@gbasin/agentboard-darwin-x64 0.2.31 → 0.2.32
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var bS=Object.defineProperty;var CS=(e,t,r)=>t in e?bS(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var rt=(e,t,r)=>CS(e,typeof t!="symbol"?t+"":t,r);function ES(e,t){for(var r=0;r<t.length;r++){const n=t[r];if(typeof n!="string"&&!Array.isArray(n)){for(const i in n)if(i!=="default"&&!(i in e)){const a=Object.getOwnPropertyDescriptor(n,i);a&&Object.defineProperty(e,i,a.get?a:{enumerable:!0,get:()=>n[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"]'))n(i);new MutationObserver(i=>{for(const a of i)if(a.type==="childList")for(const l of a.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&n(l)}).observe(document,{childList:!0,subtree:!0});function r(i){const a={};return i.integrity&&(a.integrity=i.integrity),i.referrerPolicy&&(a.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?a.credentials="include":i.crossOrigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function n(i){if(i.ep)return;i.ep=!0;const a=r(i);fetch(i.href,a)}})();function kS(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var $v={exports:{}},ec={},zv={exports:{}},
|
|
1
|
+
var bS=Object.defineProperty;var CS=(e,t,r)=>t in e?bS(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var rt=(e,t,r)=>CS(e,typeof t!="symbol"?t+"":t,r);function ES(e,t){for(var r=0;r<t.length;r++){const n=t[r];if(typeof n!="string"&&!Array.isArray(n)){for(const i in n)if(i!=="default"&&!(i in e)){const a=Object.getOwnPropertyDescriptor(n,i);a&&Object.defineProperty(e,i,a.get?a:{enumerable:!0,get:()=>n[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"]'))n(i);new MutationObserver(i=>{for(const a of i)if(a.type==="childList")for(const l of a.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&n(l)}).observe(document,{childList:!0,subtree:!0});function r(i){const a={};return i.integrity&&(a.integrity=i.integrity),i.referrerPolicy&&(a.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?a.credentials="include":i.crossOrigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function n(i){if(i.ep)return;i.ep=!0;const a=r(i);fetch(i.href,a)}})();function kS(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var $v={exports:{}},ec={},zv={exports:{}},Ke={};/**
|
|
2
2
|
* @license React
|
|
3
3
|
* react.production.min.js
|
|
4
4
|
*
|
|
@@ -6,7 +6,7 @@ var bS=Object.defineProperty;var CS=(e,t,r)=>t in e?bS(e,t,{enumerable:!0,config
|
|
|
6
6
|
*
|
|
7
7
|
* This source code is licensed under the MIT license found in the
|
|
8
8
|
* LICENSE file in the root directory of this source tree.
|
|
9
|
-
*/var qo=Symbol.for("react.element"),LS=Symbol.for("react.portal"),TS=Symbol.for("react.fragment"),RS=Symbol.for("react.strict_mode"),DS=Symbol.for("react.profiler"),MS=Symbol.for("react.provider"),AS=Symbol.for("react.context"),PS=Symbol.for("react.forward_ref"),IS=Symbol.for("react.suspense"),OS=Symbol.for("react.memo"),BS=Symbol.for("react.lazy"),kp=Symbol.iterator;function NS(e){return e===null||typeof e!="object"?null:(e=kp&&e[kp]||e["@@iterator"],typeof e=="function"?e:null)}var Uv={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Wv=Object.assign,Vv={};function wi(e,t,r){this.props=e,this.context=t,this.refs=Vv,this.updater=r||Uv}wi.prototype.isReactComponent={};wi.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")};wi.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function Kv(){}Kv.prototype=wi.prototype;function vd(e,t,r){this.props=e,this.context=t,this.refs=Vv,this.updater=r||Uv}var _d=vd.prototype=new Kv;_d.constructor=vd;Wv(_d,wi.prototype);_d.isPureReactComponent=!0;var Lp=Array.isArray,Gv=Object.prototype.hasOwnProperty,yd={current:null},qv={key:!0,ref:!0,__self:!0,__source:!0};function Xv(e,t,r){var n,i={},a=null,l=null;if(t!=null)for(n in t.ref!==void 0&&(l=t.ref),t.key!==void 0&&(a=""+t.key),t)Gv.call(t,n)&&!qv.hasOwnProperty(n)&&(i[n]=t[n]);var s=arguments.length-2;if(s===1)i.children=r;else if(1<s){for(var o=Array(s),c=0;c<s;c++)o[c]=arguments[c+2];i.children=o}if(e&&e.defaultProps)for(n in s=e.defaultProps,s)i[n]===void 0&&(i[n]=s[n]);return{$$typeof:qo,type:e,key:a,ref:l,props:i,_owner:yd.current}}function jS(e,t){return{$$typeof:qo,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function wd(e){return typeof e=="object"&&e!==null&&e.$$typeof===qo}function FS(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(r){return t[r]})}var Tp=/\/+/g;function Tc(e,t){return typeof e=="object"&&e!==null&&e.key!=null?FS(""+e.key):t.toString(36)}function Wa(e,t,r,n,i){var a=typeof e;(a==="undefined"||a==="boolean")&&(e=null);var l=!1;if(e===null)l=!0;else switch(a){case"string":case"number":l=!0;break;case"object":switch(e.$$typeof){case qo:case LS:l=!0}}if(l)return l=e,i=i(l),e=n===""?"."+Tc(l,0):n,Lp(i)?(r="",e!=null&&(r=e.replace(Tp,"$&/")+"/"),Wa(i,t,r,"",function(c){return c})):i!=null&&(wd(i)&&(i=jS(i,r+(!i.key||l&&l.key===i.key?"":(""+i.key).replace(Tp,"$&/")+"/")+e)),t.push(i)),1;if(l=0,n=n===""?".":n+":",Lp(e))for(var s=0;s<e.length;s++){a=e[s];var o=n+Tc(a,s);l+=Wa(a,t,r,o,i)}else if(o=NS(e),typeof o=="function")for(e=o.call(e),s=0;!(a=e.next()).done;)a=a.value,o=n+Tc(a,s++),l+=Wa(a,t,r,o,i);else if(a==="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 l}function ua(e,t,r){if(e==null)return e;var n=[],i=0;return Wa(e,n,"","",function(a){return t.call(r,a,i++)}),n}function HS(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(r){(e._status===0||e._status===-1)&&(e._status=1,e._result=r)},function(r){(e._status===0||e._status===-1)&&(e._status=2,e._result=r)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var tr={current:null},Va={transition:null},$S={ReactCurrentDispatcher:tr,ReactCurrentBatchConfig:Va,ReactCurrentOwner:yd};function Yv(){throw Error("act(...) is not supported in production builds of React.")}
|
|
9
|
+
*/var qo=Symbol.for("react.element"),LS=Symbol.for("react.portal"),TS=Symbol.for("react.fragment"),RS=Symbol.for("react.strict_mode"),DS=Symbol.for("react.profiler"),MS=Symbol.for("react.provider"),AS=Symbol.for("react.context"),PS=Symbol.for("react.forward_ref"),IS=Symbol.for("react.suspense"),OS=Symbol.for("react.memo"),BS=Symbol.for("react.lazy"),kp=Symbol.iterator;function NS(e){return e===null||typeof e!="object"?null:(e=kp&&e[kp]||e["@@iterator"],typeof e=="function"?e:null)}var Uv={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Wv=Object.assign,Vv={};function wi(e,t,r){this.props=e,this.context=t,this.refs=Vv,this.updater=r||Uv}wi.prototype.isReactComponent={};wi.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")};wi.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function Kv(){}Kv.prototype=wi.prototype;function vd(e,t,r){this.props=e,this.context=t,this.refs=Vv,this.updater=r||Uv}var _d=vd.prototype=new Kv;_d.constructor=vd;Wv(_d,wi.prototype);_d.isPureReactComponent=!0;var Lp=Array.isArray,Gv=Object.prototype.hasOwnProperty,yd={current:null},qv={key:!0,ref:!0,__self:!0,__source:!0};function Xv(e,t,r){var n,i={},a=null,l=null;if(t!=null)for(n in t.ref!==void 0&&(l=t.ref),t.key!==void 0&&(a=""+t.key),t)Gv.call(t,n)&&!qv.hasOwnProperty(n)&&(i[n]=t[n]);var s=arguments.length-2;if(s===1)i.children=r;else if(1<s){for(var o=Array(s),c=0;c<s;c++)o[c]=arguments[c+2];i.children=o}if(e&&e.defaultProps)for(n in s=e.defaultProps,s)i[n]===void 0&&(i[n]=s[n]);return{$$typeof:qo,type:e,key:a,ref:l,props:i,_owner:yd.current}}function jS(e,t){return{$$typeof:qo,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function wd(e){return typeof e=="object"&&e!==null&&e.$$typeof===qo}function FS(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(r){return t[r]})}var Tp=/\/+/g;function Tc(e,t){return typeof e=="object"&&e!==null&&e.key!=null?FS(""+e.key):t.toString(36)}function Wa(e,t,r,n,i){var a=typeof e;(a==="undefined"||a==="boolean")&&(e=null);var l=!1;if(e===null)l=!0;else switch(a){case"string":case"number":l=!0;break;case"object":switch(e.$$typeof){case qo:case LS:l=!0}}if(l)return l=e,i=i(l),e=n===""?"."+Tc(l,0):n,Lp(i)?(r="",e!=null&&(r=e.replace(Tp,"$&/")+"/"),Wa(i,t,r,"",function(c){return c})):i!=null&&(wd(i)&&(i=jS(i,r+(!i.key||l&&l.key===i.key?"":(""+i.key).replace(Tp,"$&/")+"/")+e)),t.push(i)),1;if(l=0,n=n===""?".":n+":",Lp(e))for(var s=0;s<e.length;s++){a=e[s];var o=n+Tc(a,s);l+=Wa(a,t,r,o,i)}else if(o=NS(e),typeof o=="function")for(e=o.call(e),s=0;!(a=e.next()).done;)a=a.value,o=n+Tc(a,s++),l+=Wa(a,t,r,o,i);else if(a==="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 l}function ua(e,t,r){if(e==null)return e;var n=[],i=0;return Wa(e,n,"","",function(a){return t.call(r,a,i++)}),n}function HS(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(r){(e._status===0||e._status===-1)&&(e._status=1,e._result=r)},function(r){(e._status===0||e._status===-1)&&(e._status=2,e._result=r)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var tr={current:null},Va={transition:null},$S={ReactCurrentDispatcher:tr,ReactCurrentBatchConfig:Va,ReactCurrentOwner:yd};function Yv(){throw Error("act(...) is not supported in production builds of React.")}Ke.Children={map:ua,forEach:function(e,t,r){ua(e,function(){t.apply(this,arguments)},r)},count:function(e){var t=0;return ua(e,function(){t++}),t},toArray:function(e){return ua(e,function(t){return t})||[]},only:function(e){if(!wd(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};Ke.Component=wi;Ke.Fragment=TS;Ke.Profiler=DS;Ke.PureComponent=vd;Ke.StrictMode=RS;Ke.Suspense=IS;Ke.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=$S;Ke.act=Yv;Ke.cloneElement=function(e,t,r){if(e==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var n=Wv({},e.props),i=e.key,a=e.ref,l=e._owner;if(t!=null){if(t.ref!==void 0&&(a=t.ref,l=yd.current),t.key!==void 0&&(i=""+t.key),e.type&&e.type.defaultProps)var s=e.type.defaultProps;for(o in t)Gv.call(t,o)&&!qv.hasOwnProperty(o)&&(n[o]=t[o]===void 0&&s!==void 0?s[o]:t[o])}var o=arguments.length-2;if(o===1)n.children=r;else if(1<o){s=Array(o);for(var c=0;c<o;c++)s[c]=arguments[c+2];n.children=s}return{$$typeof:qo,type:e.type,key:i,ref:a,props:n,_owner:l}};Ke.createContext=function(e){return e={$$typeof:AS,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:MS,_context:e},e.Consumer=e};Ke.createElement=Xv;Ke.createFactory=function(e){var t=Xv.bind(null,e);return t.type=e,t};Ke.createRef=function(){return{current:null}};Ke.forwardRef=function(e){return{$$typeof:PS,render:e}};Ke.isValidElement=wd;Ke.lazy=function(e){return{$$typeof:BS,_payload:{_status:-1,_result:e},_init:HS}};Ke.memo=function(e,t){return{$$typeof:OS,type:e,compare:t===void 0?null:t}};Ke.startTransition=function(e){var t=Va.transition;Va.transition={};try{e()}finally{Va.transition=t}};Ke.unstable_act=Yv;Ke.useCallback=function(e,t){return tr.current.useCallback(e,t)};Ke.useContext=function(e){return tr.current.useContext(e)};Ke.useDebugValue=function(){};Ke.useDeferredValue=function(e){return tr.current.useDeferredValue(e)};Ke.useEffect=function(e,t){return tr.current.useEffect(e,t)};Ke.useId=function(){return tr.current.useId()};Ke.useImperativeHandle=function(e,t,r){return tr.current.useImperativeHandle(e,t,r)};Ke.useInsertionEffect=function(e,t){return tr.current.useInsertionEffect(e,t)};Ke.useLayoutEffect=function(e,t){return tr.current.useLayoutEffect(e,t)};Ke.useMemo=function(e,t){return tr.current.useMemo(e,t)};Ke.useReducer=function(e,t,r){return tr.current.useReducer(e,t,r)};Ke.useRef=function(e){return tr.current.useRef(e)};Ke.useState=function(e){return tr.current.useState(e)};Ke.useSyncExternalStore=function(e,t,r){return tr.current.useSyncExternalStore(e,t,r)};Ke.useTransition=function(){return tr.current.useTransition()};Ke.version="18.3.1";zv.exports=Ke;var E=zv.exports;const gt=kS(E),Jv=ES({__proto__:null,default:gt},[E]);/**
|
|
10
10
|
* @license React
|
|
11
11
|
* react-jsx-runtime.production.min.js
|
|
12
12
|
*
|
|
@@ -30,14 +30,14 @@ var bS=Object.defineProperty;var CS=(e,t,r)=>t in e?bS(e,t,{enumerable:!0,config
|
|
|
30
30
|
*
|
|
31
31
|
* This source code is licensed under the MIT license found in the
|
|
32
32
|
* LICENSE file in the root directory of this source tree.
|
|
33
|
-
*/var XS=E,fr=qS;function
|
|
33
|
+
*/var XS=E,fr=qS;function he(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,r=1;r<arguments.length;r++)t+="&args[]="+encodeURIComponent(arguments[r]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var r_=new Set,yo={};function Cs(e,t){ci(e,t),ci(e+"Capture",t)}function ci(e,t){for(yo[e]=t,e=0;e<t.length;e++)r_.add(t[e])}var pn=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Ou=Object.prototype.hasOwnProperty,YS=/^[: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]*$/,Rp={},Dp={};function JS(e){return Ou.call(Dp,e)?!0:Ou.call(Rp,e)?!1:YS.test(e)?Dp[e]=!0:(Rp[e]=!0,!1)}function QS(e,t,r,n){if(r!==null&&r.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return n?!1:r!==null?!r.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function ZS(e,t,r,n){if(t===null||typeof t>"u"||QS(e,t,r,n))return!0;if(n)return!1;if(r!==null)switch(r.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function rr(e,t,r,n,i,a,l){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=n,this.attributeNamespace=i,this.mustUseProperty=r,this.propertyName=e,this.type=t,this.sanitizeURL=a,this.removeEmptyString=l}var Ht={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){Ht[e]=new rr(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];Ht[t]=new rr(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){Ht[e]=new rr(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){Ht[e]=new rr(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){Ht[e]=new rr(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){Ht[e]=new rr(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){Ht[e]=new rr(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){Ht[e]=new rr(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){Ht[e]=new rr(e,5,!1,e.toLowerCase(),null,!1,!1)});var Sd=/[\-:]([a-z])/g;function xd(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(Sd,xd);Ht[t]=new rr(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(Sd,xd);Ht[t]=new rr(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(Sd,xd);Ht[t]=new rr(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){Ht[e]=new rr(e,1,!1,e.toLowerCase(),null,!1,!1)});Ht.xlinkHref=new rr("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){Ht[e]=new rr(e,1,!1,e.toLowerCase(),null,!0,!0)});function bd(e,t,r,n){var i=Ht.hasOwnProperty(t)?Ht[t]:null;(i!==null?i.type!==0:n||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(ZS(t,r,i,n)&&(r=null),n||i===null?JS(t)&&(r===null?e.removeAttribute(t):e.setAttribute(t,""+r)):i.mustUseProperty?e[i.propertyName]=r===null?i.type===3?!1:"":r:(t=i.attributeName,n=i.attributeNamespace,r===null?e.removeAttribute(t):(i=i.type,r=i===3||i===4&&r===!0?"":""+r,n?e.setAttributeNS(n,t,r):e.setAttribute(t,r))))}var yn=XS.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,ha=Symbol.for("react.element"),Os=Symbol.for("react.portal"),Bs=Symbol.for("react.fragment"),Cd=Symbol.for("react.strict_mode"),Bu=Symbol.for("react.profiler"),n_=Symbol.for("react.provider"),s_=Symbol.for("react.context"),Ed=Symbol.for("react.forward_ref"),Nu=Symbol.for("react.suspense"),ju=Symbol.for("react.suspense_list"),kd=Symbol.for("react.memo"),Ln=Symbol.for("react.lazy"),i_=Symbol.for("react.offscreen"),Mp=Symbol.iterator;function Ai(e){return e===null||typeof e!="object"?null:(e=Mp&&e[Mp]||e["@@iterator"],typeof e=="function"?e:null)}var ut=Object.assign,Rc;function Vi(e){if(Rc===void 0)try{throw Error()}catch(r){var t=r.stack.trim().match(/\n( *(at )?)/);Rc=t&&t[1]||""}return`
|
|
34
34
|
`+Rc+e}var Dc=!1;function Mc(e,t){if(!e||Dc)return"";Dc=!0;var r=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(t,[])}catch(c){var n=c}Reflect.construct(e,[],t)}else{try{t.call()}catch(c){n=c}e.call(t.prototype)}else{try{throw Error()}catch(c){n=c}e()}}catch(c){if(c&&n&&typeof c.stack=="string"){for(var i=c.stack.split(`
|
|
35
35
|
`),a=n.stack.split(`
|
|
36
36
|
`),l=i.length-1,s=a.length-1;1<=l&&0<=s&&i[l]!==a[s];)s--;for(;1<=l&&0<=s;l--,s--)if(i[l]!==a[s]){if(l!==1||s!==1)do if(l--,s--,0>s||i[l]!==a[s]){var o=`
|
|
37
|
-
`+i[l].replace(" at new "," at ");return e.displayName&&o.includes("<anonymous>")&&(o=o.replace("<anonymous>",e.displayName)),o}while(1<=l&&0<=s);break}}}finally{Dc=!1,Error.prepareStackTrace=r}return(e=e?e.displayName||e.name:"")?Vi(e):""}function ex(e){switch(e.tag){case 5:return Vi(e.type);case 16:return Vi("Lazy");case 13:return Vi("Suspense");case 19:return Vi("SuspenseList");case 0:case 2:case 15:return e=Mc(e.type,!1),e;case 11:return e=Mc(e.type.render,!1),e;case 1:return e=Mc(e.type,!0),e;default:return""}}function Fu(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 Bs:return"Fragment";case Os:return"Portal";case Bu:return"Profiler";case Cd:return"StrictMode";case Nu:return"Suspense";case ju:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case s_:return(e.displayName||"Context")+".Consumer";case n_:return(e._context.displayName||"Context")+".Provider";case Ed:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case kd:return t=e.displayName||null,t!==null?t:Fu(e.type)||"Memo";case Ln:t=e._payload,e=e._init;try{return Fu(e(t))}catch{}}return null}function tx(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 Fu(t);case 8:return t===Cd?"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 Un(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function o_(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function rx(e){var t=o_(e)?"checked":"value",r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),n=""+e[t];if(!e.hasOwnProperty(t)&&typeof r<"u"&&typeof r.get=="function"&&typeof r.set=="function"){var i=r.get,a=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(l){n=""+l,a.call(this,l)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(l){n=""+l},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function da(e){e._valueTracker||(e._valueTracker=rx(e))}function a_(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var r=t.getValue(),n="";return e&&(n=o_(e)?e.checked?"true":"false":e.value),e=n,e!==r?(t.setValue(e),!0):!1}function hl(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 Hu(e,t){var r=t.checked;return ut({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:r??e._wrapperState.initialChecked})}function Ap(e,t){var r=t.defaultValue==null?"":t.defaultValue,n=t.checked!=null?t.checked:t.defaultChecked;r=Un(t.value!=null?t.value:r),e._wrapperState={initialChecked:n,initialValue:r,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function l_(e,t){t=t.checked,t!=null&&bd(e,"checked",t,!1)}function $u(e,t){l_(e,t);var r=Un(t.value),n=t.type;if(r!=null)n==="number"?(r===0&&e.value===""||e.value!=r)&&(e.value=""+r):e.value!==""+r&&(e.value=""+r);else if(n==="submit"||n==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?zu(e,t.type,r):t.hasOwnProperty("defaultValue")&&zu(e,t.type,Un(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Pp(e,t,r){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var n=t.type;if(!(n!=="submit"&&n!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,r||t===e.value||(e.value=t),e.defaultValue=t}r=e.name,r!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,r!==""&&(e.name=r)}function zu(e,t,r){(t!=="number"||hl(e.ownerDocument)!==e)&&(r==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+r&&(e.defaultValue=""+r))}var Ki=Array.isArray;function Qs(e,t,r,n){if(e=e.options,t){t={};for(var i=0;i<r.length;i++)t["$"+r[i]]=!0;for(r=0;r<e.length;r++)i=t.hasOwnProperty("$"+e[r].value),e[r].selected!==i&&(e[r].selected=i),i&&n&&(e[r].defaultSelected=!0)}else{for(r=""+Un(r),t=null,i=0;i<e.length;i++){if(e[i].value===r){e[i].selected=!0,n&&(e[i].defaultSelected=!0);return}t!==null||e[i].disabled||(t=e[i])}t!==null&&(t.selected=!0)}}function Uu(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(ce(91));return ut({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function Ip(e,t){var r=t.value;if(r==null){if(r=t.children,t=t.defaultValue,r!=null){if(t!=null)throw Error(ce(92));if(Ki(r)){if(1<r.length)throw Error(ce(93));r=r[0]}t=r}t==null&&(t=""),r=t}e._wrapperState={initialValue:Un(r)}}function c_(e,t){var r=Un(t.value),n=Un(t.defaultValue);r!=null&&(r=""+r,r!==e.value&&(e.value=r),t.defaultValue==null&&e.defaultValue!==r&&(e.defaultValue=r)),n!=null&&(e.defaultValue=""+n)}function Op(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function u_(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 Wu(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?u_(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var fa,h_=function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,r,n,i){MSApp.execUnsafeLocalFunction(function(){return e(t,r,n,i)})}:e}(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(fa=fa||document.createElement("div"),fa.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=fa.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function wo(e,t){if(t){var r=e.firstChild;if(r&&r===e.lastChild&&r.nodeType===3){r.nodeValue=t;return}}e.textContent=t}var Zi={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},nx=["Webkit","ms","Moz","O"];Object.keys(Zi).forEach(function(e){nx.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Zi[t]=Zi[e]})});function d_(e,t,r){return t==null||typeof t=="boolean"||t===""?"":r||typeof t!="number"||t===0||Zi.hasOwnProperty(e)&&Zi[e]?(""+t).trim():t+"px"}function f_(e,t){e=e.style;for(var r in t)if(t.hasOwnProperty(r)){var n=r.indexOf("--")===0,i=d_(r,t[r],n);r==="float"&&(r="cssFloat"),n?e.setProperty(r,i):e[r]=i}}var sx=ut({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 Vu(e,t){if(t){if(sx[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(ce(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(ce(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(ce(61))}if(t.style!=null&&typeof t.style!="object")throw Error(ce(62))}}function Ku(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 Gu=null;function Ld(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var qu=null,Zs=null,ei=null;function Bp(e){if(e=Jo(e)){if(typeof qu!="function")throw Error(ce(280));var t=e.stateNode;t&&(t=ic(t),qu(e.stateNode,e.type,t))}}function p_(e){Zs?ei?ei.push(e):ei=[e]:Zs=e}function m_(){if(Zs){var e=Zs,t=ei;if(ei=Zs=null,Bp(e),t)for(e=0;e<t.length;e++)Bp(t[e])}}function g_(e,t){return e(t)}function v_(){}var Ac=!1;function __(e,t,r){if(Ac)return e(t,r);Ac=!0;try{return g_(e,t,r)}finally{Ac=!1,(Zs!==null||ei!==null)&&(v_(),m_())}}function So(e,t){var r=e.stateNode;if(r===null)return null;var n=ic(r);if(n===null)return null;r=n[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":(n=!n.disabled)||(e=e.type,n=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!n;break e;default:e=!1}if(e)return null;if(r&&typeof r!="function")throw Error(ce(231,t,typeof r));return r}var Xu=!1;if(pn)try{var Pi={};Object.defineProperty(Pi,"passive",{get:function(){Xu=!0}}),window.addEventListener("test",Pi,Pi),window.removeEventListener("test",Pi,Pi)}catch{Xu=!1}function ix(e,t,r,n,i,a,l,s,o){var c=Array.prototype.slice.call(arguments,3);try{t.apply(r,c)}catch(f){this.onError(f)}}var eo=!1,dl=null,fl=!1,Yu=null,ox={onError:function(e){eo=!0,dl=e}};function ax(e,t,r,n,i,a,l,s,o){eo=!1,dl=null,ix.apply(ox,arguments)}function lx(e,t,r,n,i,a,l,s,o){if(ax.apply(this,arguments),eo){if(eo){var c=dl;eo=!1,dl=null}else throw Error(ce(198));fl||(fl=!0,Yu=c)}}function Es(e){var t=e,r=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(r=t.return),e=t.return;while(e)}return t.tag===3?r:null}function y_(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 Np(e){if(Es(e)!==e)throw Error(ce(188))}function cx(e){var t=e.alternate;if(!t){if(t=Es(e),t===null)throw Error(ce(188));return t!==e?null:e}for(var r=e,n=t;;){var i=r.return;if(i===null)break;var a=i.alternate;if(a===null){if(n=i.return,n!==null){r=n;continue}break}if(i.child===a.child){for(a=i.child;a;){if(a===r)return Np(i),e;if(a===n)return Np(i),t;a=a.sibling}throw Error(ce(188))}if(r.return!==n.return)r=i,n=a;else{for(var l=!1,s=i.child;s;){if(s===r){l=!0,r=i,n=a;break}if(s===n){l=!0,n=i,r=a;break}s=s.sibling}if(!l){for(s=a.child;s;){if(s===r){l=!0,r=a,n=i;break}if(s===n){l=!0,n=a,r=i;break}s=s.sibling}if(!l)throw Error(ce(189))}}if(r.alternate!==n)throw Error(ce(190))}if(r.tag!==3)throw Error(ce(188));return r.stateNode.current===r?e:t}function w_(e){return e=cx(e),e!==null?S_(e):null}function S_(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=S_(e);if(t!==null)return t;e=e.sibling}return null}var x_=fr.unstable_scheduleCallback,jp=fr.unstable_cancelCallback,ux=fr.unstable_shouldYield,hx=fr.unstable_requestPaint,pt=fr.unstable_now,dx=fr.unstable_getCurrentPriorityLevel,Td=fr.unstable_ImmediatePriority,b_=fr.unstable_UserBlockingPriority,pl=fr.unstable_NormalPriority,fx=fr.unstable_LowPriority,C_=fr.unstable_IdlePriority,tc=null,Ur=null;function px(e){if(Ur&&typeof Ur.onCommitFiberRoot=="function")try{Ur.onCommitFiberRoot(tc,e,void 0,(e.current.flags&128)===128)}catch{}}var Or=Math.clz32?Math.clz32:vx,mx=Math.log,gx=Math.LN2;function vx(e){return e>>>=0,e===0?32:31-(mx(e)/gx|0)|0}var pa=64,ma=4194304;function Gi(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 ml(e,t){var r=e.pendingLanes;if(r===0)return 0;var n=0,i=e.suspendedLanes,a=e.pingedLanes,l=r&268435455;if(l!==0){var s=l&~i;s!==0?n=Gi(s):(a&=l,a!==0&&(n=Gi(a)))}else l=r&~i,l!==0?n=Gi(l):a!==0&&(n=Gi(a));if(n===0)return 0;if(t!==0&&t!==n&&!(t&i)&&(i=n&-n,a=t&-t,i>=a||i===16&&(a&4194240)!==0))return t;if(n&4&&(n|=r&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=n;0<t;)r=31-Or(t),i=1<<r,n|=e[r],t&=~i;return n}function _x(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 yx(e,t){for(var r=e.suspendedLanes,n=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes;0<a;){var l=31-Or(a),s=1<<l,o=i[l];o===-1?(!(s&r)||s&n)&&(i[l]=_x(s,t)):o<=t&&(e.expiredLanes|=s),a&=~s}}function Ju(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function E_(){var e=pa;return pa<<=1,!(pa&4194240)&&(pa=64),e}function Pc(e){for(var t=[],r=0;31>r;r++)t.push(e);return t}function Xo(e,t,r){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Or(t),e[t]=r}function wx(e,t){var r=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var n=e.eventTimes;for(e=e.expirationTimes;0<r;){var i=31-Or(r),a=1<<i;t[i]=0,n[i]=-1,e[i]=-1,r&=~a}}function Rd(e,t){var r=e.entangledLanes|=t;for(e=e.entanglements;r;){var n=31-Or(r),i=1<<n;i&t|e[n]&t&&(e[n]|=t),r&=~i}}var Qe=0;function k_(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var L_,Dd,T_,R_,D_,Qu=!1,ga=[],On=null,Bn=null,Nn=null,xo=new Map,bo=new Map,Dn=[],Sx="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 Fp(e,t){switch(e){case"focusin":case"focusout":On=null;break;case"dragenter":case"dragleave":Bn=null;break;case"mouseover":case"mouseout":Nn=null;break;case"pointerover":case"pointerout":xo.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":bo.delete(t.pointerId)}}function Ii(e,t,r,n,i,a){return e===null||e.nativeEvent!==a?(e={blockedOn:t,domEventName:r,eventSystemFlags:n,nativeEvent:a,targetContainers:[i]},t!==null&&(t=Jo(t),t!==null&&Dd(t)),e):(e.eventSystemFlags|=n,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function xx(e,t,r,n,i){switch(t){case"focusin":return On=Ii(On,e,t,r,n,i),!0;case"dragenter":return Bn=Ii(Bn,e,t,r,n,i),!0;case"mouseover":return Nn=Ii(Nn,e,t,r,n,i),!0;case"pointerover":var a=i.pointerId;return xo.set(a,Ii(xo.get(a)||null,e,t,r,n,i)),!0;case"gotpointercapture":return a=i.pointerId,bo.set(a,Ii(bo.get(a)||null,e,t,r,n,i)),!0}return!1}function M_(e){var t=ls(e.target);if(t!==null){var r=Es(t);if(r!==null){if(t=r.tag,t===13){if(t=y_(r),t!==null){e.blockedOn=t,D_(e.priority,function(){T_(r)});return}}else if(t===3&&r.stateNode.current.memoizedState.isDehydrated){e.blockedOn=r.tag===3?r.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Ka(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var r=Zu(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(r===null){r=e.nativeEvent;var n=new r.constructor(r.type,r);Gu=n,r.target.dispatchEvent(n),Gu=null}else return t=Jo(r),t!==null&&Dd(t),e.blockedOn=r,!1;t.shift()}return!0}function Hp(e,t,r){Ka(e)&&r.delete(t)}function bx(){Qu=!1,On!==null&&Ka(On)&&(On=null),Bn!==null&&Ka(Bn)&&(Bn=null),Nn!==null&&Ka(Nn)&&(Nn=null),xo.forEach(Hp),bo.forEach(Hp)}function Oi(e,t){e.blockedOn===t&&(e.blockedOn=null,Qu||(Qu=!0,fr.unstable_scheduleCallback(fr.unstable_NormalPriority,bx)))}function Co(e){function t(i){return Oi(i,e)}if(0<ga.length){Oi(ga[0],e);for(var r=1;r<ga.length;r++){var n=ga[r];n.blockedOn===e&&(n.blockedOn=null)}}for(On!==null&&Oi(On,e),Bn!==null&&Oi(Bn,e),Nn!==null&&Oi(Nn,e),xo.forEach(t),bo.forEach(t),r=0;r<Dn.length;r++)n=Dn[r],n.blockedOn===e&&(n.blockedOn=null);for(;0<Dn.length&&(r=Dn[0],r.blockedOn===null);)M_(r),r.blockedOn===null&&Dn.shift()}var ti=yn.ReactCurrentBatchConfig,gl=!0;function Cx(e,t,r,n){var i=Qe,a=ti.transition;ti.transition=null;try{Qe=1,Md(e,t,r,n)}finally{Qe=i,ti.transition=a}}function Ex(e,t,r,n){var i=Qe,a=ti.transition;ti.transition=null;try{Qe=4,Md(e,t,r,n)}finally{Qe=i,ti.transition=a}}function Md(e,t,r,n){if(gl){var i=Zu(e,t,r,n);if(i===null)Uc(e,t,n,vl,r),Fp(e,n);else if(xx(i,e,t,r,n))n.stopPropagation();else if(Fp(e,n),t&4&&-1<Sx.indexOf(e)){for(;i!==null;){var a=Jo(i);if(a!==null&&L_(a),a=Zu(e,t,r,n),a===null&&Uc(e,t,n,vl,r),a===i)break;i=a}i!==null&&n.stopPropagation()}else Uc(e,t,n,null,r)}}var vl=null;function Zu(e,t,r,n){if(vl=null,e=Ld(n),e=ls(e),e!==null)if(t=Es(e),t===null)e=null;else if(r=t.tag,r===13){if(e=y_(t),e!==null)return e;e=null}else if(r===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null);return vl=e,null}function A_(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(dx()){case Td:return 1;case b_:return 4;case pl:case fx:return 16;case C_:return 536870912;default:return 16}default:return 16}}var An=null,Ad=null,Ga=null;function P_(){if(Ga)return Ga;var e,t=Ad,r=t.length,n,i="value"in An?An.value:An.textContent,a=i.length;for(e=0;e<r&&t[e]===i[e];e++);var l=r-e;for(n=1;n<=l&&t[r-n]===i[a-n];n++);return Ga=i.slice(e,1<n?1-n:void 0)}function qa(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 va(){return!0}function $p(){return!1}function mr(e){function t(r,n,i,a,l){this._reactName=r,this._targetInst=i,this.type=n,this.nativeEvent=a,this.target=l,this.currentTarget=null;for(var s in e)e.hasOwnProperty(s)&&(r=e[s],this[s]=r?r(a):a[s]);return this.isDefaultPrevented=(a.defaultPrevented!=null?a.defaultPrevented:a.returnValue===!1)?va:$p,this.isPropagationStopped=$p,this}return ut(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var r=this.nativeEvent;r&&(r.preventDefault?r.preventDefault():typeof r.returnValue!="unknown"&&(r.returnValue=!1),this.isDefaultPrevented=va)},stopPropagation:function(){var r=this.nativeEvent;r&&(r.stopPropagation?r.stopPropagation():typeof r.cancelBubble!="unknown"&&(r.cancelBubble=!0),this.isPropagationStopped=va)},persist:function(){},isPersistent:va}),t}var Si={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Pd=mr(Si),Yo=ut({},Si,{view:0,detail:0}),kx=mr(Yo),Ic,Oc,Bi,rc=ut({},Yo,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Id,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!==Bi&&(Bi&&e.type==="mousemove"?(Ic=e.screenX-Bi.screenX,Oc=e.screenY-Bi.screenY):Oc=Ic=0,Bi=e),Ic)},movementY:function(e){return"movementY"in e?e.movementY:Oc}}),zp=mr(rc),Lx=ut({},rc,{dataTransfer:0}),Tx=mr(Lx),Rx=ut({},Yo,{relatedTarget:0}),Bc=mr(Rx),Dx=ut({},Si,{animationName:0,elapsedTime:0,pseudoElement:0}),Mx=mr(Dx),Ax=ut({},Si,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),Px=mr(Ax),Ix=ut({},Si,{data:0}),Up=mr(Ix),Ox={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Bx={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"},Nx={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function jx(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Nx[e])?!!t[e]:!1}function Id(){return jx}var Fx=ut({},Yo,{key:function(e){if(e.key){var t=Ox[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=qa(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?Bx[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Id,charCode:function(e){return e.type==="keypress"?qa(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?qa(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),Hx=mr(Fx),$x=ut({},rc,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Wp=mr($x),zx=ut({},Yo,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Id}),Ux=mr(zx),Wx=ut({},Si,{propertyName:0,elapsedTime:0,pseudoElement:0}),Vx=mr(Wx),Kx=ut({},rc,{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}),Gx=mr(Kx),qx=[9,13,27,32],Od=pn&&"CompositionEvent"in window,to=null;pn&&"documentMode"in document&&(to=document.documentMode);var Xx=pn&&"TextEvent"in window&&!to,I_=pn&&(!Od||to&&8<to&&11>=to),Vp=" ",Kp=!1;function O_(e,t){switch(e){case"keyup":return qx.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function B_(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Ns=!1;function Yx(e,t){switch(e){case"compositionend":return B_(t);case"keypress":return t.which!==32?null:(Kp=!0,Vp);case"textInput":return e=t.data,e===Vp&&Kp?null:e;default:return null}}function Jx(e,t){if(Ns)return e==="compositionend"||!Od&&O_(e,t)?(e=P_(),Ga=Ad=An=null,Ns=!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 I_&&t.locale!=="ko"?null:t.data;default:return null}}var Qx={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 Gp(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!Qx[e.type]:t==="textarea"}function N_(e,t,r,n){p_(n),t=_l(t,"onChange"),0<t.length&&(r=new Pd("onChange","change",null,r,n),e.push({event:r,listeners:t}))}var ro=null,Eo=null;function Zx(e){q_(e,0)}function nc(e){var t=Hs(e);if(a_(t))return e}function eb(e,t){if(e==="change")return t}var j_=!1;if(pn){var Nc;if(pn){var jc="oninput"in document;if(!jc){var qp=document.createElement("div");qp.setAttribute("oninput","return;"),jc=typeof qp.oninput=="function"}Nc=jc}else Nc=!1;j_=Nc&&(!document.documentMode||9<document.documentMode)}function Xp(){ro&&(ro.detachEvent("onpropertychange",F_),Eo=ro=null)}function F_(e){if(e.propertyName==="value"&&nc(Eo)){var t=[];N_(t,Eo,e,Ld(e)),__(Zx,t)}}function tb(e,t,r){e==="focusin"?(Xp(),ro=t,Eo=r,ro.attachEvent("onpropertychange",F_)):e==="focusout"&&Xp()}function rb(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return nc(Eo)}function nb(e,t){if(e==="click")return nc(t)}function sb(e,t){if(e==="input"||e==="change")return nc(t)}function ib(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Nr=typeof Object.is=="function"?Object.is:ib;function ko(e,t){if(Nr(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var r=Object.keys(e),n=Object.keys(t);if(r.length!==n.length)return!1;for(n=0;n<r.length;n++){var i=r[n];if(!Ou.call(t,i)||!Nr(e[i],t[i]))return!1}return!0}function Yp(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Jp(e,t){var r=Yp(e);e=0;for(var n;r;){if(r.nodeType===3){if(n=e+r.textContent.length,e<=t&&n>=t)return{node:r,offset:t-e};e=n}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=Yp(r)}}function H_(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?H_(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function $_(){for(var e=window,t=hl();t instanceof e.HTMLIFrameElement;){try{var r=typeof t.contentWindow.location.href=="string"}catch{r=!1}if(r)e=t.contentWindow;else break;t=hl(e.document)}return t}function Bd(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 ob(e){var t=$_(),r=e.focusedElem,n=e.selectionRange;if(t!==r&&r&&r.ownerDocument&&H_(r.ownerDocument.documentElement,r)){if(n!==null&&Bd(r)){if(t=n.start,e=n.end,e===void 0&&(e=t),"selectionStart"in r)r.selectionStart=t,r.selectionEnd=Math.min(e,r.value.length);else if(e=(t=r.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var i=r.textContent.length,a=Math.min(n.start,i);n=n.end===void 0?a:Math.min(n.end,i),!e.extend&&a>n&&(i=n,n=a,a=i),i=Jp(r,a);var l=Jp(r,n);i&&l&&(e.rangeCount!==1||e.anchorNode!==i.node||e.anchorOffset!==i.offset||e.focusNode!==l.node||e.focusOffset!==l.offset)&&(t=t.createRange(),t.setStart(i.node,i.offset),e.removeAllRanges(),a>n?(e.addRange(t),e.extend(l.node,l.offset)):(t.setEnd(l.node,l.offset),e.addRange(t)))}}for(t=[],e=r;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof r.focus=="function"&&r.focus(),r=0;r<t.length;r++)e=t[r],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var ab=pn&&"documentMode"in document&&11>=document.documentMode,js=null,eh=null,no=null,th=!1;function Qp(e,t,r){var n=r.window===r?r.document:r.nodeType===9?r:r.ownerDocument;th||js==null||js!==hl(n)||(n=js,"selectionStart"in n&&Bd(n)?n={start:n.selectionStart,end:n.selectionEnd}:(n=(n.ownerDocument&&n.ownerDocument.defaultView||window).getSelection(),n={anchorNode:n.anchorNode,anchorOffset:n.anchorOffset,focusNode:n.focusNode,focusOffset:n.focusOffset}),no&&ko(no,n)||(no=n,n=_l(eh,"onSelect"),0<n.length&&(t=new Pd("onSelect","select",null,t,r),e.push({event:t,listeners:n}),t.target=js)))}function _a(e,t){var r={};return r[e.toLowerCase()]=t.toLowerCase(),r["Webkit"+e]="webkit"+t,r["Moz"+e]="moz"+t,r}var Fs={animationend:_a("Animation","AnimationEnd"),animationiteration:_a("Animation","AnimationIteration"),animationstart:_a("Animation","AnimationStart"),transitionend:_a("Transition","TransitionEnd")},Fc={},z_={};pn&&(z_=document.createElement("div").style,"AnimationEvent"in window||(delete Fs.animationend.animation,delete Fs.animationiteration.animation,delete Fs.animationstart.animation),"TransitionEvent"in window||delete Fs.transitionend.transition);function sc(e){if(Fc[e])return Fc[e];if(!Fs[e])return e;var t=Fs[e],r;for(r in t)if(t.hasOwnProperty(r)&&r in z_)return Fc[e]=t[r];return e}var U_=sc("animationend"),W_=sc("animationiteration"),V_=sc("animationstart"),K_=sc("transitionend"),G_=new Map,Zp="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 Gn(e,t){G_.set(e,t),Cs(t,[e])}for(var Hc=0;Hc<Zp.length;Hc++){var $c=Zp[Hc],lb=$c.toLowerCase(),cb=$c[0].toUpperCase()+$c.slice(1);Gn(lb,"on"+cb)}Gn(U_,"onAnimationEnd");Gn(W_,"onAnimationIteration");Gn(V_,"onAnimationStart");Gn("dblclick","onDoubleClick");Gn("focusin","onFocus");Gn("focusout","onBlur");Gn(K_,"onTransitionEnd");ci("onMouseEnter",["mouseout","mouseover"]);ci("onMouseLeave",["mouseout","mouseover"]);ci("onPointerEnter",["pointerout","pointerover"]);ci("onPointerLeave",["pointerout","pointerover"]);Cs("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));Cs("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));Cs("onBeforeInput",["compositionend","keypress","textInput","paste"]);Cs("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));Cs("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));Cs("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var qi="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(" "),ub=new Set("cancel close invalid load scroll toggle".split(" ").concat(qi));function em(e,t,r){var n=e.type||"unknown-event";e.currentTarget=r,lx(n,t,void 0,e),e.currentTarget=null}function q_(e,t){t=(t&4)!==0;for(var r=0;r<e.length;r++){var n=e[r],i=n.event;n=n.listeners;e:{var a=void 0;if(t)for(var l=n.length-1;0<=l;l--){var s=n[l],o=s.instance,c=s.currentTarget;if(s=s.listener,o!==a&&i.isPropagationStopped())break e;em(i,s,c),a=o}else for(l=0;l<n.length;l++){if(s=n[l],o=s.instance,c=s.currentTarget,s=s.listener,o!==a&&i.isPropagationStopped())break e;em(i,s,c),a=o}}}if(fl)throw e=Yu,fl=!1,Yu=null,e}function nt(e,t){var r=t[oh];r===void 0&&(r=t[oh]=new Set);var n=e+"__bubble";r.has(n)||(X_(t,e,2,!1),r.add(n))}function zc(e,t,r){var n=0;t&&(n|=4),X_(r,e,n,t)}var ya="_reactListening"+Math.random().toString(36).slice(2);function Lo(e){if(!e[ya]){e[ya]=!0,r_.forEach(function(r){r!=="selectionchange"&&(ub.has(r)||zc(r,!1,e),zc(r,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[ya]||(t[ya]=!0,zc("selectionchange",!1,t))}}function X_(e,t,r,n){switch(A_(t)){case 1:var i=Cx;break;case 4:i=Ex;break;default:i=Md}r=i.bind(null,t,r,e),i=void 0,!Xu||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(i=!0),n?i!==void 0?e.addEventListener(t,r,{capture:!0,passive:i}):e.addEventListener(t,r,!0):i!==void 0?e.addEventListener(t,r,{passive:i}):e.addEventListener(t,r,!1)}function Uc(e,t,r,n,i){var a=n;if(!(t&1)&&!(t&2)&&n!==null)e:for(;;){if(n===null)return;var l=n.tag;if(l===3||l===4){var s=n.stateNode.containerInfo;if(s===i||s.nodeType===8&&s.parentNode===i)break;if(l===4)for(l=n.return;l!==null;){var o=l.tag;if((o===3||o===4)&&(o=l.stateNode.containerInfo,o===i||o.nodeType===8&&o.parentNode===i))return;l=l.return}for(;s!==null;){if(l=ls(s),l===null)return;if(o=l.tag,o===5||o===6){n=a=l;continue e}s=s.parentNode}}n=n.return}__(function(){var c=a,f=Ld(r),u=[];e:{var p=G_.get(e);if(p!==void 0){var _=Pd,y=e;switch(e){case"keypress":if(qa(r)===0)break e;case"keydown":case"keyup":_=Hx;break;case"focusin":y="focus",_=Bc;break;case"focusout":y="blur",_=Bc;break;case"beforeblur":case"afterblur":_=Bc;break;case"click":if(r.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":_=zp;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":_=Tx;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":_=Ux;break;case U_:case W_:case V_:_=Mx;break;case K_:_=Vx;break;case"scroll":_=kx;break;case"wheel":_=Gx;break;case"copy":case"cut":case"paste":_=Px;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":_=Wp}var v=(t&4)!==0,h=!v&&e==="scroll",m=v?p!==null?p+"Capture":null:p;v=[];for(var d=c,g;d!==null;){g=d;var w=g.stateNode;if(g.tag===5&&w!==null&&(g=w,m!==null&&(w=So(d,m),w!=null&&v.push(To(d,w,g)))),h)break;d=d.return}0<v.length&&(p=new _(p,y,null,r,f),u.push({event:p,listeners:v}))}}if(!(t&7)){e:{if(p=e==="mouseover"||e==="pointerover",_=e==="mouseout"||e==="pointerout",p&&r!==Gu&&(y=r.relatedTarget||r.fromElement)&&(ls(y)||y[mn]))break e;if((_||p)&&(p=f.window===f?f:(p=f.ownerDocument)?p.defaultView||p.parentWindow:window,_?(y=r.relatedTarget||r.toElement,_=c,y=y?ls(y):null,y!==null&&(h=Es(y),y!==h||y.tag!==5&&y.tag!==6)&&(y=null)):(_=null,y=c),_!==y)){if(v=zp,w="onMouseLeave",m="onMouseEnter",d="mouse",(e==="pointerout"||e==="pointerover")&&(v=Wp,w="onPointerLeave",m="onPointerEnter",d="pointer"),h=_==null?p:Hs(_),g=y==null?p:Hs(y),p=new v(w,d+"leave",_,r,f),p.target=h,p.relatedTarget=g,w=null,ls(f)===c&&(v=new v(m,d+"enter",y,r,f),v.target=g,v.relatedTarget=h,w=v),h=w,_&&y)t:{for(v=_,m=y,d=0,g=v;g;g=As(g))d++;for(g=0,w=m;w;w=As(w))g++;for(;0<d-g;)v=As(v),d--;for(;0<g-d;)m=As(m),g--;for(;d--;){if(v===m||m!==null&&v===m.alternate)break t;v=As(v),m=As(m)}v=null}else v=null;_!==null&&tm(u,p,_,v,!1),y!==null&&h!==null&&tm(u,h,y,v,!0)}}e:{if(p=c?Hs(c):window,_=p.nodeName&&p.nodeName.toLowerCase(),_==="select"||_==="input"&&p.type==="file")var b=eb;else if(Gp(p))if(j_)b=sb;else{b=rb;var x=tb}else(_=p.nodeName)&&_.toLowerCase()==="input"&&(p.type==="checkbox"||p.type==="radio")&&(b=nb);if(b&&(b=b(e,c))){N_(u,b,r,f);break e}x&&x(e,p,c),e==="focusout"&&(x=p._wrapperState)&&x.controlled&&p.type==="number"&&zu(p,"number",p.value)}switch(x=c?Hs(c):window,e){case"focusin":(Gp(x)||x.contentEditable==="true")&&(js=x,eh=c,no=null);break;case"focusout":no=eh=js=null;break;case"mousedown":th=!0;break;case"contextmenu":case"mouseup":case"dragend":th=!1,Qp(u,r,f);break;case"selectionchange":if(ab)break;case"keydown":case"keyup":Qp(u,r,f)}var C;if(Od)e:{switch(e){case"compositionstart":var S="onCompositionStart";break e;case"compositionend":S="onCompositionEnd";break e;case"compositionupdate":S="onCompositionUpdate";break e}S=void 0}else Ns?O_(e,r)&&(S="onCompositionEnd"):e==="keydown"&&r.keyCode===229&&(S="onCompositionStart");S&&(I_&&r.locale!=="ko"&&(Ns||S!=="onCompositionStart"?S==="onCompositionEnd"&&Ns&&(C=P_()):(An=f,Ad="value"in An?An.value:An.textContent,Ns=!0)),x=_l(c,S),0<x.length&&(S=new Up(S,e,null,r,f),u.push({event:S,listeners:x}),C?S.data=C:(C=B_(r),C!==null&&(S.data=C)))),(C=Xx?Yx(e,r):Jx(e,r))&&(c=_l(c,"onBeforeInput"),0<c.length&&(f=new Up("onBeforeInput","beforeinput",null,r,f),u.push({event:f,listeners:c}),f.data=C))}q_(u,t)})}function To(e,t,r){return{instance:e,listener:t,currentTarget:r}}function _l(e,t){for(var r=t+"Capture",n=[];e!==null;){var i=e,a=i.stateNode;i.tag===5&&a!==null&&(i=a,a=So(e,r),a!=null&&n.unshift(To(e,a,i)),a=So(e,t),a!=null&&n.push(To(e,a,i))),e=e.return}return n}function As(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function tm(e,t,r,n,i){for(var a=t._reactName,l=[];r!==null&&r!==n;){var s=r,o=s.alternate,c=s.stateNode;if(o!==null&&o===n)break;s.tag===5&&c!==null&&(s=c,i?(o=So(r,a),o!=null&&l.unshift(To(r,o,s))):i||(o=So(r,a),o!=null&&l.push(To(r,o,s)))),r=r.return}l.length!==0&&e.push({event:t,listeners:l})}var hb=/\r\n?/g,db=/\u0000|\uFFFD/g;function rm(e){return(typeof e=="string"?e:""+e).replace(hb,`
|
|
38
|
-
`).replace(db,"")}function wa(e,t,r){if(t=rm(t),rm(e)!==t&&r)throw Error(ce(425))}function yl(){}var rh=null,nh=null;function sh(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 ih=typeof setTimeout=="function"?setTimeout:void 0,fb=typeof clearTimeout=="function"?clearTimeout:void 0,nm=typeof Promise=="function"?Promise:void 0,pb=typeof queueMicrotask=="function"?queueMicrotask:typeof nm<"u"?function(e){return nm.resolve(null).then(e).catch(mb)}:ih;function mb(e){setTimeout(function(){throw e})}function Wc(e,t){var r=t,n=0;do{var i=r.nextSibling;if(e.removeChild(r),i&&i.nodeType===8)if(r=i.data,r==="/$"){if(n===0){e.removeChild(i),Co(t);return}n--}else r!=="$"&&r!=="$?"&&r!=="$!"||n++;r=i}while(r);Co(t)}function jn(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 sm(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var r=e.data;if(r==="$"||r==="$!"||r==="$?"){if(t===0)return e;t--}else r==="/$"&&t++}e=e.previousSibling}return null}var xi=Math.random().toString(36).slice(2),$r="__reactFiber$"+xi,Ro="__reactProps$"+xi,mn="__reactContainer$"+xi,oh="__reactEvents$"+xi,gb="__reactListeners$"+xi,vb="__reactHandles$"+xi;function ls(e){var t=e[$r];if(t)return t;for(var r=e.parentNode;r;){if(t=r[mn]||r[$r]){if(r=t.alternate,t.child!==null||r!==null&&r.child!==null)for(e=sm(e);e!==null;){if(r=e[$r])return r;e=sm(e)}return t}e=r,r=e.parentNode}return null}function Jo(e){return e=e[$r]||e[mn],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function Hs(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(ce(33))}function ic(e){return e[Ro]||null}var ah=[],$s=-1;function qn(e){return{current:e}}function st(e){0>$s||(e.current=ah[$s],ah[$s]=null,$s--)}function Ze(e,t){$s++,ah[$s]=e.current,e.current=t}var Wn={},Xt=qn(Wn),ir=qn(!1),ys=Wn;function ui(e,t){var r=e.type.contextTypes;if(!r)return Wn;var n=e.stateNode;if(n&&n.__reactInternalMemoizedUnmaskedChildContext===t)return n.__reactInternalMemoizedMaskedChildContext;var i={},a;for(a in r)i[a]=t[a];return n&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=i),i}function or(e){return e=e.childContextTypes,e!=null}function wl(){st(ir),st(Xt)}function im(e,t,r){if(Xt.current!==Wn)throw Error(ce(168));Ze(Xt,t),Ze(ir,r)}function Y_(e,t,r){var n=e.stateNode;if(t=t.childContextTypes,typeof n.getChildContext!="function")return r;n=n.getChildContext();for(var i in n)if(!(i in t))throw Error(ce(108,tx(e)||"Unknown",i));return ut({},r,n)}function Sl(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Wn,ys=Xt.current,Ze(Xt,e),Ze(ir,ir.current),!0}function om(e,t,r){var n=e.stateNode;if(!n)throw Error(ce(169));r?(e=Y_(e,t,ys),n.__reactInternalMemoizedMergedChildContext=e,st(ir),st(Xt),Ze(Xt,e)):st(ir),Ze(ir,r)}var ln=null,oc=!1,Vc=!1;function J_(e){ln===null?ln=[e]:ln.push(e)}function _b(e){oc=!0,J_(e)}function Xn(){if(!Vc&&ln!==null){Vc=!0;var e=0,t=Qe;try{var r=ln;for(Qe=1;e<r.length;e++){var n=r[e];do n=n(!0);while(n!==null)}ln=null,oc=!1}catch(i){throw ln!==null&&(ln=ln.slice(e+1)),x_(Td,Xn),i}finally{Qe=t,Vc=!1}}return null}var zs=[],Us=0,xl=null,bl=0,_r=[],yr=0,ws=null,cn=1,un="";function is(e,t){zs[Us++]=bl,zs[Us++]=xl,xl=e,bl=t}function Q_(e,t,r){_r[yr++]=cn,_r[yr++]=un,_r[yr++]=ws,ws=e;var n=cn;e=un;var i=32-Or(n)-1;n&=~(1<<i),r+=1;var a=32-Or(t)+i;if(30<a){var l=i-i%5;a=(n&(1<<l)-1).toString(32),n>>=l,i-=l,cn=1<<32-Or(t)+i|r<<i|n,un=a+e}else cn=1<<a|r<<i|n,un=e}function Nd(e){e.return!==null&&(is(e,1),Q_(e,1,0))}function jd(e){for(;e===xl;)xl=zs[--Us],zs[Us]=null,bl=zs[--Us],zs[Us]=null;for(;e===ws;)ws=_r[--yr],_r[yr]=null,un=_r[--yr],_r[yr]=null,cn=_r[--yr],_r[yr]=null}var dr=null,hr=null,ot=!1,Pr=null;function Z_(e,t){var r=wr(5,null,null,0);r.elementType="DELETED",r.stateNode=t,r.return=e,t=e.deletions,t===null?(e.deletions=[r],e.flags|=16):t.push(r)}function am(e,t){switch(e.tag){case 5:var r=e.type;return t=t.nodeType!==1||r.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,dr=e,hr=jn(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,dr=e,hr=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(r=ws!==null?{id:cn,overflow:un}:null,e.memoizedState={dehydrated:t,treeContext:r,retryLane:1073741824},r=wr(18,null,null,0),r.stateNode=t,r.return=e,e.child=r,dr=e,hr=null,!0):!1;default:return!1}}function lh(e){return(e.mode&1)!==0&&(e.flags&128)===0}function ch(e){if(ot){var t=hr;if(t){var r=t;if(!am(e,t)){if(lh(e))throw Error(ce(418));t=jn(r.nextSibling);var n=dr;t&&am(e,t)?Z_(n,r):(e.flags=e.flags&-4097|2,ot=!1,dr=e)}}else{if(lh(e))throw Error(ce(418));e.flags=e.flags&-4097|2,ot=!1,dr=e}}}function lm(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;dr=e}function Sa(e){if(e!==dr)return!1;if(!ot)return lm(e),ot=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!sh(e.type,e.memoizedProps)),t&&(t=hr)){if(lh(e))throw e0(),Error(ce(418));for(;t;)Z_(e,t),t=jn(t.nextSibling)}if(lm(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(ce(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var r=e.data;if(r==="/$"){if(t===0){hr=jn(e.nextSibling);break e}t--}else r!=="$"&&r!=="$!"&&r!=="$?"||t++}e=e.nextSibling}hr=null}}else hr=dr?jn(e.stateNode.nextSibling):null;return!0}function e0(){for(var e=hr;e;)e=jn(e.nextSibling)}function hi(){hr=dr=null,ot=!1}function Fd(e){Pr===null?Pr=[e]:Pr.push(e)}var yb=yn.ReactCurrentBatchConfig;function Ni(e,t,r){if(e=r.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(r._owner){if(r=r._owner,r){if(r.tag!==1)throw Error(ce(309));var n=r.stateNode}if(!n)throw Error(ce(147,e));var i=n,a=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===a?t.ref:(t=function(l){var s=i.refs;l===null?delete s[a]:s[a]=l},t._stringRef=a,t)}if(typeof e!="string")throw Error(ce(284));if(!r._owner)throw Error(ce(290,e))}return e}function xa(e,t){throw e=Object.prototype.toString.call(t),Error(ce(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function cm(e){var t=e._init;return t(e._payload)}function t0(e){function t(m,d){if(e){var g=m.deletions;g===null?(m.deletions=[d],m.flags|=16):g.push(d)}}function r(m,d){if(!e)return null;for(;d!==null;)t(m,d),d=d.sibling;return null}function n(m,d){for(m=new Map;d!==null;)d.key!==null?m.set(d.key,d):m.set(d.index,d),d=d.sibling;return m}function i(m,d){return m=zn(m,d),m.index=0,m.sibling=null,m}function a(m,d,g){return m.index=g,e?(g=m.alternate,g!==null?(g=g.index,g<d?(m.flags|=2,d):g):(m.flags|=2,d)):(m.flags|=1048576,d)}function l(m){return e&&m.alternate===null&&(m.flags|=2),m}function s(m,d,g,w){return d===null||d.tag!==6?(d=Qc(g,m.mode,w),d.return=m,d):(d=i(d,g),d.return=m,d)}function o(m,d,g,w){var b=g.type;return b===Bs?f(m,d,g.props.children,w,g.key):d!==null&&(d.elementType===b||typeof b=="object"&&b!==null&&b.$$typeof===Ln&&cm(b)===d.type)?(w=i(d,g.props),w.ref=Ni(m,d,g),w.return=m,w):(w=tl(g.type,g.key,g.props,null,m.mode,w),w.ref=Ni(m,d,g),w.return=m,w)}function c(m,d,g,w){return d===null||d.tag!==4||d.stateNode.containerInfo!==g.containerInfo||d.stateNode.implementation!==g.implementation?(d=Zc(g,m.mode,w),d.return=m,d):(d=i(d,g.children||[]),d.return=m,d)}function f(m,d,g,w,b){return d===null||d.tag!==7?(d=gs(g,m.mode,w,b),d.return=m,d):(d=i(d,g),d.return=m,d)}function u(m,d,g){if(typeof d=="string"&&d!==""||typeof d=="number")return d=Qc(""+d,m.mode,g),d.return=m,d;if(typeof d=="object"&&d!==null){switch(d.$$typeof){case ha:return g=tl(d.type,d.key,d.props,null,m.mode,g),g.ref=Ni(m,null,d),g.return=m,g;case Os:return d=Zc(d,m.mode,g),d.return=m,d;case Ln:var w=d._init;return u(m,w(d._payload),g)}if(Ki(d)||Ai(d))return d=gs(d,m.mode,g,null),d.return=m,d;xa(m,d)}return null}function p(m,d,g,w){var b=d!==null?d.key:null;if(typeof g=="string"&&g!==""||typeof g=="number")return b!==null?null:s(m,d,""+g,w);if(typeof g=="object"&&g!==null){switch(g.$$typeof){case ha:return g.key===b?o(m,d,g,w):null;case Os:return g.key===b?c(m,d,g,w):null;case Ln:return b=g._init,p(m,d,b(g._payload),w)}if(Ki(g)||Ai(g))return b!==null?null:f(m,d,g,w,null);xa(m,g)}return null}function _(m,d,g,w,b){if(typeof w=="string"&&w!==""||typeof w=="number")return m=m.get(g)||null,s(d,m,""+w,b);if(typeof w=="object"&&w!==null){switch(w.$$typeof){case ha:return m=m.get(w.key===null?g:w.key)||null,o(d,m,w,b);case Os:return m=m.get(w.key===null?g:w.key)||null,c(d,m,w,b);case Ln:var x=w._init;return _(m,d,g,x(w._payload),b)}if(Ki(w)||Ai(w))return m=m.get(g)||null,f(d,m,w,b,null);xa(d,w)}return null}function y(m,d,g,w){for(var b=null,x=null,C=d,S=d=0,k=null;C!==null&&S<g.length;S++){C.index>S?(k=C,C=null):k=C.sibling;var L=p(m,C,g[S],w);if(L===null){C===null&&(C=k);break}e&&C&&L.alternate===null&&t(m,C),d=a(L,d,S),x===null?b=L:x.sibling=L,x=L,C=k}if(S===g.length)return r(m,C),ot&&is(m,S),b;if(C===null){for(;S<g.length;S++)C=u(m,g[S],w),C!==null&&(d=a(C,d,S),x===null?b=C:x.sibling=C,x=C);return ot&&is(m,S),b}for(C=n(m,C);S<g.length;S++)k=_(C,m,S,g[S],w),k!==null&&(e&&k.alternate!==null&&C.delete(k.key===null?S:k.key),d=a(k,d,S),x===null?b=k:x.sibling=k,x=k);return e&&C.forEach(function(A){return t(m,A)}),ot&&is(m,S),b}function v(m,d,g,w){var b=Ai(g);if(typeof b!="function")throw Error(ce(150));if(g=b.call(g),g==null)throw Error(ce(151));for(var x=b=null,C=d,S=d=0,k=null,L=g.next();C!==null&&!L.done;S++,L=g.next()){C.index>S?(k=C,C=null):k=C.sibling;var A=p(m,C,L.value,w);if(A===null){C===null&&(C=k);break}e&&C&&A.alternate===null&&t(m,C),d=a(A,d,S),x===null?b=A:x.sibling=A,x=A,C=k}if(L.done)return r(m,C),ot&&is(m,S),b;if(C===null){for(;!L.done;S++,L=g.next())L=u(m,L.value,w),L!==null&&(d=a(L,d,S),x===null?b=L:x.sibling=L,x=L);return ot&&is(m,S),b}for(C=n(m,C);!L.done;S++,L=g.next())L=_(C,m,S,L.value,w),L!==null&&(e&&L.alternate!==null&&C.delete(L.key===null?S:L.key),d=a(L,d,S),x===null?b=L:x.sibling=L,x=L);return e&&C.forEach(function(M){return t(m,M)}),ot&&is(m,S),b}function h(m,d,g,w){if(typeof g=="object"&&g!==null&&g.type===Bs&&g.key===null&&(g=g.props.children),typeof g=="object"&&g!==null){switch(g.$$typeof){case ha:e:{for(var b=g.key,x=d;x!==null;){if(x.key===b){if(b=g.type,b===Bs){if(x.tag===7){r(m,x.sibling),d=i(x,g.props.children),d.return=m,m=d;break e}}else if(x.elementType===b||typeof b=="object"&&b!==null&&b.$$typeof===Ln&&cm(b)===x.type){r(m,x.sibling),d=i(x,g.props),d.ref=Ni(m,x,g),d.return=m,m=d;break e}r(m,x);break}else t(m,x);x=x.sibling}g.type===Bs?(d=gs(g.props.children,m.mode,w,g.key),d.return=m,m=d):(w=tl(g.type,g.key,g.props,null,m.mode,w),w.ref=Ni(m,d,g),w.return=m,m=w)}return l(m);case Os:e:{for(x=g.key;d!==null;){if(d.key===x)if(d.tag===4&&d.stateNode.containerInfo===g.containerInfo&&d.stateNode.implementation===g.implementation){r(m,d.sibling),d=i(d,g.children||[]),d.return=m,m=d;break e}else{r(m,d);break}else t(m,d);d=d.sibling}d=Zc(g,m.mode,w),d.return=m,m=d}return l(m);case Ln:return x=g._init,h(m,d,x(g._payload),w)}if(Ki(g))return y(m,d,g,w);if(Ai(g))return v(m,d,g,w);xa(m,g)}return typeof g=="string"&&g!==""||typeof g=="number"?(g=""+g,d!==null&&d.tag===6?(r(m,d.sibling),d=i(d,g),d.return=m,m=d):(r(m,d),d=Qc(g,m.mode,w),d.return=m,m=d),l(m)):r(m,d)}return h}var di=t0(!0),r0=t0(!1),Cl=qn(null),El=null,Ws=null,Hd=null;function $d(){Hd=Ws=El=null}function zd(e){var t=Cl.current;st(Cl),e._currentValue=t}function uh(e,t,r){for(;e!==null;){var n=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,n!==null&&(n.childLanes|=t)):n!==null&&(n.childLanes&t)!==t&&(n.childLanes|=t),e===r)break;e=e.return}}function ri(e,t){El=e,Hd=Ws=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(sr=!0),e.firstContext=null)}function Cr(e){var t=e._currentValue;if(Hd!==e)if(e={context:e,memoizedValue:t,next:null},Ws===null){if(El===null)throw Error(ce(308));Ws=e,El.dependencies={lanes:0,firstContext:e}}else Ws=Ws.next=e;return t}var cs=null;function Ud(e){cs===null?cs=[e]:cs.push(e)}function n0(e,t,r,n){var i=t.interleaved;return i===null?(r.next=r,Ud(t)):(r.next=i.next,i.next=r),t.interleaved=r,gn(e,n)}function gn(e,t){e.lanes|=t;var r=e.alternate;for(r!==null&&(r.lanes|=t),r=e,e=e.return;e!==null;)e.childLanes|=t,r=e.alternate,r!==null&&(r.childLanes|=t),r=e,e=e.return;return r.tag===3?r.stateNode:null}var Tn=!1;function Wd(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function s0(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 dn(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Fn(e,t,r){var n=e.updateQueue;if(n===null)return null;if(n=n.shared,Xe&2){var i=n.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),n.pending=t,gn(e,r)}return i=n.interleaved,i===null?(t.next=t,Ud(n)):(t.next=i.next,i.next=t),n.interleaved=t,gn(e,r)}function Xa(e,t,r){if(t=t.updateQueue,t!==null&&(t=t.shared,(r&4194240)!==0)){var n=t.lanes;n&=e.pendingLanes,r|=n,t.lanes=r,Rd(e,r)}}function um(e,t){var r=e.updateQueue,n=e.alternate;if(n!==null&&(n=n.updateQueue,r===n)){var i=null,a=null;if(r=r.firstBaseUpdate,r!==null){do{var l={eventTime:r.eventTime,lane:r.lane,tag:r.tag,payload:r.payload,callback:r.callback,next:null};a===null?i=a=l:a=a.next=l,r=r.next}while(r!==null);a===null?i=a=t:a=a.next=t}else i=a=t;r={baseState:n.baseState,firstBaseUpdate:i,lastBaseUpdate:a,shared:n.shared,effects:n.effects},e.updateQueue=r;return}e=r.lastBaseUpdate,e===null?r.firstBaseUpdate=t:e.next=t,r.lastBaseUpdate=t}function kl(e,t,r,n){var i=e.updateQueue;Tn=!1;var a=i.firstBaseUpdate,l=i.lastBaseUpdate,s=i.shared.pending;if(s!==null){i.shared.pending=null;var o=s,c=o.next;o.next=null,l===null?a=c:l.next=c,l=o;var f=e.alternate;f!==null&&(f=f.updateQueue,s=f.lastBaseUpdate,s!==l&&(s===null?f.firstBaseUpdate=c:s.next=c,f.lastBaseUpdate=o))}if(a!==null){var u=i.baseState;l=0,f=c=o=null,s=a;do{var p=s.lane,_=s.eventTime;if((n&p)===p){f!==null&&(f=f.next={eventTime:_,lane:0,tag:s.tag,payload:s.payload,callback:s.callback,next:null});e:{var y=e,v=s;switch(p=t,_=r,v.tag){case 1:if(y=v.payload,typeof y=="function"){u=y.call(_,u,p);break e}u=y;break e;case 3:y.flags=y.flags&-65537|128;case 0:if(y=v.payload,p=typeof y=="function"?y.call(_,u,p):y,p==null)break e;u=ut({},u,p);break e;case 2:Tn=!0}}s.callback!==null&&s.lane!==0&&(e.flags|=64,p=i.effects,p===null?i.effects=[s]:p.push(s))}else _={eventTime:_,lane:p,tag:s.tag,payload:s.payload,callback:s.callback,next:null},f===null?(c=f=_,o=u):f=f.next=_,l|=p;if(s=s.next,s===null){if(s=i.shared.pending,s===null)break;p=s,s=p.next,p.next=null,i.lastBaseUpdate=p,i.shared.pending=null}}while(!0);if(f===null&&(o=u),i.baseState=o,i.firstBaseUpdate=c,i.lastBaseUpdate=f,t=i.shared.interleaved,t!==null){i=t;do l|=i.lane,i=i.next;while(i!==t)}else a===null&&(i.shared.lanes=0);xs|=l,e.lanes=l,e.memoizedState=u}}function hm(e,t,r){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var n=e[t],i=n.callback;if(i!==null){if(n.callback=null,n=r,typeof i!="function")throw Error(ce(191,i));i.call(n)}}}var Qo={},Wr=qn(Qo),Do=qn(Qo),Mo=qn(Qo);function us(e){if(e===Qo)throw Error(ce(174));return e}function Vd(e,t){switch(Ze(Mo,t),Ze(Do,e),Ze(Wr,Qo),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:Wu(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=Wu(t,e)}st(Wr),Ze(Wr,t)}function fi(){st(Wr),st(Do),st(Mo)}function i0(e){us(Mo.current);var t=us(Wr.current),r=Wu(t,e.type);t!==r&&(Ze(Do,e),Ze(Wr,r))}function Kd(e){Do.current===e&&(st(Wr),st(Do))}var at=qn(0);function Ll(e){for(var t=e;t!==null;){if(t.tag===13){var r=t.memoizedState;if(r!==null&&(r=r.dehydrated,r===null||r.data==="$?"||r.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var Kc=[];function Gd(){for(var e=0;e<Kc.length;e++)Kc[e]._workInProgressVersionPrimary=null;Kc.length=0}var Ya=yn.ReactCurrentDispatcher,Gc=yn.ReactCurrentBatchConfig,Ss=0,ct=null,St=null,Lt=null,Tl=!1,so=!1,Ao=0,wb=0;function Ut(){throw Error(ce(321))}function qd(e,t){if(t===null)return!1;for(var r=0;r<t.length&&r<e.length;r++)if(!Nr(e[r],t[r]))return!1;return!0}function Xd(e,t,r,n,i,a){if(Ss=a,ct=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,Ya.current=e===null||e.memoizedState===null?Cb:Eb,e=r(n,i),so){a=0;do{if(so=!1,Ao=0,25<=a)throw Error(ce(301));a+=1,Lt=St=null,t.updateQueue=null,Ya.current=kb,e=r(n,i)}while(so)}if(Ya.current=Rl,t=St!==null&&St.next!==null,Ss=0,Lt=St=ct=null,Tl=!1,t)throw Error(ce(300));return e}function Yd(){var e=Ao!==0;return Ao=0,e}function Hr(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Lt===null?ct.memoizedState=Lt=e:Lt=Lt.next=e,Lt}function Er(){if(St===null){var e=ct.alternate;e=e!==null?e.memoizedState:null}else e=St.next;var t=Lt===null?ct.memoizedState:Lt.next;if(t!==null)Lt=t,St=e;else{if(e===null)throw Error(ce(310));St=e,e={memoizedState:St.memoizedState,baseState:St.baseState,baseQueue:St.baseQueue,queue:St.queue,next:null},Lt===null?ct.memoizedState=Lt=e:Lt=Lt.next=e}return Lt}function Po(e,t){return typeof t=="function"?t(e):t}function qc(e){var t=Er(),r=t.queue;if(r===null)throw Error(ce(311));r.lastRenderedReducer=e;var n=St,i=n.baseQueue,a=r.pending;if(a!==null){if(i!==null){var l=i.next;i.next=a.next,a.next=l}n.baseQueue=i=a,r.pending=null}if(i!==null){a=i.next,n=n.baseState;var s=l=null,o=null,c=a;do{var f=c.lane;if((Ss&f)===f)o!==null&&(o=o.next={lane:0,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null}),n=c.hasEagerState?c.eagerState:e(n,c.action);else{var u={lane:f,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null};o===null?(s=o=u,l=n):o=o.next=u,ct.lanes|=f,xs|=f}c=c.next}while(c!==null&&c!==a);o===null?l=n:o.next=s,Nr(n,t.memoizedState)||(sr=!0),t.memoizedState=n,t.baseState=l,t.baseQueue=o,r.lastRenderedState=n}if(e=r.interleaved,e!==null){i=e;do a=i.lane,ct.lanes|=a,xs|=a,i=i.next;while(i!==e)}else i===null&&(r.lanes=0);return[t.memoizedState,r.dispatch]}function Xc(e){var t=Er(),r=t.queue;if(r===null)throw Error(ce(311));r.lastRenderedReducer=e;var n=r.dispatch,i=r.pending,a=t.memoizedState;if(i!==null){r.pending=null;var l=i=i.next;do a=e(a,l.action),l=l.next;while(l!==i);Nr(a,t.memoizedState)||(sr=!0),t.memoizedState=a,t.baseQueue===null&&(t.baseState=a),r.lastRenderedState=a}return[a,n]}function o0(){}function a0(e,t){var r=ct,n=Er(),i=t(),a=!Nr(n.memoizedState,i);if(a&&(n.memoizedState=i,sr=!0),n=n.queue,Jd(u0.bind(null,r,n,e),[e]),n.getSnapshot!==t||a||Lt!==null&&Lt.memoizedState.tag&1){if(r.flags|=2048,Io(9,c0.bind(null,r,n,i,t),void 0,null),Pt===null)throw Error(ce(349));Ss&30||l0(r,t,i)}return i}function l0(e,t,r){e.flags|=16384,e={getSnapshot:t,value:r},t=ct.updateQueue,t===null?(t={lastEffect:null,stores:null},ct.updateQueue=t,t.stores=[e]):(r=t.stores,r===null?t.stores=[e]:r.push(e))}function c0(e,t,r,n){t.value=r,t.getSnapshot=n,h0(t)&&d0(e)}function u0(e,t,r){return r(function(){h0(t)&&d0(e)})}function h0(e){var t=e.getSnapshot;e=e.value;try{var r=t();return!Nr(e,r)}catch{return!0}}function d0(e){var t=gn(e,1);t!==null&&Br(t,e,1,-1)}function dm(e){var t=Hr();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Po,lastRenderedState:e},t.queue=e,e=e.dispatch=bb.bind(null,ct,e),[t.memoizedState,e]}function Io(e,t,r,n){return e={tag:e,create:t,destroy:r,deps:n,next:null},t=ct.updateQueue,t===null?(t={lastEffect:null,stores:null},ct.updateQueue=t,t.lastEffect=e.next=e):(r=t.lastEffect,r===null?t.lastEffect=e.next=e:(n=r.next,r.next=e,e.next=n,t.lastEffect=e)),e}function f0(){return Er().memoizedState}function Ja(e,t,r,n){var i=Hr();ct.flags|=e,i.memoizedState=Io(1|t,r,void 0,n===void 0?null:n)}function ac(e,t,r,n){var i=Er();n=n===void 0?null:n;var a=void 0;if(St!==null){var l=St.memoizedState;if(a=l.destroy,n!==null&&qd(n,l.deps)){i.memoizedState=Io(t,r,a,n);return}}ct.flags|=e,i.memoizedState=Io(1|t,r,a,n)}function fm(e,t){return Ja(8390656,8,e,t)}function Jd(e,t){return ac(2048,8,e,t)}function p0(e,t){return ac(4,2,e,t)}function m0(e,t){return ac(4,4,e,t)}function g0(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 v0(e,t,r){return r=r!=null?r.concat([e]):null,ac(4,4,g0.bind(null,t,e),r)}function Qd(){}function _0(e,t){var r=Er();t=t===void 0?null:t;var n=r.memoizedState;return n!==null&&t!==null&&qd(t,n[1])?n[0]:(r.memoizedState=[e,t],e)}function y0(e,t){var r=Er();t=t===void 0?null:t;var n=r.memoizedState;return n!==null&&t!==null&&qd(t,n[1])?n[0]:(e=e(),r.memoizedState=[e,t],e)}function w0(e,t,r){return Ss&21?(Nr(r,t)||(r=E_(),ct.lanes|=r,xs|=r,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,sr=!0),e.memoizedState=r)}function Sb(e,t){var r=Qe;Qe=r!==0&&4>r?r:4,e(!0);var n=Gc.transition;Gc.transition={};try{e(!1),t()}finally{Qe=r,Gc.transition=n}}function S0(){return Er().memoizedState}function xb(e,t,r){var n=$n(e);if(r={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null},x0(e))b0(t,r);else if(r=n0(e,t,r,n),r!==null){var i=er();Br(r,e,n,i),C0(r,t,n)}}function bb(e,t,r){var n=$n(e),i={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null};if(x0(e))b0(t,i);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var l=t.lastRenderedState,s=a(l,r);if(i.hasEagerState=!0,i.eagerState=s,Nr(s,l)){var o=t.interleaved;o===null?(i.next=i,Ud(t)):(i.next=o.next,o.next=i),t.interleaved=i;return}}catch{}finally{}r=n0(e,t,i,n),r!==null&&(i=er(),Br(r,e,n,i),C0(r,t,n))}}function x0(e){var t=e.alternate;return e===ct||t!==null&&t===ct}function b0(e,t){so=Tl=!0;var r=e.pending;r===null?t.next=t:(t.next=r.next,r.next=t),e.pending=t}function C0(e,t,r){if(r&4194240){var n=t.lanes;n&=e.pendingLanes,r|=n,t.lanes=r,Rd(e,r)}}var Rl={readContext:Cr,useCallback:Ut,useContext:Ut,useEffect:Ut,useImperativeHandle:Ut,useInsertionEffect:Ut,useLayoutEffect:Ut,useMemo:Ut,useReducer:Ut,useRef:Ut,useState:Ut,useDebugValue:Ut,useDeferredValue:Ut,useTransition:Ut,useMutableSource:Ut,useSyncExternalStore:Ut,useId:Ut,unstable_isNewReconciler:!1},Cb={readContext:Cr,useCallback:function(e,t){return Hr().memoizedState=[e,t===void 0?null:t],e},useContext:Cr,useEffect:fm,useImperativeHandle:function(e,t,r){return r=r!=null?r.concat([e]):null,Ja(4194308,4,g0.bind(null,t,e),r)},useLayoutEffect:function(e,t){return Ja(4194308,4,e,t)},useInsertionEffect:function(e,t){return Ja(4,2,e,t)},useMemo:function(e,t){var r=Hr();return t=t===void 0?null:t,e=e(),r.memoizedState=[e,t],e},useReducer:function(e,t,r){var n=Hr();return t=r!==void 0?r(t):t,n.memoizedState=n.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},n.queue=e,e=e.dispatch=xb.bind(null,ct,e),[n.memoizedState,e]},useRef:function(e){var t=Hr();return e={current:e},t.memoizedState=e},useState:dm,useDebugValue:Qd,useDeferredValue:function(e){return Hr().memoizedState=e},useTransition:function(){var e=dm(!1),t=e[0];return e=Sb.bind(null,e[1]),Hr().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,r){var n=ct,i=Hr();if(ot){if(r===void 0)throw Error(ce(407));r=r()}else{if(r=t(),Pt===null)throw Error(ce(349));Ss&30||l0(n,t,r)}i.memoizedState=r;var a={value:r,getSnapshot:t};return i.queue=a,fm(u0.bind(null,n,a,e),[e]),n.flags|=2048,Io(9,c0.bind(null,n,a,r,t),void 0,null),r},useId:function(){var e=Hr(),t=Pt.identifierPrefix;if(ot){var r=un,n=cn;r=(n&~(1<<32-Or(n)-1)).toString(32)+r,t=":"+t+"R"+r,r=Ao++,0<r&&(t+="H"+r.toString(32)),t+=":"}else r=wb++,t=":"+t+"r"+r.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},Eb={readContext:Cr,useCallback:_0,useContext:Cr,useEffect:Jd,useImperativeHandle:v0,useInsertionEffect:p0,useLayoutEffect:m0,useMemo:y0,useReducer:qc,useRef:f0,useState:function(){return qc(Po)},useDebugValue:Qd,useDeferredValue:function(e){var t=Er();return w0(t,St.memoizedState,e)},useTransition:function(){var e=qc(Po)[0],t=Er().memoizedState;return[e,t]},useMutableSource:o0,useSyncExternalStore:a0,useId:S0,unstable_isNewReconciler:!1},kb={readContext:Cr,useCallback:_0,useContext:Cr,useEffect:Jd,useImperativeHandle:v0,useInsertionEffect:p0,useLayoutEffect:m0,useMemo:y0,useReducer:Xc,useRef:f0,useState:function(){return Xc(Po)},useDebugValue:Qd,useDeferredValue:function(e){var t=Er();return St===null?t.memoizedState=e:w0(t,St.memoizedState,e)},useTransition:function(){var e=Xc(Po)[0],t=Er().memoizedState;return[e,t]},useMutableSource:o0,useSyncExternalStore:a0,useId:S0,unstable_isNewReconciler:!1};function Dr(e,t){if(e&&e.defaultProps){t=ut({},t),e=e.defaultProps;for(var r in e)t[r]===void 0&&(t[r]=e[r]);return t}return t}function hh(e,t,r,n){t=e.memoizedState,r=r(n,t),r=r==null?t:ut({},t,r),e.memoizedState=r,e.lanes===0&&(e.updateQueue.baseState=r)}var lc={isMounted:function(e){return(e=e._reactInternals)?Es(e)===e:!1},enqueueSetState:function(e,t,r){e=e._reactInternals;var n=er(),i=$n(e),a=dn(n,i);a.payload=t,r!=null&&(a.callback=r),t=Fn(e,a,i),t!==null&&(Br(t,e,i,n),Xa(t,e,i))},enqueueReplaceState:function(e,t,r){e=e._reactInternals;var n=er(),i=$n(e),a=dn(n,i);a.tag=1,a.payload=t,r!=null&&(a.callback=r),t=Fn(e,a,i),t!==null&&(Br(t,e,i,n),Xa(t,e,i))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var r=er(),n=$n(e),i=dn(r,n);i.tag=2,t!=null&&(i.callback=t),t=Fn(e,i,n),t!==null&&(Br(t,e,n,r),Xa(t,e,n))}};function pm(e,t,r,n,i,a,l){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(n,a,l):t.prototype&&t.prototype.isPureReactComponent?!ko(r,n)||!ko(i,a):!0}function E0(e,t,r){var n=!1,i=Wn,a=t.contextType;return typeof a=="object"&&a!==null?a=Cr(a):(i=or(t)?ys:Xt.current,n=t.contextTypes,a=(n=n!=null)?ui(e,i):Wn),t=new t(r,a),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=lc,e.stateNode=t,t._reactInternals=e,n&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=i,e.__reactInternalMemoizedMaskedChildContext=a),t}function mm(e,t,r,n){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(r,n),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(r,n),t.state!==e&&lc.enqueueReplaceState(t,t.state,null)}function dh(e,t,r,n){var i=e.stateNode;i.props=r,i.state=e.memoizedState,i.refs={},Wd(e);var a=t.contextType;typeof a=="object"&&a!==null?i.context=Cr(a):(a=or(t)?ys:Xt.current,i.context=ui(e,a)),i.state=e.memoizedState,a=t.getDerivedStateFromProps,typeof a=="function"&&(hh(e,t,a,r),i.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof i.getSnapshotBeforeUpdate=="function"||typeof i.UNSAFE_componentWillMount!="function"&&typeof i.componentWillMount!="function"||(t=i.state,typeof i.componentWillMount=="function"&&i.componentWillMount(),typeof i.UNSAFE_componentWillMount=="function"&&i.UNSAFE_componentWillMount(),t!==i.state&&lc.enqueueReplaceState(i,i.state,null),kl(e,r,i,n),i.state=e.memoizedState),typeof i.componentDidMount=="function"&&(e.flags|=4194308)}function pi(e,t){try{var r="",n=t;do r+=ex(n),n=n.return;while(n);var i=r}catch(a){i=`
|
|
37
|
+
`+i[l].replace(" at new "," at ");return e.displayName&&o.includes("<anonymous>")&&(o=o.replace("<anonymous>",e.displayName)),o}while(1<=l&&0<=s);break}}}finally{Dc=!1,Error.prepareStackTrace=r}return(e=e?e.displayName||e.name:"")?Vi(e):""}function ex(e){switch(e.tag){case 5:return Vi(e.type);case 16:return Vi("Lazy");case 13:return Vi("Suspense");case 19:return Vi("SuspenseList");case 0:case 2:case 15:return e=Mc(e.type,!1),e;case 11:return e=Mc(e.type.render,!1),e;case 1:return e=Mc(e.type,!0),e;default:return""}}function Fu(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 Bs:return"Fragment";case Os:return"Portal";case Bu:return"Profiler";case Cd:return"StrictMode";case Nu:return"Suspense";case ju:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case s_:return(e.displayName||"Context")+".Consumer";case n_:return(e._context.displayName||"Context")+".Provider";case Ed:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case kd:return t=e.displayName||null,t!==null?t:Fu(e.type)||"Memo";case Ln:t=e._payload,e=e._init;try{return Fu(e(t))}catch{}}return null}function tx(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 Fu(t);case 8:return t===Cd?"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 Un(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function o_(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function rx(e){var t=o_(e)?"checked":"value",r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),n=""+e[t];if(!e.hasOwnProperty(t)&&typeof r<"u"&&typeof r.get=="function"&&typeof r.set=="function"){var i=r.get,a=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(l){n=""+l,a.call(this,l)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(l){n=""+l},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function da(e){e._valueTracker||(e._valueTracker=rx(e))}function a_(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var r=t.getValue(),n="";return e&&(n=o_(e)?e.checked?"true":"false":e.value),e=n,e!==r?(t.setValue(e),!0):!1}function hl(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 Hu(e,t){var r=t.checked;return ut({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:r??e._wrapperState.initialChecked})}function Ap(e,t){var r=t.defaultValue==null?"":t.defaultValue,n=t.checked!=null?t.checked:t.defaultChecked;r=Un(t.value!=null?t.value:r),e._wrapperState={initialChecked:n,initialValue:r,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function l_(e,t){t=t.checked,t!=null&&bd(e,"checked",t,!1)}function $u(e,t){l_(e,t);var r=Un(t.value),n=t.type;if(r!=null)n==="number"?(r===0&&e.value===""||e.value!=r)&&(e.value=""+r):e.value!==""+r&&(e.value=""+r);else if(n==="submit"||n==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?zu(e,t.type,r):t.hasOwnProperty("defaultValue")&&zu(e,t.type,Un(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Pp(e,t,r){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var n=t.type;if(!(n!=="submit"&&n!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,r||t===e.value||(e.value=t),e.defaultValue=t}r=e.name,r!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,r!==""&&(e.name=r)}function zu(e,t,r){(t!=="number"||hl(e.ownerDocument)!==e)&&(r==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+r&&(e.defaultValue=""+r))}var Ki=Array.isArray;function Qs(e,t,r,n){if(e=e.options,t){t={};for(var i=0;i<r.length;i++)t["$"+r[i]]=!0;for(r=0;r<e.length;r++)i=t.hasOwnProperty("$"+e[r].value),e[r].selected!==i&&(e[r].selected=i),i&&n&&(e[r].defaultSelected=!0)}else{for(r=""+Un(r),t=null,i=0;i<e.length;i++){if(e[i].value===r){e[i].selected=!0,n&&(e[i].defaultSelected=!0);return}t!==null||e[i].disabled||(t=e[i])}t!==null&&(t.selected=!0)}}function Uu(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(he(91));return ut({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function Ip(e,t){var r=t.value;if(r==null){if(r=t.children,t=t.defaultValue,r!=null){if(t!=null)throw Error(he(92));if(Ki(r)){if(1<r.length)throw Error(he(93));r=r[0]}t=r}t==null&&(t=""),r=t}e._wrapperState={initialValue:Un(r)}}function c_(e,t){var r=Un(t.value),n=Un(t.defaultValue);r!=null&&(r=""+r,r!==e.value&&(e.value=r),t.defaultValue==null&&e.defaultValue!==r&&(e.defaultValue=r)),n!=null&&(e.defaultValue=""+n)}function Op(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function u_(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 Wu(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?u_(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var fa,h_=function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,r,n,i){MSApp.execUnsafeLocalFunction(function(){return e(t,r,n,i)})}:e}(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(fa=fa||document.createElement("div"),fa.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=fa.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function wo(e,t){if(t){var r=e.firstChild;if(r&&r===e.lastChild&&r.nodeType===3){r.nodeValue=t;return}}e.textContent=t}var Zi={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},nx=["Webkit","ms","Moz","O"];Object.keys(Zi).forEach(function(e){nx.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Zi[t]=Zi[e]})});function d_(e,t,r){return t==null||typeof t=="boolean"||t===""?"":r||typeof t!="number"||t===0||Zi.hasOwnProperty(e)&&Zi[e]?(""+t).trim():t+"px"}function f_(e,t){e=e.style;for(var r in t)if(t.hasOwnProperty(r)){var n=r.indexOf("--")===0,i=d_(r,t[r],n);r==="float"&&(r="cssFloat"),n?e.setProperty(r,i):e[r]=i}}var sx=ut({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 Vu(e,t){if(t){if(sx[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(he(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(he(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(he(61))}if(t.style!=null&&typeof t.style!="object")throw Error(he(62))}}function Ku(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 Gu=null;function Ld(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var qu=null,Zs=null,ei=null;function Bp(e){if(e=Jo(e)){if(typeof qu!="function")throw Error(he(280));var t=e.stateNode;t&&(t=ic(t),qu(e.stateNode,e.type,t))}}function p_(e){Zs?ei?ei.push(e):ei=[e]:Zs=e}function m_(){if(Zs){var e=Zs,t=ei;if(ei=Zs=null,Bp(e),t)for(e=0;e<t.length;e++)Bp(t[e])}}function g_(e,t){return e(t)}function v_(){}var Ac=!1;function __(e,t,r){if(Ac)return e(t,r);Ac=!0;try{return g_(e,t,r)}finally{Ac=!1,(Zs!==null||ei!==null)&&(v_(),m_())}}function So(e,t){var r=e.stateNode;if(r===null)return null;var n=ic(r);if(n===null)return null;r=n[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":(n=!n.disabled)||(e=e.type,n=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!n;break e;default:e=!1}if(e)return null;if(r&&typeof r!="function")throw Error(he(231,t,typeof r));return r}var Xu=!1;if(pn)try{var Pi={};Object.defineProperty(Pi,"passive",{get:function(){Xu=!0}}),window.addEventListener("test",Pi,Pi),window.removeEventListener("test",Pi,Pi)}catch{Xu=!1}function ix(e,t,r,n,i,a,l,s,o){var c=Array.prototype.slice.call(arguments,3);try{t.apply(r,c)}catch(f){this.onError(f)}}var eo=!1,dl=null,fl=!1,Yu=null,ox={onError:function(e){eo=!0,dl=e}};function ax(e,t,r,n,i,a,l,s,o){eo=!1,dl=null,ix.apply(ox,arguments)}function lx(e,t,r,n,i,a,l,s,o){if(ax.apply(this,arguments),eo){if(eo){var c=dl;eo=!1,dl=null}else throw Error(he(198));fl||(fl=!0,Yu=c)}}function Es(e){var t=e,r=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(r=t.return),e=t.return;while(e)}return t.tag===3?r:null}function y_(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 Np(e){if(Es(e)!==e)throw Error(he(188))}function cx(e){var t=e.alternate;if(!t){if(t=Es(e),t===null)throw Error(he(188));return t!==e?null:e}for(var r=e,n=t;;){var i=r.return;if(i===null)break;var a=i.alternate;if(a===null){if(n=i.return,n!==null){r=n;continue}break}if(i.child===a.child){for(a=i.child;a;){if(a===r)return Np(i),e;if(a===n)return Np(i),t;a=a.sibling}throw Error(he(188))}if(r.return!==n.return)r=i,n=a;else{for(var l=!1,s=i.child;s;){if(s===r){l=!0,r=i,n=a;break}if(s===n){l=!0,n=i,r=a;break}s=s.sibling}if(!l){for(s=a.child;s;){if(s===r){l=!0,r=a,n=i;break}if(s===n){l=!0,n=a,r=i;break}s=s.sibling}if(!l)throw Error(he(189))}}if(r.alternate!==n)throw Error(he(190))}if(r.tag!==3)throw Error(he(188));return r.stateNode.current===r?e:t}function w_(e){return e=cx(e),e!==null?S_(e):null}function S_(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=S_(e);if(t!==null)return t;e=e.sibling}return null}var x_=fr.unstable_scheduleCallback,jp=fr.unstable_cancelCallback,ux=fr.unstable_shouldYield,hx=fr.unstable_requestPaint,pt=fr.unstable_now,dx=fr.unstable_getCurrentPriorityLevel,Td=fr.unstable_ImmediatePriority,b_=fr.unstable_UserBlockingPriority,pl=fr.unstable_NormalPriority,fx=fr.unstable_LowPriority,C_=fr.unstable_IdlePriority,tc=null,Wr=null;function px(e){if(Wr&&typeof Wr.onCommitFiberRoot=="function")try{Wr.onCommitFiberRoot(tc,e,void 0,(e.current.flags&128)===128)}catch{}}var Or=Math.clz32?Math.clz32:vx,mx=Math.log,gx=Math.LN2;function vx(e){return e>>>=0,e===0?32:31-(mx(e)/gx|0)|0}var pa=64,ma=4194304;function Gi(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 ml(e,t){var r=e.pendingLanes;if(r===0)return 0;var n=0,i=e.suspendedLanes,a=e.pingedLanes,l=r&268435455;if(l!==0){var s=l&~i;s!==0?n=Gi(s):(a&=l,a!==0&&(n=Gi(a)))}else l=r&~i,l!==0?n=Gi(l):a!==0&&(n=Gi(a));if(n===0)return 0;if(t!==0&&t!==n&&!(t&i)&&(i=n&-n,a=t&-t,i>=a||i===16&&(a&4194240)!==0))return t;if(n&4&&(n|=r&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=n;0<t;)r=31-Or(t),i=1<<r,n|=e[r],t&=~i;return n}function _x(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 yx(e,t){for(var r=e.suspendedLanes,n=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes;0<a;){var l=31-Or(a),s=1<<l,o=i[l];o===-1?(!(s&r)||s&n)&&(i[l]=_x(s,t)):o<=t&&(e.expiredLanes|=s),a&=~s}}function Ju(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function E_(){var e=pa;return pa<<=1,!(pa&4194240)&&(pa=64),e}function Pc(e){for(var t=[],r=0;31>r;r++)t.push(e);return t}function Xo(e,t,r){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Or(t),e[t]=r}function wx(e,t){var r=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var n=e.eventTimes;for(e=e.expirationTimes;0<r;){var i=31-Or(r),a=1<<i;t[i]=0,n[i]=-1,e[i]=-1,r&=~a}}function Rd(e,t){var r=e.entangledLanes|=t;for(e=e.entanglements;r;){var n=31-Or(r),i=1<<n;i&t|e[n]&t&&(e[n]|=t),r&=~i}}var Je=0;function k_(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var L_,Dd,T_,R_,D_,Qu=!1,ga=[],On=null,Bn=null,Nn=null,xo=new Map,bo=new Map,Dn=[],Sx="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 Fp(e,t){switch(e){case"focusin":case"focusout":On=null;break;case"dragenter":case"dragleave":Bn=null;break;case"mouseover":case"mouseout":Nn=null;break;case"pointerover":case"pointerout":xo.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":bo.delete(t.pointerId)}}function Ii(e,t,r,n,i,a){return e===null||e.nativeEvent!==a?(e={blockedOn:t,domEventName:r,eventSystemFlags:n,nativeEvent:a,targetContainers:[i]},t!==null&&(t=Jo(t),t!==null&&Dd(t)),e):(e.eventSystemFlags|=n,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function xx(e,t,r,n,i){switch(t){case"focusin":return On=Ii(On,e,t,r,n,i),!0;case"dragenter":return Bn=Ii(Bn,e,t,r,n,i),!0;case"mouseover":return Nn=Ii(Nn,e,t,r,n,i),!0;case"pointerover":var a=i.pointerId;return xo.set(a,Ii(xo.get(a)||null,e,t,r,n,i)),!0;case"gotpointercapture":return a=i.pointerId,bo.set(a,Ii(bo.get(a)||null,e,t,r,n,i)),!0}return!1}function M_(e){var t=ls(e.target);if(t!==null){var r=Es(t);if(r!==null){if(t=r.tag,t===13){if(t=y_(r),t!==null){e.blockedOn=t,D_(e.priority,function(){T_(r)});return}}else if(t===3&&r.stateNode.current.memoizedState.isDehydrated){e.blockedOn=r.tag===3?r.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Ka(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var r=Zu(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(r===null){r=e.nativeEvent;var n=new r.constructor(r.type,r);Gu=n,r.target.dispatchEvent(n),Gu=null}else return t=Jo(r),t!==null&&Dd(t),e.blockedOn=r,!1;t.shift()}return!0}function Hp(e,t,r){Ka(e)&&r.delete(t)}function bx(){Qu=!1,On!==null&&Ka(On)&&(On=null),Bn!==null&&Ka(Bn)&&(Bn=null),Nn!==null&&Ka(Nn)&&(Nn=null),xo.forEach(Hp),bo.forEach(Hp)}function Oi(e,t){e.blockedOn===t&&(e.blockedOn=null,Qu||(Qu=!0,fr.unstable_scheduleCallback(fr.unstable_NormalPriority,bx)))}function Co(e){function t(i){return Oi(i,e)}if(0<ga.length){Oi(ga[0],e);for(var r=1;r<ga.length;r++){var n=ga[r];n.blockedOn===e&&(n.blockedOn=null)}}for(On!==null&&Oi(On,e),Bn!==null&&Oi(Bn,e),Nn!==null&&Oi(Nn,e),xo.forEach(t),bo.forEach(t),r=0;r<Dn.length;r++)n=Dn[r],n.blockedOn===e&&(n.blockedOn=null);for(;0<Dn.length&&(r=Dn[0],r.blockedOn===null);)M_(r),r.blockedOn===null&&Dn.shift()}var ti=yn.ReactCurrentBatchConfig,gl=!0;function Cx(e,t,r,n){var i=Je,a=ti.transition;ti.transition=null;try{Je=1,Md(e,t,r,n)}finally{Je=i,ti.transition=a}}function Ex(e,t,r,n){var i=Je,a=ti.transition;ti.transition=null;try{Je=4,Md(e,t,r,n)}finally{Je=i,ti.transition=a}}function Md(e,t,r,n){if(gl){var i=Zu(e,t,r,n);if(i===null)Uc(e,t,n,vl,r),Fp(e,n);else if(xx(i,e,t,r,n))n.stopPropagation();else if(Fp(e,n),t&4&&-1<Sx.indexOf(e)){for(;i!==null;){var a=Jo(i);if(a!==null&&L_(a),a=Zu(e,t,r,n),a===null&&Uc(e,t,n,vl,r),a===i)break;i=a}i!==null&&n.stopPropagation()}else Uc(e,t,n,null,r)}}var vl=null;function Zu(e,t,r,n){if(vl=null,e=Ld(n),e=ls(e),e!==null)if(t=Es(e),t===null)e=null;else if(r=t.tag,r===13){if(e=y_(t),e!==null)return e;e=null}else if(r===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null);return vl=e,null}function A_(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(dx()){case Td:return 1;case b_:return 4;case pl:case fx:return 16;case C_:return 536870912;default:return 16}default:return 16}}var An=null,Ad=null,Ga=null;function P_(){if(Ga)return Ga;var e,t=Ad,r=t.length,n,i="value"in An?An.value:An.textContent,a=i.length;for(e=0;e<r&&t[e]===i[e];e++);var l=r-e;for(n=1;n<=l&&t[r-n]===i[a-n];n++);return Ga=i.slice(e,1<n?1-n:void 0)}function qa(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 va(){return!0}function $p(){return!1}function mr(e){function t(r,n,i,a,l){this._reactName=r,this._targetInst=i,this.type=n,this.nativeEvent=a,this.target=l,this.currentTarget=null;for(var s in e)e.hasOwnProperty(s)&&(r=e[s],this[s]=r?r(a):a[s]);return this.isDefaultPrevented=(a.defaultPrevented!=null?a.defaultPrevented:a.returnValue===!1)?va:$p,this.isPropagationStopped=$p,this}return ut(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var r=this.nativeEvent;r&&(r.preventDefault?r.preventDefault():typeof r.returnValue!="unknown"&&(r.returnValue=!1),this.isDefaultPrevented=va)},stopPropagation:function(){var r=this.nativeEvent;r&&(r.stopPropagation?r.stopPropagation():typeof r.cancelBubble!="unknown"&&(r.cancelBubble=!0),this.isPropagationStopped=va)},persist:function(){},isPersistent:va}),t}var Si={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Pd=mr(Si),Yo=ut({},Si,{view:0,detail:0}),kx=mr(Yo),Ic,Oc,Bi,rc=ut({},Yo,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Id,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!==Bi&&(Bi&&e.type==="mousemove"?(Ic=e.screenX-Bi.screenX,Oc=e.screenY-Bi.screenY):Oc=Ic=0,Bi=e),Ic)},movementY:function(e){return"movementY"in e?e.movementY:Oc}}),zp=mr(rc),Lx=ut({},rc,{dataTransfer:0}),Tx=mr(Lx),Rx=ut({},Yo,{relatedTarget:0}),Bc=mr(Rx),Dx=ut({},Si,{animationName:0,elapsedTime:0,pseudoElement:0}),Mx=mr(Dx),Ax=ut({},Si,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),Px=mr(Ax),Ix=ut({},Si,{data:0}),Up=mr(Ix),Ox={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Bx={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"},Nx={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function jx(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Nx[e])?!!t[e]:!1}function Id(){return jx}var Fx=ut({},Yo,{key:function(e){if(e.key){var t=Ox[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=qa(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?Bx[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Id,charCode:function(e){return e.type==="keypress"?qa(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?qa(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),Hx=mr(Fx),$x=ut({},rc,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Wp=mr($x),zx=ut({},Yo,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Id}),Ux=mr(zx),Wx=ut({},Si,{propertyName:0,elapsedTime:0,pseudoElement:0}),Vx=mr(Wx),Kx=ut({},rc,{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}),Gx=mr(Kx),qx=[9,13,27,32],Od=pn&&"CompositionEvent"in window,to=null;pn&&"documentMode"in document&&(to=document.documentMode);var Xx=pn&&"TextEvent"in window&&!to,I_=pn&&(!Od||to&&8<to&&11>=to),Vp=" ",Kp=!1;function O_(e,t){switch(e){case"keyup":return qx.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function B_(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Ns=!1;function Yx(e,t){switch(e){case"compositionend":return B_(t);case"keypress":return t.which!==32?null:(Kp=!0,Vp);case"textInput":return e=t.data,e===Vp&&Kp?null:e;default:return null}}function Jx(e,t){if(Ns)return e==="compositionend"||!Od&&O_(e,t)?(e=P_(),Ga=Ad=An=null,Ns=!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 I_&&t.locale!=="ko"?null:t.data;default:return null}}var Qx={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 Gp(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!Qx[e.type]:t==="textarea"}function N_(e,t,r,n){p_(n),t=_l(t,"onChange"),0<t.length&&(r=new Pd("onChange","change",null,r,n),e.push({event:r,listeners:t}))}var ro=null,Eo=null;function Zx(e){q_(e,0)}function nc(e){var t=Hs(e);if(a_(t))return e}function eb(e,t){if(e==="change")return t}var j_=!1;if(pn){var Nc;if(pn){var jc="oninput"in document;if(!jc){var qp=document.createElement("div");qp.setAttribute("oninput","return;"),jc=typeof qp.oninput=="function"}Nc=jc}else Nc=!1;j_=Nc&&(!document.documentMode||9<document.documentMode)}function Xp(){ro&&(ro.detachEvent("onpropertychange",F_),Eo=ro=null)}function F_(e){if(e.propertyName==="value"&&nc(Eo)){var t=[];N_(t,Eo,e,Ld(e)),__(Zx,t)}}function tb(e,t,r){e==="focusin"?(Xp(),ro=t,Eo=r,ro.attachEvent("onpropertychange",F_)):e==="focusout"&&Xp()}function rb(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return nc(Eo)}function nb(e,t){if(e==="click")return nc(t)}function sb(e,t){if(e==="input"||e==="change")return nc(t)}function ib(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Nr=typeof Object.is=="function"?Object.is:ib;function ko(e,t){if(Nr(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var r=Object.keys(e),n=Object.keys(t);if(r.length!==n.length)return!1;for(n=0;n<r.length;n++){var i=r[n];if(!Ou.call(t,i)||!Nr(e[i],t[i]))return!1}return!0}function Yp(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Jp(e,t){var r=Yp(e);e=0;for(var n;r;){if(r.nodeType===3){if(n=e+r.textContent.length,e<=t&&n>=t)return{node:r,offset:t-e};e=n}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=Yp(r)}}function H_(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?H_(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function $_(){for(var e=window,t=hl();t instanceof e.HTMLIFrameElement;){try{var r=typeof t.contentWindow.location.href=="string"}catch{r=!1}if(r)e=t.contentWindow;else break;t=hl(e.document)}return t}function Bd(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 ob(e){var t=$_(),r=e.focusedElem,n=e.selectionRange;if(t!==r&&r&&r.ownerDocument&&H_(r.ownerDocument.documentElement,r)){if(n!==null&&Bd(r)){if(t=n.start,e=n.end,e===void 0&&(e=t),"selectionStart"in r)r.selectionStart=t,r.selectionEnd=Math.min(e,r.value.length);else if(e=(t=r.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var i=r.textContent.length,a=Math.min(n.start,i);n=n.end===void 0?a:Math.min(n.end,i),!e.extend&&a>n&&(i=n,n=a,a=i),i=Jp(r,a);var l=Jp(r,n);i&&l&&(e.rangeCount!==1||e.anchorNode!==i.node||e.anchorOffset!==i.offset||e.focusNode!==l.node||e.focusOffset!==l.offset)&&(t=t.createRange(),t.setStart(i.node,i.offset),e.removeAllRanges(),a>n?(e.addRange(t),e.extend(l.node,l.offset)):(t.setEnd(l.node,l.offset),e.addRange(t)))}}for(t=[],e=r;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof r.focus=="function"&&r.focus(),r=0;r<t.length;r++)e=t[r],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var ab=pn&&"documentMode"in document&&11>=document.documentMode,js=null,eh=null,no=null,th=!1;function Qp(e,t,r){var n=r.window===r?r.document:r.nodeType===9?r:r.ownerDocument;th||js==null||js!==hl(n)||(n=js,"selectionStart"in n&&Bd(n)?n={start:n.selectionStart,end:n.selectionEnd}:(n=(n.ownerDocument&&n.ownerDocument.defaultView||window).getSelection(),n={anchorNode:n.anchorNode,anchorOffset:n.anchorOffset,focusNode:n.focusNode,focusOffset:n.focusOffset}),no&&ko(no,n)||(no=n,n=_l(eh,"onSelect"),0<n.length&&(t=new Pd("onSelect","select",null,t,r),e.push({event:t,listeners:n}),t.target=js)))}function _a(e,t){var r={};return r[e.toLowerCase()]=t.toLowerCase(),r["Webkit"+e]="webkit"+t,r["Moz"+e]="moz"+t,r}var Fs={animationend:_a("Animation","AnimationEnd"),animationiteration:_a("Animation","AnimationIteration"),animationstart:_a("Animation","AnimationStart"),transitionend:_a("Transition","TransitionEnd")},Fc={},z_={};pn&&(z_=document.createElement("div").style,"AnimationEvent"in window||(delete Fs.animationend.animation,delete Fs.animationiteration.animation,delete Fs.animationstart.animation),"TransitionEvent"in window||delete Fs.transitionend.transition);function sc(e){if(Fc[e])return Fc[e];if(!Fs[e])return e;var t=Fs[e],r;for(r in t)if(t.hasOwnProperty(r)&&r in z_)return Fc[e]=t[r];return e}var U_=sc("animationend"),W_=sc("animationiteration"),V_=sc("animationstart"),K_=sc("transitionend"),G_=new Map,Zp="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 Gn(e,t){G_.set(e,t),Cs(t,[e])}for(var Hc=0;Hc<Zp.length;Hc++){var $c=Zp[Hc],lb=$c.toLowerCase(),cb=$c[0].toUpperCase()+$c.slice(1);Gn(lb,"on"+cb)}Gn(U_,"onAnimationEnd");Gn(W_,"onAnimationIteration");Gn(V_,"onAnimationStart");Gn("dblclick","onDoubleClick");Gn("focusin","onFocus");Gn("focusout","onBlur");Gn(K_,"onTransitionEnd");ci("onMouseEnter",["mouseout","mouseover"]);ci("onMouseLeave",["mouseout","mouseover"]);ci("onPointerEnter",["pointerout","pointerover"]);ci("onPointerLeave",["pointerout","pointerover"]);Cs("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));Cs("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));Cs("onBeforeInput",["compositionend","keypress","textInput","paste"]);Cs("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));Cs("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));Cs("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var qi="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(" "),ub=new Set("cancel close invalid load scroll toggle".split(" ").concat(qi));function em(e,t,r){var n=e.type||"unknown-event";e.currentTarget=r,lx(n,t,void 0,e),e.currentTarget=null}function q_(e,t){t=(t&4)!==0;for(var r=0;r<e.length;r++){var n=e[r],i=n.event;n=n.listeners;e:{var a=void 0;if(t)for(var l=n.length-1;0<=l;l--){var s=n[l],o=s.instance,c=s.currentTarget;if(s=s.listener,o!==a&&i.isPropagationStopped())break e;em(i,s,c),a=o}else for(l=0;l<n.length;l++){if(s=n[l],o=s.instance,c=s.currentTarget,s=s.listener,o!==a&&i.isPropagationStopped())break e;em(i,s,c),a=o}}}if(fl)throw e=Yu,fl=!1,Yu=null,e}function nt(e,t){var r=t[oh];r===void 0&&(r=t[oh]=new Set);var n=e+"__bubble";r.has(n)||(X_(t,e,2,!1),r.add(n))}function zc(e,t,r){var n=0;t&&(n|=4),X_(r,e,n,t)}var ya="_reactListening"+Math.random().toString(36).slice(2);function Lo(e){if(!e[ya]){e[ya]=!0,r_.forEach(function(r){r!=="selectionchange"&&(ub.has(r)||zc(r,!1,e),zc(r,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[ya]||(t[ya]=!0,zc("selectionchange",!1,t))}}function X_(e,t,r,n){switch(A_(t)){case 1:var i=Cx;break;case 4:i=Ex;break;default:i=Md}r=i.bind(null,t,r,e),i=void 0,!Xu||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(i=!0),n?i!==void 0?e.addEventListener(t,r,{capture:!0,passive:i}):e.addEventListener(t,r,!0):i!==void 0?e.addEventListener(t,r,{passive:i}):e.addEventListener(t,r,!1)}function Uc(e,t,r,n,i){var a=n;if(!(t&1)&&!(t&2)&&n!==null)e:for(;;){if(n===null)return;var l=n.tag;if(l===3||l===4){var s=n.stateNode.containerInfo;if(s===i||s.nodeType===8&&s.parentNode===i)break;if(l===4)for(l=n.return;l!==null;){var o=l.tag;if((o===3||o===4)&&(o=l.stateNode.containerInfo,o===i||o.nodeType===8&&o.parentNode===i))return;l=l.return}for(;s!==null;){if(l=ls(s),l===null)return;if(o=l.tag,o===5||o===6){n=a=l;continue e}s=s.parentNode}}n=n.return}__(function(){var c=a,f=Ld(r),u=[];e:{var p=G_.get(e);if(p!==void 0){var _=Pd,y=e;switch(e){case"keypress":if(qa(r)===0)break e;case"keydown":case"keyup":_=Hx;break;case"focusin":y="focus",_=Bc;break;case"focusout":y="blur",_=Bc;break;case"beforeblur":case"afterblur":_=Bc;break;case"click":if(r.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":_=zp;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":_=Tx;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":_=Ux;break;case U_:case W_:case V_:_=Mx;break;case K_:_=Vx;break;case"scroll":_=kx;break;case"wheel":_=Gx;break;case"copy":case"cut":case"paste":_=Px;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":_=Wp}var v=(t&4)!==0,h=!v&&e==="scroll",m=v?p!==null?p+"Capture":null:p;v=[];for(var d=c,g;d!==null;){g=d;var w=g.stateNode;if(g.tag===5&&w!==null&&(g=w,m!==null&&(w=So(d,m),w!=null&&v.push(To(d,w,g)))),h)break;d=d.return}0<v.length&&(p=new _(p,y,null,r,f),u.push({event:p,listeners:v}))}}if(!(t&7)){e:{if(p=e==="mouseover"||e==="pointerover",_=e==="mouseout"||e==="pointerout",p&&r!==Gu&&(y=r.relatedTarget||r.fromElement)&&(ls(y)||y[mn]))break e;if((_||p)&&(p=f.window===f?f:(p=f.ownerDocument)?p.defaultView||p.parentWindow:window,_?(y=r.relatedTarget||r.toElement,_=c,y=y?ls(y):null,y!==null&&(h=Es(y),y!==h||y.tag!==5&&y.tag!==6)&&(y=null)):(_=null,y=c),_!==y)){if(v=zp,w="onMouseLeave",m="onMouseEnter",d="mouse",(e==="pointerout"||e==="pointerover")&&(v=Wp,w="onPointerLeave",m="onPointerEnter",d="pointer"),h=_==null?p:Hs(_),g=y==null?p:Hs(y),p=new v(w,d+"leave",_,r,f),p.target=h,p.relatedTarget=g,w=null,ls(f)===c&&(v=new v(m,d+"enter",y,r,f),v.target=g,v.relatedTarget=h,w=v),h=w,_&&y)t:{for(v=_,m=y,d=0,g=v;g;g=As(g))d++;for(g=0,w=m;w;w=As(w))g++;for(;0<d-g;)v=As(v),d--;for(;0<g-d;)m=As(m),g--;for(;d--;){if(v===m||m!==null&&v===m.alternate)break t;v=As(v),m=As(m)}v=null}else v=null;_!==null&&tm(u,p,_,v,!1),y!==null&&h!==null&&tm(u,h,y,v,!0)}}e:{if(p=c?Hs(c):window,_=p.nodeName&&p.nodeName.toLowerCase(),_==="select"||_==="input"&&p.type==="file")var b=eb;else if(Gp(p))if(j_)b=sb;else{b=rb;var x=tb}else(_=p.nodeName)&&_.toLowerCase()==="input"&&(p.type==="checkbox"||p.type==="radio")&&(b=nb);if(b&&(b=b(e,c))){N_(u,b,r,f);break e}x&&x(e,p,c),e==="focusout"&&(x=p._wrapperState)&&x.controlled&&p.type==="number"&&zu(p,"number",p.value)}switch(x=c?Hs(c):window,e){case"focusin":(Gp(x)||x.contentEditable==="true")&&(js=x,eh=c,no=null);break;case"focusout":no=eh=js=null;break;case"mousedown":th=!0;break;case"contextmenu":case"mouseup":case"dragend":th=!1,Qp(u,r,f);break;case"selectionchange":if(ab)break;case"keydown":case"keyup":Qp(u,r,f)}var C;if(Od)e:{switch(e){case"compositionstart":var S="onCompositionStart";break e;case"compositionend":S="onCompositionEnd";break e;case"compositionupdate":S="onCompositionUpdate";break e}S=void 0}else Ns?O_(e,r)&&(S="onCompositionEnd"):e==="keydown"&&r.keyCode===229&&(S="onCompositionStart");S&&(I_&&r.locale!=="ko"&&(Ns||S!=="onCompositionStart"?S==="onCompositionEnd"&&Ns&&(C=P_()):(An=f,Ad="value"in An?An.value:An.textContent,Ns=!0)),x=_l(c,S),0<x.length&&(S=new Up(S,e,null,r,f),u.push({event:S,listeners:x}),C?S.data=C:(C=B_(r),C!==null&&(S.data=C)))),(C=Xx?Yx(e,r):Jx(e,r))&&(c=_l(c,"onBeforeInput"),0<c.length&&(f=new Up("onBeforeInput","beforeinput",null,r,f),u.push({event:f,listeners:c}),f.data=C))}q_(u,t)})}function To(e,t,r){return{instance:e,listener:t,currentTarget:r}}function _l(e,t){for(var r=t+"Capture",n=[];e!==null;){var i=e,a=i.stateNode;i.tag===5&&a!==null&&(i=a,a=So(e,r),a!=null&&n.unshift(To(e,a,i)),a=So(e,t),a!=null&&n.push(To(e,a,i))),e=e.return}return n}function As(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function tm(e,t,r,n,i){for(var a=t._reactName,l=[];r!==null&&r!==n;){var s=r,o=s.alternate,c=s.stateNode;if(o!==null&&o===n)break;s.tag===5&&c!==null&&(s=c,i?(o=So(r,a),o!=null&&l.unshift(To(r,o,s))):i||(o=So(r,a),o!=null&&l.push(To(r,o,s)))),r=r.return}l.length!==0&&e.push({event:t,listeners:l})}var hb=/\r\n?/g,db=/\u0000|\uFFFD/g;function rm(e){return(typeof e=="string"?e:""+e).replace(hb,`
|
|
38
|
+
`).replace(db,"")}function wa(e,t,r){if(t=rm(t),rm(e)!==t&&r)throw Error(he(425))}function yl(){}var rh=null,nh=null;function sh(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 ih=typeof setTimeout=="function"?setTimeout:void 0,fb=typeof clearTimeout=="function"?clearTimeout:void 0,nm=typeof Promise=="function"?Promise:void 0,pb=typeof queueMicrotask=="function"?queueMicrotask:typeof nm<"u"?function(e){return nm.resolve(null).then(e).catch(mb)}:ih;function mb(e){setTimeout(function(){throw e})}function Wc(e,t){var r=t,n=0;do{var i=r.nextSibling;if(e.removeChild(r),i&&i.nodeType===8)if(r=i.data,r==="/$"){if(n===0){e.removeChild(i),Co(t);return}n--}else r!=="$"&&r!=="$?"&&r!=="$!"||n++;r=i}while(r);Co(t)}function jn(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 sm(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var r=e.data;if(r==="$"||r==="$!"||r==="$?"){if(t===0)return e;t--}else r==="/$"&&t++}e=e.previousSibling}return null}var xi=Math.random().toString(36).slice(2),zr="__reactFiber$"+xi,Ro="__reactProps$"+xi,mn="__reactContainer$"+xi,oh="__reactEvents$"+xi,gb="__reactListeners$"+xi,vb="__reactHandles$"+xi;function ls(e){var t=e[zr];if(t)return t;for(var r=e.parentNode;r;){if(t=r[mn]||r[zr]){if(r=t.alternate,t.child!==null||r!==null&&r.child!==null)for(e=sm(e);e!==null;){if(r=e[zr])return r;e=sm(e)}return t}e=r,r=e.parentNode}return null}function Jo(e){return e=e[zr]||e[mn],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function Hs(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(he(33))}function ic(e){return e[Ro]||null}var ah=[],$s=-1;function qn(e){return{current:e}}function st(e){0>$s||(e.current=ah[$s],ah[$s]=null,$s--)}function Ze(e,t){$s++,ah[$s]=e.current,e.current=t}var Wn={},Xt=qn(Wn),ir=qn(!1),ys=Wn;function ui(e,t){var r=e.type.contextTypes;if(!r)return Wn;var n=e.stateNode;if(n&&n.__reactInternalMemoizedUnmaskedChildContext===t)return n.__reactInternalMemoizedMaskedChildContext;var i={},a;for(a in r)i[a]=t[a];return n&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=i),i}function or(e){return e=e.childContextTypes,e!=null}function wl(){st(ir),st(Xt)}function im(e,t,r){if(Xt.current!==Wn)throw Error(he(168));Ze(Xt,t),Ze(ir,r)}function Y_(e,t,r){var n=e.stateNode;if(t=t.childContextTypes,typeof n.getChildContext!="function")return r;n=n.getChildContext();for(var i in n)if(!(i in t))throw Error(he(108,tx(e)||"Unknown",i));return ut({},r,n)}function Sl(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Wn,ys=Xt.current,Ze(Xt,e),Ze(ir,ir.current),!0}function om(e,t,r){var n=e.stateNode;if(!n)throw Error(he(169));r?(e=Y_(e,t,ys),n.__reactInternalMemoizedMergedChildContext=e,st(ir),st(Xt),Ze(Xt,e)):st(ir),Ze(ir,r)}var ln=null,oc=!1,Vc=!1;function J_(e){ln===null?ln=[e]:ln.push(e)}function _b(e){oc=!0,J_(e)}function Xn(){if(!Vc&&ln!==null){Vc=!0;var e=0,t=Je;try{var r=ln;for(Je=1;e<r.length;e++){var n=r[e];do n=n(!0);while(n!==null)}ln=null,oc=!1}catch(i){throw ln!==null&&(ln=ln.slice(e+1)),x_(Td,Xn),i}finally{Je=t,Vc=!1}}return null}var zs=[],Us=0,xl=null,bl=0,_r=[],yr=0,ws=null,cn=1,un="";function is(e,t){zs[Us++]=bl,zs[Us++]=xl,xl=e,bl=t}function Q_(e,t,r){_r[yr++]=cn,_r[yr++]=un,_r[yr++]=ws,ws=e;var n=cn;e=un;var i=32-Or(n)-1;n&=~(1<<i),r+=1;var a=32-Or(t)+i;if(30<a){var l=i-i%5;a=(n&(1<<l)-1).toString(32),n>>=l,i-=l,cn=1<<32-Or(t)+i|r<<i|n,un=a+e}else cn=1<<a|r<<i|n,un=e}function Nd(e){e.return!==null&&(is(e,1),Q_(e,1,0))}function jd(e){for(;e===xl;)xl=zs[--Us],zs[Us]=null,bl=zs[--Us],zs[Us]=null;for(;e===ws;)ws=_r[--yr],_r[yr]=null,un=_r[--yr],_r[yr]=null,cn=_r[--yr],_r[yr]=null}var dr=null,hr=null,ot=!1,Pr=null;function Z_(e,t){var r=wr(5,null,null,0);r.elementType="DELETED",r.stateNode=t,r.return=e,t=e.deletions,t===null?(e.deletions=[r],e.flags|=16):t.push(r)}function am(e,t){switch(e.tag){case 5:var r=e.type;return t=t.nodeType!==1||r.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,dr=e,hr=jn(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,dr=e,hr=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(r=ws!==null?{id:cn,overflow:un}:null,e.memoizedState={dehydrated:t,treeContext:r,retryLane:1073741824},r=wr(18,null,null,0),r.stateNode=t,r.return=e,e.child=r,dr=e,hr=null,!0):!1;default:return!1}}function lh(e){return(e.mode&1)!==0&&(e.flags&128)===0}function ch(e){if(ot){var t=hr;if(t){var r=t;if(!am(e,t)){if(lh(e))throw Error(he(418));t=jn(r.nextSibling);var n=dr;t&&am(e,t)?Z_(n,r):(e.flags=e.flags&-4097|2,ot=!1,dr=e)}}else{if(lh(e))throw Error(he(418));e.flags=e.flags&-4097|2,ot=!1,dr=e}}}function lm(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;dr=e}function Sa(e){if(e!==dr)return!1;if(!ot)return lm(e),ot=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!sh(e.type,e.memoizedProps)),t&&(t=hr)){if(lh(e))throw e0(),Error(he(418));for(;t;)Z_(e,t),t=jn(t.nextSibling)}if(lm(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(he(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var r=e.data;if(r==="/$"){if(t===0){hr=jn(e.nextSibling);break e}t--}else r!=="$"&&r!=="$!"&&r!=="$?"||t++}e=e.nextSibling}hr=null}}else hr=dr?jn(e.stateNode.nextSibling):null;return!0}function e0(){for(var e=hr;e;)e=jn(e.nextSibling)}function hi(){hr=dr=null,ot=!1}function Fd(e){Pr===null?Pr=[e]:Pr.push(e)}var yb=yn.ReactCurrentBatchConfig;function Ni(e,t,r){if(e=r.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(r._owner){if(r=r._owner,r){if(r.tag!==1)throw Error(he(309));var n=r.stateNode}if(!n)throw Error(he(147,e));var i=n,a=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===a?t.ref:(t=function(l){var s=i.refs;l===null?delete s[a]:s[a]=l},t._stringRef=a,t)}if(typeof e!="string")throw Error(he(284));if(!r._owner)throw Error(he(290,e))}return e}function xa(e,t){throw e=Object.prototype.toString.call(t),Error(he(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function cm(e){var t=e._init;return t(e._payload)}function t0(e){function t(m,d){if(e){var g=m.deletions;g===null?(m.deletions=[d],m.flags|=16):g.push(d)}}function r(m,d){if(!e)return null;for(;d!==null;)t(m,d),d=d.sibling;return null}function n(m,d){for(m=new Map;d!==null;)d.key!==null?m.set(d.key,d):m.set(d.index,d),d=d.sibling;return m}function i(m,d){return m=zn(m,d),m.index=0,m.sibling=null,m}function a(m,d,g){return m.index=g,e?(g=m.alternate,g!==null?(g=g.index,g<d?(m.flags|=2,d):g):(m.flags|=2,d)):(m.flags|=1048576,d)}function l(m){return e&&m.alternate===null&&(m.flags|=2),m}function s(m,d,g,w){return d===null||d.tag!==6?(d=Qc(g,m.mode,w),d.return=m,d):(d=i(d,g),d.return=m,d)}function o(m,d,g,w){var b=g.type;return b===Bs?f(m,d,g.props.children,w,g.key):d!==null&&(d.elementType===b||typeof b=="object"&&b!==null&&b.$$typeof===Ln&&cm(b)===d.type)?(w=i(d,g.props),w.ref=Ni(m,d,g),w.return=m,w):(w=tl(g.type,g.key,g.props,null,m.mode,w),w.ref=Ni(m,d,g),w.return=m,w)}function c(m,d,g,w){return d===null||d.tag!==4||d.stateNode.containerInfo!==g.containerInfo||d.stateNode.implementation!==g.implementation?(d=Zc(g,m.mode,w),d.return=m,d):(d=i(d,g.children||[]),d.return=m,d)}function f(m,d,g,w,b){return d===null||d.tag!==7?(d=gs(g,m.mode,w,b),d.return=m,d):(d=i(d,g),d.return=m,d)}function u(m,d,g){if(typeof d=="string"&&d!==""||typeof d=="number")return d=Qc(""+d,m.mode,g),d.return=m,d;if(typeof d=="object"&&d!==null){switch(d.$$typeof){case ha:return g=tl(d.type,d.key,d.props,null,m.mode,g),g.ref=Ni(m,null,d),g.return=m,g;case Os:return d=Zc(d,m.mode,g),d.return=m,d;case Ln:var w=d._init;return u(m,w(d._payload),g)}if(Ki(d)||Ai(d))return d=gs(d,m.mode,g,null),d.return=m,d;xa(m,d)}return null}function p(m,d,g,w){var b=d!==null?d.key:null;if(typeof g=="string"&&g!==""||typeof g=="number")return b!==null?null:s(m,d,""+g,w);if(typeof g=="object"&&g!==null){switch(g.$$typeof){case ha:return g.key===b?o(m,d,g,w):null;case Os:return g.key===b?c(m,d,g,w):null;case Ln:return b=g._init,p(m,d,b(g._payload),w)}if(Ki(g)||Ai(g))return b!==null?null:f(m,d,g,w,null);xa(m,g)}return null}function _(m,d,g,w,b){if(typeof w=="string"&&w!==""||typeof w=="number")return m=m.get(g)||null,s(d,m,""+w,b);if(typeof w=="object"&&w!==null){switch(w.$$typeof){case ha:return m=m.get(w.key===null?g:w.key)||null,o(d,m,w,b);case Os:return m=m.get(w.key===null?g:w.key)||null,c(d,m,w,b);case Ln:var x=w._init;return _(m,d,g,x(w._payload),b)}if(Ki(w)||Ai(w))return m=m.get(g)||null,f(d,m,w,b,null);xa(d,w)}return null}function y(m,d,g,w){for(var b=null,x=null,C=d,S=d=0,k=null;C!==null&&S<g.length;S++){C.index>S?(k=C,C=null):k=C.sibling;var L=p(m,C,g[S],w);if(L===null){C===null&&(C=k);break}e&&C&&L.alternate===null&&t(m,C),d=a(L,d,S),x===null?b=L:x.sibling=L,x=L,C=k}if(S===g.length)return r(m,C),ot&&is(m,S),b;if(C===null){for(;S<g.length;S++)C=u(m,g[S],w),C!==null&&(d=a(C,d,S),x===null?b=C:x.sibling=C,x=C);return ot&&is(m,S),b}for(C=n(m,C);S<g.length;S++)k=_(C,m,S,g[S],w),k!==null&&(e&&k.alternate!==null&&C.delete(k.key===null?S:k.key),d=a(k,d,S),x===null?b=k:x.sibling=k,x=k);return e&&C.forEach(function(A){return t(m,A)}),ot&&is(m,S),b}function v(m,d,g,w){var b=Ai(g);if(typeof b!="function")throw Error(he(150));if(g=b.call(g),g==null)throw Error(he(151));for(var x=b=null,C=d,S=d=0,k=null,L=g.next();C!==null&&!L.done;S++,L=g.next()){C.index>S?(k=C,C=null):k=C.sibling;var A=p(m,C,L.value,w);if(A===null){C===null&&(C=k);break}e&&C&&A.alternate===null&&t(m,C),d=a(A,d,S),x===null?b=A:x.sibling=A,x=A,C=k}if(L.done)return r(m,C),ot&&is(m,S),b;if(C===null){for(;!L.done;S++,L=g.next())L=u(m,L.value,w),L!==null&&(d=a(L,d,S),x===null?b=L:x.sibling=L,x=L);return ot&&is(m,S),b}for(C=n(m,C);!L.done;S++,L=g.next())L=_(C,m,S,L.value,w),L!==null&&(e&&L.alternate!==null&&C.delete(L.key===null?S:L.key),d=a(L,d,S),x===null?b=L:x.sibling=L,x=L);return e&&C.forEach(function(M){return t(m,M)}),ot&&is(m,S),b}function h(m,d,g,w){if(typeof g=="object"&&g!==null&&g.type===Bs&&g.key===null&&(g=g.props.children),typeof g=="object"&&g!==null){switch(g.$$typeof){case ha:e:{for(var b=g.key,x=d;x!==null;){if(x.key===b){if(b=g.type,b===Bs){if(x.tag===7){r(m,x.sibling),d=i(x,g.props.children),d.return=m,m=d;break e}}else if(x.elementType===b||typeof b=="object"&&b!==null&&b.$$typeof===Ln&&cm(b)===x.type){r(m,x.sibling),d=i(x,g.props),d.ref=Ni(m,x,g),d.return=m,m=d;break e}r(m,x);break}else t(m,x);x=x.sibling}g.type===Bs?(d=gs(g.props.children,m.mode,w,g.key),d.return=m,m=d):(w=tl(g.type,g.key,g.props,null,m.mode,w),w.ref=Ni(m,d,g),w.return=m,m=w)}return l(m);case Os:e:{for(x=g.key;d!==null;){if(d.key===x)if(d.tag===4&&d.stateNode.containerInfo===g.containerInfo&&d.stateNode.implementation===g.implementation){r(m,d.sibling),d=i(d,g.children||[]),d.return=m,m=d;break e}else{r(m,d);break}else t(m,d);d=d.sibling}d=Zc(g,m.mode,w),d.return=m,m=d}return l(m);case Ln:return x=g._init,h(m,d,x(g._payload),w)}if(Ki(g))return y(m,d,g,w);if(Ai(g))return v(m,d,g,w);xa(m,g)}return typeof g=="string"&&g!==""||typeof g=="number"?(g=""+g,d!==null&&d.tag===6?(r(m,d.sibling),d=i(d,g),d.return=m,m=d):(r(m,d),d=Qc(g,m.mode,w),d.return=m,m=d),l(m)):r(m,d)}return h}var di=t0(!0),r0=t0(!1),Cl=qn(null),El=null,Ws=null,Hd=null;function $d(){Hd=Ws=El=null}function zd(e){var t=Cl.current;st(Cl),e._currentValue=t}function uh(e,t,r){for(;e!==null;){var n=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,n!==null&&(n.childLanes|=t)):n!==null&&(n.childLanes&t)!==t&&(n.childLanes|=t),e===r)break;e=e.return}}function ri(e,t){El=e,Hd=Ws=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(sr=!0),e.firstContext=null)}function Cr(e){var t=e._currentValue;if(Hd!==e)if(e={context:e,memoizedValue:t,next:null},Ws===null){if(El===null)throw Error(he(308));Ws=e,El.dependencies={lanes:0,firstContext:e}}else Ws=Ws.next=e;return t}var cs=null;function Ud(e){cs===null?cs=[e]:cs.push(e)}function n0(e,t,r,n){var i=t.interleaved;return i===null?(r.next=r,Ud(t)):(r.next=i.next,i.next=r),t.interleaved=r,gn(e,n)}function gn(e,t){e.lanes|=t;var r=e.alternate;for(r!==null&&(r.lanes|=t),r=e,e=e.return;e!==null;)e.childLanes|=t,r=e.alternate,r!==null&&(r.childLanes|=t),r=e,e=e.return;return r.tag===3?r.stateNode:null}var Tn=!1;function Wd(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function s0(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 dn(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Fn(e,t,r){var n=e.updateQueue;if(n===null)return null;if(n=n.shared,qe&2){var i=n.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),n.pending=t,gn(e,r)}return i=n.interleaved,i===null?(t.next=t,Ud(n)):(t.next=i.next,i.next=t),n.interleaved=t,gn(e,r)}function Xa(e,t,r){if(t=t.updateQueue,t!==null&&(t=t.shared,(r&4194240)!==0)){var n=t.lanes;n&=e.pendingLanes,r|=n,t.lanes=r,Rd(e,r)}}function um(e,t){var r=e.updateQueue,n=e.alternate;if(n!==null&&(n=n.updateQueue,r===n)){var i=null,a=null;if(r=r.firstBaseUpdate,r!==null){do{var l={eventTime:r.eventTime,lane:r.lane,tag:r.tag,payload:r.payload,callback:r.callback,next:null};a===null?i=a=l:a=a.next=l,r=r.next}while(r!==null);a===null?i=a=t:a=a.next=t}else i=a=t;r={baseState:n.baseState,firstBaseUpdate:i,lastBaseUpdate:a,shared:n.shared,effects:n.effects},e.updateQueue=r;return}e=r.lastBaseUpdate,e===null?r.firstBaseUpdate=t:e.next=t,r.lastBaseUpdate=t}function kl(e,t,r,n){var i=e.updateQueue;Tn=!1;var a=i.firstBaseUpdate,l=i.lastBaseUpdate,s=i.shared.pending;if(s!==null){i.shared.pending=null;var o=s,c=o.next;o.next=null,l===null?a=c:l.next=c,l=o;var f=e.alternate;f!==null&&(f=f.updateQueue,s=f.lastBaseUpdate,s!==l&&(s===null?f.firstBaseUpdate=c:s.next=c,f.lastBaseUpdate=o))}if(a!==null){var u=i.baseState;l=0,f=c=o=null,s=a;do{var p=s.lane,_=s.eventTime;if((n&p)===p){f!==null&&(f=f.next={eventTime:_,lane:0,tag:s.tag,payload:s.payload,callback:s.callback,next:null});e:{var y=e,v=s;switch(p=t,_=r,v.tag){case 1:if(y=v.payload,typeof y=="function"){u=y.call(_,u,p);break e}u=y;break e;case 3:y.flags=y.flags&-65537|128;case 0:if(y=v.payload,p=typeof y=="function"?y.call(_,u,p):y,p==null)break e;u=ut({},u,p);break e;case 2:Tn=!0}}s.callback!==null&&s.lane!==0&&(e.flags|=64,p=i.effects,p===null?i.effects=[s]:p.push(s))}else _={eventTime:_,lane:p,tag:s.tag,payload:s.payload,callback:s.callback,next:null},f===null?(c=f=_,o=u):f=f.next=_,l|=p;if(s=s.next,s===null){if(s=i.shared.pending,s===null)break;p=s,s=p.next,p.next=null,i.lastBaseUpdate=p,i.shared.pending=null}}while(!0);if(f===null&&(o=u),i.baseState=o,i.firstBaseUpdate=c,i.lastBaseUpdate=f,t=i.shared.interleaved,t!==null){i=t;do l|=i.lane,i=i.next;while(i!==t)}else a===null&&(i.shared.lanes=0);xs|=l,e.lanes=l,e.memoizedState=u}}function hm(e,t,r){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var n=e[t],i=n.callback;if(i!==null){if(n.callback=null,n=r,typeof i!="function")throw Error(he(191,i));i.call(n)}}}var Qo={},Vr=qn(Qo),Do=qn(Qo),Mo=qn(Qo);function us(e){if(e===Qo)throw Error(he(174));return e}function Vd(e,t){switch(Ze(Mo,t),Ze(Do,e),Ze(Vr,Qo),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:Wu(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=Wu(t,e)}st(Vr),Ze(Vr,t)}function fi(){st(Vr),st(Do),st(Mo)}function i0(e){us(Mo.current);var t=us(Vr.current),r=Wu(t,e.type);t!==r&&(Ze(Do,e),Ze(Vr,r))}function Kd(e){Do.current===e&&(st(Vr),st(Do))}var at=qn(0);function Ll(e){for(var t=e;t!==null;){if(t.tag===13){var r=t.memoizedState;if(r!==null&&(r=r.dehydrated,r===null||r.data==="$?"||r.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var Kc=[];function Gd(){for(var e=0;e<Kc.length;e++)Kc[e]._workInProgressVersionPrimary=null;Kc.length=0}var Ya=yn.ReactCurrentDispatcher,Gc=yn.ReactCurrentBatchConfig,Ss=0,ct=null,St=null,Lt=null,Tl=!1,so=!1,Ao=0,wb=0;function Ut(){throw Error(he(321))}function qd(e,t){if(t===null)return!1;for(var r=0;r<t.length&&r<e.length;r++)if(!Nr(e[r],t[r]))return!1;return!0}function Xd(e,t,r,n,i,a){if(Ss=a,ct=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,Ya.current=e===null||e.memoizedState===null?Cb:Eb,e=r(n,i),so){a=0;do{if(so=!1,Ao=0,25<=a)throw Error(he(301));a+=1,Lt=St=null,t.updateQueue=null,Ya.current=kb,e=r(n,i)}while(so)}if(Ya.current=Rl,t=St!==null&&St.next!==null,Ss=0,Lt=St=ct=null,Tl=!1,t)throw Error(he(300));return e}function Yd(){var e=Ao!==0;return Ao=0,e}function $r(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Lt===null?ct.memoizedState=Lt=e:Lt=Lt.next=e,Lt}function Er(){if(St===null){var e=ct.alternate;e=e!==null?e.memoizedState:null}else e=St.next;var t=Lt===null?ct.memoizedState:Lt.next;if(t!==null)Lt=t,St=e;else{if(e===null)throw Error(he(310));St=e,e={memoizedState:St.memoizedState,baseState:St.baseState,baseQueue:St.baseQueue,queue:St.queue,next:null},Lt===null?ct.memoizedState=Lt=e:Lt=Lt.next=e}return Lt}function Po(e,t){return typeof t=="function"?t(e):t}function qc(e){var t=Er(),r=t.queue;if(r===null)throw Error(he(311));r.lastRenderedReducer=e;var n=St,i=n.baseQueue,a=r.pending;if(a!==null){if(i!==null){var l=i.next;i.next=a.next,a.next=l}n.baseQueue=i=a,r.pending=null}if(i!==null){a=i.next,n=n.baseState;var s=l=null,o=null,c=a;do{var f=c.lane;if((Ss&f)===f)o!==null&&(o=o.next={lane:0,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null}),n=c.hasEagerState?c.eagerState:e(n,c.action);else{var u={lane:f,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null};o===null?(s=o=u,l=n):o=o.next=u,ct.lanes|=f,xs|=f}c=c.next}while(c!==null&&c!==a);o===null?l=n:o.next=s,Nr(n,t.memoizedState)||(sr=!0),t.memoizedState=n,t.baseState=l,t.baseQueue=o,r.lastRenderedState=n}if(e=r.interleaved,e!==null){i=e;do a=i.lane,ct.lanes|=a,xs|=a,i=i.next;while(i!==e)}else i===null&&(r.lanes=0);return[t.memoizedState,r.dispatch]}function Xc(e){var t=Er(),r=t.queue;if(r===null)throw Error(he(311));r.lastRenderedReducer=e;var n=r.dispatch,i=r.pending,a=t.memoizedState;if(i!==null){r.pending=null;var l=i=i.next;do a=e(a,l.action),l=l.next;while(l!==i);Nr(a,t.memoizedState)||(sr=!0),t.memoizedState=a,t.baseQueue===null&&(t.baseState=a),r.lastRenderedState=a}return[a,n]}function o0(){}function a0(e,t){var r=ct,n=Er(),i=t(),a=!Nr(n.memoizedState,i);if(a&&(n.memoizedState=i,sr=!0),n=n.queue,Jd(u0.bind(null,r,n,e),[e]),n.getSnapshot!==t||a||Lt!==null&&Lt.memoizedState.tag&1){if(r.flags|=2048,Io(9,c0.bind(null,r,n,i,t),void 0,null),Pt===null)throw Error(he(349));Ss&30||l0(r,t,i)}return i}function l0(e,t,r){e.flags|=16384,e={getSnapshot:t,value:r},t=ct.updateQueue,t===null?(t={lastEffect:null,stores:null},ct.updateQueue=t,t.stores=[e]):(r=t.stores,r===null?t.stores=[e]:r.push(e))}function c0(e,t,r,n){t.value=r,t.getSnapshot=n,h0(t)&&d0(e)}function u0(e,t,r){return r(function(){h0(t)&&d0(e)})}function h0(e){var t=e.getSnapshot;e=e.value;try{var r=t();return!Nr(e,r)}catch{return!0}}function d0(e){var t=gn(e,1);t!==null&&Br(t,e,1,-1)}function dm(e){var t=$r();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Po,lastRenderedState:e},t.queue=e,e=e.dispatch=bb.bind(null,ct,e),[t.memoizedState,e]}function Io(e,t,r,n){return e={tag:e,create:t,destroy:r,deps:n,next:null},t=ct.updateQueue,t===null?(t={lastEffect:null,stores:null},ct.updateQueue=t,t.lastEffect=e.next=e):(r=t.lastEffect,r===null?t.lastEffect=e.next=e:(n=r.next,r.next=e,e.next=n,t.lastEffect=e)),e}function f0(){return Er().memoizedState}function Ja(e,t,r,n){var i=$r();ct.flags|=e,i.memoizedState=Io(1|t,r,void 0,n===void 0?null:n)}function ac(e,t,r,n){var i=Er();n=n===void 0?null:n;var a=void 0;if(St!==null){var l=St.memoizedState;if(a=l.destroy,n!==null&&qd(n,l.deps)){i.memoizedState=Io(t,r,a,n);return}}ct.flags|=e,i.memoizedState=Io(1|t,r,a,n)}function fm(e,t){return Ja(8390656,8,e,t)}function Jd(e,t){return ac(2048,8,e,t)}function p0(e,t){return ac(4,2,e,t)}function m0(e,t){return ac(4,4,e,t)}function g0(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 v0(e,t,r){return r=r!=null?r.concat([e]):null,ac(4,4,g0.bind(null,t,e),r)}function Qd(){}function _0(e,t){var r=Er();t=t===void 0?null:t;var n=r.memoizedState;return n!==null&&t!==null&&qd(t,n[1])?n[0]:(r.memoizedState=[e,t],e)}function y0(e,t){var r=Er();t=t===void 0?null:t;var n=r.memoizedState;return n!==null&&t!==null&&qd(t,n[1])?n[0]:(e=e(),r.memoizedState=[e,t],e)}function w0(e,t,r){return Ss&21?(Nr(r,t)||(r=E_(),ct.lanes|=r,xs|=r,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,sr=!0),e.memoizedState=r)}function Sb(e,t){var r=Je;Je=r!==0&&4>r?r:4,e(!0);var n=Gc.transition;Gc.transition={};try{e(!1),t()}finally{Je=r,Gc.transition=n}}function S0(){return Er().memoizedState}function xb(e,t,r){var n=$n(e);if(r={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null},x0(e))b0(t,r);else if(r=n0(e,t,r,n),r!==null){var i=er();Br(r,e,n,i),C0(r,t,n)}}function bb(e,t,r){var n=$n(e),i={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null};if(x0(e))b0(t,i);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var l=t.lastRenderedState,s=a(l,r);if(i.hasEagerState=!0,i.eagerState=s,Nr(s,l)){var o=t.interleaved;o===null?(i.next=i,Ud(t)):(i.next=o.next,o.next=i),t.interleaved=i;return}}catch{}finally{}r=n0(e,t,i,n),r!==null&&(i=er(),Br(r,e,n,i),C0(r,t,n))}}function x0(e){var t=e.alternate;return e===ct||t!==null&&t===ct}function b0(e,t){so=Tl=!0;var r=e.pending;r===null?t.next=t:(t.next=r.next,r.next=t),e.pending=t}function C0(e,t,r){if(r&4194240){var n=t.lanes;n&=e.pendingLanes,r|=n,t.lanes=r,Rd(e,r)}}var Rl={readContext:Cr,useCallback:Ut,useContext:Ut,useEffect:Ut,useImperativeHandle:Ut,useInsertionEffect:Ut,useLayoutEffect:Ut,useMemo:Ut,useReducer:Ut,useRef:Ut,useState:Ut,useDebugValue:Ut,useDeferredValue:Ut,useTransition:Ut,useMutableSource:Ut,useSyncExternalStore:Ut,useId:Ut,unstable_isNewReconciler:!1},Cb={readContext:Cr,useCallback:function(e,t){return $r().memoizedState=[e,t===void 0?null:t],e},useContext:Cr,useEffect:fm,useImperativeHandle:function(e,t,r){return r=r!=null?r.concat([e]):null,Ja(4194308,4,g0.bind(null,t,e),r)},useLayoutEffect:function(e,t){return Ja(4194308,4,e,t)},useInsertionEffect:function(e,t){return Ja(4,2,e,t)},useMemo:function(e,t){var r=$r();return t=t===void 0?null:t,e=e(),r.memoizedState=[e,t],e},useReducer:function(e,t,r){var n=$r();return t=r!==void 0?r(t):t,n.memoizedState=n.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},n.queue=e,e=e.dispatch=xb.bind(null,ct,e),[n.memoizedState,e]},useRef:function(e){var t=$r();return e={current:e},t.memoizedState=e},useState:dm,useDebugValue:Qd,useDeferredValue:function(e){return $r().memoizedState=e},useTransition:function(){var e=dm(!1),t=e[0];return e=Sb.bind(null,e[1]),$r().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,r){var n=ct,i=$r();if(ot){if(r===void 0)throw Error(he(407));r=r()}else{if(r=t(),Pt===null)throw Error(he(349));Ss&30||l0(n,t,r)}i.memoizedState=r;var a={value:r,getSnapshot:t};return i.queue=a,fm(u0.bind(null,n,a,e),[e]),n.flags|=2048,Io(9,c0.bind(null,n,a,r,t),void 0,null),r},useId:function(){var e=$r(),t=Pt.identifierPrefix;if(ot){var r=un,n=cn;r=(n&~(1<<32-Or(n)-1)).toString(32)+r,t=":"+t+"R"+r,r=Ao++,0<r&&(t+="H"+r.toString(32)),t+=":"}else r=wb++,t=":"+t+"r"+r.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},Eb={readContext:Cr,useCallback:_0,useContext:Cr,useEffect:Jd,useImperativeHandle:v0,useInsertionEffect:p0,useLayoutEffect:m0,useMemo:y0,useReducer:qc,useRef:f0,useState:function(){return qc(Po)},useDebugValue:Qd,useDeferredValue:function(e){var t=Er();return w0(t,St.memoizedState,e)},useTransition:function(){var e=qc(Po)[0],t=Er().memoizedState;return[e,t]},useMutableSource:o0,useSyncExternalStore:a0,useId:S0,unstable_isNewReconciler:!1},kb={readContext:Cr,useCallback:_0,useContext:Cr,useEffect:Jd,useImperativeHandle:v0,useInsertionEffect:p0,useLayoutEffect:m0,useMemo:y0,useReducer:Xc,useRef:f0,useState:function(){return Xc(Po)},useDebugValue:Qd,useDeferredValue:function(e){var t=Er();return St===null?t.memoizedState=e:w0(t,St.memoizedState,e)},useTransition:function(){var e=Xc(Po)[0],t=Er().memoizedState;return[e,t]},useMutableSource:o0,useSyncExternalStore:a0,useId:S0,unstable_isNewReconciler:!1};function Dr(e,t){if(e&&e.defaultProps){t=ut({},t),e=e.defaultProps;for(var r in e)t[r]===void 0&&(t[r]=e[r]);return t}return t}function hh(e,t,r,n){t=e.memoizedState,r=r(n,t),r=r==null?t:ut({},t,r),e.memoizedState=r,e.lanes===0&&(e.updateQueue.baseState=r)}var lc={isMounted:function(e){return(e=e._reactInternals)?Es(e)===e:!1},enqueueSetState:function(e,t,r){e=e._reactInternals;var n=er(),i=$n(e),a=dn(n,i);a.payload=t,r!=null&&(a.callback=r),t=Fn(e,a,i),t!==null&&(Br(t,e,i,n),Xa(t,e,i))},enqueueReplaceState:function(e,t,r){e=e._reactInternals;var n=er(),i=$n(e),a=dn(n,i);a.tag=1,a.payload=t,r!=null&&(a.callback=r),t=Fn(e,a,i),t!==null&&(Br(t,e,i,n),Xa(t,e,i))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var r=er(),n=$n(e),i=dn(r,n);i.tag=2,t!=null&&(i.callback=t),t=Fn(e,i,n),t!==null&&(Br(t,e,n,r),Xa(t,e,n))}};function pm(e,t,r,n,i,a,l){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(n,a,l):t.prototype&&t.prototype.isPureReactComponent?!ko(r,n)||!ko(i,a):!0}function E0(e,t,r){var n=!1,i=Wn,a=t.contextType;return typeof a=="object"&&a!==null?a=Cr(a):(i=or(t)?ys:Xt.current,n=t.contextTypes,a=(n=n!=null)?ui(e,i):Wn),t=new t(r,a),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=lc,e.stateNode=t,t._reactInternals=e,n&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=i,e.__reactInternalMemoizedMaskedChildContext=a),t}function mm(e,t,r,n){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(r,n),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(r,n),t.state!==e&&lc.enqueueReplaceState(t,t.state,null)}function dh(e,t,r,n){var i=e.stateNode;i.props=r,i.state=e.memoizedState,i.refs={},Wd(e);var a=t.contextType;typeof a=="object"&&a!==null?i.context=Cr(a):(a=or(t)?ys:Xt.current,i.context=ui(e,a)),i.state=e.memoizedState,a=t.getDerivedStateFromProps,typeof a=="function"&&(hh(e,t,a,r),i.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof i.getSnapshotBeforeUpdate=="function"||typeof i.UNSAFE_componentWillMount!="function"&&typeof i.componentWillMount!="function"||(t=i.state,typeof i.componentWillMount=="function"&&i.componentWillMount(),typeof i.UNSAFE_componentWillMount=="function"&&i.UNSAFE_componentWillMount(),t!==i.state&&lc.enqueueReplaceState(i,i.state,null),kl(e,r,i,n),i.state=e.memoizedState),typeof i.componentDidMount=="function"&&(e.flags|=4194308)}function pi(e,t){try{var r="",n=t;do r+=ex(n),n=n.return;while(n);var i=r}catch(a){i=`
|
|
39
39
|
Error generating stack: `+a.message+`
|
|
40
|
-
`+a.stack}return{value:e,source:t,stack:i,digest:null}}function Yc(e,t,r){return{value:e,source:null,stack:r??null,digest:t??null}}function fh(e,t){try{console.error(t.value)}catch(r){setTimeout(function(){throw r})}}var Lb=typeof WeakMap=="function"?WeakMap:Map;function k0(e,t,r){r=dn(-1,r),r.tag=3,r.payload={element:null};var n=t.value;return r.callback=function(){Ml||(Ml=!0,bh=n),fh(e,t)},r}function L0(e,t,r){r=dn(-1,r),r.tag=3;var n=e.type.getDerivedStateFromError;if(typeof n=="function"){var i=t.value;r.payload=function(){return n(i)},r.callback=function(){fh(e,t)}}var a=e.stateNode;return a!==null&&typeof a.componentDidCatch=="function"&&(r.callback=function(){fh(e,t),typeof n!="function"&&(Hn===null?Hn=new Set([this]):Hn.add(this));var l=t.stack;this.componentDidCatch(t.value,{componentStack:l!==null?l:""})}),r}function gm(e,t,r){var n=e.pingCache;if(n===null){n=e.pingCache=new Lb;var i=new Set;n.set(t,i)}else i=n.get(t),i===void 0&&(i=new Set,n.set(t,i));i.has(r)||(i.add(r),e=$b.bind(null,e,t,r),t.then(e,e))}function vm(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 _m(e,t,r,n,i){return e.mode&1?(e.flags|=65536,e.lanes=i,e):(e===t?e.flags|=65536:(e.flags|=128,r.flags|=131072,r.flags&=-52805,r.tag===1&&(r.alternate===null?r.tag=17:(t=dn(-1,1),t.tag=2,Fn(r,t,1))),r.lanes|=1),e)}var Tb=yn.ReactCurrentOwner,sr=!1;function Jt(e,t,r,n){t.child=e===null?r0(t,null,r,n):di(t,e.child,r,n)}function ym(e,t,r,n,i){r=r.render;var a=t.ref;return ri(t,i),n=Xd(e,t,r,n,a,i),r=Yd(),e!==null&&!sr?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,vn(e,t,i)):(ot&&r&&Nd(t),t.flags|=1,Jt(e,t,n,i),t.child)}function wm(e,t,r,n,i){if(e===null){var a=r.type;return typeof a=="function"&&!af(a)&&a.defaultProps===void 0&&r.compare===null&&r.defaultProps===void 0?(t.tag=15,t.type=a,T0(e,t,a,n,i)):(e=tl(r.type,null,n,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,!(e.lanes&i)){var l=a.memoizedProps;if(r=r.compare,r=r!==null?r:ko,r(l,n)&&e.ref===t.ref)return vn(e,t,i)}return t.flags|=1,e=zn(a,n),e.ref=t.ref,e.return=t,t.child=e}function T0(e,t,r,n,i){if(e!==null){var a=e.memoizedProps;if(ko(a,n)&&e.ref===t.ref)if(sr=!1,t.pendingProps=n=a,(e.lanes&i)!==0)e.flags&131072&&(sr=!0);else return t.lanes=e.lanes,vn(e,t,i)}return ph(e,t,r,n,i)}function R0(e,t,r){var n=t.pendingProps,i=n.children,a=e!==null?e.memoizedState:null;if(n.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},Ze(Ks,cr),cr|=r;else{if(!(r&1073741824))return e=a!==null?a.baseLanes|r:r,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,Ze(Ks,cr),cr|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},n=a!==null?a.baseLanes:r,Ze(Ks,cr),cr|=n}else a!==null?(n=a.baseLanes|r,t.memoizedState=null):n=r,Ze(Ks,cr),cr|=n;return Jt(e,t,i,r),t.child}function D0(e,t){var r=t.ref;(e===null&&r!==null||e!==null&&e.ref!==r)&&(t.flags|=512,t.flags|=2097152)}function ph(e,t,r,n,i){var a=or(r)?ys:Xt.current;return a=ui(t,a),ri(t,i),r=Xd(e,t,r,n,a,i),n=Yd(),e!==null&&!sr?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,vn(e,t,i)):(ot&&n&&Nd(t),t.flags|=1,Jt(e,t,r,i),t.child)}function Sm(e,t,r,n,i){if(or(r)){var a=!0;Sl(t)}else a=!1;if(ri(t,i),t.stateNode===null)Qa(e,t),E0(t,r,n),dh(t,r,n,i),n=!0;else if(e===null){var l=t.stateNode,s=t.memoizedProps;l.props=s;var o=l.context,c=r.contextType;typeof c=="object"&&c!==null?c=Cr(c):(c=or(r)?ys:Xt.current,c=ui(t,c));var f=r.getDerivedStateFromProps,u=typeof f=="function"||typeof l.getSnapshotBeforeUpdate=="function";u||typeof l.UNSAFE_componentWillReceiveProps!="function"&&typeof l.componentWillReceiveProps!="function"||(s!==n||o!==c)&&mm(t,l,n,c),Tn=!1;var p=t.memoizedState;l.state=p,kl(t,n,l,i),o=t.memoizedState,s!==n||p!==o||ir.current||Tn?(typeof f=="function"&&(hh(t,r,f,n),o=t.memoizedState),(s=Tn||pm(t,r,s,n,p,o,c))?(u||typeof l.UNSAFE_componentWillMount!="function"&&typeof l.componentWillMount!="function"||(typeof l.componentWillMount=="function"&&l.componentWillMount(),typeof l.UNSAFE_componentWillMount=="function"&&l.UNSAFE_componentWillMount()),typeof l.componentDidMount=="function"&&(t.flags|=4194308)):(typeof l.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=n,t.memoizedState=o),l.props=n,l.state=o,l.context=c,n=s):(typeof l.componentDidMount=="function"&&(t.flags|=4194308),n=!1)}else{l=t.stateNode,s0(e,t),s=t.memoizedProps,c=t.type===t.elementType?s:Dr(t.type,s),l.props=c,u=t.pendingProps,p=l.context,o=r.contextType,typeof o=="object"&&o!==null?o=Cr(o):(o=or(r)?ys:Xt.current,o=ui(t,o));var _=r.getDerivedStateFromProps;(f=typeof _=="function"||typeof l.getSnapshotBeforeUpdate=="function")||typeof l.UNSAFE_componentWillReceiveProps!="function"&&typeof l.componentWillReceiveProps!="function"||(s!==u||p!==o)&&mm(t,l,n,o),Tn=!1,p=t.memoizedState,l.state=p,kl(t,n,l,i);var y=t.memoizedState;s!==u||p!==y||ir.current||Tn?(typeof _=="function"&&(hh(t,r,_,n),y=t.memoizedState),(c=Tn||pm(t,r,c,n,p,y,o)||!1)?(f||typeof l.UNSAFE_componentWillUpdate!="function"&&typeof l.componentWillUpdate!="function"||(typeof l.componentWillUpdate=="function"&&l.componentWillUpdate(n,y,o),typeof l.UNSAFE_componentWillUpdate=="function"&&l.UNSAFE_componentWillUpdate(n,y,o)),typeof l.componentDidUpdate=="function"&&(t.flags|=4),typeof l.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof l.componentDidUpdate!="function"||s===e.memoizedProps&&p===e.memoizedState||(t.flags|=4),typeof l.getSnapshotBeforeUpdate!="function"||s===e.memoizedProps&&p===e.memoizedState||(t.flags|=1024),t.memoizedProps=n,t.memoizedState=y),l.props=n,l.state=y,l.context=o,n=c):(typeof l.componentDidUpdate!="function"||s===e.memoizedProps&&p===e.memoizedState||(t.flags|=4),typeof l.getSnapshotBeforeUpdate!="function"||s===e.memoizedProps&&p===e.memoizedState||(t.flags|=1024),n=!1)}return mh(e,t,r,n,a,i)}function mh(e,t,r,n,i,a){D0(e,t);var l=(t.flags&128)!==0;if(!n&&!l)return i&&om(t,r,!1),vn(e,t,a);n=t.stateNode,Tb.current=t;var s=l&&typeof r.getDerivedStateFromError!="function"?null:n.render();return t.flags|=1,e!==null&&l?(t.child=di(t,e.child,null,a),t.child=di(t,null,s,a)):Jt(e,t,s,a),t.memoizedState=n.state,i&&om(t,r,!0),t.child}function M0(e){var t=e.stateNode;t.pendingContext?im(e,t.pendingContext,t.pendingContext!==t.context):t.context&&im(e,t.context,!1),Vd(e,t.containerInfo)}function xm(e,t,r,n,i){return hi(),Fd(i),t.flags|=256,Jt(e,t,r,n),t.child}var gh={dehydrated:null,treeContext:null,retryLane:0};function vh(e){return{baseLanes:e,cachePool:null,transitions:null}}function A0(e,t,r){var n=t.pendingProps,i=at.current,a=!1,l=(t.flags&128)!==0,s;if((s=l)||(s=e!==null&&e.memoizedState===null?!1:(i&2)!==0),s?(a=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(i|=1),Ze(at,i&1),e===null)return ch(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):(l=n.children,e=n.fallback,a?(n=t.mode,a=t.child,l={mode:"hidden",children:l},!(n&1)&&a!==null?(a.childLanes=0,a.pendingProps=l):a=hc(l,n,0,null),e=gs(e,n,r,null),a.return=t,e.return=t,a.sibling=e,t.child=a,t.child.memoizedState=vh(r),t.memoizedState=gh,e):Zd(t,l));if(i=e.memoizedState,i!==null&&(s=i.dehydrated,s!==null))return Rb(e,t,l,n,s,i,r);if(a){a=n.fallback,l=t.mode,i=e.child,s=i.sibling;var o={mode:"hidden",children:n.children};return!(l&1)&&t.child!==i?(n=t.child,n.childLanes=0,n.pendingProps=o,t.deletions=null):(n=zn(i,o),n.subtreeFlags=i.subtreeFlags&14680064),s!==null?a=zn(s,a):(a=gs(a,l,r,null),a.flags|=2),a.return=t,n.return=t,n.sibling=a,t.child=n,n=a,a=t.child,l=e.child.memoizedState,l=l===null?vh(r):{baseLanes:l.baseLanes|r,cachePool:null,transitions:l.transitions},a.memoizedState=l,a.childLanes=e.childLanes&~r,t.memoizedState=gh,n}return a=e.child,e=a.sibling,n=zn(a,{mode:"visible",children:n.children}),!(t.mode&1)&&(n.lanes=r),n.return=t,n.sibling=null,e!==null&&(r=t.deletions,r===null?(t.deletions=[e],t.flags|=16):r.push(e)),t.child=n,t.memoizedState=null,n}function Zd(e,t){return t=hc({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function ba(e,t,r,n){return n!==null&&Fd(n),di(t,e.child,null,r),e=Zd(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Rb(e,t,r,n,i,a,l){if(r)return t.flags&256?(t.flags&=-257,n=Yc(Error(ce(422))),ba(e,t,l,n)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(a=n.fallback,i=t.mode,n=hc({mode:"visible",children:n.children},i,0,null),a=gs(a,i,l,null),a.flags|=2,n.return=t,a.return=t,n.sibling=a,t.child=n,t.mode&1&&di(t,e.child,null,l),t.child.memoizedState=vh(l),t.memoizedState=gh,a);if(!(t.mode&1))return ba(e,t,l,null);if(i.data==="$!"){if(n=i.nextSibling&&i.nextSibling.dataset,n)var s=n.dgst;return n=s,a=Error(ce(419)),n=Yc(a,n,void 0),ba(e,t,l,n)}if(s=(l&e.childLanes)!==0,sr||s){if(n=Pt,n!==null){switch(l&-l){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&(n.suspendedLanes|l)?0:i,i!==0&&i!==a.retryLane&&(a.retryLane=i,gn(e,i),Br(n,e,i,-1))}return of(),n=Yc(Error(ce(421))),ba(e,t,l,n)}return i.data==="$?"?(t.flags|=128,t.child=e.child,t=zb.bind(null,e),i._reactRetry=t,null):(e=a.treeContext,hr=jn(i.nextSibling),dr=t,ot=!0,Pr=null,e!==null&&(_r[yr++]=cn,_r[yr++]=un,_r[yr++]=ws,cn=e.id,un=e.overflow,ws=t),t=Zd(t,n.children),t.flags|=4096,t)}function bm(e,t,r){e.lanes|=t;var n=e.alternate;n!==null&&(n.lanes|=t),uh(e.return,t,r)}function Jc(e,t,r,n,i){var a=e.memoizedState;a===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:n,tail:r,tailMode:i}:(a.isBackwards=t,a.rendering=null,a.renderingStartTime=0,a.last=n,a.tail=r,a.tailMode=i)}function P0(e,t,r){var n=t.pendingProps,i=n.revealOrder,a=n.tail;if(Jt(e,t,n.children,r),n=at.current,n&2)n=n&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&&bm(e,r,t);else if(e.tag===19)bm(e,r,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}n&=1}if(Ze(at,n),!(t.mode&1))t.memoizedState=null;else switch(i){case"forwards":for(r=t.child,i=null;r!==null;)e=r.alternate,e!==null&&Ll(e)===null&&(i=r),r=r.sibling;r=i,r===null?(i=t.child,t.child=null):(i=r.sibling,r.sibling=null),Jc(t,!1,i,r,a);break;case"backwards":for(r=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&Ll(e)===null){t.child=i;break}e=i.sibling,i.sibling=r,r=i,i=e}Jc(t,!0,r,null,a);break;case"together":Jc(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function Qa(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function vn(e,t,r){if(e!==null&&(t.dependencies=e.dependencies),xs|=t.lanes,!(r&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(ce(153));if(t.child!==null){for(e=t.child,r=zn(e,e.pendingProps),t.child=r,r.return=t;e.sibling!==null;)e=e.sibling,r=r.sibling=zn(e,e.pendingProps),r.return=t;r.sibling=null}return t.child}function Db(e,t,r){switch(t.tag){case 3:M0(t),hi();break;case 5:i0(t);break;case 1:or(t.type)&&Sl(t);break;case 4:Vd(t,t.stateNode.containerInfo);break;case 10:var n=t.type._context,i=t.memoizedProps.value;Ze(Cl,n._currentValue),n._currentValue=i;break;case 13:if(n=t.memoizedState,n!==null)return n.dehydrated!==null?(Ze(at,at.current&1),t.flags|=128,null):r&t.child.childLanes?A0(e,t,r):(Ze(at,at.current&1),e=vn(e,t,r),e!==null?e.sibling:null);Ze(at,at.current&1);break;case 19:if(n=(r&t.childLanes)!==0,e.flags&128){if(n)return P0(e,t,r);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),Ze(at,at.current),n)break;return null;case 22:case 23:return t.lanes=0,R0(e,t,r)}return vn(e,t,r)}var I0,_h,O0,B0;I0=function(e,t){for(var r=t.child;r!==null;){if(r.tag===5||r.tag===6)e.appendChild(r.stateNode);else if(r.tag!==4&&r.child!==null){r.child.return=r,r=r.child;continue}if(r===t)break;for(;r.sibling===null;){if(r.return===null||r.return===t)return;r=r.return}r.sibling.return=r.return,r=r.sibling}};_h=function(){};O0=function(e,t,r,n){var i=e.memoizedProps;if(i!==n){e=t.stateNode,us(Wr.current);var a=null;switch(r){case"input":i=Hu(e,i),n=Hu(e,n),a=[];break;case"select":i=ut({},i,{value:void 0}),n=ut({},n,{value:void 0}),a=[];break;case"textarea":i=Uu(e,i),n=Uu(e,n),a=[];break;default:typeof i.onClick!="function"&&typeof n.onClick=="function"&&(e.onclick=yl)}Vu(r,n);var l;r=null;for(c in i)if(!n.hasOwnProperty(c)&&i.hasOwnProperty(c)&&i[c]!=null)if(c==="style"){var s=i[c];for(l in s)s.hasOwnProperty(l)&&(r||(r={}),r[l]="")}else c!=="dangerouslySetInnerHTML"&&c!=="children"&&c!=="suppressContentEditableWarning"&&c!=="suppressHydrationWarning"&&c!=="autoFocus"&&(yo.hasOwnProperty(c)?a||(a=[]):(a=a||[]).push(c,null));for(c in n){var o=n[c];if(s=i!=null?i[c]:void 0,n.hasOwnProperty(c)&&o!==s&&(o!=null||s!=null))if(c==="style")if(s){for(l in s)!s.hasOwnProperty(l)||o&&o.hasOwnProperty(l)||(r||(r={}),r[l]="");for(l in o)o.hasOwnProperty(l)&&s[l]!==o[l]&&(r||(r={}),r[l]=o[l])}else r||(a||(a=[]),a.push(c,r)),r=o;else c==="dangerouslySetInnerHTML"?(o=o?o.__html:void 0,s=s?s.__html:void 0,o!=null&&s!==o&&(a=a||[]).push(c,o)):c==="children"?typeof o!="string"&&typeof o!="number"||(a=a||[]).push(c,""+o):c!=="suppressContentEditableWarning"&&c!=="suppressHydrationWarning"&&(yo.hasOwnProperty(c)?(o!=null&&c==="onScroll"&&nt("scroll",e),a||s===o||(a=[])):(a=a||[]).push(c,o))}r&&(a=a||[]).push("style",r);var c=a;(t.updateQueue=c)&&(t.flags|=4)}};B0=function(e,t,r,n){r!==n&&(t.flags|=4)};function ji(e,t){if(!ot)switch(e.tailMode){case"hidden":t=e.tail;for(var r=null;t!==null;)t.alternate!==null&&(r=t),t=t.sibling;r===null?e.tail=null:r.sibling=null;break;case"collapsed":r=e.tail;for(var n=null;r!==null;)r.alternate!==null&&(n=r),r=r.sibling;n===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:n.sibling=null}}function Wt(e){var t=e.alternate!==null&&e.alternate.child===e.child,r=0,n=0;if(t)for(var i=e.child;i!==null;)r|=i.lanes|i.childLanes,n|=i.subtreeFlags&14680064,n|=i.flags&14680064,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)r|=i.lanes|i.childLanes,n|=i.subtreeFlags,n|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=n,e.childLanes=r,t}function Mb(e,t,r){var n=t.pendingProps;switch(jd(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Wt(t),null;case 1:return or(t.type)&&wl(),Wt(t),null;case 3:return n=t.stateNode,fi(),st(ir),st(Xt),Gd(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(Sa(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Pr!==null&&(kh(Pr),Pr=null))),_h(e,t),Wt(t),null;case 5:Kd(t);var i=us(Mo.current);if(r=t.type,e!==null&&t.stateNode!=null)O0(e,t,r,n,i),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!n){if(t.stateNode===null)throw Error(ce(166));return Wt(t),null}if(e=us(Wr.current),Sa(t)){n=t.stateNode,r=t.type;var a=t.memoizedProps;switch(n[$r]=t,n[Ro]=a,e=(t.mode&1)!==0,r){case"dialog":nt("cancel",n),nt("close",n);break;case"iframe":case"object":case"embed":nt("load",n);break;case"video":case"audio":for(i=0;i<qi.length;i++)nt(qi[i],n);break;case"source":nt("error",n);break;case"img":case"image":case"link":nt("error",n),nt("load",n);break;case"details":nt("toggle",n);break;case"input":Ap(n,a),nt("invalid",n);break;case"select":n._wrapperState={wasMultiple:!!a.multiple},nt("invalid",n);break;case"textarea":Ip(n,a),nt("invalid",n)}Vu(r,a),i=null;for(var l in a)if(a.hasOwnProperty(l)){var s=a[l];l==="children"?typeof s=="string"?n.textContent!==s&&(a.suppressHydrationWarning!==!0&&wa(n.textContent,s,e),i=["children",s]):typeof s=="number"&&n.textContent!==""+s&&(a.suppressHydrationWarning!==!0&&wa(n.textContent,s,e),i=["children",""+s]):yo.hasOwnProperty(l)&&s!=null&&l==="onScroll"&&nt("scroll",n)}switch(r){case"input":da(n),Pp(n,a,!0);break;case"textarea":da(n),Op(n);break;case"select":case"option":break;default:typeof a.onClick=="function"&&(n.onclick=yl)}n=i,t.updateQueue=n,n!==null&&(t.flags|=4)}else{l=i.nodeType===9?i:i.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=u_(r)),e==="http://www.w3.org/1999/xhtml"?r==="script"?(e=l.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof n.is=="string"?e=l.createElement(r,{is:n.is}):(e=l.createElement(r),r==="select"&&(l=e,n.multiple?l.multiple=!0:n.size&&(l.size=n.size))):e=l.createElementNS(e,r),e[$r]=t,e[Ro]=n,I0(e,t,!1,!1),t.stateNode=e;e:{switch(l=Ku(r,n),r){case"dialog":nt("cancel",e),nt("close",e),i=n;break;case"iframe":case"object":case"embed":nt("load",e),i=n;break;case"video":case"audio":for(i=0;i<qi.length;i++)nt(qi[i],e);i=n;break;case"source":nt("error",e),i=n;break;case"img":case"image":case"link":nt("error",e),nt("load",e),i=n;break;case"details":nt("toggle",e),i=n;break;case"input":Ap(e,n),i=Hu(e,n),nt("invalid",e);break;case"option":i=n;break;case"select":e._wrapperState={wasMultiple:!!n.multiple},i=ut({},n,{value:void 0}),nt("invalid",e);break;case"textarea":Ip(e,n),i=Uu(e,n),nt("invalid",e);break;default:i=n}Vu(r,i),s=i;for(a in s)if(s.hasOwnProperty(a)){var o=s[a];a==="style"?f_(e,o):a==="dangerouslySetInnerHTML"?(o=o?o.__html:void 0,o!=null&&h_(e,o)):a==="children"?typeof o=="string"?(r!=="textarea"||o!=="")&&wo(e,o):typeof o=="number"&&wo(e,""+o):a!=="suppressContentEditableWarning"&&a!=="suppressHydrationWarning"&&a!=="autoFocus"&&(yo.hasOwnProperty(a)?o!=null&&a==="onScroll"&&nt("scroll",e):o!=null&&bd(e,a,o,l))}switch(r){case"input":da(e),Pp(e,n,!1);break;case"textarea":da(e),Op(e);break;case"option":n.value!=null&&e.setAttribute("value",""+Un(n.value));break;case"select":e.multiple=!!n.multiple,a=n.value,a!=null?Qs(e,!!n.multiple,a,!1):n.defaultValue!=null&&Qs(e,!!n.multiple,n.defaultValue,!0);break;default:typeof i.onClick=="function"&&(e.onclick=yl)}switch(r){case"button":case"input":case"select":case"textarea":n=!!n.autoFocus;break e;case"img":n=!0;break e;default:n=!1}}n&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return Wt(t),null;case 6:if(e&&t.stateNode!=null)B0(e,t,e.memoizedProps,n);else{if(typeof n!="string"&&t.stateNode===null)throw Error(ce(166));if(r=us(Mo.current),us(Wr.current),Sa(t)){if(n=t.stateNode,r=t.memoizedProps,n[$r]=t,(a=n.nodeValue!==r)&&(e=dr,e!==null))switch(e.tag){case 3:wa(n.nodeValue,r,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&wa(n.nodeValue,r,(e.mode&1)!==0)}a&&(t.flags|=4)}else n=(r.nodeType===9?r:r.ownerDocument).createTextNode(n),n[$r]=t,t.stateNode=n}return Wt(t),null;case 13:if(st(at),n=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(ot&&hr!==null&&t.mode&1&&!(t.flags&128))e0(),hi(),t.flags|=98560,a=!1;else if(a=Sa(t),n!==null&&n.dehydrated!==null){if(e===null){if(!a)throw Error(ce(318));if(a=t.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(ce(317));a[$r]=t}else hi(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Wt(t),a=!1}else Pr!==null&&(kh(Pr),Pr=null),a=!0;if(!a)return t.flags&65536?t:null}return t.flags&128?(t.lanes=r,t):(n=n!==null,n!==(e!==null&&e.memoizedState!==null)&&n&&(t.child.flags|=8192,t.mode&1&&(e===null||at.current&1?Ct===0&&(Ct=3):of())),t.updateQueue!==null&&(t.flags|=4),Wt(t),null);case 4:return fi(),_h(e,t),e===null&&Lo(t.stateNode.containerInfo),Wt(t),null;case 10:return zd(t.type._context),Wt(t),null;case 17:return or(t.type)&&wl(),Wt(t),null;case 19:if(st(at),a=t.memoizedState,a===null)return Wt(t),null;if(n=(t.flags&128)!==0,l=a.rendering,l===null)if(n)ji(a,!1);else{if(Ct!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(l=Ll(e),l!==null){for(t.flags|=128,ji(a,!1),n=l.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),t.subtreeFlags=0,n=r,r=t.child;r!==null;)a=r,e=n,a.flags&=14680066,l=a.alternate,l===null?(a.childLanes=0,a.lanes=e,a.child=null,a.subtreeFlags=0,a.memoizedProps=null,a.memoizedState=null,a.updateQueue=null,a.dependencies=null,a.stateNode=null):(a.childLanes=l.childLanes,a.lanes=l.lanes,a.child=l.child,a.subtreeFlags=0,a.deletions=null,a.memoizedProps=l.memoizedProps,a.memoizedState=l.memoizedState,a.updateQueue=l.updateQueue,a.type=l.type,e=l.dependencies,a.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),r=r.sibling;return Ze(at,at.current&1|2),t.child}e=e.sibling}a.tail!==null&&pt()>mi&&(t.flags|=128,n=!0,ji(a,!1),t.lanes=4194304)}else{if(!n)if(e=Ll(l),e!==null){if(t.flags|=128,n=!0,r=e.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),ji(a,!0),a.tail===null&&a.tailMode==="hidden"&&!l.alternate&&!ot)return Wt(t),null}else 2*pt()-a.renderingStartTime>mi&&r!==1073741824&&(t.flags|=128,n=!0,ji(a,!1),t.lanes=4194304);a.isBackwards?(l.sibling=t.child,t.child=l):(r=a.last,r!==null?r.sibling=l:t.child=l,a.last=l)}return a.tail!==null?(t=a.tail,a.rendering=t,a.tail=t.sibling,a.renderingStartTime=pt(),t.sibling=null,r=at.current,Ze(at,n?r&1|2:r&1),t):(Wt(t),null);case 22:case 23:return sf(),n=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==n&&(t.flags|=8192),n&&t.mode&1?cr&1073741824&&(Wt(t),t.subtreeFlags&6&&(t.flags|=8192)):Wt(t),null;case 24:return null;case 25:return null}throw Error(ce(156,t.tag))}function Ab(e,t){switch(jd(t),t.tag){case 1:return or(t.type)&&wl(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return fi(),st(ir),st(Xt),Gd(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return Kd(t),null;case 13:if(st(at),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(ce(340));hi()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return st(at),null;case 4:return fi(),null;case 10:return zd(t.type._context),null;case 22:case 23:return sf(),null;case 24:return null;default:return null}}var Ca=!1,Vt=!1,Pb=typeof WeakSet=="function"?WeakSet:Set,Se=null;function Vs(e,t){var r=e.ref;if(r!==null)if(typeof r=="function")try{r(null)}catch(n){ft(e,t,n)}else r.current=null}function yh(e,t,r){try{r()}catch(n){ft(e,t,n)}}var Cm=!1;function Ib(e,t){if(rh=gl,e=$_(),Bd(e)){if("selectionStart"in e)var r={start:e.selectionStart,end:e.selectionEnd};else e:{r=(r=e.ownerDocument)&&r.defaultView||window;var n=r.getSelection&&r.getSelection();if(n&&n.rangeCount!==0){r=n.anchorNode;var i=n.anchorOffset,a=n.focusNode;n=n.focusOffset;try{r.nodeType,a.nodeType}catch{r=null;break e}var l=0,s=-1,o=-1,c=0,f=0,u=e,p=null;t:for(;;){for(var _;u!==r||i!==0&&u.nodeType!==3||(s=l+i),u!==a||n!==0&&u.nodeType!==3||(o=l+n),u.nodeType===3&&(l+=u.nodeValue.length),(_=u.firstChild)!==null;)p=u,u=_;for(;;){if(u===e)break t;if(p===r&&++c===i&&(s=l),p===a&&++f===n&&(o=l),(_=u.nextSibling)!==null)break;u=p,p=u.parentNode}u=_}r=s===-1||o===-1?null:{start:s,end:o}}else r=null}r=r||{start:0,end:0}}else r=null;for(nh={focusedElem:e,selectionRange:r},gl=!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 y=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(y!==null){var v=y.memoizedProps,h=y.memoizedState,m=t.stateNode,d=m.getSnapshotBeforeUpdate(t.elementType===t.type?v:Dr(t.type,v),h);m.__reactInternalSnapshotBeforeUpdate=d}break;case 3:var g=t.stateNode.containerInfo;g.nodeType===1?g.textContent="":g.nodeType===9&&g.documentElement&&g.removeChild(g.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(ce(163))}}catch(w){ft(t,t.return,w)}if(e=t.sibling,e!==null){e.return=t.return,Se=e;break}Se=t.return}return y=Cm,Cm=!1,y}function io(e,t,r){var n=t.updateQueue;if(n=n!==null?n.lastEffect:null,n!==null){var i=n=n.next;do{if((i.tag&e)===e){var a=i.destroy;i.destroy=void 0,a!==void 0&&yh(t,r,a)}i=i.next}while(i!==n)}}function cc(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var r=t=t.next;do{if((r.tag&e)===e){var n=r.create;r.destroy=n()}r=r.next}while(r!==t)}}function wh(e){var t=e.ref;if(t!==null){var r=e.stateNode;switch(e.tag){case 5:e=r;break;default:e=r}typeof t=="function"?t(e):t.current=e}}function N0(e){var t=e.alternate;t!==null&&(e.alternate=null,N0(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[$r],delete t[Ro],delete t[oh],delete t[gb],delete t[vb])),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 j0(e){return e.tag===5||e.tag===3||e.tag===4}function Em(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||j0(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 Sh(e,t,r){var n=e.tag;if(n===5||n===6)e=e.stateNode,t?r.nodeType===8?r.parentNode.insertBefore(e,t):r.insertBefore(e,t):(r.nodeType===8?(t=r.parentNode,t.insertBefore(e,r)):(t=r,t.appendChild(e)),r=r._reactRootContainer,r!=null||t.onclick!==null||(t.onclick=yl));else if(n!==4&&(e=e.child,e!==null))for(Sh(e,t,r),e=e.sibling;e!==null;)Sh(e,t,r),e=e.sibling}function xh(e,t,r){var n=e.tag;if(n===5||n===6)e=e.stateNode,t?r.insertBefore(e,t):r.appendChild(e);else if(n!==4&&(e=e.child,e!==null))for(xh(e,t,r),e=e.sibling;e!==null;)xh(e,t,r),e=e.sibling}var Bt=null,Mr=!1;function xn(e,t,r){for(r=r.child;r!==null;)F0(e,t,r),r=r.sibling}function F0(e,t,r){if(Ur&&typeof Ur.onCommitFiberUnmount=="function")try{Ur.onCommitFiberUnmount(tc,r)}catch{}switch(r.tag){case 5:Vt||Vs(r,t);case 6:var n=Bt,i=Mr;Bt=null,xn(e,t,r),Bt=n,Mr=i,Bt!==null&&(Mr?(e=Bt,r=r.stateNode,e.nodeType===8?e.parentNode.removeChild(r):e.removeChild(r)):Bt.removeChild(r.stateNode));break;case 18:Bt!==null&&(Mr?(e=Bt,r=r.stateNode,e.nodeType===8?Wc(e.parentNode,r):e.nodeType===1&&Wc(e,r),Co(e)):Wc(Bt,r.stateNode));break;case 4:n=Bt,i=Mr,Bt=r.stateNode.containerInfo,Mr=!0,xn(e,t,r),Bt=n,Mr=i;break;case 0:case 11:case 14:case 15:if(!Vt&&(n=r.updateQueue,n!==null&&(n=n.lastEffect,n!==null))){i=n=n.next;do{var a=i,l=a.destroy;a=a.tag,l!==void 0&&(a&2||a&4)&&yh(r,t,l),i=i.next}while(i!==n)}xn(e,t,r);break;case 1:if(!Vt&&(Vs(r,t),n=r.stateNode,typeof n.componentWillUnmount=="function"))try{n.props=r.memoizedProps,n.state=r.memoizedState,n.componentWillUnmount()}catch(s){ft(r,t,s)}xn(e,t,r);break;case 21:xn(e,t,r);break;case 22:r.mode&1?(Vt=(n=Vt)||r.memoizedState!==null,xn(e,t,r),Vt=n):xn(e,t,r);break;default:xn(e,t,r)}}function km(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var r=e.stateNode;r===null&&(r=e.stateNode=new Pb),t.forEach(function(n){var i=Ub.bind(null,e,n);r.has(n)||(r.add(n),n.then(i,i))})}}function kr(e,t){var r=t.deletions;if(r!==null)for(var n=0;n<r.length;n++){var i=r[n];try{var a=e,l=t,s=l;e:for(;s!==null;){switch(s.tag){case 5:Bt=s.stateNode,Mr=!1;break e;case 3:Bt=s.stateNode.containerInfo,Mr=!0;break e;case 4:Bt=s.stateNode.containerInfo,Mr=!0;break e}s=s.return}if(Bt===null)throw Error(ce(160));F0(a,l,i),Bt=null,Mr=!1;var o=i.alternate;o!==null&&(o.return=null),i.return=null}catch(c){ft(i,t,c)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)H0(t,e),t=t.sibling}function H0(e,t){var r=e.alternate,n=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(kr(t,e),Fr(e),n&4){try{io(3,e,e.return),cc(3,e)}catch(v){ft(e,e.return,v)}try{io(5,e,e.return)}catch(v){ft(e,e.return,v)}}break;case 1:kr(t,e),Fr(e),n&512&&r!==null&&Vs(r,r.return);break;case 5:if(kr(t,e),Fr(e),n&512&&r!==null&&Vs(r,r.return),e.flags&32){var i=e.stateNode;try{wo(i,"")}catch(v){ft(e,e.return,v)}}if(n&4&&(i=e.stateNode,i!=null)){var a=e.memoizedProps,l=r!==null?r.memoizedProps:a,s=e.type,o=e.updateQueue;if(e.updateQueue=null,o!==null)try{s==="input"&&a.type==="radio"&&a.name!=null&&l_(i,a),Ku(s,l);var c=Ku(s,a);for(l=0;l<o.length;l+=2){var f=o[l],u=o[l+1];f==="style"?f_(i,u):f==="dangerouslySetInnerHTML"?h_(i,u):f==="children"?wo(i,u):bd(i,f,u,c)}switch(s){case"input":$u(i,a);break;case"textarea":c_(i,a);break;case"select":var p=i._wrapperState.wasMultiple;i._wrapperState.wasMultiple=!!a.multiple;var _=a.value;_!=null?Qs(i,!!a.multiple,_,!1):p!==!!a.multiple&&(a.defaultValue!=null?Qs(i,!!a.multiple,a.defaultValue,!0):Qs(i,!!a.multiple,a.multiple?[]:"",!1))}i[Ro]=a}catch(v){ft(e,e.return,v)}}break;case 6:if(kr(t,e),Fr(e),n&4){if(e.stateNode===null)throw Error(ce(162));i=e.stateNode,a=e.memoizedProps;try{i.nodeValue=a}catch(v){ft(e,e.return,v)}}break;case 3:if(kr(t,e),Fr(e),n&4&&r!==null&&r.memoizedState.isDehydrated)try{Co(t.containerInfo)}catch(v){ft(e,e.return,v)}break;case 4:kr(t,e),Fr(e);break;case 13:kr(t,e),Fr(e),i=e.child,i.flags&8192&&(a=i.memoizedState!==null,i.stateNode.isHidden=a,!a||i.alternate!==null&&i.alternate.memoizedState!==null||(rf=pt())),n&4&&km(e);break;case 22:if(f=r!==null&&r.memoizedState!==null,e.mode&1?(Vt=(c=Vt)||f,kr(t,e),Vt=c):kr(t,e),Fr(e),n&8192){if(c=e.memoizedState!==null,(e.stateNode.isHidden=c)&&!f&&e.mode&1)for(Se=e,f=e.child;f!==null;){for(u=Se=f;Se!==null;){switch(p=Se,_=p.child,p.tag){case 0:case 11:case 14:case 15:io(4,p,p.return);break;case 1:Vs(p,p.return);var y=p.stateNode;if(typeof y.componentWillUnmount=="function"){n=p,r=p.return;try{t=n,y.props=t.memoizedProps,y.state=t.memoizedState,y.componentWillUnmount()}catch(v){ft(n,r,v)}}break;case 5:Vs(p,p.return);break;case 22:if(p.memoizedState!==null){Tm(u);continue}}_!==null?(_.return=p,Se=_):Tm(u)}f=f.sibling}e:for(f=null,u=e;;){if(u.tag===5){if(f===null){f=u;try{i=u.stateNode,c?(a=i.style,typeof a.setProperty=="function"?a.setProperty("display","none","important"):a.display="none"):(s=u.stateNode,o=u.memoizedProps.style,l=o!=null&&o.hasOwnProperty("display")?o.display:null,s.style.display=d_("display",l))}catch(v){ft(e,e.return,v)}}}else if(u.tag===6){if(f===null)try{u.stateNode.nodeValue=c?"":u.memoizedProps}catch(v){ft(e,e.return,v)}}else if((u.tag!==22&&u.tag!==23||u.memoizedState===null||u===e)&&u.child!==null){u.child.return=u,u=u.child;continue}if(u===e)break e;for(;u.sibling===null;){if(u.return===null||u.return===e)break e;f===u&&(f=null),u=u.return}f===u&&(f=null),u.sibling.return=u.return,u=u.sibling}}break;case 19:kr(t,e),Fr(e),n&4&&km(e);break;case 21:break;default:kr(t,e),Fr(e)}}function Fr(e){var t=e.flags;if(t&2){try{e:{for(var r=e.return;r!==null;){if(j0(r)){var n=r;break e}r=r.return}throw Error(ce(160))}switch(n.tag){case 5:var i=n.stateNode;n.flags&32&&(wo(i,""),n.flags&=-33);var a=Em(e);xh(e,a,i);break;case 3:case 4:var l=n.stateNode.containerInfo,s=Em(e);Sh(e,s,l);break;default:throw Error(ce(161))}}catch(o){ft(e,e.return,o)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Ob(e,t,r){Se=e,$0(e)}function $0(e,t,r){for(var n=(e.mode&1)!==0;Se!==null;){var i=Se,a=i.child;if(i.tag===22&&n){var l=i.memoizedState!==null||Ca;if(!l){var s=i.alternate,o=s!==null&&s.memoizedState!==null||Vt;s=Ca;var c=Vt;if(Ca=l,(Vt=o)&&!c)for(Se=i;Se!==null;)l=Se,o=l.child,l.tag===22&&l.memoizedState!==null?Rm(i):o!==null?(o.return=l,Se=o):Rm(i);for(;a!==null;)Se=a,$0(a),a=a.sibling;Se=i,Ca=s,Vt=c}Lm(e)}else i.subtreeFlags&8772&&a!==null?(a.return=i,Se=a):Lm(e)}}function Lm(e){for(;Se!==null;){var t=Se;if(t.flags&8772){var r=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:Vt||cc(5,t);break;case 1:var n=t.stateNode;if(t.flags&4&&!Vt)if(r===null)n.componentDidMount();else{var i=t.elementType===t.type?r.memoizedProps:Dr(t.type,r.memoizedProps);n.componentDidUpdate(i,r.memoizedState,n.__reactInternalSnapshotBeforeUpdate)}var a=t.updateQueue;a!==null&&hm(t,a,n);break;case 3:var l=t.updateQueue;if(l!==null){if(r=null,t.child!==null)switch(t.child.tag){case 5:r=t.child.stateNode;break;case 1:r=t.child.stateNode}hm(t,l,r)}break;case 5:var s=t.stateNode;if(r===null&&t.flags&4){r=s;var o=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":o.autoFocus&&r.focus();break;case"img":o.src&&(r.src=o.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 f=c.memoizedState;if(f!==null){var u=f.dehydrated;u!==null&&Co(u)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(ce(163))}Vt||t.flags&512&&wh(t)}catch(p){ft(t,t.return,p)}}if(t===e){Se=null;break}if(r=t.sibling,r!==null){r.return=t.return,Se=r;break}Se=t.return}}function Tm(e){for(;Se!==null;){var t=Se;if(t===e){Se=null;break}var r=t.sibling;if(r!==null){r.return=t.return,Se=r;break}Se=t.return}}function Rm(e){for(;Se!==null;){var t=Se;try{switch(t.tag){case 0:case 11:case 15:var r=t.return;try{cc(4,t)}catch(o){ft(t,r,o)}break;case 1:var n=t.stateNode;if(typeof n.componentDidMount=="function"){var i=t.return;try{n.componentDidMount()}catch(o){ft(t,i,o)}}var a=t.return;try{wh(t)}catch(o){ft(t,a,o)}break;case 5:var l=t.return;try{wh(t)}catch(o){ft(t,l,o)}}}catch(o){ft(t,t.return,o)}if(t===e){Se=null;break}var s=t.sibling;if(s!==null){s.return=t.return,Se=s;break}Se=t.return}}var Bb=Math.ceil,Dl=yn.ReactCurrentDispatcher,ef=yn.ReactCurrentOwner,xr=yn.ReactCurrentBatchConfig,Xe=0,Pt=null,vt=null,Ft=0,cr=0,Ks=qn(0),Ct=0,Oo=null,xs=0,uc=0,tf=0,oo=null,nr=null,rf=0,mi=1/0,an=null,Ml=!1,bh=null,Hn=null,Ea=!1,Pn=null,Al=0,ao=0,Ch=null,Za=-1,el=0;function er(){return Xe&6?pt():Za!==-1?Za:Za=pt()}function $n(e){return e.mode&1?Xe&2&&Ft!==0?Ft&-Ft:yb.transition!==null?(el===0&&(el=E_()),el):(e=Qe,e!==0||(e=window.event,e=e===void 0?16:A_(e.type)),e):1}function Br(e,t,r,n){if(50<ao)throw ao=0,Ch=null,Error(ce(185));Xo(e,r,n),(!(Xe&2)||e!==Pt)&&(e===Pt&&(!(Xe&2)&&(uc|=r),Ct===4&&Mn(e,Ft)),ar(e,n),r===1&&Xe===0&&!(t.mode&1)&&(mi=pt()+500,oc&&Xn()))}function ar(e,t){var r=e.callbackNode;yx(e,t);var n=ml(e,e===Pt?Ft:0);if(n===0)r!==null&&jp(r),e.callbackNode=null,e.callbackPriority=0;else if(t=n&-n,e.callbackPriority!==t){if(r!=null&&jp(r),t===1)e.tag===0?_b(Dm.bind(null,e)):J_(Dm.bind(null,e)),pb(function(){!(Xe&6)&&Xn()}),r=null;else{switch(k_(n)){case 1:r=Td;break;case 4:r=b_;break;case 16:r=pl;break;case 536870912:r=C_;break;default:r=pl}r=X0(r,z0.bind(null,e))}e.callbackPriority=t,e.callbackNode=r}}function z0(e,t){if(Za=-1,el=0,Xe&6)throw Error(ce(327));var r=e.callbackNode;if(ni()&&e.callbackNode!==r)return null;var n=ml(e,e===Pt?Ft:0);if(n===0)return null;if(n&30||n&e.expiredLanes||t)t=Pl(e,n);else{t=n;var i=Xe;Xe|=2;var a=W0();(Pt!==e||Ft!==t)&&(an=null,mi=pt()+500,ms(e,t));do try{Fb();break}catch(s){U0(e,s)}while(!0);$d(),Dl.current=a,Xe=i,vt!==null?t=0:(Pt=null,Ft=0,t=Ct)}if(t!==0){if(t===2&&(i=Ju(e),i!==0&&(n=i,t=Eh(e,i))),t===1)throw r=Oo,ms(e,0),Mn(e,n),ar(e,pt()),r;if(t===6)Mn(e,n);else{if(i=e.current.alternate,!(n&30)&&!Nb(i)&&(t=Pl(e,n),t===2&&(a=Ju(e),a!==0&&(n=a,t=Eh(e,a))),t===1))throw r=Oo,ms(e,0),Mn(e,n),ar(e,pt()),r;switch(e.finishedWork=i,e.finishedLanes=n,t){case 0:case 1:throw Error(ce(345));case 2:os(e,nr,an);break;case 3:if(Mn(e,n),(n&130023424)===n&&(t=rf+500-pt(),10<t)){if(ml(e,0)!==0)break;if(i=e.suspendedLanes,(i&n)!==n){er(),e.pingedLanes|=e.suspendedLanes&i;break}e.timeoutHandle=ih(os.bind(null,e,nr,an),t);break}os(e,nr,an);break;case 4:if(Mn(e,n),(n&4194240)===n)break;for(t=e.eventTimes,i=-1;0<n;){var l=31-Or(n);a=1<<l,l=t[l],l>i&&(i=l),n&=~a}if(n=i,n=pt()-n,n=(120>n?120:480>n?480:1080>n?1080:1920>n?1920:3e3>n?3e3:4320>n?4320:1960*Bb(n/1960))-n,10<n){e.timeoutHandle=ih(os.bind(null,e,nr,an),n);break}os(e,nr,an);break;case 5:os(e,nr,an);break;default:throw Error(ce(329))}}}return ar(e,pt()),e.callbackNode===r?z0.bind(null,e):null}function Eh(e,t){var r=oo;return e.current.memoizedState.isDehydrated&&(ms(e,t).flags|=256),e=Pl(e,t),e!==2&&(t=nr,nr=r,t!==null&&kh(t)),e}function kh(e){nr===null?nr=e:nr.push.apply(nr,e)}function Nb(e){for(var t=e;;){if(t.flags&16384){var r=t.updateQueue;if(r!==null&&(r=r.stores,r!==null))for(var n=0;n<r.length;n++){var i=r[n],a=i.getSnapshot;i=i.value;try{if(!Nr(a(),i))return!1}catch{return!1}}}if(r=t.child,t.subtreeFlags&16384&&r!==null)r.return=t,t=r;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function Mn(e,t){for(t&=~tf,t&=~uc,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var r=31-Or(t),n=1<<r;e[r]=-1,t&=~n}}function Dm(e){if(Xe&6)throw Error(ce(327));ni();var t=ml(e,0);if(!(t&1))return ar(e,pt()),null;var r=Pl(e,t);if(e.tag!==0&&r===2){var n=Ju(e);n!==0&&(t=n,r=Eh(e,n))}if(r===1)throw r=Oo,ms(e,0),Mn(e,t),ar(e,pt()),r;if(r===6)throw Error(ce(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,os(e,nr,an),ar(e,pt()),null}function nf(e,t){var r=Xe;Xe|=1;try{return e(t)}finally{Xe=r,Xe===0&&(mi=pt()+500,oc&&Xn())}}function bs(e){Pn!==null&&Pn.tag===0&&!(Xe&6)&&ni();var t=Xe;Xe|=1;var r=xr.transition,n=Qe;try{if(xr.transition=null,Qe=1,e)return e()}finally{Qe=n,xr.transition=r,Xe=t,!(Xe&6)&&Xn()}}function sf(){cr=Ks.current,st(Ks)}function ms(e,t){e.finishedWork=null,e.finishedLanes=0;var r=e.timeoutHandle;if(r!==-1&&(e.timeoutHandle=-1,fb(r)),vt!==null)for(r=vt.return;r!==null;){var n=r;switch(jd(n),n.tag){case 1:n=n.type.childContextTypes,n!=null&&wl();break;case 3:fi(),st(ir),st(Xt),Gd();break;case 5:Kd(n);break;case 4:fi();break;case 13:st(at);break;case 19:st(at);break;case 10:zd(n.type._context);break;case 22:case 23:sf()}r=r.return}if(Pt=e,vt=e=zn(e.current,null),Ft=cr=t,Ct=0,Oo=null,tf=uc=xs=0,nr=oo=null,cs!==null){for(t=0;t<cs.length;t++)if(r=cs[t],n=r.interleaved,n!==null){r.interleaved=null;var i=n.next,a=r.pending;if(a!==null){var l=a.next;a.next=i,n.next=l}r.pending=n}cs=null}return e}function U0(e,t){do{var r=vt;try{if($d(),Ya.current=Rl,Tl){for(var n=ct.memoizedState;n!==null;){var i=n.queue;i!==null&&(i.pending=null),n=n.next}Tl=!1}if(Ss=0,Lt=St=ct=null,so=!1,Ao=0,ef.current=null,r===null||r.return===null){Ct=1,Oo=t,vt=null;break}e:{var a=e,l=r.return,s=r,o=t;if(t=Ft,s.flags|=32768,o!==null&&typeof o=="object"&&typeof o.then=="function"){var c=o,f=s,u=f.tag;if(!(f.mode&1)&&(u===0||u===11||u===15)){var p=f.alternate;p?(f.updateQueue=p.updateQueue,f.memoizedState=p.memoizedState,f.lanes=p.lanes):(f.updateQueue=null,f.memoizedState=null)}var _=vm(l);if(_!==null){_.flags&=-257,_m(_,l,s,a,t),_.mode&1&&gm(a,c,t),t=_,o=c;var y=t.updateQueue;if(y===null){var v=new Set;v.add(o),t.updateQueue=v}else y.add(o);break e}else{if(!(t&1)){gm(a,c,t),of();break e}o=Error(ce(426))}}else if(ot&&s.mode&1){var h=vm(l);if(h!==null){!(h.flags&65536)&&(h.flags|=256),_m(h,l,s,a,t),Fd(pi(o,s));break e}}a=o=pi(o,s),Ct!==4&&(Ct=2),oo===null?oo=[a]:oo.push(a),a=l;do{switch(a.tag){case 3:a.flags|=65536,t&=-t,a.lanes|=t;var m=k0(a,o,t);um(a,m);break e;case 1:s=o;var d=a.type,g=a.stateNode;if(!(a.flags&128)&&(typeof d.getDerivedStateFromError=="function"||g!==null&&typeof g.componentDidCatch=="function"&&(Hn===null||!Hn.has(g)))){a.flags|=65536,t&=-t,a.lanes|=t;var w=L0(a,s,t);um(a,w);break e}}a=a.return}while(a!==null)}K0(r)}catch(b){t=b,vt===r&&r!==null&&(vt=r=r.return);continue}break}while(!0)}function W0(){var e=Dl.current;return Dl.current=Rl,e===null?Rl:e}function of(){(Ct===0||Ct===3||Ct===2)&&(Ct=4),Pt===null||!(xs&268435455)&&!(uc&268435455)||Mn(Pt,Ft)}function Pl(e,t){var r=Xe;Xe|=2;var n=W0();(Pt!==e||Ft!==t)&&(an=null,ms(e,t));do try{jb();break}catch(i){U0(e,i)}while(!0);if($d(),Xe=r,Dl.current=n,vt!==null)throw Error(ce(261));return Pt=null,Ft=0,Ct}function jb(){for(;vt!==null;)V0(vt)}function Fb(){for(;vt!==null&&!ux();)V0(vt)}function V0(e){var t=q0(e.alternate,e,cr);e.memoizedProps=e.pendingProps,t===null?K0(e):vt=t,ef.current=null}function K0(e){var t=e;do{var r=t.alternate;if(e=t.return,t.flags&32768){if(r=Ab(r,t),r!==null){r.flags&=32767,vt=r;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{Ct=6,vt=null;return}}else if(r=Mb(r,t,cr),r!==null){vt=r;return}if(t=t.sibling,t!==null){vt=t;return}vt=t=e}while(t!==null);Ct===0&&(Ct=5)}function os(e,t,r){var n=Qe,i=xr.transition;try{xr.transition=null,Qe=1,Hb(e,t,r,n)}finally{xr.transition=i,Qe=n}return null}function Hb(e,t,r,n){do ni();while(Pn!==null);if(Xe&6)throw Error(ce(327));r=e.finishedWork;var i=e.finishedLanes;if(r===null)return null;if(e.finishedWork=null,e.finishedLanes=0,r===e.current)throw Error(ce(177));e.callbackNode=null,e.callbackPriority=0;var a=r.lanes|r.childLanes;if(wx(e,a),e===Pt&&(vt=Pt=null,Ft=0),!(r.subtreeFlags&2064)&&!(r.flags&2064)||Ea||(Ea=!0,X0(pl,function(){return ni(),null})),a=(r.flags&15990)!==0,r.subtreeFlags&15990||a){a=xr.transition,xr.transition=null;var l=Qe;Qe=1;var s=Xe;Xe|=4,ef.current=null,Ib(e,r),H0(r,e),ob(nh),gl=!!rh,nh=rh=null,e.current=r,Ob(r),hx(),Xe=s,Qe=l,xr.transition=a}else e.current=r;if(Ea&&(Ea=!1,Pn=e,Al=i),a=e.pendingLanes,a===0&&(Hn=null),px(r.stateNode),ar(e,pt()),t!==null)for(n=e.onRecoverableError,r=0;r<t.length;r++)i=t[r],n(i.value,{componentStack:i.stack,digest:i.digest});if(Ml)throw Ml=!1,e=bh,bh=null,e;return Al&1&&e.tag!==0&&ni(),a=e.pendingLanes,a&1?e===Ch?ao++:(ao=0,Ch=e):ao=0,Xn(),null}function ni(){if(Pn!==null){var e=k_(Al),t=xr.transition,r=Qe;try{if(xr.transition=null,Qe=16>e?16:e,Pn===null)var n=!1;else{if(e=Pn,Pn=null,Al=0,Xe&6)throw Error(ce(331));var i=Xe;for(Xe|=4,Se=e.current;Se!==null;){var a=Se,l=a.child;if(Se.flags&16){var s=a.deletions;if(s!==null){for(var o=0;o<s.length;o++){var c=s[o];for(Se=c;Se!==null;){var f=Se;switch(f.tag){case 0:case 11:case 15:io(8,f,a)}var u=f.child;if(u!==null)u.return=f,Se=u;else for(;Se!==null;){f=Se;var p=f.sibling,_=f.return;if(N0(f),f===c){Se=null;break}if(p!==null){p.return=_,Se=p;break}Se=_}}}var y=a.alternate;if(y!==null){var v=y.child;if(v!==null){y.child=null;do{var h=v.sibling;v.sibling=null,v=h}while(v!==null)}}Se=a}}if(a.subtreeFlags&2064&&l!==null)l.return=a,Se=l;else e:for(;Se!==null;){if(a=Se,a.flags&2048)switch(a.tag){case 0:case 11:case 15:io(9,a,a.return)}var m=a.sibling;if(m!==null){m.return=a.return,Se=m;break e}Se=a.return}}var d=e.current;for(Se=d;Se!==null;){l=Se;var g=l.child;if(l.subtreeFlags&2064&&g!==null)g.return=l,Se=g;else e:for(l=d;Se!==null;){if(s=Se,s.flags&2048)try{switch(s.tag){case 0:case 11:case 15:cc(9,s)}}catch(b){ft(s,s.return,b)}if(s===l){Se=null;break e}var w=s.sibling;if(w!==null){w.return=s.return,Se=w;break e}Se=s.return}}if(Xe=i,Xn(),Ur&&typeof Ur.onPostCommitFiberRoot=="function")try{Ur.onPostCommitFiberRoot(tc,e)}catch{}n=!0}return n}finally{Qe=r,xr.transition=t}}return!1}function Mm(e,t,r){t=pi(r,t),t=k0(e,t,1),e=Fn(e,t,1),t=er(),e!==null&&(Xo(e,1,t),ar(e,t))}function ft(e,t,r){if(e.tag===3)Mm(e,e,r);else for(;t!==null;){if(t.tag===3){Mm(t,e,r);break}else if(t.tag===1){var n=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof n.componentDidCatch=="function"&&(Hn===null||!Hn.has(n))){e=pi(r,e),e=L0(t,e,1),t=Fn(t,e,1),e=er(),t!==null&&(Xo(t,1,e),ar(t,e));break}}t=t.return}}function $b(e,t,r){var n=e.pingCache;n!==null&&n.delete(t),t=er(),e.pingedLanes|=e.suspendedLanes&r,Pt===e&&(Ft&r)===r&&(Ct===4||Ct===3&&(Ft&130023424)===Ft&&500>pt()-rf?ms(e,0):tf|=r),ar(e,t)}function G0(e,t){t===0&&(e.mode&1?(t=ma,ma<<=1,!(ma&130023424)&&(ma=4194304)):t=1);var r=er();e=gn(e,t),e!==null&&(Xo(e,t,r),ar(e,r))}function zb(e){var t=e.memoizedState,r=0;t!==null&&(r=t.retryLane),G0(e,r)}function Ub(e,t){var r=0;switch(e.tag){case 13:var n=e.stateNode,i=e.memoizedState;i!==null&&(r=i.retryLane);break;case 19:n=e.stateNode;break;default:throw Error(ce(314))}n!==null&&n.delete(t),G0(e,r)}var q0;q0=function(e,t,r){if(e!==null)if(e.memoizedProps!==t.pendingProps||ir.current)sr=!0;else{if(!(e.lanes&r)&&!(t.flags&128))return sr=!1,Db(e,t,r);sr=!!(e.flags&131072)}else sr=!1,ot&&t.flags&1048576&&Q_(t,bl,t.index);switch(t.lanes=0,t.tag){case 2:var n=t.type;Qa(e,t),e=t.pendingProps;var i=ui(t,Xt.current);ri(t,r),i=Xd(null,t,n,e,i,r);var a=Yd();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,or(n)?(a=!0,Sl(t)):a=!1,t.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,Wd(t),i.updater=lc,t.stateNode=i,i._reactInternals=t,dh(t,n,e,r),t=mh(null,t,n,!0,a,r)):(t.tag=0,ot&&a&&Nd(t),Jt(null,t,i,r),t=t.child),t;case 16:n=t.elementType;e:{switch(Qa(e,t),e=t.pendingProps,i=n._init,n=i(n._payload),t.type=n,i=t.tag=Vb(n),e=Dr(n,e),i){case 0:t=ph(null,t,n,e,r);break e;case 1:t=Sm(null,t,n,e,r);break e;case 11:t=ym(null,t,n,e,r);break e;case 14:t=wm(null,t,n,Dr(n.type,e),r);break e}throw Error(ce(306,n,""))}return t;case 0:return n=t.type,i=t.pendingProps,i=t.elementType===n?i:Dr(n,i),ph(e,t,n,i,r);case 1:return n=t.type,i=t.pendingProps,i=t.elementType===n?i:Dr(n,i),Sm(e,t,n,i,r);case 3:e:{if(M0(t),e===null)throw Error(ce(387));n=t.pendingProps,a=t.memoizedState,i=a.element,s0(e,t),kl(t,n,null,r);var l=t.memoizedState;if(n=l.element,a.isDehydrated)if(a={element:n,isDehydrated:!1,cache:l.cache,pendingSuspenseBoundaries:l.pendingSuspenseBoundaries,transitions:l.transitions},t.updateQueue.baseState=a,t.memoizedState=a,t.flags&256){i=pi(Error(ce(423)),t),t=xm(e,t,n,r,i);break e}else if(n!==i){i=pi(Error(ce(424)),t),t=xm(e,t,n,r,i);break e}else for(hr=jn(t.stateNode.containerInfo.firstChild),dr=t,ot=!0,Pr=null,r=r0(t,null,n,r),t.child=r;r;)r.flags=r.flags&-3|4096,r=r.sibling;else{if(hi(),n===i){t=vn(e,t,r);break e}Jt(e,t,n,r)}t=t.child}return t;case 5:return i0(t),e===null&&ch(t),n=t.type,i=t.pendingProps,a=e!==null?e.memoizedProps:null,l=i.children,sh(n,i)?l=null:a!==null&&sh(n,a)&&(t.flags|=32),D0(e,t),Jt(e,t,l,r),t.child;case 6:return e===null&&ch(t),null;case 13:return A0(e,t,r);case 4:return Vd(t,t.stateNode.containerInfo),n=t.pendingProps,e===null?t.child=di(t,null,n,r):Jt(e,t,n,r),t.child;case 11:return n=t.type,i=t.pendingProps,i=t.elementType===n?i:Dr(n,i),ym(e,t,n,i,r);case 7:return Jt(e,t,t.pendingProps,r),t.child;case 8:return Jt(e,t,t.pendingProps.children,r),t.child;case 12:return Jt(e,t,t.pendingProps.children,r),t.child;case 10:e:{if(n=t.type._context,i=t.pendingProps,a=t.memoizedProps,l=i.value,Ze(Cl,n._currentValue),n._currentValue=l,a!==null)if(Nr(a.value,l)){if(a.children===i.children&&!ir.current){t=vn(e,t,r);break e}}else for(a=t.child,a!==null&&(a.return=t);a!==null;){var s=a.dependencies;if(s!==null){l=a.child;for(var o=s.firstContext;o!==null;){if(o.context===n){if(a.tag===1){o=dn(-1,r&-r),o.tag=2;var c=a.updateQueue;if(c!==null){c=c.shared;var f=c.pending;f===null?o.next=o:(o.next=f.next,f.next=o),c.pending=o}}a.lanes|=r,o=a.alternate,o!==null&&(o.lanes|=r),uh(a.return,r,t),s.lanes|=r;break}o=o.next}}else if(a.tag===10)l=a.type===t.type?null:a.child;else if(a.tag===18){if(l=a.return,l===null)throw Error(ce(341));l.lanes|=r,s=l.alternate,s!==null&&(s.lanes|=r),uh(l,r,t),l=a.sibling}else l=a.child;if(l!==null)l.return=a;else for(l=a;l!==null;){if(l===t){l=null;break}if(a=l.sibling,a!==null){a.return=l.return,l=a;break}l=l.return}a=l}Jt(e,t,i.children,r),t=t.child}return t;case 9:return i=t.type,n=t.pendingProps.children,ri(t,r),i=Cr(i),n=n(i),t.flags|=1,Jt(e,t,n,r),t.child;case 14:return n=t.type,i=Dr(n,t.pendingProps),i=Dr(n.type,i),wm(e,t,n,i,r);case 15:return T0(e,t,t.type,t.pendingProps,r);case 17:return n=t.type,i=t.pendingProps,i=t.elementType===n?i:Dr(n,i),Qa(e,t),t.tag=1,or(n)?(e=!0,Sl(t)):e=!1,ri(t,r),E0(t,n,i),dh(t,n,i,r),mh(null,t,n,!0,e,r);case 19:return P0(e,t,r);case 22:return R0(e,t,r)}throw Error(ce(156,t.tag))};function X0(e,t){return x_(e,t)}function Wb(e,t,r,n){this.tag=e,this.key=r,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=n,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function wr(e,t,r,n){return new Wb(e,t,r,n)}function af(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Vb(e){if(typeof e=="function")return af(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Ed)return 11;if(e===kd)return 14}return 2}function zn(e,t){var r=e.alternate;return r===null?(r=wr(e.tag,t,e.key,e.mode),r.elementType=e.elementType,r.type=e.type,r.stateNode=e.stateNode,r.alternate=e,e.alternate=r):(r.pendingProps=t,r.type=e.type,r.flags=0,r.subtreeFlags=0,r.deletions=null),r.flags=e.flags&14680064,r.childLanes=e.childLanes,r.lanes=e.lanes,r.child=e.child,r.memoizedProps=e.memoizedProps,r.memoizedState=e.memoizedState,r.updateQueue=e.updateQueue,t=e.dependencies,r.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},r.sibling=e.sibling,r.index=e.index,r.ref=e.ref,r}function tl(e,t,r,n,i,a){var l=2;if(n=e,typeof e=="function")af(e)&&(l=1);else if(typeof e=="string")l=5;else e:switch(e){case Bs:return gs(r.children,i,a,t);case Cd:l=8,i|=8;break;case Bu:return e=wr(12,r,t,i|2),e.elementType=Bu,e.lanes=a,e;case Nu:return e=wr(13,r,t,i),e.elementType=Nu,e.lanes=a,e;case ju:return e=wr(19,r,t,i),e.elementType=ju,e.lanes=a,e;case i_:return hc(r,i,a,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case n_:l=10;break e;case s_:l=9;break e;case Ed:l=11;break e;case kd:l=14;break e;case Ln:l=16,n=null;break e}throw Error(ce(130,e==null?e:typeof e,""))}return t=wr(l,r,t,i),t.elementType=e,t.type=n,t.lanes=a,t}function gs(e,t,r,n){return e=wr(7,e,n,t),e.lanes=r,e}function hc(e,t,r,n){return e=wr(22,e,n,t),e.elementType=i_,e.lanes=r,e.stateNode={isHidden:!1},e}function Qc(e,t,r){return e=wr(6,e,null,t),e.lanes=r,e}function Zc(e,t,r){return t=wr(4,e.children!==null?e.children:[],e.key,t),t.lanes=r,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function Kb(e,t,r,n,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=Pc(0),this.expirationTimes=Pc(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Pc(0),this.identifierPrefix=n,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function lf(e,t,r,n,i,a,l,s,o){return e=new Kb(e,t,r,s,o),t===1?(t=1,a===!0&&(t|=8)):t=0,a=wr(3,null,null,t),e.current=a,a.stateNode=e,a.memoizedState={element:n,isDehydrated:r,cache:null,transitions:null,pendingSuspenseBoundaries:null},Wd(a),e}function Gb(e,t,r){var n=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:Os,key:n==null?null:""+n,children:e,containerInfo:t,implementation:r}}function Y0(e){if(!e)return Wn;e=e._reactInternals;e:{if(Es(e)!==e||e.tag!==1)throw Error(ce(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(or(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(ce(171))}if(e.tag===1){var r=e.type;if(or(r))return Y_(e,r,t)}return t}function J0(e,t,r,n,i,a,l,s,o){return e=lf(r,n,!0,e,i,a,l,s,o),e.context=Y0(null),r=e.current,n=er(),i=$n(r),a=dn(n,i),a.callback=t??null,Fn(r,a,i),e.current.lanes=i,Xo(e,i,n),ar(e,n),e}function dc(e,t,r,n){var i=t.current,a=er(),l=$n(i);return r=Y0(r),t.context===null?t.context=r:t.pendingContext=r,t=dn(a,l),t.payload={element:e},n=n===void 0?null:n,n!==null&&(t.callback=n),e=Fn(i,t,l),e!==null&&(Br(e,i,l,a),Xa(e,i,l)),l}function Il(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 Am(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var r=e.retryLane;e.retryLane=r!==0&&r<t?r:t}}function cf(e,t){Am(e,t),(e=e.alternate)&&Am(e,t)}function qb(){return null}var Q0=typeof reportError=="function"?reportError:function(e){console.error(e)};function uf(e){this._internalRoot=e}fc.prototype.render=uf.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(ce(409));dc(e,t,null,null)};fc.prototype.unmount=uf.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;bs(function(){dc(null,e,null,null)}),t[mn]=null}};function fc(e){this._internalRoot=e}fc.prototype.unstable_scheduleHydration=function(e){if(e){var t=R_();e={blockedOn:null,target:e,priority:t};for(var r=0;r<Dn.length&&t!==0&&t<Dn[r].priority;r++);Dn.splice(r,0,e),r===0&&M_(e)}};function hf(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function pc(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function Pm(){}function Xb(e,t,r,n,i){if(i){if(typeof n=="function"){var a=n;n=function(){var c=Il(l);a.call(c)}}var l=J0(t,n,e,0,null,!1,!1,"",Pm);return e._reactRootContainer=l,e[mn]=l.current,Lo(e.nodeType===8?e.parentNode:e),bs(),l}for(;i=e.lastChild;)e.removeChild(i);if(typeof n=="function"){var s=n;n=function(){var c=Il(o);s.call(c)}}var o=lf(e,0,!1,null,null,!1,!1,"",Pm);return e._reactRootContainer=o,e[mn]=o.current,Lo(e.nodeType===8?e.parentNode:e),bs(function(){dc(t,o,r,n)}),o}function mc(e,t,r,n,i){var a=r._reactRootContainer;if(a){var l=a;if(typeof i=="function"){var s=i;i=function(){var o=Il(l);s.call(o)}}dc(t,l,e,i)}else l=Xb(r,t,e,i,n);return Il(l)}L_=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var r=Gi(t.pendingLanes);r!==0&&(Rd(t,r|1),ar(t,pt()),!(Xe&6)&&(mi=pt()+500,Xn()))}break;case 13:bs(function(){var n=gn(e,1);if(n!==null){var i=er();Br(n,e,1,i)}}),cf(e,1)}};Dd=function(e){if(e.tag===13){var t=gn(e,134217728);if(t!==null){var r=er();Br(t,e,134217728,r)}cf(e,134217728)}};T_=function(e){if(e.tag===13){var t=$n(e),r=gn(e,t);if(r!==null){var n=er();Br(r,e,t,n)}cf(e,t)}};R_=function(){return Qe};D_=function(e,t){var r=Qe;try{return Qe=e,t()}finally{Qe=r}};qu=function(e,t,r){switch(t){case"input":if($u(e,r),t=r.name,r.type==="radio"&&t!=null){for(r=e;r.parentNode;)r=r.parentNode;for(r=r.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<r.length;t++){var n=r[t];if(n!==e&&n.form===e.form){var i=ic(n);if(!i)throw Error(ce(90));a_(n),$u(n,i)}}}break;case"textarea":c_(e,r);break;case"select":t=r.value,t!=null&&Qs(e,!!r.multiple,t,!1)}};g_=nf;v_=bs;var Yb={usingClientEntryPoint:!1,Events:[Jo,Hs,ic,p_,m_,nf]},Fi={findFiberByHostInstance:ls,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},Jb={bundleType:Fi.bundleType,version:Fi.version,rendererPackageName:Fi.rendererPackageName,rendererConfig:Fi.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:yn.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=w_(e),e===null?null:e.stateNode},findFiberByHostInstance:Fi.findFiberByHostInstance||qb,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 ka=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!ka.isDisabled&&ka.supportsFiber)try{tc=ka.inject(Jb),Ur=ka}catch{}}pr.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Yb;pr.createPortal=function(e,t){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!hf(t))throw Error(ce(200));return Gb(e,t,null,r)};pr.createRoot=function(e,t){if(!hf(e))throw Error(ce(299));var r=!1,n="",i=Q0;return t!=null&&(t.unstable_strictMode===!0&&(r=!0),t.identifierPrefix!==void 0&&(n=t.identifierPrefix),t.onRecoverableError!==void 0&&(i=t.onRecoverableError)),t=lf(e,1,!1,null,null,r,!1,n,i),e[mn]=t.current,Lo(e.nodeType===8?e.parentNode:e),new uf(t)};pr.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(ce(188)):(e=Object.keys(e).join(","),Error(ce(268,e)));return e=w_(t),e=e===null?null:e.stateNode,e};pr.flushSync=function(e){return bs(e)};pr.hydrate=function(e,t,r){if(!pc(t))throw Error(ce(200));return mc(null,e,t,!0,r)};pr.hydrateRoot=function(e,t,r){if(!hf(e))throw Error(ce(405));var n=r!=null&&r.hydratedSources||null,i=!1,a="",l=Q0;if(r!=null&&(r.unstable_strictMode===!0&&(i=!0),r.identifierPrefix!==void 0&&(a=r.identifierPrefix),r.onRecoverableError!==void 0&&(l=r.onRecoverableError)),t=J0(t,null,e,1,r??null,i,!1,a,l),e[mn]=t.current,Lo(e),n)for(e=0;e<n.length;e++)r=n[e],i=r._getVersion,i=i(r._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[r,i]:t.mutableSourceEagerHydrationData.push(r,i);return new fc(t)};pr.render=function(e,t,r){if(!pc(t))throw Error(ce(200));return mc(null,e,t,!1,r)};pr.unmountComponentAtNode=function(e){if(!pc(e))throw Error(ce(40));return e._reactRootContainer?(bs(function(){mc(null,null,e,!1,function(){e._reactRootContainer=null,e[mn]=null})}),!0):!1};pr.unstable_batchedUpdates=nf;pr.unstable_renderSubtreeIntoContainer=function(e,t,r,n){if(!pc(r))throw Error(ce(200));if(e==null||e._reactInternals===void 0)throw Error(ce(38));return mc(e,t,r,!1,n)};pr.version="18.3.1-next-f1338f8080-20240426";function Z0(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Z0)}catch(e){console.error(e)}}Z0(),Zv.exports=pr;var hn=Zv.exports,ey,Im=hn;ey=Im.createRoot,Im.hydrateRoot;const Om=e=>{let t;const r=new Set,n=(c,f)=>{const u=typeof c=="function"?c(t):c;if(!Object.is(u,t)){const p=t;t=f??(typeof u!="object"||u===null)?u:Object.assign({},t,u),r.forEach(_=>_(t,p))}},i=()=>t,s={setState:n,getState:i,getInitialState:()=>o,subscribe:c=>(r.add(c),()=>r.delete(c))},o=t=e(n,i,s);return s},Qb=e=>e?Om(e):Om,Zb=e=>e;function eC(e,t=Zb){const r=gt.useSyncExternalStore(e.subscribe,gt.useCallback(()=>t(e.getState()),[e,t]),gt.useCallback(()=>t(e.getInitialState()),[e,t]));return gt.useDebugValue(r),r}const tC=e=>{const t=Qb(e),r=n=>eC(t,n);return Object.assign(r,t),r},df=e=>tC;function gc(e,t){let r;try{r=e()}catch{return}return{getItem:i=>{var a;const l=o=>o===null?null:JSON.parse(o,void 0),s=(a=r.getItem(i))!=null?a:null;return s instanceof Promise?s.then(l):l(s)},setItem:(i,a)=>r.setItem(i,JSON.stringify(a,void 0)),removeItem:i=>r.removeItem(i)}}const Lh=e=>t=>{try{const r=e(t);return r instanceof Promise?r:{then(n){return Lh(n)(r)},catch(n){return this}}}catch(r){return{then(n){return this},catch(n){return Lh(n)(r)}}}},rC=(e,t)=>(r,n,i)=>{let a={storage:gc(()=>localStorage),partialize:v=>v,version:0,merge:(v,h)=>({...h,...v}),...t},l=!1;const s=new Set,o=new Set;let c=a.storage;if(!c)return e((...v)=>{console.warn(`[zustand persist middleware] Unable to update item '${a.name}', the given storage is currently unavailable.`),r(...v)},n,i);const f=()=>{const v=a.partialize({...n()});return c.setItem(a.name,{state:v,version:a.version})},u=i.setState;i.setState=(v,h)=>(u(v,h),f());const p=e((...v)=>(r(...v),f()),n,i);i.getInitialState=()=>p;let _;const y=()=>{var v,h;if(!c)return;l=!1,s.forEach(d=>{var g;return d((g=n())!=null?g:p)});const m=((h=a.onRehydrateStorage)==null?void 0:h.call(a,(v=n())!=null?v:p))||void 0;return Lh(c.getItem.bind(c))(a.name).then(d=>{if(d)if(typeof d.version=="number"&&d.version!==a.version){if(a.migrate){const g=a.migrate(d.state,d.version);return g instanceof Promise?g.then(w=>[!0,w]):[!0,g]}console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return[!1,d.state];return[!1,void 0]}).then(d=>{var g;const[w,b]=d;if(_=a.merge(b,(g=n())!=null?g:p),r(_,!0),w)return f()}).then(()=>{m==null||m(_,void 0),_=n(),l=!0,o.forEach(d=>d(_))}).catch(d=>{m==null||m(void 0,d)})};return i.persist={setOptions:v=>{a={...a,...v},v.storage&&(c=v.storage)},clearStorage:()=>{c==null||c.removeItem(a.name)},getOptions:()=>a,rehydrate:()=>y(),hasHydrated:()=>l,onHydrate:v=>(s.add(v),()=>{s.delete(v)}),onFinishHydration:v=>(o.add(v),()=>{o.delete(v)})},a.skipHydration||y(),_||p},ff=rC;function nC(){const e=new Map;return{getItem:t=>e.get(t)??null,setItem:(t,r)=>{e.set(t,r)},removeItem:t=>{e.delete(t)}}}const Ps=nC(),lo={getItem:e=>{if(typeof localStorage>"u")return Ps.getItem(e);try{return localStorage.getItem(e)}catch{return Ps.getItem(e)}},setItem:(e,t)=>{if(typeof localStorage>"u"){Ps.setItem(e,t);return}try{localStorage.setItem(e,t)}catch{Ps.setItem(e,t)}},removeItem:e=>{if(typeof localStorage>"u"){Ps.removeItem(e);return}try{localStorage.removeItem(e)}catch{Ps.removeItem(e)}}};function sC(e){const t=new Map;let r=!1;const n=i=>{var a;(a=globalThis.Bun)==null||a.main};return{getItem(i){if(n(),r)return t.get(i)??null;r=!0;const a=lo.getItem(i);return a!==null&&t.set(i,a),a},setItem(i,a){n(),t.set(i,a),lo.setItem(i,a)},removeItem(i){n(),t.delete(i),lo.removeItem(i)}}}const Th="~/Documents/GitHub",iC="claude",si=50,oC=typeof navigator<"u"&&/^((?!chrome|android).)*safari/i.test(navigator.userAgent)&&!/iPhone|iPad|iPod/.test(navigator.userAgent),aC=!(oC&&(typeof devicePixelRatio<"u"?devicePixelRatio:1)>1),Rh=[{id:"jetbrains-mono",label:"JetBrains Mono",family:'"JetBrains Mono Variable", "JetBrains Mono", "SF Mono", "Fira Code", ui-monospace, monospace'},{id:"system",label:"System Default",family:'ui-monospace, "SF Mono", Menlo, Monaco, "Cascadia Code", "Consolas", monospace'},{id:"custom",label:"Custom",family:""}];function lC(e,t){if(e==="custom"&&t.trim())return t.trim();const r=Rh.find(n=>n.id===e);return(r==null?void 0:r.family)||Rh[0].family}const La=[{id:"claude",label:"Claude",command:"claude",isBuiltIn:!0,agentType:"claude"},{id:"codex",label:"Codex",command:"codex",isBuiltIn:!0,agentType:"codex"},{id:"pi",label:"Pi",command:"pi",isBuiltIn:!0,agentType:"pi"}];function cC(e){if(typeof e!="object"||e===null)return!1;const t=e;return typeof t.id=="string"&&t.id.length>=1&&t.id.length<=128&&typeof t.label=="string"&&t.label.trim().length>=1&&t.label.length<=64&&typeof t.command=="string"&&t.command.trim().length>=1&&t.command.length<=1024&&typeof t.isBuiltIn=="boolean"&&(t.agentType===void 0||t.agentType==="claude"||t.agentType==="codex"||t.agentType==="pi")}function Bm(e){return{...e,label:e.label.trim().slice(0,64),command:e.command.trim().slice(0,1024)}}function Hi(e){return e.command.trim()}function Nm(e){for(let r=0;r<100;r++){const n=`custom-${Date.now()}-${Math.random().toString(36).slice(2,6)}`;if(!e.has(n))return n}return`custom-${Date.now()}-${Math.random().toString(36).slice(2)}`}function jm(e,t){var r;return e.some(n=>n.id===t)?t:((r=e[0])==null?void 0:r.id)||"claude"}const ty=180,ry=400,uC=240,me=df()(ff((e,t)=>({defaultProjectDir:Th,setDefaultProjectDir:r=>e({defaultProjectDir:r}),defaultCommand:iC,setDefaultCommand:r=>e({defaultCommand:r}),lastProjectPath:null,setLastProjectPath:r=>e({lastProjectPath:r}),recentPaths:[],addRecentPath:r=>e(n=>({recentPaths:[r,...n.recentPaths.filter(i=>i!==r)].slice(0,5)})),sessionSortMode:"created",setSessionSortMode:r=>e({sessionSortMode:r}),sessionSortDirection:"desc",setSessionSortDirection:r=>e({sessionSortDirection:r}),manualSessionOrder:[],setManualSessionOrder:r=>e({manualSessionOrder:r}),useWebGL:aC,setUseWebGL:r=>e({useWebGL:r}),fontSize:13,setFontSize:r=>e({fontSize:Math.max(6,Math.min(24,r))}),lineHeight:1,setLineHeight:r=>e({lineHeight:Math.max(1,Math.min(2,r))}),letterSpacing:0,setLetterSpacing:r=>e({letterSpacing:Math.max(-3,Math.min(3,r))}),fontOption:"jetbrains-mono",setFontOption:r=>e({fontOption:r}),customFontFamily:"",setCustomFontFamily:r=>e({customFontFamily:r.slice(0,256)}),shortcutModifier:"auto",setShortcutModifier:r=>e({shortcutModifier:r}),showProjectName:!0,setShowProjectName:r=>e({showProjectName:r}),showLastUserMessage:!0,setShowLastUserMessage:r=>e({showLastUserMessage:r}),showSessionIdPrefix:!1,setShowSessionIdPrefix:r=>e({showSessionIdPrefix:r}),inactiveSessionsExpanded:!1,setInactiveSessionsExpanded:r=>e({inactiveSessionsExpanded:r}),sidebarWidth:uC,setSidebarWidth:r=>e({sidebarWidth:Math.max(ty,Math.min(ry,r))}),projectFilters:[],setProjectFilters:r=>e({projectFilters:r}),hostFilters:[],setHostFilters:r=>e({hostFilters:r}),soundOnPermission:!1,setSoundOnPermission:r=>e({soundOnPermission:r}),soundOnIdle:!1,setSoundOnIdle:r=>e({soundOnIdle:r}),commandPresets:La,setCommandPresets:r=>e({commandPresets:r}),defaultPresetId:"claude",setDefaultPresetId:r=>e({defaultPresetId:r}),updatePresetCommand:(r,n)=>{const{commandPresets:i}=t(),a=i.map(l=>l.id===r?{...l,command:n.trim().slice(0,1024)}:l);e({commandPresets:a})},addPreset:r=>{const{commandPresets:n}=t();if(n.length>=si){console.warn("[agentboard:settings] Max presets reached");return}const i=new Set(n.map(l=>l.id)),a={...Bm({...r,id:"",isBuiltIn:!1}),id:Nm(i),isBuiltIn:!1};e({commandPresets:[...n,a]})},removePreset:r=>{const{commandPresets:n,defaultPresetId:i}=t(),a=n.find(o=>o.id===r);if(!a||a.isBuiltIn)return;const l=n.filter(o=>o.id!==r),s=r===i?jm(l,i):i;e({commandPresets:l,defaultPresetId:s})}}),{name:"agentboard-settings",storage:gc(()=>lo),version:4,partialize:e=>{const{manualSessionOrder:t,...r}=e;return r},migrate:(e,t)=>{const r=e,n=p=>{if(typeof p.command=="string")return p;const _=typeof p.baseCommand=="string"?p.baseCommand.trim():"",y=typeof p.modifiers=="string"?p.modifiers.trim():"",v=y?`${_} ${y}`:_;return{id:p.id,label:p.label,command:v||"claude",isBuiltIn:p.isBuiltIn,agentType:p.agentType}};if(t===0||!Array.isArray(r.commandPresets)){const p=typeof r.defaultCommand=="string"?r.defaultCommand:"claude",_=[...La];let y="claude";if(p==="codex")y="codex";else if(p!=="claude"){const v=new Set(_.map(m=>m.id)),h={id:Nm(v),label:"Migrated",command:p,isBuiltIn:!1};_.push(h),y=h.id}return console.info("[agentboard:settings] Migrated from v0 to v2"),{...r,commandPresets:_,defaultPresetId:y,defaultCommand:p,recentPaths:[]}}const l=r.commandPresets.map(n).filter(cC);if(!(l.some(p=>p.id==="claude")&&l.some(p=>p.id==="codex"))||l.length===0)return console.warn("[agentboard:settings] Invalid presets, resetting to defaults"),{...r,commandPresets:La,defaultPresetId:"claude"};const o=l.length>si?[...l.filter(p=>p.isBuiltIn),...l.filter(p=>!p.isBuiltIn).slice(0,si-2)]:l,c=new Set(o.map(p=>p.id)),f=La.filter(p=>p.isBuiltIn&&!c.has(p.id)),u=[...o,...f];return t<4&&console.info(`[agentboard:settings] Migrated from v${t} to v4 (ensured all built-in presets)`),{...r,commandPresets:u.map(Bm),defaultPresetId:jm(o,r.defaultPresetId)}}}));function hC(){const[e,t]=E.useState(me.persist.hasHydrated());return E.useEffect(()=>{const r=me.persist.onFinishHydration(()=>t(!0));return me.persist.hasHydrated()&&t(!0),r},[]),e}function dC({title:e,titleId:t,...r},n){return E.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true",ref:n,"aria-labelledby":t},r),e?E.createElement("title",{id:t},e):null,E.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 9v4m0 4h.01M10.615 3.892L2.39 18.098c-.456.788-.684 1.182-.65 1.506a1 1 0 00.406.705c.263.191.718.191 1.629.191h16.45c.91 0 1.365 0 1.628-.191a1 1 0 00.407-.705c.034-.324-.195-.718-.65-1.506L13.383 3.892c-.454-.785-.681-1.178-.978-1.31a1 1 0 00-.813 0c-.296.132-.523.525-.978 1.31z"}))}const fC=E.forwardRef(dC);function pC({title:e,titleId:t,...r},n){return E.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true",ref:n,"aria-labelledby":t},r),e?E.createElement("title",{id:t},e):null,E.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 9l6 6 6-6"}))}const pf=E.forwardRef(pC);function mC({title:e,titleId:t,...r},n){return E.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true",ref:n,"aria-labelledby":t},r),e?E.createElement("title",{id:t},e):null,E.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 18l6-6-6-6"}))}const gC=E.forwardRef(mC);function vC({title:e,titleId:t,...r},n){return E.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true",ref:n,"aria-labelledby":t},r),e?E.createElement("title",{id:t},e):null,E.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 15c-.932 0-1.398 0-1.765-.152a2 2 0 01-1.083-1.083C2 13.398 2 12.932 2 12V5.2c0-1.12 0-1.68.218-2.108a2 2 0 01.874-.874C3.52 2 4.08 2 5.2 2H12c.932 0 1.398 0 1.765.152a2 2 0 011.083 1.083C15 3.602 15 4.068 15 5m-2.8 17h6.6c1.12 0 1.68 0 2.108-.218a2 2 0 00.874-.874C22 20.48 22 19.92 22 18.8v-6.6c0-1.12 0-1.68-.218-2.108a2 2 0 00-.874-.874C20.48 9 19.92 9 18.8 9h-6.6c-1.12 0-1.68 0-2.108.218a2 2 0 00-.874.874C9 10.52 9 11.08 9 12.2v6.6c0 1.12 0 1.68.218 2.108a2 2 0 00.874.874C10.52 22 11.08 22 12.2 22z"}))}const ny=E.forwardRef(vC);function _C({title:e,titleId:t,...r},n){return E.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true",ref:n,"aria-labelledby":t},r),e?E.createElement("title",{id:t},e):null,E.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M20 4v1.4c0 3.36 0 5.04-.654 6.324a6 6 0 01-2.622 2.622C15.44 15 13.76 15 10.4 15H4m0 0l5-5m-5 5l5 5"}))}const yC=E.forwardRef(_C);function wC({title:e,titleId:t,...r},n){return E.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true",ref:n,"aria-labelledby":t},r),e?E.createElement("title",{id:t},e):null,E.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 13a1 1 0 100-2 1 1 0 000 2zM12 6a1 1 0 100-2 1 1 0 000 2zM12 20a1 1 0 100-2 1 1 0 000 2z"}))}const SC=E.forwardRef(wC);function xC({title:e,titleId:t,...r},n){return E.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true",ref:n,"aria-labelledby":t},r),e?E.createElement("title",{id:t},e):null,E.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M11 4H6.8c-1.68 0-2.52 0-3.162.327a3 3 0 00-1.311 1.311C2 6.28 2 7.12 2 8.8v8.4c0 1.68 0 2.52.327 3.162a3 3 0 001.311 1.311C4.28 22 5.12 22 6.8 22h8.4c1.68 0 2.52 0 3.162-.327a3 3 0 001.311-1.311C20 19.72 20 18.88 20 17.2V13M8 16h1.675c.489 0 .733 0 .963-.055.204-.05.4-.13.579-.24.201-.123.374-.296.72-.642L21.5 5.5a2.121 2.121 0 00-3-3l-9.563 9.563c-.346.346-.519.519-.642.72a2 2 0 00-.24.579c-.055.23-.055.474-.055.963V16z"}))}const sy=E.forwardRef(xC);function bC({title:e,titleId:t,...r},n){return E.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true",ref:n,"aria-labelledby":t},r),e?E.createElement("title",{id:t},e):null,E.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M14 2.27V6.4c0 .56 0 .84.109 1.054a1 1 0 00.437.437c.214.11.494.11 1.054.11h4.13M16 13H8m8 4H8m2-8H8m6-7H8.8c-1.68 0-2.52 0-3.162.327a3 3 0 00-1.311 1.311C4 4.28 4 5.12 4 6.8v10.4c0 1.68 0 2.52.327 3.162a3 3 0 001.311 1.311C6.28 22 7.12 22 8.8 22h6.4c1.68 0 2.52 0 3.162-.327a3 3 0 001.311-1.311C20 19.72 20 18.88 20 17.2V8l-6-6z"}))}const iy=E.forwardRef(bC);function CC({title:e,titleId:t,...r},n){return E.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true",ref:n,"aria-labelledby":t},r),e?E.createElement("title",{id:t},e):null,E.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M13 7l-1.116-2.231c-.32-.642-.481-.963-.72-1.198a2 2 0 00-.748-.462C10.1 3 9.74 3 9.022 3H5.2c-1.12 0-1.68 0-2.108.218a2 2 0 00-.874.874C2 4.52 2 5.08 2 6.2V7m0 0h15.2c1.68 0 2.52 0 3.162.327a3 3 0 011.311 1.311C22 9.28 22 10.12 22 11.8v4.4c0 1.68 0 2.52-.327 3.162a3 3 0 01-1.311 1.311C19.72 21 18.88 21 17.2 21H6.8c-1.68 0-2.52 0-3.162-.327a3 3 0 01-1.311-1.311C2 18.72 2 17.88 2 16.2V7z"}))}const EC=E.forwardRef(CC);function kC({title:e,titleId:t,...r},n){return E.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true",ref:n,"aria-labelledby":t},r),e?E.createElement("title",{id:t},e):null,E.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6.9 11.444v2.778m0-2.778V4.778c0-.92.761-1.667 1.7-1.667s1.7.746 1.7 1.667m-3.4 6.666c0-.92-.761-1.666-1.7-1.666s-1.7.746-1.7 1.666v2.223C3.5 18.269 7.306 22 12 22s8.5-3.731 8.5-8.333V8.11c0-.92-.761-1.667-1.7-1.667s-1.7.747-1.7 1.667m-6.8-3.333v6.11m0-6.11V3.667C10.3 2.747 11.061 2 12 2s1.7.746 1.7 1.667v1.11m0 0v6.112m0-6.111c0-.92.761-1.667 1.7-1.667s1.7.746 1.7 1.667V8.11m0 0v2.778"}))}const LC=E.forwardRef(kC);function TC({title:e,titleId:t,...r},n){return E.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true",ref:n,"aria-labelledby":t},r),e?E.createElement("title",{id:t},e):null,E.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3 12h18M3 6h18M3 18h18"}))}const RC=E.forwardRef(TC);function DC({title:e,titleId:t,...r},n){return E.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true",ref:n,"aria-labelledby":t},r),e?E.createElement("title",{id:t},e):null,E.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 9l-3 3m0 0l3 3m-3-3h20M9 5l3-3m0 0l3 3m-3-3v20m3-3l-3 3m0 0l-3-3M19 9l3 3m0 0l-3 3"}))}const MC=E.forwardRef(DC);function AC({title:e,titleId:t,...r},n){return E.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true",ref:n,"aria-labelledby":t},r),e?E.createElement("title",{id:t},e):null,E.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M8.377 15.616L2.72 21.273m8.974-14.631l-1.56 1.56a2.1 2.1 0 01-.264.242 1 1 0 01-.207.111c-.082.032-.17.05-.347.085l-3.665.733c-.952.19-1.428.286-1.65.537a1 1 0 00-.243.8c.046.333.39.677 1.076 1.363l7.086 7.086c.686.687 1.03 1.03 1.362 1.076a1 1 0 00.801-.242c.251-.223.346-.7.537-1.651l.733-3.665c.035-.176.053-.265.085-.347a.997.997 0 01.11-.207c.051-.072.115-.136.242-.263l1.561-1.561c.082-.082.122-.122.167-.158.04-.031.082-.06.126-.085.05-.029.103-.051.208-.097l2.495-1.069c.727-.312 1.091-.467 1.256-.72a1 1 0 00.144-.747c-.06-.295-.34-.575-.9-1.135l-5.142-5.143c-.56-.56-.84-.84-1.135-.9a1 1 0 00-.748.145c-.252.165-.407.529-.72 1.256l-1.068 2.495a2.096 2.096 0 01-.097.208.998.998 0 01-.085.126 2.065 2.065 0 01-.158.167z"}))}const Ol=E.forwardRef(AC);function PC({title:e,titleId:t,...r},n){return E.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true",ref:n,"aria-labelledby":t},r),e?E.createElement("title",{id:t},e):null,E.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 5v14m-7-7h14"}))}const oy=E.forwardRef(PC);function IC({title:e,titleId:t,...r},n){return E.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true",ref:n,"aria-labelledby":t},r),e?E.createElement("title",{id:t},e):null,E.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 15a3 3 0 100-6 3 3 0 000 6z"}),E.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M18.727 14.727a1.5 1.5 0 00.3 1.655l.055.054a1.816 1.816 0 010 2.573 1.818 1.818 0 01-2.573 0l-.055-.055a1.5 1.5 0 00-1.654-.3 1.5 1.5 0 00-.91 1.373v.155a1.818 1.818 0 11-3.636 0V20.1a1.5 1.5 0 00-.981-1.373 1.5 1.5 0 00-1.655.3l-.054.055a1.818 1.818 0 01-3.106-1.287 1.818 1.818 0 01.533-1.286l.054-.055a1.5 1.5 0 00.3-1.654 1.5 1.5 0 00-1.372-.91h-.155a1.818 1.818 0 110-3.636H3.9a1.5 1.5 0 001.373-.981 1.5 1.5 0 00-.3-1.655l-.055-.054A1.818 1.818 0 117.491 4.99l.054.054a1.5 1.5 0 001.655.3h.073a1.5 1.5 0 00.909-1.372v-.155a1.818 1.818 0 013.636 0V3.9a1.499 1.499 0 00.91 1.373 1.5 1.5 0 001.654-.3l.054-.055a1.817 1.817 0 012.573 0 1.819 1.819 0 010 2.573l-.055.054a1.5 1.5 0 00-.3 1.655v.073a1.5 1.5 0 001.373.909h.155a1.818 1.818 0 010 3.636H20.1a1.499 1.499 0 00-1.373.91z"}))}const OC=E.forwardRef(IC);function BC({title:e,titleId:t,...r},n){return E.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true",ref:n,"aria-labelledby":t},r),e?E.createElement("title",{id:t},e):null,E.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 15a3 3 0 100-6 3 3 0 000 6z"}),E.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9.29 19.371l.584 1.315a2.213 2.213 0 004.044 0l.585-1.315a2.426 2.426 0 012.47-1.423l1.43.152a2.212 2.212 0 002.022-3.502l-.847-1.164a2.428 2.428 0 01-.46-1.434c0-.513.163-1.014.465-1.429l.847-1.163a2.212 2.212 0 00-2.023-3.502l-1.43.152a2.433 2.433 0 01-1.47-.312 2.425 2.425 0 01-1-1.117l-.588-1.315a2.212 2.212 0 00-4.045 0L9.29 4.63c-.207.468-.558.86-1 1.117-.445.256-.96.365-1.47.312l-1.435-.152a2.212 2.212 0 00-2.022 3.502l.847 1.163a2.43 2.43 0 010 2.858l-.847 1.163a2.21 2.21 0 00.786 3.273c.381.195.81.274 1.236.23l1.43-.153a2.434 2.434 0 012.475 1.43z"}))}const NC=E.forwardRef(BC);function jC({title:e,titleId:t,...r},n){return E.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true",ref:n,"aria-labelledby":t},r),e?E.createElement("title",{id:t},e):null,E.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4 17l6-6-6-6m8 14h8"}))}const FC=E.forwardRef(jC);function HC({title:e,titleId:t,...r},n){return E.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true",ref:n,"aria-labelledby":t},r),e?E.createElement("title",{id:t},e):null,E.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M18 6L6 18M6 6l12 12"}))}const Dh=E.forwardRef(HC);function Zo(){if(typeof navigator>"u")return!1;const e=navigator.userAgent,t=/iPad|iPhone|iPod/.test(e),r=navigator.platform==="MacIntel"&&navigator.maxTouchPoints>1;return t||r}function $C(){return typeof navigator>"u"?!1:Zo()&&navigator.standalone===!0}function zC(){return typeof navigator>"u"?!1:navigator.platform.toUpperCase().indexOf("MAC")>=0}function ea(e){return e==="auto"?zC()?"ctrl-option":"ctrl-shift":e}const UC={"ctrl-option":"⌃⌥","ctrl-shift":"⌃⇧","cmd-option":"⌘⌥","cmd-shift":"⌘⇧"};function ii(e){return UC[e]}function WC(e,t){switch(t){case"ctrl-option":return e.ctrlKey&&e.altKey&&!e.metaKey&&!e.shiftKey;case"ctrl-shift":return e.ctrlKey&&e.shiftKey&&!e.metaKey&&!e.altKey;case"cmd-option":return e.metaKey&&e.altKey&&!e.ctrlKey&&!e.shiftKey;case"cmd-shift":return e.metaKey&&e.shiftKey&&!e.ctrlKey&&!e.altKey}}const VC={connected:"bg-working",connecting:"bg-approval",reconnecting:"bg-approval",disconnected:"bg-danger"};function KC({connectionStatus:e,onNewSession:t,onOpenSettings:r,tailscaleIp:n}){const[i,a]=E.useState(!1),l=me(c=>c.shortcutModifier),s=ii(ea(l)),o=()=>{if(!n)return;const c=`http://${n}:${window.location.port||"4040"}`;navigator.clipboard.writeText(c),a(!0),setTimeout(()=>a(!1),1500)};return T.jsxs("header",{className:"flex h-10 shrink-0 items-center justify-between border-b border-border bg-elevated px-3",children:[T.jsxs("div",{className:"flex items-center gap-2",children:[T.jsx("h1",{className:"text-sm font-semibold tracking-tight text-primary text-balance",children:"AGENTBOARD"}),T.jsxs("div",{className:"flex items-center gap-1.5 text-xs text-muted",children:[T.jsx("span",{className:`h-2 w-2 rounded-full ${VC[e]}`}),n&&T.jsxs("button",{onClick:o,className:"ml-3 inline-flex items-center gap-1 text-muted/70 hover:text-muted transition-colors cursor-pointer",title:"Tailscale IP - click to copy remote access URL",children:[T.jsx("span",{className:"leading-none translate-y-[1px]",children:i?"Copied!":n}),!i&&T.jsx(ny,{width:12,height:12,className:"shrink-0"})]})]})]}),T.jsxs("div",{className:"flex items-center gap-1.5",children:[T.jsx("button",{onClick:t,className:"flex h-7 w-7 items-center justify-center rounded bg-accent text-white hover:bg-accent/90 active:scale-95 transition-all",title:`New session (${s}N)`,"aria-label":"New session",children:T.jsx(oy,{width:16,height:16})}),T.jsx("button",{onClick:r,className:"flex h-7 w-7 items-center justify-center rounded border border-border text-secondary hover:bg-hover hover:text-primary active:scale-95 transition-all",title:"Settings","aria-label":"Settings",children:T.jsx(NC,{width:14,height:14})})]})]})}const mf=E.createContext({});function gf(e){const t=E.useRef(null);return t.current===null&&(t.current=e()),t.current}const vf=typeof window<"u",ay=vf?E.useLayoutEffect:E.useEffect,vc=E.createContext(null);function _f(e,t){e.indexOf(t)===-1&&e.push(t)}function yf(e,t){const r=e.indexOf(t);r>-1&&e.splice(r,1)}const Kr=(e,t,r)=>r>t?t:r<e?e:r;let wf=()=>{};const _n={},ly=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e);function cy(e){return typeof e=="object"&&e!==null}const uy=e=>/^0[^.\s]+$/u.test(e);function Sf(e){let t;return()=>(t===void 0&&(t=e()),t)}const br=e=>e,GC=(e,t)=>r=>t(e(r)),ta=(...e)=>e.reduce(GC),Bo=(e,t,r)=>{const n=t-e;return n===0?1:(r-e)/n};class xf{constructor(){this.subscriptions=[]}add(t){return _f(this.subscriptions,t),()=>yf(this.subscriptions,t)}notify(t,r,n){const i=this.subscriptions.length;if(i)if(i===1)this.subscriptions[0](t,r,n);else for(let a=0;a<i;a++){const l=this.subscriptions[a];l&&l(t,r,n)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const fn=e=>e*1e3,Sr=e=>e/1e3;function hy(e,t){return t?e*(1e3/t):0}const dy=(e,t,r)=>(((1-3*r+3*t)*e+(3*r-6*t))*e+3*t)*e,qC=1e-7,XC=12;function YC(e,t,r,n,i){let a,l,s=0;do l=t+(r-t)/2,a=dy(l,n,i)-e,a>0?r=l:t=l;while(Math.abs(a)>qC&&++s<XC);return l}function ra(e,t,r,n){if(e===t&&r===n)return br;const i=a=>YC(a,0,1,e,r);return a=>a===0||a===1?a:dy(i(a),t,n)}const fy=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,py=e=>t=>1-e(1-t),my=ra(.33,1.53,.69,.99),bf=py(my),gy=fy(bf),vy=e=>(e*=2)<1?.5*bf(e):.5*(2-Math.pow(2,-10*(e-1))),Cf=e=>1-Math.sin(Math.acos(e)),_y=py(Cf),yy=fy(Cf),JC=ra(.42,0,1,1),QC=ra(0,0,.58,1),wy=ra(.42,0,.58,1),ZC=e=>Array.isArray(e)&&typeof e[0]!="number",Sy=e=>Array.isArray(e)&&typeof e[0]=="number",e2={linear:br,easeIn:JC,easeInOut:wy,easeOut:QC,circIn:Cf,circInOut:yy,circOut:_y,backIn:bf,backInOut:gy,backOut:my,anticipate:vy},t2=e=>typeof e=="string",Fm=e=>{if(Sy(e)){wf(e.length===4);const[t,r,n,i]=e;return ra(t,r,n,i)}else if(t2(e))return e2[e];return e},Ta=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function r2(e,t){let r=new Set,n=new Set,i=!1,a=!1;const l=new WeakSet;let s={delta:0,timestamp:0,isProcessing:!1};function o(f){l.has(f)&&(c.schedule(f),e()),f(s)}const c={schedule:(f,u=!1,p=!1)=>{const y=p&&i?r:n;return u&&l.add(f),y.has(f)||y.add(f),f},cancel:f=>{n.delete(f),l.delete(f)},process:f=>{if(s=f,i){a=!0;return}i=!0,[r,n]=[n,r],r.forEach(o),r.clear(),i=!1,a&&(a=!1,c.process(f))}};return c}const n2=40;function xy(e,t){let r=!1,n=!0;const i={delta:0,timestamp:0,isProcessing:!1},a=()=>r=!0,l=Ta.reduce((g,w)=>(g[w]=r2(a),g),{}),{setup:s,read:o,resolveKeyframes:c,preUpdate:f,update:u,preRender:p,render:_,postRender:y}=l,v=()=>{const g=_n.useManualTiming?i.timestamp:performance.now();r=!1,_n.useManualTiming||(i.delta=n?1e3/60:Math.max(Math.min(g-i.timestamp,n2),1)),i.timestamp=g,i.isProcessing=!0,s.process(i),o.process(i),c.process(i),f.process(i),u.process(i),p.process(i),_.process(i),y.process(i),i.isProcessing=!1,r&&t&&(n=!1,e(v))},h=()=>{r=!0,n=!0,i.isProcessing||e(v)};return{schedule:Ta.reduce((g,w)=>{const b=l[w];return g[w]=(x,C=!1,S=!1)=>(r||h(),b.schedule(x,C,S)),g},{}),cancel:g=>{for(let w=0;w<Ta.length;w++)l[Ta[w]].cancel(g)},state:i,steps:l}}const{schedule:it,cancel:Vn,state:Nt,steps:eu}=xy(typeof requestAnimationFrame<"u"?requestAnimationFrame:br,!0);let rl;function s2(){rl=void 0}const Qt={now:()=>(rl===void 0&&Qt.set(Nt.isProcessing||_n.useManualTiming?Nt.timestamp:performance.now()),rl),set:e=>{rl=e,queueMicrotask(s2)}},by=e=>t=>typeof t=="string"&&t.startsWith(e),Cy=by("--"),i2=by("var(--"),Ef=e=>i2(e)?o2.test(e.split("/*")[0].trim()):!1,o2=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function Hm(e){return typeof e!="string"?!1:e.split("/*")[0].includes("var(--")}const bi={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},No={...bi,transform:e=>Kr(0,1,e)},Ra={...bi,default:1},co=e=>Math.round(e*1e5)/1e5,kf=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function a2(e){return e==null}const l2=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,Lf=(e,t)=>r=>!!(typeof r=="string"&&l2.test(r)&&r.startsWith(e)||t&&!a2(r)&&Object.prototype.hasOwnProperty.call(r,t)),Ey=(e,t,r)=>n=>{if(typeof n!="string")return n;const[i,a,l,s]=n.match(kf);return{[e]:parseFloat(i),[t]:parseFloat(a),[r]:parseFloat(l),alpha:s!==void 0?parseFloat(s):1}},c2=e=>Kr(0,255,e),tu={...bi,transform:e=>Math.round(c2(e))},hs={test:Lf("rgb","red"),parse:Ey("red","green","blue"),transform:({red:e,green:t,blue:r,alpha:n=1})=>"rgba("+tu.transform(e)+", "+tu.transform(t)+", "+tu.transform(r)+", "+co(No.transform(n))+")"};function u2(e){let t="",r="",n="",i="";return e.length>5?(t=e.substring(1,3),r=e.substring(3,5),n=e.substring(5,7),i=e.substring(7,9)):(t=e.substring(1,2),r=e.substring(2,3),n=e.substring(3,4),i=e.substring(4,5),t+=t,r+=r,n+=n,i+=i),{red:parseInt(t,16),green:parseInt(r,16),blue:parseInt(n,16),alpha:i?parseInt(i,16)/255:1}}const Mh={test:Lf("#"),parse:u2,transform:hs.transform},na=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),kn=na("deg"),Vr=na("%"),we=na("px"),h2=na("vh"),d2=na("vw"),$m={...Vr,parse:e=>Vr.parse(e)/100,transform:e=>Vr.transform(e*100)},Gs={test:Lf("hsl","hue"),parse:Ey("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:r,alpha:n=1})=>"hsla("+Math.round(e)+", "+Vr.transform(co(t))+", "+Vr.transform(co(r))+", "+co(No.transform(n))+")"},mt={test:e=>hs.test(e)||Mh.test(e)||Gs.test(e),parse:e=>hs.test(e)?hs.parse(e):Gs.test(e)?Gs.parse(e):Mh.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?hs.transform(e):Gs.transform(e),getAnimatableNone:e=>{const t=mt.parse(e);return t.alpha=0,mt.transform(t)}},f2=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function p2(e){var t,r;return isNaN(e)&&typeof e=="string"&&(((t=e.match(kf))==null?void 0:t.length)||0)+(((r=e.match(f2))==null?void 0:r.length)||0)>0}const ky="number",Ly="color",m2="var",g2="var(",zm="${}",v2=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function jo(e){const t=e.toString(),r=[],n={color:[],number:[],var:[]},i=[];let a=0;const s=t.replace(v2,o=>(mt.test(o)?(n.color.push(a),i.push(Ly),r.push(mt.parse(o))):o.startsWith(g2)?(n.var.push(a),i.push(m2),r.push(o)):(n.number.push(a),i.push(ky),r.push(parseFloat(o))),++a,zm)).split(zm);return{values:r,split:s,indexes:n,types:i}}function Ty(e){return jo(e).values}function Ry(e){const{split:t,types:r}=jo(e),n=t.length;return i=>{let a="";for(let l=0;l<n;l++)if(a+=t[l],i[l]!==void 0){const s=r[l];s===ky?a+=co(i[l]):s===Ly?a+=mt.transform(i[l]):a+=i[l]}return a}}const _2=e=>typeof e=="number"?0:mt.test(e)?mt.getAnimatableNone(e):e;function y2(e){const t=Ty(e);return Ry(e)(t.map(_2))}const Kn={test:p2,parse:Ty,createTransformer:Ry,getAnimatableNone:y2};function ru(e,t,r){return r<0&&(r+=1),r>1&&(r-=1),r<1/6?e+(t-e)*6*r:r<1/2?t:r<2/3?e+(t-e)*(2/3-r)*6:e}function w2({hue:e,saturation:t,lightness:r,alpha:n}){e/=360,t/=100,r/=100;let i=0,a=0,l=0;if(!t)i=a=l=r;else{const s=r<.5?r*(1+t):r+t-r*t,o=2*r-s;i=ru(o,s,e+1/3),a=ru(o,s,e),l=ru(o,s,e-1/3)}return{red:Math.round(i*255),green:Math.round(a*255),blue:Math.round(l*255),alpha:n}}function Bl(e,t){return r=>r>0?t:e}const lt=(e,t,r)=>e+(t-e)*r,nu=(e,t,r)=>{const n=e*e,i=r*(t*t-n)+n;return i<0?0:Math.sqrt(i)},S2=[Mh,hs,Gs],x2=e=>S2.find(t=>t.test(e));function Um(e){const t=x2(e);if(!t)return!1;let r=t.parse(e);return t===Gs&&(r=w2(r)),r}const Wm=(e,t)=>{const r=Um(e),n=Um(t);if(!r||!n)return Bl(e,t);const i={...r};return a=>(i.red=nu(r.red,n.red,a),i.green=nu(r.green,n.green,a),i.blue=nu(r.blue,n.blue,a),i.alpha=lt(r.alpha,n.alpha,a),hs.transform(i))},Ah=new Set(["none","hidden"]);function b2(e,t){return Ah.has(e)?r=>r<=0?e:t:r=>r>=1?t:e}function C2(e,t){return r=>lt(e,t,r)}function Tf(e){return typeof e=="number"?C2:typeof e=="string"?Ef(e)?Bl:mt.test(e)?Wm:L2:Array.isArray(e)?Dy:typeof e=="object"?mt.test(e)?Wm:E2:Bl}function Dy(e,t){const r=[...e],n=r.length,i=e.map((a,l)=>Tf(a)(a,t[l]));return a=>{for(let l=0;l<n;l++)r[l]=i[l](a);return r}}function E2(e,t){const r={...e,...t},n={};for(const i in r)e[i]!==void 0&&t[i]!==void 0&&(n[i]=Tf(e[i])(e[i],t[i]));return i=>{for(const a in n)r[a]=n[a](i);return r}}function k2(e,t){const r=[],n={color:0,var:0,number:0};for(let i=0;i<t.values.length;i++){const a=t.types[i],l=e.indexes[a][n[a]],s=e.values[l]??0;r[i]=s,n[a]++}return r}const L2=(e,t)=>{const r=Kn.createTransformer(t),n=jo(e),i=jo(t);return n.indexes.var.length===i.indexes.var.length&&n.indexes.color.length===i.indexes.color.length&&n.indexes.number.length>=i.indexes.number.length?Ah.has(e)&&!i.values.length||Ah.has(t)&&!n.values.length?b2(e,t):ta(Dy(k2(n,i),i.values),r):Bl(e,t)};function My(e,t,r){return typeof e=="number"&&typeof t=="number"&&typeof r=="number"?lt(e,t,r):Tf(e)(e,t)}const T2=e=>{const t=({timestamp:r})=>e(r);return{start:(r=!0)=>it.update(t,r),stop:()=>Vn(t),now:()=>Nt.isProcessing?Nt.timestamp:Qt.now()}},Ay=(e,t,r=10)=>{let n="";const i=Math.max(Math.round(t/r),2);for(let a=0;a<i;a++)n+=Math.round(e(a/(i-1))*1e4)/1e4+", ";return`linear(${n.substring(0,n.length-2)})`},Nl=2e4;function Rf(e){let t=0;const r=50;let n=e.next(t);for(;!n.done&&t<Nl;)t+=r,n=e.next(t);return t>=Nl?1/0:t}function R2(e,t=100,r){const n=r({...e,keyframes:[0,t]}),i=Math.min(Rf(n),Nl);return{type:"keyframes",ease:a=>n.next(i*a).value/t,duration:Sr(i)}}const D2=5;function Py(e,t,r){const n=Math.max(t-D2,0);return hy(r-e(n),t-n)}const ht={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1},su=.001;function M2({duration:e=ht.duration,bounce:t=ht.bounce,velocity:r=ht.velocity,mass:n=ht.mass}){let i,a,l=1-t;l=Kr(ht.minDamping,ht.maxDamping,l),e=Kr(ht.minDuration,ht.maxDuration,Sr(e)),l<1?(i=c=>{const f=c*l,u=f*e,p=f-r,_=Ph(c,l),y=Math.exp(-u);return su-p/_*y},a=c=>{const u=c*l*e,p=u*r+r,_=Math.pow(l,2)*Math.pow(c,2)*e,y=Math.exp(-u),v=Ph(Math.pow(c,2),l);return(-i(c)+su>0?-1:1)*((p-_)*y)/v}):(i=c=>{const f=Math.exp(-c*e),u=(c-r)*e+1;return-su+f*u},a=c=>{const f=Math.exp(-c*e),u=(r-c)*(e*e);return f*u});const s=5/e,o=P2(i,a,s);if(e=fn(e),isNaN(o))return{stiffness:ht.stiffness,damping:ht.damping,duration:e};{const c=Math.pow(o,2)*n;return{stiffness:c,damping:l*2*Math.sqrt(n*c),duration:e}}}const A2=12;function P2(e,t,r){let n=r;for(let i=1;i<A2;i++)n=n-e(n)/t(n);return n}function Ph(e,t){return e*Math.sqrt(1-t*t)}const I2=["duration","bounce"],O2=["stiffness","damping","mass"];function Vm(e,t){return t.some(r=>e[r]!==void 0)}function B2(e){let t={velocity:ht.velocity,stiffness:ht.stiffness,damping:ht.damping,mass:ht.mass,isResolvedFromDuration:!1,...e};if(!Vm(e,O2)&&Vm(e,I2))if(e.visualDuration){const r=e.visualDuration,n=2*Math.PI/(r*1.2),i=n*n,a=2*Kr(.05,1,1-(e.bounce||0))*Math.sqrt(i);t={...t,mass:ht.mass,stiffness:i,damping:a}}else{const r=M2(e);t={...t,...r,mass:ht.mass},t.isResolvedFromDuration=!0}return t}function jl(e=ht.visualDuration,t=ht.bounce){const r=typeof e!="object"?{visualDuration:e,keyframes:[0,1],bounce:t}:e;let{restSpeed:n,restDelta:i}=r;const a=r.keyframes[0],l=r.keyframes[r.keyframes.length-1],s={done:!1,value:a},{stiffness:o,damping:c,mass:f,duration:u,velocity:p,isResolvedFromDuration:_}=B2({...r,velocity:-Sr(r.velocity||0)}),y=p||0,v=c/(2*Math.sqrt(o*f)),h=l-a,m=Sr(Math.sqrt(o/f)),d=Math.abs(h)<5;n||(n=d?ht.restSpeed.granular:ht.restSpeed.default),i||(i=d?ht.restDelta.granular:ht.restDelta.default);let g;if(v<1){const b=Ph(m,v);g=x=>{const C=Math.exp(-v*m*x);return l-C*((y+v*m*h)/b*Math.sin(b*x)+h*Math.cos(b*x))}}else if(v===1)g=b=>l-Math.exp(-m*b)*(h+(y+m*h)*b);else{const b=m*Math.sqrt(v*v-1);g=x=>{const C=Math.exp(-v*m*x),S=Math.min(b*x,300);return l-C*((y+v*m*h)*Math.sinh(S)+b*h*Math.cosh(S))/b}}const w={calculatedDuration:_&&u||null,next:b=>{const x=g(b);if(_)s.done=b>=u;else{let C=b===0?y:0;v<1&&(C=b===0?fn(y):Py(g,b,x));const S=Math.abs(C)<=n,k=Math.abs(l-x)<=i;s.done=S&&k}return s.value=s.done?l:x,s},toString:()=>{const b=Math.min(Rf(w),Nl),x=Ay(C=>w.next(b*C).value,b,30);return b+"ms "+x},toTransition:()=>{}};return w}jl.applyToOptions=e=>{const t=R2(e,100,jl);return e.ease=t.ease,e.duration=fn(t.duration),e.type="keyframes",e};function Ih({keyframes:e,velocity:t=0,power:r=.8,timeConstant:n=325,bounceDamping:i=10,bounceStiffness:a=500,modifyTarget:l,min:s,max:o,restDelta:c=.5,restSpeed:f}){const u=e[0],p={done:!1,value:u},_=S=>s!==void 0&&S<s||o!==void 0&&S>o,y=S=>s===void 0?o:o===void 0||Math.abs(s-S)<Math.abs(o-S)?s:o;let v=r*t;const h=u+v,m=l===void 0?h:l(h);m!==h&&(v=m-u);const d=S=>-v*Math.exp(-S/n),g=S=>m+d(S),w=S=>{const k=d(S),L=g(S);p.done=Math.abs(k)<=c,p.value=p.done?m:L};let b,x;const C=S=>{_(p.value)&&(b=S,x=jl({keyframes:[p.value,y(p.value)],velocity:Py(g,S,p.value),damping:i,stiffness:a,restDelta:c,restSpeed:f}))};return C(0),{calculatedDuration:null,next:S=>{let k=!1;return!x&&b===void 0&&(k=!0,w(S),C(S)),b!==void 0&&S>=b?x.next(S-b):(!k&&w(S),p)}}}function N2(e,t,r){const n=[],i=r||_n.mix||My,a=e.length-1;for(let l=0;l<a;l++){let s=i(e[l],e[l+1]);if(t){const o=Array.isArray(t)?t[l]||br:t;s=ta(o,s)}n.push(s)}return n}function j2(e,t,{clamp:r=!0,ease:n,mixer:i}={}){const a=e.length;if(wf(a===t.length),a===1)return()=>t[0];if(a===2&&t[0]===t[1])return()=>t[1];const l=e[0]===e[1];e[0]>e[a-1]&&(e=[...e].reverse(),t=[...t].reverse());const s=N2(t,n,i),o=s.length,c=f=>{if(l&&f<e[0])return t[0];let u=0;if(o>1)for(;u<e.length-2&&!(f<e[u+1]);u++);const p=Bo(e[u],e[u+1],f);return s[u](p)};return r?f=>c(Kr(e[0],e[a-1],f)):c}function F2(e,t){const r=e[e.length-1];for(let n=1;n<=t;n++){const i=Bo(0,t,n);e.push(lt(r,1,i))}}function H2(e){const t=[0];return F2(t,e.length-1),t}function $2(e,t){return e.map(r=>r*t)}function z2(e,t){return e.map(()=>t||wy).splice(0,e.length-1)}function uo({duration:e=300,keyframes:t,times:r,ease:n="easeInOut"}){const i=ZC(n)?n.map(Fm):Fm(n),a={done:!1,value:t[0]},l=$2(r&&r.length===t.length?r:H2(t),e),s=j2(l,t,{ease:Array.isArray(i)?i:z2(t,i)});return{calculatedDuration:e,next:o=>(a.value=s(o),a.done=o>=e,a)}}const U2=e=>e!==null;function Df(e,{repeat:t,repeatType:r="loop"},n,i=1){const a=e.filter(U2),s=i<0||t&&r!=="loop"&&t%2===1?0:a.length-1;return!s||n===void 0?a[s]:n}const W2={decay:Ih,inertia:Ih,tween:uo,keyframes:uo,spring:jl};function Iy(e){typeof e.type=="string"&&(e.type=W2[e.type])}class Mf{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(t=>{this.resolve=t})}notifyFinished(){this.resolve()}then(t,r){return this.finished.then(t,r)}}const V2=e=>e/100;class Af extends Mf{constructor(t){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.stop=()=>{var n,i;const{motionValue:r}=this.options;r&&r.updatedAt!==Qt.now()&&this.tick(Qt.now()),this.isStopped=!0,this.state!=="idle"&&(this.teardown(),(i=(n=this.options).onStop)==null||i.call(n))},this.options=t,this.initAnimation(),this.play(),t.autoplay===!1&&this.pause()}initAnimation(){const{options:t}=this;Iy(t);const{type:r=uo,repeat:n=0,repeatDelay:i=0,repeatType:a,velocity:l=0}=t;let{keyframes:s}=t;const o=r||uo;o!==uo&&typeof s[0]!="number"&&(this.mixKeyframes=ta(V2,My(s[0],s[1])),s=[0,100]);const c=o({...t,keyframes:s});a==="mirror"&&(this.mirroredGenerator=o({...t,keyframes:[...s].reverse(),velocity:-l})),c.calculatedDuration===null&&(c.calculatedDuration=Rf(c));const{calculatedDuration:f}=c;this.calculatedDuration=f,this.resolvedDuration=f+i,this.totalDuration=this.resolvedDuration*(n+1)-i,this.generator=c}updateTime(t){const r=Math.round(t-this.startTime)*this.playbackSpeed;this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=r}tick(t,r=!1){const{generator:n,totalDuration:i,mixKeyframes:a,mirroredGenerator:l,resolvedDuration:s,calculatedDuration:o}=this;if(this.startTime===null)return n.next(0);const{delay:c=0,keyframes:f,repeat:u,repeatType:p,repeatDelay:_,type:y,onUpdate:v,finalKeyframe:h}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-i/this.speed,this.startTime)),r?this.currentTime=t:this.updateTime(t);const m=this.currentTime-c*(this.playbackSpeed>=0?1:-1),d=this.playbackSpeed>=0?m<0:m>i;this.currentTime=Math.max(m,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=i);let g=this.currentTime,w=n;if(u){const S=Math.min(this.currentTime,i)/s;let k=Math.floor(S),L=S%1;!L&&S>=1&&(L=1),L===1&&k--,k=Math.min(k,u+1),!!(k%2)&&(p==="reverse"?(L=1-L,_&&(L-=_/s)):p==="mirror"&&(w=l)),g=Kr(0,1,L)*s}const b=d?{done:!1,value:f[0]}:w.next(g);a&&(b.value=a(b.value));let{done:x}=b;!d&&o!==null&&(x=this.playbackSpeed>=0?this.currentTime>=i:this.currentTime<=0);const C=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&x);return C&&y!==Ih&&(b.value=Df(f,this.options,h,this.speed)),v&&v(b.value),C&&this.finish(),b}then(t,r){return this.finished.then(t,r)}get duration(){return Sr(this.calculatedDuration)}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+Sr(t)}get time(){return Sr(this.currentTime)}set time(t){var r;t=fn(t),this.currentTime=t,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.playbackSpeed),(r=this.driver)==null||r.start(!1)}get speed(){return this.playbackSpeed}set speed(t){this.updateTime(Qt.now());const r=this.playbackSpeed!==t;this.playbackSpeed=t,r&&(this.time=Sr(this.currentTime))}play(){var i,a;if(this.isStopped)return;const{driver:t=T2,startTime:r}=this.options;this.driver||(this.driver=t(l=>this.tick(l))),(a=(i=this.options).onPlay)==null||a.call(i);const n=this.driver.now();this.state==="finished"?(this.updateFinished(),this.startTime=n):this.holdTime!==null?this.startTime=n-this.holdTime:this.startTime||(this.startTime=r??n),this.state==="finished"&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(Qt.now()),this.holdTime=this.currentTime}complete(){this.state!=="running"&&this.play(),this.state="finished",this.holdTime=null}finish(){var t,r;this.notifyFinished(),this.teardown(),this.state="finished",(r=(t=this.options).onComplete)==null||r.call(t)}cancel(){var t,r;this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),(r=(t=this.options).onCancel)==null||r.call(t)}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}attachTimeline(t){var r;return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),(r=this.driver)==null||r.stop(),t.observe(this)}}function K2(e){for(let t=1;t<e.length;t++)e[t]??(e[t]=e[t-1])}const ds=e=>e*180/Math.PI,Oh=e=>{const t=ds(Math.atan2(e[1],e[0]));return Bh(t)},G2={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:Oh,rotateZ:Oh,skewX:e=>ds(Math.atan(e[1])),skewY:e=>ds(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},Bh=e=>(e=e%360,e<0&&(e+=360),e),Km=Oh,Gm=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),qm=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),q2={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:Gm,scaleY:qm,scale:e=>(Gm(e)+qm(e))/2,rotateX:e=>Bh(ds(Math.atan2(e[6],e[5]))),rotateY:e=>Bh(ds(Math.atan2(-e[2],e[0]))),rotateZ:Km,rotate:Km,skewX:e=>ds(Math.atan(e[4])),skewY:e=>ds(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function Nh(e){return e.includes("scale")?1:0}function jh(e,t){if(!e||e==="none")return Nh(t);const r=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let n,i;if(r)n=q2,i=r;else{const s=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);n=G2,i=s}if(!i)return Nh(t);const a=n[t],l=i[1].split(",").map(Y2);return typeof a=="function"?a(l):l[a]}const X2=(e,t)=>{const{transform:r="none"}=getComputedStyle(e);return jh(r,t)};function Y2(e){return parseFloat(e.trim())}const Ci=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Ei=new Set(Ci),Xm=e=>e===bi||e===we,J2=new Set(["x","y","z"]),Q2=Ci.filter(e=>!J2.has(e));function Z2(e){const t=[];return Q2.forEach(r=>{const n=e.getValue(r);n!==void 0&&(t.push([r,n.get()]),n.set(r.startsWith("scale")?1:0))}),t}const In={width:({x:e},{paddingLeft:t="0",paddingRight:r="0"})=>e.max-e.min-parseFloat(t)-parseFloat(r),height:({y:e},{paddingTop:t="0",paddingBottom:r="0"})=>e.max-e.min-parseFloat(t)-parseFloat(r),top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:(e,{transform:t})=>jh(t,"x"),y:(e,{transform:t})=>jh(t,"y")};In.translateX=In.x;In.translateY=In.y;const vs=new Set;let Fh=!1,Hh=!1,$h=!1;function Oy(){if(Hh){const e=Array.from(vs).filter(n=>n.needsMeasurement),t=new Set(e.map(n=>n.element)),r=new Map;t.forEach(n=>{const i=Z2(n);i.length&&(r.set(n,i),n.render())}),e.forEach(n=>n.measureInitialState()),t.forEach(n=>{n.render();const i=r.get(n);i&&i.forEach(([a,l])=>{var s;(s=n.getValue(a))==null||s.set(l)})}),e.forEach(n=>n.measureEndState()),e.forEach(n=>{n.suspendedScrollY!==void 0&&window.scrollTo(0,n.suspendedScrollY)})}Hh=!1,Fh=!1,vs.forEach(e=>e.complete($h)),vs.clear()}function By(){vs.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(Hh=!0)})}function e5(){$h=!0,By(),Oy(),$h=!1}class Pf{constructor(t,r,n,i,a,l=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...t],this.onComplete=r,this.name=n,this.motionValue=i,this.element=a,this.isAsync=l}scheduleResolve(){this.state="scheduled",this.isAsync?(vs.add(this),Fh||(Fh=!0,it.read(By),it.resolveKeyframes(Oy))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:r,element:n,motionValue:i}=this;if(t[0]===null){const a=i==null?void 0:i.get(),l=t[t.length-1];if(a!==void 0)t[0]=a;else if(n&&r){const s=n.readValue(r,l);s!=null&&(t[0]=s)}t[0]===void 0&&(t[0]=l),i&&a===void 0&&i.set(t[0])}K2(t)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(t=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,t),vs.delete(this)}cancel(){this.state==="scheduled"&&(vs.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const t5=e=>e.startsWith("--");function r5(e,t,r){t5(t)?e.style.setProperty(t,r):e.style[t]=r}const n5=Sf(()=>window.ScrollTimeline!==void 0),s5={};function i5(e,t){const r=Sf(e);return()=>s5[t]??r()}const Ny=i5(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),Xi=([e,t,r,n])=>`cubic-bezier(${e}, ${t}, ${r}, ${n})`,Ym={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Xi([0,.65,.55,1]),circOut:Xi([.55,0,1,.45]),backIn:Xi([.31,.01,.66,-.59]),backOut:Xi([.33,1.53,.69,.99])};function jy(e,t){if(e)return typeof e=="function"?Ny()?Ay(e,t):"ease-out":Sy(e)?Xi(e):Array.isArray(e)?e.map(r=>jy(r,t)||Ym.easeOut):Ym[e]}function o5(e,t,r,{delay:n=0,duration:i=300,repeat:a=0,repeatType:l="loop",ease:s="easeOut",times:o}={},c=void 0){const f={[t]:r};o&&(f.offset=o);const u=jy(s,i);Array.isArray(u)&&(f.easing=u);const p={delay:n,duration:i,easing:Array.isArray(u)?"linear":u,fill:"both",iterations:a+1,direction:l==="reverse"?"alternate":"normal"};return c&&(p.pseudoElement=c),e.animate(f,p)}function Fy(e){return typeof e=="function"&&"applyToOptions"in e}function a5({type:e,...t}){return Fy(e)&&Ny()?e.applyToOptions(t):(t.duration??(t.duration=300),t.ease??(t.ease="easeOut"),t)}class l5 extends Mf{constructor(t){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!t)return;const{element:r,name:n,keyframes:i,pseudoElement:a,allowFlatten:l=!1,finalKeyframe:s,onComplete:o}=t;this.isPseudoElement=!!a,this.allowFlatten=l,this.options=t,wf(typeof t.type!="string");const c=a5(t);this.animation=o5(r,n,i,c,a),c.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!a){const f=Df(i,this.options,s,this.speed);this.updateMotionValue?this.updateMotionValue(f):r5(r,n,f),this.animation.cancel()}o==null||o(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),this.state==="finished"&&this.updateFinished())}pause(){this.animation.pause()}complete(){var t,r;(r=(t=this.animation).finish)==null||r.call(t)}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:t}=this;t==="idle"||t==="finished"||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){var t,r;this.isPseudoElement||(r=(t=this.animation).commitStyles)==null||r.call(t)}get duration(){var r,n;const t=((n=(r=this.animation.effect)==null?void 0:r.getComputedTiming)==null?void 0:n.call(r).duration)||0;return Sr(Number(t))}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+Sr(t)}get time(){return Sr(Number(this.animation.currentTime)||0)}set time(t){this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=fn(t)}get speed(){return this.animation.playbackRate}set speed(t){t<0&&(this.finishedTime=null),this.animation.playbackRate=t}get state(){return this.finishedTime!==null?"finished":this.animation.playState}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(t){this.manualStartTime=this.animation.startTime=t}attachTimeline({timeline:t,observe:r}){var n;return this.allowFlatten&&((n=this.animation.effect)==null||n.updateTiming({easing:"linear"})),this.animation.onfinish=null,t&&n5()?(this.animation.timeline=t,br):r(this)}}const Hy={anticipate:vy,backInOut:gy,circInOut:yy};function c5(e){return e in Hy}function u5(e){typeof e.ease=="string"&&c5(e.ease)&&(e.ease=Hy[e.ease])}const iu=10;class h5 extends l5{constructor(t){u5(t),Iy(t),super(t),t.startTime!==void 0&&(this.startTime=t.startTime),this.options=t}updateMotionValue(t){const{motionValue:r,onUpdate:n,onComplete:i,element:a,...l}=this.options;if(!r)return;if(t!==void 0){r.set(t);return}const s=new Af({...l,autoplay:!1}),o=Math.max(iu,Qt.now()-this.startTime),c=Kr(0,iu,o-iu);r.setWithVelocity(s.sample(Math.max(0,o-c)).value,s.sample(o).value,c),s.stop()}}const Jm=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(Kn.test(e)||e==="0")&&!e.startsWith("url("));function d5(e){const t=e[0];if(e.length===1)return!0;for(let r=0;r<e.length;r++)if(e[r]!==t)return!0}function f5(e,t,r,n){const i=e[0];if(i===null)return!1;if(t==="display"||t==="visibility")return!0;const a=e[e.length-1],l=Jm(i,t),s=Jm(a,t);return!l||!s?!1:d5(e)||(r==="spring"||Fy(r))&&n}function zh(e){e.duration=0,e.type="keyframes"}const p5=new Set(["opacity","clipPath","filter","transform"]),m5=Sf(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function g5(e){var f;const{motionValue:t,name:r,repeatDelay:n,repeatType:i,damping:a,type:l}=e;if(!(((f=t==null?void 0:t.owner)==null?void 0:f.current)instanceof HTMLElement))return!1;const{onUpdate:o,transformTemplate:c}=t.owner.getProps();return m5()&&r&&p5.has(r)&&(r!=="transform"||!c)&&!o&&!n&&i!=="mirror"&&a!==0&&l!=="inertia"}const v5=40;class _5 extends Mf{constructor({autoplay:t=!0,delay:r=0,type:n="keyframes",repeat:i=0,repeatDelay:a=0,repeatType:l="loop",keyframes:s,name:o,motionValue:c,element:f,...u}){var y;super(),this.stop=()=>{var v,h;this._animation&&(this._animation.stop(),(v=this.stopTimeline)==null||v.call(this)),(h=this.keyframeResolver)==null||h.cancel()},this.createdAt=Qt.now();const p={autoplay:t,delay:r,type:n,repeat:i,repeatDelay:a,repeatType:l,name:o,motionValue:c,element:f,...u},_=(f==null?void 0:f.KeyframeResolver)||Pf;this.keyframeResolver=new _(s,(v,h,m)=>this.onKeyframesResolved(v,h,p,!m),o,c,f),(y=this.keyframeResolver)==null||y.scheduleResolve()}onKeyframesResolved(t,r,n,i){this.keyframeResolver=void 0;const{name:a,type:l,velocity:s,delay:o,isHandoff:c,onUpdate:f}=n;this.resolvedAt=Qt.now(),f5(t,a,l,s)||((_n.instantAnimations||!o)&&(f==null||f(Df(t,n,r))),t[0]=t[t.length-1],zh(n),n.repeat=0);const p={startTime:i?this.resolvedAt?this.resolvedAt-this.createdAt>v5?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:r,...n,keyframes:t},_=!c&&g5(p)?new h5({...p,element:p.motionValue.owner.current}):new Af(p);_.finished.then(()=>this.notifyFinished()).catch(br),this.pendingTimeline&&(this.stopTimeline=_.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=_}get finished(){return this._animation?this.animation.finished:this._finished}then(t,r){return this.finished.finally(t).then(()=>{})}get animation(){var t;return this._animation||((t=this.keyframeResolver)==null||t.resume(),e5()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(t){this.animation.time=t}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(t){this.animation.speed=t}get startTime(){return this.animation.startTime}attachTimeline(t){return this._animation?this.stopTimeline=this.animation.attachTimeline(t):this.pendingTimeline=t,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){var t;this._animation&&this.animation.cancel(),(t=this.keyframeResolver)==null||t.cancel()}}const y5=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function w5(e){const t=y5.exec(e);if(!t)return[,];const[,r,n,i]=t;return[`--${r??n}`,i]}function $y(e,t,r=1){const[n,i]=w5(e);if(!n)return;const a=window.getComputedStyle(t).getPropertyValue(n);if(a){const l=a.trim();return ly(l)?parseFloat(l):l}return Ef(i)?$y(i,t,r+1):i}function If(e,t){return(e==null?void 0:e[t])??(e==null?void 0:e.default)??e}const zy=new Set(["width","height","top","left","right","bottom",...Ci]),S5={test:e=>e==="auto",parse:e=>e},Uy=e=>t=>t.test(e),Wy=[bi,we,Vr,kn,d2,h2,S5],Qm=e=>Wy.find(Uy(e));function x5(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||uy(e):!0}const b5=new Set(["brightness","contrast","saturate","opacity"]);function C5(e){const[t,r]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[n]=r.match(kf)||[];if(!n)return e;const i=r.replace(n,"");let a=b5.has(t)?1:0;return n!==r&&(a*=100),t+"("+a+i+")"}const E5=/\b([a-z-]*)\(.*?\)/gu,Uh={...Kn,getAnimatableNone:e=>{const t=e.match(E5);return t?t.map(C5).join(" "):e}},Zm={...bi,transform:Math.round},k5={rotate:kn,rotateX:kn,rotateY:kn,rotateZ:kn,scale:Ra,scaleX:Ra,scaleY:Ra,scaleZ:Ra,skew:kn,skewX:kn,skewY:kn,distance:we,translateX:we,translateY:we,translateZ:we,x:we,y:we,z:we,perspective:we,transformPerspective:we,opacity:No,originX:$m,originY:$m,originZ:we},Of={borderWidth:we,borderTopWidth:we,borderRightWidth:we,borderBottomWidth:we,borderLeftWidth:we,borderRadius:we,radius:we,borderTopLeftRadius:we,borderTopRightRadius:we,borderBottomRightRadius:we,borderBottomLeftRadius:we,width:we,maxWidth:we,height:we,maxHeight:we,top:we,right:we,bottom:we,left:we,inset:we,insetBlock:we,insetBlockStart:we,insetBlockEnd:we,insetInline:we,insetInlineStart:we,insetInlineEnd:we,padding:we,paddingTop:we,paddingRight:we,paddingBottom:we,paddingLeft:we,paddingBlock:we,paddingBlockStart:we,paddingBlockEnd:we,paddingInline:we,paddingInlineStart:we,paddingInlineEnd:we,margin:we,marginTop:we,marginRight:we,marginBottom:we,marginLeft:we,marginBlock:we,marginBlockStart:we,marginBlockEnd:we,marginInline:we,marginInlineStart:we,marginInlineEnd:we,backgroundPositionX:we,backgroundPositionY:we,...k5,zIndex:Zm,fillOpacity:No,strokeOpacity:No,numOctaves:Zm},L5={...Of,color:mt,backgroundColor:mt,outlineColor:mt,fill:mt,stroke:mt,borderColor:mt,borderTopColor:mt,borderRightColor:mt,borderBottomColor:mt,borderLeftColor:mt,filter:Uh,WebkitFilter:Uh},Vy=e=>L5[e];function Ky(e,t){let r=Vy(e);return r!==Uh&&(r=Kn),r.getAnimatableNone?r.getAnimatableNone(t):void 0}const T5=new Set(["auto","none","0"]);function R5(e,t,r){let n=0,i;for(;n<e.length&&!i;){const a=e[n];typeof a=="string"&&!T5.has(a)&&jo(a).values.length&&(i=e[n]),n++}if(i&&r)for(const a of t)e[a]=Ky(r,i)}class D5 extends Pf{constructor(t,r,n,i,a){super(t,r,n,i,a,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:r,name:n}=this;if(!r||!r.current)return;super.readKeyframes();for(let f=0;f<t.length;f++){let u=t[f];if(typeof u=="string"&&(u=u.trim(),Ef(u))){const p=$y(u,r.current);p!==void 0&&(t[f]=p),f===t.length-1&&(this.finalKeyframe=u)}}if(this.resolveNoneKeyframes(),!zy.has(n)||t.length!==2)return;const[i,a]=t,l=Qm(i),s=Qm(a),o=Hm(i),c=Hm(a);if(o!==c&&In[n]){this.needsMeasurement=!0;return}if(l!==s)if(Xm(l)&&Xm(s))for(let f=0;f<t.length;f++){const u=t[f];typeof u=="string"&&(t[f]=parseFloat(u))}else In[n]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:r}=this,n=[];for(let i=0;i<t.length;i++)(t[i]===null||x5(t[i]))&&n.push(i);n.length&&R5(t,n,r)}measureInitialState(){const{element:t,unresolvedKeyframes:r,name:n}=this;if(!t||!t.current)return;n==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=In[n](t.measureViewportBox(),window.getComputedStyle(t.current)),r[0]=this.measuredOrigin;const i=r[r.length-1];i!==void 0&&t.getValue(n,i).jump(i,!1)}measureEndState(){var s;const{element:t,name:r,unresolvedKeyframes:n}=this;if(!t||!t.current)return;const i=t.getValue(r);i&&i.jump(this.measuredOrigin,!1);const a=n.length-1,l=n[a];n[a]=In[r](t.measureViewportBox(),window.getComputedStyle(t.current)),l!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=l),(s=this.removedTransforms)!=null&&s.length&&this.removedTransforms.forEach(([o,c])=>{t.getValue(o).set(c)}),this.resolveNoneKeyframes()}}function M5(e,t,r){if(e instanceof EventTarget)return[e];if(typeof e=="string"){let n=document;const i=(r==null?void 0:r[e])??n.querySelectorAll(e);return i?Array.from(i):[]}return Array.from(e)}const Gy=(e,t)=>t&&typeof e=="number"?t.transform(e):e;function qy(e){return cy(e)&&"offsetHeight"in e}const eg=30,A5=e=>!isNaN(parseFloat(e));class P5{constructor(t,r={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=n=>{var a;const i=Qt.now();if(this.updatedAt!==i&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(n),this.current!==this.prev&&((a=this.events.change)==null||a.notify(this.current),this.dependents))for(const l of this.dependents)l.dirty()},this.hasAnimated=!1,this.setCurrent(t),this.owner=r.owner}setCurrent(t){this.current=t,this.updatedAt=Qt.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=A5(this.current))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return this.on("change",t)}on(t,r){this.events[t]||(this.events[t]=new xf);const n=this.events[t].add(r);return t==="change"?()=>{n(),it.read(()=>{this.events.change.getSize()||this.stop()})}:n}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,r){this.passiveEffect=t,this.stopPassiveEffect=r}set(t){this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t)}setWithVelocity(t,r,n){this.set(r),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-n}jump(t,r=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,r&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){var t;(t=this.events.change)==null||t.notify(this.current)}addDependent(t){this.dependents||(this.dependents=new Set),this.dependents.add(t)}removeDependent(t){this.dependents&&this.dependents.delete(t)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const t=Qt.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>eg)return 0;const r=Math.min(this.updatedAt-this.prevUpdatedAt,eg);return hy(parseFloat(this.current)-parseFloat(this.prevFrameValue),r)}start(t){return this.stop(),new Promise(r=>{this.hasAnimated=!0,this.animation=t(r),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){var t,r;(t=this.dependents)==null||t.clear(),(r=this.events.destroy)==null||r.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function gi(e,t){return new P5(e,t)}const{schedule:Bf}=xy(queueMicrotask,!1),Rr={x:!1,y:!1};function Xy(){return Rr.x||Rr.y}function I5(e){return e==="x"||e==="y"?Rr[e]?null:(Rr[e]=!0,()=>{Rr[e]=!1}):Rr.x||Rr.y?null:(Rr.x=Rr.y=!0,()=>{Rr.x=Rr.y=!1})}function Yy(e,t){const r=M5(e),n=new AbortController,i={passive:!0,...t,signal:n.signal};return[r,i,()=>n.abort()]}function tg(e){return!(e.pointerType==="touch"||Xy())}function O5(e,t,r={}){const[n,i,a]=Yy(e,r),l=s=>{if(!tg(s))return;const{target:o}=s,c=t(o,s);if(typeof c!="function"||!o)return;const f=u=>{tg(u)&&(c(u),o.removeEventListener("pointerleave",f))};o.addEventListener("pointerleave",f,i)};return n.forEach(s=>{s.addEventListener("pointerenter",l,i)}),a}const Jy=(e,t)=>t?e===t?!0:Jy(e,t.parentElement):!1,Nf=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1,B5=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function Qy(e){return B5.has(e.tagName)||e.isContentEditable===!0}const nl=new WeakSet;function rg(e){return t=>{t.key==="Enter"&&e(t)}}function ou(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const N5=(e,t)=>{const r=e.currentTarget;if(!r)return;const n=rg(()=>{if(nl.has(r))return;ou(r,"down");const i=rg(()=>{ou(r,"up")}),a=()=>ou(r,"cancel");r.addEventListener("keyup",i,t),r.addEventListener("blur",a,t)});r.addEventListener("keydown",n,t),r.addEventListener("blur",()=>r.removeEventListener("keydown",n),t)};function ng(e){return Nf(e)&&!Xy()}function j5(e,t,r={}){const[n,i,a]=Yy(e,r),l=s=>{const o=s.currentTarget;if(!ng(s))return;nl.add(o);const c=t(o,s),f=(_,y)=>{window.removeEventListener("pointerup",u),window.removeEventListener("pointercancel",p),nl.has(o)&&nl.delete(o),ng(_)&&typeof c=="function"&&c(_,{success:y})},u=_=>{f(_,o===window||o===document||r.useGlobalTarget||Jy(o,_.target))},p=_=>{f(_,!1)};window.addEventListener("pointerup",u,i),window.addEventListener("pointercancel",p,i)};return n.forEach(s=>{(r.useGlobalTarget?window:s).addEventListener("pointerdown",l,i),qy(s)&&(s.addEventListener("focus",c=>N5(c,i)),!Qy(s)&&!s.hasAttribute("tabindex")&&(s.tabIndex=0))}),a}function Zy(e){return cy(e)&&"ownerSVGElement"in e}function F5(e){return Zy(e)&&e.tagName==="svg"}const Gt=e=>!!(e&&e.getVelocity),H5=[...Wy,mt,Kn],$5=e=>H5.find(Uy(e)),jf=E.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});function sg(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function z5(...e){return t=>{let r=!1;const n=e.map(i=>{const a=sg(i,t);return!r&&typeof a=="function"&&(r=!0),a});if(r)return()=>{for(let i=0;i<n.length;i++){const a=n[i];typeof a=="function"?a():sg(e[i],null)}}}}function U5(...e){return E.useCallback(z5(...e),e)}class W5 extends E.Component{getSnapshotBeforeUpdate(t){const r=this.props.childRef.current;if(r&&t.isPresent&&!this.props.isPresent){const n=r.offsetParent,i=qy(n)&&n.offsetWidth||0,a=this.props.sizeRef.current;a.height=r.offsetHeight||0,a.width=r.offsetWidth||0,a.top=r.offsetTop,a.left=r.offsetLeft,a.right=i-a.width-a.left}return null}componentDidUpdate(){}render(){return this.props.children}}function V5({children:e,isPresent:t,anchorX:r,root:n}){var f;const i=E.useId(),a=E.useRef(null),l=E.useRef({width:0,height:0,top:0,left:0,right:0}),{nonce:s}=E.useContext(jf),o=((f=e.props)==null?void 0:f.ref)??(e==null?void 0:e.ref),c=U5(a,o);return E.useInsertionEffect(()=>{const{width:u,height:p,top:_,left:y,right:v}=l.current;if(t||!a.current||!u||!p)return;const h=r==="left"?`left: ${y}`:`right: ${v}`;a.current.dataset.motionPopId=i;const m=document.createElement("style");s&&(m.nonce=s);const d=n??document.head;return d.appendChild(m),m.sheet&&m.sheet.insertRule(`
|
|
40
|
+
`+a.stack}return{value:e,source:t,stack:i,digest:null}}function Yc(e,t,r){return{value:e,source:null,stack:r??null,digest:t??null}}function fh(e,t){try{console.error(t.value)}catch(r){setTimeout(function(){throw r})}}var Lb=typeof WeakMap=="function"?WeakMap:Map;function k0(e,t,r){r=dn(-1,r),r.tag=3,r.payload={element:null};var n=t.value;return r.callback=function(){Ml||(Ml=!0,bh=n),fh(e,t)},r}function L0(e,t,r){r=dn(-1,r),r.tag=3;var n=e.type.getDerivedStateFromError;if(typeof n=="function"){var i=t.value;r.payload=function(){return n(i)},r.callback=function(){fh(e,t)}}var a=e.stateNode;return a!==null&&typeof a.componentDidCatch=="function"&&(r.callback=function(){fh(e,t),typeof n!="function"&&(Hn===null?Hn=new Set([this]):Hn.add(this));var l=t.stack;this.componentDidCatch(t.value,{componentStack:l!==null?l:""})}),r}function gm(e,t,r){var n=e.pingCache;if(n===null){n=e.pingCache=new Lb;var i=new Set;n.set(t,i)}else i=n.get(t),i===void 0&&(i=new Set,n.set(t,i));i.has(r)||(i.add(r),e=$b.bind(null,e,t,r),t.then(e,e))}function vm(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 _m(e,t,r,n,i){return e.mode&1?(e.flags|=65536,e.lanes=i,e):(e===t?e.flags|=65536:(e.flags|=128,r.flags|=131072,r.flags&=-52805,r.tag===1&&(r.alternate===null?r.tag=17:(t=dn(-1,1),t.tag=2,Fn(r,t,1))),r.lanes|=1),e)}var Tb=yn.ReactCurrentOwner,sr=!1;function Jt(e,t,r,n){t.child=e===null?r0(t,null,r,n):di(t,e.child,r,n)}function ym(e,t,r,n,i){r=r.render;var a=t.ref;return ri(t,i),n=Xd(e,t,r,n,a,i),r=Yd(),e!==null&&!sr?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,vn(e,t,i)):(ot&&r&&Nd(t),t.flags|=1,Jt(e,t,n,i),t.child)}function wm(e,t,r,n,i){if(e===null){var a=r.type;return typeof a=="function"&&!af(a)&&a.defaultProps===void 0&&r.compare===null&&r.defaultProps===void 0?(t.tag=15,t.type=a,T0(e,t,a,n,i)):(e=tl(r.type,null,n,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,!(e.lanes&i)){var l=a.memoizedProps;if(r=r.compare,r=r!==null?r:ko,r(l,n)&&e.ref===t.ref)return vn(e,t,i)}return t.flags|=1,e=zn(a,n),e.ref=t.ref,e.return=t,t.child=e}function T0(e,t,r,n,i){if(e!==null){var a=e.memoizedProps;if(ko(a,n)&&e.ref===t.ref)if(sr=!1,t.pendingProps=n=a,(e.lanes&i)!==0)e.flags&131072&&(sr=!0);else return t.lanes=e.lanes,vn(e,t,i)}return ph(e,t,r,n,i)}function R0(e,t,r){var n=t.pendingProps,i=n.children,a=e!==null?e.memoizedState:null;if(n.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},Ze(Ks,cr),cr|=r;else{if(!(r&1073741824))return e=a!==null?a.baseLanes|r:r,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,Ze(Ks,cr),cr|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},n=a!==null?a.baseLanes:r,Ze(Ks,cr),cr|=n}else a!==null?(n=a.baseLanes|r,t.memoizedState=null):n=r,Ze(Ks,cr),cr|=n;return Jt(e,t,i,r),t.child}function D0(e,t){var r=t.ref;(e===null&&r!==null||e!==null&&e.ref!==r)&&(t.flags|=512,t.flags|=2097152)}function ph(e,t,r,n,i){var a=or(r)?ys:Xt.current;return a=ui(t,a),ri(t,i),r=Xd(e,t,r,n,a,i),n=Yd(),e!==null&&!sr?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,vn(e,t,i)):(ot&&n&&Nd(t),t.flags|=1,Jt(e,t,r,i),t.child)}function Sm(e,t,r,n,i){if(or(r)){var a=!0;Sl(t)}else a=!1;if(ri(t,i),t.stateNode===null)Qa(e,t),E0(t,r,n),dh(t,r,n,i),n=!0;else if(e===null){var l=t.stateNode,s=t.memoizedProps;l.props=s;var o=l.context,c=r.contextType;typeof c=="object"&&c!==null?c=Cr(c):(c=or(r)?ys:Xt.current,c=ui(t,c));var f=r.getDerivedStateFromProps,u=typeof f=="function"||typeof l.getSnapshotBeforeUpdate=="function";u||typeof l.UNSAFE_componentWillReceiveProps!="function"&&typeof l.componentWillReceiveProps!="function"||(s!==n||o!==c)&&mm(t,l,n,c),Tn=!1;var p=t.memoizedState;l.state=p,kl(t,n,l,i),o=t.memoizedState,s!==n||p!==o||ir.current||Tn?(typeof f=="function"&&(hh(t,r,f,n),o=t.memoizedState),(s=Tn||pm(t,r,s,n,p,o,c))?(u||typeof l.UNSAFE_componentWillMount!="function"&&typeof l.componentWillMount!="function"||(typeof l.componentWillMount=="function"&&l.componentWillMount(),typeof l.UNSAFE_componentWillMount=="function"&&l.UNSAFE_componentWillMount()),typeof l.componentDidMount=="function"&&(t.flags|=4194308)):(typeof l.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=n,t.memoizedState=o),l.props=n,l.state=o,l.context=c,n=s):(typeof l.componentDidMount=="function"&&(t.flags|=4194308),n=!1)}else{l=t.stateNode,s0(e,t),s=t.memoizedProps,c=t.type===t.elementType?s:Dr(t.type,s),l.props=c,u=t.pendingProps,p=l.context,o=r.contextType,typeof o=="object"&&o!==null?o=Cr(o):(o=or(r)?ys:Xt.current,o=ui(t,o));var _=r.getDerivedStateFromProps;(f=typeof _=="function"||typeof l.getSnapshotBeforeUpdate=="function")||typeof l.UNSAFE_componentWillReceiveProps!="function"&&typeof l.componentWillReceiveProps!="function"||(s!==u||p!==o)&&mm(t,l,n,o),Tn=!1,p=t.memoizedState,l.state=p,kl(t,n,l,i);var y=t.memoizedState;s!==u||p!==y||ir.current||Tn?(typeof _=="function"&&(hh(t,r,_,n),y=t.memoizedState),(c=Tn||pm(t,r,c,n,p,y,o)||!1)?(f||typeof l.UNSAFE_componentWillUpdate!="function"&&typeof l.componentWillUpdate!="function"||(typeof l.componentWillUpdate=="function"&&l.componentWillUpdate(n,y,o),typeof l.UNSAFE_componentWillUpdate=="function"&&l.UNSAFE_componentWillUpdate(n,y,o)),typeof l.componentDidUpdate=="function"&&(t.flags|=4),typeof l.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof l.componentDidUpdate!="function"||s===e.memoizedProps&&p===e.memoizedState||(t.flags|=4),typeof l.getSnapshotBeforeUpdate!="function"||s===e.memoizedProps&&p===e.memoizedState||(t.flags|=1024),t.memoizedProps=n,t.memoizedState=y),l.props=n,l.state=y,l.context=o,n=c):(typeof l.componentDidUpdate!="function"||s===e.memoizedProps&&p===e.memoizedState||(t.flags|=4),typeof l.getSnapshotBeforeUpdate!="function"||s===e.memoizedProps&&p===e.memoizedState||(t.flags|=1024),n=!1)}return mh(e,t,r,n,a,i)}function mh(e,t,r,n,i,a){D0(e,t);var l=(t.flags&128)!==0;if(!n&&!l)return i&&om(t,r,!1),vn(e,t,a);n=t.stateNode,Tb.current=t;var s=l&&typeof r.getDerivedStateFromError!="function"?null:n.render();return t.flags|=1,e!==null&&l?(t.child=di(t,e.child,null,a),t.child=di(t,null,s,a)):Jt(e,t,s,a),t.memoizedState=n.state,i&&om(t,r,!0),t.child}function M0(e){var t=e.stateNode;t.pendingContext?im(e,t.pendingContext,t.pendingContext!==t.context):t.context&&im(e,t.context,!1),Vd(e,t.containerInfo)}function xm(e,t,r,n,i){return hi(),Fd(i),t.flags|=256,Jt(e,t,r,n),t.child}var gh={dehydrated:null,treeContext:null,retryLane:0};function vh(e){return{baseLanes:e,cachePool:null,transitions:null}}function A0(e,t,r){var n=t.pendingProps,i=at.current,a=!1,l=(t.flags&128)!==0,s;if((s=l)||(s=e!==null&&e.memoizedState===null?!1:(i&2)!==0),s?(a=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(i|=1),Ze(at,i&1),e===null)return ch(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):(l=n.children,e=n.fallback,a?(n=t.mode,a=t.child,l={mode:"hidden",children:l},!(n&1)&&a!==null?(a.childLanes=0,a.pendingProps=l):a=hc(l,n,0,null),e=gs(e,n,r,null),a.return=t,e.return=t,a.sibling=e,t.child=a,t.child.memoizedState=vh(r),t.memoizedState=gh,e):Zd(t,l));if(i=e.memoizedState,i!==null&&(s=i.dehydrated,s!==null))return Rb(e,t,l,n,s,i,r);if(a){a=n.fallback,l=t.mode,i=e.child,s=i.sibling;var o={mode:"hidden",children:n.children};return!(l&1)&&t.child!==i?(n=t.child,n.childLanes=0,n.pendingProps=o,t.deletions=null):(n=zn(i,o),n.subtreeFlags=i.subtreeFlags&14680064),s!==null?a=zn(s,a):(a=gs(a,l,r,null),a.flags|=2),a.return=t,n.return=t,n.sibling=a,t.child=n,n=a,a=t.child,l=e.child.memoizedState,l=l===null?vh(r):{baseLanes:l.baseLanes|r,cachePool:null,transitions:l.transitions},a.memoizedState=l,a.childLanes=e.childLanes&~r,t.memoizedState=gh,n}return a=e.child,e=a.sibling,n=zn(a,{mode:"visible",children:n.children}),!(t.mode&1)&&(n.lanes=r),n.return=t,n.sibling=null,e!==null&&(r=t.deletions,r===null?(t.deletions=[e],t.flags|=16):r.push(e)),t.child=n,t.memoizedState=null,n}function Zd(e,t){return t=hc({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function ba(e,t,r,n){return n!==null&&Fd(n),di(t,e.child,null,r),e=Zd(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Rb(e,t,r,n,i,a,l){if(r)return t.flags&256?(t.flags&=-257,n=Yc(Error(he(422))),ba(e,t,l,n)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(a=n.fallback,i=t.mode,n=hc({mode:"visible",children:n.children},i,0,null),a=gs(a,i,l,null),a.flags|=2,n.return=t,a.return=t,n.sibling=a,t.child=n,t.mode&1&&di(t,e.child,null,l),t.child.memoizedState=vh(l),t.memoizedState=gh,a);if(!(t.mode&1))return ba(e,t,l,null);if(i.data==="$!"){if(n=i.nextSibling&&i.nextSibling.dataset,n)var s=n.dgst;return n=s,a=Error(he(419)),n=Yc(a,n,void 0),ba(e,t,l,n)}if(s=(l&e.childLanes)!==0,sr||s){if(n=Pt,n!==null){switch(l&-l){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&(n.suspendedLanes|l)?0:i,i!==0&&i!==a.retryLane&&(a.retryLane=i,gn(e,i),Br(n,e,i,-1))}return of(),n=Yc(Error(he(421))),ba(e,t,l,n)}return i.data==="$?"?(t.flags|=128,t.child=e.child,t=zb.bind(null,e),i._reactRetry=t,null):(e=a.treeContext,hr=jn(i.nextSibling),dr=t,ot=!0,Pr=null,e!==null&&(_r[yr++]=cn,_r[yr++]=un,_r[yr++]=ws,cn=e.id,un=e.overflow,ws=t),t=Zd(t,n.children),t.flags|=4096,t)}function bm(e,t,r){e.lanes|=t;var n=e.alternate;n!==null&&(n.lanes|=t),uh(e.return,t,r)}function Jc(e,t,r,n,i){var a=e.memoizedState;a===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:n,tail:r,tailMode:i}:(a.isBackwards=t,a.rendering=null,a.renderingStartTime=0,a.last=n,a.tail=r,a.tailMode=i)}function P0(e,t,r){var n=t.pendingProps,i=n.revealOrder,a=n.tail;if(Jt(e,t,n.children,r),n=at.current,n&2)n=n&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&&bm(e,r,t);else if(e.tag===19)bm(e,r,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}n&=1}if(Ze(at,n),!(t.mode&1))t.memoizedState=null;else switch(i){case"forwards":for(r=t.child,i=null;r!==null;)e=r.alternate,e!==null&&Ll(e)===null&&(i=r),r=r.sibling;r=i,r===null?(i=t.child,t.child=null):(i=r.sibling,r.sibling=null),Jc(t,!1,i,r,a);break;case"backwards":for(r=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&Ll(e)===null){t.child=i;break}e=i.sibling,i.sibling=r,r=i,i=e}Jc(t,!0,r,null,a);break;case"together":Jc(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function Qa(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function vn(e,t,r){if(e!==null&&(t.dependencies=e.dependencies),xs|=t.lanes,!(r&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(he(153));if(t.child!==null){for(e=t.child,r=zn(e,e.pendingProps),t.child=r,r.return=t;e.sibling!==null;)e=e.sibling,r=r.sibling=zn(e,e.pendingProps),r.return=t;r.sibling=null}return t.child}function Db(e,t,r){switch(t.tag){case 3:M0(t),hi();break;case 5:i0(t);break;case 1:or(t.type)&&Sl(t);break;case 4:Vd(t,t.stateNode.containerInfo);break;case 10:var n=t.type._context,i=t.memoizedProps.value;Ze(Cl,n._currentValue),n._currentValue=i;break;case 13:if(n=t.memoizedState,n!==null)return n.dehydrated!==null?(Ze(at,at.current&1),t.flags|=128,null):r&t.child.childLanes?A0(e,t,r):(Ze(at,at.current&1),e=vn(e,t,r),e!==null?e.sibling:null);Ze(at,at.current&1);break;case 19:if(n=(r&t.childLanes)!==0,e.flags&128){if(n)return P0(e,t,r);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),Ze(at,at.current),n)break;return null;case 22:case 23:return t.lanes=0,R0(e,t,r)}return vn(e,t,r)}var I0,_h,O0,B0;I0=function(e,t){for(var r=t.child;r!==null;){if(r.tag===5||r.tag===6)e.appendChild(r.stateNode);else if(r.tag!==4&&r.child!==null){r.child.return=r,r=r.child;continue}if(r===t)break;for(;r.sibling===null;){if(r.return===null||r.return===t)return;r=r.return}r.sibling.return=r.return,r=r.sibling}};_h=function(){};O0=function(e,t,r,n){var i=e.memoizedProps;if(i!==n){e=t.stateNode,us(Vr.current);var a=null;switch(r){case"input":i=Hu(e,i),n=Hu(e,n),a=[];break;case"select":i=ut({},i,{value:void 0}),n=ut({},n,{value:void 0}),a=[];break;case"textarea":i=Uu(e,i),n=Uu(e,n),a=[];break;default:typeof i.onClick!="function"&&typeof n.onClick=="function"&&(e.onclick=yl)}Vu(r,n);var l;r=null;for(c in i)if(!n.hasOwnProperty(c)&&i.hasOwnProperty(c)&&i[c]!=null)if(c==="style"){var s=i[c];for(l in s)s.hasOwnProperty(l)&&(r||(r={}),r[l]="")}else c!=="dangerouslySetInnerHTML"&&c!=="children"&&c!=="suppressContentEditableWarning"&&c!=="suppressHydrationWarning"&&c!=="autoFocus"&&(yo.hasOwnProperty(c)?a||(a=[]):(a=a||[]).push(c,null));for(c in n){var o=n[c];if(s=i!=null?i[c]:void 0,n.hasOwnProperty(c)&&o!==s&&(o!=null||s!=null))if(c==="style")if(s){for(l in s)!s.hasOwnProperty(l)||o&&o.hasOwnProperty(l)||(r||(r={}),r[l]="");for(l in o)o.hasOwnProperty(l)&&s[l]!==o[l]&&(r||(r={}),r[l]=o[l])}else r||(a||(a=[]),a.push(c,r)),r=o;else c==="dangerouslySetInnerHTML"?(o=o?o.__html:void 0,s=s?s.__html:void 0,o!=null&&s!==o&&(a=a||[]).push(c,o)):c==="children"?typeof o!="string"&&typeof o!="number"||(a=a||[]).push(c,""+o):c!=="suppressContentEditableWarning"&&c!=="suppressHydrationWarning"&&(yo.hasOwnProperty(c)?(o!=null&&c==="onScroll"&&nt("scroll",e),a||s===o||(a=[])):(a=a||[]).push(c,o))}r&&(a=a||[]).push("style",r);var c=a;(t.updateQueue=c)&&(t.flags|=4)}};B0=function(e,t,r,n){r!==n&&(t.flags|=4)};function ji(e,t){if(!ot)switch(e.tailMode){case"hidden":t=e.tail;for(var r=null;t!==null;)t.alternate!==null&&(r=t),t=t.sibling;r===null?e.tail=null:r.sibling=null;break;case"collapsed":r=e.tail;for(var n=null;r!==null;)r.alternate!==null&&(n=r),r=r.sibling;n===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:n.sibling=null}}function Wt(e){var t=e.alternate!==null&&e.alternate.child===e.child,r=0,n=0;if(t)for(var i=e.child;i!==null;)r|=i.lanes|i.childLanes,n|=i.subtreeFlags&14680064,n|=i.flags&14680064,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)r|=i.lanes|i.childLanes,n|=i.subtreeFlags,n|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=n,e.childLanes=r,t}function Mb(e,t,r){var n=t.pendingProps;switch(jd(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Wt(t),null;case 1:return or(t.type)&&wl(),Wt(t),null;case 3:return n=t.stateNode,fi(),st(ir),st(Xt),Gd(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(Sa(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Pr!==null&&(kh(Pr),Pr=null))),_h(e,t),Wt(t),null;case 5:Kd(t);var i=us(Mo.current);if(r=t.type,e!==null&&t.stateNode!=null)O0(e,t,r,n,i),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!n){if(t.stateNode===null)throw Error(he(166));return Wt(t),null}if(e=us(Vr.current),Sa(t)){n=t.stateNode,r=t.type;var a=t.memoizedProps;switch(n[zr]=t,n[Ro]=a,e=(t.mode&1)!==0,r){case"dialog":nt("cancel",n),nt("close",n);break;case"iframe":case"object":case"embed":nt("load",n);break;case"video":case"audio":for(i=0;i<qi.length;i++)nt(qi[i],n);break;case"source":nt("error",n);break;case"img":case"image":case"link":nt("error",n),nt("load",n);break;case"details":nt("toggle",n);break;case"input":Ap(n,a),nt("invalid",n);break;case"select":n._wrapperState={wasMultiple:!!a.multiple},nt("invalid",n);break;case"textarea":Ip(n,a),nt("invalid",n)}Vu(r,a),i=null;for(var l in a)if(a.hasOwnProperty(l)){var s=a[l];l==="children"?typeof s=="string"?n.textContent!==s&&(a.suppressHydrationWarning!==!0&&wa(n.textContent,s,e),i=["children",s]):typeof s=="number"&&n.textContent!==""+s&&(a.suppressHydrationWarning!==!0&&wa(n.textContent,s,e),i=["children",""+s]):yo.hasOwnProperty(l)&&s!=null&&l==="onScroll"&&nt("scroll",n)}switch(r){case"input":da(n),Pp(n,a,!0);break;case"textarea":da(n),Op(n);break;case"select":case"option":break;default:typeof a.onClick=="function"&&(n.onclick=yl)}n=i,t.updateQueue=n,n!==null&&(t.flags|=4)}else{l=i.nodeType===9?i:i.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=u_(r)),e==="http://www.w3.org/1999/xhtml"?r==="script"?(e=l.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof n.is=="string"?e=l.createElement(r,{is:n.is}):(e=l.createElement(r),r==="select"&&(l=e,n.multiple?l.multiple=!0:n.size&&(l.size=n.size))):e=l.createElementNS(e,r),e[zr]=t,e[Ro]=n,I0(e,t,!1,!1),t.stateNode=e;e:{switch(l=Ku(r,n),r){case"dialog":nt("cancel",e),nt("close",e),i=n;break;case"iframe":case"object":case"embed":nt("load",e),i=n;break;case"video":case"audio":for(i=0;i<qi.length;i++)nt(qi[i],e);i=n;break;case"source":nt("error",e),i=n;break;case"img":case"image":case"link":nt("error",e),nt("load",e),i=n;break;case"details":nt("toggle",e),i=n;break;case"input":Ap(e,n),i=Hu(e,n),nt("invalid",e);break;case"option":i=n;break;case"select":e._wrapperState={wasMultiple:!!n.multiple},i=ut({},n,{value:void 0}),nt("invalid",e);break;case"textarea":Ip(e,n),i=Uu(e,n),nt("invalid",e);break;default:i=n}Vu(r,i),s=i;for(a in s)if(s.hasOwnProperty(a)){var o=s[a];a==="style"?f_(e,o):a==="dangerouslySetInnerHTML"?(o=o?o.__html:void 0,o!=null&&h_(e,o)):a==="children"?typeof o=="string"?(r!=="textarea"||o!=="")&&wo(e,o):typeof o=="number"&&wo(e,""+o):a!=="suppressContentEditableWarning"&&a!=="suppressHydrationWarning"&&a!=="autoFocus"&&(yo.hasOwnProperty(a)?o!=null&&a==="onScroll"&&nt("scroll",e):o!=null&&bd(e,a,o,l))}switch(r){case"input":da(e),Pp(e,n,!1);break;case"textarea":da(e),Op(e);break;case"option":n.value!=null&&e.setAttribute("value",""+Un(n.value));break;case"select":e.multiple=!!n.multiple,a=n.value,a!=null?Qs(e,!!n.multiple,a,!1):n.defaultValue!=null&&Qs(e,!!n.multiple,n.defaultValue,!0);break;default:typeof i.onClick=="function"&&(e.onclick=yl)}switch(r){case"button":case"input":case"select":case"textarea":n=!!n.autoFocus;break e;case"img":n=!0;break e;default:n=!1}}n&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return Wt(t),null;case 6:if(e&&t.stateNode!=null)B0(e,t,e.memoizedProps,n);else{if(typeof n!="string"&&t.stateNode===null)throw Error(he(166));if(r=us(Mo.current),us(Vr.current),Sa(t)){if(n=t.stateNode,r=t.memoizedProps,n[zr]=t,(a=n.nodeValue!==r)&&(e=dr,e!==null))switch(e.tag){case 3:wa(n.nodeValue,r,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&wa(n.nodeValue,r,(e.mode&1)!==0)}a&&(t.flags|=4)}else n=(r.nodeType===9?r:r.ownerDocument).createTextNode(n),n[zr]=t,t.stateNode=n}return Wt(t),null;case 13:if(st(at),n=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(ot&&hr!==null&&t.mode&1&&!(t.flags&128))e0(),hi(),t.flags|=98560,a=!1;else if(a=Sa(t),n!==null&&n.dehydrated!==null){if(e===null){if(!a)throw Error(he(318));if(a=t.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(he(317));a[zr]=t}else hi(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Wt(t),a=!1}else Pr!==null&&(kh(Pr),Pr=null),a=!0;if(!a)return t.flags&65536?t:null}return t.flags&128?(t.lanes=r,t):(n=n!==null,n!==(e!==null&&e.memoizedState!==null)&&n&&(t.child.flags|=8192,t.mode&1&&(e===null||at.current&1?Ct===0&&(Ct=3):of())),t.updateQueue!==null&&(t.flags|=4),Wt(t),null);case 4:return fi(),_h(e,t),e===null&&Lo(t.stateNode.containerInfo),Wt(t),null;case 10:return zd(t.type._context),Wt(t),null;case 17:return or(t.type)&&wl(),Wt(t),null;case 19:if(st(at),a=t.memoizedState,a===null)return Wt(t),null;if(n=(t.flags&128)!==0,l=a.rendering,l===null)if(n)ji(a,!1);else{if(Ct!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(l=Ll(e),l!==null){for(t.flags|=128,ji(a,!1),n=l.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),t.subtreeFlags=0,n=r,r=t.child;r!==null;)a=r,e=n,a.flags&=14680066,l=a.alternate,l===null?(a.childLanes=0,a.lanes=e,a.child=null,a.subtreeFlags=0,a.memoizedProps=null,a.memoizedState=null,a.updateQueue=null,a.dependencies=null,a.stateNode=null):(a.childLanes=l.childLanes,a.lanes=l.lanes,a.child=l.child,a.subtreeFlags=0,a.deletions=null,a.memoizedProps=l.memoizedProps,a.memoizedState=l.memoizedState,a.updateQueue=l.updateQueue,a.type=l.type,e=l.dependencies,a.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),r=r.sibling;return Ze(at,at.current&1|2),t.child}e=e.sibling}a.tail!==null&&pt()>mi&&(t.flags|=128,n=!0,ji(a,!1),t.lanes=4194304)}else{if(!n)if(e=Ll(l),e!==null){if(t.flags|=128,n=!0,r=e.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),ji(a,!0),a.tail===null&&a.tailMode==="hidden"&&!l.alternate&&!ot)return Wt(t),null}else 2*pt()-a.renderingStartTime>mi&&r!==1073741824&&(t.flags|=128,n=!0,ji(a,!1),t.lanes=4194304);a.isBackwards?(l.sibling=t.child,t.child=l):(r=a.last,r!==null?r.sibling=l:t.child=l,a.last=l)}return a.tail!==null?(t=a.tail,a.rendering=t,a.tail=t.sibling,a.renderingStartTime=pt(),t.sibling=null,r=at.current,Ze(at,n?r&1|2:r&1),t):(Wt(t),null);case 22:case 23:return sf(),n=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==n&&(t.flags|=8192),n&&t.mode&1?cr&1073741824&&(Wt(t),t.subtreeFlags&6&&(t.flags|=8192)):Wt(t),null;case 24:return null;case 25:return null}throw Error(he(156,t.tag))}function Ab(e,t){switch(jd(t),t.tag){case 1:return or(t.type)&&wl(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return fi(),st(ir),st(Xt),Gd(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return Kd(t),null;case 13:if(st(at),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(he(340));hi()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return st(at),null;case 4:return fi(),null;case 10:return zd(t.type._context),null;case 22:case 23:return sf(),null;case 24:return null;default:return null}}var Ca=!1,Vt=!1,Pb=typeof WeakSet=="function"?WeakSet:Set,xe=null;function Vs(e,t){var r=e.ref;if(r!==null)if(typeof r=="function")try{r(null)}catch(n){ft(e,t,n)}else r.current=null}function yh(e,t,r){try{r()}catch(n){ft(e,t,n)}}var Cm=!1;function Ib(e,t){if(rh=gl,e=$_(),Bd(e)){if("selectionStart"in e)var r={start:e.selectionStart,end:e.selectionEnd};else e:{r=(r=e.ownerDocument)&&r.defaultView||window;var n=r.getSelection&&r.getSelection();if(n&&n.rangeCount!==0){r=n.anchorNode;var i=n.anchorOffset,a=n.focusNode;n=n.focusOffset;try{r.nodeType,a.nodeType}catch{r=null;break e}var l=0,s=-1,o=-1,c=0,f=0,u=e,p=null;t:for(;;){for(var _;u!==r||i!==0&&u.nodeType!==3||(s=l+i),u!==a||n!==0&&u.nodeType!==3||(o=l+n),u.nodeType===3&&(l+=u.nodeValue.length),(_=u.firstChild)!==null;)p=u,u=_;for(;;){if(u===e)break t;if(p===r&&++c===i&&(s=l),p===a&&++f===n&&(o=l),(_=u.nextSibling)!==null)break;u=p,p=u.parentNode}u=_}r=s===-1||o===-1?null:{start:s,end:o}}else r=null}r=r||{start:0,end:0}}else r=null;for(nh={focusedElem:e,selectionRange:r},gl=!1,xe=t;xe!==null;)if(t=xe,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,xe=e;else for(;xe!==null;){t=xe;try{var y=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(y!==null){var v=y.memoizedProps,h=y.memoizedState,m=t.stateNode,d=m.getSnapshotBeforeUpdate(t.elementType===t.type?v:Dr(t.type,v),h);m.__reactInternalSnapshotBeforeUpdate=d}break;case 3:var g=t.stateNode.containerInfo;g.nodeType===1?g.textContent="":g.nodeType===9&&g.documentElement&&g.removeChild(g.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(he(163))}}catch(w){ft(t,t.return,w)}if(e=t.sibling,e!==null){e.return=t.return,xe=e;break}xe=t.return}return y=Cm,Cm=!1,y}function io(e,t,r){var n=t.updateQueue;if(n=n!==null?n.lastEffect:null,n!==null){var i=n=n.next;do{if((i.tag&e)===e){var a=i.destroy;i.destroy=void 0,a!==void 0&&yh(t,r,a)}i=i.next}while(i!==n)}}function cc(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var r=t=t.next;do{if((r.tag&e)===e){var n=r.create;r.destroy=n()}r=r.next}while(r!==t)}}function wh(e){var t=e.ref;if(t!==null){var r=e.stateNode;switch(e.tag){case 5:e=r;break;default:e=r}typeof t=="function"?t(e):t.current=e}}function N0(e){var t=e.alternate;t!==null&&(e.alternate=null,N0(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[zr],delete t[Ro],delete t[oh],delete t[gb],delete t[vb])),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 j0(e){return e.tag===5||e.tag===3||e.tag===4}function Em(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||j0(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 Sh(e,t,r){var n=e.tag;if(n===5||n===6)e=e.stateNode,t?r.nodeType===8?r.parentNode.insertBefore(e,t):r.insertBefore(e,t):(r.nodeType===8?(t=r.parentNode,t.insertBefore(e,r)):(t=r,t.appendChild(e)),r=r._reactRootContainer,r!=null||t.onclick!==null||(t.onclick=yl));else if(n!==4&&(e=e.child,e!==null))for(Sh(e,t,r),e=e.sibling;e!==null;)Sh(e,t,r),e=e.sibling}function xh(e,t,r){var n=e.tag;if(n===5||n===6)e=e.stateNode,t?r.insertBefore(e,t):r.appendChild(e);else if(n!==4&&(e=e.child,e!==null))for(xh(e,t,r),e=e.sibling;e!==null;)xh(e,t,r),e=e.sibling}var Bt=null,Mr=!1;function xn(e,t,r){for(r=r.child;r!==null;)F0(e,t,r),r=r.sibling}function F0(e,t,r){if(Wr&&typeof Wr.onCommitFiberUnmount=="function")try{Wr.onCommitFiberUnmount(tc,r)}catch{}switch(r.tag){case 5:Vt||Vs(r,t);case 6:var n=Bt,i=Mr;Bt=null,xn(e,t,r),Bt=n,Mr=i,Bt!==null&&(Mr?(e=Bt,r=r.stateNode,e.nodeType===8?e.parentNode.removeChild(r):e.removeChild(r)):Bt.removeChild(r.stateNode));break;case 18:Bt!==null&&(Mr?(e=Bt,r=r.stateNode,e.nodeType===8?Wc(e.parentNode,r):e.nodeType===1&&Wc(e,r),Co(e)):Wc(Bt,r.stateNode));break;case 4:n=Bt,i=Mr,Bt=r.stateNode.containerInfo,Mr=!0,xn(e,t,r),Bt=n,Mr=i;break;case 0:case 11:case 14:case 15:if(!Vt&&(n=r.updateQueue,n!==null&&(n=n.lastEffect,n!==null))){i=n=n.next;do{var a=i,l=a.destroy;a=a.tag,l!==void 0&&(a&2||a&4)&&yh(r,t,l),i=i.next}while(i!==n)}xn(e,t,r);break;case 1:if(!Vt&&(Vs(r,t),n=r.stateNode,typeof n.componentWillUnmount=="function"))try{n.props=r.memoizedProps,n.state=r.memoizedState,n.componentWillUnmount()}catch(s){ft(r,t,s)}xn(e,t,r);break;case 21:xn(e,t,r);break;case 22:r.mode&1?(Vt=(n=Vt)||r.memoizedState!==null,xn(e,t,r),Vt=n):xn(e,t,r);break;default:xn(e,t,r)}}function km(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var r=e.stateNode;r===null&&(r=e.stateNode=new Pb),t.forEach(function(n){var i=Ub.bind(null,e,n);r.has(n)||(r.add(n),n.then(i,i))})}}function kr(e,t){var r=t.deletions;if(r!==null)for(var n=0;n<r.length;n++){var i=r[n];try{var a=e,l=t,s=l;e:for(;s!==null;){switch(s.tag){case 5:Bt=s.stateNode,Mr=!1;break e;case 3:Bt=s.stateNode.containerInfo,Mr=!0;break e;case 4:Bt=s.stateNode.containerInfo,Mr=!0;break e}s=s.return}if(Bt===null)throw Error(he(160));F0(a,l,i),Bt=null,Mr=!1;var o=i.alternate;o!==null&&(o.return=null),i.return=null}catch(c){ft(i,t,c)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)H0(t,e),t=t.sibling}function H0(e,t){var r=e.alternate,n=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(kr(t,e),Fr(e),n&4){try{io(3,e,e.return),cc(3,e)}catch(v){ft(e,e.return,v)}try{io(5,e,e.return)}catch(v){ft(e,e.return,v)}}break;case 1:kr(t,e),Fr(e),n&512&&r!==null&&Vs(r,r.return);break;case 5:if(kr(t,e),Fr(e),n&512&&r!==null&&Vs(r,r.return),e.flags&32){var i=e.stateNode;try{wo(i,"")}catch(v){ft(e,e.return,v)}}if(n&4&&(i=e.stateNode,i!=null)){var a=e.memoizedProps,l=r!==null?r.memoizedProps:a,s=e.type,o=e.updateQueue;if(e.updateQueue=null,o!==null)try{s==="input"&&a.type==="radio"&&a.name!=null&&l_(i,a),Ku(s,l);var c=Ku(s,a);for(l=0;l<o.length;l+=2){var f=o[l],u=o[l+1];f==="style"?f_(i,u):f==="dangerouslySetInnerHTML"?h_(i,u):f==="children"?wo(i,u):bd(i,f,u,c)}switch(s){case"input":$u(i,a);break;case"textarea":c_(i,a);break;case"select":var p=i._wrapperState.wasMultiple;i._wrapperState.wasMultiple=!!a.multiple;var _=a.value;_!=null?Qs(i,!!a.multiple,_,!1):p!==!!a.multiple&&(a.defaultValue!=null?Qs(i,!!a.multiple,a.defaultValue,!0):Qs(i,!!a.multiple,a.multiple?[]:"",!1))}i[Ro]=a}catch(v){ft(e,e.return,v)}}break;case 6:if(kr(t,e),Fr(e),n&4){if(e.stateNode===null)throw Error(he(162));i=e.stateNode,a=e.memoizedProps;try{i.nodeValue=a}catch(v){ft(e,e.return,v)}}break;case 3:if(kr(t,e),Fr(e),n&4&&r!==null&&r.memoizedState.isDehydrated)try{Co(t.containerInfo)}catch(v){ft(e,e.return,v)}break;case 4:kr(t,e),Fr(e);break;case 13:kr(t,e),Fr(e),i=e.child,i.flags&8192&&(a=i.memoizedState!==null,i.stateNode.isHidden=a,!a||i.alternate!==null&&i.alternate.memoizedState!==null||(rf=pt())),n&4&&km(e);break;case 22:if(f=r!==null&&r.memoizedState!==null,e.mode&1?(Vt=(c=Vt)||f,kr(t,e),Vt=c):kr(t,e),Fr(e),n&8192){if(c=e.memoizedState!==null,(e.stateNode.isHidden=c)&&!f&&e.mode&1)for(xe=e,f=e.child;f!==null;){for(u=xe=f;xe!==null;){switch(p=xe,_=p.child,p.tag){case 0:case 11:case 14:case 15:io(4,p,p.return);break;case 1:Vs(p,p.return);var y=p.stateNode;if(typeof y.componentWillUnmount=="function"){n=p,r=p.return;try{t=n,y.props=t.memoizedProps,y.state=t.memoizedState,y.componentWillUnmount()}catch(v){ft(n,r,v)}}break;case 5:Vs(p,p.return);break;case 22:if(p.memoizedState!==null){Tm(u);continue}}_!==null?(_.return=p,xe=_):Tm(u)}f=f.sibling}e:for(f=null,u=e;;){if(u.tag===5){if(f===null){f=u;try{i=u.stateNode,c?(a=i.style,typeof a.setProperty=="function"?a.setProperty("display","none","important"):a.display="none"):(s=u.stateNode,o=u.memoizedProps.style,l=o!=null&&o.hasOwnProperty("display")?o.display:null,s.style.display=d_("display",l))}catch(v){ft(e,e.return,v)}}}else if(u.tag===6){if(f===null)try{u.stateNode.nodeValue=c?"":u.memoizedProps}catch(v){ft(e,e.return,v)}}else if((u.tag!==22&&u.tag!==23||u.memoizedState===null||u===e)&&u.child!==null){u.child.return=u,u=u.child;continue}if(u===e)break e;for(;u.sibling===null;){if(u.return===null||u.return===e)break e;f===u&&(f=null),u=u.return}f===u&&(f=null),u.sibling.return=u.return,u=u.sibling}}break;case 19:kr(t,e),Fr(e),n&4&&km(e);break;case 21:break;default:kr(t,e),Fr(e)}}function Fr(e){var t=e.flags;if(t&2){try{e:{for(var r=e.return;r!==null;){if(j0(r)){var n=r;break e}r=r.return}throw Error(he(160))}switch(n.tag){case 5:var i=n.stateNode;n.flags&32&&(wo(i,""),n.flags&=-33);var a=Em(e);xh(e,a,i);break;case 3:case 4:var l=n.stateNode.containerInfo,s=Em(e);Sh(e,s,l);break;default:throw Error(he(161))}}catch(o){ft(e,e.return,o)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Ob(e,t,r){xe=e,$0(e)}function $0(e,t,r){for(var n=(e.mode&1)!==0;xe!==null;){var i=xe,a=i.child;if(i.tag===22&&n){var l=i.memoizedState!==null||Ca;if(!l){var s=i.alternate,o=s!==null&&s.memoizedState!==null||Vt;s=Ca;var c=Vt;if(Ca=l,(Vt=o)&&!c)for(xe=i;xe!==null;)l=xe,o=l.child,l.tag===22&&l.memoizedState!==null?Rm(i):o!==null?(o.return=l,xe=o):Rm(i);for(;a!==null;)xe=a,$0(a),a=a.sibling;xe=i,Ca=s,Vt=c}Lm(e)}else i.subtreeFlags&8772&&a!==null?(a.return=i,xe=a):Lm(e)}}function Lm(e){for(;xe!==null;){var t=xe;if(t.flags&8772){var r=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:Vt||cc(5,t);break;case 1:var n=t.stateNode;if(t.flags&4&&!Vt)if(r===null)n.componentDidMount();else{var i=t.elementType===t.type?r.memoizedProps:Dr(t.type,r.memoizedProps);n.componentDidUpdate(i,r.memoizedState,n.__reactInternalSnapshotBeforeUpdate)}var a=t.updateQueue;a!==null&&hm(t,a,n);break;case 3:var l=t.updateQueue;if(l!==null){if(r=null,t.child!==null)switch(t.child.tag){case 5:r=t.child.stateNode;break;case 1:r=t.child.stateNode}hm(t,l,r)}break;case 5:var s=t.stateNode;if(r===null&&t.flags&4){r=s;var o=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":o.autoFocus&&r.focus();break;case"img":o.src&&(r.src=o.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 f=c.memoizedState;if(f!==null){var u=f.dehydrated;u!==null&&Co(u)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(he(163))}Vt||t.flags&512&&wh(t)}catch(p){ft(t,t.return,p)}}if(t===e){xe=null;break}if(r=t.sibling,r!==null){r.return=t.return,xe=r;break}xe=t.return}}function Tm(e){for(;xe!==null;){var t=xe;if(t===e){xe=null;break}var r=t.sibling;if(r!==null){r.return=t.return,xe=r;break}xe=t.return}}function Rm(e){for(;xe!==null;){var t=xe;try{switch(t.tag){case 0:case 11:case 15:var r=t.return;try{cc(4,t)}catch(o){ft(t,r,o)}break;case 1:var n=t.stateNode;if(typeof n.componentDidMount=="function"){var i=t.return;try{n.componentDidMount()}catch(o){ft(t,i,o)}}var a=t.return;try{wh(t)}catch(o){ft(t,a,o)}break;case 5:var l=t.return;try{wh(t)}catch(o){ft(t,l,o)}}}catch(o){ft(t,t.return,o)}if(t===e){xe=null;break}var s=t.sibling;if(s!==null){s.return=t.return,xe=s;break}xe=t.return}}var Bb=Math.ceil,Dl=yn.ReactCurrentDispatcher,ef=yn.ReactCurrentOwner,xr=yn.ReactCurrentBatchConfig,qe=0,Pt=null,vt=null,Ft=0,cr=0,Ks=qn(0),Ct=0,Oo=null,xs=0,uc=0,tf=0,oo=null,nr=null,rf=0,mi=1/0,an=null,Ml=!1,bh=null,Hn=null,Ea=!1,Pn=null,Al=0,ao=0,Ch=null,Za=-1,el=0;function er(){return qe&6?pt():Za!==-1?Za:Za=pt()}function $n(e){return e.mode&1?qe&2&&Ft!==0?Ft&-Ft:yb.transition!==null?(el===0&&(el=E_()),el):(e=Je,e!==0||(e=window.event,e=e===void 0?16:A_(e.type)),e):1}function Br(e,t,r,n){if(50<ao)throw ao=0,Ch=null,Error(he(185));Xo(e,r,n),(!(qe&2)||e!==Pt)&&(e===Pt&&(!(qe&2)&&(uc|=r),Ct===4&&Mn(e,Ft)),ar(e,n),r===1&&qe===0&&!(t.mode&1)&&(mi=pt()+500,oc&&Xn()))}function ar(e,t){var r=e.callbackNode;yx(e,t);var n=ml(e,e===Pt?Ft:0);if(n===0)r!==null&&jp(r),e.callbackNode=null,e.callbackPriority=0;else if(t=n&-n,e.callbackPriority!==t){if(r!=null&&jp(r),t===1)e.tag===0?_b(Dm.bind(null,e)):J_(Dm.bind(null,e)),pb(function(){!(qe&6)&&Xn()}),r=null;else{switch(k_(n)){case 1:r=Td;break;case 4:r=b_;break;case 16:r=pl;break;case 536870912:r=C_;break;default:r=pl}r=X0(r,z0.bind(null,e))}e.callbackPriority=t,e.callbackNode=r}}function z0(e,t){if(Za=-1,el=0,qe&6)throw Error(he(327));var r=e.callbackNode;if(ni()&&e.callbackNode!==r)return null;var n=ml(e,e===Pt?Ft:0);if(n===0)return null;if(n&30||n&e.expiredLanes||t)t=Pl(e,n);else{t=n;var i=qe;qe|=2;var a=W0();(Pt!==e||Ft!==t)&&(an=null,mi=pt()+500,ms(e,t));do try{Fb();break}catch(s){U0(e,s)}while(!0);$d(),Dl.current=a,qe=i,vt!==null?t=0:(Pt=null,Ft=0,t=Ct)}if(t!==0){if(t===2&&(i=Ju(e),i!==0&&(n=i,t=Eh(e,i))),t===1)throw r=Oo,ms(e,0),Mn(e,n),ar(e,pt()),r;if(t===6)Mn(e,n);else{if(i=e.current.alternate,!(n&30)&&!Nb(i)&&(t=Pl(e,n),t===2&&(a=Ju(e),a!==0&&(n=a,t=Eh(e,a))),t===1))throw r=Oo,ms(e,0),Mn(e,n),ar(e,pt()),r;switch(e.finishedWork=i,e.finishedLanes=n,t){case 0:case 1:throw Error(he(345));case 2:os(e,nr,an);break;case 3:if(Mn(e,n),(n&130023424)===n&&(t=rf+500-pt(),10<t)){if(ml(e,0)!==0)break;if(i=e.suspendedLanes,(i&n)!==n){er(),e.pingedLanes|=e.suspendedLanes&i;break}e.timeoutHandle=ih(os.bind(null,e,nr,an),t);break}os(e,nr,an);break;case 4:if(Mn(e,n),(n&4194240)===n)break;for(t=e.eventTimes,i=-1;0<n;){var l=31-Or(n);a=1<<l,l=t[l],l>i&&(i=l),n&=~a}if(n=i,n=pt()-n,n=(120>n?120:480>n?480:1080>n?1080:1920>n?1920:3e3>n?3e3:4320>n?4320:1960*Bb(n/1960))-n,10<n){e.timeoutHandle=ih(os.bind(null,e,nr,an),n);break}os(e,nr,an);break;case 5:os(e,nr,an);break;default:throw Error(he(329))}}}return ar(e,pt()),e.callbackNode===r?z0.bind(null,e):null}function Eh(e,t){var r=oo;return e.current.memoizedState.isDehydrated&&(ms(e,t).flags|=256),e=Pl(e,t),e!==2&&(t=nr,nr=r,t!==null&&kh(t)),e}function kh(e){nr===null?nr=e:nr.push.apply(nr,e)}function Nb(e){for(var t=e;;){if(t.flags&16384){var r=t.updateQueue;if(r!==null&&(r=r.stores,r!==null))for(var n=0;n<r.length;n++){var i=r[n],a=i.getSnapshot;i=i.value;try{if(!Nr(a(),i))return!1}catch{return!1}}}if(r=t.child,t.subtreeFlags&16384&&r!==null)r.return=t,t=r;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function Mn(e,t){for(t&=~tf,t&=~uc,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var r=31-Or(t),n=1<<r;e[r]=-1,t&=~n}}function Dm(e){if(qe&6)throw Error(he(327));ni();var t=ml(e,0);if(!(t&1))return ar(e,pt()),null;var r=Pl(e,t);if(e.tag!==0&&r===2){var n=Ju(e);n!==0&&(t=n,r=Eh(e,n))}if(r===1)throw r=Oo,ms(e,0),Mn(e,t),ar(e,pt()),r;if(r===6)throw Error(he(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,os(e,nr,an),ar(e,pt()),null}function nf(e,t){var r=qe;qe|=1;try{return e(t)}finally{qe=r,qe===0&&(mi=pt()+500,oc&&Xn())}}function bs(e){Pn!==null&&Pn.tag===0&&!(qe&6)&&ni();var t=qe;qe|=1;var r=xr.transition,n=Je;try{if(xr.transition=null,Je=1,e)return e()}finally{Je=n,xr.transition=r,qe=t,!(qe&6)&&Xn()}}function sf(){cr=Ks.current,st(Ks)}function ms(e,t){e.finishedWork=null,e.finishedLanes=0;var r=e.timeoutHandle;if(r!==-1&&(e.timeoutHandle=-1,fb(r)),vt!==null)for(r=vt.return;r!==null;){var n=r;switch(jd(n),n.tag){case 1:n=n.type.childContextTypes,n!=null&&wl();break;case 3:fi(),st(ir),st(Xt),Gd();break;case 5:Kd(n);break;case 4:fi();break;case 13:st(at);break;case 19:st(at);break;case 10:zd(n.type._context);break;case 22:case 23:sf()}r=r.return}if(Pt=e,vt=e=zn(e.current,null),Ft=cr=t,Ct=0,Oo=null,tf=uc=xs=0,nr=oo=null,cs!==null){for(t=0;t<cs.length;t++)if(r=cs[t],n=r.interleaved,n!==null){r.interleaved=null;var i=n.next,a=r.pending;if(a!==null){var l=a.next;a.next=i,n.next=l}r.pending=n}cs=null}return e}function U0(e,t){do{var r=vt;try{if($d(),Ya.current=Rl,Tl){for(var n=ct.memoizedState;n!==null;){var i=n.queue;i!==null&&(i.pending=null),n=n.next}Tl=!1}if(Ss=0,Lt=St=ct=null,so=!1,Ao=0,ef.current=null,r===null||r.return===null){Ct=1,Oo=t,vt=null;break}e:{var a=e,l=r.return,s=r,o=t;if(t=Ft,s.flags|=32768,o!==null&&typeof o=="object"&&typeof o.then=="function"){var c=o,f=s,u=f.tag;if(!(f.mode&1)&&(u===0||u===11||u===15)){var p=f.alternate;p?(f.updateQueue=p.updateQueue,f.memoizedState=p.memoizedState,f.lanes=p.lanes):(f.updateQueue=null,f.memoizedState=null)}var _=vm(l);if(_!==null){_.flags&=-257,_m(_,l,s,a,t),_.mode&1&&gm(a,c,t),t=_,o=c;var y=t.updateQueue;if(y===null){var v=new Set;v.add(o),t.updateQueue=v}else y.add(o);break e}else{if(!(t&1)){gm(a,c,t),of();break e}o=Error(he(426))}}else if(ot&&s.mode&1){var h=vm(l);if(h!==null){!(h.flags&65536)&&(h.flags|=256),_m(h,l,s,a,t),Fd(pi(o,s));break e}}a=o=pi(o,s),Ct!==4&&(Ct=2),oo===null?oo=[a]:oo.push(a),a=l;do{switch(a.tag){case 3:a.flags|=65536,t&=-t,a.lanes|=t;var m=k0(a,o,t);um(a,m);break e;case 1:s=o;var d=a.type,g=a.stateNode;if(!(a.flags&128)&&(typeof d.getDerivedStateFromError=="function"||g!==null&&typeof g.componentDidCatch=="function"&&(Hn===null||!Hn.has(g)))){a.flags|=65536,t&=-t,a.lanes|=t;var w=L0(a,s,t);um(a,w);break e}}a=a.return}while(a!==null)}K0(r)}catch(b){t=b,vt===r&&r!==null&&(vt=r=r.return);continue}break}while(!0)}function W0(){var e=Dl.current;return Dl.current=Rl,e===null?Rl:e}function of(){(Ct===0||Ct===3||Ct===2)&&(Ct=4),Pt===null||!(xs&268435455)&&!(uc&268435455)||Mn(Pt,Ft)}function Pl(e,t){var r=qe;qe|=2;var n=W0();(Pt!==e||Ft!==t)&&(an=null,ms(e,t));do try{jb();break}catch(i){U0(e,i)}while(!0);if($d(),qe=r,Dl.current=n,vt!==null)throw Error(he(261));return Pt=null,Ft=0,Ct}function jb(){for(;vt!==null;)V0(vt)}function Fb(){for(;vt!==null&&!ux();)V0(vt)}function V0(e){var t=q0(e.alternate,e,cr);e.memoizedProps=e.pendingProps,t===null?K0(e):vt=t,ef.current=null}function K0(e){var t=e;do{var r=t.alternate;if(e=t.return,t.flags&32768){if(r=Ab(r,t),r!==null){r.flags&=32767,vt=r;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{Ct=6,vt=null;return}}else if(r=Mb(r,t,cr),r!==null){vt=r;return}if(t=t.sibling,t!==null){vt=t;return}vt=t=e}while(t!==null);Ct===0&&(Ct=5)}function os(e,t,r){var n=Je,i=xr.transition;try{xr.transition=null,Je=1,Hb(e,t,r,n)}finally{xr.transition=i,Je=n}return null}function Hb(e,t,r,n){do ni();while(Pn!==null);if(qe&6)throw Error(he(327));r=e.finishedWork;var i=e.finishedLanes;if(r===null)return null;if(e.finishedWork=null,e.finishedLanes=0,r===e.current)throw Error(he(177));e.callbackNode=null,e.callbackPriority=0;var a=r.lanes|r.childLanes;if(wx(e,a),e===Pt&&(vt=Pt=null,Ft=0),!(r.subtreeFlags&2064)&&!(r.flags&2064)||Ea||(Ea=!0,X0(pl,function(){return ni(),null})),a=(r.flags&15990)!==0,r.subtreeFlags&15990||a){a=xr.transition,xr.transition=null;var l=Je;Je=1;var s=qe;qe|=4,ef.current=null,Ib(e,r),H0(r,e),ob(nh),gl=!!rh,nh=rh=null,e.current=r,Ob(r),hx(),qe=s,Je=l,xr.transition=a}else e.current=r;if(Ea&&(Ea=!1,Pn=e,Al=i),a=e.pendingLanes,a===0&&(Hn=null),px(r.stateNode),ar(e,pt()),t!==null)for(n=e.onRecoverableError,r=0;r<t.length;r++)i=t[r],n(i.value,{componentStack:i.stack,digest:i.digest});if(Ml)throw Ml=!1,e=bh,bh=null,e;return Al&1&&e.tag!==0&&ni(),a=e.pendingLanes,a&1?e===Ch?ao++:(ao=0,Ch=e):ao=0,Xn(),null}function ni(){if(Pn!==null){var e=k_(Al),t=xr.transition,r=Je;try{if(xr.transition=null,Je=16>e?16:e,Pn===null)var n=!1;else{if(e=Pn,Pn=null,Al=0,qe&6)throw Error(he(331));var i=qe;for(qe|=4,xe=e.current;xe!==null;){var a=xe,l=a.child;if(xe.flags&16){var s=a.deletions;if(s!==null){for(var o=0;o<s.length;o++){var c=s[o];for(xe=c;xe!==null;){var f=xe;switch(f.tag){case 0:case 11:case 15:io(8,f,a)}var u=f.child;if(u!==null)u.return=f,xe=u;else for(;xe!==null;){f=xe;var p=f.sibling,_=f.return;if(N0(f),f===c){xe=null;break}if(p!==null){p.return=_,xe=p;break}xe=_}}}var y=a.alternate;if(y!==null){var v=y.child;if(v!==null){y.child=null;do{var h=v.sibling;v.sibling=null,v=h}while(v!==null)}}xe=a}}if(a.subtreeFlags&2064&&l!==null)l.return=a,xe=l;else e:for(;xe!==null;){if(a=xe,a.flags&2048)switch(a.tag){case 0:case 11:case 15:io(9,a,a.return)}var m=a.sibling;if(m!==null){m.return=a.return,xe=m;break e}xe=a.return}}var d=e.current;for(xe=d;xe!==null;){l=xe;var g=l.child;if(l.subtreeFlags&2064&&g!==null)g.return=l,xe=g;else e:for(l=d;xe!==null;){if(s=xe,s.flags&2048)try{switch(s.tag){case 0:case 11:case 15:cc(9,s)}}catch(b){ft(s,s.return,b)}if(s===l){xe=null;break e}var w=s.sibling;if(w!==null){w.return=s.return,xe=w;break e}xe=s.return}}if(qe=i,Xn(),Wr&&typeof Wr.onPostCommitFiberRoot=="function")try{Wr.onPostCommitFiberRoot(tc,e)}catch{}n=!0}return n}finally{Je=r,xr.transition=t}}return!1}function Mm(e,t,r){t=pi(r,t),t=k0(e,t,1),e=Fn(e,t,1),t=er(),e!==null&&(Xo(e,1,t),ar(e,t))}function ft(e,t,r){if(e.tag===3)Mm(e,e,r);else for(;t!==null;){if(t.tag===3){Mm(t,e,r);break}else if(t.tag===1){var n=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof n.componentDidCatch=="function"&&(Hn===null||!Hn.has(n))){e=pi(r,e),e=L0(t,e,1),t=Fn(t,e,1),e=er(),t!==null&&(Xo(t,1,e),ar(t,e));break}}t=t.return}}function $b(e,t,r){var n=e.pingCache;n!==null&&n.delete(t),t=er(),e.pingedLanes|=e.suspendedLanes&r,Pt===e&&(Ft&r)===r&&(Ct===4||Ct===3&&(Ft&130023424)===Ft&&500>pt()-rf?ms(e,0):tf|=r),ar(e,t)}function G0(e,t){t===0&&(e.mode&1?(t=ma,ma<<=1,!(ma&130023424)&&(ma=4194304)):t=1);var r=er();e=gn(e,t),e!==null&&(Xo(e,t,r),ar(e,r))}function zb(e){var t=e.memoizedState,r=0;t!==null&&(r=t.retryLane),G0(e,r)}function Ub(e,t){var r=0;switch(e.tag){case 13:var n=e.stateNode,i=e.memoizedState;i!==null&&(r=i.retryLane);break;case 19:n=e.stateNode;break;default:throw Error(he(314))}n!==null&&n.delete(t),G0(e,r)}var q0;q0=function(e,t,r){if(e!==null)if(e.memoizedProps!==t.pendingProps||ir.current)sr=!0;else{if(!(e.lanes&r)&&!(t.flags&128))return sr=!1,Db(e,t,r);sr=!!(e.flags&131072)}else sr=!1,ot&&t.flags&1048576&&Q_(t,bl,t.index);switch(t.lanes=0,t.tag){case 2:var n=t.type;Qa(e,t),e=t.pendingProps;var i=ui(t,Xt.current);ri(t,r),i=Xd(null,t,n,e,i,r);var a=Yd();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,or(n)?(a=!0,Sl(t)):a=!1,t.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,Wd(t),i.updater=lc,t.stateNode=i,i._reactInternals=t,dh(t,n,e,r),t=mh(null,t,n,!0,a,r)):(t.tag=0,ot&&a&&Nd(t),Jt(null,t,i,r),t=t.child),t;case 16:n=t.elementType;e:{switch(Qa(e,t),e=t.pendingProps,i=n._init,n=i(n._payload),t.type=n,i=t.tag=Vb(n),e=Dr(n,e),i){case 0:t=ph(null,t,n,e,r);break e;case 1:t=Sm(null,t,n,e,r);break e;case 11:t=ym(null,t,n,e,r);break e;case 14:t=wm(null,t,n,Dr(n.type,e),r);break e}throw Error(he(306,n,""))}return t;case 0:return n=t.type,i=t.pendingProps,i=t.elementType===n?i:Dr(n,i),ph(e,t,n,i,r);case 1:return n=t.type,i=t.pendingProps,i=t.elementType===n?i:Dr(n,i),Sm(e,t,n,i,r);case 3:e:{if(M0(t),e===null)throw Error(he(387));n=t.pendingProps,a=t.memoizedState,i=a.element,s0(e,t),kl(t,n,null,r);var l=t.memoizedState;if(n=l.element,a.isDehydrated)if(a={element:n,isDehydrated:!1,cache:l.cache,pendingSuspenseBoundaries:l.pendingSuspenseBoundaries,transitions:l.transitions},t.updateQueue.baseState=a,t.memoizedState=a,t.flags&256){i=pi(Error(he(423)),t),t=xm(e,t,n,r,i);break e}else if(n!==i){i=pi(Error(he(424)),t),t=xm(e,t,n,r,i);break e}else for(hr=jn(t.stateNode.containerInfo.firstChild),dr=t,ot=!0,Pr=null,r=r0(t,null,n,r),t.child=r;r;)r.flags=r.flags&-3|4096,r=r.sibling;else{if(hi(),n===i){t=vn(e,t,r);break e}Jt(e,t,n,r)}t=t.child}return t;case 5:return i0(t),e===null&&ch(t),n=t.type,i=t.pendingProps,a=e!==null?e.memoizedProps:null,l=i.children,sh(n,i)?l=null:a!==null&&sh(n,a)&&(t.flags|=32),D0(e,t),Jt(e,t,l,r),t.child;case 6:return e===null&&ch(t),null;case 13:return A0(e,t,r);case 4:return Vd(t,t.stateNode.containerInfo),n=t.pendingProps,e===null?t.child=di(t,null,n,r):Jt(e,t,n,r),t.child;case 11:return n=t.type,i=t.pendingProps,i=t.elementType===n?i:Dr(n,i),ym(e,t,n,i,r);case 7:return Jt(e,t,t.pendingProps,r),t.child;case 8:return Jt(e,t,t.pendingProps.children,r),t.child;case 12:return Jt(e,t,t.pendingProps.children,r),t.child;case 10:e:{if(n=t.type._context,i=t.pendingProps,a=t.memoizedProps,l=i.value,Ze(Cl,n._currentValue),n._currentValue=l,a!==null)if(Nr(a.value,l)){if(a.children===i.children&&!ir.current){t=vn(e,t,r);break e}}else for(a=t.child,a!==null&&(a.return=t);a!==null;){var s=a.dependencies;if(s!==null){l=a.child;for(var o=s.firstContext;o!==null;){if(o.context===n){if(a.tag===1){o=dn(-1,r&-r),o.tag=2;var c=a.updateQueue;if(c!==null){c=c.shared;var f=c.pending;f===null?o.next=o:(o.next=f.next,f.next=o),c.pending=o}}a.lanes|=r,o=a.alternate,o!==null&&(o.lanes|=r),uh(a.return,r,t),s.lanes|=r;break}o=o.next}}else if(a.tag===10)l=a.type===t.type?null:a.child;else if(a.tag===18){if(l=a.return,l===null)throw Error(he(341));l.lanes|=r,s=l.alternate,s!==null&&(s.lanes|=r),uh(l,r,t),l=a.sibling}else l=a.child;if(l!==null)l.return=a;else for(l=a;l!==null;){if(l===t){l=null;break}if(a=l.sibling,a!==null){a.return=l.return,l=a;break}l=l.return}a=l}Jt(e,t,i.children,r),t=t.child}return t;case 9:return i=t.type,n=t.pendingProps.children,ri(t,r),i=Cr(i),n=n(i),t.flags|=1,Jt(e,t,n,r),t.child;case 14:return n=t.type,i=Dr(n,t.pendingProps),i=Dr(n.type,i),wm(e,t,n,i,r);case 15:return T0(e,t,t.type,t.pendingProps,r);case 17:return n=t.type,i=t.pendingProps,i=t.elementType===n?i:Dr(n,i),Qa(e,t),t.tag=1,or(n)?(e=!0,Sl(t)):e=!1,ri(t,r),E0(t,n,i),dh(t,n,i,r),mh(null,t,n,!0,e,r);case 19:return P0(e,t,r);case 22:return R0(e,t,r)}throw Error(he(156,t.tag))};function X0(e,t){return x_(e,t)}function Wb(e,t,r,n){this.tag=e,this.key=r,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=n,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function wr(e,t,r,n){return new Wb(e,t,r,n)}function af(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Vb(e){if(typeof e=="function")return af(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Ed)return 11;if(e===kd)return 14}return 2}function zn(e,t){var r=e.alternate;return r===null?(r=wr(e.tag,t,e.key,e.mode),r.elementType=e.elementType,r.type=e.type,r.stateNode=e.stateNode,r.alternate=e,e.alternate=r):(r.pendingProps=t,r.type=e.type,r.flags=0,r.subtreeFlags=0,r.deletions=null),r.flags=e.flags&14680064,r.childLanes=e.childLanes,r.lanes=e.lanes,r.child=e.child,r.memoizedProps=e.memoizedProps,r.memoizedState=e.memoizedState,r.updateQueue=e.updateQueue,t=e.dependencies,r.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},r.sibling=e.sibling,r.index=e.index,r.ref=e.ref,r}function tl(e,t,r,n,i,a){var l=2;if(n=e,typeof e=="function")af(e)&&(l=1);else if(typeof e=="string")l=5;else e:switch(e){case Bs:return gs(r.children,i,a,t);case Cd:l=8,i|=8;break;case Bu:return e=wr(12,r,t,i|2),e.elementType=Bu,e.lanes=a,e;case Nu:return e=wr(13,r,t,i),e.elementType=Nu,e.lanes=a,e;case ju:return e=wr(19,r,t,i),e.elementType=ju,e.lanes=a,e;case i_:return hc(r,i,a,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case n_:l=10;break e;case s_:l=9;break e;case Ed:l=11;break e;case kd:l=14;break e;case Ln:l=16,n=null;break e}throw Error(he(130,e==null?e:typeof e,""))}return t=wr(l,r,t,i),t.elementType=e,t.type=n,t.lanes=a,t}function gs(e,t,r,n){return e=wr(7,e,n,t),e.lanes=r,e}function hc(e,t,r,n){return e=wr(22,e,n,t),e.elementType=i_,e.lanes=r,e.stateNode={isHidden:!1},e}function Qc(e,t,r){return e=wr(6,e,null,t),e.lanes=r,e}function Zc(e,t,r){return t=wr(4,e.children!==null?e.children:[],e.key,t),t.lanes=r,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function Kb(e,t,r,n,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=Pc(0),this.expirationTimes=Pc(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Pc(0),this.identifierPrefix=n,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function lf(e,t,r,n,i,a,l,s,o){return e=new Kb(e,t,r,s,o),t===1?(t=1,a===!0&&(t|=8)):t=0,a=wr(3,null,null,t),e.current=a,a.stateNode=e,a.memoizedState={element:n,isDehydrated:r,cache:null,transitions:null,pendingSuspenseBoundaries:null},Wd(a),e}function Gb(e,t,r){var n=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:Os,key:n==null?null:""+n,children:e,containerInfo:t,implementation:r}}function Y0(e){if(!e)return Wn;e=e._reactInternals;e:{if(Es(e)!==e||e.tag!==1)throw Error(he(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(or(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(he(171))}if(e.tag===1){var r=e.type;if(or(r))return Y_(e,r,t)}return t}function J0(e,t,r,n,i,a,l,s,o){return e=lf(r,n,!0,e,i,a,l,s,o),e.context=Y0(null),r=e.current,n=er(),i=$n(r),a=dn(n,i),a.callback=t??null,Fn(r,a,i),e.current.lanes=i,Xo(e,i,n),ar(e,n),e}function dc(e,t,r,n){var i=t.current,a=er(),l=$n(i);return r=Y0(r),t.context===null?t.context=r:t.pendingContext=r,t=dn(a,l),t.payload={element:e},n=n===void 0?null:n,n!==null&&(t.callback=n),e=Fn(i,t,l),e!==null&&(Br(e,i,l,a),Xa(e,i,l)),l}function Il(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 Am(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var r=e.retryLane;e.retryLane=r!==0&&r<t?r:t}}function cf(e,t){Am(e,t),(e=e.alternate)&&Am(e,t)}function qb(){return null}var Q0=typeof reportError=="function"?reportError:function(e){console.error(e)};function uf(e){this._internalRoot=e}fc.prototype.render=uf.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(he(409));dc(e,t,null,null)};fc.prototype.unmount=uf.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;bs(function(){dc(null,e,null,null)}),t[mn]=null}};function fc(e){this._internalRoot=e}fc.prototype.unstable_scheduleHydration=function(e){if(e){var t=R_();e={blockedOn:null,target:e,priority:t};for(var r=0;r<Dn.length&&t!==0&&t<Dn[r].priority;r++);Dn.splice(r,0,e),r===0&&M_(e)}};function hf(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function pc(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function Pm(){}function Xb(e,t,r,n,i){if(i){if(typeof n=="function"){var a=n;n=function(){var c=Il(l);a.call(c)}}var l=J0(t,n,e,0,null,!1,!1,"",Pm);return e._reactRootContainer=l,e[mn]=l.current,Lo(e.nodeType===8?e.parentNode:e),bs(),l}for(;i=e.lastChild;)e.removeChild(i);if(typeof n=="function"){var s=n;n=function(){var c=Il(o);s.call(c)}}var o=lf(e,0,!1,null,null,!1,!1,"",Pm);return e._reactRootContainer=o,e[mn]=o.current,Lo(e.nodeType===8?e.parentNode:e),bs(function(){dc(t,o,r,n)}),o}function mc(e,t,r,n,i){var a=r._reactRootContainer;if(a){var l=a;if(typeof i=="function"){var s=i;i=function(){var o=Il(l);s.call(o)}}dc(t,l,e,i)}else l=Xb(r,t,e,i,n);return Il(l)}L_=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var r=Gi(t.pendingLanes);r!==0&&(Rd(t,r|1),ar(t,pt()),!(qe&6)&&(mi=pt()+500,Xn()))}break;case 13:bs(function(){var n=gn(e,1);if(n!==null){var i=er();Br(n,e,1,i)}}),cf(e,1)}};Dd=function(e){if(e.tag===13){var t=gn(e,134217728);if(t!==null){var r=er();Br(t,e,134217728,r)}cf(e,134217728)}};T_=function(e){if(e.tag===13){var t=$n(e),r=gn(e,t);if(r!==null){var n=er();Br(r,e,t,n)}cf(e,t)}};R_=function(){return Je};D_=function(e,t){var r=Je;try{return Je=e,t()}finally{Je=r}};qu=function(e,t,r){switch(t){case"input":if($u(e,r),t=r.name,r.type==="radio"&&t!=null){for(r=e;r.parentNode;)r=r.parentNode;for(r=r.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<r.length;t++){var n=r[t];if(n!==e&&n.form===e.form){var i=ic(n);if(!i)throw Error(he(90));a_(n),$u(n,i)}}}break;case"textarea":c_(e,r);break;case"select":t=r.value,t!=null&&Qs(e,!!r.multiple,t,!1)}};g_=nf;v_=bs;var Yb={usingClientEntryPoint:!1,Events:[Jo,Hs,ic,p_,m_,nf]},Fi={findFiberByHostInstance:ls,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},Jb={bundleType:Fi.bundleType,version:Fi.version,rendererPackageName:Fi.rendererPackageName,rendererConfig:Fi.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:yn.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=w_(e),e===null?null:e.stateNode},findFiberByHostInstance:Fi.findFiberByHostInstance||qb,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 ka=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!ka.isDisabled&&ka.supportsFiber)try{tc=ka.inject(Jb),Wr=ka}catch{}}pr.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Yb;pr.createPortal=function(e,t){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!hf(t))throw Error(he(200));return Gb(e,t,null,r)};pr.createRoot=function(e,t){if(!hf(e))throw Error(he(299));var r=!1,n="",i=Q0;return t!=null&&(t.unstable_strictMode===!0&&(r=!0),t.identifierPrefix!==void 0&&(n=t.identifierPrefix),t.onRecoverableError!==void 0&&(i=t.onRecoverableError)),t=lf(e,1,!1,null,null,r,!1,n,i),e[mn]=t.current,Lo(e.nodeType===8?e.parentNode:e),new uf(t)};pr.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(he(188)):(e=Object.keys(e).join(","),Error(he(268,e)));return e=w_(t),e=e===null?null:e.stateNode,e};pr.flushSync=function(e){return bs(e)};pr.hydrate=function(e,t,r){if(!pc(t))throw Error(he(200));return mc(null,e,t,!0,r)};pr.hydrateRoot=function(e,t,r){if(!hf(e))throw Error(he(405));var n=r!=null&&r.hydratedSources||null,i=!1,a="",l=Q0;if(r!=null&&(r.unstable_strictMode===!0&&(i=!0),r.identifierPrefix!==void 0&&(a=r.identifierPrefix),r.onRecoverableError!==void 0&&(l=r.onRecoverableError)),t=J0(t,null,e,1,r??null,i,!1,a,l),e[mn]=t.current,Lo(e),n)for(e=0;e<n.length;e++)r=n[e],i=r._getVersion,i=i(r._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[r,i]:t.mutableSourceEagerHydrationData.push(r,i);return new fc(t)};pr.render=function(e,t,r){if(!pc(t))throw Error(he(200));return mc(null,e,t,!1,r)};pr.unmountComponentAtNode=function(e){if(!pc(e))throw Error(he(40));return e._reactRootContainer?(bs(function(){mc(null,null,e,!1,function(){e._reactRootContainer=null,e[mn]=null})}),!0):!1};pr.unstable_batchedUpdates=nf;pr.unstable_renderSubtreeIntoContainer=function(e,t,r,n){if(!pc(r))throw Error(he(200));if(e==null||e._reactInternals===void 0)throw Error(he(38));return mc(e,t,r,!1,n)};pr.version="18.3.1-next-f1338f8080-20240426";function Z0(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Z0)}catch(e){console.error(e)}}Z0(),Zv.exports=pr;var hn=Zv.exports,ey,Im=hn;ey=Im.createRoot,Im.hydrateRoot;const Om=e=>{let t;const r=new Set,n=(c,f)=>{const u=typeof c=="function"?c(t):c;if(!Object.is(u,t)){const p=t;t=f??(typeof u!="object"||u===null)?u:Object.assign({},t,u),r.forEach(_=>_(t,p))}},i=()=>t,s={setState:n,getState:i,getInitialState:()=>o,subscribe:c=>(r.add(c),()=>r.delete(c))},o=t=e(n,i,s);return s},Qb=e=>e?Om(e):Om,Zb=e=>e;function eC(e,t=Zb){const r=gt.useSyncExternalStore(e.subscribe,gt.useCallback(()=>t(e.getState()),[e,t]),gt.useCallback(()=>t(e.getInitialState()),[e,t]));return gt.useDebugValue(r),r}const tC=e=>{const t=Qb(e),r=n=>eC(t,n);return Object.assign(r,t),r},df=e=>tC;function gc(e,t){let r;try{r=e()}catch{return}return{getItem:i=>{var a;const l=o=>o===null?null:JSON.parse(o,void 0),s=(a=r.getItem(i))!=null?a:null;return s instanceof Promise?s.then(l):l(s)},setItem:(i,a)=>r.setItem(i,JSON.stringify(a,void 0)),removeItem:i=>r.removeItem(i)}}const Lh=e=>t=>{try{const r=e(t);return r instanceof Promise?r:{then(n){return Lh(n)(r)},catch(n){return this}}}catch(r){return{then(n){return this},catch(n){return Lh(n)(r)}}}},rC=(e,t)=>(r,n,i)=>{let a={storage:gc(()=>localStorage),partialize:v=>v,version:0,merge:(v,h)=>({...h,...v}),...t},l=!1;const s=new Set,o=new Set;let c=a.storage;if(!c)return e((...v)=>{console.warn(`[zustand persist middleware] Unable to update item '${a.name}', the given storage is currently unavailable.`),r(...v)},n,i);const f=()=>{const v=a.partialize({...n()});return c.setItem(a.name,{state:v,version:a.version})},u=i.setState;i.setState=(v,h)=>(u(v,h),f());const p=e((...v)=>(r(...v),f()),n,i);i.getInitialState=()=>p;let _;const y=()=>{var v,h;if(!c)return;l=!1,s.forEach(d=>{var g;return d((g=n())!=null?g:p)});const m=((h=a.onRehydrateStorage)==null?void 0:h.call(a,(v=n())!=null?v:p))||void 0;return Lh(c.getItem.bind(c))(a.name).then(d=>{if(d)if(typeof d.version=="number"&&d.version!==a.version){if(a.migrate){const g=a.migrate(d.state,d.version);return g instanceof Promise?g.then(w=>[!0,w]):[!0,g]}console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return[!1,d.state];return[!1,void 0]}).then(d=>{var g;const[w,b]=d;if(_=a.merge(b,(g=n())!=null?g:p),r(_,!0),w)return f()}).then(()=>{m==null||m(_,void 0),_=n(),l=!0,o.forEach(d=>d(_))}).catch(d=>{m==null||m(void 0,d)})};return i.persist={setOptions:v=>{a={...a,...v},v.storage&&(c=v.storage)},clearStorage:()=>{c==null||c.removeItem(a.name)},getOptions:()=>a,rehydrate:()=>y(),hasHydrated:()=>l,onHydrate:v=>(s.add(v),()=>{s.delete(v)}),onFinishHydration:v=>(o.add(v),()=>{o.delete(v)})},a.skipHydration||y(),_||p},ff=rC;function nC(){const e=new Map;return{getItem:t=>e.get(t)??null,setItem:(t,r)=>{e.set(t,r)},removeItem:t=>{e.delete(t)}}}const Ps=nC(),lo={getItem:e=>{if(typeof localStorage>"u")return Ps.getItem(e);try{return localStorage.getItem(e)}catch{return Ps.getItem(e)}},setItem:(e,t)=>{if(typeof localStorage>"u"){Ps.setItem(e,t);return}try{localStorage.setItem(e,t)}catch{Ps.setItem(e,t)}},removeItem:e=>{if(typeof localStorage>"u"){Ps.removeItem(e);return}try{localStorage.removeItem(e)}catch{Ps.removeItem(e)}}};function sC(e){const t=new Map;let r=!1;const n=i=>{var a;(a=globalThis.Bun)==null||a.main};return{getItem(i){if(n(),r)return t.get(i)??null;r=!0;const a=lo.getItem(i);return a!==null&&t.set(i,a),a},setItem(i,a){n(),t.set(i,a),lo.setItem(i,a)},removeItem(i){n(),t.delete(i),lo.removeItem(i)}}}const Th="~/Documents/GitHub",iC="claude",si=50,oC=typeof navigator<"u"&&/^((?!chrome|android).)*safari/i.test(navigator.userAgent)&&!/iPhone|iPad|iPod/.test(navigator.userAgent),aC=!(oC&&(typeof devicePixelRatio<"u"?devicePixelRatio:1)>1),Rh=[{id:"jetbrains-mono",label:"JetBrains Mono",family:'"JetBrains Mono Variable", "JetBrains Mono", "SF Mono", "Fira Code", ui-monospace, monospace'},{id:"system",label:"System Default",family:'ui-monospace, "SF Mono", Menlo, Monaco, "Cascadia Code", "Consolas", monospace'},{id:"custom",label:"Custom",family:""}];function lC(e,t){if(e==="custom"&&t.trim())return t.trim();const r=Rh.find(n=>n.id===e);return(r==null?void 0:r.family)||Rh[0].family}const La=[{id:"claude",label:"Claude",command:"claude",isBuiltIn:!0,agentType:"claude"},{id:"codex",label:"Codex",command:"codex",isBuiltIn:!0,agentType:"codex"},{id:"pi",label:"Pi",command:"pi",isBuiltIn:!0,agentType:"pi"}];function cC(e){if(typeof e!="object"||e===null)return!1;const t=e;return typeof t.id=="string"&&t.id.length>=1&&t.id.length<=128&&typeof t.label=="string"&&t.label.trim().length>=1&&t.label.length<=64&&typeof t.command=="string"&&t.command.trim().length>=1&&t.command.length<=1024&&typeof t.isBuiltIn=="boolean"&&(t.agentType===void 0||t.agentType==="claude"||t.agentType==="codex"||t.agentType==="pi")}function Bm(e){return{...e,label:e.label.trim().slice(0,64),command:e.command.trim().slice(0,1024)}}function Hi(e){return e.command.trim()}function Nm(e){for(let r=0;r<100;r++){const n=`custom-${Date.now()}-${Math.random().toString(36).slice(2,6)}`;if(!e.has(n))return n}return`custom-${Date.now()}-${Math.random().toString(36).slice(2)}`}function jm(e,t){var r;return e.some(n=>n.id===t)?t:((r=e[0])==null?void 0:r.id)||"claude"}const ty=180,ry=400,uC=240,me=df()(ff((e,t)=>({defaultProjectDir:Th,setDefaultProjectDir:r=>e({defaultProjectDir:r}),defaultCommand:iC,setDefaultCommand:r=>e({defaultCommand:r}),lastProjectPath:null,setLastProjectPath:r=>e({lastProjectPath:r}),recentPaths:[],addRecentPath:r=>e(n=>({recentPaths:[r,...n.recentPaths.filter(i=>i!==r)].slice(0,5)})),sessionSortMode:"created",setSessionSortMode:r=>e({sessionSortMode:r}),sessionSortDirection:"desc",setSessionSortDirection:r=>e({sessionSortDirection:r}),manualSessionOrder:[],setManualSessionOrder:r=>e({manualSessionOrder:r}),useWebGL:aC,setUseWebGL:r=>e({useWebGL:r}),fontSize:13,setFontSize:r=>e({fontSize:Math.max(6,Math.min(24,r))}),lineHeight:1,setLineHeight:r=>e({lineHeight:Math.max(1,Math.min(2,r))}),letterSpacing:0,setLetterSpacing:r=>e({letterSpacing:Math.max(-3,Math.min(3,r))}),fontOption:"jetbrains-mono",setFontOption:r=>e({fontOption:r}),customFontFamily:"",setCustomFontFamily:r=>e({customFontFamily:r.slice(0,256)}),shortcutModifier:"auto",setShortcutModifier:r=>e({shortcutModifier:r}),showProjectName:!0,setShowProjectName:r=>e({showProjectName:r}),showLastUserMessage:!0,setShowLastUserMessage:r=>e({showLastUserMessage:r}),showSessionIdPrefix:!1,setShowSessionIdPrefix:r=>e({showSessionIdPrefix:r}),inactiveSessionsExpanded:!1,setInactiveSessionsExpanded:r=>e({inactiveSessionsExpanded:r}),sidebarWidth:uC,setSidebarWidth:r=>e({sidebarWidth:Math.max(ty,Math.min(ry,r))}),projectFilters:[],setProjectFilters:r=>e({projectFilters:r}),hostFilters:[],setHostFilters:r=>e({hostFilters:r}),soundOnPermission:!1,setSoundOnPermission:r=>e({soundOnPermission:r}),soundOnIdle:!1,setSoundOnIdle:r=>e({soundOnIdle:r}),commandPresets:La,setCommandPresets:r=>e({commandPresets:r}),defaultPresetId:"claude",setDefaultPresetId:r=>e({defaultPresetId:r}),updatePresetCommand:(r,n)=>{const{commandPresets:i}=t(),a=i.map(l=>l.id===r?{...l,command:n.trim().slice(0,1024)}:l);e({commandPresets:a})},addPreset:r=>{const{commandPresets:n}=t();if(n.length>=si){console.warn("[agentboard:settings] Max presets reached");return}const i=new Set(n.map(l=>l.id)),a={...Bm({...r,id:"",isBuiltIn:!1}),id:Nm(i),isBuiltIn:!1};e({commandPresets:[...n,a]})},removePreset:r=>{const{commandPresets:n,defaultPresetId:i}=t(),a=n.find(o=>o.id===r);if(!a||a.isBuiltIn)return;const l=n.filter(o=>o.id!==r),s=r===i?jm(l,i):i;e({commandPresets:l,defaultPresetId:s})}}),{name:"agentboard-settings",storage:gc(()=>lo),version:4,partialize:e=>{const{manualSessionOrder:t,...r}=e;return r},migrate:(e,t)=>{const r=e,n=p=>{if(typeof p.command=="string")return p;const _=typeof p.baseCommand=="string"?p.baseCommand.trim():"",y=typeof p.modifiers=="string"?p.modifiers.trim():"",v=y?`${_} ${y}`:_;return{id:p.id,label:p.label,command:v||"claude",isBuiltIn:p.isBuiltIn,agentType:p.agentType}};if(t===0||!Array.isArray(r.commandPresets)){const p=typeof r.defaultCommand=="string"?r.defaultCommand:"claude",_=[...La];let y="claude";if(p==="codex")y="codex";else if(p!=="claude"){const v=new Set(_.map(m=>m.id)),h={id:Nm(v),label:"Migrated",command:p,isBuiltIn:!1};_.push(h),y=h.id}return console.info("[agentboard:settings] Migrated from v0 to v2"),{...r,commandPresets:_,defaultPresetId:y,defaultCommand:p,recentPaths:[]}}const l=r.commandPresets.map(n).filter(cC);if(!(l.some(p=>p.id==="claude")&&l.some(p=>p.id==="codex"))||l.length===0)return console.warn("[agentboard:settings] Invalid presets, resetting to defaults"),{...r,commandPresets:La,defaultPresetId:"claude"};const o=l.length>si?[...l.filter(p=>p.isBuiltIn),...l.filter(p=>!p.isBuiltIn).slice(0,si-2)]:l,c=new Set(o.map(p=>p.id)),f=La.filter(p=>p.isBuiltIn&&!c.has(p.id)),u=[...o,...f];return t<4&&console.info(`[agentboard:settings] Migrated from v${t} to v4 (ensured all built-in presets)`),{...r,commandPresets:u.map(Bm),defaultPresetId:jm(o,r.defaultPresetId)}}}));function hC(){const[e,t]=E.useState(me.persist.hasHydrated());return E.useEffect(()=>{const r=me.persist.onFinishHydration(()=>t(!0));return me.persist.hasHydrated()&&t(!0),r},[]),e}function dC({title:e,titleId:t,...r},n){return E.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true",ref:n,"aria-labelledby":t},r),e?E.createElement("title",{id:t},e):null,E.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 9v4m0 4h.01M10.615 3.892L2.39 18.098c-.456.788-.684 1.182-.65 1.506a1 1 0 00.406.705c.263.191.718.191 1.629.191h16.45c.91 0 1.365 0 1.628-.191a1 1 0 00.407-.705c.034-.324-.195-.718-.65-1.506L13.383 3.892c-.454-.785-.681-1.178-.978-1.31a1 1 0 00-.813 0c-.296.132-.523.525-.978 1.31z"}))}const fC=E.forwardRef(dC);function pC({title:e,titleId:t,...r},n){return E.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true",ref:n,"aria-labelledby":t},r),e?E.createElement("title",{id:t},e):null,E.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 9l6 6 6-6"}))}const pf=E.forwardRef(pC);function mC({title:e,titleId:t,...r},n){return E.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true",ref:n,"aria-labelledby":t},r),e?E.createElement("title",{id:t},e):null,E.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 18l6-6-6-6"}))}const gC=E.forwardRef(mC);function vC({title:e,titleId:t,...r},n){return E.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true",ref:n,"aria-labelledby":t},r),e?E.createElement("title",{id:t},e):null,E.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 15c-.932 0-1.398 0-1.765-.152a2 2 0 01-1.083-1.083C2 13.398 2 12.932 2 12V5.2c0-1.12 0-1.68.218-2.108a2 2 0 01.874-.874C3.52 2 4.08 2 5.2 2H12c.932 0 1.398 0 1.765.152a2 2 0 011.083 1.083C15 3.602 15 4.068 15 5m-2.8 17h6.6c1.12 0 1.68 0 2.108-.218a2 2 0 00.874-.874C22 20.48 22 19.92 22 18.8v-6.6c0-1.12 0-1.68-.218-2.108a2 2 0 00-.874-.874C20.48 9 19.92 9 18.8 9h-6.6c-1.12 0-1.68 0-2.108.218a2 2 0 00-.874.874C9 10.52 9 11.08 9 12.2v6.6c0 1.12 0 1.68.218 2.108a2 2 0 00.874.874C10.52 22 11.08 22 12.2 22z"}))}const ny=E.forwardRef(vC);function _C({title:e,titleId:t,...r},n){return E.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true",ref:n,"aria-labelledby":t},r),e?E.createElement("title",{id:t},e):null,E.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M20 4v1.4c0 3.36 0 5.04-.654 6.324a6 6 0 01-2.622 2.622C15.44 15 13.76 15 10.4 15H4m0 0l5-5m-5 5l5 5"}))}const yC=E.forwardRef(_C);function wC({title:e,titleId:t,...r},n){return E.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true",ref:n,"aria-labelledby":t},r),e?E.createElement("title",{id:t},e):null,E.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 13a1 1 0 100-2 1 1 0 000 2zM12 6a1 1 0 100-2 1 1 0 000 2zM12 20a1 1 0 100-2 1 1 0 000 2z"}))}const SC=E.forwardRef(wC);function xC({title:e,titleId:t,...r},n){return E.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true",ref:n,"aria-labelledby":t},r),e?E.createElement("title",{id:t},e):null,E.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M11 4H6.8c-1.68 0-2.52 0-3.162.327a3 3 0 00-1.311 1.311C2 6.28 2 7.12 2 8.8v8.4c0 1.68 0 2.52.327 3.162a3 3 0 001.311 1.311C4.28 22 5.12 22 6.8 22h8.4c1.68 0 2.52 0 3.162-.327a3 3 0 001.311-1.311C20 19.72 20 18.88 20 17.2V13M8 16h1.675c.489 0 .733 0 .963-.055.204-.05.4-.13.579-.24.201-.123.374-.296.72-.642L21.5 5.5a2.121 2.121 0 00-3-3l-9.563 9.563c-.346.346-.519.519-.642.72a2 2 0 00-.24.579c-.055.23-.055.474-.055.963V16z"}))}const sy=E.forwardRef(xC);function bC({title:e,titleId:t,...r},n){return E.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true",ref:n,"aria-labelledby":t},r),e?E.createElement("title",{id:t},e):null,E.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M14 2.27V6.4c0 .56 0 .84.109 1.054a1 1 0 00.437.437c.214.11.494.11 1.054.11h4.13M16 13H8m8 4H8m2-8H8m6-7H8.8c-1.68 0-2.52 0-3.162.327a3 3 0 00-1.311 1.311C4 4.28 4 5.12 4 6.8v10.4c0 1.68 0 2.52.327 3.162a3 3 0 001.311 1.311C6.28 22 7.12 22 8.8 22h6.4c1.68 0 2.52 0 3.162-.327a3 3 0 001.311-1.311C20 19.72 20 18.88 20 17.2V8l-6-6z"}))}const iy=E.forwardRef(bC);function CC({title:e,titleId:t,...r},n){return E.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true",ref:n,"aria-labelledby":t},r),e?E.createElement("title",{id:t},e):null,E.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M13 7l-1.116-2.231c-.32-.642-.481-.963-.72-1.198a2 2 0 00-.748-.462C10.1 3 9.74 3 9.022 3H5.2c-1.12 0-1.68 0-2.108.218a2 2 0 00-.874.874C2 4.52 2 5.08 2 6.2V7m0 0h15.2c1.68 0 2.52 0 3.162.327a3 3 0 011.311 1.311C22 9.28 22 10.12 22 11.8v4.4c0 1.68 0 2.52-.327 3.162a3 3 0 01-1.311 1.311C19.72 21 18.88 21 17.2 21H6.8c-1.68 0-2.52 0-3.162-.327a3 3 0 01-1.311-1.311C2 18.72 2 17.88 2 16.2V7z"}))}const EC=E.forwardRef(CC);function kC({title:e,titleId:t,...r},n){return E.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true",ref:n,"aria-labelledby":t},r),e?E.createElement("title",{id:t},e):null,E.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6.9 11.444v2.778m0-2.778V4.778c0-.92.761-1.667 1.7-1.667s1.7.746 1.7 1.667m-3.4 6.666c0-.92-.761-1.666-1.7-1.666s-1.7.746-1.7 1.666v2.223C3.5 18.269 7.306 22 12 22s8.5-3.731 8.5-8.333V8.11c0-.92-.761-1.667-1.7-1.667s-1.7.747-1.7 1.667m-6.8-3.333v6.11m0-6.11V3.667C10.3 2.747 11.061 2 12 2s1.7.746 1.7 1.667v1.11m0 0v6.112m0-6.111c0-.92.761-1.667 1.7-1.667s1.7.746 1.7 1.667V8.11m0 0v2.778"}))}const LC=E.forwardRef(kC);function TC({title:e,titleId:t,...r},n){return E.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true",ref:n,"aria-labelledby":t},r),e?E.createElement("title",{id:t},e):null,E.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3 12h18M3 6h18M3 18h18"}))}const RC=E.forwardRef(TC);function DC({title:e,titleId:t,...r},n){return E.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true",ref:n,"aria-labelledby":t},r),e?E.createElement("title",{id:t},e):null,E.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 9l-3 3m0 0l3 3m-3-3h20M9 5l3-3m0 0l3 3m-3-3v20m3-3l-3 3m0 0l-3-3M19 9l3 3m0 0l-3 3"}))}const MC=E.forwardRef(DC);function AC({title:e,titleId:t,...r},n){return E.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true",ref:n,"aria-labelledby":t},r),e?E.createElement("title",{id:t},e):null,E.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M8.377 15.616L2.72 21.273m8.974-14.631l-1.56 1.56a2.1 2.1 0 01-.264.242 1 1 0 01-.207.111c-.082.032-.17.05-.347.085l-3.665.733c-.952.19-1.428.286-1.65.537a1 1 0 00-.243.8c.046.333.39.677 1.076 1.363l7.086 7.086c.686.687 1.03 1.03 1.362 1.076a1 1 0 00.801-.242c.251-.223.346-.7.537-1.651l.733-3.665c.035-.176.053-.265.085-.347a.997.997 0 01.11-.207c.051-.072.115-.136.242-.263l1.561-1.561c.082-.082.122-.122.167-.158.04-.031.082-.06.126-.085.05-.029.103-.051.208-.097l2.495-1.069c.727-.312 1.091-.467 1.256-.72a1 1 0 00.144-.747c-.06-.295-.34-.575-.9-1.135l-5.142-5.143c-.56-.56-.84-.84-1.135-.9a1 1 0 00-.748.145c-.252.165-.407.529-.72 1.256l-1.068 2.495a2.096 2.096 0 01-.097.208.998.998 0 01-.085.126 2.065 2.065 0 01-.158.167z"}))}const Ol=E.forwardRef(AC);function PC({title:e,titleId:t,...r},n){return E.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true",ref:n,"aria-labelledby":t},r),e?E.createElement("title",{id:t},e):null,E.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 5v14m-7-7h14"}))}const oy=E.forwardRef(PC);function IC({title:e,titleId:t,...r},n){return E.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true",ref:n,"aria-labelledby":t},r),e?E.createElement("title",{id:t},e):null,E.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 15a3 3 0 100-6 3 3 0 000 6z"}),E.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M18.727 14.727a1.5 1.5 0 00.3 1.655l.055.054a1.816 1.816 0 010 2.573 1.818 1.818 0 01-2.573 0l-.055-.055a1.5 1.5 0 00-1.654-.3 1.5 1.5 0 00-.91 1.373v.155a1.818 1.818 0 11-3.636 0V20.1a1.5 1.5 0 00-.981-1.373 1.5 1.5 0 00-1.655.3l-.054.055a1.818 1.818 0 01-3.106-1.287 1.818 1.818 0 01.533-1.286l.054-.055a1.5 1.5 0 00.3-1.654 1.5 1.5 0 00-1.372-.91h-.155a1.818 1.818 0 110-3.636H3.9a1.5 1.5 0 001.373-.981 1.5 1.5 0 00-.3-1.655l-.055-.054A1.818 1.818 0 117.491 4.99l.054.054a1.5 1.5 0 001.655.3h.073a1.5 1.5 0 00.909-1.372v-.155a1.818 1.818 0 013.636 0V3.9a1.499 1.499 0 00.91 1.373 1.5 1.5 0 001.654-.3l.054-.055a1.817 1.817 0 012.573 0 1.819 1.819 0 010 2.573l-.055.054a1.5 1.5 0 00-.3 1.655v.073a1.5 1.5 0 001.373.909h.155a1.818 1.818 0 010 3.636H20.1a1.499 1.499 0 00-1.373.91z"}))}const OC=E.forwardRef(IC);function BC({title:e,titleId:t,...r},n){return E.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true",ref:n,"aria-labelledby":t},r),e?E.createElement("title",{id:t},e):null,E.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 15a3 3 0 100-6 3 3 0 000 6z"}),E.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9.29 19.371l.584 1.315a2.213 2.213 0 004.044 0l.585-1.315a2.426 2.426 0 012.47-1.423l1.43.152a2.212 2.212 0 002.022-3.502l-.847-1.164a2.428 2.428 0 01-.46-1.434c0-.513.163-1.014.465-1.429l.847-1.163a2.212 2.212 0 00-2.023-3.502l-1.43.152a2.433 2.433 0 01-1.47-.312 2.425 2.425 0 01-1-1.117l-.588-1.315a2.212 2.212 0 00-4.045 0L9.29 4.63c-.207.468-.558.86-1 1.117-.445.256-.96.365-1.47.312l-1.435-.152a2.212 2.212 0 00-2.022 3.502l.847 1.163a2.43 2.43 0 010 2.858l-.847 1.163a2.21 2.21 0 00.786 3.273c.381.195.81.274 1.236.23l1.43-.153a2.434 2.434 0 012.475 1.43z"}))}const NC=E.forwardRef(BC);function jC({title:e,titleId:t,...r},n){return E.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true",ref:n,"aria-labelledby":t},r),e?E.createElement("title",{id:t},e):null,E.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4 17l6-6-6-6m8 14h8"}))}const FC=E.forwardRef(jC);function HC({title:e,titleId:t,...r},n){return E.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true",ref:n,"aria-labelledby":t},r),e?E.createElement("title",{id:t},e):null,E.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M18 6L6 18M6 6l12 12"}))}const Dh=E.forwardRef(HC);function Zo(){if(typeof navigator>"u")return!1;const e=navigator.userAgent,t=/iPad|iPhone|iPod/.test(e),r=navigator.platform==="MacIntel"&&navigator.maxTouchPoints>1;return t||r}function $C(){return typeof navigator>"u"?!1:Zo()&&navigator.standalone===!0}function zC(){return typeof navigator>"u"?!1:navigator.platform.toUpperCase().indexOf("MAC")>=0}function ea(e){return e==="auto"?zC()?"ctrl-option":"ctrl-shift":e}const UC={"ctrl-option":"⌃⌥","ctrl-shift":"⌃⇧","cmd-option":"⌘⌥","cmd-shift":"⌘⇧"};function ii(e){return UC[e]}function WC(e,t){switch(t){case"ctrl-option":return e.ctrlKey&&e.altKey&&!e.metaKey&&!e.shiftKey;case"ctrl-shift":return e.ctrlKey&&e.shiftKey&&!e.metaKey&&!e.altKey;case"cmd-option":return e.metaKey&&e.altKey&&!e.ctrlKey&&!e.shiftKey;case"cmd-shift":return e.metaKey&&e.shiftKey&&!e.ctrlKey&&!e.altKey}}const VC={connected:"bg-working",connecting:"bg-approval",reconnecting:"bg-approval",disconnected:"bg-danger"};function KC({connectionStatus:e,onNewSession:t,onOpenSettings:r,tailscaleIp:n}){const[i,a]=E.useState(!1),l=me(c=>c.shortcutModifier),s=ii(ea(l)),o=()=>{if(!n)return;const c=`http://${n}:${window.location.port||"4040"}`;navigator.clipboard.writeText(c),a(!0),setTimeout(()=>a(!1),1500)};return T.jsxs("header",{className:"flex h-10 shrink-0 items-center justify-between border-b border-border bg-elevated px-3",children:[T.jsxs("div",{className:"flex items-center gap-2",children:[T.jsx("h1",{className:"text-sm font-semibold tracking-tight text-primary text-balance",children:"AGENTBOARD"}),T.jsxs("div",{className:"flex items-center gap-1.5 text-xs text-muted",children:[T.jsx("span",{className:`h-2 w-2 rounded-full ${VC[e]}`}),n&&T.jsxs("button",{onClick:o,className:"ml-3 inline-flex items-center gap-1 text-muted/70 hover:text-muted transition-colors cursor-pointer",title:"Tailscale IP - click to copy remote access URL",children:[T.jsx("span",{className:"leading-none translate-y-[1px]",children:i?"Copied!":n}),!i&&T.jsx(ny,{width:12,height:12,className:"shrink-0"})]})]})]}),T.jsxs("div",{className:"flex items-center gap-1.5",children:[T.jsx("button",{onClick:t,className:"flex h-7 w-7 items-center justify-center rounded bg-accent text-white hover:bg-accent/90 active:scale-95 transition-all",title:`New session (${s}N)`,"aria-label":"New session",children:T.jsx(oy,{width:16,height:16})}),T.jsx("button",{onClick:r,className:"flex h-7 w-7 items-center justify-center rounded border border-border text-secondary hover:bg-hover hover:text-primary active:scale-95 transition-all",title:"Settings","aria-label":"Settings",children:T.jsx(NC,{width:14,height:14})})]})]})}const mf=E.createContext({});function gf(e){const t=E.useRef(null);return t.current===null&&(t.current=e()),t.current}const vf=typeof window<"u",ay=vf?E.useLayoutEffect:E.useEffect,vc=E.createContext(null);function _f(e,t){e.indexOf(t)===-1&&e.push(t)}function yf(e,t){const r=e.indexOf(t);r>-1&&e.splice(r,1)}const Gr=(e,t,r)=>r>t?t:r<e?e:r;let wf=()=>{};const _n={},ly=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e);function cy(e){return typeof e=="object"&&e!==null}const uy=e=>/^0[^.\s]+$/u.test(e);function Sf(e){let t;return()=>(t===void 0&&(t=e()),t)}const br=e=>e,GC=(e,t)=>r=>t(e(r)),ta=(...e)=>e.reduce(GC),Bo=(e,t,r)=>{const n=t-e;return n===0?1:(r-e)/n};class xf{constructor(){this.subscriptions=[]}add(t){return _f(this.subscriptions,t),()=>yf(this.subscriptions,t)}notify(t,r,n){const i=this.subscriptions.length;if(i)if(i===1)this.subscriptions[0](t,r,n);else for(let a=0;a<i;a++){const l=this.subscriptions[a];l&&l(t,r,n)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const fn=e=>e*1e3,Sr=e=>e/1e3;function hy(e,t){return t?e*(1e3/t):0}const dy=(e,t,r)=>(((1-3*r+3*t)*e+(3*r-6*t))*e+3*t)*e,qC=1e-7,XC=12;function YC(e,t,r,n,i){let a,l,s=0;do l=t+(r-t)/2,a=dy(l,n,i)-e,a>0?r=l:t=l;while(Math.abs(a)>qC&&++s<XC);return l}function ra(e,t,r,n){if(e===t&&r===n)return br;const i=a=>YC(a,0,1,e,r);return a=>a===0||a===1?a:dy(i(a),t,n)}const fy=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,py=e=>t=>1-e(1-t),my=ra(.33,1.53,.69,.99),bf=py(my),gy=fy(bf),vy=e=>(e*=2)<1?.5*bf(e):.5*(2-Math.pow(2,-10*(e-1))),Cf=e=>1-Math.sin(Math.acos(e)),_y=py(Cf),yy=fy(Cf),JC=ra(.42,0,1,1),QC=ra(0,0,.58,1),wy=ra(.42,0,.58,1),ZC=e=>Array.isArray(e)&&typeof e[0]!="number",Sy=e=>Array.isArray(e)&&typeof e[0]=="number",e2={linear:br,easeIn:JC,easeInOut:wy,easeOut:QC,circIn:Cf,circInOut:yy,circOut:_y,backIn:bf,backInOut:gy,backOut:my,anticipate:vy},t2=e=>typeof e=="string",Fm=e=>{if(Sy(e)){wf(e.length===4);const[t,r,n,i]=e;return ra(t,r,n,i)}else if(t2(e))return e2[e];return e},Ta=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function r2(e,t){let r=new Set,n=new Set,i=!1,a=!1;const l=new WeakSet;let s={delta:0,timestamp:0,isProcessing:!1};function o(f){l.has(f)&&(c.schedule(f),e()),f(s)}const c={schedule:(f,u=!1,p=!1)=>{const y=p&&i?r:n;return u&&l.add(f),y.has(f)||y.add(f),f},cancel:f=>{n.delete(f),l.delete(f)},process:f=>{if(s=f,i){a=!0;return}i=!0,[r,n]=[n,r],r.forEach(o),r.clear(),i=!1,a&&(a=!1,c.process(f))}};return c}const n2=40;function xy(e,t){let r=!1,n=!0;const i={delta:0,timestamp:0,isProcessing:!1},a=()=>r=!0,l=Ta.reduce((g,w)=>(g[w]=r2(a),g),{}),{setup:s,read:o,resolveKeyframes:c,preUpdate:f,update:u,preRender:p,render:_,postRender:y}=l,v=()=>{const g=_n.useManualTiming?i.timestamp:performance.now();r=!1,_n.useManualTiming||(i.delta=n?1e3/60:Math.max(Math.min(g-i.timestamp,n2),1)),i.timestamp=g,i.isProcessing=!0,s.process(i),o.process(i),c.process(i),f.process(i),u.process(i),p.process(i),_.process(i),y.process(i),i.isProcessing=!1,r&&t&&(n=!1,e(v))},h=()=>{r=!0,n=!0,i.isProcessing||e(v)};return{schedule:Ta.reduce((g,w)=>{const b=l[w];return g[w]=(x,C=!1,S=!1)=>(r||h(),b.schedule(x,C,S)),g},{}),cancel:g=>{for(let w=0;w<Ta.length;w++)l[Ta[w]].cancel(g)},state:i,steps:l}}const{schedule:it,cancel:Vn,state:Nt,steps:eu}=xy(typeof requestAnimationFrame<"u"?requestAnimationFrame:br,!0);let rl;function s2(){rl=void 0}const Qt={now:()=>(rl===void 0&&Qt.set(Nt.isProcessing||_n.useManualTiming?Nt.timestamp:performance.now()),rl),set:e=>{rl=e,queueMicrotask(s2)}},by=e=>t=>typeof t=="string"&&t.startsWith(e),Cy=by("--"),i2=by("var(--"),Ef=e=>i2(e)?o2.test(e.split("/*")[0].trim()):!1,o2=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function Hm(e){return typeof e!="string"?!1:e.split("/*")[0].includes("var(--")}const bi={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},No={...bi,transform:e=>Gr(0,1,e)},Ra={...bi,default:1},co=e=>Math.round(e*1e5)/1e5,kf=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function a2(e){return e==null}const l2=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,Lf=(e,t)=>r=>!!(typeof r=="string"&&l2.test(r)&&r.startsWith(e)||t&&!a2(r)&&Object.prototype.hasOwnProperty.call(r,t)),Ey=(e,t,r)=>n=>{if(typeof n!="string")return n;const[i,a,l,s]=n.match(kf);return{[e]:parseFloat(i),[t]:parseFloat(a),[r]:parseFloat(l),alpha:s!==void 0?parseFloat(s):1}},c2=e=>Gr(0,255,e),tu={...bi,transform:e=>Math.round(c2(e))},hs={test:Lf("rgb","red"),parse:Ey("red","green","blue"),transform:({red:e,green:t,blue:r,alpha:n=1})=>"rgba("+tu.transform(e)+", "+tu.transform(t)+", "+tu.transform(r)+", "+co(No.transform(n))+")"};function u2(e){let t="",r="",n="",i="";return e.length>5?(t=e.substring(1,3),r=e.substring(3,5),n=e.substring(5,7),i=e.substring(7,9)):(t=e.substring(1,2),r=e.substring(2,3),n=e.substring(3,4),i=e.substring(4,5),t+=t,r+=r,n+=n,i+=i),{red:parseInt(t,16),green:parseInt(r,16),blue:parseInt(n,16),alpha:i?parseInt(i,16)/255:1}}const Mh={test:Lf("#"),parse:u2,transform:hs.transform},na=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),kn=na("deg"),Kr=na("%"),Se=na("px"),h2=na("vh"),d2=na("vw"),$m={...Kr,parse:e=>Kr.parse(e)/100,transform:e=>Kr.transform(e*100)},Gs={test:Lf("hsl","hue"),parse:Ey("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:r,alpha:n=1})=>"hsla("+Math.round(e)+", "+Kr.transform(co(t))+", "+Kr.transform(co(r))+", "+co(No.transform(n))+")"},mt={test:e=>hs.test(e)||Mh.test(e)||Gs.test(e),parse:e=>hs.test(e)?hs.parse(e):Gs.test(e)?Gs.parse(e):Mh.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?hs.transform(e):Gs.transform(e),getAnimatableNone:e=>{const t=mt.parse(e);return t.alpha=0,mt.transform(t)}},f2=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function p2(e){var t,r;return isNaN(e)&&typeof e=="string"&&(((t=e.match(kf))==null?void 0:t.length)||0)+(((r=e.match(f2))==null?void 0:r.length)||0)>0}const ky="number",Ly="color",m2="var",g2="var(",zm="${}",v2=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function jo(e){const t=e.toString(),r=[],n={color:[],number:[],var:[]},i=[];let a=0;const s=t.replace(v2,o=>(mt.test(o)?(n.color.push(a),i.push(Ly),r.push(mt.parse(o))):o.startsWith(g2)?(n.var.push(a),i.push(m2),r.push(o)):(n.number.push(a),i.push(ky),r.push(parseFloat(o))),++a,zm)).split(zm);return{values:r,split:s,indexes:n,types:i}}function Ty(e){return jo(e).values}function Ry(e){const{split:t,types:r}=jo(e),n=t.length;return i=>{let a="";for(let l=0;l<n;l++)if(a+=t[l],i[l]!==void 0){const s=r[l];s===ky?a+=co(i[l]):s===Ly?a+=mt.transform(i[l]):a+=i[l]}return a}}const _2=e=>typeof e=="number"?0:mt.test(e)?mt.getAnimatableNone(e):e;function y2(e){const t=Ty(e);return Ry(e)(t.map(_2))}const Kn={test:p2,parse:Ty,createTransformer:Ry,getAnimatableNone:y2};function ru(e,t,r){return r<0&&(r+=1),r>1&&(r-=1),r<1/6?e+(t-e)*6*r:r<1/2?t:r<2/3?e+(t-e)*(2/3-r)*6:e}function w2({hue:e,saturation:t,lightness:r,alpha:n}){e/=360,t/=100,r/=100;let i=0,a=0,l=0;if(!t)i=a=l=r;else{const s=r<.5?r*(1+t):r+t-r*t,o=2*r-s;i=ru(o,s,e+1/3),a=ru(o,s,e),l=ru(o,s,e-1/3)}return{red:Math.round(i*255),green:Math.round(a*255),blue:Math.round(l*255),alpha:n}}function Bl(e,t){return r=>r>0?t:e}const lt=(e,t,r)=>e+(t-e)*r,nu=(e,t,r)=>{const n=e*e,i=r*(t*t-n)+n;return i<0?0:Math.sqrt(i)},S2=[Mh,hs,Gs],x2=e=>S2.find(t=>t.test(e));function Um(e){const t=x2(e);if(!t)return!1;let r=t.parse(e);return t===Gs&&(r=w2(r)),r}const Wm=(e,t)=>{const r=Um(e),n=Um(t);if(!r||!n)return Bl(e,t);const i={...r};return a=>(i.red=nu(r.red,n.red,a),i.green=nu(r.green,n.green,a),i.blue=nu(r.blue,n.blue,a),i.alpha=lt(r.alpha,n.alpha,a),hs.transform(i))},Ah=new Set(["none","hidden"]);function b2(e,t){return Ah.has(e)?r=>r<=0?e:t:r=>r>=1?t:e}function C2(e,t){return r=>lt(e,t,r)}function Tf(e){return typeof e=="number"?C2:typeof e=="string"?Ef(e)?Bl:mt.test(e)?Wm:L2:Array.isArray(e)?Dy:typeof e=="object"?mt.test(e)?Wm:E2:Bl}function Dy(e,t){const r=[...e],n=r.length,i=e.map((a,l)=>Tf(a)(a,t[l]));return a=>{for(let l=0;l<n;l++)r[l]=i[l](a);return r}}function E2(e,t){const r={...e,...t},n={};for(const i in r)e[i]!==void 0&&t[i]!==void 0&&(n[i]=Tf(e[i])(e[i],t[i]));return i=>{for(const a in n)r[a]=n[a](i);return r}}function k2(e,t){const r=[],n={color:0,var:0,number:0};for(let i=0;i<t.values.length;i++){const a=t.types[i],l=e.indexes[a][n[a]],s=e.values[l]??0;r[i]=s,n[a]++}return r}const L2=(e,t)=>{const r=Kn.createTransformer(t),n=jo(e),i=jo(t);return n.indexes.var.length===i.indexes.var.length&&n.indexes.color.length===i.indexes.color.length&&n.indexes.number.length>=i.indexes.number.length?Ah.has(e)&&!i.values.length||Ah.has(t)&&!n.values.length?b2(e,t):ta(Dy(k2(n,i),i.values),r):Bl(e,t)};function My(e,t,r){return typeof e=="number"&&typeof t=="number"&&typeof r=="number"?lt(e,t,r):Tf(e)(e,t)}const T2=e=>{const t=({timestamp:r})=>e(r);return{start:(r=!0)=>it.update(t,r),stop:()=>Vn(t),now:()=>Nt.isProcessing?Nt.timestamp:Qt.now()}},Ay=(e,t,r=10)=>{let n="";const i=Math.max(Math.round(t/r),2);for(let a=0;a<i;a++)n+=Math.round(e(a/(i-1))*1e4)/1e4+", ";return`linear(${n.substring(0,n.length-2)})`},Nl=2e4;function Rf(e){let t=0;const r=50;let n=e.next(t);for(;!n.done&&t<Nl;)t+=r,n=e.next(t);return t>=Nl?1/0:t}function R2(e,t=100,r){const n=r({...e,keyframes:[0,t]}),i=Math.min(Rf(n),Nl);return{type:"keyframes",ease:a=>n.next(i*a).value/t,duration:Sr(i)}}const D2=5;function Py(e,t,r){const n=Math.max(t-D2,0);return hy(r-e(n),t-n)}const ht={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1},su=.001;function M2({duration:e=ht.duration,bounce:t=ht.bounce,velocity:r=ht.velocity,mass:n=ht.mass}){let i,a,l=1-t;l=Gr(ht.minDamping,ht.maxDamping,l),e=Gr(ht.minDuration,ht.maxDuration,Sr(e)),l<1?(i=c=>{const f=c*l,u=f*e,p=f-r,_=Ph(c,l),y=Math.exp(-u);return su-p/_*y},a=c=>{const u=c*l*e,p=u*r+r,_=Math.pow(l,2)*Math.pow(c,2)*e,y=Math.exp(-u),v=Ph(Math.pow(c,2),l);return(-i(c)+su>0?-1:1)*((p-_)*y)/v}):(i=c=>{const f=Math.exp(-c*e),u=(c-r)*e+1;return-su+f*u},a=c=>{const f=Math.exp(-c*e),u=(r-c)*(e*e);return f*u});const s=5/e,o=P2(i,a,s);if(e=fn(e),isNaN(o))return{stiffness:ht.stiffness,damping:ht.damping,duration:e};{const c=Math.pow(o,2)*n;return{stiffness:c,damping:l*2*Math.sqrt(n*c),duration:e}}}const A2=12;function P2(e,t,r){let n=r;for(let i=1;i<A2;i++)n=n-e(n)/t(n);return n}function Ph(e,t){return e*Math.sqrt(1-t*t)}const I2=["duration","bounce"],O2=["stiffness","damping","mass"];function Vm(e,t){return t.some(r=>e[r]!==void 0)}function B2(e){let t={velocity:ht.velocity,stiffness:ht.stiffness,damping:ht.damping,mass:ht.mass,isResolvedFromDuration:!1,...e};if(!Vm(e,O2)&&Vm(e,I2))if(e.visualDuration){const r=e.visualDuration,n=2*Math.PI/(r*1.2),i=n*n,a=2*Gr(.05,1,1-(e.bounce||0))*Math.sqrt(i);t={...t,mass:ht.mass,stiffness:i,damping:a}}else{const r=M2(e);t={...t,...r,mass:ht.mass},t.isResolvedFromDuration=!0}return t}function jl(e=ht.visualDuration,t=ht.bounce){const r=typeof e!="object"?{visualDuration:e,keyframes:[0,1],bounce:t}:e;let{restSpeed:n,restDelta:i}=r;const a=r.keyframes[0],l=r.keyframes[r.keyframes.length-1],s={done:!1,value:a},{stiffness:o,damping:c,mass:f,duration:u,velocity:p,isResolvedFromDuration:_}=B2({...r,velocity:-Sr(r.velocity||0)}),y=p||0,v=c/(2*Math.sqrt(o*f)),h=l-a,m=Sr(Math.sqrt(o/f)),d=Math.abs(h)<5;n||(n=d?ht.restSpeed.granular:ht.restSpeed.default),i||(i=d?ht.restDelta.granular:ht.restDelta.default);let g;if(v<1){const b=Ph(m,v);g=x=>{const C=Math.exp(-v*m*x);return l-C*((y+v*m*h)/b*Math.sin(b*x)+h*Math.cos(b*x))}}else if(v===1)g=b=>l-Math.exp(-m*b)*(h+(y+m*h)*b);else{const b=m*Math.sqrt(v*v-1);g=x=>{const C=Math.exp(-v*m*x),S=Math.min(b*x,300);return l-C*((y+v*m*h)*Math.sinh(S)+b*h*Math.cosh(S))/b}}const w={calculatedDuration:_&&u||null,next:b=>{const x=g(b);if(_)s.done=b>=u;else{let C=b===0?y:0;v<1&&(C=b===0?fn(y):Py(g,b,x));const S=Math.abs(C)<=n,k=Math.abs(l-x)<=i;s.done=S&&k}return s.value=s.done?l:x,s},toString:()=>{const b=Math.min(Rf(w),Nl),x=Ay(C=>w.next(b*C).value,b,30);return b+"ms "+x},toTransition:()=>{}};return w}jl.applyToOptions=e=>{const t=R2(e,100,jl);return e.ease=t.ease,e.duration=fn(t.duration),e.type="keyframes",e};function Ih({keyframes:e,velocity:t=0,power:r=.8,timeConstant:n=325,bounceDamping:i=10,bounceStiffness:a=500,modifyTarget:l,min:s,max:o,restDelta:c=.5,restSpeed:f}){const u=e[0],p={done:!1,value:u},_=S=>s!==void 0&&S<s||o!==void 0&&S>o,y=S=>s===void 0?o:o===void 0||Math.abs(s-S)<Math.abs(o-S)?s:o;let v=r*t;const h=u+v,m=l===void 0?h:l(h);m!==h&&(v=m-u);const d=S=>-v*Math.exp(-S/n),g=S=>m+d(S),w=S=>{const k=d(S),L=g(S);p.done=Math.abs(k)<=c,p.value=p.done?m:L};let b,x;const C=S=>{_(p.value)&&(b=S,x=jl({keyframes:[p.value,y(p.value)],velocity:Py(g,S,p.value),damping:i,stiffness:a,restDelta:c,restSpeed:f}))};return C(0),{calculatedDuration:null,next:S=>{let k=!1;return!x&&b===void 0&&(k=!0,w(S),C(S)),b!==void 0&&S>=b?x.next(S-b):(!k&&w(S),p)}}}function N2(e,t,r){const n=[],i=r||_n.mix||My,a=e.length-1;for(let l=0;l<a;l++){let s=i(e[l],e[l+1]);if(t){const o=Array.isArray(t)?t[l]||br:t;s=ta(o,s)}n.push(s)}return n}function j2(e,t,{clamp:r=!0,ease:n,mixer:i}={}){const a=e.length;if(wf(a===t.length),a===1)return()=>t[0];if(a===2&&t[0]===t[1])return()=>t[1];const l=e[0]===e[1];e[0]>e[a-1]&&(e=[...e].reverse(),t=[...t].reverse());const s=N2(t,n,i),o=s.length,c=f=>{if(l&&f<e[0])return t[0];let u=0;if(o>1)for(;u<e.length-2&&!(f<e[u+1]);u++);const p=Bo(e[u],e[u+1],f);return s[u](p)};return r?f=>c(Gr(e[0],e[a-1],f)):c}function F2(e,t){const r=e[e.length-1];for(let n=1;n<=t;n++){const i=Bo(0,t,n);e.push(lt(r,1,i))}}function H2(e){const t=[0];return F2(t,e.length-1),t}function $2(e,t){return e.map(r=>r*t)}function z2(e,t){return e.map(()=>t||wy).splice(0,e.length-1)}function uo({duration:e=300,keyframes:t,times:r,ease:n="easeInOut"}){const i=ZC(n)?n.map(Fm):Fm(n),a={done:!1,value:t[0]},l=$2(r&&r.length===t.length?r:H2(t),e),s=j2(l,t,{ease:Array.isArray(i)?i:z2(t,i)});return{calculatedDuration:e,next:o=>(a.value=s(o),a.done=o>=e,a)}}const U2=e=>e!==null;function Df(e,{repeat:t,repeatType:r="loop"},n,i=1){const a=e.filter(U2),s=i<0||t&&r!=="loop"&&t%2===1?0:a.length-1;return!s||n===void 0?a[s]:n}const W2={decay:Ih,inertia:Ih,tween:uo,keyframes:uo,spring:jl};function Iy(e){typeof e.type=="string"&&(e.type=W2[e.type])}class Mf{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(t=>{this.resolve=t})}notifyFinished(){this.resolve()}then(t,r){return this.finished.then(t,r)}}const V2=e=>e/100;class Af extends Mf{constructor(t){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.stop=()=>{var n,i;const{motionValue:r}=this.options;r&&r.updatedAt!==Qt.now()&&this.tick(Qt.now()),this.isStopped=!0,this.state!=="idle"&&(this.teardown(),(i=(n=this.options).onStop)==null||i.call(n))},this.options=t,this.initAnimation(),this.play(),t.autoplay===!1&&this.pause()}initAnimation(){const{options:t}=this;Iy(t);const{type:r=uo,repeat:n=0,repeatDelay:i=0,repeatType:a,velocity:l=0}=t;let{keyframes:s}=t;const o=r||uo;o!==uo&&typeof s[0]!="number"&&(this.mixKeyframes=ta(V2,My(s[0],s[1])),s=[0,100]);const c=o({...t,keyframes:s});a==="mirror"&&(this.mirroredGenerator=o({...t,keyframes:[...s].reverse(),velocity:-l})),c.calculatedDuration===null&&(c.calculatedDuration=Rf(c));const{calculatedDuration:f}=c;this.calculatedDuration=f,this.resolvedDuration=f+i,this.totalDuration=this.resolvedDuration*(n+1)-i,this.generator=c}updateTime(t){const r=Math.round(t-this.startTime)*this.playbackSpeed;this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=r}tick(t,r=!1){const{generator:n,totalDuration:i,mixKeyframes:a,mirroredGenerator:l,resolvedDuration:s,calculatedDuration:o}=this;if(this.startTime===null)return n.next(0);const{delay:c=0,keyframes:f,repeat:u,repeatType:p,repeatDelay:_,type:y,onUpdate:v,finalKeyframe:h}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-i/this.speed,this.startTime)),r?this.currentTime=t:this.updateTime(t);const m=this.currentTime-c*(this.playbackSpeed>=0?1:-1),d=this.playbackSpeed>=0?m<0:m>i;this.currentTime=Math.max(m,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=i);let g=this.currentTime,w=n;if(u){const S=Math.min(this.currentTime,i)/s;let k=Math.floor(S),L=S%1;!L&&S>=1&&(L=1),L===1&&k--,k=Math.min(k,u+1),!!(k%2)&&(p==="reverse"?(L=1-L,_&&(L-=_/s)):p==="mirror"&&(w=l)),g=Gr(0,1,L)*s}const b=d?{done:!1,value:f[0]}:w.next(g);a&&(b.value=a(b.value));let{done:x}=b;!d&&o!==null&&(x=this.playbackSpeed>=0?this.currentTime>=i:this.currentTime<=0);const C=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&x);return C&&y!==Ih&&(b.value=Df(f,this.options,h,this.speed)),v&&v(b.value),C&&this.finish(),b}then(t,r){return this.finished.then(t,r)}get duration(){return Sr(this.calculatedDuration)}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+Sr(t)}get time(){return Sr(this.currentTime)}set time(t){var r;t=fn(t),this.currentTime=t,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.playbackSpeed),(r=this.driver)==null||r.start(!1)}get speed(){return this.playbackSpeed}set speed(t){this.updateTime(Qt.now());const r=this.playbackSpeed!==t;this.playbackSpeed=t,r&&(this.time=Sr(this.currentTime))}play(){var i,a;if(this.isStopped)return;const{driver:t=T2,startTime:r}=this.options;this.driver||(this.driver=t(l=>this.tick(l))),(a=(i=this.options).onPlay)==null||a.call(i);const n=this.driver.now();this.state==="finished"?(this.updateFinished(),this.startTime=n):this.holdTime!==null?this.startTime=n-this.holdTime:this.startTime||(this.startTime=r??n),this.state==="finished"&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(Qt.now()),this.holdTime=this.currentTime}complete(){this.state!=="running"&&this.play(),this.state="finished",this.holdTime=null}finish(){var t,r;this.notifyFinished(),this.teardown(),this.state="finished",(r=(t=this.options).onComplete)==null||r.call(t)}cancel(){var t,r;this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),(r=(t=this.options).onCancel)==null||r.call(t)}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}attachTimeline(t){var r;return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),(r=this.driver)==null||r.stop(),t.observe(this)}}function K2(e){for(let t=1;t<e.length;t++)e[t]??(e[t]=e[t-1])}const ds=e=>e*180/Math.PI,Oh=e=>{const t=ds(Math.atan2(e[1],e[0]));return Bh(t)},G2={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:Oh,rotateZ:Oh,skewX:e=>ds(Math.atan(e[1])),skewY:e=>ds(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},Bh=e=>(e=e%360,e<0&&(e+=360),e),Km=Oh,Gm=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),qm=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),q2={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:Gm,scaleY:qm,scale:e=>(Gm(e)+qm(e))/2,rotateX:e=>Bh(ds(Math.atan2(e[6],e[5]))),rotateY:e=>Bh(ds(Math.atan2(-e[2],e[0]))),rotateZ:Km,rotate:Km,skewX:e=>ds(Math.atan(e[4])),skewY:e=>ds(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function Nh(e){return e.includes("scale")?1:0}function jh(e,t){if(!e||e==="none")return Nh(t);const r=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let n,i;if(r)n=q2,i=r;else{const s=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);n=G2,i=s}if(!i)return Nh(t);const a=n[t],l=i[1].split(",").map(Y2);return typeof a=="function"?a(l):l[a]}const X2=(e,t)=>{const{transform:r="none"}=getComputedStyle(e);return jh(r,t)};function Y2(e){return parseFloat(e.trim())}const Ci=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Ei=new Set(Ci),Xm=e=>e===bi||e===Se,J2=new Set(["x","y","z"]),Q2=Ci.filter(e=>!J2.has(e));function Z2(e){const t=[];return Q2.forEach(r=>{const n=e.getValue(r);n!==void 0&&(t.push([r,n.get()]),n.set(r.startsWith("scale")?1:0))}),t}const In={width:({x:e},{paddingLeft:t="0",paddingRight:r="0"})=>e.max-e.min-parseFloat(t)-parseFloat(r),height:({y:e},{paddingTop:t="0",paddingBottom:r="0"})=>e.max-e.min-parseFloat(t)-parseFloat(r),top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:(e,{transform:t})=>jh(t,"x"),y:(e,{transform:t})=>jh(t,"y")};In.translateX=In.x;In.translateY=In.y;const vs=new Set;let Fh=!1,Hh=!1,$h=!1;function Oy(){if(Hh){const e=Array.from(vs).filter(n=>n.needsMeasurement),t=new Set(e.map(n=>n.element)),r=new Map;t.forEach(n=>{const i=Z2(n);i.length&&(r.set(n,i),n.render())}),e.forEach(n=>n.measureInitialState()),t.forEach(n=>{n.render();const i=r.get(n);i&&i.forEach(([a,l])=>{var s;(s=n.getValue(a))==null||s.set(l)})}),e.forEach(n=>n.measureEndState()),e.forEach(n=>{n.suspendedScrollY!==void 0&&window.scrollTo(0,n.suspendedScrollY)})}Hh=!1,Fh=!1,vs.forEach(e=>e.complete($h)),vs.clear()}function By(){vs.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(Hh=!0)})}function e5(){$h=!0,By(),Oy(),$h=!1}class Pf{constructor(t,r,n,i,a,l=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...t],this.onComplete=r,this.name=n,this.motionValue=i,this.element=a,this.isAsync=l}scheduleResolve(){this.state="scheduled",this.isAsync?(vs.add(this),Fh||(Fh=!0,it.read(By),it.resolveKeyframes(Oy))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:r,element:n,motionValue:i}=this;if(t[0]===null){const a=i==null?void 0:i.get(),l=t[t.length-1];if(a!==void 0)t[0]=a;else if(n&&r){const s=n.readValue(r,l);s!=null&&(t[0]=s)}t[0]===void 0&&(t[0]=l),i&&a===void 0&&i.set(t[0])}K2(t)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(t=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,t),vs.delete(this)}cancel(){this.state==="scheduled"&&(vs.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const t5=e=>e.startsWith("--");function r5(e,t,r){t5(t)?e.style.setProperty(t,r):e.style[t]=r}const n5=Sf(()=>window.ScrollTimeline!==void 0),s5={};function i5(e,t){const r=Sf(e);return()=>s5[t]??r()}const Ny=i5(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),Xi=([e,t,r,n])=>`cubic-bezier(${e}, ${t}, ${r}, ${n})`,Ym={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Xi([0,.65,.55,1]),circOut:Xi([.55,0,1,.45]),backIn:Xi([.31,.01,.66,-.59]),backOut:Xi([.33,1.53,.69,.99])};function jy(e,t){if(e)return typeof e=="function"?Ny()?Ay(e,t):"ease-out":Sy(e)?Xi(e):Array.isArray(e)?e.map(r=>jy(r,t)||Ym.easeOut):Ym[e]}function o5(e,t,r,{delay:n=0,duration:i=300,repeat:a=0,repeatType:l="loop",ease:s="easeOut",times:o}={},c=void 0){const f={[t]:r};o&&(f.offset=o);const u=jy(s,i);Array.isArray(u)&&(f.easing=u);const p={delay:n,duration:i,easing:Array.isArray(u)?"linear":u,fill:"both",iterations:a+1,direction:l==="reverse"?"alternate":"normal"};return c&&(p.pseudoElement=c),e.animate(f,p)}function Fy(e){return typeof e=="function"&&"applyToOptions"in e}function a5({type:e,...t}){return Fy(e)&&Ny()?e.applyToOptions(t):(t.duration??(t.duration=300),t.ease??(t.ease="easeOut"),t)}class l5 extends Mf{constructor(t){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!t)return;const{element:r,name:n,keyframes:i,pseudoElement:a,allowFlatten:l=!1,finalKeyframe:s,onComplete:o}=t;this.isPseudoElement=!!a,this.allowFlatten=l,this.options=t,wf(typeof t.type!="string");const c=a5(t);this.animation=o5(r,n,i,c,a),c.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!a){const f=Df(i,this.options,s,this.speed);this.updateMotionValue?this.updateMotionValue(f):r5(r,n,f),this.animation.cancel()}o==null||o(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),this.state==="finished"&&this.updateFinished())}pause(){this.animation.pause()}complete(){var t,r;(r=(t=this.animation).finish)==null||r.call(t)}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:t}=this;t==="idle"||t==="finished"||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){var t,r;this.isPseudoElement||(r=(t=this.animation).commitStyles)==null||r.call(t)}get duration(){var r,n;const t=((n=(r=this.animation.effect)==null?void 0:r.getComputedTiming)==null?void 0:n.call(r).duration)||0;return Sr(Number(t))}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+Sr(t)}get time(){return Sr(Number(this.animation.currentTime)||0)}set time(t){this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=fn(t)}get speed(){return this.animation.playbackRate}set speed(t){t<0&&(this.finishedTime=null),this.animation.playbackRate=t}get state(){return this.finishedTime!==null?"finished":this.animation.playState}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(t){this.manualStartTime=this.animation.startTime=t}attachTimeline({timeline:t,observe:r}){var n;return this.allowFlatten&&((n=this.animation.effect)==null||n.updateTiming({easing:"linear"})),this.animation.onfinish=null,t&&n5()?(this.animation.timeline=t,br):r(this)}}const Hy={anticipate:vy,backInOut:gy,circInOut:yy};function c5(e){return e in Hy}function u5(e){typeof e.ease=="string"&&c5(e.ease)&&(e.ease=Hy[e.ease])}const iu=10;class h5 extends l5{constructor(t){u5(t),Iy(t),super(t),t.startTime!==void 0&&(this.startTime=t.startTime),this.options=t}updateMotionValue(t){const{motionValue:r,onUpdate:n,onComplete:i,element:a,...l}=this.options;if(!r)return;if(t!==void 0){r.set(t);return}const s=new Af({...l,autoplay:!1}),o=Math.max(iu,Qt.now()-this.startTime),c=Gr(0,iu,o-iu);r.setWithVelocity(s.sample(Math.max(0,o-c)).value,s.sample(o).value,c),s.stop()}}const Jm=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(Kn.test(e)||e==="0")&&!e.startsWith("url("));function d5(e){const t=e[0];if(e.length===1)return!0;for(let r=0;r<e.length;r++)if(e[r]!==t)return!0}function f5(e,t,r,n){const i=e[0];if(i===null)return!1;if(t==="display"||t==="visibility")return!0;const a=e[e.length-1],l=Jm(i,t),s=Jm(a,t);return!l||!s?!1:d5(e)||(r==="spring"||Fy(r))&&n}function zh(e){e.duration=0,e.type="keyframes"}const p5=new Set(["opacity","clipPath","filter","transform"]),m5=Sf(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function g5(e){var f;const{motionValue:t,name:r,repeatDelay:n,repeatType:i,damping:a,type:l}=e;if(!(((f=t==null?void 0:t.owner)==null?void 0:f.current)instanceof HTMLElement))return!1;const{onUpdate:o,transformTemplate:c}=t.owner.getProps();return m5()&&r&&p5.has(r)&&(r!=="transform"||!c)&&!o&&!n&&i!=="mirror"&&a!==0&&l!=="inertia"}const v5=40;class _5 extends Mf{constructor({autoplay:t=!0,delay:r=0,type:n="keyframes",repeat:i=0,repeatDelay:a=0,repeatType:l="loop",keyframes:s,name:o,motionValue:c,element:f,...u}){var y;super(),this.stop=()=>{var v,h;this._animation&&(this._animation.stop(),(v=this.stopTimeline)==null||v.call(this)),(h=this.keyframeResolver)==null||h.cancel()},this.createdAt=Qt.now();const p={autoplay:t,delay:r,type:n,repeat:i,repeatDelay:a,repeatType:l,name:o,motionValue:c,element:f,...u},_=(f==null?void 0:f.KeyframeResolver)||Pf;this.keyframeResolver=new _(s,(v,h,m)=>this.onKeyframesResolved(v,h,p,!m),o,c,f),(y=this.keyframeResolver)==null||y.scheduleResolve()}onKeyframesResolved(t,r,n,i){this.keyframeResolver=void 0;const{name:a,type:l,velocity:s,delay:o,isHandoff:c,onUpdate:f}=n;this.resolvedAt=Qt.now(),f5(t,a,l,s)||((_n.instantAnimations||!o)&&(f==null||f(Df(t,n,r))),t[0]=t[t.length-1],zh(n),n.repeat=0);const p={startTime:i?this.resolvedAt?this.resolvedAt-this.createdAt>v5?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:r,...n,keyframes:t},_=!c&&g5(p)?new h5({...p,element:p.motionValue.owner.current}):new Af(p);_.finished.then(()=>this.notifyFinished()).catch(br),this.pendingTimeline&&(this.stopTimeline=_.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=_}get finished(){return this._animation?this.animation.finished:this._finished}then(t,r){return this.finished.finally(t).then(()=>{})}get animation(){var t;return this._animation||((t=this.keyframeResolver)==null||t.resume(),e5()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(t){this.animation.time=t}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(t){this.animation.speed=t}get startTime(){return this.animation.startTime}attachTimeline(t){return this._animation?this.stopTimeline=this.animation.attachTimeline(t):this.pendingTimeline=t,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){var t;this._animation&&this.animation.cancel(),(t=this.keyframeResolver)==null||t.cancel()}}const y5=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function w5(e){const t=y5.exec(e);if(!t)return[,];const[,r,n,i]=t;return[`--${r??n}`,i]}function $y(e,t,r=1){const[n,i]=w5(e);if(!n)return;const a=window.getComputedStyle(t).getPropertyValue(n);if(a){const l=a.trim();return ly(l)?parseFloat(l):l}return Ef(i)?$y(i,t,r+1):i}function If(e,t){return(e==null?void 0:e[t])??(e==null?void 0:e.default)??e}const zy=new Set(["width","height","top","left","right","bottom",...Ci]),S5={test:e=>e==="auto",parse:e=>e},Uy=e=>t=>t.test(e),Wy=[bi,Se,Kr,kn,d2,h2,S5],Qm=e=>Wy.find(Uy(e));function x5(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||uy(e):!0}const b5=new Set(["brightness","contrast","saturate","opacity"]);function C5(e){const[t,r]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[n]=r.match(kf)||[];if(!n)return e;const i=r.replace(n,"");let a=b5.has(t)?1:0;return n!==r&&(a*=100),t+"("+a+i+")"}const E5=/\b([a-z-]*)\(.*?\)/gu,Uh={...Kn,getAnimatableNone:e=>{const t=e.match(E5);return t?t.map(C5).join(" "):e}},Zm={...bi,transform:Math.round},k5={rotate:kn,rotateX:kn,rotateY:kn,rotateZ:kn,scale:Ra,scaleX:Ra,scaleY:Ra,scaleZ:Ra,skew:kn,skewX:kn,skewY:kn,distance:Se,translateX:Se,translateY:Se,translateZ:Se,x:Se,y:Se,z:Se,perspective:Se,transformPerspective:Se,opacity:No,originX:$m,originY:$m,originZ:Se},Of={borderWidth:Se,borderTopWidth:Se,borderRightWidth:Se,borderBottomWidth:Se,borderLeftWidth:Se,borderRadius:Se,radius:Se,borderTopLeftRadius:Se,borderTopRightRadius:Se,borderBottomRightRadius:Se,borderBottomLeftRadius:Se,width:Se,maxWidth:Se,height:Se,maxHeight:Se,top:Se,right:Se,bottom:Se,left:Se,inset:Se,insetBlock:Se,insetBlockStart:Se,insetBlockEnd:Se,insetInline:Se,insetInlineStart:Se,insetInlineEnd:Se,padding:Se,paddingTop:Se,paddingRight:Se,paddingBottom:Se,paddingLeft:Se,paddingBlock:Se,paddingBlockStart:Se,paddingBlockEnd:Se,paddingInline:Se,paddingInlineStart:Se,paddingInlineEnd:Se,margin:Se,marginTop:Se,marginRight:Se,marginBottom:Se,marginLeft:Se,marginBlock:Se,marginBlockStart:Se,marginBlockEnd:Se,marginInline:Se,marginInlineStart:Se,marginInlineEnd:Se,backgroundPositionX:Se,backgroundPositionY:Se,...k5,zIndex:Zm,fillOpacity:No,strokeOpacity:No,numOctaves:Zm},L5={...Of,color:mt,backgroundColor:mt,outlineColor:mt,fill:mt,stroke:mt,borderColor:mt,borderTopColor:mt,borderRightColor:mt,borderBottomColor:mt,borderLeftColor:mt,filter:Uh,WebkitFilter:Uh},Vy=e=>L5[e];function Ky(e,t){let r=Vy(e);return r!==Uh&&(r=Kn),r.getAnimatableNone?r.getAnimatableNone(t):void 0}const T5=new Set(["auto","none","0"]);function R5(e,t,r){let n=0,i;for(;n<e.length&&!i;){const a=e[n];typeof a=="string"&&!T5.has(a)&&jo(a).values.length&&(i=e[n]),n++}if(i&&r)for(const a of t)e[a]=Ky(r,i)}class D5 extends Pf{constructor(t,r,n,i,a){super(t,r,n,i,a,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:r,name:n}=this;if(!r||!r.current)return;super.readKeyframes();for(let f=0;f<t.length;f++){let u=t[f];if(typeof u=="string"&&(u=u.trim(),Ef(u))){const p=$y(u,r.current);p!==void 0&&(t[f]=p),f===t.length-1&&(this.finalKeyframe=u)}}if(this.resolveNoneKeyframes(),!zy.has(n)||t.length!==2)return;const[i,a]=t,l=Qm(i),s=Qm(a),o=Hm(i),c=Hm(a);if(o!==c&&In[n]){this.needsMeasurement=!0;return}if(l!==s)if(Xm(l)&&Xm(s))for(let f=0;f<t.length;f++){const u=t[f];typeof u=="string"&&(t[f]=parseFloat(u))}else In[n]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:r}=this,n=[];for(let i=0;i<t.length;i++)(t[i]===null||x5(t[i]))&&n.push(i);n.length&&R5(t,n,r)}measureInitialState(){const{element:t,unresolvedKeyframes:r,name:n}=this;if(!t||!t.current)return;n==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=In[n](t.measureViewportBox(),window.getComputedStyle(t.current)),r[0]=this.measuredOrigin;const i=r[r.length-1];i!==void 0&&t.getValue(n,i).jump(i,!1)}measureEndState(){var s;const{element:t,name:r,unresolvedKeyframes:n}=this;if(!t||!t.current)return;const i=t.getValue(r);i&&i.jump(this.measuredOrigin,!1);const a=n.length-1,l=n[a];n[a]=In[r](t.measureViewportBox(),window.getComputedStyle(t.current)),l!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=l),(s=this.removedTransforms)!=null&&s.length&&this.removedTransforms.forEach(([o,c])=>{t.getValue(o).set(c)}),this.resolveNoneKeyframes()}}function M5(e,t,r){if(e instanceof EventTarget)return[e];if(typeof e=="string"){let n=document;const i=(r==null?void 0:r[e])??n.querySelectorAll(e);return i?Array.from(i):[]}return Array.from(e)}const Gy=(e,t)=>t&&typeof e=="number"?t.transform(e):e;function qy(e){return cy(e)&&"offsetHeight"in e}const eg=30,A5=e=>!isNaN(parseFloat(e));class P5{constructor(t,r={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=n=>{var a;const i=Qt.now();if(this.updatedAt!==i&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(n),this.current!==this.prev&&((a=this.events.change)==null||a.notify(this.current),this.dependents))for(const l of this.dependents)l.dirty()},this.hasAnimated=!1,this.setCurrent(t),this.owner=r.owner}setCurrent(t){this.current=t,this.updatedAt=Qt.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=A5(this.current))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return this.on("change",t)}on(t,r){this.events[t]||(this.events[t]=new xf);const n=this.events[t].add(r);return t==="change"?()=>{n(),it.read(()=>{this.events.change.getSize()||this.stop()})}:n}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,r){this.passiveEffect=t,this.stopPassiveEffect=r}set(t){this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t)}setWithVelocity(t,r,n){this.set(r),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-n}jump(t,r=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,r&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){var t;(t=this.events.change)==null||t.notify(this.current)}addDependent(t){this.dependents||(this.dependents=new Set),this.dependents.add(t)}removeDependent(t){this.dependents&&this.dependents.delete(t)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const t=Qt.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>eg)return 0;const r=Math.min(this.updatedAt-this.prevUpdatedAt,eg);return hy(parseFloat(this.current)-parseFloat(this.prevFrameValue),r)}start(t){return this.stop(),new Promise(r=>{this.hasAnimated=!0,this.animation=t(r),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){var t,r;(t=this.dependents)==null||t.clear(),(r=this.events.destroy)==null||r.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function gi(e,t){return new P5(e,t)}const{schedule:Bf}=xy(queueMicrotask,!1),Rr={x:!1,y:!1};function Xy(){return Rr.x||Rr.y}function I5(e){return e==="x"||e==="y"?Rr[e]?null:(Rr[e]=!0,()=>{Rr[e]=!1}):Rr.x||Rr.y?null:(Rr.x=Rr.y=!0,()=>{Rr.x=Rr.y=!1})}function Yy(e,t){const r=M5(e),n=new AbortController,i={passive:!0,...t,signal:n.signal};return[r,i,()=>n.abort()]}function tg(e){return!(e.pointerType==="touch"||Xy())}function O5(e,t,r={}){const[n,i,a]=Yy(e,r),l=s=>{if(!tg(s))return;const{target:o}=s,c=t(o,s);if(typeof c!="function"||!o)return;const f=u=>{tg(u)&&(c(u),o.removeEventListener("pointerleave",f))};o.addEventListener("pointerleave",f,i)};return n.forEach(s=>{s.addEventListener("pointerenter",l,i)}),a}const Jy=(e,t)=>t?e===t?!0:Jy(e,t.parentElement):!1,Nf=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1,B5=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function Qy(e){return B5.has(e.tagName)||e.isContentEditable===!0}const nl=new WeakSet;function rg(e){return t=>{t.key==="Enter"&&e(t)}}function ou(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const N5=(e,t)=>{const r=e.currentTarget;if(!r)return;const n=rg(()=>{if(nl.has(r))return;ou(r,"down");const i=rg(()=>{ou(r,"up")}),a=()=>ou(r,"cancel");r.addEventListener("keyup",i,t),r.addEventListener("blur",a,t)});r.addEventListener("keydown",n,t),r.addEventListener("blur",()=>r.removeEventListener("keydown",n),t)};function ng(e){return Nf(e)&&!Xy()}function j5(e,t,r={}){const[n,i,a]=Yy(e,r),l=s=>{const o=s.currentTarget;if(!ng(s))return;nl.add(o);const c=t(o,s),f=(_,y)=>{window.removeEventListener("pointerup",u),window.removeEventListener("pointercancel",p),nl.has(o)&&nl.delete(o),ng(_)&&typeof c=="function"&&c(_,{success:y})},u=_=>{f(_,o===window||o===document||r.useGlobalTarget||Jy(o,_.target))},p=_=>{f(_,!1)};window.addEventListener("pointerup",u,i),window.addEventListener("pointercancel",p,i)};return n.forEach(s=>{(r.useGlobalTarget?window:s).addEventListener("pointerdown",l,i),qy(s)&&(s.addEventListener("focus",c=>N5(c,i)),!Qy(s)&&!s.hasAttribute("tabindex")&&(s.tabIndex=0))}),a}function Zy(e){return cy(e)&&"ownerSVGElement"in e}function F5(e){return Zy(e)&&e.tagName==="svg"}const Gt=e=>!!(e&&e.getVelocity),H5=[...Wy,mt,Kn],$5=e=>H5.find(Uy(e)),jf=E.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});function sg(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function z5(...e){return t=>{let r=!1;const n=e.map(i=>{const a=sg(i,t);return!r&&typeof a=="function"&&(r=!0),a});if(r)return()=>{for(let i=0;i<n.length;i++){const a=n[i];typeof a=="function"?a():sg(e[i],null)}}}}function U5(...e){return E.useCallback(z5(...e),e)}class W5 extends E.Component{getSnapshotBeforeUpdate(t){const r=this.props.childRef.current;if(r&&t.isPresent&&!this.props.isPresent){const n=r.offsetParent,i=qy(n)&&n.offsetWidth||0,a=this.props.sizeRef.current;a.height=r.offsetHeight||0,a.width=r.offsetWidth||0,a.top=r.offsetTop,a.left=r.offsetLeft,a.right=i-a.width-a.left}return null}componentDidUpdate(){}render(){return this.props.children}}function V5({children:e,isPresent:t,anchorX:r,root:n}){var f;const i=E.useId(),a=E.useRef(null),l=E.useRef({width:0,height:0,top:0,left:0,right:0}),{nonce:s}=E.useContext(jf),o=((f=e.props)==null?void 0:f.ref)??(e==null?void 0:e.ref),c=U5(a,o);return E.useInsertionEffect(()=>{const{width:u,height:p,top:_,left:y,right:v}=l.current;if(t||!a.current||!u||!p)return;const h=r==="left"?`left: ${y}`:`right: ${v}`;a.current.dataset.motionPopId=i;const m=document.createElement("style");s&&(m.nonce=s);const d=n??document.head;return d.appendChild(m),m.sheet&&m.sheet.insertRule(`
|
|
41
41
|
[data-motion-pop-id="${i}"] {
|
|
42
42
|
position: absolute !important;
|
|
43
43
|
width: ${u}px !important;
|
|
@@ -45,17 +45,17 @@ Error generating stack: `+a.message+`
|
|
|
45
45
|
${h}px !important;
|
|
46
46
|
top: ${_}px !important;
|
|
47
47
|
}
|
|
48
|
-
`),()=>{d.contains(m)&&d.removeChild(m)}},[t]),T.jsx(W5,{isPresent:t,childRef:a,sizeRef:l,children:E.cloneElement(e,{ref:c})})}const K5=({children:e,initial:t,isPresent:r,onExitComplete:n,custom:i,presenceAffectsLayout:a,mode:l,anchorX:s,root:o})=>{const c=gf(G5),f=E.useId();let u=!0,p=E.useMemo(()=>(u=!1,{id:f,initial:t,isPresent:r,custom:i,onExitComplete:_=>{c.set(_,!0);for(const y of c.values())if(!y)return;n&&n()},register:_=>(c.set(_,!1),()=>c.delete(_))}),[r,c,n]);return a&&u&&(p={...p}),E.useMemo(()=>{c.forEach((_,y)=>c.set(y,!1))},[r]),E.useEffect(()=>{!r&&!c.size&&n&&n()},[r]),l==="popLayout"&&(e=T.jsx(V5,{isPresent:r,anchorX:s,root:o,children:e})),T.jsx(vc.Provider,{value:p,children:e})};function G5(){return new Map}function e1(e=!0){const t=E.useContext(vc);if(t===null)return[!0,null];const{isPresent:r,onExitComplete:n,register:i}=t,a=E.useId();E.useEffect(()=>{if(e)return i(a)},[e]);const l=E.useCallback(()=>e&&n&&n(a),[a,n,e]);return!r&&n?[!1,l]:[!0]}const Da=e=>e.key||"";function ig(e){const t=[];return E.Children.forEach(e,r=>{E.isValidElement(r)&&t.push(r)}),t}const q5=({children:e,custom:t,initial:r=!0,onExitComplete:n,presenceAffectsLayout:i=!0,mode:a="sync",propagate:l=!1,anchorX:s="left",root:o})=>{const[c,f]=e1(l),u=E.useMemo(()=>ig(e),[e]),p=l&&!c?[]:u.map(Da),_=E.useRef(!0),y=E.useRef(u),v=gf(()=>new Map),h=E.useRef(new Set),[m,d]=E.useState(u),[g,w]=E.useState(u);ay(()=>{_.current=!1,y.current=u;for(let C=0;C<g.length;C++){const S=Da(g[C]);p.includes(S)?(v.delete(S),h.current.delete(S)):v.get(S)!==!0&&v.set(S,!1)}},[g,p.length,p.join("-")]);const b=[];if(u!==m){let C=[...u];for(let S=0;S<g.length;S++){const k=g[S],L=Da(k);p.includes(L)||(C.splice(S,0,k),b.push(k))}return a==="wait"&&b.length&&(C=b),w(ig(C)),d(u),null}const{forceRender:x}=E.useContext(mf);return T.jsx(T.Fragment,{children:g.map(C=>{const S=Da(C),k=l&&!c?!1:u===g||p.includes(S),L=()=>{if(h.current.has(S))return;if(h.current.add(S),v.has(S))v.set(S,!0);else return;let A=!0;v.forEach(M=>{M||(A=!1)}),A&&(x==null||x(),w(y.current),l&&(f==null||f()),n&&n())};return T.jsx(K5,{isPresent:k,initial:!_.current||r?void 0:!1,custom:t,presenceAffectsLayout:i,mode:a,root:o,onExitComplete:k?void 0:L,anchorX:s,children:C},S)})})},t1=E.createContext({strict:!1}),og={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]},vi={};for(const e in og)vi[e]={isEnabled:t=>og[e].some(r=>!!t[r])};function X5(e){for(const t in e)vi[t]={...vi[t],...e[t]}}const Y5=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","ignoreStrict","viewport"]);function Fl(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||Y5.has(e)}let r1=e=>!Fl(e);function J5(e){typeof e=="function"&&(r1=t=>t.startsWith("on")?!Fl(t):e(t))}try{J5(require("@emotion/is-prop-valid").default)}catch{}function Q5(e,t,r){const n={};for(const i in e)i==="values"&&typeof e.values=="object"||(r1(i)||r===!0&&Fl(i)||!t&&!Fl(i)||e.draggable&&i.startsWith("onDrag"))&&(n[i]=e[i]);return n}const _c=E.createContext({});function yc(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}function Fo(e){return typeof e=="string"||Array.isArray(e)}const Ff=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],Hf=["initial",...Ff];function wc(e){return yc(e.animate)||Hf.some(t=>Fo(e[t]))}function n1(e){return!!(wc(e)||e.variants)}function Z5(e,t){if(wc(e)){const{initial:r,animate:n}=e;return{initial:r===!1||Fo(r)?r:void 0,animate:Fo(n)?n:void 0}}return e.inherit!==!1?t:{}}function eE(e){const{initial:t,animate:r}=Z5(e,E.useContext(_c));return E.useMemo(()=>({initial:t,animate:r}),[ag(t),ag(r)])}function ag(e){return Array.isArray(e)?e.join(" "):e}function lg(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const $i={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(we.test(e))e=parseFloat(e);else return e;const r=lg(e,t.target.x),n=lg(e,t.target.y);return`${r}% ${n}%`}},tE={correct:(e,{treeScale:t,projectionDelta:r})=>{const n=e,i=Kn.parse(e);if(i.length>5)return n;const a=Kn.createTransformer(e),l=typeof i[0]!="number"?1:0,s=r.x.scale*t.x,o=r.y.scale*t.y;i[0+l]/=s,i[1+l]/=o;const c=lt(s,o,.5);return typeof i[2+l]=="number"&&(i[2+l]/=c),typeof i[3+l]=="number"&&(i[3+l]/=c),a(i)}},Wh={borderRadius:{...$i,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:$i,borderTopRightRadius:$i,borderBottomLeftRadius:$i,borderBottomRightRadius:$i,boxShadow:tE};function s1(e,{layout:t,layoutId:r}){return Ei.has(e)||e.startsWith("origin")||(t||r!==void 0)&&(!!Wh[e]||e==="opacity")}const rE={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},nE=Ci.length;function sE(e,t,r){let n="",i=!0;for(let a=0;a<nE;a++){const l=Ci[a],s=e[l];if(s===void 0)continue;let o=!0;if(typeof s=="number"?o=s===(l.startsWith("scale")?1:0):o=parseFloat(s)===0,!o||r){const c=Gy(s,Of[l]);if(!o){i=!1;const f=rE[l]||l;n+=`${f}(${c}) `}r&&(t[l]=c)}}return n=n.trim(),r?n=r(t,i?"":n):i&&(n="none"),n}function $f(e,t,r){const{style:n,vars:i,transformOrigin:a}=e;let l=!1,s=!1;for(const o in t){const c=t[o];if(Ei.has(o)){l=!0;continue}else if(Cy(o)){i[o]=c;continue}else{const f=Gy(c,Of[o]);o.startsWith("origin")?(s=!0,a[o]=f):n[o]=f}}if(t.transform||(l||r?n.transform=sE(t,e.transform,r):n.transform&&(n.transform="none")),s){const{originX:o="50%",originY:c="50%",originZ:f=0}=a;n.transformOrigin=`${o} ${c} ${f}`}}const zf=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function i1(e,t,r){for(const n in t)!Gt(t[n])&&!s1(n,r)&&(e[n]=t[n])}function iE({transformTemplate:e},t){return E.useMemo(()=>{const r=zf();return $f(r,t,e),Object.assign({},r.vars,r.style)},[t])}function oE(e,t){const r=e.style||{},n={};return i1(n,r,e),Object.assign(n,iE(e,t)),n}function aE(e,t){const r={},n=oE(e,t);return e.drag&&e.dragListener!==!1&&(r.draggable=!1,n.userSelect=n.WebkitUserSelect=n.WebkitTouchCallout="none",n.touchAction=e.drag===!0?"none":`pan-${e.drag==="x"?"y":"x"}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(r.tabIndex=0),r.style=n,r}const lE={offset:"stroke-dashoffset",array:"stroke-dasharray"},cE={offset:"strokeDashoffset",array:"strokeDasharray"};function uE(e,t,r=1,n=0,i=!0){e.pathLength=1;const a=i?lE:cE;e[a.offset]=we.transform(-n);const l=we.transform(t),s=we.transform(r);e[a.array]=`${l} ${s}`}const hE=["offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function o1(e,{attrX:t,attrY:r,attrScale:n,pathLength:i,pathSpacing:a=1,pathOffset:l=0,...s},o,c,f){if($f(e,s,c),o){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};const{attrs:u,style:p}=e;u.transform&&(p.transform=u.transform,delete u.transform),(p.transform||u.transformOrigin)&&(p.transformOrigin=u.transformOrigin??"50% 50%",delete u.transformOrigin),p.transform&&(p.transformBox=(f==null?void 0:f.transformBox)??"fill-box",delete u.transformBox);for(const _ of hE)u[_]!==void 0&&(p[_]=u[_],delete u[_]);t!==void 0&&(u.x=t),r!==void 0&&(u.y=r),n!==void 0&&(u.scale=n),i!==void 0&&uE(u,i,a,l,!1)}const a1=()=>({...zf(),attrs:{}}),l1=e=>typeof e=="string"&&e.toLowerCase()==="svg";function dE(e,t,r,n){const i=E.useMemo(()=>{const a=a1();return o1(a,t,l1(n),e.transformTemplate,e.style),{...a.attrs,style:{...a.style}}},[t]);if(e.style){const a={};i1(a,e.style,e),i.style={...a,...i.style}}return i}const fE=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function Uf(e){return typeof e!="string"||e.includes("-")?!1:!!(fE.indexOf(e)>-1||/[A-Z]/u.test(e))}function pE(e,t,r,{latestValues:n},i,a=!1,l){const o=(l??Uf(e)?dE:aE)(t,n,i,e),c=Q5(t,typeof e=="string",a),f=e!==E.Fragment?{...c,...o,ref:r}:{},{children:u}=t,p=E.useMemo(()=>Gt(u)?u.get():u,[u]);return E.createElement(e,{...f,children:p})}function cg(e){const t=[{},{}];return e==null||e.values.forEach((r,n)=>{t[0][n]=r.get(),t[1][n]=r.getVelocity()}),t}function Wf(e,t,r,n){if(typeof t=="function"){const[i,a]=cg(n);t=t(r!==void 0?r:e.custom,i,a)}if(typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"){const[i,a]=cg(n);t=t(r!==void 0?r:e.custom,i,a)}return t}function sl(e){return Gt(e)?e.get():e}function mE({scrapeMotionValuesFromProps:e,createRenderState:t},r,n,i){return{latestValues:gE(r,n,i,e),renderState:t()}}function gE(e,t,r,n){const i={},a=n(e,{});for(const p in a)i[p]=sl(a[p]);let{initial:l,animate:s}=e;const o=wc(e),c=n1(e);t&&c&&!o&&e.inherit!==!1&&(l===void 0&&(l=t.initial),s===void 0&&(s=t.animate));let f=r?r.initial===!1:!1;f=f||l===!1;const u=f?s:l;if(u&&typeof u!="boolean"&&!yc(u)){const p=Array.isArray(u)?u:[u];for(let _=0;_<p.length;_++){const y=Wf(e,p[_]);if(y){const{transitionEnd:v,transition:h,...m}=y;for(const d in m){let g=m[d];if(Array.isArray(g)){const w=f?g.length-1:0;g=g[w]}g!==null&&(i[d]=g)}for(const d in v)i[d]=v[d]}}}return i}const c1=e=>(t,r)=>{const n=E.useContext(_c),i=E.useContext(vc),a=()=>mE(e,t,n,i);return r?a():gf(a)};function Vf(e,t,r){var a;const{style:n}=e,i={};for(const l in n)(Gt(n[l])||t.style&&Gt(t.style[l])||s1(l,e)||((a=r==null?void 0:r.getValue(l))==null?void 0:a.liveStyle)!==void 0)&&(i[l]=n[l]);return i}const vE=c1({scrapeMotionValuesFromProps:Vf,createRenderState:zf});function u1(e,t,r){const n=Vf(e,t,r);for(const i in e)if(Gt(e[i])||Gt(t[i])){const a=Ci.indexOf(i)!==-1?"attr"+i.charAt(0).toUpperCase()+i.substring(1):i;n[a]=e[i]}return n}const _E=c1({scrapeMotionValuesFromProps:u1,createRenderState:a1}),yE=Symbol.for("motionComponentSymbol");function wE(e,t,r){const n=E.useRef(r);E.useInsertionEffect(()=>{n.current=r});const i=E.useRef(null);return E.useCallback(a=>{var s;a&&((s=e.onMount)==null||s.call(e,a)),t&&(a?t.mount(a):t.unmount());const l=n.current;if(typeof l=="function")if(a){const o=l(a);typeof o=="function"&&(i.current=o)}else i.current?(i.current(),i.current=null):l(a);else l&&(l.current=a)},[t])}const Kf=e=>e.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),SE="framerAppearId",h1="data-"+Kf(SE),d1=E.createContext({});function Yi(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function xE(e,t,r,n,i,a){var h,m;const{visualElement:l}=E.useContext(_c),s=E.useContext(t1),o=E.useContext(vc),c=E.useContext(jf).reducedMotion,f=E.useRef(null);n=n||s.renderer,!f.current&&n&&(f.current=n(e,{visualState:t,parent:l,props:r,presenceContext:o,blockInitialAnimation:o?o.initial===!1:!1,reducedMotionConfig:c,isSVG:a}));const u=f.current,p=E.useContext(d1);u&&!u.projection&&i&&(u.type==="html"||u.type==="svg")&&bE(f.current,r,i,p);const _=E.useRef(!1);E.useInsertionEffect(()=>{u&&_.current&&u.update(r,o)});const y=r[h1],v=E.useRef(!!y&&!((h=window.MotionHandoffIsComplete)!=null&&h.call(window,y))&&((m=window.MotionHasOptimisedAnimation)==null?void 0:m.call(window,y)));return ay(()=>{u&&(_.current=!0,window.MotionIsMounted=!0,u.updateFeatures(),u.scheduleRenderMicrotask(),v.current&&u.animationState&&u.animationState.animateChanges())}),E.useEffect(()=>{u&&(!v.current&&u.animationState&&u.animationState.animateChanges(),v.current&&(queueMicrotask(()=>{var d;(d=window.MotionHandoffMarkAsComplete)==null||d.call(window,y)}),v.current=!1),u.enteringChildren=void 0)}),u}function bE(e,t,r,n){const{layoutId:i,layout:a,drag:l,dragConstraints:s,layoutScroll:o,layoutRoot:c,layoutCrossfade:f}=t;e.projection=new r(e.latestValues,t["data-framer-portal-id"]?void 0:f1(e.parent)),e.projection.setOptions({layoutId:i,layout:a,alwaysMeasureLayout:!!l||s&&Yi(s),visualElement:e,animationType:typeof a=="string"?a:"both",initialPromotionConfig:n,crossfade:f,layoutScroll:o,layoutRoot:c})}function f1(e){if(e)return e.options.allowProjection!==!1?e.projection:f1(e.parent)}function au(e,{forwardMotionProps:t=!1,type:r}={},n,i){n&&X5(n);const a=r?r==="svg":Uf(e),l=a?_E:vE;function s(c,f){let u;const p={...E.useContext(jf),...c,layoutId:CE(c)},{isStatic:_}=p,y=eE(c),v=l(c,_);if(!_&&vf){EE();const h=kE(p);u=h.MeasureLayout,y.visualElement=xE(e,v,p,i,h.ProjectionNode,a)}return T.jsxs(_c.Provider,{value:y,children:[u&&y.visualElement?T.jsx(u,{visualElement:y.visualElement,...p}):null,pE(e,c,wE(v,y.visualElement,f),v,_,t,a)]})}s.displayName=`motion.${typeof e=="string"?e:`create(${e.displayName??e.name??""})`}`;const o=E.forwardRef(s);return o[yE]=e,o}function CE({layoutId:e}){const t=E.useContext(mf).id;return t&&e!==void 0?t+"-"+e:e}function EE(e,t){E.useContext(t1).strict}function kE(e){const{drag:t,layout:r}=vi;if(!t&&!r)return{};const n={...t,...r};return{MeasureLayout:t!=null&&t.isEnabled(e)||r!=null&&r.isEnabled(e)?n.MeasureLayout:void 0,ProjectionNode:n.ProjectionNode}}function LE(e,t){if(typeof Proxy>"u")return au;const r=new Map,n=(a,l)=>au(a,l,e,t),i=(a,l)=>n(a,l);return new Proxy(i,{get:(a,l)=>l==="create"?n:(r.has(l)||r.set(l,au(l,void 0,e,t)),r.get(l))})}function p1({top:e,left:t,right:r,bottom:n}){return{x:{min:t,max:r},y:{min:e,max:n}}}function TE({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function RE(e,t){if(!t)return e;const r=t({x:e.left,y:e.top}),n=t({x:e.right,y:e.bottom});return{top:r.y,left:r.x,bottom:n.y,right:n.x}}function lu(e){return e===void 0||e===1}function Vh({scale:e,scaleX:t,scaleY:r}){return!lu(e)||!lu(t)||!lu(r)}function as(e){return Vh(e)||m1(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function m1(e){return ug(e.x)||ug(e.y)}function ug(e){return e&&e!=="0%"}function Hl(e,t,r){const n=e-r,i=t*n;return r+i}function hg(e,t,r,n,i){return i!==void 0&&(e=Hl(e,i,n)),Hl(e,r,n)+t}function Kh(e,t=0,r=1,n,i){e.min=hg(e.min,t,r,n,i),e.max=hg(e.max,t,r,n,i)}function g1(e,{x:t,y:r}){Kh(e.x,t.translate,t.scale,t.originPoint),Kh(e.y,r.translate,r.scale,r.originPoint)}const dg=.999999999999,fg=1.0000000000001;function DE(e,t,r,n=!1){const i=r.length;if(!i)return;t.x=t.y=1;let a,l;for(let s=0;s<i;s++){a=r[s],l=a.projectionDelta;const{visualElement:o}=a.options;o&&o.props.style&&o.props.style.display==="contents"||(n&&a.options.layoutScroll&&a.scroll&&a!==a.root&&Xs(e,{x:-a.scroll.offset.x,y:-a.scroll.offset.y}),l&&(t.x*=l.x.scale,t.y*=l.y.scale,g1(e,l)),n&&as(a.latestValues)&&Xs(e,a.latestValues))}t.x<fg&&t.x>dg&&(t.x=1),t.y<fg&&t.y>dg&&(t.y=1)}function qs(e,t){e.min=e.min+t,e.max=e.max+t}function pg(e,t,r,n,i=.5){const a=lt(e.min,e.max,i);Kh(e,t,r,a,n)}function Xs(e,t){pg(e.x,t.x,t.scaleX,t.scale,t.originX),pg(e.y,t.y,t.scaleY,t.scale,t.originY)}function v1(e,t){return p1(RE(e.getBoundingClientRect(),t))}function ME(e,t,r){const n=v1(e,r),{scroll:i}=t;return i&&(qs(n.x,i.offset.x),qs(n.y,i.offset.y)),n}const mg=()=>({translate:0,scale:1,origin:0,originPoint:0}),Ys=()=>({x:mg(),y:mg()}),gg=()=>({min:0,max:0}),wt=()=>({x:gg(),y:gg()}),$l={current:null},Gf={current:!1};function _1(){if(Gf.current=!0,!!vf)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>$l.current=e.matches;e.addEventListener("change",t),t()}else $l.current=!1}const AE=new WeakMap;function PE(e,t,r){for(const n in t){const i=t[n],a=r[n];if(Gt(i))e.addValue(n,i);else if(Gt(a))e.addValue(n,gi(i,{owner:e}));else if(a!==i)if(e.hasValue(n)){const l=e.getValue(n);l.liveStyle===!0?l.jump(i):l.hasAnimated||l.set(i)}else{const l=e.getStaticValue(n);e.addValue(n,gi(l!==void 0?l:i,{owner:e}))}}for(const n in r)t[n]===void 0&&e.removeValue(n);return t}const vg=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class IE{scrapeMotionValuesFromProps(t,r,n){return{}}constructor({parent:t,props:r,presenceContext:n,reducedMotionConfig:i,blockInitialAnimation:a,visualState:l},s={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=Pf,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const p=Qt.now();this.renderScheduledAt<p&&(this.renderScheduledAt=p,it.render(this.render,!1,!0))};const{latestValues:o,renderState:c}=l;this.latestValues=o,this.baseTarget={...o},this.initialValues=r.initial?{...o}:{},this.renderState=c,this.parent=t,this.props=r,this.presenceContext=n,this.depth=t?t.depth+1:0,this.reducedMotionConfig=i,this.options=s,this.blockInitialAnimation=!!a,this.isControllingVariants=wc(r),this.isVariantNode=n1(r),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(t&&t.current);const{willChange:f,...u}=this.scrapeMotionValuesFromProps(r,{},this);for(const p in u){const _=u[p];o[p]!==void 0&&Gt(_)&&_.set(o[p])}}mount(t){var r;this.current=t,AE.set(t,this),this.projection&&!this.projection.instance&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((n,i)=>this.bindToMotionValue(i,n)),this.reducedMotionConfig==="never"?this.shouldReduceMotion=!1:this.reducedMotionConfig==="always"?this.shouldReduceMotion=!0:(Gf.current||_1(),this.shouldReduceMotion=$l.current),(r=this.parent)==null||r.addChild(this),this.update(this.props,this.presenceContext)}unmount(){var t;this.projection&&this.projection.unmount(),Vn(this.notifyUpdate),Vn(this.render),this.valueSubscriptions.forEach(r=>r()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),(t=this.parent)==null||t.removeChild(this);for(const r in this.events)this.events[r].clear();for(const r in this.features){const n=this.features[r];n&&(n.unmount(),n.isMounted=!1)}this.current=null}addChild(t){this.children.add(t),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(t)}removeChild(t){this.children.delete(t),this.enteringChildren&&this.enteringChildren.delete(t)}bindToMotionValue(t,r){this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)();const n=Ei.has(t);n&&this.onBindTransform&&this.onBindTransform();const i=r.on("change",l=>{this.latestValues[t]=l,this.props.onUpdate&&it.preRender(this.notifyUpdate),n&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let a;window.MotionCheckAppearSync&&(a=window.MotionCheckAppearSync(this,t,r)),this.valueSubscriptions.set(t,()=>{i(),a&&a(),r.owner&&r.stop()})}sortNodePosition(t){return!this.current||!this.sortInstanceNodePosition||this.type!==t.type?0:this.sortInstanceNodePosition(this.current,t.current)}updateFeatures(){let t="animation";for(t in vi){const r=vi[t];if(!r)continue;const{isEnabled:n,Feature:i}=r;if(!this.features[t]&&i&&n(this.props)&&(this.features[t]=new i(this)),this.features[t]){const a=this.features[t];a.isMounted?a.update():(a.mount(),a.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):wt()}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,r){this.latestValues[t]=r}update(t,r){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=r;for(let n=0;n<vg.length;n++){const i=vg[n];this.propEventSubscriptions[i]&&(this.propEventSubscriptions[i](),delete this.propEventSubscriptions[i]);const a="on"+i,l=t[a];l&&(this.propEventSubscriptions[i]=this.on(i,l))}this.prevMotionValues=PE(this,this.scrapeMotionValuesFromProps(t,this.prevProps,this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(t){return this.props.variants?this.props.variants[t]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(t){const r=this.getClosestVariantNode();if(r)return r.variantChildren&&r.variantChildren.add(t),()=>r.variantChildren.delete(t)}addValue(t,r){const n=this.values.get(t);r!==n&&(n&&this.removeValue(t),this.bindToMotionValue(t,r),this.values.set(t,r),this.latestValues[t]=r.get())}removeValue(t){this.values.delete(t);const r=this.valueSubscriptions.get(t);r&&(r(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,r){if(this.props.values&&this.props.values[t])return this.props.values[t];let n=this.values.get(t);return n===void 0&&r!==void 0&&(n=gi(r===null?void 0:r,{owner:this}),this.addValue(t,n)),n}readValue(t,r){let n=this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:this.getBaseTargetFromProps(this.props,t)??this.readValueFromInstance(this.current,t,this.options);return n!=null&&(typeof n=="string"&&(ly(n)||uy(n))?n=parseFloat(n):!$5(n)&&Kn.test(r)&&(n=Ky(t,r)),this.setBaseTarget(t,Gt(n)?n.get():n)),Gt(n)?n.get():n}setBaseTarget(t,r){this.baseTarget[t]=r}getBaseTarget(t){var a;const{initial:r}=this.props;let n;if(typeof r=="string"||typeof r=="object"){const l=Wf(this.props,r,(a=this.presenceContext)==null?void 0:a.custom);l&&(n=l[t])}if(r&&n!==void 0)return n;const i=this.getBaseTargetFromProps(this.props,t);return i!==void 0&&!Gt(i)?i:this.initialValues[t]!==void 0&&n===void 0?void 0:this.baseTarget[t]}on(t,r){return this.events[t]||(this.events[t]=new xf),this.events[t].add(r)}notify(t,...r){this.events[t]&&this.events[t].notify(...r)}scheduleRenderMicrotask(){Bf.render(this.render)}}class y1 extends IE{constructor(){super(...arguments),this.KeyframeResolver=D5}sortInstanceNodePosition(t,r){return t.compareDocumentPosition(r)&2?1:-1}getBaseTargetFromProps(t,r){return t.style?t.style[r]:void 0}removeValueFromRenderState(t,{vars:r,style:n}){delete r[t],delete n[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;Gt(t)&&(this.childSubscription=t.on("change",r=>{this.current&&(this.current.textContent=`${r}`)}))}}function w1(e,{style:t,vars:r},n,i){const a=e.style;let l;for(l in t)a[l]=t[l];i==null||i.applyProjectionStyles(a,n);for(l in r)a.setProperty(l,r[l])}function OE(e){return window.getComputedStyle(e)}class BE extends y1{constructor(){super(...arguments),this.type="html",this.renderInstance=w1}readValueFromInstance(t,r){var n;if(Ei.has(r))return(n=this.projection)!=null&&n.isProjecting?Nh(r):X2(t,r);{const i=OE(t),a=(Cy(r)?i.getPropertyValue(r):i[r])||0;return typeof a=="string"?a.trim():a}}measureInstanceViewportBox(t,{transformPagePoint:r}){return v1(t,r)}build(t,r,n){$f(t,r,n.transformTemplate)}scrapeMotionValuesFromProps(t,r,n){return Vf(t,r,n)}}const S1=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);function NE(e,t,r,n){w1(e,t,void 0,n);for(const i in t.attrs)e.setAttribute(S1.has(i)?i:Kf(i),t.attrs[i])}class jE extends y1{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=wt}getBaseTargetFromProps(t,r){return t[r]}readValueFromInstance(t,r){if(Ei.has(r)){const n=Vy(r);return n&&n.default||0}return r=S1.has(r)?r:Kf(r),t.getAttribute(r)}scrapeMotionValuesFromProps(t,r,n){return u1(t,r,n)}build(t,r,n){o1(t,r,this.isSVGTag,n.transformTemplate,n.style)}renderInstance(t,r,n,i){NE(t,r,n,i)}mount(t){this.isSVGTag=l1(t.tagName),super.mount(t)}}const FE=(e,t)=>t.isSVG??Uf(e)?new jE(t):new BE(t,{allowProjection:e!==E.Fragment});function oi(e,t,r){const n=e.getProps();return Wf(n,t,r!==void 0?r:n.custom,e)}const Gh=e=>Array.isArray(e);function HE(e,t,r){e.hasValue(t)?e.getValue(t).set(r):e.addValue(t,gi(r))}function $E(e){return Gh(e)?e[e.length-1]||0:e}function zE(e,t){const r=oi(e,t);let{transitionEnd:n={},transition:i={},...a}=r||{};a={...a,...n};for(const l in a){const s=$E(a[l]);HE(e,l,s)}}function UE(e){return!!(Gt(e)&&e.add)}function qh(e,t){const r=e.getValue("willChange");if(UE(r))return r.add(t);if(!r&&_n.WillChange){const n=new _n.WillChange("auto");e.addValue("willChange",n),n.add(t)}}function x1(e){return e.props[h1]}const WE=e=>e!==null;function VE(e,{repeat:t,repeatType:r="loop"},n){const i=e.filter(WE),a=t&&r!=="loop"&&t%2===1?0:i.length-1;return i[a]}const KE={type:"spring",stiffness:500,damping:25,restSpeed:10},GE=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),qE={type:"keyframes",duration:.8},XE={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},YE=(e,{keyframes:t})=>t.length>2?qE:Ei.has(e)?e.startsWith("scale")?GE(t[1]):KE:XE;function JE({when:e,delay:t,delayChildren:r,staggerChildren:n,staggerDirection:i,repeat:a,repeatType:l,repeatDelay:s,from:o,elapsed:c,...f}){return!!Object.keys(f).length}const qf=(e,t,r,n={},i,a)=>l=>{const s=If(n,e)||{},o=s.delay||n.delay||0;let{elapsed:c=0}=n;c=c-fn(o);const f={keyframes:Array.isArray(r)?r:[null,r],ease:"easeOut",velocity:t.getVelocity(),...s,delay:-c,onUpdate:p=>{t.set(p),s.onUpdate&&s.onUpdate(p)},onComplete:()=>{l(),s.onComplete&&s.onComplete()},name:e,motionValue:t,element:a?void 0:i};JE(s)||Object.assign(f,YE(e,f)),f.duration&&(f.duration=fn(f.duration)),f.repeatDelay&&(f.repeatDelay=fn(f.repeatDelay)),f.from!==void 0&&(f.keyframes[0]=f.from);let u=!1;if((f.type===!1||f.duration===0&&!f.repeatDelay)&&(zh(f),f.delay===0&&(u=!0)),(_n.instantAnimations||_n.skipAnimations)&&(u=!0,zh(f),f.delay=0),f.allowFlatten=!s.type&&!s.ease,u&&!a&&t.get()!==void 0){const p=VE(f.keyframes,s);if(p!==void 0){it.update(()=>{f.onUpdate(p),f.onComplete()});return}}return s.isSync?new Af(f):new _5(f)};function QE({protectedKeys:e,needsAnimating:t},r){const n=e.hasOwnProperty(r)&&t[r]!==!0;return t[r]=!1,n}function b1(e,t,{delay:r=0,transitionOverride:n,type:i}={}){let{transition:a=e.getDefaultTransition(),transitionEnd:l,...s}=t;n&&(a=n);const o=[],c=i&&e.animationState&&e.animationState.getState()[i];for(const f in s){const u=e.getValue(f,e.latestValues[f]??null),p=s[f];if(p===void 0||c&&QE(c,f))continue;const _={delay:r,...If(a||{},f)},y=u.get();if(y!==void 0&&!u.isAnimating&&!Array.isArray(p)&&p===y&&!_.velocity)continue;let v=!1;if(window.MotionHandoffAnimation){const m=x1(e);if(m){const d=window.MotionHandoffAnimation(m,f,it);d!==null&&(_.startTime=d,v=!0)}}qh(e,f),u.start(qf(f,u,p,e.shouldReduceMotion&&zy.has(f)?{type:!1}:_,e,v));const h=u.animation;h&&o.push(h)}return l&&Promise.all(o).then(()=>{it.update(()=>{l&&zE(e,l)})}),o}function C1(e,t,r,n=0,i=1){const a=Array.from(e).sort((c,f)=>c.sortNodePosition(f)).indexOf(t),l=e.size,s=(l-1)*n;return typeof r=="function"?r(a,l):i===1?a*n:s-a*n}function Xh(e,t,r={}){var o;const n=oi(e,t,r.type==="exit"?(o=e.presenceContext)==null?void 0:o.custom:void 0);let{transition:i=e.getDefaultTransition()||{}}=n||{};r.transitionOverride&&(i=r.transitionOverride);const a=n?()=>Promise.all(b1(e,n,r)):()=>Promise.resolve(),l=e.variantChildren&&e.variantChildren.size?(c=0)=>{const{delayChildren:f=0,staggerChildren:u,staggerDirection:p}=i;return ZE(e,t,c,f,u,p,r)}:()=>Promise.resolve(),{when:s}=i;if(s){const[c,f]=s==="beforeChildren"?[a,l]:[l,a];return c().then(()=>f())}else return Promise.all([a(),l(r.delay)])}function ZE(e,t,r=0,n=0,i=0,a=1,l){const s=[];for(const o of e.variantChildren)o.notify("AnimationStart",t),s.push(Xh(o,t,{...l,delay:r+(typeof n=="function"?0:n)+C1(e.variantChildren,o,n,i,a)}).then(()=>o.notify("AnimationComplete",t)));return Promise.all(s)}function ek(e,t,r={}){e.notify("AnimationStart",t);let n;if(Array.isArray(t)){const i=t.map(a=>Xh(e,a,r));n=Promise.all(i)}else if(typeof t=="string")n=Xh(e,t,r);else{const i=typeof t=="function"?oi(e,t,r.custom):t;n=Promise.all(b1(e,i,r))}return n.then(()=>{e.notify("AnimationComplete",t)})}function E1(e,t){if(!Array.isArray(t))return!1;const r=t.length;if(r!==e.length)return!1;for(let n=0;n<r;n++)if(t[n]!==e[n])return!1;return!0}const tk=Hf.length;function k1(e){if(!e)return;if(!e.isControllingVariants){const r=e.parent?k1(e.parent)||{}:{};return e.props.initial!==void 0&&(r.initial=e.props.initial),r}const t={};for(let r=0;r<tk;r++){const n=Hf[r],i=e.props[n];(Fo(i)||i===!1)&&(t[n]=i)}return t}const rk=[...Ff].reverse(),nk=Ff.length;function sk(e){return t=>Promise.all(t.map(({animation:r,options:n})=>ek(e,r,n)))}function ik(e){let t=sk(e),r=_g(),n=!0;const i=o=>(c,f)=>{var p;const u=oi(e,f,o==="exit"?(p=e.presenceContext)==null?void 0:p.custom:void 0);if(u){const{transition:_,transitionEnd:y,...v}=u;c={...c,...v,...y}}return c};function a(o){t=o(e)}function l(o){const{props:c}=e,f=k1(e.parent)||{},u=[],p=new Set;let _={},y=1/0;for(let h=0;h<nk;h++){const m=rk[h],d=r[m],g=c[m]!==void 0?c[m]:f[m],w=Fo(g),b=m===o?d.isActive:null;b===!1&&(y=h);let x=g===f[m]&&g!==c[m]&&w;if(x&&n&&e.manuallyAnimateOnMount&&(x=!1),d.protectedKeys={..._},!d.isActive&&b===null||!g&&!d.prevProp||yc(g)||typeof g=="boolean")continue;const C=ok(d.prevProp,g);let S=C||m===o&&d.isActive&&!x&&w||h>y&&w,k=!1;const L=Array.isArray(g)?g:[g];let A=L.reduce(i(m),{});b===!1&&(A={});const{prevResolvedValues:M={}}=d,D={...M,...A},O=H=>{S=!0,p.has(H)&&(k=!0,p.delete(H)),d.needsAnimating[H]=!0;const I=e.getValue(H);I&&(I.liveStyle=!1)};for(const H in D){const I=A[H],R=M[H];if(_.hasOwnProperty(H))continue;let P=!1;Gh(I)&&Gh(R)?P=!E1(I,R):P=I!==R,P?I!=null?O(H):p.add(H):I!==void 0&&p.has(H)?O(H):d.protectedKeys[H]=!0}d.prevProp=g,d.prevResolvedValues=A,d.isActive&&(_={..._,...A}),n&&e.blockInitialAnimation&&(S=!1);const z=x&&C;S&&(!z||k)&&u.push(...L.map(H=>{const I={type:m};if(typeof H=="string"&&n&&!z&&e.manuallyAnimateOnMount&&e.parent){const{parent:R}=e,P=oi(R,H);if(R.enteringChildren&&P){const{delayChildren:N}=P.transition||{};I.delay=C1(R.enteringChildren,e,N)}}return{animation:H,options:I}}))}if(p.size){const h={};if(typeof c.initial!="boolean"){const m=oi(e,Array.isArray(c.initial)?c.initial[0]:c.initial);m&&m.transition&&(h.transition=m.transition)}p.forEach(m=>{const d=e.getBaseTarget(m),g=e.getValue(m);g&&(g.liveStyle=!0),h[m]=d??null}),u.push({animation:h})}let v=!!u.length;return n&&(c.initial===!1||c.initial===c.animate)&&!e.manuallyAnimateOnMount&&(v=!1),n=!1,v?t(u):Promise.resolve()}function s(o,c){var u;if(r[o].isActive===c)return Promise.resolve();(u=e.variantChildren)==null||u.forEach(p=>{var _;return(_=p.animationState)==null?void 0:_.setActive(o,c)}),r[o].isActive=c;const f=l(o);for(const p in r)r[p].protectedKeys={};return f}return{animateChanges:l,setActive:s,setAnimateFunction:a,getState:()=>r,reset:()=>{r=_g()}}}function ok(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!E1(t,e):!1}function es(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function _g(){return{animate:es(!0),whileInView:es(),whileHover:es(),whileTap:es(),whileDrag:es(),whileFocus:es(),exit:es()}}class Yn{constructor(t){this.isMounted=!1,this.node=t}update(){}}class ak extends Yn{constructor(t){super(t),t.animationState||(t.animationState=ik(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();yc(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:r}=this.node.prevProps||{};t!==r&&this.updateAnimationControlsSubscription()}unmount(){var t;this.node.animationState.reset(),(t=this.unmountControls)==null||t.call(this)}}let lk=0;class ck extends Yn{constructor(){super(...arguments),this.id=lk++}update(){if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:r}=this.node.presenceContext,{isPresent:n}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===n)return;const i=this.node.animationState.setActive("exit",!t);r&&!t&&i.then(()=>{r(this.id)})}mount(){const{register:t,onExitComplete:r}=this.node.presenceContext||{};r&&r(this.id),t&&(this.unmount=t(this.id))}unmount(){}}const uk={animation:{Feature:ak},exit:{Feature:ck}};function Ho(e,t,r,n={passive:!0}){return e.addEventListener(t,r,n),()=>e.removeEventListener(t,r)}function sa(e){return{point:{x:e.pageX,y:e.pageY}}}const hk=e=>t=>Nf(t)&&e(t,sa(t));function ho(e,t,r,n){return Ho(e,t,hk(r),n)}const L1=1e-4,dk=1-L1,fk=1+L1,T1=.01,pk=0-T1,mk=0+T1;function Zt(e){return e.max-e.min}function gk(e,t,r){return Math.abs(e-t)<=r}function yg(e,t,r,n=.5){e.origin=n,e.originPoint=lt(t.min,t.max,e.origin),e.scale=Zt(r)/Zt(t),e.translate=lt(r.min,r.max,e.origin)-e.originPoint,(e.scale>=dk&&e.scale<=fk||isNaN(e.scale))&&(e.scale=1),(e.translate>=pk&&e.translate<=mk||isNaN(e.translate))&&(e.translate=0)}function fo(e,t,r,n){yg(e.x,t.x,r.x,n?n.originX:void 0),yg(e.y,t.y,r.y,n?n.originY:void 0)}function wg(e,t,r){e.min=r.min+t.min,e.max=e.min+Zt(t)}function vk(e,t,r){wg(e.x,t.x,r.x),wg(e.y,t.y,r.y)}function Sg(e,t,r){e.min=t.min-r.min,e.max=e.min+Zt(t)}function zl(e,t,r){Sg(e.x,t.x,r.x),Sg(e.y,t.y,r.y)}function gr(e){return[e("x"),e("y")]}const R1=({current:e})=>e?e.ownerDocument.defaultView:null,xg=(e,t)=>Math.abs(e-t);function _k(e,t){const r=xg(e.x,t.x),n=xg(e.y,t.y);return Math.sqrt(r**2+n**2)}const bg=new Set(["auto","scroll"]);class D1{constructor(t,r,{transformPagePoint:n,contextWindow:i=window,dragSnapToOrigin:a=!1,distanceThreshold:l=3,element:s}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.scrollPositions=new Map,this.removeScrollListeners=null,this.onElementScroll=_=>{this.handleScroll(_.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const _=uu(this.lastMoveEventInfo,this.history),y=this.startEvent!==null,v=_k(_.offset,{x:0,y:0})>=this.distanceThreshold;if(!y&&!v)return;const{point:h}=_,{timestamp:m}=Nt;this.history.push({...h,timestamp:m});const{onStart:d,onMove:g}=this.handlers;y||(d&&d(this.lastMoveEvent,_),this.startEvent=this.lastMoveEvent),g&&g(this.lastMoveEvent,_)},this.handlePointerMove=(_,y)=>{this.lastMoveEvent=_,this.lastMoveEventInfo=cu(y,this.transformPagePoint),it.update(this.updatePoint,!0)},this.handlePointerUp=(_,y)=>{this.end();const{onEnd:v,onSessionEnd:h,resumeAnimation:m}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&m&&m(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const d=uu(_.type==="pointercancel"?this.lastMoveEventInfo:cu(y,this.transformPagePoint),this.history);this.startEvent&&v&&v(_,d),h&&h(_,d)},!Nf(t))return;this.dragSnapToOrigin=a,this.handlers=r,this.transformPagePoint=n,this.distanceThreshold=l,this.contextWindow=i||window;const o=sa(t),c=cu(o,this.transformPagePoint),{point:f}=c,{timestamp:u}=Nt;this.history=[{...f,timestamp:u}];const{onSessionStart:p}=r;p&&p(t,uu(c,this.history)),this.removeListeners=ta(ho(this.contextWindow,"pointermove",this.handlePointerMove),ho(this.contextWindow,"pointerup",this.handlePointerUp),ho(this.contextWindow,"pointercancel",this.handlePointerUp)),s&&this.startScrollTracking(s)}startScrollTracking(t){let r=t.parentElement;for(;r;){const n=getComputedStyle(r);(bg.has(n.overflowX)||bg.has(n.overflowY))&&this.scrollPositions.set(r,{x:r.scrollLeft,y:r.scrollTop}),r=r.parentElement}this.scrollPositions.set(window,{x:window.scrollX,y:window.scrollY}),window.addEventListener("scroll",this.onElementScroll,{capture:!0,passive:!0}),window.addEventListener("scroll",this.onWindowScroll,{passive:!0}),this.removeScrollListeners=()=>{window.removeEventListener("scroll",this.onElementScroll,{capture:!0}),window.removeEventListener("scroll",this.onWindowScroll)}}handleScroll(t){const r=this.scrollPositions.get(t);if(!r)return;const n=t===window,i=n?{x:window.scrollX,y:window.scrollY}:{x:t.scrollLeft,y:t.scrollTop},a={x:i.x-r.x,y:i.y-r.y};a.x===0&&a.y===0||(n?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=a.x,this.lastMoveEventInfo.point.y+=a.y):this.history.length>0&&(this.history[0].x-=a.x,this.history[0].y-=a.y),this.scrollPositions.set(t,i),it.update(this.updatePoint,!0))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),Vn(this.updatePoint)}}function cu(e,t){return t?{point:t(e.point)}:e}function Cg(e,t){return{x:e.x-t.x,y:e.y-t.y}}function uu({point:e},t){return{point:e,delta:Cg(e,M1(t)),offset:Cg(e,yk(t)),velocity:wk(t,.1)}}function yk(e){return e[0]}function M1(e){return e[e.length-1]}function wk(e,t){if(e.length<2)return{x:0,y:0};let r=e.length-1,n=null;const i=M1(e);for(;r>=0&&(n=e[r],!(i.timestamp-n.timestamp>fn(t)));)r--;if(!n)return{x:0,y:0};const a=Sr(i.timestamp-n.timestamp);if(a===0)return{x:0,y:0};const l={x:(i.x-n.x)/a,y:(i.y-n.y)/a};return l.x===1/0&&(l.x=0),l.y===1/0&&(l.y=0),l}function Sk(e,{min:t,max:r},n){return t!==void 0&&e<t?e=n?lt(t,e,n.min):Math.max(e,t):r!==void 0&&e>r&&(e=n?lt(r,e,n.max):Math.min(e,r)),e}function Eg(e,t,r){return{min:t!==void 0?e.min+t:void 0,max:r!==void 0?e.max+r-(e.max-e.min):void 0}}function xk(e,{top:t,left:r,bottom:n,right:i}){return{x:Eg(e.x,r,i),y:Eg(e.y,t,n)}}function kg(e,t){let r=t.min-e.min,n=t.max-e.max;return t.max-t.min<e.max-e.min&&([r,n]=[n,r]),{min:r,max:n}}function bk(e,t){return{x:kg(e.x,t.x),y:kg(e.y,t.y)}}function Ck(e,t){let r=.5;const n=Zt(e),i=Zt(t);return i>n?r=Bo(t.min,t.max-n,e.min):n>i&&(r=Bo(e.min,e.max-i,t.min)),Kr(0,1,r)}function Ek(e,t){const r={};return t.min!==void 0&&(r.min=t.min-e.min),t.max!==void 0&&(r.max=t.max-e.min),r}const Yh=.35;function kk(e=Yh){return e===!1?e=0:e===!0&&(e=Yh),{x:Lg(e,"left","right"),y:Lg(e,"top","bottom")}}function Lg(e,t,r){return{min:Tg(e,t),max:Tg(e,r)}}function Tg(e,t){return typeof e=="number"?e:e[t]||0}const Lk=new WeakMap;class Tk{constructor(t){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=wt(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=t}start(t,{snapToCursor:r=!1,distanceThreshold:n}={}){const{presenceContext:i}=this.visualElement;if(i&&i.isPresent===!1)return;const a=u=>{r?(this.stopAnimation(),this.snapToCursor(sa(u).point)):this.pauseAnimation()},l=(u,p)=>{this.stopAnimation();const{drag:_,dragPropagation:y,onDragStart:v}=this.getProps();if(_&&!y&&(this.openDragLock&&this.openDragLock(),this.openDragLock=I5(_),!this.openDragLock))return;this.latestPointerEvent=u,this.latestPanInfo=p,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),gr(m=>{let d=this.getAxisMotionValue(m).get()||0;if(Vr.test(d)){const{projection:g}=this.visualElement;if(g&&g.layout){const w=g.layout.layoutBox[m];w&&(d=Zt(w)*(parseFloat(d)/100))}}this.originPoint[m]=d}),v&&it.postRender(()=>v(u,p)),qh(this.visualElement,"transform");const{animationState:h}=this.visualElement;h&&h.setActive("whileDrag",!0)},s=(u,p)=>{this.latestPointerEvent=u,this.latestPanInfo=p;const{dragPropagation:_,dragDirectionLock:y,onDirectionLock:v,onDrag:h}=this.getProps();if(!_&&!this.openDragLock)return;const{offset:m}=p;if(y&&this.currentDirection===null){this.currentDirection=Rk(m),this.currentDirection!==null&&v&&v(this.currentDirection);return}this.updateAxis("x",p.point,m),this.updateAxis("y",p.point,m),this.visualElement.render(),h&&h(u,p)},o=(u,p)=>{this.latestPointerEvent=u,this.latestPanInfo=p,this.stop(u,p),this.latestPointerEvent=null,this.latestPanInfo=null},c=()=>gr(u=>{var p;return this.getAnimationState(u)==="paused"&&((p=this.getAxisMotionValue(u).animation)==null?void 0:p.play())}),{dragSnapToOrigin:f}=this.getProps();this.panSession=new D1(t,{onSessionStart:a,onStart:l,onMove:s,onSessionEnd:o,resumeAnimation:c},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:f,distanceThreshold:n,contextWindow:R1(this.visualElement),element:this.visualElement.current})}stop(t,r){const n=t||this.latestPointerEvent,i=r||this.latestPanInfo,a=this.isDragging;if(this.cancel(),!a||!i||!n)return;const{velocity:l}=i;this.startAnimation(l);const{onDragEnd:s}=this.getProps();s&&it.postRender(()=>s(n,i))}cancel(){this.isDragging=!1;const{projection:t,animationState:r}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:n}=this.getProps();!n&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),r&&r.setActive("whileDrag",!1)}updateAxis(t,r,n){const{drag:i}=this.getProps();if(!n||!Ma(t,i,this.currentDirection))return;const a=this.getAxisMotionValue(t);let l=this.originPoint[t]+n[t];this.constraints&&this.constraints[t]&&(l=Sk(l,this.constraints[t],this.elastic[t])),a.set(l)}resolveConstraints(){var a;const{dragConstraints:t,dragElastic:r}=this.getProps(),n=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(a=this.visualElement.projection)==null?void 0:a.layout,i=this.constraints;t&&Yi(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):t&&n?this.constraints=xk(n.layoutBox,t):this.constraints=!1,this.elastic=kk(r),i!==this.constraints&&n&&this.constraints&&!this.hasMutatedConstraints&&gr(l=>{this.constraints!==!1&&this.getAxisMotionValue(l)&&(this.constraints[l]=Ek(n.layoutBox[l],this.constraints[l]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:r}=this.getProps();if(!t||!Yi(t))return!1;const n=t.current,{projection:i}=this.visualElement;if(!i||!i.layout)return!1;const a=ME(n,i.root,this.visualElement.getTransformPagePoint());let l=bk(i.layout.layoutBox,a);if(r){const s=r(TE(l));this.hasMutatedConstraints=!!s,s&&(l=p1(s))}return l}startAnimation(t){const{drag:r,dragMomentum:n,dragElastic:i,dragTransition:a,dragSnapToOrigin:l,onDragTransitionEnd:s}=this.getProps(),o=this.constraints||{},c=gr(f=>{if(!Ma(f,r,this.currentDirection))return;let u=o&&o[f]||{};l&&(u={min:0,max:0});const p=i?200:1e6,_=i?40:1e7,y={type:"inertia",velocity:n?t[f]:0,bounceStiffness:p,bounceDamping:_,timeConstant:750,restDelta:1,restSpeed:10,...a,...u};return this.startAxisValueAnimation(f,y)});return Promise.all(c).then(s)}startAxisValueAnimation(t,r){const n=this.getAxisMotionValue(t);return qh(this.visualElement,t),n.start(qf(t,n,0,r,this.visualElement,!1))}stopAnimation(){gr(t=>this.getAxisMotionValue(t).stop())}pauseAnimation(){gr(t=>{var r;return(r=this.getAxisMotionValue(t).animation)==null?void 0:r.pause()})}getAnimationState(t){var r;return(r=this.getAxisMotionValue(t).animation)==null?void 0:r.state}getAxisMotionValue(t){const r=`_drag${t.toUpperCase()}`,n=this.visualElement.getProps(),i=n[r];return i||this.visualElement.getValue(t,(n.initial?n.initial[t]:void 0)||0)}snapToCursor(t){gr(r=>{const{drag:n}=this.getProps();if(!Ma(r,n,this.currentDirection))return;const{projection:i}=this.visualElement,a=this.getAxisMotionValue(r);if(i&&i.layout){const{min:l,max:s}=i.layout.layoutBox[r],o=a.get()||0;a.set(t[r]-lt(l,s,.5)+o)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:r}=this.getProps(),{projection:n}=this.visualElement;if(!Yi(r)||!n||!this.constraints)return;this.stopAnimation();const i={x:0,y:0};gr(l=>{const s=this.getAxisMotionValue(l);if(s&&this.constraints!==!1){const o=s.get();i[l]=Ck({min:o,max:o},this.constraints[l])}});const{transformTemplate:a}=this.visualElement.getProps();this.visualElement.current.style.transform=a?a({},""):"none",n.root&&n.root.updateScroll(),n.updateLayout(),this.resolveConstraints(),gr(l=>{if(!Ma(l,t,null))return;const s=this.getAxisMotionValue(l),{min:o,max:c}=this.constraints[l];s.set(lt(o,c,i[l]))})}addListeners(){if(!this.visualElement.current)return;Lk.set(this.visualElement,this);const t=this.visualElement.current,r=ho(t,"pointerdown",o=>{const{drag:c,dragListener:f=!0}=this.getProps();c&&f&&!Qy(o.target)&&this.start(o)}),n=()=>{const{dragConstraints:o}=this.getProps();Yi(o)&&o.current&&(this.constraints=this.resolveRefConstraints())},{projection:i}=this.visualElement,a=i.addEventListener("measure",n);i&&!i.layout&&(i.root&&i.root.updateScroll(),i.updateLayout()),it.read(n);const l=Ho(window,"resize",()=>this.scalePositionWithinConstraints()),s=i.addEventListener("didUpdate",({delta:o,hasLayoutChanged:c})=>{this.isDragging&&c&&(gr(f=>{const u=this.getAxisMotionValue(f);u&&(this.originPoint[f]+=o[f].translate,u.set(u.get()+o[f].translate))}),this.visualElement.render())});return()=>{l(),r(),a(),s&&s()}}getProps(){const t=this.visualElement.getProps(),{drag:r=!1,dragDirectionLock:n=!1,dragPropagation:i=!1,dragConstraints:a=!1,dragElastic:l=Yh,dragMomentum:s=!0}=t;return{...t,drag:r,dragDirectionLock:n,dragPropagation:i,dragConstraints:a,dragElastic:l,dragMomentum:s}}}function Ma(e,t,r){return(t===!0||t===e)&&(r===null||r===e)}function Rk(e,t=10){let r=null;return Math.abs(e.y)>t?r="y":Math.abs(e.x)>t&&(r="x"),r}class Dk extends Yn{constructor(t){super(t),this.removeGroupControls=br,this.removeListeners=br,this.controls=new Tk(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||br}update(){const{dragControls:t}=this.node.getProps(),{dragControls:r}=this.node.prevProps||{};t!==r&&(this.removeGroupControls(),t&&(this.removeGroupControls=t.subscribe(this.controls)))}unmount(){this.removeGroupControls(),this.removeListeners()}}const Rg=e=>(t,r)=>{e&&it.postRender(()=>e(t,r))};class Mk extends Yn{constructor(){super(...arguments),this.removePointerDownListener=br}onPointerDown(t){this.session=new D1(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:R1(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:r,onPan:n,onPanEnd:i}=this.node.getProps();return{onSessionStart:Rg(t),onStart:Rg(r),onMove:n,onEnd:(a,l)=>{delete this.session,i&&it.postRender(()=>i(a,l))}}}mount(){this.removePointerDownListener=ho(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}const il={hasAnimatedSinceResize:!0,hasEverUpdated:!1};let hu=!1;class Ak extends E.Component{componentDidMount(){const{visualElement:t,layoutGroup:r,switchLayoutGroup:n,layoutId:i}=this.props,{projection:a}=t;a&&(r.group&&r.group.add(a),n&&n.register&&i&&n.register(a),hu&&a.root.didUpdate(),a.addEventListener("animationComplete",()=>{this.safeToRemove()}),a.setOptions({...a.options,onExitComplete:()=>this.safeToRemove()})),il.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:r,visualElement:n,drag:i,isPresent:a}=this.props,{projection:l}=n;return l&&(l.isPresent=a,hu=!0,i||t.layoutDependency!==r||r===void 0||t.isPresent!==a?l.willUpdate():this.safeToRemove(),t.isPresent!==a&&(a?l.promote():l.relegate()||it.postRender(()=>{const s=l.getStack();(!s||!s.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),Bf.postRender(()=>{!t.currentAnimation&&t.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:r,switchLayoutGroup:n}=this.props,{projection:i}=t;hu=!0,i&&(i.scheduleCheckAfterUnmount(),r&&r.group&&r.group.remove(i),n&&n.deregister&&n.deregister(i))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function A1(e){const[t,r]=e1(),n=E.useContext(mf);return T.jsx(Ak,{...e,layoutGroup:n,switchLayoutGroup:E.useContext(d1),isPresent:t,safeToRemove:r})}function Pk(e,t,r){const n=Gt(e)?e:gi(e);return n.start(qf("",n,t,r)),n.animation}const Ik=(e,t)=>e.depth-t.depth;class Ok{constructor(){this.children=[],this.isDirty=!1}add(t){_f(this.children,t),this.isDirty=!0}remove(t){yf(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(Ik),this.isDirty=!1,this.children.forEach(t)}}function Bk(e,t){const r=Qt.now(),n=({timestamp:i})=>{const a=i-r;a>=t&&(Vn(n),e(a-t))};return it.setup(n,!0),()=>Vn(n)}const P1=["TopLeft","TopRight","BottomLeft","BottomRight"],Nk=P1.length,Dg=e=>typeof e=="string"?parseFloat(e):e,Mg=e=>typeof e=="number"||we.test(e);function jk(e,t,r,n,i,a){i?(e.opacity=lt(0,r.opacity??1,Fk(n)),e.opacityExit=lt(t.opacity??1,0,Hk(n))):a&&(e.opacity=lt(t.opacity??1,r.opacity??1,n));for(let l=0;l<Nk;l++){const s=`border${P1[l]}Radius`;let o=Ag(t,s),c=Ag(r,s);if(o===void 0&&c===void 0)continue;o||(o=0),c||(c=0),o===0||c===0||Mg(o)===Mg(c)?(e[s]=Math.max(lt(Dg(o),Dg(c),n),0),(Vr.test(c)||Vr.test(o))&&(e[s]+="%")):e[s]=c}(t.rotate||r.rotate)&&(e.rotate=lt(t.rotate||0,r.rotate||0,n))}function Ag(e,t){return e[t]!==void 0?e[t]:e.borderRadius}const Fk=I1(0,.5,_y),Hk=I1(.5,.95,br);function I1(e,t,r){return n=>n<e?0:n>t?1:r(Bo(e,t,n))}function Pg(e,t){e.min=t.min,e.max=t.max}function Lr(e,t){Pg(e.x,t.x),Pg(e.y,t.y)}function Ig(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}function Og(e,t,r,n,i){return e-=t,e=Hl(e,1/r,n),i!==void 0&&(e=Hl(e,1/i,n)),e}function $k(e,t=0,r=1,n=.5,i,a=e,l=e){if(Vr.test(t)&&(t=parseFloat(t),t=lt(l.min,l.max,t/100)-l.min),typeof t!="number")return;let s=lt(a.min,a.max,n);e===a&&(s-=t),e.min=Og(e.min,t,r,s,i),e.max=Og(e.max,t,r,s,i)}function Bg(e,t,[r,n,i],a,l){$k(e,t[r],t[n],t[i],t.scale,a,l)}const zk=["x","scaleX","originX"],Uk=["y","scaleY","originY"];function Ng(e,t,r,n){Bg(e.x,t,zk,r?r.x:void 0,n?n.x:void 0),Bg(e.y,t,Uk,r?r.y:void 0,n?n.y:void 0)}function jg(e){return e.translate===0&&e.scale===1}function O1(e){return jg(e.x)&&jg(e.y)}function Fg(e,t){return e.min===t.min&&e.max===t.max}function Wk(e,t){return Fg(e.x,t.x)&&Fg(e.y,t.y)}function Hg(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function B1(e,t){return Hg(e.x,t.x)&&Hg(e.y,t.y)}function $g(e){return Zt(e.x)/Zt(e.y)}function zg(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}class Vk{constructor(){this.members=[]}add(t){_f(this.members,t),t.scheduleRender()}remove(t){if(yf(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const r=this.members[this.members.length-1];r&&this.promote(r)}}relegate(t){const r=this.members.findIndex(i=>t===i);if(r===0)return!1;let n;for(let i=r;i>=0;i--){const a=this.members[i];if(a.isPresent!==!1){n=a;break}}return n?(this.promote(n),!0):!1}promote(t,r){const n=this.lead;if(t!==n&&(this.prevLead=n,this.lead=t,t.show(),n)){n.instance&&n.scheduleRender(),t.scheduleRender(),t.resumeFrom=n,r&&(t.resumeFrom.preserveOpacity=!0),n.snapshot&&(t.snapshot=n.snapshot,t.snapshot.latestValues=n.animationValues||n.latestValues),t.root&&t.root.isUpdating&&(t.isLayoutDirty=!0);const{crossfade:i}=t.options;i===!1&&n.hide()}}exitAnimationComplete(){this.members.forEach(t=>{const{options:r,resumingFrom:n}=t;r.onExitComplete&&r.onExitComplete(),n&&n.options.onExitComplete&&n.options.onExitComplete()})}scheduleRender(){this.members.forEach(t=>{t.instance&&t.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function Kk(e,t,r){let n="";const i=e.x.translate/t.x,a=e.y.translate/t.y,l=(r==null?void 0:r.z)||0;if((i||a||l)&&(n=`translate3d(${i}px, ${a}px, ${l}px) `),(t.x!==1||t.y!==1)&&(n+=`scale(${1/t.x}, ${1/t.y}) `),r){const{transformPerspective:c,rotate:f,rotateX:u,rotateY:p,skewX:_,skewY:y}=r;c&&(n=`perspective(${c}px) ${n}`),f&&(n+=`rotate(${f}deg) `),u&&(n+=`rotateX(${u}deg) `),p&&(n+=`rotateY(${p}deg) `),_&&(n+=`skewX(${_}deg) `),y&&(n+=`skewY(${y}deg) `)}const s=e.x.scale*t.x,o=e.y.scale*t.y;return(s!==1||o!==1)&&(n+=`scale(${s}, ${o})`),n||"none"}const du=["","X","Y","Z"],Gk=1e3;let qk=0;function fu(e,t,r,n){const{latestValues:i}=t;i[e]&&(r[e]=i[e],t.setStaticValue(e,0),n&&(n[e]=0))}function N1(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const r=x1(t);if(window.MotionHasOptimisedAnimation(r,"transform")){const{layout:i,layoutId:a}=e.options;window.MotionCancelOptimisedAnimation(r,"transform",it,!(i||a))}const{parent:n}=e;n&&!n.hasCheckedOptimisedAppear&&N1(n)}function j1({attachResizeListener:e,defaultParent:t,measureScroll:r,checkIsScrollRoot:n,resetTransform:i}){return class{constructor(l={},s=t==null?void 0:t()){this.id=qk++,this.animationId=0,this.animationCommitId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.layoutVersion=0,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,this.nodes.forEach(Jk),this.nodes.forEach(tL),this.nodes.forEach(rL),this.nodes.forEach(Qk)},this.resolvedRelativeTargetAt=0,this.linkedParentVersion=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=l,this.root=s?s.root||s:this,this.path=s?[...s.path,s]:[],this.parent=s,this.depth=s?s.depth+1:0;for(let o=0;o<this.path.length;o++)this.path[o].shouldResetTransform=!0;this.root===this&&(this.nodes=new Ok)}addEventListener(l,s){return this.eventHandlers.has(l)||this.eventHandlers.set(l,new xf),this.eventHandlers.get(l).add(s)}notifyListeners(l,...s){const o=this.eventHandlers.get(l);o&&o.notify(...s)}hasListeners(l){return this.eventHandlers.has(l)}mount(l){if(this.instance)return;this.isSVG=Zy(l)&&!F5(l),this.instance=l;const{layoutId:s,layout:o,visualElement:c}=this.options;if(c&&!c.current&&c.mount(l),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(o||s)&&(this.isLayoutDirty=!0),e){let f,u=0;const p=()=>this.root.updateBlockedByResize=!1;it.read(()=>{u=window.innerWidth}),e(l,()=>{const _=window.innerWidth;_!==u&&(u=_,this.root.updateBlockedByResize=!0,f&&f(),f=Bk(p,250),il.hasAnimatedSinceResize&&(il.hasAnimatedSinceResize=!1,this.nodes.forEach(Vg)))})}s&&this.root.registerSharedNode(s,this),this.options.animate!==!1&&c&&(s||o)&&this.addEventListener("didUpdate",({delta:f,hasLayoutChanged:u,hasRelativeLayoutChanged:p,layout:_})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const y=this.options.transition||c.getDefaultTransition()||aL,{onLayoutAnimationStart:v,onLayoutAnimationComplete:h}=c.getProps(),m=!this.targetLayout||!B1(this.targetLayout,_),d=!u&&p;if(this.options.layoutRoot||this.resumeFrom||d||u&&(m||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const g={...If(y,"layout"),onPlay:v,onComplete:h};(c.shouldReduceMotion||this.options.layoutRoot)&&(g.delay=0,g.type=!1),this.startAnimation(g),this.setAnimationOrigin(f,d)}else u||Vg(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=_})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const l=this.getStack();l&&l.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),Vn(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(nL),this.animationId++)}getTransformTemplate(){const{visualElement:l}=this.options;return l&&l.getProps().transformTemplate}willUpdate(l=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&N1(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let f=0;f<this.path.length;f++){const u=this.path[f];u.shouldResetTransform=!0,u.updateScroll("snapshot"),u.options.layoutRoot&&u.willUpdate(!1)}const{layoutId:s,layout:o}=this.options;if(s===void 0&&!o)return;const c=this.getTransformTemplate();this.prevTransformTemplateValue=c?c(this.latestValues,""):void 0,this.updateSnapshot(),l&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(Ug);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(Wg);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(eL),this.nodes.forEach(Xk),this.nodes.forEach(Yk)):this.nodes.forEach(Wg),this.clearAllSnapshots();const s=Qt.now();Nt.delta=Kr(0,1e3/60,s-Nt.timestamp),Nt.timestamp=s,Nt.isProcessing=!0,eu.update.process(Nt),eu.preRender.process(Nt),eu.render.process(Nt),Nt.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,Bf.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(Zk),this.sharedNodes.forEach(sL)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,it.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){it.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!Zt(this.snapshot.measuredBox.x)&&!Zt(this.snapshot.measuredBox.y)&&(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let o=0;o<this.path.length;o++)this.path[o].updateScroll();const l=this.layout;this.layout=this.measure(!1),this.layoutVersion++,this.layoutCorrected=wt(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:s}=this.options;s&&s.notify("LayoutMeasure",this.layout.layoutBox,l?l.layoutBox:void 0)}updateScroll(l="measure"){let s=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===l&&(s=!1),s&&this.instance){const o=n(this.instance);this.scroll={animationId:this.root.animationId,phase:l,isRoot:o,offset:r(this.instance),wasRoot:this.scroll?this.scroll.isRoot:o}}}resetTransform(){if(!i)return;const l=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,s=this.projectionDelta&&!O1(this.projectionDelta),o=this.getTransformTemplate(),c=o?o(this.latestValues,""):void 0,f=c!==this.prevTransformTemplateValue;l&&this.instance&&(s||as(this.latestValues)||f)&&(i(this.instance,c),this.shouldResetTransform=!1,this.scheduleRender())}measure(l=!0){const s=this.measurePageBox();let o=this.removeElementScroll(s);return l&&(o=this.removeTransform(o)),lL(o),{animationId:this.root.animationId,measuredBox:s,layoutBox:o,latestValues:{},source:this.id}}measurePageBox(){var c;const{visualElement:l}=this.options;if(!l)return wt();const s=l.measureViewportBox();if(!(((c=this.scroll)==null?void 0:c.wasRoot)||this.path.some(cL))){const{scroll:f}=this.root;f&&(qs(s.x,f.offset.x),qs(s.y,f.offset.y))}return s}removeElementScroll(l){var o;const s=wt();if(Lr(s,l),(o=this.scroll)!=null&&o.wasRoot)return s;for(let c=0;c<this.path.length;c++){const f=this.path[c],{scroll:u,options:p}=f;f!==this.root&&u&&p.layoutScroll&&(u.wasRoot&&Lr(s,l),qs(s.x,u.offset.x),qs(s.y,u.offset.y))}return s}applyTransform(l,s=!1){const o=wt();Lr(o,l);for(let c=0;c<this.path.length;c++){const f=this.path[c];!s&&f.options.layoutScroll&&f.scroll&&f!==f.root&&Xs(o,{x:-f.scroll.offset.x,y:-f.scroll.offset.y}),as(f.latestValues)&&Xs(o,f.latestValues)}return as(this.latestValues)&&Xs(o,this.latestValues),o}removeTransform(l){const s=wt();Lr(s,l);for(let o=0;o<this.path.length;o++){const c=this.path[o];if(!c.instance||!as(c.latestValues))continue;Vh(c.latestValues)&&c.updateSnapshot();const f=wt(),u=c.measurePageBox();Lr(f,u),Ng(s,c.latestValues,c.snapshot?c.snapshot.layoutBox:void 0,f)}return as(this.latestValues)&&Ng(s,this.latestValues),s}setTargetDelta(l){this.targetDelta=l,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(l){this.options={...this.options,...l,crossfade:l.crossfade!==void 0?l.crossfade:!0}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==Nt.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(l=!1){var _;const s=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=s.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=s.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=s.isSharedProjectionDirty);const o=!!this.resumingFrom||this!==s;if(!(l||o&&this.isSharedProjectionDirty||this.isProjectionDirty||(_=this.parent)!=null&&_.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:f,layoutId:u}=this.options;if(!this.layout||!(f||u))return;this.resolvedRelativeTargetAt=Nt.timestamp;const p=this.getClosestProjectingParent();p&&this.linkedParentVersion!==p.layoutVersion&&!p.options.layoutRoot&&this.removeRelativeTarget(),!this.targetDelta&&!this.relativeTarget&&(p&&p.layout?this.createRelativeTarget(p,this.layout.layoutBox,p.layout.layoutBox):this.removeRelativeTarget()),!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=wt(),this.targetWithTransforms=wt()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),vk(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):Lr(this.target,this.layout.layoutBox),g1(this.target,this.targetDelta)):Lr(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,p&&!!p.resumingFrom==!!this.resumingFrom&&!p.options.layoutScroll&&p.target&&this.animationProgress!==1?this.createRelativeTarget(p,this.target,p.target):this.relativeParent=this.relativeTarget=void 0))}getClosestProjectingParent(){if(!(!this.parent||Vh(this.parent.latestValues)||m1(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}createRelativeTarget(l,s,o){this.relativeParent=l,this.linkedParentVersion=l.layoutVersion,this.forceRelativeParentToResolveTarget(),this.relativeTarget=wt(),this.relativeTargetOrigin=wt(),zl(this.relativeTargetOrigin,s,o),Lr(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){var y;const l=this.getLead(),s=!!this.resumingFrom||this!==l;let o=!0;if((this.isProjectionDirty||(y=this.parent)!=null&&y.isProjectionDirty)&&(o=!1),s&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(o=!1),this.resolvedRelativeTargetAt===Nt.timestamp&&(o=!1),o)return;const{layout:c,layoutId:f}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(c||f))return;Lr(this.layoutCorrected,this.layout.layoutBox);const u=this.treeScale.x,p=this.treeScale.y;DE(this.layoutCorrected,this.treeScale,this.path,s),l.layout&&!l.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(l.target=l.layout.layoutBox,l.targetWithTransforms=wt());const{target:_}=l;if(!_){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(Ig(this.prevProjectionDelta.x,this.projectionDelta.x),Ig(this.prevProjectionDelta.y,this.projectionDelta.y)),fo(this.projectionDelta,this.layoutCorrected,_,this.latestValues),(this.treeScale.x!==u||this.treeScale.y!==p||!zg(this.projectionDelta.x,this.prevProjectionDelta.x)||!zg(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",_))}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(l=!0){var s;if((s=this.options.visualElement)==null||s.scheduleRender(),l){const o=this.getStack();o&&o.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=Ys(),this.projectionDelta=Ys(),this.projectionDeltaWithTransform=Ys()}setAnimationOrigin(l,s=!1){const o=this.snapshot,c=o?o.latestValues:{},f={...this.latestValues},u=Ys();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!s;const p=wt(),_=o?o.source:void 0,y=this.layout?this.layout.source:void 0,v=_!==y,h=this.getStack(),m=!h||h.members.length<=1,d=!!(v&&!m&&this.options.crossfade===!0&&!this.path.some(oL));this.animationProgress=0;let g;this.mixTargetDelta=w=>{const b=w/1e3;Kg(u.x,l.x,b),Kg(u.y,l.y,b),this.setTargetDelta(u),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(zl(p,this.layout.layoutBox,this.relativeParent.layout.layoutBox),iL(this.relativeTarget,this.relativeTargetOrigin,p,b),g&&Wk(this.relativeTarget,g)&&(this.isProjectionDirty=!1),g||(g=wt()),Lr(g,this.relativeTarget)),v&&(this.animationValues=f,jk(f,c,this.latestValues,b,d,m)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=b},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(l){var s,o,c;this.notifyListeners("animationStart"),(s=this.currentAnimation)==null||s.stop(),(c=(o=this.resumingFrom)==null?void 0:o.currentAnimation)==null||c.stop(),this.pendingAnimation&&(Vn(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=it.update(()=>{il.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=gi(0)),this.currentAnimation=Pk(this.motionValue,[0,1e3],{...l,velocity:0,isSync:!0,onUpdate:f=>{this.mixTargetDelta(f),l.onUpdate&&l.onUpdate(f)},onStop:()=>{},onComplete:()=>{l.onComplete&&l.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const l=this.getStack();l&&l.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(Gk),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const l=this.getLead();let{targetWithTransforms:s,target:o,layout:c,latestValues:f}=l;if(!(!s||!o||!c)){if(this!==l&&this.layout&&c&&F1(this.options.animationType,this.layout.layoutBox,c.layoutBox)){o=this.target||wt();const u=Zt(this.layout.layoutBox.x);o.x.min=l.target.x.min,o.x.max=o.x.min+u;const p=Zt(this.layout.layoutBox.y);o.y.min=l.target.y.min,o.y.max=o.y.min+p}Lr(s,o),Xs(s,f),fo(this.projectionDeltaWithTransform,this.layoutCorrected,s,f)}}registerSharedNode(l,s){this.sharedNodes.has(l)||this.sharedNodes.set(l,new Vk),this.sharedNodes.get(l).add(s);const c=s.options.initialPromotionConfig;s.promote({transition:c?c.transition:void 0,preserveFollowOpacity:c&&c.shouldPreserveFollowOpacity?c.shouldPreserveFollowOpacity(s):void 0})}isLead(){const l=this.getStack();return l?l.lead===this:!0}getLead(){var s;const{layoutId:l}=this.options;return l?((s=this.getStack())==null?void 0:s.lead)||this:this}getPrevLead(){var s;const{layoutId:l}=this.options;return l?(s=this.getStack())==null?void 0:s.prevLead:void 0}getStack(){const{layoutId:l}=this.options;if(l)return this.root.sharedNodes.get(l)}promote({needsReset:l,transition:s,preserveFollowOpacity:o}={}){const c=this.getStack();c&&c.promote(this,o),l&&(this.projectionDelta=void 0,this.needsReset=!0),s&&this.setOptions({transition:s})}relegate(){const l=this.getStack();return l?l.relegate(this):!1}resetSkewAndRotation(){const{visualElement:l}=this.options;if(!l)return;let s=!1;const{latestValues:o}=l;if((o.z||o.rotate||o.rotateX||o.rotateY||o.rotateZ||o.skewX||o.skewY)&&(s=!0),!s)return;const c={};o.z&&fu("z",l,c,this.animationValues);for(let f=0;f<du.length;f++)fu(`rotate${du[f]}`,l,c,this.animationValues),fu(`skew${du[f]}`,l,c,this.animationValues);l.render();for(const f in c)l.setStaticValue(f,c[f]),this.animationValues&&(this.animationValues[f]=c[f]);l.scheduleRender()}applyProjectionStyles(l,s){if(!this.instance||this.isSVG)return;if(!this.isVisible){l.visibility="hidden";return}const o=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,l.visibility="",l.opacity="",l.pointerEvents=sl(s==null?void 0:s.pointerEvents)||"",l.transform=o?o(this.latestValues,""):"none";return}const c=this.getLead();if(!this.projectionDelta||!this.layout||!c.target){this.options.layoutId&&(l.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,l.pointerEvents=sl(s==null?void 0:s.pointerEvents)||""),this.hasProjected&&!as(this.latestValues)&&(l.transform=o?o({},""):"none",this.hasProjected=!1);return}l.visibility="";const f=c.animationValues||c.latestValues;this.applyTransformsToTarget();let u=Kk(this.projectionDeltaWithTransform,this.treeScale,f);o&&(u=o(f,u)),l.transform=u;const{x:p,y:_}=this.projectionDelta;l.transformOrigin=`${p.origin*100}% ${_.origin*100}% 0`,c.animationValues?l.opacity=c===this?f.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:f.opacityExit:l.opacity=c===this?f.opacity!==void 0?f.opacity:"":f.opacityExit!==void 0?f.opacityExit:0;for(const y in Wh){if(f[y]===void 0)continue;const{correct:v,applyTo:h,isCSSVariable:m}=Wh[y],d=u==="none"?f[y]:v(f[y],c);if(h){const g=h.length;for(let w=0;w<g;w++)l[h[w]]=d}else m?this.options.visualElement.renderState.vars[y]=d:l[y]=d}this.options.layoutId&&(l.pointerEvents=c===this?sl(s==null?void 0:s.pointerEvents)||"":"none")}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(l=>{var s;return(s=l.currentAnimation)==null?void 0:s.stop()}),this.root.nodes.forEach(Ug),this.root.sharedNodes.clear()}}}function Xk(e){e.updateLayout()}function Yk(e){var r;const t=((r=e.resumeFrom)==null?void 0:r.snapshot)||e.snapshot;if(e.isLead()&&e.layout&&t&&e.hasListeners("didUpdate")){const{layoutBox:n,measuredBox:i}=e.layout,{animationType:a}=e.options,l=t.source!==e.layout.source;a==="size"?gr(u=>{const p=l?t.measuredBox[u]:t.layoutBox[u],_=Zt(p);p.min=n[u].min,p.max=p.min+_}):F1(a,t.layoutBox,n)&&gr(u=>{const p=l?t.measuredBox[u]:t.layoutBox[u],_=Zt(n[u]);p.max=p.min+_,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[u].max=e.relativeTarget[u].min+_)});const s=Ys();fo(s,n,t.layoutBox);const o=Ys();l?fo(o,e.applyTransform(i,!0),t.measuredBox):fo(o,n,t.layoutBox);const c=!O1(s);let f=!1;if(!e.resumeFrom){const u=e.getClosestProjectingParent();if(u&&!u.resumeFrom){const{snapshot:p,layout:_}=u;if(p&&_){const y=wt();zl(y,t.layoutBox,p.layoutBox);const v=wt();zl(v,n,_.layoutBox),B1(y,v)||(f=!0),u.options.layoutRoot&&(e.relativeTarget=v,e.relativeTargetOrigin=y,e.relativeParent=u)}}}e.notifyListeners("didUpdate",{layout:n,snapshot:t,delta:o,layoutDelta:s,hasLayoutChanged:c,hasRelativeLayoutChanged:f})}else if(e.isLead()){const{onExitComplete:n}=e.options;n&&n()}e.options.transition=void 0}function Jk(e){e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||(e.isSharedProjectionDirty=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty)),e.isTransformDirty||(e.isTransformDirty=e.parent.isTransformDirty))}function Qk(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function Zk(e){e.clearSnapshot()}function Ug(e){e.clearMeasurements()}function Wg(e){e.isLayoutDirty=!1}function eL(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function Vg(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function tL(e){e.resolveTargetDelta()}function rL(e){e.calcProjection()}function nL(e){e.resetSkewAndRotation()}function sL(e){e.removeLeadSnapshot()}function Kg(e,t,r){e.translate=lt(t.translate,0,r),e.scale=lt(t.scale,1,r),e.origin=t.origin,e.originPoint=t.originPoint}function Gg(e,t,r,n){e.min=lt(t.min,r.min,n),e.max=lt(t.max,r.max,n)}function iL(e,t,r,n){Gg(e.x,t.x,r.x,n),Gg(e.y,t.y,r.y,n)}function oL(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const aL={duration:.45,ease:[.4,0,.1,1]},qg=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),Xg=qg("applewebkit/")&&!qg("chrome/")?Math.round:br;function Yg(e){e.min=Xg(e.min),e.max=Xg(e.max)}function lL(e){Yg(e.x),Yg(e.y)}function F1(e,t,r){return e==="position"||e==="preserve-aspect"&&!gk($g(t),$g(r),.2)}function cL(e){var t;return e!==e.root&&((t=e.scroll)==null?void 0:t.wasRoot)}const uL=j1({attachResizeListener:(e,t)=>Ho(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),pu={current:void 0},H1=j1({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!pu.current){const e=new uL({});e.mount(window),e.setOptions({layoutScroll:!0}),pu.current=e}return pu.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),hL={pan:{Feature:Mk},drag:{Feature:Dk,ProjectionNode:H1,MeasureLayout:A1}};function Jg(e,t,r){const{props:n}=e;e.animationState&&n.whileHover&&e.animationState.setActive("whileHover",r==="Start");const i="onHover"+r,a=n[i];a&&it.postRender(()=>a(t,sa(t)))}class dL extends Yn{mount(){const{current:t}=this.node;t&&(this.unmount=O5(t,(r,n)=>(Jg(this.node,n,"Start"),i=>Jg(this.node,i,"End"))))}unmount(){}}class fL extends Yn{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch{t=!0}!t||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=ta(Ho(this.node.current,"focus",()=>this.onFocus()),Ho(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function Qg(e,t,r){const{props:n}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;e.animationState&&n.whileTap&&e.animationState.setActive("whileTap",r==="Start");const i="onTap"+(r==="End"?"":r),a=n[i];a&&it.postRender(()=>a(t,sa(t)))}class pL extends Yn{mount(){const{current:t}=this.node;t&&(this.unmount=j5(t,(r,n)=>(Qg(this.node,n,"Start"),(i,{success:a})=>Qg(this.node,i,a?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const Jh=new WeakMap,mu=new WeakMap,mL=e=>{const t=Jh.get(e.target);t&&t(e)},gL=e=>{e.forEach(mL)};function vL({root:e,...t}){const r=e||document;mu.has(r)||mu.set(r,{});const n=mu.get(r),i=JSON.stringify(t);return n[i]||(n[i]=new IntersectionObserver(gL,{root:e,...t})),n[i]}function _L(e,t,r){const n=vL(t);return Jh.set(e,r),n.observe(e),()=>{Jh.delete(e),n.unobserve(e)}}const yL={some:0,all:1};class wL extends Yn{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:t={}}=this.node.getProps(),{root:r,margin:n,amount:i="some",once:a}=t,l={root:r?r.current:void 0,rootMargin:n,threshold:typeof i=="number"?i:yL[i]},s=o=>{const{isIntersecting:c}=o;if(this.isInView===c||(this.isInView=c,a&&!c&&this.hasEnteredView))return;c&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",c);const{onViewportEnter:f,onViewportLeave:u}=this.node.getProps(),p=c?f:u;p&&p(o)};return _L(this.node.current,l,s)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:r}=this.node;["amount","margin","root"].some(SL(t,r))&&this.startObserver()}unmount(){}}function SL({viewport:e={}},{viewport:t={}}={}){return r=>e[r]!==t[r]}const xL={inView:{Feature:wL},tap:{Feature:pL},focus:{Feature:fL},hover:{Feature:dL}},bL={layout:{ProjectionNode:H1,MeasureLayout:A1}},CL={...uk,...xL,...hL,...bL},Qh=LE(CL,FE);function $1(){!Gf.current&&_1();const[e]=E.useState($l.current);return e}function EL(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return E.useMemo(()=>n=>{t.forEach(i=>i(n))},t)}const Sc=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function ki(e){const t=Object.prototype.toString.call(e);return t==="[object Window]"||t==="[object global]"}function Xf(e){return"nodeType"in e}function lr(e){var t,r;return e?ki(e)?e:Xf(e)&&(t=(r=e.ownerDocument)==null?void 0:r.defaultView)!=null?t:window:window}function Yf(e){const{Document:t}=lr(e);return e instanceof t}function ia(e){return ki(e)?!1:e instanceof lr(e).HTMLElement}function z1(e){return e instanceof lr(e).SVGElement}function Li(e){return e?ki(e)?e.document:Xf(e)?Yf(e)?e:ia(e)||z1(e)?e.ownerDocument:document:document:document}const Gr=Sc?E.useLayoutEffect:E.useEffect;function Jf(e){const t=E.useRef(e);return Gr(()=>{t.current=e}),E.useCallback(function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return t.current==null?void 0:t.current(...n)},[])}function kL(){const e=E.useRef(null),t=E.useCallback((n,i)=>{e.current=setInterval(n,i)},[]),r=E.useCallback(()=>{e.current!==null&&(clearInterval(e.current),e.current=null)},[]);return[t,r]}function $o(e,t){t===void 0&&(t=[e]);const r=E.useRef(e);return Gr(()=>{r.current!==e&&(r.current=e)},t),r}function oa(e,t){const r=E.useRef();return E.useMemo(()=>{const n=e(r.current);return r.current=n,n},[...t])}function Ul(e){const t=Jf(e),r=E.useRef(null),n=E.useCallback(i=>{i!==r.current&&(t==null||t(i,r.current)),r.current=i},[]);return[r,n]}function Zh(e){const t=E.useRef();return E.useEffect(()=>{t.current=e},[e]),t.current}let gu={};function aa(e,t){return E.useMemo(()=>{if(t)return t;const r=gu[e]==null?0:gu[e]+1;return gu[e]=r,e+"-"+r},[e,t])}function U1(e){return function(t){for(var r=arguments.length,n=new Array(r>1?r-1:0),i=1;i<r;i++)n[i-1]=arguments[i];return n.reduce((a,l)=>{const s=Object.entries(l);for(const[o,c]of s){const f=a[o];f!=null&&(a[o]=f+e*c)}return a},{...t})}}const ai=U1(1),Wl=U1(-1);function LL(e){return"clientX"in e&&"clientY"in e}function Qf(e){if(!e)return!1;const{KeyboardEvent:t}=lr(e.target);return t&&e instanceof t}function TL(e){if(!e)return!1;const{TouchEvent:t}=lr(e.target);return t&&e instanceof t}function ed(e){if(TL(e)){if(e.touches&&e.touches.length){const{clientX:t,clientY:r}=e.touches[0];return{x:t,y:r}}else if(e.changedTouches&&e.changedTouches.length){const{clientX:t,clientY:r}=e.changedTouches[0];return{x:t,y:r}}}return LL(e)?{x:e.clientX,y:e.clientY}:null}const zo=Object.freeze({Translate:{toString(e){if(!e)return;const{x:t,y:r}=e;return"translate3d("+(t?Math.round(t):0)+"px, "+(r?Math.round(r):0)+"px, 0)"}},Scale:{toString(e){if(!e)return;const{scaleX:t,scaleY:r}=e;return"scaleX("+t+") scaleY("+r+")"}},Transform:{toString(e){if(e)return[zo.Translate.toString(e),zo.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:r,easing:n}=e;return t+" "+r+"ms "+n}}}),Zg="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function RL(e){return e.matches(Zg)?e:e.querySelector(Zg)}const DL={display:"none"};function ML(e){let{id:t,value:r}=e;return gt.createElement("div",{id:t,style:DL},r)}function AL(e){let{id:t,announcement:r,ariaLiveType:n="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 gt.createElement("div",{id:t,style:i,role:"status","aria-live":n,"aria-atomic":!0},r)}function PL(){const[e,t]=E.useState("");return{announce:E.useCallback(n=>{n!=null&&t(n)},[]),announcement:e}}const W1=E.createContext(null);function IL(e){const t=E.useContext(W1);E.useEffect(()=>{if(!t)throw new Error("useDndMonitor must be used within a children of <DndContext>");return t(e)},[e,t])}function OL(){const[e]=E.useState(()=>new Set),t=E.useCallback(n=>(e.add(n),()=>e.delete(n)),[e]);return[E.useCallback(n=>{let{type:i,event:a}=n;e.forEach(l=>{var s;return(s=l[i])==null?void 0:s.call(l,a)})},[e]),t]}const BL={draggable:`
|
|
48
|
+
`),()=>{d.contains(m)&&d.removeChild(m)}},[t]),T.jsx(W5,{isPresent:t,childRef:a,sizeRef:l,children:E.cloneElement(e,{ref:c})})}const K5=({children:e,initial:t,isPresent:r,onExitComplete:n,custom:i,presenceAffectsLayout:a,mode:l,anchorX:s,root:o})=>{const c=gf(G5),f=E.useId();let u=!0,p=E.useMemo(()=>(u=!1,{id:f,initial:t,isPresent:r,custom:i,onExitComplete:_=>{c.set(_,!0);for(const y of c.values())if(!y)return;n&&n()},register:_=>(c.set(_,!1),()=>c.delete(_))}),[r,c,n]);return a&&u&&(p={...p}),E.useMemo(()=>{c.forEach((_,y)=>c.set(y,!1))},[r]),E.useEffect(()=>{!r&&!c.size&&n&&n()},[r]),l==="popLayout"&&(e=T.jsx(V5,{isPresent:r,anchorX:s,root:o,children:e})),T.jsx(vc.Provider,{value:p,children:e})};function G5(){return new Map}function e1(e=!0){const t=E.useContext(vc);if(t===null)return[!0,null];const{isPresent:r,onExitComplete:n,register:i}=t,a=E.useId();E.useEffect(()=>{if(e)return i(a)},[e]);const l=E.useCallback(()=>e&&n&&n(a),[a,n,e]);return!r&&n?[!1,l]:[!0]}const Da=e=>e.key||"";function ig(e){const t=[];return E.Children.forEach(e,r=>{E.isValidElement(r)&&t.push(r)}),t}const q5=({children:e,custom:t,initial:r=!0,onExitComplete:n,presenceAffectsLayout:i=!0,mode:a="sync",propagate:l=!1,anchorX:s="left",root:o})=>{const[c,f]=e1(l),u=E.useMemo(()=>ig(e),[e]),p=l&&!c?[]:u.map(Da),_=E.useRef(!0),y=E.useRef(u),v=gf(()=>new Map),h=E.useRef(new Set),[m,d]=E.useState(u),[g,w]=E.useState(u);ay(()=>{_.current=!1,y.current=u;for(let C=0;C<g.length;C++){const S=Da(g[C]);p.includes(S)?(v.delete(S),h.current.delete(S)):v.get(S)!==!0&&v.set(S,!1)}},[g,p.length,p.join("-")]);const b=[];if(u!==m){let C=[...u];for(let S=0;S<g.length;S++){const k=g[S],L=Da(k);p.includes(L)||(C.splice(S,0,k),b.push(k))}return a==="wait"&&b.length&&(C=b),w(ig(C)),d(u),null}const{forceRender:x}=E.useContext(mf);return T.jsx(T.Fragment,{children:g.map(C=>{const S=Da(C),k=l&&!c?!1:u===g||p.includes(S),L=()=>{if(h.current.has(S))return;if(h.current.add(S),v.has(S))v.set(S,!0);else return;let A=!0;v.forEach(M=>{M||(A=!1)}),A&&(x==null||x(),w(y.current),l&&(f==null||f()),n&&n())};return T.jsx(K5,{isPresent:k,initial:!_.current||r?void 0:!1,custom:t,presenceAffectsLayout:i,mode:a,root:o,onExitComplete:k?void 0:L,anchorX:s,children:C},S)})})},t1=E.createContext({strict:!1}),og={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]},vi={};for(const e in og)vi[e]={isEnabled:t=>og[e].some(r=>!!t[r])};function X5(e){for(const t in e)vi[t]={...vi[t],...e[t]}}const Y5=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","ignoreStrict","viewport"]);function Fl(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||Y5.has(e)}let r1=e=>!Fl(e);function J5(e){typeof e=="function"&&(r1=t=>t.startsWith("on")?!Fl(t):e(t))}try{J5(require("@emotion/is-prop-valid").default)}catch{}function Q5(e,t,r){const n={};for(const i in e)i==="values"&&typeof e.values=="object"||(r1(i)||r===!0&&Fl(i)||!t&&!Fl(i)||e.draggable&&i.startsWith("onDrag"))&&(n[i]=e[i]);return n}const _c=E.createContext({});function yc(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}function Fo(e){return typeof e=="string"||Array.isArray(e)}const Ff=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],Hf=["initial",...Ff];function wc(e){return yc(e.animate)||Hf.some(t=>Fo(e[t]))}function n1(e){return!!(wc(e)||e.variants)}function Z5(e,t){if(wc(e)){const{initial:r,animate:n}=e;return{initial:r===!1||Fo(r)?r:void 0,animate:Fo(n)?n:void 0}}return e.inherit!==!1?t:{}}function eE(e){const{initial:t,animate:r}=Z5(e,E.useContext(_c));return E.useMemo(()=>({initial:t,animate:r}),[ag(t),ag(r)])}function ag(e){return Array.isArray(e)?e.join(" "):e}function lg(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const $i={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(Se.test(e))e=parseFloat(e);else return e;const r=lg(e,t.target.x),n=lg(e,t.target.y);return`${r}% ${n}%`}},tE={correct:(e,{treeScale:t,projectionDelta:r})=>{const n=e,i=Kn.parse(e);if(i.length>5)return n;const a=Kn.createTransformer(e),l=typeof i[0]!="number"?1:0,s=r.x.scale*t.x,o=r.y.scale*t.y;i[0+l]/=s,i[1+l]/=o;const c=lt(s,o,.5);return typeof i[2+l]=="number"&&(i[2+l]/=c),typeof i[3+l]=="number"&&(i[3+l]/=c),a(i)}},Wh={borderRadius:{...$i,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:$i,borderTopRightRadius:$i,borderBottomLeftRadius:$i,borderBottomRightRadius:$i,boxShadow:tE};function s1(e,{layout:t,layoutId:r}){return Ei.has(e)||e.startsWith("origin")||(t||r!==void 0)&&(!!Wh[e]||e==="opacity")}const rE={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},nE=Ci.length;function sE(e,t,r){let n="",i=!0;for(let a=0;a<nE;a++){const l=Ci[a],s=e[l];if(s===void 0)continue;let o=!0;if(typeof s=="number"?o=s===(l.startsWith("scale")?1:0):o=parseFloat(s)===0,!o||r){const c=Gy(s,Of[l]);if(!o){i=!1;const f=rE[l]||l;n+=`${f}(${c}) `}r&&(t[l]=c)}}return n=n.trim(),r?n=r(t,i?"":n):i&&(n="none"),n}function $f(e,t,r){const{style:n,vars:i,transformOrigin:a}=e;let l=!1,s=!1;for(const o in t){const c=t[o];if(Ei.has(o)){l=!0;continue}else if(Cy(o)){i[o]=c;continue}else{const f=Gy(c,Of[o]);o.startsWith("origin")?(s=!0,a[o]=f):n[o]=f}}if(t.transform||(l||r?n.transform=sE(t,e.transform,r):n.transform&&(n.transform="none")),s){const{originX:o="50%",originY:c="50%",originZ:f=0}=a;n.transformOrigin=`${o} ${c} ${f}`}}const zf=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function i1(e,t,r){for(const n in t)!Gt(t[n])&&!s1(n,r)&&(e[n]=t[n])}function iE({transformTemplate:e},t){return E.useMemo(()=>{const r=zf();return $f(r,t,e),Object.assign({},r.vars,r.style)},[t])}function oE(e,t){const r=e.style||{},n={};return i1(n,r,e),Object.assign(n,iE(e,t)),n}function aE(e,t){const r={},n=oE(e,t);return e.drag&&e.dragListener!==!1&&(r.draggable=!1,n.userSelect=n.WebkitUserSelect=n.WebkitTouchCallout="none",n.touchAction=e.drag===!0?"none":`pan-${e.drag==="x"?"y":"x"}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(r.tabIndex=0),r.style=n,r}const lE={offset:"stroke-dashoffset",array:"stroke-dasharray"},cE={offset:"strokeDashoffset",array:"strokeDasharray"};function uE(e,t,r=1,n=0,i=!0){e.pathLength=1;const a=i?lE:cE;e[a.offset]=Se.transform(-n);const l=Se.transform(t),s=Se.transform(r);e[a.array]=`${l} ${s}`}const hE=["offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function o1(e,{attrX:t,attrY:r,attrScale:n,pathLength:i,pathSpacing:a=1,pathOffset:l=0,...s},o,c,f){if($f(e,s,c),o){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};const{attrs:u,style:p}=e;u.transform&&(p.transform=u.transform,delete u.transform),(p.transform||u.transformOrigin)&&(p.transformOrigin=u.transformOrigin??"50% 50%",delete u.transformOrigin),p.transform&&(p.transformBox=(f==null?void 0:f.transformBox)??"fill-box",delete u.transformBox);for(const _ of hE)u[_]!==void 0&&(p[_]=u[_],delete u[_]);t!==void 0&&(u.x=t),r!==void 0&&(u.y=r),n!==void 0&&(u.scale=n),i!==void 0&&uE(u,i,a,l,!1)}const a1=()=>({...zf(),attrs:{}}),l1=e=>typeof e=="string"&&e.toLowerCase()==="svg";function dE(e,t,r,n){const i=E.useMemo(()=>{const a=a1();return o1(a,t,l1(n),e.transformTemplate,e.style),{...a.attrs,style:{...a.style}}},[t]);if(e.style){const a={};i1(a,e.style,e),i.style={...a,...i.style}}return i}const fE=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function Uf(e){return typeof e!="string"||e.includes("-")?!1:!!(fE.indexOf(e)>-1||/[A-Z]/u.test(e))}function pE(e,t,r,{latestValues:n},i,a=!1,l){const o=(l??Uf(e)?dE:aE)(t,n,i,e),c=Q5(t,typeof e=="string",a),f=e!==E.Fragment?{...c,...o,ref:r}:{},{children:u}=t,p=E.useMemo(()=>Gt(u)?u.get():u,[u]);return E.createElement(e,{...f,children:p})}function cg(e){const t=[{},{}];return e==null||e.values.forEach((r,n)=>{t[0][n]=r.get(),t[1][n]=r.getVelocity()}),t}function Wf(e,t,r,n){if(typeof t=="function"){const[i,a]=cg(n);t=t(r!==void 0?r:e.custom,i,a)}if(typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"){const[i,a]=cg(n);t=t(r!==void 0?r:e.custom,i,a)}return t}function sl(e){return Gt(e)?e.get():e}function mE({scrapeMotionValuesFromProps:e,createRenderState:t},r,n,i){return{latestValues:gE(r,n,i,e),renderState:t()}}function gE(e,t,r,n){const i={},a=n(e,{});for(const p in a)i[p]=sl(a[p]);let{initial:l,animate:s}=e;const o=wc(e),c=n1(e);t&&c&&!o&&e.inherit!==!1&&(l===void 0&&(l=t.initial),s===void 0&&(s=t.animate));let f=r?r.initial===!1:!1;f=f||l===!1;const u=f?s:l;if(u&&typeof u!="boolean"&&!yc(u)){const p=Array.isArray(u)?u:[u];for(let _=0;_<p.length;_++){const y=Wf(e,p[_]);if(y){const{transitionEnd:v,transition:h,...m}=y;for(const d in m){let g=m[d];if(Array.isArray(g)){const w=f?g.length-1:0;g=g[w]}g!==null&&(i[d]=g)}for(const d in v)i[d]=v[d]}}}return i}const c1=e=>(t,r)=>{const n=E.useContext(_c),i=E.useContext(vc),a=()=>mE(e,t,n,i);return r?a():gf(a)};function Vf(e,t,r){var a;const{style:n}=e,i={};for(const l in n)(Gt(n[l])||t.style&&Gt(t.style[l])||s1(l,e)||((a=r==null?void 0:r.getValue(l))==null?void 0:a.liveStyle)!==void 0)&&(i[l]=n[l]);return i}const vE=c1({scrapeMotionValuesFromProps:Vf,createRenderState:zf});function u1(e,t,r){const n=Vf(e,t,r);for(const i in e)if(Gt(e[i])||Gt(t[i])){const a=Ci.indexOf(i)!==-1?"attr"+i.charAt(0).toUpperCase()+i.substring(1):i;n[a]=e[i]}return n}const _E=c1({scrapeMotionValuesFromProps:u1,createRenderState:a1}),yE=Symbol.for("motionComponentSymbol");function wE(e,t,r){const n=E.useRef(r);E.useInsertionEffect(()=>{n.current=r});const i=E.useRef(null);return E.useCallback(a=>{var s;a&&((s=e.onMount)==null||s.call(e,a)),t&&(a?t.mount(a):t.unmount());const l=n.current;if(typeof l=="function")if(a){const o=l(a);typeof o=="function"&&(i.current=o)}else i.current?(i.current(),i.current=null):l(a);else l&&(l.current=a)},[t])}const Kf=e=>e.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),SE="framerAppearId",h1="data-"+Kf(SE),d1=E.createContext({});function Yi(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function xE(e,t,r,n,i,a){var h,m;const{visualElement:l}=E.useContext(_c),s=E.useContext(t1),o=E.useContext(vc),c=E.useContext(jf).reducedMotion,f=E.useRef(null);n=n||s.renderer,!f.current&&n&&(f.current=n(e,{visualState:t,parent:l,props:r,presenceContext:o,blockInitialAnimation:o?o.initial===!1:!1,reducedMotionConfig:c,isSVG:a}));const u=f.current,p=E.useContext(d1);u&&!u.projection&&i&&(u.type==="html"||u.type==="svg")&&bE(f.current,r,i,p);const _=E.useRef(!1);E.useInsertionEffect(()=>{u&&_.current&&u.update(r,o)});const y=r[h1],v=E.useRef(!!y&&!((h=window.MotionHandoffIsComplete)!=null&&h.call(window,y))&&((m=window.MotionHasOptimisedAnimation)==null?void 0:m.call(window,y)));return ay(()=>{u&&(_.current=!0,window.MotionIsMounted=!0,u.updateFeatures(),u.scheduleRenderMicrotask(),v.current&&u.animationState&&u.animationState.animateChanges())}),E.useEffect(()=>{u&&(!v.current&&u.animationState&&u.animationState.animateChanges(),v.current&&(queueMicrotask(()=>{var d;(d=window.MotionHandoffMarkAsComplete)==null||d.call(window,y)}),v.current=!1),u.enteringChildren=void 0)}),u}function bE(e,t,r,n){const{layoutId:i,layout:a,drag:l,dragConstraints:s,layoutScroll:o,layoutRoot:c,layoutCrossfade:f}=t;e.projection=new r(e.latestValues,t["data-framer-portal-id"]?void 0:f1(e.parent)),e.projection.setOptions({layoutId:i,layout:a,alwaysMeasureLayout:!!l||s&&Yi(s),visualElement:e,animationType:typeof a=="string"?a:"both",initialPromotionConfig:n,crossfade:f,layoutScroll:o,layoutRoot:c})}function f1(e){if(e)return e.options.allowProjection!==!1?e.projection:f1(e.parent)}function au(e,{forwardMotionProps:t=!1,type:r}={},n,i){n&&X5(n);const a=r?r==="svg":Uf(e),l=a?_E:vE;function s(c,f){let u;const p={...E.useContext(jf),...c,layoutId:CE(c)},{isStatic:_}=p,y=eE(c),v=l(c,_);if(!_&&vf){EE();const h=kE(p);u=h.MeasureLayout,y.visualElement=xE(e,v,p,i,h.ProjectionNode,a)}return T.jsxs(_c.Provider,{value:y,children:[u&&y.visualElement?T.jsx(u,{visualElement:y.visualElement,...p}):null,pE(e,c,wE(v,y.visualElement,f),v,_,t,a)]})}s.displayName=`motion.${typeof e=="string"?e:`create(${e.displayName??e.name??""})`}`;const o=E.forwardRef(s);return o[yE]=e,o}function CE({layoutId:e}){const t=E.useContext(mf).id;return t&&e!==void 0?t+"-"+e:e}function EE(e,t){E.useContext(t1).strict}function kE(e){const{drag:t,layout:r}=vi;if(!t&&!r)return{};const n={...t,...r};return{MeasureLayout:t!=null&&t.isEnabled(e)||r!=null&&r.isEnabled(e)?n.MeasureLayout:void 0,ProjectionNode:n.ProjectionNode}}function LE(e,t){if(typeof Proxy>"u")return au;const r=new Map,n=(a,l)=>au(a,l,e,t),i=(a,l)=>n(a,l);return new Proxy(i,{get:(a,l)=>l==="create"?n:(r.has(l)||r.set(l,au(l,void 0,e,t)),r.get(l))})}function p1({top:e,left:t,right:r,bottom:n}){return{x:{min:t,max:r},y:{min:e,max:n}}}function TE({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function RE(e,t){if(!t)return e;const r=t({x:e.left,y:e.top}),n=t({x:e.right,y:e.bottom});return{top:r.y,left:r.x,bottom:n.y,right:n.x}}function lu(e){return e===void 0||e===1}function Vh({scale:e,scaleX:t,scaleY:r}){return!lu(e)||!lu(t)||!lu(r)}function as(e){return Vh(e)||m1(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function m1(e){return ug(e.x)||ug(e.y)}function ug(e){return e&&e!=="0%"}function Hl(e,t,r){const n=e-r,i=t*n;return r+i}function hg(e,t,r,n,i){return i!==void 0&&(e=Hl(e,i,n)),Hl(e,r,n)+t}function Kh(e,t=0,r=1,n,i){e.min=hg(e.min,t,r,n,i),e.max=hg(e.max,t,r,n,i)}function g1(e,{x:t,y:r}){Kh(e.x,t.translate,t.scale,t.originPoint),Kh(e.y,r.translate,r.scale,r.originPoint)}const dg=.999999999999,fg=1.0000000000001;function DE(e,t,r,n=!1){const i=r.length;if(!i)return;t.x=t.y=1;let a,l;for(let s=0;s<i;s++){a=r[s],l=a.projectionDelta;const{visualElement:o}=a.options;o&&o.props.style&&o.props.style.display==="contents"||(n&&a.options.layoutScroll&&a.scroll&&a!==a.root&&Xs(e,{x:-a.scroll.offset.x,y:-a.scroll.offset.y}),l&&(t.x*=l.x.scale,t.y*=l.y.scale,g1(e,l)),n&&as(a.latestValues)&&Xs(e,a.latestValues))}t.x<fg&&t.x>dg&&(t.x=1),t.y<fg&&t.y>dg&&(t.y=1)}function qs(e,t){e.min=e.min+t,e.max=e.max+t}function pg(e,t,r,n,i=.5){const a=lt(e.min,e.max,i);Kh(e,t,r,a,n)}function Xs(e,t){pg(e.x,t.x,t.scaleX,t.scale,t.originX),pg(e.y,t.y,t.scaleY,t.scale,t.originY)}function v1(e,t){return p1(RE(e.getBoundingClientRect(),t))}function ME(e,t,r){const n=v1(e,r),{scroll:i}=t;return i&&(qs(n.x,i.offset.x),qs(n.y,i.offset.y)),n}const mg=()=>({translate:0,scale:1,origin:0,originPoint:0}),Ys=()=>({x:mg(),y:mg()}),gg=()=>({min:0,max:0}),wt=()=>({x:gg(),y:gg()}),$l={current:null},Gf={current:!1};function _1(){if(Gf.current=!0,!!vf)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>$l.current=e.matches;e.addEventListener("change",t),t()}else $l.current=!1}const AE=new WeakMap;function PE(e,t,r){for(const n in t){const i=t[n],a=r[n];if(Gt(i))e.addValue(n,i);else if(Gt(a))e.addValue(n,gi(i,{owner:e}));else if(a!==i)if(e.hasValue(n)){const l=e.getValue(n);l.liveStyle===!0?l.jump(i):l.hasAnimated||l.set(i)}else{const l=e.getStaticValue(n);e.addValue(n,gi(l!==void 0?l:i,{owner:e}))}}for(const n in r)t[n]===void 0&&e.removeValue(n);return t}const vg=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class IE{scrapeMotionValuesFromProps(t,r,n){return{}}constructor({parent:t,props:r,presenceContext:n,reducedMotionConfig:i,blockInitialAnimation:a,visualState:l},s={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=Pf,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const p=Qt.now();this.renderScheduledAt<p&&(this.renderScheduledAt=p,it.render(this.render,!1,!0))};const{latestValues:o,renderState:c}=l;this.latestValues=o,this.baseTarget={...o},this.initialValues=r.initial?{...o}:{},this.renderState=c,this.parent=t,this.props=r,this.presenceContext=n,this.depth=t?t.depth+1:0,this.reducedMotionConfig=i,this.options=s,this.blockInitialAnimation=!!a,this.isControllingVariants=wc(r),this.isVariantNode=n1(r),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(t&&t.current);const{willChange:f,...u}=this.scrapeMotionValuesFromProps(r,{},this);for(const p in u){const _=u[p];o[p]!==void 0&&Gt(_)&&_.set(o[p])}}mount(t){var r;this.current=t,AE.set(t,this),this.projection&&!this.projection.instance&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((n,i)=>this.bindToMotionValue(i,n)),this.reducedMotionConfig==="never"?this.shouldReduceMotion=!1:this.reducedMotionConfig==="always"?this.shouldReduceMotion=!0:(Gf.current||_1(),this.shouldReduceMotion=$l.current),(r=this.parent)==null||r.addChild(this),this.update(this.props,this.presenceContext)}unmount(){var t;this.projection&&this.projection.unmount(),Vn(this.notifyUpdate),Vn(this.render),this.valueSubscriptions.forEach(r=>r()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),(t=this.parent)==null||t.removeChild(this);for(const r in this.events)this.events[r].clear();for(const r in this.features){const n=this.features[r];n&&(n.unmount(),n.isMounted=!1)}this.current=null}addChild(t){this.children.add(t),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(t)}removeChild(t){this.children.delete(t),this.enteringChildren&&this.enteringChildren.delete(t)}bindToMotionValue(t,r){this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)();const n=Ei.has(t);n&&this.onBindTransform&&this.onBindTransform();const i=r.on("change",l=>{this.latestValues[t]=l,this.props.onUpdate&&it.preRender(this.notifyUpdate),n&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let a;window.MotionCheckAppearSync&&(a=window.MotionCheckAppearSync(this,t,r)),this.valueSubscriptions.set(t,()=>{i(),a&&a(),r.owner&&r.stop()})}sortNodePosition(t){return!this.current||!this.sortInstanceNodePosition||this.type!==t.type?0:this.sortInstanceNodePosition(this.current,t.current)}updateFeatures(){let t="animation";for(t in vi){const r=vi[t];if(!r)continue;const{isEnabled:n,Feature:i}=r;if(!this.features[t]&&i&&n(this.props)&&(this.features[t]=new i(this)),this.features[t]){const a=this.features[t];a.isMounted?a.update():(a.mount(),a.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):wt()}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,r){this.latestValues[t]=r}update(t,r){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=r;for(let n=0;n<vg.length;n++){const i=vg[n];this.propEventSubscriptions[i]&&(this.propEventSubscriptions[i](),delete this.propEventSubscriptions[i]);const a="on"+i,l=t[a];l&&(this.propEventSubscriptions[i]=this.on(i,l))}this.prevMotionValues=PE(this,this.scrapeMotionValuesFromProps(t,this.prevProps,this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(t){return this.props.variants?this.props.variants[t]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(t){const r=this.getClosestVariantNode();if(r)return r.variantChildren&&r.variantChildren.add(t),()=>r.variantChildren.delete(t)}addValue(t,r){const n=this.values.get(t);r!==n&&(n&&this.removeValue(t),this.bindToMotionValue(t,r),this.values.set(t,r),this.latestValues[t]=r.get())}removeValue(t){this.values.delete(t);const r=this.valueSubscriptions.get(t);r&&(r(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,r){if(this.props.values&&this.props.values[t])return this.props.values[t];let n=this.values.get(t);return n===void 0&&r!==void 0&&(n=gi(r===null?void 0:r,{owner:this}),this.addValue(t,n)),n}readValue(t,r){let n=this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:this.getBaseTargetFromProps(this.props,t)??this.readValueFromInstance(this.current,t,this.options);return n!=null&&(typeof n=="string"&&(ly(n)||uy(n))?n=parseFloat(n):!$5(n)&&Kn.test(r)&&(n=Ky(t,r)),this.setBaseTarget(t,Gt(n)?n.get():n)),Gt(n)?n.get():n}setBaseTarget(t,r){this.baseTarget[t]=r}getBaseTarget(t){var a;const{initial:r}=this.props;let n;if(typeof r=="string"||typeof r=="object"){const l=Wf(this.props,r,(a=this.presenceContext)==null?void 0:a.custom);l&&(n=l[t])}if(r&&n!==void 0)return n;const i=this.getBaseTargetFromProps(this.props,t);return i!==void 0&&!Gt(i)?i:this.initialValues[t]!==void 0&&n===void 0?void 0:this.baseTarget[t]}on(t,r){return this.events[t]||(this.events[t]=new xf),this.events[t].add(r)}notify(t,...r){this.events[t]&&this.events[t].notify(...r)}scheduleRenderMicrotask(){Bf.render(this.render)}}class y1 extends IE{constructor(){super(...arguments),this.KeyframeResolver=D5}sortInstanceNodePosition(t,r){return t.compareDocumentPosition(r)&2?1:-1}getBaseTargetFromProps(t,r){return t.style?t.style[r]:void 0}removeValueFromRenderState(t,{vars:r,style:n}){delete r[t],delete n[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;Gt(t)&&(this.childSubscription=t.on("change",r=>{this.current&&(this.current.textContent=`${r}`)}))}}function w1(e,{style:t,vars:r},n,i){const a=e.style;let l;for(l in t)a[l]=t[l];i==null||i.applyProjectionStyles(a,n);for(l in r)a.setProperty(l,r[l])}function OE(e){return window.getComputedStyle(e)}class BE extends y1{constructor(){super(...arguments),this.type="html",this.renderInstance=w1}readValueFromInstance(t,r){var n;if(Ei.has(r))return(n=this.projection)!=null&&n.isProjecting?Nh(r):X2(t,r);{const i=OE(t),a=(Cy(r)?i.getPropertyValue(r):i[r])||0;return typeof a=="string"?a.trim():a}}measureInstanceViewportBox(t,{transformPagePoint:r}){return v1(t,r)}build(t,r,n){$f(t,r,n.transformTemplate)}scrapeMotionValuesFromProps(t,r,n){return Vf(t,r,n)}}const S1=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);function NE(e,t,r,n){w1(e,t,void 0,n);for(const i in t.attrs)e.setAttribute(S1.has(i)?i:Kf(i),t.attrs[i])}class jE extends y1{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=wt}getBaseTargetFromProps(t,r){return t[r]}readValueFromInstance(t,r){if(Ei.has(r)){const n=Vy(r);return n&&n.default||0}return r=S1.has(r)?r:Kf(r),t.getAttribute(r)}scrapeMotionValuesFromProps(t,r,n){return u1(t,r,n)}build(t,r,n){o1(t,r,this.isSVGTag,n.transformTemplate,n.style)}renderInstance(t,r,n,i){NE(t,r,n,i)}mount(t){this.isSVGTag=l1(t.tagName),super.mount(t)}}const FE=(e,t)=>t.isSVG??Uf(e)?new jE(t):new BE(t,{allowProjection:e!==E.Fragment});function oi(e,t,r){const n=e.getProps();return Wf(n,t,r!==void 0?r:n.custom,e)}const Gh=e=>Array.isArray(e);function HE(e,t,r){e.hasValue(t)?e.getValue(t).set(r):e.addValue(t,gi(r))}function $E(e){return Gh(e)?e[e.length-1]||0:e}function zE(e,t){const r=oi(e,t);let{transitionEnd:n={},transition:i={},...a}=r||{};a={...a,...n};for(const l in a){const s=$E(a[l]);HE(e,l,s)}}function UE(e){return!!(Gt(e)&&e.add)}function qh(e,t){const r=e.getValue("willChange");if(UE(r))return r.add(t);if(!r&&_n.WillChange){const n=new _n.WillChange("auto");e.addValue("willChange",n),n.add(t)}}function x1(e){return e.props[h1]}const WE=e=>e!==null;function VE(e,{repeat:t,repeatType:r="loop"},n){const i=e.filter(WE),a=t&&r!=="loop"&&t%2===1?0:i.length-1;return i[a]}const KE={type:"spring",stiffness:500,damping:25,restSpeed:10},GE=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),qE={type:"keyframes",duration:.8},XE={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},YE=(e,{keyframes:t})=>t.length>2?qE:Ei.has(e)?e.startsWith("scale")?GE(t[1]):KE:XE;function JE({when:e,delay:t,delayChildren:r,staggerChildren:n,staggerDirection:i,repeat:a,repeatType:l,repeatDelay:s,from:o,elapsed:c,...f}){return!!Object.keys(f).length}const qf=(e,t,r,n={},i,a)=>l=>{const s=If(n,e)||{},o=s.delay||n.delay||0;let{elapsed:c=0}=n;c=c-fn(o);const f={keyframes:Array.isArray(r)?r:[null,r],ease:"easeOut",velocity:t.getVelocity(),...s,delay:-c,onUpdate:p=>{t.set(p),s.onUpdate&&s.onUpdate(p)},onComplete:()=>{l(),s.onComplete&&s.onComplete()},name:e,motionValue:t,element:a?void 0:i};JE(s)||Object.assign(f,YE(e,f)),f.duration&&(f.duration=fn(f.duration)),f.repeatDelay&&(f.repeatDelay=fn(f.repeatDelay)),f.from!==void 0&&(f.keyframes[0]=f.from);let u=!1;if((f.type===!1||f.duration===0&&!f.repeatDelay)&&(zh(f),f.delay===0&&(u=!0)),(_n.instantAnimations||_n.skipAnimations)&&(u=!0,zh(f),f.delay=0),f.allowFlatten=!s.type&&!s.ease,u&&!a&&t.get()!==void 0){const p=VE(f.keyframes,s);if(p!==void 0){it.update(()=>{f.onUpdate(p),f.onComplete()});return}}return s.isSync?new Af(f):new _5(f)};function QE({protectedKeys:e,needsAnimating:t},r){const n=e.hasOwnProperty(r)&&t[r]!==!0;return t[r]=!1,n}function b1(e,t,{delay:r=0,transitionOverride:n,type:i}={}){let{transition:a=e.getDefaultTransition(),transitionEnd:l,...s}=t;n&&(a=n);const o=[],c=i&&e.animationState&&e.animationState.getState()[i];for(const f in s){const u=e.getValue(f,e.latestValues[f]??null),p=s[f];if(p===void 0||c&&QE(c,f))continue;const _={delay:r,...If(a||{},f)},y=u.get();if(y!==void 0&&!u.isAnimating&&!Array.isArray(p)&&p===y&&!_.velocity)continue;let v=!1;if(window.MotionHandoffAnimation){const m=x1(e);if(m){const d=window.MotionHandoffAnimation(m,f,it);d!==null&&(_.startTime=d,v=!0)}}qh(e,f),u.start(qf(f,u,p,e.shouldReduceMotion&&zy.has(f)?{type:!1}:_,e,v));const h=u.animation;h&&o.push(h)}return l&&Promise.all(o).then(()=>{it.update(()=>{l&&zE(e,l)})}),o}function C1(e,t,r,n=0,i=1){const a=Array.from(e).sort((c,f)=>c.sortNodePosition(f)).indexOf(t),l=e.size,s=(l-1)*n;return typeof r=="function"?r(a,l):i===1?a*n:s-a*n}function Xh(e,t,r={}){var o;const n=oi(e,t,r.type==="exit"?(o=e.presenceContext)==null?void 0:o.custom:void 0);let{transition:i=e.getDefaultTransition()||{}}=n||{};r.transitionOverride&&(i=r.transitionOverride);const a=n?()=>Promise.all(b1(e,n,r)):()=>Promise.resolve(),l=e.variantChildren&&e.variantChildren.size?(c=0)=>{const{delayChildren:f=0,staggerChildren:u,staggerDirection:p}=i;return ZE(e,t,c,f,u,p,r)}:()=>Promise.resolve(),{when:s}=i;if(s){const[c,f]=s==="beforeChildren"?[a,l]:[l,a];return c().then(()=>f())}else return Promise.all([a(),l(r.delay)])}function ZE(e,t,r=0,n=0,i=0,a=1,l){const s=[];for(const o of e.variantChildren)o.notify("AnimationStart",t),s.push(Xh(o,t,{...l,delay:r+(typeof n=="function"?0:n)+C1(e.variantChildren,o,n,i,a)}).then(()=>o.notify("AnimationComplete",t)));return Promise.all(s)}function ek(e,t,r={}){e.notify("AnimationStart",t);let n;if(Array.isArray(t)){const i=t.map(a=>Xh(e,a,r));n=Promise.all(i)}else if(typeof t=="string")n=Xh(e,t,r);else{const i=typeof t=="function"?oi(e,t,r.custom):t;n=Promise.all(b1(e,i,r))}return n.then(()=>{e.notify("AnimationComplete",t)})}function E1(e,t){if(!Array.isArray(t))return!1;const r=t.length;if(r!==e.length)return!1;for(let n=0;n<r;n++)if(t[n]!==e[n])return!1;return!0}const tk=Hf.length;function k1(e){if(!e)return;if(!e.isControllingVariants){const r=e.parent?k1(e.parent)||{}:{};return e.props.initial!==void 0&&(r.initial=e.props.initial),r}const t={};for(let r=0;r<tk;r++){const n=Hf[r],i=e.props[n];(Fo(i)||i===!1)&&(t[n]=i)}return t}const rk=[...Ff].reverse(),nk=Ff.length;function sk(e){return t=>Promise.all(t.map(({animation:r,options:n})=>ek(e,r,n)))}function ik(e){let t=sk(e),r=_g(),n=!0;const i=o=>(c,f)=>{var p;const u=oi(e,f,o==="exit"?(p=e.presenceContext)==null?void 0:p.custom:void 0);if(u){const{transition:_,transitionEnd:y,...v}=u;c={...c,...v,...y}}return c};function a(o){t=o(e)}function l(o){const{props:c}=e,f=k1(e.parent)||{},u=[],p=new Set;let _={},y=1/0;for(let h=0;h<nk;h++){const m=rk[h],d=r[m],g=c[m]!==void 0?c[m]:f[m],w=Fo(g),b=m===o?d.isActive:null;b===!1&&(y=h);let x=g===f[m]&&g!==c[m]&&w;if(x&&n&&e.manuallyAnimateOnMount&&(x=!1),d.protectedKeys={..._},!d.isActive&&b===null||!g&&!d.prevProp||yc(g)||typeof g=="boolean")continue;const C=ok(d.prevProp,g);let S=C||m===o&&d.isActive&&!x&&w||h>y&&w,k=!1;const L=Array.isArray(g)?g:[g];let A=L.reduce(i(m),{});b===!1&&(A={});const{prevResolvedValues:M={}}=d,D={...M,...A},O=H=>{S=!0,p.has(H)&&(k=!0,p.delete(H)),d.needsAnimating[H]=!0;const I=e.getValue(H);I&&(I.liveStyle=!1)};for(const H in D){const I=A[H],R=M[H];if(_.hasOwnProperty(H))continue;let P=!1;Gh(I)&&Gh(R)?P=!E1(I,R):P=I!==R,P?I!=null?O(H):p.add(H):I!==void 0&&p.has(H)?O(H):d.protectedKeys[H]=!0}d.prevProp=g,d.prevResolvedValues=A,d.isActive&&(_={..._,...A}),n&&e.blockInitialAnimation&&(S=!1);const z=x&&C;S&&(!z||k)&&u.push(...L.map(H=>{const I={type:m};if(typeof H=="string"&&n&&!z&&e.manuallyAnimateOnMount&&e.parent){const{parent:R}=e,P=oi(R,H);if(R.enteringChildren&&P){const{delayChildren:N}=P.transition||{};I.delay=C1(R.enteringChildren,e,N)}}return{animation:H,options:I}}))}if(p.size){const h={};if(typeof c.initial!="boolean"){const m=oi(e,Array.isArray(c.initial)?c.initial[0]:c.initial);m&&m.transition&&(h.transition=m.transition)}p.forEach(m=>{const d=e.getBaseTarget(m),g=e.getValue(m);g&&(g.liveStyle=!0),h[m]=d??null}),u.push({animation:h})}let v=!!u.length;return n&&(c.initial===!1||c.initial===c.animate)&&!e.manuallyAnimateOnMount&&(v=!1),n=!1,v?t(u):Promise.resolve()}function s(o,c){var u;if(r[o].isActive===c)return Promise.resolve();(u=e.variantChildren)==null||u.forEach(p=>{var _;return(_=p.animationState)==null?void 0:_.setActive(o,c)}),r[o].isActive=c;const f=l(o);for(const p in r)r[p].protectedKeys={};return f}return{animateChanges:l,setActive:s,setAnimateFunction:a,getState:()=>r,reset:()=>{r=_g()}}}function ok(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!E1(t,e):!1}function es(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function _g(){return{animate:es(!0),whileInView:es(),whileHover:es(),whileTap:es(),whileDrag:es(),whileFocus:es(),exit:es()}}class Yn{constructor(t){this.isMounted=!1,this.node=t}update(){}}class ak extends Yn{constructor(t){super(t),t.animationState||(t.animationState=ik(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();yc(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:r}=this.node.prevProps||{};t!==r&&this.updateAnimationControlsSubscription()}unmount(){var t;this.node.animationState.reset(),(t=this.unmountControls)==null||t.call(this)}}let lk=0;class ck extends Yn{constructor(){super(...arguments),this.id=lk++}update(){if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:r}=this.node.presenceContext,{isPresent:n}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===n)return;const i=this.node.animationState.setActive("exit",!t);r&&!t&&i.then(()=>{r(this.id)})}mount(){const{register:t,onExitComplete:r}=this.node.presenceContext||{};r&&r(this.id),t&&(this.unmount=t(this.id))}unmount(){}}const uk={animation:{Feature:ak},exit:{Feature:ck}};function Ho(e,t,r,n={passive:!0}){return e.addEventListener(t,r,n),()=>e.removeEventListener(t,r)}function sa(e){return{point:{x:e.pageX,y:e.pageY}}}const hk=e=>t=>Nf(t)&&e(t,sa(t));function ho(e,t,r,n){return Ho(e,t,hk(r),n)}const L1=1e-4,dk=1-L1,fk=1+L1,T1=.01,pk=0-T1,mk=0+T1;function Zt(e){return e.max-e.min}function gk(e,t,r){return Math.abs(e-t)<=r}function yg(e,t,r,n=.5){e.origin=n,e.originPoint=lt(t.min,t.max,e.origin),e.scale=Zt(r)/Zt(t),e.translate=lt(r.min,r.max,e.origin)-e.originPoint,(e.scale>=dk&&e.scale<=fk||isNaN(e.scale))&&(e.scale=1),(e.translate>=pk&&e.translate<=mk||isNaN(e.translate))&&(e.translate=0)}function fo(e,t,r,n){yg(e.x,t.x,r.x,n?n.originX:void 0),yg(e.y,t.y,r.y,n?n.originY:void 0)}function wg(e,t,r){e.min=r.min+t.min,e.max=e.min+Zt(t)}function vk(e,t,r){wg(e.x,t.x,r.x),wg(e.y,t.y,r.y)}function Sg(e,t,r){e.min=t.min-r.min,e.max=e.min+Zt(t)}function zl(e,t,r){Sg(e.x,t.x,r.x),Sg(e.y,t.y,r.y)}function gr(e){return[e("x"),e("y")]}const R1=({current:e})=>e?e.ownerDocument.defaultView:null,xg=(e,t)=>Math.abs(e-t);function _k(e,t){const r=xg(e.x,t.x),n=xg(e.y,t.y);return Math.sqrt(r**2+n**2)}const bg=new Set(["auto","scroll"]);class D1{constructor(t,r,{transformPagePoint:n,contextWindow:i=window,dragSnapToOrigin:a=!1,distanceThreshold:l=3,element:s}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.scrollPositions=new Map,this.removeScrollListeners=null,this.onElementScroll=_=>{this.handleScroll(_.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const _=uu(this.lastMoveEventInfo,this.history),y=this.startEvent!==null,v=_k(_.offset,{x:0,y:0})>=this.distanceThreshold;if(!y&&!v)return;const{point:h}=_,{timestamp:m}=Nt;this.history.push({...h,timestamp:m});const{onStart:d,onMove:g}=this.handlers;y||(d&&d(this.lastMoveEvent,_),this.startEvent=this.lastMoveEvent),g&&g(this.lastMoveEvent,_)},this.handlePointerMove=(_,y)=>{this.lastMoveEvent=_,this.lastMoveEventInfo=cu(y,this.transformPagePoint),it.update(this.updatePoint,!0)},this.handlePointerUp=(_,y)=>{this.end();const{onEnd:v,onSessionEnd:h,resumeAnimation:m}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&m&&m(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const d=uu(_.type==="pointercancel"?this.lastMoveEventInfo:cu(y,this.transformPagePoint),this.history);this.startEvent&&v&&v(_,d),h&&h(_,d)},!Nf(t))return;this.dragSnapToOrigin=a,this.handlers=r,this.transformPagePoint=n,this.distanceThreshold=l,this.contextWindow=i||window;const o=sa(t),c=cu(o,this.transformPagePoint),{point:f}=c,{timestamp:u}=Nt;this.history=[{...f,timestamp:u}];const{onSessionStart:p}=r;p&&p(t,uu(c,this.history)),this.removeListeners=ta(ho(this.contextWindow,"pointermove",this.handlePointerMove),ho(this.contextWindow,"pointerup",this.handlePointerUp),ho(this.contextWindow,"pointercancel",this.handlePointerUp)),s&&this.startScrollTracking(s)}startScrollTracking(t){let r=t.parentElement;for(;r;){const n=getComputedStyle(r);(bg.has(n.overflowX)||bg.has(n.overflowY))&&this.scrollPositions.set(r,{x:r.scrollLeft,y:r.scrollTop}),r=r.parentElement}this.scrollPositions.set(window,{x:window.scrollX,y:window.scrollY}),window.addEventListener("scroll",this.onElementScroll,{capture:!0,passive:!0}),window.addEventListener("scroll",this.onWindowScroll,{passive:!0}),this.removeScrollListeners=()=>{window.removeEventListener("scroll",this.onElementScroll,{capture:!0}),window.removeEventListener("scroll",this.onWindowScroll)}}handleScroll(t){const r=this.scrollPositions.get(t);if(!r)return;const n=t===window,i=n?{x:window.scrollX,y:window.scrollY}:{x:t.scrollLeft,y:t.scrollTop},a={x:i.x-r.x,y:i.y-r.y};a.x===0&&a.y===0||(n?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=a.x,this.lastMoveEventInfo.point.y+=a.y):this.history.length>0&&(this.history[0].x-=a.x,this.history[0].y-=a.y),this.scrollPositions.set(t,i),it.update(this.updatePoint,!0))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),Vn(this.updatePoint)}}function cu(e,t){return t?{point:t(e.point)}:e}function Cg(e,t){return{x:e.x-t.x,y:e.y-t.y}}function uu({point:e},t){return{point:e,delta:Cg(e,M1(t)),offset:Cg(e,yk(t)),velocity:wk(t,.1)}}function yk(e){return e[0]}function M1(e){return e[e.length-1]}function wk(e,t){if(e.length<2)return{x:0,y:0};let r=e.length-1,n=null;const i=M1(e);for(;r>=0&&(n=e[r],!(i.timestamp-n.timestamp>fn(t)));)r--;if(!n)return{x:0,y:0};const a=Sr(i.timestamp-n.timestamp);if(a===0)return{x:0,y:0};const l={x:(i.x-n.x)/a,y:(i.y-n.y)/a};return l.x===1/0&&(l.x=0),l.y===1/0&&(l.y=0),l}function Sk(e,{min:t,max:r},n){return t!==void 0&&e<t?e=n?lt(t,e,n.min):Math.max(e,t):r!==void 0&&e>r&&(e=n?lt(r,e,n.max):Math.min(e,r)),e}function Eg(e,t,r){return{min:t!==void 0?e.min+t:void 0,max:r!==void 0?e.max+r-(e.max-e.min):void 0}}function xk(e,{top:t,left:r,bottom:n,right:i}){return{x:Eg(e.x,r,i),y:Eg(e.y,t,n)}}function kg(e,t){let r=t.min-e.min,n=t.max-e.max;return t.max-t.min<e.max-e.min&&([r,n]=[n,r]),{min:r,max:n}}function bk(e,t){return{x:kg(e.x,t.x),y:kg(e.y,t.y)}}function Ck(e,t){let r=.5;const n=Zt(e),i=Zt(t);return i>n?r=Bo(t.min,t.max-n,e.min):n>i&&(r=Bo(e.min,e.max-i,t.min)),Gr(0,1,r)}function Ek(e,t){const r={};return t.min!==void 0&&(r.min=t.min-e.min),t.max!==void 0&&(r.max=t.max-e.min),r}const Yh=.35;function kk(e=Yh){return e===!1?e=0:e===!0&&(e=Yh),{x:Lg(e,"left","right"),y:Lg(e,"top","bottom")}}function Lg(e,t,r){return{min:Tg(e,t),max:Tg(e,r)}}function Tg(e,t){return typeof e=="number"?e:e[t]||0}const Lk=new WeakMap;class Tk{constructor(t){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=wt(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=t}start(t,{snapToCursor:r=!1,distanceThreshold:n}={}){const{presenceContext:i}=this.visualElement;if(i&&i.isPresent===!1)return;const a=u=>{r?(this.stopAnimation(),this.snapToCursor(sa(u).point)):this.pauseAnimation()},l=(u,p)=>{this.stopAnimation();const{drag:_,dragPropagation:y,onDragStart:v}=this.getProps();if(_&&!y&&(this.openDragLock&&this.openDragLock(),this.openDragLock=I5(_),!this.openDragLock))return;this.latestPointerEvent=u,this.latestPanInfo=p,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),gr(m=>{let d=this.getAxisMotionValue(m).get()||0;if(Kr.test(d)){const{projection:g}=this.visualElement;if(g&&g.layout){const w=g.layout.layoutBox[m];w&&(d=Zt(w)*(parseFloat(d)/100))}}this.originPoint[m]=d}),v&&it.postRender(()=>v(u,p)),qh(this.visualElement,"transform");const{animationState:h}=this.visualElement;h&&h.setActive("whileDrag",!0)},s=(u,p)=>{this.latestPointerEvent=u,this.latestPanInfo=p;const{dragPropagation:_,dragDirectionLock:y,onDirectionLock:v,onDrag:h}=this.getProps();if(!_&&!this.openDragLock)return;const{offset:m}=p;if(y&&this.currentDirection===null){this.currentDirection=Rk(m),this.currentDirection!==null&&v&&v(this.currentDirection);return}this.updateAxis("x",p.point,m),this.updateAxis("y",p.point,m),this.visualElement.render(),h&&h(u,p)},o=(u,p)=>{this.latestPointerEvent=u,this.latestPanInfo=p,this.stop(u,p),this.latestPointerEvent=null,this.latestPanInfo=null},c=()=>gr(u=>{var p;return this.getAnimationState(u)==="paused"&&((p=this.getAxisMotionValue(u).animation)==null?void 0:p.play())}),{dragSnapToOrigin:f}=this.getProps();this.panSession=new D1(t,{onSessionStart:a,onStart:l,onMove:s,onSessionEnd:o,resumeAnimation:c},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:f,distanceThreshold:n,contextWindow:R1(this.visualElement),element:this.visualElement.current})}stop(t,r){const n=t||this.latestPointerEvent,i=r||this.latestPanInfo,a=this.isDragging;if(this.cancel(),!a||!i||!n)return;const{velocity:l}=i;this.startAnimation(l);const{onDragEnd:s}=this.getProps();s&&it.postRender(()=>s(n,i))}cancel(){this.isDragging=!1;const{projection:t,animationState:r}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:n}=this.getProps();!n&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),r&&r.setActive("whileDrag",!1)}updateAxis(t,r,n){const{drag:i}=this.getProps();if(!n||!Ma(t,i,this.currentDirection))return;const a=this.getAxisMotionValue(t);let l=this.originPoint[t]+n[t];this.constraints&&this.constraints[t]&&(l=Sk(l,this.constraints[t],this.elastic[t])),a.set(l)}resolveConstraints(){var a;const{dragConstraints:t,dragElastic:r}=this.getProps(),n=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(a=this.visualElement.projection)==null?void 0:a.layout,i=this.constraints;t&&Yi(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):t&&n?this.constraints=xk(n.layoutBox,t):this.constraints=!1,this.elastic=kk(r),i!==this.constraints&&n&&this.constraints&&!this.hasMutatedConstraints&&gr(l=>{this.constraints!==!1&&this.getAxisMotionValue(l)&&(this.constraints[l]=Ek(n.layoutBox[l],this.constraints[l]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:r}=this.getProps();if(!t||!Yi(t))return!1;const n=t.current,{projection:i}=this.visualElement;if(!i||!i.layout)return!1;const a=ME(n,i.root,this.visualElement.getTransformPagePoint());let l=bk(i.layout.layoutBox,a);if(r){const s=r(TE(l));this.hasMutatedConstraints=!!s,s&&(l=p1(s))}return l}startAnimation(t){const{drag:r,dragMomentum:n,dragElastic:i,dragTransition:a,dragSnapToOrigin:l,onDragTransitionEnd:s}=this.getProps(),o=this.constraints||{},c=gr(f=>{if(!Ma(f,r,this.currentDirection))return;let u=o&&o[f]||{};l&&(u={min:0,max:0});const p=i?200:1e6,_=i?40:1e7,y={type:"inertia",velocity:n?t[f]:0,bounceStiffness:p,bounceDamping:_,timeConstant:750,restDelta:1,restSpeed:10,...a,...u};return this.startAxisValueAnimation(f,y)});return Promise.all(c).then(s)}startAxisValueAnimation(t,r){const n=this.getAxisMotionValue(t);return qh(this.visualElement,t),n.start(qf(t,n,0,r,this.visualElement,!1))}stopAnimation(){gr(t=>this.getAxisMotionValue(t).stop())}pauseAnimation(){gr(t=>{var r;return(r=this.getAxisMotionValue(t).animation)==null?void 0:r.pause()})}getAnimationState(t){var r;return(r=this.getAxisMotionValue(t).animation)==null?void 0:r.state}getAxisMotionValue(t){const r=`_drag${t.toUpperCase()}`,n=this.visualElement.getProps(),i=n[r];return i||this.visualElement.getValue(t,(n.initial?n.initial[t]:void 0)||0)}snapToCursor(t){gr(r=>{const{drag:n}=this.getProps();if(!Ma(r,n,this.currentDirection))return;const{projection:i}=this.visualElement,a=this.getAxisMotionValue(r);if(i&&i.layout){const{min:l,max:s}=i.layout.layoutBox[r],o=a.get()||0;a.set(t[r]-lt(l,s,.5)+o)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:r}=this.getProps(),{projection:n}=this.visualElement;if(!Yi(r)||!n||!this.constraints)return;this.stopAnimation();const i={x:0,y:0};gr(l=>{const s=this.getAxisMotionValue(l);if(s&&this.constraints!==!1){const o=s.get();i[l]=Ck({min:o,max:o},this.constraints[l])}});const{transformTemplate:a}=this.visualElement.getProps();this.visualElement.current.style.transform=a?a({},""):"none",n.root&&n.root.updateScroll(),n.updateLayout(),this.resolveConstraints(),gr(l=>{if(!Ma(l,t,null))return;const s=this.getAxisMotionValue(l),{min:o,max:c}=this.constraints[l];s.set(lt(o,c,i[l]))})}addListeners(){if(!this.visualElement.current)return;Lk.set(this.visualElement,this);const t=this.visualElement.current,r=ho(t,"pointerdown",o=>{const{drag:c,dragListener:f=!0}=this.getProps();c&&f&&!Qy(o.target)&&this.start(o)}),n=()=>{const{dragConstraints:o}=this.getProps();Yi(o)&&o.current&&(this.constraints=this.resolveRefConstraints())},{projection:i}=this.visualElement,a=i.addEventListener("measure",n);i&&!i.layout&&(i.root&&i.root.updateScroll(),i.updateLayout()),it.read(n);const l=Ho(window,"resize",()=>this.scalePositionWithinConstraints()),s=i.addEventListener("didUpdate",({delta:o,hasLayoutChanged:c})=>{this.isDragging&&c&&(gr(f=>{const u=this.getAxisMotionValue(f);u&&(this.originPoint[f]+=o[f].translate,u.set(u.get()+o[f].translate))}),this.visualElement.render())});return()=>{l(),r(),a(),s&&s()}}getProps(){const t=this.visualElement.getProps(),{drag:r=!1,dragDirectionLock:n=!1,dragPropagation:i=!1,dragConstraints:a=!1,dragElastic:l=Yh,dragMomentum:s=!0}=t;return{...t,drag:r,dragDirectionLock:n,dragPropagation:i,dragConstraints:a,dragElastic:l,dragMomentum:s}}}function Ma(e,t,r){return(t===!0||t===e)&&(r===null||r===e)}function Rk(e,t=10){let r=null;return Math.abs(e.y)>t?r="y":Math.abs(e.x)>t&&(r="x"),r}class Dk extends Yn{constructor(t){super(t),this.removeGroupControls=br,this.removeListeners=br,this.controls=new Tk(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||br}update(){const{dragControls:t}=this.node.getProps(),{dragControls:r}=this.node.prevProps||{};t!==r&&(this.removeGroupControls(),t&&(this.removeGroupControls=t.subscribe(this.controls)))}unmount(){this.removeGroupControls(),this.removeListeners()}}const Rg=e=>(t,r)=>{e&&it.postRender(()=>e(t,r))};class Mk extends Yn{constructor(){super(...arguments),this.removePointerDownListener=br}onPointerDown(t){this.session=new D1(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:R1(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:r,onPan:n,onPanEnd:i}=this.node.getProps();return{onSessionStart:Rg(t),onStart:Rg(r),onMove:n,onEnd:(a,l)=>{delete this.session,i&&it.postRender(()=>i(a,l))}}}mount(){this.removePointerDownListener=ho(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}const il={hasAnimatedSinceResize:!0,hasEverUpdated:!1};let hu=!1;class Ak extends E.Component{componentDidMount(){const{visualElement:t,layoutGroup:r,switchLayoutGroup:n,layoutId:i}=this.props,{projection:a}=t;a&&(r.group&&r.group.add(a),n&&n.register&&i&&n.register(a),hu&&a.root.didUpdate(),a.addEventListener("animationComplete",()=>{this.safeToRemove()}),a.setOptions({...a.options,onExitComplete:()=>this.safeToRemove()})),il.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:r,visualElement:n,drag:i,isPresent:a}=this.props,{projection:l}=n;return l&&(l.isPresent=a,hu=!0,i||t.layoutDependency!==r||r===void 0||t.isPresent!==a?l.willUpdate():this.safeToRemove(),t.isPresent!==a&&(a?l.promote():l.relegate()||it.postRender(()=>{const s=l.getStack();(!s||!s.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),Bf.postRender(()=>{!t.currentAnimation&&t.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:r,switchLayoutGroup:n}=this.props,{projection:i}=t;hu=!0,i&&(i.scheduleCheckAfterUnmount(),r&&r.group&&r.group.remove(i),n&&n.deregister&&n.deregister(i))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function A1(e){const[t,r]=e1(),n=E.useContext(mf);return T.jsx(Ak,{...e,layoutGroup:n,switchLayoutGroup:E.useContext(d1),isPresent:t,safeToRemove:r})}function Pk(e,t,r){const n=Gt(e)?e:gi(e);return n.start(qf("",n,t,r)),n.animation}const Ik=(e,t)=>e.depth-t.depth;class Ok{constructor(){this.children=[],this.isDirty=!1}add(t){_f(this.children,t),this.isDirty=!0}remove(t){yf(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(Ik),this.isDirty=!1,this.children.forEach(t)}}function Bk(e,t){const r=Qt.now(),n=({timestamp:i})=>{const a=i-r;a>=t&&(Vn(n),e(a-t))};return it.setup(n,!0),()=>Vn(n)}const P1=["TopLeft","TopRight","BottomLeft","BottomRight"],Nk=P1.length,Dg=e=>typeof e=="string"?parseFloat(e):e,Mg=e=>typeof e=="number"||Se.test(e);function jk(e,t,r,n,i,a){i?(e.opacity=lt(0,r.opacity??1,Fk(n)),e.opacityExit=lt(t.opacity??1,0,Hk(n))):a&&(e.opacity=lt(t.opacity??1,r.opacity??1,n));for(let l=0;l<Nk;l++){const s=`border${P1[l]}Radius`;let o=Ag(t,s),c=Ag(r,s);if(o===void 0&&c===void 0)continue;o||(o=0),c||(c=0),o===0||c===0||Mg(o)===Mg(c)?(e[s]=Math.max(lt(Dg(o),Dg(c),n),0),(Kr.test(c)||Kr.test(o))&&(e[s]+="%")):e[s]=c}(t.rotate||r.rotate)&&(e.rotate=lt(t.rotate||0,r.rotate||0,n))}function Ag(e,t){return e[t]!==void 0?e[t]:e.borderRadius}const Fk=I1(0,.5,_y),Hk=I1(.5,.95,br);function I1(e,t,r){return n=>n<e?0:n>t?1:r(Bo(e,t,n))}function Pg(e,t){e.min=t.min,e.max=t.max}function Lr(e,t){Pg(e.x,t.x),Pg(e.y,t.y)}function Ig(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}function Og(e,t,r,n,i){return e-=t,e=Hl(e,1/r,n),i!==void 0&&(e=Hl(e,1/i,n)),e}function $k(e,t=0,r=1,n=.5,i,a=e,l=e){if(Kr.test(t)&&(t=parseFloat(t),t=lt(l.min,l.max,t/100)-l.min),typeof t!="number")return;let s=lt(a.min,a.max,n);e===a&&(s-=t),e.min=Og(e.min,t,r,s,i),e.max=Og(e.max,t,r,s,i)}function Bg(e,t,[r,n,i],a,l){$k(e,t[r],t[n],t[i],t.scale,a,l)}const zk=["x","scaleX","originX"],Uk=["y","scaleY","originY"];function Ng(e,t,r,n){Bg(e.x,t,zk,r?r.x:void 0,n?n.x:void 0),Bg(e.y,t,Uk,r?r.y:void 0,n?n.y:void 0)}function jg(e){return e.translate===0&&e.scale===1}function O1(e){return jg(e.x)&&jg(e.y)}function Fg(e,t){return e.min===t.min&&e.max===t.max}function Wk(e,t){return Fg(e.x,t.x)&&Fg(e.y,t.y)}function Hg(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function B1(e,t){return Hg(e.x,t.x)&&Hg(e.y,t.y)}function $g(e){return Zt(e.x)/Zt(e.y)}function zg(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}class Vk{constructor(){this.members=[]}add(t){_f(this.members,t),t.scheduleRender()}remove(t){if(yf(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const r=this.members[this.members.length-1];r&&this.promote(r)}}relegate(t){const r=this.members.findIndex(i=>t===i);if(r===0)return!1;let n;for(let i=r;i>=0;i--){const a=this.members[i];if(a.isPresent!==!1){n=a;break}}return n?(this.promote(n),!0):!1}promote(t,r){const n=this.lead;if(t!==n&&(this.prevLead=n,this.lead=t,t.show(),n)){n.instance&&n.scheduleRender(),t.scheduleRender(),t.resumeFrom=n,r&&(t.resumeFrom.preserveOpacity=!0),n.snapshot&&(t.snapshot=n.snapshot,t.snapshot.latestValues=n.animationValues||n.latestValues),t.root&&t.root.isUpdating&&(t.isLayoutDirty=!0);const{crossfade:i}=t.options;i===!1&&n.hide()}}exitAnimationComplete(){this.members.forEach(t=>{const{options:r,resumingFrom:n}=t;r.onExitComplete&&r.onExitComplete(),n&&n.options.onExitComplete&&n.options.onExitComplete()})}scheduleRender(){this.members.forEach(t=>{t.instance&&t.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function Kk(e,t,r){let n="";const i=e.x.translate/t.x,a=e.y.translate/t.y,l=(r==null?void 0:r.z)||0;if((i||a||l)&&(n=`translate3d(${i}px, ${a}px, ${l}px) `),(t.x!==1||t.y!==1)&&(n+=`scale(${1/t.x}, ${1/t.y}) `),r){const{transformPerspective:c,rotate:f,rotateX:u,rotateY:p,skewX:_,skewY:y}=r;c&&(n=`perspective(${c}px) ${n}`),f&&(n+=`rotate(${f}deg) `),u&&(n+=`rotateX(${u}deg) `),p&&(n+=`rotateY(${p}deg) `),_&&(n+=`skewX(${_}deg) `),y&&(n+=`skewY(${y}deg) `)}const s=e.x.scale*t.x,o=e.y.scale*t.y;return(s!==1||o!==1)&&(n+=`scale(${s}, ${o})`),n||"none"}const du=["","X","Y","Z"],Gk=1e3;let qk=0;function fu(e,t,r,n){const{latestValues:i}=t;i[e]&&(r[e]=i[e],t.setStaticValue(e,0),n&&(n[e]=0))}function N1(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const r=x1(t);if(window.MotionHasOptimisedAnimation(r,"transform")){const{layout:i,layoutId:a}=e.options;window.MotionCancelOptimisedAnimation(r,"transform",it,!(i||a))}const{parent:n}=e;n&&!n.hasCheckedOptimisedAppear&&N1(n)}function j1({attachResizeListener:e,defaultParent:t,measureScroll:r,checkIsScrollRoot:n,resetTransform:i}){return class{constructor(l={},s=t==null?void 0:t()){this.id=qk++,this.animationId=0,this.animationCommitId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.layoutVersion=0,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,this.nodes.forEach(Jk),this.nodes.forEach(tL),this.nodes.forEach(rL),this.nodes.forEach(Qk)},this.resolvedRelativeTargetAt=0,this.linkedParentVersion=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=l,this.root=s?s.root||s:this,this.path=s?[...s.path,s]:[],this.parent=s,this.depth=s?s.depth+1:0;for(let o=0;o<this.path.length;o++)this.path[o].shouldResetTransform=!0;this.root===this&&(this.nodes=new Ok)}addEventListener(l,s){return this.eventHandlers.has(l)||this.eventHandlers.set(l,new xf),this.eventHandlers.get(l).add(s)}notifyListeners(l,...s){const o=this.eventHandlers.get(l);o&&o.notify(...s)}hasListeners(l){return this.eventHandlers.has(l)}mount(l){if(this.instance)return;this.isSVG=Zy(l)&&!F5(l),this.instance=l;const{layoutId:s,layout:o,visualElement:c}=this.options;if(c&&!c.current&&c.mount(l),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(o||s)&&(this.isLayoutDirty=!0),e){let f,u=0;const p=()=>this.root.updateBlockedByResize=!1;it.read(()=>{u=window.innerWidth}),e(l,()=>{const _=window.innerWidth;_!==u&&(u=_,this.root.updateBlockedByResize=!0,f&&f(),f=Bk(p,250),il.hasAnimatedSinceResize&&(il.hasAnimatedSinceResize=!1,this.nodes.forEach(Vg)))})}s&&this.root.registerSharedNode(s,this),this.options.animate!==!1&&c&&(s||o)&&this.addEventListener("didUpdate",({delta:f,hasLayoutChanged:u,hasRelativeLayoutChanged:p,layout:_})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const y=this.options.transition||c.getDefaultTransition()||aL,{onLayoutAnimationStart:v,onLayoutAnimationComplete:h}=c.getProps(),m=!this.targetLayout||!B1(this.targetLayout,_),d=!u&&p;if(this.options.layoutRoot||this.resumeFrom||d||u&&(m||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const g={...If(y,"layout"),onPlay:v,onComplete:h};(c.shouldReduceMotion||this.options.layoutRoot)&&(g.delay=0,g.type=!1),this.startAnimation(g),this.setAnimationOrigin(f,d)}else u||Vg(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=_})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const l=this.getStack();l&&l.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),Vn(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(nL),this.animationId++)}getTransformTemplate(){const{visualElement:l}=this.options;return l&&l.getProps().transformTemplate}willUpdate(l=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&N1(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let f=0;f<this.path.length;f++){const u=this.path[f];u.shouldResetTransform=!0,u.updateScroll("snapshot"),u.options.layoutRoot&&u.willUpdate(!1)}const{layoutId:s,layout:o}=this.options;if(s===void 0&&!o)return;const c=this.getTransformTemplate();this.prevTransformTemplateValue=c?c(this.latestValues,""):void 0,this.updateSnapshot(),l&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(Ug);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(Wg);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(eL),this.nodes.forEach(Xk),this.nodes.forEach(Yk)):this.nodes.forEach(Wg),this.clearAllSnapshots();const s=Qt.now();Nt.delta=Gr(0,1e3/60,s-Nt.timestamp),Nt.timestamp=s,Nt.isProcessing=!0,eu.update.process(Nt),eu.preRender.process(Nt),eu.render.process(Nt),Nt.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,Bf.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(Zk),this.sharedNodes.forEach(sL)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,it.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){it.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!Zt(this.snapshot.measuredBox.x)&&!Zt(this.snapshot.measuredBox.y)&&(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let o=0;o<this.path.length;o++)this.path[o].updateScroll();const l=this.layout;this.layout=this.measure(!1),this.layoutVersion++,this.layoutCorrected=wt(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:s}=this.options;s&&s.notify("LayoutMeasure",this.layout.layoutBox,l?l.layoutBox:void 0)}updateScroll(l="measure"){let s=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===l&&(s=!1),s&&this.instance){const o=n(this.instance);this.scroll={animationId:this.root.animationId,phase:l,isRoot:o,offset:r(this.instance),wasRoot:this.scroll?this.scroll.isRoot:o}}}resetTransform(){if(!i)return;const l=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,s=this.projectionDelta&&!O1(this.projectionDelta),o=this.getTransformTemplate(),c=o?o(this.latestValues,""):void 0,f=c!==this.prevTransformTemplateValue;l&&this.instance&&(s||as(this.latestValues)||f)&&(i(this.instance,c),this.shouldResetTransform=!1,this.scheduleRender())}measure(l=!0){const s=this.measurePageBox();let o=this.removeElementScroll(s);return l&&(o=this.removeTransform(o)),lL(o),{animationId:this.root.animationId,measuredBox:s,layoutBox:o,latestValues:{},source:this.id}}measurePageBox(){var c;const{visualElement:l}=this.options;if(!l)return wt();const s=l.measureViewportBox();if(!(((c=this.scroll)==null?void 0:c.wasRoot)||this.path.some(cL))){const{scroll:f}=this.root;f&&(qs(s.x,f.offset.x),qs(s.y,f.offset.y))}return s}removeElementScroll(l){var o;const s=wt();if(Lr(s,l),(o=this.scroll)!=null&&o.wasRoot)return s;for(let c=0;c<this.path.length;c++){const f=this.path[c],{scroll:u,options:p}=f;f!==this.root&&u&&p.layoutScroll&&(u.wasRoot&&Lr(s,l),qs(s.x,u.offset.x),qs(s.y,u.offset.y))}return s}applyTransform(l,s=!1){const o=wt();Lr(o,l);for(let c=0;c<this.path.length;c++){const f=this.path[c];!s&&f.options.layoutScroll&&f.scroll&&f!==f.root&&Xs(o,{x:-f.scroll.offset.x,y:-f.scroll.offset.y}),as(f.latestValues)&&Xs(o,f.latestValues)}return as(this.latestValues)&&Xs(o,this.latestValues),o}removeTransform(l){const s=wt();Lr(s,l);for(let o=0;o<this.path.length;o++){const c=this.path[o];if(!c.instance||!as(c.latestValues))continue;Vh(c.latestValues)&&c.updateSnapshot();const f=wt(),u=c.measurePageBox();Lr(f,u),Ng(s,c.latestValues,c.snapshot?c.snapshot.layoutBox:void 0,f)}return as(this.latestValues)&&Ng(s,this.latestValues),s}setTargetDelta(l){this.targetDelta=l,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(l){this.options={...this.options,...l,crossfade:l.crossfade!==void 0?l.crossfade:!0}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==Nt.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(l=!1){var _;const s=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=s.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=s.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=s.isSharedProjectionDirty);const o=!!this.resumingFrom||this!==s;if(!(l||o&&this.isSharedProjectionDirty||this.isProjectionDirty||(_=this.parent)!=null&&_.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:f,layoutId:u}=this.options;if(!this.layout||!(f||u))return;this.resolvedRelativeTargetAt=Nt.timestamp;const p=this.getClosestProjectingParent();p&&this.linkedParentVersion!==p.layoutVersion&&!p.options.layoutRoot&&this.removeRelativeTarget(),!this.targetDelta&&!this.relativeTarget&&(p&&p.layout?this.createRelativeTarget(p,this.layout.layoutBox,p.layout.layoutBox):this.removeRelativeTarget()),!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=wt(),this.targetWithTransforms=wt()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),vk(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):Lr(this.target,this.layout.layoutBox),g1(this.target,this.targetDelta)):Lr(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,p&&!!p.resumingFrom==!!this.resumingFrom&&!p.options.layoutScroll&&p.target&&this.animationProgress!==1?this.createRelativeTarget(p,this.target,p.target):this.relativeParent=this.relativeTarget=void 0))}getClosestProjectingParent(){if(!(!this.parent||Vh(this.parent.latestValues)||m1(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}createRelativeTarget(l,s,o){this.relativeParent=l,this.linkedParentVersion=l.layoutVersion,this.forceRelativeParentToResolveTarget(),this.relativeTarget=wt(),this.relativeTargetOrigin=wt(),zl(this.relativeTargetOrigin,s,o),Lr(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){var y;const l=this.getLead(),s=!!this.resumingFrom||this!==l;let o=!0;if((this.isProjectionDirty||(y=this.parent)!=null&&y.isProjectionDirty)&&(o=!1),s&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(o=!1),this.resolvedRelativeTargetAt===Nt.timestamp&&(o=!1),o)return;const{layout:c,layoutId:f}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(c||f))return;Lr(this.layoutCorrected,this.layout.layoutBox);const u=this.treeScale.x,p=this.treeScale.y;DE(this.layoutCorrected,this.treeScale,this.path,s),l.layout&&!l.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(l.target=l.layout.layoutBox,l.targetWithTransforms=wt());const{target:_}=l;if(!_){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(Ig(this.prevProjectionDelta.x,this.projectionDelta.x),Ig(this.prevProjectionDelta.y,this.projectionDelta.y)),fo(this.projectionDelta,this.layoutCorrected,_,this.latestValues),(this.treeScale.x!==u||this.treeScale.y!==p||!zg(this.projectionDelta.x,this.prevProjectionDelta.x)||!zg(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",_))}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(l=!0){var s;if((s=this.options.visualElement)==null||s.scheduleRender(),l){const o=this.getStack();o&&o.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=Ys(),this.projectionDelta=Ys(),this.projectionDeltaWithTransform=Ys()}setAnimationOrigin(l,s=!1){const o=this.snapshot,c=o?o.latestValues:{},f={...this.latestValues},u=Ys();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!s;const p=wt(),_=o?o.source:void 0,y=this.layout?this.layout.source:void 0,v=_!==y,h=this.getStack(),m=!h||h.members.length<=1,d=!!(v&&!m&&this.options.crossfade===!0&&!this.path.some(oL));this.animationProgress=0;let g;this.mixTargetDelta=w=>{const b=w/1e3;Kg(u.x,l.x,b),Kg(u.y,l.y,b),this.setTargetDelta(u),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(zl(p,this.layout.layoutBox,this.relativeParent.layout.layoutBox),iL(this.relativeTarget,this.relativeTargetOrigin,p,b),g&&Wk(this.relativeTarget,g)&&(this.isProjectionDirty=!1),g||(g=wt()),Lr(g,this.relativeTarget)),v&&(this.animationValues=f,jk(f,c,this.latestValues,b,d,m)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=b},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(l){var s,o,c;this.notifyListeners("animationStart"),(s=this.currentAnimation)==null||s.stop(),(c=(o=this.resumingFrom)==null?void 0:o.currentAnimation)==null||c.stop(),this.pendingAnimation&&(Vn(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=it.update(()=>{il.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=gi(0)),this.currentAnimation=Pk(this.motionValue,[0,1e3],{...l,velocity:0,isSync:!0,onUpdate:f=>{this.mixTargetDelta(f),l.onUpdate&&l.onUpdate(f)},onStop:()=>{},onComplete:()=>{l.onComplete&&l.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const l=this.getStack();l&&l.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(Gk),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const l=this.getLead();let{targetWithTransforms:s,target:o,layout:c,latestValues:f}=l;if(!(!s||!o||!c)){if(this!==l&&this.layout&&c&&F1(this.options.animationType,this.layout.layoutBox,c.layoutBox)){o=this.target||wt();const u=Zt(this.layout.layoutBox.x);o.x.min=l.target.x.min,o.x.max=o.x.min+u;const p=Zt(this.layout.layoutBox.y);o.y.min=l.target.y.min,o.y.max=o.y.min+p}Lr(s,o),Xs(s,f),fo(this.projectionDeltaWithTransform,this.layoutCorrected,s,f)}}registerSharedNode(l,s){this.sharedNodes.has(l)||this.sharedNodes.set(l,new Vk),this.sharedNodes.get(l).add(s);const c=s.options.initialPromotionConfig;s.promote({transition:c?c.transition:void 0,preserveFollowOpacity:c&&c.shouldPreserveFollowOpacity?c.shouldPreserveFollowOpacity(s):void 0})}isLead(){const l=this.getStack();return l?l.lead===this:!0}getLead(){var s;const{layoutId:l}=this.options;return l?((s=this.getStack())==null?void 0:s.lead)||this:this}getPrevLead(){var s;const{layoutId:l}=this.options;return l?(s=this.getStack())==null?void 0:s.prevLead:void 0}getStack(){const{layoutId:l}=this.options;if(l)return this.root.sharedNodes.get(l)}promote({needsReset:l,transition:s,preserveFollowOpacity:o}={}){const c=this.getStack();c&&c.promote(this,o),l&&(this.projectionDelta=void 0,this.needsReset=!0),s&&this.setOptions({transition:s})}relegate(){const l=this.getStack();return l?l.relegate(this):!1}resetSkewAndRotation(){const{visualElement:l}=this.options;if(!l)return;let s=!1;const{latestValues:o}=l;if((o.z||o.rotate||o.rotateX||o.rotateY||o.rotateZ||o.skewX||o.skewY)&&(s=!0),!s)return;const c={};o.z&&fu("z",l,c,this.animationValues);for(let f=0;f<du.length;f++)fu(`rotate${du[f]}`,l,c,this.animationValues),fu(`skew${du[f]}`,l,c,this.animationValues);l.render();for(const f in c)l.setStaticValue(f,c[f]),this.animationValues&&(this.animationValues[f]=c[f]);l.scheduleRender()}applyProjectionStyles(l,s){if(!this.instance||this.isSVG)return;if(!this.isVisible){l.visibility="hidden";return}const o=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,l.visibility="",l.opacity="",l.pointerEvents=sl(s==null?void 0:s.pointerEvents)||"",l.transform=o?o(this.latestValues,""):"none";return}const c=this.getLead();if(!this.projectionDelta||!this.layout||!c.target){this.options.layoutId&&(l.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,l.pointerEvents=sl(s==null?void 0:s.pointerEvents)||""),this.hasProjected&&!as(this.latestValues)&&(l.transform=o?o({},""):"none",this.hasProjected=!1);return}l.visibility="";const f=c.animationValues||c.latestValues;this.applyTransformsToTarget();let u=Kk(this.projectionDeltaWithTransform,this.treeScale,f);o&&(u=o(f,u)),l.transform=u;const{x:p,y:_}=this.projectionDelta;l.transformOrigin=`${p.origin*100}% ${_.origin*100}% 0`,c.animationValues?l.opacity=c===this?f.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:f.opacityExit:l.opacity=c===this?f.opacity!==void 0?f.opacity:"":f.opacityExit!==void 0?f.opacityExit:0;for(const y in Wh){if(f[y]===void 0)continue;const{correct:v,applyTo:h,isCSSVariable:m}=Wh[y],d=u==="none"?f[y]:v(f[y],c);if(h){const g=h.length;for(let w=0;w<g;w++)l[h[w]]=d}else m?this.options.visualElement.renderState.vars[y]=d:l[y]=d}this.options.layoutId&&(l.pointerEvents=c===this?sl(s==null?void 0:s.pointerEvents)||"":"none")}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(l=>{var s;return(s=l.currentAnimation)==null?void 0:s.stop()}),this.root.nodes.forEach(Ug),this.root.sharedNodes.clear()}}}function Xk(e){e.updateLayout()}function Yk(e){var r;const t=((r=e.resumeFrom)==null?void 0:r.snapshot)||e.snapshot;if(e.isLead()&&e.layout&&t&&e.hasListeners("didUpdate")){const{layoutBox:n,measuredBox:i}=e.layout,{animationType:a}=e.options,l=t.source!==e.layout.source;a==="size"?gr(u=>{const p=l?t.measuredBox[u]:t.layoutBox[u],_=Zt(p);p.min=n[u].min,p.max=p.min+_}):F1(a,t.layoutBox,n)&&gr(u=>{const p=l?t.measuredBox[u]:t.layoutBox[u],_=Zt(n[u]);p.max=p.min+_,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[u].max=e.relativeTarget[u].min+_)});const s=Ys();fo(s,n,t.layoutBox);const o=Ys();l?fo(o,e.applyTransform(i,!0),t.measuredBox):fo(o,n,t.layoutBox);const c=!O1(s);let f=!1;if(!e.resumeFrom){const u=e.getClosestProjectingParent();if(u&&!u.resumeFrom){const{snapshot:p,layout:_}=u;if(p&&_){const y=wt();zl(y,t.layoutBox,p.layoutBox);const v=wt();zl(v,n,_.layoutBox),B1(y,v)||(f=!0),u.options.layoutRoot&&(e.relativeTarget=v,e.relativeTargetOrigin=y,e.relativeParent=u)}}}e.notifyListeners("didUpdate",{layout:n,snapshot:t,delta:o,layoutDelta:s,hasLayoutChanged:c,hasRelativeLayoutChanged:f})}else if(e.isLead()){const{onExitComplete:n}=e.options;n&&n()}e.options.transition=void 0}function Jk(e){e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||(e.isSharedProjectionDirty=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty)),e.isTransformDirty||(e.isTransformDirty=e.parent.isTransformDirty))}function Qk(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function Zk(e){e.clearSnapshot()}function Ug(e){e.clearMeasurements()}function Wg(e){e.isLayoutDirty=!1}function eL(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function Vg(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function tL(e){e.resolveTargetDelta()}function rL(e){e.calcProjection()}function nL(e){e.resetSkewAndRotation()}function sL(e){e.removeLeadSnapshot()}function Kg(e,t,r){e.translate=lt(t.translate,0,r),e.scale=lt(t.scale,1,r),e.origin=t.origin,e.originPoint=t.originPoint}function Gg(e,t,r,n){e.min=lt(t.min,r.min,n),e.max=lt(t.max,r.max,n)}function iL(e,t,r,n){Gg(e.x,t.x,r.x,n),Gg(e.y,t.y,r.y,n)}function oL(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const aL={duration:.45,ease:[.4,0,.1,1]},qg=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),Xg=qg("applewebkit/")&&!qg("chrome/")?Math.round:br;function Yg(e){e.min=Xg(e.min),e.max=Xg(e.max)}function lL(e){Yg(e.x),Yg(e.y)}function F1(e,t,r){return e==="position"||e==="preserve-aspect"&&!gk($g(t),$g(r),.2)}function cL(e){var t;return e!==e.root&&((t=e.scroll)==null?void 0:t.wasRoot)}const uL=j1({attachResizeListener:(e,t)=>Ho(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),pu={current:void 0},H1=j1({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!pu.current){const e=new uL({});e.mount(window),e.setOptions({layoutScroll:!0}),pu.current=e}return pu.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),hL={pan:{Feature:Mk},drag:{Feature:Dk,ProjectionNode:H1,MeasureLayout:A1}};function Jg(e,t,r){const{props:n}=e;e.animationState&&n.whileHover&&e.animationState.setActive("whileHover",r==="Start");const i="onHover"+r,a=n[i];a&&it.postRender(()=>a(t,sa(t)))}class dL extends Yn{mount(){const{current:t}=this.node;t&&(this.unmount=O5(t,(r,n)=>(Jg(this.node,n,"Start"),i=>Jg(this.node,i,"End"))))}unmount(){}}class fL extends Yn{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch{t=!0}!t||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=ta(Ho(this.node.current,"focus",()=>this.onFocus()),Ho(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function Qg(e,t,r){const{props:n}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;e.animationState&&n.whileTap&&e.animationState.setActive("whileTap",r==="Start");const i="onTap"+(r==="End"?"":r),a=n[i];a&&it.postRender(()=>a(t,sa(t)))}class pL extends Yn{mount(){const{current:t}=this.node;t&&(this.unmount=j5(t,(r,n)=>(Qg(this.node,n,"Start"),(i,{success:a})=>Qg(this.node,i,a?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const Jh=new WeakMap,mu=new WeakMap,mL=e=>{const t=Jh.get(e.target);t&&t(e)},gL=e=>{e.forEach(mL)};function vL({root:e,...t}){const r=e||document;mu.has(r)||mu.set(r,{});const n=mu.get(r),i=JSON.stringify(t);return n[i]||(n[i]=new IntersectionObserver(gL,{root:e,...t})),n[i]}function _L(e,t,r){const n=vL(t);return Jh.set(e,r),n.observe(e),()=>{Jh.delete(e),n.unobserve(e)}}const yL={some:0,all:1};class wL extends Yn{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:t={}}=this.node.getProps(),{root:r,margin:n,amount:i="some",once:a}=t,l={root:r?r.current:void 0,rootMargin:n,threshold:typeof i=="number"?i:yL[i]},s=o=>{const{isIntersecting:c}=o;if(this.isInView===c||(this.isInView=c,a&&!c&&this.hasEnteredView))return;c&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",c);const{onViewportEnter:f,onViewportLeave:u}=this.node.getProps(),p=c?f:u;p&&p(o)};return _L(this.node.current,l,s)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:r}=this.node;["amount","margin","root"].some(SL(t,r))&&this.startObserver()}unmount(){}}function SL({viewport:e={}},{viewport:t={}}={}){return r=>e[r]!==t[r]}const xL={inView:{Feature:wL},tap:{Feature:pL},focus:{Feature:fL},hover:{Feature:dL}},bL={layout:{ProjectionNode:H1,MeasureLayout:A1}},CL={...uk,...xL,...hL,...bL},Qh=LE(CL,FE);function $1(){!Gf.current&&_1();const[e]=E.useState($l.current);return e}function EL(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return E.useMemo(()=>n=>{t.forEach(i=>i(n))},t)}const Sc=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function ki(e){const t=Object.prototype.toString.call(e);return t==="[object Window]"||t==="[object global]"}function Xf(e){return"nodeType"in e}function lr(e){var t,r;return e?ki(e)?e:Xf(e)&&(t=(r=e.ownerDocument)==null?void 0:r.defaultView)!=null?t:window:window}function Yf(e){const{Document:t}=lr(e);return e instanceof t}function ia(e){return ki(e)?!1:e instanceof lr(e).HTMLElement}function z1(e){return e instanceof lr(e).SVGElement}function Li(e){return e?ki(e)?e.document:Xf(e)?Yf(e)?e:ia(e)||z1(e)?e.ownerDocument:document:document:document}const qr=Sc?E.useLayoutEffect:E.useEffect;function Jf(e){const t=E.useRef(e);return qr(()=>{t.current=e}),E.useCallback(function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return t.current==null?void 0:t.current(...n)},[])}function kL(){const e=E.useRef(null),t=E.useCallback((n,i)=>{e.current=setInterval(n,i)},[]),r=E.useCallback(()=>{e.current!==null&&(clearInterval(e.current),e.current=null)},[]);return[t,r]}function $o(e,t){t===void 0&&(t=[e]);const r=E.useRef(e);return qr(()=>{r.current!==e&&(r.current=e)},t),r}function oa(e,t){const r=E.useRef();return E.useMemo(()=>{const n=e(r.current);return r.current=n,n},[...t])}function Ul(e){const t=Jf(e),r=E.useRef(null),n=E.useCallback(i=>{i!==r.current&&(t==null||t(i,r.current)),r.current=i},[]);return[r,n]}function Zh(e){const t=E.useRef();return E.useEffect(()=>{t.current=e},[e]),t.current}let gu={};function aa(e,t){return E.useMemo(()=>{if(t)return t;const r=gu[e]==null?0:gu[e]+1;return gu[e]=r,e+"-"+r},[e,t])}function U1(e){return function(t){for(var r=arguments.length,n=new Array(r>1?r-1:0),i=1;i<r;i++)n[i-1]=arguments[i];return n.reduce((a,l)=>{const s=Object.entries(l);for(const[o,c]of s){const f=a[o];f!=null&&(a[o]=f+e*c)}return a},{...t})}}const ai=U1(1),Wl=U1(-1);function LL(e){return"clientX"in e&&"clientY"in e}function Qf(e){if(!e)return!1;const{KeyboardEvent:t}=lr(e.target);return t&&e instanceof t}function TL(e){if(!e)return!1;const{TouchEvent:t}=lr(e.target);return t&&e instanceof t}function ed(e){if(TL(e)){if(e.touches&&e.touches.length){const{clientX:t,clientY:r}=e.touches[0];return{x:t,y:r}}else if(e.changedTouches&&e.changedTouches.length){const{clientX:t,clientY:r}=e.changedTouches[0];return{x:t,y:r}}}return LL(e)?{x:e.clientX,y:e.clientY}:null}const zo=Object.freeze({Translate:{toString(e){if(!e)return;const{x:t,y:r}=e;return"translate3d("+(t?Math.round(t):0)+"px, "+(r?Math.round(r):0)+"px, 0)"}},Scale:{toString(e){if(!e)return;const{scaleX:t,scaleY:r}=e;return"scaleX("+t+") scaleY("+r+")"}},Transform:{toString(e){if(e)return[zo.Translate.toString(e),zo.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:r,easing:n}=e;return t+" "+r+"ms "+n}}}),Zg="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function RL(e){return e.matches(Zg)?e:e.querySelector(Zg)}const DL={display:"none"};function ML(e){let{id:t,value:r}=e;return gt.createElement("div",{id:t,style:DL},r)}function AL(e){let{id:t,announcement:r,ariaLiveType:n="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 gt.createElement("div",{id:t,style:i,role:"status","aria-live":n,"aria-atomic":!0},r)}function PL(){const[e,t]=E.useState("");return{announce:E.useCallback(n=>{n!=null&&t(n)},[]),announcement:e}}const W1=E.createContext(null);function IL(e){const t=E.useContext(W1);E.useEffect(()=>{if(!t)throw new Error("useDndMonitor must be used within a children of <DndContext>");return t(e)},[e,t])}function OL(){const[e]=E.useState(()=>new Set),t=E.useCallback(n=>(e.add(n),()=>e.delete(n)),[e]);return[E.useCallback(n=>{let{type:i,event:a}=n;e.forEach(l=>{var s;return(s=l[i])==null?void 0:s.call(l,a)})},[e]),t]}const BL={draggable:`
|
|
49
49
|
To pick up a draggable item, press the space bar.
|
|
50
50
|
While dragging, use the arrow keys to move the item.
|
|
51
51
|
Press space again to drop the item in its new position, or press escape to cancel.
|
|
52
|
-
`},NL={onDragStart(e){let{active:t}=e;return"Picked up draggable item "+t.id+"."},onDragOver(e){let{active:t,over:r}=e;return r?"Draggable item "+t.id+" was moved over droppable area "+r.id+".":"Draggable item "+t.id+" is no longer over a droppable area."},onDragEnd(e){let{active:t,over:r}=e;return r?"Draggable item "+t.id+" was dropped over droppable area "+r.id:"Draggable item "+t.id+" was dropped."},onDragCancel(e){let{active:t}=e;return"Dragging was cancelled. Draggable item "+t.id+" was dropped."}};function jL(e){let{announcements:t=NL,container:r,hiddenTextDescribedById:n,screenReaderInstructions:i=BL}=e;const{announce:a,announcement:l}=PL(),s=aa("DndLiveRegion"),[o,c]=E.useState(!1);if(E.useEffect(()=>{c(!0)},[]),IL(E.useMemo(()=>({onDragStart(u){let{active:p}=u;a(t.onDragStart({active:p}))},onDragMove(u){let{active:p,over:_}=u;t.onDragMove&&a(t.onDragMove({active:p,over:_}))},onDragOver(u){let{active:p,over:_}=u;a(t.onDragOver({active:p,over:_}))},onDragEnd(u){let{active:p,over:_}=u;a(t.onDragEnd({active:p,over:_}))},onDragCancel(u){let{active:p,over:_}=u;a(t.onDragCancel({active:p,over:_}))}}),[a,t])),!o)return null;const f=gt.createElement(gt.Fragment,null,gt.createElement(ML,{id:n,value:i.draggable}),gt.createElement(AL,{id:s,announcement:l}));return r?hn.createPortal(f,r):f}var xt;(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"})(xt||(xt={}));function Vl(){}function FL(e,t){return E.useMemo(()=>({sensor:e,options:t??{}}),[e,t])}function HL(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return E.useMemo(()=>[...t].filter(n=>n!=null),[...t])}const jr=Object.freeze({x:0,y:0});function $L(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function zL(e,t){let{data:{value:r}}=e,{data:{value:n}}=t;return r-n}function UL(e,t){let{data:{value:r}}=e,{data:{value:n}}=t;return n-r}function WL(e,t){if(!e||e.length===0)return null;const[r]=e;return r[t]}function ev(e,t,r){return t===void 0&&(t=e.left),r===void 0&&(r=e.top),{x:t+e.width*.5,y:r+e.height*.5}}const VL=e=>{let{collisionRect:t,droppableRects:r,droppableContainers:n}=e;const i=ev(t,t.left,t.top),a=[];for(const l of n){const{id:s}=l,o=r.get(s);if(o){const c=$L(ev(o),i);a.push({id:s,data:{droppableContainer:l,value:c}})}}return a.sort(zL)};function KL(e,t){const r=Math.max(t.top,e.top),n=Math.max(t.left,e.left),i=Math.min(t.left+t.width,e.left+e.width),a=Math.min(t.top+t.height,e.top+e.height),l=i-n,s=a-r;if(n<i&&r<a){const o=t.width*t.height,c=e.width*e.height,f=l*s,u=f/(o+c-f);return Number(u.toFixed(4))}return 0}const GL=e=>{let{collisionRect:t,droppableRects:r,droppableContainers:n}=e;const i=[];for(const a of n){const{id:l}=a,s=r.get(l);if(s){const o=KL(s,t);o>0&&i.push({id:l,data:{droppableContainer:a,value:o}})}}return i.sort(UL)};function qL(e,t,r){return{...e,scaleX:t&&r?t.width/r.width:1,scaleY:t&&r?t.height/r.height:1}}function V1(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:jr}function XL(e){return function(r){for(var n=arguments.length,i=new Array(n>1?n-1:0),a=1;a<n;a++)i[a-1]=arguments[a];return i.reduce((l,s)=>({...l,top:l.top+e*s.y,bottom:l.bottom+e*s.y,left:l.left+e*s.x,right:l.right+e*s.x}),{...r})}}const YL=XL(1);function JL(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 QL(e,t,r){const n=JL(t);if(!n)return e;const{scaleX:i,scaleY:a,x:l,y:s}=n,o=e.left-l-(1-i)*parseFloat(r),c=e.top-s-(1-a)*parseFloat(r.slice(r.indexOf(" ")+1)),f=i?e.width/i:e.width,u=a?e.height/a:e.height;return{width:f,height:u,top:c,right:o+f,bottom:c+u,left:o}}const ZL={ignoreTransform:!1};function Ti(e,t){t===void 0&&(t=ZL);let r=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:c,transformOrigin:f}=lr(e).getComputedStyle(e);c&&(r=QL(r,c,f))}const{top:n,left:i,width:a,height:l,bottom:s,right:o}=r;return{top:n,left:i,width:a,height:l,bottom:s,right:o}}function tv(e){return Ti(e,{ignoreTransform:!0})}function eT(e){const t=e.innerWidth,r=e.innerHeight;return{top:0,left:0,right:t,bottom:r,width:t,height:r}}function tT(e,t){return t===void 0&&(t=lr(e).getComputedStyle(e)),t.position==="fixed"}function rT(e,t){t===void 0&&(t=lr(e).getComputedStyle(e));const r=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(i=>{const a=t[i];return typeof a=="string"?r.test(a):!1})}function Zf(e,t){const r=[];function n(i){if(t!=null&&r.length>=t||!i)return r;if(Yf(i)&&i.scrollingElement!=null&&!r.includes(i.scrollingElement))return r.push(i.scrollingElement),r;if(!ia(i)||z1(i)||r.includes(i))return r;const a=lr(e).getComputedStyle(i);return i!==e&&rT(i,a)&&r.push(i),tT(i,a)?r:n(i.parentNode)}return e?n(e):r}function K1(e){const[t]=Zf(e,1);return t??null}function vu(e){return!Sc||!e?null:ki(e)?e:Xf(e)?Yf(e)||e===Li(e).scrollingElement?window:ia(e)?e:null:null}function G1(e){return ki(e)?e.scrollX:e.scrollLeft}function q1(e){return ki(e)?e.scrollY:e.scrollTop}function td(e){return{x:G1(e),y:q1(e)}}var Tt;(function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"})(Tt||(Tt={}));function X1(e){return!Sc||!e?!1:e===document.scrollingElement}function Y1(e){const t={x:0,y:0},r=X1(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},n={x:e.scrollWidth-r.width,y:e.scrollHeight-r.height},i=e.scrollTop<=t.y,a=e.scrollLeft<=t.x,l=e.scrollTop>=n.y,s=e.scrollLeft>=n.x;return{isTop:i,isLeft:a,isBottom:l,isRight:s,maxScroll:n,minScroll:t}}const nT={x:.2,y:.2};function sT(e,t,r,n,i){let{top:a,left:l,right:s,bottom:o}=r;n===void 0&&(n=10),i===void 0&&(i=nT);const{isTop:c,isBottom:f,isLeft:u,isRight:p}=Y1(e),_={x:0,y:0},y={x:0,y:0},v={height:t.height*i.y,width:t.width*i.x};return!c&&a<=t.top+v.height?(_.y=Tt.Backward,y.y=n*Math.abs((t.top+v.height-a)/v.height)):!f&&o>=t.bottom-v.height&&(_.y=Tt.Forward,y.y=n*Math.abs((t.bottom-v.height-o)/v.height)),!p&&s>=t.right-v.width?(_.x=Tt.Forward,y.x=n*Math.abs((t.right-v.width-s)/v.width)):!u&&l<=t.left+v.width&&(_.x=Tt.Backward,y.x=n*Math.abs((t.left+v.width-l)/v.width)),{direction:_,speed:y}}function iT(e){if(e===document.scrollingElement){const{innerWidth:a,innerHeight:l}=window;return{top:0,left:0,right:a,bottom:l,width:a,height:l}}const{top:t,left:r,right:n,bottom:i}=e.getBoundingClientRect();return{top:t,left:r,right:n,bottom:i,width:e.clientWidth,height:e.clientHeight}}function J1(e){return e.reduce((t,r)=>ai(t,td(r)),jr)}function oT(e){return e.reduce((t,r)=>t+G1(r),0)}function aT(e){return e.reduce((t,r)=>t+q1(r),0)}function lT(e,t){if(t===void 0&&(t=Ti),!e)return;const{top:r,left:n,bottom:i,right:a}=t(e);K1(e)&&(i<=0||a<=0||r>=window.innerHeight||n>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}const cT=[["x",["left","right"],oT],["y",["top","bottom"],aT]];class ep{constructor(t,r){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 n=Zf(r),i=J1(n);this.rect={...t},this.width=t.width,this.height=t.height;for(const[a,l,s]of cT)for(const o of l)Object.defineProperty(this,o,{get:()=>{const c=s(n),f=i[a]-c;return this.rect[o]+f},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class po{constructor(t){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(r=>{var n;return(n=this.target)==null?void 0:n.removeEventListener(...r)})},this.target=t}add(t,r,n){var i;(i=this.target)==null||i.addEventListener(t,r,n),this.listeners.push([t,r,n])}}function uT(e){const{EventTarget:t}=lr(e);return e instanceof t?e:Li(e)}function _u(e,t){const r=Math.abs(e.x),n=Math.abs(e.y);return typeof t=="number"?Math.sqrt(r**2+n**2)>t:"x"in t&&"y"in t?r>t.x&&n>t.y:"x"in t?r>t.x:"y"in t?n>t.y:!1}var vr;(function(e){e.Click="click",e.DragStart="dragstart",e.Keydown="keydown",e.ContextMenu="contextmenu",e.Resize="resize",e.SelectionChange="selectionchange",e.VisibilityChange="visibilitychange"})(vr||(vr={}));function rv(e){e.preventDefault()}function hT(e){e.stopPropagation()}var Je;(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"})(Je||(Je={}));const Q1={start:[Je.Space,Je.Enter],cancel:[Je.Esc],end:[Je.Space,Je.Enter,Je.Tab]},dT=(e,t)=>{let{currentCoordinates:r}=t;switch(e.code){case Je.Right:return{...r,x:r.x+25};case Je.Left:return{...r,x:r.x-25};case Je.Down:return{...r,y:r.y+25};case Je.Up:return{...r,y:r.y-25}}};class Z1{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:r}}=t;this.props=t,this.listeners=new po(Li(r)),this.windowListeners=new po(lr(r)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(vr.Resize,this.handleCancel),this.windowListeners.add(vr.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(vr.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:t,onStart:r}=this.props,n=t.node.current;n&&lT(n),r(jr)}handleKeyDown(t){if(Qf(t)){const{active:r,context:n,options:i}=this.props,{keyboardCodes:a=Q1,coordinateGetter:l=dT,scrollBehavior:s="smooth"}=i,{code:o}=t;if(a.end.includes(o)){this.handleEnd(t);return}if(a.cancel.includes(o)){this.handleCancel(t);return}const{collisionRect:c}=n.current,f=c?{x:c.left,y:c.top}:jr;this.referenceCoordinates||(this.referenceCoordinates=f);const u=l(t,{active:r,context:n.current,currentCoordinates:f});if(u){const p=Wl(u,f),_={x:0,y:0},{scrollableAncestors:y}=n.current;for(const v of y){const h=t.code,{isTop:m,isRight:d,isLeft:g,isBottom:w,maxScroll:b,minScroll:x}=Y1(v),C=iT(v),S={x:Math.min(h===Je.Right?C.right-C.width/2:C.right,Math.max(h===Je.Right?C.left:C.left+C.width/2,u.x)),y:Math.min(h===Je.Down?C.bottom-C.height/2:C.bottom,Math.max(h===Je.Down?C.top:C.top+C.height/2,u.y))},k=h===Je.Right&&!d||h===Je.Left&&!g,L=h===Je.Down&&!w||h===Je.Up&&!m;if(k&&S.x!==u.x){const A=v.scrollLeft+p.x,M=h===Je.Right&&A<=b.x||h===Je.Left&&A>=x.x;if(M&&!p.y){v.scrollTo({left:A,behavior:s});return}M?_.x=v.scrollLeft-A:_.x=h===Je.Right?v.scrollLeft-b.x:v.scrollLeft-x.x,_.x&&v.scrollBy({left:-_.x,behavior:s});break}else if(L&&S.y!==u.y){const A=v.scrollTop+p.y,M=h===Je.Down&&A<=b.y||h===Je.Up&&A>=x.y;if(M&&!p.x){v.scrollTo({top:A,behavior:s});return}M?_.y=v.scrollTop-A:_.y=h===Je.Down?v.scrollTop-b.y:v.scrollTop-x.y,_.y&&v.scrollBy({top:-_.y,behavior:s});break}}this.handleMove(t,ai(Wl(u,this.referenceCoordinates),_))}}}handleMove(t,r){const{onMove:n}=this.props;t.preventDefault(),n(r)}handleEnd(t){const{onEnd:r}=this.props;t.preventDefault(),this.detach(),r()}handleCancel(t){const{onCancel:r}=this.props;t.preventDefault(),this.detach(),r()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}Z1.activators=[{eventName:"onKeyDown",handler:(e,t,r)=>{let{keyboardCodes:n=Q1,onActivation:i}=t,{active:a}=r;const{code:l}=e.nativeEvent;if(n.start.includes(l)){const s=a.activatorNode.current;return s&&e.target!==s?!1:(e.preventDefault(),i==null||i({event:e.nativeEvent}),!0)}return!1}}];function nv(e){return!!(e&&"distance"in e)}function sv(e){return!!(e&&"delay"in e)}class tp{constructor(t,r,n){var i;n===void 0&&(n=uT(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=r;const{event:a}=t,{target:l}=a;this.props=t,this.events=r,this.document=Li(l),this.documentListeners=new po(this.document),this.listeners=new po(n),this.windowListeners=new po(lr(l)),this.initialCoordinates=(i=ed(a))!=null?i:jr,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:r,bypassActivationConstraint:n}}}=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(vr.Resize,this.handleCancel),this.windowListeners.add(vr.DragStart,rv),this.windowListeners.add(vr.VisibilityChange,this.handleCancel),this.windowListeners.add(vr.ContextMenu,rv),this.documentListeners.add(vr.Keydown,this.handleKeydown),r){if(n!=null&&n({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(sv(r)){this.timeoutId=setTimeout(this.handleStart,r.delay),this.handlePending(r);return}if(nv(r)){this.handlePending(r);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,r){const{active:n,onPending:i}=this.props;i(n,t,this.initialCoordinates,r)}handleStart(){const{initialCoordinates:t}=this,{onStart:r}=this.props;t&&(this.activated=!0,this.documentListeners.add(vr.Click,hT,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(vr.SelectionChange,this.removeTextSelection),r(t))}handleMove(t){var r;const{activated:n,initialCoordinates:i,props:a}=this,{onMove:l,options:{activationConstraint:s}}=a;if(!i)return;const o=(r=ed(t))!=null?r:jr,c=Wl(i,o);if(!n&&s){if(nv(s)){if(s.tolerance!=null&&_u(c,s.tolerance))return this.handleCancel();if(_u(c,s.distance))return this.handleStart()}if(sv(s)&&_u(c,s.tolerance))return this.handleCancel();this.handlePending(s,c);return}t.cancelable&&t.preventDefault(),l(o)}handleEnd(){const{onAbort:t,onEnd:r}=this.props;this.detach(),this.activated||t(this.props.active),r()}handleCancel(){const{onAbort:t,onCancel:r}=this.props;this.detach(),this.activated||t(this.props.active),r()}handleKeydown(t){t.code===Je.Esc&&this.handleCancel()}removeTextSelection(){var t;(t=this.document.getSelection())==null||t.removeAllRanges()}}const fT={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class rp extends tp{constructor(t){const{event:r}=t,n=Li(r.target);super(t,fT,n)}}rp.activators=[{eventName:"onPointerDown",handler:(e,t)=>{let{nativeEvent:r}=e,{onActivation:n}=t;return!r.isPrimary||r.button!==0?!1:(n==null||n({event:r}),!0)}}];const pT={move:{name:"mousemove"},end:{name:"mouseup"}};var rd;(function(e){e[e.RightClick=2]="RightClick"})(rd||(rd={}));class mT extends tp{constructor(t){super(t,pT,Li(t.event.target))}}mT.activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:r}=e,{onActivation:n}=t;return r.button===rd.RightClick?!1:(n==null||n({event:r}),!0)}}];const yu={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class gT extends tp{constructor(t){super(t,yu)}static setup(){return window.addEventListener(yu.move.name,t,{capture:!1,passive:!1}),function(){window.removeEventListener(yu.move.name,t)};function t(){}}}gT.activators=[{eventName:"onTouchStart",handler:(e,t)=>{let{nativeEvent:r}=e,{onActivation:n}=t;const{touches:i}=r;return i.length>1?!1:(n==null||n({event:r}),!0)}}];var mo;(function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"})(mo||(mo={}));var Kl;(function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"})(Kl||(Kl={}));function vT(e){let{acceleration:t,activator:r=mo.Pointer,canScroll:n,draggingRect:i,enabled:a,interval:l=5,order:s=Kl.TreeOrder,pointerCoordinates:o,scrollableAncestors:c,scrollableAncestorRects:f,delta:u,threshold:p}=e;const _=yT({delta:u,disabled:!a}),[y,v]=kL(),h=E.useRef({x:0,y:0}),m=E.useRef({x:0,y:0}),d=E.useMemo(()=>{switch(r){case mo.Pointer:return o?{top:o.y,bottom:o.y,left:o.x,right:o.x}:null;case mo.DraggableRect:return i}},[r,i,o]),g=E.useRef(null),w=E.useCallback(()=>{const x=g.current;if(!x)return;const C=h.current.x*m.current.x,S=h.current.y*m.current.y;x.scrollBy(C,S)},[]),b=E.useMemo(()=>s===Kl.TreeOrder?[...c].reverse():c,[s,c]);E.useEffect(()=>{if(!a||!c.length||!d){v();return}for(const x of b){if((n==null?void 0:n(x))===!1)continue;const C=c.indexOf(x),S=f[C];if(!S)continue;const{direction:k,speed:L}=sT(x,S,d,t,p);for(const A of["x","y"])_[A][k[A]]||(L[A]=0,k[A]=0);if(L.x>0||L.y>0){v(),g.current=x,y(w,l),h.current=L,m.current=k;return}}h.current={x:0,y:0},m.current={x:0,y:0},v()},[t,w,n,v,a,l,JSON.stringify(d),JSON.stringify(_),y,c,b,f,JSON.stringify(p)])}const _T={x:{[Tt.Backward]:!1,[Tt.Forward]:!1},y:{[Tt.Backward]:!1,[Tt.Forward]:!1}};function yT(e){let{delta:t,disabled:r}=e;const n=Zh(t);return oa(i=>{if(r||!n||!i)return _T;const a={x:Math.sign(t.x-n.x),y:Math.sign(t.y-n.y)};return{x:{[Tt.Backward]:i.x[Tt.Backward]||a.x===-1,[Tt.Forward]:i.x[Tt.Forward]||a.x===1},y:{[Tt.Backward]:i.y[Tt.Backward]||a.y===-1,[Tt.Forward]:i.y[Tt.Forward]||a.y===1}}},[r,t,n])}function wT(e,t){const r=t!=null?e.get(t):void 0,n=r?r.node.current:null;return oa(i=>{var a;return t==null?null:(a=n??i)!=null?a:null},[n,t])}function ST(e,t){return E.useMemo(()=>e.reduce((r,n)=>{const{sensor:i}=n,a=i.activators.map(l=>({eventName:l.eventName,handler:t(l.handler,n)}));return[...r,...a]},[]),[e,t])}var Uo;(function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"})(Uo||(Uo={}));var nd;(function(e){e.Optimized="optimized"})(nd||(nd={}));const iv=new Map;function xT(e,t){let{dragging:r,dependencies:n,config:i}=t;const[a,l]=E.useState(null),{frequency:s,measure:o,strategy:c}=i,f=E.useRef(e),u=h(),p=$o(u),_=E.useCallback(function(m){m===void 0&&(m=[]),!p.current&&l(d=>d===null?m:d.concat(m.filter(g=>!d.includes(g))))},[p]),y=E.useRef(null),v=oa(m=>{if(u&&!r)return iv;if(!m||m===iv||f.current!==e||a!=null){const d=new Map;for(let g of e){if(!g)continue;if(a&&a.length>0&&!a.includes(g.id)&&g.rect.current){d.set(g.id,g.rect.current);continue}const w=g.node.current,b=w?new ep(o(w),w):null;g.rect.current=b,b&&d.set(g.id,b)}return d}return m},[e,a,r,u,o]);return E.useEffect(()=>{f.current=e},[e]),E.useEffect(()=>{u||_()},[r,u]),E.useEffect(()=>{a&&a.length>0&&l(null)},[JSON.stringify(a)]),E.useEffect(()=>{u||typeof s!="number"||y.current!==null||(y.current=setTimeout(()=>{_(),y.current=null},s))},[s,u,_,...n]),{droppableRects:v,measureDroppableContainers:_,measuringScheduled:a!=null};function h(){switch(c){case Uo.Always:return!1;case Uo.BeforeDragging:return r;default:return!r}}}function ew(e,t){return oa(r=>e?r||(typeof t=="function"?t(e):e):null,[t,e])}function bT(e,t){return ew(e,t)}function CT(e){let{callback:t,disabled:r}=e;const n=Jf(t),i=E.useMemo(()=>{if(r||typeof window>"u"||typeof window.MutationObserver>"u")return;const{MutationObserver:a}=window;return new a(n)},[n,r]);return E.useEffect(()=>()=>i==null?void 0:i.disconnect(),[i]),i}function xc(e){let{callback:t,disabled:r}=e;const n=Jf(t),i=E.useMemo(()=>{if(r||typeof window>"u"||typeof window.ResizeObserver>"u")return;const{ResizeObserver:a}=window;return new a(n)},[r]);return E.useEffect(()=>()=>i==null?void 0:i.disconnect(),[i]),i}function ET(e){return new ep(Ti(e),e)}function ov(e,t,r){t===void 0&&(t=ET);const[n,i]=E.useState(null);function a(){i(o=>{if(!e)return null;if(e.isConnected===!1){var c;return(c=o??r)!=null?c:null}const f=t(e);return JSON.stringify(o)===JSON.stringify(f)?o:f})}const l=CT({callback(o){if(e)for(const c of o){const{type:f,target:u}=c;if(f==="childList"&&u instanceof HTMLElement&&u.contains(e)){a();break}}}}),s=xc({callback:a});return Gr(()=>{a(),e?(s==null||s.observe(e),l==null||l.observe(document.body,{childList:!0,subtree:!0})):(s==null||s.disconnect(),l==null||l.disconnect())},[e]),n}function kT(e){const t=ew(e);return V1(e,t)}const av=[];function LT(e){const t=E.useRef(e),r=oa(n=>e?n&&n!==av&&e&&t.current&&e.parentNode===t.current.parentNode?n:Zf(e):av,[e]);return E.useEffect(()=>{t.current=e},[e]),r}function TT(e){const[t,r]=E.useState(null),n=E.useRef(e),i=E.useCallback(a=>{const l=vu(a.target);l&&r(s=>s?(s.set(l,td(l)),new Map(s)):null)},[]);return E.useEffect(()=>{const a=n.current;if(e!==a){l(a);const s=e.map(o=>{const c=vu(o);return c?(c.addEventListener("scroll",i,{passive:!0}),[c,td(c)]):null}).filter(o=>o!=null);r(s.length?new Map(s):null),n.current=e}return()=>{l(e),l(a)};function l(s){s.forEach(o=>{const c=vu(o);c==null||c.removeEventListener("scroll",i)})}},[i,e]),E.useMemo(()=>e.length?t?Array.from(t.values()).reduce((a,l)=>ai(a,l),jr):J1(e):jr,[e,t])}function lv(e,t){t===void 0&&(t=[]);const r=E.useRef(null);return E.useEffect(()=>{r.current=null},t),E.useEffect(()=>{const n=e!==jr;n&&!r.current&&(r.current=e),!n&&r.current&&(r.current=null)},[e]),r.current?Wl(e,r.current):jr}function RT(e){E.useEffect(()=>{if(!Sc)return;const t=e.map(r=>{let{sensor:n}=r;return n.setup==null?void 0:n.setup()});return()=>{for(const r of t)r==null||r()}},e.map(t=>{let{sensor:r}=t;return r}))}function DT(e,t){return E.useMemo(()=>e.reduce((r,n)=>{let{eventName:i,handler:a}=n;return r[i]=l=>{a(l,t)},r},{}),[e,t])}function tw(e){return E.useMemo(()=>e?eT(e):null,[e])}const cv=[];function MT(e,t){t===void 0&&(t=Ti);const[r]=e,n=tw(r?lr(r):null),[i,a]=E.useState(cv);function l(){a(()=>e.length?e.map(o=>X1(o)?n:new ep(t(o),o)):cv)}const s=xc({callback:l});return Gr(()=>{s==null||s.disconnect(),l(),e.forEach(o=>s==null?void 0:s.observe(o))},[e]),i}function AT(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return ia(t)?t:e}function PT(e){let{measure:t}=e;const[r,n]=E.useState(null),i=E.useCallback(c=>{for(const{target:f}of c)if(ia(f)){n(u=>{const p=t(f);return u?{...u,width:p.width,height:p.height}:p});break}},[t]),a=xc({callback:i}),l=E.useCallback(c=>{const f=AT(c);a==null||a.disconnect(),f&&(a==null||a.observe(f)),n(f?t(f):null)},[t,a]),[s,o]=Ul(l);return E.useMemo(()=>({nodeRef:s,rect:r,setRef:o}),[r,s,o])}const IT=[{sensor:rp,options:{}},{sensor:Z1,options:{}}],OT={current:{}},ol={draggable:{measure:tv},droppable:{measure:tv,strategy:Uo.WhileDragging,frequency:nd.Optimized},dragOverlay:{measure:Ti}};class go extends Map{get(t){var r;return t!=null&&(r=super.get(t))!=null?r:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(t=>{let{disabled:r}=t;return!r})}getNodeFor(t){var r,n;return(r=(n=this.get(t))==null?void 0:n.node.current)!=null?r:void 0}}const BT={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new go,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:Vl},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:ol,measureDroppableContainers:Vl,windowRect:null,measuringScheduled:!1},NT={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:Vl,draggableNodes:new Map,over:null,measureDroppableContainers:Vl},bc=E.createContext(NT),rw=E.createContext(BT);function jT(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new go}}}function FT(e,t){switch(t.type){case xt.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case xt.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 xt.DragEnd:case xt.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case xt.RegisterDroppable:{const{element:r}=t,{id:n}=r,i=new go(e.droppable.containers);return i.set(n,r),{...e,droppable:{...e.droppable,containers:i}}}case xt.SetDroppableDisabled:{const{id:r,key:n,disabled:i}=t,a=e.droppable.containers.get(r);if(!a||n!==a.key)return e;const l=new go(e.droppable.containers);return l.set(r,{...a,disabled:i}),{...e,droppable:{...e.droppable,containers:l}}}case xt.UnregisterDroppable:{const{id:r,key:n}=t,i=e.droppable.containers.get(r);if(!i||n!==i.key)return e;const a=new go(e.droppable.containers);return a.delete(r),{...e,droppable:{...e.droppable,containers:a}}}default:return e}}function HT(e){let{disabled:t}=e;const{active:r,activatorEvent:n,draggableNodes:i}=E.useContext(bc),a=Zh(n),l=Zh(r==null?void 0:r.id);return E.useEffect(()=>{if(!t&&!n&&a&&l!=null){if(!Qf(a)||document.activeElement===a.target)return;const s=i.get(l);if(!s)return;const{activatorNode:o,node:c}=s;if(!o.current&&!c.current)return;requestAnimationFrame(()=>{for(const f of[o.current,c.current]){if(!f)continue;const u=RL(f);if(u){u.focus();break}}})}},[n,t,i,l,a]),null}function $T(e,t){let{transform:r,...n}=t;return e!=null&&e.length?e.reduce((i,a)=>a({transform:i,...n}),r):r}function zT(e){return E.useMemo(()=>({draggable:{...ol.draggable,...e==null?void 0:e.draggable},droppable:{...ol.droppable,...e==null?void 0:e.droppable},dragOverlay:{...ol.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 UT(e){let{activeNode:t,measure:r,initialRect:n,config:i=!0}=e;const a=E.useRef(!1),{x:l,y:s}=typeof i=="boolean"?{x:i,y:i}:i;Gr(()=>{if(!l&&!s||!t){a.current=!1;return}if(a.current||!n)return;const c=t==null?void 0:t.node.current;if(!c||c.isConnected===!1)return;const f=r(c),u=V1(f,n);if(l||(u.x=0),s||(u.y=0),a.current=!0,Math.abs(u.x)>0||Math.abs(u.y)>0){const p=K1(c);p&&p.scrollBy({top:u.y,left:u.x})}},[t,l,s,n,r])}const nw=E.createContext({...jr,scaleX:1,scaleY:1});var Rn;(function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"})(Rn||(Rn={}));const WT=E.memo(function(t){var r,n,i,a;let{id:l,accessibility:s,autoScroll:o=!0,children:c,sensors:f=IT,collisionDetection:u=GL,measuring:p,modifiers:_,...y}=t;const v=E.useReducer(FT,void 0,jT),[h,m]=v,[d,g]=OL(),[w,b]=E.useState(Rn.Uninitialized),x=w===Rn.Initialized,{draggable:{active:C,nodes:S,translate:k},droppable:{containers:L}}=h,A=C!=null?S.get(C):null,M=E.useRef({initial:null,translated:null}),D=E.useMemo(()=>{var ue;return C!=null?{id:C,data:(ue=A==null?void 0:A.data)!=null?ue:OT,rect:M}:null},[C,A]),O=E.useRef(null),[z,F]=E.useState(null),[H,I]=E.useState(null),R=$o(y,Object.values(y)),P=aa("DndDescribedBy",l),N=E.useMemo(()=>L.getEnabled(),[L]),j=zT(p),{droppableRects:W,measureDroppableContainers:V,measuringScheduled:Z}=xT(N,{dragging:x,dependencies:[k.x,k.y],config:j.droppable}),Q=wT(S,C),$=E.useMemo(()=>H?ed(H):null,[H]),B=ne(),G=bT(Q,j.draggable.measure);UT({activeNode:C!=null?S.get(C):null,config:B.layoutShiftCompensation,initialRect:G,measure:j.draggable.measure});const U=ov(Q,j.draggable.measure,G),te=ov(Q?Q.parentElement:null),Y=E.useRef({activatorEvent:null,active:null,activeNode:Q,collisionRect:null,collisions:null,droppableRects:W,draggableNodes:S,draggingNode:null,draggingNodeRect:null,droppableContainers:L,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),_e=L.getNodeFor((r=Y.current.over)==null?void 0:r.id),fe=PT({measure:j.dragOverlay.measure}),re=(n=fe.nodeRef.current)!=null?n:Q,le=x?(i=fe.rect)!=null?i:U:null,se=!!(fe.nodeRef.current&&fe.rect),pe=kT(se?null:U),ve=tw(re?lr(re):null),ie=LT(x?_e??Q:null),oe=MT(ie),de=$T(_,{transform:{x:k.x-pe.x,y:k.y-pe.y,scaleX:1,scaleY:1},activatorEvent:H,active:D,activeNodeRect:U,containerNodeRect:te,draggingNodeRect:le,over:Y.current.over,overlayNodeRect:fe.rect,scrollableAncestors:ie,scrollableAncestorRects:oe,windowRect:ve}),ae=$?ai($,k):null,ge=TT(ie),Ee=lv(ge),Le=lv(ge,[U]),He=ai(de,Ee),je=le?YL(le,de):null,Pe=D&&je?u({active:D,collisionRect:je,droppableRects:W,droppableContainers:N,pointerCoordinates:ae}):null,Oe=WL(Pe,"id"),[Ce,Te]=E.useState(null),J=se?de:ai(de,Le),ee=qL(J,(a=Ce==null?void 0:Ce.rect)!=null?a:null,U),$e=E.useRef(null),Ne=E.useCallback((ue,ke)=>{let{sensor:De,options:ze}=ke;if(O.current==null)return;const We=S.get(O.current);if(!We)return;const Ie=ue.nativeEvent,Me=new De({active:O.current,activeNode:We,event:Ie,options:ze,context:Y,onAbort(Ue){if(!S.get(Ue))return;const{onDragAbort:Ae}=R.current,Ve={id:Ue};Ae==null||Ae(Ve),d({type:"onDragAbort",event:Ve})},onPending(Ue,Re,Ae,Ve){if(!S.get(Ue))return;const{onDragPending:$t}=R.current,_t={id:Ue,constraint:Re,initialCoordinates:Ae,offset:Ve};$t==null||$t(_t),d({type:"onDragPending",event:_t})},onStart(Ue){const Re=O.current;if(Re==null)return;const Ae=S.get(Re);if(!Ae)return;const{onDragStart:Ve}=R.current,Ye={activatorEvent:Ie,active:{id:Re,data:Ae.data,rect:M}};hn.unstable_batchedUpdates(()=>{Ve==null||Ve(Ye),b(Rn.Initializing),m({type:xt.DragStart,initialCoordinates:Ue,active:Re}),d({type:"onDragStart",event:Ye}),F($e.current),I(Ie)})},onMove(Ue){m({type:xt.DragMove,coordinates:Ue})},onEnd:et(xt.DragEnd),onCancel:et(xt.DragCancel)});$e.current=Me;function et(Ue){return async function(){const{active:Ae,collisions:Ve,over:Ye,scrollAdjustedTranslate:$t}=Y.current;let _t=null;if(Ae&&$t){const{cancelDrop:zt}=R.current;_t={activatorEvent:Ie,active:Ae,collisions:Ve,delta:$t,over:Ye},Ue===xt.DragEnd&&typeof zt=="function"&&await Promise.resolve(zt(_t))&&(Ue=xt.DragCancel)}O.current=null,hn.unstable_batchedUpdates(()=>{m({type:Ue}),b(Rn.Uninitialized),Te(null),F(null),I(null),$e.current=null;const zt=Ue===xt.DragEnd?"onDragEnd":"onDragCancel";if(_t){const It=R.current[zt];It==null||It(_t),d({type:zt,event:_t})}})}}},[S]),K=E.useCallback((ue,ke)=>(De,ze)=>{const We=De.nativeEvent,Ie=S.get(ze);if(O.current!==null||!Ie||We.dndKit||We.defaultPrevented)return;const Me={active:Ie};ue(De,ke.options,Me)===!0&&(We.dndKit={capturedBy:ke.sensor},O.current=ze,Ne(De,ke))},[S,Ne]),he=ST(f,K);RT(f),Gr(()=>{U&&w===Rn.Initializing&&b(Rn.Initialized)},[U,w]),E.useEffect(()=>{const{onDragMove:ue}=R.current,{active:ke,activatorEvent:De,collisions:ze,over:We}=Y.current;if(!ke||!De)return;const Ie={active:ke,activatorEvent:De,collisions:ze,delta:{x:He.x,y:He.y},over:We};hn.unstable_batchedUpdates(()=>{ue==null||ue(Ie),d({type:"onDragMove",event:Ie})})},[He.x,He.y]),E.useEffect(()=>{const{active:ue,activatorEvent:ke,collisions:De,droppableContainers:ze,scrollAdjustedTranslate:We}=Y.current;if(!ue||O.current==null||!ke||!We)return;const{onDragOver:Ie}=R.current,Me=ze.get(Oe),et=Me&&Me.rect.current?{id:Me.id,rect:Me.rect.current,data:Me.data,disabled:Me.disabled}:null,Ue={active:ue,activatorEvent:ke,collisions:De,delta:{x:We.x,y:We.y},over:et};hn.unstable_batchedUpdates(()=>{Te(et),Ie==null||Ie(Ue),d({type:"onDragOver",event:Ue})})},[Oe]),Gr(()=>{Y.current={activatorEvent:H,active:D,activeNode:Q,collisionRect:je,collisions:Pe,droppableRects:W,draggableNodes:S,draggingNode:re,draggingNodeRect:le,droppableContainers:L,over:Ce,scrollableAncestors:ie,scrollAdjustedTranslate:He},M.current={initial:le,translated:je}},[D,Q,Pe,je,S,re,le,W,L,Ce,ie,He]),vT({...B,delta:k,draggingRect:je,pointerCoordinates:ae,scrollableAncestors:ie,scrollableAncestorRects:oe});const X=E.useMemo(()=>({active:D,activeNode:Q,activeNodeRect:U,activatorEvent:H,collisions:Pe,containerNodeRect:te,dragOverlay:fe,draggableNodes:S,droppableContainers:L,droppableRects:W,over:Ce,measureDroppableContainers:V,scrollableAncestors:ie,scrollableAncestorRects:oe,measuringConfiguration:j,measuringScheduled:Z,windowRect:ve}),[D,Q,U,H,Pe,te,fe,S,L,W,Ce,V,ie,oe,j,Z,ve]),ye=E.useMemo(()=>({activatorEvent:H,activators:he,active:D,activeNodeRect:U,ariaDescribedById:{draggable:P},dispatch:m,draggableNodes:S,over:Ce,measureDroppableContainers:V}),[H,he,D,U,m,P,S,Ce,V]);return gt.createElement(W1.Provider,{value:g},gt.createElement(bc.Provider,{value:ye},gt.createElement(rw.Provider,{value:X},gt.createElement(nw.Provider,{value:ee},c)),gt.createElement(HT,{disabled:(s==null?void 0:s.restoreFocus)===!1})),gt.createElement(jL,{...s,hiddenTextDescribedById:P}));function ne(){const ue=(z==null?void 0:z.autoScrollEnabled)===!1,ke=typeof o=="object"?o.enabled===!1:o===!1,De=x&&!ue&&!ke;return typeof o=="object"?{...o,enabled:De}:{enabled:De}}}),VT=E.createContext(null),uv="button",KT="Draggable";function GT(e){let{id:t,data:r,disabled:n=!1,attributes:i}=e;const a=aa(KT),{activators:l,activatorEvent:s,active:o,activeNodeRect:c,ariaDescribedById:f,draggableNodes:u,over:p}=E.useContext(bc),{role:_=uv,roleDescription:y="draggable",tabIndex:v=0}=i??{},h=(o==null?void 0:o.id)===t,m=E.useContext(h?nw:VT),[d,g]=Ul(),[w,b]=Ul(),x=DT(l,t),C=$o(r);Gr(()=>(u.set(t,{id:t,key:a,node:d,activatorNode:w,data:C}),()=>{const k=u.get(t);k&&k.key===a&&u.delete(t)}),[u,t]);const S=E.useMemo(()=>({role:_,tabIndex:v,"aria-disabled":n,"aria-pressed":h&&_===uv?!0:void 0,"aria-roledescription":y,"aria-describedby":f.draggable}),[n,_,v,h,y,f.draggable]);return{active:o,activatorEvent:s,activeNodeRect:c,attributes:S,isDragging:h,listeners:n?void 0:x,node:d,over:p,setNodeRef:g,setActivatorNodeRef:b,transform:m}}function qT(){return E.useContext(rw)}const XT="Droppable",YT={timeout:25};function JT(e){let{data:t,disabled:r=!1,id:n,resizeObserverConfig:i}=e;const a=aa(XT),{active:l,dispatch:s,over:o,measureDroppableContainers:c}=E.useContext(bc),f=E.useRef({disabled:r}),u=E.useRef(!1),p=E.useRef(null),_=E.useRef(null),{disabled:y,updateMeasurementsFor:v,timeout:h}={...YT,...i},m=$o(v??n),d=E.useCallback(()=>{if(!u.current){u.current=!0;return}_.current!=null&&clearTimeout(_.current),_.current=setTimeout(()=>{c(Array.isArray(m.current)?m.current:[m.current]),_.current=null},h)},[h]),g=xc({callback:d,disabled:y||!l}),w=E.useCallback((S,k)=>{g&&(k&&(g.unobserve(k),u.current=!1),S&&g.observe(S))},[g]),[b,x]=Ul(w),C=$o(t);return E.useEffect(()=>{!g||!b.current||(g.disconnect(),u.current=!1,g.observe(b.current))},[b,g]),E.useEffect(()=>(s({type:xt.RegisterDroppable,element:{id:n,key:a,disabled:r,node:b,rect:p,data:C}}),()=>s({type:xt.UnregisterDroppable,key:a,id:n})),[n]),E.useEffect(()=>{r!==f.current.disabled&&(s({type:xt.SetDroppableDisabled,id:n,key:a,disabled:r}),f.current.disabled=r)},[n,a,r,s]),{active:l,rect:p,isOver:(o==null?void 0:o.id)===n,node:b,over:o,setNodeRef:x}}function sw(e,t,r){const n=e.slice();return n.splice(r<0?n.length+r:r,0,n.splice(t,1)[0]),n}function QT(e,t){return e.reduce((r,n,i)=>{const a=t.get(n);return a&&(r[i]=a),r},Array(e.length))}function Aa(e){return e!==null&&e>=0}function ZT(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let r=0;r<e.length;r++)if(e[r]!==t[r])return!1;return!0}function eR(e){return typeof e=="boolean"?{draggable:e,droppable:e}:e}const iw=e=>{let{rects:t,activeIndex:r,overIndex:n,index:i}=e;const a=sw(t,n,r),l=t[i],s=a[i];return!s||!l?null:{x:s.left-l.left,y:s.top-l.top,scaleX:s.width/l.width,scaleY:s.height/l.height}},Pa={scaleX:1,scaleY:1},tR=e=>{var t;let{activeIndex:r,activeNodeRect:n,index:i,rects:a,overIndex:l}=e;const s=(t=a[r])!=null?t:n;if(!s)return null;if(i===r){const c=a[l];return c?{x:0,y:r<l?c.top+c.height-(s.top+s.height):c.top-s.top,...Pa}:null}const o=rR(a,i,r);return i>r&&i<=l?{x:0,y:-s.height-o,...Pa}:i<r&&i>=l?{x:0,y:s.height+o,...Pa}:{x:0,y:0,...Pa}};function rR(e,t,r){const n=e[t],i=e[t-1],a=e[t+1];return n?r<t?i?n.top-(i.top+i.height):a?a.top-(n.top+n.height):0:a?a.top-(n.top+n.height):i?n.top-(i.top+i.height):0:0}const ow="Sortable",aw=gt.createContext({activeIndex:-1,containerId:ow,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:iw,disabled:{draggable:!1,droppable:!1}});function nR(e){let{children:t,id:r,items:n,strategy:i=iw,disabled:a=!1}=e;const{active:l,dragOverlay:s,droppableRects:o,over:c,measureDroppableContainers:f}=qT(),u=aa(ow,r),p=s.rect!==null,_=E.useMemo(()=>n.map(x=>typeof x=="object"&&"id"in x?x.id:x),[n]),y=l!=null,v=l?_.indexOf(l.id):-1,h=c?_.indexOf(c.id):-1,m=E.useRef(_),d=!ZT(_,m.current),g=h!==-1&&v===-1||d,w=eR(a);Gr(()=>{d&&y&&f(_)},[d,_,y,f]),E.useEffect(()=>{m.current=_},[_]);const b=E.useMemo(()=>({activeIndex:v,containerId:u,disabled:w,disableTransforms:g,items:_,overIndex:h,useDragOverlay:p,sortedRects:QT(_,o),strategy:i}),[v,u,w.draggable,w.droppable,g,_,h,o,p,i]);return gt.createElement(aw.Provider,{value:b},t)}const sR=e=>{let{id:t,items:r,activeIndex:n,overIndex:i}=e;return sw(r,n,i).indexOf(t)},iR=e=>{let{containerId:t,isSorting:r,wasDragging:n,index:i,items:a,newIndex:l,previousItems:s,previousContainerId:o,transition:c}=e;return!c||!n||s!==a&&i===l?!1:r?!0:l!==i&&t===o},oR={duration:200,easing:"ease"},lw="transform",aR=zo.Transition.toString({property:lw,duration:0,easing:"linear"}),lR={roleDescription:"sortable"};function cR(e){let{disabled:t,index:r,node:n,rect:i}=e;const[a,l]=E.useState(null),s=E.useRef(r);return Gr(()=>{if(!t&&r!==s.current&&n.current){const o=i.current;if(o){const c=Ti(n.current,{ignoreTransform:!0}),f={x:o.left-c.left,y:o.top-c.top,scaleX:o.width/c.width,scaleY:o.height/c.height};(f.x||f.y)&&l(f)}}r!==s.current&&(s.current=r)},[t,r,n,i]),E.useEffect(()=>{a&&l(null)},[a]),a}function uR(e){let{animateLayoutChanges:t=iR,attributes:r,disabled:n,data:i,getNewIndex:a=sR,id:l,strategy:s,resizeObserverConfig:o,transition:c=oR}=e;const{items:f,containerId:u,activeIndex:p,disabled:_,disableTransforms:y,sortedRects:v,overIndex:h,useDragOverlay:m,strategy:d}=E.useContext(aw),g=hR(n,_),w=f.indexOf(l),b=E.useMemo(()=>({sortable:{containerId:u,index:w,items:f},...i}),[u,i,w,f]),x=E.useMemo(()=>f.slice(f.indexOf(l)),[f,l]),{rect:C,node:S,isOver:k,setNodeRef:L}=JT({id:l,data:b,disabled:g.droppable,resizeObserverConfig:{updateMeasurementsFor:x,...o}}),{active:A,activatorEvent:M,activeNodeRect:D,attributes:O,setNodeRef:z,listeners:F,isDragging:H,over:I,setActivatorNodeRef:R,transform:P}=GT({id:l,data:b,attributes:{...lR,...r},disabled:g.draggable}),N=EL(L,z),j=!!A,W=j&&!y&&Aa(p)&&Aa(h),V=!m&&H,Z=V&&W?P:null,$=W?Z??(s??d)({rects:v,activeNodeRect:D,activeIndex:p,overIndex:h,index:w}):null,B=Aa(p)&&Aa(h)?a({id:l,items:f,activeIndex:p,overIndex:h}):w,G=A==null?void 0:A.id,U=E.useRef({activeId:G,items:f,newIndex:B,containerId:u}),te=f!==U.current.items,Y=t({active:A,containerId:u,isDragging:H,isSorting:j,id:l,index:w,items:f,newIndex:U.current.newIndex,previousItems:U.current.items,previousContainerId:U.current.containerId,transition:c,wasDragging:U.current.activeId!=null}),_e=cR({disabled:!Y,index:w,node:S,rect:C});return E.useEffect(()=>{j&&U.current.newIndex!==B&&(U.current.newIndex=B),u!==U.current.containerId&&(U.current.containerId=u),f!==U.current.items&&(U.current.items=f)},[j,B,u,f]),E.useEffect(()=>{if(G===U.current.activeId)return;if(G!=null&&U.current.activeId==null){U.current.activeId=G;return}const re=setTimeout(()=>{U.current.activeId=G},50);return()=>clearTimeout(re)},[G]),{active:A,activeIndex:p,attributes:O,data:b,rect:C,index:w,newIndex:B,items:f,isOver:k,isSorting:j,isDragging:H,listeners:F,node:S,overIndex:h,over:I,setNodeRef:N,setActivatorNodeRef:R,setDroppableNodeRef:L,setDraggableNodeRef:z,transform:_e??$,transition:fe()};function fe(){if(_e||te&&U.current.newIndex===w)return aR;if(!(V&&!Qf(M)||!c)&&(j||Y))return zo.Transition.toString({...c,property:lw})}}function hR(e,t){var r,n;return typeof e=="boolean"?{draggable:e,droppable:!1}:{draggable:(r=e==null?void 0:e.draggable)!=null?r:t.draggable,droppable:(n=e==null?void 0:e.droppable)!=null?n:t.droppable}}Je.Down,Je.Right,Je.Up,Je.Left;const Ia={permission:0,waiting:1,working:2,unknown:3};function vo(e){var r;const t=(r=e.agentSessionId)==null?void 0:r.trim();return t&&t.length>0?t:e.id}const dR={mode:"created",direction:"desc"};function np(e,t=dR){const{mode:r,direction:n,manualOrder:i}=t;if(r==="manual"&&i&&i.length>0){const a=new Map(i.map((l,s)=>[l,s]));return e.toSorted((l,s)=>{const o=vo(l),c=vo(s),f=a.get(o)??a.get(l.id)??1/0,u=a.get(c)??a.get(s.id)??1/0;return f===1/0&&u===1/0?Date.parse(s.createdAt)-Date.parse(l.createdAt):f-u})}return e.toSorted((a,l)=>{if(r==="status"){const c=Ia[a.status]??Ia.unknown,f=Ia[l.status]??Ia.unknown;return c!==f?c-f:Date.parse(l.lastActivity)-Date.parse(a.lastActivity)}const s=Date.parse(a.createdAt),o=Date.parse(l.createdAt);return n==="desc"?o-s:s-o})}function fR(e,t){var n,i;const r=new Map;for(const a of e){const l=(n=a.projectPath)==null?void 0:n.trim();if(l){const s=Date.parse(a.lastActivity)||0,o=r.get(l)||0;s>o&&r.set(l,s)}}for(const a of t){const l=(i=a.projectPath)==null?void 0:i.trim();if(l){const s=Date.parse(a.lastActivityAt)||0,o=r.get(l)||0;s>o&&r.set(l,s)}}return Array.from(r.keys()).toSorted((a,l)=>{const s=r.get(a)||0;return(r.get(l)||0)-s})}function pR(e,t){var n,i;const r=new Map;for(const a of e){const l=(n=a.host)==null?void 0:n.trim();if(l){const s=Date.parse(a.lastActivity)||0,o=r.get(l)||0;s>o&&r.set(l,s)}}for(const a of t){const l=(i=a.host)==null?void 0:i.trim();if(l){const s=Date.parse(a.lastActivityAt)||0,o=r.get(l)||0;s>o&&r.set(l,s)}}return Array.from(r.keys()).toSorted((a,l)=>{const s=r.get(a)||0;return(r.get(l)||0)-s})}function sp(e){const t=Date.parse(e);if(Number.isNaN(t))return"";const r=Date.now()-t,n=Math.floor(r/6e4);if(n<1)return"now";if(n<60)return`${n}m`;const i=Math.floor(n/60);return i<24?`${i}h`:`${Math.floor(i/24)}d`}function _s(e){const t=e.trim();if(!t)return null;const r=t.replace(/[\\/]+$/,"");if(!r)return null;const n=r.split(/[\\/]/);return n[n.length-1]||null}function mR(e){const t=e.map(s=>{const o=s.trim(),c=o.replace(/[\\/]+$/,""),f=c.split(/[\\/]/).filter(Boolean);return{path:s,parts:f,fallback:c||o||s}}),r=new Map;for(const s of t)r.set(s.path,1);let n=!0;for(;n;){n=!1;const s=new Map;for(const o of t){if(o.parts.length===0)continue;const c=r.get(o.path)??1,f=o.parts.slice(-c).join("/");s.set(f,(s.get(f)??0)+1)}for(const o of t){if(o.parts.length===0)continue;const c=r.get(o.path)??1,f=o.parts.slice(-c).join("/");(s.get(f)??0)>1&&c<o.parts.length&&(r.set(o.path,c+1),n=!0)}}const i=new Map,a=new Map;for(const s of t){let o=s.fallback;if(s.parts.length>0){const c=r.get(s.path)??1;o=s.parts.slice(-c).join("/")}i.set(s.path,o),a.set(o,(a.get(o)??0)+1)}const l=new Map;for(const s of t){let o=i.get(s.path)??s.fallback;(a.get(o)??0)>1&&(o=s.fallback),l.set(s.path,o)}return l}function cw(e){const t=e.trim();return!t||t.length<=6?t:`${t.slice(0,3)}…${t.slice(-3)}`}function uw(e){var r;const t=document.createElement("textarea");t.value=e,t.style.position="fixed",t.style.left="-9999px",document.body.appendChild(t),t.focus(),t.select();try{if(!document.execCommand("copy"))throw 0}catch{(r=navigator.clipboard)==null||r.writeText(e).catch(()=>{})}document.body.removeChild(t)}function gR({useSafariLayoutFallback:e,isDragging:t,dndTransform:r,generatedTransform:n}){return e&&!t&&!r||!r?n:!n||n==="none"?r:`${r} ${n}`}const vR="agentboard-session",_R=sC();function yR(e,t){return e.id===t.id&&e.name===t.name&&e.tmuxWindow===t.tmuxWindow&&e.projectPath===t.projectPath&&e.status===t.status&&e.lastActivity===t.lastActivity&&e.createdAt===t.createdAt&&e.source===t.source&&e.host===t.host&&e.remote===t.remote&&e.command===t.command&&e.agentType===t.agentType&&e.agentSessionId===t.agentSessionId&&e.agentSessionName===t.agentSessionName&&e.logFilePath===t.logFilePath&&e.isPinned===t.isPinned&&e.lastUserMessage===t.lastUserMessage}function wR(e,t){if(e.length!==t.length)return!1;const r=new Map(e.map(n=>[n.id,n]));for(const n of t){const i=r.get(n.id);if(!i||!yR(i,n))return!1}return!0}const Ke=df()(ff((e,t)=>({sessions:[],agentSessions:{active:[],inactive:[]},hostStatuses:[],exitingSessions:new Map,selectedSessionId:null,hasLoaded:!1,connectionStatus:"connecting",connectionError:null,remoteAllowControl:!1,remoteAllowAttach:!1,hostLabel:null,setSessions:r=>{var f;const n=t(),i=n.selectedSessionId,a=n.sessions,l=n.exitingSessions;if(n.hasLoaded&&wR(a,r))return;const s=new Set(r.map(u=>u.id)),o=a.filter(u=>!s.has(u.id)&&!l.has(u.id));let c=i;if(i!==null&&!r.some(u=>u.id===i)){const{sessionSortMode:u,sessionSortDirection:p}=me.getState();c=((f=np(r,{mode:u,direction:p})[0])==null?void 0:f.id)??null}if(o.length>0){const u=new Map(l);for(const p of o)u.set(p.id,p);e({sessions:r,hasLoaded:!0,selectedSessionId:c,exitingSessions:u})}else e({sessions:r,hasLoaded:!0,selectedSessionId:c})},setAgentSessions:(r,n)=>e({agentSessions:{active:r,inactive:n}}),setHostStatuses:r=>e({hostStatuses:r}),updateSession:r=>e(n=>({sessions:n.sessions.map(i=>i.id===r.id?r:i)})),setSelectedSessionId:r=>e({selectedSessionId:r}),setConnectionStatus:r=>e({connectionStatus:r}),setConnectionError:r=>e({connectionError:r}),setRemoteAllowControl:r=>e({remoteAllowControl:r}),setRemoteAllowAttach:r=>e({remoteAllowAttach:r}),setHostLabel:r=>e({hostLabel:r}),markSessionExiting:r=>{const n=t().sessions.find(i=>i.id===r);if(n){const i=new Map(t().exitingSessions);i.set(r,n),e({exitingSessions:i})}},clearExitingSession:r=>{const n=new Map(t().exitingSessions);n.delete(r),e({exitingSessions:n})}}),{name:vR,storage:gc(()=>_R),partialize:e=>({selectedSessionId:e.selectedSessionId})}));function hv(e,t,r=!1){const[n,i]=E.useState(!1),a=E.useRef(e),l=E.useRef(!1);return E.useEffect(()=>{const o=a.current;if(r?e>o:e!==o){l.current=!0;const f=setTimeout(()=>{l.current&&(i(!0),l.current=!1)},t);return a.current=e,()=>clearTimeout(f)}a.current=e},[e,t,r]),[n,()=>i(!1)]}function SR(e,t,r,n){const i=E.useRef(new Map);E.useEffect(()=>{const a=new Set(e.map(l=>l.id));for(const l of t.keys())if(a.has(l)){const s=i.current.get(l);s&&(clearTimeout(s),i.current.delete(l)),r(l)}else if(!i.current.has(l)){const s=setTimeout(()=>{i.current.delete(l),r(l)},n+100);i.current.set(l,s)}},[e,t,r,n]),E.useEffect(()=>()=>{for(const a of i.current.values())clearTimeout(a);i.current.clear()},[])}function xR({className:e}){return T.jsx("svg",{viewBox:"0 0 92.2 92.2",fill:"currentColor",className:e,"aria-label":"Anthropic",children:T.jsx("path",{d:"M66.5,0H52.4l25.7,65h14.1L66.5,0z M25.7,0L0,65h14.4l5.3-13.6h26.9L51.8,65h14.4L40.5,0C40.5,0,25.7,0,25.7,0z M24.3,39.3l8.8-22.8l8.8,22.8H24.3z",transform:"translate(0, 13.6)"})})}function bR({className:e}){return T.jsx("svg",{viewBox:"-1 -1 26 26",fill:"currentColor",className:e,"aria-label":"OpenAI",children:T.jsx("path",{d:"M22.2819 9.8211a5.9847 5.9847 0 0 0-.5157-4.9108 6.0462 6.0462 0 0 0-6.5098-2.9A6.0651 6.0651 0 0 0 4.9807 4.1818a5.9847 5.9847 0 0 0-3.9977 2.9 6.0462 6.0462 0 0 0 .7427 7.0966 5.98 5.98 0 0 0 .511 4.9107 6.051 6.051 0 0 0 6.5146 2.9001A5.9847 5.9847 0 0 0 13.2599 24a6.0557 6.0557 0 0 0 5.7718-4.2058 5.9894 5.9894 0 0 0 3.9977-2.9001 6.0557 6.0557 0 0 0-.7475-7.0729zm-9.022 12.6081a4.4755 4.4755 0 0 1-2.8764-1.0408l.1419-.0804 4.7783-2.7582a.7948.7948 0 0 0 .3927-.6813v-6.7369l2.02 1.1686a.071.071 0 0 1 .038.052v5.5826a4.504 4.504 0 0 1-4.4945 4.4944zm-9.6607-4.1254a4.4708 4.4708 0 0 1-.5346-3.0137l.142.0852 4.783 2.7582a.7712.7712 0 0 0 .7806 0l5.8428-3.3685v2.3324a.0804.0804 0 0 1-.0332.0615L9.74 19.9502a4.4992 4.4992 0 0 1-6.1408-1.6464zM2.3408 7.8956a4.485 4.485 0 0 1 2.3655-1.9728V11.6a.7664.7664 0 0 0 .3879.6765l5.8144 3.3543-2.0201 1.1685a.0757.0757 0 0 1-.071 0l-4.8303-2.7865A4.504 4.504 0 0 1 2.3408 7.872zm16.5963 3.8558L13.1038 8.364 15.1192 7.2a.0757.0757 0 0 1 .071 0l4.8303 2.7913a4.4944 4.4944 0 0 1-.6765 8.1042v-5.6772a.79.79 0 0 0-.407-.667zm2.0107-3.0231l-.142-.0852-4.7735-2.7818a.7759.7759 0 0 0-.7854 0L9.409 9.2297V6.8974a.0662.0662 0 0 1 .0284-.0615l4.8303-2.7866a4.4992 4.4992 0 0 1 6.6802 4.66zM8.3065 12.863l-2.02-1.1638a.0804.0804 0 0 1-.038-.0567V6.0742a4.4992 4.4992 0 0 1 7.3757-3.4537l-.142.0805L8.704 5.459a.7948.7948 0 0 0-.3927.6813zm1.0976-2.3654l2.602-1.4998 2.6069 1.4998v2.9994l-2.5974 1.4997-2.6067-1.4997Z"})})}function CR({className:e}){return T.jsx("svg",{viewBox:"0 0 588.42 568.88",fill:"currentColor",className:e,"aria-label":"Pi",children:T.jsx("path",{d:"M 10.499686,177.03840 L 31.174931,178.56990 C 52.615925,154.32116 61.039171,82.595924 187.38789,96.634671 C 182.79339,403.95560 48.021426,436.37234 56.444675,499.41907 C 59.507674,535.15406 87.840417,557.10556 118.47041,558.38181 C 215.21014,555.06356 210.87089,424.63084 240.99038,95.868921 L 365.80760,95.868921 C 359.17110,211.75239 341.04836,327.63586 339.00636,441.22208 C 340.53786,516.77606 386.48285,557.10556 446.97708,557.61606 C 546.52456,560.93431 577.92030,444.79558 577.92030,395.27709 L 556.47931,395.27710 C 554.43731,436.11709 534.78306,465.47083 492.92207,467.25758 C 378.82535,468.78908 441.61683,266.63113 442.38258,97.400421 L 577.92030,98.166171 L 577.15455,11.636437 C 13.807491,8.9075799 85.312284,-2.1366151 10.499686,177.03840 z"})})}const ER=[["claude",xR],["codex",bR],["pi",CR]];function Cc({agentType:e,command:t,className:r=""}){const n=(e||(t==null?void 0:t.split(" ")[0])||"").toLowerCase();for(const[i,a]of ER)if(n.startsWith(i))return T.jsx(a,{className:r});return T.jsx(FC,{className:r})}const kR=360;function LR(e){let t=0;for(let r=0;r<e.length;r++){const n=e.charCodeAt(r);t=(t<<5)-t+n,t=t&t}return Math.abs(t)}function hw(e){return{"--badge-hue":`${LR(e)%kR}`}}function dw({name:e,fullPath:t,className:r=""}){const n=hw(e);return T.jsx("span",{className:`project-badge inline-flex items-center rounded-full px-1.5 py-0.5 text-[10px] font-medium leading-none ${r}`,style:n,title:t,children:e})}const TR=E.memo(function({session:t,showSessionIdPrefix:r,showProjectName:n,showLastUserMessage:i,onResume:a,onPreview:l,onSetPinned:s}){const o=sp(t.lastActivityAt),c=_s(t.projectPath),f=t.displayName||c||t.sessionId.slice(0,8),u=n&&!!c,p=i&&!!t.lastUserMessage,_=r?cw(t.sessionId):"",y=E.useRef(null),[v,h]=E.useState(null);E.useEffect(()=>{if(!v)return;const d=w=>{y.current&&!y.current.contains(w.target)&&h(null)},g=w=>{w.key==="Escape"&&h(null)};return document.addEventListener("mousedown",d),document.addEventListener("touchstart",d),document.addEventListener("keydown",g),()=>{document.removeEventListener("mousedown",d),document.removeEventListener("touchstart",d),document.removeEventListener("keydown",g)}},[v]);const m=d=>{d.preventDefault(),d.stopPropagation(),h({x:d.clientX,y:d.clientY})};return T.jsxs("div",{className:"group relative cursor-pointer px-3 py-2 hover:bg-hover",role:"button",tabIndex:0,title:"Click to preview",onClick:()=>l(t),onKeyDown:d=>{(d.key==="Enter"||d.key===" ")&&(d.preventDefault(),l(t))},onContextMenu:m,children:[T.jsx("button",{type:"button",className:"absolute right-3 top-1/2 -translate-y-1/2 text-xs text-muted opacity-0 hover:text-primary group-hover:opacity-100",title:"Resume directly",onClick:d=>{d.stopPropagation(),a(t.sessionId)},children:"▶"}),T.jsxs("div",{className:"flex flex-col gap-0.5 pl-2.5 group-hover:pr-4",children:[T.jsxs("div",{className:"flex items-center gap-2",children:[T.jsx(Cc,{agentType:t.agentType,className:"h-3.5 w-3.5 shrink-0 text-muted"}),T.jsx("span",{className:"min-w-0 flex-1 truncate text-sm font-medium text-primary",children:f}),t.lastResumeError&&T.jsx(fC,{className:"h-3 w-3 shrink-0 text-amber-500","aria-label":"Resume failed",title:`Last resume failed: ${t.lastResumeError}`}),t.isPinned&&T.jsx(Ol,{className:"h-3 w-3 shrink-0 text-muted","aria-label":"Pinned",title:"Pinned - will auto-resume on server restart"}),_&&T.jsx("span",{className:"shrink-0 text-[11px] font-mono text-muted",title:t.sessionId,children:_}),T.jsx("span",{className:"ml-1 w-8 shrink-0 text-right text-xs tabular-nums text-muted",children:o})]}),(u||p)&&T.jsxs("div",{className:"flex flex-wrap items-center gap-1 pl-[1.375rem]",children:[u&&T.jsx(dw,{name:c,fullPath:t.projectPath}),p&&T.jsxs("span",{className:"truncate text-xs italic text-muted",children:['"',t.lastUserMessage.length>200?t.lastUserMessage.slice(0,200)+"…":t.lastUserMessage,'"']})]})]}),v&&T.jsxs("div",{ref:y,className:"fixed z-50 min-w-[160px] rounded-md border border-border bg-elevated shadow-lg py-1",style:{left:v.x,top:v.y},role:"menu",children:[s&&T.jsxs("button",{onClick:d=>{d.stopPropagation(),h(null),s(t.sessionId,!t.isPinned)},className:"w-full px-3 py-2 text-left text-sm text-secondary hover:bg-hover hover:text-primary flex items-center gap-2",role:"menuitem",title:t.isPinned?"Remove from auto-resume list":"Auto-resume on server restart",children:[T.jsx(Ol,{width:14,height:14}),t.isPinned?"Unpin":"Pin"]}),t.logFilePath&&T.jsxs("button",{onClick:d=>{d.stopPropagation(),h(null),t.logFilePath&&uw(t.logFilePath)},className:"w-full px-3 py-2 text-left text-sm text-secondary hover:bg-hover hover:text-primary flex items-center gap-2",role:"menuitem",title:t.logFilePath,children:[T.jsx(iy,{width:14,height:14}),"Copy Log Path"]})]})]})});function RR({name:e,className:t=""}){const r=hw(`host:${e}`);return T.jsx("span",{className:`inline-flex items-center rounded-full px-1.5 py-0.5 text-[10px] font-medium uppercase leading-none tracking-wide ${t}`,style:r,title:e,children:e})}function DR({hosts:e,selectedHosts:t,onSelect:r,statuses:n=[]}){const[i,a]=E.useState(!1),l=E.useId(),s=E.useRef(null),o=E.useMemo(()=>new Set(t),[t]),c=E.useMemo(()=>new Map(n.map(_=>[_.host,_])),[n]),f=E.useMemo(()=>t.length===0?"All Hosts":t.join(", "),[t]),u=E.useMemo(()=>t.length===0?"All Hosts":t.length===1?t[0]:`${t.length} hosts`,[t]);E.useEffect(()=>{if(!i||typeof document>"u"||!document.addEventListener||!document.removeEventListener)return;const _=v=>{var m;const h=v.target;h&&((m=s.current)!=null&&m.contains(h))||a(!1)},y=v=>{v.key==="Escape"&&a(!1)};return document.addEventListener("mousedown",_),document.addEventListener("touchstart",_,{passive:!0}),document.addEventListener("keydown",y),()=>{document.removeEventListener("mousedown",_),document.removeEventListener("touchstart",_),document.removeEventListener("keydown",y)}},[i]);const p=_=>{const y=new Set(o);y.has(_)?y.delete(_):y.add(_);const v=e.filter(h=>y.has(h));r(v)};return T.jsxs("div",{ref:s,className:"relative",children:[T.jsxs("button",{type:"button","aria-haspopup":"menu","aria-expanded":i,"aria-controls":l,"aria-label":"Filter by host",onClick:()=>a(_=>!_),className:"flex h-6 max-w-[9rem] items-center gap-1 rounded border border-border bg-base px-2 text-[11px] text-primary hover:bg-hover focus:border-accent focus:outline-none",title:f,children:[T.jsx("span",{className:"truncate",children:u}),T.jsx(pf,{className:"h-3 w-3 shrink-0 text-muted"})]}),i&&T.jsxs("div",{id:l,role:"menu",className:"absolute right-0 z-20 mt-1 w-48 rounded border border-border bg-surface p-2 text-xs shadow-lg",children:[T.jsxs("label",{role:"menuitemcheckbox","aria-checked":t.length===0,className:"flex cursor-pointer items-center gap-2 rounded px-2 py-1.5 text-primary hover:bg-hover",children:[T.jsx("input",{type:"checkbox",checked:t.length===0,onChange:()=>r([]),className:"h-3.5 w-3.5 accent-approval"}),T.jsx("span",{children:"All Hosts"})]}),T.jsx("div",{className:"my-2 h-px bg-border"}),e.length===0?T.jsx("div",{className:"px-2 py-1 text-muted",children:"No hosts"}):T.jsx("div",{className:"max-h-48 overflow-y-auto pr-1",children:e.map(_=>{const y=c.get(_),v=y?!y.ok:!1;return T.jsxs("label",{role:"menuitemcheckbox","aria-checked":o.has(_),className:"flex cursor-pointer items-center gap-2 rounded px-2 py-1.5 text-primary hover:bg-hover",title:y!=null&&y.error?`${_}: ${y.error}`:_,children:[T.jsx("input",{type:"checkbox",checked:o.has(_),onChange:()=>p(_),className:"h-3.5 w-3.5 accent-approval"}),T.jsx("span",{className:"truncate",children:_}),v&&T.jsx("span",{className:"ml-auto text-[10px] uppercase text-danger",children:"offline"})]},_)})})]})]})}function MR({projects:e,selectedProjects:t,onSelect:r,hasHiddenPermissions:n}){const[i,a]=E.useState(!1),l=E.useId(),s=E.useRef(null),o=E.useMemo(()=>mR(e),[e]),c=E.useMemo(()=>new Set(t),[t]),f=n&&t.length>0,u=E.useMemo(()=>t.length===0?"All Projects":t.map(y=>o.get(y)??_s(y)??y).join(", "),[o,t]),p=E.useMemo(()=>{if(t.length===0)return"All Projects";if(t.length===1){const y=t[0];return o.get(y)??_s(y)??y}return`${t.length} projects`},[o,t]);E.useEffect(()=>{if(!i||typeof document>"u"||!document.addEventListener||!document.removeEventListener)return;const y=h=>{var d;const m=h.target;m&&((d=s.current)!=null&&d.contains(m))||a(!1)},v=h=>{h.key==="Escape"&&a(!1)};return document.addEventListener("mousedown",y),document.addEventListener("touchstart",y,{passive:!0}),document.addEventListener("keydown",v),()=>{document.removeEventListener("mousedown",y),document.removeEventListener("touchstart",y),document.removeEventListener("keydown",v)}},[i]);const _=y=>{const v=new Set(c);v.has(y)?v.delete(y):v.add(y);const h=e.filter(m=>v.has(m));r(h)};return T.jsxs("div",{ref:s,className:"relative",children:[T.jsxs("button",{type:"button","aria-haspopup":"menu","aria-expanded":i,"aria-controls":l,"aria-label":"Filter by project",onClick:()=>a(y=>!y),className:"flex h-6 max-w-[11rem] items-center gap-1 rounded border border-border bg-base px-2 text-[11px] text-primary hover:bg-hover focus:border-accent focus:outline-none",title:u,children:[T.jsx("span",{className:"truncate",children:p}),T.jsx(pf,{className:"h-3 w-3 shrink-0 text-muted"})]}),i&&T.jsxs("div",{id:l,role:"menu",className:"absolute right-0 z-20 mt-1 w-60 rounded border border-border bg-surface p-2 text-xs shadow-lg",children:[T.jsxs("label",{className:"flex cursor-pointer items-center gap-2 rounded px-2 py-1.5 text-primary hover:bg-hover",children:[T.jsx("input",{type:"checkbox",checked:t.length===0,onChange:()=>r([]),className:"h-3.5 w-3.5 accent-approval"}),T.jsx("span",{children:"All Projects"})]}),T.jsx("div",{className:"my-2 h-px bg-border"}),e.length===0?T.jsx("div",{className:"px-2 py-1 text-muted",children:"No projects"}):T.jsx("div",{className:"max-h-48 overflow-y-auto pr-1",children:e.map(y=>{const v=o.get(y)??_s(y)??y;return T.jsxs("label",{className:"flex cursor-pointer items-center gap-2 rounded px-2 py-1.5 text-primary hover:bg-hover",title:y,children:[T.jsx("input",{type:"checkbox",checked:c.has(y),onChange:()=>_(y),className:"h-3.5 w-3.5 accent-approval"}),T.jsx("span",{className:"truncate",children:v})]},y)})})]}),f&&T.jsx("button",{type:"button",className:"absolute -right-1 -top-1 h-2 w-2 rounded-full bg-approval pulse-approval ring-2 ring-elevated",title:"Hidden sessions need attention","aria-label":"Clear project filters",onClick:y=>{y.stopPropagation(),r([])},children:T.jsx("span",{className:"sr-only",children:"Clear project filters"})})]})}const Gl=new Set(["tool_result","custom_tool_call_output"]),AR=new Set(["text","input_text","output_text"]);function qr(e){return!e||typeof e!="object"?null:e}function At(e){return typeof e=="string"?e:null}function Wo(e){return e==="user"?"user":e==="assistant"?"assistant":e==="system"||e==="developer"?"system":e==="tool"?"tool":"other"}function PR(e){const t=At(e.type)??"",r=qr(e.payload),n=At(r==null?void 0:r.type)??"",i=At(e.source)??At(r==null?void 0:r.source)??"",a=At(e.agent)??"";return i.toLowerCase()==="pi"||a.toLowerCase()==="pi"?"pi":t==="response_item"||t==="event_msg"?"codex":t==="tool_use"||t==="result"||t==="user"||t==="assistant"||t==="system"?"claude":n==="user_message"||n==="assistant_message"?"codex":"unknown"}function IR(e){const t=qr(e.payload),r=At(t==null?void 0:t.type);return{family:PR(e),rawType:At(e.type)??"unknown",...r?{payloadType:r}:{}}}function bt(e){if(!e)return[];if(typeof e=="string")return e.trim()?[e]:[];if(Array.isArray(e)){const r=[];for(const n of e){if(typeof n=="string"){n.trim()&&r.push(n);continue}const i=qr(n);if(!i)continue;const a=At(i.type);if(a&&Gl.has(a)||a&&!AR.has(a))continue;const l=At(i.text);l&&l.trim()&&r.push(l)}return r}const t=qr(e);if(t){const r=At(t.type);if(r&&Gl.has(r))return[];const n=At(t.text);return n&&n.trim()?[n]:[...bt(t.content),...bt(t.message)]}return[]}function OR(e,t){if(e.type!=="response_item")return[];const r=qr(e.payload);if(!r||r.type!=="message")return[];const n=Wo(r.role);return bt(r.content).map(i=>({kind:"message",role:n,text:i,source:t}))}function BR(e,t){if(e.type!=="event_msg")return[];const r=qr(e.payload);if(!r)return[];const n=At(r.type);let i=null;if(n==="user_message"?i="user":n==="assistant_message"?i="assistant":n==="system_message"?i="system":n==="message"&&(i=Wo(r.role)),!i||!["user","assistant","system"].includes(i))return[];const a=Array.from(new Set([...bt(r.message),...bt(r.content),...bt(r.text)]));return a.length===0?[]:a.map(l=>({kind:"message",role:i,text:l,source:t}))}function NR(e,t){const r=Wo(e.type),n=qr(e.message);if(n){const a=Wo(n.role??e.type);return[...bt(n.content),...bt(n.text),...bt(n.message)].map(s=>({kind:"message",role:a,text:s,source:t}))}return["user","assistant","system"].includes(r)?[...bt(e.content),...bt(e.text)].map(a=>({kind:"message",role:r,text:a,source:t})):[]}function jR(e,t){const r=Wo(e.role);return["user","assistant","system"].includes(r)?[...bt(e.content),...bt(e.message),...bt(e.text)].map(i=>({kind:"message",role:r,text:i,source:t})):[]}function FR(e,t){const r=At(e.type),n=At(e.event);return r!=="tool_use"&&n!=="tool_use"?[]:[{kind:"tool_call",role:"assistant",text:`[Tool: ${At(e.name)??"tool"}]`,source:t}]}function HR(e,t){if(e.type!=="result")return[];const r=At(e.result);return!r||!r.trim()?[]:[{kind:"result",role:"system",text:r,source:t}]}function $R(e,t){const r=qr(e.payload),n=[...bt(e.message),...bt(e.content),...bt(e.text),...bt(r==null?void 0:r.message),...bt(r==null?void 0:r.content)];return n.length===0?[]:n.map(i=>({kind:"unknown",role:"other",text:i,source:t}))}function zR(e,t){const r=At(e.type),n=qr(e.payload),i=At(n==null?void 0:n.type);return r&&Gl.has(r)||i&&Gl.has(i)?[{kind:"tool_result",role:"tool",text:"",source:t}]:[]}function UR(e){const t=qr(e);if(!t)return[];const r=IR(t),n=[...OR(t,r),...BR(t,r),...NR(t,r),...FR(t,r),...HR(t,r),...zR(t,r)];if(n.length>0)return n;const i=jR(t,r);return i.length>0?i:$R(t,r)}function WR(e){const t=e.trim();if(!t)return null;try{const r=JSON.parse(t);return{parsed:!0,events:UR(r),raw:r}}catch{return{parsed:!1,events:[{kind:"unknown",role:"other",text:t,source:{family:"unknown",rawType:"raw_text"}}],raw:e}}}function VR(e){return e==="user"?"user":e==="assistant"?"assistant":e==="system"?"system":"other"}function KR(e){const t=WR(e);if(!t)return[];const r=t.events.map(n=>({type:VR(n.role),content:n.text.trim(),raw:e})).filter(n=>n.content.length>0);return r.length>0?r:!t.parsed&&e.trim()?[{type:"other",content:e.trim(),raw:e}]:[]}function GR({session:e,onClose:t,onResume:r}){const[n,i]=E.useState(!0),[a,l]=E.useState(null),[s,o]=E.useState(null),[c,f]=E.useState(!1),u=E.useRef(null),p=E.useRef(null);E.useEffect(()=>{(async()=>{try{const m=await fetch(`/api/session-preview/${e.sessionId}`);if(!m.ok){const g=await m.json();throw new Error(g.error||"Failed to load preview")}const d=await m.json();o(d)}catch(m){l(m instanceof Error?m.message:"Failed to load preview")}finally{i(!1)}})()},[e.sessionId]),E.useEffect(()=>{u.current&&s&&(u.current.scrollTop=u.current.scrollHeight)},[s,c]),E.useEffect(()=>{const h=m=>{m.key==="Escape"?(m.stopPropagation(),t()):m.key==="Enter"&&!n&&!a&&(m.preventDefault(),r(e.sessionId))};return window.addEventListener("keydown",h),()=>window.removeEventListener("keydown",h)},[t,r,e.sessionId,n,a]),E.useEffect(()=>{var h;(h=p.current)==null||h.focus()},[]);const _=e.displayName||_s(e.projectPath)||e.sessionId.slice(0,8),y=sp(e.lastActivityAt),v=(s==null?void 0:s.lines.flatMap(KR).slice(-30))??[];return T.jsx("div",{role:"dialog","aria-modal":"true","aria-labelledby":"preview-title",className:"fixed inset-0 z-50 flex items-center justify-center bg-black/60 p-4",onClick:h=>{h.target===h.currentTarget&&t()},children:T.jsxs("div",{ref:p,tabIndex:-1,className:"flex max-h-[80vh] w-full max-w-2xl flex-col border border-border bg-elevated",children:[T.jsxs("div",{className:"flex items-center gap-3 border-b border-border px-4 py-3",children:[T.jsx(Cc,{agentType:e.agentType,className:"h-5 w-5 shrink-0 text-muted"}),T.jsxs("div",{className:"min-w-0 flex-1",children:[T.jsx("h2",{id:"preview-title",className:"truncate text-sm font-semibold text-primary",children:_}),T.jsxs("p",{className:"truncate text-xs text-muted",title:e.projectPath,children:[_s(e.projectPath)," · ",y]})]}),T.jsx("button",{type:"button",onClick:()=>f(h=>!h),className:`btn text-xs ${c?"btn-primary":""}`,children:c?"Parsed":"Raw"})]}),T.jsxs("div",{ref:u,className:"flex-1 overflow-y-auto p-4 font-mono text-xs",children:[n&&T.jsx("div",{className:"flex items-center justify-center py-8 text-muted",children:"Loading preview..."}),a&&T.jsx("div",{className:"flex items-center justify-center py-8 text-danger",children:a}),s&&!c&&T.jsx("div",{className:"space-y-2",children:v.length===0?T.jsx("div",{className:"py-8 text-center text-muted",children:"No readable content found. Try raw view."}):v.map((h,m)=>T.jsx("div",{className:`rounded px-2 py-1 ${h.type==="user"?"bg-blue-500/10 text-blue-400":h.type==="assistant"?"bg-emerald-500/10 text-emerald-400":h.type==="system"?"bg-yellow-500/10 text-yellow-400":"text-muted"}`,children:T.jsx("span",{className:"whitespace-pre-wrap break-words",children:h.content.length>500?`${h.content.slice(0,500)}...`:h.content})},m))}),s&&c&&T.jsx("div",{className:"space-y-1",children:s.lines.slice(-50).map((h,m)=>T.jsx("div",{className:"whitespace-pre-wrap break-all text-muted",children:h||" "},m))})]}),T.jsxs("div",{className:"flex items-center justify-end gap-2 border-t border-border px-4 py-3",children:[T.jsx("button",{type:"button",onClick:t,className:"btn",children:"Cancel"}),T.jsx("button",{type:"button",onClick:()=>r(e.sessionId),disabled:n||!!a,className:"btn btn-primary",children:"Resume"})]})]})})}const dv={working:"bg-green-500/20 text-green-600",waiting:"bg-zinc-500/20 text-zinc-400",permission:"bg-amber-500/20 text-amber-600",unknown:"bg-zinc-500/20 text-zinc-400"};function qR(){const[,e]=E.useState(0);E.useEffect(()=>{const t=setInterval(()=>e(r=>r+1),3e4);return()=>clearInterval(t)},[])}function fw({sessions:e,inactiveSessions:t=[],selectedSessionId:r,loading:n,error:i,onSelect:a,onRename:l,onResume:s,onKill:o,onDuplicate:c,onSetPinned:f}){qR();const u=E.useMemo(()=>typeof navigator>"u"?!1:/^((?!chrome|android).)*safari/i.test(navigator.userAgent),[]),[p,_]=E.useState(null),y=me(K=>K.inactiveSessionsExpanded),v=me(K=>K.setInactiveSessionsExpanded),[h,m]=E.useState(null),[d,g]=E.useState(20),w=$1(),b=u&&!w;E.useEffect(()=>{y||g(20)},[y]);const x=200,[C,S]=hv(e.length,x),[k,L]=hv(t.length,x,!0),A=E.useRef(new Set(e.map(K=>K.id))),M=E.useRef(new Set(t.map(K=>K.sessionId))),[D,O]=E.useState(new Set);E.useEffect(()=>{var ye;const K=new Set(e.map(ne=>ne.id)),he=new Set(t.map(ne=>ne.sessionId)),X=new Set;for(const ne of K)A.current.has(ne)||X.add(ne);for(const ne of e){const ue=(ye=ne.agentSessionId)==null?void 0:ye.trim();ue&&M.current.has(ue)&&!he.has(ue)&&X.add(ne.id)}A.current=K,M.current=he,X.size>0&&O(X)},[e,t]),E.useEffect(()=>{if(D.size===0)return;const K=setTimeout(()=>O(new Set),500);return()=>clearTimeout(K)},[D]);const z=me(K=>K.shortcutModifier),F=ii(ea(z)),H=me(K=>K.sessionSortMode),I=me(K=>K.setSessionSortMode),R=me(K=>K.sessionSortDirection),P=me(K=>K.manualSessionOrder),N=me(K=>K.setManualSessionOrder),j=me(K=>K.showProjectName),W=me(K=>K.showLastUserMessage),V=me(K=>K.showSessionIdPrefix),Z=me(K=>K.projectFilters),Q=me(K=>K.setProjectFilters),$=me(K=>K.hostFilters),B=me(K=>K.setHostFilters),G=Ke(K=>K.exitingSessions),U=Ke(K=>K.clearExitingSession),te=Ke(K=>K.hostStatuses),Y=Ke(K=>K.remoteAllowControl);SR(e,G,U,x),E.useEffect(()=>{if(P.length===0)return;const K=new Set;for(const X of e)K.add(vo(X)),K.add(X.id);for(const X of t)K.add(X.sessionId);const he=P.filter(X=>K.has(X));he.length!==P.length&&N(he)},[e,t,P,N]);const fe=E.useMemo(()=>np(e,{mode:H,direction:R,manualOrder:P}),[e,H,R,P]),re=E.useMemo(()=>fR(e,t),[e,t]),le=E.useMemo(()=>{const K=pR(e,t),he=te.map(ne=>ne.host),X=new Set,ye=[];for(const ne of he)!ne||X.has(ne)||(X.add(ne),ye.push(ne));for(const ne of K)!ne||X.has(ne)||(X.add(ne),ye.push(ne));return ye},[e,t,te]),se=E.useMemo(()=>le.length>1,[le]),pe=E.useMemo(()=>{let K=fe;return Z.length>0&&(K=K.filter(he=>Z.includes(he.projectPath))),$.length>0&&(K=K.filter(he=>$.includes(he.host??""))),K},[fe,Z,$]),ve=E.useMemo(()=>{const K=Z.length===0?"all-projects":Z.join("|"),he=$.length===0?"all-hosts":$.join("|");return`${K}::${he}`},[Z,$]),ie=E.useRef(new Set(pe.map(K=>K.id))),[oe,de]=E.useState(new Set);E.useEffect(()=>{const K=new Set(pe.map(X=>X.id)),he=new Set;for(const X of K)ie.current.has(X)||D.has(X)||he.add(X);ie.current=K,he.size>0&&de(he)},[pe,D]),E.useEffect(()=>{if(oe.size===0)return;const K=setTimeout(()=>de(new Set),500);return()=>clearTimeout(K)},[oe]);const ae=E.useMemo(()=>{let K=t;return Z.length>0&&(K=K.filter(he=>Z.includes(he.projectPath))),$.length>0&&(K=K.filter(he=>$.includes(he.host??""))),K},[t,Z,$]),ge=E.useMemo(()=>{if(Z.length===0)return 0;const K=new Set(Z);return e.filter(he=>!K.has(he.projectPath)&&he.status==="permission").length},[e,Z]);E.useEffect(()=>{if(Z.length===0||re.length===0)return;const K=new Set(re),he=Z.filter(X=>K.has(X));he.length!==Z.length&&Q(he)},[Z,re,Q]),E.useEffect(()=>{if($.length===0||le.length===0)return;const K=new Set(le),he=$.filter(X=>K.has(X));he.length!==$.length&&B(he)},[$,le,B]);const Ee=HL(FL(rp,{activationConstraint:{distance:8}})),[Le,He]=E.useState(null),[je,Pe]=E.useState(null),[Oe,Ce]=E.useState(!1),Te=E.useCallback(K=>{He(K.active.id),Ce(!0)},[]),J=E.useCallback(K=>{var he;Pe((he=K.over)==null?void 0:he.id)},[]),ee=E.useCallback(K=>{const{active:he,over:X}=K;if(He(null),Pe(null),!X||he.id===X.id){setTimeout(()=>Ce(!1),100);return}const ye=pe.findIndex(Me=>Me.id===he.id),ne=pe.findIndex(Me=>Me.id===X.id);if(ye===-1||ne===-1){setTimeout(()=>Ce(!1),100);return}const ue=pe.map(Me=>vo(Me)),[ke]=ue.splice(ye,1);ue.splice(ne,0,ke);const De=fe.map(Me=>vo(Me)),ze=new Set(ue);let We=0;const Ie=De.map(Me=>{if(!ze.has(Me))return Me;const et=ue[We];return We+=1,et});H!=="manual"&&I("manual"),N(Ie),setTimeout(()=>Ce(!1),100)},[pe,fe,H,I,N]),$e=E.useCallback(()=>{He(null),Pe(null),setTimeout(()=>Ce(!1),100)},[]);E.useEffect(()=>{if(!Le&&!je)return;const K=new Set(pe.map(X=>X.id));let he=!1;Le&&!K.has(Le)&&(He(null),he=!0),je&&!K.has(je)&&(Pe(null),he=!0),he&&Ce(!1)},[pe,Le,je]);const Ne=(K,he)=>{l(K,he),_(null)};return T.jsxs("aside",{className:"flex min-h-0 flex-1 flex-col border-r border-border bg-elevated",children:[i&&T.jsx("div",{className:"shrink-0 border-b border-danger/30 bg-danger/10 px-3 py-2 text-xs text-danger",children:i}),T.jsxs("div",{className:"min-h-0 flex-1 overflow-y-auto",children:[T.jsxs("div",{className:"sticky top-0 z-10 flex h-10 items-center justify-between border-b border-border bg-elevated px-3",children:[T.jsx("span",{className:"text-xs font-medium uppercase tracking-wider text-muted",children:"Sessions"}),T.jsxs("div",{className:"flex items-center gap-4",children:[se&&T.jsx(DR,{hosts:le,selectedHosts:$,onSelect:B,statuses:te}),T.jsx(MR,{projects:re,selectedProjects:Z,onSelect:Q,hasHiddenPermissions:ge>0}),T.jsx(Qh.span,{className:"w-8 text-right text-xs text-muted",animate:C&&!w?{scale:[1,1.3,1]}:{},transition:{duration:.3},onAnimationComplete:S,children:pe.length})]})]}),n?T.jsx("div",{className:"space-y-1 p-2",children:[0,1,2].map(K=>T.jsx("div",{className:"h-14 animate-pulse rounded bg-surface"},K))}):pe.length===0?T.jsx("div",{className:"px-3 py-6 text-center text-xs text-muted",children:"No sessions"}):T.jsx(WT,{sensors:Ee,collisionDetection:VL,onDragStart:Te,onDragOver:J,onDragEnd:ee,onDragCancel:$e,children:T.jsx(nR,{items:pe.map(K=>K.id),strategy:tR,children:T.jsx("div",{children:T.jsx(q5,{initial:!1,mode:b?"sync":"popLayout",children:pe.map((K,he)=>{const X=D.has(K.id),ye=oe.has(K.id),ne=K.remote===!0,ue=K.source==="managed",ke=!ne||Y&&ue,De=Le?pe.findIndex(Me=>Me.id===Le):-1,We=je===K.id&&Le!==K.id?De>he?"above":"below":null,Ie=X||ye;return T.jsx(pw,{session:K,isNew:Ie,exitDuration:x,prefersReducedMotion:w,useSafariLayoutFallback:b,layoutAnimationsDisabled:Oe,isSelected:K.id===r,isEditing:K.id===p,showSessionIdPrefix:V,showProjectName:j,showLastUserMessage:W,showHostInfo:se,dropIndicator:We,onSelect:()=>a(K.id),onStartEdit:ke?()=>_(K.id):void 0,onCancelEdit:()=>_(null),onRename:Me=>Ne(K.id,Me),onKill:o&&ke?()=>o(K.id):void 0,onDuplicate:c&&ke?()=>c(K.id):void 0,onSetPinned:f&&K.agentSessionId?Me=>f(K.agentSessionId.trim(),Me):void 0},K.id)})})},ve)})}),ae.length>0&&T.jsxs("div",{className:"border-t border-border",children:[T.jsxs("button",{type:"button",onClick:()=>v(!y),className:"flex w-full items-center justify-between px-3 py-2 text-left text-xs font-medium uppercase tracking-wider text-muted hover:text-primary",children:[T.jsxs("span",{className:"flex items-center gap-2",children:[y?T.jsx(pf,{className:"h-4 w-4"}):T.jsx(gC,{className:"h-4 w-4"}),"Inactive Sessions"]}),T.jsx(Qh.span,{className:"w-8 text-right text-xs",animate:k&&!w?{scale:[1,1.3,1]}:{},transition:{duration:.3},onAnimationComplete:L,children:ae.length})]}),y&&T.jsxs("div",{className:"py-1",children:[ae.slice(0,d).map(K=>T.jsx(TR,{session:K,showSessionIdPrefix:V,showProjectName:j,showLastUserMessage:W,onResume:he=>s==null?void 0:s(he),onPreview:m,onSetPinned:f},K.sessionId)),ae.length>d&&T.jsxs("button",{type:"button",onClick:()=>g(K=>K+20),className:"w-full px-3 py-2 text-center text-xs text-muted hover:text-primary hover:bg-hover",children:["Show more (",ae.length-d," remaining)"]})]})]})]}),T.jsx("div",{className:"hidden shrink-0 border-t border-border px-3 py-2 md:block",children:T.jsxs("div",{className:"flex flex-wrap gap-x-3 gap-y-0.5 text-[10px] text-muted",children:[T.jsxs("span",{children:[F,"[ ] nav"]}),T.jsxs("span",{children:[F,"N new"]}),T.jsxs("span",{children:[F,"X kill"]})]})}),h&&T.jsx(GR,{session:h,onClose:()=>m(null),onResume:K=>{m(null),s==null||s(K)}})]})}const pw=E.forwardRef(function({session:t,isNew:r,exitDuration:n,prefersReducedMotion:i,useSafariLayoutFallback:a,layoutAnimationsDisabled:l,isSelected:s,isEditing:o,showSessionIdPrefix:c,showProjectName:f,showLastUserMessage:u,showHostInfo:p,dropIndicator:_,onSelect:y,onStartEdit:v,onCancelEdit:h,onRename:m,onKill:d,onDuplicate:g,onSetPinned:w},b){const{attributes:x,listeners:C,setNodeRef:S,transform:k,transition:L,isDragging:A}=uR({id:t.id,animateLayoutChanges:({isSorting:F,wasDragging:H})=>F||H}),M=zo.Transform.toString(k),O={...!!(i&&M)?{transform:M,transition:L}:{},zIndex:A?10:void 0,opacity:A?.9:void 0},z=E.useCallback(F=>{S(F),typeof b=="function"?b(F):b&&(b.current=F)},[S,b]);return T.jsxs(Qh.div,{ref:z,style:{...O,overflow:"hidden"},className:"relative",layout:!i&&!A&&!l&&!r?!a:!1,transformTemplate:(F,H)=>gR({useSafariLayoutFallback:a,isDragging:A,dndTransform:M,generatedTransform:H}),initial:i||!r?!1:a?{opacity:0}:{opacity:0,scale:.97},animate:i?{opacity:1}:r?a?{opacity:1}:{opacity:1,scale:[1.02,.99,1]}:{opacity:1,scale:1},exit:i?{opacity:0}:a?{opacity:0,height:0}:{opacity:0,height:0,scale:.97},transition:i?{duration:0}:a?{opacity:{duration:n/1e3},height:{duration:n/1e3,ease:"easeOut"}}:{layout:{type:"spring",stiffness:500,damping:35},opacity:{duration:n/1e3},scale:{duration:n/1e3,ease:[.34,1.56,.64,1]},height:{duration:n/1e3,ease:"easeOut"}},...x,...C,children:[_==="above"&&T.jsx("div",{className:"absolute -top-px left-3 right-3 h-0.5 border-t-2 border-dashed border-accent"}),T.jsx(XR,{session:t,isSelected:s,isEditing:o,showSessionIdPrefix:c,showProjectName:f,showLastUserMessage:u,showHostInfo:p,isDragging:A,onSelect:y,onStartEdit:v,onCancelEdit:h,onRename:m,onKill:d,onDuplicate:g,onSetPinned:w}),_==="below"&&T.jsx("div",{className:"absolute -bottom-px left-3 right-3 h-0.5 border-t-2 border-dashed border-accent"})]})});pw.displayName="SortableSessionItem";function XR({session:e,isSelected:t,isEditing:r,showSessionIdPrefix:n,showProjectName:i,showLastUserMessage:a,showHostInfo:l,isDragging:s=!1,onSelect:o,onStartEdit:c,onCancelEdit:f,onRename:u,onKill:p,onDuplicate:_,onSetPinned:y}){var Q,$,B,G;const v=sp(e.lastActivity),h=E.useRef(null),m=E.useRef(null),d=((Q=e.agentSessionName)==null?void 0:Q.trim())||(($=e.name)==null?void 0:$.trim())||e.id,[g,w]=E.useState(d),b=E.useRef(null),[x,C]=E.useState(null),S=_s(e.projectPath),k=(B=e.host)==null?void 0:B.trim(),L=e.status==="permission",A=(G=e.agentSessionId)==null?void 0:G.trim(),M=n&&A?cw(A):"",D=i&&!!S,O=l&&!!k,z=a&&!!e.lastUserMessage,F=E.useRef(e.status),[H,I]=E.useState(!1);E.useEffect(()=>{const U=F.current,te=e.status;U==="working"&&te==="waiting"?I(!0):F.current=te},[e.status]);const R=()=>{I(!1),F.current=e.status};E.useEffect(()=>{r&&h.current&&(h.current.focus(),h.current.select())},[r]),E.useEffect(()=>{w(d)},[d]);const P=()=>{const U=g.trim();U&&U!==d?u(U):f()},N=U=>{U.key==="Enter"?(U.preventDefault(),P()):U.key==="Escape"&&(U.preventDefault(),w(d),f())},j=E.useRef(null),W=U=>{if(s)return;const te=U.touches[0];j.current={x:te.clientX,y:te.clientY},b.current=setTimeout(()=>{j.current&&C(j.current)},500)},V=()=>{b.current&&(clearTimeout(b.current),b.current=null)};E.useEffect(()=>{if(!x)return;const U=Y=>{m.current&&!m.current.contains(Y.target)&&C(null)},te=Y=>{Y.key==="Escape"&&C(null)};return document.addEventListener("mousedown",U),document.addEventListener("touchstart",U),document.addEventListener("keydown",te),()=>{document.removeEventListener("mousedown",U),document.removeEventListener("touchstart",U),document.removeEventListener("keydown",te)}},[x]);const Z=U=>{U.preventDefault(),U.stopPropagation(),C({x:U.clientX,y:U.clientY})};return T.jsxs("div",{className:`session-row group cursor-pointer select-none px-3 py-2 ${t?"selected":""} ${s?"cursor-grabbing shadow-lg ring-1 ring-accent/30 bg-elevated":"cursor-grab"}`,role:"button",tabIndex:0,"data-testid":"session-card","data-session-id":e.id,onClick:s?void 0:o,onKeyDown:U=>{(U.key==="Enter"||U.key===" ")&&o()},onContextMenu:Z,onTouchStart:W,onTouchEnd:V,onTouchCancel:V,children:[T.jsxs("div",{className:"flex flex-col gap-0.5 pl-0.5",children:[T.jsxs("div",{className:"flex items-center gap-2",children:[T.jsx(Cc,{agentType:e.agentType,command:e.command,className:"h-3.5 w-3.5 shrink-0 text-muted"}),r?T.jsx("input",{ref:h,type:"text",value:g,onChange:U=>w(U.target.value),onBlur:P,onKeyDown:N,onClick:U=>U.stopPropagation(),className:"min-w-0 flex-1 rounded border border-border bg-surface px-1.5 py-0.5 text-sm font-medium text-primary outline-none focus:border-accent"}):T.jsx("span",{className:"min-w-0 flex-1 truncate text-sm font-medium text-primary",children:d}),e.isPinned&&T.jsx(Ol,{className:"h-3 w-3 shrink-0 text-primary","aria-label":"Pinned",title:"Pinned - will auto-resume on server restart"}),M&&T.jsx("span",{className:"shrink-0 text-[11px] font-mono text-muted",title:A,children:M}),L?T.jsx("span",{className:`ml-1 flex shrink-0 items-center justify-center rounded-full px-1.5 py-0.5 ${dv[e.status]} pulse-approval`,onAnimationEnd:R,children:T.jsx(LC,{className:"h-3 w-3","aria-label":"Needs input"})}):T.jsx("span",{className:`ml-1 shrink-0 rounded-full px-1.5 py-0.5 text-right text-xs tabular-nums ${dv[e.status]}${H?" pulse-complete":""}`,onAnimationEnd:R,children:v})]}),(D||O||z)&&T.jsxs("div",{className:"flex flex-wrap items-center gap-1 pl-[1.375rem]",children:[O&&T.jsx(RR,{name:k}),D&&T.jsx(dw,{name:S,fullPath:e.projectPath}),z&&T.jsxs("span",{className:"line-clamp-2 text-xs italic text-muted",children:['"',e.lastUserMessage.length>200?e.lastUserMessage.slice(0,200)+"…":e.lastUserMessage,'"']})]})]}),x&&T.jsxs("div",{ref:m,className:"fixed z-50 min-w-[160px] rounded-md border border-border bg-elevated shadow-lg py-1",style:{left:x.x,top:x.y},role:"menu",children:[c&&T.jsxs("button",{onClick:U=>{U.stopPropagation(),C(null),c()},className:"w-full px-3 py-2 text-left text-sm text-secondary hover:bg-hover hover:text-primary flex items-center gap-2",role:"menuitem",children:[T.jsx(sy,{width:14,height:14}),"Rename"]}),_&&T.jsxs("button",{onClick:U=>{U.stopPropagation(),C(null),_()},className:"w-full px-3 py-2 text-left text-sm text-secondary hover:bg-hover hover:text-primary flex items-center gap-2",role:"menuitem",title:"Create a copy in a new tmux window",children:[T.jsx(ny,{width:14,height:14}),"Duplicate"]}),y&&T.jsxs("button",{onClick:U=>{U.stopPropagation(),C(null),y(!e.isPinned)},className:"w-full px-3 py-2 text-left text-sm text-secondary hover:bg-hover hover:text-primary flex items-center gap-2",role:"menuitem",title:e.isPinned?"Remove from auto-resume list":"Auto-resume on server restart",children:[T.jsx(Ol,{width:14,height:14}),e.isPinned?"Unpin":"Pin"]}),e.logFilePath&&T.jsxs("button",{onClick:U=>{U.stopPropagation(),C(null),e.logFilePath&&uw(e.logFilePath)},className:"w-full px-3 py-2 text-left text-sm text-secondary hover:bg-hover hover:text-primary flex items-center gap-2",role:"menuitem",title:e.logFilePath,children:[T.jsx(iy,{width:14,height:14}),"Copy Log Path"]}),p&&T.jsxs(T.Fragment,{children:[T.jsx("div",{className:"my-1 border-t border-border"}),T.jsxs("button",{onClick:U=>{U.stopPropagation(),C(null),p()},className:"w-full px-3 py-2 text-left text-sm text-danger hover:bg-danger/10 flex items-center gap-2",role:"menuitem",children:[T.jsx(Dh,{width:14,height:14}),"Kill Session"]})]})]})]})}const sd={debug:0,info:1,warn:2,error:3};let mw="info";function YR(e){const t=e.toLowerCase();t in sd&&(mw=t)}function qe(e,t,r="debug"){if(!(sd[r]<sd[mw]))try{fetch("/api/client-log",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({event:e,data:t,level:r})}).catch(()=>{})}catch{}}var gw={exports:{}};(function(e,t){(function(r,n){e.exports=n()})(globalThis,()=>(()=>{var r={4567:function(l,s,o){var c=this&&this.__decorate||function(d,g,w,b){var x,C=arguments.length,S=C<3?g:b===null?b=Object.getOwnPropertyDescriptor(g,w):b;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")S=Reflect.decorate(d,g,w,b);else for(var k=d.length-1;k>=0;k--)(x=d[k])&&(S=(C<3?x(S):C>3?x(g,w,S):x(g,w))||S);return C>3&&S&&Object.defineProperty(g,w,S),S},f=this&&this.__param||function(d,g){return function(w,b){g(w,b,d)}};Object.defineProperty(s,"__esModule",{value:!0}),s.AccessibilityManager=void 0;const u=o(9042),p=o(9924),_=o(844),y=o(4725),v=o(2585),h=o(3656);let m=s.AccessibilityManager=class extends _.Disposable{constructor(d,g,w,b){super(),this._terminal=d,this._coreBrowserService=w,this._renderService=b,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 x=0;x<this._terminal.rows;x++)this._rowElements[x]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[x]);if(this._topBoundaryFocusListener=x=>this._handleBoundaryFocus(x,0),this._bottomBoundaryFocusListener=x=>this._handleBoundaryFocus(x,1),this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions(),this._accessibilityContainer.appendChild(this._rowContainer),this._liveRegion=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 p.TimeBasedDebouncer(this._renderRows.bind(this))),!this._terminal.element)throw new Error("Cannot enable accessibility before Terminal.open");this._terminal.element.insertAdjacentElement("afterbegin",this._accessibilityContainer),this.register(this._terminal.onResize(x=>this._handleResize(x.rows))),this.register(this._terminal.onRender(x=>this._refreshRows(x.start,x.end))),this.register(this._terminal.onScroll(()=>this._refreshRows())),this.register(this._terminal.onA11yChar(x=>this._handleChar(x))),this.register(this._terminal.onLineFeed(()=>this._handleChar(`
|
|
52
|
+
`},NL={onDragStart(e){let{active:t}=e;return"Picked up draggable item "+t.id+"."},onDragOver(e){let{active:t,over:r}=e;return r?"Draggable item "+t.id+" was moved over droppable area "+r.id+".":"Draggable item "+t.id+" is no longer over a droppable area."},onDragEnd(e){let{active:t,over:r}=e;return r?"Draggable item "+t.id+" was dropped over droppable area "+r.id:"Draggable item "+t.id+" was dropped."},onDragCancel(e){let{active:t}=e;return"Dragging was cancelled. Draggable item "+t.id+" was dropped."}};function jL(e){let{announcements:t=NL,container:r,hiddenTextDescribedById:n,screenReaderInstructions:i=BL}=e;const{announce:a,announcement:l}=PL(),s=aa("DndLiveRegion"),[o,c]=E.useState(!1);if(E.useEffect(()=>{c(!0)},[]),IL(E.useMemo(()=>({onDragStart(u){let{active:p}=u;a(t.onDragStart({active:p}))},onDragMove(u){let{active:p,over:_}=u;t.onDragMove&&a(t.onDragMove({active:p,over:_}))},onDragOver(u){let{active:p,over:_}=u;a(t.onDragOver({active:p,over:_}))},onDragEnd(u){let{active:p,over:_}=u;a(t.onDragEnd({active:p,over:_}))},onDragCancel(u){let{active:p,over:_}=u;a(t.onDragCancel({active:p,over:_}))}}),[a,t])),!o)return null;const f=gt.createElement(gt.Fragment,null,gt.createElement(ML,{id:n,value:i.draggable}),gt.createElement(AL,{id:s,announcement:l}));return r?hn.createPortal(f,r):f}var xt;(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"})(xt||(xt={}));function Vl(){}function FL(e,t){return E.useMemo(()=>({sensor:e,options:t??{}}),[e,t])}function HL(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return E.useMemo(()=>[...t].filter(n=>n!=null),[...t])}const jr=Object.freeze({x:0,y:0});function $L(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function zL(e,t){let{data:{value:r}}=e,{data:{value:n}}=t;return r-n}function UL(e,t){let{data:{value:r}}=e,{data:{value:n}}=t;return n-r}function WL(e,t){if(!e||e.length===0)return null;const[r]=e;return r[t]}function ev(e,t,r){return t===void 0&&(t=e.left),r===void 0&&(r=e.top),{x:t+e.width*.5,y:r+e.height*.5}}const VL=e=>{let{collisionRect:t,droppableRects:r,droppableContainers:n}=e;const i=ev(t,t.left,t.top),a=[];for(const l of n){const{id:s}=l,o=r.get(s);if(o){const c=$L(ev(o),i);a.push({id:s,data:{droppableContainer:l,value:c}})}}return a.sort(zL)};function KL(e,t){const r=Math.max(t.top,e.top),n=Math.max(t.left,e.left),i=Math.min(t.left+t.width,e.left+e.width),a=Math.min(t.top+t.height,e.top+e.height),l=i-n,s=a-r;if(n<i&&r<a){const o=t.width*t.height,c=e.width*e.height,f=l*s,u=f/(o+c-f);return Number(u.toFixed(4))}return 0}const GL=e=>{let{collisionRect:t,droppableRects:r,droppableContainers:n}=e;const i=[];for(const a of n){const{id:l}=a,s=r.get(l);if(s){const o=KL(s,t);o>0&&i.push({id:l,data:{droppableContainer:a,value:o}})}}return i.sort(UL)};function qL(e,t,r){return{...e,scaleX:t&&r?t.width/r.width:1,scaleY:t&&r?t.height/r.height:1}}function V1(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:jr}function XL(e){return function(r){for(var n=arguments.length,i=new Array(n>1?n-1:0),a=1;a<n;a++)i[a-1]=arguments[a];return i.reduce((l,s)=>({...l,top:l.top+e*s.y,bottom:l.bottom+e*s.y,left:l.left+e*s.x,right:l.right+e*s.x}),{...r})}}const YL=XL(1);function JL(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 QL(e,t,r){const n=JL(t);if(!n)return e;const{scaleX:i,scaleY:a,x:l,y:s}=n,o=e.left-l-(1-i)*parseFloat(r),c=e.top-s-(1-a)*parseFloat(r.slice(r.indexOf(" ")+1)),f=i?e.width/i:e.width,u=a?e.height/a:e.height;return{width:f,height:u,top:c,right:o+f,bottom:c+u,left:o}}const ZL={ignoreTransform:!1};function Ti(e,t){t===void 0&&(t=ZL);let r=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:c,transformOrigin:f}=lr(e).getComputedStyle(e);c&&(r=QL(r,c,f))}const{top:n,left:i,width:a,height:l,bottom:s,right:o}=r;return{top:n,left:i,width:a,height:l,bottom:s,right:o}}function tv(e){return Ti(e,{ignoreTransform:!0})}function eT(e){const t=e.innerWidth,r=e.innerHeight;return{top:0,left:0,right:t,bottom:r,width:t,height:r}}function tT(e,t){return t===void 0&&(t=lr(e).getComputedStyle(e)),t.position==="fixed"}function rT(e,t){t===void 0&&(t=lr(e).getComputedStyle(e));const r=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(i=>{const a=t[i];return typeof a=="string"?r.test(a):!1})}function Zf(e,t){const r=[];function n(i){if(t!=null&&r.length>=t||!i)return r;if(Yf(i)&&i.scrollingElement!=null&&!r.includes(i.scrollingElement))return r.push(i.scrollingElement),r;if(!ia(i)||z1(i)||r.includes(i))return r;const a=lr(e).getComputedStyle(i);return i!==e&&rT(i,a)&&r.push(i),tT(i,a)?r:n(i.parentNode)}return e?n(e):r}function K1(e){const[t]=Zf(e,1);return t??null}function vu(e){return!Sc||!e?null:ki(e)?e:Xf(e)?Yf(e)||e===Li(e).scrollingElement?window:ia(e)?e:null:null}function G1(e){return ki(e)?e.scrollX:e.scrollLeft}function q1(e){return ki(e)?e.scrollY:e.scrollTop}function td(e){return{x:G1(e),y:q1(e)}}var Tt;(function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"})(Tt||(Tt={}));function X1(e){return!Sc||!e?!1:e===document.scrollingElement}function Y1(e){const t={x:0,y:0},r=X1(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},n={x:e.scrollWidth-r.width,y:e.scrollHeight-r.height},i=e.scrollTop<=t.y,a=e.scrollLeft<=t.x,l=e.scrollTop>=n.y,s=e.scrollLeft>=n.x;return{isTop:i,isLeft:a,isBottom:l,isRight:s,maxScroll:n,minScroll:t}}const nT={x:.2,y:.2};function sT(e,t,r,n,i){let{top:a,left:l,right:s,bottom:o}=r;n===void 0&&(n=10),i===void 0&&(i=nT);const{isTop:c,isBottom:f,isLeft:u,isRight:p}=Y1(e),_={x:0,y:0},y={x:0,y:0},v={height:t.height*i.y,width:t.width*i.x};return!c&&a<=t.top+v.height?(_.y=Tt.Backward,y.y=n*Math.abs((t.top+v.height-a)/v.height)):!f&&o>=t.bottom-v.height&&(_.y=Tt.Forward,y.y=n*Math.abs((t.bottom-v.height-o)/v.height)),!p&&s>=t.right-v.width?(_.x=Tt.Forward,y.x=n*Math.abs((t.right-v.width-s)/v.width)):!u&&l<=t.left+v.width&&(_.x=Tt.Backward,y.x=n*Math.abs((t.left+v.width-l)/v.width)),{direction:_,speed:y}}function iT(e){if(e===document.scrollingElement){const{innerWidth:a,innerHeight:l}=window;return{top:0,left:0,right:a,bottom:l,width:a,height:l}}const{top:t,left:r,right:n,bottom:i}=e.getBoundingClientRect();return{top:t,left:r,right:n,bottom:i,width:e.clientWidth,height:e.clientHeight}}function J1(e){return e.reduce((t,r)=>ai(t,td(r)),jr)}function oT(e){return e.reduce((t,r)=>t+G1(r),0)}function aT(e){return e.reduce((t,r)=>t+q1(r),0)}function lT(e,t){if(t===void 0&&(t=Ti),!e)return;const{top:r,left:n,bottom:i,right:a}=t(e);K1(e)&&(i<=0||a<=0||r>=window.innerHeight||n>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}const cT=[["x",["left","right"],oT],["y",["top","bottom"],aT]];class ep{constructor(t,r){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 n=Zf(r),i=J1(n);this.rect={...t},this.width=t.width,this.height=t.height;for(const[a,l,s]of cT)for(const o of l)Object.defineProperty(this,o,{get:()=>{const c=s(n),f=i[a]-c;return this.rect[o]+f},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class po{constructor(t){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(r=>{var n;return(n=this.target)==null?void 0:n.removeEventListener(...r)})},this.target=t}add(t,r,n){var i;(i=this.target)==null||i.addEventListener(t,r,n),this.listeners.push([t,r,n])}}function uT(e){const{EventTarget:t}=lr(e);return e instanceof t?e:Li(e)}function _u(e,t){const r=Math.abs(e.x),n=Math.abs(e.y);return typeof t=="number"?Math.sqrt(r**2+n**2)>t:"x"in t&&"y"in t?r>t.x&&n>t.y:"x"in t?r>t.x:"y"in t?n>t.y:!1}var vr;(function(e){e.Click="click",e.DragStart="dragstart",e.Keydown="keydown",e.ContextMenu="contextmenu",e.Resize="resize",e.SelectionChange="selectionchange",e.VisibilityChange="visibilitychange"})(vr||(vr={}));function rv(e){e.preventDefault()}function hT(e){e.stopPropagation()}var Ye;(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"})(Ye||(Ye={}));const Q1={start:[Ye.Space,Ye.Enter],cancel:[Ye.Esc],end:[Ye.Space,Ye.Enter,Ye.Tab]},dT=(e,t)=>{let{currentCoordinates:r}=t;switch(e.code){case Ye.Right:return{...r,x:r.x+25};case Ye.Left:return{...r,x:r.x-25};case Ye.Down:return{...r,y:r.y+25};case Ye.Up:return{...r,y:r.y-25}}};class Z1{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:r}}=t;this.props=t,this.listeners=new po(Li(r)),this.windowListeners=new po(lr(r)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(vr.Resize,this.handleCancel),this.windowListeners.add(vr.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(vr.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:t,onStart:r}=this.props,n=t.node.current;n&&lT(n),r(jr)}handleKeyDown(t){if(Qf(t)){const{active:r,context:n,options:i}=this.props,{keyboardCodes:a=Q1,coordinateGetter:l=dT,scrollBehavior:s="smooth"}=i,{code:o}=t;if(a.end.includes(o)){this.handleEnd(t);return}if(a.cancel.includes(o)){this.handleCancel(t);return}const{collisionRect:c}=n.current,f=c?{x:c.left,y:c.top}:jr;this.referenceCoordinates||(this.referenceCoordinates=f);const u=l(t,{active:r,context:n.current,currentCoordinates:f});if(u){const p=Wl(u,f),_={x:0,y:0},{scrollableAncestors:y}=n.current;for(const v of y){const h=t.code,{isTop:m,isRight:d,isLeft:g,isBottom:w,maxScroll:b,minScroll:x}=Y1(v),C=iT(v),S={x:Math.min(h===Ye.Right?C.right-C.width/2:C.right,Math.max(h===Ye.Right?C.left:C.left+C.width/2,u.x)),y:Math.min(h===Ye.Down?C.bottom-C.height/2:C.bottom,Math.max(h===Ye.Down?C.top:C.top+C.height/2,u.y))},k=h===Ye.Right&&!d||h===Ye.Left&&!g,L=h===Ye.Down&&!w||h===Ye.Up&&!m;if(k&&S.x!==u.x){const A=v.scrollLeft+p.x,M=h===Ye.Right&&A<=b.x||h===Ye.Left&&A>=x.x;if(M&&!p.y){v.scrollTo({left:A,behavior:s});return}M?_.x=v.scrollLeft-A:_.x=h===Ye.Right?v.scrollLeft-b.x:v.scrollLeft-x.x,_.x&&v.scrollBy({left:-_.x,behavior:s});break}else if(L&&S.y!==u.y){const A=v.scrollTop+p.y,M=h===Ye.Down&&A<=b.y||h===Ye.Up&&A>=x.y;if(M&&!p.x){v.scrollTo({top:A,behavior:s});return}M?_.y=v.scrollTop-A:_.y=h===Ye.Down?v.scrollTop-b.y:v.scrollTop-x.y,_.y&&v.scrollBy({top:-_.y,behavior:s});break}}this.handleMove(t,ai(Wl(u,this.referenceCoordinates),_))}}}handleMove(t,r){const{onMove:n}=this.props;t.preventDefault(),n(r)}handleEnd(t){const{onEnd:r}=this.props;t.preventDefault(),this.detach(),r()}handleCancel(t){const{onCancel:r}=this.props;t.preventDefault(),this.detach(),r()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}Z1.activators=[{eventName:"onKeyDown",handler:(e,t,r)=>{let{keyboardCodes:n=Q1,onActivation:i}=t,{active:a}=r;const{code:l}=e.nativeEvent;if(n.start.includes(l)){const s=a.activatorNode.current;return s&&e.target!==s?!1:(e.preventDefault(),i==null||i({event:e.nativeEvent}),!0)}return!1}}];function nv(e){return!!(e&&"distance"in e)}function sv(e){return!!(e&&"delay"in e)}class tp{constructor(t,r,n){var i;n===void 0&&(n=uT(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=r;const{event:a}=t,{target:l}=a;this.props=t,this.events=r,this.document=Li(l),this.documentListeners=new po(this.document),this.listeners=new po(n),this.windowListeners=new po(lr(l)),this.initialCoordinates=(i=ed(a))!=null?i:jr,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:r,bypassActivationConstraint:n}}}=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(vr.Resize,this.handleCancel),this.windowListeners.add(vr.DragStart,rv),this.windowListeners.add(vr.VisibilityChange,this.handleCancel),this.windowListeners.add(vr.ContextMenu,rv),this.documentListeners.add(vr.Keydown,this.handleKeydown),r){if(n!=null&&n({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(sv(r)){this.timeoutId=setTimeout(this.handleStart,r.delay),this.handlePending(r);return}if(nv(r)){this.handlePending(r);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,r){const{active:n,onPending:i}=this.props;i(n,t,this.initialCoordinates,r)}handleStart(){const{initialCoordinates:t}=this,{onStart:r}=this.props;t&&(this.activated=!0,this.documentListeners.add(vr.Click,hT,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(vr.SelectionChange,this.removeTextSelection),r(t))}handleMove(t){var r;const{activated:n,initialCoordinates:i,props:a}=this,{onMove:l,options:{activationConstraint:s}}=a;if(!i)return;const o=(r=ed(t))!=null?r:jr,c=Wl(i,o);if(!n&&s){if(nv(s)){if(s.tolerance!=null&&_u(c,s.tolerance))return this.handleCancel();if(_u(c,s.distance))return this.handleStart()}if(sv(s)&&_u(c,s.tolerance))return this.handleCancel();this.handlePending(s,c);return}t.cancelable&&t.preventDefault(),l(o)}handleEnd(){const{onAbort:t,onEnd:r}=this.props;this.detach(),this.activated||t(this.props.active),r()}handleCancel(){const{onAbort:t,onCancel:r}=this.props;this.detach(),this.activated||t(this.props.active),r()}handleKeydown(t){t.code===Ye.Esc&&this.handleCancel()}removeTextSelection(){var t;(t=this.document.getSelection())==null||t.removeAllRanges()}}const fT={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class rp extends tp{constructor(t){const{event:r}=t,n=Li(r.target);super(t,fT,n)}}rp.activators=[{eventName:"onPointerDown",handler:(e,t)=>{let{nativeEvent:r}=e,{onActivation:n}=t;return!r.isPrimary||r.button!==0?!1:(n==null||n({event:r}),!0)}}];const pT={move:{name:"mousemove"},end:{name:"mouseup"}};var rd;(function(e){e[e.RightClick=2]="RightClick"})(rd||(rd={}));class mT extends tp{constructor(t){super(t,pT,Li(t.event.target))}}mT.activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:r}=e,{onActivation:n}=t;return r.button===rd.RightClick?!1:(n==null||n({event:r}),!0)}}];const yu={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class gT extends tp{constructor(t){super(t,yu)}static setup(){return window.addEventListener(yu.move.name,t,{capture:!1,passive:!1}),function(){window.removeEventListener(yu.move.name,t)};function t(){}}}gT.activators=[{eventName:"onTouchStart",handler:(e,t)=>{let{nativeEvent:r}=e,{onActivation:n}=t;const{touches:i}=r;return i.length>1?!1:(n==null||n({event:r}),!0)}}];var mo;(function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"})(mo||(mo={}));var Kl;(function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"})(Kl||(Kl={}));function vT(e){let{acceleration:t,activator:r=mo.Pointer,canScroll:n,draggingRect:i,enabled:a,interval:l=5,order:s=Kl.TreeOrder,pointerCoordinates:o,scrollableAncestors:c,scrollableAncestorRects:f,delta:u,threshold:p}=e;const _=yT({delta:u,disabled:!a}),[y,v]=kL(),h=E.useRef({x:0,y:0}),m=E.useRef({x:0,y:0}),d=E.useMemo(()=>{switch(r){case mo.Pointer:return o?{top:o.y,bottom:o.y,left:o.x,right:o.x}:null;case mo.DraggableRect:return i}},[r,i,o]),g=E.useRef(null),w=E.useCallback(()=>{const x=g.current;if(!x)return;const C=h.current.x*m.current.x,S=h.current.y*m.current.y;x.scrollBy(C,S)},[]),b=E.useMemo(()=>s===Kl.TreeOrder?[...c].reverse():c,[s,c]);E.useEffect(()=>{if(!a||!c.length||!d){v();return}for(const x of b){if((n==null?void 0:n(x))===!1)continue;const C=c.indexOf(x),S=f[C];if(!S)continue;const{direction:k,speed:L}=sT(x,S,d,t,p);for(const A of["x","y"])_[A][k[A]]||(L[A]=0,k[A]=0);if(L.x>0||L.y>0){v(),g.current=x,y(w,l),h.current=L,m.current=k;return}}h.current={x:0,y:0},m.current={x:0,y:0},v()},[t,w,n,v,a,l,JSON.stringify(d),JSON.stringify(_),y,c,b,f,JSON.stringify(p)])}const _T={x:{[Tt.Backward]:!1,[Tt.Forward]:!1},y:{[Tt.Backward]:!1,[Tt.Forward]:!1}};function yT(e){let{delta:t,disabled:r}=e;const n=Zh(t);return oa(i=>{if(r||!n||!i)return _T;const a={x:Math.sign(t.x-n.x),y:Math.sign(t.y-n.y)};return{x:{[Tt.Backward]:i.x[Tt.Backward]||a.x===-1,[Tt.Forward]:i.x[Tt.Forward]||a.x===1},y:{[Tt.Backward]:i.y[Tt.Backward]||a.y===-1,[Tt.Forward]:i.y[Tt.Forward]||a.y===1}}},[r,t,n])}function wT(e,t){const r=t!=null?e.get(t):void 0,n=r?r.node.current:null;return oa(i=>{var a;return t==null?null:(a=n??i)!=null?a:null},[n,t])}function ST(e,t){return E.useMemo(()=>e.reduce((r,n)=>{const{sensor:i}=n,a=i.activators.map(l=>({eventName:l.eventName,handler:t(l.handler,n)}));return[...r,...a]},[]),[e,t])}var Uo;(function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"})(Uo||(Uo={}));var nd;(function(e){e.Optimized="optimized"})(nd||(nd={}));const iv=new Map;function xT(e,t){let{dragging:r,dependencies:n,config:i}=t;const[a,l]=E.useState(null),{frequency:s,measure:o,strategy:c}=i,f=E.useRef(e),u=h(),p=$o(u),_=E.useCallback(function(m){m===void 0&&(m=[]),!p.current&&l(d=>d===null?m:d.concat(m.filter(g=>!d.includes(g))))},[p]),y=E.useRef(null),v=oa(m=>{if(u&&!r)return iv;if(!m||m===iv||f.current!==e||a!=null){const d=new Map;for(let g of e){if(!g)continue;if(a&&a.length>0&&!a.includes(g.id)&&g.rect.current){d.set(g.id,g.rect.current);continue}const w=g.node.current,b=w?new ep(o(w),w):null;g.rect.current=b,b&&d.set(g.id,b)}return d}return m},[e,a,r,u,o]);return E.useEffect(()=>{f.current=e},[e]),E.useEffect(()=>{u||_()},[r,u]),E.useEffect(()=>{a&&a.length>0&&l(null)},[JSON.stringify(a)]),E.useEffect(()=>{u||typeof s!="number"||y.current!==null||(y.current=setTimeout(()=>{_(),y.current=null},s))},[s,u,_,...n]),{droppableRects:v,measureDroppableContainers:_,measuringScheduled:a!=null};function h(){switch(c){case Uo.Always:return!1;case Uo.BeforeDragging:return r;default:return!r}}}function ew(e,t){return oa(r=>e?r||(typeof t=="function"?t(e):e):null,[t,e])}function bT(e,t){return ew(e,t)}function CT(e){let{callback:t,disabled:r}=e;const n=Jf(t),i=E.useMemo(()=>{if(r||typeof window>"u"||typeof window.MutationObserver>"u")return;const{MutationObserver:a}=window;return new a(n)},[n,r]);return E.useEffect(()=>()=>i==null?void 0:i.disconnect(),[i]),i}function xc(e){let{callback:t,disabled:r}=e;const n=Jf(t),i=E.useMemo(()=>{if(r||typeof window>"u"||typeof window.ResizeObserver>"u")return;const{ResizeObserver:a}=window;return new a(n)},[r]);return E.useEffect(()=>()=>i==null?void 0:i.disconnect(),[i]),i}function ET(e){return new ep(Ti(e),e)}function ov(e,t,r){t===void 0&&(t=ET);const[n,i]=E.useState(null);function a(){i(o=>{if(!e)return null;if(e.isConnected===!1){var c;return(c=o??r)!=null?c:null}const f=t(e);return JSON.stringify(o)===JSON.stringify(f)?o:f})}const l=CT({callback(o){if(e)for(const c of o){const{type:f,target:u}=c;if(f==="childList"&&u instanceof HTMLElement&&u.contains(e)){a();break}}}}),s=xc({callback:a});return qr(()=>{a(),e?(s==null||s.observe(e),l==null||l.observe(document.body,{childList:!0,subtree:!0})):(s==null||s.disconnect(),l==null||l.disconnect())},[e]),n}function kT(e){const t=ew(e);return V1(e,t)}const av=[];function LT(e){const t=E.useRef(e),r=oa(n=>e?n&&n!==av&&e&&t.current&&e.parentNode===t.current.parentNode?n:Zf(e):av,[e]);return E.useEffect(()=>{t.current=e},[e]),r}function TT(e){const[t,r]=E.useState(null),n=E.useRef(e),i=E.useCallback(a=>{const l=vu(a.target);l&&r(s=>s?(s.set(l,td(l)),new Map(s)):null)},[]);return E.useEffect(()=>{const a=n.current;if(e!==a){l(a);const s=e.map(o=>{const c=vu(o);return c?(c.addEventListener("scroll",i,{passive:!0}),[c,td(c)]):null}).filter(o=>o!=null);r(s.length?new Map(s):null),n.current=e}return()=>{l(e),l(a)};function l(s){s.forEach(o=>{const c=vu(o);c==null||c.removeEventListener("scroll",i)})}},[i,e]),E.useMemo(()=>e.length?t?Array.from(t.values()).reduce((a,l)=>ai(a,l),jr):J1(e):jr,[e,t])}function lv(e,t){t===void 0&&(t=[]);const r=E.useRef(null);return E.useEffect(()=>{r.current=null},t),E.useEffect(()=>{const n=e!==jr;n&&!r.current&&(r.current=e),!n&&r.current&&(r.current=null)},[e]),r.current?Wl(e,r.current):jr}function RT(e){E.useEffect(()=>{if(!Sc)return;const t=e.map(r=>{let{sensor:n}=r;return n.setup==null?void 0:n.setup()});return()=>{for(const r of t)r==null||r()}},e.map(t=>{let{sensor:r}=t;return r}))}function DT(e,t){return E.useMemo(()=>e.reduce((r,n)=>{let{eventName:i,handler:a}=n;return r[i]=l=>{a(l,t)},r},{}),[e,t])}function tw(e){return E.useMemo(()=>e?eT(e):null,[e])}const cv=[];function MT(e,t){t===void 0&&(t=Ti);const[r]=e,n=tw(r?lr(r):null),[i,a]=E.useState(cv);function l(){a(()=>e.length?e.map(o=>X1(o)?n:new ep(t(o),o)):cv)}const s=xc({callback:l});return qr(()=>{s==null||s.disconnect(),l(),e.forEach(o=>s==null?void 0:s.observe(o))},[e]),i}function AT(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return ia(t)?t:e}function PT(e){let{measure:t}=e;const[r,n]=E.useState(null),i=E.useCallback(c=>{for(const{target:f}of c)if(ia(f)){n(u=>{const p=t(f);return u?{...u,width:p.width,height:p.height}:p});break}},[t]),a=xc({callback:i}),l=E.useCallback(c=>{const f=AT(c);a==null||a.disconnect(),f&&(a==null||a.observe(f)),n(f?t(f):null)},[t,a]),[s,o]=Ul(l);return E.useMemo(()=>({nodeRef:s,rect:r,setRef:o}),[r,s,o])}const IT=[{sensor:rp,options:{}},{sensor:Z1,options:{}}],OT={current:{}},ol={draggable:{measure:tv},droppable:{measure:tv,strategy:Uo.WhileDragging,frequency:nd.Optimized},dragOverlay:{measure:Ti}};class go extends Map{get(t){var r;return t!=null&&(r=super.get(t))!=null?r:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(t=>{let{disabled:r}=t;return!r})}getNodeFor(t){var r,n;return(r=(n=this.get(t))==null?void 0:n.node.current)!=null?r:void 0}}const BT={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new go,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:Vl},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:ol,measureDroppableContainers:Vl,windowRect:null,measuringScheduled:!1},NT={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:Vl,draggableNodes:new Map,over:null,measureDroppableContainers:Vl},bc=E.createContext(NT),rw=E.createContext(BT);function jT(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new go}}}function FT(e,t){switch(t.type){case xt.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case xt.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 xt.DragEnd:case xt.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case xt.RegisterDroppable:{const{element:r}=t,{id:n}=r,i=new go(e.droppable.containers);return i.set(n,r),{...e,droppable:{...e.droppable,containers:i}}}case xt.SetDroppableDisabled:{const{id:r,key:n,disabled:i}=t,a=e.droppable.containers.get(r);if(!a||n!==a.key)return e;const l=new go(e.droppable.containers);return l.set(r,{...a,disabled:i}),{...e,droppable:{...e.droppable,containers:l}}}case xt.UnregisterDroppable:{const{id:r,key:n}=t,i=e.droppable.containers.get(r);if(!i||n!==i.key)return e;const a=new go(e.droppable.containers);return a.delete(r),{...e,droppable:{...e.droppable,containers:a}}}default:return e}}function HT(e){let{disabled:t}=e;const{active:r,activatorEvent:n,draggableNodes:i}=E.useContext(bc),a=Zh(n),l=Zh(r==null?void 0:r.id);return E.useEffect(()=>{if(!t&&!n&&a&&l!=null){if(!Qf(a)||document.activeElement===a.target)return;const s=i.get(l);if(!s)return;const{activatorNode:o,node:c}=s;if(!o.current&&!c.current)return;requestAnimationFrame(()=>{for(const f of[o.current,c.current]){if(!f)continue;const u=RL(f);if(u){u.focus();break}}})}},[n,t,i,l,a]),null}function $T(e,t){let{transform:r,...n}=t;return e!=null&&e.length?e.reduce((i,a)=>a({transform:i,...n}),r):r}function zT(e){return E.useMemo(()=>({draggable:{...ol.draggable,...e==null?void 0:e.draggable},droppable:{...ol.droppable,...e==null?void 0:e.droppable},dragOverlay:{...ol.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 UT(e){let{activeNode:t,measure:r,initialRect:n,config:i=!0}=e;const a=E.useRef(!1),{x:l,y:s}=typeof i=="boolean"?{x:i,y:i}:i;qr(()=>{if(!l&&!s||!t){a.current=!1;return}if(a.current||!n)return;const c=t==null?void 0:t.node.current;if(!c||c.isConnected===!1)return;const f=r(c),u=V1(f,n);if(l||(u.x=0),s||(u.y=0),a.current=!0,Math.abs(u.x)>0||Math.abs(u.y)>0){const p=K1(c);p&&p.scrollBy({top:u.y,left:u.x})}},[t,l,s,n,r])}const nw=E.createContext({...jr,scaleX:1,scaleY:1});var Rn;(function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"})(Rn||(Rn={}));const WT=E.memo(function(t){var r,n,i,a;let{id:l,accessibility:s,autoScroll:o=!0,children:c,sensors:f=IT,collisionDetection:u=GL,measuring:p,modifiers:_,...y}=t;const v=E.useReducer(FT,void 0,jT),[h,m]=v,[d,g]=OL(),[w,b]=E.useState(Rn.Uninitialized),x=w===Rn.Initialized,{draggable:{active:C,nodes:S,translate:k},droppable:{containers:L}}=h,A=C!=null?S.get(C):null,M=E.useRef({initial:null,translated:null}),D=E.useMemo(()=>{var le;return C!=null?{id:C,data:(le=A==null?void 0:A.data)!=null?le:OT,rect:M}:null},[C,A]),O=E.useRef(null),[z,F]=E.useState(null),[H,I]=E.useState(null),R=$o(y,Object.values(y)),P=aa("DndDescribedBy",l),N=E.useMemo(()=>L.getEnabled(),[L]),j=zT(p),{droppableRects:W,measureDroppableContainers:V,measuringScheduled:Z}=xT(N,{dragging:x,dependencies:[k.x,k.y],config:j.droppable}),Q=wT(S,C),$=E.useMemo(()=>H?ed(H):null,[H]),B=re(),K=bT(Q,j.draggable.measure);UT({activeNode:C!=null?S.get(C):null,config:B.layoutShiftCompensation,initialRect:K,measure:j.draggable.measure});const U=ov(Q,j.draggable.measure,K),te=ov(Q?Q.parentElement:null),Y=E.useRef({activatorEvent:null,active:null,activeNode:Q,collisionRect:null,collisions:null,droppableRects:W,draggableNodes:S,draggingNode:null,draggingNodeRect:null,droppableContainers:L,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),ye=L.getNodeFor((r=Y.current.over)==null?void 0:r.id),pe=PT({measure:j.dragOverlay.measure}),ne=(n=pe.nodeRef.current)!=null?n:Q,oe=x?(i=pe.rect)!=null?i:U:null,ce=!!(pe.nodeRef.current&&pe.rect),ue=kT(ce?null:U),ve=tw(ne?lr(ne):null),se=LT(x?ye??Q:null),ae=MT(se),fe=$T(_,{transform:{x:k.x-ue.x,y:k.y-ue.y,scaleX:1,scaleY:1},activatorEvent:H,active:D,activeNodeRect:U,containerNodeRect:te,draggingNodeRect:oe,over:Y.current.over,overlayNodeRect:pe.rect,scrollableAncestors:se,scrollableAncestorRects:ae,windowRect:ve}),ie=$?ai($,k):null,ge=TT(se),be=lv(ge),Te=lv(ge,[U]),je=ai(fe,be),He=oe?YL(oe,fe):null,Pe=D&&He?u({active:D,collisionRect:He,droppableRects:W,droppableContainers:N,pointerCoordinates:ie}):null,Oe=WL(Pe,"id"),[ke,Le]=E.useState(null),Qe=ce?fe:ai(fe,Te),J=qL(Qe,(a=ke==null?void 0:ke.rect)!=null?a:null,U),ee=E.useRef(null),Be=E.useCallback((le,we)=>{let{sensor:De,options:$e}=we;if(O.current==null)return;const Ue=S.get(O.current);if(!Ue)return;const Ie=le.nativeEvent,Me=new De({active:O.current,activeNode:Ue,event:Ie,options:$e,context:Y,onAbort(ze){if(!S.get(ze))return;const{onDragAbort:Ae}=R.current,We={id:ze};Ae==null||Ae(We),d({type:"onDragAbort",event:We})},onPending(ze,Re,Ae,We){if(!S.get(ze))return;const{onDragPending:$t}=R.current,_t={id:ze,constraint:Re,initialCoordinates:Ae,offset:We};$t==null||$t(_t),d({type:"onDragPending",event:_t})},onStart(ze){const Re=O.current;if(Re==null)return;const Ae=S.get(Re);if(!Ae)return;const{onDragStart:We}=R.current,Xe={activatorEvent:Ie,active:{id:Re,data:Ae.data,rect:M}};hn.unstable_batchedUpdates(()=>{We==null||We(Xe),b(Rn.Initializing),m({type:xt.DragStart,initialCoordinates:ze,active:Re}),d({type:"onDragStart",event:Xe}),F(ee.current),I(Ie)})},onMove(ze){m({type:xt.DragMove,coordinates:ze})},onEnd:et(xt.DragEnd),onCancel:et(xt.DragCancel)});ee.current=Me;function et(ze){return async function(){const{active:Ae,collisions:We,over:Xe,scrollAdjustedTranslate:$t}=Y.current;let _t=null;if(Ae&&$t){const{cancelDrop:zt}=R.current;_t={activatorEvent:Ie,active:Ae,collisions:We,delta:$t,over:Xe},ze===xt.DragEnd&&typeof zt=="function"&&await Promise.resolve(zt(_t))&&(ze=xt.DragCancel)}O.current=null,hn.unstable_batchedUpdates(()=>{m({type:ze}),b(Rn.Uninitialized),Le(null),F(null),I(null),ee.current=null;const zt=ze===xt.DragEnd?"onDragEnd":"onDragCancel";if(_t){const It=R.current[zt];It==null||It(_t),d({type:zt,event:_t})}})}}},[S]),q=E.useCallback((le,we)=>(De,$e)=>{const Ue=De.nativeEvent,Ie=S.get($e);if(O.current!==null||!Ie||Ue.dndKit||Ue.defaultPrevented)return;const Me={active:Ie};le(De,we.options,Me)===!0&&(Ue.dndKit={capturedBy:we.sensor},O.current=$e,Be(De,we))},[S,Be]),de=ST(f,q);RT(f),qr(()=>{U&&w===Rn.Initializing&&b(Rn.Initialized)},[U,w]),E.useEffect(()=>{const{onDragMove:le}=R.current,{active:we,activatorEvent:De,collisions:$e,over:Ue}=Y.current;if(!we||!De)return;const Ie={active:we,activatorEvent:De,collisions:$e,delta:{x:je.x,y:je.y},over:Ue};hn.unstable_batchedUpdates(()=>{le==null||le(Ie),d({type:"onDragMove",event:Ie})})},[je.x,je.y]),E.useEffect(()=>{const{active:le,activatorEvent:we,collisions:De,droppableContainers:$e,scrollAdjustedTranslate:Ue}=Y.current;if(!le||O.current==null||!we||!Ue)return;const{onDragOver:Ie}=R.current,Me=$e.get(Oe),et=Me&&Me.rect.current?{id:Me.id,rect:Me.rect.current,data:Me.data,disabled:Me.disabled}:null,ze={active:le,activatorEvent:we,collisions:De,delta:{x:Ue.x,y:Ue.y},over:et};hn.unstable_batchedUpdates(()=>{Le(et),Ie==null||Ie(ze),d({type:"onDragOver",event:ze})})},[Oe]),qr(()=>{Y.current={activatorEvent:H,active:D,activeNode:Q,collisionRect:He,collisions:Pe,droppableRects:W,draggableNodes:S,draggingNode:ne,draggingNodeRect:oe,droppableContainers:L,over:ke,scrollableAncestors:se,scrollAdjustedTranslate:je},M.current={initial:oe,translated:He}},[D,Q,Pe,He,S,ne,oe,W,L,ke,se,je]),vT({...B,delta:k,draggingRect:He,pointerCoordinates:ie,scrollableAncestors:se,scrollableAncestorRects:ae});const X=E.useMemo(()=>({active:D,activeNode:Q,activeNodeRect:U,activatorEvent:H,collisions:Pe,containerNodeRect:te,dragOverlay:pe,draggableNodes:S,droppableContainers:L,droppableRects:W,over:ke,measureDroppableContainers:V,scrollableAncestors:se,scrollableAncestorRects:ae,measuringConfiguration:j,measuringScheduled:Z,windowRect:ve}),[D,Q,U,H,Pe,te,pe,S,L,W,ke,V,se,ae,j,Z,ve]),_e=E.useMemo(()=>({activatorEvent:H,activators:de,active:D,activeNodeRect:U,ariaDescribedById:{draggable:P},dispatch:m,draggableNodes:S,over:ke,measureDroppableContainers:V}),[H,de,D,U,m,P,S,ke,V]);return gt.createElement(W1.Provider,{value:g},gt.createElement(bc.Provider,{value:_e},gt.createElement(rw.Provider,{value:X},gt.createElement(nw.Provider,{value:J},c)),gt.createElement(HT,{disabled:(s==null?void 0:s.restoreFocus)===!1})),gt.createElement(jL,{...s,hiddenTextDescribedById:P}));function re(){const le=(z==null?void 0:z.autoScrollEnabled)===!1,we=typeof o=="object"?o.enabled===!1:o===!1,De=x&&!le&&!we;return typeof o=="object"?{...o,enabled:De}:{enabled:De}}}),VT=E.createContext(null),uv="button",KT="Draggable";function GT(e){let{id:t,data:r,disabled:n=!1,attributes:i}=e;const a=aa(KT),{activators:l,activatorEvent:s,active:o,activeNodeRect:c,ariaDescribedById:f,draggableNodes:u,over:p}=E.useContext(bc),{role:_=uv,roleDescription:y="draggable",tabIndex:v=0}=i??{},h=(o==null?void 0:o.id)===t,m=E.useContext(h?nw:VT),[d,g]=Ul(),[w,b]=Ul(),x=DT(l,t),C=$o(r);qr(()=>(u.set(t,{id:t,key:a,node:d,activatorNode:w,data:C}),()=>{const k=u.get(t);k&&k.key===a&&u.delete(t)}),[u,t]);const S=E.useMemo(()=>({role:_,tabIndex:v,"aria-disabled":n,"aria-pressed":h&&_===uv?!0:void 0,"aria-roledescription":y,"aria-describedby":f.draggable}),[n,_,v,h,y,f.draggable]);return{active:o,activatorEvent:s,activeNodeRect:c,attributes:S,isDragging:h,listeners:n?void 0:x,node:d,over:p,setNodeRef:g,setActivatorNodeRef:b,transform:m}}function qT(){return E.useContext(rw)}const XT="Droppable",YT={timeout:25};function JT(e){let{data:t,disabled:r=!1,id:n,resizeObserverConfig:i}=e;const a=aa(XT),{active:l,dispatch:s,over:o,measureDroppableContainers:c}=E.useContext(bc),f=E.useRef({disabled:r}),u=E.useRef(!1),p=E.useRef(null),_=E.useRef(null),{disabled:y,updateMeasurementsFor:v,timeout:h}={...YT,...i},m=$o(v??n),d=E.useCallback(()=>{if(!u.current){u.current=!0;return}_.current!=null&&clearTimeout(_.current),_.current=setTimeout(()=>{c(Array.isArray(m.current)?m.current:[m.current]),_.current=null},h)},[h]),g=xc({callback:d,disabled:y||!l}),w=E.useCallback((S,k)=>{g&&(k&&(g.unobserve(k),u.current=!1),S&&g.observe(S))},[g]),[b,x]=Ul(w),C=$o(t);return E.useEffect(()=>{!g||!b.current||(g.disconnect(),u.current=!1,g.observe(b.current))},[b,g]),E.useEffect(()=>(s({type:xt.RegisterDroppable,element:{id:n,key:a,disabled:r,node:b,rect:p,data:C}}),()=>s({type:xt.UnregisterDroppable,key:a,id:n})),[n]),E.useEffect(()=>{r!==f.current.disabled&&(s({type:xt.SetDroppableDisabled,id:n,key:a,disabled:r}),f.current.disabled=r)},[n,a,r,s]),{active:l,rect:p,isOver:(o==null?void 0:o.id)===n,node:b,over:o,setNodeRef:x}}function sw(e,t,r){const n=e.slice();return n.splice(r<0?n.length+r:r,0,n.splice(t,1)[0]),n}function QT(e,t){return e.reduce((r,n,i)=>{const a=t.get(n);return a&&(r[i]=a),r},Array(e.length))}function Aa(e){return e!==null&&e>=0}function ZT(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let r=0;r<e.length;r++)if(e[r]!==t[r])return!1;return!0}function eR(e){return typeof e=="boolean"?{draggable:e,droppable:e}:e}const iw=e=>{let{rects:t,activeIndex:r,overIndex:n,index:i}=e;const a=sw(t,n,r),l=t[i],s=a[i];return!s||!l?null:{x:s.left-l.left,y:s.top-l.top,scaleX:s.width/l.width,scaleY:s.height/l.height}},Pa={scaleX:1,scaleY:1},tR=e=>{var t;let{activeIndex:r,activeNodeRect:n,index:i,rects:a,overIndex:l}=e;const s=(t=a[r])!=null?t:n;if(!s)return null;if(i===r){const c=a[l];return c?{x:0,y:r<l?c.top+c.height-(s.top+s.height):c.top-s.top,...Pa}:null}const o=rR(a,i,r);return i>r&&i<=l?{x:0,y:-s.height-o,...Pa}:i<r&&i>=l?{x:0,y:s.height+o,...Pa}:{x:0,y:0,...Pa}};function rR(e,t,r){const n=e[t],i=e[t-1],a=e[t+1];return n?r<t?i?n.top-(i.top+i.height):a?a.top-(n.top+n.height):0:a?a.top-(n.top+n.height):i?n.top-(i.top+i.height):0:0}const ow="Sortable",aw=gt.createContext({activeIndex:-1,containerId:ow,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:iw,disabled:{draggable:!1,droppable:!1}});function nR(e){let{children:t,id:r,items:n,strategy:i=iw,disabled:a=!1}=e;const{active:l,dragOverlay:s,droppableRects:o,over:c,measureDroppableContainers:f}=qT(),u=aa(ow,r),p=s.rect!==null,_=E.useMemo(()=>n.map(x=>typeof x=="object"&&"id"in x?x.id:x),[n]),y=l!=null,v=l?_.indexOf(l.id):-1,h=c?_.indexOf(c.id):-1,m=E.useRef(_),d=!ZT(_,m.current),g=h!==-1&&v===-1||d,w=eR(a);qr(()=>{d&&y&&f(_)},[d,_,y,f]),E.useEffect(()=>{m.current=_},[_]);const b=E.useMemo(()=>({activeIndex:v,containerId:u,disabled:w,disableTransforms:g,items:_,overIndex:h,useDragOverlay:p,sortedRects:QT(_,o),strategy:i}),[v,u,w.draggable,w.droppable,g,_,h,o,p,i]);return gt.createElement(aw.Provider,{value:b},t)}const sR=e=>{let{id:t,items:r,activeIndex:n,overIndex:i}=e;return sw(r,n,i).indexOf(t)},iR=e=>{let{containerId:t,isSorting:r,wasDragging:n,index:i,items:a,newIndex:l,previousItems:s,previousContainerId:o,transition:c}=e;return!c||!n||s!==a&&i===l?!1:r?!0:l!==i&&t===o},oR={duration:200,easing:"ease"},lw="transform",aR=zo.Transition.toString({property:lw,duration:0,easing:"linear"}),lR={roleDescription:"sortable"};function cR(e){let{disabled:t,index:r,node:n,rect:i}=e;const[a,l]=E.useState(null),s=E.useRef(r);return qr(()=>{if(!t&&r!==s.current&&n.current){const o=i.current;if(o){const c=Ti(n.current,{ignoreTransform:!0}),f={x:o.left-c.left,y:o.top-c.top,scaleX:o.width/c.width,scaleY:o.height/c.height};(f.x||f.y)&&l(f)}}r!==s.current&&(s.current=r)},[t,r,n,i]),E.useEffect(()=>{a&&l(null)},[a]),a}function uR(e){let{animateLayoutChanges:t=iR,attributes:r,disabled:n,data:i,getNewIndex:a=sR,id:l,strategy:s,resizeObserverConfig:o,transition:c=oR}=e;const{items:f,containerId:u,activeIndex:p,disabled:_,disableTransforms:y,sortedRects:v,overIndex:h,useDragOverlay:m,strategy:d}=E.useContext(aw),g=hR(n,_),w=f.indexOf(l),b=E.useMemo(()=>({sortable:{containerId:u,index:w,items:f},...i}),[u,i,w,f]),x=E.useMemo(()=>f.slice(f.indexOf(l)),[f,l]),{rect:C,node:S,isOver:k,setNodeRef:L}=JT({id:l,data:b,disabled:g.droppable,resizeObserverConfig:{updateMeasurementsFor:x,...o}}),{active:A,activatorEvent:M,activeNodeRect:D,attributes:O,setNodeRef:z,listeners:F,isDragging:H,over:I,setActivatorNodeRef:R,transform:P}=GT({id:l,data:b,attributes:{...lR,...r},disabled:g.draggable}),N=EL(L,z),j=!!A,W=j&&!y&&Aa(p)&&Aa(h),V=!m&&H,Z=V&&W?P:null,$=W?Z??(s??d)({rects:v,activeNodeRect:D,activeIndex:p,overIndex:h,index:w}):null,B=Aa(p)&&Aa(h)?a({id:l,items:f,activeIndex:p,overIndex:h}):w,K=A==null?void 0:A.id,U=E.useRef({activeId:K,items:f,newIndex:B,containerId:u}),te=f!==U.current.items,Y=t({active:A,containerId:u,isDragging:H,isSorting:j,id:l,index:w,items:f,newIndex:U.current.newIndex,previousItems:U.current.items,previousContainerId:U.current.containerId,transition:c,wasDragging:U.current.activeId!=null}),ye=cR({disabled:!Y,index:w,node:S,rect:C});return E.useEffect(()=>{j&&U.current.newIndex!==B&&(U.current.newIndex=B),u!==U.current.containerId&&(U.current.containerId=u),f!==U.current.items&&(U.current.items=f)},[j,B,u,f]),E.useEffect(()=>{if(K===U.current.activeId)return;if(K!=null&&U.current.activeId==null){U.current.activeId=K;return}const ne=setTimeout(()=>{U.current.activeId=K},50);return()=>clearTimeout(ne)},[K]),{active:A,activeIndex:p,attributes:O,data:b,rect:C,index:w,newIndex:B,items:f,isOver:k,isSorting:j,isDragging:H,listeners:F,node:S,overIndex:h,over:I,setNodeRef:N,setActivatorNodeRef:R,setDroppableNodeRef:L,setDraggableNodeRef:z,transform:ye??$,transition:pe()};function pe(){if(ye||te&&U.current.newIndex===w)return aR;if(!(V&&!Qf(M)||!c)&&(j||Y))return zo.Transition.toString({...c,property:lw})}}function hR(e,t){var r,n;return typeof e=="boolean"?{draggable:e,droppable:!1}:{draggable:(r=e==null?void 0:e.draggable)!=null?r:t.draggable,droppable:(n=e==null?void 0:e.droppable)!=null?n:t.droppable}}Ye.Down,Ye.Right,Ye.Up,Ye.Left;const Ia={permission:0,waiting:1,working:2,unknown:3};function vo(e){var r;const t=(r=e.agentSessionId)==null?void 0:r.trim();return t&&t.length>0?t:e.id}const dR={mode:"created",direction:"desc"};function np(e,t=dR){const{mode:r,direction:n,manualOrder:i}=t;if(r==="manual"&&i&&i.length>0){const a=new Map(i.map((l,s)=>[l,s]));return e.toSorted((l,s)=>{const o=vo(l),c=vo(s),f=a.get(o)??a.get(l.id)??1/0,u=a.get(c)??a.get(s.id)??1/0;return f===1/0&&u===1/0?Date.parse(s.createdAt)-Date.parse(l.createdAt):f-u})}return e.toSorted((a,l)=>{if(r==="status"){const c=Ia[a.status]??Ia.unknown,f=Ia[l.status]??Ia.unknown;return c!==f?c-f:Date.parse(l.lastActivity)-Date.parse(a.lastActivity)}const s=Date.parse(a.createdAt),o=Date.parse(l.createdAt);return n==="desc"?o-s:s-o})}function fR(e,t){var n,i;const r=new Map;for(const a of e){const l=(n=a.projectPath)==null?void 0:n.trim();if(l){const s=Date.parse(a.lastActivity)||0,o=r.get(l)||0;s>o&&r.set(l,s)}}for(const a of t){const l=(i=a.projectPath)==null?void 0:i.trim();if(l){const s=Date.parse(a.lastActivityAt)||0,o=r.get(l)||0;s>o&&r.set(l,s)}}return Array.from(r.keys()).toSorted((a,l)=>{const s=r.get(a)||0;return(r.get(l)||0)-s})}function pR(e,t){var n,i;const r=new Map;for(const a of e){const l=(n=a.host)==null?void 0:n.trim();if(l){const s=Date.parse(a.lastActivity)||0,o=r.get(l)||0;s>o&&r.set(l,s)}}for(const a of t){const l=(i=a.host)==null?void 0:i.trim();if(l){const s=Date.parse(a.lastActivityAt)||0,o=r.get(l)||0;s>o&&r.set(l,s)}}return Array.from(r.keys()).toSorted((a,l)=>{const s=r.get(a)||0;return(r.get(l)||0)-s})}function sp(e){const t=Date.parse(e);if(Number.isNaN(t))return"";const r=Date.now()-t,n=Math.floor(r/6e4);if(n<1)return"now";if(n<60)return`${n}m`;const i=Math.floor(n/60);return i<24?`${i}h`:`${Math.floor(i/24)}d`}function _s(e){const t=e.trim();if(!t)return null;const r=t.replace(/[\\/]+$/,"");if(!r)return null;const n=r.split(/[\\/]/);return n[n.length-1]||null}function mR(e){const t=e.map(s=>{const o=s.trim(),c=o.replace(/[\\/]+$/,""),f=c.split(/[\\/]/).filter(Boolean);return{path:s,parts:f,fallback:c||o||s}}),r=new Map;for(const s of t)r.set(s.path,1);let n=!0;for(;n;){n=!1;const s=new Map;for(const o of t){if(o.parts.length===0)continue;const c=r.get(o.path)??1,f=o.parts.slice(-c).join("/");s.set(f,(s.get(f)??0)+1)}for(const o of t){if(o.parts.length===0)continue;const c=r.get(o.path)??1,f=o.parts.slice(-c).join("/");(s.get(f)??0)>1&&c<o.parts.length&&(r.set(o.path,c+1),n=!0)}}const i=new Map,a=new Map;for(const s of t){let o=s.fallback;if(s.parts.length>0){const c=r.get(s.path)??1;o=s.parts.slice(-c).join("/")}i.set(s.path,o),a.set(o,(a.get(o)??0)+1)}const l=new Map;for(const s of t){let o=i.get(s.path)??s.fallback;(a.get(o)??0)>1&&(o=s.fallback),l.set(s.path,o)}return l}function cw(e){const t=e.trim();return!t||t.length<=6?t:`${t.slice(0,3)}…${t.slice(-3)}`}function uw(e){var r;const t=document.createElement("textarea");t.value=e,t.style.position="fixed",t.style.left="-9999px",document.body.appendChild(t),t.focus(),t.select();try{if(!document.execCommand("copy"))throw 0}catch{(r=navigator.clipboard)==null||r.writeText(e).catch(()=>{})}document.body.removeChild(t)}function gR({useSafariLayoutFallback:e,isDragging:t,dndTransform:r,generatedTransform:n}){return e&&!t&&!r||!r?n:!n||n==="none"?r:`${r} ${n}`}const vR="agentboard-session",_R=sC();function yR(e,t){return e.id===t.id&&e.name===t.name&&e.tmuxWindow===t.tmuxWindow&&e.projectPath===t.projectPath&&e.status===t.status&&e.lastActivity===t.lastActivity&&e.createdAt===t.createdAt&&e.source===t.source&&e.host===t.host&&e.remote===t.remote&&e.command===t.command&&e.agentType===t.agentType&&e.agentSessionId===t.agentSessionId&&e.agentSessionName===t.agentSessionName&&e.logFilePath===t.logFilePath&&e.isPinned===t.isPinned&&e.lastUserMessage===t.lastUserMessage}function wR(e,t){if(e.length!==t.length)return!1;const r=new Map(e.map(n=>[n.id,n]));for(const n of t){const i=r.get(n.id);if(!i||!yR(i,n))return!1}return!0}const Ve=df()(ff((e,t)=>({sessions:[],agentSessions:{active:[],inactive:[]},hostStatuses:[],exitingSessions:new Map,selectedSessionId:null,hasLoaded:!1,connectionStatus:"connecting",connectionError:null,remoteAllowControl:!1,remoteAllowAttach:!1,hostLabel:null,setSessions:r=>{var f;const n=t(),i=n.selectedSessionId,a=n.sessions,l=n.exitingSessions;if(n.hasLoaded&&wR(a,r))return;const s=new Set(r.map(u=>u.id)),o=a.filter(u=>!s.has(u.id)&&!l.has(u.id));let c=i;if(i!==null&&!r.some(u=>u.id===i)){const{sessionSortMode:u,sessionSortDirection:p}=me.getState();c=((f=np(r,{mode:u,direction:p})[0])==null?void 0:f.id)??null}if(o.length>0){const u=new Map(l);for(const p of o)u.set(p.id,p);e({sessions:r,hasLoaded:!0,selectedSessionId:c,exitingSessions:u})}else e({sessions:r,hasLoaded:!0,selectedSessionId:c})},setAgentSessions:(r,n)=>e({agentSessions:{active:r,inactive:n}}),setHostStatuses:r=>e({hostStatuses:r}),updateSession:r=>e(n=>({sessions:n.sessions.map(i=>i.id===r.id?r:i)})),setSelectedSessionId:r=>e({selectedSessionId:r}),setConnectionStatus:r=>e({connectionStatus:r}),setConnectionError:r=>e({connectionError:r}),setRemoteAllowControl:r=>e({remoteAllowControl:r}),setRemoteAllowAttach:r=>e({remoteAllowAttach:r}),setHostLabel:r=>e({hostLabel:r}),markSessionExiting:r=>{const n=t().sessions.find(i=>i.id===r);if(n){const i=new Map(t().exitingSessions);i.set(r,n),e({exitingSessions:i})}},clearExitingSession:r=>{const n=new Map(t().exitingSessions);n.delete(r),e({exitingSessions:n})}}),{name:vR,storage:gc(()=>_R),partialize:e=>({selectedSessionId:e.selectedSessionId})}));function hv(e,t,r=!1){const[n,i]=E.useState(!1),a=E.useRef(e),l=E.useRef(!1);return E.useEffect(()=>{const o=a.current;if(r?e>o:e!==o){l.current=!0;const f=setTimeout(()=>{l.current&&(i(!0),l.current=!1)},t);return a.current=e,()=>clearTimeout(f)}a.current=e},[e,t,r]),[n,()=>i(!1)]}function SR(e,t,r,n){const i=E.useRef(new Map);E.useEffect(()=>{const a=new Set(e.map(l=>l.id));for(const l of t.keys())if(a.has(l)){const s=i.current.get(l);s&&(clearTimeout(s),i.current.delete(l)),r(l)}else if(!i.current.has(l)){const s=setTimeout(()=>{i.current.delete(l),r(l)},n+100);i.current.set(l,s)}},[e,t,r,n]),E.useEffect(()=>()=>{for(const a of i.current.values())clearTimeout(a);i.current.clear()},[])}function xR({className:e}){return T.jsx("svg",{viewBox:"0 0 92.2 92.2",fill:"currentColor",className:e,"aria-label":"Anthropic",children:T.jsx("path",{d:"M66.5,0H52.4l25.7,65h14.1L66.5,0z M25.7,0L0,65h14.4l5.3-13.6h26.9L51.8,65h14.4L40.5,0C40.5,0,25.7,0,25.7,0z M24.3,39.3l8.8-22.8l8.8,22.8H24.3z",transform:"translate(0, 13.6)"})})}function bR({className:e}){return T.jsx("svg",{viewBox:"-1 -1 26 26",fill:"currentColor",className:e,"aria-label":"OpenAI",children:T.jsx("path",{d:"M22.2819 9.8211a5.9847 5.9847 0 0 0-.5157-4.9108 6.0462 6.0462 0 0 0-6.5098-2.9A6.0651 6.0651 0 0 0 4.9807 4.1818a5.9847 5.9847 0 0 0-3.9977 2.9 6.0462 6.0462 0 0 0 .7427 7.0966 5.98 5.98 0 0 0 .511 4.9107 6.051 6.051 0 0 0 6.5146 2.9001A5.9847 5.9847 0 0 0 13.2599 24a6.0557 6.0557 0 0 0 5.7718-4.2058 5.9894 5.9894 0 0 0 3.9977-2.9001 6.0557 6.0557 0 0 0-.7475-7.0729zm-9.022 12.6081a4.4755 4.4755 0 0 1-2.8764-1.0408l.1419-.0804 4.7783-2.7582a.7948.7948 0 0 0 .3927-.6813v-6.7369l2.02 1.1686a.071.071 0 0 1 .038.052v5.5826a4.504 4.504 0 0 1-4.4945 4.4944zm-9.6607-4.1254a4.4708 4.4708 0 0 1-.5346-3.0137l.142.0852 4.783 2.7582a.7712.7712 0 0 0 .7806 0l5.8428-3.3685v2.3324a.0804.0804 0 0 1-.0332.0615L9.74 19.9502a4.4992 4.4992 0 0 1-6.1408-1.6464zM2.3408 7.8956a4.485 4.485 0 0 1 2.3655-1.9728V11.6a.7664.7664 0 0 0 .3879.6765l5.8144 3.3543-2.0201 1.1685a.0757.0757 0 0 1-.071 0l-4.8303-2.7865A4.504 4.504 0 0 1 2.3408 7.872zm16.5963 3.8558L13.1038 8.364 15.1192 7.2a.0757.0757 0 0 1 .071 0l4.8303 2.7913a4.4944 4.4944 0 0 1-.6765 8.1042v-5.6772a.79.79 0 0 0-.407-.667zm2.0107-3.0231l-.142-.0852-4.7735-2.7818a.7759.7759 0 0 0-.7854 0L9.409 9.2297V6.8974a.0662.0662 0 0 1 .0284-.0615l4.8303-2.7866a4.4992 4.4992 0 0 1 6.6802 4.66zM8.3065 12.863l-2.02-1.1638a.0804.0804 0 0 1-.038-.0567V6.0742a4.4992 4.4992 0 0 1 7.3757-3.4537l-.142.0805L8.704 5.459a.7948.7948 0 0 0-.3927.6813zm1.0976-2.3654l2.602-1.4998 2.6069 1.4998v2.9994l-2.5974 1.4997-2.6067-1.4997Z"})})}function CR({className:e}){return T.jsx("svg",{viewBox:"0 0 588.42 568.88",fill:"currentColor",className:e,"aria-label":"Pi",children:T.jsx("path",{d:"M 10.499686,177.03840 L 31.174931,178.56990 C 52.615925,154.32116 61.039171,82.595924 187.38789,96.634671 C 182.79339,403.95560 48.021426,436.37234 56.444675,499.41907 C 59.507674,535.15406 87.840417,557.10556 118.47041,558.38181 C 215.21014,555.06356 210.87089,424.63084 240.99038,95.868921 L 365.80760,95.868921 C 359.17110,211.75239 341.04836,327.63586 339.00636,441.22208 C 340.53786,516.77606 386.48285,557.10556 446.97708,557.61606 C 546.52456,560.93431 577.92030,444.79558 577.92030,395.27709 L 556.47931,395.27710 C 554.43731,436.11709 534.78306,465.47083 492.92207,467.25758 C 378.82535,468.78908 441.61683,266.63113 442.38258,97.400421 L 577.92030,98.166171 L 577.15455,11.636437 C 13.807491,8.9075799 85.312284,-2.1366151 10.499686,177.03840 z"})})}const ER=[["claude",xR],["codex",bR],["pi",CR]];function Cc({agentType:e,command:t,className:r=""}){const n=(e||(t==null?void 0:t.split(" ")[0])||"").toLowerCase();for(const[i,a]of ER)if(n.startsWith(i))return T.jsx(a,{className:r});return T.jsx(FC,{className:r})}const kR=360;function LR(e){let t=0;for(let r=0;r<e.length;r++){const n=e.charCodeAt(r);t=(t<<5)-t+n,t=t&t}return Math.abs(t)}function hw(e){return{"--badge-hue":`${LR(e)%kR}`}}function dw({name:e,fullPath:t,className:r=""}){const n=hw(e);return T.jsx("span",{className:`project-badge inline-flex items-center rounded-full px-1.5 py-0.5 text-[10px] font-medium leading-none ${r}`,style:n,title:t,children:e})}const TR=E.memo(function({session:t,showSessionIdPrefix:r,showProjectName:n,showLastUserMessage:i,onResume:a,onPreview:l,onSetPinned:s}){const o=sp(t.lastActivityAt),c=_s(t.projectPath),f=t.displayName||c||t.sessionId.slice(0,8),u=n&&!!c,p=i&&!!t.lastUserMessage,_=r?cw(t.sessionId):"",y=E.useRef(null),[v,h]=E.useState(null);E.useEffect(()=>{if(!v)return;const d=w=>{y.current&&!y.current.contains(w.target)&&h(null)},g=w=>{w.key==="Escape"&&h(null)};return document.addEventListener("mousedown",d),document.addEventListener("touchstart",d),document.addEventListener("keydown",g),()=>{document.removeEventListener("mousedown",d),document.removeEventListener("touchstart",d),document.removeEventListener("keydown",g)}},[v]);const m=d=>{d.preventDefault(),d.stopPropagation(),h({x:d.clientX,y:d.clientY})};return T.jsxs("div",{className:"group relative cursor-pointer px-3 py-2 hover:bg-hover",role:"button",tabIndex:0,title:"Click to preview",onClick:()=>l(t),onKeyDown:d=>{(d.key==="Enter"||d.key===" ")&&(d.preventDefault(),l(t))},onContextMenu:m,children:[T.jsx("button",{type:"button",className:"absolute right-3 top-1/2 -translate-y-1/2 text-xs text-muted opacity-0 hover:text-primary group-hover:opacity-100",title:"Resume directly",onClick:d=>{d.stopPropagation(),a(t.sessionId)},children:"▶"}),T.jsxs("div",{className:"flex flex-col gap-0.5 pl-2.5 group-hover:pr-4",children:[T.jsxs("div",{className:"flex items-center gap-2",children:[T.jsx(Cc,{agentType:t.agentType,className:"h-3.5 w-3.5 shrink-0 text-muted"}),T.jsx("span",{className:"min-w-0 flex-1 truncate text-sm font-medium text-primary",children:f}),t.lastResumeError&&T.jsx(fC,{className:"h-3 w-3 shrink-0 text-amber-500","aria-label":"Resume failed",title:`Last resume failed: ${t.lastResumeError}`}),t.isPinned&&T.jsx(Ol,{className:"h-3 w-3 shrink-0 text-muted","aria-label":"Pinned",title:"Pinned - will auto-resume on server restart"}),_&&T.jsx("span",{className:"shrink-0 text-[11px] font-mono text-muted",title:t.sessionId,children:_}),T.jsx("span",{className:"ml-1 w-8 shrink-0 text-right text-xs tabular-nums text-muted",children:o})]}),(u||p)&&T.jsxs("div",{className:"flex flex-wrap items-center gap-1 pl-[1.375rem]",children:[u&&T.jsx(dw,{name:c,fullPath:t.projectPath}),p&&T.jsxs("span",{className:"truncate text-xs italic text-muted",children:['"',t.lastUserMessage.length>200?t.lastUserMessage.slice(0,200)+"…":t.lastUserMessage,'"']})]})]}),v&&T.jsxs("div",{ref:y,className:"fixed z-50 min-w-[160px] rounded-md border border-border bg-elevated shadow-lg py-1",style:{left:v.x,top:v.y},role:"menu",children:[s&&T.jsxs("button",{onClick:d=>{d.stopPropagation(),h(null),s(t.sessionId,!t.isPinned)},className:"w-full px-3 py-2 text-left text-sm text-secondary hover:bg-hover hover:text-primary flex items-center gap-2",role:"menuitem",title:t.isPinned?"Remove from auto-resume list":"Auto-resume on server restart",children:[T.jsx(Ol,{width:14,height:14}),t.isPinned?"Unpin":"Pin"]}),t.logFilePath&&T.jsxs("button",{onClick:d=>{d.stopPropagation(),h(null),t.logFilePath&&uw(t.logFilePath)},className:"w-full px-3 py-2 text-left text-sm text-secondary hover:bg-hover hover:text-primary flex items-center gap-2",role:"menuitem",title:t.logFilePath,children:[T.jsx(iy,{width:14,height:14}),"Copy Log Path"]})]})]})});function RR({name:e,className:t=""}){const r=hw(`host:${e}`);return T.jsx("span",{className:`inline-flex items-center rounded-full px-1.5 py-0.5 text-[10px] font-medium uppercase leading-none tracking-wide ${t}`,style:r,title:e,children:e})}function DR({hosts:e,selectedHosts:t,onSelect:r,statuses:n=[]}){const[i,a]=E.useState(!1),l=E.useId(),s=E.useRef(null),o=E.useMemo(()=>new Set(t),[t]),c=E.useMemo(()=>new Map(n.map(_=>[_.host,_])),[n]),f=E.useMemo(()=>t.length===0?"All Hosts":t.join(", "),[t]),u=E.useMemo(()=>t.length===0?"All Hosts":t.length===1?t[0]:`${t.length} hosts`,[t]);E.useEffect(()=>{if(!i||typeof document>"u"||!document.addEventListener||!document.removeEventListener)return;const _=v=>{var m;const h=v.target;h&&((m=s.current)!=null&&m.contains(h))||a(!1)},y=v=>{v.key==="Escape"&&a(!1)};return document.addEventListener("mousedown",_),document.addEventListener("touchstart",_,{passive:!0}),document.addEventListener("keydown",y),()=>{document.removeEventListener("mousedown",_),document.removeEventListener("touchstart",_),document.removeEventListener("keydown",y)}},[i]);const p=_=>{const y=new Set(o);y.has(_)?y.delete(_):y.add(_);const v=e.filter(h=>y.has(h));r(v)};return T.jsxs("div",{ref:s,className:"relative",children:[T.jsxs("button",{type:"button","aria-haspopup":"menu","aria-expanded":i,"aria-controls":l,"aria-label":"Filter by host",onClick:()=>a(_=>!_),className:"flex h-6 max-w-[9rem] items-center gap-1 rounded border border-border bg-base px-2 text-[11px] text-primary hover:bg-hover focus:border-accent focus:outline-none",title:f,children:[T.jsx("span",{className:"truncate",children:u}),T.jsx(pf,{className:"h-3 w-3 shrink-0 text-muted"})]}),i&&T.jsxs("div",{id:l,role:"menu",className:"absolute right-0 z-20 mt-1 w-48 rounded border border-border bg-surface p-2 text-xs shadow-lg",children:[T.jsxs("label",{role:"menuitemcheckbox","aria-checked":t.length===0,className:"flex cursor-pointer items-center gap-2 rounded px-2 py-1.5 text-primary hover:bg-hover",children:[T.jsx("input",{type:"checkbox",checked:t.length===0,onChange:()=>r([]),className:"h-3.5 w-3.5 accent-approval"}),T.jsx("span",{children:"All Hosts"})]}),T.jsx("div",{className:"my-2 h-px bg-border"}),e.length===0?T.jsx("div",{className:"px-2 py-1 text-muted",children:"No hosts"}):T.jsx("div",{className:"max-h-48 overflow-y-auto pr-1",children:e.map(_=>{const y=c.get(_),v=y?!y.ok:!1;return T.jsxs("label",{role:"menuitemcheckbox","aria-checked":o.has(_),className:"flex cursor-pointer items-center gap-2 rounded px-2 py-1.5 text-primary hover:bg-hover",title:y!=null&&y.error?`${_}: ${y.error}`:_,children:[T.jsx("input",{type:"checkbox",checked:o.has(_),onChange:()=>p(_),className:"h-3.5 w-3.5 accent-approval"}),T.jsx("span",{className:"truncate",children:_}),v&&T.jsx("span",{className:"ml-auto text-[10px] uppercase text-danger",children:"offline"})]},_)})})]})]})}function MR({projects:e,selectedProjects:t,onSelect:r,hasHiddenPermissions:n}){const[i,a]=E.useState(!1),l=E.useId(),s=E.useRef(null),o=E.useMemo(()=>mR(e),[e]),c=E.useMemo(()=>new Set(t),[t]),f=n&&t.length>0,u=E.useMemo(()=>t.length===0?"All Projects":t.map(y=>o.get(y)??_s(y)??y).join(", "),[o,t]),p=E.useMemo(()=>{if(t.length===0)return"All Projects";if(t.length===1){const y=t[0];return o.get(y)??_s(y)??y}return`${t.length} projects`},[o,t]);E.useEffect(()=>{if(!i||typeof document>"u"||!document.addEventListener||!document.removeEventListener)return;const y=h=>{var d;const m=h.target;m&&((d=s.current)!=null&&d.contains(m))||a(!1)},v=h=>{h.key==="Escape"&&a(!1)};return document.addEventListener("mousedown",y),document.addEventListener("touchstart",y,{passive:!0}),document.addEventListener("keydown",v),()=>{document.removeEventListener("mousedown",y),document.removeEventListener("touchstart",y),document.removeEventListener("keydown",v)}},[i]);const _=y=>{const v=new Set(c);v.has(y)?v.delete(y):v.add(y);const h=e.filter(m=>v.has(m));r(h)};return T.jsxs("div",{ref:s,className:"relative",children:[T.jsxs("button",{type:"button","aria-haspopup":"menu","aria-expanded":i,"aria-controls":l,"aria-label":"Filter by project",onClick:()=>a(y=>!y),className:"flex h-6 max-w-[11rem] items-center gap-1 rounded border border-border bg-base px-2 text-[11px] text-primary hover:bg-hover focus:border-accent focus:outline-none",title:u,children:[T.jsx("span",{className:"truncate",children:p}),T.jsx(pf,{className:"h-3 w-3 shrink-0 text-muted"})]}),i&&T.jsxs("div",{id:l,role:"menu",className:"absolute right-0 z-20 mt-1 w-60 rounded border border-border bg-surface p-2 text-xs shadow-lg",children:[T.jsxs("label",{className:"flex cursor-pointer items-center gap-2 rounded px-2 py-1.5 text-primary hover:bg-hover",children:[T.jsx("input",{type:"checkbox",checked:t.length===0,onChange:()=>r([]),className:"h-3.5 w-3.5 accent-approval"}),T.jsx("span",{children:"All Projects"})]}),T.jsx("div",{className:"my-2 h-px bg-border"}),e.length===0?T.jsx("div",{className:"px-2 py-1 text-muted",children:"No projects"}):T.jsx("div",{className:"max-h-48 overflow-y-auto pr-1",children:e.map(y=>{const v=o.get(y)??_s(y)??y;return T.jsxs("label",{className:"flex cursor-pointer items-center gap-2 rounded px-2 py-1.5 text-primary hover:bg-hover",title:y,children:[T.jsx("input",{type:"checkbox",checked:c.has(y),onChange:()=>_(y),className:"h-3.5 w-3.5 accent-approval"}),T.jsx("span",{className:"truncate",children:v})]},y)})})]}),f&&T.jsx("button",{type:"button",className:"absolute -right-1 -top-1 h-2 w-2 rounded-full bg-approval pulse-approval ring-2 ring-elevated",title:"Hidden sessions need attention","aria-label":"Clear project filters",onClick:y=>{y.stopPropagation(),r([])},children:T.jsx("span",{className:"sr-only",children:"Clear project filters"})})]})}const Gl=new Set(["tool_result","custom_tool_call_output"]),AR=new Set(["text","input_text","output_text"]);function Xr(e){return!e||typeof e!="object"?null:e}function At(e){return typeof e=="string"?e:null}function Wo(e){return e==="user"?"user":e==="assistant"?"assistant":e==="system"||e==="developer"?"system":e==="tool"?"tool":"other"}function PR(e){const t=At(e.type)??"",r=Xr(e.payload),n=At(r==null?void 0:r.type)??"",i=At(e.source)??At(r==null?void 0:r.source)??"",a=At(e.agent)??"";return i.toLowerCase()==="pi"||a.toLowerCase()==="pi"?"pi":t==="response_item"||t==="event_msg"?"codex":t==="tool_use"||t==="result"||t==="user"||t==="assistant"||t==="system"?"claude":n==="user_message"||n==="assistant_message"?"codex":"unknown"}function IR(e){const t=Xr(e.payload),r=At(t==null?void 0:t.type);return{family:PR(e),rawType:At(e.type)??"unknown",...r?{payloadType:r}:{}}}function bt(e){if(!e)return[];if(typeof e=="string")return e.trim()?[e]:[];if(Array.isArray(e)){const r=[];for(const n of e){if(typeof n=="string"){n.trim()&&r.push(n);continue}const i=Xr(n);if(!i)continue;const a=At(i.type);if(a&&Gl.has(a)||a&&!AR.has(a))continue;const l=At(i.text);l&&l.trim()&&r.push(l)}return r}const t=Xr(e);if(t){const r=At(t.type);if(r&&Gl.has(r))return[];const n=At(t.text);return n&&n.trim()?[n]:[...bt(t.content),...bt(t.message)]}return[]}function OR(e,t){if(e.type!=="response_item")return[];const r=Xr(e.payload);if(!r||r.type!=="message")return[];const n=Wo(r.role);return bt(r.content).map(i=>({kind:"message",role:n,text:i,source:t}))}function BR(e,t){if(e.type!=="event_msg")return[];const r=Xr(e.payload);if(!r)return[];const n=At(r.type);let i=null;if(n==="user_message"?i="user":n==="assistant_message"?i="assistant":n==="system_message"?i="system":n==="message"&&(i=Wo(r.role)),!i||!["user","assistant","system"].includes(i))return[];const a=Array.from(new Set([...bt(r.message),...bt(r.content),...bt(r.text)]));return a.length===0?[]:a.map(l=>({kind:"message",role:i,text:l,source:t}))}function NR(e,t){const r=Wo(e.type),n=Xr(e.message);if(n){const a=Wo(n.role??e.type);return[...bt(n.content),...bt(n.text),...bt(n.message)].map(s=>({kind:"message",role:a,text:s,source:t}))}return["user","assistant","system"].includes(r)?[...bt(e.content),...bt(e.text)].map(a=>({kind:"message",role:r,text:a,source:t})):[]}function jR(e,t){const r=Wo(e.role);return["user","assistant","system"].includes(r)?[...bt(e.content),...bt(e.message),...bt(e.text)].map(i=>({kind:"message",role:r,text:i,source:t})):[]}function FR(e,t){const r=At(e.type),n=At(e.event);return r!=="tool_use"&&n!=="tool_use"?[]:[{kind:"tool_call",role:"assistant",text:`[Tool: ${At(e.name)??"tool"}]`,source:t}]}function HR(e,t){if(e.type!=="result")return[];const r=At(e.result);return!r||!r.trim()?[]:[{kind:"result",role:"system",text:r,source:t}]}function $R(e,t){const r=Xr(e.payload),n=[...bt(e.message),...bt(e.content),...bt(e.text),...bt(r==null?void 0:r.message),...bt(r==null?void 0:r.content)];return n.length===0?[]:n.map(i=>({kind:"unknown",role:"other",text:i,source:t}))}function zR(e,t){const r=At(e.type),n=Xr(e.payload),i=At(n==null?void 0:n.type);return r&&Gl.has(r)||i&&Gl.has(i)?[{kind:"tool_result",role:"tool",text:"",source:t}]:[]}function UR(e){const t=Xr(e);if(!t)return[];const r=IR(t),n=[...OR(t,r),...BR(t,r),...NR(t,r),...FR(t,r),...HR(t,r),...zR(t,r)];if(n.length>0)return n;const i=jR(t,r);return i.length>0?i:$R(t,r)}function WR(e){const t=e.trim();if(!t)return null;try{const r=JSON.parse(t);return{parsed:!0,events:UR(r),raw:r}}catch{return{parsed:!1,events:[{kind:"unknown",role:"other",text:t,source:{family:"unknown",rawType:"raw_text"}}],raw:e}}}function VR(e){return e==="user"?"user":e==="assistant"?"assistant":e==="system"?"system":"other"}function KR(e){const t=WR(e);if(!t)return[];const r=t.events.map(n=>({type:VR(n.role),content:n.text.trim(),raw:e})).filter(n=>n.content.length>0);return r.length>0?r:!t.parsed&&e.trim()?[{type:"other",content:e.trim(),raw:e}]:[]}function GR({session:e,onClose:t,onResume:r}){const[n,i]=E.useState(!0),[a,l]=E.useState(null),[s,o]=E.useState(null),[c,f]=E.useState(!1),u=E.useRef(null),p=E.useRef(null);E.useEffect(()=>{(async()=>{try{const m=await fetch(`/api/session-preview/${e.sessionId}`);if(!m.ok){const g=await m.json();throw new Error(g.error||"Failed to load preview")}const d=await m.json();o(d)}catch(m){l(m instanceof Error?m.message:"Failed to load preview")}finally{i(!1)}})()},[e.sessionId]),E.useEffect(()=>{u.current&&s&&(u.current.scrollTop=u.current.scrollHeight)},[s,c]),E.useEffect(()=>{const h=m=>{m.key==="Escape"?(m.stopPropagation(),t()):m.key==="Enter"&&!n&&!a&&(m.preventDefault(),r(e.sessionId))};return window.addEventListener("keydown",h),()=>window.removeEventListener("keydown",h)},[t,r,e.sessionId,n,a]),E.useEffect(()=>{var h;(h=p.current)==null||h.focus()},[]);const _=e.displayName||_s(e.projectPath)||e.sessionId.slice(0,8),y=sp(e.lastActivityAt),v=(s==null?void 0:s.lines.flatMap(KR).slice(-30))??[];return T.jsx("div",{role:"dialog","aria-modal":"true","aria-labelledby":"preview-title",className:"fixed inset-0 z-50 flex items-center justify-center bg-black/60 p-4",onClick:h=>{h.target===h.currentTarget&&t()},children:T.jsxs("div",{ref:p,tabIndex:-1,className:"flex max-h-[80vh] w-full max-w-2xl flex-col border border-border bg-elevated",children:[T.jsxs("div",{className:"flex items-center gap-3 border-b border-border px-4 py-3",children:[T.jsx(Cc,{agentType:e.agentType,className:"h-5 w-5 shrink-0 text-muted"}),T.jsxs("div",{className:"min-w-0 flex-1",children:[T.jsx("h2",{id:"preview-title",className:"truncate text-sm font-semibold text-primary",children:_}),T.jsxs("p",{className:"truncate text-xs text-muted",title:e.projectPath,children:[_s(e.projectPath)," · ",y]})]}),T.jsx("button",{type:"button",onClick:()=>f(h=>!h),className:`btn text-xs ${c?"btn-primary":""}`,children:c?"Parsed":"Raw"})]}),T.jsxs("div",{ref:u,className:"flex-1 overflow-y-auto p-4 font-mono text-xs",children:[n&&T.jsx("div",{className:"flex items-center justify-center py-8 text-muted",children:"Loading preview..."}),a&&T.jsx("div",{className:"flex items-center justify-center py-8 text-danger",children:a}),s&&!c&&T.jsx("div",{className:"space-y-2",children:v.length===0?T.jsx("div",{className:"py-8 text-center text-muted",children:"No readable content found. Try raw view."}):v.map((h,m)=>T.jsx("div",{className:`rounded px-2 py-1 ${h.type==="user"?"bg-blue-500/10 text-blue-400":h.type==="assistant"?"bg-emerald-500/10 text-emerald-400":h.type==="system"?"bg-yellow-500/10 text-yellow-400":"text-muted"}`,children:T.jsx("span",{className:"whitespace-pre-wrap break-words",children:h.content.length>500?`${h.content.slice(0,500)}...`:h.content})},m))}),s&&c&&T.jsx("div",{className:"space-y-1",children:s.lines.slice(-50).map((h,m)=>T.jsx("div",{className:"whitespace-pre-wrap break-all text-muted",children:h||" "},m))})]}),T.jsxs("div",{className:"flex items-center justify-end gap-2 border-t border-border px-4 py-3",children:[T.jsx("button",{type:"button",onClick:t,className:"btn",children:"Cancel"}),T.jsx("button",{type:"button",onClick:()=>r(e.sessionId),disabled:n||!!a,className:"btn btn-primary",children:"Resume"})]})]})})}const dv={working:"bg-green-500/20 text-green-600",waiting:"bg-zinc-500/20 text-zinc-400",permission:"bg-amber-500/20 text-amber-600",unknown:"bg-zinc-500/20 text-zinc-400"};function qR(){const[,e]=E.useState(0);E.useEffect(()=>{const t=setInterval(()=>e(r=>r+1),3e4);return()=>clearInterval(t)},[])}function fw({sessions:e,inactiveSessions:t=[],selectedSessionId:r,loading:n,error:i,onSelect:a,onRename:l,onResume:s,onKill:o,onDuplicate:c,onSetPinned:f}){qR();const u=E.useMemo(()=>typeof navigator>"u"?!1:/^((?!chrome|android).)*safari/i.test(navigator.userAgent),[]),[p,_]=E.useState(null),y=me(q=>q.inactiveSessionsExpanded),v=me(q=>q.setInactiveSessionsExpanded),[h,m]=E.useState(null),[d,g]=E.useState(20),w=$1(),b=u&&!w;E.useEffect(()=>{y||g(20)},[y]);const x=200,[C,S]=hv(e.length,x),[k,L]=hv(t.length,x,!0),A=E.useRef(new Set(e.map(q=>q.id))),M=E.useRef(new Set(t.map(q=>q.sessionId))),[D,O]=E.useState(new Set);E.useEffect(()=>{var _e;const q=new Set(e.map(re=>re.id)),de=new Set(t.map(re=>re.sessionId)),X=new Set;for(const re of q)A.current.has(re)||X.add(re);for(const re of e){const le=(_e=re.agentSessionId)==null?void 0:_e.trim();le&&M.current.has(le)&&!de.has(le)&&X.add(re.id)}A.current=q,M.current=de,X.size>0&&O(X)},[e,t]),E.useEffect(()=>{if(D.size===0)return;const q=setTimeout(()=>O(new Set),500);return()=>clearTimeout(q)},[D]);const z=me(q=>q.shortcutModifier),F=ii(ea(z)),H=me(q=>q.sessionSortMode),I=me(q=>q.setSessionSortMode),R=me(q=>q.sessionSortDirection),P=me(q=>q.manualSessionOrder),N=me(q=>q.setManualSessionOrder),j=me(q=>q.showProjectName),W=me(q=>q.showLastUserMessage),V=me(q=>q.showSessionIdPrefix),Z=me(q=>q.projectFilters),Q=me(q=>q.setProjectFilters),$=me(q=>q.hostFilters),B=me(q=>q.setHostFilters),K=Ve(q=>q.exitingSessions),U=Ve(q=>q.clearExitingSession),te=Ve(q=>q.hostStatuses),Y=Ve(q=>q.remoteAllowControl);SR(e,K,U,x),E.useEffect(()=>{if(P.length===0)return;const q=new Set;for(const X of e)q.add(vo(X)),q.add(X.id);for(const X of t)q.add(X.sessionId);const de=P.filter(X=>q.has(X));de.length!==P.length&&N(de)},[e,t,P,N]);const pe=E.useMemo(()=>np(e,{mode:H,direction:R,manualOrder:P}),[e,H,R,P]),ne=E.useMemo(()=>fR(e,t),[e,t]),oe=E.useMemo(()=>{const q=pR(e,t),de=te.map(re=>re.host),X=new Set,_e=[];for(const re of de)!re||X.has(re)||(X.add(re),_e.push(re));for(const re of q)!re||X.has(re)||(X.add(re),_e.push(re));return _e},[e,t,te]),ce=E.useMemo(()=>oe.length>1,[oe]),ue=E.useMemo(()=>{let q=pe;return Z.length>0&&(q=q.filter(de=>Z.includes(de.projectPath))),$.length>0&&(q=q.filter(de=>$.includes(de.host??""))),q},[pe,Z,$]),ve=E.useMemo(()=>{const q=Z.length===0?"all-projects":Z.join("|"),de=$.length===0?"all-hosts":$.join("|");return`${q}::${de}`},[Z,$]),se=E.useRef(new Set(ue.map(q=>q.id))),[ae,fe]=E.useState(new Set);E.useEffect(()=>{const q=new Set(ue.map(X=>X.id)),de=new Set;for(const X of q)se.current.has(X)||D.has(X)||de.add(X);se.current=q,de.size>0&&fe(de)},[ue,D]),E.useEffect(()=>{if(ae.size===0)return;const q=setTimeout(()=>fe(new Set),500);return()=>clearTimeout(q)},[ae]);const ie=E.useMemo(()=>{let q=t;return Z.length>0&&(q=q.filter(de=>Z.includes(de.projectPath))),$.length>0&&(q=q.filter(de=>$.includes(de.host??""))),q},[t,Z,$]),ge=E.useMemo(()=>{if(Z.length===0)return 0;const q=new Set(Z);return e.filter(de=>!q.has(de.projectPath)&&de.status==="permission").length},[e,Z]);E.useEffect(()=>{if(Z.length===0||ne.length===0)return;const q=new Set(ne),de=Z.filter(X=>q.has(X));de.length!==Z.length&&Q(de)},[Z,ne,Q]),E.useEffect(()=>{if($.length===0||oe.length===0)return;const q=new Set(oe),de=$.filter(X=>q.has(X));de.length!==$.length&&B(de)},[$,oe,B]);const be=HL(FL(rp,{activationConstraint:{distance:8}})),[Te,je]=E.useState(null),[He,Pe]=E.useState(null),[Oe,ke]=E.useState(!1),Le=E.useCallback(q=>{je(q.active.id),ke(!0)},[]),Qe=E.useCallback(q=>{var de;Pe((de=q.over)==null?void 0:de.id)},[]),J=E.useCallback(q=>{const{active:de,over:X}=q;if(je(null),Pe(null),!X||de.id===X.id){setTimeout(()=>ke(!1),100);return}const _e=ue.findIndex(Me=>Me.id===de.id),re=ue.findIndex(Me=>Me.id===X.id);if(_e===-1||re===-1){setTimeout(()=>ke(!1),100);return}const le=ue.map(Me=>vo(Me)),[we]=le.splice(_e,1);le.splice(re,0,we);const De=pe.map(Me=>vo(Me)),$e=new Set(le);let Ue=0;const Ie=De.map(Me=>{if(!$e.has(Me))return Me;const et=le[Ue];return Ue+=1,et});H!=="manual"&&I("manual"),N(Ie),setTimeout(()=>ke(!1),100)},[ue,pe,H,I,N]),ee=E.useCallback(()=>{je(null),Pe(null),setTimeout(()=>ke(!1),100)},[]);E.useEffect(()=>{if(!Te&&!He)return;const q=new Set(ue.map(X=>X.id));let de=!1;Te&&!q.has(Te)&&(je(null),de=!0),He&&!q.has(He)&&(Pe(null),de=!0),de&&ke(!1)},[ue,Te,He]);const Be=(q,de)=>{l(q,de),_(null)};return T.jsxs("aside",{className:"flex min-h-0 flex-1 flex-col border-r border-border bg-elevated",children:[i&&T.jsx("div",{className:"shrink-0 border-b border-danger/30 bg-danger/10 px-3 py-2 text-xs text-danger",children:i}),T.jsxs("div",{className:"min-h-0 flex-1 overflow-y-auto",children:[T.jsxs("div",{className:"sticky top-0 z-10 flex h-10 items-center justify-between border-b border-border bg-elevated px-3",children:[T.jsx("span",{className:"text-xs font-medium uppercase tracking-wider text-muted",children:"Sessions"}),T.jsxs("div",{className:"flex items-center gap-4",children:[ce&&T.jsx(DR,{hosts:oe,selectedHosts:$,onSelect:B,statuses:te}),T.jsx(MR,{projects:ne,selectedProjects:Z,onSelect:Q,hasHiddenPermissions:ge>0}),T.jsx(Qh.span,{className:"w-8 text-right text-xs text-muted",animate:C&&!w?{scale:[1,1.3,1]}:{},transition:{duration:.3},onAnimationComplete:S,children:ue.length})]})]}),n?T.jsx("div",{className:"space-y-1 p-2",children:[0,1,2].map(q=>T.jsx("div",{className:"h-14 animate-pulse rounded bg-surface"},q))}):ue.length===0?T.jsx("div",{className:"px-3 py-6 text-center text-xs text-muted",children:"No sessions"}):T.jsx(WT,{sensors:be,collisionDetection:VL,onDragStart:Le,onDragOver:Qe,onDragEnd:J,onDragCancel:ee,children:T.jsx(nR,{items:ue.map(q=>q.id),strategy:tR,children:T.jsx("div",{children:T.jsx(q5,{initial:!1,mode:b?"sync":"popLayout",children:ue.map((q,de)=>{const X=D.has(q.id),_e=ae.has(q.id),re=q.remote===!0,le=q.source==="managed",we=!re||Y&&le,De=Te?ue.findIndex(Me=>Me.id===Te):-1,Ue=He===q.id&&Te!==q.id?De>de?"above":"below":null,Ie=X||_e;return T.jsx(pw,{session:q,isNew:Ie,exitDuration:x,prefersReducedMotion:w,useSafariLayoutFallback:b,layoutAnimationsDisabled:Oe,isSelected:q.id===r,isEditing:q.id===p,showSessionIdPrefix:V,showProjectName:j,showLastUserMessage:W,showHostInfo:ce,dropIndicator:Ue,onSelect:()=>a(q.id),onStartEdit:we?()=>_(q.id):void 0,onCancelEdit:()=>_(null),onRename:Me=>Be(q.id,Me),onKill:o&&we?()=>o(q.id):void 0,onDuplicate:c&&we?()=>c(q.id):void 0,onSetPinned:f&&q.agentSessionId?Me=>f(q.agentSessionId.trim(),Me):void 0},q.id)})})},ve)})}),ie.length>0&&T.jsxs("div",{className:"border-t border-border",children:[T.jsxs("button",{type:"button",onClick:()=>v(!y),className:"flex w-full items-center justify-between px-3 py-2 text-left text-xs font-medium uppercase tracking-wider text-muted hover:text-primary",children:[T.jsxs("span",{className:"flex items-center gap-2",children:[y?T.jsx(pf,{className:"h-4 w-4"}):T.jsx(gC,{className:"h-4 w-4"}),"Inactive Sessions"]}),T.jsx(Qh.span,{className:"w-8 text-right text-xs",animate:k&&!w?{scale:[1,1.3,1]}:{},transition:{duration:.3},onAnimationComplete:L,children:ie.length})]}),y&&T.jsxs("div",{className:"py-1",children:[ie.slice(0,d).map(q=>T.jsx(TR,{session:q,showSessionIdPrefix:V,showProjectName:j,showLastUserMessage:W,onResume:de=>s==null?void 0:s(de),onPreview:m,onSetPinned:f},q.sessionId)),ie.length>d&&T.jsxs("button",{type:"button",onClick:()=>g(q=>q+20),className:"w-full px-3 py-2 text-center text-xs text-muted hover:text-primary hover:bg-hover",children:["Show more (",ie.length-d," remaining)"]})]})]})]}),T.jsx("div",{className:"hidden shrink-0 border-t border-border px-3 py-2 md:block",children:T.jsxs("div",{className:"flex flex-wrap gap-x-3 gap-y-0.5 text-[10px] text-muted",children:[T.jsxs("span",{children:[F,"[ ] nav"]}),T.jsxs("span",{children:[F,"N new"]}),T.jsxs("span",{children:[F,"X kill"]})]})}),h&&T.jsx(GR,{session:h,onClose:()=>m(null),onResume:q=>{m(null),s==null||s(q)}})]})}const pw=E.forwardRef(function({session:t,isNew:r,exitDuration:n,prefersReducedMotion:i,useSafariLayoutFallback:a,layoutAnimationsDisabled:l,isSelected:s,isEditing:o,showSessionIdPrefix:c,showProjectName:f,showLastUserMessage:u,showHostInfo:p,dropIndicator:_,onSelect:y,onStartEdit:v,onCancelEdit:h,onRename:m,onKill:d,onDuplicate:g,onSetPinned:w},b){const{attributes:x,listeners:C,setNodeRef:S,transform:k,transition:L,isDragging:A}=uR({id:t.id,animateLayoutChanges:({isSorting:F,wasDragging:H})=>F||H}),M=zo.Transform.toString(k),O={...!!(i&&M)?{transform:M,transition:L}:{},zIndex:A?10:void 0,opacity:A?.9:void 0},z=E.useCallback(F=>{S(F),typeof b=="function"?b(F):b&&(b.current=F)},[S,b]);return T.jsxs(Qh.div,{ref:z,style:{...O,overflow:"hidden"},className:"relative",layout:!i&&!A&&!l&&!r?!a:!1,transformTemplate:(F,H)=>gR({useSafariLayoutFallback:a,isDragging:A,dndTransform:M,generatedTransform:H}),initial:i||!r?!1:a?{opacity:0}:{opacity:0,scale:.97},animate:i?{opacity:1}:r?a?{opacity:1}:{opacity:1,scale:[1.02,.99,1]}:{opacity:1,scale:1},exit:i?{opacity:0}:a?{opacity:0,height:0}:{opacity:0,height:0,scale:.97},transition:i?{duration:0}:a?{opacity:{duration:n/1e3},height:{duration:n/1e3,ease:"easeOut"}}:{layout:{type:"spring",stiffness:500,damping:35},opacity:{duration:n/1e3},scale:{duration:n/1e3,ease:[.34,1.56,.64,1]},height:{duration:n/1e3,ease:"easeOut"}},...x,...C,children:[_==="above"&&T.jsx("div",{className:"absolute -top-px left-3 right-3 h-0.5 border-t-2 border-dashed border-accent"}),T.jsx(XR,{session:t,isSelected:s,isEditing:o,showSessionIdPrefix:c,showProjectName:f,showLastUserMessage:u,showHostInfo:p,isDragging:A,onSelect:y,onStartEdit:v,onCancelEdit:h,onRename:m,onKill:d,onDuplicate:g,onSetPinned:w}),_==="below"&&T.jsx("div",{className:"absolute -bottom-px left-3 right-3 h-0.5 border-t-2 border-dashed border-accent"})]})});pw.displayName="SortableSessionItem";function XR({session:e,isSelected:t,isEditing:r,showSessionIdPrefix:n,showProjectName:i,showLastUserMessage:a,showHostInfo:l,isDragging:s=!1,onSelect:o,onStartEdit:c,onCancelEdit:f,onRename:u,onKill:p,onDuplicate:_,onSetPinned:y}){var Q,$,B,K;const v=sp(e.lastActivity),h=E.useRef(null),m=E.useRef(null),d=((Q=e.agentSessionName)==null?void 0:Q.trim())||(($=e.name)==null?void 0:$.trim())||e.id,[g,w]=E.useState(d),b=E.useRef(null),[x,C]=E.useState(null),S=_s(e.projectPath),k=(B=e.host)==null?void 0:B.trim(),L=e.status==="permission",A=(K=e.agentSessionId)==null?void 0:K.trim(),M=n&&A?cw(A):"",D=i&&!!S,O=l&&!!k,z=a&&!!e.lastUserMessage,F=E.useRef(e.status),[H,I]=E.useState(!1);E.useEffect(()=>{const U=F.current,te=e.status;U==="working"&&te==="waiting"?I(!0):F.current=te},[e.status]);const R=()=>{I(!1),F.current=e.status};E.useEffect(()=>{r&&h.current&&(h.current.focus(),h.current.select())},[r]),E.useEffect(()=>{w(d)},[d]);const P=()=>{const U=g.trim();U&&U!==d?u(U):f()},N=U=>{U.key==="Enter"?(U.preventDefault(),P()):U.key==="Escape"&&(U.preventDefault(),w(d),f())},j=E.useRef(null),W=U=>{if(s)return;const te=U.touches[0];j.current={x:te.clientX,y:te.clientY},b.current=setTimeout(()=>{j.current&&C(j.current)},500)},V=()=>{b.current&&(clearTimeout(b.current),b.current=null)};E.useEffect(()=>{if(!x)return;const U=Y=>{m.current&&!m.current.contains(Y.target)&&C(null)},te=Y=>{Y.key==="Escape"&&C(null)};return document.addEventListener("mousedown",U),document.addEventListener("touchstart",U),document.addEventListener("keydown",te),()=>{document.removeEventListener("mousedown",U),document.removeEventListener("touchstart",U),document.removeEventListener("keydown",te)}},[x]);const Z=U=>{U.preventDefault(),U.stopPropagation(),C({x:U.clientX,y:U.clientY})};return T.jsxs("div",{className:`session-row group cursor-pointer select-none px-3 py-2 ${t?"selected":""} ${s?"cursor-grabbing shadow-lg ring-1 ring-accent/30 bg-elevated":"cursor-grab"}`,role:"button",tabIndex:0,"data-testid":"session-card","data-session-id":e.id,onClick:s?void 0:o,onKeyDown:U=>{(U.key==="Enter"||U.key===" ")&&o()},onContextMenu:Z,onTouchStart:W,onTouchEnd:V,onTouchCancel:V,children:[T.jsxs("div",{className:"flex flex-col gap-0.5 pl-0.5",children:[T.jsxs("div",{className:"flex items-center gap-2",children:[T.jsx(Cc,{agentType:e.agentType,command:e.command,className:"h-3.5 w-3.5 shrink-0 text-muted"}),r?T.jsx("input",{ref:h,type:"text",value:g,onChange:U=>w(U.target.value),onBlur:P,onKeyDown:N,onClick:U=>U.stopPropagation(),className:"min-w-0 flex-1 rounded border border-border bg-surface px-1.5 py-0.5 text-sm font-medium text-primary outline-none focus:border-accent"}):T.jsx("span",{className:"min-w-0 flex-1 truncate text-sm font-medium text-primary",children:d}),e.isPinned&&T.jsx(Ol,{className:"h-3 w-3 shrink-0 text-primary","aria-label":"Pinned",title:"Pinned - will auto-resume on server restart"}),M&&T.jsx("span",{className:"shrink-0 text-[11px] font-mono text-muted",title:A,children:M}),L?T.jsx("span",{className:`ml-1 flex shrink-0 items-center justify-center rounded-full px-1.5 py-0.5 ${dv[e.status]} pulse-approval`,onAnimationEnd:R,children:T.jsx(LC,{className:"h-3 w-3","aria-label":"Needs input"})}):T.jsx("span",{className:`ml-1 shrink-0 rounded-full px-1.5 py-0.5 text-right text-xs tabular-nums ${dv[e.status]}${H?" pulse-complete":""}`,onAnimationEnd:R,children:v})]}),(D||O||z)&&T.jsxs("div",{className:"flex flex-wrap items-center gap-1 pl-[1.375rem]",children:[O&&T.jsx(RR,{name:k}),D&&T.jsx(dw,{name:S,fullPath:e.projectPath}),z&&T.jsxs("span",{className:"line-clamp-2 text-xs italic text-muted",children:['"',e.lastUserMessage.length>200?e.lastUserMessage.slice(0,200)+"…":e.lastUserMessage,'"']})]})]}),x&&T.jsxs("div",{ref:m,className:"fixed z-50 min-w-[160px] rounded-md border border-border bg-elevated shadow-lg py-1",style:{left:x.x,top:x.y},role:"menu",children:[c&&T.jsxs("button",{onClick:U=>{U.stopPropagation(),C(null),c()},className:"w-full px-3 py-2 text-left text-sm text-secondary hover:bg-hover hover:text-primary flex items-center gap-2",role:"menuitem",children:[T.jsx(sy,{width:14,height:14}),"Rename"]}),_&&T.jsxs("button",{onClick:U=>{U.stopPropagation(),C(null),_()},className:"w-full px-3 py-2 text-left text-sm text-secondary hover:bg-hover hover:text-primary flex items-center gap-2",role:"menuitem",title:"Create a copy in a new tmux window",children:[T.jsx(ny,{width:14,height:14}),"Duplicate"]}),y&&T.jsxs("button",{onClick:U=>{U.stopPropagation(),C(null),y(!e.isPinned)},className:"w-full px-3 py-2 text-left text-sm text-secondary hover:bg-hover hover:text-primary flex items-center gap-2",role:"menuitem",title:e.isPinned?"Remove from auto-resume list":"Auto-resume on server restart",children:[T.jsx(Ol,{width:14,height:14}),e.isPinned?"Unpin":"Pin"]}),e.logFilePath&&T.jsxs("button",{onClick:U=>{U.stopPropagation(),C(null),e.logFilePath&&uw(e.logFilePath)},className:"w-full px-3 py-2 text-left text-sm text-secondary hover:bg-hover hover:text-primary flex items-center gap-2",role:"menuitem",title:e.logFilePath,children:[T.jsx(iy,{width:14,height:14}),"Copy Log Path"]}),p&&T.jsxs(T.Fragment,{children:[T.jsx("div",{className:"my-1 border-t border-border"}),T.jsxs("button",{onClick:U=>{U.stopPropagation(),C(null),p()},className:"w-full px-3 py-2 text-left text-sm text-danger hover:bg-danger/10 flex items-center gap-2",role:"menuitem",children:[T.jsx(Dh,{width:14,height:14}),"Kill Session"]})]})]})]})}const sd={debug:0,info:1,warn:2,error:3};let mw="info";function YR(e){const t=e.toLowerCase();t in sd&&(mw=t)}function Ge(e,t,r="debug"){if(!(sd[r]<sd[mw]))try{fetch("/api/client-log",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({event:e,data:t,level:r})}).catch(()=>{})}catch{}}var gw={exports:{}};(function(e,t){(function(r,n){e.exports=n()})(globalThis,()=>(()=>{var r={4567:function(l,s,o){var c=this&&this.__decorate||function(d,g,w,b){var x,C=arguments.length,S=C<3?g:b===null?b=Object.getOwnPropertyDescriptor(g,w):b;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")S=Reflect.decorate(d,g,w,b);else for(var k=d.length-1;k>=0;k--)(x=d[k])&&(S=(C<3?x(S):C>3?x(g,w,S):x(g,w))||S);return C>3&&S&&Object.defineProperty(g,w,S),S},f=this&&this.__param||function(d,g){return function(w,b){g(w,b,d)}};Object.defineProperty(s,"__esModule",{value:!0}),s.AccessibilityManager=void 0;const u=o(9042),p=o(9924),_=o(844),y=o(4725),v=o(2585),h=o(3656);let m=s.AccessibilityManager=class extends _.Disposable{constructor(d,g,w,b){super(),this._terminal=d,this._coreBrowserService=w,this._renderService=b,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 x=0;x<this._terminal.rows;x++)this._rowElements[x]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[x]);if(this._topBoundaryFocusListener=x=>this._handleBoundaryFocus(x,0),this._bottomBoundaryFocusListener=x=>this._handleBoundaryFocus(x,1),this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions(),this._accessibilityContainer.appendChild(this._rowContainer),this._liveRegion=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 p.TimeBasedDebouncer(this._renderRows.bind(this))),!this._terminal.element)throw new Error("Cannot enable accessibility before Terminal.open");this._terminal.element.insertAdjacentElement("afterbegin",this._accessibilityContainer),this.register(this._terminal.onResize(x=>this._handleResize(x.rows))),this.register(this._terminal.onRender(x=>this._refreshRows(x.start,x.end))),this.register(this._terminal.onScroll(()=>this._refreshRows())),this.register(this._terminal.onA11yChar(x=>this._handleChar(x))),this.register(this._terminal.onLineFeed(()=>this._handleChar(`
|
|
53
53
|
`))),this.register(this._terminal.onA11yTab(x=>this._handleTab(x))),this.register(this._terminal.onKey(x=>this._handleKey(x.key))),this.register(this._terminal.onBlur(()=>this._clearLiveRegion())),this.register(this._renderService.onDimensionsChange(()=>this._refreshRowsDimensions())),this.register((0,h.addDisposableDomListener)(document,"selectionchange",()=>this._handleSelectionChange())),this.register(this._coreBrowserService.onDprChange(()=>this._refreshRowsDimensions())),this._refreshRows(),this.register((0,_.toDisposable)(()=>{this._accessibilityContainer.remove(),this._rowElements.length=0}))}_handleTab(d){for(let g=0;g<d;g++)this._handleChar(" ")}_handleChar(d){this._liveRegionLineCount<21&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==d&&(this._charsToAnnounce+=d):this._charsToAnnounce+=d,d===`
|
|
54
54
|
`&&(this._liveRegionLineCount++,this._liveRegionLineCount===21&&(this._liveRegion.textContent+=u.tooMuchOutput)))}_clearLiveRegion(){this._liveRegion.textContent="",this._liveRegionLineCount=0}_handleKey(d){this._clearLiveRegion(),new RegExp("\\p{Control}","u").test(d)||this._charsToConsume.push(d)}_refreshRows(d,g){this._liveRegionDebouncer.refresh(d,g,this._terminal.rows)}_renderRows(d,g){const w=this._terminal.buffer,b=w.lines.length.toString();for(let x=d;x<=g;x++){const C=w.lines.get(w.ydisp+x),S=[],k=(C==null?void 0:C.translateToString(!0,void 0,void 0,S))||"",L=(w.ydisp+x+1).toString(),A=this._rowElements[x];A&&(k.length===0?(A.innerText=" ",this._rowColumns.set(A,[0,1])):(A.textContent=k,this._rowColumns.set(A,S)),A.setAttribute("aria-posinset",L),A.setAttribute("aria-setsize",b))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(d,g){const w=d.target,b=this._rowElements[g===0?1:this._rowElements.length-2];if(w.getAttribute("aria-posinset")===(g===0?"1":`${this._terminal.buffer.lines.length}`)||d.relatedTarget!==b)return;let x,C;if(g===0?(x=w,C=this._rowElements.pop(),this._rowContainer.removeChild(C)):(x=this._rowElements.shift(),C=w,this._rowContainer.removeChild(x)),x.removeEventListener("focus",this._topBoundaryFocusListener),C.removeEventListener("focus",this._bottomBoundaryFocusListener),g===0){const S=this._createAccessibilityTreeNode();this._rowElements.unshift(S),this._rowContainer.insertAdjacentElement("afterbegin",S)}else{const S=this._createAccessibilityTreeNode();this._rowElements.push(S),this._rowContainer.appendChild(S)}this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._terminal.scrollLines(g===0?-1:1),this._rowElements[g===0?1:this._rowElements.length-2].focus(),d.preventDefault(),d.stopImmediatePropagation()}_handleSelectionChange(){var k;if(this._rowElements.length===0)return;const d=document.getSelection();if(!d)return;if(d.isCollapsed)return void(this._rowContainer.contains(d.anchorNode)&&this._terminal.clearSelection());if(!d.anchorNode||!d.focusNode)return void console.error("anchorNode and/or focusNode are null");let g={node:d.anchorNode,offset:d.anchorOffset},w={node:d.focusNode,offset:d.focusOffset};if((g.node.compareDocumentPosition(w.node)&Node.DOCUMENT_POSITION_PRECEDING||g.node===w.node&&g.offset>w.offset)&&([g,w]=[w,g]),g.node.compareDocumentPosition(this._rowElements[0])&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_FOLLOWING)&&(g={node:this._rowElements[0].childNodes[0],offset:0}),!this._rowContainer.contains(g.node))return;const b=this._rowElements.slice(-1)[0];if(w.node.compareDocumentPosition(b)&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_PRECEDING)&&(w={node:b,offset:((k=b.textContent)==null?void 0:k.length)??0}),!this._rowContainer.contains(w.node))return;const x=({node:L,offset:A})=>{const M=L instanceof Text?L.parentNode:L;let D=parseInt(M==null?void 0:M.getAttribute("aria-posinset"),10)-1;if(isNaN(D))return console.warn("row is invalid. Race condition?"),null;const O=this._rowColumns.get(M);if(!O)return console.warn("columns is null. Race condition?"),null;let z=A<O.length?O[A]:O.slice(-1)[0]+1;return z>=this._terminal.cols&&(++D,z=0),{row:D,column:z}},C=x(g),S=x(w);if(C&&S){if(C.row>S.row||C.row===S.row&&C.column>=S.column)throw new Error("invalid range");this._terminal.select(C.column,C.row,(S.row-C.row)*this._terminal.cols-C.column+S.column)}}_handleResize(d){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(let g=this._rowContainer.children.length;g<this._terminal.rows;g++)this._rowElements[g]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[g]);for(;this._rowElements.length>d;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){const d=this._coreBrowserService.mainDocument.createElement("div");return d.setAttribute("role","listitem"),d.tabIndex=-1,this._refreshRowDimensions(d),d}_refreshRowsDimensions(){if(this._renderService.dimensions.css.cell.height){this._accessibilityContainer.style.width=`${this._renderService.dimensions.css.canvas.width}px`,this._rowElements.length!==this._terminal.rows&&this._handleResize(this._terminal.rows);for(let d=0;d<this._terminal.rows;d++)this._refreshRowDimensions(this._rowElements[d])}}_refreshRowDimensions(d){d.style.height=`${this._renderService.dimensions.css.cell.height}px`}};s.AccessibilityManager=m=c([f(1,v.IInstantiationService),f(2,y.ICoreBrowserService),f(3,y.IRenderService)],m)},3614:(l,s)=>{function o(p){return p.replace(/\r?\n/g,"\r")}function c(p,_){return _?"\x1B[200~"+p+"\x1B[201~":p}function f(p,_,y,v){p=c(p=o(p),y.decPrivateModes.bracketedPasteMode&&v.rawOptions.ignoreBracketedPasteMode!==!0),y.triggerDataEvent(p,!0),_.value=""}function u(p,_,y){const v=y.getBoundingClientRect(),h=p.clientX-v.left-10,m=p.clientY-v.top-10;_.style.width="20px",_.style.height="20px",_.style.left=`${h}px`,_.style.top=`${m}px`,_.style.zIndex="1000",_.focus()}Object.defineProperty(s,"__esModule",{value:!0}),s.rightClickHandler=s.moveTextAreaUnderMouseCursor=s.paste=s.handlePasteEvent=s.copyHandler=s.bracketTextForPaste=s.prepareTextForTerminal=void 0,s.prepareTextForTerminal=o,s.bracketTextForPaste=c,s.copyHandler=function(p,_){p.clipboardData&&p.clipboardData.setData("text/plain",_.selectionText),p.preventDefault()},s.handlePasteEvent=function(p,_,y,v){p.stopPropagation(),p.clipboardData&&f(p.clipboardData.getData("text/plain"),_,y,v)},s.paste=f,s.moveTextAreaUnderMouseCursor=u,s.rightClickHandler=function(p,_,y,v,h){u(p,_,y),h&&v.rightClickSelect(p),_.value=v.selectionText,_.select()}},7239:(l,s,o)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.ColorContrastCache=void 0;const c=o(1505);s.ColorContrastCache=class{constructor(){this._color=new c.TwoKeyMap,this._css=new c.TwoKeyMap}setCss(f,u,p){this._css.set(f,u,p)}getCss(f,u){return this._css.get(f,u)}setColor(f,u,p){this._color.set(f,u,p)}getColor(f,u){return this._color.get(f,u)}clear(){this._color.clear(),this._css.clear()}}},3656:(l,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.addDisposableDomListener=void 0,s.addDisposableDomListener=function(o,c,f,u){o.addEventListener(c,f,u);let p=!1;return{dispose:()=>{p||(p=!0,o.removeEventListener(c,f,u))}}}},3551:function(l,s,o){var c=this&&this.__decorate||function(m,d,g,w){var b,x=arguments.length,C=x<3?d:w===null?w=Object.getOwnPropertyDescriptor(d,g):w;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")C=Reflect.decorate(m,d,g,w);else for(var S=m.length-1;S>=0;S--)(b=m[S])&&(C=(x<3?b(C):x>3?b(d,g,C):b(d,g))||C);return x>3&&C&&Object.defineProperty(d,g,C),C},f=this&&this.__param||function(m,d){return function(g,w){d(g,w,m)}};Object.defineProperty(s,"__esModule",{value:!0}),s.Linkifier=void 0;const u=o(3656),p=o(8460),_=o(844),y=o(2585),v=o(4725);let h=s.Linkifier=class extends _.Disposable{get currentLink(){return this._currentLink}constructor(m,d,g,w,b){super(),this._element=m,this._mouseService=d,this._renderService=g,this._bufferService=w,this._linkProviderService=b,this._linkCacheDisposables=[],this._isMouseOut=!0,this._wasResized=!1,this._activeLine=-1,this._onShowLinkUnderline=this.register(new p.EventEmitter),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this.register(new p.EventEmitter),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this.register((0,_.getDisposeArrayDisposable)(this._linkCacheDisposables)),this.register((0,_.toDisposable)(()=>{var x;this._lastMouseEvent=void 0,(x=this._activeProviderReplies)==null||x.clear()})),this.register(this._bufferService.onResize(()=>{this._clearCurrentLink(),this._wasResized=!0})),this.register((0,u.addDisposableDomListener)(this._element,"mouseleave",()=>{this._isMouseOut=!0,this._clearCurrentLink()})),this.register((0,u.addDisposableDomListener)(this._element,"mousemove",this._handleMouseMove.bind(this))),this.register((0,u.addDisposableDomListener)(this._element,"mousedown",this._handleMouseDown.bind(this))),this.register((0,u.addDisposableDomListener)(this._element,"mouseup",this._handleMouseUp.bind(this)))}_handleMouseMove(m){this._lastMouseEvent=m;const d=this._positionFromMouseEvent(m,this._element,this._mouseService);if(!d)return;this._isMouseOut=!1;const g=m.composedPath();for(let w=0;w<g.length;w++){const b=g[w];if(b.classList.contains("xterm"))break;if(b.classList.contains("xterm-hover"))return}this._lastBufferCell&&d.x===this._lastBufferCell.x&&d.y===this._lastBufferCell.y||(this._handleHover(d),this._lastBufferCell=d)}_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,d){var w,b;this._activeProviderReplies&&d||((w=this._activeProviderReplies)==null||w.forEach(x=>{x==null||x.forEach(C=>{C.link.dispose&&C.link.dispose()})}),this._activeProviderReplies=new Map,this._activeLine=m.y);let g=!1;for(const[x,C]of this._linkProviderService.linkProviders.entries())d?(b=this._activeProviderReplies)!=null&&b.get(x)&&(g=this._checkLinkProviderResult(x,m,g)):C.provideLinks(m.y,S=>{var L,A;if(this._isMouseOut)return;const k=S==null?void 0:S.map(M=>({link:M}));(L=this._activeProviderReplies)==null||L.set(x,k),g=this._checkLinkProviderResult(x,m,g),((A=this._activeProviderReplies)==null?void 0:A.size)===this._linkProviderService.linkProviders.length&&this._removeIntersectingLinks(m.y,this._activeProviderReplies)})}_removeIntersectingLinks(m,d){const g=new Set;for(let w=0;w<d.size;w++){const b=d.get(w);if(b)for(let x=0;x<b.length;x++){const C=b[x],S=C.link.range.start.y<m?0:C.link.range.start.x,k=C.link.range.end.y>m?this._bufferService.cols:C.link.range.end.x;for(let L=S;L<=k;L++){if(g.has(L)){b.splice(x--,1);break}g.add(L)}}}}_checkLinkProviderResult(m,d,g){var x;if(!this._activeProviderReplies)return g;const w=this._activeProviderReplies.get(m);let b=!1;for(let C=0;C<m;C++)this._activeProviderReplies.has(C)&&!this._activeProviderReplies.get(C)||(b=!0);if(!b&&w){const C=w.find(S=>this._linkAtPosition(S.link,d));C&&(g=!0,this._handleNewLink(C))}if(this._activeProviderReplies.size===this._linkProviderService.linkProviders.length&&!g)for(let C=0;C<this._activeProviderReplies.size;C++){const S=(x=this._activeProviderReplies.get(C))==null?void 0:x.find(k=>this._linkAtPosition(k.link,d));if(S){g=!0,this._handleNewLink(S);break}}return g}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(m){if(!this._currentLink)return;const d=this._positionFromMouseEvent(m,this._element,this._mouseService);d&&this._mouseDownLink===this._currentLink&&this._linkAtPosition(this._currentLink.link,d)&&this._currentLink.link.activate(m,this._currentLink.link.text)}_clearCurrentLink(m,d){this._currentLink&&this._lastMouseEvent&&(!m||!d||this._currentLink.link.range.start.y>=m&&this._currentLink.link.range.end.y<=d)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,(0,_.disposeArray)(this._linkCacheDisposables))}_handleNewLink(m){if(!this._lastMouseEvent)return;const d=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);d&&this._linkAtPosition(m.link,d)&&(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 g,w;return(w=(g=this._currentLink)==null?void 0:g.state)==null?void 0:w.decorations.pointerCursor},set:g=>{var w;(w=this._currentLink)!=null&&w.state&&this._currentLink.state.decorations.pointerCursor!==g&&(this._currentLink.state.decorations.pointerCursor=g,this._currentLink.state.isHovered&&this._element.classList.toggle("xterm-cursor-pointer",g))}},underline:{get:()=>{var g,w;return(w=(g=this._currentLink)==null?void 0:g.state)==null?void 0:w.decorations.underline},set:g=>{var w,b,x;(w=this._currentLink)!=null&&w.state&&((x=(b=this._currentLink)==null?void 0:b.state)==null?void 0:x.decorations.underline)!==g&&(this._currentLink.state.decorations.underline=g,this._currentLink.state.isHovered&&this._fireUnderlineEvent(m.link,g))}}}),this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange(g=>{if(!this._currentLink)return;const w=g.start===0?0:g.start+1+this._bufferService.buffer.ydisp,b=this._bufferService.buffer.ydisp+1+g.end;if(this._currentLink.link.range.start.y>=w&&this._currentLink.link.range.end.y<=b&&(this._clearCurrentLink(w,b),this._lastMouseEvent)){const x=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);x&&this._askForLink(x,!1)}})))}_linkHover(m,d,g){var w;(w=this._currentLink)!=null&&w.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(d,!0),this._currentLink.state.decorations.pointerCursor&&m.classList.add("xterm-cursor-pointer")),d.hover&&d.hover(g,d.text)}_fireUnderlineEvent(m,d){const g=m.range,w=this._bufferService.buffer.ydisp,b=this._createLinkUnderlineEvent(g.start.x-1,g.start.y-w-1,g.end.x,g.end.y-w-1,void 0);(d?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(b)}_linkLeave(m,d,g){var w;(w=this._currentLink)!=null&&w.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(d,!1),this._currentLink.state.decorations.pointerCursor&&m.classList.remove("xterm-cursor-pointer")),d.leave&&d.leave(g,d.text)}_linkAtPosition(m,d){const g=m.range.start.y*this._bufferService.cols+m.range.start.x,w=m.range.end.y*this._bufferService.cols+m.range.end.x,b=d.y*this._bufferService.cols+d.x;return g<=b&&b<=w}_positionFromMouseEvent(m,d,g){const w=g.getCoords(m,d,this._bufferService.cols,this._bufferService.rows);if(w)return{x:w[0],y:w[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(m,d,g,w,b){return{x1:m,y1:d,x2:g,y2:w,cols:this._bufferService.cols,fg:b}}};s.Linkifier=h=c([f(1,v.IMouseService),f(2,v.IRenderService),f(3,y.IBufferService),f(4,v.ILinkProviderService)],h)},9042:(l,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.tooMuchOutput=s.promptLabel=void 0,s.promptLabel="Terminal input",s.tooMuchOutput="Too much output to announce, navigate to rows manually to read"},3730:function(l,s,o){var c=this&&this.__decorate||function(v,h,m,d){var g,w=arguments.length,b=w<3?h:d===null?d=Object.getOwnPropertyDescriptor(h,m):d;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")b=Reflect.decorate(v,h,m,d);else for(var x=v.length-1;x>=0;x--)(g=v[x])&&(b=(w<3?g(b):w>3?g(h,m,b):g(h,m))||b);return w>3&&b&&Object.defineProperty(h,m,b),b},f=this&&this.__param||function(v,h){return function(m,d){h(m,d,v)}};Object.defineProperty(s,"__esModule",{value:!0}),s.OscLinkProvider=void 0;const u=o(511),p=o(2585);let _=s.OscLinkProvider=class{constructor(v,h,m){this._bufferService=v,this._optionsService=h,this._oscLinkService=m}provideLinks(v,h){var k;const m=this._bufferService.buffer.lines.get(v-1);if(!m)return void h(void 0);const d=[],g=this._optionsService.rawOptions.linkHandler,w=new u.CellData,b=m.getTrimmedLength();let x=-1,C=-1,S=!1;for(let L=0;L<b;L++)if(C!==-1||m.hasContent(L)){if(m.loadCell(L,w),w.hasExtendedAttrs()&&w.extended.urlId){if(C===-1){C=L,x=w.extended.urlId;continue}S=w.extended.urlId!==x}else C!==-1&&(S=!0);if(S||C!==-1&&L===b-1){const A=(k=this._oscLinkService.getLinkData(x))==null?void 0:k.uri;if(A){const M={start:{x:C+1,y:v},end:{x:L+(S||L!==b-1?0:1),y:v}};let D=!1;if(!(g!=null&&g.allowNonHttpProtocols))try{const O=new URL(A);["http:","https:"].includes(O.protocol)||(D=!0)}catch{D=!0}D||d.push({text:A,range:M,activate:(O,z)=>g?g.activate(O,z,M):y(0,z),hover:(O,z)=>{var F;return(F=g==null?void 0:g.hover)==null?void 0:F.call(g,O,z,M)},leave:(O,z)=>{var F;return(F=g==null?void 0:g.leave)==null?void 0:F.call(g,O,z,M)}})}S=!1,w.hasExtendedAttrs()&&w.extended.urlId?(C=L,x=w.extended.urlId):(C=-1,x=-1)}}h(d)}};function y(v,h){if(confirm(`Do you want to navigate to ${h}?
|
|
55
55
|
|
|
56
|
-
WARNING: This link could potentially be dangerous`)){const m=window.open();if(m){try{m.opener=null}catch{}m.location.href=h}else console.warn("Opening link blocked as opener could not be cleared")}}s.OscLinkProvider=_=c([f(0,p.IBufferService),f(1,p.IOptionsService),f(2,p.IOscLinkService)],_)},6193:(l,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.RenderDebouncer=void 0,s.RenderDebouncer=class{constructor(o,c){this._renderCallback=o,this._coreBrowserService=c,this._refreshCallbacks=[]}dispose(){this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}addRefreshCallback(o){return this._refreshCallbacks.push(o),this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._innerRefresh())),this._animationFrame}refresh(o,c,f){this._rowCount=f,o=o!==void 0?o:0,c=c!==void 0?c:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,o):o,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 o=Math.max(this._rowStart,0),c=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(o,c),this._runRefreshCallbacks()}_runRefreshCallbacks(){for(const o of this._refreshCallbacks)o(0);this._refreshCallbacks=[]}}},3236:(l,s,o)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.Terminal=void 0;const c=o(3614),f=o(3656),u=o(3551),p=o(9042),_=o(3730),y=o(1680),v=o(3107),h=o(5744),m=o(2950),d=o(1296),g=o(428),w=o(4269),b=o(5114),x=o(8934),C=o(3230),S=o(9312),k=o(4725),L=o(6731),A=o(8055),M=o(8969),D=o(8460),O=o(844),z=o(6114),F=o(8437),H=o(2584),I=o(7399),R=o(5941),P=o(9074),N=o(2585),j=o(5435),W=o(4567),V=o(779);class Z extends M.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($={}){super($),this.browser=z,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this.register(new O.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(P.DecorationService),this._instantiationService.setService(N.IDecorationService,this._decorationService),this._linkProviderService=this._instantiationService.createInstance(V.LinkProviderService),this._instantiationService.setService(k.ILinkProviderService,this._linkProviderService),this._linkProviderService.registerLinkProvider(this._instantiationService.createInstance(_.OscLinkProvider)),this.register(this._inputHandler.onRequestBell(()=>this._onBell.fire())),this.register(this._inputHandler.onRequestRefreshRows((B,G)=>this.refresh(B,G))),this.register(this._inputHandler.onRequestSendFocus(()=>this._reportFocus())),this.register(this._inputHandler.onRequestReset(()=>this.reset())),this.register(this._inputHandler.onRequestWindowsOptionsReport(B=>this._reportWindowsOptions(B))),this.register(this._inputHandler.onColor(B=>this._handleColorEvent(B))),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(B=>this._afterResize(B.cols,B.rows))),this.register((0,O.toDisposable)(()=>{var B,G;this._customKeyEventHandler=void 0,(G=(B=this.element)==null?void 0:B.parentNode)==null||G.removeChild(this.element)}))}_handleColorEvent($){if(this._themeService)for(const B of $){let G,U="";switch(B.index){case 256:G="foreground",U="10";break;case 257:G="background",U="11";break;case 258:G="cursor",U="12";break;default:G="ansi",U="4;"+B.index}switch(B.type){case 0:const te=A.color.toColorRGB(G==="ansi"?this._themeService.colors.ansi[B.index]:this._themeService.colors[G]);this.coreService.triggerDataEvent(`${H.C0.ESC}]${U};${(0,R.toRgbString)(te)}${H.C1_ESCAPED.ST}`);break;case 1:if(G==="ansi")this._themeService.modifyColors(Y=>Y.ansi[B.index]=A.channels.toColor(...B.color));else{const Y=G;this._themeService.modifyColors(_e=>_e[Y]=A.channels.toColor(...B.color))}break;case 2:this._themeService.restoreColor(B.index)}}}_setup(){super._setup(),this._customKeyEventHandler=void 0}get buffer(){return this.buffers.active}focus(){this.textarea&&this.textarea.focus({preventScroll:!0})}_handleScreenReaderModeOptionChange($){$?!this._accessibilityManager.value&&this._renderService&&(this._accessibilityManager.value=this._instantiationService.createInstance(W.AccessibilityManager,this)):this._accessibilityManager.clear()}_handleTextAreaFocus($){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(H.C0.ESC+"[I"),this.element.classList.add("focus"),this._showCursor(),this._onFocus.fire()}blur(){var $;return($=this.textarea)==null?void 0:$.blur()}_handleTextAreaBlur(){this.textarea.value="",this.refresh(this.buffer.y,this.buffer.y),this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(H.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 $=this.buffer.ybase+this.buffer.y,B=this.buffer.lines.get($);if(!B)return;const G=Math.min(this.buffer.x,this.cols-1),U=this._renderService.dimensions.css.cell.height,te=B.getWidth(G),Y=this._renderService.dimensions.css.cell.width*te,_e=this.buffer.y*this._renderService.dimensions.css.cell.height,fe=G*this._renderService.dimensions.css.cell.width;this.textarea.style.left=fe+"px",this.textarea.style.top=_e+"px",this.textarea.style.width=Y+"px",this.textarea.style.height=U+"px",this.textarea.style.lineHeight=U+"px",this.textarea.style.zIndex="-5"}_initGlobal(){this._bindKeys(),this.register((0,f.addDisposableDomListener)(this.element,"copy",B=>{this.hasSelection()&&(0,c.copyHandler)(B,this._selectionService)}));const $=B=>(0,c.handlePasteEvent)(B,this.textarea,this.coreService,this.optionsService);this.register((0,f.addDisposableDomListener)(this.textarea,"paste",$)),this.register((0,f.addDisposableDomListener)(this.element,"paste",$)),z.isFirefox?this.register((0,f.addDisposableDomListener)(this.element,"mousedown",B=>{B.button===2&&(0,c.rightClickHandler)(B,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})):this.register((0,f.addDisposableDomListener)(this.element,"contextmenu",B=>{(0,c.rightClickHandler)(B,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})),z.isLinux&&this.register((0,f.addDisposableDomListener)(this.element,"auxclick",B=>{B.button===1&&(0,c.moveTextAreaUnderMouseCursor)(B,this.textarea,this.screenElement)}))}_bindKeys(){this.register((0,f.addDisposableDomListener)(this.textarea,"keyup",$=>this._keyUp($),!0)),this.register((0,f.addDisposableDomListener)(this.textarea,"keydown",$=>this._keyDown($),!0)),this.register((0,f.addDisposableDomListener)(this.textarea,"keypress",$=>this._keyPress($),!0)),this.register((0,f.addDisposableDomListener)(this.textarea,"compositionstart",()=>this._compositionHelper.compositionstart())),this.register((0,f.addDisposableDomListener)(this.textarea,"compositionupdate",$=>this._compositionHelper.compositionupdate($))),this.register((0,f.addDisposableDomListener)(this.textarea,"compositionend",()=>this._compositionHelper.compositionend())),this.register((0,f.addDisposableDomListener)(this.textarea,"input",$=>this._inputEvent($),!0)),this.register(this.onRender(()=>this._compositionHelper.updateCompositionElements()))}open($){var G;if(!$)throw new Error("Terminal requires a parent element.");if($.isConnected||this._logService.debug("Terminal.open was called on an element that was not attached to the DOM"),((G=this.element)==null?void 0:G.ownerDocument.defaultView)&&this._coreBrowserService)return void(this.element.ownerDocument.defaultView!==this._coreBrowserService.window&&(this._coreBrowserService.window=this.element.ownerDocument.defaultView));this._document=$.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"),$.appendChild(this.element);const B=this._document.createDocumentFragment();this._viewportElement=this._document.createElement("div"),this._viewportElement.classList.add("xterm-viewport"),B.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,f.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),B.appendChild(this.screenElement),this.textarea=this._document.createElement("textarea"),this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",p.promptLabel),z.isChromeOS||this.textarea.setAttribute("aria-multiline","false"),this.textarea.setAttribute("autocorrect","off"),this.textarea.setAttribute("autocapitalize","off"),this.textarea.setAttribute("spellcheck","false"),this.textarea.tabIndex=0,this._coreBrowserService=this.register(this._instantiationService.createInstance(b.CoreBrowserService,this.textarea,$.ownerDocument.defaultView??window,this._document??typeof window<"u"?window.document:null)),this._instantiationService.setService(k.ICoreBrowserService,this._coreBrowserService),this.register((0,f.addDisposableDomListener)(this.textarea,"focus",U=>this._handleTextAreaFocus(U))),this.register((0,f.addDisposableDomListener)(this.textarea,"blur",()=>this._handleTextAreaBlur())),this._helperContainer.appendChild(this.textarea),this._charSizeService=this._instantiationService.createInstance(g.CharSizeService,this._document,this._helperContainer),this._instantiationService.setService(k.ICharSizeService,this._charSizeService),this._themeService=this._instantiationService.createInstance(L.ThemeService),this._instantiationService.setService(k.IThemeService,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(w.CharacterJoinerService),this._instantiationService.setService(k.ICharacterJoinerService,this._characterJoinerService),this._renderService=this.register(this._instantiationService.createInstance(C.RenderService,this.rows,this.screenElement)),this._instantiationService.setService(k.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(x.MouseService),this._instantiationService.setService(k.IMouseService,this._mouseService),this.linkifier=this.register(this._instantiationService.createInstance(u.Linkifier,this.screenElement)),this.element.appendChild(B);try{this._onWillOpen.fire(this.element)}catch{}this._renderService.hasRenderer()||this._renderService.setRenderer(this._createRenderer()),this.viewport=this._instantiationService.createInstance(y.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(S.SelectionService,this.element,this.screenElement,this.linkifier)),this._instantiationService.setService(k.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,f.addDisposableDomListener)(this._viewportElement,"scroll",()=>this._selectionService.refresh())),this.register(this._instantiationService.createInstance(v.BufferDecorationRenderer,this.screenElement)),this.register((0,f.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(W.AccessibilityManager,this)),this.register(this.optionsService.onSpecificOptionChange("screenReaderMode",U=>this._handleScreenReaderModeOptionChange(U))),this.options.overviewRulerWidth&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(h.OverviewRulerRenderer,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRulerWidth",U=>{!this._overviewRulerRenderer&&U&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(h.OverviewRulerRenderer,this._viewportElement,this.screenElement)))}),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()}_createRenderer(){return this._instantiationService.createInstance(d.DomRenderer,this,this._document,this.element,this.screenElement,this._viewportElement,this._helperContainer,this.linkifier)}bindMouse(){const $=this,B=this.element;function G(Y){const _e=$._mouseService.getMouseReportCoords(Y,$.screenElement);if(!_e)return!1;let fe,re;switch(Y.overrideType||Y.type){case"mousemove":re=32,Y.buttons===void 0?(fe=3,Y.button!==void 0&&(fe=Y.button<3?Y.button:3)):fe=1&Y.buttons?0:4&Y.buttons?1:2&Y.buttons?2:3;break;case"mouseup":re=0,fe=Y.button<3?Y.button:3;break;case"mousedown":re=1,fe=Y.button<3?Y.button:3;break;case"wheel":if($._customWheelEventHandler&&$._customWheelEventHandler(Y)===!1||$.viewport.getLinesScrolled(Y)===0)return!1;re=Y.deltaY<0?0:1,fe=4;break;default:return!1}return!(re===void 0||fe===void 0||fe>4)&&$.coreMouseService.triggerMouseEvent({col:_e.col,row:_e.row,x:_e.x,y:_e.y,button:fe,action:re,ctrl:Y.ctrlKey,alt:Y.altKey,shift:Y.shiftKey})}const U={mouseup:null,wheel:null,mousedrag:null,mousemove:null},te={mouseup:Y=>(G(Y),Y.buttons||(this._document.removeEventListener("mouseup",U.mouseup),U.mousedrag&&this._document.removeEventListener("mousemove",U.mousedrag)),this.cancel(Y)),wheel:Y=>(G(Y),this.cancel(Y,!0)),mousedrag:Y=>{Y.buttons&&G(Y)},mousemove:Y=>{Y.buttons||G(Y)}};this.register(this.coreMouseService.onProtocolChange(Y=>{Y?(this.optionsService.rawOptions.logLevel==="debug"&&this._logService.debug("Binding to mouse events:",this.coreMouseService.explainEvents(Y)),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&Y?U.mousemove||(B.addEventListener("mousemove",te.mousemove),U.mousemove=te.mousemove):(B.removeEventListener("mousemove",U.mousemove),U.mousemove=null),16&Y?U.wheel||(B.addEventListener("wheel",te.wheel,{passive:!1}),U.wheel=te.wheel):(B.removeEventListener("wheel",U.wheel),U.wheel=null),2&Y?U.mouseup||(U.mouseup=te.mouseup):(this._document.removeEventListener("mouseup",U.mouseup),U.mouseup=null),4&Y?U.mousedrag||(U.mousedrag=te.mousedrag):(this._document.removeEventListener("mousemove",U.mousedrag),U.mousedrag=null)})),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this.register((0,f.addDisposableDomListener)(B,"mousedown",Y=>{if(Y.preventDefault(),this.focus(),this.coreMouseService.areMouseEventsActive&&!this._selectionService.shouldForceSelection(Y))return G(Y),U.mouseup&&this._document.addEventListener("mouseup",U.mouseup),U.mousedrag&&this._document.addEventListener("mousemove",U.mousedrag),this.cancel(Y)})),this.register((0,f.addDisposableDomListener)(B,"wheel",Y=>{if(!U.wheel){if(this._customWheelEventHandler&&this._customWheelEventHandler(Y)===!1)return!1;if(!this.buffer.hasScrollback){const _e=this.viewport.getLinesScrolled(Y);if(_e===0)return;const fe=H.C0.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(Y.deltaY<0?"A":"B");let re="";for(let le=0;le<Math.abs(_e);le++)re+=fe;return this.coreService.triggerDataEvent(re,!0),this.cancel(Y,!0)}return this.viewport.handleWheel(Y)?this.cancel(Y):void 0}},{passive:!1})),this.register((0,f.addDisposableDomListener)(B,"touchstart",Y=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchStart(Y),this.cancel(Y)},{passive:!0})),this.register((0,f.addDisposableDomListener)(B,"touchmove",Y=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchMove(Y)?void 0:this.cancel(Y)},{passive:!1}))}refresh($,B){var G;(G=this._renderService)==null||G.refreshRows($,B)}updateCursorStyle($){var B;(B=this._selectionService)!=null&&B.shouldColumnSelect($)?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($,B,G=0){var U;G===1?(super.scrollLines($,B,G),this.refresh(0,this.rows-1)):(U=this.viewport)==null||U.scrollLines($)}paste($){(0,c.paste)($,this.textarea,this.coreService,this.optionsService)}attachCustomKeyEventHandler($){this._customKeyEventHandler=$}attachCustomWheelEventHandler($){this._customWheelEventHandler=$}registerLinkProvider($){return this._linkProviderService.registerLinkProvider($)}registerCharacterJoiner($){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");const B=this._characterJoinerService.register($);return this.refresh(0,this.rows-1),B}deregisterCharacterJoiner($){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");this._characterJoinerService.deregister($)&&this.refresh(0,this.rows-1)}get markers(){return this.buffer.markers}registerMarker($){return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+$)}registerDecoration($){return this._decorationService.registerDecoration($)}hasSelection(){return!!this._selectionService&&this._selectionService.hasSelection}select($,B,G){this._selectionService.setSelection($,B,G)}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 $;($=this._selectionService)==null||$.clearSelection()}selectAll(){var $;($=this._selectionService)==null||$.selectAll()}selectLines($,B){var G;(G=this._selectionService)==null||G.selectLines($,B)}_keyDown($){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&this._customKeyEventHandler($)===!1)return!1;const B=this.browser.isMac&&this.options.macOptionIsMeta&&$.altKey;if(!B&&!this._compositionHelper.keydown($))return this.options.scrollOnUserInput&&this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(),!1;B||$.key!=="Dead"&&$.key!=="AltGraph"||(this._unprocessedDeadKey=!0);const G=(0,I.evaluateKeyboardEvent)($,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle($),G.type===3||G.type===2){const U=this.rows-1;return this.scrollLines(G.type===2?-U:U),this.cancel($,!0)}return G.type===1&&this.selectAll(),!!this._isThirdLevelShift(this.browser,$)||(G.cancel&&this.cancel($,!0),!G.key||!!($.key&&!$.ctrlKey&&!$.altKey&&!$.metaKey&&$.key.length===1&&$.key.charCodeAt(0)>=65&&$.key.charCodeAt(0)<=90)||(this._unprocessedDeadKey?(this._unprocessedDeadKey=!1,!0):(G.key!==H.C0.ETX&&G.key!==H.C0.CR||(this.textarea.value=""),this._onKey.fire({key:G.key,domEvent:$}),this._showCursor(),this.coreService.triggerDataEvent(G.key,!0),!this.optionsService.rawOptions.screenReaderMode||$.altKey||$.ctrlKey?this.cancel($,!0):void(this._keyDownHandled=!0))))}_isThirdLevelShift($,B){const G=$.isMac&&!this.options.macOptionIsMeta&&B.altKey&&!B.ctrlKey&&!B.metaKey||$.isWindows&&B.altKey&&B.ctrlKey&&!B.metaKey||$.isWindows&&B.getModifierState("AltGraph");return B.type==="keypress"?G:G&&(!B.keyCode||B.keyCode>47)}_keyUp($){this._keyDownSeen=!1,this._customKeyEventHandler&&this._customKeyEventHandler($)===!1||(function(B){return B.keyCode===16||B.keyCode===17||B.keyCode===18}($)||this.focus(),this.updateCursorStyle($),this._keyPressHandled=!1)}_keyPress($){let B;if(this._keyPressHandled=!1,this._keyDownHandled||this._customKeyEventHandler&&this._customKeyEventHandler($)===!1)return!1;if(this.cancel($),$.charCode)B=$.charCode;else if($.which===null||$.which===void 0)B=$.keyCode;else{if($.which===0||$.charCode===0)return!1;B=$.which}return!(!B||($.altKey||$.ctrlKey||$.metaKey)&&!this._isThirdLevelShift(this.browser,$)||(B=String.fromCharCode(B),this._onKey.fire({key:B,domEvent:$}),this._showCursor(),this.coreService.triggerDataEvent(B,!0),this._keyPressHandled=!0,this._unprocessedDeadKey=!1,0))}_inputEvent($){if($.data&&$.inputType==="insertText"&&(!$.composed||!this._keyDownSeen)&&!this.optionsService.rawOptions.screenReaderMode){if(this._keyPressHandled)return!1;this._unprocessedDeadKey=!1;const B=$.data;return this.coreService.triggerDataEvent(B,!0),this.cancel($),!0}return!1}resize($,B){$!==this.cols||B!==this.rows?super.resize($,B):this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure()}_afterResize($,B){var G,U;(G=this._charSizeService)==null||G.measure(),(U=this.viewport)==null||U.syncScrollArea(!0)}clear(){var $;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 B=1;B<this.rows;B++)this.buffer.lines.push(this.buffer.getBlankLine(F.DEFAULT_ATTR_DATA));this._onScroll.fire({position:this.buffer.ydisp,source:0}),($=this.viewport)==null||$.reset(),this.refresh(0,this.rows-1)}}reset(){var B,G;this.options.rows=this.rows,this.options.cols=this.cols;const $=this._customKeyEventHandler;this._setup(),super.reset(),(B=this._selectionService)==null||B.reset(),this._decorationService.reset(),(G=this.viewport)==null||G.reset(),this._customKeyEventHandler=$,this.refresh(0,this.rows-1)}clearTextureAtlas(){var $;($=this._renderService)==null||$.clearTextureAtlas()}_reportFocus(){var $;($=this.element)!=null&&$.classList.contains("focus")?this.coreService.triggerDataEvent(H.C0.ESC+"[I"):this.coreService.triggerDataEvent(H.C0.ESC+"[O")}_reportWindowsOptions($){if(this._renderService)switch($){case j.WindowsOptionsReportType.GET_WIN_SIZE_PIXELS:const B=this._renderService.dimensions.css.canvas.width.toFixed(0),G=this._renderService.dimensions.css.canvas.height.toFixed(0);this.coreService.triggerDataEvent(`${H.C0.ESC}[4;${G};${B}t`);break;case j.WindowsOptionsReportType.GET_CELL_SIZE_PIXELS:const U=this._renderService.dimensions.css.cell.width.toFixed(0),te=this._renderService.dimensions.css.cell.height.toFixed(0);this.coreService.triggerDataEvent(`${H.C0.ESC}[6;${te};${U}t`)}}cancel($,B){if(this.options.cancelEvents||B)return $.preventDefault(),$.stopPropagation(),!1}}s.Terminal=Z},9924:(l,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.TimeBasedDebouncer=void 0,s.TimeBasedDebouncer=class{constructor(o,c=1e3){this._renderCallback=o,this._debounceThresholdMS=c,this._lastRefreshMs=0,this._additionalRefreshRequested=!1}dispose(){this._refreshTimeoutID&&clearTimeout(this._refreshTimeoutID)}refresh(o,c,f){this._rowCount=f,o=o!==void 0?o:0,c=c!==void 0?c:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,o):o,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,c):c;const u=Date.now();if(u-this._lastRefreshMs>=this._debounceThresholdMS)this._lastRefreshMs=u,this._innerRefresh();else if(!this._additionalRefreshRequested){const p=u-this._lastRefreshMs,_=this._debounceThresholdMS-p;this._additionalRefreshRequested=!0,this._refreshTimeoutID=window.setTimeout(()=>{this._lastRefreshMs=Date.now(),this._innerRefresh(),this._additionalRefreshRequested=!1,this._refreshTimeoutID=void 0},_)}}_innerRefresh(){if(this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return;const o=Math.max(this._rowStart,0),c=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(o,c)}}},1680:function(l,s,o){var c=this&&this.__decorate||function(m,d,g,w){var b,x=arguments.length,C=x<3?d:w===null?w=Object.getOwnPropertyDescriptor(d,g):w;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")C=Reflect.decorate(m,d,g,w);else for(var S=m.length-1;S>=0;S--)(b=m[S])&&(C=(x<3?b(C):x>3?b(d,g,C):b(d,g))||C);return x>3&&C&&Object.defineProperty(d,g,C),C},f=this&&this.__param||function(m,d){return function(g,w){d(g,w,m)}};Object.defineProperty(s,"__esModule",{value:!0}),s.Viewport=void 0;const u=o(3656),p=o(4725),_=o(8460),y=o(844),v=o(2585);let h=s.Viewport=class extends y.Disposable{constructor(m,d,g,w,b,x,C,S){super(),this._viewportElement=m,this._scrollArea=d,this._bufferService=g,this._optionsService=w,this._charSizeService=b,this._renderService=x,this._coreBrowserService=C,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 _.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this.scrollBarWidth=this._viewportElement.offsetWidth-this._scrollArea.offsetWidth||15,this.register((0,u.addDisposableDomListener)(this._viewportElement,"scroll",this._handleScroll.bind(this))),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate(k=>this._activeBuffer=k.activeBuffer)),this._renderDimensions=this._renderService.dimensions,this.register(this._renderService.onDimensionsChange(k=>this._renderDimensions=k)),this._handleThemeChange(S.colors),this.register(S.onChangeColors(k=>this._handleThemeChange(k))),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 d=Math.round(this._currentRowHeight*this._lastRecordedBufferLength)+(this._lastRecordedViewportHeight-this._renderDimensions.css.canvas.height);this._lastRecordedBufferHeight!==d&&(this._lastRecordedBufferHeight=d,this._scrollArea.style.height=this._lastRecordedBufferHeight+"px")}const 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 d=Math.round(this._lastScrollTop/this._currentRowHeight)-this._bufferService.buffer.ydisp;this._onRequestScrollLines.fire({amount:d,suppressScrollEvent:!0})}_smoothScroll(){if(this._isDisposed||this._smoothScrollState.origin===-1||this._smoothScrollState.target===-1)return;const 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,d){const g=this._viewportElement.scrollTop+this._lastRecordedViewportHeight;return!(d<0&&this._viewportElement.scrollTop!==0||d>0&&g<this._lastRecordedBufferHeight)||(m.cancelable&&m.preventDefault(),!1)}handleWheel(m){const d=this._getPixelsScrolled(m);return d!==0&&(this._optionsService.rawOptions.smoothScrollDuration?(this._smoothScrollState.startTime=Date.now(),this._smoothScrollPercent()<1?(this._smoothScrollState.origin=this._viewportElement.scrollTop,this._smoothScrollState.target===-1?this._smoothScrollState.target=this._viewportElement.scrollTop+d:this._smoothScrollState.target+=d,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()):this._viewportElement.scrollTop+=d,this._bubbleScroll(m,d))}scrollLines(m){if(m!==0)if(this._optionsService.rawOptions.smoothScrollDuration){const d=m*this._currentRowHeight;this._smoothScrollState.startTime=Date.now(),this._smoothScrollPercent()<1?(this._smoothScrollState.origin=this._viewportElement.scrollTop,this._smoothScrollState.target=this._smoothScrollState.origin+d,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()}else this._onRequestScrollLines.fire({amount:m,suppressScrollEvent:!1})}_getPixelsScrolled(m){if(m.deltaY===0||m.shiftKey)return 0;let d=this._applyScrollModifier(m.deltaY,m);return m.deltaMode===WheelEvent.DOM_DELTA_LINE?d*=this._currentRowHeight:m.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(d*=this._currentRowHeight*this._bufferService.rows),d}getBufferElements(m,d){var S;let g,w="";const b=[],x=d??this._bufferService.buffer.lines.length,C=this._bufferService.buffer.lines;for(let k=m;k<x;k++){const L=C.get(k);if(!L)continue;const A=(S=C.get(k+1))==null?void 0:S.isWrapped;if(w+=L.translateToString(!A),!A||k===C.length-1){const M=document.createElement("div");M.textContent=w,b.push(M),w.length>0&&(g=M),w=""}}return{bufferElements:b,cursorElement:g}}getLinesScrolled(m){if(m.deltaY===0||m.shiftKey)return 0;let d=this._applyScrollModifier(m.deltaY,m);return m.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(d/=this._currentRowHeight+0,this._wheelPartialScroll+=d,d=Math.floor(Math.abs(this._wheelPartialScroll))*(this._wheelPartialScroll>0?1:-1),this._wheelPartialScroll%=1):m.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(d*=this._bufferService.rows),d}_applyScrollModifier(m,d){const g=this._optionsService.rawOptions.fastScrollModifier;return g==="alt"&&d.altKey||g==="ctrl"&&d.ctrlKey||g==="shift"&&d.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 d=this._lastTouchY-m.touches[0].pageY;return this._lastTouchY=m.touches[0].pageY,d!==0&&(this._viewportElement.scrollTop+=d,this._bubbleScroll(m,d))}};s.Viewport=h=c([f(2,v.IBufferService),f(3,v.IOptionsService),f(4,p.ICharSizeService),f(5,p.IRenderService),f(6,p.ICoreBrowserService),f(7,p.IThemeService)],h)},3107:function(l,s,o){var c=this&&this.__decorate||function(v,h,m,d){var g,w=arguments.length,b=w<3?h:d===null?d=Object.getOwnPropertyDescriptor(h,m):d;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")b=Reflect.decorate(v,h,m,d);else for(var x=v.length-1;x>=0;x--)(g=v[x])&&(b=(w<3?g(b):w>3?g(h,m,b):g(h,m))||b);return w>3&&b&&Object.defineProperty(h,m,b),b},f=this&&this.__param||function(v,h){return function(m,d){h(m,d,v)}};Object.defineProperty(s,"__esModule",{value:!0}),s.BufferDecorationRenderer=void 0;const u=o(4725),p=o(844),_=o(2585);let y=s.BufferDecorationRenderer=class extends p.Disposable{constructor(v,h,m,d,g){super(),this._screenElement=v,this._bufferService=h,this._coreBrowserService=m,this._decorationService=d,this._renderService=g,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(w=>this._removeDecoration(w))),this.register((0,p.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 v of this._decorationService.decorations)this._renderDecoration(v);this._dimensionsChanged=!1}_renderDecoration(v){this._refreshStyle(v),this._dimensionsChanged&&this._refreshXPosition(v)}_createElement(v){var d;const h=this._coreBrowserService.mainDocument.createElement("div");h.classList.add("xterm-decoration"),h.classList.toggle("xterm-decoration-top-layer",((d=v==null?void 0:v.options)==null?void 0:d.layer)==="top"),h.style.width=`${Math.round((v.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,h.style.height=(v.options.height||1)*this._renderService.dimensions.css.cell.height+"px",h.style.top=(v.marker.line-this._bufferService.buffers.active.ydisp)*this._renderService.dimensions.css.cell.height+"px",h.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`;const m=v.options.x??0;return m&&m>this._bufferService.cols&&(h.style.display="none"),this._refreshXPosition(v,h),h}_refreshStyle(v){const h=v.marker.line-this._bufferService.buffers.active.ydisp;if(h<0||h>=this._bufferService.rows)v.element&&(v.element.style.display="none",v.onRenderEmitter.fire(v.element));else{let m=this._decorationElements.get(v);m||(m=this._createElement(v),v.element=m,this._decorationElements.set(v,m),this._container.appendChild(m),v.onDispose(()=>{this._decorationElements.delete(v),m.remove()})),m.style.top=h*this._renderService.dimensions.css.cell.height+"px",m.style.display=this._altBufferIsActive?"none":"block",v.onRenderEmitter.fire(m)}}_refreshXPosition(v,h=v.element){if(!h)return;const m=v.options.x??0;(v.options.anchor||"left")==="right"?h.style.right=m?m*this._renderService.dimensions.css.cell.width+"px":"":h.style.left=m?m*this._renderService.dimensions.css.cell.width+"px":""}_removeDecoration(v){var h;(h=this._decorationElements.get(v))==null||h.remove(),this._decorationElements.delete(v),v.dispose()}};s.BufferDecorationRenderer=y=c([f(1,_.IBufferService),f(2,u.ICoreBrowserService),f(3,_.IDecorationService),f(4,u.IRenderService)],y)},5871:(l,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.ColorZoneStore=void 0,s.ColorZoneStore=class{constructor(){this._zones=[],this._zonePool=[],this._zonePoolIndex=0,this._linePadding={full:0,left:0,center:0,right:0}}get zones(){return this._zonePool.length=Math.min(this._zonePool.length,this._zones.length),this._zones}clear(){this._zones.length=0,this._zonePoolIndex=0}addDecoration(o){if(o.options.overviewRulerOptions){for(const c of this._zones)if(c.color===o.options.overviewRulerOptions.color&&c.position===o.options.overviewRulerOptions.position){if(this._lineIntersectsZone(c,o.marker.line))return;if(this._lineAdjacentToZone(c,o.marker.line,o.options.overviewRulerOptions.position))return void this._addLineToZone(c,o.marker.line)}if(this._zonePoolIndex<this._zonePool.length)return this._zonePool[this._zonePoolIndex].color=o.options.overviewRulerOptions.color,this._zonePool[this._zonePoolIndex].position=o.options.overviewRulerOptions.position,this._zonePool[this._zonePoolIndex].startBufferLine=o.marker.line,this._zonePool[this._zonePoolIndex].endBufferLine=o.marker.line,void this._zones.push(this._zonePool[this._zonePoolIndex++]);this._zones.push({color:o.options.overviewRulerOptions.color,position:o.options.overviewRulerOptions.position,startBufferLine:o.marker.line,endBufferLine:o.marker.line}),this._zonePool.push(this._zones[this._zones.length-1]),this._zonePoolIndex++}}setPadding(o){this._linePadding=o}_lineIntersectsZone(o,c){return c>=o.startBufferLine&&c<=o.endBufferLine}_lineAdjacentToZone(o,c,f){return c>=o.startBufferLine-this._linePadding[f||"full"]&&c<=o.endBufferLine+this._linePadding[f||"full"]}_addLineToZone(o,c){o.startBufferLine=Math.min(o.startBufferLine,c),o.endBufferLine=Math.max(o.endBufferLine,c)}}},5744:function(l,s,o){var c=this&&this.__decorate||function(g,w,b,x){var C,S=arguments.length,k=S<3?w:x===null?x=Object.getOwnPropertyDescriptor(w,b):x;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")k=Reflect.decorate(g,w,b,x);else for(var L=g.length-1;L>=0;L--)(C=g[L])&&(k=(S<3?C(k):S>3?C(w,b,k):C(w,b))||k);return S>3&&k&&Object.defineProperty(w,b,k),k},f=this&&this.__param||function(g,w){return function(b,x){w(b,x,g)}};Object.defineProperty(s,"__esModule",{value:!0}),s.OverviewRulerRenderer=void 0;const u=o(5871),p=o(4725),_=o(844),y=o(2585),v={full:0,left:0,center:0,right:0},h={full:0,left:0,center:0,right:0},m={full:0,left:0,center:0,right:0};let d=s.OverviewRulerRenderer=class extends _.Disposable{get _width(){return this._optionsService.options.overviewRulerWidth||0}constructor(g,w,b,x,C,S,k){var A;super(),this._viewportElement=g,this._screenElement=w,this._bufferService=b,this._decorationService=x,this._renderService=C,this._optionsService=S,this._coreBrowserService=k,this._colorZoneStore=new u.ColorZoneStore,this._shouldUpdateDimensions=!0,this._shouldUpdateAnchor=!0,this._lastKnownBufferLength=0,this._canvas=this._coreBrowserService.mainDocument.createElement("canvas"),this._canvas.classList.add("xterm-decoration-overview-ruler"),this._refreshCanvasDimensions(),(A=this._viewportElement.parentElement)==null||A.insertBefore(this._canvas,this._viewportElement);const L=this._canvas.getContext("2d");if(!L)throw new Error("Ctx cannot be null");this._ctx=L,this._registerDecorationListeners(),this._registerBufferChangeListeners(),this._registerDimensionChangeListeners(),this.register((0,_.toDisposable)(()=>{var M;(M=this._canvas)==null||M.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 g=Math.floor(this._canvas.width/3),w=Math.ceil(this._canvas.width/3);h.full=this._canvas.width,h.left=g,h.center=w,h.right=g,this._refreshDrawHeightConstants(),m.full=0,m.left=0,m.center=h.left,m.right=h.left+h.center}_refreshDrawHeightConstants(){v.full=Math.round(2*this._coreBrowserService.dpr);const g=this._canvas.height/this._bufferService.buffer.lines.length,w=Math.round(Math.max(Math.min(g,12),6)*this._coreBrowserService.dpr);v.left=w,v.center=w,v.right=w}_refreshColorZonePadding(){this._colorZoneStore.setPadding({full:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*v.full),left:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*v.left),center:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*v.center),right:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*v.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 w of this._decorationService.decorations)this._colorZoneStore.addDecoration(w);this._ctx.lineWidth=1;const g=this._colorZoneStore.zones;for(const w of g)w.position!=="full"&&this._renderColorZone(w);for(const w of g)w.position==="full"&&this._renderColorZone(w);this._shouldUpdateDimensions=!1,this._shouldUpdateAnchor=!1}_renderColorZone(g){this._ctx.fillStyle=g.color,this._ctx.fillRect(m[g.position||"full"],Math.round((this._canvas.height-1)*(g.startBufferLine/this._bufferService.buffers.active.lines.length)-v[g.position||"full"]/2),h[g.position||"full"],Math.round((this._canvas.height-1)*((g.endBufferLine-g.startBufferLine)/this._bufferService.buffers.active.lines.length)+v[g.position||"full"]))}_queueRefresh(g,w){this._shouldUpdateDimensions=g||this._shouldUpdateDimensions,this._shouldUpdateAnchor=w||this._shouldUpdateAnchor,this._animationFrame===void 0&&(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>{this._refreshDecorations(),this._animationFrame=void 0}))}};s.OverviewRulerRenderer=d=c([f(2,y.IBufferService),f(3,y.IDecorationService),f(4,p.IRenderService),f(5,y.IOptionsService),f(6,p.ICoreBrowserService)],d)},2950:function(l,s,o){var c=this&&this.__decorate||function(v,h,m,d){var g,w=arguments.length,b=w<3?h:d===null?d=Object.getOwnPropertyDescriptor(h,m):d;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")b=Reflect.decorate(v,h,m,d);else for(var x=v.length-1;x>=0;x--)(g=v[x])&&(b=(w<3?g(b):w>3?g(h,m,b):g(h,m))||b);return w>3&&b&&Object.defineProperty(h,m,b),b},f=this&&this.__param||function(v,h){return function(m,d){h(m,d,v)}};Object.defineProperty(s,"__esModule",{value:!0}),s.CompositionHelper=void 0;const u=o(4725),p=o(2585),_=o(2584);let y=s.CompositionHelper=class{get isComposing(){return this._isComposing}constructor(v,h,m,d,g,w){this._textarea=v,this._compositionView=h,this._bufferService=m,this._optionsService=d,this._coreService=g,this._renderService=w,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(v){this._compositionView.textContent=v.data,this.updateCompositionElements(),setTimeout(()=>{this._compositionPosition.end=this._textarea.value.length},0)}compositionend(){this._finalizeComposition(!0)}keydown(v){if(this._isComposing||this._isSendingComposition){if(v.keyCode===229||v.keyCode===16||v.keyCode===17||v.keyCode===18)return!1;this._finalizeComposition(!1)}return v.keyCode!==229||(this._handleAnyTextareaChanges(),!1)}_finalizeComposition(v){if(this._compositionView.classList.remove("active"),this._isComposing=!1,v){const h={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout(()=>{if(this._isSendingComposition){let m;this._isSendingComposition=!1,h.start+=this._dataAlreadySent.length,m=this._isComposing?this._textarea.value.substring(h.start,h.end):this._textarea.value.substring(h.start),m.length>0&&this._coreService.triggerDataEvent(m,!0)}},0)}else{this._isSendingComposition=!1;const h=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(h,!0)}}_handleAnyTextareaChanges(){const v=this._textarea.value;setTimeout(()=>{if(!this._isComposing){const h=this._textarea.value,m=h.replace(v,"");this._dataAlreadySent=m,h.length>v.length?this._coreService.triggerDataEvent(m,!0):h.length<v.length?this._coreService.triggerDataEvent(`${_.C0.DEL}`,!0):h.length===v.length&&h!==v&&this._coreService.triggerDataEvent(h,!0)}},0)}updateCompositionElements(v){if(this._isComposing){if(this._bufferService.buffer.isCursorInViewport){const h=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1),m=this._renderService.dimensions.css.cell.height,d=this._bufferService.buffer.y*this._renderService.dimensions.css.cell.height,g=h*this._renderService.dimensions.css.cell.width;this._compositionView.style.left=g+"px",this._compositionView.style.top=d+"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 w=this._compositionView.getBoundingClientRect();this._textarea.style.left=g+"px",this._textarea.style.top=d+"px",this._textarea.style.width=Math.max(w.width,1)+"px",this._textarea.style.height=Math.max(w.height,1)+"px",this._textarea.style.lineHeight=w.height+"px"}v||setTimeout(()=>this.updateCompositionElements(!0),0)}}};s.CompositionHelper=y=c([f(2,p.IBufferService),f(3,p.IOptionsService),f(4,p.ICoreService),f(5,u.IRenderService)],y)},9806:(l,s)=>{function o(c,f,u){const p=u.getBoundingClientRect(),_=c.getComputedStyle(u),y=parseInt(_.getPropertyValue("padding-left")),v=parseInt(_.getPropertyValue("padding-top"));return[f.clientX-p.left-y,f.clientY-p.top-v]}Object.defineProperty(s,"__esModule",{value:!0}),s.getCoords=s.getCoordsRelativeToElement=void 0,s.getCoordsRelativeToElement=o,s.getCoords=function(c,f,u,p,_,y,v,h,m){if(!y)return;const d=o(c,f,u);return d?(d[0]=Math.ceil((d[0]+(m?v/2:0))/v),d[1]=Math.ceil(d[1]/h),d[0]=Math.min(Math.max(d[0],1),p+(m?1:0)),d[1]=Math.min(Math.max(d[1],1),_),d):void 0}},9504:(l,s,o)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.moveToCellSequence=void 0;const c=o(2584);function f(h,m,d,g){const w=h-u(h,d),b=m-u(m,d),x=Math.abs(w-b)-function(C,S,k){let L=0;const A=C-u(C,k),M=S-u(S,k);for(let D=0;D<Math.abs(A-M);D++){const O=p(C,S)==="A"?-1:1,z=k.buffer.lines.get(A+O*D);z!=null&&z.isWrapped&&L++}return L}(h,m,d);return v(x,y(p(h,m),g))}function u(h,m){let d=0,g=m.buffer.lines.get(h),w=g==null?void 0:g.isWrapped;for(;w&&h>=0&&h<m.rows;)d++,g=m.buffer.lines.get(--h),w=g==null?void 0:g.isWrapped;return d}function p(h,m){return h>m?"A":"B"}function _(h,m,d,g,w,b){let x=h,C=m,S="";for(;x!==d||C!==g;)x+=w?1:-1,w&&x>b.cols-1?(S+=b.buffer.translateBufferLineToString(C,!1,h,x),x=0,h=0,C++):!w&&x<0&&(S+=b.buffer.translateBufferLineToString(C,!1,0,h+1),x=b.cols-1,h=x,C--);return S+b.buffer.translateBufferLineToString(C,!1,h,x)}function y(h,m){const d=m?"O":"[";return c.C0.ESC+d+h}function v(h,m){h=Math.floor(h);let d="";for(let g=0;g<h;g++)d+=m;return d}s.moveToCellSequence=function(h,m,d,g){const w=d.buffer.x,b=d.buffer.y;if(!d.buffer.hasScrollback)return function(S,k,L,A,M,D){return f(k,A,M,D).length===0?"":v(_(S,k,S,k-u(k,M),!1,M).length,y("D",D))}(w,b,0,m,d,g)+f(b,m,d,g)+function(S,k,L,A,M,D){let O;O=f(k,A,M,D).length>0?A-u(A,M):k;const z=A,F=function(H,I,R,P,N,j){let W;return W=f(R,P,N,j).length>0?P-u(P,N):I,H<R&&W<=P||H>=R&&W<P?"C":"D"}(S,k,L,A,M,D);return v(_(S,O,L,z,F==="C",M).length,y(F,D))}(w,b,h,m,d,g);let x;if(b===m)return x=w>h?"D":"C",v(Math.abs(w-h),y(x,g));x=b>m?"D":"C";const C=Math.abs(b-m);return v(function(S,k){return k.cols-S}(b>m?h:w,d)+(C-1)*d.cols+1+((b>m?w:h)-1),y(x,g))}},1296:function(l,s,o){var c=this&&this.__decorate||function(D,O,z,F){var H,I=arguments.length,R=I<3?O:F===null?F=Object.getOwnPropertyDescriptor(O,z):F;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")R=Reflect.decorate(D,O,z,F);else for(var P=D.length-1;P>=0;P--)(H=D[P])&&(R=(I<3?H(R):I>3?H(O,z,R):H(O,z))||R);return I>3&&R&&Object.defineProperty(O,z,R),R},f=this&&this.__param||function(D,O){return function(z,F){O(z,F,D)}};Object.defineProperty(s,"__esModule",{value:!0}),s.DomRenderer=void 0;const u=o(3787),p=o(2550),_=o(2223),y=o(6171),v=o(6052),h=o(4725),m=o(8055),d=o(8460),g=o(844),w=o(2585),b="xterm-dom-renderer-owner-",x="xterm-rows",C="xterm-fg-",S="xterm-bg-",k="xterm-focus",L="xterm-selection";let A=1,M=s.DomRenderer=class extends g.Disposable{constructor(D,O,z,F,H,I,R,P,N,j,W,V,Z){super(),this._terminal=D,this._document=O,this._element=z,this._screenElement=F,this._viewportElement=H,this._helperContainer=I,this._linkifier2=R,this._charSizeService=N,this._optionsService=j,this._bufferService=W,this._coreBrowserService=V,this._themeService=Z,this._terminalClass=A++,this._rowElements=[],this._selectionRenderModel=(0,v.createSelectionRenderModel)(),this.onRequestRedraw=this.register(new d.EventEmitter).event,this._rowContainer=this._document.createElement("div"),this._rowContainer.classList.add(x),this._rowContainer.style.lineHeight="normal",this._rowContainer.setAttribute("aria-hidden","true"),this._refreshRowElements(this._bufferService.cols,this._bufferService.rows),this._selectionContainer=this._document.createElement("div"),this._selectionContainer.classList.add(L),this._selectionContainer.setAttribute("aria-hidden","true"),this.dimensions=(0,y.createRenderDimensions)(),this._updateDimensions(),this.register(this._optionsService.onOptionChange(()=>this._handleOptionsChanged())),this.register(this._themeService.onChangeColors(Q=>this._injectCss(Q))),this._injectCss(this._themeService.colors),this._rowFactory=P.createInstance(u.DomRendererRowFactory,document),this._element.classList.add(b+this._terminalClass),this._screenElement.appendChild(this._rowContainer),this._screenElement.appendChild(this._selectionContainer),this.register(this._linkifier2.onShowLinkUnderline(Q=>this._handleLinkHover(Q))),this.register(this._linkifier2.onHideLinkUnderline(Q=>this._handleLinkLeave(Q))),this.register((0,g.toDisposable)(()=>{this._element.classList.remove(b+this._terminalClass),this._rowContainer.remove(),this._selectionContainer.remove(),this._widthCache.dispose(),this._themeStyleElement.remove(),this._dimensionsStyleElement.remove()})),this._widthCache=new p.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 z of this._rowElements)z.style.width=`${this.dimensions.css.canvas.width}px`,z.style.height=`${this.dimensions.css.cell.height}px`,z.style.lineHeight=`${this.dimensions.css.cell.height}px`,z.style.overflow="hidden";this._dimensionsStyleElement||(this._dimensionsStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._dimensionsStyleElement));const O=`${this._terminalSelector} .${x} span { display: inline-block; height: 100%; vertical-align: top;}`;this._dimensionsStyleElement.textContent=O,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 O=`${this._terminalSelector} .${x} { color: ${D.foreground.css}; font-family: ${this._optionsService.rawOptions.fontFamily}; font-size: ${this._optionsService.rawOptions.fontSize}px; font-kerning: none; white-space: pre}`;O+=`${this._terminalSelector} .${x} .xterm-dim { color: ${m.color.multiplyOpacity(D.foreground,.5).css};}`,O+=`${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 z=`blink_underline_${this._terminalClass}`,F=`blink_bar_${this._terminalClass}`,H=`blink_block_${this._terminalClass}`;O+=`@keyframes ${z} { 50% { border-bottom-style: hidden; }}`,O+=`@keyframes ${F} { 50% { box-shadow: none; }}`,O+=`@keyframes ${H} { 0% { background-color: ${D.cursor.css}; color: ${D.cursorAccent.css}; } 50% { background-color: inherit; color: ${D.cursor.css}; }}`,O+=`${this._terminalSelector} .${x}.${k} .xterm-cursor.xterm-cursor-blink.xterm-cursor-underline { animation: ${z} 1s step-end infinite;}${this._terminalSelector} .${x}.${k} .xterm-cursor.xterm-cursor-blink.xterm-cursor-bar { animation: ${F} 1s step-end infinite;}${this._terminalSelector} .${x}.${k} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: ${H} 1s step-end infinite;}${this._terminalSelector} .${x} .xterm-cursor.xterm-cursor-block { background-color: ${D.cursor.css}; color: ${D.cursorAccent.css};}${this._terminalSelector} .${x} .xterm-cursor.xterm-cursor-block:not(.xterm-cursor-blink) { background-color: ${D.cursor.css} !important; color: ${D.cursorAccent.css} !important;}${this._terminalSelector} .${x} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${D.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${x} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${D.cursor.css} inset;}${this._terminalSelector} .${x} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${D.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,O+=`${this._terminalSelector} .${L} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${L} div { position: absolute; background-color: ${D.selectionBackgroundOpaque.css};}${this._terminalSelector} .${L} div { position: absolute; background-color: ${D.selectionInactiveBackgroundOpaque.css};}`;for(const[I,R]of D.ansi.entries())O+=`${this._terminalSelector} .${C}${I} { color: ${R.css}; }${this._terminalSelector} .${C}${I}.xterm-dim { color: ${m.color.multiplyOpacity(R,.5).css}; }${this._terminalSelector} .${S}${I} { background-color: ${R.css}; }`;O+=`${this._terminalSelector} .${C}${_.INVERTED_DEFAULT_COLOR} { color: ${m.color.opaque(D.background).css}; }${this._terminalSelector} .${C}${_.INVERTED_DEFAULT_COLOR}.xterm-dim { color: ${m.color.multiplyOpacity(m.color.opaque(D.background),.5).css}; }${this._terminalSelector} .${S}${_.INVERTED_DEFAULT_COLOR} { background-color: ${D.foreground.css}; }`,this._themeStyleElement.textContent=O}_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,O){for(let z=this._rowElements.length;z<=O;z++){const F=this._document.createElement("div");this._rowContainer.appendChild(F),this._rowElements.push(F)}for(;this._rowElements.length>O;)this._rowContainer.removeChild(this._rowElements.pop())}handleResize(D,O){this._refreshRowElements(D,O),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(k),this.renderRows(0,this._bufferService.rows-1)}handleFocus(){this._rowContainer.classList.add(k),this.renderRows(this._bufferService.buffer.y,this._bufferService.buffer.y)}handleSelectionChanged(D,O,z){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged(D,O,z),this.renderRows(0,this._bufferService.rows-1),!D||!O)return;this._selectionRenderModel.update(this._terminal,D,O,z);const F=this._selectionRenderModel.viewportStartRow,H=this._selectionRenderModel.viewportEndRow,I=this._selectionRenderModel.viewportCappedStartRow,R=this._selectionRenderModel.viewportCappedEndRow;if(I>=this._bufferService.rows||R<0)return;const P=this._document.createDocumentFragment();if(z){const N=D[0]>O[0];P.appendChild(this._createSelectionElement(I,N?O[0]:D[0],N?D[0]:O[0],R-I+1))}else{const N=F===I?D[0]:0,j=I===H?O[0]:this._bufferService.cols;P.appendChild(this._createSelectionElement(I,N,j));const W=R-I-1;if(P.appendChild(this._createSelectionElement(I+1,0,this._bufferService.cols,W)),I!==R){const V=H===R?O[0]:this._bufferService.cols;P.appendChild(this._createSelectionElement(R,0,V))}}this._selectionContainer.appendChild(P)}_createSelectionElement(D,O,z,F=1){const H=this._document.createElement("div"),I=O*this.dimensions.css.cell.width;let R=this.dimensions.css.cell.width*(z-O);return I+R>this.dimensions.css.canvas.width&&(R=this.dimensions.css.canvas.width-I),H.style.height=F*this.dimensions.css.cell.height+"px",H.style.top=D*this.dimensions.css.cell.height+"px",H.style.left=`${I}px`,H.style.width=`${R}px`,H}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,O){const z=this._bufferService.buffer,F=z.ybase+z.y,H=Math.min(z.x,this._bufferService.cols-1),I=this._optionsService.rawOptions.cursorBlink,R=this._optionsService.rawOptions.cursorStyle,P=this._optionsService.rawOptions.cursorInactiveStyle;for(let N=D;N<=O;N++){const j=N+z.ydisp,W=this._rowElements[N],V=z.lines.get(j);if(!W||!V)break;W.replaceChildren(...this._rowFactory.createRow(V,j,j===F,R,P,H,I,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${b}${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,O,z,F,H,I){z<0&&(D=0),F<0&&(O=0);const R=this._bufferService.rows-1;z=Math.max(Math.min(z,R),0),F=Math.max(Math.min(F,R),0),H=Math.min(H,this._bufferService.cols);const P=this._bufferService.buffer,N=P.ybase+P.y,j=Math.min(P.x,H-1),W=this._optionsService.rawOptions.cursorBlink,V=this._optionsService.rawOptions.cursorStyle,Z=this._optionsService.rawOptions.cursorInactiveStyle;for(let Q=z;Q<=F;++Q){const $=Q+P.ydisp,B=this._rowElements[Q],G=P.lines.get($);if(!B||!G)break;B.replaceChildren(...this._rowFactory.createRow(G,$,$===N,V,Z,j,W,this.dimensions.css.cell.width,this._widthCache,I?Q===z?D:0:-1,I?(Q===F?O:H)-1:-1))}}};s.DomRenderer=M=c([f(7,w.IInstantiationService),f(8,h.ICharSizeService),f(9,w.IOptionsService),f(10,w.IBufferService),f(11,h.ICoreBrowserService),f(12,h.IThemeService)],M)},3787:function(l,s,o){var c=this&&this.__decorate||function(x,C,S,k){var L,A=arguments.length,M=A<3?C:k===null?k=Object.getOwnPropertyDescriptor(C,S):k;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")M=Reflect.decorate(x,C,S,k);else for(var D=x.length-1;D>=0;D--)(L=x[D])&&(M=(A<3?L(M):A>3?L(C,S,M):L(C,S))||M);return A>3&&M&&Object.defineProperty(C,S,M),M},f=this&&this.__param||function(x,C){return function(S,k){C(S,k,x)}};Object.defineProperty(s,"__esModule",{value:!0}),s.DomRendererRowFactory=void 0;const u=o(2223),p=o(643),_=o(511),y=o(2585),v=o(8055),h=o(4725),m=o(4269),d=o(6171),g=o(3734);let w=s.DomRendererRowFactory=class{constructor(x,C,S,k,L,A,M){this._document=x,this._characterJoinerService=C,this._optionsService=S,this._coreBrowserService=k,this._coreService=L,this._decorationService=A,this._themeService=M,this._workCell=new _.CellData,this._columnSelectMode=!1,this.defaultSpacing=0}handleSelectionChanged(x,C,S){this._selectionStart=x,this._selectionEnd=C,this._columnSelectMode=S}createRow(x,C,S,k,L,A,M,D,O,z,F){const H=[],I=this._characterJoinerService.getJoinedCharacters(C),R=this._themeService.colors;let P,N=x.getNoBgTrimmedLength();S&&N<A+1&&(N=A+1);let j=0,W="",V=0,Z=0,Q=0,$=!1,B=0,G=!1,U=0;const te=[],Y=z!==-1&&F!==-1;for(let _e=0;_e<N;_e++){x.loadCell(_e,this._workCell);let fe=this._workCell.getWidth();if(fe===0)continue;let re=!1,le=_e,se=this._workCell;if(I.length>0&&_e===I[0][0]){re=!0;const Te=I.shift();se=new m.JoinedCellData(this._workCell,x.translateToString(!0,Te[0],Te[1]),Te[1]-Te[0]),le=Te[1]-1,fe=se.getWidth()}const pe=this._isCellInSelection(_e,C),ve=S&&_e===A,ie=Y&&_e>=z&&_e<=F;let oe=!1;this._decorationService.forEachDecorationAtCell(_e,C,void 0,Te=>{oe=!0});let de=se.getChars()||p.WHITESPACE_CELL_CHAR;if(de===" "&&(se.isUnderline()||se.isOverline())&&(de=" "),U=fe*D-O.get(de,se.isBold(),se.isItalic()),P){if(j&&(pe&&G||!pe&&!G&&se.bg===V)&&(pe&&G&&R.selectionForeground||se.fg===Z)&&se.extended.ext===Q&&ie===$&&U===B&&!ve&&!re&&!oe){se.isInvisible()?W+=p.WHITESPACE_CELL_CHAR:W+=de,j++;continue}j&&(P.textContent=W),P=this._document.createElement("span"),j=0,W=""}else P=this._document.createElement("span");if(V=se.bg,Z=se.fg,Q=se.extended.ext,$=ie,B=U,G=pe,re&&A>=_e&&A<=le&&(A=_e),!this._coreService.isCursorHidden&&ve&&this._coreService.isCursorInitialized){if(te.push("xterm-cursor"),this._coreBrowserService.isFocused)M&&te.push("xterm-cursor-blink"),te.push(k==="bar"?"xterm-cursor-bar":k==="underline"?"xterm-cursor-underline":"xterm-cursor-block");else if(L)switch(L){case"outline":te.push("xterm-cursor-outline");break;case"block":te.push("xterm-cursor-block");break;case"bar":te.push("xterm-cursor-bar");break;case"underline":te.push("xterm-cursor-underline")}}if(se.isBold()&&te.push("xterm-bold"),se.isItalic()&&te.push("xterm-italic"),se.isDim()&&te.push("xterm-dim"),W=se.isInvisible()?p.WHITESPACE_CELL_CHAR:se.getChars()||p.WHITESPACE_CELL_CHAR,se.isUnderline()&&(te.push(`xterm-underline-${se.extended.underlineStyle}`),W===" "&&(W=" "),!se.isUnderlineColorDefault()))if(se.isUnderlineColorRGB())P.style.textDecorationColor=`rgb(${g.AttributeData.toColorRGB(se.getUnderlineColor()).join(",")})`;else{let Te=se.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&se.isBold()&&Te<8&&(Te+=8),P.style.textDecorationColor=R.ansi[Te].css}se.isOverline()&&(te.push("xterm-overline"),W===" "&&(W=" ")),se.isStrikethrough()&&te.push("xterm-strikethrough"),ie&&(P.style.textDecoration="underline");let ae=se.getFgColor(),ge=se.getFgColorMode(),Ee=se.getBgColor(),Le=se.getBgColorMode();const He=!!se.isInverse();if(He){const Te=ae;ae=Ee,Ee=Te;const J=ge;ge=Le,Le=J}let je,Pe,Oe,Ce=!1;switch(this._decorationService.forEachDecorationAtCell(_e,C,void 0,Te=>{Te.options.layer!=="top"&&Ce||(Te.backgroundColorRGB&&(Le=50331648,Ee=Te.backgroundColorRGB.rgba>>8&16777215,je=Te.backgroundColorRGB),Te.foregroundColorRGB&&(ge=50331648,ae=Te.foregroundColorRGB.rgba>>8&16777215,Pe=Te.foregroundColorRGB),Ce=Te.options.layer==="top")}),!Ce&&pe&&(je=this._coreBrowserService.isFocused?R.selectionBackgroundOpaque:R.selectionInactiveBackgroundOpaque,Ee=je.rgba>>8&16777215,Le=50331648,Ce=!0,R.selectionForeground&&(ge=50331648,ae=R.selectionForeground.rgba>>8&16777215,Pe=R.selectionForeground)),Ce&&te.push("xterm-decoration-top"),Le){case 16777216:case 33554432:Oe=R.ansi[Ee],te.push(`xterm-bg-${Ee}`);break;case 50331648:Oe=v.channels.toColor(Ee>>16,Ee>>8&255,255&Ee),this._addStyle(P,`background-color:#${b((Ee>>>0).toString(16),"0",6)}`);break;default:He?(Oe=R.foreground,te.push(`xterm-bg-${u.INVERTED_DEFAULT_COLOR}`)):Oe=R.background}switch(je||se.isDim()&&(je=v.color.multiplyOpacity(Oe,.5)),ge){case 16777216:case 33554432:se.isBold()&&ae<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(ae+=8),this._applyMinimumContrast(P,Oe,R.ansi[ae],se,je,void 0)||te.push(`xterm-fg-${ae}`);break;case 50331648:const Te=v.channels.toColor(ae>>16&255,ae>>8&255,255&ae);this._applyMinimumContrast(P,Oe,Te,se,je,Pe)||this._addStyle(P,`color:#${b(ae.toString(16),"0",6)}`);break;default:this._applyMinimumContrast(P,Oe,R.foreground,se,je,Pe)||He&&te.push(`xterm-fg-${u.INVERTED_DEFAULT_COLOR}`)}te.length&&(P.className=te.join(" "),te.length=0),ve||re||oe?P.textContent=W:j++,U!==this.defaultSpacing&&(P.style.letterSpacing=`${U}px`),H.push(P),_e=le}return P&&j&&(P.textContent=W),H}_applyMinimumContrast(x,C,S,k,L,A){if(this._optionsService.rawOptions.minimumContrastRatio===1||(0,d.treatGlyphAsBackgroundColor)(k.getCode()))return!1;const M=this._getContrastCache(k);let D;if(L||A||(D=M.getColor(C.rgba,S.rgba)),D===void 0){const O=this._optionsService.rawOptions.minimumContrastRatio/(k.isDim()?2:1);D=v.color.ensureContrastRatio(L||C,A||S,O),M.setColor((L||C).rgba,(A||S).rgba,D??null)}return!!D&&(this._addStyle(x,`color:${D.css}`),!0)}_getContrastCache(x){return x.isDim()?this._themeService.colors.halfContrastCache:this._themeService.colors.contrastCache}_addStyle(x,C){x.setAttribute("style",`${x.getAttribute("style")||""}${C};`)}_isCellInSelection(x,C){const S=this._selectionStart,k=this._selectionEnd;return!(!S||!k)&&(this._columnSelectMode?S[0]<=k[0]?x>=S[0]&&C>=S[1]&&x<k[0]&&C<=k[1]:x<S[0]&&C>=S[1]&&x>=k[0]&&C<=k[1]:C>S[1]&&C<k[1]||S[1]===k[1]&&C===S[1]&&x>=S[0]&&x<k[0]||S[1]<k[1]&&C===k[1]&&x<k[0]||S[1]<k[1]&&C===S[1]&&x>=S[0])}};function b(x,C,S){for(;x.length<S;)x=C+x;return x}s.DomRendererRowFactory=w=c([f(1,h.ICharacterJoinerService),f(2,y.IOptionsService),f(3,h.ICoreBrowserService),f(4,y.ICoreService),f(5,y.IDecorationService),f(6,h.IThemeService)],w)},2550:(l,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.WidthCache=void 0,s.WidthCache=class{constructor(o,c){this._flat=new Float32Array(256),this._font="",this._fontSize=0,this._weight="normal",this._weightBold="bold",this._measureElements=[],this._container=o.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 f=o.createElement("span");f.classList.add("xterm-char-measure-element");const u=o.createElement("span");u.classList.add("xterm-char-measure-element"),u.style.fontWeight="bold";const p=o.createElement("span");p.classList.add("xterm-char-measure-element"),p.style.fontStyle="italic";const _=o.createElement("span");_.classList.add("xterm-char-measure-element"),_.style.fontWeight="bold",_.style.fontStyle="italic",this._measureElements=[f,u,p,_],this._container.appendChild(f),this._container.appendChild(u),this._container.appendChild(p),this._container.appendChild(_),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(o,c,f,u){o===this._font&&c===this._fontSize&&f===this._weight&&u===this._weightBold||(this._font=o,this._fontSize=c,this._weight=f,this._weightBold=u,this._container.style.fontFamily=this._font,this._container.style.fontSize=`${this._fontSize}px`,this._measureElements[0].style.fontWeight=`${f}`,this._measureElements[1].style.fontWeight=`${u}`,this._measureElements[2].style.fontWeight=`${f}`,this._measureElements[3].style.fontWeight=`${u}`,this.clear())}get(o,c,f){let u=0;if(!c&&!f&&o.length===1&&(u=o.charCodeAt(0))<256){if(this._flat[u]!==-9999)return this._flat[u];const y=this._measure(o,0);return y>0&&(this._flat[u]=y),y}let p=o;c&&(p+="B"),f&&(p+="I");let _=this._holey.get(p);if(_===void 0){let y=0;c&&(y|=1),f&&(y|=2),_=this._measure(o,y),_>0&&this._holey.set(p,_)}return _}_measure(o,c){const f=this._measureElements[c];return f.textContent=o.repeat(32),f.offsetWidth/32}}},2223:(l,s,o)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.TEXT_BASELINE=s.DIM_OPACITY=s.INVERTED_DEFAULT_COLOR=void 0;const c=o(6114);s.INVERTED_DEFAULT_COLOR=257,s.DIM_OPACITY=.5,s.TEXT_BASELINE=c.isFirefox||c.isLegacyEdge?"bottom":"ideographic"},6171:(l,s)=>{function o(f){return 57508<=f&&f<=57558}function c(f){return f>=128512&&f<=128591||f>=127744&&f<=128511||f>=128640&&f<=128767||f>=9728&&f<=9983||f>=9984&&f<=10175||f>=65024&&f<=65039||f>=129280&&f<=129535||f>=127462&&f<=127487}Object.defineProperty(s,"__esModule",{value:!0}),s.computeNextVariantOffset=s.createRenderDimensions=s.treatGlyphAsBackgroundColor=s.allowRescaling=s.isEmoji=s.isRestrictedPowerlineGlyph=s.isPowerlineGlyph=s.throwIfFalsy=void 0,s.throwIfFalsy=function(f){if(!f)throw new Error("value must not be falsy");return f},s.isPowerlineGlyph=o,s.isRestrictedPowerlineGlyph=function(f){return 57520<=f&&f<=57527},s.isEmoji=c,s.allowRescaling=function(f,u,p,_){return u===1&&p>Math.ceil(1.5*_)&&f!==void 0&&f>255&&!c(f)&&!o(f)&&!function(y){return 57344<=y&&y<=63743}(f)},s.treatGlyphAsBackgroundColor=function(f){return o(f)||function(u){return 9472<=u&&u<=9631}(f)},s.createRenderDimensions=function(){return{css:{canvas:{width:0,height:0},cell:{width:0,height:0}},device:{canvas:{width:0,height:0},cell:{width:0,height:0},char:{width:0,height:0,left:0,top:0}}}},s.computeNextVariantOffset=function(f,u,p=0){return(f-(2*Math.round(u)-p))%(2*Math.round(u))}},6052:(l,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.createSelectionRenderModel=void 0;class o{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(f,u,p,_=!1){if(this.selectionStart=u,this.selectionEnd=p,!u||!p||u[0]===p[0]&&u[1]===p[1])return void this.clear();const y=f.buffers.active.ydisp,v=u[1]-y,h=p[1]-y,m=Math.max(v,0),d=Math.min(h,f.rows-1);m>=f.rows||d<0?this.clear():(this.hasSelection=!0,this.columnSelectMode=_,this.viewportStartRow=v,this.viewportEndRow=h,this.viewportCappedStartRow=m,this.viewportCappedEndRow=d,this.startCol=u[0],this.endCol=p[0])}isCellSelected(f,u,p){return!!this.hasSelection&&(p-=f.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?u>=this.startCol&&p>=this.viewportCappedStartRow&&u<this.endCol&&p<=this.viewportCappedEndRow:u<this.startCol&&p>=this.viewportCappedStartRow&&u>=this.endCol&&p<=this.viewportCappedEndRow:p>this.viewportStartRow&&p<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&p===this.viewportStartRow&&u>=this.startCol&&u<this.endCol||this.viewportStartRow<this.viewportEndRow&&p===this.viewportEndRow&&u<this.endCol||this.viewportStartRow<this.viewportEndRow&&p===this.viewportStartRow&&u>=this.startCol)}}s.createSelectionRenderModel=function(){return new o}},456:(l,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.SelectionModel=void 0,s.SelectionModel=class{constructor(o){this._bufferService=o,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 o=this.selectionStart[0]+this.selectionStartLength;return o>this._bufferService.cols?o%this._bufferService.cols==0?[this._bufferService.cols,this.selectionStart[1]+Math.floor(o/this._bufferService.cols)-1]:[o%this._bufferService.cols,this.selectionStart[1]+Math.floor(o/this._bufferService.cols)]:[o,this.selectionStart[1]]}if(this.selectionStartLength&&this.selectionEnd[1]===this.selectionStart[1]){const o=this.selectionStart[0]+this.selectionStartLength;return o>this._bufferService.cols?[o%this._bufferService.cols,this.selectionStart[1]+Math.floor(o/this._bufferService.cols)]:[Math.max(o,this.selectionEnd[0]),this.selectionEnd[1]]}return this.selectionEnd}}areSelectionValuesReversed(){const o=this.selectionStart,c=this.selectionEnd;return!(!o||!c)&&(o[1]>c[1]||o[1]===c[1]&&o[0]>c[0])}handleTrim(o){return this.selectionStart&&(this.selectionStart[1]-=o),this.selectionEnd&&(this.selectionEnd[1]-=o),this.selectionEnd&&this.selectionEnd[1]<0?(this.clearSelection(),!0):(this.selectionStart&&this.selectionStart[1]<0&&(this.selectionStart[1]=0),!1)}}},428:function(l,s,o){var c=this&&this.__decorate||function(d,g,w,b){var x,C=arguments.length,S=C<3?g:b===null?b=Object.getOwnPropertyDescriptor(g,w):b;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")S=Reflect.decorate(d,g,w,b);else for(var k=d.length-1;k>=0;k--)(x=d[k])&&(S=(C<3?x(S):C>3?x(g,w,S):x(g,w))||S);return C>3&&S&&Object.defineProperty(g,w,S),S},f=this&&this.__param||function(d,g){return function(w,b){g(w,b,d)}};Object.defineProperty(s,"__esModule",{value:!0}),s.CharSizeService=void 0;const u=o(2585),p=o(8460),_=o(844);let y=s.CharSizeService=class extends _.Disposable{get hasValidSize(){return this.width>0&&this.height>0}constructor(d,g,w){super(),this._optionsService=w,this.width=0,this.height=0,this._onCharSizeChange=this.register(new p.EventEmitter),this.onCharSizeChange=this._onCharSizeChange.event;try{this._measureStrategy=this.register(new m(this._optionsService))}catch{this._measureStrategy=this.register(new h(d,g,this._optionsService))}this.register(this._optionsService.onMultipleOptionChange(["fontFamily","fontSize"],()=>this.measure()))}measure(){const d=this._measureStrategy.measure();d.width===this.width&&d.height===this.height||(this.width=d.width,this.height=d.height,this._onCharSizeChange.fire())}};s.CharSizeService=y=c([f(2,u.IOptionsService)],y);class v extends _.Disposable{constructor(){super(...arguments),this._result={width:0,height:0}}_validateAndSet(g,w){g!==void 0&&g>0&&w!==void 0&&w>0&&(this._result.width=g,this._result.height=w)}}class h extends v{constructor(g,w,b){super(),this._document=g,this._parentElement=w,this._optionsService=b,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 v{constructor(g){super(),this._optionsService=g,this._canvas=new OffscreenCanvas(100,100),this._ctx=this._canvas.getContext("2d");const w=this._ctx.measureText("W");if(!("width"in w&&"fontBoundingBoxAscent"in w&&"fontBoundingBoxDescent"in w))throw new Error("Required font metrics not supported")}measure(){this._ctx.font=`${this._optionsService.rawOptions.fontSize}px ${this._optionsService.rawOptions.fontFamily}`;const g=this._ctx.measureText("W");return this._validateAndSet(g.width,g.fontBoundingBoxAscent+g.fontBoundingBoxDescent),this._result}}},4269:function(l,s,o){var c=this&&this.__decorate||function(m,d,g,w){var b,x=arguments.length,C=x<3?d:w===null?w=Object.getOwnPropertyDescriptor(d,g):w;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")C=Reflect.decorate(m,d,g,w);else for(var S=m.length-1;S>=0;S--)(b=m[S])&&(C=(x<3?b(C):x>3?b(d,g,C):b(d,g))||C);return x>3&&C&&Object.defineProperty(d,g,C),C},f=this&&this.__param||function(m,d){return function(g,w){d(g,w,m)}};Object.defineProperty(s,"__esModule",{value:!0}),s.CharacterJoinerService=s.JoinedCellData=void 0;const u=o(3734),p=o(643),_=o(511),y=o(2585);class v extends u.AttributeData{constructor(d,g,w){super(),this.content=0,this.combinedData="",this.fg=d.fg,this.bg=d.bg,this.combinedData=g,this._width=w}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(d){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}s.JoinedCellData=v;let h=s.CharacterJoinerService=class vw{constructor(d){this._bufferService=d,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new _.CellData}register(d){const g={id:this._nextCharacterJoinerId++,handler:d};return this._characterJoiners.push(g),g.id}deregister(d){for(let g=0;g<this._characterJoiners.length;g++)if(this._characterJoiners[g].id===d)return this._characterJoiners.splice(g,1),!0;return!1}getJoinedCharacters(d){if(this._characterJoiners.length===0)return[];const g=this._bufferService.buffer.lines.get(d);if(!g||g.length===0)return[];const w=[],b=g.translateToString(!0);let x=0,C=0,S=0,k=g.getFg(0),L=g.getBg(0);for(let A=0;A<g.getTrimmedLength();A++)if(g.loadCell(A,this._workCell),this._workCell.getWidth()!==0){if(this._workCell.fg!==k||this._workCell.bg!==L){if(A-x>1){const M=this._getJoinedRanges(b,S,C,g,x);for(let D=0;D<M.length;D++)w.push(M[D])}x=A,S=C,k=this._workCell.fg,L=this._workCell.bg}C+=this._workCell.getChars().length||p.WHITESPACE_CELL_CHAR.length}if(this._bufferService.cols-x>1){const A=this._getJoinedRanges(b,S,C,g,x);for(let M=0;M<A.length;M++)w.push(A[M])}return w}_getJoinedRanges(d,g,w,b,x){const C=d.substring(g,w);let S=[];try{S=this._characterJoiners[0].handler(C)}catch(k){console.error(k)}for(let k=1;k<this._characterJoiners.length;k++)try{const L=this._characterJoiners[k].handler(C);for(let A=0;A<L.length;A++)vw._mergeRanges(S,L[A])}catch(L){console.error(L)}return this._stringRangesToCellRanges(S,b,x),S}_stringRangesToCellRanges(d,g,w){let b=0,x=!1,C=0,S=d[b];if(S){for(let k=w;k<this._bufferService.cols;k++){const L=g.getWidth(k),A=g.getString(k).length||p.WHITESPACE_CELL_CHAR.length;if(L!==0){if(!x&&S[0]<=C&&(S[0]=k,x=!0),S[1]<=C){if(S[1]=k,S=d[++b],!S)break;S[0]<=C?(S[0]=k,x=!0):x=!1}C+=A}}S&&(S[1]=this._bufferService.cols)}}static _mergeRanges(d,g){let w=!1;for(let b=0;b<d.length;b++){const x=d[b];if(w){if(g[1]<=x[0])return d[b-1][1]=g[1],d;if(g[1]<=x[1])return d[b-1][1]=Math.max(g[1],x[1]),d.splice(b,1),d;d.splice(b,1),b--}else{if(g[1]<=x[0])return d.splice(b,0,g),d;if(g[1]<=x[1])return x[0]=Math.min(g[0],x[0]),d;g[0]<x[1]&&(x[0]=Math.min(g[0],x[0]),w=!0)}}return w?d[d.length-1][1]=g[1]:d.push(g),d}};s.CharacterJoinerService=h=c([f(0,y.IBufferService)],h)},5114:(l,s,o)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.CoreBrowserService=void 0;const c=o(844),f=o(8460),u=o(3656);class p extends c.Disposable{constructor(v,h,m){super(),this._textarea=v,this._window=h,this.mainDocument=m,this._isFocused=!1,this._cachedIsFocused=void 0,this._screenDprMonitor=new _(this._window),this._onDprChange=this.register(new f.EventEmitter),this.onDprChange=this._onDprChange.event,this._onWindowChange=this.register(new f.EventEmitter),this.onWindowChange=this._onWindowChange.event,this.register(this.onWindowChange(d=>this._screenDprMonitor.setWindow(d))),this.register((0,f.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(v){this._window!==v&&(this._window=v,this._onWindowChange.fire(this._window))}get dpr(){return this.window.devicePixelRatio}get isFocused(){return this._cachedIsFocused===void 0&&(this._cachedIsFocused=this._isFocused&&this._textarea.ownerDocument.hasFocus(),queueMicrotask(()=>this._cachedIsFocused=void 0)),this._cachedIsFocused}}s.CoreBrowserService=p;class _ extends c.Disposable{constructor(v){super(),this._parentWindow=v,this._windowResizeListener=this.register(new c.MutableDisposable),this._onDprChange=this.register(new f.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(v){this._parentWindow=v,this._setWindowResizeListener(),this._setDprAndFireIfDiffers()}_setWindowResizeListener(){this._windowResizeListener.value=(0,u.addDisposableDomListener)(this._parentWindow,"resize",()=>this._setDprAndFireIfDiffers())}_setDprAndFireIfDiffers(){this._parentWindow.devicePixelRatio!==this._currentDevicePixelRatio&&this._onDprChange.fire(this._parentWindow.devicePixelRatio),this._updateDpr()}_updateDpr(){var v;this._outerListener&&((v=this._resolutionMediaMatchList)==null||v.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:(l,s,o)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.LinkProviderService=void 0;const c=o(844);class f extends c.Disposable{constructor(){super(),this.linkProviders=[],this.register((0,c.toDisposable)(()=>this.linkProviders.length=0))}registerLinkProvider(p){return this.linkProviders.push(p),{dispose:()=>{const _=this.linkProviders.indexOf(p);_!==-1&&this.linkProviders.splice(_,1)}}}}s.LinkProviderService=f},8934:function(l,s,o){var c=this&&this.__decorate||function(y,v,h,m){var d,g=arguments.length,w=g<3?v:m===null?m=Object.getOwnPropertyDescriptor(v,h):m;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")w=Reflect.decorate(y,v,h,m);else for(var b=y.length-1;b>=0;b--)(d=y[b])&&(w=(g<3?d(w):g>3?d(v,h,w):d(v,h))||w);return g>3&&w&&Object.defineProperty(v,h,w),w},f=this&&this.__param||function(y,v){return function(h,m){v(h,m,y)}};Object.defineProperty(s,"__esModule",{value:!0}),s.MouseService=void 0;const u=o(4725),p=o(9806);let _=s.MouseService=class{constructor(y,v){this._renderService=y,this._charSizeService=v}getCoords(y,v,h,m,d){return(0,p.getCoords)(window,y,v,h,m,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,d)}getMouseReportCoords(y,v){const h=(0,p.getCoordsRelativeToElement)(window,y,v);if(this._charSizeService.hasValidSize)return h[0]=Math.min(Math.max(h[0],0),this._renderService.dimensions.css.canvas.width-1),h[1]=Math.min(Math.max(h[1],0),this._renderService.dimensions.css.canvas.height-1),{col:Math.floor(h[0]/this._renderService.dimensions.css.cell.width),row:Math.floor(h[1]/this._renderService.dimensions.css.cell.height),x:Math.floor(h[0]),y:Math.floor(h[1])}}};s.MouseService=_=c([f(0,u.IRenderService),f(1,u.ICharSizeService)],_)},3230:function(l,s,o){var c=this&&this.__decorate||function(d,g,w,b){var x,C=arguments.length,S=C<3?g:b===null?b=Object.getOwnPropertyDescriptor(g,w):b;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")S=Reflect.decorate(d,g,w,b);else for(var k=d.length-1;k>=0;k--)(x=d[k])&&(S=(C<3?x(S):C>3?x(g,w,S):x(g,w))||S);return C>3&&S&&Object.defineProperty(g,w,S),S},f=this&&this.__param||function(d,g){return function(w,b){g(w,b,d)}};Object.defineProperty(s,"__esModule",{value:!0}),s.RenderService=void 0;const u=o(6193),p=o(4725),_=o(8460),y=o(844),v=o(7226),h=o(2585);let m=s.RenderService=class extends y.Disposable{get dimensions(){return this._renderer.value.dimensions}constructor(d,g,w,b,x,C,S,k){super(),this._rowCount=d,this._charSizeService=b,this._renderer=this.register(new y.MutableDisposable),this._pausedResizeTask=new v.DebouncedIdleTask,this._observerDisposable=this.register(new y.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 _.EventEmitter),this.onDimensionsChange=this._onDimensionsChange.event,this._onRenderedViewportChange=this.register(new _.EventEmitter),this.onRenderedViewportChange=this._onRenderedViewportChange.event,this._onRender=this.register(new _.EventEmitter),this.onRender=this._onRender.event,this._onRefreshRequest=this.register(new _.EventEmitter),this.onRefreshRequest=this._onRefreshRequest.event,this._renderDebouncer=new u.RenderDebouncer((L,A)=>this._renderRows(L,A),S),this.register(this._renderDebouncer),this.register(S.onDprChange(()=>this.handleDevicePixelRatioChange())),this.register(C.onResize(()=>this._fullRefresh())),this.register(C.buffers.onBufferActivate(()=>{var L;return(L=this._renderer.value)==null?void 0:L.clear()})),this.register(w.onOptionChange(()=>this._handleOptionsChanged())),this.register(this._charSizeService.onCharSizeChange(()=>this.handleCharSizeChanged())),this.register(x.onDecorationRegistered(()=>this._fullRefresh())),this.register(x.onDecorationRemoved(()=>this._fullRefresh())),this.register(w.onMultipleOptionChange(["customGlyphs","drawBoldTextInBrightColors","letterSpacing","lineHeight","fontFamily","fontSize","fontWeight","fontWeightBold","minimumContrastRatio","rescaleOverlappingGlyphs"],()=>{this.clear(),this.handleResize(C.cols,C.rows),this._fullRefresh()})),this.register(w.onMultipleOptionChange(["cursorBlink","cursorStyle"],()=>this.refreshRows(C.buffer.y,C.buffer.y,!0))),this.register(k.onChangeColors(()=>this._fullRefresh())),this._registerIntersectionObserver(S.window,g),this.register(S.onWindowChange(L=>this._registerIntersectionObserver(L,g)))}_registerIntersectionObserver(d,g){if("IntersectionObserver"in d){const w=new d.IntersectionObserver(b=>this._handleIntersectionChange(b[b.length-1]),{threshold:0});w.observe(g),this._observerDisposable.value=(0,y.toDisposable)(()=>w.disconnect())}}_handleIntersectionChange(d){this._isPaused=d.isIntersecting===void 0?d.intersectionRatio===0:!d.isIntersecting,this._isPaused||this._charSizeService.hasValidSize||this._charSizeService.measure(),!this._isPaused&&this._needsFullRefresh&&(this._pausedResizeTask.flush(),this.refreshRows(0,this._rowCount-1),this._needsFullRefresh=!1)}refreshRows(d,g,w=!1){this._isPaused?this._needsFullRefresh=!0:(w||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(d,g,this._rowCount))}_renderRows(d,g){this._renderer.value&&(d=Math.min(d,this._rowCount-1),g=Math.min(g,this._rowCount-1),this._renderer.value.renderRows(d,g),this._needsSelectionRefresh&&(this._renderer.value.handleSelectionChanged(this._selectionState.start,this._selectionState.end,this._selectionState.columnSelectMode),this._needsSelectionRefresh=!1),this._isNextRenderRedrawOnly||this._onRenderedViewportChange.fire({start:d,end:g}),this._onRender.fire({start:d,end:g}),this._isNextRenderRedrawOnly=!0)}resize(d,g){this._rowCount=g,this._fireOnCanvasResize()}_handleOptionsChanged(){this._renderer.value&&(this.refreshRows(0,this._rowCount-1),this._fireOnCanvasResize())}_fireOnCanvasResize(){this._renderer.value&&(this._renderer.value.dimensions.css.canvas.width===this._canvasWidth&&this._renderer.value.dimensions.css.canvas.height===this._canvasHeight||this._onDimensionsChange.fire(this._renderer.value.dimensions))}hasRenderer(){return!!this._renderer.value}setRenderer(d){this._renderer.value=d,this._renderer.value&&(this._renderer.value.onRequestRedraw(g=>this.refreshRows(g.start,g.end,!0)),this._needsSelectionRefresh=!0,this._fullRefresh())}addRefreshCallback(d){return this._renderDebouncer.addRefreshCallback(d)}_fullRefresh(){this._isPaused?this._needsFullRefresh=!0:this.refreshRows(0,this._rowCount-1)}clearTextureAtlas(){var d,g;this._renderer.value&&((g=(d=this._renderer.value).clearTextureAtlas)==null||g.call(d),this._fullRefresh())}handleDevicePixelRatioChange(){this._charSizeService.measure(),this._renderer.value&&(this._renderer.value.handleDevicePixelRatioChange(),this.refreshRows(0,this._rowCount-1))}handleResize(d,g){this._renderer.value&&(this._isPaused?this._pausedResizeTask.set(()=>{var w;return(w=this._renderer.value)==null?void 0:w.handleResize(d,g)}):this._renderer.value.handleResize(d,g),this._fullRefresh())}handleCharSizeChanged(){var d;(d=this._renderer.value)==null||d.handleCharSizeChanged()}handleBlur(){var d;(d=this._renderer.value)==null||d.handleBlur()}handleFocus(){var d;(d=this._renderer.value)==null||d.handleFocus()}handleSelectionChanged(d,g,w){var b;this._selectionState.start=d,this._selectionState.end=g,this._selectionState.columnSelectMode=w,(b=this._renderer.value)==null||b.handleSelectionChanged(d,g,w)}handleCursorMove(){var d;(d=this._renderer.value)==null||d.handleCursorMove()}clear(){var d;(d=this._renderer.value)==null||d.clear()}};s.RenderService=m=c([f(2,h.IOptionsService),f(3,p.ICharSizeService),f(4,h.IDecorationService),f(5,h.IBufferService),f(6,p.ICoreBrowserService),f(7,p.IThemeService)],m)},9312:function(l,s,o){var c=this&&this.__decorate||function(S,k,L,A){var M,D=arguments.length,O=D<3?k:A===null?A=Object.getOwnPropertyDescriptor(k,L):A;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")O=Reflect.decorate(S,k,L,A);else for(var z=S.length-1;z>=0;z--)(M=S[z])&&(O=(D<3?M(O):D>3?M(k,L,O):M(k,L))||O);return D>3&&O&&Object.defineProperty(k,L,O),O},f=this&&this.__param||function(S,k){return function(L,A){k(L,A,S)}};Object.defineProperty(s,"__esModule",{value:!0}),s.SelectionService=void 0;const u=o(9806),p=o(9504),_=o(456),y=o(4725),v=o(8460),h=o(844),m=o(6114),d=o(4841),g=o(511),w=o(2585),b=" ",x=new RegExp(b,"g");let C=s.SelectionService=class extends h.Disposable{constructor(S,k,L,A,M,D,O,z,F){super(),this._element=S,this._screenElement=k,this._linkifier=L,this._bufferService=A,this._coreService=M,this._mouseService=D,this._optionsService=O,this._renderService=z,this._coreBrowserService=F,this._dragScrollAmount=0,this._enabled=!0,this._workCell=new g.CellData,this._mouseDownTimeStamp=0,this._oldHasSelection=!1,this._oldSelectionStart=void 0,this._oldSelectionEnd=void 0,this._onLinuxMouseSelection=this.register(new v.EventEmitter),this.onLinuxMouseSelection=this._onLinuxMouseSelection.event,this._onRedrawRequest=this.register(new v.EventEmitter),this.onRequestRedraw=this._onRedrawRequest.event,this._onSelectionChange=this.register(new v.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onRequestScrollLines=this.register(new v.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this._mouseMoveListener=H=>this._handleMouseMove(H),this._mouseUpListener=H=>this._handleMouseUp(H),this._coreService.onUserInput(()=>{this.hasSelection&&this.clearSelection()}),this._trimListener=this._bufferService.buffer.lines.onTrim(H=>this._handleTrim(H)),this.register(this._bufferService.buffers.onBufferActivate(H=>this._handleBufferActivate(H))),this.enable(),this._model=new _.SelectionModel(this._bufferService),this._activeSelectionMode=0,this.register((0,h.toDisposable)(()=>{this._removeMouseDownListeners()}))}reset(){this.clearSelection()}disable(){this.clearSelection(),this._enabled=!1}enable(){this._enabled=!0}get selectionStart(){return this._model.finalSelectionStart}get selectionEnd(){return this._model.finalSelectionEnd}get hasSelection(){const S=this._model.finalSelectionStart,k=this._model.finalSelectionEnd;return!(!S||!k||S[0]===k[0]&&S[1]===k[1])}get selectionText(){const S=this._model.finalSelectionStart,k=this._model.finalSelectionEnd;if(!S||!k)return"";const L=this._bufferService.buffer,A=[];if(this._activeSelectionMode===3){if(S[0]===k[0])return"";const M=S[0]<k[0]?S[0]:k[0],D=S[0]<k[0]?k[0]:S[0];for(let O=S[1];O<=k[1];O++){const z=L.translateBufferLineToString(O,!0,M,D);A.push(z)}}else{const M=S[1]===k[1]?k[0]:void 0;A.push(L.translateBufferLineToString(S[1],!0,S[0],M));for(let D=S[1]+1;D<=k[1]-1;D++){const O=L.lines.get(D),z=L.translateBufferLineToString(D,!0);O!=null&&O.isWrapped?A[A.length-1]+=z:A.push(z)}if(S[1]!==k[1]){const D=L.lines.get(k[1]),O=L.translateBufferLineToString(k[1],!0,0,k[0]);D&&D.isWrapped?A[A.length-1]+=O:A.push(O)}}return A.map(M=>M.replace(x," ")).join(m.isWindows?`\r
|
|
56
|
+
WARNING: This link could potentially be dangerous`)){const m=window.open();if(m){try{m.opener=null}catch{}m.location.href=h}else console.warn("Opening link blocked as opener could not be cleared")}}s.OscLinkProvider=_=c([f(0,p.IBufferService),f(1,p.IOptionsService),f(2,p.IOscLinkService)],_)},6193:(l,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.RenderDebouncer=void 0,s.RenderDebouncer=class{constructor(o,c){this._renderCallback=o,this._coreBrowserService=c,this._refreshCallbacks=[]}dispose(){this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}addRefreshCallback(o){return this._refreshCallbacks.push(o),this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._innerRefresh())),this._animationFrame}refresh(o,c,f){this._rowCount=f,o=o!==void 0?o:0,c=c!==void 0?c:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,o):o,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 o=Math.max(this._rowStart,0),c=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(o,c),this._runRefreshCallbacks()}_runRefreshCallbacks(){for(const o of this._refreshCallbacks)o(0);this._refreshCallbacks=[]}}},3236:(l,s,o)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.Terminal=void 0;const c=o(3614),f=o(3656),u=o(3551),p=o(9042),_=o(3730),y=o(1680),v=o(3107),h=o(5744),m=o(2950),d=o(1296),g=o(428),w=o(4269),b=o(5114),x=o(8934),C=o(3230),S=o(9312),k=o(4725),L=o(6731),A=o(8055),M=o(8969),D=o(8460),O=o(844),z=o(6114),F=o(8437),H=o(2584),I=o(7399),R=o(5941),P=o(9074),N=o(2585),j=o(5435),W=o(4567),V=o(779);class Z extends M.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($={}){super($),this.browser=z,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this.register(new O.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(P.DecorationService),this._instantiationService.setService(N.IDecorationService,this._decorationService),this._linkProviderService=this._instantiationService.createInstance(V.LinkProviderService),this._instantiationService.setService(k.ILinkProviderService,this._linkProviderService),this._linkProviderService.registerLinkProvider(this._instantiationService.createInstance(_.OscLinkProvider)),this.register(this._inputHandler.onRequestBell(()=>this._onBell.fire())),this.register(this._inputHandler.onRequestRefreshRows((B,K)=>this.refresh(B,K))),this.register(this._inputHandler.onRequestSendFocus(()=>this._reportFocus())),this.register(this._inputHandler.onRequestReset(()=>this.reset())),this.register(this._inputHandler.onRequestWindowsOptionsReport(B=>this._reportWindowsOptions(B))),this.register(this._inputHandler.onColor(B=>this._handleColorEvent(B))),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(B=>this._afterResize(B.cols,B.rows))),this.register((0,O.toDisposable)(()=>{var B,K;this._customKeyEventHandler=void 0,(K=(B=this.element)==null?void 0:B.parentNode)==null||K.removeChild(this.element)}))}_handleColorEvent($){if(this._themeService)for(const B of $){let K,U="";switch(B.index){case 256:K="foreground",U="10";break;case 257:K="background",U="11";break;case 258:K="cursor",U="12";break;default:K="ansi",U="4;"+B.index}switch(B.type){case 0:const te=A.color.toColorRGB(K==="ansi"?this._themeService.colors.ansi[B.index]:this._themeService.colors[K]);this.coreService.triggerDataEvent(`${H.C0.ESC}]${U};${(0,R.toRgbString)(te)}${H.C1_ESCAPED.ST}`);break;case 1:if(K==="ansi")this._themeService.modifyColors(Y=>Y.ansi[B.index]=A.channels.toColor(...B.color));else{const Y=K;this._themeService.modifyColors(ye=>ye[Y]=A.channels.toColor(...B.color))}break;case 2:this._themeService.restoreColor(B.index)}}}_setup(){super._setup(),this._customKeyEventHandler=void 0}get buffer(){return this.buffers.active}focus(){this.textarea&&this.textarea.focus({preventScroll:!0})}_handleScreenReaderModeOptionChange($){$?!this._accessibilityManager.value&&this._renderService&&(this._accessibilityManager.value=this._instantiationService.createInstance(W.AccessibilityManager,this)):this._accessibilityManager.clear()}_handleTextAreaFocus($){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(H.C0.ESC+"[I"),this.element.classList.add("focus"),this._showCursor(),this._onFocus.fire()}blur(){var $;return($=this.textarea)==null?void 0:$.blur()}_handleTextAreaBlur(){this.textarea.value="",this.refresh(this.buffer.y,this.buffer.y),this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(H.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 $=this.buffer.ybase+this.buffer.y,B=this.buffer.lines.get($);if(!B)return;const K=Math.min(this.buffer.x,this.cols-1),U=this._renderService.dimensions.css.cell.height,te=B.getWidth(K),Y=this._renderService.dimensions.css.cell.width*te,ye=this.buffer.y*this._renderService.dimensions.css.cell.height,pe=K*this._renderService.dimensions.css.cell.width;this.textarea.style.left=pe+"px",this.textarea.style.top=ye+"px",this.textarea.style.width=Y+"px",this.textarea.style.height=U+"px",this.textarea.style.lineHeight=U+"px",this.textarea.style.zIndex="-5"}_initGlobal(){this._bindKeys(),this.register((0,f.addDisposableDomListener)(this.element,"copy",B=>{this.hasSelection()&&(0,c.copyHandler)(B,this._selectionService)}));const $=B=>(0,c.handlePasteEvent)(B,this.textarea,this.coreService,this.optionsService);this.register((0,f.addDisposableDomListener)(this.textarea,"paste",$)),this.register((0,f.addDisposableDomListener)(this.element,"paste",$)),z.isFirefox?this.register((0,f.addDisposableDomListener)(this.element,"mousedown",B=>{B.button===2&&(0,c.rightClickHandler)(B,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})):this.register((0,f.addDisposableDomListener)(this.element,"contextmenu",B=>{(0,c.rightClickHandler)(B,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})),z.isLinux&&this.register((0,f.addDisposableDomListener)(this.element,"auxclick",B=>{B.button===1&&(0,c.moveTextAreaUnderMouseCursor)(B,this.textarea,this.screenElement)}))}_bindKeys(){this.register((0,f.addDisposableDomListener)(this.textarea,"keyup",$=>this._keyUp($),!0)),this.register((0,f.addDisposableDomListener)(this.textarea,"keydown",$=>this._keyDown($),!0)),this.register((0,f.addDisposableDomListener)(this.textarea,"keypress",$=>this._keyPress($),!0)),this.register((0,f.addDisposableDomListener)(this.textarea,"compositionstart",()=>this._compositionHelper.compositionstart())),this.register((0,f.addDisposableDomListener)(this.textarea,"compositionupdate",$=>this._compositionHelper.compositionupdate($))),this.register((0,f.addDisposableDomListener)(this.textarea,"compositionend",()=>this._compositionHelper.compositionend())),this.register((0,f.addDisposableDomListener)(this.textarea,"input",$=>this._inputEvent($),!0)),this.register(this.onRender(()=>this._compositionHelper.updateCompositionElements()))}open($){var K;if(!$)throw new Error("Terminal requires a parent element.");if($.isConnected||this._logService.debug("Terminal.open was called on an element that was not attached to the DOM"),((K=this.element)==null?void 0:K.ownerDocument.defaultView)&&this._coreBrowserService)return void(this.element.ownerDocument.defaultView!==this._coreBrowserService.window&&(this._coreBrowserService.window=this.element.ownerDocument.defaultView));this._document=$.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"),$.appendChild(this.element);const B=this._document.createDocumentFragment();this._viewportElement=this._document.createElement("div"),this._viewportElement.classList.add("xterm-viewport"),B.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,f.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),B.appendChild(this.screenElement),this.textarea=this._document.createElement("textarea"),this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",p.promptLabel),z.isChromeOS||this.textarea.setAttribute("aria-multiline","false"),this.textarea.setAttribute("autocorrect","off"),this.textarea.setAttribute("autocapitalize","off"),this.textarea.setAttribute("spellcheck","false"),this.textarea.tabIndex=0,this._coreBrowserService=this.register(this._instantiationService.createInstance(b.CoreBrowserService,this.textarea,$.ownerDocument.defaultView??window,this._document??typeof window<"u"?window.document:null)),this._instantiationService.setService(k.ICoreBrowserService,this._coreBrowserService),this.register((0,f.addDisposableDomListener)(this.textarea,"focus",U=>this._handleTextAreaFocus(U))),this.register((0,f.addDisposableDomListener)(this.textarea,"blur",()=>this._handleTextAreaBlur())),this._helperContainer.appendChild(this.textarea),this._charSizeService=this._instantiationService.createInstance(g.CharSizeService,this._document,this._helperContainer),this._instantiationService.setService(k.ICharSizeService,this._charSizeService),this._themeService=this._instantiationService.createInstance(L.ThemeService),this._instantiationService.setService(k.IThemeService,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(w.CharacterJoinerService),this._instantiationService.setService(k.ICharacterJoinerService,this._characterJoinerService),this._renderService=this.register(this._instantiationService.createInstance(C.RenderService,this.rows,this.screenElement)),this._instantiationService.setService(k.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(x.MouseService),this._instantiationService.setService(k.IMouseService,this._mouseService),this.linkifier=this.register(this._instantiationService.createInstance(u.Linkifier,this.screenElement)),this.element.appendChild(B);try{this._onWillOpen.fire(this.element)}catch{}this._renderService.hasRenderer()||this._renderService.setRenderer(this._createRenderer()),this.viewport=this._instantiationService.createInstance(y.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(S.SelectionService,this.element,this.screenElement,this.linkifier)),this._instantiationService.setService(k.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,f.addDisposableDomListener)(this._viewportElement,"scroll",()=>this._selectionService.refresh())),this.register(this._instantiationService.createInstance(v.BufferDecorationRenderer,this.screenElement)),this.register((0,f.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(W.AccessibilityManager,this)),this.register(this.optionsService.onSpecificOptionChange("screenReaderMode",U=>this._handleScreenReaderModeOptionChange(U))),this.options.overviewRulerWidth&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(h.OverviewRulerRenderer,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRulerWidth",U=>{!this._overviewRulerRenderer&&U&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(h.OverviewRulerRenderer,this._viewportElement,this.screenElement)))}),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()}_createRenderer(){return this._instantiationService.createInstance(d.DomRenderer,this,this._document,this.element,this.screenElement,this._viewportElement,this._helperContainer,this.linkifier)}bindMouse(){const $=this,B=this.element;function K(Y){const ye=$._mouseService.getMouseReportCoords(Y,$.screenElement);if(!ye)return!1;let pe,ne;switch(Y.overrideType||Y.type){case"mousemove":ne=32,Y.buttons===void 0?(pe=3,Y.button!==void 0&&(pe=Y.button<3?Y.button:3)):pe=1&Y.buttons?0:4&Y.buttons?1:2&Y.buttons?2:3;break;case"mouseup":ne=0,pe=Y.button<3?Y.button:3;break;case"mousedown":ne=1,pe=Y.button<3?Y.button:3;break;case"wheel":if($._customWheelEventHandler&&$._customWheelEventHandler(Y)===!1||$.viewport.getLinesScrolled(Y)===0)return!1;ne=Y.deltaY<0?0:1,pe=4;break;default:return!1}return!(ne===void 0||pe===void 0||pe>4)&&$.coreMouseService.triggerMouseEvent({col:ye.col,row:ye.row,x:ye.x,y:ye.y,button:pe,action:ne,ctrl:Y.ctrlKey,alt:Y.altKey,shift:Y.shiftKey})}const U={mouseup:null,wheel:null,mousedrag:null,mousemove:null},te={mouseup:Y=>(K(Y),Y.buttons||(this._document.removeEventListener("mouseup",U.mouseup),U.mousedrag&&this._document.removeEventListener("mousemove",U.mousedrag)),this.cancel(Y)),wheel:Y=>(K(Y),this.cancel(Y,!0)),mousedrag:Y=>{Y.buttons&&K(Y)},mousemove:Y=>{Y.buttons||K(Y)}};this.register(this.coreMouseService.onProtocolChange(Y=>{Y?(this.optionsService.rawOptions.logLevel==="debug"&&this._logService.debug("Binding to mouse events:",this.coreMouseService.explainEvents(Y)),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&Y?U.mousemove||(B.addEventListener("mousemove",te.mousemove),U.mousemove=te.mousemove):(B.removeEventListener("mousemove",U.mousemove),U.mousemove=null),16&Y?U.wheel||(B.addEventListener("wheel",te.wheel,{passive:!1}),U.wheel=te.wheel):(B.removeEventListener("wheel",U.wheel),U.wheel=null),2&Y?U.mouseup||(U.mouseup=te.mouseup):(this._document.removeEventListener("mouseup",U.mouseup),U.mouseup=null),4&Y?U.mousedrag||(U.mousedrag=te.mousedrag):(this._document.removeEventListener("mousemove",U.mousedrag),U.mousedrag=null)})),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this.register((0,f.addDisposableDomListener)(B,"mousedown",Y=>{if(Y.preventDefault(),this.focus(),this.coreMouseService.areMouseEventsActive&&!this._selectionService.shouldForceSelection(Y))return K(Y),U.mouseup&&this._document.addEventListener("mouseup",U.mouseup),U.mousedrag&&this._document.addEventListener("mousemove",U.mousedrag),this.cancel(Y)})),this.register((0,f.addDisposableDomListener)(B,"wheel",Y=>{if(!U.wheel){if(this._customWheelEventHandler&&this._customWheelEventHandler(Y)===!1)return!1;if(!this.buffer.hasScrollback){const ye=this.viewport.getLinesScrolled(Y);if(ye===0)return;const pe=H.C0.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(Y.deltaY<0?"A":"B");let ne="";for(let oe=0;oe<Math.abs(ye);oe++)ne+=pe;return this.coreService.triggerDataEvent(ne,!0),this.cancel(Y,!0)}return this.viewport.handleWheel(Y)?this.cancel(Y):void 0}},{passive:!1})),this.register((0,f.addDisposableDomListener)(B,"touchstart",Y=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchStart(Y),this.cancel(Y)},{passive:!0})),this.register((0,f.addDisposableDomListener)(B,"touchmove",Y=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchMove(Y)?void 0:this.cancel(Y)},{passive:!1}))}refresh($,B){var K;(K=this._renderService)==null||K.refreshRows($,B)}updateCursorStyle($){var B;(B=this._selectionService)!=null&&B.shouldColumnSelect($)?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($,B,K=0){var U;K===1?(super.scrollLines($,B,K),this.refresh(0,this.rows-1)):(U=this.viewport)==null||U.scrollLines($)}paste($){(0,c.paste)($,this.textarea,this.coreService,this.optionsService)}attachCustomKeyEventHandler($){this._customKeyEventHandler=$}attachCustomWheelEventHandler($){this._customWheelEventHandler=$}registerLinkProvider($){return this._linkProviderService.registerLinkProvider($)}registerCharacterJoiner($){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");const B=this._characterJoinerService.register($);return this.refresh(0,this.rows-1),B}deregisterCharacterJoiner($){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");this._characterJoinerService.deregister($)&&this.refresh(0,this.rows-1)}get markers(){return this.buffer.markers}registerMarker($){return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+$)}registerDecoration($){return this._decorationService.registerDecoration($)}hasSelection(){return!!this._selectionService&&this._selectionService.hasSelection}select($,B,K){this._selectionService.setSelection($,B,K)}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 $;($=this._selectionService)==null||$.clearSelection()}selectAll(){var $;($=this._selectionService)==null||$.selectAll()}selectLines($,B){var K;(K=this._selectionService)==null||K.selectLines($,B)}_keyDown($){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&this._customKeyEventHandler($)===!1)return!1;const B=this.browser.isMac&&this.options.macOptionIsMeta&&$.altKey;if(!B&&!this._compositionHelper.keydown($))return this.options.scrollOnUserInput&&this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(),!1;B||$.key!=="Dead"&&$.key!=="AltGraph"||(this._unprocessedDeadKey=!0);const K=(0,I.evaluateKeyboardEvent)($,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle($),K.type===3||K.type===2){const U=this.rows-1;return this.scrollLines(K.type===2?-U:U),this.cancel($,!0)}return K.type===1&&this.selectAll(),!!this._isThirdLevelShift(this.browser,$)||(K.cancel&&this.cancel($,!0),!K.key||!!($.key&&!$.ctrlKey&&!$.altKey&&!$.metaKey&&$.key.length===1&&$.key.charCodeAt(0)>=65&&$.key.charCodeAt(0)<=90)||(this._unprocessedDeadKey?(this._unprocessedDeadKey=!1,!0):(K.key!==H.C0.ETX&&K.key!==H.C0.CR||(this.textarea.value=""),this._onKey.fire({key:K.key,domEvent:$}),this._showCursor(),this.coreService.triggerDataEvent(K.key,!0),!this.optionsService.rawOptions.screenReaderMode||$.altKey||$.ctrlKey?this.cancel($,!0):void(this._keyDownHandled=!0))))}_isThirdLevelShift($,B){const K=$.isMac&&!this.options.macOptionIsMeta&&B.altKey&&!B.ctrlKey&&!B.metaKey||$.isWindows&&B.altKey&&B.ctrlKey&&!B.metaKey||$.isWindows&&B.getModifierState("AltGraph");return B.type==="keypress"?K:K&&(!B.keyCode||B.keyCode>47)}_keyUp($){this._keyDownSeen=!1,this._customKeyEventHandler&&this._customKeyEventHandler($)===!1||(function(B){return B.keyCode===16||B.keyCode===17||B.keyCode===18}($)||this.focus(),this.updateCursorStyle($),this._keyPressHandled=!1)}_keyPress($){let B;if(this._keyPressHandled=!1,this._keyDownHandled||this._customKeyEventHandler&&this._customKeyEventHandler($)===!1)return!1;if(this.cancel($),$.charCode)B=$.charCode;else if($.which===null||$.which===void 0)B=$.keyCode;else{if($.which===0||$.charCode===0)return!1;B=$.which}return!(!B||($.altKey||$.ctrlKey||$.metaKey)&&!this._isThirdLevelShift(this.browser,$)||(B=String.fromCharCode(B),this._onKey.fire({key:B,domEvent:$}),this._showCursor(),this.coreService.triggerDataEvent(B,!0),this._keyPressHandled=!0,this._unprocessedDeadKey=!1,0))}_inputEvent($){if($.data&&$.inputType==="insertText"&&(!$.composed||!this._keyDownSeen)&&!this.optionsService.rawOptions.screenReaderMode){if(this._keyPressHandled)return!1;this._unprocessedDeadKey=!1;const B=$.data;return this.coreService.triggerDataEvent(B,!0),this.cancel($),!0}return!1}resize($,B){$!==this.cols||B!==this.rows?super.resize($,B):this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure()}_afterResize($,B){var K,U;(K=this._charSizeService)==null||K.measure(),(U=this.viewport)==null||U.syncScrollArea(!0)}clear(){var $;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 B=1;B<this.rows;B++)this.buffer.lines.push(this.buffer.getBlankLine(F.DEFAULT_ATTR_DATA));this._onScroll.fire({position:this.buffer.ydisp,source:0}),($=this.viewport)==null||$.reset(),this.refresh(0,this.rows-1)}}reset(){var B,K;this.options.rows=this.rows,this.options.cols=this.cols;const $=this._customKeyEventHandler;this._setup(),super.reset(),(B=this._selectionService)==null||B.reset(),this._decorationService.reset(),(K=this.viewport)==null||K.reset(),this._customKeyEventHandler=$,this.refresh(0,this.rows-1)}clearTextureAtlas(){var $;($=this._renderService)==null||$.clearTextureAtlas()}_reportFocus(){var $;($=this.element)!=null&&$.classList.contains("focus")?this.coreService.triggerDataEvent(H.C0.ESC+"[I"):this.coreService.triggerDataEvent(H.C0.ESC+"[O")}_reportWindowsOptions($){if(this._renderService)switch($){case j.WindowsOptionsReportType.GET_WIN_SIZE_PIXELS:const B=this._renderService.dimensions.css.canvas.width.toFixed(0),K=this._renderService.dimensions.css.canvas.height.toFixed(0);this.coreService.triggerDataEvent(`${H.C0.ESC}[4;${K};${B}t`);break;case j.WindowsOptionsReportType.GET_CELL_SIZE_PIXELS:const U=this._renderService.dimensions.css.cell.width.toFixed(0),te=this._renderService.dimensions.css.cell.height.toFixed(0);this.coreService.triggerDataEvent(`${H.C0.ESC}[6;${te};${U}t`)}}cancel($,B){if(this.options.cancelEvents||B)return $.preventDefault(),$.stopPropagation(),!1}}s.Terminal=Z},9924:(l,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.TimeBasedDebouncer=void 0,s.TimeBasedDebouncer=class{constructor(o,c=1e3){this._renderCallback=o,this._debounceThresholdMS=c,this._lastRefreshMs=0,this._additionalRefreshRequested=!1}dispose(){this._refreshTimeoutID&&clearTimeout(this._refreshTimeoutID)}refresh(o,c,f){this._rowCount=f,o=o!==void 0?o:0,c=c!==void 0?c:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,o):o,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,c):c;const u=Date.now();if(u-this._lastRefreshMs>=this._debounceThresholdMS)this._lastRefreshMs=u,this._innerRefresh();else if(!this._additionalRefreshRequested){const p=u-this._lastRefreshMs,_=this._debounceThresholdMS-p;this._additionalRefreshRequested=!0,this._refreshTimeoutID=window.setTimeout(()=>{this._lastRefreshMs=Date.now(),this._innerRefresh(),this._additionalRefreshRequested=!1,this._refreshTimeoutID=void 0},_)}}_innerRefresh(){if(this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return;const o=Math.max(this._rowStart,0),c=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(o,c)}}},1680:function(l,s,o){var c=this&&this.__decorate||function(m,d,g,w){var b,x=arguments.length,C=x<3?d:w===null?w=Object.getOwnPropertyDescriptor(d,g):w;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")C=Reflect.decorate(m,d,g,w);else for(var S=m.length-1;S>=0;S--)(b=m[S])&&(C=(x<3?b(C):x>3?b(d,g,C):b(d,g))||C);return x>3&&C&&Object.defineProperty(d,g,C),C},f=this&&this.__param||function(m,d){return function(g,w){d(g,w,m)}};Object.defineProperty(s,"__esModule",{value:!0}),s.Viewport=void 0;const u=o(3656),p=o(4725),_=o(8460),y=o(844),v=o(2585);let h=s.Viewport=class extends y.Disposable{constructor(m,d,g,w,b,x,C,S){super(),this._viewportElement=m,this._scrollArea=d,this._bufferService=g,this._optionsService=w,this._charSizeService=b,this._renderService=x,this._coreBrowserService=C,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 _.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this.scrollBarWidth=this._viewportElement.offsetWidth-this._scrollArea.offsetWidth||15,this.register((0,u.addDisposableDomListener)(this._viewportElement,"scroll",this._handleScroll.bind(this))),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate(k=>this._activeBuffer=k.activeBuffer)),this._renderDimensions=this._renderService.dimensions,this.register(this._renderService.onDimensionsChange(k=>this._renderDimensions=k)),this._handleThemeChange(S.colors),this.register(S.onChangeColors(k=>this._handleThemeChange(k))),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 d=Math.round(this._currentRowHeight*this._lastRecordedBufferLength)+(this._lastRecordedViewportHeight-this._renderDimensions.css.canvas.height);this._lastRecordedBufferHeight!==d&&(this._lastRecordedBufferHeight=d,this._scrollArea.style.height=this._lastRecordedBufferHeight+"px")}const 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 d=Math.round(this._lastScrollTop/this._currentRowHeight)-this._bufferService.buffer.ydisp;this._onRequestScrollLines.fire({amount:d,suppressScrollEvent:!0})}_smoothScroll(){if(this._isDisposed||this._smoothScrollState.origin===-1||this._smoothScrollState.target===-1)return;const 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,d){const g=this._viewportElement.scrollTop+this._lastRecordedViewportHeight;return!(d<0&&this._viewportElement.scrollTop!==0||d>0&&g<this._lastRecordedBufferHeight)||(m.cancelable&&m.preventDefault(),!1)}handleWheel(m){const d=this._getPixelsScrolled(m);return d!==0&&(this._optionsService.rawOptions.smoothScrollDuration?(this._smoothScrollState.startTime=Date.now(),this._smoothScrollPercent()<1?(this._smoothScrollState.origin=this._viewportElement.scrollTop,this._smoothScrollState.target===-1?this._smoothScrollState.target=this._viewportElement.scrollTop+d:this._smoothScrollState.target+=d,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()):this._viewportElement.scrollTop+=d,this._bubbleScroll(m,d))}scrollLines(m){if(m!==0)if(this._optionsService.rawOptions.smoothScrollDuration){const d=m*this._currentRowHeight;this._smoothScrollState.startTime=Date.now(),this._smoothScrollPercent()<1?(this._smoothScrollState.origin=this._viewportElement.scrollTop,this._smoothScrollState.target=this._smoothScrollState.origin+d,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()}else this._onRequestScrollLines.fire({amount:m,suppressScrollEvent:!1})}_getPixelsScrolled(m){if(m.deltaY===0||m.shiftKey)return 0;let d=this._applyScrollModifier(m.deltaY,m);return m.deltaMode===WheelEvent.DOM_DELTA_LINE?d*=this._currentRowHeight:m.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(d*=this._currentRowHeight*this._bufferService.rows),d}getBufferElements(m,d){var S;let g,w="";const b=[],x=d??this._bufferService.buffer.lines.length,C=this._bufferService.buffer.lines;for(let k=m;k<x;k++){const L=C.get(k);if(!L)continue;const A=(S=C.get(k+1))==null?void 0:S.isWrapped;if(w+=L.translateToString(!A),!A||k===C.length-1){const M=document.createElement("div");M.textContent=w,b.push(M),w.length>0&&(g=M),w=""}}return{bufferElements:b,cursorElement:g}}getLinesScrolled(m){if(m.deltaY===0||m.shiftKey)return 0;let d=this._applyScrollModifier(m.deltaY,m);return m.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(d/=this._currentRowHeight+0,this._wheelPartialScroll+=d,d=Math.floor(Math.abs(this._wheelPartialScroll))*(this._wheelPartialScroll>0?1:-1),this._wheelPartialScroll%=1):m.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(d*=this._bufferService.rows),d}_applyScrollModifier(m,d){const g=this._optionsService.rawOptions.fastScrollModifier;return g==="alt"&&d.altKey||g==="ctrl"&&d.ctrlKey||g==="shift"&&d.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 d=this._lastTouchY-m.touches[0].pageY;return this._lastTouchY=m.touches[0].pageY,d!==0&&(this._viewportElement.scrollTop+=d,this._bubbleScroll(m,d))}};s.Viewport=h=c([f(2,v.IBufferService),f(3,v.IOptionsService),f(4,p.ICharSizeService),f(5,p.IRenderService),f(6,p.ICoreBrowserService),f(7,p.IThemeService)],h)},3107:function(l,s,o){var c=this&&this.__decorate||function(v,h,m,d){var g,w=arguments.length,b=w<3?h:d===null?d=Object.getOwnPropertyDescriptor(h,m):d;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")b=Reflect.decorate(v,h,m,d);else for(var x=v.length-1;x>=0;x--)(g=v[x])&&(b=(w<3?g(b):w>3?g(h,m,b):g(h,m))||b);return w>3&&b&&Object.defineProperty(h,m,b),b},f=this&&this.__param||function(v,h){return function(m,d){h(m,d,v)}};Object.defineProperty(s,"__esModule",{value:!0}),s.BufferDecorationRenderer=void 0;const u=o(4725),p=o(844),_=o(2585);let y=s.BufferDecorationRenderer=class extends p.Disposable{constructor(v,h,m,d,g){super(),this._screenElement=v,this._bufferService=h,this._coreBrowserService=m,this._decorationService=d,this._renderService=g,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(w=>this._removeDecoration(w))),this.register((0,p.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 v of this._decorationService.decorations)this._renderDecoration(v);this._dimensionsChanged=!1}_renderDecoration(v){this._refreshStyle(v),this._dimensionsChanged&&this._refreshXPosition(v)}_createElement(v){var d;const h=this._coreBrowserService.mainDocument.createElement("div");h.classList.add("xterm-decoration"),h.classList.toggle("xterm-decoration-top-layer",((d=v==null?void 0:v.options)==null?void 0:d.layer)==="top"),h.style.width=`${Math.round((v.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,h.style.height=(v.options.height||1)*this._renderService.dimensions.css.cell.height+"px",h.style.top=(v.marker.line-this._bufferService.buffers.active.ydisp)*this._renderService.dimensions.css.cell.height+"px",h.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`;const m=v.options.x??0;return m&&m>this._bufferService.cols&&(h.style.display="none"),this._refreshXPosition(v,h),h}_refreshStyle(v){const h=v.marker.line-this._bufferService.buffers.active.ydisp;if(h<0||h>=this._bufferService.rows)v.element&&(v.element.style.display="none",v.onRenderEmitter.fire(v.element));else{let m=this._decorationElements.get(v);m||(m=this._createElement(v),v.element=m,this._decorationElements.set(v,m),this._container.appendChild(m),v.onDispose(()=>{this._decorationElements.delete(v),m.remove()})),m.style.top=h*this._renderService.dimensions.css.cell.height+"px",m.style.display=this._altBufferIsActive?"none":"block",v.onRenderEmitter.fire(m)}}_refreshXPosition(v,h=v.element){if(!h)return;const m=v.options.x??0;(v.options.anchor||"left")==="right"?h.style.right=m?m*this._renderService.dimensions.css.cell.width+"px":"":h.style.left=m?m*this._renderService.dimensions.css.cell.width+"px":""}_removeDecoration(v){var h;(h=this._decorationElements.get(v))==null||h.remove(),this._decorationElements.delete(v),v.dispose()}};s.BufferDecorationRenderer=y=c([f(1,_.IBufferService),f(2,u.ICoreBrowserService),f(3,_.IDecorationService),f(4,u.IRenderService)],y)},5871:(l,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.ColorZoneStore=void 0,s.ColorZoneStore=class{constructor(){this._zones=[],this._zonePool=[],this._zonePoolIndex=0,this._linePadding={full:0,left:0,center:0,right:0}}get zones(){return this._zonePool.length=Math.min(this._zonePool.length,this._zones.length),this._zones}clear(){this._zones.length=0,this._zonePoolIndex=0}addDecoration(o){if(o.options.overviewRulerOptions){for(const c of this._zones)if(c.color===o.options.overviewRulerOptions.color&&c.position===o.options.overviewRulerOptions.position){if(this._lineIntersectsZone(c,o.marker.line))return;if(this._lineAdjacentToZone(c,o.marker.line,o.options.overviewRulerOptions.position))return void this._addLineToZone(c,o.marker.line)}if(this._zonePoolIndex<this._zonePool.length)return this._zonePool[this._zonePoolIndex].color=o.options.overviewRulerOptions.color,this._zonePool[this._zonePoolIndex].position=o.options.overviewRulerOptions.position,this._zonePool[this._zonePoolIndex].startBufferLine=o.marker.line,this._zonePool[this._zonePoolIndex].endBufferLine=o.marker.line,void this._zones.push(this._zonePool[this._zonePoolIndex++]);this._zones.push({color:o.options.overviewRulerOptions.color,position:o.options.overviewRulerOptions.position,startBufferLine:o.marker.line,endBufferLine:o.marker.line}),this._zonePool.push(this._zones[this._zones.length-1]),this._zonePoolIndex++}}setPadding(o){this._linePadding=o}_lineIntersectsZone(o,c){return c>=o.startBufferLine&&c<=o.endBufferLine}_lineAdjacentToZone(o,c,f){return c>=o.startBufferLine-this._linePadding[f||"full"]&&c<=o.endBufferLine+this._linePadding[f||"full"]}_addLineToZone(o,c){o.startBufferLine=Math.min(o.startBufferLine,c),o.endBufferLine=Math.max(o.endBufferLine,c)}}},5744:function(l,s,o){var c=this&&this.__decorate||function(g,w,b,x){var C,S=arguments.length,k=S<3?w:x===null?x=Object.getOwnPropertyDescriptor(w,b):x;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")k=Reflect.decorate(g,w,b,x);else for(var L=g.length-1;L>=0;L--)(C=g[L])&&(k=(S<3?C(k):S>3?C(w,b,k):C(w,b))||k);return S>3&&k&&Object.defineProperty(w,b,k),k},f=this&&this.__param||function(g,w){return function(b,x){w(b,x,g)}};Object.defineProperty(s,"__esModule",{value:!0}),s.OverviewRulerRenderer=void 0;const u=o(5871),p=o(4725),_=o(844),y=o(2585),v={full:0,left:0,center:0,right:0},h={full:0,left:0,center:0,right:0},m={full:0,left:0,center:0,right:0};let d=s.OverviewRulerRenderer=class extends _.Disposable{get _width(){return this._optionsService.options.overviewRulerWidth||0}constructor(g,w,b,x,C,S,k){var A;super(),this._viewportElement=g,this._screenElement=w,this._bufferService=b,this._decorationService=x,this._renderService=C,this._optionsService=S,this._coreBrowserService=k,this._colorZoneStore=new u.ColorZoneStore,this._shouldUpdateDimensions=!0,this._shouldUpdateAnchor=!0,this._lastKnownBufferLength=0,this._canvas=this._coreBrowserService.mainDocument.createElement("canvas"),this._canvas.classList.add("xterm-decoration-overview-ruler"),this._refreshCanvasDimensions(),(A=this._viewportElement.parentElement)==null||A.insertBefore(this._canvas,this._viewportElement);const L=this._canvas.getContext("2d");if(!L)throw new Error("Ctx cannot be null");this._ctx=L,this._registerDecorationListeners(),this._registerBufferChangeListeners(),this._registerDimensionChangeListeners(),this.register((0,_.toDisposable)(()=>{var M;(M=this._canvas)==null||M.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 g=Math.floor(this._canvas.width/3),w=Math.ceil(this._canvas.width/3);h.full=this._canvas.width,h.left=g,h.center=w,h.right=g,this._refreshDrawHeightConstants(),m.full=0,m.left=0,m.center=h.left,m.right=h.left+h.center}_refreshDrawHeightConstants(){v.full=Math.round(2*this._coreBrowserService.dpr);const g=this._canvas.height/this._bufferService.buffer.lines.length,w=Math.round(Math.max(Math.min(g,12),6)*this._coreBrowserService.dpr);v.left=w,v.center=w,v.right=w}_refreshColorZonePadding(){this._colorZoneStore.setPadding({full:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*v.full),left:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*v.left),center:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*v.center),right:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*v.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 w of this._decorationService.decorations)this._colorZoneStore.addDecoration(w);this._ctx.lineWidth=1;const g=this._colorZoneStore.zones;for(const w of g)w.position!=="full"&&this._renderColorZone(w);for(const w of g)w.position==="full"&&this._renderColorZone(w);this._shouldUpdateDimensions=!1,this._shouldUpdateAnchor=!1}_renderColorZone(g){this._ctx.fillStyle=g.color,this._ctx.fillRect(m[g.position||"full"],Math.round((this._canvas.height-1)*(g.startBufferLine/this._bufferService.buffers.active.lines.length)-v[g.position||"full"]/2),h[g.position||"full"],Math.round((this._canvas.height-1)*((g.endBufferLine-g.startBufferLine)/this._bufferService.buffers.active.lines.length)+v[g.position||"full"]))}_queueRefresh(g,w){this._shouldUpdateDimensions=g||this._shouldUpdateDimensions,this._shouldUpdateAnchor=w||this._shouldUpdateAnchor,this._animationFrame===void 0&&(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>{this._refreshDecorations(),this._animationFrame=void 0}))}};s.OverviewRulerRenderer=d=c([f(2,y.IBufferService),f(3,y.IDecorationService),f(4,p.IRenderService),f(5,y.IOptionsService),f(6,p.ICoreBrowserService)],d)},2950:function(l,s,o){var c=this&&this.__decorate||function(v,h,m,d){var g,w=arguments.length,b=w<3?h:d===null?d=Object.getOwnPropertyDescriptor(h,m):d;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")b=Reflect.decorate(v,h,m,d);else for(var x=v.length-1;x>=0;x--)(g=v[x])&&(b=(w<3?g(b):w>3?g(h,m,b):g(h,m))||b);return w>3&&b&&Object.defineProperty(h,m,b),b},f=this&&this.__param||function(v,h){return function(m,d){h(m,d,v)}};Object.defineProperty(s,"__esModule",{value:!0}),s.CompositionHelper=void 0;const u=o(4725),p=o(2585),_=o(2584);let y=s.CompositionHelper=class{get isComposing(){return this._isComposing}constructor(v,h,m,d,g,w){this._textarea=v,this._compositionView=h,this._bufferService=m,this._optionsService=d,this._coreService=g,this._renderService=w,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(v){this._compositionView.textContent=v.data,this.updateCompositionElements(),setTimeout(()=>{this._compositionPosition.end=this._textarea.value.length},0)}compositionend(){this._finalizeComposition(!0)}keydown(v){if(this._isComposing||this._isSendingComposition){if(v.keyCode===229||v.keyCode===16||v.keyCode===17||v.keyCode===18)return!1;this._finalizeComposition(!1)}return v.keyCode!==229||(this._handleAnyTextareaChanges(),!1)}_finalizeComposition(v){if(this._compositionView.classList.remove("active"),this._isComposing=!1,v){const h={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout(()=>{if(this._isSendingComposition){let m;this._isSendingComposition=!1,h.start+=this._dataAlreadySent.length,m=this._isComposing?this._textarea.value.substring(h.start,h.end):this._textarea.value.substring(h.start),m.length>0&&this._coreService.triggerDataEvent(m,!0)}},0)}else{this._isSendingComposition=!1;const h=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(h,!0)}}_handleAnyTextareaChanges(){const v=this._textarea.value;setTimeout(()=>{if(!this._isComposing){const h=this._textarea.value,m=h.replace(v,"");this._dataAlreadySent=m,h.length>v.length?this._coreService.triggerDataEvent(m,!0):h.length<v.length?this._coreService.triggerDataEvent(`${_.C0.DEL}`,!0):h.length===v.length&&h!==v&&this._coreService.triggerDataEvent(h,!0)}},0)}updateCompositionElements(v){if(this._isComposing){if(this._bufferService.buffer.isCursorInViewport){const h=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1),m=this._renderService.dimensions.css.cell.height,d=this._bufferService.buffer.y*this._renderService.dimensions.css.cell.height,g=h*this._renderService.dimensions.css.cell.width;this._compositionView.style.left=g+"px",this._compositionView.style.top=d+"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 w=this._compositionView.getBoundingClientRect();this._textarea.style.left=g+"px",this._textarea.style.top=d+"px",this._textarea.style.width=Math.max(w.width,1)+"px",this._textarea.style.height=Math.max(w.height,1)+"px",this._textarea.style.lineHeight=w.height+"px"}v||setTimeout(()=>this.updateCompositionElements(!0),0)}}};s.CompositionHelper=y=c([f(2,p.IBufferService),f(3,p.IOptionsService),f(4,p.ICoreService),f(5,u.IRenderService)],y)},9806:(l,s)=>{function o(c,f,u){const p=u.getBoundingClientRect(),_=c.getComputedStyle(u),y=parseInt(_.getPropertyValue("padding-left")),v=parseInt(_.getPropertyValue("padding-top"));return[f.clientX-p.left-y,f.clientY-p.top-v]}Object.defineProperty(s,"__esModule",{value:!0}),s.getCoords=s.getCoordsRelativeToElement=void 0,s.getCoordsRelativeToElement=o,s.getCoords=function(c,f,u,p,_,y,v,h,m){if(!y)return;const d=o(c,f,u);return d?(d[0]=Math.ceil((d[0]+(m?v/2:0))/v),d[1]=Math.ceil(d[1]/h),d[0]=Math.min(Math.max(d[0],1),p+(m?1:0)),d[1]=Math.min(Math.max(d[1],1),_),d):void 0}},9504:(l,s,o)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.moveToCellSequence=void 0;const c=o(2584);function f(h,m,d,g){const w=h-u(h,d),b=m-u(m,d),x=Math.abs(w-b)-function(C,S,k){let L=0;const A=C-u(C,k),M=S-u(S,k);for(let D=0;D<Math.abs(A-M);D++){const O=p(C,S)==="A"?-1:1,z=k.buffer.lines.get(A+O*D);z!=null&&z.isWrapped&&L++}return L}(h,m,d);return v(x,y(p(h,m),g))}function u(h,m){let d=0,g=m.buffer.lines.get(h),w=g==null?void 0:g.isWrapped;for(;w&&h>=0&&h<m.rows;)d++,g=m.buffer.lines.get(--h),w=g==null?void 0:g.isWrapped;return d}function p(h,m){return h>m?"A":"B"}function _(h,m,d,g,w,b){let x=h,C=m,S="";for(;x!==d||C!==g;)x+=w?1:-1,w&&x>b.cols-1?(S+=b.buffer.translateBufferLineToString(C,!1,h,x),x=0,h=0,C++):!w&&x<0&&(S+=b.buffer.translateBufferLineToString(C,!1,0,h+1),x=b.cols-1,h=x,C--);return S+b.buffer.translateBufferLineToString(C,!1,h,x)}function y(h,m){const d=m?"O":"[";return c.C0.ESC+d+h}function v(h,m){h=Math.floor(h);let d="";for(let g=0;g<h;g++)d+=m;return d}s.moveToCellSequence=function(h,m,d,g){const w=d.buffer.x,b=d.buffer.y;if(!d.buffer.hasScrollback)return function(S,k,L,A,M,D){return f(k,A,M,D).length===0?"":v(_(S,k,S,k-u(k,M),!1,M).length,y("D",D))}(w,b,0,m,d,g)+f(b,m,d,g)+function(S,k,L,A,M,D){let O;O=f(k,A,M,D).length>0?A-u(A,M):k;const z=A,F=function(H,I,R,P,N,j){let W;return W=f(R,P,N,j).length>0?P-u(P,N):I,H<R&&W<=P||H>=R&&W<P?"C":"D"}(S,k,L,A,M,D);return v(_(S,O,L,z,F==="C",M).length,y(F,D))}(w,b,h,m,d,g);let x;if(b===m)return x=w>h?"D":"C",v(Math.abs(w-h),y(x,g));x=b>m?"D":"C";const C=Math.abs(b-m);return v(function(S,k){return k.cols-S}(b>m?h:w,d)+(C-1)*d.cols+1+((b>m?w:h)-1),y(x,g))}},1296:function(l,s,o){var c=this&&this.__decorate||function(D,O,z,F){var H,I=arguments.length,R=I<3?O:F===null?F=Object.getOwnPropertyDescriptor(O,z):F;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")R=Reflect.decorate(D,O,z,F);else for(var P=D.length-1;P>=0;P--)(H=D[P])&&(R=(I<3?H(R):I>3?H(O,z,R):H(O,z))||R);return I>3&&R&&Object.defineProperty(O,z,R),R},f=this&&this.__param||function(D,O){return function(z,F){O(z,F,D)}};Object.defineProperty(s,"__esModule",{value:!0}),s.DomRenderer=void 0;const u=o(3787),p=o(2550),_=o(2223),y=o(6171),v=o(6052),h=o(4725),m=o(8055),d=o(8460),g=o(844),w=o(2585),b="xterm-dom-renderer-owner-",x="xterm-rows",C="xterm-fg-",S="xterm-bg-",k="xterm-focus",L="xterm-selection";let A=1,M=s.DomRenderer=class extends g.Disposable{constructor(D,O,z,F,H,I,R,P,N,j,W,V,Z){super(),this._terminal=D,this._document=O,this._element=z,this._screenElement=F,this._viewportElement=H,this._helperContainer=I,this._linkifier2=R,this._charSizeService=N,this._optionsService=j,this._bufferService=W,this._coreBrowserService=V,this._themeService=Z,this._terminalClass=A++,this._rowElements=[],this._selectionRenderModel=(0,v.createSelectionRenderModel)(),this.onRequestRedraw=this.register(new d.EventEmitter).event,this._rowContainer=this._document.createElement("div"),this._rowContainer.classList.add(x),this._rowContainer.style.lineHeight="normal",this._rowContainer.setAttribute("aria-hidden","true"),this._refreshRowElements(this._bufferService.cols,this._bufferService.rows),this._selectionContainer=this._document.createElement("div"),this._selectionContainer.classList.add(L),this._selectionContainer.setAttribute("aria-hidden","true"),this.dimensions=(0,y.createRenderDimensions)(),this._updateDimensions(),this.register(this._optionsService.onOptionChange(()=>this._handleOptionsChanged())),this.register(this._themeService.onChangeColors(Q=>this._injectCss(Q))),this._injectCss(this._themeService.colors),this._rowFactory=P.createInstance(u.DomRendererRowFactory,document),this._element.classList.add(b+this._terminalClass),this._screenElement.appendChild(this._rowContainer),this._screenElement.appendChild(this._selectionContainer),this.register(this._linkifier2.onShowLinkUnderline(Q=>this._handleLinkHover(Q))),this.register(this._linkifier2.onHideLinkUnderline(Q=>this._handleLinkLeave(Q))),this.register((0,g.toDisposable)(()=>{this._element.classList.remove(b+this._terminalClass),this._rowContainer.remove(),this._selectionContainer.remove(),this._widthCache.dispose(),this._themeStyleElement.remove(),this._dimensionsStyleElement.remove()})),this._widthCache=new p.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 z of this._rowElements)z.style.width=`${this.dimensions.css.canvas.width}px`,z.style.height=`${this.dimensions.css.cell.height}px`,z.style.lineHeight=`${this.dimensions.css.cell.height}px`,z.style.overflow="hidden";this._dimensionsStyleElement||(this._dimensionsStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._dimensionsStyleElement));const O=`${this._terminalSelector} .${x} span { display: inline-block; height: 100%; vertical-align: top;}`;this._dimensionsStyleElement.textContent=O,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 O=`${this._terminalSelector} .${x} { color: ${D.foreground.css}; font-family: ${this._optionsService.rawOptions.fontFamily}; font-size: ${this._optionsService.rawOptions.fontSize}px; font-kerning: none; white-space: pre}`;O+=`${this._terminalSelector} .${x} .xterm-dim { color: ${m.color.multiplyOpacity(D.foreground,.5).css};}`,O+=`${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 z=`blink_underline_${this._terminalClass}`,F=`blink_bar_${this._terminalClass}`,H=`blink_block_${this._terminalClass}`;O+=`@keyframes ${z} { 50% { border-bottom-style: hidden; }}`,O+=`@keyframes ${F} { 50% { box-shadow: none; }}`,O+=`@keyframes ${H} { 0% { background-color: ${D.cursor.css}; color: ${D.cursorAccent.css}; } 50% { background-color: inherit; color: ${D.cursor.css}; }}`,O+=`${this._terminalSelector} .${x}.${k} .xterm-cursor.xterm-cursor-blink.xterm-cursor-underline { animation: ${z} 1s step-end infinite;}${this._terminalSelector} .${x}.${k} .xterm-cursor.xterm-cursor-blink.xterm-cursor-bar { animation: ${F} 1s step-end infinite;}${this._terminalSelector} .${x}.${k} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: ${H} 1s step-end infinite;}${this._terminalSelector} .${x} .xterm-cursor.xterm-cursor-block { background-color: ${D.cursor.css}; color: ${D.cursorAccent.css};}${this._terminalSelector} .${x} .xterm-cursor.xterm-cursor-block:not(.xterm-cursor-blink) { background-color: ${D.cursor.css} !important; color: ${D.cursorAccent.css} !important;}${this._terminalSelector} .${x} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${D.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${x} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${D.cursor.css} inset;}${this._terminalSelector} .${x} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${D.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,O+=`${this._terminalSelector} .${L} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${L} div { position: absolute; background-color: ${D.selectionBackgroundOpaque.css};}${this._terminalSelector} .${L} div { position: absolute; background-color: ${D.selectionInactiveBackgroundOpaque.css};}`;for(const[I,R]of D.ansi.entries())O+=`${this._terminalSelector} .${C}${I} { color: ${R.css}; }${this._terminalSelector} .${C}${I}.xterm-dim { color: ${m.color.multiplyOpacity(R,.5).css}; }${this._terminalSelector} .${S}${I} { background-color: ${R.css}; }`;O+=`${this._terminalSelector} .${C}${_.INVERTED_DEFAULT_COLOR} { color: ${m.color.opaque(D.background).css}; }${this._terminalSelector} .${C}${_.INVERTED_DEFAULT_COLOR}.xterm-dim { color: ${m.color.multiplyOpacity(m.color.opaque(D.background),.5).css}; }${this._terminalSelector} .${S}${_.INVERTED_DEFAULT_COLOR} { background-color: ${D.foreground.css}; }`,this._themeStyleElement.textContent=O}_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,O){for(let z=this._rowElements.length;z<=O;z++){const F=this._document.createElement("div");this._rowContainer.appendChild(F),this._rowElements.push(F)}for(;this._rowElements.length>O;)this._rowContainer.removeChild(this._rowElements.pop())}handleResize(D,O){this._refreshRowElements(D,O),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(k),this.renderRows(0,this._bufferService.rows-1)}handleFocus(){this._rowContainer.classList.add(k),this.renderRows(this._bufferService.buffer.y,this._bufferService.buffer.y)}handleSelectionChanged(D,O,z){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged(D,O,z),this.renderRows(0,this._bufferService.rows-1),!D||!O)return;this._selectionRenderModel.update(this._terminal,D,O,z);const F=this._selectionRenderModel.viewportStartRow,H=this._selectionRenderModel.viewportEndRow,I=this._selectionRenderModel.viewportCappedStartRow,R=this._selectionRenderModel.viewportCappedEndRow;if(I>=this._bufferService.rows||R<0)return;const P=this._document.createDocumentFragment();if(z){const N=D[0]>O[0];P.appendChild(this._createSelectionElement(I,N?O[0]:D[0],N?D[0]:O[0],R-I+1))}else{const N=F===I?D[0]:0,j=I===H?O[0]:this._bufferService.cols;P.appendChild(this._createSelectionElement(I,N,j));const W=R-I-1;if(P.appendChild(this._createSelectionElement(I+1,0,this._bufferService.cols,W)),I!==R){const V=H===R?O[0]:this._bufferService.cols;P.appendChild(this._createSelectionElement(R,0,V))}}this._selectionContainer.appendChild(P)}_createSelectionElement(D,O,z,F=1){const H=this._document.createElement("div"),I=O*this.dimensions.css.cell.width;let R=this.dimensions.css.cell.width*(z-O);return I+R>this.dimensions.css.canvas.width&&(R=this.dimensions.css.canvas.width-I),H.style.height=F*this.dimensions.css.cell.height+"px",H.style.top=D*this.dimensions.css.cell.height+"px",H.style.left=`${I}px`,H.style.width=`${R}px`,H}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,O){const z=this._bufferService.buffer,F=z.ybase+z.y,H=Math.min(z.x,this._bufferService.cols-1),I=this._optionsService.rawOptions.cursorBlink,R=this._optionsService.rawOptions.cursorStyle,P=this._optionsService.rawOptions.cursorInactiveStyle;for(let N=D;N<=O;N++){const j=N+z.ydisp,W=this._rowElements[N],V=z.lines.get(j);if(!W||!V)break;W.replaceChildren(...this._rowFactory.createRow(V,j,j===F,R,P,H,I,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${b}${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,O,z,F,H,I){z<0&&(D=0),F<0&&(O=0);const R=this._bufferService.rows-1;z=Math.max(Math.min(z,R),0),F=Math.max(Math.min(F,R),0),H=Math.min(H,this._bufferService.cols);const P=this._bufferService.buffer,N=P.ybase+P.y,j=Math.min(P.x,H-1),W=this._optionsService.rawOptions.cursorBlink,V=this._optionsService.rawOptions.cursorStyle,Z=this._optionsService.rawOptions.cursorInactiveStyle;for(let Q=z;Q<=F;++Q){const $=Q+P.ydisp,B=this._rowElements[Q],K=P.lines.get($);if(!B||!K)break;B.replaceChildren(...this._rowFactory.createRow(K,$,$===N,V,Z,j,W,this.dimensions.css.cell.width,this._widthCache,I?Q===z?D:0:-1,I?(Q===F?O:H)-1:-1))}}};s.DomRenderer=M=c([f(7,w.IInstantiationService),f(8,h.ICharSizeService),f(9,w.IOptionsService),f(10,w.IBufferService),f(11,h.ICoreBrowserService),f(12,h.IThemeService)],M)},3787:function(l,s,o){var c=this&&this.__decorate||function(x,C,S,k){var L,A=arguments.length,M=A<3?C:k===null?k=Object.getOwnPropertyDescriptor(C,S):k;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")M=Reflect.decorate(x,C,S,k);else for(var D=x.length-1;D>=0;D--)(L=x[D])&&(M=(A<3?L(M):A>3?L(C,S,M):L(C,S))||M);return A>3&&M&&Object.defineProperty(C,S,M),M},f=this&&this.__param||function(x,C){return function(S,k){C(S,k,x)}};Object.defineProperty(s,"__esModule",{value:!0}),s.DomRendererRowFactory=void 0;const u=o(2223),p=o(643),_=o(511),y=o(2585),v=o(8055),h=o(4725),m=o(4269),d=o(6171),g=o(3734);let w=s.DomRendererRowFactory=class{constructor(x,C,S,k,L,A,M){this._document=x,this._characterJoinerService=C,this._optionsService=S,this._coreBrowserService=k,this._coreService=L,this._decorationService=A,this._themeService=M,this._workCell=new _.CellData,this._columnSelectMode=!1,this.defaultSpacing=0}handleSelectionChanged(x,C,S){this._selectionStart=x,this._selectionEnd=C,this._columnSelectMode=S}createRow(x,C,S,k,L,A,M,D,O,z,F){const H=[],I=this._characterJoinerService.getJoinedCharacters(C),R=this._themeService.colors;let P,N=x.getNoBgTrimmedLength();S&&N<A+1&&(N=A+1);let j=0,W="",V=0,Z=0,Q=0,$=!1,B=0,K=!1,U=0;const te=[],Y=z!==-1&&F!==-1;for(let ye=0;ye<N;ye++){x.loadCell(ye,this._workCell);let pe=this._workCell.getWidth();if(pe===0)continue;let ne=!1,oe=ye,ce=this._workCell;if(I.length>0&&ye===I[0][0]){ne=!0;const Le=I.shift();ce=new m.JoinedCellData(this._workCell,x.translateToString(!0,Le[0],Le[1]),Le[1]-Le[0]),oe=Le[1]-1,pe=ce.getWidth()}const ue=this._isCellInSelection(ye,C),ve=S&&ye===A,se=Y&&ye>=z&&ye<=F;let ae=!1;this._decorationService.forEachDecorationAtCell(ye,C,void 0,Le=>{ae=!0});let fe=ce.getChars()||p.WHITESPACE_CELL_CHAR;if(fe===" "&&(ce.isUnderline()||ce.isOverline())&&(fe=" "),U=pe*D-O.get(fe,ce.isBold(),ce.isItalic()),P){if(j&&(ue&&K||!ue&&!K&&ce.bg===V)&&(ue&&K&&R.selectionForeground||ce.fg===Z)&&ce.extended.ext===Q&&se===$&&U===B&&!ve&&!ne&&!ae){ce.isInvisible()?W+=p.WHITESPACE_CELL_CHAR:W+=fe,j++;continue}j&&(P.textContent=W),P=this._document.createElement("span"),j=0,W=""}else P=this._document.createElement("span");if(V=ce.bg,Z=ce.fg,Q=ce.extended.ext,$=se,B=U,K=ue,ne&&A>=ye&&A<=oe&&(A=ye),!this._coreService.isCursorHidden&&ve&&this._coreService.isCursorInitialized){if(te.push("xterm-cursor"),this._coreBrowserService.isFocused)M&&te.push("xterm-cursor-blink"),te.push(k==="bar"?"xterm-cursor-bar":k==="underline"?"xterm-cursor-underline":"xterm-cursor-block");else if(L)switch(L){case"outline":te.push("xterm-cursor-outline");break;case"block":te.push("xterm-cursor-block");break;case"bar":te.push("xterm-cursor-bar");break;case"underline":te.push("xterm-cursor-underline")}}if(ce.isBold()&&te.push("xterm-bold"),ce.isItalic()&&te.push("xterm-italic"),ce.isDim()&&te.push("xterm-dim"),W=ce.isInvisible()?p.WHITESPACE_CELL_CHAR:ce.getChars()||p.WHITESPACE_CELL_CHAR,ce.isUnderline()&&(te.push(`xterm-underline-${ce.extended.underlineStyle}`),W===" "&&(W=" "),!ce.isUnderlineColorDefault()))if(ce.isUnderlineColorRGB())P.style.textDecorationColor=`rgb(${g.AttributeData.toColorRGB(ce.getUnderlineColor()).join(",")})`;else{let Le=ce.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&ce.isBold()&&Le<8&&(Le+=8),P.style.textDecorationColor=R.ansi[Le].css}ce.isOverline()&&(te.push("xterm-overline"),W===" "&&(W=" ")),ce.isStrikethrough()&&te.push("xterm-strikethrough"),se&&(P.style.textDecoration="underline");let ie=ce.getFgColor(),ge=ce.getFgColorMode(),be=ce.getBgColor(),Te=ce.getBgColorMode();const je=!!ce.isInverse();if(je){const Le=ie;ie=be,be=Le;const Qe=ge;ge=Te,Te=Qe}let He,Pe,Oe,ke=!1;switch(this._decorationService.forEachDecorationAtCell(ye,C,void 0,Le=>{Le.options.layer!=="top"&&ke||(Le.backgroundColorRGB&&(Te=50331648,be=Le.backgroundColorRGB.rgba>>8&16777215,He=Le.backgroundColorRGB),Le.foregroundColorRGB&&(ge=50331648,ie=Le.foregroundColorRGB.rgba>>8&16777215,Pe=Le.foregroundColorRGB),ke=Le.options.layer==="top")}),!ke&&ue&&(He=this._coreBrowserService.isFocused?R.selectionBackgroundOpaque:R.selectionInactiveBackgroundOpaque,be=He.rgba>>8&16777215,Te=50331648,ke=!0,R.selectionForeground&&(ge=50331648,ie=R.selectionForeground.rgba>>8&16777215,Pe=R.selectionForeground)),ke&&te.push("xterm-decoration-top"),Te){case 16777216:case 33554432:Oe=R.ansi[be],te.push(`xterm-bg-${be}`);break;case 50331648:Oe=v.channels.toColor(be>>16,be>>8&255,255&be),this._addStyle(P,`background-color:#${b((be>>>0).toString(16),"0",6)}`);break;default:je?(Oe=R.foreground,te.push(`xterm-bg-${u.INVERTED_DEFAULT_COLOR}`)):Oe=R.background}switch(He||ce.isDim()&&(He=v.color.multiplyOpacity(Oe,.5)),ge){case 16777216:case 33554432:ce.isBold()&&ie<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(ie+=8),this._applyMinimumContrast(P,Oe,R.ansi[ie],ce,He,void 0)||te.push(`xterm-fg-${ie}`);break;case 50331648:const Le=v.channels.toColor(ie>>16&255,ie>>8&255,255&ie);this._applyMinimumContrast(P,Oe,Le,ce,He,Pe)||this._addStyle(P,`color:#${b(ie.toString(16),"0",6)}`);break;default:this._applyMinimumContrast(P,Oe,R.foreground,ce,He,Pe)||je&&te.push(`xterm-fg-${u.INVERTED_DEFAULT_COLOR}`)}te.length&&(P.className=te.join(" "),te.length=0),ve||ne||ae?P.textContent=W:j++,U!==this.defaultSpacing&&(P.style.letterSpacing=`${U}px`),H.push(P),ye=oe}return P&&j&&(P.textContent=W),H}_applyMinimumContrast(x,C,S,k,L,A){if(this._optionsService.rawOptions.minimumContrastRatio===1||(0,d.treatGlyphAsBackgroundColor)(k.getCode()))return!1;const M=this._getContrastCache(k);let D;if(L||A||(D=M.getColor(C.rgba,S.rgba)),D===void 0){const O=this._optionsService.rawOptions.minimumContrastRatio/(k.isDim()?2:1);D=v.color.ensureContrastRatio(L||C,A||S,O),M.setColor((L||C).rgba,(A||S).rgba,D??null)}return!!D&&(this._addStyle(x,`color:${D.css}`),!0)}_getContrastCache(x){return x.isDim()?this._themeService.colors.halfContrastCache:this._themeService.colors.contrastCache}_addStyle(x,C){x.setAttribute("style",`${x.getAttribute("style")||""}${C};`)}_isCellInSelection(x,C){const S=this._selectionStart,k=this._selectionEnd;return!(!S||!k)&&(this._columnSelectMode?S[0]<=k[0]?x>=S[0]&&C>=S[1]&&x<k[0]&&C<=k[1]:x<S[0]&&C>=S[1]&&x>=k[0]&&C<=k[1]:C>S[1]&&C<k[1]||S[1]===k[1]&&C===S[1]&&x>=S[0]&&x<k[0]||S[1]<k[1]&&C===k[1]&&x<k[0]||S[1]<k[1]&&C===S[1]&&x>=S[0])}};function b(x,C,S){for(;x.length<S;)x=C+x;return x}s.DomRendererRowFactory=w=c([f(1,h.ICharacterJoinerService),f(2,y.IOptionsService),f(3,h.ICoreBrowserService),f(4,y.ICoreService),f(5,y.IDecorationService),f(6,h.IThemeService)],w)},2550:(l,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.WidthCache=void 0,s.WidthCache=class{constructor(o,c){this._flat=new Float32Array(256),this._font="",this._fontSize=0,this._weight="normal",this._weightBold="bold",this._measureElements=[],this._container=o.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 f=o.createElement("span");f.classList.add("xterm-char-measure-element");const u=o.createElement("span");u.classList.add("xterm-char-measure-element"),u.style.fontWeight="bold";const p=o.createElement("span");p.classList.add("xterm-char-measure-element"),p.style.fontStyle="italic";const _=o.createElement("span");_.classList.add("xterm-char-measure-element"),_.style.fontWeight="bold",_.style.fontStyle="italic",this._measureElements=[f,u,p,_],this._container.appendChild(f),this._container.appendChild(u),this._container.appendChild(p),this._container.appendChild(_),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(o,c,f,u){o===this._font&&c===this._fontSize&&f===this._weight&&u===this._weightBold||(this._font=o,this._fontSize=c,this._weight=f,this._weightBold=u,this._container.style.fontFamily=this._font,this._container.style.fontSize=`${this._fontSize}px`,this._measureElements[0].style.fontWeight=`${f}`,this._measureElements[1].style.fontWeight=`${u}`,this._measureElements[2].style.fontWeight=`${f}`,this._measureElements[3].style.fontWeight=`${u}`,this.clear())}get(o,c,f){let u=0;if(!c&&!f&&o.length===1&&(u=o.charCodeAt(0))<256){if(this._flat[u]!==-9999)return this._flat[u];const y=this._measure(o,0);return y>0&&(this._flat[u]=y),y}let p=o;c&&(p+="B"),f&&(p+="I");let _=this._holey.get(p);if(_===void 0){let y=0;c&&(y|=1),f&&(y|=2),_=this._measure(o,y),_>0&&this._holey.set(p,_)}return _}_measure(o,c){const f=this._measureElements[c];return f.textContent=o.repeat(32),f.offsetWidth/32}}},2223:(l,s,o)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.TEXT_BASELINE=s.DIM_OPACITY=s.INVERTED_DEFAULT_COLOR=void 0;const c=o(6114);s.INVERTED_DEFAULT_COLOR=257,s.DIM_OPACITY=.5,s.TEXT_BASELINE=c.isFirefox||c.isLegacyEdge?"bottom":"ideographic"},6171:(l,s)=>{function o(f){return 57508<=f&&f<=57558}function c(f){return f>=128512&&f<=128591||f>=127744&&f<=128511||f>=128640&&f<=128767||f>=9728&&f<=9983||f>=9984&&f<=10175||f>=65024&&f<=65039||f>=129280&&f<=129535||f>=127462&&f<=127487}Object.defineProperty(s,"__esModule",{value:!0}),s.computeNextVariantOffset=s.createRenderDimensions=s.treatGlyphAsBackgroundColor=s.allowRescaling=s.isEmoji=s.isRestrictedPowerlineGlyph=s.isPowerlineGlyph=s.throwIfFalsy=void 0,s.throwIfFalsy=function(f){if(!f)throw new Error("value must not be falsy");return f},s.isPowerlineGlyph=o,s.isRestrictedPowerlineGlyph=function(f){return 57520<=f&&f<=57527},s.isEmoji=c,s.allowRescaling=function(f,u,p,_){return u===1&&p>Math.ceil(1.5*_)&&f!==void 0&&f>255&&!c(f)&&!o(f)&&!function(y){return 57344<=y&&y<=63743}(f)},s.treatGlyphAsBackgroundColor=function(f){return o(f)||function(u){return 9472<=u&&u<=9631}(f)},s.createRenderDimensions=function(){return{css:{canvas:{width:0,height:0},cell:{width:0,height:0}},device:{canvas:{width:0,height:0},cell:{width:0,height:0},char:{width:0,height:0,left:0,top:0}}}},s.computeNextVariantOffset=function(f,u,p=0){return(f-(2*Math.round(u)-p))%(2*Math.round(u))}},6052:(l,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.createSelectionRenderModel=void 0;class o{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(f,u,p,_=!1){if(this.selectionStart=u,this.selectionEnd=p,!u||!p||u[0]===p[0]&&u[1]===p[1])return void this.clear();const y=f.buffers.active.ydisp,v=u[1]-y,h=p[1]-y,m=Math.max(v,0),d=Math.min(h,f.rows-1);m>=f.rows||d<0?this.clear():(this.hasSelection=!0,this.columnSelectMode=_,this.viewportStartRow=v,this.viewportEndRow=h,this.viewportCappedStartRow=m,this.viewportCappedEndRow=d,this.startCol=u[0],this.endCol=p[0])}isCellSelected(f,u,p){return!!this.hasSelection&&(p-=f.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?u>=this.startCol&&p>=this.viewportCappedStartRow&&u<this.endCol&&p<=this.viewportCappedEndRow:u<this.startCol&&p>=this.viewportCappedStartRow&&u>=this.endCol&&p<=this.viewportCappedEndRow:p>this.viewportStartRow&&p<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&p===this.viewportStartRow&&u>=this.startCol&&u<this.endCol||this.viewportStartRow<this.viewportEndRow&&p===this.viewportEndRow&&u<this.endCol||this.viewportStartRow<this.viewportEndRow&&p===this.viewportStartRow&&u>=this.startCol)}}s.createSelectionRenderModel=function(){return new o}},456:(l,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.SelectionModel=void 0,s.SelectionModel=class{constructor(o){this._bufferService=o,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 o=this.selectionStart[0]+this.selectionStartLength;return o>this._bufferService.cols?o%this._bufferService.cols==0?[this._bufferService.cols,this.selectionStart[1]+Math.floor(o/this._bufferService.cols)-1]:[o%this._bufferService.cols,this.selectionStart[1]+Math.floor(o/this._bufferService.cols)]:[o,this.selectionStart[1]]}if(this.selectionStartLength&&this.selectionEnd[1]===this.selectionStart[1]){const o=this.selectionStart[0]+this.selectionStartLength;return o>this._bufferService.cols?[o%this._bufferService.cols,this.selectionStart[1]+Math.floor(o/this._bufferService.cols)]:[Math.max(o,this.selectionEnd[0]),this.selectionEnd[1]]}return this.selectionEnd}}areSelectionValuesReversed(){const o=this.selectionStart,c=this.selectionEnd;return!(!o||!c)&&(o[1]>c[1]||o[1]===c[1]&&o[0]>c[0])}handleTrim(o){return this.selectionStart&&(this.selectionStart[1]-=o),this.selectionEnd&&(this.selectionEnd[1]-=o),this.selectionEnd&&this.selectionEnd[1]<0?(this.clearSelection(),!0):(this.selectionStart&&this.selectionStart[1]<0&&(this.selectionStart[1]=0),!1)}}},428:function(l,s,o){var c=this&&this.__decorate||function(d,g,w,b){var x,C=arguments.length,S=C<3?g:b===null?b=Object.getOwnPropertyDescriptor(g,w):b;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")S=Reflect.decorate(d,g,w,b);else for(var k=d.length-1;k>=0;k--)(x=d[k])&&(S=(C<3?x(S):C>3?x(g,w,S):x(g,w))||S);return C>3&&S&&Object.defineProperty(g,w,S),S},f=this&&this.__param||function(d,g){return function(w,b){g(w,b,d)}};Object.defineProperty(s,"__esModule",{value:!0}),s.CharSizeService=void 0;const u=o(2585),p=o(8460),_=o(844);let y=s.CharSizeService=class extends _.Disposable{get hasValidSize(){return this.width>0&&this.height>0}constructor(d,g,w){super(),this._optionsService=w,this.width=0,this.height=0,this._onCharSizeChange=this.register(new p.EventEmitter),this.onCharSizeChange=this._onCharSizeChange.event;try{this._measureStrategy=this.register(new m(this._optionsService))}catch{this._measureStrategy=this.register(new h(d,g,this._optionsService))}this.register(this._optionsService.onMultipleOptionChange(["fontFamily","fontSize"],()=>this.measure()))}measure(){const d=this._measureStrategy.measure();d.width===this.width&&d.height===this.height||(this.width=d.width,this.height=d.height,this._onCharSizeChange.fire())}};s.CharSizeService=y=c([f(2,u.IOptionsService)],y);class v extends _.Disposable{constructor(){super(...arguments),this._result={width:0,height:0}}_validateAndSet(g,w){g!==void 0&&g>0&&w!==void 0&&w>0&&(this._result.width=g,this._result.height=w)}}class h extends v{constructor(g,w,b){super(),this._document=g,this._parentElement=w,this._optionsService=b,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 v{constructor(g){super(),this._optionsService=g,this._canvas=new OffscreenCanvas(100,100),this._ctx=this._canvas.getContext("2d");const w=this._ctx.measureText("W");if(!("width"in w&&"fontBoundingBoxAscent"in w&&"fontBoundingBoxDescent"in w))throw new Error("Required font metrics not supported")}measure(){this._ctx.font=`${this._optionsService.rawOptions.fontSize}px ${this._optionsService.rawOptions.fontFamily}`;const g=this._ctx.measureText("W");return this._validateAndSet(g.width,g.fontBoundingBoxAscent+g.fontBoundingBoxDescent),this._result}}},4269:function(l,s,o){var c=this&&this.__decorate||function(m,d,g,w){var b,x=arguments.length,C=x<3?d:w===null?w=Object.getOwnPropertyDescriptor(d,g):w;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")C=Reflect.decorate(m,d,g,w);else for(var S=m.length-1;S>=0;S--)(b=m[S])&&(C=(x<3?b(C):x>3?b(d,g,C):b(d,g))||C);return x>3&&C&&Object.defineProperty(d,g,C),C},f=this&&this.__param||function(m,d){return function(g,w){d(g,w,m)}};Object.defineProperty(s,"__esModule",{value:!0}),s.CharacterJoinerService=s.JoinedCellData=void 0;const u=o(3734),p=o(643),_=o(511),y=o(2585);class v extends u.AttributeData{constructor(d,g,w){super(),this.content=0,this.combinedData="",this.fg=d.fg,this.bg=d.bg,this.combinedData=g,this._width=w}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(d){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}s.JoinedCellData=v;let h=s.CharacterJoinerService=class vw{constructor(d){this._bufferService=d,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new _.CellData}register(d){const g={id:this._nextCharacterJoinerId++,handler:d};return this._characterJoiners.push(g),g.id}deregister(d){for(let g=0;g<this._characterJoiners.length;g++)if(this._characterJoiners[g].id===d)return this._characterJoiners.splice(g,1),!0;return!1}getJoinedCharacters(d){if(this._characterJoiners.length===0)return[];const g=this._bufferService.buffer.lines.get(d);if(!g||g.length===0)return[];const w=[],b=g.translateToString(!0);let x=0,C=0,S=0,k=g.getFg(0),L=g.getBg(0);for(let A=0;A<g.getTrimmedLength();A++)if(g.loadCell(A,this._workCell),this._workCell.getWidth()!==0){if(this._workCell.fg!==k||this._workCell.bg!==L){if(A-x>1){const M=this._getJoinedRanges(b,S,C,g,x);for(let D=0;D<M.length;D++)w.push(M[D])}x=A,S=C,k=this._workCell.fg,L=this._workCell.bg}C+=this._workCell.getChars().length||p.WHITESPACE_CELL_CHAR.length}if(this._bufferService.cols-x>1){const A=this._getJoinedRanges(b,S,C,g,x);for(let M=0;M<A.length;M++)w.push(A[M])}return w}_getJoinedRanges(d,g,w,b,x){const C=d.substring(g,w);let S=[];try{S=this._characterJoiners[0].handler(C)}catch(k){console.error(k)}for(let k=1;k<this._characterJoiners.length;k++)try{const L=this._characterJoiners[k].handler(C);for(let A=0;A<L.length;A++)vw._mergeRanges(S,L[A])}catch(L){console.error(L)}return this._stringRangesToCellRanges(S,b,x),S}_stringRangesToCellRanges(d,g,w){let b=0,x=!1,C=0,S=d[b];if(S){for(let k=w;k<this._bufferService.cols;k++){const L=g.getWidth(k),A=g.getString(k).length||p.WHITESPACE_CELL_CHAR.length;if(L!==0){if(!x&&S[0]<=C&&(S[0]=k,x=!0),S[1]<=C){if(S[1]=k,S=d[++b],!S)break;S[0]<=C?(S[0]=k,x=!0):x=!1}C+=A}}S&&(S[1]=this._bufferService.cols)}}static _mergeRanges(d,g){let w=!1;for(let b=0;b<d.length;b++){const x=d[b];if(w){if(g[1]<=x[0])return d[b-1][1]=g[1],d;if(g[1]<=x[1])return d[b-1][1]=Math.max(g[1],x[1]),d.splice(b,1),d;d.splice(b,1),b--}else{if(g[1]<=x[0])return d.splice(b,0,g),d;if(g[1]<=x[1])return x[0]=Math.min(g[0],x[0]),d;g[0]<x[1]&&(x[0]=Math.min(g[0],x[0]),w=!0)}}return w?d[d.length-1][1]=g[1]:d.push(g),d}};s.CharacterJoinerService=h=c([f(0,y.IBufferService)],h)},5114:(l,s,o)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.CoreBrowserService=void 0;const c=o(844),f=o(8460),u=o(3656);class p extends c.Disposable{constructor(v,h,m){super(),this._textarea=v,this._window=h,this.mainDocument=m,this._isFocused=!1,this._cachedIsFocused=void 0,this._screenDprMonitor=new _(this._window),this._onDprChange=this.register(new f.EventEmitter),this.onDprChange=this._onDprChange.event,this._onWindowChange=this.register(new f.EventEmitter),this.onWindowChange=this._onWindowChange.event,this.register(this.onWindowChange(d=>this._screenDprMonitor.setWindow(d))),this.register((0,f.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(v){this._window!==v&&(this._window=v,this._onWindowChange.fire(this._window))}get dpr(){return this.window.devicePixelRatio}get isFocused(){return this._cachedIsFocused===void 0&&(this._cachedIsFocused=this._isFocused&&this._textarea.ownerDocument.hasFocus(),queueMicrotask(()=>this._cachedIsFocused=void 0)),this._cachedIsFocused}}s.CoreBrowserService=p;class _ extends c.Disposable{constructor(v){super(),this._parentWindow=v,this._windowResizeListener=this.register(new c.MutableDisposable),this._onDprChange=this.register(new f.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(v){this._parentWindow=v,this._setWindowResizeListener(),this._setDprAndFireIfDiffers()}_setWindowResizeListener(){this._windowResizeListener.value=(0,u.addDisposableDomListener)(this._parentWindow,"resize",()=>this._setDprAndFireIfDiffers())}_setDprAndFireIfDiffers(){this._parentWindow.devicePixelRatio!==this._currentDevicePixelRatio&&this._onDprChange.fire(this._parentWindow.devicePixelRatio),this._updateDpr()}_updateDpr(){var v;this._outerListener&&((v=this._resolutionMediaMatchList)==null||v.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:(l,s,o)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.LinkProviderService=void 0;const c=o(844);class f extends c.Disposable{constructor(){super(),this.linkProviders=[],this.register((0,c.toDisposable)(()=>this.linkProviders.length=0))}registerLinkProvider(p){return this.linkProviders.push(p),{dispose:()=>{const _=this.linkProviders.indexOf(p);_!==-1&&this.linkProviders.splice(_,1)}}}}s.LinkProviderService=f},8934:function(l,s,o){var c=this&&this.__decorate||function(y,v,h,m){var d,g=arguments.length,w=g<3?v:m===null?m=Object.getOwnPropertyDescriptor(v,h):m;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")w=Reflect.decorate(y,v,h,m);else for(var b=y.length-1;b>=0;b--)(d=y[b])&&(w=(g<3?d(w):g>3?d(v,h,w):d(v,h))||w);return g>3&&w&&Object.defineProperty(v,h,w),w},f=this&&this.__param||function(y,v){return function(h,m){v(h,m,y)}};Object.defineProperty(s,"__esModule",{value:!0}),s.MouseService=void 0;const u=o(4725),p=o(9806);let _=s.MouseService=class{constructor(y,v){this._renderService=y,this._charSizeService=v}getCoords(y,v,h,m,d){return(0,p.getCoords)(window,y,v,h,m,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,d)}getMouseReportCoords(y,v){const h=(0,p.getCoordsRelativeToElement)(window,y,v);if(this._charSizeService.hasValidSize)return h[0]=Math.min(Math.max(h[0],0),this._renderService.dimensions.css.canvas.width-1),h[1]=Math.min(Math.max(h[1],0),this._renderService.dimensions.css.canvas.height-1),{col:Math.floor(h[0]/this._renderService.dimensions.css.cell.width),row:Math.floor(h[1]/this._renderService.dimensions.css.cell.height),x:Math.floor(h[0]),y:Math.floor(h[1])}}};s.MouseService=_=c([f(0,u.IRenderService),f(1,u.ICharSizeService)],_)},3230:function(l,s,o){var c=this&&this.__decorate||function(d,g,w,b){var x,C=arguments.length,S=C<3?g:b===null?b=Object.getOwnPropertyDescriptor(g,w):b;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")S=Reflect.decorate(d,g,w,b);else for(var k=d.length-1;k>=0;k--)(x=d[k])&&(S=(C<3?x(S):C>3?x(g,w,S):x(g,w))||S);return C>3&&S&&Object.defineProperty(g,w,S),S},f=this&&this.__param||function(d,g){return function(w,b){g(w,b,d)}};Object.defineProperty(s,"__esModule",{value:!0}),s.RenderService=void 0;const u=o(6193),p=o(4725),_=o(8460),y=o(844),v=o(7226),h=o(2585);let m=s.RenderService=class extends y.Disposable{get dimensions(){return this._renderer.value.dimensions}constructor(d,g,w,b,x,C,S,k){super(),this._rowCount=d,this._charSizeService=b,this._renderer=this.register(new y.MutableDisposable),this._pausedResizeTask=new v.DebouncedIdleTask,this._observerDisposable=this.register(new y.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 _.EventEmitter),this.onDimensionsChange=this._onDimensionsChange.event,this._onRenderedViewportChange=this.register(new _.EventEmitter),this.onRenderedViewportChange=this._onRenderedViewportChange.event,this._onRender=this.register(new _.EventEmitter),this.onRender=this._onRender.event,this._onRefreshRequest=this.register(new _.EventEmitter),this.onRefreshRequest=this._onRefreshRequest.event,this._renderDebouncer=new u.RenderDebouncer((L,A)=>this._renderRows(L,A),S),this.register(this._renderDebouncer),this.register(S.onDprChange(()=>this.handleDevicePixelRatioChange())),this.register(C.onResize(()=>this._fullRefresh())),this.register(C.buffers.onBufferActivate(()=>{var L;return(L=this._renderer.value)==null?void 0:L.clear()})),this.register(w.onOptionChange(()=>this._handleOptionsChanged())),this.register(this._charSizeService.onCharSizeChange(()=>this.handleCharSizeChanged())),this.register(x.onDecorationRegistered(()=>this._fullRefresh())),this.register(x.onDecorationRemoved(()=>this._fullRefresh())),this.register(w.onMultipleOptionChange(["customGlyphs","drawBoldTextInBrightColors","letterSpacing","lineHeight","fontFamily","fontSize","fontWeight","fontWeightBold","minimumContrastRatio","rescaleOverlappingGlyphs"],()=>{this.clear(),this.handleResize(C.cols,C.rows),this._fullRefresh()})),this.register(w.onMultipleOptionChange(["cursorBlink","cursorStyle"],()=>this.refreshRows(C.buffer.y,C.buffer.y,!0))),this.register(k.onChangeColors(()=>this._fullRefresh())),this._registerIntersectionObserver(S.window,g),this.register(S.onWindowChange(L=>this._registerIntersectionObserver(L,g)))}_registerIntersectionObserver(d,g){if("IntersectionObserver"in d){const w=new d.IntersectionObserver(b=>this._handleIntersectionChange(b[b.length-1]),{threshold:0});w.observe(g),this._observerDisposable.value=(0,y.toDisposable)(()=>w.disconnect())}}_handleIntersectionChange(d){this._isPaused=d.isIntersecting===void 0?d.intersectionRatio===0:!d.isIntersecting,this._isPaused||this._charSizeService.hasValidSize||this._charSizeService.measure(),!this._isPaused&&this._needsFullRefresh&&(this._pausedResizeTask.flush(),this.refreshRows(0,this._rowCount-1),this._needsFullRefresh=!1)}refreshRows(d,g,w=!1){this._isPaused?this._needsFullRefresh=!0:(w||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(d,g,this._rowCount))}_renderRows(d,g){this._renderer.value&&(d=Math.min(d,this._rowCount-1),g=Math.min(g,this._rowCount-1),this._renderer.value.renderRows(d,g),this._needsSelectionRefresh&&(this._renderer.value.handleSelectionChanged(this._selectionState.start,this._selectionState.end,this._selectionState.columnSelectMode),this._needsSelectionRefresh=!1),this._isNextRenderRedrawOnly||this._onRenderedViewportChange.fire({start:d,end:g}),this._onRender.fire({start:d,end:g}),this._isNextRenderRedrawOnly=!0)}resize(d,g){this._rowCount=g,this._fireOnCanvasResize()}_handleOptionsChanged(){this._renderer.value&&(this.refreshRows(0,this._rowCount-1),this._fireOnCanvasResize())}_fireOnCanvasResize(){this._renderer.value&&(this._renderer.value.dimensions.css.canvas.width===this._canvasWidth&&this._renderer.value.dimensions.css.canvas.height===this._canvasHeight||this._onDimensionsChange.fire(this._renderer.value.dimensions))}hasRenderer(){return!!this._renderer.value}setRenderer(d){this._renderer.value=d,this._renderer.value&&(this._renderer.value.onRequestRedraw(g=>this.refreshRows(g.start,g.end,!0)),this._needsSelectionRefresh=!0,this._fullRefresh())}addRefreshCallback(d){return this._renderDebouncer.addRefreshCallback(d)}_fullRefresh(){this._isPaused?this._needsFullRefresh=!0:this.refreshRows(0,this._rowCount-1)}clearTextureAtlas(){var d,g;this._renderer.value&&((g=(d=this._renderer.value).clearTextureAtlas)==null||g.call(d),this._fullRefresh())}handleDevicePixelRatioChange(){this._charSizeService.measure(),this._renderer.value&&(this._renderer.value.handleDevicePixelRatioChange(),this.refreshRows(0,this._rowCount-1))}handleResize(d,g){this._renderer.value&&(this._isPaused?this._pausedResizeTask.set(()=>{var w;return(w=this._renderer.value)==null?void 0:w.handleResize(d,g)}):this._renderer.value.handleResize(d,g),this._fullRefresh())}handleCharSizeChanged(){var d;(d=this._renderer.value)==null||d.handleCharSizeChanged()}handleBlur(){var d;(d=this._renderer.value)==null||d.handleBlur()}handleFocus(){var d;(d=this._renderer.value)==null||d.handleFocus()}handleSelectionChanged(d,g,w){var b;this._selectionState.start=d,this._selectionState.end=g,this._selectionState.columnSelectMode=w,(b=this._renderer.value)==null||b.handleSelectionChanged(d,g,w)}handleCursorMove(){var d;(d=this._renderer.value)==null||d.handleCursorMove()}clear(){var d;(d=this._renderer.value)==null||d.clear()}};s.RenderService=m=c([f(2,h.IOptionsService),f(3,p.ICharSizeService),f(4,h.IDecorationService),f(5,h.IBufferService),f(6,p.ICoreBrowserService),f(7,p.IThemeService)],m)},9312:function(l,s,o){var c=this&&this.__decorate||function(S,k,L,A){var M,D=arguments.length,O=D<3?k:A===null?A=Object.getOwnPropertyDescriptor(k,L):A;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")O=Reflect.decorate(S,k,L,A);else for(var z=S.length-1;z>=0;z--)(M=S[z])&&(O=(D<3?M(O):D>3?M(k,L,O):M(k,L))||O);return D>3&&O&&Object.defineProperty(k,L,O),O},f=this&&this.__param||function(S,k){return function(L,A){k(L,A,S)}};Object.defineProperty(s,"__esModule",{value:!0}),s.SelectionService=void 0;const u=o(9806),p=o(9504),_=o(456),y=o(4725),v=o(8460),h=o(844),m=o(6114),d=o(4841),g=o(511),w=o(2585),b=" ",x=new RegExp(b,"g");let C=s.SelectionService=class extends h.Disposable{constructor(S,k,L,A,M,D,O,z,F){super(),this._element=S,this._screenElement=k,this._linkifier=L,this._bufferService=A,this._coreService=M,this._mouseService=D,this._optionsService=O,this._renderService=z,this._coreBrowserService=F,this._dragScrollAmount=0,this._enabled=!0,this._workCell=new g.CellData,this._mouseDownTimeStamp=0,this._oldHasSelection=!1,this._oldSelectionStart=void 0,this._oldSelectionEnd=void 0,this._onLinuxMouseSelection=this.register(new v.EventEmitter),this.onLinuxMouseSelection=this._onLinuxMouseSelection.event,this._onRedrawRequest=this.register(new v.EventEmitter),this.onRequestRedraw=this._onRedrawRequest.event,this._onSelectionChange=this.register(new v.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onRequestScrollLines=this.register(new v.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this._mouseMoveListener=H=>this._handleMouseMove(H),this._mouseUpListener=H=>this._handleMouseUp(H),this._coreService.onUserInput(()=>{this.hasSelection&&this.clearSelection()}),this._trimListener=this._bufferService.buffer.lines.onTrim(H=>this._handleTrim(H)),this.register(this._bufferService.buffers.onBufferActivate(H=>this._handleBufferActivate(H))),this.enable(),this._model=new _.SelectionModel(this._bufferService),this._activeSelectionMode=0,this.register((0,h.toDisposable)(()=>{this._removeMouseDownListeners()}))}reset(){this.clearSelection()}disable(){this.clearSelection(),this._enabled=!1}enable(){this._enabled=!0}get selectionStart(){return this._model.finalSelectionStart}get selectionEnd(){return this._model.finalSelectionEnd}get hasSelection(){const S=this._model.finalSelectionStart,k=this._model.finalSelectionEnd;return!(!S||!k||S[0]===k[0]&&S[1]===k[1])}get selectionText(){const S=this._model.finalSelectionStart,k=this._model.finalSelectionEnd;if(!S||!k)return"";const L=this._bufferService.buffer,A=[];if(this._activeSelectionMode===3){if(S[0]===k[0])return"";const M=S[0]<k[0]?S[0]:k[0],D=S[0]<k[0]?k[0]:S[0];for(let O=S[1];O<=k[1];O++){const z=L.translateBufferLineToString(O,!0,M,D);A.push(z)}}else{const M=S[1]===k[1]?k[0]:void 0;A.push(L.translateBufferLineToString(S[1],!0,S[0],M));for(let D=S[1]+1;D<=k[1]-1;D++){const O=L.lines.get(D),z=L.translateBufferLineToString(D,!0);O!=null&&O.isWrapped?A[A.length-1]+=z:A.push(z)}if(S[1]!==k[1]){const D=L.lines.get(k[1]),O=L.translateBufferLineToString(k[1],!0,0,k[0]);D&&D.isWrapped?A[A.length-1]+=O:A.push(O)}}return A.map(M=>M.replace(x," ")).join(m.isWindows?`\r
|
|
57
57
|
`:`
|
|
58
|
-
`)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(S){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._refresh())),m.isLinux&&S&&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(S){const k=this._getMouseBufferCoords(S),L=this._model.finalSelectionStart,A=this._model.finalSelectionEnd;return!!(L&&A&&k)&&this._areCoordsInSelection(k,L,A)}isCellInSelection(S,k){const L=this._model.finalSelectionStart,A=this._model.finalSelectionEnd;return!(!L||!A)&&this._areCoordsInSelection([S,k],L,A)}_areCoordsInSelection(S,k,L){return S[1]>k[1]&&S[1]<L[1]||k[1]===L[1]&&S[1]===k[1]&&S[0]>=k[0]&&S[0]<L[0]||k[1]<L[1]&&S[1]===L[1]&&S[0]<L[0]||k[1]<L[1]&&S[1]===k[1]&&S[0]>=k[0]}_selectWordAtCursor(S,k){var M,D;const L=(D=(M=this._linkifier.currentLink)==null?void 0:M.link)==null?void 0:D.range;if(L)return this._model.selectionStart=[L.start.x-1,L.start.y-1],this._model.selectionStartLength=(0,d.getRangeLength)(L,this._bufferService.cols),this._model.selectionEnd=void 0,!0;const A=this._getMouseBufferCoords(S);return!!A&&(this._selectWordAt(A,k),this._model.selectionEnd=void 0,!0)}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(S,k){this._model.clearSelection(),S=Math.max(S,0),k=Math.min(k,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,S],this._model.selectionEnd=[this._bufferService.cols,k],this.refresh(),this._onSelectionChange.fire()}_handleTrim(S){this._model.handleTrim(S)&&this.refresh()}_getMouseBufferCoords(S){const k=this._mouseService.getCoords(S,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(k)return k[0]--,k[1]--,k[1]+=this._bufferService.buffer.ydisp,k}_getMouseEventScrollAmount(S){let k=(0,u.getCoordsRelativeToElement)(this._coreBrowserService.window,S,this._screenElement)[1];const L=this._renderService.dimensions.css.canvas.height;return k>=0&&k<=L?0:(k>L&&(k-=L),k=Math.min(Math.max(k,-50),50),k/=50,k/Math.abs(k)+Math.round(14*k))}shouldForceSelection(S){return m.isMac?S.altKey&&this._optionsService.rawOptions.macOptionClickForcesSelection:S.shiftKey}handleMouseDown(S){if(this._mouseDownTimeStamp=S.timeStamp,(S.button!==2||!this.hasSelection)&&S.button===0){if(!this._enabled){if(!this.shouldForceSelection(S))return;S.stopPropagation()}S.preventDefault(),this._dragScrollAmount=0,this._enabled&&S.shiftKey?this._handleIncrementalClick(S):S.detail===1?this._handleSingleClick(S):S.detail===2?this._handleDoubleClick(S):S.detail===3&&this._handleTripleClick(S),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(S){this._model.selectionStart&&(this._model.selectionEnd=this._getMouseBufferCoords(S))}_handleSingleClick(S){if(this._model.selectionStartLength=0,this._model.isSelectAllActive=!1,this._activeSelectionMode=this.shouldColumnSelect(S)?3:0,this._model.selectionStart=this._getMouseBufferCoords(S),!this._model.selectionStart)return;this._model.selectionEnd=void 0;const k=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);k&&k.length!==this._model.selectionStart[0]&&k.hasWidth(this._model.selectionStart[0])===0&&this._model.selectionStart[0]++}_handleDoubleClick(S){this._selectWordAtCursor(S,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(S){const k=this._getMouseBufferCoords(S);k&&(this._activeSelectionMode=2,this._selectLineAt(k[1]))}shouldColumnSelect(S){return S.altKey&&!(m.isMac&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(S){if(S.stopImmediatePropagation(),!this._model.selectionStart)return;const k=this._model.selectionEnd?[this._model.selectionEnd[0],this._model.selectionEnd[1]]:null;if(this._model.selectionEnd=this._getMouseBufferCoords(S),!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(S),this._activeSelectionMode!==3&&(this._dragScrollAmount>0?this._model.selectionEnd[0]=this._bufferService.cols:this._dragScrollAmount<0&&(this._model.selectionEnd[0]=0));const L=this._bufferService.buffer;if(this._model.selectionEnd[1]<L.lines.length){const A=L.lines.get(this._model.selectionEnd[1]);A&&A.hasWidth(this._model.selectionEnd[0])===0&&this._model.selectionEnd[0]<this._bufferService.cols&&this._model.selectionEnd[0]++}k&&k[0]===this._model.selectionEnd[0]&&k[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 S=this._bufferService.buffer;this._dragScrollAmount>0?(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=this._bufferService.cols),this._model.selectionEnd[1]=Math.min(S.ydisp+this._bufferService.rows,S.lines.length-1)):(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=0),this._model.selectionEnd[1]=S.ydisp),this.refresh()}}_handleMouseUp(S){const k=S.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&k<500&&S.altKey&&this._optionsService.rawOptions.altClickMovesCursor){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){const L=this._mouseService.getCoords(S,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(L&&L[0]!==void 0&&L[1]!==void 0){const A=(0,p.moveToCellSequence)(L[0]-1,L[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(A,!0)}}}else this._fireEventIfSelectionChanged()}_fireEventIfSelectionChanged(){const S=this._model.finalSelectionStart,k=this._model.finalSelectionEnd,L=!(!S||!k||S[0]===k[0]&&S[1]===k[1]);L?S&&k&&(this._oldSelectionStart&&this._oldSelectionEnd&&S[0]===this._oldSelectionStart[0]&&S[1]===this._oldSelectionStart[1]&&k[0]===this._oldSelectionEnd[0]&&k[1]===this._oldSelectionEnd[1]||this._fireOnSelectionChange(S,k,L)):this._oldHasSelection&&this._fireOnSelectionChange(S,k,L)}_fireOnSelectionChange(S,k,L){this._oldSelectionStart=S,this._oldSelectionEnd=k,this._oldHasSelection=L,this._onSelectionChange.fire()}_handleBufferActivate(S){this.clearSelection(),this._trimListener.dispose(),this._trimListener=S.activeBuffer.lines.onTrim(k=>this._handleTrim(k))}_convertViewportColToCharacterIndex(S,k){let L=k;for(let A=0;k>=A;A++){const M=S.loadCell(A,this._workCell).getChars().length;this._workCell.getWidth()===0?L--:M>1&&k!==A&&(L+=M-1)}return L}setSelection(S,k,L){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[S,k],this._model.selectionStartLength=L,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(S){this._isClickInSelection(S)||(this._selectWordAtCursor(S,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(S,k,L=!0,A=!0){if(S[0]>=this._bufferService.cols)return;const M=this._bufferService.buffer,D=M.lines.get(S[1]);if(!D)return;const O=M.translateBufferLineToString(S[1],!1);let z=this._convertViewportColToCharacterIndex(D,S[0]),F=z;const H=S[0]-z;let I=0,R=0,P=0,N=0;if(O.charAt(z)===" "){for(;z>0&&O.charAt(z-1)===" ";)z--;for(;F<O.length&&O.charAt(F+1)===" ";)F++}else{let V=S[0],Z=S[0];D.getWidth(V)===0&&(I++,V--),D.getWidth(Z)===2&&(R++,Z++);const Q=D.getString(Z).length;for(Q>1&&(N+=Q-1,F+=Q-1);V>0&&z>0&&!this._isCharWordSeparator(D.loadCell(V-1,this._workCell));){D.loadCell(V-1,this._workCell);const $=this._workCell.getChars().length;this._workCell.getWidth()===0?(I++,V--):$>1&&(P+=$-1,z-=$-1),z--,V--}for(;Z<D.length&&F+1<O.length&&!this._isCharWordSeparator(D.loadCell(Z+1,this._workCell));){D.loadCell(Z+1,this._workCell);const $=this._workCell.getChars().length;this._workCell.getWidth()===2?(R++,Z++):$>1&&(N+=$-1,F+=$-1),F++,Z++}}F++;let j=z+H-I+P,W=Math.min(this._bufferService.cols,F-z+I+R-P-N);if(k||O.slice(z,F).trim()!==""){if(L&&j===0&&D.getCodePoint(0)!==32){const V=M.lines.get(S[1]-1);if(V&&D.isWrapped&&V.getCodePoint(this._bufferService.cols-1)!==32){const Z=this._getWordAt([this._bufferService.cols-1,S[1]-1],!1,!0,!1);if(Z){const Q=this._bufferService.cols-Z.start;j-=Q,W+=Q}}}if(A&&j+W===this._bufferService.cols&&D.getCodePoint(this._bufferService.cols-1)!==32){const V=M.lines.get(S[1]+1);if(V!=null&&V.isWrapped&&V.getCodePoint(0)!==32){const Z=this._getWordAt([0,S[1]+1],!1,!1,!0);Z&&(W+=Z.length)}}return{start:j,length:W}}}_selectWordAt(S,k){const L=this._getWordAt(S,k);if(L){for(;L.start<0;)L.start+=this._bufferService.cols,S[1]--;this._model.selectionStart=[L.start,S[1]],this._model.selectionStartLength=L.length}}_selectToWordAt(S){const k=this._getWordAt(S,!0);if(k){let L=S[1];for(;k.start<0;)k.start+=this._bufferService.cols,L--;if(!this._model.areSelectionValuesReversed())for(;k.start+k.length>this._bufferService.cols;)k.length-=this._bufferService.cols,L++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?k.start:k.start+k.length,L]}}_isCharWordSeparator(S){return S.getWidth()!==0&&this._optionsService.rawOptions.wordSeparator.indexOf(S.getChars())>=0}_selectLineAt(S){const k=this._bufferService.buffer.getWrappedRangeForLine(S),L={start:{x:0,y:k.first},end:{x:this._bufferService.cols-1,y:k.last}};this._model.selectionStart=[0,k.first],this._model.selectionEnd=void 0,this._model.selectionStartLength=(0,d.getRangeLength)(L,this._bufferService.cols)}};s.SelectionService=C=c([f(3,w.IBufferService),f(4,w.ICoreService),f(5,y.IMouseService),f(6,w.IOptionsService),f(7,y.IRenderService),f(8,y.ICoreBrowserService)],C)},4725:(l,s,o)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.ILinkProviderService=s.IThemeService=s.ICharacterJoinerService=s.ISelectionService=s.IRenderService=s.IMouseService=s.ICoreBrowserService=s.ICharSizeService=void 0;const c=o(8343);s.ICharSizeService=(0,c.createDecorator)("CharSizeService"),s.ICoreBrowserService=(0,c.createDecorator)("CoreBrowserService"),s.IMouseService=(0,c.createDecorator)("MouseService"),s.IRenderService=(0,c.createDecorator)("RenderService"),s.ISelectionService=(0,c.createDecorator)("SelectionService"),s.ICharacterJoinerService=(0,c.createDecorator)("CharacterJoinerService"),s.IThemeService=(0,c.createDecorator)("ThemeService"),s.ILinkProviderService=(0,c.createDecorator)("LinkProviderService")},6731:function(l,s,o){var c=this&&this.__decorate||function(C,S,k,L){var A,M=arguments.length,D=M<3?S:L===null?L=Object.getOwnPropertyDescriptor(S,k):L;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")D=Reflect.decorate(C,S,k,L);else for(var O=C.length-1;O>=0;O--)(A=C[O])&&(D=(M<3?A(D):M>3?A(S,k,D):A(S,k))||D);return M>3&&D&&Object.defineProperty(S,k,D),D},f=this&&this.__param||function(C,S){return function(k,L){S(k,L,C)}};Object.defineProperty(s,"__esModule",{value:!0}),s.ThemeService=s.DEFAULT_ANSI_COLORS=void 0;const u=o(7239),p=o(8055),_=o(8460),y=o(844),v=o(2585),h=p.css.toColor("#ffffff"),m=p.css.toColor("#000000"),d=p.css.toColor("#ffffff"),g=p.css.toColor("#000000"),w={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117};s.DEFAULT_ANSI_COLORS=Object.freeze((()=>{const C=[p.css.toColor("#2e3436"),p.css.toColor("#cc0000"),p.css.toColor("#4e9a06"),p.css.toColor("#c4a000"),p.css.toColor("#3465a4"),p.css.toColor("#75507b"),p.css.toColor("#06989a"),p.css.toColor("#d3d7cf"),p.css.toColor("#555753"),p.css.toColor("#ef2929"),p.css.toColor("#8ae234"),p.css.toColor("#fce94f"),p.css.toColor("#729fcf"),p.css.toColor("#ad7fa8"),p.css.toColor("#34e2e2"),p.css.toColor("#eeeeec")],S=[0,95,135,175,215,255];for(let k=0;k<216;k++){const L=S[k/36%6|0],A=S[k/6%6|0],M=S[k%6];C.push({css:p.channels.toCss(L,A,M),rgba:p.channels.toRgba(L,A,M)})}for(let k=0;k<24;k++){const L=8+10*k;C.push({css:p.channels.toCss(L,L,L),rgba:p.channels.toRgba(L,L,L)})}return C})());let b=s.ThemeService=class extends y.Disposable{get colors(){return this._colors}constructor(C){super(),this._optionsService=C,this._contrastCache=new u.ColorContrastCache,this._halfContrastCache=new u.ColorContrastCache,this._onChangeColors=this.register(new _.EventEmitter),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:h,background:m,cursor:d,cursorAccent:g,selectionForeground:void 0,selectionBackgroundTransparent:w,selectionBackgroundOpaque:p.color.blend(m,w),selectionInactiveBackgroundTransparent:w,selectionInactiveBackgroundOpaque:p.color.blend(m,w),ansi:s.DEFAULT_ANSI_COLORS.slice(),contrastCache:this._contrastCache,halfContrastCache:this._halfContrastCache},this._updateRestoreColors(),this._setTheme(this._optionsService.rawOptions.theme),this.register(this._optionsService.onSpecificOptionChange("minimumContrastRatio",()=>this._contrastCache.clear())),this.register(this._optionsService.onSpecificOptionChange("theme",()=>this._setTheme(this._optionsService.rawOptions.theme)))}_setTheme(C={}){const S=this._colors;if(S.foreground=x(C.foreground,h),S.background=x(C.background,m),S.cursor=x(C.cursor,d),S.cursorAccent=x(C.cursorAccent,g),S.selectionBackgroundTransparent=x(C.selectionBackground,w),S.selectionBackgroundOpaque=p.color.blend(S.background,S.selectionBackgroundTransparent),S.selectionInactiveBackgroundTransparent=x(C.selectionInactiveBackground,S.selectionBackgroundTransparent),S.selectionInactiveBackgroundOpaque=p.color.blend(S.background,S.selectionInactiveBackgroundTransparent),S.selectionForeground=C.selectionForeground?x(C.selectionForeground,p.NULL_COLOR):void 0,S.selectionForeground===p.NULL_COLOR&&(S.selectionForeground=void 0),p.color.isOpaque(S.selectionBackgroundTransparent)&&(S.selectionBackgroundTransparent=p.color.opacity(S.selectionBackgroundTransparent,.3)),p.color.isOpaque(S.selectionInactiveBackgroundTransparent)&&(S.selectionInactiveBackgroundTransparent=p.color.opacity(S.selectionInactiveBackgroundTransparent,.3)),S.ansi=s.DEFAULT_ANSI_COLORS.slice(),S.ansi[0]=x(C.black,s.DEFAULT_ANSI_COLORS[0]),S.ansi[1]=x(C.red,s.DEFAULT_ANSI_COLORS[1]),S.ansi[2]=x(C.green,s.DEFAULT_ANSI_COLORS[2]),S.ansi[3]=x(C.yellow,s.DEFAULT_ANSI_COLORS[3]),S.ansi[4]=x(C.blue,s.DEFAULT_ANSI_COLORS[4]),S.ansi[5]=x(C.magenta,s.DEFAULT_ANSI_COLORS[5]),S.ansi[6]=x(C.cyan,s.DEFAULT_ANSI_COLORS[6]),S.ansi[7]=x(C.white,s.DEFAULT_ANSI_COLORS[7]),S.ansi[8]=x(C.brightBlack,s.DEFAULT_ANSI_COLORS[8]),S.ansi[9]=x(C.brightRed,s.DEFAULT_ANSI_COLORS[9]),S.ansi[10]=x(C.brightGreen,s.DEFAULT_ANSI_COLORS[10]),S.ansi[11]=x(C.brightYellow,s.DEFAULT_ANSI_COLORS[11]),S.ansi[12]=x(C.brightBlue,s.DEFAULT_ANSI_COLORS[12]),S.ansi[13]=x(C.brightMagenta,s.DEFAULT_ANSI_COLORS[13]),S.ansi[14]=x(C.brightCyan,s.DEFAULT_ANSI_COLORS[14]),S.ansi[15]=x(C.brightWhite,s.DEFAULT_ANSI_COLORS[15]),C.extendedAnsi){const k=Math.min(S.ansi.length-16,C.extendedAnsi.length);for(let L=0;L<k;L++)S.ansi[L+16]=x(C.extendedAnsi[L],s.DEFAULT_ANSI_COLORS[L+16])}this._contrastCache.clear(),this._halfContrastCache.clear(),this._updateRestoreColors(),this._onChangeColors.fire(this.colors)}restoreColor(C){this._restoreColor(C),this._onChangeColors.fire(this.colors)}_restoreColor(C){if(C!==void 0)switch(C){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[C]=this._restoreColors.ansi[C]}else for(let S=0;S<this._restoreColors.ansi.length;++S)this._colors.ansi[S]=this._restoreColors.ansi[S]}modifyColors(C){C(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 x(C,S){if(C!==void 0)try{return p.css.toColor(C)}catch{}return S}s.ThemeService=b=c([f(0,v.IOptionsService)],b)},6349:(l,s,o)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.CircularList=void 0;const c=o(8460),f=o(844);class u extends f.Disposable{constructor(_){super(),this._maxLength=_,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(_){if(this._maxLength===_)return;const y=new Array(_);for(let v=0;v<Math.min(_,this.length);v++)y[v]=this._array[this._getCyclicIndex(v)];this._array=y,this._maxLength=_,this._startIndex=0}get length(){return this._length}set length(_){if(_>this._length)for(let y=this._length;y<_;y++)this._array[y]=void 0;this._length=_}get(_){return this._array[this._getCyclicIndex(_)]}set(_,y){this._array[this._getCyclicIndex(_)]=y}push(_){this._array[this._getCyclicIndex(this._length)]=_,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(_,y,...v){if(y){for(let h=_;h<this._length-y;h++)this._array[this._getCyclicIndex(h)]=this._array[this._getCyclicIndex(h+y)];this._length-=y,this.onDeleteEmitter.fire({index:_,amount:y})}for(let h=this._length-1;h>=_;h--)this._array[this._getCyclicIndex(h+v.length)]=this._array[this._getCyclicIndex(h)];for(let h=0;h<v.length;h++)this._array[this._getCyclicIndex(_+h)]=v[h];if(v.length&&this.onInsertEmitter.fire({index:_,amount:v.length}),this._length+v.length>this._maxLength){const h=this._length+v.length-this._maxLength;this._startIndex+=h,this._length=this._maxLength,this.onTrimEmitter.fire(h)}else this._length+=v.length}trimStart(_){_>this._length&&(_=this._length),this._startIndex+=_,this._length-=_,this.onTrimEmitter.fire(_)}shiftElements(_,y,v){if(!(y<=0)){if(_<0||_>=this._length)throw new Error("start argument out of range");if(_+v<0)throw new Error("Cannot shift elements in list beyond index 0");if(v>0){for(let m=y-1;m>=0;m--)this.set(_+m+v,this.get(_+m));const h=_+y+v-this._length;if(h>0)for(this._length+=h;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(let h=0;h<y;h++)this.set(_+h+v,this.get(_+h))}}_getCyclicIndex(_){return(this._startIndex+_)%this._maxLength}}s.CircularList=u},1439:(l,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.clone=void 0,s.clone=function o(c,f=5){if(typeof c!="object")return c;const u=Array.isArray(c)?[]:{};for(const p in c)u[p]=f<=1?c[p]:c[p]&&o(c[p],f-1);return u}},8055:(l,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.contrastRatio=s.toPaddedHex=s.rgba=s.rgb=s.css=s.color=s.channels=s.NULL_COLOR=void 0;let o=0,c=0,f=0,u=0;var p,_,y,v,h;function m(g){const w=g.toString(16);return w.length<2?"0"+w:w}function d(g,w){return g<w?(w+.05)/(g+.05):(g+.05)/(w+.05)}s.NULL_COLOR={css:"#00000000",rgba:0},function(g){g.toCss=function(w,b,x,C){return C!==void 0?`#${m(w)}${m(b)}${m(x)}${m(C)}`:`#${m(w)}${m(b)}${m(x)}`},g.toRgba=function(w,b,x,C=255){return(w<<24|b<<16|x<<8|C)>>>0},g.toColor=function(w,b,x,C){return{css:g.toCss(w,b,x,C),rgba:g.toRgba(w,b,x,C)}}}(p||(s.channels=p={})),function(g){function w(b,x){return u=Math.round(255*x),[o,c,f]=h.toChannels(b.rgba),{css:p.toCss(o,c,f,u),rgba:p.toRgba(o,c,f,u)}}g.blend=function(b,x){if(u=(255&x.rgba)/255,u===1)return{css:x.css,rgba:x.rgba};const C=x.rgba>>24&255,S=x.rgba>>16&255,k=x.rgba>>8&255,L=b.rgba>>24&255,A=b.rgba>>16&255,M=b.rgba>>8&255;return o=L+Math.round((C-L)*u),c=A+Math.round((S-A)*u),f=M+Math.round((k-M)*u),{css:p.toCss(o,c,f),rgba:p.toRgba(o,c,f)}},g.isOpaque=function(b){return(255&b.rgba)==255},g.ensureContrastRatio=function(b,x,C){const S=h.ensureContrastRatio(b.rgba,x.rgba,C);if(S)return p.toColor(S>>24&255,S>>16&255,S>>8&255)},g.opaque=function(b){const x=(255|b.rgba)>>>0;return[o,c,f]=h.toChannels(x),{css:p.toCss(o,c,f),rgba:x}},g.opacity=w,g.multiplyOpacity=function(b,x){return u=255&b.rgba,w(b,u*x/255)},g.toColorRGB=function(b){return[b.rgba>>24&255,b.rgba>>16&255,b.rgba>>8&255]}}(_||(s.color=_={})),function(g){let w,b;try{const x=document.createElement("canvas");x.width=1,x.height=1;const C=x.getContext("2d",{willReadFrequently:!0});C&&(w=C,w.globalCompositeOperation="copy",b=w.createLinearGradient(0,0,1,1))}catch{}g.toColor=function(x){if(x.match(/#[\da-f]{3,8}/i))switch(x.length){case 4:return o=parseInt(x.slice(1,2).repeat(2),16),c=parseInt(x.slice(2,3).repeat(2),16),f=parseInt(x.slice(3,4).repeat(2),16),p.toColor(o,c,f);case 5:return o=parseInt(x.slice(1,2).repeat(2),16),c=parseInt(x.slice(2,3).repeat(2),16),f=parseInt(x.slice(3,4).repeat(2),16),u=parseInt(x.slice(4,5).repeat(2),16),p.toColor(o,c,f,u);case 7:return{css:x,rgba:(parseInt(x.slice(1),16)<<8|255)>>>0};case 9:return{css:x,rgba:parseInt(x.slice(1),16)>>>0}}const C=x.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(C)return o=parseInt(C[1]),c=parseInt(C[2]),f=parseInt(C[3]),u=Math.round(255*(C[5]===void 0?1:parseFloat(C[5]))),p.toColor(o,c,f,u);if(!w||!b)throw new Error("css.toColor: Unsupported css format");if(w.fillStyle=b,w.fillStyle=x,typeof w.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(w.fillRect(0,0,1,1),[o,c,f,u]=w.getImageData(0,0,1,1).data,u!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:p.toRgba(o,c,f,u),css:x}}}(y||(s.css=y={})),function(g){function w(b,x,C){const S=b/255,k=x/255,L=C/255;return .2126*(S<=.03928?S/12.92:Math.pow((S+.055)/1.055,2.4))+.7152*(k<=.03928?k/12.92:Math.pow((k+.055)/1.055,2.4))+.0722*(L<=.03928?L/12.92:Math.pow((L+.055)/1.055,2.4))}g.relativeLuminance=function(b){return w(b>>16&255,b>>8&255,255&b)},g.relativeLuminance2=w}(v||(s.rgb=v={})),function(g){function w(x,C,S){const k=x>>24&255,L=x>>16&255,A=x>>8&255;let M=C>>24&255,D=C>>16&255,O=C>>8&255,z=d(v.relativeLuminance2(M,D,O),v.relativeLuminance2(k,L,A));for(;z<S&&(M>0||D>0||O>0);)M-=Math.max(0,Math.ceil(.1*M)),D-=Math.max(0,Math.ceil(.1*D)),O-=Math.max(0,Math.ceil(.1*O)),z=d(v.relativeLuminance2(M,D,O),v.relativeLuminance2(k,L,A));return(M<<24|D<<16|O<<8|255)>>>0}function b(x,C,S){const k=x>>24&255,L=x>>16&255,A=x>>8&255;let M=C>>24&255,D=C>>16&255,O=C>>8&255,z=d(v.relativeLuminance2(M,D,O),v.relativeLuminance2(k,L,A));for(;z<S&&(M<255||D<255||O<255);)M=Math.min(255,M+Math.ceil(.1*(255-M))),D=Math.min(255,D+Math.ceil(.1*(255-D))),O=Math.min(255,O+Math.ceil(.1*(255-O))),z=d(v.relativeLuminance2(M,D,O),v.relativeLuminance2(k,L,A));return(M<<24|D<<16|O<<8|255)>>>0}g.blend=function(x,C){if(u=(255&C)/255,u===1)return C;const S=C>>24&255,k=C>>16&255,L=C>>8&255,A=x>>24&255,M=x>>16&255,D=x>>8&255;return o=A+Math.round((S-A)*u),c=M+Math.round((k-M)*u),f=D+Math.round((L-D)*u),p.toRgba(o,c,f)},g.ensureContrastRatio=function(x,C,S){const k=v.relativeLuminance(x>>8),L=v.relativeLuminance(C>>8);if(d(k,L)<S){if(L<k){const D=w(x,C,S),O=d(k,v.relativeLuminance(D>>8));if(O<S){const z=b(x,C,S);return O>d(k,v.relativeLuminance(z>>8))?D:z}return D}const A=b(x,C,S),M=d(k,v.relativeLuminance(A>>8));if(M<S){const D=w(x,C,S);return M>d(k,v.relativeLuminance(D>>8))?A:D}return A}},g.reduceLuminance=w,g.increaseLuminance=b,g.toChannels=function(x){return[x>>24&255,x>>16&255,x>>8&255,255&x]}}(h||(s.rgba=h={})),s.toPaddedHex=m,s.contrastRatio=d},8969:(l,s,o)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.CoreTerminal=void 0;const c=o(844),f=o(2585),u=o(4348),p=o(7866),_=o(744),y=o(7302),v=o(6975),h=o(8460),m=o(1753),d=o(1480),g=o(7994),w=o(9282),b=o(5435),x=o(5981),C=o(2660);let S=!1;class k extends c.Disposable{get onScroll(){return this._onScrollApi||(this._onScrollApi=this.register(new h.EventEmitter),this._onScroll.event(A=>{var M;(M=this._onScrollApi)==null||M.fire(A.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(A){for(const M in A)this.optionsService.options[M]=A[M]}constructor(A){super(),this._windowsWrappingHeuristics=this.register(new c.MutableDisposable),this._onBinary=this.register(new h.EventEmitter),this.onBinary=this._onBinary.event,this._onData=this.register(new h.EventEmitter),this.onData=this._onData.event,this._onLineFeed=this.register(new h.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onResize=this.register(new h.EventEmitter),this.onResize=this._onResize.event,this._onWriteParsed=this.register(new h.EventEmitter),this.onWriteParsed=this._onWriteParsed.event,this._onScroll=this.register(new h.EventEmitter),this._instantiationService=new u.InstantiationService,this.optionsService=this.register(new y.OptionsService(A)),this._instantiationService.setService(f.IOptionsService,this.optionsService),this._bufferService=this.register(this._instantiationService.createInstance(_.BufferService)),this._instantiationService.setService(f.IBufferService,this._bufferService),this._logService=this.register(this._instantiationService.createInstance(p.LogService)),this._instantiationService.setService(f.ILogService,this._logService),this.coreService=this.register(this._instantiationService.createInstance(v.CoreService)),this._instantiationService.setService(f.ICoreService,this.coreService),this.coreMouseService=this.register(this._instantiationService.createInstance(m.CoreMouseService)),this._instantiationService.setService(f.ICoreMouseService,this.coreMouseService),this.unicodeService=this.register(this._instantiationService.createInstance(d.UnicodeService)),this._instantiationService.setService(f.IUnicodeService,this.unicodeService),this._charsetService=this._instantiationService.createInstance(g.CharsetService),this._instantiationService.setService(f.ICharsetService,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(C.OscLinkService),this._instantiationService.setService(f.IOscLinkService,this._oscLinkService),this._inputHandler=this.register(new b.InputHandler(this._bufferService,this._charsetService,this.coreService,this._logService,this.optionsService,this._oscLinkService,this.coreMouseService,this.unicodeService)),this.register((0,h.forwardEvent)(this._inputHandler.onLineFeed,this._onLineFeed)),this.register(this._inputHandler),this.register((0,h.forwardEvent)(this._bufferService.onResize,this._onResize)),this.register((0,h.forwardEvent)(this.coreService.onData,this._onData)),this.register((0,h.forwardEvent)(this.coreService.onBinary,this._onBinary)),this.register(this.coreService.onRequestScrollToBottom(()=>this.scrollToBottom())),this.register(this.coreService.onUserInput(()=>this._writeBuffer.handleUserInput())),this.register(this.optionsService.onMultipleOptionChange(["windowsMode","windowsPty"],()=>this._handleWindowsPtyOptionChange())),this.register(this._bufferService.onScroll(M=>{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(M=>{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 x.WriteBuffer((M,D)=>this._inputHandler.parse(M,D))),this.register((0,h.forwardEvent)(this._writeBuffer.onWriteParsed,this._onWriteParsed))}write(A,M){this._writeBuffer.write(A,M)}writeSync(A,M){this._logService.logLevel<=f.LogLevelEnum.WARN&&!S&&(this._logService.warn("writeSync is unreliable and will be removed soon."),S=!0),this._writeBuffer.writeSync(A,M)}input(A,M=!0){this.coreService.triggerDataEvent(A,M)}resize(A,M){isNaN(A)||isNaN(M)||(A=Math.max(A,_.MINIMUM_COLS),M=Math.max(M,_.MINIMUM_ROWS),this._bufferService.resize(A,M))}scroll(A,M=!1){this._bufferService.scroll(A,M)}scrollLines(A,M,D){this._bufferService.scrollLines(A,M,D)}scrollPages(A){this.scrollLines(A*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(){this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(A){const M=A-this._bufferService.buffer.ydisp;M!==0&&this.scrollLines(M)}registerEscHandler(A,M){return this._inputHandler.registerEscHandler(A,M)}registerDcsHandler(A,M){return this._inputHandler.registerDcsHandler(A,M)}registerCsiHandler(A,M){return this._inputHandler.registerCsiHandler(A,M)}registerOscHandler(A,M){return this._inputHandler.registerOscHandler(A,M)}_setup(){this._handleWindowsPtyOptionChange()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_handleWindowsPtyOptionChange(){let A=!1;const M=this.optionsService.rawOptions.windowsPty;M&&M.buildNumber!==void 0&&M.buildNumber!==void 0?A=M.backend==="conpty"&&M.buildNumber<21376:this.optionsService.rawOptions.windowsMode&&(A=!0),A?this._enableWindowsWrappingHeuristics():this._windowsWrappingHeuristics.clear()}_enableWindowsWrappingHeuristics(){if(!this._windowsWrappingHeuristics.value){const A=[];A.push(this.onLineFeed(w.updateWindowsModeWrappedState.bind(null,this._bufferService))),A.push(this.registerCsiHandler({final:"H"},()=>((0,w.updateWindowsModeWrappedState)(this._bufferService),!1))),this._windowsWrappingHeuristics.value=(0,c.toDisposable)(()=>{for(const M of A)M.dispose()})}}}s.CoreTerminal=k},8460:(l,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.runAndSubscribe=s.forwardEvent=s.EventEmitter=void 0,s.EventEmitter=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||(this._event=o=>(this._listeners.push(o),{dispose:()=>{if(!this._disposed){for(let c=0;c<this._listeners.length;c++)if(this._listeners[c]===o)return void this._listeners.splice(c,1)}}})),this._event}fire(o,c){const f=[];for(let u=0;u<this._listeners.length;u++)f.push(this._listeners[u]);for(let u=0;u<f.length;u++)f[u].call(void 0,o,c)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},s.forwardEvent=function(o,c){return o(f=>c.fire(f))},s.runAndSubscribe=function(o,c){return c(void 0),o(f=>c(f))}},5435:function(l,s,o){var c=this&&this.__decorate||function(I,R,P,N){var j,W=arguments.length,V=W<3?R:N===null?N=Object.getOwnPropertyDescriptor(R,P):N;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")V=Reflect.decorate(I,R,P,N);else for(var Z=I.length-1;Z>=0;Z--)(j=I[Z])&&(V=(W<3?j(V):W>3?j(R,P,V):j(R,P))||V);return W>3&&V&&Object.defineProperty(R,P,V),V},f=this&&this.__param||function(I,R){return function(P,N){R(P,N,I)}};Object.defineProperty(s,"__esModule",{value:!0}),s.InputHandler=s.WindowsOptionsReportType=void 0;const u=o(2584),p=o(7116),_=o(2015),y=o(844),v=o(482),h=o(8437),m=o(8460),d=o(643),g=o(511),w=o(3734),b=o(2585),x=o(1480),C=o(6242),S=o(6351),k=o(5941),L={"(":0,")":1,"*":2,"+":3,"-":1,".":2},A=131072;function M(I,R){if(I>24)return R.setWinLines||!1;switch(I){case 1:return!!R.restoreWin;case 2:return!!R.minimizeWin;case 3:return!!R.setWinPosition;case 4:return!!R.setWinSizePixels;case 5:return!!R.raiseWin;case 6:return!!R.lowerWin;case 7:return!!R.refreshWin;case 8:return!!R.setWinSizeChars;case 9:return!!R.maximizeWin;case 10:return!!R.fullscreenWin;case 11:return!!R.getWinState;case 13:return!!R.getWinPosition;case 14:return!!R.getWinSizePixels;case 15:return!!R.getScreenSizePixels;case 16:return!!R.getCellSizePixels;case 18:return!!R.getWinSizeChars;case 19:return!!R.getScreenSizeChars;case 20:return!!R.getIconTitle;case 21:return!!R.getWinTitle;case 22:return!!R.pushTitle;case 23:return!!R.popTitle;case 24:return!!R.setWinLines}return!1}var D;(function(I){I[I.GET_WIN_SIZE_PIXELS=0]="GET_WIN_SIZE_PIXELS",I[I.GET_CELL_SIZE_PIXELS=1]="GET_CELL_SIZE_PIXELS"})(D||(s.WindowsOptionsReportType=D={}));let O=0;class z extends y.Disposable{getAttrData(){return this._curAttrData}constructor(R,P,N,j,W,V,Z,Q,$=new _.EscapeSequenceParser){super(),this._bufferService=R,this._charsetService=P,this._coreService=N,this._logService=j,this._optionsService=W,this._oscLinkService=V,this._coreMouseService=Z,this._unicodeService=Q,this._parser=$,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new v.StringToUtf32,this._utf8Decoder=new v.Utf8ToUtf32,this._workCell=new g.CellData,this._windowTitle="",this._iconName="",this._windowTitleStack=[],this._iconNameStack=[],this._curAttrData=h.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=h.DEFAULT_ATTR_DATA.clone(),this._onRequestBell=this.register(new 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 F(this._bufferService),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate(B=>this._activeBuffer=B.activeBuffer)),this._parser.setCsiHandlerFallback((B,G)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString(B),params:G.toArray()})}),this._parser.setEscHandlerFallback(B=>{this._logService.debug("Unknown ESC code: ",{identifier:this._parser.identToString(B)})}),this._parser.setExecuteHandlerFallback(B=>{this._logService.debug("Unknown EXECUTE code: ",{code:B})}),this._parser.setOscHandlerFallback((B,G,U)=>{this._logService.debug("Unknown OSC code: ",{identifier:B,action:G,data:U})}),this._parser.setDcsHandlerFallback((B,G,U)=>{G==="HOOK"&&(U=U.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(B),action:G,payload:U})}),this._parser.setPrintHandler((B,G,U)=>this.print(B,G,U)),this._parser.registerCsiHandler({final:"@"},B=>this.insertChars(B)),this._parser.registerCsiHandler({intermediates:" ",final:"@"},B=>this.scrollLeft(B)),this._parser.registerCsiHandler({final:"A"},B=>this.cursorUp(B)),this._parser.registerCsiHandler({intermediates:" ",final:"A"},B=>this.scrollRight(B)),this._parser.registerCsiHandler({final:"B"},B=>this.cursorDown(B)),this._parser.registerCsiHandler({final:"C"},B=>this.cursorForward(B)),this._parser.registerCsiHandler({final:"D"},B=>this.cursorBackward(B)),this._parser.registerCsiHandler({final:"E"},B=>this.cursorNextLine(B)),this._parser.registerCsiHandler({final:"F"},B=>this.cursorPrecedingLine(B)),this._parser.registerCsiHandler({final:"G"},B=>this.cursorCharAbsolute(B)),this._parser.registerCsiHandler({final:"H"},B=>this.cursorPosition(B)),this._parser.registerCsiHandler({final:"I"},B=>this.cursorForwardTab(B)),this._parser.registerCsiHandler({final:"J"},B=>this.eraseInDisplay(B,!1)),this._parser.registerCsiHandler({prefix:"?",final:"J"},B=>this.eraseInDisplay(B,!0)),this._parser.registerCsiHandler({final:"K"},B=>this.eraseInLine(B,!1)),this._parser.registerCsiHandler({prefix:"?",final:"K"},B=>this.eraseInLine(B,!0)),this._parser.registerCsiHandler({final:"L"},B=>this.insertLines(B)),this._parser.registerCsiHandler({final:"M"},B=>this.deleteLines(B)),this._parser.registerCsiHandler({final:"P"},B=>this.deleteChars(B)),this._parser.registerCsiHandler({final:"S"},B=>this.scrollUp(B)),this._parser.registerCsiHandler({final:"T"},B=>this.scrollDown(B)),this._parser.registerCsiHandler({final:"X"},B=>this.eraseChars(B)),this._parser.registerCsiHandler({final:"Z"},B=>this.cursorBackwardTab(B)),this._parser.registerCsiHandler({final:"`"},B=>this.charPosAbsolute(B)),this._parser.registerCsiHandler({final:"a"},B=>this.hPositionRelative(B)),this._parser.registerCsiHandler({final:"b"},B=>this.repeatPrecedingCharacter(B)),this._parser.registerCsiHandler({final:"c"},B=>this.sendDeviceAttributesPrimary(B)),this._parser.registerCsiHandler({prefix:">",final:"c"},B=>this.sendDeviceAttributesSecondary(B)),this._parser.registerCsiHandler({final:"d"},B=>this.linePosAbsolute(B)),this._parser.registerCsiHandler({final:"e"},B=>this.vPositionRelative(B)),this._parser.registerCsiHandler({final:"f"},B=>this.hVPosition(B)),this._parser.registerCsiHandler({final:"g"},B=>this.tabClear(B)),this._parser.registerCsiHandler({final:"h"},B=>this.setMode(B)),this._parser.registerCsiHandler({prefix:"?",final:"h"},B=>this.setModePrivate(B)),this._parser.registerCsiHandler({final:"l"},B=>this.resetMode(B)),this._parser.registerCsiHandler({prefix:"?",final:"l"},B=>this.resetModePrivate(B)),this._parser.registerCsiHandler({final:"m"},B=>this.charAttributes(B)),this._parser.registerCsiHandler({final:"n"},B=>this.deviceStatus(B)),this._parser.registerCsiHandler({prefix:"?",final:"n"},B=>this.deviceStatusPrivate(B)),this._parser.registerCsiHandler({intermediates:"!",final:"p"},B=>this.softReset(B)),this._parser.registerCsiHandler({intermediates:" ",final:"q"},B=>this.setCursorStyle(B)),this._parser.registerCsiHandler({final:"r"},B=>this.setScrollRegion(B)),this._parser.registerCsiHandler({final:"s"},B=>this.saveCursor(B)),this._parser.registerCsiHandler({final:"t"},B=>this.windowOptions(B)),this._parser.registerCsiHandler({final:"u"},B=>this.restoreCursor(B)),this._parser.registerCsiHandler({intermediates:"'",final:"}"},B=>this.insertColumns(B)),this._parser.registerCsiHandler({intermediates:"'",final:"~"},B=>this.deleteColumns(B)),this._parser.registerCsiHandler({intermediates:'"',final:"q"},B=>this.selectProtected(B)),this._parser.registerCsiHandler({intermediates:"$",final:"p"},B=>this.requestMode(B,!0)),this._parser.registerCsiHandler({prefix:"?",intermediates:"$",final:"p"},B=>this.requestMode(B,!1)),this._parser.setExecuteHandler(u.C0.BEL,()=>this.bell()),this._parser.setExecuteHandler(u.C0.LF,()=>this.lineFeed()),this._parser.setExecuteHandler(u.C0.VT,()=>this.lineFeed()),this._parser.setExecuteHandler(u.C0.FF,()=>this.lineFeed()),this._parser.setExecuteHandler(u.C0.CR,()=>this.carriageReturn()),this._parser.setExecuteHandler(u.C0.BS,()=>this.backspace()),this._parser.setExecuteHandler(u.C0.HT,()=>this.tab()),this._parser.setExecuteHandler(u.C0.SO,()=>this.shiftOut()),this._parser.setExecuteHandler(u.C0.SI,()=>this.shiftIn()),this._parser.setExecuteHandler(u.C1.IND,()=>this.index()),this._parser.setExecuteHandler(u.C1.NEL,()=>this.nextLine()),this._parser.setExecuteHandler(u.C1.HTS,()=>this.tabSet()),this._parser.registerOscHandler(0,new C.OscHandler(B=>(this.setTitle(B),this.setIconName(B),!0))),this._parser.registerOscHandler(1,new C.OscHandler(B=>this.setIconName(B))),this._parser.registerOscHandler(2,new C.OscHandler(B=>this.setTitle(B))),this._parser.registerOscHandler(4,new C.OscHandler(B=>this.setOrReportIndexedColor(B))),this._parser.registerOscHandler(8,new C.OscHandler(B=>this.setHyperlink(B))),this._parser.registerOscHandler(10,new C.OscHandler(B=>this.setOrReportFgColor(B))),this._parser.registerOscHandler(11,new C.OscHandler(B=>this.setOrReportBgColor(B))),this._parser.registerOscHandler(12,new C.OscHandler(B=>this.setOrReportCursorColor(B))),this._parser.registerOscHandler(104,new C.OscHandler(B=>this.restoreIndexedColor(B))),this._parser.registerOscHandler(110,new C.OscHandler(B=>this.restoreFgColor(B))),this._parser.registerOscHandler(111,new C.OscHandler(B=>this.restoreBgColor(B))),this._parser.registerOscHandler(112,new C.OscHandler(B=>this.restoreCursorColor(B))),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 B in p.CHARSETS)this._parser.registerEscHandler({intermediates:"(",final:B},()=>this.selectCharset("("+B)),this._parser.registerEscHandler({intermediates:")",final:B},()=>this.selectCharset(")"+B)),this._parser.registerEscHandler({intermediates:"*",final:B},()=>this.selectCharset("*"+B)),this._parser.registerEscHandler({intermediates:"+",final:B},()=>this.selectCharset("+"+B)),this._parser.registerEscHandler({intermediates:"-",final:B},()=>this.selectCharset("-"+B)),this._parser.registerEscHandler({intermediates:".",final:B},()=>this.selectCharset("."+B)),this._parser.registerEscHandler({intermediates:"/",final:B},()=>this.selectCharset("/"+B));this._parser.registerEscHandler({intermediates:"#",final:"8"},()=>this.screenAlignmentPattern()),this._parser.setErrorHandler(B=>(this._logService.error("Parsing error: ",B),B)),this._parser.registerDcsHandler({intermediates:"$",final:"q"},new S.DcsHandler((B,G)=>this.requestStatusString(B,G)))}_preserveStack(R,P,N,j){this._parseStack.paused=!0,this._parseStack.cursorStartX=R,this._parseStack.cursorStartY=P,this._parseStack.decodedLength=N,this._parseStack.position=j}_logSlowResolvingAsync(R){this._logService.logLevel<=b.LogLevelEnum.WARN&&Promise.race([R,new Promise((P,N)=>setTimeout(()=>N("#SLOW_TIMEOUT"),5e3))]).catch(P=>{if(P!=="#SLOW_TIMEOUT")throw P;console.warn("async parser handler taking longer than 5000 ms")})}_getCurrentLinkId(){return this._curAttrData.extended.urlId}parse(R,P){let N,j=this._activeBuffer.x,W=this._activeBuffer.y,V=0;const Z=this._parseStack.paused;if(Z){if(N=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,P))return this._logSlowResolvingAsync(N),N;j=this._parseStack.cursorStartX,W=this._parseStack.cursorStartY,this._parseStack.paused=!1,R.length>A&&(V=this._parseStack.position+A)}if(this._logService.logLevel<=b.LogLevelEnum.DEBUG&&this._logService.debug("parsing data"+(typeof R=="string"?` "${R}"`:` "${Array.prototype.map.call(R,B=>String.fromCharCode(B)).join("")}"`),typeof R=="string"?R.split("").map(B=>B.charCodeAt(0)):R),this._parseBuffer.length<R.length&&this._parseBuffer.length<A&&(this._parseBuffer=new Uint32Array(Math.min(R.length,A))),Z||this._dirtyRowTracker.clearRange(),R.length>A)for(let B=V;B<R.length;B+=A){const G=B+A<R.length?B+A:R.length,U=typeof R=="string"?this._stringDecoder.decode(R.substring(B,G),this._parseBuffer):this._utf8Decoder.decode(R.subarray(B,G),this._parseBuffer);if(N=this._parser.parse(this._parseBuffer,U))return this._preserveStack(j,W,U,B),this._logSlowResolvingAsync(N),N}else if(!Z){const B=typeof R=="string"?this._stringDecoder.decode(R,this._parseBuffer):this._utf8Decoder.decode(R,this._parseBuffer);if(N=this._parser.parse(this._parseBuffer,B))return this._preserveStack(j,W,B,0),this._logSlowResolvingAsync(N),N}this._activeBuffer.x===j&&this._activeBuffer.y===W||this._onCursorMove.fire();const Q=this._dirtyRowTracker.end+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp),$=this._dirtyRowTracker.start+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp);$<this._bufferService.rows&&this._onRequestRefreshRows.fire(Math.min($,this._bufferService.rows-1),Math.min(Q,this._bufferService.rows-1))}print(R,P,N){let j,W;const V=this._charsetService.charset,Z=this._optionsService.rawOptions.screenReaderMode,Q=this._bufferService.cols,$=this._coreService.decPrivateModes.wraparound,B=this._coreService.modes.insertMode,G=this._curAttrData;let U=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._activeBuffer.x&&N-P>0&&U.getWidth(this._activeBuffer.x-1)===2&&U.setCellFromCodepoint(this._activeBuffer.x-1,0,1,G);let te=this._parser.precedingJoinState;for(let Y=P;Y<N;++Y){if(j=R[Y],j<127&&V){const le=V[String.fromCharCode(j)];le&&(j=le.charCodeAt(0))}const _e=this._unicodeService.charProperties(j,te);W=x.UnicodeService.extractWidth(_e);const fe=x.UnicodeService.extractShouldJoin(_e),re=fe?x.UnicodeService.extractWidth(te):0;if(te=_e,Z&&this._onA11yChar.fire((0,v.stringFromCodePoint)(j)),this._getCurrentLinkId()&&this._oscLinkService.addLineToLink(this._getCurrentLinkId(),this._activeBuffer.ybase+this._activeBuffer.y),this._activeBuffer.x+W-re>Q){if($){const le=U;let se=this._activeBuffer.x-re;for(this._activeBuffer.x=re,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),re>0&&U instanceof h.BufferLine&&U.copyCellsFrom(le,se,0,re,!1);se<Q;)le.setCellFromCodepoint(se++,0,1,G)}else if(this._activeBuffer.x=Q-1,W===2)continue}if(fe&&this._activeBuffer.x){const le=U.getWidth(this._activeBuffer.x-1)?1:2;U.addCodepointToCell(this._activeBuffer.x-le,j,W);for(let se=W-re;--se>=0;)U.setCellFromCodepoint(this._activeBuffer.x++,0,0,G)}else if(B&&(U.insertCells(this._activeBuffer.x,W-re,this._activeBuffer.getNullCell(G)),U.getWidth(Q-1)===2&&U.setCellFromCodepoint(Q-1,d.NULL_CELL_CODE,d.NULL_CELL_WIDTH,G)),U.setCellFromCodepoint(this._activeBuffer.x++,j,W,G),W>0)for(;--W;)U.setCellFromCodepoint(this._activeBuffer.x++,0,0,G)}this._parser.precedingJoinState=te,this._activeBuffer.x<Q&&N-P>0&&U.getWidth(this._activeBuffer.x)===0&&!U.hasContent(this._activeBuffer.x)&&U.setCellFromCodepoint(this._activeBuffer.x,0,1,G),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler(R,P){return R.final!=="t"||R.prefix||R.intermediates?this._parser.registerCsiHandler(R,P):this._parser.registerCsiHandler(R,N=>!M(N.params[0],this._optionsService.rawOptions.windowOptions)||P(N))}registerDcsHandler(R,P){return this._parser.registerDcsHandler(R,new S.DcsHandler(P))}registerEscHandler(R,P){return this._parser.registerEscHandler(R,P)}registerOscHandler(R,P){return this._parser.registerOscHandler(R,new C.OscHandler(P))}bell(){return this._onRequestBell.fire(),!0}lineFeed(){return this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._optionsService.rawOptions.convertEol&&(this._activeBuffer.x=0),this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData())):this._activeBuffer.y>=this._bufferService.rows?this._activeBuffer.y=this._bufferService.rows-1:this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.x>=this._bufferService.cols&&this._activeBuffer.x--,this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._onLineFeed.fire(),!0}carriageReturn(){return this._activeBuffer.x=0,!0}backspace(){var R;if(!this._coreService.decPrivateModes.reverseWraparound)return this._restrictCursor(),this._activeBuffer.x>0&&this._activeBuffer.x--,!0;if(this._restrictCursor(this._bufferService.cols),this._activeBuffer.x>0)this._activeBuffer.x--;else if(this._activeBuffer.x===0&&this._activeBuffer.y>this._activeBuffer.scrollTop&&this._activeBuffer.y<=this._activeBuffer.scrollBottom&&((R=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y))!=null&&R.isWrapped)){this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.y--,this._activeBuffer.x=this._bufferService.cols-1;const P=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);P.hasWidth(this._activeBuffer.x)&&!P.hasContent(this._activeBuffer.x)&&this._activeBuffer.x--}return this._restrictCursor(),!0}tab(){if(this._activeBuffer.x>=this._bufferService.cols)return!0;const R=this._activeBuffer.x;return this._activeBuffer.x=this._activeBuffer.nextStop(),this._optionsService.rawOptions.screenReaderMode&&this._onA11yTab.fire(this._activeBuffer.x-R),!0}shiftOut(){return this._charsetService.setgLevel(1),!0}shiftIn(){return this._charsetService.setgLevel(0),!0}_restrictCursor(R=this._bufferService.cols-1){this._activeBuffer.x=Math.min(R,Math.max(0,this._activeBuffer.x)),this._activeBuffer.y=this._coreService.decPrivateModes.origin?Math.min(this._activeBuffer.scrollBottom,Math.max(this._activeBuffer.scrollTop,this._activeBuffer.y)):Math.min(this._bufferService.rows-1,Math.max(0,this._activeBuffer.y)),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_setCursor(R,P){this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=R,this._activeBuffer.y=this._activeBuffer.scrollTop+P):(this._activeBuffer.x=R,this._activeBuffer.y=P),this._restrictCursor(),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_moveCursor(R,P){this._restrictCursor(),this._setCursor(this._activeBuffer.x+R,this._activeBuffer.y+P)}cursorUp(R){const P=this._activeBuffer.y-this._activeBuffer.scrollTop;return P>=0?this._moveCursor(0,-Math.min(P,R.params[0]||1)):this._moveCursor(0,-(R.params[0]||1)),!0}cursorDown(R){const P=this._activeBuffer.scrollBottom-this._activeBuffer.y;return P>=0?this._moveCursor(0,Math.min(P,R.params[0]||1)):this._moveCursor(0,R.params[0]||1),!0}cursorForward(R){return this._moveCursor(R.params[0]||1,0),!0}cursorBackward(R){return this._moveCursor(-(R.params[0]||1),0),!0}cursorNextLine(R){return this.cursorDown(R),this._activeBuffer.x=0,!0}cursorPrecedingLine(R){return this.cursorUp(R),this._activeBuffer.x=0,!0}cursorCharAbsolute(R){return this._setCursor((R.params[0]||1)-1,this._activeBuffer.y),!0}cursorPosition(R){return this._setCursor(R.length>=2?(R.params[1]||1)-1:0,(R.params[0]||1)-1),!0}charPosAbsolute(R){return this._setCursor((R.params[0]||1)-1,this._activeBuffer.y),!0}hPositionRelative(R){return this._moveCursor(R.params[0]||1,0),!0}linePosAbsolute(R){return this._setCursor(this._activeBuffer.x,(R.params[0]||1)-1),!0}vPositionRelative(R){return this._moveCursor(0,R.params[0]||1),!0}hVPosition(R){return this.cursorPosition(R),!0}tabClear(R){const P=R.params[0];return P===0?delete this._activeBuffer.tabs[this._activeBuffer.x]:P===3&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(R){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let P=R.params[0]||1;for(;P--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0}cursorBackwardTab(R){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let P=R.params[0]||1;for(;P--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0}selectProtected(R){const P=R.params[0];return P===1&&(this._curAttrData.bg|=536870912),P!==2&&P!==0||(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine(R,P,N,j=!1,W=!1){const V=this._activeBuffer.lines.get(this._activeBuffer.ybase+R);V.replaceCells(P,N,this._activeBuffer.getNullCell(this._eraseAttrData()),W),j&&(V.isWrapped=!1)}_resetBufferLine(R,P=!1){const N=this._activeBuffer.lines.get(this._activeBuffer.ybase+R);N&&(N.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),P),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+R),N.isWrapped=!1)}eraseInDisplay(R,P=!1){let N;switch(this._restrictCursor(this._bufferService.cols),R.params[0]){case 0:for(N=this._activeBuffer.y,this._dirtyRowTracker.markDirty(N),this._eraseInBufferLine(N++,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,P);N<this._bufferService.rows;N++)this._resetBufferLine(N,P);this._dirtyRowTracker.markDirty(N);break;case 1:for(N=this._activeBuffer.y,this._dirtyRowTracker.markDirty(N),this._eraseInBufferLine(N,0,this._activeBuffer.x+1,!0,P),this._activeBuffer.x+1>=this._bufferService.cols&&(this._activeBuffer.lines.get(N+1).isWrapped=!1);N--;)this._resetBufferLine(N,P);this._dirtyRowTracker.markDirty(0);break;case 2:for(N=this._bufferService.rows,this._dirtyRowTracker.markDirty(N-1);N--;)this._resetBufferLine(N,P);this._dirtyRowTracker.markDirty(0);break;case 3:const j=this._activeBuffer.lines.length-this._bufferService.rows;j>0&&(this._activeBuffer.lines.trimStart(j),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-j,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-j,0),this._onScroll.fire(0))}return!0}eraseInLine(R,P=!1){switch(this._restrictCursor(this._bufferService.cols),R.params[0]){case 0:this._eraseInBufferLine(this._activeBuffer.y,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,P);break;case 1:this._eraseInBufferLine(this._activeBuffer.y,0,this._activeBuffer.x+1,!1,P);break;case 2:this._eraseInBufferLine(this._activeBuffer.y,0,this._bufferService.cols,!0,P)}return this._dirtyRowTracker.markDirty(this._activeBuffer.y),!0}insertLines(R){this._restrictCursor();let P=R.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const N=this._activeBuffer.ybase+this._activeBuffer.y,j=this._bufferService.rows-1-this._activeBuffer.scrollBottom,W=this._bufferService.rows-1+this._activeBuffer.ybase-j+1;for(;P--;)this._activeBuffer.lines.splice(W-1,1),this._activeBuffer.lines.splice(N,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}deleteLines(R){this._restrictCursor();let P=R.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const N=this._activeBuffer.ybase+this._activeBuffer.y;let j;for(j=this._bufferService.rows-1-this._activeBuffer.scrollBottom,j=this._bufferService.rows-1+this._activeBuffer.ybase-j;P--;)this._activeBuffer.lines.splice(N,1),this._activeBuffer.lines.splice(j,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}insertChars(R){this._restrictCursor();const P=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return P&&(P.insertCells(this._activeBuffer.x,R.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}deleteChars(R){this._restrictCursor();const P=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return P&&(P.deleteCells(this._activeBuffer.x,R.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}scrollUp(R){let P=R.params[0]||1;for(;P--;)this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollTop,1),this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollBottom,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollDown(R){let P=R.params[0]||1;for(;P--;)this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollBottom,1),this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollTop,0,this._activeBuffer.getBlankLine(h.DEFAULT_ATTR_DATA));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollLeft(R){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const P=R.params[0]||1;for(let N=this._activeBuffer.scrollTop;N<=this._activeBuffer.scrollBottom;++N){const j=this._activeBuffer.lines.get(this._activeBuffer.ybase+N);j.deleteCells(0,P,this._activeBuffer.getNullCell(this._eraseAttrData())),j.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollRight(R){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const P=R.params[0]||1;for(let N=this._activeBuffer.scrollTop;N<=this._activeBuffer.scrollBottom;++N){const j=this._activeBuffer.lines.get(this._activeBuffer.ybase+N);j.insertCells(0,P,this._activeBuffer.getNullCell(this._eraseAttrData())),j.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}insertColumns(R){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const P=R.params[0]||1;for(let N=this._activeBuffer.scrollTop;N<=this._activeBuffer.scrollBottom;++N){const j=this._activeBuffer.lines.get(this._activeBuffer.ybase+N);j.insertCells(this._activeBuffer.x,P,this._activeBuffer.getNullCell(this._eraseAttrData())),j.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}deleteColumns(R){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const P=R.params[0]||1;for(let N=this._activeBuffer.scrollTop;N<=this._activeBuffer.scrollBottom;++N){const j=this._activeBuffer.lines.get(this._activeBuffer.ybase+N);j.deleteCells(this._activeBuffer.x,P,this._activeBuffer.getNullCell(this._eraseAttrData())),j.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}eraseChars(R){this._restrictCursor();const P=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return P&&(P.replaceCells(this._activeBuffer.x,this._activeBuffer.x+(R.params[0]||1),this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}repeatPrecedingCharacter(R){const P=this._parser.precedingJoinState;if(!P)return!0;const N=R.params[0]||1,j=x.UnicodeService.extractWidth(P),W=this._activeBuffer.x-j,V=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).getString(W),Z=new Uint32Array(V.length*N);let Q=0;for(let B=0;B<V.length;){const G=V.codePointAt(B)||0;Z[Q++]=G,B+=G>65535?2:1}let $=Q;for(let B=1;B<N;++B)Z.copyWithin($,0,Q),$+=Q;return this.print(Z,0,$),!0}sendDeviceAttributesPrimary(R){return R.params[0]>0||(this._is("xterm")||this._is("rxvt-unicode")||this._is("screen")?this._coreService.triggerDataEvent(u.C0.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(u.C0.ESC+"[?6c")),!0}sendDeviceAttributesSecondary(R){return R.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(u.C0.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(u.C0.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(R.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(u.C0.ESC+"[>83;40003;0c")),!0}_is(R){return(this._optionsService.rawOptions.termName+"").indexOf(R)===0}setMode(R){for(let P=0;P<R.length;P++)switch(R.params[P]){case 4:this._coreService.modes.insertMode=!0;break;case 20:this._optionsService.options.convertEol=!0}return!0}setModePrivate(R){for(let P=0;P<R.length;P++)switch(R.params[P]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!0;break;case 2:this._charsetService.setgCharset(0,p.DEFAULT_CHARSET),this._charsetService.setgCharset(1,p.DEFAULT_CHARSET),this._charsetService.setgCharset(2,p.DEFAULT_CHARSET),this._charsetService.setgCharset(3,p.DEFAULT_CHARSET);break;case 3:this._optionsService.rawOptions.windowOptions.setWinLines&&(this._bufferService.resize(132,this._bufferService.rows),this._onRequestReset.fire());break;case 6:this._coreService.decPrivateModes.origin=!0,this._setCursor(0,0);break;case 7:this._coreService.decPrivateModes.wraparound=!0;break;case 12:this._optionsService.options.cursorBlink=!0;break;case 45:this._coreService.decPrivateModes.reverseWraparound=!0;break;case 66:this._logService.debug("Serial port requested application keypad."),this._coreService.decPrivateModes.applicationKeypad=!0,this._onRequestSyncScrollBar.fire();break;case 9:this._coreMouseService.activeProtocol="X10";break;case 1e3:this._coreMouseService.activeProtocol="VT200";break;case 1002:this._coreMouseService.activeProtocol="DRAG";break;case 1003:this._coreMouseService.activeProtocol="ANY";break;case 1004:this._coreService.decPrivateModes.sendFocus=!0,this._onRequestSendFocus.fire();break;case 1005:this._logService.debug("DECSET 1005 not supported (see #2507)");break;case 1006:this._coreMouseService.activeEncoding="SGR";break;case 1015:this._logService.debug("DECSET 1015 not supported (see #2507)");break;case 1016:this._coreMouseService.activeEncoding="SGR_PIXELS";break;case 25:this._coreService.isCursorHidden=!1;break;case 1048:this.saveCursor();break;case 1049:this.saveCursor();case 47:case 1047:this._bufferService.buffers.activateAltBuffer(this._eraseAttrData()),this._coreService.isCursorInitialized=!0,this._onRequestRefreshRows.fire(0,this._bufferService.rows-1),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!0}return!0}resetMode(R){for(let P=0;P<R.length;P++)switch(R.params[P]){case 4:this._coreService.modes.insertMode=!1;break;case 20:this._optionsService.options.convertEol=!1}return!0}resetModePrivate(R){for(let P=0;P<R.length;P++)switch(R.params[P]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!1;break;case 3:this._optionsService.rawOptions.windowOptions.setWinLines&&(this._bufferService.resize(80,this._bufferService.rows),this._onRequestReset.fire());break;case 6:this._coreService.decPrivateModes.origin=!1,this._setCursor(0,0);break;case 7:this._coreService.decPrivateModes.wraparound=!1;break;case 12:this._optionsService.options.cursorBlink=!1;break;case 45:this._coreService.decPrivateModes.reverseWraparound=!1;break;case 66:this._logService.debug("Switching back to normal keypad."),this._coreService.decPrivateModes.applicationKeypad=!1,this._onRequestSyncScrollBar.fire();break;case 9:case 1e3:case 1002:case 1003:this._coreMouseService.activeProtocol="NONE";break;case 1004:this._coreService.decPrivateModes.sendFocus=!1;break;case 1005:this._logService.debug("DECRST 1005 not supported (see #2507)");break;case 1006:case 1016:this._coreMouseService.activeEncoding="DEFAULT";break;case 1015:this._logService.debug("DECRST 1015 not supported (see #2507)");break;case 25:this._coreService.isCursorHidden=!0;break;case 1048:this.restoreCursor();break;case 1049:case 47:case 1047:this._bufferService.buffers.activateNormalBuffer(),R.params[P]===1049&&this.restoreCursor(),this._coreService.isCursorInitialized=!0,this._onRequestRefreshRows.fire(0,this._bufferService.rows-1),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!1}return!0}requestMode(R,P){const N=this._coreService.decPrivateModes,{activeProtocol:j,activeEncoding:W}=this._coreMouseService,V=this._coreService,{buffers:Z,cols:Q}=this._bufferService,{active:$,alt:B}=Z,G=this._optionsService.rawOptions,U=fe=>fe?1:2,te=R.params[0];return Y=te,_e=P?te===2?4:te===4?U(V.modes.insertMode):te===12?3:te===20?U(G.convertEol):0:te===1?U(N.applicationCursorKeys):te===3?G.windowOptions.setWinLines?Q===80?2:Q===132?1:0:0:te===6?U(N.origin):te===7?U(N.wraparound):te===8?3:te===9?U(j==="X10"):te===12?U(G.cursorBlink):te===25?U(!V.isCursorHidden):te===45?U(N.reverseWraparound):te===66?U(N.applicationKeypad):te===67?4:te===1e3?U(j==="VT200"):te===1002?U(j==="DRAG"):te===1003?U(j==="ANY"):te===1004?U(N.sendFocus):te===1005?4:te===1006?U(W==="SGR"):te===1015?4:te===1016?U(W==="SGR_PIXELS"):te===1048?1:te===47||te===1047||te===1049?U($===B):te===2004?U(N.bracketedPasteMode):0,V.triggerDataEvent(`${u.C0.ESC}[${P?"":"?"}${Y};${_e}$y`),!0;var Y,_e}_updateAttrColor(R,P,N,j,W){return P===2?(R|=50331648,R&=-16777216,R|=w.AttributeData.fromColorRGB([N,j,W])):P===5&&(R&=-50331904,R|=33554432|255&N),R}_extractColor(R,P,N){const j=[0,0,-1,0,0,0];let W=0,V=0;do{if(j[V+W]=R.params[P+V],R.hasSubParams(P+V)){const Z=R.getSubParams(P+V);let Q=0;do j[1]===5&&(W=1),j[V+Q+1+W]=Z[Q];while(++Q<Z.length&&Q+V+1+W<j.length);break}if(j[1]===5&&V+W>=2||j[1]===2&&V+W>=5)break;j[1]&&(W=1)}while(++V+P<R.length&&V+W<j.length);for(let Z=2;Z<j.length;++Z)j[Z]===-1&&(j[Z]=0);switch(j[0]){case 38:N.fg=this._updateAttrColor(N.fg,j[1],j[3],j[4],j[5]);break;case 48:N.bg=this._updateAttrColor(N.bg,j[1],j[3],j[4],j[5]);break;case 58:N.extended=N.extended.clone(),N.extended.underlineColor=this._updateAttrColor(N.extended.underlineColor,j[1],j[3],j[4],j[5])}return V}_processUnderline(R,P){P.extended=P.extended.clone(),(!~R||R>5)&&(R=1),P.extended.underlineStyle=R,P.fg|=268435456,R===0&&(P.fg&=-268435457),P.updateExtended()}_processSGR0(R){R.fg=h.DEFAULT_ATTR_DATA.fg,R.bg=h.DEFAULT_ATTR_DATA.bg,R.extended=R.extended.clone(),R.extended.underlineStyle=0,R.extended.underlineColor&=-67108864,R.updateExtended()}charAttributes(R){if(R.length===1&&R.params[0]===0)return this._processSGR0(this._curAttrData),!0;const P=R.length;let N;const j=this._curAttrData;for(let W=0;W<P;W++)N=R.params[W],N>=30&&N<=37?(j.fg&=-50331904,j.fg|=16777216|N-30):N>=40&&N<=47?(j.bg&=-50331904,j.bg|=16777216|N-40):N>=90&&N<=97?(j.fg&=-50331904,j.fg|=16777224|N-90):N>=100&&N<=107?(j.bg&=-50331904,j.bg|=16777224|N-100):N===0?this._processSGR0(j):N===1?j.fg|=134217728:N===3?j.bg|=67108864:N===4?(j.fg|=268435456,this._processUnderline(R.hasSubParams(W)?R.getSubParams(W)[0]:1,j)):N===5?j.fg|=536870912:N===7?j.fg|=67108864:N===8?j.fg|=1073741824:N===9?j.fg|=2147483648:N===2?j.bg|=134217728:N===21?this._processUnderline(2,j):N===22?(j.fg&=-134217729,j.bg&=-134217729):N===23?j.bg&=-67108865:N===24?(j.fg&=-268435457,this._processUnderline(0,j)):N===25?j.fg&=-536870913:N===27?j.fg&=-67108865:N===28?j.fg&=-1073741825:N===29?j.fg&=2147483647:N===39?(j.fg&=-67108864,j.fg|=16777215&h.DEFAULT_ATTR_DATA.fg):N===49?(j.bg&=-67108864,j.bg|=16777215&h.DEFAULT_ATTR_DATA.bg):N===38||N===48||N===58?W+=this._extractColor(R,W,j):N===53?j.bg|=1073741824:N===55?j.bg&=-1073741825:N===59?(j.extended=j.extended.clone(),j.extended.underlineColor=-1,j.updateExtended()):N===100?(j.fg&=-67108864,j.fg|=16777215&h.DEFAULT_ATTR_DATA.fg,j.bg&=-67108864,j.bg|=16777215&h.DEFAULT_ATTR_DATA.bg):this._logService.debug("Unknown SGR attribute: %d.",N);return!0}deviceStatus(R){switch(R.params[0]){case 5:this._coreService.triggerDataEvent(`${u.C0.ESC}[0n`);break;case 6:const P=this._activeBuffer.y+1,N=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${u.C0.ESC}[${P};${N}R`)}return!0}deviceStatusPrivate(R){if(R.params[0]===6){const P=this._activeBuffer.y+1,N=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${u.C0.ESC}[?${P};${N}R`)}return!0}softReset(R){return this._coreService.isCursorHidden=!1,this._onRequestSyncScrollBar.fire(),this._activeBuffer.scrollTop=0,this._activeBuffer.scrollBottom=this._bufferService.rows-1,this._curAttrData=h.DEFAULT_ATTR_DATA.clone(),this._coreService.reset(),this._charsetService.reset(),this._activeBuffer.savedX=0,this._activeBuffer.savedY=this._activeBuffer.ybase,this._activeBuffer.savedCurAttrData.fg=this._curAttrData.fg,this._activeBuffer.savedCurAttrData.bg=this._curAttrData.bg,this._activeBuffer.savedCharset=this._charsetService.charset,this._coreService.decPrivateModes.origin=!1,!0}setCursorStyle(R){const P=R.params[0]||1;switch(P){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 N=P%2==1;return this._optionsService.options.cursorBlink=N,!0}setScrollRegion(R){const P=R.params[0]||1;let N;return(R.length<2||(N=R.params[1])>this._bufferService.rows||N===0)&&(N=this._bufferService.rows),N>P&&(this._activeBuffer.scrollTop=P-1,this._activeBuffer.scrollBottom=N-1,this._setCursor(0,0)),!0}windowOptions(R){if(!M(R.params[0],this._optionsService.rawOptions.windowOptions))return!0;const P=R.length>1?R.params[1]:0;switch(R.params[0]){case 14:P!==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(`${u.C0.ESC}[8;${this._bufferService.rows};${this._bufferService.cols}t`);break;case 22:P!==0&&P!==2||(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>10&&this._windowTitleStack.shift()),P!==0&&P!==1||(this._iconNameStack.push(this._iconName),this._iconNameStack.length>10&&this._iconNameStack.shift());break;case 23:P!==0&&P!==2||this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),P!==0&&P!==1||this._iconNameStack.length&&this.setIconName(this._iconNameStack.pop())}return!0}saveCursor(R){return this._activeBuffer.savedX=this._activeBuffer.x,this._activeBuffer.savedY=this._activeBuffer.ybase+this._activeBuffer.y,this._activeBuffer.savedCurAttrData.fg=this._curAttrData.fg,this._activeBuffer.savedCurAttrData.bg=this._curAttrData.bg,this._activeBuffer.savedCharset=this._charsetService.charset,!0}restoreCursor(R){return this._activeBuffer.x=this._activeBuffer.savedX||0,this._activeBuffer.y=Math.max(this._activeBuffer.savedY-this._activeBuffer.ybase,0),this._curAttrData.fg=this._activeBuffer.savedCurAttrData.fg,this._curAttrData.bg=this._activeBuffer.savedCurAttrData.bg,this._charsetService.charset=this._savedCharset,this._activeBuffer.savedCharset&&(this._charsetService.charset=this._activeBuffer.savedCharset),this._restrictCursor(),!0}setTitle(R){return this._windowTitle=R,this._onTitleChange.fire(R),!0}setIconName(R){return this._iconName=R,!0}setOrReportIndexedColor(R){const P=[],N=R.split(";");for(;N.length>1;){const j=N.shift(),W=N.shift();if(/^\d+$/.exec(j)){const V=parseInt(j);if(H(V))if(W==="?")P.push({type:0,index:V});else{const Z=(0,k.parseColor)(W);Z&&P.push({type:1,index:V,color:Z})}}}return P.length&&this._onColor.fire(P),!0}setHyperlink(R){const P=R.split(";");return!(P.length<2)&&(P[1]?this._createHyperlink(P[0],P[1]):!P[0]&&this._finishHyperlink())}_createHyperlink(R,P){this._getCurrentLinkId()&&this._finishHyperlink();const N=R.split(":");let j;const W=N.findIndex(V=>V.startsWith("id="));return W!==-1&&(j=N[W].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:j,uri:P}),this._curAttrData.updateExtended(),!0}_finishHyperlink(){return this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=0,this._curAttrData.updateExtended(),!0}_setOrReportSpecialColor(R,P){const N=R.split(";");for(let j=0;j<N.length&&!(P>=this._specialColors.length);++j,++P)if(N[j]==="?")this._onColor.fire([{type:0,index:this._specialColors[P]}]);else{const W=(0,k.parseColor)(N[j]);W&&this._onColor.fire([{type:1,index:this._specialColors[P],color:W}])}return!0}setOrReportFgColor(R){return this._setOrReportSpecialColor(R,0)}setOrReportBgColor(R){return this._setOrReportSpecialColor(R,1)}setOrReportCursorColor(R){return this._setOrReportSpecialColor(R,2)}restoreIndexedColor(R){if(!R)return this._onColor.fire([{type:2}]),!0;const P=[],N=R.split(";");for(let j=0;j<N.length;++j)if(/^\d+$/.exec(N[j])){const W=parseInt(N[j]);H(W)&&P.push({type:2,index:W})}return P.length&&this._onColor.fire(P),!0}restoreFgColor(R){return this._onColor.fire([{type:2,index:256}]),!0}restoreBgColor(R){return this._onColor.fire([{type:2,index:257}]),!0}restoreCursorColor(R){return this._onColor.fire([{type:2,index:258}]),!0}nextLine(){return this._activeBuffer.x=0,this.index(),!0}keypadApplicationMode(){return this._logService.debug("Serial port requested application keypad."),this._coreService.decPrivateModes.applicationKeypad=!0,this._onRequestSyncScrollBar.fire(),!0}keypadNumericMode(){return this._logService.debug("Switching back to normal keypad."),this._coreService.decPrivateModes.applicationKeypad=!1,this._onRequestSyncScrollBar.fire(),!0}selectDefaultCharset(){return this._charsetService.setgLevel(0),this._charsetService.setgCharset(0,p.DEFAULT_CHARSET),!0}selectCharset(R){return R.length!==2?(this.selectDefaultCharset(),!0):(R[0]==="/"||this._charsetService.setgCharset(L[R[0]],p.CHARSETS[R[1]]||p.DEFAULT_CHARSET),!0)}index(){return this._restrictCursor(),this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData())):this._activeBuffer.y>=this._bufferService.rows&&(this._activeBuffer.y=this._bufferService.rows-1),this._restrictCursor(),!0}tabSet(){return this._activeBuffer.tabs[this._activeBuffer.x]=!0,!0}reverseIndex(){if(this._restrictCursor(),this._activeBuffer.y===this._activeBuffer.scrollTop){const R=this._activeBuffer.scrollBottom-this._activeBuffer.scrollTop;this._activeBuffer.lines.shiftElements(this._activeBuffer.ybase+this._activeBuffer.y,R,1),this._activeBuffer.lines.set(this._activeBuffer.ybase+this._activeBuffer.y,this._activeBuffer.getBlankLine(this._eraseAttrData())),this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom)}else this._activeBuffer.y--,this._restrictCursor();return!0}fullReset(){return this._parser.reset(),this._onRequestReset.fire(),!0}reset(){this._curAttrData=h.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=h.DEFAULT_ATTR_DATA.clone()}_eraseAttrData(){return this._eraseAttrDataInternal.bg&=-67108864,this._eraseAttrDataInternal.bg|=67108863&this._curAttrData.bg,this._eraseAttrDataInternal}setgLevel(R){return this._charsetService.setgLevel(R),!0}screenAlignmentPattern(){const R=new g.CellData;R.content=4194373,R.fg=this._curAttrData.fg,R.bg=this._curAttrData.bg,this._setCursor(0,0);for(let P=0;P<this._bufferService.rows;++P){const N=this._activeBuffer.ybase+this._activeBuffer.y+P,j=this._activeBuffer.lines.get(N);j&&(j.fill(R),j.isWrapped=!1)}return this._dirtyRowTracker.markAllDirty(),this._setCursor(0,0),!0}requestStatusString(R,P){const N=this._bufferService.buffer,j=this._optionsService.rawOptions;return(W=>(this._coreService.triggerDataEvent(`${u.C0.ESC}${W}${u.C0.ESC}\\`),!0))(R==='"q'?`P1$r${this._curAttrData.isProtected()?1:0}"q`:R==='"p'?'P1$r61;1"p':R==="r"?`P1$r${N.scrollTop+1};${N.scrollBottom+1}r`:R==="m"?"P1$r0m":R===" q"?`P1$r${{block:2,underline:4,bar:6}[j.cursorStyle]-(j.cursorBlink?1:0)} q`:"P0$r")}markRangeDirty(R,P){this._dirtyRowTracker.markRangeDirty(R,P)}}s.InputHandler=z;let F=class{constructor(I){this._bufferService=I,this.clearRange()}clearRange(){this.start=this._bufferService.buffer.y,this.end=this._bufferService.buffer.y}markDirty(I){I<this.start?this.start=I:I>this.end&&(this.end=I)}markRangeDirty(I,R){I>R&&(O=I,I=R,R=O),I<this.start&&(this.start=I),R>this.end&&(this.end=R)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};function H(I){return 0<=I&&I<256}F=c([f(0,b.IBufferService)],F)},844:(l,s)=>{function o(c){for(const f of c)f.dispose();c.length=0}Object.defineProperty(s,"__esModule",{value:!0}),s.getDisposeArrayDisposable=s.disposeArray=s.toDisposable=s.MutableDisposable=s.Disposable=void 0,s.Disposable=class{constructor(){this._disposables=[],this._isDisposed=!1}dispose(){this._isDisposed=!0;for(const c of this._disposables)c.dispose();this._disposables.length=0}register(c){return this._disposables.push(c),c}unregister(c){const f=this._disposables.indexOf(c);f!==-1&&this._disposables.splice(f,1)}},s.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(c){var f;this._isDisposed||c===this._value||((f=this._value)==null||f.dispose(),this._value=c)}clear(){this.value=void 0}dispose(){var c;this._isDisposed=!0,(c=this._value)==null||c.dispose(),this._value=void 0}},s.toDisposable=function(c){return{dispose:c}},s.disposeArray=o,s.getDisposeArrayDisposable=function(c){return{dispose:()=>o(c)}}},1505:(l,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.FourKeyMap=s.TwoKeyMap=void 0;class o{constructor(){this._data={}}set(f,u,p){this._data[f]||(this._data[f]={}),this._data[f][u]=p}get(f,u){return this._data[f]?this._data[f][u]:void 0}clear(){this._data={}}}s.TwoKeyMap=o,s.FourKeyMap=class{constructor(){this._data=new o}set(c,f,u,p,_){this._data.get(c,f)||this._data.set(c,f,new o),this._data.get(c,f).set(u,p,_)}get(c,f,u,p){var _;return(_=this._data.get(c,f))==null?void 0:_.get(u,p)}clear(){this._data.clear()}}},6114:(l,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.isChromeOS=s.isLinux=s.isWindows=s.isIphone=s.isIpad=s.isMac=s.getSafariVersion=s.isSafari=s.isLegacyEdge=s.isFirefox=s.isNode=void 0,s.isNode=typeof process<"u"&&"title"in process;const o=s.isNode?"node":navigator.userAgent,c=s.isNode?"node":navigator.platform;s.isFirefox=o.includes("Firefox"),s.isLegacyEdge=o.includes("Edge"),s.isSafari=/^((?!chrome|android).)*safari/i.test(o),s.getSafariVersion=function(){if(!s.isSafari)return 0;const f=o.match(/Version\/(\d+)/);return f===null||f.length<2?0:parseInt(f[1])},s.isMac=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(c),s.isIpad=c==="iPad",s.isIphone=c==="iPhone",s.isWindows=["Windows","Win16","Win32","WinCE"].includes(c),s.isLinux=c.indexOf("Linux")>=0,s.isChromeOS=/\bCrOS\b/.test(o)},6106:(l,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.SortedList=void 0;let o=0;s.SortedList=class{constructor(c){this._getKey=c,this._array=[]}clear(){this._array.length=0}insert(c){this._array.length!==0?(o=this._search(this._getKey(c)),this._array.splice(o,0,c)):this._array.push(c)}delete(c){if(this._array.length===0)return!1;const f=this._getKey(c);if(f===void 0||(o=this._search(f),o===-1)||this._getKey(this._array[o])!==f)return!1;do if(this._array[o]===c)return this._array.splice(o,1),!0;while(++o<this._array.length&&this._getKey(this._array[o])===f);return!1}*getKeyIterator(c){if(this._array.length!==0&&(o=this._search(c),!(o<0||o>=this._array.length)&&this._getKey(this._array[o])===c))do yield this._array[o];while(++o<this._array.length&&this._getKey(this._array[o])===c)}forEachByKey(c,f){if(this._array.length!==0&&(o=this._search(c),!(o<0||o>=this._array.length)&&this._getKey(this._array[o])===c))do f(this._array[o]);while(++o<this._array.length&&this._getKey(this._array[o])===c)}values(){return[...this._array].values()}_search(c){let f=0,u=this._array.length-1;for(;u>=f;){let p=f+u>>1;const _=this._getKey(this._array[p]);if(_>c)u=p-1;else{if(!(_<c)){for(;p>0&&this._getKey(this._array[p-1])===c;)p--;return p}f=p+1}}return f}}},7226:(l,s,o)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.DebouncedIdleTask=s.IdleTaskQueue=s.PriorityTaskQueue=void 0;const c=o(6114);class f{constructor(){this._tasks=[],this._i=0}enqueue(_){this._tasks.push(_),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(_){this._idleCallback=void 0;let y=0,v=0,h=_.timeRemaining(),m=0;for(;this._i<this._tasks.length;){if(y=Date.now(),this._tasks[this._i]()||this._i++,y=Math.max(1,Date.now()-y),v=Math.max(y,v),m=_.timeRemaining(),1.5*v>m)return h-y<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(h-y))}ms`),void this._start();h=m}this.clear()}}class u extends f{_requestCallback(_){return setTimeout(()=>_(this._createDeadline(16)))}_cancelCallback(_){clearTimeout(_)}_createDeadline(_){const y=Date.now()+_;return{timeRemaining:()=>Math.max(0,y-Date.now())}}}s.PriorityTaskQueue=u,s.IdleTaskQueue=!c.isNode&&"requestIdleCallback"in window?class extends f{_requestCallback(p){return requestIdleCallback(p)}_cancelCallback(p){cancelIdleCallback(p)}}:u,s.DebouncedIdleTask=class{constructor(){this._queue=new s.IdleTaskQueue}set(p){this._queue.clear(),this._queue.enqueue(p)}flush(){this._queue.flush()}}},9282:(l,s,o)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.updateWindowsModeWrappedState=void 0;const c=o(643);s.updateWindowsModeWrappedState=function(f){const u=f.buffer.lines.get(f.buffer.ybase+f.buffer.y-1),p=u==null?void 0:u.get(f.cols-1),_=f.buffer.lines.get(f.buffer.ybase+f.buffer.y);_&&p&&(_.isWrapped=p[c.CHAR_DATA_CODE_INDEX]!==c.NULL_CELL_CODE&&p[c.CHAR_DATA_CODE_INDEX]!==c.WHITESPACE_CELL_CODE)}},3734:(l,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.ExtendedAttrs=s.AttributeData=void 0;class o{constructor(){this.fg=0,this.bg=0,this.extended=new c}static toColorRGB(u){return[u>>>16&255,u>>>8&255,255&u]}static fromColorRGB(u){return(255&u[0])<<16|(255&u[1])<<8|255&u[2]}clone(){const u=new o;return u.fg=this.fg,u.bg=this.bg,u.extended=this.extended.clone(),u}isInverse(){return 67108864&this.fg}isBold(){return 134217728&this.fg}isUnderline(){return this.hasExtendedAttrs()&&this.extended.underlineStyle!==0?1:268435456&this.fg}isBlink(){return 536870912&this.fg}isInvisible(){return 1073741824&this.fg}isItalic(){return 67108864&this.bg}isDim(){return 134217728&this.bg}isStrikethrough(){return 2147483648&this.fg}isProtected(){return 536870912&this.bg}isOverline(){return 1073741824&this.bg}getFgColorMode(){return 50331648&this.fg}getBgColorMode(){return 50331648&this.bg}isFgRGB(){return(50331648&this.fg)==50331648}isBgRGB(){return(50331648&this.bg)==50331648}isFgPalette(){return(50331648&this.fg)==16777216||(50331648&this.fg)==33554432}isBgPalette(){return(50331648&this.bg)==16777216||(50331648&this.bg)==33554432}isFgDefault(){return(50331648&this.fg)==0}isBgDefault(){return(50331648&this.bg)==0}isAttributeDefault(){return this.fg===0&&this.bg===0}getFgColor(){switch(50331648&this.fg){case 16777216:case 33554432:return 255&this.fg;case 50331648:return 16777215&this.fg;default:return-1}}getBgColor(){switch(50331648&this.bg){case 16777216:case 33554432:return 255&this.bg;case 50331648:return 16777215&this.bg;default:return-1}}hasExtendedAttrs(){return 268435456&this.bg}updateExtended(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456}getUnderlineColor(){if(268435456&this.bg&&~this.extended.underlineColor)switch(50331648&this.extended.underlineColor){case 16777216:case 33554432:return 255&this.extended.underlineColor;case 50331648:return 16777215&this.extended.underlineColor;default:return this.getFgColor()}return this.getFgColor()}getUnderlineColorMode(){return 268435456&this.bg&&~this.extended.underlineColor?50331648&this.extended.underlineColor:this.getFgColorMode()}isUnderlineColorRGB(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==50331648:this.isFgRGB()}isUnderlineColorPalette(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==16777216||(50331648&this.extended.underlineColor)==33554432:this.isFgPalette()}isUnderlineColorDefault(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==0:this.isFgDefault()}getUnderlineStyle(){return 268435456&this.fg?268435456&this.bg?this.extended.underlineStyle:1:0}getUnderlineVariantOffset(){return this.extended.underlineVariantOffset}}s.AttributeData=o;class c{get ext(){return this._urlId?-469762049&this._ext|this.underlineStyle<<26:this._ext}set ext(u){this._ext=u}get underlineStyle(){return this._urlId?5:(469762048&this._ext)>>26}set underlineStyle(u){this._ext&=-469762049,this._ext|=u<<26&469762048}get underlineColor(){return 67108863&this._ext}set underlineColor(u){this._ext&=-67108864,this._ext|=67108863&u}get urlId(){return this._urlId}set urlId(u){this._urlId=u}get underlineVariantOffset(){const u=(3758096384&this._ext)>>29;return u<0?4294967288^u:u}set underlineVariantOffset(u){this._ext&=536870911,this._ext|=u<<29&3758096384}constructor(u=0,p=0){this._ext=0,this._urlId=0,this._ext=u,this._urlId=p}clone(){return new c(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}}s.ExtendedAttrs=c},9092:(l,s,o)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.Buffer=s.MAX_BUFFER_SIZE=void 0;const c=o(6349),f=o(7226),u=o(3734),p=o(8437),_=o(4634),y=o(511),v=o(643),h=o(4863),m=o(7116);s.MAX_BUFFER_SIZE=4294967295,s.Buffer=class{constructor(d,g,w){this._hasScrollback=d,this._optionsService=g,this._bufferService=w,this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.tabs={},this.savedY=0,this.savedX=0,this.savedCurAttrData=p.DEFAULT_ATTR_DATA.clone(),this.savedCharset=m.DEFAULT_CHARSET,this.markers=[],this._nullCell=y.CellData.fromCharData([0,v.NULL_CELL_CHAR,v.NULL_CELL_WIDTH,v.NULL_CELL_CODE]),this._whitespaceCell=y.CellData.fromCharData([0,v.WHITESPACE_CELL_CHAR,v.WHITESPACE_CELL_WIDTH,v.WHITESPACE_CELL_CODE]),this._isClearing=!1,this._memoryCleanupQueue=new f.IdleTaskQueue,this._memoryCleanupPosition=0,this._cols=this._bufferService.cols,this._rows=this._bufferService.rows,this.lines=new c.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}getNullCell(d){return d?(this._nullCell.fg=d.fg,this._nullCell.bg=d.bg,this._nullCell.extended=d.extended):(this._nullCell.fg=0,this._nullCell.bg=0,this._nullCell.extended=new u.ExtendedAttrs),this._nullCell}getWhitespaceCell(d){return d?(this._whitespaceCell.fg=d.fg,this._whitespaceCell.bg=d.bg,this._whitespaceCell.extended=d.extended):(this._whitespaceCell.fg=0,this._whitespaceCell.bg=0,this._whitespaceCell.extended=new u.ExtendedAttrs),this._whitespaceCell}getBlankLine(d,g){return new p.BufferLine(this._bufferService.cols,this.getNullCell(d),g)}get hasScrollback(){return this._hasScrollback&&this.lines.maxLength>this._rows}get isCursorInViewport(){const d=this.ybase+this.y-this.ydisp;return d>=0&&d<this._rows}_getCorrectBufferLength(d){if(!this._hasScrollback)return d;const g=d+this._optionsService.rawOptions.scrollback;return g>s.MAX_BUFFER_SIZE?s.MAX_BUFFER_SIZE:g}fillViewportRows(d){if(this.lines.length===0){d===void 0&&(d=p.DEFAULT_ATTR_DATA);let g=this._rows;for(;g--;)this.lines.push(this.getBlankLine(d))}}clear(){this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.lines=new c.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}resize(d,g){const w=this.getNullCell(p.DEFAULT_ATTR_DATA);let b=0;const x=this._getCorrectBufferLength(g);if(x>this.lines.maxLength&&(this.lines.maxLength=x),this.lines.length>0){if(this._cols<d)for(let S=0;S<this.lines.length;S++)b+=+this.lines.get(S).resize(d,w);let C=0;if(this._rows<g)for(let S=this._rows;S<g;S++)this.lines.length<g+this.ybase&&(this._optionsService.rawOptions.windowsMode||this._optionsService.rawOptions.windowsPty.backend!==void 0||this._optionsService.rawOptions.windowsPty.buildNumber!==void 0?this.lines.push(new p.BufferLine(d,w)):this.ybase>0&&this.lines.length<=this.ybase+this.y+C+1?(this.ybase--,C++,this.ydisp>0&&this.ydisp--):this.lines.push(new p.BufferLine(d,w)));else for(let S=this._rows;S>g;S--)this.lines.length>g+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(x<this.lines.maxLength){const S=this.lines.length-x;S>0&&(this.lines.trimStart(S),this.ybase=Math.max(this.ybase-S,0),this.ydisp=Math.max(this.ydisp-S,0),this.savedY=Math.max(this.savedY-S,0)),this.lines.maxLength=x}this.x=Math.min(this.x,d-1),this.y=Math.min(this.y,g-1),C&&(this.y+=C),this.savedX=Math.min(this.savedX,d-1),this.scrollTop=0}if(this.scrollBottom=g-1,this._isReflowEnabled&&(this._reflow(d,g),this._cols>d))for(let C=0;C<this.lines.length;C++)b+=+this.lines.get(C).resize(d,w);this._cols=d,this._rows=g,this._memoryCleanupQueue.clear(),b>.1*this.lines.length&&(this._memoryCleanupPosition=0,this._memoryCleanupQueue.enqueue(()=>this._batchedMemoryCleanup()))}_batchedMemoryCleanup(){let d=!0;this._memoryCleanupPosition>=this.lines.length&&(this._memoryCleanupPosition=0,d=!1);let g=0;for(;this._memoryCleanupPosition<this.lines.length;)if(g+=this.lines.get(this._memoryCleanupPosition++).cleanupMemory(),g>100)return!0;return d}get _isReflowEnabled(){const d=this._optionsService.rawOptions.windowsPty;return d&&d.buildNumber?this._hasScrollback&&d.backend==="conpty"&&d.buildNumber>=21376:this._hasScrollback&&!this._optionsService.rawOptions.windowsMode}_reflow(d,g){this._cols!==d&&(d>this._cols?this._reflowLarger(d,g):this._reflowSmaller(d,g))}_reflowLarger(d,g){const w=(0,_.reflowLargerGetLinesToRemove)(this.lines,this._cols,d,this.ybase+this.y,this.getNullCell(p.DEFAULT_ATTR_DATA));if(w.length>0){const b=(0,_.reflowLargerCreateNewLayout)(this.lines,w);(0,_.reflowLargerApplyNewLayout)(this.lines,b.layout),this._reflowLargerAdjustViewport(d,g,b.countRemoved)}}_reflowLargerAdjustViewport(d,g,w){const b=this.getNullCell(p.DEFAULT_ATTR_DATA);let x=w;for(;x-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length<g&&this.lines.push(new p.BufferLine(d,b))):(this.ydisp===this.ybase&&this.ydisp--,this.ybase--);this.savedY=Math.max(this.savedY-w,0)}_reflowSmaller(d,g){const w=this.getNullCell(p.DEFAULT_ATTR_DATA),b=[];let x=0;for(let C=this.lines.length-1;C>=0;C--){let S=this.lines.get(C);if(!S||!S.isWrapped&&S.getTrimmedLength()<=d)continue;const k=[S];for(;S.isWrapped&&C>0;)S=this.lines.get(--C),k.unshift(S);const L=this.ybase+this.y;if(L>=C&&L<C+k.length)continue;const A=k[k.length-1].getTrimmedLength(),M=(0,_.reflowSmallerGetNewLineLengths)(k,this._cols,d),D=M.length-k.length;let O;O=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 z=[];for(let N=0;N<D;N++){const j=this.getBlankLine(p.DEFAULT_ATTR_DATA,!0);z.push(j)}z.length>0&&(b.push({start:C+k.length+x,newLines:z}),x+=z.length),k.push(...z);let F=M.length-1,H=M[F];H===0&&(F--,H=M[F]);let I=k.length-D-1,R=A;for(;I>=0;){const N=Math.min(R,H);if(k[F]===void 0)break;if(k[F].copyCellsFrom(k[I],R-N,H-N,N,!0),H-=N,H===0&&(F--,H=M[F]),R-=N,R===0){I--;const j=Math.max(I,0);R=(0,_.getWrappedLineTrimmedLength)(k,j,this._cols)}}for(let N=0;N<k.length;N++)M[N]<d&&k[N].setCell(M[N],w);let P=D-O;for(;P-- >0;)this.ybase===0?this.y<g-1?(this.y++,this.lines.pop()):(this.ybase++,this.ydisp++):this.ybase<Math.min(this.lines.maxLength,this.lines.length+x)-g&&(this.ybase===this.ydisp&&this.ydisp++,this.ybase++);this.savedY=Math.min(this.savedY+D,this.ybase+g-1)}if(b.length>0){const C=[],S=[];for(let F=0;F<this.lines.length;F++)S.push(this.lines.get(F));const k=this.lines.length;let L=k-1,A=0,M=b[A];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+x);let D=0;for(let F=Math.min(this.lines.maxLength-1,k+x-1);F>=0;F--)if(M&&M.start>L+D){for(let H=M.newLines.length-1;H>=0;H--)this.lines.set(F--,M.newLines[H]);F++,C.push({index:L+1,amount:M.newLines.length}),D+=M.newLines.length,M=b[++A]}else this.lines.set(F,S[L--]);let O=0;for(let F=C.length-1;F>=0;F--)C[F].index+=O,this.lines.onInsertEmitter.fire(C[F]),O+=C[F].amount;const z=Math.max(0,k+x-this.lines.maxLength);z>0&&this.lines.onTrimEmitter.fire(z)}}translateBufferLineToString(d,g,w=0,b){const x=this.lines.get(d);return x?x.translateToString(g,w,b):""}getWrappedRangeForLine(d){let g=d,w=d;for(;g>0&&this.lines.get(g).isWrapped;)g--;for(;w+1<this.lines.length&&this.lines.get(w+1).isWrapped;)w++;return{first:g,last:w}}setupTabStops(d){for(d!=null?this.tabs[d]||(d=this.prevStop(d)):(this.tabs={},d=0);d<this._cols;d+=this._optionsService.rawOptions.tabStopWidth)this.tabs[d]=!0}prevStop(d){for(d==null&&(d=this.x);!this.tabs[--d]&&d>0;);return d>=this._cols?this._cols-1:d<0?0:d}nextStop(d){for(d==null&&(d=this.x);!this.tabs[++d]&&d<this._cols;);return d>=this._cols?this._cols-1:d<0?0:d}clearMarkers(d){this._isClearing=!0;for(let g=0;g<this.markers.length;g++)this.markers[g].line===d&&(this.markers[g].dispose(),this.markers.splice(g--,1));this._isClearing=!1}clearAllMarkers(){this._isClearing=!0;for(let d=0;d<this.markers.length;d++)this.markers[d].dispose(),this.markers.splice(d--,1);this._isClearing=!1}addMarker(d){const g=new h.Marker(d);return this.markers.push(g),g.register(this.lines.onTrim(w=>{g.line-=w,g.line<0&&g.dispose()})),g.register(this.lines.onInsert(w=>{g.line>=w.index&&(g.line+=w.amount)})),g.register(this.lines.onDelete(w=>{g.line>=w.index&&g.line<w.index+w.amount&&g.dispose(),g.line>w.index&&(g.line-=w.amount)})),g.register(g.onDispose(()=>this._removeMarker(g))),g}_removeMarker(d){this._isClearing||this.markers.splice(this.markers.indexOf(d),1)}}},8437:(l,s,o)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.BufferLine=s.DEFAULT_ATTR_DATA=void 0;const c=o(3734),f=o(511),u=o(643),p=o(482);s.DEFAULT_ATTR_DATA=Object.freeze(new c.AttributeData);let _=0;class y{constructor(h,m,d=!1){this.isWrapped=d,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(3*h);const g=m||f.CellData.fromCharData([0,u.NULL_CELL_CHAR,u.NULL_CELL_WIDTH,u.NULL_CELL_CODE]);for(let w=0;w<h;++w)this.setCell(w,g);this.length=h}get(h){const m=this._data[3*h+0],d=2097151&m;return[this._data[3*h+1],2097152&m?this._combined[h]:d?(0,p.stringFromCodePoint)(d):"",m>>22,2097152&m?this._combined[h].charCodeAt(this._combined[h].length-1):d]}set(h,m){this._data[3*h+1]=m[u.CHAR_DATA_ATTR_INDEX],m[u.CHAR_DATA_CHAR_INDEX].length>1?(this._combined[h]=m[1],this._data[3*h+0]=2097152|h|m[u.CHAR_DATA_WIDTH_INDEX]<<22):this._data[3*h+0]=m[u.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|m[u.CHAR_DATA_WIDTH_INDEX]<<22}getWidth(h){return this._data[3*h+0]>>22}hasWidth(h){return 12582912&this._data[3*h+0]}getFg(h){return this._data[3*h+1]}getBg(h){return this._data[3*h+2]}hasContent(h){return 4194303&this._data[3*h+0]}getCodePoint(h){const m=this._data[3*h+0];return 2097152&m?this._combined[h].charCodeAt(this._combined[h].length-1):2097151&m}isCombined(h){return 2097152&this._data[3*h+0]}getString(h){const m=this._data[3*h+0];return 2097152&m?this._combined[h]:2097151&m?(0,p.stringFromCodePoint)(2097151&m):""}isProtected(h){return 536870912&this._data[3*h+2]}loadCell(h,m){return _=3*h,m.content=this._data[_+0],m.fg=this._data[_+1],m.bg=this._data[_+2],2097152&m.content&&(m.combinedData=this._combined[h]),268435456&m.bg&&(m.extended=this._extendedAttrs[h]),m}setCell(h,m){2097152&m.content&&(this._combined[h]=m.combinedData),268435456&m.bg&&(this._extendedAttrs[h]=m.extended),this._data[3*h+0]=m.content,this._data[3*h+1]=m.fg,this._data[3*h+2]=m.bg}setCellFromCodepoint(h,m,d,g){268435456&g.bg&&(this._extendedAttrs[h]=g.extended),this._data[3*h+0]=m|d<<22,this._data[3*h+1]=g.fg,this._data[3*h+2]=g.bg}addCodepointToCell(h,m,d){let g=this._data[3*h+0];2097152&g?this._combined[h]+=(0,p.stringFromCodePoint)(m):2097151&g?(this._combined[h]=(0,p.stringFromCodePoint)(2097151&g)+(0,p.stringFromCodePoint)(m),g&=-2097152,g|=2097152):g=m|4194304,d&&(g&=-12582913,g|=d<<22),this._data[3*h+0]=g}insertCells(h,m,d){if((h%=this.length)&&this.getWidth(h-1)===2&&this.setCellFromCodepoint(h-1,0,1,d),m<this.length-h){const g=new f.CellData;for(let w=this.length-h-m-1;w>=0;--w)this.setCell(h+m+w,this.loadCell(h+w,g));for(let w=0;w<m;++w)this.setCell(h+w,d)}else for(let g=h;g<this.length;++g)this.setCell(g,d);this.getWidth(this.length-1)===2&&this.setCellFromCodepoint(this.length-1,0,1,d)}deleteCells(h,m,d){if(h%=this.length,m<this.length-h){const g=new f.CellData;for(let w=0;w<this.length-h-m;++w)this.setCell(h+w,this.loadCell(h+m+w,g));for(let w=this.length-m;w<this.length;++w)this.setCell(w,d)}else for(let g=h;g<this.length;++g)this.setCell(g,d);h&&this.getWidth(h-1)===2&&this.setCellFromCodepoint(h-1,0,1,d),this.getWidth(h)!==0||this.hasContent(h)||this.setCellFromCodepoint(h,0,1,d)}replaceCells(h,m,d,g=!1){if(g)for(h&&this.getWidth(h-1)===2&&!this.isProtected(h-1)&&this.setCellFromCodepoint(h-1,0,1,d),m<this.length&&this.getWidth(m-1)===2&&!this.isProtected(m)&&this.setCellFromCodepoint(m,0,1,d);h<m&&h<this.length;)this.isProtected(h)||this.setCell(h,d),h++;else for(h&&this.getWidth(h-1)===2&&this.setCellFromCodepoint(h-1,0,1,d),m<this.length&&this.getWidth(m-1)===2&&this.setCellFromCodepoint(m,0,1,d);h<m&&h<this.length;)this.setCell(h++,d)}resize(h,m){if(h===this.length)return 4*this._data.length*2<this._data.buffer.byteLength;const d=3*h;if(h>this.length){if(this._data.buffer.byteLength>=4*d)this._data=new Uint32Array(this._data.buffer,0,d);else{const g=new Uint32Array(d);g.set(this._data),this._data=g}for(let g=this.length;g<h;++g)this.setCell(g,m)}else{this._data=this._data.subarray(0,d);const g=Object.keys(this._combined);for(let b=0;b<g.length;b++){const x=parseInt(g[b],10);x>=h&&delete this._combined[x]}const w=Object.keys(this._extendedAttrs);for(let b=0;b<w.length;b++){const x=parseInt(w[b],10);x>=h&&delete this._extendedAttrs[x]}}return this.length=h,4*d*2<this._data.buffer.byteLength}cleanupMemory(){if(4*this._data.length*2<this._data.buffer.byteLength){const h=new Uint32Array(this._data.length);return h.set(this._data),this._data=h,1}return 0}fill(h,m=!1){if(m)for(let d=0;d<this.length;++d)this.isProtected(d)||this.setCell(d,h);else{this._combined={},this._extendedAttrs={};for(let d=0;d<this.length;++d)this.setCell(d,h)}}copyFrom(h){this.length!==h.length?this._data=new Uint32Array(h._data):this._data.set(h._data),this.length=h.length,this._combined={};for(const m in h._combined)this._combined[m]=h._combined[m];this._extendedAttrs={};for(const m in h._extendedAttrs)this._extendedAttrs[m]=h._extendedAttrs[m];this.isWrapped=h.isWrapped}clone(){const h=new y(0);h._data=new Uint32Array(this._data),h.length=this.length;for(const m in this._combined)h._combined[m]=this._combined[m];for(const m in this._extendedAttrs)h._extendedAttrs[m]=this._extendedAttrs[m];return h.isWrapped=this.isWrapped,h}getTrimmedLength(){for(let h=this.length-1;h>=0;--h)if(4194303&this._data[3*h+0])return h+(this._data[3*h+0]>>22);return 0}getNoBgTrimmedLength(){for(let h=this.length-1;h>=0;--h)if(4194303&this._data[3*h+0]||50331648&this._data[3*h+2])return h+(this._data[3*h+0]>>22);return 0}copyCellsFrom(h,m,d,g,w){const b=h._data;if(w)for(let C=g-1;C>=0;C--){for(let S=0;S<3;S++)this._data[3*(d+C)+S]=b[3*(m+C)+S];268435456&b[3*(m+C)+2]&&(this._extendedAttrs[d+C]=h._extendedAttrs[m+C])}else for(let C=0;C<g;C++){for(let S=0;S<3;S++)this._data[3*(d+C)+S]=b[3*(m+C)+S];268435456&b[3*(m+C)+2]&&(this._extendedAttrs[d+C]=h._extendedAttrs[m+C])}const x=Object.keys(h._combined);for(let C=0;C<x.length;C++){const S=parseInt(x[C],10);S>=m&&(this._combined[S-m+d]=h._combined[S])}}translateToString(h,m,d,g){m=m??0,d=d??this.length,h&&(d=Math.min(d,this.getTrimmedLength())),g&&(g.length=0);let w="";for(;m<d;){const b=this._data[3*m+0],x=2097151&b,C=2097152&b?this._combined[m]:x?(0,p.stringFromCodePoint)(x):u.WHITESPACE_CELL_CHAR;if(w+=C,g)for(let S=0;S<C.length;++S)g.push(m);m+=b>>22||1}return g&&g.push(m),w}}s.BufferLine=y},4841:(l,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.getRangeLength=void 0,s.getRangeLength=function(o,c){if(o.start.y>o.end.y)throw new Error(`Buffer range end (${o.end.x}, ${o.end.y}) cannot be before start (${o.start.x}, ${o.start.y})`);return c*(o.end.y-o.start.y)+(o.end.x-o.start.x+1)}},4634:(l,s)=>{function o(c,f,u){if(f===c.length-1)return c[f].getTrimmedLength();const p=!c[f].hasContent(u-1)&&c[f].getWidth(u-1)===1,_=c[f+1].getWidth(0)===2;return p&&_?u-1:u}Object.defineProperty(s,"__esModule",{value:!0}),s.getWrappedLineTrimmedLength=s.reflowSmallerGetNewLineLengths=s.reflowLargerApplyNewLayout=s.reflowLargerCreateNewLayout=s.reflowLargerGetLinesToRemove=void 0,s.reflowLargerGetLinesToRemove=function(c,f,u,p,_){const y=[];for(let v=0;v<c.length-1;v++){let h=v,m=c.get(++h);if(!m.isWrapped)continue;const d=[c.get(v)];for(;h<c.length&&m.isWrapped;)d.push(m),m=c.get(++h);if(p>=v&&p<h){v+=d.length-1;continue}let g=0,w=o(d,g,f),b=1,x=0;for(;b<d.length;){const S=o(d,b,f),k=S-x,L=u-w,A=Math.min(k,L);d[g].copyCellsFrom(d[b],x,w,A,!1),w+=A,w===u&&(g++,w=0),x+=A,x===S&&(b++,x=0),w===0&&g!==0&&d[g-1].getWidth(u-1)===2&&(d[g].copyCellsFrom(d[g-1],u-1,w++,1,!1),d[g-1].setCell(u-1,_))}d[g].replaceCells(w,u,_);let C=0;for(let S=d.length-1;S>0&&(S>g||d[S].getTrimmedLength()===0);S--)C++;C>0&&(y.push(v+d.length-C),y.push(C)),v+=d.length-1}return y},s.reflowLargerCreateNewLayout=function(c,f){const u=[];let p=0,_=f[p],y=0;for(let v=0;v<c.length;v++)if(_===v){const h=f[++p];c.onDeleteEmitter.fire({index:v-y,amount:h}),v+=h-1,y+=h,_=f[++p]}else u.push(v);return{layout:u,countRemoved:y}},s.reflowLargerApplyNewLayout=function(c,f){const u=[];for(let p=0;p<f.length;p++)u.push(c.get(f[p]));for(let p=0;p<u.length;p++)c.set(p,u[p]);c.length=f.length},s.reflowSmallerGetNewLineLengths=function(c,f,u){const p=[],_=c.map((m,d)=>o(c,d,f)).reduce((m,d)=>m+d);let y=0,v=0,h=0;for(;h<_;){if(_-h<u){p.push(_-h);break}y+=u;const m=o(c,v,f);y>m&&(y-=m,v++);const d=c[v].getWidth(y-1)===2;d&&y--;const g=d?u-1:u;p.push(g),h+=g}return p},s.getWrappedLineTrimmedLength=o},5295:(l,s,o)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.BufferSet=void 0;const c=o(8460),f=o(844),u=o(9092);class p extends f.Disposable{constructor(y,v){super(),this._optionsService=y,this._bufferService=v,this._onBufferActivate=this.register(new c.EventEmitter),this.onBufferActivate=this._onBufferActivate.event,this.reset(),this.register(this._optionsService.onSpecificOptionChange("scrollback",()=>this.resize(this._bufferService.cols,this._bufferService.rows))),this.register(this._optionsService.onSpecificOptionChange("tabStopWidth",()=>this.setupTabStops()))}reset(){this._normal=new u.Buffer(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new u.Buffer(!1,this._optionsService,this._bufferService),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}),this.setupTabStops()}get alt(){return this._alt}get active(){return this._activeBuffer}get normal(){return this._normal}activateNormalBuffer(){this._activeBuffer!==this._normal&&(this._normal.x=this._alt.x,this._normal.y=this._alt.y,this._alt.clearAllMarkers(),this._alt.clear(),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}))}activateAltBuffer(y){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(y),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,v){this._normal.resize(y,v),this._alt.resize(y,v),this.setupTabStops(y)}setupTabStops(y){this._normal.setupTabStops(y),this._alt.setupTabStops(y)}}s.BufferSet=p},511:(l,s,o)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.CellData=void 0;const c=o(482),f=o(643),u=o(3734);class p extends u.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new u.ExtendedAttrs,this.combinedData=""}static fromCharData(y){const v=new p;return v.setFromCharData(y),v}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(y){this.fg=y[f.CHAR_DATA_ATTR_INDEX],this.bg=0;let v=!1;if(y[f.CHAR_DATA_CHAR_INDEX].length>2)v=!0;else if(y[f.CHAR_DATA_CHAR_INDEX].length===2){const h=y[f.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=h&&h<=56319){const m=y[f.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=m&&m<=57343?this.content=1024*(h-55296)+m-56320+65536|y[f.CHAR_DATA_WIDTH_INDEX]<<22:v=!0}else v=!0}else this.content=y[f.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|y[f.CHAR_DATA_WIDTH_INDEX]<<22;v&&(this.combinedData=y[f.CHAR_DATA_CHAR_INDEX],this.content=2097152|y[f.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}s.CellData=p},643:(l,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.WHITESPACE_CELL_CODE=s.WHITESPACE_CELL_WIDTH=s.WHITESPACE_CELL_CHAR=s.NULL_CELL_CODE=s.NULL_CELL_WIDTH=s.NULL_CELL_CHAR=s.CHAR_DATA_CODE_INDEX=s.CHAR_DATA_WIDTH_INDEX=s.CHAR_DATA_CHAR_INDEX=s.CHAR_DATA_ATTR_INDEX=s.DEFAULT_EXT=s.DEFAULT_ATTR=s.DEFAULT_COLOR=void 0,s.DEFAULT_COLOR=0,s.DEFAULT_ATTR=256|s.DEFAULT_COLOR<<9,s.DEFAULT_EXT=0,s.CHAR_DATA_ATTR_INDEX=0,s.CHAR_DATA_CHAR_INDEX=1,s.CHAR_DATA_WIDTH_INDEX=2,s.CHAR_DATA_CODE_INDEX=3,s.NULL_CELL_CHAR="",s.NULL_CELL_WIDTH=1,s.NULL_CELL_CODE=0,s.WHITESPACE_CELL_CHAR=" ",s.WHITESPACE_CELL_WIDTH=1,s.WHITESPACE_CELL_CODE=32},4863:(l,s,o)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.Marker=void 0;const c=o(8460),f=o(844);class u{get id(){return this._id}constructor(_){this.line=_,this.isDisposed=!1,this._disposables=[],this._id=u._nextId++,this._onDispose=this.register(new c.EventEmitter),this.onDispose=this._onDispose.event}dispose(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire(),(0,f.disposeArray)(this._disposables),this._disposables.length=0)}register(_){return this._disposables.push(_),_}}s.Marker=u,u._nextId=1},7116:(l,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.DEFAULT_CHARSET=s.CHARSETS=void 0,s.CHARSETS={},s.DEFAULT_CHARSET=s.CHARSETS.B,s.CHARSETS[0]={"`":"◆",a:"▒",b:"␉",c:"␌",d:"␍",e:"␊",f:"°",g:"±",h:"",i:"␋",j:"┘",k:"┐",l:"┌",m:"└",n:"┼",o:"⎺",p:"⎻",q:"─",r:"⎼",s:"⎽",t:"├",u:"┤",v:"┴",w:"┬",x:"│",y:"≤",z:"≥","{":"π","|":"≠","}":"£","~":"·"},s.CHARSETS.A={"#":"£"},s.CHARSETS.B=void 0,s.CHARSETS[4]={"#":"£","@":"¾","[":"ij","\\":"½","]":"|","{":"¨","|":"f","}":"¼","~":"´"},s.CHARSETS.C=s.CHARSETS[5]={"[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},s.CHARSETS.R={"#":"£","@":"à","[":"°","\\":"ç","]":"§","{":"é","|":"ù","}":"è","~":"¨"},s.CHARSETS.Q={"@":"à","[":"â","\\":"ç","]":"ê","^":"î","`":"ô","{":"é","|":"ù","}":"è","~":"û"},s.CHARSETS.K={"@":"§","[":"Ä","\\":"Ö","]":"Ü","{":"ä","|":"ö","}":"ü","~":"ß"},s.CHARSETS.Y={"#":"£","@":"§","[":"°","\\":"ç","]":"é","`":"ù","{":"à","|":"ò","}":"è","~":"ì"},s.CHARSETS.E=s.CHARSETS[6]={"@":"Ä","[":"Æ","\\":"Ø","]":"Å","^":"Ü","`":"ä","{":"æ","|":"ø","}":"å","~":"ü"},s.CHARSETS.Z={"#":"£","@":"§","[":"¡","\\":"Ñ","]":"¿","{":"°","|":"ñ","}":"ç"},s.CHARSETS.H=s.CHARSETS[7]={"@":"É","[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},s.CHARSETS["="]={"#":"ù","@":"à","[":"é","\\":"ç","]":"ê","^":"î",_:"è","`":"ô","{":"ä","|":"ö","}":"ü","~":"û"}},2584:(l,s)=>{var o,c,f;Object.defineProperty(s,"__esModule",{value:!0}),s.C1_ESCAPED=s.C1=s.C0=void 0,function(u){u.NUL="\0",u.SOH="",u.STX="",u.ETX="",u.EOT="",u.ENQ="",u.ACK="",u.BEL="\x07",u.BS="\b",u.HT=" ",u.LF=`
|
|
58
|
+
`)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(S){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._refresh())),m.isLinux&&S&&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(S){const k=this._getMouseBufferCoords(S),L=this._model.finalSelectionStart,A=this._model.finalSelectionEnd;return!!(L&&A&&k)&&this._areCoordsInSelection(k,L,A)}isCellInSelection(S,k){const L=this._model.finalSelectionStart,A=this._model.finalSelectionEnd;return!(!L||!A)&&this._areCoordsInSelection([S,k],L,A)}_areCoordsInSelection(S,k,L){return S[1]>k[1]&&S[1]<L[1]||k[1]===L[1]&&S[1]===k[1]&&S[0]>=k[0]&&S[0]<L[0]||k[1]<L[1]&&S[1]===L[1]&&S[0]<L[0]||k[1]<L[1]&&S[1]===k[1]&&S[0]>=k[0]}_selectWordAtCursor(S,k){var M,D;const L=(D=(M=this._linkifier.currentLink)==null?void 0:M.link)==null?void 0:D.range;if(L)return this._model.selectionStart=[L.start.x-1,L.start.y-1],this._model.selectionStartLength=(0,d.getRangeLength)(L,this._bufferService.cols),this._model.selectionEnd=void 0,!0;const A=this._getMouseBufferCoords(S);return!!A&&(this._selectWordAt(A,k),this._model.selectionEnd=void 0,!0)}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(S,k){this._model.clearSelection(),S=Math.max(S,0),k=Math.min(k,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,S],this._model.selectionEnd=[this._bufferService.cols,k],this.refresh(),this._onSelectionChange.fire()}_handleTrim(S){this._model.handleTrim(S)&&this.refresh()}_getMouseBufferCoords(S){const k=this._mouseService.getCoords(S,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(k)return k[0]--,k[1]--,k[1]+=this._bufferService.buffer.ydisp,k}_getMouseEventScrollAmount(S){let k=(0,u.getCoordsRelativeToElement)(this._coreBrowserService.window,S,this._screenElement)[1];const L=this._renderService.dimensions.css.canvas.height;return k>=0&&k<=L?0:(k>L&&(k-=L),k=Math.min(Math.max(k,-50),50),k/=50,k/Math.abs(k)+Math.round(14*k))}shouldForceSelection(S){return m.isMac?S.altKey&&this._optionsService.rawOptions.macOptionClickForcesSelection:S.shiftKey}handleMouseDown(S){if(this._mouseDownTimeStamp=S.timeStamp,(S.button!==2||!this.hasSelection)&&S.button===0){if(!this._enabled){if(!this.shouldForceSelection(S))return;S.stopPropagation()}S.preventDefault(),this._dragScrollAmount=0,this._enabled&&S.shiftKey?this._handleIncrementalClick(S):S.detail===1?this._handleSingleClick(S):S.detail===2?this._handleDoubleClick(S):S.detail===3&&this._handleTripleClick(S),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(S){this._model.selectionStart&&(this._model.selectionEnd=this._getMouseBufferCoords(S))}_handleSingleClick(S){if(this._model.selectionStartLength=0,this._model.isSelectAllActive=!1,this._activeSelectionMode=this.shouldColumnSelect(S)?3:0,this._model.selectionStart=this._getMouseBufferCoords(S),!this._model.selectionStart)return;this._model.selectionEnd=void 0;const k=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);k&&k.length!==this._model.selectionStart[0]&&k.hasWidth(this._model.selectionStart[0])===0&&this._model.selectionStart[0]++}_handleDoubleClick(S){this._selectWordAtCursor(S,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(S){const k=this._getMouseBufferCoords(S);k&&(this._activeSelectionMode=2,this._selectLineAt(k[1]))}shouldColumnSelect(S){return S.altKey&&!(m.isMac&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(S){if(S.stopImmediatePropagation(),!this._model.selectionStart)return;const k=this._model.selectionEnd?[this._model.selectionEnd[0],this._model.selectionEnd[1]]:null;if(this._model.selectionEnd=this._getMouseBufferCoords(S),!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(S),this._activeSelectionMode!==3&&(this._dragScrollAmount>0?this._model.selectionEnd[0]=this._bufferService.cols:this._dragScrollAmount<0&&(this._model.selectionEnd[0]=0));const L=this._bufferService.buffer;if(this._model.selectionEnd[1]<L.lines.length){const A=L.lines.get(this._model.selectionEnd[1]);A&&A.hasWidth(this._model.selectionEnd[0])===0&&this._model.selectionEnd[0]<this._bufferService.cols&&this._model.selectionEnd[0]++}k&&k[0]===this._model.selectionEnd[0]&&k[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 S=this._bufferService.buffer;this._dragScrollAmount>0?(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=this._bufferService.cols),this._model.selectionEnd[1]=Math.min(S.ydisp+this._bufferService.rows,S.lines.length-1)):(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=0),this._model.selectionEnd[1]=S.ydisp),this.refresh()}}_handleMouseUp(S){const k=S.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&k<500&&S.altKey&&this._optionsService.rawOptions.altClickMovesCursor){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){const L=this._mouseService.getCoords(S,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(L&&L[0]!==void 0&&L[1]!==void 0){const A=(0,p.moveToCellSequence)(L[0]-1,L[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(A,!0)}}}else this._fireEventIfSelectionChanged()}_fireEventIfSelectionChanged(){const S=this._model.finalSelectionStart,k=this._model.finalSelectionEnd,L=!(!S||!k||S[0]===k[0]&&S[1]===k[1]);L?S&&k&&(this._oldSelectionStart&&this._oldSelectionEnd&&S[0]===this._oldSelectionStart[0]&&S[1]===this._oldSelectionStart[1]&&k[0]===this._oldSelectionEnd[0]&&k[1]===this._oldSelectionEnd[1]||this._fireOnSelectionChange(S,k,L)):this._oldHasSelection&&this._fireOnSelectionChange(S,k,L)}_fireOnSelectionChange(S,k,L){this._oldSelectionStart=S,this._oldSelectionEnd=k,this._oldHasSelection=L,this._onSelectionChange.fire()}_handleBufferActivate(S){this.clearSelection(),this._trimListener.dispose(),this._trimListener=S.activeBuffer.lines.onTrim(k=>this._handleTrim(k))}_convertViewportColToCharacterIndex(S,k){let L=k;for(let A=0;k>=A;A++){const M=S.loadCell(A,this._workCell).getChars().length;this._workCell.getWidth()===0?L--:M>1&&k!==A&&(L+=M-1)}return L}setSelection(S,k,L){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[S,k],this._model.selectionStartLength=L,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(S){this._isClickInSelection(S)||(this._selectWordAtCursor(S,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(S,k,L=!0,A=!0){if(S[0]>=this._bufferService.cols)return;const M=this._bufferService.buffer,D=M.lines.get(S[1]);if(!D)return;const O=M.translateBufferLineToString(S[1],!1);let z=this._convertViewportColToCharacterIndex(D,S[0]),F=z;const H=S[0]-z;let I=0,R=0,P=0,N=0;if(O.charAt(z)===" "){for(;z>0&&O.charAt(z-1)===" ";)z--;for(;F<O.length&&O.charAt(F+1)===" ";)F++}else{let V=S[0],Z=S[0];D.getWidth(V)===0&&(I++,V--),D.getWidth(Z)===2&&(R++,Z++);const Q=D.getString(Z).length;for(Q>1&&(N+=Q-1,F+=Q-1);V>0&&z>0&&!this._isCharWordSeparator(D.loadCell(V-1,this._workCell));){D.loadCell(V-1,this._workCell);const $=this._workCell.getChars().length;this._workCell.getWidth()===0?(I++,V--):$>1&&(P+=$-1,z-=$-1),z--,V--}for(;Z<D.length&&F+1<O.length&&!this._isCharWordSeparator(D.loadCell(Z+1,this._workCell));){D.loadCell(Z+1,this._workCell);const $=this._workCell.getChars().length;this._workCell.getWidth()===2?(R++,Z++):$>1&&(N+=$-1,F+=$-1),F++,Z++}}F++;let j=z+H-I+P,W=Math.min(this._bufferService.cols,F-z+I+R-P-N);if(k||O.slice(z,F).trim()!==""){if(L&&j===0&&D.getCodePoint(0)!==32){const V=M.lines.get(S[1]-1);if(V&&D.isWrapped&&V.getCodePoint(this._bufferService.cols-1)!==32){const Z=this._getWordAt([this._bufferService.cols-1,S[1]-1],!1,!0,!1);if(Z){const Q=this._bufferService.cols-Z.start;j-=Q,W+=Q}}}if(A&&j+W===this._bufferService.cols&&D.getCodePoint(this._bufferService.cols-1)!==32){const V=M.lines.get(S[1]+1);if(V!=null&&V.isWrapped&&V.getCodePoint(0)!==32){const Z=this._getWordAt([0,S[1]+1],!1,!1,!0);Z&&(W+=Z.length)}}return{start:j,length:W}}}_selectWordAt(S,k){const L=this._getWordAt(S,k);if(L){for(;L.start<0;)L.start+=this._bufferService.cols,S[1]--;this._model.selectionStart=[L.start,S[1]],this._model.selectionStartLength=L.length}}_selectToWordAt(S){const k=this._getWordAt(S,!0);if(k){let L=S[1];for(;k.start<0;)k.start+=this._bufferService.cols,L--;if(!this._model.areSelectionValuesReversed())for(;k.start+k.length>this._bufferService.cols;)k.length-=this._bufferService.cols,L++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?k.start:k.start+k.length,L]}}_isCharWordSeparator(S){return S.getWidth()!==0&&this._optionsService.rawOptions.wordSeparator.indexOf(S.getChars())>=0}_selectLineAt(S){const k=this._bufferService.buffer.getWrappedRangeForLine(S),L={start:{x:0,y:k.first},end:{x:this._bufferService.cols-1,y:k.last}};this._model.selectionStart=[0,k.first],this._model.selectionEnd=void 0,this._model.selectionStartLength=(0,d.getRangeLength)(L,this._bufferService.cols)}};s.SelectionService=C=c([f(3,w.IBufferService),f(4,w.ICoreService),f(5,y.IMouseService),f(6,w.IOptionsService),f(7,y.IRenderService),f(8,y.ICoreBrowserService)],C)},4725:(l,s,o)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.ILinkProviderService=s.IThemeService=s.ICharacterJoinerService=s.ISelectionService=s.IRenderService=s.IMouseService=s.ICoreBrowserService=s.ICharSizeService=void 0;const c=o(8343);s.ICharSizeService=(0,c.createDecorator)("CharSizeService"),s.ICoreBrowserService=(0,c.createDecorator)("CoreBrowserService"),s.IMouseService=(0,c.createDecorator)("MouseService"),s.IRenderService=(0,c.createDecorator)("RenderService"),s.ISelectionService=(0,c.createDecorator)("SelectionService"),s.ICharacterJoinerService=(0,c.createDecorator)("CharacterJoinerService"),s.IThemeService=(0,c.createDecorator)("ThemeService"),s.ILinkProviderService=(0,c.createDecorator)("LinkProviderService")},6731:function(l,s,o){var c=this&&this.__decorate||function(C,S,k,L){var A,M=arguments.length,D=M<3?S:L===null?L=Object.getOwnPropertyDescriptor(S,k):L;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")D=Reflect.decorate(C,S,k,L);else for(var O=C.length-1;O>=0;O--)(A=C[O])&&(D=(M<3?A(D):M>3?A(S,k,D):A(S,k))||D);return M>3&&D&&Object.defineProperty(S,k,D),D},f=this&&this.__param||function(C,S){return function(k,L){S(k,L,C)}};Object.defineProperty(s,"__esModule",{value:!0}),s.ThemeService=s.DEFAULT_ANSI_COLORS=void 0;const u=o(7239),p=o(8055),_=o(8460),y=o(844),v=o(2585),h=p.css.toColor("#ffffff"),m=p.css.toColor("#000000"),d=p.css.toColor("#ffffff"),g=p.css.toColor("#000000"),w={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117};s.DEFAULT_ANSI_COLORS=Object.freeze((()=>{const C=[p.css.toColor("#2e3436"),p.css.toColor("#cc0000"),p.css.toColor("#4e9a06"),p.css.toColor("#c4a000"),p.css.toColor("#3465a4"),p.css.toColor("#75507b"),p.css.toColor("#06989a"),p.css.toColor("#d3d7cf"),p.css.toColor("#555753"),p.css.toColor("#ef2929"),p.css.toColor("#8ae234"),p.css.toColor("#fce94f"),p.css.toColor("#729fcf"),p.css.toColor("#ad7fa8"),p.css.toColor("#34e2e2"),p.css.toColor("#eeeeec")],S=[0,95,135,175,215,255];for(let k=0;k<216;k++){const L=S[k/36%6|0],A=S[k/6%6|0],M=S[k%6];C.push({css:p.channels.toCss(L,A,M),rgba:p.channels.toRgba(L,A,M)})}for(let k=0;k<24;k++){const L=8+10*k;C.push({css:p.channels.toCss(L,L,L),rgba:p.channels.toRgba(L,L,L)})}return C})());let b=s.ThemeService=class extends y.Disposable{get colors(){return this._colors}constructor(C){super(),this._optionsService=C,this._contrastCache=new u.ColorContrastCache,this._halfContrastCache=new u.ColorContrastCache,this._onChangeColors=this.register(new _.EventEmitter),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:h,background:m,cursor:d,cursorAccent:g,selectionForeground:void 0,selectionBackgroundTransparent:w,selectionBackgroundOpaque:p.color.blend(m,w),selectionInactiveBackgroundTransparent:w,selectionInactiveBackgroundOpaque:p.color.blend(m,w),ansi:s.DEFAULT_ANSI_COLORS.slice(),contrastCache:this._contrastCache,halfContrastCache:this._halfContrastCache},this._updateRestoreColors(),this._setTheme(this._optionsService.rawOptions.theme),this.register(this._optionsService.onSpecificOptionChange("minimumContrastRatio",()=>this._contrastCache.clear())),this.register(this._optionsService.onSpecificOptionChange("theme",()=>this._setTheme(this._optionsService.rawOptions.theme)))}_setTheme(C={}){const S=this._colors;if(S.foreground=x(C.foreground,h),S.background=x(C.background,m),S.cursor=x(C.cursor,d),S.cursorAccent=x(C.cursorAccent,g),S.selectionBackgroundTransparent=x(C.selectionBackground,w),S.selectionBackgroundOpaque=p.color.blend(S.background,S.selectionBackgroundTransparent),S.selectionInactiveBackgroundTransparent=x(C.selectionInactiveBackground,S.selectionBackgroundTransparent),S.selectionInactiveBackgroundOpaque=p.color.blend(S.background,S.selectionInactiveBackgroundTransparent),S.selectionForeground=C.selectionForeground?x(C.selectionForeground,p.NULL_COLOR):void 0,S.selectionForeground===p.NULL_COLOR&&(S.selectionForeground=void 0),p.color.isOpaque(S.selectionBackgroundTransparent)&&(S.selectionBackgroundTransparent=p.color.opacity(S.selectionBackgroundTransparent,.3)),p.color.isOpaque(S.selectionInactiveBackgroundTransparent)&&(S.selectionInactiveBackgroundTransparent=p.color.opacity(S.selectionInactiveBackgroundTransparent,.3)),S.ansi=s.DEFAULT_ANSI_COLORS.slice(),S.ansi[0]=x(C.black,s.DEFAULT_ANSI_COLORS[0]),S.ansi[1]=x(C.red,s.DEFAULT_ANSI_COLORS[1]),S.ansi[2]=x(C.green,s.DEFAULT_ANSI_COLORS[2]),S.ansi[3]=x(C.yellow,s.DEFAULT_ANSI_COLORS[3]),S.ansi[4]=x(C.blue,s.DEFAULT_ANSI_COLORS[4]),S.ansi[5]=x(C.magenta,s.DEFAULT_ANSI_COLORS[5]),S.ansi[6]=x(C.cyan,s.DEFAULT_ANSI_COLORS[6]),S.ansi[7]=x(C.white,s.DEFAULT_ANSI_COLORS[7]),S.ansi[8]=x(C.brightBlack,s.DEFAULT_ANSI_COLORS[8]),S.ansi[9]=x(C.brightRed,s.DEFAULT_ANSI_COLORS[9]),S.ansi[10]=x(C.brightGreen,s.DEFAULT_ANSI_COLORS[10]),S.ansi[11]=x(C.brightYellow,s.DEFAULT_ANSI_COLORS[11]),S.ansi[12]=x(C.brightBlue,s.DEFAULT_ANSI_COLORS[12]),S.ansi[13]=x(C.brightMagenta,s.DEFAULT_ANSI_COLORS[13]),S.ansi[14]=x(C.brightCyan,s.DEFAULT_ANSI_COLORS[14]),S.ansi[15]=x(C.brightWhite,s.DEFAULT_ANSI_COLORS[15]),C.extendedAnsi){const k=Math.min(S.ansi.length-16,C.extendedAnsi.length);for(let L=0;L<k;L++)S.ansi[L+16]=x(C.extendedAnsi[L],s.DEFAULT_ANSI_COLORS[L+16])}this._contrastCache.clear(),this._halfContrastCache.clear(),this._updateRestoreColors(),this._onChangeColors.fire(this.colors)}restoreColor(C){this._restoreColor(C),this._onChangeColors.fire(this.colors)}_restoreColor(C){if(C!==void 0)switch(C){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[C]=this._restoreColors.ansi[C]}else for(let S=0;S<this._restoreColors.ansi.length;++S)this._colors.ansi[S]=this._restoreColors.ansi[S]}modifyColors(C){C(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 x(C,S){if(C!==void 0)try{return p.css.toColor(C)}catch{}return S}s.ThemeService=b=c([f(0,v.IOptionsService)],b)},6349:(l,s,o)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.CircularList=void 0;const c=o(8460),f=o(844);class u extends f.Disposable{constructor(_){super(),this._maxLength=_,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(_){if(this._maxLength===_)return;const y=new Array(_);for(let v=0;v<Math.min(_,this.length);v++)y[v]=this._array[this._getCyclicIndex(v)];this._array=y,this._maxLength=_,this._startIndex=0}get length(){return this._length}set length(_){if(_>this._length)for(let y=this._length;y<_;y++)this._array[y]=void 0;this._length=_}get(_){return this._array[this._getCyclicIndex(_)]}set(_,y){this._array[this._getCyclicIndex(_)]=y}push(_){this._array[this._getCyclicIndex(this._length)]=_,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(_,y,...v){if(y){for(let h=_;h<this._length-y;h++)this._array[this._getCyclicIndex(h)]=this._array[this._getCyclicIndex(h+y)];this._length-=y,this.onDeleteEmitter.fire({index:_,amount:y})}for(let h=this._length-1;h>=_;h--)this._array[this._getCyclicIndex(h+v.length)]=this._array[this._getCyclicIndex(h)];for(let h=0;h<v.length;h++)this._array[this._getCyclicIndex(_+h)]=v[h];if(v.length&&this.onInsertEmitter.fire({index:_,amount:v.length}),this._length+v.length>this._maxLength){const h=this._length+v.length-this._maxLength;this._startIndex+=h,this._length=this._maxLength,this.onTrimEmitter.fire(h)}else this._length+=v.length}trimStart(_){_>this._length&&(_=this._length),this._startIndex+=_,this._length-=_,this.onTrimEmitter.fire(_)}shiftElements(_,y,v){if(!(y<=0)){if(_<0||_>=this._length)throw new Error("start argument out of range");if(_+v<0)throw new Error("Cannot shift elements in list beyond index 0");if(v>0){for(let m=y-1;m>=0;m--)this.set(_+m+v,this.get(_+m));const h=_+y+v-this._length;if(h>0)for(this._length+=h;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(let h=0;h<y;h++)this.set(_+h+v,this.get(_+h))}}_getCyclicIndex(_){return(this._startIndex+_)%this._maxLength}}s.CircularList=u},1439:(l,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.clone=void 0,s.clone=function o(c,f=5){if(typeof c!="object")return c;const u=Array.isArray(c)?[]:{};for(const p in c)u[p]=f<=1?c[p]:c[p]&&o(c[p],f-1);return u}},8055:(l,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.contrastRatio=s.toPaddedHex=s.rgba=s.rgb=s.css=s.color=s.channels=s.NULL_COLOR=void 0;let o=0,c=0,f=0,u=0;var p,_,y,v,h;function m(g){const w=g.toString(16);return w.length<2?"0"+w:w}function d(g,w){return g<w?(w+.05)/(g+.05):(g+.05)/(w+.05)}s.NULL_COLOR={css:"#00000000",rgba:0},function(g){g.toCss=function(w,b,x,C){return C!==void 0?`#${m(w)}${m(b)}${m(x)}${m(C)}`:`#${m(w)}${m(b)}${m(x)}`},g.toRgba=function(w,b,x,C=255){return(w<<24|b<<16|x<<8|C)>>>0},g.toColor=function(w,b,x,C){return{css:g.toCss(w,b,x,C),rgba:g.toRgba(w,b,x,C)}}}(p||(s.channels=p={})),function(g){function w(b,x){return u=Math.round(255*x),[o,c,f]=h.toChannels(b.rgba),{css:p.toCss(o,c,f,u),rgba:p.toRgba(o,c,f,u)}}g.blend=function(b,x){if(u=(255&x.rgba)/255,u===1)return{css:x.css,rgba:x.rgba};const C=x.rgba>>24&255,S=x.rgba>>16&255,k=x.rgba>>8&255,L=b.rgba>>24&255,A=b.rgba>>16&255,M=b.rgba>>8&255;return o=L+Math.round((C-L)*u),c=A+Math.round((S-A)*u),f=M+Math.round((k-M)*u),{css:p.toCss(o,c,f),rgba:p.toRgba(o,c,f)}},g.isOpaque=function(b){return(255&b.rgba)==255},g.ensureContrastRatio=function(b,x,C){const S=h.ensureContrastRatio(b.rgba,x.rgba,C);if(S)return p.toColor(S>>24&255,S>>16&255,S>>8&255)},g.opaque=function(b){const x=(255|b.rgba)>>>0;return[o,c,f]=h.toChannels(x),{css:p.toCss(o,c,f),rgba:x}},g.opacity=w,g.multiplyOpacity=function(b,x){return u=255&b.rgba,w(b,u*x/255)},g.toColorRGB=function(b){return[b.rgba>>24&255,b.rgba>>16&255,b.rgba>>8&255]}}(_||(s.color=_={})),function(g){let w,b;try{const x=document.createElement("canvas");x.width=1,x.height=1;const C=x.getContext("2d",{willReadFrequently:!0});C&&(w=C,w.globalCompositeOperation="copy",b=w.createLinearGradient(0,0,1,1))}catch{}g.toColor=function(x){if(x.match(/#[\da-f]{3,8}/i))switch(x.length){case 4:return o=parseInt(x.slice(1,2).repeat(2),16),c=parseInt(x.slice(2,3).repeat(2),16),f=parseInt(x.slice(3,4).repeat(2),16),p.toColor(o,c,f);case 5:return o=parseInt(x.slice(1,2).repeat(2),16),c=parseInt(x.slice(2,3).repeat(2),16),f=parseInt(x.slice(3,4).repeat(2),16),u=parseInt(x.slice(4,5).repeat(2),16),p.toColor(o,c,f,u);case 7:return{css:x,rgba:(parseInt(x.slice(1),16)<<8|255)>>>0};case 9:return{css:x,rgba:parseInt(x.slice(1),16)>>>0}}const C=x.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(C)return o=parseInt(C[1]),c=parseInt(C[2]),f=parseInt(C[3]),u=Math.round(255*(C[5]===void 0?1:parseFloat(C[5]))),p.toColor(o,c,f,u);if(!w||!b)throw new Error("css.toColor: Unsupported css format");if(w.fillStyle=b,w.fillStyle=x,typeof w.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(w.fillRect(0,0,1,1),[o,c,f,u]=w.getImageData(0,0,1,1).data,u!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:p.toRgba(o,c,f,u),css:x}}}(y||(s.css=y={})),function(g){function w(b,x,C){const S=b/255,k=x/255,L=C/255;return .2126*(S<=.03928?S/12.92:Math.pow((S+.055)/1.055,2.4))+.7152*(k<=.03928?k/12.92:Math.pow((k+.055)/1.055,2.4))+.0722*(L<=.03928?L/12.92:Math.pow((L+.055)/1.055,2.4))}g.relativeLuminance=function(b){return w(b>>16&255,b>>8&255,255&b)},g.relativeLuminance2=w}(v||(s.rgb=v={})),function(g){function w(x,C,S){const k=x>>24&255,L=x>>16&255,A=x>>8&255;let M=C>>24&255,D=C>>16&255,O=C>>8&255,z=d(v.relativeLuminance2(M,D,O),v.relativeLuminance2(k,L,A));for(;z<S&&(M>0||D>0||O>0);)M-=Math.max(0,Math.ceil(.1*M)),D-=Math.max(0,Math.ceil(.1*D)),O-=Math.max(0,Math.ceil(.1*O)),z=d(v.relativeLuminance2(M,D,O),v.relativeLuminance2(k,L,A));return(M<<24|D<<16|O<<8|255)>>>0}function b(x,C,S){const k=x>>24&255,L=x>>16&255,A=x>>8&255;let M=C>>24&255,D=C>>16&255,O=C>>8&255,z=d(v.relativeLuminance2(M,D,O),v.relativeLuminance2(k,L,A));for(;z<S&&(M<255||D<255||O<255);)M=Math.min(255,M+Math.ceil(.1*(255-M))),D=Math.min(255,D+Math.ceil(.1*(255-D))),O=Math.min(255,O+Math.ceil(.1*(255-O))),z=d(v.relativeLuminance2(M,D,O),v.relativeLuminance2(k,L,A));return(M<<24|D<<16|O<<8|255)>>>0}g.blend=function(x,C){if(u=(255&C)/255,u===1)return C;const S=C>>24&255,k=C>>16&255,L=C>>8&255,A=x>>24&255,M=x>>16&255,D=x>>8&255;return o=A+Math.round((S-A)*u),c=M+Math.round((k-M)*u),f=D+Math.round((L-D)*u),p.toRgba(o,c,f)},g.ensureContrastRatio=function(x,C,S){const k=v.relativeLuminance(x>>8),L=v.relativeLuminance(C>>8);if(d(k,L)<S){if(L<k){const D=w(x,C,S),O=d(k,v.relativeLuminance(D>>8));if(O<S){const z=b(x,C,S);return O>d(k,v.relativeLuminance(z>>8))?D:z}return D}const A=b(x,C,S),M=d(k,v.relativeLuminance(A>>8));if(M<S){const D=w(x,C,S);return M>d(k,v.relativeLuminance(D>>8))?A:D}return A}},g.reduceLuminance=w,g.increaseLuminance=b,g.toChannels=function(x){return[x>>24&255,x>>16&255,x>>8&255,255&x]}}(h||(s.rgba=h={})),s.toPaddedHex=m,s.contrastRatio=d},8969:(l,s,o)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.CoreTerminal=void 0;const c=o(844),f=o(2585),u=o(4348),p=o(7866),_=o(744),y=o(7302),v=o(6975),h=o(8460),m=o(1753),d=o(1480),g=o(7994),w=o(9282),b=o(5435),x=o(5981),C=o(2660);let S=!1;class k extends c.Disposable{get onScroll(){return this._onScrollApi||(this._onScrollApi=this.register(new h.EventEmitter),this._onScroll.event(A=>{var M;(M=this._onScrollApi)==null||M.fire(A.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(A){for(const M in A)this.optionsService.options[M]=A[M]}constructor(A){super(),this._windowsWrappingHeuristics=this.register(new c.MutableDisposable),this._onBinary=this.register(new h.EventEmitter),this.onBinary=this._onBinary.event,this._onData=this.register(new h.EventEmitter),this.onData=this._onData.event,this._onLineFeed=this.register(new h.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onResize=this.register(new h.EventEmitter),this.onResize=this._onResize.event,this._onWriteParsed=this.register(new h.EventEmitter),this.onWriteParsed=this._onWriteParsed.event,this._onScroll=this.register(new h.EventEmitter),this._instantiationService=new u.InstantiationService,this.optionsService=this.register(new y.OptionsService(A)),this._instantiationService.setService(f.IOptionsService,this.optionsService),this._bufferService=this.register(this._instantiationService.createInstance(_.BufferService)),this._instantiationService.setService(f.IBufferService,this._bufferService),this._logService=this.register(this._instantiationService.createInstance(p.LogService)),this._instantiationService.setService(f.ILogService,this._logService),this.coreService=this.register(this._instantiationService.createInstance(v.CoreService)),this._instantiationService.setService(f.ICoreService,this.coreService),this.coreMouseService=this.register(this._instantiationService.createInstance(m.CoreMouseService)),this._instantiationService.setService(f.ICoreMouseService,this.coreMouseService),this.unicodeService=this.register(this._instantiationService.createInstance(d.UnicodeService)),this._instantiationService.setService(f.IUnicodeService,this.unicodeService),this._charsetService=this._instantiationService.createInstance(g.CharsetService),this._instantiationService.setService(f.ICharsetService,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(C.OscLinkService),this._instantiationService.setService(f.IOscLinkService,this._oscLinkService),this._inputHandler=this.register(new b.InputHandler(this._bufferService,this._charsetService,this.coreService,this._logService,this.optionsService,this._oscLinkService,this.coreMouseService,this.unicodeService)),this.register((0,h.forwardEvent)(this._inputHandler.onLineFeed,this._onLineFeed)),this.register(this._inputHandler),this.register((0,h.forwardEvent)(this._bufferService.onResize,this._onResize)),this.register((0,h.forwardEvent)(this.coreService.onData,this._onData)),this.register((0,h.forwardEvent)(this.coreService.onBinary,this._onBinary)),this.register(this.coreService.onRequestScrollToBottom(()=>this.scrollToBottom())),this.register(this.coreService.onUserInput(()=>this._writeBuffer.handleUserInput())),this.register(this.optionsService.onMultipleOptionChange(["windowsMode","windowsPty"],()=>this._handleWindowsPtyOptionChange())),this.register(this._bufferService.onScroll(M=>{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(M=>{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 x.WriteBuffer((M,D)=>this._inputHandler.parse(M,D))),this.register((0,h.forwardEvent)(this._writeBuffer.onWriteParsed,this._onWriteParsed))}write(A,M){this._writeBuffer.write(A,M)}writeSync(A,M){this._logService.logLevel<=f.LogLevelEnum.WARN&&!S&&(this._logService.warn("writeSync is unreliable and will be removed soon."),S=!0),this._writeBuffer.writeSync(A,M)}input(A,M=!0){this.coreService.triggerDataEvent(A,M)}resize(A,M){isNaN(A)||isNaN(M)||(A=Math.max(A,_.MINIMUM_COLS),M=Math.max(M,_.MINIMUM_ROWS),this._bufferService.resize(A,M))}scroll(A,M=!1){this._bufferService.scroll(A,M)}scrollLines(A,M,D){this._bufferService.scrollLines(A,M,D)}scrollPages(A){this.scrollLines(A*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(){this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(A){const M=A-this._bufferService.buffer.ydisp;M!==0&&this.scrollLines(M)}registerEscHandler(A,M){return this._inputHandler.registerEscHandler(A,M)}registerDcsHandler(A,M){return this._inputHandler.registerDcsHandler(A,M)}registerCsiHandler(A,M){return this._inputHandler.registerCsiHandler(A,M)}registerOscHandler(A,M){return this._inputHandler.registerOscHandler(A,M)}_setup(){this._handleWindowsPtyOptionChange()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_handleWindowsPtyOptionChange(){let A=!1;const M=this.optionsService.rawOptions.windowsPty;M&&M.buildNumber!==void 0&&M.buildNumber!==void 0?A=M.backend==="conpty"&&M.buildNumber<21376:this.optionsService.rawOptions.windowsMode&&(A=!0),A?this._enableWindowsWrappingHeuristics():this._windowsWrappingHeuristics.clear()}_enableWindowsWrappingHeuristics(){if(!this._windowsWrappingHeuristics.value){const A=[];A.push(this.onLineFeed(w.updateWindowsModeWrappedState.bind(null,this._bufferService))),A.push(this.registerCsiHandler({final:"H"},()=>((0,w.updateWindowsModeWrappedState)(this._bufferService),!1))),this._windowsWrappingHeuristics.value=(0,c.toDisposable)(()=>{for(const M of A)M.dispose()})}}}s.CoreTerminal=k},8460:(l,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.runAndSubscribe=s.forwardEvent=s.EventEmitter=void 0,s.EventEmitter=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||(this._event=o=>(this._listeners.push(o),{dispose:()=>{if(!this._disposed){for(let c=0;c<this._listeners.length;c++)if(this._listeners[c]===o)return void this._listeners.splice(c,1)}}})),this._event}fire(o,c){const f=[];for(let u=0;u<this._listeners.length;u++)f.push(this._listeners[u]);for(let u=0;u<f.length;u++)f[u].call(void 0,o,c)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},s.forwardEvent=function(o,c){return o(f=>c.fire(f))},s.runAndSubscribe=function(o,c){return c(void 0),o(f=>c(f))}},5435:function(l,s,o){var c=this&&this.__decorate||function(I,R,P,N){var j,W=arguments.length,V=W<3?R:N===null?N=Object.getOwnPropertyDescriptor(R,P):N;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")V=Reflect.decorate(I,R,P,N);else for(var Z=I.length-1;Z>=0;Z--)(j=I[Z])&&(V=(W<3?j(V):W>3?j(R,P,V):j(R,P))||V);return W>3&&V&&Object.defineProperty(R,P,V),V},f=this&&this.__param||function(I,R){return function(P,N){R(P,N,I)}};Object.defineProperty(s,"__esModule",{value:!0}),s.InputHandler=s.WindowsOptionsReportType=void 0;const u=o(2584),p=o(7116),_=o(2015),y=o(844),v=o(482),h=o(8437),m=o(8460),d=o(643),g=o(511),w=o(3734),b=o(2585),x=o(1480),C=o(6242),S=o(6351),k=o(5941),L={"(":0,")":1,"*":2,"+":3,"-":1,".":2},A=131072;function M(I,R){if(I>24)return R.setWinLines||!1;switch(I){case 1:return!!R.restoreWin;case 2:return!!R.minimizeWin;case 3:return!!R.setWinPosition;case 4:return!!R.setWinSizePixels;case 5:return!!R.raiseWin;case 6:return!!R.lowerWin;case 7:return!!R.refreshWin;case 8:return!!R.setWinSizeChars;case 9:return!!R.maximizeWin;case 10:return!!R.fullscreenWin;case 11:return!!R.getWinState;case 13:return!!R.getWinPosition;case 14:return!!R.getWinSizePixels;case 15:return!!R.getScreenSizePixels;case 16:return!!R.getCellSizePixels;case 18:return!!R.getWinSizeChars;case 19:return!!R.getScreenSizeChars;case 20:return!!R.getIconTitle;case 21:return!!R.getWinTitle;case 22:return!!R.pushTitle;case 23:return!!R.popTitle;case 24:return!!R.setWinLines}return!1}var D;(function(I){I[I.GET_WIN_SIZE_PIXELS=0]="GET_WIN_SIZE_PIXELS",I[I.GET_CELL_SIZE_PIXELS=1]="GET_CELL_SIZE_PIXELS"})(D||(s.WindowsOptionsReportType=D={}));let O=0;class z extends y.Disposable{getAttrData(){return this._curAttrData}constructor(R,P,N,j,W,V,Z,Q,$=new _.EscapeSequenceParser){super(),this._bufferService=R,this._charsetService=P,this._coreService=N,this._logService=j,this._optionsService=W,this._oscLinkService=V,this._coreMouseService=Z,this._unicodeService=Q,this._parser=$,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new v.StringToUtf32,this._utf8Decoder=new v.Utf8ToUtf32,this._workCell=new g.CellData,this._windowTitle="",this._iconName="",this._windowTitleStack=[],this._iconNameStack=[],this._curAttrData=h.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=h.DEFAULT_ATTR_DATA.clone(),this._onRequestBell=this.register(new 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 F(this._bufferService),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate(B=>this._activeBuffer=B.activeBuffer)),this._parser.setCsiHandlerFallback((B,K)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString(B),params:K.toArray()})}),this._parser.setEscHandlerFallback(B=>{this._logService.debug("Unknown ESC code: ",{identifier:this._parser.identToString(B)})}),this._parser.setExecuteHandlerFallback(B=>{this._logService.debug("Unknown EXECUTE code: ",{code:B})}),this._parser.setOscHandlerFallback((B,K,U)=>{this._logService.debug("Unknown OSC code: ",{identifier:B,action:K,data:U})}),this._parser.setDcsHandlerFallback((B,K,U)=>{K==="HOOK"&&(U=U.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(B),action:K,payload:U})}),this._parser.setPrintHandler((B,K,U)=>this.print(B,K,U)),this._parser.registerCsiHandler({final:"@"},B=>this.insertChars(B)),this._parser.registerCsiHandler({intermediates:" ",final:"@"},B=>this.scrollLeft(B)),this._parser.registerCsiHandler({final:"A"},B=>this.cursorUp(B)),this._parser.registerCsiHandler({intermediates:" ",final:"A"},B=>this.scrollRight(B)),this._parser.registerCsiHandler({final:"B"},B=>this.cursorDown(B)),this._parser.registerCsiHandler({final:"C"},B=>this.cursorForward(B)),this._parser.registerCsiHandler({final:"D"},B=>this.cursorBackward(B)),this._parser.registerCsiHandler({final:"E"},B=>this.cursorNextLine(B)),this._parser.registerCsiHandler({final:"F"},B=>this.cursorPrecedingLine(B)),this._parser.registerCsiHandler({final:"G"},B=>this.cursorCharAbsolute(B)),this._parser.registerCsiHandler({final:"H"},B=>this.cursorPosition(B)),this._parser.registerCsiHandler({final:"I"},B=>this.cursorForwardTab(B)),this._parser.registerCsiHandler({final:"J"},B=>this.eraseInDisplay(B,!1)),this._parser.registerCsiHandler({prefix:"?",final:"J"},B=>this.eraseInDisplay(B,!0)),this._parser.registerCsiHandler({final:"K"},B=>this.eraseInLine(B,!1)),this._parser.registerCsiHandler({prefix:"?",final:"K"},B=>this.eraseInLine(B,!0)),this._parser.registerCsiHandler({final:"L"},B=>this.insertLines(B)),this._parser.registerCsiHandler({final:"M"},B=>this.deleteLines(B)),this._parser.registerCsiHandler({final:"P"},B=>this.deleteChars(B)),this._parser.registerCsiHandler({final:"S"},B=>this.scrollUp(B)),this._parser.registerCsiHandler({final:"T"},B=>this.scrollDown(B)),this._parser.registerCsiHandler({final:"X"},B=>this.eraseChars(B)),this._parser.registerCsiHandler({final:"Z"},B=>this.cursorBackwardTab(B)),this._parser.registerCsiHandler({final:"`"},B=>this.charPosAbsolute(B)),this._parser.registerCsiHandler({final:"a"},B=>this.hPositionRelative(B)),this._parser.registerCsiHandler({final:"b"},B=>this.repeatPrecedingCharacter(B)),this._parser.registerCsiHandler({final:"c"},B=>this.sendDeviceAttributesPrimary(B)),this._parser.registerCsiHandler({prefix:">",final:"c"},B=>this.sendDeviceAttributesSecondary(B)),this._parser.registerCsiHandler({final:"d"},B=>this.linePosAbsolute(B)),this._parser.registerCsiHandler({final:"e"},B=>this.vPositionRelative(B)),this._parser.registerCsiHandler({final:"f"},B=>this.hVPosition(B)),this._parser.registerCsiHandler({final:"g"},B=>this.tabClear(B)),this._parser.registerCsiHandler({final:"h"},B=>this.setMode(B)),this._parser.registerCsiHandler({prefix:"?",final:"h"},B=>this.setModePrivate(B)),this._parser.registerCsiHandler({final:"l"},B=>this.resetMode(B)),this._parser.registerCsiHandler({prefix:"?",final:"l"},B=>this.resetModePrivate(B)),this._parser.registerCsiHandler({final:"m"},B=>this.charAttributes(B)),this._parser.registerCsiHandler({final:"n"},B=>this.deviceStatus(B)),this._parser.registerCsiHandler({prefix:"?",final:"n"},B=>this.deviceStatusPrivate(B)),this._parser.registerCsiHandler({intermediates:"!",final:"p"},B=>this.softReset(B)),this._parser.registerCsiHandler({intermediates:" ",final:"q"},B=>this.setCursorStyle(B)),this._parser.registerCsiHandler({final:"r"},B=>this.setScrollRegion(B)),this._parser.registerCsiHandler({final:"s"},B=>this.saveCursor(B)),this._parser.registerCsiHandler({final:"t"},B=>this.windowOptions(B)),this._parser.registerCsiHandler({final:"u"},B=>this.restoreCursor(B)),this._parser.registerCsiHandler({intermediates:"'",final:"}"},B=>this.insertColumns(B)),this._parser.registerCsiHandler({intermediates:"'",final:"~"},B=>this.deleteColumns(B)),this._parser.registerCsiHandler({intermediates:'"',final:"q"},B=>this.selectProtected(B)),this._parser.registerCsiHandler({intermediates:"$",final:"p"},B=>this.requestMode(B,!0)),this._parser.registerCsiHandler({prefix:"?",intermediates:"$",final:"p"},B=>this.requestMode(B,!1)),this._parser.setExecuteHandler(u.C0.BEL,()=>this.bell()),this._parser.setExecuteHandler(u.C0.LF,()=>this.lineFeed()),this._parser.setExecuteHandler(u.C0.VT,()=>this.lineFeed()),this._parser.setExecuteHandler(u.C0.FF,()=>this.lineFeed()),this._parser.setExecuteHandler(u.C0.CR,()=>this.carriageReturn()),this._parser.setExecuteHandler(u.C0.BS,()=>this.backspace()),this._parser.setExecuteHandler(u.C0.HT,()=>this.tab()),this._parser.setExecuteHandler(u.C0.SO,()=>this.shiftOut()),this._parser.setExecuteHandler(u.C0.SI,()=>this.shiftIn()),this._parser.setExecuteHandler(u.C1.IND,()=>this.index()),this._parser.setExecuteHandler(u.C1.NEL,()=>this.nextLine()),this._parser.setExecuteHandler(u.C1.HTS,()=>this.tabSet()),this._parser.registerOscHandler(0,new C.OscHandler(B=>(this.setTitle(B),this.setIconName(B),!0))),this._parser.registerOscHandler(1,new C.OscHandler(B=>this.setIconName(B))),this._parser.registerOscHandler(2,new C.OscHandler(B=>this.setTitle(B))),this._parser.registerOscHandler(4,new C.OscHandler(B=>this.setOrReportIndexedColor(B))),this._parser.registerOscHandler(8,new C.OscHandler(B=>this.setHyperlink(B))),this._parser.registerOscHandler(10,new C.OscHandler(B=>this.setOrReportFgColor(B))),this._parser.registerOscHandler(11,new C.OscHandler(B=>this.setOrReportBgColor(B))),this._parser.registerOscHandler(12,new C.OscHandler(B=>this.setOrReportCursorColor(B))),this._parser.registerOscHandler(104,new C.OscHandler(B=>this.restoreIndexedColor(B))),this._parser.registerOscHandler(110,new C.OscHandler(B=>this.restoreFgColor(B))),this._parser.registerOscHandler(111,new C.OscHandler(B=>this.restoreBgColor(B))),this._parser.registerOscHandler(112,new C.OscHandler(B=>this.restoreCursorColor(B))),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 B in p.CHARSETS)this._parser.registerEscHandler({intermediates:"(",final:B},()=>this.selectCharset("("+B)),this._parser.registerEscHandler({intermediates:")",final:B},()=>this.selectCharset(")"+B)),this._parser.registerEscHandler({intermediates:"*",final:B},()=>this.selectCharset("*"+B)),this._parser.registerEscHandler({intermediates:"+",final:B},()=>this.selectCharset("+"+B)),this._parser.registerEscHandler({intermediates:"-",final:B},()=>this.selectCharset("-"+B)),this._parser.registerEscHandler({intermediates:".",final:B},()=>this.selectCharset("."+B)),this._parser.registerEscHandler({intermediates:"/",final:B},()=>this.selectCharset("/"+B));this._parser.registerEscHandler({intermediates:"#",final:"8"},()=>this.screenAlignmentPattern()),this._parser.setErrorHandler(B=>(this._logService.error("Parsing error: ",B),B)),this._parser.registerDcsHandler({intermediates:"$",final:"q"},new S.DcsHandler((B,K)=>this.requestStatusString(B,K)))}_preserveStack(R,P,N,j){this._parseStack.paused=!0,this._parseStack.cursorStartX=R,this._parseStack.cursorStartY=P,this._parseStack.decodedLength=N,this._parseStack.position=j}_logSlowResolvingAsync(R){this._logService.logLevel<=b.LogLevelEnum.WARN&&Promise.race([R,new Promise((P,N)=>setTimeout(()=>N("#SLOW_TIMEOUT"),5e3))]).catch(P=>{if(P!=="#SLOW_TIMEOUT")throw P;console.warn("async parser handler taking longer than 5000 ms")})}_getCurrentLinkId(){return this._curAttrData.extended.urlId}parse(R,P){let N,j=this._activeBuffer.x,W=this._activeBuffer.y,V=0;const Z=this._parseStack.paused;if(Z){if(N=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,P))return this._logSlowResolvingAsync(N),N;j=this._parseStack.cursorStartX,W=this._parseStack.cursorStartY,this._parseStack.paused=!1,R.length>A&&(V=this._parseStack.position+A)}if(this._logService.logLevel<=b.LogLevelEnum.DEBUG&&this._logService.debug("parsing data"+(typeof R=="string"?` "${R}"`:` "${Array.prototype.map.call(R,B=>String.fromCharCode(B)).join("")}"`),typeof R=="string"?R.split("").map(B=>B.charCodeAt(0)):R),this._parseBuffer.length<R.length&&this._parseBuffer.length<A&&(this._parseBuffer=new Uint32Array(Math.min(R.length,A))),Z||this._dirtyRowTracker.clearRange(),R.length>A)for(let B=V;B<R.length;B+=A){const K=B+A<R.length?B+A:R.length,U=typeof R=="string"?this._stringDecoder.decode(R.substring(B,K),this._parseBuffer):this._utf8Decoder.decode(R.subarray(B,K),this._parseBuffer);if(N=this._parser.parse(this._parseBuffer,U))return this._preserveStack(j,W,U,B),this._logSlowResolvingAsync(N),N}else if(!Z){const B=typeof R=="string"?this._stringDecoder.decode(R,this._parseBuffer):this._utf8Decoder.decode(R,this._parseBuffer);if(N=this._parser.parse(this._parseBuffer,B))return this._preserveStack(j,W,B,0),this._logSlowResolvingAsync(N),N}this._activeBuffer.x===j&&this._activeBuffer.y===W||this._onCursorMove.fire();const Q=this._dirtyRowTracker.end+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp),$=this._dirtyRowTracker.start+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp);$<this._bufferService.rows&&this._onRequestRefreshRows.fire(Math.min($,this._bufferService.rows-1),Math.min(Q,this._bufferService.rows-1))}print(R,P,N){let j,W;const V=this._charsetService.charset,Z=this._optionsService.rawOptions.screenReaderMode,Q=this._bufferService.cols,$=this._coreService.decPrivateModes.wraparound,B=this._coreService.modes.insertMode,K=this._curAttrData;let U=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._activeBuffer.x&&N-P>0&&U.getWidth(this._activeBuffer.x-1)===2&&U.setCellFromCodepoint(this._activeBuffer.x-1,0,1,K);let te=this._parser.precedingJoinState;for(let Y=P;Y<N;++Y){if(j=R[Y],j<127&&V){const oe=V[String.fromCharCode(j)];oe&&(j=oe.charCodeAt(0))}const ye=this._unicodeService.charProperties(j,te);W=x.UnicodeService.extractWidth(ye);const pe=x.UnicodeService.extractShouldJoin(ye),ne=pe?x.UnicodeService.extractWidth(te):0;if(te=ye,Z&&this._onA11yChar.fire((0,v.stringFromCodePoint)(j)),this._getCurrentLinkId()&&this._oscLinkService.addLineToLink(this._getCurrentLinkId(),this._activeBuffer.ybase+this._activeBuffer.y),this._activeBuffer.x+W-ne>Q){if($){const oe=U;let ce=this._activeBuffer.x-ne;for(this._activeBuffer.x=ne,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),ne>0&&U instanceof h.BufferLine&&U.copyCellsFrom(oe,ce,0,ne,!1);ce<Q;)oe.setCellFromCodepoint(ce++,0,1,K)}else if(this._activeBuffer.x=Q-1,W===2)continue}if(pe&&this._activeBuffer.x){const oe=U.getWidth(this._activeBuffer.x-1)?1:2;U.addCodepointToCell(this._activeBuffer.x-oe,j,W);for(let ce=W-ne;--ce>=0;)U.setCellFromCodepoint(this._activeBuffer.x++,0,0,K)}else if(B&&(U.insertCells(this._activeBuffer.x,W-ne,this._activeBuffer.getNullCell(K)),U.getWidth(Q-1)===2&&U.setCellFromCodepoint(Q-1,d.NULL_CELL_CODE,d.NULL_CELL_WIDTH,K)),U.setCellFromCodepoint(this._activeBuffer.x++,j,W,K),W>0)for(;--W;)U.setCellFromCodepoint(this._activeBuffer.x++,0,0,K)}this._parser.precedingJoinState=te,this._activeBuffer.x<Q&&N-P>0&&U.getWidth(this._activeBuffer.x)===0&&!U.hasContent(this._activeBuffer.x)&&U.setCellFromCodepoint(this._activeBuffer.x,0,1,K),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler(R,P){return R.final!=="t"||R.prefix||R.intermediates?this._parser.registerCsiHandler(R,P):this._parser.registerCsiHandler(R,N=>!M(N.params[0],this._optionsService.rawOptions.windowOptions)||P(N))}registerDcsHandler(R,P){return this._parser.registerDcsHandler(R,new S.DcsHandler(P))}registerEscHandler(R,P){return this._parser.registerEscHandler(R,P)}registerOscHandler(R,P){return this._parser.registerOscHandler(R,new C.OscHandler(P))}bell(){return this._onRequestBell.fire(),!0}lineFeed(){return this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._optionsService.rawOptions.convertEol&&(this._activeBuffer.x=0),this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData())):this._activeBuffer.y>=this._bufferService.rows?this._activeBuffer.y=this._bufferService.rows-1:this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.x>=this._bufferService.cols&&this._activeBuffer.x--,this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._onLineFeed.fire(),!0}carriageReturn(){return this._activeBuffer.x=0,!0}backspace(){var R;if(!this._coreService.decPrivateModes.reverseWraparound)return this._restrictCursor(),this._activeBuffer.x>0&&this._activeBuffer.x--,!0;if(this._restrictCursor(this._bufferService.cols),this._activeBuffer.x>0)this._activeBuffer.x--;else if(this._activeBuffer.x===0&&this._activeBuffer.y>this._activeBuffer.scrollTop&&this._activeBuffer.y<=this._activeBuffer.scrollBottom&&((R=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y))!=null&&R.isWrapped)){this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.y--,this._activeBuffer.x=this._bufferService.cols-1;const P=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);P.hasWidth(this._activeBuffer.x)&&!P.hasContent(this._activeBuffer.x)&&this._activeBuffer.x--}return this._restrictCursor(),!0}tab(){if(this._activeBuffer.x>=this._bufferService.cols)return!0;const R=this._activeBuffer.x;return this._activeBuffer.x=this._activeBuffer.nextStop(),this._optionsService.rawOptions.screenReaderMode&&this._onA11yTab.fire(this._activeBuffer.x-R),!0}shiftOut(){return this._charsetService.setgLevel(1),!0}shiftIn(){return this._charsetService.setgLevel(0),!0}_restrictCursor(R=this._bufferService.cols-1){this._activeBuffer.x=Math.min(R,Math.max(0,this._activeBuffer.x)),this._activeBuffer.y=this._coreService.decPrivateModes.origin?Math.min(this._activeBuffer.scrollBottom,Math.max(this._activeBuffer.scrollTop,this._activeBuffer.y)):Math.min(this._bufferService.rows-1,Math.max(0,this._activeBuffer.y)),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_setCursor(R,P){this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=R,this._activeBuffer.y=this._activeBuffer.scrollTop+P):(this._activeBuffer.x=R,this._activeBuffer.y=P),this._restrictCursor(),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_moveCursor(R,P){this._restrictCursor(),this._setCursor(this._activeBuffer.x+R,this._activeBuffer.y+P)}cursorUp(R){const P=this._activeBuffer.y-this._activeBuffer.scrollTop;return P>=0?this._moveCursor(0,-Math.min(P,R.params[0]||1)):this._moveCursor(0,-(R.params[0]||1)),!0}cursorDown(R){const P=this._activeBuffer.scrollBottom-this._activeBuffer.y;return P>=0?this._moveCursor(0,Math.min(P,R.params[0]||1)):this._moveCursor(0,R.params[0]||1),!0}cursorForward(R){return this._moveCursor(R.params[0]||1,0),!0}cursorBackward(R){return this._moveCursor(-(R.params[0]||1),0),!0}cursorNextLine(R){return this.cursorDown(R),this._activeBuffer.x=0,!0}cursorPrecedingLine(R){return this.cursorUp(R),this._activeBuffer.x=0,!0}cursorCharAbsolute(R){return this._setCursor((R.params[0]||1)-1,this._activeBuffer.y),!0}cursorPosition(R){return this._setCursor(R.length>=2?(R.params[1]||1)-1:0,(R.params[0]||1)-1),!0}charPosAbsolute(R){return this._setCursor((R.params[0]||1)-1,this._activeBuffer.y),!0}hPositionRelative(R){return this._moveCursor(R.params[0]||1,0),!0}linePosAbsolute(R){return this._setCursor(this._activeBuffer.x,(R.params[0]||1)-1),!0}vPositionRelative(R){return this._moveCursor(0,R.params[0]||1),!0}hVPosition(R){return this.cursorPosition(R),!0}tabClear(R){const P=R.params[0];return P===0?delete this._activeBuffer.tabs[this._activeBuffer.x]:P===3&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(R){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let P=R.params[0]||1;for(;P--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0}cursorBackwardTab(R){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let P=R.params[0]||1;for(;P--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0}selectProtected(R){const P=R.params[0];return P===1&&(this._curAttrData.bg|=536870912),P!==2&&P!==0||(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine(R,P,N,j=!1,W=!1){const V=this._activeBuffer.lines.get(this._activeBuffer.ybase+R);V.replaceCells(P,N,this._activeBuffer.getNullCell(this._eraseAttrData()),W),j&&(V.isWrapped=!1)}_resetBufferLine(R,P=!1){const N=this._activeBuffer.lines.get(this._activeBuffer.ybase+R);N&&(N.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),P),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+R),N.isWrapped=!1)}eraseInDisplay(R,P=!1){let N;switch(this._restrictCursor(this._bufferService.cols),R.params[0]){case 0:for(N=this._activeBuffer.y,this._dirtyRowTracker.markDirty(N),this._eraseInBufferLine(N++,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,P);N<this._bufferService.rows;N++)this._resetBufferLine(N,P);this._dirtyRowTracker.markDirty(N);break;case 1:for(N=this._activeBuffer.y,this._dirtyRowTracker.markDirty(N),this._eraseInBufferLine(N,0,this._activeBuffer.x+1,!0,P),this._activeBuffer.x+1>=this._bufferService.cols&&(this._activeBuffer.lines.get(N+1).isWrapped=!1);N--;)this._resetBufferLine(N,P);this._dirtyRowTracker.markDirty(0);break;case 2:for(N=this._bufferService.rows,this._dirtyRowTracker.markDirty(N-1);N--;)this._resetBufferLine(N,P);this._dirtyRowTracker.markDirty(0);break;case 3:const j=this._activeBuffer.lines.length-this._bufferService.rows;j>0&&(this._activeBuffer.lines.trimStart(j),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-j,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-j,0),this._onScroll.fire(0))}return!0}eraseInLine(R,P=!1){switch(this._restrictCursor(this._bufferService.cols),R.params[0]){case 0:this._eraseInBufferLine(this._activeBuffer.y,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,P);break;case 1:this._eraseInBufferLine(this._activeBuffer.y,0,this._activeBuffer.x+1,!1,P);break;case 2:this._eraseInBufferLine(this._activeBuffer.y,0,this._bufferService.cols,!0,P)}return this._dirtyRowTracker.markDirty(this._activeBuffer.y),!0}insertLines(R){this._restrictCursor();let P=R.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const N=this._activeBuffer.ybase+this._activeBuffer.y,j=this._bufferService.rows-1-this._activeBuffer.scrollBottom,W=this._bufferService.rows-1+this._activeBuffer.ybase-j+1;for(;P--;)this._activeBuffer.lines.splice(W-1,1),this._activeBuffer.lines.splice(N,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}deleteLines(R){this._restrictCursor();let P=R.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const N=this._activeBuffer.ybase+this._activeBuffer.y;let j;for(j=this._bufferService.rows-1-this._activeBuffer.scrollBottom,j=this._bufferService.rows-1+this._activeBuffer.ybase-j;P--;)this._activeBuffer.lines.splice(N,1),this._activeBuffer.lines.splice(j,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}insertChars(R){this._restrictCursor();const P=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return P&&(P.insertCells(this._activeBuffer.x,R.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}deleteChars(R){this._restrictCursor();const P=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return P&&(P.deleteCells(this._activeBuffer.x,R.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}scrollUp(R){let P=R.params[0]||1;for(;P--;)this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollTop,1),this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollBottom,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollDown(R){let P=R.params[0]||1;for(;P--;)this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollBottom,1),this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollTop,0,this._activeBuffer.getBlankLine(h.DEFAULT_ATTR_DATA));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollLeft(R){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const P=R.params[0]||1;for(let N=this._activeBuffer.scrollTop;N<=this._activeBuffer.scrollBottom;++N){const j=this._activeBuffer.lines.get(this._activeBuffer.ybase+N);j.deleteCells(0,P,this._activeBuffer.getNullCell(this._eraseAttrData())),j.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollRight(R){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const P=R.params[0]||1;for(let N=this._activeBuffer.scrollTop;N<=this._activeBuffer.scrollBottom;++N){const j=this._activeBuffer.lines.get(this._activeBuffer.ybase+N);j.insertCells(0,P,this._activeBuffer.getNullCell(this._eraseAttrData())),j.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}insertColumns(R){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const P=R.params[0]||1;for(let N=this._activeBuffer.scrollTop;N<=this._activeBuffer.scrollBottom;++N){const j=this._activeBuffer.lines.get(this._activeBuffer.ybase+N);j.insertCells(this._activeBuffer.x,P,this._activeBuffer.getNullCell(this._eraseAttrData())),j.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}deleteColumns(R){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const P=R.params[0]||1;for(let N=this._activeBuffer.scrollTop;N<=this._activeBuffer.scrollBottom;++N){const j=this._activeBuffer.lines.get(this._activeBuffer.ybase+N);j.deleteCells(this._activeBuffer.x,P,this._activeBuffer.getNullCell(this._eraseAttrData())),j.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}eraseChars(R){this._restrictCursor();const P=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return P&&(P.replaceCells(this._activeBuffer.x,this._activeBuffer.x+(R.params[0]||1),this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}repeatPrecedingCharacter(R){const P=this._parser.precedingJoinState;if(!P)return!0;const N=R.params[0]||1,j=x.UnicodeService.extractWidth(P),W=this._activeBuffer.x-j,V=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).getString(W),Z=new Uint32Array(V.length*N);let Q=0;for(let B=0;B<V.length;){const K=V.codePointAt(B)||0;Z[Q++]=K,B+=K>65535?2:1}let $=Q;for(let B=1;B<N;++B)Z.copyWithin($,0,Q),$+=Q;return this.print(Z,0,$),!0}sendDeviceAttributesPrimary(R){return R.params[0]>0||(this._is("xterm")||this._is("rxvt-unicode")||this._is("screen")?this._coreService.triggerDataEvent(u.C0.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(u.C0.ESC+"[?6c")),!0}sendDeviceAttributesSecondary(R){return R.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(u.C0.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(u.C0.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(R.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(u.C0.ESC+"[>83;40003;0c")),!0}_is(R){return(this._optionsService.rawOptions.termName+"").indexOf(R)===0}setMode(R){for(let P=0;P<R.length;P++)switch(R.params[P]){case 4:this._coreService.modes.insertMode=!0;break;case 20:this._optionsService.options.convertEol=!0}return!0}setModePrivate(R){for(let P=0;P<R.length;P++)switch(R.params[P]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!0;break;case 2:this._charsetService.setgCharset(0,p.DEFAULT_CHARSET),this._charsetService.setgCharset(1,p.DEFAULT_CHARSET),this._charsetService.setgCharset(2,p.DEFAULT_CHARSET),this._charsetService.setgCharset(3,p.DEFAULT_CHARSET);break;case 3:this._optionsService.rawOptions.windowOptions.setWinLines&&(this._bufferService.resize(132,this._bufferService.rows),this._onRequestReset.fire());break;case 6:this._coreService.decPrivateModes.origin=!0,this._setCursor(0,0);break;case 7:this._coreService.decPrivateModes.wraparound=!0;break;case 12:this._optionsService.options.cursorBlink=!0;break;case 45:this._coreService.decPrivateModes.reverseWraparound=!0;break;case 66:this._logService.debug("Serial port requested application keypad."),this._coreService.decPrivateModes.applicationKeypad=!0,this._onRequestSyncScrollBar.fire();break;case 9:this._coreMouseService.activeProtocol="X10";break;case 1e3:this._coreMouseService.activeProtocol="VT200";break;case 1002:this._coreMouseService.activeProtocol="DRAG";break;case 1003:this._coreMouseService.activeProtocol="ANY";break;case 1004:this._coreService.decPrivateModes.sendFocus=!0,this._onRequestSendFocus.fire();break;case 1005:this._logService.debug("DECSET 1005 not supported (see #2507)");break;case 1006:this._coreMouseService.activeEncoding="SGR";break;case 1015:this._logService.debug("DECSET 1015 not supported (see #2507)");break;case 1016:this._coreMouseService.activeEncoding="SGR_PIXELS";break;case 25:this._coreService.isCursorHidden=!1;break;case 1048:this.saveCursor();break;case 1049:this.saveCursor();case 47:case 1047:this._bufferService.buffers.activateAltBuffer(this._eraseAttrData()),this._coreService.isCursorInitialized=!0,this._onRequestRefreshRows.fire(0,this._bufferService.rows-1),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!0}return!0}resetMode(R){for(let P=0;P<R.length;P++)switch(R.params[P]){case 4:this._coreService.modes.insertMode=!1;break;case 20:this._optionsService.options.convertEol=!1}return!0}resetModePrivate(R){for(let P=0;P<R.length;P++)switch(R.params[P]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!1;break;case 3:this._optionsService.rawOptions.windowOptions.setWinLines&&(this._bufferService.resize(80,this._bufferService.rows),this._onRequestReset.fire());break;case 6:this._coreService.decPrivateModes.origin=!1,this._setCursor(0,0);break;case 7:this._coreService.decPrivateModes.wraparound=!1;break;case 12:this._optionsService.options.cursorBlink=!1;break;case 45:this._coreService.decPrivateModes.reverseWraparound=!1;break;case 66:this._logService.debug("Switching back to normal keypad."),this._coreService.decPrivateModes.applicationKeypad=!1,this._onRequestSyncScrollBar.fire();break;case 9:case 1e3:case 1002:case 1003:this._coreMouseService.activeProtocol="NONE";break;case 1004:this._coreService.decPrivateModes.sendFocus=!1;break;case 1005:this._logService.debug("DECRST 1005 not supported (see #2507)");break;case 1006:case 1016:this._coreMouseService.activeEncoding="DEFAULT";break;case 1015:this._logService.debug("DECRST 1015 not supported (see #2507)");break;case 25:this._coreService.isCursorHidden=!0;break;case 1048:this.restoreCursor();break;case 1049:case 47:case 1047:this._bufferService.buffers.activateNormalBuffer(),R.params[P]===1049&&this.restoreCursor(),this._coreService.isCursorInitialized=!0,this._onRequestRefreshRows.fire(0,this._bufferService.rows-1),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!1}return!0}requestMode(R,P){const N=this._coreService.decPrivateModes,{activeProtocol:j,activeEncoding:W}=this._coreMouseService,V=this._coreService,{buffers:Z,cols:Q}=this._bufferService,{active:$,alt:B}=Z,K=this._optionsService.rawOptions,U=pe=>pe?1:2,te=R.params[0];return Y=te,ye=P?te===2?4:te===4?U(V.modes.insertMode):te===12?3:te===20?U(K.convertEol):0:te===1?U(N.applicationCursorKeys):te===3?K.windowOptions.setWinLines?Q===80?2:Q===132?1:0:0:te===6?U(N.origin):te===7?U(N.wraparound):te===8?3:te===9?U(j==="X10"):te===12?U(K.cursorBlink):te===25?U(!V.isCursorHidden):te===45?U(N.reverseWraparound):te===66?U(N.applicationKeypad):te===67?4:te===1e3?U(j==="VT200"):te===1002?U(j==="DRAG"):te===1003?U(j==="ANY"):te===1004?U(N.sendFocus):te===1005?4:te===1006?U(W==="SGR"):te===1015?4:te===1016?U(W==="SGR_PIXELS"):te===1048?1:te===47||te===1047||te===1049?U($===B):te===2004?U(N.bracketedPasteMode):0,V.triggerDataEvent(`${u.C0.ESC}[${P?"":"?"}${Y};${ye}$y`),!0;var Y,ye}_updateAttrColor(R,P,N,j,W){return P===2?(R|=50331648,R&=-16777216,R|=w.AttributeData.fromColorRGB([N,j,W])):P===5&&(R&=-50331904,R|=33554432|255&N),R}_extractColor(R,P,N){const j=[0,0,-1,0,0,0];let W=0,V=0;do{if(j[V+W]=R.params[P+V],R.hasSubParams(P+V)){const Z=R.getSubParams(P+V);let Q=0;do j[1]===5&&(W=1),j[V+Q+1+W]=Z[Q];while(++Q<Z.length&&Q+V+1+W<j.length);break}if(j[1]===5&&V+W>=2||j[1]===2&&V+W>=5)break;j[1]&&(W=1)}while(++V+P<R.length&&V+W<j.length);for(let Z=2;Z<j.length;++Z)j[Z]===-1&&(j[Z]=0);switch(j[0]){case 38:N.fg=this._updateAttrColor(N.fg,j[1],j[3],j[4],j[5]);break;case 48:N.bg=this._updateAttrColor(N.bg,j[1],j[3],j[4],j[5]);break;case 58:N.extended=N.extended.clone(),N.extended.underlineColor=this._updateAttrColor(N.extended.underlineColor,j[1],j[3],j[4],j[5])}return V}_processUnderline(R,P){P.extended=P.extended.clone(),(!~R||R>5)&&(R=1),P.extended.underlineStyle=R,P.fg|=268435456,R===0&&(P.fg&=-268435457),P.updateExtended()}_processSGR0(R){R.fg=h.DEFAULT_ATTR_DATA.fg,R.bg=h.DEFAULT_ATTR_DATA.bg,R.extended=R.extended.clone(),R.extended.underlineStyle=0,R.extended.underlineColor&=-67108864,R.updateExtended()}charAttributes(R){if(R.length===1&&R.params[0]===0)return this._processSGR0(this._curAttrData),!0;const P=R.length;let N;const j=this._curAttrData;for(let W=0;W<P;W++)N=R.params[W],N>=30&&N<=37?(j.fg&=-50331904,j.fg|=16777216|N-30):N>=40&&N<=47?(j.bg&=-50331904,j.bg|=16777216|N-40):N>=90&&N<=97?(j.fg&=-50331904,j.fg|=16777224|N-90):N>=100&&N<=107?(j.bg&=-50331904,j.bg|=16777224|N-100):N===0?this._processSGR0(j):N===1?j.fg|=134217728:N===3?j.bg|=67108864:N===4?(j.fg|=268435456,this._processUnderline(R.hasSubParams(W)?R.getSubParams(W)[0]:1,j)):N===5?j.fg|=536870912:N===7?j.fg|=67108864:N===8?j.fg|=1073741824:N===9?j.fg|=2147483648:N===2?j.bg|=134217728:N===21?this._processUnderline(2,j):N===22?(j.fg&=-134217729,j.bg&=-134217729):N===23?j.bg&=-67108865:N===24?(j.fg&=-268435457,this._processUnderline(0,j)):N===25?j.fg&=-536870913:N===27?j.fg&=-67108865:N===28?j.fg&=-1073741825:N===29?j.fg&=2147483647:N===39?(j.fg&=-67108864,j.fg|=16777215&h.DEFAULT_ATTR_DATA.fg):N===49?(j.bg&=-67108864,j.bg|=16777215&h.DEFAULT_ATTR_DATA.bg):N===38||N===48||N===58?W+=this._extractColor(R,W,j):N===53?j.bg|=1073741824:N===55?j.bg&=-1073741825:N===59?(j.extended=j.extended.clone(),j.extended.underlineColor=-1,j.updateExtended()):N===100?(j.fg&=-67108864,j.fg|=16777215&h.DEFAULT_ATTR_DATA.fg,j.bg&=-67108864,j.bg|=16777215&h.DEFAULT_ATTR_DATA.bg):this._logService.debug("Unknown SGR attribute: %d.",N);return!0}deviceStatus(R){switch(R.params[0]){case 5:this._coreService.triggerDataEvent(`${u.C0.ESC}[0n`);break;case 6:const P=this._activeBuffer.y+1,N=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${u.C0.ESC}[${P};${N}R`)}return!0}deviceStatusPrivate(R){if(R.params[0]===6){const P=this._activeBuffer.y+1,N=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${u.C0.ESC}[?${P};${N}R`)}return!0}softReset(R){return this._coreService.isCursorHidden=!1,this._onRequestSyncScrollBar.fire(),this._activeBuffer.scrollTop=0,this._activeBuffer.scrollBottom=this._bufferService.rows-1,this._curAttrData=h.DEFAULT_ATTR_DATA.clone(),this._coreService.reset(),this._charsetService.reset(),this._activeBuffer.savedX=0,this._activeBuffer.savedY=this._activeBuffer.ybase,this._activeBuffer.savedCurAttrData.fg=this._curAttrData.fg,this._activeBuffer.savedCurAttrData.bg=this._curAttrData.bg,this._activeBuffer.savedCharset=this._charsetService.charset,this._coreService.decPrivateModes.origin=!1,!0}setCursorStyle(R){const P=R.params[0]||1;switch(P){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 N=P%2==1;return this._optionsService.options.cursorBlink=N,!0}setScrollRegion(R){const P=R.params[0]||1;let N;return(R.length<2||(N=R.params[1])>this._bufferService.rows||N===0)&&(N=this._bufferService.rows),N>P&&(this._activeBuffer.scrollTop=P-1,this._activeBuffer.scrollBottom=N-1,this._setCursor(0,0)),!0}windowOptions(R){if(!M(R.params[0],this._optionsService.rawOptions.windowOptions))return!0;const P=R.length>1?R.params[1]:0;switch(R.params[0]){case 14:P!==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(`${u.C0.ESC}[8;${this._bufferService.rows};${this._bufferService.cols}t`);break;case 22:P!==0&&P!==2||(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>10&&this._windowTitleStack.shift()),P!==0&&P!==1||(this._iconNameStack.push(this._iconName),this._iconNameStack.length>10&&this._iconNameStack.shift());break;case 23:P!==0&&P!==2||this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),P!==0&&P!==1||this._iconNameStack.length&&this.setIconName(this._iconNameStack.pop())}return!0}saveCursor(R){return this._activeBuffer.savedX=this._activeBuffer.x,this._activeBuffer.savedY=this._activeBuffer.ybase+this._activeBuffer.y,this._activeBuffer.savedCurAttrData.fg=this._curAttrData.fg,this._activeBuffer.savedCurAttrData.bg=this._curAttrData.bg,this._activeBuffer.savedCharset=this._charsetService.charset,!0}restoreCursor(R){return this._activeBuffer.x=this._activeBuffer.savedX||0,this._activeBuffer.y=Math.max(this._activeBuffer.savedY-this._activeBuffer.ybase,0),this._curAttrData.fg=this._activeBuffer.savedCurAttrData.fg,this._curAttrData.bg=this._activeBuffer.savedCurAttrData.bg,this._charsetService.charset=this._savedCharset,this._activeBuffer.savedCharset&&(this._charsetService.charset=this._activeBuffer.savedCharset),this._restrictCursor(),!0}setTitle(R){return this._windowTitle=R,this._onTitleChange.fire(R),!0}setIconName(R){return this._iconName=R,!0}setOrReportIndexedColor(R){const P=[],N=R.split(";");for(;N.length>1;){const j=N.shift(),W=N.shift();if(/^\d+$/.exec(j)){const V=parseInt(j);if(H(V))if(W==="?")P.push({type:0,index:V});else{const Z=(0,k.parseColor)(W);Z&&P.push({type:1,index:V,color:Z})}}}return P.length&&this._onColor.fire(P),!0}setHyperlink(R){const P=R.split(";");return!(P.length<2)&&(P[1]?this._createHyperlink(P[0],P[1]):!P[0]&&this._finishHyperlink())}_createHyperlink(R,P){this._getCurrentLinkId()&&this._finishHyperlink();const N=R.split(":");let j;const W=N.findIndex(V=>V.startsWith("id="));return W!==-1&&(j=N[W].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:j,uri:P}),this._curAttrData.updateExtended(),!0}_finishHyperlink(){return this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=0,this._curAttrData.updateExtended(),!0}_setOrReportSpecialColor(R,P){const N=R.split(";");for(let j=0;j<N.length&&!(P>=this._specialColors.length);++j,++P)if(N[j]==="?")this._onColor.fire([{type:0,index:this._specialColors[P]}]);else{const W=(0,k.parseColor)(N[j]);W&&this._onColor.fire([{type:1,index:this._specialColors[P],color:W}])}return!0}setOrReportFgColor(R){return this._setOrReportSpecialColor(R,0)}setOrReportBgColor(R){return this._setOrReportSpecialColor(R,1)}setOrReportCursorColor(R){return this._setOrReportSpecialColor(R,2)}restoreIndexedColor(R){if(!R)return this._onColor.fire([{type:2}]),!0;const P=[],N=R.split(";");for(let j=0;j<N.length;++j)if(/^\d+$/.exec(N[j])){const W=parseInt(N[j]);H(W)&&P.push({type:2,index:W})}return P.length&&this._onColor.fire(P),!0}restoreFgColor(R){return this._onColor.fire([{type:2,index:256}]),!0}restoreBgColor(R){return this._onColor.fire([{type:2,index:257}]),!0}restoreCursorColor(R){return this._onColor.fire([{type:2,index:258}]),!0}nextLine(){return this._activeBuffer.x=0,this.index(),!0}keypadApplicationMode(){return this._logService.debug("Serial port requested application keypad."),this._coreService.decPrivateModes.applicationKeypad=!0,this._onRequestSyncScrollBar.fire(),!0}keypadNumericMode(){return this._logService.debug("Switching back to normal keypad."),this._coreService.decPrivateModes.applicationKeypad=!1,this._onRequestSyncScrollBar.fire(),!0}selectDefaultCharset(){return this._charsetService.setgLevel(0),this._charsetService.setgCharset(0,p.DEFAULT_CHARSET),!0}selectCharset(R){return R.length!==2?(this.selectDefaultCharset(),!0):(R[0]==="/"||this._charsetService.setgCharset(L[R[0]],p.CHARSETS[R[1]]||p.DEFAULT_CHARSET),!0)}index(){return this._restrictCursor(),this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData())):this._activeBuffer.y>=this._bufferService.rows&&(this._activeBuffer.y=this._bufferService.rows-1),this._restrictCursor(),!0}tabSet(){return this._activeBuffer.tabs[this._activeBuffer.x]=!0,!0}reverseIndex(){if(this._restrictCursor(),this._activeBuffer.y===this._activeBuffer.scrollTop){const R=this._activeBuffer.scrollBottom-this._activeBuffer.scrollTop;this._activeBuffer.lines.shiftElements(this._activeBuffer.ybase+this._activeBuffer.y,R,1),this._activeBuffer.lines.set(this._activeBuffer.ybase+this._activeBuffer.y,this._activeBuffer.getBlankLine(this._eraseAttrData())),this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom)}else this._activeBuffer.y--,this._restrictCursor();return!0}fullReset(){return this._parser.reset(),this._onRequestReset.fire(),!0}reset(){this._curAttrData=h.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=h.DEFAULT_ATTR_DATA.clone()}_eraseAttrData(){return this._eraseAttrDataInternal.bg&=-67108864,this._eraseAttrDataInternal.bg|=67108863&this._curAttrData.bg,this._eraseAttrDataInternal}setgLevel(R){return this._charsetService.setgLevel(R),!0}screenAlignmentPattern(){const R=new g.CellData;R.content=4194373,R.fg=this._curAttrData.fg,R.bg=this._curAttrData.bg,this._setCursor(0,0);for(let P=0;P<this._bufferService.rows;++P){const N=this._activeBuffer.ybase+this._activeBuffer.y+P,j=this._activeBuffer.lines.get(N);j&&(j.fill(R),j.isWrapped=!1)}return this._dirtyRowTracker.markAllDirty(),this._setCursor(0,0),!0}requestStatusString(R,P){const N=this._bufferService.buffer,j=this._optionsService.rawOptions;return(W=>(this._coreService.triggerDataEvent(`${u.C0.ESC}${W}${u.C0.ESC}\\`),!0))(R==='"q'?`P1$r${this._curAttrData.isProtected()?1:0}"q`:R==='"p'?'P1$r61;1"p':R==="r"?`P1$r${N.scrollTop+1};${N.scrollBottom+1}r`:R==="m"?"P1$r0m":R===" q"?`P1$r${{block:2,underline:4,bar:6}[j.cursorStyle]-(j.cursorBlink?1:0)} q`:"P0$r")}markRangeDirty(R,P){this._dirtyRowTracker.markRangeDirty(R,P)}}s.InputHandler=z;let F=class{constructor(I){this._bufferService=I,this.clearRange()}clearRange(){this.start=this._bufferService.buffer.y,this.end=this._bufferService.buffer.y}markDirty(I){I<this.start?this.start=I:I>this.end&&(this.end=I)}markRangeDirty(I,R){I>R&&(O=I,I=R,R=O),I<this.start&&(this.start=I),R>this.end&&(this.end=R)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};function H(I){return 0<=I&&I<256}F=c([f(0,b.IBufferService)],F)},844:(l,s)=>{function o(c){for(const f of c)f.dispose();c.length=0}Object.defineProperty(s,"__esModule",{value:!0}),s.getDisposeArrayDisposable=s.disposeArray=s.toDisposable=s.MutableDisposable=s.Disposable=void 0,s.Disposable=class{constructor(){this._disposables=[],this._isDisposed=!1}dispose(){this._isDisposed=!0;for(const c of this._disposables)c.dispose();this._disposables.length=0}register(c){return this._disposables.push(c),c}unregister(c){const f=this._disposables.indexOf(c);f!==-1&&this._disposables.splice(f,1)}},s.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(c){var f;this._isDisposed||c===this._value||((f=this._value)==null||f.dispose(),this._value=c)}clear(){this.value=void 0}dispose(){var c;this._isDisposed=!0,(c=this._value)==null||c.dispose(),this._value=void 0}},s.toDisposable=function(c){return{dispose:c}},s.disposeArray=o,s.getDisposeArrayDisposable=function(c){return{dispose:()=>o(c)}}},1505:(l,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.FourKeyMap=s.TwoKeyMap=void 0;class o{constructor(){this._data={}}set(f,u,p){this._data[f]||(this._data[f]={}),this._data[f][u]=p}get(f,u){return this._data[f]?this._data[f][u]:void 0}clear(){this._data={}}}s.TwoKeyMap=o,s.FourKeyMap=class{constructor(){this._data=new o}set(c,f,u,p,_){this._data.get(c,f)||this._data.set(c,f,new o),this._data.get(c,f).set(u,p,_)}get(c,f,u,p){var _;return(_=this._data.get(c,f))==null?void 0:_.get(u,p)}clear(){this._data.clear()}}},6114:(l,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.isChromeOS=s.isLinux=s.isWindows=s.isIphone=s.isIpad=s.isMac=s.getSafariVersion=s.isSafari=s.isLegacyEdge=s.isFirefox=s.isNode=void 0,s.isNode=typeof process<"u"&&"title"in process;const o=s.isNode?"node":navigator.userAgent,c=s.isNode?"node":navigator.platform;s.isFirefox=o.includes("Firefox"),s.isLegacyEdge=o.includes("Edge"),s.isSafari=/^((?!chrome|android).)*safari/i.test(o),s.getSafariVersion=function(){if(!s.isSafari)return 0;const f=o.match(/Version\/(\d+)/);return f===null||f.length<2?0:parseInt(f[1])},s.isMac=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(c),s.isIpad=c==="iPad",s.isIphone=c==="iPhone",s.isWindows=["Windows","Win16","Win32","WinCE"].includes(c),s.isLinux=c.indexOf("Linux")>=0,s.isChromeOS=/\bCrOS\b/.test(o)},6106:(l,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.SortedList=void 0;let o=0;s.SortedList=class{constructor(c){this._getKey=c,this._array=[]}clear(){this._array.length=0}insert(c){this._array.length!==0?(o=this._search(this._getKey(c)),this._array.splice(o,0,c)):this._array.push(c)}delete(c){if(this._array.length===0)return!1;const f=this._getKey(c);if(f===void 0||(o=this._search(f),o===-1)||this._getKey(this._array[o])!==f)return!1;do if(this._array[o]===c)return this._array.splice(o,1),!0;while(++o<this._array.length&&this._getKey(this._array[o])===f);return!1}*getKeyIterator(c){if(this._array.length!==0&&(o=this._search(c),!(o<0||o>=this._array.length)&&this._getKey(this._array[o])===c))do yield this._array[o];while(++o<this._array.length&&this._getKey(this._array[o])===c)}forEachByKey(c,f){if(this._array.length!==0&&(o=this._search(c),!(o<0||o>=this._array.length)&&this._getKey(this._array[o])===c))do f(this._array[o]);while(++o<this._array.length&&this._getKey(this._array[o])===c)}values(){return[...this._array].values()}_search(c){let f=0,u=this._array.length-1;for(;u>=f;){let p=f+u>>1;const _=this._getKey(this._array[p]);if(_>c)u=p-1;else{if(!(_<c)){for(;p>0&&this._getKey(this._array[p-1])===c;)p--;return p}f=p+1}}return f}}},7226:(l,s,o)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.DebouncedIdleTask=s.IdleTaskQueue=s.PriorityTaskQueue=void 0;const c=o(6114);class f{constructor(){this._tasks=[],this._i=0}enqueue(_){this._tasks.push(_),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(_){this._idleCallback=void 0;let y=0,v=0,h=_.timeRemaining(),m=0;for(;this._i<this._tasks.length;){if(y=Date.now(),this._tasks[this._i]()||this._i++,y=Math.max(1,Date.now()-y),v=Math.max(y,v),m=_.timeRemaining(),1.5*v>m)return h-y<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(h-y))}ms`),void this._start();h=m}this.clear()}}class u extends f{_requestCallback(_){return setTimeout(()=>_(this._createDeadline(16)))}_cancelCallback(_){clearTimeout(_)}_createDeadline(_){const y=Date.now()+_;return{timeRemaining:()=>Math.max(0,y-Date.now())}}}s.PriorityTaskQueue=u,s.IdleTaskQueue=!c.isNode&&"requestIdleCallback"in window?class extends f{_requestCallback(p){return requestIdleCallback(p)}_cancelCallback(p){cancelIdleCallback(p)}}:u,s.DebouncedIdleTask=class{constructor(){this._queue=new s.IdleTaskQueue}set(p){this._queue.clear(),this._queue.enqueue(p)}flush(){this._queue.flush()}}},9282:(l,s,o)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.updateWindowsModeWrappedState=void 0;const c=o(643);s.updateWindowsModeWrappedState=function(f){const u=f.buffer.lines.get(f.buffer.ybase+f.buffer.y-1),p=u==null?void 0:u.get(f.cols-1),_=f.buffer.lines.get(f.buffer.ybase+f.buffer.y);_&&p&&(_.isWrapped=p[c.CHAR_DATA_CODE_INDEX]!==c.NULL_CELL_CODE&&p[c.CHAR_DATA_CODE_INDEX]!==c.WHITESPACE_CELL_CODE)}},3734:(l,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.ExtendedAttrs=s.AttributeData=void 0;class o{constructor(){this.fg=0,this.bg=0,this.extended=new c}static toColorRGB(u){return[u>>>16&255,u>>>8&255,255&u]}static fromColorRGB(u){return(255&u[0])<<16|(255&u[1])<<8|255&u[2]}clone(){const u=new o;return u.fg=this.fg,u.bg=this.bg,u.extended=this.extended.clone(),u}isInverse(){return 67108864&this.fg}isBold(){return 134217728&this.fg}isUnderline(){return this.hasExtendedAttrs()&&this.extended.underlineStyle!==0?1:268435456&this.fg}isBlink(){return 536870912&this.fg}isInvisible(){return 1073741824&this.fg}isItalic(){return 67108864&this.bg}isDim(){return 134217728&this.bg}isStrikethrough(){return 2147483648&this.fg}isProtected(){return 536870912&this.bg}isOverline(){return 1073741824&this.bg}getFgColorMode(){return 50331648&this.fg}getBgColorMode(){return 50331648&this.bg}isFgRGB(){return(50331648&this.fg)==50331648}isBgRGB(){return(50331648&this.bg)==50331648}isFgPalette(){return(50331648&this.fg)==16777216||(50331648&this.fg)==33554432}isBgPalette(){return(50331648&this.bg)==16777216||(50331648&this.bg)==33554432}isFgDefault(){return(50331648&this.fg)==0}isBgDefault(){return(50331648&this.bg)==0}isAttributeDefault(){return this.fg===0&&this.bg===0}getFgColor(){switch(50331648&this.fg){case 16777216:case 33554432:return 255&this.fg;case 50331648:return 16777215&this.fg;default:return-1}}getBgColor(){switch(50331648&this.bg){case 16777216:case 33554432:return 255&this.bg;case 50331648:return 16777215&this.bg;default:return-1}}hasExtendedAttrs(){return 268435456&this.bg}updateExtended(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456}getUnderlineColor(){if(268435456&this.bg&&~this.extended.underlineColor)switch(50331648&this.extended.underlineColor){case 16777216:case 33554432:return 255&this.extended.underlineColor;case 50331648:return 16777215&this.extended.underlineColor;default:return this.getFgColor()}return this.getFgColor()}getUnderlineColorMode(){return 268435456&this.bg&&~this.extended.underlineColor?50331648&this.extended.underlineColor:this.getFgColorMode()}isUnderlineColorRGB(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==50331648:this.isFgRGB()}isUnderlineColorPalette(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==16777216||(50331648&this.extended.underlineColor)==33554432:this.isFgPalette()}isUnderlineColorDefault(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==0:this.isFgDefault()}getUnderlineStyle(){return 268435456&this.fg?268435456&this.bg?this.extended.underlineStyle:1:0}getUnderlineVariantOffset(){return this.extended.underlineVariantOffset}}s.AttributeData=o;class c{get ext(){return this._urlId?-469762049&this._ext|this.underlineStyle<<26:this._ext}set ext(u){this._ext=u}get underlineStyle(){return this._urlId?5:(469762048&this._ext)>>26}set underlineStyle(u){this._ext&=-469762049,this._ext|=u<<26&469762048}get underlineColor(){return 67108863&this._ext}set underlineColor(u){this._ext&=-67108864,this._ext|=67108863&u}get urlId(){return this._urlId}set urlId(u){this._urlId=u}get underlineVariantOffset(){const u=(3758096384&this._ext)>>29;return u<0?4294967288^u:u}set underlineVariantOffset(u){this._ext&=536870911,this._ext|=u<<29&3758096384}constructor(u=0,p=0){this._ext=0,this._urlId=0,this._ext=u,this._urlId=p}clone(){return new c(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}}s.ExtendedAttrs=c},9092:(l,s,o)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.Buffer=s.MAX_BUFFER_SIZE=void 0;const c=o(6349),f=o(7226),u=o(3734),p=o(8437),_=o(4634),y=o(511),v=o(643),h=o(4863),m=o(7116);s.MAX_BUFFER_SIZE=4294967295,s.Buffer=class{constructor(d,g,w){this._hasScrollback=d,this._optionsService=g,this._bufferService=w,this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.tabs={},this.savedY=0,this.savedX=0,this.savedCurAttrData=p.DEFAULT_ATTR_DATA.clone(),this.savedCharset=m.DEFAULT_CHARSET,this.markers=[],this._nullCell=y.CellData.fromCharData([0,v.NULL_CELL_CHAR,v.NULL_CELL_WIDTH,v.NULL_CELL_CODE]),this._whitespaceCell=y.CellData.fromCharData([0,v.WHITESPACE_CELL_CHAR,v.WHITESPACE_CELL_WIDTH,v.WHITESPACE_CELL_CODE]),this._isClearing=!1,this._memoryCleanupQueue=new f.IdleTaskQueue,this._memoryCleanupPosition=0,this._cols=this._bufferService.cols,this._rows=this._bufferService.rows,this.lines=new c.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}getNullCell(d){return d?(this._nullCell.fg=d.fg,this._nullCell.bg=d.bg,this._nullCell.extended=d.extended):(this._nullCell.fg=0,this._nullCell.bg=0,this._nullCell.extended=new u.ExtendedAttrs),this._nullCell}getWhitespaceCell(d){return d?(this._whitespaceCell.fg=d.fg,this._whitespaceCell.bg=d.bg,this._whitespaceCell.extended=d.extended):(this._whitespaceCell.fg=0,this._whitespaceCell.bg=0,this._whitespaceCell.extended=new u.ExtendedAttrs),this._whitespaceCell}getBlankLine(d,g){return new p.BufferLine(this._bufferService.cols,this.getNullCell(d),g)}get hasScrollback(){return this._hasScrollback&&this.lines.maxLength>this._rows}get isCursorInViewport(){const d=this.ybase+this.y-this.ydisp;return d>=0&&d<this._rows}_getCorrectBufferLength(d){if(!this._hasScrollback)return d;const g=d+this._optionsService.rawOptions.scrollback;return g>s.MAX_BUFFER_SIZE?s.MAX_BUFFER_SIZE:g}fillViewportRows(d){if(this.lines.length===0){d===void 0&&(d=p.DEFAULT_ATTR_DATA);let g=this._rows;for(;g--;)this.lines.push(this.getBlankLine(d))}}clear(){this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.lines=new c.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}resize(d,g){const w=this.getNullCell(p.DEFAULT_ATTR_DATA);let b=0;const x=this._getCorrectBufferLength(g);if(x>this.lines.maxLength&&(this.lines.maxLength=x),this.lines.length>0){if(this._cols<d)for(let S=0;S<this.lines.length;S++)b+=+this.lines.get(S).resize(d,w);let C=0;if(this._rows<g)for(let S=this._rows;S<g;S++)this.lines.length<g+this.ybase&&(this._optionsService.rawOptions.windowsMode||this._optionsService.rawOptions.windowsPty.backend!==void 0||this._optionsService.rawOptions.windowsPty.buildNumber!==void 0?this.lines.push(new p.BufferLine(d,w)):this.ybase>0&&this.lines.length<=this.ybase+this.y+C+1?(this.ybase--,C++,this.ydisp>0&&this.ydisp--):this.lines.push(new p.BufferLine(d,w)));else for(let S=this._rows;S>g;S--)this.lines.length>g+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(x<this.lines.maxLength){const S=this.lines.length-x;S>0&&(this.lines.trimStart(S),this.ybase=Math.max(this.ybase-S,0),this.ydisp=Math.max(this.ydisp-S,0),this.savedY=Math.max(this.savedY-S,0)),this.lines.maxLength=x}this.x=Math.min(this.x,d-1),this.y=Math.min(this.y,g-1),C&&(this.y+=C),this.savedX=Math.min(this.savedX,d-1),this.scrollTop=0}if(this.scrollBottom=g-1,this._isReflowEnabled&&(this._reflow(d,g),this._cols>d))for(let C=0;C<this.lines.length;C++)b+=+this.lines.get(C).resize(d,w);this._cols=d,this._rows=g,this._memoryCleanupQueue.clear(),b>.1*this.lines.length&&(this._memoryCleanupPosition=0,this._memoryCleanupQueue.enqueue(()=>this._batchedMemoryCleanup()))}_batchedMemoryCleanup(){let d=!0;this._memoryCleanupPosition>=this.lines.length&&(this._memoryCleanupPosition=0,d=!1);let g=0;for(;this._memoryCleanupPosition<this.lines.length;)if(g+=this.lines.get(this._memoryCleanupPosition++).cleanupMemory(),g>100)return!0;return d}get _isReflowEnabled(){const d=this._optionsService.rawOptions.windowsPty;return d&&d.buildNumber?this._hasScrollback&&d.backend==="conpty"&&d.buildNumber>=21376:this._hasScrollback&&!this._optionsService.rawOptions.windowsMode}_reflow(d,g){this._cols!==d&&(d>this._cols?this._reflowLarger(d,g):this._reflowSmaller(d,g))}_reflowLarger(d,g){const w=(0,_.reflowLargerGetLinesToRemove)(this.lines,this._cols,d,this.ybase+this.y,this.getNullCell(p.DEFAULT_ATTR_DATA));if(w.length>0){const b=(0,_.reflowLargerCreateNewLayout)(this.lines,w);(0,_.reflowLargerApplyNewLayout)(this.lines,b.layout),this._reflowLargerAdjustViewport(d,g,b.countRemoved)}}_reflowLargerAdjustViewport(d,g,w){const b=this.getNullCell(p.DEFAULT_ATTR_DATA);let x=w;for(;x-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length<g&&this.lines.push(new p.BufferLine(d,b))):(this.ydisp===this.ybase&&this.ydisp--,this.ybase--);this.savedY=Math.max(this.savedY-w,0)}_reflowSmaller(d,g){const w=this.getNullCell(p.DEFAULT_ATTR_DATA),b=[];let x=0;for(let C=this.lines.length-1;C>=0;C--){let S=this.lines.get(C);if(!S||!S.isWrapped&&S.getTrimmedLength()<=d)continue;const k=[S];for(;S.isWrapped&&C>0;)S=this.lines.get(--C),k.unshift(S);const L=this.ybase+this.y;if(L>=C&&L<C+k.length)continue;const A=k[k.length-1].getTrimmedLength(),M=(0,_.reflowSmallerGetNewLineLengths)(k,this._cols,d),D=M.length-k.length;let O;O=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 z=[];for(let N=0;N<D;N++){const j=this.getBlankLine(p.DEFAULT_ATTR_DATA,!0);z.push(j)}z.length>0&&(b.push({start:C+k.length+x,newLines:z}),x+=z.length),k.push(...z);let F=M.length-1,H=M[F];H===0&&(F--,H=M[F]);let I=k.length-D-1,R=A;for(;I>=0;){const N=Math.min(R,H);if(k[F]===void 0)break;if(k[F].copyCellsFrom(k[I],R-N,H-N,N,!0),H-=N,H===0&&(F--,H=M[F]),R-=N,R===0){I--;const j=Math.max(I,0);R=(0,_.getWrappedLineTrimmedLength)(k,j,this._cols)}}for(let N=0;N<k.length;N++)M[N]<d&&k[N].setCell(M[N],w);let P=D-O;for(;P-- >0;)this.ybase===0?this.y<g-1?(this.y++,this.lines.pop()):(this.ybase++,this.ydisp++):this.ybase<Math.min(this.lines.maxLength,this.lines.length+x)-g&&(this.ybase===this.ydisp&&this.ydisp++,this.ybase++);this.savedY=Math.min(this.savedY+D,this.ybase+g-1)}if(b.length>0){const C=[],S=[];for(let F=0;F<this.lines.length;F++)S.push(this.lines.get(F));const k=this.lines.length;let L=k-1,A=0,M=b[A];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+x);let D=0;for(let F=Math.min(this.lines.maxLength-1,k+x-1);F>=0;F--)if(M&&M.start>L+D){for(let H=M.newLines.length-1;H>=0;H--)this.lines.set(F--,M.newLines[H]);F++,C.push({index:L+1,amount:M.newLines.length}),D+=M.newLines.length,M=b[++A]}else this.lines.set(F,S[L--]);let O=0;for(let F=C.length-1;F>=0;F--)C[F].index+=O,this.lines.onInsertEmitter.fire(C[F]),O+=C[F].amount;const z=Math.max(0,k+x-this.lines.maxLength);z>0&&this.lines.onTrimEmitter.fire(z)}}translateBufferLineToString(d,g,w=0,b){const x=this.lines.get(d);return x?x.translateToString(g,w,b):""}getWrappedRangeForLine(d){let g=d,w=d;for(;g>0&&this.lines.get(g).isWrapped;)g--;for(;w+1<this.lines.length&&this.lines.get(w+1).isWrapped;)w++;return{first:g,last:w}}setupTabStops(d){for(d!=null?this.tabs[d]||(d=this.prevStop(d)):(this.tabs={},d=0);d<this._cols;d+=this._optionsService.rawOptions.tabStopWidth)this.tabs[d]=!0}prevStop(d){for(d==null&&(d=this.x);!this.tabs[--d]&&d>0;);return d>=this._cols?this._cols-1:d<0?0:d}nextStop(d){for(d==null&&(d=this.x);!this.tabs[++d]&&d<this._cols;);return d>=this._cols?this._cols-1:d<0?0:d}clearMarkers(d){this._isClearing=!0;for(let g=0;g<this.markers.length;g++)this.markers[g].line===d&&(this.markers[g].dispose(),this.markers.splice(g--,1));this._isClearing=!1}clearAllMarkers(){this._isClearing=!0;for(let d=0;d<this.markers.length;d++)this.markers[d].dispose(),this.markers.splice(d--,1);this._isClearing=!1}addMarker(d){const g=new h.Marker(d);return this.markers.push(g),g.register(this.lines.onTrim(w=>{g.line-=w,g.line<0&&g.dispose()})),g.register(this.lines.onInsert(w=>{g.line>=w.index&&(g.line+=w.amount)})),g.register(this.lines.onDelete(w=>{g.line>=w.index&&g.line<w.index+w.amount&&g.dispose(),g.line>w.index&&(g.line-=w.amount)})),g.register(g.onDispose(()=>this._removeMarker(g))),g}_removeMarker(d){this._isClearing||this.markers.splice(this.markers.indexOf(d),1)}}},8437:(l,s,o)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.BufferLine=s.DEFAULT_ATTR_DATA=void 0;const c=o(3734),f=o(511),u=o(643),p=o(482);s.DEFAULT_ATTR_DATA=Object.freeze(new c.AttributeData);let _=0;class y{constructor(h,m,d=!1){this.isWrapped=d,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(3*h);const g=m||f.CellData.fromCharData([0,u.NULL_CELL_CHAR,u.NULL_CELL_WIDTH,u.NULL_CELL_CODE]);for(let w=0;w<h;++w)this.setCell(w,g);this.length=h}get(h){const m=this._data[3*h+0],d=2097151&m;return[this._data[3*h+1],2097152&m?this._combined[h]:d?(0,p.stringFromCodePoint)(d):"",m>>22,2097152&m?this._combined[h].charCodeAt(this._combined[h].length-1):d]}set(h,m){this._data[3*h+1]=m[u.CHAR_DATA_ATTR_INDEX],m[u.CHAR_DATA_CHAR_INDEX].length>1?(this._combined[h]=m[1],this._data[3*h+0]=2097152|h|m[u.CHAR_DATA_WIDTH_INDEX]<<22):this._data[3*h+0]=m[u.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|m[u.CHAR_DATA_WIDTH_INDEX]<<22}getWidth(h){return this._data[3*h+0]>>22}hasWidth(h){return 12582912&this._data[3*h+0]}getFg(h){return this._data[3*h+1]}getBg(h){return this._data[3*h+2]}hasContent(h){return 4194303&this._data[3*h+0]}getCodePoint(h){const m=this._data[3*h+0];return 2097152&m?this._combined[h].charCodeAt(this._combined[h].length-1):2097151&m}isCombined(h){return 2097152&this._data[3*h+0]}getString(h){const m=this._data[3*h+0];return 2097152&m?this._combined[h]:2097151&m?(0,p.stringFromCodePoint)(2097151&m):""}isProtected(h){return 536870912&this._data[3*h+2]}loadCell(h,m){return _=3*h,m.content=this._data[_+0],m.fg=this._data[_+1],m.bg=this._data[_+2],2097152&m.content&&(m.combinedData=this._combined[h]),268435456&m.bg&&(m.extended=this._extendedAttrs[h]),m}setCell(h,m){2097152&m.content&&(this._combined[h]=m.combinedData),268435456&m.bg&&(this._extendedAttrs[h]=m.extended),this._data[3*h+0]=m.content,this._data[3*h+1]=m.fg,this._data[3*h+2]=m.bg}setCellFromCodepoint(h,m,d,g){268435456&g.bg&&(this._extendedAttrs[h]=g.extended),this._data[3*h+0]=m|d<<22,this._data[3*h+1]=g.fg,this._data[3*h+2]=g.bg}addCodepointToCell(h,m,d){let g=this._data[3*h+0];2097152&g?this._combined[h]+=(0,p.stringFromCodePoint)(m):2097151&g?(this._combined[h]=(0,p.stringFromCodePoint)(2097151&g)+(0,p.stringFromCodePoint)(m),g&=-2097152,g|=2097152):g=m|4194304,d&&(g&=-12582913,g|=d<<22),this._data[3*h+0]=g}insertCells(h,m,d){if((h%=this.length)&&this.getWidth(h-1)===2&&this.setCellFromCodepoint(h-1,0,1,d),m<this.length-h){const g=new f.CellData;for(let w=this.length-h-m-1;w>=0;--w)this.setCell(h+m+w,this.loadCell(h+w,g));for(let w=0;w<m;++w)this.setCell(h+w,d)}else for(let g=h;g<this.length;++g)this.setCell(g,d);this.getWidth(this.length-1)===2&&this.setCellFromCodepoint(this.length-1,0,1,d)}deleteCells(h,m,d){if(h%=this.length,m<this.length-h){const g=new f.CellData;for(let w=0;w<this.length-h-m;++w)this.setCell(h+w,this.loadCell(h+m+w,g));for(let w=this.length-m;w<this.length;++w)this.setCell(w,d)}else for(let g=h;g<this.length;++g)this.setCell(g,d);h&&this.getWidth(h-1)===2&&this.setCellFromCodepoint(h-1,0,1,d),this.getWidth(h)!==0||this.hasContent(h)||this.setCellFromCodepoint(h,0,1,d)}replaceCells(h,m,d,g=!1){if(g)for(h&&this.getWidth(h-1)===2&&!this.isProtected(h-1)&&this.setCellFromCodepoint(h-1,0,1,d),m<this.length&&this.getWidth(m-1)===2&&!this.isProtected(m)&&this.setCellFromCodepoint(m,0,1,d);h<m&&h<this.length;)this.isProtected(h)||this.setCell(h,d),h++;else for(h&&this.getWidth(h-1)===2&&this.setCellFromCodepoint(h-1,0,1,d),m<this.length&&this.getWidth(m-1)===2&&this.setCellFromCodepoint(m,0,1,d);h<m&&h<this.length;)this.setCell(h++,d)}resize(h,m){if(h===this.length)return 4*this._data.length*2<this._data.buffer.byteLength;const d=3*h;if(h>this.length){if(this._data.buffer.byteLength>=4*d)this._data=new Uint32Array(this._data.buffer,0,d);else{const g=new Uint32Array(d);g.set(this._data),this._data=g}for(let g=this.length;g<h;++g)this.setCell(g,m)}else{this._data=this._data.subarray(0,d);const g=Object.keys(this._combined);for(let b=0;b<g.length;b++){const x=parseInt(g[b],10);x>=h&&delete this._combined[x]}const w=Object.keys(this._extendedAttrs);for(let b=0;b<w.length;b++){const x=parseInt(w[b],10);x>=h&&delete this._extendedAttrs[x]}}return this.length=h,4*d*2<this._data.buffer.byteLength}cleanupMemory(){if(4*this._data.length*2<this._data.buffer.byteLength){const h=new Uint32Array(this._data.length);return h.set(this._data),this._data=h,1}return 0}fill(h,m=!1){if(m)for(let d=0;d<this.length;++d)this.isProtected(d)||this.setCell(d,h);else{this._combined={},this._extendedAttrs={};for(let d=0;d<this.length;++d)this.setCell(d,h)}}copyFrom(h){this.length!==h.length?this._data=new Uint32Array(h._data):this._data.set(h._data),this.length=h.length,this._combined={};for(const m in h._combined)this._combined[m]=h._combined[m];this._extendedAttrs={};for(const m in h._extendedAttrs)this._extendedAttrs[m]=h._extendedAttrs[m];this.isWrapped=h.isWrapped}clone(){const h=new y(0);h._data=new Uint32Array(this._data),h.length=this.length;for(const m in this._combined)h._combined[m]=this._combined[m];for(const m in this._extendedAttrs)h._extendedAttrs[m]=this._extendedAttrs[m];return h.isWrapped=this.isWrapped,h}getTrimmedLength(){for(let h=this.length-1;h>=0;--h)if(4194303&this._data[3*h+0])return h+(this._data[3*h+0]>>22);return 0}getNoBgTrimmedLength(){for(let h=this.length-1;h>=0;--h)if(4194303&this._data[3*h+0]||50331648&this._data[3*h+2])return h+(this._data[3*h+0]>>22);return 0}copyCellsFrom(h,m,d,g,w){const b=h._data;if(w)for(let C=g-1;C>=0;C--){for(let S=0;S<3;S++)this._data[3*(d+C)+S]=b[3*(m+C)+S];268435456&b[3*(m+C)+2]&&(this._extendedAttrs[d+C]=h._extendedAttrs[m+C])}else for(let C=0;C<g;C++){for(let S=0;S<3;S++)this._data[3*(d+C)+S]=b[3*(m+C)+S];268435456&b[3*(m+C)+2]&&(this._extendedAttrs[d+C]=h._extendedAttrs[m+C])}const x=Object.keys(h._combined);for(let C=0;C<x.length;C++){const S=parseInt(x[C],10);S>=m&&(this._combined[S-m+d]=h._combined[S])}}translateToString(h,m,d,g){m=m??0,d=d??this.length,h&&(d=Math.min(d,this.getTrimmedLength())),g&&(g.length=0);let w="";for(;m<d;){const b=this._data[3*m+0],x=2097151&b,C=2097152&b?this._combined[m]:x?(0,p.stringFromCodePoint)(x):u.WHITESPACE_CELL_CHAR;if(w+=C,g)for(let S=0;S<C.length;++S)g.push(m);m+=b>>22||1}return g&&g.push(m),w}}s.BufferLine=y},4841:(l,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.getRangeLength=void 0,s.getRangeLength=function(o,c){if(o.start.y>o.end.y)throw new Error(`Buffer range end (${o.end.x}, ${o.end.y}) cannot be before start (${o.start.x}, ${o.start.y})`);return c*(o.end.y-o.start.y)+(o.end.x-o.start.x+1)}},4634:(l,s)=>{function o(c,f,u){if(f===c.length-1)return c[f].getTrimmedLength();const p=!c[f].hasContent(u-1)&&c[f].getWidth(u-1)===1,_=c[f+1].getWidth(0)===2;return p&&_?u-1:u}Object.defineProperty(s,"__esModule",{value:!0}),s.getWrappedLineTrimmedLength=s.reflowSmallerGetNewLineLengths=s.reflowLargerApplyNewLayout=s.reflowLargerCreateNewLayout=s.reflowLargerGetLinesToRemove=void 0,s.reflowLargerGetLinesToRemove=function(c,f,u,p,_){const y=[];for(let v=0;v<c.length-1;v++){let h=v,m=c.get(++h);if(!m.isWrapped)continue;const d=[c.get(v)];for(;h<c.length&&m.isWrapped;)d.push(m),m=c.get(++h);if(p>=v&&p<h){v+=d.length-1;continue}let g=0,w=o(d,g,f),b=1,x=0;for(;b<d.length;){const S=o(d,b,f),k=S-x,L=u-w,A=Math.min(k,L);d[g].copyCellsFrom(d[b],x,w,A,!1),w+=A,w===u&&(g++,w=0),x+=A,x===S&&(b++,x=0),w===0&&g!==0&&d[g-1].getWidth(u-1)===2&&(d[g].copyCellsFrom(d[g-1],u-1,w++,1,!1),d[g-1].setCell(u-1,_))}d[g].replaceCells(w,u,_);let C=0;for(let S=d.length-1;S>0&&(S>g||d[S].getTrimmedLength()===0);S--)C++;C>0&&(y.push(v+d.length-C),y.push(C)),v+=d.length-1}return y},s.reflowLargerCreateNewLayout=function(c,f){const u=[];let p=0,_=f[p],y=0;for(let v=0;v<c.length;v++)if(_===v){const h=f[++p];c.onDeleteEmitter.fire({index:v-y,amount:h}),v+=h-1,y+=h,_=f[++p]}else u.push(v);return{layout:u,countRemoved:y}},s.reflowLargerApplyNewLayout=function(c,f){const u=[];for(let p=0;p<f.length;p++)u.push(c.get(f[p]));for(let p=0;p<u.length;p++)c.set(p,u[p]);c.length=f.length},s.reflowSmallerGetNewLineLengths=function(c,f,u){const p=[],_=c.map((m,d)=>o(c,d,f)).reduce((m,d)=>m+d);let y=0,v=0,h=0;for(;h<_;){if(_-h<u){p.push(_-h);break}y+=u;const m=o(c,v,f);y>m&&(y-=m,v++);const d=c[v].getWidth(y-1)===2;d&&y--;const g=d?u-1:u;p.push(g),h+=g}return p},s.getWrappedLineTrimmedLength=o},5295:(l,s,o)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.BufferSet=void 0;const c=o(8460),f=o(844),u=o(9092);class p extends f.Disposable{constructor(y,v){super(),this._optionsService=y,this._bufferService=v,this._onBufferActivate=this.register(new c.EventEmitter),this.onBufferActivate=this._onBufferActivate.event,this.reset(),this.register(this._optionsService.onSpecificOptionChange("scrollback",()=>this.resize(this._bufferService.cols,this._bufferService.rows))),this.register(this._optionsService.onSpecificOptionChange("tabStopWidth",()=>this.setupTabStops()))}reset(){this._normal=new u.Buffer(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new u.Buffer(!1,this._optionsService,this._bufferService),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}),this.setupTabStops()}get alt(){return this._alt}get active(){return this._activeBuffer}get normal(){return this._normal}activateNormalBuffer(){this._activeBuffer!==this._normal&&(this._normal.x=this._alt.x,this._normal.y=this._alt.y,this._alt.clearAllMarkers(),this._alt.clear(),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}))}activateAltBuffer(y){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(y),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,v){this._normal.resize(y,v),this._alt.resize(y,v),this.setupTabStops(y)}setupTabStops(y){this._normal.setupTabStops(y),this._alt.setupTabStops(y)}}s.BufferSet=p},511:(l,s,o)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.CellData=void 0;const c=o(482),f=o(643),u=o(3734);class p extends u.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new u.ExtendedAttrs,this.combinedData=""}static fromCharData(y){const v=new p;return v.setFromCharData(y),v}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(y){this.fg=y[f.CHAR_DATA_ATTR_INDEX],this.bg=0;let v=!1;if(y[f.CHAR_DATA_CHAR_INDEX].length>2)v=!0;else if(y[f.CHAR_DATA_CHAR_INDEX].length===2){const h=y[f.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=h&&h<=56319){const m=y[f.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=m&&m<=57343?this.content=1024*(h-55296)+m-56320+65536|y[f.CHAR_DATA_WIDTH_INDEX]<<22:v=!0}else v=!0}else this.content=y[f.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|y[f.CHAR_DATA_WIDTH_INDEX]<<22;v&&(this.combinedData=y[f.CHAR_DATA_CHAR_INDEX],this.content=2097152|y[f.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}s.CellData=p},643:(l,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.WHITESPACE_CELL_CODE=s.WHITESPACE_CELL_WIDTH=s.WHITESPACE_CELL_CHAR=s.NULL_CELL_CODE=s.NULL_CELL_WIDTH=s.NULL_CELL_CHAR=s.CHAR_DATA_CODE_INDEX=s.CHAR_DATA_WIDTH_INDEX=s.CHAR_DATA_CHAR_INDEX=s.CHAR_DATA_ATTR_INDEX=s.DEFAULT_EXT=s.DEFAULT_ATTR=s.DEFAULT_COLOR=void 0,s.DEFAULT_COLOR=0,s.DEFAULT_ATTR=256|s.DEFAULT_COLOR<<9,s.DEFAULT_EXT=0,s.CHAR_DATA_ATTR_INDEX=0,s.CHAR_DATA_CHAR_INDEX=1,s.CHAR_DATA_WIDTH_INDEX=2,s.CHAR_DATA_CODE_INDEX=3,s.NULL_CELL_CHAR="",s.NULL_CELL_WIDTH=1,s.NULL_CELL_CODE=0,s.WHITESPACE_CELL_CHAR=" ",s.WHITESPACE_CELL_WIDTH=1,s.WHITESPACE_CELL_CODE=32},4863:(l,s,o)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.Marker=void 0;const c=o(8460),f=o(844);class u{get id(){return this._id}constructor(_){this.line=_,this.isDisposed=!1,this._disposables=[],this._id=u._nextId++,this._onDispose=this.register(new c.EventEmitter),this.onDispose=this._onDispose.event}dispose(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire(),(0,f.disposeArray)(this._disposables),this._disposables.length=0)}register(_){return this._disposables.push(_),_}}s.Marker=u,u._nextId=1},7116:(l,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.DEFAULT_CHARSET=s.CHARSETS=void 0,s.CHARSETS={},s.DEFAULT_CHARSET=s.CHARSETS.B,s.CHARSETS[0]={"`":"◆",a:"▒",b:"␉",c:"␌",d:"␍",e:"␊",f:"°",g:"±",h:"",i:"␋",j:"┘",k:"┐",l:"┌",m:"└",n:"┼",o:"⎺",p:"⎻",q:"─",r:"⎼",s:"⎽",t:"├",u:"┤",v:"┴",w:"┬",x:"│",y:"≤",z:"≥","{":"π","|":"≠","}":"£","~":"·"},s.CHARSETS.A={"#":"£"},s.CHARSETS.B=void 0,s.CHARSETS[4]={"#":"£","@":"¾","[":"ij","\\":"½","]":"|","{":"¨","|":"f","}":"¼","~":"´"},s.CHARSETS.C=s.CHARSETS[5]={"[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},s.CHARSETS.R={"#":"£","@":"à","[":"°","\\":"ç","]":"§","{":"é","|":"ù","}":"è","~":"¨"},s.CHARSETS.Q={"@":"à","[":"â","\\":"ç","]":"ê","^":"î","`":"ô","{":"é","|":"ù","}":"è","~":"û"},s.CHARSETS.K={"@":"§","[":"Ä","\\":"Ö","]":"Ü","{":"ä","|":"ö","}":"ü","~":"ß"},s.CHARSETS.Y={"#":"£","@":"§","[":"°","\\":"ç","]":"é","`":"ù","{":"à","|":"ò","}":"è","~":"ì"},s.CHARSETS.E=s.CHARSETS[6]={"@":"Ä","[":"Æ","\\":"Ø","]":"Å","^":"Ü","`":"ä","{":"æ","|":"ø","}":"å","~":"ü"},s.CHARSETS.Z={"#":"£","@":"§","[":"¡","\\":"Ñ","]":"¿","{":"°","|":"ñ","}":"ç"},s.CHARSETS.H=s.CHARSETS[7]={"@":"É","[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},s.CHARSETS["="]={"#":"ù","@":"à","[":"é","\\":"ç","]":"ê","^":"î",_:"è","`":"ô","{":"ä","|":"ö","}":"ü","~":"û"}},2584:(l,s)=>{var o,c,f;Object.defineProperty(s,"__esModule",{value:!0}),s.C1_ESCAPED=s.C1=s.C0=void 0,function(u){u.NUL="\0",u.SOH="",u.STX="",u.ETX="",u.EOT="",u.ENQ="",u.ACK="",u.BEL="\x07",u.BS="\b",u.HT=" ",u.LF=`
|
|
59
59
|
`,u.VT="\v",u.FF="\f",u.CR="\r",u.SO="",u.SI="",u.DLE="",u.DC1="",u.DC2="",u.DC3="",u.DC4="",u.NAK="",u.SYN="",u.ETB="",u.CAN="",u.EM="",u.SUB="",u.ESC="\x1B",u.FS="",u.GS="",u.RS="",u.US="",u.SP=" ",u.DEL=""}(o||(s.C0=o={})),function(u){u.PAD="",u.HOP="",u.BPH="",u.NBH="",u.IND="",u.NEL="
",u.SSA="",u.ESA="",u.HTS="",u.HTJ="",u.VTS="",u.PLD="",u.PLU="",u.RI="",u.SS2="",u.SS3="",u.DCS="",u.PU1="",u.PU2="",u.STS="",u.CCH="",u.MW="",u.SPA="",u.EPA="",u.SOS="",u.SGCI="",u.SCI="",u.CSI="",u.ST="",u.OSC="",u.PM="",u.APC=""}(c||(s.C1=c={})),function(u){u.ST=`${o.ESC}\\`}(f||(s.C1_ESCAPED=f={}))},7399:(l,s,o)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.evaluateKeyboardEvent=void 0;const c=o(2584),f={48:["0",")"],49:["1","!"],50:["2","@"],51:["3","#"],52:["4","$"],53:["5","%"],54:["6","^"],55:["7","&"],56:["8","*"],57:["9","("],186:[";",":"],187:["=","+"],188:[",","<"],189:["-","_"],190:[".",">"],191:["/","?"],192:["`","~"],219:["[","{"],220:["\\","|"],221:["]","}"],222:["'",'"']};s.evaluateKeyboardEvent=function(u,p,_,y){const v={type:0,cancel:!1,key:void 0},h=(u.shiftKey?1:0)|(u.altKey?2:0)|(u.ctrlKey?4:0)|(u.metaKey?8:0);switch(u.keyCode){case 0:u.key==="UIKeyInputUpArrow"?v.key=p?c.C0.ESC+"OA":c.C0.ESC+"[A":u.key==="UIKeyInputLeftArrow"?v.key=p?c.C0.ESC+"OD":c.C0.ESC+"[D":u.key==="UIKeyInputRightArrow"?v.key=p?c.C0.ESC+"OC":c.C0.ESC+"[C":u.key==="UIKeyInputDownArrow"&&(v.key=p?c.C0.ESC+"OB":c.C0.ESC+"[B");break;case 8:v.key=u.ctrlKey?"\b":c.C0.DEL,u.altKey&&(v.key=c.C0.ESC+v.key);break;case 9:if(u.shiftKey){v.key=c.C0.ESC+"[Z";break}v.key=c.C0.HT,v.cancel=!0;break;case 13:v.key=u.altKey?c.C0.ESC+c.C0.CR:c.C0.CR,v.cancel=!0;break;case 27:v.key=c.C0.ESC,u.altKey&&(v.key=c.C0.ESC+c.C0.ESC),v.cancel=!0;break;case 37:if(u.metaKey)break;h?(v.key=c.C0.ESC+"[1;"+(h+1)+"D",v.key===c.C0.ESC+"[1;3D"&&(v.key=c.C0.ESC+(_?"b":"[1;5D"))):v.key=p?c.C0.ESC+"OD":c.C0.ESC+"[D";break;case 39:if(u.metaKey)break;h?(v.key=c.C0.ESC+"[1;"+(h+1)+"C",v.key===c.C0.ESC+"[1;3C"&&(v.key=c.C0.ESC+(_?"f":"[1;5C"))):v.key=p?c.C0.ESC+"OC":c.C0.ESC+"[C";break;case 38:if(u.metaKey)break;h?(v.key=c.C0.ESC+"[1;"+(h+1)+"A",_||v.key!==c.C0.ESC+"[1;3A"||(v.key=c.C0.ESC+"[1;5A")):v.key=p?c.C0.ESC+"OA":c.C0.ESC+"[A";break;case 40:if(u.metaKey)break;h?(v.key=c.C0.ESC+"[1;"+(h+1)+"B",_||v.key!==c.C0.ESC+"[1;3B"||(v.key=c.C0.ESC+"[1;5B")):v.key=p?c.C0.ESC+"OB":c.C0.ESC+"[B";break;case 45:u.shiftKey||u.ctrlKey||(v.key=c.C0.ESC+"[2~");break;case 46:v.key=h?c.C0.ESC+"[3;"+(h+1)+"~":c.C0.ESC+"[3~";break;case 36:v.key=h?c.C0.ESC+"[1;"+(h+1)+"H":p?c.C0.ESC+"OH":c.C0.ESC+"[H";break;case 35:v.key=h?c.C0.ESC+"[1;"+(h+1)+"F":p?c.C0.ESC+"OF":c.C0.ESC+"[F";break;case 33:u.shiftKey?v.type=2:u.ctrlKey?v.key=c.C0.ESC+"[5;"+(h+1)+"~":v.key=c.C0.ESC+"[5~";break;case 34:u.shiftKey?v.type=3:u.ctrlKey?v.key=c.C0.ESC+"[6;"+(h+1)+"~":v.key=c.C0.ESC+"[6~";break;case 112:v.key=h?c.C0.ESC+"[1;"+(h+1)+"P":c.C0.ESC+"OP";break;case 113:v.key=h?c.C0.ESC+"[1;"+(h+1)+"Q":c.C0.ESC+"OQ";break;case 114:v.key=h?c.C0.ESC+"[1;"+(h+1)+"R":c.C0.ESC+"OR";break;case 115:v.key=h?c.C0.ESC+"[1;"+(h+1)+"S":c.C0.ESC+"OS";break;case 116:v.key=h?c.C0.ESC+"[15;"+(h+1)+"~":c.C0.ESC+"[15~";break;case 117:v.key=h?c.C0.ESC+"[17;"+(h+1)+"~":c.C0.ESC+"[17~";break;case 118:v.key=h?c.C0.ESC+"[18;"+(h+1)+"~":c.C0.ESC+"[18~";break;case 119:v.key=h?c.C0.ESC+"[19;"+(h+1)+"~":c.C0.ESC+"[19~";break;case 120:v.key=h?c.C0.ESC+"[20;"+(h+1)+"~":c.C0.ESC+"[20~";break;case 121:v.key=h?c.C0.ESC+"[21;"+(h+1)+"~":c.C0.ESC+"[21~";break;case 122:v.key=h?c.C0.ESC+"[23;"+(h+1)+"~":c.C0.ESC+"[23~";break;case 123:v.key=h?c.C0.ESC+"[24;"+(h+1)+"~":c.C0.ESC+"[24~";break;default:if(!u.ctrlKey||u.shiftKey||u.altKey||u.metaKey)if(_&&!y||!u.altKey||u.metaKey)!_||u.altKey||u.ctrlKey||u.shiftKey||!u.metaKey?u.key&&!u.ctrlKey&&!u.altKey&&!u.metaKey&&u.keyCode>=48&&u.key.length===1?v.key=u.key:u.key&&u.ctrlKey&&(u.key==="_"&&(v.key=c.C0.US),u.key==="@"&&(v.key=c.C0.NUL)):u.keyCode===65&&(v.type=1);else{const m=f[u.keyCode],d=m==null?void 0:m[u.shiftKey?1:0];if(d)v.key=c.C0.ESC+d;else if(u.keyCode>=65&&u.keyCode<=90){const g=u.ctrlKey?u.keyCode-64:u.keyCode+32;let w=String.fromCharCode(g);u.shiftKey&&(w=w.toUpperCase()),v.key=c.C0.ESC+w}else if(u.keyCode===32)v.key=c.C0.ESC+(u.ctrlKey?c.C0.NUL:" ");else if(u.key==="Dead"&&u.code.startsWith("Key")){let g=u.code.slice(3,4);u.shiftKey||(g=g.toLowerCase()),v.key=c.C0.ESC+g,v.cancel=!0}}else u.keyCode>=65&&u.keyCode<=90?v.key=String.fromCharCode(u.keyCode-64):u.keyCode===32?v.key=c.C0.NUL:u.keyCode>=51&&u.keyCode<=55?v.key=String.fromCharCode(u.keyCode-51+27):u.keyCode===56?v.key=c.C0.DEL:u.keyCode===219?v.key=c.C0.ESC:u.keyCode===220?v.key=c.C0.FS:u.keyCode===221&&(v.key=c.C0.GS)}return v}},482:(l,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.Utf8ToUtf32=s.StringToUtf32=s.utf32ToString=s.stringFromCodePoint=void 0,s.stringFromCodePoint=function(o){return o>65535?(o-=65536,String.fromCharCode(55296+(o>>10))+String.fromCharCode(o%1024+56320)):String.fromCharCode(o)},s.utf32ToString=function(o,c=0,f=o.length){let u="";for(let p=c;p<f;++p){let _=o[p];_>65535?(_-=65536,u+=String.fromCharCode(55296+(_>>10))+String.fromCharCode(_%1024+56320)):u+=String.fromCharCode(_)}return u},s.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(o,c){const f=o.length;if(!f)return 0;let u=0,p=0;if(this._interim){const _=o.charCodeAt(p++);56320<=_&&_<=57343?c[u++]=1024*(this._interim-55296)+_-56320+65536:(c[u++]=this._interim,c[u++]=_),this._interim=0}for(let _=p;_<f;++_){const y=o.charCodeAt(_);if(55296<=y&&y<=56319){if(++_>=f)return this._interim=y,u;const v=o.charCodeAt(_);56320<=v&&v<=57343?c[u++]=1024*(y-55296)+v-56320+65536:(c[u++]=y,c[u++]=v)}else y!==65279&&(c[u++]=y)}return u}},s.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(o,c){const f=o.length;if(!f)return 0;let u,p,_,y,v=0,h=0,m=0;if(this.interim[0]){let w=!1,b=this.interim[0];b&=(224&b)==192?31:(240&b)==224?15:7;let x,C=0;for(;(x=63&this.interim[++C])&&C<4;)b<<=6,b|=x;const S=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,k=S-C;for(;m<k;){if(m>=f)return 0;if(x=o[m++],(192&x)!=128){m--,w=!0;break}this.interim[C++]=x,b<<=6,b|=63&x}w||(S===2?b<128?m--:c[v++]=b:S===3?b<2048||b>=55296&&b<=57343||b===65279||(c[v++]=b):b<65536||b>1114111||(c[v++]=b)),this.interim.fill(0)}const d=f-4;let g=m;for(;g<f;){for(;!(!(g<d)||128&(u=o[g])||128&(p=o[g+1])||128&(_=o[g+2])||128&(y=o[g+3]));)c[v++]=u,c[v++]=p,c[v++]=_,c[v++]=y,g+=4;if(u=o[g++],u<128)c[v++]=u;else if((224&u)==192){if(g>=f)return this.interim[0]=u,v;if(p=o[g++],(192&p)!=128){g--;continue}if(h=(31&u)<<6|63&p,h<128){g--;continue}c[v++]=h}else if((240&u)==224){if(g>=f)return this.interim[0]=u,v;if(p=o[g++],(192&p)!=128){g--;continue}if(g>=f)return this.interim[0]=u,this.interim[1]=p,v;if(_=o[g++],(192&_)!=128){g--;continue}if(h=(15&u)<<12|(63&p)<<6|63&_,h<2048||h>=55296&&h<=57343||h===65279)continue;c[v++]=h}else if((248&u)==240){if(g>=f)return this.interim[0]=u,v;if(p=o[g++],(192&p)!=128){g--;continue}if(g>=f)return this.interim[0]=u,this.interim[1]=p,v;if(_=o[g++],(192&_)!=128){g--;continue}if(g>=f)return this.interim[0]=u,this.interim[1]=p,this.interim[2]=_,v;if(y=o[g++],(192&y)!=128){g--;continue}if(h=(7&u)<<18|(63&p)<<12|(63&_)<<6|63&y,h<65536||h>1114111)continue;c[v++]=h}}return v}}},225:(l,s,o)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.UnicodeV6=void 0;const c=o(1480),f=[[768,879],[1155,1158],[1160,1161],[1425,1469],[1471,1471],[1473,1474],[1476,1477],[1479,1479],[1536,1539],[1552,1557],[1611,1630],[1648,1648],[1750,1764],[1767,1768],[1770,1773],[1807,1807],[1809,1809],[1840,1866],[1958,1968],[2027,2035],[2305,2306],[2364,2364],[2369,2376],[2381,2381],[2385,2388],[2402,2403],[2433,2433],[2492,2492],[2497,2500],[2509,2509],[2530,2531],[2561,2562],[2620,2620],[2625,2626],[2631,2632],[2635,2637],[2672,2673],[2689,2690],[2748,2748],[2753,2757],[2759,2760],[2765,2765],[2786,2787],[2817,2817],[2876,2876],[2879,2879],[2881,2883],[2893,2893],[2902,2902],[2946,2946],[3008,3008],[3021,3021],[3134,3136],[3142,3144],[3146,3149],[3157,3158],[3260,3260],[3263,3263],[3270,3270],[3276,3277],[3298,3299],[3393,3395],[3405,3405],[3530,3530],[3538,3540],[3542,3542],[3633,3633],[3636,3642],[3655,3662],[3761,3761],[3764,3769],[3771,3772],[3784,3789],[3864,3865],[3893,3893],[3895,3895],[3897,3897],[3953,3966],[3968,3972],[3974,3975],[3984,3991],[3993,4028],[4038,4038],[4141,4144],[4146,4146],[4150,4151],[4153,4153],[4184,4185],[4448,4607],[4959,4959],[5906,5908],[5938,5940],[5970,5971],[6002,6003],[6068,6069],[6071,6077],[6086,6086],[6089,6099],[6109,6109],[6155,6157],[6313,6313],[6432,6434],[6439,6440],[6450,6450],[6457,6459],[6679,6680],[6912,6915],[6964,6964],[6966,6970],[6972,6972],[6978,6978],[7019,7027],[7616,7626],[7678,7679],[8203,8207],[8234,8238],[8288,8291],[8298,8303],[8400,8431],[12330,12335],[12441,12442],[43014,43014],[43019,43019],[43045,43046],[64286,64286],[65024,65039],[65056,65059],[65279,65279],[65529,65531]],u=[[68097,68099],[68101,68102],[68108,68111],[68152,68154],[68159,68159],[119143,119145],[119155,119170],[119173,119179],[119210,119213],[119362,119364],[917505,917505],[917536,917631],[917760,917999]];let p;s.UnicodeV6=class{constructor(){if(this.version="6",!p){p=new Uint8Array(65536),p.fill(1),p[0]=0,p.fill(0,1,32),p.fill(0,127,160),p.fill(2,4352,4448),p[9001]=2,p[9002]=2,p.fill(2,11904,42192),p[12351]=1,p.fill(2,44032,55204),p.fill(2,63744,64256),p.fill(2,65040,65050),p.fill(2,65072,65136),p.fill(2,65280,65377),p.fill(2,65504,65511);for(let _=0;_<f.length;++_)p.fill(0,f[_][0],f[_][1]+1)}}wcwidth(_){return _<32?0:_<127?1:_<65536?p[_]:function(y,v){let h,m=0,d=v.length-1;if(y<v[0][0]||y>v[d][1])return!1;for(;d>=m;)if(h=m+d>>1,y>v[h][1])m=h+1;else{if(!(y<v[h][0]))return!0;d=h-1}return!1}(_,u)?0:_>=131072&&_<=196605||_>=196608&&_<=262141?2:1}charProperties(_,y){let v=this.wcwidth(_),h=v===0&&y!==0;if(h){const m=c.UnicodeService.extractWidth(y);m===0?h=!1:m>v&&(v=m)}return c.UnicodeService.createPropertyValue(0,v,h)}}},5981:(l,s,o)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.WriteBuffer=void 0;const c=o(8460),f=o(844);class u extends f.Disposable{constructor(_){super(),this._action=_,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(_,y){if(y!==void 0&&this._syncCalls>y)return void(this._syncCalls=0);if(this._pendingData+=_.length,this._writeBuffer.push(_),this._callbacks.push(void 0),this._syncCalls++,this._isSyncWriting)return;let v;for(this._isSyncWriting=!0;v=this._writeBuffer.shift();){this._action(v);const h=this._callbacks.shift();h&&h()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(_,y){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+=_.length,this._writeBuffer.push(_),this._callbacks.push(y),void this._innerWrite();setTimeout(()=>this._innerWrite())}this._pendingData+=_.length,this._writeBuffer.push(_),this._callbacks.push(y)}_innerWrite(_=0,y=!0){const v=_||Date.now();for(;this._writeBuffer.length>this._bufferOffset;){const h=this._writeBuffer[this._bufferOffset],m=this._action(h,y);if(m){const g=w=>Date.now()-v>=12?setTimeout(()=>this._innerWrite(0,w)):this._innerWrite(v,w);return void m.catch(w=>(queueMicrotask(()=>{throw w}),Promise.resolve(!1))).then(g)}const d=this._callbacks[this._bufferOffset];if(d&&d(),this._bufferOffset++,this._pendingData-=h.length,Date.now()-v>=12)break}this._writeBuffer.length>this._bufferOffset?(this._bufferOffset>50&&(this._writeBuffer=this._writeBuffer.slice(this._bufferOffset),this._callbacks=this._callbacks.slice(this._bufferOffset),this._bufferOffset=0),setTimeout(()=>this._innerWrite())):(this._writeBuffer.length=0,this._callbacks.length=0,this._pendingData=0,this._bufferOffset=0),this._onWriteParsed.fire()}}s.WriteBuffer=u},5941:(l,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.toRgbString=s.parseColor=void 0;const o=/^([\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 f(u,p){const _=u.toString(16),y=_.length<2?"0"+_:_;switch(p){case 4:return _[0];case 8:return y;case 12:return(y+y).slice(0,3);default:return y+y}}s.parseColor=function(u){if(!u)return;let p=u.toLowerCase();if(p.indexOf("rgb:")===0){p=p.slice(4);const _=o.exec(p);if(_){const y=_[1]?15:_[4]?255:_[7]?4095:65535;return[Math.round(parseInt(_[1]||_[4]||_[7]||_[10],16)/y*255),Math.round(parseInt(_[2]||_[5]||_[8]||_[11],16)/y*255),Math.round(parseInt(_[3]||_[6]||_[9]||_[12],16)/y*255)]}}else if(p.indexOf("#")===0&&(p=p.slice(1),c.exec(p)&&[3,6,9,12].includes(p.length))){const _=p.length/3,y=[0,0,0];for(let v=0;v<3;++v){const h=parseInt(p.slice(_*v,_*v+_),16);y[v]=_===1?h<<4:_===2?h:_===3?h>>4:h>>8}return y}},s.toRgbString=function(u,p=16){const[_,y,v]=u;return`rgb:${f(_,p)}/${f(y,p)}/${f(v,p)}`}},5770:(l,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.PAYLOAD_LIMIT=void 0,s.PAYLOAD_LIMIT=1e7},6351:(l,s,o)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.DcsHandler=s.DcsParser=void 0;const c=o(482),f=o(8742),u=o(5770),p=[];s.DcsParser=class{constructor(){this._handlers=Object.create(null),this._active=p,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=p}registerHandler(y,v){this._handlers[y]===void 0&&(this._handlers[y]=[]);const h=this._handlers[y];return h.push(v),{dispose:()=>{const m=h.indexOf(v);m!==-1&&h.splice(m,1)}}}clearHandler(y){this._handlers[y]&&delete this._handlers[y]}setHandlerFallback(y){this._handlerFb=y}reset(){if(this._active.length)for(let y=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;y>=0;--y)this._active[y].unhook(!1);this._stack.paused=!1,this._active=p,this._ident=0}hook(y,v){if(this.reset(),this._ident=y,this._active=this._handlers[y]||p,this._active.length)for(let h=this._active.length-1;h>=0;h--)this._active[h].hook(v);else this._handlerFb(this._ident,"HOOK",v)}put(y,v,h){if(this._active.length)for(let m=this._active.length-1;m>=0;m--)this._active[m].put(y,v,h);else this._handlerFb(this._ident,"PUT",(0,c.utf32ToString)(y,v,h))}unhook(y,v=!0){if(this._active.length){let h=!1,m=this._active.length-1,d=!1;if(this._stack.paused&&(m=this._stack.loopPosition-1,h=v,d=this._stack.fallThrough,this._stack.paused=!1),!d&&h===!1){for(;m>=0&&(h=this._active[m].unhook(y),h!==!0);m--)if(h instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=m,this._stack.fallThrough=!1,h;m--}for(;m>=0;m--)if(h=this._active[m].unhook(!1),h instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=m,this._stack.fallThrough=!0,h}else this._handlerFb(this._ident,"UNHOOK",y);this._active=p,this._ident=0}};const _=new f.Params;_.addParam(0),s.DcsHandler=class{constructor(y){this._handler=y,this._data="",this._params=_,this._hitLimit=!1}hook(y){this._params=y.length>1||y.params[0]?y.clone():_,this._data="",this._hitLimit=!1}put(y,v,h){this._hitLimit||(this._data+=(0,c.utf32ToString)(y,v,h),this._data.length>u.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}unhook(y){let v=!1;if(this._hitLimit)v=!1;else if(y&&(v=this._handler(this._data,this._params),v instanceof Promise))return v.then(h=>(this._params=_,this._data="",this._hitLimit=!1,h));return this._params=_,this._data="",this._hitLimit=!1,v}}},2015:(l,s,o)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.EscapeSequenceParser=s.VT500_TRANSITION_TABLE=s.TransitionTable=void 0;const c=o(844),f=o(8742),u=o(6242),p=o(6351);class _{constructor(m){this.table=new Uint8Array(m)}setDefault(m,d){this.table.fill(m<<4|d)}add(m,d,g,w){this.table[d<<8|m]=g<<4|w}addMany(m,d,g,w){for(let b=0;b<m.length;b++)this.table[d<<8|m[b]]=g<<4|w}}s.TransitionTable=_;const y=160;s.VT500_TRANSITION_TABLE=function(){const h=new _(4095),m=Array.apply(null,Array(256)).map((C,S)=>S),d=(C,S)=>m.slice(C,S),g=d(32,127),w=d(0,24);w.push(25),w.push.apply(w,d(28,32));const b=d(0,14);let x;for(x in h.setDefault(1,0),h.addMany(g,0,2,0),b)h.addMany([24,26,153,154],x,3,0),h.addMany(d(128,144),x,3,0),h.addMany(d(144,152),x,3,0),h.add(156,x,0,0),h.add(27,x,11,1),h.add(157,x,4,8),h.addMany([152,158,159],x,0,7),h.add(155,x,11,3),h.add(144,x,11,9);return h.addMany(w,0,3,0),h.addMany(w,1,3,1),h.add(127,1,0,1),h.addMany(w,8,0,8),h.addMany(w,3,3,3),h.add(127,3,0,3),h.addMany(w,4,3,4),h.add(127,4,0,4),h.addMany(w,6,3,6),h.addMany(w,5,3,5),h.add(127,5,0,5),h.addMany(w,2,3,2),h.add(127,2,0,2),h.add(93,1,4,8),h.addMany(g,8,5,8),h.add(127,8,5,8),h.addMany([156,27,24,26,7],8,6,0),h.addMany(d(28,32),8,0,8),h.addMany([88,94,95],1,0,7),h.addMany(g,7,0,7),h.addMany(w,7,0,7),h.add(156,7,0,0),h.add(127,7,0,7),h.add(91,1,11,3),h.addMany(d(64,127),3,7,0),h.addMany(d(48,60),3,8,4),h.addMany([60,61,62,63],3,9,4),h.addMany(d(48,60),4,8,4),h.addMany(d(64,127),4,7,0),h.addMany([60,61,62,63],4,0,6),h.addMany(d(32,64),6,0,6),h.add(127,6,0,6),h.addMany(d(64,127),6,0,0),h.addMany(d(32,48),3,9,5),h.addMany(d(32,48),5,9,5),h.addMany(d(48,64),5,0,6),h.addMany(d(64,127),5,7,0),h.addMany(d(32,48),4,9,5),h.addMany(d(32,48),1,9,2),h.addMany(d(32,48),2,9,2),h.addMany(d(48,127),2,10,0),h.addMany(d(48,80),1,10,0),h.addMany(d(81,88),1,10,0),h.addMany([89,90,92],1,10,0),h.addMany(d(96,127),1,10,0),h.add(80,1,11,9),h.addMany(w,9,0,9),h.add(127,9,0,9),h.addMany(d(28,32),9,0,9),h.addMany(d(32,48),9,9,12),h.addMany(d(48,60),9,8,10),h.addMany([60,61,62,63],9,9,10),h.addMany(w,11,0,11),h.addMany(d(32,128),11,0,11),h.addMany(d(28,32),11,0,11),h.addMany(w,10,0,10),h.add(127,10,0,10),h.addMany(d(28,32),10,0,10),h.addMany(d(48,60),10,8,10),h.addMany([60,61,62,63],10,0,11),h.addMany(d(32,48),10,9,12),h.addMany(w,12,0,12),h.add(127,12,0,12),h.addMany(d(28,32),12,0,12),h.addMany(d(32,48),12,9,12),h.addMany(d(48,64),12,0,11),h.addMany(d(64,127),12,12,13),h.addMany(d(64,127),10,12,13),h.addMany(d(64,127),9,12,13),h.addMany(w,13,13,13),h.addMany(g,13,13,13),h.add(127,13,0,13),h.addMany([27,156,24,26],13,14,0),h.add(y,0,2,0),h.add(y,8,5,8),h.add(y,6,0,6),h.add(y,11,0,11),h.add(y,13,13,13),h}();class v extends c.Disposable{constructor(m=s.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 f.Params,this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._printHandlerFb=(d,g,w)=>{},this._executeHandlerFb=d=>{},this._csiHandlerFb=(d,g)=>{},this._escHandlerFb=d=>{},this._errorHandlerFb=d=>d,this._printHandler=this._printHandlerFb,this._executeHandlers=Object.create(null),this._csiHandlers=Object.create(null),this._escHandlers=Object.create(null),this.register((0,c.toDisposable)(()=>{this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null)})),this._oscParser=this.register(new u.OscParser),this._dcsParser=this.register(new p.DcsParser),this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:"\\"},()=>!0)}_identifier(m,d=[64,126]){let g=0;if(m.prefix){if(m.prefix.length>1)throw new Error("only one byte as prefix supported");if(g=m.prefix.charCodeAt(0),g&&60>g||g>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 b=0;b<m.intermediates.length;++b){const x=m.intermediates.charCodeAt(b);if(32>x||x>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");g<<=8,g|=x}}if(m.final.length!==1)throw new Error("final must be a single byte");const w=m.final.charCodeAt(0);if(d[0]>w||w>d[1])throw new Error(`final must be in range ${d[0]} .. ${d[1]}`);return g<<=8,g|=w,g}identToString(m){const d=[];for(;m;)d.push(String.fromCharCode(255&m)),m>>=8;return d.reverse().join("")}setPrintHandler(m){this._printHandler=m}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(m,d){const g=this._identifier(m,[48,126]);this._escHandlers[g]===void 0&&(this._escHandlers[g]=[]);const w=this._escHandlers[g];return w.push(d),{dispose:()=>{const b=w.indexOf(d);b!==-1&&w.splice(b,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,d){this._executeHandlers[m.charCodeAt(0)]=d}clearExecuteHandler(m){this._executeHandlers[m.charCodeAt(0)]&&delete this._executeHandlers[m.charCodeAt(0)]}setExecuteHandlerFallback(m){this._executeHandlerFb=m}registerCsiHandler(m,d){const g=this._identifier(m);this._csiHandlers[g]===void 0&&(this._csiHandlers[g]=[]);const w=this._csiHandlers[g];return w.push(d),{dispose:()=>{const b=w.indexOf(d);b!==-1&&w.splice(b,1)}}}clearCsiHandler(m){this._csiHandlers[this._identifier(m)]&&delete this._csiHandlers[this._identifier(m)]}setCsiHandlerFallback(m){this._csiHandlerFb=m}registerDcsHandler(m,d){return this._dcsParser.registerHandler(this._identifier(m),d)}clearDcsHandler(m){this._dcsParser.clearHandler(this._identifier(m))}setDcsHandlerFallback(m){this._dcsParser.setHandlerFallback(m)}registerOscHandler(m,d){return this._oscParser.registerHandler(m,d)}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,d,g,w,b){this._parseStack.state=m,this._parseStack.handlers=d,this._parseStack.handlerPos=g,this._parseStack.transition=w,this._parseStack.chunkPos=b}parse(m,d,g){let w,b=0,x=0,C=0;if(this._parseStack.state)if(this._parseStack.state===2)this._parseStack.state=0,C=this._parseStack.chunkPos+1;else{if(g===void 0||this._parseStack.state===1)throw this._parseStack.state=1,new Error("improper continuation due to previous async handler, giving up parsing");const S=this._parseStack.handlers;let k=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(g===!1&&k>-1){for(;k>=0&&(w=S[k](this._params),w!==!0);k--)if(w instanceof Promise)return this._parseStack.handlerPos=k,w}this._parseStack.handlers=[];break;case 4:if(g===!1&&k>-1){for(;k>=0&&(w=S[k](),w!==!0);k--)if(w instanceof Promise)return this._parseStack.handlerPos=k,w}this._parseStack.handlers=[];break;case 6:if(b=m[this._parseStack.chunkPos],w=this._dcsParser.unhook(b!==24&&b!==26,g),w)return w;b===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(b=m[this._parseStack.chunkPos],w=this._oscParser.end(b!==24&&b!==26,g),w)return w;b===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0}this._parseStack.state=0,C=this._parseStack.chunkPos+1,this.precedingJoinState=0,this.currentState=15&this._parseStack.transition}for(let S=C;S<d;++S){switch(b=m[S],x=this._transitions.table[this.currentState<<8|(b<160?b:y)],x>>4){case 2:for(let D=S+1;;++D){if(D>=d||(b=m[D])<32||b>126&&b<y){this._printHandler(m,S,D),S=D-1;break}if(++D>=d||(b=m[D])<32||b>126&&b<y){this._printHandler(m,S,D),S=D-1;break}if(++D>=d||(b=m[D])<32||b>126&&b<y){this._printHandler(m,S,D),S=D-1;break}if(++D>=d||(b=m[D])<32||b>126&&b<y){this._printHandler(m,S,D),S=D-1;break}}break;case 3:this._executeHandlers[b]?this._executeHandlers[b]():this._executeHandlerFb(b),this.precedingJoinState=0;break;case 0:break;case 1:if(this._errorHandler({position:S,code:b,currentState:this.currentState,collect:this._collect,params:this._params,abort:!1}).abort)return;break;case 7:const k=this._csiHandlers[this._collect<<8|b];let L=k?k.length-1:-1;for(;L>=0&&(w=k[L](this._params),w!==!0);L--)if(w instanceof Promise)return this._preserveStack(3,k,L,x,S),w;L<0&&this._csiHandlerFb(this._collect<<8|b,this._params),this.precedingJoinState=0;break;case 8:do switch(b){case 59:this._params.addParam(0);break;case 58:this._params.addSubParam(-1);break;default:this._params.addDigit(b-48)}while(++S<d&&(b=m[S])>47&&b<60);S--;break;case 9:this._collect<<=8,this._collect|=b;break;case 10:const A=this._escHandlers[this._collect<<8|b];let M=A?A.length-1:-1;for(;M>=0&&(w=A[M](),w!==!0);M--)if(w instanceof Promise)return this._preserveStack(4,A,M,x,S),w;M<0&&this._escHandlerFb(this._collect<<8|b),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|b,this._params);break;case 13:for(let D=S+1;;++D)if(D>=d||(b=m[D])===24||b===26||b===27||b>127&&b<y){this._dcsParser.put(m,S,D),S=D-1;break}break;case 14:if(w=this._dcsParser.unhook(b!==24&&b!==26),w)return this._preserveStack(6,[],0,x,S),w;b===27&&(x|=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=S+1;;D++)if(D>=d||(b=m[D])<32||b>127&&b<y){this._oscParser.put(m,S,D),S=D-1;break}break;case 6:if(w=this._oscParser.end(b!==24&&b!==26),w)return this._preserveStack(5,[],0,x,S),w;b===27&&(x|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0}this.currentState=15&x}}}s.EscapeSequenceParser=v},6242:(l,s,o)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.OscHandler=s.OscParser=void 0;const c=o(5770),f=o(482),u=[];s.OscParser=class{constructor(){this._state=0,this._active=u,this._id=-1,this._handlers=Object.create(null),this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}registerHandler(p,_){this._handlers[p]===void 0&&(this._handlers[p]=[]);const y=this._handlers[p];return y.push(_),{dispose:()=>{const v=y.indexOf(_);v!==-1&&y.splice(v,1)}}}clearHandler(p){this._handlers[p]&&delete this._handlers[p]}setHandlerFallback(p){this._handlerFb=p}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=u}reset(){if(this._state===2)for(let p=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;p>=0;--p)this._active[p].end(!1);this._stack.paused=!1,this._active=u,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||u,this._active.length)for(let p=this._active.length-1;p>=0;p--)this._active[p].start();else this._handlerFb(this._id,"START")}_put(p,_,y){if(this._active.length)for(let v=this._active.length-1;v>=0;v--)this._active[v].put(p,_,y);else this._handlerFb(this._id,"PUT",(0,f.utf32ToString)(p,_,y))}start(){this.reset(),this._state=1}put(p,_,y){if(this._state!==3){if(this._state===1)for(;_<y;){const v=p[_++];if(v===59){this._state=2,this._start();break}if(v<48||57<v)return void(this._state=3);this._id===-1&&(this._id=0),this._id=10*this._id+v-48}this._state===2&&y-_>0&&this._put(p,_,y)}}end(p,_=!0){if(this._state!==0){if(this._state!==3)if(this._state===1&&this._start(),this._active.length){let y=!1,v=this._active.length-1,h=!1;if(this._stack.paused&&(v=this._stack.loopPosition-1,y=_,h=this._stack.fallThrough,this._stack.paused=!1),!h&&y===!1){for(;v>=0&&(y=this._active[v].end(p),y!==!0);v--)if(y instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=v,this._stack.fallThrough=!1,y;v--}for(;v>=0;v--)if(y=this._active[v].end(!1),y instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=v,this._stack.fallThrough=!0,y}else this._handlerFb(this._id,"END",p);this._active=u,this._id=-1,this._state=0}}},s.OscHandler=class{constructor(p){this._handler=p,this._data="",this._hitLimit=!1}start(){this._data="",this._hitLimit=!1}put(p,_,y){this._hitLimit||(this._data+=(0,f.utf32ToString)(p,_,y),this._data.length>c.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}end(p){let _=!1;if(this._hitLimit)_=!1;else if(p&&(_=this._handler(this._data),_ instanceof Promise))return _.then(y=>(this._data="",this._hitLimit=!1,y));return this._data="",this._hitLimit=!1,_}}},8742:(l,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.Params=void 0;const o=2147483647;class c{static fromArray(u){const p=new c;if(!u.length)return p;for(let _=Array.isArray(u[0])?1:0;_<u.length;++_){const y=u[_];if(Array.isArray(y))for(let v=0;v<y.length;++v)p.addSubParam(y[v]);else p.addParam(y)}return p}constructor(u=32,p=32){if(this.maxLength=u,this.maxSubParamsLength=p,p>256)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(u),this.length=0,this._subParams=new Int32Array(p),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(u),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}clone(){const u=new c(this.maxLength,this.maxSubParamsLength);return u.params.set(this.params),u.length=this.length,u._subParams.set(this._subParams),u._subParamsLength=this._subParamsLength,u._subParamsIdx.set(this._subParamsIdx),u._rejectDigits=this._rejectDigits,u._rejectSubDigits=this._rejectSubDigits,u._digitIsSub=this._digitIsSub,u}toArray(){const u=[];for(let p=0;p<this.length;++p){u.push(this.params[p]);const _=this._subParamsIdx[p]>>8,y=255&this._subParamsIdx[p];y-_>0&&u.push(Array.prototype.slice.call(this._subParams,_,y))}return u}reset(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}addParam(u){if(this._digitIsSub=!1,this.length>=this.maxLength)this._rejectDigits=!0;else{if(u<-1)throw new Error("values lesser than -1 are not allowed");this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=u>o?o:u}}addSubParam(u){if(this._digitIsSub=!0,this.length)if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength)this._rejectSubDigits=!0;else{if(u<-1)throw new Error("values lesser than -1 are not allowed");this._subParams[this._subParamsLength++]=u>o?o:u,this._subParamsIdx[this.length-1]++}}hasSubParams(u){return(255&this._subParamsIdx[u])-(this._subParamsIdx[u]>>8)>0}getSubParams(u){const p=this._subParamsIdx[u]>>8,_=255&this._subParamsIdx[u];return _-p>0?this._subParams.subarray(p,_):null}getSubParamsAll(){const u={};for(let p=0;p<this.length;++p){const _=this._subParamsIdx[p]>>8,y=255&this._subParamsIdx[p];y-_>0&&(u[p]=this._subParams.slice(_,y))}return u}addDigit(u){let p;if(this._rejectDigits||!(p=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;const _=this._digitIsSub?this._subParams:this.params,y=_[p-1];_[p-1]=~y?Math.min(10*y+u,o):u}}s.Params=c},5741:(l,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.AddonManager=void 0,s.AddonManager=class{constructor(){this._addons=[]}dispose(){for(let o=this._addons.length-1;o>=0;o--)this._addons[o].instance.dispose()}loadAddon(o,c){const f={instance:c,dispose:c.dispose,isDisposed:!1};this._addons.push(f),c.dispose=()=>this._wrappedAddonDispose(f),c.activate(o)}_wrappedAddonDispose(o){if(o.isDisposed)return;let c=-1;for(let f=0;f<this._addons.length;f++)if(this._addons[f]===o){c=f;break}if(c===-1)throw new Error("Could not dispose an addon that has not been loaded");o.isDisposed=!0,o.dispose.apply(o.instance),this._addons.splice(c,1)}}},8771:(l,s,o)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.BufferApiView=void 0;const c=o(3785),f=o(511);s.BufferApiView=class{constructor(u,p){this._buffer=u,this.type=p}init(u){return this._buffer=u,this}get cursorY(){return this._buffer.y}get cursorX(){return this._buffer.x}get viewportY(){return this._buffer.ydisp}get baseY(){return this._buffer.ybase}get length(){return this._buffer.lines.length}getLine(u){const p=this._buffer.lines.get(u);if(p)return new c.BufferLineApiView(p)}getNullCell(){return new f.CellData}}},3785:(l,s,o)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.BufferLineApiView=void 0;const c=o(511);s.BufferLineApiView=class{constructor(f){this._line=f}get isWrapped(){return this._line.isWrapped}get length(){return this._line.length}getCell(f,u){if(!(f<0||f>=this._line.length))return u?(this._line.loadCell(f,u),u):this._line.loadCell(f,new c.CellData)}translateToString(f,u,p){return this._line.translateToString(f,u,p)}}},8285:(l,s,o)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.BufferNamespaceApi=void 0;const c=o(8771),f=o(8460),u=o(844);class p extends u.Disposable{constructor(y){super(),this._core=y,this._onBufferChange=this.register(new f.EventEmitter),this.onBufferChange=this._onBufferChange.event,this._normal=new c.BufferApiView(this._core.buffers.normal,"normal"),this._alternate=new c.BufferApiView(this._core.buffers.alt,"alternate"),this._core.buffers.onBufferActivate(()=>this._onBufferChange.fire(this.active))}get active(){if(this._core.buffers.active===this._core.buffers.normal)return this.normal;if(this._core.buffers.active===this._core.buffers.alt)return this.alternate;throw new Error("Active buffer is neither normal nor alternate")}get normal(){return this._normal.init(this._core.buffers.normal)}get alternate(){return this._alternate.init(this._core.buffers.alt)}}s.BufferNamespaceApi=p},7975:(l,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.ParserApi=void 0,s.ParserApi=class{constructor(o){this._core=o}registerCsiHandler(o,c){return this._core.registerCsiHandler(o,f=>c(f.toArray()))}addCsiHandler(o,c){return this.registerCsiHandler(o,c)}registerDcsHandler(o,c){return this._core.registerDcsHandler(o,(f,u)=>c(f,u.toArray()))}addDcsHandler(o,c){return this.registerDcsHandler(o,c)}registerEscHandler(o,c){return this._core.registerEscHandler(o,c)}addEscHandler(o,c){return this.registerEscHandler(o,c)}registerOscHandler(o,c){return this._core.registerOscHandler(o,c)}addOscHandler(o,c){return this.registerOscHandler(o,c)}}},7090:(l,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.UnicodeApi=void 0,s.UnicodeApi=class{constructor(o){this._core=o}register(o){this._core.unicodeService.register(o)}get versions(){return this._core.unicodeService.versions}get activeVersion(){return this._core.unicodeService.activeVersion}set activeVersion(o){this._core.unicodeService.activeVersion=o}}},744:function(l,s,o){var c=this&&this.__decorate||function(h,m,d,g){var w,b=arguments.length,x=b<3?m:g===null?g=Object.getOwnPropertyDescriptor(m,d):g;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")x=Reflect.decorate(h,m,d,g);else for(var C=h.length-1;C>=0;C--)(w=h[C])&&(x=(b<3?w(x):b>3?w(m,d,x):w(m,d))||x);return b>3&&x&&Object.defineProperty(m,d,x),x},f=this&&this.__param||function(h,m){return function(d,g){m(d,g,h)}};Object.defineProperty(s,"__esModule",{value:!0}),s.BufferService=s.MINIMUM_ROWS=s.MINIMUM_COLS=void 0;const u=o(8460),p=o(844),_=o(5295),y=o(2585);s.MINIMUM_COLS=2,s.MINIMUM_ROWS=1;let v=s.BufferService=class extends p.Disposable{get buffer(){return this.buffers.active}constructor(h){super(),this.isUserScrolling=!1,this._onResize=this.register(new u.EventEmitter),this.onResize=this._onResize.event,this._onScroll=this.register(new u.EventEmitter),this.onScroll=this._onScroll.event,this.cols=Math.max(h.rawOptions.cols||0,s.MINIMUM_COLS),this.rows=Math.max(h.rawOptions.rows||0,s.MINIMUM_ROWS),this.buffers=this.register(new _.BufferSet(h,this))}resize(h,m){this.cols=h,this.rows=m,this.buffers.resize(h,m),this._onResize.fire({cols:h,rows:m})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(h,m=!1){const d=this.buffer;let g;g=this._cachedBlankLine,g&&g.length===this.cols&&g.getFg(0)===h.fg&&g.getBg(0)===h.bg||(g=d.getBlankLine(h,m),this._cachedBlankLine=g),g.isWrapped=m;const w=d.ybase+d.scrollTop,b=d.ybase+d.scrollBottom;if(d.scrollTop===0){const x=d.lines.isFull;b===d.lines.length-1?x?d.lines.recycle().copyFrom(g):d.lines.push(g.clone()):d.lines.splice(b+1,0,g.clone()),x?this.isUserScrolling&&(d.ydisp=Math.max(d.ydisp-1,0)):(d.ybase++,this.isUserScrolling||d.ydisp++)}else{const x=b-w+1;d.lines.shiftElements(w+1,x-1,-1),d.lines.set(b,g.clone())}this.isUserScrolling||(d.ydisp=d.ybase),this._onScroll.fire(d.ydisp)}scrollLines(h,m,d){const g=this.buffer;if(h<0){if(g.ydisp===0)return;this.isUserScrolling=!0}else h+g.ydisp>=g.ybase&&(this.isUserScrolling=!1);const w=g.ydisp;g.ydisp=Math.max(Math.min(g.ydisp+h,g.ybase),0),w!==g.ydisp&&(m||this._onScroll.fire(g.ydisp))}};s.BufferService=v=c([f(0,y.IOptionsService)],v)},7994:(l,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.CharsetService=void 0,s.CharsetService=class{constructor(){this.glevel=0,this._charsets=[]}reset(){this.charset=void 0,this._charsets=[],this.glevel=0}setgLevel(o){this.glevel=o,this.charset=this._charsets[o]}setgCharset(o,c){this._charsets[o]=c,this.glevel===o&&(this.charset=c)}}},1753:function(l,s,o){var c=this&&this.__decorate||function(g,w,b,x){var C,S=arguments.length,k=S<3?w:x===null?x=Object.getOwnPropertyDescriptor(w,b):x;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")k=Reflect.decorate(g,w,b,x);else for(var L=g.length-1;L>=0;L--)(C=g[L])&&(k=(S<3?C(k):S>3?C(w,b,k):C(w,b))||k);return S>3&&k&&Object.defineProperty(w,b,k),k},f=this&&this.__param||function(g,w){return function(b,x){w(b,x,g)}};Object.defineProperty(s,"__esModule",{value:!0}),s.CoreMouseService=void 0;const u=o(2585),p=o(8460),_=o(844),y={NONE:{events:0,restrict:()=>!1},X10:{events:1,restrict:g=>g.button!==4&&g.action===1&&(g.ctrl=!1,g.alt=!1,g.shift=!1,!0)},VT200:{events:19,restrict:g=>g.action!==32},DRAG:{events:23,restrict:g=>g.action!==32||g.button!==3},ANY:{events:31,restrict:g=>!0}};function v(g,w){let b=(g.ctrl?16:0)|(g.shift?4:0)|(g.alt?8:0);return g.button===4?(b|=64,b|=g.action):(b|=3&g.button,4&g.button&&(b|=64),8&g.button&&(b|=128),g.action===32?b|=32:g.action!==0||w||(b|=3)),b}const h=String.fromCharCode,m={DEFAULT:g=>{const w=[v(g,!1)+32,g.col+32,g.row+32];return w[0]>255||w[1]>255||w[2]>255?"":`\x1B[M${h(w[0])}${h(w[1])}${h(w[2])}`},SGR:g=>{const w=g.action===0&&g.button!==4?"m":"M";return`\x1B[<${v(g,!0)};${g.col};${g.row}${w}`},SGR_PIXELS:g=>{const w=g.action===0&&g.button!==4?"m":"M";return`\x1B[<${v(g,!0)};${g.x};${g.y}${w}`}};let d=s.CoreMouseService=class extends _.Disposable{constructor(g,w){super(),this._bufferService=g,this._coreService=w,this._protocols={},this._encodings={},this._activeProtocol="",this._activeEncoding="",this._lastEvent=null,this._onProtocolChange=this.register(new p.EventEmitter),this.onProtocolChange=this._onProtocolChange.event;for(const b of Object.keys(y))this.addProtocol(b,y[b]);for(const b of Object.keys(m))this.addEncoding(b,m[b]);this.reset()}addProtocol(g,w){this._protocols[g]=w}addEncoding(g,w){this._encodings[g]=w}get activeProtocol(){return this._activeProtocol}get areMouseEventsActive(){return this._protocols[this._activeProtocol].events!==0}set activeProtocol(g){if(!this._protocols[g])throw new Error(`unknown protocol "${g}"`);this._activeProtocol=g,this._onProtocolChange.fire(this._protocols[g].events)}get activeEncoding(){return this._activeEncoding}set activeEncoding(g){if(!this._encodings[g])throw new Error(`unknown encoding "${g}"`);this._activeEncoding=g}reset(){this.activeProtocol="NONE",this.activeEncoding="DEFAULT",this._lastEvent=null}triggerMouseEvent(g){if(g.col<0||g.col>=this._bufferService.cols||g.row<0||g.row>=this._bufferService.rows||g.button===4&&g.action===32||g.button===3&&g.action!==32||g.button!==4&&(g.action===2||g.action===3)||(g.col++,g.row++,g.action===32&&this._lastEvent&&this._equalEvents(this._lastEvent,g,this._activeEncoding==="SGR_PIXELS"))||!this._protocols[this._activeProtocol].restrict(g))return!1;const w=this._encodings[this._activeEncoding](g);return w&&(this._activeEncoding==="DEFAULT"?this._coreService.triggerBinaryEvent(w):this._coreService.triggerDataEvent(w,!0)),this._lastEvent=g,!0}explainEvents(g){return{down:!!(1&g),up:!!(2&g),drag:!!(4&g),move:!!(8&g),wheel:!!(16&g)}}_equalEvents(g,w,b){if(b){if(g.x!==w.x||g.y!==w.y)return!1}else if(g.col!==w.col||g.row!==w.row)return!1;return g.button===w.button&&g.action===w.action&&g.ctrl===w.ctrl&&g.alt===w.alt&&g.shift===w.shift}};s.CoreMouseService=d=c([f(0,u.IBufferService),f(1,u.ICoreService)],d)},6975:function(l,s,o){var c=this&&this.__decorate||function(d,g,w,b){var x,C=arguments.length,S=C<3?g:b===null?b=Object.getOwnPropertyDescriptor(g,w):b;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")S=Reflect.decorate(d,g,w,b);else for(var k=d.length-1;k>=0;k--)(x=d[k])&&(S=(C<3?x(S):C>3?x(g,w,S):x(g,w))||S);return C>3&&S&&Object.defineProperty(g,w,S),S},f=this&&this.__param||function(d,g){return function(w,b){g(w,b,d)}};Object.defineProperty(s,"__esModule",{value:!0}),s.CoreService=void 0;const u=o(1439),p=o(8460),_=o(844),y=o(2585),v=Object.freeze({insertMode:!1}),h=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,origin:!1,reverseWraparound:!1,sendFocus:!1,wraparound:!0});let m=s.CoreService=class extends _.Disposable{constructor(d,g,w){super(),this._bufferService=d,this._logService=g,this._optionsService=w,this.isCursorInitialized=!1,this.isCursorHidden=!1,this._onData=this.register(new p.EventEmitter),this.onData=this._onData.event,this._onUserInput=this.register(new p.EventEmitter),this.onUserInput=this._onUserInput.event,this._onBinary=this.register(new p.EventEmitter),this.onBinary=this._onBinary.event,this._onRequestScrollToBottom=this.register(new p.EventEmitter),this.onRequestScrollToBottom=this._onRequestScrollToBottom.event,this.modes=(0,u.clone)(v),this.decPrivateModes=(0,u.clone)(h)}reset(){this.modes=(0,u.clone)(v),this.decPrivateModes=(0,u.clone)(h)}triggerDataEvent(d,g=!1){if(this._optionsService.rawOptions.disableStdin)return;const w=this._bufferService.buffer;g&&this._optionsService.rawOptions.scrollOnUserInput&&w.ybase!==w.ydisp&&this._onRequestScrollToBottom.fire(),g&&this._onUserInput.fire(),this._logService.debug(`sending data "${d}"`,()=>d.split("").map(b=>b.charCodeAt(0))),this._onData.fire(d)}triggerBinaryEvent(d){this._optionsService.rawOptions.disableStdin||(this._logService.debug(`sending binary "${d}"`,()=>d.split("").map(g=>g.charCodeAt(0))),this._onBinary.fire(d))}};s.CoreService=m=c([f(0,y.IBufferService),f(1,y.ILogService),f(2,y.IOptionsService)],m)},9074:(l,s,o)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.DecorationService=void 0;const c=o(8055),f=o(8460),u=o(844),p=o(6106);let _=0,y=0;class v extends u.Disposable{get decorations(){return this._decorations.values()}constructor(){super(),this._decorations=new p.SortedList(d=>d==null?void 0:d.marker.line),this._onDecorationRegistered=this.register(new f.EventEmitter),this.onDecorationRegistered=this._onDecorationRegistered.event,this._onDecorationRemoved=this.register(new f.EventEmitter),this.onDecorationRemoved=this._onDecorationRemoved.event,this.register((0,u.toDisposable)(()=>this.reset()))}registerDecoration(d){if(d.marker.isDisposed)return;const g=new h(d);if(g){const w=g.marker.onDispose(()=>g.dispose());g.onDispose(()=>{g&&(this._decorations.delete(g)&&this._onDecorationRemoved.fire(g),w.dispose())}),this._decorations.insert(g),this._onDecorationRegistered.fire(g)}return g}reset(){for(const d of this._decorations.values())d.dispose();this._decorations.clear()}*getDecorationsAtCell(d,g,w){let b=0,x=0;for(const C of this._decorations.getKeyIterator(g))b=C.options.x??0,x=b+(C.options.width??1),d>=b&&d<x&&(!w||(C.options.layer??"bottom")===w)&&(yield C)}forEachDecorationAtCell(d,g,w,b){this._decorations.forEachByKey(g,x=>{_=x.options.x??0,y=_+(x.options.width??1),d>=_&&d<y&&(!w||(x.options.layer??"bottom")===w)&&b(x)})}}s.DecorationService=v;class h extends u.Disposable{get isDisposed(){return this._isDisposed}get backgroundColorRGB(){return this._cachedBg===null&&(this.options.backgroundColor?this._cachedBg=c.css.toColor(this.options.backgroundColor):this._cachedBg=void 0),this._cachedBg}get foregroundColorRGB(){return this._cachedFg===null&&(this.options.foregroundColor?this._cachedFg=c.css.toColor(this.options.foregroundColor):this._cachedFg=void 0),this._cachedFg}constructor(d){super(),this.options=d,this.onRenderEmitter=this.register(new f.EventEmitter),this.onRender=this.onRenderEmitter.event,this._onDispose=this.register(new f.EventEmitter),this.onDispose=this._onDispose.event,this._cachedBg=null,this._cachedFg=null,this.marker=d.marker,this.options.overviewRulerOptions&&!this.options.overviewRulerOptions.position&&(this.options.overviewRulerOptions.position="full")}dispose(){this._onDispose.fire(),super.dispose()}}},4348:(l,s,o)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.InstantiationService=s.ServiceCollection=void 0;const c=o(2585),f=o(8343);class u{constructor(..._){this._entries=new Map;for(const[y,v]of _)this.set(y,v)}set(_,y){const v=this._entries.get(_);return this._entries.set(_,y),v}forEach(_){for(const[y,v]of this._entries.entries())_(y,v)}has(_){return this._entries.has(_)}get(_){return this._entries.get(_)}}s.ServiceCollection=u,s.InstantiationService=class{constructor(){this._services=new u,this._services.set(c.IInstantiationService,this)}setService(p,_){this._services.set(p,_)}getService(p){return this._services.get(p)}createInstance(p,..._){const y=(0,f.getServiceDependencies)(p).sort((m,d)=>m.index-d.index),v=[];for(const m of y){const d=this._services.get(m.id);if(!d)throw new Error(`[createInstance] ${p.name} depends on UNKNOWN service ${m.id}.`);v.push(d)}const h=y.length>0?y[0].index:_.length;if(_.length!==h)throw new Error(`[createInstance] First service dependency of ${p.name} at position ${h+1} conflicts with ${_.length} static arguments`);return new p(..._,...v)}}},7866:function(l,s,o){var c=this&&this.__decorate||function(h,m,d,g){var w,b=arguments.length,x=b<3?m:g===null?g=Object.getOwnPropertyDescriptor(m,d):g;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")x=Reflect.decorate(h,m,d,g);else for(var C=h.length-1;C>=0;C--)(w=h[C])&&(x=(b<3?w(x):b>3?w(m,d,x):w(m,d))||x);return b>3&&x&&Object.defineProperty(m,d,x),x},f=this&&this.__param||function(h,m){return function(d,g){m(d,g,h)}};Object.defineProperty(s,"__esModule",{value:!0}),s.traceCall=s.setTraceLogger=s.LogService=void 0;const u=o(844),p=o(2585),_={trace:p.LogLevelEnum.TRACE,debug:p.LogLevelEnum.DEBUG,info:p.LogLevelEnum.INFO,warn:p.LogLevelEnum.WARN,error:p.LogLevelEnum.ERROR,off:p.LogLevelEnum.OFF};let y,v=s.LogService=class extends u.Disposable{get logLevel(){return this._logLevel}constructor(h){super(),this._optionsService=h,this._logLevel=p.LogLevelEnum.OFF,this._updateLogLevel(),this.register(this._optionsService.onSpecificOptionChange("logLevel",()=>this._updateLogLevel())),y=this}_updateLogLevel(){this._logLevel=_[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(h){for(let m=0;m<h.length;m++)typeof h[m]=="function"&&(h[m]=h[m]())}_log(h,m,d){this._evalLazyOptionalParams(d),h.call(console,(this._optionsService.options.logger?"":"xterm.js: ")+m,...d)}trace(h,...m){var d;this._logLevel<=p.LogLevelEnum.TRACE&&this._log(((d=this._optionsService.options.logger)==null?void 0:d.trace.bind(this._optionsService.options.logger))??console.log,h,m)}debug(h,...m){var d;this._logLevel<=p.LogLevelEnum.DEBUG&&this._log(((d=this._optionsService.options.logger)==null?void 0:d.debug.bind(this._optionsService.options.logger))??console.log,h,m)}info(h,...m){var d;this._logLevel<=p.LogLevelEnum.INFO&&this._log(((d=this._optionsService.options.logger)==null?void 0:d.info.bind(this._optionsService.options.logger))??console.info,h,m)}warn(h,...m){var d;this._logLevel<=p.LogLevelEnum.WARN&&this._log(((d=this._optionsService.options.logger)==null?void 0:d.warn.bind(this._optionsService.options.logger))??console.warn,h,m)}error(h,...m){var d;this._logLevel<=p.LogLevelEnum.ERROR&&this._log(((d=this._optionsService.options.logger)==null?void 0:d.error.bind(this._optionsService.options.logger))??console.error,h,m)}};s.LogService=v=c([f(0,p.IOptionsService)],v),s.setTraceLogger=function(h){y=h},s.traceCall=function(h,m,d){if(typeof d.value!="function")throw new Error("not supported");const g=d.value;d.value=function(...w){if(y.logLevel!==p.LogLevelEnum.TRACE)return g.apply(this,w);y.trace(`GlyphRenderer#${g.name}(${w.map(x=>JSON.stringify(x)).join(", ")})`);const b=g.apply(this,w);return y.trace(`GlyphRenderer#${g.name} return`,b),b}}},7302:(l,s,o)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.OptionsService=s.DEFAULT_OPTIONS=void 0;const c=o(8460),f=o(844),u=o(6114);s.DEFAULT_OPTIONS={cols:80,rows:24,cursorBlink:!1,cursorStyle:"block",cursorWidth:1,cursorInactiveStyle:"outline",customGlyphs:!0,drawBoldTextInBrightColors:!0,documentOverride:null,fastScrollModifier:"alt",fastScrollSensitivity:5,fontFamily:"courier-new, courier, monospace",fontSize:15,fontWeight:"normal",fontWeightBold:"bold",ignoreBracketedPasteMode:!1,lineHeight:1,letterSpacing:0,linkHandler:null,logLevel:"info",logger:null,scrollback:1e3,scrollOnUserInput:!0,scrollSensitivity:1,screenReaderMode:!1,smoothScrollDuration:0,macOptionIsMeta:!1,macOptionClickForcesSelection:!1,minimumContrastRatio:1,disableStdin:!1,allowProposedApi:!1,allowTransparency:!1,tabStopWidth:8,theme:{},rescaleOverlappingGlyphs:!1,rightClickSelectsWord:u.isMac,windowOptions:{},windowsMode:!1,windowsPty:{},wordSeparator:" ()[]{}',\"`",altClickMovesCursor:!0,convertEol:!1,termName:"xterm",cancelEvents:!1,overviewRulerWidth:0};const p=["normal","bold","100","200","300","400","500","600","700","800","900"];class _ extends f.Disposable{constructor(v){super(),this._onOptionChange=this.register(new c.EventEmitter),this.onOptionChange=this._onOptionChange.event;const h={...s.DEFAULT_OPTIONS};for(const m in v)if(m in h)try{const d=v[m];h[m]=this._sanitizeAndValidateOption(m,d)}catch(d){console.error(d)}this.rawOptions=h,this.options={...h},this._setupOptions(),this.register((0,f.toDisposable)(()=>{this.rawOptions.linkHandler=null,this.rawOptions.documentOverride=null}))}onSpecificOptionChange(v,h){return this.onOptionChange(m=>{m===v&&h(this.rawOptions[v])})}onMultipleOptionChange(v,h){return this.onOptionChange(m=>{v.indexOf(m)!==-1&&h()})}_setupOptions(){const v=m=>{if(!(m in s.DEFAULT_OPTIONS))throw new Error(`No option with key "${m}"`);return this.rawOptions[m]},h=(m,d)=>{if(!(m in s.DEFAULT_OPTIONS))throw new Error(`No option with key "${m}"`);d=this._sanitizeAndValidateOption(m,d),this.rawOptions[m]!==d&&(this.rawOptions[m]=d,this._onOptionChange.fire(m))};for(const m in this.rawOptions){const d={get:v.bind(this,m),set:h.bind(this,m)};Object.defineProperty(this.options,m,d)}}_sanitizeAndValidateOption(v,h){switch(v){case"cursorStyle":if(h||(h=s.DEFAULT_OPTIONS[v]),!function(m){return m==="block"||m==="underline"||m==="bar"}(h))throw new Error(`"${h}" is not a valid value for ${v}`);break;case"wordSeparator":h||(h=s.DEFAULT_OPTIONS[v]);break;case"fontWeight":case"fontWeightBold":if(typeof h=="number"&&1<=h&&h<=1e3)break;h=p.includes(h)?h:s.DEFAULT_OPTIONS[v];break;case"cursorWidth":h=Math.floor(h);case"lineHeight":case"tabStopWidth":if(h<1)throw new Error(`${v} cannot be less than 1, value: ${h}`);break;case"minimumContrastRatio":h=Math.max(1,Math.min(21,Math.round(10*h)/10));break;case"scrollback":if((h=Math.min(h,4294967295))<0)throw new Error(`${v} cannot be less than 0, value: ${h}`);break;case"fastScrollSensitivity":case"scrollSensitivity":if(h<=0)throw new Error(`${v} cannot be less than or equal to 0, value: ${h}`);break;case"rows":case"cols":if(!h&&h!==0)throw new Error(`${v} must be numeric, value: ${h}`);break;case"windowsPty":h=h??{}}return h}}s.OptionsService=_},2660:function(l,s,o){var c=this&&this.__decorate||function(_,y,v,h){var m,d=arguments.length,g=d<3?y:h===null?h=Object.getOwnPropertyDescriptor(y,v):h;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")g=Reflect.decorate(_,y,v,h);else for(var w=_.length-1;w>=0;w--)(m=_[w])&&(g=(d<3?m(g):d>3?m(y,v,g):m(y,v))||g);return d>3&&g&&Object.defineProperty(y,v,g),g},f=this&&this.__param||function(_,y){return function(v,h){y(v,h,_)}};Object.defineProperty(s,"__esModule",{value:!0}),s.OscLinkService=void 0;const u=o(2585);let p=s.OscLinkService=class{constructor(_){this._bufferService=_,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(_){const y=this._bufferService.buffer;if(_.id===void 0){const w=y.addMarker(y.ybase+y.y),b={data:_,id:this._nextId++,lines:[w]};return w.onDispose(()=>this._removeMarkerFromLink(b,w)),this._dataByLinkId.set(b.id,b),b.id}const v=_,h=this._getEntryIdKey(v),m=this._entriesWithId.get(h);if(m)return this.addLineToLink(m.id,y.ybase+y.y),m.id;const d=y.addMarker(y.ybase+y.y),g={id:this._nextId++,key:this._getEntryIdKey(v),data:v,lines:[d]};return d.onDispose(()=>this._removeMarkerFromLink(g,d)),this._entriesWithId.set(g.key,g),this._dataByLinkId.set(g.id,g),g.id}addLineToLink(_,y){const v=this._dataByLinkId.get(_);if(v&&v.lines.every(h=>h.line!==y)){const h=this._bufferService.buffer.addMarker(y);v.lines.push(h),h.onDispose(()=>this._removeMarkerFromLink(v,h))}}getLinkData(_){var y;return(y=this._dataByLinkId.get(_))==null?void 0:y.data}_getEntryIdKey(_){return`${_.id};;${_.uri}`}_removeMarkerFromLink(_,y){const v=_.lines.indexOf(y);v!==-1&&(_.lines.splice(v,1),_.lines.length===0&&(_.data.id!==void 0&&this._entriesWithId.delete(_.key),this._dataByLinkId.delete(_.id)))}};s.OscLinkService=p=c([f(0,u.IBufferService)],p)},8343:(l,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.createDecorator=s.getServiceDependencies=s.serviceRegistry=void 0;const o="di$target",c="di$dependencies";s.serviceRegistry=new Map,s.getServiceDependencies=function(f){return f[c]||[]},s.createDecorator=function(f){if(s.serviceRegistry.has(f))return s.serviceRegistry.get(f);const u=function(p,_,y){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");(function(v,h,m){h[o]===h?h[c].push({id:v,index:m}):(h[c]=[{id:v,index:m}],h[o]=h)})(u,p,y)};return u.toString=()=>f,s.serviceRegistry.set(f,u),u}},2585:(l,s,o)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.IDecorationService=s.IUnicodeService=s.IOscLinkService=s.IOptionsService=s.ILogService=s.LogLevelEnum=s.IInstantiationService=s.ICharsetService=s.ICoreService=s.ICoreMouseService=s.IBufferService=void 0;const c=o(8343);var f;s.IBufferService=(0,c.createDecorator)("BufferService"),s.ICoreMouseService=(0,c.createDecorator)("CoreMouseService"),s.ICoreService=(0,c.createDecorator)("CoreService"),s.ICharsetService=(0,c.createDecorator)("CharsetService"),s.IInstantiationService=(0,c.createDecorator)("InstantiationService"),function(u){u[u.TRACE=0]="TRACE",u[u.DEBUG=1]="DEBUG",u[u.INFO=2]="INFO",u[u.WARN=3]="WARN",u[u.ERROR=4]="ERROR",u[u.OFF=5]="OFF"}(f||(s.LogLevelEnum=f={})),s.ILogService=(0,c.createDecorator)("LogService"),s.IOptionsService=(0,c.createDecorator)("OptionsService"),s.IOscLinkService=(0,c.createDecorator)("OscLinkService"),s.IUnicodeService=(0,c.createDecorator)("UnicodeService"),s.IDecorationService=(0,c.createDecorator)("DecorationService")},1480:(l,s,o)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.UnicodeService=void 0;const c=o(8460),f=o(225);class u{static extractShouldJoin(_){return(1&_)!=0}static extractWidth(_){return _>>1&3}static extractCharKind(_){return _>>3}static createPropertyValue(_,y,v=!1){return(16777215&_)<<3|(3&y)<<1|(v?1:0)}constructor(){this._providers=Object.create(null),this._active="",this._onChange=new c.EventEmitter,this.onChange=this._onChange.event;const _=new f.UnicodeV6;this.register(_),this._active=_.version,this._activeProvider=_}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(_){if(!this._providers[_])throw new Error(`unknown Unicode version "${_}"`);this._active=_,this._activeProvider=this._providers[_],this._onChange.fire(_)}register(_){this._providers[_.version]=_}wcwidth(_){return this._activeProvider.wcwidth(_)}getStringCellWidth(_){let y=0,v=0;const h=_.length;for(let m=0;m<h;++m){let d=_.charCodeAt(m);if(55296<=d&&d<=56319){if(++m>=h)return y+this.wcwidth(d);const b=_.charCodeAt(m);56320<=b&&b<=57343?d=1024*(d-55296)+b-56320+65536:y+=this.wcwidth(b)}const g=this.charProperties(d,v);let w=u.extractWidth(g);u.extractShouldJoin(g)&&(w-=u.extractWidth(v)),y+=w,v=g}return y}charProperties(_,y){return this._activeProvider.charProperties(_,y)}}s.UnicodeService=u}},n={};function i(l){var s=n[l];if(s!==void 0)return s.exports;var o=n[l]={exports:{}};return r[l].call(o.exports,o,o.exports,i),o.exports}var a={};return(()=>{var l=a;Object.defineProperty(l,"__esModule",{value:!0}),l.Terminal=void 0;const s=i(9042),o=i(3236),c=i(844),f=i(5741),u=i(8285),p=i(7975),_=i(7090),y=["cols","rows"];class v extends c.Disposable{constructor(m){super(),this._core=this.register(new o.Terminal(m)),this._addonManager=this.register(new f.AddonManager),this._publicOptions={...this._core.options};const d=w=>this._core.options[w],g=(w,b)=>{this._checkReadonlyOptions(w),this._core.options[w]=b};for(const w in this._core.options){const b={get:d.bind(this,w),set:g.bind(this,w)};Object.defineProperty(this._publicOptions,w,b)}}_checkReadonlyOptions(m){if(y.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 p.ParserApi(this._core)),this._parser}get unicode(){return this._checkProposedApi(),new _.UnicodeApi(this._core)}get textarea(){return this._core.textarea}get rows(){return this._core.rows}get cols(){return this._core.cols}get buffer(){return this._buffer||(this._buffer=this.register(new u.BufferNamespaceApi(this._core))),this._buffer}get markers(){return this._checkProposedApi(),this._core.markers}get modes(){const m=this._core.coreService.decPrivateModes;let d="none";switch(this._core.coreMouseService.activeProtocol){case"X10":d="x10";break;case"VT200":d="vt200";break;case"DRAG":d="drag";break;case"ANY":d="any"}return{applicationCursorKeysMode:m.applicationCursorKeys,applicationKeypadMode:m.applicationKeypad,bracketedPasteMode:m.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:d,originMode:m.origin,reverseWraparoundMode:m.reverseWraparound,sendFocusMode:m.sendFocus,wraparoundMode:m.wraparound}}get options(){return this._publicOptions}set options(m){for(const d in m)this._publicOptions[d]=m[d]}blur(){this._core.blur()}focus(){this._core.focus()}input(m,d=!0){this._core.input(m,d)}resize(m,d){this._verifyIntegers(m,d),this._core.resize(m,d)}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,d,g){this._verifyIntegers(m,d,g),this._core.select(m,d,g)}getSelection(){return this._core.getSelection()}getSelectionPosition(){return this._core.getSelectionPosition()}clearSelection(){this._core.clearSelection()}selectAll(){this._core.selectAll()}selectLines(m,d){this._verifyIntegers(m,d),this._core.selectLines(m,d)}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,d){this._core.write(m,d)}writeln(m,d){this._core.write(m),this._core.write(`\r
|
|
60
60
|
`,d)}paste(m){this._core.paste(m)}refresh(m,d){this._verifyIntegers(m,d),this._core.refresh(m,d)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(m){this._addonManager.loadAddon(this,m)}static get strings(){return s}_verifyIntegers(...m){for(const d of m)if(d===1/0||isNaN(d)||d%1!=0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...m){for(const d of m)if(d&&(d===1/0||isNaN(d)||d%1!=0||d<0))throw new Error("This API only accepts positive integers")}}l.Terminal=v})(),a})())})(gw);var JR=gw.exports;/**
|
|
61
61
|
* Copyright (c) 2014-2024 The xterm.js authors. All rights reserved.
|
|
@@ -125,7 +125,7 @@ out vec4 outColor;
|
|
|
125
125
|
|
|
126
126
|
void main() {
|
|
127
127
|
outColor = v_color;
|
|
128
|
-
}`)),this.register((0,f.toDisposable)(()=>M.deleteProgram(this._program))),this._projectionLocation=(0,c.throwIfFalsy)(M.getUniformLocation(this._program,"u_projection")),this._vertexArrayObject=M.createVertexArray(),M.bindVertexArray(this._vertexArrayObject);const D=new Float32Array([0,0,1,0,0,1,1,1]),O=M.createBuffer();this.register((0,f.toDisposable)(()=>M.deleteBuffer(O))),M.bindBuffer(M.ARRAY_BUFFER,O),M.bufferData(M.ARRAY_BUFFER,D,M.STATIC_DRAW),M.enableVertexAttribArray(3),M.vertexAttribPointer(3,2,this._gl.FLOAT,!1,0,0);const z=new Uint8Array([0,1,2,3]),F=M.createBuffer();this.register((0,f.toDisposable)(()=>M.deleteBuffer(F))),M.bindBuffer(M.ELEMENT_ARRAY_BUFFER,F),M.bufferData(M.ELEMENT_ARRAY_BUFFER,z,M.STATIC_DRAW),this._attributesBuffer=(0,c.throwIfFalsy)(M.createBuffer()),this.register((0,f.toDisposable)(()=>M.deleteBuffer(this._attributesBuffer))),M.bindBuffer(M.ARRAY_BUFFER,this._attributesBuffer),M.enableVertexAttribArray(0),M.vertexAttribPointer(0,2,M.FLOAT,!1,_,0),M.vertexAttribDivisor(0,1),M.enableVertexAttribArray(1),M.vertexAttribPointer(1,2,M.FLOAT,!1,_,2*Float32Array.BYTES_PER_ELEMENT),M.vertexAttribDivisor(1,1),M.enableVertexAttribArray(2),M.vertexAttribPointer(2,4,M.FLOAT,!1,_,4*Float32Array.BYTES_PER_ELEMENT),M.vertexAttribDivisor(2,1),this._updateCachedColors(A.colors),this.register(this._themeService.onChangeColors(H=>{this._updateCachedColors(H),this._updateViewportRectangle()}))}renderBackgrounds(){this._renderVertices(this._vertices)}renderCursor(){this._renderVertices(this._verticesCursor)}_renderVertices(S){const k=this._gl;k.useProgram(this._program),k.bindVertexArray(this._vertexArrayObject),k.uniformMatrix4fv(this._projectionLocation,!1,p.PROJECTION_MATRIX),k.bindBuffer(k.ARRAY_BUFFER,this._attributesBuffer),k.bufferData(k.ARRAY_BUFFER,S.attributes,k.DYNAMIC_DRAW),k.drawElementsInstanced(this._gl.TRIANGLE_STRIP,4,k.UNSIGNED_BYTE,0,S.count)}handleResize(){this._updateViewportRectangle()}setDimensions(S){this._dimensions=S}_updateCachedColors(S){this._bgFloat=this._colorToFloat32Array(S.background),this._cursorFloat=this._colorToFloat32Array(S.cursor)}_updateViewportRectangle(){this._addRectangleFloat(this._vertices.attributes,0,0,0,this._terminal.cols*this._dimensions.device.cell.width,this._terminal.rows*this._dimensions.device.cell.height,this._bgFloat)}updateBackgrounds(S){const k=this._terminal,L=this._vertices;let A,M,D,O,z,F,H,I,R,P,N,j=1;for(A=0;A<k.rows;A++){for(D=-1,O=0,z=0,F=!1,M=0;M<k.cols;M++)H=(A*k.cols+M)*u.RENDER_MODEL_INDICIES_PER_CELL,I=S.cells[H+u.RENDER_MODEL_BG_OFFSET],R=S.cells[H+u.RENDER_MODEL_FG_OFFSET],P=!!(67108864&R),(I!==O||R!==z&&(F||P))&&((O!==0||F&&z!==0)&&(N=8*j++,this._updateRectangle(L,N,z,O,D,M,A)),D=M,O=I,z=R,F=P);(O!==0||F&&z!==0)&&(N=8*j++,this._updateRectangle(L,N,z,O,D,k.cols,A))}L.count=j}updateCursor(S){const k=this._verticesCursor,L=S.cursor;if(!L||L.style==="block")return void(k.count=0);let A,M=0;L.style!=="bar"&&L.style!=="outline"||(A=8*M++,this._addRectangleFloat(k.attributes,A,L.x*this._dimensions.device.cell.width,L.y*this._dimensions.device.cell.height,L.style==="bar"?L.dpr*L.cursorWidth:L.dpr,this._dimensions.device.cell.height,this._cursorFloat)),L.style!=="underline"&&L.style!=="outline"||(A=8*M++,this._addRectangleFloat(k.attributes,A,L.x*this._dimensions.device.cell.width,(L.y+1)*this._dimensions.device.cell.height-L.dpr,L.width*this._dimensions.device.cell.width,L.dpr,this._cursorFloat)),L.style==="outline"&&(A=8*M++,this._addRectangleFloat(k.attributes,A,L.x*this._dimensions.device.cell.width,L.y*this._dimensions.device.cell.height,L.width*this._dimensions.device.cell.width,L.dpr,this._cursorFloat),A=8*M++,this._addRectangleFloat(k.attributes,A,(L.x+L.width)*this._dimensions.device.cell.width-L.dpr,L.y*this._dimensions.device.cell.height,L.dpr,this._dimensions.device.cell.height,this._cursorFloat)),k.count=M}_updateRectangle(S,k,L,A,M,D,O){if(67108864&L)switch(50331648&L){case 16777216:case 33554432:v=this._themeService.colors.ansi[255&L].rgba;break;case 50331648:v=(16777215&L)<<8;break;default:v=this._themeService.colors.foreground.rgba}else switch(50331648&A){case 16777216:case 33554432:v=this._themeService.colors.ansi[255&A].rgba;break;case 50331648:v=(16777215&A)<<8;break;default:v=this._themeService.colors.background.rgba}S.attributes.length<k+4&&(S.attributes=(0,p.expandFloat32Array)(S.attributes,this._terminal.rows*this._terminal.cols*8)),h=M*this._dimensions.device.cell.width,m=O*this._dimensions.device.cell.height,d=(v>>24&255)/255,g=(v>>16&255)/255,w=(v>>8&255)/255,b=1,this._addRectangle(S.attributes,k,h,m,(D-M)*this._dimensions.device.cell.width,this._dimensions.device.cell.height,d,g,w,b)}_addRectangle(S,k,L,A,M,D,O,z,F,H){S[k]=L/this._dimensions.device.canvas.width,S[k+1]=A/this._dimensions.device.canvas.height,S[k+2]=M/this._dimensions.device.canvas.width,S[k+3]=D/this._dimensions.device.canvas.height,S[k+4]=O,S[k+5]=z,S[k+6]=F,S[k+7]=H}_addRectangleFloat(S,k,L,A,M,D,O){S[k]=L/this._dimensions.device.canvas.width,S[k+1]=A/this._dimensions.device.canvas.height,S[k+2]=M/this._dimensions.device.canvas.width,S[k+3]=D/this._dimensions.device.canvas.height,S[k+4]=O[0],S[k+5]=O[1],S[k+6]=O[2],S[k+7]=O[3]}_colorToFloat32Array(S){return new Float32Array([(S.rgba>>24&255)/255,(S.rgba>>16&255)/255,(S.rgba>>8&255)/255,(255&S.rgba)/255])}}s.RectangleRenderer=x},310:(l,s,o)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.RenderModel=s.COMBINED_CHAR_BIT_MASK=s.RENDER_MODEL_EXT_OFFSET=s.RENDER_MODEL_FG_OFFSET=s.RENDER_MODEL_BG_OFFSET=s.RENDER_MODEL_INDICIES_PER_CELL=void 0;const c=o(296);s.RENDER_MODEL_INDICIES_PER_CELL=4,s.RENDER_MODEL_BG_OFFSET=1,s.RENDER_MODEL_FG_OFFSET=2,s.RENDER_MODEL_EXT_OFFSET=3,s.COMBINED_CHAR_BIT_MASK=2147483648,s.RenderModel=class{constructor(){this.cells=new Uint32Array(0),this.lineLengths=new Uint32Array(0),this.selection=(0,c.createSelectionRenderModel)()}resize(f,u){const p=f*u*s.RENDER_MODEL_INDICIES_PER_CELL;p!==this.cells.length&&(this.cells=new Uint32Array(p),this.lineLengths=new Uint32Array(u))}clear(){this.cells.fill(0,0),this.lineLengths.fill(0,0)}}},666:(l,s,o)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.JoinedCellData=s.WebglRenderer=void 0;const c=o(820),f=o(274),u=o(627),p=o(457),_=o(56),y=o(374),v=o(345),h=o(859),m=o(147),d=o(782),g=o(855),w=o(965),b=o(742),x=o(310),C=o(733);class S extends h.Disposable{constructor(M,D,O,z,F,H,I,R,P){super(),this._terminal=M,this._characterJoinerService=D,this._charSizeService=O,this._coreBrowserService=z,this._coreService=F,this._decorationService=H,this._optionsService=I,this._themeService=R,this._cursorBlinkStateManager=new h.MutableDisposable,this._charAtlasDisposable=this.register(new h.MutableDisposable),this._observerDisposable=this.register(new h.MutableDisposable),this._model=new x.RenderModel,this._workCell=new d.CellData,this._workCell2=new d.CellData,this._rectangleRenderer=this.register(new h.MutableDisposable),this._glyphRenderer=this.register(new h.MutableDisposable),this._onChangeTextureAtlas=this.register(new v.EventEmitter),this.onChangeTextureAtlas=this._onChangeTextureAtlas.event,this._onAddTextureAtlasCanvas=this.register(new v.EventEmitter),this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event,this._onRemoveTextureAtlasCanvas=this.register(new v.EventEmitter),this.onRemoveTextureAtlasCanvas=this._onRemoveTextureAtlasCanvas.event,this._onRequestRedraw=this.register(new v.EventEmitter),this.onRequestRedraw=this._onRequestRedraw.event,this._onContextLoss=this.register(new v.EventEmitter),this.onContextLoss=this._onContextLoss.event,this.register(this._themeService.onChangeColors(()=>this._handleColorChange())),this._cellColorResolver=new f.CellColorResolver(this._terminal,this._optionsService,this._model.selection,this._decorationService,this._coreBrowserService,this._themeService),this._core=this._terminal._core,this._renderLayers=[new C.LinkRenderLayer(this._core.screenElement,2,this._terminal,this._core.linkifier,this._coreBrowserService,I,this._themeService)],this.dimensions=(0,y.createRenderDimensions)(),this._devicePixelRatio=this._coreBrowserService.dpr,this._updateDimensions(),this._updateCursorBlink(),this.register(I.onOptionChange(()=>this._handleOptionsChanged())),this._canvas=this._coreBrowserService.mainDocument.createElement("canvas");const N={antialias:!1,depth:!1,preserveDrawingBuffer:P};if(this._gl=this._canvas.getContext("webgl2",N),!this._gl)throw new Error("WebGL2 not supported "+this._gl);this.register((0,c.addDisposableDomListener)(this._canvas,"webglcontextlost",j=>{console.log("webglcontextlost event received"),j.preventDefault(),this._contextRestorationTimeout=setTimeout(()=>{this._contextRestorationTimeout=void 0,console.warn("webgl context not restored; firing onContextLoss"),this._onContextLoss.fire(j)},3e3)})),this.register((0,c.addDisposableDomListener)(this._canvas,"webglcontextrestored",j=>{console.warn("webglcontextrestored event received"),clearTimeout(this._contextRestorationTimeout),this._contextRestorationTimeout=void 0,(0,u.removeTerminalFromCache)(this._terminal),this._initializeWebGLState(),this._requestRedrawViewport()})),this._observerDisposable.value=(0,_.observeDevicePixelDimensions)(this._canvas,this._coreBrowserService.window,(j,W)=>this._setCanvasDevicePixelDimensions(j,W)),this.register(this._coreBrowserService.onWindowChange(j=>{this._observerDisposable.value=(0,_.observeDevicePixelDimensions)(this._canvas,j,(W,V)=>this._setCanvasDevicePixelDimensions(W,V))})),this._core.screenElement.appendChild(this._canvas),[this._rectangleRenderer.value,this._glyphRenderer.value]=this._initializeWebGLState(),this._isAttached=this._coreBrowserService.window.document.body.contains(this._core.screenElement),this.register((0,h.toDisposable)(()=>{var j;for(const W of this._renderLayers)W.dispose();(j=this._canvas.parentElement)==null||j.removeChild(this._canvas),(0,u.removeTerminalFromCache)(this._terminal)}))}get textureAtlas(){var M;return(M=this._charAtlas)==null?void 0:M.pages[0].canvas}_handleColorChange(){this._refreshCharAtlas(),this._clearModel(!0)}handleDevicePixelRatioChange(){this._devicePixelRatio!==this._coreBrowserService.dpr&&(this._devicePixelRatio=this._coreBrowserService.dpr,this.handleResize(this._terminal.cols,this._terminal.rows))}handleResize(M,D){var O,z,F,H;this._updateDimensions(),this._model.resize(this._terminal.cols,this._terminal.rows);for(const I of this._renderLayers)I.resize(this._terminal,this.dimensions);this._canvas.width=this.dimensions.device.canvas.width,this._canvas.height=this.dimensions.device.canvas.height,this._canvas.style.width=`${this.dimensions.css.canvas.width}px`,this._canvas.style.height=`${this.dimensions.css.canvas.height}px`,this._core.screenElement.style.width=`${this.dimensions.css.canvas.width}px`,this._core.screenElement.style.height=`${this.dimensions.css.canvas.height}px`,(O=this._rectangleRenderer.value)==null||O.setDimensions(this.dimensions),(z=this._rectangleRenderer.value)==null||z.handleResize(),(F=this._glyphRenderer.value)==null||F.setDimensions(this.dimensions),(H=this._glyphRenderer.value)==null||H.handleResize(),this._refreshCharAtlas(),this._clearModel(!1)}handleCharSizeChanged(){this.handleResize(this._terminal.cols,this._terminal.rows)}handleBlur(){var M;for(const D of this._renderLayers)D.handleBlur(this._terminal);(M=this._cursorBlinkStateManager.value)==null||M.pause(),this._requestRedrawViewport()}handleFocus(){var M;for(const D of this._renderLayers)D.handleFocus(this._terminal);(M=this._cursorBlinkStateManager.value)==null||M.resume(),this._requestRedrawViewport()}handleSelectionChanged(M,D,O){for(const z of this._renderLayers)z.handleSelectionChanged(this._terminal,M,D,O);this._model.selection.update(this._core,M,D,O),this._requestRedrawViewport()}handleCursorMove(){var M;for(const D of this._renderLayers)D.handleCursorMove(this._terminal);(M=this._cursorBlinkStateManager.value)==null||M.restartBlinkAnimation()}_handleOptionsChanged(){this._updateDimensions(),this._refreshCharAtlas(),this._updateCursorBlink()}_initializeWebGLState(){return this._rectangleRenderer.value=new b.RectangleRenderer(this._terminal,this._gl,this.dimensions,this._themeService),this._glyphRenderer.value=new w.GlyphRenderer(this._terminal,this._gl,this.dimensions,this._optionsService),this.handleCharSizeChanged(),[this._rectangleRenderer.value,this._glyphRenderer.value]}_refreshCharAtlas(){var D;if(this.dimensions.device.char.width<=0&&this.dimensions.device.char.height<=0)return void(this._isAttached=!1);const M=(0,u.acquireTextureAtlas)(this._terminal,this._optionsService.rawOptions,this._themeService.colors,this.dimensions.device.cell.width,this.dimensions.device.cell.height,this.dimensions.device.char.width,this.dimensions.device.char.height,this._coreBrowserService.dpr);this._charAtlas!==M&&(this._onChangeTextureAtlas.fire(M.pages[0].canvas),this._charAtlasDisposable.value=(0,h.getDisposeArrayDisposable)([(0,v.forwardEvent)(M.onAddTextureAtlasCanvas,this._onAddTextureAtlasCanvas),(0,v.forwardEvent)(M.onRemoveTextureAtlasCanvas,this._onRemoveTextureAtlasCanvas)])),this._charAtlas=M,this._charAtlas.warmUp(),(D=this._glyphRenderer.value)==null||D.setAtlas(this._charAtlas)}_clearModel(M){var D;this._model.clear(),M&&((D=this._glyphRenderer.value)==null||D.clear())}clearTextureAtlas(){var M;(M=this._charAtlas)==null||M.clearTexture(),this._clearModel(!0),this._requestRedrawViewport()}clear(){var M;this._clearModel(!0);for(const D of this._renderLayers)D.reset(this._terminal);(M=this._cursorBlinkStateManager.value)==null||M.restartBlinkAnimation(),this._updateCursorBlink()}registerCharacterJoiner(M){return-1}deregisterCharacterJoiner(M){return!1}renderRows(M,D){if(!this._isAttached){if(!(this._coreBrowserService.window.document.body.contains(this._core.screenElement)&&this._charSizeService.width&&this._charSizeService.height))return;this._updateDimensions(),this._refreshCharAtlas(),this._isAttached=!0}for(const O of this._renderLayers)O.handleGridChanged(this._terminal,M,D);this._glyphRenderer.value&&this._rectangleRenderer.value&&(this._glyphRenderer.value.beginFrame()?(this._clearModel(!0),this._updateModel(0,this._terminal.rows-1)):this._updateModel(M,D),this._rectangleRenderer.value.renderBackgrounds(),this._glyphRenderer.value.render(this._model),this._cursorBlinkStateManager.value&&!this._cursorBlinkStateManager.value.isCursorVisible||this._rectangleRenderer.value.renderCursor())}_updateCursorBlink(){this._terminal.options.cursorBlink?this._cursorBlinkStateManager.value=new p.CursorBlinkStateManager(()=>{this._requestRedrawCursor()},this._coreBrowserService):this._cursorBlinkStateManager.clear(),this._requestRedrawCursor()}_updateModel(M,D){const O=this._core;let z,F,H,I,R,P,N,j,W,V,Z,Q,$,B,G=this._workCell;M=L(M,O.rows-1,0),D=L(D,O.rows-1,0);const U=this._terminal.buffer.active.baseY+this._terminal.buffer.active.cursorY,te=U-O.buffer.ydisp,Y=Math.min(this._terminal.buffer.active.cursorX,O.cols-1);let _e=-1;const fe=this._coreService.isCursorInitialized&&!this._coreService.isCursorHidden&&(!this._cursorBlinkStateManager.value||this._cursorBlinkStateManager.value.isCursorVisible);this._model.cursor=void 0;let re=!1;for(F=M;F<=D;F++)for(H=F+O.buffer.ydisp,I=O.buffer.lines.get(H),this._model.lineLengths[F]=0,R=this._characterJoinerService.getJoinedCharacters(H),$=0;$<O.cols;$++)if(z=this._cellColorResolver.result.bg,I.loadCell($,G),$===0&&(z=this._cellColorResolver.result.bg),P=!1,N=$,R.length>0&&$===R[0][0]&&(P=!0,j=R.shift(),G=new k(G,I.translateToString(!0,j[0],j[1]),j[1]-j[0]),N=j[1]-1),W=G.getChars(),V=G.getCode(),Q=(F*O.cols+$)*x.RENDER_MODEL_INDICIES_PER_CELL,this._cellColorResolver.resolve(G,$,H,this.dimensions.device.cell.width),fe&&H===U&&($===Y&&(this._model.cursor={x:Y,y:te,width:G.getWidth(),style:this._coreBrowserService.isFocused?O.options.cursorStyle||"block":O.options.cursorInactiveStyle,cursorWidth:O.options.cursorWidth,dpr:this._devicePixelRatio},_e=Y+G.getWidth()-1),$>=Y&&$<=_e&&(this._coreBrowserService.isFocused&&(O.options.cursorStyle||"block")==="block"||this._coreBrowserService.isFocused===!1&&O.options.cursorInactiveStyle==="block")&&(this._cellColorResolver.result.fg=50331648|this._themeService.colors.cursorAccent.rgba>>8&16777215,this._cellColorResolver.result.bg=50331648|this._themeService.colors.cursor.rgba>>8&16777215)),V!==g.NULL_CELL_CODE&&(this._model.lineLengths[F]=$+1),(this._model.cells[Q]!==V||this._model.cells[Q+x.RENDER_MODEL_BG_OFFSET]!==this._cellColorResolver.result.bg||this._model.cells[Q+x.RENDER_MODEL_FG_OFFSET]!==this._cellColorResolver.result.fg||this._model.cells[Q+x.RENDER_MODEL_EXT_OFFSET]!==this._cellColorResolver.result.ext)&&(re=!0,W.length>1&&(V|=x.COMBINED_CHAR_BIT_MASK),this._model.cells[Q]=V,this._model.cells[Q+x.RENDER_MODEL_BG_OFFSET]=this._cellColorResolver.result.bg,this._model.cells[Q+x.RENDER_MODEL_FG_OFFSET]=this._cellColorResolver.result.fg,this._model.cells[Q+x.RENDER_MODEL_EXT_OFFSET]=this._cellColorResolver.result.ext,Z=G.getWidth(),this._glyphRenderer.value.updateCell($,F,V,this._cellColorResolver.result.bg,this._cellColorResolver.result.fg,this._cellColorResolver.result.ext,W,Z,z),P))for(G=this._workCell,$++;$<N;$++)B=(F*O.cols+$)*x.RENDER_MODEL_INDICIES_PER_CELL,this._glyphRenderer.value.updateCell($,F,g.NULL_CELL_CODE,0,0,0,g.NULL_CELL_CHAR,0,0),this._model.cells[B]=g.NULL_CELL_CODE,this._model.cells[B+x.RENDER_MODEL_BG_OFFSET]=this._cellColorResolver.result.bg,this._model.cells[B+x.RENDER_MODEL_FG_OFFSET]=this._cellColorResolver.result.fg,this._model.cells[B+x.RENDER_MODEL_EXT_OFFSET]=this._cellColorResolver.result.ext;re&&this._rectangleRenderer.value.updateBackgrounds(this._model),this._rectangleRenderer.value.updateCursor(this._model)}_updateDimensions(){this._charSizeService.width&&this._charSizeService.height&&(this.dimensions.device.char.width=Math.floor(this._charSizeService.width*this._devicePixelRatio),this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*this._devicePixelRatio),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._terminal.rows*this.dimensions.device.cell.height,this.dimensions.device.canvas.width=this._terminal.cols*this.dimensions.device.cell.width,this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/this._devicePixelRatio),this.dimensions.css.canvas.width=Math.round(this.dimensions.device.canvas.width/this._devicePixelRatio),this.dimensions.css.cell.height=this.dimensions.device.cell.height/this._devicePixelRatio,this.dimensions.css.cell.width=this.dimensions.device.cell.width/this._devicePixelRatio)}_setCanvasDevicePixelDimensions(M,D){this._canvas.width===M&&this._canvas.height===D||(this._canvas.width=M,this._canvas.height=D,this._requestRedrawViewport())}_requestRedrawViewport(){this._onRequestRedraw.fire({start:0,end:this._terminal.rows-1})}_requestRedrawCursor(){const M=this._terminal.buffer.active.cursorY;this._onRequestRedraw.fire({start:M,end:M})}}s.WebglRenderer=S;class k extends m.AttributeData{constructor(M,D,O){super(),this.content=0,this.combinedData="",this.fg=M.fg,this.bg=M.bg,this.combinedData=D,this._width=O}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(M){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}function L(A,M,D=0){return Math.max(Math.min(A,M),D)}s.JoinedCellData=k},381:(l,s,o)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.GLTexture=s.expandFloat32Array=s.createShader=s.createProgram=s.PROJECTION_MATRIX=void 0;const c=o(374);function f(u,p,_){const y=(0,c.throwIfFalsy)(u.createShader(p));if(u.shaderSource(y,_),u.compileShader(y),u.getShaderParameter(y,u.COMPILE_STATUS))return y;console.error(u.getShaderInfoLog(y)),u.deleteShader(y)}s.PROJECTION_MATRIX=new Float32Array([2,0,0,0,0,-2,0,0,0,0,1,0,-1,1,0,1]),s.createProgram=function(u,p,_){const y=(0,c.throwIfFalsy)(u.createProgram());if(u.attachShader(y,(0,c.throwIfFalsy)(f(u,u.VERTEX_SHADER,p))),u.attachShader(y,(0,c.throwIfFalsy)(f(u,u.FRAGMENT_SHADER,_))),u.linkProgram(y),u.getProgramParameter(y,u.LINK_STATUS))return y;console.error(u.getProgramInfoLog(y)),u.deleteProgram(y)},s.createShader=f,s.expandFloat32Array=function(u,p){const _=Math.min(2*u.length,p),y=new Float32Array(_);for(let v=0;v<u.length;v++)y[v]=u[v];return y},s.GLTexture=class{constructor(u){this.texture=u,this.version=-1}}},592:(l,s,o)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.BaseRenderLayer=void 0;const c=o(627),f=o(237),u=o(374),p=o(859);class _ extends p.Disposable{constructor(v,h,m,d,g,w,b,x){super(),this._container=h,this._alpha=g,this._coreBrowserService=w,this._optionsService=b,this._themeService=x,this._deviceCharWidth=0,this._deviceCharHeight=0,this._deviceCellWidth=0,this._deviceCellHeight=0,this._deviceCharLeft=0,this._deviceCharTop=0,this._canvas=this._coreBrowserService.mainDocument.createElement("canvas"),this._canvas.classList.add(`xterm-${m}-layer`),this._canvas.style.zIndex=d.toString(),this._initCanvas(),this._container.appendChild(this._canvas),this.register(this._themeService.onChangeColors(C=>{this._refreshCharAtlas(v,C),this.reset(v)})),this.register((0,p.toDisposable)(()=>{this._canvas.remove()}))}_initCanvas(){this._ctx=(0,u.throwIfFalsy)(this._canvas.getContext("2d",{alpha:this._alpha})),this._alpha||this._clearAll()}handleBlur(v){}handleFocus(v){}handleCursorMove(v){}handleGridChanged(v,h,m){}handleSelectionChanged(v,h,m,d=!1){}_setTransparency(v,h){if(h===this._alpha)return;const m=this._canvas;this._alpha=h,this._canvas=this._canvas.cloneNode(),this._initCanvas(),this._container.replaceChild(this._canvas,m),this._refreshCharAtlas(v,this._themeService.colors),this.handleGridChanged(v,0,v.rows-1)}_refreshCharAtlas(v,h){this._deviceCharWidth<=0&&this._deviceCharHeight<=0||(this._charAtlas=(0,c.acquireTextureAtlas)(v,this._optionsService.rawOptions,h,this._deviceCellWidth,this._deviceCellHeight,this._deviceCharWidth,this._deviceCharHeight,this._coreBrowserService.dpr),this._charAtlas.warmUp())}resize(v,h){this._deviceCellWidth=h.device.cell.width,this._deviceCellHeight=h.device.cell.height,this._deviceCharWidth=h.device.char.width,this._deviceCharHeight=h.device.char.height,this._deviceCharLeft=h.device.char.left,this._deviceCharTop=h.device.char.top,this._canvas.width=h.device.canvas.width,this._canvas.height=h.device.canvas.height,this._canvas.style.width=`${h.css.canvas.width}px`,this._canvas.style.height=`${h.css.canvas.height}px`,this._alpha||this._clearAll(),this._refreshCharAtlas(v,this._themeService.colors)}_fillBottomLineAtCells(v,h,m=1){this._ctx.fillRect(v*this._deviceCellWidth,(h+1)*this._deviceCellHeight-this._coreBrowserService.dpr-1,m*this._deviceCellWidth,this._coreBrowserService.dpr)}_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(v,h,m,d){this._alpha?this._ctx.clearRect(v*this._deviceCellWidth,h*this._deviceCellHeight,m*this._deviceCellWidth,d*this._deviceCellHeight):(this._ctx.fillStyle=this._themeService.colors.background.css,this._ctx.fillRect(v*this._deviceCellWidth,h*this._deviceCellHeight,m*this._deviceCellWidth,d*this._deviceCellHeight))}_fillCharTrueColor(v,h,m,d){this._ctx.font=this._getFont(v,!1,!1),this._ctx.textBaseline=f.TEXT_BASELINE,this._clipCell(m,d,h.getWidth()),this._ctx.fillText(h.getChars(),m*this._deviceCellWidth+this._deviceCharLeft,d*this._deviceCellHeight+this._deviceCharTop+this._deviceCharHeight)}_clipCell(v,h,m){this._ctx.beginPath(),this._ctx.rect(v*this._deviceCellWidth,h*this._deviceCellHeight,m*this._deviceCellWidth,this._deviceCellHeight),this._ctx.clip()}_getFont(v,h,m){return`${m?"italic":""} ${h?v.options.fontWeightBold:v.options.fontWeight} ${v.options.fontSize*this._coreBrowserService.dpr}px ${v.options.fontFamily}`}}s.BaseRenderLayer=_},733:(l,s,o)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.LinkRenderLayer=void 0;const c=o(197),f=o(237),u=o(592);class p extends u.BaseRenderLayer{constructor(y,v,h,m,d,g,w){super(h,y,"link",v,!0,d,g,w),this.register(m.onShowLinkUnderline(b=>this._handleShowLinkUnderline(b))),this.register(m.onHideLinkUnderline(b=>this._handleHideLinkUnderline(b)))}resize(y,v){super.resize(y,v),this._state=void 0}reset(y){this._clearCurrentLink()}_clearCurrentLink(){if(this._state){this._clearCells(this._state.x1,this._state.y1,this._state.cols-this._state.x1,1);const y=this._state.y2-this._state.y1-1;y>0&&this._clearCells(0,this._state.y1+1,this._state.cols,y),this._clearCells(0,this._state.y2,this._state.x2,1),this._state=void 0}}_handleShowLinkUnderline(y){if(y.fg===f.INVERTED_DEFAULT_COLOR?this._ctx.fillStyle=this._themeService.colors.background.css:y.fg!==void 0&&(0,c.is256Color)(y.fg)?this._ctx.fillStyle=this._themeService.colors.ansi[y.fg].css:this._ctx.fillStyle=this._themeService.colors.foreground.css,y.y1===y.y2)this._fillBottomLineAtCells(y.x1,y.y1,y.x2-y.x1);else{this._fillBottomLineAtCells(y.x1,y.y1,y.cols-y.x1);for(let v=y.y1+1;v<y.y2;v++)this._fillBottomLineAtCells(0,v,y.cols);this._fillBottomLineAtCells(0,y.y2,y.x2)}this._state=y}_handleHideLinkUnderline(y){this._clearCurrentLink()}}s.LinkRenderLayer=p},820:(l,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.addDisposableDomListener=void 0,s.addDisposableDomListener=function(o,c,f,u){o.addEventListener(c,f,u);let p=!1;return{dispose:()=>{p||(p=!0,o.removeEventListener(c,f,u))}}}},274:(l,s,o)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.CellColorResolver=void 0;const c=o(855),f=o(160),u=o(374);let p,_=0,y=0,v=!1,h=!1,m=!1,d=0;s.CellColorResolver=class{constructor(g,w,b,x,C,S){this._terminal=g,this._optionService=w,this._selectionRenderModel=b,this._decorationService=x,this._coreBrowserService=C,this._themeService=S,this.result={fg:0,bg:0,ext:0}}resolve(g,w,b,x){if(this.result.bg=g.bg,this.result.fg=g.fg,this.result.ext=268435456&g.bg?g.extended.ext:0,y=0,_=0,h=!1,v=!1,m=!1,p=this._themeService.colors,d=0,g.getCode()!==c.NULL_CELL_CODE&&g.extended.underlineStyle===4){const C=Math.max(1,Math.floor(this._optionService.rawOptions.fontSize*this._coreBrowserService.dpr/15));d=w*x%(2*Math.round(C))}if(this._decorationService.forEachDecorationAtCell(w,b,"bottom",C=>{C.backgroundColorRGB&&(y=C.backgroundColorRGB.rgba>>8&16777215,h=!0),C.foregroundColorRGB&&(_=C.foregroundColorRGB.rgba>>8&16777215,v=!0)}),m=this._selectionRenderModel.isCellSelected(this._terminal,w,b),m){if(67108864&this.result.fg||50331648&this.result.bg){if(67108864&this.result.fg)switch(50331648&this.result.fg){case 16777216:case 33554432:y=this._themeService.colors.ansi[255&this.result.fg].rgba;break;case 50331648:y=(16777215&this.result.fg)<<8|255;break;default:y=this._themeService.colors.foreground.rgba}else switch(50331648&this.result.bg){case 16777216:case 33554432:y=this._themeService.colors.ansi[255&this.result.bg].rgba;break;case 50331648:y=(16777215&this.result.bg)<<8|255}y=f.rgba.blend(y,4294967040&(this._coreBrowserService.isFocused?p.selectionBackgroundOpaque:p.selectionInactiveBackgroundOpaque).rgba|128)>>8&16777215}else y=(this._coreBrowserService.isFocused?p.selectionBackgroundOpaque:p.selectionInactiveBackgroundOpaque).rgba>>8&16777215;if(h=!0,p.selectionForeground&&(_=p.selectionForeground.rgba>>8&16777215,v=!0),(0,u.treatGlyphAsBackgroundColor)(g.getCode())){if(67108864&this.result.fg&&!(50331648&this.result.bg))_=(this._coreBrowserService.isFocused?p.selectionBackgroundOpaque:p.selectionInactiveBackgroundOpaque).rgba>>8&16777215;else{if(67108864&this.result.fg)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}else 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}_=f.rgba.blend(_,4294967040&(this._coreBrowserService.isFocused?p.selectionBackgroundOpaque:p.selectionInactiveBackgroundOpaque).rgba|128)>>8&16777215}v=!0}}this._decorationService.forEachDecorationAtCell(w,b,"top",C=>{C.backgroundColorRGB&&(y=C.backgroundColorRGB.rgba>>8&16777215,h=!0),C.foregroundColorRGB&&(_=C.foregroundColorRGB.rgba>>8&16777215,v=!0)}),h&&(y=m?-16777216&g.bg&-134217729|y|50331648:-16777216&g.bg|y|50331648),v&&(_=-16777216&g.fg&-67108865|_|50331648),67108864&this.result.fg&&(h&&!v&&(_=50331648&this.result.bg?-134217728&this.result.fg|67108863&this.result.bg:-134217728&this.result.fg|16777215&p.background.rgba>>8|50331648,v=!0),!h&&v&&(y=50331648&this.result.fg?-67108864&this.result.bg|67108863&this.result.fg:-67108864&this.result.bg|16777215&p.foreground.rgba>>8|50331648,h=!0)),p=void 0,this.result.bg=h?y:this.result.bg,this.result.fg=v?_:this.result.fg,this.result.ext&=536870911,this.result.ext|=d<<29&3758096384}}},627:(l,s,o)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.removeTerminalFromCache=s.acquireTextureAtlas=void 0;const c=o(509),f=o(197),u=[];s.acquireTextureAtlas=function(p,_,y,v,h,m,d,g){const w=(0,f.generateConfig)(v,h,m,d,_,y,g);for(let C=0;C<u.length;C++){const S=u[C],k=S.ownedBy.indexOf(p);if(k>=0){if((0,f.configEquals)(S.config,w))return S.atlas;S.ownedBy.length===1?(S.atlas.dispose(),u.splice(C,1)):S.ownedBy.splice(k,1);break}}for(let C=0;C<u.length;C++){const S=u[C];if((0,f.configEquals)(S.config,w))return S.ownedBy.push(p),S.atlas}const b=p._core,x={atlas:new c.TextureAtlas(document,w,b.unicodeService),config:w,ownedBy:[p]};return u.push(x),x.atlas},s.removeTerminalFromCache=function(p){for(let _=0;_<u.length;_++){const y=u[_].ownedBy.indexOf(p);if(y!==-1){u[_].ownedBy.length===1?(u[_].atlas.dispose(),u.splice(_,1)):u[_].ownedBy.splice(y,1);break}}}},197:(l,s,o)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.is256Color=s.configEquals=s.generateConfig=void 0;const c=o(160);s.generateConfig=function(f,u,p,_,y,v,h){const m={foreground:v.foreground,background:v.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:v.ansi.slice(),contrastCache:v.contrastCache,halfContrastCache:v.halfContrastCache};return{customGlyphs:y.customGlyphs,devicePixelRatio:h,letterSpacing:y.letterSpacing,lineHeight:y.lineHeight,deviceCellWidth:f,deviceCellHeight:u,deviceCharWidth:p,deviceCharHeight:_,fontFamily:y.fontFamily,fontSize:y.fontSize,fontWeight:y.fontWeight,fontWeightBold:y.fontWeightBold,allowTransparency:y.allowTransparency,drawBoldTextInBrightColors:y.drawBoldTextInBrightColors,minimumContrastRatio:y.minimumContrastRatio,colors:m}},s.configEquals=function(f,u){for(let p=0;p<f.colors.ansi.length;p++)if(f.colors.ansi[p].rgba!==u.colors.ansi[p].rgba)return!1;return f.devicePixelRatio===u.devicePixelRatio&&f.customGlyphs===u.customGlyphs&&f.lineHeight===u.lineHeight&&f.letterSpacing===u.letterSpacing&&f.fontFamily===u.fontFamily&&f.fontSize===u.fontSize&&f.fontWeight===u.fontWeight&&f.fontWeightBold===u.fontWeightBold&&f.allowTransparency===u.allowTransparency&&f.deviceCharWidth===u.deviceCharWidth&&f.deviceCharHeight===u.deviceCharHeight&&f.drawBoldTextInBrightColors===u.drawBoldTextInBrightColors&&f.minimumContrastRatio===u.minimumContrastRatio&&f.colors.foreground.rgba===u.colors.foreground.rgba&&f.colors.background.rgba===u.colors.background.rgba},s.is256Color=function(f){return(50331648&f)==16777216||(50331648&f)==33554432}},237:(l,s,o)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.TEXT_BASELINE=s.DIM_OPACITY=s.INVERTED_DEFAULT_COLOR=void 0;const c=o(399);s.INVERTED_DEFAULT_COLOR=257,s.DIM_OPACITY=.5,s.TEXT_BASELINE=c.isFirefox||c.isLegacyEdge?"bottom":"ideographic"},457:(l,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.CursorBlinkStateManager=void 0,s.CursorBlinkStateManager=class{constructor(o,c){this._renderCallback=o,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(o=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)},o)}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:(l,s,o)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.tryDrawCustomChar=s.powerlineDefinitions=s.boxDrawingDefinitions=s.blockElementDefinitions=void 0;const c=o(374);s.blockElementDefinitions={"▀":[{x:0,y:0,w:8,h:4}],"▁":[{x:0,y:7,w:8,h:1}],"▂":[{x:0,y:6,w:8,h:2}],"▃":[{x:0,y:5,w:8,h:3}],"▄":[{x:0,y:4,w:8,h:4}],"▅":[{x:0,y:3,w:8,h:5}],"▆":[{x:0,y:2,w:8,h:6}],"▇":[{x:0,y:1,w:8,h:7}],"█":[{x:0,y:0,w:8,h:8}],"▉":[{x:0,y:0,w:7,h:8}],"▊":[{x:0,y:0,w:6,h:8}],"▋":[{x:0,y:0,w:5,h:8}],"▌":[{x:0,y:0,w:4,h:8}],"▍":[{x:0,y:0,w:3,h:8}],"▎":[{x:0,y:0,w:2,h:8}],"▏":[{x:0,y:0,w:1,h:8}],"▐":[{x:4,y:0,w:4,h:8}],"▔":[{x:0,y:0,w:8,h:1}],"▕":[{x:7,y:0,w:1,h:8}],"▖":[{x:0,y:4,w:4,h:4}],"▗":[{x:4,y:4,w:4,h:4}],"▘":[{x:0,y:0,w:4,h:4}],"▙":[{x:0,y:0,w:4,h:8},{x:0,y:4,w:8,h:4}],"▚":[{x:0,y:0,w:4,h:4},{x:4,y:4,w:4,h:4}],"▛":[{x:0,y:0,w:4,h:8},{x:4,y:0,w:4,h:4}],"▜":[{x:0,y:0,w:8,h:4},{x:4,y:0,w:4,h:8}],"▝":[{x:4,y:0,w:4,h:4}],"▞":[{x:4,y:0,w:4,h:4},{x:0,y:4,w:4,h:4}],"▟":[{x:4,y:0,w:4,h:8},{x:0,y:4,w:8,h:4}],"🭰":[{x:1,y:0,w:1,h:8}],"🭱":[{x:2,y:0,w:1,h:8}],"🭲":[{x:3,y:0,w:1,h:8}],"🭳":[{x:4,y:0,w:1,h:8}],"🭴":[{x:5,y:0,w:1,h:8}],"🭵":[{x:6,y:0,w:1,h:8}],"🭶":[{x:0,y:1,w:8,h:1}],"🭷":[{x:0,y:2,w:8,h:1}],"🭸":[{x:0,y:3,w:8,h:1}],"🭹":[{x:0,y:4,w:8,h:1}],"🭺":[{x:0,y:5,w:8,h:1}],"🭻":[{x:0,y:6,w:8,h:1}],"🭼":[{x:0,y:0,w:1,h:8},{x:0,y:7,w:8,h:1}],"🭽":[{x:0,y:0,w:1,h:8},{x:0,y:0,w:8,h:1}],"🭾":[{x:7,y:0,w:1,h:8},{x:0,y:0,w:8,h:1}],"🭿":[{x:7,y:0,w:1,h:8},{x:0,y:7,w:8,h:1}],"🮀":[{x:0,y:0,w:8,h:1},{x:0,y:7,w:8,h:1}],"🮁":[{x:0,y:0,w:8,h:1},{x:0,y:2,w:8,h:1},{x:0,y:4,w:8,h:1},{x:0,y:7,w:8,h:1}],"🮂":[{x:0,y:0,w:8,h:2}],"🮃":[{x:0,y:0,w:8,h:3}],"🮄":[{x:0,y:0,w:8,h:5}],"🮅":[{x:0,y:0,w:8,h:6}],"🮆":[{x:0,y:0,w:8,h:7}],"🮇":[{x:6,y:0,w:2,h:8}],"🮈":[{x:5,y:0,w:3,h:8}],"🮉":[{x:3,y:0,w:5,h:8}],"🮊":[{x:2,y:0,w:6,h:8}],"🮋":[{x:1,y:0,w:7,h:8}],"🮕":[{x:0,y:0,w:2,h:2},{x:4,y:0,w:2,h:2},{x:2,y:2,w:2,h:2},{x:6,y:2,w:2,h:2},{x:0,y:4,w:2,h:2},{x:4,y:4,w:2,h:2},{x:2,y:6,w:2,h:2},{x:6,y:6,w:2,h:2}],"🮖":[{x:2,y:0,w:2,h:2},{x:6,y:0,w:2,h:2},{x:0,y:2,w:2,h:2},{x:4,y:2,w:2,h:2},{x:2,y:4,w:2,h:2},{x:6,y:4,w:2,h:2},{x:0,y:6,w:2,h:2},{x:4,y:6,w:2,h:2}],"🮗":[{x:0,y:2,w:8,h:2},{x:0,y:6,w:8,h:2}]};const f={"░":[[1,0,0,0],[0,0,0,0],[0,0,1,0],[0,0,0,0]],"▒":[[1,0],[0,0],[0,1],[0,0]],"▓":[[0,1],[1,1],[1,0],[1,1]]};s.boxDrawingDefinitions={"─":{1:"M0,.5 L1,.5"},"━":{3:"M0,.5 L1,.5"},"│":{1:"M.5,0 L.5,1"},"┃":{3:"M.5,0 L.5,1"},"┌":{1:"M0.5,1 L.5,.5 L1,.5"},"┏":{3:"M0.5,1 L.5,.5 L1,.5"},"┐":{1:"M0,.5 L.5,.5 L.5,1"},"┓":{3:"M0,.5 L.5,.5 L.5,1"},"└":{1:"M.5,0 L.5,.5 L1,.5"},"┗":{3:"M.5,0 L.5,.5 L1,.5"},"┘":{1:"M.5,0 L.5,.5 L0,.5"},"┛":{3:"M.5,0 L.5,.5 L0,.5"},"├":{1:"M.5,0 L.5,1 M.5,.5 L1,.5"},"┣":{3:"M.5,0 L.5,1 M.5,.5 L1,.5"},"┤":{1:"M.5,0 L.5,1 M.5,.5 L0,.5"},"┫":{3:"M.5,0 L.5,1 M.5,.5 L0,.5"},"┬":{1:"M0,.5 L1,.5 M.5,.5 L.5,1"},"┳":{3:"M0,.5 L1,.5 M.5,.5 L.5,1"},"┴":{1:"M0,.5 L1,.5 M.5,.5 L.5,0"},"┻":{3:"M0,.5 L1,.5 M.5,.5 L.5,0"},"┼":{1:"M0,.5 L1,.5 M.5,0 L.5,1"},"╋":{3:"M0,.5 L1,.5 M.5,0 L.5,1"},"╴":{1:"M.5,.5 L0,.5"},"╸":{3:"M.5,.5 L0,.5"},"╵":{1:"M.5,.5 L.5,0"},"╹":{3:"M.5,.5 L.5,0"},"╶":{1:"M.5,.5 L1,.5"},"╺":{3:"M.5,.5 L1,.5"},"╷":{1:"M.5,.5 L.5,1"},"╻":{3:"M.5,.5 L.5,1"},"═":{1:(v,h)=>`M0,${.5-h} L1,${.5-h} M0,${.5+h} L1,${.5+h}`},"║":{1:(v,h)=>`M${.5-v},0 L${.5-v},1 M${.5+v},0 L${.5+v},1`},"╒":{1:(v,h)=>`M.5,1 L.5,${.5-h} L1,${.5-h} M.5,${.5+h} L1,${.5+h}`},"╓":{1:(v,h)=>`M${.5-v},1 L${.5-v},.5 L1,.5 M${.5+v},.5 L${.5+v},1`},"╔":{1:(v,h)=>`M1,${.5-h} L${.5-v},${.5-h} L${.5-v},1 M1,${.5+h} L${.5+v},${.5+h} L${.5+v},1`},"╕":{1:(v,h)=>`M0,${.5-h} L.5,${.5-h} L.5,1 M0,${.5+h} L.5,${.5+h}`},"╖":{1:(v,h)=>`M${.5+v},1 L${.5+v},.5 L0,.5 M${.5-v},.5 L${.5-v},1`},"╗":{1:(v,h)=>`M0,${.5+h} L${.5-v},${.5+h} L${.5-v},1 M0,${.5-h} L${.5+v},${.5-h} L${.5+v},1`},"╘":{1:(v,h)=>`M.5,0 L.5,${.5+h} L1,${.5+h} M.5,${.5-h} L1,${.5-h}`},"╙":{1:(v,h)=>`M1,.5 L${.5-v},.5 L${.5-v},0 M${.5+v},.5 L${.5+v},0`},"╚":{1:(v,h)=>`M1,${.5-h} L${.5+v},${.5-h} L${.5+v},0 M1,${.5+h} L${.5-v},${.5+h} L${.5-v},0`},"╛":{1:(v,h)=>`M0,${.5+h} L.5,${.5+h} L.5,0 M0,${.5-h} L.5,${.5-h}`},"╜":{1:(v,h)=>`M0,.5 L${.5+v},.5 L${.5+v},0 M${.5-v},.5 L${.5-v},0`},"╝":{1:(v,h)=>`M0,${.5-h} L${.5-v},${.5-h} L${.5-v},0 M0,${.5+h} L${.5+v},${.5+h} L${.5+v},0`},"╞":{1:(v,h)=>`M.5,0 L.5,1 M.5,${.5-h} L1,${.5-h} M.5,${.5+h} L1,${.5+h}`},"╟":{1:(v,h)=>`M${.5-v},0 L${.5-v},1 M${.5+v},0 L${.5+v},1 M${.5+v},.5 L1,.5`},"╠":{1:(v,h)=>`M${.5-v},0 L${.5-v},1 M1,${.5+h} L${.5+v},${.5+h} L${.5+v},1 M1,${.5-h} L${.5+v},${.5-h} L${.5+v},0`},"╡":{1:(v,h)=>`M.5,0 L.5,1 M0,${.5-h} L.5,${.5-h} M0,${.5+h} L.5,${.5+h}`},"╢":{1:(v,h)=>`M0,.5 L${.5-v},.5 M${.5-v},0 L${.5-v},1 M${.5+v},0 L${.5+v},1`},"╣":{1:(v,h)=>`M${.5+v},0 L${.5+v},1 M0,${.5+h} L${.5-v},${.5+h} L${.5-v},1 M0,${.5-h} L${.5-v},${.5-h} L${.5-v},0`},"╤":{1:(v,h)=>`M0,${.5-h} L1,${.5-h} M0,${.5+h} L1,${.5+h} M.5,${.5+h} L.5,1`},"╥":{1:(v,h)=>`M0,.5 L1,.5 M${.5-v},.5 L${.5-v},1 M${.5+v},.5 L${.5+v},1`},"╦":{1:(v,h)=>`M0,${.5-h} L1,${.5-h} M0,${.5+h} L${.5-v},${.5+h} L${.5-v},1 M1,${.5+h} L${.5+v},${.5+h} L${.5+v},1`},"╧":{1:(v,h)=>`M.5,0 L.5,${.5-h} M0,${.5-h} L1,${.5-h} M0,${.5+h} L1,${.5+h}`},"╨":{1:(v,h)=>`M0,.5 L1,.5 M${.5-v},.5 L${.5-v},0 M${.5+v},.5 L${.5+v},0`},"╩":{1:(v,h)=>`M0,${.5+h} L1,${.5+h} M0,${.5-h} L${.5-v},${.5-h} L${.5-v},0 M1,${.5-h} L${.5+v},${.5-h} L${.5+v},0`},"╪":{1:(v,h)=>`M.5,0 L.5,1 M0,${.5-h} L1,${.5-h} M0,${.5+h} L1,${.5+h}`},"╫":{1:(v,h)=>`M0,.5 L1,.5 M${.5-v},0 L${.5-v},1 M${.5+v},0 L${.5+v},1`},"╬":{1:(v,h)=>`M0,${.5+h} L${.5-v},${.5+h} L${.5-v},1 M1,${.5+h} L${.5+v},${.5+h} L${.5+v},1 M0,${.5-h} L${.5-v},${.5-h} L${.5-v},0 M1,${.5-h} L${.5+v},${.5-h} L${.5+v},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:(v,h)=>`M.5,1 L.5,${.5+h/.15*.5} C.5,${.5+h/.15*.5},.5,.5,1,.5`},"╮":{1:(v,h)=>`M.5,1 L.5,${.5+h/.15*.5} C.5,${.5+h/.15*.5},.5,.5,0,.5`},"╯":{1:(v,h)=>`M.5,0 L.5,${.5-h/.15*.5} C.5,${.5-h/.15*.5},.5,.5,0,.5`},"╰":{1:(v,h)=>`M.5,0 L.5,${.5-h/.15*.5} C.5,${.5-h/.15*.5},.5,.5,1,.5`}},s.powerlineDefinitions={"":{d:"M0,0 L1,.5 L0,1",type:0,rightPadding:2},"":{d:"M-1,-.5 L1,.5 L-1,1.5",type:1,leftPadding:1,rightPadding:1},"":{d:"M1,0 L0,.5 L1,1",type:0,leftPadding:2},"":{d:"M2,-.5 L0,.5 L2,1.5",type:1,leftPadding:1,rightPadding:1},"":{d:"M0,0 L0,1 C0.552,1,1,0.776,1,.5 C1,0.224,0.552,0,0,0",type:0,rightPadding:1},"":{d:"M.2,1 C.422,1,.8,.826,.78,.5 C.8,.174,0.422,0,.2,0",type:1,rightPadding:1},"":{d:"M1,0 L1,1 C0.448,1,0,0.776,0,.5 C0,0.224,0.448,0,1,0",type:0,leftPadding:1},"":{d:"M.8,1 C0.578,1,0.2,.826,.22,.5 C0.2,0.174,0.578,0,0.8,0",type:1,leftPadding:1},"":{d:"M-.5,-.5 L1.5,1.5 L-.5,1.5",type:0},"":{d:"M-.5,-.5 L1.5,1.5",type:1,leftPadding:1,rightPadding:1},"":{d:"M1.5,-.5 L-.5,1.5 L1.5,1.5",type:0},"":{d:"M1.5,-.5 L-.5,1.5 L-.5,-.5",type:0},"":{d:"M1.5,-.5 L-.5,1.5",type:1,leftPadding:1,rightPadding:1},"":{d:"M-.5,-.5 L1.5,1.5 L1.5,-.5",type:0}},s.powerlineDefinitions[""]=s.powerlineDefinitions[""],s.powerlineDefinitions[""]=s.powerlineDefinitions[""],s.tryDrawCustomChar=function(v,h,m,d,g,w,b,x){const C=s.blockElementDefinitions[h];if(C)return function(A,M,D,O,z,F){for(let H=0;H<M.length;H++){const I=M[H],R=z/8,P=F/8;A.fillRect(D+I.x*R,O+I.y*P,I.w*R,I.h*P)}}(v,C,m,d,g,w),!0;const S=f[h];if(S)return function(A,M,D,O,z,F){let H=u.get(M);H||(H=new Map,u.set(M,H));const I=A.fillStyle;if(typeof I!="string")throw new Error(`Unexpected fillStyle type "${I}"`);let R=H.get(I);if(!R){const P=M[0].length,N=M.length,j=A.canvas.ownerDocument.createElement("canvas");j.width=P,j.height=N;const W=(0,c.throwIfFalsy)(j.getContext("2d")),V=new ImageData(P,N);let Z,Q,$,B;if(I.startsWith("#"))Z=parseInt(I.slice(1,3),16),Q=parseInt(I.slice(3,5),16),$=parseInt(I.slice(5,7),16),B=I.length>7&&parseInt(I.slice(7,9),16)||1;else{if(!I.startsWith("rgba"))throw new Error(`Unexpected fillStyle color format "${I}" when drawing pattern glyph`);[Z,Q,$,B]=I.substring(5,I.length-1).split(",").map(G=>parseFloat(G))}for(let G=0;G<N;G++)for(let U=0;U<P;U++)V.data[4*(G*P+U)]=Z,V.data[4*(G*P+U)+1]=Q,V.data[4*(G*P+U)+2]=$,V.data[4*(G*P+U)+3]=M[G][U]*(255*B);W.putImageData(V,0,0),R=(0,c.throwIfFalsy)(A.createPattern(j,null)),H.set(I,R)}A.fillStyle=R,A.fillRect(D,O,z,F)}(v,S,m,d,g,w),!0;const k=s.boxDrawingDefinitions[h];if(k)return function(A,M,D,O,z,F,H){A.strokeStyle=A.fillStyle;for(const[I,R]of Object.entries(M)){let P;A.beginPath(),A.lineWidth=H*Number.parseInt(I),P=typeof R=="function"?R(.15,.15/F*z):R;for(const N of P.split(" ")){const j=N[0],W=_[j];if(!W){console.error(`Could not find drawing instructions for "${j}"`);continue}const V=N.substring(1).split(",");V[0]&&V[1]&&W(A,y(V,z,F,D,O,!0,H))}A.stroke(),A.closePath()}}(v,k,m,d,g,w,x),!0;const L=s.powerlineDefinitions[h];return!!L&&(function(A,M,D,O,z,F,H,I){const R=new Path2D;R.rect(D,O,z,F),A.clip(R),A.beginPath();const P=H/12;A.lineWidth=I*P;for(const N of M.d.split(" ")){const j=N[0],W=_[j];if(!W){console.error(`Could not find drawing instructions for "${j}"`);continue}const V=N.substring(1).split(",");V[0]&&V[1]&&W(A,y(V,z,F,D,O,!1,I,(M.leftPadding??0)*(P/2),(M.rightPadding??0)*(P/2)))}M.type===1?(A.strokeStyle=A.fillStyle,A.stroke()):A.fill(),A.closePath()}(v,L,m,d,g,w,b,x),!0)};const u=new Map;function p(v,h,m=0){return Math.max(Math.min(v,h),m)}const _={C:(v,h)=>v.bezierCurveTo(h[0],h[1],h[2],h[3],h[4],h[5]),L:(v,h)=>v.lineTo(h[0],h[1]),M:(v,h)=>v.moveTo(h[0],h[1])};function y(v,h,m,d,g,w,b,x=0,C=0){const S=v.map(k=>parseFloat(k)||parseInt(k));if(S.length<2)throw new Error("Too few arguments for instruction");for(let k=0;k<S.length;k+=2)S[k]*=h-x*b-C*b,w&&S[k]!==0&&(S[k]=p(Math.round(S[k]+.5)-.5,h,0)),S[k]+=d+x*b;for(let k=1;k<S.length;k+=2)S[k]*=m,w&&S[k]!==0&&(S[k]=p(Math.round(S[k]+.5)-.5,m,0)),S[k]+=g;return S}},56:(l,s,o)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.observeDevicePixelDimensions=void 0;const c=o(859);s.observeDevicePixelDimensions=function(f,u,p){let _=new u.ResizeObserver(y=>{const v=y.find(d=>d.target===f);if(!v)return;if(!("devicePixelContentBoxSize"in v))return _==null||_.disconnect(),void(_=void 0);const h=v.devicePixelContentBoxSize[0].inlineSize,m=v.devicePixelContentBoxSize[0].blockSize;h>0&&m>0&&p(h,m)});try{_.observe(f,{box:["device-pixel-content-box"]})}catch{_.disconnect(),_=void 0}return(0,c.toDisposable)(()=>_==null?void 0:_.disconnect())}},374:(l,s)=>{function o(f){return 57508<=f&&f<=57558}function c(f){return f>=128512&&f<=128591||f>=127744&&f<=128511||f>=128640&&f<=128767||f>=9728&&f<=9983||f>=9984&&f<=10175||f>=65024&&f<=65039||f>=129280&&f<=129535||f>=127462&&f<=127487}Object.defineProperty(s,"__esModule",{value:!0}),s.computeNextVariantOffset=s.createRenderDimensions=s.treatGlyphAsBackgroundColor=s.allowRescaling=s.isEmoji=s.isRestrictedPowerlineGlyph=s.isPowerlineGlyph=s.throwIfFalsy=void 0,s.throwIfFalsy=function(f){if(!f)throw new Error("value must not be falsy");return f},s.isPowerlineGlyph=o,s.isRestrictedPowerlineGlyph=function(f){return 57520<=f&&f<=57527},s.isEmoji=c,s.allowRescaling=function(f,u,p,_){return u===1&&p>Math.ceil(1.5*_)&&f!==void 0&&f>255&&!c(f)&&!o(f)&&!function(y){return 57344<=y&&y<=63743}(f)},s.treatGlyphAsBackgroundColor=function(f){return o(f)||function(u){return 9472<=u&&u<=9631}(f)},s.createRenderDimensions=function(){return{css:{canvas:{width:0,height:0},cell:{width:0,height:0}},device:{canvas:{width:0,height:0},cell:{width:0,height:0},char:{width:0,height:0,left:0,top:0}}}},s.computeNextVariantOffset=function(f,u,p=0){return(f-(2*Math.round(u)-p))%(2*Math.round(u))}},296:(l,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.createSelectionRenderModel=void 0;class o{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(f,u,p,_=!1){if(this.selectionStart=u,this.selectionEnd=p,!u||!p||u[0]===p[0]&&u[1]===p[1])return void this.clear();const y=f.buffers.active.ydisp,v=u[1]-y,h=p[1]-y,m=Math.max(v,0),d=Math.min(h,f.rows-1);m>=f.rows||d<0?this.clear():(this.hasSelection=!0,this.columnSelectMode=_,this.viewportStartRow=v,this.viewportEndRow=h,this.viewportCappedStartRow=m,this.viewportCappedEndRow=d,this.startCol=u[0],this.endCol=p[0])}isCellSelected(f,u,p){return!!this.hasSelection&&(p-=f.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?u>=this.startCol&&p>=this.viewportCappedStartRow&&u<this.endCol&&p<=this.viewportCappedEndRow:u<this.startCol&&p>=this.viewportCappedStartRow&&u>=this.endCol&&p<=this.viewportCappedEndRow:p>this.viewportStartRow&&p<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&p===this.viewportStartRow&&u>=this.startCol&&u<this.endCol||this.viewportStartRow<this.viewportEndRow&&p===this.viewportEndRow&&u<this.endCol||this.viewportStartRow<this.viewportEndRow&&p===this.viewportStartRow&&u>=this.startCol)}}s.createSelectionRenderModel=function(){return new o}},509:(l,s,o)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.TextureAtlas=void 0;const c=o(237),f=o(860),u=o(374),p=o(160),_=o(345),y=o(485),v=o(385),h=o(147),m=o(855),d={texturePage:0,texturePosition:{x:0,y:0},texturePositionClipSpace:{x:0,y:0},offset:{x:0,y:0},size:{x:0,y:0},sizeClipSpace:{x:0,y:0}};let g;class w{get pages(){return this._pages}constructor(k,L,A){this._document=k,this._config=L,this._unicodeService=A,this._didWarmUp=!1,this._cacheMap=new y.FourKeyMap,this._cacheMapCombined=new y.FourKeyMap,this._pages=[],this._activePages=[],this._workBoundingBox={top:0,left:0,bottom:0,right:0},this._workAttributeData=new h.AttributeData,this._textureSize=512,this._onAddTextureAtlasCanvas=new _.EventEmitter,this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event,this._onRemoveTextureAtlasCanvas=new _.EventEmitter,this.onRemoveTextureAtlasCanvas=this._onRemoveTextureAtlasCanvas.event,this._requestClearModel=!1,this._createNewPage(),this._tmpCanvas=C(k,4*this._config.deviceCellWidth+4,this._config.deviceCellHeight+4),this._tmpCtx=(0,u.throwIfFalsy)(this._tmpCanvas.getContext("2d",{alpha:this._config.allowTransparency,willReadFrequently:!0}))}dispose(){for(const k of this.pages)k.canvas.remove();this._onAddTextureAtlasCanvas.dispose()}warmUp(){this._didWarmUp||(this._doWarmUp(),this._didWarmUp=!0)}_doWarmUp(){const k=new v.IdleTaskQueue;for(let L=33;L<126;L++)k.enqueue(()=>{if(!this._cacheMap.get(L,m.DEFAULT_COLOR,m.DEFAULT_COLOR,m.DEFAULT_EXT)){const A=this._drawToCache(L,m.DEFAULT_COLOR,m.DEFAULT_COLOR,m.DEFAULT_EXT);this._cacheMap.set(L,m.DEFAULT_COLOR,m.DEFAULT_COLOR,m.DEFAULT_EXT,A)}})}beginFrame(){return this._requestClearModel}clearTexture(){if(this._pages[0].currentRow.x!==0||this._pages[0].currentRow.y!==0){for(const k of this._pages)k.clear();this._cacheMap.clear(),this._cacheMapCombined.clear(),this._didWarmUp=!1}}_createNewPage(){if(w.maxAtlasPages&&this._pages.length>=Math.max(4,w.maxAtlasPages)){const L=this._pages.filter(H=>2*H.canvas.width<=(w.maxTextureSize||4096)).sort((H,I)=>I.canvas.width!==H.canvas.width?I.canvas.width-H.canvas.width:I.percentageUsed-H.percentageUsed);let A=-1,M=0;for(let H=0;H<L.length;H++)if(L[H].canvas.width!==M)A=H,M=L[H].canvas.width;else if(H-A==3)break;const D=L.slice(A,A+4),O=D.map(H=>H.glyphs[0].texturePage).sort((H,I)=>H>I?1:-1),z=this.pages.length-D.length,F=this._mergePages(D,z);F.version++;for(let H=O.length-1;H>=0;H--)this._deletePage(O[H]);this.pages.push(F),this._requestClearModel=!0,this._onAddTextureAtlasCanvas.fire(F.canvas)}const k=new b(this._document,this._textureSize);return this._pages.push(k),this._activePages.push(k),this._onAddTextureAtlasCanvas.fire(k.canvas),k}_mergePages(k,L){const A=2*k[0].canvas.width,M=new b(this._document,A,k);for(const[D,O]of k.entries()){const z=D*O.canvas.width%A,F=Math.floor(D/2)*O.canvas.height;M.ctx.drawImage(O.canvas,z,F);for(const I of O.glyphs)I.texturePage=L,I.sizeClipSpace.x=I.size.x/A,I.sizeClipSpace.y=I.size.y/A,I.texturePosition.x+=z,I.texturePosition.y+=F,I.texturePositionClipSpace.x=I.texturePosition.x/A,I.texturePositionClipSpace.y=I.texturePosition.y/A;this._onRemoveTextureAtlasCanvas.fire(O.canvas);const H=this._activePages.indexOf(O);H!==-1&&this._activePages.splice(H,1)}return M}_deletePage(k){this._pages.splice(k,1);for(let L=k;L<this._pages.length;L++){const A=this._pages[L];for(const M of A.glyphs)M.texturePage--;A.version++}}getRasterizedGlyphCombinedChar(k,L,A,M,D){return this._getFromCacheMap(this._cacheMapCombined,k,L,A,M,D)}getRasterizedGlyph(k,L,A,M,D){return this._getFromCacheMap(this._cacheMap,k,L,A,M,D)}_getFromCacheMap(k,L,A,M,D,O=!1){return g=k.get(L,A,M,D),g||(g=this._drawToCache(L,A,M,D,O),k.set(L,A,M,D,g)),g}_getColorFromAnsiIndex(k){if(k>=this._config.colors.ansi.length)throw new Error("No color found for idx "+k);return this._config.colors.ansi[k]}_getBackgroundColor(k,L,A,M){if(this._config.allowTransparency)return p.NULL_COLOR;let D;switch(k){case 16777216:case 33554432:D=this._getColorFromAnsiIndex(L);break;case 50331648:const O=h.AttributeData.toColorRGB(L);D=p.channels.toColor(O[0],O[1],O[2]);break;default:D=A?p.color.opaque(this._config.colors.foreground):this._config.colors.background}return D}_getForegroundColor(k,L,A,M,D,O,z,F,H,I){const R=this._getMinimumContrastColor(k,L,A,M,D,O,z,H,F,I);if(R)return R;let P;switch(D){case 16777216:case 33554432:this._config.drawBoldTextInBrightColors&&H&&O<8&&(O+=8),P=this._getColorFromAnsiIndex(O);break;case 50331648:const N=h.AttributeData.toColorRGB(O);P=p.channels.toColor(N[0],N[1],N[2]);break;default:P=z?this._config.colors.background:this._config.colors.foreground}return this._config.allowTransparency&&(P=p.color.opaque(P)),F&&(P=p.color.multiplyOpacity(P,c.DIM_OPACITY)),P}_resolveBackgroundRgba(k,L,A){switch(k){case 16777216:case 33554432:return this._getColorFromAnsiIndex(L).rgba;case 50331648:return L<<8;default:return A?this._config.colors.foreground.rgba:this._config.colors.background.rgba}}_resolveForegroundRgba(k,L,A,M){switch(k){case 16777216:case 33554432:return this._config.drawBoldTextInBrightColors&&M&&L<8&&(L+=8),this._getColorFromAnsiIndex(L).rgba;case 50331648:return L<<8;default:return A?this._config.colors.background.rgba:this._config.colors.foreground.rgba}}_getMinimumContrastColor(k,L,A,M,D,O,z,F,H,I){if(this._config.minimumContrastRatio===1||I)return;const R=this._getContrastCache(H),P=R.getColor(k,M);if(P!==void 0)return P||void 0;const N=this._resolveBackgroundRgba(L,A,z),j=this._resolveForegroundRgba(D,O,z,F),W=p.rgba.ensureContrastRatio(N,j,this._config.minimumContrastRatio/(H?2:1));if(!W)return void R.setColor(k,M,null);const V=p.channels.toColor(W>>24&255,W>>16&255,W>>8&255);return R.setColor(k,M,V),V}_getContrastCache(k){return k?this._config.colors.halfContrastCache:this._config.colors.contrastCache}_drawToCache(k,L,A,M,D=!1){const O=typeof k=="number"?String.fromCharCode(k):k,z=Math.min(this._config.deviceCellWidth*Math.max(O.length,2)+4,this._textureSize);this._tmpCanvas.width<z&&(this._tmpCanvas.width=z);const F=Math.min(this._config.deviceCellHeight+8,this._textureSize);if(this._tmpCanvas.height<F&&(this._tmpCanvas.height=F),this._tmpCtx.save(),this._workAttributeData.fg=A,this._workAttributeData.bg=L,this._workAttributeData.extended.ext=M,this._workAttributeData.isInvisible())return d;const H=!!this._workAttributeData.isBold(),I=!!this._workAttributeData.isInverse(),R=!!this._workAttributeData.isDim(),P=!!this._workAttributeData.isItalic(),N=!!this._workAttributeData.isUnderline(),j=!!this._workAttributeData.isStrikethrough(),W=!!this._workAttributeData.isOverline();let V=this._workAttributeData.getFgColor(),Z=this._workAttributeData.getFgColorMode(),Q=this._workAttributeData.getBgColor(),$=this._workAttributeData.getBgColorMode();if(I){const ae=V;V=Q,Q=ae;const ge=Z;Z=$,$=ge}const B=this._getBackgroundColor($,Q,I,R);this._tmpCtx.globalCompositeOperation="copy",this._tmpCtx.fillStyle=B.css,this._tmpCtx.fillRect(0,0,this._tmpCanvas.width,this._tmpCanvas.height),this._tmpCtx.globalCompositeOperation="source-over";const G=H?this._config.fontWeightBold:this._config.fontWeight,U=P?"italic":"";this._tmpCtx.font=`${U} ${G} ${this._config.fontSize*this._config.devicePixelRatio}px ${this._config.fontFamily}`,this._tmpCtx.textBaseline=c.TEXT_BASELINE;const te=O.length===1&&(0,u.isPowerlineGlyph)(O.charCodeAt(0)),Y=O.length===1&&(0,u.isRestrictedPowerlineGlyph)(O.charCodeAt(0)),_e=this._getForegroundColor(L,$,Q,A,Z,V,I,R,H,(0,u.treatGlyphAsBackgroundColor)(O.charCodeAt(0)));this._tmpCtx.fillStyle=_e.css;const fe=Y?0:4;let re=!1;this._config.customGlyphs!==!1&&(re=(0,f.tryDrawCustomChar)(this._tmpCtx,O,fe,fe,this._config.deviceCellWidth,this._config.deviceCellHeight,this._config.fontSize,this._config.devicePixelRatio));let le,se=!te;if(le=typeof k=="number"?this._unicodeService.wcwidth(k):this._unicodeService.getStringCellWidth(k),N){this._tmpCtx.save();const ae=Math.max(1,Math.floor(this._config.fontSize*this._config.devicePixelRatio/15)),ge=ae%2==1?.5:0;if(this._tmpCtx.lineWidth=ae,this._workAttributeData.isUnderlineColorDefault())this._tmpCtx.strokeStyle=this._tmpCtx.fillStyle;else if(this._workAttributeData.isUnderlineColorRGB())se=!1,this._tmpCtx.strokeStyle=`rgb(${h.AttributeData.toColorRGB(this._workAttributeData.getUnderlineColor()).join(",")})`;else{se=!1;let Oe=this._workAttributeData.getUnderlineColor();this._config.drawBoldTextInBrightColors&&this._workAttributeData.isBold()&&Oe<8&&(Oe+=8),this._tmpCtx.strokeStyle=this._getColorFromAnsiIndex(Oe).css}this._tmpCtx.beginPath();const Ee=fe,Le=Math.ceil(fe+this._config.deviceCharHeight)-ge-(D?2*ae:0),He=Le+ae,je=Le+2*ae;let Pe=this._workAttributeData.getUnderlineVariantOffset();for(let Oe=0;Oe<le;Oe++){this._tmpCtx.save();const Ce=Ee+Oe*this._config.deviceCellWidth,Te=Ee+(Oe+1)*this._config.deviceCellWidth,J=Ce+this._config.deviceCellWidth/2;switch(this._workAttributeData.extended.underlineStyle){case 2:this._tmpCtx.moveTo(Ce,Le),this._tmpCtx.lineTo(Te,Le),this._tmpCtx.moveTo(Ce,je),this._tmpCtx.lineTo(Te,je);break;case 3:const ee=ae<=1?je:Math.ceil(fe+this._config.deviceCharHeight-ae/2)-ge,$e=ae<=1?Le:Math.ceil(fe+this._config.deviceCharHeight+ae/2)-ge,Ne=new Path2D;Ne.rect(Ce,Le,this._config.deviceCellWidth,je-Le),this._tmpCtx.clip(Ne),this._tmpCtx.moveTo(Ce-this._config.deviceCellWidth/2,He),this._tmpCtx.bezierCurveTo(Ce-this._config.deviceCellWidth/2,$e,Ce,$e,Ce,He),this._tmpCtx.bezierCurveTo(Ce,ee,J,ee,J,He),this._tmpCtx.bezierCurveTo(J,$e,Te,$e,Te,He),this._tmpCtx.bezierCurveTo(Te,ee,Te+this._config.deviceCellWidth/2,ee,Te+this._config.deviceCellWidth/2,He);break;case 4:const K=Pe===0?0:Pe>=ae?2*ae-Pe:ae-Pe;Pe>=ae||K===0?(this._tmpCtx.setLineDash([Math.round(ae),Math.round(ae)]),this._tmpCtx.moveTo(Ce+K,Le),this._tmpCtx.lineTo(Te,Le)):(this._tmpCtx.setLineDash([Math.round(ae),Math.round(ae)]),this._tmpCtx.moveTo(Ce,Le),this._tmpCtx.lineTo(Ce+K,Le),this._tmpCtx.moveTo(Ce+K+ae,Le),this._tmpCtx.lineTo(Te,Le)),Pe=(0,u.computeNextVariantOffset)(Te-Ce,ae,Pe);break;case 5:const he=.6,X=.3,ye=Te-Ce,ne=Math.floor(he*ye),ue=Math.floor(X*ye),ke=ye-ne-ue;this._tmpCtx.setLineDash([ne,ue,ke]),this._tmpCtx.moveTo(Ce,Le),this._tmpCtx.lineTo(Te,Le);break;default:this._tmpCtx.moveTo(Ce,Le),this._tmpCtx.lineTo(Te,Le)}this._tmpCtx.stroke(),this._tmpCtx.restore()}if(this._tmpCtx.restore(),!re&&this._config.fontSize>=12&&!this._config.allowTransparency&&O!==" "){this._tmpCtx.save(),this._tmpCtx.textBaseline="alphabetic";const Oe=this._tmpCtx.measureText(O);if(this._tmpCtx.restore(),"actualBoundingBoxDescent"in Oe&&Oe.actualBoundingBoxDescent>0){this._tmpCtx.save();const Ce=new Path2D;Ce.rect(Ee,Le-Math.ceil(ae/2),this._config.deviceCellWidth*le,je-Le+Math.ceil(ae/2)),this._tmpCtx.clip(Ce),this._tmpCtx.lineWidth=3*this._config.devicePixelRatio,this._tmpCtx.strokeStyle=B.css,this._tmpCtx.strokeText(O,fe,fe+this._config.deviceCharHeight),this._tmpCtx.restore()}}}if(W){const ae=Math.max(1,Math.floor(this._config.fontSize*this._config.devicePixelRatio/15)),ge=ae%2==1?.5:0;this._tmpCtx.lineWidth=ae,this._tmpCtx.strokeStyle=this._tmpCtx.fillStyle,this._tmpCtx.beginPath(),this._tmpCtx.moveTo(fe,fe+ge),this._tmpCtx.lineTo(fe+this._config.deviceCharWidth*le,fe+ge),this._tmpCtx.stroke()}if(re||this._tmpCtx.fillText(O,fe,fe+this._config.deviceCharHeight),O==="_"&&!this._config.allowTransparency){let ae=x(this._tmpCtx.getImageData(fe,fe,this._config.deviceCellWidth,this._config.deviceCellHeight),B,_e,se);if(ae)for(let ge=1;ge<=5&&(this._tmpCtx.save(),this._tmpCtx.fillStyle=B.css,this._tmpCtx.fillRect(0,0,this._tmpCanvas.width,this._tmpCanvas.height),this._tmpCtx.restore(),this._tmpCtx.fillText(O,fe,fe+this._config.deviceCharHeight-ge),ae=x(this._tmpCtx.getImageData(fe,fe,this._config.deviceCellWidth,this._config.deviceCellHeight),B,_e,se),ae);ge++);}if(j){const ae=Math.max(1,Math.floor(this._config.fontSize*this._config.devicePixelRatio/10)),ge=this._tmpCtx.lineWidth%2==1?.5:0;this._tmpCtx.lineWidth=ae,this._tmpCtx.strokeStyle=this._tmpCtx.fillStyle,this._tmpCtx.beginPath(),this._tmpCtx.moveTo(fe,fe+Math.floor(this._config.deviceCharHeight/2)-ge),this._tmpCtx.lineTo(fe+this._config.deviceCharWidth*le,fe+Math.floor(this._config.deviceCharHeight/2)-ge),this._tmpCtx.stroke()}this._tmpCtx.restore();const pe=this._tmpCtx.getImageData(0,0,this._tmpCanvas.width,this._tmpCanvas.height);let ve;if(ve=this._config.allowTransparency?function(ae){for(let ge=0;ge<ae.data.length;ge+=4)if(ae.data[ge+3]>0)return!1;return!0}(pe):x(pe,B,_e,se),ve)return d;const ie=this._findGlyphBoundingBox(pe,this._workBoundingBox,z,Y,re,fe);let oe,de;for(;;){if(this._activePages.length===0){const ae=this._createNewPage();oe=ae,de=ae.currentRow,de.height=ie.size.y;break}oe=this._activePages[this._activePages.length-1],de=oe.currentRow;for(const ae of this._activePages)ie.size.y<=ae.currentRow.height&&(oe=ae,de=ae.currentRow);for(let ae=this._activePages.length-1;ae>=0;ae--)for(const ge of this._activePages[ae].fixedRows)ge.height<=de.height&&ie.size.y<=ge.height&&(oe=this._activePages[ae],de=ge);if(de.y+ie.size.y>=oe.canvas.height||de.height>ie.size.y+2){let ae=!1;if(oe.currentRow.y+oe.currentRow.height+ie.size.y>=oe.canvas.height){let ge;for(const Ee of this._activePages)if(Ee.currentRow.y+Ee.currentRow.height+ie.size.y<Ee.canvas.height){ge=Ee;break}if(ge)oe=ge;else if(w.maxAtlasPages&&this._pages.length>=w.maxAtlasPages&&de.y+ie.size.y<=oe.canvas.height&&de.height>=ie.size.y&&de.x+ie.size.x<=oe.canvas.width)ae=!0;else{const Ee=this._createNewPage();oe=Ee,de=Ee.currentRow,de.height=ie.size.y,ae=!0}}ae||(oe.currentRow.height>0&&oe.fixedRows.push(oe.currentRow),de={x:0,y:oe.currentRow.y+oe.currentRow.height,height:ie.size.y},oe.fixedRows.push(de),oe.currentRow={x:0,y:de.y+de.height,height:0})}if(de.x+ie.size.x<=oe.canvas.width)break;de===oe.currentRow?(de.x=0,de.y+=de.height,de.height=0):oe.fixedRows.splice(oe.fixedRows.indexOf(de),1)}return ie.texturePage=this._pages.indexOf(oe),ie.texturePosition.x=de.x,ie.texturePosition.y=de.y,ie.texturePositionClipSpace.x=de.x/oe.canvas.width,ie.texturePositionClipSpace.y=de.y/oe.canvas.height,ie.sizeClipSpace.x/=oe.canvas.width,ie.sizeClipSpace.y/=oe.canvas.height,de.height=Math.max(de.height,ie.size.y),de.x+=ie.size.x,oe.ctx.putImageData(pe,ie.texturePosition.x-this._workBoundingBox.left,ie.texturePosition.y-this._workBoundingBox.top,this._workBoundingBox.left,this._workBoundingBox.top,ie.size.x,ie.size.y),oe.addGlyph(ie),oe.version++,ie}_findGlyphBoundingBox(k,L,A,M,D,O){L.top=0;const z=M?this._config.deviceCellHeight:this._tmpCanvas.height,F=M?this._config.deviceCellWidth:A;let H=!1;for(let I=0;I<z;I++){for(let R=0;R<F;R++){const P=I*this._tmpCanvas.width*4+4*R+3;if(k.data[P]!==0){L.top=I,H=!0;break}}if(H)break}L.left=0,H=!1;for(let I=0;I<O+F;I++){for(let R=0;R<z;R++){const P=R*this._tmpCanvas.width*4+4*I+3;if(k.data[P]!==0){L.left=I,H=!0;break}}if(H)break}L.right=F,H=!1;for(let I=O+F-1;I>=O;I--){for(let R=0;R<z;R++){const P=R*this._tmpCanvas.width*4+4*I+3;if(k.data[P]!==0){L.right=I,H=!0;break}}if(H)break}L.bottom=z,H=!1;for(let I=z-1;I>=0;I--){for(let R=0;R<F;R++){const P=I*this._tmpCanvas.width*4+4*R+3;if(k.data[P]!==0){L.bottom=I,H=!0;break}}if(H)break}return{texturePage:0,texturePosition:{x:0,y:0},texturePositionClipSpace:{x:0,y:0},size:{x:L.right-L.left+1,y:L.bottom-L.top+1},sizeClipSpace:{x:L.right-L.left+1,y:L.bottom-L.top+1},offset:{x:-L.left+O+(M||D?Math.floor((this._config.deviceCellWidth-this._config.deviceCharWidth)/2):0),y:-L.top+O+(M||D?this._config.lineHeight===1?0:Math.round((this._config.deviceCellHeight-this._config.deviceCharHeight)/2):0)}}}}s.TextureAtlas=w;class b{get percentageUsed(){return this._usedPixels/(this.canvas.width*this.canvas.height)}get glyphs(){return this._glyphs}addGlyph(k){this._glyphs.push(k),this._usedPixels+=k.size.x*k.size.y}constructor(k,L,A){if(this._usedPixels=0,this._glyphs=[],this.version=0,this.currentRow={x:0,y:0,height:0},this.fixedRows=[],A)for(const M of A)this._glyphs.push(...M.glyphs),this._usedPixels+=M._usedPixels;this.canvas=C(k,L,L),this.ctx=(0,u.throwIfFalsy)(this.canvas.getContext("2d",{alpha:!0}))}clear(){this.ctx.clearRect(0,0,this.canvas.width,this.canvas.height),this.currentRow.x=0,this.currentRow.y=0,this.currentRow.height=0,this.fixedRows.length=0,this.version++}}function x(S,k,L,A){const M=k.rgba>>>24,D=k.rgba>>>16&255,O=k.rgba>>>8&255,z=L.rgba>>>24,F=L.rgba>>>16&255,H=L.rgba>>>8&255,I=Math.floor((Math.abs(M-z)+Math.abs(D-F)+Math.abs(O-H))/12);let R=!0;for(let P=0;P<S.data.length;P+=4)S.data[P]===M&&S.data[P+1]===D&&S.data[P+2]===O||A&&Math.abs(S.data[P]-M)+Math.abs(S.data[P+1]-D)+Math.abs(S.data[P+2]-O)<I?S.data[P+3]=0:R=!1;return R}function C(S,k,L){const A=S.createElement("canvas");return A.width=k,A.height=L,A}},160:(l,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.contrastRatio=s.toPaddedHex=s.rgba=s.rgb=s.css=s.color=s.channels=s.NULL_COLOR=void 0;let o=0,c=0,f=0,u=0;var p,_,y,v,h;function m(g){const w=g.toString(16);return w.length<2?"0"+w:w}function d(g,w){return g<w?(w+.05)/(g+.05):(g+.05)/(w+.05)}s.NULL_COLOR={css:"#00000000",rgba:0},function(g){g.toCss=function(w,b,x,C){return C!==void 0?`#${m(w)}${m(b)}${m(x)}${m(C)}`:`#${m(w)}${m(b)}${m(x)}`},g.toRgba=function(w,b,x,C=255){return(w<<24|b<<16|x<<8|C)>>>0},g.toColor=function(w,b,x,C){return{css:g.toCss(w,b,x,C),rgba:g.toRgba(w,b,x,C)}}}(p||(s.channels=p={})),function(g){function w(b,x){return u=Math.round(255*x),[o,c,f]=h.toChannels(b.rgba),{css:p.toCss(o,c,f,u),rgba:p.toRgba(o,c,f,u)}}g.blend=function(b,x){if(u=(255&x.rgba)/255,u===1)return{css:x.css,rgba:x.rgba};const C=x.rgba>>24&255,S=x.rgba>>16&255,k=x.rgba>>8&255,L=b.rgba>>24&255,A=b.rgba>>16&255,M=b.rgba>>8&255;return o=L+Math.round((C-L)*u),c=A+Math.round((S-A)*u),f=M+Math.round((k-M)*u),{css:p.toCss(o,c,f),rgba:p.toRgba(o,c,f)}},g.isOpaque=function(b){return(255&b.rgba)==255},g.ensureContrastRatio=function(b,x,C){const S=h.ensureContrastRatio(b.rgba,x.rgba,C);if(S)return p.toColor(S>>24&255,S>>16&255,S>>8&255)},g.opaque=function(b){const x=(255|b.rgba)>>>0;return[o,c,f]=h.toChannels(x),{css:p.toCss(o,c,f),rgba:x}},g.opacity=w,g.multiplyOpacity=function(b,x){return u=255&b.rgba,w(b,u*x/255)},g.toColorRGB=function(b){return[b.rgba>>24&255,b.rgba>>16&255,b.rgba>>8&255]}}(_||(s.color=_={})),function(g){let w,b;try{const x=document.createElement("canvas");x.width=1,x.height=1;const C=x.getContext("2d",{willReadFrequently:!0});C&&(w=C,w.globalCompositeOperation="copy",b=w.createLinearGradient(0,0,1,1))}catch{}g.toColor=function(x){if(x.match(/#[\da-f]{3,8}/i))switch(x.length){case 4:return o=parseInt(x.slice(1,2).repeat(2),16),c=parseInt(x.slice(2,3).repeat(2),16),f=parseInt(x.slice(3,4).repeat(2),16),p.toColor(o,c,f);case 5:return o=parseInt(x.slice(1,2).repeat(2),16),c=parseInt(x.slice(2,3).repeat(2),16),f=parseInt(x.slice(3,4).repeat(2),16),u=parseInt(x.slice(4,5).repeat(2),16),p.toColor(o,c,f,u);case 7:return{css:x,rgba:(parseInt(x.slice(1),16)<<8|255)>>>0};case 9:return{css:x,rgba:parseInt(x.slice(1),16)>>>0}}const C=x.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(C)return o=parseInt(C[1]),c=parseInt(C[2]),f=parseInt(C[3]),u=Math.round(255*(C[5]===void 0?1:parseFloat(C[5]))),p.toColor(o,c,f,u);if(!w||!b)throw new Error("css.toColor: Unsupported css format");if(w.fillStyle=b,w.fillStyle=x,typeof w.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(w.fillRect(0,0,1,1),[o,c,f,u]=w.getImageData(0,0,1,1).data,u!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:p.toRgba(o,c,f,u),css:x}}}(y||(s.css=y={})),function(g){function w(b,x,C){const S=b/255,k=x/255,L=C/255;return .2126*(S<=.03928?S/12.92:Math.pow((S+.055)/1.055,2.4))+.7152*(k<=.03928?k/12.92:Math.pow((k+.055)/1.055,2.4))+.0722*(L<=.03928?L/12.92:Math.pow((L+.055)/1.055,2.4))}g.relativeLuminance=function(b){return w(b>>16&255,b>>8&255,255&b)},g.relativeLuminance2=w}(v||(s.rgb=v={})),function(g){function w(x,C,S){const k=x>>24&255,L=x>>16&255,A=x>>8&255;let M=C>>24&255,D=C>>16&255,O=C>>8&255,z=d(v.relativeLuminance2(M,D,O),v.relativeLuminance2(k,L,A));for(;z<S&&(M>0||D>0||O>0);)M-=Math.max(0,Math.ceil(.1*M)),D-=Math.max(0,Math.ceil(.1*D)),O-=Math.max(0,Math.ceil(.1*O)),z=d(v.relativeLuminance2(M,D,O),v.relativeLuminance2(k,L,A));return(M<<24|D<<16|O<<8|255)>>>0}function b(x,C,S){const k=x>>24&255,L=x>>16&255,A=x>>8&255;let M=C>>24&255,D=C>>16&255,O=C>>8&255,z=d(v.relativeLuminance2(M,D,O),v.relativeLuminance2(k,L,A));for(;z<S&&(M<255||D<255||O<255);)M=Math.min(255,M+Math.ceil(.1*(255-M))),D=Math.min(255,D+Math.ceil(.1*(255-D))),O=Math.min(255,O+Math.ceil(.1*(255-O))),z=d(v.relativeLuminance2(M,D,O),v.relativeLuminance2(k,L,A));return(M<<24|D<<16|O<<8|255)>>>0}g.blend=function(x,C){if(u=(255&C)/255,u===1)return C;const S=C>>24&255,k=C>>16&255,L=C>>8&255,A=x>>24&255,M=x>>16&255,D=x>>8&255;return o=A+Math.round((S-A)*u),c=M+Math.round((k-M)*u),f=D+Math.round((L-D)*u),p.toRgba(o,c,f)},g.ensureContrastRatio=function(x,C,S){const k=v.relativeLuminance(x>>8),L=v.relativeLuminance(C>>8);if(d(k,L)<S){if(L<k){const D=w(x,C,S),O=d(k,v.relativeLuminance(D>>8));if(O<S){const z=b(x,C,S);return O>d(k,v.relativeLuminance(z>>8))?D:z}return D}const A=b(x,C,S),M=d(k,v.relativeLuminance(A>>8));if(M<S){const D=w(x,C,S);return M>d(k,v.relativeLuminance(D>>8))?A:D}return A}},g.reduceLuminance=w,g.increaseLuminance=b,g.toChannels=function(x){return[x>>24&255,x>>16&255,x>>8&255,255&x]}}(h||(s.rgba=h={})),s.toPaddedHex=m,s.contrastRatio=d},345:(l,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.runAndSubscribe=s.forwardEvent=s.EventEmitter=void 0,s.EventEmitter=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||(this._event=o=>(this._listeners.push(o),{dispose:()=>{if(!this._disposed){for(let c=0;c<this._listeners.length;c++)if(this._listeners[c]===o)return void this._listeners.splice(c,1)}}})),this._event}fire(o,c){const f=[];for(let u=0;u<this._listeners.length;u++)f.push(this._listeners[u]);for(let u=0;u<f.length;u++)f[u].call(void 0,o,c)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},s.forwardEvent=function(o,c){return o(f=>c.fire(f))},s.runAndSubscribe=function(o,c){return c(void 0),o(f=>c(f))}},859:(l,s)=>{function o(c){for(const f of c)f.dispose();c.length=0}Object.defineProperty(s,"__esModule",{value:!0}),s.getDisposeArrayDisposable=s.disposeArray=s.toDisposable=s.MutableDisposable=s.Disposable=void 0,s.Disposable=class{constructor(){this._disposables=[],this._isDisposed=!1}dispose(){this._isDisposed=!0;for(const c of this._disposables)c.dispose();this._disposables.length=0}register(c){return this._disposables.push(c),c}unregister(c){const f=this._disposables.indexOf(c);f!==-1&&this._disposables.splice(f,1)}},s.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(c){var f;this._isDisposed||c===this._value||((f=this._value)==null||f.dispose(),this._value=c)}clear(){this.value=void 0}dispose(){var c;this._isDisposed=!0,(c=this._value)==null||c.dispose(),this._value=void 0}},s.toDisposable=function(c){return{dispose:c}},s.disposeArray=o,s.getDisposeArrayDisposable=function(c){return{dispose:()=>o(c)}}},485:(l,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.FourKeyMap=s.TwoKeyMap=void 0;class o{constructor(){this._data={}}set(f,u,p){this._data[f]||(this._data[f]={}),this._data[f][u]=p}get(f,u){return this._data[f]?this._data[f][u]:void 0}clear(){this._data={}}}s.TwoKeyMap=o,s.FourKeyMap=class{constructor(){this._data=new o}set(c,f,u,p,_){this._data.get(c,f)||this._data.set(c,f,new o),this._data.get(c,f).set(u,p,_)}get(c,f,u,p){var _;return(_=this._data.get(c,f))==null?void 0:_.get(u,p)}clear(){this._data.clear()}}},399:(l,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.isChromeOS=s.isLinux=s.isWindows=s.isIphone=s.isIpad=s.isMac=s.getSafariVersion=s.isSafari=s.isLegacyEdge=s.isFirefox=s.isNode=void 0,s.isNode=typeof process<"u"&&"title"in process;const o=s.isNode?"node":navigator.userAgent,c=s.isNode?"node":navigator.platform;s.isFirefox=o.includes("Firefox"),s.isLegacyEdge=o.includes("Edge"),s.isSafari=/^((?!chrome|android).)*safari/i.test(o),s.getSafariVersion=function(){if(!s.isSafari)return 0;const f=o.match(/Version\/(\d+)/);return f===null||f.length<2?0:parseInt(f[1])},s.isMac=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(c),s.isIpad=c==="iPad",s.isIphone=c==="iPhone",s.isWindows=["Windows","Win16","Win32","WinCE"].includes(c),s.isLinux=c.indexOf("Linux")>=0,s.isChromeOS=/\bCrOS\b/.test(o)},385:(l,s,o)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.DebouncedIdleTask=s.IdleTaskQueue=s.PriorityTaskQueue=void 0;const c=o(399);class f{constructor(){this._tasks=[],this._i=0}enqueue(_){this._tasks.push(_),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(_){this._idleCallback=void 0;let y=0,v=0,h=_.timeRemaining(),m=0;for(;this._i<this._tasks.length;){if(y=Date.now(),this._tasks[this._i]()||this._i++,y=Math.max(1,Date.now()-y),v=Math.max(y,v),m=_.timeRemaining(),1.5*v>m)return h-y<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(h-y))}ms`),void this._start();h=m}this.clear()}}class u extends f{_requestCallback(_){return setTimeout(()=>_(this._createDeadline(16)))}_cancelCallback(_){clearTimeout(_)}_createDeadline(_){const y=Date.now()+_;return{timeRemaining:()=>Math.max(0,y-Date.now())}}}s.PriorityTaskQueue=u,s.IdleTaskQueue=!c.isNode&&"requestIdleCallback"in window?class extends f{_requestCallback(p){return requestIdleCallback(p)}_cancelCallback(p){cancelIdleCallback(p)}}:u,s.DebouncedIdleTask=class{constructor(){this._queue=new s.IdleTaskQueue}set(p){this._queue.clear(),this._queue.enqueue(p)}flush(){this._queue.flush()}}},147:(l,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.ExtendedAttrs=s.AttributeData=void 0;class o{constructor(){this.fg=0,this.bg=0,this.extended=new c}static toColorRGB(u){return[u>>>16&255,u>>>8&255,255&u]}static fromColorRGB(u){return(255&u[0])<<16|(255&u[1])<<8|255&u[2]}clone(){const u=new o;return u.fg=this.fg,u.bg=this.bg,u.extended=this.extended.clone(),u}isInverse(){return 67108864&this.fg}isBold(){return 134217728&this.fg}isUnderline(){return this.hasExtendedAttrs()&&this.extended.underlineStyle!==0?1:268435456&this.fg}isBlink(){return 536870912&this.fg}isInvisible(){return 1073741824&this.fg}isItalic(){return 67108864&this.bg}isDim(){return 134217728&this.bg}isStrikethrough(){return 2147483648&this.fg}isProtected(){return 536870912&this.bg}isOverline(){return 1073741824&this.bg}getFgColorMode(){return 50331648&this.fg}getBgColorMode(){return 50331648&this.bg}isFgRGB(){return(50331648&this.fg)==50331648}isBgRGB(){return(50331648&this.bg)==50331648}isFgPalette(){return(50331648&this.fg)==16777216||(50331648&this.fg)==33554432}isBgPalette(){return(50331648&this.bg)==16777216||(50331648&this.bg)==33554432}isFgDefault(){return(50331648&this.fg)==0}isBgDefault(){return(50331648&this.bg)==0}isAttributeDefault(){return this.fg===0&&this.bg===0}getFgColor(){switch(50331648&this.fg){case 16777216:case 33554432:return 255&this.fg;case 50331648:return 16777215&this.fg;default:return-1}}getBgColor(){switch(50331648&this.bg){case 16777216:case 33554432:return 255&this.bg;case 50331648:return 16777215&this.bg;default:return-1}}hasExtendedAttrs(){return 268435456&this.bg}updateExtended(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456}getUnderlineColor(){if(268435456&this.bg&&~this.extended.underlineColor)switch(50331648&this.extended.underlineColor){case 16777216:case 33554432:return 255&this.extended.underlineColor;case 50331648:return 16777215&this.extended.underlineColor;default:return this.getFgColor()}return this.getFgColor()}getUnderlineColorMode(){return 268435456&this.bg&&~this.extended.underlineColor?50331648&this.extended.underlineColor:this.getFgColorMode()}isUnderlineColorRGB(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==50331648:this.isFgRGB()}isUnderlineColorPalette(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==16777216||(50331648&this.extended.underlineColor)==33554432:this.isFgPalette()}isUnderlineColorDefault(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==0:this.isFgDefault()}getUnderlineStyle(){return 268435456&this.fg?268435456&this.bg?this.extended.underlineStyle:1:0}getUnderlineVariantOffset(){return this.extended.underlineVariantOffset}}s.AttributeData=o;class c{get ext(){return this._urlId?-469762049&this._ext|this.underlineStyle<<26:this._ext}set ext(u){this._ext=u}get underlineStyle(){return this._urlId?5:(469762048&this._ext)>>26}set underlineStyle(u){this._ext&=-469762049,this._ext|=u<<26&469762048}get underlineColor(){return 67108863&this._ext}set underlineColor(u){this._ext&=-67108864,this._ext|=67108863&u}get urlId(){return this._urlId}set urlId(u){this._urlId=u}get underlineVariantOffset(){const u=(3758096384&this._ext)>>29;return u<0?4294967288^u:u}set underlineVariantOffset(u){this._ext&=536870911,this._ext|=u<<29&3758096384}constructor(u=0,p=0){this._ext=0,this._urlId=0,this._ext=u,this._urlId=p}clone(){return new c(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}}s.ExtendedAttrs=c},782:(l,s,o)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.CellData=void 0;const c=o(133),f=o(855),u=o(147);class p extends u.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new u.ExtendedAttrs,this.combinedData=""}static fromCharData(y){const v=new p;return v.setFromCharData(y),v}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(y){this.fg=y[f.CHAR_DATA_ATTR_INDEX],this.bg=0;let v=!1;if(y[f.CHAR_DATA_CHAR_INDEX].length>2)v=!0;else if(y[f.CHAR_DATA_CHAR_INDEX].length===2){const h=y[f.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=h&&h<=56319){const m=y[f.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=m&&m<=57343?this.content=1024*(h-55296)+m-56320+65536|y[f.CHAR_DATA_WIDTH_INDEX]<<22:v=!0}else v=!0}else this.content=y[f.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|y[f.CHAR_DATA_WIDTH_INDEX]<<22;v&&(this.combinedData=y[f.CHAR_DATA_CHAR_INDEX],this.content=2097152|y[f.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}s.CellData=p},855:(l,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.WHITESPACE_CELL_CODE=s.WHITESPACE_CELL_WIDTH=s.WHITESPACE_CELL_CHAR=s.NULL_CELL_CODE=s.NULL_CELL_WIDTH=s.NULL_CELL_CHAR=s.CHAR_DATA_CODE_INDEX=s.CHAR_DATA_WIDTH_INDEX=s.CHAR_DATA_CHAR_INDEX=s.CHAR_DATA_ATTR_INDEX=s.DEFAULT_EXT=s.DEFAULT_ATTR=s.DEFAULT_COLOR=void 0,s.DEFAULT_COLOR=0,s.DEFAULT_ATTR=256|s.DEFAULT_COLOR<<9,s.DEFAULT_EXT=0,s.CHAR_DATA_ATTR_INDEX=0,s.CHAR_DATA_CHAR_INDEX=1,s.CHAR_DATA_WIDTH_INDEX=2,s.CHAR_DATA_CODE_INDEX=3,s.NULL_CELL_CHAR="",s.NULL_CELL_WIDTH=1,s.NULL_CELL_CODE=0,s.WHITESPACE_CELL_CHAR=" ",s.WHITESPACE_CELL_WIDTH=1,s.WHITESPACE_CELL_CODE=32},133:(l,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.Utf8ToUtf32=s.StringToUtf32=s.utf32ToString=s.stringFromCodePoint=void 0,s.stringFromCodePoint=function(o){return o>65535?(o-=65536,String.fromCharCode(55296+(o>>10))+String.fromCharCode(o%1024+56320)):String.fromCharCode(o)},s.utf32ToString=function(o,c=0,f=o.length){let u="";for(let p=c;p<f;++p){let _=o[p];_>65535?(_-=65536,u+=String.fromCharCode(55296+(_>>10))+String.fromCharCode(_%1024+56320)):u+=String.fromCharCode(_)}return u},s.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(o,c){const f=o.length;if(!f)return 0;let u=0,p=0;if(this._interim){const _=o.charCodeAt(p++);56320<=_&&_<=57343?c[u++]=1024*(this._interim-55296)+_-56320+65536:(c[u++]=this._interim,c[u++]=_),this._interim=0}for(let _=p;_<f;++_){const y=o.charCodeAt(_);if(55296<=y&&y<=56319){if(++_>=f)return this._interim=y,u;const v=o.charCodeAt(_);56320<=v&&v<=57343?c[u++]=1024*(y-55296)+v-56320+65536:(c[u++]=y,c[u++]=v)}else y!==65279&&(c[u++]=y)}return u}},s.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(o,c){const f=o.length;if(!f)return 0;let u,p,_,y,v=0,h=0,m=0;if(this.interim[0]){let w=!1,b=this.interim[0];b&=(224&b)==192?31:(240&b)==224?15:7;let x,C=0;for(;(x=63&this.interim[++C])&&C<4;)b<<=6,b|=x;const S=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,k=S-C;for(;m<k;){if(m>=f)return 0;if(x=o[m++],(192&x)!=128){m--,w=!0;break}this.interim[C++]=x,b<<=6,b|=63&x}w||(S===2?b<128?m--:c[v++]=b:S===3?b<2048||b>=55296&&b<=57343||b===65279||(c[v++]=b):b<65536||b>1114111||(c[v++]=b)),this.interim.fill(0)}const d=f-4;let g=m;for(;g<f;){for(;!(!(g<d)||128&(u=o[g])||128&(p=o[g+1])||128&(_=o[g+2])||128&(y=o[g+3]));)c[v++]=u,c[v++]=p,c[v++]=_,c[v++]=y,g+=4;if(u=o[g++],u<128)c[v++]=u;else if((224&u)==192){if(g>=f)return this.interim[0]=u,v;if(p=o[g++],(192&p)!=128){g--;continue}if(h=(31&u)<<6|63&p,h<128){g--;continue}c[v++]=h}else if((240&u)==224){if(g>=f)return this.interim[0]=u,v;if(p=o[g++],(192&p)!=128){g--;continue}if(g>=f)return this.interim[0]=u,this.interim[1]=p,v;if(_=o[g++],(192&_)!=128){g--;continue}if(h=(15&u)<<12|(63&p)<<6|63&_,h<2048||h>=55296&&h<=57343||h===65279)continue;c[v++]=h}else if((248&u)==240){if(g>=f)return this.interim[0]=u,v;if(p=o[g++],(192&p)!=128){g--;continue}if(g>=f)return this.interim[0]=u,this.interim[1]=p,v;if(_=o[g++],(192&_)!=128){g--;continue}if(g>=f)return this.interim[0]=u,this.interim[1]=p,this.interim[2]=_,v;if(y=o[g++],(192&y)!=128){g--;continue}if(h=(7&u)<<18|(63&p)<<12|(63&_)<<6|63&y,h<65536||h>1114111)continue;c[v++]=h}}return v}}},776:function(l,s,o){var c=this&&this.__decorate||function(h,m,d,g){var w,b=arguments.length,x=b<3?m:g===null?g=Object.getOwnPropertyDescriptor(m,d):g;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")x=Reflect.decorate(h,m,d,g);else for(var C=h.length-1;C>=0;C--)(w=h[C])&&(x=(b<3?w(x):b>3?w(m,d,x):w(m,d))||x);return b>3&&x&&Object.defineProperty(m,d,x),x},f=this&&this.__param||function(h,m){return function(d,g){m(d,g,h)}};Object.defineProperty(s,"__esModule",{value:!0}),s.traceCall=s.setTraceLogger=s.LogService=void 0;const u=o(859),p=o(97),_={trace:p.LogLevelEnum.TRACE,debug:p.LogLevelEnum.DEBUG,info:p.LogLevelEnum.INFO,warn:p.LogLevelEnum.WARN,error:p.LogLevelEnum.ERROR,off:p.LogLevelEnum.OFF};let y,v=s.LogService=class extends u.Disposable{get logLevel(){return this._logLevel}constructor(h){super(),this._optionsService=h,this._logLevel=p.LogLevelEnum.OFF,this._updateLogLevel(),this.register(this._optionsService.onSpecificOptionChange("logLevel",()=>this._updateLogLevel())),y=this}_updateLogLevel(){this._logLevel=_[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(h){for(let m=0;m<h.length;m++)typeof h[m]=="function"&&(h[m]=h[m]())}_log(h,m,d){this._evalLazyOptionalParams(d),h.call(console,(this._optionsService.options.logger?"":"xterm.js: ")+m,...d)}trace(h,...m){var d;this._logLevel<=p.LogLevelEnum.TRACE&&this._log(((d=this._optionsService.options.logger)==null?void 0:d.trace.bind(this._optionsService.options.logger))??console.log,h,m)}debug(h,...m){var d;this._logLevel<=p.LogLevelEnum.DEBUG&&this._log(((d=this._optionsService.options.logger)==null?void 0:d.debug.bind(this._optionsService.options.logger))??console.log,h,m)}info(h,...m){var d;this._logLevel<=p.LogLevelEnum.INFO&&this._log(((d=this._optionsService.options.logger)==null?void 0:d.info.bind(this._optionsService.options.logger))??console.info,h,m)}warn(h,...m){var d;this._logLevel<=p.LogLevelEnum.WARN&&this._log(((d=this._optionsService.options.logger)==null?void 0:d.warn.bind(this._optionsService.options.logger))??console.warn,h,m)}error(h,...m){var d;this._logLevel<=p.LogLevelEnum.ERROR&&this._log(((d=this._optionsService.options.logger)==null?void 0:d.error.bind(this._optionsService.options.logger))??console.error,h,m)}};s.LogService=v=c([f(0,p.IOptionsService)],v),s.setTraceLogger=function(h){y=h},s.traceCall=function(h,m,d){if(typeof d.value!="function")throw new Error("not supported");const g=d.value;d.value=function(...w){if(y.logLevel!==p.LogLevelEnum.TRACE)return g.apply(this,w);y.trace(`GlyphRenderer#${g.name}(${w.map(x=>JSON.stringify(x)).join(", ")})`);const b=g.apply(this,w);return y.trace(`GlyphRenderer#${g.name} return`,b),b}}},726:(l,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.createDecorator=s.getServiceDependencies=s.serviceRegistry=void 0;const o="di$target",c="di$dependencies";s.serviceRegistry=new Map,s.getServiceDependencies=function(f){return f[c]||[]},s.createDecorator=function(f){if(s.serviceRegistry.has(f))return s.serviceRegistry.get(f);const u=function(p,_,y){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");(function(v,h,m){h[o]===h?h[c].push({id:v,index:m}):(h[c]=[{id:v,index:m}],h[o]=h)})(u,p,y)};return u.toString=()=>f,s.serviceRegistry.set(f,u),u}},97:(l,s,o)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.IDecorationService=s.IUnicodeService=s.IOscLinkService=s.IOptionsService=s.ILogService=s.LogLevelEnum=s.IInstantiationService=s.ICharsetService=s.ICoreService=s.ICoreMouseService=s.IBufferService=void 0;const c=o(726);var f;s.IBufferService=(0,c.createDecorator)("BufferService"),s.ICoreMouseService=(0,c.createDecorator)("CoreMouseService"),s.ICoreService=(0,c.createDecorator)("CoreService"),s.ICharsetService=(0,c.createDecorator)("CharsetService"),s.IInstantiationService=(0,c.createDecorator)("InstantiationService"),function(u){u[u.TRACE=0]="TRACE",u[u.DEBUG=1]="DEBUG",u[u.INFO=2]="INFO",u[u.WARN=3]="WARN",u[u.ERROR=4]="ERROR",u[u.OFF=5]="OFF"}(f||(s.LogLevelEnum=f={})),s.ILogService=(0,c.createDecorator)("LogService"),s.IOptionsService=(0,c.createDecorator)("OptionsService"),s.IOscLinkService=(0,c.createDecorator)("OscLinkService"),s.IUnicodeService=(0,c.createDecorator)("UnicodeService"),s.IDecorationService=(0,c.createDecorator)("DecorationService")}},n={};function i(l){var s=n[l];if(s!==void 0)return s.exports;var o=n[l]={exports:{}};return r[l].call(o.exports,o,o.exports,i),o.exports}var a={};return(()=>{var l=a;Object.defineProperty(l,"__esModule",{value:!0}),l.WebglAddon=void 0;const s=i(345),o=i(859),c=i(399),f=i(666),u=i(776);class p extends o.Disposable{constructor(y){if(c.isSafari&&(0,c.getSafariVersion)()<16){const v={antialias:!1,depth:!1,preserveDrawingBuffer:!0};if(!document.createElement("canvas").getContext("webgl2",v))throw new Error("Webgl2 is only supported on Safari 16 and above")}super(),this._preserveDrawingBuffer=y,this._onChangeTextureAtlas=this.register(new s.EventEmitter),this.onChangeTextureAtlas=this._onChangeTextureAtlas.event,this._onAddTextureAtlasCanvas=this.register(new s.EventEmitter),this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event,this._onRemoveTextureAtlasCanvas=this.register(new s.EventEmitter),this.onRemoveTextureAtlasCanvas=this._onRemoveTextureAtlasCanvas.event,this._onContextLoss=this.register(new s.EventEmitter),this.onContextLoss=this._onContextLoss.event}activate(y){const v=y._core;if(!y.element)return void this.register(v.onWillOpen(()=>this.activate(y)));this._terminal=y;const h=v.coreService,m=v.optionsService,d=v,g=d._renderService,w=d._characterJoinerService,b=d._charSizeService,x=d._coreBrowserService,C=d._decorationService,S=d._logService,k=d._themeService;(0,u.setTraceLogger)(S),this._renderer=this.register(new f.WebglRenderer(y,w,b,x,h,C,m,k,this._preserveDrawingBuffer)),this.register((0,s.forwardEvent)(this._renderer.onContextLoss,this._onContextLoss)),this.register((0,s.forwardEvent)(this._renderer.onChangeTextureAtlas,this._onChangeTextureAtlas)),this.register((0,s.forwardEvent)(this._renderer.onAddTextureAtlasCanvas,this._onAddTextureAtlasCanvas)),this.register((0,s.forwardEvent)(this._renderer.onRemoveTextureAtlasCanvas,this._onRemoveTextureAtlasCanvas)),g.setRenderer(this._renderer),this.register((0,o.toDisposable)(()=>{const L=this._terminal._core._renderService;L.setRenderer(this._terminal._core._createRenderer()),L.handleResize(y.cols,y.rows)}))}get textureAtlas(){var y;return(y=this._renderer)==null?void 0:y.textureAtlas}clearTextureAtlas(){var y;(y=this._renderer)==null||y.clearTextureAtlas()}}l.WebglAddon=p})(),a})())})(_w);var fv=_w.exports;/**
|
|
128
|
+
}`)),this.register((0,f.toDisposable)(()=>M.deleteProgram(this._program))),this._projectionLocation=(0,c.throwIfFalsy)(M.getUniformLocation(this._program,"u_projection")),this._vertexArrayObject=M.createVertexArray(),M.bindVertexArray(this._vertexArrayObject);const D=new Float32Array([0,0,1,0,0,1,1,1]),O=M.createBuffer();this.register((0,f.toDisposable)(()=>M.deleteBuffer(O))),M.bindBuffer(M.ARRAY_BUFFER,O),M.bufferData(M.ARRAY_BUFFER,D,M.STATIC_DRAW),M.enableVertexAttribArray(3),M.vertexAttribPointer(3,2,this._gl.FLOAT,!1,0,0);const z=new Uint8Array([0,1,2,3]),F=M.createBuffer();this.register((0,f.toDisposable)(()=>M.deleteBuffer(F))),M.bindBuffer(M.ELEMENT_ARRAY_BUFFER,F),M.bufferData(M.ELEMENT_ARRAY_BUFFER,z,M.STATIC_DRAW),this._attributesBuffer=(0,c.throwIfFalsy)(M.createBuffer()),this.register((0,f.toDisposable)(()=>M.deleteBuffer(this._attributesBuffer))),M.bindBuffer(M.ARRAY_BUFFER,this._attributesBuffer),M.enableVertexAttribArray(0),M.vertexAttribPointer(0,2,M.FLOAT,!1,_,0),M.vertexAttribDivisor(0,1),M.enableVertexAttribArray(1),M.vertexAttribPointer(1,2,M.FLOAT,!1,_,2*Float32Array.BYTES_PER_ELEMENT),M.vertexAttribDivisor(1,1),M.enableVertexAttribArray(2),M.vertexAttribPointer(2,4,M.FLOAT,!1,_,4*Float32Array.BYTES_PER_ELEMENT),M.vertexAttribDivisor(2,1),this._updateCachedColors(A.colors),this.register(this._themeService.onChangeColors(H=>{this._updateCachedColors(H),this._updateViewportRectangle()}))}renderBackgrounds(){this._renderVertices(this._vertices)}renderCursor(){this._renderVertices(this._verticesCursor)}_renderVertices(S){const k=this._gl;k.useProgram(this._program),k.bindVertexArray(this._vertexArrayObject),k.uniformMatrix4fv(this._projectionLocation,!1,p.PROJECTION_MATRIX),k.bindBuffer(k.ARRAY_BUFFER,this._attributesBuffer),k.bufferData(k.ARRAY_BUFFER,S.attributes,k.DYNAMIC_DRAW),k.drawElementsInstanced(this._gl.TRIANGLE_STRIP,4,k.UNSIGNED_BYTE,0,S.count)}handleResize(){this._updateViewportRectangle()}setDimensions(S){this._dimensions=S}_updateCachedColors(S){this._bgFloat=this._colorToFloat32Array(S.background),this._cursorFloat=this._colorToFloat32Array(S.cursor)}_updateViewportRectangle(){this._addRectangleFloat(this._vertices.attributes,0,0,0,this._terminal.cols*this._dimensions.device.cell.width,this._terminal.rows*this._dimensions.device.cell.height,this._bgFloat)}updateBackgrounds(S){const k=this._terminal,L=this._vertices;let A,M,D,O,z,F,H,I,R,P,N,j=1;for(A=0;A<k.rows;A++){for(D=-1,O=0,z=0,F=!1,M=0;M<k.cols;M++)H=(A*k.cols+M)*u.RENDER_MODEL_INDICIES_PER_CELL,I=S.cells[H+u.RENDER_MODEL_BG_OFFSET],R=S.cells[H+u.RENDER_MODEL_FG_OFFSET],P=!!(67108864&R),(I!==O||R!==z&&(F||P))&&((O!==0||F&&z!==0)&&(N=8*j++,this._updateRectangle(L,N,z,O,D,M,A)),D=M,O=I,z=R,F=P);(O!==0||F&&z!==0)&&(N=8*j++,this._updateRectangle(L,N,z,O,D,k.cols,A))}L.count=j}updateCursor(S){const k=this._verticesCursor,L=S.cursor;if(!L||L.style==="block")return void(k.count=0);let A,M=0;L.style!=="bar"&&L.style!=="outline"||(A=8*M++,this._addRectangleFloat(k.attributes,A,L.x*this._dimensions.device.cell.width,L.y*this._dimensions.device.cell.height,L.style==="bar"?L.dpr*L.cursorWidth:L.dpr,this._dimensions.device.cell.height,this._cursorFloat)),L.style!=="underline"&&L.style!=="outline"||(A=8*M++,this._addRectangleFloat(k.attributes,A,L.x*this._dimensions.device.cell.width,(L.y+1)*this._dimensions.device.cell.height-L.dpr,L.width*this._dimensions.device.cell.width,L.dpr,this._cursorFloat)),L.style==="outline"&&(A=8*M++,this._addRectangleFloat(k.attributes,A,L.x*this._dimensions.device.cell.width,L.y*this._dimensions.device.cell.height,L.width*this._dimensions.device.cell.width,L.dpr,this._cursorFloat),A=8*M++,this._addRectangleFloat(k.attributes,A,(L.x+L.width)*this._dimensions.device.cell.width-L.dpr,L.y*this._dimensions.device.cell.height,L.dpr,this._dimensions.device.cell.height,this._cursorFloat)),k.count=M}_updateRectangle(S,k,L,A,M,D,O){if(67108864&L)switch(50331648&L){case 16777216:case 33554432:v=this._themeService.colors.ansi[255&L].rgba;break;case 50331648:v=(16777215&L)<<8;break;default:v=this._themeService.colors.foreground.rgba}else switch(50331648&A){case 16777216:case 33554432:v=this._themeService.colors.ansi[255&A].rgba;break;case 50331648:v=(16777215&A)<<8;break;default:v=this._themeService.colors.background.rgba}S.attributes.length<k+4&&(S.attributes=(0,p.expandFloat32Array)(S.attributes,this._terminal.rows*this._terminal.cols*8)),h=M*this._dimensions.device.cell.width,m=O*this._dimensions.device.cell.height,d=(v>>24&255)/255,g=(v>>16&255)/255,w=(v>>8&255)/255,b=1,this._addRectangle(S.attributes,k,h,m,(D-M)*this._dimensions.device.cell.width,this._dimensions.device.cell.height,d,g,w,b)}_addRectangle(S,k,L,A,M,D,O,z,F,H){S[k]=L/this._dimensions.device.canvas.width,S[k+1]=A/this._dimensions.device.canvas.height,S[k+2]=M/this._dimensions.device.canvas.width,S[k+3]=D/this._dimensions.device.canvas.height,S[k+4]=O,S[k+5]=z,S[k+6]=F,S[k+7]=H}_addRectangleFloat(S,k,L,A,M,D,O){S[k]=L/this._dimensions.device.canvas.width,S[k+1]=A/this._dimensions.device.canvas.height,S[k+2]=M/this._dimensions.device.canvas.width,S[k+3]=D/this._dimensions.device.canvas.height,S[k+4]=O[0],S[k+5]=O[1],S[k+6]=O[2],S[k+7]=O[3]}_colorToFloat32Array(S){return new Float32Array([(S.rgba>>24&255)/255,(S.rgba>>16&255)/255,(S.rgba>>8&255)/255,(255&S.rgba)/255])}}s.RectangleRenderer=x},310:(l,s,o)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.RenderModel=s.COMBINED_CHAR_BIT_MASK=s.RENDER_MODEL_EXT_OFFSET=s.RENDER_MODEL_FG_OFFSET=s.RENDER_MODEL_BG_OFFSET=s.RENDER_MODEL_INDICIES_PER_CELL=void 0;const c=o(296);s.RENDER_MODEL_INDICIES_PER_CELL=4,s.RENDER_MODEL_BG_OFFSET=1,s.RENDER_MODEL_FG_OFFSET=2,s.RENDER_MODEL_EXT_OFFSET=3,s.COMBINED_CHAR_BIT_MASK=2147483648,s.RenderModel=class{constructor(){this.cells=new Uint32Array(0),this.lineLengths=new Uint32Array(0),this.selection=(0,c.createSelectionRenderModel)()}resize(f,u){const p=f*u*s.RENDER_MODEL_INDICIES_PER_CELL;p!==this.cells.length&&(this.cells=new Uint32Array(p),this.lineLengths=new Uint32Array(u))}clear(){this.cells.fill(0,0),this.lineLengths.fill(0,0)}}},666:(l,s,o)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.JoinedCellData=s.WebglRenderer=void 0;const c=o(820),f=o(274),u=o(627),p=o(457),_=o(56),y=o(374),v=o(345),h=o(859),m=o(147),d=o(782),g=o(855),w=o(965),b=o(742),x=o(310),C=o(733);class S extends h.Disposable{constructor(M,D,O,z,F,H,I,R,P){super(),this._terminal=M,this._characterJoinerService=D,this._charSizeService=O,this._coreBrowserService=z,this._coreService=F,this._decorationService=H,this._optionsService=I,this._themeService=R,this._cursorBlinkStateManager=new h.MutableDisposable,this._charAtlasDisposable=this.register(new h.MutableDisposable),this._observerDisposable=this.register(new h.MutableDisposable),this._model=new x.RenderModel,this._workCell=new d.CellData,this._workCell2=new d.CellData,this._rectangleRenderer=this.register(new h.MutableDisposable),this._glyphRenderer=this.register(new h.MutableDisposable),this._onChangeTextureAtlas=this.register(new v.EventEmitter),this.onChangeTextureAtlas=this._onChangeTextureAtlas.event,this._onAddTextureAtlasCanvas=this.register(new v.EventEmitter),this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event,this._onRemoveTextureAtlasCanvas=this.register(new v.EventEmitter),this.onRemoveTextureAtlasCanvas=this._onRemoveTextureAtlasCanvas.event,this._onRequestRedraw=this.register(new v.EventEmitter),this.onRequestRedraw=this._onRequestRedraw.event,this._onContextLoss=this.register(new v.EventEmitter),this.onContextLoss=this._onContextLoss.event,this.register(this._themeService.onChangeColors(()=>this._handleColorChange())),this._cellColorResolver=new f.CellColorResolver(this._terminal,this._optionsService,this._model.selection,this._decorationService,this._coreBrowserService,this._themeService),this._core=this._terminal._core,this._renderLayers=[new C.LinkRenderLayer(this._core.screenElement,2,this._terminal,this._core.linkifier,this._coreBrowserService,I,this._themeService)],this.dimensions=(0,y.createRenderDimensions)(),this._devicePixelRatio=this._coreBrowserService.dpr,this._updateDimensions(),this._updateCursorBlink(),this.register(I.onOptionChange(()=>this._handleOptionsChanged())),this._canvas=this._coreBrowserService.mainDocument.createElement("canvas");const N={antialias:!1,depth:!1,preserveDrawingBuffer:P};if(this._gl=this._canvas.getContext("webgl2",N),!this._gl)throw new Error("WebGL2 not supported "+this._gl);this.register((0,c.addDisposableDomListener)(this._canvas,"webglcontextlost",j=>{console.log("webglcontextlost event received"),j.preventDefault(),this._contextRestorationTimeout=setTimeout(()=>{this._contextRestorationTimeout=void 0,console.warn("webgl context not restored; firing onContextLoss"),this._onContextLoss.fire(j)},3e3)})),this.register((0,c.addDisposableDomListener)(this._canvas,"webglcontextrestored",j=>{console.warn("webglcontextrestored event received"),clearTimeout(this._contextRestorationTimeout),this._contextRestorationTimeout=void 0,(0,u.removeTerminalFromCache)(this._terminal),this._initializeWebGLState(),this._requestRedrawViewport()})),this._observerDisposable.value=(0,_.observeDevicePixelDimensions)(this._canvas,this._coreBrowserService.window,(j,W)=>this._setCanvasDevicePixelDimensions(j,W)),this.register(this._coreBrowserService.onWindowChange(j=>{this._observerDisposable.value=(0,_.observeDevicePixelDimensions)(this._canvas,j,(W,V)=>this._setCanvasDevicePixelDimensions(W,V))})),this._core.screenElement.appendChild(this._canvas),[this._rectangleRenderer.value,this._glyphRenderer.value]=this._initializeWebGLState(),this._isAttached=this._coreBrowserService.window.document.body.contains(this._core.screenElement),this.register((0,h.toDisposable)(()=>{var j;for(const W of this._renderLayers)W.dispose();(j=this._canvas.parentElement)==null||j.removeChild(this._canvas),(0,u.removeTerminalFromCache)(this._terminal)}))}get textureAtlas(){var M;return(M=this._charAtlas)==null?void 0:M.pages[0].canvas}_handleColorChange(){this._refreshCharAtlas(),this._clearModel(!0)}handleDevicePixelRatioChange(){this._devicePixelRatio!==this._coreBrowserService.dpr&&(this._devicePixelRatio=this._coreBrowserService.dpr,this.handleResize(this._terminal.cols,this._terminal.rows))}handleResize(M,D){var O,z,F,H;this._updateDimensions(),this._model.resize(this._terminal.cols,this._terminal.rows);for(const I of this._renderLayers)I.resize(this._terminal,this.dimensions);this._canvas.width=this.dimensions.device.canvas.width,this._canvas.height=this.dimensions.device.canvas.height,this._canvas.style.width=`${this.dimensions.css.canvas.width}px`,this._canvas.style.height=`${this.dimensions.css.canvas.height}px`,this._core.screenElement.style.width=`${this.dimensions.css.canvas.width}px`,this._core.screenElement.style.height=`${this.dimensions.css.canvas.height}px`,(O=this._rectangleRenderer.value)==null||O.setDimensions(this.dimensions),(z=this._rectangleRenderer.value)==null||z.handleResize(),(F=this._glyphRenderer.value)==null||F.setDimensions(this.dimensions),(H=this._glyphRenderer.value)==null||H.handleResize(),this._refreshCharAtlas(),this._clearModel(!1)}handleCharSizeChanged(){this.handleResize(this._terminal.cols,this._terminal.rows)}handleBlur(){var M;for(const D of this._renderLayers)D.handleBlur(this._terminal);(M=this._cursorBlinkStateManager.value)==null||M.pause(),this._requestRedrawViewport()}handleFocus(){var M;for(const D of this._renderLayers)D.handleFocus(this._terminal);(M=this._cursorBlinkStateManager.value)==null||M.resume(),this._requestRedrawViewport()}handleSelectionChanged(M,D,O){for(const z of this._renderLayers)z.handleSelectionChanged(this._terminal,M,D,O);this._model.selection.update(this._core,M,D,O),this._requestRedrawViewport()}handleCursorMove(){var M;for(const D of this._renderLayers)D.handleCursorMove(this._terminal);(M=this._cursorBlinkStateManager.value)==null||M.restartBlinkAnimation()}_handleOptionsChanged(){this._updateDimensions(),this._refreshCharAtlas(),this._updateCursorBlink()}_initializeWebGLState(){return this._rectangleRenderer.value=new b.RectangleRenderer(this._terminal,this._gl,this.dimensions,this._themeService),this._glyphRenderer.value=new w.GlyphRenderer(this._terminal,this._gl,this.dimensions,this._optionsService),this.handleCharSizeChanged(),[this._rectangleRenderer.value,this._glyphRenderer.value]}_refreshCharAtlas(){var D;if(this.dimensions.device.char.width<=0&&this.dimensions.device.char.height<=0)return void(this._isAttached=!1);const M=(0,u.acquireTextureAtlas)(this._terminal,this._optionsService.rawOptions,this._themeService.colors,this.dimensions.device.cell.width,this.dimensions.device.cell.height,this.dimensions.device.char.width,this.dimensions.device.char.height,this._coreBrowserService.dpr);this._charAtlas!==M&&(this._onChangeTextureAtlas.fire(M.pages[0].canvas),this._charAtlasDisposable.value=(0,h.getDisposeArrayDisposable)([(0,v.forwardEvent)(M.onAddTextureAtlasCanvas,this._onAddTextureAtlasCanvas),(0,v.forwardEvent)(M.onRemoveTextureAtlasCanvas,this._onRemoveTextureAtlasCanvas)])),this._charAtlas=M,this._charAtlas.warmUp(),(D=this._glyphRenderer.value)==null||D.setAtlas(this._charAtlas)}_clearModel(M){var D;this._model.clear(),M&&((D=this._glyphRenderer.value)==null||D.clear())}clearTextureAtlas(){var M;(M=this._charAtlas)==null||M.clearTexture(),this._clearModel(!0),this._requestRedrawViewport()}clear(){var M;this._clearModel(!0);for(const D of this._renderLayers)D.reset(this._terminal);(M=this._cursorBlinkStateManager.value)==null||M.restartBlinkAnimation(),this._updateCursorBlink()}registerCharacterJoiner(M){return-1}deregisterCharacterJoiner(M){return!1}renderRows(M,D){if(!this._isAttached){if(!(this._coreBrowserService.window.document.body.contains(this._core.screenElement)&&this._charSizeService.width&&this._charSizeService.height))return;this._updateDimensions(),this._refreshCharAtlas(),this._isAttached=!0}for(const O of this._renderLayers)O.handleGridChanged(this._terminal,M,D);this._glyphRenderer.value&&this._rectangleRenderer.value&&(this._glyphRenderer.value.beginFrame()?(this._clearModel(!0),this._updateModel(0,this._terminal.rows-1)):this._updateModel(M,D),this._rectangleRenderer.value.renderBackgrounds(),this._glyphRenderer.value.render(this._model),this._cursorBlinkStateManager.value&&!this._cursorBlinkStateManager.value.isCursorVisible||this._rectangleRenderer.value.renderCursor())}_updateCursorBlink(){this._terminal.options.cursorBlink?this._cursorBlinkStateManager.value=new p.CursorBlinkStateManager(()=>{this._requestRedrawCursor()},this._coreBrowserService):this._cursorBlinkStateManager.clear(),this._requestRedrawCursor()}_updateModel(M,D){const O=this._core;let z,F,H,I,R,P,N,j,W,V,Z,Q,$,B,K=this._workCell;M=L(M,O.rows-1,0),D=L(D,O.rows-1,0);const U=this._terminal.buffer.active.baseY+this._terminal.buffer.active.cursorY,te=U-O.buffer.ydisp,Y=Math.min(this._terminal.buffer.active.cursorX,O.cols-1);let ye=-1;const pe=this._coreService.isCursorInitialized&&!this._coreService.isCursorHidden&&(!this._cursorBlinkStateManager.value||this._cursorBlinkStateManager.value.isCursorVisible);this._model.cursor=void 0;let ne=!1;for(F=M;F<=D;F++)for(H=F+O.buffer.ydisp,I=O.buffer.lines.get(H),this._model.lineLengths[F]=0,R=this._characterJoinerService.getJoinedCharacters(H),$=0;$<O.cols;$++)if(z=this._cellColorResolver.result.bg,I.loadCell($,K),$===0&&(z=this._cellColorResolver.result.bg),P=!1,N=$,R.length>0&&$===R[0][0]&&(P=!0,j=R.shift(),K=new k(K,I.translateToString(!0,j[0],j[1]),j[1]-j[0]),N=j[1]-1),W=K.getChars(),V=K.getCode(),Q=(F*O.cols+$)*x.RENDER_MODEL_INDICIES_PER_CELL,this._cellColorResolver.resolve(K,$,H,this.dimensions.device.cell.width),pe&&H===U&&($===Y&&(this._model.cursor={x:Y,y:te,width:K.getWidth(),style:this._coreBrowserService.isFocused?O.options.cursorStyle||"block":O.options.cursorInactiveStyle,cursorWidth:O.options.cursorWidth,dpr:this._devicePixelRatio},ye=Y+K.getWidth()-1),$>=Y&&$<=ye&&(this._coreBrowserService.isFocused&&(O.options.cursorStyle||"block")==="block"||this._coreBrowserService.isFocused===!1&&O.options.cursorInactiveStyle==="block")&&(this._cellColorResolver.result.fg=50331648|this._themeService.colors.cursorAccent.rgba>>8&16777215,this._cellColorResolver.result.bg=50331648|this._themeService.colors.cursor.rgba>>8&16777215)),V!==g.NULL_CELL_CODE&&(this._model.lineLengths[F]=$+1),(this._model.cells[Q]!==V||this._model.cells[Q+x.RENDER_MODEL_BG_OFFSET]!==this._cellColorResolver.result.bg||this._model.cells[Q+x.RENDER_MODEL_FG_OFFSET]!==this._cellColorResolver.result.fg||this._model.cells[Q+x.RENDER_MODEL_EXT_OFFSET]!==this._cellColorResolver.result.ext)&&(ne=!0,W.length>1&&(V|=x.COMBINED_CHAR_BIT_MASK),this._model.cells[Q]=V,this._model.cells[Q+x.RENDER_MODEL_BG_OFFSET]=this._cellColorResolver.result.bg,this._model.cells[Q+x.RENDER_MODEL_FG_OFFSET]=this._cellColorResolver.result.fg,this._model.cells[Q+x.RENDER_MODEL_EXT_OFFSET]=this._cellColorResolver.result.ext,Z=K.getWidth(),this._glyphRenderer.value.updateCell($,F,V,this._cellColorResolver.result.bg,this._cellColorResolver.result.fg,this._cellColorResolver.result.ext,W,Z,z),P))for(K=this._workCell,$++;$<N;$++)B=(F*O.cols+$)*x.RENDER_MODEL_INDICIES_PER_CELL,this._glyphRenderer.value.updateCell($,F,g.NULL_CELL_CODE,0,0,0,g.NULL_CELL_CHAR,0,0),this._model.cells[B]=g.NULL_CELL_CODE,this._model.cells[B+x.RENDER_MODEL_BG_OFFSET]=this._cellColorResolver.result.bg,this._model.cells[B+x.RENDER_MODEL_FG_OFFSET]=this._cellColorResolver.result.fg,this._model.cells[B+x.RENDER_MODEL_EXT_OFFSET]=this._cellColorResolver.result.ext;ne&&this._rectangleRenderer.value.updateBackgrounds(this._model),this._rectangleRenderer.value.updateCursor(this._model)}_updateDimensions(){this._charSizeService.width&&this._charSizeService.height&&(this.dimensions.device.char.width=Math.floor(this._charSizeService.width*this._devicePixelRatio),this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*this._devicePixelRatio),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._terminal.rows*this.dimensions.device.cell.height,this.dimensions.device.canvas.width=this._terminal.cols*this.dimensions.device.cell.width,this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/this._devicePixelRatio),this.dimensions.css.canvas.width=Math.round(this.dimensions.device.canvas.width/this._devicePixelRatio),this.dimensions.css.cell.height=this.dimensions.device.cell.height/this._devicePixelRatio,this.dimensions.css.cell.width=this.dimensions.device.cell.width/this._devicePixelRatio)}_setCanvasDevicePixelDimensions(M,D){this._canvas.width===M&&this._canvas.height===D||(this._canvas.width=M,this._canvas.height=D,this._requestRedrawViewport())}_requestRedrawViewport(){this._onRequestRedraw.fire({start:0,end:this._terminal.rows-1})}_requestRedrawCursor(){const M=this._terminal.buffer.active.cursorY;this._onRequestRedraw.fire({start:M,end:M})}}s.WebglRenderer=S;class k extends m.AttributeData{constructor(M,D,O){super(),this.content=0,this.combinedData="",this.fg=M.fg,this.bg=M.bg,this.combinedData=D,this._width=O}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(M){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}function L(A,M,D=0){return Math.max(Math.min(A,M),D)}s.JoinedCellData=k},381:(l,s,o)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.GLTexture=s.expandFloat32Array=s.createShader=s.createProgram=s.PROJECTION_MATRIX=void 0;const c=o(374);function f(u,p,_){const y=(0,c.throwIfFalsy)(u.createShader(p));if(u.shaderSource(y,_),u.compileShader(y),u.getShaderParameter(y,u.COMPILE_STATUS))return y;console.error(u.getShaderInfoLog(y)),u.deleteShader(y)}s.PROJECTION_MATRIX=new Float32Array([2,0,0,0,0,-2,0,0,0,0,1,0,-1,1,0,1]),s.createProgram=function(u,p,_){const y=(0,c.throwIfFalsy)(u.createProgram());if(u.attachShader(y,(0,c.throwIfFalsy)(f(u,u.VERTEX_SHADER,p))),u.attachShader(y,(0,c.throwIfFalsy)(f(u,u.FRAGMENT_SHADER,_))),u.linkProgram(y),u.getProgramParameter(y,u.LINK_STATUS))return y;console.error(u.getProgramInfoLog(y)),u.deleteProgram(y)},s.createShader=f,s.expandFloat32Array=function(u,p){const _=Math.min(2*u.length,p),y=new Float32Array(_);for(let v=0;v<u.length;v++)y[v]=u[v];return y},s.GLTexture=class{constructor(u){this.texture=u,this.version=-1}}},592:(l,s,o)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.BaseRenderLayer=void 0;const c=o(627),f=o(237),u=o(374),p=o(859);class _ extends p.Disposable{constructor(v,h,m,d,g,w,b,x){super(),this._container=h,this._alpha=g,this._coreBrowserService=w,this._optionsService=b,this._themeService=x,this._deviceCharWidth=0,this._deviceCharHeight=0,this._deviceCellWidth=0,this._deviceCellHeight=0,this._deviceCharLeft=0,this._deviceCharTop=0,this._canvas=this._coreBrowserService.mainDocument.createElement("canvas"),this._canvas.classList.add(`xterm-${m}-layer`),this._canvas.style.zIndex=d.toString(),this._initCanvas(),this._container.appendChild(this._canvas),this.register(this._themeService.onChangeColors(C=>{this._refreshCharAtlas(v,C),this.reset(v)})),this.register((0,p.toDisposable)(()=>{this._canvas.remove()}))}_initCanvas(){this._ctx=(0,u.throwIfFalsy)(this._canvas.getContext("2d",{alpha:this._alpha})),this._alpha||this._clearAll()}handleBlur(v){}handleFocus(v){}handleCursorMove(v){}handleGridChanged(v,h,m){}handleSelectionChanged(v,h,m,d=!1){}_setTransparency(v,h){if(h===this._alpha)return;const m=this._canvas;this._alpha=h,this._canvas=this._canvas.cloneNode(),this._initCanvas(),this._container.replaceChild(this._canvas,m),this._refreshCharAtlas(v,this._themeService.colors),this.handleGridChanged(v,0,v.rows-1)}_refreshCharAtlas(v,h){this._deviceCharWidth<=0&&this._deviceCharHeight<=0||(this._charAtlas=(0,c.acquireTextureAtlas)(v,this._optionsService.rawOptions,h,this._deviceCellWidth,this._deviceCellHeight,this._deviceCharWidth,this._deviceCharHeight,this._coreBrowserService.dpr),this._charAtlas.warmUp())}resize(v,h){this._deviceCellWidth=h.device.cell.width,this._deviceCellHeight=h.device.cell.height,this._deviceCharWidth=h.device.char.width,this._deviceCharHeight=h.device.char.height,this._deviceCharLeft=h.device.char.left,this._deviceCharTop=h.device.char.top,this._canvas.width=h.device.canvas.width,this._canvas.height=h.device.canvas.height,this._canvas.style.width=`${h.css.canvas.width}px`,this._canvas.style.height=`${h.css.canvas.height}px`,this._alpha||this._clearAll(),this._refreshCharAtlas(v,this._themeService.colors)}_fillBottomLineAtCells(v,h,m=1){this._ctx.fillRect(v*this._deviceCellWidth,(h+1)*this._deviceCellHeight-this._coreBrowserService.dpr-1,m*this._deviceCellWidth,this._coreBrowserService.dpr)}_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(v,h,m,d){this._alpha?this._ctx.clearRect(v*this._deviceCellWidth,h*this._deviceCellHeight,m*this._deviceCellWidth,d*this._deviceCellHeight):(this._ctx.fillStyle=this._themeService.colors.background.css,this._ctx.fillRect(v*this._deviceCellWidth,h*this._deviceCellHeight,m*this._deviceCellWidth,d*this._deviceCellHeight))}_fillCharTrueColor(v,h,m,d){this._ctx.font=this._getFont(v,!1,!1),this._ctx.textBaseline=f.TEXT_BASELINE,this._clipCell(m,d,h.getWidth()),this._ctx.fillText(h.getChars(),m*this._deviceCellWidth+this._deviceCharLeft,d*this._deviceCellHeight+this._deviceCharTop+this._deviceCharHeight)}_clipCell(v,h,m){this._ctx.beginPath(),this._ctx.rect(v*this._deviceCellWidth,h*this._deviceCellHeight,m*this._deviceCellWidth,this._deviceCellHeight),this._ctx.clip()}_getFont(v,h,m){return`${m?"italic":""} ${h?v.options.fontWeightBold:v.options.fontWeight} ${v.options.fontSize*this._coreBrowserService.dpr}px ${v.options.fontFamily}`}}s.BaseRenderLayer=_},733:(l,s,o)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.LinkRenderLayer=void 0;const c=o(197),f=o(237),u=o(592);class p extends u.BaseRenderLayer{constructor(y,v,h,m,d,g,w){super(h,y,"link",v,!0,d,g,w),this.register(m.onShowLinkUnderline(b=>this._handleShowLinkUnderline(b))),this.register(m.onHideLinkUnderline(b=>this._handleHideLinkUnderline(b)))}resize(y,v){super.resize(y,v),this._state=void 0}reset(y){this._clearCurrentLink()}_clearCurrentLink(){if(this._state){this._clearCells(this._state.x1,this._state.y1,this._state.cols-this._state.x1,1);const y=this._state.y2-this._state.y1-1;y>0&&this._clearCells(0,this._state.y1+1,this._state.cols,y),this._clearCells(0,this._state.y2,this._state.x2,1),this._state=void 0}}_handleShowLinkUnderline(y){if(y.fg===f.INVERTED_DEFAULT_COLOR?this._ctx.fillStyle=this._themeService.colors.background.css:y.fg!==void 0&&(0,c.is256Color)(y.fg)?this._ctx.fillStyle=this._themeService.colors.ansi[y.fg].css:this._ctx.fillStyle=this._themeService.colors.foreground.css,y.y1===y.y2)this._fillBottomLineAtCells(y.x1,y.y1,y.x2-y.x1);else{this._fillBottomLineAtCells(y.x1,y.y1,y.cols-y.x1);for(let v=y.y1+1;v<y.y2;v++)this._fillBottomLineAtCells(0,v,y.cols);this._fillBottomLineAtCells(0,y.y2,y.x2)}this._state=y}_handleHideLinkUnderline(y){this._clearCurrentLink()}}s.LinkRenderLayer=p},820:(l,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.addDisposableDomListener=void 0,s.addDisposableDomListener=function(o,c,f,u){o.addEventListener(c,f,u);let p=!1;return{dispose:()=>{p||(p=!0,o.removeEventListener(c,f,u))}}}},274:(l,s,o)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.CellColorResolver=void 0;const c=o(855),f=o(160),u=o(374);let p,_=0,y=0,v=!1,h=!1,m=!1,d=0;s.CellColorResolver=class{constructor(g,w,b,x,C,S){this._terminal=g,this._optionService=w,this._selectionRenderModel=b,this._decorationService=x,this._coreBrowserService=C,this._themeService=S,this.result={fg:0,bg:0,ext:0}}resolve(g,w,b,x){if(this.result.bg=g.bg,this.result.fg=g.fg,this.result.ext=268435456&g.bg?g.extended.ext:0,y=0,_=0,h=!1,v=!1,m=!1,p=this._themeService.colors,d=0,g.getCode()!==c.NULL_CELL_CODE&&g.extended.underlineStyle===4){const C=Math.max(1,Math.floor(this._optionService.rawOptions.fontSize*this._coreBrowserService.dpr/15));d=w*x%(2*Math.round(C))}if(this._decorationService.forEachDecorationAtCell(w,b,"bottom",C=>{C.backgroundColorRGB&&(y=C.backgroundColorRGB.rgba>>8&16777215,h=!0),C.foregroundColorRGB&&(_=C.foregroundColorRGB.rgba>>8&16777215,v=!0)}),m=this._selectionRenderModel.isCellSelected(this._terminal,w,b),m){if(67108864&this.result.fg||50331648&this.result.bg){if(67108864&this.result.fg)switch(50331648&this.result.fg){case 16777216:case 33554432:y=this._themeService.colors.ansi[255&this.result.fg].rgba;break;case 50331648:y=(16777215&this.result.fg)<<8|255;break;default:y=this._themeService.colors.foreground.rgba}else switch(50331648&this.result.bg){case 16777216:case 33554432:y=this._themeService.colors.ansi[255&this.result.bg].rgba;break;case 50331648:y=(16777215&this.result.bg)<<8|255}y=f.rgba.blend(y,4294967040&(this._coreBrowserService.isFocused?p.selectionBackgroundOpaque:p.selectionInactiveBackgroundOpaque).rgba|128)>>8&16777215}else y=(this._coreBrowserService.isFocused?p.selectionBackgroundOpaque:p.selectionInactiveBackgroundOpaque).rgba>>8&16777215;if(h=!0,p.selectionForeground&&(_=p.selectionForeground.rgba>>8&16777215,v=!0),(0,u.treatGlyphAsBackgroundColor)(g.getCode())){if(67108864&this.result.fg&&!(50331648&this.result.bg))_=(this._coreBrowserService.isFocused?p.selectionBackgroundOpaque:p.selectionInactiveBackgroundOpaque).rgba>>8&16777215;else{if(67108864&this.result.fg)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}else 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}_=f.rgba.blend(_,4294967040&(this._coreBrowserService.isFocused?p.selectionBackgroundOpaque:p.selectionInactiveBackgroundOpaque).rgba|128)>>8&16777215}v=!0}}this._decorationService.forEachDecorationAtCell(w,b,"top",C=>{C.backgroundColorRGB&&(y=C.backgroundColorRGB.rgba>>8&16777215,h=!0),C.foregroundColorRGB&&(_=C.foregroundColorRGB.rgba>>8&16777215,v=!0)}),h&&(y=m?-16777216&g.bg&-134217729|y|50331648:-16777216&g.bg|y|50331648),v&&(_=-16777216&g.fg&-67108865|_|50331648),67108864&this.result.fg&&(h&&!v&&(_=50331648&this.result.bg?-134217728&this.result.fg|67108863&this.result.bg:-134217728&this.result.fg|16777215&p.background.rgba>>8|50331648,v=!0),!h&&v&&(y=50331648&this.result.fg?-67108864&this.result.bg|67108863&this.result.fg:-67108864&this.result.bg|16777215&p.foreground.rgba>>8|50331648,h=!0)),p=void 0,this.result.bg=h?y:this.result.bg,this.result.fg=v?_:this.result.fg,this.result.ext&=536870911,this.result.ext|=d<<29&3758096384}}},627:(l,s,o)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.removeTerminalFromCache=s.acquireTextureAtlas=void 0;const c=o(509),f=o(197),u=[];s.acquireTextureAtlas=function(p,_,y,v,h,m,d,g){const w=(0,f.generateConfig)(v,h,m,d,_,y,g);for(let C=0;C<u.length;C++){const S=u[C],k=S.ownedBy.indexOf(p);if(k>=0){if((0,f.configEquals)(S.config,w))return S.atlas;S.ownedBy.length===1?(S.atlas.dispose(),u.splice(C,1)):S.ownedBy.splice(k,1);break}}for(let C=0;C<u.length;C++){const S=u[C];if((0,f.configEquals)(S.config,w))return S.ownedBy.push(p),S.atlas}const b=p._core,x={atlas:new c.TextureAtlas(document,w,b.unicodeService),config:w,ownedBy:[p]};return u.push(x),x.atlas},s.removeTerminalFromCache=function(p){for(let _=0;_<u.length;_++){const y=u[_].ownedBy.indexOf(p);if(y!==-1){u[_].ownedBy.length===1?(u[_].atlas.dispose(),u.splice(_,1)):u[_].ownedBy.splice(y,1);break}}}},197:(l,s,o)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.is256Color=s.configEquals=s.generateConfig=void 0;const c=o(160);s.generateConfig=function(f,u,p,_,y,v,h){const m={foreground:v.foreground,background:v.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:v.ansi.slice(),contrastCache:v.contrastCache,halfContrastCache:v.halfContrastCache};return{customGlyphs:y.customGlyphs,devicePixelRatio:h,letterSpacing:y.letterSpacing,lineHeight:y.lineHeight,deviceCellWidth:f,deviceCellHeight:u,deviceCharWidth:p,deviceCharHeight:_,fontFamily:y.fontFamily,fontSize:y.fontSize,fontWeight:y.fontWeight,fontWeightBold:y.fontWeightBold,allowTransparency:y.allowTransparency,drawBoldTextInBrightColors:y.drawBoldTextInBrightColors,minimumContrastRatio:y.minimumContrastRatio,colors:m}},s.configEquals=function(f,u){for(let p=0;p<f.colors.ansi.length;p++)if(f.colors.ansi[p].rgba!==u.colors.ansi[p].rgba)return!1;return f.devicePixelRatio===u.devicePixelRatio&&f.customGlyphs===u.customGlyphs&&f.lineHeight===u.lineHeight&&f.letterSpacing===u.letterSpacing&&f.fontFamily===u.fontFamily&&f.fontSize===u.fontSize&&f.fontWeight===u.fontWeight&&f.fontWeightBold===u.fontWeightBold&&f.allowTransparency===u.allowTransparency&&f.deviceCharWidth===u.deviceCharWidth&&f.deviceCharHeight===u.deviceCharHeight&&f.drawBoldTextInBrightColors===u.drawBoldTextInBrightColors&&f.minimumContrastRatio===u.minimumContrastRatio&&f.colors.foreground.rgba===u.colors.foreground.rgba&&f.colors.background.rgba===u.colors.background.rgba},s.is256Color=function(f){return(50331648&f)==16777216||(50331648&f)==33554432}},237:(l,s,o)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.TEXT_BASELINE=s.DIM_OPACITY=s.INVERTED_DEFAULT_COLOR=void 0;const c=o(399);s.INVERTED_DEFAULT_COLOR=257,s.DIM_OPACITY=.5,s.TEXT_BASELINE=c.isFirefox||c.isLegacyEdge?"bottom":"ideographic"},457:(l,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.CursorBlinkStateManager=void 0,s.CursorBlinkStateManager=class{constructor(o,c){this._renderCallback=o,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(o=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)},o)}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:(l,s,o)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.tryDrawCustomChar=s.powerlineDefinitions=s.boxDrawingDefinitions=s.blockElementDefinitions=void 0;const c=o(374);s.blockElementDefinitions={"▀":[{x:0,y:0,w:8,h:4}],"▁":[{x:0,y:7,w:8,h:1}],"▂":[{x:0,y:6,w:8,h:2}],"▃":[{x:0,y:5,w:8,h:3}],"▄":[{x:0,y:4,w:8,h:4}],"▅":[{x:0,y:3,w:8,h:5}],"▆":[{x:0,y:2,w:8,h:6}],"▇":[{x:0,y:1,w:8,h:7}],"█":[{x:0,y:0,w:8,h:8}],"▉":[{x:0,y:0,w:7,h:8}],"▊":[{x:0,y:0,w:6,h:8}],"▋":[{x:0,y:0,w:5,h:8}],"▌":[{x:0,y:0,w:4,h:8}],"▍":[{x:0,y:0,w:3,h:8}],"▎":[{x:0,y:0,w:2,h:8}],"▏":[{x:0,y:0,w:1,h:8}],"▐":[{x:4,y:0,w:4,h:8}],"▔":[{x:0,y:0,w:8,h:1}],"▕":[{x:7,y:0,w:1,h:8}],"▖":[{x:0,y:4,w:4,h:4}],"▗":[{x:4,y:4,w:4,h:4}],"▘":[{x:0,y:0,w:4,h:4}],"▙":[{x:0,y:0,w:4,h:8},{x:0,y:4,w:8,h:4}],"▚":[{x:0,y:0,w:4,h:4},{x:4,y:4,w:4,h:4}],"▛":[{x:0,y:0,w:4,h:8},{x:4,y:0,w:4,h:4}],"▜":[{x:0,y:0,w:8,h:4},{x:4,y:0,w:4,h:8}],"▝":[{x:4,y:0,w:4,h:4}],"▞":[{x:4,y:0,w:4,h:4},{x:0,y:4,w:4,h:4}],"▟":[{x:4,y:0,w:4,h:8},{x:0,y:4,w:8,h:4}],"🭰":[{x:1,y:0,w:1,h:8}],"🭱":[{x:2,y:0,w:1,h:8}],"🭲":[{x:3,y:0,w:1,h:8}],"🭳":[{x:4,y:0,w:1,h:8}],"🭴":[{x:5,y:0,w:1,h:8}],"🭵":[{x:6,y:0,w:1,h:8}],"🭶":[{x:0,y:1,w:8,h:1}],"🭷":[{x:0,y:2,w:8,h:1}],"🭸":[{x:0,y:3,w:8,h:1}],"🭹":[{x:0,y:4,w:8,h:1}],"🭺":[{x:0,y:5,w:8,h:1}],"🭻":[{x:0,y:6,w:8,h:1}],"🭼":[{x:0,y:0,w:1,h:8},{x:0,y:7,w:8,h:1}],"🭽":[{x:0,y:0,w:1,h:8},{x:0,y:0,w:8,h:1}],"🭾":[{x:7,y:0,w:1,h:8},{x:0,y:0,w:8,h:1}],"🭿":[{x:7,y:0,w:1,h:8},{x:0,y:7,w:8,h:1}],"🮀":[{x:0,y:0,w:8,h:1},{x:0,y:7,w:8,h:1}],"🮁":[{x:0,y:0,w:8,h:1},{x:0,y:2,w:8,h:1},{x:0,y:4,w:8,h:1},{x:0,y:7,w:8,h:1}],"🮂":[{x:0,y:0,w:8,h:2}],"🮃":[{x:0,y:0,w:8,h:3}],"🮄":[{x:0,y:0,w:8,h:5}],"🮅":[{x:0,y:0,w:8,h:6}],"🮆":[{x:0,y:0,w:8,h:7}],"🮇":[{x:6,y:0,w:2,h:8}],"🮈":[{x:5,y:0,w:3,h:8}],"🮉":[{x:3,y:0,w:5,h:8}],"🮊":[{x:2,y:0,w:6,h:8}],"🮋":[{x:1,y:0,w:7,h:8}],"🮕":[{x:0,y:0,w:2,h:2},{x:4,y:0,w:2,h:2},{x:2,y:2,w:2,h:2},{x:6,y:2,w:2,h:2},{x:0,y:4,w:2,h:2},{x:4,y:4,w:2,h:2},{x:2,y:6,w:2,h:2},{x:6,y:6,w:2,h:2}],"🮖":[{x:2,y:0,w:2,h:2},{x:6,y:0,w:2,h:2},{x:0,y:2,w:2,h:2},{x:4,y:2,w:2,h:2},{x:2,y:4,w:2,h:2},{x:6,y:4,w:2,h:2},{x:0,y:6,w:2,h:2},{x:4,y:6,w:2,h:2}],"🮗":[{x:0,y:2,w:8,h:2},{x:0,y:6,w:8,h:2}]};const f={"░":[[1,0,0,0],[0,0,0,0],[0,0,1,0],[0,0,0,0]],"▒":[[1,0],[0,0],[0,1],[0,0]],"▓":[[0,1],[1,1],[1,0],[1,1]]};s.boxDrawingDefinitions={"─":{1:"M0,.5 L1,.5"},"━":{3:"M0,.5 L1,.5"},"│":{1:"M.5,0 L.5,1"},"┃":{3:"M.5,0 L.5,1"},"┌":{1:"M0.5,1 L.5,.5 L1,.5"},"┏":{3:"M0.5,1 L.5,.5 L1,.5"},"┐":{1:"M0,.5 L.5,.5 L.5,1"},"┓":{3:"M0,.5 L.5,.5 L.5,1"},"└":{1:"M.5,0 L.5,.5 L1,.5"},"┗":{3:"M.5,0 L.5,.5 L1,.5"},"┘":{1:"M.5,0 L.5,.5 L0,.5"},"┛":{3:"M.5,0 L.5,.5 L0,.5"},"├":{1:"M.5,0 L.5,1 M.5,.5 L1,.5"},"┣":{3:"M.5,0 L.5,1 M.5,.5 L1,.5"},"┤":{1:"M.5,0 L.5,1 M.5,.5 L0,.5"},"┫":{3:"M.5,0 L.5,1 M.5,.5 L0,.5"},"┬":{1:"M0,.5 L1,.5 M.5,.5 L.5,1"},"┳":{3:"M0,.5 L1,.5 M.5,.5 L.5,1"},"┴":{1:"M0,.5 L1,.5 M.5,.5 L.5,0"},"┻":{3:"M0,.5 L1,.5 M.5,.5 L.5,0"},"┼":{1:"M0,.5 L1,.5 M.5,0 L.5,1"},"╋":{3:"M0,.5 L1,.5 M.5,0 L.5,1"},"╴":{1:"M.5,.5 L0,.5"},"╸":{3:"M.5,.5 L0,.5"},"╵":{1:"M.5,.5 L.5,0"},"╹":{3:"M.5,.5 L.5,0"},"╶":{1:"M.5,.5 L1,.5"},"╺":{3:"M.5,.5 L1,.5"},"╷":{1:"M.5,.5 L.5,1"},"╻":{3:"M.5,.5 L.5,1"},"═":{1:(v,h)=>`M0,${.5-h} L1,${.5-h} M0,${.5+h} L1,${.5+h}`},"║":{1:(v,h)=>`M${.5-v},0 L${.5-v},1 M${.5+v},0 L${.5+v},1`},"╒":{1:(v,h)=>`M.5,1 L.5,${.5-h} L1,${.5-h} M.5,${.5+h} L1,${.5+h}`},"╓":{1:(v,h)=>`M${.5-v},1 L${.5-v},.5 L1,.5 M${.5+v},.5 L${.5+v},1`},"╔":{1:(v,h)=>`M1,${.5-h} L${.5-v},${.5-h} L${.5-v},1 M1,${.5+h} L${.5+v},${.5+h} L${.5+v},1`},"╕":{1:(v,h)=>`M0,${.5-h} L.5,${.5-h} L.5,1 M0,${.5+h} L.5,${.5+h}`},"╖":{1:(v,h)=>`M${.5+v},1 L${.5+v},.5 L0,.5 M${.5-v},.5 L${.5-v},1`},"╗":{1:(v,h)=>`M0,${.5+h} L${.5-v},${.5+h} L${.5-v},1 M0,${.5-h} L${.5+v},${.5-h} L${.5+v},1`},"╘":{1:(v,h)=>`M.5,0 L.5,${.5+h} L1,${.5+h} M.5,${.5-h} L1,${.5-h}`},"╙":{1:(v,h)=>`M1,.5 L${.5-v},.5 L${.5-v},0 M${.5+v},.5 L${.5+v},0`},"╚":{1:(v,h)=>`M1,${.5-h} L${.5+v},${.5-h} L${.5+v},0 M1,${.5+h} L${.5-v},${.5+h} L${.5-v},0`},"╛":{1:(v,h)=>`M0,${.5+h} L.5,${.5+h} L.5,0 M0,${.5-h} L.5,${.5-h}`},"╜":{1:(v,h)=>`M0,.5 L${.5+v},.5 L${.5+v},0 M${.5-v},.5 L${.5-v},0`},"╝":{1:(v,h)=>`M0,${.5-h} L${.5-v},${.5-h} L${.5-v},0 M0,${.5+h} L${.5+v},${.5+h} L${.5+v},0`},"╞":{1:(v,h)=>`M.5,0 L.5,1 M.5,${.5-h} L1,${.5-h} M.5,${.5+h} L1,${.5+h}`},"╟":{1:(v,h)=>`M${.5-v},0 L${.5-v},1 M${.5+v},0 L${.5+v},1 M${.5+v},.5 L1,.5`},"╠":{1:(v,h)=>`M${.5-v},0 L${.5-v},1 M1,${.5+h} L${.5+v},${.5+h} L${.5+v},1 M1,${.5-h} L${.5+v},${.5-h} L${.5+v},0`},"╡":{1:(v,h)=>`M.5,0 L.5,1 M0,${.5-h} L.5,${.5-h} M0,${.5+h} L.5,${.5+h}`},"╢":{1:(v,h)=>`M0,.5 L${.5-v},.5 M${.5-v},0 L${.5-v},1 M${.5+v},0 L${.5+v},1`},"╣":{1:(v,h)=>`M${.5+v},0 L${.5+v},1 M0,${.5+h} L${.5-v},${.5+h} L${.5-v},1 M0,${.5-h} L${.5-v},${.5-h} L${.5-v},0`},"╤":{1:(v,h)=>`M0,${.5-h} L1,${.5-h} M0,${.5+h} L1,${.5+h} M.5,${.5+h} L.5,1`},"╥":{1:(v,h)=>`M0,.5 L1,.5 M${.5-v},.5 L${.5-v},1 M${.5+v},.5 L${.5+v},1`},"╦":{1:(v,h)=>`M0,${.5-h} L1,${.5-h} M0,${.5+h} L${.5-v},${.5+h} L${.5-v},1 M1,${.5+h} L${.5+v},${.5+h} L${.5+v},1`},"╧":{1:(v,h)=>`M.5,0 L.5,${.5-h} M0,${.5-h} L1,${.5-h} M0,${.5+h} L1,${.5+h}`},"╨":{1:(v,h)=>`M0,.5 L1,.5 M${.5-v},.5 L${.5-v},0 M${.5+v},.5 L${.5+v},0`},"╩":{1:(v,h)=>`M0,${.5+h} L1,${.5+h} M0,${.5-h} L${.5-v},${.5-h} L${.5-v},0 M1,${.5-h} L${.5+v},${.5-h} L${.5+v},0`},"╪":{1:(v,h)=>`M.5,0 L.5,1 M0,${.5-h} L1,${.5-h} M0,${.5+h} L1,${.5+h}`},"╫":{1:(v,h)=>`M0,.5 L1,.5 M${.5-v},0 L${.5-v},1 M${.5+v},0 L${.5+v},1`},"╬":{1:(v,h)=>`M0,${.5+h} L${.5-v},${.5+h} L${.5-v},1 M1,${.5+h} L${.5+v},${.5+h} L${.5+v},1 M0,${.5-h} L${.5-v},${.5-h} L${.5-v},0 M1,${.5-h} L${.5+v},${.5-h} L${.5+v},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:(v,h)=>`M.5,1 L.5,${.5+h/.15*.5} C.5,${.5+h/.15*.5},.5,.5,1,.5`},"╮":{1:(v,h)=>`M.5,1 L.5,${.5+h/.15*.5} C.5,${.5+h/.15*.5},.5,.5,0,.5`},"╯":{1:(v,h)=>`M.5,0 L.5,${.5-h/.15*.5} C.5,${.5-h/.15*.5},.5,.5,0,.5`},"╰":{1:(v,h)=>`M.5,0 L.5,${.5-h/.15*.5} C.5,${.5-h/.15*.5},.5,.5,1,.5`}},s.powerlineDefinitions={"":{d:"M0,0 L1,.5 L0,1",type:0,rightPadding:2},"":{d:"M-1,-.5 L1,.5 L-1,1.5",type:1,leftPadding:1,rightPadding:1},"":{d:"M1,0 L0,.5 L1,1",type:0,leftPadding:2},"":{d:"M2,-.5 L0,.5 L2,1.5",type:1,leftPadding:1,rightPadding:1},"":{d:"M0,0 L0,1 C0.552,1,1,0.776,1,.5 C1,0.224,0.552,0,0,0",type:0,rightPadding:1},"":{d:"M.2,1 C.422,1,.8,.826,.78,.5 C.8,.174,0.422,0,.2,0",type:1,rightPadding:1},"":{d:"M1,0 L1,1 C0.448,1,0,0.776,0,.5 C0,0.224,0.448,0,1,0",type:0,leftPadding:1},"":{d:"M.8,1 C0.578,1,0.2,.826,.22,.5 C0.2,0.174,0.578,0,0.8,0",type:1,leftPadding:1},"":{d:"M-.5,-.5 L1.5,1.5 L-.5,1.5",type:0},"":{d:"M-.5,-.5 L1.5,1.5",type:1,leftPadding:1,rightPadding:1},"":{d:"M1.5,-.5 L-.5,1.5 L1.5,1.5",type:0},"":{d:"M1.5,-.5 L-.5,1.5 L-.5,-.5",type:0},"":{d:"M1.5,-.5 L-.5,1.5",type:1,leftPadding:1,rightPadding:1},"":{d:"M-.5,-.5 L1.5,1.5 L1.5,-.5",type:0}},s.powerlineDefinitions[""]=s.powerlineDefinitions[""],s.powerlineDefinitions[""]=s.powerlineDefinitions[""],s.tryDrawCustomChar=function(v,h,m,d,g,w,b,x){const C=s.blockElementDefinitions[h];if(C)return function(A,M,D,O,z,F){for(let H=0;H<M.length;H++){const I=M[H],R=z/8,P=F/8;A.fillRect(D+I.x*R,O+I.y*P,I.w*R,I.h*P)}}(v,C,m,d,g,w),!0;const S=f[h];if(S)return function(A,M,D,O,z,F){let H=u.get(M);H||(H=new Map,u.set(M,H));const I=A.fillStyle;if(typeof I!="string")throw new Error(`Unexpected fillStyle type "${I}"`);let R=H.get(I);if(!R){const P=M[0].length,N=M.length,j=A.canvas.ownerDocument.createElement("canvas");j.width=P,j.height=N;const W=(0,c.throwIfFalsy)(j.getContext("2d")),V=new ImageData(P,N);let Z,Q,$,B;if(I.startsWith("#"))Z=parseInt(I.slice(1,3),16),Q=parseInt(I.slice(3,5),16),$=parseInt(I.slice(5,7),16),B=I.length>7&&parseInt(I.slice(7,9),16)||1;else{if(!I.startsWith("rgba"))throw new Error(`Unexpected fillStyle color format "${I}" when drawing pattern glyph`);[Z,Q,$,B]=I.substring(5,I.length-1).split(",").map(K=>parseFloat(K))}for(let K=0;K<N;K++)for(let U=0;U<P;U++)V.data[4*(K*P+U)]=Z,V.data[4*(K*P+U)+1]=Q,V.data[4*(K*P+U)+2]=$,V.data[4*(K*P+U)+3]=M[K][U]*(255*B);W.putImageData(V,0,0),R=(0,c.throwIfFalsy)(A.createPattern(j,null)),H.set(I,R)}A.fillStyle=R,A.fillRect(D,O,z,F)}(v,S,m,d,g,w),!0;const k=s.boxDrawingDefinitions[h];if(k)return function(A,M,D,O,z,F,H){A.strokeStyle=A.fillStyle;for(const[I,R]of Object.entries(M)){let P;A.beginPath(),A.lineWidth=H*Number.parseInt(I),P=typeof R=="function"?R(.15,.15/F*z):R;for(const N of P.split(" ")){const j=N[0],W=_[j];if(!W){console.error(`Could not find drawing instructions for "${j}"`);continue}const V=N.substring(1).split(",");V[0]&&V[1]&&W(A,y(V,z,F,D,O,!0,H))}A.stroke(),A.closePath()}}(v,k,m,d,g,w,x),!0;const L=s.powerlineDefinitions[h];return!!L&&(function(A,M,D,O,z,F,H,I){const R=new Path2D;R.rect(D,O,z,F),A.clip(R),A.beginPath();const P=H/12;A.lineWidth=I*P;for(const N of M.d.split(" ")){const j=N[0],W=_[j];if(!W){console.error(`Could not find drawing instructions for "${j}"`);continue}const V=N.substring(1).split(",");V[0]&&V[1]&&W(A,y(V,z,F,D,O,!1,I,(M.leftPadding??0)*(P/2),(M.rightPadding??0)*(P/2)))}M.type===1?(A.strokeStyle=A.fillStyle,A.stroke()):A.fill(),A.closePath()}(v,L,m,d,g,w,b,x),!0)};const u=new Map;function p(v,h,m=0){return Math.max(Math.min(v,h),m)}const _={C:(v,h)=>v.bezierCurveTo(h[0],h[1],h[2],h[3],h[4],h[5]),L:(v,h)=>v.lineTo(h[0],h[1]),M:(v,h)=>v.moveTo(h[0],h[1])};function y(v,h,m,d,g,w,b,x=0,C=0){const S=v.map(k=>parseFloat(k)||parseInt(k));if(S.length<2)throw new Error("Too few arguments for instruction");for(let k=0;k<S.length;k+=2)S[k]*=h-x*b-C*b,w&&S[k]!==0&&(S[k]=p(Math.round(S[k]+.5)-.5,h,0)),S[k]+=d+x*b;for(let k=1;k<S.length;k+=2)S[k]*=m,w&&S[k]!==0&&(S[k]=p(Math.round(S[k]+.5)-.5,m,0)),S[k]+=g;return S}},56:(l,s,o)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.observeDevicePixelDimensions=void 0;const c=o(859);s.observeDevicePixelDimensions=function(f,u,p){let _=new u.ResizeObserver(y=>{const v=y.find(d=>d.target===f);if(!v)return;if(!("devicePixelContentBoxSize"in v))return _==null||_.disconnect(),void(_=void 0);const h=v.devicePixelContentBoxSize[0].inlineSize,m=v.devicePixelContentBoxSize[0].blockSize;h>0&&m>0&&p(h,m)});try{_.observe(f,{box:["device-pixel-content-box"]})}catch{_.disconnect(),_=void 0}return(0,c.toDisposable)(()=>_==null?void 0:_.disconnect())}},374:(l,s)=>{function o(f){return 57508<=f&&f<=57558}function c(f){return f>=128512&&f<=128591||f>=127744&&f<=128511||f>=128640&&f<=128767||f>=9728&&f<=9983||f>=9984&&f<=10175||f>=65024&&f<=65039||f>=129280&&f<=129535||f>=127462&&f<=127487}Object.defineProperty(s,"__esModule",{value:!0}),s.computeNextVariantOffset=s.createRenderDimensions=s.treatGlyphAsBackgroundColor=s.allowRescaling=s.isEmoji=s.isRestrictedPowerlineGlyph=s.isPowerlineGlyph=s.throwIfFalsy=void 0,s.throwIfFalsy=function(f){if(!f)throw new Error("value must not be falsy");return f},s.isPowerlineGlyph=o,s.isRestrictedPowerlineGlyph=function(f){return 57520<=f&&f<=57527},s.isEmoji=c,s.allowRescaling=function(f,u,p,_){return u===1&&p>Math.ceil(1.5*_)&&f!==void 0&&f>255&&!c(f)&&!o(f)&&!function(y){return 57344<=y&&y<=63743}(f)},s.treatGlyphAsBackgroundColor=function(f){return o(f)||function(u){return 9472<=u&&u<=9631}(f)},s.createRenderDimensions=function(){return{css:{canvas:{width:0,height:0},cell:{width:0,height:0}},device:{canvas:{width:0,height:0},cell:{width:0,height:0},char:{width:0,height:0,left:0,top:0}}}},s.computeNextVariantOffset=function(f,u,p=0){return(f-(2*Math.round(u)-p))%(2*Math.round(u))}},296:(l,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.createSelectionRenderModel=void 0;class o{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(f,u,p,_=!1){if(this.selectionStart=u,this.selectionEnd=p,!u||!p||u[0]===p[0]&&u[1]===p[1])return void this.clear();const y=f.buffers.active.ydisp,v=u[1]-y,h=p[1]-y,m=Math.max(v,0),d=Math.min(h,f.rows-1);m>=f.rows||d<0?this.clear():(this.hasSelection=!0,this.columnSelectMode=_,this.viewportStartRow=v,this.viewportEndRow=h,this.viewportCappedStartRow=m,this.viewportCappedEndRow=d,this.startCol=u[0],this.endCol=p[0])}isCellSelected(f,u,p){return!!this.hasSelection&&(p-=f.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?u>=this.startCol&&p>=this.viewportCappedStartRow&&u<this.endCol&&p<=this.viewportCappedEndRow:u<this.startCol&&p>=this.viewportCappedStartRow&&u>=this.endCol&&p<=this.viewportCappedEndRow:p>this.viewportStartRow&&p<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&p===this.viewportStartRow&&u>=this.startCol&&u<this.endCol||this.viewportStartRow<this.viewportEndRow&&p===this.viewportEndRow&&u<this.endCol||this.viewportStartRow<this.viewportEndRow&&p===this.viewportStartRow&&u>=this.startCol)}}s.createSelectionRenderModel=function(){return new o}},509:(l,s,o)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.TextureAtlas=void 0;const c=o(237),f=o(860),u=o(374),p=o(160),_=o(345),y=o(485),v=o(385),h=o(147),m=o(855),d={texturePage:0,texturePosition:{x:0,y:0},texturePositionClipSpace:{x:0,y:0},offset:{x:0,y:0},size:{x:0,y:0},sizeClipSpace:{x:0,y:0}};let g;class w{get pages(){return this._pages}constructor(k,L,A){this._document=k,this._config=L,this._unicodeService=A,this._didWarmUp=!1,this._cacheMap=new y.FourKeyMap,this._cacheMapCombined=new y.FourKeyMap,this._pages=[],this._activePages=[],this._workBoundingBox={top:0,left:0,bottom:0,right:0},this._workAttributeData=new h.AttributeData,this._textureSize=512,this._onAddTextureAtlasCanvas=new _.EventEmitter,this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event,this._onRemoveTextureAtlasCanvas=new _.EventEmitter,this.onRemoveTextureAtlasCanvas=this._onRemoveTextureAtlasCanvas.event,this._requestClearModel=!1,this._createNewPage(),this._tmpCanvas=C(k,4*this._config.deviceCellWidth+4,this._config.deviceCellHeight+4),this._tmpCtx=(0,u.throwIfFalsy)(this._tmpCanvas.getContext("2d",{alpha:this._config.allowTransparency,willReadFrequently:!0}))}dispose(){for(const k of this.pages)k.canvas.remove();this._onAddTextureAtlasCanvas.dispose()}warmUp(){this._didWarmUp||(this._doWarmUp(),this._didWarmUp=!0)}_doWarmUp(){const k=new v.IdleTaskQueue;for(let L=33;L<126;L++)k.enqueue(()=>{if(!this._cacheMap.get(L,m.DEFAULT_COLOR,m.DEFAULT_COLOR,m.DEFAULT_EXT)){const A=this._drawToCache(L,m.DEFAULT_COLOR,m.DEFAULT_COLOR,m.DEFAULT_EXT);this._cacheMap.set(L,m.DEFAULT_COLOR,m.DEFAULT_COLOR,m.DEFAULT_EXT,A)}})}beginFrame(){return this._requestClearModel}clearTexture(){if(this._pages[0].currentRow.x!==0||this._pages[0].currentRow.y!==0){for(const k of this._pages)k.clear();this._cacheMap.clear(),this._cacheMapCombined.clear(),this._didWarmUp=!1}}_createNewPage(){if(w.maxAtlasPages&&this._pages.length>=Math.max(4,w.maxAtlasPages)){const L=this._pages.filter(H=>2*H.canvas.width<=(w.maxTextureSize||4096)).sort((H,I)=>I.canvas.width!==H.canvas.width?I.canvas.width-H.canvas.width:I.percentageUsed-H.percentageUsed);let A=-1,M=0;for(let H=0;H<L.length;H++)if(L[H].canvas.width!==M)A=H,M=L[H].canvas.width;else if(H-A==3)break;const D=L.slice(A,A+4),O=D.map(H=>H.glyphs[0].texturePage).sort((H,I)=>H>I?1:-1),z=this.pages.length-D.length,F=this._mergePages(D,z);F.version++;for(let H=O.length-1;H>=0;H--)this._deletePage(O[H]);this.pages.push(F),this._requestClearModel=!0,this._onAddTextureAtlasCanvas.fire(F.canvas)}const k=new b(this._document,this._textureSize);return this._pages.push(k),this._activePages.push(k),this._onAddTextureAtlasCanvas.fire(k.canvas),k}_mergePages(k,L){const A=2*k[0].canvas.width,M=new b(this._document,A,k);for(const[D,O]of k.entries()){const z=D*O.canvas.width%A,F=Math.floor(D/2)*O.canvas.height;M.ctx.drawImage(O.canvas,z,F);for(const I of O.glyphs)I.texturePage=L,I.sizeClipSpace.x=I.size.x/A,I.sizeClipSpace.y=I.size.y/A,I.texturePosition.x+=z,I.texturePosition.y+=F,I.texturePositionClipSpace.x=I.texturePosition.x/A,I.texturePositionClipSpace.y=I.texturePosition.y/A;this._onRemoveTextureAtlasCanvas.fire(O.canvas);const H=this._activePages.indexOf(O);H!==-1&&this._activePages.splice(H,1)}return M}_deletePage(k){this._pages.splice(k,1);for(let L=k;L<this._pages.length;L++){const A=this._pages[L];for(const M of A.glyphs)M.texturePage--;A.version++}}getRasterizedGlyphCombinedChar(k,L,A,M,D){return this._getFromCacheMap(this._cacheMapCombined,k,L,A,M,D)}getRasterizedGlyph(k,L,A,M,D){return this._getFromCacheMap(this._cacheMap,k,L,A,M,D)}_getFromCacheMap(k,L,A,M,D,O=!1){return g=k.get(L,A,M,D),g||(g=this._drawToCache(L,A,M,D,O),k.set(L,A,M,D,g)),g}_getColorFromAnsiIndex(k){if(k>=this._config.colors.ansi.length)throw new Error("No color found for idx "+k);return this._config.colors.ansi[k]}_getBackgroundColor(k,L,A,M){if(this._config.allowTransparency)return p.NULL_COLOR;let D;switch(k){case 16777216:case 33554432:D=this._getColorFromAnsiIndex(L);break;case 50331648:const O=h.AttributeData.toColorRGB(L);D=p.channels.toColor(O[0],O[1],O[2]);break;default:D=A?p.color.opaque(this._config.colors.foreground):this._config.colors.background}return D}_getForegroundColor(k,L,A,M,D,O,z,F,H,I){const R=this._getMinimumContrastColor(k,L,A,M,D,O,z,H,F,I);if(R)return R;let P;switch(D){case 16777216:case 33554432:this._config.drawBoldTextInBrightColors&&H&&O<8&&(O+=8),P=this._getColorFromAnsiIndex(O);break;case 50331648:const N=h.AttributeData.toColorRGB(O);P=p.channels.toColor(N[0],N[1],N[2]);break;default:P=z?this._config.colors.background:this._config.colors.foreground}return this._config.allowTransparency&&(P=p.color.opaque(P)),F&&(P=p.color.multiplyOpacity(P,c.DIM_OPACITY)),P}_resolveBackgroundRgba(k,L,A){switch(k){case 16777216:case 33554432:return this._getColorFromAnsiIndex(L).rgba;case 50331648:return L<<8;default:return A?this._config.colors.foreground.rgba:this._config.colors.background.rgba}}_resolveForegroundRgba(k,L,A,M){switch(k){case 16777216:case 33554432:return this._config.drawBoldTextInBrightColors&&M&&L<8&&(L+=8),this._getColorFromAnsiIndex(L).rgba;case 50331648:return L<<8;default:return A?this._config.colors.background.rgba:this._config.colors.foreground.rgba}}_getMinimumContrastColor(k,L,A,M,D,O,z,F,H,I){if(this._config.minimumContrastRatio===1||I)return;const R=this._getContrastCache(H),P=R.getColor(k,M);if(P!==void 0)return P||void 0;const N=this._resolveBackgroundRgba(L,A,z),j=this._resolveForegroundRgba(D,O,z,F),W=p.rgba.ensureContrastRatio(N,j,this._config.minimumContrastRatio/(H?2:1));if(!W)return void R.setColor(k,M,null);const V=p.channels.toColor(W>>24&255,W>>16&255,W>>8&255);return R.setColor(k,M,V),V}_getContrastCache(k){return k?this._config.colors.halfContrastCache:this._config.colors.contrastCache}_drawToCache(k,L,A,M,D=!1){const O=typeof k=="number"?String.fromCharCode(k):k,z=Math.min(this._config.deviceCellWidth*Math.max(O.length,2)+4,this._textureSize);this._tmpCanvas.width<z&&(this._tmpCanvas.width=z);const F=Math.min(this._config.deviceCellHeight+8,this._textureSize);if(this._tmpCanvas.height<F&&(this._tmpCanvas.height=F),this._tmpCtx.save(),this._workAttributeData.fg=A,this._workAttributeData.bg=L,this._workAttributeData.extended.ext=M,this._workAttributeData.isInvisible())return d;const H=!!this._workAttributeData.isBold(),I=!!this._workAttributeData.isInverse(),R=!!this._workAttributeData.isDim(),P=!!this._workAttributeData.isItalic(),N=!!this._workAttributeData.isUnderline(),j=!!this._workAttributeData.isStrikethrough(),W=!!this._workAttributeData.isOverline();let V=this._workAttributeData.getFgColor(),Z=this._workAttributeData.getFgColorMode(),Q=this._workAttributeData.getBgColor(),$=this._workAttributeData.getBgColorMode();if(I){const ie=V;V=Q,Q=ie;const ge=Z;Z=$,$=ge}const B=this._getBackgroundColor($,Q,I,R);this._tmpCtx.globalCompositeOperation="copy",this._tmpCtx.fillStyle=B.css,this._tmpCtx.fillRect(0,0,this._tmpCanvas.width,this._tmpCanvas.height),this._tmpCtx.globalCompositeOperation="source-over";const K=H?this._config.fontWeightBold:this._config.fontWeight,U=P?"italic":"";this._tmpCtx.font=`${U} ${K} ${this._config.fontSize*this._config.devicePixelRatio}px ${this._config.fontFamily}`,this._tmpCtx.textBaseline=c.TEXT_BASELINE;const te=O.length===1&&(0,u.isPowerlineGlyph)(O.charCodeAt(0)),Y=O.length===1&&(0,u.isRestrictedPowerlineGlyph)(O.charCodeAt(0)),ye=this._getForegroundColor(L,$,Q,A,Z,V,I,R,H,(0,u.treatGlyphAsBackgroundColor)(O.charCodeAt(0)));this._tmpCtx.fillStyle=ye.css;const pe=Y?0:4;let ne=!1;this._config.customGlyphs!==!1&&(ne=(0,f.tryDrawCustomChar)(this._tmpCtx,O,pe,pe,this._config.deviceCellWidth,this._config.deviceCellHeight,this._config.fontSize,this._config.devicePixelRatio));let oe,ce=!te;if(oe=typeof k=="number"?this._unicodeService.wcwidth(k):this._unicodeService.getStringCellWidth(k),N){this._tmpCtx.save();const ie=Math.max(1,Math.floor(this._config.fontSize*this._config.devicePixelRatio/15)),ge=ie%2==1?.5:0;if(this._tmpCtx.lineWidth=ie,this._workAttributeData.isUnderlineColorDefault())this._tmpCtx.strokeStyle=this._tmpCtx.fillStyle;else if(this._workAttributeData.isUnderlineColorRGB())ce=!1,this._tmpCtx.strokeStyle=`rgb(${h.AttributeData.toColorRGB(this._workAttributeData.getUnderlineColor()).join(",")})`;else{ce=!1;let Oe=this._workAttributeData.getUnderlineColor();this._config.drawBoldTextInBrightColors&&this._workAttributeData.isBold()&&Oe<8&&(Oe+=8),this._tmpCtx.strokeStyle=this._getColorFromAnsiIndex(Oe).css}this._tmpCtx.beginPath();const be=pe,Te=Math.ceil(pe+this._config.deviceCharHeight)-ge-(D?2*ie:0),je=Te+ie,He=Te+2*ie;let Pe=this._workAttributeData.getUnderlineVariantOffset();for(let Oe=0;Oe<oe;Oe++){this._tmpCtx.save();const ke=be+Oe*this._config.deviceCellWidth,Le=be+(Oe+1)*this._config.deviceCellWidth,Qe=ke+this._config.deviceCellWidth/2;switch(this._workAttributeData.extended.underlineStyle){case 2:this._tmpCtx.moveTo(ke,Te),this._tmpCtx.lineTo(Le,Te),this._tmpCtx.moveTo(ke,He),this._tmpCtx.lineTo(Le,He);break;case 3:const J=ie<=1?He:Math.ceil(pe+this._config.deviceCharHeight-ie/2)-ge,ee=ie<=1?Te:Math.ceil(pe+this._config.deviceCharHeight+ie/2)-ge,Be=new Path2D;Be.rect(ke,Te,this._config.deviceCellWidth,He-Te),this._tmpCtx.clip(Be),this._tmpCtx.moveTo(ke-this._config.deviceCellWidth/2,je),this._tmpCtx.bezierCurveTo(ke-this._config.deviceCellWidth/2,ee,ke,ee,ke,je),this._tmpCtx.bezierCurveTo(ke,J,Qe,J,Qe,je),this._tmpCtx.bezierCurveTo(Qe,ee,Le,ee,Le,je),this._tmpCtx.bezierCurveTo(Le,J,Le+this._config.deviceCellWidth/2,J,Le+this._config.deviceCellWidth/2,je);break;case 4:const q=Pe===0?0:Pe>=ie?2*ie-Pe:ie-Pe;Pe>=ie||q===0?(this._tmpCtx.setLineDash([Math.round(ie),Math.round(ie)]),this._tmpCtx.moveTo(ke+q,Te),this._tmpCtx.lineTo(Le,Te)):(this._tmpCtx.setLineDash([Math.round(ie),Math.round(ie)]),this._tmpCtx.moveTo(ke,Te),this._tmpCtx.lineTo(ke+q,Te),this._tmpCtx.moveTo(ke+q+ie,Te),this._tmpCtx.lineTo(Le,Te)),Pe=(0,u.computeNextVariantOffset)(Le-ke,ie,Pe);break;case 5:const de=.6,X=.3,_e=Le-ke,re=Math.floor(de*_e),le=Math.floor(X*_e),we=_e-re-le;this._tmpCtx.setLineDash([re,le,we]),this._tmpCtx.moveTo(ke,Te),this._tmpCtx.lineTo(Le,Te);break;default:this._tmpCtx.moveTo(ke,Te),this._tmpCtx.lineTo(Le,Te)}this._tmpCtx.stroke(),this._tmpCtx.restore()}if(this._tmpCtx.restore(),!ne&&this._config.fontSize>=12&&!this._config.allowTransparency&&O!==" "){this._tmpCtx.save(),this._tmpCtx.textBaseline="alphabetic";const Oe=this._tmpCtx.measureText(O);if(this._tmpCtx.restore(),"actualBoundingBoxDescent"in Oe&&Oe.actualBoundingBoxDescent>0){this._tmpCtx.save();const ke=new Path2D;ke.rect(be,Te-Math.ceil(ie/2),this._config.deviceCellWidth*oe,He-Te+Math.ceil(ie/2)),this._tmpCtx.clip(ke),this._tmpCtx.lineWidth=3*this._config.devicePixelRatio,this._tmpCtx.strokeStyle=B.css,this._tmpCtx.strokeText(O,pe,pe+this._config.deviceCharHeight),this._tmpCtx.restore()}}}if(W){const ie=Math.max(1,Math.floor(this._config.fontSize*this._config.devicePixelRatio/15)),ge=ie%2==1?.5:0;this._tmpCtx.lineWidth=ie,this._tmpCtx.strokeStyle=this._tmpCtx.fillStyle,this._tmpCtx.beginPath(),this._tmpCtx.moveTo(pe,pe+ge),this._tmpCtx.lineTo(pe+this._config.deviceCharWidth*oe,pe+ge),this._tmpCtx.stroke()}if(ne||this._tmpCtx.fillText(O,pe,pe+this._config.deviceCharHeight),O==="_"&&!this._config.allowTransparency){let ie=x(this._tmpCtx.getImageData(pe,pe,this._config.deviceCellWidth,this._config.deviceCellHeight),B,ye,ce);if(ie)for(let ge=1;ge<=5&&(this._tmpCtx.save(),this._tmpCtx.fillStyle=B.css,this._tmpCtx.fillRect(0,0,this._tmpCanvas.width,this._tmpCanvas.height),this._tmpCtx.restore(),this._tmpCtx.fillText(O,pe,pe+this._config.deviceCharHeight-ge),ie=x(this._tmpCtx.getImageData(pe,pe,this._config.deviceCellWidth,this._config.deviceCellHeight),B,ye,ce),ie);ge++);}if(j){const ie=Math.max(1,Math.floor(this._config.fontSize*this._config.devicePixelRatio/10)),ge=this._tmpCtx.lineWidth%2==1?.5:0;this._tmpCtx.lineWidth=ie,this._tmpCtx.strokeStyle=this._tmpCtx.fillStyle,this._tmpCtx.beginPath(),this._tmpCtx.moveTo(pe,pe+Math.floor(this._config.deviceCharHeight/2)-ge),this._tmpCtx.lineTo(pe+this._config.deviceCharWidth*oe,pe+Math.floor(this._config.deviceCharHeight/2)-ge),this._tmpCtx.stroke()}this._tmpCtx.restore();const ue=this._tmpCtx.getImageData(0,0,this._tmpCanvas.width,this._tmpCanvas.height);let ve;if(ve=this._config.allowTransparency?function(ie){for(let ge=0;ge<ie.data.length;ge+=4)if(ie.data[ge+3]>0)return!1;return!0}(ue):x(ue,B,ye,ce),ve)return d;const se=this._findGlyphBoundingBox(ue,this._workBoundingBox,z,Y,ne,pe);let ae,fe;for(;;){if(this._activePages.length===0){const ie=this._createNewPage();ae=ie,fe=ie.currentRow,fe.height=se.size.y;break}ae=this._activePages[this._activePages.length-1],fe=ae.currentRow;for(const ie of this._activePages)se.size.y<=ie.currentRow.height&&(ae=ie,fe=ie.currentRow);for(let ie=this._activePages.length-1;ie>=0;ie--)for(const ge of this._activePages[ie].fixedRows)ge.height<=fe.height&&se.size.y<=ge.height&&(ae=this._activePages[ie],fe=ge);if(fe.y+se.size.y>=ae.canvas.height||fe.height>se.size.y+2){let ie=!1;if(ae.currentRow.y+ae.currentRow.height+se.size.y>=ae.canvas.height){let ge;for(const be of this._activePages)if(be.currentRow.y+be.currentRow.height+se.size.y<be.canvas.height){ge=be;break}if(ge)ae=ge;else if(w.maxAtlasPages&&this._pages.length>=w.maxAtlasPages&&fe.y+se.size.y<=ae.canvas.height&&fe.height>=se.size.y&&fe.x+se.size.x<=ae.canvas.width)ie=!0;else{const be=this._createNewPage();ae=be,fe=be.currentRow,fe.height=se.size.y,ie=!0}}ie||(ae.currentRow.height>0&&ae.fixedRows.push(ae.currentRow),fe={x:0,y:ae.currentRow.y+ae.currentRow.height,height:se.size.y},ae.fixedRows.push(fe),ae.currentRow={x:0,y:fe.y+fe.height,height:0})}if(fe.x+se.size.x<=ae.canvas.width)break;fe===ae.currentRow?(fe.x=0,fe.y+=fe.height,fe.height=0):ae.fixedRows.splice(ae.fixedRows.indexOf(fe),1)}return se.texturePage=this._pages.indexOf(ae),se.texturePosition.x=fe.x,se.texturePosition.y=fe.y,se.texturePositionClipSpace.x=fe.x/ae.canvas.width,se.texturePositionClipSpace.y=fe.y/ae.canvas.height,se.sizeClipSpace.x/=ae.canvas.width,se.sizeClipSpace.y/=ae.canvas.height,fe.height=Math.max(fe.height,se.size.y),fe.x+=se.size.x,ae.ctx.putImageData(ue,se.texturePosition.x-this._workBoundingBox.left,se.texturePosition.y-this._workBoundingBox.top,this._workBoundingBox.left,this._workBoundingBox.top,se.size.x,se.size.y),ae.addGlyph(se),ae.version++,se}_findGlyphBoundingBox(k,L,A,M,D,O){L.top=0;const z=M?this._config.deviceCellHeight:this._tmpCanvas.height,F=M?this._config.deviceCellWidth:A;let H=!1;for(let I=0;I<z;I++){for(let R=0;R<F;R++){const P=I*this._tmpCanvas.width*4+4*R+3;if(k.data[P]!==0){L.top=I,H=!0;break}}if(H)break}L.left=0,H=!1;for(let I=0;I<O+F;I++){for(let R=0;R<z;R++){const P=R*this._tmpCanvas.width*4+4*I+3;if(k.data[P]!==0){L.left=I,H=!0;break}}if(H)break}L.right=F,H=!1;for(let I=O+F-1;I>=O;I--){for(let R=0;R<z;R++){const P=R*this._tmpCanvas.width*4+4*I+3;if(k.data[P]!==0){L.right=I,H=!0;break}}if(H)break}L.bottom=z,H=!1;for(let I=z-1;I>=0;I--){for(let R=0;R<F;R++){const P=I*this._tmpCanvas.width*4+4*R+3;if(k.data[P]!==0){L.bottom=I,H=!0;break}}if(H)break}return{texturePage:0,texturePosition:{x:0,y:0},texturePositionClipSpace:{x:0,y:0},size:{x:L.right-L.left+1,y:L.bottom-L.top+1},sizeClipSpace:{x:L.right-L.left+1,y:L.bottom-L.top+1},offset:{x:-L.left+O+(M||D?Math.floor((this._config.deviceCellWidth-this._config.deviceCharWidth)/2):0),y:-L.top+O+(M||D?this._config.lineHeight===1?0:Math.round((this._config.deviceCellHeight-this._config.deviceCharHeight)/2):0)}}}}s.TextureAtlas=w;class b{get percentageUsed(){return this._usedPixels/(this.canvas.width*this.canvas.height)}get glyphs(){return this._glyphs}addGlyph(k){this._glyphs.push(k),this._usedPixels+=k.size.x*k.size.y}constructor(k,L,A){if(this._usedPixels=0,this._glyphs=[],this.version=0,this.currentRow={x:0,y:0,height:0},this.fixedRows=[],A)for(const M of A)this._glyphs.push(...M.glyphs),this._usedPixels+=M._usedPixels;this.canvas=C(k,L,L),this.ctx=(0,u.throwIfFalsy)(this.canvas.getContext("2d",{alpha:!0}))}clear(){this.ctx.clearRect(0,0,this.canvas.width,this.canvas.height),this.currentRow.x=0,this.currentRow.y=0,this.currentRow.height=0,this.fixedRows.length=0,this.version++}}function x(S,k,L,A){const M=k.rgba>>>24,D=k.rgba>>>16&255,O=k.rgba>>>8&255,z=L.rgba>>>24,F=L.rgba>>>16&255,H=L.rgba>>>8&255,I=Math.floor((Math.abs(M-z)+Math.abs(D-F)+Math.abs(O-H))/12);let R=!0;for(let P=0;P<S.data.length;P+=4)S.data[P]===M&&S.data[P+1]===D&&S.data[P+2]===O||A&&Math.abs(S.data[P]-M)+Math.abs(S.data[P+1]-D)+Math.abs(S.data[P+2]-O)<I?S.data[P+3]=0:R=!1;return R}function C(S,k,L){const A=S.createElement("canvas");return A.width=k,A.height=L,A}},160:(l,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.contrastRatio=s.toPaddedHex=s.rgba=s.rgb=s.css=s.color=s.channels=s.NULL_COLOR=void 0;let o=0,c=0,f=0,u=0;var p,_,y,v,h;function m(g){const w=g.toString(16);return w.length<2?"0"+w:w}function d(g,w){return g<w?(w+.05)/(g+.05):(g+.05)/(w+.05)}s.NULL_COLOR={css:"#00000000",rgba:0},function(g){g.toCss=function(w,b,x,C){return C!==void 0?`#${m(w)}${m(b)}${m(x)}${m(C)}`:`#${m(w)}${m(b)}${m(x)}`},g.toRgba=function(w,b,x,C=255){return(w<<24|b<<16|x<<8|C)>>>0},g.toColor=function(w,b,x,C){return{css:g.toCss(w,b,x,C),rgba:g.toRgba(w,b,x,C)}}}(p||(s.channels=p={})),function(g){function w(b,x){return u=Math.round(255*x),[o,c,f]=h.toChannels(b.rgba),{css:p.toCss(o,c,f,u),rgba:p.toRgba(o,c,f,u)}}g.blend=function(b,x){if(u=(255&x.rgba)/255,u===1)return{css:x.css,rgba:x.rgba};const C=x.rgba>>24&255,S=x.rgba>>16&255,k=x.rgba>>8&255,L=b.rgba>>24&255,A=b.rgba>>16&255,M=b.rgba>>8&255;return o=L+Math.round((C-L)*u),c=A+Math.round((S-A)*u),f=M+Math.round((k-M)*u),{css:p.toCss(o,c,f),rgba:p.toRgba(o,c,f)}},g.isOpaque=function(b){return(255&b.rgba)==255},g.ensureContrastRatio=function(b,x,C){const S=h.ensureContrastRatio(b.rgba,x.rgba,C);if(S)return p.toColor(S>>24&255,S>>16&255,S>>8&255)},g.opaque=function(b){const x=(255|b.rgba)>>>0;return[o,c,f]=h.toChannels(x),{css:p.toCss(o,c,f),rgba:x}},g.opacity=w,g.multiplyOpacity=function(b,x){return u=255&b.rgba,w(b,u*x/255)},g.toColorRGB=function(b){return[b.rgba>>24&255,b.rgba>>16&255,b.rgba>>8&255]}}(_||(s.color=_={})),function(g){let w,b;try{const x=document.createElement("canvas");x.width=1,x.height=1;const C=x.getContext("2d",{willReadFrequently:!0});C&&(w=C,w.globalCompositeOperation="copy",b=w.createLinearGradient(0,0,1,1))}catch{}g.toColor=function(x){if(x.match(/#[\da-f]{3,8}/i))switch(x.length){case 4:return o=parseInt(x.slice(1,2).repeat(2),16),c=parseInt(x.slice(2,3).repeat(2),16),f=parseInt(x.slice(3,4).repeat(2),16),p.toColor(o,c,f);case 5:return o=parseInt(x.slice(1,2).repeat(2),16),c=parseInt(x.slice(2,3).repeat(2),16),f=parseInt(x.slice(3,4).repeat(2),16),u=parseInt(x.slice(4,5).repeat(2),16),p.toColor(o,c,f,u);case 7:return{css:x,rgba:(parseInt(x.slice(1),16)<<8|255)>>>0};case 9:return{css:x,rgba:parseInt(x.slice(1),16)>>>0}}const C=x.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(C)return o=parseInt(C[1]),c=parseInt(C[2]),f=parseInt(C[3]),u=Math.round(255*(C[5]===void 0?1:parseFloat(C[5]))),p.toColor(o,c,f,u);if(!w||!b)throw new Error("css.toColor: Unsupported css format");if(w.fillStyle=b,w.fillStyle=x,typeof w.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(w.fillRect(0,0,1,1),[o,c,f,u]=w.getImageData(0,0,1,1).data,u!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:p.toRgba(o,c,f,u),css:x}}}(y||(s.css=y={})),function(g){function w(b,x,C){const S=b/255,k=x/255,L=C/255;return .2126*(S<=.03928?S/12.92:Math.pow((S+.055)/1.055,2.4))+.7152*(k<=.03928?k/12.92:Math.pow((k+.055)/1.055,2.4))+.0722*(L<=.03928?L/12.92:Math.pow((L+.055)/1.055,2.4))}g.relativeLuminance=function(b){return w(b>>16&255,b>>8&255,255&b)},g.relativeLuminance2=w}(v||(s.rgb=v={})),function(g){function w(x,C,S){const k=x>>24&255,L=x>>16&255,A=x>>8&255;let M=C>>24&255,D=C>>16&255,O=C>>8&255,z=d(v.relativeLuminance2(M,D,O),v.relativeLuminance2(k,L,A));for(;z<S&&(M>0||D>0||O>0);)M-=Math.max(0,Math.ceil(.1*M)),D-=Math.max(0,Math.ceil(.1*D)),O-=Math.max(0,Math.ceil(.1*O)),z=d(v.relativeLuminance2(M,D,O),v.relativeLuminance2(k,L,A));return(M<<24|D<<16|O<<8|255)>>>0}function b(x,C,S){const k=x>>24&255,L=x>>16&255,A=x>>8&255;let M=C>>24&255,D=C>>16&255,O=C>>8&255,z=d(v.relativeLuminance2(M,D,O),v.relativeLuminance2(k,L,A));for(;z<S&&(M<255||D<255||O<255);)M=Math.min(255,M+Math.ceil(.1*(255-M))),D=Math.min(255,D+Math.ceil(.1*(255-D))),O=Math.min(255,O+Math.ceil(.1*(255-O))),z=d(v.relativeLuminance2(M,D,O),v.relativeLuminance2(k,L,A));return(M<<24|D<<16|O<<8|255)>>>0}g.blend=function(x,C){if(u=(255&C)/255,u===1)return C;const S=C>>24&255,k=C>>16&255,L=C>>8&255,A=x>>24&255,M=x>>16&255,D=x>>8&255;return o=A+Math.round((S-A)*u),c=M+Math.round((k-M)*u),f=D+Math.round((L-D)*u),p.toRgba(o,c,f)},g.ensureContrastRatio=function(x,C,S){const k=v.relativeLuminance(x>>8),L=v.relativeLuminance(C>>8);if(d(k,L)<S){if(L<k){const D=w(x,C,S),O=d(k,v.relativeLuminance(D>>8));if(O<S){const z=b(x,C,S);return O>d(k,v.relativeLuminance(z>>8))?D:z}return D}const A=b(x,C,S),M=d(k,v.relativeLuminance(A>>8));if(M<S){const D=w(x,C,S);return M>d(k,v.relativeLuminance(D>>8))?A:D}return A}},g.reduceLuminance=w,g.increaseLuminance=b,g.toChannels=function(x){return[x>>24&255,x>>16&255,x>>8&255,255&x]}}(h||(s.rgba=h={})),s.toPaddedHex=m,s.contrastRatio=d},345:(l,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.runAndSubscribe=s.forwardEvent=s.EventEmitter=void 0,s.EventEmitter=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||(this._event=o=>(this._listeners.push(o),{dispose:()=>{if(!this._disposed){for(let c=0;c<this._listeners.length;c++)if(this._listeners[c]===o)return void this._listeners.splice(c,1)}}})),this._event}fire(o,c){const f=[];for(let u=0;u<this._listeners.length;u++)f.push(this._listeners[u]);for(let u=0;u<f.length;u++)f[u].call(void 0,o,c)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},s.forwardEvent=function(o,c){return o(f=>c.fire(f))},s.runAndSubscribe=function(o,c){return c(void 0),o(f=>c(f))}},859:(l,s)=>{function o(c){for(const f of c)f.dispose();c.length=0}Object.defineProperty(s,"__esModule",{value:!0}),s.getDisposeArrayDisposable=s.disposeArray=s.toDisposable=s.MutableDisposable=s.Disposable=void 0,s.Disposable=class{constructor(){this._disposables=[],this._isDisposed=!1}dispose(){this._isDisposed=!0;for(const c of this._disposables)c.dispose();this._disposables.length=0}register(c){return this._disposables.push(c),c}unregister(c){const f=this._disposables.indexOf(c);f!==-1&&this._disposables.splice(f,1)}},s.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(c){var f;this._isDisposed||c===this._value||((f=this._value)==null||f.dispose(),this._value=c)}clear(){this.value=void 0}dispose(){var c;this._isDisposed=!0,(c=this._value)==null||c.dispose(),this._value=void 0}},s.toDisposable=function(c){return{dispose:c}},s.disposeArray=o,s.getDisposeArrayDisposable=function(c){return{dispose:()=>o(c)}}},485:(l,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.FourKeyMap=s.TwoKeyMap=void 0;class o{constructor(){this._data={}}set(f,u,p){this._data[f]||(this._data[f]={}),this._data[f][u]=p}get(f,u){return this._data[f]?this._data[f][u]:void 0}clear(){this._data={}}}s.TwoKeyMap=o,s.FourKeyMap=class{constructor(){this._data=new o}set(c,f,u,p,_){this._data.get(c,f)||this._data.set(c,f,new o),this._data.get(c,f).set(u,p,_)}get(c,f,u,p){var _;return(_=this._data.get(c,f))==null?void 0:_.get(u,p)}clear(){this._data.clear()}}},399:(l,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.isChromeOS=s.isLinux=s.isWindows=s.isIphone=s.isIpad=s.isMac=s.getSafariVersion=s.isSafari=s.isLegacyEdge=s.isFirefox=s.isNode=void 0,s.isNode=typeof process<"u"&&"title"in process;const o=s.isNode?"node":navigator.userAgent,c=s.isNode?"node":navigator.platform;s.isFirefox=o.includes("Firefox"),s.isLegacyEdge=o.includes("Edge"),s.isSafari=/^((?!chrome|android).)*safari/i.test(o),s.getSafariVersion=function(){if(!s.isSafari)return 0;const f=o.match(/Version\/(\d+)/);return f===null||f.length<2?0:parseInt(f[1])},s.isMac=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(c),s.isIpad=c==="iPad",s.isIphone=c==="iPhone",s.isWindows=["Windows","Win16","Win32","WinCE"].includes(c),s.isLinux=c.indexOf("Linux")>=0,s.isChromeOS=/\bCrOS\b/.test(o)},385:(l,s,o)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.DebouncedIdleTask=s.IdleTaskQueue=s.PriorityTaskQueue=void 0;const c=o(399);class f{constructor(){this._tasks=[],this._i=0}enqueue(_){this._tasks.push(_),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(_){this._idleCallback=void 0;let y=0,v=0,h=_.timeRemaining(),m=0;for(;this._i<this._tasks.length;){if(y=Date.now(),this._tasks[this._i]()||this._i++,y=Math.max(1,Date.now()-y),v=Math.max(y,v),m=_.timeRemaining(),1.5*v>m)return h-y<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(h-y))}ms`),void this._start();h=m}this.clear()}}class u extends f{_requestCallback(_){return setTimeout(()=>_(this._createDeadline(16)))}_cancelCallback(_){clearTimeout(_)}_createDeadline(_){const y=Date.now()+_;return{timeRemaining:()=>Math.max(0,y-Date.now())}}}s.PriorityTaskQueue=u,s.IdleTaskQueue=!c.isNode&&"requestIdleCallback"in window?class extends f{_requestCallback(p){return requestIdleCallback(p)}_cancelCallback(p){cancelIdleCallback(p)}}:u,s.DebouncedIdleTask=class{constructor(){this._queue=new s.IdleTaskQueue}set(p){this._queue.clear(),this._queue.enqueue(p)}flush(){this._queue.flush()}}},147:(l,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.ExtendedAttrs=s.AttributeData=void 0;class o{constructor(){this.fg=0,this.bg=0,this.extended=new c}static toColorRGB(u){return[u>>>16&255,u>>>8&255,255&u]}static fromColorRGB(u){return(255&u[0])<<16|(255&u[1])<<8|255&u[2]}clone(){const u=new o;return u.fg=this.fg,u.bg=this.bg,u.extended=this.extended.clone(),u}isInverse(){return 67108864&this.fg}isBold(){return 134217728&this.fg}isUnderline(){return this.hasExtendedAttrs()&&this.extended.underlineStyle!==0?1:268435456&this.fg}isBlink(){return 536870912&this.fg}isInvisible(){return 1073741824&this.fg}isItalic(){return 67108864&this.bg}isDim(){return 134217728&this.bg}isStrikethrough(){return 2147483648&this.fg}isProtected(){return 536870912&this.bg}isOverline(){return 1073741824&this.bg}getFgColorMode(){return 50331648&this.fg}getBgColorMode(){return 50331648&this.bg}isFgRGB(){return(50331648&this.fg)==50331648}isBgRGB(){return(50331648&this.bg)==50331648}isFgPalette(){return(50331648&this.fg)==16777216||(50331648&this.fg)==33554432}isBgPalette(){return(50331648&this.bg)==16777216||(50331648&this.bg)==33554432}isFgDefault(){return(50331648&this.fg)==0}isBgDefault(){return(50331648&this.bg)==0}isAttributeDefault(){return this.fg===0&&this.bg===0}getFgColor(){switch(50331648&this.fg){case 16777216:case 33554432:return 255&this.fg;case 50331648:return 16777215&this.fg;default:return-1}}getBgColor(){switch(50331648&this.bg){case 16777216:case 33554432:return 255&this.bg;case 50331648:return 16777215&this.bg;default:return-1}}hasExtendedAttrs(){return 268435456&this.bg}updateExtended(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456}getUnderlineColor(){if(268435456&this.bg&&~this.extended.underlineColor)switch(50331648&this.extended.underlineColor){case 16777216:case 33554432:return 255&this.extended.underlineColor;case 50331648:return 16777215&this.extended.underlineColor;default:return this.getFgColor()}return this.getFgColor()}getUnderlineColorMode(){return 268435456&this.bg&&~this.extended.underlineColor?50331648&this.extended.underlineColor:this.getFgColorMode()}isUnderlineColorRGB(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==50331648:this.isFgRGB()}isUnderlineColorPalette(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==16777216||(50331648&this.extended.underlineColor)==33554432:this.isFgPalette()}isUnderlineColorDefault(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==0:this.isFgDefault()}getUnderlineStyle(){return 268435456&this.fg?268435456&this.bg?this.extended.underlineStyle:1:0}getUnderlineVariantOffset(){return this.extended.underlineVariantOffset}}s.AttributeData=o;class c{get ext(){return this._urlId?-469762049&this._ext|this.underlineStyle<<26:this._ext}set ext(u){this._ext=u}get underlineStyle(){return this._urlId?5:(469762048&this._ext)>>26}set underlineStyle(u){this._ext&=-469762049,this._ext|=u<<26&469762048}get underlineColor(){return 67108863&this._ext}set underlineColor(u){this._ext&=-67108864,this._ext|=67108863&u}get urlId(){return this._urlId}set urlId(u){this._urlId=u}get underlineVariantOffset(){const u=(3758096384&this._ext)>>29;return u<0?4294967288^u:u}set underlineVariantOffset(u){this._ext&=536870911,this._ext|=u<<29&3758096384}constructor(u=0,p=0){this._ext=0,this._urlId=0,this._ext=u,this._urlId=p}clone(){return new c(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}}s.ExtendedAttrs=c},782:(l,s,o)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.CellData=void 0;const c=o(133),f=o(855),u=o(147);class p extends u.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new u.ExtendedAttrs,this.combinedData=""}static fromCharData(y){const v=new p;return v.setFromCharData(y),v}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(y){this.fg=y[f.CHAR_DATA_ATTR_INDEX],this.bg=0;let v=!1;if(y[f.CHAR_DATA_CHAR_INDEX].length>2)v=!0;else if(y[f.CHAR_DATA_CHAR_INDEX].length===2){const h=y[f.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=h&&h<=56319){const m=y[f.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=m&&m<=57343?this.content=1024*(h-55296)+m-56320+65536|y[f.CHAR_DATA_WIDTH_INDEX]<<22:v=!0}else v=!0}else this.content=y[f.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|y[f.CHAR_DATA_WIDTH_INDEX]<<22;v&&(this.combinedData=y[f.CHAR_DATA_CHAR_INDEX],this.content=2097152|y[f.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}s.CellData=p},855:(l,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.WHITESPACE_CELL_CODE=s.WHITESPACE_CELL_WIDTH=s.WHITESPACE_CELL_CHAR=s.NULL_CELL_CODE=s.NULL_CELL_WIDTH=s.NULL_CELL_CHAR=s.CHAR_DATA_CODE_INDEX=s.CHAR_DATA_WIDTH_INDEX=s.CHAR_DATA_CHAR_INDEX=s.CHAR_DATA_ATTR_INDEX=s.DEFAULT_EXT=s.DEFAULT_ATTR=s.DEFAULT_COLOR=void 0,s.DEFAULT_COLOR=0,s.DEFAULT_ATTR=256|s.DEFAULT_COLOR<<9,s.DEFAULT_EXT=0,s.CHAR_DATA_ATTR_INDEX=0,s.CHAR_DATA_CHAR_INDEX=1,s.CHAR_DATA_WIDTH_INDEX=2,s.CHAR_DATA_CODE_INDEX=3,s.NULL_CELL_CHAR="",s.NULL_CELL_WIDTH=1,s.NULL_CELL_CODE=0,s.WHITESPACE_CELL_CHAR=" ",s.WHITESPACE_CELL_WIDTH=1,s.WHITESPACE_CELL_CODE=32},133:(l,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.Utf8ToUtf32=s.StringToUtf32=s.utf32ToString=s.stringFromCodePoint=void 0,s.stringFromCodePoint=function(o){return o>65535?(o-=65536,String.fromCharCode(55296+(o>>10))+String.fromCharCode(o%1024+56320)):String.fromCharCode(o)},s.utf32ToString=function(o,c=0,f=o.length){let u="";for(let p=c;p<f;++p){let _=o[p];_>65535?(_-=65536,u+=String.fromCharCode(55296+(_>>10))+String.fromCharCode(_%1024+56320)):u+=String.fromCharCode(_)}return u},s.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(o,c){const f=o.length;if(!f)return 0;let u=0,p=0;if(this._interim){const _=o.charCodeAt(p++);56320<=_&&_<=57343?c[u++]=1024*(this._interim-55296)+_-56320+65536:(c[u++]=this._interim,c[u++]=_),this._interim=0}for(let _=p;_<f;++_){const y=o.charCodeAt(_);if(55296<=y&&y<=56319){if(++_>=f)return this._interim=y,u;const v=o.charCodeAt(_);56320<=v&&v<=57343?c[u++]=1024*(y-55296)+v-56320+65536:(c[u++]=y,c[u++]=v)}else y!==65279&&(c[u++]=y)}return u}},s.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(o,c){const f=o.length;if(!f)return 0;let u,p,_,y,v=0,h=0,m=0;if(this.interim[0]){let w=!1,b=this.interim[0];b&=(224&b)==192?31:(240&b)==224?15:7;let x,C=0;for(;(x=63&this.interim[++C])&&C<4;)b<<=6,b|=x;const S=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,k=S-C;for(;m<k;){if(m>=f)return 0;if(x=o[m++],(192&x)!=128){m--,w=!0;break}this.interim[C++]=x,b<<=6,b|=63&x}w||(S===2?b<128?m--:c[v++]=b:S===3?b<2048||b>=55296&&b<=57343||b===65279||(c[v++]=b):b<65536||b>1114111||(c[v++]=b)),this.interim.fill(0)}const d=f-4;let g=m;for(;g<f;){for(;!(!(g<d)||128&(u=o[g])||128&(p=o[g+1])||128&(_=o[g+2])||128&(y=o[g+3]));)c[v++]=u,c[v++]=p,c[v++]=_,c[v++]=y,g+=4;if(u=o[g++],u<128)c[v++]=u;else if((224&u)==192){if(g>=f)return this.interim[0]=u,v;if(p=o[g++],(192&p)!=128){g--;continue}if(h=(31&u)<<6|63&p,h<128){g--;continue}c[v++]=h}else if((240&u)==224){if(g>=f)return this.interim[0]=u,v;if(p=o[g++],(192&p)!=128){g--;continue}if(g>=f)return this.interim[0]=u,this.interim[1]=p,v;if(_=o[g++],(192&_)!=128){g--;continue}if(h=(15&u)<<12|(63&p)<<6|63&_,h<2048||h>=55296&&h<=57343||h===65279)continue;c[v++]=h}else if((248&u)==240){if(g>=f)return this.interim[0]=u,v;if(p=o[g++],(192&p)!=128){g--;continue}if(g>=f)return this.interim[0]=u,this.interim[1]=p,v;if(_=o[g++],(192&_)!=128){g--;continue}if(g>=f)return this.interim[0]=u,this.interim[1]=p,this.interim[2]=_,v;if(y=o[g++],(192&y)!=128){g--;continue}if(h=(7&u)<<18|(63&p)<<12|(63&_)<<6|63&y,h<65536||h>1114111)continue;c[v++]=h}}return v}}},776:function(l,s,o){var c=this&&this.__decorate||function(h,m,d,g){var w,b=arguments.length,x=b<3?m:g===null?g=Object.getOwnPropertyDescriptor(m,d):g;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")x=Reflect.decorate(h,m,d,g);else for(var C=h.length-1;C>=0;C--)(w=h[C])&&(x=(b<3?w(x):b>3?w(m,d,x):w(m,d))||x);return b>3&&x&&Object.defineProperty(m,d,x),x},f=this&&this.__param||function(h,m){return function(d,g){m(d,g,h)}};Object.defineProperty(s,"__esModule",{value:!0}),s.traceCall=s.setTraceLogger=s.LogService=void 0;const u=o(859),p=o(97),_={trace:p.LogLevelEnum.TRACE,debug:p.LogLevelEnum.DEBUG,info:p.LogLevelEnum.INFO,warn:p.LogLevelEnum.WARN,error:p.LogLevelEnum.ERROR,off:p.LogLevelEnum.OFF};let y,v=s.LogService=class extends u.Disposable{get logLevel(){return this._logLevel}constructor(h){super(),this._optionsService=h,this._logLevel=p.LogLevelEnum.OFF,this._updateLogLevel(),this.register(this._optionsService.onSpecificOptionChange("logLevel",()=>this._updateLogLevel())),y=this}_updateLogLevel(){this._logLevel=_[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(h){for(let m=0;m<h.length;m++)typeof h[m]=="function"&&(h[m]=h[m]())}_log(h,m,d){this._evalLazyOptionalParams(d),h.call(console,(this._optionsService.options.logger?"":"xterm.js: ")+m,...d)}trace(h,...m){var d;this._logLevel<=p.LogLevelEnum.TRACE&&this._log(((d=this._optionsService.options.logger)==null?void 0:d.trace.bind(this._optionsService.options.logger))??console.log,h,m)}debug(h,...m){var d;this._logLevel<=p.LogLevelEnum.DEBUG&&this._log(((d=this._optionsService.options.logger)==null?void 0:d.debug.bind(this._optionsService.options.logger))??console.log,h,m)}info(h,...m){var d;this._logLevel<=p.LogLevelEnum.INFO&&this._log(((d=this._optionsService.options.logger)==null?void 0:d.info.bind(this._optionsService.options.logger))??console.info,h,m)}warn(h,...m){var d;this._logLevel<=p.LogLevelEnum.WARN&&this._log(((d=this._optionsService.options.logger)==null?void 0:d.warn.bind(this._optionsService.options.logger))??console.warn,h,m)}error(h,...m){var d;this._logLevel<=p.LogLevelEnum.ERROR&&this._log(((d=this._optionsService.options.logger)==null?void 0:d.error.bind(this._optionsService.options.logger))??console.error,h,m)}};s.LogService=v=c([f(0,p.IOptionsService)],v),s.setTraceLogger=function(h){y=h},s.traceCall=function(h,m,d){if(typeof d.value!="function")throw new Error("not supported");const g=d.value;d.value=function(...w){if(y.logLevel!==p.LogLevelEnum.TRACE)return g.apply(this,w);y.trace(`GlyphRenderer#${g.name}(${w.map(x=>JSON.stringify(x)).join(", ")})`);const b=g.apply(this,w);return y.trace(`GlyphRenderer#${g.name} return`,b),b}}},726:(l,s)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.createDecorator=s.getServiceDependencies=s.serviceRegistry=void 0;const o="di$target",c="di$dependencies";s.serviceRegistry=new Map,s.getServiceDependencies=function(f){return f[c]||[]},s.createDecorator=function(f){if(s.serviceRegistry.has(f))return s.serviceRegistry.get(f);const u=function(p,_,y){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");(function(v,h,m){h[o]===h?h[c].push({id:v,index:m}):(h[c]=[{id:v,index:m}],h[o]=h)})(u,p,y)};return u.toString=()=>f,s.serviceRegistry.set(f,u),u}},97:(l,s,o)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.IDecorationService=s.IUnicodeService=s.IOscLinkService=s.IOptionsService=s.ILogService=s.LogLevelEnum=s.IInstantiationService=s.ICharsetService=s.ICoreService=s.ICoreMouseService=s.IBufferService=void 0;const c=o(726);var f;s.IBufferService=(0,c.createDecorator)("BufferService"),s.ICoreMouseService=(0,c.createDecorator)("CoreMouseService"),s.ICoreService=(0,c.createDecorator)("CoreService"),s.ICharsetService=(0,c.createDecorator)("CharsetService"),s.IInstantiationService=(0,c.createDecorator)("InstantiationService"),function(u){u[u.TRACE=0]="TRACE",u[u.DEBUG=1]="DEBUG",u[u.INFO=2]="INFO",u[u.WARN=3]="WARN",u[u.ERROR=4]="ERROR",u[u.OFF=5]="OFF"}(f||(s.LogLevelEnum=f={})),s.ILogService=(0,c.createDecorator)("LogService"),s.IOptionsService=(0,c.createDecorator)("OptionsService"),s.IOscLinkService=(0,c.createDecorator)("OscLinkService"),s.IUnicodeService=(0,c.createDecorator)("UnicodeService"),s.IDecorationService=(0,c.createDecorator)("DecorationService")}},n={};function i(l){var s=n[l];if(s!==void 0)return s.exports;var o=n[l]={exports:{}};return r[l].call(o.exports,o,o.exports,i),o.exports}var a={};return(()=>{var l=a;Object.defineProperty(l,"__esModule",{value:!0}),l.WebglAddon=void 0;const s=i(345),o=i(859),c=i(399),f=i(666),u=i(776);class p extends o.Disposable{constructor(y){if(c.isSafari&&(0,c.getSafariVersion)()<16){const v={antialias:!1,depth:!1,preserveDrawingBuffer:!0};if(!document.createElement("canvas").getContext("webgl2",v))throw new Error("Webgl2 is only supported on Safari 16 and above")}super(),this._preserveDrawingBuffer=y,this._onChangeTextureAtlas=this.register(new s.EventEmitter),this.onChangeTextureAtlas=this._onChangeTextureAtlas.event,this._onAddTextureAtlasCanvas=this.register(new s.EventEmitter),this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event,this._onRemoveTextureAtlasCanvas=this.register(new s.EventEmitter),this.onRemoveTextureAtlasCanvas=this._onRemoveTextureAtlasCanvas.event,this._onContextLoss=this.register(new s.EventEmitter),this.onContextLoss=this._onContextLoss.event}activate(y){const v=y._core;if(!y.element)return void this.register(v.onWillOpen(()=>this.activate(y)));this._terminal=y;const h=v.coreService,m=v.optionsService,d=v,g=d._renderService,w=d._characterJoinerService,b=d._charSizeService,x=d._coreBrowserService,C=d._decorationService,S=d._logService,k=d._themeService;(0,u.setTraceLogger)(S),this._renderer=this.register(new f.WebglRenderer(y,w,b,x,h,C,m,k,this._preserveDrawingBuffer)),this.register((0,s.forwardEvent)(this._renderer.onContextLoss,this._onContextLoss)),this.register((0,s.forwardEvent)(this._renderer.onChangeTextureAtlas,this._onChangeTextureAtlas)),this.register((0,s.forwardEvent)(this._renderer.onAddTextureAtlasCanvas,this._onAddTextureAtlasCanvas)),this.register((0,s.forwardEvent)(this._renderer.onRemoveTextureAtlasCanvas,this._onRemoveTextureAtlasCanvas)),g.setRenderer(this._renderer),this.register((0,o.toDisposable)(()=>{const L=this._terminal._core._renderService;L.setRenderer(this._terminal._core._createRenderer()),L.handleResize(y.cols,y.rows)}))}get textureAtlas(){var y;return(y=this._renderer)==null?void 0:y.textureAtlas}clearTextureAtlas(){var y;(y=this._renderer)==null||y.clearTextureAtlas()}}l.WebglAddon=p})(),a})())})(_w);var fv=_w.exports;/**
|
|
129
129
|
* Copyright (c) 2014-2024 The xterm.js authors. All rights reserved.
|
|
130
130
|
* @license MIT
|
|
131
131
|
*
|
|
@@ -158,7 +158,7 @@ void main() {
|
|
|
158
158
|
* Fabrice Bellard's javascript vt100 for jslinux:
|
|
159
159
|
* http://bellard.org/jslinux/
|
|
160
160
|
* Copyright (c) 2011 Fabrice Bellard
|
|
161
|
-
*/var Rt=0,Dt=0,Mt=0,dt=0,Kt;(e=>{function t(i,a,l,s){return s!==void 0?`#${ts(i)}${ts(a)}${ts(l)}${ts(s)}`:`#${ts(i)}${ts(a)}${ts(l)}`}e.toCss=t;function r(i,a,l,s=255){return(i<<24|a<<16|l<<8|s)>>>0}e.toRgba=r;function n(i,a,l,s){return{css:e.toCss(i,a,l,s),rgba:e.toRgba(i,a,l,s)}}e.toColor=n})(Kt||(Kt={}));var SD;(e=>{function t(o,c){if(dt=(c.rgba&255)/255,dt===1)return{css:c.css,rgba:c.rgba};let f=c.rgba>>24&255,u=c.rgba>>16&255,p=c.rgba>>8&255,_=o.rgba>>24&255,y=o.rgba>>16&255,v=o.rgba>>8&255;Rt=_+Math.round((f-_)*dt),Dt=y+Math.round((u-y)*dt),Mt=v+Math.round((p-v)*dt);let h=Kt.toCss(Rt,Dt,Mt),m=Kt.toRgba(Rt,Dt,Mt);return{css:h,rgba:m}}e.blend=t;function r(o){return(o.rgba&255)===255}e.isOpaque=r;function n(o,c,f){let u=cl.ensureContrastRatio(o.rgba,c.rgba,f);if(u)return Kt.toColor(u>>24&255,u>>16&255,u>>8&255)}e.ensureContrastRatio=n;function i(o){let c=(o.rgba|255)>>>0;return[Rt,Dt,Mt]=cl.toChannels(c),{css:Kt.toCss(Rt,Dt,Mt),rgba:c}}e.opaque=i;function a(o,c){return dt=Math.round(c*255),[Rt,Dt,Mt]=cl.toChannels(o.rgba),{css:Kt.toCss(Rt,Dt,Mt,dt),rgba:Kt.toRgba(Rt,Dt,Mt,dt)}}e.opacity=a;function l(o,c){return dt=o.rgba&255,a(o,dt*c/255)}e.multiplyOpacity=l;function s(o){return[o.rgba>>24&255,o.rgba>>16&255,o.rgba>>8&255]}e.toColorRGB=s})(SD||(SD={}));var Ot;(e=>{let t,r;try{let i=document.createElement("canvas");i.width=1,i.height=1;let a=i.getContext("2d",{willReadFrequently:!0});a&&(t=a,t.globalCompositeOperation="copy",r=t.createLinearGradient(0,0,1,1))}catch{}function n(i){if(i.match(/#[\da-f]{3,8}/i))switch(i.length){case 4:return Rt=parseInt(i.slice(1,2).repeat(2),16),Dt=parseInt(i.slice(2,3).repeat(2),16),Mt=parseInt(i.slice(3,4).repeat(2),16),Kt.toColor(Rt,Dt,Mt);case 5:return Rt=parseInt(i.slice(1,2).repeat(2),16),Dt=parseInt(i.slice(2,3).repeat(2),16),Mt=parseInt(i.slice(3,4).repeat(2),16),dt=parseInt(i.slice(4,5).repeat(2),16),Kt.toColor(Rt,Dt,Mt,dt);case 7:return{css:i,rgba:(parseInt(i.slice(1),16)<<8|255)>>>0};case 9:return{css:i,rgba:parseInt(i.slice(1),16)>>>0}}let a=i.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(a)return Rt=parseInt(a[1]),Dt=parseInt(a[2]),Mt=parseInt(a[3]),dt=Math.round((a[5]===void 0?1:parseFloat(a[5]))*255),Kt.toColor(Rt,Dt,Mt,dt);if(!t||!r)throw new Error("css.toColor: Unsupported css format");if(t.fillStyle=r,t.fillStyle=i,typeof t.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(t.fillRect(0,0,1,1),[Rt,Dt,Mt,dt]=t.getImageData(0,0,1,1).data,dt!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:Kt.toRgba(Rt,Dt,Mt,dt),css:i}}e.toColor=n})(Ot||(Ot={}));var Yt;(e=>{function t(n){return r(n>>16&255,n>>8&255,n&255)}e.relativeLuminance=t;function r(n,i,a){let l=n/255,s=i/255,o=a/255,c=l<=.03928?l/12.92:Math.pow((l+.055)/1.055,2.4),f=s<=.03928?s/12.92:Math.pow((s+.055)/1.055,2.4),u=o<=.03928?o/12.92:Math.pow((o+.055)/1.055,2.4);return c*.2126+f*.7152+u*.0722}e.relativeLuminance2=r})(Yt||(Yt={}));var cl;(e=>{function t(l,s){if(dt=(s&255)/255,dt===1)return s;let o=s>>24&255,c=s>>16&255,f=s>>8&255,u=l>>24&255,p=l>>16&255,_=l>>8&255;return Rt=u+Math.round((o-u)*dt),Dt=p+Math.round((c-p)*dt),Mt=_+Math.round((f-_)*dt),Kt.toRgba(Rt,Dt,Mt)}e.blend=t;function r(l,s,o){let c=Yt.relativeLuminance(l>>8),f=Yt.relativeLuminance(s>>8);if(
|
|
161
|
+
*/var Rt=0,Dt=0,Mt=0,dt=0,Kt;(e=>{function t(i,a,l,s){return s!==void 0?`#${ts(i)}${ts(a)}${ts(l)}${ts(s)}`:`#${ts(i)}${ts(a)}${ts(l)}`}e.toCss=t;function r(i,a,l,s=255){return(i<<24|a<<16|l<<8|s)>>>0}e.toRgba=r;function n(i,a,l,s){return{css:e.toCss(i,a,l,s),rgba:e.toRgba(i,a,l,s)}}e.toColor=n})(Kt||(Kt={}));var SD;(e=>{function t(o,c){if(dt=(c.rgba&255)/255,dt===1)return{css:c.css,rgba:c.rgba};let f=c.rgba>>24&255,u=c.rgba>>16&255,p=c.rgba>>8&255,_=o.rgba>>24&255,y=o.rgba>>16&255,v=o.rgba>>8&255;Rt=_+Math.round((f-_)*dt),Dt=y+Math.round((u-y)*dt),Mt=v+Math.round((p-v)*dt);let h=Kt.toCss(Rt,Dt,Mt),m=Kt.toRgba(Rt,Dt,Mt);return{css:h,rgba:m}}e.blend=t;function r(o){return(o.rgba&255)===255}e.isOpaque=r;function n(o,c,f){let u=cl.ensureContrastRatio(o.rgba,c.rgba,f);if(u)return Kt.toColor(u>>24&255,u>>16&255,u>>8&255)}e.ensureContrastRatio=n;function i(o){let c=(o.rgba|255)>>>0;return[Rt,Dt,Mt]=cl.toChannels(c),{css:Kt.toCss(Rt,Dt,Mt),rgba:c}}e.opaque=i;function a(o,c){return dt=Math.round(c*255),[Rt,Dt,Mt]=cl.toChannels(o.rgba),{css:Kt.toCss(Rt,Dt,Mt,dt),rgba:Kt.toRgba(Rt,Dt,Mt,dt)}}e.opacity=a;function l(o,c){return dt=o.rgba&255,a(o,dt*c/255)}e.multiplyOpacity=l;function s(o){return[o.rgba>>24&255,o.rgba>>16&255,o.rgba>>8&255]}e.toColorRGB=s})(SD||(SD={}));var Ot;(e=>{let t,r;try{let i=document.createElement("canvas");i.width=1,i.height=1;let a=i.getContext("2d",{willReadFrequently:!0});a&&(t=a,t.globalCompositeOperation="copy",r=t.createLinearGradient(0,0,1,1))}catch{}function n(i){if(i.match(/#[\da-f]{3,8}/i))switch(i.length){case 4:return Rt=parseInt(i.slice(1,2).repeat(2),16),Dt=parseInt(i.slice(2,3).repeat(2),16),Mt=parseInt(i.slice(3,4).repeat(2),16),Kt.toColor(Rt,Dt,Mt);case 5:return Rt=parseInt(i.slice(1,2).repeat(2),16),Dt=parseInt(i.slice(2,3).repeat(2),16),Mt=parseInt(i.slice(3,4).repeat(2),16),dt=parseInt(i.slice(4,5).repeat(2),16),Kt.toColor(Rt,Dt,Mt,dt);case 7:return{css:i,rgba:(parseInt(i.slice(1),16)<<8|255)>>>0};case 9:return{css:i,rgba:parseInt(i.slice(1),16)>>>0}}let a=i.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(a)return Rt=parseInt(a[1]),Dt=parseInt(a[2]),Mt=parseInt(a[3]),dt=Math.round((a[5]===void 0?1:parseFloat(a[5]))*255),Kt.toColor(Rt,Dt,Mt,dt);if(!t||!r)throw new Error("css.toColor: Unsupported css format");if(t.fillStyle=r,t.fillStyle=i,typeof t.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(t.fillRect(0,0,1,1),[Rt,Dt,Mt,dt]=t.getImageData(0,0,1,1).data,dt!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:Kt.toRgba(Rt,Dt,Mt,dt),css:i}}e.toColor=n})(Ot||(Ot={}));var Yt;(e=>{function t(n){return r(n>>16&255,n>>8&255,n&255)}e.relativeLuminance=t;function r(n,i,a){let l=n/255,s=i/255,o=a/255,c=l<=.03928?l/12.92:Math.pow((l+.055)/1.055,2.4),f=s<=.03928?s/12.92:Math.pow((s+.055)/1.055,2.4),u=o<=.03928?o/12.92:Math.pow((o+.055)/1.055,2.4);return c*.2126+f*.7152+u*.0722}e.relativeLuminance2=r})(Yt||(Yt={}));var cl;(e=>{function t(l,s){if(dt=(s&255)/255,dt===1)return s;let o=s>>24&255,c=s>>16&255,f=s>>8&255,u=l>>24&255,p=l>>16&255,_=l>>8&255;return Rt=u+Math.round((o-u)*dt),Dt=p+Math.round((c-p)*dt),Mt=_+Math.round((f-_)*dt),Kt.toRgba(Rt,Dt,Mt)}e.blend=t;function r(l,s,o){let c=Yt.relativeLuminance(l>>8),f=Yt.relativeLuminance(s>>8);if(rn(c,f)<o){if(f<c){let _=n(l,s,o),y=rn(c,Yt.relativeLuminance(_>>8));if(y<o){let v=i(l,s,o),h=rn(c,Yt.relativeLuminance(v>>8));return y>h?_:v}return _}let u=i(l,s,o),p=rn(c,Yt.relativeLuminance(u>>8));if(p<o){let _=n(l,s,o),y=rn(c,Yt.relativeLuminance(_>>8));return p>y?u:_}return u}}e.ensureContrastRatio=r;function n(l,s,o){let c=l>>24&255,f=l>>16&255,u=l>>8&255,p=s>>24&255,_=s>>16&255,y=s>>8&255,v=rn(Yt.relativeLuminance2(p,_,y),Yt.relativeLuminance2(c,f,u));for(;v<o&&(p>0||_>0||y>0);)p-=Math.max(0,Math.ceil(p*.1)),_-=Math.max(0,Math.ceil(_*.1)),y-=Math.max(0,Math.ceil(y*.1)),v=rn(Yt.relativeLuminance2(p,_,y),Yt.relativeLuminance2(c,f,u));return(p<<24|_<<16|y<<8|255)>>>0}e.reduceLuminance=n;function i(l,s,o){let c=l>>24&255,f=l>>16&255,u=l>>8&255,p=s>>24&255,_=s>>16&255,y=s>>8&255,v=rn(Yt.relativeLuminance2(p,_,y),Yt.relativeLuminance2(c,f,u));for(;v<o&&(p<255||_<255||y<255);)p=Math.min(255,p+Math.ceil((255-p)*.1)),_=Math.min(255,_+Math.ceil((255-_)*.1)),y=Math.min(255,y+Math.ceil((255-y)*.1)),v=rn(Yt.relativeLuminance2(p,_,y),Yt.relativeLuminance2(c,f,u));return(p<<24|_<<16|y<<8|255)>>>0}e.increaseLuminance=i;function a(l){return[l>>24&255,l>>16&255,l>>8&255,l&255]}e.toChannels=a})(cl||(cl={}));function ts(e){let t=e.toString(16);return t.length<2?"0"+t:t}function rn(e,t){return e<t?(t+.05)/(e+.05):(e+.05)/(t+.05)}var xD=Object.freeze((()=>{let e=[Ot.toColor("#2e3436"),Ot.toColor("#cc0000"),Ot.toColor("#4e9a06"),Ot.toColor("#c4a000"),Ot.toColor("#3465a4"),Ot.toColor("#75507b"),Ot.toColor("#06989a"),Ot.toColor("#d3d7cf"),Ot.toColor("#555753"),Ot.toColor("#ef2929"),Ot.toColor("#8ae234"),Ot.toColor("#fce94f"),Ot.toColor("#729fcf"),Ot.toColor("#ad7fa8"),Ot.toColor("#34e2e2"),Ot.toColor("#eeeeec")],t=[0,95,135,175,215,255];for(let r=0;r<216;r++){let n=t[r/36%6|0],i=t[r/6%6|0],a=t[r%6];e.push({css:Kt.toCss(n,i,a),rgba:Kt.toRgba(n,i,a)})}for(let r=0;r<24;r++){let n=8+r*10;e.push({css:Kt.toCss(n,n,n),rgba:Kt.toRgba(n,n,n)})}return e})());function yv(e,t,r){return Math.max(t,Math.min(e,r))}function bD(e){switch(e){case"&":return"&";case"<":return"<"}return e}var Pw=class{constructor(e){this._buffer=e}serialize(e,t){let r=this._buffer.getNullCell(),n=this._buffer.getNullCell(),i=r,a=e.start.y,l=e.end.y,s=e.start.x,o=e.end.x;this._beforeSerialize(l-a,a,l);for(let c=a;c<=l;c++){let f=this._buffer.getLine(c);if(f){let u=c===e.start.y?s:0,p=c===e.end.y?o:f.length;for(let _=u;_<p;_++){let y=f.getCell(_,i===r?n:r);if(!y){console.warn(`Can't get cell at row=${c}, col=${_}`);continue}this._nextCell(y,i,c,_),i=y}}this._rowEnd(c,c===l)}return this._afterSerialize(),this._serializeString(t)}_nextCell(e,t,r,n){}_rowEnd(e,t){}_beforeSerialize(e,t,r){}_afterSerialize(){}_serializeString(e){return""}};function Iw(e,t){return e.getFgColorMode()===t.getFgColorMode()&&e.getFgColor()===t.getFgColor()}function on(e,t){return e.getBgColorMode()===t.getBgColorMode()&&e.getBgColor()===t.getBgColor()}function Ow(e,t){return e.isInverse()===t.isInverse()&&e.isBold()===t.isBold()&&e.isUnderline()===t.isUnderline()&&e.isOverline()===t.isOverline()&&e.isBlink()===t.isBlink()&&e.isInvisible()===t.isInvisible()&&e.isItalic()===t.isItalic()&&e.isDim()===t.isDim()&&e.isStrikethrough()===t.isStrikethrough()}var CD=class extends Pw{constructor(e,t){super(e),this._terminal=t,this._rowIndex=0,this._allRows=new Array,this._allRowSeparators=new Array,this._currentRow="",this._nullCellCount=0,this._cursorStyle=this._buffer.getNullCell(),this._cursorStyleRow=0,this._cursorStyleCol=0,this._backgroundCell=this._buffer.getNullCell(),this._firstRow=0,this._lastCursorRow=0,this._lastCursorCol=0,this._lastContentCursorRow=0,this._lastContentCursorCol=0,this._thisRowLastChar=this._buffer.getNullCell(),this._thisRowLastSecondChar=this._buffer.getNullCell(),this._nextRowFirstChar=this._buffer.getNullCell()}_beforeSerialize(e,t,r){this._allRows=new Array(e),this._lastContentCursorRow=t,this._lastCursorRow=t,this._firstRow=t}_rowEnd(e,t){var n;this._nullCellCount>0&&!on(this._cursorStyle,this._backgroundCell)&&(this._currentRow+=`\x1B[${this._nullCellCount}X`);let r="";if(!t){e-this._firstRow>=this._terminal.rows&&((n=this._buffer.getLine(this._cursorStyleRow))==null||n.getCell(this._cursorStyleCol,this._backgroundCell));let i=this._buffer.getLine(e),a=this._buffer.getLine(e+1);if(!a.isWrapped)r=`\r
|
|
162
162
|
`,this._lastCursorRow=e+1,this._lastCursorCol=0;else{r="";let l=i.getCell(i.length-1,this._thisRowLastChar),s=i.getCell(i.length-2,this._thisRowLastSecondChar),o=a.getCell(0,this._nextRowFirstChar),c=o.getWidth()>1,f=!1;(o.getChars()&&c?this._nullCellCount<=1:this._nullCellCount<=0)&&((l.getChars()||l.getWidth()===0)&&on(l,o)&&(f=!0),c&&(s.getChars()||s.getWidth()===0)&&on(l,o)&&on(s,o)&&(f=!0)),f||(r="-".repeat(this._nullCellCount+1),r+="\x1B[1D\x1B[1X",this._nullCellCount>0&&(r+="\x1B[A",r+=`\x1B[${i.length-this._nullCellCount}C`,r+=`\x1B[${this._nullCellCount}X`,r+=`\x1B[${i.length-this._nullCellCount}D`,r+="\x1B[B"),this._lastContentCursorRow=e+1,this._lastContentCursorCol=0,this._lastCursorRow=e+1,this._lastCursorCol=0)}}this._allRows[this._rowIndex]=this._currentRow,this._allRowSeparators[this._rowIndex++]=r,this._currentRow="",this._nullCellCount=0}_diffStyle(e,t){let r=[],n=!Iw(e,t),i=!on(e,t),a=!Ow(e,t);if(n||i||a)if(e.isAttributeDefault())t.isAttributeDefault()||r.push(0);else{if(n){let l=e.getFgColor();e.isFgRGB()?r.push(38,2,l>>>16&255,l>>>8&255,l&255):e.isFgPalette()?l>=16?r.push(38,5,l):r.push(l&8?90+(l&7):30+(l&7)):r.push(39)}if(i){let l=e.getBgColor();e.isBgRGB()?r.push(48,2,l>>>16&255,l>>>8&255,l&255):e.isBgPalette()?l>=16?r.push(48,5,l):r.push(l&8?100+(l&7):40+(l&7)):r.push(49)}a&&(e.isInverse()!==t.isInverse()&&r.push(e.isInverse()?7:27),e.isBold()!==t.isBold()&&r.push(e.isBold()?1:22),e.isUnderline()!==t.isUnderline()&&r.push(e.isUnderline()?4:24),e.isOverline()!==t.isOverline()&&r.push(e.isOverline()?53:55),e.isBlink()!==t.isBlink()&&r.push(e.isBlink()?5:25),e.isInvisible()!==t.isInvisible()&&r.push(e.isInvisible()?8:28),e.isItalic()!==t.isItalic()&&r.push(e.isItalic()?3:23),e.isDim()!==t.isDim()&&r.push(e.isDim()?2:22),e.isStrikethrough()!==t.isStrikethrough()&&r.push(e.isStrikethrough()?9:29))}return r}_nextCell(e,t,r,n){if(e.getWidth()===0)return;let i=e.getChars()==="",a=this._diffStyle(e,this._cursorStyle);if(i?!on(this._cursorStyle,e):a.length>0){this._nullCellCount>0&&(on(this._cursorStyle,this._backgroundCell)||(this._currentRow+=`\x1B[${this._nullCellCount}X`),this._currentRow+=`\x1B[${this._nullCellCount}C`,this._nullCellCount=0),this._lastContentCursorRow=this._lastCursorRow=r,this._lastContentCursorCol=this._lastCursorCol=n,this._currentRow+=`\x1B[${a.join(";")}m`;let l=this._buffer.getLine(r);l!==void 0&&(l.getCell(n,this._cursorStyle),this._cursorStyleRow=r,this._cursorStyleCol=n)}i?this._nullCellCount+=e.getWidth():(this._nullCellCount>0&&(on(this._cursorStyle,this._backgroundCell)?this._currentRow+=`\x1B[${this._nullCellCount}C`:(this._currentRow+=`\x1B[${this._nullCellCount}X`,this._currentRow+=`\x1B[${this._nullCellCount}C`),this._nullCellCount=0),this._currentRow+=e.getChars(),this._lastContentCursorRow=this._lastCursorRow=r,this._lastContentCursorCol=this._lastCursorCol=n+e.getWidth())}_serializeString(e){let t=this._allRows.length;this._buffer.length-this._firstRow<=this._terminal.rows&&(t=this._lastContentCursorRow+1-this._firstRow,this._lastCursorCol=this._lastContentCursorCol,this._lastCursorRow=this._lastContentCursorRow);let r="";for(let a=0;a<t;a++)r+=this._allRows[a],a+1<t&&(r+=this._allRowSeparators[a]);if(!e){let a=this._buffer.baseY+this._buffer.cursorY,l=this._buffer.cursorX,s=a!==this._lastCursorRow||l!==this._lastCursorCol,o=c=>{c>0?r+=`\x1B[${c}C`:c<0&&(r+=`\x1B[${-c}D`)};s&&((c=>{c>0?r+=`\x1B[${c}B`:c<0&&(r+=`\x1B[${-c}A`)})(a-this._lastCursorRow),o(l-this._lastCursorCol))}let n=this._terminal._core._inputHandler._curAttrData,i=this._diffStyle(n,this._cursorStyle);return i.length>0&&(r+=`\x1B[${i.join(";")}m`),r}},ED=class{activate(e){this._terminal=e}_serializeBufferByScrollback(e,t,r){let n=t.length,i=r===void 0?n:yv(r+e.rows,0,n);return this._serializeBufferByRange(e,t,{start:n-i,end:n-1},!1)}_serializeBufferByRange(e,t,r,n){return new CD(t,e).serialize({start:{x:0,y:typeof r.start=="number"?r.start:r.start.line},end:{x:e.cols,y:typeof r.end=="number"?r.end:r.end.line}},n)}_serializeBufferAsHTML(e,t){var s;let r=e.buffer.active,n=new kD(r,e,t),i=t.onlySelection??!1,a=t.range;if(a)return n.serialize({start:{x:a.startCol,y:(a.startLine,a.startLine)},end:{x:e.cols,y:(a.endLine,a.endLine)}});if(!i){let o=r.length,c=t.scrollback,f=c===void 0?o:yv(c+e.rows,0,o);return n.serialize({start:{x:0,y:o-f},end:{x:e.cols,y:o-1}})}let l=(s=this._terminal)==null?void 0:s.getSelectionPosition();return l!==void 0?n.serialize({start:{x:l.start.x,y:l.start.y},end:{x:l.end.x,y:l.end.y}}):""}_serializeModes(e){let t="",r=e.modes;if(r.applicationCursorKeysMode&&(t+="\x1B[?1h"),r.applicationKeypadMode&&(t+="\x1B[?66h"),r.bracketedPasteMode&&(t+="\x1B[?2004h"),r.insertMode&&(t+="\x1B[4h"),r.originMode&&(t+="\x1B[?6h"),r.reverseWraparoundMode&&(t+="\x1B[?45h"),r.sendFocusMode&&(t+="\x1B[?1004h"),r.wraparoundMode===!1&&(t+="\x1B[?7l"),r.mouseTrackingMode!=="none")switch(r.mouseTrackingMode){case"x10":t+="\x1B[?9h";break;case"vt200":t+="\x1B[?1000h";break;case"drag":t+="\x1B[?1002h";break;case"any":t+="\x1B[?1003h";break}return t}serialize(e){if(!this._terminal)throw new Error("Cannot use addon until it has been loaded");let t=e!=null&&e.range?this._serializeBufferByRange(this._terminal,this._terminal.buffer.normal,e.range,!0):this._serializeBufferByScrollback(this._terminal,this._terminal.buffer.normal,e==null?void 0:e.scrollback);if(!(e!=null&&e.excludeAltBuffer)&&this._terminal.buffer.active.type==="alternate"){let r=this._serializeBufferByScrollback(this._terminal,this._terminal.buffer.alternate,void 0);t+=`\x1B[?1049h\x1B[H${r}`}return e!=null&&e.excludeModes||(t+=this._serializeModes(this._terminal)),t}serializeAsHTML(e){if(!this._terminal)throw new Error("Cannot use addon until it has been loaded");return this._serializeBufferAsHTML(this._terminal,e||{})}dispose(){}},kD=class extends Pw{constructor(e,t,r){super(e),this._terminal=t,this._options=r,this._currentRow="",this._htmlContent="",t._core._themeService?this._ansiColors=t._core._themeService.colors.ansi:this._ansiColors=xD}_padStart(e,t,r){return t=t>>0,r=r??" ",e.length>t?e:(t-=e.length,t>r.length&&(r+=r.repeat(t/r.length)),r.slice(0,t)+e)}_beforeSerialize(e,t,r){var l,s;this._htmlContent+="<html><body><!--StartFragment--><pre>";let n="#000000",i="#ffffff";(this._options.includeGlobalBackground??!1)&&(n=((l=this._terminal.options.theme)==null?void 0:l.foreground)??"#ffffff",i=((s=this._terminal.options.theme)==null?void 0:s.background)??"#000000");let a=[];a.push("color: "+n+";"),a.push("background-color: "+i+";"),a.push("font-family: "+this._terminal.options.fontFamily+";"),a.push("font-size: "+this._terminal.options.fontSize+"px;"),this._htmlContent+="<div style='"+a.join(" ")+"'>"}_afterSerialize(){this._htmlContent+="</div>",this._htmlContent+="</pre><!--EndFragment--></body></html>"}_rowEnd(e,t){this._htmlContent+="<div><span>"+this._currentRow+"</span></div>",this._currentRow=""}_getHexColor(e,t){let r=t?e.getFgColor():e.getBgColor();if(t?e.isFgRGB():e.isBgRGB())return"#"+[r>>16&255,r>>8&255,r&255].map(n=>this._padStart(n.toString(16),2,"0")).join("");if(t?e.isFgPalette():e.isBgPalette())return this._ansiColors[r].css}_diffStyle(e,t){let r=[],n=!Iw(e,t),i=!on(e,t),a=!Ow(e,t);if(n||i||a){let l=this._getHexColor(e,!0);l&&r.push("color: "+l+";");let s=this._getHexColor(e,!1);return s&&r.push("background-color: "+s+";"),e.isInverse()&&r.push("color: #000000; background-color: #BFBFBF;"),e.isBold()&&r.push("font-weight: bold;"),e.isUnderline()&&e.isOverline()?r.push("text-decoration: overline underline;"):e.isUnderline()?r.push("text-decoration: underline;"):e.isOverline()&&r.push("text-decoration: overline;"),e.isBlink()&&r.push("text-decoration: blink;"),e.isInvisible()&&r.push("visibility: hidden;"),e.isItalic()&&r.push("font-style: italic;"),e.isDim()&&r.push("opacity: 0.5;"),e.isStrikethrough()&&r.push("text-decoration: line-through;"),r}}_nextCell(e,t,r,n){if(e.getWidth()===0)return;let i=e.getChars()==="",a=this._diffStyle(e,t);a&&(this._currentRow+=a.length===0?"</span><span>":"</span><span style='"+a.join(" ")+"'>"),i?this._currentRow+=" ":this._currentRow+=bD(e.getChars())}_serializeString(){return this._htmlContent}};/**
|
|
163
163
|
* Copyright (c) 2014-2024 The xterm.js authors. All rights reserved.
|
|
164
164
|
* @license MIT
|
|
@@ -170,7 +170,7 @@ void main() {
|
|
|
170
170
|
* Fabrice Bellard's javascript vt100 for jslinux:
|
|
171
171
|
* http://bellard.org/jslinux/
|
|
172
172
|
* Copyright (c) 2011 Fabrice Bellard
|
|
173
|
-
*/function wv(e){let t=0;for(let r=0;r<e.length;++r){let n=e.charCodeAt(r);if(n<48||57<n)return-1;t=t*10+n-48}return t}var LD=class{constructor(){this._st=0,this._pr=0}dispose(){var e,t;(e=this._seqHandler)==null||e.dispose(),(t=this._onChange)==null||t.dispose()}activate(e){this._seqHandler=e.parser.registerOscHandler(9,t=>{if(!t.startsWith("4;"))return!1;let r=t.split(";");if(r.length>3)return!0;r.length===2&&r.push("");let n=wv(r[1]),i=wv(r[2]);switch(n){case 0:this.progress={state:n,value:0};break;case 1:if(i<0)return!0;this.progress={state:n,value:i};break;case 2:case 4:if(i<0)return!0;this.progress={state:n,value:i||this._pr};break;case 3:this.progress={state:n,value:this._pr};break}return!0}),this._onChange=new e._core._onData.constructor,this.onChange=this._onChange.event}get progress(){return{state:this._st,value:this._pr}}set progress(e){var t;if(e.state<0||e.state>4){console.warn("progress state out of bounds, not applied");return}this._st=e.state,this._pr=Math.min(Math.max(e.value,0),100),(t=this._onChange)==null||t.fire({state:this._st,value:this._pr})}};const TD=/https?:\/\/[^\s"'<>]+|\b(?:localhost|\d{1,3}(?:\.\d{1,3}){3}):\d{1,5}(?:\/[^\s"'<>]*)?\b/,RD=/[.,;:!?]+$/,DD=[["(",")"],["[","]"],["{","}"]],Sv=(e,t)=>e.split(t).length-1;function wu(e){let t=e.trim();if(!t)return t;const r=()=>{t=t.replace(RD,"")};r();let n=!0;for(;n;){n=!1;for(const[i,a]of DD){if(!t.endsWith(a))continue;const l=Sv(t,i);Sv(t,a)>l&&(t=t.slice(0,-1),n=!0)}}return r(),t}const Na=()=>typeof navigator<"u"&&/Mac|iPhone|iPad|iPod/.test(navigator.platform),MD="\x1B[200~\x1B[201~";class AD{async readText(t){if(t!=="c")return"";try{return await navigator.clipboard.readText()}catch{return""}}async writeText(t,r){if(!(t!=="c"||!(r!=null&&r.trim())))try{await navigator.clipboard.writeText(r)}catch{}}}const PD="︎",Bw=["⏺"],ID=e=>e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),OD=new RegExp(Bw.map(ID).join("|"),"g");function BD(e){for(const t of Bw)if(e.indexOf(t)!==-1)return e.replace(OD,`$&${PD}`);return e}function ND({sessionId:e,tmuxTarget:t,allowAttach:r=!0,connectionStatus:n="connected",connectionEpoch:i=0,sendMessage:a,subscribe:l,theme:s,fontSize:o,lineHeight:c,letterSpacing:f,fontFamily:u,useWebGL:p,onScrollChange:_}){const y=Zo(),v=E.useRef(null),h=E.useRef(null),m=E.useRef(null),d=E.useRef(null),g=E.useRef(null),w=E.useRef(null),b=E.useRef(null),x=E.useRef(null),C=E.useRef(null),S=E.useRef(null),k=E.useRef(null),L=E.useRef(null),A=E.useRef(0),M=E.useRef(!1),D=E.useRef(null),O=E.useRef(null),z=E.useRef(null),F=E.useRef(-1),H=E.useRef(null),I=E.useRef(a),R=E.useRef(_),P=E.useRef(p),N=E.useRef(""),j=E.useRef(null),W=E.useRef(null),V=2,Z=16,Q=E.useRef(null),$=E.useRef(null),B=E.useRef(null),
|
|
173
|
+
*/function wv(e){let t=0;for(let r=0;r<e.length;++r){let n=e.charCodeAt(r);if(n<48||57<n)return-1;t=t*10+n-48}return t}var LD=class{constructor(){this._st=0,this._pr=0}dispose(){var e,t;(e=this._seqHandler)==null||e.dispose(),(t=this._onChange)==null||t.dispose()}activate(e){this._seqHandler=e.parser.registerOscHandler(9,t=>{if(!t.startsWith("4;"))return!1;let r=t.split(";");if(r.length>3)return!0;r.length===2&&r.push("");let n=wv(r[1]),i=wv(r[2]);switch(n){case 0:this.progress={state:n,value:0};break;case 1:if(i<0)return!0;this.progress={state:n,value:i};break;case 2:case 4:if(i<0)return!0;this.progress={state:n,value:i||this._pr};break;case 3:this.progress={state:n,value:this._pr};break}return!0}),this._onChange=new e._core._onData.constructor,this.onChange=this._onChange.event}get progress(){return{state:this._st,value:this._pr}}set progress(e){var t;if(e.state<0||e.state>4){console.warn("progress state out of bounds, not applied");return}this._st=e.state,this._pr=Math.min(Math.max(e.value,0),100),(t=this._onChange)==null||t.fire({state:this._st,value:this._pr})}};const TD=/https?:\/\/[^\s"'<>]+|\b(?:localhost|\d{1,3}(?:\.\d{1,3}){3}):\d{1,5}(?:\/[^\s"'<>]*)?\b/,RD=/[.,;:!?]+$/,DD=[["(",")"],["[","]"],["{","}"]],Sv=(e,t)=>e.split(t).length-1;function wu(e){let t=e.trim();if(!t)return t;const r=()=>{t=t.replace(RD,"")};r();let n=!0;for(;n;){n=!1;for(const[i,a]of DD){if(!t.endsWith(a))continue;const l=Sv(t,i);Sv(t,a)>l&&(t=t.slice(0,-1),n=!0)}}return r(),t}const Na=()=>typeof navigator<"u"&&/Mac|iPhone|iPad|iPod/.test(navigator.platform),MD="\x1B[200~\x1B[201~";class AD{async readText(t){if(t!=="c")return"";try{return await navigator.clipboard.readText()}catch{return""}}async writeText(t,r){if(!(t!=="c"||!(r!=null&&r.trim())))try{await navigator.clipboard.writeText(r)}catch{}}}const PD="︎",Bw=["⏺"],ID=e=>e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),OD=new RegExp(Bw.map(ID).join("|"),"g");function BD(e){for(const t of Bw)if(e.indexOf(t)!==-1)return e.replace(OD,`$&${PD}`);return e}function ND({sessionId:e,tmuxTarget:t,allowAttach:r=!0,connectionStatus:n="connected",connectionEpoch:i=0,sendMessage:a,subscribe:l,theme:s,fontSize:o,lineHeight:c,letterSpacing:f,fontFamily:u,useWebGL:p,onScrollChange:_}){const y=Zo(),v=E.useRef(null),h=E.useRef(null),m=E.useRef(null),d=E.useRef(null),g=E.useRef(null),w=E.useRef(null),b=E.useRef(null),x=E.useRef(null),C=E.useRef(null),S=E.useRef(null),k=E.useRef(null),L=E.useRef(null),A=E.useRef(0),M=E.useRef(!1),D=E.useRef(null),O=E.useRef(null),z=E.useRef(null),F=E.useRef(-1),H=E.useRef(null),I=E.useRef(a),R=E.useRef(_),P=E.useRef(p),N=E.useRef(""),j=E.useRef(null),W=E.useRef(null),V=2,Z=16,Q=E.useRef(null),$=E.useRef(null),B=E.useRef(null),K=()=>{if(Q.current!==null&&(window.clearTimeout(Q.current),Q.current=null),$.current!==null&&(cancelAnimationFrame($.current),$.current=null),B.current!==null){const ne=v.current;ne&&(ne.style.display=B.current),B.current=null}},U=ne=>{const oe=v.current;oe&&(K(),Q.current=window.setTimeout(()=>{Q.current=null;const ce=h.current;ce&&ce.refresh(0,ce.rows-1),B.current=oe.style.display,oe.style.display="none",$.current=requestAnimationFrame(()=>{$.current=requestAnimationFrame(()=>{$.current=null,oe.style.display=B.current??"",B.current=null})})},ne))};E.useEffect(()=>{I.current=a},[a]),E.useEffect(()=>{R.current=_},[_]);const te=E.useCallback(()=>{const ne=h.current;if(!ne||!R.current)return;const oe=ne.buffer.active,ce=!M.current&&oe.viewportY>=oe.baseY;R.current(ce)},[]),Y=E.useCallback(ne=>{if(M.current===ne)return;M.current=ne;const oe=h.current;oe&&ne&&oe.write("\x1B[?1000l\x1B[?1002l\x1B[?1003l\x1B[?1006l"),te()},[te]),ye=E.useCallback(()=>{const ne=O.current;ne&&(D.current!==null&&window.clearTimeout(D.current),D.current=window.setTimeout(()=>{D.current=null,I.current({type:"tmux-check-copy-mode",sessionId:ne})},150))},[]),pe=E.useCallback(()=>{const ne=h.current,oe=m.current;if(!ne||!oe)return;oe.fit();const ce=O.current;ce&&I.current({type:"terminal-resize",sessionId:ce,cols:ne.cols,rows:ne.rows})},[]);return E.useEffect(()=>{var _e;const ne=v.current;if(!ne||h.current)return;let oe=!1;ne.innerHTML="";const ue=((re,le)=>Math.round(re*le)/re)(o,c),ve=new JR.Terminal({fontFamily:u,fontSize:o,lineHeight:ue,letterSpacing:f,scrollback:0,cursorBlink:!1,cursorStyle:"underline",convertEol:!0,theme:s,screenReaderMode:y,minimumContrastRatio:4.5}),se=new eD;ve.loadAddon(se),ve.loadAddon(new vD(void 0,new AD));const ae=new wD.SearchAddon;ve.loadAddon(ae),b.current=ae;const fe=new ED;ve.loadAddon(fe),x.current=fe;const ie=new LD;ve.loadAddon(ie),C.current=ie;const ge=()=>{if(!oe){if(P.current)try{const re=new fv.WebglAddon;re.onContextLoss(()=>{try{re.dispose()}catch{}d.current=null}),ve.loadAddon(re),d.current=re}catch{}ve.open(ne),se.fit(),be&&ve.element&&ve.element.appendChild(be)}};(_e=document.fonts)!=null&&_e.ready?document.fonts.ready.then(ge).catch(ge):ge();let be=null,Te=null,je=null;typeof document<"u"&&document.createElement&&(be=document.createElement("div"),be.className="xterm-hover",be.style.cssText=`
|
|
174
174
|
position: absolute;
|
|
175
175
|
display: none;
|
|
176
176
|
z-index: 20;
|
|
@@ -184,7 +184,7 @@ void main() {
|
|
|
184
184
|
pointer-events: none;
|
|
185
185
|
max-width: 400px;
|
|
186
186
|
word-break: break-all;
|
|
187
|
-
`,Le=document.createElement("div"),Ee.appendChild(Le),He=document.createElement("div"),He.style.color="var(--text-muted)",He.style.marginTop="2px",He.style.fontSize="11px",Ee.appendChild(He),w.current=Ee);const je=(ne,ue)=>{if(!ve.element||!Ee||!Le||!He)return;const ke=wu(ue);if(!ke)return;const De=ve.element.getBoundingClientRect(),ze=ke.length>60?ke.slice(0,57)+"...":ke;Le.textContent=ze,He.textContent=`${Na()?"⌘":"Ctrl"}+click to open`,Ee.style.left=`${ne.clientX-De.left+10}px`,Ee.style.top=`${ne.clientY-De.top+10}px`,Ee.style.display="block"},Pe=()=>{Ee&&(Ee.style.display="none")};let Oe=null,Ce=!1,Te=null;const J={activate:(ne,ue)=>{if(!Ce&&(ne.metaKey||ne.ctrlKey)){const ke=wu(ue);if(!ke)return;window.open(ke,"_blank","noopener")}},hover:(ne,ue)=>{Oe=wu(ue)||null,je(ne,ue)},leave:()=>{Oe=null,Pe()}},ee=ne=>{Oe&&(ne.metaKey||ne.ctrlKey)&&(ne.preventDefault(),ne.stopPropagation(),Ce=!0,window.open(Oe,"_blank","noopener"),Te&&clearTimeout(Te),Te=setTimeout(()=>{Ce=!1},100))};re.addEventListener("mousedown",ee,!0),ve.options.linkHandler=J;const $e=new oD((ne,ue)=>J.activate(ne,ue),{urlRegex:TD,hover:(ne,ue)=>J.hover(ne,ue),leave:()=>J.leave()});ve.loadAddon($e),g.current=$e;let Ne=null,K=null;const he=Na()?"metaKey":"ctrlKey";ve.attachCustomKeyEventHandler(ne=>{if((ne.ctrlKey||ne.metaKey)&&ne.key.toLowerCase()==="c"&&ve.hasSelection()){const ue=ve.getSelection();return ue!=null&&ue.trim()&&navigator.clipboard&&navigator.clipboard.writeText(ue),!1}if(Na()&&!y&&ne.ctrlKey&&!ne.metaKey&&ne.key.toLowerCase()==="v"&&ne.type==="keydown")return O.current&&(M.current&&(I.current({type:"tmux-cancel-copy-mode",sessionId:O.current}),Y(!1)),I.current({type:"terminal-input",sessionId:O.current,data:MD})),!O.current;if(ne[he]&&ne.key.toLowerCase()==="v"&&ne.type==="keydown"){K!==null&&(clearTimeout(K),K=null),Ne=null;const ue=new Promise(ke=>{K=setTimeout(()=>{K=null,Ne=null,ke(null)},100),Ne=De=>{K!==null&&(clearTimeout(K),K=null),ke(De)}});return(async()=>{try{const ke=O.current;if(!ke)return;let De=await ue;if(De==null)try{De=await navigator.clipboard.readText()}catch{De=""}if(!De&&Na()&&!y)try{const ze=await fetch("/api/clipboard-file-path");if(ze.ok){const{path:We}=await ze.json();if(We){I.current({type:"terminal-input",sessionId:ke,data:We});return}}}catch{}De&&ve.paste(De)}finally{Ne=null}})(),!1}if(ne.ctrlKey&&ne.key==="Backspace"&&ne.type==="keydown"){const ue=O.current;return ue&&I.current({type:"terminal-input",sessionId:ue,data:""}),!1}return!0});const X=ne=>{var De;if(!Ne)return;ne.preventDefault(),ne.stopPropagation();const ue=((De=ne.clipboardData)==null?void 0:De.getData("text/plain"))??"",ke=Ne;Ne=null,ke(ue)};return re.addEventListener("paste",X,{capture:!0}),ve.onData(ne=>{const ue=O.current;if(ue){const ke=/^\x1b\[(<[\d;]+[Mm]|[\d;]+M|M[\x20-\xff]{3})$/.test(ne);if(M.current&&ke)return;M.current&&(I.current({type:"tmux-cancel-copy-mode",sessionId:ue}),Y(!1)),I.current({type:"terminal-input",sessionId:ue,data:ne})}}),ve.attachCustomWheelEventHandler(ne=>{const ue=O.current;if(!ue)return!0;const ke=ne.target;if(ke!=null&&ke.closest('input, textarea, [contenteditable="true"], .xterm-hover')||ve.hasSelection()||ne.shiftKey)return!0;const De=30;A.current+=ne.deltaY;const ze=ve.cols,We=ve.rows,Ie=Math.floor(ze/2),Me=Math.floor(We/2);let et=!1,Ue=!1;for(;Math.abs(A.current)>=De;){Ue=!0;const Re=A.current>0;A.current+=Re?-De:De;const Ae=Re?65:64;Re||(et=!0),I.current({type:"terminal-input",sessionId:ue,data:`\x1B[<${Ae};${Ie};${Me}M`})}return et&&Y(!0),Ue&&_e(),!1}),h.current=ve,m.current=ie,()=>{if(le=!0,Te&&clearTimeout(Te),Oe=null,re.removeEventListener("mousedown",ee,!0),re.removeEventListener("paste",X,!0),K!==null&&(clearTimeout(K),K=null),Ne=null,w.current&&(w.current.remove(),w.current=null),g.current){try{g.current.dispose()}catch{}g.current=null}if(d.current){try{d.current.dispose()}catch{}d.current=null}try{ve.dispose()}catch{}re&&(re.innerHTML=""),h.current=null,m.current=null,b.current=null,x.current=null,C.current=null,L.current&&window.clearTimeout(L.current),D.current!==null&&window.clearTimeout(D.current)}},[fe]),E.useEffect(()=>{h.current&&(h.current.options.theme=s)},[s]),E.useEffect(()=>{const re=h.current,le=m.current;if(re&&le){re.options.fontFamily=u,re.options.fontSize=o,re.options.lineHeight=Math.round(o*c)/o,re.options.letterSpacing=f,le.fit();const se=O.current;se&&I.current({type:"terminal-resize",sessionId:se,cols:re.cols,rows:re.rows})}},[o,c,f,u]),E.useEffect(()=>{const re=h.current;if(!re)return;const le=P.current;if(P.current=p,le!==p){if(p){if(!d.current)try{const se=new fv.WebglAddon;se.onContextLoss(()=>{try{se.dispose()}catch{}d.current=null}),re.loadAddon(se),d.current=se}catch{}}else if(d.current){try{d.current.dispose()}catch{}d.current=null}}},[p]),E.useEffect(()=>{const re=h.current;if(!re)return;const le=O.current,se=z.current;if(!r){le&&(I.current({type:"terminal-detach",sessionId:le}),O.current=null,z.current=null,F.current=-1,M.current=!1),re.reset();return}if(n!=="connected"){le&&(qe("terminal_detach_on_disconnect",{connectionStatus:n,prevAttached:le}),O.current=null,z.current=null,F.current=-1,M.current=!1);return}le&&le!==e&&(I.current({type:"terminal-detach",sessionId:le}),O.current=null,z.current=null,F.current=-1,M.current=!1);const pe=F.current,ve=i!==pe;if(e&&(e!==le||t!==se||ve)){qe("terminal_attach",{sessionId:e,tmuxTarget:t,prevAttached:le,prevTarget:se,connectionStatus:n,connectionEpoch:i,attachedEpoch:pe});const ie=performance.now();re.reset();const oe=performance.now(),de=m.current;de&&de.fit();const ae=performance.now();I.current({type:"terminal-attach",sessionId:e,tmuxTarget:t??void 0,cols:re.cols,rows:re.rows}),O.current=e,z.current=t??null,F.current=i,I.current({type:"tmux-check-copy-mode",sessionId:e}),qe("switch_attach_sent",{sessionId:e,resetMs:Math.round(oe-ie),fitMs:Math.round(ae-oe),totalMs:Math.round(performance.now()-ie),from:le??null}),H.current=ie,k.current&&window.clearTimeout(k.current),k.current=window.setTimeout(()=>{re.scrollToBottom(),te(),re.focus()},300)}e&&e===le&&t===se&&!ve&&qe("terminal_attach_skip",{sessionId:e,prevAttached:le,connectionStatus:n,connectionEpoch:i,attachedEpoch:pe}),!e&&le&&(O.current=null,z.current=null,F.current=-1)},[e,t,r,n,i,te]),E.useEffect(()=>{const re=()=>{j.current!==null&&(window.clearTimeout(j.current),j.current=null),W.current!==null&&(window.clearTimeout(W.current),W.current=null);const pe=h.current,ve=N.current;if(!pe||!ve)return;N.current="";const ie=performance.now(),oe=ve.length;pe.write(ve,()=>{const de=Math.round(performance.now()-ie);de>50&&qe("switch_write_slow",{sessionId:O.current,writeMs:de,bytes:oe}),te()})},le=()=>{j.current!==null&&window.clearTimeout(j.current),j.current=window.setTimeout(re,V),W.current===null&&(W.current=window.setTimeout(re,Z))},se=l(pe=>{const ve=O.current;if(pe.type==="terminal-output"&&ve&&pe.sessionId===ve){const ie=H.current;ie&&(qe("switch_first_output",{sessionId:pe.sessionId,serverRoundtripMs:Math.round(performance.now()-ie),bytes:pe.data.length,parseMs:pe._parseMs??-1,rawLength:pe._rawLength??-1}),H.current=null),N.current+=y?BD(pe.data):pe.data,le()}if(pe.type==="terminal-ready"&&ve&&pe.sessionId===ve){const ie=H.current;ie&&(qe("switch_ready",{sessionId:pe.sessionId,totalMs:Math.round(performance.now()-ie)}),H.current=null),y&&(re(),U(50))}pe.type==="tmux-copy-mode-status"&&ve&&pe.sessionId===ve&&Y(pe.inCopyMode)});return()=>{se(),re(),G()}},[l,te,Y]),E.useEffect(()=>{const re=v.current,le=h.current,se=m.current;if(!re||!le||!se)return;const pe=()=>{S.current&&window.clearTimeout(S.current),S.current=window.setTimeout(()=>{fe()},150)},ve=new ResizeObserver(pe);return ve.observe(re),pe(),()=>{ve.disconnect(),S.current&&window.clearTimeout(S.current)}},[]),E.useEffect(()=>{if(!y)return;const re=()=>{document.visibilityState!=="hidden"&&U(200)},le=pe=>{pe.persisted&&U(200)},se=()=>{U(200)};return document.addEventListener("visibilitychange",re),window.addEventListener("pageshow",le),window.addEventListener("focus",se),()=>{document.removeEventListener("visibilitychange",re),window.removeEventListener("pageshow",le),window.removeEventListener("focus",se),G()}},[]),{containerRef:v,terminalRef:h,searchAddonRef:b,serializeAddonRef:x,progressAddonRef:C,inTmuxCopyModeRef:M,setTmuxCopyMode:Y}}function jD(e="(max-width: 767px)"){const[t,r]=E.useState(()=>typeof window>"u"||!window.matchMedia?!1:window.matchMedia(e).matches);return E.useEffect(()=>{if(typeof window>"u"||!window.matchMedia)return;const n=window.matchMedia(e),i=()=>r(n.matches);return i(),typeof n.addEventListener=="function"?(n.addEventListener("change",i),()=>n.removeEventListener("change",i)):(n.addListener(i),()=>n.removeListener(i))},[e]),t}function FD(e,t,r){E.useEffect(()=>{if(!t)return;const n=i=>{e.current&&!e.current.contains(i.target)&&r()};return document.addEventListener("mousedown",n),document.addEventListener("touchstart",n),()=>{document.removeEventListener("mousedown",n),document.removeEventListener("touchstart",n)}},[e,t,r])}function HD(e,t){E.useEffect(()=>{if(!e)return;const r=n=>{n.key==="Escape"&&(n.preventDefault(),t())};return document.addEventListener("keydown",r),()=>document.removeEventListener("keydown",r)},[e,t])}function $D({enabled:e,isOpen:t,onOpen:r,edgeThresholdPx:n=30,swipeDistancePx:i=50,swipeRatio:a=1.5}){const l=E.useRef(!1);return E.useEffect(()=>{if(!e)return;let s=0,o=0,c=!1;const f=p=>{if(t)return;const _=p.touches[0];_.clientX<=n?(s=_.clientX,o=_.clientY,c=!0,l.current=!0):c=!1},u=p=>{if(l.current=!1,!c||t)return;const _=p.changedTouches[0],y=_.clientX-s,v=Math.abs(_.clientY-o);y>=i&&y>v*a&&r(),c=!1};return document.addEventListener("touchstart",f,{passive:!0}),document.addEventListener("touchend",u,{passive:!0}),()=>{l.current=!1,document.removeEventListener("touchstart",f),document.removeEventListener("touchend",u)}},[e,t,r,n,i,a]),l}const ql=df()(ff(e=>({theme:"dark",setTheme:t=>e({theme:t}),toggleTheme:()=>e(t=>({theme:t.theme==="dark"?"light":"dark"}))}),{name:"agentboard-theme",storage:gc(()=>lo)})),zD={dark:{background:"#2d2d2d",foreground:"#d4d4d4",cursor:"#3b82f6",cursorAccent:"#2d2d2d",selectionBackground:"rgba(59, 130, 246, 0.35)",selectionForeground:"#ffffff",black:"#808080",red:"#f87171",green:"#4ade80",yellow:"#fbbf24",blue:"#60a5fa",magenta:"#c084fc",cyan:"#22d3ee",white:"#d4d4d4",brightBlack:"#a0a0a0",brightRed:"#fca5a5",brightGreen:"#86efac",brightYellow:"#fde047",brightBlue:"#93c5fd",brightMagenta:"#d8b4fe",brightCyan:"#67e8f9",brightWhite:"#ffffff"},light:{background:"#fafafa",foreground:"#171717",cursor:"#2563eb",cursorAccent:"#fafafa",selectionBackground:"rgba(37, 99, 235, 0.2)",selectionForeground:"#000000",black:"#171717",red:"#dc2626",green:"#16a34a",yellow:"#ca8a04",blue:"#2563eb",magenta:"#9333ea",cyan:"#0891b2",white:"#f5f5f5",brightBlack:"#737373",brightRed:"#ef4444",brightGreen:"#22c55e",brightYellow:"#eab308",brightBlue:"#3b82f6",brightMagenta:"#a855f7",brightCyan:"#06b6d4",brightWhite:"#ffffff"}},UD={up:"\x1B[A",down:"\x1B[B",left:"\x1B[D",right:"\x1B[C"},WD=150,VD=250,KD=400,xv=1500,GD=15,Qi=70;function Su(e=10){"vibrate"in navigator&&navigator.vibrate(e)}function qD(e,t){const r=Math.sqrt(e*e+t*t);if(r<GD)return{direction:null,distance:0};const n=Math.atan2(t,e)*(180/Math.PI);let i;return n>=-45&&n<45?i="right":n>=45&&n<135?i="down":n>=-135&&n<-45?i="up":i="left",{direction:i,distance:r}}function XD(e){const t=Qi-20,r=Math.min(e/t,1);return xv-r*(xv-KD)}function YD({onSendKey:e,disabled:t=!1,onRefocus:r,isKeyboardVisible:n}){const[i,a]=E.useState(!1),[l,s]=E.useState(null),[o,c]=E.useState({x:0,y:0}),[f,u]=E.useState({x:0,y:0}),p=E.useRef(null),_=E.useRef(null),y=E.useRef(null),v=E.useRef(!1),h=E.useRef(null),m=E.useRef(0),d=E.useCallback(()=>{p.current&&(clearTimeout(p.current),p.current=null),_.current&&(clearTimeout(_.current),_.current=null),y.current&&(clearInterval(y.current),y.current=null)},[]),g=E.useCallback(()=>{_.current&&(clearTimeout(_.current),_.current=null),y.current&&(clearInterval(y.current),y.current=null)},[]),w=E.useCallback(D=>{const O=XD(m.current);y.current=setTimeout(()=>{h.current&&(Su(5),e(D),w(D))},O)},[e]),b=E.useCallback((D,O)=>{if(!D||t)return;const z=UD[D];m.current=O,Su(8),e(z),g(),_.current=setTimeout(()=>{w(z)},VD)},[t,e,g,w]),x=E.useCallback((D,O)=>{const z=D-o.x,F=O-o.y,H=Math.sqrt(z*z+F*F),I=Math.min(H,Qi-20),R=H>0?I/H:0;u({x:z*R,y:F*R});const{direction:P,distance:N}=qD(z,F);m.current=N,P!==h.current&&(h.current=P,s(P),g(),P&&b(P,N))},[o,g,b]),C=E.useCallback(()=>{a(!1),s(null),u({x:0,y:0}),g(),h.current=null,v.current&&(r==null||r())},[g,r]),S=E.useCallback(D=>{if(t)return;D.preventDefault(),D.stopPropagation();const O=D.touches[0];v.current=(n==null?void 0:n())??!1,p.current=setTimeout(()=>{Su(15),c({x:O.clientX,y:O.clientY-80}),u({x:0,y:0}),a(!0)},WD)},[t,n]),k=E.useCallback(D=>{if(D.preventDefault(),D.stopPropagation(),!i)return;const O=D.touches[0];x(O.clientX,O.clientY)},[i,x]),L=E.useCallback(D=>{D.preventDefault(),D.stopPropagation(),p.current&&(clearTimeout(p.current),p.current=null),i&&C()},[i,C]),A=E.useCallback(D=>{D.preventDefault(),d(),C()},[d,C]);E.useEffect(()=>()=>{d()},[d]);const M=[{dir:"up",angle:-90,label:"↑"},{dir:"right",angle:0,label:"→"},{dir:"down",angle:90,label:"↓"},{dir:"left",angle:180,label:"←"}];return T.jsxs(T.Fragment,{children:[T.jsx("button",{type:"button","aria-label":"Arrow keys",className:`
|
|
187
|
+
`,Te=document.createElement("div"),be.appendChild(Te),je=document.createElement("div"),je.style.color="var(--text-muted)",je.style.marginTop="2px",je.style.fontSize="11px",be.appendChild(je),w.current=be);const He=(re,le)=>{if(!ve.element||!be||!Te||!je)return;const we=wu(le);if(!we)return;const De=ve.element.getBoundingClientRect(),$e=we.length>60?we.slice(0,57)+"...":we;Te.textContent=$e,je.textContent=`${Na()?"⌘":"Ctrl"}+click to open`,be.style.left=`${re.clientX-De.left+10}px`,be.style.top=`${re.clientY-De.top+10}px`,be.style.display="block"},Pe=()=>{be&&(be.style.display="none")};let Oe=null,ke=!1,Le=null;const Qe={activate:(re,le)=>{if(!ke&&(re.metaKey||re.ctrlKey)){const we=wu(le);if(!we)return;window.open(we,"_blank","noopener")}},hover:(re,le)=>{Oe=wu(le)||null,He(re,le)},leave:()=>{Oe=null,Pe()}},J=re=>{Oe&&(re.metaKey||re.ctrlKey)&&(re.preventDefault(),re.stopPropagation(),ke=!0,window.open(Oe,"_blank","noopener"),Le&&clearTimeout(Le),Le=setTimeout(()=>{ke=!1},100))};ne.addEventListener("mousedown",J,!0),ve.options.linkHandler=Qe;const ee=new oD((re,le)=>Qe.activate(re,le),{urlRegex:TD,hover:(re,le)=>Qe.hover(re,le),leave:()=>Qe.leave()});ve.loadAddon(ee),g.current=ee;let Be=null,q=null;const de=Na()?"metaKey":"ctrlKey";ve.attachCustomKeyEventHandler(re=>{if((re.ctrlKey||re.metaKey)&&re.key.toLowerCase()==="c"&&ve.hasSelection()){const le=ve.getSelection();return le!=null&&le.trim()&&navigator.clipboard&&navigator.clipboard.writeText(le),!1}if(Na()&&!y&&re.ctrlKey&&!re.metaKey&&re.key.toLowerCase()==="v"&&re.type==="keydown")return O.current&&(M.current&&(I.current({type:"tmux-cancel-copy-mode",sessionId:O.current}),Y(!1)),I.current({type:"terminal-input",sessionId:O.current,data:MD})),!O.current;if(re[de]&&re.key.toLowerCase()==="v"&&re.type==="keydown"){q!==null&&(clearTimeout(q),q=null),Be=null;const le=new Promise(we=>{q=setTimeout(()=>{q=null,Be=null,we(null)},100),Be=De=>{q!==null&&(clearTimeout(q),q=null),we(De)}});return(async()=>{try{const we=O.current;if(!we)return;let De=await le;if(De==null)try{De=await navigator.clipboard.readText()}catch{De=""}if(!De&&Na()&&!y)try{const $e=await fetch("/api/clipboard-file-path");if($e.ok){const{path:Ue}=await $e.json();if(Ue){I.current({type:"terminal-input",sessionId:we,data:Ue});return}}}catch{}De&&ve.paste(De)}finally{Be=null}})(),!1}if(re.ctrlKey&&re.key==="Backspace"&&re.type==="keydown"){const le=O.current;return le&&I.current({type:"terminal-input",sessionId:le,data:""}),!1}return!0});const X=re=>{var De;if(!Be)return;re.preventDefault(),re.stopPropagation();const le=((De=re.clipboardData)==null?void 0:De.getData("text/plain"))??"",we=Be;Be=null,we(le)};return ne.addEventListener("paste",X,{capture:!0}),ve.onData(re=>{const le=O.current;if(le){const we=/^\x1b\[(<[\d;]+[Mm]|[\d;]+M|M[\x20-\xff]{3})$/.test(re);if(M.current&&we)return;M.current&&(I.current({type:"tmux-cancel-copy-mode",sessionId:le}),Y(!1)),I.current({type:"terminal-input",sessionId:le,data:re})}}),ve.attachCustomWheelEventHandler(re=>{const le=O.current;if(!le)return!0;const we=re.target;if(we!=null&&we.closest('input, textarea, [contenteditable="true"], .xterm-hover')||ve.hasSelection()||re.shiftKey)return!0;const De=30;A.current+=re.deltaY;const $e=ve.cols,Ue=ve.rows,Ie=Math.floor($e/2),Me=Math.floor(Ue/2);let et=!1,ze=!1;for(;Math.abs(A.current)>=De;){ze=!0;const Re=A.current>0;A.current+=Re?-De:De;const Ae=Re?65:64;Re||(et=!0),I.current({type:"terminal-input",sessionId:le,data:`\x1B[<${Ae};${Ie};${Me}M`})}return et&&Y(!0),ze&&ye(),!1}),h.current=ve,m.current=se,()=>{if(oe=!0,Le&&clearTimeout(Le),Oe=null,ne.removeEventListener("mousedown",J,!0),ne.removeEventListener("paste",X,!0),q!==null&&(clearTimeout(q),q=null),Be=null,w.current&&(w.current.remove(),w.current=null),g.current){try{g.current.dispose()}catch{}g.current=null}if(d.current){try{d.current.dispose()}catch{}d.current=null}try{ve.dispose()}catch{}ne&&(ne.innerHTML=""),h.current=null,m.current=null,b.current=null,x.current=null,C.current=null,L.current&&window.clearTimeout(L.current),D.current!==null&&window.clearTimeout(D.current)}},[pe]),E.useEffect(()=>{h.current&&(h.current.options.theme=s)},[s]),E.useEffect(()=>{const ne=h.current,oe=m.current;if(ne&&oe){ne.options.fontFamily=u,ne.options.fontSize=o,ne.options.lineHeight=Math.round(o*c)/o,ne.options.letterSpacing=f,oe.fit();const ce=O.current;ce&&I.current({type:"terminal-resize",sessionId:ce,cols:ne.cols,rows:ne.rows})}},[o,c,f,u]),E.useEffect(()=>{const ne=h.current;if(!ne)return;const oe=P.current;if(P.current=p,oe!==p){if(p){if(!d.current)try{const ce=new fv.WebglAddon;ce.onContextLoss(()=>{try{ce.dispose()}catch{}d.current=null}),ne.loadAddon(ce),d.current=ce}catch{}}else if(d.current){try{d.current.dispose()}catch{}d.current=null}}},[p]),E.useEffect(()=>{const ne=h.current;if(!ne)return;const oe=O.current,ce=z.current;if(!r){oe&&(I.current({type:"terminal-detach",sessionId:oe}),O.current=null,z.current=null,F.current=-1,M.current=!1),ne.reset();return}if(n!=="connected"){oe&&(Ge("terminal_detach_on_disconnect",{connectionStatus:n,prevAttached:oe}),O.current=null,z.current=null,F.current=-1,M.current=!1);return}oe&&oe!==e&&(I.current({type:"terminal-detach",sessionId:oe}),O.current=null,z.current=null,F.current=-1,M.current=!1);const ue=F.current,ve=i!==ue;if(e&&(e!==oe||t!==ce||ve)){Ge("terminal_attach",{sessionId:e,tmuxTarget:t,prevAttached:oe,prevTarget:ce,connectionStatus:n,connectionEpoch:i,attachedEpoch:ue});const se=performance.now();ne.reset();const ae=performance.now(),fe=m.current;fe&&fe.fit();const ie=performance.now();I.current({type:"terminal-attach",sessionId:e,tmuxTarget:t??void 0,cols:ne.cols,rows:ne.rows}),O.current=e,z.current=t??null,F.current=i,I.current({type:"tmux-check-copy-mode",sessionId:e}),Ge("switch_attach_sent",{sessionId:e,resetMs:Math.round(ae-se),fitMs:Math.round(ie-ae),totalMs:Math.round(performance.now()-se),from:oe??null}),H.current=se,k.current&&window.clearTimeout(k.current),k.current=window.setTimeout(()=>{ne.scrollToBottom(),te(),ne.focus()},300)}e&&e===oe&&t===ce&&!ve&&Ge("terminal_attach_skip",{sessionId:e,prevAttached:oe,connectionStatus:n,connectionEpoch:i,attachedEpoch:ue}),!e&&oe&&(O.current=null,z.current=null,F.current=-1)},[e,t,r,n,i,te]),E.useEffect(()=>{const ne=()=>{j.current!==null&&(window.clearTimeout(j.current),j.current=null),W.current!==null&&(window.clearTimeout(W.current),W.current=null);const ue=h.current,ve=N.current;if(!ue||!ve)return;N.current="";const se=performance.now(),ae=ve.length;ue.write(ve,()=>{const fe=Math.round(performance.now()-se);fe>50&&Ge("switch_write_slow",{sessionId:O.current,writeMs:fe,bytes:ae}),te()})},oe=()=>{j.current!==null&&window.clearTimeout(j.current),j.current=window.setTimeout(ne,V),W.current===null&&(W.current=window.setTimeout(ne,Z))},ce=l(ue=>{const ve=O.current;if(ue.type==="terminal-output"&&ve&&ue.sessionId===ve){const se=H.current;se&&(Ge("switch_first_output",{sessionId:ue.sessionId,serverRoundtripMs:Math.round(performance.now()-se),bytes:ue.data.length,parseMs:ue._parseMs??-1,rawLength:ue._rawLength??-1}),H.current=null),N.current+=y?BD(ue.data):ue.data,oe()}if(ue.type==="terminal-ready"&&ve&&ue.sessionId===ve){const se=H.current;se&&(Ge("switch_ready",{sessionId:ue.sessionId,totalMs:Math.round(performance.now()-se)}),H.current=null),y&&(ne(),U(50))}ue.type==="tmux-copy-mode-status"&&ve&&ue.sessionId===ve&&Y(ue.inCopyMode)});return()=>{ce(),ne(),K()}},[l,te,Y]),E.useEffect(()=>{const ne=v.current,oe=h.current,ce=m.current;if(!ne||!oe||!ce)return;const ue=()=>{S.current&&window.clearTimeout(S.current),S.current=window.setTimeout(()=>{pe()},150)},ve=new ResizeObserver(ue);return ve.observe(ne),ue(),()=>{ve.disconnect(),S.current&&window.clearTimeout(S.current)}},[]),E.useEffect(()=>{if(!y)return;const ne=()=>{document.visibilityState!=="hidden"&&U(200)},oe=ue=>{ue.persisted&&U(200)},ce=()=>{U(200)};return document.addEventListener("visibilitychange",ne),window.addEventListener("pageshow",oe),window.addEventListener("focus",ce),()=>{document.removeEventListener("visibilitychange",ne),window.removeEventListener("pageshow",oe),window.removeEventListener("focus",ce),K()}},[]),{containerRef:v,terminalRef:h,searchAddonRef:b,serializeAddonRef:x,progressAddonRef:C,inTmuxCopyModeRef:M,setTmuxCopyMode:Y}}function jD(e="(max-width: 767px)"){const[t,r]=E.useState(()=>typeof window>"u"||!window.matchMedia?!1:window.matchMedia(e).matches);return E.useEffect(()=>{if(typeof window>"u"||!window.matchMedia)return;const n=window.matchMedia(e),i=()=>r(n.matches);return i(),typeof n.addEventListener=="function"?(n.addEventListener("change",i),()=>n.removeEventListener("change",i)):(n.addListener(i),()=>n.removeListener(i))},[e]),t}function FD(e,t,r){E.useEffect(()=>{if(!t)return;const n=i=>{e.current&&!e.current.contains(i.target)&&r()};return document.addEventListener("mousedown",n),document.addEventListener("touchstart",n),()=>{document.removeEventListener("mousedown",n),document.removeEventListener("touchstart",n)}},[e,t,r])}function HD(e,t){E.useEffect(()=>{if(!e)return;const r=n=>{n.key==="Escape"&&(n.preventDefault(),t())};return document.addEventListener("keydown",r),()=>document.removeEventListener("keydown",r)},[e,t])}function $D({enabled:e,isOpen:t,onOpen:r,edgeThresholdPx:n=30,swipeDistancePx:i=50,swipeRatio:a=1.5}){const l=E.useRef(!1);return E.useEffect(()=>{if(!e)return;let s=0,o=0,c=!1;const f=p=>{if(t)return;const _=p.touches[0];_.clientX<=n?(s=_.clientX,o=_.clientY,c=!0,l.current=!0):c=!1},u=p=>{if(l.current=!1,!c||t)return;const _=p.changedTouches[0],y=_.clientX-s,v=Math.abs(_.clientY-o);y>=i&&y>v*a&&r(),c=!1};return document.addEventListener("touchstart",f,{passive:!0}),document.addEventListener("touchend",u,{passive:!0}),()=>{l.current=!1,document.removeEventListener("touchstart",f),document.removeEventListener("touchend",u)}},[e,t,r,n,i,a]),l}const ql=df()(ff(e=>({theme:"dark",setTheme:t=>e({theme:t}),toggleTheme:()=>e(t=>({theme:t.theme==="dark"?"light":"dark"}))}),{name:"agentboard-theme",storage:gc(()=>lo)})),zD={dark:{background:"#2d2d2d",foreground:"#d4d4d4",cursor:"#3b82f6",cursorAccent:"#2d2d2d",selectionBackground:"rgba(59, 130, 246, 0.35)",selectionForeground:"#ffffff",black:"#808080",red:"#f87171",green:"#4ade80",yellow:"#fbbf24",blue:"#60a5fa",magenta:"#c084fc",cyan:"#22d3ee",white:"#d4d4d4",brightBlack:"#a0a0a0",brightRed:"#fca5a5",brightGreen:"#86efac",brightYellow:"#fde047",brightBlue:"#93c5fd",brightMagenta:"#d8b4fe",brightCyan:"#67e8f9",brightWhite:"#ffffff"},light:{background:"#fafafa",foreground:"#171717",cursor:"#2563eb",cursorAccent:"#fafafa",selectionBackground:"rgba(37, 99, 235, 0.2)",selectionForeground:"#000000",black:"#171717",red:"#dc2626",green:"#16a34a",yellow:"#ca8a04",blue:"#2563eb",magenta:"#9333ea",cyan:"#0891b2",white:"#f5f5f5",brightBlack:"#737373",brightRed:"#ef4444",brightGreen:"#22c55e",brightYellow:"#eab308",brightBlue:"#3b82f6",brightMagenta:"#a855f7",brightCyan:"#06b6d4",brightWhite:"#ffffff"}},UD={up:"\x1B[A",down:"\x1B[B",left:"\x1B[D",right:"\x1B[C"},WD=150,VD=250,KD=400,xv=1500,GD=15,Qi=70;function Su(e=10){"vibrate"in navigator&&navigator.vibrate(e)}function qD(e,t){const r=Math.sqrt(e*e+t*t);if(r<GD)return{direction:null,distance:0};const n=Math.atan2(t,e)*(180/Math.PI);let i;return n>=-45&&n<45?i="right":n>=45&&n<135?i="down":n>=-135&&n<-45?i="up":i="left",{direction:i,distance:r}}function XD(e){const t=Qi-20,r=Math.min(e/t,1);return xv-r*(xv-KD)}function YD({onSendKey:e,disabled:t=!1,onRefocus:r,isKeyboardVisible:n}){const[i,a]=E.useState(!1),[l,s]=E.useState(null),[o,c]=E.useState({x:0,y:0}),[f,u]=E.useState({x:0,y:0}),p=E.useRef(null),_=E.useRef(null),y=E.useRef(null),v=E.useRef(!1),h=E.useRef(null),m=E.useRef(0),d=E.useCallback(()=>{p.current&&(clearTimeout(p.current),p.current=null),_.current&&(clearTimeout(_.current),_.current=null),y.current&&(clearInterval(y.current),y.current=null)},[]),g=E.useCallback(()=>{_.current&&(clearTimeout(_.current),_.current=null),y.current&&(clearInterval(y.current),y.current=null)},[]),w=E.useCallback(D=>{const O=XD(m.current);y.current=setTimeout(()=>{h.current&&(Su(5),e(D),w(D))},O)},[e]),b=E.useCallback((D,O)=>{if(!D||t)return;const z=UD[D];m.current=O,Su(8),e(z),g(),_.current=setTimeout(()=>{w(z)},VD)},[t,e,g,w]),x=E.useCallback((D,O)=>{const z=D-o.x,F=O-o.y,H=Math.sqrt(z*z+F*F),I=Math.min(H,Qi-20),R=H>0?I/H:0;u({x:z*R,y:F*R});const{direction:P,distance:N}=qD(z,F);m.current=N,P!==h.current&&(h.current=P,s(P),g(),P&&b(P,N))},[o,g,b]),C=E.useCallback(()=>{a(!1),s(null),u({x:0,y:0}),g(),h.current=null,v.current&&(r==null||r())},[g,r]),S=E.useCallback(D=>{if(t)return;D.preventDefault(),D.stopPropagation();const O=D.touches[0];v.current=(n==null?void 0:n())??!1,p.current=setTimeout(()=>{Su(15),c({x:O.clientX,y:O.clientY-80}),u({x:0,y:0}),a(!0)},WD)},[t,n]),k=E.useCallback(D=>{if(D.preventDefault(),D.stopPropagation(),!i)return;const O=D.touches[0];x(O.clientX,O.clientY)},[i,x]),L=E.useCallback(D=>{D.preventDefault(),D.stopPropagation(),p.current&&(clearTimeout(p.current),p.current=null),i&&C()},[i,C]),A=E.useCallback(D=>{D.preventDefault(),d(),C()},[d,C]);E.useEffect(()=>()=>{d()},[d]);const M=[{dir:"up",angle:-90,label:"↑"},{dir:"right",angle:0,label:"→"},{dir:"down",angle:90,label:"↓"},{dir:"left",angle:180,label:"←"}];return T.jsxs(T.Fragment,{children:[T.jsx("button",{type:"button","aria-label":"Arrow keys",className:`
|
|
188
188
|
terminal-key
|
|
189
189
|
flex items-center justify-center
|
|
190
190
|
h-11 min-w-[2.75rem] px-2.5
|
|
@@ -291,13 +291,13 @@ void main() {
|
|
|
291
291
|
select-none touch-manipulation
|
|
292
292
|
text-secondary
|
|
293
293
|
${t?"opacity-50":""}
|
|
294
|
-
`,onMouseDown:F=>F.preventDefault(),onTouchStart:O(M),onClick:z(M),disabled:t,children:nM})]}),c&&T.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/50",children:T.jsxs("div",{ref:d,className:"mx-4 w-full max-w-sm rounded-lg border border-border bg-elevated p-4 shadow-xl",children:[T.jsx("h3",{className:"text-base font-medium text-primary mb-1 text-balance",children:"Paste"}),T.jsx("p",{className:"text-xs text-muted mb-3 text-pretty",children:"Text or image (long-press → Paste)"}),_?T.jsx("div",{className:"w-full h-11 flex items-center justify-center bg-surface border border-border rounded-md text-secondary",children:"Uploading image..."}):T.jsx("input",{ref:m,type:"text",value:u,onChange:F=>p(F.target.value),onKeyDown:F=>{F.key==="Enter"?(F.preventDefault(),k()):F.key==="Escape"&&(F.preventDefault(),L())},placeholder:"Paste here...",className:"w-full h-11 px-3 text-[16px] bg-surface border border-border rounded-md text-primary placeholder:text-muted outline-none focus:border-accent",style:{fontSize:"16px"}}),T.jsxs("div",{className:"flex justify-end gap-2 mt-4",children:[T.jsx("button",{type:"button",onClick:L,className:"px-4 py-2 text-sm font-medium text-secondary bg-surface border border-border rounded-md active:scale-95 transition-transform",children:"Cancel"}),T.jsx("button",{type:"button",onClick:k,disabled:_,className:"px-4 py-2 text-sm font-medium bg-accent text-white rounded-md active:scale-95 transition-transform disabled:opacity-50",children:"Send"})]})]})})]})}function lM({isOpen:e,onClose:t,sessions:r,inactiveSessions:n=[],selectedSessionId:i,onSelect:a,onRename:l,onResume:s,onSetPinned:o,onNewSession:c,loading:f,error:u}){const p=$1(),_=E.useRef(null),y=E.useRef(null);E.useEffect(()=>{if(!e)return;const m=d=>{d.key==="Escape"&&(d.preventDefault(),t())};return document.addEventListener("keydown",m),()=>document.removeEventListener("keydown",m)},[e,t]),E.useEffect(()=>{var m;e?(y.current=document.activeElement,(m=_.current)==null||m.focus()):y.current&&(y.current.focus(),y.current=null)},[e]),E.useEffect(()=>{if(!e)return;const m=_.current;if(!m)return;const d=50,g=1.5;let w=0,b=0;const x=S=>{const k=S.touches[0];w=k.clientX,b=k.clientY},C=S=>{const k=S.changedTouches[0],L=w-k.clientX,A=Math.abs(k.clientY-b);L>=d&&L>A*g&&("vibrate"in navigator&&navigator.vibrate(10),t())};return m.addEventListener("touchstart",x,{passive:!0}),m.addEventListener("touchend",C,{passive:!0}),()=>{m.removeEventListener("touchstart",x),m.removeEventListener("touchend",C)}},[e,t]);const v=m=>{a(m),t()},h=p?{transition:"none"}:void 0;return T.jsxs(T.Fragment,{children:[T.jsx("div",{className:`session-drawer-backdrop ${e?"open":""}`,style:h,onClick:t,"aria-hidden":"true"}),T.jsxs("div",{ref:_,className:`session-drawer ${e?"open":""}`,style:h,role:"dialog","aria-modal":"true","aria-label":"Session list",tabIndex:-1,children:[T.jsx(fw,{sessions:r,inactiveSessions:n,selectedSessionId:i,onSelect:v,onRename:l,onResume:s,onSetPinned:o,loading:f,error:u}),T.jsx("div",{className:"shrink-0 border-t border-border px-2 pt-2",style:{paddingBottom:"max(0.5rem, env(safe-area-inset-bottom, 0.5rem))"},children:T.jsx("button",{onClick:()=>{c()!==!1&&t()},className:"btn btn-primary w-full py-2 text-sm",children:"New Session"})})]})]})}const cM={working:"Working",waiting:"Waiting",permission:"Needs Input",unknown:"Unknown"},uM={working:"text-working",waiting:"text-waiting",permission:"text-approval",unknown:"text-muted"},hM={working:"bg-green-500/35 text-white",waiting:"bg-blue-500/35 text-white",permission:"bg-amber-500/35 text-white",unknown:"bg-gray-500/35 text-white"},dM={working:"bg-working text-white",waiting:"bg-waiting text-white",permission:"bg-approval text-white",unknown:"bg-muted text-white"};function bv(){"vibrate"in navigator&&navigator.vibrate(10)}function fM({session:e,sessions:t,inactiveSessions:r=[],connectionStatus:n,connectionEpoch:i=0,sendMessage:a,subscribe:l,onClose:s,onSelectSession:o,onNewSession:c,onKillSession:f,onRenameSession:u,onResumeSession:p,onSetPinned:_,onOpenSettings:y,loading:v=!1,error:h=null}){const m=ql(X=>X.theme),d=zD[m],g=me(X=>X.useWebGL),w=me(X=>X.fontSize),b=me(X=>X.lineHeight),x=me(X=>X.letterSpacing),C=me(X=>X.fontOption),S=me(X=>X.customFontFamily),k=lC(C,S),L=me(X=>X.shortcutModifier),A=ii(ea(L)),M=Zo(),D=jD(),[O,z]=E.useState(!1),[F,H]=E.useState(!1),[I,R]=E.useState(!1),[P,N]=E.useState(!1),[j,W]=E.useState(!1),[V,Z]=E.useState(!1),[Q,$]=E.useState(""),B=E.useRef(!1),G=E.useRef(null),U=E.useRef(null),te=E.useRef(null),Y=E.useRef(null),_e=(e==null?void 0:e.remote)===!0,fe=Ke(X=>X.remoteAllowControl),re=Ke(X=>X.remoteAllowAttach),le=_e&&!re,se=!_e||fe&&(e==null?void 0:e.source)==="managed",{containerRef:pe,terminalRef:ve,inTmuxCopyModeRef:ie,setTmuxCopyMode:oe}=ND({sessionId:(e==null?void 0:e.id)??null,tmuxTarget:(e==null?void 0:e.tmuxWindow)??null,allowAttach:!le,connectionStatus:n,connectionEpoch:i,sendMessage:a,subscribe:l,theme:d,fontSize:w,lineHeight:b,letterSpacing:x,fontFamily:k,useWebGL:g,onScrollChange:X=>{z(!X)}}),de=E.useCallback(()=>{var X;!e||le||(a({type:"tmux-cancel-copy-mode",sessionId:e.id}),oe(!1),(X=ve.current)==null||X.scrollToBottom())},[e,le,a,oe,ve]),ae=E.useCallback(()=>{W(!0),bv()},[]),ge=$D({enabled:D||M,isOpen:j,onOpen:ae});E.useEffect(()=>{!D&&!M&&j&&W(!1)},[j,D,M]);const Ee=E.useCallback(()=>N(!1),[]);FD(U,P,Ee),E.useEffect(()=>{V&&te.current&&(te.current.focus(),te.current.select())},[V]),E.useEffect(()=>{I&&Y.current&&Y.current.focus()},[I]);const Le=E.useCallback(()=>R(!1),[]);HD(I,Le);const He=()=>{e&&(f(e.id),R(!1))},je=()=>{e&&($(e.agentSessionName||e.name),Z(!0),N(!1))},Pe=()=>{if(!e)return;const X=Q.trim(),ye=e.agentSessionName||e.name;X&&X!==ye&&u(e.id,X),Z(!1)},Oe=X=>{X.key==="Enter"?(X.preventDefault(),Pe()):X.key==="Escape"&&(X.preventDefault(),Z(!1))};E.useEffect(()=>{if(!M||!e){H(!1);return}const X=pe.current;if(!X)return;const ye=Re=>{const Ae=X.querySelector(".xterm-accessibility-tree");if(!Ae)return!1;const Ve=Re.anchorNode,Ye=Re.focusNode;return!!Ve&&Ae.contains(Ve)||!!Ye&&Ae.contains(Ye)},ne=()=>{const Re=X.querySelector(".xterm-accessibility"),Ae=X.querySelector(".xterm-accessibility-tree");!Re||!Ae||(Re.style.setProperty("opacity","0"),Ae.style.setProperty("opacity","0"),Re.style.setProperty("-webkit-user-select","none"),Re.style.setProperty("user-select","none"),Ae.style.setProperty("-webkit-user-select","none"),Ae.style.setProperty("user-select","none"),Re.offsetHeight,requestAnimationFrame(()=>{Re.style.removeProperty("opacity"),Ae.style.removeProperty("opacity"),Re.style.removeProperty("-webkit-user-select"),Re.style.removeProperty("user-select"),Ae.style.removeProperty("-webkit-user-select"),Ae.style.removeProperty("user-select")}))},ue=()=>{var Ae;B.current=!1;const Re=window.getSelection();try{Re==null||Re.removeAllRanges()}catch{}(Ae=ve.current)==null||Ae.clearSelection(),ne(),H(!1)};G.current=ue;const ke=()=>{const Re=window.getSelection();if(!Re||Re.rangeCount===0||Re.isCollapsed){B.current?ue():H(Ye=>Ye&&!1);return}const Ae=ye(Re);if(!Ae&&B.current){ue();return}B.current=Ae;const Ve=Ae;H(Ye=>Ye!==Ve?Ve:Ye)},De=()=>{const Re=window.getSelection();!Re||Re.isCollapsed||ye(Re)&&setTimeout(ue,0)},ze=10;let We=null,Ie=!1;const Me=Re=>{if(Re.touches.length===1){const Ae=Re.touches[0];We={x:Ae.clientX,y:Ae.clientY},Ie=!1}},et=Re=>{if(Ie||!We||Re.touches.length!==1)return;const Ae=Re.touches[0],Ve=Math.abs(Ae.clientX-We.x),Ye=Math.abs(Ae.clientY-We.y);(Ve>ze||Ye>ze)&&(Ie=!0)},Ue=Re=>{const Ae=Ie;We=null,Ie=!1;const Ve=window.getSelection();if(!Ve||Ve.rangeCount===0||Ve.isCollapsed){H(!1);return}const Ye=X.querySelector(".xterm-accessibility-tree");if(!Ye)return;if(!ye(Ve)){H(!1);return}if(Ae)return;const $t=Re.target,_t=$t?Ye.contains($t):!1;let zt=!1;if(_t&&$t)try{zt=Ve.containsNode($t,!0)}catch{zt=!1}(!_t||!zt)&&setTimeout(ue,0)};return document.addEventListener("selectionchange",ke),document.addEventListener("copy",De),document.addEventListener("touchstart",Me,{passive:!0}),document.addEventListener("touchmove",et,{passive:!0}),document.addEventListener("touchend",Ue,{passive:!0}),()=>{document.removeEventListener("selectionchange",ke),document.removeEventListener("copy",De),document.removeEventListener("touchstart",Me),document.removeEventListener("touchmove",et),document.removeEventListener("touchend",Ue),G.current=null,B.current=!1}},[pe,M,e==null?void 0:e.id]),E.useEffect(()=>{var We;if(!M)return;const X=pe.current;if(!X)return;const ye=()=>{const Ie=ve.current,Me=X.querySelector(".xterm");if(!Ie||!Me)return;const et=Me.querySelector(".xterm-screen"),Ue=Me.querySelector(".xterm-accessibility"),Re=Me.querySelector(".xterm-accessibility-tree");if(!et||!Ue||!Re)return;const Ae=Me.getBoundingClientRect(),Ve=et.getBoundingClientRect(),Ye=Ve.left-Ae.left,$t=Ve.top-Ae.top;Object.assign(Ue.style,{left:`${Ye}px`,top:`${$t}px`,right:"auto",bottom:"auto",width:`${Ve.width}px`,height:`${Ve.height}px`});const _t=Ve.width/Ie.cols,zt=Ve.height/Ie.rows,It=document.createElement("span");It.textContent="0".repeat(200),It.style.cssText="position:absolute;visibility:hidden;white-space:pre;pointer-events:none;letter-spacing:0px",Re.appendChild(It);const wn=It.getBoundingClientRect().width/200;It.remove();const Ts=Math.max(-2,Math.min(2,_t-wn));X.style.setProperty("--xterm-font-size",`${Ie.options.fontSize}px`),X.style.setProperty("--xterm-cell-height",`${zt}px`),X.style.setProperty("--xterm-a11y-letter-spacing",`${Ts}px`)},ne=performance.now();ye();const ue=Math.round(performance.now()-ne);ue>10&&qe("switch_a11y_overlay",{sessionId:e==null?void 0:e.id,a11yMs:ue});const ke=window.requestAnimationFrame(ye),De=window.setTimeout(ye,100),ze=()=>window.requestAnimationFrame(ye);return(We=window.visualViewport)==null||We.addEventListener("resize",ze),window.addEventListener("orientationchange",ze),()=>{var Ie;window.cancelAnimationFrame(ke),window.clearTimeout(De),(Ie=window.visualViewport)==null||Ie.removeEventListener("resize",ze),window.removeEventListener("orientationchange",ze)}},[pe,w,M,e==null?void 0:e.id,ve]);const Ce=E.useRef(F);E.useEffect(()=>{Ce.current=F},[F]);const Te=E.useRef(e==null?void 0:e.id);E.useEffect(()=>{Te.current=e==null?void 0:e.id},[e==null?void 0:e.id]);const J=E.useRef(a);E.useEffect(()=>{J.current=a},[a]);const ee=E.useRef(!1);E.useEffect(()=>{const X=pe.current;if(!X||!(e!=null&&e.id)||!D&&!M)return;const ye=6,ne=350;let ue={x:0,y:0},ke=0,De=!1,ze=null,We=0,Ie=0,Me=0,et=Math.round(w*b),Ue=null;const Re=()=>{const Et=window.getComputedStyle(X).getPropertyValue("--xterm-cell-height").trim(),kt=Number.parseFloat(Et);return!Number.isNaN(kt)&&kt>0?kt:Math.round(w*b)},Ae=()=>X.querySelector(".xterm-helper-textarea"),Ve=()=>{const Be=Ae();Be&&document.activeElement!==Be&&(Be.disabled=!0)},Ye=()=>{const Be=Ae();Be&&(Be.disabled=!1)};Ve();const $t=()=>{if(ie.current)return;const Be=Ae();Be&&(Be.disabled=!1,Be.focus())},_t=()=>{Ue!==null&&(cancelAnimationFrame(Ue),Ue=null),Ie=0},zt=Be=>{const Et=Te.current;if(!Et||Be===0)return!1;const kt=ve.current,Zr=(kt==null?void 0:kt.cols)??80,Ds=(kt==null?void 0:kt.rows)??24,Ms=Math.floor(Zr/2),Jn=Math.floor(Ds/2),Qn=Be>0?65:64,Zn=Math.abs(Be),Sn=Be<0;for(let en=0;en<Zn;en++)J.current({type:"terminal-input",sessionId:Et,data:`\x1B[<${Qn};${Ms};${Jn}M`});return Sn&&oe(!0),Sn},It=()=>{ze=null,Ie=0,Me=0},wn=()=>{if(!M)return!1;const Be=window.getSelection();if(!Be||Be.isCollapsed)return!1;const Et=X.querySelector(".xterm-accessibility-tree");if(!Et)return!1;const kt=Be.anchorNode,Zr=Be.focusNode;return!!kt&&Et.contains(kt)||!!Zr&&Et.contains(Zr)},Ts=()=>{var Be;!M||!B.current||wn()||(Be=G.current)==null||Be.call(G)},ca=Be=>{if(_t(),Ts(),ge.current||j){It();return}if(Ce.current){It();return}if(Be.touches.length===1){const Et=Be.touches[0];ue={x:Et.clientX,y:Et.clientY},ke=performance.now(),De=!1,ze=Et.clientY,We=ke,Ie=0,Me=0,et=Re(),Ye()}},q=Be=>{if(Be.touches.length!==1||ze===null)return;if(Ts(),ge.current||j){It();return}if(Ce.current||wn()){It();return}Be.preventDefault(),Be.stopPropagation();const Et=performance.now(),kt=Be.touches[0],Zr=kt.clientX,Ds=kt.clientY,Ms=Math.abs(Zr-ue.x),Jn=Math.abs(Ds-ue.y);!De&&(Ms>ye||Jn>ye)&&(De=!0,Ve());const Qn=ze-Ds,Zn=Et-We;if(ze=Ds,We=Et,Zn>0){const kc=Qn/Zn;Ie=Ie*.7+kc*.3}Me+=Qn;const Sn=Math.max(6,et*.6),en=Math.trunc(Me/Sn);en!==0&&(zt(en),Me-=en*Sn)},tt=Be=>{var Ms;const Et=Ie,kt=performance.now()-ke;if(It(),ge.current||j)return;const Zr=wn();if(Ce.current&&!Zr&&((Ms=G.current)==null||Ms.call(G)),Ce.current||Zr){ie.current&&(ee.current=!0);return}if(!De){if(M&&kt>=ne)return;if(ie.current){Be.preventDefault(),Be.stopPropagation(),ee.current=!0;return}$t();return}if(Math.abs(Et)>.12){let Jn=Et,Qn=performance.now();const Zn=()=>{const Sn=performance.now(),en=Sn-Qn;Qn=Sn;const kc=Jn*en;Me+=kc;const Ep=Math.max(6,et*.6),Lc=Math.trunc(Me/Ep);Lc!==0&&(zt(Lc),Me-=Lc*Ep),Jn*=Math.pow(.95,en/16.67),Math.abs(Jn)>.02?Ue=requestAnimationFrame(Zn):Ue=null};Ue=requestAnimationFrame(Zn)}},Jr=Be=>{ee.current&&(Be.preventDefault(),Be.stopPropagation(),ee.current=!1)},Qr={passive:!0,capture:!0},Rs={passive:!1,capture:!0},bp={passive:!1,capture:!0},Cp={capture:!0};return X.addEventListener("touchstart",ca,Qr),X.addEventListener("touchmove",q,Rs),X.addEventListener("touchend",tt,bp),X.addEventListener("mousedown",Jr,Cp),()=>{X.removeEventListener("touchstart",ca,Qr),X.removeEventListener("touchmove",q,Rs),X.removeEventListener("touchend",tt,bp),X.removeEventListener("mousedown",Jr,Cp);const Be=Ae();Be&&(Be.disabled=!1)}},[e==null?void 0:e.id,pe,ve,M,D,j,w,b]);const $e=E.useCallback(X=>{!e||le||a({type:"terminal-input",sessionId:e.id,data:X})},[e,le,a]),Ne=E.useCallback(()=>{const X=pe.current;if(!X)return;const ye=X.querySelector(".xterm-helper-textarea");ye&&(ye.removeAttribute("disabled"),ye.focus())},[pe]),K=E.useCallback(()=>{if(!e||le)return;ie.current&&(a({type:"tmux-cancel-copy-mode",sessionId:e.id}),oe(!1));const X=pe.current;if(!X)return;const ye=X.querySelector(".xterm-helper-textarea");ye&&(ye.removeAttribute("disabled"),ye.focus())},[e,le,a,pe,ie,oe]),he=E.useCallback(()=>{var De,ze;if(typeof document>"u")return!1;const X=pe.current;if(!X)return!1;const ye=X.querySelector(".xterm-helper-textarea");if(ye&&document.activeElement===ye)return!0;const ne=document.activeElement,ue=typeof HTMLInputElement<"u"&&ne instanceof HTMLInputElement,ke=typeof HTMLTextAreaElement<"u"&&ne instanceof HTMLTextAreaElement;return ue||ke||ne&&ne.isContentEditable?!1:!!((ze=(De=document.documentElement)==null?void 0:De.classList)!=null&&ze.contains("keyboard-visible"))},[pe]);return E.useEffect(()=>{if(!M)return;const X=pe.current;if(!X)return;const ye=X.querySelector(".xterm-accessibility"),ne=X.querySelector(".xterm-accessibility-tree");if(!ye||!ne)return;const ue=()=>{const ke=X.querySelector(".xterm-helper-textarea");(ke?document.activeElement===ke:!1)&&!Ce.current?(ye.style.pointerEvents="none",ne.style.pointerEvents="none"):(ye.style.removeProperty("pointer-events"),ne.style.removeProperty("pointer-events"))};return ue(),document.addEventListener("focusin",ue),document.addEventListener("focusout",ue),()=>{document.removeEventListener("focusin",ue),document.removeEventListener("focusout",ue)}},[pe,M,F]),T.jsxs("section",{className:`flex flex-1 flex-col bg-base terminal-mobile-overlay md:relative md:inset-auto ${M?"ios-native-term-selection":""}`,"data-testid":"terminal-panel",children:[T.jsxs("div",{className:`flex h-10 shrink-0 items-center justify-between border-b border-border bg-elevated px-3 ${e?"":"md:hidden"}`,children:[T.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[T.jsx("button",{onClick:()=>W(!0),className:"flex h-7 w-7 items-center justify-center rounded bg-surface border border-border text-secondary hover:bg-hover hover:text-primary active:scale-95 transition-all md:hidden shrink-0","aria-label":"Open session menu",children:T.jsx(RC,{width:16,height:16})}),e&&se&&T.jsx("button",{onClick:()=>R(!0),className:"hidden md:flex h-7 w-7 items-center justify-center rounded bg-danger/10 border border-danger/30 text-danger hover:bg-danger/20 active:scale-95 transition-all shrink-0",title:`Kill session (${A}X)`,"aria-label":"Kill session",children:T.jsx(Dh,{width:16,height:16})}),e?T.jsxs("div",{className:"flex items-baseline gap-3 min-w-0",children:[V?T.jsx("input",{ref:te,type:"text",value:Q,onChange:X=>$(X.target.value),onBlur:Pe,onKeyDown:Oe,className:"w-full max-w-[200px] rounded border border-border bg-surface px-2 py-0.5 text-sm font-medium text-primary outline-none focus:border-accent"}):T.jsx("span",{className:"text-sm font-medium text-primary truncate",children:e.agentSessionName||e.name}),T.jsx("span",{className:`text-xs shrink-0 ${uM[e.status]}`,children:cM[e.status]})]}):T.jsx("span",{className:"text-sm font-medium text-primary md:hidden",children:"Sessions"})]}),T.jsxs("div",{className:"flex items-center gap-1.5 shrink-0",children:[n!=="connected"&&T.jsx("span",{className:"text-xs text-approval",children:n}),T.jsx("button",{onClick:c,className:"flex h-7 w-7 items-center justify-center rounded bg-accent text-white hover:bg-accent/90 active:scale-95 transition-all md:hidden",title:`New session (${A}N)`,"aria-label":"New session",children:T.jsx(oy,{width:16,height:16})}),e&&se&&T.jsx("button",{onClick:()=>R(!0),className:"flex md:hidden h-7 w-7 items-center justify-center rounded bg-danger/10 border border-danger/30 text-danger hover:bg-danger/20 active:scale-95 transition-all",title:`Kill session (${A}X)`,"aria-label":"Kill session",children:T.jsx(Dh,{width:16,height:16})}),e&&T.jsxs("div",{className:"relative md:hidden",ref:U,children:[T.jsx("button",{onClick:()=>N(!P),className:"flex h-7 w-7 items-center justify-center rounded bg-surface border border-border text-secondary hover:bg-hover hover:text-primary active:scale-95 transition-all",title:"More options","aria-label":"More options",children:T.jsx(SC,{width:16,height:16})}),P&&T.jsxs("div",{className:"absolute right-0 top-full mt-1 z-20 min-w-[140px] rounded-md border border-border bg-elevated shadow-lg py-1",children:[se&&T.jsxs("button",{onClick:je,className:"w-full px-3 py-2 text-left text-sm text-secondary hover:bg-hover hover:text-primary flex items-center gap-2",children:[T.jsx(sy,{width:14,height:14}),"Rename"]}),T.jsxs("button",{onClick:()=>{y(),N(!1)},className:"w-full px-3 py-2 text-left text-sm text-secondary hover:bg-hover hover:text-primary flex items-center gap-2",children:[T.jsx(OC,{width:14,height:14}),"Settings"]})]})]})]})]}),e&&t.length>1&&T.jsxs("div",{className:"relative overflow-hidden bg-elevated border-b border-border md:hidden",children:[T.jsx("div",{className:"absolute right-0 top-0 bottom-0 w-4 bg-gradient-to-l from-elevated to-transparent z-10 pointer-events-none"}),T.jsx("div",{className:"flex items-center gap-1.5 pl-5 pr-3 py-1.5 overflow-x-auto scrollbar-none scroll-smooth snap-x snap-mandatory",style:{WebkitOverflowScrolling:"touch"},children:t.map((X,ye)=>{const ne=X.id===e.id;return T.jsx("button",{type:"button",className:`
|
|
294
|
+
`,onMouseDown:F=>F.preventDefault(),onTouchStart:O(M),onClick:z(M),disabled:t,children:nM})]}),c&&T.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/50",children:T.jsxs("div",{ref:d,className:"mx-4 w-full max-w-sm rounded-lg border border-border bg-elevated p-4 shadow-xl",children:[T.jsx("h3",{className:"text-base font-medium text-primary mb-1 text-balance",children:"Paste"}),T.jsx("p",{className:"text-xs text-muted mb-3 text-pretty",children:"Text or image (long-press → Paste)"}),_?T.jsx("div",{className:"w-full h-11 flex items-center justify-center bg-surface border border-border rounded-md text-secondary",children:"Uploading image..."}):T.jsx("input",{ref:m,type:"text",value:u,onChange:F=>p(F.target.value),onKeyDown:F=>{F.key==="Enter"?(F.preventDefault(),k()):F.key==="Escape"&&(F.preventDefault(),L())},placeholder:"Paste here...",className:"w-full h-11 px-3 text-[16px] bg-surface border border-border rounded-md text-primary placeholder:text-muted outline-none focus:border-accent",style:{fontSize:"16px"}}),T.jsxs("div",{className:"flex justify-end gap-2 mt-4",children:[T.jsx("button",{type:"button",onClick:L,className:"px-4 py-2 text-sm font-medium text-secondary bg-surface border border-border rounded-md active:scale-95 transition-transform",children:"Cancel"}),T.jsx("button",{type:"button",onClick:k,disabled:_,className:"px-4 py-2 text-sm font-medium bg-accent text-white rounded-md active:scale-95 transition-transform disabled:opacity-50",children:"Send"})]})]})})]})}function lM({isOpen:e,onClose:t,sessions:r,inactiveSessions:n=[],selectedSessionId:i,onSelect:a,onRename:l,onResume:s,onSetPinned:o,onNewSession:c,loading:f,error:u}){const p=$1(),_=E.useRef(null),y=E.useRef(null);E.useEffect(()=>{if(!e)return;const m=d=>{d.key==="Escape"&&(d.preventDefault(),t())};return document.addEventListener("keydown",m),()=>document.removeEventListener("keydown",m)},[e,t]),E.useEffect(()=>{var m;e?(y.current=document.activeElement,(m=_.current)==null||m.focus()):y.current&&(y.current.focus(),y.current=null)},[e]),E.useEffect(()=>{if(!e)return;const m=_.current;if(!m)return;const d=50,g=1.5;let w=0,b=0;const x=S=>{const k=S.touches[0];w=k.clientX,b=k.clientY},C=S=>{const k=S.changedTouches[0],L=w-k.clientX,A=Math.abs(k.clientY-b);L>=d&&L>A*g&&("vibrate"in navigator&&navigator.vibrate(10),t())};return m.addEventListener("touchstart",x,{passive:!0}),m.addEventListener("touchend",C,{passive:!0}),()=>{m.removeEventListener("touchstart",x),m.removeEventListener("touchend",C)}},[e,t]);const v=m=>{a(m),t()},h=p?{transition:"none"}:void 0;return T.jsxs(T.Fragment,{children:[T.jsx("div",{className:`session-drawer-backdrop ${e?"open":""}`,style:h,onClick:t,"aria-hidden":"true"}),T.jsxs("div",{ref:_,className:`session-drawer ${e?"open":""}`,style:h,role:"dialog","aria-modal":"true","aria-label":"Session list",tabIndex:-1,children:[T.jsx(fw,{sessions:r,inactiveSessions:n,selectedSessionId:i,onSelect:v,onRename:l,onResume:s,onSetPinned:o,loading:f,error:u}),T.jsx("div",{className:"shrink-0 border-t border-border px-2 pt-2",style:{paddingBottom:"max(0.5rem, env(safe-area-inset-bottom, 0.5rem))"},children:T.jsx("button",{onClick:()=>{c()!==!1&&t()},className:"btn btn-primary w-full py-2 text-sm",children:"New Session"})})]})]})}const cM={working:"Working",waiting:"Waiting",permission:"Needs Input",unknown:"Unknown"},uM={working:"text-working",waiting:"text-waiting",permission:"text-approval",unknown:"text-muted"},hM={working:"bg-green-500/35 text-white",waiting:"bg-blue-500/35 text-white",permission:"bg-amber-500/35 text-white",unknown:"bg-gray-500/35 text-white"},dM={working:"bg-working text-white",waiting:"bg-waiting text-white",permission:"bg-approval text-white",unknown:"bg-muted text-white"};function bv(){"vibrate"in navigator&&navigator.vibrate(10)}function fM({session:e,sessions:t,inactiveSessions:r=[],connectionStatus:n,connectionEpoch:i=0,sendMessage:a,subscribe:l,onClose:s,onSelectSession:o,onNewSession:c,onKillSession:f,onRenameSession:u,onResumeSession:p,onSetPinned:_,onOpenSettings:y,loading:v=!1,error:h=null}){const m=ql(X=>X.theme),d=zD[m],g=me(X=>X.useWebGL),w=me(X=>X.fontSize),b=me(X=>X.lineHeight),x=me(X=>X.letterSpacing),C=me(X=>X.fontOption),S=me(X=>X.customFontFamily),k=lC(C,S),L=me(X=>X.shortcutModifier),A=ii(ea(L)),M=Zo(),D=jD(),[O,z]=E.useState(!1),[F,H]=E.useState(!1),[I,R]=E.useState(!1),[P,N]=E.useState(!1),[j,W]=E.useState(!1),[V,Z]=E.useState(!1),[Q,$]=E.useState(""),B=E.useRef(!1),K=E.useRef(null),U=E.useRef(null),te=E.useRef(null),Y=E.useRef(null),ye=(e==null?void 0:e.remote)===!0,pe=Ve(X=>X.remoteAllowControl),ne=Ve(X=>X.remoteAllowAttach),oe=ye&&!ne,ce=!ye||pe&&(e==null?void 0:e.source)==="managed",{containerRef:ue,terminalRef:ve,inTmuxCopyModeRef:se,setTmuxCopyMode:ae}=ND({sessionId:(e==null?void 0:e.id)??null,tmuxTarget:(e==null?void 0:e.tmuxWindow)??null,allowAttach:!oe,connectionStatus:n,connectionEpoch:i,sendMessage:a,subscribe:l,theme:d,fontSize:w,lineHeight:b,letterSpacing:x,fontFamily:k,useWebGL:g,onScrollChange:X=>{z(!X)}}),fe=E.useCallback(()=>{var X;!e||oe||(a({type:"tmux-cancel-copy-mode",sessionId:e.id}),ae(!1),(X=ve.current)==null||X.scrollToBottom())},[e,oe,a,ae,ve]),ie=E.useCallback(()=>{W(!0),bv()},[]),ge=$D({enabled:D||M,isOpen:j,onOpen:ie});E.useEffect(()=>{!D&&!M&&j&&W(!1)},[j,D,M]);const be=E.useCallback(()=>N(!1),[]);FD(U,P,be),E.useEffect(()=>{V&&te.current&&(te.current.focus(),te.current.select())},[V]),E.useEffect(()=>{I&&Y.current&&Y.current.focus()},[I]);const Te=E.useCallback(()=>R(!1),[]);HD(I,Te);const je=()=>{e&&(f(e.id),R(!1))},He=()=>{e&&($(e.agentSessionName||e.name),Z(!0),N(!1))},Pe=()=>{if(!e)return;const X=Q.trim(),_e=e.agentSessionName||e.name;X&&X!==_e&&u(e.id,X),Z(!1)},Oe=X=>{X.key==="Enter"?(X.preventDefault(),Pe()):X.key==="Escape"&&(X.preventDefault(),Z(!1))};E.useEffect(()=>{if(!M||!e){H(!1);return}const X=ue.current;if(!X)return;const _e=Re=>{const Ae=X.querySelector(".xterm-accessibility-tree");if(!Ae)return!1;const We=Re.anchorNode,Xe=Re.focusNode;return!!We&&Ae.contains(We)||!!Xe&&Ae.contains(Xe)},re=()=>{const Re=X.querySelector(".xterm-accessibility"),Ae=X.querySelector(".xterm-accessibility-tree");!Re||!Ae||(Re.style.setProperty("opacity","0"),Ae.style.setProperty("opacity","0"),Re.style.setProperty("-webkit-user-select","none"),Re.style.setProperty("user-select","none"),Ae.style.setProperty("-webkit-user-select","none"),Ae.style.setProperty("user-select","none"),Re.offsetHeight,requestAnimationFrame(()=>{Re.style.removeProperty("opacity"),Ae.style.removeProperty("opacity"),Re.style.removeProperty("-webkit-user-select"),Re.style.removeProperty("user-select"),Ae.style.removeProperty("-webkit-user-select"),Ae.style.removeProperty("user-select")}))},le=()=>{var Ae;B.current=!1;const Re=window.getSelection();try{Re==null||Re.removeAllRanges()}catch{}(Ae=ve.current)==null||Ae.clearSelection(),re(),H(!1)};K.current=le;const we=()=>{const Re=window.getSelection();if(!Re||Re.rangeCount===0||Re.isCollapsed){B.current?le():H(Xe=>Xe&&!1);return}const Ae=_e(Re);if(!Ae&&B.current){le();return}B.current=Ae;const We=Ae;H(Xe=>Xe!==We?We:Xe)},De=()=>{const Re=window.getSelection();!Re||Re.isCollapsed||_e(Re)&&setTimeout(le,0)},$e=10;let Ue=null,Ie=!1;const Me=Re=>{if(Re.touches.length===1){const Ae=Re.touches[0];Ue={x:Ae.clientX,y:Ae.clientY},Ie=!1}},et=Re=>{if(Ie||!Ue||Re.touches.length!==1)return;const Ae=Re.touches[0],We=Math.abs(Ae.clientX-Ue.x),Xe=Math.abs(Ae.clientY-Ue.y);(We>$e||Xe>$e)&&(Ie=!0)},ze=Re=>{const Ae=Ie;Ue=null,Ie=!1;const We=window.getSelection();if(!We||We.rangeCount===0||We.isCollapsed){H(!1);return}const Xe=X.querySelector(".xterm-accessibility-tree");if(!Xe)return;if(!_e(We)){H(!1);return}if(Ae)return;const $t=Re.target,_t=$t?Xe.contains($t):!1;let zt=!1;if(_t&&$t)try{zt=We.containsNode($t,!0)}catch{zt=!1}(!_t||!zt)&&setTimeout(le,0)};return document.addEventListener("selectionchange",we),document.addEventListener("copy",De),document.addEventListener("touchstart",Me,{passive:!0}),document.addEventListener("touchmove",et,{passive:!0}),document.addEventListener("touchend",ze,{passive:!0}),()=>{document.removeEventListener("selectionchange",we),document.removeEventListener("copy",De),document.removeEventListener("touchstart",Me),document.removeEventListener("touchmove",et),document.removeEventListener("touchend",ze),K.current=null,B.current=!1}},[ue,M,e==null?void 0:e.id]),E.useEffect(()=>{var Ue;if(!M)return;const X=ue.current;if(!X)return;const _e=()=>{const Ie=ve.current,Me=X.querySelector(".xterm");if(!Ie||!Me)return;const et=Me.querySelector(".xterm-screen"),ze=Me.querySelector(".xterm-accessibility"),Re=Me.querySelector(".xterm-accessibility-tree");if(!et||!ze||!Re)return;const Ae=Me.getBoundingClientRect(),We=et.getBoundingClientRect(),Xe=We.left-Ae.left,$t=We.top-Ae.top;Object.assign(ze.style,{left:`${Xe}px`,top:`${$t}px`,right:"auto",bottom:"auto",width:`${We.width}px`,height:`${We.height}px`});const _t=We.width/Ie.cols,zt=We.height/Ie.rows,It=document.createElement("span");It.textContent="0".repeat(200),It.style.cssText="position:absolute;visibility:hidden;white-space:pre;pointer-events:none;letter-spacing:0px",Re.appendChild(It);const wn=It.getBoundingClientRect().width/200;It.remove();const Ts=Math.max(-2,Math.min(2,_t-wn));X.style.setProperty("--xterm-font-size",`${Ie.options.fontSize}px`),X.style.setProperty("--xterm-cell-height",`${zt}px`),X.style.setProperty("--xterm-a11y-letter-spacing",`${Ts}px`)},re=performance.now();_e();const le=Math.round(performance.now()-re);le>10&&Ge("switch_a11y_overlay",{sessionId:e==null?void 0:e.id,a11yMs:le});const we=window.requestAnimationFrame(_e),De=window.setTimeout(_e,100),$e=()=>window.requestAnimationFrame(_e);return(Ue=window.visualViewport)==null||Ue.addEventListener("resize",$e),window.addEventListener("orientationchange",$e),()=>{var Ie;window.cancelAnimationFrame(we),window.clearTimeout(De),(Ie=window.visualViewport)==null||Ie.removeEventListener("resize",$e),window.removeEventListener("orientationchange",$e)}},[ue,w,M,e==null?void 0:e.id,ve]);const ke=E.useRef(F);E.useEffect(()=>{ke.current=F},[F]);const Le=E.useRef(e==null?void 0:e.id);E.useEffect(()=>{Le.current=e==null?void 0:e.id},[e==null?void 0:e.id]);const Qe=E.useRef(a);E.useEffect(()=>{Qe.current=a},[a]);const J=E.useRef(!1);E.useEffect(()=>{const X=ue.current;if(!X||!(e!=null&&e.id)||!D&&!M)return;const _e=6,re=350;let le={x:0,y:0},we=0,De=!1,$e=null,Ue=0,Ie=0,Me=0,et=Math.round(w*b),ze=null;const Re=()=>{const Et=window.getComputedStyle(X).getPropertyValue("--xterm-cell-height").trim(),kt=Number.parseFloat(Et);return!Number.isNaN(kt)&&kt>0?kt:Math.round(w*b)},Ae=()=>X.querySelector(".xterm-helper-textarea"),We=()=>{const Ne=Ae();Ne&&document.activeElement!==Ne&&(Ne.disabled=!0)},Xe=()=>{const Ne=Ae();Ne&&(Ne.disabled=!1)};We();const $t=()=>{if(se.current)return;const Ne=Ae();Ne&&(Ne.disabled=!1,Ne.focus())},_t=()=>{ze!==null&&(cancelAnimationFrame(ze),ze=null),Ie=0},zt=Ne=>{const Et=Le.current;if(!Et||Ne===0)return!1;const kt=ve.current,en=(kt==null?void 0:kt.cols)??80,Ds=(kt==null?void 0:kt.rows)??24,Ms=Math.floor(en/2),Jn=Math.floor(Ds/2),Qn=Ne>0?65:64,Zn=Math.abs(Ne),Sn=Ne<0;for(let tn=0;tn<Zn;tn++)Qe.current({type:"terminal-input",sessionId:Et,data:`\x1B[<${Qn};${Ms};${Jn}M`});return Sn&&ae(!0),Sn},It=()=>{$e=null,Ie=0,Me=0},wn=()=>{if(!M)return!1;const Ne=window.getSelection();if(!Ne||Ne.isCollapsed)return!1;const Et=X.querySelector(".xterm-accessibility-tree");if(!Et)return!1;const kt=Ne.anchorNode,en=Ne.focusNode;return!!kt&&Et.contains(kt)||!!en&&Et.contains(en)},Ts=()=>{var Ne;!M||!B.current||wn()||(Ne=K.current)==null||Ne.call(K)},ca=Ne=>{if(_t(),Ts(),ge.current||j){It();return}if(ke.current){It();return}if(Ne.touches.length===1){const Et=Ne.touches[0];le={x:Et.clientX,y:Et.clientY},we=performance.now(),De=!1,$e=Et.clientY,Ue=we,Ie=0,Me=0,et=Re(),Xe()}},G=Ne=>{if(Ne.touches.length!==1||$e===null)return;if(Ts(),ge.current||j){It();return}if(ke.current||wn()){It();return}Ne.preventDefault(),Ne.stopPropagation();const Et=performance.now(),kt=Ne.touches[0],en=kt.clientX,Ds=kt.clientY,Ms=Math.abs(en-le.x),Jn=Math.abs(Ds-le.y);!De&&(Ms>_e||Jn>_e)&&(De=!0,We());const Qn=$e-Ds,Zn=Et-Ue;if($e=Ds,Ue=Et,Zn>0){const kc=Qn/Zn;Ie=Ie*.7+kc*.3}Me+=Qn;const Sn=Math.max(6,et*.6),tn=Math.trunc(Me/Sn);tn!==0&&(zt(tn),Me-=tn*Sn)},tt=Ne=>{var Ms;const Et=Ie,kt=performance.now()-we;if(It(),ge.current||j)return;const en=wn();if(ke.current&&!en&&((Ms=K.current)==null||Ms.call(K)),ke.current||en){se.current&&(J.current=!0);return}if(!De){if(M&&kt>=re)return;if(se.current){Ne.preventDefault(),Ne.stopPropagation(),J.current=!0;return}$t();return}if(Math.abs(Et)>.12){let Jn=Et,Qn=performance.now();const Zn=()=>{const Sn=performance.now(),tn=Sn-Qn;Qn=Sn;const kc=Jn*tn;Me+=kc;const Ep=Math.max(6,et*.6),Lc=Math.trunc(Me/Ep);Lc!==0&&(zt(Lc),Me-=Lc*Ep),Jn*=Math.pow(.95,tn/16.67),Math.abs(Jn)>.02?ze=requestAnimationFrame(Zn):ze=null};ze=requestAnimationFrame(Zn)}},Qr=Ne=>{J.current&&(Ne.preventDefault(),Ne.stopPropagation(),J.current=!1)},Zr={passive:!0,capture:!0},Rs={passive:!1,capture:!0},bp={passive:!1,capture:!0},Cp={capture:!0};return X.addEventListener("touchstart",ca,Zr),X.addEventListener("touchmove",G,Rs),X.addEventListener("touchend",tt,bp),X.addEventListener("mousedown",Qr,Cp),()=>{X.removeEventListener("touchstart",ca,Zr),X.removeEventListener("touchmove",G,Rs),X.removeEventListener("touchend",tt,bp),X.removeEventListener("mousedown",Qr,Cp);const Ne=Ae();Ne&&(Ne.disabled=!1)}},[e==null?void 0:e.id,ue,ve,M,D,j,w,b]);const ee=E.useCallback(X=>{!e||oe||a({type:"terminal-input",sessionId:e.id,data:X})},[e,oe,a]),Be=E.useCallback(()=>{const X=ue.current;if(!X)return;const _e=X.querySelector(".xterm-helper-textarea");_e&&(_e.removeAttribute("disabled"),_e.focus())},[ue]),q=E.useCallback(()=>{if(!e||oe)return;se.current&&(a({type:"tmux-cancel-copy-mode",sessionId:e.id}),ae(!1));const X=ue.current;if(!X)return;const _e=X.querySelector(".xterm-helper-textarea");_e&&(_e.removeAttribute("disabled"),_e.focus())},[e,oe,a,ue,se,ae]),de=E.useCallback(()=>{var De,$e;if(typeof document>"u")return!1;const X=ue.current;if(!X)return!1;const _e=X.querySelector(".xterm-helper-textarea");if(_e&&document.activeElement===_e)return!0;const re=document.activeElement,le=typeof HTMLInputElement<"u"&&re instanceof HTMLInputElement,we=typeof HTMLTextAreaElement<"u"&&re instanceof HTMLTextAreaElement;return le||we||re&&re.isContentEditable?!1:!!(($e=(De=document.documentElement)==null?void 0:De.classList)!=null&&$e.contains("keyboard-visible"))},[ue]);return E.useEffect(()=>{if(!M)return;const X=ue.current;if(!X)return;const _e=X.querySelector(".xterm-accessibility"),re=X.querySelector(".xterm-accessibility-tree");if(!_e||!re)return;const le=()=>{const we=X.querySelector(".xterm-helper-textarea");(we?document.activeElement===we:!1)&&!ke.current?(_e.style.pointerEvents="none",re.style.pointerEvents="none"):(_e.style.removeProperty("pointer-events"),re.style.removeProperty("pointer-events"))};return le(),document.addEventListener("focusin",le),document.addEventListener("focusout",le),()=>{document.removeEventListener("focusin",le),document.removeEventListener("focusout",le)}},[ue,M,F]),T.jsxs("section",{className:`flex flex-1 flex-col bg-base terminal-mobile-overlay md:relative md:inset-auto ${M?"ios-native-term-selection":""}`,"data-testid":"terminal-panel",children:[T.jsxs("div",{className:`flex h-10 shrink-0 items-center justify-between border-b border-border bg-elevated px-3 ${e?"":"md:hidden"}`,children:[T.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[T.jsx("button",{onClick:()=>W(!0),className:"flex h-7 w-7 items-center justify-center rounded bg-surface border border-border text-secondary hover:bg-hover hover:text-primary active:scale-95 transition-all md:hidden shrink-0","aria-label":"Open session menu",children:T.jsx(RC,{width:16,height:16})}),e&&ce&&T.jsx("button",{onClick:()=>R(!0),className:"hidden md:flex h-7 w-7 items-center justify-center rounded bg-danger/10 border border-danger/30 text-danger hover:bg-danger/20 active:scale-95 transition-all shrink-0",title:`Kill session (${A}X)`,"aria-label":"Kill session",children:T.jsx(Dh,{width:16,height:16})}),e?T.jsxs("div",{className:"flex items-baseline gap-3 min-w-0",children:[V?T.jsx("input",{ref:te,type:"text",value:Q,onChange:X=>$(X.target.value),onBlur:Pe,onKeyDown:Oe,className:"w-full max-w-[200px] rounded border border-border bg-surface px-2 py-0.5 text-sm font-medium text-primary outline-none focus:border-accent"}):T.jsx("span",{className:"text-sm font-medium text-primary truncate",children:e.agentSessionName||e.name}),T.jsx("span",{className:`text-xs shrink-0 ${uM[e.status]}`,children:cM[e.status]})]}):T.jsx("span",{className:"text-sm font-medium text-primary md:hidden",children:"Sessions"})]}),T.jsxs("div",{className:"flex items-center gap-1.5 shrink-0",children:[n!=="connected"&&T.jsx("span",{className:"text-xs text-approval",children:n}),T.jsx("button",{onClick:c,className:"flex h-7 w-7 items-center justify-center rounded bg-accent text-white hover:bg-accent/90 active:scale-95 transition-all md:hidden",title:`New session (${A}N)`,"aria-label":"New session",children:T.jsx(oy,{width:16,height:16})}),e&&ce&&T.jsx("button",{onClick:()=>R(!0),className:"flex md:hidden h-7 w-7 items-center justify-center rounded bg-danger/10 border border-danger/30 text-danger hover:bg-danger/20 active:scale-95 transition-all",title:`Kill session (${A}X)`,"aria-label":"Kill session",children:T.jsx(Dh,{width:16,height:16})}),e&&T.jsxs("div",{className:"relative md:hidden",ref:U,children:[T.jsx("button",{onClick:()=>N(!P),className:"flex h-7 w-7 items-center justify-center rounded bg-surface border border-border text-secondary hover:bg-hover hover:text-primary active:scale-95 transition-all",title:"More options","aria-label":"More options",children:T.jsx(SC,{width:16,height:16})}),P&&T.jsxs("div",{className:"absolute right-0 top-full mt-1 z-20 min-w-[140px] rounded-md border border-border bg-elevated shadow-lg py-1",children:[ce&&T.jsxs("button",{onClick:He,className:"w-full px-3 py-2 text-left text-sm text-secondary hover:bg-hover hover:text-primary flex items-center gap-2",children:[T.jsx(sy,{width:14,height:14}),"Rename"]}),T.jsxs("button",{onClick:()=>{y(),N(!1)},className:"w-full px-3 py-2 text-left text-sm text-secondary hover:bg-hover hover:text-primary flex items-center gap-2",children:[T.jsx(OC,{width:14,height:14}),"Settings"]})]})]})]})]}),e&&t.length>1&&T.jsxs("div",{className:"relative overflow-hidden bg-elevated border-b border-border md:hidden",children:[T.jsx("div",{className:"absolute right-0 top-0 bottom-0 w-4 bg-gradient-to-l from-elevated to-transparent z-10 pointer-events-none"}),T.jsx("div",{className:"flex items-center gap-1.5 pl-5 pr-3 py-1.5 overflow-x-auto scrollbar-none scroll-smooth snap-x snap-mandatory",style:{WebkitOverflowScrolling:"touch"},children:t.map((X,_e)=>{const re=X.id===e.id;return T.jsx("button",{type:"button",className:`
|
|
295
295
|
flex items-center justify-center shrink-0 snap-start
|
|
296
296
|
h-8 w-8 text-sm font-extrabold rounded-lg
|
|
297
297
|
active:scale-95 transition-all duration-75
|
|
298
298
|
select-none touch-manipulation
|
|
299
|
-
${
|
|
300
|
-
`,onClick:()=>{bv(),o(X.id)},children:ye+1},X.id)})})]}),T.jsxs("div",{className:"relative flex-1",children:[T.jsx("div",{ref:pe,className:"absolute inset-0"}),!e&&T.jsx("div",{className:"absolute inset-0 flex items-center justify-center text-sm text-muted",children:"Select a session to view terminal"}),e&&le&&T.jsx("div",{className:"absolute inset-0 flex items-center justify-center text-center text-sm text-muted",children:"Remote session (read-only). Use SSH to attach on the host."}),O&&e&&!F&&T.jsxs("button",{onClick:de,className:"absolute bottom-8 left-1/2 z-20 flex h-10 px-4 items-center justify-center gap-1.5 rounded-full bg-blue-600/90 text-white shadow-lg hover:bg-blue-600 active:scale-95 transition-all",style:{transform:"translateX(-50%)"},title:"Scroll to bottom","aria-label":"Scroll to bottom",children:[T.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:T.jsx("path",{d:"M12 5v14M5 12l7 7 7-7"})}),T.jsx("span",{className:"text-sm font-medium",children:"Jump to bottom"})]})]}),e&&T.jsx(aM,{onSendKey:$e,disabled:n!=="connected"||le,sessions:t.map(X=>({id:X.id,name:X.name,status:X.status})),currentSessionId:e.id,onSelectSession:o,hideSessionSwitcher:!0,onRefocus:Ne,isKeyboardVisible:he,onEnterTextMode:K}),(D||M)&&T.jsx(lM,{isOpen:j,onClose:()=>W(!1),sessions:t,inactiveSessions:r,selectedSessionId:(e==null?void 0:e.id)??null,onSelect:o,onRename:u,onResume:p,onSetPinned:_,onNewSession:c,loading:v,error:h}),I&&e&&T.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/50",children:T.jsxs("div",{className:"mx-4 w-full max-w-sm rounded-lg border border-border bg-elevated p-4 shadow-xl",children:[T.jsx("h3",{className:"text-base font-medium text-primary mb-2 text-balance",children:"Kill Session"}),T.jsxs("p",{className:"text-sm text-secondary mb-4 text-pretty",children:['Kill "',e.agentSessionName||e.name,'"? The process will be terminated. Conversation history is preserved in logs.']}),T.jsxs("div",{className:"flex justify-end gap-2",children:[T.jsx("button",{onClick:()=>R(!1),className:"btn py-1.5 px-3 text-sm",children:"Cancel"}),T.jsx("button",{ref:Y,onClick:He,className:"btn btn-danger py-1.5 px-3 text-sm",children:"Kill Session"})]})]})})]})}function pM({onSelect:e,onCancel:t,initialPath:r}){const[n,i]=E.useState(r||"~"),[a,l]=E.useState(null),[s,o]=E.useState(null),[c,f]=E.useState(!0),[u,p]=E.useState(-1),_=E.useRef(null),y=me(g=>g.recentPaths),v=E.useCallback(async g=>{var x;(x=_.current)==null||x.abort();const w=new AbortController;_.current=w;const{signal:b}=w;f(!0),o(null),l(null),p(-1),i(g);try{const C=await fetch(`/api/directories?path=${encodeURIComponent(g)}`,{signal:b});if(!C.ok){const k=await C.json();throw new Error(k.message||"Failed to load directory")}const S=await C.json();if(_.current!==w)return;l(S),i(S.path)}catch(C){if(_.current!==w)return;const S=C;(S==null?void 0:S.name)!=="AbortError"&&o((S==null?void 0:S.message)||"Failed to load directory")}finally{_.current===w&&f(!1)}},[]);E.useEffect(()=>(v(r||"~"),()=>{var g;(g=_.current)==null||g.abort()}),[v,r]);const h=(a==null?void 0:a.directories)??[],m=(a==null?void 0:a.path)||n,d=a==null?void 0:a.parent;return E.useEffect(()=>{const g=w=>{if(w.key==="Escape"){w.preventDefault(),t();return}if(!c){if(w.key==="ArrowDown"){w.preventDefault(),p(b=>h.length===0?-1:b<0?0:Math.min(b+1,h.length-1));return}if(w.key==="ArrowUp"){w.preventDefault(),p(b=>h.length===0?-1:b<0?h.length-1:Math.max(b-1,0));return}if(w.key==="Enter"){w.preventDefault();const b=h[u];b?v(b.path):m&&e(m);return}w.key==="Backspace"&&d&&(w.preventDefault(),v(d))}};return window.addEventListener("keydown",g),()=>window.removeEventListener("keydown",g)},[h,m,v,u,c,t,e,d]),T.jsx("div",{role:"dialog","aria-modal":"true","aria-label":"Directory browser",className:"fixed inset-0 z-[60] flex items-center justify-center bg-black/60 p-4",onClick:g=>{g.target===g.currentTarget&&t()},"data-testid":"directory-browser",children:T.jsxs("div",{className:"w-full max-w-lg border border-border bg-elevated p-4",children:[T.jsxs("div",{className:"flex items-center gap-3 border-b border-border pb-2",children:[T.jsx("button",{type:"button",className:"btn",onClick:()=>{d&&v(d)},disabled:!d||c,children:"Up"}),T.jsx("div",{className:"min-w-0 flex-1 truncate text-xs font-mono text-secondary",title:m,"data-testid":"directory-current-path",children:m})]}),T.jsx("div",{className:"mt-3 max-h-60 overflow-y-auto border border-border bg-surface",children:c?T.jsx("div",{className:"px-3 py-4 text-xs text-muted","data-testid":"directory-loading",children:"Loading directories..."}):s?T.jsxs("div",{className:"px-3 py-4 text-xs","data-testid":"directory-error",children:[T.jsx("p",{className:"text-danger",children:s}),T.jsx("button",{type:"button",className:"btn mt-3",onClick:()=>v(n),children:"Retry"})]}):h.length===0?T.jsx("div",{className:"px-3 py-4 text-xs text-muted","data-testid":"directory-empty",children:"No subdirectories"}):T.jsx("div",{className:"py-1",children:h.map((g,w)=>T.jsxs("button",{type:"button",onClick:()=>v(g.path),onMouseEnter:()=>p(w),className:`flex w-full items-center gap-2 px-3 py-2 text-left text-xs ${w===u?"bg-hover text-primary":"text-secondary"}`,"data-testid":"directory-entry","data-entry-name":g.name,"data-entry-path":g.path,children:[T.jsx(EC,{width:14,height:14,className:"shrink-0 text-muted","aria-hidden":"true"}),T.jsx("span",{className:"truncate",children:g.name})]},g.path))})}),a!=null&&a.truncated?T.jsx("p",{className:"mt-2 text-[10px] text-muted",children:"Showing first 200 directories."}):null,T.jsxs("div",{className:"mt-4 border-t border-border pt-3",children:[T.jsx("div",{className:"text-[10px] uppercase tracking-wider text-secondary",children:"Recent"}),y.length===0?T.jsx("p",{className:"mt-2 text-xs text-muted",children:"No recent paths yet."}):T.jsx("div",{className:"mt-2 space-y-1",children:y.map(g=>T.jsx("button",{type:"button",className:"block w-full truncate text-left text-xs text-secondary hover:text-primary",onClick:()=>v(g),title:g,"data-testid":"directory-recent","data-recent-path":g,children:g},g))})]}),T.jsxs("div",{className:"mt-4 flex justify-end gap-2",children:[T.jsx("button",{type:"button",onClick:t,className:"btn",children:"Cancel"}),T.jsx("button",{type:"button",onClick:()=>{m&&e(m)},className:"btn btn-primary",disabled:c||!m,children:"Select"})]})]})})}function mM({isOpen:e,onClose:t,onCreate:r,defaultProjectDir:n,commandPresets:i,defaultPresetId:a,lastProjectPath:l,activeProjectPath:s,remoteHosts:o=[],remoteAllowControl:c=!1,initialHost:f,initialPath:u,initialCommand:p}){const[_,y]=E.useState(""),[v,h]=E.useState(""),[m,d]=E.useState(null),[g,w]=E.useState(""),[b,x]=E.useState(!1),[C,S]=E.useState(""),k=E.useRef(null),L=E.useRef(null),A=E.useRef(null),M=c&&o.length>0;if(E.useEffect(()=>{if(!e){y(""),h(""),d(null),w(""),x(!1),S(f??""),setTimeout(()=>{if(typeof document>"u"||typeof document.querySelector!="function")return;const W=document.querySelector(".xterm-helper-textarea");W&&(W.removeAttribute("disabled"),W.focus())},300);return}if(typeof document<"u"&&typeof document.querySelector=="function"){const W=document.querySelector(".xterm-helper-textarea");W&&typeof W.setAttribute=="function"&&(typeof W.blur=="function"&&W.blur(),W.setAttribute("disabled","true"))}const N=(u==null?void 0:u.trim())||(s==null?void 0:s.trim())||l||n||"";y(N),h(""),S(f??"");const j=p==null?void 0:p.trim();if(j){const W=i.find(V=>Hi(V)===j);W?(d(W.id),w(Hi(W))):(d(null),w(j))}else{const W=i.find(V=>V.id===a);W?(d(a),w(Hi(W))):i.length>0?(d(i[0].id),w(Hi(i[0]))):(d(null),w(""))}setTimeout(()=>{var W;if((W=A.current)==null||W.focus(),L.current){const V=L.current;V.scrollLeft=V.scrollWidth}},50)},[s,i,a,n,e,l,f,u,p]),E.useEffect(()=>{if(!e||typeof window>"u"||typeof window.addEventListener!="function")return;const N=()=>k.current?Array.from(k.current.querySelectorAll('input:not([disabled]), select:not([disabled]), button:not([disabled]):not([tabindex="-1"]), [tabindex="0"]')):[],j=W=>{var V,Z;if(!b){if(W.key==="Escape"){typeof W.stopPropagation=="function"&&W.stopPropagation(),t();return}if(W.key==="Enter"){const Q=document.activeElement;if(!Q||Q.tagName==="INPUT"||Q.closest('[data-testid="host-select"]')||!Q.closest('[data-testid="command-select"]'))return;W.preventDefault(),typeof W.stopPropagation=="function"&&W.stopPropagation(),(V=k.current)==null||V.requestSubmit();return}if(W.key==="Tab"){W.preventDefault(),typeof W.stopPropagation=="function"&&W.stopPropagation();const Q=N();if(Q.length===0)return;const $=document.activeElement,B=Q.indexOf($);let G;B===-1?G=W.shiftKey?Q.length-1:0:W.shiftKey?G=B<=0?Q.length-1:B-1:G=B>=Q.length-1?0:B+1,(Z=Q[G])==null||Z.focus()}}};return window.addEventListener("keydown",j),()=>window.removeEventListener("keydown",j)},[e,t,b]),!e)return null;const D=N=>{const j=i.find(W=>W.id===N);j&&(d(N),w(Hi(j)))},O=()=>{d(null),w("")},z=m===null,F=C!=="",H=N=>{N.preventDefault();const j=_.trim();if(!j)return;const W=g.trim();r(j,v.trim()||void 0,W||void 0,F?C:void 0),t()},I=[...i.map(N=>({id:N.id,label:N.label,isCustom:!1,agentType:N.agentType,command:N.command})),{id:"custom",label:"Custom",isCustom:!0,agentType:void 0,command:void 0}],R=[{id:"",label:"Local",ok:!0,error:void 0},...o.map(N=>({id:N.host,label:N.host,ok:N.ok,error:N.error}))],P=_.trim()||"~";return T.jsxs("div",{role:"dialog","aria-modal":"true","aria-labelledby":"new-session-title",className:"fixed inset-0 z-50 flex items-center justify-center bg-black/60 p-4",onClick:N=>{N.target===N.currentTarget&&t()},children:[T.jsxs("form",{ref:k,onSubmit:H,className:"w-full max-w-md border border-border bg-elevated p-6",children:[T.jsx("h2",{id:"new-session-title",className:"text-sm font-semibold uppercase tracking-wider text-primary text-balance",children:"New Session"}),T.jsxs("div",{className:"mt-4 space-y-4",children:[M&&T.jsxs("div",{children:[T.jsx("label",{className:"mb-1.5 block text-xs text-secondary",children:"Host"}),T.jsx("div",{className:"flex flex-wrap gap-2",role:"radiogroup","aria-label":"Host","data-testid":"host-select",children:R.map((N,j)=>{const W=C===N.id,V=!N.ok&&!W;return T.jsx("button",{type:"button",role:"radio","aria-checked":W,"aria-label":N.label,title:N.ok?void 0:N.error||"Unreachable",tabIndex:W?0:-1,onClick:()=>S(N.id),onKeyDown:Z=>{var U;let Q=j;if(Z.key==="ArrowRight"||Z.key==="ArrowDown")Z.preventDefault(),Q=(j+1)%R.length;else if(Z.key==="ArrowLeft"||Z.key==="ArrowUp")Z.preventDefault(),Q=(j-1+R.length)%R.length;else return;const $=R[Q];S($.id);const B=Z.currentTarget.parentElement,G=B==null?void 0:B.querySelectorAll('[role="radio"]');(U=G==null?void 0:G[Q])==null||U.focus()},className:`btn text-xs focus:outline-none focus:ring-2 focus:ring-primary ${W?"btn-primary":""} ${V?"opacity-60":""}`,children:N.label},N.id||"local")})})]}),T.jsxs("div",{children:[T.jsx("label",{className:"mb-1.5 block text-xs text-secondary",children:"Command"}),T.jsx("div",{className:"flex flex-wrap gap-2",role:"radiogroup","aria-label":"Command preset","data-testid":"command-select",children:I.map((N,j)=>{const W=N.isCustom?z:m===N.id;return T.jsxs("button",{ref:W?A:void 0,type:"button",role:"radio","aria-checked":W,tabIndex:W?0:-1,onClick:()=>{N.isCustom?O():D(N.id)},onKeyDown:V=>{var G;let Z=j;if(V.key==="ArrowRight"||V.key==="ArrowDown")V.preventDefault(),Z=(j+1)%I.length;else if(V.key==="ArrowLeft"||V.key==="ArrowUp")V.preventDefault(),Z=(j-1+I.length)%I.length;else return;const Q=I[Z];Q.isCustom?O():D(Q.id);const $=V.currentTarget.parentElement,B=$==null?void 0:$.querySelectorAll('[role="radio"]');(G=B==null?void 0:B[Z])==null||G.focus()},className:`btn text-xs focus:outline-none focus:ring-2 focus:ring-primary ${W?"btn-primary":""}`,children:[T.jsx(Cc,{agentType:N.agentType,command:N.command,className:"inline-block h-3.5 w-3.5 shrink-0"}),N.label]},N.id)})}),T.jsx("input",{value:g,onChange:N=>w(N.target.value),placeholder:"Enter command...",className:"input mt-2 font-mono text-xs"})]}),T.jsxs("div",{children:[T.jsx("label",{className:"mb-1.5 block text-xs text-secondary",children:"Project Path"}),T.jsxs("div",{className:"flex gap-2",children:[T.jsx("input",{ref:L,value:_,onChange:N=>y(N.target.value),placeholder:F?"/home/user/project":s||l||n||"/Users/you/code/my-project",className:"input flex-1 text-sm"}),!F&&T.jsx("button",{type:"button",className:"btn",onClick:()=>x(!0),children:"Browse"})]})]}),T.jsxs("div",{children:[T.jsx("label",{className:"mb-1.5 block text-xs text-secondary",children:"Display Name"}),T.jsx("input",{value:v,onChange:N=>h(N.target.value),placeholder:"auto-generated",className:"input text-sm placeholder:italic"})]})]}),T.jsxs("div",{className:"mt-6 flex justify-end gap-2",children:[T.jsx("button",{type:"button",onClick:t,className:"btn",children:"Cancel"}),T.jsx("button",{type:"submit",className:"btn btn-primary",children:"Create"})]})]}),b&&!F&&T.jsx(pM,{initialPath:P,onSelect:N=>{y(N),x(!1)},onCancel:()=>x(!1)})]})}const Cu=1,Eu=168;function gM({controlled:e,default:t,name:r,state:n="value"}){const{current:i}=E.useRef(e!==void 0),[a,l]=E.useState(t),s=i?e:a,o=E.useCallback(c=>{i||l(c)},[]);return[s,o]}const Cv={};function ks(e,t){const r=E.useRef(Cv);return r.current===Cv&&(r.current=e(t)),r}const ku=Jv[`useInsertionEffect${Math.random().toFixed(1)}`.slice(0,-3)],vM=ku&&ku!==E.useLayoutEffect?ku:e=>e();function Xr(e){const t=ks(_M).current;return t.next=e,vM(t.effect),t.trampoline}function _M(){const e={next:void 0,callback:yM,trampoline:(...t)=>{var r;return(r=e.callback)==null?void 0:r.call(e,...t)},effect:()=>{e.callback=e.next}};return e}function yM(){}function ld(e,t,r,n){const i=ks(Fw).current;return SM(i,e,t,r,n)&&Hw(i,[e,t,r,n]),i.callback}function wM(e){const t=ks(Fw).current;return xM(t,e)&&Hw(t,e),t.callback}function Fw(){return{callback:null,cleanup:null,refs:[]}}function SM(e,t,r,n,i){return e.refs[0]!==t||e.refs[1]!==r||e.refs[2]!==n||e.refs[3]!==i}function xM(e,t){return e.refs.length!==t.length||e.refs.some((r,n)=>r!==t[n])}function Hw(e,t){if(e.refs=t,t.every(r=>r==null)){e.callback=null;return}e.callback=r=>{if(e.cleanup&&(e.cleanup(),e.cleanup=null),r!=null){const n=Array(t.length).fill(null);for(let i=0;i<t.length;i+=1){const a=t[i];if(a!=null)switch(typeof a){case"function":{const l=a(r);typeof l=="function"&&(n[i]=l);break}case"object":{a.current=r;break}}}e.cleanup=()=>{for(let i=0;i<t.length;i+=1){const a=t[i];if(a!=null)switch(typeof a){case"function":{const l=n[i];typeof l=="function"?l():a(null);break}case"object":{a.current=null;break}}}}}}}const bM=()=>{},qt=typeof document<"u"?E.useLayoutEffect:bM,$w={clipPath:"inset(50%)",overflow:"hidden",whiteSpace:"nowrap",border:0,padding:0,width:1,height:1,margin:-1},ap={...$w,position:"fixed",top:0,left:0},CM={...$w,position:"absolute"};function ur(){}const zr=Object.freeze({});function Yr(e,...t){const r=new URL("https://base-ui.com/production-error");return r.searchParams.set("code",e.toString()),t.forEach(n=>r.searchParams.append("args[]",n)),`Base UI error #${e}; visit ${r} for the full message.`}const EM=parseInt(E.version,10);function lp(e){return EM>=e}function Ev(e){if(!E.isValidElement(e))return null;const t=e,r=t.props;return(lp(19)?r==null?void 0:r.ref:t.ref)??null}function cd(e,t){if(e&&!t)return e;if(!e&&t)return t;if(e||t)return{...e,...t}}function kM(e,t){const r={};for(const n in e){const i=e[n];if(t!=null&&t.hasOwnProperty(n)){const a=t[n](i);a!=null&&Object.assign(r,a);continue}i===!0?r[`data-${n.toLowerCase()}`]="":i&&(r[`data-${n.toLowerCase()}`]=i.toString())}return r}function LM(e,t){return typeof e=="function"?e(t):e}function TM(e,t){return typeof e=="function"?e(t):e}const _o={};function cp(e,t,r,n,i){let a={...ud(e,_o)};return t&&(a=ul(a,t)),r&&(a=ul(a,r)),n&&(a=ul(a,n)),a}function RM(e){if(e.length===0)return _o;if(e.length===1)return ud(e[0],_o);let t={...ud(e[0],_o)};for(let r=1;r<e.length;r+=1)t=ul(t,e[r]);return t}function ul(e,t){return zw(t)?t(e):DM(e,t)}function DM(e,t){if(!t)return e;for(const r in t){const n=t[r];switch(r){case"style":{e[r]=cd(e.style,n);break}case"className":{e[r]=Uw(e.className,n);break}default:MM(r,n)?e[r]=AM(e[r],n):e[r]=n}}return e}function MM(e,t){const r=e.charCodeAt(0),n=e.charCodeAt(1),i=e.charCodeAt(2);return r===111&&n===110&&i>=65&&i<=90&&(typeof t=="function"||typeof t>"u")}function zw(e){return typeof e=="function"}function ud(e,t){return zw(e)?e(t):e??_o}function AM(e,t){return t?e?r=>{if(PM(r)){const i=r;hd(i);const a=t(i);return i.baseUIHandlerPrevented||e==null||e(i),a}const n=t(r);return e==null||e(r),n}:t:e}function hd(e){return e.preventBaseUIHandler=()=>{e.baseUIHandlerPrevented=!0},e}function Uw(e,t){return t?e?t+" "+e:t:e}function PM(e){return e!=null&&typeof e=="object"&&"nativeEvent"in e}function Ls(e,t,r={}){const n=t.render,i=IM(t,r);if(r.enabled===!1)return null;const a=r.state??zr;return BM(e,n,i,a)}function IM(e,t={}){const{className:r,style:n,render:i}=e,{state:a=zr,ref:l,props:s,stateAttributesMapping:o,enabled:c=!0}=t,f=c?LM(r,a):void 0,u=c?TM(n,a):void 0,p=c?kM(a,o):zr,_=c?cd(p,Array.isArray(s)?RM(s):s)??zr:zr;return typeof document<"u"&&(c?Array.isArray(l)?_.ref=wM([_.ref,Ev(i),...l]):_.ref=ld(_.ref,Ev(i),l):ld(null,null)),c?(f!==void 0&&(_.className=Uw(_.className,f)),u!==void 0&&(_.style=cd(_.style,u)),_):zr}const OM=Symbol.for("react.lazy");function BM(e,t,r,n){if(t){if(typeof t=="function")return t(r,n);const i=cp(r,t.props);i.ref=r.ref;let a=t;return(a==null?void 0:a.$$typeof)===OM&&(a=E.Children.toArray(t)[0]),E.cloneElement(a,i)}if(e&&typeof e=="string")return NM(e,r);throw new Error(Yr(8))}function NM(e,t){return e==="button"?E.createElement("button",{type:"button",...t,key:t.key}):e==="img"?E.createElement("img",{alt:"",...t,key:t.key}):E.createElement(e,t)}const jM={...Jv};let kv=0;function FM(e,t="mui"){const[r,n]=E.useState(e),i=e||r;return E.useEffect(()=>{r==null&&(kv+=1,n(`${t}-${kv}`))},[r,t]),i}const Lv=jM.useId;function up(e,t){if(Lv!==void 0){const r=Lv();return e??(t?`${t}-${r}`:r)}return FM(e,t)}function Ww(e){return up(e,"base-ui")}function hp(){return typeof window<"u"}function Ko(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function HM(e){return hp()?e instanceof Element||e instanceof Ko(e).Element:!1}function $M(e){return hp()?e instanceof HTMLElement||e instanceof Ko(e).HTMLElement:!1}function zM(e){return!hp()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Ko(e).ShadowRoot}const UM=E.createContext(void 0);function WM(e=!1){const t=E.useContext(UM);if(t===void 0&&!e)throw new Error(Yr(16));return t}function VM(e){const{focusableWhenDisabled:t,disabled:r,composite:n=!1,tabIndex:i=0,isNativeButton:a}=e,l=n&&t!==!1,s=n&&t===!1;return{props:E.useMemo(()=>{const c={onKeyDown(f){r&&t&&f.key!=="Tab"&&f.preventDefault()}};return n||(c.tabIndex=i,!a&&r&&(c.tabIndex=t?i:-1)),(a&&(t||l)||!a&&r)&&(c["aria-disabled"]=r),a&&(!t||s)&&(c.disabled=r),c},[n,r,t,l,s,a,i])}}function Vw(e={}){const{disabled:t=!1,focusableWhenDisabled:r,tabIndex:n=0,native:i=!0}=e,a=E.useRef(null),l=WM(!0)!==void 0,s=Xr(()=>{const p=a.current;return!!((p==null?void 0:p.tagName)==="A"&&(p!=null&&p.href))}),{props:o}=VM({focusableWhenDisabled:r,disabled:t,composite:l,tabIndex:n,isNativeButton:i}),c=E.useCallback(()=>{const p=a.current;KM(p)&&l&&t&&o.disabled===void 0&&p.disabled&&(p.disabled=!1)},[t,o.disabled,l]);qt(c,[c]);const f=E.useCallback((p={})=>{const{onClick:_,onMouseDown:y,onKeyUp:v,onKeyDown:h,onPointerDown:m,...d}=p;return cp({type:i?"button":void 0,onClick(w){if(t){w.preventDefault();return}_==null||_(w)},onMouseDown(w){t||y==null||y(w)},onKeyDown(w){if(t||(hd(w),h==null||h(w)),w.baseUIHandlerPrevented)return;const b=w.target===w.currentTarget&&!i&&!s()&&!t,x=w.key==="Enter",C=w.key===" ";b&&((C||x)&&w.preventDefault(),x&&(_==null||_(w)))},onKeyUp(w){t||(hd(w),v==null||v(w)),!w.baseUIHandlerPrevented&&w.target===w.currentTarget&&!i&&!t&&w.key===" "&&(_==null||_(w))},onPointerDown(w){if(t){w.preventDefault();return}m==null||m(w)}},i?void 0:{role:"button"},o,d)},[t,o,i,s]),u=Xr(p=>{a.current=p,c()});return{getButtonProps:f,buttonRef:u}}function KM(e){return $M(e)&&e.tagName==="BUTTON"}const Kw=E.createContext(void 0);function GM(){const e=E.useContext(Kw);if(e===void 0)throw new Error(Yr(63));return e}let Tv=function(e){return e.disabled="data-disabled",e.valid="data-valid",e.invalid="data-invalid",e.touched="data-touched",e.dirty="data-dirty",e.filled="data-filled",e.focused="data-focused",e}({});const qM={badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valid:null,valueMissing:!1},XM={valid(e){return e===null?null:e?{[Tv.valid]:""}:{[Tv.invalid]:""}}};let Rv=function(e){return e.checked="data-checked",e.unchecked="data-unchecked",e.disabled="data-disabled",e.readonly="data-readonly",e.required="data-required",e.valid="data-valid",e.invalid="data-invalid",e.touched="data-touched",e.dirty="data-dirty",e.filled="data-filled",e.focused="data-focused",e}({});const Gw={...XM,checked(e){return e?{[Rv.checked]:""}:{[Rv.unchecked]:""}}};function YM(e,t){return{...e,state:{...e.state,valid:!t&&e.state.valid}}}const JM=E.createContext({formRef:{current:{fields:new Map}},errors:{},clearErrors:ur,validationMode:"onSubmit",submitAttemptedRef:{current:!1}});function qw(){return E.useContext(JM)}const QM=E.createContext({invalid:void 0,name:void 0,validityData:{state:qM,errors:[],error:"",value:"",initialValue:null},setValidityData:ur,disabled:void 0,touched:!1,setTouched:ur,dirty:!1,setDirty:ur,filled:!1,setFilled:ur,focused:!1,setFocused:ur,validate:()=>null,validationMode:"onSubmit",validationDebounceTime:0,shouldValidateOnChange:()=>!1,state:{disabled:!1,valid:null,touched:!1,dirty:!1,filled:!1,focused:!1},markedDirtyRef:{current:!1},validation:{getValidationProps:(e=zr)=>e,getInputValidationProps:(e=zr)=>e,inputRef:{current:null},commit:async()=>{}}});function dp(e=!0){const t=E.useContext(QM);if(t.setValidityData===ur&&!e)throw new Error(Yr(28));return t}function ZM(e){const{enabled:t=!0,value:r,id:n,name:i,controlRef:a,commit:l}=e,{formRef:s}=qw(),{invalid:o,markedDirtyRef:c,validityData:f,setValidityData:u}=dp(),p=Xr(e.getValue);qt(()=>{if(!t)return;let _=r;_===void 0&&(_=p()),f.initialValue===null&&_!==null&&u(y=>({...y,initialValue:_}))},[t,u,r,f.initialValue,p]),qt(()=>{!t||!n||s.current.fields.set(n,{getValue:p,name:i,controlRef:a,validityData:YM(f,o),validate(_=!0){let y=r;y===void 0&&(y=p()),c.current=!0,_?hn.flushSync(()=>l(y)):l(y)}})},[l,a,t,s,p,n,o,c,i,f,r]),qt(()=>{const _=s.current.fields;return()=>{n&&_.delete(n)}},[s,n])}const e3=E.createContext({controlId:void 0,registerControlId:ur,labelId:void 0,setLabelId:ur,messageIds:[],setMessageIds:ur,getDescriptionProps:e=>e});function Xw(){return E.useContext(e3)}function t3(e={}){const{id:t,implicit:r=!1,controlRef:n}=e,{controlId:i,registerControlId:a}=Xw(),l=Ww(t),s=r?i:void 0,o=ks(()=>Symbol("labelable-control")),c=E.useRef(!1),f=E.useRef(t!=null),u=Xr(()=>{!c.current||a===ur||(c.current=!1,a(o.current,void 0))});return qt(()=>{if(a===ur)return;let p;if(r){const _=n==null?void 0:n.current;HM(_)&&_.closest("label")!=null?p=t??null:p=s??l}else if(t!=null)f.current=!0,p=t;else if(f.current)p=l;else{u();return}if(p===void 0){u();return}c.current=!0,a(o.current,p)},[t,n,s,a,r,l,o,u]),E.useEffect(()=>u,[u]),i??l}const r3="none";function n3(e,t,r,n){let i=!1,a=!1;const l=zr;return{reason:e,event:t??new Event("base-ui"),cancel(){i=!0},allowPropagation(){a=!0},get isCanceled(){return i},get isPropagationAllowed(){return a},trigger:r,...l}}function s3(e,t){const r=E.useRef(e),n=Xr(t);qt(()=>{r.current!==e&&n(r.current)},[e,n]),qt(()=>{r.current=e},[e])}const i3=E.forwardRef(function(t,r){const{checked:n,className:i,defaultChecked:a,id:l,inputRef:s,name:o,nativeButton:c=!1,onCheckedChange:f,readOnly:u=!1,required:p=!1,disabled:_=!1,render:y,uncheckedValue:v,value:h,...m}=t,{clearErrors:d}=qw(),{state:g,setTouched:w,setDirty:b,validityData:x,setFilled:C,setFocused:S,shouldValidateOnChange:k,validationMode:L,disabled:A,name:M,validation:D}=dp(),{labelId:O}=Xw(),z=A||_,F=M??o,H=Xr(f),I=E.useRef(null),R=ld(I,s,D.inputRef),P=E.useRef(null),N=Ww(),j=t3({id:l,implicit:!1,controlRef:P}),W=c?void 0:j,[V,Z]=gM({controlled:n,default:!!a,name:"Switch",state:"checked"});ZM({id:N,commit:D.commit,value:V,controlRef:P,name:F,getValue:()=>V}),qt(()=>{I.current&&C(I.current.checked)},[I,C]),s3(V,()=>{d(F),b(V!==x.initialValue),C(V),k()?D.commit(V):D.commit(V,!0)});const{getButtonProps:Q,buttonRef:$}=Vw({disabled:z,native:c}),B={id:c?j:N,role:"switch","aria-checked":V,"aria-readonly":u||void 0,"aria-required":p||void 0,"aria-labelledby":O,onFocus(){z||S(!0)},onBlur(){const Y=I.current;!Y||z||(w(!0),S(!1),L==="onBlur"&&D.commit(Y.checked))},onClick(Y){var _e;u||z||(Y.preventDefault(),(_e=I.current)==null||_e.dispatchEvent(new PointerEvent("click",{bubbles:!0,shiftKey:Y.shiftKey,ctrlKey:Y.ctrlKey,altKey:Y.altKey,metaKey:Y.metaKey})))}},G=E.useMemo(()=>cp({checked:V,disabled:z,id:W,name:F,required:p,style:F?CM:ap,tabIndex:-1,type:"checkbox","aria-hidden":!0,ref:R,onChange(Y){if(Y.nativeEvent.defaultPrevented)return;const _e=Y.target.checked,fe=n3(r3,Y.nativeEvent);H==null||H(_e,fe),!fe.isCanceled&&Z(_e)},onFocus(){var Y;(Y=P.current)==null||Y.focus()}},D.getInputValidationProps,h!==void 0?{value:h}:zr),[V,z,R,W,F,H,p,Z,D,h]),U=E.useMemo(()=>({...g,checked:V,disabled:z,readOnly:u,required:p}),[g,V,z,u,p]),te=Ls("span",t,{state:U,ref:[r,P,$],props:[B,D.getValidationProps,m,Q],stateAttributesMapping:Gw});return T.jsxs(Kw.Provider,{value:U,children:[te,!V&&F&&v!==void 0&&T.jsx("input",{type:"hidden",name:F,value:v}),T.jsx("input",{...G})]})}),o3=E.forwardRef(function(t,r){const{render:n,className:i,...a}=t,{state:l}=dp(),s=GM(),o={...l,...s};return Ls("span",t,{state:o,ref:r,stateAttributesMapping:Gw,props:a})});function Yw(e){var t,r,n="";if(typeof e=="string"||typeof e=="number")n+=e;else if(typeof e=="object")if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(r=Yw(e[t]))&&(n&&(n+=" "),n+=r)}else for(r in e)e[r]&&(n&&(n+=" "),n+=r);return n}function a3(){for(var e,t,r=0,n="",i=arguments.length;r<i;r++)(e=arguments[r])&&(t=Yw(e))&&(n&&(n+=" "),n+=t);return n}const l3=(e,t)=>{const r=new Array(e.length+t.length);for(let n=0;n<e.length;n++)r[n]=e[n];for(let n=0;n<t.length;n++)r[e.length+n]=t[n];return r},c3=(e,t)=>({classGroupId:e,validator:t}),Jw=(e=new Map,t=null,r)=>({nextPart:e,validators:t,classGroupId:r}),Xl="-",Dv=[],u3="arbitrary..",h3=e=>{const t=f3(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:n}=e;return{getClassGroupId:l=>{if(l.startsWith("[")&&l.endsWith("]"))return d3(l);const s=l.split(Xl),o=s[0]===""&&s.length>1?1:0;return Qw(s,o,t)},getConflictingClassGroupIds:(l,s)=>{if(s){const o=n[l],c=r[l];return o?c?l3(c,o):o:c||Dv}return r[l]||Dv}}},Qw=(e,t,r)=>{if(e.length-t===0)return r.classGroupId;const i=e[t],a=r.nextPart.get(i);if(a){const c=Qw(e,t+1,a);if(c)return c}const l=r.validators;if(l===null)return;const s=t===0?e.join(Xl):e.slice(t).join(Xl),o=l.length;for(let c=0;c<o;c++){const f=l[c];if(f.validator(s))return f.classGroupId}},d3=e=>e.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const t=e.slice(1,-1),r=t.indexOf(":"),n=t.slice(0,r);return n?u3+n:void 0})(),f3=e=>{const{theme:t,classGroups:r}=e;return p3(r,t)},p3=(e,t)=>{const r=Jw();for(const n in e){const i=e[n];fp(i,r,n,t)}return r},fp=(e,t,r,n)=>{const i=e.length;for(let a=0;a<i;a++){const l=e[a];m3(l,t,r,n)}},m3=(e,t,r,n)=>{if(typeof e=="string"){g3(e,t,r);return}if(typeof e=="function"){v3(e,t,r,n);return}_3(e,t,r,n)},g3=(e,t,r)=>{const n=e===""?t:Zw(t,e);n.classGroupId=r},v3=(e,t,r,n)=>{if(y3(e)){fp(e(n),t,r,n);return}t.validators===null&&(t.validators=[]),t.validators.push(c3(r,e))},_3=(e,t,r,n)=>{const i=Object.entries(e),a=i.length;for(let l=0;l<a;l++){const[s,o]=i[l];fp(o,Zw(t,s),r,n)}},Zw=(e,t)=>{let r=e;const n=t.split(Xl),i=n.length;for(let a=0;a<i;a++){const l=n[a];let s=r.nextPart.get(l);s||(s=Jw(),r.nextPart.set(l,s)),r=s}return r},y3=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,w3=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,r=Object.create(null),n=Object.create(null);const i=(a,l)=>{r[a]=l,t++,t>e&&(t=0,n=r,r=Object.create(null))};return{get(a){let l=r[a];if(l!==void 0)return l;if((l=n[a])!==void 0)return i(a,l),l},set(a,l){a in r?r[a]=l:i(a,l)}}},dd="!",Mv=":",S3=[],Av=(e,t,r,n,i)=>({modifiers:e,hasImportantModifier:t,baseClassName:r,maybePostfixModifierPosition:n,isExternal:i}),x3=e=>{const{prefix:t,experimentalParseClassName:r}=e;let n=i=>{const a=[];let l=0,s=0,o=0,c;const f=i.length;for(let v=0;v<f;v++){const h=i[v];if(l===0&&s===0){if(h===Mv){a.push(i.slice(o,v)),o=v+1;continue}if(h==="/"){c=v;continue}}h==="["?l++:h==="]"?l--:h==="("?s++:h===")"&&s--}const u=a.length===0?i:i.slice(o);let p=u,_=!1;u.endsWith(dd)?(p=u.slice(0,-1),_=!0):u.startsWith(dd)&&(p=u.slice(1),_=!0);const y=c&&c>o?c-o:void 0;return Av(a,_,p,y)};if(t){const i=t+Mv,a=n;n=l=>l.startsWith(i)?a(l.slice(i.length)):Av(S3,!1,l,void 0,!0)}if(r){const i=n;n=a=>r({className:a,parseClassName:i})}return n},b3=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((r,n)=>{t.set(r,1e6+n)}),r=>{const n=[];let i=[];for(let a=0;a<r.length;a++){const l=r[a],s=l[0]==="[",o=t.has(l);s||o?(i.length>0&&(i.sort(),n.push(...i),i=[]),n.push(l)):i.push(l)}return i.length>0&&(i.sort(),n.push(...i)),n}},C3=e=>({cache:w3(e.cacheSize),parseClassName:x3(e),sortModifiers:b3(e),...h3(e)}),E3=/\s+/,k3=(e,t)=>{const{parseClassName:r,getClassGroupId:n,getConflictingClassGroupIds:i,sortModifiers:a}=t,l=[],s=e.trim().split(E3);let o="";for(let c=s.length-1;c>=0;c-=1){const f=s[c],{isExternal:u,modifiers:p,hasImportantModifier:_,baseClassName:y,maybePostfixModifierPosition:v}=r(f);if(u){o=f+(o.length>0?" "+o:o);continue}let h=!!v,m=n(h?y.substring(0,v):y);if(!m){if(!h){o=f+(o.length>0?" "+o:o);continue}if(m=n(y),!m){o=f+(o.length>0?" "+o:o);continue}h=!1}const d=p.length===0?"":p.length===1?p[0]:a(p).join(":"),g=_?d+dd:d,w=g+m;if(l.indexOf(w)>-1)continue;l.push(w);const b=i(m,h);for(let x=0;x<b.length;++x){const C=b[x];l.push(g+C)}o=f+(o.length>0?" "+o:o)}return o},L3=(...e)=>{let t=0,r,n,i="";for(;t<e.length;)(r=e[t++])&&(n=eS(r))&&(i&&(i+=" "),i+=n);return i},eS=e=>{if(typeof e=="string")return e;let t,r="";for(let n=0;n<e.length;n++)e[n]&&(t=eS(e[n]))&&(r&&(r+=" "),r+=t);return r},T3=(e,...t)=>{let r,n,i,a;const l=o=>{const c=t.reduce((f,u)=>u(f),e());return r=C3(c),n=r.cache.get,i=r.cache.set,a=s,s(o)},s=o=>{const c=n(o);if(c)return c;const f=k3(o,r);return i(o,f),f};return a=l,(...o)=>a(L3(...o))},R3=[],yt=e=>{const t=r=>r[e]||R3;return t.isThemeGetter=!0,t},tS=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,rS=/^\((?:(\w[\w-]*):)?(.+)\)$/i,D3=/^\d+\/\d+$/,M3=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,A3=/\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$/,P3=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,I3=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,O3=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Is=e=>D3.test(e),Fe=e=>!!e&&!Number.isNaN(Number(e)),bn=e=>!!e&&Number.isInteger(Number(e)),Lu=e=>e.endsWith("%")&&Fe(e.slice(0,-1)),rn=e=>M3.test(e),B3=()=>!0,N3=e=>A3.test(e)&&!P3.test(e),nS=()=>!1,j3=e=>I3.test(e),F3=e=>O3.test(e),H3=e=>!xe(e)&&!be(e),$3=e=>Di(e,oS,nS),xe=e=>tS.test(e),ns=e=>Di(e,aS,N3),Tu=e=>Di(e,K3,Fe),Pv=e=>Di(e,sS,nS),z3=e=>Di(e,iS,F3),ja=e=>Di(e,lS,j3),be=e=>rS.test(e),zi=e=>Mi(e,aS),U3=e=>Mi(e,G3),Iv=e=>Mi(e,sS),W3=e=>Mi(e,oS),V3=e=>Mi(e,iS),Fa=e=>Mi(e,lS,!0),Di=(e,t,r)=>{const n=tS.exec(e);return n?n[1]?t(n[1]):r(n[2]):!1},Mi=(e,t,r=!1)=>{const n=rS.exec(e);return n?n[1]?t(n[1]):r:!1},sS=e=>e==="position"||e==="percentage",iS=e=>e==="image"||e==="url",oS=e=>e==="length"||e==="size"||e==="bg-size",aS=e=>e==="length",K3=e=>e==="number",G3=e=>e==="family-name",lS=e=>e==="shadow",q3=()=>{const e=yt("color"),t=yt("font"),r=yt("text"),n=yt("font-weight"),i=yt("tracking"),a=yt("leading"),l=yt("breakpoint"),s=yt("container"),o=yt("spacing"),c=yt("radius"),f=yt("shadow"),u=yt("inset-shadow"),p=yt("text-shadow"),_=yt("drop-shadow"),y=yt("blur"),v=yt("perspective"),h=yt("aspect"),m=yt("ease"),d=yt("animate"),g=()=>["auto","avoid","all","avoid-page","page","left","right","column"],w=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],b=()=>[...w(),be,xe],x=()=>["auto","hidden","clip","visible","scroll"],C=()=>["auto","contain","none"],S=()=>[be,xe,o],k=()=>[Is,"full","auto",...S()],L=()=>[bn,"none","subgrid",be,xe],A=()=>["auto",{span:["full",bn,be,xe]},bn,be,xe],M=()=>[bn,"auto",be,xe],D=()=>["auto","min","max","fr",be,xe],O=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],z=()=>["start","end","center","stretch","center-safe","end-safe"],F=()=>["auto",...S()],H=()=>[Is,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...S()],I=()=>[e,be,xe],R=()=>[...w(),Iv,Pv,{position:[be,xe]}],P=()=>["no-repeat",{repeat:["","x","y","space","round"]}],N=()=>["auto","cover","contain",W3,$3,{size:[be,xe]}],j=()=>[Lu,zi,ns],W=()=>["","none","full",c,be,xe],V=()=>["",Fe,zi,ns],Z=()=>["solid","dashed","dotted","double"],Q=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],$=()=>[Fe,Lu,Iv,Pv],B=()=>["","none",y,be,xe],G=()=>["none",Fe,be,xe],U=()=>["none",Fe,be,xe],te=()=>[Fe,be,xe],Y=()=>[Is,"full",...S()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[rn],breakpoint:[rn],color:[B3],container:[rn],"drop-shadow":[rn],ease:["in","out","in-out"],font:[H3],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[rn],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[rn],shadow:[rn],spacing:["px",Fe],text:[rn],"text-shadow":[rn],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Is,xe,be,h]}],container:["container"],columns:[{columns:[Fe,xe,be,s]}],"break-after":[{"break-after":g()}],"break-before":[{"break-before":g()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:b()}],overflow:[{overflow:x()}],"overflow-x":[{"overflow-x":x()}],"overflow-y":[{"overflow-y":x()}],overscroll:[{overscroll:C()}],"overscroll-x":[{"overscroll-x":C()}],"overscroll-y":[{"overscroll-y":C()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:k()}],"inset-x":[{"inset-x":k()}],"inset-y":[{"inset-y":k()}],start:[{start:k()}],end:[{end:k()}],top:[{top:k()}],right:[{right:k()}],bottom:[{bottom:k()}],left:[{left:k()}],visibility:["visible","invisible","collapse"],z:[{z:[bn,"auto",be,xe]}],basis:[{basis:[Is,"full","auto",s,...S()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Fe,Is,"auto","initial","none",xe]}],grow:[{grow:["",Fe,be,xe]}],shrink:[{shrink:["",Fe,be,xe]}],order:[{order:[bn,"first","last","none",be,xe]}],"grid-cols":[{"grid-cols":L()}],"col-start-end":[{col:A()}],"col-start":[{"col-start":M()}],"col-end":[{"col-end":M()}],"grid-rows":[{"grid-rows":L()}],"row-start-end":[{row:A()}],"row-start":[{"row-start":M()}],"row-end":[{"row-end":M()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":D()}],"auto-rows":[{"auto-rows":D()}],gap:[{gap:S()}],"gap-x":[{"gap-x":S()}],"gap-y":[{"gap-y":S()}],"justify-content":[{justify:[...O(),"normal"]}],"justify-items":[{"justify-items":[...z(),"normal"]}],"justify-self":[{"justify-self":["auto",...z()]}],"align-content":[{content:["normal",...O()]}],"align-items":[{items:[...z(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...z(),{baseline:["","last"]}]}],"place-content":[{"place-content":O()}],"place-items":[{"place-items":[...z(),"baseline"]}],"place-self":[{"place-self":["auto",...z()]}],p:[{p:S()}],px:[{px:S()}],py:[{py:S()}],ps:[{ps:S()}],pe:[{pe:S()}],pt:[{pt:S()}],pr:[{pr:S()}],pb:[{pb:S()}],pl:[{pl:S()}],m:[{m:F()}],mx:[{mx:F()}],my:[{my:F()}],ms:[{ms:F()}],me:[{me:F()}],mt:[{mt:F()}],mr:[{mr:F()}],mb:[{mb:F()}],ml:[{ml:F()}],"space-x":[{"space-x":S()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":S()}],"space-y-reverse":["space-y-reverse"],size:[{size:H()}],w:[{w:[s,"screen",...H()]}],"min-w":[{"min-w":[s,"screen","none",...H()]}],"max-w":[{"max-w":[s,"screen","none","prose",{screen:[l]},...H()]}],h:[{h:["screen","lh",...H()]}],"min-h":[{"min-h":["screen","lh","none",...H()]}],"max-h":[{"max-h":["screen","lh",...H()]}],"font-size":[{text:["base",r,zi,ns]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[n,be,Tu]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Lu,xe]}],"font-family":[{font:[U3,xe,t]}],"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:[i,be,xe]}],"line-clamp":[{"line-clamp":[Fe,"none",be,Tu]}],leading:[{leading:[a,...S()]}],"list-image":[{"list-image":["none",be,xe]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",be,xe]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:I()}],"text-color":[{text:I()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...Z(),"wavy"]}],"text-decoration-thickness":[{decoration:[Fe,"from-font","auto",be,ns]}],"text-decoration-color":[{decoration:I()}],"underline-offset":[{"underline-offset":[Fe,"auto",be,xe]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:S()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",be,xe]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",be,xe]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:R()}],"bg-repeat":[{bg:P()}],"bg-size":[{bg:N()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},bn,be,xe],radial:["",be,xe],conic:[bn,be,xe]},V3,z3]}],"bg-color":[{bg:I()}],"gradient-from-pos":[{from:j()}],"gradient-via-pos":[{via:j()}],"gradient-to-pos":[{to:j()}],"gradient-from":[{from:I()}],"gradient-via":[{via:I()}],"gradient-to":[{to:I()}],rounded:[{rounded:W()}],"rounded-s":[{"rounded-s":W()}],"rounded-e":[{"rounded-e":W()}],"rounded-t":[{"rounded-t":W()}],"rounded-r":[{"rounded-r":W()}],"rounded-b":[{"rounded-b":W()}],"rounded-l":[{"rounded-l":W()}],"rounded-ss":[{"rounded-ss":W()}],"rounded-se":[{"rounded-se":W()}],"rounded-ee":[{"rounded-ee":W()}],"rounded-es":[{"rounded-es":W()}],"rounded-tl":[{"rounded-tl":W()}],"rounded-tr":[{"rounded-tr":W()}],"rounded-br":[{"rounded-br":W()}],"rounded-bl":[{"rounded-bl":W()}],"border-w":[{border:V()}],"border-w-x":[{"border-x":V()}],"border-w-y":[{"border-y":V()}],"border-w-s":[{"border-s":V()}],"border-w-e":[{"border-e":V()}],"border-w-t":[{"border-t":V()}],"border-w-r":[{"border-r":V()}],"border-w-b":[{"border-b":V()}],"border-w-l":[{"border-l":V()}],"divide-x":[{"divide-x":V()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":V()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...Z(),"hidden","none"]}],"divide-style":[{divide:[...Z(),"hidden","none"]}],"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:[...Z(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Fe,be,xe]}],"outline-w":[{outline:["",Fe,zi,ns]}],"outline-color":[{outline:I()}],shadow:[{shadow:["","none",f,Fa,ja]}],"shadow-color":[{shadow:I()}],"inset-shadow":[{"inset-shadow":["none",u,Fa,ja]}],"inset-shadow-color":[{"inset-shadow":I()}],"ring-w":[{ring:V()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:I()}],"ring-offset-w":[{"ring-offset":[Fe,ns]}],"ring-offset-color":[{"ring-offset":I()}],"inset-ring-w":[{"inset-ring":V()}],"inset-ring-color":[{"inset-ring":I()}],"text-shadow":[{"text-shadow":["none",p,Fa,ja]}],"text-shadow-color":[{"text-shadow":I()}],opacity:[{opacity:[Fe,be,xe]}],"mix-blend":[{"mix-blend":[...Q(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":Q()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[Fe]}],"mask-image-linear-from-pos":[{"mask-linear-from":$()}],"mask-image-linear-to-pos":[{"mask-linear-to":$()}],"mask-image-linear-from-color":[{"mask-linear-from":I()}],"mask-image-linear-to-color":[{"mask-linear-to":I()}],"mask-image-t-from-pos":[{"mask-t-from":$()}],"mask-image-t-to-pos":[{"mask-t-to":$()}],"mask-image-t-from-color":[{"mask-t-from":I()}],"mask-image-t-to-color":[{"mask-t-to":I()}],"mask-image-r-from-pos":[{"mask-r-from":$()}],"mask-image-r-to-pos":[{"mask-r-to":$()}],"mask-image-r-from-color":[{"mask-r-from":I()}],"mask-image-r-to-color":[{"mask-r-to":I()}],"mask-image-b-from-pos":[{"mask-b-from":$()}],"mask-image-b-to-pos":[{"mask-b-to":$()}],"mask-image-b-from-color":[{"mask-b-from":I()}],"mask-image-b-to-color":[{"mask-b-to":I()}],"mask-image-l-from-pos":[{"mask-l-from":$()}],"mask-image-l-to-pos":[{"mask-l-to":$()}],"mask-image-l-from-color":[{"mask-l-from":I()}],"mask-image-l-to-color":[{"mask-l-to":I()}],"mask-image-x-from-pos":[{"mask-x-from":$()}],"mask-image-x-to-pos":[{"mask-x-to":$()}],"mask-image-x-from-color":[{"mask-x-from":I()}],"mask-image-x-to-color":[{"mask-x-to":I()}],"mask-image-y-from-pos":[{"mask-y-from":$()}],"mask-image-y-to-pos":[{"mask-y-to":$()}],"mask-image-y-from-color":[{"mask-y-from":I()}],"mask-image-y-to-color":[{"mask-y-to":I()}],"mask-image-radial":[{"mask-radial":[be,xe]}],"mask-image-radial-from-pos":[{"mask-radial-from":$()}],"mask-image-radial-to-pos":[{"mask-radial-to":$()}],"mask-image-radial-from-color":[{"mask-radial-from":I()}],"mask-image-radial-to-color":[{"mask-radial-to":I()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":w()}],"mask-image-conic-pos":[{"mask-conic":[Fe]}],"mask-image-conic-from-pos":[{"mask-conic-from":$()}],"mask-image-conic-to-pos":[{"mask-conic-to":$()}],"mask-image-conic-from-color":[{"mask-conic-from":I()}],"mask-image-conic-to-color":[{"mask-conic-to":I()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:R()}],"mask-repeat":[{mask:P()}],"mask-size":[{mask:N()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",be,xe]}],filter:[{filter:["","none",be,xe]}],blur:[{blur:B()}],brightness:[{brightness:[Fe,be,xe]}],contrast:[{contrast:[Fe,be,xe]}],"drop-shadow":[{"drop-shadow":["","none",_,Fa,ja]}],"drop-shadow-color":[{"drop-shadow":I()}],grayscale:[{grayscale:["",Fe,be,xe]}],"hue-rotate":[{"hue-rotate":[Fe,be,xe]}],invert:[{invert:["",Fe,be,xe]}],saturate:[{saturate:[Fe,be,xe]}],sepia:[{sepia:["",Fe,be,xe]}],"backdrop-filter":[{"backdrop-filter":["","none",be,xe]}],"backdrop-blur":[{"backdrop-blur":B()}],"backdrop-brightness":[{"backdrop-brightness":[Fe,be,xe]}],"backdrop-contrast":[{"backdrop-contrast":[Fe,be,xe]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Fe,be,xe]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Fe,be,xe]}],"backdrop-invert":[{"backdrop-invert":["",Fe,be,xe]}],"backdrop-opacity":[{"backdrop-opacity":[Fe,be,xe]}],"backdrop-saturate":[{"backdrop-saturate":[Fe,be,xe]}],"backdrop-sepia":[{"backdrop-sepia":["",Fe,be,xe]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":S()}],"border-spacing-x":[{"border-spacing-x":S()}],"border-spacing-y":[{"border-spacing-y":S()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",be,xe]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Fe,"initial",be,xe]}],ease:[{ease:["linear","initial",m,be,xe]}],delay:[{delay:[Fe,be,xe]}],animate:[{animate:["none",d,be,xe]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[v,be,xe]}],"perspective-origin":[{"perspective-origin":b()}],rotate:[{rotate:G()}],"rotate-x":[{"rotate-x":G()}],"rotate-y":[{"rotate-y":G()}],"rotate-z":[{"rotate-z":G()}],scale:[{scale:U()}],"scale-x":[{"scale-x":U()}],"scale-y":[{"scale-y":U()}],"scale-z":[{"scale-z":U()}],"scale-3d":["scale-3d"],skew:[{skew:te()}],"skew-x":[{"skew-x":te()}],"skew-y":[{"skew-y":te()}],transform:[{transform:[be,xe,"","none","gpu","cpu"]}],"transform-origin":[{origin:b()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Y()}],"translate-x":[{"translate-x":Y()}],"translate-y":[{"translate-y":Y()}],"translate-z":[{"translate-z":Y()}],"translate-none":["translate-none"],accent:[{accent:I()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:I()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",be,xe]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":S()}],"scroll-mx":[{"scroll-mx":S()}],"scroll-my":[{"scroll-my":S()}],"scroll-ms":[{"scroll-ms":S()}],"scroll-me":[{"scroll-me":S()}],"scroll-mt":[{"scroll-mt":S()}],"scroll-mr":[{"scroll-mr":S()}],"scroll-mb":[{"scroll-mb":S()}],"scroll-ml":[{"scroll-ml":S()}],"scroll-p":[{"scroll-p":S()}],"scroll-px":[{"scroll-px":S()}],"scroll-py":[{"scroll-py":S()}],"scroll-ps":[{"scroll-ps":S()}],"scroll-pe":[{"scroll-pe":S()}],"scroll-pt":[{"scroll-pt":S()}],"scroll-pr":[{"scroll-pr":S()}],"scroll-pb":[{"scroll-pb":S()}],"scroll-pl":[{"scroll-pl":S()}],"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",be,xe]}],fill:[{fill:["none",...I()]}],"stroke-w":[{stroke:[Fe,zi,ns,Tu]}],stroke:[{stroke:["none",...I()]}],"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-x","border-w-y","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-x","border-color-y","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"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-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"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},X3=T3(q3);function Yl(...e){return X3(a3(e))}function Cn({checked:e,onCheckedChange:t,disabled:r,className:n}){return T.jsx(i3,{checked:e,onCheckedChange:t,disabled:r,className:Yl("group relative inline-flex h-6 w-10 shrink-0 cursor-pointer items-center rounded-full transition-colors","bg-border data-[checked]:bg-accent","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent focus-visible:ring-offset-2 focus-visible:ring-offset-bg-base","disabled:cursor-not-allowed disabled:opacity-50",n),children:T.jsx(o3,{className:Yl("pointer-events-none block size-4 rounded-full bg-white shadow-sm transition-transform","translate-x-1 group-data-[checked]:translate-x-5")})})}let Ar=null,pp=!1;const Jl={},cS=500;function mp(){if(typeof window>"u")return null;if((Ar==null?void 0:Ar.state)==="closed"&&(Ar=null),!Ar){const e=window.AudioContext??window.webkitAudioContext;if(!e)return null;Ar=new e}return Ar}function Y3(){Ar&&(Ar.close().catch(()=>{}),Ar=null),mp()}function J3(){return pp}function Ru(){Ar&&(Y3(),pp=!0)}if(typeof window<"u"){window.addEventListener("pageshow",t=>{t.persisted&&Ru()}),document.addEventListener("visibilitychange",()=>{document.visibilityState==="visible"&&Ru()});let e=Date.now();setInterval(()=>{const t=Date.now();t-e>15e3&&Ru(),e=t},5e3)}async function fd(){const e=mp();e&&e.state==="suspended"&&await e.resume().catch(()=>{}),pp=!1}async function Q3(e){e.state==="suspended"&&await e.resume().catch(()=>{})}async function uS(e){const t=mp();if(!t||(await Q3(t),t.state!=="running"))return;const{frequencies:r,durationMs:n,attackMs:i,peakGain:a,type:l="sine"}=e,s=t.currentTime,o=n/1e3,c=i/1e3,f=t.createGain();f.connect(t.destination);const u=s+o*.7;f.gain.setValueAtTime(0,s),f.gain.linearRampToValueAtTime(a,s+c),f.gain.setValueAtTime(a,u),f.gain.linearRampToValueAtTime(0,s+o);const p=r.map(y=>{const v=t.createOscillator();return v.type=l,v.frequency.setValueAtTime(y,s),v.connect(f),v});for(const y of p)y.start(s),y.stop(s+o);const _=p[p.length-1];_.onended=()=>{for(const y of p)y.disconnect();f.disconnect()}}async function pd(){const e=Date.now();if(!(e-(Jl.permission||0)<cS)){Jl.permission=e;try{await uS({frequencies:[880],durationMs:150,attackMs:5,peakGain:.15,type:"sine"})}catch{}}}async function md(){const e=Date.now();if(!(e-(Jl.idle||0)<cS)){Jl.idle=e;try{await uS({frequencies:[440,550],durationMs:300,attackMs:10,peakGain:.08,type:"sine"})}catch{}}}function Z3({isOpen:e,onClose:t}){const r=me(q=>q.defaultProjectDir),n=me(q=>q.setDefaultProjectDir),i=me(q=>q.commandPresets),a=me(q=>q.setCommandPresets),l=me(q=>q.defaultPresetId),s=me(q=>q.setDefaultPresetId),o=me(q=>q.sessionSortMode),c=me(q=>q.setSessionSortMode),f=me(q=>q.sessionSortDirection),u=me(q=>q.setSessionSortDirection),p=me(q=>q.useWebGL),_=me(q=>q.setUseWebGL),y=me(q=>q.fontSize),v=me(q=>q.setFontSize),h=me(q=>q.lineHeight),m=me(q=>q.setLineHeight),d=me(q=>q.letterSpacing),g=me(q=>q.setLetterSpacing),w=me(q=>q.fontOption),b=me(q=>q.setFontOption),x=me(q=>q.customFontFamily),C=me(q=>q.setCustomFontFamily),S=me(q=>q.shortcutModifier),k=me(q=>q.setShortcutModifier),L=me(q=>q.showProjectName),A=me(q=>q.setShowProjectName),M=me(q=>q.showLastUserMessage),D=me(q=>q.setShowLastUserMessage),O=me(q=>q.showSessionIdPrefix),z=me(q=>q.setShowSessionIdPrefix),F=ql(q=>q.theme),H=ql(q=>q.setTheme),I=me(q=>q.soundOnPermission),R=me(q=>q.setSoundOnPermission),P=me(q=>q.soundOnIdle),N=me(q=>q.setSoundOnIdle),[j,W]=E.useState(r),[V,Z]=E.useState(i),[Q,$]=E.useState(l),[B,G]=E.useState(o),[U,te]=E.useState(f),[Y,_e]=E.useState(p),[fe,re]=E.useState(y),[le,se]=E.useState(h),[pe,ve]=E.useState(d),[ie,oe]=E.useState(w),[de,ae]=E.useState(x),[ge,Ee]=E.useState(S),[Le,He]=E.useState(L),[je,Pe]=E.useState(M),[Oe,Ce]=E.useState(O),[Te,J]=E.useState(F),[ee,$e]=E.useState(I),[Ne,K]=E.useState(P),[he,X]=E.useState(!0),[ye,ne]=E.useState(!1),[ue,ke]=E.useState(24),[De,ze]=E.useState(!1),[We,Ie]=E.useState(!1),[Me,et]=E.useState(""),[Ue,Re]=E.useState(""),[Ae,Ve]=E.useState(""),Ye=E.useRef(null);if(E.useEffect(()=>{if(Ye.current&&(clearTimeout(Ye.current),Ye.current=null),e){if(W(r),Z(i),$(l),G(o),te(f),_e(p),re(y),se(h),ve(d),oe(w),ae(x),Ee(S),He(L),Pe(M),Ce(O),J(F),$e(I),K(P),Ie(!1),et(""),Re(""),Ve(""),fetch("/api/settings/tmux-mouse-mode").then(q=>q.json()).then(q=>X(q.enabled)).catch(()=>{}),fetch("/api/settings/inactive-max-age-hours").then(q=>q.json()).then(q=>ke(q.hours)).catch(()=>{}),typeof document<"u"){const q=document.querySelector(".xterm-helper-textarea");q&&typeof q.setAttribute=="function"&&(typeof q.blur=="function"&&q.blur(),q.setAttribute("disabled","true"))}}else typeof document<"u"&&(Ye.current=setTimeout(()=>{if(typeof document>"u")return;const q=document.querySelector(".xterm-helper-textarea");q&&(q.removeAttribute("disabled"),q.focus())},300));return()=>{Ye.current&&(clearTimeout(Ye.current),Ye.current=null)}},[i,l,r,o,f,p,y,h,d,w,x,S,L,M,O,F,I,P,e]),E.useEffect(()=>{if(!e||typeof window>"u"||typeof window.addEventListener!="function")return;const q=tt=>{tt.key==="Escape"&&(typeof tt.stopPropagation=="function"&&tt.stopPropagation(),t())};return window.addEventListener("keydown",q),()=>window.removeEventListener("keydown",q)},[e,t]),!e)return null;const $t=q=>{q.preventDefault();const tt=j.trim(),Jr=Y!==p;n(tt||Th),a(V),s(Q),c(B),u(U),_(Y),v(fe),m(le),g(pe),b(ie),C(de),k(ge),A(Le),D(je),z(Oe),H(Te),R(ee),N(Ne),t({webglChanged:Jr})},_t=(q,tt)=>{Z(Jr=>Jr.map(Qr=>Qr.id===q?{...Qr,...tt}:Qr))},zt=q=>{var Qr;const tt=V.find(Rs=>Rs.id===q);if(!tt||tt.isBuiltIn)return;const Jr=V.filter(Rs=>Rs.id!==q);Z(Jr),q===Q&&$(((Qr=Jr[0])==null?void 0:Qr.id)||"claude")},It=()=>{if(!Me.trim()||!Ue.trim()||V.length>=si)return;const q={id:`custom-${Date.now()}-${Math.random().toString(36).slice(2,6)}`,label:Me.trim(),command:Ue.trim(),isBuiltIn:!1,agentType:Ae||void 0};Z([...V,q]),Ie(!1),et(""),Re(""),Ve("")},wn=V.length<si,Ts=q=>{ne(!0),X(q),fetch("/api/settings/tmux-mouse-mode",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({enabled:q})}).catch(()=>X(!q)).finally(()=>ne(!1))},ca=q=>{const tt=ue;ze(!0),ke(q),fetch("/api/settings/inactive-max-age-hours",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({hours:q})}).catch(()=>ke(tt)).finally(()=>ze(!1))};return T.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/60 p-4",onClick:q=>{q.target===q.currentTarget&&t()},children:T.jsxs("form",{onSubmit:$t,className:"w-full max-w-lg max-h-[90vh] flex flex-col border border-border bg-elevated",children:[T.jsxs("div",{className:"p-6 pb-0",children:[T.jsx("h2",{className:"text-sm font-semibold uppercase tracking-wider text-primary text-balance",children:"Settings"}),T.jsx("p",{className:"mt-2 text-xs text-muted text-pretty",children:"Configure default directory, command presets, and display options."})]}),T.jsx("div",{className:"flex-1 overflow-y-auto px-6 pb-4",children:T.jsxs("div",{className:"mt-5 space-y-4",children:[T.jsxs("div",{children:[T.jsx("label",{className:"mb-1.5 block text-xs text-secondary",children:"Default Project Directory"}),T.jsx("input",{value:j,onChange:q=>W(q.target.value),placeholder:Th,className:"input",autoFocus:!0})]}),T.jsxs("div",{className:"border-t border-border pt-4",children:[T.jsxs("div",{className:"flex items-center justify-between mb-2",children:[T.jsx("label",{className:"text-xs text-secondary",children:"Command Presets"}),T.jsx("select",{value:Q,onChange:q=>$(q.target.value),className:"input text-xs py-1 px-2 w-auto",children:V.map(q=>T.jsx("option",{value:q.id,children:q.label},q.id))})]}),T.jsx("p",{className:"text-[10px] text-muted mb-3",children:"Default preset is pre-selected when creating new sessions."}),T.jsx("div",{className:"space-y-3",children:V.map(q=>T.jsxs("div",{className:"border border-border p-3 space-y-2",children:[T.jsxs("div",{className:"flex items-center justify-between",children:[T.jsx("div",{className:"flex items-center gap-2",children:T.jsx("input",{value:q.label,onChange:tt=>_t(q.id,{label:tt.target.value}),className:"input text-sm py-1 px-2 w-32",placeholder:"Label"})}),!q.isBuiltIn&&T.jsx("button",{type:"button",onClick:()=>zt(q.id),className:"btn text-xs px-2 py-1 text-error hover:bg-error/10",children:"Delete"})]}),T.jsxs("div",{children:[T.jsx("label",{className:"text-[10px] text-muted block mb-1",children:"Command"}),T.jsx("input",{value:q.command,onChange:tt=>_t(q.id,{command:tt.target.value}),className:"input text-xs py-1 px-2 font-mono w-full",placeholder:"command --flags"})]}),!q.isBuiltIn&&T.jsxs("div",{children:[T.jsx("label",{className:"text-[10px] text-muted block mb-1",children:"Icon"}),T.jsxs("select",{value:q.agentType||"",onChange:tt=>_t(q.id,{agentType:tt.target.value||void 0}),className:"input text-xs py-1 px-2 w-auto",children:[T.jsx("option",{value:"",children:"Terminal"}),T.jsx("option",{value:"claude",children:"Claude"}),T.jsx("option",{value:"codex",children:"Codex"})]})]})]},q.id))}),We?T.jsxs("div",{className:"mt-3 border border-border p-3 space-y-2",children:[T.jsx("div",{className:"text-xs text-secondary mb-2",children:"New Preset"}),T.jsx("input",{value:Me,onChange:q=>et(q.target.value),className:"input text-xs py-1 px-2 w-full",placeholder:"Label"}),T.jsx("input",{value:Ue,onChange:q=>Re(q.target.value),className:"input text-xs py-1 px-2 font-mono w-full",placeholder:"command --flags"}),T.jsxs("div",{className:"flex items-center gap-2",children:[T.jsxs("select",{value:Ae,onChange:q=>Ve(q.target.value),className:"input text-xs py-1 px-2 w-auto",children:[T.jsx("option",{value:"",children:"Terminal Icon"}),T.jsx("option",{value:"claude",children:"Claude Icon"}),T.jsx("option",{value:"codex",children:"Codex Icon"})]}),T.jsx("div",{className:"flex-1"}),T.jsx("button",{type:"button",onClick:()=>Ie(!1),className:"btn text-xs px-2 py-1",children:"Cancel"}),T.jsx("button",{type:"button",onClick:It,disabled:!Me.trim()||!Ue.trim(),className:"btn btn-primary text-xs px-2 py-1",children:"Add"})]})]}):T.jsx("button",{type:"button",onClick:()=>Ie(!0),disabled:!wn,className:"btn text-xs mt-3 w-full",children:wn?"+ Add Preset":`Max ${si} presets`})]}),T.jsxs("div",{className:"border-t border-border pt-4",children:[T.jsx("label",{className:"mb-2 block text-xs text-secondary",children:"Session List Order"}),T.jsxs("div",{className:"flex gap-2",children:[T.jsx("button",{type:"button",className:`btn flex-1 ${B==="created"?"btn-primary":""}`,onClick:()=>G("created"),children:"Created"}),T.jsx("button",{type:"button",className:`btn flex-1 ${B==="status"?"btn-primary":""}`,onClick:()=>G("status"),children:"Status"}),T.jsx("button",{type:"button",className:`btn flex-1 ${B==="manual"?"btn-primary":""}`,onClick:()=>G("manual"),children:"Manual"})]}),T.jsx("p",{className:"mt-1.5 text-[10px] text-muted",children:B==="status"?"Sessions auto-resort by status (waiting, working, unknown)":B==="manual"?"Drag sessions to reorder manually":"Sessions stay in creation order"})]}),B==="created"&&T.jsxs("div",{children:[T.jsx("label",{className:"mb-2 block text-xs text-secondary",children:"Sort Direction"}),T.jsxs("div",{className:"flex gap-2",children:[T.jsx("button",{type:"button",className:`btn flex-1 ${U==="desc"?"btn-primary":""}`,onClick:()=>te("desc"),children:"Newest First"}),T.jsx("button",{type:"button",className:`btn flex-1 ${U==="asc"?"btn-primary":""}`,onClick:()=>te("asc"),children:"Oldest First"})]})]}),T.jsxs("div",{className:"border-t border-border pt-4 space-y-3",children:[T.jsx("label",{className:"mb-1 block text-xs text-secondary",children:"Session List Details"}),T.jsxs("div",{className:"flex items-center justify-between",children:[T.jsxs("div",{children:[T.jsx("div",{className:"text-sm text-primary",children:"Project Name"}),T.jsx("div",{className:"text-[10px] text-muted",children:"Show the project folder name under each session."})]}),T.jsx(Cn,{checked:Le,onCheckedChange:He})]}),T.jsxs("div",{className:"flex items-center justify-between",children:[T.jsxs("div",{children:[T.jsx("div",{className:"text-sm text-primary",children:"Last User Message"}),T.jsx("div",{className:"text-[10px] text-muted",children:"Show the most recent user input next to the project name."})]}),T.jsx(Cn,{checked:je,onCheckedChange:Pe})]}),T.jsxs("div",{className:"flex items-center justify-between",children:[T.jsxs("div",{children:[T.jsx("div",{className:"text-sm text-primary",children:"Session ID Prefix"}),T.jsx("div",{className:"text-[10px] text-muted",children:"Show first 5 characters of agent session IDs in the list."})]}),T.jsx(Cn,{checked:Oe,onCheckedChange:Ce})]}),T.jsxs("div",{className:"flex items-center justify-between",children:[T.jsxs("div",{children:[T.jsx("div",{className:"text-sm text-primary",children:"Inactive Sessions Lookback"}),T.jsxs("div",{className:"text-[10px] text-muted",children:["Show inactive sessions from the last N hours (",Cu,"-",Eu,")."]})]}),T.jsxs("div",{className:"flex items-center gap-2",children:[T.jsx("input",{type:"number",min:Cu,max:Eu,value:ue,onChange:q=>{const tt=parseInt(q.target.value,10);tt>=Cu&&tt<=Eu&&ca(tt)},disabled:De,className:"input text-xs py-1 px-2 w-16 text-center"}),T.jsx("span",{className:"text-xs text-muted",children:"hrs"})]})]})]}),T.jsxs("div",{className:"border-t border-border pt-4 space-y-3",children:[T.jsx("label",{className:"mb-1 block text-xs text-secondary",children:"Notifications"}),T.jsxs("div",{className:"flex items-center justify-between",children:[T.jsxs("div",{className:"flex-1",children:[T.jsx("div",{className:"text-sm text-primary",children:"Permission Sound"}),T.jsx("div",{className:"text-[10px] text-muted",children:"Play a ping when any session needs permission."})]}),T.jsxs("div",{className:"flex items-center gap-2",children:[T.jsx("button",{type:"button",onClick:()=>void pd(),className:"btn text-xs px-2 py-1",children:"Test"}),T.jsx(Cn,{checked:ee,onCheckedChange:q=>{$e(q),q&&fd()}})]})]}),T.jsxs("div",{className:"flex items-center justify-between",children:[T.jsxs("div",{className:"flex-1",children:[T.jsx("div",{className:"text-sm text-primary",children:"Idle Sound"}),T.jsx("div",{className:"text-[10px] text-muted",children:"Play a chime when a session finishes working."})]}),T.jsxs("div",{className:"flex items-center gap-2",children:[T.jsx("button",{type:"button",onClick:()=>void md(),className:"btn text-xs px-2 py-1",children:"Test"}),T.jsx(Cn,{checked:Ne,onCheckedChange:q=>{K(q),q&&fd()}})]})]})]}),T.jsxs("div",{className:"border-t border-border pt-4",children:[T.jsx("label",{className:"mb-2 block text-xs text-secondary",children:"Terminal Rendering"}),T.jsxs("div",{className:"flex items-center justify-between",children:[T.jsxs("div",{children:[T.jsx("div",{className:"text-sm text-primary",children:"WebGL Acceleration"}),T.jsx("div",{className:"text-[10px] text-muted",children:"GPU rendering for better performance. Turn off if text looks fuzzy or flickering."})]}),T.jsx(Cn,{checked:Y,onCheckedChange:_e})]}),Y!==p&&T.jsx("p",{className:"mt-2 text-[10px] text-approval",children:"Terminal will reload when saved"}),T.jsxs("div",{className:"mt-4 flex items-center justify-between",children:[T.jsxs("div",{children:[T.jsx("div",{className:"text-sm text-primary",children:"Mouse Mode"}),T.jsx("div",{className:"text-[10px] text-muted",children:"Enable tmux mouse mode for trackpad/scroll wheel support."})]}),T.jsx(Cn,{checked:he,onCheckedChange:Ts,disabled:ye})]}),T.jsxs("div",{className:"mt-4 flex items-center justify-between",children:[T.jsxs("div",{children:[T.jsx("div",{className:"text-sm text-primary",children:"Font Size"}),T.jsx("div",{className:"text-[10px] text-muted",children:"Terminal text size in pixels (6-24)"})]}),T.jsxs("div",{className:"flex items-center gap-2",children:[T.jsx("button",{type:"button",onClick:()=>re(Math.max(6,fe-1)),className:"flex h-7 w-7 items-center justify-center rounded bg-surface border border-border text-secondary hover:bg-hover",children:T.jsx("span",{className:"text-sm font-bold",children:"−"})}),T.jsx("span",{className:"text-sm text-secondary w-6 text-center",children:fe}),T.jsx("button",{type:"button",onClick:()=>re(Math.min(24,fe+1)),className:"flex h-7 w-7 items-center justify-center rounded bg-surface border border-border text-secondary hover:bg-hover",children:T.jsx("span",{className:"text-sm font-bold",children:"+"})})]})]}),T.jsxs("div",{className:"mt-4 flex items-center justify-between",children:[T.jsxs("div",{children:[T.jsx("div",{className:"text-sm text-primary",children:"Line Height"}),T.jsx("div",{className:"text-[10px] text-muted",children:"Vertical spacing (1.0 = compact, 2.0 = spacious)"})]}),T.jsxs("div",{className:"flex items-center gap-2",children:[T.jsx("input",{type:"range",min:"1.0",max:"2.0",step:"0.1",value:le,onChange:q=>se(parseFloat(q.target.value)),className:"w-20 h-1 bg-border rounded-lg appearance-none cursor-pointer accent-accent"}),T.jsx("span",{className:"text-xs text-secondary w-8 text-right",children:le.toFixed(1)})]})]}),T.jsxs("div",{className:"mt-4 flex items-center justify-between",children:[T.jsxs("div",{children:[T.jsx("div",{className:"text-sm text-primary",children:"Letter Spacing"}),T.jsx("div",{className:"text-[10px] text-muted",children:"Horizontal spacing between characters in pixels"})]}),T.jsxs("div",{className:"flex items-center gap-2",children:[T.jsx("input",{type:"range",min:"-3",max:"3",step:"1",value:pe,onChange:q=>ve(parseInt(q.target.value,10)),className:"w-20 h-1 bg-border rounded-lg appearance-none cursor-pointer accent-accent"}),T.jsxs("span",{className:"text-xs text-secondary w-8 text-right",children:[pe,"px"]})]})]}),T.jsxs("div",{className:"mt-4",children:[T.jsxs("div",{className:"flex items-center justify-between",children:[T.jsxs("div",{children:[T.jsx("div",{className:"text-sm text-primary",children:"Font Family"}),T.jsx("div",{className:"text-[10px] text-muted",children:"Terminal typeface"})]}),T.jsx("select",{value:ie,onChange:q=>oe(q.target.value),className:"input text-xs py-1 px-2 w-auto",children:Rh.map(q=>T.jsx("option",{value:q.id,children:q.label},q.id))})]}),ie==="custom"&&T.jsx("input",{value:de,onChange:q=>ae(q.target.value),placeholder:'"Fira Code", monospace',className:"input text-xs mt-2 font-mono"})]}),T.jsxs("div",{className:"mt-4 flex items-center justify-between",children:[T.jsxs("div",{children:[T.jsx("div",{className:"text-sm text-primary",children:"Dark Mode"}),T.jsx("div",{className:"text-[10px] text-muted",children:"Switch between dark and light themes."})]}),T.jsx(Cn,{checked:Te==="dark",onCheckedChange:q=>J(q?"dark":"light")})]})]}),T.jsxs("div",{className:"border-t border-border pt-4",children:[T.jsx("label",{className:"mb-2 block text-xs text-secondary",children:"Keyboard Shortcut Modifier"}),T.jsx("div",{className:"grid grid-cols-5 gap-1",children:["auto","ctrl-option","ctrl-shift","cmd-option","cmd-shift"].map(q=>T.jsx("button",{type:"button",className:`btn text-xs px-2 ${ge===q?"btn-primary":""}`,onClick:()=>Ee(q),children:q==="auto"?"Auto":ii(q)},q))}),T.jsx("p",{className:"mt-1.5 text-[10px] text-muted",children:ge==="auto"?`Platform default: ${ii(ea("auto"))}`:`Shortcuts: ${ii(ge)}+[N/X/[/]]`})]})]})}),T.jsxs("div",{className:"flex justify-end gap-2 p-6 pt-4 border-t border-border bg-elevated",children:[T.jsx("button",{type:"button",onClick:()=>t(),className:"btn",children:"Cancel"}),T.jsx("button",{type:"submit",className:"btn btn-primary",children:"Save"})]})]})})}const eA=[];function gp(e){E.useEffect(e,eA)}const vp=E.createContext(void 0);function _p(){const e=E.useContext(vp);if(!e)throw new Error(Yr(73));return e}var Ql=Symbol("NOT_FOUND");function tA(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!="function")throw new TypeError(t)}function rA(e,t=`expected an object, instead received ${typeof e}`){if(typeof e!="object")throw new TypeError(t)}function nA(e,t="expected all items to be functions, instead received the following types: "){if(!e.every(r=>typeof r=="function")){const r=e.map(n=>typeof n=="function"?`function ${n.name||"unnamed"}()`:typeof n).join(", ");throw new TypeError(`${t}[${r}]`)}}var Ov=e=>Array.isArray(e)?e:[e];function sA(e){const t=Array.isArray(e[0])?e[0]:e;return nA(t,"createSelector expects all input-selectors to be functions, but received the following types: "),t}function iA(e,t){const r=[],{length:n}=e;for(let i=0;i<n;i++)r.push(e[i].apply(null,t));return r}function oA(e){let t;return{get(r){return t&&e(t.key,r)?t.value:Ql},put(r,n){t={key:r,value:n}},getEntries(){return t?[t]:[]},clear(){t=void 0}}}function aA(e,t){let r=[];function n(s){const o=r.findIndex(c=>t(s,c.key));if(o>-1){const c=r[o];return o>0&&(r.splice(o,1),r.unshift(c)),c.value}return Ql}function i(s,o){n(s)===Ql&&(r.unshift({key:s,value:o}),r.length>e&&r.pop())}function a(){return r}function l(){r=[]}return{get:n,put:i,getEntries:a,clear:l}}var lA=(e,t)=>e===t;function cA(e){return function(r,n){if(r===null||n===null||r.length!==n.length)return!1;const{length:i}=r;for(let a=0;a<i;a++)if(!e(r[a],n[a]))return!1;return!0}}function uA(e,t){const r=typeof t=="object"?t:{equalityCheck:t},{equalityCheck:n=lA,maxSize:i=1,resultEqualityCheck:a}=r,l=cA(n);let s=0;const o=i<=1?oA(l):aA(i,l);function c(){let f=o.get(arguments);if(f===Ql){if(f=e.apply(null,arguments),s++,a){const p=o.getEntries().find(_=>a(_.value,f));p&&(f=p.value,s!==0&&s--)}o.put(arguments,f)}return f}return c.clearCache=()=>{o.clear(),c.resetResultsCount()},c.resultsCount=()=>s,c.resetResultsCount=()=>{s=0},c}var hA=class{constructor(e){this.value=e}deref(){return this.value}},dA=typeof WeakRef<"u"?WeakRef:hA,fA=0,Bv=1;function Ha(){return{s:fA,v:void 0,o:null,p:null}}function hS(e,t={}){let r=Ha();const{resultEqualityCheck:n}=t;let i,a=0;function l(){var u;let s=r;const{length:o}=arguments;for(let p=0,_=o;p<_;p++){const y=arguments[p];if(typeof y=="function"||typeof y=="object"&&y!==null){let v=s.o;v===null&&(s.o=v=new WeakMap);const h=v.get(y);h===void 0?(s=Ha(),v.set(y,s)):s=h}else{let v=s.p;v===null&&(s.p=v=new Map);const h=v.get(y);h===void 0?(s=Ha(),v.set(y,s)):s=h}}const c=s;let f;if(s.s===Bv)f=s.v;else if(f=e.apply(null,arguments),a++,n){const p=((u=i==null?void 0:i.deref)==null?void 0:u.call(i))??i;p!=null&&n(p,f)&&(f=p,a!==0&&a--),i=typeof f=="object"&&f!==null||typeof f=="function"?new dA(f):f}return c.s=Bv,c.v=f,f}return l.clearCache=()=>{r=Ha(),l.resetResultsCount()},l.resultsCount=()=>a,l.resetResultsCount=()=>{a=0},l}function dS(e,...t){const r=typeof e=="function"?{memoize:e,memoizeOptions:t}:e,n=(...i)=>{let a=0,l=0,s,o={},c=i.pop();typeof c=="object"&&(o=c,c=i.pop()),tA(c,`createSelector expects an output function after the inputs, but received: [${typeof c}]`);const f={...r,...o},{memoize:u,memoizeOptions:p=[],argsMemoize:_=hS,argsMemoizeOptions:y=[]}=f,v=Ov(p),h=Ov(y),m=sA(i),d=u(function(){return a++,c.apply(null,arguments)},...v),g=_(function(){l++;const b=iA(m,arguments);return s=d.apply(null,b),s},...h);return Object.assign(g,{resultFunc:c,memoizedResultFunc:d,dependencies:m,dependencyRecomputations:()=>l,resetDependencyRecomputations:()=>{l=0},lastResult:()=>s,recomputations:()=>a,resetRecomputations:()=>{a=0},memoize:u,argsMemoize:_})};return Object.assign(n,{withTypes:()=>n}),n}var pA=dS(hS),mA=Object.assign((e,t=pA)=>{rA(e,`createStructuredSelector expects first argument to be an object where each property is a selector, instead received a ${typeof e}`);const r=Object.keys(e),n=r.map(a=>e[a]);return t(n,(...a)=>a.reduce((l,s,o)=>(l[r[o]]=s,l),{}))},{withTypes:()=>mA});const gA=dS({memoize:uA,memoizeOptions:{maxSize:1,equalityCheck:Object.is}}),Tr=(e,t,r,n,i,a,...l)=>{if(l.length>0)throw new Error(Yr(1));let s;if(e&&t)s=(o,c,f,u)=>{const p=e(o,c,f,u);return t(p,c,f,u)};else if(e)s=e;else throw new Error("Missing arguments");return s},vA=(...e)=>{const t=new WeakMap;let r=1;const n=e[e.length-1],i=e.length-1||1,a=n.length-i;if(a>3)throw new Error(Yr(2));return(s,o,c,f)=>{let u=s.__cacheKey__;u||(u={id:r},s.__cacheKey__=u,r+=1);let p=t.get(u);if(!p){let _=e;const y=[void 0,void 0,void 0];switch(a){case 0:break;case 1:{_=[...e.slice(0,-1),()=>y[0],n];break}case 2:{_=[...e.slice(0,-1),()=>y[0],()=>y[1],n];break}case 3:{_=[...e.slice(0,-1),()=>y[0],()=>y[1],()=>y[2],n];break}default:throw new Error(Yr(2))}p=gA(..._),p.selectorArgs=y,t.set(u,p)}switch(p.selectorArgs[0]=o,p.selectorArgs[1]=c,p.selectorArgs[2]=f,a){case 0:return p(s);case 1:return p(s,o);case 2:return p(s,o,c);case 3:return p(s,o,c,f);default:throw new Error("unreachable")}}};var fS={exports:{}},pS={};/**
|
|
299
|
+
${re?dM[X.status]:hM[X.status]}
|
|
300
|
+
`,onClick:()=>{bv(),o(X.id)},children:_e+1},X.id)})})]}),T.jsxs("div",{className:"relative flex-1",children:[T.jsx("div",{ref:ue,className:"absolute inset-0"}),!e&&T.jsx("div",{className:"absolute inset-0 flex items-center justify-center text-sm text-muted",children:"Select a session to view terminal"}),e&&oe&&T.jsx("div",{className:"absolute inset-0 flex items-center justify-center text-center text-sm text-muted",children:"Remote session (read-only). Use SSH to attach on the host."}),O&&e&&!F&&T.jsxs("button",{onClick:fe,className:"absolute bottom-8 left-1/2 z-20 flex h-10 px-4 items-center justify-center gap-1.5 rounded-full bg-blue-600/90 text-white shadow-lg hover:bg-blue-600 active:scale-95 transition-all",style:{transform:"translateX(-50%)"},title:"Scroll to bottom","aria-label":"Scroll to bottom",children:[T.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:T.jsx("path",{d:"M12 5v14M5 12l7 7 7-7"})}),T.jsx("span",{className:"text-sm font-medium",children:"Jump to bottom"})]})]}),e&&T.jsx(aM,{onSendKey:ee,disabled:n!=="connected"||oe,sessions:t.map(X=>({id:X.id,name:X.name,status:X.status})),currentSessionId:e.id,onSelectSession:o,hideSessionSwitcher:!0,onRefocus:Be,isKeyboardVisible:de,onEnterTextMode:q}),(D||M)&&T.jsx(lM,{isOpen:j,onClose:()=>W(!1),sessions:t,inactiveSessions:r,selectedSessionId:(e==null?void 0:e.id)??null,onSelect:o,onRename:u,onResume:p,onSetPinned:_,onNewSession:c,loading:v,error:h}),I&&e&&T.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/50",children:T.jsxs("div",{className:"mx-4 w-full max-w-sm rounded-lg border border-border bg-elevated p-4 shadow-xl",children:[T.jsx("h3",{className:"text-base font-medium text-primary mb-2 text-balance",children:"Kill Session"}),T.jsxs("p",{className:"text-sm text-secondary mb-4 text-pretty",children:['Kill "',e.agentSessionName||e.name,'"? The process will be terminated. Conversation history is preserved in logs.']}),T.jsxs("div",{className:"flex justify-end gap-2",children:[T.jsx("button",{onClick:()=>R(!1),className:"btn py-1.5 px-3 text-sm",children:"Cancel"}),T.jsx("button",{ref:Y,onClick:je,className:"btn btn-danger py-1.5 px-3 text-sm",children:"Kill Session"})]})]})})]})}function pM({onSelect:e,onCancel:t,initialPath:r}){const[n,i]=E.useState(r||"~"),[a,l]=E.useState(null),[s,o]=E.useState(null),[c,f]=E.useState(!0),[u,p]=E.useState(-1),_=E.useRef(null),y=me(g=>g.recentPaths),v=E.useCallback(async g=>{var x;(x=_.current)==null||x.abort();const w=new AbortController;_.current=w;const{signal:b}=w;f(!0),o(null),l(null),p(-1),i(g);try{const C=await fetch(`/api/directories?path=${encodeURIComponent(g)}`,{signal:b});if(!C.ok){const k=await C.json();throw new Error(k.message||"Failed to load directory")}const S=await C.json();if(_.current!==w)return;l(S),i(S.path)}catch(C){if(_.current!==w)return;const S=C;(S==null?void 0:S.name)!=="AbortError"&&o((S==null?void 0:S.message)||"Failed to load directory")}finally{_.current===w&&f(!1)}},[]);E.useEffect(()=>(v(r||"~"),()=>{var g;(g=_.current)==null||g.abort()}),[v,r]);const h=(a==null?void 0:a.directories)??[],m=(a==null?void 0:a.path)||n,d=a==null?void 0:a.parent;return E.useEffect(()=>{const g=w=>{if(w.key==="Escape"){w.preventDefault(),t();return}if(!c){if(w.key==="ArrowDown"){w.preventDefault(),p(b=>h.length===0?-1:b<0?0:Math.min(b+1,h.length-1));return}if(w.key==="ArrowUp"){w.preventDefault(),p(b=>h.length===0?-1:b<0?h.length-1:Math.max(b-1,0));return}if(w.key==="Enter"){w.preventDefault();const b=h[u];b?v(b.path):m&&e(m);return}w.key==="Backspace"&&d&&(w.preventDefault(),v(d))}};return window.addEventListener("keydown",g),()=>window.removeEventListener("keydown",g)},[h,m,v,u,c,t,e,d]),T.jsx("div",{role:"dialog","aria-modal":"true","aria-label":"Directory browser",className:"fixed inset-0 z-[60] flex items-center justify-center bg-black/60 p-4",onClick:g=>{g.target===g.currentTarget&&t()},"data-testid":"directory-browser",children:T.jsxs("div",{className:"w-full max-w-lg border border-border bg-elevated p-4",children:[T.jsxs("div",{className:"flex items-center gap-3 border-b border-border pb-2",children:[T.jsx("button",{type:"button",className:"btn",onClick:()=>{d&&v(d)},disabled:!d||c,children:"Up"}),T.jsx("div",{className:"min-w-0 flex-1 truncate text-xs font-mono text-secondary",title:m,"data-testid":"directory-current-path",children:m})]}),T.jsx("div",{className:"mt-3 max-h-60 overflow-y-auto border border-border bg-surface",children:c?T.jsx("div",{className:"px-3 py-4 text-xs text-muted","data-testid":"directory-loading",children:"Loading directories..."}):s?T.jsxs("div",{className:"px-3 py-4 text-xs","data-testid":"directory-error",children:[T.jsx("p",{className:"text-danger",children:s}),T.jsx("button",{type:"button",className:"btn mt-3",onClick:()=>v(n),children:"Retry"})]}):h.length===0?T.jsx("div",{className:"px-3 py-4 text-xs text-muted","data-testid":"directory-empty",children:"No subdirectories"}):T.jsx("div",{className:"py-1",children:h.map((g,w)=>T.jsxs("button",{type:"button",onClick:()=>v(g.path),onMouseEnter:()=>p(w),className:`flex w-full items-center gap-2 px-3 py-2 text-left text-xs ${w===u?"bg-hover text-primary":"text-secondary"}`,"data-testid":"directory-entry","data-entry-name":g.name,"data-entry-path":g.path,children:[T.jsx(EC,{width:14,height:14,className:"shrink-0 text-muted","aria-hidden":"true"}),T.jsx("span",{className:"truncate",children:g.name})]},g.path))})}),a!=null&&a.truncated?T.jsx("p",{className:"mt-2 text-[10px] text-muted",children:"Showing first 200 directories."}):null,T.jsxs("div",{className:"mt-4 border-t border-border pt-3",children:[T.jsx("div",{className:"text-[10px] uppercase tracking-wider text-secondary",children:"Recent"}),y.length===0?T.jsx("p",{className:"mt-2 text-xs text-muted",children:"No recent paths yet."}):T.jsx("div",{className:"mt-2 space-y-1",children:y.map(g=>T.jsx("button",{type:"button",className:"block w-full truncate text-left text-xs text-secondary hover:text-primary",onClick:()=>v(g),title:g,"data-testid":"directory-recent","data-recent-path":g,children:g},g))})]}),T.jsxs("div",{className:"mt-4 flex justify-end gap-2",children:[T.jsx("button",{type:"button",onClick:t,className:"btn",children:"Cancel"}),T.jsx("button",{type:"button",onClick:()=>{m&&e(m)},className:"btn btn-primary",disabled:c||!m,children:"Select"})]})]})})}function mM({isOpen:e,onClose:t,onCreate:r,defaultProjectDir:n,commandPresets:i,defaultPresetId:a,lastProjectPath:l,activeProjectPath:s,remoteHosts:o=[],remoteAllowControl:c=!1,initialHost:f,initialPath:u,initialCommand:p}){const[_,y]=E.useState(""),[v,h]=E.useState(""),[m,d]=E.useState(null),[g,w]=E.useState(""),[b,x]=E.useState(!1),[C,S]=E.useState(""),k=E.useRef(null),L=E.useRef(null),A=E.useRef(null),M=c&&o.length>0;if(E.useEffect(()=>{if(!e){y(""),h(""),d(null),w(""),x(!1),S(f??""),setTimeout(()=>{if(typeof document>"u"||typeof document.querySelector!="function")return;const W=document.querySelector(".xterm-helper-textarea");W&&(W.removeAttribute("disabled"),W.focus())},300);return}if(typeof document<"u"&&typeof document.querySelector=="function"){const W=document.querySelector(".xterm-helper-textarea");W&&typeof W.setAttribute=="function"&&(typeof W.blur=="function"&&W.blur(),W.setAttribute("disabled","true"))}const N=(u==null?void 0:u.trim())||(s==null?void 0:s.trim())||l||n||"";y(N),h(""),S(f??"");const j=p==null?void 0:p.trim();if(j){const W=i.find(V=>Hi(V)===j);W?(d(W.id),w(Hi(W))):(d(null),w(j))}else{const W=i.find(V=>V.id===a);W?(d(a),w(Hi(W))):i.length>0?(d(i[0].id),w(Hi(i[0]))):(d(null),w(""))}setTimeout(()=>{var W;if((W=A.current)==null||W.focus(),L.current){const V=L.current;V.scrollLeft=V.scrollWidth}},50)},[s,i,a,n,e,l,f,u,p]),E.useEffect(()=>{if(!e||typeof window>"u"||typeof window.addEventListener!="function")return;const N=()=>k.current?Array.from(k.current.querySelectorAll('input:not([disabled]), select:not([disabled]), button:not([disabled]):not([tabindex="-1"]), [tabindex="0"]')):[],j=W=>{var V,Z;if(!b){if(W.key==="Escape"){typeof W.stopPropagation=="function"&&W.stopPropagation(),t();return}if(W.key==="Enter"){const Q=document.activeElement;if(!Q||Q.tagName==="INPUT"||Q.closest('[data-testid="host-select"]')||!Q.closest('[data-testid="command-select"]'))return;W.preventDefault(),typeof W.stopPropagation=="function"&&W.stopPropagation(),(V=k.current)==null||V.requestSubmit();return}if(W.key==="Tab"){W.preventDefault(),typeof W.stopPropagation=="function"&&W.stopPropagation();const Q=N();if(Q.length===0)return;const $=document.activeElement,B=Q.indexOf($);let K;B===-1?K=W.shiftKey?Q.length-1:0:W.shiftKey?K=B<=0?Q.length-1:B-1:K=B>=Q.length-1?0:B+1,(Z=Q[K])==null||Z.focus()}}};return window.addEventListener("keydown",j),()=>window.removeEventListener("keydown",j)},[e,t,b]),!e)return null;const D=N=>{const j=i.find(W=>W.id===N);j&&(d(N),w(Hi(j)))},O=()=>{d(null),w("")},z=m===null,F=C!=="",H=N=>{N.preventDefault();const j=_.trim();if(!j)return;const W=g.trim();r(j,v.trim()||void 0,W||void 0,F?C:void 0),t()},I=[...i.map(N=>({id:N.id,label:N.label,isCustom:!1,agentType:N.agentType,command:N.command})),{id:"custom",label:"Custom",isCustom:!0,agentType:void 0,command:void 0}],R=[{id:"",label:"Local",ok:!0,error:void 0},...o.map(N=>({id:N.host,label:N.host,ok:N.ok,error:N.error}))],P=_.trim()||"~";return T.jsxs("div",{role:"dialog","aria-modal":"true","aria-labelledby":"new-session-title",className:"fixed inset-0 z-50 flex items-center justify-center bg-black/60 p-4",onClick:N=>{N.target===N.currentTarget&&t()},children:[T.jsxs("form",{ref:k,onSubmit:H,className:"w-full max-w-md border border-border bg-elevated p-6",children:[T.jsx("h2",{id:"new-session-title",className:"text-sm font-semibold uppercase tracking-wider text-primary text-balance",children:"New Session"}),T.jsxs("div",{className:"mt-4 space-y-4",children:[M&&T.jsxs("div",{children:[T.jsx("label",{className:"mb-1.5 block text-xs text-secondary",children:"Host"}),T.jsx("div",{className:"flex flex-wrap gap-2",role:"radiogroup","aria-label":"Host","data-testid":"host-select",children:R.map((N,j)=>{const W=C===N.id,V=!N.ok&&!W;return T.jsx("button",{type:"button",role:"radio","aria-checked":W,"aria-label":N.label,title:N.ok?void 0:N.error||"Unreachable",tabIndex:W?0:-1,onClick:()=>S(N.id),onKeyDown:Z=>{var U;let Q=j;if(Z.key==="ArrowRight"||Z.key==="ArrowDown")Z.preventDefault(),Q=(j+1)%R.length;else if(Z.key==="ArrowLeft"||Z.key==="ArrowUp")Z.preventDefault(),Q=(j-1+R.length)%R.length;else return;const $=R[Q];S($.id);const B=Z.currentTarget.parentElement,K=B==null?void 0:B.querySelectorAll('[role="radio"]');(U=K==null?void 0:K[Q])==null||U.focus()},className:`btn text-xs focus:outline-none focus:ring-2 focus:ring-primary ${W?"btn-primary":""} ${V?"opacity-60":""}`,children:N.label},N.id||"local")})})]}),T.jsxs("div",{children:[T.jsx("label",{className:"mb-1.5 block text-xs text-secondary",children:"Command"}),T.jsx("div",{className:"flex flex-wrap gap-2",role:"radiogroup","aria-label":"Command preset","data-testid":"command-select",children:I.map((N,j)=>{const W=N.isCustom?z:m===N.id;return T.jsxs("button",{ref:W?A:void 0,type:"button",role:"radio","aria-checked":W,tabIndex:W?0:-1,onClick:()=>{N.isCustom?O():D(N.id)},onKeyDown:V=>{var K;let Z=j;if(V.key==="ArrowRight"||V.key==="ArrowDown")V.preventDefault(),Z=(j+1)%I.length;else if(V.key==="ArrowLeft"||V.key==="ArrowUp")V.preventDefault(),Z=(j-1+I.length)%I.length;else return;const Q=I[Z];Q.isCustom?O():D(Q.id);const $=V.currentTarget.parentElement,B=$==null?void 0:$.querySelectorAll('[role="radio"]');(K=B==null?void 0:B[Z])==null||K.focus()},className:`btn text-xs focus:outline-none focus:ring-2 focus:ring-primary ${W?"btn-primary":""}`,children:[T.jsx(Cc,{agentType:N.agentType,command:N.command,className:"inline-block h-3.5 w-3.5 shrink-0"}),N.label]},N.id)})}),T.jsx("input",{value:g,onChange:N=>w(N.target.value),placeholder:"Enter command...",className:"input mt-2 font-mono text-xs"})]}),T.jsxs("div",{children:[T.jsx("label",{className:"mb-1.5 block text-xs text-secondary",children:"Project Path"}),T.jsxs("div",{className:"flex gap-2",children:[T.jsx("input",{ref:L,value:_,onChange:N=>y(N.target.value),placeholder:F?"/home/user/project":s||l||n||"/Users/you/code/my-project",className:"input flex-1 text-sm"}),!F&&T.jsx("button",{type:"button",className:"btn",onClick:()=>x(!0),children:"Browse"})]})]}),T.jsxs("div",{children:[T.jsx("label",{className:"mb-1.5 block text-xs text-secondary",children:"Display Name"}),T.jsx("input",{value:v,onChange:N=>h(N.target.value),placeholder:"auto-generated",className:"input text-sm placeholder:italic"})]})]}),T.jsxs("div",{className:"mt-6 flex justify-end gap-2",children:[T.jsx("button",{type:"button",onClick:t,className:"btn",children:"Cancel"}),T.jsx("button",{type:"submit",className:"btn btn-primary",children:"Create"})]})]}),b&&!F&&T.jsx(pM,{initialPath:P,onSelect:N=>{y(N),x(!1)},onCancel:()=>x(!1)})]})}const Cu=1,Eu=168;function gM({controlled:e,default:t,name:r,state:n="value"}){const{current:i}=E.useRef(e!==void 0),[a,l]=E.useState(t),s=i?e:a,o=E.useCallback(c=>{i||l(c)},[]);return[s,o]}const Cv={};function ks(e,t){const r=E.useRef(Cv);return r.current===Cv&&(r.current=e(t)),r}const ku=Jv[`useInsertionEffect${Math.random().toFixed(1)}`.slice(0,-3)],vM=ku&&ku!==E.useLayoutEffect?ku:e=>e();function Yr(e){const t=ks(_M).current;return t.next=e,vM(t.effect),t.trampoline}function _M(){const e={next:void 0,callback:yM,trampoline:(...t)=>{var r;return(r=e.callback)==null?void 0:r.call(e,...t)},effect:()=>{e.callback=e.next}};return e}function yM(){}function ld(e,t,r,n){const i=ks(Fw).current;return SM(i,e,t,r,n)&&Hw(i,[e,t,r,n]),i.callback}function wM(e){const t=ks(Fw).current;return xM(t,e)&&Hw(t,e),t.callback}function Fw(){return{callback:null,cleanup:null,refs:[]}}function SM(e,t,r,n,i){return e.refs[0]!==t||e.refs[1]!==r||e.refs[2]!==n||e.refs[3]!==i}function xM(e,t){return e.refs.length!==t.length||e.refs.some((r,n)=>r!==t[n])}function Hw(e,t){if(e.refs=t,t.every(r=>r==null)){e.callback=null;return}e.callback=r=>{if(e.cleanup&&(e.cleanup(),e.cleanup=null),r!=null){const n=Array(t.length).fill(null);for(let i=0;i<t.length;i+=1){const a=t[i];if(a!=null)switch(typeof a){case"function":{const l=a(r);typeof l=="function"&&(n[i]=l);break}case"object":{a.current=r;break}}}e.cleanup=()=>{for(let i=0;i<t.length;i+=1){const a=t[i];if(a!=null)switch(typeof a){case"function":{const l=n[i];typeof l=="function"?l():a(null);break}case"object":{a.current=null;break}}}}}}}const bM=()=>{},qt=typeof document<"u"?E.useLayoutEffect:bM,$w={clipPath:"inset(50%)",overflow:"hidden",whiteSpace:"nowrap",border:0,padding:0,width:1,height:1,margin:-1},ap={...$w,position:"fixed",top:0,left:0},CM={...$w,position:"absolute"};function ur(){}const Ur=Object.freeze({});function Jr(e,...t){const r=new URL("https://base-ui.com/production-error");return r.searchParams.set("code",e.toString()),t.forEach(n=>r.searchParams.append("args[]",n)),`Base UI error #${e}; visit ${r} for the full message.`}const EM=parseInt(E.version,10);function lp(e){return EM>=e}function Ev(e){if(!E.isValidElement(e))return null;const t=e,r=t.props;return(lp(19)?r==null?void 0:r.ref:t.ref)??null}function cd(e,t){if(e&&!t)return e;if(!e&&t)return t;if(e||t)return{...e,...t}}function kM(e,t){const r={};for(const n in e){const i=e[n];if(t!=null&&t.hasOwnProperty(n)){const a=t[n](i);a!=null&&Object.assign(r,a);continue}i===!0?r[`data-${n.toLowerCase()}`]="":i&&(r[`data-${n.toLowerCase()}`]=i.toString())}return r}function LM(e,t){return typeof e=="function"?e(t):e}function TM(e,t){return typeof e=="function"?e(t):e}const _o={};function cp(e,t,r,n,i){let a={...ud(e,_o)};return t&&(a=ul(a,t)),r&&(a=ul(a,r)),n&&(a=ul(a,n)),a}function RM(e){if(e.length===0)return _o;if(e.length===1)return ud(e[0],_o);let t={...ud(e[0],_o)};for(let r=1;r<e.length;r+=1)t=ul(t,e[r]);return t}function ul(e,t){return zw(t)?t(e):DM(e,t)}function DM(e,t){if(!t)return e;for(const r in t){const n=t[r];switch(r){case"style":{e[r]=cd(e.style,n);break}case"className":{e[r]=Uw(e.className,n);break}default:MM(r,n)?e[r]=AM(e[r],n):e[r]=n}}return e}function MM(e,t){const r=e.charCodeAt(0),n=e.charCodeAt(1),i=e.charCodeAt(2);return r===111&&n===110&&i>=65&&i<=90&&(typeof t=="function"||typeof t>"u")}function zw(e){return typeof e=="function"}function ud(e,t){return zw(e)?e(t):e??_o}function AM(e,t){return t?e?r=>{if(PM(r)){const i=r;hd(i);const a=t(i);return i.baseUIHandlerPrevented||e==null||e(i),a}const n=t(r);return e==null||e(r),n}:t:e}function hd(e){return e.preventBaseUIHandler=()=>{e.baseUIHandlerPrevented=!0},e}function Uw(e,t){return t?e?t+" "+e:t:e}function PM(e){return e!=null&&typeof e=="object"&&"nativeEvent"in e}function Ls(e,t,r={}){const n=t.render,i=IM(t,r);if(r.enabled===!1)return null;const a=r.state??Ur;return BM(e,n,i,a)}function IM(e,t={}){const{className:r,style:n,render:i}=e,{state:a=Ur,ref:l,props:s,stateAttributesMapping:o,enabled:c=!0}=t,f=c?LM(r,a):void 0,u=c?TM(n,a):void 0,p=c?kM(a,o):Ur,_=c?cd(p,Array.isArray(s)?RM(s):s)??Ur:Ur;return typeof document<"u"&&(c?Array.isArray(l)?_.ref=wM([_.ref,Ev(i),...l]):_.ref=ld(_.ref,Ev(i),l):ld(null,null)),c?(f!==void 0&&(_.className=Uw(_.className,f)),u!==void 0&&(_.style=cd(_.style,u)),_):Ur}const OM=Symbol.for("react.lazy");function BM(e,t,r,n){if(t){if(typeof t=="function")return t(r,n);const i=cp(r,t.props);i.ref=r.ref;let a=t;return(a==null?void 0:a.$$typeof)===OM&&(a=E.Children.toArray(t)[0]),E.cloneElement(a,i)}if(e&&typeof e=="string")return NM(e,r);throw new Error(Jr(8))}function NM(e,t){return e==="button"?E.createElement("button",{type:"button",...t,key:t.key}):e==="img"?E.createElement("img",{alt:"",...t,key:t.key}):E.createElement(e,t)}const jM={...Jv};let kv=0;function FM(e,t="mui"){const[r,n]=E.useState(e),i=e||r;return E.useEffect(()=>{r==null&&(kv+=1,n(`${t}-${kv}`))},[r,t]),i}const Lv=jM.useId;function up(e,t){if(Lv!==void 0){const r=Lv();return e??(t?`${t}-${r}`:r)}return FM(e,t)}function Ww(e){return up(e,"base-ui")}function hp(){return typeof window<"u"}function Ko(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function HM(e){return hp()?e instanceof Element||e instanceof Ko(e).Element:!1}function $M(e){return hp()?e instanceof HTMLElement||e instanceof Ko(e).HTMLElement:!1}function zM(e){return!hp()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Ko(e).ShadowRoot}const UM=E.createContext(void 0);function WM(e=!1){const t=E.useContext(UM);if(t===void 0&&!e)throw new Error(Jr(16));return t}function VM(e){const{focusableWhenDisabled:t,disabled:r,composite:n=!1,tabIndex:i=0,isNativeButton:a}=e,l=n&&t!==!1,s=n&&t===!1;return{props:E.useMemo(()=>{const c={onKeyDown(f){r&&t&&f.key!=="Tab"&&f.preventDefault()}};return n||(c.tabIndex=i,!a&&r&&(c.tabIndex=t?i:-1)),(a&&(t||l)||!a&&r)&&(c["aria-disabled"]=r),a&&(!t||s)&&(c.disabled=r),c},[n,r,t,l,s,a,i])}}function Vw(e={}){const{disabled:t=!1,focusableWhenDisabled:r,tabIndex:n=0,native:i=!0}=e,a=E.useRef(null),l=WM(!0)!==void 0,s=Yr(()=>{const p=a.current;return!!((p==null?void 0:p.tagName)==="A"&&(p!=null&&p.href))}),{props:o}=VM({focusableWhenDisabled:r,disabled:t,composite:l,tabIndex:n,isNativeButton:i}),c=E.useCallback(()=>{const p=a.current;KM(p)&&l&&t&&o.disabled===void 0&&p.disabled&&(p.disabled=!1)},[t,o.disabled,l]);qt(c,[c]);const f=E.useCallback((p={})=>{const{onClick:_,onMouseDown:y,onKeyUp:v,onKeyDown:h,onPointerDown:m,...d}=p;return cp({type:i?"button":void 0,onClick(w){if(t){w.preventDefault();return}_==null||_(w)},onMouseDown(w){t||y==null||y(w)},onKeyDown(w){if(t||(hd(w),h==null||h(w)),w.baseUIHandlerPrevented)return;const b=w.target===w.currentTarget&&!i&&!s()&&!t,x=w.key==="Enter",C=w.key===" ";b&&((C||x)&&w.preventDefault(),x&&(_==null||_(w)))},onKeyUp(w){t||(hd(w),v==null||v(w)),!w.baseUIHandlerPrevented&&w.target===w.currentTarget&&!i&&!t&&w.key===" "&&(_==null||_(w))},onPointerDown(w){if(t){w.preventDefault();return}m==null||m(w)}},i?void 0:{role:"button"},o,d)},[t,o,i,s]),u=Yr(p=>{a.current=p,c()});return{getButtonProps:f,buttonRef:u}}function KM(e){return $M(e)&&e.tagName==="BUTTON"}const Kw=E.createContext(void 0);function GM(){const e=E.useContext(Kw);if(e===void 0)throw new Error(Jr(63));return e}let Tv=function(e){return e.disabled="data-disabled",e.valid="data-valid",e.invalid="data-invalid",e.touched="data-touched",e.dirty="data-dirty",e.filled="data-filled",e.focused="data-focused",e}({});const qM={badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valid:null,valueMissing:!1},XM={valid(e){return e===null?null:e?{[Tv.valid]:""}:{[Tv.invalid]:""}}};let Rv=function(e){return e.checked="data-checked",e.unchecked="data-unchecked",e.disabled="data-disabled",e.readonly="data-readonly",e.required="data-required",e.valid="data-valid",e.invalid="data-invalid",e.touched="data-touched",e.dirty="data-dirty",e.filled="data-filled",e.focused="data-focused",e}({});const Gw={...XM,checked(e){return e?{[Rv.checked]:""}:{[Rv.unchecked]:""}}};function YM(e,t){return{...e,state:{...e.state,valid:!t&&e.state.valid}}}const JM=E.createContext({formRef:{current:{fields:new Map}},errors:{},clearErrors:ur,validationMode:"onSubmit",submitAttemptedRef:{current:!1}});function qw(){return E.useContext(JM)}const QM=E.createContext({invalid:void 0,name:void 0,validityData:{state:qM,errors:[],error:"",value:"",initialValue:null},setValidityData:ur,disabled:void 0,touched:!1,setTouched:ur,dirty:!1,setDirty:ur,filled:!1,setFilled:ur,focused:!1,setFocused:ur,validate:()=>null,validationMode:"onSubmit",validationDebounceTime:0,shouldValidateOnChange:()=>!1,state:{disabled:!1,valid:null,touched:!1,dirty:!1,filled:!1,focused:!1},markedDirtyRef:{current:!1},validation:{getValidationProps:(e=Ur)=>e,getInputValidationProps:(e=Ur)=>e,inputRef:{current:null},commit:async()=>{}}});function dp(e=!0){const t=E.useContext(QM);if(t.setValidityData===ur&&!e)throw new Error(Jr(28));return t}function ZM(e){const{enabled:t=!0,value:r,id:n,name:i,controlRef:a,commit:l}=e,{formRef:s}=qw(),{invalid:o,markedDirtyRef:c,validityData:f,setValidityData:u}=dp(),p=Yr(e.getValue);qt(()=>{if(!t)return;let _=r;_===void 0&&(_=p()),f.initialValue===null&&_!==null&&u(y=>({...y,initialValue:_}))},[t,u,r,f.initialValue,p]),qt(()=>{!t||!n||s.current.fields.set(n,{getValue:p,name:i,controlRef:a,validityData:YM(f,o),validate(_=!0){let y=r;y===void 0&&(y=p()),c.current=!0,_?hn.flushSync(()=>l(y)):l(y)}})},[l,a,t,s,p,n,o,c,i,f,r]),qt(()=>{const _=s.current.fields;return()=>{n&&_.delete(n)}},[s,n])}const e3=E.createContext({controlId:void 0,registerControlId:ur,labelId:void 0,setLabelId:ur,messageIds:[],setMessageIds:ur,getDescriptionProps:e=>e});function Xw(){return E.useContext(e3)}function t3(e={}){const{id:t,implicit:r=!1,controlRef:n}=e,{controlId:i,registerControlId:a}=Xw(),l=Ww(t),s=r?i:void 0,o=ks(()=>Symbol("labelable-control")),c=E.useRef(!1),f=E.useRef(t!=null),u=Yr(()=>{!c.current||a===ur||(c.current=!1,a(o.current,void 0))});return qt(()=>{if(a===ur)return;let p;if(r){const _=n==null?void 0:n.current;HM(_)&&_.closest("label")!=null?p=t??null:p=s??l}else if(t!=null)f.current=!0,p=t;else if(f.current)p=l;else{u();return}if(p===void 0){u();return}c.current=!0,a(o.current,p)},[t,n,s,a,r,l,o,u]),E.useEffect(()=>u,[u]),i??l}const r3="none";function n3(e,t,r,n){let i=!1,a=!1;const l=Ur;return{reason:e,event:t??new Event("base-ui"),cancel(){i=!0},allowPropagation(){a=!0},get isCanceled(){return i},get isPropagationAllowed(){return a},trigger:r,...l}}function s3(e,t){const r=E.useRef(e),n=Yr(t);qt(()=>{r.current!==e&&n(r.current)},[e,n]),qt(()=>{r.current=e},[e])}const i3=E.forwardRef(function(t,r){const{checked:n,className:i,defaultChecked:a,id:l,inputRef:s,name:o,nativeButton:c=!1,onCheckedChange:f,readOnly:u=!1,required:p=!1,disabled:_=!1,render:y,uncheckedValue:v,value:h,...m}=t,{clearErrors:d}=qw(),{state:g,setTouched:w,setDirty:b,validityData:x,setFilled:C,setFocused:S,shouldValidateOnChange:k,validationMode:L,disabled:A,name:M,validation:D}=dp(),{labelId:O}=Xw(),z=A||_,F=M??o,H=Yr(f),I=E.useRef(null),R=ld(I,s,D.inputRef),P=E.useRef(null),N=Ww(),j=t3({id:l,implicit:!1,controlRef:P}),W=c?void 0:j,[V,Z]=gM({controlled:n,default:!!a,name:"Switch",state:"checked"});ZM({id:N,commit:D.commit,value:V,controlRef:P,name:F,getValue:()=>V}),qt(()=>{I.current&&C(I.current.checked)},[I,C]),s3(V,()=>{d(F),b(V!==x.initialValue),C(V),k()?D.commit(V):D.commit(V,!0)});const{getButtonProps:Q,buttonRef:$}=Vw({disabled:z,native:c}),B={id:c?j:N,role:"switch","aria-checked":V,"aria-readonly":u||void 0,"aria-required":p||void 0,"aria-labelledby":O,onFocus(){z||S(!0)},onBlur(){const Y=I.current;!Y||z||(w(!0),S(!1),L==="onBlur"&&D.commit(Y.checked))},onClick(Y){var ye;u||z||(Y.preventDefault(),(ye=I.current)==null||ye.dispatchEvent(new PointerEvent("click",{bubbles:!0,shiftKey:Y.shiftKey,ctrlKey:Y.ctrlKey,altKey:Y.altKey,metaKey:Y.metaKey})))}},K=E.useMemo(()=>cp({checked:V,disabled:z,id:W,name:F,required:p,style:F?CM:ap,tabIndex:-1,type:"checkbox","aria-hidden":!0,ref:R,onChange(Y){if(Y.nativeEvent.defaultPrevented)return;const ye=Y.target.checked,pe=n3(r3,Y.nativeEvent);H==null||H(ye,pe),!pe.isCanceled&&Z(ye)},onFocus(){var Y;(Y=P.current)==null||Y.focus()}},D.getInputValidationProps,h!==void 0?{value:h}:Ur),[V,z,R,W,F,H,p,Z,D,h]),U=E.useMemo(()=>({...g,checked:V,disabled:z,readOnly:u,required:p}),[g,V,z,u,p]),te=Ls("span",t,{state:U,ref:[r,P,$],props:[B,D.getValidationProps,m,Q],stateAttributesMapping:Gw});return T.jsxs(Kw.Provider,{value:U,children:[te,!V&&F&&v!==void 0&&T.jsx("input",{type:"hidden",name:F,value:v}),T.jsx("input",{...K})]})}),o3=E.forwardRef(function(t,r){const{render:n,className:i,...a}=t,{state:l}=dp(),s=GM(),o={...l,...s};return Ls("span",t,{state:o,ref:r,stateAttributesMapping:Gw,props:a})});function Yw(e){var t,r,n="";if(typeof e=="string"||typeof e=="number")n+=e;else if(typeof e=="object")if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(r=Yw(e[t]))&&(n&&(n+=" "),n+=r)}else for(r in e)e[r]&&(n&&(n+=" "),n+=r);return n}function a3(){for(var e,t,r=0,n="",i=arguments.length;r<i;r++)(e=arguments[r])&&(t=Yw(e))&&(n&&(n+=" "),n+=t);return n}const l3=(e,t)=>{const r=new Array(e.length+t.length);for(let n=0;n<e.length;n++)r[n]=e[n];for(let n=0;n<t.length;n++)r[e.length+n]=t[n];return r},c3=(e,t)=>({classGroupId:e,validator:t}),Jw=(e=new Map,t=null,r)=>({nextPart:e,validators:t,classGroupId:r}),Xl="-",Dv=[],u3="arbitrary..",h3=e=>{const t=f3(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:n}=e;return{getClassGroupId:l=>{if(l.startsWith("[")&&l.endsWith("]"))return d3(l);const s=l.split(Xl),o=s[0]===""&&s.length>1?1:0;return Qw(s,o,t)},getConflictingClassGroupIds:(l,s)=>{if(s){const o=n[l],c=r[l];return o?c?l3(c,o):o:c||Dv}return r[l]||Dv}}},Qw=(e,t,r)=>{if(e.length-t===0)return r.classGroupId;const i=e[t],a=r.nextPart.get(i);if(a){const c=Qw(e,t+1,a);if(c)return c}const l=r.validators;if(l===null)return;const s=t===0?e.join(Xl):e.slice(t).join(Xl),o=l.length;for(let c=0;c<o;c++){const f=l[c];if(f.validator(s))return f.classGroupId}},d3=e=>e.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const t=e.slice(1,-1),r=t.indexOf(":"),n=t.slice(0,r);return n?u3+n:void 0})(),f3=e=>{const{theme:t,classGroups:r}=e;return p3(r,t)},p3=(e,t)=>{const r=Jw();for(const n in e){const i=e[n];fp(i,r,n,t)}return r},fp=(e,t,r,n)=>{const i=e.length;for(let a=0;a<i;a++){const l=e[a];m3(l,t,r,n)}},m3=(e,t,r,n)=>{if(typeof e=="string"){g3(e,t,r);return}if(typeof e=="function"){v3(e,t,r,n);return}_3(e,t,r,n)},g3=(e,t,r)=>{const n=e===""?t:Zw(t,e);n.classGroupId=r},v3=(e,t,r,n)=>{if(y3(e)){fp(e(n),t,r,n);return}t.validators===null&&(t.validators=[]),t.validators.push(c3(r,e))},_3=(e,t,r,n)=>{const i=Object.entries(e),a=i.length;for(let l=0;l<a;l++){const[s,o]=i[l];fp(o,Zw(t,s),r,n)}},Zw=(e,t)=>{let r=e;const n=t.split(Xl),i=n.length;for(let a=0;a<i;a++){const l=n[a];let s=r.nextPart.get(l);s||(s=Jw(),r.nextPart.set(l,s)),r=s}return r},y3=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,w3=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,r=Object.create(null),n=Object.create(null);const i=(a,l)=>{r[a]=l,t++,t>e&&(t=0,n=r,r=Object.create(null))};return{get(a){let l=r[a];if(l!==void 0)return l;if((l=n[a])!==void 0)return i(a,l),l},set(a,l){a in r?r[a]=l:i(a,l)}}},dd="!",Mv=":",S3=[],Av=(e,t,r,n,i)=>({modifiers:e,hasImportantModifier:t,baseClassName:r,maybePostfixModifierPosition:n,isExternal:i}),x3=e=>{const{prefix:t,experimentalParseClassName:r}=e;let n=i=>{const a=[];let l=0,s=0,o=0,c;const f=i.length;for(let v=0;v<f;v++){const h=i[v];if(l===0&&s===0){if(h===Mv){a.push(i.slice(o,v)),o=v+1;continue}if(h==="/"){c=v;continue}}h==="["?l++:h==="]"?l--:h==="("?s++:h===")"&&s--}const u=a.length===0?i:i.slice(o);let p=u,_=!1;u.endsWith(dd)?(p=u.slice(0,-1),_=!0):u.startsWith(dd)&&(p=u.slice(1),_=!0);const y=c&&c>o?c-o:void 0;return Av(a,_,p,y)};if(t){const i=t+Mv,a=n;n=l=>l.startsWith(i)?a(l.slice(i.length)):Av(S3,!1,l,void 0,!0)}if(r){const i=n;n=a=>r({className:a,parseClassName:i})}return n},b3=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((r,n)=>{t.set(r,1e6+n)}),r=>{const n=[];let i=[];for(let a=0;a<r.length;a++){const l=r[a],s=l[0]==="[",o=t.has(l);s||o?(i.length>0&&(i.sort(),n.push(...i),i=[]),n.push(l)):i.push(l)}return i.length>0&&(i.sort(),n.push(...i)),n}},C3=e=>({cache:w3(e.cacheSize),parseClassName:x3(e),sortModifiers:b3(e),...h3(e)}),E3=/\s+/,k3=(e,t)=>{const{parseClassName:r,getClassGroupId:n,getConflictingClassGroupIds:i,sortModifiers:a}=t,l=[],s=e.trim().split(E3);let o="";for(let c=s.length-1;c>=0;c-=1){const f=s[c],{isExternal:u,modifiers:p,hasImportantModifier:_,baseClassName:y,maybePostfixModifierPosition:v}=r(f);if(u){o=f+(o.length>0?" "+o:o);continue}let h=!!v,m=n(h?y.substring(0,v):y);if(!m){if(!h){o=f+(o.length>0?" "+o:o);continue}if(m=n(y),!m){o=f+(o.length>0?" "+o:o);continue}h=!1}const d=p.length===0?"":p.length===1?p[0]:a(p).join(":"),g=_?d+dd:d,w=g+m;if(l.indexOf(w)>-1)continue;l.push(w);const b=i(m,h);for(let x=0;x<b.length;++x){const C=b[x];l.push(g+C)}o=f+(o.length>0?" "+o:o)}return o},L3=(...e)=>{let t=0,r,n,i="";for(;t<e.length;)(r=e[t++])&&(n=eS(r))&&(i&&(i+=" "),i+=n);return i},eS=e=>{if(typeof e=="string")return e;let t,r="";for(let n=0;n<e.length;n++)e[n]&&(t=eS(e[n]))&&(r&&(r+=" "),r+=t);return r},T3=(e,...t)=>{let r,n,i,a;const l=o=>{const c=t.reduce((f,u)=>u(f),e());return r=C3(c),n=r.cache.get,i=r.cache.set,a=s,s(o)},s=o=>{const c=n(o);if(c)return c;const f=k3(o,r);return i(o,f),f};return a=l,(...o)=>a(L3(...o))},R3=[],yt=e=>{const t=r=>r[e]||R3;return t.isThemeGetter=!0,t},tS=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,rS=/^\((?:(\w[\w-]*):)?(.+)\)$/i,D3=/^\d+\/\d+$/,M3=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,A3=/\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$/,P3=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,I3=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,O3=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Is=e=>D3.test(e),Fe=e=>!!e&&!Number.isNaN(Number(e)),bn=e=>!!e&&Number.isInteger(Number(e)),Lu=e=>e.endsWith("%")&&Fe(e.slice(0,-1)),nn=e=>M3.test(e),B3=()=>!0,N3=e=>A3.test(e)&&!P3.test(e),nS=()=>!1,j3=e=>I3.test(e),F3=e=>O3.test(e),H3=e=>!Ce(e)&&!Ee(e),$3=e=>Di(e,oS,nS),Ce=e=>tS.test(e),ns=e=>Di(e,aS,N3),Tu=e=>Di(e,K3,Fe),Pv=e=>Di(e,sS,nS),z3=e=>Di(e,iS,F3),ja=e=>Di(e,lS,j3),Ee=e=>rS.test(e),zi=e=>Mi(e,aS),U3=e=>Mi(e,G3),Iv=e=>Mi(e,sS),W3=e=>Mi(e,oS),V3=e=>Mi(e,iS),Fa=e=>Mi(e,lS,!0),Di=(e,t,r)=>{const n=tS.exec(e);return n?n[1]?t(n[1]):r(n[2]):!1},Mi=(e,t,r=!1)=>{const n=rS.exec(e);return n?n[1]?t(n[1]):r:!1},sS=e=>e==="position"||e==="percentage",iS=e=>e==="image"||e==="url",oS=e=>e==="length"||e==="size"||e==="bg-size",aS=e=>e==="length",K3=e=>e==="number",G3=e=>e==="family-name",lS=e=>e==="shadow",q3=()=>{const e=yt("color"),t=yt("font"),r=yt("text"),n=yt("font-weight"),i=yt("tracking"),a=yt("leading"),l=yt("breakpoint"),s=yt("container"),o=yt("spacing"),c=yt("radius"),f=yt("shadow"),u=yt("inset-shadow"),p=yt("text-shadow"),_=yt("drop-shadow"),y=yt("blur"),v=yt("perspective"),h=yt("aspect"),m=yt("ease"),d=yt("animate"),g=()=>["auto","avoid","all","avoid-page","page","left","right","column"],w=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],b=()=>[...w(),Ee,Ce],x=()=>["auto","hidden","clip","visible","scroll"],C=()=>["auto","contain","none"],S=()=>[Ee,Ce,o],k=()=>[Is,"full","auto",...S()],L=()=>[bn,"none","subgrid",Ee,Ce],A=()=>["auto",{span:["full",bn,Ee,Ce]},bn,Ee,Ce],M=()=>[bn,"auto",Ee,Ce],D=()=>["auto","min","max","fr",Ee,Ce],O=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],z=()=>["start","end","center","stretch","center-safe","end-safe"],F=()=>["auto",...S()],H=()=>[Is,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...S()],I=()=>[e,Ee,Ce],R=()=>[...w(),Iv,Pv,{position:[Ee,Ce]}],P=()=>["no-repeat",{repeat:["","x","y","space","round"]}],N=()=>["auto","cover","contain",W3,$3,{size:[Ee,Ce]}],j=()=>[Lu,zi,ns],W=()=>["","none","full",c,Ee,Ce],V=()=>["",Fe,zi,ns],Z=()=>["solid","dashed","dotted","double"],Q=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],$=()=>[Fe,Lu,Iv,Pv],B=()=>["","none",y,Ee,Ce],K=()=>["none",Fe,Ee,Ce],U=()=>["none",Fe,Ee,Ce],te=()=>[Fe,Ee,Ce],Y=()=>[Is,"full",...S()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[nn],breakpoint:[nn],color:[B3],container:[nn],"drop-shadow":[nn],ease:["in","out","in-out"],font:[H3],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[nn],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[nn],shadow:[nn],spacing:["px",Fe],text:[nn],"text-shadow":[nn],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Is,Ce,Ee,h]}],container:["container"],columns:[{columns:[Fe,Ce,Ee,s]}],"break-after":[{"break-after":g()}],"break-before":[{"break-before":g()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:b()}],overflow:[{overflow:x()}],"overflow-x":[{"overflow-x":x()}],"overflow-y":[{"overflow-y":x()}],overscroll:[{overscroll:C()}],"overscroll-x":[{"overscroll-x":C()}],"overscroll-y":[{"overscroll-y":C()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:k()}],"inset-x":[{"inset-x":k()}],"inset-y":[{"inset-y":k()}],start:[{start:k()}],end:[{end:k()}],top:[{top:k()}],right:[{right:k()}],bottom:[{bottom:k()}],left:[{left:k()}],visibility:["visible","invisible","collapse"],z:[{z:[bn,"auto",Ee,Ce]}],basis:[{basis:[Is,"full","auto",s,...S()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Fe,Is,"auto","initial","none",Ce]}],grow:[{grow:["",Fe,Ee,Ce]}],shrink:[{shrink:["",Fe,Ee,Ce]}],order:[{order:[bn,"first","last","none",Ee,Ce]}],"grid-cols":[{"grid-cols":L()}],"col-start-end":[{col:A()}],"col-start":[{"col-start":M()}],"col-end":[{"col-end":M()}],"grid-rows":[{"grid-rows":L()}],"row-start-end":[{row:A()}],"row-start":[{"row-start":M()}],"row-end":[{"row-end":M()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":D()}],"auto-rows":[{"auto-rows":D()}],gap:[{gap:S()}],"gap-x":[{"gap-x":S()}],"gap-y":[{"gap-y":S()}],"justify-content":[{justify:[...O(),"normal"]}],"justify-items":[{"justify-items":[...z(),"normal"]}],"justify-self":[{"justify-self":["auto",...z()]}],"align-content":[{content:["normal",...O()]}],"align-items":[{items:[...z(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...z(),{baseline:["","last"]}]}],"place-content":[{"place-content":O()}],"place-items":[{"place-items":[...z(),"baseline"]}],"place-self":[{"place-self":["auto",...z()]}],p:[{p:S()}],px:[{px:S()}],py:[{py:S()}],ps:[{ps:S()}],pe:[{pe:S()}],pt:[{pt:S()}],pr:[{pr:S()}],pb:[{pb:S()}],pl:[{pl:S()}],m:[{m:F()}],mx:[{mx:F()}],my:[{my:F()}],ms:[{ms:F()}],me:[{me:F()}],mt:[{mt:F()}],mr:[{mr:F()}],mb:[{mb:F()}],ml:[{ml:F()}],"space-x":[{"space-x":S()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":S()}],"space-y-reverse":["space-y-reverse"],size:[{size:H()}],w:[{w:[s,"screen",...H()]}],"min-w":[{"min-w":[s,"screen","none",...H()]}],"max-w":[{"max-w":[s,"screen","none","prose",{screen:[l]},...H()]}],h:[{h:["screen","lh",...H()]}],"min-h":[{"min-h":["screen","lh","none",...H()]}],"max-h":[{"max-h":["screen","lh",...H()]}],"font-size":[{text:["base",r,zi,ns]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[n,Ee,Tu]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Lu,Ce]}],"font-family":[{font:[U3,Ce,t]}],"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:[i,Ee,Ce]}],"line-clamp":[{"line-clamp":[Fe,"none",Ee,Tu]}],leading:[{leading:[a,...S()]}],"list-image":[{"list-image":["none",Ee,Ce]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",Ee,Ce]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:I()}],"text-color":[{text:I()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...Z(),"wavy"]}],"text-decoration-thickness":[{decoration:[Fe,"from-font","auto",Ee,ns]}],"text-decoration-color":[{decoration:I()}],"underline-offset":[{"underline-offset":[Fe,"auto",Ee,Ce]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:S()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Ee,Ce]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",Ee,Ce]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:R()}],"bg-repeat":[{bg:P()}],"bg-size":[{bg:N()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},bn,Ee,Ce],radial:["",Ee,Ce],conic:[bn,Ee,Ce]},V3,z3]}],"bg-color":[{bg:I()}],"gradient-from-pos":[{from:j()}],"gradient-via-pos":[{via:j()}],"gradient-to-pos":[{to:j()}],"gradient-from":[{from:I()}],"gradient-via":[{via:I()}],"gradient-to":[{to:I()}],rounded:[{rounded:W()}],"rounded-s":[{"rounded-s":W()}],"rounded-e":[{"rounded-e":W()}],"rounded-t":[{"rounded-t":W()}],"rounded-r":[{"rounded-r":W()}],"rounded-b":[{"rounded-b":W()}],"rounded-l":[{"rounded-l":W()}],"rounded-ss":[{"rounded-ss":W()}],"rounded-se":[{"rounded-se":W()}],"rounded-ee":[{"rounded-ee":W()}],"rounded-es":[{"rounded-es":W()}],"rounded-tl":[{"rounded-tl":W()}],"rounded-tr":[{"rounded-tr":W()}],"rounded-br":[{"rounded-br":W()}],"rounded-bl":[{"rounded-bl":W()}],"border-w":[{border:V()}],"border-w-x":[{"border-x":V()}],"border-w-y":[{"border-y":V()}],"border-w-s":[{"border-s":V()}],"border-w-e":[{"border-e":V()}],"border-w-t":[{"border-t":V()}],"border-w-r":[{"border-r":V()}],"border-w-b":[{"border-b":V()}],"border-w-l":[{"border-l":V()}],"divide-x":[{"divide-x":V()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":V()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...Z(),"hidden","none"]}],"divide-style":[{divide:[...Z(),"hidden","none"]}],"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:[...Z(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Fe,Ee,Ce]}],"outline-w":[{outline:["",Fe,zi,ns]}],"outline-color":[{outline:I()}],shadow:[{shadow:["","none",f,Fa,ja]}],"shadow-color":[{shadow:I()}],"inset-shadow":[{"inset-shadow":["none",u,Fa,ja]}],"inset-shadow-color":[{"inset-shadow":I()}],"ring-w":[{ring:V()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:I()}],"ring-offset-w":[{"ring-offset":[Fe,ns]}],"ring-offset-color":[{"ring-offset":I()}],"inset-ring-w":[{"inset-ring":V()}],"inset-ring-color":[{"inset-ring":I()}],"text-shadow":[{"text-shadow":["none",p,Fa,ja]}],"text-shadow-color":[{"text-shadow":I()}],opacity:[{opacity:[Fe,Ee,Ce]}],"mix-blend":[{"mix-blend":[...Q(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":Q()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[Fe]}],"mask-image-linear-from-pos":[{"mask-linear-from":$()}],"mask-image-linear-to-pos":[{"mask-linear-to":$()}],"mask-image-linear-from-color":[{"mask-linear-from":I()}],"mask-image-linear-to-color":[{"mask-linear-to":I()}],"mask-image-t-from-pos":[{"mask-t-from":$()}],"mask-image-t-to-pos":[{"mask-t-to":$()}],"mask-image-t-from-color":[{"mask-t-from":I()}],"mask-image-t-to-color":[{"mask-t-to":I()}],"mask-image-r-from-pos":[{"mask-r-from":$()}],"mask-image-r-to-pos":[{"mask-r-to":$()}],"mask-image-r-from-color":[{"mask-r-from":I()}],"mask-image-r-to-color":[{"mask-r-to":I()}],"mask-image-b-from-pos":[{"mask-b-from":$()}],"mask-image-b-to-pos":[{"mask-b-to":$()}],"mask-image-b-from-color":[{"mask-b-from":I()}],"mask-image-b-to-color":[{"mask-b-to":I()}],"mask-image-l-from-pos":[{"mask-l-from":$()}],"mask-image-l-to-pos":[{"mask-l-to":$()}],"mask-image-l-from-color":[{"mask-l-from":I()}],"mask-image-l-to-color":[{"mask-l-to":I()}],"mask-image-x-from-pos":[{"mask-x-from":$()}],"mask-image-x-to-pos":[{"mask-x-to":$()}],"mask-image-x-from-color":[{"mask-x-from":I()}],"mask-image-x-to-color":[{"mask-x-to":I()}],"mask-image-y-from-pos":[{"mask-y-from":$()}],"mask-image-y-to-pos":[{"mask-y-to":$()}],"mask-image-y-from-color":[{"mask-y-from":I()}],"mask-image-y-to-color":[{"mask-y-to":I()}],"mask-image-radial":[{"mask-radial":[Ee,Ce]}],"mask-image-radial-from-pos":[{"mask-radial-from":$()}],"mask-image-radial-to-pos":[{"mask-radial-to":$()}],"mask-image-radial-from-color":[{"mask-radial-from":I()}],"mask-image-radial-to-color":[{"mask-radial-to":I()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":w()}],"mask-image-conic-pos":[{"mask-conic":[Fe]}],"mask-image-conic-from-pos":[{"mask-conic-from":$()}],"mask-image-conic-to-pos":[{"mask-conic-to":$()}],"mask-image-conic-from-color":[{"mask-conic-from":I()}],"mask-image-conic-to-color":[{"mask-conic-to":I()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:R()}],"mask-repeat":[{mask:P()}],"mask-size":[{mask:N()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",Ee,Ce]}],filter:[{filter:["","none",Ee,Ce]}],blur:[{blur:B()}],brightness:[{brightness:[Fe,Ee,Ce]}],contrast:[{contrast:[Fe,Ee,Ce]}],"drop-shadow":[{"drop-shadow":["","none",_,Fa,ja]}],"drop-shadow-color":[{"drop-shadow":I()}],grayscale:[{grayscale:["",Fe,Ee,Ce]}],"hue-rotate":[{"hue-rotate":[Fe,Ee,Ce]}],invert:[{invert:["",Fe,Ee,Ce]}],saturate:[{saturate:[Fe,Ee,Ce]}],sepia:[{sepia:["",Fe,Ee,Ce]}],"backdrop-filter":[{"backdrop-filter":["","none",Ee,Ce]}],"backdrop-blur":[{"backdrop-blur":B()}],"backdrop-brightness":[{"backdrop-brightness":[Fe,Ee,Ce]}],"backdrop-contrast":[{"backdrop-contrast":[Fe,Ee,Ce]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Fe,Ee,Ce]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Fe,Ee,Ce]}],"backdrop-invert":[{"backdrop-invert":["",Fe,Ee,Ce]}],"backdrop-opacity":[{"backdrop-opacity":[Fe,Ee,Ce]}],"backdrop-saturate":[{"backdrop-saturate":[Fe,Ee,Ce]}],"backdrop-sepia":[{"backdrop-sepia":["",Fe,Ee,Ce]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":S()}],"border-spacing-x":[{"border-spacing-x":S()}],"border-spacing-y":[{"border-spacing-y":S()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",Ee,Ce]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Fe,"initial",Ee,Ce]}],ease:[{ease:["linear","initial",m,Ee,Ce]}],delay:[{delay:[Fe,Ee,Ce]}],animate:[{animate:["none",d,Ee,Ce]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[v,Ee,Ce]}],"perspective-origin":[{"perspective-origin":b()}],rotate:[{rotate:K()}],"rotate-x":[{"rotate-x":K()}],"rotate-y":[{"rotate-y":K()}],"rotate-z":[{"rotate-z":K()}],scale:[{scale:U()}],"scale-x":[{"scale-x":U()}],"scale-y":[{"scale-y":U()}],"scale-z":[{"scale-z":U()}],"scale-3d":["scale-3d"],skew:[{skew:te()}],"skew-x":[{"skew-x":te()}],"skew-y":[{"skew-y":te()}],transform:[{transform:[Ee,Ce,"","none","gpu","cpu"]}],"transform-origin":[{origin:b()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Y()}],"translate-x":[{"translate-x":Y()}],"translate-y":[{"translate-y":Y()}],"translate-z":[{"translate-z":Y()}],"translate-none":["translate-none"],accent:[{accent:I()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:I()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",Ee,Ce]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":S()}],"scroll-mx":[{"scroll-mx":S()}],"scroll-my":[{"scroll-my":S()}],"scroll-ms":[{"scroll-ms":S()}],"scroll-me":[{"scroll-me":S()}],"scroll-mt":[{"scroll-mt":S()}],"scroll-mr":[{"scroll-mr":S()}],"scroll-mb":[{"scroll-mb":S()}],"scroll-ml":[{"scroll-ml":S()}],"scroll-p":[{"scroll-p":S()}],"scroll-px":[{"scroll-px":S()}],"scroll-py":[{"scroll-py":S()}],"scroll-ps":[{"scroll-ps":S()}],"scroll-pe":[{"scroll-pe":S()}],"scroll-pt":[{"scroll-pt":S()}],"scroll-pr":[{"scroll-pr":S()}],"scroll-pb":[{"scroll-pb":S()}],"scroll-pl":[{"scroll-pl":S()}],"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",Ee,Ce]}],fill:[{fill:["none",...I()]}],"stroke-w":[{stroke:[Fe,zi,ns,Tu]}],stroke:[{stroke:["none",...I()]}],"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-x","border-w-y","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-x","border-color-y","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"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-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"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},X3=T3(q3);function Yl(...e){return X3(a3(e))}function Cn({checked:e,onCheckedChange:t,disabled:r,className:n}){return T.jsx(i3,{checked:e,onCheckedChange:t,disabled:r,className:Yl("group relative inline-flex h-6 w-10 shrink-0 cursor-pointer items-center rounded-full transition-colors","bg-border data-[checked]:bg-accent","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent focus-visible:ring-offset-2 focus-visible:ring-offset-bg-base","disabled:cursor-not-allowed disabled:opacity-50",n),children:T.jsx(o3,{className:Yl("pointer-events-none block size-4 rounded-full bg-white shadow-sm transition-transform","translate-x-1 group-data-[checked]:translate-x-5")})})}let Ar=null,pp=!1;const Jl={},cS=500;function mp(){if(typeof window>"u")return null;if((Ar==null?void 0:Ar.state)==="closed"&&(Ar=null),!Ar){const e=window.AudioContext??window.webkitAudioContext;if(!e)return null;Ar=new e}return Ar}function Y3(){Ar&&(Ar.close().catch(()=>{}),Ar=null),mp()}function J3(){return pp}function Ru(){Ar&&(Y3(),pp=!0)}if(typeof window<"u"){window.addEventListener("pageshow",t=>{t.persisted&&Ru()}),document.addEventListener("visibilitychange",()=>{document.visibilityState==="visible"&&Ru()});let e=Date.now();setInterval(()=>{const t=Date.now();t-e>15e3&&Ru(),e=t},5e3)}async function fd(){const e=mp();e&&e.state==="suspended"&&await e.resume().catch(()=>{}),pp=!1}async function Q3(e){e.state==="suspended"&&await e.resume().catch(()=>{})}async function uS(e){const t=mp();if(!t||(await Q3(t),t.state!=="running"))return;const{frequencies:r,durationMs:n,attackMs:i,peakGain:a,type:l="sine"}=e,s=t.currentTime,o=n/1e3,c=i/1e3,f=t.createGain();f.connect(t.destination);const u=s+o*.7;f.gain.setValueAtTime(0,s),f.gain.linearRampToValueAtTime(a,s+c),f.gain.setValueAtTime(a,u),f.gain.linearRampToValueAtTime(0,s+o);const p=r.map(y=>{const v=t.createOscillator();return v.type=l,v.frequency.setValueAtTime(y,s),v.connect(f),v});for(const y of p)y.start(s),y.stop(s+o);const _=p[p.length-1];_.onended=()=>{for(const y of p)y.disconnect();f.disconnect()}}async function pd(){const e=Date.now();if(!(e-(Jl.permission||0)<cS)){Jl.permission=e;try{await uS({frequencies:[880],durationMs:150,attackMs:5,peakGain:.15,type:"sine"})}catch{}}}async function md(){const e=Date.now();if(!(e-(Jl.idle||0)<cS)){Jl.idle=e;try{await uS({frequencies:[440,550],durationMs:300,attackMs:10,peakGain:.08,type:"sine"})}catch{}}}function Z3({isOpen:e,onClose:t}){const r=me(G=>G.defaultProjectDir),n=me(G=>G.setDefaultProjectDir),i=me(G=>G.commandPresets),a=me(G=>G.setCommandPresets),l=me(G=>G.defaultPresetId),s=me(G=>G.setDefaultPresetId),o=me(G=>G.sessionSortMode),c=me(G=>G.setSessionSortMode),f=me(G=>G.sessionSortDirection),u=me(G=>G.setSessionSortDirection),p=me(G=>G.useWebGL),_=me(G=>G.setUseWebGL),y=me(G=>G.fontSize),v=me(G=>G.setFontSize),h=me(G=>G.lineHeight),m=me(G=>G.setLineHeight),d=me(G=>G.letterSpacing),g=me(G=>G.setLetterSpacing),w=me(G=>G.fontOption),b=me(G=>G.setFontOption),x=me(G=>G.customFontFamily),C=me(G=>G.setCustomFontFamily),S=me(G=>G.shortcutModifier),k=me(G=>G.setShortcutModifier),L=me(G=>G.showProjectName),A=me(G=>G.setShowProjectName),M=me(G=>G.showLastUserMessage),D=me(G=>G.setShowLastUserMessage),O=me(G=>G.showSessionIdPrefix),z=me(G=>G.setShowSessionIdPrefix),F=ql(G=>G.theme),H=ql(G=>G.setTheme),I=me(G=>G.soundOnPermission),R=me(G=>G.setSoundOnPermission),P=me(G=>G.soundOnIdle),N=me(G=>G.setSoundOnIdle),[j,W]=E.useState(r),[V,Z]=E.useState(i),[Q,$]=E.useState(l),[B,K]=E.useState(o),[U,te]=E.useState(f),[Y,ye]=E.useState(p),[pe,ne]=E.useState(y),[oe,ce]=E.useState(h),[ue,ve]=E.useState(d),[se,ae]=E.useState(w),[fe,ie]=E.useState(x),[ge,be]=E.useState(S),[Te,je]=E.useState(L),[He,Pe]=E.useState(M),[Oe,ke]=E.useState(O),[Le,Qe]=E.useState(F),[J,ee]=E.useState(I),[Be,q]=E.useState(P),[de,X]=E.useState(!0),[_e,re]=E.useState(!1),[le,we]=E.useState(24),[De,$e]=E.useState(!1),[Ue,Ie]=E.useState(!1),[Me,et]=E.useState(""),[ze,Re]=E.useState(""),[Ae,We]=E.useState(""),Xe=E.useRef(null);if(E.useEffect(()=>{if(Xe.current&&(clearTimeout(Xe.current),Xe.current=null),e){if(W(r),Z(i),$(l),K(o),te(f),ye(p),ne(y),ce(h),ve(d),ae(w),ie(x),be(S),je(L),Pe(M),ke(O),Qe(F),ee(I),q(P),Ie(!1),et(""),Re(""),We(""),fetch("/api/settings/tmux-mouse-mode").then(G=>G.json()).then(G=>X(G.enabled)).catch(()=>{}),fetch("/api/settings/inactive-max-age-hours").then(G=>G.json()).then(G=>we(G.hours)).catch(()=>{}),typeof document<"u"){const G=document.querySelector(".xterm-helper-textarea");G&&typeof G.setAttribute=="function"&&(typeof G.blur=="function"&&G.blur(),G.setAttribute("disabled","true"))}}else typeof document<"u"&&(Xe.current=setTimeout(()=>{if(typeof document>"u")return;const G=document.querySelector(".xterm-helper-textarea");G&&(G.removeAttribute("disabled"),G.focus())},300));return()=>{Xe.current&&(clearTimeout(Xe.current),Xe.current=null)}},[i,l,r,o,f,p,y,h,d,w,x,S,L,M,O,F,I,P,e]),E.useEffect(()=>{if(!e||typeof window>"u"||typeof window.addEventListener!="function")return;const G=tt=>{tt.key==="Escape"&&(typeof tt.stopPropagation=="function"&&tt.stopPropagation(),t())};return window.addEventListener("keydown",G),()=>window.removeEventListener("keydown",G)},[e,t]),!e)return null;const $t=G=>{G.preventDefault();const tt=j.trim(),Qr=Y!==p;n(tt||Th),a(V),s(Q),c(B),u(U),_(Y),v(pe),m(oe),g(ue),b(se),C(fe),k(ge),A(Te),D(He),z(Oe),H(Le),R(J),N(Be),t({webglChanged:Qr})},_t=(G,tt)=>{Z(Qr=>Qr.map(Zr=>Zr.id===G?{...Zr,...tt}:Zr))},zt=G=>{var Zr;const tt=V.find(Rs=>Rs.id===G);if(!tt||tt.isBuiltIn)return;const Qr=V.filter(Rs=>Rs.id!==G);Z(Qr),G===Q&&$(((Zr=Qr[0])==null?void 0:Zr.id)||"claude")},It=()=>{if(!Me.trim()||!ze.trim()||V.length>=si)return;const G={id:`custom-${Date.now()}-${Math.random().toString(36).slice(2,6)}`,label:Me.trim(),command:ze.trim(),isBuiltIn:!1,agentType:Ae||void 0};Z([...V,G]),Ie(!1),et(""),Re(""),We("")},wn=V.length<si,Ts=G=>{re(!0),X(G),fetch("/api/settings/tmux-mouse-mode",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({enabled:G})}).catch(()=>X(!G)).finally(()=>re(!1))},ca=G=>{const tt=le;$e(!0),we(G),fetch("/api/settings/inactive-max-age-hours",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({hours:G})}).catch(()=>we(tt)).finally(()=>$e(!1))};return T.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/60 p-4",onClick:G=>{G.target===G.currentTarget&&t()},children:T.jsxs("form",{onSubmit:$t,className:"w-full max-w-lg max-h-[90vh] flex flex-col border border-border bg-elevated",children:[T.jsxs("div",{className:"p-6 pb-0",children:[T.jsx("h2",{className:"text-sm font-semibold uppercase tracking-wider text-primary text-balance",children:"Settings"}),T.jsx("p",{className:"mt-2 text-xs text-muted text-pretty",children:"Configure default directory, command presets, and display options."})]}),T.jsx("div",{className:"flex-1 overflow-y-auto px-6 pb-4",children:T.jsxs("div",{className:"mt-5 space-y-4",children:[T.jsxs("div",{children:[T.jsx("label",{className:"mb-1.5 block text-xs text-secondary",children:"Default Project Directory"}),T.jsx("input",{value:j,onChange:G=>W(G.target.value),placeholder:Th,className:"input",autoFocus:!0})]}),T.jsxs("div",{className:"border-t border-border pt-4",children:[T.jsxs("div",{className:"flex items-center justify-between mb-2",children:[T.jsx("label",{className:"text-xs text-secondary",children:"Command Presets"}),T.jsx("select",{value:Q,onChange:G=>$(G.target.value),className:"input text-xs py-1 px-2 w-auto",children:V.map(G=>T.jsx("option",{value:G.id,children:G.label},G.id))})]}),T.jsx("p",{className:"text-[10px] text-muted mb-3",children:"Default preset is pre-selected when creating new sessions."}),T.jsx("div",{className:"space-y-3",children:V.map(G=>T.jsxs("div",{className:"border border-border p-3 space-y-2",children:[T.jsxs("div",{className:"flex items-center justify-between",children:[T.jsx("div",{className:"flex items-center gap-2",children:T.jsx("input",{value:G.label,onChange:tt=>_t(G.id,{label:tt.target.value}),className:"input text-sm py-1 px-2 w-32",placeholder:"Label"})}),!G.isBuiltIn&&T.jsx("button",{type:"button",onClick:()=>zt(G.id),className:"btn text-xs px-2 py-1 text-error hover:bg-error/10",children:"Delete"})]}),T.jsxs("div",{children:[T.jsx("label",{className:"text-[10px] text-muted block mb-1",children:"Command"}),T.jsx("input",{value:G.command,onChange:tt=>_t(G.id,{command:tt.target.value}),className:"input text-xs py-1 px-2 font-mono w-full",placeholder:"command --flags"})]}),!G.isBuiltIn&&T.jsxs("div",{children:[T.jsx("label",{className:"text-[10px] text-muted block mb-1",children:"Icon"}),T.jsxs("select",{value:G.agentType||"",onChange:tt=>_t(G.id,{agentType:tt.target.value||void 0}),className:"input text-xs py-1 px-2 w-auto",children:[T.jsx("option",{value:"",children:"Terminal"}),T.jsx("option",{value:"claude",children:"Claude"}),T.jsx("option",{value:"codex",children:"Codex"})]})]})]},G.id))}),Ue?T.jsxs("div",{className:"mt-3 border border-border p-3 space-y-2",children:[T.jsx("div",{className:"text-xs text-secondary mb-2",children:"New Preset"}),T.jsx("input",{value:Me,onChange:G=>et(G.target.value),className:"input text-xs py-1 px-2 w-full",placeholder:"Label"}),T.jsx("input",{value:ze,onChange:G=>Re(G.target.value),className:"input text-xs py-1 px-2 font-mono w-full",placeholder:"command --flags"}),T.jsxs("div",{className:"flex items-center gap-2",children:[T.jsxs("select",{value:Ae,onChange:G=>We(G.target.value),className:"input text-xs py-1 px-2 w-auto",children:[T.jsx("option",{value:"",children:"Terminal Icon"}),T.jsx("option",{value:"claude",children:"Claude Icon"}),T.jsx("option",{value:"codex",children:"Codex Icon"})]}),T.jsx("div",{className:"flex-1"}),T.jsx("button",{type:"button",onClick:()=>Ie(!1),className:"btn text-xs px-2 py-1",children:"Cancel"}),T.jsx("button",{type:"button",onClick:It,disabled:!Me.trim()||!ze.trim(),className:"btn btn-primary text-xs px-2 py-1",children:"Add"})]})]}):T.jsx("button",{type:"button",onClick:()=>Ie(!0),disabled:!wn,className:"btn text-xs mt-3 w-full",children:wn?"+ Add Preset":`Max ${si} presets`})]}),T.jsxs("div",{className:"border-t border-border pt-4",children:[T.jsx("label",{className:"mb-2 block text-xs text-secondary",children:"Session List Order"}),T.jsxs("div",{className:"flex gap-2",children:[T.jsx("button",{type:"button",className:`btn flex-1 ${B==="created"?"btn-primary":""}`,onClick:()=>K("created"),children:"Created"}),T.jsx("button",{type:"button",className:`btn flex-1 ${B==="status"?"btn-primary":""}`,onClick:()=>K("status"),children:"Status"}),T.jsx("button",{type:"button",className:`btn flex-1 ${B==="manual"?"btn-primary":""}`,onClick:()=>K("manual"),children:"Manual"})]}),T.jsx("p",{className:"mt-1.5 text-[10px] text-muted",children:B==="status"?"Sessions auto-resort by status (waiting, working, unknown)":B==="manual"?"Drag sessions to reorder manually":"Sessions stay in creation order"})]}),B==="created"&&T.jsxs("div",{children:[T.jsx("label",{className:"mb-2 block text-xs text-secondary",children:"Sort Direction"}),T.jsxs("div",{className:"flex gap-2",children:[T.jsx("button",{type:"button",className:`btn flex-1 ${U==="desc"?"btn-primary":""}`,onClick:()=>te("desc"),children:"Newest First"}),T.jsx("button",{type:"button",className:`btn flex-1 ${U==="asc"?"btn-primary":""}`,onClick:()=>te("asc"),children:"Oldest First"})]})]}),T.jsxs("div",{className:"border-t border-border pt-4 space-y-3",children:[T.jsx("label",{className:"mb-1 block text-xs text-secondary",children:"Session List Details"}),T.jsxs("div",{className:"flex items-center justify-between",children:[T.jsxs("div",{children:[T.jsx("div",{className:"text-sm text-primary",children:"Project Name"}),T.jsx("div",{className:"text-[10px] text-muted",children:"Show the project folder name under each session."})]}),T.jsx(Cn,{checked:Te,onCheckedChange:je})]}),T.jsxs("div",{className:"flex items-center justify-between",children:[T.jsxs("div",{children:[T.jsx("div",{className:"text-sm text-primary",children:"Last User Message"}),T.jsx("div",{className:"text-[10px] text-muted",children:"Show the most recent user input next to the project name."})]}),T.jsx(Cn,{checked:He,onCheckedChange:Pe})]}),T.jsxs("div",{className:"flex items-center justify-between",children:[T.jsxs("div",{children:[T.jsx("div",{className:"text-sm text-primary",children:"Session ID Prefix"}),T.jsx("div",{className:"text-[10px] text-muted",children:"Show first 5 characters of agent session IDs in the list."})]}),T.jsx(Cn,{checked:Oe,onCheckedChange:ke})]}),T.jsxs("div",{className:"flex items-center justify-between",children:[T.jsxs("div",{children:[T.jsx("div",{className:"text-sm text-primary",children:"Inactive Sessions Lookback"}),T.jsxs("div",{className:"text-[10px] text-muted",children:["Show inactive sessions from the last N hours (",Cu,"-",Eu,")."]})]}),T.jsxs("div",{className:"flex items-center gap-2",children:[T.jsx("input",{type:"number",min:Cu,max:Eu,value:le,onChange:G=>{const tt=parseInt(G.target.value,10);tt>=Cu&&tt<=Eu&&ca(tt)},disabled:De,className:"input text-xs py-1 px-2 w-16 text-center"}),T.jsx("span",{className:"text-xs text-muted",children:"hrs"})]})]})]}),T.jsxs("div",{className:"border-t border-border pt-4 space-y-3",children:[T.jsx("label",{className:"mb-1 block text-xs text-secondary",children:"Notifications"}),T.jsxs("div",{className:"flex items-center justify-between",children:[T.jsxs("div",{className:"flex-1",children:[T.jsx("div",{className:"text-sm text-primary",children:"Permission Sound"}),T.jsx("div",{className:"text-[10px] text-muted",children:"Play a ping when any session needs permission."})]}),T.jsxs("div",{className:"flex items-center gap-2",children:[T.jsx("button",{type:"button",onClick:()=>void pd(),className:"btn text-xs px-2 py-1",children:"Test"}),T.jsx(Cn,{checked:J,onCheckedChange:G=>{ee(G),G&&fd()}})]})]}),T.jsxs("div",{className:"flex items-center justify-between",children:[T.jsxs("div",{className:"flex-1",children:[T.jsx("div",{className:"text-sm text-primary",children:"Idle Sound"}),T.jsx("div",{className:"text-[10px] text-muted",children:"Play a chime when a session finishes working."})]}),T.jsxs("div",{className:"flex items-center gap-2",children:[T.jsx("button",{type:"button",onClick:()=>void md(),className:"btn text-xs px-2 py-1",children:"Test"}),T.jsx(Cn,{checked:Be,onCheckedChange:G=>{q(G),G&&fd()}})]})]})]}),T.jsxs("div",{className:"border-t border-border pt-4",children:[T.jsx("label",{className:"mb-2 block text-xs text-secondary",children:"Terminal Rendering"}),T.jsxs("div",{className:"flex items-center justify-between",children:[T.jsxs("div",{children:[T.jsx("div",{className:"text-sm text-primary",children:"WebGL Acceleration"}),T.jsx("div",{className:"text-[10px] text-muted",children:"GPU rendering for better performance. Turn off if text looks fuzzy or flickering."})]}),T.jsx(Cn,{checked:Y,onCheckedChange:ye})]}),Y!==p&&T.jsx("p",{className:"mt-2 text-[10px] text-approval",children:"Terminal will reload when saved"}),T.jsxs("div",{className:"mt-4 flex items-center justify-between",children:[T.jsxs("div",{children:[T.jsx("div",{className:"text-sm text-primary",children:"Mouse Mode"}),T.jsx("div",{className:"text-[10px] text-muted",children:"Enable tmux mouse mode for trackpad/scroll wheel support."})]}),T.jsx(Cn,{checked:de,onCheckedChange:Ts,disabled:_e})]}),T.jsxs("div",{className:"mt-4 flex items-center justify-between",children:[T.jsxs("div",{children:[T.jsx("div",{className:"text-sm text-primary",children:"Font Size"}),T.jsx("div",{className:"text-[10px] text-muted",children:"Terminal text size in pixels (6-24)"})]}),T.jsxs("div",{className:"flex items-center gap-2",children:[T.jsx("button",{type:"button",onClick:()=>ne(Math.max(6,pe-1)),className:"flex h-7 w-7 items-center justify-center rounded bg-surface border border-border text-secondary hover:bg-hover",children:T.jsx("span",{className:"text-sm font-bold",children:"−"})}),T.jsx("span",{className:"text-sm text-secondary w-6 text-center",children:pe}),T.jsx("button",{type:"button",onClick:()=>ne(Math.min(24,pe+1)),className:"flex h-7 w-7 items-center justify-center rounded bg-surface border border-border text-secondary hover:bg-hover",children:T.jsx("span",{className:"text-sm font-bold",children:"+"})})]})]}),T.jsxs("div",{className:"mt-4 flex items-center justify-between",children:[T.jsxs("div",{children:[T.jsx("div",{className:"text-sm text-primary",children:"Line Height"}),T.jsx("div",{className:"text-[10px] text-muted",children:"Vertical spacing (1.0 = compact, 2.0 = spacious)"})]}),T.jsxs("div",{className:"flex items-center gap-2",children:[T.jsx("input",{type:"range",min:"1.0",max:"2.0",step:"0.1",value:oe,onChange:G=>ce(parseFloat(G.target.value)),className:"w-20 h-1 bg-border rounded-lg appearance-none cursor-pointer accent-accent"}),T.jsx("span",{className:"text-xs text-secondary w-8 text-right",children:oe.toFixed(1)})]})]}),T.jsxs("div",{className:"mt-4 flex items-center justify-between",children:[T.jsxs("div",{children:[T.jsx("div",{className:"text-sm text-primary",children:"Letter Spacing"}),T.jsx("div",{className:"text-[10px] text-muted",children:"Horizontal spacing between characters in pixels"})]}),T.jsxs("div",{className:"flex items-center gap-2",children:[T.jsx("input",{type:"range",min:"-3",max:"3",step:"1",value:ue,onChange:G=>ve(parseInt(G.target.value,10)),className:"w-20 h-1 bg-border rounded-lg appearance-none cursor-pointer accent-accent"}),T.jsxs("span",{className:"text-xs text-secondary w-8 text-right",children:[ue,"px"]})]})]}),T.jsxs("div",{className:"mt-4",children:[T.jsxs("div",{className:"flex items-center justify-between",children:[T.jsxs("div",{children:[T.jsx("div",{className:"text-sm text-primary",children:"Font Family"}),T.jsx("div",{className:"text-[10px] text-muted",children:"Terminal typeface"})]}),T.jsx("select",{value:se,onChange:G=>ae(G.target.value),className:"input text-xs py-1 px-2 w-auto",children:Rh.map(G=>T.jsx("option",{value:G.id,children:G.label},G.id))})]}),se==="custom"&&T.jsx("input",{value:fe,onChange:G=>ie(G.target.value),placeholder:'"Fira Code", monospace',className:"input text-xs mt-2 font-mono"})]}),T.jsxs("div",{className:"mt-4 flex items-center justify-between",children:[T.jsxs("div",{children:[T.jsx("div",{className:"text-sm text-primary",children:"Dark Mode"}),T.jsx("div",{className:"text-[10px] text-muted",children:"Switch between dark and light themes."})]}),T.jsx(Cn,{checked:Le==="dark",onCheckedChange:G=>Qe(G?"dark":"light")})]})]}),T.jsxs("div",{className:"border-t border-border pt-4",children:[T.jsx("label",{className:"mb-2 block text-xs text-secondary",children:"Keyboard Shortcut Modifier"}),T.jsx("div",{className:"grid grid-cols-5 gap-1",children:["auto","ctrl-option","ctrl-shift","cmd-option","cmd-shift"].map(G=>T.jsx("button",{type:"button",className:`btn text-xs px-2 ${ge===G?"btn-primary":""}`,onClick:()=>be(G),children:G==="auto"?"Auto":ii(G)},G))}),T.jsx("p",{className:"mt-1.5 text-[10px] text-muted",children:ge==="auto"?`Platform default: ${ii(ea("auto"))}`:`Shortcuts: ${ii(ge)}+[N/X/[/]]`})]})]})}),T.jsxs("div",{className:"flex justify-end gap-2 p-6 pt-4 border-t border-border bg-elevated",children:[T.jsx("button",{type:"button",onClick:()=>t(),className:"btn",children:"Cancel"}),T.jsx("button",{type:"submit",className:"btn btn-primary",children:"Save"})]})]})})}const eA=[];function gp(e){E.useEffect(e,eA)}const vp=E.createContext(void 0);function _p(){const e=E.useContext(vp);if(!e)throw new Error(Jr(73));return e}var Ql=Symbol("NOT_FOUND");function tA(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!="function")throw new TypeError(t)}function rA(e,t=`expected an object, instead received ${typeof e}`){if(typeof e!="object")throw new TypeError(t)}function nA(e,t="expected all items to be functions, instead received the following types: "){if(!e.every(r=>typeof r=="function")){const r=e.map(n=>typeof n=="function"?`function ${n.name||"unnamed"}()`:typeof n).join(", ");throw new TypeError(`${t}[${r}]`)}}var Ov=e=>Array.isArray(e)?e:[e];function sA(e){const t=Array.isArray(e[0])?e[0]:e;return nA(t,"createSelector expects all input-selectors to be functions, but received the following types: "),t}function iA(e,t){const r=[],{length:n}=e;for(let i=0;i<n;i++)r.push(e[i].apply(null,t));return r}function oA(e){let t;return{get(r){return t&&e(t.key,r)?t.value:Ql},put(r,n){t={key:r,value:n}},getEntries(){return t?[t]:[]},clear(){t=void 0}}}function aA(e,t){let r=[];function n(s){const o=r.findIndex(c=>t(s,c.key));if(o>-1){const c=r[o];return o>0&&(r.splice(o,1),r.unshift(c)),c.value}return Ql}function i(s,o){n(s)===Ql&&(r.unshift({key:s,value:o}),r.length>e&&r.pop())}function a(){return r}function l(){r=[]}return{get:n,put:i,getEntries:a,clear:l}}var lA=(e,t)=>e===t;function cA(e){return function(r,n){if(r===null||n===null||r.length!==n.length)return!1;const{length:i}=r;for(let a=0;a<i;a++)if(!e(r[a],n[a]))return!1;return!0}}function uA(e,t){const r=typeof t=="object"?t:{equalityCheck:t},{equalityCheck:n=lA,maxSize:i=1,resultEqualityCheck:a}=r,l=cA(n);let s=0;const o=i<=1?oA(l):aA(i,l);function c(){let f=o.get(arguments);if(f===Ql){if(f=e.apply(null,arguments),s++,a){const p=o.getEntries().find(_=>a(_.value,f));p&&(f=p.value,s!==0&&s--)}o.put(arguments,f)}return f}return c.clearCache=()=>{o.clear(),c.resetResultsCount()},c.resultsCount=()=>s,c.resetResultsCount=()=>{s=0},c}var hA=class{constructor(e){this.value=e}deref(){return this.value}},dA=typeof WeakRef<"u"?WeakRef:hA,fA=0,Bv=1;function Ha(){return{s:fA,v:void 0,o:null,p:null}}function hS(e,t={}){let r=Ha();const{resultEqualityCheck:n}=t;let i,a=0;function l(){var u;let s=r;const{length:o}=arguments;for(let p=0,_=o;p<_;p++){const y=arguments[p];if(typeof y=="function"||typeof y=="object"&&y!==null){let v=s.o;v===null&&(s.o=v=new WeakMap);const h=v.get(y);h===void 0?(s=Ha(),v.set(y,s)):s=h}else{let v=s.p;v===null&&(s.p=v=new Map);const h=v.get(y);h===void 0?(s=Ha(),v.set(y,s)):s=h}}const c=s;let f;if(s.s===Bv)f=s.v;else if(f=e.apply(null,arguments),a++,n){const p=((u=i==null?void 0:i.deref)==null?void 0:u.call(i))??i;p!=null&&n(p,f)&&(f=p,a!==0&&a--),i=typeof f=="object"&&f!==null||typeof f=="function"?new dA(f):f}return c.s=Bv,c.v=f,f}return l.clearCache=()=>{r=Ha(),l.resetResultsCount()},l.resultsCount=()=>a,l.resetResultsCount=()=>{a=0},l}function dS(e,...t){const r=typeof e=="function"?{memoize:e,memoizeOptions:t}:e,n=(...i)=>{let a=0,l=0,s,o={},c=i.pop();typeof c=="object"&&(o=c,c=i.pop()),tA(c,`createSelector expects an output function after the inputs, but received: [${typeof c}]`);const f={...r,...o},{memoize:u,memoizeOptions:p=[],argsMemoize:_=hS,argsMemoizeOptions:y=[]}=f,v=Ov(p),h=Ov(y),m=sA(i),d=u(function(){return a++,c.apply(null,arguments)},...v),g=_(function(){l++;const b=iA(m,arguments);return s=d.apply(null,b),s},...h);return Object.assign(g,{resultFunc:c,memoizedResultFunc:d,dependencies:m,dependencyRecomputations:()=>l,resetDependencyRecomputations:()=>{l=0},lastResult:()=>s,recomputations:()=>a,resetRecomputations:()=>{a=0},memoize:u,argsMemoize:_})};return Object.assign(n,{withTypes:()=>n}),n}var pA=dS(hS),mA=Object.assign((e,t=pA)=>{rA(e,`createStructuredSelector expects first argument to be an object where each property is a selector, instead received a ${typeof e}`);const r=Object.keys(e),n=r.map(a=>e[a]);return t(n,(...a)=>a.reduce((l,s,o)=>(l[r[o]]=s,l),{}))},{withTypes:()=>mA});const gA=dS({memoize:uA,memoizeOptions:{maxSize:1,equalityCheck:Object.is}}),Tr=(e,t,r,n,i,a,...l)=>{if(l.length>0)throw new Error(Jr(1));let s;if(e&&t)s=(o,c,f,u)=>{const p=e(o,c,f,u);return t(p,c,f,u)};else if(e)s=e;else throw new Error("Missing arguments");return s},vA=(...e)=>{const t=new WeakMap;let r=1;const n=e[e.length-1],i=e.length-1||1,a=n.length-i;if(a>3)throw new Error(Jr(2));return(s,o,c,f)=>{let u=s.__cacheKey__;u||(u={id:r},s.__cacheKey__=u,r+=1);let p=t.get(u);if(!p){let _=e;const y=[void 0,void 0,void 0];switch(a){case 0:break;case 1:{_=[...e.slice(0,-1),()=>y[0],n];break}case 2:{_=[...e.slice(0,-1),()=>y[0],()=>y[1],n];break}case 3:{_=[...e.slice(0,-1),()=>y[0],()=>y[1],()=>y[2],n];break}default:throw new Error(Jr(2))}p=gA(..._),p.selectorArgs=y,t.set(u,p)}switch(p.selectorArgs[0]=o,p.selectorArgs[1]=c,p.selectorArgs[2]=f,a){case 0:return p(s);case 1:return p(s,o);case 2:return p(s,o,c);case 3:return p(s,o,c,f);default:throw new Error("unreachable")}}};var fS={exports:{}},pS={};/**
|
|
301
301
|
* @license React
|
|
302
302
|
* use-sync-external-store-shim.production.js
|
|
303
303
|
*
|
|
@@ -313,4 +313,4 @@ void main() {
|
|
|
313
313
|
*
|
|
314
314
|
* This source code is licensed under the MIT license found in the
|
|
315
315
|
* LICENSE file in the root directory of this source tree.
|
|
316
|
-
*/var Ec=E,LA=mS;function TA(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var RA=typeof Object.is=="function"?Object.is:TA,DA=LA.useSyncExternalStore,MA=Ec.useRef,AA=Ec.useEffect,PA=Ec.useMemo,IA=Ec.useDebugValue;vS.useSyncExternalStoreWithSelector=function(e,t,r,n,i){var a=MA(null);if(a.current===null){var l={hasValue:!1,value:null};a.current=l}else l=a.current;a=PA(function(){function o(_){if(!c){if(c=!0,f=_,_=n(_),i!==void 0&&l.hasValue){var y=l.value;if(i(y,_))return u=y}return u=_}if(y=u,RA(f,_))return y;var v=n(_);return i!==void 0&&i(y,v)?(f=_,y):(f=_,u=v)}var c=!1,f,u,p=r===void 0?null:r;return[function(){return o(t())},p===null?void 0:function(){return o(p())}]},[t,r,n,i]);var s=DA(e,a[0],a[1]);return AA(function(){l.hasValue=!0,l.value=s},[s]),IA(s),s};gS.exports=vS;var OA=gS.exports;const BA=lp(19),NA=BA?FA:HA;function _S(e,t,r,n,i){return NA(e,t,r,n,i)}function jA(e,t,r,n,i){const a=E.useCallback(()=>t(e.getSnapshot(),r,n,i),[e,t,r,n,i]);return mS.useSyncExternalStore(e.subscribe,a,a)}function FA(e,t,r,n,i){return jA(e,t,r,n,i)}function HA(e,t,r,n,i){return OA.useSyncExternalStoreWithSelector(e.subscribe,e.getSnapshot,e.getSnapshot,a=>t(a,r,n,i))}class $A{constructor(t){rt(this,"subscribe",t=>(this.listeners.add(t),()=>{this.listeners.delete(t)}));rt(this,"getSnapshot",()=>this.state);this.state=t,this.listeners=new Set,this.updateTick=0}setState(t){if(this.state===t)return;this.state=t,this.updateTick+=1;const r=this.updateTick;for(const n of this.listeners){if(r!==this.updateTick)return;n(t)}}update(t){for(const r in t)if(!Object.is(this.state[r],t[r])){this.setState({...this.state,...t});return}}set(t,r){Object.is(this.state[t],r)||this.setState({...this.state,[t]:r})}notifyAll(){const t={...this.state};this.setState(t)}use(t,r,n,i){return _S(this,t,r,n,i)}}class zA extends $A{constructor(t,r={},n){super(t),this.context=r,this.selectors=n}useSyncedValue(t,r){E.useDebugValue(t),qt(()=>{this.state[t]!==r&&this.set(t,r)},[t,r])}useSyncedValueWithCleanup(t,r){const n=this;qt(()=>(n.state[t]!==r&&n.set(t,r),()=>{n.set(t,void 0)}),[n,t,r])}useSyncedValues(t){const r=this,n=Object.values(t);qt(()=>{r.update(t)},[r,...n])}useControlledProp(t,r){E.useDebugValue(t);const n=r!==void 0;qt(()=>{n&&!Object.is(this.state[t],r)&&super.setState({...this.state,[t]:r})},[t,r,n])}select(t,r,n,i){const a=this.selectors[t];return a(this.state,r,n,i)}useState(t,r,n,i){return E.useDebugValue(t),_S(this,this.selectors[t],r,n,i)}useContextCallback(t,r){E.useDebugValue(t);const n=Xr(r??ur);this.context[t]=n}useStateSetter(t){const r=E.useRef(void 0);return r.current===void 0&&(r.current=n=>{this.set(t,n)}),r.current}observe(t,r){let n;typeof t=="function"?n=t:n=this.selectors[t];let i=n(this.state);return r(i,i,this),this.subscribe(a=>{const l=n(a);if(!Object.is(i,l)){const s=i;i=l,r(l,s,this)}})}}const $a=null;class UA{constructor(){rt(this,"callbacks",[]);rt(this,"callbacksCount",0);rt(this,"nextId",1);rt(this,"startId",1);rt(this,"isScheduled",!1);rt(this,"tick",t=>{var i;this.isScheduled=!1;const r=this.callbacks,n=this.callbacksCount;if(this.callbacks=[],this.callbacksCount=0,this.startId=this.nextId,n>0)for(let a=0;a<r.length;a+=1)(i=r[a])==null||i.call(r,t)})}request(t){const r=this.nextId;return this.nextId+=1,this.callbacks.push(t),this.callbacksCount+=1,(!this.isScheduled||!1)&&(requestAnimationFrame(this.tick),this.isScheduled=!0),r}cancel(t){const r=t-this.startId;r<0||r>=this.callbacks.length||(this.callbacks[r]=null,this.callbacksCount-=1)}}const za=new UA;class yp{constructor(){rt(this,"currentId",$a);rt(this,"cancel",()=>{this.currentId!==$a&&(za.cancel(this.currentId),this.currentId=$a)});rt(this,"disposeEffect",()=>this.cancel)}static create(){return new yp}static request(t){return za.request(t)}static cancel(t){return za.cancel(t)}request(t){this.cancel(),this.currentId=za.request(()=>{this.currentId=$a,t()})}}function WA(){const e=ks(yp.create).current;return gp(e.disposeEffect),e}const Ui=0;class Go{constructor(){rt(this,"currentId",Ui);rt(this,"clear",()=>{this.currentId!==Ui&&(clearTimeout(this.currentId),this.currentId=Ui)});rt(this,"disposeEffect",()=>this.clear)}static create(){return new Go}start(t,r){this.clear(),this.currentId=setTimeout(()=>{this.currentId=Ui,r()},t)}isStarted(){return this.currentId!==Ui}}function VA(){const e=ks(Go.create).current;return gp(e.disposeEffect),e}let Nv=0;function yS(e){return Nv+=1,`${e}-${Math.random().toString(36).slice(2,6)}-${Nv}`}function Js(e){return(e==null?void 0:e.ownerDocument)||document}function Mu(e,t){if(typeof e=="string")return{description:e};if(typeof e=="function"){const r=e(t);return typeof r=="string"?{description:r}:r}return e}const la=typeof navigator<"u",Au=YA(),KA=QA(),GA=JA();typeof CSS>"u"||!CSS.supports||CSS.supports("-webkit-backdrop-filter:none");Au.platform==="MacIntel"&&Au.maxTouchPoints>1||/iP(hone|ad|od)|iOS/.test(Au.platform);const qA=la&&/apple/i.test(navigator.vendor);la&&KA.toLowerCase().startsWith("mac")&&navigator.maxTouchPoints;const XA=GA.includes("jsdom/");function YA(){if(!la)return{platform:"",maxTouchPoints:-1};const e=navigator.userAgentData;return e!=null&&e.platform?{platform:e.platform,maxTouchPoints:navigator.maxTouchPoints}:{platform:navigator.platform??"",maxTouchPoints:navigator.maxTouchPoints??-1}}function JA(){if(!la)return"";const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(({brand:t,version:r})=>`${t}/${r}`).join(" "):navigator.userAgent}function QA(){if(!la)return"";const e=navigator.userAgentData;return e!=null&&e.platform?e.platform:navigator.platform??""}function Zl(e){var r;let t=e.activeElement;for(;((r=t==null?void 0:t.shadowRoot)==null?void 0:r.activeElement)!=null;)t=t.shadowRoot.activeElement;return t}function yi(e,t){var n;if(!e||!t)return!1;const r=(n=t.getRootNode)==null?void 0:n.call(t);if(e.contains(t))return!0;if(r&&zM(r)){let i=t;for(;i;){if(e===i)return!0;i=i.parentNode||i.host}}return!1}function wp(e){return"composedPath"in e?e.composedPath()[0]:e.target}function gd(e){if(!e||XA)return!0;try{return e.matches(":focus-visible")}catch{return!0}}const Ua=vA(e=>e.toasts,e=>{const t=new Map;let r=0,n=0;return e.forEach((i,a)=>{const l=i.transitionStatus==="ending";t.set(i.id,{value:i,domIndex:a,visibleIndex:l?-1:r,offsetY:n}),n+=i.height||0,l||(r+=1)}),t}),nn={toasts:Tr(e=>e.toasts),isEmpty:Tr(e=>e.toasts.length===0),toast:Tr(Ua,(e,t)=>{var r;return(r=e.get(t))==null?void 0:r.value}),toastIndex:Tr(Ua,(e,t)=>{var r;return((r=e.get(t))==null?void 0:r.domIndex)??-1}),toastOffsetY:Tr(Ua,(e,t)=>{var r;return((r=e.get(t))==null?void 0:r.offsetY)??0}),toastVisibleIndex:Tr(Ua,(e,t)=>{var r;return((r=e.get(t))==null?void 0:r.visibleIndex)??-1}),hovering:Tr(e=>e.hovering),focused:Tr(e=>e.focused),expanded:Tr(e=>e.hovering||e.focused),expandedOrOutOfFocus:Tr(e=>e.hovering||e.focused||!e.isWindowFocused),prevFocusElement:Tr(e=>e.prevFocusElement)};class ZA extends zA{constructor(r){super(r,{},nn);rt(this,"timers",new Map);rt(this,"areTimersPaused",!1);rt(this,"setViewport",r=>{this.set("viewport",r)});rt(this,"disposeEffect",()=>()=>{this.timers.forEach(r=>{var n;(n=r.timeout)==null||n.clear()}),this.timers.clear()});rt(this,"addToast",r=>{const{toasts:n,timeout:i,limit:a}=this.state,l=r.id||yS("toast"),s={...r,id:l,transitionStatus:"starting"},o=[s,...n],c=o.filter(u=>u.transitionStatus!=="ending");if(c.length>a){const u=c.length-a,p=c.slice(-u),_=new Set(p.map(y=>y.id));this.setToasts(o.map(y=>{const v=_.has(y.id);return y.limited!==v?{...y,limited:v}:y}))}else this.setToasts(o.map(u=>u.limited?{...u,limited:!1}:u));const f=s.timeout??i;return s.type!=="loading"&&f>0&&this.scheduleTimer(l,f,()=>this.closeToast(l)),nn.expandedOrOutOfFocus(this.state)&&this.pauseTimers(),l});rt(this,"updateToast",(r,n)=>{this.updateToastInternal(r,n)});rt(this,"updateToastInternal",(r,n)=>{var v,h;const{timeout:i,toasts:a}=this.state,l=nn.toast(this.state,r)??null;if(!l||l.transitionStatus==="ending")return;const s={...l,...n};this.setToasts(a.map(m=>m.id===r?{...m,...n}:m));const o=s.timeout??i,c=(l==null?void 0:l.timeout)??i,f=Object.hasOwn(n,"timeout"),u=s.transitionStatus!=="ending"&&s.type!=="loading"&&o>0,p=this.timers.has(r),_=c!==o,y=(l==null?void 0:l.type)==="loading";if(!u&&p){const m=this.timers.get(r);(v=m==null?void 0:m.timeout)==null||v.clear(),this.timers.delete(r);return}if(u&&(!p||_||f||y)){const m=this.timers.get(r);m&&((h=m.timeout)==null||h.clear(),this.timers.delete(r)),this.scheduleTimer(r,o,()=>this.closeToast(r)),nn.expandedOrOutOfFocus(this.state)&&this.pauseTimers()}});rt(this,"closeToast",r=>{var c;const n=nn.toast(this.state,r);(c=n==null?void 0:n.onClose)==null||c.call(n);const{limit:i,toasts:a}=this.state;let l=0;const s=a.map(f=>{if(f.id===r)return{...f,transitionStatus:"ending",height:0};if(f.transitionStatus==="ending")return f;const u=l>=i;return l+=1,f.limited!==u?{...f,limited:u}:f}),o=this.timers.get(r);o&&o.timeout&&(o.timeout.clear(),this.timers.delete(r)),this.handleFocusManagement(r),this.setToasts(s)});rt(this,"promiseToast",(r,n)=>{const i=Mu(n.loading),a=this.addToast({...i,type:"loading"}),l=r.then(s=>{const o=Mu(n.success,s);return this.updateToast(a,{...o,type:"success",timeout:o.timeout}),s}).catch(s=>{const o=Mu(n.error,s);return this.updateToast(a,{...o,type:"error",timeout:o.timeout}),Promise.reject(s)});return{}.hasOwnProperty.call(n,"setPromise")&&n.setPromise(l),l});rt(this,"handleDocumentPointerDown",r=>{if(r.pointerType!=="touch")return;const n=wp(r);yi(this.state.viewport,n)||(this.resumeTimers(),this.update({hovering:!1,focused:!1}))})}setFocused(r){this.set("focused",r)}setHovering(r){this.set("hovering",r)}setIsWindowFocused(r){this.set("isWindowFocused",r)}setPrevFocusElement(r){this.set("prevFocusElement",r)}removeToast(r){var l;const n=nn.toastIndex(this.state,r);if(n===-1)return;const i=this.state.toasts[n];(l=i==null?void 0:i.onRemove)==null||l.call(i);const a=[...this.state.toasts];a.splice(n,1),this.setToasts(a)}pauseTimers(){this.areTimersPaused||(this.areTimersPaused=!0,this.timers.forEach(r=>{if(r.timeout){r.timeout.clear();const n=Date.now()-r.start,i=r.delay-n;r.remaining=i>0?i:0}}))}resumeTimers(){this.areTimersPaused&&(this.areTimersPaused=!1,this.timers.forEach((r,n)=>{r.remaining=r.remaining>0?r.remaining:r.delay,r.timeout??(r.timeout=Go.create()),r.timeout.start(r.remaining,()=>{this.timers.delete(n),r.callback()}),r.start=Date.now()}))}restoreFocusToPrevElement(){var r;(r=this.state.prevFocusElement)==null||r.focus({preventScroll:!0})}scheduleTimer(r,n,i){const a=Date.now(),l=!nn.expandedOrOutOfFocus(this.state),s=l?Go.create():void 0;s==null||s.start(n,()=>{this.timers.delete(r),i()}),this.timers.set(r,{timeout:s,start:l?a:0,delay:n,remaining:n,callback:i})}setToasts(r){const n={toasts:r};r.length===0&&(n.hovering=!1,n.focused=!1),this.update(n)}handleFocusManagement(r){var o,c;const n=Zl(Js(this.state.viewport));if(!this.state.viewport||!yi(this.state.viewport,n)||!gd(n))return;const i=nn.toasts(this.state),a=nn.toastIndex(this.state,r);let l=null,s=a+1;for(;s<i.length;){if(i[s].transitionStatus!=="ending"){l=i[s];break}s+=1}if(!l)for(s=a-1;s>=0;){if(i[s].transitionStatus!=="ending"){l=i[s];break}s-=1}l?(c=(o=l.ref)==null?void 0:o.current)==null||c.focus():this.restoreFocusToPrevElement()}}const eP=function(t){const{children:r,timeout:n=5e3,limit:i=3,toastManager:a}=t,l=ks(()=>new ZA({timeout:n,limit:i,viewport:null,toasts:[],hovering:!1,focused:!1,isWindowFocused:!0,prevFocusElement:null})).current;return gp(l.disposeEffect),E.useEffect(function(){return a?a[" subscribe"](({action:c,options:f})=>{const u=f.id;c==="promise"&&f.promise?l.promiseToast(f.promise,f):c==="update"&&u?l.updateToast(u,f):c==="close"&&u?l.closeToast(u):l.addToast(f)}):void 0},[l,n,a]),l.useSyncedValues({timeout:n,limit:i}),T.jsx(vp.Provider,{value:l,children:r})},Pu=E.forwardRef(function(t,r){const[n,i]=E.useState();qt(()=>{qA&&i("button")},[]);const a={tabIndex:0,role:n};return T.jsx("span",{...t,ref:r,style:ap,"aria-hidden":n?void 0:!0,...a,"data-base-ui-focus-guard":""})});let tP=function(e){return e.frontmostHeight="--toast-frontmost-height",e}({});const rP=E.forwardRef(function(t,r){var M;const{render:n,className:i,children:a,...l}=t,s=_p(),o=VA(),c=E.useRef(!1),f=E.useRef(!1),u=s.useState("isEmpty"),p=s.useState("toasts"),_=s.useState("focused"),y=s.useState("expanded"),v=s.useState("prevFocusElement"),h=((M=p[0])==null?void 0:M.height)??0,m=E.useMemo(()=>p.some(D=>D.transitionStatus==="ending"),[p]);E.useEffect(()=>{const D=s.state.viewport;if(!D)return;function O(F){u||F.key==="F6"&&F.target!==D&&(F.preventDefault(),s.setPrevFocusElement(Zl(Js(D))),D==null||D.focus({preventScroll:!0}),s.pauseTimers(),s.setFocused(!0))}const z=Ko(D);return z.addEventListener("keydown",O),()=>{z.removeEventListener("keydown",O)}},[s,u]),E.useEffect(()=>{const D=s.state.viewport;if(!D||u)return;const O=Ko(D);function z(H){H.target===O&&(s.setIsWindowFocused(!1),s.pauseTimers())}function F(H){if(H.relatedTarget||H.target===O)return;const I=wp(H),R=Zl(Js(D));(!yi(D,I)||!gd(R))&&s.resumeTimers(),o.start(0,()=>s.setIsWindowFocused(!0))}return O.addEventListener("blur",z,!0),O.addEventListener("focus",F,!0),()=>{O.removeEventListener("blur",z,!0),O.removeEventListener("focus",F,!0)}},[s,o,u]),E.useEffect(()=>{const D=s.state.viewport;if(!D||u)return;const O=Js(D);return O.addEventListener("pointerdown",s.handleDocumentPointerDown,!0),()=>{O.removeEventListener("pointerdown",s.handleDocumentPointerDown,!0)}},[u,s]);function d(D){var z,F,H;const O=s.state.viewport;O&&(c.current=!0,D.relatedTarget===O?(H=(F=(z=p[0])==null?void 0:z.ref)==null?void 0:F.current)==null||H.focus():s.restoreFocusToPrevElement())}function g(D){D.key==="Tab"&&D.shiftKey&&D.target===s.state.viewport&&(D.preventDefault(),s.restoreFocusToPrevElement(),s.resumeTimers())}E.useEffect(()=>{!s.state.isWindowFocused||m||!f.current||(s.resumeTimers(),s.setHovering(!1),f.current=!1)},[m,s]);function w(){s.pauseTimers(),s.setHovering(!0),f.current=!1}function b(){m?f.current=!0:(s.resumeTimers(),s.setHovering(!1))}function x(){if(c.current){c.current=!1;return}_||gd(Js(s.state.viewport).activeElement)&&(s.setFocused(!0),s.pauseTimers())}function C(D){!_||yi(s.state.viewport,D.relatedTarget)||(s.setFocused(!1),s.resumeTimers())}const S={tabIndex:-1,role:"region","aria-live":"polite","aria-atomic":!1,"aria-relevant":"additions text","aria-label":"Notifications",onMouseEnter:w,onMouseMove:w,onMouseLeave:b,onFocus:x,onBlur:C,onKeyDown:g,onClick:x},k={expanded:y},L=Ls("div",t,{ref:[r,s.setViewport],state:k,props:[S,{style:{[tP.frontmostHeight]:h?`${h}px`:void 0}},l,{children:T.jsxs(E.Fragment,{children:[!u&&v&&T.jsx(Pu,{onFocus:d}),a,!u&&v&&T.jsx(Pu,{onFocus:d})]})}]}),A=E.useMemo(()=>p.filter(D=>D.priority==="high"),[p]);return T.jsxs(E.Fragment,{children:[!u&&v&&T.jsx(Pu,{onFocus:d}),L,!_&&A.length>0&&T.jsx("div",{style:ap,children:A.map(D=>T.jsxs("div",{role:"alert","aria-atomic":!0,children:[T.jsx("div",{children:D.title}),T.jsx("div",{children:D.description})]},D.id))})]})});function nP(e){return lp(19)?e:e?"true":void 0}const wS=E.createContext(void 0);function Sp(){const e=E.useContext(wS);if(!e)throw new Error(Yr(66));return e}let xp=function(e){return e.startingStyle="data-starting-style",e.endingStyle="data-ending-style",e}({});const sP={[xp.startingStyle]:""},iP={[xp.endingStyle]:""},oP={transitionStatus(e){return e==="starting"?sP:e==="ending"?iP:null}};function aP(e){return e==null?e:"current"in e?e.current:e}function lP(e,t=!1,r=!0){const n=WA();return Xr((i,a=null)=>{n.cancel();function l(){hn.flushSync(i)}const s=aP(e);if(s==null)return;const o=s;if(typeof o.getAnimations!="function"||globalThis.BASE_UI_ANIMATIONS_DISABLED)i();else{let u=function(){const _=xp.startingStyle;if(!o.hasAttribute(_)){n.request(p);return}const y=new MutationObserver(()=>{o.hasAttribute(_)||(y.disconnect(),p())});y.observe(o,{attributes:!0,attributeFilter:[_]}),a==null||a.addEventListener("abort",()=>y.disconnect(),{once:!0})},p=function(){Promise.all(o.getAnimations().map(_=>_.finished)).then(()=>{a!=null&&a.aborted||l()}).catch(()=>{const _=o.getAnimations();if(r){if(a!=null&&a.aborted)return;l()}else _.length>0&&_.some(y=>y.pending||y.playState!=="finished")&&p()})};var c=u,f=p;if(t){u();return}n.request(p)}})}function cP(e){const{enabled:t=!0,open:r,ref:n,onComplete:i}=e,a=Xr(i),l=lP(n,r,!1);E.useEffect(()=>{if(!t)return;const s=new AbortController;return l(a,s.signal),()=>{s.abort()}},[t,r,a,l])}let ss=function(e){return e.index="--toast-index",e.offsetY="--toast-offset-y",e.height="--toast-height",e.swipeMovementX="--toast-swipe-movement-x",e.swipeMovementY="--toast-swipe-movement-y",e}({});const uP={...oP,swipeDirection(e){return e?{"data-swipe-direction":e}:null}},Wi=40,hP=10,En=.5,dP=1;function jv(e,t,r){switch(e){case"up":return-r;case"down":return r;case"left":return-t;case"right":return t;default:return 0}}function fP(e){const r=window.getComputedStyle(e).transform;let n=0,i=0,a=1;if(r&&r!=="none"){const l=r.match(/matrix(?:3d)?\(([^)]+)\)/);if(l){const s=l[1].split(", ").map(parseFloat);s.length===6?(n=s[4],i=s[5],a=Math.sqrt(s[0]*s[0]+s[1]*s[1])):s.length===16&&(n=s[12],i=s[13],a=s[0])}}return{x:n,y:i,scale:a}}const pP=E.forwardRef(function(t,r){var ve;const{toast:n,render:i,className:a,swipeDirection:l=["down","right"],...s}=t,o=((ve=n.positionerProps)==null?void 0:ve.anchor)!==void 0;let c=[];o||(c=Array.isArray(l)?l:[l]);const f=c.length>0,u=_p(),[p,_]=E.useState(void 0),[y,v]=E.useState(!1),[h,m]=E.useState(!1),[d,g]=E.useState(!1),[w,b]=E.useState({x:0,y:0}),[x,C]=E.useState({x:0,y:0,scale:1}),[S,k]=E.useState(),[L,A]=E.useState(),[M,D]=E.useState(null),O=E.useRef(null),z=E.useRef({x:0,y:0}),F=E.useRef({x:0,y:0,scale:1}),H=E.useRef(void 0),I=E.useRef(0),R=E.useRef(!1),P=E.useRef({x:0,y:0}),N=E.useRef(!1),j=u.useState("toastIndex",n.id),W=u.useState("toastVisibleIndex",n.id),V=u.useState("toastOffsetY",n.id),Z=u.useState("focused"),Q=u.useState("expanded");cP({open:n.transitionStatus!=="ending",ref:O,onComplete(){n.transitionStatus==="ending"&&u.removeToast(n.id)}});const $=Xr((ie=!1)=>{const oe=O.current;if(!oe)return;const de=oe.style.height;oe.style.height="auto";const ae=oe.offsetHeight;oe.style.height=de;function ge(){u.updateToastInternal(n.id,{ref:O,height:ae,...n.transitionStatus==="starting"?{transitionStatus:void 0}:{}})}ie?hn.flushSync(ge):ge()});qt($,[$]);function B(ie,oe){let de=ie,ae=oe;return!c.includes("left")&&!c.includes("right")?de=ie>0?ie**En:-(Math.abs(ie)**En):(!c.includes("right")&&ie>0&&(de=ie**En),!c.includes("left")&&ie<0&&(de=-(Math.abs(ie)**En))),!c.includes("up")&&!c.includes("down")?ae=oe>0?oe**En:-(Math.abs(oe)**En):(!c.includes("down")&&oe>0&&(ae=oe**En),!c.includes("up")&&oe<0&&(ae=-(Math.abs(oe)**En))),{x:de,y:ae}}function G(ie){var ae;if(ie.button!==0)return;ie.pointerType==="touch"&&u.pauseTimers();const oe=wp(ie.nativeEvent);if(!(oe&&oe.closest('button,a,input,textarea,[role="button"],[data-swipe-ignore]'))){if(R.current=!1,H.current=void 0,I.current=0,z.current={x:ie.clientX,y:ie.clientY},P.current=z.current,O.current){const ge=fP(O.current);F.current=ge,C(ge),b({x:ge.x,y:ge.y})}u.setHovering(!0),v(!0),m(!1),D(null),N.current=!0,(ae=O.current)==null||ae.setPointerCapture(ie.pointerId)}}function U(ie){if(!y)return;ie.preventDefault(),N.current&&(z.current={x:ie.clientX,y:ie.clientY},N.current=!1);const{clientY:oe,clientX:de,movementX:ae,movementY:ge}=ie;(ge<0&&oe>P.current.y||ge>0&&oe<P.current.y)&&(P.current={x:P.current.x,y:oe}),(ae<0&&de>P.current.x||ae>0&&de<P.current.x)&&(P.current={x:de,y:P.current.y});const Ee=de-z.current.x,Le=oe-z.current.y,He=oe-P.current.y,je=de-P.current.x;if(!h&&Math.sqrt(Ee*Ee+Le*Le)>=dP&&(m(!0),M===null)){const ee=c.includes("left")||c.includes("right"),$e=c.includes("up")||c.includes("down");if(ee&&$e){const Ne=Math.abs(Ee),K=Math.abs(Le);D(Ne>K?"horizontal":"vertical")}}let Pe;if(!H.current)M==="vertical"?Le>0?Pe="down":Le<0&&(Pe="up"):M==="horizontal"?Ee>0?Pe="right":Ee<0&&(Pe="left"):Math.abs(Ee)>=Math.abs(Le)?Pe=Ee>0?"right":"left":Pe=Le>0?"down":"up",Pe&&c.includes(Pe)&&(H.current=Pe,I.current=jv(Pe,Ee,Le),_(Pe));else{const J=H.current,ee=jv(J,je,He);ee>Wi?(R.current=!1,_(J)):!(c.includes("left")&&c.includes("right"))&&!(c.includes("up")&&c.includes("down"))&&I.current-ee>=hP&&(R.current=!0)}const Oe=B(Ee,Le);let Ce=F.current.x,Te=F.current.y;M==="horizontal"?(c.includes("left")||c.includes("right"))&&(Ce+=Oe.x):(M==="vertical"||(c.includes("left")||c.includes("right"))&&(Ce+=Oe.x),(c.includes("up")||c.includes("down"))&&(Te+=Oe.y)),b({x:Ce,y:Te})}function te(ie){var Ee;if(!y)return;if(v(!1),m(!1),D(null),(Ee=O.current)==null||Ee.releasePointerCapture(ie.pointerId),R.current){b({x:x.x,y:x.y}),_(void 0);return}let oe=!1;const de=w.x-x.x,ae=w.y-x.y;let ge;for(const Le of c){switch(Le){case"right":de>Wi&&(oe=!0,ge="right");break;case"left":de<-Wi&&(oe=!0,ge="left");break;case"down":ae>Wi&&(oe=!0,ge="down");break;case"up":ae<-Wi&&(oe=!0,ge="up");break}if(oe)break}oe?(_(ge),g(!0),u.closeToast(n.id)):(b({x:x.x,y:x.y}),_(void 0))}function Y(ie){if(ie.key==="Escape"){if(!O.current||!yi(O.current,Zl(Js(O.current))))return;u.closeToast(n.id)}}E.useEffect(()=>{if(!f)return;const ie=O.current;if(!ie)return;function oe(de){yi(ie,de.target)&&de.preventDefault()}return ie.addEventListener("touchmove",oe,{passive:!1}),()=>{ie.removeEventListener("touchmove",oe)}},[f]);function _e(){if(!y&&w.x===x.x&&w.y===x.y&&!d)return{[ss.swipeMovementX]:"0px",[ss.swipeMovementY]:"0px"};const ie=w.x-x.x,oe=w.y-x.y;return{transition:y?"none":void 0,transform:y?`translateX(${w.x}px) translateY(${w.y}px) scale(${x.scale})`:void 0,[ss.swipeMovementX]:`${ie}px`,[ss.swipeMovementY]:`${oe}px`}}const fe=n.priority==="high",re={role:fe?"alertdialog":"dialog",tabIndex:0,"aria-modal":!1,"aria-labelledby":S,"aria-describedby":L,"aria-hidden":fe&&!Z?!0:void 0,onPointerDown:f?G:void 0,onPointerMove:f?U:void 0,onPointerUp:f?te:void 0,onKeyDown:Y,inert:nP(n.limited),style:{..._e(),[ss.index]:n.transitionStatus==="ending"?j:W,[ss.offsetY]:`${V}px`,[ss.height]:n.height?`${n.height}px`:void 0}},le=E.useMemo(()=>({rootRef:O,toast:n,titleId:S,setTitleId:k,descriptionId:L,setDescriptionId:A,swiping:y,swipeDirection:p,recalculateHeight:$,index:j,visibleIndex:W,expanded:Q}),[n,S,L,y,p,$,j,W,Q]),se={transitionStatus:n.transitionStatus,expanded:Q,limited:n.limited||!1,type:n.type,swiping:le.swiping,swipeDirection:le.swipeDirection},pe=Ls("div",t,{ref:[r,le.rootRef],state:se,stateAttributesMapping:uP,props:[re,s]});return T.jsx(wS.Provider,{value:le,children:pe})}),mP=E.forwardRef(function(t,r){const{render:n,className:i,id:a,children:l,...s}=t,{toast:o,setDescriptionId:c}=Sp(),f=l??o.description,u=!!f,p=up(a);qt(()=>{if(u)return c(p),()=>{c(void 0)}},[u,p,c]);const _={type:o.type},y=Ls("p",t,{ref:r,state:_,props:{...s,id:p,children:f}});return u?y:null}),gP=E.forwardRef(function(t,r){const{render:n,className:i,id:a,children:l,...s}=t,{toast:o,setTitleId:c}=Sp(),f=l??o.title,u=!!f,p=up(a);qt(()=>{if(u)return c(p),()=>{c(void 0)}},[u,p,c]);const _={type:o.type},y=Ls("h2",t,{ref:r,state:_,props:{...s,id:p,children:f}});return u?y:null}),vP=E.forwardRef(function(t,r){const{render:n,className:i,disabled:a,nativeButton:l=!0,...s}=t,o=_p(),{toast:c}=Sp(),f=o.useState("expanded"),[u,p]=E.useState(!1),{getButtonProps:_,buttonRef:y}=Vw({disabled:a,native:l}),v={type:c.type};return Ls("button",t,{ref:[r,y],state:v,props:[{"aria-hidden":!f&&!u,onClick(){o.closeToast(c.id)},onFocus(){p(!0)},onBlur(){p(!1)}},s,_]})});function _P(){const e=E.useContext(vp);if(!e)throw new Error(Yr(73));const t=e.useState("toasts");return E.useMemo(()=>({toasts:t,add:e.addToast,close:e.closeToast,update:e.updateToast,promise:e.promiseToast}),[t,e])}function yP(){const e=new Set;function t(r){e.forEach(n=>n(r))}return{" subscribe":function(n){return e.add(n),()=>{e.delete(n)}},add(r){const n=r.id||yS("toast"),i={...r,id:n,transitionStatus:"starting"};return t({action:"add",options:i}),n},close(r){t({action:"close",options:{id:r}})},update(r,n){t({action:"update",options:{...n,id:r}})},promise(r,n){let i=r;return t({action:"promise",options:{...n,promise:r,setPromise(a){i=a}}}),i}}}const wP=5e3,SS=yP();function SP({toast:e}){return T.jsxs(pP,{toast:e,className:Yl("relative flex w-80 items-start gap-3 border bg-elevated p-4 shadow-lg","data-[swipe=move]:translate-x-[var(--toast-swipe-move-x)]","data-[ending-style]:translate-x-[var(--toast-swipe-end-x)]","data-[ending-style]:opacity-0","data-[starting-style]:translate-y-2 data-[starting-style]:opacity-0","transition-all duration-200",e.type==="error"&&"border-error/50",e.type==="success"&&"border-approval/50",(!e.type||e.type==="info")&&"border-border"),children:[T.jsxs("div",{className:"flex-1 min-w-0",children:[T.jsx(gP,{className:Yl("text-sm font-medium",e.type==="error"&&"text-error",e.type==="success"&&"text-approval",(!e.type||e.type==="info")&&"text-primary"),children:e.title}),e.description&&T.jsx(mP,{className:"mt-1 text-xs text-muted line-clamp-2",children:e.description})]}),T.jsx(vP,{className:"shrink-0 text-muted hover:text-primary transition-colors","aria-label":"Close",children:T.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[T.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),T.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]})}function xP(){const{toasts:e}=_P();return T.jsx(T.Fragment,{children:e.map(t=>T.jsx(SP,{toast:t},t.id))})}function bP(){return T.jsxs(eP,{timeout:wP,toastManager:SS,children:[T.jsx(xP,{}),T.jsx(rP,{className:"fixed bottom-4 right-4 z-[100] flex flex-col gap-2"})]})}const Fv=["CONNECTING","OPEN","CLOSING","CLOSED"],CP=3e3,EP=8e3,kP=15e3,LP=5e3,Iu=2e4,TP=1e4,RP=1500,DP=5e3,MP=750,AP=4,PP=5e3;class IP{constructor(){this.ws=null,this.listeners=new Set,this.statusListeners=new Set,this.status="connecting",this.error=null,this.reconnectAttempts=0,this.reconnectTimer=null,this.connectTimer=null,this.manualClose=!1,this.lastTick=Date.now(),this.wakeCheckInterval=null,this.lifecycleStarted=!1,this.heartbeatTimer=null,this.pongTimer=null,this.lastForceReconnectTs=0,this.pingSeq=0,this.connectionEpoch=0,this.consecutiveFailures=0,this.isResumeAttempt=!1,this.leakedSockets=new Set,this.verifyTimer=null,this.onVisibilityChange=()=>{var t;if(qe("ws_visibility",{state:document.visibilityState,...this.wsSnap()},"info"),document.visibilityState==="visible"){const r=Date.now(),n=r-this.lastTick;this.lastTick=r,qe("ws_resume",{gapMs:n,...this.wsSnap()},"info"),((t=this.ws)==null?void 0:t.readyState)===WebSocket.OPEN?this.verifyConnection():this.forceReconnect("visibilitychange",!0)}else this.stopHeartbeat(),this.cancelVerify(),this.reconnectTimer&&(window.clearTimeout(this.reconnectTimer),this.reconnectTimer=null)},this.onPageShow=t=>{qe("ws_pageshow",{persisted:t.persisted,...this.wsSnap()},"info"),t.persisted&&(this.lastTick=Date.now(),this.forceReconnect("pageshow",!0))}}wsSnap(){return{status:this.status,ws:this.ws?Fv[this.ws.readyState]:null,attempt:this.reconnectAttempts,failures:this.consecutiveFailures,leaked:this.leakedSockets.size,online:typeof navigator<"u"?navigator.onLine:void 0,verifying:this.verifyTimer!==null,buffered:this.ws?this.ws.bufferedAmount:void 0}}connect(){if(this.ws){const a=this.ws.readyState===WebSocket.OPEN;if(a&&this.status==="connected"){qe("ws_connect_skip",{reason:"already_open",...this.wsSnap()});return}qe("ws_connect_destroy_zombie",{reason:a?"open_desynced":"not_open",...this.wsSnap()}),this.destroySocket()}this.manualClose=!1,this.clearConnectTimer(),this.setStatus("connecting");const r=`${window.location.protocol==="https:"?"wss":"ws"}://${window.location.host}/ws`;qe("ws_connect",{url:r,resume:this.isResumeAttempt,...this.wsSnap()},"info");const n=new WebSocket(r);this.ws=n,this.leakedSockets.add(n);const i=this.isResumeAttempt?EP:CP;this.isResumeAttempt=!1,this.connectTimer=window.setTimeout(()=>{if(this.ws!==n)return;this.connectTimer=null,n.readyState===WebSocket.OPEN&&this.status==="connected"||(qe("ws_connect_timeout",{wsState:Fv[n.readyState],managerStatus:this.status,timeoutMs:i,...this.wsSnap()},"info"),this.consecutiveFailures+=1,this.destroySocket(),this.scheduleReconnect())},i),n.onopen=()=>{if(this.ws!==n){qe("ws_onopen_stale",this.wsSnap(),"info");return}qe("ws_onopen",this.wsSnap(),"info"),this.clearConnectTimer(),this.reconnectAttempts=0,this.consecutiveFailures=0,this.connectionEpoch+=1,this.leakedSockets.delete(n),this.setStatus("connected"),this.startHeartbeat()},n.onmessage=a=>{try{const l=a.data,s=performance.now(),o=JSON.parse(l),c=performance.now()-s,f=o;if(f._parseMs=Math.round(c),f._rawLength=l.length,o.type==="pong"){o.seq===this.pingSeq&&(this.clearPongTimer(),this.verifyTimer!==null&&(this.cancelVerify(),qe("ws_verify_ok",this.wsSnap(),"info"),this.startHeartbeat(DP)));return}this.listeners.forEach(u=>u(o))}catch{}},n.onerror=()=>{this.ws===n&&(qe("ws_onerror",this.wsSnap(),"info"),this.clearConnectTimer())},n.onclose=a=>{if(this.ws!==n){qe("ws_onclose_stale",{code:a.code,...this.wsSnap()},"info");return}qe("ws_onclose",{code:a.code,reason:a.reason,clean:a.wasClean,...this.wsSnap()},"info"),this.clearConnectTimer(),this.cancelVerify(),this.consecutiveFailures+=1,this.ws=null,this.manualClose?this.setStatus("disconnected"):this.scheduleReconnect()}}disconnect(){this.manualClose=!0,this.clearConnectTimer(),this.cancelVerify(),this.reconnectTimer&&(window.clearTimeout(this.reconnectTimer),this.reconnectTimer=null),this.destroySocket(),this.setStatus("disconnected")}startLifecycleListeners(){this.lifecycleStarted||typeof document>"u"||typeof window>"u"||(this.lifecycleStarted=!0,document.addEventListener("visibilitychange",this.onVisibilityChange),window.addEventListener("pageshow",this.onPageShow),this.lastTick=Date.now(),this.wakeCheckInterval=window.setInterval(()=>{const t=Date.now(),r=t-this.lastTick;this.isHidden()||(r>kP&&(qe("ws_time_jump",{gapMs:r,...this.wsSnap()},"info"),this.forceReconnect("time_jump",!0)),this.lastTick=t)},LP))}stopLifecycleListeners(){this.lifecycleStarted&&(this.lifecycleStarted=!1,document.removeEventListener("visibilitychange",this.onVisibilityChange),window.removeEventListener("pageshow",this.onPageShow),this.wakeCheckInterval!==null&&(window.clearInterval(this.wakeCheckInterval),this.wakeCheckInterval=null))}send(t){var r;if(((r=this.ws)==null?void 0:r.readyState)!==WebSocket.OPEN)return!1;try{return this.ws.send(JSON.stringify(t)),!0}catch(n){return qe("ws_send_error",{messageType:t.type,error:n instanceof Error?n.message:String(n),...this.wsSnap()},"info"),this.destroySocket(),this.scheduleReconnect(),!1}}subscribe(t){return this.listeners.add(t),()=>this.listeners.delete(t)}subscribeStatus(t){return this.statusListeners.add(t),t(this.status,this.error,this.connectionEpoch),()=>this.statusListeners.delete(t)}getStatus(){return this.status}getConnectionEpoch(){return this.connectionEpoch}verifyConnection(){this.cancelVerify(),this.stopHeartbeat(),this.pingSeq+=1;const t=this.pingSeq,r=this.ws;if(qe("ws_verify",{seq:t,...this.wsSnap()},"info"),!this.send({type:"ping",seq:t})){qe("ws_verify_send_fail",this.wsSnap(),"info"),this.forceReconnect("verify_send_fail",!0);return}this.verifyTimer=window.setTimeout(()=>{this.verifyTimer=null,this.ws===r&&(qe("ws_verify_timeout",this.wsSnap(),"info"),this.forceReconnect("verify_timeout",!0))},RP)}cancelVerify(){this.verifyTimer!==null&&(window.clearTimeout(this.verifyTimer),this.verifyTimer=null)}forceReconnect(t="unknown",r=!1){var a;if(this.manualClose){qe("ws_force_skip",{trigger:t,reason:"manual_close"});return}const n=Date.now(),i=r?200:500;if(n-this.lastForceReconnectTs<i){qe("ws_force_skip",{trigger:t,reason:"debounce",force:r});return}if(!r&&((a=this.ws)==null?void 0:a.readyState)===WebSocket.OPEN&&this.status==="connected"){qe("ws_force_skip",{trigger:t,reason:"already_connected"});return}this.lastForceReconnectTs=n,qe("ws_force_reconnect",{trigger:t,force:r,...this.wsSnap()},"info"),this.reconnectAttempts=0,this.consecutiveFailures=0,this.reconnectTimer&&(window.clearTimeout(this.reconnectTimer),this.reconnectTimer=null),this.destroySocket(),r?(this.purgeLeakedSockets(),this.isResumeAttempt=!0,this.setStatus("reconnecting"),this.reconnectTimer=window.setTimeout(()=>{this.reconnectTimer=null,this.connect()},MP)):this.connect()}startHeartbeat(t){this.stopHeartbeat();const r=()=>{var n;((n=this.ws)==null?void 0:n.readyState)===WebSocket.OPEN&&(this.pingSeq+=1,this.send({type:"ping",seq:this.pingSeq})&&(this.clearPongTimer(),this.pongTimer=window.setTimeout(()=>{this.pongTimer=null,qe("ws_pong_timeout",this.wsSnap(),"info"),this.destroySocket(),this.scheduleReconnect()},TP)))};t!==void 0&&t<Iu?this.heartbeatTimer=window.setTimeout(()=>{r(),this.heartbeatTimer=window.setInterval(r,Iu)},t):this.heartbeatTimer=window.setInterval(r,Iu)}stopHeartbeat(){this.heartbeatTimer!==null&&(window.clearTimeout(this.heartbeatTimer),this.heartbeatTimer=null),this.clearPongTimer()}clearPongTimer(){this.pongTimer!==null&&(window.clearTimeout(this.pongTimer),this.pongTimer=null)}setStatus(t,r=null){this.status=t,this.error=r,this.statusListeners.forEach(n=>n(t,r,this.connectionEpoch))}scheduleReconnect(){if(this.stopHeartbeat(),this.isHidden()){qe("ws_schedule_skip",{reason:"hidden",...this.wsSnap()}),this.setStatus("reconnecting");return}if(this.consecutiveFailures>=AP){qe("ws_stall_detected",this.wsSnap(),"info"),this.purgeLeakedSockets(),this.consecutiveFailures=0,this.reconnectAttempts=0,this.isResumeAttempt=!0,this.setStatus("reconnecting"),this.reconnectTimer=window.setTimeout(()=>{this.reconnectTimer=null,this.connect()},PP);return}this.reconnectAttempts+=1;const t=Math.min(1e3*2**(this.reconnectAttempts-1),3e4);qe("ws_schedule_reconnect",{delay:t,...this.wsSnap()}),this.setStatus("reconnecting"),this.reconnectTimer&&window.clearTimeout(this.reconnectTimer),this.reconnectTimer=window.setTimeout(()=>{this.reconnectTimer=null,this.connect()},t)}isHidden(){return typeof document<"u"&&document.visibilityState==="hidden"}clearConnectTimer(){this.connectTimer&&(window.clearTimeout(this.connectTimer),this.connectTimer=null)}destroySocket(){if(this.clearConnectTimer(),this.stopHeartbeat(),this.cancelVerify(),!this.ws)return;const t=this.ws;this.ws=null,this.leakedSockets.add(t),t.onopen=null,t.onmessage=null,t.onerror=null,t.onclose=null;try{t.close()}catch{}}purgeLeakedSockets(){if(this.leakedSockets.size!==0){qe("ws_purge_leaked",{count:this.leakedSockets.size},"info");for(const t of this.leakedSockets)try{t.onopen=null,t.onmessage=null,t.onerror=null,t.onclose=null,t.close()}catch{}this.leakedSockets.clear()}}}const sn=new IP;function OP(){const e=Ke(o=>o.setConnectionStatus),t=Ke(o=>o.setConnectionError),[r,n]=E.useState(sn.getStatus()),[i,a]=E.useState(sn.getConnectionEpoch());E.useEffect(()=>{sn.connect(),sn.startLifecycleListeners();const o=sn.subscribeStatus((c,f,u)=>{n(c),a(u),e(c),t(f)});return()=>{o(),sn.stopLifecycleListeners()}},[t,e]);const l=E.useMemo(()=>o=>{sn.send(o)},[]),s=E.useMemo(()=>sn.subscribe.bind(sn),[]);return{status:r,connectionEpoch:i,sendMessage:l,subscribe:s}}const BP=100;function NP({viewport:e,win:t,doc:r}){if(!e)return!1;const n=Math.max(0,e.offsetTop||0),i=Math.max(0,e.offsetLeft||0),a=t.innerHeight-(e.height+n),l=Math.max(0,a),s=Math.max(0,e.height||0),o=Math.max(0,e.width||0);return r.documentElement.style.setProperty("--keyboard-inset",`${l}px`),r.documentElement.style.setProperty("--viewport-offset-top",`${n}px`),r.documentElement.style.setProperty("--viewport-offset-left",`${i}px`),r.documentElement.style.setProperty("--visual-viewport-height",`${s}px`),r.documentElement.style.setProperty("--visual-viewport-width",`${o}px`),l>BP?r.documentElement.classList.add("keyboard-visible"):r.documentElement.classList.remove("keyboard-visible"),!0}function jP(e){e.documentElement.style.removeProperty("--keyboard-inset"),e.documentElement.style.removeProperty("--viewport-offset-top"),e.documentElement.style.removeProperty("--viewport-offset-left"),e.documentElement.style.removeProperty("--visual-viewport-height"),e.documentElement.style.removeProperty("--visual-viewport-width"),e.documentElement.classList.remove("keyboard-visible")}function FP(){E.useEffect(()=>{const e=window.visualViewport;if(!e)return;let t=null,r=null;const n=()=>{var v;const _=document.activeElement;if(!_)return!1;const y=(v=_.tagName)==null?void 0:v.toLowerCase();return y==="input"||y==="textarea"?!0:!!_.isContentEditable},i=()=>{NP({viewport:e,win:window,doc:document})},a=()=>{if(typeof window.requestAnimationFrame!="function"){i();return}t!==null&&window.cancelAnimationFrame(t);const _=performance.now(),y=()=>{i(),performance.now()-_<1500?t=window.requestAnimationFrame(y):t=null};t=window.requestAnimationFrame(y)},l=()=>{if(!n()){o();return}i()},s=()=>{r!==null||typeof window.setInterval!="function"||(r=window.setInterval(l,250),l())},o=()=>{r===null||typeof window.clearInterval!="function"||(window.clearInterval(r),r=null)},c=()=>{n()?(a(),s(),i()):o()},f=()=>{c()},u=()=>{c()},p=()=>{a()};return i(),c(),e.addEventListener("resize",i),e.addEventListener("scroll",i),typeof window.addEventListener=="function"&&(window.addEventListener("resize",i),window.addEventListener("orientationchange",p)),typeof document.addEventListener=="function"&&(document.addEventListener("focusin",f),document.addEventListener("focusout",u),document.addEventListener("focus",f,!0),document.addEventListener("blur",u,!0)),()=>{e.removeEventListener("resize",i),e.removeEventListener("scroll",i),typeof window.removeEventListener=="function"&&(window.removeEventListener("resize",i),window.removeEventListener("orientationchange",p)),typeof document.removeEventListener=="function"&&(document.removeEventListener("focusin",f),document.removeEventListener("focusout",u),document.removeEventListener("focus",f,!0),document.removeEventListener("blur",u,!0)),t!==null&&typeof window.cancelAnimationFrame=="function"&&window.cancelAnimationFrame(t),o(),jP(document)}},[])}function HP(){const[e,t]=E.useState(!1),[r,n]=E.useState(void 0),[i,a]=E.useState(void 0),[l,s]=E.useState(void 0),[o,c]=E.useState(!1),[f,u]=E.useState(null),[p,_]=E.useState(null),y=Ke(J=>J.sessions),v=Ke(J=>J.agentSessions),h=Ke(J=>J.selectedSessionId),m=Ke(J=>J.setSessions),d=Ke(J=>J.setAgentSessions),g=Ke(J=>J.setHostStatuses),w=Ke(J=>J.updateSession),b=Ke(J=>J.setSelectedSessionId),x=Ke(J=>J.hasLoaded),C=Ke(J=>J.connectionStatus),S=Ke(J=>J.connectionError),k=Ke(J=>J.clearExitingSession),L=Ke(J=>J.markSessionExiting),A=Ke(J=>J.setRemoteAllowControl),M=Ke(J=>J.setRemoteAllowAttach),D=Ke(J=>J.setHostLabel),O=Ke(J=>J.hostStatuses),z=Ke(J=>J.remoteAllowControl),F=Ke(J=>J.hostLabel),H=ql(J=>J.theme),I=hC(),R=me(J=>J.defaultProjectDir),P=me(J=>J.commandPresets),N=me(J=>J.defaultPresetId),j=me(J=>J.lastProjectPath),W=me(J=>J.setLastProjectPath),V=me(J=>J.addRecentPath),Z=me(J=>J.shortcutModifier),Q=me(J=>J.sidebarWidth),$=me(J=>J.setSidebarWidth),B=me(J=>J.projectFilters),G=me(J=>J.hostFilters),U=me(J=>J.soundOnPermission),te=me(J=>J.soundOnIdle),{sendMessage:Y,subscribe:_e,connectionEpoch:fe}=OP();FP(),E.useEffect(()=>{if(typeof document>"u"||!U&&!te)return;let J=!1;const ee=()=>{J&&!J3()||(J=!0,fd())};return document.addEventListener("click",ee,{passive:!0}),document.addEventListener("keydown",ee,{passive:!0}),document.addEventListener("touchstart",ee,{passive:!0}),()=>{document.removeEventListener("click",ee),document.removeEventListener("keydown",ee),document.removeEventListener("touchstart",ee)}},[U,te]);const re=E.useRef(!1),le=E.useCallback(J=>{J.preventDefault(),re.current=!0,document.body.style.cursor="col-resize",document.body.style.userSelect="none"},[]);E.useEffect(()=>{if(typeof document>"u"||typeof document.addEventListener!="function")return;const J=$e=>{if(!re.current)return;const Ne=$e.clientX;$(Math.max(ty,Math.min(ry,Ne)))},ee=()=>{re.current&&(re.current=!1,document.body.style.cursor="",document.body.style.userSelect="")};return document.addEventListener("mousemove",J),document.addEventListener("mouseup",ee),()=>{document.removeEventListener("mousemove",J),document.removeEventListener("mouseup",ee)}},[$]),E.useEffect(()=>{const J=_e(ee=>{var $e,Ne;if(ee.type==="sessions"){const K=Ke.getState().sessions,{soundOnPermission:he,soundOnIdle:X}=me.getState();if(he||X)for(const ye of ee.sessions){const ne=K.find(ue=>ue.id===ye.id);ne&&ne.status!==ye.status&&(ne.status!=="permission"&&ye.status==="permission"&&he&&pd(),ne.status==="working"&&ye.status==="waiting"&&X&&md())}m(ee.sessions)}if(ee.type==="host-status"&&g(ee.hosts),ee.type==="server-config"&&(A(ee.remoteAllowControl),M(ee.remoteAllowAttach),D(ee.hostLabel),ee.clientLogLevel&&YR(ee.clientLogLevel)),ee.type==="session-update"){const he=Ke.getState().sessions.find(ne=>ne.id===ee.session.id),X=he==null?void 0:he.status,ye=ee.session.status;if(w(ee.session),X){const{soundOnPermission:ne,soundOnIdle:ue}=me.getState();X!=="permission"&&ye==="permission"&&ne&&pd(),X==="working"&&ye==="waiting"&&ue&&md()}}if(ee.type==="session-created"){const K=Ke.getState().sessions;K.some(ye=>ye.id===ee.session.id)||m([ee.session,...K]),b(ee.session.id),V(ee.session.projectPath);const{projectFilters:he,setProjectFilters:X}=me.getState();he.length>0&&!he.includes(ee.session.projectPath)&&X([...he,ee.session.projectPath])}if(ee.type==="session-removed"){ae.current.delete(ee.sessionId);const K=Ke.getState().sessions,he=K.filter(X=>X.id!==ee.sessionId);he.length!==K.length&&m(he)}if(ee.type==="agent-sessions"&&d(ee.active,ee.inactive),ee.type==="agent-sessions-active"){const K=Ke.getState().agentSessions;d(ee.active,K.inactive)}if(ee.type==="session-orphaned"&&!ee.supersededBy){const K=Ke.getState().sessions,he=K.filter(X=>{var ye;return((ye=X.agentSessionId)==null?void 0:ye.trim())!==ee.session.sessionId});he.length!==K.length&&m(he)}if(ee.type==="session-activated"){const K=Ke.getState().sessions.find(he=>he.tmuxWindow===ee.window);K&&w({...K,agentSessionId:ee.session.sessionId,agentSessionName:ee.session.displayName,logFilePath:ee.session.logFilePath,isPinned:ee.session.isPinned,lastUserMessage:ee.session.lastUserMessage??K.lastUserMessage})}if(ee.type==="session-resume-result")if(ee.ok&&ee.session){const K=Ke.getState().sessions;K.some(he=>he.id===ee.session.id)||m([ee.session,...K]),b(ee.session.id)}else ee.ok||(u(`${($e=ee.error)==null?void 0:$e.code}: ${(Ne=ee.error)==null?void 0:Ne.message}`),window.setTimeout(()=>u(null),6e3));if(ee.type==="terminal-error"&&(!ee.sessionId||ee.sessionId===h)&&(u(`${ee.code}: ${ee.message}`),window.setTimeout(()=>u(null),6e3)),ee.type==="terminal-ready"&&ee.sessionId===h&&u(null),ee.type==="error"&&(u(ee.message),window.setTimeout(()=>u(null),6e3)),ee.type==="kill-failed"){const K=ae.current.get(ee.sessionId);if(K){const he=Ke.getState().sessions;he.some(X=>X.id===ee.sessionId)||m([K.session,...he]),K.wasSelected&&b(ee.sessionId),ae.current.delete(ee.sessionId)}k(ee.sessionId),u(ee.message),window.setTimeout(()=>u(null),6e3)}ee.type==="session-pin-result"&&!ee.ok&&ee.error&&(u(ee.error),window.setTimeout(()=>u(null),6e3)),ee.type==="session-resurrection-failed"&&SS.add({title:"Session resurrection failed",description:`"${ee.displayName}" could not be resumed: ${ee.error}`,type:"error",timeout:8e3})});return()=>{J()}},[h,V,k,Y,b,m,d,g,A,M,D,_e,w]);const se=E.useMemo(()=>y.find(J=>J.id===h)||null,[h,y]);E.useEffect(()=>{se!=null&&se.projectPath&&!se.remote&&W(se.projectPath)},[se==null?void 0:se.projectPath,se==null?void 0:se.remote,W]);const pe=me(J=>J.sessionSortMode),ve=me(J=>J.sessionSortDirection),ie=me(J=>J.manualSessionOrder),oe=E.useMemo(()=>np(y,{mode:pe,direction:ve,manualOrder:ie}),[y,pe,ve,ie]),de=E.useMemo(()=>{let J=oe;return B.length>0&&(J=J.filter(ee=>B.includes(ee.projectPath))),G.length>0&&(J=J.filter(ee=>G.includes(ee.host??""))),J},[oe,B,G]);E.useEffect(()=>{h&&de.length>0&&!de.some(J=>J.id===h)&&b(de[0].id)},[h,de,b]),E.useEffect(()=>{window.matchMedia("(max-width: 767px)").matches&&x&&h===null&&oe.length>0&&b(oe[0].id)},[x,h,oe,b]);const ae=E.useRef(new Map),ge=E.useCallback(J=>{const{sessions:ee,selectedSessionId:$e}=Ke.getState(),Ne=ee.find(K=>K.id===J);Ne&&ae.current.set(J,{session:Ne,wasSelected:$e===J}),L(J),m(ee.filter(K=>K.id!==J)),Y({type:"session-kill",sessionId:J})},[L,m,Y]);E.useEffect(()=>{const J=ea(Z),ee=$e=>{if($e.defaultPrevented)return;const Ne=$e.code,K=WC($e,J);if(K&&(Ne==="BracketLeft"||Ne==="BracketRight")){$e.preventDefault();const he=de;if(he.length===0)return;const X=he.findIndex(ue=>ue.id===h);if(X===-1){b(he[0].id);return}const ne=(X+(Ne==="BracketLeft"?-1:1)+he.length)%he.length;b(he[ne].id);return}if(K&&Ne==="KeyN"){$e.preventDefault(),!e&&I&&t(!0);return}if(K&&Ne==="KeyX"){$e.preventDefault(),h&&!e&&ge(h);return}};return window.addEventListener("keydown",ee),()=>window.removeEventListener("keydown",ee)},[e,h,b,de,ge,Z,I]);const Ee=()=>I?(n(void 0),a(void 0),s(void 0),t(!0),!0):!1,Le=()=>c(!0),He=(J,ee,$e,Ne)=>{Y({type:"session-create",projectPath:J,name:ee,command:$e,host:Ne}),Ne||W(J)},je=J=>{Y({type:"session-resume",sessionId:J})},Pe=(J,ee)=>{Y({type:"session-rename",sessionId:J,newName:ee})},Oe=E.useCallback(J=>{const ee=y.find($e=>$e.id===J);ee&&Y({type:"session-create",projectPath:ee.projectPath,command:ee.command||void 0,host:ee.remote&&ee.host?ee.host:void 0})},[y,Y]),Ce=E.useCallback((J,ee)=>{Y({type:"session-pin",sessionId:J,isPinned:ee})},[Y]);E.useEffect(()=>{document.documentElement.setAttribute("data-theme",H)},[H]),E.useEffect(()=>{fetch("/api/server-info").then(J=>J.json()).then(J=>_(J)).catch(()=>{})},[]);const Te=E.useMemo(()=>F?O.filter(J=>J.host!==F):O,[O,F]);return T.jsxs("div",{className:"flex h-full overflow-hidden",children:[T.jsxs("div",{className:"hidden h-full flex-col md:flex md:shrink-0",style:{width:Q},children:[T.jsx(KC,{connectionStatus:C,onNewSession:Ee,onOpenSettings:Le,tailscaleIp:(p==null?void 0:p.tailscaleIp)??null}),T.jsx(fw,{sessions:y,inactiveSessions:v.inactive,selectedSessionId:h,onSelect:b,onRename:Pe,onResume:je,onKill:ge,onDuplicate:Oe,onSetPinned:Ce,loading:!x,error:S||f})]}),T.jsx("div",{className:"hidden md:block w-1 shrink-0 cursor-col-resize bg-transparent transition-colors hover:bg-white/10 active:bg-white/20",onMouseDown:le}),T.jsx(fM,{session:se,sessions:de,connectionStatus:C,connectionEpoch:fe,sendMessage:Y,subscribe:_e,onClose:()=>b(null),onSelectSession:b,onNewSession:Ee,onKillSession:ge,onRenameSession:Pe,onOpenSettings:Le,onResumeSession:je,onSetPinned:Ce,inactiveSessions:v.inactive,loading:!x,error:S||f}),T.jsx(mM,{isOpen:e,onClose:()=>t(!1),onCreate:He,defaultProjectDir:R,commandPresets:P,defaultPresetId:N,lastProjectPath:j,activeProjectPath:se&&!se.remote?se.projectPath:void 0,remoteHosts:Te,remoteAllowControl:z,initialHost:r,initialPath:i,initialCommand:l}),T.jsx(Z3,{isOpen:o,onClose:()=>c(!1)}),T.jsx(bP,{})]})}const $P="modulepreload",zP=function(e){return"/"+e},Hv={},UP=function(t,r,n){let i=Promise.resolve();if(r&&r.length>0){document.getElementsByTagName("link");const l=document.querySelector("meta[property=csp-nonce]"),s=(l==null?void 0:l.nonce)||(l==null?void 0:l.getAttribute("nonce"));i=Promise.allSettled(r.map(o=>{if(o=zP(o),o in Hv)return;Hv[o]=!0;const c=o.endsWith(".css"),f=c?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${o}"]${f}`))return;const u=document.createElement("link");if(u.rel=c?"stylesheet":$P,c||(u.as="script"),u.crossOrigin="",u.href=o,s&&u.setAttribute("nonce",s),document.head.appendChild(u),c)return new Promise((p,_)=>{u.addEventListener("load",p),u.addEventListener("error",()=>_(new Error(`Unable to preload CSS for ${o}`)))})}))}function a(l){const s=new Event("vite:preloadError",{cancelable:!0});if(s.payload=l,window.dispatchEvent(s),!s.defaultPrevented)throw l}return i.then(l=>{for(const s of l||[])s.status==="rejected"&&a(s.reason);return t().catch(a)})};function WP(e={}){const{immediate:t=!1,onNeedRefresh:r,onOfflineReady:n,onRegistered:i,onRegisteredSW:a,onRegisterError:l}=e;let s,o;const c=async(u=!0)=>{await o};async function f(){if("serviceWorker"in navigator){if(s=await UP(async()=>{const{Workbox:u}=await import("./workbox-window.prod.es5-vqzQaGvo.js");return{Workbox:u}},[]).then(({Workbox:u})=>new u("/sw.js",{scope:"/",type:"classic"})).catch(u=>{l==null||l(u)}),!s)return;s.addEventListener("activated",u=>{(u.isUpdate||u.isExternal)&&window.location.reload()}),s.addEventListener("installed",u=>{u.isUpdate||n==null||n()}),s.register({immediate:t}).then(u=>{a?a("/sw.js",u):i==null||i(u)}).catch(u=>{l==null||l(u)})}}return o=f(),c}Zo()&&document.documentElement.classList.add("ios");$C()&&document.documentElement.classList.add("ios-pwa");WP({immediate:!0,onRegisteredSW(e,t){t&&(setInterval(()=>{t.update()},5*60*1e3),document.addEventListener("visibilitychange",()=>{document.visibilityState==="visible"&&t.update()}))}});const xS=document.getElementById("root");if(!xS)throw new Error("Root element not found");ey(xS).render(T.jsx(gt.StrictMode,{children:T.jsx(HP,{})}));
|
|
316
|
+
*/var Ec=E,LA=mS;function TA(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var RA=typeof Object.is=="function"?Object.is:TA,DA=LA.useSyncExternalStore,MA=Ec.useRef,AA=Ec.useEffect,PA=Ec.useMemo,IA=Ec.useDebugValue;vS.useSyncExternalStoreWithSelector=function(e,t,r,n,i){var a=MA(null);if(a.current===null){var l={hasValue:!1,value:null};a.current=l}else l=a.current;a=PA(function(){function o(_){if(!c){if(c=!0,f=_,_=n(_),i!==void 0&&l.hasValue){var y=l.value;if(i(y,_))return u=y}return u=_}if(y=u,RA(f,_))return y;var v=n(_);return i!==void 0&&i(y,v)?(f=_,y):(f=_,u=v)}var c=!1,f,u,p=r===void 0?null:r;return[function(){return o(t())},p===null?void 0:function(){return o(p())}]},[t,r,n,i]);var s=DA(e,a[0],a[1]);return AA(function(){l.hasValue=!0,l.value=s},[s]),IA(s),s};gS.exports=vS;var OA=gS.exports;const BA=lp(19),NA=BA?FA:HA;function _S(e,t,r,n,i){return NA(e,t,r,n,i)}function jA(e,t,r,n,i){const a=E.useCallback(()=>t(e.getSnapshot(),r,n,i),[e,t,r,n,i]);return mS.useSyncExternalStore(e.subscribe,a,a)}function FA(e,t,r,n,i){return jA(e,t,r,n,i)}function HA(e,t,r,n,i){return OA.useSyncExternalStoreWithSelector(e.subscribe,e.getSnapshot,e.getSnapshot,a=>t(a,r,n,i))}class $A{constructor(t){rt(this,"subscribe",t=>(this.listeners.add(t),()=>{this.listeners.delete(t)}));rt(this,"getSnapshot",()=>this.state);this.state=t,this.listeners=new Set,this.updateTick=0}setState(t){if(this.state===t)return;this.state=t,this.updateTick+=1;const r=this.updateTick;for(const n of this.listeners){if(r!==this.updateTick)return;n(t)}}update(t){for(const r in t)if(!Object.is(this.state[r],t[r])){this.setState({...this.state,...t});return}}set(t,r){Object.is(this.state[t],r)||this.setState({...this.state,[t]:r})}notifyAll(){const t={...this.state};this.setState(t)}use(t,r,n,i){return _S(this,t,r,n,i)}}class zA extends $A{constructor(t,r={},n){super(t),this.context=r,this.selectors=n}useSyncedValue(t,r){E.useDebugValue(t),qt(()=>{this.state[t]!==r&&this.set(t,r)},[t,r])}useSyncedValueWithCleanup(t,r){const n=this;qt(()=>(n.state[t]!==r&&n.set(t,r),()=>{n.set(t,void 0)}),[n,t,r])}useSyncedValues(t){const r=this,n=Object.values(t);qt(()=>{r.update(t)},[r,...n])}useControlledProp(t,r){E.useDebugValue(t);const n=r!==void 0;qt(()=>{n&&!Object.is(this.state[t],r)&&super.setState({...this.state,[t]:r})},[t,r,n])}select(t,r,n,i){const a=this.selectors[t];return a(this.state,r,n,i)}useState(t,r,n,i){return E.useDebugValue(t),_S(this,this.selectors[t],r,n,i)}useContextCallback(t,r){E.useDebugValue(t);const n=Yr(r??ur);this.context[t]=n}useStateSetter(t){const r=E.useRef(void 0);return r.current===void 0&&(r.current=n=>{this.set(t,n)}),r.current}observe(t,r){let n;typeof t=="function"?n=t:n=this.selectors[t];let i=n(this.state);return r(i,i,this),this.subscribe(a=>{const l=n(a);if(!Object.is(i,l)){const s=i;i=l,r(l,s,this)}})}}const $a=null;class UA{constructor(){rt(this,"callbacks",[]);rt(this,"callbacksCount",0);rt(this,"nextId",1);rt(this,"startId",1);rt(this,"isScheduled",!1);rt(this,"tick",t=>{var i;this.isScheduled=!1;const r=this.callbacks,n=this.callbacksCount;if(this.callbacks=[],this.callbacksCount=0,this.startId=this.nextId,n>0)for(let a=0;a<r.length;a+=1)(i=r[a])==null||i.call(r,t)})}request(t){const r=this.nextId;return this.nextId+=1,this.callbacks.push(t),this.callbacksCount+=1,(!this.isScheduled||!1)&&(requestAnimationFrame(this.tick),this.isScheduled=!0),r}cancel(t){const r=t-this.startId;r<0||r>=this.callbacks.length||(this.callbacks[r]=null,this.callbacksCount-=1)}}const za=new UA;class yp{constructor(){rt(this,"currentId",$a);rt(this,"cancel",()=>{this.currentId!==$a&&(za.cancel(this.currentId),this.currentId=$a)});rt(this,"disposeEffect",()=>this.cancel)}static create(){return new yp}static request(t){return za.request(t)}static cancel(t){return za.cancel(t)}request(t){this.cancel(),this.currentId=za.request(()=>{this.currentId=$a,t()})}}function WA(){const e=ks(yp.create).current;return gp(e.disposeEffect),e}const Ui=0;class Go{constructor(){rt(this,"currentId",Ui);rt(this,"clear",()=>{this.currentId!==Ui&&(clearTimeout(this.currentId),this.currentId=Ui)});rt(this,"disposeEffect",()=>this.clear)}static create(){return new Go}start(t,r){this.clear(),this.currentId=setTimeout(()=>{this.currentId=Ui,r()},t)}isStarted(){return this.currentId!==Ui}}function VA(){const e=ks(Go.create).current;return gp(e.disposeEffect),e}let Nv=0;function yS(e){return Nv+=1,`${e}-${Math.random().toString(36).slice(2,6)}-${Nv}`}function Js(e){return(e==null?void 0:e.ownerDocument)||document}function Mu(e,t){if(typeof e=="string")return{description:e};if(typeof e=="function"){const r=e(t);return typeof r=="string"?{description:r}:r}return e}const la=typeof navigator<"u",Au=YA(),KA=QA(),GA=JA();typeof CSS>"u"||!CSS.supports||CSS.supports("-webkit-backdrop-filter:none");Au.platform==="MacIntel"&&Au.maxTouchPoints>1||/iP(hone|ad|od)|iOS/.test(Au.platform);const qA=la&&/apple/i.test(navigator.vendor);la&&KA.toLowerCase().startsWith("mac")&&navigator.maxTouchPoints;const XA=GA.includes("jsdom/");function YA(){if(!la)return{platform:"",maxTouchPoints:-1};const e=navigator.userAgentData;return e!=null&&e.platform?{platform:e.platform,maxTouchPoints:navigator.maxTouchPoints}:{platform:navigator.platform??"",maxTouchPoints:navigator.maxTouchPoints??-1}}function JA(){if(!la)return"";const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(({brand:t,version:r})=>`${t}/${r}`).join(" "):navigator.userAgent}function QA(){if(!la)return"";const e=navigator.userAgentData;return e!=null&&e.platform?e.platform:navigator.platform??""}function Zl(e){var r;let t=e.activeElement;for(;((r=t==null?void 0:t.shadowRoot)==null?void 0:r.activeElement)!=null;)t=t.shadowRoot.activeElement;return t}function yi(e,t){var n;if(!e||!t)return!1;const r=(n=t.getRootNode)==null?void 0:n.call(t);if(e.contains(t))return!0;if(r&&zM(r)){let i=t;for(;i;){if(e===i)return!0;i=i.parentNode||i.host}}return!1}function wp(e){return"composedPath"in e?e.composedPath()[0]:e.target}function gd(e){if(!e||XA)return!0;try{return e.matches(":focus-visible")}catch{return!0}}const Ua=vA(e=>e.toasts,e=>{const t=new Map;let r=0,n=0;return e.forEach((i,a)=>{const l=i.transitionStatus==="ending";t.set(i.id,{value:i,domIndex:a,visibleIndex:l?-1:r,offsetY:n}),n+=i.height||0,l||(r+=1)}),t}),sn={toasts:Tr(e=>e.toasts),isEmpty:Tr(e=>e.toasts.length===0),toast:Tr(Ua,(e,t)=>{var r;return(r=e.get(t))==null?void 0:r.value}),toastIndex:Tr(Ua,(e,t)=>{var r;return((r=e.get(t))==null?void 0:r.domIndex)??-1}),toastOffsetY:Tr(Ua,(e,t)=>{var r;return((r=e.get(t))==null?void 0:r.offsetY)??0}),toastVisibleIndex:Tr(Ua,(e,t)=>{var r;return((r=e.get(t))==null?void 0:r.visibleIndex)??-1}),hovering:Tr(e=>e.hovering),focused:Tr(e=>e.focused),expanded:Tr(e=>e.hovering||e.focused),expandedOrOutOfFocus:Tr(e=>e.hovering||e.focused||!e.isWindowFocused),prevFocusElement:Tr(e=>e.prevFocusElement)};class ZA extends zA{constructor(r){super(r,{},sn);rt(this,"timers",new Map);rt(this,"areTimersPaused",!1);rt(this,"setViewport",r=>{this.set("viewport",r)});rt(this,"disposeEffect",()=>()=>{this.timers.forEach(r=>{var n;(n=r.timeout)==null||n.clear()}),this.timers.clear()});rt(this,"addToast",r=>{const{toasts:n,timeout:i,limit:a}=this.state,l=r.id||yS("toast"),s={...r,id:l,transitionStatus:"starting"},o=[s,...n],c=o.filter(u=>u.transitionStatus!=="ending");if(c.length>a){const u=c.length-a,p=c.slice(-u),_=new Set(p.map(y=>y.id));this.setToasts(o.map(y=>{const v=_.has(y.id);return y.limited!==v?{...y,limited:v}:y}))}else this.setToasts(o.map(u=>u.limited?{...u,limited:!1}:u));const f=s.timeout??i;return s.type!=="loading"&&f>0&&this.scheduleTimer(l,f,()=>this.closeToast(l)),sn.expandedOrOutOfFocus(this.state)&&this.pauseTimers(),l});rt(this,"updateToast",(r,n)=>{this.updateToastInternal(r,n)});rt(this,"updateToastInternal",(r,n)=>{var v,h;const{timeout:i,toasts:a}=this.state,l=sn.toast(this.state,r)??null;if(!l||l.transitionStatus==="ending")return;const s={...l,...n};this.setToasts(a.map(m=>m.id===r?{...m,...n}:m));const o=s.timeout??i,c=(l==null?void 0:l.timeout)??i,f=Object.hasOwn(n,"timeout"),u=s.transitionStatus!=="ending"&&s.type!=="loading"&&o>0,p=this.timers.has(r),_=c!==o,y=(l==null?void 0:l.type)==="loading";if(!u&&p){const m=this.timers.get(r);(v=m==null?void 0:m.timeout)==null||v.clear(),this.timers.delete(r);return}if(u&&(!p||_||f||y)){const m=this.timers.get(r);m&&((h=m.timeout)==null||h.clear(),this.timers.delete(r)),this.scheduleTimer(r,o,()=>this.closeToast(r)),sn.expandedOrOutOfFocus(this.state)&&this.pauseTimers()}});rt(this,"closeToast",r=>{var c;const n=sn.toast(this.state,r);(c=n==null?void 0:n.onClose)==null||c.call(n);const{limit:i,toasts:a}=this.state;let l=0;const s=a.map(f=>{if(f.id===r)return{...f,transitionStatus:"ending",height:0};if(f.transitionStatus==="ending")return f;const u=l>=i;return l+=1,f.limited!==u?{...f,limited:u}:f}),o=this.timers.get(r);o&&o.timeout&&(o.timeout.clear(),this.timers.delete(r)),this.handleFocusManagement(r),this.setToasts(s)});rt(this,"promiseToast",(r,n)=>{const i=Mu(n.loading),a=this.addToast({...i,type:"loading"}),l=r.then(s=>{const o=Mu(n.success,s);return this.updateToast(a,{...o,type:"success",timeout:o.timeout}),s}).catch(s=>{const o=Mu(n.error,s);return this.updateToast(a,{...o,type:"error",timeout:o.timeout}),Promise.reject(s)});return{}.hasOwnProperty.call(n,"setPromise")&&n.setPromise(l),l});rt(this,"handleDocumentPointerDown",r=>{if(r.pointerType!=="touch")return;const n=wp(r);yi(this.state.viewport,n)||(this.resumeTimers(),this.update({hovering:!1,focused:!1}))})}setFocused(r){this.set("focused",r)}setHovering(r){this.set("hovering",r)}setIsWindowFocused(r){this.set("isWindowFocused",r)}setPrevFocusElement(r){this.set("prevFocusElement",r)}removeToast(r){var l;const n=sn.toastIndex(this.state,r);if(n===-1)return;const i=this.state.toasts[n];(l=i==null?void 0:i.onRemove)==null||l.call(i);const a=[...this.state.toasts];a.splice(n,1),this.setToasts(a)}pauseTimers(){this.areTimersPaused||(this.areTimersPaused=!0,this.timers.forEach(r=>{if(r.timeout){r.timeout.clear();const n=Date.now()-r.start,i=r.delay-n;r.remaining=i>0?i:0}}))}resumeTimers(){this.areTimersPaused&&(this.areTimersPaused=!1,this.timers.forEach((r,n)=>{r.remaining=r.remaining>0?r.remaining:r.delay,r.timeout??(r.timeout=Go.create()),r.timeout.start(r.remaining,()=>{this.timers.delete(n),r.callback()}),r.start=Date.now()}))}restoreFocusToPrevElement(){var r;(r=this.state.prevFocusElement)==null||r.focus({preventScroll:!0})}scheduleTimer(r,n,i){const a=Date.now(),l=!sn.expandedOrOutOfFocus(this.state),s=l?Go.create():void 0;s==null||s.start(n,()=>{this.timers.delete(r),i()}),this.timers.set(r,{timeout:s,start:l?a:0,delay:n,remaining:n,callback:i})}setToasts(r){const n={toasts:r};r.length===0&&(n.hovering=!1,n.focused=!1),this.update(n)}handleFocusManagement(r){var o,c;const n=Zl(Js(this.state.viewport));if(!this.state.viewport||!yi(this.state.viewport,n)||!gd(n))return;const i=sn.toasts(this.state),a=sn.toastIndex(this.state,r);let l=null,s=a+1;for(;s<i.length;){if(i[s].transitionStatus!=="ending"){l=i[s];break}s+=1}if(!l)for(s=a-1;s>=0;){if(i[s].transitionStatus!=="ending"){l=i[s];break}s-=1}l?(c=(o=l.ref)==null?void 0:o.current)==null||c.focus():this.restoreFocusToPrevElement()}}const eP=function(t){const{children:r,timeout:n=5e3,limit:i=3,toastManager:a}=t,l=ks(()=>new ZA({timeout:n,limit:i,viewport:null,toasts:[],hovering:!1,focused:!1,isWindowFocused:!0,prevFocusElement:null})).current;return gp(l.disposeEffect),E.useEffect(function(){return a?a[" subscribe"](({action:c,options:f})=>{const u=f.id;c==="promise"&&f.promise?l.promiseToast(f.promise,f):c==="update"&&u?l.updateToast(u,f):c==="close"&&u?l.closeToast(u):l.addToast(f)}):void 0},[l,n,a]),l.useSyncedValues({timeout:n,limit:i}),T.jsx(vp.Provider,{value:l,children:r})},Pu=E.forwardRef(function(t,r){const[n,i]=E.useState();qt(()=>{qA&&i("button")},[]);const a={tabIndex:0,role:n};return T.jsx("span",{...t,ref:r,style:ap,"aria-hidden":n?void 0:!0,...a,"data-base-ui-focus-guard":""})});let tP=function(e){return e.frontmostHeight="--toast-frontmost-height",e}({});const rP=E.forwardRef(function(t,r){var M;const{render:n,className:i,children:a,...l}=t,s=_p(),o=VA(),c=E.useRef(!1),f=E.useRef(!1),u=s.useState("isEmpty"),p=s.useState("toasts"),_=s.useState("focused"),y=s.useState("expanded"),v=s.useState("prevFocusElement"),h=((M=p[0])==null?void 0:M.height)??0,m=E.useMemo(()=>p.some(D=>D.transitionStatus==="ending"),[p]);E.useEffect(()=>{const D=s.state.viewport;if(!D)return;function O(F){u||F.key==="F6"&&F.target!==D&&(F.preventDefault(),s.setPrevFocusElement(Zl(Js(D))),D==null||D.focus({preventScroll:!0}),s.pauseTimers(),s.setFocused(!0))}const z=Ko(D);return z.addEventListener("keydown",O),()=>{z.removeEventListener("keydown",O)}},[s,u]),E.useEffect(()=>{const D=s.state.viewport;if(!D||u)return;const O=Ko(D);function z(H){H.target===O&&(s.setIsWindowFocused(!1),s.pauseTimers())}function F(H){if(H.relatedTarget||H.target===O)return;const I=wp(H),R=Zl(Js(D));(!yi(D,I)||!gd(R))&&s.resumeTimers(),o.start(0,()=>s.setIsWindowFocused(!0))}return O.addEventListener("blur",z,!0),O.addEventListener("focus",F,!0),()=>{O.removeEventListener("blur",z,!0),O.removeEventListener("focus",F,!0)}},[s,o,u]),E.useEffect(()=>{const D=s.state.viewport;if(!D||u)return;const O=Js(D);return O.addEventListener("pointerdown",s.handleDocumentPointerDown,!0),()=>{O.removeEventListener("pointerdown",s.handleDocumentPointerDown,!0)}},[u,s]);function d(D){var z,F,H;const O=s.state.viewport;O&&(c.current=!0,D.relatedTarget===O?(H=(F=(z=p[0])==null?void 0:z.ref)==null?void 0:F.current)==null||H.focus():s.restoreFocusToPrevElement())}function g(D){D.key==="Tab"&&D.shiftKey&&D.target===s.state.viewport&&(D.preventDefault(),s.restoreFocusToPrevElement(),s.resumeTimers())}E.useEffect(()=>{!s.state.isWindowFocused||m||!f.current||(s.resumeTimers(),s.setHovering(!1),f.current=!1)},[m,s]);function w(){s.pauseTimers(),s.setHovering(!0),f.current=!1}function b(){m?f.current=!0:(s.resumeTimers(),s.setHovering(!1))}function x(){if(c.current){c.current=!1;return}_||gd(Js(s.state.viewport).activeElement)&&(s.setFocused(!0),s.pauseTimers())}function C(D){!_||yi(s.state.viewport,D.relatedTarget)||(s.setFocused(!1),s.resumeTimers())}const S={tabIndex:-1,role:"region","aria-live":"polite","aria-atomic":!1,"aria-relevant":"additions text","aria-label":"Notifications",onMouseEnter:w,onMouseMove:w,onMouseLeave:b,onFocus:x,onBlur:C,onKeyDown:g,onClick:x},k={expanded:y},L=Ls("div",t,{ref:[r,s.setViewport],state:k,props:[S,{style:{[tP.frontmostHeight]:h?`${h}px`:void 0}},l,{children:T.jsxs(E.Fragment,{children:[!u&&v&&T.jsx(Pu,{onFocus:d}),a,!u&&v&&T.jsx(Pu,{onFocus:d})]})}]}),A=E.useMemo(()=>p.filter(D=>D.priority==="high"),[p]);return T.jsxs(E.Fragment,{children:[!u&&v&&T.jsx(Pu,{onFocus:d}),L,!_&&A.length>0&&T.jsx("div",{style:ap,children:A.map(D=>T.jsxs("div",{role:"alert","aria-atomic":!0,children:[T.jsx("div",{children:D.title}),T.jsx("div",{children:D.description})]},D.id))})]})});function nP(e){return lp(19)?e:e?"true":void 0}const wS=E.createContext(void 0);function Sp(){const e=E.useContext(wS);if(!e)throw new Error(Jr(66));return e}let xp=function(e){return e.startingStyle="data-starting-style",e.endingStyle="data-ending-style",e}({});const sP={[xp.startingStyle]:""},iP={[xp.endingStyle]:""},oP={transitionStatus(e){return e==="starting"?sP:e==="ending"?iP:null}};function aP(e){return e==null?e:"current"in e?e.current:e}function lP(e,t=!1,r=!0){const n=WA();return Yr((i,a=null)=>{n.cancel();function l(){hn.flushSync(i)}const s=aP(e);if(s==null)return;const o=s;if(typeof o.getAnimations!="function"||globalThis.BASE_UI_ANIMATIONS_DISABLED)i();else{let u=function(){const _=xp.startingStyle;if(!o.hasAttribute(_)){n.request(p);return}const y=new MutationObserver(()=>{o.hasAttribute(_)||(y.disconnect(),p())});y.observe(o,{attributes:!0,attributeFilter:[_]}),a==null||a.addEventListener("abort",()=>y.disconnect(),{once:!0})},p=function(){Promise.all(o.getAnimations().map(_=>_.finished)).then(()=>{a!=null&&a.aborted||l()}).catch(()=>{const _=o.getAnimations();if(r){if(a!=null&&a.aborted)return;l()}else _.length>0&&_.some(y=>y.pending||y.playState!=="finished")&&p()})};var c=u,f=p;if(t){u();return}n.request(p)}})}function cP(e){const{enabled:t=!0,open:r,ref:n,onComplete:i}=e,a=Yr(i),l=lP(n,r,!1);E.useEffect(()=>{if(!t)return;const s=new AbortController;return l(a,s.signal),()=>{s.abort()}},[t,r,a,l])}let ss=function(e){return e.index="--toast-index",e.offsetY="--toast-offset-y",e.height="--toast-height",e.swipeMovementX="--toast-swipe-movement-x",e.swipeMovementY="--toast-swipe-movement-y",e}({});const uP={...oP,swipeDirection(e){return e?{"data-swipe-direction":e}:null}},Wi=40,hP=10,En=.5,dP=1;function jv(e,t,r){switch(e){case"up":return-r;case"down":return r;case"left":return-t;case"right":return t;default:return 0}}function fP(e){const r=window.getComputedStyle(e).transform;let n=0,i=0,a=1;if(r&&r!=="none"){const l=r.match(/matrix(?:3d)?\(([^)]+)\)/);if(l){const s=l[1].split(", ").map(parseFloat);s.length===6?(n=s[4],i=s[5],a=Math.sqrt(s[0]*s[0]+s[1]*s[1])):s.length===16&&(n=s[12],i=s[13],a=s[0])}}return{x:n,y:i,scale:a}}const pP=E.forwardRef(function(t,r){var ve;const{toast:n,render:i,className:a,swipeDirection:l=["down","right"],...s}=t,o=((ve=n.positionerProps)==null?void 0:ve.anchor)!==void 0;let c=[];o||(c=Array.isArray(l)?l:[l]);const f=c.length>0,u=_p(),[p,_]=E.useState(void 0),[y,v]=E.useState(!1),[h,m]=E.useState(!1),[d,g]=E.useState(!1),[w,b]=E.useState({x:0,y:0}),[x,C]=E.useState({x:0,y:0,scale:1}),[S,k]=E.useState(),[L,A]=E.useState(),[M,D]=E.useState(null),O=E.useRef(null),z=E.useRef({x:0,y:0}),F=E.useRef({x:0,y:0,scale:1}),H=E.useRef(void 0),I=E.useRef(0),R=E.useRef(!1),P=E.useRef({x:0,y:0}),N=E.useRef(!1),j=u.useState("toastIndex",n.id),W=u.useState("toastVisibleIndex",n.id),V=u.useState("toastOffsetY",n.id),Z=u.useState("focused"),Q=u.useState("expanded");cP({open:n.transitionStatus!=="ending",ref:O,onComplete(){n.transitionStatus==="ending"&&u.removeToast(n.id)}});const $=Yr((se=!1)=>{const ae=O.current;if(!ae)return;const fe=ae.style.height;ae.style.height="auto";const ie=ae.offsetHeight;ae.style.height=fe;function ge(){u.updateToastInternal(n.id,{ref:O,height:ie,...n.transitionStatus==="starting"?{transitionStatus:void 0}:{}})}se?hn.flushSync(ge):ge()});qt($,[$]);function B(se,ae){let fe=se,ie=ae;return!c.includes("left")&&!c.includes("right")?fe=se>0?se**En:-(Math.abs(se)**En):(!c.includes("right")&&se>0&&(fe=se**En),!c.includes("left")&&se<0&&(fe=-(Math.abs(se)**En))),!c.includes("up")&&!c.includes("down")?ie=ae>0?ae**En:-(Math.abs(ae)**En):(!c.includes("down")&&ae>0&&(ie=ae**En),!c.includes("up")&&ae<0&&(ie=-(Math.abs(ae)**En))),{x:fe,y:ie}}function K(se){var ie;if(se.button!==0)return;se.pointerType==="touch"&&u.pauseTimers();const ae=wp(se.nativeEvent);if(!(ae&&ae.closest('button,a,input,textarea,[role="button"],[data-swipe-ignore]'))){if(R.current=!1,H.current=void 0,I.current=0,z.current={x:se.clientX,y:se.clientY},P.current=z.current,O.current){const ge=fP(O.current);F.current=ge,C(ge),b({x:ge.x,y:ge.y})}u.setHovering(!0),v(!0),m(!1),D(null),N.current=!0,(ie=O.current)==null||ie.setPointerCapture(se.pointerId)}}function U(se){if(!y)return;se.preventDefault(),N.current&&(z.current={x:se.clientX,y:se.clientY},N.current=!1);const{clientY:ae,clientX:fe,movementX:ie,movementY:ge}=se;(ge<0&&ae>P.current.y||ge>0&&ae<P.current.y)&&(P.current={x:P.current.x,y:ae}),(ie<0&&fe>P.current.x||ie>0&&fe<P.current.x)&&(P.current={x:fe,y:P.current.y});const be=fe-z.current.x,Te=ae-z.current.y,je=ae-P.current.y,He=fe-P.current.x;if(!h&&Math.sqrt(be*be+Te*Te)>=dP&&(m(!0),M===null)){const J=c.includes("left")||c.includes("right"),ee=c.includes("up")||c.includes("down");if(J&&ee){const Be=Math.abs(be),q=Math.abs(Te);D(Be>q?"horizontal":"vertical")}}let Pe;if(!H.current)M==="vertical"?Te>0?Pe="down":Te<0&&(Pe="up"):M==="horizontal"?be>0?Pe="right":be<0&&(Pe="left"):Math.abs(be)>=Math.abs(Te)?Pe=be>0?"right":"left":Pe=Te>0?"down":"up",Pe&&c.includes(Pe)&&(H.current=Pe,I.current=jv(Pe,be,Te),_(Pe));else{const Qe=H.current,J=jv(Qe,He,je);J>Wi?(R.current=!1,_(Qe)):!(c.includes("left")&&c.includes("right"))&&!(c.includes("up")&&c.includes("down"))&&I.current-J>=hP&&(R.current=!0)}const Oe=B(be,Te);let ke=F.current.x,Le=F.current.y;M==="horizontal"?(c.includes("left")||c.includes("right"))&&(ke+=Oe.x):(M==="vertical"||(c.includes("left")||c.includes("right"))&&(ke+=Oe.x),(c.includes("up")||c.includes("down"))&&(Le+=Oe.y)),b({x:ke,y:Le})}function te(se){var be;if(!y)return;if(v(!1),m(!1),D(null),(be=O.current)==null||be.releasePointerCapture(se.pointerId),R.current){b({x:x.x,y:x.y}),_(void 0);return}let ae=!1;const fe=w.x-x.x,ie=w.y-x.y;let ge;for(const Te of c){switch(Te){case"right":fe>Wi&&(ae=!0,ge="right");break;case"left":fe<-Wi&&(ae=!0,ge="left");break;case"down":ie>Wi&&(ae=!0,ge="down");break;case"up":ie<-Wi&&(ae=!0,ge="up");break}if(ae)break}ae?(_(ge),g(!0),u.closeToast(n.id)):(b({x:x.x,y:x.y}),_(void 0))}function Y(se){if(se.key==="Escape"){if(!O.current||!yi(O.current,Zl(Js(O.current))))return;u.closeToast(n.id)}}E.useEffect(()=>{if(!f)return;const se=O.current;if(!se)return;function ae(fe){yi(se,fe.target)&&fe.preventDefault()}return se.addEventListener("touchmove",ae,{passive:!1}),()=>{se.removeEventListener("touchmove",ae)}},[f]);function ye(){if(!y&&w.x===x.x&&w.y===x.y&&!d)return{[ss.swipeMovementX]:"0px",[ss.swipeMovementY]:"0px"};const se=w.x-x.x,ae=w.y-x.y;return{transition:y?"none":void 0,transform:y?`translateX(${w.x}px) translateY(${w.y}px) scale(${x.scale})`:void 0,[ss.swipeMovementX]:`${se}px`,[ss.swipeMovementY]:`${ae}px`}}const pe=n.priority==="high",ne={role:pe?"alertdialog":"dialog",tabIndex:0,"aria-modal":!1,"aria-labelledby":S,"aria-describedby":L,"aria-hidden":pe&&!Z?!0:void 0,onPointerDown:f?K:void 0,onPointerMove:f?U:void 0,onPointerUp:f?te:void 0,onKeyDown:Y,inert:nP(n.limited),style:{...ye(),[ss.index]:n.transitionStatus==="ending"?j:W,[ss.offsetY]:`${V}px`,[ss.height]:n.height?`${n.height}px`:void 0}},oe=E.useMemo(()=>({rootRef:O,toast:n,titleId:S,setTitleId:k,descriptionId:L,setDescriptionId:A,swiping:y,swipeDirection:p,recalculateHeight:$,index:j,visibleIndex:W,expanded:Q}),[n,S,L,y,p,$,j,W,Q]),ce={transitionStatus:n.transitionStatus,expanded:Q,limited:n.limited||!1,type:n.type,swiping:oe.swiping,swipeDirection:oe.swipeDirection},ue=Ls("div",t,{ref:[r,oe.rootRef],state:ce,stateAttributesMapping:uP,props:[ne,s]});return T.jsx(wS.Provider,{value:oe,children:ue})}),mP=E.forwardRef(function(t,r){const{render:n,className:i,id:a,children:l,...s}=t,{toast:o,setDescriptionId:c}=Sp(),f=l??o.description,u=!!f,p=up(a);qt(()=>{if(u)return c(p),()=>{c(void 0)}},[u,p,c]);const _={type:o.type},y=Ls("p",t,{ref:r,state:_,props:{...s,id:p,children:f}});return u?y:null}),gP=E.forwardRef(function(t,r){const{render:n,className:i,id:a,children:l,...s}=t,{toast:o,setTitleId:c}=Sp(),f=l??o.title,u=!!f,p=up(a);qt(()=>{if(u)return c(p),()=>{c(void 0)}},[u,p,c]);const _={type:o.type},y=Ls("h2",t,{ref:r,state:_,props:{...s,id:p,children:f}});return u?y:null}),vP=E.forwardRef(function(t,r){const{render:n,className:i,disabled:a,nativeButton:l=!0,...s}=t,o=_p(),{toast:c}=Sp(),f=o.useState("expanded"),[u,p]=E.useState(!1),{getButtonProps:_,buttonRef:y}=Vw({disabled:a,native:l}),v={type:c.type};return Ls("button",t,{ref:[r,y],state:v,props:[{"aria-hidden":!f&&!u,onClick(){o.closeToast(c.id)},onFocus(){p(!0)},onBlur(){p(!1)}},s,_]})});function _P(){const e=E.useContext(vp);if(!e)throw new Error(Jr(73));const t=e.useState("toasts");return E.useMemo(()=>({toasts:t,add:e.addToast,close:e.closeToast,update:e.updateToast,promise:e.promiseToast}),[t,e])}function yP(){const e=new Set;function t(r){e.forEach(n=>n(r))}return{" subscribe":function(n){return e.add(n),()=>{e.delete(n)}},add(r){const n=r.id||yS("toast"),i={...r,id:n,transitionStatus:"starting"};return t({action:"add",options:i}),n},close(r){t({action:"close",options:{id:r}})},update(r,n){t({action:"update",options:{...n,id:r}})},promise(r,n){let i=r;return t({action:"promise",options:{...n,promise:r,setPromise(a){i=a}}}),i}}}const wP=5e3,SS=yP();function SP({toast:e}){return T.jsxs(pP,{toast:e,className:Yl("relative flex w-80 items-start gap-3 border bg-elevated p-4 shadow-lg","data-[swipe=move]:translate-x-[var(--toast-swipe-move-x)]","data-[ending-style]:translate-x-[var(--toast-swipe-end-x)]","data-[ending-style]:opacity-0","data-[starting-style]:translate-y-2 data-[starting-style]:opacity-0","transition-all duration-200",e.type==="error"&&"border-error/50",e.type==="success"&&"border-approval/50",(!e.type||e.type==="info")&&"border-border"),children:[T.jsxs("div",{className:"flex-1 min-w-0",children:[T.jsx(gP,{className:Yl("text-sm font-medium",e.type==="error"&&"text-error",e.type==="success"&&"text-approval",(!e.type||e.type==="info")&&"text-primary"),children:e.title}),e.description&&T.jsx(mP,{className:"mt-1 text-xs text-muted line-clamp-2",children:e.description})]}),T.jsx(vP,{className:"shrink-0 text-muted hover:text-primary transition-colors","aria-label":"Close",children:T.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[T.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),T.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]})}function xP(){const{toasts:e}=_P();return T.jsx(T.Fragment,{children:e.map(t=>T.jsx(SP,{toast:t},t.id))})}function bP(){return T.jsxs(eP,{timeout:wP,toastManager:SS,children:[T.jsx(xP,{}),T.jsx(rP,{className:"fixed bottom-4 right-4 z-[100] flex flex-col gap-2"})]})}const Fv=["CONNECTING","OPEN","CLOSING","CLOSED"],CP=3e3,EP=8e3,kP=15e3,LP=5e3,Iu=2e4,TP=1e4,RP=1500,DP=5e3,MP=750,AP=4,PP=5e3;class IP{constructor(){this.ws=null,this.listeners=new Set,this.statusListeners=new Set,this.status="connecting",this.error=null,this.reconnectAttempts=0,this.reconnectTimer=null,this.connectTimer=null,this.manualClose=!1,this.lastTick=Date.now(),this.wakeCheckInterval=null,this.lifecycleStarted=!1,this.heartbeatTimer=null,this.pongTimer=null,this.lastForceReconnectTs=0,this.pingSeq=0,this.connectionEpoch=0,this.consecutiveFailures=0,this.isResumeAttempt=!1,this.leakedSockets=new Set,this.verifyTimer=null,this.onVisibilityChange=()=>{var t;if(Ge("ws_visibility",{state:document.visibilityState,...this.wsSnap()},"info"),document.visibilityState==="visible"){const r=Date.now(),n=r-this.lastTick;this.lastTick=r,Ge("ws_resume",{gapMs:n,...this.wsSnap()},"info"),((t=this.ws)==null?void 0:t.readyState)===WebSocket.OPEN?this.verifyConnection():this.forceReconnect("visibilitychange",!0)}else this.stopHeartbeat(),this.cancelVerify(),this.reconnectTimer&&(window.clearTimeout(this.reconnectTimer),this.reconnectTimer=null)},this.onPageShow=t=>{Ge("ws_pageshow",{persisted:t.persisted,...this.wsSnap()},"info"),t.persisted&&(this.lastTick=Date.now(),this.forceReconnect("pageshow",!0))}}wsSnap(){return{status:this.status,ws:this.ws?Fv[this.ws.readyState]:null,attempt:this.reconnectAttempts,failures:this.consecutiveFailures,leaked:this.leakedSockets.size,online:typeof navigator<"u"?navigator.onLine:void 0,verifying:this.verifyTimer!==null,buffered:this.ws?this.ws.bufferedAmount:void 0}}connect(){if(this.ws){const a=this.ws.readyState===WebSocket.OPEN;if(a&&this.status==="connected"){Ge("ws_connect_skip",{reason:"already_open",...this.wsSnap()});return}Ge("ws_connect_destroy_zombie",{reason:a?"open_desynced":"not_open",...this.wsSnap()}),this.destroySocket()}this.manualClose=!1,this.clearConnectTimer(),this.setStatus("connecting");const r=`${window.location.protocol==="https:"?"wss":"ws"}://${window.location.host}/ws`;Ge("ws_connect",{url:r,resume:this.isResumeAttempt,...this.wsSnap()},"info");const n=new WebSocket(r);this.ws=n,this.leakedSockets.add(n);const i=this.isResumeAttempt?EP:CP;this.isResumeAttempt=!1,this.connectTimer=window.setTimeout(()=>{if(this.ws!==n)return;this.connectTimer=null,n.readyState===WebSocket.OPEN&&this.status==="connected"||(Ge("ws_connect_timeout",{wsState:Fv[n.readyState],managerStatus:this.status,timeoutMs:i,...this.wsSnap()},"info"),this.consecutiveFailures+=1,this.destroySocket(),this.scheduleReconnect())},i),n.onopen=()=>{if(this.ws!==n){Ge("ws_onopen_stale",this.wsSnap(),"info");return}Ge("ws_onopen",this.wsSnap(),"info"),this.clearConnectTimer(),this.reconnectAttempts=0,this.consecutiveFailures=0,this.connectionEpoch+=1,this.leakedSockets.delete(n),this.setStatus("connected"),this.startHeartbeat()},n.onmessage=a=>{try{const l=a.data,s=performance.now(),o=JSON.parse(l),c=performance.now()-s,f=o;if(f._parseMs=Math.round(c),f._rawLength=l.length,o.type==="pong"){o.seq===this.pingSeq&&(this.clearPongTimer(),this.verifyTimer!==null&&(this.cancelVerify(),Ge("ws_verify_ok",this.wsSnap(),"info"),this.startHeartbeat(DP)));return}this.listeners.forEach(u=>u(o))}catch{}},n.onerror=()=>{this.ws===n&&(Ge("ws_onerror",this.wsSnap(),"info"),this.clearConnectTimer())},n.onclose=a=>{if(this.ws!==n){Ge("ws_onclose_stale",{code:a.code,...this.wsSnap()},"info");return}Ge("ws_onclose",{code:a.code,reason:a.reason,clean:a.wasClean,...this.wsSnap()},"info"),this.clearConnectTimer(),this.cancelVerify(),this.consecutiveFailures+=1,this.ws=null,this.manualClose?this.setStatus("disconnected"):this.scheduleReconnect()}}disconnect(){this.manualClose=!0,this.clearConnectTimer(),this.cancelVerify(),this.reconnectTimer&&(window.clearTimeout(this.reconnectTimer),this.reconnectTimer=null),this.destroySocket(),this.setStatus("disconnected")}startLifecycleListeners(){this.lifecycleStarted||typeof document>"u"||typeof window>"u"||(this.lifecycleStarted=!0,document.addEventListener("visibilitychange",this.onVisibilityChange),window.addEventListener("pageshow",this.onPageShow),this.lastTick=Date.now(),this.wakeCheckInterval=window.setInterval(()=>{const t=Date.now(),r=t-this.lastTick;this.isHidden()||(r>kP&&(Ge("ws_time_jump",{gapMs:r,...this.wsSnap()},"info"),this.forceReconnect("time_jump",!0)),this.lastTick=t)},LP))}stopLifecycleListeners(){this.lifecycleStarted&&(this.lifecycleStarted=!1,document.removeEventListener("visibilitychange",this.onVisibilityChange),window.removeEventListener("pageshow",this.onPageShow),this.wakeCheckInterval!==null&&(window.clearInterval(this.wakeCheckInterval),this.wakeCheckInterval=null))}send(t){var r;if(((r=this.ws)==null?void 0:r.readyState)!==WebSocket.OPEN)return!1;try{return this.ws.send(JSON.stringify(t)),!0}catch(n){return Ge("ws_send_error",{messageType:t.type,error:n instanceof Error?n.message:String(n),...this.wsSnap()},"info"),this.destroySocket(),this.scheduleReconnect(),!1}}subscribe(t){return this.listeners.add(t),()=>this.listeners.delete(t)}subscribeStatus(t){return this.statusListeners.add(t),t(this.status,this.error,this.connectionEpoch),()=>this.statusListeners.delete(t)}getStatus(){return this.status}getConnectionEpoch(){return this.connectionEpoch}verifyConnection(){this.cancelVerify(),this.stopHeartbeat(),this.pingSeq+=1;const t=this.pingSeq,r=this.ws;if(Ge("ws_verify",{seq:t,...this.wsSnap()},"info"),!this.send({type:"ping",seq:t})){Ge("ws_verify_send_fail",this.wsSnap(),"info"),this.forceReconnect("verify_send_fail",!0);return}this.verifyTimer=window.setTimeout(()=>{this.verifyTimer=null,this.ws===r&&(Ge("ws_verify_timeout",this.wsSnap(),"info"),this.forceReconnect("verify_timeout",!0))},RP)}cancelVerify(){this.verifyTimer!==null&&(window.clearTimeout(this.verifyTimer),this.verifyTimer=null)}forceReconnect(t="unknown",r=!1){var a;if(this.manualClose){Ge("ws_force_skip",{trigger:t,reason:"manual_close"});return}const n=Date.now(),i=r?200:500;if(n-this.lastForceReconnectTs<i){Ge("ws_force_skip",{trigger:t,reason:"debounce",force:r});return}if(!r&&((a=this.ws)==null?void 0:a.readyState)===WebSocket.OPEN&&this.status==="connected"){Ge("ws_force_skip",{trigger:t,reason:"already_connected"});return}this.lastForceReconnectTs=n,Ge("ws_force_reconnect",{trigger:t,force:r,...this.wsSnap()},"info"),this.reconnectAttempts=0,this.consecutiveFailures=0,this.reconnectTimer&&(window.clearTimeout(this.reconnectTimer),this.reconnectTimer=null),this.destroySocket(),r?(this.purgeLeakedSockets(),this.isResumeAttempt=!0,this.setStatus("reconnecting"),this.reconnectTimer=window.setTimeout(()=>{this.reconnectTimer=null,this.connect()},MP)):this.connect()}startHeartbeat(t){this.stopHeartbeat();const r=()=>{var n;((n=this.ws)==null?void 0:n.readyState)===WebSocket.OPEN&&(this.pingSeq+=1,this.send({type:"ping",seq:this.pingSeq})&&(this.clearPongTimer(),this.pongTimer=window.setTimeout(()=>{this.pongTimer=null,Ge("ws_pong_timeout",this.wsSnap(),"info"),this.destroySocket(),this.scheduleReconnect()},TP)))};t!==void 0&&t<Iu?this.heartbeatTimer=window.setTimeout(()=>{r(),this.heartbeatTimer=window.setInterval(r,Iu)},t):this.heartbeatTimer=window.setInterval(r,Iu)}stopHeartbeat(){this.heartbeatTimer!==null&&(window.clearTimeout(this.heartbeatTimer),this.heartbeatTimer=null),this.clearPongTimer()}clearPongTimer(){this.pongTimer!==null&&(window.clearTimeout(this.pongTimer),this.pongTimer=null)}setStatus(t,r=null){this.status=t,this.error=r,this.statusListeners.forEach(n=>n(t,r,this.connectionEpoch))}scheduleReconnect(){if(this.stopHeartbeat(),this.isHidden()){Ge("ws_schedule_skip",{reason:"hidden",...this.wsSnap()}),this.setStatus("reconnecting");return}if(this.consecutiveFailures>=AP){Ge("ws_stall_detected",this.wsSnap(),"info"),this.purgeLeakedSockets(),this.consecutiveFailures=0,this.reconnectAttempts=0,this.isResumeAttempt=!0,this.setStatus("reconnecting"),this.reconnectTimer=window.setTimeout(()=>{this.reconnectTimer=null,this.connect()},PP);return}this.reconnectAttempts+=1;const t=Math.min(1e3*2**(this.reconnectAttempts-1),3e4);Ge("ws_schedule_reconnect",{delay:t,...this.wsSnap()}),this.setStatus("reconnecting"),this.reconnectTimer&&window.clearTimeout(this.reconnectTimer),this.reconnectTimer=window.setTimeout(()=>{this.reconnectTimer=null,this.connect()},t)}isHidden(){return typeof document<"u"&&document.visibilityState==="hidden"}clearConnectTimer(){this.connectTimer&&(window.clearTimeout(this.connectTimer),this.connectTimer=null)}destroySocket(){if(this.clearConnectTimer(),this.stopHeartbeat(),this.cancelVerify(),!this.ws)return;const t=this.ws;this.ws=null,this.leakedSockets.add(t),t.onopen=null,t.onmessage=null,t.onerror=null,t.onclose=null;try{t.close()}catch{}}purgeLeakedSockets(){if(this.leakedSockets.size!==0){Ge("ws_purge_leaked",{count:this.leakedSockets.size},"info");for(const t of this.leakedSockets)try{t.onopen=null,t.onmessage=null,t.onerror=null,t.onclose=null,t.close()}catch{}this.leakedSockets.clear()}}}const Hr=new IP;function OP(){const e=Ve(c=>c.setConnectionStatus),t=Ve(c=>c.setConnectionError),[r,n]=E.useState(Hr.getStatus()),[i,a]=E.useState(Hr.getConnectionEpoch());E.useEffect(()=>{Hr.connect(),Hr.startLifecycleListeners();const c=Hr.subscribeStatus((f,u,p)=>{n(f),a(p),e(f),t(u)});return()=>{c(),Hr.stopLifecycleListeners()}},[t,e]);const l=E.useMemo(()=>c=>{Hr.send(c)},[]),s=E.useMemo(()=>Hr.subscribe.bind(Hr),[]),o=E.useMemo(()=>()=>Hr.getConnectionEpoch(),[]);return{status:r,connectionEpoch:i,sendMessage:l,subscribe:s,getConnectionEpoch:o}}const BP=100;function NP({viewport:e,win:t,doc:r}){if(!e)return!1;const n=Math.max(0,e.offsetTop||0),i=Math.max(0,e.offsetLeft||0),a=t.innerHeight-(e.height+n),l=Math.max(0,a),s=Math.max(0,e.height||0),o=Math.max(0,e.width||0);return r.documentElement.style.setProperty("--keyboard-inset",`${l}px`),r.documentElement.style.setProperty("--viewport-offset-top",`${n}px`),r.documentElement.style.setProperty("--viewport-offset-left",`${i}px`),r.documentElement.style.setProperty("--visual-viewport-height",`${s}px`),r.documentElement.style.setProperty("--visual-viewport-width",`${o}px`),l>BP?r.documentElement.classList.add("keyboard-visible"):r.documentElement.classList.remove("keyboard-visible"),!0}function jP(e){e.documentElement.style.removeProperty("--keyboard-inset"),e.documentElement.style.removeProperty("--viewport-offset-top"),e.documentElement.style.removeProperty("--viewport-offset-left"),e.documentElement.style.removeProperty("--visual-viewport-height"),e.documentElement.style.removeProperty("--visual-viewport-width"),e.documentElement.classList.remove("keyboard-visible")}function FP(){E.useEffect(()=>{const e=window.visualViewport;if(!e)return;let t=null,r=null;const n=()=>{var v;const _=document.activeElement;if(!_)return!1;const y=(v=_.tagName)==null?void 0:v.toLowerCase();return y==="input"||y==="textarea"?!0:!!_.isContentEditable},i=()=>{NP({viewport:e,win:window,doc:document})},a=()=>{if(typeof window.requestAnimationFrame!="function"){i();return}t!==null&&window.cancelAnimationFrame(t);const _=performance.now(),y=()=>{i(),performance.now()-_<1500?t=window.requestAnimationFrame(y):t=null};t=window.requestAnimationFrame(y)},l=()=>{if(!n()){o();return}i()},s=()=>{r!==null||typeof window.setInterval!="function"||(r=window.setInterval(l,250),l())},o=()=>{r===null||typeof window.clearInterval!="function"||(window.clearInterval(r),r=null)},c=()=>{n()?(a(),s(),i()):o()},f=()=>{c()},u=()=>{c()},p=()=>{a()};return i(),c(),e.addEventListener("resize",i),e.addEventListener("scroll",i),typeof window.addEventListener=="function"&&(window.addEventListener("resize",i),window.addEventListener("orientationchange",p)),typeof document.addEventListener=="function"&&(document.addEventListener("focusin",f),document.addEventListener("focusout",u),document.addEventListener("focus",f,!0),document.addEventListener("blur",u,!0)),()=>{e.removeEventListener("resize",i),e.removeEventListener("scroll",i),typeof window.removeEventListener=="function"&&(window.removeEventListener("resize",i),window.removeEventListener("orientationchange",p)),typeof document.removeEventListener=="function"&&(document.removeEventListener("focusin",f),document.removeEventListener("focusout",u),document.removeEventListener("focus",f,!0),document.removeEventListener("blur",u,!0)),t!==null&&typeof window.cancelAnimationFrame=="function"&&window.cancelAnimationFrame(t),o(),jP(document)}},[])}function HP(){const[e,t]=E.useState(!1),[r,n]=E.useState(void 0),[i,a]=E.useState(void 0),[l,s]=E.useState(void 0),[o,c]=E.useState(!1),[f,u]=E.useState(null),[p,_]=E.useState(null),y=Ve(J=>J.sessions),v=Ve(J=>J.agentSessions),h=Ve(J=>J.selectedSessionId),m=Ve(J=>J.setSessions),d=Ve(J=>J.setAgentSessions),g=Ve(J=>J.setHostStatuses),w=Ve(J=>J.updateSession),b=Ve(J=>J.setSelectedSessionId),x=Ve(J=>J.hasLoaded),C=Ve(J=>J.connectionStatus),S=Ve(J=>J.connectionError),k=Ve(J=>J.clearExitingSession),L=Ve(J=>J.markSessionExiting),A=Ve(J=>J.setRemoteAllowControl),M=Ve(J=>J.setRemoteAllowAttach),D=Ve(J=>J.setHostLabel),O=Ve(J=>J.hostStatuses),z=Ve(J=>J.remoteAllowControl),F=Ve(J=>J.hostLabel),H=ql(J=>J.theme),I=hC(),R=me(J=>J.defaultProjectDir),P=me(J=>J.commandPresets),N=me(J=>J.defaultPresetId),j=me(J=>J.lastProjectPath),W=me(J=>J.setLastProjectPath),V=me(J=>J.addRecentPath),Z=me(J=>J.shortcutModifier),Q=me(J=>J.sidebarWidth),$=me(J=>J.setSidebarWidth),B=me(J=>J.projectFilters),K=me(J=>J.hostFilters),U=me(J=>J.soundOnPermission),te=me(J=>J.soundOnIdle),{sendMessage:Y,subscribe:ye,connectionEpoch:pe,getConnectionEpoch:ne}=OP();FP(),E.useEffect(()=>{if(typeof document>"u"||!U&&!te)return;let J=!1;const ee=()=>{J&&!J3()||(J=!0,fd())};return document.addEventListener("click",ee,{passive:!0}),document.addEventListener("keydown",ee,{passive:!0}),document.addEventListener("touchstart",ee,{passive:!0}),()=>{document.removeEventListener("click",ee),document.removeEventListener("keydown",ee),document.removeEventListener("touchstart",ee)}},[U,te]);const oe=E.useRef(!1),ce=E.useCallback(J=>{J.preventDefault(),oe.current=!0,document.body.style.cursor="col-resize",document.body.style.userSelect="none"},[]);E.useEffect(()=>{if(typeof document>"u"||typeof document.addEventListener!="function")return;const J=Be=>{if(!oe.current)return;const q=Be.clientX;$(Math.max(ty,Math.min(ry,q)))},ee=()=>{oe.current&&(oe.current=!1,document.body.style.cursor="",document.body.style.userSelect="")};return document.addEventListener("mousemove",J),document.addEventListener("mouseup",ee),()=>{document.removeEventListener("mousemove",J),document.removeEventListener("mouseup",ee)}},[$]),E.useEffect(()=>{const J=ye(ee=>{var Be,q;if(ee.type==="sessions"){const de=Ve.getState().sessions,{soundOnPermission:X,soundOnIdle:_e}=me.getState();if(X||_e)for(const re of ee.sessions){const le=de.find(we=>we.id===re.id);le&&le.status!==re.status&&(le.status!=="permission"&&re.status==="permission"&&X&&pd(),le.status==="working"&&re.status==="waiting"&&_e&&md())}if(ge.current.size>0){const re=ne();for(const[le,we]of ge.current)we.epoch!==re&&ge.current.delete(le)}ge.current.size>0?m(ee.sessions.filter(re=>!ge.current.has(re.id))):m(ee.sessions)}if(ee.type==="host-status"&&g(ee.hosts),ee.type==="server-config"&&(A(ee.remoteAllowControl),M(ee.remoteAllowAttach),D(ee.hostLabel),ee.clientLogLevel&&YR(ee.clientLogLevel)),ee.type==="session-update"){const X=Ve.getState().sessions.find(le=>le.id===ee.session.id),_e=X==null?void 0:X.status,re=ee.session.status;if(w(ee.session),_e){const{soundOnPermission:le,soundOnIdle:we}=me.getState();_e!=="permission"&&re==="permission"&&le&&pd(),_e==="working"&&re==="waiting"&&we&&md()}}if(ee.type==="session-created"){const de=Ve.getState().sessions;de.some(re=>re.id===ee.session.id)||m([ee.session,...de]),b(ee.session.id),V(ee.session.projectPath);const{projectFilters:X,setProjectFilters:_e}=me.getState();X.length>0&&!X.includes(ee.session.projectPath)&&_e([...X,ee.session.projectPath])}if(ee.type==="session-removed"){ge.current.delete(ee.sessionId);const de=Ve.getState().sessions,X=de.filter(_e=>_e.id!==ee.sessionId);X.length!==de.length&&m(X)}if(ee.type==="agent-sessions"&&d(ee.active,ee.inactive),ee.type==="agent-sessions-active"){const de=Ve.getState().agentSessions;d(ee.active,de.inactive)}if(ee.type==="session-orphaned"&&!ee.supersededBy){const de=Ve.getState().sessions,X=de.filter(_e=>{var re;return((re=_e.agentSessionId)==null?void 0:re.trim())!==ee.session.sessionId});X.length!==de.length&&m(X)}if(ee.type==="session-activated"){const de=Ve.getState().sessions.find(X=>X.tmuxWindow===ee.window);de&&w({...de,agentSessionId:ee.session.sessionId,agentSessionName:ee.session.displayName,logFilePath:ee.session.logFilePath,isPinned:ee.session.isPinned,lastUserMessage:ee.session.lastUserMessage??de.lastUserMessage})}if(ee.type==="session-resume-result")if(ee.ok&&ee.session){const de=Ve.getState().sessions;de.some(X=>X.id===ee.session.id)||m([ee.session,...de]),b(ee.session.id)}else ee.ok||(u(`${(Be=ee.error)==null?void 0:Be.code}: ${(q=ee.error)==null?void 0:q.message}`),window.setTimeout(()=>u(null),6e3));if(ee.type==="terminal-error"&&(!ee.sessionId||ee.sessionId===h)&&(u(`${ee.code}: ${ee.message}`),window.setTimeout(()=>u(null),6e3)),ee.type==="terminal-ready"&&ee.sessionId===h&&u(null),ee.type==="error"&&(u(ee.message),window.setTimeout(()=>u(null),6e3)),ee.type==="kill-failed"){const de=ge.current.get(ee.sessionId);if(de){const X=Ve.getState().sessions;X.some(_e=>_e.id===ee.sessionId)||m([de.session,...X]),de.wasSelected&&b(ee.sessionId),ge.current.delete(ee.sessionId)}k(ee.sessionId),u(ee.message),window.setTimeout(()=>u(null),6e3)}ee.type==="session-pin-result"&&!ee.ok&&ee.error&&(u(ee.error),window.setTimeout(()=>u(null),6e3)),ee.type==="session-resurrection-failed"&&SS.add({title:"Session resurrection failed",description:`"${ee.displayName}" could not be resumed: ${ee.error}`,type:"error",timeout:8e3})});return()=>{J()}},[h,V,k,Y,b,m,d,g,A,M,D,ye,w]);const ue=E.useMemo(()=>y.find(J=>J.id===h)||null,[h,y]);E.useEffect(()=>{ue!=null&&ue.projectPath&&!ue.remote&&W(ue.projectPath)},[ue==null?void 0:ue.projectPath,ue==null?void 0:ue.remote,W]);const ve=me(J=>J.sessionSortMode),se=me(J=>J.sessionSortDirection),ae=me(J=>J.manualSessionOrder),fe=E.useMemo(()=>np(y,{mode:ve,direction:se,manualOrder:ae}),[y,ve,se,ae]),ie=E.useMemo(()=>{let J=fe;return B.length>0&&(J=J.filter(ee=>B.includes(ee.projectPath))),K.length>0&&(J=J.filter(ee=>K.includes(ee.host??""))),J},[fe,B,K]);E.useEffect(()=>{h&&ie.length>0&&!ie.some(J=>J.id===h)&&b(ie[0].id)},[h,ie,b]),E.useEffect(()=>{window.matchMedia("(max-width: 767px)").matches&&x&&h===null&&fe.length>0&&b(fe[0].id)},[x,h,fe,b]);const ge=E.useRef(new Map),be=E.useCallback(J=>{const{sessions:ee,selectedSessionId:Be}=Ve.getState(),q=ee.find(de=>de.id===J);q&&ge.current.set(J,{session:q,wasSelected:Be===J,epoch:ne()}),L(J),m(ee.filter(de=>de.id!==J)),Y({type:"session-kill",sessionId:J})},[L,m,Y]);E.useEffect(()=>{const J=ea(Z),ee=Be=>{if(Be.defaultPrevented)return;const q=Be.code,de=WC(Be,J);if(de&&(q==="BracketLeft"||q==="BracketRight")){Be.preventDefault();const X=ie;if(X.length===0)return;const _e=X.findIndex(we=>we.id===h);if(_e===-1){b(X[0].id);return}const le=(_e+(q==="BracketLeft"?-1:1)+X.length)%X.length;b(X[le].id);return}if(de&&q==="KeyN"){Be.preventDefault(),!e&&I&&t(!0);return}if(de&&q==="KeyX"){Be.preventDefault(),h&&!e&&be(h);return}};return window.addEventListener("keydown",ee),()=>window.removeEventListener("keydown",ee)},[e,h,b,ie,be,Z,I]);const Te=()=>I?(n(void 0),a(void 0),s(void 0),t(!0),!0):!1,je=()=>c(!0),He=(J,ee,Be,q)=>{Y({type:"session-create",projectPath:J,name:ee,command:Be,host:q}),q||W(J)},Pe=J=>{Y({type:"session-resume",sessionId:J})},Oe=(J,ee)=>{Y({type:"session-rename",sessionId:J,newName:ee})},ke=E.useCallback(J=>{const ee=y.find(Be=>Be.id===J);ee&&Y({type:"session-create",projectPath:ee.projectPath,command:ee.command||void 0,host:ee.remote&&ee.host?ee.host:void 0})},[y,Y]),Le=E.useCallback((J,ee)=>{Y({type:"session-pin",sessionId:J,isPinned:ee})},[Y]);E.useEffect(()=>{document.documentElement.setAttribute("data-theme",H)},[H]),E.useEffect(()=>{fetch("/api/server-info").then(J=>J.json()).then(J=>_(J)).catch(()=>{})},[]);const Qe=E.useMemo(()=>F?O.filter(J=>J.host!==F):O,[O,F]);return T.jsxs("div",{className:"flex h-full overflow-hidden",children:[T.jsxs("div",{className:"hidden h-full flex-col md:flex md:shrink-0",style:{width:Q},children:[T.jsx(KC,{connectionStatus:C,onNewSession:Te,onOpenSettings:je,tailscaleIp:(p==null?void 0:p.tailscaleIp)??null}),T.jsx(fw,{sessions:y,inactiveSessions:v.inactive,selectedSessionId:h,onSelect:b,onRename:Oe,onResume:Pe,onKill:be,onDuplicate:ke,onSetPinned:Le,loading:!x,error:S||f})]}),T.jsx("div",{className:"hidden md:block w-1 shrink-0 cursor-col-resize bg-transparent transition-colors hover:bg-white/10 active:bg-white/20",onMouseDown:ce}),T.jsx(fM,{session:ue,sessions:ie,connectionStatus:C,connectionEpoch:pe,sendMessage:Y,subscribe:ye,onClose:()=>b(null),onSelectSession:b,onNewSession:Te,onKillSession:be,onRenameSession:Oe,onOpenSettings:je,onResumeSession:Pe,onSetPinned:Le,inactiveSessions:v.inactive,loading:!x,error:S||f}),T.jsx(mM,{isOpen:e,onClose:()=>t(!1),onCreate:He,defaultProjectDir:R,commandPresets:P,defaultPresetId:N,lastProjectPath:j,activeProjectPath:ue&&!ue.remote?ue.projectPath:void 0,remoteHosts:Qe,remoteAllowControl:z,initialHost:r,initialPath:i,initialCommand:l}),T.jsx(Z3,{isOpen:o,onClose:()=>c(!1)}),T.jsx(bP,{})]})}const $P="modulepreload",zP=function(e){return"/"+e},Hv={},UP=function(t,r,n){let i=Promise.resolve();if(r&&r.length>0){document.getElementsByTagName("link");const l=document.querySelector("meta[property=csp-nonce]"),s=(l==null?void 0:l.nonce)||(l==null?void 0:l.getAttribute("nonce"));i=Promise.allSettled(r.map(o=>{if(o=zP(o),o in Hv)return;Hv[o]=!0;const c=o.endsWith(".css"),f=c?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${o}"]${f}`))return;const u=document.createElement("link");if(u.rel=c?"stylesheet":$P,c||(u.as="script"),u.crossOrigin="",u.href=o,s&&u.setAttribute("nonce",s),document.head.appendChild(u),c)return new Promise((p,_)=>{u.addEventListener("load",p),u.addEventListener("error",()=>_(new Error(`Unable to preload CSS for ${o}`)))})}))}function a(l){const s=new Event("vite:preloadError",{cancelable:!0});if(s.payload=l,window.dispatchEvent(s),!s.defaultPrevented)throw l}return i.then(l=>{for(const s of l||[])s.status==="rejected"&&a(s.reason);return t().catch(a)})};function WP(e={}){const{immediate:t=!1,onNeedRefresh:r,onOfflineReady:n,onRegistered:i,onRegisteredSW:a,onRegisterError:l}=e;let s,o;const c=async(u=!0)=>{await o};async function f(){if("serviceWorker"in navigator){if(s=await UP(async()=>{const{Workbox:u}=await import("./workbox-window.prod.es5-vqzQaGvo.js");return{Workbox:u}},[]).then(({Workbox:u})=>new u("/sw.js",{scope:"/",type:"classic"})).catch(u=>{l==null||l(u)}),!s)return;s.addEventListener("activated",u=>{(u.isUpdate||u.isExternal)&&window.location.reload()}),s.addEventListener("installed",u=>{u.isUpdate||n==null||n()}),s.register({immediate:t}).then(u=>{a?a("/sw.js",u):i==null||i(u)}).catch(u=>{l==null||l(u)})}}return o=f(),c}Zo()&&document.documentElement.classList.add("ios");$C()&&document.documentElement.classList.add("ios-pwa");WP({immediate:!0,onRegisteredSW(e,t){t&&(setInterval(()=>{t.update()},5*60*1e3),document.addEventListener("visibilitychange",()=>{document.visibilityState==="visible"&&t.update()}))}});const xS=document.getElementById("root");if(!xS)throw new Error("Root element not found");ey(xS).render(T.jsx(gt.StrictMode,{children:T.jsx(HP,{})}));
|