magpie-agent-console 0.0.0-stage → 1.0.0

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.
package/app/app.js ADDED
@@ -0,0 +1,202 @@
1
+ (()=>{var zM=Object.create;var Iu=Object.defineProperty;var PM=Object.getOwnPropertyDescriptor;var UM=Object.getOwnPropertyNames;var HM=Object.getPrototypeOf,FM=Object.prototype.hasOwnProperty;var jb=e=>{throw TypeError(e)};var qM=(e,t,i)=>t in e?Iu(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i;var ce=(e,t,i)=>()=>{if(i)throw i[0];try{return e&&(t=e(e=0)),t}catch(n){throw i=[n],n}};var me=(e,t)=>()=>{try{return t||e((t={exports:{}}).exports,t),t.exports}catch(i){throw t=0,i}},Vb=(e,t)=>{for(var i in t)Iu(e,i,{get:t[i],enumerable:!0})},KM=(e,t,i,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of UM(t))!FM.call(e,s)&&s!==i&&Iu(e,s,{get:()=>t[s],enumerable:!(n=PM(t,s))||n.enumerable});return e};var ae=(e,t,i)=>(i=e!=null?zM(HM(e)):{},KM(t||!e||!e.__esModule?Iu(i,"default",{value:e,enumerable:!0}):i,e));var he=(e,t,i)=>qM(e,typeof t!="symbol"?t+"":t,i),WM=(e,t,i)=>t.has(e)||jb("Cannot "+i);var Xb=(e,t,i)=>t.has(e)?jb("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,i);var tp=(e,t,i)=>(WM(e,t,"access private method"),i);var Zb=ce(()=>{});var Qb=ce(()=>{});var Jb=ce(()=>{});var e0=ce(()=>{});var t0=ce(()=>{});var h0=me(ft=>{"use strict";function rp(e,t){var i=e.length;e.push(t);e:for(;0<i;){var n=i-1>>>1,s=e[n];if(0<zu(s,t))e[n]=t,e[i]=s,i=n;else break e}}function Jn(e){return e.length===0?null:e[0]}function Uu(e){if(e.length===0)return null;var t=e[0],i=e.pop();if(i!==t){e[0]=i;e:for(var n=0,s=e.length,r=s>>>1;n<r;){var a=2*(n+1)-1,o=e[a],l=a+1,c=e[l];if(0>zu(o,i))l<s&&0>zu(c,o)?(e[n]=c,e[l]=i,n=l):(e[n]=o,e[a]=i,n=a);else if(l<s&&0>zu(c,i))e[n]=c,e[l]=i,n=l;else break e}}return t}function zu(e,t){var i=e.sortIndex-t.sortIndex;return i!==0?i:e.id-t.id}ft.unstable_now=void 0;typeof performance=="object"&&typeof performance.now=="function"?(i0=performance,ft.unstable_now=function(){return i0.now()}):(ip=Date,n0=ip.now(),ft.unstable_now=function(){return ip.now()-n0});var i0,ip,n0,Ns=[],rr=[],GM=1,gn=null,bi=3,ap=!1,Il=!1,zl=!1,op=!1,a0=typeof setTimeout=="function"?setTimeout:null,o0=typeof clearTimeout=="function"?clearTimeout:null,s0=typeof setImmediate<"u"?setImmediate:null;function Pu(e){for(var t=Jn(rr);t!==null;){if(t.callback===null)Uu(rr);else if(t.startTime<=e)Uu(rr),t.sortIndex=t.expirationTime,rp(Ns,t);else break;t=Jn(rr)}}function lp(e){if(zl=!1,Pu(e),!Il)if(Jn(Ns)!==null)Il=!0,ao||(ao=!0,ro());else{var t=Jn(rr);t!==null&&cp(lp,t.startTime-e)}}var ao=!1,Pl=-1,l0=5,c0=-1;function u0(){return op?!0:!(ft.unstable_now()-c0<l0)}function np(){if(op=!1,ao){var e=ft.unstable_now();c0=e;var t=!0;try{e:{Il=!1,zl&&(zl=!1,o0(Pl),Pl=-1),ap=!0;var i=bi;try{t:{for(Pu(e),gn=Jn(Ns);gn!==null&&!(gn.expirationTime>e&&u0());){var n=gn.callback;if(typeof n=="function"){gn.callback=null,bi=gn.priorityLevel;var s=n(gn.expirationTime<=e);if(e=ft.unstable_now(),typeof s=="function"){gn.callback=s,Pu(e),t=!0;break t}gn===Jn(Ns)&&Uu(Ns),Pu(e)}else Uu(Ns);gn=Jn(Ns)}if(gn!==null)t=!0;else{var r=Jn(rr);r!==null&&cp(lp,r.startTime-e),t=!1}}break e}finally{gn=null,bi=i,ap=!1}t=void 0}}finally{t?ro():ao=!1}}}var ro;typeof s0=="function"?ro=function(){s0(np)}:typeof MessageChannel<"u"?(sp=new MessageChannel,r0=sp.port2,sp.port1.onmessage=np,ro=function(){r0.postMessage(null)}):ro=function(){a0(np,0)};var sp,r0;function cp(e,t){Pl=a0(function(){e(ft.unstable_now())},t)}ft.unstable_IdlePriority=5;ft.unstable_ImmediatePriority=1;ft.unstable_LowPriority=4;ft.unstable_NormalPriority=3;ft.unstable_Profiling=null;ft.unstable_UserBlockingPriority=2;ft.unstable_cancelCallback=function(e){e.callback=null};ft.unstable_forceFrameRate=function(e){0>e||125<e?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):l0=0<e?Math.floor(1e3/e):5};ft.unstable_getCurrentPriorityLevel=function(){return bi};ft.unstable_next=function(e){switch(bi){case 1:case 2:case 3:var t=3;break;default:t=bi}var i=bi;bi=t;try{return e()}finally{bi=i}};ft.unstable_requestPaint=function(){op=!0};ft.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var i=bi;bi=e;try{return t()}finally{bi=i}};ft.unstable_scheduleCallback=function(e,t,i){var n=ft.unstable_now();switch(typeof i=="object"&&i!==null?(i=i.delay,i=typeof i=="number"&&0<i?n+i:n):i=n,e){case 1:var s=-1;break;case 2:s=250;break;case 5:s=1073741823;break;case 4:s=1e4;break;default:s=5e3}return s=i+s,e={id:GM++,callback:t,priorityLevel:e,startTime:i,expirationTime:s,sortIndex:-1},i>n?(e.sortIndex=i,rp(rr,e),Jn(Ns)===null&&e===Jn(rr)&&(zl?(o0(Pl),Pl=-1):zl=!0,cp(lp,i-n))):(e.sortIndex=s,rp(Ns,e),Il||ap||(Il=!0,ao||(ao=!0,ro()))),e};ft.unstable_shouldYield=u0;ft.unstable_wrapCallback=function(e){var t=bi;return function(){var i=bi;bi=t;try{return e.apply(this,arguments)}finally{bi=i}}}});var f0=me((tP,d0)=>{"use strict";d0.exports=h0()});var k0=me(be=>{"use strict";var dp=Symbol.for("react.transitional.element"),$M=Symbol.for("react.portal"),YM=Symbol.for("react.fragment"),jM=Symbol.for("react.strict_mode"),VM=Symbol.for("react.profiler"),XM=Symbol.for("react.consumer"),ZM=Symbol.for("react.context"),QM=Symbol.for("react.forward_ref"),JM=Symbol.for("react.suspense"),eO=Symbol.for("react.memo"),v0=Symbol.for("react.lazy"),tO=Symbol.for("react.activity"),iO=Symbol.for("react.view_transition"),p0=Symbol.iterator;function nO(e){return e===null||typeof e!="object"?null:(e=p0&&e[p0]||e["@@iterator"],typeof e=="function"?e:null)}var b0={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},y0=Object.assign,S0={};function lo(e,t,i){this.props=e,this.context=t,this.refs=S0,this.updater=i||b0}lo.prototype.isReactComponent={};lo.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("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")};lo.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function w0(){}w0.prototype=lo.prototype;function fp(e,t,i){this.props=e,this.context=t,this.refs=S0,this.updater=i||b0}var pp=fp.prototype=new w0;pp.constructor=fp;y0(pp,lo.prototype);pp.isPureReactComponent=!0;var m0=Array.isArray;function hp(){}var st={H:null,A:null,T:null,S:null},E0=Object.prototype.hasOwnProperty;function mp(e,t,i){var n=i.ref;return{$$typeof:dp,type:e,key:t,ref:n!==void 0?n:null,props:i}}function sO(e,t){return mp(e.type,t,e.props)}function gp(e){return typeof e=="object"&&e!==null&&e.$$typeof===dp}function rO(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(i){return t[i]})}var g0=/\/+/g;function up(e,t){return typeof e=="object"&&e!==null&&e.key!=null?rO(""+e.key):t.toString(36)}function aO(e){switch(e.status){case"fulfilled":return e.value;case"rejected":throw e.reason;default:switch(typeof e.status=="string"?e.then(hp,hp):(e.status="pending",e.then(function(t){e.status==="pending"&&(e.status="fulfilled",e.value=t)},function(t){e.status==="pending"&&(e.status="rejected",e.reason=t)})),e.status){case"fulfilled":return e.value;case"rejected":throw e.reason}}throw e}function oo(e,t,i,n,s){var r=typeof e;(r==="undefined"||r==="boolean")&&(e=null);var a=!1;if(e===null)a=!0;else switch(r){case"bigint":case"string":case"number":a=!0;break;case"object":switch(e.$$typeof){case dp:case $M:a=!0;break;case v0:return a=e._init,oo(a(e._payload),t,i,n,s)}}if(a)return s=s(e),a=n===""?"."+up(e,0):n,m0(s)?(i="",a!=null&&(i=a.replace(g0,"$&/")+"/"),oo(s,t,i,"",function(c){return c})):s!=null&&(gp(s)&&(s=sO(s,i+(s.key==null||e&&e.key===s.key?"":(""+s.key).replace(g0,"$&/")+"/")+a)),t.push(s)),1;a=0;var o=n===""?".":n+":";if(m0(e))for(var l=0;l<e.length;l++)n=e[l],r=o+up(n,l),a+=oo(n,t,i,r,s);else if(l=nO(e),typeof l=="function")for(e=l.call(e),l=0;!(n=e.next()).done;)n=n.value,r=o+up(n,l++),a+=oo(n,t,i,r,s);else if(r==="object"){if(typeof e.then=="function")return oo(aO(e),t,i,n,s);throw t=String(e),Error("Objects are not valid as a React child (found: "+(t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.")}return a}function Hu(e,t,i){if(e==null)return e;var n=[],s=0;return oo(e,n,"","",function(r){return t.call(i,r,s++)}),n}function oO(e){if(e._status===-1){var t=e._result,i=t();i.then(function(n){(e._status===0||e._status===-1)&&(e._status=1,e._result=n,i.status===void 0&&(i.status="fulfilled",i.value=n))},function(n){(e._status===0||e._status===-1)&&(e._status=2,e._result=n,i.status===void 0&&(i.status="rejected",i.reason=n))}),e._status===-1&&(e._status=0,e._result=i)}if(e._status===1)return e._result.default;throw e._result}var _0=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)};function x0(e){var t=st.T,i={};i.types=t!==null?t.types:null,st.T=i;try{var n=e(),s=st.S;s!==null&&s(i,n),typeof n=="object"&&n!==null&&typeof n.then=="function"&&n.then(hp,_0)}catch(r){_0(r)}finally{t!==null&&i.types!==null&&(t.types=i.types),st.T=t}}function C0(e){var t=st.T;if(t!==null){var i=t.types;i===null?t.types=[e]:i.indexOf(e)===-1&&i.push(e)}else x0(C0.bind(null,e))}var lO={map:Hu,forEach:function(e,t,i){Hu(e,function(){t.apply(this,arguments)},i)},count:function(e){var t=0;return Hu(e,function(){t++}),t},toArray:function(e){return Hu(e,function(t){return t})||[]},only:function(e){if(!gp(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};be.Activity=tO;be.Children=lO;be.Component=lo;be.Fragment=YM;be.Profiler=VM;be.PureComponent=fp;be.StrictMode=jM;be.Suspense=JM;be.ViewTransition=iO;be.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=st;be.__COMPILER_RUNTIME={__proto__:null,c:function(e){return st.H.useMemoCache(e)}};be.addTransitionType=C0;be.cache=function(e){return function(){return e.apply(null,arguments)}};be.cacheSignal=function(){return null};be.cloneElement=function(e,t,i){if(e==null)throw Error("The argument must be a React element, but you passed "+e+".");var n=y0({},e.props),s=e.key;if(t!=null)for(r in t.key!==void 0&&(s=""+t.key),t)!E0.call(t,r)||r==="key"||r==="__self"||r==="__source"||r==="ref"&&t.ref===void 0||(n[r]=t[r]);var r=arguments.length-2;if(r===1)n.children=i;else if(1<r){for(var a=Array(r),o=0;o<r;o++)a[o]=arguments[o+2];n.children=a}return mp(e.type,s,n)};be.createContext=function(e){return e={$$typeof:ZM,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider=e,e.Consumer={$$typeof:XM,_context:e},e};be.createElement=function(e,t,i){var n,s={},r=null;if(t!=null)for(n in t.key!==void 0&&(r=""+t.key),t)E0.call(t,n)&&n!=="key"&&n!=="__self"&&n!=="__source"&&(s[n]=t[n]);var a=arguments.length-2;if(a===1)s.children=i;else if(1<a){for(var o=Array(a),l=0;l<a;l++)o[l]=arguments[l+2];s.children=o}if(e&&e.defaultProps)for(n in a=e.defaultProps,a)s[n]===void 0&&(s[n]=a[n]);return mp(e,r,s)};be.createRef=function(){return{current:null}};be.forwardRef=function(e){return{$$typeof:QM,render:e}};be.isValidElement=gp;be.lazy=function(e){return{$$typeof:v0,_payload:{_status:-1,_result:e},_init:oO}};be.memo=function(e,t){return{$$typeof:eO,type:e,compare:t===void 0?null:t}};be.startTransition=x0;be.unstable_useCacheRefresh=function(){return st.H.useCacheRefresh()};be.use=function(e){return st.H.use(e)};be.useActionState=function(e,t,i){return st.H.useActionState(e,t,i)};be.useCallback=function(e,t){return st.H.useCallback(e,t)};be.useContext=function(e){return st.H.useContext(e)};be.useDebugValue=function(){};be.useDeferredValue=function(e,t){return st.H.useDeferredValue(e,t)};be.useEffect=function(e,t){return st.H.useEffect(e,t)};be.useEffectEvent=function(e){return st.H.useEffectEvent(e)};be.useId=function(){return st.H.useId()};be.useImperativeHandle=function(e,t,i){return st.H.useImperativeHandle(e,t,i)};be.useInsertionEffect=function(e,t){return st.H.useInsertionEffect(e,t)};be.useLayoutEffect=function(e,t){return st.H.useLayoutEffect(e,t)};be.useMemo=function(e,t){return st.H.useMemo(e,t)};be.useOptimistic=function(e,t){return st.H.useOptimistic(e,t)};be.useReducer=function(e,t,i){return st.H.useReducer(e,t,i)};be.useRef=function(e){return st.H.useRef(e)};be.useState=function(e){return st.H.useState(e)};be.useSyncExternalStore=function(e,t,i){return st.H.useSyncExternalStore(e,t,i)};be.useTransition=function(){return st.H.useTransition()};be.version="19.3.1"});var Mt=me((nP,T0)=>{"use strict";T0.exports=k0()});var M0=me(yi=>{"use strict";var cO=Mt();function A0(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var i=2;i<arguments.length;i++)t+="&args[]="+encodeURIComponent(arguments[i])}return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function ar(){}var Ni={d:{f:ar,r:function(){throw Error(A0(522))},D:ar,C:ar,L:ar,m:ar,X:ar,S:ar,M:ar},p:0,findDOMNode:null},uO=Symbol.for("react.portal"),hO=Symbol.for("react.recoverable"),N0=Symbol.for("react.optimistic_key");function dO(e,t,i){var n=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:uO,key:n==null?null:n===N0?N0:""+n,children:e,containerInfo:t,implementation:i}}var Ul=cO.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function Fu(e,t){if(e==="font")return"";if(typeof t=="string")return t==="use-credentials"?t:""}yi.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=Ni;yi.browser=function(e){return{$$typeof:hO,_reason:e}};yi.createPortal=function(e,t){var i=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)throw Error(A0(299));return dO(e,t,null,i)};yi.flushSync=function(e){var t=Ul.T,i=Ni.p;try{if(Ul.T=null,Ni.p=2,e)return e()}finally{Ul.T=t,Ni.p=i,Ni.d.f()}};yi.preconnect=function(e,t){typeof e=="string"&&(t?(t=t.crossOrigin,t=typeof t=="string"?t==="use-credentials"?t:"":void 0):t=null,Ni.d.C(e,t))};yi.prefetchDNS=function(e){typeof e=="string"&&Ni.d.D(e)};yi.preinit=function(e,t){if(typeof e=="string"&&t&&typeof t.as=="string"){var i=t.as,n=Fu(i,t.crossOrigin),s=typeof t.integrity=="string"?t.integrity:void 0,r=typeof t.fetchPriority=="string"?t.fetchPriority:void 0;i==="style"?Ni.d.S(e,typeof t.precedence=="string"?t.precedence:void 0,{crossOrigin:n,integrity:s,fetchPriority:r}):i==="script"&&Ni.d.X(e,{crossOrigin:n,integrity:s,fetchPriority:r,nonce:typeof t.nonce=="string"?t.nonce:void 0})}};yi.preinitModule=function(e,t){if(typeof e=="string")if(typeof t=="object"&&t!==null){if(t.as==null||t.as==="script"){var i=Fu(t.as,t.crossOrigin);Ni.d.M(e,{crossOrigin:i,integrity:typeof t.integrity=="string"?t.integrity:void 0,nonce:typeof t.nonce=="string"?t.nonce:void 0,fetchPriority:typeof t.fetchPriority=="string"?t.fetchPriority:void 0})}}else t==null&&Ni.d.M(e)};yi.preload=function(e,t){if(typeof e=="string"&&typeof t=="object"&&t!==null&&typeof t.as=="string"){var i=t.as,n=Fu(i,t.crossOrigin);Ni.d.L(e,i,{crossOrigin:n,integrity:typeof t.integrity=="string"?t.integrity:void 0,nonce:typeof t.nonce=="string"?t.nonce:void 0,type:typeof t.type=="string"?t.type:void 0,fetchPriority:typeof t.fetchPriority=="string"?t.fetchPriority:void 0,referrerPolicy:typeof t.referrerPolicy=="string"?t.referrerPolicy:void 0,imageSrcSet:typeof t.imageSrcSet=="string"?t.imageSrcSet:void 0,imageSizes:typeof t.imageSizes=="string"?t.imageSizes:void 0,media:typeof t.media=="string"?t.media:void 0})}};yi.preloadModule=function(e,t){if(typeof e=="string")if(t){var i=Fu(t.as,t.crossOrigin);Ni.d.m(e,{as:typeof t.as=="string"&&t.as!=="script"?t.as:void 0,crossOrigin:i,integrity:typeof t.integrity=="string"?t.integrity:void 0,nonce:typeof t.nonce=="string"?t.nonce:void 0,fetchPriority:typeof t.fetchPriority=="string"?t.fetchPriority:void 0})}else Ni.d.m(e)};yi.requestFormReset=function(e){Ni.d.r(e)};yi.unstable_batchedUpdates=function(e,t){return e(t)};yi.useFormState=function(e,t,i){return Ul.H.useFormState(e,t,i)};yi.useFormStatus=function(){return Ul.H.useHostTransitionStatus()};yi.version="19.3.1"});var co=me((rP,R0)=>{"use strict";function O0(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(O0)}catch(e){console.error(e)}}O0(),R0.exports=M0()});var vE=me(wd=>{"use strict";var qt=f0(),_S=Mt(),fO=co();function B(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var i=2;i<arguments.length;i++)t+="&args[]="+encodeURIComponent(arguments[i])}return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function vS(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function kc(e){for(var t=e,i=t;i&&!i.alternate;)t=i,(t.flags&4098)!==0&&(e=t.return),i=t.return;for(;t.return;)t=t.return;return t.tag===3?e:null}function bS(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 yS(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function D0(e){if(kc(e)!==e)throw Error(B(188))}function pO(e){var t=e.alternate;if(!t){if(t=kc(e),t===null)throw Error(B(188));return t!==e?null:e}for(var i=e,n=t;;){var s=i.return;if(s===null)break;var r=s.alternate;if(r===null){if(n=s.return,n!==null){i=n;continue}break}if(s.child===r.child){for(r=s.child;r;){if(r===i)return D0(s),e;if(r===n)return D0(s),t;r=r.sibling}throw Error(B(188))}if(i.return!==n.return)i=s,n=r;else{for(var a=!1,o=s.child;o;){if(o===i){a=!0,i=s,n=r;break}if(o===n){a=!0,n=s,i=r;break}o=o.sibling}if(!a){for(o=r.child;o;){if(o===i){a=!0,i=r,n=s;break}if(o===n){a=!0,n=r,i=s;break}o=o.sibling}if(!a)throw Error(B(189))}}if(i.alternate!==n)throw Error(B(190))}if(i.tag!==3)throw Error(B(188));return i.stateNode.current===i?e:t}function SS(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=SS(e),t!==null)return t;e=e.sibling}return null}function Gi(e,t,i,n,s,r){for(;e!==null;){if((e.tag===5||e.tag===27||e.tag===6)&&i(e,n,s,r)||(e.tag!==22||e.memoizedState===null)&&(t||e.tag!==5&&e.tag!==27)&&Gi(e.child,t,i,n,s,r))return!0;e=e.sibling}return!1}function ya(e){for(e=e.return;e!==null;){if(e.tag===3||e.tag===5||e.tag===27)return e;e=e.return}return null}function L0(e){var t=!1;for(e=e.return;e!==null&&(e.tag===4&&(t=!0),!(e.tag===3||e.tag===5||e.tag===27));)e=e.return;return t}function wS(e){var t=[null,null],i=ya(e);return i===null||ES(t,e,i.child,{foundSelf:!1}),t}function ES(e,t,i,n){for(;i!==null;){if(i===t)n.foundSelf=!0;else if(i.tag===5||i.tag===27||i.tag===6){if(n.foundSelf)return e[1]=i,!0;e[0]=i}else if((i.tag!==22||i.memoizedState===null)&&ES(e,t,i.child,n))return!0;i=i.sibling}return!1}function Ft(e){switch(e.tag){case 5:case 27:case 6:return e.stateNode;case 3:return e.stateNode.containerInfo;default:throw Error(B(559))}}var _o=null,jp=null;function mO(e,t,i){return e===i?!0:e===t?(_o=e,!0):!1}function gO(e,t,i){return e===i?(jp=e,!1):e===t?(jp!==null&&(_o=e),!0):!1}function B0(e){if(e===null)return null;do e=e===null?null:e.return;while(e&&e.tag!==5&&e.tag!==27&&e.tag!==3);return e||null}function Vp(e,t,i){for(var n=0,s=e;s;s=i(s))n++;s=0;for(var r=t;r;r=i(r))s++;for(;0<n-s;)e=i(e),n--;for(;0<s-n;)t=i(t),s--;for(;n--;){if(e===t||t!==null&&e===t.alternate)return e;e=i(e),t=i(t)}return null}var it=Object.assign,_O=Symbol.for("react.element"),qu=Symbol.for("react.transitional.element"),$l=Symbol.for("react.portal"),vo=Symbol.for("react.fragment"),xS=Symbol.for("react.strict_mode"),Xp=Symbol.for("react.profiler"),CS=Symbol.for("react.consumer"),rs=Symbol.for("react.context"),rg=Symbol.for("react.forward_ref"),Zp=Symbol.for("react.suspense"),Qp=Symbol.for("react.suspense_list"),ag=Symbol.for("react.memo"),ur=Symbol.for("react.lazy"),Jp=Symbol.for("react.activity"),vO=Symbol.for("react.legacy_hidden"),bO=Symbol.for("react.memo_cache_sentinel"),em=Symbol.for("react.view_transition"),yO=Symbol.for("react.recoverable"),I0=Symbol.iterator;function Hl(e){return e===null||typeof e!="object"?null:(e=I0&&e[I0]||e["@@iterator"],typeof e=="function"?e:null)}var SO=Symbol.for("react.client.reference");function tm(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===SO?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case vo:return"Fragment";case Xp:return"Profiler";case xS:return"StrictMode";case Zp:return"Suspense";case Qp:return"SuspenseList";case Jp:return"Activity";case em:return"ViewTransition"}if(typeof e=="object")switch(e.$$typeof){case $l:return"Portal";case rs:return e.displayName||"Context";case CS:return(e._context.displayName||"Context")+".Consumer";case rg:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case ag:return t=e.displayName||null,t!==null?t:tm(e.type)||"Memo";case ur:t=e._payload,e=e._init;try{return tm(e(t))}catch{}}return null}var Yl=Array.isArray,ge=_S.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Ke=fO.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,oa={pending:!1,data:null,method:null,action:null},im=[],bo=-1;function ds(e){return{current:e}}function hi(e){0>bo||(e.current=im[bo],im[bo]=null,bo--)}function ot(e,t){bo++,im[bo]=e.current,e.current=t}var cs=ds(null),uc=ds(null),br=ds(null),Nh=ds(null);function Ah(e,t){switch(ot(br,t),ot(uc,e),ot(cs,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Xy(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Xy(t),e=Y1(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}hi(cs),ot(cs,e)}function Uo(){hi(cs),hi(uc),hi(br)}function nm(e){var t=e.memoizedState;t!==null&&(Vo._currentValue=t.memoizedState,ot(Nh,e)),t=cs.current;var i=Y1(t,e.type);t!==i&&(ot(uc,e),ot(cs,i))}function Mh(e){uc.current===e&&(hi(cs),hi(uc)),Nh.current===e&&(hi(Nh),Vo._currentValue=oa)}var _p,z0;function lr(e){if(_p===void 0)try{throw Error()}catch(i){var t=i.stack.trim().match(/\n( *(at )?)/);_p=t&&t[1]||"",z0=-1<i.stack.indexOf(`
2
+ at`)?" (<anonymous>)":-1<i.stack.indexOf("@")?"@unknown:0:0":""}return`
3
+ `+_p+e+z0}var vp=!1;function bp(e,t){if(!e||vp)return"";vp=!0;var i=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var n={DetermineComponentFrameRoot:function(){try{if(t){var h=function(){throw Error()};if(Object.defineProperty(h.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(h,[])}catch(p){var d=p}Reflect.construct(e,[],h)}else{try{h.call()}catch(p){d=p}h=!1;try{var f=Object.getOwnPropertyDescriptor(e.prototype,"props");Object.defineProperty(e.prototype,"props",{configurable:!0,set:function(){throw Error()}}),h=!0,new e}finally{h&&(f!==void 0?Object.defineProperty(e.prototype,"props",f):delete e.prototype.props)}}}else{try{throw Error()}catch(p){d=p}(h=e())&&typeof h.catch=="function"&&h.catch(function(){})}}catch(p){if(p&&d&&typeof p.stack=="string")return[p.stack,d.stack]}return[null,null]}};n.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var s=Object.getOwnPropertyDescriptor(n.DetermineComponentFrameRoot,"name");s&&s.configurable&&Object.defineProperty(n.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var r=n.DetermineComponentFrameRoot(),a=r[0],o=r[1];if(a&&o){var l=a.split(`
4
+ `),c=o.split(`
5
+ `);for(s=n=0;n<l.length&&!l[n].includes("DetermineComponentFrameRoot");)n++;for(;s<c.length&&!c[s].includes("DetermineComponentFrameRoot");)s++;if(n===l.length||s===c.length)for(n=l.length-1,s=c.length-1;1<=n&&0<=s&&l[n]!==c[s];)s--;for(;1<=n&&0<=s;n--,s--)if(l[n]!==c[s]){if(n!==1||s!==1)do if(n--,s--,0>s||l[n]!==c[s]){var u=`
6
+ `+l[n].replace(" at new "," at ");return e.displayName&&u.includes("<anonymous>")&&(u=u.replace("<anonymous>",e.displayName)),u}while(1<=n&&0<=s);break}}}finally{vp=!1,Error.prepareStackTrace=i}return(i=e?e.displayName||e.name:"")?lr(i):""}function wO(e,t){switch(e.tag){case 26:case 27:case 5:return lr(e.type);case 16:return lr("Lazy");case 13:return e.child!==t&&t!==null?lr("Suspense Fallback"):lr("Suspense");case 19:return lr("SuspenseList");case 0:case 15:return bp(e.type,!1);case 11:return bp(e.type.render,!1);case 1:return bp(e.type,!0);case 31:return lr("Activity");case 30:return lr("ViewTransition");default:return""}}function P0(e){try{var t="",i=null;do t+=wO(e,i),i=e,e=e.return;while(e);return t}catch(n){return`
7
+ Error generating stack: `+n.message+`
8
+ `+n.stack}}var sm=Object.prototype.hasOwnProperty,og=qt.unstable_scheduleCallback,yp=qt.unstable_cancelCallback,EO=qt.unstable_shouldYield,xO=qt.unstable_requestPaint,tn=qt.unstable_now,CO=qt.unstable_getCurrentPriorityLevel,kS=qt.unstable_ImmediatePriority,TS=qt.unstable_UserBlockingPriority,Oh=qt.unstable_NormalPriority,kO=qt.unstable_LowPriority,NS=qt.unstable_IdlePriority,TO=qt.log,NO=qt.unstable_setDisableYieldValue,Tc=null,nn=null;function fr(e){if(typeof TO=="function"&&NO(e),nn&&typeof nn.setStrictMode=="function")try{nn.setStrictMode(Tc,e)}catch{}}var sn=Math.clz32?Math.clz32:OO,AO=Math.log,MO=Math.LN2;function OO(e){return e>>>=0,e===0?32:31-(AO(e)/MO|0)|0}var Ku=256,Wu=262144,Gu=4194304;function ia(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&-e;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function nd(e,t,i){var n=e.pendingLanes;if(n===0)return 0;var s=0,r=e.suspendedLanes,a=e.pingedLanes;e=e.warmLanes;var o=n&134217727;return o!==0?(n=o&~r,n!==0?s=ia(n):(a&=o,a!==0?s=ia(a):i||(i=o&~e,i!==0&&(s=ia(i))))):(o=n&~r,o!==0?s=ia(o):a!==0?s=ia(a):i||(i=n&~e,i!==0&&(s=ia(i)))),s===0?0:t!==0&&t!==s&&(t&r)===0&&(r=s&-s,i=t&-t,r>=i||r===32&&(i&4194048)!==0)?t:s}function Nc(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function AS(e,t){(t&8)!==0&&(t|=t&32);var i=e.entangledLanes;if(i!==0)for(e=e.entanglements,i&=t;0<i;){var n=31-sn(i),s=1<<n;t|=e[n],i&=~s}return t}function RO(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function MS(){var e=Gu;return Gu<<=1,(Gu&62914560)===0&&(Gu=4194304),e}function Sp(e){for(var t=[],i=0;31>i;i++)t.push(e);return t}function Ac(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function DO(e,t,i,n,s,r){var a=e.pendingLanes;e.pendingLanes=i,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=i,e.entangledLanes&=i,e.errorRecoveryDisabledLanes&=i,e.shellSuspendCounter=0;var o=e.entanglements,l=e.expirationTimes,c=e.hiddenUpdates;for(i=a&~i;0<i;){var u=31-sn(i),h=1<<u;o[u]=0,l[u]=-1;var d=c[u];if(d!==null)for(c[u]=null,u=0;u<d.length;u++){var f=d[u];f!==null&&(f.lane&=-536870913)}i&=~h}n!==0&&OS(e,n,0),r!==0&&s===0&&e.tag!==0&&(e.suspendedLanes|=r&~(a&~t))}function OS(e,t,i){e.pendingLanes|=t,e.suspendedLanes&=~t;var n=31-sn(t);e.entangledLanes|=t,e.entanglements[n]=e.entanglements[n]|1073741824|i&261930}function RS(e,t){var i=e.entangledLanes|=t;for(e=e.entanglements;i;){var n=31-sn(i),s=1<<n;s&t|e[n]&t&&(e[n]|=t),i&=~s}}function DS(e,t){var i=t&-t;return i=(i&42)!==0?1:lg(i),(i&(e.suspendedLanes|t))!==0?0:i}function lg(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function cg(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function LS(){var e=Ke.p;return e!==0?e:(e=window.event,e===void 0?32:mE(e.type))}function U0(e,t){var i=Ke.p;try{return Ke.p=e,t()}finally{Ke.p=i}}var Fs=Math.random().toString(36).slice(2),ci="__reactFiber$"+Fs,$i="__reactProps$"+Fs,Qo="__reactContainer$"+Fs,H0="__reactEvents$"+Fs,LO="__reactListeners$"+Fs,BO="__reactHandles$"+Fs,F0="__reactResources$"+Fs,Mc="__reactMarker$"+Fs,Rh="__reactLoad$"+Fs;function sd(e){delete e[ci],delete e[$i],delete e[LO],delete e[BO]}function ra(e){var t;if(t=e[ci])return t;for(var i=e.parentNode;i;){if(t=i[Qo]||i[ci]){if(i=t.alternate,t.child!==null||i!==null&&i.child!==null)for(e=sS(e);e!==null;){if(i=e[ci])return i;e=sS(e)}return t}e=i,i=e.parentNode}return null}function Jo(e){if(e=e[ci]||e[Qo]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function jl(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(B(33))}function Ao(e){var t=e[F0];return t||(t=e[F0]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function Vt(e){e[Mc]=!0}function BS(e){e[Rh]=void 0}var IS=new Set,zS={};function Sa(e,t){Ho(e,t),Ho(e+"Capture",t)}function Ho(e,t){for(zS[e]=t,e=0;e<t.length;e++)IS.add(t[e])}var IO=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),q0={},K0={};function zO(e){return sm.call(K0,e)?!0:sm.call(q0,e)?!1:IO.test(e)?K0[e]=!0:(q0[e]=!0,!1)}var Fe=!1;function W0(){var e=Fe;return Fe=!1,e}function ch(e,t,i){if(zO(t))if(i===null)e.removeAttribute(t);else{switch(typeof i){case"undefined":case"function":case"symbol":e.removeAttribute(t);return;case"boolean":var n=t.toLowerCase().slice(0,5);if(n!=="data-"&&n!=="aria-"){e.removeAttribute(t);return}}e.setAttribute(t,i)}}function $u(e,t,i){if(i===null)e.removeAttribute(t);else{switch(typeof i){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(t);return}e.setAttribute(t,i)}}function As(e,t,i,n){if(n===null)e.removeAttribute(i);else{switch(typeof n){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(i);return}e.setAttributeNS(t,i,n)}}function Zi(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function PS(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function PO(e,t,i){var n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var s=n.get,r=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return s.call(this)},set:function(a){i=""+a,r.call(this,a)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return i},setValue:function(a){i=""+a},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function rm(e){if(!e._valueTracker){var t=PS(e)?"checked":"value";e._valueTracker=PO(e,t,""+e[t])}}function US(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var i=t.getValue(),n="";return e&&(n=PS(e)?e.checked?"true":"false":e.value),e=n,e!==i?(t.setValue(e),!0):!1}var UO=/[\n"\\]/g;function Sn(e){return e.replace(UO,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function am(e,t,i,n,s,r,a,o){e.name="",a!=null&&typeof a!="function"&&typeof a!="symbol"&&typeof a!="boolean"?e.type=a:e.removeAttribute("type"),t!=null?a==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+Zi(t)):e.value!==""+Zi(t)&&(e.value=""+Zi(t)):a!=="submit"&&a!=="reset"||e.removeAttribute("value"),t!=null?a==="number"&&e.value==t?wp(e,Zi(e.value)):wp(e,Zi(t)):i!=null?wp(e,Zi(i)):n!=null&&e.removeAttribute("value"),s==null&&r!=null&&(e.defaultChecked=!!r),s!=null&&(e.checked=s&&typeof s!="function"&&typeof s!="symbol"),o!=null&&typeof o!="function"&&typeof o!="symbol"&&typeof o!="boolean"?e.name=""+Zi(o):e.removeAttribute("name")}function HS(e,t,i,n,s,r,a,o){if(r!=null&&typeof r!="function"&&typeof r!="symbol"&&typeof r!="boolean"&&(e.type=r),t!=null||i!=null){if(!(r!=="submit"&&r!=="reset"||t!=null)){rm(e);return}i=i!=null?""+Zi(i):"",t=t!=null?""+Zi(t):i,o||t===e.value||(e.value=t),e.defaultValue=t}n=n??s,n=typeof n!="function"&&typeof n!="symbol"&&!!n,e.checked=o?e.checked:!!n,e.defaultChecked=!!n,a!=null&&typeof a!="function"&&typeof a!="symbol"&&typeof a!="boolean"&&(e.name=a),rm(e)}function wp(e,t){e.defaultValue!==""+t&&(e.defaultValue=""+t)}function Mo(e,t,i,n){if(e=e.options,t){t={};for(var s=0;s<i.length;s++)t["$"+i[s]]=!0;for(i=0;i<e.length;i++)s=t.hasOwnProperty("$"+e[i].value),e[i].selected!==s&&(e[i].selected=s),s&&n&&(e[i].defaultSelected=!0)}else{for(i=""+Zi(i),t=null,s=0;s<e.length;s++){if(e[s].value===i){e[s].selected=!0,n&&(e[s].defaultSelected=!0);return}t!==null||e[s].disabled||(t=e[s])}t!==null&&(t.selected=!0)}}function FS(e,t,i){if(t!=null&&(t=""+Zi(t),t!==e.value&&(e.value=t),i==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=i!=null?""+Zi(i):""}function qS(e,t,i,n){if(t==null){if(n!=null){if(i!=null)throw Error(B(92));if(Yl(n)){if(1<n.length)throw Error(B(93));n=n[0]}i=n}i==null&&(i=""),t=i}i=Zi(t),e.defaultValue=i,n=e.textContent,n===i&&n!==""&&n!==null&&(e.value=n),rm(e)}function Fo(e,t){if(t){var i=e.firstChild;if(i&&i===e.lastChild&&i.nodeType===3){i.nodeValue=t;return}}e.textContent=t}var HO=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function G0(e,t,i){var n=t.indexOf("--")===0;i==null||typeof i=="boolean"||i===""?n?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":n?e.setProperty(t,i):typeof i!="number"||i===0||HO.has(t)?t==="float"?e.cssFloat=i:e[t]=(""+i).trim():e[t]=i+"px"}function KS(e,t,i){if(t!=null&&typeof t!="object")throw Error(B(62));if(e=e.style,i!=null){for(var n in i)!i.hasOwnProperty(n)||t!=null&&t.hasOwnProperty(n)||(n.indexOf("--")===0?e.setProperty(n,""):n==="float"?e.cssFloat="":e[n]="",Fe=!0);for(var s in t)n=t[s],t.hasOwnProperty(s)&&i[s]!==n&&(G0(e,s,n),Fe=!0)}else for(var r in t)t.hasOwnProperty(r)&&G0(e,r,t[r])}function ug(e){if(e.indexOf("-")===-1)return!1;switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var FO=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["maskType","mask-type"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),qO=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function uh(e){return qO.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function as(){}var om=null;function hg(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var yo=null,Oo=null;function $0(e){var t=Jo(e);if(t&&(e=t.stateNode)){var i=e[$i]||null;e:switch(e=t.stateNode,t.type){case"input":if(am(e,i.value,i.defaultValue,i.defaultValue,i.checked,i.defaultChecked,i.type,i.name),t=i.name,i.type==="radio"&&t!=null){for(i=e;i.parentNode;)i=i.parentNode;for(i=i.querySelectorAll('input[name="'+Sn(""+t)+'"][type="radio"]'),t=0;t<i.length;t++){var n=i[t];if(n!==e&&n.form===e.form){var s=n[$i]||null;if(!s)throw Error(B(90));am(n,s.value,s.defaultValue,s.defaultValue,s.checked,s.defaultChecked,s.type,s.name)}}for(t=0;t<i.length;t++)n=i[t],n.form===e.form&&US(n)}break e;case"textarea":FS(e,i.value,i.defaultValue);break e;case"select":t=i.value,t!=null&&Mo(e,!!i.multiple,t,!1)}}}var Ep=!1;function WS(e,t,i){if(Ep)return e(t,i);Ep=!0;try{var n=e(t);return n}finally{if(Ep=!1,(yo!==null||Oo!==null)&&(vd(),yo&&(t=yo,e=Oo,Oo=yo=null,$0(t),e)))for(t=0;t<e.length;t++)$0(e[t])}}function hc(e,t){var i=e.stateNode;if(i===null)return null;var n=i[$i]||null;if(n===null)return null;i=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(i&&typeof i!="function")throw Error(B(231,t,typeof i));return i}var Bs=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),lm=!1;if(Bs)try{uo={},Object.defineProperty(uo,"passive",{get:function(){lm=!0}}),window.addEventListener("test",uo,uo),window.removeEventListener("test",uo,uo)}catch{lm=!1}var uo,pr=null,dg=null,hh=null;function GS(){if(hh)return hh;var e,t=dg,i=t.length,n,s="value"in pr?pr.value:pr.textContent,r=s.length;for(e=0;e<i&&t[e]===s[e];e++);var a=i-e;for(n=1;n<=a&&t[i-n]===s[r-n];n++);return hh=s.slice(e,1<n?1-n:void 0)}function dh(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 Yu(){return!0}function Y0(){return!1}function Ri(e){function t(i,n,s,r,a){this._reactName=i,this._targetInst=s,this.type=n,this.nativeEvent=r,this.target=a,this.currentTarget=null;for(var o in e)e.hasOwnProperty(o)&&(i=e[o],this[o]=i?i(r):r[o]);return this.isDefaultPrevented=(r.defaultPrevented!=null?r.defaultPrevented:r.returnValue===!1)?Yu:Y0,this.isPropagationStopped=Y0,this}return it(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var i=this.nativeEvent;i&&(i.preventDefault?i.preventDefault():typeof i.returnValue!="unknown"&&(i.returnValue=!1),this.isDefaultPrevented=Yu)},stopPropagation:function(){var i=this.nativeEvent;i&&(i.stopPropagation?i.stopPropagation():typeof i.cancelBubble!="unknown"&&(i.cancelBubble=!0),this.isPropagationStopped=Yu)},persist:function(){},isPersistent:Yu}),t}var Lr={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},rd=Ri(Lr),Oc=it({},Lr,{view:0,detail:0}),KO=Ri(Oc),xp,Cp,Fl,ad=it({},Oc,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:fg,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!==Fl&&(Fl&&e.type==="mousemove"?(xp=e.screenX-Fl.screenX,Cp=e.screenY-Fl.screenY):Cp=xp=0,Fl=e),xp)},movementY:function(e){return"movementY"in e?e.movementY:Cp}}),j0=Ri(ad),WO=it({},ad,{dataTransfer:0}),GO=Ri(WO),$O=it({},Oc,{relatedTarget:0}),kp=Ri($O),YO=it({},Lr,{animationName:0,elapsedTime:0,pseudoElement:0}),jO=Ri(YO),VO=it({},Lr,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),XO=Ri(VO),ZO=it({},Lr,{data:0}),V0=Ri(ZO),QO={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},JO={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"},eR={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function tR(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=eR[e])?!!t[e]:!1}function fg(){return tR}var iR=it({},Oc,{key:function(e){if(e.key){var t=QO[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=dh(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?JO[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:fg,charCode:function(e){return e.type==="keypress"?dh(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?dh(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),nR=Ri(iR),sR=it({},ad,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),X0=Ri(sR),rR=it({},Lr,{submitter:0}),aR=Ri(rR),oR=it({},Oc,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:fg}),lR=Ri(oR),cR=it({},Lr,{propertyName:0,elapsedTime:0,pseudoElement:0}),uR=Ri(cR),hR=it({},ad,{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}),dR=Ri(hR),fR=it({},Lr,{newState:0,oldState:0,source:0}),pR=Ri(fR),mR=[9,13,27,32],pg=Bs&&"CompositionEvent"in window,Zl=null;Bs&&"documentMode"in document&&(Zl=document.documentMode);var gR=Bs&&"TextEvent"in window&&!Zl,$S=Bs&&(!pg||Zl&&8<Zl&&11>=Zl),Z0=" ",Q0=!1;function YS(e,t){switch(e){case"keyup":return mR.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function jS(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var So=!1;function _R(e,t){switch(e){case"compositionend":return jS(t);case"keypress":return t.which!==32?null:(Q0=!0,Z0);case"textInput":return e=t.data,e===Z0&&Q0?null:e;default:return null}}function vR(e,t){if(So)return e==="compositionend"||!pg&&YS(e,t)?(e=GS(),hh=dg=pr=null,So=!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 $S&&t.locale!=="ko"?null:t.data;default:return null}}var bR={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 J0(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!bR[e.type]:t==="textarea"}function VS(e,t,i,n){yo?Oo?Oo.push(n):Oo=[n]:yo=n,t=ed(t,"onChange"),0<t.length&&(i=new rd("onChange","change",null,i,n),e.push({event:i,listeners:t}))}var Ql=null,dc=null;function yR(e){W1(e,0)}function od(e){var t=jl(e);if(US(t))return e}function ey(e,t){if(e==="change")return t}var XS=!1;Bs&&(Bs?(Vu="oninput"in document,Vu||(Tp=document.createElement("div"),Tp.setAttribute("oninput","return;"),Vu=typeof Tp.oninput=="function"),ju=Vu):ju=!1,XS=ju&&(!document.documentMode||9<document.documentMode));var ju,Vu,Tp;function ty(){Ql&&(Ql.detachEvent("onpropertychange",ZS),dc=Ql=null)}function ZS(e){if(e.propertyName==="value"&&od(dc)){var t=[];VS(t,dc,e,hg(e)),WS(yR,t)}}function SR(e,t,i){e==="focusin"?(ty(),Ql=t,dc=i,Ql.attachEvent("onpropertychange",ZS)):e==="focusout"&&ty()}function wR(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return od(dc)}function ER(e,t){if(e==="click")return od(t)}function xR(e,t){if(e==="input"||e==="change")return od(t)}function CR(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var an=typeof Object.is=="function"?Object.is:CR;function fc(e,t){if(an(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var i=Object.keys(e),n=Object.keys(t);if(i.length!==n.length)return!1;for(n=0;n<i.length;n++){var s=i[n];if(!sm.call(t,s)||!an(e[s],t[s]))return!1}return!0}function cm(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 iy(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function ny(e,t){var i=iy(e);e=0;for(var n;i;){if(i.nodeType===3){if(n=e+i.textContent.length,e<=t&&n>=t)return{node:i,offset:t-e};e=n}e:{for(;i;){if(i.nextSibling){i=i.nextSibling;break e}i=i.parentNode}i=void 0}i=iy(i)}}function QS(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?QS(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function JS(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=cm(e.document);t instanceof e.HTMLIFrameElement;){try{var i=typeof t.contentWindow.location.href=="string"}catch{i=!1}if(i)e=t.contentWindow;else break;t=cm(e.document)}return t}function mg(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}var kR=Bs&&"documentMode"in document&&11>=document.documentMode,wo=null,um=null,Jl=null,hm=!1;function sy(e,t,i){var n=i.window===i?i.document:i.nodeType===9?i:i.ownerDocument;hm||wo==null||wo!==cm(n)||(n=wo,"selectionStart"in n&&mg(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}),Jl&&fc(Jl,n)||(Jl=n,n=ed(um,"onSelect"),0<n.length&&(t=new rd("onSelect","select",null,t,i),e.push({event:t,listeners:n}),t.target=wo)))}function ea(e,t){var i={};return i[e.toLowerCase()]=t.toLowerCase(),i["Webkit"+e]="webkit"+t,i["Moz"+e]="moz"+t,i}var Eo={animationend:ea("Animation","AnimationEnd"),animationiteration:ea("Animation","AnimationIteration"),animationstart:ea("Animation","AnimationStart"),transitionrun:ea("Transition","TransitionRun"),transitionstart:ea("Transition","TransitionStart"),transitioncancel:ea("Transition","TransitionCancel"),transitionend:ea("Transition","TransitionEnd")},Np={},ew={};Bs&&(ew=document.createElement("div").style,"AnimationEvent"in window||(delete Eo.animationend.animation,delete Eo.animationiteration.animation,delete Eo.animationstart.animation),"TransitionEvent"in window||delete Eo.transitionend.transition);function wa(e){if(Np[e])return Np[e];if(!Eo[e])return e;var t=Eo[e],i;for(i in t)if(t.hasOwnProperty(i)&&i in ew)return Np[e]=t[i];return e}var tw=wa("animationend"),iw=wa("animationiteration"),nw=wa("animationstart"),TR=wa("transitionrun"),NR=wa("transitionstart"),AR=wa("transitioncancel"),sw=wa("transitionend"),rw=new Map,dm="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error fullscreenChange fullscreenError 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(" ");dm.push("scrollEnd");function Fn(e,t){rw.set(e,t),Sa(t,[e])}var MR=0;function Is(e,t){if(e.name!=null&&e.name!=="auto")return e.name;if(t.autoName!==null)return t.autoName;e=Hn.identifierPrefix;var i=MR++;return e="_"+e+"t_"+i.toString(32)+"_",t.autoName=e}function ry(e){if(e==null||typeof e=="string")return e;var t=null,i=Po;if(i!==null)for(var n=0;n<i.length;n++){var s=e[i[n]];if(s!=null){if(s==="none")return"none";t=t==null?s:t+(" "+s)}}return t??e.default}function qs(e,t){return e=ry(e),t=ry(t),t==null?e==="auto"?null:e:t==="auto"?null:t}var Dh=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)},vn=[],xo=0,gg=0;function ld(){for(var e=xo,t=gg=xo=0;t<e;){var i=vn[t];vn[t++]=null;var n=vn[t];vn[t++]=null;var s=vn[t];vn[t++]=null;var r=vn[t];if(vn[t++]=null,n!==null&&s!==null){var a=n.pending;a===null?s.next=s:(s.next=a.next,a.next=s),n.pending=s}r!==0&&aw(i,s,r)}}function cd(e,t,i,n){vn[xo++]=e,vn[xo++]=t,vn[xo++]=i,vn[xo++]=n,gg|=n,e.lanes|=n,e=e.alternate,e!==null&&(e.lanes|=n)}function _g(e,t,i,n){return cd(e,t,i,n),Lh(e)}function Ea(e,t){return cd(e,null,null,t),Lh(e)}function aw(e,t,i){e.lanes|=i;var n=e.alternate;n!==null&&(n.lanes|=i);for(var s=!1,r=e.return;r!==null;)r.childLanes|=i,n=r.alternate,n!==null&&(n.childLanes|=i),r.tag===22&&(e=r.stateNode,e===null||e._visibility&1||(s=!0)),e=r,r=r.return;return e.tag===3?(r=e.stateNode,s&&t!==null&&(s=31-sn(i),e=r.hiddenUpdates,n=e[s],n===null?e[s]=[t]:n.push(t),t.lane=i|536870912),r):null}function Lh(e){if(50<cc)throw cc=0,wh=null,Error(B(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var Co={};function OR(e,t,i,n){this.tag=e,this.key=i,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=n,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Ki(e,t,i,n){return new OR(e,t,i,n)}function vg(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Ds(e,t){var i=e.alternate;return i===null?(i=Ki(e.tag,t,e.key,e.mode),i.elementType=e.elementType,i.type=e.type,i.stateNode=e.stateNode,i.alternate=e,e.alternate=i):(i.pendingProps=t,i.type=e.type,i.flags=0,i.subtreeFlags=0,i.deletions=null),i.flags=e.flags&1206910976,i.childLanes=e.childLanes,i.lanes=e.lanes,i.child=e.child,i.memoizedProps=e.memoizedProps,i.memoizedState=e.memoizedState,i.updateQueue=e.updateQueue,t=e.dependencies,i.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},i.sibling=e.sibling,i.index=e.index,i.ref=e.ref,i.refCleanup=e.refCleanup,i}function ow(e,t){e.flags&=1206910978;var i=e.alternate;return i===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=i.childLanes,e.lanes=i.lanes,e.child=i.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=i.memoizedProps,e.memoizedState=i.memoizedState,e.updateQueue=i.updateQueue,e.type=i.type,t=i.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function fh(e,t,i,n,s,r){var a=0;if(n=e,typeof n=="function")vg(n)&&(a=1);else if(typeof n=="string")a=n2(e,i,cs.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(n){case Jp:return e=Ki(31,i,t,s),e.elementType=Jp,e.lanes=r,e;case vo:return la(i.children,s,r,t);case xS:a=8,s|=24;break;case Xp:return e=Ki(12,i,t,s|2),e.elementType=Xp,e.lanes=r,e;case Zp:return e=Ki(13,i,t,s),e.elementType=Zp,e.lanes=r,e;case Qp:return e=Ki(19,i,t,s),e.elementType=Qp,e.lanes=r,e;case vO:case em:return e=s|32,e=Ki(30,i,t,e),e.elementType=em,e.lanes=r,e.stateNode={autoName:null,paired:null,clones:null,ref:null},e;default:if(typeof n=="object"&&n!==null)switch(n.$$typeof){case rs:a=10;break e;case CS:a=9;break e;case rg:a=11;break e;case ag:a=14;break e;case ur:a=16,n=null;break e}a=29,i=Error(B(130,e===null?"null":typeof e,"")),n=null}return t=Ki(a,i,t,s),t.elementType=e,t.type=n,t.lanes=r,t}function la(e,t,i,n){return e=Ki(7,e,n,t),e.lanes=i,e}function Ap(e,t,i){return e=Ki(6,e,null,t),e.lanes=i,e}function lw(e){var t=Ki(18,null,null,0);return t.stateNode=e,t}function Mp(e,t,i){return t=Ki(4,e.children!==null?e.children:[],e.key,t),t.lanes=i,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var ay=new WeakMap;function wn(e,t){if(typeof e=="object"&&e!==null){var i=ay.get(e);return i!==void 0?i:(t={value:e,source:t,stack:P0(t)},ay.set(e,t),t)}return{value:e,source:t,stack:P0(t)}}var ko=[],To=0,Bh=null,pc=0,bn=[],yn=0,Ar=null,os=1,ls="";function Os(e,t){ko[To++]=pc,ko[To++]=Bh,Bh=e,pc=t}function cw(e,t,i){bn[yn++]=os,bn[yn++]=ls,bn[yn++]=Ar,Ar=e;var n=os;e=ls;var s=32-sn(n)-1;n&=~(1<<s),i+=1;var r=32-sn(t)+s;if(30<r){var a=s-s%5;r=(n&(1<<a)-1).toString(32),n>>=a,s-=a,os=1<<32-sn(t)+s|i<<s|n,ls=r+e}else os=1<<r|i<<s|n,ls=e}function ud(e){e.return!==null&&(Os(e,1),cw(e,1,0))}function bg(e){for(;e===Bh;)Bh=ko[--To],ko[To]=null,pc=ko[--To],ko[To]=null;for(;e===Ar;)Ar=bn[--yn],bn[yn]=null,ls=bn[--yn],bn[yn]=null,os=bn[--yn],bn[yn]=null}function uw(e,t){bn[yn++]=os,bn[yn++]=ls,bn[yn++]=Ar,os=t.id,ls=t.overflow,Ar=e}var Xt=null,at=null,ke=!1,yr=null,En=!1,fm=Error(B(519));function Mr(e){var t=Error(B(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw mc(wn(t,e)),fm}function oy(e){var t=e.stateNode,i=e.type,n=e.memoizedProps;switch(t[ci]=e,t[$i]=n,i){case"dialog":Re("cancel",t),Re("close",t);break;case"iframe":case"object":case"embed":Re("load",t);break;case"video":case"audio":for(i=0;i<bc.length;i++)Re(bc[i],t);break;case"source":Re("error",t);break;case"img":case"image":case"link":Re("error",t),Re("load",t);break;case"details":Re("toggle",t);break;case"input":Re("invalid",t),HS(t,n.value,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name,!0);break;case"select":Re("invalid",t);break;case"textarea":Re("invalid",t),qS(t,n.value,n.defaultValue,n.children)}i=n.children,typeof i!="string"&&typeof i!="number"&&typeof i!="bigint"||t.textContent===""+i||n.suppressHydrationWarning===!0||$1(t.textContent,i)?(n.popover!=null&&(Re("beforetoggle",t),Re("toggle",t)),n.onScroll!=null&&Re("scroll",t),n.onScrollEnd!=null&&Re("scrollend",t),n.onClick!=null&&(t.onclick=as),t=!0):t=!1,t||Mr(e,!0)}function Ih(e){for(Xt=e.return;Xt;)switch(Xt.tag){case 5:case 31:case 13:En=!1;return;case 27:case 3:En=!0;return;default:Xt=Xt.return}}function ho(e){if(e!==Xt)return!1;if(!ke)return Ih(e),ke=!0,!1;var t=e.tag,i;if((i=t!==3&&t!==27)&&((i=t===5)&&(i=e.type,i=!(i!=="form"&&i!=="button")||Zm(e.type,e.memoizedProps)),i=!i),i&&at&&Mr(e),Ih(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(B(317));at=nS(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(B(317));at=nS(e)}else t===27?(t=at,Br(e.type)?(e=tg,tg=null,at=e):at=t):at=Xt?xn(e.stateNode.nextSibling):null;return!0}function da(){at=Xt=null,ke=!1}function Op(){var e=yr;return e!==null&&(Fi===null?Fi=e:Fi.push.apply(Fi,e),yr=null),e}function mc(e){yr===null?yr=[e]:yr.push(e)}var pm=ds(null),xa=null,Rs=null;function mr(e,t,i){ot(pm,t._currentValue),t._currentValue=i}function Ls(e){e._currentValue=pm.current,hi(pm)}function ph(e,t,i){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===i)break;e=e.return}}function mm(e,t,i,n){var s=e.child;for(s!==null&&(s.return=e);s!==null;){var r=s.dependencies;if(r!==null){var a=s.child;r=r.firstContext;e:for(;r!==null;){var o=r;r=s;for(var l=0;l<t.length;l++)if(o.context===t[l]){r.lanes|=i,o=r.alternate,o!==null&&(o.lanes|=i),ph(r.return,i,e),n||(a=null);break e}r=o.next}}else if(s.tag===18){if(a=s.return,a===null)throw Error(B(341));a.lanes|=i,r=a.alternate,r!==null&&(r.lanes|=i),ph(a,i,e),a=null}else s.tag===13&&s.memoizedState!==null&&s.memoizedState.dehydrated===null?(s.lanes|=i,a=s.alternate,a!==null&&(a.lanes|=i),ph(s.return,i,e),a=s.child,a=a!==null?a.sibling:null):a=s.child;if(a!==null)a.return=s;else for(a=s;a!==null;){if(a===e){a=null;break}if(s=a.sibling,s!==null){s.return=a.return,a=s;break}a=a.return}s=a}}function fa(e,t,i,n){e=null;for(var s=t,r=!1;s!==null;){if(!r){if((s.flags&524288)!==0)r=!0;else if((s.flags&262144)!==0)break}if(s.tag===10){var a=s.alternate;if(a===null)throw Error(B(387));if(a=a.memoizedProps,a!==null){var o=s.type;an(s.pendingProps.value,a.value)||(e!==null?e.push(o):e=[o])}}else if(s===Nh.current){if(a=s.alternate,a===null)throw Error(B(387));a.memoizedState.memoizedState!==s.memoizedState.memoizedState&&(e!==null?e.push(Vo):e=[Vo])}s=s.return}return e!==null&&mm(t,e,i,n),t.flags|=262144,e!==null}function zh(e){for(e=e.firstContext;e!==null;){if(!an(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function pa(e){xa=e,Rs=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function ui(e){return hw(xa,e)}function Xu(e,t){return xa===null&&pa(e),hw(e,t)}function hw(e,t){var i=t._currentValue;if(t={context:t,memoizedValue:i,next:null},Rs===null){if(e===null)throw Error(B(308));Rs=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else Rs=Rs.next=t;return i}var RR=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(i,n){e.push(n)}};this.abort=function(){t.aborted=!0,e.forEach(function(i){return i()})}},DR=qt.unstable_scheduleCallback,LR=qt.unstable_NormalPriority,Rt={$$typeof:rs,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function yg(){return{controller:new RR,data:new Map,refCount:0}}function Rc(e){e.refCount--,e.refCount===0&&DR(LR,function(){e.controller.abort()})}function ly(e,t){if((e.pendingLanes&4194048)!==0){var i=e.transitionTypes;for(i===null&&(i=e.transitionTypes=[]),e=0;e<t.length;e++){var n=t[e];i.indexOf(n)===-1&&i.push(n)}}}var Vl=null;function BR(e){var t=e.transitionTypes;return e.transitionTypes=null,t}var ec=null,gm=0,ma=0,Ro=null;function IR(e,t){if(ec===null){var i=ec=[];gm=0,ma=jg(),Ro={status:"pending",value:void 0,then:function(n){i.push(n)}}}return gm++,t.then(cy,cy),t}function cy(){if(--gm===0&&(Vl=null,ec!==null)){Ro!==null&&(Ro.status="fulfilled");var e=ec;ec=null,ma=0,Ro=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function zR(e,t){var i=[],n={status:"pending",value:null,reason:null,then:function(s){i.push(s)}};return e.then(function(){n.status="fulfilled",n.value=t;for(var s=0;s<i.length;s++)(0,i[s])(t)},function(s){for(n.status="rejected",n.reason=s,s=0;s<i.length;s++)(0,i[s])(void 0)}),n}var uy=ge.S;ge.S=function(e,t){if(A1=tn(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&IR(e,t),Vl!==null)for(var i=$o;i!==null;)ly(i,Vl),i=i.next;if(i=e.types,i!==null){for(var n=$o;n!==null;)ly(n,i),n=n.next;if(ma!==0){n=Vl,n===null&&(n=Vl=[]);for(var s=0;s<i.length;s++){var r=i[s];n.indexOf(r)===-1&&n.push(r)}}}uy!==null&&uy(e,t)};var ca=ds(null);function Sg(){var e=ca.current;return e!==null?e:tt.pooledCache}function mh(e,t){t===null?ot(ca,ca.current):ot(ca,t.pool)}function dw(){var e=Sg();return e===null?null:{parent:Rt._currentValue,pool:e}}var el=Error(B(460)),wg=Error(B(474)),hd=Error(B(542)),Ph={then:function(){}};function hy(e){return e=e.status,e==="fulfilled"||e==="rejected"}function fw(e,t,i){switch(i=e[i],i===void 0?e.push(t):i!==t&&(t.then(as,as),t=i),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,fy(e),e===void 0&&!("reason"in t)?Error(B(600)):e;default:if(typeof t.status=="string")t.then(as,as);else{if(e=tt,e!==null&&100<e.shellSuspendCounter)throw Error(B(482));e=t,e.status="pending",e.then(function(n){if(t.status==="pending"){var s=t;s.status="fulfilled",s.value=n}},function(n){if(t.status==="pending"){var s=t;s.status="rejected",s.reason=n}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,fy(e),e}throw ua=t,el}}function na(e){try{var t=e._init;return t(e._payload)}catch(i){throw i!==null&&typeof i=="object"&&typeof i.then=="function"?(ua=i,el):i}}var ua=null;function dy(){if(ua===null)throw Error(B(459));var e=ua;return ua=null,e}function fy(e){if(e===el||e===hd)throw Error(B(483))}var Do=null,gc=0;function Zu(e){var t=gc;return gc+=1,Do===null&&(Do=[]),fw(Do,e,t)}function or(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function Qu(e,t){throw t.$$typeof===_O?Error(B(525)):(e=Object.prototype.toString.call(t),Error(B(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function pw(e){function t(g,m){if(e){var b=g.deletions;b===null?(g.deletions=[m],g.flags|=16):b.push(m)}}function i(g,m){if(!e)return null;for(;m!==null;)t(g,m),m=m.sibling;return null}function n(g){for(var m=new Map;g!==null;)g.key===null?m.set(g.index,g):m.set(g.key,g),g=g.sibling;return m}function s(g,m){return g=Ds(g,m),g.index=0,g.sibling=null,g}function r(g,m,b){return g.index=b,e?(b=g.alternate,b!==null?(b=b.index,b<m?(g.flags|=2,m):b):(g.flags|=134217730,m)):(g.flags|=1048576,m)}function a(g){return e&&g.alternate===null&&(g.flags|=134217730),g}function o(g,m,b,S){return m===null||m.tag!==6?(m=Ap(b,g.mode,S),m.return=g,m):(m=s(m,b),m.return=g,m)}function l(g,m,b,S){var x=b.type;return x===vo?(g=u(g,m,b.props.children,S,b.key),or(g,b),g):m!==null&&(m.elementType===x||typeof x=="object"&&x!==null&&x.$$typeof===ur&&na(x)===m.type)?(m=s(m,b.props),or(m,b),m.return=g,m):(m=fh(b.type,b.key,b.props,null,g.mode,S),or(m,b),m.return=g,m)}function c(g,m,b,S){return m===null||m.tag!==4||m.stateNode.containerInfo!==b.containerInfo||m.stateNode.implementation!==b.implementation?(m=Mp(b,g.mode,S),m.return=g,m):(m=s(m,b.children||[]),m.return=g,m)}function u(g,m,b,S,x){return m===null||m.tag!==7?(m=la(b,g.mode,S,x),m.return=g,m):(m=s(m,b),m.return=g,m)}function h(g,m,b){if(typeof m=="string"&&m!==""||typeof m=="number"||typeof m=="bigint")return m=Ap(""+m,g.mode,b),m.return=g,m;if(typeof m=="object"&&m!==null){switch(m.$$typeof){case qu:return b=fh(m.type,m.key,m.props,null,g.mode,b),or(b,m),b.return=g,b;case $l:return m=Mp(m,g.mode,b),m.return=g,m;case ur:return m=na(m),h(g,m,b)}if(Yl(m)||Hl(m))return m=la(m,g.mode,b,null),m.return=g,m;if(typeof m.then=="function")return h(g,Zu(m),b);if(m.$$typeof===rs)return h(g,Xu(g,m),b);Qu(g,m)}return null}function d(g,m,b,S){var x=m!==null?m.key:null;if(typeof b=="string"&&b!==""||typeof b=="number"||typeof b=="bigint")return x!==null?null:o(g,m,""+b,S);if(typeof b=="object"&&b!==null){switch(b.$$typeof){case qu:return b.key===x?l(g,m,b,S):null;case $l:return b.key===x?c(g,m,b,S):null;case ur:return b=na(b),d(g,m,b,S)}if(Yl(b)||Hl(b))return x!==null?null:u(g,m,b,S,null);if(typeof b.then=="function")return d(g,m,Zu(b),S);if(b.$$typeof===rs)return d(g,m,Xu(g,b),S);Qu(g,b)}return null}function f(g,m,b,S,x){if(typeof S=="string"&&S!==""||typeof S=="number"||typeof S=="bigint")return g=g.get(b)||null,o(m,g,""+S,x);if(typeof S=="object"&&S!==null){switch(S.$$typeof){case qu:return g=g.get(S.key===null?b:S.key)||null,l(m,g,S,x);case $l:return g=g.get(S.key===null?b:S.key)||null,c(m,g,S,x);case ur:return S=na(S),f(g,m,b,S,x)}if(Yl(S)||Hl(S))return g=g.get(b)||null,u(m,g,S,x,null);if(typeof S.then=="function")return f(g,m,b,Zu(S),x);if(S.$$typeof===rs)return f(g,m,b,Xu(m,S),x);Qu(m,S)}return null}function p(g,m,b,S){for(var x=null,C=null,N=m,M=m=0,O=null;N!==null&&M<b.length;M++){N.index>M?(O=N,N=null):O=N.sibling;var q=d(g,N,b[M],S);if(q===null){N===null&&(N=O);break}e&&N&&q.alternate===null&&t(g,N),m=r(q,m,M),C===null?x=q:C.sibling=q,C=q,N=O}if(M===b.length)return i(g,N),ke&&Os(g,M),x;if(N===null){for(;M<b.length;M++)N=h(g,b[M],S),N!==null&&(m=r(N,m,M),C===null?x=N:C.sibling=N,C=N);return ke&&Os(g,M),x}for(N=n(N);M<b.length;M++)O=f(N,g,M,b[M],S),O!==null&&(e&&(q=O.alternate,q!==null&&N.delete(q.key===null?M:q.key)),m=r(O,m,M),C===null?x=O:C.sibling=O,C=O);return e&&N.forEach(function(G){return t(g,G)}),ke&&Os(g,M),x}function _(g,m,b,S){if(b==null)throw Error(B(151));for(var x=null,C=null,N=m,M=m=0,O=null,q=b.next();N!==null&&!q.done;M++,q=b.next()){N.index>M?(O=N,N=null):O=N.sibling;var G=d(g,N,q.value,S);if(G===null){N===null&&(N=O);break}e&&N&&G.alternate===null&&t(g,N),m=r(G,m,M),C===null?x=G:C.sibling=G,C=G,N=O}if(q.done)return i(g,N),ke&&Os(g,M),x;if(N===null){for(;!q.done;M++,q=b.next())q=h(g,q.value,S),q!==null&&(m=r(q,m,M),C===null?x=q:C.sibling=q,C=q);return ke&&Os(g,M),x}for(N=n(N);!q.done;M++,q=b.next())q=f(N,g,M,q.value,S),q!==null&&(e&&(O=q.alternate,O!==null&&N.delete(O.key===null?M:O.key)),m=r(q,m,M),C===null?x=q:C.sibling=q,C=q);return e&&N.forEach(function(I){return t(g,I)}),ke&&Os(g,M),x}function v(g,m,b,S){if(typeof b=="object"&&b!==null&&b.type===vo&&b.key===null&&b.props.ref===void 0&&(b=b.props.children),typeof b=="object"&&b!==null){switch(b.$$typeof){case qu:e:{for(var x=b.key;m!==null;){if(m.key===x){if(x=b.type,x===vo){if(m.tag===7){i(g,m.sibling),S=s(m,b.props.children),or(S,b),S.return=g,g=S;break e}}else if(m.elementType===x||typeof x=="object"&&x!==null&&x.$$typeof===ur&&na(x)===m.type){i(g,m.sibling),S=s(m,b.props),or(S,b),S.return=g,g=S;break e}i(g,m);break}else t(g,m);m=m.sibling}b.type===vo?(S=la(b.props.children,g.mode,S,b.key),or(S,b),S.return=g,g=S):(S=fh(b.type,b.key,b.props,null,g.mode,S),or(S,b),S.return=g,g=S)}return a(g);case $l:e:{for(x=b.key;m!==null;){if(m.key===x)if(m.tag===4&&m.stateNode.containerInfo===b.containerInfo&&m.stateNode.implementation===b.implementation){i(g,m.sibling),S=s(m,b.children||[]),S.return=g,g=S;break e}else{i(g,m);break}else t(g,m);m=m.sibling}S=Mp(b,g.mode,S),S.return=g,g=S}return a(g);case ur:return b=na(b),v(g,m,b,S)}if(Yl(b))return p(g,m,b,S);if(Hl(b)){if(x=Hl(b),typeof x!="function")throw Error(B(150));return b=x.call(b),_(g,m,b,S)}if(typeof b.then=="function")return v(g,m,Zu(b),S);if(b.$$typeof===rs)return v(g,m,Xu(g,b),S);Qu(g,b)}return typeof b=="string"&&b!==""||typeof b=="number"||typeof b=="bigint"?(b=""+b,m!==null&&m.tag===6?(i(g,m.sibling),S=s(m,b),S.return=g,g=S):(i(g,m),S=Ap(b,g.mode,S),S.return=g,g=S),a(g)):i(g,m)}return function(g,m,b,S){try{gc=0;var x=v(g,m,b,S);return Do=null,x}catch(N){if(N===el||N===hd)throw N;var C=Ki(29,N,null,g.mode);return C.lanes=S,C.return=g,C}}}var ga=pw(!0),mw=pw(!1),hr=!1;function Eg(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function _m(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function Sr(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function wr(e,t,i){var n=e.updateQueue;if(n===null)return null;if(n=n.shared,(qe&2)!==0){var s=n.pending;return s===null?t.next=t:(t.next=s.next,s.next=t),n.pending=t,t=Lh(e),aw(e,null,i),t}return cd(e,n,t,i),Lh(e)}function tc(e,t,i){if(t=t.updateQueue,t!==null&&(t=t.shared,(i&4194048)!==0)){var n=t.lanes;n&=e.pendingLanes,i|=n,t.lanes=i,RS(e,i)}}function Rp(e,t){var i=e.updateQueue,n=e.alternate;if(n!==null&&(n=n.updateQueue,i===n)){var s=null,r=null;if(i=i.firstBaseUpdate,i!==null){do{var a={lane:i.lane,tag:i.tag,payload:i.payload,callback:null,next:null};r===null?s=r=a:r=r.next=a,i=i.next}while(i!==null);r===null?s=r=t:r=r.next=t}else s=r=t;i={baseState:n.baseState,firstBaseUpdate:s,lastBaseUpdate:r,shared:n.shared,callbacks:n.callbacks},e.updateQueue=i;return}e=i.lastBaseUpdate,e===null?i.firstBaseUpdate=t:e.next=t,i.lastBaseUpdate=t}var vm=!1;function ic(){if(vm){var e=Ro;if(e!==null)throw e}}function nc(e,t,i,n){vm=!1;var s=e.updateQueue;hr=!1;var r=s.firstBaseUpdate,a=s.lastBaseUpdate,o=s.shared.pending;if(o!==null){s.shared.pending=null;var l=o,c=l.next;l.next=null,a===null?r=c:a.next=c,a=l;var u=e.alternate;u!==null&&(u=u.updateQueue,o=u.lastBaseUpdate,o!==a&&(o===null?u.firstBaseUpdate=c:o.next=c,u.lastBaseUpdate=l))}if(r!==null){var h=s.baseState;a=0,u=c=l=null,o=r;do{var d=o.lane&-536870913,f=d!==o.lane;if(f?(ze&d)===d:(n&d)===d){d!==0&&d===ma&&(vm=!0),u!==null&&(u=u.next={lane:0,tag:o.tag,payload:o.payload,callback:null,next:null});e:{var p=e,_=o;d=t;var v=i;switch(_.tag){case 1:if(p=_.payload,typeof p=="function"){h=p.call(v,h,d);break e}h=p;break e;case 3:p.flags=p.flags&-65537|128;case 0:if(p=_.payload,d=typeof p=="function"?p.call(v,h,d):p,d==null)break e;h=it({},h,d);break e;case 2:hr=!0}}d=o.callback,d!==null&&(e.flags|=64,f&&(e.flags|=8192),f=s.callbacks,f===null?s.callbacks=[d]:f.push(d))}else f={lane:d,tag:o.tag,payload:o.payload,callback:o.callback,next:null},u===null?(c=u=f,l=h):u=u.next=f,a|=d;if(o=o.next,o===null){if(o=s.shared.pending,o===null)break;f=o,o=f.next,f.next=null,s.lastBaseUpdate=f,s.shared.pending=null}}while(!0);u===null&&(l=h),s.baseState=l,s.firstBaseUpdate=c,s.lastBaseUpdate=u,r===null&&(s.shared.lanes=0),Dr|=a,e.lanes=a,e.memoizedState=h}}function gw(e,t){if(typeof e!="function")throw Error(B(191,e));e.call(t)}function _w(e,t){var i=e.callbacks;if(i!==null)for(e.callbacks=null,e=0;e<i.length;e++)gw(i[e],t)}var Or=ds(null),Uh=ds(0);function py(e,t){e=Hs,ot(Uh,e),ot(Or,t),Hs=e|t.baseLanes}function bm(){ot(Uh,Hs),ot(Or,Or.current)}function xg(){Hs=Uh.current,hi(Or),hi(Uh)}var pi=ds(null),Si=null;function Er(e){var t=e.alternate;ot(di,di.current&1),ot(pi,e),Si===null&&(t===null||Or.current!==null||t.memoizedState!==null)&&(Si=e)}function ym(e){ot(di,di.current),ot(pi,e),Si===null&&(Si=e)}function vw(e){e.tag===22?(ot(di,di.current),ot(pi,e),Si===null&&(Si=e)):xr()}function xr(){ot(di,di.current),ot(pi,pi.current)}function Qi(e){hi(pi),Si===e&&(Si=null),hi(di)}var di=ds(0);function _c(e,t){ot(pi,pi.current),ot(di,t)}function Cg(e){hi(di),hi(pi),Si===e&&(Si=null)}function Hh(e){for(var t=e;t!==null;){if(t.tag===13){var i=t.memoizedState;if(i!==null&&(i=i.dehydrated,i===null||eg(i)||Qg(i)))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!=="independent"){if((t.flags&128)!==0)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var zs=0,we=null,Qe=null,Ot=null,Fh=!1,Lo=!1,_a=!1,qh=0,vc=0,Bo=null,PR=0;function yt(){throw Error(B(321))}function kg(e,t){if(t===null)return!1;for(var i=0;i<t.length&&i<e.length;i++)if(!an(e[i],t[i]))return!1;return!0}function Tg(e,t,i,n,s,r){return zs=r,we=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,ge.H=e===null||e.memoizedState===null?Vw:Xw,_a=!1,r=i(n,s),_a=!1,Lo&&(r=yw(t,i,n,s)),bw(e),r}function bw(e){ge.H=Kh;var t=Qe!==null&&Qe.next!==null;if(zs=0,Ot=Qe=we=null,Fh=!1,vc=0,Bo=null,t)throw Error(B(300));e===null||Dt||(e=e.dependencies,e!==null&&zh(e)&&(Dt=!0))}function yw(e,t,i,n){we=e;var s=0;do{if(Lo&&(Bo=null),vc=0,Lo=!1,25<=s)throw Error(B(301));if(s+=1,Ot=Qe=null,e.updateQueue!=null){var r=e.updateQueue;r.lastEffect=null,r.events=null,r.stores=null,r.memoCache!=null&&(r.memoCache.index=0)}ge.H=$R,r=t(i,n)}while(Lo);return r}function UR(){var e=ge.H,t=e.useState()[0];return t=typeof t.then=="function"?Dc(t):t,e=e.useState()[0],(Qe!==null?Qe.memoizedState:null)!==e&&(we.flags|=1024),t}function Ng(){var e=qh!==0;return qh=0,e}function Ag(e,t,i){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i}function Mg(e){if(Fh){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}Fh=!1}zs=0,Ot=Qe=we=null,Lo=!1,vc=qh=0,Bo=null}function Oi(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Ot===null?we.memoizedState=Ot=e:Ot=Ot.next=e,Ot}function Tt(){if(Qe===null){var e=we.alternate;e=e!==null?e.memoizedState:null}else e=Qe.next;var t=Ot===null?we.memoizedState:Ot.next;if(t!==null)Ot=t,Qe=e;else{if(e===null)throw we.alternate===null?Error(B(467)):Error(B(310));Qe=e,e={memoizedState:Qe.memoizedState,baseState:Qe.baseState,baseQueue:Qe.baseQueue,queue:Qe.queue,next:null},Ot===null?we.memoizedState=Ot=e:Ot=Ot.next=e}return Ot}function dd(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Dc(e){var t=vc;return vc+=1,Bo===null&&(Bo=[]),e=fw(Bo,e,t),t=we,(Ot===null?t.memoizedState:Ot.next)===null&&(t=t.alternate,ge.H=t===null||t.memoizedState===null?Vw:Xw),e}function fd(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return Dc(e);if(e.$$typeof===yO)return;if(e.$$typeof===rs)return ui(e)}throw Error(B(438,String(e)))}function Og(e){var t=null,i=we.updateQueue;if(i!==null&&(t=i.memoCache),t==null){var n=we.alternate;n!==null&&(n=n.updateQueue,n!==null&&(n=n.memoCache,n!=null&&(t={data:n.data.map(function(s){return s.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),i===null&&(i=dd(),we.updateQueue=i),i.memoCache=t,i=t.data[t.index],i===void 0)for(i=t.data[t.index]=Array(e),n=0;n<e;n++)i[n]=bO;return t.index++,i}function Ps(e,t){return typeof t=="function"?t(e):t}function gh(e){var t=Tt();return Rg(t,Qe,e)}function Rg(e,t,i){var n=e.queue;if(n===null)throw Error(B(311));n.lastRenderedReducer=i;var s=e.baseQueue,r=n.pending;if(r!==null){if(s!==null){var a=s.next;s.next=r.next,r.next=a}t.baseQueue=s=r,n.pending=null}if(r=e.baseState,s===null)e.memoizedState=r;else{t=s.next;var o=a=null,l=null,c=t,u=!1;do{var h=c.lane&-536870913;if(h!==c.lane?(ze&h)===h:(zs&h)===h){var d=c.revertLane;if(d===0)l!==null&&(l=l.next={lane:0,revertLane:0,gesture:null,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null}),h===ma&&(u=!0);else if((zs&d)===d){c=c.next,d===ma&&(u=!0);continue}else h={lane:0,revertLane:c.revertLane,gesture:null,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null},l===null?(o=l=h,a=r):l=l.next=h,we.lanes|=d,Dr|=d;h=c.action,_a&&i(r,h),r=c.hasEagerState?c.eagerState:i(r,h)}else d={lane:h,revertLane:c.revertLane,gesture:c.gesture,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null},l===null?(o=l=d,a=r):l=l.next=d,we.lanes|=h,Dr|=h;c=c.next}while(c!==null&&c!==t);if(l===null?a=r:l.next=o,!an(r,e.memoizedState)&&(Dt=!0,u&&(i=Ro,i!==null)))throw i;e.memoizedState=r,e.baseState=a,e.baseQueue=l,n.lastRenderedState=r}return s===null&&(n.lanes=0),[e.memoizedState,n.dispatch]}function Dp(e){var t=Tt(),i=t.queue;if(i===null)throw Error(B(311));i.lastRenderedReducer=e;var n=i.dispatch,s=i.pending,r=t.memoizedState;if(s!==null){i.pending=null;var a=s=s.next;do r=e(r,a.action),a=a.next;while(a!==s);an(r,t.memoizedState)||(Dt=!0),t.memoizedState=r,t.baseQueue===null&&(t.baseState=r),i.lastRenderedState=r}return[r,n]}function Sw(e,t,i){var n=we,s=Tt(),r=ke;if(r){if(i===void 0)throw Error(B(407));i=i()}else i=t();var a=!an((Qe||s).memoizedState,i);if(a&&(s.memoizedState=i,Dt=!0),s=s.queue,Dg(xw.bind(null,n,s,e),[e]),e=s.getSnapshot!==t||a||Ot!==null&&(Ot.memoizedState.tag&1)!==0,qo(e?9:8,{destroy:void 0},Ew.bind(null,n,s,i,t),null),e){if(n.flags|=2048,tt===null)throw Error(B(349));r||(zs&127)!==0||ww(n,t,i)}return i}function ww(e,t,i){e.flags|=16384,e={getSnapshot:t,value:i},t=we.updateQueue,t===null?(t=dd(),we.updateQueue=t,t.stores=[e]):(i=t.stores,i===null?t.stores=[e]:i.push(e))}function Ew(e,t,i,n){t.value=i,t.getSnapshot=n,Cw(t)&&kw(e)}function xw(e,t,i){return i(function(){Cw(t)&&kw(e)})}function Cw(e){var t=e.getSnapshot;e=e.value;try{var i=t();return!an(e,i)}catch{return!0}}function kw(e){var t=Ea(e,2);t!==null&&Wi(t,e,2)}function Sm(e){var t=Oi();if(typeof e=="function"){var i=e;if(e=i(),_a){fr(!0);try{i()}finally{fr(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ps,lastRenderedState:e},t}function Tw(e,t,i,n){return e.baseState=i,Rg(e,Qe,typeof n=="function"?n:Ps)}function HR(e,t,i,n,s){if(md(e))throw Error(B(485));if(e=t.action,e!==null){var r={payload:s,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(a){r.listeners.push(a)}};ge.T!==null?i(!0):r.isTransition=!1,n(r),i=t.pending,i===null?(r.next=t.pending=r,Nw(t,r)):(r.next=i.next,t.pending=i.next=r)}}function Nw(e,t){var i=t.action,n=t.payload,s=e.state;if(t.isTransition){var r=ge.T,a={};a.types=r!==null?r.types:null,ge.T=a;try{var o=i(s,n),l=ge.S;l!==null&&l(a,o),my(e,t,o)}catch(c){wm(e,t,c)}finally{r!==null&&a.types!==null&&(r.types=a.types),ge.T=r}}else try{r=i(s,n),my(e,t,r)}catch(c){wm(e,t,c)}}function my(e,t,i){i!==null&&typeof i=="object"&&typeof i.then=="function"?i.then(function(n){gy(e,t,n)},function(n){return wm(e,t,n)}):gy(e,t,i)}function gy(e,t,i){t.status="fulfilled",t.value=i,Aw(t),e.state=i,t=e.pending,t!==null&&(i=t.next,i===t?e.pending=null:(i=i.next,t.next=i,Nw(e,i)))}function wm(e,t,i){var n=e.pending;if(e.pending=null,n!==null){n=n.next;do t.status="rejected",t.reason=i,Aw(t),t=t.next;while(t!==n)}e.action=null}function Aw(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Mw(e,t){return t}function _y(e,t){if(ke){var i=tt.formState;if(i!==null){e:{var n=we;if(ke){if(at){t:{for(var s=at,r=En;s.nodeType!==8;){if(!r){s=null;break t}if(s=xn(s.nextSibling),s===null){s=null;break t}}r=s.data,s=r==="F!"||r==="F"?s:null}if(s){at=xn(s.nextSibling),n=s.data==="F!";break e}}Mr(n)}n=!1}n&&(t=i[0])}}return i=Oi(),i.memoizedState=i.baseState=t,n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Mw,lastRenderedState:t},i.queue=n,i=$w.bind(null,we,n),n.dispatch=i,n=Sm(!1),r=zg.bind(null,we,!1,n.queue),n=Oi(),s={state:t,dispatch:null,action:e,pending:null},n.queue=s,i=HR.bind(null,we,s,r,i),s.dispatch=i,n.memoizedState=e,[t,i,!1]}function vy(e){var t=Tt();return Ow(t,Qe,e)}function Ow(e,t,i){if(t=Rg(e,t,Mw)[0],e=gh(Ps)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var n=Dc(t)}catch(a){throw a===el?hd:a}else n=t;t=Tt();var s=t.queue,r=s.dispatch;return i!==t.memoizedState&&(we.flags|=2048,qo(9,{destroy:void 0},FR.bind(null,s,i),null)),[n,r,e]}function FR(e,t){e.action=t}function by(e){var t=Tt(),i=Qe;if(i!==null)return Ow(t,i,e);Tt(),t=t.memoizedState,i=Tt();var n=i.queue.dispatch;return i.memoizedState=e,[t,n,!1]}function qo(e,t,i,n){return e={tag:e,create:i,deps:n,inst:t,next:null},t=we.updateQueue,t===null&&(t=dd(),we.updateQueue=t),i=t.lastEffect,i===null?t.lastEffect=e.next=e:(n=i.next,i.next=e,e.next=n,t.lastEffect=e),e}function Rw(){return Tt().memoizedState}function _h(e,t,i,n){var s=Oi();we.flags|=e,s.memoizedState=qo(1|t,{destroy:void 0},i,n===void 0?null:n)}function pd(e,t,i,n){var s=Tt();n=n===void 0?null:n;var r=s.memoizedState.inst;Qe!==null&&n!==null&&kg(n,Qe.memoizedState.deps)?s.memoizedState=qo(t,r,i,n):(we.flags|=e,s.memoizedState=qo(1|t,r,i,n))}function yy(e,t){_h(8390656,8,e,t)}function Dg(e,t){pd(2048,8,e,t)}function qR(e){we.flags|=4;var t=we.updateQueue;if(t===null)t=dd(),we.updateQueue=t,t.events=[e];else{var i=t.events;i===null?t.events=[e]:i.push(e)}}function Dw(e){var t=Tt().memoizedState;return qR({ref:t,nextImpl:e}),function(){if((qe&2)!==0)throw Error(B(440));return t.impl.apply(void 0,arguments)}}function Lw(e,t){return pd(4,2,e,t)}function Bw(e,t){return pd(4,4,e,t)}function Iw(e,t){if(typeof t=="function"){e=e();var i=t(e);return function(){typeof i=="function"?i():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function zw(e,t,i){i=i!=null?i.concat([e]):null,pd(4,4,Iw.bind(null,t,e),i)}function Lg(){}function Pw(e,t){var i=Tt();t=t===void 0?null:t;var n=i.memoizedState;return t!==null&&kg(t,n[1])?n[0]:(i.memoizedState=[e,t],e)}function Uw(e,t){var i=Tt();t=t===void 0?null:t;var n=i.memoizedState;if(t!==null&&kg(t,n[1]))return n[0];if(n=e(),_a){fr(!0);try{e()}finally{fr(!1)}}return i.memoizedState=[n,t],n}function Bg(e,t,i){return i===void 0||(zs&1073741824)!==0&&(ze&261930)===0?e.memoizedState=t:(e.memoizedState=i,e=O1(),we.lanes|=e,Dr|=e,i)}function Hw(e,t,i,n){return an(i,t)?i:Or.current!==null?(e=Bg(e,i,n),an(e,t)||(Dt=!0),e):(zs&106)===0||(zs&1073741824)!==0&&(ze&261930)===0?(Dt=!0,e.memoizedState=i):(e=O1(),we.lanes|=e,Dr|=e,t)}function Fw(e,t,i,n,s){var r=Ke.p;Ke.p=r!==0&&8>r?r:8;var a=ge.T,o={};o.types=a!==null?a.types:null,ge.T=o,zg(e,!1,t,i);try{var l=s(),c=ge.S;if(c!==null&&c(o,l),l!==null&&typeof l=="object"&&typeof l.then=="function"){var u=zR(l,n);sc(e,t,u,rn(e))}else sc(e,t,n,rn(e))}catch(h){sc(e,t,{then:function(){},status:"rejected",reason:h},rn())}finally{Ke.p=r,a!==null&&o.types!==null&&(a.types=o.types),ge.T=a}}function KR(){}function Em(e,t,i,n){if(e.tag!==5)throw Error(B(476));var s=qw(e).queue;Fw(e,s,t,oa,i===null?KR:function(){return Kw(e),i(n)})}function qw(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:oa,baseState:oa,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ps,lastRenderedState:oa},next:null};var i={};return t.next={memoizedState:i,baseState:i,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ps,lastRenderedState:i},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Kw(e){var t=qw(e);t.next===null&&(t=e.alternate.memoizedState),sc(e,t.next.queue,{},rn())}function Ig(){return ui(Vo)}function Ww(){return Tt().memoizedState}function Gw(){return Tt().memoizedState}function WR(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var i=rn();e=Sr(i);var n=wr(t,e,i);n!==null&&(Wi(n,t,i),tc(n,t,i)),t={cache:yg()},e.payload=t;return}t=t.return}}function GR(e,t,i){var n=rn();i={lane:n,revertLane:0,gesture:null,action:i,hasEagerState:!1,eagerState:null,next:null},md(e)?Yw(t,i):(i=_g(e,t,i,n),i!==null&&(Wi(i,e,n),jw(i,t,n)))}function $w(e,t,i){var n=rn();sc(e,t,i,n)}function sc(e,t,i,n){var s={lane:n,revertLane:0,gesture:null,action:i,hasEagerState:!1,eagerState:null,next:null};if(md(e))Yw(t,s);else{var r=e.alternate;if(e.lanes===0&&(r===null||r.lanes===0)&&(r=t.lastRenderedReducer,r!==null))try{var a=t.lastRenderedState,o=r(a,i);if(s.hasEagerState=!0,s.eagerState=o,an(o,a))return cd(e,t,s,0),tt===null&&ld(),!1}catch{}if(i=_g(e,t,s,n),i!==null)return Wi(i,e,n),jw(i,t,n),!0}return!1}function zg(e,t,i,n){if(n={lane:2,revertLane:jg(),gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},md(e)){if(t)throw Error(B(479))}else t=_g(e,i,n,2),t!==null&&Wi(t,e,2)}function md(e){var t=e.alternate;return e===we||t!==null&&t===we}function Yw(e,t){Lo=Fh=!0;var i=e.pending;i===null?t.next=t:(t.next=i.next,i.next=t),e.pending=t}function jw(e,t,i){if((i&4194048)!==0){var n=t.lanes;n&=e.pendingLanes,i|=n,t.lanes=i,RS(e,i)}}var Kh={readContext:ui,use:fd,useCallback:yt,useContext:yt,useEffect:yt,useImperativeHandle:yt,useLayoutEffect:yt,useInsertionEffect:yt,useMemo:yt,useReducer:yt,useRef:yt,useState:yt,useDebugValue:yt,useDeferredValue:yt,useTransition:yt,useSyncExternalStore:yt,useId:yt,useHostTransitionStatus:yt,useFormState:yt,useActionState:yt,useOptimistic:yt,useMemoCache:yt,useCacheRefresh:yt,useEffectEvent:yt},Vw={readContext:ui,use:fd,useCallback:function(e,t){return Oi().memoizedState=[e,t===void 0?null:t],e},useContext:ui,useEffect:yy,useImperativeHandle:function(e,t,i){i=i!=null?i.concat([e]):null,_h(4194308,4,Iw.bind(null,t,e),i)},useLayoutEffect:function(e,t){return _h(4194308,4,e,t)},useInsertionEffect:function(e,t){_h(4,2,e,t)},useMemo:function(e,t){var i=Oi();t=t===void 0?null:t;var n=e();if(_a){fr(!0);try{e()}finally{fr(!1)}}return i.memoizedState=[n,t],n},useReducer:function(e,t,i){var n=Oi();if(i!==void 0){var s=i(t);if(_a){fr(!0);try{i(t)}finally{fr(!1)}}}else s=t;return n.memoizedState=n.baseState=s,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:s},n.queue=e,e=e.dispatch=GR.bind(null,we,e),[n.memoizedState,e]},useRef:function(e){var t=Oi();return e={current:e},t.memoizedState=e},useState:function(e){e=Sm(e);var t=e.queue,i=$w.bind(null,we,t);return t.dispatch=i,[e.memoizedState,i]},useDebugValue:Lg,useDeferredValue:function(e,t){var i=Oi();return Bg(i,e,t)},useTransition:function(){var e=Sm(!1);return e=Fw.bind(null,we,e.queue,!0,!1),Oi().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,i){var n=we,s=Oi();if(ke){if(i===void 0)throw Error(B(407));i=i()}else{if(i=t(),tt===null)throw Error(B(349));(ze&127)!==0||ww(n,t,i)}s.memoizedState=i;var r={value:i,getSnapshot:t};return s.queue=r,yy(xw.bind(null,n,r,e),[e]),n.flags|=2048,qo(9,{destroy:void 0},Ew.bind(null,n,r,i,t),null),i},useId:function(){var e=Oi(),t=tt.identifierPrefix;if(ke){var i=ls,n=os;i=(n&~(1<<32-sn(n)-1)).toString(32)+i,t="_"+t+"R_"+i,i=qh++,0<i&&(t+="H"+i.toString(32)),t+="_"}else i=PR++,t="_"+t+"r_"+i.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:Ig,useFormState:_y,useActionState:_y,useOptimistic:function(e){var t=Oi();t.memoizedState=t.baseState=e;var i={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=i,t=zg.bind(null,we,!0,i),i.dispatch=t,[e,t]},useMemoCache:Og,useCacheRefresh:function(){return Oi().memoizedState=WR.bind(null,we)},useEffectEvent:function(e){var t=Oi(),i={impl:e};return t.memoizedState=i,function(){if((qe&2)!==0)throw Error(B(440));return i.impl.apply(void 0,arguments)}}},Xw={readContext:ui,use:fd,useCallback:Pw,useContext:ui,useEffect:Dg,useImperativeHandle:zw,useInsertionEffect:Lw,useLayoutEffect:Bw,useMemo:Uw,useReducer:gh,useRef:Rw,useState:function(){return gh(Ps)},useDebugValue:Lg,useDeferredValue:function(e,t){var i=Tt();return Hw(i,Qe.memoizedState,e,t)},useTransition:function(){var e=gh(Ps)[0],t=Tt().memoizedState;return[typeof e=="boolean"?e:Dc(e),t]},useSyncExternalStore:Sw,useId:Ww,useHostTransitionStatus:Ig,useFormState:vy,useActionState:vy,useOptimistic:function(e,t){var i=Tt();return Tw(i,Qe,e,t)},useMemoCache:Og,useCacheRefresh:Gw,useEffectEvent:Dw},$R={readContext:ui,use:fd,useCallback:Pw,useContext:ui,useEffect:Dg,useImperativeHandle:zw,useInsertionEffect:Lw,useLayoutEffect:Bw,useMemo:Uw,useReducer:Dp,useRef:Rw,useState:function(){return Dp(Ps)},useDebugValue:Lg,useDeferredValue:function(e,t){var i=Tt();return Qe===null?Bg(i,e,t):Hw(i,Qe.memoizedState,e,t)},useTransition:function(){var e=Dp(Ps)[0],t=Tt().memoizedState;return[typeof e=="boolean"?e:Dc(e),t]},useSyncExternalStore:Sw,useId:Ww,useHostTransitionStatus:Ig,useFormState:by,useActionState:by,useOptimistic:function(e,t){var i=Tt();return Qe!==null?Tw(i,Qe,e,t):(i.baseState=e,[e,i.queue.dispatch])},useMemoCache:Og,useCacheRefresh:Gw,useEffectEvent:Dw};function Lp(e,t,i,n){t=e.memoizedState,i=i(n,t),i=i==null?t:it({},t,i),e.memoizedState=i,e.lanes===0&&(e.updateQueue.baseState=i)}var xm={enqueueSetState:function(e,t,i){e=e._reactInternals;var n=rn(),s=Sr(n);s.payload=t,i!=null&&(s.callback=i),t=wr(e,s,n),t!==null&&(Wi(t,e,n),tc(t,e,n))},enqueueReplaceState:function(e,t,i){e=e._reactInternals;var n=rn(),s=Sr(n);s.tag=1,s.payload=t,i!=null&&(s.callback=i),t=wr(e,s,n),t!==null&&(Wi(t,e,n),tc(t,e,n))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var i=rn(),n=Sr(i);n.tag=2,t!=null&&(n.callback=t),t=wr(e,n,i),t!==null&&(Wi(t,e,i),tc(t,e,i))}};function Sy(e,t,i,n,s,r,a){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(n,r,a):t.prototype&&t.prototype.isPureReactComponent?!fc(i,n)||!fc(s,r):!0}function wy(e,t,i,n){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(i,n),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(i,n),t.state!==e&&xm.enqueueReplaceState(t,t.state,null)}function va(e,t){var i=t;if("ref"in t){i={};for(var n in t)n!=="ref"&&(i[n]=t[n])}if(e=e.defaultProps){i===t&&(i=it({},i));for(var s in e)i[s]===void 0&&(i[s]=e[s])}return i}function Zw(e){Dh(e)}function Qw(e){console.error(e)}function Jw(e){Dh(e)}function Wh(e,t){try{var i=e.onUncaughtError;i(t.value,{componentStack:t.stack})}catch(n){setTimeout(function(){throw n})}}function Ey(e,t,i){try{var n=e.onCaughtError;n(i.value,{componentStack:i.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(s){setTimeout(function(){throw s})}}function Cm(e,t,i){return i=Sr(i),i.tag=3,i.payload={element:null},i.callback=function(){Wh(e,t)},i}function e1(e){return e=Sr(e),e.tag=3,e}function t1(e,t,i,n){var s=i.type.getDerivedStateFromError;if(typeof s=="function"){var r=n.value;e.payload=function(){return s(r)},e.callback=function(){Ey(t,i,n)}}var a=i.stateNode;a!==null&&typeof a.componentDidCatch=="function"&&(e.callback=function(){Ey(t,i,n),typeof s!="function"&&(Cr===null?Cr=new Set([this]):Cr.add(this));var o=n.stack;this.componentDidCatch(n.value,{componentStack:o!==null?o:""})})}function YR(e,t,i,n,s){if(i.flags|=32768,n!==null&&typeof n=="object"&&typeof n.then=="function"){if(t=i.alternate,t!==null&&fa(t,i,s,!0),i=pi.current,i!==null){switch(i.tag){case 31:case 13:case 19:return Si===null?Qh():i.alternate===null&&St===0&&(St=3),i.flags&=-257,i.flags|=65536,i.lanes=s,n===Ph?i.flags|=16384:(t=i.updateQueue,t===null?i.updateQueue=new Set([n]):t.add(n),Fp(e,n,s)),!1;case 22:return i.flags|=65536,n===Ph?i.flags|=16384:(t=i.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([n])},i.updateQueue=t):(i=t.retryQueue,i===null?t.retryQueue=new Set([n]):i.add(n)),Fp(e,n,s)),!1}throw Error(B(435,i.tag))}return Fp(e,n,s),Qh(),!1}if(ke)return t=pi.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=s,n!==fm&&(e=Error(B(422),{cause:n}),mc(wn(e,i)))):(n!==fm&&(t=Error(B(423),{cause:n}),mc(wn(t,i))),e=e.current.alternate,e.flags|=65536,s&=-s,e.lanes|=s,n=wn(n,i),s=Cm(e.stateNode,n,s),Rp(e,s),St!==4&&(St=2)),!1;var r=Error(B(520),{cause:n});if(r=wn(r,i),lc===null?lc=[r]:lc.push(r),St!==4&&(St=2),t===null)return!0;n=wn(n,i),i=t;do{switch(i.tag){case 3:return i.flags|=65536,e=s&-s,i.lanes|=e,e=Cm(i.stateNode,n,e),Rp(i,e),!1;case 1:if(t=i.type,r=i.stateNode,(i.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||r!==null&&typeof r.componentDidCatch=="function"&&(Cr===null||!Cr.has(r))))return i.flags|=65536,s&=-s,i.lanes|=s,s=e1(s),t1(s,e,i,n),Rp(i,s),!1;break;case 22:if(i.memoizedState!==null)return i.flags|=65536,!1}i=i.return}while(i!==null);return!1}var Pg=Error(B(461)),Dt=!1;function Ht(e,t,i,n){t.child=e===null?mw(t,null,i,n):ga(t,e.child,i,n)}function xy(e,t,i,n,s){i=i.render;var r=t.ref;if("ref"in n){var a={};for(var o in n)o!=="ref"&&(a[o]=n[o])}else a=n;return pa(t),n=Tg(e,t,i,a,r,s),o=Ng(),e!==null&&!Dt?(Ag(e,t,s),Us(e,t,s)):(ke&&o&&ud(t),t.flags|=1,Ht(e,t,n,s),t.child)}function Cy(e,t,i,n,s){if(e===null){var r=i.type;return typeof r=="function"&&!vg(r)&&r.defaultProps===void 0&&i.compare===null?(t.tag=15,t.type=r,i1(e,t,r,n,s)):(e=fh(i.type,null,n,t,t.mode,s),e.ref=t.ref,e.return=t,t.child=e)}if(r=e.child,!Hg(e,s)){var a=r.memoizedProps;if(i=i.compare,i=i!==null?i:fc,i(a,n)&&e.ref===t.ref)return Us(e,t,s)}return t.flags|=1,e=Ds(r,n),e.ref=t.ref,e.return=t,t.child=e}function i1(e,t,i,n,s){if(e!==null){var r=e.memoizedProps;if(fc(r,n)&&e.ref===t.ref)if(Dt=!1,t.pendingProps=n=r,Hg(e,s))(e.flags&131072)!==0&&(Dt=!0);else return t.lanes=e.lanes,Us(e,t,s)}return km(e,t,i,n,s)}function n1(e,t,i,n){var s=n.children,r=e!==null?e.memoizedState:null;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),n.mode==="hidden"){if((t.flags&128)!==0){if(r=r!==null?r.baseLanes|i:i,e!==null){for(n=t.child=e.child,s=0;n!==null;)s=s|n.lanes|n.childLanes,n=n.sibling;n=s&~r}else n=0,t.child=null;return ky(e,t,r,i,n)}if((i&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&mh(t,r!==null?r.cachePool:null),r!==null?py(t,r):bm(),vw(t);else return n=t.lanes=536870912,ky(e,t,r!==null?r.baseLanes|i:i,i,n)}else r!==null?(mh(t,r.cachePool),py(t,r),xr(),t.memoizedState=null):(e!==null&&mh(t,null),bm(),xr());return Ht(e,t,s,i),t.child}function rc(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function ky(e,t,i,n,s){var r=Sg();return r=r===null?null:{parent:Rt._currentValue,pool:r},t.memoizedState={baseLanes:i,cachePool:r},e!==null&&mh(t,null),bm(),vw(t),e!==null&&fa(e,t,n,!0),t.childLanes=s,null}function vh(e,t){return t=gd({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function Ty(e,t,i){return ga(t,e.child,null,i),e=vh(t,t.pendingProps),e.flags|=2,Qi(t),t.memoizedState=null,e}function jR(e,t,i){var n=t.pendingProps,s=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(ke){if(n.mode==="hidden")return e=vh(t,n),t.lanes=536870912,e.memoizedState={baseLanes:0,cachePool:null},rc(null,e);if(ym(t),(e=at)?(e=nE(e,En),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Ar!==null?{id:os,overflow:ls}:null,retryLane:536870912,hydrationErrors:null},i=lw(e),i.return=t,t.child=i,Xt=t,at=null)):e=null,e===null)throw Mr(t);return t.lanes=536870912,null}return vh(t,n)}var r=e.memoizedState;if(r!==null){var a=r.dehydrated;if(ym(t),s)if(t.flags&256)t.flags&=-257,t=Ty(e,t,i);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(B(558));else if(Dt||fa(e,t,i,!1),s=(i&e.childLanes)!==0,Dt||s){if(Or.current===null){if(n=tt,n!==null&&(a=DS(n,i),a!==0&&a!==r.retryLane))throw r.retryLane=a,Ea(e,a),Wi(n,e,a),Pg;Qh()}t=Ty(e,t,i)}else e=r.treeContext,at=xn(a.nextSibling),Xt=t,ke=!0,yr=null,En=!1,e!==null&&uw(t,e),t=vh(t,n),t.flags|=134221824;return t}return e=Ds(e.child,{mode:n.mode,children:n.children}),e.ref=t.ref,t.child=e,e.return=t,e}function po(e,t){var i=t.ref;if(i===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof i!="function"&&typeof i!="object")throw Error(B(284));(e===null||e.ref!==i)&&(t.flags|=4194816)}}function km(e,t,i,n,s){return pa(t),i=Tg(e,t,i,n,void 0,s),n=Ng(),e!==null&&!Dt?(Ag(e,t,s),Us(e,t,s)):(ke&&n&&ud(t),t.flags|=1,Ht(e,t,i,s),t.child)}function Ny(e,t,i,n,s,r){return pa(t),t.updateQueue=null,i=yw(t,n,i,s),bw(e),n=Ng(),e!==null&&!Dt?(Ag(e,t,r),Us(e,t,r)):(ke&&n&&ud(t),t.flags|=1,Ht(e,t,i,r),t.child)}function Ay(e,t,i,n,s){if(pa(t),t.stateNode===null){var r=Co,a=i.contextType;typeof a=="object"&&a!==null&&(r=ui(a)),r=new i(n,r),t.memoizedState=r.state!==null&&r.state!==void 0?r.state:null,r.updater=xm,t.stateNode=r,r._reactInternals=t,r=t.stateNode,r.props=n,r.state=t.memoizedState,r.refs={},Eg(t),a=i.contextType,r.context=typeof a=="object"&&a!==null?ui(a):Co,r.state=t.memoizedState,a=i.getDerivedStateFromProps,typeof a=="function"&&(Lp(t,i,a,n),r.state=t.memoizedState),typeof i.getDerivedStateFromProps=="function"||typeof r.getSnapshotBeforeUpdate=="function"||typeof r.UNSAFE_componentWillMount!="function"&&typeof r.componentWillMount!="function"||(a=r.state,typeof r.componentWillMount=="function"&&r.componentWillMount(),typeof r.UNSAFE_componentWillMount=="function"&&r.UNSAFE_componentWillMount(),a!==r.state&&xm.enqueueReplaceState(r,r.state,null),nc(t,n,r,s),ic(),r.state=t.memoizedState),typeof r.componentDidMount=="function"&&(t.flags|=4194308),n=!0}else if(e===null){r=t.stateNode;var o=t.memoizedProps,l=va(i,o);r.props=l;var c=r.context,u=i.contextType;a=Co,typeof u=="object"&&u!==null&&(a=ui(u));var h=i.getDerivedStateFromProps;u=typeof h=="function"||typeof r.getSnapshotBeforeUpdate=="function",o=t.pendingProps!==o,u||typeof r.UNSAFE_componentWillReceiveProps!="function"&&typeof r.componentWillReceiveProps!="function"||(o||c!==a)&&wy(t,r,n,a),hr=!1;var d=t.memoizedState;r.state=d,nc(t,n,r,s),ic(),c=t.memoizedState,o||d!==c||hr?(typeof h=="function"&&(Lp(t,i,h,n),c=t.memoizedState),(l=hr||Sy(t,i,l,n,d,c,a))?(u||typeof r.UNSAFE_componentWillMount!="function"&&typeof r.componentWillMount!="function"||(typeof r.componentWillMount=="function"&&r.componentWillMount(),typeof r.UNSAFE_componentWillMount=="function"&&r.UNSAFE_componentWillMount()),typeof r.componentDidMount=="function"&&(t.flags|=4194308)):(typeof r.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=n,t.memoizedState=c),r.props=n,r.state=c,r.context=a,n=l):(typeof r.componentDidMount=="function"&&(t.flags|=4194308),n=!1)}else{r=t.stateNode,_m(e,t),a=t.memoizedProps,u=va(i,a),r.props=u,h=t.pendingProps,d=r.context,c=i.contextType,l=Co,typeof c=="object"&&c!==null&&(l=ui(c)),o=i.getDerivedStateFromProps,(c=typeof o=="function"||typeof r.getSnapshotBeforeUpdate=="function")||typeof r.UNSAFE_componentWillReceiveProps!="function"&&typeof r.componentWillReceiveProps!="function"||(a!==h||d!==l)&&wy(t,r,n,l),hr=!1,d=t.memoizedState,r.state=d,nc(t,n,r,s),ic();var f=t.memoizedState;a!==h||d!==f||hr||e!==null&&e.dependencies!==null&&zh(e.dependencies)?(typeof o=="function"&&(Lp(t,i,o,n),f=t.memoizedState),(u=hr||Sy(t,i,u,n,d,f,l)||e!==null&&e.dependencies!==null&&zh(e.dependencies))?(c||typeof r.UNSAFE_componentWillUpdate!="function"&&typeof r.componentWillUpdate!="function"||(typeof r.componentWillUpdate=="function"&&r.componentWillUpdate(n,f,l),typeof r.UNSAFE_componentWillUpdate=="function"&&r.UNSAFE_componentWillUpdate(n,f,l)),typeof r.componentDidUpdate=="function"&&(t.flags|=4),typeof r.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof r.componentDidUpdate!="function"||a===e.memoizedProps&&d===e.memoizedState||(t.flags|=4),typeof r.getSnapshotBeforeUpdate!="function"||a===e.memoizedProps&&d===e.memoizedState||(t.flags|=1024),t.memoizedProps=n,t.memoizedState=f),r.props=n,r.state=f,r.context=l,n=u):(typeof r.componentDidUpdate!="function"||a===e.memoizedProps&&d===e.memoizedState||(t.flags|=4),typeof r.getSnapshotBeforeUpdate!="function"||a===e.memoizedProps&&d===e.memoizedState||(t.flags|=1024),n=!1)}return r=n,po(e,t),n=(t.flags&128)!==0,r||n?(r=t.stateNode,i=n&&typeof i.getDerivedStateFromError!="function"?null:r.render(),t.flags|=1,e!==null&&n?(t.child=ga(t,e.child,null,s),t.child=ga(t,null,i,s)):Ht(e,t,i,s),t.memoizedState=r.state,e=t.child):e=Us(e,t,s),e}function My(e,t,i,n){return da(),t.flags|=256,Ht(e,t,i,n),t.child}var Tm={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Nm(e){return{baseLanes:e,cachePool:dw()}}function Am(e,t,i){return e=e!==null?e.childLanes&~i:0,t&&(e|=en),e}function s1(e,t,i){var n=t.pendingProps,s=!1,r=(t.flags&128)!==0,a;if((a=r)||(a=e!==null&&e.memoizedState===null?!1:(di.current&2)!==0),a&&(s=!0,t.flags&=-129),a=(t.flags&32)!==0,t.flags&=-33,e===null){if(ke){if(s?Er(t):xr(),(e=at)?(e=nE(e,En),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Ar!==null?{id:os,overflow:ls}:null,retryLane:536870912,hydrationErrors:null},i=lw(e),i.return=t,t.child=i,Xt=t,at=null)):e=null,e===null)throw Mr(t);return Qg(e)?t.lanes=32:t.lanes=536870912,null}return r=n.children,n=n.fallback,s?(xr(),s=t.mode,r=gd({mode:"hidden",children:r},s),n=la(n,s,i,null),r.return=t,n.return=t,r.sibling=n,t.child=r,n=t.child,n.memoizedState=Nm(i),n.childLanes=Am(e,a,i),t.memoizedState=Tm,rc(null,n)):(Er(t),Ug(t,r))}var o=e.memoizedState;if(o!==null){var l=o.dehydrated;if(l!==null)return VR(e,t,r,a,n,l,o,i)}return s?(xr(),s=n.fallback,r=t.mode,o=e.child,l=o.sibling,n=Ds(o,{mode:"hidden",children:n.children}),n.subtreeFlags=o.subtreeFlags&1206910976,l!==null?s=Ds(l,s):(s=la(s,r,i,null),s.flags|=2),s.return=t,n.return=t,n.sibling=s,t.child=n,rc(null,n),n=t.child,s=e.child.memoizedState,s===null?s=Nm(i):(r=s.cachePool,r!==null?(o=Rt._currentValue,r=r.parent!==o?{parent:o,pool:o}:r):r=dw(),s={baseLanes:s.baseLanes|i,cachePool:r}),n.memoizedState=s,n.childLanes=Am(e,a,i),t.memoizedState=Tm,rc(e.child,n)):(Er(t),i=e.child,e=i.sibling,i=Ds(i,{mode:"visible",children:n.children}),i.return=t,i.sibling=null,e!==null&&(a=t.deletions,a===null?(t.deletions=[e],t.flags|=16):a.push(e)),t.child=i,t.memoizedState=null,i)}function Ug(e,t){return t=gd({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function gd(e,t){return e=Ki(22,e,null,t),e.lanes=0,e}function Ju(e,t,i){return ga(t,e.child,null,i),e=Ug(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function VR(e,t,i,n,s,r,a,o){if(i)return t.flags&256?(Er(t),t.flags&=-257,Ju(e,t,o)):t.memoizedState!==null?(xr(),t.child=e.child,t.flags|=128,null):(xr(),r=s.fallback,a=t.mode,s=gd({mode:"visible",children:s.children},a),r=la(r,a,o,null),r.flags|=2,s.return=t,r.return=t,s.sibling=r,t.child=s,ga(t,e.child,null,o),s=t.child,s.memoizedState=Nm(o),s.childLanes=Am(e,n,o),t.memoizedState=Tm,rc(null,s));if(Er(t),Qg(r)){if(n=r.nextSibling&&r.nextSibling.dataset,n)var l=n.dgst;return n=l,n!==""&&(s=Error(B(419)),s.stack="",s.digest=n,mc({value:s,source:null,stack:null})),Ju(e,t,o)}if(Dt||fa(e,t,o,!1),n=(o&e.childLanes)!==0,Dt||n){if(Or.current!==null)return Ju(e,t,o);if(n=tt,n!==null&&(s=DS(n,o),s!==0&&s!==a.retryLane))throw a.retryLane=s,Ea(e,s),Wi(n,e,s),Pg;return eg(r)||Qh(),Ju(e,t,o)}return eg(r)?(t.flags|=192,t.child=e.child,null):(e=a.treeContext,at=xn(r.nextSibling),Xt=t,ke=!0,yr=null,En=!1,e!==null&&uw(t,e),t=Ug(t,s.children),t.flags|=134221824,t)}function Oy(e,t,i){e.lanes|=t;var n=e.alternate;n!==null&&(n.lanes|=t),ph(e.return,t,i)}function Ry(e){for(var t=null;e!==null;){var i=e.alternate;i!==null&&Hh(i)===null&&(t=e),e=e.sibling}return t}function eh(e,t,i,n,s,r){var a=e.memoizedState;a===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:n,tail:i,tailMode:s,treeForkCount:r}:(a.isBackwards=t,a.rendering=null,a.renderingStartTime=0,a.last=n,a.tail=i,a.tailMode=s,a.treeForkCount=r)}function Bp(e){var t=e.child;for(e.child=null;t!==null;){var i=t.sibling;t.sibling=e.child,e.child=t,t=i}}function Mm(e,t,i){var n=t.pendingProps,s=n.revealOrder,r=n.tail;n=n.children;var a=di.current;if(t.flags&128)return _c(t,a),null;var o=(a&2)!==0;if(o?(a=a&1|2,t.flags|=128):a&=1,_c(t,a),s==="backwards"&&e!==null?(Bp(e),Ht(e,t,n,i),Bp(e)):Ht(e,t,n,i),n=ke?pc:0,!o&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Oy(e,i,t);else if(e.tag===19)Oy(e,i,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(s){case"backwards":i=Ry(t.child),i===null?(s=t.child,t.child=null):(s=i.sibling,i.sibling=null,Bp(t)),eh(t,!0,s,null,r,n);break;case"unstable_legacy-backwards":for(i=null,s=t.child,t.child=null;s!==null;){if(e=s.alternate,e!==null&&Hh(e)===null){t.child=s;break}e=s.sibling,s.sibling=i,i=s,s=e}eh(t,!0,i,null,r,n);break;case"together":eh(t,!1,null,null,void 0,n);break;case"independent":t.memoizedState=null;break;default:i=Ry(t.child),i===null?(s=t.child,t.child=null):(s=i.sibling,i.sibling=null),eh(t,!1,s,i,r,n)}return t.child}function Dy(e,t,i){var n=t.pendingProps;return mr(t,t.type,n.value),Ht(e,t,n.children,i),t.child}function Us(e,t,i){if(e!==null&&(t.dependencies=e.dependencies),Dr|=t.lanes,(i&t.childLanes)===0)if(e!==null){if(fa(e,t,i,!1),(i&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(B(153));if(t.child!==null){for(e=t.child,i=Ds(e,e.pendingProps),t.child=i,i.return=t;e.sibling!==null;)e=e.sibling,i=i.sibling=Ds(e,e.pendingProps),i.return=t;i.sibling=null}return t.child}function Hg(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&zh(e)))}function XR(e,t,i){switch(t.tag){case 3:Ah(t,t.stateNode.containerInfo),mr(t,Rt,e.memoizedState.cache),da();break;case 27:case 5:nm(t);break;case 4:Ah(t,t.stateNode.containerInfo);break;case 10:mr(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,ym(t),null;break;case 13:var n=t.memoizedState;if(n!==null){if(n.dehydrated!==null)return Er(t),t.flags|=128,null;n=fa(e,t,i,!1);var s=t.child.childLanes;return n||(i&s)!==0?s1(e,t,i):(Er(t),e=Us(e,t,i),e!==null?e.sibling:null)}Er(t);break;case 19:if(t.flags&128)return Mm(e,t,i);if(s=(e.flags&128)!==0,n=(i&t.childLanes)!==0,n||(fa(e,t,i,!1),n=(i&t.childLanes)!==0),s){if(n)return Mm(e,t,i);t.flags|=128}if(s=t.memoizedState,s!==null&&(s.rendering=null,s.tail=null,s.lastEffect=null),_c(t,di.current),n)break;return null;case 22:return t.lanes=0,n1(e,t,i,t.pendingProps);case 24:mr(t,Rt,e.memoizedState.cache)}return Us(e,t,i)}function r1(e,t,i){if(e!==null)if(e.memoizedProps!==t.pendingProps)Dt=!0;else{if(!Hg(e,i)&&(t.flags&128)===0)return Dt=!1,XR(e,t,i);Dt=(e.flags&131072)!==0}else Dt=!1,ke&&(t.flags&1048576)!==0&&cw(t,pc,t.index);switch(t.lanes=0,t.tag){case 16:e:{var n=t.pendingProps;if(e=na(t.elementType),t.type=e,typeof e=="function")vg(e)?(n=va(e,n),t.tag=1,t=Ay(null,t,e,n,i)):(t.tag=0,t=km(null,t,e,n,i));else{if(e!=null){var s=e.$$typeof;if(s===rg){t.tag=11,t=xy(null,t,e,n,i);break e}else if(s===ag){t.tag=14,t=Cy(null,t,e,n,i);break e}else if(s===rs){t.tag=10,t.type=e,t=Dy(null,t,i);break e}}throw t=tm(e)||e,Error(B(306,t,""))}}return t;case 0:return km(e,t,t.type,t.pendingProps,i);case 1:return n=t.type,s=va(n,t.pendingProps),Ay(e,t,n,s,i);case 3:e:{if(Ah(t,t.stateNode.containerInfo),e===null)throw Error(B(387));n=t.pendingProps;var r=t.memoizedState;s=r.element,_m(e,t),nc(t,n,null,i);var a=t.memoizedState;if(n=a.cache,mr(t,Rt,n),n!==r.cache&&mm(t,[Rt],i,!0),ic(),n=a.element,r.isDehydrated)if(r={element:n,isDehydrated:!1,cache:a.cache},t.updateQueue.baseState=r,t.memoizedState=r,t.flags&256){t=My(e,t,n,i);break e}else if(n!==s){s=wn(Error(B(424)),t),mc(s),t=My(e,t,n,i);break e}else for(e=t.stateNode.containerInfo,e.nodeType===9?e=e.body:e=e.nodeName==="HTML"?e.ownerDocument.body:e,at=xn(e.firstChild),Xt=t,ke=!0,yr=null,En=!0,i=mw(t,null,n,i),t.child=i;i;)i.flags=i.flags&-3|134221824,i=i.sibling;else{if(da(),n===s){t=Us(e,t,i);break e}Ht(e,t,n,i)}t=t.child}return t;case 26:return po(e,t),e===null?(i=aS(t.type,null,t.pendingProps,null))?t.memoizedState=i:ke||(t.stateNode=j1(t.type,t.pendingProps,br.current,t)):t.memoizedState=aS(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return nm(t),e===null&&ke&&(n=t.stateNode=sE(t.type,t.pendingProps,br.current),Xt=t,En=!0,s=at,Br(t.type)?(tg=s,at=xn(n.firstChild)):at=s),Ht(e,t,t.pendingProps.children,i),po(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&ke&&((s=n=at)&&(n=qD(n,t.type,t.pendingProps,En),n!==null?(t.stateNode=n,Xt=t,at=xn(n.firstChild),En=!1,s=!0):s=!1),s||Mr(t)),nm(t),s=t.type,r=t.pendingProps,a=e!==null?e.memoizedProps:null,n=r.children,Zm(s,r)?n=null:a!==null&&Zm(s,a)&&(t.flags|=32),t.memoizedState!==null&&(s=Tg(e,t,UR,null,null,i),Vo._currentValue=s),po(e,t),Ht(e,t,n,i),t.child;case 6:return e===null&&ke&&((e=i=at)&&(i=KD(i,t.pendingProps,En),i!==null?(t.stateNode=i,Xt=t,at=null,e=!0):e=!1),e||Mr(t)),null;case 13:return s1(e,t,i);case 4:return Ah(t,t.stateNode.containerInfo),n=t.pendingProps,e===null?t.child=ga(t,null,n,i):Ht(e,t,n,i),t.child;case 11:return xy(e,t,t.type,t.pendingProps,i);case 7:return n=t.pendingProps,po(e,t),Ht(e,t,n,i),t.child;case 8:return Ht(e,t,t.pendingProps.children,i),t.child;case 12:return Ht(e,t,t.pendingProps.children,i),t.child;case 10:return Dy(e,t,i);case 9:return s=t.type._context,n=t.pendingProps.children,pa(t),s=ui(s),n=n(s),t.flags|=1,Ht(e,t,n,i),t.child;case 14:return Cy(e,t,t.type,t.pendingProps,i);case 15:return i1(e,t,t.type,t.pendingProps,i);case 19:return Mm(e,t,i);case 31:return jR(e,t,i);case 22:return n1(e,t,i,t.pendingProps);case 24:return pa(t),n=ui(Rt),e===null?(s=Sg(),s===null&&(s=tt,r=yg(),s.pooledCache=r,r.refCount++,r!==null&&(s.pooledCacheLanes|=i),s=r),t.memoizedState={parent:n,cache:s},Eg(t),mr(t,Rt,s)):((e.lanes&i)!==0&&(_m(e,t),nc(t,null,null,i),ic()),s=e.memoizedState,r=t.memoizedState,s.parent!==n?(s={parent:n,cache:n},t.memoizedState=s,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=s),mr(t,Rt,n)):(n=r.cache,mr(t,Rt,n),n!==s.cache&&mm(t,[Rt],i,!0))),Ht(e,t,t.pendingProps.children,i),t.child;case 30:return t.stateNode===null&&(t.stateNode={autoName:null,paired:null,clones:null,ref:null}),n=t.pendingProps,n.name!=null&&n.name!=="auto"?t.flags|=e===null?18882560:18874368:ke&&ud(t),e!==null&&e.memoizedProps.name!==n.name?t.flags|=4194816:po(e,t),Ht(e,t,n.children,i),t.child;case 29:throw t.pendingProps}throw Error(B(156,t.tag))}function Ms(e){e.flags|=4}function Ip(e,t,i,n,s){var r;if((r=(e.mode&32)!==0)&&(r=i===null?cS(t,n):cS(t,n)&&(n.src!==i.src||n.srcSet!==i.srcSet)),r){if(e.flags|=16777216,(s&335544128)===s)if(e.stateNode.complete)e.flags|=8192;else if(L1())e.flags|=8192;else throw ua=Ph,wg}else e.flags&=-16777217}function Ly(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!lE(t))if(L1())e.flags|=8192;else throw ua=Ph,wg}function th(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?MS():536870912,e.lanes|=t,Ko|=t)}function ql(e,t){if(!ke)switch(e.tailMode){case"visible":break;case"collapsed":for(var i=e.tail,n=null;i!==null;)i.alternate!==null&&(n=i),i=i.sibling;n===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:n.sibling=null;break;default:for(t=e.tail,i=null;t!==null;)t.alternate!==null&&(i=t),t=t.sibling;i===null?e.tail=null:i.sibling=null}}function rt(e){var t=e.alternate!==null&&e.alternate.child===e.child,i=0,n=0;if(t)for(var s=e.child;s!==null;)i|=s.lanes|s.childLanes,n|=s.subtreeFlags&1206910976,n|=s.flags&1206910976,s.return=e,s=s.sibling;else for(s=e.child;s!==null;)i|=s.lanes|s.childLanes,n|=s.subtreeFlags,n|=s.flags,s.return=e,s=s.sibling;return e.subtreeFlags|=n,e.childLanes=i,t}function ZR(e,t,i){var n=t.pendingProps;switch(bg(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return rt(t),null;case 1:return rt(t),null;case 3:return i=t.stateNode,n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),Ls(Rt),Uo(),i.pendingContext&&(i.context=i.pendingContext,i.pendingContext=null),(e===null||e.child===null)&&(ho(t)?Ms(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,Op())),rt(t),null;case 26:var s=t.type,r=t.memoizedState;return e===null?(Ms(t),r!==null?(rt(t),Ly(t,r)):(rt(t),Ip(t,s,null,n,i))):r?r!==e.memoizedState?(Ms(t),rt(t),Ly(t,r)):(rt(t),t.flags&=-16777217):(e=e.memoizedProps,e!==n&&Ms(t),rt(t),Ip(t,s,e,n,i)),null;case 27:if(Mh(t),i=br.current,s=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==n&&Ms(t);else{if(!n){if(t.stateNode===null)throw Error(B(166));return rt(t),t.subtreeFlags&=-33554433,null}e=cs.current,ho(t)?oy(t,e):(e=sE(s,n,i),t.stateNode=e,Ms(t))}return rt(t),t.subtreeFlags&=-33554433,null;case 5:if(Mh(t),s=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==n&&Ms(t);else{if(!n){if(t.stateNode===null)throw Error(B(166));return rt(t),t.subtreeFlags&=-33554433,null}if(r=cs.current,ho(t))oy(t,r);else{var a=Sc(br.current);switch(r){case 1:r=a.createElementNS("http://www.w3.org/2000/svg",s);break;case 2:r=a.createElementNS("http://www.w3.org/1998/Math/MathML",s);break;default:switch(s){case"svg":r=a.createElementNS("http://www.w3.org/2000/svg",s);break;case"math":r=a.createElementNS("http://www.w3.org/1998/Math/MathML",s);break;case"script":r=a.createElement("div"),r.innerHTML="<script><\/script>",r=r.removeChild(r.firstChild);break;case"select":r=typeof n.is=="string"?a.createElement("select",{is:n.is}):a.createElement("select"),n.multiple?r.multiple=!0:n.size&&(r.size=n.size);break;default:r=typeof n.is=="string"?a.createElement(s,{is:n.is}):a.createElement(s)}}r[ci]=t,r[$i]=n;e:for(a=t.child;a!==null;){if(a.tag===5||a.tag===6)r.appendChild(a.stateNode);else if(a.tag!==4&&a.tag!==27&&a.child!==null){a.child.return=a,a=a.child;continue}if(a===t)break e;for(;a.sibling===null;){if(a.return===null||a.return===t)break e;a=a.return}a.sibling.return=a.return,a=a.sibling}t.stateNode=r;e:switch(fi(r,s,n),s){case"button":case"input":case"select":case"textarea":n=!!n.autoFocus;break e;case"img":n=!0;break e;default:n=!1}n&&Ms(t)}}return rt(t),t.subtreeFlags&=-33554433,Ip(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,i),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==n&&Ms(t);else{if(typeof n!="string"&&t.stateNode===null)throw Error(B(166));if(e=br.current,ho(t)){if(e=t.stateNode,i=t.memoizedProps,n=null,s=Xt,s!==null)switch(s.tag){case 27:case 5:n=s.memoizedProps}e[ci]=t,e=!!(e.nodeValue===i||n!==null&&n.suppressHydrationWarning===!0||$1(e.nodeValue,i)),e||Mr(t,!0)}else e=Sc(e).createTextNode(n),e[ci]=t,t.stateNode=e}return rt(t),null;case 31:if(i=t.memoizedState,e===null||e.memoizedState!==null){if(n=ho(t),i!==null){if(e===null){if(!n)throw Error(B(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(B(557));e[ci]=t}else da(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;rt(t),e=!1}else i=Op(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=i),e=!0;if(!e)return t.flags&256?(Qi(t),t):(Qi(t),null);if((t.flags&128)!==0)throw Error(B(558))}return rt(t),null;case 13:if(n=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(s=ho(t),n!==null&&n.dehydrated!==null){if(e===null){if(!s)throw Error(B(318));if(s=t.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(B(317));s[ci]=t}else da(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;rt(t),s=!1}else s=Op(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=s),s=!0;if(!s)return t.flags&256?(Qi(t),t):(Qi(t),null)}return Qi(t),(t.flags&128)!==0?(t.lanes=i,t):(i=n!==null,e=e!==null&&e.memoizedState!==null,i&&(n=t.child,s=null,n.alternate!==null&&n.alternate.memoizedState!==null&&n.alternate.memoizedState.cachePool!==null&&(s=n.alternate.memoizedState.cachePool.pool),r=null,n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(r=n.memoizedState.cachePool.pool),r!==s&&(n.flags|=2048)),i!==e&&i&&(t.child.flags|=8192),th(t,t.updateQueue),rt(t),null);case 4:return Uo(),e===null&&Vg(t.stateNode.containerInfo),t.flags|=67108864,rt(t),null;case 10:return Ls(t.type),rt(t),null;case 19:if(Cg(t),n=t.memoizedState,n===null)return rt(t),null;if(s=(t.flags&128)!==0,r=n.rendering,r===null)if(s)ql(n,!1);else{if(St!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(r=Hh(e),r!==null){for(t.flags|=128,ql(n,!1),e=r.updateQueue,t.updateQueue=e,th(t,e),t.subtreeFlags=0,e=i,i=t.child;i!==null;)ow(i,e),i=i.sibling;return _c(t,di.current&1|2),ke&&Os(t,n.treeForkCount),t.child}e=e.sibling}n.tail!==null&&tn()>Xh&&(t.flags|=128,s=!0,ql(n,!1),t.lanes=4194304)}else{if(!s)if(e=Hh(r),e!==null){if(t.flags|=128,s=!0,e=e.updateQueue,t.updateQueue=e,th(t,e),ql(n,!0),n.tail===null&&n.tailMode!=="collapsed"&&n.tailMode!=="visible"&&!r.alternate&&!ke)return rt(t),null}else 2*tn()-n.renderingStartTime>Xh&&i!==536870912&&(t.flags|=128,s=!0,ql(n,!1),t.lanes=4194304);n.isBackwards?(r.sibling=t.child,t.child=r):(e=n.last,e!==null?e.sibling=r:t.child=r,n.last=r)}if(n.tail!==null){e=n.tail;e:{for(i=e;i!==null;){if(i.alternate!==null){i=!1;break e}i=i.sibling}i=!0}return n.rendering=e,n.tail=e.sibling,n.renderingStartTime=tn(),e.sibling=null,r=di.current,r=s?r&1|2:r&1,n.tailMode==="visible"||n.tailMode==="collapsed"||!i||ke?_c(t,r):(i=r,ot(pi,t),ot(di,i),Si===null&&(Si=t)),ke&&Os(t,n.treeForkCount),e}return rt(t),null;case 22:case 23:return Qi(t),xg(),n=t.memoizedState!==null,e!==null?e.memoizedState!==null!==n&&(t.flags|=8192):n&&(t.flags|=8192),n?(i&536870912)!==0&&(t.flags&128)===0&&(rt(t),t.subtreeFlags&6&&(t.flags|=8192)):rt(t),i=t.updateQueue,i!==null&&th(t,i.retryQueue),i=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(i=e.memoizedState.cachePool.pool),n=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(n=t.memoizedState.cachePool.pool),n!==i&&(t.flags|=2048),e!==null&&hi(ca),null;case 24:return i=null,e!==null&&(i=e.memoizedState.cache),t.memoizedState.cache!==i&&(t.flags|=2048),Ls(Rt),rt(t),null;case 25:return null;case 30:return t.flags|=33554432,rt(t),null}throw Error(B(156,t.tag))}function QR(e,t){switch(bg(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Ls(Rt),Uo(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return Mh(t),null;case 31:if(t.memoizedState!==null){if(Qi(t),t.alternate===null)throw Error(B(340));da()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(Qi(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(B(340));da()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Cg(t),e=t.flags,e&65536?(t.flags=e&-65537|128,e=t.memoizedState,e!==null&&(e.rendering=null,e.tail=null),t.flags|=4,t):null;case 4:return Uo(),null;case 10:return Ls(t.type),null;case 22:case 23:return Qi(t),xg(),e!==null&&hi(ca),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Ls(Rt),null;case 25:return null;default:return null}}function a1(e,t){switch(bg(t),t.tag){case 3:Ls(Rt),Uo();break;case 26:case 27:case 5:Mh(t);break;case 4:Uo();break;case 31:t.memoizedState!==null&&Qi(t);break;case 13:Qi(t);break;case 19:Cg(t);break;case 10:Ls(t.type);break;case 22:case 23:Qi(t),xg(),e!==null&&hi(ca);break;case 24:Ls(Rt)}}function Lc(e,t){try{var i=t.updateQueue,n=i!==null?i.lastEffect:null;if(n!==null){var s=n.next;i=s;do{if((i.tag&e)===e){n=void 0;var r=i.create,a=i.inst;n=r(),a.destroy=n}i=i.next}while(i!==s)}}catch(o){Ze(t,t.return,o)}}function Rr(e,t,i){try{var n=t.updateQueue,s=n!==null?n.lastEffect:null;if(s!==null){var r=s.next;n=r;do{if((n.tag&e)===e){var a=n.inst,o=a.destroy;if(o!==void 0){a.destroy=void 0,s=t;var l=i,c=o;try{c()}catch(u){Ze(s,l,u)}}}n=n.next}while(n!==r)}}catch(u){Ze(t,t.return,u)}}function o1(e){var t=e.updateQueue;if(t!==null){var i=e.stateNode;try{_w(t,i)}catch(n){Ze(e,e.return,n)}}}function l1(e,t,i){i.props=va(e.type,e.memoizedProps),i.state=e.memoizedState;try{i.componentWillUnmount()}catch(n){Ze(e,t,n)}}function ns(e,t){try{var i=e.ref;if(i!==null){switch(e.tag){case 26:case 27:case 5:var n=e.stateNode;break;case 30:var s=e.stateNode,r=Is(e.memoizedProps,s);(s.ref===null||s.ref.name!==r)&&(s.ref=Q1(r)),n=s.ref;break;case 7:if(e.stateNode===null){var a=new on(e);Gi(e.child,!1,HD,a,void 0,void 0),e.stateNode=a}n=e.stateNode;break;default:n=e.stateNode}typeof i=="function"?e.refCleanup=i(n):i.current=n}}catch(o){Ze(e,t,o)}}function li(e,t){var i=e.ref,n=e.refCleanup;if(i!==null)if(typeof n=="function")try{n()}catch(s){Ze(e,t,s)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof i=="function")try{i(null)}catch(s){Ze(e,t,s)}else i.current=null}function Gh(e,t){if((e.tag===5||e.tag===27||e.tag===6)&&e.alternate===null&&t!==null)for(var i=0;i<t.length;i++)iE(e.stateNode,t[i])}function By(e){for(var t=e.return;t!==null&&(qg(t)&&iE(e.stateNode,t.stateNode),!Fg(t));)t=t.return}function ac(e){for(var t=e.return;t!==null&&(qg(t)&&FD(e.stateNode,t.stateNode),!Fg(t));)t=t.return}function Fg(e){return e.tag===5||e.tag===3||e.tag===27}function qg(e){return e&&e.tag===7&&e.stateNode!==null}function Om(e){var t=e.type,i=e.memoizedProps,n=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":i.autoFocus&&n.focus();break e;case"img":i.src?n.src=i.src:i.srcSet&&(n.srcset=i.srcSet)}}catch(s){Ze(e,e.return,s)}}function zp(e,t,i){try{var n=e.stateNode;wD(n,e.type,i,t),n[$i]=t}catch(s){Ze(e,e.return,s)}}function c1(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Br(e.type)||e.tag===4}function Pp(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||c1(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&Br(e.type)||e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Rm(e,t,i,n){var s=e.tag;if(s===5||s===6)s=e.stateNode,t?(i.nodeType===9?i.body:i.nodeName==="HTML"?i.ownerDocument.body:i).insertBefore(s,t):(t=i.nodeType===9?i.body:i.nodeName==="HTML"?i.ownerDocument.body:i,t.appendChild(s),i=i._reactRootContainer,i!=null||t.onclick!==null||(t.onclick=as)),Gh(e,n),Fe=!0;else if(s!==4&&(s===27&&(Gh(e,n),n=null,Br(e.type)&&(i=e.stateNode,t=null)),e=e.child,e!==null))for(Rm(e,t,i,n),e=e.sibling;e!==null;)Rm(e,t,i,n),e=e.sibling}function $h(e,t,i,n){var s=e.tag;if(s===5||s===6)s=e.stateNode,t?i.insertBefore(s,t):i.appendChild(s),Gh(e,n),Fe=!0;else if(s!==4&&(s===27&&(Gh(e,n),n=null,Br(e.type)&&(i=e.stateNode)),e=e.child,e!==null))for($h(e,t,i,n),e=e.sibling;e!==null;)$h(e,t,i,n),e=e.sibling}function u1(e){var t=e.stateNode,i=e.memoizedProps;try{for(var n=e.type,s=t.attributes;s.length;)t.removeAttributeNode(s[0]);fi(t,n,i),t[ci]=e,t[$i]=i}catch(r){Ze(e,e.return,r)}}var Yh=!1,Ji=null;function Iy(e){(e.tag===30||(e.subtreeFlags&33554432)!==0)&&(Yh=!0)}var ss=null;function zy(){var e=ss;return ss=null,e}var qi=0;function tl(e,t,i,n,s){return qi=0,h1(e.child,t,i,n,s)}function h1(e,t,i,n,s){for(var r=!1;e!==null;){if(e.tag===5){var a=e.stateNode;if(n!==null){var o=Qm(a);n.push(o),o.view&&(r=!0)}else r||Qm(a).view&&(r=!0);Yh=!0,V1(a,qi===0?t:t+"_"+qi,i),qi++}else(e.tag!==22||e.memoizedState===null)&&(e.tag===30&&s||h1(e.child,t,i,n,s)&&(r=!0));e=e.sibling}return r}function hs(e,t){for(;e!==null;)e.tag===5?X1(e.stateNode,e.memoizedProps):(e.tag!==22||e.memoizedState===null)&&(e.tag===30&&t||hs(e.child,t)),e=e.sibling}function bh(e){if((e.subtreeFlags&18874368)!==0)for(e=e.child;e!==null;){if((e.tag!==22||e.memoizedState===null)&&(bh(e),e.tag===30&&(e.flags&18874368)!==0&&e.stateNode.paired)){var t=e.memoizedProps;if(t.name==null||t.name==="auto")throw Error(B(544));var i=t.name;t=qs(t.default,t.share),t!=="none"&&(tl(e,i,t,null,!1)||hs(e.child,!1))}e=e.sibling}}function Dm(e,t){if(e.tag===30){var i=e.stateNode,n=e.memoizedProps,s=Is(n,i),r=qs(n.default,i.paired?n.share:n.enter);r!=="none"?tl(e,s,r,null,!1)?(bh(e),i.paired||t||Wo(e,n.onEnter)):hs(e.child,!1):bh(e)}else if((e.subtreeFlags&33554432)!==0)for(e=e.child;e!==null;)Dm(e,t),e=e.sibling;else bh(e)}function Lm(e){if(Ji!==null&&Ji.size!==0){var t=Ji;if((e.subtreeFlags&18874368)!==0)for(e=e.child;e!==null;){if(e.tag!==22||e.memoizedState===null){if(e.tag===30&&(e.flags&18874368)!==0){var i=e.memoizedProps,n=i.name;if(n!=null&&n!=="auto"){var s=t.get(n);if(s!==void 0){var r=qs(i.default,i.share);if(r!=="none"&&(tl(e,n,r,null,!1)?(r=e.stateNode,s.paired=r,r.paired=s,Wo(e,i.onShare)):hs(e.child,!1)),t.delete(n),t.size===0)break}}}Lm(e)}e=e.sibling}}}function Bm(e){if(e.tag===30){var t=e.memoizedProps,i=Is(t,e.stateNode),n=Ji!==null?Ji.get(i):void 0,s=qs(t.default,n!==void 0?t.share:t.exit);s!=="none"&&(tl(e,i,s,null,!1)?n!==void 0?(s=e.stateNode,n.paired=s,s.paired=n,Ji.delete(i),Wo(e,t.onShare)):Wo(e,t.onExit):hs(e.child,!1)),Ji!==null&&Lm(e)}else if((e.subtreeFlags&33554432)!==0)for(e=e.child;e!==null;)Bm(e),e=e.sibling;else Ji!==null&&Lm(e)}function d1(e){for(e=e.child;e!==null;){if(e.tag===30){var t=e.memoizedProps,i=Is(t,e.stateNode);t=qs(t.default,t.update),e.flags&=-5,t!=="none"&&tl(e,i,t,e.memoizedState=[],!1)}else(e.subtreeFlags&33554432)!==0&&d1(e);e=e.sibling}}function Im(e){if((e.subtreeFlags&18874368)!==0)for(e=e.child;e!==null;){if(e.tag!==22||e.memoizedState===null){if(e.tag===30&&(e.flags&18874368)!==0){var t=e.stateNode;t.paired!==null&&(t.paired=null,hs(e.child,!1))}Im(e)}e=e.sibling}}function yh(e){if(e.tag===30)e.stateNode.paired=null,hs(e.child,!1),Im(e);else if((e.subtreeFlags&33554432)!==0)for(e=e.child;e!==null;)yh(e),e=e.sibling;else Im(e)}function f1(e){for(e=e.child;e!==null;)e.tag===30?hs(e.child,!1):(e.subtreeFlags&33554432)!==0&&f1(e),e=e.sibling}function Kg(e,t,i,n,s,r,a){for(var o=!1;t!==null;){if(t.tag===5){var l=t.stateNode;if(r!==null&&qi<r.length){var c=r[qi],u=Qm(l);(c.view||u.view)&&(o=!0);var h;if(h=(e.flags&4)===0)if(u.clip)h=!0;else{h=c.rect;var d=u.rect;h=h.y!==d.y||h.x!==d.x||h.height!==d.height||h.width!==d.width}h&&(e.flags|=4),u.abs?u=!c.abs:(c=c.rect,u=u.rect,u=c.height!==u.height||c.width!==u.width),u&&(e.flags|=32)}else e.flags|=32;(e.flags&4)!==0&&V1(l,qi===0?i:i+"_"+qi,s),o&&(e.flags&4)!==0||(ss===null&&(ss=[]),ss.push(l,qi===0?n:n+"_"+qi,t.memoizedProps)),qi++}else(t.tag!==22||t.memoizedState===null)&&(t.tag===30&&a?e.flags|=t.flags&32:Kg(e,t.child,i,n,s,r,a)&&(o=!0));t=t.sibling}return o}function p1(e,t){for(e=e.child;e!==null;){if(e.tag===30){var i=e.memoizedProps,n=e.stateNode,s=Is(i,n),r=qs(i.default,i.update);if(t){n=n.clones;var a=n===null?null:n.map(ND)}else a=e.memoizedState,e.memoizedState=null;n=e;var o=e.child;qi=0,s=Kg(n,o,s,s,r,a,!1),(e.flags&4)!==0&&s&&(t||Wo(e,i.onUpdate))}else(e.subtreeFlags&33554432)!==0&&p1(e,t);e=e.sibling}}var Yt=!1,$e=!1,es=!1,Up=!1,Py=typeof WeakSet=="function"?WeakSet:Set,jt=null,ts=!1,Xl=!1,jh=!1,zm=!1;function JR(e,t,i){if(e=e.containerInfo,Vm=Xo,e=JS(e),mg(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var s=n.getSelection&&n.getSelection();if(s&&s.rangeCount!==0){n=s.anchorNode;var r=s.anchorOffset,a=s.focusNode;s=s.focusOffset;try{n.nodeType,a.nodeType}catch{n=null;break e}var o=0,l=-1,c=-1,u=0,h=0,d=e,f=null;t:for(;;){for(var p;d!==n||r!==0&&d.nodeType!==3||(l=o+r),d!==a||s!==0&&d.nodeType!==3||(c=o+s),d.nodeType===3&&(o+=d.nodeValue.length),(p=d.firstChild)!==null;)f=d,d=p;for(;;){if(d===e)break t;if(f===n&&++u===r&&(l=o),f===a&&++h===s&&(c=o),(p=d.nextSibling)!==null)break;d=f,f=d.parentNode}d=p}n=l===-1||c===-1?null:{start:l,end:c}}else n=null}n=n||{start:0,end:0}}else n=null;for(Xm={focusedElem:e,selectionRange:n},Xo=!1,i=(i&335544064)===i,jt=t,t=i?9270:1024;jt!==null;){if(e=jt,i&&(n=e.deletions,n!==null))for(r=0;r<n.length;r++)i&&Bm(n[r]);if(e.alternate===null&&(e.flags&2)!==0)i&&Iy(e),ih(i);else{if(e.tag===22){if(n=e.alternate,e.memoizedState!==null){n!==null&&n.memoizedState===null&&i&&Bm(n),ih(i);continue}else if(n!==null&&n.memoizedState!==null){i&&Iy(e),ih(i);continue}}n=e.child,(e.subtreeFlags&t)!==0&&n!==null?(n.return=e,jt=n):(i&&d1(e),ih(i))}}Ji=null}function ih(e){for(;jt!==null;){var t=jt,i=e,n=t.alternate,s=t.flags;switch(t.tag){case 0:case 11:case 15:break;case 1:if((s&1024)!==0&&n!==null){i=void 0,s=n.memoizedProps,n=n.memoizedState;var r=t.stateNode;try{var a=va(t.type,s);i=r.getSnapshotBeforeUpdate(a,n),r.__reactInternalSnapshotBeforeUpdate=i}catch(o){Ze(t,t.return,o)}}break;case 3:if((s&1024)!==0){if(n=t.stateNode.containerInfo,i=n.nodeType,i===9)Jm(n);else if(i===1)switch(n.nodeName){case"HEAD":case"HTML":case"BODY":Jm(n);break;default:n.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;case 30:i&&n!==null&&(i=Is(n.memoizedProps,n.stateNode),s=t.memoizedProps,s=qs(s.default,s.update),s!=="none"&&tl(n,i,s,n.memoizedState=[],!0));break;default:if((s&1024)!==0)throw Error(B(163))}if(n=t.sibling,n!==null){n.return=t.return,jt=n;break}jt=t.return}}function m1(e,t,i){var n=i.flags;switch(i.tag){case 0:case 11:case 15:is(e,i),n&4&&Lc(5,i);break;case 1:if(is(e,i),n&4)if(e=i.stateNode,t===null)try{e.componentDidMount()}catch(a){Ze(i,i.return,a)}else{var s=va(i.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(s,t,e.__reactInternalSnapshotBeforeUpdate)}catch(a){Ze(i,i.return,a)}}n&64&&o1(i),n&512&&ns(i,i.return);break;case 3:if(is(e,i),n&64&&(e=i.updateQueue,e!==null)){if(t=null,i.child!==null)switch(i.child.tag){case 27:case 5:t=i.child.stateNode;break;case 1:t=i.child.stateNode}try{_w(e,t)}catch(a){Ze(i,i.return,a)}}break;case 27:t===null&&n&4&&u1(i);case 26:case 5:is(e,i),t===null&&n&4&&Om(i),n&512&&ns(i,i.return);break;case 12:is(e,i);break;case 31:is(e,i),n&4&&b1(e,i);break;case 13:is(e,i),n&4&&y1(e,i),n&64&&(e=i.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(i=hD.bind(null,i),WD(e,i))));break;case 22:if(n=i.memoizedState!==null||Yt,!n){var r=t!==null&&t.memoizedState!==null||$e;t=Yt,s=$e,Yt=n,($e=r)&&!s?(n=2,(i.subtreeFlags&8772)!==0&&(n|=1),zn(e,i,n)):is(e,i),Yt=t,$e=s}break;case 30:is(e,i),n&512&&ns(i,i.return);break;case 7:n&512&&ns(i,i.return);default:is(e,i)}}function Pm(e,t){for(e=e.child;e!==null;)g1(e,t),e=e.sibling}function g1(e,t){switch(e.tag){case 5:case 26:try{var i=e.stateNode;if(t){var n=i.style;typeof n.setProperty=="function"?n.setProperty("display","none","important"):n.display="none"}else{var s=e.stateNode,r=e.memoizedProps.style,a=r!=null&&r.hasOwnProperty("display")?r.display:null;s.style.display=a==null||typeof a=="boolean"?"":(""+a).trim()}}catch(l){Ze(e,e.return,l)}Um(e,t);break;case 6:try{e.stateNode.nodeValue=t?"":e.memoizedProps,Fe=!0}catch(l){Ze(e,e.return,l)}break;case 18:try{var o=e.stateNode;t?eS(o,!0):eS(e.stateNode,!1)}catch(l){Ze(e,e.return,l)}break;case 22:case 23:e.memoizedState===null&&Pm(e,t);break;default:Pm(e,t)}}function Um(e,t){if(e.subtreeFlags&67108864)for(e=e.child;e!==null;){e:{var i=e,n=t;switch(i.tag){case 4:g1(i,n);break e;case 22:i.memoizedState===null&&Um(i,n);break e;default:Um(i,n)}}e=e.sibling}}function _1(e){var t=e.alternate;t!==null&&(e.alternate=null,_1(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&sd(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var pt=null,Hi=!1;function In(e,t,i){for(i=i.child;i!==null;)v1(e,t,i),i=i.sibling}function v1(e,t,i){if(nn&&typeof nn.onCommitFiberUnmount=="function")try{nn.onCommitFiberUnmount(Tc,i)}catch{}switch(i.tag){case 26:$e||li(i,t),In(e,t,i),i.memoizedState?i.memoizedState.count--:i.stateNode&&!$e&&(i=i.stateNode,i.parentNode.removeChild(i));break;case 27:$e||li(i,t),ac(i);var n=pt,s=Hi;Br(i.type)&&(pt=i.stateNode,Hi=!1),In(e,t,i),rE(i.stateNode,i.type,i.memoizedProps),pt=n,Hi=s;break;case 5:$e||li(i,t),ac(i);case 6:if(i.tag===6&&ac(i),n=pt,s=Hi,pt=null,In(e,t,i),pt=n,Hi=s,pt!==null)if(Hi)try{(pt.nodeType===9?pt.body:pt.nodeName==="HTML"?pt.ownerDocument.body:pt).removeChild(i.stateNode),Fe=!0}catch(r){Ze(i,t,r)}else try{pt.removeChild(i.stateNode),Fe=!0}catch(r){Ze(i,t,r)}break;case 18:pt!==null&&(Hi?(e=pt,Jy(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,i.stateNode),Zo(e)):Jy(pt,i.stateNode));break;case 4:n=pt,s=Hi,pt=i.stateNode.containerInfo,Hi=!0,In(e,t,i),pt=n,Hi=s;break;case 0:case 11:case 14:case 15:Rr(2,i,t),$e||Rr(4,i,t),In(e,t,i);break;case 1:$e||(li(i,t),n=i.stateNode,typeof n.componentWillUnmount=="function"&&l1(i,t,n)),In(e,t,i);break;case 21:In(e,t,i);break;case 22:$e=(n=$e)||i.memoizedState!==null,In(e,t,i),$e=n;break;case 30:li(i,t),In(e,t,i);break;case 7:$e||li(i,t),In(e,t,i);break;default:In(e,t,i)}}function b1(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Zo(e)}catch(i){Ze(t,t.return,i)}}}function y1(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Zo(e)}catch(i){Ze(t,t.return,i)}}function eD(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new Py),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new Py),t;default:throw Error(B(435,e.tag))}}function nh(e,t){var i=eD(e);t.forEach(function(n){if(!i.has(n)){i.add(n);var s=dD.bind(null,e,n);n.then(s,s)}})}function Ai(e,t,i){var n=t.deletions;if(n!==null)for(var s=0;s<n.length;s++){var r=n[s],a=e,o=t,l=o;e:for(;l!==null;){switch(l.tag){case 27:if(Br(l.type)){pt=l.stateNode,Hi=!1;break e}break;case 5:pt=l.stateNode,Hi=!1;break e;case 3:case 4:pt=l.stateNode.containerInfo,Hi=!0;break e}l=l.return}if(pt===null)throw Error(B(160));v1(a,o,r),pt=null,Hi=!1,a=r.alternate,a!==null&&(a.return=null),r.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)S1(t,e,i),t=t.sibling}var Pn=null;function S1(e,t,i){var n=e.alternate,s=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(s&4&&(n=e.updateQueue,n=n!==null?n.events:null,n!==null))for(var r=0;r<n.length;r++){var a=n[r];a.ref.impl=a.nextImpl}Ai(t,e,i),Mi(e),s&4&&(Rr(3,e,e.return),Lc(3,e),Rr(5,e,e.return));break;case 1:Ai(t,e,i),Mi(e),s&512&&($e||n===null||li(n,n.return)),s&64&&Yt&&(e=e.updateQueue,e!==null&&(t=e.callbacks,t!==null&&(i=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=i===null?t:i.concat(t))));break;case 26:if(r=Pn,Ai(t,e,i),Mi(e),s&512&&($e||n===null||li(n,n.return)),s&4)if(s=n!==null?n.memoizedState:null,i=e.memoizedState,n===null)if(i===null)if(e.stateNode===null)if(Yt)e.stateNode=j1(e.type,e.memoizedProps,t.containerInfo,e);else{e:{t=e.type,i=e.memoizedProps,s=r.ownerDocument||r;t:switch(t){case"title":n=s.getElementsByTagName("title")[0],(!n||n[Mc]||n[ci]||n.namespaceURI==="http://www.w3.org/2000/svg"||n.hasAttribute("itemprop"))&&(n=s.createElement(t),s.head.insertBefore(n,s.querySelector("head > title"))),fi(n,t,i),n[ci]=e,Vt(n),t=n;break e;case"link":if(r=lS("link","href",s).get(t+(i.href||""))){for(a=0;a<r.length;a++)if(n=r[a],n.getAttribute("href")===(i.href==null||i.href===""?null:i.href)&&n.getAttribute("rel")===(i.rel==null?null:i.rel)&&n.getAttribute("title")===(i.title==null?null:i.title)&&n.getAttribute("crossorigin")===(i.crossOrigin==null?null:i.crossOrigin)){r.splice(a,1);break t}}n=s.createElement(t),fi(n,t,i),s.head.appendChild(n);break;case"meta":if(r=lS("meta","content",s).get(t+(i.content||""))){for(a=0;a<r.length;a++)if(n=r[a],n.getAttribute("content")===(i.content==null?null:""+i.content)&&n.getAttribute("name")===(i.name==null?null:i.name)&&n.getAttribute("property")===(i.property==null?null:i.property)&&n.getAttribute("http-equiv")===(i.httpEquiv==null?null:i.httpEquiv)&&n.getAttribute("charset")===(i.charSet==null?null:i.charSet)){r.splice(a,1);break t}}n=s.createElement(t),fi(n,t,i),s.head.appendChild(n);break;default:throw Error(B(468,t))}n[ci]=e,Vt(n),t=n}e.stateNode=t}else Yt||ig(r,e.type,e.stateNode);else e.stateNode=oS(r,i,e.memoizedProps);else s!==i?(s===null?(t=n.stateNode,t===null||$e||t.parentNode.removeChild(t)):s.count--,i===null?Yt||ig(r,e.type,e.stateNode):oS(r,i,e.memoizedProps)):i===null&&e.stateNode!==null&&zp(e,e.memoizedProps,n.memoizedProps);break;case 27:Ai(t,e,i),Mi(e),s&512&&($e||n===null||li(n,n.return)),n!==null&&s&4&&zp(e,e.memoizedProps,n.memoizedProps);break;case 5:if(r=es,es=!1,Ai(t,e,i),es=r,Mi(e),s&512&&($e||n===null||li(n,n.return)),e.flags&32){t=e.stateNode;try{Fo(t,""),Fe=!0}catch(u){Ze(e,e.return,u)}}s&4&&e.stateNode!=null&&(t=e.memoizedProps,zp(e,t,n!==null?n.memoizedProps:t)),s&1024&&(Up=!0);break;case 6:if(Ai(t,e,i),Mi(e),s&4){if(e.stateNode===null)throw Error(B(162));t=e.memoizedProps,i=e.stateNode;try{i.nodeValue=t,Fe=!0}catch(u){Ze(e,e.return,u)}}break;case 3:if(Fe=!1,xh=null,r=Pn,Pn=wc(t.containerInfo),Ai(t,e,i),Pn=r,Mi(e),s&4&&n!==null&&n.memoizedState.isDehydrated)try{Zo(t.containerInfo)}catch(u){Ze(e,e.return,u)}Up&&(Up=!1,w1(e)),Fe=!1;break;case 4:s=es,es=Yt,n=W0(),r=Pn,Pn=wc(e.stateNode.containerInfo),Ai(t,e,i),Mi(e),Pn=r,Fe&&Xl&&(jh=!0),Fe=n,es=s;break;case 12:Ai(t,e,i),Mi(e);break;case 31:Ai(t,e,i),Mi(e),s&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,nh(e,t)));break;case 13:Ai(t,e,i),Mi(e),e.child.flags&8192&&e.memoizedState!==null!=(n!==null&&n.memoizedState!==null)&&(_d=tn()),s&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,nh(e,t)));break;case 22:r=e.memoizedState!==null,a=n!==null&&n.memoizedState!==null;var o=Yt,l=$e,c=es;Yt=o||r,es=c||r,$e=l||a,Ai(t,e,i),$e=l,es=c,Yt=o,Mi(e),s&8192&&(t=e.stateNode,t._visibility=r?t._visibility&-2:t._visibility|1,!r||n===null||a||Yt||$e||(t=a||$e,i=Yt,n=$e,Yt=r||Yt,$e=t,cr(e,2),Yt=i,$e=n),!r&&es||Pm(e,r)),s&4&&(t=e.updateQueue,t!==null&&(i=t.retryQueue,i!==null&&(t.retryQueue=null,nh(e,i))));break;case 19:Ai(t,e,i),Mi(e),s&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,nh(e,t)));break;case 30:s&512&&($e||n===null||li(n,n.return)),s=W0(),r=Xl,a=(i&335544064)===i,o=e.memoizedProps,Xl=a&&qs(o.default,o.update)!=="none",Ai(t,e,i),Mi(e),a&&n!==null&&Fe&&(e.flags|=4),Xl=r,Fe=s;break;case 21:break;case 7:s&512&&($e||n===null||li(n,n.return)),n&&n.stateNode!==null&&(n.stateNode._fragmentFiber=e);default:Ai(t,e,i),Mi(e)}}function Mi(e){var t=e.flags;if(t&2){try{for(var i,n=e.return;n!==null;){if(c1(n)){i=n;break}n=n.return}n=null;for(var s=e.return;s!==null;){if(qg(s)){var r=s.stateNode;n===null?n=[r]:n.push(r)}if(Fg(s))break;s=s.return}var a=n;if(i==null)throw Error(B(160));switch(i.tag){case 27:var o=i.stateNode,l=Pp(e);$h(e,l,o,a);break;case 5:var c=i.stateNode;i.flags&32&&(Fo(c,""),i.flags&=-33);var u=Pp(e);$h(e,u,c,a);break;case 3:case 4:var h=i.stateNode.containerInfo,d=Pp(e);Rm(e,d,h,a);break;default:throw Error(B(161))}}catch(f){Ze(e,e.return,f)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function w1(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;w1(t),t.tag===5&&t.flags&1024&&(t=t.stateNode,Xo=!0,t.reset(),Xo=!1),e=e.sibling}}function fo(e,t){if(t.subtreeFlags&9270)for(t=t.child;t!==null;)E1(t,e),t=t.sibling;else p1(t,!1)}function E1(e,t){var i=e.alternate;if(i===null)Dm(e,!1);else switch(e.tag){case 3:if(zm=ts=!1,zy(),fo(t,e),!ts&&!jh){if(e=ss,e!==null)for(var n=0;n<e.length;n+=3){i=e[n];var s=e[n+1];X1(i,e[n+2]),i=i.ownerDocument.documentElement,i!==null&&i.animate({opacity:[0,0],pointerEvents:["none","none"]},{duration:0,fill:"forwards",pseudoElement:"::view-transition-group("+s+")"})}e=t.containerInfo,e=e.nodeType===9?e.documentElement:e.ownerDocument.documentElement,e!==null&&e.style.viewTransitionName===""&&(e.style.viewTransitionName="none",e.animate({opacity:[0,0],pointerEvents:["none","none"]},{duration:0,fill:"forwards",pseudoElement:"::view-transition-group(root)"}),e.animate({width:[0,0],height:[0,0]},{duration:0,fill:"forwards",pseudoElement:"::view-transition"})),zm=!0}ss=null;break;case 5:fo(t,e);break;case 4:n=ts,ts=!1,fo(t,e),ts&&(jh=!0),ts=n;break;case 22:e.memoizedState===null&&(i.memoizedState!==null?Dm(e,!1):fo(t,e));break;case 30:n=ts,s=zy(),ts=!1,fo(t,e),ts&&(e.flags|=4);var r=e.memoizedProps,a=e.stateNode;t=Is(r,a),a=Is(i.memoizedProps,a);var o=qs(r.default,r.update);o==="none"?t=!1:(r=i.memoizedState,i.memoizedState=null,i=e.child,qi=0,t=Kg(e,i,t,a,o,r,!0),qi!==(r===null?0:r.length)&&(e.flags|=32)),(e.flags&4)!==0&&t?(Wo(e,e.memoizedProps.onUpdate),ss=s):s!==null&&(s.push.apply(s,ss),ss=s),ts=(e.flags&32)!==0?!0:n;break;default:fo(t,e)}}function is(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)m1(e,t.alternate,t),t=t.sibling}function cr(e,t){for(e=e.child;e!==null;){var i=e,n=t;switch(i.tag){case 0:case 11:case 14:case 15:Rr(4,i,i.return),cr(i,n);break;case 1:li(i,i.return);var s=i.stateNode;typeof s.componentWillUnmount=="function"&&l1(i,i.return,s),cr(i,n);break;case 27:(n&2)!==0&&rE(i.stateNode,i.type,i.memoizedProps);case 5:li(i,i.return),i.tag!==5&&i.tag!==27||ac(i),cr(i,n);break;case 6:ac(i);break;case 26:li(i,i.return),s=i.stateNode,i.memoizedState!==null||s===null||$e||s.parentNode.removeChild(s),cr(i,n);break;case 22:i.memoizedState===null&&cr(i,n);break;case 30:li(i,i.return),cr(i,n);break;case 7:li(i,i.return);default:cr(i,n)}e=e.sibling}}function zn(e,t,i){for(i=(t.subtreeFlags&8772)!==0?i:i&-2,t=t.child;t!==null;){var n=t.alternate,s=e,r=t,a=r.flags,o=(i&1)!==0;switch(r.tag){case 0:case 11:case 15:zn(s,r,i),Lc(4,r);break;case 1:if(zn(s,r,i),n=r,s=n.stateNode,typeof s.componentDidMount=="function")try{s.componentDidMount()}catch(u){Ze(n,n.return,u)}if(n=r,s=n.updateQueue,s!==null){var l=n.stateNode;try{var c=s.shared.hiddenCallbacks;if(c!==null)for(s.shared.hiddenCallbacks=null,s=0;s<c.length;s++)gw(c[s],l)}catch(u){Ze(n,n.return,u)}}o&&a&64&&o1(r),ns(r,r.return);break;case 27:(i&2)!==0&&u1(r);case 5:r.tag!==5&&r.tag!==27||By(r),zn(s,r,i),o&&n===null&&a&4&&Om(r),ns(r,r.return);break;case 6:By(r);break;case 26:l=r.stateNode,r.memoizedState!==null||l===null||Yt||ig(wc(l.ownerDocument),r.type,l),zn(s,r,i),o&&n===null&&a&4&&Om(r),ns(r,r.return);break;case 12:zn(s,r,i);break;case 31:zn(s,r,i),o&&a&4&&b1(s,r);break;case 13:zn(s,r,i),o&&a&4&&y1(s,r);break;case 22:r.memoizedState===null&&zn(s,r,i),ns(r,r.return);break;case 30:zn(s,r,i),ns(r,r.return);break;case 7:ns(r,r.return);default:zn(s,r,i)}t=t.sibling}}function Wg(e,t){var i=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(i=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==i&&(e!=null&&e.refCount++,i!=null&&Rc(i))}function Gg(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Rc(e))}function _n(e,t,i,n){var s=(i&335544064)===i;if(t.subtreeFlags&(s?10262:10256))for(t=t.child;t!==null;)x1(e,t,i,n),t=t.sibling;else s&&f1(t)}function x1(e,t,i,n){var s=(i&335544064)===i;s&&t.alternate===null&&t.return!==null&&t.return.alternate!==null&&yh(t);var r=t.flags;switch(t.tag){case 0:case 11:case 15:_n(e,t,i,n),r&2048&&Lc(9,t);break;case 1:_n(e,t,i,n);break;case 3:_n(e,t,i,n),s&&zm&&(e=e.containerInfo,e=e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,e.style.viewTransitionName==="root"&&(e.style.viewTransitionName=""),e=e.ownerDocument.documentElement,e!==null&&e.style.viewTransitionName==="none"&&(e.style.viewTransitionName="")),r&2048&&(r=null,t.alternate!==null&&(r=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==r&&(t.refCount++,r!=null&&Rc(r)));break;case 12:if(r&2048){_n(e,t,i,n),r=t.stateNode;try{var a=t.memoizedProps,o=a.id,l=a.onPostCommit;typeof l=="function"&&l(o,t.alternate===null?"mount":"update",r.passiveEffectDuration,-0)}catch(c){Ze(t,t.return,c)}}else _n(e,t,i,n);break;case 31:_n(e,t,i,n);break;case 13:_n(e,t,i,n);break;case 23:break;case 22:a=t.stateNode,o=t.alternate,t.memoizedState!==null?(s&&o!==null&&o.memoizedState===null&&yh(o),a._visibility&2?_n(e,t,i,n):oc(e,t)):(s&&o!==null&&o.memoizedState!==null&&yh(t),a._visibility&2?_n(e,t,i,n):(a._visibility|=2,mo(e,t,i,n,(t.subtreeFlags&10256)!==0||!1))),r&2048&&Wg(o,t);break;case 24:_n(e,t,i,n),r&2048&&Gg(t.alternate,t);break;case 30:s&&(r=t.alternate,r!==null&&(hs(r.child,!0),hs(t.child,!0))),_n(e,t,i,n);break;default:_n(e,t,i,n)}}function mo(e,t,i,n,s){for(s=s&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var r=e,a=t,o=i,l=n,c=a.flags;switch(a.tag){case 0:case 11:case 15:mo(r,a,o,l,s),Lc(8,a);break;case 23:break;case 22:var u=a.stateNode;a.memoizedState!==null?u._visibility&2?mo(r,a,o,l,s):oc(r,a):(u._visibility|=2,mo(r,a,o,l,s)),s&&c&2048&&Wg(a.alternate,a);break;case 24:mo(r,a,o,l,s),s&&c&2048&&Gg(a.alternate,a);break;default:mo(r,a,o,l,s)}t=t.sibling}}function oc(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var i=e,n=t,s=n.flags;switch(n.tag){case 22:oc(i,n),s&2048&&Wg(n.alternate,n);break;case 24:oc(i,n),s&2048&&Gg(n.alternate,n);break;default:oc(i,n)}t=t.sibling}}var sa=8192;function ta(e,t,i){if(e.subtreeFlags&sa)for(e=e.child;e!==null;)C1(e,t,i),e=e.sibling}function C1(e,t,i){switch(e.tag){case 26:ta(e,t,i),e.flags&sa&&(e.memoizedState!==null?s2(i,Pn,e.memoizedState,e.memoizedProps):(e=e.stateNode,(t&335544128)===t&&uS(i,e)));break;case 5:ta(e,t,i),e.flags&sa&&(e=e.stateNode,(t&335544128)===t&&uS(i,e));break;case 3:case 4:var n=Pn;Pn=wc(e.stateNode.containerInfo),ta(e,t,i),Pn=n;break;case 22:e.memoizedState===null&&(n=e.alternate,n!==null&&n.memoizedState!==null?(n=sa,sa=16777216,ta(e,t,i),sa=n):ta(e,t,i));break;case 30:if((e.flags&sa)!==0&&(n=e.memoizedProps.name,n!=null&&n!=="auto")){var s=e.stateNode;s.paired=null,Ji===null&&(Ji=new Map),Ji.set(n,s)}ta(e,t,i);break;default:ta(e,t,i)}}function k1(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function Kl(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var i=0;i<t.length;i++){var n=t[i];jt=n,N1(n,e)}k1(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)T1(e),e=e.sibling}function T1(e){switch(e.tag){case 0:case 11:case 15:Kl(e),e.flags&2048&&Rr(9,e,e.return);break;case 3:Kl(e);break;case 12:Kl(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Sh(e)):Kl(e);break;default:Kl(e)}}function Sh(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var i=0;i<t.length;i++){var n=t[i];jt=n,N1(n,e)}k1(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Rr(8,t,t.return),Sh(t);break;case 22:i=t.stateNode,i._visibility&2&&(i._visibility&=-3,Sh(t));break;default:Sh(t)}e=e.sibling}}function N1(e,t){for(;jt!==null;){var i=jt;switch(i.tag){case 0:case 11:case 15:Rr(8,i,t);break;case 23:case 22:if(i.memoizedState!==null&&i.memoizedState.cachePool!==null){var n=i.memoizedState.cachePool.pool;n!=null&&n.refCount++}break;case 24:Rc(i.memoizedState.cache)}if(n=i.child,n!==null)n.return=i,jt=n;else e:for(i=e;jt!==null;){n=jt;var s=n.sibling,r=n.return;if(_1(n),n===i){jt=null;break e}if(s!==null){s.return=r,jt=s;break e}jt=r}}}var tD={getCacheForType:function(e){var t=ui(Rt),i=t.data.get(e);return i===void 0&&(i=e(),t.data.set(e,i)),i},cacheSignal:function(){return ui(Rt).controller.signal}},iD=typeof WeakMap=="function"?WeakMap:Map,qe=0,tt=null,De=null,ze=0,Ve=0,Xi=null,gr=!1,il=!1,$g=!1,Hs=0,St=0,Dr=0,ha=0,Vh=0,en=0,Ko=0,lc=null,Fi=null,Hm=!1,_d=0,A1=0,Xh=1/0,Zh=null,Cr=null,vt=0,Hn=null,ba=null,us=0,Fm=0,qm=null,M1=null,Io=null,zo=null,Po=null,cc=0,wh=null;function rn(){return(qe&2)!==0&&ze!==0?ze&-ze:ge.T!==null?jg():LS()}function O1(){if(en===0)if((ze&536870912)===0||ke){var e=Wu;Wu<<=1,(Wu&3932160)===0&&(Wu=262144),en=e}else en=536870912;return e=pi.current,e!==null&&(e.flags|=32),en}function Wo(e,t){if(t!=null){var i=e.stateNode,n=i.ref;n===null&&(n=i.ref=Q1(Is(e.memoizedProps,i))),zo===null&&(zo=[]),zo.push(t.bind(null,n))}}function Wi(e,t,i){(e===tt&&(Ve===2||Ve===9)||e.cancelPendingCommit!==null)&&(Go(e,0),_r(e,ze,en,!1)),Ac(e,i),((qe&2)===0||e!==tt)&&(e===tt&&((qe&2)===0&&(ha|=i),St===4&&_r(e,ze,en,!1)),fs(e))}function R1(e,t,i){if((qe&6)!==0)throw Error(B(327));var n=!i&&(t&127)===0&&(t&e.expiredLanes)===0||Nc(e,t),s=n?rD(e,t):Hp(e,t,!0),r=n;do{if(s===0){il&&!n&&_r(e,t,0,!1);break}else{if(i=e.current.alternate,r&&!nD(i)){s=Hp(e,t,!1),r=!1;continue}if(s===2){if(r=t,e.errorRecoveryDisabledLanes&r)var a=0;else a=e.pendingLanes&-536870913,a=a!==0?a:a&536870912?536870912:0;if(a!==0){t=a;e:{var o=e;s=lc;var l=o.current.memoizedState.isDehydrated;if(l&&(Go(o,a).flags|=256),a=Hp(o,a,!1),a!==2&&a!==6){if($g&&!l){o.errorRecoveryDisabledLanes|=r,ha|=r,s=4;break e}r=Fi,Fi=s,r!==null&&(Fi===null?Fi=r:Fi.push.apply(Fi,r))}s=a}if(r=!1,s!==2)continue}}if(s===1){Go(e,0),_r(e,t,0,!0);break}e:{switch(n=e,r=s,r){case 0:case 1:throw Error(B(345));case 4:if((t&4194048)!==t&&(t&62914560)!==t)break;case 6:_r(n,t,en,!gr);break e;case 2:Fi=null;break;case 3:case 5:break;default:throw Error(B(329))}if((t&62914560)===t&&(s=_d+300-tn(),10<s)){if(_r(n,t,en,!gr),nd(n,0,!0)!==0)break e;us=t,n.timeoutHandle=Xg(Uy.bind(null,n,i,Fi,Zh,Hm,t,en,ha,Ko,gr,r,"Throttled",-0,0),s);break e}Uy(n,i,Fi,Zh,Hm,t,en,ha,Ko,gr,r,null,-0,0)}}break}while(!0);fs(e)}function Uy(e,t,i,n,s,r,a,o,l,c,u,h,d,f){e.timeoutHandle=-1;var p=t.subtreeFlags,_=(r&335544064)===r;if(h=null,(_||p&8192||(p&16785408)===16785408)&&(h={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:as},Ji=null,C1(t,r,h),_&&(p=h,_=e.containerInfo,_=(_.nodeType===9?_:_.ownerDocument).__reactViewTransition,_!=null&&(p.count++,p.waitingForViewTransition=!0,p=Ec.bind(p),_.finished.then(p,p))),p=(r&62914560)===r?_d-tn():(r&4194048)===r?A1-tn():0,p=r2(h,p),p!==null)){us=r,e.cancelPendingCommit=p(Fy.bind(null,e,t,r,i,n,s,a,o,l,c,u,h,null,d,f)),_r(e,r,a,!c);return}Fy(e,t,r,i,n,s,a,o,l,c,u,h)}function nD(e){for(var t=e;;){var i=t.tag;if((i===0||i===11||i===15)&&t.flags&16384&&(i=t.updateQueue,i!==null&&(i=i.stores,i!==null)))for(var n=0;n<i.length;n++){var s=i[n],r=s.getSnapshot;s=s.value;try{if(!an(r(),s))return!1}catch{return!1}}if(i=t.child,t.subtreeFlags&16384&&i!==null)i.return=t,t=i;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 _r(e,t,i,n){t=AS(e,t),t&=~Vh,t&=~ha,e.suspendedLanes|=t,e.pingedLanes&=~t,n&&(e.warmLanes|=t),n=e.expirationTimes;for(var s=t;0<s;){var r=31-sn(s),a=1<<r;n[r]=-1,s&=~a}i!==0&&OS(e,i,t)}function vd(){return(qe&6)===0?(Bc(0,!1),!1):!0}function Yg(){if(De!==null){if(Ve===0)var e=De.return;else e=De,Rs=xa=null,Mg(e),Do=null,gc=0,e=De;for(;e!==null;)a1(e.alternate,e),e=e.return;De=null}}function Go(e,t){var i=e.timeoutHandle;return i!==-1&&(e.timeoutHandle=-1,CD(i)),i=e.cancelPendingCommit,i!==null&&(e.cancelPendingCommit=null,i()),us=0,Yg(),tt=e,De=i=Ds(e.current,null),ze=t,Ve=0,Xi=null,gr=!1,il=Nc(e,t),$g=!1,Ko=en=Vh=ha=Dr=St=0,Fi=lc=null,Hm=!1,Hs=AS(e,t),ld(),i}function D1(e,t){we=null,ge.H=Kh,t===el||t===hd?(t=dy(),Ve=3):t===wg?(t=dy(),Ve=4):Ve=t===Pg?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,Xi=t,De===null&&(St=1,Wh(e,wn(t,e.current)))}function L1(){var e=pi.current;return e===null?!0:(ze&4194048)===ze?Si===null:(ze&62914560)===ze||(ze&536870912)!==0?e===Si:!1}function B1(){var e=ge.H;return ge.H=Kh,e===null?Kh:e}function I1(){var e=ge.A;return ge.A=tD,e}function Qh(){St=4,gr||(ze&4194048)!==ze&&pi.current!==null||(il=!0),(Dr&134217727)===0&&(ha&134217727)===0||tt===null||_r(tt,ze,en,!1)}function Hp(e,t,i){var n=qe;qe|=2;var s=B1(),r=I1();(tt!==e||ze!==t)&&(Zh=null,Go(e,t)),t=!1;var a=St;e:do try{if(Ve!==0&&De!==null){var o=De,l=Xi;switch(Ve){case 8:Yg(),a=6;break e;case 3:case 2:case 9:case 6:pi.current===null&&(t=!0);var c=Ve;if(Ve=0,Xi=null,No(e,o,l,c),i&&il){a=0;break e}break;default:c=Ve,Ve=0,Xi=null,No(e,o,l,c)}}sD(),a=St;break}catch(u){D1(e,u)}while(!0);return t&&e.shellSuspendCounter++,Rs=xa=null,qe=n,ge.H=s,ge.A=r,De===null&&(tt=null,ze=0,ld()),a}function sD(){for(;De!==null;)z1(De)}function rD(e,t){var i=qe;qe|=2;var n=B1(),s=I1();tt!==e||ze!==t?(Zh=null,Xh=tn()+500,Go(e,t)):il=Nc(e,t);e:do try{if(Ve!==0&&De!==null){t=De;var r=Xi;t:switch(Ve){case 1:Ve=0,Xi=null,No(e,t,r,1);break;case 2:case 9:if(hy(r)){Ve=0,Xi=null,Hy(t);break}t=function(){Ve!==2&&Ve!==9||tt!==e||(Ve=7),fs(e)},r.then(t,t);break e;case 3:Ve=7;break e;case 4:Ve=5;break e;case 7:hy(r)?(Ve=0,Xi=null,Hy(t)):(Ve=0,Xi=null,No(e,t,r,7));break;case 5:var a=null;switch(De.tag){case 26:a=De.memoizedState;case 5:case 27:var o=De;if(a?lE(a):o.stateNode.complete){Ve=0,Xi=null;var l=o.sibling;if(l!==null)De=l;else{var c=o.return;c!==null?(De=c,bd(c)):De=null}break t}}Ve=0,Xi=null,No(e,t,r,5);break;case 6:Ve=0,Xi=null,No(e,t,r,6);break;case 8:Yg(),St=6;break e;default:throw Error(B(462))}}aD();break}catch(u){D1(e,u)}while(!0);return Rs=xa=null,ge.H=n,ge.A=s,qe=i,De!==null?0:(tt=null,ze=0,ld(),St)}function aD(){for(;De!==null&&!EO();)z1(De)}function z1(e){var t=r1(e.alternate,e,Hs);e.memoizedProps=e.pendingProps,t===null?bd(e):De=t}function Hy(e){var t=e,i=t.alternate;switch(t.tag){case 15:case 0:t=Ny(i,t,t.pendingProps,t.type,void 0,ze);break;case 11:t=Ny(i,t,t.pendingProps,t.type.render,t.ref,ze);break;case 5:Mg(t);var n=t;n===Xt&&(ke?(Ih(n),n.tag===5&&n.stateNode!=null&&(at=n.stateNode)):(Ih(n),ke=!0));default:a1(i,t),t=De=ow(t,Hs),t=r1(i,t,Hs)}e.memoizedProps=e.pendingProps,t===null?bd(e):De=t}function No(e,t,i,n){Rs=xa=null,Mg(t),Do=null,gc=0;var s=t.return;try{if(YR(e,s,t,i,ze)){St=1,Wh(e,wn(i,e.current)),De=null;return}}catch(r){if(s!==null)throw De=s,r;St=1,Wh(e,wn(i,e.current)),De=null;return}t.flags&32768?(ke||n===1?e=!0:il||(ze&536870912)!==0?e=!1:(gr=e=!0,(n===2||n===9||n===3||n===6)&&(n=pi.current,n!==null&&n.tag===13&&(n.flags|=16384))),P1(t,e)):bd(t)}function bd(e){var t=e;do{if((t.flags&32768)!==0){P1(t,gr);return}e=t.return;var i=ZR(t.alternate,t,Hs);if(i!==null){De=i;return}if(t=t.sibling,t!==null){De=t;return}De=t=e}while(t!==null);St===0&&(St=5)}function P1(e,t){do{var i=QR(e.alternate,e);if(i!==null){i.flags&=32767,De=i;return}if(i=e.return,i!==null&&(i.flags|=32768,i.subtreeFlags=0,i.deletions=null),!t&&(e=e.sibling,e!==null)){De=e;return}De=e=i}while(e!==null);St=6,De=null}function Fy(e,t,i,n,s,r,a,o,l,c,u,h){e.cancelPendingCommit=null;do yd();while(vt!==0);if((qe&6)!==0)throw Error(B(327));if(t!==null){if(t===e.current)throw Error(B(177));e===tt&&(De=tt=null,ze=0),ba=t,Hn=e,us=i,qm=s,M1=n,oD(e,t,i,a,o,l,h)}}function oD(e,t,i,n,s,r,a){var o=t.lanes|t.childLanes;if(Fm=o,o|=gg,DO(e,i,o,n,s,r),zo=null,(i&335544064)===i?(Po=BR(e),n=10262):(Po=null,n=10256),(t.subtreeFlags&n)!==0||(t.flags&n)!==0?(e.callbackNode=null,e.callbackPriority=0,fD(Oh,function(){return $m(),null})):(e.callbackNode=null,e.callbackPriority=0),Yh=!1,n=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||n){n=ge.T,ge.T=null,s=Ke.p,Ke.p=2,r=qe,qe|=4;try{JR(e,t,i)}finally{qe=r,Ke.p=s,ge.T=n}}vt=1,Yh?Io=OD(a,e.containerInfo,Po,Km,Wm,cD,Gm,$m,lD,null,null):(Km(),Wm(),Gm())}function lD(e){if(vt!==0){var t=Hn.onRecoverableError;t(e,{componentStack:null})}}function cD(){vt===3&&(vt=0,E1(ba,Hn),vt=4)}function Km(){if(vt===1){vt=0;var e=Hn,t=ba,i=us,n=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||n){n=ge.T,ge.T=null;var s=Ke.p;Ke.p=2;var r=qe;qe|=4;try{Xl=jh=!1,S1(t,e,i),i=Xm;var a=JS(e.containerInfo),o=i.focusedElem,l=i.selectionRange;if(a!==o&&o&&o.ownerDocument&&QS(o.ownerDocument.documentElement,o)){if(l!==null&&mg(o)){var c=l.start,u=l.end;if(u===void 0&&(u=c),"selectionStart"in o)o.selectionStart=c,o.selectionEnd=Math.min(u,o.value.length);else{var h=o.ownerDocument||document,d=h&&h.defaultView||window;if(d.getSelection){var f=d.getSelection(),p=o.textContent.length,_=Math.min(l.start,p),v=l.end===void 0?_:Math.min(l.end,p);!f.extend&&_>v&&(a=v,v=_,_=a);var g=ny(o,_),m=ny(o,v);if(g&&m&&(f.rangeCount!==1||f.anchorNode!==g.node||f.anchorOffset!==g.offset||f.focusNode!==m.node||f.focusOffset!==m.offset)){var b=h.createRange();b.setStart(g.node,g.offset),f.removeAllRanges(),_>v?(f.addRange(b),f.extend(m.node,m.offset)):(b.setEnd(m.node,m.offset),f.addRange(b))}}}}for(h=[],f=o;f=f.parentNode;)f.nodeType===1&&h.push({element:f,left:f.scrollLeft,top:f.scrollTop});for(typeof o.focus=="function"&&o.focus(),o=0;o<h.length;o++){var S=h[o];S.element.scrollLeft=S.left,S.element.scrollTop=S.top}}Xo=!!Vm,Xm=Vm=null}finally{qe=r,Ke.p=s,ge.T=n}}e.current=t,vt=2}}function Wm(){if(vt===2){vt=0;var e=Hn,t=ba,i=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||i){i=ge.T,ge.T=null;var n=Ke.p;Ke.p=2;var s=qe;qe|=4;try{m1(e,t.alternate,t)}finally{qe=s,Ke.p=n,ge.T=i}}vt=3}}function Gm(){if(vt===4||vt===3){vt=0;var e=Io;Io=null,xO();var t=Hn,i=ba,n=us,s=M1,r=(n&335544064)===n?10262:10256;if((i.subtreeFlags&r)!==0||(i.flags&r)!==0?vt=5:(vt=0,ba=Hn=null,U1(t,t.pendingLanes)),r=t.pendingLanes,r===0&&(Cr=null),cg(n),i=i.stateNode,nn&&typeof nn.onCommitFiberRoot=="function")try{nn.onCommitFiberRoot(Tc,i,void 0,(i.current.flags&128)===128)}catch{}if(s!==null){i=ge.T,r=Ke.p,Ke.p=2,ge.T=null;try{for(var a=t.onRecoverableError,o=0;o<s.length;o++){var l=s[o];a(l.value,{componentStack:l.stack})}}finally{ge.T=i,Ke.p=r}}if(s=zo,a=Po,Po=null,s!==null&&(zo=null,a===null&&(a=[]),e!==null))for(l=0;l<s.length;l++)i=(0,s[l])(a),i!==void 0&&e.finished.finally(i);(us&3)!==0&&yd(),fs(t),r=t.pendingLanes,(n&261930)!==0&&(r&42)!==0?t===wh?cc++:(cc=0,wh=t):(cc=0,wh=null),Bc(0,!1)}}function U1(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,Rc(t)))}function yd(){return Io!==null&&(Io.skipTransition(),Io=null),Km(),Wm(),Gm(),$m()}function $m(){if(vt!==5)return!1;var e=Hn,t=Fm;Fm=0;var i=cg(us),n=ge.T,s=Ke.p;try{Ke.p=32>i?32:i,ge.T=null,i=qm,qm=null;var r=Hn,a=us;if(vt=0,ba=Hn=null,us=0,(qe&6)!==0)throw Error(B(331));var o=qe;if(qe|=4,T1(r.current),x1(r,r.current,a,i),qe=o,Bc(0,!1),nn&&typeof nn.onPostCommitFiberRoot=="function")try{nn.onPostCommitFiberRoot(Tc,r)}catch{}return!0}finally{Ke.p=s,ge.T=n,U1(e,t)}}function qy(e,t,i){t=wn(i,t),t=Cm(e.stateNode,t,2),e=wr(e,t,2),e!==null&&(Ac(e,2),fs(e))}function Ze(e,t,i){if(e.tag===3)qy(e,e,i);else for(;t!==null;){if(t.tag===3){qy(t,e,i);break}else if(t.tag===1){var n=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof n.componentDidCatch=="function"&&(Cr===null||!Cr.has(n))){e=wn(i,e),i=e1(2),n=wr(t,i,2),n!==null&&(t1(i,n,t,e),Ac(n,2),fs(n));break}}t=t.return}}function Fp(e,t,i){var n=e.pingCache;if(n===null){n=e.pingCache=new iD;var s=new Set;n.set(t,s)}else s=n.get(t),s===void 0&&(s=new Set,n.set(t,s));s.has(i)||($g=!0,s.add(i),e=uD.bind(null,e,t,i),t.then(e,e))}function uD(e,t,i){var n=e.pingCache;n!==null&&n.delete(t),e.pingedLanes|=e.suspendedLanes&i,e.warmLanes&=~i,tt===e&&(ze&i)===i&&((St===4||St===3&&(ze&62914560)===ze&&300>tn()-_d)&&(qe&2)===0?Go(e,0):Vh|=i,Ko===ze&&(Ko=0)),fs(e)}function H1(e,t){t===0&&(t=MS()),e=Ea(e,t),e!==null&&(Ac(e,t),fs(e))}function hD(e){var t=e.memoizedState,i=0;t!==null&&(i=t.retryLane),H1(e,i)}function dD(e,t){var i=0;switch(e.tag){case 31:case 13:var n=e.stateNode,s=e.memoizedState;s!==null&&(i=s.retryLane);break;case 19:n=e.stateNode;break;case 22:n=e.stateNode._retryCache;break;default:throw Error(B(314))}n!==null&&n.delete(t),H1(e,i)}function fD(e,t){return og(e,t)}var $o=null,go=null,Ym=!1,Jh=!1,qp=!1,vr=0;function fs(e){e!==go&&e.next===null&&(go===null?$o=go=e:go=go.next=e),Jh=!0,Ym||(Ym=!0,mD())}function Bc(e,t){if(!qp&&Jh){qp=!0;do for(var i=!1,n=$o;n!==null;){if(!t)if(e!==0){var s=n.pendingLanes;if(s===0)var r=0;else{var a=n.suspendedLanes,o=n.pingedLanes;r=(1<<31-sn(42|e)+1)-1,r&=s&~(a&~o),r=r&201326741?r&201326741|1:r?r|2:0}r!==0&&(i=!0,Ky(n,r))}else r=ze,r=nd(n,n===tt?r:0,n.cancelPendingCommit!==null||n.timeoutHandle!==-1),(r&3)===0||Nc(n,r)||(i=!0,Ky(n,r));n=n.next}while(i);qp=!1}}function pD(){F1()}function F1(){Jh=Ym=!1;var e=0;vr!==0&&xD()&&(e=vr);for(var t=tn(),i=null,n=$o;n!==null;){var s=n.next,r=q1(n,t);r===0?(n.next=null,i===null?$o=s:i.next=s,s===null&&(go=i)):(i=n,(e!==0||(r&3)!==0)&&(Jh=!0)),n=s}vt!==0&&vt!==5||Bc(e,!1),vr!==0&&(vr=0)}function q1(e,t){for(var i=e.suspendedLanes,n=e.pingedLanes,s=e.expirationTimes,r=e.pendingLanes&-62914561;0<r;){var a=31-sn(r),o=1<<a,l=s[a];l===-1?((o&i)===0||(o&n)!==0)&&(s[a]=RO(o,t)):l<=t&&(e.expiredLanes|=o),r&=~o}if(t=tt,i=ze,i=nd(e,e===t?i:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),n=e.callbackNode,i===0||e===t&&(Ve===2||Ve===9)||e.cancelPendingCommit!==null)return n!==null&&n!==null&&yp(n),e.callbackNode=null,e.callbackPriority=0;if((i&3)===0||Nc(e,i)){if(t=i&-i,t===e.callbackPriority)return t;switch(n!==null&&yp(n),cg(i)){case 2:case 8:i=TS;break;case 32:i=Oh;break;case 268435456:i=NS;break;default:i=Oh}return n=K1.bind(null,e),i=og(i,n),e.callbackPriority=t,e.callbackNode=i,t}return n!==null&&n!==null&&yp(n),e.callbackPriority=2,e.callbackNode=null,2}function K1(e,t){if(vt!==0&&vt!==5)return e.callbackNode=null,e.callbackPriority=0,null;var i=e.callbackNode;if(yd()&&e.callbackNode!==i)return null;var n=ze;return n=nd(e,e===tt?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),n===0?null:(R1(e,n,t),q1(e,tn()),e.callbackNode!=null&&e.callbackNode===i?K1.bind(null,e):null)}function Ky(e,t){if(yd())return null;R1(e,t,!0)}function mD(){kD(function(){(qe&6)!==0?og(kS,pD):F1()})}function jg(){if(vr===0){var e=ma;e===0&&(e=Ku,Ku<<=1,(Ku&261888)===0&&(Ku=256)),vr=e}return vr}function Wy(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:uh(e)}function gD(e,t,i,n,s){if(t==="submit"&&i&&i.stateNode===s){var r=Wy((s[$i]||null).action),a=n.submitter;a&&(t=(t=a[$i]||null)?Wy(t.formAction):a.getAttribute("formAction"),t!==null&&(r=t,a=null));var o=new rd("action","action",null,n,s);e.push({event:o,listeners:[{instance:null,listener:function(){if(n.defaultPrevented){if(vr!==0){var l=new FormData(s,a);Em(i,{pending:!0,data:l,method:s.method,action:r},null,l)}}else typeof r=="function"&&(o.preventDefault(),l=new FormData(s,a),Em(i,{pending:!0,data:l,method:s.method,action:r},r,l))},currentTarget:s}]})}}for(sh=0;sh<dm.length;sh++)rh=dm[sh],Gy=rh.toLowerCase(),$y=rh[0].toUpperCase()+rh.slice(1),Fn(Gy,"on"+$y);var rh,Gy,$y,sh;Fn(tw,"onAnimationEnd");Fn(iw,"onAnimationIteration");Fn(nw,"onAnimationStart");Fn("dblclick","onDoubleClick");Fn("focusin","onFocus");Fn("focusout","onBlur");Fn(TR,"onTransitionRun");Fn(NR,"onTransitionStart");Fn(AR,"onTransitionCancel");Fn(sw,"onTransitionEnd");Ho("onMouseEnter",["mouseout","mouseover"]);Ho("onMouseLeave",["mouseout","mouseover"]);Ho("onPointerEnter",["pointerout","pointerover"]);Ho("onPointerLeave",["pointerout","pointerover"]);Sa("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));Sa("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));Sa("onBeforeInput",["compositionend","keypress","textInput","paste"]);Sa("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));Sa("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));Sa("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var bc="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(" "),_D=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(bc));function W1(e,t){t=(t&4)!==0;for(var i=0;i<e.length;i++){var n=e[i],s=n.event;n=n.listeners;e:{var r=void 0;if(t)for(var a=n.length-1;0<=a;a--){var o=n[a],l=o.instance,c=o.currentTarget;if(o=o.listener,l!==r&&s.isPropagationStopped())break e;r=o,s.currentTarget=c;try{r(s)}catch(u){Dh(u)}s.currentTarget=null,r=l}else for(a=0;a<n.length;a++){if(o=n[a],l=o.instance,c=o.currentTarget,o=o.listener,l!==r&&s.isPropagationStopped())break e;r=o,s.currentTarget=c;try{r(s)}catch(u){Dh(u)}s.currentTarget=null,r=l}}}}function Re(e,t){var i=t[H0];i===void 0&&(i=t[H0]=new Set);var n=e+"__bubble";i.has(n)||(G1(t,e,2,!1),i.add(n))}function Kp(e,t,i){var n=0;t&&(n|=4),G1(i,e,n,t)}var ah="_reactListening"+Math.random().toString(36).slice(2);function Vg(e){if(!e[ah]){e[ah]=!0,IS.forEach(function(i){i!=="selectionchange"&&(_D.has(i)||Kp(i,!1,e),Kp(i,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[ah]||(t[ah]=!0,Kp("selectionchange",!1,t))}}function G1(e,t,i,n){switch(mE(t)){case 2:var s=c2;break;case 8:s=u2;break;default:s=i_}i=s.bind(null,t,i,e),s=void 0,!lm||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(s=!0),n?s!==void 0?e.addEventListener(t,i,{capture:!0,passive:s}):e.addEventListener(t,i,!0):s!==void 0?e.addEventListener(t,i,{passive:s}):e.addEventListener(t,i,!1)}function Wp(e,t,i,n,s){var r=n;if((t&1)===0&&(t&2)===0&&n!==null)e:for(;;){if(n===null)return;var a=n.tag;if(a===3||a===4){var o=n.stateNode.containerInfo;if(o===s)break;if(a===4)for(a=n.return;a!==null;){var l=a.tag;if((l===3||l===4)&&a.stateNode.containerInfo===s)return;a=a.return}for(;o!==null;){if(a=ra(o),a===null)return;if(l=a.tag,l===5||l===6||l===26||l===27){n=r=a;continue e}o=o.parentNode}}n=n.return}WS(function(){var c=r,u=hg(i),h=[];e:{var d=rw.get(e);if(d!==void 0){var f=rd,p=e;switch(e){case"keypress":if(dh(i)===0)break e;case"keydown":case"keyup":f=nR;break;case"focusin":p="focus",f=kp;break;case"focusout":p="blur",f=kp;break;case"beforeblur":case"afterblur":f=kp;break;case"click":if(i.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":f=j0;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":f=GO;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":f=lR;break;case tw:case iw:case nw:f=jO;break;case sw:f=uR;break;case"scroll":case"scrollend":f=KO;break;case"wheel":f=dR;break;case"copy":case"cut":case"paste":f=XO;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":f=X0;break;case"submit":f=aR;break;case"toggle":case"beforetoggle":f=pR}var _=(t&4)!==0,v=!_&&(e==="scroll"||e==="scrollend"),g=_?d!==null?d+"Capture":null:d;_=[];for(var m=c,b;m!==null;){var S=m;if(b=S.stateNode,S=S.tag,S!==5&&S!==26&&S!==27||b===null||g===null||(S=hc(m,g),S!=null&&_.push(yc(m,S,b))),v)break;m=m.return}0<_.length&&(d=new f(d,p,null,i,u),h.push({event:d,listeners:_}))}}if((t&7)===0){e:{if(f=e==="mouseover"||e==="pointerover",d=e==="mouseout"||e==="pointerout",f&&i!==om&&(p=i.relatedTarget||i.fromElement)&&(ra(p)||p[Qo]))break e;(d||f)&&(p=u.window===u?u:(f=u.ownerDocument)?f.defaultView||f.parentWindow:window,d?(f=i.relatedTarget||i.toElement,d=c,f=f?ra(f):null,f!==null&&(v=kc(f),_=f.tag,f!==v||_!==5&&_!==27&&_!==6)&&(f=null)):(d=null,f=c),d!==f&&(_=j0,S="onMouseLeave",g="onMouseEnter",m="mouse",(e==="pointerout"||e==="pointerover")&&(_=X0,S="onPointerLeave",g="onPointerEnter",m="pointer"),v=d==null?p:jl(d),b=f==null?p:jl(f),p=new _(S,m+"leave",d,i,u),p.target=v,p.relatedTarget=b,S=null,ra(u)===c&&(_=new _(g,m+"enter",f,i,u),_.target=b,_.relatedTarget=v,S=_),v=S,_=d&&f?Vp(d,f,vD):null,d!==null&&Yy(h,p,d,_,!1),f!==null&&v!==null&&Yy(h,v,f,_,!0)))}e:{if(d=c?jl(c):window,f=d.nodeName&&d.nodeName.toLowerCase(),f==="select"||f==="input"&&d.type==="file")var x=ey;else if(J0(d))if(XS)x=xR;else{x=wR;var C=SR}else f=d.nodeName,!f||f.toLowerCase()!=="input"||d.type!=="checkbox"&&d.type!=="radio"?c&&ug(c.elementType)&&(x=ey):x=ER;if(x&&(x=x(e,c))){VS(h,x,i,u);break e}C&&C(e,d,c)}switch(C=c?jl(c):window,e){case"focusin":(J0(C)||C.contentEditable==="true")&&(wo=C,um=c,Jl=null);break;case"focusout":Jl=um=wo=null;break;case"mousedown":hm=!0;break;case"contextmenu":case"mouseup":case"dragend":hm=!1,sy(h,i,u);break;case"selectionchange":if(kR)break;case"keydown":case"keyup":sy(h,i,u)}var N;if(pg)e:{switch(e){case"compositionstart":var M="onCompositionStart";break e;case"compositionend":M="onCompositionEnd";break e;case"compositionupdate":M="onCompositionUpdate";break e}M=void 0}else So?YS(e,i)&&(M="onCompositionEnd"):e==="keydown"&&i.keyCode===229&&(M="onCompositionStart");M&&($S&&i.locale!=="ko"&&(So||M!=="onCompositionStart"?M==="onCompositionEnd"&&So&&(N=GS()):(pr=u,dg="value"in pr?pr.value:pr.textContent,So=!0)),C=ed(c,M),0<C.length&&(M=new V0(M,e,null,i,u),h.push({event:M,listeners:C}),N?M.data=N:(N=jS(i),N!==null&&(M.data=N)))),(N=gR?_R(e,i):vR(e,i))&&(M=ed(c,"onBeforeInput"),0<M.length&&(C=new V0("onBeforeInput","beforeinput",null,i,u),h.push({event:C,listeners:M}),C.data=N)),gD(h,e,c,i,u)}W1(h,t)})}function yc(e,t,i){return{instance:e,listener:t,currentTarget:i}}function ed(e,t){for(var i=t+"Capture",n=[];e!==null;){var s=e,r=s.stateNode;if(s=s.tag,s!==5&&s!==26&&s!==27||r===null||(s=hc(e,i),s!=null&&n.unshift(yc(e,s,r)),s=hc(e,t),s!=null&&n.push(yc(e,s,r))),e.tag===3)return n;e=e.return}return[]}function vD(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Yy(e,t,i,n,s){for(var r=t._reactName,a=[];i!==null&&i!==n;){var o=i,l=o.alternate,c=o.stateNode;if(o=o.tag,l!==null&&l===n)break;o!==5&&o!==26&&o!==27||c===null||(l=c,s?(c=hc(i,r),c!=null&&a.unshift(yc(i,c,l))):s||(c=hc(i,r),c!=null&&a.push(yc(i,c,l)))),i=i.return}a.length!==0&&e.push({event:t,listeners:a})}var bD=/\r\n?/g,yD=/\u0000|\uFFFD/g;function jy(e){return(typeof e=="string"?e:""+e).replace(bD,`
9
+ `).replace(yD,"")}function $1(e,t){return t=jy(t),jy(e)===t}function Xe(e,t,i,n,s,r){switch(i){case"children":if(typeof n=="string")t==="body"||t==="textarea"&&n===""||Fo(e,n);else if(typeof n=="number"||typeof n=="bigint")t!=="body"&&Fo(e,""+n);else return;break;case"className":$u(e,"class",n);break;case"tabIndex":$u(e,"tabindex",n);break;case"dir":case"role":case"viewBox":case"width":case"height":$u(e,i,n);break;case"style":KS(e,n,r);return;case"data":if(t!=="object"){$u(e,"data",n);break}case"src":case"href":if(n===""&&(t!=="a"||i!=="href")){e.removeAttribute(i);break}if(n==null||typeof n=="function"||typeof n=="symbol"||typeof n=="boolean"){e.removeAttribute(i);break}n=uh(n),e.setAttribute(i,n);break;case"action":case"formAction":if(typeof n=="function"){e.setAttribute(i,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof r=="function"&&(i==="formAction"?(t!=="input"&&Xe(e,t,"name",s.name,s,null),Xe(e,t,"formEncType",s.formEncType,s,null),Xe(e,t,"formMethod",s.formMethod,s,null),Xe(e,t,"formTarget",s.formTarget,s,null)):(Xe(e,t,"encType",s.encType,s,null),Xe(e,t,"method",s.method,s,null),Xe(e,t,"target",s.target,s,null)));if(n==null||typeof n=="symbol"||typeof n=="boolean"){e.removeAttribute(i);break}n=uh(n),e.setAttribute(i,n);break;case"onClick":n!=null&&(e.onclick=as);return;case"onScroll":n!=null&&Re("scroll",e);return;case"onScrollEnd":n!=null&&Re("scrollend",e);return;case"dangerouslySetInnerHTML":if(n!=null){if(typeof n!="object"||!("__html"in n))throw Error(B(61));if(i=n.__html,i!=null){if(s.children!=null)throw Error(B(60));r?.__html!==i&&(e.innerHTML=i)}}break;case"multiple":e.multiple=n&&typeof n!="function"&&typeof n!="symbol";break;case"muted":e.muted=n&&typeof n!="function"&&typeof n!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(n==null||typeof n=="function"||typeof n=="boolean"||typeof n=="symbol"){e.removeAttribute("xlink:href");break}i=uh(n),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",i);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":n!=null&&typeof n!="function"&&typeof n!="symbol"?e.setAttribute(i,n):e.removeAttribute(i);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"credentialless":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":n&&typeof n!="function"&&typeof n!="symbol"?e.setAttribute(i,""):e.removeAttribute(i);break;case"capture":case"download":n===!0?e.setAttribute(i,""):n!==!1&&n!=null&&typeof n!="function"&&typeof n!="symbol"?e.setAttribute(i,n):e.removeAttribute(i);break;case"cols":case"rows":case"size":case"span":n!=null&&typeof n!="function"&&typeof n!="symbol"&&!isNaN(n)&&1<=n?e.setAttribute(i,n):e.removeAttribute(i);break;case"rowSpan":case"start":n==null||typeof n=="function"||typeof n=="symbol"||isNaN(n)?e.removeAttribute(i):e.setAttribute(i,n);break;case"popover":Re("beforetoggle",e),Re("toggle",e),ch(e,"popover",n);break;case"xlinkActuate":As(e,"http://www.w3.org/1999/xlink","xlink:actuate",n);break;case"xlinkArcrole":As(e,"http://www.w3.org/1999/xlink","xlink:arcrole",n);break;case"xlinkRole":As(e,"http://www.w3.org/1999/xlink","xlink:role",n);break;case"xlinkShow":As(e,"http://www.w3.org/1999/xlink","xlink:show",n);break;case"xlinkTitle":As(e,"http://www.w3.org/1999/xlink","xlink:title",n);break;case"xlinkType":As(e,"http://www.w3.org/1999/xlink","xlink:type",n);break;case"xmlBase":As(e,"http://www.w3.org/XML/1998/namespace","xml:base",n);break;case"xmlLang":As(e,"http://www.w3.org/XML/1998/namespace","xml:lang",n);break;case"xmlSpace":As(e,"http://www.w3.org/XML/1998/namespace","xml:space",n);break;case"is":ch(e,"is",n);break;case"innerText":case"textContent":return;default:if(!(2<i.length)||i[0]!=="o"&&i[0]!=="O"||i[1]!=="n"&&i[1]!=="N")i=FO.get(i)||i,ch(e,i,n);else return}Fe=!0}function jm(e,t,i,n,s,r){switch(i){case"style":KS(e,n,r);return;case"dangerouslySetInnerHTML":if(n!=null){if(typeof n!="object"||!("__html"in n))throw Error(B(61));if(i=n.__html,i!=null){if(s.children!=null)throw Error(B(60));r?.__html!==i&&(e.innerHTML=i)}}break;case"children":if(typeof n=="string")Fo(e,n);else if(typeof n=="number"||typeof n=="bigint")Fo(e,""+n);else return;break;case"onScroll":n!=null&&Re("scroll",e);return;case"onScrollEnd":n!=null&&Re("scrollend",e);return;case"onClick":n!=null&&(e.onclick=as);return;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":return;case"innerText":case"textContent":return;default:if(!zS.hasOwnProperty(i))e:{if(i[0]==="o"&&i[1]==="n"&&(s=i.endsWith("Capture"),r=i.slice(2,s?i.length-7:void 0),t=e[$i]||null,t=t!=null?t[i]:null,typeof t=="function"&&e.removeEventListener(r,t,s),typeof n=="function")){typeof t!="function"&&t!==null&&(i in e?e[i]=null:e.hasAttribute(i)&&e.removeAttribute(i)),e.addEventListener(r,n,s);break e}Fe=!0,i in e?e[i]=n:n===!0?e.setAttribute(i,""):ch(e,i,n)}return}Fe=!0}function fi(e,t,i){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Re("error",e),Re("load",e);var n=!1,s=!1,r;for(r in i)if(i.hasOwnProperty(r)){var a=i[r];if(a!=null)switch(r){case"src":n=!0;break;case"srcSet":s=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(B(137,t));default:Xe(e,t,r,a,i,null)}}s&&Xe(e,t,"srcSet",i.srcSet,i,null),n&&Xe(e,t,"src",i.src,i,null);return;case"input":Re("invalid",e);var o=r=a=s=null,l=null,c=null;for(n in i)if(i.hasOwnProperty(n)){var u=i[n];if(u!=null)switch(n){case"name":s=u;break;case"type":a=u;break;case"checked":l=u;break;case"defaultChecked":c=u;break;case"value":r=u;break;case"defaultValue":o=u;break;case"children":case"dangerouslySetInnerHTML":if(u!=null)throw Error(B(137,t));break;default:Xe(e,t,n,u,i,null)}}HS(e,r,o,l,c,a,s,!1);return;case"select":Re("invalid",e),n=a=r=null;for(s in i)if(i.hasOwnProperty(s)&&(o=i[s],o!=null))switch(s){case"value":r=o;break;case"defaultValue":a=o;break;case"multiple":n=o;default:Xe(e,t,s,o,i,null)}t=r,i=a,e.multiple=!!n,t!=null?Mo(e,!!n,t,!1):i!=null&&Mo(e,!!n,i,!0);return;case"textarea":Re("invalid",e),r=s=n=null;for(a in i)if(i.hasOwnProperty(a)&&(o=i[a],o!=null))switch(a){case"value":n=o;break;case"defaultValue":s=o;break;case"children":r=o;break;case"dangerouslySetInnerHTML":if(o!=null)throw Error(B(91));break;default:Xe(e,t,a,o,i,null)}qS(e,n,s,r);return;case"option":for(l in i)i.hasOwnProperty(l)&&(n=i[l],n!=null)&&(l==="selected"?e.selected=n&&typeof n!="function"&&typeof n!="symbol":Xe(e,t,l,n,i,null));return;case"dialog":Re("beforetoggle",e),Re("toggle",e),Re("cancel",e),Re("close",e);break;case"iframe":case"object":Re("load",e);break;case"video":case"audio":for(n=0;n<bc.length;n++)Re(bc[n],e);break;case"image":Re("error",e),Re("load",e);break;case"details":Re("toggle",e);break;case"embed":case"source":case"link":Re("error",e),Re("load",e);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(c in i)if(i.hasOwnProperty(c)&&(n=i[c],n!=null))switch(c){case"children":case"dangerouslySetInnerHTML":throw Error(B(137,t));default:Xe(e,t,c,n,i,null)}return;default:if(ug(t)){for(u in i)i.hasOwnProperty(u)&&(n=i[u],n!==void 0&&jm(e,t,u,n,i,void 0));return}}for(o in i)i.hasOwnProperty(o)&&(n=i[o],n!=null&&Xe(e,t,o,n,i,null))}var SD={};function wD(e,t,i,n){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var s=null,r=null,a=null,o=null,l=null,c=null,u=null;for(f in i){var h=i[f];if(i.hasOwnProperty(f)&&h!=null)switch(f){case"checked":break;case"value":break;case"defaultValue":l=h;default:n.hasOwnProperty(f)||Xe(e,t,f,null,n,h)}}for(var d in n){var f=n[d];if(h=i[d],n.hasOwnProperty(d)&&(f!=null||h!=null))switch(d){case"type":f!==h&&(Fe=!0),r=f;break;case"name":f!==h&&(Fe=!0),s=f;break;case"checked":f!==h&&(Fe=!0),c=f;break;case"defaultChecked":f!==h&&(Fe=!0),u=f;break;case"value":f!==h&&(Fe=!0),a=f;break;case"defaultValue":f!==h&&(Fe=!0),o=f;break;case"children":case"dangerouslySetInnerHTML":if(f!=null)throw Error(B(137,t));break;default:f!==h&&Xe(e,t,d,f,n,h)}}am(e,a,o,l,c,u,r,s);return;case"select":f=a=o=d=null;for(r in i)if(l=i[r],i.hasOwnProperty(r)&&l!=null)switch(r){case"value":break;case"multiple":f=l;default:n.hasOwnProperty(r)||Xe(e,t,r,null,n,l)}for(s in n)if(r=n[s],l=i[s],n.hasOwnProperty(s)&&(r!=null||l!=null))switch(s){case"value":r!==l&&(Fe=!0),d=r;break;case"defaultValue":r!==l&&(Fe=!0),o=r;break;case"multiple":r!==l&&(Fe=!0),a=r;default:r!==l&&Xe(e,t,s,r,n,l)}t=o,i=a,n=f,d!=null?Mo(e,!!i,d,!1):!!n!=!!i&&(t!=null?Mo(e,!!i,t,!0):Mo(e,!!i,i?[]:"",!1));return;case"textarea":f=d=null;for(o in i)if(s=i[o],i.hasOwnProperty(o)&&s!=null&&!n.hasOwnProperty(o))switch(o){case"value":break;case"children":break;default:Xe(e,t,o,null,n,s)}for(a in n)if(s=n[a],r=i[a],n.hasOwnProperty(a)&&(s!=null||r!=null))switch(a){case"value":s!==r&&(Fe=!0),d=s;break;case"defaultValue":s!==r&&(Fe=!0),f=s;break;case"children":break;case"dangerouslySetInnerHTML":if(s!=null)throw Error(B(91));break;default:s!==r&&Xe(e,t,a,s,n,r)}FS(e,d,f);return;case"option":for(var p in i)d=i[p],i.hasOwnProperty(p)&&d!=null&&!n.hasOwnProperty(p)&&(p==="selected"?e.selected=!1:Xe(e,t,p,null,n,d));for(l in n)d=n[l],f=i[l],n.hasOwnProperty(l)&&d!==f&&(d!=null||f!=null)&&(l==="selected"?(d!==f&&(Fe=!0),e.selected=d&&typeof d!="function"&&typeof d!="symbol"):Xe(e,t,l,d,n,f));return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var _ in i)d=i[_],i.hasOwnProperty(_)&&d!=null&&!n.hasOwnProperty(_)&&Xe(e,t,_,null,n,d);for(c in n)if(d=n[c],f=i[c],n.hasOwnProperty(c)&&d!==f&&(d!=null||f!=null))switch(c){case"children":case"dangerouslySetInnerHTML":if(d!=null)throw Error(B(137,t));break;default:Xe(e,t,c,d,n,f)}return;default:if(ug(t)){for(var v in i)d=i[v],i.hasOwnProperty(v)&&d!==void 0&&!n.hasOwnProperty(v)&&jm(e,t,v,void 0,n,d);for(u in n)d=n[u],f=i[u],!n.hasOwnProperty(u)||d===f||d===void 0&&f===void 0||jm(e,t,u,d,n,f);return}}for(var g in i)d=i[g],i.hasOwnProperty(g)&&d!=null&&!n.hasOwnProperty(g)&&Xe(e,t,g,null,n,d);for(h in n)d=n[h],f=i[h],!n.hasOwnProperty(h)||d===f||d==null&&f==null||Xe(e,t,h,d,n,f)}function Vy(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function ED(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,i=performance.getEntriesByType("resource"),n=0;n<i.length;n++){var s=i[n],r=s.transferSize,a=s.initiatorType,o=s.duration;if(r&&o&&Vy(a)){for(a=0,o=s.responseEnd,n+=1;n<i.length;n++){var l=i[n],c=l.startTime;if(c>o)break;var u=l.transferSize,h=l.initiatorType;u&&Vy(h)&&(l=l.responseEnd,a+=u*(l<o?1:(o-c)/(l-c)))}if(--n,t+=8*(r+a)/(s.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e=="number")?e:5}var Vm=null,Xm=null;function Sc(e){return e.nodeType===9?e:e.ownerDocument}function Xy(e){switch(e){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function Y1(e,t){if(e===0)switch(t){case"svg":return 1;case"math":return 2;default:return 0}return e===1&&t==="foreignObject"?0:e}function j1(e,t,i,n){return i=Sc(i).createElement(e),i[ci]=n,i[$i]=t,fi(i,e,t),Vt(i),i}function Zm(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.children=="bigint"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var Gp=null;function xD(){var e=window.event;return e&&e.type==="popstate"?e===Gp?!1:(Gp=e,!0):(Gp=null,!1)}var Xg=typeof setTimeout=="function"?setTimeout:void 0,CD=typeof clearTimeout=="function"?clearTimeout:void 0,Zy=typeof Promise=="function"?Promise:void 0,Qy=typeof requestAnimationFrame=="function"?requestAnimationFrame:Xg,kD=typeof queueMicrotask=="function"?queueMicrotask:typeof Zy<"u"?function(e){return Zy.resolve(null).then(e).catch(TD)}:Xg;function TD(e){setTimeout(function(){throw e})}function Br(e){return e==="head"}function Jy(e,t){var i=t,n=0;do{var s=i.nextSibling;if(e.removeChild(i),s&&s.nodeType===8)if(i=s.data,i==="/$"||i==="/&"){if(n===0){e.removeChild(s),Zo(t);return}n--}else if(i==="$"||i==="$?"||i==="$~"||i==="$!"||i==="&")n++;else if(i==="html")Yp(e.ownerDocument.documentElement);else if(i==="head"){i=e.ownerDocument.head,Yp(i);for(var r=i.firstChild;r;){var a=r.nextSibling,o=r.nodeName;r[Mc]||o==="SCRIPT"||o==="STYLE"||o==="LINK"&&r.rel.toLowerCase()==="stylesheet"||i.removeChild(r),r=a}}else i==="body"&&Yp(e.ownerDocument.body);i=s}while(i);Zo(t)}function eS(e,t){var i=e;e=0;do{var n=i.nextSibling;if(i.nodeType===1?t?(i._stashedDisplay=i.style.display,i.style.display="none"):(i.style.display=i._stashedDisplay||"",i.getAttribute("style")===""&&i.removeAttribute("style")):i.nodeType===3&&(t?(i._stashedText=i.nodeValue,i.nodeValue=""):i.nodeValue=i._stashedText||""),n&&n.nodeType===8)if(i=n.data,i==="/$"){if(e===0)break;e--}else i!=="$"&&i!=="$?"&&i!=="$~"&&i!=="$!"||e++;i=n}while(i)}function V1(e,t,i){if(t=CSS.escape(t)!==t?"r-"+btoa(t).replace(/=/g,""):t,e.style.viewTransitionName=t,i!=null&&(e.style.viewTransitionClass=i),i=getComputedStyle(e),i.display==="inline"){if(t=e.getClientRects(),t.length===1)var n=1;else for(var s=n=0;s<t.length;s++){var r=t[s];0<r.width&&0<r.height&&n++}n===1&&(e=e.style,e.display=t.length===1?"inline-block":"block",e.marginTop="-"+i.paddingTop,e.marginBottom="-"+i.paddingBottom)}}function X1(e,t){e=e.style,t=t.style;var i=t!=null?t.hasOwnProperty("viewTransitionName")?t.viewTransitionName:t.hasOwnProperty("view-transition-name")?t["view-transition-name"]:null:null;e.viewTransitionName=i==null||typeof i=="boolean"?"":(""+i).trim(),i=t!=null?t.hasOwnProperty("viewTransitionClass")?t.viewTransitionClass:t.hasOwnProperty("view-transition-class")?t["view-transition-class"]:null:null,e.viewTransitionClass=i==null||typeof i=="boolean"?"":(""+i).trim(),e.display==="inline-block"&&(t==null?e.display=e.margin="":(i=t.display,e.display=i==null||typeof i=="boolean"?"":i,i=t.margin,i!=null?e.margin=i:(i=t.hasOwnProperty("marginTop")?t.marginTop:t["margin-top"],e.marginTop=i==null||typeof i=="boolean"?"":i,t=t.hasOwnProperty("marginBottom")?t.marginBottom:t["margin-bottom"],e.marginBottom=t==null||typeof t=="boolean"?"":t)))}function Z1(e,t,i){return i=i.ownerDocument.defaultView,{rect:e,abs:t.position==="absolute"||t.position==="fixed",clip:t.clipPath!=="none"||t.overflow!=="visible"||t.filter!=="none"||t.mask!=="none"||t.mask!=="none"||t.borderRadius!=="0px",view:0<=e.bottom&&0<=e.right&&e.top<=i.innerHeight&&e.left<=i.innerWidth}}function Qm(e){var t=e.getBoundingClientRect(),i=getComputedStyle(e);return Z1(t,i,e)}function ND(e){var t=e.getBoundingClientRect();t=new DOMRect(t.x+2e4,t.y+2e4,t.width,t.height);var i=getComputedStyle(e);return Z1(t,i,e)}function AD(e){return e.documentElement.clientHeight}function MD(e){this.addEventListener("load",e),this.addEventListener("error",e)}function OD(e,t,i,n,s,r,a,o,l){var c=t.nodeType===9?t:t.ownerDocument;try{var u=c.startViewTransition({update:function(){var d=c.defaultView,f=d.navigation&&d.navigation.transition,p=c.fonts.status;n();var _=[];if(p==="loaded"&&(AD(c),c.fonts.status==="loading"&&_.push(c.fonts.ready)),p=_.length,e!==null)for(var v=e.suspenseyImages,g=0,m=0;m<v.length;m++){var b=v[m];if(!b.complete){var S=b.getBoundingClientRect();if(0<S.bottom&&0<S.right&&S.top<d.innerHeight&&S.left<d.innerWidth){if(g+=cE(b),g>Ch){_.length=p;break}b=new Promise(MD.bind(b)),_.push(b)}}}if(0<_.length)return d=Promise.race([Promise.all(_),new Promise(function(x){return setTimeout(x,500)})]).then(s,s),(f?Promise.allSettled([f.finished,d]):d).then(r,r);if(s(),f)return f.finished.then(r,r);r()},types:i});c.__reactViewTransition=u;var h=[];return u.ready.then(function(){for(var d=c.documentElement.getAnimations({subtree:!0}),f=0;f<d.length;f++){var p=d[f],_=p.effect,v=_.pseudoElement;if(v!=null&&v.startsWith("::view-transition")){h.push(p),p=_.getKeyframes();for(var g=v=void 0,m=!0,b=0;b<p.length;b++){var S=p[b],x=S.width;if(v===void 0)v=x;else if(v!==x){m=!1;break}if(x=S.height,g===void 0)g=x;else if(g!==x){m=!1;break}delete S.width,delete S.height,S.transform==="none"&&delete S.transform}m&&v!==void 0&&g!==void 0&&(_.setKeyframes(p),m=getComputedStyle(_.target,_.pseudoElement),m.width!==v||m.height!==g)&&(m=p[0],m.width=v,m.height=g,m=p[p.length-1],m.width=v,m.height=g,_.setKeyframes(p))}}a()},function(d){c.__reactViewTransition===u&&(c.__reactViewTransition=null);try{typeof d=="object"&&d!==null&&d.name==="InvalidStateError"&&(d.message==="View transition was skipped because document visibility state is hidden."||d.message==="Skipping view transition because document visibility state has become hidden."||d.message==="Skipping view transition because viewport size changed."||d.message==="Transition was aborted because of invalid state")&&(d=null),d!==null&&l(d)}finally{n(),s(),a()}}),u.finished.finally(function(){for(var d=0;d<h.length;d++)h[d].cancel();c.__reactViewTransition===u&&(c.__reactViewTransition=null),o()}),u}catch{return n(),s(),a(),null}}function aa(e,t){this._scope=document.documentElement,this._selector="::view-transition-"+e+"("+t+")"}aa.prototype.animate=function(e,t){return t=typeof t=="number"?{duration:t}:it({},t),t.pseudoElement=this._selector,this._scope.animate(e,t)};aa.prototype.getAnimations=function(){for(var e=this._scope,t=this._selector,i=e.getAnimations({subtree:!0}),n=[],s=0;s<i.length;s++){var r=i[s].effect;r!==null&&r.target===e&&r.pseudoElement===t&&n.push(i[s])}return n};aa.prototype.getComputedStyle=function(){return getComputedStyle(this._scope,this._selector)};function Q1(e){return{name:e,group:new aa("group",e),imagePair:new aa("image-pair",e),old:new aa("old",e),new:new aa("new",e)}}function on(e){this._fragmentFiber=e,this._observers=this._eventListeners=null}on.prototype.addEventListener=function(e,t,i){var n=null,s=null;if(!(i!=null&&typeof i!="boolean"&&(n=i.signal||null,n!==null&&n.aborted))){this._eventListeners===null&&(this._eventListeners=[]);var r=this._eventListeners;if(J1(r,e,t,i)===-1){var a=this,o=t;i!=null&&typeof i!="boolean"&&i.once===!0&&(o=function(l){a.removeEventListener(e,t,i),typeof t=="function"?t.call(this,l):t.handleEvent(l)}),n!==null&&(s=a.removeEventListener.bind(a,e,t,i),n.addEventListener("abort",s,{once:!0}),s=n.removeEventListener.bind(n,"abort",s)),n=Yo(i),r.push({type:e,listener:t,optionsOrUseCapture:i,attachedListener:o,cleanup:s}),Gi(this._fragmentFiber.child,!1,RD,e,o,n)}this._eventListeners=r}};function RD(e,t,i,n){return Ft(e).addEventListener(t,i,n),!1}on.prototype.removeEventListener=function(e,t,i){var n=this._eventListeners;if(n!==null&&(t=J1(n,e,t,i),t!==-1)){var s=n[t];i=s.attachedListener;var r=s.cleanup;s=Yo(s.optionsOrUseCapture),Gi(this._fragmentFiber.child,!1,DD,e,i,s),n.splice(t,1),r!==null&&r()}};function DD(e,t,i,n){return Ft(e).removeEventListener(t,i,n),!1}function Yo(e){return e!=null&&typeof e!="boolean"&&(e.once===!0||e.signal instanceof AbortSignal)?{capture:e.capture,passive:e.passive}:e}function tS(e){return e==null?"c=0":typeof e=="boolean"?"c="+(e?"1":"0"):"c="+(e.capture?"1":"0")}function J1(e,t,i,n){if(e.length===0)return-1;n=tS(n);for(var s=0;s<e.length;s++){var r=e[s];if(r.type===t&&r.listener===i&&tS(r.optionsOrUseCapture)===n)return s}return-1}on.prototype.dispatchEvent=function(e){var t=ya(this._fragmentFiber);if(t===null)return!0;t=Ft(t);var i=this._eventListeners;if(i!==null&&0<i.length||!e.bubbles){var n=t.nodeType===9?t.createComment(""):document.createTextNode("");if(i)for(var s=0;s<i.length;s++){var r=i[s];n.addEventListener(r.type,r.attachedListener,Yo(r.optionsOrUseCapture))}if(t.appendChild(n),e=n.dispatchEvent(e),i)for(s=0;s<i.length;s++)r=i[s],n.removeEventListener(r.type,r.attachedListener,Yo(r.optionsOrUseCapture));return t.removeChild(n),e}return t.dispatchEvent(e)};on.prototype.focus=function(e){Gi(this._fragmentFiber.child,!0,eE,e,void 0,void 0)};function eE(e,t){return e.tag===6?!1:(e=Ft(e),GD(e,t))}on.prototype.focusLast=function(e){var t=[];Gi(this._fragmentFiber.child,!0,Zg,t,void 0,void 0);for(var i=t.length-1;0<=i&&!eE(t[i],e);i--);};function Zg(e,t){return t.push(e),!1}on.prototype.blur=function(){var e=ya(this._fragmentFiber);e!==null&&(e=Ft(e),e=Sc(e).activeElement,e!==null&&Gi(this._fragmentFiber.child,!1,LD,e,void 0,void 0))};function LD(e,t){return e.tag===6?!1:(e=Ft(e),e===t||e.contains(t)?(t.blur(),!0):!1)}on.prototype.observeUsing=function(e){this._observers===null&&(this._observers=new Set),this._observers.add(e),Gi(this._fragmentFiber.child,!1,BD,e,void 0,void 0)};function BD(e,t){return e.tag===6||(e=Ft(e),t.observe(e)),!1}on.prototype.unobserveUsing=function(e){var t=this._observers;if(t!==null&&t.has(e)){t.delete(e),Gi(this._fragmentFiber.child,!1,ID,e,void 0,void 0);for(var i=t=0;i<Un.length;i++){var n=Un[i];n.fragmentInstance===this&&n.observer===e?e.unobserve(n.instance):Un[t++]=n}Un.length=t}};function ID(e,t){return e.tag===6||(e=Ft(e),t.unobserve(e)),!1}var Un=[],$p=!1;function zD(e,t,i){Un.push({fragmentInstance:e,observer:t,instance:i}),$p||($p=!0,$D(function(){$p=!1;var n=Un;Un=[];for(var s=0;s<n.length;s++){var r=n[s];r.observer.unobserve(r.instance)}}))}on.prototype.getClientRects=function(){var e=[];return Gi(this._fragmentFiber.child,!1,PD,e,void 0,void 0),e};function PD(e,t){if(e.tag===6){e=e.stateNode;var i=e.ownerDocument.createRange();i.selectNodeContents(e),t.push.apply(t,i.getClientRects())}else e=Ft(e),t.push.apply(t,e.getClientRects());return!1}on.prototype.getRootNode=function(e){var t=ya(this._fragmentFiber);return t===null?this:Ft(t).getRootNode(e)};on.prototype.compareDocumentPosition=function(e){var t=ya(this._fragmentFiber);if(t===null)return Node.DOCUMENT_POSITION_DISCONNECTED;var i=[];Gi(this._fragmentFiber.child,!1,Zg,i,void 0,void 0);var n=Ft(t);if(i.length===0){if(i=n,L0(this._fragmentFiber)){e:{for(t=this._fragmentFiber.return;t!==null;){if(t.tag===4){t=t.stateNode.containerInfo;break e}if(t.tag===3||t.tag===5||t.tag===27)break;t=t.return}t=null}t!=null&&(i=t)}t=this._fragmentFiber;var s=n=i.compareDocumentPosition(e);return i===e?s=Node.DOCUMENT_POSITION_CONTAINS:n&Node.DOCUMENT_POSITION_CONTAINED_BY&&(i=wS(t)[1],i===null?s=Node.DOCUMENT_POSITION_PRECEDING:(e=Ft(i).compareDocumentPosition(e),s=e===0||e&Node.DOCUMENT_POSITION_FOLLOWING?Node.DOCUMENT_POSITION_FOLLOWING:Node.DOCUMENT_POSITION_PRECEDING)),s|=Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC}t=Ft(i[0]),s=Ft(i[i.length-1]);var r=L0(this._fragmentFiber)?t.parentElement:n;if(r==null)return Node.DOCUMENT_POSITION_DISCONNECTED;n=r.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_CONTAINED_BY,r=r.compareDocumentPosition(s)&Node.DOCUMENT_POSITION_CONTAINED_BY;var a=t.compareDocumentPosition(e),o=s.compareDocumentPosition(e),l=a&Node.DOCUMENT_POSITION_CONTAINED_BY||o&Node.DOCUMENT_POSITION_CONTAINED_BY;return o=n&&r&&a&Node.DOCUMENT_POSITION_FOLLOWING&&o&Node.DOCUMENT_POSITION_PRECEDING,t=n&&t===e||r&&s===e||l||o?Node.DOCUMENT_POSITION_CONTAINED_BY:!n&&t===e||!r&&s===e?Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC:a,t&Node.DOCUMENT_POSITION_DISCONNECTED||t&Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC||UD(t,this._fragmentFiber,i[0],i[i.length-1],e)?t:Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC};function UD(e,t,i,n,s){var r=ra(s);if(e&Node.DOCUMENT_POSITION_CONTAINED_BY){if(i=!!r)e:{for(;r!==null;){if(r.tag===7&&(r===t||r.alternate===t)){i=!0;break e}r=r.return}i=!1}return i}if(e&Node.DOCUMENT_POSITION_CONTAINS){if(r===null)return r=s.ownerDocument,s===r||s===r.documentElement||s===r.body;e:{for(r=t,t=ya(t);r!==null;){if(!(r.tag!==5&&r.tag!==3&&r.tag!==27||r!==t&&r.alternate!==t)){r=!0;break e}r=r.return}r=!1}return r}return e&Node.DOCUMENT_POSITION_PRECEDING?((t=!!r)&&!(t=r===i)&&(t=Vp(i,r,B0),t===null?t=!1:(Gi(t,!0,mO,r,i),r=_o,_o=null,t=r!==null)),t):e&Node.DOCUMENT_POSITION_FOLLOWING?((t=!!r)&&!(t=r===n)&&(t=Vp(n,r,B0),t===null?t=!1:(Gi(t,!0,gO,r,n),r=_o,jp=_o=null,t=r!==null)),t):!1}function iS(e,t){var i=e.ownerDocument.createRange();i.selectNodeContents(e),e=i.getBoundingClientRect(),window.scrollTo(window.scrollX+e.left,t?window.scrollY+e.top:window.scrollY+e.bottom-window.innerHeight)}on.prototype.scrollIntoView=function(e){if(typeof e=="object")throw Error(B(566));var t=[];Gi(this._fragmentFiber.child,!1,Zg,t,void 0,void 0);var i=e!==!1;if(t.length===0){var n=wS(this._fragmentFiber);if(n=i?n[1]||n[0]||ya(this._fragmentFiber):n[0]||n[1],n===null)return;if(n.tag===6){e=Ft(n),iS(e,i);return}if(n=Ft(n),n.nodeType!==9){if(n.nodeType===11){i="host"in n?n.host:null,i!==null&&i.scrollIntoView(e);return}n.scrollIntoView(e)}}for(n=i?t.length-1:0;n!==(i?-1:t.length);){var s=t[n];s.tag===6?(s=Ft(s),iS(s,i)):Ft(s).scrollIntoView(e),n+=i?-1:1}};function HD(e,t){return e=Ft(e),tE(e,t),!1}function tE(e,t){e.reactFragments==null&&(e.reactFragments=new Set),e.reactFragments.add(t)}function iE(e,t){var i=t._eventListeners;if(i!==null)for(var n=0;n<i.length;n++){var s=i[n];e.addEventListener(s.type,s.attachedListener,Yo(s.optionsOrUseCapture))}e.nodeType!==3&&(i=t._observers,i!==null&&i.forEach(function(r){for(var a=0,o=0;o<Un.length;o++){var l=Un[o];(l.fragmentInstance!==t||l.observer!==r||l.instance!==e)&&(Un[a++]=l)}Un.length=a,r.observe(e)}),tE(e,t))}function FD(e,t){var i=t._eventListeners;if(i!==null)for(var n=0;n<i.length;n++){var s=i[n];e.removeEventListener(s.type,s.attachedListener,Yo(s.optionsOrUseCapture))}e.nodeType!==3&&(i=t._observers,i!==null&&i.forEach(function(r){typeof r.rootMargin=="string"?zD(t,r,e):r.unobserve(e)}),e.reactFragments!=null&&e.reactFragments.delete(t))}function Jm(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var i=t;switch(t=t.nextSibling,i.nodeName){case"HTML":case"HEAD":case"BODY":Jm(i),sd(i);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(i.rel.toLowerCase()==="stylesheet")continue}e.removeChild(i)}}function qD(e,t,i,n){for(;e.nodeType===1;){var s=i;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!n&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(n){if(!e[Mc])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(r=e.getAttribute("rel"),r==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(r!==s.rel||e.getAttribute("href")!==(s.href==null||s.href===""?null:s.href)||e.getAttribute("crossorigin")!==(s.crossOrigin==null?null:s.crossOrigin)||e.getAttribute("title")!==(s.title==null?null:s.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(r=e.getAttribute("src"),(r!==(s.src==null?null:s.src)||e.getAttribute("type")!==(s.type==null?null:s.type)||e.getAttribute("crossorigin")!==(s.crossOrigin==null?null:s.crossOrigin))&&r&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var r=s.name==null?null:""+s.name;if(s.type==="hidden"&&e.getAttribute("name")===r)return e}else return e;if(e=xn(e.nextSibling),e===null)break}return null}function KD(e,t,i){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!i||(e=xn(e.nextSibling),e===null))return null;return e}function nE(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=xn(e.nextSibling),e===null))return null;return e}function eg(e){return e.data==="$?"||e.data==="$~"}function Qg(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function WD(e,t){var i=e.ownerDocument;if(e.data==="$~")e._reactRetry=t;else if(e.data!=="$?"||i.readyState!=="loading")t();else{var n=function(){t(),i.removeEventListener("DOMContentLoaded",n)};i.addEventListener("DOMContentLoaded",n),e._reactRetry=n}}function xn(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?"||t==="$~"||t==="&"||t==="F!"||t==="F")break;if(t==="/$"||t==="/&")return null}}return e}var tg=null;function nS(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var i=e.data;if(i==="/$"||i==="/&"){if(t===0)return xn(e.nextSibling);t--}else i!=="$"&&i!=="$!"&&i!=="$?"&&i!=="$~"&&i!=="&"||t++}e=e.nextSibling}return null}function sS(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var i=e.data;if(i==="$"||i==="$!"||i==="$?"||i==="$~"||i==="&"){if(t===0)return e;t--}else i!=="/$"&&i!=="/&"||t++}e=e.previousSibling}return null}function GD(e,t){function i(){n=!0}if(e.ownerDocument.activeElement===e)return!0;var n=!1;try{e.ownerDocument.addEventListener("focus",i,!0),(e.focus||HTMLElement.prototype.focus).call(e,t)}finally{e.ownerDocument.removeEventListener("focus",i,!0)}return n}function $D(e){Qy(function(){Qy(function(t){return e(t)})})}function sE(e,t,i){switch(t=Sc(i),e){case"html":if(e=t.documentElement,!e)throw Error(B(452));return e;case"head":if(e=t.head,!e)throw Error(B(453));return e;case"body":if(e=t.body,!e)throw Error(B(454));return e;default:throw Error(B(451))}}function rE(e,t,i){for(var n in i){var s=i[n];i.hasOwnProperty(n)&&s!=null&&Xe(e,t,n,null,SD,s)}i.dangerouslySetInnerHTML!=null&&(e.textContent=""),e.onclick===as&&(e.onclick=null),sd(e)}function Yp(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);sd(e)}var Cn=new Map,rS=new Set;function wc(e){if(typeof e.getRootNode=="function"){var t=e.getRootNode();if(t.nodeType===9||t.nodeType===11)return t}return e.nodeType===9?e:e.ownerDocument}var Ks=Ke.d;Ke.d={f:YD,r:jD,D:VD,C:XD,L:ZD,m:QD,X:e2,S:JD,M:t2};function YD(){var e=Ks.f(),t=vd();return e||t}function jD(e){var t=Jo(e);t!==null&&t.tag===5&&t.type==="form"?Kw(t):Ks.r(e)}var nl=typeof document>"u"?null:document;function aE(e,t,i){var n=nl;if(n&&typeof t=="string"&&t){var s=Sn(t);s='link[rel="'+e+'"][href="'+s+'"]',typeof i=="string"&&(s+='[crossorigin="'+i+'"]'),rS.has(s)||(rS.add(s),e={rel:e,crossOrigin:i,href:t},n.querySelector(s)===null&&(t=n.createElement("link"),fi(t,"link",e),Vt(t),n.head.appendChild(t)))}}function VD(e){Ks.D(e),aE("dns-prefetch",e,null)}function XD(e,t){Ks.C(e,t),aE("preconnect",e,t)}function ZD(e,t,i){Ks.L(e,t,i);var n=nl;if(n&&e&&t){var s='link[rel="preload"][as="'+Sn(t)+'"]';t==="image"&&i&&i.imageSrcSet?(s+='[imagesrcset="'+Sn(i.imageSrcSet)+'"]',typeof i.imageSizes=="string"&&(s+='[imagesizes="'+Sn(i.imageSizes)+'"]')):s+='[href="'+Sn(e)+'"]';var r=s;switch(t){case"style":r=jo(e);break;case"script":r=sl(e)}if(!(Cn.has(r)||(e=it({rel:"preload",href:t==="image"&&i&&i.imageSrcSet?void 0:e,as:t},i),Cn.set(r,e),n.querySelector(s)!==null||t==="style"&&n.querySelector(Ic(r))||t==="script"&&n.querySelector(zc(r))))){var a=n.createElement("link");fi(a,"link",e),t==="style"&&(a[Rh]=!0,a.onload=a.onerror=function(){BS(a)}),Vt(a),n.head.appendChild(a)}}}function QD(e,t){Ks.m(e,t);var i=nl;if(i&&e){var n=t&&typeof t.as=="string"?t.as:"script",s='link[rel="modulepreload"][as="'+Sn(n)+'"][href="'+Sn(e)+'"]',r=s;switch(n){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":r=sl(e)}if(!Cn.has(r)&&(e=it({rel:"modulepreload",href:e},t),Cn.set(r,e),i.querySelector(s)===null)){switch(n){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(i.querySelector(zc(r)))return}n=i.createElement("link"),fi(n,"link",e),Vt(n),i.head.appendChild(n)}}}function JD(e,t,i){Ks.S(e,t,i);var n=nl;if(n&&e){var s=Ao(n).hoistableStyles,r=jo(e);t=t||"default";var a=s.get(r);if(!a){var o={loading:0,preload:null};if(a=n.querySelector(Ic(r)))o.loading=5;else{e=it({rel:"stylesheet",href:e,"data-precedence":t},i),(i=Cn.get(r))&&Jg(e,i);var l=a=n.createElement("link");Vt(l),fi(l,"link",e),l._p=new Promise(function(c,u){l.onload=c,l.onerror=u}),l.addEventListener("load",function(){o.loading|=1}),l.addEventListener("error",function(){o.loading|=2}),o.loading|=4,Eh(a,t,n)}a={type:"stylesheet",instance:a,count:1,state:o},s.set(r,a)}}}function e2(e,t){Ks.X(e,t);var i=nl;if(i&&e){var n=Ao(i).hoistableScripts,s=sl(e),r=n.get(s);r||(r=i.querySelector(zc(s)),r||(e=it({src:e,async:!0},t),(t=Cn.get(s))&&e_(e,t),r=i.createElement("script"),Vt(r),fi(r,"link",e),i.head.appendChild(r)),r={type:"script",instance:r,count:1,state:null},n.set(s,r))}}function t2(e,t){Ks.M(e,t);var i=nl;if(i&&e){var n=Ao(i).hoistableScripts,s=sl(e),r=n.get(s);r||(r=i.querySelector(zc(s)),r||(e=it({src:e,async:!0,type:"module"},t),(t=Cn.get(s))&&e_(e,t),r=i.createElement("script"),Vt(r),fi(r,"link",e),i.head.appendChild(r)),r={type:"script",instance:r,count:1,state:null},n.set(s,r))}}function aS(e,t,i,n){var s=(s=br.current)?wc(s):null;if(!s)throw Error(B(446));switch(e){case"meta":case"title":return null;case"style":return typeof i.precedence=="string"&&typeof i.href=="string"?(i=jo(i.href),t=Ao(s).hoistableStyles,n=t.get(i),n||(n={type:"style",instance:null,count:0,state:null},t.set(i,n)),n):{type:"void",instance:null,count:0,state:null};case"link":if(i.rel==="stylesheet"&&typeof i.href=="string"&&typeof i.precedence=="string"){e=jo(i.href);var r=Ao(s).hoistableStyles,a=r.get(e);if(a||(s=s.ownerDocument||s,a={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},r.set(e,a),(r=s.querySelector(Ic(e)))?r._p||(a.instance=r,a.state.loading=5):(r=Cn.get(e),r||(r={rel:"preload",as:"style",href:i.href,crossOrigin:i.crossOrigin,integrity:i.integrity,media:i.media,hrefLang:i.hrefLang,referrerPolicy:i.referrerPolicy},Cn.set(e,r)),i2(s,e,r,a.state))),t&&n===null)throw Error(B(528,""));return a}if(t&&n!==null)throw Error(B(529,""));return null;case"script":return t=i.async,i=i.src,typeof i=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(i=sl(i),t=Ao(s).hoistableScripts,n=t.get(i),n||(n={type:"script",instance:null,count:0,state:null},t.set(i,n)),n):{type:"void",instance:null,count:0,state:null};default:throw Error(B(444,e))}}function jo(e){return'href="'+Sn(e)+'"'}function Ic(e){return'link[rel="stylesheet"]['+e+"]"}function oE(e){return it({},e,{"data-precedence":e.precedence,precedence:null})}function i2(e,t,i,n){if(t=e.querySelector('link[rel="preload"][as="style"]['+t+"]")){if(t[Rh]!==!0){n.loading=1;return}}else t=e.createElement("link"),t[Rh]=!0,t.onload=t.onerror=BS.bind(null,t),fi(t,"link",i),Vt(t),e.head.appendChild(t);n.preload=t,t.addEventListener("load",function(){return n.loading|=1}),t.addEventListener("error",function(){return n.loading|=2})}function sl(e){return'[src="'+Sn(e)+'"]'}function zc(e){return"script[async]"+e}function oS(e,t,i){if(t.count++,t.instance===null)switch(t.type){case"style":var n=e.querySelector('style[data-href~="'+Sn(i.href)+'"]');if(n)return t.instance=n,Vt(n),n;var s=it({},i,{"data-href":i.href,"data-precedence":i.precedence,href:null,precedence:null});return n=(e.ownerDocument||e).createElement("style"),Vt(n),fi(n,"style",s),Eh(n,i.precedence,e),t.instance=n;case"stylesheet":s=jo(i.href);var r=e.querySelector(Ic(s));if(r)return t.state.loading|=4,t.instance=r,Vt(r),r;n=oE(i),(s=Cn.get(s))&&Jg(n,s),r=(e.ownerDocument||e).createElement("link"),Vt(r);var a=r;return a._p=new Promise(function(o,l){a.onload=o,a.onerror=l}),fi(r,"link",n),t.state.loading|=4,Eh(r,i.precedence,e),t.instance=r;case"script":return r=sl(i.src),(s=e.querySelector(zc(r)))?(t.instance=s,Vt(s),s):(n=i,(s=Cn.get(r))&&(n=it({},i),e_(n,s)),e=e.ownerDocument||e,s=e.createElement("script"),Vt(s),fi(s,"link",n),e.head.appendChild(s),t.instance=s);case"void":return null;default:throw Error(B(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(n=t.instance,t.state.loading|=4,Eh(n,i.precedence,e));return t.instance}function Eh(e,t,i){for(var n=i.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),s=n.length?n[n.length-1]:null,r=s,a=0;a<n.length;a++){var o=n[a];if(o.dataset.precedence===t)r=o;else if(r!==s)break}r?r.parentNode.insertBefore(e,r.nextSibling):(t=i.nodeType===9?i.head:i,t.insertBefore(e,t.firstChild))}function Jg(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function e_(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var xh=null;function lS(e,t,i){if(xh===null){var n=new Map,s=xh=new Map;s.set(i,n)}else s=xh,n=s.get(i),n||(n=new Map,s.set(i,n));if(n.has(e))return n;for(n.set(e,null),i=i.getElementsByTagName(e),s=0;s<i.length;s++){var r=i[s];if(!(r[Mc]||r[ci]||e==="link"&&r.getAttribute("rel")==="stylesheet")&&r.namespaceURI!=="http://www.w3.org/2000/svg"){var a=r.getAttribute(t)||"";a=e+a;var o=n.get(a);o?o.push(r):n.set(a,[r])}}return n}function ig(e,t,i){e=e.ownerDocument||e,e.head.insertBefore(i,t==="title"?e.querySelector("head > title"):null)}function n2(e,t,i){if(i===1||t.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof t.precedence!="string"||typeof t.href!="string"||t.href==="")break;return!0;case"link":if(typeof t.rel!="string"||typeof t.href!="string"||t.href===""||t.onLoad||t.onError)break;return t.rel==="stylesheet"?(e=t.disabled,typeof t.precedence=="string"&&e==null):!0;case"script":if(t.async&&typeof t.async!="function"&&typeof t.async!="symbol"&&!t.onLoad&&!t.onError&&t.src&&typeof t.src=="string")return!0}return!1}function cS(e,t){return e==="img"&&t.src!=null&&t.src!==""&&t.onLoad==null&&t.loading!=="lazy"}function lE(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function cE(e){return(e.width||100)*(e.height||100)*(typeof devicePixelRatio=="number"?devicePixelRatio:1)*.25}function uS(e,t){typeof t.decode=="function"&&(e.imgCount++,t.complete||(e.imgBytes+=cE(t),e.suspenseyImages.push(t)),e=a2.bind(e),t.decode().then(e,e))}function s2(e,t,i,n){if(i.type==="stylesheet"&&(typeof n.media!="string"||matchMedia(n.media).matches!==!1)&&(i.state.loading&4)===0){if(i.instance===null){var s=jo(n.href),r=t.querySelector(Ic(s));if(r){t=r._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=Ec.bind(e),t.then(e,e)),i.state.loading|=4,i.instance=r,Vt(r);return}r=t.ownerDocument||t,n=oE(n),(s=Cn.get(s))&&Jg(n,s),r=r.createElement("link"),Vt(r);var a=r;a._p=new Promise(function(o,l){a.onload=o,a.onerror=l}),fi(r,"link",n),i.instance=r}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(i,t),(t=i.state.preload)&&(i.state.loading&3)===0&&(e.count++,i=Ec.bind(e),t.addEventListener("load",i),t.addEventListener("error",i))}}var Ch=0;function r2(e,t){return e.stylesheets&&e.count===0&&kh(e,e.stylesheets),0<e.count||0<e.imgCount?function(i){var n=setTimeout(function(){if(e.stylesheets&&kh(e,e.stylesheets),e.unsuspend){var r=e.unsuspend;e.unsuspend=null,r()}},6e4+t);0<e.imgBytes&&Ch===0&&(Ch=62500*ED());var s=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&kh(e,e.stylesheets),e.unsuspend)){var r=e.unsuspend;e.unsuspend=null,r()}},(e.imgBytes>Ch?50:800)+t);return e.unsuspend=i,function(){e.unsuspend=null,clearTimeout(n),clearTimeout(s)}}:null}function uE(e){if(e.count===0&&(e.imgCount===0||!e.waitingForImages)){if(e.stylesheets)kh(e,e.stylesheets);else if(e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}}}function Ec(){this.count--,uE(this)}function a2(){this.imgCount--,uE(this)}var td=null;function kh(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,td=new Map,t.forEach(o2,e),td=null,Ec.call(e))}function o2(e,t){if(!(t.state.loading&4)){var i=td.get(e);if(i)var n=i.get(null);else{i=new Map,td.set(e,i);for(var s=e.querySelectorAll("link[data-precedence],style[data-precedence]"),r=0;r<s.length;r++){var a=s[r];(a.nodeName==="LINK"||a.getAttribute("media")!=="not all")&&(i.set(a.dataset.precedence,a),n=a)}n&&i.set(null,n)}s=t.instance,a=s.getAttribute("data-precedence"),r=i.get(a)||n,r===n&&i.set(null,s),i.set(a,s),this.count++,n=Ec.bind(this),s.addEventListener("load",n),s.addEventListener("error",n),r?r.parentNode.insertBefore(s,r.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(s,e.firstChild)),t.state.loading|=4}}var Vo={$$typeof:rs,Provider:null,Consumer:null,_currentValue:oa,_currentValue2:oa,_threadCount:0};function l2(e,t,i,n,s,r,a,o,l){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=Sp(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Sp(0),this.hiddenUpdates=Sp(null),this.identifierPrefix=n,this.onUncaughtError=s,this.onCaughtError=r,this.onRecoverableError=a,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=l,this.transitionTypes=null,this.incompleteTransitions=new Map}function hE(e,t,i,n,s,r,a,o,l,c,u,h){return e=new l2(e,t,i,a,l,c,u,h,o),t=1,r===!0&&(t|=24),r=Ki(3,null,null,t),e.current=r,r.stateNode=e,t=yg(),t.refCount++,e.pooledCache=t,t.refCount++,r.memoizedState={element:n,isDehydrated:i,cache:t},Eg(r),e}function dE(e){return e?(e=Co,e):Co}function fE(e,t,i,n,s,r){s=dE(s),n.context===null?n.context=s:n.pendingContext=s,n=Sr(t),n.payload={element:i},r=r===void 0?null:r,r!==null&&(n.callback=r),i=wr(e,n,t),i!==null&&(Wi(i,e,t),tc(i,e,t))}function hS(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var i=e.retryLane;e.retryLane=i!==0&&i<t?i:t}}function t_(e,t){hS(e,t),(e=e.alternate)&&hS(e,t)}function pE(e){if(e.tag===13||e.tag===31){var t=Ea(e,67108864);t!==null&&Wi(t,e,67108864),t_(e,67108864)}}function dS(e){if(e.tag===13||e.tag===31){var t=rn();t=lg(t);var i=Ea(e,t);i!==null&&Wi(i,e,t),t_(e,t)}}var Xo=!0;function c2(e,t,i,n){var s=ge.T;ge.T=null;var r=Ke.p;try{Ke.p=2,i_(e,t,i,n)}finally{Ke.p=r,ge.T=s}}function u2(e,t,i,n){var s=ge.T;ge.T=null;var r=Ke.p;try{Ke.p=8,i_(e,t,i,n)}finally{Ke.p=r,ge.T=s}}function i_(e,t,i,n){if(Xo){var s=ng(n);if(s===null)Wp(e,t,n,id,i),fS(e,n);else if(d2(s,e,t,i,n))n.stopPropagation();else if(fS(e,n),t&4&&-1<h2.indexOf(e)){for(;s!==null;){var r=Jo(s);if(r!==null)switch(r.tag){case 3:if(r=r.stateNode,r.current.memoizedState.isDehydrated){var a=ia(r.pendingLanes);if(a!==0){var o=r;for(o.pendingLanes|=2,o.entangledLanes|=2;a;){var l=1<<31-sn(a);o.entanglements[1]|=l,a&=~l}fs(r),(qe&6)===0&&(Xh=tn()+500,Bc(0,!1))}}break;case 31:case 13:o=Ea(r,2),o!==null&&Wi(o,r,2),vd(),t_(r,2)}if(r=ng(n),r===null&&Wp(e,t,n,id,i),r===s)break;s=r}s!==null&&n.stopPropagation()}else Wp(e,t,n,null,i)}}function ng(e){return e=hg(e),n_(e)}var id=null;function n_(e){if(id=null,e=ra(e),e!==null){var t=kc(e);if(t===null)e=null;else{var i=t.tag;if(i===13){if(e=bS(t),e!==null)return e;e=null}else if(i===31){if(e=yS(t),e!==null)return e;e=null}else if(i===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return id=e,null}function mE(e){switch(e){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"fullscreenerror":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"resize":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(CO()){case kS:return 2;case TS:return 8;case Oh:case kO:return 32;case NS:return 268435456;default:return 32}default:return 32}}var sg=!1,kr=null,Tr=null,Nr=null,xc=new Map,Cc=new Map,dr=[],h2="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function fS(e,t){switch(e){case"focusin":case"focusout":kr=null;break;case"dragenter":case"dragleave":Tr=null;break;case"mouseover":case"mouseout":Nr=null;break;case"pointerover":case"pointerout":xc.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Cc.delete(t.pointerId)}}function Wl(e,t,i,n,s,r){return e===null||e.nativeEvent!==r?(e={blockedOn:t,domEventName:i,eventSystemFlags:n,nativeEvent:r,targetContainers:[s]},t!==null&&(t=Jo(t),t!==null&&pE(t)),e):(e.eventSystemFlags|=n,t=e.targetContainers,s!==null&&t.indexOf(s)===-1&&t.push(s),e)}function d2(e,t,i,n,s){switch(t){case"focusin":return kr=Wl(kr,e,t,i,n,s),!0;case"dragenter":return Tr=Wl(Tr,e,t,i,n,s),!0;case"mouseover":return Nr=Wl(Nr,e,t,i,n,s),!0;case"pointerover":var r=s.pointerId;return xc.set(r,Wl(xc.get(r)||null,e,t,i,n,s)),!0;case"gotpointercapture":return r=s.pointerId,Cc.set(r,Wl(Cc.get(r)||null,e,t,i,n,s)),!0}return!1}function gE(e){var t=ra(e.target);if(t!==null){var i=kc(t);if(i!==null){if(t=i.tag,t===13){if(t=bS(i),t!==null){e.blockedOn=t,U0(e.priority,function(){dS(i)});return}}else if(t===31){if(t=yS(i),t!==null){e.blockedOn=t,U0(e.priority,function(){dS(i)});return}}else if(t===3&&i.stateNode.current.memoizedState.isDehydrated){e.blockedOn=i.tag===3?i.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Th(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var i=ng(e.nativeEvent);if(i===null){i=e.nativeEvent;var n=new i.constructor(i.type,i);om=n,i.target.dispatchEvent(n),om=null}else return t=Jo(i),t!==null&&pE(t),e.blockedOn=i,!1;t.shift()}return!0}function pS(e,t,i){Th(e)&&i.delete(t)}function f2(){sg=!1,kr!==null&&Th(kr)&&(kr=null),Tr!==null&&Th(Tr)&&(Tr=null),Nr!==null&&Th(Nr)&&(Nr=null),xc.forEach(pS),Cc.forEach(pS)}function oh(e,t){e.blockedOn===t&&(e.blockedOn=null,sg||(sg=!0,qt.unstable_scheduleCallback(qt.unstable_NormalPriority,f2)))}var lh=null;function mS(e){lh!==e&&(lh=e,qt.unstable_scheduleCallback(qt.unstable_NormalPriority,function(){lh===e&&(lh=null);for(var t=0;t<e.length;t+=3){var i=e[t],n=e[t+1],s=e[t+2];if(typeof n!="function"){if(n_(n||i)===null)continue;break}var r=Jo(i);r!==null&&(e.splice(t,3),t-=3,Em(r,{pending:!0,data:s,method:i.method,action:n},n,s))}}))}function Zo(e){function t(l){return oh(l,e)}kr!==null&&oh(kr,e),Tr!==null&&oh(Tr,e),Nr!==null&&oh(Nr,e),xc.forEach(t),Cc.forEach(t);for(var i=0;i<dr.length;i++){var n=dr[i];n.blockedOn===e&&(n.blockedOn=null)}for(;0<dr.length&&(i=dr[0],i.blockedOn===null);)gE(i),i.blockedOn===null&&dr.shift();if(i=(e.ownerDocument||e).$$reactFormReplay,i!=null)for(n=0;n<i.length;n+=3){var s=i[n],r=i[n+1],a=s[$i]||null;if(typeof r=="function")a||mS(i);else if(a){var o=null;if(r&&r.hasAttribute("formAction")){if(s=r,a=r[$i]||null)o=a.formAction;else if(n_(s)!==null)continue}else o=a.action;typeof o=="function"?i[n+1]=o:(i.splice(n,3),n-=3),mS(i)}}}function _E(){function e(r){r.canIntercept&&r.info==="react-transition"&&r.intercept({handler:function(){return new Promise(function(a){return s=a})},focusReset:"manual",scroll:"manual"})}function t(){s!==null&&(s(),s=null),n||setTimeout(i,20)}function i(){if(!n&&!navigation.transition){var r=navigation.currentEntry;r&&r.url!=null&&navigation.navigate(r.url,{state:r.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var n=!1,s=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",t),navigation.addEventListener("navigateerror",t),setTimeout(i,100),function(){n=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",t),navigation.removeEventListener("navigateerror",t),s!==null&&(s(),s=null)}}}function s_(e){this._internalRoot=e}Sd.prototype.render=s_.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(B(409));var i=t.current,n=rn();fE(i,n,e,t,null,null)};Sd.prototype.unmount=s_.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;fE(e.current,2,null,e,null,null),vd(),t[Qo]=null}};function Sd(e){this._internalRoot=e}Sd.prototype.unstable_scheduleHydration=function(e){if(e){var t=LS();e={blockedOn:null,target:e,priority:t};for(var i=0;i<dr.length&&t!==0&&t<dr[i].priority;i++);dr.splice(i,0,e),i===0&&gE(e)}};var gS=_S.version;if(gS!=="19.3.1")throw Error(B(527,gS,"19.3.1"));Ke.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(B(188)):(e=Object.keys(e).join(","),Error(B(268,e)));return e=pO(t),e=e!==null?SS(e):null,e=e===null?null:e.stateNode,e};var p2={bundleType:0,version:"19.3.1",rendererPackageName:"react-dom",currentDispatcherRef:ge,reconcilerVersion:"19.3.1"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&(Gl=__REACT_DEVTOOLS_GLOBAL_HOOK__,!Gl.isDisabled&&Gl.supportsFiber))try{Tc=Gl.inject(p2),nn=Gl}catch{}var Gl;wd.createRoot=function(e,t){if(!vS(e))throw Error(B(299));var i=!1,n="",s=Zw,r=Qw,a=Jw;return t!=null&&(t.unstable_strictMode===!0&&(i=!0),t.identifierPrefix!==void 0&&(n=t.identifierPrefix),t.onUncaughtError!==void 0&&(s=t.onUncaughtError),t.onCaughtError!==void 0&&(r=t.onCaughtError),t.onRecoverableError!==void 0&&(a=t.onRecoverableError)),t=hE(e,1,!1,null,null,i,n,null,s,r,a,_E),e[Qo]=t.current,Vg(e),new s_(t)};wd.hydrateRoot=function(e,t,i){if(!vS(e))throw Error(B(299));var n=!1,s="",r=Zw,a=Qw,o=Jw,l=null;return i!=null&&(i.unstable_strictMode===!0&&(n=!0),i.identifierPrefix!==void 0&&(s=i.identifierPrefix),i.onUncaughtError!==void 0&&(r=i.onUncaughtError),i.onCaughtError!==void 0&&(a=i.onCaughtError),i.onRecoverableError!==void 0&&(o=i.onRecoverableError),i.formState!==void 0&&(l=i.formState)),t=hE(e,1,!0,t,i??null,n,s,l,r,a,o,_E),t.context=dE(null),i=t.current,n=rn(),n=lg(n),s=Sr(n),s.callback=null,wr(i,s,n),i=n,t.current.lanes=i,Ac(t,i),fs(t),e[Qo]=t.current,Vg(e),new Sd(t)};wd.version="19.3.1"});var SE=me((oP,yE)=>{"use strict";function bE(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(bE)}catch(e){console.error(e)}}bE(),yE.exports=vE()});function wE(e){let t=new URLSearchParams(e).get("tokens");if(!t)return;let i;try{i=JSON.parse(decodeURIComponent(escape(atob(t))))}catch{return}let n=document.documentElement;for(let[s,r]of Object.entries(i)){let a=String(r??"").trim();if(!a)continue;let o=s.startsWith("--")?s:s.startsWith("magpie-")?`--${s}`:`--magpie-${s}`;n.style.setProperty(o,a)}}var EE=ce(()=>{});var r_,xE=ce(()=>{r_={zh:{app:{title:"Agent \u63A7\u5236\u53F0",subtitle:"\u5148\u5728\u5DE6\u4FA7\u65B0\u5EFA\u6216\u9009\u62E9\u4E00\u4E2A\u9879\u76EE"},common:{cancel:"\u53D6\u6D88",ok:"\u786E\u5B9A",save:"\u4FDD\u5B58",add:"\u6DFB\u52A0",browse:"\u6D4F\u89C8\u2026",more:"\u66F4\u591A",copy:"\u590D\u5236",copied:"\u5DF2\u590D\u5236",copyPath:"\u590D\u5236\u8DEF\u5F84",copiedPath:"\u5DF2\u590D\u5236\u8DEF\u5F84",search:"\u641C\u7D22",settings:"\u8BBE\u7F6E",remove:"\u79FB\u9664",close:"\u5173\u95ED",retry:"\u91CD\u8BD5",details:"\u8BE6\u60C5 \u203A",submit:"\u63D0\u4EA4",other:"\u5176\u4ED6\u2026",default:"\u9ED8\u8BA4",done:"\u5B8C\u6210",loading:"\u52A0\u8F7D\u4E2D\u2026",send:"\u53D1\u9001",stop:"\u505C\u6B62",refresh:"\u5237\u65B0",rename:"\u91CD\u547D\u540D",delete:"\u5220\u9664",discard:"\u653E\u5F03",notInstalled:"\uFF08\u672A\u5B89\u88C5\uFF09",notDetected:"\uFF08\u672A\u68C0\u6D4B\u5230\uFF09",current:"\uFF08\u5F53\u524D\uFF09",messages:"\u6761",imported:" \xB7 \u5DF2\u5BFC\u5165",justNow:"\u521A\u521A",minutesAgo:"{n} \u5206\u949F\u524D",hoursAgo:"{n} \u5C0F\u65F6\u524D",daysAgo:"{n} \u5929\u524D"},boot:{connecting:"\u6B63\u5728\u8FDE\u63A5\u2026",serviceDown:"\u672C\u5730\u670D\u52A1\u672A\u542F\u52A8",retry:"\u91CD\u8BD5",reconnecting:"\u8FDE\u63A5\u4E2D\u65AD\uFF0C\u6B63\u5728\u91CD\u8FDE\u2026",starting:"\u6B63\u5728\u542F\u52A8\u672C\u5730\u670D\u52A1\u2026"},topbar:{pickThread:"\u9009\u62E9\u4E00\u4E2A\u5BF9\u8BDD",sidebar:"\u4FA7\u680F\uFF08Ctrl+B\uFF09",clickRename:"\u70B9\u51FB\u6539\u540D",waitAuth:"\u7B49\u5F85\u6388\u6743",running:"\u8FD0\u884C\u4E2D {s}s",error:"\u51FA\u9519",closedResume:"\u5DF2\u5173\u95ED \xB7 \u53D1\u9001\u6D88\u606F\u5C06\u7EED\u63A5",threadInfo:"\u5BF9\u8BDD\u4FE1\u606F",panelChanges:"\u6539\u52A8\uFF08Ctrl+J\uFF09",panelFiles:"\u6587\u4EF6",panelTerminal:"\u7EC8\u7AEF"},sidebar:{newProject:"\u65B0\u5EFA\u9879\u76EE",filterPlaceholder:"\u8FC7\u6EE4\u5BF9\u8BDD\u6807\u9898",searchTitle:"\u641C\u7D22\uFF08Ctrl+K\uFF09",noProjectsTitle:"\u8FD8\u6CA1\u6709\u9879\u76EE",noProjectsSub:"\u9879\u76EE\u5BF9\u5E94\u4E00\u4E2A\u672C\u673A\u76EE\u5F55\uFF0C\u5BF9\u8BDD\u90FD\u5728\u76EE\u5F55\u91CC\u5E72\u6D3B\u3002",newThread:"\u65B0\u5EFA\u5BF9\u8BDD",projectMenu:"\u9879\u76EE\u83DC\u5355",showAll:"\u663E\u793A\u5168\u90E8 {n} \u6761",noThreads:"\u8FD8\u6CA1\u6709\u5BF9\u8BDD",rename:"\u91CD\u547D\u540D",pin:"\u7F6E\u9876",unpin:"\u53D6\u6D88\u7F6E\u9876",archive:"\u5F52\u6863",unarchive:"\u53D6\u6D88\u5F52\u6863",exportMd:"\u5BFC\u51FA Markdown",deleteThread:"\u5220\u9664\u5BF9\u8BDD",deleteThreadBody:"\u300C{title}\u300D\u5C06\u88AB\u79FB\u5230\u56DE\u6536\u76EE\u5F55\uFF0C\u786E\u5B9A\u5417\uFF1F",importHist:"\u5BFC\u5165\u5DF2\u6709\u5BF9\u8BDD\u2026",openExplorer:"\u5728\u8D44\u6E90\u7BA1\u7406\u5668\u6253\u5F00",showArchived:"\u663E\u793A\u5DF2\u5F52\u6863",hideArchived:"\u9690\u85CF\u5DF2\u5F52\u6863",archivedN:"\u5DF2\u5F52\u6863 {n} \u6761",archivedHint:"\u5DF2\u5F52\u6863\uFF0C\u53EF\u5728\u9879\u76EE\u5217\u8868\u5E95\u90E8\u67E5\u770B",unarchived:"\u5DF2\u53D6\u6D88\u5F52\u6863",exportSaved:"\u5DF2\u5BFC\u51FA\u5230 {path}",removeProject:"\u79FB\u9664\u9879\u76EE",removeProjectBody:"\u300C{name}\u300D\u5C06\u4ECE\u5217\u8868\u79FB\u9664\uFF0C\u5176\u5BF9\u8BDD\u79FB\u5230\u56DE\u6536\u76EE\u5F55\uFF08\u6587\u4EF6\u4E0D\u4F1A\u88AB\u5220\u9664\uFF09\u3002",renameProject:"\u91CD\u547D\u540D\u9879\u76EE",projectName:"\u9879\u76EE\u540D",newProjectDlg:"\u65B0\u5EFA\u9879\u76EE",dirLabel:"\u9879\u76EE\u76EE\u5F55\uFF08\u5FC5\u987B\u662F\u5DF2\u5B58\u5728\u7684\u6587\u4EF6\u5939\uFF09",dirMissing:"\u76EE\u5F55\u4E0D\u5B58\u5728",notDir:"\u8FD9\u662F\u4E00\u4E2A\u6587\u4EF6\uFF0C\u4E0D\u662F\u76EE\u5F55",dirOk:"\u2713 \u76EE\u5F55\u53EF\u7528\uFF0C\u9879\u76EE\u540D\u53D6\u76EE\u5F55\u540D",recent:"\u6700\u8FD1\u4F7F\u7528",pickFolderUnsupported:"\u5F53\u524D\u7CFB\u7EDF\u4E0D\u652F\u6301\u5F39\u7A97\u9009\u76EE\u5F55\uFF0C\u8BF7\u624B\u52A8\u8F93\u5165",pickFolderFailed:"\u6253\u5F00\u6587\u4EF6\u5939\u9009\u62E9\u6846\u5931\u8D25",importTitle:"\u5BFC\u5165\u5DF2\u6709\u5BF9\u8BDD \u2014 {name}",scanning:"\u6B63\u5728\u626B\u63CF\u672C\u673A\u5386\u53F2\u4F1A\u8BDD\u2026",importEmpty:"\u6CA1\u6709\u627E\u5230\u5BF9\u5E94\u8FD9\u4E2A\u9879\u76EE\u76EE\u5F55\u7684\u5386\u53F2\u4F1A\u8BDD\u3002",importing:"\u5BFC\u5165\u4E2D\u2026",importN:"\u5BFC\u5165 {n} \u4E2A\u5BF9\u8BDD",importedN:"\u5DF2\u5BFC\u5165 {n} \u4E2A\u5BF9\u8BDD",failNewThread:"\u65B0\u5EFA\u5BF9\u8BDD\u5931\u8D25\uFF1A",failRename:"\u91CD\u547D\u540D\u5931\u8D25\uFF1A",failAddProject:"\u6DFB\u52A0\u9879\u76EE\u5931\u8D25\uFF1A",failImportList:"\u8BFB\u53D6\u5386\u53F2\u5931\u8D25\uFF1A",failImport:"\u5BFC\u5165\u5931\u8D25\uFF1A",failExport:"\u5BFC\u51FA\u5931\u8D25\uFF1A"},chat:{newInProject:"\u5728 {name} \u4E2D\u65B0\u5EFA\u5BF9\u8BDD",emptyHint:"\u5BF9\u8BDD\u8FD8\u6CA1\u6709\u6D88\u606F\uFF0C\u4E0B\u9762\u8F93\u5165\u5F00\u59CB\u3002",jumpBottom:"\u56DE\u5230\u5E95\u90E8",emptyPlaceholder:"\u8F93\u5165\u4EFB\u52A1\uFF0CEnter \u53D1\u9001",autoNewThread:"\u5C06\u81EA\u52A8\u65B0\u5EFA\u5BF9\u8BDD",failSend:"\u53D1\u9001\u5931\u8D25\uFF1A"},composer:{waitPerm:"\u7B49\u5F85\u4F60\u786E\u8BA4\u4E0A\u9762\u7684\u6388\u6743\u8BF7\u6C42",queuePlaceholder:"\u8F93\u5165\u6392\u961F\u6D88\u606F\uFF08Ctrl+Enter \u63D2\u8BDD\uFF09",inputPlaceholder:"\u8F93\u5165\u6D88\u606F\u2026",bypassWarn:"Bypass\uFF1AAgent \u7684\u6240\u6709\u64CD\u4F5C\u4E0D\u4F1A\u518D\u95EE\u4F60\u3002",agentModel:"Agent & model",agentLocked:"Agent (locked)",agent:"Agent",model:"Model",searchModel:"Search",searchAllModels:"Search models\u2026",providers:"Providers",agentLockedHint:"\u5DF2\u5F00\u59CB\u7684\u5BF9\u8BDD\u4E0D\u80FD\u66F4\u6362 Agent\uFF1B\u8981\u7528\u522B\u7684 Agent \u8BF7\u65B0\u5EFA\u5BF9\u8BDD\u3002",providersLoading:"\u6B63\u5728\u68C0\u6D4B Agent\u2026",moreModels:"\u8FD8\u6709 {n} \u4E2A\u6A21\u578B\uFF0C\u8BF7\u7528\u4E0A\u65B9\u641C\u7D22",pickModel:"\u9009\u62E9\u6A21\u578B",noModelMatch:"\u6CA1\u6709\u5339\u914D\u7684\u6A21\u578B",defaultModel:"Default",defaultEffort:"Default",defaultEffortNamed:"Default ({level})",effortTitle:"\u601D\u8003\u5F3A\u5EA6",attachTitle:"\u9644\u4EF6\uFF08\u56FE\u7247/\u6587\u672C\uFF09",failSwitchAgent:"\u5207\u6362 Agent \u5931\u8D25\uFF1A",failSend:"\u53D1\u9001\u5931\u8D25\uFF1A",failUpload:"\u9644\u4EF6\u4E0A\u4F20\u5931\u8D25\uFF1A",uploadFailed:"\u4E0A\u4F20\u5931\u8D25",steerTag:"\u63D2\u8BDD",cursorAutoReview:"\u81EA\u52A8\u63A5\u53D7\u6743\u9650\u63D0\u793A\uFF08Auto-review\uFF09",cursorFastOff:"\u6807\u51C6\u901F\u5EA6",cursorFastOn:"Fast",slashGroupCommand:"\u547D\u4EE4",slashGroupSkill:"Skill",slashNoCommands:"\u8BE5 Agent \u672A\u63D0\u4F9B\u547D\u4EE4",slashLoading:"\u6B63\u5728\u83B7\u53D6\u547D\u4EE4\u2026",mode:{plan:{label:"Plan Mode",desc:"\u53EA\u5206\u6790\u4EE3\u7801\u5E93\uFF0C\u4E0D\u6267\u884C\u5DE5\u5177\u6216\u4FEE\u6539"},default:{label:"Always Ask",desc:"\u9996\u6B21\u4F7F\u7528\u5DE5\u5177\u65F6\u4F1A\u8BF7\u6C42\u6388\u6743"},acceptEdits:{label:"Accept File Edits",desc:"\u81EA\u52A8\u6279\u51C6\u7F16\u8F91\u7C7B\u5DE5\u5177\uFF0C\u4E0D\u518D\u9010\u9879\u8BE2\u95EE"},bypass:{label:"Bypass",desc:"\u8DF3\u8FC7\u6240\u6709\u6388\u6743\u63D0\u793A\uFF08\u8BF7\u8C28\u614E\u4F7F\u7528\uFF09"},cursorAgent:{label:"Agent",desc:"\u5B8C\u6574 Agent\uFF1A\u53EF\u8BFB\u5199\u3001\u6267\u884C\u5DE5\u5177"},cursorPlan:{label:"Plan",desc:"\u53EA\u8BFB\u89C4\u5212\uFF1A\u5206\u6790\u5E76\u63D0\u51FA\u65B9\u6848\uFF0C\u4E0D\u6539\u6587\u4EF6"},cursorAsk:{label:"Ask",desc:"\u95EE\u7B54\u6A21\u5F0F\uFF1A\u89E3\u91CA\u4E0E\u8BA8\u8BBA\uFF0C\u53EA\u8BFB"}}},settings:{title:"\u8BBE\u7F6E",defaultAgent:"\u9ED8\u8BA4 Agent",defaultMode:"\u9ED8\u8BA4\u6743\u9650\u6A21\u5F0F",theme:"\u4E3B\u9898",themeAuto:"\u8DDF\u968F\u7CFB\u7EDF",themeLight:"\u6D45\u8272",themeDark:"\u6DF1\u8272",sendKey:"\u53D1\u9001\u952E",sendEnter:"Enter \u53D1\u9001 / Shift+Enter \u6362\u884C",sendCtrl:"Ctrl+Enter \u53D1\u9001 / Enter \u6362\u884C",runningSend:"\u8FD0\u884C\u4E2D\u518D\u53D1\u9001",queue:"\u6392\u961F\uFF08\u53D1\u5B8C\u81EA\u52A8\u7EE7\u7EED\uFF09",steer:"\u63D2\u8BDD\uFF08\u7ACB\u5373\u6253\u65AD\u5F53\u524D\u601D\u8DEF\uFF09",thinking:"\u601D\u8003\u8FC7\u7A0B",showThinking:"\u663E\u793A Agent \u7684\u601D\u8003/\u63A8\u7406\u5185\u5BB9",idleClose:"\u7A7A\u95F2\u56DE\u6536",idleMinutes:"\u5206\u949F\u540E\u81EA\u52A8\u5173\u95ED\u7A7A\u95F2\u4F1A\u8BDD",versionLine:"\u7248\u672C v{ver} \xB7 PID {pid}",dataDir:"\u6570\u636E\u76EE\u5F55\uFF1A",failSave:"\u4FDD\u5B58\u5931\u8D25\uFF1A",providers:"Providers",providerOn:"\u53EF\u7528",providerOff:"\u5DF2\u7981\u7528",providerPending:"\u5C1A\u672A\u63A5\u5165",providerVerified:"\u5DF2\u9A8C\u8BC1",providerExperimental:"\u5B9E\u9A8C\u6027",providerPlanned:"\u672A\u63A5\u5165",providerModels:"{n} \u4E2A Model",providerRedetect:"\u91CD\u65B0\u68C0\u6D4B",providerCopyHint:"\u590D\u5236\u5B89\u88C5\u63D0\u793A",providerLaunchCmd:"\u81EA\u5B9A\u4E49\u542F\u52A8\uFF08\u9AD8\u7EA7\uFF09",providerLaunchExe:"\u53EF\u6267\u884C\u6587\u4EF6\u8DEF\u5F84",providerLaunchArgs:"\u53C2\u6570\uFF08JSON \u6570\u7EC4\uFF09"},palette:{aria:"\u547D\u4EE4\u9762\u677F",placeholder:"\u641C\u7D22\u5BF9\u8BDD\u3001\u9879\u76EE\u6216\u52A8\u4F5C\u2026",noMatch:"\u6CA1\u6709\u5339\u914D\u9879",hintAction:"\u52A8\u4F5C",hintThread:"\u5BF9\u8BDD",hintProject:"\u9879\u76EE",actNewThread:"\u65B0\u5EFA\u5BF9\u8BDD",actSettings:"\u6253\u5F00\u8BBE\u7F6E",actTheme:"\u5207\u6362\u4E3B\u9898",actChanges:"\u6253\u5F00\u6539\u52A8\u9762\u677F",actFiles:"\u6253\u5F00\u6587\u4EF6\u9762\u677F",actTerminal:"\u6253\u5F00\u7EC8\u7AEF\u9762\u677F",actImport:"\u5BFC\u5165\u5DF2\u6709\u5BF9\u8BDD\u2026",failNew:"\u65B0\u5EFA\u5931\u8D25\uFF1A"},panel:{changes:"\u6539\u52A8",files:"\u6587\u4EF6",terminal:"\u7EC8\u7AEF",closeTitle:"\u5173\u95ED\uFF08Ctrl+J\uFF09",pickProject:"\u5148\u9009\u4E00\u4E2A\u9879\u76EE",notGit:"\u8FD9\u4E2A\u9879\u76EE\u4E0D\u662F git \u4ED3\u5E93",clean:"\u5DE5\u4F5C\u533A\u5E72\u51C0",branch:"\u5F53\u524D\u5206\u652F",loadingDiff:"\u52A0\u8F7D diff\u2026",diffTooLarge:"diff \u8D85\u8FC7 1MB\uFF0C\u4E0D\u663E\u793A",discardTitle:"\u653E\u5F03\u6539\u52A8",discardUntracked:`\u653E\u5F03 {path} \u7684\u6539\u52A8\uFF1F
10
+ \u672A\u8DDF\u8E2A\u6587\u4EF6\u4F1A\u88AB\u79FB\u5230\u56DE\u6536\u76EE\u5F55\uFF08trash/discarded\uFF09\uFF0C\u4E0D\u4F1A\u76F4\u63A5\u5220\u9664\u3002`,discardTracked:"\u653E\u5F03 {path} \u7684\u6539\u52A8\uFF1F\u8BE5\u6587\u4EF6\u4F1A\u6062\u590D\u5230 git \u91CC\u7684\u7248\u672C\u3002",discardBtn:"\u653E\u5F03\u6539\u52A8",failDiscard:"\u653E\u5F03\u5931\u8D25\uFF1A",closePreview:"\u5173\u95ED\u9884\u89C8",reading:"\u8BFB\u53D6\u4E2D\u2026",binary:"\u4E8C\u8FDB\u5236\u6587\u4EF6\uFF0C\u4E0D\u9884\u89C8",tooLarge:"\u8D85\u8FC7 1MB\uFF0C\u4E0D\u9884\u89C8",gitKind:{modified:"\u6539",added:"\u589E",deleted:"\u5220",untracked:"\u65B0",renamed:"\u79FB"}},terminal:{new:"\u65B0\u5EFA\u7EC8\u7AEF",noTerm:"\u8FD8\u6CA1\u6709\u7EC8\u7AEF",closeTitle:"\u5173\u95ED\u7EC8\u7AEF",closeBody:"\u5173\u95ED\u300C{title}\u300D\uFF1F\u91CC\u9762\u8FD0\u884C\u7684\u8FDB\u7A0B\u4F1A\u88AB\u7ED3\u675F\u3002",closeOk:"\u5173\u95ED",simpleNote:"\u7B80\u5316\u7EC8\u7AEF\uFF08\u65E0\u4EA4\u4E92\u7A0B\u5E8F\u652F\u6301\uFF09",ended:"\uFF08\u7EC8\u7AEF\u5DF2\u7ED3\u675F\uFF09",failNew:"\u65B0\u5EFA\u7EC8\u7AEF\u5931\u8D25\uFF1A",failKill:"\u5173\u95ED\u5931\u8D25\uFF1A"},thread:{new:"\u65B0\u5BF9\u8BDD",info:"\u5BF9\u8BDD\u4FE1\u606F",agent:"Agent",model:"\u6A21\u578B",mode:"\u6A21\u5F0F",effort:"\u601D\u8003\u5F3A\u5EA6",sessionId:"\u4F1A\u8BDD ID",tokens:"\u7D2F\u8BA1 token",cost:"\u7D2F\u8BA1\u8D39\u7528",created:"\u521B\u5EFA\u4E8E",workdir:"\u5DE5\u4F5C\u76EE\u5F55",importedFrom:"\u5BFC\u5165\u81EA",sessionNone:"\uFF08\u672A\u5EFA\u7ACB\uFF09",tokensFmt:"{in} \u5165 / {out} \u51FA / {cache} \u7F13\u5B58"},timeline:{thinking:"\u601D\u8003 {s}s",todo:"\u5F85\u529E {done}/{total}",steer:"\u63D2\u8BDD",permAllowSession:"\u672C\u5BF9\u8BDD\u90FD\u5141\u8BB8",permDenied:"\u5DF2\u62D2\u7EDD",permAllowed:"\u5DF2\u5141\u8BB8",permCancelled:"\u5DF2\u53D6\u6D88",submitted:"\u5DF2\u63D0\u4EA4\uFF1A{ans}",turnError:"\u51FA\u9519\uFF1A{err}",unknownError:"\u672A\u77E5\u9519\u8BEF",interrupted:"\u5DF2\u6253\u65AD",filesChanged:"\u6539\u52A8 {n} \u4E2A\u6587\u4EF6 \u203A",editResend:"\u7F16\u8F91\u540E\u91CD\u53D1",tool:{read:"\u8BFB\u53D6",edit:"\u4FEE\u6539",write:"\u5199\u5165",bash:"\u8FD0\u884C",search:"\u641C\u7D22",glob:"\u641C\u7D22",web:"\u8054\u7F51",task:"\u5B50\u4EFB\u52A1",mcp:"\u5DE5\u5177",todo:"\u5F85\u529E",other:"\u5DE5\u5177",processing:"\u5904\u7406"},toolSummary:"\u5DF2\u6267\u884C {n} \u6B65 \xB7 {parts}",toolRunning:"\u6B63\u5728{kind}\uFF1A{title}",showAllLines:"\u663E\u793A\u5168\u90E8 {n} \u884C",diffClip:"\uFF08\u53EA\u663E\u793A\u524D {n} \u884C\uFF09"},api:{requestFailed:"\u8BF7\u6C42\u5931\u8D25",bad_params:"\u53C2\u6570\u4E0D\u6B63\u786E",not_found:"\u672A\u627E\u5230",busy:"\u6B63\u5FD9\uFF0C\u8BF7\u7A0D\u540E\u518D\u8BD5",bad_path:"\u8DEF\u5F84\u65E0\u6548"}},en:{app:{title:"Agent Console",subtitle:"Create or select a project in the sidebar"},common:{cancel:"Cancel",ok:"OK",save:"Save",add:"Add",browse:"Browse\u2026",more:"More",copy:"Copy",copied:"Copied",copyPath:"Copy path",copiedPath:"Path copied",search:"Search",settings:"Settings",remove:"Remove",close:"Close",retry:"Retry",details:"Details \u203A",submit:"Submit",other:"Other\u2026",default:"Default",done:"Done",loading:"Loading\u2026",send:"Send",stop:"Stop",refresh:"Refresh",rename:"Rename",delete:"Delete",discard:"Discard",notInstalled:" (not installed)",notDetected:" (not detected)",current:" (current)",messages:" msgs",imported:" \xB7 imported",justNow:"Just now",minutesAgo:"{n}m ago",hoursAgo:"{n}h ago",daysAgo:"{n}d ago"},boot:{connecting:"Connecting\u2026",serviceDown:"Local service is not running",retry:"Retry",reconnecting:"Connection lost. Reconnecting\u2026",starting:"Starting local service\u2026"},topbar:{pickThread:"Select a conversation",sidebar:"Sidebar (Ctrl+B)",clickRename:"Click to rename",waitAuth:"Waiting for approval",running:"Running {s}s",error:"Error",closedResume:"Closed \xB7 send a message to resume",threadInfo:"Conversation info",panelChanges:"Changes (Ctrl+J)",panelFiles:"Files",panelTerminal:"Terminal"},sidebar:{newProject:"New project",filterPlaceholder:"Filter conversations",searchTitle:"Search (Ctrl+K)",noProjectsTitle:"No projects yet",noProjectsSub:"A project maps to a folder on this machine.",newThread:"New conversation",projectMenu:"Project menu",showAll:"Show all {n}",noThreads:"No conversations yet",rename:"Rename",pin:"Pin",unpin:"Unpin",archive:"Archive",unarchive:"Unarchive",exportMd:"Export Markdown",deleteThread:"Delete conversation",deleteThreadBody:"Move \u201C{title}\u201D to trash?",importHist:"Import existing conversations\u2026",openExplorer:"Open in Explorer",showArchived:"Show archived",hideArchived:"Hide archived",archivedN:"{n} archived",archivedHint:"Archived \u2014 see the bottom of the project list",unarchived:"Unarchived",exportSaved:"Exported to {path}",removeProject:"Remove project",removeProjectBody:"Remove \u201C{name}\u201D from the list? Conversations move to trash (files stay on disk).",renameProject:"Rename project",projectName:"Project name",newProjectDlg:"New project",dirLabel:"Project folder (must already exist)",dirMissing:"Folder does not exist",notDir:"This path is a file, not a folder",dirOk:"\u2713 Folder OK \u2014 name comes from the folder",recent:"Recent",pickFolderUnsupported:"Folder picker is not available \u2014 type the path",pickFolderFailed:"Could not open folder picker",importTitle:"Import conversations \u2014 {name}",scanning:"Scanning local history\u2026",importEmpty:"No history found for this project folder.",importing:"Importing\u2026",importN:"Import {n} conversation(s)",importedN:"Imported {n} conversation(s)",failNewThread:"Could not create conversation: ",failRename:"Rename failed: ",failAddProject:"Could not add project: ",failImportList:"Could not read history: ",failImport:"Import failed: ",failExport:"Export failed: "},chat:{newInProject:"New conversation in {name}",emptyHint:"No messages yet \u2014 type below to start.",jumpBottom:"Jump to bottom",emptyPlaceholder:"Describe a task \u2014 Enter to send",autoNewThread:"A new conversation will be created",failSend:"Send failed: "},composer:{waitPerm:"Waiting for your approval above",queuePlaceholder:"Queue a message (Ctrl+Enter to steer)",inputPlaceholder:"Message\u2026",bypassWarn:"Bypass: the agent will not ask for permission.",agentModel:"Agent & model",agentLocked:"Agent (locked after first message)",agent:"Agent",model:"Model",searchModel:"Search",searchAllModels:"Search all models\u2026",providers:"Providers",agentLockedHint:"The agent can't change after the conversation starts. Start a new conversation to use another agent.",providersLoading:"Detecting agents\u2026",moreModels:"{n} more models \u2014 use search above",pickModel:"Choose model",noModelMatch:"No matching models",defaultModel:"Default",defaultEffort:"Default",defaultEffortNamed:"Default ({level})",effortTitle:"Reasoning effort",attachTitle:"Attachments (images / text)",failSwitchAgent:"Could not switch agent: ",failSend:"Send failed: ",failUpload:"Upload failed: ",uploadFailed:"Upload failed",steerTag:"Steer",cursorAutoReview:"Auto accept permission prompts",cursorFastOff:"Off",cursorFastOn:"Fast",slashGroupCommand:"Commands",slashGroupSkill:"Skills",slashNoCommands:"This agent has no slash commands",slashLoading:"Loading commands\u2026",mode:{plan:{label:"Plan Mode",desc:"Analyze the codebase without running tools or edits"},default:{label:"Always Ask",desc:"Ask permission the first time a tool is used"},acceptEdits:{label:"Accept File Edits",desc:"Auto-approve edit tools without prompting"},bypass:{label:"Bypass",desc:"Skip all permission prompts (use with caution)"},cursorAgent:{label:"Agent",desc:"Full agent: tools and edits"},cursorPlan:{label:"Plan",desc:"Read-only planning and analysis"},cursorAsk:{label:"Ask",desc:"Q&A style explanations (read-only)"}}},settings:{title:"Settings",defaultAgent:"Default agent",defaultMode:"Default permission mode",theme:"Theme",themeAuto:"System",themeLight:"Light",themeDark:"Dark",sendKey:"Send shortcut",sendEnter:"Enter sends / Shift+Enter newline",sendCtrl:"Ctrl+Enter sends / Enter newline",runningSend:"While running",queue:"Queue (run after current turn)",steer:"Steer (interrupt now)",thinking:"Reasoning",showThinking:"Show agent reasoning/thinking",idleClose:"Idle cleanup",idleMinutes:"minutes before closing idle sessions",versionLine:"Version v{ver} \xB7 PID {pid}",dataDir:"Data: ",failSave:"Could not save: ",providers:"Providers",providerOn:"Available",providerOff:"Disabled",providerPending:"Not wired yet",providerVerified:"Verified",providerExperimental:"Experimental",providerPlanned:"Planned",providerModels:"{n} models",providerRedetect:"Re-detect",providerCopyHint:"Copy install hint",providerLaunchCmd:"Custom launch (advanced)",providerLaunchExe:"Executable path",providerLaunchArgs:"Args (JSON array)"},palette:{aria:"Command palette",placeholder:"Search conversations, projects, actions\u2026",noMatch:"No matches",hintAction:"Action",hintThread:"Conversation",hintProject:"Project",actNewThread:"New conversation",actSettings:"Open settings",actTheme:"Toggle theme",actChanges:"Open changes panel",actFiles:"Open files panel",actTerminal:"Open terminal panel",actImport:"Import existing conversations\u2026",failNew:"Could not create: "},panel:{changes:"Changes",files:"Files",terminal:"Terminal",closeTitle:"Close (Ctrl+J)",pickProject:"Select a project first",notGit:"This folder is not a git repository",clean:"Working tree clean",branch:"Current branch",loadingDiff:"Loading diff\u2026",diffTooLarge:"Diff is over 1MB \u2014 not shown",discardTitle:"Discard changes",discardUntracked:`Discard changes to {path}?
11
+ Untracked files move to trash/discarded.`,discardTracked:"Discard changes to {path}? The file reverts to the git version.",discardBtn:"Discard",failDiscard:"Discard failed: ",closePreview:"Close preview",reading:"Reading\u2026",binary:"Binary file \u2014 no preview",tooLarge:"Over 1MB \u2014 no preview",gitKind:{modified:"M",added:"A",deleted:"D",untracked:"?",renamed:"R"}},terminal:{new:"New terminal",noTerm:"No terminals yet",closeTitle:"Close terminal",closeBody:"Close \u201C{title}\u201D? Running processes will be killed.",closeOk:"Close",simpleNote:"Simple terminal (no full TTY programs)",ended:"(Terminal ended)",failNew:"Could not create terminal: ",failKill:"Could not close: "},thread:{new:"New chat",info:"Conversation info",agent:"Agent",model:"Model",mode:"Mode",effort:"Effort",sessionId:"Session ID",tokens:"Total tokens",cost:"Total cost",created:"Created",workdir:"Working directory",importedFrom:"Imported from",sessionNone:"(none)",tokensFmt:"{in} in / {out} out / {cache} cache"},timeline:{thinking:"Thinking {s}s",todo:"Todos {done}/{total}",steer:"Steer",permAllowSession:"Allowed for this chat",permDenied:"Denied",permAllowed:"Allowed",permCancelled:"Cancelled",submitted:"Submitted: {ans}",turnError:"Error: {err}",unknownError:"Unknown error",interrupted:"Interrupted",filesChanged:"{n} file(s) changed \u203A",editResend:"Edit and resend",tool:{read:"Read",edit:"Edit",write:"Write",bash:"Run",search:"Search",glob:"Search",web:"Web",task:"Subtask",mcp:"Tool",todo:"Todo",other:"Tool",processing:"Working"},toolSummary:"{n} step(s) \xB7 {parts}",toolRunning:"{kind}: {title}",showAllLines:"Show all {n} lines",diffClip:"(first {n} lines only)"},api:{requestFailed:"Request failed",bad_params:"Invalid parameters",not_found:"Not found",busy:"Busy \u2014 try again later",bad_path:"Invalid path"}}}});function kE(e){let t=String(e??"").trim().toLowerCase();return t?t==="zh"||t.startsWith("zh-")?"zh":"en":m2()}function m2(){let e=typeof navigator<"u"?navigator.language:"";return kE(e||"zh")}function TE(e){let t=new URLSearchParams(e).get("lang");Ca=kE(t);let i=Ca==="zh"?"zh-CN":"en";return typeof document<"u"&&(document.documentElement.lang=i),Ca}function Ed(){return Ca}function xd(){return Ca==="zh"?"zh-CN":"en-US"}function CE(e,t){let i=t.split("."),n=e;for(let s of i){if(typeof n!="object"||n==null||!(s in n))return;n=n[s]}return typeof n=="string"?n:void 0}function w(e){return CE(r_[Ca],e)??CE(r_.en,e)??e}function Te(e,t){let i=w(e);for(let[n,s]of Object.entries(t))i=i.replaceAll(`{${n}}`,String(s));return i}function ht(e){let t=e,i=t?.code;if(i){let s=w(`api.${i}`);if(s!==`api.${i}`)return s}let n=String(t?.message??e);return ka(n)}function ka(e){if(Ca==="zh")return e;if(e==="\u540E\u53F0\u5DF2\u91CD\u542F\uFF0C\u672C\u8F6E\u5DF2\u4E2D\u65AD")return"Daemon restarted \u2014 this turn was interrupted";if(e.startsWith("\u4F1A\u8BDD\u542F\u52A8\u5931\u8D25\uFF1A"))return"Session start failed: "+e.slice(7);if(e.startsWith("\u53D1\u9001\u5931\u8D25\uFF1A"))return"Send failed: "+e.slice(5);if(e==="Agent \u8FDB\u7A0B\u610F\u5916\u9000\u51FA")return"Agent process exited unexpectedly";let t=e.match(/^附件不存在或已失效((.+)),请重新上传$/);return t?`Attachment missing or expired (${t[1]}) \u2014 upload again`:e}function Cd(e,t){return t&&(e==="\u65B0\u5BF9\u8BDD"||e==="New chat")?w("thread.new"):e}var Ca,wi=ce(()=>{xE();Ca="zh"});var kd,NE=ce(()=>{wi();kd=class{constructor(t,i="zh"){he(this,"token",t);he(this,"lang",i);he(this,"ws",null);he(this,"seq",0);he(this,"pending",new Map);he(this,"subs",new Map);he(this,"binHandlers",[]);he(this,"stateListeners",new Set);he(this,"state","connecting");he(this,"retry",0);he(this,"closed",!1);he(this,"helloOk",null);he(this,"helloWaiters",[])}onState(t){return this.stateListeners.add(t),t(this.state),()=>this.stateListeners.delete(t)}getState(){return this.state}setState(t){this.state=t;for(let i of this.stateListeners)i(t)}connect(){if(this.closed)return;this.setState(this.retry===0?"connecting":"reconnecting");let t=new WebSocket(`ws://${location.host}/ws`);t.binaryType="arraybuffer",this.ws=t,t.onopen=()=>{t.send(JSON.stringify({t:"hello",token:this.token,v:1,lang:this.lang}))},t.onmessage=i=>{if(typeof i.data!="string"){this.onBinary(new Uint8Array(i.data));return}let n;try{n=JSON.parse(i.data)}catch{return}if(n.t==="hello.ok"){this.retry=0,this.helloOk=n,this.setState("open");let s=this.helloWaiters.splice(0);for(let r of s)r(n);for(let[r,a]of this.subs)this.call("sub.add",{ch:r,afterSeq:a.afterSeq?.()}).catch(()=>{});return}if(n.t==="res"){let s=n.id,r=this.pending.get(s);if(r)if(this.pending.delete(s),clearTimeout(r.timer),n.ok)r.res(n.r);else{let a=n.e,o=new Error(a?.message??w("api.requestFailed"));o.code=a?.code,r.rej(o)}return}if(n.t==="evt"){this.subs.get(n.ch)?.handler(n.ch,n.d);return}},t.onclose=()=>{this.ws=null;for(let[n,s]of this.pending)clearTimeout(s.timer),s.rej(new Error("\u8FDE\u63A5\u4E2D\u65AD")),this.pending.delete(n);if(this.closed)return;this.retry++;let i=Math.min(1e3*Math.pow(2,this.retry-1),1e4);this.setState(this.retry>20?"down":"reconnecting"),setTimeout(()=>this.connect(),i)},t.onerror=()=>{}}waitHello(){return this.helloOk?Promise.resolve(this.helloOk):new Promise(t=>this.helloWaiters.push(t))}call(t,i,n=6e4){return new Promise((s,r)=>{let a=this.ws;if(!a||a.readyState!==WebSocket.OPEN){r(new Error("\u8FDE\u63A5\u672A\u5EFA\u7ACB"));return}let o=++this.seq,l=setTimeout(()=>{this.pending.delete(o),r(new Error("\u8BF7\u6C42\u8D85\u65F6"))},n);this.pending.set(o,{res:s,rej:r,timer:l}),a.send(JSON.stringify({t:"req",id:o,m:t,p:i??{}}))})}subscribe(t,i,n){return this.subs.set(t,{handler:i,afterSeq:n}),this.state==="open"&&this.call("sub.add",{ch:t,afterSeq:n?.()}).catch(()=>{}),()=>{this.subs.delete(t),this.state==="open"&&this.call("sub.remove",{ch:t}).catch(()=>{})}}onBinaryFrame(t){return this.binHandlers.push(t),()=>{this.binHandlers=this.binHandlers.filter(i=>i!==t)}}onBinary(t){if(t.length<3)return;let i=t[0],n=t[1]<<8|t[2];for(let s of this.binHandlers)s(i,n,t.subarray(3))}sendBinary(t,i,n){let s=this.ws;if(!s||s.readyState!==WebSocket.OPEN)return;let r=new Uint8Array(3+n.length);r[0]=t,r[1]=i>>8&255,r[2]=i&255,r.set(n,3),s.send(r)}ping(){try{this.ws?.send(JSON.stringify({t:"ping"}))}catch{}}close(){this.closed=!0,this.ws?.close()}}});var AE,ME,a_=ce(()=>{AE=e=>{let t,i=new Set,n=(c,u)=>{let h=typeof c=="function"?c(t):c;if(!Object.is(h,t)){let d=t;t=u??(typeof h!="object"||h===null)?h:Object.assign({},t,h),i.forEach(f=>f(t,d))}},s=()=>t,o={setState:n,getState:s,getInitialState:()=>l,subscribe:c=>(i.add(c),()=>i.delete(c))},l=t=e(n,s,o);return o},ME=(e=>e?AE(e):AE)});function _2(e,t=g2){let i=Td.default.useSyncExternalStore(e.subscribe,Td.default.useCallback(()=>t(e.getState()),[e,t]),()=>t(e.getInitialState()));return Td.default.useDebugValue(i),i}var Td,g2,OE,ps,RE=ce(()=>{Td=ae(Mt(),1);a_();g2=e=>e;OE=e=>{let t=ME(e),i=n=>_2(t,n);return Object.assign(i,t),i},ps=(e=>e?OE(e):OE)});var rl=ce(()=>{a_();RE()});var ms,Pc=ce(()=>{rl();ms=ps(e=>({state:"connecting",version:null,set:t=>e(t)}))});function Ta(e,t=window.innerWidth){if(t<900)return l_;let i=e.sbHidden?0:e.sidebarWidth;return al(t-i-LE-DE,Ir,l_)}function ol(e,t=window.innerWidth){if(t<760)return o_;let i=e.panelOpen?e.panelWidth:0;return al(t-i-LE-DE,Na,o_)}function Nd(e,t=window.innerWidth){let i=al(e.sidebarWidth,Na,ol(e,t)),n=al(e.panelWidth,Ir,Ta({...e,sidebarWidth:i},t));return i=al(i,Na,ol({...e,sidebarWidth:i,panelWidth:n},t)),n=al(n,Ir,Ta({...e,sidebarWidth:i,panelWidth:n},t)),{sidebarWidth:i,panelWidth:n}}var DE,LE,al,c_=ce(()=>{ln();DE=300,LE=10,al=(e,t,i)=>Math.max(t,Math.min(i,e))});function Aa(e,t){let i=e().ws;i&&i.call("settings.set",{patch:t}).catch(()=>{})}var Na,o_,Ir,l_,u_,fe,ln=ce(()=>{rl();c_();Na=200,o_=360,Ir=320,l_=900,u_=(e,t,i)=>Math.max(t,Math.min(i,e));fe=ps((e,t)=>({ws:null,sidebarWidth:248,sbHidden:!1,sbOpen:!1,panelOpen:!1,panelTab:"changes",panelWidth:440,collapsed:{},currentProjectId:null,currentThreadId:null,bind:i=>e({ws:i}),hydrate:i=>{let n={};for(let a of i.collapsedProjects??[])n[a]=!0;let s={sidebarWidth:i.sidebarWidth??248,panelWidth:i.panel?.width??440,panelOpen:i.panel?.open??!1,sbHidden:!1},r=Nd(s);e({sidebarWidth:r.sidebarWidth,panelOpen:s.panelOpen,panelTab:i.panel?.tab??"changes",panelWidth:r.panelWidth,collapsed:n,currentProjectId:i.lastProjectId??null,currentThreadId:i.lastThreadId??null})},setSidebarWidth:i=>{let n=t(),s=ol(n);i=u_(Math.round(i),Na,s),e({sidebarWidth:i}),Aa(t,{sidebarWidth:i})},setPanelWidth:i=>{let n=t(),s=Ta(n);i=u_(Math.round(i),Ir,s),e({panelWidth:i}),Aa(t,{panel:{open:t().panelOpen,tab:t().panelTab,width:i}})},openPanel:i=>{let n=i??t().panelTab,s=t(),r=u_(s.panelWidth,Ir,Ta({...s,panelOpen:!0}));e({panelOpen:!0,panelTab:n,panelWidth:r}),Aa(t,{panel:{open:!0,tab:n,width:r}})},closePanel:()=>{e({panelOpen:!1}),Aa(t,{panel:{open:!1,tab:t().panelTab,width:t().panelWidth}})},setPanelTab:i=>{e({panelTab:i}),Aa(t,{panel:{open:t().panelOpen,tab:i,width:t().panelWidth}})},toggleSidebarHidden:()=>e(i=>({sbHidden:!i.sbHidden})),setSbOpen:i=>e({sbOpen:i}),toggleCollapsed:i=>{let n={...t().collapsed};n[i]?delete n[i]:n[i]=!0,e({collapsed:n}),Aa(t,{collapsedProjects:Object.keys(n)})},select:(i,n)=>{e({currentProjectId:i,currentThreadId:n,sbOpen:!1}),Aa(t,{lastProjectId:i,lastThreadId:n})},reconcileSelection:(i,n)=>{let{currentProjectId:s,currentThreadId:r}=t();if(i.length===0){(s||r)&&t().select(null,null);return}let a=s;(!a||!i.some(l=>l.id===a))&&(a=null);let o=r;if(o){let l=n.find(c=>c.id===o);!l||!i.some(c=>c.id===l.projectId)||a&&l.projectId!==a?o=null:a||(a=l.projectId)}(a!==s||o!==r)&&t().select(a,o)}}))});async function ll(){let e="claude";try{e=(await lt.getState().ws.call("settings.get")).defaultProvider??"claude"}catch{}let t=lt.getState().providers;return t.length?t.find(i=>i.id===e&&BE(i))?.id??t.find(i=>BE(i))?.id??e:e}function BE(e){return e.enabled===!1||!e.available||e.status==="planned"?!1:e.status==="verified"||e.status==="experimental"?!0:e.ready!==!1}var lt,qn=ce(()=>{rl();ln();lt=ps((e,t)=>({ws:null,loaded:!1,projects:[],threads:[],providers:[],bind:async i=>{if(t().ws===i&&t().loaded)return;e({ws:i}),i.subscribe("sidebar",(l,c)=>{let u=c;!u||typeof u!="object"||(u.type==="project.upsert"?t().upsertProject(u.project):u.type==="project.remove"?(e({projects:t().projects.filter(h=>h.id!==u.id)}),fe.getState().reconcileSelection(t().projects,t().threads)):u.type==="thread.upsert"?t().upsertThread(u.thread):u.type==="thread.remove"&&(e({threads:t().threads.filter(h=>h.id!==u.id)}),fe.getState().reconcileSelection(t().projects,t().threads)))}),i.call("providers.list").then(l=>e({providers:l})).catch(()=>{});let[n,s]=await Promise.all([i.call("projects.list"),i.call("threads.list")]),r=t(),a=new Map(n.map(l=>[l.id,l]));for(let l of r.projects)a.set(l.id,l);let o=new Map(s.map(l=>[l.id,l]));for(let l of r.threads)o.set(l.id,l);e({projects:[...a.values()].sort((l,c)=>l.createdAt-c.createdAt),threads:[...o.values()],loaded:!0}),fe.getState().reconcileSelection(t().projects,t().threads)},upsertProject:i=>{let n=t().projects.filter(s=>s.id!==i.id);e({projects:[...n,i].sort((s,r)=>s.createdAt-r.createdAt)})},upsertThread:i=>{let n=t().threads.filter(s=>s.id!==i.id);e({threads:[...n,i]})}}))});var zE=me(Ad=>{"use strict";var v2=Symbol.for("react.transitional.element"),b2=Symbol.for("react.fragment");function IE(e,t,i){var n=null;if(i!==void 0&&(n=""+i),t.key!==void 0&&(n=""+t.key),"key"in t){i={};for(var s in t)s!=="key"&&(i[s]=t[s])}else i=t;return t=i.ref,{$$typeof:v2,type:e,key:n,ref:t!==void 0?t:null,props:i}}Ad.Fragment=b2;Ad.jsx=IE;Ad.jsxs=IE});var Le=me((RP,PE)=>{"use strict";PE.exports=zE()});function HE(e){let[t,i]=(0,wt.useState)(()=>window.matchMedia?.(e).matches??!1);return(0,wt.useEffect)(()=>{let n=window.matchMedia?.(e);if(!n)return;let s=()=>i(n.matches);return n.addEventListener?.("change",s),s(),()=>n.removeEventListener?.("change",s)},[e]),t}function FE(e,t,i){let n=(0,wt.useRef)(0),s=(0,wt.useRef)(0),[r,a]=(0,wt.useState)(!1),o=(0,wt.useCallback)(l=>{l.preventDefault(),n.current=l.clientX,s.current=e(),a(!0),document.body.classList.add("col-drag");let c=h=>t(s.current,h.clientX-n.current),u=()=>{window.removeEventListener("pointermove",c),window.removeEventListener("pointerup",u),document.body.classList.remove("col-drag"),a(!1),i()};window.addEventListener("pointermove",c),window.addEventListener("pointerup",u)},[e,t,i]);return{drag:r,down:o}}function qE({sidebar:e,topbar:t,children:i,panel:n}){let s=fe(),r=HE("(max-width: 759px)"),a=HE("(max-width: 899px)"),o=(0,wt.useRef)(!1),l=(0,wt.useRef)(!1),c=FE((0,wt.useCallback)(()=>fe.getState().sidebarWidth,[]),(0,wt.useCallback)((d,f)=>{o.current=!0;let p=fe.getState(),_=ol(p);fe.setState({sidebarWidth:UE(Math.round(d+f),Na,_)})},[]),(0,wt.useCallback)(()=>{o.current&&(o.current=!1,fe.getState().setSidebarWidth(fe.getState().sidebarWidth))},[])),u=FE((0,wt.useCallback)(()=>fe.getState().panelWidth,[]),(0,wt.useCallback)((d,f)=>{l.current=!0;let p=fe.getState(),_=Ta(p);fe.setState({panelWidth:UE(Math.round(d-f),Ir,_)})},[]),(0,wt.useCallback)(()=>{l.current&&(l.current=!1,fe.getState().setPanelWidth(fe.getState().panelWidth))},[]));(0,wt.useEffect)(()=>{let d=f=>{if(!(f.ctrlKey||f.metaKey))return;let p=f.key.toLowerCase();if(p==="b"){f.preventDefault();let _=fe.getState();window.matchMedia("(max-width: 759px)").matches?_.setSbOpen(!_.sbOpen):_.toggleSidebarHidden()}else if(p==="j"){f.preventDefault();let _=fe.getState();_.panelOpen?_.closePanel():_.openPanel()}};return window.addEventListener("keydown",d),()=>window.removeEventListener("keydown",d)},[]),(0,wt.useEffect)(()=>{document.documentElement.style.setProperty("--sb-w",`${s.sidebarWidth}px`)},[s.sidebarWidth]),(0,wt.useEffect)(()=>{document.documentElement.style.setProperty("--pn-w",`${s.panelWidth}px`)},[s.panelWidth]),(0,wt.useEffect)(()=>{let d=()=>{let f=fe.getState(),p=Nd(f);p.sidebarWidth!==f.sidebarWidth&&fe.getState().setSidebarWidth(p.sidebarWidth),p.panelWidth!==f.panelWidth&&fe.getState().setPanelWidth(p.panelWidth)};return window.addEventListener("resize",d),d(),()=>window.removeEventListener("resize",d)},[]);let h=s.sbOpen||s.panelOpen&&a;return(0,Ws.jsxs)("div",{className:"app",children:[(0,Ws.jsx)("aside",{className:`sidebar${s.sbHidden&&!r?" w-hide":""}${s.sbOpen?" open":""}`,children:e}),(0,Ws.jsx)("div",{className:`rs rs-l${c.drag?" drag":""}`,onPointerDown:c.down}),(0,Ws.jsxs)("main",{className:"main",children:[t,i]}),(0,Ws.jsx)("div",{className:`rs rs-r${u.drag?" drag":""}`,onPointerDown:u.down}),(0,Ws.jsx)("section",{className:`panel${s.panelOpen?" open":" w-hide"}`,"aria-hidden":!s.panelOpen,children:n}),(0,Ws.jsx)("div",{className:`scrim${h?" show":""}`,onClick:()=>{fe.getState().setSbOpen(!1),fe.getState().panelOpen&&a&&fe.getState().closePanel()}})]})}var wt,Ws,UE,KE=ce(()=>{wt=ae(Mt(),1);ln();c_();Ws=ae(Le(),1),UE=(e,t,i)=>Math.max(t,Math.min(i,e))});function kn(e){return!!e.isComposing||e.keyCode===229}var cl=ce(()=>{});function h_(e,t=Date.now()){let i=Math.max(0,t-e),n=Math.floor(i/6e4);if(n<1)return w("common.justNow");if(n<60)return Te("common.minutesAgo",{n});let s=Math.floor(n/60);if(s<24)return Te("common.hoursAgo",{n:s});let r=Math.floor(s/24);if(r<7)return Te("common.daysAgo",{n:r});let a=new Date(e),o=xd();return Ed()==="zh"?`${a.getMonth()+1}/${a.getDate()}`:a.toLocaleDateString(o,{month:"short",day:"numeric"})}function ul(e){return e>=1e3?`${(e/1e3).toFixed(1)}k`:String(e)}function Md(e){return`$${e.toFixed(2)}`}function d_(e){let t=Math.round(e/1e3);return t<60?`${t}s`:`${Math.floor(t/60)}m${t%60?` ${t%60}s`:""}`}var Od=ce(()=>{wi()});function Uc({x:e,y:t,items:i,onClose:n}){let s=(0,Gs.useRef)(null),[r,a]=(0,Gs.useState)({left:e,top:t});return(0,Gs.useLayoutEffect)(()=>{let o=s.current;if(!o)return;let l=o.getBoundingClientRect(),{left:c,top:u}=r;c+l.width>window.innerWidth-8&&(c=Math.max(8,window.innerWidth-l.width-8)),u+l.height>window.innerHeight-8&&(u=Math.max(8,window.innerHeight-l.height-8)),(c!==r.left||u!==r.top)&&a({left:c,top:u})},[e,t]),(0,Gs.useEffect)(()=>{let o=c=>{s.current&&!s.current.contains(c.target)&&n()},l=c=>{c.key==="Escape"&&(c.stopPropagation(),n())};return window.addEventListener("pointerdown",o,!0),window.addEventListener("keydown",l,!0),()=>{window.removeEventListener("pointerdown",o,!0),window.removeEventListener("keydown",l,!0)}},[n]),(0,WE.createPortal)((0,zr.jsx)("div",{ref:s,className:"menu",style:r,role:"menu",children:i.map((o,l)=>o.kind==="sep"?(0,zr.jsx)("div",{className:"msep"},l):o.kind==="label"?(0,zr.jsx)("div",{className:"mlabel",children:o.text},l):(0,zr.jsxs)("button",{className:`mi${o.danger?" danger":""}`,disabled:o.disabled,role:"menuitem",onClick:()=>{n(),o.onClick()},children:[(0,zr.jsx)("span",{children:o.label}),o.checked&&(0,zr.jsx)("span",{className:"mi-check",children:"\u2713"})]},l))}),document.body)}function Hc(){let[e,t]=(0,Gs.useState)(null);return[e,n=>{n.preventDefault(),n.stopPropagation(),t({x:n.clientX,y:n.clientY})},()=>t(null)]}var Gs,WE,zr,f_=ce(()=>{Gs=ae(Mt(),1),WE=ae(co(),1),zr=ae(Le(),1)});function gs({title:e,children:t,footer:i,onClose:n,wide:s}){return(0,GE.useEffect)(()=>{let r=a=>{a.key==="Escape"&&(a.stopPropagation(),n())};return window.addEventListener("keydown",r,!0),()=>window.removeEventListener("keydown",r,!0)},[n]),(0,$E.createPortal)((0,Yi.jsx)("div",{className:"dlg-scrim",onPointerDown:r=>{r.target===r.currentTarget&&n()},children:(0,Yi.jsxs)("div",{className:"dlg",style:s?{width:560}:void 0,role:"dialog","aria-label":e,children:[(0,Yi.jsx)("div",{className:"dlg-title",children:e}),(0,Yi.jsx)("div",{className:"dlg-body",children:t}),i&&(0,Yi.jsx)("div",{className:"dlg-foot",children:i})]})}),document.body)}function hl({title:e,body:t,okLabel:i,danger:n,onOk:s,onClose:r}){let a=i??w("common.ok");return(0,Yi.jsx)(gs,{title:e,onClose:r,footer:(0,Yi.jsxs)(Yi.Fragment,{children:[(0,Yi.jsx)("button",{className:"btn ghost",onClick:r,children:w("common.cancel")}),(0,Yi.jsx)("button",{className:`btn${n?" danger":" primary"}`,onClick:()=>{r(),s()},children:a})]}),children:(0,Yi.jsx)("div",{className:"dlg-hint",style:{fontSize:"var(--fs-m)",color:"var(--fg)"},children:t})})}var GE,$E,Yi,dl=ce(()=>{GE=ae(Mt(),1),$E=ae(co(),1);wi();Yi=ae(Le(),1)});function Me({name:e,size:t=16}){let i=y2[e];return i?(0,p_.jsx)("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:(0,p_.jsx)("path",{d:i})}):null}var p_,y2,Pr=ce(()=>{p_=ae(Le(),1),y2={plus:"M12 5v14M5 12h14",search:"M11 4a7 7 0 1 0 0 14 7 7 0 0 0 0-14Zm10 17-4.5-4.5",caret:"M9 6l6 6-6 6",dots:"M5 12h.01M12 12h.01M19 12h.01",pin:"M9 4h6l1 7 3 3v2H5v-2l3-3 1-7Zm3 12v4",send:"M4 12 20 4l-4 8 4 8-16-8Zm0 0h8",stop:"M7 7h10v10H7z",attach:"M8 12l6-6a3.5 3.5 0 0 1 5 5l-7 7a5 5 0 0 1-7-7l6-6",menu:"M4 6h16M4 12h16M4 18h16",changes:"M7 4v13m0 0a3 3 0 1 0 .01 0M7 17a3 3 0 1 1-.01 0M17 7v13m0-13a3 3 0 1 0 .01 0M17 7a3 3 0 1 1-.01 0",files:"M4 4h6l2 3h8v13H4V4Z",term:"M4 5h16v14H4zM7 9l3 3-3 3m5 0h5",x:"M6 6l12 12M18 6 6 18",refresh:"M20 11a8 8 0 1 0-2.3 6.3M20 5v6h-6",copy:"M8 8h11v12H8zM5 16V4h11",check:"M5 13l4 4L19 7",shield:"M12 3l8 3v6c0 5-3.5 9-8 11-4.5-2-8-6-8-11V6l8-3z",zap:"M13 2L4 14h7l-1 8 9-12h-7l1-8z",settings:"M12 15a3 3 0 1 0 0-6 3 3 0 0 0 0 6zM19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 1 1-2.83 2.83l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 1 1-4 0v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 1 1-2.83-2.83l.06-.06A1.65 1.65 0 0 0 4.68 15a1.65 1.65 0 0 0-1.51-1H3a2 2 0 1 1 0-4h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 1 1 2.83-2.83l.06.06A1.65 1.65 0 0 0 9 4.68a1.65 1.65 0 0 0 1-1.51V3a2 2 0 1 1 4 0v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 1 1 2.83 2.83l-.06.06A1.65 1.65 0 0 0 19.4 9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 1 1 0 4h-.09a1.65 1.65 0 0 0-1.51 1z"}});function jE(){let e=YE(t=>t.list);return e.length===0?null:(0,m_.jsx)("div",{className:"toasts",children:e.map(t=>(0,m_.jsx)("div",{className:`toast${t.err?" err":""}`,children:t.text},t.id))})}var m_,S2,YE,Pe,_s=ce(()=>{rl();m_=ae(Le(),1),S2=0,YE=ps(e=>({list:[],push:(t,i)=>{let n=++S2;e(s=>({list:[...s.list,{id:n,text:t,err:i}]})),setTimeout(()=>e(s=>({list:s.list.filter(r=>r.id!==n)})),3500)}})),Pe=(e,t=!1)=>YE.getState().push(e,t)});function w2(e,t){return t.has(e.id)?"dot wait":e.status==="running"||e.status==="initializing"?"dot run":e.status==="error"||e.lastTurnStatus==="failed"?"dot err":"dot"}function XE({pendingByThread:e}){let{projects:t,threads:i}=lt(),n=fe(),[s,r]=(0,Ye.useState)(""),[a,o]=(0,Ye.useState)({}),[l,c]=(0,Ye.useState)({}),[u,h]=(0,Ye.useState)(null),[d,f]=(0,Ye.useState)(""),[p,_]=(0,Ye.useState)(!1),[v,g]=(0,Ye.useState)(null),[m,b]=(0,Ye.useState)(null),[S,x]=(0,Ye.useState)(null),[C,N,M]=Hc(),[O,q,G]=Hc(),I=(0,Ye.useRef)({}),P=(0,Ye.useRef)(null);(0,Ye.useEffect)(()=>{let L=Ce=>{let ue=Ce.detail?.projectId,Ue=t.find(Q=>Q.id===ue)??t[0];Ue&&g(Ue)},ee=()=>_(!0);return window.addEventListener("open-import",L),window.addEventListener("open-new-project",ee),()=>{window.removeEventListener("open-import",L),window.removeEventListener("open-new-project",ee)}},[t]);let R=(0,Ye.useMemo)(()=>{let L=s.trim().toLowerCase();return L?i.filter(ee=>ee.title.toLowerCase().includes(L)):i},[i,s]),K=(0,Ye.useMemo)(()=>{let L=new Map;for(let ee of R)(!ee.archived||a[ee.projectId])&&(L.get(ee.projectId)??L.set(ee.projectId,[]).get(ee.projectId)).push(ee);for(let ee of L.values())ee.sort((Ce,ue)=>Number(Ce.archived)-Number(ue.archived)||Number(ue.pinned)-Number(Ce.pinned)||ue.updatedAt-Ce.updatedAt);return L},[R,a]),T=(0,Ye.useMemo)(()=>{let L=new Map;for(let ee of R)ee.archived&&L.set(ee.projectId,(L.get(ee.projectId)??0)+1);return L},[R]);async function D(L){try{let ee=await x2(),Ce=await ll(),ue=await te.call("threads.create",{projectId:L,provider:Ce,model:null,mode:ee.defaultMode??"default",effort:ee.defaultEffort??null});n.select(L,ue.id)}catch(ee){Pe(w("sidebar.failNewThread")+ht(ee),!0)}}function A(L){return[{kind:"item",label:w("common.rename"),onClick:()=>{h(L.id),f(L.title)}},{kind:"item",label:L.pinned?w("sidebar.unpin"):w("sidebar.pin"),onClick:()=>{te.call("threads.update",{id:L.id,pinned:!L.pinned})}},{kind:"item",label:L.archived?w("sidebar.unarchive"):w("sidebar.archive"),onClick:()=>{Z(L)}},{kind:"item",label:w("sidebar.exportMd"),onClick:()=>{T2(L)}},{kind:"sep"},{kind:"item",label:w("common.delete"),danger:!0,onClick:()=>b({title:w("sidebar.deleteThread"),body:Te("sidebar.deleteThreadBody",{title:L.title}),onOk:()=>{te.call("threads.delete",{id:L.id})}})}]}async function Z(L){try{await te.call("threads.update",{id:L.id,archived:!L.archived}),L.archived?Pe(w("sidebar.unarchived")):(o(ee=>({...ee,[L.projectId]:!0})),Pe(w("sidebar.archivedHint")))}catch(ee){Pe(ht(ee),!0)}}function re(L){return[{kind:"item",label:w("sidebar.newThread"),onClick:()=>{D(L.id)}},{kind:"item",label:w("sidebar.importHist"),onClick:()=>g(L)},{kind:"item",label:w("common.rename"),onClick:()=>x(L)},{kind:"item",label:w("sidebar.openExplorer"),onClick:()=>{te.call("projects.open",{id:L.id})}},{kind:"sep"},{kind:"item",label:a[L.id]?w("sidebar.hideArchived"):w("sidebar.showArchived"),onClick:()=>o(ee=>({...ee,[L.id]:!ee[L.id]}))},{kind:"sep"},{kind:"item",label:w("sidebar.removeProject"),danger:!0,onClick:()=>b({title:w("sidebar.removeProject"),body:Te("sidebar.removeProjectBody",{name:L.name}),onOk:()=>{te.call("projects.remove",{id:L.id})}})}]}return(0,j.jsxs)(j.Fragment,{children:[(0,j.jsxs)("div",{className:"sb-row",children:[(0,j.jsxs)("button",{className:"sb-new",onClick:()=>_(!0),children:[(0,j.jsx)(Me,{name:"plus"})," ",w("sidebar.newProject")]}),(0,j.jsx)("button",{className:"ibtn",title:w("common.settings"),onClick:()=>window.dispatchEvent(new CustomEvent("open-settings")),children:(0,j.jsx)(Me,{name:"settings"})}),(0,j.jsx)("button",{className:"ibtn",title:w("sidebar.searchTitle"),onClick:()=>P.current?.focus(),children:(0,j.jsx)(Me,{name:"search"})})]}),(0,j.jsx)("div",{className:"sb-row",style:{height:32,paddingTop:0},children:(0,j.jsx)("div",{className:"sb-search",children:(0,j.jsx)("input",{ref:P,placeholder:w("sidebar.filterPlaceholder"),value:s,onChange:L=>r(L.target.value),onKeyDown:L=>{L.key==="Escape"&&r("")}})})}),(0,j.jsxs)("div",{className:"sb-list",children:[t.length===0&&(0,j.jsxs)("div",{className:"sb-start",children:[(0,j.jsx)("div",{className:"sb-start-t",children:w("sidebar.noProjectsTitle")}),(0,j.jsx)("div",{className:"sb-start-s",children:w("sidebar.noProjectsSub")}),(0,j.jsx)("button",{className:"btn primary",onClick:()=>_(!0),children:w("sidebar.newProject")})]}),t.map(L=>{let ee=K.get(L.id)??[],Ce=n.collapsed[L.id],ue=T.get(L.id)??0,Ue=l[L.id]?ee:ee.slice(0,VE);return(0,j.jsxs)("div",{className:"pj-group",children:[(0,j.jsxs)("div",{className:"pj",onContextMenu:Q=>{I.current.project=L,N(Q)},children:[(0,j.jsxs)("button",{className:"pj-toggle",onClick:()=>n.toggleCollapsed(L.id),children:[(0,j.jsx)("span",{className:`pj-caret${Ce?"":" open"}`,children:(0,j.jsx)(Me,{name:"caret"})}),(0,j.jsx)("span",{className:"pj-badge",children:L.name.slice(0,1)}),(0,j.jsx)("span",{className:"pj-name",children:L.name})]}),(0,j.jsx)("span",{className:"pj-count",children:ee.length||""}),(0,j.jsx)("button",{className:"pj-act",title:w("sidebar.newThread"),onClick:()=>{D(L.id)},children:(0,j.jsx)(Me,{name:"plus"})}),(0,j.jsx)("button",{className:"pj-act",title:w("sidebar.projectMenu"),onClick:Q=>{I.current.project=L,N(Q)},children:(0,j.jsx)(Me,{name:"dots"})})]}),!Ce&&(0,j.jsxs)("div",{className:"pj-sessions",children:[Ue.map(Q=>u===Q.id?(0,j.jsx)("div",{className:"t-item",children:(0,j.jsx)("input",{className:"t-rename",autoFocus:!0,value:d,onChange:Oe=>f(Oe.target.value),onBlur:()=>h(null),onKeyDown:Oe=>{Oe.key==="Enter"&&!kn(Oe.nativeEvent)&&d.trim()?(te.call("threads.update",{id:Q.id,title:d.trim()}),h(null)):Oe.key==="Escape"&&h(null)}})},Q.id):(0,j.jsxs)("button",{className:`t-item${n.currentThreadId===Q.id?" on":""}${Q.archived?" archived":""}`,onClick:()=>n.select(L.id,Q.id),onContextMenu:Oe=>{I.current.thread=Q,q(Oe)},children:[(0,j.jsx)("span",{className:w2(Q,e)}),Q.pinned&&(0,j.jsx)("span",{className:"t-pin",children:(0,j.jsx)(Me,{name:"pin"})}),(0,j.jsx)("span",{className:"t-title",children:Cd(Q.title,Q.titleAuto)}),(0,j.jsx)("span",{className:"t-time",children:h_(Q.updatedAt)}),(0,j.jsx)("span",{className:"t-more",role:"button",onClick:Oe=>{Oe.stopPropagation(),I.current.thread=Q,q(Oe)},children:(0,j.jsx)(Me,{name:"dots"})})]},Q.id)),ee.length>VE&&!l[L.id]&&(0,j.jsx)("button",{className:"pj-more",onClick:()=>c(Q=>({...Q,[L.id]:!0})),children:Te("sidebar.showAll",{n:ee.length})}),ue>0&&(0,j.jsx)("button",{className:"pj-more",onClick:()=>o(Q=>({...Q,[L.id]:!Q[L.id]})),children:a[L.id]?w("sidebar.hideArchived"):Te("sidebar.archivedN",{n:ue})}),ee.length===0&&ue===0&&(0,j.jsx)("div",{className:"pj-empty",children:w("sidebar.noThreads")})]})]},L.id)})]}),C&&I.current.project&&(0,j.jsx)(Uc,{x:C.x,y:C.y,items:re(I.current.project),onClose:M}),O&&I.current.thread&&(0,j.jsx)(Uc,{x:O.x,y:O.y,items:A(I.current.thread),onClose:G}),p&&(0,j.jsx)(C2,{onClose:()=>_(!1)}),v&&(0,j.jsx)(k2,{project:v,onClose:()=>g(null)}),m&&(0,j.jsx)(hl,{title:m.title,body:m.body,danger:!0,onOk:m.onOk,onClose:()=>b(null)}),S&&(0,j.jsx)(E2,{project:S,onClose:()=>x(null)})]})}function E2({project:e,onClose:t}){let[i,n]=(0,Ye.useState)(e.name),s=i.trim().length>0&&i.trim()!==e.name,r=()=>{s&&te.call("projects.rename",{id:e.id,name:i.trim()}).then(t).catch(a=>Pe(w("sidebar.failRename")+ht(a),!0))};return(0,j.jsx)(gs,{title:w("sidebar.renameProject"),onClose:t,footer:(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)("button",{className:"btn ghost",onClick:t,children:w("common.cancel")}),(0,j.jsx)("button",{className:"btn primary",disabled:!s,onClick:r,children:w("common.save")})]}),children:(0,j.jsxs)("div",{className:"dlg-row",children:[(0,j.jsx)("label",{children:w("sidebar.projectName")}),(0,j.jsx)("input",{className:"tinput",autoFocus:!0,value:i,onChange:a=>n(a.target.value),onKeyDown:a=>{a.key==="Enter"&&!kn(a.nativeEvent)&&r()}})]})})}function x2(){return te.call("settings.get").then(e=>e).catch(()=>({}))}function C2({onClose:e}){let[t,i]=(0,Ye.useState)(""),[n,s]=(0,Ye.useState)(null),[r,a]=(0,Ye.useState)([]),[o,l]=(0,Ye.useState)(!1),c=fe();(0,Ye.useEffect)(()=>{te.call("fs.recentDirs").then(d=>a(d)).catch(()=>{})},[]),(0,Ye.useEffect)(()=>{let d=t.trim();if(!d){s(null);return}let f=setTimeout(()=>{te.call("fs.check",{path:d}).then(p=>s(p)).catch(()=>s(null))},200);return()=>clearTimeout(f)},[t]);let u=n?.exists&&n.isDir;async function h(){if(!(!u||o)){l(!0);try{let d=await te.call("projects.create",{path:t.trim()});c.select(d.id,null),e()}catch(d){Pe(w("sidebar.failAddProject")+ht(d),!0),l(!1)}}}return(0,j.jsxs)(gs,{title:w("sidebar.newProjectDlg"),onClose:e,footer:(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)("button",{className:"btn ghost",onClick:e,children:w("common.cancel")}),(0,j.jsx)("button",{className:"btn primary",disabled:!u||o,onClick:()=>{h()},children:w("common.add")})]}),children:[(0,j.jsxs)("div",{className:"dlg-row",children:[(0,j.jsx)("label",{children:w("sidebar.dirLabel")}),(0,j.jsxs)("div",{style:{display:"flex",gap:6},children:[(0,j.jsx)("input",{className:`tinput${n&&!u?" err":""}`,style:{flex:1},autoFocus:!0,placeholder:"D:\\\\path\\\\to\\\\project",value:t,onChange:d=>i(d.target.value),onKeyDown:d=>{d.key==="Enter"&&!kn(d.nativeEvent)&&h()}}),(0,j.jsx)("button",{className:"btn",style:{flex:"none",whiteSpace:"nowrap"},onClick:()=>{te.call("fs.pickFolder",{initial:t.trim()||void 0}).then(d=>{let f=d;f?.path?i(f.path):f&&!f.available&&Pe(w("sidebar.pickFolderUnsupported"))}).catch(()=>Pe(w("sidebar.pickFolderFailed")))},children:w("common.browse")})]}),n&&!n.exists&&(0,j.jsx)("div",{className:"dlg-hint err",children:w("sidebar.dirMissing")}),n&&n.exists&&!n.isDir&&(0,j.jsx)("div",{className:"dlg-hint err",children:w("sidebar.notDir")}),u&&(0,j.jsx)("div",{className:"dlg-hint",children:w("sidebar.dirOk")})]}),r.length>0&&(0,j.jsxs)("div",{className:"dlg-row",children:[(0,j.jsx)("label",{children:w("sidebar.recent")}),r.map(d=>(0,j.jsx)("button",{className:"mi",style:{height:26},onClick:()=>i(d),children:d},d))]})]})}function k2({project:e,onClose:t}){let[i,n]=(0,Ye.useState)(null),[s,r]=(0,Ye.useState)(new Set),[a,o]=(0,Ye.useState)(!1),l=fe();(0,Ye.useEffect)(()=>{te.call("history.list",{projectId:e.id}).then(h=>n(h)).catch(h=>{Pe(w("sidebar.failImportList")+ht(h),!0),n([])})},[e.id]);let c=h=>{r(d=>{let f=new Set(d);return f.has(h)?f.delete(h):f.add(h),f})};async function u(){if(!(a||s.size===0||!i)){o(!0);try{let h=i.filter(f=>s.has(f.sessionId)&&!f.imported),d=await te.call("history.import",{projectId:e.id,items:h.map(f=>({provider:f.provider,sessionId:f.sessionId,title:f.title}))});Pe(Te("sidebar.importedN",{n:d.length})),d.length>0&&l.select(e.id,d[d.length-1].id),t()}catch(h){Pe(w("sidebar.failImport")+ht(h),!0)}finally{o(!1)}}}return(0,j.jsxs)(gs,{title:Te("sidebar.importTitle",{name:e.name}),onClose:t,wide:!0,footer:(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)("button",{className:"btn ghost",onClick:t,children:w("common.cancel")}),(0,j.jsx)("button",{className:"btn primary",disabled:a||s.size===0,onClick:()=>{u()},children:a?w("sidebar.importing"):Te("sidebar.importN",{n:s.size||0})})]}),children:[i===null&&(0,j.jsx)("div",{className:"dlg-hint",children:w("sidebar.scanning")}),i!==null&&i.length===0&&(0,j.jsx)("div",{className:"dlg-hint",children:w("sidebar.importEmpty")}),i!==null&&i.length>0&&(0,j.jsx)("div",{className:"imp-list",children:i.map(h=>(0,j.jsxs)("label",{className:`imp-row${h.imported?" done":""}`,children:[(0,j.jsx)("input",{type:"checkbox",disabled:h.imported,checked:s.has(h.sessionId),onChange:()=>c(h.sessionId)}),(0,j.jsx)("span",{className:"imp-title",children:h.title}),(0,j.jsxs)("span",{className:"imp-meta",children:[h.provider," \xB7 ",h.messageCount,w("common.messages")," \xB7 ",h_(h.updatedAt),h.imported?w("common.imported"):""]})]},h.sessionId))})]})}async function T2(e){try{let t=await te.call("thread.exportMarkdown",{id:e.id});if(t.path){Pe(Te("sidebar.exportSaved",{path:t.path}));return}let i=new Blob([t.markdown],{type:"text/markdown;charset=utf-8"}),n=document.createElement("a");n.href=URL.createObjectURL(i),n.download=t.filename||`${e.title}.md`,n.style.display="none",document.body.appendChild(n),n.click(),setTimeout(()=>{URL.revokeObjectURL(n.href),n.remove()},5e3)}catch(t){Pe(w("sidebar.failExport")+ht(t),!0)}}var Ye,j,VE,ZE=ce(()=>{Ye=ae(Mt(),1);cl();qn();ln();Tn();Od();f_();dl();Pr();_s();wi();j=ae(Le(),1),VE=10});function v_(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}function lx(e){Ba=e}function Ma(e){let t=[];return i=>{let n=Math.max(0,Math.min(3,i-1)),s=t[n];return s||(s=e(n),t[n]=s),s}}function Se(e,t=""){let i=typeof e=="string"?e:e.source,n={replace:(s,r)=>{let a=typeof r=="string"?r:r.source;return a=a.replace(Zt.caret,"$1"),i=i.replace(s,a),n},getRegex:()=>new RegExp(i,t)};return n}function cn(e,t){if(t){if(Zt.escapeTest.test(e))return e.replace(Zt.escapeReplace,tx)}else if(Zt.escapeTestNoEncode.test(e))return e.replace(Zt.escapeReplaceNoEncode,tx);return e}function kL(e){return Zt.numericCharacterReference.test(e)?e.replace(Zt.numericCharacterReferenceOrAmpersand,(t,i,n)=>{if(i===void 0&&n===void 0)return"&amp;";let s=i===void 0?Number.parseInt(n,16):Number.parseInt(i,10);return s===0||s>1114111||s>=55296&&s<=57343?"\uFFFD":s===38?"&amp;":String.fromCodePoint(s)}):e}function ix(e){try{e=encodeURI(e).replace(Zt.percentDecode,"%")}catch{return null}return e}function nx(e,t){let i=e.replace(Zt.findPipe,(r,a,o)=>{let l=!1,c=a;for(;--c>=0&&o[c]==="\\";)l=!l;return l?"|":" |"}),n=i.split(Zt.splitPipe),s=0;if(n[0].trim()||n.shift(),n.length>0&&!n.at(-1)?.trim()&&n.pop(),t)if(n.length>t)n.splice(t);else for(;n.length<t;)n.push("");for(;s<n.length;s++)n[s]=n[s].trim().replace(Zt.slashPipe,"|");return n}function Ur(e,t,i){let n=e.length;if(n===0)return"";let s=0;for(;s<n;){let r=e.charAt(n-s-1);if(r===t&&!i)s++;else if(r!==t&&i)s++;else break}return e.slice(0,n-s)}function sx(e){let t=e.split(`
12
+ `),i=t.length-1;for(;i>=0&&Zt.blankLine.test(t[i]);)i--;return t.length-i<=2?e:t.slice(0,i+1).join(`
13
+ `)}function Id(e){return e.trim().toLowerCase().toUpperCase().toLowerCase()}function rx(e,t){if(e.indexOf(t[0])===-1&&e.indexOf(t[1])===-1)return-1;let i=0;for(let n=0;n<e.length;n++)if(e[n]==="\\")n++;else if(e[n]===t[0])i++;else if(e[n]===t[1]&&(i--,i<0))return n;return i>0?-2:-1}function Dd(e,t=0){let i=t,n="";for(let s of e)if(s===" "){let r=4-i%4;n+=" ".repeat(r),i+=r}else n+=s,i++;return n}function ax(e,t,i,n,s){let r=t.href,a=t.title||null,o=e[1].replace(s.other.outputLinkReplace,"$1"),l=e[0].charAt(0)==="!",c=n.state.inLink,u=n.state.linkEmitted,h=n.state.inRawBlock;n.state.inLink=!0,n.state.linkEmitted=!1;let d=n.inlineTokens(o),f=n.state.linkEmitted;if(n.state.linkEmitted=u,n.state.inLink=c,!l){if(f){n.state.inRawBlock=h;return}n.state.linkEmitted=!0}return{type:l?"image":"link",raw:i,href:r,title:a,text:o,tokens:d}}function TL(e,t,i){let n=e.match(i.other.indentCodeCompensation);if(n===null)return t;let s=n[1];return t.split(`
14
+ `).map(r=>{let a=r.match(i.other.beginningSpace);if(a===null)return r;let[o]=a;return r.slice(Math.min(o.length,s.length))}).join(`
15
+ `)}function ox(e,t,i,n){if(!t.includes("<"))return!1;for(let s=0;s<t.length;s++){if(t[s]==="\\"){s++;continue}if(t[s]==="`"){let o=n.inline.code.exec(t.slice(s));if(o){s+=o[0].length-1;continue}}if(t[s]!=="<")continue;let r=e.slice(i+s),a=n.inline.tag.exec(r)||n.inline.autolink.exec(r);if(a){if(a[0].length>t.length-s)return!0;s+=a[0].length-1}}return!1}function Oa(e,t){if(Array.isArray(t))for(let i=0;i<t.length;i++)e.push(t[i]);else e.push(t)}function je(e,t){return La.parse(e,t)}function AL(...e){return La.use(...e),je.defaults=La.defaults,lx(je.defaults),je}var Ba,Ra,N2,Zt,A2,M2,O2,Kc,R2,b_,cx,ux,D2,y_,L2,S_,B2,I2,Wc,w_,z2,hx,P2,U2,H2,E_,QE,F2,q2,K2,W2,dx,G2,vs,ml,Gc,$2,Y2,fx,j2,V2,X2,px,Z2,Q2,J2,eL,mx,tL,iL,nL,sL,rL,aL,oL,lL,cL,uL,hL,dL,fL,pL,mL,gx,Bd,gL,_L,vL,JE,bL,yL,ex,SL,wL,x_,EL,g_,xL,Rd,Fc,CL,tx,fl,pl,_x,vx,Da,Kn,zd,C_,Wn,Ld,qc,NL,La,iU,nU,sU,rU,aU,oU,bx=ce(()=>{Ba=v_();Ra={exec:()=>null};N2=((e="")=>{try{return!!new RegExp("(?<=1)(?<!1)"+e)}catch{return!1}})(),Zt={codeRemoveIndent:/^(?: {0,3}\t| {1,4})/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,endingSpaceTabChar:/[ \t]$/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,leadingSpaceTab:/^[ \t]+/,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,blockquoteMarkerWhitespace:/^( {0,3}>)([ \t]+)/gm,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,numericCharacterReference:/&#(?:(\d{1,7})|[Xx]([A-Fa-f0-9]{1,6}));/,numericCharacterReferenceOrAmpersand:/&#(?:(\d{1,7})|[Xx]([A-Fa-f0-9]{1,6}));|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:e=>new RegExp(`^( {0,3}${e})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:Ma(e=>new RegExp(`^ {0,${e}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`)),hrRegex:Ma(e=>new RegExp(`^ {0,${e}}((?:-[ ]*){3,}|(?:_[ ]*){3,}|(?:\\*[ ]*){3,})(?:\\n+|$)`)),fencesBeginRegex:Ma(e=>new RegExp(`^ {0,${e}}(?:\`\`\`|~~~)`)),headingBeginRegex:Ma(e=>new RegExp(`^ {0,${e}}#{1,6}(?:\\s|$)`)),pedanticHeadingBeginRegex:Ma(e=>new RegExp(`^ {0,${e}}#`)),htmlBeginRegex:Ma(e=>new RegExp(`^ {0,${e}}(?:</?(?:${Wc})(?: +|$|/?>)|<(?:(?:script|pre|style|textarea)(?:[\\s>]|$)|!--)|<\\?|<![A-Za-z]|<!\\[CDATA\\[)`,"i")),blockquoteBeginRegex:Ma(e=>new RegExp(`^ {0,${e}}>`))},A2=/^(?:[ \t]*(?:\n|$))+/,M2=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,O2=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,Kc=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,R2=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,b_=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,cx=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |fences|blockquote|heading|hr|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,ux=Se(cx).replace(/bull/g,b_).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}(?:\s|$)/).replace(/hr/g,/ {0,3}(?:(?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),D2=Se(cx).replace(/bull/g,b_).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}(?:\s|$)/).replace(/hr/g,/ {0,3}(?:(?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),y_=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table|[ \t]+\n)[^\n]+)*)/,L2=/^[^\n]+/,S_=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,B2=Se(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",S_).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),I2=Se(/^(bull)([ \t][^\n]*?)?(?:\n|$)/).replace(/bull/g,b_).getRegex(),Wc="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",w_=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,z2=Se("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n*|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>[^\\n]*\\n*|$)|<![A-Z][\\s\\S]*?(?:>[^\\n]*\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>[^\\n]*\\n*|$)|</?(tag)(?:[ \\t]+|\\n|/?>|$)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!(?:script|pre|style|textarea)(?![a-z0-9-]))([a-z][a-z0-9-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</[a-z][a-z0-9-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",w_).replace("tag",Wc).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),hx=e=>Se(y_).replace("hr",Kc).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace("list",e).replace("html"," {0,3}(?:</?(?:tag)(?: +|\\n|/?>)|<(?:(?:script|pre|style|textarea)(?:[\\s>]|$)|!--)|<\\?|<![A-Za-z]|<!\\[CDATA\\[)").replace("tag",Wc).getRegex(),P2=hx(/ {0,3}(?:[*+-]|1[.)])[ \t]+[^ \t\n]/),U2=hx(/ {0,3}(?:[*+-]|\d{1,9}[.)])(?:[ \t]|\n|$)/),H2=Se(/^( {0,3}> ?(?:(?![ \t]*(?:\n|$))(paragraph)|[^\n]*)(?:\n|$))+/).replace("paragraph",U2).getRegex(),E_={blockquote:H2,code:M2,def:B2,fences:O2,heading:R2,hr:Kc,html:z2,lheading:ux,list:I2,newline:A2,paragraph:P2,table:Ra,text:L2},QE=Se("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",Kc).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html"," {0,3}(?:</?(?:tag)(?: +|\\n|/?>)|<(?:(?:script|pre|style|textarea)(?:[\\s>]|$)|!--)|<\\?|<![A-Za-z]|<!\\[CDATA\\[)").replace("tag",Wc).getRegex(),F2={...E_,lheading:D2,table:QE,paragraph:Se(y_).replace("hr",Kc).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",QE).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]+[^ \\t\\n]").replace("html"," {0,3}(?:</?(?:tag)(?: +|\\n|/?>)|<(?:(?:script|pre|style|textarea)(?:[\\s>]|$)|!--)|<\\?|<![A-Za-z]|<!\\[CDATA\\[)").replace("tag",Wc).getRegex()},q2={...E_,html:Se(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",w_).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:Ra,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:Se(y_).replace("hr",Kc).replace("heading",` *#{1,6} *[^
16
+ ]`).replace("lheading",ux).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},K2=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,W2=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,dx=/^( {2,}|\\)\n(?!\s*$)[ \t]*/,G2=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,vs=/[\p{P}\p{S}]/u,ml=/[\s\p{P}\p{S}]/u,Gc=/[^\s\p{P}\p{S}]/u,$2=Se(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,ml).getRegex(),Y2=/[\p{Pi}\p{Ps}"']/u,fx=/(?!~)[\p{P}\p{S}]/u,j2=/(?!~)[\s\p{P}\p{S}]/u,V2=/(?:[^\s\p{P}\p{S}]|~)/u,X2=Se(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",N2?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),px=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,Z2=Se(px,"u").replace(/punct/g,vs).getRegex(),Q2=Se(px,"u").replace(/punct/g,fx).getRegex(),J2=/^(?:\*+(?:((?!\*)(?!openQuote)punct)|([^\s*]))?)|^_+(?:((?!_)(?!openQuote)punct)|([^\s_]))?/,eL=Se(J2,"u").replace(/openQuote/g,Y2).replace(/punct/g,vs).getRegex(),mx="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",tL=Se(mx,"gu").replace(/notPunctSpace/g,Gc).replace(/punctSpace/g,ml).replace(/punct/g,vs).getRegex(),iL=Se(mx,"gu").replace(/notPunctSpace/g,V2).replace(/punctSpace/g,j2).replace(/punct/g,fx).getRegex(),nL="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)[\\s](\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|(?:(?!\\*)punct|notPunctSpace)(\\*+)(?!\\*)(?=notPunctSpace)",sL=Se(nL,"gu").replace(/notPunctSpace/g,Gc).replace(/punctSpace/g,ml).replace(/punct/g,vs).getRegex(),rL=Se("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,Gc).replace(/punctSpace/g,ml).replace(/punct/g,vs).getRegex(),aL="^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)[\\s](_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)|(?:(?!_)punct|notPunctSpace)(_+)(?!_)(?=notPunctSpace)",oL=Se(aL,"gu").replace(/notPunctSpace/g,Gc).replace(/punctSpace/g,ml).replace(/punct/g,vs).getRegex(),lL=Se(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,vs).getRegex(),cL="^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)",uL=Se(cL,"gu").replace(/notPunctSpace/g,Gc).replace(/punctSpace/g,ml).replace(/punct/g,vs).getRegex(),hL=Se(/\\(punct)/,"gu").replace(/punct/g,vs).getRegex(),dL=Se(/(`+)(?:[^`]|[^`][\s\S]*?[^`])\1(?!`)|`+|\\(punct)/,"gu").replace(/punct/g,vs).getRegex(),fL=Se(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),pL=Se(w_).replace("(?:-->|$)","-->").getRegex(),mL=Se("^comment|^</[a-zA-Z][a-zA-Z0-9-]*\\s*>|^<[a-zA-Z][a-zA-Z0-9-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",pL).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),gx=/\[(?:\\[\s\S]|[^\[\]\\])*\]/,Bd=Se(/(?:\[(?:brackets|\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/).replace("brackets",gx).getRegex(),gL=Se(/^!?\[(label)\]\([ \t\n]*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?[ \t\n]*\)/).replace("label",Bd).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]+|(?=\))/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),_L=Se(/^!?\[(label)\]\[(ref)\]/).replace("label",Bd).replace("ref",S_).getRegex(),vL=Se(/^!?\[(ref)\](?:\[\])?/).replace("ref",S_).getRegex(),JE=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\]){1,999}/,bL=Se(/(?:[^\[\]\\`]*(?:\[(?:brackets|\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\]))){0,999}?[^\[\]\\`]*?/).replace("brackets",gx).getRegex(),yL=Se("reflink|nolink(?!\\()","g").replace("reflink",Se(/^!?\[(label)\]\[(ref)\]/).replace("label",bL).replace("ref",JE).getRegex()).replace("nolink",Se(/^!?\[(ref)\](?:\[\])?/).replace("ref",JE).getRegex()).getRegex(),ex=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,SL=/[A-Za-z0-9._+-]+@[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![\w-])/,wL=Se(/(?:mailto:email|xmpp:email(?:\/[A-Za-z0-9@.]+)?)/).replace(/email/g,SL).getRegex(),x_={_backpedal:Ra,anyPunctuation:hL,anyPunctuationOutsideCode:dL,autolink:fL,blockSkip:X2,br:dx,code:W2,del:Ra,delLDelim:Ra,delRDelim:Ra,emStrongLDelim:Z2,emStrongRDelimAst:tL,emStrongRDelimUnd:rL,escape:K2,link:gL,nolink:vL,punctuation:$2,reflink:_L,reflinkSearch:yL,tag:mL,text:G2,url:Ra},EL={...x_,emStrongLDelim:eL,emStrongRDelimAst:sL,emStrongRDelimUnd:oL,link:Se(/^!?\[(label)\]\((.*?)\)/).replace("label",Bd).getRegex(),reflink:Se(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Bd).getRegex()},g_={...x_,emStrongRDelimAst:iL,emStrongLDelim:Q2,delLDelim:lL,delRDelim:uL,url:Se(/^emailProtocol|^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("emailProtocol",wL).replace("protocol",ex).replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![\w-])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:Se(/^(?:[^a-zA-Z0-9](?=emailProtocol)|(`+|~+|[^`~])(?:(?=[`~])|(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9](?=emailProtocol)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@))))/).replace("protocol",ex).replace(/emailProtocol/g,/(?:mailto|xmpp):/).getRegex()},xL={...g_,br:Se(dx).replace("{2,}","*").getRegex(),text:Se(g_.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},Rd={normal:E_,gfm:F2,pedantic:q2},Fc={normal:x_,gfm:g_,breaks:xL,pedantic:EL},CL={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},tx=e=>CL[e];fl=class{constructor(e){he(this,"options");he(this,"rules");he(this,"lexer");this.options=e||Ba}space(e){let t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:"space",raw:t[0]}}code(e){let t=this.rules.block.code.exec(e);if(t){let i=this.options.pedantic?t[0]:sx(t[0]),n=i.replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:i,codeBlockStyle:"indented",text:n}}}fences(e){let t=this.rules.block.fences.exec(e);if(t){let i=t[0],n=TL(i,t[3]||"",this.rules);return{type:"code",raw:i,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):t[2],text:n}}}heading(e){let t=this.rules.block.heading.exec(e);if(t){let i=t[2].trim();if(this.rules.other.endingHash.test(i)){let n=Ur(i,"#");(this.options.pedantic||!n||this.rules.other.endingSpaceTabChar.test(n))&&(i=n.trim())}return{type:"heading",raw:Ur(t[0],`
17
+ `),depth:t[1].length,text:i,tokens:this.lexer.inline(i)}}}hr(e){let t=this.rules.block.hr.exec(e);if(t)return{type:"hr",raw:Ur(t[0],`
18
+ `)}}blockquote(e){let t=this.rules.block.blockquote.exec(e);if(t){let i=Ur(t[0],`
19
+ `).split(`
20
+ `),n="",s="",r=[];for(;i.length>0;){let a=!1,o=[],l;for(l=0;l<i.length;l++)if(this.rules.other.blockquoteStart.test(i[l]))o.push(i[l]),a=!0;else if(!a)o.push(i[l]);else break;i=i.slice(l);let c=o.join(`
21
+ `),u=c.replace(this.rules.other.blockquoteMarkerWhitespace,(f,p,_)=>p+Dd(_,p.length)).replace(this.rules.other.blockquoteSetextReplace,`
22
+ $1`).replace(this.rules.other.blockquoteSetextReplace2,"");n=n?`${n}
23
+ ${c}`:c,s=s?`${s}
24
+ ${u}`:u;let h=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(u,r,!0),this.lexer.state.top=h,i.length===0)break;let d=r.at(-1);if(d?.type==="code"||d?.type==="heading"||d?.type==="hr"||d?.type==="html")break;if(d?.type==="blockquote"){let f=d,p=i.join(`
25
+ `),_=f.raw+`
26
+ `+p.replace(this.rules.other.blockquoteSetextReplace2,""),v=this.blockquote(_);r[r.length-1]=v;let g=_.substring(v.raw.length).replace(/^\n/,""),m=g?g.split(`
27
+ `).length:0,b=m?i.slice(0,-m):i;b.length>0&&(n=`${n}
28
+ ${b.join(`
29
+ `)}`),s=s.substring(0,s.length-f.text.length)+v.text;break}else if(d?.type==="list"){let f=d,p=f.raw+`
30
+ `+i.join(`
31
+ `),_=this.list(p);r[r.length-1]=_;let v=_.raw.length>f.raw.length?p.slice(f.raw.length+1,_.raw.length).split(`
32
+ `).length:0;if(v>0){let g=i.slice(0,v).join(`
33
+ `);n=`${n}
34
+ ${g}`,s=`${s}
35
+ ${g}`}i=i.slice(v);continue}}return{type:"blockquote",raw:n,tokens:r,text:s}}}list(e){let t=this.rules.block.list.exec(e);if(t){let i=e,n=()=>i.length-e.length,s=t[1].trim(),r=s.length>1,a={type:"list",raw:"",ordered:r,start:r?+s.slice(0,-1):"",loose:!1,items:[]};s=r?`\\d{1,9}\\${s.slice(-1)}`:`\\${s}`,this.options.pedantic&&(s=r?s:"[*+-]");let o=this.rules.other.listItemRegex(s),l=!1;for(;e;){let u=!1,h="";if(!(t=o.exec(e))||this.rules.block.hr.test(e))break;let d=n();e=e.substring(t[0].length);let f=t[2].split(`
36
+ `,1)[0],p=t[1].length,_=this.options.pedantic?Dd(f,p):f.replace(this.rules.other.leadingSpaceTab,S=>Dd(S,p)),v=e.split(`
37
+ `,1)[0],g=!_.trim(),m=0;if(this.options.pedantic?(m=2,h=_.trimStart()):g?m=p+1:(m=_.search(this.rules.other.nonSpaceChar),m=m>4?1:m,h=_.slice(m),m+=p),g&&this.rules.other.blankLine.test(v)&&(e=e.substring(v.length+1),u=!0),!u){let S=this.rules.other.nextBulletRegex(m),x=this.rules.other.hrRegex(m),C=this.rules.other.fencesBeginRegex(m),N=this.options.pedantic?this.rules.other.pedanticHeadingBeginRegex(m):this.rules.other.headingBeginRegex(m),M=this.rules.other.htmlBeginRegex(m),O=this.rules.other.blockquoteBeginRegex(m);for(;e;){let q=e.split(`
38
+ `,1)[0],G;if(v=q,this.options.pedantic?(v=v.replace(this.rules.other.listReplaceNesting," "),G=v):G=v.replace(this.rules.other.leadingSpaceTab,I=>Dd(I)),C.test(v)||N.test(v)||M.test(v)||O.test(v)||S.test(v)||x.test(v))break;if(G.search(this.rules.other.nonSpaceChar)>=m||!v.trim())h+=`
39
+ `+G.slice(m);else{if(g||_.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||C.test(_)||N.test(_)||x.test(_))break;let I=!this.options.pedantic&&/^ {0,3}(?:=+|-+) *$/.test(v)&&this.rules.block.lheading.test(`${_}
40
+ ${v}`)?` ${G.replace(/^ {0,3}/,"")}`:v;h+=`
41
+ `+I}g=!v.trim(),e=e.substring(q.length+1),_=G.slice(m)}}let b=i.slice(d,n());a.loose||(l?a.loose=!0:this.rules.other.doubleBlankLine.test(b)&&(l=!0)),a.items.push({type:"list_item",raw:b,task:!!this.options.gfm&&this.rules.other.listIsTask.test(h),loose:!1,text:h,tokens:[]})}let c=a.items.at(-1);if(c)c.raw=c.raw.trimEnd(),c.text=c.text.trimEnd();else return;a.raw=i.slice(0,n()).trimEnd();for(let u of a.items)if(this.lexer.state.top=!1,u.tokens=this.lexer.blockTokens(u.text,[]),!a.loose){let h=u.tokens.filter(f=>f.type==="space"),d=h.length>0&&h.some(f=>this.rules.other.anyLine.test(f.raw));a.loose=d}for(let u of a.items){let h=u.tokens[0];if(u.task&&(h?.type==="text"||h?.type==="paragraph")){u.text=u.text.replace(this.rules.other.listReplaceTask,""),h.raw=h.raw.replace(this.rules.other.listReplaceTask,""),h.text=h.text.replace(this.rules.other.listReplaceTask,"");for(let f=this.lexer.inlineQueue.length-1;f>=0;f--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[f].src)){this.lexer.inlineQueue[f].src=this.lexer.inlineQueue[f].src.replace(this.rules.other.listReplaceTask,"");break}let d=this.rules.other.listTaskCheckbox.exec(u.raw);if(d){let f={type:"checkbox",raw:d[0]+" ",checked:d[0]!=="[ ]"};u.checked=f.checked,a.loose?u.tokens[0]&&["paragraph","text"].includes(u.tokens[0].type)&&"tokens"in u.tokens[0]&&u.tokens[0].tokens?(u.tokens[0].raw=f.raw+u.tokens[0].raw,u.tokens[0].text=f.raw+u.tokens[0].text,u.tokens[0].tokens.unshift(f)):u.tokens.unshift({type:"paragraph",raw:f.raw,text:f.raw,tokens:[f]}):u.tokens.unshift(f)}}else u.task&&(u.task=!1)}if(a.loose)for(let u of a.items){u.loose=!0;for(let h of u.tokens)h.type==="text"&&(h.type="paragraph")}return a}}html(e){let t=this.rules.block.html.exec(e);if(t){let i=sx(t[0]);return{type:"html",block:!0,raw:i,pre:t[1]==="pre"||t[1]==="script"||t[1]==="style",text:i}}}def(e){let t=this.rules.block.def.exec(e);if(t){if(!this.rules.other.startAngleBracket.test(t[2])&&rx(t[2],"()")!==-1)return;let i=Id(t[1]).replace(this.rules.other.multipleSpaceGlobal," "),n=t[2]?t[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",s=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):t[3];return{type:"def",tag:i,raw:Ur(t[0],`
42
+ `),href:n,title:s}}}table(e){let t=this.rules.block.table.exec(e);if(!t||!this.rules.other.tableDelimiter.test(t[2]))return;let i=nx(t[1]),n=t[2].replace(this.rules.other.tableAlignChars,"").split("|"),s=t[3]?.trim()?t[3].replace(this.rules.other.tableRowBlankLine,"").split(`
43
+ `):[],r={type:"table",raw:Ur(t[0],`
44
+ `),header:[],align:[],rows:[]};if(i.length===n.length){for(let a of n)this.rules.other.tableAlignRight.test(a)?r.align.push("right"):this.rules.other.tableAlignCenter.test(a)?r.align.push("center"):this.rules.other.tableAlignLeft.test(a)?r.align.push("left"):r.align.push(null);for(let a=0;a<i.length;a++)r.header.push({text:i[a],tokens:this.lexer.inline(i[a]),header:!0,align:r.align[a]});for(let a of s)r.rows.push(nx(a,r.header.length).map((o,l)=>({text:o,tokens:this.lexer.inline(o),header:!1,align:r.align[l]})));return r}}lheading(e){let t=this.rules.block.lheading.exec(e);if(t){let i=t[1].trim();return{type:"heading",raw:Ur(t[0],`
45
+ `),depth:t[2].charAt(0)==="="?1:2,text:i,tokens:this.lexer.inline(i)}}}paragraph(e){let t=this.rules.block.paragraph.exec(e);if(t){let i=t[1].charAt(t[1].length-1)===`
46
+ `?t[1].slice(0,-1):t[1];return{type:"paragraph",raw:t[0],text:i,tokens:this.lexer.inline(i)}}}text(e){let t=this.rules.block.text.exec(e);if(t)return{type:"text",raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){let t=this.rules.inline.escape.exec(e);if(t)return{type:"escape",raw:t[0],text:t[1]}}tag(e){let t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&this.rules.other.startATag.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(e){if(this.lexer.state.linkParenPossible===!1)return;let t=this.rules.inline.link.exec(e);if(t){let i=t[0].charAt(0)==="!"?2:1;if(!this.options.pedantic&&ox(e,t[1],i,this.rules))return;let n=t[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(n)){if(!this.rules.other.endAngleBracket.test(n))return;let a=Ur(n.slice(0,-1),"\\");if((n.length-a.length)%2===0)return}else{let a=rx(t[2],"()");if(a===-2)return;if(a>-1){let o=(t[0].indexOf("!")===0?5:4)+t[1].length+a;t[2]=t[2].substring(0,a),t[0]=t[0].substring(0,o).trim(),t[3]=""}}let s=t[2],r="";if(this.options.pedantic){let a=this.rules.other.pedanticHrefTitle.exec(s);a&&(s=a[1],r=a[3])}else r=t[3]?t[3].slice(1,-1):"";return s=s.trim(),this.rules.other.startAngleBracket.test(s)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(n)?s=s.slice(1):s=s.slice(1,-1)),ax(t,{href:s&&s.replace(this.rules.inline.anyPunctuation,"$1"),title:r&&r.replace(this.rules.inline.anyPunctuation,"$1")},t[0],this.lexer,this.rules)}}reflink(e,t){let i;if((i=this.rules.inline.reflink.exec(e))||(i=this.rules.inline.nolink.exec(e))){let n=i[0].charAt(0)==="!"?2:1;if(!this.options.pedantic&&ox(e,i[1],n,this.rules))return;let s=(i[2]||i[1]).replace(this.rules.other.multipleSpaceGlobal," "),r=t[Id(s)];if(!r){let a=i[0].charAt(0);return{type:"text",raw:a,text:a}}return ax(i,r,i[0],this.lexer,this.rules)}}emStrong(e,t,i=""){let n=this.rules.inline.emStrongLDelim.exec(e);if(!n||!n[1]&&!n[2]&&!n[3]&&!n[4])return;let s=n[0][0],r=i===s,a=t.length-e.length,o=a;for(;!this.options.pedantic&&o>0&&t[o-1]===s;)o--;let l=[...t.slice(Math.max(0,o-2),o)].at(-1)??"",c=l==="*"||l==="_"||!!this.rules.inline.punctuation.exec(l);o<a&&(i=l);let u=o<a?c:!!this.rules.inline.punctuation.exec(i);if(n[4]&&i.match(this.rules.other.unicodeAlphaNumeric))return;let h=n[1]||n[3]||"";if(!h||!i||u){let d=[...n[0]].length-1,f,p,_=d,v=0,g=a-o+d,m=!this.options.pedantic&&!!l.trim()&&(!!h||s==="*"&&!c),b=s==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(b.lastIndex=0,t=t.slice(-1*e.length+d);(n=b.exec(t))!==null;){if(f=n[1]||n[2]||n[3]||n[4]||n[5]||n[6],!f)continue;if(p=[...f].length,n[3]||n[4]){_+=p;continue}else if(n[5]||n[6]||m){if(r&&(n[5]||n[6]))break;if(g%3&&!((g+p)%3)){v+=p;continue}}if(_-=p,_>0)continue;p=Math.min(p,p+_+v);let S=[...n[0]][0].length,x=e.slice(0,d+n.index+S+p);if(Math.min(d,p)%2){let N=x.slice(1,-1);return{type:"em",raw:x,text:N,tokens:this.lexer.inlineTokens(N)}}let C=x.slice(2,-2);return{type:"strong",raw:x,text:C,tokens:this.lexer.inlineTokens(C)}}}}codespan(e){let t=this.rules.inline.code.exec(e);if(t){let i=t[2].replace(this.rules.other.newLineCharGlobal," "),n=this.rules.other.nonSpaceChar.test(i),s=this.rules.other.startingSpaceChar.test(i)&&this.rules.other.endingSpaceChar.test(i);return n&&s&&(i=i.substring(1,i.length-1)),{type:"codespan",raw:t[0],text:i}}}br(e){let t=this.rules.inline.br.exec(e);if(t)return{type:"br",raw:t[0]}}del(e,t,i=""){let n=this.rules.inline.delLDelim.exec(e);if(n&&(!n[1]||!i||this.rules.inline.punctuation.exec(i))){let s=[...n[0]].length-1,r,a,o=s,l=this.rules.inline.delRDelim;for(l.lastIndex=0,t=t.slice(-1*e.length+s);(n=l.exec(t))!==null;){if(r=n[1]||n[2]||n[3]||n[4]||n[5]||n[6],!r||(a=[...r].length,a!==s))continue;if(n[3]||n[4]){o+=a;continue}if(o-=a,o>0)continue;a=Math.min(a,a+o);let c=[...n[0]][0].length,u=e.slice(0,s+n.index+c+a),h=u.slice(s,-s);return{type:"del",raw:u,text:h,tokens:this.lexer.inlineTokens(h)}}}}autolink(e){let t=this.rules.inline.autolink.exec(e);if(t){let i,n;return t[2]==="@"?(i=t[1],n="mailto:"+i):(i=t[1],n=i),{type:"link",raw:t[0],text:i,href:n,autolink:!0,tokens:[{type:"text",raw:i,text:i}]}}}url(e){let t;if(t=this.rules.inline.url.exec(e)){let i,n;if(t[2]==="@")i=t[0],n="mailto:"+i;else{let s;do s=t[0],t[0]=this.rules.inline._backpedal.exec(t[0])?.[0]??"";while(s!==t[0]);i=t[0],t[1]==="www."?n="http://"+t[0]:n=t[0]}return{type:"link",raw:t[0],text:i,href:n,autolink:!0,tokens:[{type:"text",raw:i,text:i}]}}}inlineText(e){let t=this.rules.inline.text.exec(e);if(t){let i=this.lexer.state.inRawBlock;return{type:"text",raw:t[0],text:i?t[0]:kL(t[0]),escaped:i}}}},Kn=(Da=class{constructor(t){Xb(this,pl);he(this,"tokens");he(this,"options");he(this,"state");he(this,"inlineQueue");he(this,"tokenizer");this.tokens=[],this.tokens.links=Object.create(null),this.options=t||Ba,this.options.tokenizer=this.options.tokenizer||new fl,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,linkEmitted:!1,linkParenPossible:!0,top:!0};let i={other:Zt,block:Rd.normal,inline:Fc.normal};this.options.pedantic?(i.block=Rd.pedantic,i.inline=Fc.pedantic):this.options.gfm&&(i.block=Rd.gfm,this.options.breaks?i.inline=Fc.breaks:i.inline=Fc.gfm),this.tokenizer.rules=i}static get rules(){return{block:Rd,inline:Fc}}static lex(t,i){return new Da(i).lex(t)}static lexInline(t,i){return new Da(i).inlineTokens(t)}lex(t){t=t.replace(Zt.carriageReturn,`
47
+ `),this.blockTokens(t,this.tokens);for(let i=0;i<this.inlineQueue.length;i++){let n=this.inlineQueue[i];this.state.inRawBlock=!1,this.inlineTokens(n.src,n.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(t,i=[],n=!1){this.tokenizer.lexer=this,this.options.pedantic&&(t=t.replace(Zt.tabCharGlobal," ").replace(Zt.spaceLine,""));let s=1/0;for(;t;){if(t.length<s)s=t.length;else{this.infiniteLoopError(t.charCodeAt(0));break}let r;if(this.options.extensions?.block?.some(o=>(r=o.call({lexer:this},t,i))?(t=t.substring(r.raw.length),i.push(r),!0):!1))continue;if(r=this.tokenizer.space(t)){t=t.substring(r.raw.length);let o=i.at(-1);r.raw.length===1&&o!==void 0?o.raw+=`
48
+ `:i.push(r);continue}if(r=this.tokenizer.code(t)){t=t.substring(r.raw.length);let o=i.at(-1);o?.type==="paragraph"||o?.type==="text"?(o.raw+=(o.raw.endsWith(`
49
+ `)?"":`
50
+ `)+r.raw,o.text+=`
51
+ `+r.text,this.inlineQueue.at(-1).src=o.text):i.push(r);continue}if(r=this.tokenizer.fences(t)){t=t.substring(r.raw.length),i.push(r);continue}if(r=this.tokenizer.heading(t)){t=t.substring(r.raw.length),i.push(r);continue}if(r=this.tokenizer.hr(t)){t=t.substring(r.raw.length),i.push(r);continue}if(r=this.tokenizer.blockquote(t)){t=t.substring(r.raw.length),i.push(r);continue}if(r=this.tokenizer.list(t)){t=t.substring(r.raw.length),i.push(r);continue}if(r=this.tokenizer.html(t)){t=t.substring(r.raw.length),i.push(r);continue}if(r=this.tokenizer.def(t)){t=t.substring(r.raw.length);let o=i.at(-1);o?.type==="paragraph"||o?.type==="text"?(o.raw+=(o.raw.endsWith(`
52
+ `)?"":`
53
+ `)+r.raw,o.text+=`
54
+ `+r.raw,this.inlineQueue.at(-1).src=o.text):(this.tokens.links[r.tag]||(this.tokens.links[r.tag]={href:r.href,title:r.title}),i.push(r));continue}if(r=this.tokenizer.table(t)){t=t.substring(r.raw.length),i.push(r);continue}if(r=this.tokenizer.lheading(t)){t=t.substring(r.raw.length),i.push(r);continue}let a=t;if(this.options.extensions?.startBlock){let o=1/0,l=t.slice(1),c;this.options.extensions.startBlock.forEach(u=>{c=u.call({lexer:this},l),typeof c=="number"&&c>=0&&(o=Math.min(o,c))}),o<1/0&&o>=0&&(a=t.substring(0,o+1))}if(this.state.top&&(r=this.tokenizer.paragraph(a))){let o=i.at(-1);n&&o?.type==="paragraph"?(o.raw+=(o.raw.endsWith(`
55
+ `)?"":`
56
+ `)+r.raw,o.text+=`
57
+ `+r.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=o.text):i.push(r),n=a.length!==t.length,t=t.substring(r.raw.length);continue}if(r=this.tokenizer.text(t)){t=t.substring(r.raw.length);let o=i.at(-1);o?.type==="text"?(o.raw+=(o.raw.endsWith(`
58
+ `)?"":`
59
+ `)+r.raw,o.text+=`
60
+ `+r.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=o.text):i.push(r);continue}if(t){this.infiniteLoopError(t.charCodeAt(0));break}}return this.state.top=!0,i}inline(t,i=[]){return this.inlineQueue.push({src:t,tokens:i}),i}linkInText(t){if(!t.includes("["))return!1;let i=this.tokenizer.rules.inline.link;for(let n of t.matchAll(this.tokenizer.rules.inline.blockSkip))if(i.test(n[0])&&t.charAt(n.index-1)!=="!")return!0;for(let n of t.matchAll(this.tokenizer.rules.inline.reflinkSearch)){let s=n[0],r=s.lastIndexOf("[");if(!(s.charAt(0)==="!"||!Object.hasOwn(this.tokens.links,Id(s.slice(r+1,-1))))&&!(r>1&&this.linkInText(s.slice(1,r-1))))return!0}return!1}inlineTokens(t,i=[]){this.tokenizer.lexer=this;let n=this.state.linkParenPossible;this.state.linkParenPossible=n&&t.includes(")");try{return tp(this,pl,_x).call(this,t,i)}finally{this.state.linkParenPossible=n}}infiniteLoopError(t){let i="Infinite loop on byte: "+t;if(this.options.silent)console.error(i);else throw new Error(i)}},pl=new WeakSet,_x=function(t,i){let n=t.includes("*")||t.includes("_")||t.includes("~")||this.options.hooks?.emStrongMask||this.tokenizer.emStrong!==fl.prototype.emStrong||this.tokenizer.del!==fl.prototype.del?tp(this,pl,vx).call(this,t):t,s=!1,r="",a=1/0;for(;t;){if(t.length<a)a=t.length;else{this.infiniteLoopError(t.charCodeAt(0));break}s||(r=""),s=!1;let o;if(this.options.extensions?.inline?.some(c=>(o=c.call({lexer:this},t,i))?(t=t.substring(o.raw.length),i.push(o),!0):!1))continue;if(o=this.tokenizer.escape(t)){t=t.substring(o.raw.length),i.push(o);continue}if(o=this.tokenizer.tag(t)){t=t.substring(o.raw.length),i.push(o);continue}if(o=this.tokenizer.link(t)){t=t.substring(o.raw.length),i.push(o);continue}if(o=this.tokenizer.reflink(t,this.tokens.links)){t=t.substring(o.raw.length);let c=i.at(-1);o.type==="text"&&c?.type==="text"?(c.raw+=o.raw,c.text+=o.text):i.push(o);continue}if(o=this.tokenizer.emStrong(t,n,r)){t=t.substring(o.raw.length),i.push(o);continue}if(o=this.tokenizer.codespan(t)){t=t.substring(o.raw.length),i.push(o);continue}if(o=this.tokenizer.br(t)){t=t.substring(o.raw.length),i.push(o);continue}if(o=this.tokenizer.del(t,n,r)){t=t.substring(o.raw.length),i.push(o);continue}if(o=this.tokenizer.autolink(t)){t=t.substring(o.raw.length),i.push(o);continue}if(!this.state.inLink&&(o=this.tokenizer.url(t))){t=t.substring(o.raw.length),i.push(o);continue}let l=t;if(this.options.extensions?.startInline){let c=1/0,u=t.slice(1),h;this.options.extensions.startInline.forEach(d=>{h=d.call({lexer:this},u),typeof h=="number"&&h>=0&&(c=Math.min(c,h))}),c<1/0&&c>=0&&(l=t.substring(0,c+1))}if(o=this.tokenizer.inlineText(l)){t=t.substring(o.raw.length),o.raw.slice(-1)!=="_"&&(r=o.raw.slice(-1)),s=!0;let c=i.at(-1);c?.type==="text"?(c.raw+=o.raw,c.text+=o.text):i.push(o);continue}if(t){this.infiniteLoopError(t.charCodeAt(0));break}}return i},vx=function(t){let i=t;if(this.tokens.links&&t.includes("[")){let n=this.tokenizer.rules.inline.reflinkSearch,s=r=>{let a=r.lastIndexOf("[");if(!Object.hasOwn(this.tokens.links,Id(r.slice(a+1,-1))))return r;if(a>1&&r.charAt(0)!=="!"){let o=r.slice(1,a-1);if(this.linkInText(o))return"["+o.replace(n,s)+"]["+"a".repeat(r.length-a-2)+"]"}return"["+"a".repeat(r.length-2)+"]"};i=i.replace(n,s)}return i=i.replace(this.tokenizer.rules.inline.anyPunctuationOutsideCode,(n,s,r)=>r?"+".repeat(n.length):s?s+n.slice(s.length,-s.length).replace(/`/g,"+")+s:n),i=i.replace(this.tokenizer.rules.inline.blockSkip,(n,s,r)=>{let a=r?r.length:0;return n.slice(0,a)+"["+"a".repeat(n.length-a-2)+"]"}),i=this.options.hooks?.emStrongMask?.call({lexer:this},i)??i,i},Da),zd=class{constructor(e){he(this,"options");he(this,"parser");this.options=e||Ba}space(e){return""}code({text:e,lang:t,escaped:i}){let n=(t||"").match(Zt.notSpaceStart)?.[0],s=e?e.replace(Zt.endingNewline,"")+`
61
+ `:"";return n?'<pre><code class="language-'+cn(n)+'">'+(i?s:cn(s,!0))+`</code></pre>
62
+ `:"<pre><code>"+(i?s:cn(s,!0))+`</code></pre>
63
+ `}blockquote({tokens:e}){return`<blockquote>
64
+ ${this.parser.parse(e)}</blockquote>
65
+ `}html({text:e}){return e}def(e){return""}heading({tokens:e,depth:t}){return`<h${t}>${this.parser.parseInline(e)}</h${t}>
66
+ `}hr(e){return`<hr>
67
+ `}list(e){let t=e.ordered,i=e.start,n="";for(let a=0;a<e.items.length;a++){let o=e.items[a];n+=this.listitem(o)}let s=t?"ol":"ul",r=t&&i!==1?' start="'+i+'"':"";return"<"+s+r+`>
68
+ `+n+"</"+s+`>
69
+ `}listitem(e){return`<li>${this.parser.parse(e.tokens)}</li>
70
+ `}checkbox({checked:e}){return"<input "+(e?'checked="" ':"")+'disabled="" type="checkbox"> '}paragraph({tokens:e}){return`<p>${this.parser.parseInline(e)}</p>
71
+ `}table(e){let t="",i="";for(let s=0;s<e.header.length;s++)i+=this.tablecell(e.header[s]);t+=this.tablerow({text:i});let n="";for(let s=0;s<e.rows.length;s++){let r=e.rows[s];i="";for(let a=0;a<r.length;a++)i+=this.tablecell(r[a]);n+=this.tablerow({text:i})}return n&&(n=`<tbody>${n}</tbody>`),`<table>
72
+ <thead>
73
+ `+t+`</thead>
74
+ `+n+`</table>
75
+ `}tablerow({text:e}){return`<tr>
76
+ ${e}</tr>
77
+ `}tablecell(e){let t=this.parser.parseInline(e.tokens),i=e.header?"th":"td";return(e.align?`<${i} align="${e.align}">`:`<${i}>`)+t+`</${i}>
78
+ `}strong({tokens:e}){return`<strong>${this.parser.parseInline(e)}</strong>`}em({tokens:e}){return`<em>${this.parser.parseInline(e)}</em>`}codespan({text:e}){return`<code>${cn(e,!0)}</code>`}br(e){return"<br>"}del({tokens:e}){return`<del>${this.parser.parseInline(e)}</del>`}link({href:e,title:t,text:i,tokens:n,autolink:s}){let r=s?cn(i,!0):this.parser.parseInline(n),a=ix(e);if(a===null)return r;e=cn(a,s);let o='<a href="'+e+'"';return t&&(o+=' title="'+cn(t)+'"'),o+=">"+r+"</a>",o}image({href:e,title:t,text:i,tokens:n}){n&&(i=this.parser.parseInline(n,this.parser.textRenderer));let s=ix(e);if(s===null)return cn(i);e=s;let r=`<img src="${cn(e)}" alt="${cn(i)}"`;return t&&(r+=` title="${cn(t)}"`),r+=">",r}text(e){return"tokens"in e&&e.tokens?this.parser.parseInline(e.tokens):"escaped"in e&&e.escaped?e.text:cn(e.text)}},C_=class{constructor(){he(this,"parser")}strong({text:e,tokens:t}){return t?this.parser.parseInline(t,this):e}em({text:e,tokens:t}){return t?this.parser.parseInline(t,this):e}codespan({text:e}){return e}del({text:e,tokens:t}){return t?this.parser.parseInline(t,this):e}html({text:e}){return e}text({text:e}){return e}link({text:e,tokens:t}){return t?this.parser.parseInline(t,this):e}image({text:e,tokens:t}){return t?this.parser.parseInline(t,this):e}br(){return""}checkbox({raw:e}){return e}},Wn=class __{constructor(t){he(this,"options");he(this,"renderer");he(this,"textRenderer");this.options=t||Ba,this.options.renderer=this.options.renderer||new zd,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new C_,this.textRenderer.parser=this}static parse(t,i){return new __(i).parse(t)}static parseInline(t,i){return new __(i).parseInline(t)}parse(t){this.renderer.parser=this;let i="";for(let n=0;n<t.length;n++){let s=t[n];if(this.options.extensions?.renderers?.[s.type]){let a=s,o=this.options.extensions.renderers[a.type].call({parser:this},a);if(o!==!1||!["space","hr","heading","code","table","blockquote","list","checkbox","html","def","paragraph","text"].includes(a.type)){i+=o||"";continue}}let r=s;switch(r.type){case"space":{i+=this.renderer.space(r);break}case"hr":{i+=this.renderer.hr(r);break}case"heading":{i+=this.renderer.heading(r);break}case"code":{i+=this.renderer.code(r);break}case"table":{i+=this.renderer.table(r);break}case"blockquote":{i+=this.renderer.blockquote(r);break}case"list":{i+=this.renderer.list(r);break}case"checkbox":{i+=this.renderer.checkbox(r);break}case"html":{i+=this.renderer.html(r);break}case"def":{i+=this.renderer.def(r);break}case"paragraph":{i+=this.renderer.paragraph(r);break}case"text":{i+=this.renderer.text(r);break}default:{let a='Token with "'+r.type+'" type was not found.';if(this.options.silent)return console.error(a),"";throw new Error(a)}}}return i}parseInline(t,i=this.renderer){this.renderer.parser=this;let n="";for(let s=0;s<t.length;s++){let r=t[s];if(this.options.extensions?.renderers?.[r.type]){let o=this.options.extensions.renderers[r.type].call({parser:this},r);if(o!==!1||!["escape","html","link","image","checkbox","strong","em","codespan","br","del","text"].includes(r.type)){n+=o||"";continue}}let a=r;switch(a.type){case"escape":{n+=i.text(a);break}case"html":{n+=i.html(a);break}case"link":{n+=i.link(a);break}case"image":{n+=i.image(a);break}case"checkbox":{n+=i.checkbox(a);break}case"strong":{n+=i.strong(a);break}case"em":{n+=i.em(a);break}case"codespan":{n+=i.codespan(a);break}case"br":{n+=i.br(a);break}case"del":{n+=i.del(a);break}case"text":{n+=i.text(a);break}default:{let o='Token with "'+a.type+'" type was not found.';if(this.options.silent)return console.error(o),"";throw new Error(o)}}}return n}},qc=(Ld=class{constructor(e){he(this,"options");he(this,"block");this.options=e||Ba}preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}emStrongMask(e){return e}provideLexer(e=this.block){return e?Kn.lex:Kn.lexInline}provideParser(e=this.block){return e?Wn.parse:Wn.parseInline}},he(Ld,"passThroughHooks",new Set(["preprocess","postprocess","processAllTokens","emStrongMask"])),he(Ld,"passThroughHooksRespectAsync",new Set(["preprocess","postprocess","processAllTokens"])),Ld);NL=class{constructor(...e){he(this,"defaults",v_());he(this,"options",this.setOptions);he(this,"parse",this.parseMarkdown(!0));he(this,"parseInline",this.parseMarkdown(!1));he(this,"Parser",Wn);he(this,"Renderer",zd);he(this,"TextRenderer",C_);he(this,"Lexer",Kn);he(this,"Tokenizer",fl);he(this,"Hooks",qc);this.use(...e)}walkTokens(e,t){let i=[];for(let n of e)switch(Oa(i,t.call(this,n)),n.type){case"table":{let s=n;for(let r of s.header)Oa(i,this.walkTokens(r.tokens,t));for(let r of s.rows)for(let a of r)Oa(i,this.walkTokens(a.tokens,t));break}case"list":{let s=n;Oa(i,this.walkTokens(s.items,t));break}default:{let s=n;this.defaults.extensions?.childTokens?.[s.type]?this.defaults.extensions.childTokens[s.type].forEach(r=>{let a=s[r].flat(1/0);Oa(i,this.walkTokens(a,t))}):s.tokens&&Oa(i,this.walkTokens(s.tokens,t))}}return i}use(...e){let t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(i=>{let n={...i};if(n.async=this.defaults.async||n.async||!1,i.extensions&&(i.extensions.forEach(s=>{if(!s.name)throw new Error("extension name required");if("renderer"in s){let r=t.renderers[s.name];r?t.renderers[s.name]=function(...a){let o=s.renderer.apply(this,a);return o===!1&&(o=r.apply(this,a)),o}:t.renderers[s.name]=s.renderer}if("tokenizer"in s){if(!s.level||s.level!=="block"&&s.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let r=t[s.level];r?r.unshift(s.tokenizer):t[s.level]=[s.tokenizer],s.start&&(s.level==="block"?t.startBlock?t.startBlock.push(s.start):t.startBlock=[s.start]:s.level==="inline"&&(t.startInline?t.startInline.push(s.start):t.startInline=[s.start]))}"childTokens"in s&&s.childTokens&&(t.childTokens[s.name]=s.childTokens)}),n.extensions=t),i.renderer){let s=this.defaults.renderer||new zd(this.defaults);for(let r in i.renderer){if(!(r in s))throw new Error(`renderer '${r}' does not exist`);if(["options","parser"].includes(r))continue;let a=r,o=i.renderer[a],l=s[a];s[a]=(...c)=>{let u=o.apply(s,c);return u===!1&&(u=l.apply(s,c)),u||""}}n.renderer=s}if(i.tokenizer){let s=this.defaults.tokenizer||new fl(this.defaults);for(let r in i.tokenizer){if(!(r in s))throw new Error(`tokenizer '${r}' does not exist`);if(["options","rules","lexer"].includes(r))continue;let a=r,o=i.tokenizer[a],l=s[a];s[a]=(...c)=>{let u=o.apply(s,c);return u===!1&&(u=l.apply(s,c)),u}}n.tokenizer=s}if(i.hooks){let s=this.defaults.hooks||new qc;for(let r in i.hooks){if(!(r in s))throw new Error(`hook '${r}' does not exist`);if(["options","block"].includes(r))continue;let a=r,o=i.hooks[a],l=s[a];qc.passThroughHooks.has(r)?s[a]=c=>{if(s.options.async&&qc.passThroughHooksRespectAsync.has(r))return(async()=>{let h=await o.call(s,c);return l.call(s,h)})();let u=o.call(s,c);return l.call(s,u)}:s[a]=(...c)=>{if(s.options.async)return(async()=>{let h=await o.apply(s,c);return h===!1&&(h=await l.apply(s,c)),h})();let u=o.apply(s,c);return u===!1&&(u=l.apply(s,c)),u}}n.hooks=s}if(i.walkTokens){let s=this.defaults.walkTokens,r=i.walkTokens;n.walkTokens=function(a){let o=[];return o.push(r.call(this,a)),s&&Oa(o,s.call(this,a)),o}}this.defaults={...this.defaults,...n}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return Kn.lex(e,t??this.defaults)}parser(e,t){return Wn.parse(e,t??this.defaults)}parseMarkdown(e){return(t,i)=>{let n={...i},s={...this.defaults,...n},r=this.onError(!!s.silent,!!s.async);if(this.defaults.async===!0&&n.async===!1)return r(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof t>"u"||t===null)return r(new Error("marked(): input parameter is undefined or null"));if(typeof t!="string")return r(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(t)+", string expected"));if(s.hooks&&(s.hooks.options=s,s.hooks.block=e),s.async)return(async()=>{let a=s.hooks?await s.hooks.preprocess(t):t,o=await(s.hooks?await s.hooks.provideLexer(e):e?Kn.lex:Kn.lexInline)(a,s),l=s.hooks?await s.hooks.processAllTokens(o):o;s.walkTokens&&await Promise.all(this.walkTokens(l,s.walkTokens));let c=await(s.hooks?await s.hooks.provideParser(e):e?Wn.parse:Wn.parseInline)(l,s);return s.hooks?await s.hooks.postprocess(c):c})().catch(r);try{s.hooks&&(t=s.hooks.preprocess(t));let a=(s.hooks?s.hooks.provideLexer(e):e?Kn.lex:Kn.lexInline)(t,s);s.hooks&&(a=s.hooks.processAllTokens(a)),s.walkTokens&&this.walkTokens(a,s.walkTokens);let o=(s.hooks?s.hooks.provideParser(e):e?Wn.parse:Wn.parseInline)(a,s);return s.hooks&&(o=s.hooks.postprocess(o)),o}catch(a){return r(a)}}}onError(e,t){return i=>{if(i.message+=`
79
+ Please report this to https://github.com/markedjs/marked.`,e){let n="<p>An error occurred:</p><pre>"+cn(i.message+"",!0)+"</pre>";return t?Promise.resolve(n):n}if(t)return Promise.reject(i);throw i}}},La=new NL;je.options=je.setOptions=function(e){return La.setOptions(e),je.defaults=La.defaults,lx(je.defaults),je};je.getDefaults=v_;je.defaults=Ba;je.use=AL;je.walkTokens=function(e,t){return La.walkTokens(e,t)};je.parseInline=La.parseInline;je.Parser=Wn;je.parser=Wn.parse;je.Renderer=zd;je.TextRenderer=C_;je.Lexer=Kn;je.lexer=Kn.lex;je.Tokenizer=fl;je.Hooks=qc;je.parse=je;iU=je.options,nU=je.setOptions,sU=je.walkTokens,rU=je.parseInline,aU=Wn.parse,oU=Kn.lex});function ML(e,t){this.v=e,this.k=t}function yx(e,t){(t==null||t>e.length)&&(t=e.length);for(var i=0,n=Array(t);i<t;i++)n[i]=e[i];return n}function OL(e){if(Array.isArray(e))return e}function RL(e,t){var i=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(i!=null){var n,s,r,a,o=[],l=!0,c=!1;try{if(r=(i=i.call(e)).next,t===0){if(Object(i)!==i)return;l=!1}else for(;!(l=(n=r.call(i)).done)&&(o.push(n.value),o.length!==t);l=!0);}catch(u){c=!0,s=u}finally{try{if(!l&&i.return!=null&&(a=i.return(),Object(a)!==a))return}finally{if(c)throw s}}return o}}function DL(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
80
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function LL(e,t){return OL(e)||RL(e,t)||BL(e,t)||DL()}function BL(e,t){if(e){if(typeof e=="string")return yx(e,t);var i={}.toString.call(e).slice(8,-1);return i==="Object"&&e.constructor&&(i=e.constructor.name),i==="Map"||i==="Set"?Array.from(e):i==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?yx(e,t):void 0}}function Pd(e){var t,i;function n(r,a){try{var o=e[r](a),l=o.value,c=l instanceof ML;Promise.resolve(c?l.v:l).then(function(u){if(c){var h=r==="return"&&l.k?r:"next";if(!l.k||u.done)return n(h,u);u=e[h](u).value}s(!!o.done,u)},function(u){n("throw",u)})}catch(u){s(2,u)}}function s(r,a){r===2?t.reject(a):t.resolve({value:a,done:r}),(t=t.next)?n(t.key,t.arg):i=null}this._invoke=function(r,a){return new Promise(function(o,l){var c={key:r,arg:a,resolve:o,reject:l,next:null};i?i=i.next=c:(t=i=c,n(r,a))})},typeof e.return!="function"&&(this.return=void 0)}function mt(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);for(var i=arguments.length,n=new Array(i>1?i-1:0),s=1;s<i;s++)n[s-1]=arguments[s];return B_(e,t,n)}}function Ux(e){return function(){for(var t=arguments.length,i=new Array(t),n=0;n<t;n++)i[n]=arguments[n];return I_(e,i)}}function He(e,t){let i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Ia;if(Sx&&Sx(e,null),!_l(t))return e;let n=t.length;for(;n--;){let s=t[n];if(typeof s=="string"){let r=i(s);r!==s&&(IL(t)||(t[n]=r),s=r)}e[s]=!0}return e}function KL(e){for(let t=0;t<e.length;t++)ji(e,t)||(e[t]=null);return e}function un(e){let t=gl(null);for(let n of Bx(e)){var i=LL(n,2);let s=i[0],r=i[1];ji(e,s)&&(_l(r)?t[s]=KL(r):r&&typeof r=="object"&&r.constructor===Object?t[s]=un(r):t[s]=r)}return t}function WL(e){switch(typeof e){case"string":return e;case"number":return FL(e);case"boolean":return qL(e);case"bigint":return Cx?Cx(e):"0";case"symbol":return kx?kx(e):"Symbol()";case"undefined":return Vc(e);case"function":case"object":{if(e===null)return Vc(e);let t=e,i=Nn(t,"toString");if(typeof i=="function"){let n=i(t);return typeof n=="string"?n:Vc(n)}return Vc(e)}default:return Vc(e)}}function Nn(e,t){for(;e!==null;){let n=zx(e,t);if(n){if(n.get)return mt(n.get);if(typeof n.value=="function")return mt(n.value)}e=Ix(e)}function i(){return null}return i}function GL(e,t){for(;e!==null;){let i=zx(e,t);if(i)return i.get?mt(i.get):null;e=Ix(e)}return null}function $L(e){try{return mi(e,""),!0}catch{return!1}}function Hx(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:a3(),t=W=>Hx(W);if(t.version="3.4.17",t.removed=[],!e||!e.document||e.document.nodeType!==Lt.document||!e.Element)return t.isSupported=!1,t;let i=e.document,n=i,s=n.currentScript;e.DocumentFragment;let r=e.HTMLTemplateElement,a=e.Node,o=e.Element,l=e.NodeFilter;e.NamedNodeMap===void 0&&(e.NamedNodeMap||e.MozNamedAttrMap),e.HTMLFormElement;let c=e.DOMParser,u=e.trustedTypes,h=o.prototype,d=Nn(h,"cloneNode"),f=Nn(h,"remove"),p=Nn(h,"removeAttributeNode"),_=Nn(h,"nextSibling"),v=Nn(h,"childNodes"),g=Nn(h,"parentNode"),m=Nn(h,"shadowRoot"),b=Nn(h,"attributes"),S=a&&a.prototype?Nn(a.prototype,"nodeType"):null,x=a&&a.prototype?Nn(a.prototype,"nodeName"):null,C=a&&a.prototype?Nn(a.prototype,"ownerDocument"):null,N=function(y){return S?S(y):y.nodeType},M=function(y){return x?x(y):y.nodeName},O=GL(h,"namespaceURI"),q=function(y){return O?O(y):y.namespaceURI};if(typeof r=="function"){let W=i.createElement("template");W.content&&W.content.ownerDocument&&(i=W.content.ownerDocument)}let G,I="",P,R=!1,K=0,T=function(){if(K>0)throw Ys('A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.')},D=function(y){T(),K++;try{return G.createHTML(y)}finally{K--}},A=function(y){T(),K++;try{return G.createScriptURL(y)}finally{K--}},Z=function(){return R||(P=o3(u,s),R=!0),P},re=i,L=re.implementation,ee=re.createNodeIterator,Ce=re.createDocumentFragment,ue=re.getElementsByTagName,Ue=n.importNode,Q=Lx();t.isSupported=typeof Bx=="function"&&typeof g=="function"&&L&&L.createHTMLDocument!==void 0;let Oe=VL,_i=XL,zt=ZL,Bi=QL,Ii=JL,vi=e3,ve=t3,mn=n3,oi=Ox,oe=null,zi=He({},[...Tx,...A_,...M_,...O_,...Nx]),ie=null,jn=He({},[...Ax,...R_,...Mx,...Ud]),Ge=Object.seal(gl(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),Ie=null,Vn=null,Pt=Object.seal(gl(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}})),ir=!0,Ts=!0,E=!1,U=!0,$=!1,J=!0,ye=!1,Ct=!1,Xn=null,Za=null,Pf=!1,Qa=!1,Au=!1,Mu=!1,xb=!0,Cb=!1,kb="user-content-",Uf=!0,Hf=!1,Qr=null,Ja={},Jr=null,Tb=He({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","selectedcontent","style","svg","template","thead","title","video","xmp"]),Nb=null,Ab=He({},["audio","video","img","source","image","track"]),Mb=null,Ob=He({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Ou="http://www.w3.org/1998/Math/MathML",Ru="http://www.w3.org/2000/svg",Zn="http://www.w3.org/1999/xhtml",eo=Zn,Ff=!1,qf=null,_M=He({},[Ou,Ru,Zn],N_),Rb=Qt(["mi","mo","mn","ms","mtext"]),Kf=He({},Rb),Db=Qt(["annotation-xml"]),Wf=He({},Db),vM=He({},["title","style","font","a","script"]),Dl=null,bM=["application/xhtml+xml","text/html"],yM="text/html",kt=null,to=null,SM=i.createElement("form"),Lb=function(y){return y instanceof RegExp||y instanceof Function},Gf=function(){let y=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(to&&to===y)return;(!y||typeof y!="object")&&(y={}),y=un(y),Dl=bM.indexOf(y.PARSER_MEDIA_TYPE)===-1?yM:y.PARSER_MEDIA_TYPE,kt=Dl==="application/xhtml+xml"?N_:Ia,oe=Hr(y,"ALLOWED_TAGS",zi,{transform:kt}),ie=Hr(y,"ALLOWED_ATTR",jn,{transform:kt}),qf=Hr(y,"ALLOWED_NAMESPACES",_M,{transform:N_}),Mb=Hr(y,"ADD_URI_SAFE_ATTR",Ob,{transform:kt,base:Ob}),Nb=Hr(y,"ADD_DATA_URI_TAGS",Ab,{transform:kt,base:Ab}),Jr=Hr(y,"FORBID_CONTENTS",Tb,{transform:kt}),Ie=Hr(y,"FORBID_TAGS",un({}),{transform:kt}),Vn=Hr(y,"FORBID_ATTR",un({}),{transform:kt}),Ja=ji(y,"USE_PROFILES")?y.USE_PROFILES&&typeof y.USE_PROFILES=="object"?un(y.USE_PROFILES):y.USE_PROFILES:!1,ir=y.ALLOW_ARIA_ATTR!==!1,Ts=y.ALLOW_DATA_ATTR!==!1,E=y.ALLOW_UNKNOWN_PROTOCOLS||!1,U=y.ALLOW_SELF_CLOSE_IN_ATTR!==!1,$=y.SAFE_FOR_TEMPLATES||!1,J=y.SAFE_FOR_XML!==!1,ye=y.WHOLE_DOCUMENT||!1,Qa=y.RETURN_DOM||!1,Au=y.RETURN_DOM_FRAGMENT||!1,Mu=y.RETURN_TRUSTED_TYPE||!1,Pf=y.FORCE_BODY||!1,xb=y.SANITIZE_DOM!==!1,Cb=y.SANITIZE_NAMED_PROPS||!1,Uf=y.KEEP_CONTENT!==!1,Hf=y.IN_PLACE||!1,oi=$L(y.ALLOWED_URI_REGEXP)?y.ALLOWED_URI_REGEXP:Ox,eo=typeof y.NAMESPACE=="string"?y.NAMESPACE:Zn,Kf=L_(y,"MATHML_TEXT_INTEGRATION_POINTS",()=>He({},Rb)),Wf=L_(y,"HTML_INTEGRATION_POINTS",()=>He({},Db));let k=L_(y,"CUSTOM_ELEMENT_HANDLING",()=>gl(null));if(Ge=gl(null),ji(k,"tagNameCheck")&&Lb(k.tagNameCheck)&&(Ge.tagNameCheck=k.tagNameCheck),ji(k,"attributeNameCheck")&&Lb(k.attributeNameCheck)&&(Ge.attributeNameCheck=k.attributeNameCheck),ji(k,"allowCustomizedBuiltInElements")&&typeof k.allowCustomizedBuiltInElements=="boolean"&&(Ge.allowCustomizedBuiltInElements=k.allowCustomizedBuiltInElements),gi(Ge),$&&(Ts=!1),Au&&(Qa=!0),Ja&&(oe=He({},Nx),ie=gl(null),Ja.html===!0&&(He(oe,Tx),He(ie,Ax)),Ja.svg===!0&&(He(oe,A_),He(ie,R_),He(ie,Ud)),Ja.svgFilters===!0&&(He(oe,M_),He(ie,R_),He(ie,Ud)),Ja.mathMl===!0&&(He(oe,O_),He(ie,Mx),He(ie,Ud))),Pt.tagCheck=null,Pt.attributeCheck=null,ji(y,"ADD_TAGS")&&(typeof y.ADD_TAGS=="function"?Pt.tagCheck=y.ADD_TAGS:_l(y.ADD_TAGS)&&(oe===zi&&(oe=un(oe)),He(oe,y.ADD_TAGS,kt))),ji(y,"ADD_ATTR")&&(typeof y.ADD_ATTR=="function"?Pt.attributeCheck=y.ADD_ATTR:_l(y.ADD_ATTR)&&(ie===jn&&(ie=un(ie)),He(ie,y.ADD_ATTR,kt))),ji(y,"ADD_FORBID_CONTENTS")&&_l(y.ADD_FORBID_CONTENTS)&&(Jr===Tb&&(Jr=un(Jr)),He(Jr,y.ADD_FORBID_CONTENTS,kt)),Uf&&(oe["#text"]=!0),ye&&He(oe,["html","head","body"]),oe.table&&(He(oe,["tbody"]),delete Ie.tbody),y.TRUSTED_TYPES_POLICY){if(typeof y.TRUSTED_TYPES_POLICY.createHTML!="function")throw Ys('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof y.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw Ys('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');let H=G;G=y.TRUSTED_TYPES_POLICY;try{I=D("")}catch(F){throw G=H,F}}else y.TRUSTED_TYPES_POLICY===null?(G=void 0,I=""):(G===void 0&&(G=Z()),G&&typeof I=="string"&&(I=D("")));Qt&&Qt(y),to=y},Bb=He({},[...A_,...M_,...YL]),Ib=He({},[...O_,...jL]),wM=function(y,k,H){return k.namespaceURI===Zn?y==="svg":k.namespaceURI===Ou?y==="svg"&&(H==="annotation-xml"||Kf[H]):!!Bb[y]},EM=function(y,k,H){return k.namespaceURI===Zn?y==="math":k.namespaceURI===Ru?y==="math"&&Wf[H]:!!Ib[y]},xM=function(y,k,H){return k.namespaceURI===Ru&&!Wf[H]||k.namespaceURI===Ou&&!Kf[H]?!1:!Ib[y]&&(vM[y]||!Bb[y])},CM=function(y){let k=q(y),H=Ia(M(y)),F=g(y),le,pe;return F&&N(F)===Lt.element?(le={namespaceURI:q(F)},pe=Ia(M(F))):(le={namespaceURI:eo},pe="template"),qf[k]?k===Ru?wM(H,le,pe):k===Ou?EM(H,le,pe):k===Zn?xM(H,le,pe):!!(Dl==="application/xhtml+xml"&&qf[k]):!1},nr=function(y){$c(t.removed,{element:y});try{g(y).removeChild(y)}catch{if(f(y),!g(y))throw Ys("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place")}},zb=function(y,k,H){try{p(y,k)}catch{try{y.removeAttribute(H)}catch{}}},$f=function(y){jf(y);let k=v(y);k&&$s(PL(k),F=>{try{f(F)}catch{}});let H=N(y)===Lt.element?b(y):null;if(H)for(let F=H.length-1;F>=0;--F){let le=H[F],pe=le&&le.name;typeof pe=="string"&&zb(y,le,pe)}},io=function(y,k,H){if(!H)try{H=k.getAttributeNode(y)}catch{H=null}$c(t.removed,{attribute:H||null,from:k});try{H?p(k,H):k.removeAttribute(y)}catch{try{k.removeAttribute(y)}catch{}}if(y==="is")if(Qa||Au)try{nr(k)}catch{}else try{k.setAttribute(y,"")}catch{}},Pb=function(y){let k=b(y);if(k)for(let H=k.length-1;H>=0;--H){let F=k[H],le=F&&F.name;typeof le!="string"||ie[kt(le)]||zb(y,F,le)}},Yf=function(y,k){let H=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,F=[y];for(;F.length>0;){let le=F.pop();if(k(le)===!1)continue;if(H&&N(le)===Lt.element){let Ae=m(le);sr(Ae)&&F.push(Ae)}let pe=v(le);if(pe)for(let Ae=pe.length-1;Ae>=0;--Ae)F.push(pe[Ae])}},jf=function(y){Yf(y,k=>{N(k)===Lt.element&&Pb(k)})},Vf=function(y){let k=[];return Yf(y,H=>{k.push(H)},!0),k},kM=function(y,k){let H=k_();$s(Vf(y),F=>{N(F)===Lt.element&&T_(H,F)}),$s(k,F=>{N(F)===Lt.element&&!Yc(H,F)&&Pb(F)})},Ub=function(y,k){let H=!1;return $s(t.removed,F=>{F.element&&(H=H||F.element===y,jf(F.element))}),kM(y,k),H},TM=8,NM=function(y,k){let H=Qr,F=null,le=()=>(F||(F=k_(),$s(k,pe=>{T_(F,pe)})),F);for(let pe=0;;pe++){let Ae=Vf(y),Ut=[y],Qn=!1;if($s(Ae,Ti=>{N(Ti)===Lt.documentFragment?$c(Ut,Ti):!Qn&&!Yc(H,Ti)&&(Qn=Yc(le(),Ti))}),!Qn)return;if(pe>=TM)throw Ys("the tree kept changing during in-place sanitization; refusing to return it");$s(Ut,(Ti,Pi)=>{AM(Ti,Pi>0,y,le())})}},AM=function(y,k,H,F){let le=Xf(y),pe;for(;pe=le.nextNode();)!Yc(F,pe)||Yc(Qr,pe)||(k&&Bn(Q.uponSanitizeShadowNode,pe,null),Qf(pe,H),Jf(pe,H),sr(pe.content)&&Bl(pe.content))},MM=function(y){Qr&&T_(Qr,y)},Hb=function(y,k){return J?y==="patchsrc"?!0:y==="for"&&k!=="label"&&k!=="output":!1},OM=function(y){J&&Yf(y,k=>{let H=N(k);if(H===Lt.processingInstruction||H===Lt.comment&&mi(Rx,k.data)){try{f(k)}catch{}return!1}if(H===Lt.element){let F=k,le=kt(M(k));try{F.hasAttribute&&F.hasAttribute("patchsrc")&&F.removeAttribute("patchsrc"),F.hasAttribute&&F.hasAttribute("for")&&Hb("for",le)&&F.removeAttribute("for")}catch{}}return!0})},Fb=function(y){let k=null,H=null;if(Pf)y="<remove></remove>"+y;else{let pe=Ex(y,/^[\r\n\t ]+/);H=pe&&pe[0]}Dl==="application/xhtml+xml"&&eo===Zn&&(y='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+y+"</body></html>");let F=G?D(y):y;if(eo===Zn)try{k=new c().parseFromString(F,Dl)}catch{}if(!k||!k.documentElement){k=L.createDocument(eo,"template",null);try{k.documentElement.innerHTML=Ff?I:F}catch{}}let le=k.body||k.documentElement;return y&&H&&le.insertBefore(i.createTextNode(H),le.childNodes[0]||null),eo===Zn?ue.call(k,ye?"html":"body")[0]:ye?k.documentElement:le},Xf=function(y){let k=C?C(y):y.ownerDocument;return ee.call(k||y,y,l.SHOW_ELEMENT|l.SHOW_COMMENT|l.SHOW_TEXT|l.SHOW_PROCESSING_INSTRUCTION|l.SHOW_CDATA_SECTION,null)},Du=function(y){return y=jc(y,Oe," "),y=jc(y,_i," "),y=jc(y,zt," "),y},Zf=function(y){var k;qb(y);let H=(k=y.querySelectorAll)===null||k===void 0?void 0:k.call(y,"template");H&&$s(H,F=>{sr(F.content)&&Zf(F.content)})},qb=function(y){y.normalize();let k=C?C(y):y.ownerDocument,H=ee.call(k||y,y,l.SHOW_TEXT|l.SHOW_COMMENT|l.SHOW_CDATA_SECTION|l.SHOW_PROCESSING_INSTRUCTION,null),F=H.nextNode();for(;F;)F.data=Du(F.data),F=H.nextNode()},Lu=function(y){let k=x?x(y):null;return typeof k!="string"||kt(k)!=="form"?!1:typeof y.nodeName!="string"||typeof y.textContent!="string"||typeof y.removeChild!="function"||y.attributes!==b(y)||typeof y.removeAttribute!="function"||typeof y.removeAttributeNode!="function"||typeof y.getAttributeNode!="function"||typeof y.setAttribute!="function"||typeof y.namespaceURI!="string"||typeof y.insertBefore!="function"||typeof y.hasChildNodes!="function"||y.nodeType!==S(y)||y.childNodes!==v(y)},sr=function(y){if(!S||typeof y!="object"||y===null)return!1;try{return S(y)===Lt.documentFragment}catch{return!1}},Ll=function(y){if(!S||typeof y!="object"||y===null)return!1;try{return typeof S(y)=="number"}catch{return!1}};function Bn(W,y,k){W.length!==0&&$s(W,H=>{H.call(t,y,k,to)})}let RM=function(y,k){return!!(J&&y.hasChildNodes()&&!Ll(y.firstElementChild)&&mi(D_,y.textContent)&&mi(D_,y.innerHTML)||J&&r3[k]&&N(y)===Lt.element&&q(y)===Zn&&(Ll(y.firstElementChild)||typeof y.textContent=="string"&&mi(D_,y.textContent))||y.nodeType===Lt.processingInstruction||J&&y.nodeType===Lt.comment&&mi(Rx,y.data))},Bu=function(y,k){if(y instanceof RegExp)return mi(y,k);if(y instanceof Function){for(var H=arguments.length,F=new Array(H>2?H-2:0),le=2;le<H;le++)F[le-2]=arguments[le];return!!y(k,...F)}return!1},DM=function(y,k,H){if(!Ie[k]&&Gb(k)&&Bu(Ge.tagNameCheck,k))return!1;if(Uf&&!Jr[k]&&!Jr[Ia(k)]){let F=g(y),le=v(y);if(le&&F){let pe=le.length;for(let Ae=pe-1;Ae>=0;--Ae){let Ut=y===H?d(le[Ae],!0):le[Ae];F.insertBefore(Ut,_(y))}}}return nr(y),!0},Kb=function(y,k,H,F){return y.length===0?k:k===H||k===F?un(k):k},no=function(y,k){return y===k||g(y)!==null?!1:(Hf&&jf(y),!0)},Qf=function(y,k){if(MM(y),Bn(Q.beforeSanitizeElements,y,null),no(y,k))return!0;if(Lu(y))return nr(y),!0;let H=kt(M(y));if(oe=Kb(Q.uponSanitizeElement,oe,zi,Xn),Bn(Q.uponSanitizeElement,y,{tagName:H,allowedTags:oe}),no(y,k))return!0;if(RM(y,H))return nr(y),!0;if(Ie[H]||!(Pt.tagCheck instanceof Function&&Pt.tagCheck(H))&&!oe[H]){let F=DM(y,H,k);return F===!1&&(Bn(Q.afterSanitizeElements,y,null),no(y,k))?!0:F}if(N(y)===Lt.element&&!CM(y)||(H==="noscript"||H==="noembed"||H==="noframes")&&mi(s3,y.innerHTML))return nr(y),!0;if($&&y.nodeType===Lt.text){let F=Du(y.textContent);y.textContent!==F&&($c(t.removed,{element:y.cloneNode()}),y.textContent=F)}return Bn(Q.afterSanitizeElements,y,null),no(y,k)},Wb=function(y,k,H){if(Vn[k]||Hb(k,y)||xb&&(k==="id"||k==="name")&&(H in i||H in SM))return!1;let F=ie[k]||Pt.attributeCheck instanceof Function&&Pt.attributeCheck(k,y);return Ts&&mi(Bi,k)||ir&&mi(Ii,k)?!0:F?Mb[k]||mi(oi,jc(H,ve,""))||(k==="src"||k==="xlink:href"||k==="href")&&y!=="script"&&xx(H,"data:")===0&&Nb[y]||E&&!mi(vi,jc(H,ve,""))?!0:!H:Gb(y)&&Bu(Ge.tagNameCheck,y)&&Bu(Ge.attributeNameCheck,k,y)||k==="is"&&Ge.allowCustomizedBuiltInElements&&Bu(Ge.tagNameCheck,H)},LM=He({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),Gb=function(y){return!LM[Ia(y)]&&mi(mn,y)},BM=function(y,k,H,F){if(G&&typeof u=="object"&&typeof u.getAttributeType=="function"&&!H)switch(u.getAttributeType(y,k)){case"TrustedHTML":return D(F);case"TrustedScriptURL":return A(F)}return F},IM=function(y,k,H,F){try{return H?y.setAttributeNS(H,k,F):y.setAttribute(k,F),Lu(y)?(nr(y),!1):!0}catch{return io(k,y),!1}},$b=function(y,k){return J&&mi(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,k)?!0:Ia(y)==="attributename"&&Ex(k,"href")!==null},Jf=function(y,k){if(Bn(Q.beforeSanitizeAttributes,y,null),no(y,k))return;let H=y.attributes;if(!H||Lu(y))return;ie=Kb(Q.uponSanitizeAttribute,ie,jn,Za);let F={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:ie,forceKeepAttr:void 0},le=H.length,pe=kt(y.nodeName);for(;le--;){let Ae=H[le],Ut=Ae.name,Qn=Ae.namespaceURI,Ti=Ae.value,Pi=kt(Ut),so=Ti,Ui=Ut==="value"?so:HL(so),Yb=!1;if(F.attrName=Pi,F.attrValue=Ui,F.keepAttr=!0,F.forceKeepAttr=void 0,Bn(Q.uponSanitizeAttribute,y,F),Ui=F.attrValue,Cb&&(Pi==="id"||Pi==="name")&&xx(Ui,kb)!==0&&(io(Ut,y,Ae),Ui=kb+Ui,Yb=!0),$b(Ut,Ui)){io(Ut,y,Ae);continue}if(!F.forceKeepAttr){if(!F.keepAttr){io(Ut,y,Ae);continue}if(!U&&mi(Dx,Ui)){io(Ut,y,Ae);continue}if($&&(Ui=Du(Ui)),!Wb(pe,Pi,Ui)){io(Ut,y,Ae);continue}Ui=BM(pe,Pi,Qn,Ui),Ui!==so&&IM(y,Ut,Qn,Ui)&&Yb&&wx(t.removed)}}Bn(Q.afterSanitizeAttributes,y,null),no(y,k)},Bl=function(y){let k=null,H=Xf(y);for(Bn(Q.beforeSanitizeShadowDOM,y,null);k=H.nextNode();)if(Bn(Q.uponSanitizeShadowNode,k,null),Qf(k,y),Jf(k,y),sr(k.content)&&Bl(k.content),N(k)===Lt.element){let F=m(k);sr(F)&&(ep(F),Bl(F))}$&&qb(y),Bn(Q.afterSanitizeShadowDOM,y,null)},ep=function(y){let k=[{node:y,shadow:null}];for(;k.length>0;){let H=k.pop();if(H.shadow){Bl(H.shadow);continue}let F=H.node,le=N(F)===Lt.element,pe=v(F);if(pe)for(let Ae=pe.length-1;Ae>=0;--Ae)k.push({node:pe[Ae],shadow:null});if(le){let Ae=x?x(F):null;if(typeof Ae=="string"&&kt(Ae)==="template"){let Ut=F.content;sr(Ut)&&k.push({node:Ut,shadow:null})}}if(le){let Ae=m(F);sr(Ae)&&k.push({node:null,shadow:Ae},{node:Ae,shadow:null})}}};return t.sanitize=function(W){let y=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},k=null,H=null,F=null,le=null;if(Ff=!W,Ff&&(W="<!-->"),typeof W!="string"&&!Ll(W)&&(W=WL(W),typeof W!="string"))throw Ys("dirty is not a string, aborting");if(!t.isSupported)return W;Ct?(oe=Xn,ie=Za):Gf(y),(Q.uponSanitizeElement.length>0||Q.uponSanitizeAttribute.length>0)&&(oe=un(oe)),Q.uponSanitizeAttribute.length>0&&(ie=un(ie)),t.removed=[];let pe=Hf&&typeof W!="string"&&Ll(W),Ae=[],Ut=Qr;if(pe){OM(W);let Pi=M(W);if(typeof Pi=="string"){let so=kt(Pi);if(!oe[so]||Ie[so])throw $f(W),Ys("root node is forbidden and cannot be sanitized in-place")}if(Lu(W))throw $f(W),Ys("root node is clobbered and cannot be sanitized in-place");Ae=Vf(W),Qr=k_()}else if(Ll(W))k=Fb("<!---->"),H=k.ownerDocument.importNode(W,!0),H.nodeType===Lt.element&&H.nodeName==="BODY"||H.nodeName==="HTML"?k=H:k.appendChild(H),ep(k);else{if(!Qa&&!$&&!ye&&W.indexOf("<")===-1)return G&&Mu?D(W):W;if(k=Fb(W),!k)return Qa?null:Mu?I:""}k&&Pf&&nr(k.firstChild);let Qn=pe?W:k;try{pe&&ep(W);let Pi=Xf(Qn);for(;F=Pi.nextNode();)Qf(F,Qn),Jf(F,Qn),sr(F.content)&&Bl(F.content);pe&&NM(W,Ae)}catch(Pi){throw pe&&($f(W),Ub(W,Ae)),Pi}finally{Qr=Ut}if(pe){if(Ub(W,Ae))throw Ys("a node selected for removal could not be safely returned; refusing to sanitize in place");return $&&Zf(W),W}if(Qa){if($&&Zf(k),Au)for(le=Ce.call(k.ownerDocument);k.firstChild;)le.appendChild(k.firstChild);else le=k;return(ie.shadowroot||ie.shadowrootmode)&&(le=Ue.call(n,le,!0)),le}let Ti=ye?k.outerHTML:k.innerHTML;return ye&&oe["!doctype"]&&k.ownerDocument&&k.ownerDocument.doctype&&k.ownerDocument.doctype.name&&mi(i3,k.ownerDocument.doctype.name)&&(Ti="<!DOCTYPE "+k.ownerDocument.doctype.name+`>
81
+ `+Ti),$&&(Ti=Du(Ti)),G&&Mu?D(Ti):Ti},t.setConfig=function(){let W=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Gf(W),Ct=!0,Xn=oe,Za=ie},t.clearConfig=function(){to=null,Ct=!1,Xn=null,Za=null,G=P,I=""},t.isValidAttribute=function(W,y,k){to||Gf({});let H=kt(W),F=kt(y);return typeof k=="string"&&($b(y,k)||!U&&mi(Dx,k))?!1:Wb(H,F,k)},t.addHook=function(W,y){typeof y=="function"&&ji(Q,W)&&$c(Q[W],y)},t.removeHook=function(W,y){if(ji(Q,W)){if(y!==void 0){let k=zL(Q[W],y);return k===-1?void 0:UL(Q[W],k,1)[0]}return wx(Q[W])}},t.removeHooks=function(W){ji(Q,W)&&(Q[W]=[])},t.removeAllHooks=function(){Q=Lx()},t}var Bx,Sx,IL,Ix,zx,Qt,gi,gl,Px,B_,I_,$s,zL,wx,$c,PL,UL,_l,k_,T_,Yc,Ia,N_,Ex,jc,xx,HL,FL,qL,Cx,kx,ji,Vc,mi,Ys,Tx,A_,M_,YL,O_,jL,Nx,Ax,R_,Mx,Ud,VL,XL,ZL,QL,JL,Ox,e3,t3,i3,n3,D_,Rx,s3,Dx,Lt,r3,a3,o3,Lx,Hr,L_,Fx,qx=ce(()=>{Pd.prototype[typeof Symbol=="function"&&Symbol.asyncIterator||"@@asyncIterator"]=function(){return this},Pd.prototype.next=function(e){return this._invoke("next",e)},Pd.prototype.throw=function(e){return this._invoke("throw",e)},Pd.prototype.return=function(e){return this._invoke("return",e)};Bx=Object.entries,Sx=Object.setPrototypeOf,IL=Object.isFrozen,Ix=Object.getPrototypeOf,zx=Object.getOwnPropertyDescriptor,Qt=Object.freeze,gi=Object.seal,gl=Object.create,Px=typeof Reflect<"u"&&Reflect,B_=Px.apply,I_=Px.construct;Qt||(Qt=function(t){return t});gi||(gi=function(t){return t});B_||(B_=function(t,i){for(var n=arguments.length,s=new Array(n>2?n-2:0),r=2;r<n;r++)s[r-2]=arguments[r];return t.apply(i,s)});I_||(I_=function(t){for(var i=arguments.length,n=new Array(i>1?i-1:0),s=1;s<i;s++)n[s-1]=arguments[s];return new t(...n)});$s=mt(Array.prototype.forEach);Array.prototype.indexOf;zL=mt(Array.prototype.lastIndexOf),wx=mt(Array.prototype.pop),$c=mt(Array.prototype.push),PL=mt(Array.prototype.slice),UL=mt(Array.prototype.splice),_l=Array.isArray,k_=Ux(Set),T_=mt(Set.prototype.add),Yc=mt(Set.prototype.has),Ia=mt(String.prototype.toLowerCase),N_=mt(String.prototype.toString),Ex=mt(String.prototype.match),jc=mt(String.prototype.replace),xx=mt(String.prototype.indexOf),HL=mt(String.prototype.trim),FL=mt(Number.prototype.toString),qL=mt(Boolean.prototype.toString),Cx=typeof BigInt>"u"?null:mt(BigInt.prototype.toString),kx=typeof Symbol>"u"?null:mt(Symbol.prototype.toString),ji=mt(Object.prototype.hasOwnProperty),Vc=mt(Object.prototype.toString),mi=mt(RegExp.prototype.test),Ys=Ux(TypeError);Tx=Qt(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),A_=Qt(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),M_=Qt(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),YL=Qt(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),O_=Qt(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),jL=Qt(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),Nx=Qt(["#text"]),Ax=Qt(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","command","commandfor","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns"]),R_=Qt(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dominant-baseline","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","mask-type","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","pointer-events","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-orientation","text-rendering","textlength","type","u1","u2","unicode","values","vector-effect","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),Mx=Qt(["accent","accentunder","align","bevelled","close","columnalign","columnlines","columnspacing","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lquote","lspace","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),Ud=Qt(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),VL=gi(/{{[\w\W]*|^[\w\W]*}}/g),XL=gi(/<%[\w\W]*|^[\w\W]*%>/g),ZL=gi(/\${[\w\W]*/g),QL=gi(/^data-[\-\w.\u00B7-\uFFFF]+$/),JL=gi(/^aria-[\-\w]+$/),Ox=gi(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),e3=gi(/^(?:\w+script|data):/i),t3=gi(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),i3=gi(/^html$/i),n3=gi(/^[a-z][.\w]*(-[.\w]+)+$/i),D_=gi(/<[/\w!]/g),Rx=gi(/<[/\w]/g),s3=gi(/<\/no(script|embed|frames)/i),Dx=gi(/\/>/i),Lt={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,processingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},r3=Qt(He({},["style","script","xmp","iframe","noembed","noframes","plaintext","noscript"])),a3=function(){return typeof window>"u"?null:window},o3=function(t,i){if(typeof t!="object"||typeof t.createPolicy!="function")return null;let n=null,s="data-tt-policy-suffix";i&&i.hasAttribute(s)&&(n=i.getAttribute(s));let r="dompurify"+(n?"#"+n:"");try{return t.createPolicy(r,{createHTML(a){return a},createScriptURL(a){return a}})}catch{return console.warn("TrustedTypes policy "+r+" could not be created."),null}},Lx=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},Hr=function(t,i,n,s){return ji(t,i)&&_l(t[i])?He(s.base?un(s.base):{},t[i],s.transform):n},L_=function(t,i,n){let s=ji(t,i)?t[i]:void 0;return s&&typeof s=="object"?un(s):n()};Fx=Hx()});var lC=me((gU,oC)=>{function Vx(e){return e instanceof Map?e.clear=e.delete=e.set=function(){throw new Error("map is read-only")}:e instanceof Set&&(e.add=e.clear=e.delete=function(){throw new Error("set is read-only")}),Object.freeze(e),Object.getOwnPropertyNames(e).forEach(t=>{let i=e[t],n=typeof i;(n==="object"||n==="function")&&!Object.isFrozen(i)&&Vx(i)}),e}var Fd=class{constructor(t){t.data===void 0&&(t.data={}),this.data=t.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}};function Xx(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#x27;")}function Fr(e,...t){let i=Object.create(null);for(let n in e)i[n]=e[n];return t.forEach(function(n){for(let s in n)i[s]=n[s]}),i}var l3="</span>",Kx=e=>!!e.scope,c3=(e,{prefix:t})=>{if(e.startsWith("language:"))return e.replace("language:","language-");if(e.includes(".")){let i=e.split(".");return[`${t}${i.shift()}`,...i.map((n,s)=>`${n}${"_".repeat(s+1)}`)].join(" ")}return`${t}${e}`},P_=class{constructor(t,i){this.buffer="",this.classPrefix=i.classPrefix,t.walk(this)}addText(t){this.buffer+=Xx(t)}openNode(t){if(!Kx(t))return;let i=c3(t.scope,{prefix:this.classPrefix});this.span(i)}closeNode(t){Kx(t)&&(this.buffer+=l3)}value(){return this.buffer}span(t){this.buffer+=`<span class="${t}">`}},Wx=(e={})=>{let t={children:[]};return Object.assign(t,e),t},U_=class e{constructor(){this.rootNode=Wx(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(t){this.top.children.push(t)}openNode(t){let i=Wx({scope:t});this.add(i),this.stack.push(i)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(t){return this.constructor._walk(t,this.rootNode)}static _walk(t,i){return typeof i=="string"?t.addText(i):i.children&&(t.openNode(i),i.children.forEach(n=>this._walk(t,n)),t.closeNode(i)),t}static _collapse(t){typeof t!="string"&&t.children&&(t.children.every(i=>typeof i=="string")?t.children=[t.children.join("")]:t.children.forEach(i=>{e._collapse(i)}))}},H_=class extends U_{constructor(t){super(),this.options=t}addText(t){t!==""&&this.add(t)}startScope(t){this.openNode(t)}endScope(){this.closeNode()}__addSublanguage(t,i){let n=t.root;i&&(n.scope=`language:${i}`),this.add(n)}toHTML(){return new P_(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}};function Xc(e){return e?typeof e=="string"?e:e.source:null}function Zx(e){return Pa("(?=",e,")")}function u3(e){return Pa("(?:",e,")*")}function h3(e){return Pa("(?:",e,")?")}function Pa(...e){return e.map(i=>Xc(i)).join("")}function d3(e){let t=e[e.length-1];return typeof t=="object"&&t.constructor===Object?(e.splice(e.length-1,1),t):{}}function Kd(...e){return"("+(d3(e).capture?"":"?:")+e.map(n=>Xc(n)).join("|")+")"}function Qx(e){return new RegExp(e.toString()+"|").exec("").length-1}function f3(e,t){let i=e&&e.exec(t);return i&&i.index===0}var p3=new RegExp(Kd(/\[(?:[^\\\]]|\\.)*\]/,/\(\?<(?![=!])[^>]+>/,/\(\?'[^']+'/,/\(\??/,/\\([1-9][0-9]*)/,/\\./));function q_(e,{joinWith:t}){let i=0;return e.map(n=>{i+=1;let s=i,r=Xc(n),a="";for(;r.length>0;){let o=p3.exec(r);if(!o){a+=r;break}a+=r.substring(0,o.index),r=r.substring(o.index+o[0].length),o[0][0]==="\\"&&o[1]?a+="\\"+String(Number(o[1])+s):(a+=o[0],(o[0]==="("||/^\(\?[<']/.test(o[0]))&&i++)}return a}).map(n=>`(${n})`).join(t)}var m3=/\b\B/,Jx="[a-zA-Z]\\w*",K_="[a-zA-Z_]\\w*",eC="\\b\\d+(\\.\\d+)?",tC="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",iC="\\b(0b[01]+)",g3="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",_3=(e={})=>{let t=/^#![ ]*\//;return e.binary&&(e.begin=Pa(t,/.*\b/,e.binary,/\b.*/)),Fr({scope:"meta",begin:t,end:/$/,relevance:0,"on:begin":(i,n)=>{i.index!==0&&n.ignoreMatch()}},e)},Zc={begin:"\\\\[\\s\\S]",relevance:0},v3={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[Zc]},b3={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[Zc]},y3={begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},Wd=function(e,t,i={}){let n=Fr({scope:"comment",begin:e,end:t,contains:[]},i);n.contains.push({scope:"doctag",begin:"[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)",end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0});let s=Kd("I","a","is","so","us","to","at","if","in","it","on",/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/);return n.contains.push({begin:Pa(/[ ]+/,"(",s,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),n},S3=Wd("//","$"),w3=Wd("/\\*","\\*/"),E3=Wd("#","$"),x3={scope:"number",begin:eC,relevance:0},C3={scope:"number",begin:tC,relevance:0},k3={scope:"number",begin:iC,relevance:0},T3={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[Zc,{begin:/\[/,end:/\]/,relevance:0,contains:[Zc]}]},N3={scope:"title",begin:Jx,relevance:0},A3={scope:"title",begin:K_,relevance:0},M3={begin:"\\.\\s*"+K_,relevance:0},O3=function(e){return Object.assign(e,{"on:begin":(t,i)=>{i.data._beginMatch=t[1]},"on:end":(t,i)=>{i.data._beginMatch!==t[1]&&i.ignoreMatch()}})},Hd=Object.freeze({__proto__:null,APOS_STRING_MODE:v3,BACKSLASH_ESCAPE:Zc,BINARY_NUMBER_MODE:k3,BINARY_NUMBER_RE:iC,COMMENT:Wd,C_BLOCK_COMMENT_MODE:w3,C_LINE_COMMENT_MODE:S3,C_NUMBER_MODE:C3,C_NUMBER_RE:tC,END_SAME_AS_BEGIN:O3,HASH_COMMENT_MODE:E3,IDENT_RE:Jx,MATCH_NOTHING_RE:m3,METHOD_GUARD:M3,NUMBER_MODE:x3,NUMBER_RE:eC,PHRASAL_WORDS_MODE:y3,QUOTE_STRING_MODE:b3,REGEXP_MODE:T3,RE_STARTERS_RE:g3,SHEBANG:_3,TITLE_MODE:N3,UNDERSCORE_IDENT_RE:K_,UNDERSCORE_TITLE_MODE:A3});function R3(e,t){e.input[e.index-1]==="."&&t.ignoreMatch()}function D3(e,t){e.className!==void 0&&(e.scope=e.className,delete e.className)}function L3(e,t){t&&e.beginKeywords&&(e.begin="\\b("+e.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",e.__beforeBegin=R3,e.keywords=e.keywords||e.beginKeywords,delete e.beginKeywords,e.relevance===void 0&&(e.relevance=0))}function B3(e,t){Array.isArray(e.illegal)&&(e.illegal=Kd(...e.illegal))}function I3(e,t){if(e.match){if(e.begin||e.end)throw new Error("begin & end are not supported with match");e.begin=e.match,delete e.match}}function z3(e,t){e.relevance===void 0&&(e.relevance=1)}var P3=(e,t)=>{if(!e.beforeMatch)return;if(e.starts)throw new Error("beforeMatch cannot be used with starts");let i=Object.assign({},e);Object.keys(e).forEach(n=>{delete e[n]}),e.keywords=i.keywords,e.begin=Pa(i.beforeMatch,Zx(i.begin)),e.starts={relevance:0,contains:[Object.assign(i,{endsParent:!0})]},e.relevance=0,delete i.beforeMatch},U3=["of","and","for","in","not","or","if","then","parent","list","value"],H3="keyword";function nC(e,t,i=H3){let n=Object.create(null);return typeof e=="string"?s(i,e.split(" ")):Array.isArray(e)?s(i,e):Object.keys(e).forEach(function(r){Object.assign(n,nC(e[r],t,r))}),n;function s(r,a){t&&(a=a.map(o=>o.toLowerCase())),a.forEach(function(o){let l=o.split("|");n[l[0]]=[r,F3(l[0],l[1])]})}}function F3(e,t){return t?Number(t):q3(e)?0:1}function q3(e){return U3.includes(e.toLowerCase())}var Gx={},za=e=>{console.error(e)},$x=(e,...t)=>{console.log(`WARN: ${e}`,...t)},vl=(e,t)=>{Gx[`${e}/${t}`]||(console.log(`Deprecated as of ${e}. ${t}`),Gx[`${e}/${t}`]=!0)},qd=new Error;function sC(e,t,{key:i}){let n=0,s=e[i],r={},a={};for(let o=1;o<=t.length;o++)a[o+n]=s[o],r[o+n]=!0,n+=Qx(t[o-1]);e[i]=a,e[i]._emit=r,e[i]._multi=!0}function K3(e){if(Array.isArray(e.begin)){if(e.skip||e.excludeBegin||e.returnBegin)throw za("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),qd;if(typeof e.beginScope!="object"||e.beginScope===null)throw za("beginScope must be object"),qd;sC(e,e.begin,{key:"beginScope"}),e.begin=q_(e.begin,{joinWith:""})}}function W3(e){if(Array.isArray(e.end)){if(e.skip||e.excludeEnd||e.returnEnd)throw za("skip, excludeEnd, returnEnd not compatible with endScope: {}"),qd;if(typeof e.endScope!="object"||e.endScope===null)throw za("endScope must be object"),qd;sC(e,e.end,{key:"endScope"}),e.end=q_(e.end,{joinWith:""})}}function G3(e){e.scope&&typeof e.scope=="object"&&e.scope!==null&&(e.beginScope=e.scope,delete e.scope)}function $3(e){G3(e),typeof e.beginScope=="string"&&(e.beginScope={_wrap:e.beginScope}),typeof e.endScope=="string"&&(e.endScope={_wrap:e.endScope}),K3(e),W3(e)}function Y3(e){function t(a,o){return new RegExp(Xc(a),"m"+(e.case_insensitive?"i":"")+(e.unicodeRegex?"u":"")+(o?"g":""))}class i{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(o,l){l.position=this.position++,this.matchIndexes[this.matchAt]=l,this.regexes.push([l,o]),this.matchAt+=Qx(o)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);let o=this.regexes.map(l=>l[1]);this.matcherRe=t(q_(o,{joinWith:"|"}),!0),this.lastIndex=0}exec(o){this.matcherRe.lastIndex=this.lastIndex;let l=this.matcherRe.exec(o);if(!l)return null;let c=l.findIndex((h,d)=>d>0&&h!==void 0),u=this.matchIndexes[c];return l.splice(0,c),Object.assign(l,u)}}class n{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(o){if(this.multiRegexes[o])return this.multiRegexes[o];let l=new i;return this.rules.slice(o).forEach(([c,u])=>l.addRule(c,u)),l.compile(),this.multiRegexes[o]=l,l}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(o,l){this.rules.push([o,l]),l.type==="begin"&&this.count++}exec(o){let l=this.getMatcher(this.regexIndex);l.lastIndex=this.lastIndex;let c=l.exec(o);if(this.resumingScanAtSamePosition()&&!(c&&c.index===this.lastIndex)){let u=this.getMatcher(0);u.lastIndex=this.lastIndex+1,c=u.exec(o)}return c&&(this.regexIndex+=c.position+1,this.regexIndex===this.count&&this.considerAll()),c}}function s(a){let o=new n;return a.contains.forEach(l=>o.addRule(l.begin,{rule:l,type:"begin"})),a.terminatorEnd&&o.addRule(a.terminatorEnd,{type:"end"}),a.illegal&&o.addRule(a.illegal,{type:"illegal"}),o}function r(a,o){let l=a;if(a.isCompiled)return l;[D3,I3,$3,P3].forEach(u=>u(a,o)),e.compilerExtensions.forEach(u=>u(a,o)),a.__beforeBegin=null,[L3,B3,z3].forEach(u=>u(a,o)),a.isCompiled=!0;let c=null;return typeof a.keywords=="object"&&a.keywords.$pattern&&(a.keywords=Object.assign({},a.keywords),c=a.keywords.$pattern,delete a.keywords.$pattern),c=c||/\w+/,a.keywords&&(a.keywords=nC(a.keywords,e.case_insensitive)),l.keywordPatternRe=t(c,!0),o&&(a.begin||(a.begin=/\B|\b/),l.beginRe=t(l.begin),!a.end&&!a.endsWithParent&&(a.end=/\B|\b/),a.end&&(l.endRe=t(l.end)),l.terminatorEnd=Xc(l.end)||"",a.endsWithParent&&o.terminatorEnd&&(l.terminatorEnd+=(a.end?"|":"")+o.terminatorEnd)),a.illegal&&(l.illegalRe=t(a.illegal)),a.contains||(a.contains=[]),a.contains=[].concat(...a.contains.map(function(u){return j3(u==="self"?a:u)})),a.contains.forEach(function(u){r(u,l)}),a.starts&&r(a.starts,o),l.matcher=s(l),l}if(e.compilerExtensions||(e.compilerExtensions=[]),e.contains&&e.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return e.classNameAliases=Fr(e.classNameAliases||{}),r(e)}function rC(e){return e?e.endsWithParent||rC(e.starts):!1}function j3(e){return e.variants&&!e.cachedVariants&&(e.cachedVariants=e.variants.map(function(t){return Fr(e,{variants:null},t)})),e.cachedVariants?e.cachedVariants:rC(e)?Fr(e,{starts:e.starts?Fr(e.starts):null}):Object.isFrozen(e)?Fr(e):e}var V3="11.12.0",F_=class extends Error{constructor(t,i){super(t),this.name="HTMLInjectionError",this.html=i}},z_=Xx,Yx=Fr,jx=Symbol("nomatch"),X3=7,aC=function(e){let t=Object.create(null),i=Object.create(null),n=[],s=!0,r="Could not find the language '{}', did you forget to load/include a language module?",a={disableAutodetect:!0,name:"Plain text",contains:[]},o={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:H_};function l(T){return o.noHighlightRe.test(T)}function c(T){let D=T.className+" ";D+=T.parentNode?T.parentNode.className:"";let A=o.languageDetectRe.exec(D);if(A){let Z=M(A[1]);return Z||($x(r.replace("{}",A[1])),$x("Falling back to no-highlight mode for this block.",T)),Z?A[1]:"no-highlight"}return D.split(/\s+/).find(Z=>l(Z)||M(Z))}function u(T,D,A){let Z="",re="";typeof D=="object"?(Z=T,A=D.ignoreIllegals,re=D.language):(vl("10.7.0","highlight(lang, code, ...args) has been deprecated."),vl("10.7.0",`Please use highlight(code, options) instead.
82
+ https://github.com/highlightjs/highlight.js/issues/2277`),re=T,Z=D),A===void 0&&(A=!0);let L={code:Z,language:re};R("before:highlight",L);let ee=L.result?L.result:h(L.language,L.code,A);return ee.code=L.code,R("after:highlight",ee),ee}function h(T,D,A,Z){let re=Object.create(null);function L(E,U){return E.keywords[U]}function ee(){if(!ie.keywords){Ge.addText(Ie);return}let E=0;ie.keywordPatternRe.lastIndex=0;let U=ie.keywordPatternRe.exec(Ie),$="";for(;U;){$+=Ie.substring(E,U.index);let J=oi.case_insensitive?U[0].toLowerCase():U[0],ye=L(ie,J);if(ye){let[Ct,Xn]=ye;if(Ge.addText($),$="",re[J]=(re[J]||0)+1,re[J]<=X3&&(Vn+=Xn),Ct.startsWith("_"))$+=U[0];else{let Za=oi.classNameAliases[Ct]||Ct;Ue(U[0],Za)}}else $+=U[0];E=ie.keywordPatternRe.lastIndex,U=ie.keywordPatternRe.exec(Ie)}$+=Ie.substring(E),Ge.addText($)}function Ce(){if(Ie==="")return;let E=null;if(typeof ie.subLanguage=="string"){if(!t[ie.subLanguage]){Ge.addText(Ie);return}E=h(ie.subLanguage,Ie,!0,jn[ie.subLanguage]),jn[ie.subLanguage]=E._top}else E=f(Ie,ie.subLanguage.length?ie.subLanguage:null);ie.relevance>0&&(Vn+=E.relevance),Ge.__addSublanguage(E._emitter,E.language)}function ue(){ie.subLanguage!=null?Ce():ee(),Ie=""}function Ue(E,U){E!==""&&(Ge.startScope(U),Ge.addText(E),Ge.endScope())}function Q(E,U){let $=1,J=U.length-1;for(;$<=J;){if(!E._emit[$]){$++;continue}let ye=oi.classNameAliases[E[$]]||E[$],Ct=U[$];ye?Ue(Ct,ye):(Ie=Ct,ee(),Ie=""),$++}}function Oe(E,U){return E.scope&&typeof E.scope=="string"&&Ge.openNode(oi.classNameAliases[E.scope]||E.scope),E.beginScope&&(E.beginScope._wrap?(Ue(Ie,oi.classNameAliases[E.beginScope._wrap]||E.beginScope._wrap),Ie=""):E.beginScope._multi&&(Q(E.beginScope,U),Ie="")),ie=Object.create(E,{parent:{value:ie}}),ie}function _i(E,U,$){let J=f3(E.endRe,$);if(J){if(E["on:end"]){let ye=new Fd(E);E["on:end"](U,ye),ye.isMatchIgnored&&(J=!1)}if(J){for(;E.endsParent&&E.parent;)E=E.parent;return E}}if(E.endsWithParent)return _i(E.parent,U,$)}function zt(E){return ie.matcher.regexIndex===0?(Ie+=E[0],1):(Ts=!0,0)}function Bi(E){let U=E[0],$=E.rule,J=new Fd($),ye=[$.__beforeBegin,$["on:begin"]];for(let Ct of ye)if(Ct&&(Ct(E,J),J.isMatchIgnored))return zt(U);return $.skip?Ie+=U:($.excludeBegin&&(Ie+=U),ue(),!$.returnBegin&&!$.excludeBegin&&(Ie=U)),Oe($,E),$.returnBegin?0:U.length}function Ii(E){let U=E[0],$=D.substring(E.index),J=_i(ie,E,$);if(!J)return jx;let ye=ie;ie.endScope&&ie.endScope._wrap?(ue(),Ue(U,ie.endScope._wrap)):ie.endScope&&ie.endScope._multi?(ue(),Q(ie.endScope,E)):ye.skip?Ie+=U:(ye.returnEnd||ye.excludeEnd||(Ie+=U),ue(),ye.excludeEnd&&(Ie=U));do ie.scope&&Ge.closeNode(),!ie.skip&&!ie.subLanguage&&(Vn+=ie.relevance),ie=ie.parent;while(ie!==J.parent);return J.starts&&Oe(J.starts,E),ye.returnEnd?0:U.length}function vi(){let E=[];for(let U=ie;U!==oi;U=U.parent)U.scope&&E.unshift(U.scope);E.forEach(U=>Ge.openNode(U))}let ve={};function mn(E,U){let $=U&&U[0];if(Ie+=E,$==null)return ue(),0;if(ve.type==="begin"&&U.type==="end"&&ve.index===U.index&&$===""){if(Ie+=D.slice(U.index,U.index+1),!s){let J=new Error(`0 width match regex (${T})`);throw J.languageName=T,J.badRule=ve.rule,J}return 1}if(ve=U,U.type==="begin")return Bi(U);if(U.type==="illegal"&&!A){let J=new Error('Illegal lexeme "'+$+'" for mode "'+(ie.scope||"<unnamed>")+'"');throw J.mode=ie,J}else if(U.type==="end"){let J=Ii(U);if(J!==jx)return J}if(U.type==="illegal"&&$==="")return U.index===D.length||(Ie+=`
83
+ `),1;if(ir>1e5&&ir>U.index*3)throw new Error("potential infinite loop, way more iterations than matches");return Ie+=$,$.length}let oi=M(T);if(!oi)throw za(r.replace("{}",T)),new Error('Unknown language: "'+T+'"');let oe=Y3(oi),zi="",ie=Z||oe,jn={},Ge=new o.__emitter(o);vi();let Ie="",Vn=0,Pt=0,ir=0,Ts=!1;try{if(oi.__emitTokens)oi.__emitTokens(D,Ge);else{for(ie.matcher.considerAll();;){ir++,Ts?Ts=!1:ie.matcher.considerAll(),ie.matcher.lastIndex=Pt;let E=ie.matcher.exec(D);if(!E)break;let U=D.substring(Pt,E.index),$=mn(U,E);Pt=E.index+$}mn(D.substring(Pt))}return Ge.finalize(),zi=Ge.toHTML(),{language:T,value:zi,relevance:Vn,illegal:!1,_emitter:Ge,_top:ie}}catch(E){if(E.message&&E.message.includes("Illegal"))return{language:T,value:z_(D),illegal:!0,relevance:0,_illegalBy:{message:E.message,index:Pt,context:D.slice(Pt-100,Pt+100),mode:E.mode,resultSoFar:zi},_emitter:Ge};if(s)return{language:T,value:z_(D),illegal:!1,relevance:0,errorRaised:E,_emitter:Ge,_top:ie};throw E}}function d(T){let D={value:z_(T),illegal:!1,relevance:0,_top:a,_emitter:new o.__emitter(o)};return D._emitter.addText(T),D}function f(T,D){D=D||o.languages||Object.keys(t);let A=d(T),Z=D.filter(M).filter(q).map(ue=>h(ue,T,!1));Z.unshift(A);let re=Z.sort((ue,Ue)=>{if(ue.relevance!==Ue.relevance)return Ue.relevance-ue.relevance;if(ue.language&&Ue.language){if(M(ue.language).supersetOf===Ue.language)return 1;if(M(Ue.language).supersetOf===ue.language)return-1}return 0}),[L,ee]=re,Ce=L;return Ce.secondBest=ee,Ce}function p(T,D,A){let Z=D&&i[D]||A;T.classList.add("hljs"),T.classList.add(`language-${Z}`)}function _(T){let D=null,A=c(T);if(l(A))return;if(R("before:highlightElement",{el:T,language:A}),T.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",T);return}if(T.children.length>0&&(o.ignoreUnescapedHTML||(console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk."),console.warn("https://github.com/highlightjs/highlight.js/wiki/security"),console.warn("The element with unescaped HTML:"),console.warn(T)),o.throwUnescapedHTML))throw new F_("One of your code blocks includes unescaped HTML.",T.innerHTML);D=T;let Z=D.textContent,re=A?u(Z,{language:A,ignoreIllegals:!0}):f(Z);T.innerHTML=re.value,T.dataset.highlighted="yes",p(T,A,re.language),T.result={language:re.language,re:re.relevance,relevance:re.relevance},re.secondBest&&(T.secondBest={language:re.secondBest.language,relevance:re.secondBest.relevance}),R("after:highlightElement",{el:T,result:re,text:Z})}function v(T){o=Yx(o,T)}let g=()=>{S(),vl("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function m(){S(),vl("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let b=!1;function S(){function T(){S()}if(document.readyState==="loading"){b||window.addEventListener("DOMContentLoaded",T,!1),b=!0;return}document.querySelectorAll(o.cssSelector).forEach(_)}function x(T,D){let A=null;try{A=D(e)}catch(Z){if(za("Language definition for '{}' could not be registered.".replace("{}",T)),s)za(Z);else throw Z;A=a}A.name||(A.name=T),t[T]=A,A.rawDefinition=D.bind(null,e),A.aliases&&O(A.aliases,{languageName:T})}function C(T){delete t[T];for(let D of Object.keys(i))i[D]===T&&delete i[D]}function N(){return Object.keys(t)}function M(T){return T=(T||"").toLowerCase(),t[T]||t[i[T]]}function O(T,{languageName:D}){typeof T=="string"&&(T=[T]),T.forEach(A=>{i[A.toLowerCase()]=D})}function q(T){let D=M(T);return D&&!D.disableAutodetect}function G(T){T["before:highlightBlock"]&&!T["before:highlightElement"]&&(T["before:highlightElement"]=D=>{T["before:highlightBlock"](Object.assign({block:D.el},D))}),T["after:highlightBlock"]&&!T["after:highlightElement"]&&(T["after:highlightElement"]=D=>{T["after:highlightBlock"](Object.assign({block:D.el},D))})}function I(T){G(T),n.push(T)}function P(T){let D=n.indexOf(T);D!==-1&&n.splice(D,1)}function R(T,D){let A=T;n.forEach(function(Z){Z[A]&&Z[A](D)})}function K(T){return vl("10.7.0","highlightBlock will be removed entirely in v12.0"),vl("10.7.0","Please use highlightElement now."),_(T)}Object.assign(e,{highlight:u,highlightAuto:f,highlightAll:S,highlightElement:_,highlightBlock:K,configure:v,initHighlighting:g,initHighlightingOnLoad:m,registerLanguage:x,unregisterLanguage:C,listLanguages:N,getLanguage:M,registerAliases:O,autoDetection:q,inherit:Yx,addPlugin:I,removePlugin:P}),e.debugMode=function(){s=!1},e.safeMode=function(){s=!0},e.versionString=V3,e.regex={concat:Pa,lookahead:Zx,either:Kd,optional:h3,anyNumberOfTimes:u3};for(let T in Hd)typeof Hd[T]=="object"&&Vx(Hd[T]);return Object.assign(e,Hd),e},bl=aC({});bl.newInstance=()=>aC({});oC.exports=bl;bl.HighlightJS=bl;bl.default=bl});var uC=me((_U,cC)=>{function Z3(e){let t=e.regex,i=t.concat(/[\p{L}_]/u,t.optional(/[\p{L}0-9_.-]*:/u),/[\p{L}0-9_.-]*/u),n=/[\p{L}0-9._:-]+/u,s={className:"symbol",begin:/&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;/},r={begin:/\s/,contains:[{className:"keyword",begin:/#?[a-z_][a-z1-9_-]+/,illegal:/\n/}]},a=e.inherit(r,{begin:/\(/,end:/\)/}),o=e.inherit(e.APOS_STRING_MODE,{className:"string"}),l=e.inherit(e.QUOTE_STRING_MODE,{className:"string"}),c={endsWithParent:!0,illegal:/</,relevance:0,contains:[{className:"attr",begin:n,relevance:0},{begin:/=\s*/,relevance:0,contains:[{className:"string",endsParent:!0,variants:[{begin:/"/,end:/"/,contains:[s]},{begin:/'/,end:/'/,contains:[s]},{begin:/[^\s"'=<>`]+/}]}]}]};return{name:"HTML, XML",aliases:["html","xhtml","rss","atom","xjb","xsd","xsl","plist","wsf","svg"],case_insensitive:!0,unicodeRegex:!0,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,relevance:10,contains:[r,l,o,a,{begin:/\[/,end:/\]/,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,contains:[r,a,l,o]}]}]},e.COMMENT(/<!--/,/-->/,{relevance:10}),{begin:/<!\[CDATA\[/,end:/\]\]>/,relevance:10},s,{className:"meta",end:/\?>/,variants:[{begin:/<\?xml/,relevance:10,contains:[l]},{begin:/<\?[a-z][a-z0-9]+/}]},{className:"tag",begin:/<style(?=\s|>)/,end:/>/,keywords:{name:"style"},contains:[c],starts:{end:/<\/style>/,returnEnd:!0,subLanguage:"css"}},{className:"tag",begin:/<script(?=\s|>)/,end:/>/,keywords:{name:"script"},contains:[c],starts:{end:/<\/script>/,returnEnd:!0,subLanguage:"javascript"}},{className:"tag",begin:/<>|<\/>/},{className:"tag",begin:t.concat(/</,t.lookahead(t.concat(i,t.either(/\/>/,/>/,/\s/)))),end:/\/?>/,contains:[{className:"name",begin:i,relevance:0,starts:c}]},{className:"tag",begin:t.concat(/<\//,t.lookahead(t.concat(i,/>/))),contains:[{className:"name",begin:i,relevance:0},{begin:/>/,relevance:0,endsParent:!0}]}]}}cC.exports=Z3});var dC=me((vU,hC)=>{function Q3(e){let t=e.regex,i={},n={begin:/\$\{/,end:/\}/,contains:["self",{begin:/:-/,contains:[i]}]};Object.assign(i,{className:"variable",variants:[{begin:t.concat(/\$[\w\d#@][\w\d_]*/,"(?![\\w\\d])(?![$])")},n]});let s={className:"subst",begin:/\$\(/,end:/\)/,contains:[e.BACKSLASH_ESCAPE]},r=e.inherit(e.COMMENT(),{match:[/(^|\s)/,/#.*$/],scope:{2:"comment"}}),a={begin:/<<-?\s*(?=\w+)/,starts:{contains:[e.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,className:"string"})]}},o={className:"string",begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,i,s]};s.contains.push(o);let l={match:/\\"/},c={className:"string",begin:/'/,end:/'/},u={match:/\\'/},h={begin:/\$?\(\(/,end:/\)\)/,contains:[{begin:/\d+#[0-9a-f]+/,className:"number"},e.NUMBER_MODE,i]},d=["fish","bash","zsh","sh","csh","ksh","tcsh","dash","scsh"],f=e.SHEBANG({binary:`(${d.join("|")})`,relevance:10}),p={className:"function",begin:/\w[\w\d_]*\s*\(\s*\)\s*\{/,returnBegin:!0,contains:[e.inherit(e.TITLE_MODE,{begin:/\w[\w\d_]*/})],relevance:0},_=["if","then","else","elif","fi","time","for","while","until","in","do","done","case","esac","coproc","function","select"],v=["true","false"],g={match:/(\/[a-z._-]+)+/},m=["break","cd","continue","eval","exec","exit","export","getopts","hash","pwd","readonly","return","shift","test","times","trap","umask","unset"],b=["alias","bind","builtin","caller","command","declare","echo","enable","help","let","local","logout","mapfile","printf","read","readarray","source","sudo","type","typeset","ulimit","unalias"],S=["autoload","bg","bindkey","bye","cap","chdir","clone","comparguments","compcall","compctl","compdescribe","compfiles","compgroups","compquote","comptags","comptry","compvalues","dirs","disable","disown","echotc","echoti","emulate","fc","fg","float","functions","getcap","getln","history","integer","jobs","kill","limit","log","noglob","popd","print","pushd","pushln","rehash","sched","setcap","setopt","stat","suspend","ttyctl","unfunction","unhash","unlimit","unsetopt","vared","wait","whence","where","which","zcompile","zformat","zftp","zle","zmodload","zparseopts","zprof","zpty","zregexparse","zsocket","zstyle","ztcp"],x=["chcon","chgrp","chown","chmod","cp","dd","df","dir","dircolors","ln","ls","mkdir","mkfifo","mknod","mktemp","mv","realpath","rm","rmdir","shred","sync","touch","truncate","vdir","b2sum","base32","base64","cat","cksum","comm","csplit","cut","expand","fmt","fold","head","join","md5sum","nl","numfmt","od","paste","ptx","pr","sha1sum","sha224sum","sha256sum","sha384sum","sha512sum","shuf","sort","split","sum","tac","tail","tr","tsort","unexpand","uniq","wc","arch","basename","chroot","date","dirname","du","echo","env","expr","factor","groups","hostid","id","link","logname","nice","nohup","nproc","pathchk","pinky","printenv","printf","pwd","readlink","runcon","seq","sleep","stat","stdbuf","stty","tee","test","timeout","tty","uname","unlink","uptime","users","who","whoami","yes"];return{name:"Bash",aliases:["sh","zsh"],keywords:{$pattern:/\b[a-z][a-z0-9._-]+\b/,keyword:_,literal:v,built_in:[...m,...b,"set","shopt",...S,...x]},contains:[f,e.SHEBANG(),p,h,r,a,g,o,l,c,u,i]}}hC.exports=Q3});var pC=me((bU,fC)=>{function J3(e){let t=e.regex,i=e.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),n="decltype\\(auto\\)",s="[a-zA-Z_]\\w*::",a="("+n+"|"+t.optional(s)+"[a-zA-Z_]\\w*"+t.optional("<[^<>]+>")+")",o=t.concat(/\batomic_/,t.either("bool","char","schar","uchar","short","ushort","int","uint","long","ulong","llong","ullong","char16_t","char32_t","wchar_t","int_least8_t","uint_least8_t","int_least16_t","uint_least16_t","int_least32_t","uint_least32_t","int_least64_t","uint_least64_t","int_fast8_t","uint_fast8_t","int_fast16_t","uint_fast16_t","int_fast32_t","uint_fast32_t","int_fast64_t","uint_fast64_t","intptr_t","uintptr_t","size_t","ptrdiff_t","intmax_t","uintmax_t"),/\b/),l={className:"type",variants:[{begin:"\\b[a-z\\d_]*_t\\b"},{match:o}]},u={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'("+"\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)"+"|.)",end:"'",illegal:"."},e.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\\s"]{0,16})\(/,end:/\)([^()\\\s"]{0,16})"/})]},h={className:"number",variants:[{match:/\b(0b[01']+)/},{match:/(-?)\b([\d']+(\.[\d']*)?|\.[\d']+)((ll|LL|l|L)(u|U)?|(u|U)(ll|LL|l|L)?|f|F|b|B)/},{match:/(-?)\b(0[xX][a-fA-F0-9]+(?:'[a-fA-F0-9]+)*(?:\.[a-fA-F0-9]*(?:'[a-fA-F0-9]*)*)?(?:[pP][-+]?[0-9]+)?(l|L)?(u|U)?)/},{match:/(-?)\b\d+(?:'\d+)*(?:\.\d*(?:'\d*)*)?(?:[eE][-+]?\d+)?/}],relevance:0},d={scope:"meta",begin:/#\s*include\b/,end:/$/,keywords:{keyword:"include"},contains:[{begin:/\\\n/},u,{scope:"string",begin:/<.*?>/},i,e.C_BLOCK_COMMENT_MODE]},f={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef elifdef elifndef include"},contains:[{begin:/\\\n/,relevance:0},e.inherit(u,{className:"string"}),i,e.C_BLOCK_COMMENT_MODE]},p=[d,f],_={className:"title",begin:t.optional(s)+e.IDENT_RE,relevance:0},v=t.optional(s)+e.IDENT_RE+"\\s*\\(",g=12,S={keyword:["asm","auto","break","case","continue","default","do","else","enum","extern","for","fortran","goto","if","inline","register","restrict","return","sizeof","typeof","typeof_unqual","struct","switch","typedef","union","volatile","while","_Alignas","_Alignof","_Atomic","_Generic","_Noreturn","_Static_assert","_Thread_local","alignas","alignof","noreturn","static_assert","thread_local","_Pragma"],type:["float","double","signed","unsigned","int","short","long","char","void","_Bool","_BitInt","_Complex","_Imaginary","_Decimal32","_Decimal64","_Decimal96","_Decimal128","_Decimal64x","_Decimal128x","_Float16","_Float32","_Float64","_Float128","_Float32x","_Float64x","_Float128x","const","static","constexpr","complex","bool","imaginary"],literal:"true false NULL",built_in:"std string wstring cin cout cerr clog stdin stdout stderr stringstream istringstream ostringstream auto_ptr deque list queue stack vector map set pair bitset multiset multimap unordered_set unordered_map unordered_multiset unordered_multimap priority_queue make_pair array shared_ptr abort terminate abs acos asin atan2 atan calloc ceil cosh cos exit exp fabs floor fmod fprintf fputs free frexp fscanf future isalnum isalpha iscntrl isdigit isgraph islower isprint ispunct isspace isupper isxdigit tolower toupper labs ldexp log10 log malloc realloc memchr memcmp memcpy memset modf pow printf putchar puts scanf sinh sin snprintf sprintf sqrt sscanf strcat strchr strcmp strcpy strcspn strlen strncat strncmp strncpy strpbrk strrchr strspn strstr tanh tan vfprintf vprintf vsprintf endl initializer_list unique_ptr"},x=[...p,l,i,e.C_BLOCK_COMMENT_MODE,h,u],C={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:S,contains:x.concat([{begin:/\(/,end:/\)/,keywords:S,contains:x.concat(["self"]),relevance:0}]),relevance:0},N={begin:"("+a+"[\\*&\\s]+){1,"+g+"}"+v,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:S,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:n,keywords:S,relevance:0},{begin:v,returnBegin:!0,contains:[e.inherit(_,{className:"title.function"})],relevance:0},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:S,relevance:0,contains:[i,e.C_BLOCK_COMMENT_MODE,u,h,l,{begin:/\(/,end:/\)/,keywords:S,relevance:0,contains:["self",i,e.C_BLOCK_COMMENT_MODE,u,h,l]}]},l,i,e.C_BLOCK_COMMENT_MODE,...p]};return{name:"C",aliases:["h"],keywords:S,disableAutodetect:!0,illegal:"</",contains:[].concat(C,N,x,[...p,{begin:e.IDENT_RE+"::",keywords:S},{className:"class",beginKeywords:"enum class struct union",end:/[{;:<>=]/,contains:[{beginKeywords:"final class struct"},e.TITLE_MODE]}]),exports:{preprocessor:f,strings:u,keywords:S}}}fC.exports=J3});var gC=me((yU,mC)=>{function eB(e){let t=e.regex,i=e.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),n="decltype\\(auto\\)",s="[a-zA-Z_]\\w*::",a="(?!struct)("+n+"|"+t.optional(s)+"[a-zA-Z_]\\w*"+t.optional("<[^<>]+>")+")",o={className:"type",begin:"\\b[a-z\\d_]*_t\\b"},c={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'("+"\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)"+"|.)",end:"'",illegal:"."},e.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\\s"]{0,16})\(/,end:/\)([^()\\\s"]{0,16})"/})]},u={className:"number",variants:[{begin:"[+-]?(?:(?:\\b[0-9](?:'?[0-9])*\\.(?:[0-9](?:'?[0-9])*)?|\\.[0-9](?:'?[0-9])*)(?:[Ee][+-]?[0-9](?:'?[0-9])*)?|\\b[0-9](?:'?[0-9])*[Ee][+-]?[0-9](?:'?[0-9])*|\\b0[Xx](?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*(?:\\.(?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)?)?|\\.[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)[Pp][+-]?[0-9](?:'?[0-9])*)(?:[Ff](?:16|32|64|128)?|(BF|bf)16|[Ll]|)"},{begin:"[+-]?\\b(?:0[Bb][01](?:'?[01])*|0[Xx][0-9A-Fa-f](?:'?[0-9A-Fa-f])*|0(?:'?[0-7])*|[1-9](?:'?[0-9])*)(?:[Uu](?:LL?|ll?)|[Uu][Zz]?|(?:LL?|ll?)[Uu]?|[Zz][Uu]|)"}],relevance:0},h={scope:"meta",begin:/#\s*include\b/,end:/$/,keywords:{keyword:"include"},contains:[{begin:/\\\n/},c,{scope:"string",begin:/<.*?>/},i,e.C_BLOCK_COMMENT_MODE]},d={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},e.inherit(c,{className:"string"}),i,e.C_BLOCK_COMMENT_MODE]},f=[h,d],p={className:"title",begin:t.optional(s)+e.IDENT_RE,relevance:0},_=t.optional(s)+e.IDENT_RE+"\\s*\\(",v=12,g=["alignas","alignof","and","and_eq","asm","atomic_cancel","atomic_commit","atomic_noexcept","auto","bitand","bitor","break","case","catch","class","co_await","co_return","co_yield","compl","concept","const_cast|10","consteval","constexpr","constinit","continue","decltype","default","delete","do","dynamic_cast|10","else","enum","explicit","export","extern","false","final","for","friend","goto","if","import","inline","module","mutable","namespace","new","noexcept","not","not_eq","nullptr","operator","or","or_eq","override","private","protected","public","reflexpr","register","reinterpret_cast|10","requires","return","sizeof","static_assert","static_cast|10","struct","switch","synchronized","template","this","thread_local","throw","transaction_safe","transaction_safe_dynamic","true","try","typedef","typeid","typename","union","using","virtual","volatile","while","xor","xor_eq"],m=["bool","char","char16_t","char32_t","char8_t","double","float","int","long","short","void","wchar_t","unsigned","signed","const","static"],b=["any","auto_ptr","barrier","binary_semaphore","bitset","complex","condition_variable","condition_variable_any","counting_semaphore","deque","false_type","flat_map","flat_set","future","imaginary","initializer_list","istringstream","jthread","latch","lock_guard","multimap","multiset","mutex","optional","ostringstream","packaged_task","pair","promise","priority_queue","queue","recursive_mutex","recursive_timed_mutex","scoped_lock","set","shared_future","shared_lock","shared_mutex","shared_timed_mutex","shared_ptr","stack","string_view","stringstream","timed_mutex","thread","true_type","tuple","unique_lock","unique_ptr","unordered_map","unordered_multimap","unordered_multiset","unordered_set","variant","vector","weak_ptr","wstring","wstring_view"],S=["abort","abs","acos","apply","as_const","asin","atan","atan2","calloc","ceil","cerr","cin","clog","cos","cosh","cout","declval","endl","exchange","exit","exp","fabs","floor","fmod","forward","fprintf","fputs","free","frexp","fscanf","future","invoke","isalnum","isalpha","iscntrl","isdigit","isgraph","islower","isprint","ispunct","isspace","isupper","isxdigit","labs","launder","ldexp","log","log10","make_pair","make_shared","make_shared_for_overwrite","make_tuple","make_unique","malloc","memchr","memcmp","memcpy","memset","modf","move","pow","printf","putchar","puts","realloc","scanf","sin","sinh","snprintf","sprintf","sqrt","sscanf","std","stderr","stdin","stdout","strcat","strchr","strcmp","strcpy","strcspn","strlen","strncat","strncmp","strncpy","strpbrk","strrchr","strspn","strstr","swap","tan","tanh","terminate","to_underlying","tolower","toupper","vfprintf","visit","vprintf","vsprintf"],N={type:m,keyword:g,literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:b},M={className:"function.dispatch",relevance:0,keywords:{_hint:S},begin:t.concat(/\b/,`(?!${g.join("|")})`,e.IDENT_RE,t.lookahead(/(<[^<>]+>|)\s*\(/))},O=[M,...f,o,i,e.C_BLOCK_COMMENT_MODE,u,c],q={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:N,contains:O.concat([{begin:/\(/,end:/\)/,keywords:N,contains:O.concat(["self"]),relevance:0}]),relevance:0},G={className:"function",begin:"("+a+"[\\*&\\s]+){1,"+v+"}"+_,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:N,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:n,keywords:N,relevance:0},{begin:_,returnBegin:!0,contains:[p],relevance:0},{begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[c,u]},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:N,relevance:0,contains:[i,e.C_BLOCK_COMMENT_MODE,c,u,o,{begin:/\(/,end:/\)/,keywords:N,relevance:0,contains:["self",i,e.C_BLOCK_COMMENT_MODE,c,u,o]}]},o,i,e.C_BLOCK_COMMENT_MODE,...f]};return{name:"C++",aliases:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:N,illegal:"</",classNameAliases:{"function.dispatch":"built_in"},contains:[].concat(q,G,M,O,[...f,{begin:"\\b(deque|list|queue|priority_queue|pair|stack|vector|map|set|bitset|multiset|multimap|unordered_map|unordered_set|unordered_multiset|unordered_multimap|array|tuple|optional|variant|function|flat_map|flat_set)\\s*<(?!<)",end:">",keywords:N,contains:["self",o]},{begin:e.IDENT_RE+"::",keywords:N},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}}mC.exports=eB});var vC=me((SU,_C)=>{function tB(e){let t=["bool","byte","char","decimal","delegate","double","dynamic","enum","float","int","long","nint","nuint","object","sbyte","short","string","ulong","uint","ushort"],i=["public","private","protected","static","internal","protected","abstract","async","extern","override","unsafe","virtual","new","sealed","partial"],n=["default","false","null","true"],s=["abstract","as","base","break","case","catch","class","const","continue","do","else","event","explicit","extern","finally","fixed","for","foreach","goto","if","implicit","in","interface","internal","is","lock","namespace","new","operator","out","override","params","private","protected","public","readonly","record","ref","return","scoped","sealed","sizeof","stackalloc","static","struct","switch","this","throw","try","typeof","unchecked","unsafe","using","virtual","void","volatile","while"],r=["add","alias","and","ascending","args","async","await","by","descending","dynamic","equals","file","from","get","global","group","init","into","join","let","nameof","not","notnull","on","or","orderby","partial","record","remove","required","scoped","select","set","unmanaged","value|0","var","when","where","with","yield"],a={keyword:s.concat(r),built_in:t,literal:n},o=e.inherit(e.TITLE_MODE,{begin:"[a-zA-Z](\\.?\\w)*"}),l="\\d(_*\\d)*",c="([uU][lL]?|[lL][uU]?)?",h={className:"number",variants:[{begin:"\\b0[bB]_*[01](_*[01])*"+c},{begin:"(-?)\\b0[xX]_*[a-fA-F0-9](_*[a-fA-F0-9])*"+c},{begin:"(-?)(\\b"+l+"(\\.("+l+")?)?|\\."+l+")([eE][-+]?"+l+")?"+"([fFdDmM]|[uU][lL]?|[lL][uU]?)?"}],relevance:0},d={className:"string",begin:/"""("*)(?!")(.|\n)*?"""\1/,relevance:1},f={className:"string",begin:'@"',end:'"',contains:[{begin:'""'}]},p=e.inherit(f,{illegal:/\n/}),_={className:"subst",begin:/\{/,end:/\}/,keywords:a},v=e.inherit(_,{illegal:/\n/}),g={className:"string",begin:/\$"/,end:'"',illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},e.BACKSLASH_ESCAPE,v]},m={className:"string",begin:/\$@"/,end:'"',contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},_]},b=e.inherit(m,{illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},v]});_.contains=[m,g,f,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,h,e.C_BLOCK_COMMENT_MODE],v.contains=[b,g,p,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,h,e.inherit(e.C_BLOCK_COMMENT_MODE,{illegal:/\n/})];let S={variants:[d,m,g,f,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},x={begin:"<",end:">",contains:[{beginKeywords:"in out"},o]},C=e.IDENT_RE+"(<"+e.IDENT_RE+"(\\s*,\\s*"+e.IDENT_RE+")*>)?(\\[\\])?",N={begin:"@"+e.IDENT_RE,relevance:0};return{name:"C#",aliases:["cs","c#"],keywords:a,illegal:/::/,contains:[e.COMMENT("///","$",{returnBegin:!0,contains:[{className:"doctag",variants:[{begin:"///",relevance:0},{begin:"<!--|-->"},{begin:"</?",end:">"}]}]}),e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{className:"meta",begin:"#",end:"$",keywords:{keyword:"if else elif endif define undef warning error line region endregion pragma checksum"}},S,h,{beginKeywords:"class interface",relevance:0,end:/[{;=]/,illegal:/[^\s:,]/,contains:[{beginKeywords:"where class"},o,x,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:"namespace",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[o,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:"record",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[o,x,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{className:"meta",begin:"^\\s*\\[(?=[\\w])",excludeBegin:!0,end:"\\]",excludeEnd:!0,contains:[{className:"string",begin:/"/,end:/"/}]},{beginKeywords:"new return throw await else",relevance:0},{className:"function",begin:"("+C+"\\s+)+"+e.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,end:/\s*[{;=]/,excludeEnd:!0,keywords:a,contains:[{beginKeywords:i.join(" "),relevance:0},{begin:e.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,contains:[e.TITLE_MODE,x],relevance:0},{match:/\(\)/},{className:"params",begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:a,relevance:0,contains:[S,h,e.C_BLOCK_COMMENT_MODE]},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},N]}}_C.exports=tB});var yC=me((wU,bC)=>{var iB=e=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:e.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},UNICODE_RANGE:{scope:"number",begin:/\b[Uu]\+[0-9A-Fa-f][0-9A-Fa-f?]{0,5}(-[0-9A-Fa-f][0-9A-Fa-f]{0,5})?/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:e.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),nB=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],sB=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],rB=[...nB,...sB],aB=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),oB=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),lB=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),cB=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","corner-bottom-left-shape","corner-bottom-right-shape","corner-shape","corner-top-left-shape","corner-top-right-shape","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","unicode-range","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse();function uB(e){let t=e.regex,i=iB(e),n={begin:/-(webkit|moz|ms|o)-(?=[a-z])/},s="and or not only",r=/@-?\w[\w]*(-\w+)*/,a="[a-zA-Z-][a-zA-Z0-9_-]*",o=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE];return{name:"CSS",case_insensitive:!0,illegal:/[=|'\$]/,keywords:{keyframePosition:"from to"},classNameAliases:{keyframePosition:"selector-tag"},contains:[i.BLOCK_COMMENT,n,i.CSS_NUMBER_MODE,{className:"selector-id",begin:/#[A-Za-z0-9_-]+/,relevance:0},{className:"selector-class",begin:"\\."+a,relevance:0},i.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",variants:[{begin:":("+oB.join("|")+")"},{begin:":(:)?("+lB.join("|")+")"}]},i.CSS_VARIABLE,{className:"attribute",begin:"\\b("+cB.join("|")+")\\b"},{begin:/:/,end:/[;}{]/,contains:[i.BLOCK_COMMENT,i.HEXCOLOR,i.IMPORTANT,i.CSS_NUMBER_MODE,i.UNICODE_RANGE,...o,{begin:/(url|data-uri)\(/,end:/\)/,relevance:0,keywords:{built_in:"url data-uri"},contains:[...o,{className:"string",begin:/[^)]/,endsWithParent:!0,excludeEnd:!0}]},i.FUNCTION_DISPATCH]},{begin:t.lookahead(/@/),end:"[{;]",relevance:0,illegal:/:/,contains:[{className:"keyword",begin:r},{begin:/\s/,endsWithParent:!0,excludeEnd:!0,relevance:0,keywords:{$pattern:/[a-z-]+/,keyword:s,attribute:aB.join(" ")},contains:[{begin:/[a-z-]+(?=:)/,className:"attribute"},...o,i.CSS_NUMBER_MODE]}]},{className:"selector-tag",begin:"\\b("+rB.join("|")+")\\b"}]}}bC.exports=uB});var wC=me((EU,SC)=>{function hB(e){let t=e.regex,i={begin:/<\/?[A-Za-z_]/,end:">",subLanguage:"xml",relevance:0},n={match:/^ {0,3}([-*_])[ \t]*(?:\1[ \t]*){2,}$/},s={className:"code",variants:[{begin:"(`{3,})[^`](.|\\n)*?\\1`*[ ]*"},{begin:"(~{3,})[^~](.|\\n)*?\\1~*[ ]*"},{begin:"```",end:"```+[ ]*$"},{begin:"~~~",end:"~~~+[ ]*$"},{begin:"`.+?`"},{begin:"(?=^( {4}|\\t))",contains:[{begin:"^( {4}|\\t)",end:"(\\n)$"}],relevance:0}]},r={className:"bullet",begin:"^[ ]*([*+-]|(\\d+\\.))(?=\\s+)",end:"\\s+",excludeEnd:!0},a={begin:/^\[[^\n]+\]:/,returnBegin:!0,contains:[{className:"symbol",begin:/\[/,end:/\]/,excludeBegin:!0,excludeEnd:!0},{className:"link",begin:/:\s*/,end:/$/,excludeBegin:!0}]},o=/[A-Za-z][A-Za-z0-9+.-]*/,l={variants:[{begin:/\[.+?\]\[.*?\]/,relevance:0},{begin:/\[.+?\]\(((data|javascript|mailto):|(?:http|ftp)s?:\/\/).*?\)/,relevance:2},{begin:t.concat(/\[.+?\]\(/,o,/:\/\/.*?\)/),relevance:2},{begin:/\[.+?\]\([./?&#].*?\)/,relevance:1},{begin:/\[.*?\]\(.*?\)/,relevance:0}],returnBegin:!0,contains:[{match:/\[(?=\])/},{className:"string",relevance:0,begin:"\\[",end:"\\]",excludeBegin:!0,returnEnd:!0},{className:"link",relevance:0,begin:"\\]\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0},{className:"symbol",relevance:0,begin:"\\]\\[",end:"\\]",excludeBegin:!0,excludeEnd:!0}]},c={className:"strong",contains:[],variants:[{begin:/_{2}(?!\s)/,end:/_{2}/},{begin:/\*{2}(?!\s)/,end:/\*{2}/}]},u={className:"emphasis",contains:[],variants:[{begin:/\*(?![*\s])/,end:/\*/},{begin:/_(?![_\s])/,end:/_/,relevance:0}]},h=e.inherit(c,{contains:[]}),d=e.inherit(u,{contains:[]});c.contains.push(d),u.contains.push(h);let f=[i,l];return[c,u,h,d].forEach(g=>{g.contains=g.contains.concat(f)}),f=f.concat(c,u),{name:"Markdown",aliases:["md","mkdown","mkd"],contains:[{className:"section",variants:[{begin:"^#{1,6}",end:"$",contains:f},{begin:"(?=^.+?\\n[=-]{2,}$)",contains:[{begin:"^[=-]*$"},{begin:"^",end:"\\n",contains:f}]}]},i,r,n,c,u,{className:"quote",begin:"^>\\s+",contains:f,end:"$"},s,l,a,{scope:"literal",match:/&([a-zA-Z0-9]+|#[0-9]{1,7}|#[Xx][0-9a-fA-F]{1,6});/}]}}SC.exports=hB});var xC=me((xU,EC)=>{function dB(e){let t=e.regex;return{name:"Diff",aliases:["patch"],contains:[{className:"meta",relevance:10,match:t.either(/^@@ +-\d+,\d+ +\+\d+,\d+ +@@/,/^@@ +-\d+ +\+\d+,\d+ +@@/,/^@@ +-\d+,\d+ +\+\d+ +@@/,/^@@ +-\d+ +\+\d+ +@@/,/^\*\*\* +\d+,\d+ +\*\*\*\*$/,/^--- +\d+,\d+ +----$/)},{className:"comment",variants:[{begin:t.either(/Index: /,/^index/,/={3,}/,/^-{3}/,/^\*{3} /,/^\+{3}/,/^diff --git/),end:/$/},{match:/^\*{15}$/}]},{className:"addition",begin:/^\+/,end:/$/},{className:"deletion",begin:/^-/,end:/$/},{className:"addition",begin:/^!/,end:/$/}]}}EC.exports=dB});var kC=me((CU,CC)=>{function fB(e){let t=e.regex,i="([a-zA-Z_]\\w*[!?=]?|[-+~]@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\]=?)",n=t.either(/\b([A-Z]+[a-z0-9]+)+/,/\b([A-Z]+[a-z0-9]+)+[A-Z]+/),s=t.concat(n,/(::\w+)*/),a={"variable.constant":["__FILE__","__LINE__","__ENCODING__"],"variable.language":["self","super"],keyword:["alias","and","begin","BEGIN","break","case","class","defined","do","else","elsif","end","END","ensure","for","if","in","module","next","not","or","redo","require","rescue","retry","return","then","undef","unless","until","when","while","yield",...["include","extend","prepend","public","private","protected","raise","throw"]],built_in:["proc","lambda","attr_accessor","attr_reader","attr_writer","define_method","private_constant","module_function"],literal:["true","false","nil"]},o={className:"doctag",begin:"@[A-Za-z]+"},l={begin:"#<",end:">"},c=[e.COMMENT("#","$",{contains:[o]}),e.COMMENT("^=begin","^=end",{contains:[o],relevance:10}),e.COMMENT("^__END__",e.MATCH_NOTHING_RE)],u={className:"subst",begin:/#\{/,end:/\}/,keywords:a},h={className:"string",contains:[e.BACKSLASH_ESCAPE,u],variants:[{begin:/'/,end:/'/},{begin:/"/,end:/"/},{begin:/`/,end:/`/},{begin:/%[qQwWx]?\(/,end:/\)/},{begin:/%[qQwWx]?\[/,end:/\]/},{begin:/%[qQwWx]?\{/,end:/\}/},{begin:/%[qQwWx]?</,end:/>/},{begin:/%[qQwWx]?\//,end:/\//},{begin:/%[qQwWx]?%/,end:/%/},{begin:/%[qQwWx]?-/,end:/-/},{begin:/%[qQwWx]?\|/,end:/\|/},{begin:/\B\?(\\\d{1,3})/},{begin:/\B\?(\\x[A-Fa-f0-9]{1,2})/},{begin:/\B\?(\\u\{?[A-Fa-f0-9]{1,6}\}?)/},{begin:/\B\?(\\M-\\C-|\\M-\\c|\\c\\M-|\\M-|\\C-\\M-)[\x20-\x7e]/},{begin:/\B\?\\(c|C-)[\x20-\x7e]/},{begin:/\B\?\\?\S/},{begin:t.concat(/<<[-~]?'?/,t.lookahead(/(\w+)(?=\W)[^\n]*\n(?:[^\n]*\n)*?\s*\1\b/)),contains:[e.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,contains:[e.BACKSLASH_ESCAPE,u]})]}]},d="[1-9](_?[0-9])*|0",f="[0-9](_?[0-9])*",p={className:"number",relevance:0,variants:[{begin:`\\b(${d})(\\.(${f}))?([eE][+-]?(${f})|r)?i?\\b`},{begin:"\\b0[dD][0-9](_?[0-9])*r?i?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*r?i?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*r?i?\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*r?i?\\b"},{begin:"\\b0(_?[0-7])+r?i?\\b"}]},_={variants:[{match:/\(\)/},{className:"params",begin:/\(/,end:/(?=\))/,excludeBegin:!0,endsParent:!0,keywords:a}]},C=[h,{variants:[{match:[/class\s+/,s,/\s+<\s+/,s]},{match:[/\b(class|module)\s+/,s]}],scope:{2:"title.class",4:"title.class.inherited"},keywords:a},{match:[/(include|extend)\s+/,s],scope:{2:"title.class"},keywords:a},{relevance:0,match:[s,/\.new[. (]/],scope:{1:"title.class"}},{relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"},{relevance:0,match:n,scope:"title.class"},{match:[/def/,/\s+/,i],scope:{1:"keyword",3:"title.function"},contains:[_]},{begin:"::"},{className:"symbol",begin:e.UNDERSCORE_IDENT_RE+"(!|\\?)?:",relevance:0},{className:"symbol",begin:":(?!\\s)",contains:[h,{begin:i}],relevance:0},p,{className:"variable",begin:"(\\$\\W)|((\\$|@@?)(\\w+))(?=[^@$?])(?![A-Za-z])(?![@$?'])"},{className:"params",begin:/\|(?!=)/,end:/\|/,excludeBegin:!0,excludeEnd:!0,relevance:0,keywords:a},{begin:"("+e.RE_STARTERS_RE+"|unless)\\s*",keywords:"unless",contains:[{className:"regexp",contains:[e.BACKSLASH_ESCAPE,u],illegal:/\n/,variants:[{begin:"/",end:"/[a-z]*"},{begin:/%r\{/,end:/\}[a-z]*/},{begin:"%r\\(",end:"\\)[a-z]*"},{begin:"%r!",end:"![a-z]*"},{begin:"%r\\[",end:"\\][a-z]*"}]}].concat(l,c),relevance:0}].concat(l,c);u.contains=C,_.contains=C;let q=[{begin:/^\s*=>/,starts:{end:"$",contains:C}},{className:"meta.prompt",begin:"^("+"[>?]>"+"|"+"[\\w#]+\\(\\w+\\):\\d+:\\d+[>*]"+"|"+"(\\w+-)?\\d+\\.\\d+\\.\\d+(p\\d+)?[^\\d][^>]+>"+")(?=[ ])",starts:{end:"$",keywords:a,contains:C}}];return c.unshift(l),{name:"Ruby",aliases:["rb","gemspec","podspec","thor","irb"],keywords:a,illegal:/\/\*/,contains:[e.SHEBANG({binary:"ruby"})].concat(q).concat(c).concat(C)}}CC.exports=fB});var NC=me((kU,TC)=>{function pB(e){let r={keyword:["break","case","chan","const","continue","default","defer","else","fallthrough","for","func","go","goto","if","import","interface","map","package","range","return","select","struct","switch","type","var"],type:["bool","byte","complex64","complex128","error","float32","float64","int8","int16","int32","int64","string","uint8","uint16","uint32","uint64","int","uint","uintptr","rune"],literal:["true","false","iota","nil"],built_in:["append","cap","close","complex","copy","imag","len","make","new","panic","print","println","real","recover","delete"]};return{name:"Go",aliases:["golang"],keywords:r,illegal:"</",contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{className:"string",variants:[e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,{begin:"`",end:"`"}]},{className:"number",variants:[{match:/-?\b0[xX]\.[a-fA-F0-9](_?[a-fA-F0-9])*[pP][+-]?\d(_?\d)*i?/,relevance:0},{match:/-?\b0[xX](_?[a-fA-F0-9])+((\.([a-fA-F0-9](_?[a-fA-F0-9])*)?)?[pP][+-]?\d(_?\d)*)?i?/,relevance:0},{match:/-?\b0[oO](_?[0-7])*i?/,relevance:0},{match:/-?\b0[bB](_?[01])*i?/,relevance:0},{match:/-?\.\d(_?\d)*([eE][+-]?\d(_?\d)*)?i?/,relevance:0},{match:/-?\b\d(_?\d)*(\.(\d(_?\d)*)?)?([eE][+-]?\d(_?\d)*)?i?/,relevance:0}]},{begin:/:=/},{className:"function",beginKeywords:"func",end:"\\s*(\\{|$)",excludeEnd:!0,contains:[e.TITLE_MODE,{className:"params",begin:/\(/,end:/\)/,endsParent:!0,keywords:r,illegal:/["']/}]}]}}TC.exports=pB});var MC=me((TU,AC)=>{function mB(e){let t=e.regex,i=/[_A-Za-z][_0-9A-Za-z]*/;return{name:"GraphQL",aliases:["gql"],case_insensitive:!0,disableAutodetect:!1,keywords:{keyword:["query","mutation","subscription","type","input","schema","directive","interface","union","scalar","fragment","enum","on"],literal:["true","false","null"]},contains:[e.HASH_COMMENT_MODE,e.QUOTE_STRING_MODE,e.NUMBER_MODE,{scope:"punctuation",match:/[.]{3}/,relevance:0},{scope:"punctuation",begin:/[\!\(\)\:\=\[\]\{\|\}]{1}/,relevance:0},{scope:"variable",begin:/\$/,end:/\W/,excludeEnd:!0,relevance:0},{scope:"meta",match:/@\w+/,excludeEnd:!0},{scope:"symbol",begin:t.concat(i,t.lookahead(/\s*:/)),relevance:0}],illegal:[/[;<']/,/BEGIN/]}}AC.exports=mB});var RC=me((NU,OC)=>{function gB(e){let t=e.regex,i={className:"number",relevance:0,variants:[{begin:/([+-]+)?[\d]+_[\d_]+/},{begin:e.NUMBER_RE}]},n=e.COMMENT();n.variants=[{begin:/;/,end:/$/},{begin:/#/,end:/$/}];let s={className:"variable",variants:[{begin:/\$[\w\d"][\w\d_]*/},{begin:/\$\{(.*?)\}/}]},r={className:"literal",begin:/\bon|off|true|false|yes|no\b/},a={className:"string",contains:[e.BACKSLASH_ESCAPE],variants:[{begin:"'''",end:"'''",relevance:10},{begin:'"""',end:'"""',relevance:10},{begin:'"',end:'"'},{begin:"'",end:"'"}]},o={begin:/\[/,end:/\]/,contains:[n,r,s,a,i,"self"],relevance:0},l=/[A-Za-z0-9_-]+/,c=/"(\\"|[^"])*"/,u=/'[^']*'/,h=t.either(l,c,u),d=t.concat(h,"(\\s*\\.\\s*",h,")*",t.lookahead(/\s*=\s*[^#\s]/));return{name:"TOML, also INI",aliases:["toml"],case_insensitive:!0,illegal:/\S/,contains:[n,{className:"section",begin:/\[+/,end:/\]+/},{begin:d,className:"attr",starts:{end:/$/,contains:[n,o,r,s,a,i]}}]}}OC.exports=gB});var IC=me((AU,BC)=>{var yl="[0-9](_*[0-9])*",Gd=`\\.(${yl})`,$d="[0-9a-fA-F](_*[0-9a-fA-F])*",DC={className:"number",variants:[{begin:`(\\b(${yl})((${Gd})|\\.)?|(${Gd}))[eE][+-]?(${yl})[fFdD]?\\b`},{begin:`\\b(${yl})((${Gd})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${Gd})[fFdD]?\\b`},{begin:`\\b(${yl})[fFdD]\\b`},{begin:`\\b0[xX]((${$d})\\.?|(${$d})?\\.(${$d}))[pP][+-]?(${yl})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${$d})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function LC(e,t,i){return i===-1?"":e.replace(t,n=>LC(e,t,i-1))}function _B(e){let t=e.regex,i="[\xC0-\u02B8a-zA-Z_$][\xC0-\u02B8a-zA-Z_$0-9]*",n="(?:(?:\\s*\\[\\s*])+)?",s=i+"<@@@>"+n,a="(?:"+("\\?(?:\\s+(?:extends|super)\\s+"+s+")?")+"|"+s+")",o=LC("(?:\\s*<\\s*"+a+"(?:\\s*,\\s*"+a+")*\\s*>)?",/<@@@>/g,2),d={keyword:["synchronized","abstract","private","var","static","if","const ","for","while","strictfp","finally","protected","import","native","final","void","enum","else","break","transient","catch","instanceof","volatile","case","assert","package","default","public","try","switch","continue","throws","protected","public","private","module","requires","exports","do","sealed","yield","permits","goto","when"],literal:["false","true","null"],type:["char","boolean","long","float","int","byte","short","double"],built_in:["super","this"]},f={className:"meta",begin:"@"+i,contains:[{begin:/\(/,end:/\)/,contains:["self"]}]},p={className:"params",begin:/\(/,end:/\)/,keywords:d,relevance:0,contains:[e.C_BLOCK_COMMENT_MODE],endsParent:!0};return{name:"Java",aliases:["jsp"],keywords:d,illegal:/<\/|#/,contains:[e.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{begin:/\w+@/,relevance:0},{className:"doctag",begin:"@[A-Za-z]+"}]}),{begin:/import java\.[a-z]+\./,keywords:"import",relevance:2},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{begin:/"""/,end:/"""/,className:"string",contains:[e.BACKSLASH_ESCAPE]},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,{match:[/\b(?:class|interface|enum|extends|implements|new)/,/\s+/,i],className:{1:"keyword",3:"title.class"}},{match:/non-sealed/,scope:"keyword"},{beginKeywords:"new throw return else yield assert",relevance:0},{begin:[i,t.concat(o,n,/\s+/),i,n,/\s*/,/=(?!=)/],className:{1:"type",3:"variable",6:"operator"}},{begin:[/record/,/\s+/,i],className:{1:"keyword",3:"title.class"},contains:[p,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{begin:[i,t.concat(o,n,/\s+/),i,/\s*(?=\()/],className:{1:"type",3:"title.function"},keywords:d,contains:[{className:"params",begin:/\(/,end:/\)/,keywords:d,relevance:0,contains:[f,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,DC,e.C_BLOCK_COMMENT_MODE]},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},DC,f]}}BC.exports=_B});var qC=me((MU,FC)=>{var zC="[A-Za-z$_][0-9A-Za-z$_]*",vB=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends","using"],bB=["true","false","null","undefined","NaN","Infinity"],PC=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],UC=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],HC=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],yB=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","self","global"],SB=[].concat(HC,PC,UC);function wB(e){let t=e.regex,i=(A,{after:Z})=>{let re="</"+A[0].slice(1);return A.input.indexOf(re,Z)!==-1},n=zC,s={begin:"<>",end:"</>"},r=/<[A-Za-z0-9\\._:-]+\s*\/>/,a={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(A,Z)=>{let re=A[0].length+A.index,L=A.input[re];if(L==="<"||L===","){Z.ignoreMatch();return}L===">"&&(i(A,{after:re})||Z.ignoreMatch());let ee,Ce=A.input.substring(re);if(ee=Ce.match(/^\s*=/)){Z.ignoreMatch();return}if((ee=Ce.match(/^\s+extends\s+/))&&ee.index===0){Z.ignoreMatch();return}}},o={$pattern:zC,keyword:vB,literal:bB,built_in:SB,"variable.language":yB},l="[0-9](_?[0-9])*",c=`\\.(${l})`,u="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",h={className:"number",variants:[{begin:`(\\b(${u})((${c})|\\.)?|(${c}))[eE][+-]?(${l})\\b`},{begin:`\\b(${u})\\b((${c})\\b|\\.)?|(${c})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},d={className:"subst",begin:"\\$\\{",end:"\\}",keywords:o,contains:[]},f={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,d],subLanguage:"xml"}},p={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,d],subLanguage:"css"}},_={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,d],subLanguage:"graphql"}},v={className:"string",begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,d]},m={className:"comment",variants:[e.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:n+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]},b=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,f,p,_,v,{match:/\$\d+/},h];d.contains=b.concat({begin:/\{/,end:/\}/,keywords:o,contains:["self"].concat(b)});let S=[].concat(m,d.contains),x=S.concat([{begin:/(\s*)\(/,end:/\)/,keywords:o,contains:["self"].concat(S)}]),C={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:o,contains:x},N={variants:[{match:[/class/,/\s+/,n,/\s+/,/extends/,/\s+/,t.concat(n,"(",t.concat(/\./,n),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,n],scope:{1:"keyword",3:"title.class"}}]},M={relevance:0,match:t.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...PC,...UC]}},O={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},q={variants:[{match:[/function/,/\s+/,n,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[C],illegal:/%/},G={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function I(A){return t.concat("(?!",A.join("|"),")")}let P={match:t.concat(/\b/,I([...HC,"super","import","await"].map(A=>`${A}\\s*\\(`)),n,t.lookahead(/\s*\(/)),className:"title.function",relevance:0},R={begin:t.concat(/\./,t.lookahead(t.concat(n,/(?![0-9A-Za-z$_(])/))),end:n,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},K={match:[/get|set/,/\s+/,n,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},C]},T="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",D={match:[/const|var|let/,/\s+/,n,/\s*/,/=\s*/,/(async\s*)?/,t.lookahead(T)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[C]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:o,exports:{PARAMS_CONTAINS:x,CLASS_REFERENCE:M},illegal:/#(?![$_A-Za-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),O,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,f,p,_,v,m,{match:/\$\d+/},h,M,{scope:"attr",match:n+t.lookahead(":"),relevance:0},D,{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[m,e.REGEXP_MODE,{className:"function",begin:T,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:e.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:o,contains:x}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:s.begin,end:s.end},{match:r},{begin:a.begin,"on:begin":a.isTrulyOpeningTag,end:a.end}],subLanguage:"xml",contains:[{begin:a.begin,end:a.end,skip:!0,contains:["self"]}]}]},q,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[C,e.inherit(e.TITLE_MODE,{begin:n,className:"title.function"})]},{match:/\.\.\./,relevance:0},R,{match:"\\$"+n,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[C]},P,G,N,K,{match:/\$[(.]/}]}}FC.exports=wB});var WC=me((OU,KC)=>{var EB="([-+]?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)|NaN|[-+]?Infinity",xB={scope:"number",match:EB,relevance:0};function CB(e){let t={className:"attr",begin:/(("(\\.|[^\\"\r\n])*")|('(\\.|[^\\'\r\n])*'))(?=\s*:)/,relevance:1.01},i={match:/[{}[\],:]/,className:"punctuation",relevance:0},n=["true","false","null"],s={scope:"literal",beginKeywords:n.join(" ")};return{name:"JSON",aliases:["jsonc","json5"],keywords:{literal:n},contains:[t,i,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,s,xB,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE],illegal:"\\S"}}KC.exports=CB});var $C=me((RU,GC)=>{var Sl="[0-9](_*[0-9])*",Yd=`\\.(${Sl})`,jd="[0-9a-fA-F](_*[0-9a-fA-F])*",kB={className:"number",variants:[{begin:`(\\b(${Sl})((${Yd})|\\.)?|(${Yd}))[eE][+-]?(${Sl})[fFdD]?\\b`},{begin:`\\b(${Sl})((${Yd})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${Yd})[fFdD]?\\b`},{begin:`\\b(${Sl})[fFdD]\\b`},{begin:`\\b0[xX]((${jd})\\.?|(${jd})?\\.(${jd}))[pP][+-]?(${Sl})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${jd})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function TB(e){let t={keyword:"abstract as val var vararg get set class object open private protected public noinline crossinline dynamic final enum if else do while for when throw try catch finally import package is in fun override companion reified inline lateinit init interface annotation data sealed internal infix operator out by constructor super tailrec where const inner suspend typealias external expect actual",built_in:"Byte Short Char Int Long Boolean Float Double Void Unit Nothing",literal:"true false null"},i={className:"keyword",begin:/\b(break|continue|return|this)\b/,starts:{contains:[{className:"symbol",begin:/@\w+/}]}},n={className:"symbol",begin:e.UNDERSCORE_IDENT_RE+"@"},s={className:"subst",begin:/\$\{/,end:/\}/,contains:[e.C_NUMBER_MODE]},r={className:"variable",begin:"\\$"+e.UNDERSCORE_IDENT_RE},a={className:"string",variants:[{begin:'"""',end:'"""(?=[^"])',contains:[r,s]},{begin:"'",end:"'",illegal:/\n/,contains:[e.BACKSLASH_ESCAPE]},{begin:'"',end:'"',illegal:/\n/,contains:[e.BACKSLASH_ESCAPE,r,s]}]};s.contains.push(a);let o={className:"meta",begin:"@(?:file|property|field|get|set|receiver|param|setparam|delegate)\\s*:(?:\\s*"+e.UNDERSCORE_IDENT_RE+")?"},l={className:"meta",begin:"@"+e.UNDERSCORE_IDENT_RE,contains:[{begin:/\(/,end:/\)/,contains:[e.inherit(a,{className:"string"}),"self"]}]},c=kB,u=e.COMMENT("/\\*","\\*/",{contains:[e.C_BLOCK_COMMENT_MODE]}),h={variants:[{className:"type",begin:e.UNDERSCORE_IDENT_RE},{begin:/\(/,end:/\)/,contains:[]}]},d=h;return d.variants[1].contains=[h],h.variants[1].contains=[d],{name:"Kotlin",aliases:["kt","kts","ktm","ktx"],keywords:t,contains:[e.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"}]}),e.C_LINE_COMMENT_MODE,u,i,n,o,l,{className:"function",beginKeywords:"fun",end:"[(]|$",returnBegin:!0,excludeEnd:!0,keywords:t,relevance:5,contains:[{begin:e.UNDERSCORE_IDENT_RE+"\\s*\\(",returnBegin:!0,relevance:0,contains:[e.UNDERSCORE_TITLE_MODE]},{className:"type",begin:/</,end:/>/,keywords:"reified",relevance:0},{className:"params",begin:/\(/,end:/\)/,endsParent:!0,keywords:t,relevance:0,contains:[{begin:/:/,end:/[=,\/]/,endsWithParent:!0,contains:[h,e.C_LINE_COMMENT_MODE,u],relevance:0},e.C_LINE_COMMENT_MODE,u,o,l,a,e.C_NUMBER_MODE]},u]},{begin:[/class|interface|trait/,/\s+/,e.UNDERSCORE_IDENT_RE],beginScope:{3:"title.class"},keywords:"class interface trait",end:/[:\{(]|$/,excludeEnd:!0,illegal:"extends implements",contains:[{beginKeywords:"public protected internal private constructor"},e.UNDERSCORE_TITLE_MODE,{className:"type",begin:/</,end:/>/,excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:/[,:]\s*/,end:/[<\(,){\s]|$/,excludeBegin:!0,returnEnd:!0},o,l]},a,{className:"meta",begin:"^#!/usr/bin/env",end:"$",illegal:`
84
+ `},c]}}GC.exports=TB});var XC=me((DU,VC)=>{var NB=e=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:e.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},UNICODE_RANGE:{scope:"number",begin:/\b[Uu]\+[0-9A-Fa-f][0-9A-Fa-f?]{0,5}(-[0-9A-Fa-f][0-9A-Fa-f]{0,5})?/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:e.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),AB=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],MB=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],OB=[...AB,...MB],RB=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),YC=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),jC=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),DB=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","corner-bottom-left-shape","corner-bottom-right-shape","corner-shape","corner-top-left-shape","corner-top-right-shape","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","unicode-range","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse(),LB=YC.concat(jC).sort().reverse();function BB(e){let t=NB(e),i=LB,n="and or not only",s="[\\w-]+",r="("+s+"|@\\{"+s+"\\})",a=[],o=[],l=function(b){return{className:"string",begin:"~?"+b+".*?"+b}},c=function(b,S,x){return{className:b,begin:S,relevance:x}},u={$pattern:/[a-z-]+/,keyword:n,attribute:RB.join(" ")},h={begin:"\\(",end:"\\)",contains:o,keywords:u,relevance:0};o.push(e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,l("'"),l('"'),t.CSS_NUMBER_MODE,{begin:"(url|data-uri)\\(",starts:{className:"string",end:"[\\)\\n]",excludeEnd:!0}},t.UNICODE_RANGE,t.HEXCOLOR,h,c("variable","@@?"+s,10),c("variable","@\\{"+s+"\\}"),c("built_in","~?`[^`]*?`"),{className:"attribute",begin:s+"\\s*:",end:":",returnBegin:!0,excludeEnd:!0},t.IMPORTANT,{beginKeywords:"and not"},t.FUNCTION_DISPATCH);let d=o.concat({begin:/\{/,end:/\}/,contains:a}),f={beginKeywords:"when",endsWithParent:!0,contains:[{beginKeywords:"and not"}].concat(o)},p={begin:r+"\\s*:",returnBegin:!0,end:/[;}]/,relevance:0,contains:[{begin:/-(webkit|moz|ms|o)-/},t.CSS_VARIABLE,{className:"attribute",begin:"\\b("+DB.join("|")+")\\b",end:/(?=:)/,starts:{endsWithParent:!0,illegal:"[<=$]",relevance:0,contains:o}}]},_={className:"keyword",begin:"@(import|media|charset|font-face|(-[a-z]+-)?keyframes|supports|document|namespace|page|viewport|host)\\b",starts:{end:"[;{}]",keywords:u,returnEnd:!0,contains:o,relevance:0}},v={className:"variable",variants:[{begin:"@"+s+"\\s*:",relevance:15},{begin:"@"+s}],starts:{end:"[;}]",returnEnd:!0,contains:d}},g={variants:[{begin:"[\\.#:&\\[>]",end:"[;{}]"},{begin:r,end:/\{/}],returnBegin:!0,returnEnd:!0,illegal:`[<='$"]`,relevance:0,contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,f,c("keyword","all\\b"),c("variable","@\\{"+s+"\\}"),{begin:"\\b("+OB.join("|")+")\\b",className:"selector-tag"},t.CSS_NUMBER_MODE,c("selector-tag",r,0),c("selector-id","#"+r),c("selector-class","\\."+r,0),c("selector-tag","&",0),t.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",begin:":("+YC.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+jC.join("|")+")"},{begin:/\(/,end:/\)/,relevance:0,contains:d},{begin:"!important"},t.FUNCTION_DISPATCH]},m={begin:s+`:(:)?(${i.join("|")})`,returnBegin:!0,contains:[g]};return a.push(e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,_,v,m,p,g,f,t.FUNCTION_DISPATCH),{name:"Less",case_insensitive:!0,illegal:`[=>'/<($"]`,contains:a}}VC.exports=BB});var QC=me((LU,ZC)=>{function IB(e){let t="\\[=*\\[",i="\\]=*\\]",n={begin:t,end:i,contains:["self"]},s=[e.COMMENT("--(?!"+t+")","$"),e.COMMENT("--"+t,i,{contains:[n],relevance:10})];return{name:"Lua",aliases:["pluto"],keywords:{$pattern:e.UNDERSCORE_IDENT_RE,literal:"true false nil",keyword:"and break do else elseif end for goto if in local global not or repeat return then until while",built_in:"_G _ENV _VERSION __index __newindex __mode __call __metatable __tostring __len __gc __add __sub __mul __div __mod __pow __concat __unm __eq __lt __le assert collectgarbage dofile error getfenv getmetatable ipairs load loadfile loadstring module next pairs pcall print rawequal rawget rawset require select setfenv setmetatable tonumber tostring type unpack xpcall arg self coroutine resume yield status wrap create running debug getupvalue debug sethook getmetatable gethook setmetatable setlocal traceback setfenv getinfo setupvalue getlocal getregistry getfenv io lines write close flush open output type read stderr stdin input stdout popen tmpfile math log max acos huge ldexp pi cos tanh pow deg tan cosh sinh random randomseed frexp ceil floor rad abs sqrt modf asin min mod fmod log10 atan2 exp sin atan os exit setlocale date getenv difftime remove time clock tmpname rename execute package preload loadlib loaded loaders cpath config path seeall string sub upper len gfind rep find match char dump gmatch reverse byte format gsub lower table setn insert getn foreachi maxn foreach concat sort remove"},contains:s.concat([{className:"function",beginKeywords:"function",end:"\\)",contains:[e.inherit(e.TITLE_MODE,{begin:"([_a-zA-Z]\\w*\\.)*([_a-zA-Z]\\w*:)?[_a-zA-Z]\\w*"}),{className:"params",begin:"\\(",endsWithParent:!0,contains:s}].concat(s)},e.C_NUMBER_MODE,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,{className:"string",begin:t,end:i,contains:[n],relevance:5}])}}ZC.exports=IB});var ek=me((BU,JC)=>{function zB(e){let t={className:"variable",variants:[{begin:"\\$\\("+e.UNDERSCORE_IDENT_RE+"\\)",contains:[e.BACKSLASH_ESCAPE]},{begin:/\$[@%<?\^\+\*]/}]},i={className:"string",begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,t]},n={className:"variable",begin:/\$\([\w-]+\s/,end:/\)/,keywords:{built_in:"subst patsubst strip findstring filter filter-out sort word wordlist firstword lastword dir notdir suffix basename addsuffix addprefix join wildcard realpath abspath error warning shell origin flavor foreach if or and call eval file value"},contains:[t,i]},s={begin:"^"+e.UNDERSCORE_IDENT_RE+"\\s*(?=[:+?]?=)"},r={className:"meta",begin:/^\.PHONY:/,end:/$/,keywords:{$pattern:/[\.\w]+/,keyword:".PHONY"}},a={className:"section",begin:/^[^\s]+:/,end:/$/,contains:[t]};return{name:"Makefile",aliases:["mk","mak","make"],keywords:{$pattern:/[\w-]+/,keyword:"define endef undefine ifdef ifndef ifeq ifneq else endif include -include sinclude override export unexport private vpath"},contains:[e.HASH_COMMENT_MODE,t,i,n,s,r,a]}}JC.exports=zB});var ik=me((IU,tk)=>{function PB(e){let t=e.regex,i=["abs","accept","alarm","and","atan2","bind","binmode","bless","break","caller","chdir","chmod","chomp","chop","chown","chr","chroot","class","close","closedir","connect","continue","cos","crypt","dbmclose","dbmopen","defined","delete","die","do","dump","each","else","elsif","endgrent","endhostent","endnetent","endprotoent","endpwent","endservent","eof","eval","exec","exists","exit","exp","fcntl","field","fileno","flock","for","foreach","fork","format","formline","getc","getgrent","getgrgid","getgrnam","gethostbyaddr","gethostbyname","gethostent","getlogin","getnetbyaddr","getnetbyname","getnetent","getpeername","getpgrp","getpriority","getprotobyname","getprotobynumber","getprotoent","getpwent","getpwnam","getpwuid","getservbyname","getservbyport","getservent","getsockname","getsockopt","given","glob","gmtime","goto","grep","gt","hex","if","index","int","ioctl","join","keys","kill","last","lc","lcfirst","length","link","listen","local","localtime","log","lstat","lt","ma","map","method","mkdir","msgctl","msgget","msgrcv","msgsnd","my","ne","next","no","not","oct","open","opendir","or","ord","our","pack","package","pipe","pop","pos","print","printf","prototype","push","q|0","qq","quotemeta","qw","qx","rand","read","readdir","readline","readlink","readpipe","recv","redo","ref","rename","require","reset","return","reverse","rewinddir","rindex","rmdir","say","scalar","seek","seekdir","select","semctl","semget","semop","send","setgrent","sethostent","setnetent","setpgrp","setpriority","setprotoent","setpwent","setservent","setsockopt","shift","shmctl","shmget","shmread","shmwrite","shutdown","sin","sleep","socket","socketpair","sort","splice","split","sprintf","sqrt","srand","stat","state","study","sub","substr","symlink","syscall","sysopen","sysread","sysseek","system","syswrite","tell","telldir","tie","tied","time","times","tr","truncate","uc","ucfirst","umask","undef","unless","unlink","unpack","unshift","untie","until","use","utime","values","vec","wait","waitpid","wantarray","warn","when","while","write","x|0","xor","y|0"],n=/[dualxmsipngr]{0,12}/,s={$pattern:/[\w.]+/,keyword:i.join(" ")},r={className:"subst",begin:"[$@]\\{",end:"\\}",keywords:s},a={begin:/->\{/,end:/\}/},o={scope:"attr",match:/\s+:\s*\w+(\s*\(.*?\))?/},l={scope:"variable",variants:[{begin:/\$\d/},{begin:t.concat(/[$%@](?!")(\^\w\b|#\w+(::\w+)*|\{\w+\}|\w+(::\w*)*)/,"(?![A-Za-z])(?![@$%])")},{begin:/[$%@](?!")[^\s\w{=]|\$=/,relevance:0}],contains:[o]},c={className:"number",variants:[{match:/0?\.[0-9][0-9_]+\b/},{match:/\bv?(0|[1-9][0-9_]*(\.[0-9_]+)?|[1-9][0-9_]*)\b/},{match:/\b0[0-7][0-7_]*\b/},{match:/\b0x[0-9a-fA-F][0-9a-fA-F_]*\b/},{match:/\b0b[0-1][0-1_]*\b/}],relevance:0},u=[e.BACKSLASH_ESCAPE,r,l],h=[/!/,/\//,/\|/,/\?/,/'/,/"/,/#/],d=(_,v,g="\\1")=>{let m=g==="\\1"?g:t.concat(g,v);return t.concat(t.concat("(?:",_,")"),v,/(?:\\.|[^\\\/])*?/,m,/(?:\\.|[^\\\/])*?/,g,n)},f=(_,v,g)=>t.concat(t.concat("(?:",_,")"),v,/(?:\\.|[^\\\/])*?/,g,n),p=[l,e.HASH_COMMENT_MODE,e.COMMENT(/^=\w/,/=cut/,{endsWithParent:!0}),a,{className:"string",contains:u,variants:[{begin:"q[qwxr]?\\s*\\(",end:"\\)",relevance:5},{begin:"q[qwxr]?\\s*\\[",end:"\\]",relevance:5},{begin:"q[qwxr]?\\s*\\{",end:"\\}",relevance:5},{begin:"q[qwxr]?\\s*\\|",end:"\\|",relevance:5},{begin:"q[qwxr]?\\s*<",end:">",relevance:5},{begin:"qw\\s+q",end:"q",relevance:5},{begin:"'",end:"'",contains:[e.BACKSLASH_ESCAPE]},{begin:'"',end:'"'},{begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE]},{begin:/\{\w+\}/,relevance:0},{begin:"-?\\w+\\s*=>",relevance:0}]},c,{begin:"(\\/\\/|"+e.RE_STARTERS_RE+"|\\b(split|return|print|reverse|grep)\\b)\\s*",keywords:"split return print reverse grep",relevance:0,contains:[e.HASH_COMMENT_MODE,{className:"regexp",variants:[{begin:d("s|tr|y",t.either(...h,{capture:!0}))},{begin:d("s|tr|y","\\(","\\)")},{begin:d("s|tr|y","\\[","\\]")},{begin:d("s|tr|y","\\{","\\}")}],relevance:2},{className:"regexp",variants:[{begin:/(m|qr)\/\//,relevance:0},{begin:f("(?:m|qr)?",/\//,/\//)},{begin:f("m|qr",t.either(...h,{capture:!0}),/\1/)},{begin:f("m|qr",/\(/,/\)/)},{begin:f("m|qr",/\[/,/\]/)},{begin:f("m|qr",/\{/,/\}/)}]}]},{className:"function",beginKeywords:"sub method",end:"(\\s*\\(.*?\\))?[;{]",excludeEnd:!0,relevance:5,contains:[e.TITLE_MODE,o]},{className:"class",beginKeywords:"class",end:"[;{]",excludeEnd:!0,relevance:5,contains:[e.TITLE_MODE,o,c]},{begin:"-\\w\\b",relevance:0},{begin:"^__DATA__$",end:"^__END__$",subLanguage:"mojolicious",contains:[{begin:"^@@.*",end:"$",className:"comment"}]}];return r.contains=p,a.contains=p,{name:"Perl",aliases:["pl","pm"],keywords:s,contains:p}}tk.exports=PB});var sk=me((zU,nk)=>{function UB(e){let t={className:"built_in",begin:"\\b(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)\\w+"},i=/[a-zA-Z@][a-zA-Z0-9_]*/,o={"variable.language":["this","super"],$pattern:i,keyword:["while","export","sizeof","typedef","const","struct","for","union","volatile","static","mutable","if","do","return","goto","enum","else","break","extern","asm","case","default","register","explicit","typename","switch","continue","inline","readonly","assign","readwrite","self","@synchronized","id","typeof","nonatomic","IBOutlet","IBAction","strong","weak","copy","in","out","inout","bycopy","byref","oneway","__strong","__weak","__block","__autoreleasing","@private","@protected","@public","@try","@property","@end","@throw","@catch","@finally","@autoreleasepool","@synthesize","@dynamic","@selector","@optional","@required","@encode","@package","@import","@defs","@compatibility_alias","__bridge","__bridge_transfer","__bridge_retained","__bridge_retain","__covariant","__contravariant","__kindof","_Nonnull","_Nullable","_Null_unspecified","__FUNCTION__","__PRETTY_FUNCTION__","__attribute__","getter","setter","retain","unsafe_unretained","nonnull","nullable","null_unspecified","null_resettable","class","instancetype","NS_DESIGNATED_INITIALIZER","NS_UNAVAILABLE","NS_REQUIRES_SUPER","NS_RETURNS_INNER_POINTER","NS_INLINE","NS_AVAILABLE","NS_DEPRECATED","NS_ENUM","NS_OPTIONS","NS_SWIFT_UNAVAILABLE","NS_ASSUME_NONNULL_BEGIN","NS_ASSUME_NONNULL_END","NS_REFINED_FOR_SWIFT","NS_SWIFT_NAME","NS_SWIFT_NOTHROW","NS_DURING","NS_HANDLER","NS_ENDHANDLER","NS_VALUERETURN","NS_VOIDRETURN"],literal:["false","true","FALSE","TRUE","nil","YES","NO","NULL"],built_in:["dispatch_once_t","dispatch_queue_t","dispatch_sync","dispatch_async","dispatch_once"],type:["int","float","char","unsigned","signed","short","long","double","wchar_t","unichar","void","bool","BOOL","id|0","_Bool"]},l={$pattern:i,keyword:["@interface","@class","@protocol","@implementation"]};return{name:"Objective-C",aliases:["mm","objc","obj-c","obj-c++","objective-c++"],keywords:o,illegal:"</",contains:[t,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,e.C_NUMBER_MODE,e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,{className:"string",variants:[{begin:'@"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE]}]},{className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},e.inherit(e.QUOTE_STRING_MODE,{className:"string"}),{className:"string",begin:/<.*?>/,end:/$/,illegal:"\\n"},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{className:"class",begin:"("+l.keyword.join("|")+")\\b",end:/(\{|$)/,excludeEnd:!0,keywords:l,contains:[e.UNDERSCORE_TITLE_MODE]},{begin:"\\."+e.UNDERSCORE_IDENT_RE,relevance:0}]}}nk.exports=UB});var ak=me((PU,rk)=>{function HB(e){let t=e.regex,i=/(?![A-Za-z0-9])(?![$])/,n=t.concat(/[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*/,i),s=t.concat(/(\\?[A-Z][a-z0-9_\x7f-\xff]+|\\?[A-Z]+(?=[A-Z][a-z0-9_\x7f-\xff])){1,}/,i),r=t.concat(/[A-Z]+/,i),a={scope:"variable",match:"\\$+"+n},o={scope:"meta",variants:[{begin:/<\?php/,relevance:10},{begin:/<\?=/},{begin:/<\?/,relevance:.1},{begin:/\?>/}]},l={scope:"subst",variants:[{begin:/\$\w+/},{begin:/\{\$/,end:/\}/}]},c=e.inherit(e.APOS_STRING_MODE,{illegal:null}),u=e.inherit(e.QUOTE_STRING_MODE,{illegal:null,contains:e.QUOTE_STRING_MODE.contains.concat(l)}),h={begin:/<<<[ \t]*(?:(\w+)|"(\w+)")\n/,end:/[ \t]*(\w+)\b/,contains:e.QUOTE_STRING_MODE.contains.concat(l),"on:begin":(R,K)=>{K.data._beginMatch=R[1]||R[2]},"on:end":(R,K)=>{K.data._beginMatch!==R[1]&&K.ignoreMatch()}},d=e.END_SAME_AS_BEGIN({begin:/<<<[ \t]*'(\w+)'\n/,end:/[ \t]*(\w+)\b/}),f=`[
85
+ ]`,p={scope:"string",variants:[u,c,h,d]},_={scope:"number",variants:[{begin:"\\b0[bB][01]+(?:_[01]+)*\\b"},{begin:"\\b0[oO][0-7]+(?:_[0-7]+)*\\b"},{begin:"\\b0[xX][\\da-fA-F]+(?:_[\\da-fA-F]+)*\\b"},{begin:"(?:\\b\\d+(?:_\\d+)*(\\.(?:\\d+(?:_\\d+)*))?|\\B\\.\\d+)(?:[eE][+-]?\\d+)?"}],relevance:0},v=["false","null","true"],g=["__CLASS__","__DIR__","__FILE__","__FUNCTION__","__COMPILER_HALT_OFFSET__","__LINE__","__METHOD__","__NAMESPACE__","__TRAIT__","die","echo","exit","include","include_once","print","require","require_once","array","abstract","and","as","binary","bool","boolean","break","callable","case","catch","class","clone","const","continue","declare","default","do","double","else","elseif","empty","enddeclare","endfor","endforeach","endif","endswitch","endwhile","enum","eval","extends","final","finally","float","for","foreach","from","global","goto","if","implements","instanceof","insteadof","int","integer","interface","isset","iterable","list","match|0","mixed","new","never","object","or","private","protected","public","readonly","real","return","string","switch","throw","trait","try","unset","use","var","void","while","xor","yield"],m=["Error|0","AppendIterator","ArgumentCountError","ArithmeticError","ArrayIterator","ArrayObject","AssertionError","BadFunctionCallException","BadMethodCallException","CachingIterator","CallbackFilterIterator","CompileError","Countable","DirectoryIterator","DivisionByZeroError","DomainException","EmptyIterator","ErrorException","Exception","FilesystemIterator","FilterIterator","GlobIterator","InfiniteIterator","InvalidArgumentException","IteratorIterator","LengthException","LimitIterator","LogicException","MultipleIterator","NoRewindIterator","OutOfBoundsException","OutOfRangeException","OuterIterator","OverflowException","ParentIterator","ParseError","RangeException","RecursiveArrayIterator","RecursiveCachingIterator","RecursiveCallbackFilterIterator","RecursiveDirectoryIterator","RecursiveFilterIterator","RecursiveIterator","RecursiveIteratorIterator","RecursiveRegexIterator","RecursiveTreeIterator","RegexIterator","RuntimeException","SeekableIterator","SplDoublyLinkedList","SplFileInfo","SplFileObject","SplFixedArray","SplHeap","SplMaxHeap","SplMinHeap","SplObjectStorage","SplObserver","SplPriorityQueue","SplQueue","SplStack","SplSubject","SplTempFileObject","TypeError","UnderflowException","UnexpectedValueException","UnhandledMatchError","ArrayAccess","BackedEnum","Closure","Fiber","Generator","Iterator","IteratorAggregate","Serializable","Stringable","Throwable","Traversable","UnitEnum","WeakReference","WeakMap","Directory","__PHP_Incomplete_Class","parent","php_user_filter","self","static","stdClass"],S={keyword:g,literal:(R=>{let K=[];return R.forEach(T=>{K.push(T),T.toLowerCase()===T?K.push(T.toUpperCase()):K.push(T.toLowerCase())}),K})(v),built_in:m},x=R=>R.map(K=>K.replace(/\|\d+$/,"")),C={variants:[{match:[/new/,t.concat(f,"+"),t.concat("(?!",x(m).join("\\b|"),"\\b)"),s],scope:{1:"keyword",4:"title.class"}}]},N=t.concat(n,"\\b(?!\\()"),M={variants:[{match:[t.concat(/::/,t.lookahead(/(?!class\b)/)),N],scope:{2:"variable.constant"}},{match:[/::/,/class/],scope:{2:"variable.language"}},{match:[s,t.concat(/::/,t.lookahead(/(?!class\b)/)),N],scope:{1:"title.class",3:"variable.constant"}},{match:[s,t.concat("::",t.lookahead(/(?!class\b)/))],scope:{1:"title.class"}},{match:[s,/::/,/class/],scope:{1:"title.class",3:"variable.language"}}]},O={scope:"attr",match:t.concat(n,t.lookahead(":"),t.lookahead(/(?!::)/))},q={relevance:0,begin:/\(/,end:/\)/,keywords:S,contains:[O,a,M,e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE,e.HASH_COMMENT_MODE,p,_,C]},G={relevance:0,match:[/\b/,t.concat("(?!fn\\b|function\\b|",x(g).join("\\b|"),"|",x(m).join("\\b|"),"\\b)"),n,t.concat(f,"*"),t.lookahead(/(?=\()/)],scope:{3:"title.function.invoke"},contains:[q]};q.contains.push(G);let I=[O,M,e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE,e.HASH_COMMENT_MODE,p,_,C],P={begin:t.concat(/#\[\s*\\?/,t.either(s,r)),beginScope:"meta",end:/]/,endScope:"meta",keywords:{literal:v,keyword:["new","array"]},contains:[{begin:/\[/,end:/]/,keywords:{literal:v,keyword:["new","array"]},contains:["self",...I]},...I,{scope:"meta",variants:[{match:s},{match:r}]}]};return{case_insensitive:!1,keywords:S,contains:[P,e.HASH_COMMENT_MODE,e.COMMENT("//","$"),e.COMMENT("/\\*","\\*/",{contains:[{scope:"doctag",match:"@[A-Za-z]+"}]}),{match:/__halt_compiler\(\);/,keywords:"__halt_compiler",starts:{scope:"comment",end:e.MATCH_NOTHING_RE,contains:[{match:/\?>/,scope:"meta",endsParent:!0}]}},o,{scope:"variable.language",match:/\$this\b/},a,G,M,{match:[/const/,/\s/,n],scope:{1:"keyword",3:"variable.constant"}},C,{scope:"function",relevance:0,beginKeywords:"fn function",end:/[;{]/,excludeEnd:!0,illegal:"[$%\\[]",contains:[{beginKeywords:"use"},e.UNDERSCORE_TITLE_MODE,{begin:"=>",endsParent:!0},{scope:"params",begin:"\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0,keywords:S,contains:["self",P,a,M,e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE,e.HASH_COMMENT_MODE,p,_]}]},{scope:"class",variants:[{beginKeywords:"enum",illegal:/[($"]/},{beginKeywords:"class interface trait",illegal:/[:($"]/}],relevance:0,end:/\{/,excludeEnd:!0,contains:[{beginKeywords:"extends implements"},e.UNDERSCORE_TITLE_MODE]},{beginKeywords:"namespace",relevance:0,end:";",illegal:/[.']/,contains:[e.inherit(e.UNDERSCORE_TITLE_MODE,{scope:"title.class"})]},{beginKeywords:"use",relevance:0,end:";",contains:[{match:/\b(as|const|function)\b/,scope:"keyword"},e.UNDERSCORE_TITLE_MODE]},p,_]}}rk.exports=HB});var lk=me((UU,ok)=>{function FB(e){return{name:"PHP template",subLanguage:"xml",contains:[{begin:/<\?(php|=)?/,end:/\?>/,subLanguage:"php",contains:[{begin:"/\\*",end:"\\*/",skip:!0},{begin:'b"',end:'"',skip:!0},{begin:"b'",end:"'",skip:!0},e.inherit(e.APOS_STRING_MODE,{illegal:null,className:null,contains:null,skip:!0}),e.inherit(e.QUOTE_STRING_MODE,{illegal:null,className:null,contains:null,skip:!0})]}]}}ok.exports=FB});var uk=me((HU,ck)=>{function qB(e){return{name:"Plain text",aliases:["text","txt"],disableAutodetect:!0}}ck.exports=qB});var dk=me((FU,hk)=>{function KB(e){let t=e.regex,i=/[\p{XID_Start}_]\p{XID_Continue}*/u,n=["and","as","assert","async","await","break","case","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","in","is","lambda","lazy","match","nonlocal|10","not","or","pass","raise","return","try","while","with","yield"],o={$pattern:/[A-Za-z]\w+|__\w+__/,keyword:n,built_in:["__import__","abs","aiter","all","anext","any","ascii","bin","bool","breakpoint","bytearray","bytes","callable","chr","classmethod","compile","complex","delattr","dict","dir","divmod","enumerate","eval","exec","filter","float","format","frozendict","frozenset","getattr","globals","hasattr","hash","help","hex","id","input","int","isinstance","issubclass","iter","len","list","locals","map","max","memoryview","min","next","object","oct","open","ord","pow","print","property","range","repr","reversed","round","sentinel","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","vars","zip"],literal:["__debug__","Ellipsis","False","None","NotImplemented","True"],type:["Any","Callable","Coroutine","Dict","List","Literal","Generic","Optional","Sequence","Set","Tuple","Type","Union"]},l={className:"meta",begin:/^(>>>|\.\.\.) /},c={className:"subst",begin:/\{/,end:/\}/,keywords:o,illegal:/#/},u={begin:/\{\{/,relevance:0},h={className:"string",contains:[e.BACKSLASH_ESCAPE],variants:[{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,l],relevance:10},{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,l],relevance:10},{begin:/([fFtT][rR]|[rR][fFtT]|[fFtT])'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,l,u,c]},{begin:/([fFtT][rR]|[rR][fFtT]|[fFtT])"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,l,u,c]},{begin:/([uU]|[rR])'/,end:/'/,relevance:10},{begin:/([uU]|[rR])"/,end:/"/,relevance:10},{begin:/([bB]|[bB][rR]|[rR][bB])'/,end:/'/},{begin:/([bB]|[bB][rR]|[rR][bB])"/,end:/"/},{begin:/([fFtT][rR]|[rR][fFtT]|[fFtT])'/,end:/'/,contains:[e.BACKSLASH_ESCAPE,u,c]},{begin:/([fFtT][rR]|[rR][fFtT]|[fFtT])"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,u,c]},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},d="[0-9](_?[0-9])*",f=`(\\b(${d}))?\\.(${d})|\\b(${d})\\.`,p=`\\b|${n.join("|")}`,_={className:"number",relevance:0,variants:[{begin:`(\\b(${d})|(${f}))[eE][+-]?(${d})[jJ]?(?=${p})`},{begin:`(${f})[jJ]?`},{begin:`\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${p})`},{begin:`\\b0[bB](_?[01])+[lL]?(?=${p})`},{begin:`\\b0[oO](_?[0-7])+[lL]?(?=${p})`},{begin:`\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${p})`},{begin:`\\b(${d})[jJ](?=${p})`}]},v={className:"comment",begin:t.lookahead(/# type:/),end:/$/,keywords:o,contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},g={className:"params",variants:[{className:"",begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:o,contains:["self",l,_,h,e.HASH_COMMENT_MODE]}]};return c.contains=[h,_,l],{name:"Python",aliases:["py","gyp","ipython"],unicodeRegex:!0,keywords:o,illegal:/(<\/|\?)|=>/,contains:[l,_,{scope:"variable.language",match:/\bself\b/},{beginKeywords:"if",relevance:0},{match:/\bor\b/,scope:"keyword"},h,v,e.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,i],scope:{1:"keyword",3:"title.function"},contains:[g]},{variants:[{match:[/\bclass/,/\s+/,i,/\s*/,/\(\s*/,i,/\s*\)/]},{match:[/\bclass/,/\s+/,i]}],scope:{1:"keyword",3:"title.class",6:"title.class.inherited"}},{className:"meta",begin:/^[\t ]*@/,end:/(?=#)|$/,contains:[_,g,h]}]}}hk.exports=KB});var pk=me((qU,fk)=>{function WB(e){return{aliases:["pycon"],contains:[{className:"meta.prompt",starts:{end:/ |$/,starts:{end:"$",subLanguage:"python"}},variants:[{begin:/^>>>(?=[ ]|$)/},{begin:/^\.\.\.(?=[ ]|$)/}]}]}}fk.exports=WB});var gk=me((KU,mk)=>{function GB(e){let t=e.regex,i=/(?:(?:[a-zA-Z]|\.[._a-zA-Z])[._a-zA-Z0-9]*)|\.(?!\d)/,n=t.either(/0[xX][0-9a-fA-F]+\.[0-9a-fA-F]*[pP][+-]?\d+i?/,/0[xX][0-9a-fA-F]+(?:[pP][+-]?\d+)?[Li]?/,/(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+)?[Li]?/),s=/[=!<>:]=|\|\||&&|:::?|<-|<<-|->>|->|\|>|[-+*\/?!$&|:<=>@^~]|\*\*/,r=t.either(/[()]/,/[{}]/,/\[\[/,/[[\]]/,/\\/,/,/);return{name:"R",keywords:{$pattern:i,keyword:"function if in break next repeat else for while",literal:"NULL NA TRUE FALSE Inf NaN NA_integer_|10 NA_real_|10 NA_character_|10 NA_complex_|10",built_in:"LETTERS letters month.abb month.name pi T F abs acos acosh all any anyNA Arg as.call as.character as.complex as.double as.environment as.integer as.logical as.null.default as.numeric as.raw asin asinh atan atanh attr attributes baseenv browser c call ceiling class Conj cos cosh cospi cummax cummin cumprod cumsum digamma dim dimnames emptyenv exp expression floor forceAndCall gamma gc.time globalenv Im interactive invisible is.array is.atomic is.call is.character is.complex is.double is.environment is.expression is.finite is.function is.infinite is.integer is.language is.list is.logical is.matrix is.na is.name is.nan is.null is.numeric is.object is.pairlist is.raw is.recursive is.single is.symbol lazyLoadDBfetch length lgamma list log max min missing Mod names nargs nzchar oldClass on.exit pos.to.env proc.time prod quote range Re rep retracemem return round seq_along seq_len seq.int sign signif sin sinh sinpi sqrt standardGeneric substitute sum switch tan tanh tanpi tracemem trigamma trunc unclass untracemem UseMethod xtfrm"},contains:[e.COMMENT(/#'/,/$/,{contains:[{scope:"doctag",match:/@examples/,starts:{end:t.lookahead(t.either(/\n^#'\s*(?=@[a-zA-Z]+)/,/\n^(?!#')/)),endsParent:!0}},{scope:"doctag",begin:"@param",end:/$/,contains:[{scope:"variable",variants:[{match:i},{match:/`(?:\\.|[^`\\])+`/}],endsParent:!0}]},{scope:"doctag",match:/@[a-zA-Z]+/},{scope:"keyword",match:/\\[a-zA-Z]+/}]}),e.HASH_COMMENT_MODE,{scope:"string",contains:[e.BACKSLASH_ESCAPE],variants:[e.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\(/,end:/\)(-*)"/}),e.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\{/,end:/\}(-*)"/}),e.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\[/,end:/\](-*)"/}),e.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\(/,end:/\)(-*)'/}),e.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\{/,end:/\}(-*)'/}),e.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\[/,end:/\](-*)'/}),{begin:'"',end:'"',relevance:0},{begin:"'",end:"'",relevance:0}]},{relevance:0,variants:[{scope:{1:"operator",2:"number"},match:[s,n]},{scope:{1:"operator",2:"number"},match:[/%[^%]*%/,n]},{scope:{1:"punctuation",2:"number"},match:[r,n]},{scope:{2:"number"},match:[/[^a-zA-Z0-9._]|^/,n]}]},{scope:{3:"operator"},match:[i,/\s+/,/<-/,/\s+/]},{scope:"operator",relevance:0,variants:[{match:s},{match:/%[^%]*%/}]},{scope:"punctuation",relevance:0,match:r},{begin:"`",end:"`",contains:[{begin:/\\./}]}]}}mk.exports=GB});var vk=me((WU,_k)=>{function $B(e){let t=e.regex,i=/(r#)?/,n=t.concat(i,e.UNDERSCORE_IDENT_RE),s=t.concat(i,e.IDENT_RE),r={scope:"title.function.invoke",relevance:0,begin:t.concat(/\b/,/(?!(?:let|for|while|if|else|match)\b)/,s,t.lookahead(/\s*\(/))},a="([ui](8|16|32|64|128|size)|f(16|32|64|128))?",o=["abstract","as","async","await","become","box","break","const","continue","crate","do","dyn","else","enum","extern","false","final","fn","for","if","impl","in","let","loop","macro","match","mod","move","mut","override","priv","pub","raw","ref","return","self","Self","static","struct","super","trait","true","try","type","typeof","union","unsafe","unsized","use","virtual","where","while","yield"],l=["true","false","Some","None","Ok","Err"],c=["drop ","Copy","Send","Sized","Sync","Drop","Fn","FnMut","FnOnce","ToOwned","Clone","Debug","PartialEq","PartialOrd","Eq","Ord","AsRef","AsMut","Into","From","Default","Iterator","Extend","IntoIterator","DoubleEndedIterator","ExactSizeIterator","SliceConcatExt","ToString","assert!","assert_eq!","bitflags!","bytes!","cfg!","col!","concat!","concat_idents!","debug_assert!","debug_assert_eq!","env!","eprintln!","panic!","file!","format!","format_args!","include_bytes!","include_str!","line!","local_data_key!","module_path!","option_env!","print!","println!","select!","stringify!","try!","unimplemented!","unreachable!","vec!","write!","writeln!","macro_rules!","assert_ne!","debug_assert_ne!"],u=["i8","i16","i32","i64","i128","isize","u8","u16","u32","u64","u128","usize","f16","f32","f64","f128","str","char","bool","Box","Option","Result","String","Vec"];return{name:"Rust",aliases:["rs"],keywords:{$pattern:e.IDENT_RE+"!?",type:u,keyword:o,literal:l,built_in:c},illegal:"</",contains:[e.C_LINE_COMMENT_MODE,e.COMMENT("/\\*","\\*/",{contains:["self"]}),e.inherit(e.QUOTE_STRING_MODE,{begin:/b?"/,illegal:null}),{scope:"symbol",begin:/'[a-zA-Z_][a-zA-Z0-9_]*(?!')/},{scope:"string",variants:[{begin:/b?r(#*)"(.|\n)*?"\1(?!#)/},{begin:/b?'/,end:/'/,contains:[{scope:"char.escape",match:/\\('|"|\\|\w|x\w{2}|u\w{4}|U\w{8})/}]}]},{scope:"number",variants:[{begin:"\\b0b([01_]+)"+a},{begin:"\\b0o([0-7_]+)"+a},{begin:"\\b0x([A-Fa-f0-9_]+)"+a},{begin:"\\b(\\d[\\d_]*(\\.[0-9_]+)?([eE][+-]?[0-9_]+)?)"+a}],relevance:0},{begin:[/\bsafe/,/\s+/,/extern/],scope:{1:"keyword",3:"keyword"}},{begin:[/fn/,/\s+/,n],scope:{1:"keyword",3:"title.function"}},{scope:"meta",begin:"#!?\\[",end:"\\]",contains:[{scope:"string",begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE]}]},{begin:[/let/,/\s+/,/(?:mut\s+)?/,n],scope:{1:"keyword",3:"keyword",4:"variable"}},{begin:[/for/,/\s+/,n,/\s+/,/in/],scope:{1:"keyword",3:"variable",5:"keyword"}},{begin:[/type/,/\s+/,n],scope:{1:"keyword",3:"title.class"}},{begin:[/(?:trait|enum|struct|union|impl|for)/,/\s+/,n],scope:{1:"keyword",3:"title.class"}},{begin:e.IDENT_RE+"::",keywords:{keyword:"Self",built_in:c,type:u}},{scope:"punctuation",begin:"->"},r]}}_k.exports=$B});var yk=me((GU,bk)=>{var YB=e=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:e.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},UNICODE_RANGE:{scope:"number",begin:/\b[Uu]\+[0-9A-Fa-f][0-9A-Fa-f?]{0,5}(-[0-9A-Fa-f][0-9A-Fa-f]{0,5})?/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:e.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),jB=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],VB=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],XB=[...jB,...VB],ZB=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),QB=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),JB=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),eI=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","corner-bottom-left-shape","corner-bottom-right-shape","corner-shape","corner-top-left-shape","corner-top-right-shape","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","unicode-range","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse();function tI(e){let t=YB(e),i=JB,n=QB,s="@[a-z-]+",r="and or not only",o={className:"variable",begin:"(\\$"+"[a-zA-Z-][a-zA-Z0-9_-]*"+")\\b",relevance:0};return{name:"SCSS",case_insensitive:!0,illegal:"[=/|']",contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,t.CSS_NUMBER_MODE,{className:"selector-id",begin:"#[A-Za-z0-9_-]+",relevance:0},{className:"selector-class",begin:"\\.[A-Za-z0-9_-]+",relevance:0},t.ATTRIBUTE_SELECTOR_MODE,{className:"selector-tag",begin:"\\b("+XB.join("|")+")\\b",relevance:0},{className:"selector-pseudo",begin:":("+n.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+i.join("|")+")"},o,{begin:/\(/,end:/\)/,contains:[t.CSS_NUMBER_MODE]},t.CSS_VARIABLE,{className:"attribute",begin:"\\b("+eI.join("|")+")\\b"},{begin:"\\b(whitespace|wait|w-resize|visible|vertical-text|vertical-ideographic|uppercase|upper-roman|upper-alpha|underline|transparent|top|thin|thick|text|text-top|text-bottom|tb-rl|table-header-group|table-footer-group|sw-resize|super|strict|static|square|solid|small-caps|separate|se-resize|scroll|s-resize|rtl|row-resize|ridge|right|repeat|repeat-y|repeat-x|relative|progress|pointer|overline|outside|outset|oblique|nowrap|not-allowed|normal|none|nw-resize|no-repeat|no-drop|newspaper|ne-resize|n-resize|move|middle|medium|ltr|lr-tb|lowercase|lower-roman|lower-alpha|loose|list-item|line|line-through|line-edge|lighter|left|keep-all|justify|italic|inter-word|inter-ideograph|inside|inset|inline|inline-block|inherit|inactive|ideograph-space|ideograph-parenthesis|ideograph-numeric|ideograph-alpha|horizontal|hidden|help|hand|groove|fixed|ellipsis|e-resize|double|dotted|distribute|distribute-space|distribute-letter|distribute-all-lines|disc|disabled|default|decimal|dashed|crosshair|collapse|col-resize|circle|char|center|capitalize|break-word|break-all|bottom|both|bolder|bold|block|bidi-override|below|baseline|auto|always|all-scroll|absolute|table|table-cell)\\b"},{begin:/:/,end:/[;}{]/,relevance:0,contains:[t.BLOCK_COMMENT,o,t.HEXCOLOR,t.CSS_NUMBER_MODE,t.UNICODE_RANGE,e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,t.IMPORTANT,t.FUNCTION_DISPATCH]},{begin:"@(page|font-face)",keywords:{$pattern:s,keyword:"@page @font-face"}},{begin:"@",end:"[{;]",returnBegin:!0,keywords:{$pattern:/[a-z-]+/,keyword:r,attribute:ZB.join(" ")},contains:[{begin:s,className:"keyword"},{begin:/[a-z-]+(?=:)/,className:"attribute"},o,e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,t.HEXCOLOR,t.CSS_NUMBER_MODE]},t.FUNCTION_DISPATCH]}}bk.exports=tI});var wk=me(($U,Sk)=>{function iI(e){return{name:"Shell Session",aliases:["console","shellsession"],contains:[{className:"meta.prompt",begin:/^\s{0,3}[./~\w\d[\]()@-]*[>%$#][ ]?/,starts:{end:/[^\\](?=\s*$)/,subLanguage:"bash"}}]}}Sk.exports=iI});var xk=me((YU,Ek)=>{function nI(e){let t=e.regex,i=e.COMMENT("--","$"),n={scope:"string",variants:[{begin:/'/,end:/'/,contains:[{match:/''/}]}]},s={begin:/"/,end:/"/,contains:[{match:/""/}]},r=["true","false","unknown"],a=["double precision","large object","with timezone","without timezone"],o=["bigint","binary","blob","boolean","char","character","clob","date","dec","decfloat","decimal","float","int","integer","interval","nchar","nclob","national","numeric","real","row","smallint","time","timestamp","varchar","varying","varbinary"],l=["add","asc","collation","desc","final","first","last","view"],c=["abs","acos","all","allocate","alter","and","any","are","array","array_agg","array_max_cardinality","as","asensitive","asin","asymmetric","at","atan","atomic","authorization","avg","begin","begin_frame","begin_partition","between","bigint","binary","blob","boolean","both","by","call","called","cardinality","cascaded","case","cast","ceil","ceiling","char","char_length","character","character_length","check","classifier","clob","close","coalesce","collate","collect","column","commit","condition","connect","constraint","contains","convert","copy","corr","corresponding","cos","cosh","count","covar_pop","covar_samp","create","cross","cube","cume_dist","current","current_catalog","current_date","current_default_transform_group","current_path","current_role","current_row","current_schema","current_time","current_timestamp","current_path","current_role","current_transform_group_for_type","current_user","cursor","cycle","date","day","deallocate","dec","decimal","decfloat","declare","default","define","delete","dense_rank","deref","describe","deterministic","disconnect","distinct","double","drop","dynamic","each","element","else","empty","end","end_frame","end_partition","end-exec","equals","escape","every","except","exec","execute","exists","exp","external","extract","false","fetch","filter","first_value","float","floor","for","foreign","frame_row","free","from","full","function","fusion","get","global","grant","group","grouping","groups","having","hold","hour","identity","in","indicator","initial","inner","inout","insensitive","insert","int","integer","intersect","intersection","interval","into","is","join","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","language","large","last_value","lateral","lead","leading","left","like","like_regex","listagg","ln","local","localtime","localtimestamp","log","log10","lower","match","match_number","match_recognize","matches","max","member","merge","method","min","minute","mod","modifies","module","month","multiset","national","natural","nchar","nclob","new","no","none","normalize","not","nth_value","ntile","null","nullif","numeric","octet_length","occurrences_regex","of","offset","old","omit","on","one","only","open","or","order","out","outer","over","overlaps","overlay","parameter","partition","pattern","per","percent","percent_rank","percentile_cont","percentile_disc","period","portion","position","position_regex","power","precedes","precision","prepare","primary","procedure","ptf","range","rank","reads","real","recursive","ref","references","referencing","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","release","result","return","returns","revoke","right","rollback","rollup","row","row_number","rows","running","savepoint","scope","scroll","search","second","seek","select","sensitive","session_user","set","show","similar","sin","sinh","skip","smallint","some","specific","specifictype","sql","sqlexception","sqlstate","sqlwarning","sqrt","start","static","stddev_pop","stddev_samp","submultiset","subset","substring","substring_regex","succeeds","sum","symmetric","system","system_time","system_user","table","tablesample","tan","tanh","then","time","timestamp","timezone_hour","timezone_minute","to","trailing","translate","translate_regex","translation","treat","trigger","trim","trim_array","true","truncate","uescape","union","unique","unknown","unnest","update","upper","user","using","value","values","value_of","var_pop","var_samp","varbinary","varchar","varying","versioning","when","whenever","where","width_bucket","window","with","within","without","year"],u=["abs","acos","array_agg","asin","atan","avg","cast","ceil","ceiling","coalesce","corr","cos","cosh","count","covar_pop","covar_samp","cume_dist","dense_rank","deref","element","exp","extract","first_value","floor","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","last_value","lead","listagg","ln","log","log10","lower","max","min","mod","nth_value","ntile","nullif","percent_rank","percentile_cont","percentile_disc","position","position_regex","power","rank","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","row_number","sin","sinh","sqrt","stddev_pop","stddev_samp","substring","substring_regex","sum","tan","tanh","translate","translate_regex","treat","trim","trim_array","unnest","upper","value_of","var_pop","var_samp","width_bucket"],h=["current_catalog","current_date","current_default_transform_group","current_path","current_role","current_schema","current_transform_group_for_type","current_user","session_user","system_time","system_user","current_time","localtime","current_timestamp","localtimestamp"],d=["create table","insert into","primary key","foreign key","not null","alter table","add constraint","grouping sets","on overflow","character set","respect nulls","ignore nulls","nulls first","nulls last","depth first","breadth first"],f=u,p=[...c,...l].filter(x=>!u.includes(x)),_={scope:"variable",match:/@[a-z0-9][a-z0-9_]*/},v={scope:"operator",match:/[-+*/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?/,relevance:0},g={match:t.concat(/\b/,t.either(...f),/\s*\(/),relevance:0,keywords:{built_in:f}};function m(x){return t.concat(/\b/,t.either(...x.map(C=>C.replace(/\s+/,"\\s+"))),/\b/)}let b={scope:"keyword",match:m(d),relevance:0};function S(x,{exceptions:C,when:N}={}){let M=N;return C=C||[],x.map(O=>O.match(/\|\d+$/)||C.includes(O)?O:M(O)?`${O}|0`:O)}return{name:"SQL",case_insensitive:!0,illegal:/[{}]|<\//,keywords:{$pattern:/\b[\w\.]+/,keyword:S(p,{when:x=>x.length<3}),literal:r,type:o,built_in:h},contains:[{scope:"type",match:m(a)},b,g,_,n,s,e.C_NUMBER_MODE,e.C_BLOCK_COMMENT_MODE,i,v]}}Ek.exports=nI});var Dk=me((jU,Rk)=>{function Nk(e){return e?typeof e=="string"?e:e.source:null}function Qc(e){return Je("(?=",e,")")}function Je(...e){return e.map(i=>Nk(i)).join("")}function sI(e){let t=e[e.length-1];return typeof t=="object"&&t.constructor===Object?(e.splice(e.length-1,1),t):{}}function Ei(...e){return"("+(sI(e).capture?"":"?:")+e.map(n=>Nk(n)).join("|")+")"}new RegExp(Ei(/\[(?:[^\\\]]|\\.)*\]/,/\(\?<(?![=!])[^>]+>/,/\(\?'[^']+'/,/\(\??/,/\\([1-9][0-9]*)/,/\\./));var $_=e=>Je(/\b/,e,/\w$/.test(e)?/\b/:/\B/),rI=["Protocol","Type"].map($_),Ck=["init","self"].map($_),aI=["Any","Self"],W_=["actor","any","associatedtype","async","await",/as\?/,/as!/,"as","borrowing","break","case","catch","class","consume","consuming","continue","convenience","copy","default","defer","deinit","didSet","distributed","do","dynamic","each","else","enum","extension","fallthrough",/fileprivate\(set\)/,"fileprivate","final","for","func","get","guard","if","import","indirect","infix",/init\?/,/init!/,"inout",/internal\(set\)/,"internal","in","is","isolated","nonisolated","lazy","let","macro","mutating","nonmutating",/open\(set\)/,"open","operator","optional","override","package","postfix","precedencegroup","prefix",/private\(set\)/,"private","protocol",/public\(set\)/,"public","repeat","required","rethrows","return","set","some","static","struct","subscript","super","switch","throws","throw",/try\?/,/try!/,"try","typealias",/unowned\(safe\)/,/unowned\(unsafe\)/,"unowned","var","weak","where","while","willSet"],kk=["false","nil","true"],oI=["assignment","associativity","higherThan","left","lowerThan","none","right"],lI=["#colorLiteral","#column","#dsohandle","#else","#elseif","#endif","#error","#file","#fileID","#fileLiteral","#filePath","#function","#if","#imageLiteral","#keyPath","#line","#selector","#sourceLocation","#warning"],Tk=["abs","all","any","assert","assertionFailure","debugPrint","dump","fatalError","getVaList","isKnownUniquelyReferenced","max","min","numericCast","pointwiseMax","pointwiseMin","precondition","preconditionFailure","print","readLine","repeatElement","sequence","stride","swap","swift_unboxFromSwiftValueWithType","transcode","type","unsafeBitCast","unsafeDowncast","withExtendedLifetime","withUnsafeMutablePointer","withUnsafePointer","withVaList","withoutActuallyEscaping","zip"],Ak=Ei(/[/=\-+!*%<>&|^~?]/,/[\u00A1-\u00A7]/,/[\u00A9\u00AB]/,/[\u00AC\u00AE]/,/[\u00B0\u00B1]/,/[\u00B6\u00BB\u00BF\u00D7\u00F7]/,/[\u2016-\u2017]/,/[\u2020-\u2027]/,/[\u2030-\u203E]/,/[\u2041-\u2053]/,/[\u2055-\u205E]/,/[\u2190-\u23FF]/,/[\u2500-\u2775]/,/[\u2794-\u2BFF]/,/[\u2E00-\u2E7F]/,/[\u3001-\u3003]/,/[\u3008-\u3020]/,/[\u3030]/),Mk=Ei(Ak,/[\u0300-\u036F]/,/[\u1DC0-\u1DFF]/,/[\u20D0-\u20FF]/,/[\uFE00-\uFE0F]/,/[\uFE20-\uFE2F]/),G_=Je(Ak,Mk,"*"),Ok=Ei(/[a-zA-Z_]/,/[\u00A8\u00AA\u00AD\u00AF\u00B2-\u00B5\u00B7-\u00BA]/,/[\u00BC-\u00BE\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF]/,/[\u0100-\u02FF\u0370-\u167F\u1681-\u180D\u180F-\u1DBF]/,/[\u1E00-\u1FFF]/,/[\u200B-\u200D\u202A-\u202E\u203F-\u2040\u2054\u2060-\u206F]/,/[\u2070-\u20CF\u2100-\u218F\u2460-\u24FF\u2776-\u2793]/,/[\u2C00-\u2DFF\u2E80-\u2FFF]/,/[\u3004-\u3007\u3021-\u302F\u3031-\u303F\u3040-\uD7FF]/,/[\uF900-\uFD3D\uFD40-\uFDCF\uFDF0-\uFE1F\uFE30-\uFE44]/,/[\uFE47-\uFEFE\uFF00-\uFFFD]/),Xd=Ei(Ok,/\d/,/[\u0300-\u036F\u1DC0-\u1DFF\u20D0-\u20FF\uFE20-\uFE2F]/),bs=Je(Ok,Xd,"*"),Vd=Je(/[A-Z]/,Xd,"*"),cI=["attached","autoclosure",Je(/convention\(/,Ei("swift","block","c"),/\)/),"discardableResult","dynamicCallable","dynamicMemberLookup","escaping","freestanding","frozen","GKInspectable","IBAction","IBDesignable","IBInspectable","IBOutlet","IBSegueAction","inlinable","main","nonobjc","NSApplicationMain","NSCopying","NSManaged",Je(/objc\(/,bs,/\)/),"objc","objcMembers","propertyWrapper","requires_stored_property_inits","resultBuilder","Sendable","testable","UIApplicationMain","unchecked","unknown","usableFromInline","warn_unqualified_access"],uI=["iOS","iOSApplicationExtension","macOS","macOSApplicationExtension","macCatalyst","macCatalystApplicationExtension","watchOS","watchOSApplicationExtension","tvOS","tvOSApplicationExtension","swift"];function hI(e){let t={match:/\s+/,relevance:0},i=e.COMMENT("/\\*","\\*/",{contains:["self"]}),n=[e.C_LINE_COMMENT_MODE,i],s={match:[/\./,Ei(...rI,...Ck)],className:{2:"keyword"}},r={match:Je(/\./,Ei(...W_)),relevance:0},a=W_.filter(oe=>typeof oe=="string").concat(["_|0"]),o=W_.filter(oe=>typeof oe!="string").concat(aI).map($_),l={variants:[{className:"keyword",match:Ei(...o,...Ck)}]},c={$pattern:Ei(/\b\w+/,/#\w+/),keyword:a.concat(lI),literal:kk},u=[s,r,l],h={match:Je(/\./,Ei(...Tk)),relevance:0},d={className:"built_in",match:Je(/\b/,Ei(...Tk),/(?=\()/)},f=[h,d],p={match:/->/,relevance:0},_={className:"operator",relevance:0,variants:[{match:G_},{match:`\\.(\\.|${Mk})+`}]},v=[p,_],g="([0-9]_*)+",m="([0-9a-fA-F]_*)+",b={className:"number",relevance:0,variants:[{match:`\\b(${g})(\\.(${g}))?([eE][+-]?(${g}))?\\b`},{match:`\\b0x(${m})(\\.(${m}))?([pP][+-]?(${g}))?\\b`},{match:/\b0o([0-7]_*)+\b/},{match:/\b0b([01]_*)+\b/}]},S=(oe="")=>({className:"subst",variants:[{match:Je(/\\/,oe,/[0\\tnr"']/)},{match:Je(/\\/,oe,/u\{[0-9a-fA-F]{1,8}\}/)}]}),x=(oe="")=>({className:"subst",match:Je(/\\/,oe,/[\t ]*(?:[\r\n]|\r\n)/)}),C=(oe="")=>({className:"subst",label:"interpol",begin:Je(/\\/,oe,/\(/),end:/\)/}),N=(oe="")=>({begin:Je(oe,/"""/),end:Je(/"""/,oe),contains:[S(oe),x(oe),C(oe)]}),M=(oe="")=>({begin:Je(oe,/"/),end:Je(/"/,oe),contains:[S(oe),C(oe)]}),O={className:"string",variants:[N(),N("#"),N("##"),N("###"),M(),M("#"),M("##"),M("###")]},q=[e.BACKSLASH_ESCAPE,{begin:/\[/,end:/\]/,relevance:0,contains:[e.BACKSLASH_ESCAPE]}],G={begin:/\/[^\s](?=[^/\n]*\/)/,end:/\//,contains:q},I=oe=>{let zi=Je(oe,/\//),ie=Je(/\//,oe);return{begin:zi,end:ie,contains:[...q,{scope:"comment",begin:`#(?!.*${ie})`,end:/$/}]}},P={scope:"regexp",variants:[I("###"),I("##"),I("#"),G]},R={match:Je(/`/,bs,/`/)},K={className:"variable",match:/\$\d+/},T={className:"variable",match:`\\$${Xd}+`},D=[R,K,T],A={match:/(@|#(un)?)available/,scope:"keyword",starts:{contains:[{begin:/\(/,end:/\)/,keywords:uI,contains:[...v,b,O]}]}},Z={scope:"keyword",match:Je(/@/,Ei(...cI),Qc(Ei(/\(/,/\s+/)))},re={scope:"meta",match:Je(/@/,bs)},L=[A,Z,re],ee={match:Qc(/\b[A-Z]/),relevance:0,contains:[{className:"type",match:Je(/(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)/,Xd,"+")},{className:"type",match:Vd,relevance:0},{match:/[?!]+/,relevance:0},{match:/\.\.\./,relevance:0},{match:Je(/\s+&\s+/,Qc(Vd)),relevance:0}]},Ce={begin:/</,end:/>/,keywords:c,contains:[...n,...u,...L,p,ee]};ee.contains.push(Ce);let ue={match:Je(bs,/\s*:/),keywords:"_|0",relevance:0},Ue={begin:/\(/,end:/\)/,relevance:0,keywords:c,contains:["self",ue,...n,P,...u,...f,...v,b,O,...D,...L,ee]},Q={begin:/</,end:/>/,keywords:"repeat each",contains:[...n,ee]},Oe={begin:Ei(Qc(Je(bs,/\s*:/)),Qc(Je(bs,/\s+/,bs,/\s*:/))),end:/:/,relevance:0,contains:[{className:"keyword",match:/\b_\b/},{className:"params",match:bs}]},_i={begin:/\(/,end:/\)/,keywords:c,contains:[Oe,...n,...u,...v,b,O,...L,ee,Ue],endsParent:!0,illegal:/["']/},zt={match:[/(func|macro)/,/\s+/,Ei(R.match,bs,G_)],className:{1:"keyword",3:"title.function"},contains:[Q,_i,t],illegal:[/\[/,/%/]},Bi={match:[/\b(?:subscript|init[?!]?)/,/\s*(?=[<(])/],className:{1:"keyword"},contains:[Q,_i,t],illegal:/\[|%/},Ii={match:[/operator/,/\s+/,G_],className:{1:"keyword",3:"title"}},vi={begin:[/precedencegroup/,/\s+/,Vd],className:{1:"keyword",3:"title"},contains:[ee],keywords:[...oI,...kk],end:/}/},ve={match:[/class\b/,/\s+/,/func\b/,/\s+/,/\b[A-Za-z_][A-Za-z0-9_]*\b/],scope:{1:"keyword",3:"keyword",5:"title.function"}},mn={match:[/class\b/,/\s+/,/var\b/],scope:{1:"keyword",3:"keyword"}},oi={begin:[/(struct|protocol|class|extension|enum|actor)/,/\s+/,bs,/\s*/],beginScope:{1:"keyword",3:"title.class"},keywords:c,contains:[Q,...u,{begin:/:/,end:/\{/,keywords:c,contains:[{scope:"title.class.inherited",match:Vd},...u],relevance:0}]};for(let oe of O.variants){let zi=oe.contains.find(jn=>jn.label==="interpol");zi.keywords=c;let ie=[...u,...f,...v,b,O,...D];zi.contains=[...ie,{begin:/\(/,end:/\)/,contains:["self",...ie]}]}return{name:"Swift",keywords:c,contains:[...n,zt,Bi,ve,mn,oi,Ii,vi,{beginKeywords:"import",end:/$/,contains:[...n],relevance:0},P,...u,...f,...v,b,O,...D,...L,ee,Ue]}}Rk.exports=hI});var Bk=me((VU,Lk)=>{function dI(e){let t="true false yes no null",i="[\\w#;/?:@&=+$,.~*'()[\\]]+",n={className:"attr",variants:[{begin:/[\w*@][\w*@ :()\./-]*:(?=[ \t]|$)/},{begin:/"[\w*@][\w*@ :()\./-]*":(?=[ \t]|$)/},{begin:/'[\w*@][\w*@ :()\./-]*':(?=[ \t]|$)/}]},s={className:"template-variable",variants:[{begin:/\{\{/,end:/\}\}/},{begin:/%\{/,end:/\}/}]},r={className:"string",relevance:0,begin:/'/,end:/'/,contains:[{match:/''/,scope:"char.escape",relevance:0}]},a={className:"string",relevance:0,variants:[{begin:/"/,end:/"/},{begin:/\S+/}],contains:[e.BACKSLASH_ESCAPE,s]},o=e.inherit(a,{variants:[{begin:/'/,end:/'/,contains:[{begin:/''/,relevance:0}]},{begin:/"/,end:/"/},{begin:/[^\s,{}[\]]+/}]}),d={className:"number",begin:"\\b"+"[0-9]{4}(-[0-9][0-9]){0,2}"+"([Tt \\t][0-9][0-9]?(:[0-9][0-9]){2})?"+"(\\.[0-9]*)?"+"([ \\t])*(Z|[-+][0-9][0-9]?(:[0-9][0-9])?)?"+"\\b"},f={end:",",endsWithParent:!0,excludeEnd:!0,keywords:t,relevance:0},p={begin:/\{/,end:/\}/,contains:[f],illegal:"\\n",relevance:0},_={begin:"\\[",end:"\\]",contains:[f],illegal:"\\n",relevance:0},v=[n,{className:"meta",begin:"^---\\s*$",relevance:10},{className:"string",begin:"[\\|>]([1-9]?[+-])?[ ]*\\n( +)[^ ][^\\n]*\\n(\\2[^\\n]+\\n?)*"},{begin:"<%[%=-]?",end:"[%-]?%>",subLanguage:"ruby",excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:"!\\w+!"+i},{className:"type",begin:"!<"+i+">"},{className:"type",begin:"!"+i},{className:"type",begin:"!!"+i},{className:"meta",begin:"&"+e.UNDERSCORE_IDENT_RE+"$"},{className:"meta",begin:"\\*"+e.UNDERSCORE_IDENT_RE+"$"},{className:"bullet",begin:"-(?=[ ]|$)",relevance:0},e.HASH_COMMENT_MODE,{beginKeywords:t,keywords:{literal:t}},d,{className:"number",begin:e.C_NUMBER_RE+"\\b",relevance:0},p,_,r,a],g=[...v];return g.pop(),g.push(o),f.contains=g,{name:"YAML",case_insensitive:!0,aliases:["yml"],contains:v}}Lk.exports=dI});var Wk=me((XU,Kk)=>{var Zd="[A-Za-z$_][0-9A-Za-z$_]*",Ik=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends","using"],zk=["true","false","null","undefined","NaN","Infinity"],Pk=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],Uk=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],Hk=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],Fk=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","self","global"],qk=[].concat(Hk,Pk,Uk);function fI(e){let t=e.regex,i=(A,{after:Z})=>{let re="</"+A[0].slice(1);return A.input.indexOf(re,Z)!==-1},n=Zd,s={begin:"<>",end:"</>"},r=/<[A-Za-z0-9\\._:-]+\s*\/>/,a={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(A,Z)=>{let re=A[0].length+A.index,L=A.input[re];if(L==="<"||L===","){Z.ignoreMatch();return}L===">"&&(i(A,{after:re})||Z.ignoreMatch());let ee,Ce=A.input.substring(re);if(ee=Ce.match(/^\s*=/)){Z.ignoreMatch();return}if((ee=Ce.match(/^\s+extends\s+/))&&ee.index===0){Z.ignoreMatch();return}}},o={$pattern:Zd,keyword:Ik,literal:zk,built_in:qk,"variable.language":Fk},l="[0-9](_?[0-9])*",c=`\\.(${l})`,u="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",h={className:"number",variants:[{begin:`(\\b(${u})((${c})|\\.)?|(${c}))[eE][+-]?(${l})\\b`},{begin:`\\b(${u})\\b((${c})\\b|\\.)?|(${c})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},d={className:"subst",begin:"\\$\\{",end:"\\}",keywords:o,contains:[]},f={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,d],subLanguage:"xml"}},p={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,d],subLanguage:"css"}},_={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,d],subLanguage:"graphql"}},v={className:"string",begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,d]},m={className:"comment",variants:[e.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:n+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]},b=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,f,p,_,v,{match:/\$\d+/},h];d.contains=b.concat({begin:/\{/,end:/\}/,keywords:o,contains:["self"].concat(b)});let S=[].concat(m,d.contains),x=S.concat([{begin:/(\s*)\(/,end:/\)/,keywords:o,contains:["self"].concat(S)}]),C={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:o,contains:x},N={variants:[{match:[/class/,/\s+/,n,/\s+/,/extends/,/\s+/,t.concat(n,"(",t.concat(/\./,n),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,n],scope:{1:"keyword",3:"title.class"}}]},M={relevance:0,match:t.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...Pk,...Uk]}},O={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},q={variants:[{match:[/function/,/\s+/,n,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[C],illegal:/%/},G={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function I(A){return t.concat("(?!",A.join("|"),")")}let P={match:t.concat(/\b/,I([...Hk,"super","import","await"].map(A=>`${A}\\s*\\(`)),n,t.lookahead(/\s*\(/)),className:"title.function",relevance:0},R={begin:t.concat(/\./,t.lookahead(t.concat(n,/(?![0-9A-Za-z$_(])/))),end:n,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},K={match:[/get|set/,/\s+/,n,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},C]},T="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",D={match:[/const|var|let/,/\s+/,n,/\s*/,/=\s*/,/(async\s*)?/,t.lookahead(T)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[C]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:o,exports:{PARAMS_CONTAINS:x,CLASS_REFERENCE:M},illegal:/#(?![$_A-Za-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),O,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,f,p,_,v,m,{match:/\$\d+/},h,M,{scope:"attr",match:n+t.lookahead(":"),relevance:0},D,{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[m,e.REGEXP_MODE,{className:"function",begin:T,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:e.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:o,contains:x}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:s.begin,end:s.end},{match:r},{begin:a.begin,"on:begin":a.isTrulyOpeningTag,end:a.end}],subLanguage:"xml",contains:[{begin:a.begin,end:a.end,skip:!0,contains:["self"]}]}]},q,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[C,e.inherit(e.TITLE_MODE,{begin:n,className:"title.function"})]},{match:/\.\.\./,relevance:0},R,{match:"\\$"+n,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[C]},P,G,N,K,{match:/\$[(.]/}]}}function pI(e){let t=e.regex,i=fI(e),n=Zd,s=["any","void","number","boolean","string","object","never","symbol","bigint","unknown"],r={begin:[/namespace/,/\s+/,e.IDENT_RE],beginScope:{1:"keyword",3:"title.class"}},a={beginKeywords:"interface",end:/\{/,excludeEnd:!0,keywords:{keyword:"interface extends",built_in:s},contains:[i.exports.CLASS_REFERENCE]},o={className:"meta",relevance:10,begin:/^\s*['"]use strict['"]/},l=["type","interface","public","private","protected","implements","declare","abstract","readonly","enum","override","satisfies"],c={$pattern:Zd,keyword:Ik.concat(l),literal:zk,built_in:qk.concat(s),"variable.language":Fk},u={className:"meta",begin:"@"+n},h=(_,v,g)=>{let m=_.contains.findIndex(b=>b.label===v);if(m===-1)throw new Error("can not find mode to replace");_.contains.splice(m,1,g)};Object.assign(i.keywords,c),i.exports.PARAMS_CONTAINS.push(u);let d=i.contains.find(_=>_.scope==="attr"),f=Object.assign({},d,{match:t.concat(n,t.lookahead(/\s*\?:/))});i.exports.PARAMS_CONTAINS.push([i.exports.CLASS_REFERENCE,d,f]),i.contains=i.contains.concat([u,r,a,f]),h(i,"shebang",e.SHEBANG()),h(i,"use_strict",o);let p=i.contains.find(_=>_.label==="func.def");return p.relevance=0,Object.assign(i,{name:"TypeScript",aliases:["ts","tsx","mts","cts"]}),i}Kk.exports=pI});var $k=me((ZU,Gk)=>{function mI(e){let t=e.regex,i={className:"string",begin:/"(""|[^/n])"C\b/},n={className:"string",begin:/"/,end:/"/,illegal:/\n/,contains:[{begin:/""/}]},s=/\d{1,2}\/\d{1,2}\/\d{4}/,r=/\d{4}-\d{1,2}-\d{1,2}/,a=/(\d|1[012])(:\d+){0,2} *(AM|PM)/,o=/\d{1,2}(:\d{1,2}){1,2}/,l={className:"literal",variants:[{begin:t.concat(/# */,t.either(r,s),/ *#/)},{begin:t.concat(/# */,o,/ *#/)},{begin:t.concat(/# */,a,/ *#/)},{begin:t.concat(/# */,t.either(r,s),/ +/,t.either(a,o),/ *#/)}]},c={className:"number",relevance:0,variants:[{begin:/\b\d[\d_]*((\.[\d_]+(E[+-]?[\d_]+)?)|(E[+-]?[\d_]+))[RFD@!#]?/},{begin:/\b\d[\d_]*((U?[SIL])|[%&])?/},{begin:/&H[\dA-F_]+((U?[SIL])|[%&])?/},{begin:/&O[0-7_]+((U?[SIL])|[%&])?/},{begin:/&B[01_]+((U?[SIL])|[%&])?/}]},u={className:"label",begin:/^\w+:/},h=e.COMMENT(/'''/,/$/,{contains:[{className:"doctag",begin:/<\/?/,end:/>/}]}),d=e.COMMENT(null,/$/,{variants:[{begin:/'/},{begin:/([\t ]|^)REM(?=\s)/}]});return{name:"Visual Basic .NET",aliases:["vb"],case_insensitive:!0,classNameAliases:{label:"symbol"},keywords:{keyword:"addhandler alias aggregate ansi as async assembly auto binary by byref byval call case catch class compare const continue custom declare default delegate dim distinct do each equals else elseif end enum erase error event exit explicit finally for friend from function get global goto group handles if implements imports in inherits interface into iterator join key let lib loop me mid module mustinherit mustoverride mybase myclass namespace narrowing new next notinheritable notoverridable of off on operator option optional order overloads overridable overrides paramarray partial preserve private property protected public raiseevent readonly redim removehandler resume return select set shadows shared skip static step stop structure strict sub synclock take text then throw to try unicode until using when where while widening with withevents writeonly yield",built_in:"addressof and andalso await directcast gettype getxmlnamespace is isfalse isnot istrue like mod nameof new not or orelse trycast typeof xor cbool cbyte cchar cdate cdbl cdec cint clng cobj csbyte cshort csng cstr cuint culng cushort",type:"boolean byte char date decimal double integer long object sbyte short single string uinteger ulong ushort",literal:"true false nothing"},illegal:"//|\\{|\\}|endif|gosub|variant|wend|^\\$ ",contains:[i,n,l,c,u,h,d,{className:"meta",begin:/[\t ]*#(const|disable|else|elseif|enable|end|externalsource|if|region)\b/,end:/$/,keywords:{keyword:"const disable else elseif enable end externalsource if region then"},contains:[d]}]}}Gk.exports=mI});var jk=me((QU,Yk)=>{function gI(e){e.regex;let t=e.COMMENT(/\(;/,/;\)/);t.contains.push("self");let i=e.COMMENT(/;;/,/$/),n=["anyfunc","block","br","br_if","br_table","call","call_indirect","data","drop","elem","else","end","export","func","global.get","global.set","local.get","local.set","local.tee","get_global","get_local","global","if","import","local","loop","memory","memory.grow","memory.size","module","mut","nop","offset","param","result","return","select","set_global","set_local","start","table","tee_local","then","type","unreachable"],s={begin:[/(?:func|call|call_indirect)/,/\s+/,/\$[^\s)]+/],className:{1:"keyword",3:"title.function"}},r={className:"variable",begin:/\$[\w_]+/},a={match:/(\((?!;)|\))+/,className:"punctuation",relevance:0},o={className:"number",relevance:0,match:/[+-]?\b(?:\d(?:_?\d)*(?:\.\d(?:_?\d)*)?(?:[eE][+-]?\d(?:_?\d)*)?|0x[\da-fA-F](?:_?[\da-fA-F])*(?:\.[\da-fA-F](?:_?[\da-fA-D])*)?(?:[pP][+-]?\d(?:_?\d)*)?)\b|\binf\b|\bnan(?::0x[\da-fA-F](?:_?[\da-fA-D])*)?\b/},l={match:/(i32|i64|f32|f64)(?!\.)/,className:"type"},c={className:"keyword",match:/\b(f32|f64|i32|i64)(?:\.(?:abs|add|and|ceil|clz|const|convert_[su]\/i(?:32|64)|copysign|ctz|demote\/f64|div(?:_[su])?|eqz?|extend_[su]\/i32|floor|ge(?:_[su])?|gt(?:_[su])?|le(?:_[su])?|load(?:(?:8|16|32)_[su])?|lt(?:_[su])?|max|min|mul|nearest|neg?|or|popcnt|promote\/f32|reinterpret\/[fi](?:32|64)|rem_[su]|rot[lr]|shl|shr_[su]|store(?:8|16|32)?|sqrt|sub|trunc(?:_[su]\/f(?:32|64))?|wrap\/i64|xor))\b/};return{name:"WebAssembly",keywords:{$pattern:/[\w.]+/,keyword:n},contains:[i,t,{match:[/(?:offset|align)/,/\s*/,/=/],className:{1:"keyword",3:"operator"}},r,a,s,e.QUOTE_STRING_MODE,l,c,o]}}Yk.exports=gI});var Xk=me((JU,Vk)=>{var Ee=lC();Ee.registerLanguage("xml",uC());Ee.registerLanguage("bash",dC());Ee.registerLanguage("c",pC());Ee.registerLanguage("cpp",gC());Ee.registerLanguage("csharp",vC());Ee.registerLanguage("css",yC());Ee.registerLanguage("markdown",wC());Ee.registerLanguage("diff",xC());Ee.registerLanguage("ruby",kC());Ee.registerLanguage("go",NC());Ee.registerLanguage("graphql",MC());Ee.registerLanguage("ini",RC());Ee.registerLanguage("java",IC());Ee.registerLanguage("javascript",qC());Ee.registerLanguage("json",WC());Ee.registerLanguage("kotlin",$C());Ee.registerLanguage("less",XC());Ee.registerLanguage("lua",QC());Ee.registerLanguage("makefile",ek());Ee.registerLanguage("perl",ik());Ee.registerLanguage("objectivec",sk());Ee.registerLanguage("php",ak());Ee.registerLanguage("php-template",lk());Ee.registerLanguage("plaintext",uk());Ee.registerLanguage("python",dk());Ee.registerLanguage("python-repl",pk());Ee.registerLanguage("r",gk());Ee.registerLanguage("rust",vk());Ee.registerLanguage("scss",yk());Ee.registerLanguage("shell",wk());Ee.registerLanguage("sql",xk());Ee.registerLanguage("swift",Dk());Ee.registerLanguage("yaml",Bk());Ee.registerLanguage("typescript",Wk());Ee.registerLanguage("vbnet",$k());Ee.registerLanguage("wasm",jk());Ee.HighlightJS=Ee;Ee.default=Ee;Vk.exports=Ee});var Zk,Qd,Y_=ce(()=>{Zk=ae(Xk(),1),Qd=Zk.default});function vI(e){return _I(je.parse(e,{async:!1}))}function j_({text:e,streaming:t}){let i=(0,wl.useRef)(null),n=(0,wl.useMemo)(()=>vI(e),[e]);return(0,wl.useEffect)(()=>{let s=i.current;if(s){for(let r of s.querySelectorAll("a[href^='http']"))r.target="_blank",r.rel="noopener";for(let r of s.querySelectorAll("pre")){let a=r.querySelector("code");if(a&&!a.dataset.hl){a.dataset.hl="1";try{Qd.highlightElement(a)}catch{}}if(!r.querySelector(".cb-copy")){let o=document.createElement("button");o.className="cb-copy",o.textContent="\u590D\u5236",o.onclick=()=>{let l=a?.textContent??"";Ua(l).then(()=>{o.textContent="\u5DF2\u590D\u5236",setTimeout(()=>o.textContent="\u590D\u5236",1200)})},r.appendChild(o)}}}},[n]),(0,Qk.jsx)("div",{ref:i,className:`md${t?" streaming":""}`,dangerouslySetInnerHTML:{__html:n}})}async function Ua(e){try{await navigator.clipboard.writeText(e);return}catch{}try{let t=document.createElement("textarea");t.value=e,t.style.position="fixed",t.style.opacity="0",document.body.appendChild(t),t.select(),document.execCommand("copy"),t.remove()}catch{}}var wl,Qk,_I,Jd=ce(()=>{wl=ae(Mt(),1);bx();qx();Y_();Qk=ae(Le(),1);je.setOptions({gfm:!0,breaks:!0});_I=e=>Fx.sanitize(e,{USE_PROFILES:{html:!0},ADD_ATTR:["target","rel"]})});function bI(e){let[t,i]=(0,Ha.useState)(Date.now());return(0,Ha.useEffect)(()=>{if(!e)return;let n=setInterval(()=>i(Date.now()),1e3);return()=>clearInterval(n)},[e]),t}function Jk({pendingCount:e}){let{projects:t,threads:i}=lt(),n=fe(),{version:s}=ms(),[r,a]=(0,Ha.useState)(!1),[o,l]=(0,Ha.useState)(!1),[c,u]=(0,Ha.useState)(""),[h,d,f]=Hc(),p=i.find(C=>C.id===n.currentThreadId)??null,_=p?t.find(C=>C.id===p.projectId):t.find(C=>C.id===n.currentProjectId),v=p?.status==="running"||p?.status==="initializing",g=bI(v),m=v&&p?Math.max(0,g-p.updatedAt):0,b=p?e>0?{cls:"wait",text:w("topbar.waitAuth")}:v?{cls:"run",text:Te("topbar.running",{s:Math.floor(m/1e3)})}:p.status==="error"?{cls:"err",text:w("topbar.error")}:p.status==="closed"?{cls:"",text:w("topbar.closedResume")}:null:null,S=[{tab:"changes",icon:"changes",title:w("topbar.panelChanges")},{tab:"files",icon:"files",title:w("topbar.panelFiles")},{tab:"terminal",icon:"term",title:w("topbar.panelTerminal")}],x=p?[{kind:"item",label:w("common.rename"),onClick:()=>{u(p.title),a(!0)}},{kind:"item",label:w("topbar.threadInfo"),onClick:()=>l(!0)},{kind:"sep"},{kind:"item",label:w("common.settings"),onClick:()=>window.dispatchEvent(new CustomEvent("open-settings"))},{kind:"label",text:s?`v${s}`:""}]:[{kind:"item",label:w("common.settings"),onClick:()=>window.dispatchEvent(new CustomEvent("open-settings"))},{kind:"label",text:s?`v${s}`:""}];return(0,ct.jsxs)("header",{className:"topbar",children:[(0,ct.jsx)("button",{className:"ibtn tb-menu-btn",title:w("topbar.sidebar"),onClick:()=>n.setSbOpen(!n.sbOpen),children:(0,ct.jsx)(Me,{name:"menu"})}),_&&(0,ct.jsx)("span",{className:"tb-crumb",children:_.name}),_&&p&&(0,ct.jsx)("span",{className:"tb-sep",children:"/"}),p?r?(0,ct.jsx)("input",{className:"tb-rename",autoFocus:!0,value:c,onChange:C=>u(C.target.value),onBlur:()=>a(!1),onKeyDown:C=>{C.key==="Enter"&&!kn(C.nativeEvent)&&c.trim()?(te.call("threads.update",{id:p.id,title:c.trim()}),a(!1)):C.key==="Escape"&&a(!1)}}):(0,ct.jsx)("span",{className:"tb-title",title:w("topbar.clickRename"),onClick:()=>{u(p.title),a(!0)},children:Cd(p.title,p.titleAuto)}):(0,ct.jsx)("span",{className:"tb-title ghost",children:_?w("topbar.pickThread"):w("app.title")}),b&&(0,ct.jsx)("span",{className:`tb-pill ${b.cls}`,children:b.text}),(0,ct.jsxs)("div",{className:"tb-right",children:[p?.model&&(0,ct.jsx)("span",{className:"tb-model",children:p.model}),S.map(C=>(0,ct.jsx)("button",{className:`ibtn${n.panelOpen&&n.panelTab===C.tab?" on":""}`,title:C.title,onClick:()=>n.panelOpen&&n.panelTab===C.tab?n.closePanel():n.openPanel(C.tab),children:(0,ct.jsx)(Me,{name:C.icon})},C.tab)),(0,ct.jsx)("button",{className:"ibtn",title:w("common.more"),onClick:C=>d(C),children:(0,ct.jsx)(Me,{name:"dots"})})]}),h&&(0,ct.jsx)(Uc,{x:h.x,y:h.y,items:x,onClose:f}),o&&p&&(0,ct.jsx)(yI,{thread:p,project:_,onClose:()=>l(!1)})]})}function yI({thread:e,project:t,onClose:i}){let n=e.usage,s=xd(),r=[[w("thread.agent"),e.provider],[w("thread.model"),e.model??w("common.default")],[w("thread.mode"),e.mode],[w("thread.effort"),e.effort??w("common.default")],[w("thread.sessionId"),e.providerSessionId??w("thread.sessionNone")],[w("thread.tokens"),Te("thread.tokensFmt",{in:ul(n.inputTokens),out:ul(n.outputTokens),cache:ul(n.cacheReadTokens)})],[w("thread.cost"),n.costUsd>0?Md(n.costUsd):"\u2014"],[w("thread.created"),new Date(e.createdAt).toLocaleString(s)],[w("thread.workdir"),t?.path??"\u2014"]];e.importedFrom&&r.push([w("thread.importedFrom"),`${e.importedFrom.provider} / ${e.importedFrom.sessionId.slice(0,8)}\u2026`]);let a=new Set([w("thread.sessionId"),w("thread.workdir")]);return(0,ct.jsx)(gs,{title:w("thread.info"),onClose:i,children:(0,ct.jsx)("div",{className:"info-grid",children:r.map(([o,l])=>(0,ct.jsxs)("div",{className:"info-row",children:[(0,ct.jsx)("span",{className:"info-k",children:o}),(0,ct.jsx)("span",{className:"info-v",title:l,children:l}),a.has(o)&&l!=="\u2014"&&l!==w("thread.sessionNone")&&(0,ct.jsx)("button",{className:"ibtn",title:w("common.copy"),onClick:()=>{Ua(l),Pe(w("common.copied"))},children:(0,ct.jsx)(Me,{name:"copy",size:12})})]},o))})})}var Ha,ct,eT=ce(()=>{Ha=ae(Mt(),1);cl();qn();ln();Pc();Tn();Pr();f_();dl();Jd();_s();Od();wi();ct=ae(Le(),1)});function tT(e){return typeof e=="object"?e.key:e}function iT(e,t){let i=e.length;return new Proxy(e,{get(n,s,r){if(typeof s=="string"){let a=s.charCodeAt(0);if(a>=48&&a<=57){let o=+s;if(Number.isInteger(o)&&o>=0&&o<i){let l=n[o];if(typeof l!="object"){let c=t[o*2];l=n[o]={index:o,key:l,start:c,size:t[o*2+1],end:c+t[o*2+1],lane:0}}return l}}if(s==="length")return i}return Reflect.get(n,s,r)}})}var nT=ce(()=>{});function Fa(e,t,i){let n=i.initialDeps??[],s,r=!0;function a(){var o;let c=0,u=e();if(!(u.length!==n.length||u.some((f,p)=>n[p]!==f)))return s;n=u;let d=0;return s=t(...u),i?.onChange&&!(r&&i.skipInitialOnChange)&&i.onChange(s),r=!1,s}return a.updateDeps=o=>{n=o},a}function V_(e,t){if(e===void 0)throw new Error(`Unexpected undefined${t?`: ${t}`:""}`);return e}var js,sT,X_=ce(()=>{js=(e,t)=>Math.abs(e-t)<1.01,sT=(e,t,i)=>{let n;return Object.assign(function(...s){e.clearTimeout(n),n=e.setTimeout(()=>t.apply(this,s),i)},{cancel:()=>{e.clearTimeout(n)}})}});function rT({offset:e,isScrolling:t,elementMax:i,holdOffset:n,scrollOffset:s,pendingWrite:r,clampedMaxAtWrite:a}){var o;return t&&r===null&&e===s?"spurious":r!==null&&Math.abs(e-r.target)<1.5?"readBack":r!==null&&!r.smooth&&i!==null&&r.target>i+n+.5&&Math.abs(e-(i+n))<1.5||r!==null&&!r.smooth&&((o=r.lowMaxes)!=null&&o.some(l=>Math.abs(e-l)<1.5))?"clampedReadBack":a!==null&&Math.abs(e-a)<1.5?"clampedEcho":"external"}function aT({kind:e,offset:t,command:i,target:n}){return e!=="spurious"&&e!=="readBack"&&e!=="clampedReadBack"&&i?.index!=null&&i.phase!=="queued"&&!SI(i.phase)&&!js(t,i.lastTargetOffset)&&!js(t,n())&&e!=="clampedEcho"}function oT(e){let t=e[e.length-1];if(t===void 0)return!1;let i=e.length-2;for(;i>=0&&t.t-e[i].t<Z_;)i--;if(i<0)return!1;let n=e[i],s=i-1;for(;s>=0&&n.t-e[s].t<Z_;)s--;if(s<0)return!1;let r=e[s],a=(t.offset-n.offset)/(t.t-n.t),o=(n.offset-r.offset)/(n.t-r.t);return a*o>=0&&Math.abs(a)>=2*Math.abs(o)&&Math.abs(a)-Math.abs(o)>=.8}function lT(e){let t=e[e.length-1];if(t===void 0)return!1;let i=e.length-2;for(;i>=0&&t.t-e[i].t<Z_;)i--;if(i<0)return!1;let n=e[i];return Math.abs(t.offset-n.offset)/(t.t-n.t)>=.05}var SI,Z_,cT=ce(()=>{X_();SI=e=>e==="smooth"||e==="smoothFinishing";Z_=40});var Jc,eu,Q_,wI,uT,El,ef,hT=ce(()=>{eu=()=>{if(Jc!==void 0)return Jc;if(typeof navigator>"u")return Jc=!1;if(/iP(hone|od|ad)/.test(navigator.userAgent))return Jc=!0;let e=navigator.maxTouchPoints;return Jc=navigator.platform==="MacIntel"&&e!==void 0&&e>0},wI=()=>Q_!==void 0?Q_:Q_=eu()&&typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("overflow-anchor: auto"),uT=()=>!eu()||wI(),El={capture:!0,passive:!0},ef=class{constructor(t){this.host=t,this._touch=null,this.inMotion=()=>this._touch!==null&&this._touch.phase!=="lateFling",this.dragging=()=>{var i;return((i=this._touch)==null?void 0:i.phase)==="down"&&this._touch.moved},this.tail=()=>{var i;return((i=this._touch)==null?void 0:i.phase)==="tail"?this._touch.moved?"fling":"tap":null},this.onScroll=({isScrolling:i,ownReadBack:n,moved:s,external:r})=>{var a,o,l;return i&&((a=this._touch)==null?void 0:a.phase)==="tail"?this._openTail(this._touch.moved||!n,!1):((o=this._touch)==null?void 0:o.phase)==="lateFling"&&(this.host.now()>this._touch.until?this._touch=null:r&&i&&s&&this._openTail(!0,!1)),!n&&i&&s&&((l=this._touch)==null?void 0:l.phase)==="down"?(this._touch.moved=!0,!0):!1},this.touchStart=()=>{this.end(),this._touch={phase:"down",moved:!1}},this.touchEnd=()=>{var i;let n=((i=this._touch)==null?void 0:i.phase)==="down"&&this._touch.moved;this.end(),this._openTail(n,n)},this.end=()=>{var i;let n=this.host.getWindow();((i=this._touch)==null?void 0:i.phase)==="tail"&&n!=null&&n.clearTimeout(this._touch.timerId),this._touch=null},this.listen=i=>{let n=()=>this.touchStart(),s=()=>this.touchEnd();return i.addEventListener("touchstart",n,El),i.addEventListener("touchend",s,El),i.addEventListener("touchcancel",s,El),()=>{i.removeEventListener("touchstart",n,El),i.removeEventListener("touchend",s,El),i.removeEventListener("touchcancel",s,El),this.end()}},this._openTail=(i,n)=>{let s=this.host.getWindow();if(s==null)return;this.end();let r={phase:"tail",moved:i,awaitingFling:n,timerId:s.setTimeout(()=>{if(this.host.tailStillMoving()){this._openTail(r.moved,r.awaitingFling);return}this._touch=r.awaitingFling?{phase:"lateFling",until:this.host.now()+1e3}:null,this.host.onTailClosed()},150)};this._touch=r}}get touch(){return this._touch}}});function AI(e,t,i,n){if(t===0)return!1;let s=n(0),r=new Set,a=0;for(;a<e;){let l=i(a);if(l===s)break;r.add(l),a++}let o=e-a;if(o===0||o>=t)return!1;for(let l=0;l<o;l++)if(n(l)!==i(a+l))return!1;for(let l=o;l<t;l++)if(r.has(n(l)))return!1;return!0}function MI(e,t,i){let n=0;for(;n<=t;){let s=(n+t)/2|0,r=e[s*2];if(r<i)n=s+1;else if(r>i)t=s-1;else return s}return n>0?n-1:0}function OI(e,t,i,n,s){let r=e.length-1;if(e.length<=n)return{startIndex:0,endIndex:r};if(n===1&&s!==null){let c=MI(s,r,i),u=c,h=i+t;for(;u<r&&s[u*2]+s[u*2+1]<h;)u++;return{startIndex:c,endIndex:u}}let o=bT(0,r,c=>e[c].start,i),l=o;if(n===1)for(;l<r&&e[l].end<i+t;)l++;else if(n>1){let c=Array(n).fill(0);for(;l<r&&c.some(h=>h<i+t);){let h=e[l];c[h.lane]=h.end,l++}let u=Array(n).fill(i+t);for(;o>=0&&u.some(h=>h>=i);){let h=e[o];u[h.lane]=h.start,o--}o=Math.max(0,o-o%n),l=Math.min(r,l+(n-1-l%n))}return{startIndex:o,endIndex:l}}var dT,mT,EI,xI,gT,fT,CI,kI,_T,TI,NI,vT,pT,tu,tf,bT,J_=ce(()=>{nT();X_();cT();hT();dT=e=>{let{clientWidth:t,clientHeight:i}=e;return{width:t,height:i}},mT=e=>{let t=new Set;return{schedule:i=>{let n=e.requestAnimationFrame(()=>{t.delete(n),i()});t.add(n)},cancel:()=>{t.forEach(i=>e.cancelAnimationFrame(i)),t.clear()}}},EI=e=>e,xI=e=>{let t=e.overscan*Math.max(e.lanes??1,1),i=Math.max(e.startIndex-t,0),s=Math.min(e.endIndex+t,e.count-1)-i+1,r=new Array(s);for(let a=0;a<s;a++)r[a]=i+a;return r},gT=(e,t)=>{let i=e.scrollElement;if(!i)return;let n=e.targetWindow;if(!n)return;let s=o=>{let{width:l,height:c}=o;t({width:Math.round(l),height:Math.round(c)})};if(s(dT(i)),!n.ResizeObserver)return()=>{};let r=mT(n),a=new n.ResizeObserver(()=>{let o=()=>{s(dT(i))};e.options.useAnimationFrameWithResizeObserver?r.schedule(o):o()});return a.observe(i,{box:"content-box"}),()=>{a.unobserve(i),r.cancel()}},fT={passive:!0},CI=typeof window>"u"?!0:"onscrollend"in window,kI=(e,t,i)=>{let n=e.scrollElement;if(!n)return;let s=e.targetWindow;if(!s)return;let r=e.options.useScrollendEvent&&CI,a=0,o=r?null:sT(s,()=>t(i(n),!1),e.options.isScrollingResetDelay),l=h=>()=>{a=i(n),o?.(),t(a,h)},c=l(!0),u=l(!1);return n.addEventListener("scroll",c,fT),r&&n.addEventListener("scrollend",u,fT),()=>{n.removeEventListener("scroll",c),r&&n.removeEventListener("scrollend",u),o?.cancel()}},_T=(e,t)=>kI(e,t,i=>{let{horizontal:n,isRtl:s}=e.options;return n?i.scrollLeft*(s&&-1||1):i.scrollTop}),TI=(e,t,i)=>{if(i.options.useCachedMeasurements){let n=i.indexFromElement(e),s=i.options.getItemKey(n);return i.itemSizeCache.get(s)??i.options.estimateSize(n)}if(t?.borderBoxSize){let n=t.borderBoxSize[0];if(n)return Math.round(n[i.options.horizontal?"inlineSize":"blockSize"])}if(!t){let n=i.indexFromElement(e),s=i.options.getItemKey(n),r=i.itemSizeCache.get(s);if(r!==void 0)return r}return e[i.options.horizontal?"offsetWidth":"offsetHeight"]},NI=(e,{adjustments:t=0,behavior:i},n)=>{var s,r;(r=(s=n.scrollElement)==null?void 0:s.scrollTo)==null||r.call(s,{[n.options.horizontal?"left":"top"]:e+t,behavior:i})},vT=NI,pT=(e,t)=>e==="smooth"?t?"smoothLanded":"smooth":"instant",tu=e=>e?.phase==="smooth"||e?.phase==="smoothLanded";tf=class{constructor(t){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.scrollState=null,this.measurementsCache=[],this._singleLaneMeasurements=null,this.itemSizeCache=new Map,this.itemSizeCacheVersion=0,this.laneAssignments=new Map,this.pendingMin=null,this.prevLanes=void 0,this.lanesChangedFlag=!1,this.lanesSettling=!1,this.pendingScrollAnchor=null,this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this._holdOffset=0,this._reportedOverscroll=!1,this._iosGesture=new ef({getWindow:()=>this.targetWindow,now:()=>this.now(),tailStillMoving:()=>{let i=this.scrollState;if(i?.phase!=="queued"||this.pendingWrite!==null)return!1;let n=this._readElementOffset();return n===null||this._lastElementOffset===null||Math.abs(n-this._lastElementOffset)<1?!1:(this._lastElementOffset=n,i.samples=[...i.samples??[],{t:this.now(),offset:n}],!0)},onTailClosed:()=>{let i=this.scrollState;i?.phase==="queued"&&lT(i.samples??[])&&(this.scrollState=null),this._flushHoldIfReady(!0),this._writeAwaitingCommand(),this._retryClampedAdjustment()}}),this._lastElementOffset=null,this.pendingWrite=null,this._clampedAdjustment=null,this.elementsCache=new Map,this._resizeBatch=null,this.now=()=>{var i,n,s;return((s=(n=(i=this.targetWindow)==null?void 0:i.performance)==null?void 0:n.now)==null?void 0:s.call(n))??Date.now()},this.observer=(()=>{let i=null,n=null,s=!1,r=!1,a=new Set,o=()=>{if(i)return i;let c=this.targetWindow;if(!c||!c.ResizeObserver)return null;let u=n=mT(c);return i=new c.ResizeObserver(h=>{let d=()=>{let f={sync:!1};this._resizeBatch=f;try{h.forEach(l)}finally{this._resizeBatch=null,f.notify&&(this.notify(f.sync),this._noteClampMax(),this._flushHoldIfReady(!0),this._retryClampedAdjustment(),this.measureElement(null))}};if(this.options.useAnimationFrameWithResizeObserver)u.schedule(d);else{s=!0;try{d()}finally{s=!1}}})},l=c=>{let u=c.target,h=this.indexFromElement(u);if(!u.isConnected){this.observer.unobserve(u);for(let[d,f]of this.elementsCache)if(f===u){this.elementsCache.delete(d);break}return}this.isIndexInRange(h)&&this.shouldMeasureDuringScroll(h)&&this.resizeItem(h,this.options.measureElement(u,c,this))};return{disconnect:()=>{var c;(c=o())==null||c.disconnect(),n?.cancel(),a.clear(),r=!1,i=null,n=null},observe:c=>{let u=o();if(u){if(!s){u.observe(c,{box:"border-box"});return}a.add(c),r||(r=!0,n?.schedule(()=>{r=!1,a.forEach(h=>{h.isConnected&&i?.observe(h,{box:"border-box"})}),a.clear()}))}},unobserve:c=>{var u;a.delete(c),(u=o())==null||u.unobserve(c)}}})(),this.range=null,this.setOptions=i=>{var n;let s={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:EI,rangeExtractor:xI,onChange:()=>{},measureElement:TI,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1,anchorTo:"start",followOnAppend:!1,scrollEndThreshold:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!1,useAnimationFrameWithResizeObserver:!1,laneAssignmentMode:"estimate",useCachedMeasurements:!1};for(let u in i){let h=i[u];h!==void 0&&(s[u]=h)}let r=this.options,a=null,o=null,l=!1;if(r!==void 0&&r.enabled&&s.enabled&&s.anchorTo==="end"&&this.scrollElement!==null){let u=r.count,h=s.count,d=this.getMeasurements(),f=((n=this._singleLaneMeasurements)==null?void 0:n.items)??d,p=b=>tT(f[b]),_=u>0?p(0):null,v=u>0?p(u-1):null;if(h!==u||u>0&&h>0&&(s.getItemKey(0)!==_||s.getItemKey(h-1)!==v)){l=!0;let b=u>0?this.getVirtualItemForOffset(this.getScrollOffset())??d[0]:null;b&&(a=[b.key,this.getScrollOffset()-b.start]);let S=s.followOnAppend===!0?"auto":s.followOnAppend||null;S&&h>0&&this.isAtEnd(r.scrollEndThreshold)&&(u===0||s.getItemKey(h-1)!==v)&&(h>u||AI(u,h,p,s.getItemKey))&&(o=S)}}this.options=s,l&&(this.pendingMin=0,this.itemSizeCacheVersion++);let c=null;if(a&&this.scrollOffset!==null&&!this._awaitingCommandReadBack()){let[u,h]=a,d=this.getMeasurements(),{count:f,getItemKey:p}=this.options,_=0;for(;_<f&&p(_)!==u;)_++;if(_<f){let v=d[_];if(v){let g=Math.max(0,v.start+h);!o&&g!==this.scrollOffset&&(c=g-this.scrollOffset,this.scrollOffset=g)}}}o?this.pendingScrollAnchor={kind:"follow",behavior:o}:c!==null&&(this._canWriteScroll()?this.pendingScrollAnchor={kind:"anchor",delta:c}:(this._holdOffset+=c,this._followOffsetTarget(c)))},this.notify=i=>{var n,s;(s=(n=this.options).onChange)==null||s.call(n,this,i)},this.maybeNotify=Fa(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),i=>{this.notify(i)},{key:!1,debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{var i;this.unsubs.filter(Boolean).forEach(n=>n()),this.unsubs=[],this.observer.disconnect(),this.rafId!=null&&this.targetWindow&&(this.targetWindow.cancelAnimationFrame(this.rafId),this.rafId=null),this.scrollState=null,(i=this._momentumStop)==null||i.restore(),this._momentumStop=null,this.isScrolling=!1,this.scrollDirection=null,this._holdOffset=0,this._reportedOverscroll=!1,this._clampedAdjustment=null,this.pendingWrite=null,this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{var i;let n=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==n){if(this.cleanup(),!n){this.maybeNotify();return}this.scrollElement=n,this.scrollElement&&"ownerDocument"in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=((i=this.scrollElement)==null?void 0:i.window)??null,this.elementsCache.forEach(r=>{this.observer.observe(r)}),this.unsubs.push(this.options.observeElementRect(this,r=>{this.scrollRect=r,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(r,a)=>{var o,l,c,u;let h=a?this._elementMaxScrollOffset():null,d=this._reportedOverscroll;this._reportedOverscroll=r<0||h!==null&&r>h+1;let f=r;this._lastElementOffset=f,r=this._toLayoutOffset(r);let p=this._classifyScrollEvent(r,a,h);if(p==="spurious")return;p==="readBack"?r=this.pendingWrite.target:p==="clampedReadBack"&&((o=this.scrollState)==null?void 0:o.index)!=null&&r<this.getMaxScrollOffset()-1.5?this.scrollState.lastTargetOffset=r:aT({kind:p,offset:r,command:this.scrollState,target:()=>this.getScrollStateTarget(this.scrollState)})&&(this.scrollState=null),this.pendingWrite=null,this._clampedAdjustment!==null&&Math.abs(r-this._clampedAdjustment.maxAtWrite)>=1.5&&(this._clampedAdjustment=null);let _=this.getScrollOffset(),v=this.scrollDirection;this.scrollDirection=a?_===r?this.scrollDirection:_<r?"forward":"backward":null,this.scrollOffset=r,this.isScrolling=a;let g=this.scrollState;if(g?.phase==="queued"&&p==="external"&&a)if(d||this._reportedOverscroll)g.samples=[];else{let m=this.now();g.samples=[...(g.samples??[]).filter(b=>m-b.t<=200),{t:m,offset:f}],(v!==null&&this.scrollDirection!==v||oT(g.samples))&&(this.scrollState=null)}this._iosGesture.onScroll({isScrolling:a,ownReadBack:p==="readBack",moved:r!==_,external:p==="external"&&((l=this.scrollState)==null?void 0:l.phase)!=="smooth"&&((c=this.scrollState)==null?void 0:c.phase)!=="smoothFinishing"})&&((u=this.scrollState)==null?void 0:u.phase)==="queued"&&(this.scrollState=null),this._flushHoldIfReady(!0),this.scrollState&&this.scheduleScrollReconcile(),this.maybeNotify()})),"addEventListener"in this.scrollElement&&this.unsubs.push(this._iosGesture.listen(this.scrollElement)),this._scrollToOffset(this.getScrollOffset())}this._noteClampMax();let s=this.pendingScrollAnchor;this.pendingScrollAnchor=null,s&&this.scrollElement&&this.options.enabled&&(s.kind==="anchor"?this._canWriteScroll()?tu(this.scrollState)&&!js(this.getScrollOffset()-s.delta,this.scrollState.lastTargetOffset)||(this._followOffsetTarget(s.delta),this._scrollToOffset(this.getScrollOffset())):(this._holdOffset+=s.delta,this._followOffsetTarget(s.delta),this.notify(!1)):this.scrollToEnd({behavior:s.behavior})),this._flushHoldIfReady(!1),this._retryClampedAdjustment()},this._classifyScrollEvent=(i,n,s)=>{var r;return rT({offset:i,isScrolling:n,elementMax:s,holdOffset:this._holdOffset,scrollOffset:this.scrollOffset,pendingWrite:this.pendingWrite,clampedMaxAtWrite:((r=this._clampedAdjustment)==null?void 0:r.maxAtWrite)??null})},this._retryClampedAdjustment=()=>{if(this._clampedAdjustment===null||!this.scrollElement||!this.options.enabled||!this._canWriteScroll())return;let{target:i,maxAtWrite:n}=this._clampedAdjustment,s=this.getMaxScrollOffset();s>n+.5&&(this._clampedAdjustment=i>s+.5?{target:i,maxAtWrite:s}:null,this._scrollToOffset(i))},this._writeAwaitingCommand=()=>{let i=this.scrollState;if(i===null||i.phase!=="queued")return;let{behavior:n}=i;this.getMeasurements();let s=this.getScrollStateTarget(i);i.lastTargetOffset=s,this._clampedAdjustment=null,i.phase=pT(n,i.index!=null&&js(s,this.getScrollOffset())),this._scrollToOffset(s,{behavior:n}),this.scheduleScrollReconcile()},this._readElementOffset=()=>{let i=this.scrollElement;if(i==null)return null;let{horizontal:n,isRtl:s}=this.options;return typeof i.scrollTop=="number"?n?i.scrollLeft*(s&&-1||1):i.scrollTop:typeof i.scrollY=="number"?n?i.scrollX:i.scrollY:null},this._canWriteScroll=()=>!(eu()&&this._iosGesture.inMotion())&&!this._reportedOverscroll,this._flushHoldIfReady=i=>{var n;if(this._holdOffset===0||!this.scrollElement||!this.options.enabled||!this._canWriteScroll()||((n=this.scrollState)==null?void 0:n.phase)==="smooth")return;this._holdOffset=0,this.scrollOffset!==null&&this.scrollOffset<0&&(this.scrollOffset=0),this.notify(i);let s=this.getCommandWrittenOffset()??this.getScrollOffset();this._clampedAdjustment=this._clampedBy(s),this._scrollToOffset(s)},this.rafId=null,this.getSize=()=>this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?"width":"height"]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??(typeof this.options.initialOffset=="function"?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getMeasurementOptions=Fa(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled,this.options.lanes,this.options.laneAssignmentMode,this.options.gap],(i,n,s,r,a,o,l,c)=>(this.prevLanes!==void 0&&this.prevLanes!==o&&(this.lanesChangedFlag=!0),this.prevLanes=o,this.pendingMin=null,{count:i,paddingStart:n,scrollMargin:s,getItemKey:r,enabled:a,lanes:o,laneAssignmentMode:l,gap:c}),{key:!1}),this.isIndexInRange=i=>i>=0&&i<this.options.count,this.getMeasurements=Fa(()=>[this.getMeasurementOptions(),this.itemSizeCacheVersion],({count:i,paddingStart:n,scrollMargin:s,getItemKey:r,enabled:a,lanes:o,laneAssignmentMode:l,gap:c},u)=>{var h;let d=this.itemSizeCache;if(!a)return this.measurementsCache=[],this._singleLaneMeasurements=null,this.itemSizeCache.clear(),this.laneAssignments.clear(),[];if(this.laneAssignments.size>i)for(let m of this.laneAssignments.keys())m>=i&&this.laneAssignments.delete(m);this.lanesChangedFlag&&(this.lanesChangedFlag=!1,this.lanesSettling=!0,this.measurementsCache=[],this._singleLaneMeasurements=null,this.itemSizeCache.clear(),this.laneAssignments.clear(),this.pendingMin=null),this.measurementsCache.length===0&&!this.lanesSettling&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(m=>{this.itemSizeCache.set(m.key,m.size)}));let f=this.lanesSettling?0:this.pendingMin??0;if(this.pendingMin=null,this.lanesSettling&&this.measurementsCache.length===i&&(this.lanesSettling=!1),o===1){let m=i*2,b=(h=this._singleLaneMeasurements)==null?void 0:h.flat;if(!b||b.length<m){let N=new Float64Array(m);b&&f>0&&N.set(b.subarray(0,f*2)),b=N}let S=f===0?new Array(i):this._singleLaneMeasurements.items.slice(),x;if(f===0)x=n+s;else{let N=f-1;x=b[N*2]+b[N*2+1]+c}for(let N=f;N<i;N++){let M=r(N);S[N]=M;let O=d.get(M),q=typeof O=="number"?O:this.options.estimateSize(N);b[N*2]=x,b[N*2+1]=q,x+=q+c}this._singleLaneMeasurements={flat:b,items:S};let C=iT(S,b);return this.measurementsCache=C,C}let p=this.measurementsCache.slice(0,f),_=new Array(o).fill(void 0),v=new Float64Array(o),g=0;for(let m=0;m<f;m++){let b=p[m];b&&(_[b.lane]===void 0&&g++,_[b.lane]=m,v[b.lane]=b.end)}for(let m=f;m<i;m++){let b=r(m),S=this.laneAssignments.get(m),x,C,N=l==="estimate"||d.has(b);if(S!==void 0&&this.options.lanes>1){x=S;let G=_[x],I=G!==void 0?p[G]:void 0;C=I?I.end+c:n+s}else if(g===o){let G=0,I=v[0],P=_[0];for(let R=1;R<o;R++){let K=v[R];(K<I||K===I&&_[R]<P)&&(G=R,I=K,P=_[R])}x=G,C=I+c,N&&this.laneAssignments.set(m,x)}else x=m%this.options.lanes,C=n+s,N&&this.laneAssignments.set(m,x);let M=d.get(b),O=typeof M=="number"?M:this.options.estimateSize(m),q=C+O;p[m]={index:m,start:C,size:O,end:q,key:b,lane:x},_[x]===void 0&&g++,_[x]=m,v[x]=q}return this.measurementsCache=p,p},{key:!1,debug:()=>this.options.debug}),this.calculateRange=Fa(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(i,n,s,r)=>i.length===0||n===0?(this.range=null,null):(this.range=OI(i,n,s,r,r===1&&this._singleLaneMeasurements!==null?this._singleLaneMeasurements.flat:null),this.range),{key:!1,debug:()=>this.options.debug}),this.getVirtualIndexes=Fa(()=>{let i=null,n=null,s=this.calculateRange();return s&&(i=s.startIndex,n=s.endIndex),this.maybeNotify.updateDeps([this.isScrolling,i,n]),[this.options.rangeExtractor,this.options.overscan,this.options.count,i,n,this.options.lanes]},(i,n,s,r,a,o)=>r===null||a===null?[]:i({startIndex:r,endIndex:a,overscan:n,count:s,lanes:o}),{key:!1,debug:()=>this.options.debug}),this.indexFromElement=i=>{let n=this.options.indexAttribute,s=i.getAttribute(n);return s?parseInt(s,10):(console.warn(`Missing attribute name '${n}={index}' on measured element.`),-1)},this.shouldMeasureDuringScroll=i=>{var n;if(!tu(this.scrollState))return!0;let s=this.scrollState.index??((n=this.getVirtualItemForOffset(this.scrollState.lastTargetOffset))==null?void 0:n.index);if(s!==void 0&&this.range){let r=Math.max(this.options.overscan,Math.ceil((this.range.endIndex-this.range.startIndex)/2)),a=Math.max(0,s-r),o=Math.min(this.options.count-1,s+r);return i>=a&&i<=o}return!0},this.measureElement=i=>{if(!i){this.elementsCache.forEach((a,o)=>{a.isConnected||(this.observer.unobserve(a),this.elementsCache.delete(o))});return}let n=this.indexFromElement(i);if(!this.isIndexInRange(n))return;let s=this.options.getItemKey(n),r=this.elementsCache.get(s);r!==i&&(r&&this.observer.unobserve(r),this.observer.observe(i),this.elementsCache.set(s,i)),i.isConnected&&(!this.isScrolling||this.scrollState)&&this.shouldMeasureDuringScroll(n)&&this.resizeItem(n,this.options.measureElement(i,void 0,this))},this.resizeItem=(i,n)=>{var s,r,a;if(!this.isIndexInRange(i))return;(s=this._resizeBatch)!=null&&s.sync&&this.getMeasurements();let o,l,c,u=(r=this._singleLaneMeasurements)==null?void 0:r.flat;if(this.options.lanes===1&&u!=null)c=this.options.getItemKey(i),l=u[i*2],o=u[i*2+1];else{let f=this.measurementsCache[i];if(!f)return;c=f.key,l=f.start,o=f.size}let h=this.itemSizeCache.get(c)??o,d=n-h;if(d!==0){let f=this.options.anchorTo==="end"&&!tu(this.scrollState)&&this.getVirtualDistanceFromEnd()<=this.options.scrollEndThreshold,p=f?this._getLayoutTotalSize():0,_=this.getScrollOffset(),g=!this.itemSizeCache.has(c)?l<_:l+h<=_&&this.scrollDirection!=="backward",m=!tu(this.scrollState)&&(this.shouldAdjustScrollPositionOnItemSizeChange!==void 0?this.shouldAdjustScrollPositionOnItemSizeChange(this.measurementsCache[i]??{index:i,key:c,start:l,size:o,end:l+o,lane:0},d,this):g);(this.pendingMin===null||i<this.pendingMin)&&(this.pendingMin=i),this.itemSizeCache.set(c,n),this.itemSizeCacheVersion++;let b=!1;if(this._awaitingCommandReadBack()||(f?b=this.applyScrollAdjustment(this._getLayoutTotalSize()-p):m&&(b=this.applyScrollAdjustment(d))),this._resizeBatch){this._resizeBatch.notify=!0,(a=this._resizeBatch).sync||(a.sync=b);return}this.notify(b),this._noteClampMax(),this._flushHoldIfReady(!0),this._retryClampedAdjustment()}},this.getVirtualItems=Fa(()=>[this.getVirtualIndexes(),this.getMeasurements(),this._holdOffset],(i,n,s)=>{let r=[];for(let a=0,o=i.length;a<o;a++){let l=i[a],c=n[l];r.push(s===0?c:{...c,start:c.start-s,end:c.end-s})}return r},{key:!1,debug:()=>this.options.debug}),this.getVirtualItemForOffset=i=>{var n;let s=this.getMeasurements();if(s.length===0)return;let r=(n=this._singleLaneMeasurements)==null?void 0:n.flat,a=this.options.lanes===1&&r!=null,o=bT(0,s.length-1,a?l=>r[l*2]:l=>V_(s[l]).start,i);return V_(s[o])},this._noteClampMax=()=>{if(!this._awaitingCommandReadBack())return;let i=this._elementMaxScrollOffset();if(i===null)return;let n=this.pendingWrite,s=Math.max(i,0)+this._holdOffset;if(s>=n.target)return;let r=n.lowMaxes??(n.lowMaxes=[]);r[r.length-1]!==s&&r.push(s)},this.getMaxScrollOffset=()=>(this._elementMaxScrollOffset()??0)+this._holdOffset,this._toLayoutOffset=i=>{var n;let s=i+this._holdOffset;return((n=this.pendingScrollAnchor)==null?void 0:n.kind)==="anchor"&&(s+=this.pendingScrollAnchor.delta),s},this._elementMaxScrollOffset=()=>{let i=this.scrollElement;if(i===null)return null;if("scrollHeight"in i)return this.options.horizontal?i.scrollWidth-i.clientWidth:i.scrollHeight-i.clientHeight;if("document"in i){let n=i.document.documentElement;return this.options.horizontal?n.scrollWidth-i.innerWidth:n.scrollHeight-i.innerHeight}return null},this._momentumStop=null,this._stopMomentum=i=>{let n=this.scrollElement,s=this.targetWindow;if(n===null||s===null)return;let r="document"in n?n.document.scrollingElement:n;if(!r?.style)return;if(this._momentumStop){this._momentumStop.done=i;return}let{style:a}=r,o=this.options.horizontal?"overflow-x":"overflow-y",l=a.getPropertyValue(o),c=a.getPropertyPriority(o),u=()=>this.options.horizontal?r.clientHeight:r.clientWidth,h=u();if(a.setProperty(o,"hidden","important"),u()!==h){a.setProperty(o,l,c);return}let d={restore:()=>a.getPropertyValue(o)!=="hidden"||a.getPropertyPriority(o)!=="important"?!1:(a.setProperty(o,l,c),!0),done:i};this._momentumStop=d,s.requestAnimationFrame(()=>s.requestAnimationFrame(()=>{this._momentumStop===d&&(this._momentumStop=null,d.restore()&&d.done())}))},this._clampedBy=i=>{let n=this._elementMaxScrollOffset();if(n===null)return null;let s=n+this._holdOffset;return i>s+.5?{target:i,maxAtWrite:s}:null},this.getVirtualDistanceFromEnd=()=>Math.max(this._getLayoutTotalSize()+this.options.scrollMargin-this.getSize()-this.getScrollOffset(),0),this.getDistanceFromEnd=()=>Math.max(this.getMaxScrollOffset()-this.getScrollOffset(),0),this.isAtEnd=(i=this.options.scrollEndThreshold)=>this.getDistanceFromEnd()<=i,this.getOffsetForAlignment=(i,n,s=0)=>{if(!this.scrollElement)return 0;let r=this.getSize(),a=this.getScrollOffset();n==="auto"&&(n=i>=a+r?"end":"start"),n==="center"?i+=(s-r)/2:n==="end"&&(i-=r);let o=this.getMaxScrollOffset();return Math.max(Math.min(o,i),0)},this.getOffsetForIndex=(i,n="auto")=>{i=Math.max(0,Math.min(i,this.options.count-1));let s=this.getSize(),r=this.getScrollOffset(),a=this.measurementsCache[i];if(!a)return;if(n==="auto")if(a.end>=r+s-this.options.scrollPaddingEnd)n="end";else if(a.start<=r+this.options.scrollPaddingStart)n="start";else return[r,n];if(n==="end"&&i===this.options.count-1){let l=this.getMaxScrollOffset(),c=l-this.options.paddingEnd+this.options.scrollPaddingEnd;return[Math.max(Math.min(c,l),0),n]}let o=n==="end"?a.end+this.options.scrollPaddingEnd:a.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(o,n,a.size),n]},this.scrollToOffset=(i,{align:n="start",behavior:s="auto"}={})=>{this._startScroll({index:null,align:n},this.getOffsetForAlignment(i,n),s,"absolute")},this.scrollToIndex=(i,{align:n="auto",behavior:s="auto"}={})=>{i=Math.max(0,Math.min(i,this.options.count-1));let r=this.getOffsetForIndex(i,n);if(!r)return;let[a,o]=r;this._startScroll({index:i,align:o},a,s,"absolute")},this.scrollBy=(i,{behavior:n="auto"}={})=>{let s=this.getOffsetForAlignment((this.getCommandWrittenOffset()??this.getScrollOffset())+i,"start");this._startScroll({index:null,align:"start"},s,n,"relative")},this.scrollToEnd=({behavior:i="auto"}={})=>{if(this.options.count>0){this._startScroll({index:this.options.count-1,align:"end",toEnd:!0},Math.max(this.getMaxScrollOffset(),0),i,"absolute");return}this.scrollToOffset(Math.max(this.getTotalSize()-this.getSize(),0),{behavior:i})},this.cancelScroll=()=>{this.rafId!=null&&this.targetWindow&&(this.targetWindow.cancelAnimationFrame(this.rafId),this.rafId=null),this.scrollState=null},this.getTotalSize=()=>Math.max(this._getLayoutTotalSize()-this._holdOffset,0),this._getLayoutTotalSize=()=>{var i,n;let s=this.getMeasurements(),r;if(s.length===0)r=this.options.paddingStart;else if(this.options.lanes===1){let a=s.length-1,o=(i=this._singleLaneMeasurements)==null?void 0:i.flat;o!=null?r=o[a*2]+o[a*2+1]:r=((n=s[a])==null?void 0:n.end)??0}else{let a=Array(this.options.lanes).fill(null),o=s.length-1;for(;o>=0&&a.some(l=>l===null);){let l=s[o];a[l.lane]===null&&(a[l.lane]=l.end),o--}r=Math.max(...a.filter(l=>l!==null))}return Math.max(r-this.options.scrollMargin+this.options.paddingEnd,0)},this.takeSnapshot=()=>{let i=[];if(this.itemSizeCache.size===0)return i;let n=this.getMeasurements();for(let s of n)s&&this.itemSizeCache.has(s.key)&&i.push({index:s.index,key:s.key,start:s.start,size:s.size,end:s.end,lane:s.lane});return i},this._scrollToOffset=(i,{adjustments:n,behavior:s}={})=>{let r={target:i+(n??0),smooth:s==="smooth"};return this.pendingWrite=r,this.options.scrollToFn(i-this._holdOffset,{behavior:s,adjustments:n},this),r},this.getCommandWrittenOffset=()=>this.scrollState!==null&&this.pendingWrite!==null&&!this.pendingWrite.smooth?this.pendingWrite.target:null,this._awaitingCommandReadBack=()=>{let i=this.getCommandWrittenOffset();return!(eu()&&this._iosGesture.dragging())&&i!==null&&!js(i,this.getScrollOffset())},this._followOffsetTarget=i=>{this.scrollState!==null&&this.scrollState.index==null&&(this.scrollState.lastTargetOffset+=i)},this.measure=()=>{this.pendingMin=null,this.itemSizeCache.clear(),this.laneAssignments.clear(),this.itemSizeCacheVersion++,this.notify(!1)},this.setOptions(t)}get scrollAdjustments(){return 0}applyScrollAdjustment(t,i){if(t===0)return!1;if(this._followOffsetTarget(t),this._canWriteScroll()){let n=this.getScrollOffset();this._clampedAdjustment=this._clampedBy(n+t);let s=this._scrollToOffset(n,{adjustments:t,behavior:i});return this.scrollOffset!==null&&(this.pendingWrite===s&&(this.scrollOffset+=t),this.scrollOffset<0&&(this.scrollOffset=0)),!0}else return this._holdOffset+=t,this.scrollOffset!==null&&(this.scrollOffset+=t),!0}scheduleScrollReconcile(){if(!this.targetWindow){this.scrollState=null;return}this.rafId==null&&(this.rafId=this.targetWindow.requestAnimationFrame(()=>{this.rafId=null,this.reconcileScroll()}))}getScrollStateTarget(t){let i=t.toEnd?[Math.max(this.getMaxScrollOffset(),0)]:t.index!=null?this.getOffsetForIndex(t.index,t.align):void 0;return i?i[0]:t.lastTargetOffset}reconcileScroll(){if(!this.scrollState||!this.scrollElement)return;if(this.now()-this.scrollState.startedAt>5e3){this.scrollState=null;return}if(this.scrollState.phase==="queued"){this.scheduleScrollReconcile();return}this.getMeasurements();let n=this.getScrollStateTarget(this.scrollState),s=this.scrollState.index==null?1:this.options.useAnimationFrameWithResizeObserver?3:2,r=n!==this.scrollState.lastTargetOffset;if(!r&&js(n,this.getScrollOffset())){if(this.scrollState.phase==="smooth"?this.scrollState.phase="smoothLanded":this.scrollState.phase==="smoothFinishing"&&(this.scrollState.phase="instant"),this.scrollState.stableFrames++,this.scrollState.stableFrames>=s){this.getScrollOffset()!==n&&this._scrollToOffset(n,{behavior:"auto"}),this.scrollState=null;return}}else if(this.scrollState.stableFrames=0,r){let a=this.getSize()||600,o=Math.abs(n-this.getScrollOffset()),l=tu(this.scrollState)&&o>a;this.scrollState.lastTargetOffset=n,l?this.scrollState.phase="smooth":this.scrollState.phase==="smooth"?this.scrollState.phase="smoothFinishing":this.scrollState.phase==="smoothLanded"&&(this.scrollState.phase="instant"),this._scrollToOffset(n,{behavior:l?"smooth":"auto"})}this.scheduleScrollReconcile()}_startScroll(t,i,n,s){this.pendingScrollAnchor=null,this._clampedAdjustment=null;let r=this._iosGesture.tail();if(s==="absolute"&&r!==null){if(r==="fling"&&uT()){this._stopMomentum(()=>{let a=this.scrollState;a?.phase!=="queued"||this._iosGesture.tail()!=="fling"||this._reportedOverscroll||(this._iosGesture.end(),this._flushHoldIfReady(!0),this._writeAwaitingCommand())}),this.scrollState={...t,startedAt:this.now(),lastTargetOffset:i,stableFrames:0,phase:"queued",behavior:n,samples:[]},this.scheduleScrollReconcile();return}this._iosGesture.end()}this.scrollState={...t,startedAt:this.now(),lastTargetOffset:i,stableFrames:0,behavior:n,phase:pT(n,t.index!=null&&js(i,this.getScrollOffset()))},this._scrollToOffset(i,{behavior:n}),this.scheduleScrollReconcile()}},bT=(e,t,i,n)=>{for(;e<=t;){let s=(e+t)/2|0,r=i(s);if(r<n)e=s+1;else if(r>n)t=s-1;else return s}return e>0?e-1:0}});function RI({useFlushSync:e=!0,directDomUpdates:t=!1,directDomUpdatesMode:i="transform",...n}){let s=Gn.useReducer(d=>d+1,0)[1],r=Gn.useRef({enabled:t,mode:i,container:null,lastSize:null,lastPositions:new WeakMap,prevRange:null});r.current.enabled=t,r.current.mode=i;let a=Gn.useRef(!1),o=d=>{let f=r.current;if(!f.enabled||!f.container)return;let p=d.getTotalSize();if(p!==f.lastSize){f.lastSize=p;let _=d.options.horizontal?"width":"height";f.container.style[_]=`${p}px`}},l=(d,f,p)=>{let _=r.current,v=!!d.options.horizontal,g=f.start-d.options.scrollMargin;_.lastPositions.get(p)!==g&&(_.lastPositions.set(p,g),_.mode==="transform"?p.style.transform=v?`translate3d(${g}px, 0, 0)`:`translate3d(0, ${g}px, 0)`:p.style[v?"left":"top"]=`${g}px`)},c=d=>{let f=r.current;if(!(!f.enabled||!f.container)){o(d);for(let p of d.getVirtualItems()){let _=d.elementsCache.get(p.key);_&&l(d,p,_)}}},u={...n,onChange:(d,f)=>{var p;let _=r.current,v=!0;if(_.enabled){c(d);let g=d.range,m=_.prevRange;v=!m||m.isScrolling!==d.isScrolling||m.startIndex!==g?.startIndex||m.endIndex!==g?.endIndex,v&&(_.prevRange=g?{startIndex:g.startIndex,endIndex:g.endIndex,isScrolling:d.isScrolling}:null)}v&&(e&&f&&!a.current?(0,yT.flushSync)(s):s()),(p=n.onChange)==null||p.call(n,d,f)}},[h]=Gn.useState(()=>{let d=new tf(u),f=d.measureElement;return d.measureElement=p=>{a.current=!0;try{f(p)}finally{a.current=!1}let _=r.current;if(p!==null&&_.enabled&&_.container){let v=d.measurementsCache[d.indexFromElement(p)];v&&l(d,v,p)}},Object.assign(d,{containerRef:p=>{let _=r.current;_.container=p,_.lastSize=null,p!==null&&c(d)}})});return h.setOptions(u),ev(()=>h._didMount(),[]),ev(()=>(o(h),h._willUpdate())),ev(()=>{c(h)}),h}function ST(e){return RI({observeElementRect:gT,observeElementOffset:_T,scrollToFn:vT,...e})}var Gn,yT,ev,wT=ce(()=>{Gn=ae(Mt(),1),yT=ae(co(),1);J_();J_();ev=typeof document<"u"?Gn.useLayoutEffect:Gn.useEffect});function xl(){return{items:[],seenSeq:new Set,byItemId:new Map,toolLoc:new Map,openGroup:null,reqLoc:new Map,turnUsage:new Map,lastUserIdx:new Map}}function Vs(e){e.openGroup=null}function ET(e,t,i,n){let s=e.byItemId.get(t);if(s){let o=e.items[s.idx];o.text+=n,o.streaming=!0;return}Vs(e);let r=`${i}:${t}`,a=i==="assistant"?{kind:"assistant",key:r,itemId:t,text:n,streaming:!0}:{kind:"reasoning",key:r,itemId:t,text:n,streaming:!0};e.byItemId.set(t,{idx:e.items.length,field:i}),e.items.push(a)}function DI(e,t,i){let n=/^(.*):[ktx]\d+$/.exec(t);if(!n)return;let s=n[1]+":";for(let[r,a]of[...e.byItemId])a.field===i&&r.startsWith(s)&&r!==t&&(e.items[a.idx]={kind:"gone",key:`gone:${r}`},e.byItemId.delete(r))}function xT(e,t,i,n){DI(e,t,i);let s=e.byItemId.get(t);if(s){let o=e.items[s.idx];o.text=n,o.streaming=!1;return}Vs(e);let r=`${i}:${t}`,a=i==="assistant"?{kind:"assistant",key:r,itemId:t,text:n,streaming:!1}:{kind:"reasoning",key:r,itemId:t,text:n,streaming:!1};e.byItemId.set(t,{idx:e.items.length,field:i}),e.items.push(a)}function LI(e,t){let i=e.toolLoc.get(t.itemId);if(i){let a=e.items[i.group];if(a?.kind==="toolgroup"){let o=a.steps[i.step];a.steps[i.step]={...o,kind:t.kind==="other"&&o.kind!=="other"?o.kind:t.kind,title:t.title||o.title,status:t.status,input:t.input??o.input,detail:t.detail??o.detail,output:t.output??o.output,exitCode:t.exitCode??o.exitCode,durationMs:t.durationMs??o.durationMs}}return}let n={itemId:t.itemId,kind:t.kind,title:t.title,status:t.status,input:t.input,detail:t.detail,output:t.output,exitCode:t.exitCode,durationMs:t.durationMs},s=e.openGroup;(s==null||e.items[s]?.kind!=="toolgroup")&&(s=e.items.length,e.items.push({kind:"toolgroup",key:`tg:${t.itemId}`,steps:[]}),e.openGroup=s);let r=e.items[s];e.toolLoc.set(t.itemId,{group:s,step:r.steps.length}),r.steps.push(n)}function nf(e,t){if(t.seq!=null&&t.seq>0){if(e.seenSeq.has(t.seq))return;e.seenSeq.add(t.seq)}switch(t.type){case"user_message":Vs(e),e.lastUserIdx.set(t.turnId??"",e.items.length),e.items.push({kind:"user",key:`u:${t.seq}`,text:t.text,attachments:t.attachments,steered:t.steered,ts:t.ts});return;case"assistant_delta":ET(e,t.itemId,"assistant",t.text);return;case"reasoning_delta":ET(e,t.itemId,"reasoning",t.text);return;case"assistant_message":xT(e,t.itemId,"assistant",t.text);return;case"reasoning":xT(e,t.itemId,"reasoning",t.text);return;case"tool_output_delta":{let i=e.toolLoc.get(t.itemId);if(i){let n=e.items[i.group];if(n?.kind==="toolgroup"){let s=n.steps[i.step];s.output=(s.output??"")+t.text}}return}case"tool_call":LI(e,t);return;case"plan":Vs(e),e.items.push({kind:"plan",key:`plan:${t.itemId}`,itemId:t.itemId,markdown:t.markdown});return;case"todo":Vs(e),e.items.push({kind:"todo",key:`todo:${t.seq}`,items:t.items});return;case"permission_request":Vs(e),e.reqLoc.set(t.requestId,e.items.length),e.items.push({kind:"permission",key:`perm:${t.requestId}`,requestId:t.requestId,title:t.title,kindStr:t.kind,detail:t.detail,options:t.options,status:"pending"});return;case"permission_resolved":{let i=e.reqLoc.get(t.requestId),n=i!=null?e.items[i]:null;n?.kind==="permission"&&(n.status=t.cancelled?"cancelled":"resolved",n.choice=t.optionId);return}case"question":Vs(e),e.reqLoc.set(t.requestId,e.items.length),e.items.push({kind:"question",key:`q:${t.requestId}`,requestId:t.requestId,questions:t.questions,status:"pending"});return;case"question_answered":{let i=e.reqLoc.get(t.requestId),n=i!=null?e.items[i]:null;n?.kind==="question"&&(n.status="answered",n.answers=t.answers);return}case"usage":{let i=t.turnId??"",n=e.turnUsage.get(i)??{inputTokens:0,outputTokens:0,cacheReadTokens:0,costUsd:0};n.inputTokens+=t.inputTokens,n.outputTokens+=t.outputTokens,n.cacheReadTokens+=t.cacheReadTokens,n.costUsd+=t.costUsd,e.turnUsage.set(i,n);return}case"notice":Vs(e),e.items.push({kind:"notice",key:`n:${t.seq}`,level:t.level,message:t.message});return;case"turn_ended":Vs(e),e.items.push({kind:"turnend",key:`te:${t.seq}`,status:t.status,durationMs:t.durationMs,error:t.error,filesChanged:t.filesChanged,usage:e.turnUsage.get(t.turnId)});return;case"turn_started":return;case"status":return;default:return}}function CT(e,t={}){let i=xl();for(let r of e)nf(i,r);let n=t.runtimeStatus!=="running"&&t.runtimeStatus!=="initializing",s=null;for(let r of i.items){if(r.kind==="user"&&(s=r.text),n&&r.kind==="permission"&&r.status==="pending"&&(r.status="cancelled"),n&&r.kind==="question"&&r.status==="pending"&&(r.status="cancelled"),n&&r.kind==="toolgroup")for(let a of r.steps)a.status==="running"&&(a.status="failed");(r.kind==="assistant"||r.kind==="reasoning")&&n&&r.streaming&&(r.streaming=!1)}return{items:i.items,lastUserText:s}}var kT=ce(()=>{});var NT={};Vb(NT,{useTimeline:()=>An});function TT(){let e=qr!=="running"&&qr!=="initializing";for(let t of ys.items)if(e&&t.kind==="permission"&&t.status==="pending"&&(t.status="cancelled"),e&&t.kind==="question"&&t.status==="pending"&&(t.status="cancelled"),e&&(t.kind==="assistant"||t.kind==="reasoning")&&t.streaming&&(t.streaming=!1),e&&t.kind==="toolgroup")for(let i of t.steps)i.status==="running"&&(i.status="failed")}var ys,qa,qr,sf,An,Cl=ce(()=>{rl();kT();Tn();ys=xl(),qa=0,qr="idle",sf=null;An=ps((e,t)=>{let i=n=>{sf?.(),sf=te.subscribe(`thread:${n}`,(s,r)=>{let a=r;if(t().threadId===n){if(a.type==="event"&&a.event){let o=a.event;if(o.seq!=null&&o.seq>0){if(o.seq<=qa)return;qa=Math.max(qa,o.seq)}o.type==="user_message"&&e({lastUserText:o.text}),nf(ys,o);let l=ys.items.filter(c=>(c.kind==="permission"||c.kind==="question")&&c.status==="pending").map(c=>({requestId:c.requestId,kind:c.kind}));e({items:ys.items.slice(),pending:l});return}if(a.type==="status"&&a.status){qr=a.status,TT(),e({status:qr,items:ys.items.slice()});return}if(a.type==="queue"&&a.queue){e({queue:a.queue});return}if(a.type==="pending"&&a.pending){e({pending:a.pending});return}if(a.type==="commands"&&a.commands){e({slashCommands:a.commands});return}}},()=>qa)};return{threadId:null,status:"idle",items:[],queue:[],pending:[],lastUserText:null,error:null,slashCommands:[],open:n=>{t().threadId!==n&&(t().close(),e({threadId:n,status:"initializing",items:[],queue:[],pending:[],lastUserText:null,error:null,slashCommands:[]}),ys=xl(),qa=0,qr="initializing",(async()=>{try{let s=await te.call("threads.get",{id:n});if(t().threadId!==n)return;qr=s.runtimeStatus??s.meta.status;let r=CT(s.events,{runtimeStatus:qr});ys=xl();for(let a of s.events)nf(ys,a);qa=Math.max(0,...s.events.map(a=>a.seq??0)),TT(),e({items:ys.items.slice(),status:qr,queue:s.queue??[],pending:s.pending??[],lastUserText:r.lastUserText}),t().threadId===n&&i(n)}catch(s){t().threadId===n&&e({error:String(s?.message??s),status:"error"})}})())},close:()=>{sf?.(),sf=null,ys=xl(),qa=0,e({threadId:null,items:[],queue:[],pending:[],lastUserText:null,error:null,status:"idle",slashCommands:[]})}}})});var rf,AT=ce(()=>{rf=class{constructor(t,i=2,n=8){he(this,"render",t);he(this,"minStep",i);he(this,"frac",n);he(this,"target","");he(this,"shown","");he(this,"raf",0);he(this,"running",!1);he(this,"tick",()=>{if(this.shown===this.target){this.running=!1;return}let t=this.target.length-this.shown.length,i=Math.max(this.minStep,Math.ceil(t/this.frac));this.shown=this.target.slice(0,this.shown.length+i),this.render(this.shown),this.raf=requestAnimationFrame(this.tick)})}push(t){this.target=t,this.shown.length>t.length&&(this.shown=t),this.running||(this.running=!0,this.tick())}flush(){this.shown=this.target,this.render(this.shown),this.running=!1,this.raf&&cancelAnimationFrame(this.raf)}stop(){this.running=!1,this.raf&&cancelAnimationFrame(this.raf)}}});function kl(){let e=location.hash.startsWith("#")?location.hash.slice(1):location.hash;return new URLSearchParams(e).get("t")??""}var af=ce(()=>{});function BI(e){return e==="+"||e==="-"?e:" "}function MT(e){if(!Array.isArray(e))return[];let t=[];for(let i of e){if(!i||typeof i!="object")continue;let n=i,s=[];for(let a of Array.isArray(n.lines)?n.lines:[]){if(!a||typeof a!="object")continue;let o=typeof a.text=="string"?a.text:typeof a.s=="string"?a.s:"";s.push({t:BI(a.t),text:o})}let r=typeof n.head=="string"?n.head:void 0;r===void 0&&Number.isInteger(n.oldStart)&&Number.isInteger(n.newStart)&&(r=`@@ -${n.oldStart} +${n.newStart} @@`),t.push({head:r,lines:s})}return t}var OT=ce(()=>{});function LT(e){return`/attachments/${e}?t=${DT()}`}function II({it:e,onRetry:t}){return(0,Y.jsxs)("div",{className:"um-row",children:[(0,Y.jsxs)("div",{className:"um",children:[e.attachments?.map(i=>(0,Y.jsx)("img",{className:"um-img",src:`/attachments/${i.id}?t=${DT()}`,alt:i.name},i.id)),(0,Y.jsx)("span",{className:"um-text",children:e.text}),(0,Y.jsxs)("div",{className:"um-act",children:[(0,Y.jsx)("button",{className:"ibtn",title:w("common.copy"),onClick:()=>{Ua(e.text)},children:(0,Y.jsx)(Me,{name:"copy",size:13})}),t&&(0,Y.jsx)("button",{className:"ibtn",title:w("timeline.editResend"),onClick:()=>t(e.text),children:(0,Y.jsx)(Me,{name:"send",size:13})})]})]}),e.steered&&(0,Y.jsx)("div",{className:"um-tag",children:w("timeline.steer")})]})}function zI({it:e}){let[t,i]=(0,Bt.useState)(e.streaming?"":e.text),n=(0,Bt.useRef)(null);return(0,Bt.useEffect)(()=>{n.current||(n.current=new rf(i)),n.current.push(e.text),e.streaming||n.current.flush()},[e.text,e.streaming]),(0,Bt.useEffect)(()=>()=>n.current?.stop(),[]),(0,Y.jsx)(j_,{text:t,streaming:e.streaming})}function PI({it:e}){let[t,i]=(0,Bt.useState)(!1),n=Math.max(1,Math.round(e.text.length/40));return(0,Y.jsxs)("div",{className:"rs-item",children:[(0,Y.jsxs)("button",{className:"rs-head",onClick:()=>i(!t),children:[(0,Y.jsx)("span",{className:`caret${t?" open":""}`,children:"\u203A"})," ",Te("timeline.thinking",{s:n})]}),t&&(0,Y.jsx)("div",{className:"rs-body",children:e.text})]})}function RT(e){let t=`timeline.tool.${e}`,i=w(t);return i.startsWith("timeline.tool.")?w("timeline.tool.other"):i}function UI({it:e}){let t=e.steps.some(l=>l.status==="failed"),i=e.steps.some(l=>{let c=l.detail,u=c?.hunks??c?.diff?.hunks;return Array.isArray(u)&&u.length>0}),[n,s]=(0,Bt.useState)(t||i),r=(0,Bt.useRef)(!1);(0,Bt.useEffect)(()=>{!r.current&&(t||i)&&s(!0)},[t,i]);let a=(0,Bt.useMemo)(()=>{let l=new Map;for(let u of e.steps)l.set(u.kind,(l.get(u.kind)??0)+1);let c=[...l.entries()].map(([u,h])=>`${RT(u)} ${h}`);return Te("timeline.toolSummary",{n:e.steps.length,parts:c.join(" \xB7 ")})},[e.steps]),o=e.steps.find(l=>l.status==="running");return(0,Y.jsxs)("div",{className:"tg",children:[(0,Y.jsxs)("button",{className:"tg-head",onClick:()=>{r.current=!0,s(!n)},children:[(0,Y.jsx)("span",{className:`caret${n?" open":""}`,children:"\u203A"}),(0,Y.jsx)("span",{children:a}),o&&(0,Y.jsx)("span",{className:"tg-live",children:Te("timeline.toolRunning",{kind:RT(o.kind),title:o.title})})]}),n&&(0,Y.jsx)("div",{className:"tg-list",children:e.steps.map(l=>(0,Y.jsx)(HI,{s:l},l.itemId))})]})}function HI({s:e}){let t=e.detail,[i,n]=(0,Bt.useState)(e.status==="failed"||Array.isArray(t?.hunks)&&t.hunks.length>0),s=e.status==="running"?"\u2026":e.status==="ok"?"\u2713":"\u2717",r=e.status==="running"?"run":e.status==="ok"?"ok":"fail",a=e.output||e.detail;return(0,Y.jsxs)("div",{className:"ts",children:[(0,Y.jsxs)("button",{className:"ts-head",onClick:()=>a&&n(!i),children:[(0,Y.jsx)("span",{className:`ts-ic ${r}`,children:s}),(0,Y.jsx)("span",{className:"ts-title",children:e.title}),e.durationMs!=null&&(0,Y.jsx)("span",{className:"ts-meta",children:d_(e.durationMs)}),e.exitCode!=null&&e.exitCode!==0&&(0,Y.jsxs)("span",{className:"ts-meta err",children:["exit ",e.exitCode]})]}),i&&(0,Y.jsx)(FI,{s:e})]})}function FI({s:e}){let[t,i]=(0,Bt.useState)(!1),n=e.detail,s=n?.hunks??n?.diff?.hunks;if(s)return(0,Y.jsx)(of,{hunks:MT(s),path:n?.diff?.path??n?.path});if(e.output!=null){let r=e.output.split(`
86
+ `),a=r.length>50&&!t,o=a?r.slice(-50).join(`
87
+ `):e.output;return(0,Y.jsxs)("div",{className:"ts-out",children:[a&&(0,Y.jsx)("button",{className:"ts-more",onClick:()=>i(!0),children:Te("timeline.showAllLines",{n:r.length})}),(0,Y.jsx)("pre",{children:o})]})}return e.input!=null?(0,Y.jsx)("pre",{className:"ts-out",children:JSON.stringify(e.input,null,2).slice(0,4e3)}):null}function of({hunks:e,path:t,max:i=3e3}){let n=0,s=!1;return(0,Y.jsxs)("div",{className:"diff",children:[t&&(0,Y.jsx)("div",{className:"diff-path",children:t}),(0,Y.jsx)("pre",{className:"diff-pre",children:e.map((r,a)=>(0,Y.jsxs)("span",{className:"dh",children:[(0,Y.jsx)("span",{className:"dh-head",children:r.head??"@@"}),r.lines.map((o,l)=>(n++,n>i?(s=!0,null):(0,Y.jsxs)("span",{className:`dl ${o.t==="+"?"add":o.t==="-"?"del":""}`,children:[o.t," ",o.text,`
88
+ `]},l)))]},a))}),s&&(0,Y.jsx)("div",{className:"dlg-hint",children:Te("timeline.diffClip",{n:i})})]})}function qI({it:e}){return(0,Y.jsx)("div",{className:"card plan",children:(0,Y.jsx)(j_,{text:e.markdown})})}function KI({it:e}){let[t,i]=(0,Bt.useState)(!1),n=e.items.filter(s=>s.status==="done"||s.status==="completed").length;return(0,Y.jsxs)("div",{className:"rs-item",children:[(0,Y.jsxs)("button",{className:"rs-head",onClick:()=>i(!t),children:[(0,Y.jsx)("span",{className:`caret${t?" open":""}`,children:"\u203A"})," ",Te("timeline.todo",{done:n,total:e.items.length})]}),t&&(0,Y.jsx)("ul",{className:"todo-list",children:e.items.map((s,r)=>(0,Y.jsxs)("li",{className:`todo ${s.status}`,children:[s.status==="done"||s.status==="completed"?"\u2611":s.status==="in_progress"?"\u25D0":"\u2610"," ",s.text]},r))})]})}function WI({it:e,threadId:t}){let[i,n]=(0,Bt.useState)(!1),s=l=>{n(!0),te.call("thread.respond",{id:t,requestId:e.requestId,optionId:l}).catch(()=>n(!1))},r=e.detail,a=r?.hunks??r?.diff?.hunks,o=e.status==="resolved"?e.choice==="allow_always"||e.choice==="acceptForSession"?w("timeline.permAllowSession"):e.choice==="deny"||e.choice==="reject"||e.choice==="decline"?w("timeline.permDenied"):e.choice==="implement"?w("timeline.permAllowed"):w("timeline.permAllowed"):w("timeline.permCancelled");return(0,Y.jsxs)("div",{className:`card perm${e.status!=="pending"?" done":""}`,children:[(0,Y.jsx)("div",{className:"perm-title",children:e.title}),r?.command&&(0,Y.jsx)("pre",{className:"perm-cmd",children:r.command}),r?.path&&(0,Y.jsx)("div",{className:"perm-path",children:r.path}),a&&(0,Y.jsx)(of,{hunks:a,path:r?.diff?.path??r?.path,max:200}),e.status==="pending"?(0,Y.jsx)("div",{className:"perm-btns",children:e.options.map(l=>(0,Y.jsx)("button",{className:`btn ${l.kind==="allow_once"?"primary":l.kind==="reject_once"?"danger":""}`,disabled:i,onClick:()=>s(l.id),children:l.label},l.id))}):(0,Y.jsx)("div",{className:"perm-done",children:o})]})}function GI({it:e,threadId:t}){let[i,n]=(0,Bt.useState)({}),[s,r]=(0,Bt.useState)({}),a=e.questions,o=(c,u)=>c.id??c.question??c.header??`q${u}`,l=()=>{let c={};a.forEach((u,h)=>{c[o(u,h)]=i[h]?.trim()||s[h]||""}),te.call("thread.respond",{id:t,requestId:e.requestId,answers:c})};return(0,Y.jsxs)("div",{className:`card ask${e.status!=="pending"?" done":""}`,children:[a.map((c,u)=>(0,Y.jsxs)("div",{className:"ask-q",children:[(0,Y.jsx)("div",{className:"ask-t",children:c.header??c.question}),e.status==="pending"?(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)("div",{className:"ask-opts",children:c.options?.map(h=>(0,Y.jsx)("button",{className:`btn${s[u]===h.label?" primary":""}`,onClick:()=>r(d=>({...d,[u]:h.label})),children:h.label},h.label))}),(0,Y.jsx)("input",{className:"tinput ask-free",placeholder:w("common.other"),value:i[u]??"",onChange:h=>n(d=>({...d,[u]:h.target.value}))})]}):(0,Y.jsx)("div",{className:"perm-done",children:e.answers?Te("timeline.submitted",{ans:Object.values(e.answers).join("\u3001")}):w("timeline.permCancelled")})]},u)),e.status==="pending"&&(0,Y.jsx)("button",{className:"btn primary",onClick:l,children:w("common.submit")})]})}function $I({it:e,onRetry:t}){let i=fe(),[n,s]=(0,Bt.useState)(!1);if(e.status==="failed")return(0,Y.jsxs)("div",{className:"card err-card",children:[(0,Y.jsx)("div",{className:"err-line",children:Te("timeline.turnError",{err:ka(e.error??w("timeline.unknownError"))})}),(0,Y.jsxs)("div",{className:"perm-btns",children:[t&&(0,Y.jsx)("button",{className:"btn",onClick:t,children:w("common.retry")}),e.error&&e.error.length>60&&(0,Y.jsx)("button",{className:"btn ghost",onClick:()=>s(!n),children:w("common.details")})]}),n&&(0,Y.jsx)("pre",{className:"perm-cmd",children:ka(e.error??"")})]});let r=[];if(e.durationMs!=null&&r.push(d_(e.durationMs)),e.usage){let a=e.usage.inputTokens+e.usage.outputTokens;a&&r.push(`${ul(a)} tokens`),e.usage.costUsd&&r.push(Md(e.usage.costUsd))}return e.status==="interrupted"&&r.push(w("timeline.interrupted")),(0,Y.jsxs)("div",{className:"te",children:[(0,Y.jsx)("span",{children:r.join(" \xB7 ")||e.status}),e.filesChanged!=null&&e.filesChanged>0&&(0,Y.jsx)("button",{className:"te-files",onClick:()=>i.openPanel("changes"),children:Te("timeline.filesChanged",{n:e.filesChanged})})]})}function BT({it:e,threadId:t,onEditResend:i,onRetryLast:n}){switch(e.kind){case"user":return(0,Y.jsx)(II,{it:e,onRetry:i});case"assistant":return(0,Y.jsx)("div",{className:"as",children:(0,Y.jsx)(zI,{it:e})});case"reasoning":return(0,Y.jsx)(PI,{it:e});case"toolgroup":return(0,Y.jsx)(UI,{it:e});case"plan":return(0,Y.jsx)(qI,{it:e});case"todo":return(0,Y.jsx)(KI,{it:e});case"permission":return(0,Y.jsx)(WI,{it:e,threadId:t});case"question":return(0,Y.jsx)(GI,{it:e,threadId:t});case"notice":return(0,Y.jsx)("div",{className:`nt ${e.level}`,children:ka(e.message)});case"turnend":return(0,Y.jsx)($I,{it:e,onRetry:n});case"gone":return null;default:return null}}var Bt,Y,DT,lf=ce(()=>{Bt=ae(Mt(),1);Jd();AT();Pr();Tn();af();OT();Od();ln();wi();Y=ae(Le(),1),DT=()=>kl()});function tv(){return[{id:"plan",label:w("composer.mode.plan.label"),desc:w("composer.mode.plan.desc")},{id:"default",label:w("composer.mode.default.label"),desc:w("composer.mode.default.desc")},{id:"acceptEdits",label:w("composer.mode.acceptEdits.label"),desc:w("composer.mode.acceptEdits.desc")},{id:"bypassPermissions",label:w("composer.mode.bypass.label"),desc:w("composer.mode.bypass.desc"),danger:!0}]}function YI(){return[{id:"default",label:w("composer.mode.cursorAgent.label"),desc:w("composer.mode.cursorAgent.desc")},{id:"plan",label:w("composer.mode.cursorPlan.label"),desc:w("composer.mode.cursorPlan.desc")},{id:"ask",label:w("composer.mode.cursorAsk.label"),desc:w("composer.mode.cursorAsk.desc")}]}function IT(e,t,i){return(e==="cursor"?YI():tv()).filter(s=>t.includes(s.id)).map(s=>i?.[s.id]?{...s,label:i[s.id]}:s)}var iv=ce(()=>{wi()});var HT={};Vb(HT,{SettingsDialog:()=>nv,applyTheme:()=>UT,useLiveSettings:()=>Tl});function zT(e){return!(e.enabled===!1||!e.available||e.status==="planned")}function jI(e){return e.status==="verified"?w("settings.providerVerified"):e.status==="experimental"?w("settings.providerExperimental"):e.status==="planned"?w("settings.providerPlanned"):w("settings.providerPending")}function nv({onClose:e,providers:t}){let i=lt(v=>v.ws),[n,s]=(0,Kr.useState)(null),[r,a]=(0,Kr.useState)({}),[o,l]=(0,Kr.useState)(null),c=tv();(0,Kr.useEffect)(()=>{te.call("settings.get").then(v=>s(v)),te.call("app.info").then(v=>a(v)).catch(()=>{})},[]);let u=async v=>{let g={...n,...v};s(g);try{await te.call("settings.set",{patch:v}),window.dispatchEvent(new CustomEvent("settings-changed",{detail:g})),v.theme&&UT(v.theme),v.providerEnabled&&i&&te.call("providers.list",{refresh:!0}).then(m=>{lt.setState({providers:m})})}catch(m){Pe(w("settings.failSave")+ht(m),!0)}},h=(v,g)=>{let m=n?.providerEnabled??{};u({providerEnabled:{...m,[v]:g}})},d=()=>{te.call("providers.list",{refresh:!0}).then(v=>{lt.setState({providers:v}),Pe(w("settings.providerRedetect")+" \u2713")}).catch(v=>Pe(ht(v),!0))},f=(v,g)=>{let m={...n?.providerCommand??{}};m[v]={...m[v],...g},u({providerCommand:m})},p=v=>{if(v.enabled===!1)return{dot:"off",text:w("settings.providerOff")};if(!v.available)return{dot:"off",text:v.reason??w("common.notDetected")};let g=v.models?.length??0,m=jI(v),b=g>0?` \xB7 ${Te("settings.providerModels",{n:String(g)})}`:"";return{dot:v.status==="verified"?"on":"pending",text:m+b}};if(!n)return(0,de.jsx)(gs,{title:w("settings.title"),onClose:e,children:(0,de.jsx)("div",{className:"dlg-hint",children:w("common.loading")})});let _=(v,g)=>(0,de.jsxs)("div",{className:"dlg-row",children:[(0,de.jsx)("label",{children:v}),g]});return(0,de.jsxs)(gs,{title:w("settings.title"),onClose:e,wide:!0,footer:(0,de.jsx)("button",{className:"btn primary",onClick:e,children:w("common.done")}),children:[_(w("settings.defaultAgent"),(0,de.jsx)("select",{className:"tinput",value:n.defaultProvider??"claude",onChange:v=>{u({defaultProvider:v.target.value})},children:t.map(v=>(0,de.jsxs)("option",{value:v.id,disabled:!zT(v),children:[v.name,zT(v)?"":w("common.notInstalled")]},v.id))})),(0,de.jsxs)("div",{className:"dlg-row dlg-row-top",children:[(0,de.jsx)("label",{children:w("settings.providers")}),(0,de.jsxs)("div",{className:"provider-list",children:[(0,de.jsx)("button",{type:"button",className:"btn sm provider-redetect",onClick:d,children:w("settings.providerRedetect")}),t.map(v=>{let g=p(v),m=v.enabled!==!1,b=o===v.id,S=n.providerCommand?.[v.id];return(0,de.jsxs)("div",{className:`provider-row${b?" open":""}`,children:[(0,de.jsxs)("button",{type:"button",className:"provider-head",onClick:()=>l(b?null:v.id),children:[(0,de.jsx)("span",{className:`provider-dot provider-dot-${g.dot}`,"aria-hidden":!0}),(0,de.jsxs)("div",{className:"provider-meta",children:[(0,de.jsx)("span",{className:"provider-name",children:v.name}),(0,de.jsx)("span",{className:"dlg-hint",children:g.text})]}),(0,de.jsx)("span",{className:"mi-caret",children:b?"\u25BE":"\u25B8"})]}),(0,de.jsx)("label",{className:"provider-switch",title:v.name,children:(0,de.jsx)("input",{type:"checkbox",checked:m,onChange:x=>h(v.id,x.target.checked)})}),b&&(0,de.jsxs)("div",{className:"provider-detail",children:[v.bin&&(0,de.jsxs)("div",{className:"dlg-hint",children:[v.bin,v.version?` \xB7 ${v.version}`:""]}),v.installHint&&(0,de.jsxs)("div",{className:"provider-hint-row",children:[(0,de.jsx)("span",{className:"dlg-hint",children:v.installHint}),(0,de.jsx)("button",{type:"button",className:"te-files",onClick:()=>{navigator.clipboard?.writeText(v.installHint??"").then(()=>Pe(w("common.copied")))},children:w("settings.providerCopyHint")})]}),(0,de.jsx)("div",{className:"dlg-hint",children:w("settings.providerLaunchCmd")}),(0,de.jsx)("input",{className:"tinput",placeholder:w("settings.providerLaunchExe"),value:S?.executable??"",onChange:x=>f(v.id,{executable:x.target.value||void 0})}),(0,de.jsx)("input",{className:"tinput",placeholder:'["--acp"]',value:S?.args?JSON.stringify(S.args):"",onChange:x=>{try{let C=x.target.value.trim();f(v.id,{args:C?JSON.parse(C):void 0})}catch{}}})]})]},v.id)})]})]}),_(w("settings.defaultMode"),(0,de.jsx)("select",{className:"tinput",value:n.defaultMode??"default",onChange:v=>{u({defaultMode:v.target.value})},children:c.map(v=>(0,de.jsx)("option",{value:v.id,children:v.label},v.id))})),_(w("settings.theme"),(0,de.jsxs)("select",{className:"tinput",value:n.theme??"auto",onChange:v=>{u({theme:v.target.value})},children:[(0,de.jsx)("option",{value:"auto",children:w("settings.themeAuto")}),(0,de.jsx)("option",{value:"light",children:w("settings.themeLight")}),(0,de.jsx)("option",{value:"dark",children:w("settings.themeDark")})]})),_(w("settings.sendKey"),(0,de.jsxs)("select",{className:"tinput",value:n.sendKey??"enter",onChange:v=>{u({sendKey:v.target.value})},children:[(0,de.jsx)("option",{value:"enter",children:w("settings.sendEnter")}),(0,de.jsx)("option",{value:"ctrlEnter",children:w("settings.sendCtrl")})]})),_(w("settings.runningSend"),(0,de.jsxs)("select",{className:"tinput",value:n.runningSend??"queue",onChange:v=>{u({runningSend:v.target.value})},children:[(0,de.jsx)("option",{value:"queue",children:w("settings.queue")}),(0,de.jsx)("option",{value:"steer",children:w("settings.steer")})]})),_(w("settings.thinking"),(0,de.jsxs)("label",{style:{display:"flex",gap:8,alignItems:"center",fontSize:"var(--fs-m)",color:"var(--fg)"},children:[(0,de.jsx)("input",{type:"checkbox",checked:n.showThinking!==!1,onChange:v=>{u({showThinking:v.target.checked})}}),w("settings.showThinking")]})),_(w("settings.idleClose"),(0,de.jsxs)("div",{style:{display:"flex",gap:8,alignItems:"center"},children:[(0,de.jsx)("input",{className:"tinput",type:"number",min:5,max:240,style:{width:90},value:n.idleCloseMinutes??30,onChange:v=>{u({idleCloseMinutes:Math.max(5,Number(v.target.value)||30)})}}),(0,de.jsx)("span",{className:"dlg-hint",children:w("settings.idleMinutes")})]})),(0,de.jsx)("div",{className:"msep"}),(0,de.jsxs)("div",{className:"dlg-hint",children:[Te("settings.versionLine",{ver:r.version??"?",pid:r.pid??"?"}),(0,de.jsx)("br",{}),w("settings.dataDir"),r.dataDir??"?"," ",(0,de.jsx)("button",{className:"te-files",onClick:()=>{navigator.clipboard?.writeText(r.dataDir??"").catch(()=>{})},children:w("common.copy")})]})]})}function UT(e){let t=window.matchMedia?.("(prefers-color-scheme: dark)").matches;document.documentElement.dataset.theme=e==="light"||e==="dark"?e:t?"dark":"light"}function PT(e){return{sendKey:e?.sendKey==="ctrlEnter"?"ctrlEnter":"enter",runningSend:e?.runningSend==="steer"?"steer":"queue",showThinking:e?.showThinking!==!1}}function Tl(){let[e,t]=(0,Kr.useState)(VI);return(0,Kr.useEffect)(()=>{te.call("settings.get").then(n=>t(PT(n))).catch(()=>{});let i=n=>t(PT(n.detail));return window.addEventListener("settings-changed",i),()=>window.removeEventListener("settings-changed",i)},[]),e}var Kr,de,VI,iu=ce(()=>{Kr=ae(Mt(),1);dl();Tn();_s();iv();wi();qn();de=ae(Le(),1);VI={sendKey:"enter",runningSend:"queue",showThinking:!0}});function FT(e,t=!1){if(t||!e.startsWith("/"))return{open:!1,query:""};let i=e.slice(1);return i.includes(`
89
+ `)||i.includes(" ")?{open:!1,query:""}:{open:!0,query:i}}function qT(e,t){let i=t.trim().toLowerCase();return i?e.filter(n=>n.name.toLowerCase().includes(i)||n.description.toLowerCase().includes(i)||(n.argumentHint??"").toLowerCase().includes(i)):e}function KT(e){let t=e.filter(s=>s.kind==="command"),i=e.filter(s=>s.kind==="skill"),n=[];if(t.length){n.push({type:"heading",id:"h-cmd",labelKey:"slashGroupCommand"});for(let s of t)n.push({type:"item",id:`c:${s.name}`,command:s})}if(i.length){n.push({type:"heading",id:"h-skill",labelKey:"slashGroupSkill"});for(let s of i)n.push({type:"item",id:`s:${s.name}`,command:s})}return n}function WT(e){return e.filter(t=>t.type==="item").map(t=>t.command)}function sv(e){return`/${e} `}function GT(e,t){return!!t&&e.trim()===`/${t}`}function rv(e,t){return t<=0?0:e<0?t-1:e>=t?0:e}var $T=ce(()=>{});function YT(){let e=fe(),{threads:t,providers:i}=lt(),n=An(),[s,r]=(0,We.useState)(""),[a,o]=(0,We.useState)([]),[l,c]=(0,We.useState)(!1),[u,h]=(0,We.useState)(null),[d,f]=(0,We.useState)(""),p=(0,We.useRef)(null),_=(0,We.useRef)(null),v=(0,We.useRef)(null),[g,m]=(0,We.useState)([]),[b,S]=(0,We.useState)(0),[x,C]=(0,We.useState)(0),N=(0,We.useRef)(!1),M=(0,We.useRef)(new Set),[O,q]=(0,We.useState)(!1),G=Tl(),I=t.find(E=>E.id===e.currentThreadId),P=i.find(E=>E.id===I?.provider),R=n.status==="running"||n.status==="initializing",K=n.pending.length>0,T=P?.capabilities.steer??!1,D=I?.mode??"default",A=IT(I?.provider,P?.capabilities.modes??[],P?.capabilities.modeLabels),Z=A.find(E=>E.id===D),re=n.items.some(E=>E.kind==="user"),L=(0,We.useMemo)(()=>FT(s,N.current),[s]),ee=(0,We.useMemo)(()=>qT(n.slashCommands,L.query),[n.slashCommands,L.query]),Ce=(0,We.useMemo)(()=>KT(ee),[ee]),ue=(0,We.useMemo)(()=>WT(Ce),[Ce]),Ue=L.open&&!K;(0,We.useEffect)(()=>{C(0)},[L.query,Ue]),(0,We.useEffect)(()=>{let E=I?.id;!Ue||!E||M.current.has(E)||(M.current.add(E),q(!0),te.call("thread.commands",{id:E,load:!0},3e4).then(U=>{let $=U.commands??[];($.length||!An.getState().slashCommands.length)&&An.setState({slashCommands:$})}).catch(()=>{}).finally(()=>q(!1)))},[Ue,I?.id]);let Q=(0,We.useMemo)(()=>i.filter(E=>E.enabled!==!1||E.id===I?.provider),[i,I?.provider]),Oe=Q.find(E=>E.id===(u??I?.provider)),_i=E=>E.enabled!==!1&&E.available&&E.status!=="planned",zt=E=>{c(E),E&&(h(null),f(""))};(0,We.useEffect)(()=>{if(!l)return;let E=$=>{p.current&&!p.current.contains($.target)&&zt(!1)},U=$=>{$.key==="Escape"&&($.stopPropagation(),zt(!1))};return document.addEventListener("pointerdown",E,!0),window.addEventListener("keydown",U,!0),()=>{document.removeEventListener("pointerdown",E,!0),window.removeEventListener("keydown",U,!0)}},[l]);let Bi=async(E,U)=>{if(I){zt(!1);try{!re&&E!==I.provider&&await te.call("thread.setProvider",{id:I.id,provider:E}),await te.call("thread.setModel",{id:I.id,model:U})}catch($){Pe(w("composer.failSwitchAgent")+ht($),!0)}}},Ii=(0,We.useMemo)(()=>{let E=d.trim().toLowerCase();if(!E)return[];let U=[];for(let $ of Q)if(_i($))for(let J of $.models??[])(J.name.toLowerCase().includes(E)||J.id.toLowerCase().includes(E))&&U.push({providerId:$.id,providerName:$.name,model:J});return U.slice(0,100)},[d,Q]),vi=!!(u&&!d.trim());(0,We.useEffect)(()=>{if(!R)return;let E=Date.now(),U=setInterval(()=>S(Math.floor((Date.now()-E)/1e3)),1e3);return()=>clearInterval(U)},[R]),(0,We.useEffect)(()=>{let E=_.current;E&&(E.style.height="auto",E.style.height=Math.min(E.scrollHeight,264)+"px")},[s]);let ve=(0,We.useCallback)(async(E="queue")=>{let U=e.currentThreadId,$=s.trim();if(!(!U||!$&&a.length===0)){R&&E==="queue"&&m(J=>[...J,$]),r("");try{await te.call("thread.send",{id:U,text:$,attachments:a.map(J=>({path:J.path,mime:J.mime,name:J.name})),behavior:R&&E==="steer"&&T?"steer":"queue"}),o([]),R||m(J=>[...J.slice(-9),$])}catch(J){r($),Pe(w("composer.failSend")+ht(J),!0)}}},[s,a,e.currentThreadId,R,T]),mn=E=>{if(kn(E.nativeEvent))return;if(Ue&&ue.length>0){if(E.key==="ArrowDown"){E.preventDefault(),C(Ct=>rv(Ct+1,ue.length));return}if(E.key==="ArrowUp"){E.preventDefault(),C(Ct=>rv(Ct-1,ue.length));return}if(E.key==="Escape"){E.preventDefault(),N.current=!0,C(0);return}let J=ue[x]??ue[0],ye=E.key==="Enter"&&GT(s,J?.name);if((E.key==="Enter"&&!E.shiftKey||E.key==="Tab")&&!ye){E.preventDefault(),J&&(N.current=!1,r(sv(J.name)));return}}let U=E.ctrlKey||E.metaKey;if(G.sendKey==="ctrlEnter"?E.key==="Enter"&&U:E.key==="Enter"&&!E.shiftKey&&!U){E.preventDefault(),R&&G.runningSend==="steer"&&T?ve("steer"):ve("queue");return}if(G.sendKey==="enter"&&E.key==="Enter"&&U&&R){E.preventDefault(),ve(T?"steer":"queue");return}E.key==="ArrowUp"&&s===""&&g.length>0&&(E.preventDefault(),r(g[g.length-1]))},oi=async E=>{let U=E.clipboardData?.items;if(!U)return;for(let J of U)if(J.type.startsWith("image/")){E.preventDefault();let ye=J.getAsFile();ye&&await oe(ye);return}let $=E.clipboardData.getData("text/plain");if($&&$.length>32*1024){E.preventDefault();let J=new File([$],"paste.txt",{type:"text/plain"});await oe(J)}},oe=async E=>{let U=kl(),$={path:"",name:E.name,mime:E.type||"application/octet-stream",uploading:!0};o(J=>[...J,$]);try{let ye=await(await fetch(`/api/upload?name=${encodeURIComponent(E.name)}`,{method:"POST",headers:{"x-agent-console":U},body:E})).json();if(!ye.ok)throw new Error(ye.e?.message??w("composer.uploadFailed"));o(Ct=>Ct.map(Xn=>Xn===$?{...Xn,path:ye.id,name:ye.name??E.name,uploading:!1}:Xn))}catch(J){o(ye=>ye.filter(Ct=>Ct!==$)),Pe(w("composer.failUpload")+ht(J),!0)}},zi=async E=>{E.preventDefault();for(let U of E.dataTransfer.files)(U.type.startsWith("image/")||U.type.startsWith("text/"))&&await oe(U)},ie=E=>{I&&te.call("thread.setMode",{id:I.id,mode:E})},jn=E=>{I&&te.call("thread.setEffort",{id:I.id,effort:E})},Ge=E=>{I&&te.call("thread.setCursorOpts",{id:I.id,...E}).catch(U=>Pe(ht(U),!0))},Ie=I?.model?P?.models?.find(E=>E.id===I.model):P?.models?.find(E=>E.isDefault)??P?.models?.[0],Vn=(Ie?.thinkingOptions??[]).map(E=>{let U=E,$=typeof U.id=="string"?U.id:typeof U.reasoningEffort=="string"?U.reasoningEffort:null,J=U.id,ye=$??(J&&typeof J.reasoningEffort=="string"?J.reasoningEffort:null);return ye?{id:ye,label:typeof U.label=="string"?U.label:ye}:null}).filter(E=>E!==null),Pt=typeof Ie?.defaultThinking=="string"?Ie.defaultThinking:null,ir=Vn.length>0,Ts=(()=>{if(!I?.model){let $=P?.models?.find(J=>J.isDefault);return $?`${w("composer.defaultModel")} \xB7 ${$.name}`:w("composer.defaultModel")}let U=P?.models?.find($=>$.id===I.model)?.name??I.model;return I.cursorFast&&(U+=" \xB7 Fast"),U})();return e.currentThreadId?(0,V.jsxs)("div",{className:`composer${K?" waiting":""}`,onDrop:zi,onDragOver:E=>E.preventDefault(),children:[n.queue.length>0&&(0,V.jsx)("div",{className:"q-list",children:n.queue.map(E=>(0,V.jsxs)("div",{className:"q-item",children:[(0,V.jsx)("span",{className:"q-text",children:E.text}),(0,V.jsx)("button",{className:"ibtn",title:w("common.remove"),onClick:()=>{te.call("thread.queueRemove",{id:I?.id,queueId:E.id}).catch(()=>{})},children:(0,V.jsx)(Me,{name:"x",size:12})})]},E.id))}),D==="bypassPermissions"&&(0,V.jsx)("div",{className:"cp-danger",children:w("composer.bypassWarn")}),(0,V.jsxs)("div",{className:`cp-card${K?" waiting":""}${D==="bypassPermissions"?" danger":""}`,children:[a.length>0&&(0,V.jsx)("div",{className:"att-bar",children:a.map((E,U)=>(0,V.jsxs)("span",{className:`att${E.uploading?" up":""}`,children:[E.mime.startsWith("image/")&&E.path?(0,V.jsx)("img",{src:LT(E.path),alt:E.name}):(0,V.jsx)(Me,{name:"attach",size:12}),(0,V.jsx)("span",{className:"att-name",children:E.name}),E.uploading&&(0,V.jsx)("span",{className:"att-prog",children:"\u2026"}),(0,V.jsx)("button",{className:"att-x",onClick:()=>o($=>$.filter((J,ye)=>ye!==U)),children:"\xD7"})]},U))}),(0,V.jsxs)("div",{className:"cp-ta-wrap",children:[Ue&&(0,V.jsx)("div",{className:"pop agent-picker slash-pop",role:"listbox",children:(0,V.jsx)("div",{className:"ap-scroll",children:Ce.length===0?(0,V.jsx)("div",{className:"ap-empty",children:w(O?"composer.slashLoading":"composer.slashNoCommands")}):Ce.map(E=>{if(E.type==="heading")return(0,V.jsx)("div",{className:"slash-h",children:E.labelKey==="slashGroupCommand"?w("composer.slashGroupCommand"):w("composer.slashGroupSkill")},E.id);let $=ue.indexOf(E.command)===x;return(0,V.jsxs)("button",{type:"button",role:"option","aria-selected":$,className:`mi slash-item${$?" sel":""}`,onMouseDown:J=>J.preventDefault(),onClick:()=>{N.current=!1,r(sv(E.command.name))},children:[(0,V.jsxs)("span",{className:"slash-name",children:["/",E.command.name]}),(0,V.jsx)("span",{className:"slash-desc",children:E.command.description}),E.command.argumentHint?(0,V.jsx)("span",{className:"slash-hint",children:E.command.argumentHint}):null]},E.id)})})}),(0,V.jsx)("textarea",{ref:_,className:"cp-ta",rows:1,placeholder:K?w("composer.waitPerm"):R?w("composer.queuePlaceholder"):w("composer.inputPlaceholder"),value:s,disabled:K,onChange:E=>{N.current=!1,r(E.target.value)},onKeyDown:mn,onPaste:oi})]}),(0,V.jsxs)("div",{className:"cp-bar",children:[(0,V.jsxs)("div",{className:"pill-wrap",ref:p,children:[(0,V.jsxs)("button",{className:"pill",onClick:()=>zt(!l),title:w("composer.agentModel"),children:[(0,V.jsx)("span",{className:"p-a",children:P?.name??I?.provider??w("composer.agent")}),(0,V.jsx)("span",{className:"p-t",children:Ts})]}),l&&(0,V.jsxs)("div",{className:"pop agent-pop agent-picker",children:[(0,V.jsxs)("div",{className:"ap-search",children:[(0,V.jsx)(Me,{name:"search",size:14}),(0,V.jsx)("input",{className:"ap-search-in",autoFocus:!0,placeholder:w("composer.searchAllModels"),value:d,onChange:E=>f(E.target.value)})]}),d.trim()?(0,V.jsxs)("div",{className:"ap-scroll",children:[Ii.length===0&&(0,V.jsx)("div",{className:"ap-empty",children:w("composer.noModelMatch")}),Ii.map(({providerId:E,providerName:U,model:$})=>{let J=re&&E!==I?.provider;return(0,V.jsxs)("button",{className:"mi mi-row",disabled:J,onClick:()=>{Bi(E,$.id)},children:[(0,V.jsx)("span",{className:"mi-sub",children:U}),(0,V.jsx)("span",{className:"mi-name",children:$.name}),I?.provider===E&&I?.model===$.id&&(0,V.jsx)("span",{className:"mi-check",children:"\u2713"})]},`${E}:${$.id}`)})]}):vi&&Oe?(0,V.jsxs)("div",{className:"ap-scroll",children:[(0,V.jsxs)("button",{type:"button",className:"ap-back mi",onClick:()=>h(null),children:[(0,V.jsx)("span",{className:"ap-back-icon",children:(0,V.jsx)(Me,{name:"caret",size:14})}),Oe.name]}),(0,V.jsxs)("button",{className:"mi model-pick-row",title:Oe.models?.find(E=>E.isDefault)?.name??w("composer.defaultModel"),onClick:()=>{Bi(Oe.id,null)},children:[(0,V.jsx)("span",{className:"model-pick-name",children:w("composer.defaultModel")}),(()=>{let E=Oe.models?.find(U=>U.isDefault);return E?(0,V.jsxs)("span",{className:"mi-sub model-pick-default",children:[" (",E.name,")"]}):null})(),I?.provider===Oe.id&&!I?.model?(0,V.jsx)("span",{className:"mi-check",children:"\u2713"}):""]}),(Oe.models??[]).filter(E=>!E.isDefault).slice(0,av).map(E=>(0,V.jsxs)("button",{className:"mi model-pick-row",title:E.name,onClick:()=>{Bi(Oe.id,E.id)},children:[(0,V.jsx)("span",{className:"model-pick-name",children:E.name}),I?.provider===Oe.id&&I?.model===E.id?(0,V.jsx)("span",{className:"mi-check",children:"\u2713"}):""]},E.id)),(Oe.models?.length??0)>av&&(0,V.jsx)("div",{className:"ap-empty",children:Te("composer.moreModels",{n:String((Oe.models?.length??0)-av)})})]}):(0,V.jsxs)("div",{className:"ap-scroll",children:[(0,V.jsx)("div",{className:"mlabel",children:re?w("composer.agentLocked"):w("composer.providers")}),re&&(0,V.jsx)("div",{className:"ap-empty",children:w("composer.agentLockedHint")}),Q.length===0&&(0,V.jsx)("div",{className:"ap-empty",children:w("composer.providersLoading")}),Q.map(E=>{let $=_i(E)&&(!re||E.id===I?.provider),J=E.models?.length??0,ye=E.name?.trim()||E.id;return(0,V.jsxs)("button",{className:"mi mi-row provider-pick-row",disabled:!$,onClick:()=>{$&&h(E.id)},children:[(0,V.jsx)("span",{className:"provider-pick-name",children:ye}),(0,V.jsxs)("span",{className:"provider-pick-meta",children:[E.id===I?.provider&&(0,V.jsx)("span",{className:"mi-tag",children:"Current"}),(0,V.jsx)("span",{className:"mi-meta",children:J===1?"1 model":`${J} models`}),$&&(0,V.jsx)("span",{className:"mi-caret",children:(0,V.jsx)(Me,{name:"caret",size:14})}),E.enabled===!1&&(0,V.jsx)("span",{className:"dlg-hint",children:"Disabled"}),E.enabled!==!1&&E.status==="planned"&&(0,V.jsx)("span",{className:"dlg-hint",children:"Not available"}),E.enabled!==!1&&E.status!=="planned"&&!E.available&&(0,V.jsx)("span",{className:"dlg-hint",children:"Not detected"})]})]},E.id)})]})]})]}),ir&&(0,V.jsxs)("select",{className:"pill sel",value:I?.effort??"",title:w("composer.effortTitle"),onChange:E=>jn(E.target.value||null),children:[(0,V.jsx)("option",{value:"",children:Pt?Te("composer.defaultEffortNamed",{level:Pt}):w("composer.defaultEffort")}),Vn.map(E=>(0,V.jsx)("option",{value:E.id,children:E.label},E.id))]}),A.length>1&&(0,V.jsx)("select",{className:`pill sel${D==="bypassPermissions"?" danger":""}`,value:A.some(E=>E.id===D)?D:A[0].id,title:Z?.desc,onChange:E=>ie(E.target.value),children:A.map(E=>(0,V.jsx)("option",{value:E.id,children:E.label},E.id))}),I?.provider==="cursor"&&(0,V.jsxs)("select",{className:"pill sel cursor-fast",value:I.cursorFast?"fast":"off",title:"Fast",onChange:E=>Ge({cursorFast:E.target.value==="fast"}),children:[(0,V.jsx)("option",{value:"off",children:"Fast: Off"}),(0,V.jsx)("option",{value:"fast",children:"Fast: On"})]}),(0,V.jsx)("button",{className:"ibtn",title:w("composer.attachTitle"),onClick:()=>v.current?.click(),children:(0,V.jsx)(Me,{name:"attach"})}),(0,V.jsx)("input",{ref:v,type:"file",hidden:!0,multiple:!0,accept:"image/*,.txt,.md,.log,.json,.csv",onChange:E=>{for(let U of E.target.files??[])oe(U);E.target.value=""}}),(0,V.jsx)("div",{className:"cp-right",children:R?(0,V.jsxs)(V.Fragment,{children:[(0,V.jsxs)("span",{className:"cp-clock",children:[b,"s"]}),(0,V.jsx)("button",{className:"cp-stop",title:w("common.stop"),onClick:()=>{te.call("thread.interrupt",{id:I?.id})},children:(0,V.jsx)(Me,{name:"stop"})})]}):(0,V.jsx)("button",{className:"cp-send",title:w("common.send"),disabled:K||!s.trim()&&a.length===0||a.some(E=>E.uploading),onClick:()=>{ve("queue")},children:(0,V.jsx)(Me,{name:"send"})})})]})]})]}):null}var We,V,av,jT=ce(()=>{We=ae(Mt(),1);cl();ln();qn();Cl();Tn();af();Pr();lf();_s();iu();iv();wi();$T();V=ae(Le(),1),av=150});function XT(){let e=fe(),{projects:t,threads:i}=lt(),n=An(),r=Tl().showThinking?n.items:n.items.filter(C=>C.kind!=="reasoning"),a=(0,Mn.useRef)(null),[o,l]=(0,Mn.useState)(!0),[c,u]=(0,Mn.useState)(!1),h=t.find(C=>C.id===e.currentProjectId)??null,d=e.currentThreadId,f=d?i.find(C=>C.id===d)??null:null,p=h&&f&&f.projectId===h.id?f.id:null;(0,Mn.useEffect)(()=>{p?n.open(p):n.close(),l(!0),u(!1)},[p]);let _=(0,Mn.useCallback)(C=>{let N=r[C];if(!N)return 80;switch(N.kind){case"user":return 60;case"assistant":case"reasoning":return 120;case"toolgroup":return 30+N.steps.length*26;case"plan":return 200;case"permission":case"question":return 120;case"todo":return 30;case"turnend":case"notice":return 30;default:return 60}},[r]),v=ST({count:r.length,getScrollElement:()=>a.current,estimateSize:_,getItemKey:C=>r[C]?.key??C,overscan:8,measureElement:C=>C.getBoundingClientRect().height}),g=r.length;(0,Mn.useEffect)(()=>{let C=a.current;C&&(o?C.scrollTop=C.scrollHeight:u(!0))},[g,o]);let m=()=>{let C=a.current;if(!C)return;let N=C.scrollHeight-C.scrollTop-C.clientHeight<60;l(N),N&&u(!1)},b=()=>{a.current?.scrollTo({top:a.current.scrollHeight,behavior:"smooth"}),l(!0),u(!1)},S=C=>{p&&te.call("thread.send",{id:p,text:C})},x=()=>{n.lastUserText&&S(n.lastUserText)};return t.length===0?(0,Be.jsx)("div",{className:"scroll",ref:a,children:(0,Be.jsx)(VT,{kind:"no-projects"})}):p?(0,Be.jsxs)(Be.Fragment,{children:[(0,Be.jsx)("div",{className:"scroll",ref:a,onScroll:m,children:(0,Be.jsxs)("div",{className:"tl-wrap",children:[(0,Be.jsx)("div",{style:{height:v.getTotalSize(),position:"relative"},children:v.getVirtualItems().map(C=>{let N=r[C.index];return N?(0,Be.jsx)("div",{"data-index":C.index,ref:v.measureElement,style:{position:"absolute",top:0,left:0,width:"100%",transform:`translateY(${C.start}px)`},children:(0,Be.jsx)(BT,{it:N,threadId:p,onEditResend:S,onRetryLast:x})},C.key):null})}),n.items.length===0&&!n.error&&(0,Be.jsx)("div",{className:"sb-empty",children:w("chat.emptyHint")}),n.error&&(0,Be.jsx)("div",{className:"nt error",children:ka(n.error)})]})}),!o&&(0,Be.jsxs)("button",{className:"jump",onClick:b,title:w("chat.jumpBottom"),children:[(0,Be.jsx)(Me,{name:"caret"}),c&&(0,Be.jsx)("span",{className:"jd"})]}),(0,Be.jsx)(YT,{})]}):(0,Be.jsx)("div",{className:"scroll",ref:a,children:(0,Be.jsx)("div",{className:"empty-wrap",children:h?(0,Be.jsxs)(Be.Fragment,{children:[(0,Be.jsx)("div",{className:"cp-hero-t",children:Te("chat.newInProject",{name:h.name})}),(0,Be.jsx)(XI,{projectId:h.id})]}):(0,Be.jsx)(VT,{kind:"no-projects"})})})}function VT({kind:e}){return(0,Be.jsxs)("div",{className:"empty-wrap workspace-empty",children:[(0,Be.jsx)("div",{className:"cp-hero-t",children:w("sidebar.noProjectsTitle")}),(0,Be.jsx)("div",{className:"cp-hero-s",children:w("sidebar.noProjectsSub")}),(0,Be.jsx)("div",{className:"empty-actions",children:(0,Be.jsx)("button",{type:"button",className:"btn primary",onClick:()=>window.dispatchEvent(new CustomEvent("open-new-project")),children:w("sidebar.newProject")})})]})}function XI({projectId:e}){let t=fe(),i=Tl(),[n,s]=(0,Mn.useState)(""),[r,a]=(0,Mn.useState)(!1),o=async()=>{if(!(!n.trim()||r)){a(!0);try{let l=await ll(),c=await te.call("settings.get"),u=await te.call("threads.create",{projectId:e,provider:l,model:null,mode:c.defaultMode??"default",effort:c.defaultEffort??null});t.select(e,u.id),await te.call("thread.send",{id:u.id,text:n.trim()})}catch(l){Pe(w("chat.failSend")+ht(l),!0),a(!1)}}};return(0,Be.jsxs)("div",{className:"cp-card",style:{marginTop:18},children:[(0,Be.jsx)("textarea",{className:"cp-ta",rows:3,placeholder:w("chat.emptyPlaceholder"),value:n,onChange:l=>s(l.target.value),onKeyDown:l=>{if(kn(l.nativeEvent))return;let c=l.ctrlKey||l.metaKey;(i.sendKey==="ctrlEnter"?l.key==="Enter"&&c:l.key==="Enter"&&!l.shiftKey&&!c)&&(l.preventDefault(),o())}}),(0,Be.jsxs)("div",{className:"cp-bar",children:[(0,Be.jsx)("span",{className:"dlg-hint",children:w("chat.autoNewThread")}),(0,Be.jsx)("div",{className:"cp-right",children:(0,Be.jsx)("button",{className:"cp-send",disabled:!n.trim()||r,onClick:()=>{o()},title:w("common.send"),children:(0,Be.jsx)(Me,{name:"send"})})})]})]})}var Mn,Be,ZT=ce(()=>{Mn=ae(Mt(),1);cl();wT();ln();qn();Cl();lf();jT();Pr();Tn();_s();iu();wi();Be=ae(Le(),1)});function JT({onClose:e}){let{projects:t,threads:i,providers:n}=lt(),s=fe(),[r,a]=(0,ws.useState)(""),[o,l]=(0,ws.useState)(0),c=(0,ws.useRef)(null);(0,ws.useEffect)(()=>{c.current?.focus()},[]);let u=(0,ws.useMemo)(()=>{let f=[],p=r.trim().toLowerCase(),_=g=>!p||g.toLowerCase().includes(p),v=[[w("palette.actNewThread"),()=>{let g=s.currentProjectId??t[0]?.id;g&&d(g)}],[w("palette.actSettings"),()=>window.dispatchEvent(new CustomEvent("open-settings"))],[w("palette.actTheme"),()=>{ZI()}],[w("palette.actChanges"),()=>s.openPanel("changes")],[w("palette.actFiles"),()=>s.openPanel("files")],[w("palette.actTerminal"),()=>s.openPanel("terminal")],[w("palette.actImport"),()=>{let g=s.currentProjectId??t[0]?.id;g&&window.dispatchEvent(new CustomEvent("open-import",{detail:{projectId:g}}))}]];for(let[g,m]of v)_(g)&&f.push({id:`act:${g}`,label:g,hint:w("palette.hintAction"),run:m});for(let g of t)_(g.name)&&f.push({id:`p:${g.id}`,label:g.name,hint:w("palette.hintProject"),run:()=>s.select(g.id,null)});for(let g of i){let m=t.find(S=>S.id===g.projectId),b=`${g.title} ${m?.name??""}`;_(b)&&f.push({id:`t:${g.id}`,label:g.title,hint:m?.name??w("palette.hintThread"),run:()=>s.select(g.projectId,g.id)})}return f.slice(0,30)},[r,t,i]);(0,ws.useEffect)(()=>{l(0)},[r]);let h=f=>{if(f.key==="ArrowDown")f.preventDefault(),l(p=>Math.min(u.length-1,p+1));else if(f.key==="ArrowUp")f.preventDefault(),l(p=>Math.max(0,p-1));else if(f.key==="Enter"&&!kn(f.nativeEvent)){f.preventDefault();let p=u[o];p&&(e(),p.run())}else f.key==="Escape"&&(f.preventDefault(),e())};async function d(f){try{let p=await te.call("settings.get"),_=await ll(),v=await te.call("threads.create",{projectId:f,provider:_,mode:p.defaultMode??"default",effort:p.defaultEffort??null});fe.getState().select(f,v.id)}catch(p){Pe(w("palette.failNew")+ht(p),!0)}}return(0,QT.createPortal)((0,Ss.jsx)("div",{className:"dlg-scrim",style:{alignItems:"flex-start",paddingTop:"14vh"},onPointerDown:f=>{f.target===f.currentTarget&&e()},children:(0,Ss.jsxs)("div",{className:"dlg cpal",role:"dialog","aria-label":w("palette.aria"),children:[(0,Ss.jsx)("input",{ref:c,className:"cpal-in",placeholder:w("palette.placeholder"),value:r,onChange:f=>a(f.target.value),onKeyDown:h}),(0,Ss.jsxs)("div",{className:"cpal-list",children:[u.map((f,p)=>(0,Ss.jsxs)("button",{className:`cpal-item${p===o?" on":""}`,onMouseEnter:()=>l(p),onClick:()=>{e(),f.run()},children:[(0,Ss.jsx)("span",{className:"cpal-label",children:f.label}),f.hint&&(0,Ss.jsx)("span",{className:"cpal-hint",children:f.hint})]},f.id)),u.length===0&&(0,Ss.jsx)("div",{className:"sb-empty",children:w("palette.noMatch")})]})]})}),document.body)}async function ZI(){let e=document.documentElement.dataset.theme==="dark"?"light":"dark";document.documentElement.dataset.theme=e;try{await te.call("settings.set",{patch:{theme:e}})}catch{}}var ws,QT,Ss,eN=ce(()=>{ws=ae(Mt(),1);cl();QT=ae(co(),1);qn();ln();Tn();_s();wi();Ss=ae(Le(),1)});function ez(e){return e.replace(/\r?\n/g,"\r")}function tz(e,t){return t?"\x1B[200~"+e+"\x1B[201~":e}function iz(e,t){e.clipboardData&&e.clipboardData.setData("text/plain",t.selectionText),e.preventDefault()}function nz(e,t,i,n){if(e.stopPropagation(),e.clipboardData){let s=e.clipboardData.getData("text/plain");lA(s,t,i,n)}}function lA(e,t,i,n){e=ez(e),e=tz(e,i.decPrivateModes.bracketedPasteMode&&n.rawOptions.ignoreBracketedPasteMode!==!0),i.triggerDataEvent(e,!0),t.value=""}function cA(e,t,i){let n=i.getBoundingClientRect(),s=e.clientX-n.left-10,r=e.clientY-n.top-10;t.style.width="20px",t.style.height="20px",t.style.left=`${s}px`,t.style.top=`${r}px`,t.style.zIndex="1000",t.focus()}function nN(e,t,i,n,s){cA(e,t,i),s&&n.rightClickSelect(e),t.value=n.selectionText,t.select()}function jr(e){return e>65535?(e-=65536,String.fromCharCode((e>>10)+55296)+String.fromCharCode(e%1024+56320)):String.fromCharCode(e)}function Of(e,t=0,i=e.length){let n="";for(let s=t;s<i;++s){let r=e[s];r>65535?(r-=65536,n+=String.fromCharCode((r>>10)+55296)+String.fromCharCode(r%1024+56320)):n+=String.fromCharCode(r)}return n}function az(e){return e[Cv]||[]}function si(e){if(ov.has(e))return ov.get(e);let t=function(i,n,s){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");oz(t,i,s)};return t._id=e,ov.set(e,t),t}function oz(e,t,i){t[sN]===t?t[Cv].push({id:e,index:i}):(t[Cv]=[{id:e,index:i}],t[sN]=t)}function uz(e,t){if(confirm(`Do you want to navigate to ${t}?
90
+
91
+ WARNING: This link could potentially be dangerous`)){let i=window.open();if(i){try{i.opener=null}catch{}i.location.href=t}else console.warn("Opening link blocked as opener could not be cleared")}}function pf(e){pz(e)||fz.onUnexpectedError(e)}function pz(e){return e instanceof mz?!0:e instanceof Error&&e.name===Tv&&e.message===Tv}function gz(e){return e?new Error(`Illegal argument: ${e}`):new Error("Illegal argument")}function _z(e,t,i=0,n=e.length){let s=i,r=n;for(;s<r;){let a=Math.floor((s+r)/2);t(e[a])?s=a+1:r=a}return s-1}function hn(e,t=0){return e[e.length-(1+t)]}function bz(e,t){return(i,n)=>t(e(i),e(n))}function Sz(e,t){let i=Object.create(null);for(let n of e){let s=t(n),r=i[s];r||(r=i[s]=[]),r.push(n)}return i}function Ez(e,t){let i=this,n=!1,s;return function(){if(n)return s;if(n=!0,t)try{s=e.apply(i,arguments)}finally{t()}else s=e.apply(i,arguments);return s}}function kz(e){Ya=e}function Df(e){return Ya?.trackDisposable(e),e}function Lf(e){Ya?.markAsDisposed(e)}function yu(e,t){Ya?.setParent(e,t)}function Tz(e,t){if(Ya)for(let i of e)Ya.setParent(i,t)}function cN(e){return Ya?.markAsSingleton(e),e}function ja(e){if(Rv.is(e)){let t=[];for(let i of e)if(i)try{i.dispose()}catch(n){t.push(n)}if(t.length===1)throw t[0];if(t.length>1)throw new AggregateError(t,"Encountered errors while disposing of store");return Array.isArray(e)?[]:e}else if(e)return e.dispose(),e}function Nz(...e){let t=dt(()=>ja(e));return Tz(e,t),t}function dt(e){let t=Df({dispose:Ez(()=>{Lf(t),e()})});return t}function Fz(e,t,i){typeof t=="string"&&(t=e.matchMedia(t)),t.addEventListener("change",i)}function qz(e){return fb.INSTANCE.getZoomFactor(e)}function Kz(){return vf}function r5(e){if(e.charCode){let i=String.fromCharCode(e.charCode).toUpperCase();return Hv.fromString(i)}let t=e.keyCode;if(t===3)return 7;if(Uv)switch(t){case 59:return 85;case 60:if(Zz)return 97;break;case 61:return 86;case 107:return 109;case 109:return 111;case 173:return 88;case 224:if(Cs)return 57;break}else if(_f&&(Cs&&t===93||!Cs&&t===92))return 57;return i5[t]||0}function u5(e){if(!e.parent||e.parent===e)return null;try{let t=e.location,i=e.parent.location;if(t.origin!=="null"&&i.origin!=="null"&&t.origin!==i.origin)return null}catch{return null}return e.parent}function m5(e){return 55296<=e&&e<=56319}function wN(e){return 56320<=e&&e<=57343}function g5(e,t){return(e-55296<<10)+(t-56320)+65536}function _5(e){return _b(e,0)}function _b(e,t){switch(typeof e){case"object":return e===null?Qs(349,t):Array.isArray(e)?b5(e,t):y5(e,t);case"string":return BA(e,t);case"boolean":return v5(e,t);case"number":return Qs(e,t);case"undefined":return Qs(937,t);default:return Qs(617,t)}}function Qs(e,t){return(t<<5)-t+e|0}function v5(e,t){return Qs(e?433:863,t)}function BA(e,t){t=Qs(149417,t);for(let i=0,n=e.length;i<n;i++)t=Qs(e.charCodeAt(i),t);return t}function b5(e,t){return t=Qs(104579,t),e.reduce((i,n)=>_b(n,i),t)}function y5(e,t){return t=Qs(181387,t),Object.keys(e).sort().reduce((i,n)=>(i=BA(n,i),_b(e[n],i)),t)}function dv(e,t,i=32){let n=i-t,s=~((1<<n)-1);return(e<<t|(s&e)>>>n)>>>0}function EN(e,t=0,i=e.byteLength,n=0){for(let s=0;s<i;s++)e[t+s]=n}function S5(e,t,i="0"){for(;e.length<t;)e=i+e;return e}function nu(e,t=32){return e instanceof ArrayBuffer?Array.from(new Uint8Array(e)).map(i=>i.toString(16).padStart(2,"0")).join(""):S5((e>>>0).toString(16),t/4)}function _e(e,t,i,n){return new x5(e,t,i,n)}function C5(e,t){return function(i){return t(new uu(e,i))}}function k5(e){return function(t){return e(new Fv(t))}}function A5(e){let t=e.getBoundingClientRect(),i=Yn(e);return{left:t.left+i.scrollX,top:t.top+i.scrollY,width:t.width,height:t.height}}function zA(e,t,i,...n){let s=M5.exec(t);if(!s)throw new Error("Bad use of emmet");let r=s[1]||"div",a;return e!=="http://www.w3.org/1999/xhtml"?a=document.createElementNS(e,r):a=document.createElement(r),s[3]&&(a.id=s[3]),s[4]&&(a.className=s[4].replace(/\./g," ").trim()),i&&Object.entries(i).forEach(([o,l])=>{typeof l>"u"||(/^on\w+$/.test(o)?a[o]=l:o==="selected"?l&&a.setAttribute(o,"true"):a.setAttribute(o,l))}),a.append(...n),a}function O5(e,t,...i){return zA("http://www.w3.org/1999/xhtml",e,t,...i)}function Vi(e){return typeof e=="number"?`${e}px`:e}function _u(e){return new R5(e)}function D5(e,t,i){let n=null,s=null;if(typeof i.value=="function"?(n="value",s=i.value,s.length!==0&&console.warn("Memoize should only be used in functions with zero parameters")):typeof i.get=="function"&&(n="get",s=i.get),!s)throw new Error("not supported");let r=`$memoize$${t}`;i[n]=function(...a){return this.hasOwnProperty(r)||Object.defineProperty(this,r,{configurable:!1,enumerable:!1,writable:!1,value:s.apply(this,a)}),this[r]}}function pv(e,t){let i=t-e;return function(n){return e+i*H5(n)}}function P5(e,t,i){return function(n){return n<i?e(n/i):t((n-i)/(1-i))}}function U5(e){return Math.pow(e,3)}function H5(e){return 1-U5(1-e)}function X5(e){let t={lazyRender:typeof e.lazyRender<"u"?e.lazyRender:!1,className:typeof e.className<"u"?e.className:"",useShadows:typeof e.useShadows<"u"?e.useShadows:!0,handleMouseWheel:typeof e.handleMouseWheel<"u"?e.handleMouseWheel:!0,flipAxes:typeof e.flipAxes<"u"?e.flipAxes:!1,consumeMouseWheelIfScrollbarIsNeeded:typeof e.consumeMouseWheelIfScrollbarIsNeeded<"u"?e.consumeMouseWheelIfScrollbarIsNeeded:!1,alwaysConsumeMouseWheel:typeof e.alwaysConsumeMouseWheel<"u"?e.alwaysConsumeMouseWheel:!1,scrollYToX:typeof e.scrollYToX<"u"?e.scrollYToX:!1,mouseWheelScrollSensitivity:typeof e.mouseWheelScrollSensitivity<"u"?e.mouseWheelScrollSensitivity:1,fastScrollSensitivity:typeof e.fastScrollSensitivity<"u"?e.fastScrollSensitivity:5,scrollPredominantAxis:typeof e.scrollPredominantAxis<"u"?e.scrollPredominantAxis:!0,mouseWheelSmoothScroll:typeof e.mouseWheelSmoothScroll<"u"?e.mouseWheelSmoothScroll:!0,arrowSize:typeof e.arrowSize<"u"?e.arrowSize:11,listenOnDomNode:typeof e.listenOnDomNode<"u"?e.listenOnDomNode:null,horizontal:typeof e.horizontal<"u"?e.horizontal:1,horizontalScrollbarSize:typeof e.horizontalScrollbarSize<"u"?e.horizontalScrollbarSize:10,horizontalSliderSize:typeof e.horizontalSliderSize<"u"?e.horizontalSliderSize:0,horizontalHasArrows:typeof e.horizontalHasArrows<"u"?e.horizontalHasArrows:!1,vertical:typeof e.vertical<"u"?e.vertical:1,verticalScrollbarSize:typeof e.verticalScrollbarSize<"u"?e.verticalScrollbarSize:10,verticalHasArrows:typeof e.verticalHasArrows<"u"?e.verticalHasArrows:!1,verticalSliderSize:typeof e.verticalSliderSize<"u"?e.verticalSliderSize:0,scrollByPage:typeof e.scrollByPage<"u"?e.scrollByPage:!1};return t.horizontalSliderSize=typeof e.horizontalSliderSize<"u"?e.horizontalSliderSize:t.horizontalScrollbarSize,t.verticalSliderSize=typeof e.verticalSliderSize<"u"?e.verticalSliderSize:t.verticalScrollbarSize,Cs&&(t.className+=" mac"),t}function Ka(e){let t=e.toString(16);return t.length<2?"0"+t:t}function Xs(e,t){return e<t?(t+.05)/(e+.05):(e+.05)/(t+.05)}function J5(e){return 57508<=e&&e<=57558}function e6(e){return 9472<=e&&e<=9631}function t6(e){return J5(e)||e6(e)}function i6(){return{css:{canvas:uf(),cell:uf()},device:{canvas:uf(),cell:uf(),char:{width:0,height:0,left:0,top:0}}}}function uf(){return{width:0,height:0}}function DN(e,t,i){for(;e.length<i;)e=t+e;return e}function r6(){return new s6}function bb(e,t,i){let n=i.getBoundingClientRect(),s=e.getComputedStyle(i),r=parseInt(s.getPropertyValue("padding-left")),a=parseInt(s.getPropertyValue("padding-top"));return[t.clientX-n.left-r,t.clientY-n.top-a]}function d6(e,t,i,n,s,r,a,o,l){if(!r)return;let c=bb(e,t,i);if(c)return c[0]=Math.ceil((c[0]+(l?a/2:0))/a),c[1]=Math.ceil(c[1]/o),c[0]=Math.min(Math.max(c[0],1),n+(l?1:0)),c[1]=Math.min(Math.max(c[1],1),s),c}function m6(){if(!WA)return 0;let e=ku.match(/Version\/(\d+)/);return e===null||e.length<2?0:parseInt(e[1])}function w6(e,t,i,n){let s=i.buffer.x,r=i.buffer.y;if(!i.buffer.hasScrollback)return C6(s,r,e,t,i,n)+If(r,t,i,n)+k6(s,r,e,t,i,n);let a;if(r===t)return a=s>e?"D":"C",wu(Math.abs(s-e),Su(a,n));a=r>t?"D":"C";let o=Math.abs(r-t),l=x6(r>t?e:s,i)+(o-1)*i.cols+1+E6(r>t?s:e,i);return wu(l,Su(a,n))}function E6(e,t){return e-1}function x6(e,t){return t.cols-e}function C6(e,t,i,n,s,r){return If(t,n,s,r).length===0?"":wu(VA(e,t,e,t-Va(t,s),!1,s).length,Su("D",r))}function If(e,t,i,n){let s=e-Va(e,i),r=t-Va(t,i),a=Math.abs(s-r)-T6(e,t,i);return wu(a,Su(jA(e,t),n))}function k6(e,t,i,n,s,r){let a;If(t,n,s,r).length>0?a=n-Va(n,s):a=t;let o=n,l=N6(e,t,i,n,s,r);return wu(VA(e,a,i,o,l==="C",s).length,Su(l,r))}function T6(e,t,i){let n=0,s=e-Va(e,i),r=t-Va(t,i);for(let a=0;a<Math.abs(s-r);a++){let o=jA(e,t)==="A"?-1:1;i.buffer.lines.get(s+o*a)?.isWrapped&&n++}return n}function Va(e,t){let i=0,n=t.buffer.lines.get(e),s=n?.isWrapped;for(;s&&e>=0&&e<t.rows;)i++,n=t.buffer.lines.get(--e),s=n?.isWrapped;return i}function N6(e,t,i,n,s,r){let a;return If(i,n,s,r).length>0?a=n-Va(n,s):a=t,e<i&&a<=n||e>=i&&a<n?"C":"D"}function jA(e,t){return e>t?"A":"B"}function VA(e,t,i,n,s,r){let a=e,o=t,l="";for(;(a!==i||o!==n)&&o>=0&&o<r.buffer.lines.length;)a+=s?1:-1,s&&a>r.cols-1?(l+=r.buffer.translateBufferLineToString(o,!1,e,a),a=0,e=0,o++):!s&&a<0&&(l+=r.buffer.translateBufferLineToString(o,!1,0,e+1),a=r.cols-1,e=a,o--);return l+r.buffer.translateBufferLineToString(o,!1,e,a)}function Su(e,t){let i=t?"O":"[";return z.ESC+i+e}function wu(e,t){e=Math.floor(e);let i="";for(let n=0;n<e;n++)i+=t;return i}function BN(e,t){if(e.start.y>e.end.y)throw new Error(`Buffer range end (${e.end.x}, ${e.end.y}) cannot be before start (${e.start.x}, ${e.start.y})`);return t*(e.end.y-e.start.y)+(e.end.x-e.start.x+1)}function et(e,t){if(e!==void 0)try{return gt.toColor(e)}catch{}return t}function F6(e,t,i,n,s,r){let a=[];for(let o=0;o<e.length-1;o++){let l=o,c=e.get(++l);if(!c.isWrapped)continue;let u=[e.get(o)];for(;l<e.length&&c.isWrapped;)u.push(c),c=e.get(++l);if(!r&&n>=o&&n<l){o+=u.length-1;continue}let h=0,d=Eu(u,h,t),f=1,p=0;for(;f<u.length;){let v=Eu(u,f,t),g=v-p,m=i-d,b=Math.min(g,m);u[h].copyCellsFrom(u[f],p,d,b,!1),d+=b,d===i&&(h++,d=0),p+=b,p===v&&(f++,p=0),d===0&&h!==0&&u[h-1].getWidth(i-1)===2&&(u[h].copyCellsFrom(u[h-1],i-1,d++,1,!1),u[h-1].setCell(i-1,s))}u[h].replaceCells(d,i,s);let _=0;for(let v=u.length-1;v>0&&(v>h||u[v].getTrimmedLength()===0);v--)_++;_>0&&(a.push(o+u.length-_),a.push(_)),o+=u.length-1}return a}function q6(e,t){let i=[],n=0,s=t[n],r=0;for(let a=0;a<e.length;a++)if(s===a){let o=t[++n];e.onDeleteEmitter.fire({index:a-r,amount:o}),a+=o-1,r+=o,s=t[++n]}else i.push(a);return{layout:i,countRemoved:r}}function K6(e,t){let i=[];for(let n=0;n<t.length;n++)i.push(e.get(t[n]));for(let n=0;n<i.length;n++)e.set(n,i[n]);e.length=t.length}function W6(e,t,i){let n=[],s=e.map((l,c)=>Eu(e,c,t)).reduce((l,c)=>l+c),r=0,a=0,o=0;for(;o<s;){if(s-o<i){n.push(s-o);break}r+=i;let l=Eu(e,a,t);r>l&&(r-=l,a++);let c=e[a].getWidth(r-1)===2;c&&r--;let u=c?i-1:i;n.push(u),o+=u}return n}function Eu(e,t,i){if(t===e.length-1)return e[t].getTrimmedLength();let n=!e[t].hasContent(i-1)&&e[t].getWidth(i-1)===1,s=e[t+1].getWidth(0)===2;return n&&s?i-1:i}function V6(e){return e==="block"||e==="underline"||e==="bar"}function pu(e,t=5){if(typeof e!="object")return e;let i=Array.isArray(e)?[]:{};for(let n in e)i[n]=t<=1?e[n]:e[n]&&pu(e[n],t-1);return i}function vv(e,t){let i=(e.ctrl?16:0)|(e.shift?4:0)|(e.alt?8:0);return e.button===4?(i|=64,i|=e.action):(i|=e.button&3,e.button&4&&(i|=64),e.button&8&&(i|=128),e.action===32?i|=32:e.action===0&&!t&&(i|=3)),i}function Z6(e,t){let i=0,n=t.length-1,s;if(e<t[0][0]||e>t[n][1])return!1;for(;n>=i;)if(s=i+n>>1,e>t[s][1])i=s+1;else if(e<t[s][0])n=s-1;else return!0;return!1}function YN(e){let t=e.buffer.lines.get(e.buffer.ybase+e.buffer.y-1)?.get(e.cols-1),i=e.buffer.lines.get(e.buffer.ybase+e.buffer.y);i&&t&&(i.isWrapped=t[3]!==0&&t[3]!==32)}function VN(e){if(!e)return;let t=e.toLowerCase();if(t.indexOf("rgb:")===0){t=t.slice(4);let i=a4.exec(t);if(i){let n=i[1]?15:i[4]?255:i[7]?4095:65535;return[Math.round(parseInt(i[1]||i[4]||i[7]||i[10],16)/n*255),Math.round(parseInt(i[2]||i[5]||i[8]||i[11],16)/n*255),Math.round(parseInt(i[3]||i[6]||i[9]||i[12],16)/n*255)]}}else if(t.indexOf("#")===0&&(t=t.slice(1),o4.exec(t)&&[3,6,9,12].includes(t.length))){let i=t.length/3,n=[0,0,0];for(let s=0;s<3;++s){let r=parseInt(t.slice(i*s,i*s+i),16);n[s]=i===1?r<<4:i===2?r:i===3?r>>4:r>>8}return n}}function Sv(e,t){let i=e.toString(16),n=i.length<2?"0"+i:i;switch(t){case 4:return i[0];case 8:return n;case 12:return(n+n).slice(0,3);default:return n+n}}function l4(e,t=16){let[i,n,s]=e;return`rgb:${Sv(i,t)}/${Sv(n,t)}/${Sv(s,t)}`}function ZN(e,t){if(e>24)return t.setWinLines||!1;switch(e){case 1:return!!t.restoreWin;case 2:return!!t.minimizeWin;case 3:return!!t.setWinPosition;case 4:return!!t.setWinSizePixels;case 5:return!!t.raiseWin;case 6:return!!t.lowerWin;case 7:return!!t.refreshWin;case 8:return!!t.setWinSizeChars;case 9:return!!t.maximizeWin;case 10:return!!t.fullscreenWin;case 11:return!!t.getWinState;case 13:return!!t.getWinPosition;case 14:return!!t.getWinSizePixels;case 15:return!!t.getScreenSizePixels;case 16:return!!t.getCellSizePixels;case 18:return!!t.getWinSizeChars;case 19:return!!t.getScreenSizeChars;case 20:return!!t.getIconTitle;case 21:return!!t.getWinTitle;case 22:return!!t.pushTitle;case 23:return!!t.popTitle;case 24:return!!t.setWinLines}return!1}function eA(e){return 0<=e&&e<256}function g4(e,t,i,n){let s={type:0,cancel:!1,key:void 0},r=(e.shiftKey?1:0)|(e.altKey?2:0)|(e.ctrlKey?4:0)|(e.metaKey?8:0);switch(e.keyCode){case 0:e.key==="UIKeyInputUpArrow"?t?s.key=z.ESC+"OA":s.key=z.ESC+"[A":e.key==="UIKeyInputLeftArrow"?t?s.key=z.ESC+"OD":s.key=z.ESC+"[D":e.key==="UIKeyInputRightArrow"?t?s.key=z.ESC+"OC":s.key=z.ESC+"[C":e.key==="UIKeyInputDownArrow"&&(t?s.key=z.ESC+"OB":s.key=z.ESC+"[B");break;case 8:s.key=e.ctrlKey?"\b":z.DEL,e.altKey&&(s.key=z.ESC+s.key);break;case 9:if(e.shiftKey){s.key=z.ESC+"[Z";break}s.key=z.HT,s.cancel=!0;break;case 13:s.key=e.altKey?z.ESC+z.CR:z.CR,s.cancel=!0;break;case 27:s.key=z.ESC,e.altKey&&(s.key=z.ESC+z.ESC),s.cancel=!0;break;case 37:if(e.metaKey)break;r?s.key=z.ESC+"[1;"+(r+1)+"D":t?s.key=z.ESC+"OD":s.key=z.ESC+"[D";break;case 39:if(e.metaKey)break;r?s.key=z.ESC+"[1;"+(r+1)+"C":t?s.key=z.ESC+"OC":s.key=z.ESC+"[C";break;case 38:if(e.metaKey)break;r?s.key=z.ESC+"[1;"+(r+1)+"A":t?s.key=z.ESC+"OA":s.key=z.ESC+"[A";break;case 40:if(e.metaKey)break;r?s.key=z.ESC+"[1;"+(r+1)+"B":t?s.key=z.ESC+"OB":s.key=z.ESC+"[B";break;case 45:!e.shiftKey&&!e.ctrlKey&&(s.key=z.ESC+"[2~");break;case 46:r?s.key=z.ESC+"[3;"+(r+1)+"~":s.key=z.ESC+"[3~";break;case 36:r?s.key=z.ESC+"[1;"+(r+1)+"H":t?s.key=z.ESC+"OH":s.key=z.ESC+"[H";break;case 35:r?s.key=z.ESC+"[1;"+(r+1)+"F":t?s.key=z.ESC+"OF":s.key=z.ESC+"[F";break;case 33:e.shiftKey?s.type=2:e.ctrlKey?s.key=z.ESC+"[5;"+(r+1)+"~":s.key=z.ESC+"[5~";break;case 34:e.shiftKey?s.type=3:e.ctrlKey?s.key=z.ESC+"[6;"+(r+1)+"~":s.key=z.ESC+"[6~";break;case 112:r?s.key=z.ESC+"[1;"+(r+1)+"P":s.key=z.ESC+"OP";break;case 113:r?s.key=z.ESC+"[1;"+(r+1)+"Q":s.key=z.ESC+"OQ";break;case 114:r?s.key=z.ESC+"[1;"+(r+1)+"R":s.key=z.ESC+"OR";break;case 115:r?s.key=z.ESC+"[1;"+(r+1)+"S":s.key=z.ESC+"OS";break;case 116:r?s.key=z.ESC+"[15;"+(r+1)+"~":s.key=z.ESC+"[15~";break;case 117:r?s.key=z.ESC+"[17;"+(r+1)+"~":s.key=z.ESC+"[17~";break;case 118:r?s.key=z.ESC+"[18;"+(r+1)+"~":s.key=z.ESC+"[18~";break;case 119:r?s.key=z.ESC+"[19;"+(r+1)+"~":s.key=z.ESC+"[19~";break;case 120:r?s.key=z.ESC+"[20;"+(r+1)+"~":s.key=z.ESC+"[20~";break;case 121:r?s.key=z.ESC+"[21;"+(r+1)+"~":s.key=z.ESC+"[21~";break;case 122:r?s.key=z.ESC+"[23;"+(r+1)+"~":s.key=z.ESC+"[23~";break;case 123:r?s.key=z.ESC+"[24;"+(r+1)+"~":s.key=z.ESC+"[24~";break;default:if(e.ctrlKey&&!e.shiftKey&&!e.altKey&&!e.metaKey)e.keyCode>=65&&e.keyCode<=90?s.key=String.fromCharCode(e.keyCode-64):e.keyCode===32?s.key=z.NUL:e.keyCode>=51&&e.keyCode<=55?s.key=String.fromCharCode(e.keyCode-51+27):e.keyCode===56?s.key=z.DEL:e.keyCode===219?s.key=z.ESC:e.keyCode===220?s.key=z.FS:e.keyCode===221&&(s.key=z.GS);else if((!i||n)&&e.altKey&&!e.metaKey){let a=m4[e.keyCode]?.[e.shiftKey?1:0];if(a)s.key=z.ESC+a;else if(e.keyCode>=65&&e.keyCode<=90){let o=e.ctrlKey?e.keyCode-64:e.keyCode+32,l=String.fromCharCode(o);e.shiftKey&&(l=l.toUpperCase()),s.key=z.ESC+l}else if(e.keyCode===32)s.key=z.ESC+(e.ctrlKey?z.NUL:" ");else if(e.key==="Dead"&&e.code.startsWith("Key")){let o=e.code.slice(3,4);e.shiftKey||(o=o.toLowerCase()),s.key=z.ESC+o,s.cancel=!0}}else i&&!e.altKey&&!e.ctrlKey&&!e.shiftKey&&e.metaKey?e.keyCode===65&&(s.type=1):e.key&&!e.ctrlKey&&!e.altKey&&!e.metaKey&&e.keyCode>=48&&e.key.length===1?s.key=e.key:e.key&&e.ctrlKey&&(e.key==="_"&&(s.key=z.US),e.key==="@"&&(s.key=z.NUL));break}return s}function w4(e,t){return e.text===t.text&&e.range.start.x===t.range.start.x&&e.range.start.y===t.range.start.y&&e.range.end.x===t.range.end.x&&e.range.end.y===t.range.end.y}function x4(e){return e.keyCode===16||e.keyCode===17||e.keyCode===18}var oA,QI,JI,xt,ne,tN,Ev,iN,xv,sz,rz,uA,Vr,xu,wf,Ln,sN,Cv,ov,Di,pA,Xa,lz,hb,mA,Li,gA,cz,Cu,kv,Rf,er,db,tr,hz,_A,Ol,vA,dz,fz,Tv,mz,rN,Av,vz,Mv,yz,aN,oN,lN,q8,wz,Rv,xz,Ya,Cz,wA,Xr,xe,Ml,pn,Dv,bt,uN,Az,Mz,Oz,hN,Rz,ni,Bv,Dz,dN,CA,Lz,zv,Bz,Iz,zz,mf,Pz,Uz,gf,X,Hz,Pv,fb,W8,G8,Rl,Uv,_f,pb,NA,$8,Y8,vf,Al,Ef,xf,gu,Wz,AA,MA,Gz,$z,Yz,jz,cf,bf,fN,Vz,Zs,Js,fn,OA,Xz,lv,RA,Cs,Zz,cv,Qz,j8,ks,Wr,pN,Jz,e5,t5,V8,X8,Z8,Q8,Gr,J8,mb,uv,mN,gN,i5,Hv,n5,s5,a5,o5,l5,c5,Fv,_N,h5,uu,vN,LA,bN,d5,gb,f5,p5,hv,yN,SN,w5,e9,Yn,t9,i9,n9,xN,s9,r9,E5,a9,o9,x5,CN,T5,Cf,N5,fv,kN,l9,Jt,M5,R5,PA,$n,hu,L5,vb,TN,B5,I5,z5,NN,AN,F5,q5,UA,HA,K5,W5,G5,MN,ON,$5,Gv,Y5,j5,V5,$v,Yv,Z5,Es,$r,su,kf,z,vu,jv,Vv,ei,ti,ii,Et,RN,At,ut,gt,Ci,bu,Q5,Tf,Xv,n6,s6,mv,On,hf,LN,ru,df,a6,Zv,Qv,FA,o6,l6,c6,u6,h6,Jv,f6,qA,Bf,ku,Tu,KA,p6,WA,Nf,g6,_6,GA,yb,$A,YA,v6,b6,Af,y6,eb,S6,A6,gv,M6,O6,R6,D6,L6,tb,IN,zN,Kt,Wa,du,PN,UN,au,B6,ib,I6,z6,P6,U6,nb,H6,HN,Ne,It,ff,_v,fu,ZA,G6,Gt,Ga,FN,qN,$6,JA,eM,sb,Nl,Y6,j6,KN,WN,rb,GN,bv,$N,ab,yv,X6,Wt,Q6,$a,J6,ou,e4,tM,lu,t4,dn,cu,i4,mu,jN,n4,Dn,s4,r4,a4,o4,c4,Yr,XN,QN,JN,u4,lb,h4,tA,d4,f4,cb,iA,p4,m4,Nt,_4,wv,nA,v4,b4,y4,S4,sA,rA,Mf,ub,E4,C4,k4,aA,T4,N4,A4,M4,xs,iM,nM=ce(()=>{oA=Object.defineProperty,QI=Object.getOwnPropertyDescriptor,JI=(e,t)=>{for(var i in t)oA(e,i,{get:t[i],enumerable:!0})},xt=(e,t,i,n)=>{for(var s=n>1?void 0:n?QI(t,i):t,r=e.length-1,a;r>=0;r--)(a=e[r])&&(s=(n?a(t,i,s):a(s))||s);return n&&s&&oA(t,i,s),s},ne=(e,t)=>(i,n)=>t(i,n,e),tN="Terminal input",Ev={get:()=>tN,set:e=>tN=e},iN="Too much output to announce, navigate to rows manually to read",xv={get:()=>iN,set:e=>iN=e};sz=class{constructor(){this._interim=0}clear(){this._interim=0}decode(e,t){let i=e.length;if(!i)return 0;let n=0,s=0;if(this._interim){let r=e.charCodeAt(s++);56320<=r&&r<=57343?t[n++]=(this._interim-55296)*1024+r-56320+65536:(t[n++]=this._interim,t[n++]=r),this._interim=0}for(let r=s;r<i;++r){let a=e.charCodeAt(r);if(55296<=a&&a<=56319){if(++r>=i)return this._interim=a,n;let o=e.charCodeAt(r);56320<=o&&o<=57343?t[n++]=(a-55296)*1024+o-56320+65536:(t[n++]=a,t[n++]=o);continue}a!==65279&&(t[n++]=a)}return n}},rz=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(e,t){let i=e.length;if(!i)return 0;let n=0,s,r,a,o,l=0,c=0;if(this.interim[0]){let d=!1,f=this.interim[0];f&=(f&224)===192?31:(f&240)===224?15:7;let p=0,_;for(;(_=this.interim[++p]&63)&&p<4;)f<<=6,f|=_;let v=(this.interim[0]&224)===192?2:(this.interim[0]&240)===224?3:4,g=v-p;for(;c<g;){if(c>=i)return 0;if(_=e[c++],(_&192)!==128){c--,d=!0;break}else this.interim[p++]=_,f<<=6,f|=_&63}d||(v===2?f<128?c--:t[n++]=f:v===3?f<2048||f>=55296&&f<=57343||f===65279||(t[n++]=f):f<65536||f>1114111||(t[n++]=f)),this.interim.fill(0)}let u=i-4,h=c;for(;h<i;){for(;h<u&&!((s=e[h])&128)&&!((r=e[h+1])&128)&&!((a=e[h+2])&128)&&!((o=e[h+3])&128);)t[n++]=s,t[n++]=r,t[n++]=a,t[n++]=o,h+=4;if(s=e[h++],s<128)t[n++]=s;else if((s&224)===192){if(h>=i)return this.interim[0]=s,n;if(r=e[h++],(r&192)!==128){h--;continue}if(l=(s&31)<<6|r&63,l<128){h--;continue}t[n++]=l}else if((s&240)===224){if(h>=i)return this.interim[0]=s,n;if(r=e[h++],(r&192)!==128){h--;continue}if(h>=i)return this.interim[0]=s,this.interim[1]=r,n;if(a=e[h++],(a&192)!==128){h--;continue}if(l=(s&15)<<12|(r&63)<<6|a&63,l<2048||l>=55296&&l<=57343||l===65279)continue;t[n++]=l}else if((s&248)===240){if(h>=i)return this.interim[0]=s,n;if(r=e[h++],(r&192)!==128){h--;continue}if(h>=i)return this.interim[0]=s,this.interim[1]=r,n;if(a=e[h++],(a&192)!==128){h--;continue}if(h>=i)return this.interim[0]=s,this.interim[1]=r,this.interim[2]=a,n;if(o=e[h++],(o&192)!==128){h--;continue}if(l=(s&7)<<18|(r&63)<<12|(a&63)<<6|o&63,l<65536||l>1114111)continue;t[n++]=l}}return n}},uA="",Vr=" ",xu=class hA{constructor(){this.fg=0,this.bg=0,this.extended=new wf}static toColorRGB(t){return[t>>>16&255,t>>>8&255,t&255]}static fromColorRGB(t){return(t[0]&255)<<16|(t[1]&255)<<8|t[2]&255}clone(){let t=new hA;return t.fg=this.fg,t.bg=this.bg,t.extended=this.extended.clone(),t}isInverse(){return this.fg&67108864}isBold(){return this.fg&134217728}isUnderline(){return this.hasExtendedAttrs()&&this.extended.underlineStyle!==0?1:this.fg&268435456}isBlink(){return this.fg&536870912}isInvisible(){return this.fg&1073741824}isItalic(){return this.bg&67108864}isDim(){return this.bg&134217728}isStrikethrough(){return this.fg&2147483648}isProtected(){return this.bg&536870912}isOverline(){return this.bg&1073741824}getFgColorMode(){return this.fg&50331648}getBgColorMode(){return this.bg&50331648}isFgRGB(){return(this.fg&50331648)===50331648}isBgRGB(){return(this.bg&50331648)===50331648}isFgPalette(){return(this.fg&50331648)===16777216||(this.fg&50331648)===33554432}isBgPalette(){return(this.bg&50331648)===16777216||(this.bg&50331648)===33554432}isFgDefault(){return(this.fg&50331648)===0}isBgDefault(){return(this.bg&50331648)===0}isAttributeDefault(){return this.fg===0&&this.bg===0}getFgColor(){switch(this.fg&50331648){case 16777216:case 33554432:return this.fg&255;case 50331648:return this.fg&16777215;default:return-1}}getBgColor(){switch(this.bg&50331648){case 16777216:case 33554432:return this.bg&255;case 50331648:return this.bg&16777215;default:return-1}}hasExtendedAttrs(){return this.bg&268435456}updateExtended(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456}getUnderlineColor(){if(this.bg&268435456&&~this.extended.underlineColor)switch(this.extended.underlineColor&50331648){case 16777216:case 33554432:return this.extended.underlineColor&255;case 50331648:return this.extended.underlineColor&16777215;default:return this.getFgColor()}return this.getFgColor()}getUnderlineColorMode(){return this.bg&268435456&&~this.extended.underlineColor?this.extended.underlineColor&50331648:this.getFgColorMode()}isUnderlineColorRGB(){return this.bg&268435456&&~this.extended.underlineColor?(this.extended.underlineColor&50331648)===50331648:this.isFgRGB()}isUnderlineColorPalette(){return this.bg&268435456&&~this.extended.underlineColor?(this.extended.underlineColor&50331648)===16777216||(this.extended.underlineColor&50331648)===33554432:this.isFgPalette()}isUnderlineColorDefault(){return this.bg&268435456&&~this.extended.underlineColor?(this.extended.underlineColor&50331648)===0:this.isFgDefault()}getUnderlineStyle(){return this.fg&268435456?this.bg&268435456?this.extended.underlineStyle:1:0}getUnderlineVariantOffset(){return this.extended.underlineVariantOffset}},wf=class dA{constructor(t=0,i=0){this._ext=0,this._urlId=0,this._ext=t,this._urlId=i}get ext(){return this._urlId?this._ext&-469762049|this.underlineStyle<<26:this._ext}set ext(t){this._ext=t}get underlineStyle(){return this._urlId?5:(this._ext&469762048)>>26}set underlineStyle(t){this._ext&=-469762049,this._ext|=t<<26&469762048}get underlineColor(){return this._ext&67108863}set underlineColor(t){this._ext&=-67108864,this._ext|=t&67108863}get urlId(){return this._urlId}set urlId(t){this._urlId=t}get underlineVariantOffset(){let t=(this._ext&3758096384)>>29;return t<0?t^4294967288:t}set underlineVariantOffset(t){this._ext&=536870911,this._ext|=t<<29&3758096384}clone(){return new dA(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}},Ln=class fA extends xu{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new wf,this.combinedData=""}static fromCharData(t){let i=new fA;return i.setFromCharData(t),i}isCombined(){return this.content&2097152}getWidth(){return this.content>>22}getChars(){return this.content&2097152?this.combinedData:this.content&2097151?jr(this.content&2097151):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):this.content&2097151}setFromCharData(t){this.fg=t[0],this.bg=0;let i=!1;if(t[1].length>2)i=!0;else if(t[1].length===2){let n=t[1].charCodeAt(0);if(55296<=n&&n<=56319){let s=t[1].charCodeAt(1);56320<=s&&s<=57343?this.content=(n-55296)*1024+s-56320+65536|t[2]<<22:i=!0}else i=!0}else this.content=t[1].charCodeAt(0)|t[2]<<22;i&&(this.combinedData=t[1],this.content=2097152|t[2]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}},sN="di$target",Cv="di$dependencies",ov=new Map;Di=si("BufferService"),pA=si("CoreMouseService"),Xa=si("CoreService"),lz=si("CharsetService"),hb=si("InstantiationService"),mA=si("LogService"),Li=si("OptionsService"),gA=si("OscLinkService"),cz=si("UnicodeService"),Cu=si("DecorationService"),kv=class{constructor(e,t,i){this._bufferService=e,this._optionsService=t,this._oscLinkService=i}provideLinks(e,t){let i=this._bufferService.buffer.lines.get(e-1);if(!i){t(void 0);return}let n=[],s=this._optionsService.rawOptions.linkHandler,r=new Ln,a=i.getTrimmedLength(),o=-1,l=-1,c=!1;for(let u=0;u<a;u++)if(!(l===-1&&!i.hasContent(u))){if(i.loadCell(u,r),r.hasExtendedAttrs()&&r.extended.urlId)if(l===-1){l=u,o=r.extended.urlId;continue}else c=r.extended.urlId!==o;else l!==-1&&(c=!0);if(c||l!==-1&&u===a-1){let h=this._oscLinkService.getLinkData(o)?.uri;if(h){let d={start:{x:l+1,y:e},end:{x:u+(!c&&u===a-1?1:0),y:e}},f=!1;if(!s?.allowNonHttpProtocols)try{let p=new URL(h);["http:","https:"].includes(p.protocol)||(f=!0)}catch{f=!0}f||n.push({text:h,range:d,activate:(p,_)=>s?s.activate(p,_,d):uz(p,_),hover:(p,_)=>s?.hover?.(p,_,d),leave:(p,_)=>s?.leave?.(p,_,d)})}c=!1,r.hasExtendedAttrs()&&r.extended.urlId?(l=u,o=r.extended.urlId):(l=-1,o=-1)}}t(n)}};kv=xt([ne(0,Di),ne(1,Li),ne(2,gA)],kv);Rf=si("CharSizeService"),er=si("CoreBrowserService"),db=si("MouseService"),tr=si("RenderService"),hz=si("SelectionService"),_A=si("CharacterJoinerService"),Ol=si("ThemeService"),vA=si("LinkProviderService"),dz=class{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(e){setTimeout(()=>{throw e.stack?rN.isErrorNoTelemetry(e)?new rN(e.message+`
92
+
93
+ `+e.stack):new Error(e.message+`
94
+
95
+ `+e.stack):e},0)}}addListener(e){return this.listeners.push(e),()=>{this._removeListener(e)}}emit(e){this.listeners.forEach(t=>{t(e)})}_removeListener(e){this.listeners.splice(this.listeners.indexOf(e),1)}setUnexpectedErrorHandler(e){this.unexpectedErrorHandler=e}getUnexpectedErrorHandler(){return this.unexpectedErrorHandler}onUnexpectedError(e){this.unexpectedErrorHandler(e),this.emit(e)}onUnexpectedExternalError(e){this.unexpectedErrorHandler(e)}},fz=new dz;Tv="Canceled";mz=class extends Error{constructor(){super(Tv),this.name=this.message}};rN=class Nv extends Error{constructor(t){super(t),this.name="CodeExpectedError"}static fromError(t){if(t instanceof Nv)return t;let i=new Nv;return i.message=t.message,i.stack=t.stack,i}static isErrorNoTelemetry(t){return t.name==="CodeExpectedError"}},Av=class bA extends Error{constructor(t){super(t||"An unexpected bug occurred."),Object.setPrototypeOf(this,bA.prototype)}};vz=class yA{constructor(t){this._array=t,this._findLastMonotonousLastIdx=0}findLastMonotonous(t){if(yA.assertInvariants){if(this._prevFindLastPredicate){for(let n of this._array)if(this._prevFindLastPredicate(n)&&!t(n))throw new Error("MonotonousArray: current predicate must be weaker than (or equal to) the previous predicate.")}this._prevFindLastPredicate=t}let i=_z(this._array,t,this._findLastMonotonousLastIdx);return this._findLastMonotonousLastIdx=i+1,i===-1?void 0:this._array[i]}};vz.assertInvariants=!1;(e=>{function t(r){return r<0}e.isLessThan=t;function i(r){return r<=0}e.isLessThanOrEqual=i;function n(r){return r>0}e.isGreaterThan=n;function s(r){return r===0}e.isNeitherLessOrGreaterThan=s,e.greaterThan=1,e.lessThan=-1,e.neitherLessOrGreaterThan=0})(Mv||(Mv={}));yz=(e,t)=>e-t,aN=class Ov{constructor(t){this.iterate=t}forEach(t){this.iterate(i=>(t(i),!0))}toArray(){let t=[];return this.iterate(i=>(t.push(i),!0)),t}filter(t){return new Ov(i=>this.iterate(n=>t(n)?i(n):!0))}map(t){return new Ov(i=>this.iterate(n=>i(t(n))))}some(t){let i=!1;return this.iterate(n=>(i=t(n),!i)),i}findFirst(t){let i;return this.iterate(n=>t(n)?(i=n,!1):!0),i}findLast(t){let i;return this.iterate(n=>(t(n)&&(i=n),!0)),i}findLastMaxBy(t){let i,n=!0;return this.iterate(s=>((n||Mv.isGreaterThan(t(s,i)))&&(n=!1,i=s),!0)),i}};aN.empty=new aN(e=>{});q8=class{constructor(e,t){this.toKey=t,this._map=new Map,this[oN]="SetWithKey";for(let i of e)this.add(i)}get size(){return this._map.size}add(e){let t=this.toKey(e);return this._map.set(t,e),this}delete(e){return this._map.delete(this.toKey(e))}has(e){return this._map.has(this.toKey(e))}*entries(){for(let e of this._map.values())yield[e,e]}keys(){return this.values()}*values(){for(let e of this._map.values())yield e}clear(){this._map.clear()}forEach(e,t){this._map.forEach(i=>e.call(t,i,i,this))}[(lN=Symbol.iterator,oN=Symbol.toStringTag,lN)](){return this.values()}},wz=class{constructor(){this.map=new Map}add(e,t){let i=this.map.get(e);i||(i=new Set,this.map.set(e,i)),i.add(t)}delete(e,t){let i=this.map.get(e);i&&(i.delete(t),i.size===0&&this.map.delete(e))}forEach(e,t){let i=this.map.get(e);i&&i.forEach(t)}get(e){return this.map.get(e)||new Set}};(e=>{function t(S){return S&&typeof S=="object"&&typeof S[Symbol.iterator]=="function"}e.is=t;let i=Object.freeze([]);function n(){return i}e.empty=n;function*s(S){yield S}e.single=s;function r(S){return t(S)?S:s(S)}e.wrap=r;function a(S){return S||i}e.from=a;function*o(S){for(let x=S.length-1;x>=0;x--)yield S[x]}e.reverse=o;function l(S){return!S||S[Symbol.iterator]().next().done===!0}e.isEmpty=l;function c(S){return S[Symbol.iterator]().next().value}e.first=c;function u(S,x){let C=0;for(let N of S)if(x(N,C++))return!0;return!1}e.some=u;function h(S,x){for(let C of S)if(x(C))return C}e.find=h;function*d(S,x){for(let C of S)x(C)&&(yield C)}e.filter=d;function*f(S,x){let C=0;for(let N of S)yield x(N,C++)}e.map=f;function*p(S,x){let C=0;for(let N of S)yield*x(N,C++)}e.flatMap=p;function*_(...S){for(let x of S)yield*x}e.concat=_;function v(S,x,C){let N=C;for(let M of S)N=x(N,M);return N}e.reduce=v;function*g(S,x,C=S.length){for(x<0&&(x+=S.length),C<0?C+=S.length:C>S.length&&(C=S.length);x<C;x++)yield S[x]}e.slice=g;function m(S,x=Number.POSITIVE_INFINITY){let C=[];if(x===0)return[C,S];let N=S[Symbol.iterator]();for(let M=0;M<x;M++){let O=N.next();if(O.done)return[C,e.empty()];C.push(O.value)}return[C,{[Symbol.iterator](){return N}}]}e.consume=m;async function b(S){let x=[];for await(let C of S)x.push(C);return Promise.resolve(x)}e.asyncToArray=b})(Rv||(Rv={}));xz=!1,Ya=null,Cz=class SA{constructor(){this.livingDisposables=new Map}getDisposableData(t){let i=this.livingDisposables.get(t);return i||(i={parent:null,source:null,isSingleton:!1,value:t,idx:SA.idx++},this.livingDisposables.set(t,i)),i}trackDisposable(t){let i=this.getDisposableData(t);i.source||(i.source=new Error().stack)}setParent(t,i){let n=this.getDisposableData(t);n.parent=i}markAsDisposed(t){this.livingDisposables.delete(t)}markAsSingleton(t){this.getDisposableData(t).isSingleton=!0}getRootParent(t,i){let n=i.get(t);if(n)return n;let s=t.parent?this.getRootParent(this.getDisposableData(t.parent),i):t;return i.set(t,s),s}getTrackedDisposables(){let t=new Map;return[...this.livingDisposables.entries()].filter(([,i])=>i.source!==null&&!this.getRootParent(i,t).isSingleton).flatMap(([i])=>i)}computeLeakingDisposables(t=10,i){let n;if(i)n=i;else{let l=new Map,c=[...this.livingDisposables.values()].filter(h=>h.source!==null&&!this.getRootParent(h,l).isSingleton);if(c.length===0)return;let u=new Set(c.map(h=>h.value));if(n=c.filter(h=>!(h.parent&&u.has(h.parent))),n.length===0)throw new Error("There are cyclic diposable chains!")}if(!n)return;function s(l){function c(h,d){for(;h.length>0&&d.some(f=>typeof f=="string"?f===h[0]:h[0].match(f));)h.shift()}let u=l.source.split(`
96
+ `).map(h=>h.trim().replace("at ","")).filter(h=>h!=="");return c(u,["Error",/^trackDisposable \(.*\)$/,/^DisposableTracker.trackDisposable \(.*\)$/]),u.reverse()}let r=new wz;for(let l of n){let c=s(l);for(let u=0;u<=c.length;u++)r.add(c.slice(0,u).join(`
97
+ `),l)}n.sort(bz(l=>l.idx,yz));let a="",o=0;for(let l of n.slice(0,t)){o++;let c=s(l),u=[];for(let h=0;h<c.length;h++){let d=c[h];d=`(shared with ${r.get(c.slice(0,h+1).join(`
98
+ `)).size}/${n.length} leaks) at ${d}`;let f=r.get(c.slice(0,h).join(`
99
+ `)),p=Sz([...f].map(_=>s(_)[h]),_=>_);delete p[c[h]];for(let[_,v]of Object.entries(p))u.unshift(` - stacktraces of ${v.length} other leaks continue with ${_}`);u.unshift(d)}a+=`
100
+
101
+
102
+ ==================== Leaking disposable ${o}/${n.length}: ${l.value.constructor.name} ====================
103
+ ${u.join(`
104
+ `)}
105
+ ============================================================
106
+
107
+ `}return n.length>t&&(a+=`
108
+
109
+
110
+ ... and ${n.length-t} more leaking disposables
111
+
112
+ `),{leaks:n,details:a}}};Cz.idx=0;if(xz){let e="__is_disposable_tracked__";kz(new class{trackDisposable(t){let i=new Error("Potentially leaked disposable").stack;setTimeout(()=>{t[e]||console.log(i)},3e3)}setParent(t,i){if(t&&t!==xe.None)try{t[e]=!0}catch{}}markAsDisposed(t){if(t&&t!==xe.None)try{t[e]=!0}catch{}}markAsSingleton(t){}})}wA=class EA{constructor(){this._toDispose=new Set,this._isDisposed=!1,Df(this)}dispose(){this._isDisposed||(Lf(this),this._isDisposed=!0,this.clear())}get isDisposed(){return this._isDisposed}clear(){if(this._toDispose.size!==0)try{ja(this._toDispose)}finally{this._toDispose.clear()}}add(t){if(!t)return t;if(t===this)throw new Error("Cannot register a disposable on itself!");return yu(t,this),this._isDisposed?EA.DISABLE_DISPOSED_WARNING||console.warn(new Error("Trying to add a disposable to a DisposableStore that has already been disposed of. The added object will be leaked!").stack):this._toDispose.add(t),t}delete(t){if(t){if(t===this)throw new Error("Cannot dispose a disposable on itself!");this._toDispose.delete(t),t.dispose()}}deleteAndLeak(t){t&&this._toDispose.has(t)&&(this._toDispose.delete(t),yu(t,null))}};wA.DISABLE_DISPOSED_WARNING=!1;Xr=wA,xe=class{constructor(){this._store=new Xr,Df(this),yu(this._store,this)}dispose(){Lf(this),this._store.dispose()}_register(e){if(e===this)throw new Error("Cannot register a disposable on itself!");return this._store.add(e)}};xe.None=Object.freeze({dispose(){}});Ml=class{constructor(){this._isDisposed=!1,Df(this)}get value(){return this._isDisposed?void 0:this._value}set value(e){this._isDisposed||e===this._value||(this._value?.dispose(),e&&yu(e,this),this._value=e)}clear(){this.value=void 0}dispose(){this._isDisposed=!0,Lf(this),this._value?.dispose(),this._value=void 0}clearAndLeak(){let e=this._value;return this._value=void 0,e&&yu(e,null),e}},pn=typeof window=="object"?window:globalThis,Dv=class Lv{constructor(t){this.element=t,this.next=Lv.Undefined,this.prev=Lv.Undefined}};Dv.Undefined=new Dv(void 0);bt=Dv,uN=class{constructor(){this._first=bt.Undefined,this._last=bt.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===bt.Undefined}clear(){let e=this._first;for(;e!==bt.Undefined;){let t=e.next;e.prev=bt.Undefined,e.next=bt.Undefined,e=t}this._first=bt.Undefined,this._last=bt.Undefined,this._size=0}unshift(e){return this._insert(e,!1)}push(e){return this._insert(e,!0)}_insert(e,t){let i=new bt(e);if(this._first===bt.Undefined)this._first=i,this._last=i;else if(t){let s=this._last;this._last=i,i.prev=s,s.next=i}else{let s=this._first;this._first=i,i.next=s,s.prev=i}this._size+=1;let n=!1;return()=>{n||(n=!0,this._remove(i))}}shift(){if(this._first!==bt.Undefined){let e=this._first.element;return this._remove(this._first),e}}pop(){if(this._last!==bt.Undefined){let e=this._last.element;return this._remove(this._last),e}}_remove(e){if(e.prev!==bt.Undefined&&e.next!==bt.Undefined){let t=e.prev;t.next=e.next,e.next.prev=t}else e.prev===bt.Undefined&&e.next===bt.Undefined?(this._first=bt.Undefined,this._last=bt.Undefined):e.next===bt.Undefined?(this._last=this._last.prev,this._last.next=bt.Undefined):e.prev===bt.Undefined&&(this._first=this._first.next,this._first.prev=bt.Undefined);this._size-=1}*[Symbol.iterator](){let e=this._first;for(;e!==bt.Undefined;)yield e.element,e=e.next}},Az=globalThis.performance&&typeof globalThis.performance.now=="function",Mz=class xA{static create(t){return new xA(t)}constructor(t){this._now=Az&&t===!1?Date.now:globalThis.performance.now.bind(globalThis.performance),this._startTime=this._now(),this._stopTime=-1}stop(){this._stopTime=this._now()}reset(){this._startTime=this._now(),this._stopTime=-1}elapsed(){return this._stopTime!==-1?this._stopTime-this._startTime:this._now()-this._startTime}},Oz=!1,hN=!1,Rz=!1;(e=>{e.None=()=>xe.None;function t(P){if(Rz){let{onDidAddListener:R}=P,K=zv.create(),T=0;P.onDidAddListener=()=>{++T===2&&(console.warn("snapshotted emitter LIKELY used public and SHOULD HAVE BEEN created with DisposableStore. snapshotted here"),K.print()),R?.()}}}function i(P,R){return d(P,()=>{},0,void 0,!0,void 0,R)}e.defer=i;function n(P){return(R,K=null,T)=>{let D=!1,A;return A=P(Z=>{if(!D)return A?A.dispose():D=!0,R.call(K,Z)},null,T),D&&A.dispose(),A}}e.once=n;function s(P,R,K){return u((T,D=null,A)=>P(Z=>T.call(D,R(Z)),null,A),K)}e.map=s;function r(P,R,K){return u((T,D=null,A)=>P(Z=>{R(Z),T.call(D,Z)},null,A),K)}e.forEach=r;function a(P,R,K){return u((T,D=null,A)=>P(Z=>R(Z)&&T.call(D,Z),null,A),K)}e.filter=a;function o(P){return P}e.signal=o;function l(...P){return(R,K=null,T)=>{let D=Nz(...P.map(A=>A(Z=>R.call(K,Z))));return h(D,T)}}e.any=l;function c(P,R,K,T){let D=K;return s(P,A=>(D=R(D,A),D),T)}e.reduce=c;function u(P,R){let K,T={onWillAddFirstListener(){K=P(D.fire,D)},onDidRemoveLastListener(){K?.dispose()}};R||t(T);let D=new X(T);return R?.add(D),D.event}function h(P,R){return R instanceof Array?R.push(P):R&&R.add(P),P}function d(P,R,K=100,T=!1,D=!1,A,Z){let re,L,ee,Ce=0,ue,Ue={leakWarningThreshold:A,onWillAddFirstListener(){re=P(Oe=>{Ce++,L=R(L,Oe),T&&!ee&&(Q.fire(L),L=void 0),ue=()=>{let _i=L;L=void 0,ee=void 0,(!T||Ce>1)&&Q.fire(_i),Ce=0},typeof K=="number"?(clearTimeout(ee),ee=setTimeout(ue,K)):ee===void 0&&(ee=0,queueMicrotask(ue))})},onWillRemoveListener(){D&&Ce>0&&ue?.()},onDidRemoveLastListener(){ue=void 0,re.dispose()}};Z||t(Ue);let Q=new X(Ue);return Z?.add(Q),Q.event}e.debounce=d;function f(P,R=0,K){return e.debounce(P,(T,D)=>T?(T.push(D),T):[D],R,void 0,!0,void 0,K)}e.accumulate=f;function p(P,R=(T,D)=>T===D,K){let T=!0,D;return a(P,A=>{let Z=T||!R(A,D);return T=!1,D=A,Z},K)}e.latch=p;function _(P,R,K){return[e.filter(P,R,K),e.filter(P,T=>!R(T),K)]}e.split=_;function v(P,R=!1,K=[],T){let D=K.slice(),A=P(L=>{D?D.push(L):re.fire(L)});T&&T.add(A);let Z=()=>{D?.forEach(L=>re.fire(L)),D=null},re=new X({onWillAddFirstListener(){A||(A=P(L=>re.fire(L)),T&&T.add(A))},onDidAddFirstListener(){D&&(R?setTimeout(Z):Z())},onDidRemoveLastListener(){A&&A.dispose(),A=null}});return T&&T.add(re),re.event}e.buffer=v;function g(P,R){return(K,T,D)=>{let A=R(new b);return P(function(Z){let re=A.evaluate(Z);re!==m&&K.call(T,re)},void 0,D)}}e.chain=g;let m=Symbol("HaltChainable");class b{constructor(){this.steps=[]}map(R){return this.steps.push(R),this}forEach(R){return this.steps.push(K=>(R(K),K)),this}filter(R){return this.steps.push(K=>R(K)?K:m),this}reduce(R,K){let T=K;return this.steps.push(D=>(T=R(T,D),T)),this}latch(R=(K,T)=>K===T){let K=!0,T;return this.steps.push(D=>{let A=K||!R(D,T);return K=!1,T=D,A?D:m}),this}evaluate(R){for(let K of this.steps)if(R=K(R),R===m)break;return R}}function S(P,R,K=T=>T){let T=(...re)=>Z.fire(K(...re)),D=()=>P.on(R,T),A=()=>P.removeListener(R,T),Z=new X({onWillAddFirstListener:D,onDidRemoveLastListener:A});return Z.event}e.fromNodeEventEmitter=S;function x(P,R,K=T=>T){let T=(...re)=>Z.fire(K(...re)),D=()=>P.addEventListener(R,T),A=()=>P.removeEventListener(R,T),Z=new X({onWillAddFirstListener:D,onDidRemoveLastListener:A});return Z.event}e.fromDOMEventEmitter=x;function C(P){return new Promise(R=>n(P)(R))}e.toPromise=C;function N(P){let R=new X;return P.then(K=>{R.fire(K)},()=>{R.fire(void 0)}).finally(()=>{R.dispose()}),R.event}e.fromPromise=N;function M(P,R){return P(K=>R.fire(K))}e.forward=M;function O(P,R,K){return R(K),P(T=>R(T))}e.runAndSubscribe=O;class q{constructor(R,K){this._observable=R,this._counter=0,this._hasChanged=!1;let T={onWillAddFirstListener:()=>{R.addObserver(this)},onDidRemoveLastListener:()=>{R.removeObserver(this)}};K||t(T),this.emitter=new X(T),K&&K.add(this.emitter)}beginUpdate(R){this._counter++}handlePossibleChange(R){}handleChange(R,K){this._hasChanged=!0}endUpdate(R){this._counter--,this._counter===0&&(this._observable.reportChanges(),this._hasChanged&&(this._hasChanged=!1,this.emitter.fire(this._observable.get())))}}function G(P,R){return new q(P,R).emitter.event}e.fromObservable=G;function I(P){return(R,K,T)=>{let D=0,A=!1,Z={beginUpdate(){D++},endUpdate(){D--,D===0&&(P.reportChanges(),A&&(A=!1,R.call(K)))},handlePossibleChange(){},handleChange(){A=!0}};P.addObserver(Z),P.reportChanges();let re={dispose(){P.removeObserver(Z)}};return T instanceof Xr?T.add(re):Array.isArray(T)&&T.push(re),re}}e.fromObservableLight=I})(ni||(ni={}));Bv=class Iv{constructor(t){this.listenerCount=0,this.invocationCount=0,this.elapsedOverall=0,this.durations=[],this.name=`${t}_${Iv._idPool++}`,Iv.all.add(this)}start(t){this._stopWatch=new Mz,this.listenerCount=t}stop(){if(this._stopWatch){let t=this._stopWatch.elapsed();this.durations.push(t),this.elapsedOverall+=t,this.invocationCount+=1,this._stopWatch=void 0}}};Bv.all=new Set,Bv._idPool=0;Dz=Bv,dN=-1,CA=class kA{constructor(t,i,n=(kA._idPool++).toString(16).padStart(3,"0")){this._errorHandler=t,this.threshold=i,this.name=n,this._warnCountdown=0}dispose(){this._stacks?.clear()}check(t,i){let n=this.threshold;if(n<=0||i<n)return;this._stacks||(this._stacks=new Map);let s=this._stacks.get(t.value)||0;if(this._stacks.set(t.value,s+1),this._warnCountdown-=1,this._warnCountdown<=0){this._warnCountdown=n*.5;let[r,a]=this.getMostFrequentStack(),o=`[${this.name}] potential listener LEAK detected, having ${i} listeners already. MOST frequent listener (${a}):`;console.warn(o),console.warn(r);let l=new Bz(o,r);this._errorHandler(l)}return()=>{let r=this._stacks.get(t.value)||0;this._stacks.set(t.value,r-1)}}getMostFrequentStack(){if(!this._stacks)return;let t,i=0;for(let[n,s]of this._stacks)(!t||i<s)&&(t=[n,s],i=s);return t}};CA._idPool=1;Lz=CA,zv=class TA{constructor(t){this.value=t}static create(){let t=new Error;return new TA(t.stack??"")}print(){console.warn(this.value.split(`
113
+ `).slice(2).join(`
114
+ `))}},Bz=class extends Error{constructor(e,t){super(e),this.name="ListenerLeakError",this.stack=t}},Iz=class extends Error{constructor(e,t){super(e),this.name="ListenerRefusalError",this.stack=t}},zz=0,mf=class{constructor(e){this.value=e,this.id=zz++}},Pz=2,Uz=(e,t)=>{if(e instanceof mf)t(e);else for(let i=0;i<e.length;i++){let n=e[i];n&&t(n)}};if(Oz){let e=[];setInterval(()=>{e.length!==0&&(console.warn("[LEAKING LISTENERS] GC'ed these listeners that were NOT yet disposed:"),console.warn(e.join(`
115
+ `)),e.length=0)},3e3),gf=new FinalizationRegistry(t=>{typeof t=="string"&&e.push(t)})}X=class{constructor(e){this._size=0,this._options=e,this._leakageMon=dN>0||this._options?.leakWarningThreshold?new Lz(e?.onListenerError??pf,this._options?.leakWarningThreshold??dN):void 0,this._perfMon=this._options?._profName?new Dz(this._options._profName):void 0,this._deliveryQueue=this._options?.deliveryQueue}dispose(){if(!this._disposed){if(this._disposed=!0,this._deliveryQueue?.current===this&&this._deliveryQueue.reset(),this._listeners){if(hN){let e=this._listeners;queueMicrotask(()=>{Uz(e,t=>t.stack?.print())})}this._listeners=void 0,this._size=0}this._options?.onDidRemoveLastListener?.(),this._leakageMon?.dispose()}}get event(){return this._event??(this._event=(e,t,i)=>{if(this._leakageMon&&this._size>this._leakageMon.threshold**2){let o=`[${this._leakageMon.name}] REFUSES to accept new listeners because it exceeded its threshold by far (${this._size} vs ${this._leakageMon.threshold})`;console.warn(o);let l=this._leakageMon.getMostFrequentStack()??["UNKNOWN stack",-1],c=new Iz(`${o}. HINT: Stack shows most frequent listener (${l[1]}-times)`,l[0]);return(this._options?.onListenerError||pf)(c),xe.None}if(this._disposed)return xe.None;t&&(e=e.bind(t));let n=new mf(e),s,r;this._leakageMon&&this._size>=Math.ceil(this._leakageMon.threshold*.2)&&(n.stack=zv.create(),s=this._leakageMon.check(n.stack,this._size+1)),hN&&(n.stack=r??zv.create()),this._listeners?this._listeners instanceof mf?(this._deliveryQueue??(this._deliveryQueue=new Hz),this._listeners=[this._listeners,n]):this._listeners.push(n):(this._options?.onWillAddFirstListener?.(this),this._listeners=n,this._options?.onDidAddFirstListener?.(this)),this._size++;let a=dt(()=>{gf?.unregister(a),s?.(),this._removeListener(n)});if(i instanceof Xr?i.add(a):Array.isArray(i)&&i.push(a),gf){let o=new Error().stack.split(`
116
+ `).slice(2,3).join(`
117
+ `).trim(),l=/(file:|vscode-file:\/\/vscode-app)?(\/[^:]*:\d+:\d+)/.exec(o);gf.register(a,l?.[2]??o,a)}return a}),this._event}_removeListener(e){if(this._options?.onWillRemoveListener?.(this),!this._listeners)return;if(this._size===1){this._listeners=void 0,this._options?.onDidRemoveLastListener?.(this),this._size=0;return}let t=this._listeners,i=t.indexOf(e);if(i===-1)throw console.log("disposed?",this._disposed),console.log("size?",this._size),console.log("arr?",JSON.stringify(this._listeners)),new Error("Attempted to dispose unknown listener");this._size--,t[i]=void 0;let n=this._deliveryQueue.current===this;if(this._size*Pz<=t.length){let s=0;for(let r=0;r<t.length;r++)t[r]?t[s++]=t[r]:n&&(this._deliveryQueue.end--,s<this._deliveryQueue.i&&this._deliveryQueue.i--);t.length=s}}_deliver(e,t){if(!e)return;let i=this._options?.onListenerError||pf;if(!i){e.value(t);return}try{e.value(t)}catch(n){i(n)}}_deliverQueue(e){let t=e.current._listeners;for(;e.i<e.end;)this._deliver(t[e.i++],e.value);e.reset()}fire(e){if(this._deliveryQueue?.current&&(this._deliverQueue(this._deliveryQueue),this._perfMon?.stop()),this._perfMon?.start(this._size),this._listeners)if(this._listeners instanceof mf)this._deliver(this._listeners,e);else{let t=this._deliveryQueue;t.enqueue(this,e,this._listeners.length),this._deliverQueue(t)}this._perfMon?.stop()}hasListeners(){return this._size>0}},Hz=class{constructor(){this.i=-1,this.end=0}enqueue(e,t,i){this.i=0,this.end=i,this.current=e,this.value=t}reset(){this.i=this.end,this.current=void 0,this.value=void 0}},Pv=class{constructor(){this.mapWindowIdToZoomLevel=new Map,this._onDidChangeZoomLevel=new X,this.onDidChangeZoomLevel=this._onDidChangeZoomLevel.event,this.mapWindowIdToZoomFactor=new Map,this._onDidChangeFullscreen=new X,this.onDidChangeFullscreen=this._onDidChangeFullscreen.event,this.mapWindowIdToFullScreen=new Map}getZoomLevel(t){return this.mapWindowIdToZoomLevel.get(this.getWindowId(t))??0}setZoomLevel(t,i){if(this.getZoomLevel(i)===t)return;let n=this.getWindowId(i);this.mapWindowIdToZoomLevel.set(n,t),this._onDidChangeZoomLevel.fire(n)}getZoomFactor(t){return this.mapWindowIdToZoomFactor.get(this.getWindowId(t))??1}setZoomFactor(t,i){this.mapWindowIdToZoomFactor.set(this.getWindowId(i),t)}setFullscreen(t,i){if(this.isFullscreen(i)===t)return;let n=this.getWindowId(i);this.mapWindowIdToFullScreen.set(n,t),this._onDidChangeFullscreen.fire(n)}isFullscreen(t){return!!this.mapWindowIdToFullScreen.get(this.getWindowId(t))}getWindowId(t){return t.vscodeWindowId}};Pv.INSTANCE=new Pv;fb=Pv;W8=fb.INSTANCE.onDidChangeZoomLevel;G8=fb.INSTANCE.onDidChangeFullscreen,Rl=typeof navigator=="object"?navigator.userAgent:"",Uv=Rl.indexOf("Firefox")>=0,_f=Rl.indexOf("AppleWebKit")>=0,pb=Rl.indexOf("Chrome")>=0,NA=!pb&&Rl.indexOf("Safari")>=0,$8=Rl.indexOf("Electron/")>=0,Y8=Rl.indexOf("Android")>=0,vf=!1;if(typeof pn.matchMedia=="function"){let e=pn.matchMedia("(display-mode: standalone) or (display-mode: window-controls-overlay)"),t=pn.matchMedia("(display-mode: fullscreen)");vf=e.matches,Fz(pn,e,({matches:i})=>{vf&&t.matches||(vf=i)})}Al="en",Ef=!1,xf=!1,gu=!1,Wz=!1,AA=!1,MA=!1,Gz=!1,$z=!1,Yz=!1,jz=!1,bf=Al,fN=Al,Js=globalThis;typeof Js.vscode<"u"&&typeof Js.vscode.process<"u"?fn=Js.vscode.process:typeof process<"u"&&typeof process?.versions?.node=="string"&&(fn=process);OA=typeof fn?.versions?.electron=="string",Xz=OA&&fn?.type==="renderer";if(typeof fn=="object"){Ef=fn.platform==="win32",xf=fn.platform==="darwin",gu=fn.platform==="linux",Wz=gu&&!!fn.env.SNAP&&!!fn.env.SNAP_REVISION,Gz=OA,Yz=!!fn.env.CI||!!fn.env.BUILD_ARTIFACTSTAGINGDIRECTORY,cf=Al,bf=Al;let e=fn.env.VSCODE_NLS_CONFIG;if(e)try{let t=JSON.parse(e);cf=t.userLocale,fN=t.osLocale,bf=t.resolvedLanguage||Al,Vz=t.languagePack?.translationsConfigFile}catch{}AA=!0}else typeof navigator=="object"&&!Xz?(Zs=navigator.userAgent,Ef=Zs.indexOf("Windows")>=0,xf=Zs.indexOf("Macintosh")>=0,$z=(Zs.indexOf("Macintosh")>=0||Zs.indexOf("iPad")>=0||Zs.indexOf("iPhone")>=0)&&!!navigator.maxTouchPoints&&navigator.maxTouchPoints>0,gu=Zs.indexOf("Linux")>=0,jz=Zs?.indexOf("Mobi")>=0,MA=!0,bf=globalThis._VSCODE_NLS_LANGUAGE||Al,cf=navigator.language.toLowerCase(),fN=cf):console.error("Unable to resolve platform.");lv=0;xf?lv=1:Ef?lv=3:gu&&(lv=2);RA=Ef,Cs=xf,Zz=gu,cv=AA,Qz=MA&&typeof Js.importScripts=="function",j8=Qz?Js.origin:void 0,ks=Zs,Wr=bf;(e=>{function t(){return Wr}e.value=t;function i(){return Wr.length===2?Wr==="en":Wr.length>=3?Wr[0]==="e"&&Wr[1]==="n"&&Wr[2]==="-":!1}e.isDefaultVariant=i;function n(){return Wr==="en"}e.isDefault=n})(pN||(pN={}));Jz=typeof Js.postMessage=="function"&&!Js.importScripts,e5=(()=>{if(Jz){let e=[];Js.addEventListener("message",i=>{if(i.data&&i.data.vscodeScheduleAsyncWork)for(let n=0,s=e.length;n<s;n++){let r=e[n];if(r.id===i.data.vscodeScheduleAsyncWork){e.splice(n,1),r.callback();return}}});let t=0;return i=>{let n=++t;e.push({id:n,callback:i}),Js.postMessage({vscodeScheduleAsyncWork:n},"*")}}return e=>setTimeout(e)})(),t5=!!(ks&&ks.indexOf("Chrome")>=0),V8=!!(ks&&ks.indexOf("Firefox")>=0),X8=!!(!t5&&ks&&ks.indexOf("Safari")>=0),Z8=!!(ks&&ks.indexOf("Edg/")>=0),Q8=!!(ks&&ks.indexOf("Android")>=0),Gr=typeof navigator=="object"?navigator:{},J8={clipboard:{writeText:cv||document.queryCommandSupported&&document.queryCommandSupported("copy")||!!(Gr&&Gr.clipboard&&Gr.clipboard.writeText),readText:cv||!!(Gr&&Gr.clipboard&&Gr.clipboard.readText)},keyboard:cv||Kz()?0:Gr.keyboard||NA?1:2,touch:"ontouchstart"in pn||Gr.maxTouchPoints>0,pointerEvents:pn.PointerEvent&&("ontouchstart"in pn||navigator.maxTouchPoints>0)},mb=class{constructor(){this._keyCodeToStr=[],this._strToKeyCode=Object.create(null)}define(e,t){this._keyCodeToStr[e]=t,this._strToKeyCode[t.toLowerCase()]=e}keyCodeToStr(e){return this._keyCodeToStr[e]}strToKeyCode(e){return this._strToKeyCode[e.toLowerCase()]||0}},uv=new mb,mN=new mb,gN=new mb,i5=new Array(230);(e=>{function t(o){return uv.keyCodeToStr(o)}e.toString=t;function i(o){return uv.strToKeyCode(o)}e.fromString=i;function n(o){return mN.keyCodeToStr(o)}e.toUserSettingsUS=n;function s(o){return gN.keyCodeToStr(o)}e.toUserSettingsGeneral=s;function r(o){return mN.strToKeyCode(o)||gN.strToKeyCode(o)}e.fromUserSettings=r;function a(o){if(o>=98&&o<=113)return null;switch(o){case 16:return"Up";case 18:return"Down";case 15:return"Left";case 17:return"Right"}return uv.keyCodeToStr(o)}e.toElectronAccelerator=a})(Hv||(Hv={}));n5=class DA{constructor(t,i,n,s,r){this.ctrlKey=t,this.shiftKey=i,this.altKey=n,this.metaKey=s,this.keyCode=r}equals(t){return t instanceof DA&&this.ctrlKey===t.ctrlKey&&this.shiftKey===t.shiftKey&&this.altKey===t.altKey&&this.metaKey===t.metaKey&&this.keyCode===t.keyCode}getHashCode(){let t=this.ctrlKey?"1":"0",i=this.shiftKey?"1":"0",n=this.altKey?"1":"0",s=this.metaKey?"1":"0";return`K${t}${i}${n}${s}${this.keyCode}`}isModifierKey(){return this.keyCode===0||this.keyCode===5||this.keyCode===57||this.keyCode===6||this.keyCode===4}toKeybinding(){return new s5([this])}isDuplicateModifierCase(){return this.ctrlKey&&this.keyCode===5||this.shiftKey&&this.keyCode===4||this.altKey&&this.keyCode===6||this.metaKey&&this.keyCode===57}},s5=class{constructor(e){if(e.length===0)throw gz("chords");this.chords=e}getHashCode(){let e="";for(let t=0,i=this.chords.length;t<i;t++)t!==0&&(e+=";"),e+=this.chords[t].getHashCode();return e}equals(e){if(e===null||this.chords.length!==e.chords.length)return!1;for(let t=0;t<this.chords.length;t++)if(!this.chords[t].equals(e.chords[t]))return!1;return!0}};a5=Cs?256:2048,o5=512,l5=1024,c5=Cs?2048:256,Fv=class{constructor(e){this._standardKeyboardEventBrand=!0;let t=e;this.browserEvent=t,this.target=t.target,this.ctrlKey=t.ctrlKey,this.shiftKey=t.shiftKey,this.altKey=t.altKey,this.metaKey=t.metaKey,this.altGraphKey=t.getModifierState?.("AltGraph"),this.keyCode=r5(t),this.code=t.code,this.ctrlKey=this.ctrlKey||this.keyCode===5,this.altKey=this.altKey||this.keyCode===6,this.shiftKey=this.shiftKey||this.keyCode===4,this.metaKey=this.metaKey||this.keyCode===57,this._asKeybinding=this._computeKeybinding(),this._asKeyCodeChord=this._computeKeyCodeChord()}preventDefault(){this.browserEvent&&this.browserEvent.preventDefault&&this.browserEvent.preventDefault()}stopPropagation(){this.browserEvent&&this.browserEvent.stopPropagation&&this.browserEvent.stopPropagation()}toKeyCodeChord(){return this._asKeyCodeChord}equals(e){return this._asKeybinding===e}_computeKeybinding(){let e=0;this.keyCode!==5&&this.keyCode!==4&&this.keyCode!==6&&this.keyCode!==57&&(e=this.keyCode);let t=0;return this.ctrlKey&&(t|=a5),this.altKey&&(t|=o5),this.shiftKey&&(t|=l5),this.metaKey&&(t|=c5),t|=e,t}_computeKeyCodeChord(){let e=0;return this.keyCode!==5&&this.keyCode!==4&&this.keyCode!==6&&this.keyCode!==57&&(e=this.keyCode),new n5(this.ctrlKey,this.shiftKey,this.altKey,this.metaKey,e)}},_N=new WeakMap;h5=class{static getSameOriginWindowChain(e){let t=_N.get(e);if(!t){t=[],_N.set(e,t);let i=e,n;do n=u5(i),n?t.push({window:new WeakRef(i),iframeElement:i.frameElement||null}):t.push({window:new WeakRef(i),iframeElement:null}),i=n;while(i)}return t.slice(0)}static getPositionOfChildWindowRelativeToAncestorWindow(e,t){if(!t||e===t)return{top:0,left:0};let i=0,n=0,s=this.getSameOriginWindowChain(e);for(let r of s){let a=r.window.deref();if(i+=a?.scrollY??0,n+=a?.scrollX??0,a===t||!r.iframeElement)break;let o=r.iframeElement.getBoundingClientRect();i+=o.top,n+=o.left}return{top:i,left:n}}},uu=class{constructor(e,t){this.timestamp=Date.now(),this.browserEvent=t,this.leftButton=t.button===0,this.middleButton=t.button===1,this.rightButton=t.button===2,this.buttons=t.buttons,this.target=t.target,this.detail=t.detail||1,t.type==="dblclick"&&(this.detail=2),this.ctrlKey=t.ctrlKey,this.shiftKey=t.shiftKey,this.altKey=t.altKey,this.metaKey=t.metaKey,typeof t.pageX=="number"?(this.posx=t.pageX,this.posy=t.pageY):(this.posx=t.clientX+this.target.ownerDocument.body.scrollLeft+this.target.ownerDocument.documentElement.scrollLeft,this.posy=t.clientY+this.target.ownerDocument.body.scrollTop+this.target.ownerDocument.documentElement.scrollTop);let i=h5.getPositionOfChildWindowRelativeToAncestorWindow(e,t.view);this.posx-=i.left,this.posy-=i.top}preventDefault(){this.browserEvent.preventDefault()}stopPropagation(){this.browserEvent.stopPropagation()}},vN=class{constructor(e,t=0,i=0){this.browserEvent=e||null,this.target=e?e.target||e.targetNode||e.srcElement:null,this.deltaY=i,this.deltaX=t;let n=!1;if(pb){let s=navigator.userAgent.match(/Chrome\/(\d+)/);n=(s?parseInt(s[1]):123)<=122}if(e){let s=e,r=e,a=e.view?.devicePixelRatio||1;if(typeof s.wheelDeltaY<"u")n?this.deltaY=s.wheelDeltaY/(120*a):this.deltaY=s.wheelDeltaY/120;else if(typeof r.VERTICAL_AXIS<"u"&&r.axis===r.VERTICAL_AXIS)this.deltaY=-r.detail/3;else if(e.type==="wheel"){let o=e;o.deltaMode===o.DOM_DELTA_LINE?Uv&&!Cs?this.deltaY=-e.deltaY/3:this.deltaY=-e.deltaY:this.deltaY=-e.deltaY/40}if(typeof s.wheelDeltaX<"u")NA&&RA?this.deltaX=-(s.wheelDeltaX/120):n?this.deltaX=s.wheelDeltaX/(120*a):this.deltaX=s.wheelDeltaX/120;else if(typeof r.HORIZONTAL_AXIS<"u"&&r.axis===r.HORIZONTAL_AXIS)this.deltaX=-e.detail/3;else if(e.type==="wheel"){let o=e;o.deltaMode===o.DOM_DELTA_LINE?Uv&&!Cs?this.deltaX=-e.deltaX/3:this.deltaX=-e.deltaX:this.deltaX=-e.deltaX/40}this.deltaY===0&&this.deltaX===0&&e.wheelDelta&&(n?this.deltaY=e.wheelDelta/(120*a):this.deltaY=e.wheelDelta/120)}}preventDefault(){this.browserEvent?.preventDefault()}stopPropagation(){this.browserEvent?.stopPropagation()}},LA=Object.freeze(function(e,t){let i=setTimeout(e.bind(t),0);return{dispose(){clearTimeout(i)}}});(e=>{function t(i){return i===e.None||i===e.Cancelled||i instanceof d5?!0:!i||typeof i!="object"?!1:typeof i.isCancellationRequested=="boolean"&&typeof i.onCancellationRequested=="function"}e.isCancellationToken=t,e.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:ni.None}),e.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:LA})})(bN||(bN={}));d5=class{constructor(){this._isCancelled=!1,this._emitter=null}cancel(){this._isCancelled||(this._isCancelled=!0,this._emitter&&(this._emitter.fire(void 0),this.dispose()))}get isCancellationRequested(){return this._isCancelled}get onCancellationRequested(){return this._isCancelled?LA:(this._emitter||(this._emitter=new X),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=null)}},gb=class{constructor(e,t){this._isDisposed=!1,this._token=-1,typeof e=="function"&&typeof t=="number"&&this.setIfNotSet(e,t)}dispose(){this.cancel(),this._isDisposed=!0}cancel(){this._token!==-1&&(clearTimeout(this._token),this._token=-1)}cancelAndSet(e,t){if(this._isDisposed)throw new Av("Calling 'cancelAndSet' on a disposed TimeoutTimer");this.cancel(),this._token=setTimeout(()=>{this._token=-1,e()},t)}setIfNotSet(e,t){if(this._isDisposed)throw new Av("Calling 'setIfNotSet' on a disposed TimeoutTimer");this._token===-1&&(this._token=setTimeout(()=>{this._token=-1,e()},t))}},f5=class{constructor(){this.disposable=void 0,this.isDisposed=!1}cancel(){this.disposable?.dispose(),this.disposable=void 0}cancelAndSet(e,t,i=globalThis){if(this.isDisposed)throw new Av("Calling 'cancelAndSet' on a disposed IntervalTimer");this.cancel();let n=i.setInterval(()=>{e()},t);this.disposable=dt(()=>{i.clearInterval(n),this.disposable=void 0})}dispose(){this.cancel(),this.isDisposed=!0}};(function(){typeof globalThis.requestIdleCallback!="function"||typeof globalThis.cancelIdleCallback!="function"?hv=(e,t)=>{e5(()=>{if(i)return;let n=Date.now()+15;t(Object.freeze({didTimeout:!0,timeRemaining(){return Math.max(0,n-Date.now())}}))});let i=!1;return{dispose(){i||(i=!0)}}}:hv=(e,t,i)=>{let n=e.requestIdleCallback(t,typeof i=="number"?{timeout:i}:void 0),s=!1;return{dispose(){s||(s=!0,e.cancelIdleCallback(n))}}},p5=e=>hv(globalThis,e)})();(e=>{async function t(n){let s,r=await Promise.all(n.map(a=>a.then(o=>o,o=>{s||(s=o)})));if(typeof s<"u")throw s;return r}e.settled=t;function i(n){return new Promise(async(s,r)=>{try{await n(s,r)}catch(a){r(a)}})}e.withAsyncBody=i})(yN||(yN={}));SN=class Rn{static fromArray(t){return new Rn(i=>{i.emitMany(t)})}static fromPromise(t){return new Rn(async i=>{i.emitMany(await t)})}static fromPromises(t){return new Rn(async i=>{await Promise.all(t.map(async n=>i.emitOne(await n)))})}static merge(t){return new Rn(async i=>{await Promise.all(t.map(async n=>{for await(let s of n)i.emitOne(s)}))})}constructor(t,i){this._state=0,this._results=[],this._error=null,this._onReturn=i,this._onStateChanged=new X,queueMicrotask(async()=>{let n={emitOne:s=>this.emitOne(s),emitMany:s=>this.emitMany(s),reject:s=>this.reject(s)};try{await Promise.resolve(t(n)),this.resolve()}catch(s){this.reject(s)}finally{n.emitOne=void 0,n.emitMany=void 0,n.reject=void 0}})}[Symbol.asyncIterator](){let t=0;return{next:async()=>{do{if(this._state===2)throw this._error;if(t<this._results.length)return{done:!1,value:this._results[t++]};if(this._state===1)return{done:!0,value:void 0};await ni.toPromise(this._onStateChanged.event)}while(!0)},return:async()=>(this._onReturn?.(),{done:!0,value:void 0})}}static map(t,i){return new Rn(async n=>{for await(let s of t)n.emitOne(i(s))})}map(t){return Rn.map(this,t)}static filter(t,i){return new Rn(async n=>{for await(let s of t)i(s)&&n.emitOne(s)})}filter(t){return Rn.filter(this,t)}static coalesce(t){return Rn.filter(t,i=>!!i)}coalesce(){return Rn.coalesce(this)}static async toPromise(t){let i=[];for await(let n of t)i.push(n);return i}toPromise(){return Rn.toPromise(this)}emitOne(t){this._state===0&&(this._results.push(t),this._onStateChanged.fire())}emitMany(t){this._state===0&&(this._results=this._results.concat(t),this._onStateChanged.fire())}resolve(){this._state===0&&(this._state=1,this._onStateChanged.fire())}reject(t){this._state===0&&(this._state=2,this._error=t,this._onStateChanged.fire())}};SN.EMPTY=SN.fromArray([]);w5=class IA{constructor(){this._h0=1732584193,this._h1=4023233417,this._h2=2562383102,this._h3=271733878,this._h4=3285377520,this._buff=new Uint8Array(67),this._buffDV=new DataView(this._buff.buffer),this._buffLen=0,this._totalLen=0,this._leftoverHighSurrogate=0,this._finished=!1}update(t){let i=t.length;if(i===0)return;let n=this._buff,s=this._buffLen,r=this._leftoverHighSurrogate,a,o;for(r!==0?(a=r,o=-1,r=0):(a=t.charCodeAt(0),o=0);;){let l=a;if(m5(a))if(o+1<i){let c=t.charCodeAt(o+1);wN(c)?(o++,l=g5(a,c)):l=65533}else{r=a;break}else wN(a)&&(l=65533);if(s=this._push(n,s,l),o++,o<i)a=t.charCodeAt(o);else break}this._buffLen=s,this._leftoverHighSurrogate=r}_push(t,i,n){return n<128?t[i++]=n:n<2048?(t[i++]=192|(n&1984)>>>6,t[i++]=128|(n&63)>>>0):n<65536?(t[i++]=224|(n&61440)>>>12,t[i++]=128|(n&4032)>>>6,t[i++]=128|(n&63)>>>0):(t[i++]=240|(n&1835008)>>>18,t[i++]=128|(n&258048)>>>12,t[i++]=128|(n&4032)>>>6,t[i++]=128|(n&63)>>>0),i>=64&&(this._step(),i-=64,this._totalLen+=64,t[0]=t[64],t[1]=t[65],t[2]=t[66]),i}digest(){return this._finished||(this._finished=!0,this._leftoverHighSurrogate&&(this._leftoverHighSurrogate=0,this._buffLen=this._push(this._buff,this._buffLen,65533)),this._totalLen+=this._buffLen,this._wrapUp()),nu(this._h0)+nu(this._h1)+nu(this._h2)+nu(this._h3)+nu(this._h4)}_wrapUp(){this._buff[this._buffLen++]=128,EN(this._buff,this._buffLen),this._buffLen>56&&(this._step(),EN(this._buff));let t=8*this._totalLen;this._buffDV.setUint32(56,Math.floor(t/4294967296),!1),this._buffDV.setUint32(60,t%4294967296,!1),this._step()}_step(){let t=IA._bigBlock32,i=this._buffDV;for(let h=0;h<64;h+=4)t.setUint32(h,i.getUint32(h,!1),!1);for(let h=64;h<320;h+=4)t.setUint32(h,dv(t.getUint32(h-12,!1)^t.getUint32(h-32,!1)^t.getUint32(h-56,!1)^t.getUint32(h-64,!1),1),!1);let n=this._h0,s=this._h1,r=this._h2,a=this._h3,o=this._h4,l,c,u;for(let h=0;h<80;h++)h<20?(l=s&r|~s&a,c=1518500249):h<40?(l=s^r^a,c=1859775393):h<60?(l=s&r|s&a|r&a,c=2400959708):(l=s^r^a,c=3395469782),u=dv(n,5)+l+o+c+t.getUint32(h*4,!1)&4294967295,o=a,a=r,r=dv(s,30),s=n,n=u;this._h0=this._h0+n&4294967295,this._h1=this._h1+s&4294967295,this._h2=this._h2+r&4294967295,this._h3=this._h3+a&4294967295,this._h4=this._h4+o&4294967295}};w5._bigBlock32=new DataView(new ArrayBuffer(320));({registerWindow:e9,getWindow:Yn,getDocument:t9,getWindows:i9,getWindowsCount:n9,getWindowId:xN,getWindowById:s9,hasWindow:r9,onDidRegisterWindow:E5,onWillUnregisterWindow:a9,onDidUnregisterWindow:o9}=(function(){let e=new Map,t={window:pn,disposables:new Xr};e.set(pn.vscodeWindowId,t);let i=new X,n=new X,s=new X;function r(a,o){return(typeof a=="number"?e.get(a):void 0)??(o?t:void 0)}return{onDidRegisterWindow:i.event,onWillUnregisterWindow:s.event,onDidUnregisterWindow:n.event,registerWindow(a){if(e.has(a.vscodeWindowId))return xe.None;let o=new Xr,l={window:a,disposables:o.add(new Xr)};return e.set(a.vscodeWindowId,l),o.add(dt(()=>{e.delete(a.vscodeWindowId),n.fire(a)})),o.add(_e(a,Jt.BEFORE_UNLOAD,()=>{s.fire(a)})),i.fire(l),o},getWindows(){return e.values()},getWindowsCount(){return e.size},getWindowId(a){return a.vscodeWindowId},hasWindow(a){return e.has(a)},getWindowById:r,getWindow(a){let o=a;if(o?.ownerDocument?.defaultView)return o.ownerDocument.defaultView.window;let l=a;return l?.view?l.view.window:pn},getDocument(a){return Yn(a).document}}})()),x5=class{constructor(e,t,i,n){this._node=e,this._type=t,this._handler=i,this._options=n||!1,this._node.addEventListener(this._type,this._handler,this._options)}dispose(){this._handler&&(this._node.removeEventListener(this._type,this._handler,this._options),this._node=null,this._handler=null)}};CN=function(e,t,i,n){let s=i;return t==="click"||t==="mousedown"||t==="contextmenu"?s=C5(Yn(e),i):(t==="keydown"||t==="keypress"||t==="keyup")&&(s=k5(i)),_e(e,t,s,n)},N5=class extends f5{constructor(e){super(),this.defaultTarget=e&&Yn(e)}cancelAndSet(e,t,i){return super.cancelAndSet(e,t,i??this.defaultTarget)}},fv=class{constructor(e,t=0){this._runner=e,this.priority=t,this._canceled=!1}dispose(){this._canceled=!0}execute(){if(!this._canceled)try{this._runner()}catch(e){pf(e)}}static sort(e,t){return t.priority-e.priority}};(function(){let e=new Map,t=new Map,i=new Map,n=new Map,s=r=>{i.set(r,!1);let a=e.get(r)??[];for(t.set(r,a),e.set(r,[]),n.set(r,!0);a.length>0;)a.sort(fv.sort),a.shift().execute();n.set(r,!1)};Cf=(r,a,o=0)=>{let l=xN(r),c=new fv(a,o),u=e.get(l);return u||(u=[],e.set(l,u)),u.push(c),i.get(l)||(i.set(l,!0),r.requestAnimationFrame(()=>s(l))),c},T5=(r,a,o)=>{let l=xN(r);if(n.get(l)){let c=new fv(a,o),u=t.get(l);return u||(u=[],t.set(l,u)),u.push(c),c}else return Cf(r,a,o)}})();kN=class yf{constructor(t,i){this.width=t,this.height=i}with(t=this.width,i=this.height){return t!==this.width||i!==this.height?new yf(t,i):this}static is(t){return typeof t=="object"&&typeof t.height=="number"&&typeof t.width=="number"}static lift(t){return t instanceof yf?t:new yf(t.width,t.height)}static equals(t,i){return t===i?!0:!t||!i?!1:t.width===i.width&&t.height===i.height}};kN.None=new kN(0,0);l9=new class{constructor(){this.mutationObservers=new Map}observe(e,t,i){let n=this.mutationObservers.get(e);n||(n=new Map,this.mutationObservers.set(e,n));let s=_5(i),r=n.get(s);if(r)r.users+=1;else{let a=new X,o=new MutationObserver(c=>a.fire(c));o.observe(e,i);let l=r={users:1,observer:o,onDidMutate:a.event};t.add(dt(()=>{l.users-=1,l.users===0&&(a.dispose(),o.disconnect(),n?.delete(s),n?.size===0&&this.mutationObservers.delete(e))})),n.set(s,r)}return r.onDidMutate}},Jt={CLICK:"click",AUXCLICK:"auxclick",DBLCLICK:"dblclick",MOUSE_UP:"mouseup",MOUSE_DOWN:"mousedown",MOUSE_OVER:"mouseover",MOUSE_MOVE:"mousemove",MOUSE_OUT:"mouseout",MOUSE_ENTER:"mouseenter",MOUSE_LEAVE:"mouseleave",MOUSE_WHEEL:"wheel",POINTER_UP:"pointerup",POINTER_DOWN:"pointerdown",POINTER_MOVE:"pointermove",POINTER_LEAVE:"pointerleave",CONTEXT_MENU:"contextmenu",WHEEL:"wheel",KEY_DOWN:"keydown",KEY_PRESS:"keypress",KEY_UP:"keyup",LOAD:"load",BEFORE_UNLOAD:"beforeunload",UNLOAD:"unload",PAGE_SHOW:"pageshow",PAGE_HIDE:"pagehide",PASTE:"paste",ABORT:"abort",ERROR:"error",RESIZE:"resize",SCROLL:"scroll",FULLSCREEN_CHANGE:"fullscreenchange",WK_FULLSCREEN_CHANGE:"webkitfullscreenchange",SELECT:"select",CHANGE:"change",SUBMIT:"submit",RESET:"reset",FOCUS:"focus",FOCUS_IN:"focusin",FOCUS_OUT:"focusout",BLUR:"blur",INPUT:"input",STORAGE:"storage",DRAG_START:"dragstart",DRAG:"drag",DRAG_ENTER:"dragenter",DRAG_LEAVE:"dragleave",DRAG_OVER:"dragover",DROP:"drop",DRAG_END:"dragend",ANIMATION_START:_f?"webkitAnimationStart":"animationstart",ANIMATION_END:_f?"webkitAnimationEnd":"animationend",ANIMATION_ITERATION:_f?"webkitAnimationIteration":"animationiteration"},M5=/([\w\-]+)?(#([\w\-]+))?((\.([\w\-]+))*)/;O5.SVG=function(e,t,...i){return zA("http://www.w3.org/2000/svg",e,t,...i)};R5=class{constructor(e){this.domNode=e,this._maxWidth="",this._width="",this._height="",this._top="",this._left="",this._bottom="",this._right="",this._paddingTop="",this._paddingLeft="",this._paddingBottom="",this._paddingRight="",this._fontFamily="",this._fontWeight="",this._fontSize="",this._fontStyle="",this._fontFeatureSettings="",this._fontVariationSettings="",this._textDecoration="",this._lineHeight="",this._letterSpacing="",this._className="",this._display="",this._position="",this._visibility="",this._color="",this._backgroundColor="",this._layerHint=!1,this._contain="none",this._boxShadow=""}setMaxWidth(e){let t=Vi(e);this._maxWidth!==t&&(this._maxWidth=t,this.domNode.style.maxWidth=this._maxWidth)}setWidth(e){let t=Vi(e);this._width!==t&&(this._width=t,this.domNode.style.width=this._width)}setHeight(e){let t=Vi(e);this._height!==t&&(this._height=t,this.domNode.style.height=this._height)}setTop(e){let t=Vi(e);this._top!==t&&(this._top=t,this.domNode.style.top=this._top)}setLeft(e){let t=Vi(e);this._left!==t&&(this._left=t,this.domNode.style.left=this._left)}setBottom(e){let t=Vi(e);this._bottom!==t&&(this._bottom=t,this.domNode.style.bottom=this._bottom)}setRight(e){let t=Vi(e);this._right!==t&&(this._right=t,this.domNode.style.right=this._right)}setPaddingTop(e){let t=Vi(e);this._paddingTop!==t&&(this._paddingTop=t,this.domNode.style.paddingTop=this._paddingTop)}setPaddingLeft(e){let t=Vi(e);this._paddingLeft!==t&&(this._paddingLeft=t,this.domNode.style.paddingLeft=this._paddingLeft)}setPaddingBottom(e){let t=Vi(e);this._paddingBottom!==t&&(this._paddingBottom=t,this.domNode.style.paddingBottom=this._paddingBottom)}setPaddingRight(e){let t=Vi(e);this._paddingRight!==t&&(this._paddingRight=t,this.domNode.style.paddingRight=this._paddingRight)}setFontFamily(e){this._fontFamily!==e&&(this._fontFamily=e,this.domNode.style.fontFamily=this._fontFamily)}setFontWeight(e){this._fontWeight!==e&&(this._fontWeight=e,this.domNode.style.fontWeight=this._fontWeight)}setFontSize(e){let t=Vi(e);this._fontSize!==t&&(this._fontSize=t,this.domNode.style.fontSize=this._fontSize)}setFontStyle(e){this._fontStyle!==e&&(this._fontStyle=e,this.domNode.style.fontStyle=this._fontStyle)}setFontFeatureSettings(e){this._fontFeatureSettings!==e&&(this._fontFeatureSettings=e,this.domNode.style.fontFeatureSettings=this._fontFeatureSettings)}setFontVariationSettings(e){this._fontVariationSettings!==e&&(this._fontVariationSettings=e,this.domNode.style.fontVariationSettings=this._fontVariationSettings)}setTextDecoration(e){this._textDecoration!==e&&(this._textDecoration=e,this.domNode.style.textDecoration=this._textDecoration)}setLineHeight(e){let t=Vi(e);this._lineHeight!==t&&(this._lineHeight=t,this.domNode.style.lineHeight=this._lineHeight)}setLetterSpacing(e){let t=Vi(e);this._letterSpacing!==t&&(this._letterSpacing=t,this.domNode.style.letterSpacing=this._letterSpacing)}setClassName(e){this._className!==e&&(this._className=e,this.domNode.className=this._className)}toggleClassName(e,t){this.domNode.classList.toggle(e,t),this._className=this.domNode.className}setDisplay(e){this._display!==e&&(this._display=e,this.domNode.style.display=this._display)}setPosition(e){this._position!==e&&(this._position=e,this.domNode.style.position=this._position)}setVisibility(e){this._visibility!==e&&(this._visibility=e,this.domNode.style.visibility=this._visibility)}setColor(e){this._color!==e&&(this._color=e,this.domNode.style.color=this._color)}setBackgroundColor(e){this._backgroundColor!==e&&(this._backgroundColor=e,this.domNode.style.backgroundColor=this._backgroundColor)}setLayerHinting(e){this._layerHint!==e&&(this._layerHint=e,this.domNode.style.transform=this._layerHint?"translate3d(0px, 0px, 0px)":"")}setBoxShadow(e){this._boxShadow!==e&&(this._boxShadow=e,this.domNode.style.boxShadow=e)}setContain(e){this._contain!==e&&(this._contain=e,this.domNode.style.contain=this._contain)}setAttribute(e,t){this.domNode.setAttribute(e,t)}removeAttribute(e){this.domNode.removeAttribute(e)}appendChild(e){this.domNode.appendChild(e.domNode)}removeChild(e){this.domNode.removeChild(e.domNode)}};PA=class{constructor(){this._hooks=new Xr,this._pointerMoveCallback=null,this._onStopCallback=null}dispose(){this.stopMonitoring(!1),this._hooks.dispose()}stopMonitoring(e,t){if(!this.isMonitoring())return;this._hooks.clear(),this._pointerMoveCallback=null;let i=this._onStopCallback;this._onStopCallback=null,e&&i&&i(t)}isMonitoring(){return!!this._pointerMoveCallback}startMonitoring(e,t,i,n,s){this.isMonitoring()&&this.stopMonitoring(!1),this._pointerMoveCallback=n,this._onStopCallback=s;let r=e;try{e.setPointerCapture(t),this._hooks.add(dt(()=>{try{e.releasePointerCapture(t)}catch{}}))}catch{r=Yn(e)}this._hooks.add(_e(r,Jt.POINTER_MOVE,a=>{if(a.buttons!==i){this.stopMonitoring(!0);return}a.preventDefault(),this._pointerMoveCallback(a)})),this._hooks.add(_e(r,Jt.POINTER_UP,a=>this.stopMonitoring(!0)))}};(e=>(e.Tap="-xterm-gesturetap",e.Change="-xterm-gesturechange",e.Start="-xterm-gesturestart",e.End="-xterm-gesturesend",e.Contextmenu="-xterm-gesturecontextmenu"))($n||($n={}));hu=class xi extends xe{constructor(){super(),this.dispatched=!1,this.targets=new uN,this.ignoreTargets=new uN,this.activeTouches={},this.handle=null,this._lastSetTapCountTime=0,this._register(ni.runAndSubscribe(E5,({window:t,disposables:i})=>{i.add(_e(t.document,"touchstart",n=>this.onTouchStart(n),{passive:!1})),i.add(_e(t.document,"touchend",n=>this.onTouchEnd(t,n))),i.add(_e(t.document,"touchmove",n=>this.onTouchMove(n),{passive:!1}))},{window:pn,disposables:this._store}))}static addTarget(t){if(!xi.isTouchDevice())return xe.None;xi.INSTANCE||(xi.INSTANCE=cN(new xi));let i=xi.INSTANCE.targets.push(t);return dt(i)}static ignoreTarget(t){if(!xi.isTouchDevice())return xe.None;xi.INSTANCE||(xi.INSTANCE=cN(new xi));let i=xi.INSTANCE.ignoreTargets.push(t);return dt(i)}static isTouchDevice(){return"ontouchstart"in pn||navigator.maxTouchPoints>0}dispose(){this.handle&&(this.handle.dispose(),this.handle=null),super.dispose()}onTouchStart(t){let i=Date.now();this.handle&&(this.handle.dispose(),this.handle=null);for(let n=0,s=t.targetTouches.length;n<s;n++){let r=t.targetTouches.item(n);this.activeTouches[r.identifier]={id:r.identifier,initialTarget:r.target,initialTimeStamp:i,initialPageX:r.pageX,initialPageY:r.pageY,rollingTimestamps:[i],rollingPageX:[r.pageX],rollingPageY:[r.pageY]};let a=this.newGestureEvent($n.Start,r.target);a.pageX=r.pageX,a.pageY=r.pageY,this.dispatchEvent(a)}this.dispatched&&(t.preventDefault(),t.stopPropagation(),this.dispatched=!1)}onTouchEnd(t,i){let n=Date.now(),s=Object.keys(this.activeTouches).length;for(let r=0,a=i.changedTouches.length;r<a;r++){let o=i.changedTouches.item(r);if(!this.activeTouches.hasOwnProperty(String(o.identifier))){console.warn("move of an UNKNOWN touch",o);continue}let l=this.activeTouches[o.identifier],c=Date.now()-l.initialTimeStamp;if(c<xi.HOLD_DELAY&&Math.abs(l.initialPageX-hn(l.rollingPageX))<30&&Math.abs(l.initialPageY-hn(l.rollingPageY))<30){let u=this.newGestureEvent($n.Tap,l.initialTarget);u.pageX=hn(l.rollingPageX),u.pageY=hn(l.rollingPageY),this.dispatchEvent(u)}else if(c>=xi.HOLD_DELAY&&Math.abs(l.initialPageX-hn(l.rollingPageX))<30&&Math.abs(l.initialPageY-hn(l.rollingPageY))<30){let u=this.newGestureEvent($n.Contextmenu,l.initialTarget);u.pageX=hn(l.rollingPageX),u.pageY=hn(l.rollingPageY),this.dispatchEvent(u)}else if(s===1){let u=hn(l.rollingPageX),h=hn(l.rollingPageY),d=hn(l.rollingTimestamps)-l.rollingTimestamps[0],f=u-l.rollingPageX[0],p=h-l.rollingPageY[0],_=[...this.targets].filter(v=>l.initialTarget instanceof Node&&v.contains(l.initialTarget));this.inertia(t,_,n,Math.abs(f)/d,f>0?1:-1,u,Math.abs(p)/d,p>0?1:-1,h)}this.dispatchEvent(this.newGestureEvent($n.End,l.initialTarget)),delete this.activeTouches[o.identifier]}this.dispatched&&(i.preventDefault(),i.stopPropagation(),this.dispatched=!1)}newGestureEvent(t,i){let n=document.createEvent("CustomEvent");return n.initEvent(t,!1,!0),n.initialTarget=i,n.tapCount=0,n}dispatchEvent(t){if(t.type===$n.Tap){let i=new Date().getTime(),n=0;i-this._lastSetTapCountTime>xi.CLEAR_TAP_COUNT_TIME?n=1:n=2,this._lastSetTapCountTime=i,t.tapCount=n}else(t.type===$n.Change||t.type===$n.Contextmenu)&&(this._lastSetTapCountTime=0);if(t.initialTarget instanceof Node){for(let n of this.ignoreTargets)if(n.contains(t.initialTarget))return;let i=[];for(let n of this.targets)if(n.contains(t.initialTarget)){let s=0,r=t.initialTarget;for(;r&&r!==n;)s++,r=r.parentElement;i.push([s,n])}i.sort((n,s)=>n[0]-s[0]);for(let[n,s]of i)s.dispatchEvent(t),this.dispatched=!0}}inertia(t,i,n,s,r,a,o,l,c){this.handle=Cf(t,()=>{let u=Date.now(),h=u-n,d=0,f=0,p=!0;s+=xi.SCROLL_FRICTION*h,o+=xi.SCROLL_FRICTION*h,s>0&&(p=!1,d=r*s*h),o>0&&(p=!1,f=l*o*h);let _=this.newGestureEvent($n.Change);_.translationX=d,_.translationY=f,i.forEach(v=>v.dispatchEvent(_)),p||this.inertia(t,i,u,s,r,a+d,o,l,c+f)})}onTouchMove(t){let i=Date.now();for(let n=0,s=t.changedTouches.length;n<s;n++){let r=t.changedTouches.item(n);if(!this.activeTouches.hasOwnProperty(String(r.identifier))){console.warn("end of an UNKNOWN touch",r);continue}let a=this.activeTouches[r.identifier],o=this.newGestureEvent($n.Change,a.initialTarget);o.translationX=r.pageX-hn(a.rollingPageX),o.translationY=r.pageY-hn(a.rollingPageY),o.pageX=r.pageX,o.pageY=r.pageY,this.dispatchEvent(o),a.rollingPageX.length>3&&(a.rollingPageX.shift(),a.rollingPageY.shift(),a.rollingTimestamps.shift()),a.rollingPageX.push(r.pageX),a.rollingPageY.push(r.pageY),a.rollingTimestamps.push(i)}this.dispatched&&(t.preventDefault(),t.stopPropagation(),this.dispatched=!1)}};hu.SCROLL_FRICTION=-.005,hu.HOLD_DELAY=700,hu.CLEAR_TAP_COUNT_TIME=400,xt([D5],hu,"isTouchDevice",1);L5=hu,vb=class extends xe{onclick(e,t){this._register(_e(e,Jt.CLICK,i=>t(new uu(Yn(e),i))))}onmousedown(e,t){this._register(_e(e,Jt.MOUSE_DOWN,i=>t(new uu(Yn(e),i))))}onmouseover(e,t){this._register(_e(e,Jt.MOUSE_OVER,i=>t(new uu(Yn(e),i))))}onmouseleave(e,t){this._register(_e(e,Jt.MOUSE_LEAVE,i=>t(new uu(Yn(e),i))))}onkeydown(e,t){this._register(_e(e,Jt.KEY_DOWN,i=>t(new Fv(i))))}onkeyup(e,t){this._register(_e(e,Jt.KEY_UP,i=>t(new Fv(i))))}oninput(e,t){this._register(_e(e,Jt.INPUT,t))}onblur(e,t){this._register(_e(e,Jt.BLUR,t))}onfocus(e,t){this._register(_e(e,Jt.FOCUS,t))}onchange(e,t){this._register(_e(e,Jt.CHANGE,t))}ignoreGesture(e){return L5.ignoreTarget(e)}},TN=11,B5=class extends vb{constructor(e){super(),this._onActivate=e.onActivate,this.bgDomNode=document.createElement("div"),this.bgDomNode.className="arrow-background",this.bgDomNode.style.position="absolute",this.bgDomNode.style.width=e.bgWidth+"px",this.bgDomNode.style.height=e.bgHeight+"px",typeof e.top<"u"&&(this.bgDomNode.style.top="0px"),typeof e.left<"u"&&(this.bgDomNode.style.left="0px"),typeof e.bottom<"u"&&(this.bgDomNode.style.bottom="0px"),typeof e.right<"u"&&(this.bgDomNode.style.right="0px"),this.domNode=document.createElement("div"),this.domNode.className=e.className,this.domNode.style.position="absolute",this.domNode.style.width=TN+"px",this.domNode.style.height=TN+"px",typeof e.top<"u"&&(this.domNode.style.top=e.top+"px"),typeof e.left<"u"&&(this.domNode.style.left=e.left+"px"),typeof e.bottom<"u"&&(this.domNode.style.bottom=e.bottom+"px"),typeof e.right<"u"&&(this.domNode.style.right=e.right+"px"),this._pointerMoveMonitor=this._register(new PA),this._register(CN(this.bgDomNode,Jt.POINTER_DOWN,t=>this._arrowPointerDown(t))),this._register(CN(this.domNode,Jt.POINTER_DOWN,t=>this._arrowPointerDown(t))),this._pointerdownRepeatTimer=this._register(new N5),this._pointerdownScheduleRepeatTimer=this._register(new gb)}_arrowPointerDown(e){if(!e.target||!(e.target instanceof Element))return;let t=()=>{this._pointerdownRepeatTimer.cancelAndSet(()=>this._onActivate(),1e3/24,Yn(e))};this._onActivate(),this._pointerdownRepeatTimer.cancel(),this._pointerdownScheduleRepeatTimer.cancelAndSet(t,200),this._pointerMoveMonitor.startMonitoring(e.target,e.pointerId,e.buttons,i=>{},()=>{this._pointerdownRepeatTimer.cancel(),this._pointerdownScheduleRepeatTimer.cancel()}),e.preventDefault()}},I5=class qv{constructor(t,i,n,s,r,a,o){this._forceIntegerValues=t,this._scrollStateBrand=void 0,this._forceIntegerValues&&(i=i|0,n=n|0,s=s|0,r=r|0,a=a|0,o=o|0),this.rawScrollLeft=s,this.rawScrollTop=o,i<0&&(i=0),s+i>n&&(s=n-i),s<0&&(s=0),r<0&&(r=0),o+r>a&&(o=a-r),o<0&&(o=0),this.width=i,this.scrollWidth=n,this.scrollLeft=s,this.height=r,this.scrollHeight=a,this.scrollTop=o}equals(t){return this.rawScrollLeft===t.rawScrollLeft&&this.rawScrollTop===t.rawScrollTop&&this.width===t.width&&this.scrollWidth===t.scrollWidth&&this.scrollLeft===t.scrollLeft&&this.height===t.height&&this.scrollHeight===t.scrollHeight&&this.scrollTop===t.scrollTop}withScrollDimensions(t,i){return new qv(this._forceIntegerValues,typeof t.width<"u"?t.width:this.width,typeof t.scrollWidth<"u"?t.scrollWidth:this.scrollWidth,i?this.rawScrollLeft:this.scrollLeft,typeof t.height<"u"?t.height:this.height,typeof t.scrollHeight<"u"?t.scrollHeight:this.scrollHeight,i?this.rawScrollTop:this.scrollTop)}withScrollPosition(t){return new qv(this._forceIntegerValues,this.width,this.scrollWidth,typeof t.scrollLeft<"u"?t.scrollLeft:this.rawScrollLeft,this.height,this.scrollHeight,typeof t.scrollTop<"u"?t.scrollTop:this.rawScrollTop)}createScrollEvent(t,i){let n=this.width!==t.width,s=this.scrollWidth!==t.scrollWidth,r=this.scrollLeft!==t.scrollLeft,a=this.height!==t.height,o=this.scrollHeight!==t.scrollHeight,l=this.scrollTop!==t.scrollTop;return{inSmoothScrolling:i,oldWidth:t.width,oldScrollWidth:t.scrollWidth,oldScrollLeft:t.scrollLeft,width:this.width,scrollWidth:this.scrollWidth,scrollLeft:this.scrollLeft,oldHeight:t.height,oldScrollHeight:t.scrollHeight,oldScrollTop:t.scrollTop,height:this.height,scrollHeight:this.scrollHeight,scrollTop:this.scrollTop,widthChanged:n,scrollWidthChanged:s,scrollLeftChanged:r,heightChanged:a,scrollHeightChanged:o,scrollTopChanged:l}}},z5=class extends xe{constructor(e){super(),this._scrollableBrand=void 0,this._onScroll=this._register(new X),this.onScroll=this._onScroll.event,this._smoothScrollDuration=e.smoothScrollDuration,this._scheduleAtNextAnimationFrame=e.scheduleAtNextAnimationFrame,this._state=new I5(e.forceIntegerValues,0,0,0,0,0,0),this._smoothScrolling=null}dispose(){this._smoothScrolling&&(this._smoothScrolling.dispose(),this._smoothScrolling=null),super.dispose()}setSmoothScrollDuration(e){this._smoothScrollDuration=e}validateScrollPosition(e){return this._state.withScrollPosition(e)}getScrollDimensions(){return this._state}setScrollDimensions(e,t){let i=this._state.withScrollDimensions(e,t);this._setState(i,!!this._smoothScrolling),this._smoothScrolling?.acceptScrollDimensions(this._state)}getFutureScrollPosition(){return this._smoothScrolling?this._smoothScrolling.to:this._state}getCurrentScrollPosition(){return this._state}setScrollPositionNow(e){let t=this._state.withScrollPosition(e);this._smoothScrolling&&(this._smoothScrolling.dispose(),this._smoothScrolling=null),this._setState(t,!1)}setScrollPositionSmooth(e,t){if(this._smoothScrollDuration===0)return this.setScrollPositionNow(e);if(this._smoothScrolling){e={scrollLeft:typeof e.scrollLeft>"u"?this._smoothScrolling.to.scrollLeft:e.scrollLeft,scrollTop:typeof e.scrollTop>"u"?this._smoothScrolling.to.scrollTop:e.scrollTop};let i=this._state.withScrollPosition(e);if(this._smoothScrolling.to.scrollLeft===i.scrollLeft&&this._smoothScrolling.to.scrollTop===i.scrollTop)return;let n;t?n=new AN(this._smoothScrolling.from,i,this._smoothScrolling.startTime,this._smoothScrolling.duration):n=this._smoothScrolling.combine(this._state,i,this._smoothScrollDuration),this._smoothScrolling.dispose(),this._smoothScrolling=n}else{let i=this._state.withScrollPosition(e);this._smoothScrolling=AN.start(this._state,i,this._smoothScrollDuration)}this._smoothScrolling.animationFrameDisposable=this._scheduleAtNextAnimationFrame(()=>{this._smoothScrolling&&(this._smoothScrolling.animationFrameDisposable=null,this._performSmoothScrolling())})}hasPendingScrollAnimation(){return!!this._smoothScrolling}_performSmoothScrolling(){if(!this._smoothScrolling)return;let e=this._smoothScrolling.tick(),t=this._state.withScrollPosition(e);if(this._setState(t,!0),!!this._smoothScrolling){if(e.isDone){this._smoothScrolling.dispose(),this._smoothScrolling=null;return}this._smoothScrolling.animationFrameDisposable=this._scheduleAtNextAnimationFrame(()=>{this._smoothScrolling&&(this._smoothScrolling.animationFrameDisposable=null,this._performSmoothScrolling())})}}_setState(e,t){let i=this._state;i.equals(e)||(this._state=e,this._onScroll.fire(this._state.createScrollEvent(i,t)))}},NN=class{constructor(e,t,i){this.scrollLeft=e,this.scrollTop=t,this.isDone=i}};AN=class Kv{constructor(t,i,n,s){this.from=t,this.to=i,this.duration=s,this.startTime=n,this.animationFrameDisposable=null,this._initAnimations()}_initAnimations(){this.scrollLeft=this._initAnimation(this.from.scrollLeft,this.to.scrollLeft,this.to.width),this.scrollTop=this._initAnimation(this.from.scrollTop,this.to.scrollTop,this.to.height)}_initAnimation(t,i,n){if(Math.abs(t-i)>2.5*n){let s,r;return t<i?(s=t+.75*n,r=i-.75*n):(s=t-.75*n,r=i+.75*n),P5(pv(t,s),pv(r,i),.33)}return pv(t,i)}dispose(){this.animationFrameDisposable!==null&&(this.animationFrameDisposable.dispose(),this.animationFrameDisposable=null)}acceptScrollDimensions(t){this.to=t.withScrollPosition(this.to),this._initAnimations()}tick(){return this._tick(Date.now())}_tick(t){let i=(t-this.startTime)/this.duration;if(i<1){let n=this.scrollLeft(i),s=this.scrollTop(i);return new NN(n,s,!1)}return new NN(this.to.scrollLeft,this.to.scrollTop,!0)}combine(t,i,n){return Kv.start(t,i,n)}static start(t,i,n){n=n+10;let s=Date.now()-10;return new Kv(t,i,s,n)}};F5=class extends xe{constructor(e,t,i){super(),this._visibility=e,this._visibleClassName=t,this._invisibleClassName=i,this._domNode=null,this._isVisible=!1,this._isNeeded=!1,this._rawShouldBeVisible=!1,this._shouldBeVisible=!1,this._revealTimer=this._register(new gb)}setVisibility(e){this._visibility!==e&&(this._visibility=e,this._updateShouldBeVisible())}setShouldBeVisible(e){this._rawShouldBeVisible=e,this._updateShouldBeVisible()}_applyVisibilitySetting(){return this._visibility===2?!1:this._visibility===3?!0:this._rawShouldBeVisible}_updateShouldBeVisible(){let e=this._applyVisibilitySetting();this._shouldBeVisible!==e&&(this._shouldBeVisible=e,this.ensureVisibility())}setIsNeeded(e){this._isNeeded!==e&&(this._isNeeded=e,this.ensureVisibility())}setDomNode(e){this._domNode=e,this._domNode.setClassName(this._invisibleClassName),this.setShouldBeVisible(!1)}ensureVisibility(){if(!this._isNeeded){this._hide(!1);return}this._shouldBeVisible?this._reveal():this._hide(!0)}_reveal(){this._isVisible||(this._isVisible=!0,this._revealTimer.setIfNotSet(()=>{this._domNode?.setClassName(this._visibleClassName)},0))}_hide(e){this._revealTimer.cancel(),this._isVisible&&(this._isVisible=!1,this._domNode?.setClassName(this._invisibleClassName+(e?" fade":"")))}},q5=140,UA=class extends vb{constructor(e){super(),this._lazyRender=e.lazyRender,this._host=e.host,this._scrollable=e.scrollable,this._scrollByPage=e.scrollByPage,this._scrollbarState=e.scrollbarState,this._visibilityController=this._register(new F5(e.visibility,"visible scrollbar "+e.extraScrollbarClassName,"invisible scrollbar "+e.extraScrollbarClassName)),this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._pointerMoveMonitor=this._register(new PA),this._shouldRender=!0,this.domNode=_u(document.createElement("div")),this.domNode.setAttribute("role","presentation"),this.domNode.setAttribute("aria-hidden","true"),this._visibilityController.setDomNode(this.domNode),this.domNode.setPosition("absolute"),this._register(_e(this.domNode.domNode,Jt.POINTER_DOWN,t=>this._domNodePointerDown(t)))}_createArrow(e){let t=this._register(new B5(e));this.domNode.domNode.appendChild(t.bgDomNode),this.domNode.domNode.appendChild(t.domNode)}_createSlider(e,t,i,n){this.slider=_u(document.createElement("div")),this.slider.setClassName("slider"),this.slider.setPosition("absolute"),this.slider.setTop(e),this.slider.setLeft(t),typeof i=="number"&&this.slider.setWidth(i),typeof n=="number"&&this.slider.setHeight(n),this.slider.setLayerHinting(!0),this.slider.setContain("strict"),this.domNode.domNode.appendChild(this.slider.domNode),this._register(_e(this.slider.domNode,Jt.POINTER_DOWN,s=>{s.button===0&&(s.preventDefault(),this._sliderPointerDown(s))})),this.onclick(this.slider.domNode,s=>{s.leftButton&&s.stopPropagation()})}_onElementSize(e){return this._scrollbarState.setVisibleSize(e)&&(this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._shouldRender=!0,this._lazyRender||this.render()),this._shouldRender}_onElementScrollSize(e){return this._scrollbarState.setScrollSize(e)&&(this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._shouldRender=!0,this._lazyRender||this.render()),this._shouldRender}_onElementScrollPosition(e){return this._scrollbarState.setScrollPosition(e)&&(this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._shouldRender=!0,this._lazyRender||this.render()),this._shouldRender}beginReveal(){this._visibilityController.setShouldBeVisible(!0)}beginHide(){this._visibilityController.setShouldBeVisible(!1)}render(){this._shouldRender&&(this._shouldRender=!1,this._renderDomNode(this._scrollbarState.getRectangleLargeSize(),this._scrollbarState.getRectangleSmallSize()),this._updateSlider(this._scrollbarState.getSliderSize(),this._scrollbarState.getArrowSize()+this._scrollbarState.getSliderPosition()))}_domNodePointerDown(e){e.target===this.domNode.domNode&&this._onPointerDown(e)}delegatePointerDown(e){let t=this.domNode.domNode.getClientRects()[0].top,i=t+this._scrollbarState.getSliderPosition(),n=t+this._scrollbarState.getSliderPosition()+this._scrollbarState.getSliderSize(),s=this._sliderPointerPosition(e);i<=s&&s<=n?e.button===0&&(e.preventDefault(),this._sliderPointerDown(e)):this._onPointerDown(e)}_onPointerDown(e){let t,i;if(e.target===this.domNode.domNode&&typeof e.offsetX=="number"&&typeof e.offsetY=="number")t=e.offsetX,i=e.offsetY;else{let s=A5(this.domNode.domNode);t=e.pageX-s.left,i=e.pageY-s.top}let n=this._pointerDownRelativePosition(t,i);this._setDesiredScrollPositionNow(this._scrollByPage?this._scrollbarState.getDesiredScrollPositionFromOffsetPaged(n):this._scrollbarState.getDesiredScrollPositionFromOffset(n)),e.button===0&&(e.preventDefault(),this._sliderPointerDown(e))}_sliderPointerDown(e){if(!e.target||!(e.target instanceof Element))return;let t=this._sliderPointerPosition(e),i=this._sliderOrthogonalPointerPosition(e),n=this._scrollbarState.clone();this.slider.toggleClassName("active",!0),this._pointerMoveMonitor.startMonitoring(e.target,e.pointerId,e.buttons,s=>{let r=this._sliderOrthogonalPointerPosition(s),a=Math.abs(r-i);if(RA&&a>q5){this._setDesiredScrollPositionNow(n.getScrollPosition());return}let o=this._sliderPointerPosition(s)-t;this._setDesiredScrollPositionNow(n.getDesiredScrollPositionFromDelta(o))},()=>{this.slider.toggleClassName("active",!1),this._host.onDragEnd()}),this._host.onDragStart()}_setDesiredScrollPositionNow(e){let t={};this.writeScrollPosition(t,e),this._scrollable.setScrollPositionNow(t)}updateScrollbarSize(e){this._updateScrollbarSize(e),this._scrollbarState.setScrollbarSize(e),this._shouldRender=!0,this._lazyRender||this.render()}isNeeded(){return this._scrollbarState.isNeeded()}},HA=class Wv{constructor(t,i,n,s,r,a){this._scrollbarSize=Math.round(i),this._oppositeScrollbarSize=Math.round(n),this._arrowSize=Math.round(t),this._visibleSize=s,this._scrollSize=r,this._scrollPosition=a,this._computedAvailableSize=0,this._computedIsNeeded=!1,this._computedSliderSize=0,this._computedSliderRatio=0,this._computedSliderPosition=0,this._refreshComputedValues()}clone(){return new Wv(this._arrowSize,this._scrollbarSize,this._oppositeScrollbarSize,this._visibleSize,this._scrollSize,this._scrollPosition)}setVisibleSize(t){let i=Math.round(t);return this._visibleSize!==i?(this._visibleSize=i,this._refreshComputedValues(),!0):!1}setScrollSize(t){let i=Math.round(t);return this._scrollSize!==i?(this._scrollSize=i,this._refreshComputedValues(),!0):!1}setScrollPosition(t){let i=Math.round(t);return this._scrollPosition!==i?(this._scrollPosition=i,this._refreshComputedValues(),!0):!1}setScrollbarSize(t){this._scrollbarSize=Math.round(t)}setOppositeScrollbarSize(t){this._oppositeScrollbarSize=Math.round(t)}static _computeValues(t,i,n,s,r){let a=Math.max(0,n-t),o=Math.max(0,a-2*i),l=s>0&&s>n;if(!l)return{computedAvailableSize:Math.round(a),computedIsNeeded:l,computedSliderSize:Math.round(o),computedSliderRatio:0,computedSliderPosition:0};let c=Math.round(Math.max(20,Math.floor(n*o/s))),u=(o-c)/(s-n),h=r*u;return{computedAvailableSize:Math.round(a),computedIsNeeded:l,computedSliderSize:Math.round(c),computedSliderRatio:u,computedSliderPosition:Math.round(h)}}_refreshComputedValues(){let t=Wv._computeValues(this._oppositeScrollbarSize,this._arrowSize,this._visibleSize,this._scrollSize,this._scrollPosition);this._computedAvailableSize=t.computedAvailableSize,this._computedIsNeeded=t.computedIsNeeded,this._computedSliderSize=t.computedSliderSize,this._computedSliderRatio=t.computedSliderRatio,this._computedSliderPosition=t.computedSliderPosition}getArrowSize(){return this._arrowSize}getScrollPosition(){return this._scrollPosition}getRectangleLargeSize(){return this._computedAvailableSize}getRectangleSmallSize(){return this._scrollbarSize}isNeeded(){return this._computedIsNeeded}getSliderSize(){return this._computedSliderSize}getSliderPosition(){return this._computedSliderPosition}getDesiredScrollPositionFromOffset(t){if(!this._computedIsNeeded)return 0;let i=t-this._arrowSize-this._computedSliderSize/2;return Math.round(i/this._computedSliderRatio)}getDesiredScrollPositionFromOffsetPaged(t){if(!this._computedIsNeeded)return 0;let i=t-this._arrowSize,n=this._scrollPosition;return i<this._computedSliderPosition?n-=this._visibleSize:n+=this._visibleSize,n}getDesiredScrollPositionFromDelta(t){if(!this._computedIsNeeded)return 0;let i=this._computedSliderPosition+t;return Math.round(i/this._computedSliderRatio)}},K5=class extends UA{constructor(e,t,i){let n=e.getScrollDimensions(),s=e.getCurrentScrollPosition();if(super({lazyRender:t.lazyRender,host:i,scrollbarState:new HA(t.horizontalHasArrows?t.arrowSize:0,t.horizontal===2?0:t.horizontalScrollbarSize,t.vertical===2?0:t.verticalScrollbarSize,n.width,n.scrollWidth,s.scrollLeft),visibility:t.horizontal,extraScrollbarClassName:"horizontal",scrollable:e,scrollByPage:t.scrollByPage}),t.horizontalHasArrows)throw new Error("horizontalHasArrows is not supported in xterm.js");this._createSlider(Math.floor((t.horizontalScrollbarSize-t.horizontalSliderSize)/2),0,void 0,t.horizontalSliderSize)}_updateSlider(e,t){this.slider.setWidth(e),this.slider.setLeft(t)}_renderDomNode(e,t){this.domNode.setWidth(e),this.domNode.setHeight(t),this.domNode.setLeft(0),this.domNode.setBottom(0)}onDidScroll(e){return this._shouldRender=this._onElementScrollSize(e.scrollWidth)||this._shouldRender,this._shouldRender=this._onElementScrollPosition(e.scrollLeft)||this._shouldRender,this._shouldRender=this._onElementSize(e.width)||this._shouldRender,this._shouldRender}_pointerDownRelativePosition(e,t){return e}_sliderPointerPosition(e){return e.pageX}_sliderOrthogonalPointerPosition(e){return e.pageY}_updateScrollbarSize(e){this.slider.setHeight(e)}writeScrollPosition(e,t){e.scrollLeft=t}updateOptions(e){this.updateScrollbarSize(e.horizontal===2?0:e.horizontalScrollbarSize),this._scrollbarState.setOppositeScrollbarSize(e.vertical===2?0:e.verticalScrollbarSize),this._visibilityController.setVisibility(e.horizontal),this._scrollByPage=e.scrollByPage}},W5=class extends UA{constructor(e,t,i){let n=e.getScrollDimensions(),s=e.getCurrentScrollPosition();if(super({lazyRender:t.lazyRender,host:i,scrollbarState:new HA(t.verticalHasArrows?t.arrowSize:0,t.vertical===2?0:t.verticalScrollbarSize,0,n.height,n.scrollHeight,s.scrollTop),visibility:t.vertical,extraScrollbarClassName:"vertical",scrollable:e,scrollByPage:t.scrollByPage}),t.verticalHasArrows)throw new Error("horizontalHasArrows is not supported in xterm.js");this._createSlider(0,Math.floor((t.verticalScrollbarSize-t.verticalSliderSize)/2),t.verticalSliderSize,void 0)}_updateSlider(e,t){this.slider.setHeight(e),this.slider.setTop(t)}_renderDomNode(e,t){this.domNode.setWidth(t),this.domNode.setHeight(e),this.domNode.setRight(0),this.domNode.setTop(0)}onDidScroll(e){return this._shouldRender=this._onElementScrollSize(e.scrollHeight)||this._shouldRender,this._shouldRender=this._onElementScrollPosition(e.scrollTop)||this._shouldRender,this._shouldRender=this._onElementSize(e.height)||this._shouldRender,this._shouldRender}_pointerDownRelativePosition(e,t){return t}_sliderPointerPosition(e){return e.pageY}_sliderOrthogonalPointerPosition(e){return e.pageX}_updateScrollbarSize(e){this.slider.setWidth(e)}writeScrollPosition(e,t){e.scrollTop=t}updateOptions(e){this.updateScrollbarSize(e.vertical===2?0:e.verticalScrollbarSize),this._scrollbarState.setOppositeScrollbarSize(0),this._visibilityController.setVisibility(e.vertical),this._scrollByPage=e.scrollByPage}},G5=500,MN=50,ON=!0,$5=class{constructor(e,t,i){this.timestamp=e,this.deltaX=t,this.deltaY=i,this.score=0}},Gv=class{constructor(){this._capacity=5,this._memory=[],this._front=-1,this._rear=-1}isPhysicalMouseWheel(){if(this._front===-1&&this._rear===-1)return!1;let t=1,i=0,n=1,s=this._rear;do{let r=s===this._front?t:Math.pow(2,-n);if(t-=r,i+=this._memory[s].score*r,s===this._front)break;s=(this._capacity+s-1)%this._capacity,n++}while(!0);return i<=.5}acceptStandardWheelEvent(t){if(pb){let i=Yn(t.browserEvent),n=qz(i);this.accept(Date.now(),t.deltaX*n,t.deltaY*n)}else this.accept(Date.now(),t.deltaX,t.deltaY)}accept(t,i,n){let s=null,r=new $5(t,i,n);this._front===-1&&this._rear===-1?(this._memory[0]=r,this._front=0,this._rear=0):(s=this._memory[this._rear],this._rear=(this._rear+1)%this._capacity,this._rear===this._front&&(this._front=(this._front+1)%this._capacity),this._memory[this._rear]=r),r.score=this._computeScore(r,s)}_computeScore(t,i){if(Math.abs(t.deltaX)>0&&Math.abs(t.deltaY)>0)return 1;let n=.5;if((!this._isAlmostInt(t.deltaX)||!this._isAlmostInt(t.deltaY))&&(n+=.25),i){let s=Math.abs(t.deltaX),r=Math.abs(t.deltaY),a=Math.abs(i.deltaX),o=Math.abs(i.deltaY),l=Math.max(Math.min(s,a),1),c=Math.max(Math.min(r,o),1),u=Math.max(s,a),h=Math.max(r,o);u%l===0&&h%c===0&&(n-=.5)}return Math.min(Math.max(n,0),1)}_isAlmostInt(t){return Math.abs(Math.round(t)-t)<.01}};Gv.INSTANCE=new Gv;Y5=Gv,j5=class extends vb{constructor(e,t,i){super(),this._onScroll=this._register(new X),this.onScroll=this._onScroll.event,this._onWillScroll=this._register(new X),this.onWillScroll=this._onWillScroll.event,this._options=X5(t),this._scrollable=i,this._register(this._scrollable.onScroll(s=>{this._onWillScroll.fire(s),this._onDidScroll(s),this._onScroll.fire(s)}));let n={onMouseWheel:s=>this._onMouseWheel(s),onDragStart:()=>this._onDragStart(),onDragEnd:()=>this._onDragEnd()};this._verticalScrollbar=this._register(new W5(this._scrollable,this._options,n)),this._horizontalScrollbar=this._register(new K5(this._scrollable,this._options,n)),this._domNode=document.createElement("div"),this._domNode.className="xterm-scrollable-element "+this._options.className,this._domNode.setAttribute("role","presentation"),this._domNode.style.position="relative",this._domNode.appendChild(e),this._domNode.appendChild(this._horizontalScrollbar.domNode.domNode),this._domNode.appendChild(this._verticalScrollbar.domNode.domNode),this._options.useShadows?(this._leftShadowDomNode=_u(document.createElement("div")),this._leftShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._leftShadowDomNode.domNode),this._topShadowDomNode=_u(document.createElement("div")),this._topShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._topShadowDomNode.domNode),this._topLeftShadowDomNode=_u(document.createElement("div")),this._topLeftShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._topLeftShadowDomNode.domNode)):(this._leftShadowDomNode=null,this._topShadowDomNode=null,this._topLeftShadowDomNode=null),this._listenOnDomNode=this._options.listenOnDomNode||this._domNode,this._mouseWheelToDispose=[],this._setListeningToMouseWheel(this._options.handleMouseWheel),this.onmouseover(this._listenOnDomNode,s=>this._onMouseOver(s)),this.onmouseleave(this._listenOnDomNode,s=>this._onMouseLeave(s)),this._hideTimeout=this._register(new gb),this._isDragging=!1,this._mouseIsOver=!1,this._shouldRender=!0,this._revealOnScroll=!0}get options(){return this._options}dispose(){this._mouseWheelToDispose=ja(this._mouseWheelToDispose),super.dispose()}getDomNode(){return this._domNode}getOverviewRulerLayoutInfo(){return{parent:this._domNode,insertBefore:this._verticalScrollbar.domNode.domNode}}delegateVerticalScrollbarPointerDown(e){this._verticalScrollbar.delegatePointerDown(e)}getScrollDimensions(){return this._scrollable.getScrollDimensions()}setScrollDimensions(e){this._scrollable.setScrollDimensions(e,!1)}updateClassName(e){this._options.className=e,Cs&&(this._options.className+=" mac"),this._domNode.className="xterm-scrollable-element "+this._options.className}updateOptions(e){typeof e.handleMouseWheel<"u"&&(this._options.handleMouseWheel=e.handleMouseWheel,this._setListeningToMouseWheel(this._options.handleMouseWheel)),typeof e.mouseWheelScrollSensitivity<"u"&&(this._options.mouseWheelScrollSensitivity=e.mouseWheelScrollSensitivity),typeof e.fastScrollSensitivity<"u"&&(this._options.fastScrollSensitivity=e.fastScrollSensitivity),typeof e.scrollPredominantAxis<"u"&&(this._options.scrollPredominantAxis=e.scrollPredominantAxis),typeof e.horizontal<"u"&&(this._options.horizontal=e.horizontal),typeof e.vertical<"u"&&(this._options.vertical=e.vertical),typeof e.horizontalScrollbarSize<"u"&&(this._options.horizontalScrollbarSize=e.horizontalScrollbarSize),typeof e.verticalScrollbarSize<"u"&&(this._options.verticalScrollbarSize=e.verticalScrollbarSize),typeof e.scrollByPage<"u"&&(this._options.scrollByPage=e.scrollByPage),this._horizontalScrollbar.updateOptions(this._options),this._verticalScrollbar.updateOptions(this._options),this._options.lazyRender||this._render()}setRevealOnScroll(e){this._revealOnScroll=e}delegateScrollFromMouseWheelEvent(e){this._onMouseWheel(new vN(e))}_setListeningToMouseWheel(e){if(this._mouseWheelToDispose.length>0!==e&&(this._mouseWheelToDispose=ja(this._mouseWheelToDispose),e)){let t=i=>{this._onMouseWheel(new vN(i))};this._mouseWheelToDispose.push(_e(this._listenOnDomNode,Jt.MOUSE_WHEEL,t,{passive:!1}))}}_onMouseWheel(e){if(e.browserEvent?.defaultPrevented)return;let t=Y5.INSTANCE;ON&&t.acceptStandardWheelEvent(e);let i=!1;if(e.deltaY||e.deltaX){let s=e.deltaY*this._options.mouseWheelScrollSensitivity,r=e.deltaX*this._options.mouseWheelScrollSensitivity;this._options.scrollPredominantAxis&&(this._options.scrollYToX&&r+s===0?r=s=0:Math.abs(s)>=Math.abs(r)?r=0:s=0),this._options.flipAxes&&([s,r]=[r,s]);let a=!Cs&&e.browserEvent&&e.browserEvent.shiftKey;(this._options.scrollYToX||a)&&!r&&(r=s,s=0),e.browserEvent&&e.browserEvent.altKey&&(r=r*this._options.fastScrollSensitivity,s=s*this._options.fastScrollSensitivity);let o=this._scrollable.getFutureScrollPosition(),l={};if(s){let c=MN*s,u=o.scrollTop-(c<0?Math.floor(c):Math.ceil(c));this._verticalScrollbar.writeScrollPosition(l,u)}if(r){let c=MN*r,u=o.scrollLeft-(c<0?Math.floor(c):Math.ceil(c));this._horizontalScrollbar.writeScrollPosition(l,u)}l=this._scrollable.validateScrollPosition(l),(o.scrollLeft!==l.scrollLeft||o.scrollTop!==l.scrollTop)&&(ON&&this._options.mouseWheelSmoothScroll&&t.isPhysicalMouseWheel()?this._scrollable.setScrollPositionSmooth(l):this._scrollable.setScrollPositionNow(l),i=!0)}let n=i;!n&&this._options.alwaysConsumeMouseWheel&&(n=!0),!n&&this._options.consumeMouseWheelIfScrollbarIsNeeded&&(this._verticalScrollbar.isNeeded()||this._horizontalScrollbar.isNeeded())&&(n=!0),n&&(e.preventDefault(),e.stopPropagation())}_onDidScroll(e){this._shouldRender=this._horizontalScrollbar.onDidScroll(e)||this._shouldRender,this._shouldRender=this._verticalScrollbar.onDidScroll(e)||this._shouldRender,this._options.useShadows&&(this._shouldRender=!0),this._revealOnScroll&&this._reveal(),this._options.lazyRender||this._render()}renderNow(){if(!this._options.lazyRender)throw new Error("Please use `lazyRender` together with `renderNow`!");this._render()}_render(){if(this._shouldRender&&(this._shouldRender=!1,this._horizontalScrollbar.render(),this._verticalScrollbar.render(),this._options.useShadows)){let e=this._scrollable.getCurrentScrollPosition(),t=e.scrollTop>0,i=e.scrollLeft>0,n=i?" left":"",s=t?" top":"",r=i||t?" top-left-corner":"";this._leftShadowDomNode.setClassName(`shadow${n}`),this._topShadowDomNode.setClassName(`shadow${s}`),this._topLeftShadowDomNode.setClassName(`shadow${r}${s}${n}`)}}_onDragStart(){this._isDragging=!0,this._reveal()}_onDragEnd(){this._isDragging=!1,this._hide()}_onMouseLeave(e){this._mouseIsOver=!1,this._hide()}_onMouseOver(e){this._mouseIsOver=!0,this._reveal()}_reveal(){this._verticalScrollbar.beginReveal(),this._horizontalScrollbar.beginReveal(),this._scheduleHide()}_hide(){!this._mouseIsOver&&!this._isDragging&&(this._verticalScrollbar.beginHide(),this._horizontalScrollbar.beginHide())}_scheduleHide(){!this._mouseIsOver&&!this._isDragging&&this._hideTimeout.cancelAndSet(()=>this._hide(),G5)}},V5=class extends j5{constructor(e,t,i){super(e,t,i)}setScrollPosition(e){e.reuseAnimation?this._scrollable.setScrollPositionSmooth(e,e.reuseAnimation):this._scrollable.setScrollPositionNow(e)}getScrollPosition(){return this._scrollable.getCurrentScrollPosition()}};$v=class extends xe{constructor(e,t,i,n,s,r,a,o){super(),this._bufferService=i,this._optionsService=a,this._renderService=o,this._onRequestScrollLines=this._register(new X),this.onRequestScrollLines=this._onRequestScrollLines.event,this._isSyncing=!1,this._isHandlingScroll=!1,this._suppressOnScrollHandler=!1;let l=this._register(new z5({forceIntegerValues:!1,smoothScrollDuration:this._optionsService.rawOptions.smoothScrollDuration,scheduleAtNextAnimationFrame:c=>Cf(n.window,c)}));this._register(this._optionsService.onSpecificOptionChange("smoothScrollDuration",()=>{l.setSmoothScrollDuration(this._optionsService.rawOptions.smoothScrollDuration)})),this._scrollableElement=this._register(new V5(t,{vertical:1,horizontal:2,useShadows:!1,mouseWheelSmoothScroll:!0,...this._getChangeOptions()},l)),this._register(this._optionsService.onMultipleOptionChange(["scrollSensitivity","fastScrollSensitivity","overviewRuler"],()=>this._scrollableElement.updateOptions(this._getChangeOptions()))),this._register(s.onProtocolChange(c=>{this._scrollableElement.updateOptions({handleMouseWheel:!(c&16)})})),this._scrollableElement.setScrollDimensions({height:0,scrollHeight:0}),this._register(ni.runAndSubscribe(r.onChangeColors,()=>{this._scrollableElement.getDomNode().style.backgroundColor=r.colors.background.css})),e.appendChild(this._scrollableElement.getDomNode()),this._register(dt(()=>this._scrollableElement.getDomNode().remove())),this._styleElement=n.mainDocument.createElement("style"),t.appendChild(this._styleElement),this._register(dt(()=>this._styleElement.remove())),this._register(ni.runAndSubscribe(r.onChangeColors,()=>{this._styleElement.textContent=[".xterm .xterm-scrollable-element > .scrollbar > .slider {",` background: ${r.colors.scrollbarSliderBackground.css};`,"}",".xterm .xterm-scrollable-element > .scrollbar > .slider:hover {",` background: ${r.colors.scrollbarSliderHoverBackground.css};`,"}",".xterm .xterm-scrollable-element > .scrollbar > .slider.active {",` background: ${r.colors.scrollbarSliderActiveBackground.css};`,"}"].join(`
118
+ `)})),this._register(this._bufferService.onResize(()=>this.queueSync())),this._register(this._bufferService.buffers.onBufferActivate(()=>{this._latestYDisp=void 0,this.queueSync()})),this._register(this._bufferService.onScroll(()=>this._sync())),this._register(this._scrollableElement.onScroll(c=>this._handleScroll(c)))}scrollLines(e){let t=this._scrollableElement.getScrollPosition();this._scrollableElement.setScrollPosition({reuseAnimation:!0,scrollTop:t.scrollTop+e*this._renderService.dimensions.css.cell.height})}scrollToLine(e,t){t&&(this._latestYDisp=e),this._scrollableElement.setScrollPosition({reuseAnimation:!t,scrollTop:e*this._renderService.dimensions.css.cell.height})}_getChangeOptions(){return{mouseWheelScrollSensitivity:this._optionsService.rawOptions.scrollSensitivity,fastScrollSensitivity:this._optionsService.rawOptions.fastScrollSensitivity,verticalScrollbarSize:this._optionsService.rawOptions.overviewRuler?.width||14}}queueSync(e){e!==void 0&&(this._latestYDisp=e),this._queuedAnimationFrame===void 0&&(this._queuedAnimationFrame=this._renderService.addRefreshCallback(()=>{this._queuedAnimationFrame=void 0,this._sync(this._latestYDisp)}))}_sync(e=this._bufferService.buffer.ydisp){!this._renderService||this._isSyncing||(this._isSyncing=!0,this._suppressOnScrollHandler=!0,this._scrollableElement.setScrollDimensions({height:this._renderService.dimensions.css.canvas.height,scrollHeight:this._renderService.dimensions.css.cell.height*this._bufferService.buffer.lines.length}),this._suppressOnScrollHandler=!1,e!==this._latestYDisp&&this._scrollableElement.setScrollPosition({scrollTop:e*this._renderService.dimensions.css.cell.height}),this._isSyncing=!1)}_handleScroll(e){if(!this._renderService||this._isHandlingScroll||this._suppressOnScrollHandler)return;this._isHandlingScroll=!0;let t=Math.round(e.scrollTop/this._renderService.dimensions.css.cell.height),i=t-this._bufferService.buffer.ydisp;i!==0&&(this._latestYDisp=t,this._onRequestScrollLines.fire(i)),this._isHandlingScroll=!1}};$v=xt([ne(2,Di),ne(3,er),ne(4,pA),ne(5,Ol),ne(6,Li),ne(7,tr)],$v);Yv=class extends xe{constructor(e,t,i,n,s){super(),this._screenElement=e,this._bufferService=t,this._coreBrowserService=i,this._decorationService=n,this._renderService=s,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(r=>this._removeDecoration(r))),this._register(dt(()=>{this._container.remove(),this._decorationElements.clear()}))}_queueRefresh(){this._animationFrame===void 0&&(this._animationFrame=this._renderService.addRefreshCallback(()=>{this._doRefreshDecorations(),this._animationFrame=void 0}))}_doRefreshDecorations(){for(let e of this._decorationService.decorations)this._renderDecoration(e);this._dimensionsChanged=!1}_renderDecoration(e){this._refreshStyle(e),this._dimensionsChanged&&this._refreshXPosition(e)}_createElement(e){let t=this._coreBrowserService.mainDocument.createElement("div");t.classList.add("xterm-decoration"),t.classList.toggle("xterm-decoration-top-layer",e?.options?.layer==="top"),t.style.width=`${Math.round((e.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,t.style.height=`${(e.options.height||1)*this._renderService.dimensions.css.cell.height}px`,t.style.top=`${(e.marker.line-this._bufferService.buffers.active.ydisp)*this._renderService.dimensions.css.cell.height}px`,t.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`;let i=e.options.x??0;return i&&i>this._bufferService.cols&&(t.style.display="none"),this._refreshXPosition(e,t),t}_refreshStyle(e){let t=e.marker.line-this._bufferService.buffers.active.ydisp;if(t<0||t>=this._bufferService.rows)e.element&&(e.element.style.display="none",e.onRenderEmitter.fire(e.element));else{let i=this._decorationElements.get(e);i||(i=this._createElement(e),e.element=i,this._decorationElements.set(e,i),this._container.appendChild(i),e.onDispose(()=>{this._decorationElements.delete(e),i.remove()})),i.style.display=this._altBufferIsActive?"none":"block",this._altBufferIsActive||(i.style.width=`${Math.round((e.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,i.style.height=`${(e.options.height||1)*this._renderService.dimensions.css.cell.height}px`,i.style.top=`${t*this._renderService.dimensions.css.cell.height}px`,i.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`),e.onRenderEmitter.fire(i)}}_refreshXPosition(e,t=e.element){if(!t)return;let i=e.options.x??0;(e.options.anchor||"left")==="right"?t.style.right=i?`${i*this._renderService.dimensions.css.cell.width}px`:"":t.style.left=i?`${i*this._renderService.dimensions.css.cell.width}px`:""}_removeDecoration(e){this._decorationElements.get(e)?.remove(),this._decorationElements.delete(e),e.dispose()}};Yv=xt([ne(1,Di),ne(2,er),ne(3,Cu),ne(4,tr)],Yv);Z5=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(e){if(e.options.overviewRulerOptions){for(let t of this._zones)if(t.color===e.options.overviewRulerOptions.color&&t.position===e.options.overviewRulerOptions.position){if(this._lineIntersectsZone(t,e.marker.line))return;if(this._lineAdjacentToZone(t,e.marker.line,e.options.overviewRulerOptions.position)){this._addLineToZone(t,e.marker.line);return}}if(this._zonePoolIndex<this._zonePool.length){this._zonePool[this._zonePoolIndex].color=e.options.overviewRulerOptions.color,this._zonePool[this._zonePoolIndex].position=e.options.overviewRulerOptions.position,this._zonePool[this._zonePoolIndex].startBufferLine=e.marker.line,this._zonePool[this._zonePoolIndex].endBufferLine=e.marker.line,this._zones.push(this._zonePool[this._zonePoolIndex++]);return}this._zones.push({color:e.options.overviewRulerOptions.color,position:e.options.overviewRulerOptions.position,startBufferLine:e.marker.line,endBufferLine:e.marker.line}),this._zonePool.push(this._zones[this._zones.length-1]),this._zonePoolIndex++}}setPadding(e){this._linePadding=e}_lineIntersectsZone(e,t){return t>=e.startBufferLine&&t<=e.endBufferLine}_lineAdjacentToZone(e,t,i){return t>=e.startBufferLine-this._linePadding[i||"full"]&&t<=e.endBufferLine+this._linePadding[i||"full"]}_addLineToZone(e,t){e.startBufferLine=Math.min(e.startBufferLine,t),e.endBufferLine=Math.max(e.endBufferLine,t)}},Es={full:0,left:0,center:0,right:0},$r={full:0,left:0,center:0,right:0},su={full:0,left:0,center:0,right:0},kf=class extends xe{constructor(e,t,i,n,s,r,a,o){super(),this._viewportElement=e,this._screenElement=t,this._bufferService=i,this._decorationService=n,this._renderService=s,this._optionsService=r,this._themeService=a,this._coreBrowserService=o,this._colorZoneStore=new Z5,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(),this._viewportElement.parentElement?.insertBefore(this._canvas,this._viewportElement),this._register(dt(()=>this._canvas?.remove()));let l=this._canvas.getContext("2d");if(l)this._ctx=l;else throw new Error("Ctx cannot be null");this._register(this._decorationService.onDecorationRegistered(()=>this._queueRefresh(void 0,!0))),this._register(this._decorationService.onDecorationRemoved(()=>this._queueRefresh(void 0,!0))),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())})),this._register(this._renderService.onRender(()=>{(!this._containerHeight||this._containerHeight!==this._screenElement.clientHeight)&&(this._queueRefresh(!0),this._containerHeight=this._screenElement.clientHeight)})),this._register(this._coreBrowserService.onDprChange(()=>this._queueRefresh(!0))),this._register(this._optionsService.onSpecificOptionChange("overviewRuler",()=>this._queueRefresh(!0))),this._register(this._themeService.onChangeColors(()=>this._queueRefresh())),this._queueRefresh(!0)}get _width(){return this._optionsService.options.overviewRuler?.width||0}_refreshDrawConstants(){let e=Math.floor((this._canvas.width-1)/3),t=Math.ceil((this._canvas.width-1)/3);$r.full=this._canvas.width,$r.left=e,$r.center=t,$r.right=e,this._refreshDrawHeightConstants(),su.full=1,su.left=1,su.center=1+$r.left,su.right=1+$r.left+$r.center}_refreshDrawHeightConstants(){Es.full=Math.round(2*this._coreBrowserService.dpr);let e=this._canvas.height/this._bufferService.buffer.lines.length,t=Math.round(Math.max(Math.min(e,12),6)*this._coreBrowserService.dpr);Es.left=t,Es.center=t,Es.right=t}_refreshColorZonePadding(){this._colorZoneStore.setPadding({full:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*Es.full),left:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*Es.left),center:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*Es.center),right:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*Es.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(let t of this._decorationService.decorations)this._colorZoneStore.addDecoration(t);this._ctx.lineWidth=1,this._renderRulerOutline();let e=this._colorZoneStore.zones;for(let t of e)t.position!=="full"&&this._renderColorZone(t);for(let t of e)t.position==="full"&&this._renderColorZone(t);this._shouldUpdateDimensions=!1,this._shouldUpdateAnchor=!1}_renderRulerOutline(){this._ctx.fillStyle=this._themeService.colors.overviewRulerBorder.css,this._ctx.fillRect(0,0,1,this._canvas.height),this._optionsService.rawOptions.overviewRuler.showTopBorder&&this._ctx.fillRect(1,0,this._canvas.width-1,1),this._optionsService.rawOptions.overviewRuler.showBottomBorder&&this._ctx.fillRect(1,this._canvas.height-1,this._canvas.width-1,this._canvas.height)}_renderColorZone(e){this._ctx.fillStyle=e.color,this._ctx.fillRect(su[e.position||"full"],Math.round((this._canvas.height-1)*(e.startBufferLine/this._bufferService.buffers.active.lines.length)-Es[e.position||"full"]/2),$r[e.position||"full"],Math.round((this._canvas.height-1)*((e.endBufferLine-e.startBufferLine)/this._bufferService.buffers.active.lines.length)+Es[e.position||"full"]))}_queueRefresh(e,t){this._shouldUpdateDimensions=e||this._shouldUpdateDimensions,this._shouldUpdateAnchor=t||this._shouldUpdateAnchor,this._animationFrame===void 0&&(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>{this._refreshDecorations(),this._animationFrame=void 0}))}};kf=xt([ne(2,Di),ne(3,Cu),ne(4,tr),ne(5,Li),ne(6,Ol),ne(7,er)],kf);(e=>(e.NUL="\0",e.SOH="",e.STX="",e.ETX="",e.EOT="",e.ENQ="",e.ACK="",e.BEL="\x07",e.BS="\b",e.HT=" ",e.LF=`
119
+ `,e.VT="\v",e.FF="\f",e.CR="\r",e.SO="",e.SI="",e.DLE="",e.DC1="",e.DC2="",e.DC3="",e.DC4="",e.NAK="",e.SYN="",e.ETB="",e.CAN="",e.EM="",e.SUB="",e.ESC="\x1B",e.FS="",e.GS="",e.RS="",e.US="",e.SP=" ",e.DEL="\x7F"))(z||(z={}));(e=>(e.PAD="\x80",e.HOP="\x81",e.BPH="\x82",e.NBH="\x83",e.IND="\x84",e.NEL="\x85",e.SSA="\x86",e.ESA="\x87",e.HTS="\x88",e.HTJ="\x89",e.VTS="\x8A",e.PLD="\x8B",e.PLU="\x8C",e.RI="\x8D",e.SS2="\x8E",e.SS3="\x8F",e.DCS="\x90",e.PU1="\x91",e.PU2="\x92",e.STS="\x93",e.CCH="\x94",e.MW="\x95",e.SPA="\x96",e.EPA="\x97",e.SOS="\x98",e.SGCI="\x99",e.SCI="\x9A",e.CSI="\x9B",e.ST="\x9C",e.OSC="\x9D",e.PM="\x9E",e.APC="\x9F"))(vu||(vu={}));(e=>e.ST=`${z.ESC}\\`)(jv||(jv={}));Vv=class{constructor(e,t,i,n,s,r){this._textarea=e,this._compositionView=t,this._bufferService=i,this._optionsService=n,this._coreService=s,this._renderService=r,this._isComposing=!1,this._isSendingComposition=!1,this._compositionPosition={start:0,end:0},this._dataAlreadySent=""}get isComposing(){return this._isComposing}compositionstart(){this._isComposing=!0,this._compositionPosition.start=this._textarea.value.length,this._compositionView.textContent="",this._dataAlreadySent="",this._compositionView.classList.add("active")}compositionupdate(e){this._compositionView.textContent=e.data,this.updateCompositionElements(),setTimeout(()=>{this._compositionPosition.end=this._textarea.value.length},0)}compositionend(){this._finalizeComposition(!0)}keydown(e){if(this._isComposing||this._isSendingComposition){if(e.keyCode===20||e.keyCode===229||e.keyCode===16||e.keyCode===17||e.keyCode===18)return!1;this._finalizeComposition(!1)}return e.keyCode===229?(this._handleAnyTextareaChanges(),!1):!0}_finalizeComposition(e){if(this._compositionView.classList.remove("active"),this._isComposing=!1,e){let t={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout(()=>{if(this._isSendingComposition){this._isSendingComposition=!1;let i;t.start+=this._dataAlreadySent.length,this._isComposing?i=this._textarea.value.substring(t.start,this._compositionPosition.start):i=this._textarea.value.substring(t.start),i.length>0&&this._coreService.triggerDataEvent(i,!0)}},0)}else{this._isSendingComposition=!1;let t=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(t,!0)}}_handleAnyTextareaChanges(){let e=this._textarea.value;setTimeout(()=>{if(!this._isComposing){let t=this._textarea.value,i=t.replace(e,"");this._dataAlreadySent=i,t.length>e.length?this._coreService.triggerDataEvent(i,!0):t.length<e.length?this._coreService.triggerDataEvent(`${z.DEL}`,!0):t.length===e.length&&t!==e&&this._coreService.triggerDataEvent(t,!0)}},0)}updateCompositionElements(e){if(this._isComposing){if(this._bufferService.buffer.isCursorInViewport){let t=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1),i=this._renderService.dimensions.css.cell.height,n=this._bufferService.buffer.y*this._renderService.dimensions.css.cell.height,s=t*this._renderService.dimensions.css.cell.width;this._compositionView.style.left=s+"px",this._compositionView.style.top=n+"px",this._compositionView.style.height=i+"px",this._compositionView.style.lineHeight=i+"px",this._compositionView.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._compositionView.style.fontSize=this._optionsService.rawOptions.fontSize+"px";let r=this._compositionView.getBoundingClientRect();this._textarea.style.left=s+"px",this._textarea.style.top=n+"px",this._textarea.style.width=Math.max(r.width,1)+"px",this._textarea.style.height=Math.max(r.height,1)+"px",this._textarea.style.lineHeight=r.height+"px"}e||setTimeout(()=>this.updateCompositionElements(!0),0)}}};Vv=xt([ne(2,Di),ne(3,Li),ne(4,Xa),ne(5,tr)],Vv);ei=0,ti=0,ii=0,Et=0,RN={css:"#00000000",rgba:0};(e=>{function t(s,r,a,o){return o!==void 0?`#${Ka(s)}${Ka(r)}${Ka(a)}${Ka(o)}`:`#${Ka(s)}${Ka(r)}${Ka(a)}`}e.toCss=t;function i(s,r,a,o=255){return(s<<24|r<<16|a<<8|o)>>>0}e.toRgba=i;function n(s,r,a,o){return{css:e.toCss(s,r,a,o),rgba:e.toRgba(s,r,a,o)}}e.toColor=n})(At||(At={}));(e=>{function t(l,c){if(Et=(c.rgba&255)/255,Et===1)return{css:c.css,rgba:c.rgba};let u=c.rgba>>24&255,h=c.rgba>>16&255,d=c.rgba>>8&255,f=l.rgba>>24&255,p=l.rgba>>16&255,_=l.rgba>>8&255;ei=f+Math.round((u-f)*Et),ti=p+Math.round((h-p)*Et),ii=_+Math.round((d-_)*Et);let v=At.toCss(ei,ti,ii),g=At.toRgba(ei,ti,ii);return{css:v,rgba:g}}e.blend=t;function i(l){return(l.rgba&255)===255}e.isOpaque=i;function n(l,c,u){let h=bu.ensureContrastRatio(l.rgba,c.rgba,u);if(h)return At.toColor(h>>24&255,h>>16&255,h>>8&255)}e.ensureContrastRatio=n;function s(l){let c=(l.rgba|255)>>>0;return[ei,ti,ii]=bu.toChannels(c),{css:At.toCss(ei,ti,ii),rgba:c}}e.opaque=s;function r(l,c){return Et=Math.round(c*255),[ei,ti,ii]=bu.toChannels(l.rgba),{css:At.toCss(ei,ti,ii,Et),rgba:At.toRgba(ei,ti,ii,Et)}}e.opacity=r;function a(l,c){return Et=l.rgba&255,r(l,Et*c/255)}e.multiplyOpacity=a;function o(l){return[l.rgba>>24&255,l.rgba>>16&255,l.rgba>>8&255]}e.toColorRGB=o})(ut||(ut={}));(e=>{let t,i;try{let s=document.createElement("canvas");s.width=1,s.height=1;let r=s.getContext("2d",{willReadFrequently:!0});r&&(t=r,t.globalCompositeOperation="copy",i=t.createLinearGradient(0,0,1,1))}catch{}function n(s){if(s.match(/#[\da-f]{3,8}/i))switch(s.length){case 4:return ei=parseInt(s.slice(1,2).repeat(2),16),ti=parseInt(s.slice(2,3).repeat(2),16),ii=parseInt(s.slice(3,4).repeat(2),16),At.toColor(ei,ti,ii);case 5:return ei=parseInt(s.slice(1,2).repeat(2),16),ti=parseInt(s.slice(2,3).repeat(2),16),ii=parseInt(s.slice(3,4).repeat(2),16),Et=parseInt(s.slice(4,5).repeat(2),16),At.toColor(ei,ti,ii,Et);case 7:return{css:s,rgba:(parseInt(s.slice(1),16)<<8|255)>>>0};case 9:return{css:s,rgba:parseInt(s.slice(1),16)>>>0}}let r=s.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(r)return ei=parseInt(r[1]),ti=parseInt(r[2]),ii=parseInt(r[3]),Et=Math.round((r[5]===void 0?1:parseFloat(r[5]))*255),At.toColor(ei,ti,ii,Et);if(!t||!i)throw new Error("css.toColor: Unsupported css format");if(t.fillStyle=i,t.fillStyle=s,typeof t.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(t.fillRect(0,0,1,1),[ei,ti,ii,Et]=t.getImageData(0,0,1,1).data,Et!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:At.toRgba(ei,ti,ii,Et),css:s}}e.toColor=n})(gt||(gt={}));(e=>{function t(n){return i(n>>16&255,n>>8&255,n&255)}e.relativeLuminance=t;function i(n,s,r){let a=n/255,o=s/255,l=r/255,c=a<=.03928?a/12.92:Math.pow((a+.055)/1.055,2.4),u=o<=.03928?o/12.92:Math.pow((o+.055)/1.055,2.4),h=l<=.03928?l/12.92:Math.pow((l+.055)/1.055,2.4);return c*.2126+u*.7152+h*.0722}e.relativeLuminance2=i})(Ci||(Ci={}));(e=>{function t(a,o){if(Et=(o&255)/255,Et===1)return o;let l=o>>24&255,c=o>>16&255,u=o>>8&255,h=a>>24&255,d=a>>16&255,f=a>>8&255;return ei=h+Math.round((l-h)*Et),ti=d+Math.round((c-d)*Et),ii=f+Math.round((u-f)*Et),At.toRgba(ei,ti,ii)}e.blend=t;function i(a,o,l){let c=Ci.relativeLuminance(a>>8),u=Ci.relativeLuminance(o>>8);if(Xs(c,u)<l){if(u<c){let f=n(a,o,l),p=Xs(c,Ci.relativeLuminance(f>>8));if(p<l){let _=s(a,o,l),v=Xs(c,Ci.relativeLuminance(_>>8));return p>v?f:_}return f}let h=s(a,o,l),d=Xs(c,Ci.relativeLuminance(h>>8));if(d<l){let f=n(a,o,l),p=Xs(c,Ci.relativeLuminance(f>>8));return d>p?h:f}return h}}e.ensureContrastRatio=i;function n(a,o,l){let c=a>>24&255,u=a>>16&255,h=a>>8&255,d=o>>24&255,f=o>>16&255,p=o>>8&255,_=Xs(Ci.relativeLuminance2(d,f,p),Ci.relativeLuminance2(c,u,h));for(;_<l&&(d>0||f>0||p>0);)d-=Math.max(0,Math.ceil(d*.1)),f-=Math.max(0,Math.ceil(f*.1)),p-=Math.max(0,Math.ceil(p*.1)),_=Xs(Ci.relativeLuminance2(d,f,p),Ci.relativeLuminance2(c,u,h));return(d<<24|f<<16|p<<8|255)>>>0}e.reduceLuminance=n;function s(a,o,l){let c=a>>24&255,u=a>>16&255,h=a>>8&255,d=o>>24&255,f=o>>16&255,p=o>>8&255,_=Xs(Ci.relativeLuminance2(d,f,p),Ci.relativeLuminance2(c,u,h));for(;_<l&&(d<255||f<255||p<255);)d=Math.min(255,d+Math.ceil((255-d)*.1)),f=Math.min(255,f+Math.ceil((255-f)*.1)),p=Math.min(255,p+Math.ceil((255-p)*.1)),_=Xs(Ci.relativeLuminance2(d,f,p),Ci.relativeLuminance2(c,u,h));return(d<<24|f<<16|p<<8|255)>>>0}e.increaseLuminance=s;function r(a){return[a>>24&255,a>>16&255,a>>8&255,a&255]}e.toChannels=r})(bu||(bu={}));Q5=class extends xu{constructor(e,t,i){super(),this.content=0,this.combinedData="",this.fg=e.fg,this.bg=e.bg,this.combinedData=t,this._width=i}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(e){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}},Tf=class{constructor(e){this._bufferService=e,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new Ln}register(e){let t={id:this._nextCharacterJoinerId++,handler:e};return this._characterJoiners.push(t),t.id}deregister(e){for(let t=0;t<this._characterJoiners.length;t++)if(this._characterJoiners[t].id===e)return this._characterJoiners.splice(t,1),!0;return!1}getJoinedCharacters(e){if(this._characterJoiners.length===0)return[];let t=this._bufferService.buffer.lines.get(e);if(!t||t.length===0)return[];let i=[],n=t.translateToString(!0),s=0,r=0,a=0,o=t.getFg(0),l=t.getBg(0);for(let c=0;c<t.getTrimmedLength();c++)if(t.loadCell(c,this._workCell),this._workCell.getWidth()!==0){if(this._workCell.fg!==o||this._workCell.bg!==l){if(c-s>1){let u=this._getJoinedRanges(n,a,r,t,s);for(let h=0;h<u.length;h++)i.push(u[h])}s=c,a=r,o=this._workCell.fg,l=this._workCell.bg}r+=this._workCell.getChars().length||Vr.length}if(this._bufferService.cols-s>1){let c=this._getJoinedRanges(n,a,r,t,s);for(let u=0;u<c.length;u++)i.push(c[u])}return i}_getJoinedRanges(e,t,i,n,s){let r=e.substring(t,i),a=[];try{a=this._characterJoiners[0].handler(r)}catch(o){console.error(o)}for(let o=1;o<this._characterJoiners.length;o++)try{let l=this._characterJoiners[o].handler(r);for(let c=0;c<l.length;c++)Tf._mergeRanges(a,l[c])}catch(l){console.error(l)}return this._stringRangesToCellRanges(a,n,s),a}_stringRangesToCellRanges(e,t,i){let n=0,s=!1,r=0,a=e[n];if(a){for(let o=i;o<this._bufferService.cols;o++){let l=t.getWidth(o),c=t.getString(o).length||Vr.length;if(l!==0){if(!s&&a[0]<=r&&(a[0]=o,s=!0),a[1]<=r){if(a[1]=o,a=e[++n],!a)break;a[0]<=r?(a[0]=o,s=!0):s=!1}r+=c}}a&&(a[1]=this._bufferService.cols)}}static _mergeRanges(e,t){let i=!1;for(let n=0;n<e.length;n++){let s=e[n];if(i){if(t[1]<=s[0])return e[n-1][1]=t[1],e;if(t[1]<=s[1])return e[n-1][1]=Math.max(t[1],s[1]),e.splice(n,1),e;e.splice(n,1),n--}else{if(t[1]<=s[0])return e.splice(n,0,t),e;if(t[1]<=s[1])return s[0]=Math.min(t[0],s[0]),e;t[0]<s[1]&&(s[0]=Math.min(t[0],s[0]),i=!0);continue}}return i?e[e.length-1][1]=t[1]:e.push(t),e}};Tf=xt([ne(0,Di)],Tf);Xv=class{constructor(e,t,i,n,s,r,a){this._document=e,this._characterJoinerService=t,this._optionsService=i,this._coreBrowserService=n,this._coreService=s,this._decorationService=r,this._themeService=a,this._workCell=new Ln,this._columnSelectMode=!1,this.defaultSpacing=0}handleSelectionChanged(e,t,i){this._selectionStart=e,this._selectionEnd=t,this._columnSelectMode=i}createRow(e,t,i,n,s,r,a,o,l,c,u){let h=[],d=this._characterJoinerService.getJoinedCharacters(t),f=this._themeService.colors,p=e.getNoBgTrimmedLength();i&&p<r+1&&(p=r+1);let _,v=0,g="",m=0,b=0,S=0,x=0,C=!1,N=0,M=!1,O=0,q=0,G=[],I=c!==-1&&u!==-1;for(let P=0;P<p;P++){e.loadCell(P,this._workCell);let R=this._workCell.getWidth();if(R===0)continue;let K=!1,T=P>=q,D=P,A=this._workCell;if(d.length>0&&P===d[0][0]&&T){let ve=d.shift(),mn=this._isCellInSelection(ve[0],t);for(m=ve[0]+1;m<ve[1];m++)T&&(T=mn===this._isCellInSelection(m,t));T&&(T=!i||r<ve[0]||r>=ve[1]),T?(K=!0,A=new Q5(this._workCell,e.translateToString(!0,ve[0],ve[1]),ve[1]-ve[0]),D=ve[1]-1,R=A.getWidth()):q=ve[1]}let Z=this._isCellInSelection(P,t),re=i&&P===r,L=I&&P>=c&&P<=u,ee=!1;this._decorationService.forEachDecorationAtCell(P,t,void 0,ve=>{ee=!0});let Ce=A.getChars()||Vr;if(Ce===" "&&(A.isUnderline()||A.isOverline())&&(Ce="\xA0"),O=R*o-l.get(Ce,A.isBold(),A.isItalic()),!_)_=this._document.createElement("span");else if(v&&(Z&&M||!Z&&!M&&A.bg===b)&&(Z&&M&&f.selectionForeground||A.fg===S)&&A.extended.ext===x&&L===C&&O===N&&!re&&!K&&!ee&&T){A.isInvisible()?g+=Vr:g+=Ce,v++;continue}else v&&(_.textContent=g),_=this._document.createElement("span"),v=0,g="";if(b=A.bg,S=A.fg,x=A.extended.ext,C=L,N=O,M=Z,K&&r>=P&&r<=D&&(r=P),!this._coreService.isCursorHidden&&re&&this._coreService.isCursorInitialized){if(G.push("xterm-cursor"),this._coreBrowserService.isFocused)a&&G.push("xterm-cursor-blink"),G.push(n==="bar"?"xterm-cursor-bar":n==="underline"?"xterm-cursor-underline":"xterm-cursor-block");else if(s)switch(s){case"outline":G.push("xterm-cursor-outline");break;case"block":G.push("xterm-cursor-block");break;case"bar":G.push("xterm-cursor-bar");break;case"underline":G.push("xterm-cursor-underline");break;default:break}}if(A.isBold()&&G.push("xterm-bold"),A.isItalic()&&G.push("xterm-italic"),A.isDim()&&G.push("xterm-dim"),A.isInvisible()?g=Vr:g=A.getChars()||Vr,A.isUnderline()&&(G.push(`xterm-underline-${A.extended.underlineStyle}`),g===" "&&(g="\xA0"),!A.isUnderlineColorDefault()))if(A.isUnderlineColorRGB())_.style.textDecorationColor=`rgb(${xu.toColorRGB(A.getUnderlineColor()).join(",")})`;else{let ve=A.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&A.isBold()&&ve<8&&(ve+=8),_.style.textDecorationColor=f.ansi[ve].css}A.isOverline()&&(G.push("xterm-overline"),g===" "&&(g="\xA0")),A.isStrikethrough()&&G.push("xterm-strikethrough"),L&&(_.style.textDecoration="underline");let ue=A.getFgColor(),Ue=A.getFgColorMode(),Q=A.getBgColor(),Oe=A.getBgColorMode(),_i=!!A.isInverse();if(_i){let ve=ue;ue=Q,Q=ve;let mn=Ue;Ue=Oe,Oe=mn}let zt,Bi,Ii=!1;this._decorationService.forEachDecorationAtCell(P,t,void 0,ve=>{ve.options.layer!=="top"&&Ii||(ve.backgroundColorRGB&&(Oe=50331648,Q=ve.backgroundColorRGB.rgba>>8&16777215,zt=ve.backgroundColorRGB),ve.foregroundColorRGB&&(Ue=50331648,ue=ve.foregroundColorRGB.rgba>>8&16777215,Bi=ve.foregroundColorRGB),Ii=ve.options.layer==="top")}),!Ii&&Z&&(zt=this._coreBrowserService.isFocused?f.selectionBackgroundOpaque:f.selectionInactiveBackgroundOpaque,Q=zt.rgba>>8&16777215,Oe=50331648,Ii=!0,f.selectionForeground&&(Ue=50331648,ue=f.selectionForeground.rgba>>8&16777215,Bi=f.selectionForeground)),Ii&&G.push("xterm-decoration-top");let vi;switch(Oe){case 16777216:case 33554432:vi=f.ansi[Q],G.push(`xterm-bg-${Q}`);break;case 50331648:vi=At.toColor(Q>>16,Q>>8&255,Q&255),this._addStyle(_,`background-color:#${DN((Q>>>0).toString(16),"0",6)}`);break;default:_i?(vi=f.foreground,G.push("xterm-bg-257")):vi=f.background}switch(zt||A.isDim()&&(zt=ut.multiplyOpacity(vi,.5)),Ue){case 16777216:case 33554432:A.isBold()&&ue<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(ue+=8),this._applyMinimumContrast(_,vi,f.ansi[ue],A,zt,void 0)||G.push(`xterm-fg-${ue}`);break;case 50331648:let ve=At.toColor(ue>>16&255,ue>>8&255,ue&255);this._applyMinimumContrast(_,vi,ve,A,zt,Bi)||this._addStyle(_,`color:#${DN(ue.toString(16),"0",6)}`);break;default:this._applyMinimumContrast(_,vi,f.foreground,A,zt,Bi)||_i&&G.push("xterm-fg-257")}G.length&&(_.className=G.join(" "),G.length=0),!re&&!K&&!ee&&T?v++:_.textContent=g,O!==this.defaultSpacing&&(_.style.letterSpacing=`${O}px`),h.push(_),P=D}return _&&v&&(_.textContent=g),h}_applyMinimumContrast(e,t,i,n,s,r){if(this._optionsService.rawOptions.minimumContrastRatio===1||t6(n.getCode()))return!1;let a=this._getContrastCache(n),o;if(!s&&!r&&(o=a.getColor(t.rgba,i.rgba)),o===void 0){let l=this._optionsService.rawOptions.minimumContrastRatio/(n.isDim()?2:1);o=ut.ensureContrastRatio(s||t,r||i,l),a.setColor((s||t).rgba,(r||i).rgba,o??null)}return o?(this._addStyle(e,`color:${o.css}`),!0):!1}_getContrastCache(e){return e.isDim()?this._themeService.colors.halfContrastCache:this._themeService.colors.contrastCache}_addStyle(e,t){e.setAttribute("style",`${e.getAttribute("style")||""}${t};`)}_isCellInSelection(e,t){let i=this._selectionStart,n=this._selectionEnd;return!i||!n?!1:this._columnSelectMode?i[0]<=n[0]?e>=i[0]&&t>=i[1]&&e<n[0]&&t<=n[1]:e<i[0]&&t>=i[1]&&e>=n[0]&&t<=n[1]:t>i[1]&&t<n[1]||i[1]===n[1]&&t===i[1]&&e>=i[0]&&e<n[0]||i[1]<n[1]&&t===n[1]&&e<n[0]||i[1]<n[1]&&t===i[1]&&e>=i[0]}};Xv=xt([ne(1,_A),ne(2,Li),ne(3,er),ne(4,Xa),ne(5,Cu),ne(6,Ol)],Xv);n6=class{constructor(e,t){this._flat=new Float32Array(256),this._font="",this._fontSize=0,this._weight="normal",this._weightBold="bold",this._measureElements=[],this._container=e.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";let i=e.createElement("span");i.classList.add("xterm-char-measure-element");let n=e.createElement("span");n.classList.add("xterm-char-measure-element"),n.style.fontWeight="bold";let s=e.createElement("span");s.classList.add("xterm-char-measure-element"),s.style.fontStyle="italic";let r=e.createElement("span");r.classList.add("xterm-char-measure-element"),r.style.fontWeight="bold",r.style.fontStyle="italic",this._measureElements=[i,n,s,r],this._container.appendChild(i),this._container.appendChild(n),this._container.appendChild(s),this._container.appendChild(r),t.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(e,t,i,n){e===this._font&&t===this._fontSize&&i===this._weight&&n===this._weightBold||(this._font=e,this._fontSize=t,this._weight=i,this._weightBold=n,this._container.style.fontFamily=this._font,this._container.style.fontSize=`${this._fontSize}px`,this._measureElements[0].style.fontWeight=`${i}`,this._measureElements[1].style.fontWeight=`${n}`,this._measureElements[2].style.fontWeight=`${i}`,this._measureElements[3].style.fontWeight=`${n}`,this.clear())}get(e,t,i){let n=0;if(!t&&!i&&e.length===1&&(n=e.charCodeAt(0))<256){if(this._flat[n]!==-9999)return this._flat[n];let a=this._measure(e,0);return a>0&&(this._flat[n]=a),a}let s=e;t&&(s+="B"),i&&(s+="I");let r=this._holey.get(s);if(r===void 0){let a=0;t&&(a|=1),i&&(a|=2),r=this._measure(e,a),r>0&&this._holey.set(s,r)}return r}_measure(e,t){let i=this._measureElements[t];return i.textContent=e.repeat(32),i.offsetWidth/32}},s6=class{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(e,t,i,n=!1){if(this.selectionStart=t,this.selectionEnd=i,!t||!i||t[0]===i[0]&&t[1]===i[1]){this.clear();return}let s=e.buffers.active.ydisp,r=t[1]-s,a=i[1]-s,o=Math.max(r,0),l=Math.min(a,e.rows-1);if(o>=e.rows||l<0){this.clear();return}this.hasSelection=!0,this.columnSelectMode=n,this.viewportStartRow=r,this.viewportEndRow=a,this.viewportCappedStartRow=o,this.viewportCappedEndRow=l,this.startCol=t[0],this.endCol=i[0]}isCellSelected(e,t,i){return this.hasSelection?(i-=e.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?t>=this.startCol&&i>=this.viewportCappedStartRow&&t<this.endCol&&i<=this.viewportCappedEndRow:t<this.startCol&&i>=this.viewportCappedStartRow&&t>=this.endCol&&i<=this.viewportCappedEndRow:i>this.viewportStartRow&&i<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&i===this.viewportStartRow&&t>=this.startCol&&t<this.endCol||this.viewportStartRow<this.viewportEndRow&&i===this.viewportEndRow&&t<this.endCol||this.viewportStartRow<this.viewportEndRow&&i===this.viewportStartRow&&t>=this.startCol):!1}};mv="xterm-dom-renderer-owner-",On="xterm-rows",hf="xterm-fg-",LN="xterm-bg-",ru="xterm-focus",df="xterm-selection",a6=1,Zv=class extends xe{constructor(e,t,i,n,s,r,a,o,l,c,u,h,d,f){super(),this._terminal=e,this._document=t,this._element=i,this._screenElement=n,this._viewportElement=s,this._helperContainer=r,this._linkifier2=a,this._charSizeService=l,this._optionsService=c,this._bufferService=u,this._coreService=h,this._coreBrowserService=d,this._themeService=f,this._terminalClass=a6++,this._rowElements=[],this._selectionRenderModel=r6(),this.onRequestRedraw=this._register(new X).event,this._rowContainer=this._document.createElement("div"),this._rowContainer.classList.add(On),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(df),this._selectionContainer.setAttribute("aria-hidden","true"),this.dimensions=i6(),this._updateDimensions(),this._register(this._optionsService.onOptionChange(()=>this._handleOptionsChanged())),this._register(this._themeService.onChangeColors(p=>this._injectCss(p))),this._injectCss(this._themeService.colors),this._rowFactory=o.createInstance(Xv,document),this._element.classList.add(mv+this._terminalClass),this._screenElement.appendChild(this._rowContainer),this._screenElement.appendChild(this._selectionContainer),this._register(this._linkifier2.onShowLinkUnderline(p=>this._handleLinkHover(p))),this._register(this._linkifier2.onHideLinkUnderline(p=>this._handleLinkLeave(p))),this._register(dt(()=>{this._element.classList.remove(mv+this._terminalClass),this._rowContainer.remove(),this._selectionContainer.remove(),this._widthCache.dispose(),this._themeStyleElement.remove(),this._dimensionsStyleElement.remove()})),this._widthCache=new n6(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(){let e=this._coreBrowserService.dpr;this.dimensions.device.char.width=this._charSizeService.width*e,this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*e),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/e),this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/e),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(let i of this._rowElements)i.style.width=`${this.dimensions.css.canvas.width}px`,i.style.height=`${this.dimensions.css.cell.height}px`,i.style.lineHeight=`${this.dimensions.css.cell.height}px`,i.style.overflow="hidden";this._dimensionsStyleElement||(this._dimensionsStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._dimensionsStyleElement));let t=`${this._terminalSelector} .${On} span { display: inline-block; height: 100%; vertical-align: top;}`;this._dimensionsStyleElement.textContent=t,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(e){this._themeStyleElement||(this._themeStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._themeStyleElement));let t=`${this._terminalSelector} .${On} { pointer-events: none; color: ${e.foreground.css}; font-family: ${this._optionsService.rawOptions.fontFamily}; font-size: ${this._optionsService.rawOptions.fontSize}px; font-kerning: none; white-space: pre}`;t+=`${this._terminalSelector} .${On} .xterm-dim { color: ${ut.multiplyOpacity(e.foreground,.5).css};}`,t+=`${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;}`;let i=`blink_underline_${this._terminalClass}`,n=`blink_bar_${this._terminalClass}`,s=`blink_block_${this._terminalClass}`;t+=`@keyframes ${i} { 50% { border-bottom-style: hidden; }}`,t+=`@keyframes ${n} { 50% { box-shadow: none; }}`,t+=`@keyframes ${s} { 0% { background-color: ${e.cursor.css}; color: ${e.cursorAccent.css}; } 50% { background-color: inherit; color: ${e.cursor.css}; }}`,t+=`${this._terminalSelector} .${On}.${ru} .xterm-cursor.xterm-cursor-blink.xterm-cursor-underline { animation: ${i} 1s step-end infinite;}${this._terminalSelector} .${On}.${ru} .xterm-cursor.xterm-cursor-blink.xterm-cursor-bar { animation: ${n} 1s step-end infinite;}${this._terminalSelector} .${On}.${ru} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: ${s} 1s step-end infinite;}${this._terminalSelector} .${On} .xterm-cursor.xterm-cursor-block { background-color: ${e.cursor.css}; color: ${e.cursorAccent.css};}${this._terminalSelector} .${On} .xterm-cursor.xterm-cursor-block:not(.xterm-cursor-blink) { background-color: ${e.cursor.css} !important; color: ${e.cursorAccent.css} !important;}${this._terminalSelector} .${On} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${e.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${On} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${e.cursor.css} inset;}${this._terminalSelector} .${On} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${e.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,t+=`${this._terminalSelector} .${df} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${df} div { position: absolute; background-color: ${e.selectionBackgroundOpaque.css};}${this._terminalSelector} .${df} div { position: absolute; background-color: ${e.selectionInactiveBackgroundOpaque.css};}`;for(let[r,a]of e.ansi.entries())t+=`${this._terminalSelector} .${hf}${r} { color: ${a.css}; }${this._terminalSelector} .${hf}${r}.xterm-dim { color: ${ut.multiplyOpacity(a,.5).css}; }${this._terminalSelector} .${LN}${r} { background-color: ${a.css}; }`;t+=`${this._terminalSelector} .${hf}257 { color: ${ut.opaque(e.background).css}; }${this._terminalSelector} .${hf}257.xterm-dim { color: ${ut.multiplyOpacity(ut.opaque(e.background),.5).css}; }${this._terminalSelector} .${LN}257 { background-color: ${e.foreground.css}; }`,this._themeStyleElement.textContent=t}_setDefaultSpacing(){let e=this.dimensions.css.cell.width-this._widthCache.get("W",!1,!1);this._rowContainer.style.letterSpacing=`${e}px`,this._rowFactory.defaultSpacing=e}handleDevicePixelRatioChange(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}_refreshRowElements(e,t){for(let i=this._rowElements.length;i<=t;i++){let n=this._document.createElement("div");this._rowContainer.appendChild(n),this._rowElements.push(n)}for(;this._rowElements.length>t;)this._rowContainer.removeChild(this._rowElements.pop())}handleResize(e,t){this._refreshRowElements(e,t),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(ru),this.renderRows(0,this._bufferService.rows-1)}handleFocus(){this._rowContainer.classList.add(ru),this.renderRows(this._bufferService.buffer.y,this._bufferService.buffer.y)}handleSelectionChanged(e,t,i){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged(e,t,i),this.renderRows(0,this._bufferService.rows-1),!e||!t||(this._selectionRenderModel.update(this._terminal,e,t,i),!this._selectionRenderModel.hasSelection))return;let n=this._selectionRenderModel.viewportStartRow,s=this._selectionRenderModel.viewportEndRow,r=this._selectionRenderModel.viewportCappedStartRow,a=this._selectionRenderModel.viewportCappedEndRow,o=this._document.createDocumentFragment();if(i){let l=e[0]>t[0];o.appendChild(this._createSelectionElement(r,l?t[0]:e[0],l?e[0]:t[0],a-r+1))}else{let l=n===r?e[0]:0,c=r===s?t[0]:this._bufferService.cols;o.appendChild(this._createSelectionElement(r,l,c));let u=a-r-1;if(o.appendChild(this._createSelectionElement(r+1,0,this._bufferService.cols,u)),r!==a){let h=s===a?t[0]:this._bufferService.cols;o.appendChild(this._createSelectionElement(a,0,h))}}this._selectionContainer.appendChild(o)}_createSelectionElement(e,t,i,n=1){let s=this._document.createElement("div"),r=t*this.dimensions.css.cell.width,a=this.dimensions.css.cell.width*(i-t);return r+a>this.dimensions.css.canvas.width&&(a=this.dimensions.css.canvas.width-r),s.style.height=`${n*this.dimensions.css.cell.height}px`,s.style.top=`${e*this.dimensions.css.cell.height}px`,s.style.left=`${r}px`,s.style.width=`${a}px`,s}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(let e of this._rowElements)e.replaceChildren()}renderRows(e,t){let i=this._bufferService.buffer,n=i.ybase+i.y,s=Math.min(i.x,this._bufferService.cols-1),r=this._coreService.decPrivateModes.cursorBlink??this._optionsService.rawOptions.cursorBlink,a=this._coreService.decPrivateModes.cursorStyle??this._optionsService.rawOptions.cursorStyle,o=this._optionsService.rawOptions.cursorInactiveStyle;for(let l=e;l<=t;l++){let c=l+i.ydisp,u=this._rowElements[l],h=i.lines.get(c);if(!u||!h)break;u.replaceChildren(...this._rowFactory.createRow(h,c,c===n,a,o,s,r,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${mv}${this._terminalClass}`}_handleLinkHover(e){this._setCellUnderline(e.x1,e.x2,e.y1,e.y2,e.cols,!0)}_handleLinkLeave(e){this._setCellUnderline(e.x1,e.x2,e.y1,e.y2,e.cols,!1)}_setCellUnderline(e,t,i,n,s,r){i<0&&(e=0),n<0&&(t=0);let a=this._bufferService.rows-1;i=Math.max(Math.min(i,a),0),n=Math.max(Math.min(n,a),0),s=Math.min(s,this._bufferService.cols);let o=this._bufferService.buffer,l=o.ybase+o.y,c=Math.min(o.x,s-1),u=this._optionsService.rawOptions.cursorBlink,h=this._optionsService.rawOptions.cursorStyle,d=this._optionsService.rawOptions.cursorInactiveStyle;for(let f=i;f<=n;++f){let p=f+o.ydisp,_=this._rowElements[f],v=o.lines.get(p);if(!_||!v)break;_.replaceChildren(...this._rowFactory.createRow(v,p,p===l,h,d,c,u,this.dimensions.css.cell.width,this._widthCache,r?f===i?e:0:-1,r?(f===n?t:s)-1:-1))}}};Zv=xt([ne(7,hb),ne(8,Rf),ne(9,Li),ne(10,Di),ne(11,Xa),ne(12,er),ne(13,Ol)],Zv);Qv=class extends xe{constructor(e,t,i){super(),this._optionsService=i,this.width=0,this.height=0,this._onCharSizeChange=this._register(new X),this.onCharSizeChange=this._onCharSizeChange.event;try{this._measureStrategy=this._register(new l6(this._optionsService))}catch{this._measureStrategy=this._register(new o6(e,t,this._optionsService))}this._register(this._optionsService.onMultipleOptionChange(["fontFamily","fontSize"],()=>this.measure()))}get hasValidSize(){return this.width>0&&this.height>0}measure(){let e=this._measureStrategy.measure();(e.width!==this.width||e.height!==this.height)&&(this.width=e.width,this.height=e.height,this._onCharSizeChange.fire())}};Qv=xt([ne(2,Li)],Qv);FA=class extends xe{constructor(){super(...arguments),this._result={width:0,height:0}}_validateAndSet(e,t){e!==void 0&&e>0&&t!==void 0&&t>0&&(this._result.width=e,this._result.height=t)}},o6=class extends FA{constructor(e,t,i){super(),this._document=e,this._parentElement=t,this._optionsService=i,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}},l6=class extends FA{constructor(e){super(),this._optionsService=e,this._canvas=new OffscreenCanvas(100,100),this._ctx=this._canvas.getContext("2d");let t=this._ctx.measureText("W");if(!("width"in t&&"fontBoundingBoxAscent"in t&&"fontBoundingBoxDescent"in t))throw new Error("Required font metrics not supported")}measure(){this._ctx.font=`${this._optionsService.rawOptions.fontSize}px ${this._optionsService.rawOptions.fontFamily}`;let e=this._ctx.measureText("W");return this._validateAndSet(e.width,e.fontBoundingBoxAscent+e.fontBoundingBoxDescent),this._result}},c6=class extends xe{constructor(e,t,i){super(),this._textarea=e,this._window=t,this.mainDocument=i,this._isFocused=!1,this._cachedIsFocused=void 0,this._screenDprMonitor=this._register(new u6(this._window)),this._onDprChange=this._register(new X),this.onDprChange=this._onDprChange.event,this._onWindowChange=this._register(new X),this.onWindowChange=this._onWindowChange.event,this._register(this.onWindowChange(n=>this._screenDprMonitor.setWindow(n))),this._register(ni.forward(this._screenDprMonitor.onDprChange,this._onDprChange)),this._register(_e(this._textarea,"focus",()=>this._isFocused=!0)),this._register(_e(this._textarea,"blur",()=>this._isFocused=!1))}get window(){return this._window}set window(e){this._window!==e&&(this._window=e,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}},u6=class extends xe{constructor(e){super(),this._parentWindow=e,this._windowResizeListener=this._register(new Ml),this._onDprChange=this._register(new X),this.onDprChange=this._onDprChange.event,this._outerListener=()=>this._setDprAndFireIfDiffers(),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._updateDpr(),this._setWindowResizeListener(),this._register(dt(()=>this.clearListener()))}setWindow(e){this._parentWindow=e,this._setWindowResizeListener(),this._setDprAndFireIfDiffers()}_setWindowResizeListener(){this._windowResizeListener.value=_e(this._parentWindow,"resize",()=>this._setDprAndFireIfDiffers())}_setDprAndFireIfDiffers(){this._parentWindow.devicePixelRatio!==this._currentDevicePixelRatio&&this._onDprChange.fire(this._parentWindow.devicePixelRatio),this._updateDpr()}_updateDpr(){this._outerListener&&(this._resolutionMediaMatchList?.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)}},h6=class extends xe{constructor(){super(),this.linkProviders=[],this._register(dt(()=>this.linkProviders.length=0))}registerLinkProvider(e){return this.linkProviders.push(e),{dispose:()=>{let t=this.linkProviders.indexOf(e);t!==-1&&this.linkProviders.splice(t,1)}}}};Jv=class{constructor(e,t){this._renderService=e,this._charSizeService=t}getCoords(e,t,i,n,s){return d6(window,e,t,i,n,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,s)}getMouseReportCoords(e,t){let i=bb(window,e,t);if(this._charSizeService.hasValidSize)return i[0]=Math.min(Math.max(i[0],0),this._renderService.dimensions.css.canvas.width-1),i[1]=Math.min(Math.max(i[1],0),this._renderService.dimensions.css.canvas.height-1),{col:Math.floor(i[0]/this._renderService.dimensions.css.cell.width),row:Math.floor(i[1]/this._renderService.dimensions.css.cell.height),x:Math.floor(i[0]),y:Math.floor(i[1])}}};Jv=xt([ne(0,tr),ne(1,Rf)],Jv);f6=class{constructor(e,t){this._renderCallback=e,this._coreBrowserService=t,this._refreshCallbacks=[]}dispose(){this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}addRefreshCallback(e){return this._refreshCallbacks.push(e),this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._innerRefresh())),this._animationFrame}refresh(e,t,i){this._rowCount=i,e=e!==void 0?e:0,t=t!==void 0?t:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,e):e,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,t):t,!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){this._runRefreshCallbacks();return}let e=Math.max(this._rowStart,0),t=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(e,t),this._runRefreshCallbacks()}_runRefreshCallbacks(){for(let e of this._refreshCallbacks)e(0);this._refreshCallbacks=[]}},qA={};JI(qA,{getSafariVersion:()=>m6,isChromeOS:()=>$A,isFirefox:()=>KA,isIpad:()=>g6,isIphone:()=>_6,isLegacyEdge:()=>p6,isLinux:()=>yb,isMac:()=>Nf,isNode:()=>Bf,isSafari:()=>WA,isWindows:()=>GA});Bf=typeof process<"u"&&"title"in process,ku=Bf?"node":navigator.userAgent,Tu=Bf?"node":navigator.platform,KA=ku.includes("Firefox"),p6=ku.includes("Edge"),WA=/^((?!chrome|android).)*safari/i.test(ku);Nf=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(Tu),g6=Tu==="iPad",_6=Tu==="iPhone",GA=["Windows","Win16","Win32","WinCE"].includes(Tu),yb=Tu.indexOf("Linux")>=0,$A=/\bCrOS\b/.test(ku),YA=class{constructor(){this._tasks=[],this._i=0}enqueue(e){this._tasks.push(e),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(e){this._idleCallback=void 0;let t=0,i=0,n=e.timeRemaining(),s=0;for(;this._i<this._tasks.length;){if(t=performance.now(),this._tasks[this._i]()||this._i++,t=Math.max(1,performance.now()-t),i=Math.max(t,i),s=e.timeRemaining(),i*1.5>s){n-t<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(n-t))}ms`),this._start();return}n=s}this.clear()}},v6=class extends YA{_requestCallback(e){return setTimeout(()=>e(this._createDeadline(16)))}_cancelCallback(e){clearTimeout(e)}_createDeadline(e){let t=performance.now()+e;return{timeRemaining:()=>Math.max(0,t-performance.now())}}},b6=class extends YA{_requestCallback(e){return requestIdleCallback(e)}_cancelCallback(e){cancelIdleCallback(e)}},Af=!Bf&&"requestIdleCallback"in window?b6:v6,y6=class{constructor(){this._queue=new Af}set(e){this._queue.clear(),this._queue.enqueue(e)}flush(){this._queue.flush()}},eb=class extends xe{constructor(e,t,i,n,s,r,a,o,l){super(),this._rowCount=e,this._optionsService=i,this._charSizeService=n,this._coreService=s,this._coreBrowserService=o,this._renderer=this._register(new Ml),this._pausedResizeTask=new y6,this._observerDisposable=this._register(new Ml),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 X),this.onDimensionsChange=this._onDimensionsChange.event,this._onRenderedViewportChange=this._register(new X),this.onRenderedViewportChange=this._onRenderedViewportChange.event,this._onRender=this._register(new X),this.onRender=this._onRender.event,this._onRefreshRequest=this._register(new X),this.onRefreshRequest=this._onRefreshRequest.event,this._renderDebouncer=new f6((c,u)=>this._renderRows(c,u),this._coreBrowserService),this._register(this._renderDebouncer),this._syncOutputHandler=new S6(this._coreBrowserService,this._coreService,()=>this._fullRefresh()),this._register(dt(()=>this._syncOutputHandler.dispose())),this._register(this._coreBrowserService.onDprChange(()=>this.handleDevicePixelRatioChange())),this._register(a.onResize(()=>this._fullRefresh())),this._register(a.buffers.onBufferActivate(()=>this._renderer.value?.clear())),this._register(this._optionsService.onOptionChange(()=>this._handleOptionsChanged())),this._register(this._charSizeService.onCharSizeChange(()=>this.handleCharSizeChanged())),this._register(r.onDecorationRegistered(()=>this._fullRefresh())),this._register(r.onDecorationRemoved(()=>this._fullRefresh())),this._register(this._optionsService.onMultipleOptionChange(["customGlyphs","drawBoldTextInBrightColors","letterSpacing","lineHeight","fontFamily","fontSize","fontWeight","fontWeightBold","minimumContrastRatio","rescaleOverlappingGlyphs"],()=>{this.clear(),this.handleResize(a.cols,a.rows),this._fullRefresh()})),this._register(this._optionsService.onMultipleOptionChange(["cursorBlink","cursorStyle"],()=>this.refreshRows(a.buffer.y,a.buffer.y,!0))),this._register(l.onChangeColors(()=>this._fullRefresh())),this._registerIntersectionObserver(this._coreBrowserService.window,t),this._register(this._coreBrowserService.onWindowChange(c=>this._registerIntersectionObserver(c,t)))}get dimensions(){return this._renderer.value.dimensions}_registerIntersectionObserver(e,t){if("IntersectionObserver"in e){let i=new e.IntersectionObserver(n=>this._handleIntersectionChange(n[n.length-1]),{threshold:0});i.observe(t),this._observerDisposable.value=dt(()=>i.disconnect())}}_handleIntersectionChange(e){this._isPaused=e.isIntersecting===void 0?e.intersectionRatio===0:!e.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(e,t,i=!1){if(this._isPaused){this._needsFullRefresh=!0;return}if(this._coreService.decPrivateModes.synchronizedOutput){this._syncOutputHandler.bufferRows(e,t);return}let n=this._syncOutputHandler.flush();n&&(e=Math.min(e,n.start),t=Math.max(t,n.end)),i||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(e,t,this._rowCount)}_renderRows(e,t){if(this._renderer.value){if(this._coreService.decPrivateModes.synchronizedOutput){this._syncOutputHandler.bufferRows(e,t);return}e=Math.min(e,this._rowCount-1),t=Math.min(t,this._rowCount-1),this._renderer.value.renderRows(e,t),this._needsSelectionRefresh&&(this._renderer.value.handleSelectionChanged(this._selectionState.start,this._selectionState.end,this._selectionState.columnSelectMode),this._needsSelectionRefresh=!1),this._isNextRenderRedrawOnly||this._onRenderedViewportChange.fire({start:e,end:t}),this._onRender.fire({start:e,end:t}),this._isNextRenderRedrawOnly=!0}}resize(e,t){this._rowCount=t,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(e){this._renderer.value=e,this._renderer.value&&(this._renderer.value.onRequestRedraw(t=>this.refreshRows(t.start,t.end,!0)),this._needsSelectionRefresh=!0,this._fullRefresh())}addRefreshCallback(e){return this._renderDebouncer.addRefreshCallback(e)}_fullRefresh(){this._isPaused?this._needsFullRefresh=!0:this.refreshRows(0,this._rowCount-1)}clearTextureAtlas(){this._renderer.value&&(this._renderer.value.clearTextureAtlas?.(),this._fullRefresh())}handleDevicePixelRatioChange(){this._charSizeService.measure(),this._renderer.value&&(this._renderer.value.handleDevicePixelRatioChange(),this.refreshRows(0,this._rowCount-1))}handleResize(e,t){this._renderer.value&&(this._isPaused?this._pausedResizeTask.set(()=>this._renderer.value?.handleResize(e,t)):this._renderer.value.handleResize(e,t),this._fullRefresh())}handleCharSizeChanged(){this._renderer.value?.handleCharSizeChanged()}handleBlur(){this._renderer.value?.handleBlur()}handleFocus(){this._renderer.value?.handleFocus()}handleSelectionChanged(e,t,i){this._selectionState.start=e,this._selectionState.end=t,this._selectionState.columnSelectMode=i,this._renderer.value?.handleSelectionChanged(e,t,i)}handleCursorMove(){this._renderer.value?.handleCursorMove()}clear(){this._renderer.value?.clear()}};eb=xt([ne(2,Li),ne(3,Rf),ne(4,Xa),ne(5,Cu),ne(6,Di),ne(7,er),ne(8,Ol)],eb);S6=class{constructor(e,t,i){this._coreBrowserService=e,this._coreService=t,this._onTimeout=i,this._start=0,this._end=0,this._isBuffering=!1}bufferRows(e,t){this._isBuffering?(this._start=Math.min(this._start,e),this._end=Math.max(this._end,t)):(this._start=e,this._end=t,this._isBuffering=!0),this._timeout===void 0&&(this._timeout=this._coreBrowserService.window.setTimeout(()=>{this._timeout=void 0,this._coreService.decPrivateModes.synchronizedOutput=!1,this._onTimeout()},1e3))}flush(){if(this._timeout!==void 0&&(this._coreBrowserService.window.clearTimeout(this._timeout),this._timeout=void 0),!this._isBuffering)return;let e={start:this._start,end:this._end};return this._isBuffering=!1,e}dispose(){this._timeout!==void 0&&(this._coreBrowserService.window.clearTimeout(this._timeout),this._timeout=void 0)}};A6=class{constructor(e){this._bufferService=e,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.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()){let e=this.selectionStart[0]+this.selectionStartLength;return e>this._bufferService.cols?e%this._bufferService.cols===0?[this._bufferService.cols,this.selectionStart[1]+Math.floor(e/this._bufferService.cols)-1]:[e%this._bufferService.cols,this.selectionStart[1]+Math.floor(e/this._bufferService.cols)]:[e,this.selectionStart[1]]}if(this.selectionStartLength&&this.selectionEnd[1]===this.selectionStart[1]){let e=this.selectionStart[0]+this.selectionStartLength;return e>this._bufferService.cols?[e%this._bufferService.cols,this.selectionStart[1]+Math.floor(e/this._bufferService.cols)]:[Math.max(e,this.selectionEnd[0]),this.selectionEnd[1]]}return this.selectionEnd}}areSelectionValuesReversed(){let e=this.selectionStart,t=this.selectionEnd;return!e||!t?!1:e[1]>t[1]||e[1]===t[1]&&e[0]>t[0]}handleTrim(e){return this.selectionStart&&(this.selectionStart[1]-=e),this.selectionEnd&&(this.selectionEnd[1]-=e),this.selectionEnd&&this.selectionEnd[1]<0?(this.clearSelection(),!0):(this.selectionStart&&this.selectionStart[1]<0&&(this.selectionStart[1]=0),!1)}};gv=50,M6=15,O6=50,R6=500,D6="\xA0",L6=new RegExp(D6,"g"),tb=class extends xe{constructor(e,t,i,n,s,r,a,o,l){super(),this._element=e,this._screenElement=t,this._linkifier=i,this._bufferService=n,this._coreService=s,this._mouseService=r,this._optionsService=a,this._renderService=o,this._coreBrowserService=l,this._dragScrollAmount=0,this._enabled=!0,this._workCell=new Ln,this._mouseDownTimeStamp=0,this._oldHasSelection=!1,this._oldSelectionStart=void 0,this._oldSelectionEnd=void 0,this._onLinuxMouseSelection=this._register(new X),this.onLinuxMouseSelection=this._onLinuxMouseSelection.event,this._onRedrawRequest=this._register(new X),this.onRequestRedraw=this._onRedrawRequest.event,this._onSelectionChange=this._register(new X),this.onSelectionChange=this._onSelectionChange.event,this._onRequestScrollLines=this._register(new X),this.onRequestScrollLines=this._onRequestScrollLines.event,this._mouseMoveListener=c=>this._handleMouseMove(c),this._mouseUpListener=c=>this._handleMouseUp(c),this._coreService.onUserInput(()=>{this.hasSelection&&this.clearSelection()}),this._trimListener=this._bufferService.buffer.lines.onTrim(c=>this._handleTrim(c)),this._register(this._bufferService.buffers.onBufferActivate(c=>this._handleBufferActivate(c))),this.enable(),this._model=new A6(this._bufferService),this._activeSelectionMode=0,this._register(dt(()=>{this._removeMouseDownListeners()})),this._register(this._bufferService.onResize(c=>{c.rowsChanged&&this.clearSelection()}))}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(){let e=this._model.finalSelectionStart,t=this._model.finalSelectionEnd;return!e||!t?!1:e[0]!==t[0]||e[1]!==t[1]}get selectionText(){let e=this._model.finalSelectionStart,t=this._model.finalSelectionEnd;if(!e||!t)return"";let i=this._bufferService.buffer,n=[];if(this._activeSelectionMode===3){if(e[0]===t[0])return"";let s=e[0]<t[0]?e[0]:t[0],r=e[0]<t[0]?t[0]:e[0];for(let a=e[1];a<=t[1];a++){let o=i.translateBufferLineToString(a,!0,s,r);n.push(o)}}else{let s=e[1]===t[1]?t[0]:void 0;n.push(i.translateBufferLineToString(e[1],!0,e[0],s));for(let r=e[1]+1;r<=t[1]-1;r++){let a=i.lines.get(r),o=i.translateBufferLineToString(r,!0);a?.isWrapped?n[n.length-1]+=o:n.push(o)}if(e[1]!==t[1]){let r=i.lines.get(t[1]),a=i.translateBufferLineToString(t[1],!0,0,t[0]);r&&r.isWrapped?n[n.length-1]+=a:n.push(a)}}return n.map(s=>s.replace(L6," ")).join(GA?`\r
120
+ `:`
121
+ `)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(e){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._refresh())),yb&&e&&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(e){let t=this._getMouseBufferCoords(e),i=this._model.finalSelectionStart,n=this._model.finalSelectionEnd;return!i||!n||!t?!1:this._areCoordsInSelection(t,i,n)}isCellInSelection(e,t){let i=this._model.finalSelectionStart,n=this._model.finalSelectionEnd;return!i||!n?!1:this._areCoordsInSelection([e,t],i,n)}_areCoordsInSelection(e,t,i){return e[1]>t[1]&&e[1]<i[1]||t[1]===i[1]&&e[1]===t[1]&&e[0]>=t[0]&&e[0]<i[0]||t[1]<i[1]&&e[1]===i[1]&&e[0]<i[0]||t[1]<i[1]&&e[1]===t[1]&&e[0]>=t[0]}_selectWordAtCursor(e,t){let i=this._linkifier.currentLink?.link?.range;if(i)return this._model.selectionStart=[i.start.x-1,i.start.y-1],this._model.selectionStartLength=BN(i,this._bufferService.cols),this._model.selectionEnd=void 0,!0;let n=this._getMouseBufferCoords(e);return n?(this._selectWordAt(n,t),this._model.selectionEnd=void 0,!0):!1}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(e,t){this._model.clearSelection(),e=Math.max(e,0),t=Math.min(t,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,e],this._model.selectionEnd=[this._bufferService.cols,t],this.refresh(),this._onSelectionChange.fire()}_handleTrim(e){this._model.handleTrim(e)&&this.refresh()}_getMouseBufferCoords(e){let t=this._mouseService.getCoords(e,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(t)return t[0]--,t[1]--,t[1]+=this._bufferService.buffer.ydisp,t}_getMouseEventScrollAmount(e){let t=bb(this._coreBrowserService.window,e,this._screenElement)[1],i=this._renderService.dimensions.css.canvas.height;return t>=0&&t<=i?0:(t>i&&(t-=i),t=Math.min(Math.max(t,-gv),gv),t/=gv,t/Math.abs(t)+Math.round(t*(M6-1)))}shouldForceSelection(e){return Nf?e.altKey&&this._optionsService.rawOptions.macOptionClickForcesSelection:e.shiftKey}handleMouseDown(e){if(this._mouseDownTimeStamp=e.timeStamp,!(e.button===2&&this.hasSelection)&&e.button===0){if(!this._enabled){if(!this.shouldForceSelection(e))return;e.stopPropagation()}e.preventDefault(),this._dragScrollAmount=0,this._enabled&&e.shiftKey?this._handleIncrementalClick(e):e.detail===1?this._handleSingleClick(e):e.detail===2?this._handleDoubleClick(e):e.detail===3&&this._handleTripleClick(e),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(),O6)}_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(e){this._model.selectionStart&&(this._model.selectionEnd=this._getMouseBufferCoords(e))}_handleSingleClick(e){if(this._model.selectionStartLength=0,this._model.isSelectAllActive=!1,this._activeSelectionMode=this.shouldColumnSelect(e)?3:0,this._model.selectionStart=this._getMouseBufferCoords(e),!this._model.selectionStart)return;this._model.selectionEnd=void 0;let t=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);t&&t.length!==this._model.selectionStart[0]&&t.hasWidth(this._model.selectionStart[0])===0&&this._model.selectionStart[0]++}_handleDoubleClick(e){this._selectWordAtCursor(e,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(e){let t=this._getMouseBufferCoords(e);t&&(this._activeSelectionMode=2,this._selectLineAt(t[1]))}shouldColumnSelect(e){return e.altKey&&!(Nf&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(e){if(e.stopImmediatePropagation(),!this._model.selectionStart)return;let t=this._model.selectionEnd?[this._model.selectionEnd[0],this._model.selectionEnd[1]]:null;if(this._model.selectionEnd=this._getMouseBufferCoords(e),!this._model.selectionEnd){this.refresh(!0);return}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(e),this._activeSelectionMode!==3&&(this._dragScrollAmount>0?this._model.selectionEnd[0]=this._bufferService.cols:this._dragScrollAmount<0&&(this._model.selectionEnd[0]=0));let i=this._bufferService.buffer;if(this._model.selectionEnd[1]<i.lines.length){let n=i.lines.get(this._model.selectionEnd[1]);n&&n.hasWidth(this._model.selectionEnd[0])===0&&this._model.selectionEnd[0]<this._bufferService.cols&&this._model.selectionEnd[0]++}(!t||t[0]!==this._model.selectionEnd[0]||t[1]!==this._model.selectionEnd[1])&&this.refresh(!0)}_dragScroll(){if(!(!this._model.selectionEnd||!this._model.selectionStart)&&this._dragScrollAmount){this._onRequestScrollLines.fire({amount:this._dragScrollAmount,suppressScrollEvent:!1});let e=this._bufferService.buffer;this._dragScrollAmount>0?(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=this._bufferService.cols),this._model.selectionEnd[1]=Math.min(e.ydisp+this._bufferService.rows,e.lines.length-1)):(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=0),this._model.selectionEnd[1]=e.ydisp),this.refresh()}}_handleMouseUp(e){let t=e.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&t<R6&&e.altKey&&this._optionsService.rawOptions.altClickMovesCursor){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){let i=this._mouseService.getCoords(e,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(i&&i[0]!==void 0&&i[1]!==void 0){let n=w6(i[0]-1,i[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(n,!0)}}}else this._fireEventIfSelectionChanged()}_fireEventIfSelectionChanged(){let e=this._model.finalSelectionStart,t=this._model.finalSelectionEnd,i=!!e&&!!t&&(e[0]!==t[0]||e[1]!==t[1]);if(!i){this._oldHasSelection&&this._fireOnSelectionChange(e,t,i);return}!e||!t||(!this._oldSelectionStart||!this._oldSelectionEnd||e[0]!==this._oldSelectionStart[0]||e[1]!==this._oldSelectionStart[1]||t[0]!==this._oldSelectionEnd[0]||t[1]!==this._oldSelectionEnd[1])&&this._fireOnSelectionChange(e,t,i)}_fireOnSelectionChange(e,t,i){this._oldSelectionStart=e,this._oldSelectionEnd=t,this._oldHasSelection=i,this._onSelectionChange.fire()}_handleBufferActivate(e){this.clearSelection(),this._trimListener.dispose(),this._trimListener=e.activeBuffer.lines.onTrim(t=>this._handleTrim(t))}_convertViewportColToCharacterIndex(e,t){let i=t;for(let n=0;t>=n;n++){let s=e.loadCell(n,this._workCell).getChars().length;this._workCell.getWidth()===0?i--:s>1&&t!==n&&(i+=s-1)}return i}setSelection(e,t,i){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[e,t],this._model.selectionStartLength=i,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(e){this._isClickInSelection(e)||(this._selectWordAtCursor(e,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(e,t,i=!0,n=!0){if(e[0]>=this._bufferService.cols)return;let s=this._bufferService.buffer,r=s.lines.get(e[1]);if(!r)return;let a=s.translateBufferLineToString(e[1],!1),o=this._convertViewportColToCharacterIndex(r,e[0]),l=o,c=e[0]-o,u=0,h=0,d=0,f=0;if(a.charAt(o)===" "){for(;o>0&&a.charAt(o-1)===" ";)o--;for(;l<a.length&&a.charAt(l+1)===" ";)l++}else{let v=e[0],g=e[0];r.getWidth(v)===0&&(u++,v--),r.getWidth(g)===2&&(h++,g++);let m=r.getString(g).length;for(m>1&&(f+=m-1,l+=m-1);v>0&&o>0&&!this._isCharWordSeparator(r.loadCell(v-1,this._workCell));){r.loadCell(v-1,this._workCell);let b=this._workCell.getChars().length;this._workCell.getWidth()===0?(u++,v--):b>1&&(d+=b-1,o-=b-1),o--,v--}for(;g<r.length&&l+1<a.length&&!this._isCharWordSeparator(r.loadCell(g+1,this._workCell));){r.loadCell(g+1,this._workCell);let b=this._workCell.getChars().length;this._workCell.getWidth()===2?(h++,g++):b>1&&(f+=b-1,l+=b-1),l++,g++}}l++;let p=o+c-u+d,_=Math.min(this._bufferService.cols,l-o+u+h-d-f);if(!(!t&&a.slice(o,l).trim()==="")){if(i&&p===0&&r.getCodePoint(0)!==32){let v=s.lines.get(e[1]-1);if(v&&r.isWrapped&&v.getCodePoint(this._bufferService.cols-1)!==32){let g=this._getWordAt([this._bufferService.cols-1,e[1]-1],!1,!0,!1);if(g){let m=this._bufferService.cols-g.start;p-=m,_+=m}}}if(n&&p+_===this._bufferService.cols&&r.getCodePoint(this._bufferService.cols-1)!==32){let v=s.lines.get(e[1]+1);if(v?.isWrapped&&v.getCodePoint(0)!==32){let g=this._getWordAt([0,e[1]+1],!1,!1,!0);g&&(_+=g.length)}}return{start:p,length:_}}}_selectWordAt(e,t){let i=this._getWordAt(e,t);if(i){for(;i.start<0;)i.start+=this._bufferService.cols,e[1]--;this._model.selectionStart=[i.start,e[1]],this._model.selectionStartLength=i.length}}_selectToWordAt(e){let t=this._getWordAt(e,!0);if(t){let i=e[1];for(;t.start<0;)t.start+=this._bufferService.cols,i--;if(!this._model.areSelectionValuesReversed())for(;t.start+t.length>this._bufferService.cols;)t.length-=this._bufferService.cols,i++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?t.start:t.start+t.length,i]}}_isCharWordSeparator(e){return e.getWidth()===0?!1:this._optionsService.rawOptions.wordSeparator.indexOf(e.getChars())>=0}_selectLineAt(e){let t=this._bufferService.buffer.getWrappedRangeForLine(e),i={start:{x:0,y:t.first},end:{x:this._bufferService.cols-1,y:t.last}};this._model.selectionStart=[0,t.first],this._model.selectionEnd=void 0,this._model.selectionStartLength=BN(i,this._bufferService.cols)}};tb=xt([ne(3,Di),ne(4,Xa),ne(5,db),ne(6,Li),ne(7,tr),ne(8,er)],tb);IN=class{constructor(){this._data={}}set(e,t,i){this._data[e]||(this._data[e]={}),this._data[e][t]=i}get(e,t){return this._data[e]?this._data[e][t]:void 0}clear(){this._data={}}},zN=class{constructor(){this._color=new IN,this._css=new IN}setCss(e,t,i){this._css.set(e,t,i)}getCss(e,t){return this._css.get(e,t)}setColor(e,t,i){this._color.set(e,t,i)}getColor(e,t){return this._color.get(e,t)}clear(){this._color.clear(),this._css.clear()}},Kt=Object.freeze((()=>{let e=[gt.toColor("#2e3436"),gt.toColor("#cc0000"),gt.toColor("#4e9a06"),gt.toColor("#c4a000"),gt.toColor("#3465a4"),gt.toColor("#75507b"),gt.toColor("#06989a"),gt.toColor("#d3d7cf"),gt.toColor("#555753"),gt.toColor("#ef2929"),gt.toColor("#8ae234"),gt.toColor("#fce94f"),gt.toColor("#729fcf"),gt.toColor("#ad7fa8"),gt.toColor("#34e2e2"),gt.toColor("#eeeeec")],t=[0,95,135,175,215,255];for(let i=0;i<216;i++){let n=t[i/36%6|0],s=t[i/6%6|0],r=t[i%6];e.push({css:At.toCss(n,s,r),rgba:At.toRgba(n,s,r)})}for(let i=0;i<24;i++){let n=8+i*10;e.push({css:At.toCss(n,n,n),rgba:At.toRgba(n,n,n)})}return e})()),Wa=gt.toColor("#ffffff"),du=gt.toColor("#000000"),PN=gt.toColor("#ffffff"),UN=du,au={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117},B6=Wa,ib=class extends xe{constructor(e){super(),this._optionsService=e,this._contrastCache=new zN,this._halfContrastCache=new zN,this._onChangeColors=this._register(new X),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:Wa,background:du,cursor:PN,cursorAccent:UN,selectionForeground:void 0,selectionBackgroundTransparent:au,selectionBackgroundOpaque:ut.blend(du,au),selectionInactiveBackgroundTransparent:au,selectionInactiveBackgroundOpaque:ut.blend(du,au),scrollbarSliderBackground:ut.opacity(Wa,.2),scrollbarSliderHoverBackground:ut.opacity(Wa,.4),scrollbarSliderActiveBackground:ut.opacity(Wa,.5),overviewRulerBorder:Wa,ansi:Kt.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)))}get colors(){return this._colors}_setTheme(e={}){let t=this._colors;if(t.foreground=et(e.foreground,Wa),t.background=et(e.background,du),t.cursor=ut.blend(t.background,et(e.cursor,PN)),t.cursorAccent=ut.blend(t.background,et(e.cursorAccent,UN)),t.selectionBackgroundTransparent=et(e.selectionBackground,au),t.selectionBackgroundOpaque=ut.blend(t.background,t.selectionBackgroundTransparent),t.selectionInactiveBackgroundTransparent=et(e.selectionInactiveBackground,t.selectionBackgroundTransparent),t.selectionInactiveBackgroundOpaque=ut.blend(t.background,t.selectionInactiveBackgroundTransparent),t.selectionForeground=e.selectionForeground?et(e.selectionForeground,RN):void 0,t.selectionForeground===RN&&(t.selectionForeground=void 0),ut.isOpaque(t.selectionBackgroundTransparent)&&(t.selectionBackgroundTransparent=ut.opacity(t.selectionBackgroundTransparent,.3)),ut.isOpaque(t.selectionInactiveBackgroundTransparent)&&(t.selectionInactiveBackgroundTransparent=ut.opacity(t.selectionInactiveBackgroundTransparent,.3)),t.scrollbarSliderBackground=et(e.scrollbarSliderBackground,ut.opacity(t.foreground,.2)),t.scrollbarSliderHoverBackground=et(e.scrollbarSliderHoverBackground,ut.opacity(t.foreground,.4)),t.scrollbarSliderActiveBackground=et(e.scrollbarSliderActiveBackground,ut.opacity(t.foreground,.5)),t.overviewRulerBorder=et(e.overviewRulerBorder,B6),t.ansi=Kt.slice(),t.ansi[0]=et(e.black,Kt[0]),t.ansi[1]=et(e.red,Kt[1]),t.ansi[2]=et(e.green,Kt[2]),t.ansi[3]=et(e.yellow,Kt[3]),t.ansi[4]=et(e.blue,Kt[4]),t.ansi[5]=et(e.magenta,Kt[5]),t.ansi[6]=et(e.cyan,Kt[6]),t.ansi[7]=et(e.white,Kt[7]),t.ansi[8]=et(e.brightBlack,Kt[8]),t.ansi[9]=et(e.brightRed,Kt[9]),t.ansi[10]=et(e.brightGreen,Kt[10]),t.ansi[11]=et(e.brightYellow,Kt[11]),t.ansi[12]=et(e.brightBlue,Kt[12]),t.ansi[13]=et(e.brightMagenta,Kt[13]),t.ansi[14]=et(e.brightCyan,Kt[14]),t.ansi[15]=et(e.brightWhite,Kt[15]),e.extendedAnsi){let i=Math.min(t.ansi.length-16,e.extendedAnsi.length);for(let n=0;n<i;n++)t.ansi[n+16]=et(e.extendedAnsi[n],Kt[n+16])}this._contrastCache.clear(),this._halfContrastCache.clear(),this._updateRestoreColors(),this._onChangeColors.fire(this.colors)}restoreColor(e){this._restoreColor(e),this._onChangeColors.fire(this.colors)}_restoreColor(e){if(e===void 0){for(let t=0;t<this._restoreColors.ansi.length;++t)this._colors.ansi[t]=this._restoreColors.ansi[t];return}switch(e){case 256:this._colors.foreground=this._restoreColors.foreground;break;case 257:this._colors.background=this._restoreColors.background;break;case 258:this._colors.cursor=this._restoreColors.cursor;break;default:this._colors.ansi[e]=this._restoreColors.ansi[e]}}modifyColors(e){e(this._colors),this._onChangeColors.fire(this.colors)}_updateRestoreColors(){this._restoreColors={foreground:this._colors.foreground,background:this._colors.background,cursor:this._colors.cursor,ansi:this._colors.ansi.slice()}}};ib=xt([ne(0,Li)],ib);I6=class{constructor(...e){this._entries=new Map;for(let[t,i]of e)this.set(t,i)}set(e,t){let i=this._entries.get(e);return this._entries.set(e,t),i}forEach(e){for(let[t,i]of this._entries.entries())e(t,i)}has(e){return this._entries.has(e)}get(e){return this._entries.get(e)}},z6=class{constructor(){this._services=new I6,this._services.set(hb,this)}setService(e,t){this._services.set(e,t)}getService(e){return this._services.get(e)}createInstance(e,...t){let i=az(e).sort((r,a)=>r.index-a.index),n=[];for(let r of i){let a=this._services.get(r.id);if(!a)throw new Error(`[createInstance] ${e.name} depends on UNKNOWN service ${r.id._id}.`);n.push(a)}let s=i.length>0?i[0].index:t.length;if(t.length!==s)throw new Error(`[createInstance] First service dependency of ${e.name} at position ${s+1} conflicts with ${t.length} static arguments`);return new e(...t,...n)}},P6={trace:0,debug:1,info:2,warn:3,error:4,off:5},U6="xterm.js: ",nb=class extends xe{constructor(e){super(),this._optionsService=e,this._logLevel=5,this._updateLogLevel(),this._register(this._optionsService.onSpecificOptionChange("logLevel",()=>this._updateLogLevel())),H6=this}get logLevel(){return this._logLevel}_updateLogLevel(){this._logLevel=P6[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(e){for(let t=0;t<e.length;t++)typeof e[t]=="function"&&(e[t]=e[t]())}_log(e,t,i){this._evalLazyOptionalParams(i),e.call(console,(this._optionsService.options.logger?"":U6)+t,...i)}trace(e,...t){this._logLevel<=0&&this._log(this._optionsService.options.logger?.trace.bind(this._optionsService.options.logger)??console.log,e,t)}debug(e,...t){this._logLevel<=1&&this._log(this._optionsService.options.logger?.debug.bind(this._optionsService.options.logger)??console.log,e,t)}info(e,...t){this._logLevel<=2&&this._log(this._optionsService.options.logger?.info.bind(this._optionsService.options.logger)??console.info,e,t)}warn(e,...t){this._logLevel<=3&&this._log(this._optionsService.options.logger?.warn.bind(this._optionsService.options.logger)??console.warn,e,t)}error(e,...t){this._logLevel<=4&&this._log(this._optionsService.options.logger?.error.bind(this._optionsService.options.logger)??console.error,e,t)}};nb=xt([ne(0,Li)],nb);HN=class extends xe{constructor(e){super(),this._maxLength=e,this.onDeleteEmitter=this._register(new X),this.onDelete=this.onDeleteEmitter.event,this.onInsertEmitter=this._register(new X),this.onInsert=this.onInsertEmitter.event,this.onTrimEmitter=this._register(new X),this.onTrim=this.onTrimEmitter.event,this._array=new Array(this._maxLength),this._startIndex=0,this._length=0}get maxLength(){return this._maxLength}set maxLength(e){if(this._maxLength===e)return;let t=new Array(e);for(let i=0;i<Math.min(e,this.length);i++)t[i]=this._array[this._getCyclicIndex(i)];this._array=t,this._maxLength=e,this._startIndex=0}get length(){return this._length}set length(e){if(e>this._length)for(let t=this._length;t<e;t++)this._array[t]=void 0;this._length=e}get(e){return this._array[this._getCyclicIndex(e)]}set(e,t){this._array[this._getCyclicIndex(e)]=t}push(e){this._array[this._getCyclicIndex(this._length)]=e,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(e,t,...i){if(t){for(let n=e;n<this._length-t;n++)this._array[this._getCyclicIndex(n)]=this._array[this._getCyclicIndex(n+t)];this._length-=t,this.onDeleteEmitter.fire({index:e,amount:t})}for(let n=this._length-1;n>=e;n--)this._array[this._getCyclicIndex(n+i.length)]=this._array[this._getCyclicIndex(n)];for(let n=0;n<i.length;n++)this._array[this._getCyclicIndex(e+n)]=i[n];if(i.length&&this.onInsertEmitter.fire({index:e,amount:i.length}),this._length+i.length>this._maxLength){let n=this._length+i.length-this._maxLength;this._startIndex+=n,this._length=this._maxLength,this.onTrimEmitter.fire(n)}else this._length+=i.length}trimStart(e){e>this._length&&(e=this._length),this._startIndex+=e,this._length-=e,this.onTrimEmitter.fire(e)}shiftElements(e,t,i){if(!(t<=0)){if(e<0||e>=this._length)throw new Error("start argument out of range");if(e+i<0)throw new Error("Cannot shift elements in list beyond index 0");if(i>0){for(let s=t-1;s>=0;s--)this.set(e+s+i,this.get(e+s));let n=e+t+i-this._length;if(n>0)for(this._length+=n;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(let n=0;n<t;n++)this.set(e+n+i,this.get(e+n))}}_getCyclicIndex(e){return(this._startIndex+e)%this._maxLength}},Ne=3,It=Object.freeze(new xu),ff=0,_v=2,fu=class XA{constructor(t,i,n=!1){this.isWrapped=n,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(t*Ne);let s=i||Ln.fromCharData([0,uA,1,0]);for(let r=0;r<t;++r)this.setCell(r,s);this.length=t}get(t){let i=this._data[t*Ne+0],n=i&2097151;return[this._data[t*Ne+1],i&2097152?this._combined[t]:n?jr(n):"",i>>22,i&2097152?this._combined[t].charCodeAt(this._combined[t].length-1):n]}set(t,i){this._data[t*Ne+1]=i[0],i[1].length>1?(this._combined[t]=i[1],this._data[t*Ne+0]=t|2097152|i[2]<<22):this._data[t*Ne+0]=i[1].charCodeAt(0)|i[2]<<22}getWidth(t){return this._data[t*Ne+0]>>22}hasWidth(t){return this._data[t*Ne+0]&12582912}getFg(t){return this._data[t*Ne+1]}getBg(t){return this._data[t*Ne+2]}hasContent(t){return this._data[t*Ne+0]&4194303}getCodePoint(t){let i=this._data[t*Ne+0];return i&2097152?this._combined[t].charCodeAt(this._combined[t].length-1):i&2097151}isCombined(t){return this._data[t*Ne+0]&2097152}getString(t){let i=this._data[t*Ne+0];return i&2097152?this._combined[t]:i&2097151?jr(i&2097151):""}isProtected(t){return this._data[t*Ne+2]&536870912}loadCell(t,i){return ff=t*Ne,i.content=this._data[ff+0],i.fg=this._data[ff+1],i.bg=this._data[ff+2],i.content&2097152&&(i.combinedData=this._combined[t]),i.bg&268435456&&(i.extended=this._extendedAttrs[t]),i}setCell(t,i){i.content&2097152&&(this._combined[t]=i.combinedData),i.bg&268435456&&(this._extendedAttrs[t]=i.extended),this._data[t*Ne+0]=i.content,this._data[t*Ne+1]=i.fg,this._data[t*Ne+2]=i.bg}setCellFromCodepoint(t,i,n,s){s.bg&268435456&&(this._extendedAttrs[t]=s.extended),this._data[t*Ne+0]=i|n<<22,this._data[t*Ne+1]=s.fg,this._data[t*Ne+2]=s.bg}addCodepointToCell(t,i,n){let s=this._data[t*Ne+0];s&2097152?this._combined[t]+=jr(i):s&2097151?(this._combined[t]=jr(s&2097151)+jr(i),s&=-2097152,s|=2097152):s=i|1<<22,n&&(s&=-12582913,s|=n<<22),this._data[t*Ne+0]=s}insertCells(t,i,n){if(t%=this.length,t&&this.getWidth(t-1)===2&&this.setCellFromCodepoint(t-1,0,1,n),i<this.length-t){let s=new Ln;for(let r=this.length-t-i-1;r>=0;--r)this.setCell(t+i+r,this.loadCell(t+r,s));for(let r=0;r<i;++r)this.setCell(t+r,n)}else for(let s=t;s<this.length;++s)this.setCell(s,n);this.getWidth(this.length-1)===2&&this.setCellFromCodepoint(this.length-1,0,1,n)}deleteCells(t,i,n){if(t%=this.length,i<this.length-t){let s=new Ln;for(let r=0;r<this.length-t-i;++r)this.setCell(t+r,this.loadCell(t+i+r,s));for(let r=this.length-i;r<this.length;++r)this.setCell(r,n)}else for(let s=t;s<this.length;++s)this.setCell(s,n);t&&this.getWidth(t-1)===2&&this.setCellFromCodepoint(t-1,0,1,n),this.getWidth(t)===0&&!this.hasContent(t)&&this.setCellFromCodepoint(t,0,1,n)}replaceCells(t,i,n,s=!1){if(s){for(t&&this.getWidth(t-1)===2&&!this.isProtected(t-1)&&this.setCellFromCodepoint(t-1,0,1,n),i<this.length&&this.getWidth(i-1)===2&&!this.isProtected(i)&&this.setCellFromCodepoint(i,0,1,n);t<i&&t<this.length;)this.isProtected(t)||this.setCell(t,n),t++;return}for(t&&this.getWidth(t-1)===2&&this.setCellFromCodepoint(t-1,0,1,n),i<this.length&&this.getWidth(i-1)===2&&this.setCellFromCodepoint(i,0,1,n);t<i&&t<this.length;)this.setCell(t++,n)}resize(t,i){if(t===this.length)return this._data.length*4*_v<this._data.buffer.byteLength;let n=t*Ne;if(t>this.length){if(this._data.buffer.byteLength>=n*4)this._data=new Uint32Array(this._data.buffer,0,n);else{let s=new Uint32Array(n);s.set(this._data),this._data=s}for(let s=this.length;s<t;++s)this.setCell(s,i)}else{this._data=this._data.subarray(0,n);let s=Object.keys(this._combined);for(let a=0;a<s.length;a++){let o=parseInt(s[a],10);o>=t&&delete this._combined[o]}let r=Object.keys(this._extendedAttrs);for(let a=0;a<r.length;a++){let o=parseInt(r[a],10);o>=t&&delete this._extendedAttrs[o]}}return this.length=t,n*4*_v<this._data.buffer.byteLength}cleanupMemory(){if(this._data.length*4*_v<this._data.buffer.byteLength){let t=new Uint32Array(this._data.length);return t.set(this._data),this._data=t,1}return 0}fill(t,i=!1){if(i){for(let n=0;n<this.length;++n)this.isProtected(n)||this.setCell(n,t);return}this._combined={},this._extendedAttrs={};for(let n=0;n<this.length;++n)this.setCell(n,t)}copyFrom(t){this.length!==t.length?this._data=new Uint32Array(t._data):this._data.set(t._data),this.length=t.length,this._combined={};for(let i in t._combined)this._combined[i]=t._combined[i];this._extendedAttrs={};for(let i in t._extendedAttrs)this._extendedAttrs[i]=t._extendedAttrs[i];this.isWrapped=t.isWrapped}clone(){let t=new XA(0);t._data=new Uint32Array(this._data),t.length=this.length;for(let i in this._combined)t._combined[i]=this._combined[i];for(let i in this._extendedAttrs)t._extendedAttrs[i]=this._extendedAttrs[i];return t.isWrapped=this.isWrapped,t}getTrimmedLength(){for(let t=this.length-1;t>=0;--t)if(this._data[t*Ne+0]&4194303)return t+(this._data[t*Ne+0]>>22);return 0}getNoBgTrimmedLength(){for(let t=this.length-1;t>=0;--t)if(this._data[t*Ne+0]&4194303||this._data[t*Ne+2]&50331648)return t+(this._data[t*Ne+0]>>22);return 0}copyCellsFrom(t,i,n,s,r){let a=t._data;if(r)for(let l=s-1;l>=0;l--){for(let c=0;c<Ne;c++)this._data[(n+l)*Ne+c]=a[(i+l)*Ne+c];a[(i+l)*Ne+2]&268435456&&(this._extendedAttrs[n+l]=t._extendedAttrs[i+l])}else for(let l=0;l<s;l++){for(let c=0;c<Ne;c++)this._data[(n+l)*Ne+c]=a[(i+l)*Ne+c];a[(i+l)*Ne+2]&268435456&&(this._extendedAttrs[n+l]=t._extendedAttrs[i+l])}let o=Object.keys(t._combined);for(let l=0;l<o.length;l++){let c=parseInt(o[l],10);c>=i&&(this._combined[c-i+n]=t._combined[c])}}translateToString(t,i,n,s){i=i??0,n=n??this.length,t&&(n=Math.min(n,this.getTrimmedLength())),s&&(s.length=0);let r="";for(;i<n;){let a=this._data[i*Ne+0],o=a&2097151,l=a&2097152?this._combined[i]:o?jr(o):Vr;if(r+=l,s)for(let c=0;c<l.length;++c)s.push(i);i+=a>>22||1}return s&&s.push(i),r}};ZA=class QA{constructor(t){this.line=t,this.isDisposed=!1,this._disposables=[],this._id=QA._nextId++,this._onDispose=this.register(new X),this.onDispose=this._onDispose.event}get id(){return this._id}dispose(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire(),ja(this._disposables),this._disposables.length=0)}register(t){return this._disposables.push(t),t}};ZA._nextId=1;G6=ZA,Gt={},Ga=Gt.B;Gt[0]={"`":"\u25C6",a:"\u2592",b:"\u2409",c:"\u240C",d:"\u240D",e:"\u240A",f:"\xB0",g:"\xB1",h:"\u2424",i:"\u240B",j:"\u2518",k:"\u2510",l:"\u250C",m:"\u2514",n:"\u253C",o:"\u23BA",p:"\u23BB",q:"\u2500",r:"\u23BC",s:"\u23BD",t:"\u251C",u:"\u2524",v:"\u2534",w:"\u252C",x:"\u2502",y:"\u2264",z:"\u2265","{":"\u03C0","|":"\u2260","}":"\xA3","~":"\xB7"};Gt.A={"#":"\xA3"};Gt.B=void 0;Gt[4]={"#":"\xA3","@":"\xBE","[":"ij","\\":"\xBD","]":"|","{":"\xA8","|":"f","}":"\xBC","~":"\xB4"};Gt.C=Gt[5]={"[":"\xC4","\\":"\xD6","]":"\xC5","^":"\xDC","`":"\xE9","{":"\xE4","|":"\xF6","}":"\xE5","~":"\xFC"};Gt.R={"#":"\xA3","@":"\xE0","[":"\xB0","\\":"\xE7","]":"\xA7","{":"\xE9","|":"\xF9","}":"\xE8","~":"\xA8"};Gt.Q={"@":"\xE0","[":"\xE2","\\":"\xE7","]":"\xEA","^":"\xEE","`":"\xF4","{":"\xE9","|":"\xF9","}":"\xE8","~":"\xFB"};Gt.K={"@":"\xA7","[":"\xC4","\\":"\xD6","]":"\xDC","{":"\xE4","|":"\xF6","}":"\xFC","~":"\xDF"};Gt.Y={"#":"\xA3","@":"\xA7","[":"\xB0","\\":"\xE7","]":"\xE9","`":"\xF9","{":"\xE0","|":"\xF2","}":"\xE8","~":"\xEC"};Gt.E=Gt[6]={"@":"\xC4","[":"\xC6","\\":"\xD8","]":"\xC5","^":"\xDC","`":"\xE4","{":"\xE6","|":"\xF8","}":"\xE5","~":"\xFC"};Gt.Z={"#":"\xA3","@":"\xA7","[":"\xA1","\\":"\xD1","]":"\xBF","{":"\xB0","|":"\xF1","}":"\xE7"};Gt.H=Gt[7]={"@":"\xC9","[":"\xC4","\\":"\xD6","]":"\xC5","^":"\xDC","`":"\xE9","{":"\xE4","|":"\xF6","}":"\xE5","~":"\xFC"};Gt["="]={"#":"\xF9","@":"\xE0","[":"\xE9","\\":"\xE7","]":"\xEA","^":"\xEE",_:"\xE8","`":"\xF4","{":"\xE4","|":"\xF6","}":"\xFC","~":"\xFB"};FN=4294967295,qN=class{constructor(e,t,i){this._hasScrollback=e,this._optionsService=t,this._bufferService=i,this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.tabs={},this.savedY=0,this.savedX=0,this.savedCurAttrData=It.clone(),this.savedCharset=Ga,this.markers=[],this._nullCell=Ln.fromCharData([0,uA,1,0]),this._whitespaceCell=Ln.fromCharData([0,Vr,1,32]),this._isClearing=!1,this._memoryCleanupQueue=new Af,this._memoryCleanupPosition=0,this._cols=this._bufferService.cols,this._rows=this._bufferService.rows,this.lines=new HN(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}getNullCell(e){return e?(this._nullCell.fg=e.fg,this._nullCell.bg=e.bg,this._nullCell.extended=e.extended):(this._nullCell.fg=0,this._nullCell.bg=0,this._nullCell.extended=new wf),this._nullCell}getWhitespaceCell(e){return e?(this._whitespaceCell.fg=e.fg,this._whitespaceCell.bg=e.bg,this._whitespaceCell.extended=e.extended):(this._whitespaceCell.fg=0,this._whitespaceCell.bg=0,this._whitespaceCell.extended=new wf),this._whitespaceCell}getBlankLine(e,t){return new fu(this._bufferService.cols,this.getNullCell(e),t)}get hasScrollback(){return this._hasScrollback&&this.lines.maxLength>this._rows}get isCursorInViewport(){let e=this.ybase+this.y-this.ydisp;return e>=0&&e<this._rows}_getCorrectBufferLength(e){if(!this._hasScrollback)return e;let t=e+this._optionsService.rawOptions.scrollback;return t>FN?FN:t}fillViewportRows(e){if(this.lines.length===0){e===void 0&&(e=It);let t=this._rows;for(;t--;)this.lines.push(this.getBlankLine(e))}}clear(){this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.lines=new HN(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}resize(e,t){let i=this.getNullCell(It),n=0,s=this._getCorrectBufferLength(t);if(s>this.lines.maxLength&&(this.lines.maxLength=s),this.lines.length>0){if(this._cols<e)for(let a=0;a<this.lines.length;a++)n+=+this.lines.get(a).resize(e,i);let r=0;if(this._rows<t)for(let a=this._rows;a<t;a++)this.lines.length<t+this.ybase&&(this._optionsService.rawOptions.windowsMode||this._optionsService.rawOptions.windowsPty.backend!==void 0||this._optionsService.rawOptions.windowsPty.buildNumber!==void 0?this.lines.push(new fu(e,i)):this.ybase>0&&this.lines.length<=this.ybase+this.y+r+1?(this.ybase--,r++,this.ydisp>0&&this.ydisp--):this.lines.push(new fu(e,i)));else for(let a=this._rows;a>t;a--)this.lines.length>t+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(s<this.lines.maxLength){let a=this.lines.length-s;a>0&&(this.lines.trimStart(a),this.ybase=Math.max(this.ybase-a,0),this.ydisp=Math.max(this.ydisp-a,0),this.savedY=Math.max(this.savedY-a,0)),this.lines.maxLength=s}this.x=Math.min(this.x,e-1),this.y=Math.min(this.y,t-1),r&&(this.y+=r),this.savedX=Math.min(this.savedX,e-1),this.scrollTop=0}if(this.scrollBottom=t-1,this._isReflowEnabled&&(this._reflow(e,t),this._cols>e))for(let r=0;r<this.lines.length;r++)n+=+this.lines.get(r).resize(e,i);this._cols=e,this._rows=t,this._memoryCleanupQueue.clear(),n>.1*this.lines.length&&(this._memoryCleanupPosition=0,this._memoryCleanupQueue.enqueue(()=>this._batchedMemoryCleanup()))}_batchedMemoryCleanup(){let e=!0;this._memoryCleanupPosition>=this.lines.length&&(this._memoryCleanupPosition=0,e=!1);let t=0;for(;this._memoryCleanupPosition<this.lines.length;)if(t+=this.lines.get(this._memoryCleanupPosition++).cleanupMemory(),t>100)return!0;return e}get _isReflowEnabled(){let e=this._optionsService.rawOptions.windowsPty;return e&&e.buildNumber?this._hasScrollback&&e.backend==="conpty"&&e.buildNumber>=21376:this._hasScrollback&&!this._optionsService.rawOptions.windowsMode}_reflow(e,t){this._cols!==e&&(e>this._cols?this._reflowLarger(e,t):this._reflowSmaller(e,t))}_reflowLarger(e,t){let i=this._optionsService.rawOptions.reflowCursorLine,n=F6(this.lines,this._cols,e,this.ybase+this.y,this.getNullCell(It),i);if(n.length>0){let s=q6(this.lines,n);K6(this.lines,s.layout),this._reflowLargerAdjustViewport(e,t,s.countRemoved)}}_reflowLargerAdjustViewport(e,t,i){let n=this.getNullCell(It),s=i;for(;s-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length<t&&this.lines.push(new fu(e,n))):(this.ydisp===this.ybase&&this.ydisp--,this.ybase--);this.savedY=Math.max(this.savedY-i,0)}_reflowSmaller(e,t){let i=this._optionsService.rawOptions.reflowCursorLine,n=this.getNullCell(It),s=[],r=0;for(let a=this.lines.length-1;a>=0;a--){let o=this.lines.get(a);if(!o||!o.isWrapped&&o.getTrimmedLength()<=e)continue;let l=[o];for(;o.isWrapped&&a>0;)o=this.lines.get(--a),l.unshift(o);if(!i){let b=this.ybase+this.y;if(b>=a&&b<a+l.length)continue}let c=l[l.length-1].getTrimmedLength(),u=W6(l,this._cols,e),h=u.length-l.length,d;this.ybase===0&&this.y!==this.lines.length-1?d=Math.max(0,this.y-this.lines.maxLength+h):d=Math.max(0,this.lines.length-this.lines.maxLength+h);let f=[];for(let b=0;b<h;b++){let S=this.getBlankLine(It,!0);f.push(S)}f.length>0&&(s.push({start:a+l.length+r,newLines:f}),r+=f.length),l.push(...f);let p=u.length-1,_=u[p];_===0&&(p--,_=u[p]);let v=l.length-h-1,g=c;for(;v>=0;){let b=Math.min(g,_);if(l[p]===void 0)break;if(l[p].copyCellsFrom(l[v],g-b,_-b,b,!0),_-=b,_===0&&(p--,_=u[p]),g-=b,g===0){v--;let S=Math.max(v,0);g=Eu(l,S,this._cols)}}for(let b=0;b<l.length;b++)u[b]<e&&l[b].setCell(u[b],n);let m=h-d;for(;m-- >0;)this.ybase===0?this.y<t-1?(this.y++,this.lines.pop()):(this.ybase++,this.ydisp++):this.ybase<Math.min(this.lines.maxLength,this.lines.length+r)-t&&(this.ybase===this.ydisp&&this.ydisp++,this.ybase++);this.savedY=Math.min(this.savedY+h,this.ybase+t-1)}if(s.length>0){let a=[],o=[];for(let _=0;_<this.lines.length;_++)o.push(this.lines.get(_));let l=this.lines.length,c=l-1,u=0,h=s[u];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+r);let d=0;for(let _=Math.min(this.lines.maxLength-1,l+r-1);_>=0;_--)if(h&&h.start>c+d){for(let v=h.newLines.length-1;v>=0;v--)this.lines.set(_--,h.newLines[v]);_++,a.push({index:c+1,amount:h.newLines.length}),d+=h.newLines.length,h=s[++u]}else this.lines.set(_,o[c--]);let f=0;for(let _=a.length-1;_>=0;_--)a[_].index+=f,this.lines.onInsertEmitter.fire(a[_]),f+=a[_].amount;let p=Math.max(0,l+r-this.lines.maxLength);p>0&&this.lines.onTrimEmitter.fire(p)}}translateBufferLineToString(e,t,i=0,n){let s=this.lines.get(e);return s?s.translateToString(t,i,n):""}getWrappedRangeForLine(e){let t=e,i=e;for(;t>0&&this.lines.get(t).isWrapped;)t--;for(;i+1<this.lines.length&&this.lines.get(i+1).isWrapped;)i++;return{first:t,last:i}}setupTabStops(e){for(e!=null?this.tabs[e]||(e=this.prevStop(e)):(this.tabs={},e=0);e<this._cols;e+=this._optionsService.rawOptions.tabStopWidth)this.tabs[e]=!0}prevStop(e){for(e==null&&(e=this.x);!this.tabs[--e]&&e>0;);return e>=this._cols?this._cols-1:e<0?0:e}nextStop(e){for(e==null&&(e=this.x);!this.tabs[++e]&&e<this._cols;);return e>=this._cols?this._cols-1:e<0?0:e}clearMarkers(e){this._isClearing=!0;for(let t=0;t<this.markers.length;t++)this.markers[t].line===e&&(this.markers[t].dispose(),this.markers.splice(t--,1));this._isClearing=!1}clearAllMarkers(){this._isClearing=!0;for(let e=0;e<this.markers.length;e++)this.markers[e].dispose();this.markers.length=0,this._isClearing=!1}addMarker(e){let t=new G6(e);return this.markers.push(t),t.register(this.lines.onTrim(i=>{t.line-=i,t.line<0&&t.dispose()})),t.register(this.lines.onInsert(i=>{t.line>=i.index&&(t.line+=i.amount)})),t.register(this.lines.onDelete(i=>{t.line>=i.index&&t.line<i.index+i.amount&&t.dispose(),t.line>i.index&&(t.line-=i.amount)})),t.register(t.onDispose(()=>this._removeMarker(t))),t}_removeMarker(e){this._isClearing||this.markers.splice(this.markers.indexOf(e),1)}},$6=class extends xe{constructor(e,t){super(),this._optionsService=e,this._bufferService=t,this._onBufferActivate=this._register(new X),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 qN(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new qN(!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(e){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(e),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(e,t){this._normal.resize(e,t),this._alt.resize(e,t),this.setupTabStops(e)}setupTabStops(e){this._normal.setupTabStops(e),this._alt.setupTabStops(e)}},JA=2,eM=1,sb=class extends xe{constructor(e){super(),this.isUserScrolling=!1,this._onResize=this._register(new X),this.onResize=this._onResize.event,this._onScroll=this._register(new X),this.onScroll=this._onScroll.event,this.cols=Math.max(e.rawOptions.cols||0,JA),this.rows=Math.max(e.rawOptions.rows||0,eM),this.buffers=this._register(new $6(e,this)),this._register(this.buffers.onBufferActivate(t=>{this._onScroll.fire(t.activeBuffer.ydisp)}))}get buffer(){return this.buffers.active}resize(e,t){let i=this.cols!==e,n=this.rows!==t;this.cols=e,this.rows=t,this.buffers.resize(e,t),this._onResize.fire({cols:e,rows:t,colsChanged:i,rowsChanged:n})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(e,t=!1){let i=this.buffer,n;n=this._cachedBlankLine,(!n||n.length!==this.cols||n.getFg(0)!==e.fg||n.getBg(0)!==e.bg)&&(n=i.getBlankLine(e,t),this._cachedBlankLine=n),n.isWrapped=t;let s=i.ybase+i.scrollTop,r=i.ybase+i.scrollBottom;if(i.scrollTop===0){let a=i.lines.isFull;r===i.lines.length-1?a?i.lines.recycle().copyFrom(n):i.lines.push(n.clone()):i.lines.splice(r+1,0,n.clone()),a?this.isUserScrolling&&(i.ydisp=Math.max(i.ydisp-1,0)):(i.ybase++,this.isUserScrolling||i.ydisp++)}else{let a=r-s+1;i.lines.shiftElements(s+1,a-1,-1),i.lines.set(r,n.clone())}this.isUserScrolling||(i.ydisp=i.ybase),this._onScroll.fire(i.ydisp)}scrollLines(e,t){let i=this.buffer;if(e<0){if(i.ydisp===0)return;this.isUserScrolling=!0}else e+i.ydisp>=i.ybase&&(this.isUserScrolling=!1);let n=i.ydisp;i.ydisp=Math.max(Math.min(i.ydisp+e,i.ybase),0),n!==i.ydisp&&(t||this._onScroll.fire(i.ydisp))}};sb=xt([ne(0,Li)],sb);Nl={cols:80,rows:24,cursorBlink:!1,cursorStyle:"block",cursorWidth:1,cursorInactiveStyle:"outline",customGlyphs:!0,drawBoldTextInBrightColors:!0,documentOverride:null,fastScrollModifier:"alt",fastScrollSensitivity:5,fontFamily:"monospace",fontSize:15,fontWeight:"normal",fontWeightBold:"bold",ignoreBracketedPasteMode:!1,lineHeight:1,letterSpacing:0,linkHandler:null,logLevel:"info",logger:null,scrollback:1e3,scrollOnEraseInDisplay:!1,scrollOnUserInput:!0,scrollSensitivity:1,screenReaderMode:!1,smoothScrollDuration:0,macOptionIsMeta:!1,macOptionClickForcesSelection:!1,minimumContrastRatio:1,disableStdin:!1,allowProposedApi:!1,allowTransparency:!1,tabStopWidth:8,theme:{},reflowCursorLine:!1,rescaleOverlappingGlyphs:!1,rightClickSelectsWord:Nf,windowOptions:{},windowsMode:!1,windowsPty:{},wordSeparator:" ()[]{}',\"`",altClickMovesCursor:!0,convertEol:!1,termName:"xterm",cancelEvents:!1,overviewRuler:{}},Y6=["normal","bold","100","200","300","400","500","600","700","800","900"],j6=class extends xe{constructor(e){super(),this._onOptionChange=this._register(new X),this.onOptionChange=this._onOptionChange.event;let t={...Nl};for(let i in e)if(i in t)try{let n=e[i];t[i]=this._sanitizeAndValidateOption(i,n)}catch(n){console.error(n)}this.rawOptions=t,this.options={...t},this._setupOptions(),this._register(dt(()=>{this.rawOptions.linkHandler=null,this.rawOptions.documentOverride=null}))}onSpecificOptionChange(e,t){return this.onOptionChange(i=>{i===e&&t(this.rawOptions[e])})}onMultipleOptionChange(e,t){return this.onOptionChange(i=>{e.indexOf(i)!==-1&&t()})}_setupOptions(){let e=i=>{if(!(i in Nl))throw new Error(`No option with key "${i}"`);return this.rawOptions[i]},t=(i,n)=>{if(!(i in Nl))throw new Error(`No option with key "${i}"`);n=this._sanitizeAndValidateOption(i,n),this.rawOptions[i]!==n&&(this.rawOptions[i]=n,this._onOptionChange.fire(i))};for(let i in this.rawOptions){let n={get:e.bind(this,i),set:t.bind(this,i)};Object.defineProperty(this.options,i,n)}}_sanitizeAndValidateOption(e,t){switch(e){case"cursorStyle":if(t||(t=Nl[e]),!V6(t))throw new Error(`"${t}" is not a valid value for ${e}`);break;case"wordSeparator":t||(t=Nl[e]);break;case"fontWeight":case"fontWeightBold":if(typeof t=="number"&&1<=t&&t<=1e3)break;t=Y6.includes(t)?t:Nl[e];break;case"cursorWidth":t=Math.floor(t);case"lineHeight":case"tabStopWidth":if(t<1)throw new Error(`${e} cannot be less than 1, value: ${t}`);break;case"minimumContrastRatio":t=Math.max(1,Math.min(21,Math.round(t*10)/10));break;case"scrollback":if(t=Math.min(t,4294967295),t<0)throw new Error(`${e} cannot be less than 0, value: ${t}`);break;case"fastScrollSensitivity":case"scrollSensitivity":if(t<=0)throw new Error(`${e} cannot be less than or equal to 0, value: ${t}`);break;case"rows":case"cols":if(!t&&t!==0)throw new Error(`${e} must be numeric, value: ${t}`);break;case"windowsPty":t=t??{};break}return t}};KN=Object.freeze({insertMode:!1}),WN=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,cursorBlink:void 0,cursorStyle:void 0,origin:!1,reverseWraparound:!1,sendFocus:!1,synchronizedOutput:!1,wraparound:!0}),rb=class extends xe{constructor(e,t,i){super(),this._bufferService=e,this._logService=t,this._optionsService=i,this.isCursorInitialized=!1,this.isCursorHidden=!1,this._onData=this._register(new X),this.onData=this._onData.event,this._onUserInput=this._register(new X),this.onUserInput=this._onUserInput.event,this._onBinary=this._register(new X),this.onBinary=this._onBinary.event,this._onRequestScrollToBottom=this._register(new X),this.onRequestScrollToBottom=this._onRequestScrollToBottom.event,this.modes=pu(KN),this.decPrivateModes=pu(WN)}reset(){this.modes=pu(KN),this.decPrivateModes=pu(WN)}triggerDataEvent(e,t=!1){if(this._optionsService.rawOptions.disableStdin)return;let i=this._bufferService.buffer;t&&this._optionsService.rawOptions.scrollOnUserInput&&i.ybase!==i.ydisp&&this._onRequestScrollToBottom.fire(),t&&this._onUserInput.fire(),this._logService.debug(`sending data "${e}"`),this._logService.trace("sending data (codes)",()=>e.split("").map(n=>n.charCodeAt(0))),this._onData.fire(e)}triggerBinaryEvent(e){this._optionsService.rawOptions.disableStdin||(this._logService.debug(`sending binary "${e}"`),this._logService.trace("sending binary (codes)",()=>e.split("").map(t=>t.charCodeAt(0))),this._onBinary.fire(e))}};rb=xt([ne(0,Di),ne(1,mA),ne(2,Li)],rb);GN={NONE:{events:0,restrict:()=>!1},X10:{events:1,restrict:e=>e.button===4||e.action!==1?!1:(e.ctrl=!1,e.alt=!1,e.shift=!1,!0)},VT200:{events:19,restrict:e=>e.action!==32},DRAG:{events:23,restrict:e=>!(e.action===32&&e.button===3)},ANY:{events:31,restrict:e=>!0}};bv=String.fromCharCode,$N={DEFAULT:e=>{let t=[vv(e,!1)+32,e.col+32,e.row+32];return t[0]>255||t[1]>255||t[2]>255?"":`\x1B[M${bv(t[0])}${bv(t[1])}${bv(t[2])}`},SGR:e=>{let t=e.action===0&&e.button!==4?"m":"M";return`\x1B[<${vv(e,!0)};${e.col};${e.row}${t}`},SGR_PIXELS:e=>{let t=e.action===0&&e.button!==4?"m":"M";return`\x1B[<${vv(e,!0)};${e.x};${e.y}${t}`}},ab=class extends xe{constructor(e,t,i){super(),this._bufferService=e,this._coreService=t,this._optionsService=i,this._protocols={},this._encodings={},this._activeProtocol="",this._activeEncoding="",this._lastEvent=null,this._wheelPartialScroll=0,this._onProtocolChange=this._register(new X),this.onProtocolChange=this._onProtocolChange.event;for(let n of Object.keys(GN))this.addProtocol(n,GN[n]);for(let n of Object.keys($N))this.addEncoding(n,$N[n]);this.reset()}addProtocol(e,t){this._protocols[e]=t}addEncoding(e,t){this._encodings[e]=t}get activeProtocol(){return this._activeProtocol}get areMouseEventsActive(){return this._protocols[this._activeProtocol].events!==0}set activeProtocol(e){if(!this._protocols[e])throw new Error(`unknown protocol "${e}"`);this._activeProtocol=e,this._onProtocolChange.fire(this._protocols[e].events)}get activeEncoding(){return this._activeEncoding}set activeEncoding(e){if(!this._encodings[e])throw new Error(`unknown encoding "${e}"`);this._activeEncoding=e}reset(){this.activeProtocol="NONE",this.activeEncoding="DEFAULT",this._lastEvent=null,this._wheelPartialScroll=0}consumeWheelEvent(e,t,i){if(e.deltaY===0||e.shiftKey||t===void 0||i===void 0)return 0;let n=t/i,s=this._applyScrollModifier(e.deltaY,e);return e.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(s/=n+0,Math.abs(e.deltaY)<50&&(s*=.3),this._wheelPartialScroll+=s,s=Math.floor(Math.abs(this._wheelPartialScroll))*(this._wheelPartialScroll>0?1:-1),this._wheelPartialScroll%=1):e.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(s*=this._bufferService.rows),s}_applyScrollModifier(e,t){return t.altKey||t.ctrlKey||t.shiftKey?e*this._optionsService.rawOptions.fastScrollSensitivity*this._optionsService.rawOptions.scrollSensitivity:e*this._optionsService.rawOptions.scrollSensitivity}triggerMouseEvent(e){if(e.col<0||e.col>=this._bufferService.cols||e.row<0||e.row>=this._bufferService.rows||e.button===4&&e.action===32||e.button===3&&e.action!==32||e.button!==4&&(e.action===2||e.action===3)||(e.col++,e.row++,e.action===32&&this._lastEvent&&this._equalEvents(this._lastEvent,e,this._activeEncoding==="SGR_PIXELS"))||!this._protocols[this._activeProtocol].restrict(e))return!1;let t=this._encodings[this._activeEncoding](e);return t&&(this._activeEncoding==="DEFAULT"?this._coreService.triggerBinaryEvent(t):this._coreService.triggerDataEvent(t,!0)),this._lastEvent=e,!0}explainEvents(e){return{down:!!(e&1),up:!!(e&2),drag:!!(e&4),move:!!(e&8),wheel:!!(e&16)}}_equalEvents(e,t,i){if(i){if(e.x!==t.x||e.y!==t.y)return!1}else if(e.col!==t.col||e.row!==t.row)return!1;return!(e.button!==t.button||e.action!==t.action||e.ctrl!==t.ctrl||e.alt!==t.alt||e.shift!==t.shift)}};ab=xt([ne(0,Di),ne(1,Xa),ne(2,Li)],ab);yv=[[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]],X6=[[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]];Q6=class{constructor(){if(this.version="6",!Wt){Wt=new Uint8Array(65536),Wt.fill(1),Wt[0]=0,Wt.fill(0,1,32),Wt.fill(0,127,160),Wt.fill(2,4352,4448),Wt[9001]=2,Wt[9002]=2,Wt.fill(2,11904,42192),Wt[12351]=1,Wt.fill(2,44032,55204),Wt.fill(2,63744,64256),Wt.fill(2,65040,65050),Wt.fill(2,65072,65136),Wt.fill(2,65280,65377),Wt.fill(2,65504,65511);for(let e=0;e<yv.length;++e)Wt.fill(0,yv[e][0],yv[e][1]+1)}}wcwidth(e){return e<32?0:e<127?1:e<65536?Wt[e]:Z6(e,X6)?0:e>=131072&&e<=196605||e>=196608&&e<=262141?2:1}charProperties(e,t){let i=this.wcwidth(e),n=i===0&&t!==0;if(n){let s=$a.extractWidth(t);s===0?n=!1:s>i&&(i=s)}return $a.createPropertyValue(0,i,n)}},$a=class Sf{constructor(){this._providers=Object.create(null),this._active="",this._onChange=new X,this.onChange=this._onChange.event;let t=new Q6;this.register(t),this._active=t.version,this._activeProvider=t}static extractShouldJoin(t){return(t&1)!==0}static extractWidth(t){return t>>1&3}static extractCharKind(t){return t>>3}static createPropertyValue(t,i,n=!1){return(t&16777215)<<3|(i&3)<<1|(n?1:0)}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(t){if(!this._providers[t])throw new Error(`unknown Unicode version "${t}"`);this._active=t,this._activeProvider=this._providers[t],this._onChange.fire(t)}register(t){this._providers[t.version]=t}wcwidth(t){return this._activeProvider.wcwidth(t)}getStringCellWidth(t){let i=0,n=0,s=t.length;for(let r=0;r<s;++r){let a=t.charCodeAt(r);if(55296<=a&&a<=56319){if(++r>=s)return i+this.wcwidth(a);let c=t.charCodeAt(r);56320<=c&&c<=57343?a=(a-55296)*1024+c-56320+65536:i+=this.wcwidth(c)}let o=this.charProperties(a,n),l=Sf.extractWidth(o);Sf.extractShouldJoin(o)&&(l-=Sf.extractWidth(n)),i+=l,n=o}return i}charProperties(t,i){return this._activeProvider.charProperties(t,i)}},J6=class{constructor(){this.glevel=0,this._charsets=[]}reset(){this.charset=void 0,this._charsets=[],this.glevel=0}setgLevel(e){this.glevel=e,this.charset=this._charsets[e]}setgCharset(e,t){this._charsets[e]=t,this.glevel===e&&(this.charset=t)}};ou=2147483647,e4=256,tM=class ob{constructor(t=32,i=32){if(this.maxLength=t,this.maxSubParamsLength=i,i>e4)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(t),this.length=0,this._subParams=new Int32Array(i),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(t),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}static fromArray(t){let i=new ob;if(!t.length)return i;for(let n=Array.isArray(t[0])?1:0;n<t.length;++n){let s=t[n];if(Array.isArray(s))for(let r=0;r<s.length;++r)i.addSubParam(s[r]);else i.addParam(s)}return i}clone(){let t=new ob(this.maxLength,this.maxSubParamsLength);return t.params.set(this.params),t.length=this.length,t._subParams.set(this._subParams),t._subParamsLength=this._subParamsLength,t._subParamsIdx.set(this._subParamsIdx),t._rejectDigits=this._rejectDigits,t._rejectSubDigits=this._rejectSubDigits,t._digitIsSub=this._digitIsSub,t}toArray(){let t=[];for(let i=0;i<this.length;++i){t.push(this.params[i]);let n=this._subParamsIdx[i]>>8,s=this._subParamsIdx[i]&255;s-n>0&&t.push(Array.prototype.slice.call(this._subParams,n,s))}return t}reset(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}addParam(t){if(this._digitIsSub=!1,this.length>=this.maxLength){this._rejectDigits=!0;return}if(t<-1)throw new Error("values lesser than -1 are not allowed");this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=t>ou?ou:t}addSubParam(t){if(this._digitIsSub=!0,!!this.length){if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength){this._rejectSubDigits=!0;return}if(t<-1)throw new Error("values lesser than -1 are not allowed");this._subParams[this._subParamsLength++]=t>ou?ou:t,this._subParamsIdx[this.length-1]++}}hasSubParams(t){return(this._subParamsIdx[t]&255)-(this._subParamsIdx[t]>>8)>0}getSubParams(t){let i=this._subParamsIdx[t]>>8,n=this._subParamsIdx[t]&255;return n-i>0?this._subParams.subarray(i,n):null}getSubParamsAll(){let t={};for(let i=0;i<this.length;++i){let n=this._subParamsIdx[i]>>8,s=this._subParamsIdx[i]&255;s-n>0&&(t[i]=this._subParams.slice(n,s))}return t}addDigit(t){let i;if(this._rejectDigits||!(i=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;let n=this._digitIsSub?this._subParams:this.params,s=n[i-1];n[i-1]=~s?Math.min(s*10+t,ou):t}},lu=[],t4=class{constructor(){this._state=0,this._active=lu,this._id=-1,this._handlers=Object.create(null),this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}registerHandler(e,t){this._handlers[e]===void 0&&(this._handlers[e]=[]);let i=this._handlers[e];return i.push(t),{dispose:()=>{let n=i.indexOf(t);n!==-1&&i.splice(n,1)}}}clearHandler(e){this._handlers[e]&&delete this._handlers[e]}setHandlerFallback(e){this._handlerFb=e}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=lu}reset(){if(this._state===2)for(let e=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;e>=0;--e)this._active[e].end(!1);this._stack.paused=!1,this._active=lu,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||lu,!this._active.length)this._handlerFb(this._id,"START");else for(let e=this._active.length-1;e>=0;e--)this._active[e].start()}_put(e,t,i){if(!this._active.length)this._handlerFb(this._id,"PUT",Of(e,t,i));else for(let n=this._active.length-1;n>=0;n--)this._active[n].put(e,t,i)}start(){this.reset(),this._state=1}put(e,t,i){if(this._state!==3){if(this._state===1)for(;t<i;){let n=e[t++];if(n===59){this._state=2,this._start();break}if(n<48||57<n){this._state=3;return}this._id===-1&&(this._id=0),this._id=this._id*10+n-48}this._state===2&&i-t>0&&this._put(e,t,i)}}end(e,t=!0){if(this._state!==0){if(this._state!==3)if(this._state===1&&this._start(),!this._active.length)this._handlerFb(this._id,"END",e);else{let i=!1,n=this._active.length-1,s=!1;if(this._stack.paused&&(n=this._stack.loopPosition-1,i=t,s=this._stack.fallThrough,this._stack.paused=!1),!s&&i===!1){for(;n>=0&&(i=this._active[n].end(e),i!==!0);n--)if(i instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=n,this._stack.fallThrough=!1,i;n--}for(;n>=0;n--)if(i=this._active[n].end(!1),i instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=n,this._stack.fallThrough=!0,i}this._active=lu,this._id=-1,this._state=0}}},dn=class{constructor(e){this._handler=e,this._data="",this._hitLimit=!1}start(){this._data="",this._hitLimit=!1}put(e,t,i){this._hitLimit||(this._data+=Of(e,t,i),this._data.length>1e7&&(this._data="",this._hitLimit=!0))}end(e){let t=!1;if(this._hitLimit)t=!1;else if(e&&(t=this._handler(this._data),t instanceof Promise))return t.then(i=>(this._data="",this._hitLimit=!1,i));return this._data="",this._hitLimit=!1,t}},cu=[],i4=class{constructor(){this._handlers=Object.create(null),this._active=cu,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=cu}registerHandler(e,t){this._handlers[e]===void 0&&(this._handlers[e]=[]);let i=this._handlers[e];return i.push(t),{dispose:()=>{let n=i.indexOf(t);n!==-1&&i.splice(n,1)}}}clearHandler(e){this._handlers[e]&&delete this._handlers[e]}setHandlerFallback(e){this._handlerFb=e}reset(){if(this._active.length)for(let e=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;e>=0;--e)this._active[e].unhook(!1);this._stack.paused=!1,this._active=cu,this._ident=0}hook(e,t){if(this.reset(),this._ident=e,this._active=this._handlers[e]||cu,!this._active.length)this._handlerFb(this._ident,"HOOK",t);else for(let i=this._active.length-1;i>=0;i--)this._active[i].hook(t)}put(e,t,i){if(!this._active.length)this._handlerFb(this._ident,"PUT",Of(e,t,i));else for(let n=this._active.length-1;n>=0;n--)this._active[n].put(e,t,i)}unhook(e,t=!0){if(!this._active.length)this._handlerFb(this._ident,"UNHOOK",e);else{let i=!1,n=this._active.length-1,s=!1;if(this._stack.paused&&(n=this._stack.loopPosition-1,i=t,s=this._stack.fallThrough,this._stack.paused=!1),!s&&i===!1){for(;n>=0&&(i=this._active[n].unhook(e),i!==!0);n--)if(i instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=n,this._stack.fallThrough=!1,i;n--}for(;n>=0;n--)if(i=this._active[n].unhook(!1),i instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=n,this._stack.fallThrough=!0,i}this._active=cu,this._ident=0}},mu=new tM;mu.addParam(0);jN=class{constructor(e){this._handler=e,this._data="",this._params=mu,this._hitLimit=!1}hook(e){this._params=e.length>1||e.params[0]?e.clone():mu,this._data="",this._hitLimit=!1}put(e,t,i){this._hitLimit||(this._data+=Of(e,t,i),this._data.length>1e7&&(this._data="",this._hitLimit=!0))}unhook(e){let t=!1;if(this._hitLimit)t=!1;else if(e&&(t=this._handler(this._data,this._params),t instanceof Promise))return t.then(i=>(this._params=mu,this._data="",this._hitLimit=!1,i));return this._params=mu,this._data="",this._hitLimit=!1,t}},n4=class{constructor(e){this.table=new Uint8Array(e)}setDefault(e,t){this.table.fill(e<<4|t)}add(e,t,i,n){this.table[t<<8|e]=i<<4|n}addMany(e,t,i,n){for(let s=0;s<e.length;s++)this.table[t<<8|e[s]]=i<<4|n}},Dn=160,s4=(function(){let e=new n4(4095),t=Array.apply(null,Array(256)).map((o,l)=>l),i=(o,l)=>t.slice(o,l),n=i(32,127),s=i(0,24);s.push(25),s.push.apply(s,i(28,32));let r=i(0,14),a;e.setDefault(1,0),e.addMany(n,0,2,0);for(a in r)e.addMany([24,26,153,154],a,3,0),e.addMany(i(128,144),a,3,0),e.addMany(i(144,152),a,3,0),e.add(156,a,0,0),e.add(27,a,11,1),e.add(157,a,4,8),e.addMany([152,158,159],a,0,7),e.add(155,a,11,3),e.add(144,a,11,9);return e.addMany(s,0,3,0),e.addMany(s,1,3,1),e.add(127,1,0,1),e.addMany(s,8,0,8),e.addMany(s,3,3,3),e.add(127,3,0,3),e.addMany(s,4,3,4),e.add(127,4,0,4),e.addMany(s,6,3,6),e.addMany(s,5,3,5),e.add(127,5,0,5),e.addMany(s,2,3,2),e.add(127,2,0,2),e.add(93,1,4,8),e.addMany(n,8,5,8),e.add(127,8,5,8),e.addMany([156,27,24,26,7],8,6,0),e.addMany(i(28,32),8,0,8),e.addMany([88,94,95],1,0,7),e.addMany(n,7,0,7),e.addMany(s,7,0,7),e.add(156,7,0,0),e.add(127,7,0,7),e.add(91,1,11,3),e.addMany(i(64,127),3,7,0),e.addMany(i(48,60),3,8,4),e.addMany([60,61,62,63],3,9,4),e.addMany(i(48,60),4,8,4),e.addMany(i(64,127),4,7,0),e.addMany([60,61,62,63],4,0,6),e.addMany(i(32,64),6,0,6),e.add(127,6,0,6),e.addMany(i(64,127),6,0,0),e.addMany(i(32,48),3,9,5),e.addMany(i(32,48),5,9,5),e.addMany(i(48,64),5,0,6),e.addMany(i(64,127),5,7,0),e.addMany(i(32,48),4,9,5),e.addMany(i(32,48),1,9,2),e.addMany(i(32,48),2,9,2),e.addMany(i(48,127),2,10,0),e.addMany(i(48,80),1,10,0),e.addMany(i(81,88),1,10,0),e.addMany([89,90,92],1,10,0),e.addMany(i(96,127),1,10,0),e.add(80,1,11,9),e.addMany(s,9,0,9),e.add(127,9,0,9),e.addMany(i(28,32),9,0,9),e.addMany(i(32,48),9,9,12),e.addMany(i(48,60),9,8,10),e.addMany([60,61,62,63],9,9,10),e.addMany(s,11,0,11),e.addMany(i(32,128),11,0,11),e.addMany(i(28,32),11,0,11),e.addMany(s,10,0,10),e.add(127,10,0,10),e.addMany(i(28,32),10,0,10),e.addMany(i(48,60),10,8,10),e.addMany([60,61,62,63],10,0,11),e.addMany(i(32,48),10,9,12),e.addMany(s,12,0,12),e.add(127,12,0,12),e.addMany(i(28,32),12,0,12),e.addMany(i(32,48),12,9,12),e.addMany(i(48,64),12,0,11),e.addMany(i(64,127),12,12,13),e.addMany(i(64,127),10,12,13),e.addMany(i(64,127),9,12,13),e.addMany(s,13,13,13),e.addMany(n,13,13,13),e.add(127,13,0,13),e.addMany([27,156,24,26],13,14,0),e.add(Dn,0,2,0),e.add(Dn,8,5,8),e.add(Dn,6,0,6),e.add(Dn,11,0,11),e.add(Dn,13,13,13),e})(),r4=class extends xe{constructor(e=s4){super(),this._transitions=e,this._parseStack={state:0,handlers:[],handlerPos:0,transition:0,chunkPos:0},this.initialState=0,this.currentState=this.initialState,this._params=new tM,this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._printHandlerFb=(t,i,n)=>{},this._executeHandlerFb=t=>{},this._csiHandlerFb=(t,i)=>{},this._escHandlerFb=t=>{},this._errorHandlerFb=t=>t,this._printHandler=this._printHandlerFb,this._executeHandlers=Object.create(null),this._csiHandlers=Object.create(null),this._escHandlers=Object.create(null),this._register(dt(()=>{this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null)})),this._oscParser=this._register(new t4),this._dcsParser=this._register(new i4),this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:"\\"},()=>!0)}_identifier(e,t=[64,126]){let i=0;if(e.prefix){if(e.prefix.length>1)throw new Error("only one byte as prefix supported");if(i=e.prefix.charCodeAt(0),i&&60>i||i>63)throw new Error("prefix must be in range 0x3c .. 0x3f")}if(e.intermediates){if(e.intermediates.length>2)throw new Error("only two bytes as intermediates are supported");for(let s=0;s<e.intermediates.length;++s){let r=e.intermediates.charCodeAt(s);if(32>r||r>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");i<<=8,i|=r}}if(e.final.length!==1)throw new Error("final must be a single byte");let n=e.final.charCodeAt(0);if(t[0]>n||n>t[1])throw new Error(`final must be in range ${t[0]} .. ${t[1]}`);return i<<=8,i|=n,i}identToString(e){let t=[];for(;e;)t.push(String.fromCharCode(e&255)),e>>=8;return t.reverse().join("")}setPrintHandler(e){this._printHandler=e}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(e,t){let i=this._identifier(e,[48,126]);this._escHandlers[i]===void 0&&(this._escHandlers[i]=[]);let n=this._escHandlers[i];return n.push(t),{dispose:()=>{let s=n.indexOf(t);s!==-1&&n.splice(s,1)}}}clearEscHandler(e){this._escHandlers[this._identifier(e,[48,126])]&&delete this._escHandlers[this._identifier(e,[48,126])]}setEscHandlerFallback(e){this._escHandlerFb=e}setExecuteHandler(e,t){this._executeHandlers[e.charCodeAt(0)]=t}clearExecuteHandler(e){this._executeHandlers[e.charCodeAt(0)]&&delete this._executeHandlers[e.charCodeAt(0)]}setExecuteHandlerFallback(e){this._executeHandlerFb=e}registerCsiHandler(e,t){let i=this._identifier(e);this._csiHandlers[i]===void 0&&(this._csiHandlers[i]=[]);let n=this._csiHandlers[i];return n.push(t),{dispose:()=>{let s=n.indexOf(t);s!==-1&&n.splice(s,1)}}}clearCsiHandler(e){this._csiHandlers[this._identifier(e)]&&delete this._csiHandlers[this._identifier(e)]}setCsiHandlerFallback(e){this._csiHandlerFb=e}registerDcsHandler(e,t){return this._dcsParser.registerHandler(this._identifier(e),t)}clearDcsHandler(e){this._dcsParser.clearHandler(this._identifier(e))}setDcsHandlerFallback(e){this._dcsParser.setHandlerFallback(e)}registerOscHandler(e,t){return this._oscParser.registerHandler(e,t)}clearOscHandler(e){this._oscParser.clearHandler(e)}setOscHandlerFallback(e){this._oscParser.setHandlerFallback(e)}setErrorHandler(e){this._errorHandler=e}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(e,t,i,n,s){this._parseStack.state=e,this._parseStack.handlers=t,this._parseStack.handlerPos=i,this._parseStack.transition=n,this._parseStack.chunkPos=s}parse(e,t,i){let n=0,s=0,r=0,a;if(this._parseStack.state)if(this._parseStack.state===2)this._parseStack.state=0,r=this._parseStack.chunkPos+1;else{if(i===void 0||this._parseStack.state===1)throw this._parseStack.state=1,new Error("improper continuation due to previous async handler, giving up parsing");let o=this._parseStack.handlers,l=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(i===!1&&l>-1){for(;l>=0&&(a=o[l](this._params),a!==!0);l--)if(a instanceof Promise)return this._parseStack.handlerPos=l,a}this._parseStack.handlers=[];break;case 4:if(i===!1&&l>-1){for(;l>=0&&(a=o[l](),a!==!0);l--)if(a instanceof Promise)return this._parseStack.handlerPos=l,a}this._parseStack.handlers=[];break;case 6:if(n=e[this._parseStack.chunkPos],a=this._dcsParser.unhook(n!==24&&n!==26,i),a)return a;n===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(n=e[this._parseStack.chunkPos],a=this._oscParser.end(n!==24&&n!==26,i),a)return a;n===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break}this._parseStack.state=0,r=this._parseStack.chunkPos+1,this.precedingJoinState=0,this.currentState=this._parseStack.transition&15}for(let o=r;o<t;++o){switch(n=e[o],s=this._transitions.table[this.currentState<<8|(n<160?n:Dn)],s>>4){case 2:for(let d=o+1;;++d){if(d>=t||(n=e[d])<32||n>126&&n<Dn){this._printHandler(e,o,d),o=d-1;break}if(++d>=t||(n=e[d])<32||n>126&&n<Dn){this._printHandler(e,o,d),o=d-1;break}if(++d>=t||(n=e[d])<32||n>126&&n<Dn){this._printHandler(e,o,d),o=d-1;break}if(++d>=t||(n=e[d])<32||n>126&&n<Dn){this._printHandler(e,o,d),o=d-1;break}}break;case 3:this._executeHandlers[n]?this._executeHandlers[n]():this._executeHandlerFb(n),this.precedingJoinState=0;break;case 0:break;case 1:if(this._errorHandler({position:o,code:n,currentState:this.currentState,collect:this._collect,params:this._params,abort:!1}).abort)return;break;case 7:let l=this._csiHandlers[this._collect<<8|n],c=l?l.length-1:-1;for(;c>=0&&(a=l[c](this._params),a!==!0);c--)if(a instanceof Promise)return this._preserveStack(3,l,c,s,o),a;c<0&&this._csiHandlerFb(this._collect<<8|n,this._params),this.precedingJoinState=0;break;case 8:do switch(n){case 59:this._params.addParam(0);break;case 58:this._params.addSubParam(-1);break;default:this._params.addDigit(n-48)}while(++o<t&&(n=e[o])>47&&n<60);o--;break;case 9:this._collect<<=8,this._collect|=n;break;case 10:let u=this._escHandlers[this._collect<<8|n],h=u?u.length-1:-1;for(;h>=0&&(a=u[h](),a!==!0);h--)if(a instanceof Promise)return this._preserveStack(4,u,h,s,o),a;h<0&&this._escHandlerFb(this._collect<<8|n),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|n,this._params);break;case 13:for(let d=o+1;;++d)if(d>=t||(n=e[d])===24||n===26||n===27||n>127&&n<Dn){this._dcsParser.put(e,o,d),o=d-1;break}break;case 14:if(a=this._dcsParser.unhook(n!==24&&n!==26),a)return this._preserveStack(6,[],0,s,o),a;n===27&&(s|=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=o+1;;d++)if(d>=t||(n=e[d])<32||n>127&&n<Dn){this._oscParser.put(e,o,d),o=d-1;break}break;case 6:if(a=this._oscParser.end(n!==24&&n!==26),a)return this._preserveStack(5,[],0,s,o),a;n===27&&(s|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0;break}this.currentState=s&15}}},a4=/^([\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})$/,o4=/^[\da-f]+$/;c4={"(":0,")":1,"*":2,"+":3,"-":1,".":2},Yr=131072,XN=10;QN=5e3,JN=0,u4=class extends xe{constructor(e,t,i,n,s,r,a,o,l=new r4){super(),this._bufferService=e,this._charsetService=t,this._coreService=i,this._logService=n,this._optionsService=s,this._oscLinkService=r,this._coreMouseService=a,this._unicodeService=o,this._parser=l,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new sz,this._utf8Decoder=new rz,this._windowTitle="",this._iconName="",this._windowTitleStack=[],this._iconNameStack=[],this._curAttrData=It.clone(),this._eraseAttrDataInternal=It.clone(),this._onRequestBell=this._register(new X),this.onRequestBell=this._onRequestBell.event,this._onRequestRefreshRows=this._register(new X),this.onRequestRefreshRows=this._onRequestRefreshRows.event,this._onRequestReset=this._register(new X),this.onRequestReset=this._onRequestReset.event,this._onRequestSendFocus=this._register(new X),this.onRequestSendFocus=this._onRequestSendFocus.event,this._onRequestSyncScrollBar=this._register(new X),this.onRequestSyncScrollBar=this._onRequestSyncScrollBar.event,this._onRequestWindowsOptionsReport=this._register(new X),this.onRequestWindowsOptionsReport=this._onRequestWindowsOptionsReport.event,this._onA11yChar=this._register(new X),this.onA11yChar=this._onA11yChar.event,this._onA11yTab=this._register(new X),this.onA11yTab=this._onA11yTab.event,this._onCursorMove=this._register(new X),this.onCursorMove=this._onCursorMove.event,this._onLineFeed=this._register(new X),this.onLineFeed=this._onLineFeed.event,this._onScroll=this._register(new X),this.onScroll=this._onScroll.event,this._onTitleChange=this._register(new X),this.onTitleChange=this._onTitleChange.event,this._onColor=this._register(new X),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 lb(this._bufferService),this._activeBuffer=this._bufferService.buffer,this._register(this._bufferService.buffers.onBufferActivate(c=>this._activeBuffer=c.activeBuffer)),this._parser.setCsiHandlerFallback((c,u)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString(c),params:u.toArray()})}),this._parser.setEscHandlerFallback(c=>{this._logService.debug("Unknown ESC code: ",{identifier:this._parser.identToString(c)})}),this._parser.setExecuteHandlerFallback(c=>{this._logService.debug("Unknown EXECUTE code: ",{code:c})}),this._parser.setOscHandlerFallback((c,u,h)=>{this._logService.debug("Unknown OSC code: ",{identifier:c,action:u,data:h})}),this._parser.setDcsHandlerFallback((c,u,h)=>{u==="HOOK"&&(h=h.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(c),action:u,payload:h})}),this._parser.setPrintHandler((c,u,h)=>this.print(c,u,h)),this._parser.registerCsiHandler({final:"@"},c=>this.insertChars(c)),this._parser.registerCsiHandler({intermediates:" ",final:"@"},c=>this.scrollLeft(c)),this._parser.registerCsiHandler({final:"A"},c=>this.cursorUp(c)),this._parser.registerCsiHandler({intermediates:" ",final:"A"},c=>this.scrollRight(c)),this._parser.registerCsiHandler({final:"B"},c=>this.cursorDown(c)),this._parser.registerCsiHandler({final:"C"},c=>this.cursorForward(c)),this._parser.registerCsiHandler({final:"D"},c=>this.cursorBackward(c)),this._parser.registerCsiHandler({final:"E"},c=>this.cursorNextLine(c)),this._parser.registerCsiHandler({final:"F"},c=>this.cursorPrecedingLine(c)),this._parser.registerCsiHandler({final:"G"},c=>this.cursorCharAbsolute(c)),this._parser.registerCsiHandler({final:"H"},c=>this.cursorPosition(c)),this._parser.registerCsiHandler({final:"I"},c=>this.cursorForwardTab(c)),this._parser.registerCsiHandler({final:"J"},c=>this.eraseInDisplay(c,!1)),this._parser.registerCsiHandler({prefix:"?",final:"J"},c=>this.eraseInDisplay(c,!0)),this._parser.registerCsiHandler({final:"K"},c=>this.eraseInLine(c,!1)),this._parser.registerCsiHandler({prefix:"?",final:"K"},c=>this.eraseInLine(c,!0)),this._parser.registerCsiHandler({final:"L"},c=>this.insertLines(c)),this._parser.registerCsiHandler({final:"M"},c=>this.deleteLines(c)),this._parser.registerCsiHandler({final:"P"},c=>this.deleteChars(c)),this._parser.registerCsiHandler({final:"S"},c=>this.scrollUp(c)),this._parser.registerCsiHandler({final:"T"},c=>this.scrollDown(c)),this._parser.registerCsiHandler({final:"X"},c=>this.eraseChars(c)),this._parser.registerCsiHandler({final:"Z"},c=>this.cursorBackwardTab(c)),this._parser.registerCsiHandler({final:"`"},c=>this.charPosAbsolute(c)),this._parser.registerCsiHandler({final:"a"},c=>this.hPositionRelative(c)),this._parser.registerCsiHandler({final:"b"},c=>this.repeatPrecedingCharacter(c)),this._parser.registerCsiHandler({final:"c"},c=>this.sendDeviceAttributesPrimary(c)),this._parser.registerCsiHandler({prefix:">",final:"c"},c=>this.sendDeviceAttributesSecondary(c)),this._parser.registerCsiHandler({final:"d"},c=>this.linePosAbsolute(c)),this._parser.registerCsiHandler({final:"e"},c=>this.vPositionRelative(c)),this._parser.registerCsiHandler({final:"f"},c=>this.hVPosition(c)),this._parser.registerCsiHandler({final:"g"},c=>this.tabClear(c)),this._parser.registerCsiHandler({final:"h"},c=>this.setMode(c)),this._parser.registerCsiHandler({prefix:"?",final:"h"},c=>this.setModePrivate(c)),this._parser.registerCsiHandler({final:"l"},c=>this.resetMode(c)),this._parser.registerCsiHandler({prefix:"?",final:"l"},c=>this.resetModePrivate(c)),this._parser.registerCsiHandler({final:"m"},c=>this.charAttributes(c)),this._parser.registerCsiHandler({final:"n"},c=>this.deviceStatus(c)),this._parser.registerCsiHandler({prefix:"?",final:"n"},c=>this.deviceStatusPrivate(c)),this._parser.registerCsiHandler({intermediates:"!",final:"p"},c=>this.softReset(c)),this._parser.registerCsiHandler({intermediates:" ",final:"q"},c=>this.setCursorStyle(c)),this._parser.registerCsiHandler({final:"r"},c=>this.setScrollRegion(c)),this._parser.registerCsiHandler({final:"s"},c=>this.saveCursor(c)),this._parser.registerCsiHandler({final:"t"},c=>this.windowOptions(c)),this._parser.registerCsiHandler({final:"u"},c=>this.restoreCursor(c)),this._parser.registerCsiHandler({intermediates:"'",final:"}"},c=>this.insertColumns(c)),this._parser.registerCsiHandler({intermediates:"'",final:"~"},c=>this.deleteColumns(c)),this._parser.registerCsiHandler({intermediates:'"',final:"q"},c=>this.selectProtected(c)),this._parser.registerCsiHandler({intermediates:"$",final:"p"},c=>this.requestMode(c,!0)),this._parser.registerCsiHandler({prefix:"?",intermediates:"$",final:"p"},c=>this.requestMode(c,!1)),this._parser.setExecuteHandler(z.BEL,()=>this.bell()),this._parser.setExecuteHandler(z.LF,()=>this.lineFeed()),this._parser.setExecuteHandler(z.VT,()=>this.lineFeed()),this._parser.setExecuteHandler(z.FF,()=>this.lineFeed()),this._parser.setExecuteHandler(z.CR,()=>this.carriageReturn()),this._parser.setExecuteHandler(z.BS,()=>this.backspace()),this._parser.setExecuteHandler(z.HT,()=>this.tab()),this._parser.setExecuteHandler(z.SO,()=>this.shiftOut()),this._parser.setExecuteHandler(z.SI,()=>this.shiftIn()),this._parser.setExecuteHandler(vu.IND,()=>this.index()),this._parser.setExecuteHandler(vu.NEL,()=>this.nextLine()),this._parser.setExecuteHandler(vu.HTS,()=>this.tabSet()),this._parser.registerOscHandler(0,new dn(c=>(this.setTitle(c),this.setIconName(c),!0))),this._parser.registerOscHandler(1,new dn(c=>this.setIconName(c))),this._parser.registerOscHandler(2,new dn(c=>this.setTitle(c))),this._parser.registerOscHandler(4,new dn(c=>this.setOrReportIndexedColor(c))),this._parser.registerOscHandler(8,new dn(c=>this.setHyperlink(c))),this._parser.registerOscHandler(10,new dn(c=>this.setOrReportFgColor(c))),this._parser.registerOscHandler(11,new dn(c=>this.setOrReportBgColor(c))),this._parser.registerOscHandler(12,new dn(c=>this.setOrReportCursorColor(c))),this._parser.registerOscHandler(104,new dn(c=>this.restoreIndexedColor(c))),this._parser.registerOscHandler(110,new dn(c=>this.restoreFgColor(c))),this._parser.registerOscHandler(111,new dn(c=>this.restoreBgColor(c))),this._parser.registerOscHandler(112,new dn(c=>this.restoreCursorColor(c))),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(let c in Gt)this._parser.registerEscHandler({intermediates:"(",final:c},()=>this.selectCharset("("+c)),this._parser.registerEscHandler({intermediates:")",final:c},()=>this.selectCharset(")"+c)),this._parser.registerEscHandler({intermediates:"*",final:c},()=>this.selectCharset("*"+c)),this._parser.registerEscHandler({intermediates:"+",final:c},()=>this.selectCharset("+"+c)),this._parser.registerEscHandler({intermediates:"-",final:c},()=>this.selectCharset("-"+c)),this._parser.registerEscHandler({intermediates:".",final:c},()=>this.selectCharset("."+c)),this._parser.registerEscHandler({intermediates:"/",final:c},()=>this.selectCharset("/"+c));this._parser.registerEscHandler({intermediates:"#",final:"8"},()=>this.screenAlignmentPattern()),this._parser.setErrorHandler(c=>(this._logService.error("Parsing error: ",c),c)),this._parser.registerDcsHandler({intermediates:"$",final:"q"},new jN((c,u)=>this.requestStatusString(c,u)))}getAttrData(){return this._curAttrData}_preserveStack(e,t,i,n){this._parseStack.paused=!0,this._parseStack.cursorStartX=e,this._parseStack.cursorStartY=t,this._parseStack.decodedLength=i,this._parseStack.position=n}_logSlowResolvingAsync(e){this._logService.logLevel<=3&&Promise.race([e,new Promise((t,i)=>setTimeout(()=>i("#SLOW_TIMEOUT"),QN))]).catch(t=>{if(t!=="#SLOW_TIMEOUT")throw t;console.warn(`async parser handler taking longer than ${QN} ms`)})}_getCurrentLinkId(){return this._curAttrData.extended.urlId}parse(e,t){let i,n=this._activeBuffer.x,s=this._activeBuffer.y,r=0,a=this._parseStack.paused;if(a){if(i=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,t))return this._logSlowResolvingAsync(i),i;n=this._parseStack.cursorStartX,s=this._parseStack.cursorStartY,this._parseStack.paused=!1,e.length>Yr&&(r=this._parseStack.position+Yr)}if(this._logService.logLevel<=1&&this._logService.debug(`parsing data ${typeof e=="string"?` "${e}"`:` "${Array.prototype.map.call(e,c=>String.fromCharCode(c)).join("")}"`}`),this._logService.logLevel===0&&this._logService.trace("parsing data (codes)",typeof e=="string"?e.split("").map(c=>c.charCodeAt(0)):e),this._parseBuffer.length<e.length&&this._parseBuffer.length<Yr&&(this._parseBuffer=new Uint32Array(Math.min(e.length,Yr))),a||this._dirtyRowTracker.clearRange(),e.length>Yr)for(let c=r;c<e.length;c+=Yr){let u=c+Yr<e.length?c+Yr:e.length,h=typeof e=="string"?this._stringDecoder.decode(e.substring(c,u),this._parseBuffer):this._utf8Decoder.decode(e.subarray(c,u),this._parseBuffer);if(i=this._parser.parse(this._parseBuffer,h))return this._preserveStack(n,s,h,c),this._logSlowResolvingAsync(i),i}else if(!a){let c=typeof e=="string"?this._stringDecoder.decode(e,this._parseBuffer):this._utf8Decoder.decode(e,this._parseBuffer);if(i=this._parser.parse(this._parseBuffer,c))return this._preserveStack(n,s,c,0),this._logSlowResolvingAsync(i),i}(this._activeBuffer.x!==n||this._activeBuffer.y!==s)&&this._onCursorMove.fire();let o=this._dirtyRowTracker.end+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp),l=this._dirtyRowTracker.start+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp);l<this._bufferService.rows&&this._onRequestRefreshRows.fire({start:Math.min(l,this._bufferService.rows-1),end:Math.min(o,this._bufferService.rows-1)})}print(e,t,i){let n,s,r=this._charsetService.charset,a=this._optionsService.rawOptions.screenReaderMode,o=this._bufferService.cols,l=this._coreService.decPrivateModes.wraparound,c=this._coreService.modes.insertMode,u=this._curAttrData,h=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._activeBuffer.x&&i-t>0&&h.getWidth(this._activeBuffer.x-1)===2&&h.setCellFromCodepoint(this._activeBuffer.x-1,0,1,u);let d=this._parser.precedingJoinState;for(let f=t;f<i;++f){if(n=e[f],n<127&&r){let g=r[String.fromCharCode(n)];g&&(n=g.charCodeAt(0))}let p=this._unicodeService.charProperties(n,d);s=$a.extractWidth(p);let _=$a.extractShouldJoin(p),v=_?$a.extractWidth(d):0;if(d=p,a&&this._onA11yChar.fire(jr(n)),this._getCurrentLinkId()&&this._oscLinkService.addLineToLink(this._getCurrentLinkId(),this._activeBuffer.ybase+this._activeBuffer.y),this._activeBuffer.x+s-v>o){if(l){let g=h,m=this._activeBuffer.x-v;for(this._activeBuffer.x=v,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),h=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y),v>0&&h instanceof fu&&h.copyCellsFrom(g,m,0,v,!1);m<o;)g.setCellFromCodepoint(m++,0,1,u)}else if(this._activeBuffer.x=o-1,s===2)continue}if(_&&this._activeBuffer.x){let g=h.getWidth(this._activeBuffer.x-1)?1:2;h.addCodepointToCell(this._activeBuffer.x-g,n,s);for(let m=s-v;--m>=0;)h.setCellFromCodepoint(this._activeBuffer.x++,0,0,u);continue}if(c&&(h.insertCells(this._activeBuffer.x,s-v,this._activeBuffer.getNullCell(u)),h.getWidth(o-1)===2&&h.setCellFromCodepoint(o-1,0,1,u)),h.setCellFromCodepoint(this._activeBuffer.x++,n,s,u),s>0)for(;--s;)h.setCellFromCodepoint(this._activeBuffer.x++,0,0,u)}this._parser.precedingJoinState=d,this._activeBuffer.x<o&&i-t>0&&h.getWidth(this._activeBuffer.x)===0&&!h.hasContent(this._activeBuffer.x)&&h.setCellFromCodepoint(this._activeBuffer.x,0,1,u),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler(e,t){return e.final==="t"&&!e.prefix&&!e.intermediates?this._parser.registerCsiHandler(e,i=>ZN(i.params[0],this._optionsService.rawOptions.windowOptions)?t(i):!0):this._parser.registerCsiHandler(e,t)}registerDcsHandler(e,t){return this._parser.registerDcsHandler(e,new jN(t))}registerEscHandler(e,t){return this._parser.registerEscHandler(e,t)}registerOscHandler(e,t){return this._parser.registerOscHandler(e,new dn(t))}bell(){return this._onRequestBell.fire(),!0}lineFeed(){return this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._optionsService.rawOptions.convertEol&&(this._activeBuffer.x=0),this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData())):this._activeBuffer.y>=this._bufferService.rows?this._activeBuffer.y=this._bufferService.rows-1:this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.x>=this._bufferService.cols&&this._activeBuffer.x--,this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._onLineFeed.fire(),!0}carriageReturn(){return this._activeBuffer.x=0,!0}backspace(){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&&this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y)?.isWrapped){this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.y--,this._activeBuffer.x=this._bufferService.cols-1;let e=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);e.hasWidth(this._activeBuffer.x)&&!e.hasContent(this._activeBuffer.x)&&this._activeBuffer.x--}return this._restrictCursor(),!0}tab(){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let e=this._activeBuffer.x;return this._activeBuffer.x=this._activeBuffer.nextStop(),this._optionsService.rawOptions.screenReaderMode&&this._onA11yTab.fire(this._activeBuffer.x-e),!0}shiftOut(){return this._charsetService.setgLevel(1),!0}shiftIn(){return this._charsetService.setgLevel(0),!0}_restrictCursor(e=this._bufferService.cols-1){this._activeBuffer.x=Math.min(e,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(e,t){this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=e,this._activeBuffer.y=this._activeBuffer.scrollTop+t):(this._activeBuffer.x=e,this._activeBuffer.y=t),this._restrictCursor(),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_moveCursor(e,t){this._restrictCursor(),this._setCursor(this._activeBuffer.x+e,this._activeBuffer.y+t)}cursorUp(e){let t=this._activeBuffer.y-this._activeBuffer.scrollTop;return t>=0?this._moveCursor(0,-Math.min(t,e.params[0]||1)):this._moveCursor(0,-(e.params[0]||1)),!0}cursorDown(e){let t=this._activeBuffer.scrollBottom-this._activeBuffer.y;return t>=0?this._moveCursor(0,Math.min(t,e.params[0]||1)):this._moveCursor(0,e.params[0]||1),!0}cursorForward(e){return this._moveCursor(e.params[0]||1,0),!0}cursorBackward(e){return this._moveCursor(-(e.params[0]||1),0),!0}cursorNextLine(e){return this.cursorDown(e),this._activeBuffer.x=0,!0}cursorPrecedingLine(e){return this.cursorUp(e),this._activeBuffer.x=0,!0}cursorCharAbsolute(e){return this._setCursor((e.params[0]||1)-1,this._activeBuffer.y),!0}cursorPosition(e){return this._setCursor(e.length>=2?(e.params[1]||1)-1:0,(e.params[0]||1)-1),!0}charPosAbsolute(e){return this._setCursor((e.params[0]||1)-1,this._activeBuffer.y),!0}hPositionRelative(e){return this._moveCursor(e.params[0]||1,0),!0}linePosAbsolute(e){return this._setCursor(this._activeBuffer.x,(e.params[0]||1)-1),!0}vPositionRelative(e){return this._moveCursor(0,e.params[0]||1),!0}hVPosition(e){return this.cursorPosition(e),!0}tabClear(e){let t=e.params[0];return t===0?delete this._activeBuffer.tabs[this._activeBuffer.x]:t===3&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(e){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let t=e.params[0]||1;for(;t--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0}cursorBackwardTab(e){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let t=e.params[0]||1;for(;t--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0}selectProtected(e){let t=e.params[0];return t===1&&(this._curAttrData.bg|=536870912),(t===2||t===0)&&(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine(e,t,i,n=!1,s=!1){let r=this._activeBuffer.lines.get(this._activeBuffer.ybase+e);r.replaceCells(t,i,this._activeBuffer.getNullCell(this._eraseAttrData()),s),n&&(r.isWrapped=!1)}_resetBufferLine(e,t=!1){let i=this._activeBuffer.lines.get(this._activeBuffer.ybase+e);i&&(i.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),t),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+e),i.isWrapped=!1)}eraseInDisplay(e,t=!1){this._restrictCursor(this._bufferService.cols);let i;switch(e.params[0]){case 0:for(i=this._activeBuffer.y,this._dirtyRowTracker.markDirty(i),this._eraseInBufferLine(i++,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,t);i<this._bufferService.rows;i++)this._resetBufferLine(i,t);this._dirtyRowTracker.markDirty(i);break;case 1:for(i=this._activeBuffer.y,this._dirtyRowTracker.markDirty(i),this._eraseInBufferLine(i,0,this._activeBuffer.x+1,!0,t),this._activeBuffer.x+1>=this._bufferService.cols&&(this._activeBuffer.lines.get(i+1).isWrapped=!1);i--;)this._resetBufferLine(i,t);this._dirtyRowTracker.markDirty(0);break;case 2:if(this._optionsService.rawOptions.scrollOnEraseInDisplay){for(i=this._bufferService.rows,this._dirtyRowTracker.markRangeDirty(0,i-1);i--&&!this._activeBuffer.lines.get(this._activeBuffer.ybase+i)?.getTrimmedLength(););for(;i>=0;i--)this._bufferService.scroll(this._eraseAttrData())}else{for(i=this._bufferService.rows,this._dirtyRowTracker.markDirty(i-1);i--;)this._resetBufferLine(i,t);this._dirtyRowTracker.markDirty(0)}break;case 3:let n=this._activeBuffer.lines.length-this._bufferService.rows;n>0&&(this._activeBuffer.lines.trimStart(n),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-n,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-n,0),this._onScroll.fire(0));break}return!0}eraseInLine(e,t=!1){switch(this._restrictCursor(this._bufferService.cols),e.params[0]){case 0:this._eraseInBufferLine(this._activeBuffer.y,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,t);break;case 1:this._eraseInBufferLine(this._activeBuffer.y,0,this._activeBuffer.x+1,!1,t);break;case 2:this._eraseInBufferLine(this._activeBuffer.y,0,this._bufferService.cols,!0,t);break}return this._dirtyRowTracker.markDirty(this._activeBuffer.y),!0}insertLines(e){this._restrictCursor();let t=e.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let i=this._activeBuffer.ybase+this._activeBuffer.y,n=this._bufferService.rows-1-this._activeBuffer.scrollBottom,s=this._bufferService.rows-1+this._activeBuffer.ybase-n+1;for(;t--;)this._activeBuffer.lines.splice(s-1,1),this._activeBuffer.lines.splice(i,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}deleteLines(e){this._restrictCursor();let t=e.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let i=this._activeBuffer.ybase+this._activeBuffer.y,n;for(n=this._bufferService.rows-1-this._activeBuffer.scrollBottom,n=this._bufferService.rows-1+this._activeBuffer.ybase-n;t--;)this._activeBuffer.lines.splice(i,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}insertChars(e){this._restrictCursor();let t=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return t&&(t.insertCells(this._activeBuffer.x,e.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}deleteChars(e){this._restrictCursor();let t=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return t&&(t.deleteCells(this._activeBuffer.x,e.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}scrollUp(e){let t=e.params[0]||1;for(;t--;)this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollTop,1),this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollBottom,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollDown(e){let t=e.params[0]||1;for(;t--;)this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollBottom,1),this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollTop,0,this._activeBuffer.getBlankLine(It));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollLeft(e){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let t=e.params[0]||1;for(let i=this._activeBuffer.scrollTop;i<=this._activeBuffer.scrollBottom;++i){let n=this._activeBuffer.lines.get(this._activeBuffer.ybase+i);n.deleteCells(0,t,this._activeBuffer.getNullCell(this._eraseAttrData())),n.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollRight(e){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let t=e.params[0]||1;for(let i=this._activeBuffer.scrollTop;i<=this._activeBuffer.scrollBottom;++i){let n=this._activeBuffer.lines.get(this._activeBuffer.ybase+i);n.insertCells(0,t,this._activeBuffer.getNullCell(this._eraseAttrData())),n.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}insertColumns(e){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let t=e.params[0]||1;for(let i=this._activeBuffer.scrollTop;i<=this._activeBuffer.scrollBottom;++i){let n=this._activeBuffer.lines.get(this._activeBuffer.ybase+i);n.insertCells(this._activeBuffer.x,t,this._activeBuffer.getNullCell(this._eraseAttrData())),n.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}deleteColumns(e){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let t=e.params[0]||1;for(let i=this._activeBuffer.scrollTop;i<=this._activeBuffer.scrollBottom;++i){let n=this._activeBuffer.lines.get(this._activeBuffer.ybase+i);n.deleteCells(this._activeBuffer.x,t,this._activeBuffer.getNullCell(this._eraseAttrData())),n.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}eraseChars(e){this._restrictCursor();let t=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return t&&(t.replaceCells(this._activeBuffer.x,this._activeBuffer.x+(e.params[0]||1),this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}repeatPrecedingCharacter(e){let t=this._parser.precedingJoinState;if(!t)return!0;let i=e.params[0]||1,n=$a.extractWidth(t),s=this._activeBuffer.x-n,r=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).getString(s),a=new Uint32Array(r.length*i),o=0;for(let c=0;c<r.length;){let u=r.codePointAt(c)||0;a[o++]=u,c+=u>65535?2:1}let l=o;for(let c=1;c<i;++c)a.copyWithin(l,0,o),l+=o;return this.print(a,0,l),!0}sendDeviceAttributesPrimary(e){return e.params[0]>0||(this._is("xterm")||this._is("rxvt-unicode")||this._is("screen")?this._coreService.triggerDataEvent(z.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(z.ESC+"[?6c")),!0}sendDeviceAttributesSecondary(e){return e.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(z.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(z.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(e.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(z.ESC+"[>83;40003;0c")),!0}_is(e){return(this._optionsService.rawOptions.termName+"").indexOf(e)===0}setMode(e){for(let t=0;t<e.length;t++)switch(e.params[t]){case 4:this._coreService.modes.insertMode=!0;break;case 20:this._optionsService.options.convertEol=!0;break}return!0}setModePrivate(e){for(let t=0;t<e.length;t++)switch(e.params[t]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!0;break;case 2:this._charsetService.setgCharset(0,Ga),this._charsetService.setgCharset(1,Ga),this._charsetService.setgCharset(2,Ga),this._charsetService.setgCharset(3,Ga);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(void 0),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!0;break;case 2026:this._coreService.decPrivateModes.synchronizedOutput=!0;break}return!0}resetMode(e){for(let t=0;t<e.length;t++)switch(e.params[t]){case 4:this._coreService.modes.insertMode=!1;break;case 20:this._optionsService.options.convertEol=!1;break}return!0}resetModePrivate(e){for(let t=0;t<e.length;t++)switch(e.params[t]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!1;break;case 3:this._optionsService.rawOptions.windowOptions.setWinLines&&(this._bufferService.resize(80,this._bufferService.rows),this._onRequestReset.fire());break;case 6:this._coreService.decPrivateModes.origin=!1,this._setCursor(0,0);break;case 7:this._coreService.decPrivateModes.wraparound=!1;break;case 12:this._optionsService.options.cursorBlink=!1;break;case 45:this._coreService.decPrivateModes.reverseWraparound=!1;break;case 66:this._logService.debug("Switching back to normal keypad."),this._coreService.decPrivateModes.applicationKeypad=!1,this._onRequestSyncScrollBar.fire();break;case 9:case 1e3:case 1002:case 1003:this._coreMouseService.activeProtocol="NONE";break;case 1004:this._coreService.decPrivateModes.sendFocus=!1;break;case 1005:this._logService.debug("DECRST 1005 not supported (see #2507)");break;case 1006:this._coreMouseService.activeEncoding="DEFAULT";break;case 1015:this._logService.debug("DECRST 1015 not supported (see #2507)");break;case 1016:this._coreMouseService.activeEncoding="DEFAULT";break;case 25:this._coreService.isCursorHidden=!0;break;case 1048:this.restoreCursor();break;case 1049:case 47:case 1047:this._bufferService.buffers.activateNormalBuffer(),e.params[t]===1049&&this.restoreCursor(),this._coreService.isCursorInitialized=!0,this._onRequestRefreshRows.fire(void 0),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!1;break;case 2026:this._coreService.decPrivateModes.synchronizedOutput=!1,this._onRequestRefreshRows.fire(void 0);break}return!0}requestMode(e,t){let i;(_=>(_[_.NOT_RECOGNIZED=0]="NOT_RECOGNIZED",_[_.SET=1]="SET",_[_.RESET=2]="RESET",_[_.PERMANENTLY_SET=3]="PERMANENTLY_SET",_[_.PERMANENTLY_RESET=4]="PERMANENTLY_RESET"))(i||(i={}));let n=this._coreService.decPrivateModes,{activeProtocol:s,activeEncoding:r}=this._coreMouseService,a=this._coreService,{buffers:o,cols:l}=this._bufferService,{active:c,alt:u}=o,h=this._optionsService.rawOptions,d=(_,v)=>(a.triggerDataEvent(`${z.ESC}[${t?"":"?"}${_};${v}$y`),!0),f=_=>_?1:2,p=e.params[0];return t?p===2?d(p,4):p===4?d(p,f(a.modes.insertMode)):p===12?d(p,3):p===20?d(p,f(h.convertEol)):d(p,0):p===1?d(p,f(n.applicationCursorKeys)):p===3?d(p,h.windowOptions.setWinLines?l===80?2:l===132?1:0:0):p===6?d(p,f(n.origin)):p===7?d(p,f(n.wraparound)):p===8?d(p,3):p===9?d(p,f(s==="X10")):p===12?d(p,f(h.cursorBlink)):p===25?d(p,f(!a.isCursorHidden)):p===45?d(p,f(n.reverseWraparound)):p===66?d(p,f(n.applicationKeypad)):p===67?d(p,4):p===1e3?d(p,f(s==="VT200")):p===1002?d(p,f(s==="DRAG")):p===1003?d(p,f(s==="ANY")):p===1004?d(p,f(n.sendFocus)):p===1005?d(p,4):p===1006?d(p,f(r==="SGR")):p===1015?d(p,4):p===1016?d(p,f(r==="SGR_PIXELS")):p===1048?d(p,1):p===47||p===1047||p===1049?d(p,f(c===u)):p===2004?d(p,f(n.bracketedPasteMode)):p===2026?d(p,f(n.synchronizedOutput)):d(p,0)}_updateAttrColor(e,t,i,n,s){return t===2?(e|=50331648,e&=-16777216,e|=xu.fromColorRGB([i,n,s])):t===5&&(e&=-50331904,e|=33554432|i&255),e}_extractColor(e,t,i){let n=[0,0,-1,0,0,0],s=0,r=0;do{if(n[r+s]=e.params[t+r],e.hasSubParams(t+r)){let a=e.getSubParams(t+r),o=0;do n[1]===5&&(s=1),n[r+o+1+s]=a[o];while(++o<a.length&&o+r+1+s<n.length);break}if(n[1]===5&&r+s>=2||n[1]===2&&r+s>=5)break;n[1]&&(s=1)}while(++r+t<e.length&&r+s<n.length);for(let a=2;a<n.length;++a)n[a]===-1&&(n[a]=0);switch(n[0]){case 38:i.fg=this._updateAttrColor(i.fg,n[1],n[3],n[4],n[5]);break;case 48:i.bg=this._updateAttrColor(i.bg,n[1],n[3],n[4],n[5]);break;case 58:i.extended=i.extended.clone(),i.extended.underlineColor=this._updateAttrColor(i.extended.underlineColor,n[1],n[3],n[4],n[5])}return r}_processUnderline(e,t){t.extended=t.extended.clone(),(!~e||e>5)&&(e=1),t.extended.underlineStyle=e,t.fg|=268435456,e===0&&(t.fg&=-268435457),t.updateExtended()}_processSGR0(e){e.fg=It.fg,e.bg=It.bg,e.extended=e.extended.clone(),e.extended.underlineStyle=0,e.extended.underlineColor&=-67108864,e.updateExtended()}charAttributes(e){if(e.length===1&&e.params[0]===0)return this._processSGR0(this._curAttrData),!0;let t=e.length,i,n=this._curAttrData;for(let s=0;s<t;s++)i=e.params[s],i>=30&&i<=37?(n.fg&=-50331904,n.fg|=16777216|i-30):i>=40&&i<=47?(n.bg&=-50331904,n.bg|=16777216|i-40):i>=90&&i<=97?(n.fg&=-50331904,n.fg|=16777216|i-90|8):i>=100&&i<=107?(n.bg&=-50331904,n.bg|=16777216|i-100|8):i===0?this._processSGR0(n):i===1?n.fg|=134217728:i===3?n.bg|=67108864:i===4?(n.fg|=268435456,this._processUnderline(e.hasSubParams(s)?e.getSubParams(s)[0]:1,n)):i===5?n.fg|=536870912:i===7?n.fg|=67108864:i===8?n.fg|=1073741824:i===9?n.fg|=2147483648:i===2?n.bg|=134217728:i===21?this._processUnderline(2,n):i===22?(n.fg&=-134217729,n.bg&=-134217729):i===23?n.bg&=-67108865:i===24?(n.fg&=-268435457,this._processUnderline(0,n)):i===25?n.fg&=-536870913:i===27?n.fg&=-67108865:i===28?n.fg&=-1073741825:i===29?n.fg&=2147483647:i===39?(n.fg&=-67108864,n.fg|=It.fg&16777215):i===49?(n.bg&=-67108864,n.bg|=It.bg&16777215):i===38||i===48||i===58?s+=this._extractColor(e,s,n):i===53?n.bg|=1073741824:i===55?n.bg&=-1073741825:i===59?(n.extended=n.extended.clone(),n.extended.underlineColor=-1,n.updateExtended()):i===100?(n.fg&=-67108864,n.fg|=It.fg&16777215,n.bg&=-67108864,n.bg|=It.bg&16777215):this._logService.debug("Unknown SGR attribute: %d.",i);return!0}deviceStatus(e){switch(e.params[0]){case 5:this._coreService.triggerDataEvent(`${z.ESC}[0n`);break;case 6:let t=this._activeBuffer.y+1,i=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${z.ESC}[${t};${i}R`);break}return!0}deviceStatusPrivate(e){switch(e.params[0]){case 6:let t=this._activeBuffer.y+1,i=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${z.ESC}[?${t};${i}R`);break;case 15:break;case 25:break;case 26:break;case 53:break}return!0}softReset(e){return this._coreService.isCursorHidden=!1,this._onRequestSyncScrollBar.fire(),this._activeBuffer.scrollTop=0,this._activeBuffer.scrollBottom=this._bufferService.rows-1,this._curAttrData=It.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(e){let t=e.length===0?1:e.params[0];if(t===0)this._coreService.decPrivateModes.cursorStyle=void 0,this._coreService.decPrivateModes.cursorBlink=void 0;else{switch(t){case 1:case 2:this._coreService.decPrivateModes.cursorStyle="block";break;case 3:case 4:this._coreService.decPrivateModes.cursorStyle="underline";break;case 5:case 6:this._coreService.decPrivateModes.cursorStyle="bar";break}let i=t%2===1;this._coreService.decPrivateModes.cursorBlink=i}return!0}setScrollRegion(e){let t=e.params[0]||1,i;return(e.length<2||(i=e.params[1])>this._bufferService.rows||i===0)&&(i=this._bufferService.rows),i>t&&(this._activeBuffer.scrollTop=t-1,this._activeBuffer.scrollBottom=i-1,this._setCursor(0,0)),!0}windowOptions(e){if(!ZN(e.params[0],this._optionsService.rawOptions.windowOptions))return!0;let t=e.length>1?e.params[1]:0;switch(e.params[0]){case 14:t!==2&&this._onRequestWindowsOptionsReport.fire(0);break;case 16:this._onRequestWindowsOptionsReport.fire(1);break;case 18:this._bufferService&&this._coreService.triggerDataEvent(`${z.ESC}[8;${this._bufferService.rows};${this._bufferService.cols}t`);break;case 22:(t===0||t===2)&&(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>XN&&this._windowTitleStack.shift()),(t===0||t===1)&&(this._iconNameStack.push(this._iconName),this._iconNameStack.length>XN&&this._iconNameStack.shift());break;case 23:(t===0||t===2)&&this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),(t===0||t===1)&&this._iconNameStack.length&&this.setIconName(this._iconNameStack.pop());break}return!0}saveCursor(e){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(e){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(e){return this._windowTitle=e,this._onTitleChange.fire(e),!0}setIconName(e){return this._iconName=e,!0}setOrReportIndexedColor(e){let t=[],i=e.split(";");for(;i.length>1;){let n=i.shift(),s=i.shift();if(/^\d+$/.exec(n)){let r=parseInt(n);if(eA(r))if(s==="?")t.push({type:0,index:r});else{let a=VN(s);a&&t.push({type:1,index:r,color:a})}}}return t.length&&this._onColor.fire(t),!0}setHyperlink(e){let t=e.indexOf(";");if(t===-1)return!0;let i=e.slice(0,t).trim(),n=e.slice(t+1);return n?this._createHyperlink(i,n):i.trim()?!1:this._finishHyperlink()}_createHyperlink(e,t){this._getCurrentLinkId()&&this._finishHyperlink();let i=e.split(":"),n,s=i.findIndex(r=>r.startsWith("id="));return s!==-1&&(n=i[s].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:n,uri:t}),this._curAttrData.updateExtended(),!0}_finishHyperlink(){return this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=0,this._curAttrData.updateExtended(),!0}_setOrReportSpecialColor(e,t){let i=e.split(";");for(let n=0;n<i.length&&!(t>=this._specialColors.length);++n,++t)if(i[n]==="?")this._onColor.fire([{type:0,index:this._specialColors[t]}]);else{let s=VN(i[n]);s&&this._onColor.fire([{type:1,index:this._specialColors[t],color:s}])}return!0}setOrReportFgColor(e){return this._setOrReportSpecialColor(e,0)}setOrReportBgColor(e){return this._setOrReportSpecialColor(e,1)}setOrReportCursorColor(e){return this._setOrReportSpecialColor(e,2)}restoreIndexedColor(e){if(!e)return this._onColor.fire([{type:2}]),!0;let t=[],i=e.split(";");for(let n=0;n<i.length;++n)if(/^\d+$/.exec(i[n])){let s=parseInt(i[n]);eA(s)&&t.push({type:2,index:s})}return t.length&&this._onColor.fire(t),!0}restoreFgColor(e){return this._onColor.fire([{type:2,index:256}]),!0}restoreBgColor(e){return this._onColor.fire([{type:2,index:257}]),!0}restoreCursorColor(e){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,Ga),!0}selectCharset(e){return e.length!==2?(this.selectDefaultCharset(),!0):(e[0]==="/"||this._charsetService.setgCharset(c4[e[0]],Gt[e[1]]||Ga),!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){let e=this._activeBuffer.scrollBottom-this._activeBuffer.scrollTop;this._activeBuffer.lines.shiftElements(this._activeBuffer.ybase+this._activeBuffer.y,e,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=It.clone(),this._eraseAttrDataInternal=It.clone()}_eraseAttrData(){return this._eraseAttrDataInternal.bg&=-67108864,this._eraseAttrDataInternal.bg|=this._curAttrData.bg&67108863,this._eraseAttrDataInternal}setgLevel(e){return this._charsetService.setgLevel(e),!0}screenAlignmentPattern(){let e=new Ln;e.content=1<<22|69,e.fg=this._curAttrData.fg,e.bg=this._curAttrData.bg,this._setCursor(0,0);for(let t=0;t<this._bufferService.rows;++t){let i=this._activeBuffer.ybase+this._activeBuffer.y+t,n=this._activeBuffer.lines.get(i);n&&(n.fill(e),n.isWrapped=!1)}return this._dirtyRowTracker.markAllDirty(),this._setCursor(0,0),!0}requestStatusString(e,t){let i=a=>(this._coreService.triggerDataEvent(`${z.ESC}${a}${z.ESC}\\`),!0),n=this._bufferService.buffer,s=this._optionsService.rawOptions;return i(e==='"q'?`P1$r${this._curAttrData.isProtected()?1:0}"q`:e==='"p'?'P1$r61;1"p':e==="r"?`P1$r${n.scrollTop+1};${n.scrollBottom+1}r`:e==="m"?"P1$r0m":e===" q"?`P1$r${{block:2,underline:4,bar:6}[s.cursorStyle]-(s.cursorBlink?1:0)} q`:"P0$r")}markRangeDirty(e,t){this._dirtyRowTracker.markRangeDirty(e,t)}},lb=class{constructor(e){this._bufferService=e,this.clearRange()}clearRange(){this.start=this._bufferService.buffer.y,this.end=this._bufferService.buffer.y}markDirty(e){e<this.start?this.start=e:e>this.end&&(this.end=e)}markRangeDirty(e,t){e>t&&(JN=e,e=t,t=JN),e<this.start&&(this.start=e),t>this.end&&(this.end=t)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};lb=xt([ne(0,Di)],lb);h4=5e7,tA=12,d4=50,f4=class extends xe{constructor(e){super(),this._action=e,this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=0,this._isSyncWriting=!1,this._syncCalls=0,this._didUserInput=!1,this._onWriteParsed=this._register(new X),this.onWriteParsed=this._onWriteParsed.event}handleUserInput(){this._didUserInput=!0}writeSync(e,t){if(t!==void 0&&this._syncCalls>t){this._syncCalls=0;return}if(this._pendingData+=e.length,this._writeBuffer.push(e),this._callbacks.push(void 0),this._syncCalls++,this._isSyncWriting)return;this._isSyncWriting=!0;let i;for(;i=this._writeBuffer.shift();){this._action(i);let n=this._callbacks.shift();n&&n()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(e,t){if(this._pendingData>h4)throw new Error("write data discarded, use flow control to avoid losing data");if(!this._writeBuffer.length){if(this._bufferOffset=0,this._didUserInput){this._didUserInput=!1,this._pendingData+=e.length,this._writeBuffer.push(e),this._callbacks.push(t),this._innerWrite();return}setTimeout(()=>this._innerWrite())}this._pendingData+=e.length,this._writeBuffer.push(e),this._callbacks.push(t)}_innerWrite(e=0,t=!0){let i=e||performance.now();for(;this._writeBuffer.length>this._bufferOffset;){let n=this._writeBuffer[this._bufferOffset],s=this._action(n,t);if(s){let a=o=>performance.now()-i>=tA?setTimeout(()=>this._innerWrite(0,o)):this._innerWrite(i,o);s.catch(o=>(queueMicrotask(()=>{throw o}),Promise.resolve(!1))).then(a);return}let r=this._callbacks[this._bufferOffset];if(r&&r(),this._bufferOffset++,this._pendingData-=n.length,performance.now()-i>=tA)break}this._writeBuffer.length>this._bufferOffset?(this._bufferOffset>d4&&(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()}},cb=class{constructor(e){this._bufferService=e,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(e){let t=this._bufferService.buffer;if(e.id===void 0){let o=t.addMarker(t.ybase+t.y),l={data:e,id:this._nextId++,lines:[o]};return o.onDispose(()=>this._removeMarkerFromLink(l,o)),this._dataByLinkId.set(l.id,l),l.id}let i=e,n=this._getEntryIdKey(i),s=this._entriesWithId.get(n);if(s)return this.addLineToLink(s.id,t.ybase+t.y),s.id;let r=t.addMarker(t.ybase+t.y),a={id:this._nextId++,key:this._getEntryIdKey(i),data:i,lines:[r]};return r.onDispose(()=>this._removeMarkerFromLink(a,r)),this._entriesWithId.set(a.key,a),this._dataByLinkId.set(a.id,a),a.id}addLineToLink(e,t){let i=this._dataByLinkId.get(e);if(i&&i.lines.every(n=>n.line!==t)){let n=this._bufferService.buffer.addMarker(t);i.lines.push(n),n.onDispose(()=>this._removeMarkerFromLink(i,n))}}getLinkData(e){return this._dataByLinkId.get(e)?.data}_getEntryIdKey(e){return`${e.id};;${e.uri}`}_removeMarkerFromLink(e,t){let i=e.lines.indexOf(t);i!==-1&&(e.lines.splice(i,1),e.lines.length===0&&(e.data.id!==void 0&&this._entriesWithId.delete(e.key),this._dataByLinkId.delete(e.id)))}};cb=xt([ne(0,Di)],cb);iA=!1,p4=class extends xe{constructor(e){super(),this._windowsWrappingHeuristics=this._register(new Ml),this._onBinary=this._register(new X),this.onBinary=this._onBinary.event,this._onData=this._register(new X),this.onData=this._onData.event,this._onLineFeed=this._register(new X),this.onLineFeed=this._onLineFeed.event,this._onResize=this._register(new X),this.onResize=this._onResize.event,this._onWriteParsed=this._register(new X),this.onWriteParsed=this._onWriteParsed.event,this._onScroll=this._register(new X),this._instantiationService=new z6,this.optionsService=this._register(new j6(e)),this._instantiationService.setService(Li,this.optionsService),this._bufferService=this._register(this._instantiationService.createInstance(sb)),this._instantiationService.setService(Di,this._bufferService),this._logService=this._register(this._instantiationService.createInstance(nb)),this._instantiationService.setService(mA,this._logService),this.coreService=this._register(this._instantiationService.createInstance(rb)),this._instantiationService.setService(Xa,this.coreService),this.coreMouseService=this._register(this._instantiationService.createInstance(ab)),this._instantiationService.setService(pA,this.coreMouseService),this.unicodeService=this._register(this._instantiationService.createInstance($a)),this._instantiationService.setService(cz,this.unicodeService),this._charsetService=this._instantiationService.createInstance(J6),this._instantiationService.setService(lz,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(cb),this._instantiationService.setService(gA,this._oscLinkService),this._inputHandler=this._register(new u4(this._bufferService,this._charsetService,this.coreService,this._logService,this.optionsService,this._oscLinkService,this.coreMouseService,this.unicodeService)),this._register(ni.forward(this._inputHandler.onLineFeed,this._onLineFeed)),this._register(this._inputHandler),this._register(ni.forward(this._bufferService.onResize,this._onResize)),this._register(ni.forward(this.coreService.onData,this._onData)),this._register(ni.forward(this.coreService.onBinary,this._onBinary)),this._register(this.coreService.onRequestScrollToBottom(()=>this.scrollToBottom(!0))),this._register(this.coreService.onUserInput(()=>this._writeBuffer.handleUserInput())),this._register(this.optionsService.onMultipleOptionChange(["windowsMode","windowsPty"],()=>this._handleWindowsPtyOptionChange())),this._register(this._bufferService.onScroll(()=>{this._onScroll.fire({position:this._bufferService.buffer.ydisp}),this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)})),this._writeBuffer=this._register(new f4((t,i)=>this._inputHandler.parse(t,i))),this._register(ni.forward(this._writeBuffer.onWriteParsed,this._onWriteParsed))}get onScroll(){return this._onScrollApi||(this._onScrollApi=this._register(new X),this._onScroll.event(e=>{this._onScrollApi?.fire(e.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(e){for(let t in e)this.optionsService.options[t]=e[t]}write(e,t){this._writeBuffer.write(e,t)}writeSync(e,t){this._logService.logLevel<=3&&!iA&&(this._logService.warn("writeSync is unreliable and will be removed soon."),iA=!0),this._writeBuffer.writeSync(e,t)}input(e,t=!0){this.coreService.triggerDataEvent(e,t)}resize(e,t){isNaN(e)||isNaN(t)||(e=Math.max(e,JA),t=Math.max(t,eM),this._bufferService.resize(e,t))}scroll(e,t=!1){this._bufferService.scroll(e,t)}scrollLines(e,t){this._bufferService.scrollLines(e,t)}scrollPages(e){this.scrollLines(e*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(e){this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(e){let t=e-this._bufferService.buffer.ydisp;t!==0&&this.scrollLines(t)}registerEscHandler(e,t){return this._inputHandler.registerEscHandler(e,t)}registerDcsHandler(e,t){return this._inputHandler.registerDcsHandler(e,t)}registerCsiHandler(e,t){return this._inputHandler.registerCsiHandler(e,t)}registerOscHandler(e,t){return this._inputHandler.registerOscHandler(e,t)}_setup(){this._handleWindowsPtyOptionChange()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_handleWindowsPtyOptionChange(){let e=!1,t=this.optionsService.rawOptions.windowsPty;t&&t.buildNumber!==void 0&&t.buildNumber!==void 0?e=t.backend==="conpty"&&t.buildNumber<21376:this.optionsService.rawOptions.windowsMode&&(e=!0),e?this._enableWindowsWrappingHeuristics():this._windowsWrappingHeuristics.clear()}_enableWindowsWrappingHeuristics(){if(!this._windowsWrappingHeuristics.value){let e=[];e.push(this.onLineFeed(YN.bind(null,this._bufferService))),e.push(this.registerCsiHandler({final:"H"},()=>(YN(this._bufferService),!1))),this._windowsWrappingHeuristics.value=dt(()=>{for(let t of e)t.dispose()})}}},m4={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:["'",'"']};Nt=0,_4=class{constructor(e){this._getKey=e,this._array=[],this._insertedValues=[],this._flushInsertedTask=new Af,this._isFlushingInserted=!1,this._deletedIndices=[],this._flushDeletedTask=new Af,this._isFlushingDeleted=!1}clear(){this._array.length=0,this._insertedValues.length=0,this._flushInsertedTask.clear(),this._isFlushingInserted=!1,this._deletedIndices.length=0,this._flushDeletedTask.clear(),this._isFlushingDeleted=!1}insert(e){this._flushCleanupDeleted(),this._insertedValues.length===0&&this._flushInsertedTask.enqueue(()=>this._flushInserted()),this._insertedValues.push(e)}_flushInserted(){let e=this._insertedValues.sort((s,r)=>this._getKey(s)-this._getKey(r)),t=0,i=0,n=new Array(this._array.length+this._insertedValues.length);for(let s=0;s<n.length;s++)i>=this._array.length||this._getKey(e[t])<=this._getKey(this._array[i])?(n[s]=e[t],t++):n[s]=this._array[i++];this._array=n,this._insertedValues.length=0}_flushCleanupInserted(){!this._isFlushingInserted&&this._insertedValues.length>0&&this._flushInsertedTask.flush()}delete(e){if(this._flushCleanupInserted(),this._array.length===0)return!1;let t=this._getKey(e);if(t===void 0||(Nt=this._search(t),Nt===-1)||this._getKey(this._array[Nt])!==t)return!1;do if(this._array[Nt]===e)return this._deletedIndices.length===0&&this._flushDeletedTask.enqueue(()=>this._flushDeleted()),this._deletedIndices.push(Nt),!0;while(++Nt<this._array.length&&this._getKey(this._array[Nt])===t);return!1}_flushDeleted(){this._isFlushingDeleted=!0;let e=this._deletedIndices.sort((s,r)=>s-r),t=0,i=new Array(this._array.length-e.length),n=0;for(let s=0;s<this._array.length;s++)e[t]===s?t++:i[n++]=this._array[s];this._array=i,this._deletedIndices.length=0,this._isFlushingDeleted=!1}_flushCleanupDeleted(){!this._isFlushingDeleted&&this._deletedIndices.length>0&&this._flushDeletedTask.flush()}*getKeyIterator(e){if(this._flushCleanupInserted(),this._flushCleanupDeleted(),this._array.length!==0&&(Nt=this._search(e),!(Nt<0||Nt>=this._array.length)&&this._getKey(this._array[Nt])===e))do yield this._array[Nt];while(++Nt<this._array.length&&this._getKey(this._array[Nt])===e)}forEachByKey(e,t){if(this._flushCleanupInserted(),this._flushCleanupDeleted(),this._array.length!==0&&(Nt=this._search(e),!(Nt<0||Nt>=this._array.length)&&this._getKey(this._array[Nt])===e))do t(this._array[Nt]);while(++Nt<this._array.length&&this._getKey(this._array[Nt])===e)}values(){return this._flushCleanupInserted(),this._flushCleanupDeleted(),[...this._array].values()}_search(e){let t=0,i=this._array.length-1;for(;i>=t;){let n=t+i>>1,s=this._getKey(this._array[n]);if(s>e)i=n-1;else if(s<e)t=n+1;else{for(;n>0&&this._getKey(this._array[n-1])===e;)n--;return n}}return t}},wv=0,nA=0,v4=class extends xe{constructor(){super(),this._decorations=new _4(e=>e?.marker.line),this._onDecorationRegistered=this._register(new X),this.onDecorationRegistered=this._onDecorationRegistered.event,this._onDecorationRemoved=this._register(new X),this.onDecorationRemoved=this._onDecorationRemoved.event,this._register(dt(()=>this.reset()))}get decorations(){return this._decorations.values()}registerDecoration(e){if(e.marker.isDisposed)return;let t=new b4(e);if(t){let i=t.marker.onDispose(()=>t.dispose()),n=t.onDispose(()=>{n.dispose(),t&&(this._decorations.delete(t)&&this._onDecorationRemoved.fire(t),i.dispose())});this._decorations.insert(t),this._onDecorationRegistered.fire(t)}return t}reset(){for(let e of this._decorations.values())e.dispose();this._decorations.clear()}*getDecorationsAtCell(e,t,i){let n=0,s=0;for(let r of this._decorations.getKeyIterator(t))n=r.options.x??0,s=n+(r.options.width??1),e>=n&&e<s&&(!i||(r.options.layer??"bottom")===i)&&(yield r)}forEachDecorationAtCell(e,t,i,n){this._decorations.forEachByKey(t,s=>{wv=s.options.x??0,nA=wv+(s.options.width??1),e>=wv&&e<nA&&(!i||(s.options.layer??"bottom")===i)&&n(s)})}},b4=class extends Xr{constructor(e){super(),this.options=e,this.onRenderEmitter=this.add(new X),this.onRender=this.onRenderEmitter.event,this._onDispose=this.add(new X),this.onDispose=this._onDispose.event,this._cachedBg=null,this._cachedFg=null,this.marker=e.marker,this.options.overviewRulerOptions&&!this.options.overviewRulerOptions.position&&(this.options.overviewRulerOptions.position="full")}get backgroundColorRGB(){return this._cachedBg===null&&(this.options.backgroundColor?this._cachedBg=gt.toColor(this.options.backgroundColor):this._cachedBg=void 0),this._cachedBg}get foregroundColorRGB(){return this._cachedFg===null&&(this.options.foregroundColor?this._cachedFg=gt.toColor(this.options.foregroundColor):this._cachedFg=void 0),this._cachedFg}dispose(){this._onDispose.fire(),super.dispose()}},y4=1e3,S4=class{constructor(e,t=y4){this._renderCallback=e,this._debounceThresholdMS=t,this._lastRefreshMs=0,this._additionalRefreshRequested=!1}dispose(){this._refreshTimeoutID&&clearTimeout(this._refreshTimeoutID)}refresh(e,t,i){this._rowCount=i,e=e!==void 0?e:0,t=t!==void 0?t:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,e):e,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,t):t;let n=performance.now();if(n-this._lastRefreshMs>=this._debounceThresholdMS)this._lastRefreshMs=n,this._innerRefresh();else if(!this._additionalRefreshRequested){let s=n-this._lastRefreshMs,r=this._debounceThresholdMS-s;this._additionalRefreshRequested=!0,this._refreshTimeoutID=window.setTimeout(()=>{this._lastRefreshMs=performance.now(),this._innerRefresh(),this._additionalRefreshRequested=!1,this._refreshTimeoutID=void 0},r)}}_innerRefresh(){if(this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return;let e=Math.max(this._rowStart,0),t=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(e,t)}},sA=20,rA=!1,Mf=class extends xe{constructor(e,t,i,n){super(),this._terminal=e,this._coreBrowserService=i,this._renderService=n,this._rowColumns=new WeakMap,this._liveRegionLineCount=0,this._charsToConsume=[],this._charsToAnnounce="";let s=this._coreBrowserService.mainDocument;this._accessibilityContainer=s.createElement("div"),this._accessibilityContainer.classList.add("xterm-accessibility"),this._rowContainer=s.createElement("div"),this._rowContainer.setAttribute("role","list"),this._rowContainer.classList.add("xterm-accessibility-tree"),this._rowElements=[];for(let r=0;r<this._terminal.rows;r++)this._rowElements[r]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[r]);if(this._topBoundaryFocusListener=r=>this._handleBoundaryFocus(r,0),this._bottomBoundaryFocusListener=r=>this._handleBoundaryFocus(r,1),this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._accessibilityContainer.appendChild(this._rowContainer),this._liveRegion=s.createElement("div"),this._liveRegion.classList.add("live-region"),this._liveRegion.setAttribute("aria-live","assertive"),this._accessibilityContainer.appendChild(this._liveRegion),this._liveRegionDebouncer=this._register(new S4(this._renderRows.bind(this))),!this._terminal.element)throw new Error("Cannot enable accessibility before Terminal.open");rA?(this._accessibilityContainer.classList.add("debug"),this._rowContainer.classList.add("debug"),this._debugRootContainer=s.createElement("div"),this._debugRootContainer.classList.add("xterm"),this._debugRootContainer.appendChild(s.createTextNode("------start a11y------")),this._debugRootContainer.appendChild(this._accessibilityContainer),this._debugRootContainer.appendChild(s.createTextNode("------end a11y------")),this._terminal.element.insertAdjacentElement("afterend",this._debugRootContainer)):this._terminal.element.insertAdjacentElement("afterbegin",this._accessibilityContainer),this._register(this._terminal.onResize(r=>this._handleResize(r.rows))),this._register(this._terminal.onRender(r=>this._refreshRows(r.start,r.end))),this._register(this._terminal.onScroll(()=>this._refreshRows())),this._register(this._terminal.onA11yChar(r=>this._handleChar(r))),this._register(this._terminal.onLineFeed(()=>this._handleChar(`
122
+ `))),this._register(this._terminal.onA11yTab(r=>this._handleTab(r))),this._register(this._terminal.onKey(r=>this._handleKey(r.key))),this._register(this._terminal.onBlur(()=>this._clearLiveRegion())),this._register(this._renderService.onDimensionsChange(()=>this._refreshRowsDimensions())),this._register(_e(s,"selectionchange",()=>this._handleSelectionChange())),this._register(this._coreBrowserService.onDprChange(()=>this._refreshRowsDimensions())),this._refreshRowsDimensions(),this._refreshRows(),this._register(dt(()=>{rA?this._debugRootContainer.remove():this._accessibilityContainer.remove(),this._rowElements.length=0}))}_handleTab(e){for(let t=0;t<e;t++)this._handleChar(" ")}_handleChar(e){this._liveRegionLineCount<sA+1&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==e&&(this._charsToAnnounce+=e):this._charsToAnnounce+=e,e===`
123
+ `&&(this._liveRegionLineCount++,this._liveRegionLineCount===sA+1&&(this._liveRegion.textContent+=xv.get())))}_clearLiveRegion(){this._liveRegion.textContent="",this._liveRegionLineCount=0}_handleKey(e){this._clearLiveRegion(),/\p{Control}/u.test(e)||this._charsToConsume.push(e)}_refreshRows(e,t){this._liveRegionDebouncer.refresh(e,t,this._terminal.rows)}_renderRows(e,t){let i=this._terminal.buffer,n=i.lines.length.toString();for(let s=e;s<=t;s++){let r=i.lines.get(i.ydisp+s),a=[],o=r?.translateToString(!0,void 0,void 0,a)||"",l=(i.ydisp+s+1).toString(),c=this._rowElements[s];c&&(o.length===0?(c.textContent="\xA0",this._rowColumns.set(c,[0,1])):(c.textContent=o,this._rowColumns.set(c,a)),c.setAttribute("aria-posinset",l),c.setAttribute("aria-setsize",n),this._alignRowWidth(c))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(e,t){let i=e.target,n=this._rowElements[t===0?1:this._rowElements.length-2],s=i.getAttribute("aria-posinset"),r=t===0?"1":`${this._terminal.buffer.lines.length}`;if(s===r||e.relatedTarget!==n)return;let a,o;if(t===0?(a=i,o=this._rowElements.pop(),this._rowContainer.removeChild(o)):(a=this._rowElements.shift(),o=i,this._rowContainer.removeChild(a)),a.removeEventListener("focus",this._topBoundaryFocusListener),o.removeEventListener("focus",this._bottomBoundaryFocusListener),t===0){let l=this._createAccessibilityTreeNode();this._rowElements.unshift(l),this._rowContainer.insertAdjacentElement("afterbegin",l)}else{let l=this._createAccessibilityTreeNode();this._rowElements.push(l),this._rowContainer.appendChild(l)}this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._terminal.scrollLines(t===0?-1:1),this._rowElements[t===0?1:this._rowElements.length-2].focus(),e.preventDefault(),e.stopImmediatePropagation()}_handleSelectionChange(){if(this._rowElements.length===0)return;let e=this._coreBrowserService.mainDocument.getSelection();if(!e)return;if(e.isCollapsed){this._rowContainer.contains(e.anchorNode)&&this._terminal.clearSelection();return}if(!e.anchorNode||!e.focusNode){console.error("anchorNode and/or focusNode are null");return}let t={node:e.anchorNode,offset:e.anchorOffset},i={node:e.focusNode,offset:e.focusOffset};if((t.node.compareDocumentPosition(i.node)&Node.DOCUMENT_POSITION_PRECEDING||t.node===i.node&&t.offset>i.offset)&&([t,i]=[i,t]),t.node.compareDocumentPosition(this._rowElements[0])&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_FOLLOWING)&&(t={node:this._rowElements[0].childNodes[0],offset:0}),!this._rowContainer.contains(t.node))return;let n=this._rowElements.slice(-1)[0];if(i.node.compareDocumentPosition(n)&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_PRECEDING)&&(i={node:n,offset:n.textContent?.length??0}),!this._rowContainer.contains(i.node))return;let s=({node:o,offset:l})=>{let c=o instanceof Text?o.parentNode:o,u=parseInt(c?.getAttribute("aria-posinset"),10)-1;if(isNaN(u))return console.warn("row is invalid. Race condition?"),null;let h=this._rowColumns.get(c);if(!h)return console.warn("columns is null. Race condition?"),null;let d=l<h.length?h[l]:h.slice(-1)[0]+1;return d>=this._terminal.cols&&(++u,d=0),{row:u,column:d}},r=s(t),a=s(i);if(!(!r||!a)){if(r.row>a.row||r.row===a.row&&r.column>=a.column)throw new Error("invalid range");this._terminal.select(r.column,r.row,(a.row-r.row)*this._terminal.cols-r.column+a.column)}}_handleResize(e){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(let t=this._rowContainer.children.length;t<this._terminal.rows;t++)this._rowElements[t]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[t]);for(;this._rowElements.length>e;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){let e=this._coreBrowserService.mainDocument.createElement("div");return e.setAttribute("role","listitem"),e.tabIndex=-1,this._refreshRowDimensions(e),e}_refreshRowsDimensions(){if(this._renderService.dimensions.css.cell.height){Object.assign(this._accessibilityContainer.style,{width:`${this._renderService.dimensions.css.canvas.width}px`,fontSize:`${this._terminal.options.fontSize}px`}),this._rowElements.length!==this._terminal.rows&&this._handleResize(this._terminal.rows);for(let e=0;e<this._terminal.rows;e++)this._refreshRowDimensions(this._rowElements[e]),this._alignRowWidth(this._rowElements[e])}}_refreshRowDimensions(e){e.style.height=`${this._renderService.dimensions.css.cell.height}px`}_alignRowWidth(e){e.style.transform="";let t=e.getBoundingClientRect().width,i=this._rowColumns.get(e)?.slice(-1)?.[0];if(!i)return;let n=i*this._renderService.dimensions.css.cell.width;e.style.transform=`scaleX(${n/t})`}};Mf=xt([ne(1,hb),ne(2,er),ne(3,tr)],Mf);ub=class extends xe{constructor(e,t,i,n,s){super(),this._element=e,this._mouseService=t,this._renderService=i,this._bufferService=n,this._linkProviderService=s,this._linkCacheDisposables=[],this._isMouseOut=!0,this._wasResized=!1,this._activeLine=-1,this._onShowLinkUnderline=this._register(new X),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this._register(new X),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this._register(dt(()=>{ja(this._linkCacheDisposables),this._linkCacheDisposables.length=0,this._lastMouseEvent=void 0,this._activeProviderReplies?.clear()})),this._register(this._bufferService.onResize(()=>{this._clearCurrentLink(),this._wasResized=!0})),this._register(_e(this._element,"mouseleave",()=>{this._isMouseOut=!0,this._clearCurrentLink()})),this._register(_e(this._element,"mousemove",this._handleMouseMove.bind(this))),this._register(_e(this._element,"mousedown",this._handleMouseDown.bind(this))),this._register(_e(this._element,"mouseup",this._handleMouseUp.bind(this)))}get currentLink(){return this._currentLink}_handleMouseMove(e){this._lastMouseEvent=e;let t=this._positionFromMouseEvent(e,this._element,this._mouseService);if(!t)return;this._isMouseOut=!1;let i=e.composedPath();for(let n=0;n<i.length;n++){let s=i[n];if(s.classList.contains("xterm"))break;if(s.classList.contains("xterm-hover"))return}(!this._lastBufferCell||t.x!==this._lastBufferCell.x||t.y!==this._lastBufferCell.y)&&(this._handleHover(t),this._lastBufferCell=t)}_handleHover(e){if(this._activeLine!==e.y||this._wasResized){this._clearCurrentLink(),this._askForLink(e,!1),this._wasResized=!1;return}this._currentLink&&this._linkAtPosition(this._currentLink.link,e)||(this._clearCurrentLink(),this._askForLink(e,!0))}_askForLink(e,t){(!this._activeProviderReplies||!t)&&(this._activeProviderReplies?.forEach(n=>{n?.forEach(s=>{s.link.dispose&&s.link.dispose()})}),this._activeProviderReplies=new Map,this._activeLine=e.y);let i=!1;for(let[n,s]of this._linkProviderService.linkProviders.entries())t?this._activeProviderReplies?.get(n)&&(i=this._checkLinkProviderResult(n,e,i)):s.provideLinks(e.y,r=>{if(this._isMouseOut)return;let a=r?.map(o=>({link:o}));this._activeProviderReplies?.set(n,a),i=this._checkLinkProviderResult(n,e,i),this._activeProviderReplies?.size===this._linkProviderService.linkProviders.length&&this._removeIntersectingLinks(e.y,this._activeProviderReplies)})}_removeIntersectingLinks(e,t){let i=new Set;for(let n=0;n<t.size;n++){let s=t.get(n);if(s)for(let r=0;r<s.length;r++){let a=s[r],o=a.link.range.start.y<e?0:a.link.range.start.x,l=a.link.range.end.y>e?this._bufferService.cols:a.link.range.end.x;for(let c=o;c<=l;c++){if(i.has(c)){s.splice(r--,1);break}i.add(c)}}}}_checkLinkProviderResult(e,t,i){if(!this._activeProviderReplies)return i;let n=this._activeProviderReplies.get(e),s=!1;for(let r=0;r<e;r++)(!this._activeProviderReplies.has(r)||this._activeProviderReplies.get(r))&&(s=!0);if(!s&&n){let r=n.find(a=>this._linkAtPosition(a.link,t));r&&(i=!0,this._handleNewLink(r))}if(this._activeProviderReplies.size===this._linkProviderService.linkProviders.length&&!i)for(let r=0;r<this._activeProviderReplies.size;r++){let a=this._activeProviderReplies.get(r)?.find(o=>this._linkAtPosition(o.link,t));if(a){i=!0,this._handleNewLink(a);break}}return i}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(e){if(!this._currentLink)return;let t=this._positionFromMouseEvent(e,this._element,this._mouseService);t&&this._mouseDownLink&&w4(this._mouseDownLink.link,this._currentLink.link)&&this._linkAtPosition(this._currentLink.link,t)&&this._currentLink.link.activate(e,this._currentLink.link.text)}_clearCurrentLink(e,t){!this._currentLink||!this._lastMouseEvent||(!e||!t||this._currentLink.link.range.start.y>=e&&this._currentLink.link.range.end.y<=t)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,ja(this._linkCacheDisposables),this._linkCacheDisposables.length=0)}_handleNewLink(e){if(!this._lastMouseEvent)return;let t=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);t&&this._linkAtPosition(e.link,t)&&(this._currentLink=e,this._currentLink.state={decorations:{underline:e.link.decorations===void 0?!0:e.link.decorations.underline,pointerCursor:e.link.decorations===void 0?!0:e.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,e.link,this._lastMouseEvent),e.link.decorations={},Object.defineProperties(e.link.decorations,{pointerCursor:{get:()=>this._currentLink?.state?.decorations.pointerCursor,set:i=>{this._currentLink?.state&&this._currentLink.state.decorations.pointerCursor!==i&&(this._currentLink.state.decorations.pointerCursor=i,this._currentLink.state.isHovered&&this._element.classList.toggle("xterm-cursor-pointer",i))}},underline:{get:()=>this._currentLink?.state?.decorations.underline,set:i=>{this._currentLink?.state&&this._currentLink?.state?.decorations.underline!==i&&(this._currentLink.state.decorations.underline=i,this._currentLink.state.isHovered&&this._fireUnderlineEvent(e.link,i))}}}),this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange(i=>{if(!this._currentLink)return;let n=i.start===0?0:i.start+1+this._bufferService.buffer.ydisp,s=this._bufferService.buffer.ydisp+1+i.end;if(this._currentLink.link.range.start.y>=n&&this._currentLink.link.range.end.y<=s&&(this._clearCurrentLink(n,s),this._lastMouseEvent)){let r=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);r&&this._askForLink(r,!1)}})))}_linkHover(e,t,i){this._currentLink?.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(t,!0),this._currentLink.state.decorations.pointerCursor&&e.classList.add("xterm-cursor-pointer")),t.hover&&t.hover(i,t.text)}_fireUnderlineEvent(e,t){let i=e.range,n=this._bufferService.buffer.ydisp,s=this._createLinkUnderlineEvent(i.start.x-1,i.start.y-n-1,i.end.x,i.end.y-n-1,void 0);(t?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(s)}_linkLeave(e,t,i){this._currentLink?.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(t,!1),this._currentLink.state.decorations.pointerCursor&&e.classList.remove("xterm-cursor-pointer")),t.leave&&t.leave(i,t.text)}_linkAtPosition(e,t){let i=e.range.start.y*this._bufferService.cols+e.range.start.x,n=e.range.end.y*this._bufferService.cols+e.range.end.x,s=t.y*this._bufferService.cols+t.x;return i<=s&&s<=n}_positionFromMouseEvent(e,t,i){let n=i.getCoords(e,t,this._bufferService.cols,this._bufferService.rows);if(n)return{x:n[0],y:n[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(e,t,i,n,s){return{x1:e,y1:t,x2:i,y2:n,cols:this._bufferService.cols,fg:s}}};ub=xt([ne(1,db),ne(2,tr),ne(3,Di),ne(4,vA)],ub);E4=class extends p4{constructor(e={}){super(e),this._linkifier=this._register(new Ml),this.browser=qA,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this._register(new Ml),this._onCursorMove=this._register(new X),this.onCursorMove=this._onCursorMove.event,this._onKey=this._register(new X),this.onKey=this._onKey.event,this._onRender=this._register(new X),this.onRender=this._onRender.event,this._onSelectionChange=this._register(new X),this.onSelectionChange=this._onSelectionChange.event,this._onTitleChange=this._register(new X),this.onTitleChange=this._onTitleChange.event,this._onBell=this._register(new X),this.onBell=this._onBell.event,this._onFocus=this._register(new X),this._onBlur=this._register(new X),this._onA11yCharEmitter=this._register(new X),this._onA11yTabEmitter=this._register(new X),this._onWillOpen=this._register(new X),this._setup(),this._decorationService=this._instantiationService.createInstance(v4),this._instantiationService.setService(Cu,this._decorationService),this._linkProviderService=this._instantiationService.createInstance(h6),this._instantiationService.setService(vA,this._linkProviderService),this._linkProviderService.registerLinkProvider(this._instantiationService.createInstance(kv)),this._register(this._inputHandler.onRequestBell(()=>this._onBell.fire())),this._register(this._inputHandler.onRequestRefreshRows(t=>this.refresh(t?.start??0,t?.end??this.rows-1))),this._register(this._inputHandler.onRequestSendFocus(()=>this._reportFocus())),this._register(this._inputHandler.onRequestReset(()=>this.reset())),this._register(this._inputHandler.onRequestWindowsOptionsReport(t=>this._reportWindowsOptions(t))),this._register(this._inputHandler.onColor(t=>this._handleColorEvent(t))),this._register(ni.forward(this._inputHandler.onCursorMove,this._onCursorMove)),this._register(ni.forward(this._inputHandler.onTitleChange,this._onTitleChange)),this._register(ni.forward(this._inputHandler.onA11yChar,this._onA11yCharEmitter)),this._register(ni.forward(this._inputHandler.onA11yTab,this._onA11yTabEmitter)),this._register(this._bufferService.onResize(t=>this._afterResize(t.cols,t.rows))),this._register(dt(()=>{this._customKeyEventHandler=void 0,this.element?.parentNode?.removeChild(this.element)}))}get linkifier(){return this._linkifier.value}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}_handleColorEvent(e){if(this._themeService)for(let t of e){let i,n="";switch(t.index){case 256:i="foreground",n="10";break;case 257:i="background",n="11";break;case 258:i="cursor",n="12";break;default:i="ansi",n="4;"+t.index}switch(t.type){case 0:let s=ut.toColorRGB(i==="ansi"?this._themeService.colors.ansi[t.index]:this._themeService.colors[i]);this.coreService.triggerDataEvent(`${z.ESC}]${n};${l4(s)}${jv.ST}`);break;case 1:if(i==="ansi")this._themeService.modifyColors(r=>r.ansi[t.index]=At.toColor(...t.color));else{let r=i;this._themeService.modifyColors(a=>a[r]=At.toColor(...t.color))}break;case 2:this._themeService.restoreColor(t.index);break}}}_setup(){super._setup(),this._customKeyEventHandler=void 0}get buffer(){return this.buffers.active}focus(){this.textarea&&this.textarea.focus({preventScroll:!0})}_handleScreenReaderModeOptionChange(e){e?!this._accessibilityManager.value&&this._renderService&&(this._accessibilityManager.value=this._instantiationService.createInstance(Mf,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(e){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(z.ESC+"[I"),this.element.classList.add("focus"),this._showCursor(),this._onFocus.fire()}blur(){return this.textarea?.blur()}_handleTextAreaBlur(){this.textarea.value="",this.refresh(this.buffer.y,this.buffer.y),this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(z.ESC+"[O"),this.element.classList.remove("focus"),this._onBlur.fire()}_syncTextArea(){if(!this.textarea||!this.buffer.isCursorInViewport||this._compositionHelper.isComposing||!this._renderService)return;let e=this.buffer.ybase+this.buffer.y,t=this.buffer.lines.get(e);if(!t)return;let i=Math.min(this.buffer.x,this.cols-1),n=this._renderService.dimensions.css.cell.height,s=t.getWidth(i),r=this._renderService.dimensions.css.cell.width*s,a=this.buffer.y*this._renderService.dimensions.css.cell.height,o=i*this._renderService.dimensions.css.cell.width;this.textarea.style.left=o+"px",this.textarea.style.top=a+"px",this.textarea.style.width=r+"px",this.textarea.style.height=n+"px",this.textarea.style.lineHeight=n+"px",this.textarea.style.zIndex="-5"}_initGlobal(){this._bindKeys(),this._register(_e(this.element,"copy",t=>{this.hasSelection()&&iz(t,this._selectionService)}));let e=t=>nz(t,this.textarea,this.coreService,this.optionsService);this._register(_e(this.textarea,"paste",e)),this._register(_e(this.element,"paste",e)),KA?this._register(_e(this.element,"mousedown",t=>{t.button===2&&nN(t,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})):this._register(_e(this.element,"contextmenu",t=>{nN(t,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})),yb&&this._register(_e(this.element,"auxclick",t=>{t.button===1&&cA(t,this.textarea,this.screenElement)}))}_bindKeys(){this._register(_e(this.textarea,"keyup",e=>this._keyUp(e),!0)),this._register(_e(this.textarea,"keydown",e=>this._keyDown(e),!0)),this._register(_e(this.textarea,"keypress",e=>this._keyPress(e),!0)),this._register(_e(this.textarea,"compositionstart",()=>this._compositionHelper.compositionstart())),this._register(_e(this.textarea,"compositionupdate",e=>this._compositionHelper.compositionupdate(e))),this._register(_e(this.textarea,"compositionend",()=>this._compositionHelper.compositionend())),this._register(_e(this.textarea,"input",e=>this._inputEvent(e),!0)),this._register(this.onRender(()=>this._compositionHelper.updateCompositionElements()))}open(e){if(!e)throw new Error("Terminal requires a parent element.");if(e.isConnected||this._logService.debug("Terminal.open was called on an element that was not attached to the DOM"),this.element?.ownerDocument.defaultView&&this._coreBrowserService){this.element.ownerDocument.defaultView!==this._coreBrowserService.window&&(this._coreBrowserService.window=this.element.ownerDocument.defaultView);return}this._document=e.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"),e.appendChild(this.element);let t=this._document.createDocumentFragment();this._viewportElement=this._document.createElement("div"),this._viewportElement.classList.add("xterm-viewport"),t.appendChild(this._viewportElement),this.screenElement=this._document.createElement("div"),this.screenElement.classList.add("xterm-screen"),this._register(_e(this.screenElement,"mousemove",s=>this.updateCursorStyle(s))),this._helperContainer=this._document.createElement("div"),this._helperContainer.classList.add("xterm-helpers"),this.screenElement.appendChild(this._helperContainer),t.appendChild(this.screenElement);let i=this.textarea=this._document.createElement("textarea");this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",Ev.get()),$A||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._register(this.optionsService.onSpecificOptionChange("disableStdin",()=>i.readOnly=this.optionsService.rawOptions.disableStdin)),this.textarea.readOnly=this.optionsService.rawOptions.disableStdin,this._coreBrowserService=this._register(this._instantiationService.createInstance(c6,this.textarea,e.ownerDocument.defaultView??window,this._document??typeof window<"u"?window.document:null)),this._instantiationService.setService(er,this._coreBrowserService),this._register(_e(this.textarea,"focus",s=>this._handleTextAreaFocus(s))),this._register(_e(this.textarea,"blur",()=>this._handleTextAreaBlur())),this._helperContainer.appendChild(this.textarea),this._charSizeService=this._instantiationService.createInstance(Qv,this._document,this._helperContainer),this._instantiationService.setService(Rf,this._charSizeService),this._themeService=this._instantiationService.createInstance(ib),this._instantiationService.setService(Ol,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(Tf),this._instantiationService.setService(_A,this._characterJoinerService),this._renderService=this._register(this._instantiationService.createInstance(eb,this.rows,this.screenElement)),this._instantiationService.setService(tr,this._renderService),this._register(this._renderService.onRenderedViewportChange(s=>this._onRender.fire(s))),this.onResize(s=>this._renderService.resize(s.cols,s.rows)),this._compositionView=this._document.createElement("div"),this._compositionView.classList.add("composition-view"),this._compositionHelper=this._instantiationService.createInstance(Vv,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this._mouseService=this._instantiationService.createInstance(Jv),this._instantiationService.setService(db,this._mouseService);let n=this._linkifier.value=this._register(this._instantiationService.createInstance(ub,this.screenElement));this.element.appendChild(t);try{this._onWillOpen.fire(this.element)}catch{}this._renderService.hasRenderer()||this._renderService.setRenderer(this._createRenderer()),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._viewport=this._register(this._instantiationService.createInstance($v,this.element,this.screenElement)),this._register(this._viewport.onRequestScrollLines(s=>{super.scrollLines(s,!1),this.refresh(0,this.rows-1)})),this._selectionService=this._register(this._instantiationService.createInstance(tb,this.element,this.screenElement,n)),this._instantiationService.setService(hz,this._selectionService),this._register(this._selectionService.onRequestScrollLines(s=>this.scrollLines(s.amount,s.suppressScrollEvent))),this._register(this._selectionService.onSelectionChange(()=>this._onSelectionChange.fire())),this._register(this._selectionService.onRequestRedraw(s=>this._renderService.handleSelectionChanged(s.start,s.end,s.columnSelectMode))),this._register(this._selectionService.onLinuxMouseSelection(s=>{this.textarea.value=s,this.textarea.focus(),this.textarea.select()})),this._register(ni.any(this._onScroll.event,this._inputHandler.onScroll)(()=>{this._selectionService.refresh(),this._viewport?.queueSync()})),this._register(this._instantiationService.createInstance(Yv,this.screenElement)),this._register(_e(this.element,"mousedown",s=>this._selectionService.handleMouseDown(s))),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(Mf,this)),this._register(this.optionsService.onSpecificOptionChange("screenReaderMode",s=>this._handleScreenReaderModeOptionChange(s))),this.options.overviewRuler.width&&(this._overviewRulerRenderer=this._register(this._instantiationService.createInstance(kf,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRuler",s=>{!this._overviewRulerRenderer&&s&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this._register(this._instantiationService.createInstance(kf,this._viewportElement,this.screenElement)))}),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()}_createRenderer(){return this._instantiationService.createInstance(Zv,this,this._document,this.element,this.screenElement,this._viewportElement,this._helperContainer,this.linkifier)}bindMouse(){let e=this,t=this.element;function i(r){let a=e._mouseService.getMouseReportCoords(r,e.screenElement);if(!a)return!1;let o,l;switch(r.overrideType||r.type){case"mousemove":l=32,r.buttons===void 0?(o=3,r.button!==void 0&&(o=r.button<3?r.button:3)):o=r.buttons&1?0:r.buttons&4?1:r.buttons&2?2:3;break;case"mouseup":l=0,o=r.button<3?r.button:3;break;case"mousedown":l=1,o=r.button<3?r.button:3;break;case"wheel":if(e._customWheelEventHandler&&e._customWheelEventHandler(r)===!1)return!1;let c=r.deltaY;if(c===0||e.coreMouseService.consumeWheelEvent(r,e._renderService?.dimensions?.device?.cell?.height,e._coreBrowserService?.dpr)===0)return!1;l=c<0?0:1,o=4;break;default:return!1}return l===void 0||o===void 0||o>4?!1:e.coreMouseService.triggerMouseEvent({col:a.col,row:a.row,x:a.x,y:a.y,button:o,action:l,ctrl:r.ctrlKey,alt:r.altKey,shift:r.shiftKey})}let n={mouseup:null,wheel:null,mousedrag:null,mousemove:null},s={mouseup:r=>(i(r),r.buttons||(this._document.removeEventListener("mouseup",n.mouseup),n.mousedrag&&this._document.removeEventListener("mousemove",n.mousedrag)),this.cancel(r)),wheel:r=>(i(r),this.cancel(r,!0)),mousedrag:r=>{r.buttons&&i(r)},mousemove:r=>{r.buttons||i(r)}};this._register(this.coreMouseService.onProtocolChange(r=>{r?(this.optionsService.rawOptions.logLevel==="debug"&&this._logService.debug("Binding to mouse events:",this.coreMouseService.explainEvents(r)),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()),r&8?n.mousemove||(t.addEventListener("mousemove",s.mousemove),n.mousemove=s.mousemove):(t.removeEventListener("mousemove",n.mousemove),n.mousemove=null),r&16?n.wheel||(t.addEventListener("wheel",s.wheel,{passive:!1}),n.wheel=s.wheel):(t.removeEventListener("wheel",n.wheel),n.wheel=null),r&2?n.mouseup||(n.mouseup=s.mouseup):(this._document.removeEventListener("mouseup",n.mouseup),n.mouseup=null),r&4?n.mousedrag||(n.mousedrag=s.mousedrag):(this._document.removeEventListener("mousemove",n.mousedrag),n.mousedrag=null)})),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this._register(_e(t,"mousedown",r=>{if(r.preventDefault(),this.focus(),!(!this.coreMouseService.areMouseEventsActive||this._selectionService.shouldForceSelection(r)))return i(r),n.mouseup&&this._document.addEventListener("mouseup",n.mouseup),n.mousedrag&&this._document.addEventListener("mousemove",n.mousedrag),this.cancel(r)})),this._register(_e(t,"wheel",r=>{if(!n.wheel){if(this._customWheelEventHandler&&this._customWheelEventHandler(r)===!1)return!1;if(!this.buffer.hasScrollback){if(r.deltaY===0)return!1;if(e.coreMouseService.consumeWheelEvent(r,e._renderService?.dimensions?.device?.cell?.height,e._coreBrowserService?.dpr)===0)return this.cancel(r,!0);let a=z.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(r.deltaY<0?"A":"B");return this.coreService.triggerDataEvent(a,!0),this.cancel(r,!0)}}},{passive:!1}))}refresh(e,t){this._renderService?.refreshRows(e,t)}updateCursorStyle(e){this._selectionService?.shouldColumnSelect(e)?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(e,t){this._viewport?this._viewport.scrollLines(e):super.scrollLines(e,t),this.refresh(0,this.rows-1)}scrollPages(e){this.scrollLines(e*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(e){e&&this._viewport?this._viewport.scrollToLine(this.buffer.ybase,!0):this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(e){let t=e-this._bufferService.buffer.ydisp;t!==0&&this.scrollLines(t)}paste(e){lA(e,this.textarea,this.coreService,this.optionsService)}attachCustomKeyEventHandler(e){this._customKeyEventHandler=e}attachCustomWheelEventHandler(e){this._customWheelEventHandler=e}registerLinkProvider(e){return this._linkProviderService.registerLinkProvider(e)}registerCharacterJoiner(e){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");let t=this._characterJoinerService.register(e);return this.refresh(0,this.rows-1),t}deregisterCharacterJoiner(e){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");this._characterJoinerService.deregister(e)&&this.refresh(0,this.rows-1)}get markers(){return this.buffer.markers}registerMarker(e){return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+e)}registerDecoration(e){return this._decorationService.registerDecoration(e)}hasSelection(){return this._selectionService?this._selectionService.hasSelection:!1}select(e,t,i){this._selectionService.setSelection(e,t,i)}getSelection(){return this._selectionService?this._selectionService.selectionText:""}getSelectionPosition(){if(!(!this._selectionService||!this._selectionService.hasSelection))return{start:{x:this._selectionService.selectionStart[0],y:this._selectionService.selectionStart[1]},end:{x:this._selectionService.selectionEnd[0],y:this._selectionService.selectionEnd[1]}}}clearSelection(){this._selectionService?.clearSelection()}selectAll(){this._selectionService?.selectAll()}selectLines(e,t){this._selectionService?.selectLines(e,t)}_keyDown(e){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&this._customKeyEventHandler(e)===!1)return!1;let t=this.browser.isMac&&this.options.macOptionIsMeta&&e.altKey;if(!t&&!this._compositionHelper.keydown(e))return this.options.scrollOnUserInput&&this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(!0),!1;!t&&(e.key==="Dead"||e.key==="AltGraph")&&(this._unprocessedDeadKey=!0);let i=g4(e,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(e),i.type===3||i.type===2){let n=this.rows-1;return this.scrollLines(i.type===2?-n:n),this.cancel(e,!0)}if(i.type===1&&this.selectAll(),this._isThirdLevelShift(this.browser,e)||(i.cancel&&this.cancel(e,!0),!i.key)||e.key&&!e.ctrlKey&&!e.altKey&&!e.metaKey&&e.key.length===1&&e.key.charCodeAt(0)>=65&&e.key.charCodeAt(0)<=90)return!0;if(this._unprocessedDeadKey)return this._unprocessedDeadKey=!1,!0;if((i.key===z.ETX||i.key===z.CR)&&(this.textarea.value=""),this._onKey.fire({key:i.key,domEvent:e}),this._showCursor(),this.coreService.triggerDataEvent(i.key,!0),!this.optionsService.rawOptions.screenReaderMode||e.altKey||e.ctrlKey)return this.cancel(e,!0);this._keyDownHandled=!0}_isThirdLevelShift(e,t){let i=e.isMac&&!this.options.macOptionIsMeta&&t.altKey&&!t.ctrlKey&&!t.metaKey||e.isWindows&&t.altKey&&t.ctrlKey&&!t.metaKey||e.isWindows&&t.getModifierState("AltGraph");return t.type==="keypress"?i:i&&(!t.keyCode||t.keyCode>47)}_keyUp(e){this._keyDownSeen=!1,!(this._customKeyEventHandler&&this._customKeyEventHandler(e)===!1)&&(x4(e)||this.focus(),this.updateCursorStyle(e),this._keyPressHandled=!1)}_keyPress(e){let t;if(this._keyPressHandled=!1,this._keyDownHandled||this._customKeyEventHandler&&this._customKeyEventHandler(e)===!1)return!1;if(this.cancel(e),e.charCode)t=e.charCode;else if(e.which===null||e.which===void 0)t=e.keyCode;else if(e.which!==0&&e.charCode!==0)t=e.which;else return!1;return!t||(e.altKey||e.ctrlKey||e.metaKey)&&!this._isThirdLevelShift(this.browser,e)?!1:(t=String.fromCharCode(t),this._onKey.fire({key:t,domEvent:e}),this._showCursor(),this.coreService.triggerDataEvent(t,!0),this._keyPressHandled=!0,this._unprocessedDeadKey=!1,!0)}_inputEvent(e){if(e.data&&e.inputType==="insertText"&&(!e.composed||!this._keyDownSeen)&&!this.optionsService.rawOptions.screenReaderMode){if(this._keyPressHandled)return!1;this._unprocessedDeadKey=!1;let t=e.data;return this.coreService.triggerDataEvent(t,!0),this.cancel(e),!0}return!1}resize(e,t){if(e===this.cols&&t===this.rows){this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure();return}super.resize(e,t)}_afterResize(e,t){this._charSizeService?.measure()}clear(){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 e=1;e<this.rows;e++)this.buffer.lines.push(this.buffer.getBlankLine(It));this._onScroll.fire({position:this.buffer.ydisp}),this.refresh(0,this.rows-1)}}reset(){this.options.rows=this.rows,this.options.cols=this.cols;let e=this._customKeyEventHandler;this._setup(),super.reset(),this._selectionService?.reset(),this._decorationService.reset(),this._customKeyEventHandler=e,this.refresh(0,this.rows-1)}clearTextureAtlas(){this._renderService?.clearTextureAtlas()}_reportFocus(){this.element?.classList.contains("focus")?this.coreService.triggerDataEvent(z.ESC+"[I"):this.coreService.triggerDataEvent(z.ESC+"[O")}_reportWindowsOptions(e){if(this._renderService)switch(e){case 0:let t=this._renderService.dimensions.css.canvas.width.toFixed(0),i=this._renderService.dimensions.css.canvas.height.toFixed(0);this.coreService.triggerDataEvent(`${z.ESC}[4;${i};${t}t`);break;case 1:let n=this._renderService.dimensions.css.cell.width.toFixed(0),s=this._renderService.dimensions.css.cell.height.toFixed(0);this.coreService.triggerDataEvent(`${z.ESC}[6;${s};${n}t`);break}}cancel(e,t){if(!(!this.options.cancelEvents&&!t))return e.preventDefault(),e.stopPropagation(),!1}};C4=class{constructor(){this._addons=[]}dispose(){for(let e=this._addons.length-1;e>=0;e--)this._addons[e].instance.dispose()}loadAddon(e,t){let i={instance:t,dispose:t.dispose,isDisposed:!1};this._addons.push(i),t.dispose=()=>this._wrappedAddonDispose(i),t.activate(e)}_wrappedAddonDispose(e){if(e.isDisposed)return;let t=-1;for(let i=0;i<this._addons.length;i++)if(this._addons[i]===e){t=i;break}if(t===-1)throw new Error("Could not dispose an addon that has not been loaded");e.isDisposed=!0,e.dispose.apply(e.instance),this._addons.splice(t,1)}},k4=class{constructor(e){this._line=e}get isWrapped(){return this._line.isWrapped}get length(){return this._line.length}getCell(e,t){if(!(e<0||e>=this._line.length))return t?(this._line.loadCell(e,t),t):this._line.loadCell(e,new Ln)}translateToString(e,t,i){return this._line.translateToString(e,t,i)}},aA=class{constructor(e,t){this._buffer=e,this.type=t}init(e){return this._buffer=e,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(e){let t=this._buffer.lines.get(e);if(t)return new k4(t)}getNullCell(){return new Ln}},T4=class extends xe{constructor(e){super(),this._core=e,this._onBufferChange=this._register(new X),this.onBufferChange=this._onBufferChange.event,this._normal=new aA(this._core.buffers.normal,"normal"),this._alternate=new aA(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)}},N4=class{constructor(e){this._core=e}registerCsiHandler(e,t){return this._core.registerCsiHandler(e,i=>t(i.toArray()))}addCsiHandler(e,t){return this.registerCsiHandler(e,t)}registerDcsHandler(e,t){return this._core.registerDcsHandler(e,(i,n)=>t(i,n.toArray()))}addDcsHandler(e,t){return this.registerDcsHandler(e,t)}registerEscHandler(e,t){return this._core.registerEscHandler(e,t)}addEscHandler(e,t){return this.registerEscHandler(e,t)}registerOscHandler(e,t){return this._core.registerOscHandler(e,t)}addOscHandler(e,t){return this.registerOscHandler(e,t)}},A4=class{constructor(e){this._core=e}register(e){this._core.unicodeService.register(e)}get versions(){return this._core.unicodeService.versions}get activeVersion(){return this._core.unicodeService.activeVersion}set activeVersion(e){this._core.unicodeService.activeVersion=e}},M4=["cols","rows"],xs=0,iM=class extends xe{constructor(e){super(),this._core=this._register(new E4(e)),this._addonManager=this._register(new C4),this._publicOptions={...this._core.options};let t=n=>this._core.options[n],i=(n,s)=>{this._checkReadonlyOptions(n),this._core.options[n]=s};for(let n in this._core.options){let s={get:t.bind(this,n),set:i.bind(this,n)};Object.defineProperty(this._publicOptions,n,s)}}_checkReadonlyOptions(e){if(M4.includes(e))throw new Error(`Option "${e}" 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 N4(this._core)),this._parser}get unicode(){return this._checkProposedApi(),new A4(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 T4(this._core))),this._buffer}get markers(){return this._checkProposedApi(),this._core.markers}get modes(){let e=this._core.coreService.decPrivateModes,t="none";switch(this._core.coreMouseService.activeProtocol){case"X10":t="x10";break;case"VT200":t="vt200";break;case"DRAG":t="drag";break;case"ANY":t="any";break}return{applicationCursorKeysMode:e.applicationCursorKeys,applicationKeypadMode:e.applicationKeypad,bracketedPasteMode:e.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:t,originMode:e.origin,reverseWraparoundMode:e.reverseWraparound,sendFocusMode:e.sendFocus,synchronizedOutputMode:e.synchronizedOutput,wraparoundMode:e.wraparound}}get options(){return this._publicOptions}set options(e){for(let t in e)this._publicOptions[t]=e[t]}blur(){this._core.blur()}focus(){this._core.focus()}input(e,t=!0){this._core.input(e,t)}resize(e,t){this._verifyIntegers(e,t),this._core.resize(e,t)}open(e){this._core.open(e)}attachCustomKeyEventHandler(e){this._core.attachCustomKeyEventHandler(e)}attachCustomWheelEventHandler(e){this._core.attachCustomWheelEventHandler(e)}registerLinkProvider(e){return this._core.registerLinkProvider(e)}registerCharacterJoiner(e){return this._checkProposedApi(),this._core.registerCharacterJoiner(e)}deregisterCharacterJoiner(e){this._checkProposedApi(),this._core.deregisterCharacterJoiner(e)}registerMarker(e=0){return this._verifyIntegers(e),this._core.registerMarker(e)}registerDecoration(e){return this._checkProposedApi(),this._verifyPositiveIntegers(e.x??0,e.width??0,e.height??0),this._core.registerDecoration(e)}hasSelection(){return this._core.hasSelection()}select(e,t,i){this._verifyIntegers(e,t,i),this._core.select(e,t,i)}getSelection(){return this._core.getSelection()}getSelectionPosition(){return this._core.getSelectionPosition()}clearSelection(){this._core.clearSelection()}selectAll(){this._core.selectAll()}selectLines(e,t){this._verifyIntegers(e,t),this._core.selectLines(e,t)}dispose(){super.dispose()}scrollLines(e){this._verifyIntegers(e),this._core.scrollLines(e)}scrollPages(e){this._verifyIntegers(e),this._core.scrollPages(e)}scrollToTop(){this._core.scrollToTop()}scrollToBottom(){this._core.scrollToBottom()}scrollToLine(e){this._verifyIntegers(e),this._core.scrollToLine(e)}clear(){this._core.clear()}write(e,t){this._core.write(e,t)}writeln(e,t){this._core.write(e),this._core.write(`\r
124
+ `,t)}paste(e){this._core.paste(e)}refresh(e,t){this._verifyIntegers(e,t),this._core.refresh(e,t)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(e){this._addonManager.loadAddon(this,e)}static get strings(){return{get promptLabel(){return Ev.get()},set promptLabel(e){Ev.set(e)},get tooMuchOutput(){return xv.get()},set tooMuchOutput(e){xv.set(e)}}}_verifyIntegers(...e){for(xs of e)if(xs===1/0||isNaN(xs)||xs%1!==0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...e){for(xs of e)if(xs&&(xs===1/0||isNaN(xs)||xs%1!==0||xs<0))throw new Error("This API only accepts positive integers")}}});var O4,R4,sM,rM=ce(()=>{O4=2,R4=1,sM=class{activate(e){this._terminal=e}dispose(){}fit(){let e=this.proposeDimensions();if(!e||!this._terminal||isNaN(e.cols)||isNaN(e.rows))return;let t=this._terminal._core;(this._terminal.rows!==e.rows||this._terminal.cols!==e.cols)&&(t._renderService.clear(),this._terminal.resize(e.cols,e.rows))}proposeDimensions(){if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;let e=this._terminal._core._renderService.dimensions;if(e.css.cell.width===0||e.css.cell.height===0)return;let t=this._terminal.options.scrollback===0?0:this._terminal.options.overviewRuler?.width||14,i=window.getComputedStyle(this._terminal.element.parentElement),n=parseInt(i.getPropertyValue("height")),s=Math.max(0,parseInt(i.getPropertyValue("width"))),r=window.getComputedStyle(this._terminal.element),a={top:parseInt(r.getPropertyValue("padding-top")),bottom:parseInt(r.getPropertyValue("padding-bottom")),right:parseInt(r.getPropertyValue("padding-right")),left:parseInt(r.getPropertyValue("padding-left"))},o=a.top+a.bottom,l=a.right+a.left,c=n-o,u=s-l-t;return{cols:Math.max(O4,Math.floor(u/e.css.cell.width)),rows:Math.max(R4,Math.floor(c/e.css.cell.height))}}}});var aM=ce(()=>{});function D4(){let e=document.documentElement.dataset.theme;return e==="dark"?!0:e==="light"?!1:window.matchMedia("(prefers-color-scheme: dark)").matches}function Sb(){return D4()?{background:"#0c0c0c",foreground:"#cccccc",cursor:"#cccccc",cursorAccent:"#0c0c0c",selectionBackground:"#264f78",selectionForeground:"#ffffff",black:"#0c0c0c",red:"#f14c4c",green:"#23d18b",yellow:"#f5f543",blue:"#3b8eea",magenta:"#d670d6",cyan:"#29b8db",white:"#cccccc",brightBlack:"#666666",brightRed:"#f14c4c",brightGreen:"#23d18b",brightYellow:"#f5f543",brightBlue:"#3b8eea",brightMagenta:"#d670d6",brightCyan:"#29b8db",brightWhite:"#ffffff"}:{background:"#ffffff",foreground:"#1e1e1e",cursor:"#1e1e1e",cursorAccent:"#ffffff",selectionBackground:"#add6ff",selectionForeground:"#1e1e1e",black:"#000000",red:"#cd3131",green:"#00bc00",yellow:"#949800",blue:"#0451a5",magenta:"#bc05bc",cyan:"#0598bc",white:"#555555",brightBlack:"#666666",brightRed:"#cd3131",brightGreen:"#14ce14",brightYellow:"#b5ba00",brightBlue:"#0451a5",brightMagenta:"#bc05bc",brightCyan:"#0598bc",brightWhite:"#a5a5a5"}}var oM=ce(()=>{});function lM(){let{projects:e,threads:t}=lt(),i=fe(),n=t.find(v=>v.id===i.currentThreadId)??null,s=n?e.find(v=>v.id===n.projectId):e.find(v=>v.id===i.currentProjectId),r=s?.id??null,[a,o]=(0,ri.useState)([]),[l,c]=(0,ri.useState)(null),[u,h]=(0,ri.useState)(null),d=(0,ri.useCallback)(async()=>{if(!r){o([]);return}try{let v=await te.call("terminal.list",{projectId:r});o(v),c(g=>g&&v.some(m=>m.id===g)?g:v[0]?.id??null)}catch{}},[r]);(0,ri.useEffect)(()=>{d()},[d]),(0,ri.useEffect)(()=>te.subscribe("terminals",(g,m)=>{let b=m;b?.type==="terminal.exit"&&(o(S=>S.filter(x=>x.id!==b.id)),c(S=>S===b.id?null:S))}),[]);let f=async()=>{if(r)try{let v=await te.call("terminal.create",{projectId:r,cols:100,rows:28});await d(),c(v.id)}catch(v){Pe(w("terminal.failNew")+ht(v),!0)}},p=async v=>{try{await te.call("terminal.kill",{id:v.id}),o(g=>g.filter(m=>m.id!==v.id)),c(g=>g===v.id?null:g)}catch(g){Pe(w("terminal.failKill")+ht(g),!0)}};if(!s)return(0,$t.jsx)("div",{className:"pn-empty",children:w("panel.pickProject")});let _=a.find(v=>v.id===l)??null;return(0,$t.jsxs)($t.Fragment,{children:[(0,$t.jsxs)("div",{className:"tm-tabs",children:[a.map(v=>(0,$t.jsxs)("button",{className:`tm-tab${v.id===l?" on":""}`,onClick:()=>c(v.id),title:v.title,children:[v.title,(0,$t.jsx)("span",{className:"tm-x",onClick:g=>{g.stopPropagation(),h(v)},children:"\xD7"})]},v.id)),(0,$t.jsx)("button",{className:"ibtn",title:w("terminal.new"),onClick:()=>{f()},children:(0,$t.jsx)(Me,{name:"plus",size:14})})]}),_?.simple&&(0,$t.jsx)("div",{className:"tm-note",children:w("terminal.simpleNote")}),(0,$t.jsxs)("div",{className:"tm-body",children:[a.length===0&&(0,$t.jsxs)("div",{className:"pn-empty",children:[w("terminal.noTerm"),(0,$t.jsx)("div",{style:{marginTop:8},children:(0,$t.jsx)("button",{className:"btn primary",onClick:()=>{f()},children:w("terminal.new")})})]}),a.map(v=>(0,$t.jsx)(L4,{term:v,visible:v.id===l},v.id))]}),u&&(0,$t.jsx)(hl,{title:w("terminal.closeTitle"),body:Te("terminal.closeBody",{title:u.title}),okLabel:w("terminal.closeOk"),danger:!0,onOk:()=>{p(u)},onClose:()=>h(null)})]})}function L4({term:e,visible:t}){let i=(0,ri.useRef)(null),n=(0,ri.useRef)(null),s=(0,ri.useRef)(null),[r,a]=(0,ri.useState)(!1);return(0,ri.useEffect)(()=>{let o=i.current;if(!o)return;let l=new iM({fontFamily:'"Cascadia Mono", "Cascadia Code", Consolas, "SF Mono", Menlo, Monaco, "DejaVu Sans Mono", "Ubuntu Mono", "Microsoft YaHei UI", "PingFang SC", "Noto Sans Mono CJK SC", monospace',fontSize:13,lineHeight:1.25,cursorBlink:!0,scrollback:5e3,allowTransparency:!1,theme:Sb()}),c=new sM;l.loadAddon(c),l.open(o),n.current=l,s.current=c;try{c.fit()}catch{}let u=new TextDecoder,h=new TextEncoder,d=te.onBinaryFrame((f,p,_)=>{p!==e.index||f!==1||l.write(u.decode(_))});return l.onData(f=>te.sendBinary(2,e.index,h.encode(f))),(async()=>{try{let f=await te.call("terminal.attach",{id:e.id});f.windowsPty&&(l.options.windowsPty=f.windowsPty),f.snapshot&&l.write(f.snapshot),a(!0)}catch{l.writeln(w("terminal.ended"))}})(),()=>{d(),l.dispose(),n.current=null,s.current=null}},[e.id,e.index]),(0,ri.useEffect)(()=>{let o=document.documentElement,l=()=>{let h=n.current;h&&(h.options.theme=Sb())},c=new MutationObserver(l);c.observe(o,{attributes:!0,attributeFilter:["data-theme"]});let u=window.matchMedia("(prefers-color-scheme: dark)");return u.addEventListener("change",l),()=>{c.disconnect(),u.removeEventListener("change",l)}},[]),(0,ri.useEffect)(()=>{if(!t)return;let o=s.current,l=n.current;if(!o||!l||!r)return;let c=setTimeout(()=>{try{o.fit();let u=new TextEncoder;te.sendBinary(3,e.index,u.encode(JSON.stringify({cols:l.cols,rows:l.rows})))}catch{}},50);return()=>clearTimeout(c)},[t,r,e.index]),(0,ri.useEffect)(()=>{let o=i.current;if(!o)return;let l=new ResizeObserver(()=>{let c=s.current,u=n.current;if(!(!c||!u||!t))try{c.fit();let h=new TextEncoder;te.sendBinary(3,e.index,h.encode(JSON.stringify({cols:u.cols,rows:u.rows})))}catch{}});return l.observe(o),()=>l.disconnect()},[t,e.index]),(0,$t.jsx)("div",{className:"tm-view",ref:i,style:{display:t?"block":"none"}})}var ri,$t,cM=ce(()=>{ri=ae(Mt(),1);nM();rM();ln();qn();Tn();Pr();dl();_s();wi();aM();oM();$t=ae(Le(),1)});function uM(){let e=fe(),t=[{tab:"changes",label:w("panel.changes")},{tab:"files",label:w("panel.files")},{tab:"terminal",label:w("panel.terminal")}];return(0,se.jsxs)(se.Fragment,{children:[(0,se.jsxs)("div",{className:"pn-head",children:[(0,se.jsx)("div",{className:"pn-tabs",children:t.map(i=>(0,se.jsx)("button",{className:`pn-tab${e.panelTab===i.tab?" on":""}`,onClick:()=>e.setPanelTab(i.tab),children:i.label},i.tab))}),(0,se.jsx)("button",{className:"ibtn pn-close",title:w("panel.closeTitle"),onClick:()=>e.closePanel(),children:(0,se.jsx)(Me,{name:"x"})})]}),(0,se.jsxs)("div",{className:"pn-body",children:[e.panelTab==="changes"&&(0,se.jsx)(P4,{}),e.panelTab==="files"&&(0,se.jsx)(U4,{}),e.panelTab==="terminal"&&(0,se.jsx)(lM,{})]})]})}function I4(e){let t=[],i=null;for(let n of e.split(`
125
+ `))if(!(n.startsWith("diff ")||n.startsWith("index ")||n.startsWith("--- ")||n.startsWith("+++ "))){if(n.startsWith("@@")){i={head:n,lines:[]},t.push(i);continue}i&&(n.startsWith("+")?i.lines.push({t:"+",text:n.slice(1)}):n.startsWith("-")?i.lines.push({t:"-",text:n.slice(1)}):n.startsWith("\\")?i.lines.push({t:" ",text:n}):i.lines.push({t:" ",text:n.startsWith(" ")?n.slice(1):n}))}return t}function z4(e){let t=0,i=0;for(let n of e.split(`
126
+ `))n.startsWith("+")&&!n.startsWith("+++")?t++:n.startsWith("-")&&!n.startsWith("---")&&i++;return{add:t,del:i}}function P4(){let{projects:e,threads:t}=lt(),i=fe(),n=An(M=>M.status),[s,r]=(0,_t.useState)(null),[a,o]=(0,_t.useState)(!1),[l,c]=(0,_t.useState)(null),[u,h]=(0,_t.useState)(null),[d,f]=(0,_t.useState)(null),[p,_]=(0,_t.useState)({}),v=(0,_t.useRef)(n),g=(0,_t.useRef)(null);g.current=l;let m=t.find(M=>M.id===i.currentThreadId)??null,b=m?e.find(M=>M.id===m.projectId):e.find(M=>M.id===i.currentProjectId),S=b?.id??null,x=(0,_t.useCallback)(async()=>{if(!S){r(null);return}try{let M=await te.call("git.status",{projectId:S});r(M);let O=g.current;O&&!M.files?.some(q=>q.path===O)&&(c(null),h(null))}catch(M){r({isRepo:!1,error:String(M?.message??M)})}},[S]);(0,_t.useEffect)(()=>{x();let M=setInterval(()=>{x()},3e3);return()=>clearInterval(M)},[x]),(0,_t.useEffect)(()=>{let M=v.current;v.current=n,(M==="running"||M==="initializing")&&n!=="running"&&n!=="initializing"&&x()},[n,x]);let C=(0,_t.useCallback)(async M=>{if(S){c(M.path),h({loading:!0});try{let O=await te.call("git.diff",{projectId:S,path:M.path});if(O.tooLarge)h({tooLarge:!0});else if(O.error)h({error:O.error});else{let q=I4(O.diff??"");h({hunks:q}),_(G=>({...G,[M.path]:z4(O.diff??"")}))}}catch(O){h({error:String(O?.message??O)})}}},[S]),N=(0,_t.useCallback)(async M=>{if(S){o(!0);try{await te.call("git.discard",{projectId:S,path:M.path}),l===M.path&&(c(null),h(null)),await x()}catch(O){Pe(w("panel.failDiscard")+ht(O),!0)}finally{o(!1)}}},[S,l,x]);return b?s&&!s.isRepo?(0,se.jsxs)("div",{className:"pn-empty",children:[w("panel.notGit"),s.error&&(0,se.jsx)("div",{className:"pn-empty-sub",children:s.error})]}):(0,se.jsxs)(se.Fragment,{children:[(0,se.jsxs)("div",{className:"chg-head",children:[(0,se.jsxs)("span",{className:"chg-branch",title:w("panel.branch"),children:[(0,se.jsx)(Me,{name:"changes",size:13})," ",s?.branch??"\u2026"]}),(0,se.jsx)("button",{className:"ibtn",title:w("common.refresh"),onClick:()=>{x()},children:(0,se.jsx)(Me,{name:"refresh",size:14})})]}),(0,se.jsxs)("div",{className:"chg-list",children:[(s?.files??[]).length===0&&(0,se.jsx)("div",{className:"pn-empty",children:w("panel.clean")}),s?.files?.map(M=>{let O=p[M.path];return(0,se.jsxs)("div",{className:`chg-row${l===M.path?" on":""}`,onClick:()=>{C(M)},children:[(0,se.jsx)("span",{className:`chg-kind k-${M.kind}`,title:M.kind,children:B4(M.kind)}),(0,se.jsx)("span",{className:"chg-path",title:M.path,children:M.path}),O&&(0,se.jsxs)("span",{className:"chg-stat",children:[(0,se.jsxs)("em",{className:"add",children:["+",O.add]})," ",(0,se.jsxs)("em",{className:"del",children:["\u2212",O.del]})]}),(0,se.jsx)("button",{className:"ibtn chg-discard",title:w("panel.discardBtn"),disabled:a,onClick:q=>{q.stopPropagation(),f(M)},children:(0,se.jsx)(Me,{name:"x",size:13})})]},M.path)})]}),(0,se.jsxs)("div",{className:"chg-diff",children:[u?.loading&&(0,se.jsx)("div",{className:"pn-empty",children:w("panel.loadingDiff")}),u?.tooLarge&&(0,se.jsx)("div",{className:"pn-empty",children:w("panel.diffTooLarge")}),u?.error&&(0,se.jsx)("div",{className:"pn-empty",children:u.error}),u?.hunks&&(0,se.jsx)(of,{hunks:u.hunks,path:l??void 0})]}),d&&(0,se.jsx)(hl,{title:w("panel.discardTitle"),body:d.kind==="untracked"?Te("panel.discardUntracked",{path:d.path}):Te("panel.discardTracked",{path:d.path}),okLabel:w("common.discard"),danger:!0,onOk:()=>{N(d)},onClose:()=>f(null)})]}):(0,se.jsx)("div",{className:"pn-empty",children:w("panel.pickProject")})}function U4(){let{projects:e,threads:t}=lt(),i=fe(),n=t.find(m=>m.id===i.currentThreadId)??null,s=n?e.find(m=>m.id===n.projectId):e.find(m=>m.id===i.currentProjectId),r=s?.id??null,[a,o]=(0,_t.useState)({}),[l,c]=(0,_t.useState)(null),[u,h]=(0,_t.useState)(null),d=(0,_t.useCallback)(async m=>{if(r){o(b=>({...b,[m]:"loading"}));try{let b=await te.call("files.tree",{projectId:r,dir:m});o(S=>({...S,[m]:b.error?`err:${b.error}`:b.entries??[]}))}catch(b){o(S=>({...S,[m]:`err:${String(b?.message??b)}`}))}}},[r]);(0,_t.useEffect)(()=>{o({}),c(null),h(null),r&&d(".")},[r,d]);let f=m=>{if(!m.isDir){p(m.path);return}let b=a[m.path];b&&b!=="loading"?o(S=>{let x={...S};return delete x[m.path],x}):b||d(m.path)},p=async m=>{if(r){c(m),h({loading:!0});try{let b=await te.call("files.read",{projectId:r,path:m});h(b)}catch(b){h({error:String(b?.message??b)})}}},_=(0,_t.useRef)(null);if((0,_t.useEffect)(()=>{let m=_.current;if(!(!m||!u?.text))try{Qd.highlightElement(m)}catch{}},[u?.text,u?.language]),!s)return(0,se.jsx)("div",{className:"pn-empty",children:w("panel.pickProject")});let v=l?l.split("/"):[],g=(m,b)=>{let S=a[m];return!S||S==="loading"?null:typeof S=="string"?(0,se.jsx)("div",{className:"ft-err",style:{paddingLeft:8+b*14},children:S.slice(4)}):S.map(x=>(0,se.jsxs)("div",{children:[(0,se.jsxs)("div",{className:`ft-row${l===x.path?" on":""}`,style:{paddingLeft:8+b*14},onClick:()=>f(x),title:x.path,children:[x.isDir?(0,se.jsxs)(se.Fragment,{children:[(0,se.jsx)("span",{className:`caret${a[x.path]&&a[x.path]!=="loading"?" open":""}`,children:"\u203A"}),(0,se.jsx)(Me,{name:"files",size:13})]}):(0,se.jsxs)(se.Fragment,{children:[(0,se.jsx)("span",{className:"caret",style:{visibility:"hidden"},children:"\u203A"}),(0,se.jsx)("span",{className:"ft-dot"})]}),(0,se.jsx)("span",{className:"ft-name",children:x.name})]}),x.isDir&&g(x.path,b+1)]},x.path))};return(0,se.jsxs)(se.Fragment,{children:[(0,se.jsx)("div",{className:"ft-crumbs",children:l?(0,se.jsxs)(se.Fragment,{children:[(0,se.jsx)("button",{className:"ft-crumb",onClick:()=>c(null),title:w("panel.closePreview"),children:"\xD7"}),v.map((m,b)=>(0,se.jsxs)("span",{className:"ft-crumb-t",children:[b>0?"/":"",m]},b)),(0,se.jsx)("button",{className:"ibtn",title:w("common.copyPath"),onClick:()=>{Ua(l),Pe(w("common.copiedPath"))},children:(0,se.jsx)(Me,{name:"copy",size:13})})]}):(0,se.jsx)("span",{className:"ft-crumb-t muted",children:s.name})}),(0,se.jsx)("div",{className:"ft-tree",children:g(".",0)}),l&&(0,se.jsxs)("div",{className:"ft-view",children:[u?.loading&&(0,se.jsx)("div",{className:"pn-empty",children:w("panel.reading")}),u?.binary&&(0,se.jsx)("div",{className:"pn-empty",children:w("panel.binary")}),u?.tooLarge&&(0,se.jsx)("div",{className:"pn-empty",children:w("panel.tooLarge")}),u?.error&&(0,se.jsx)("div",{className:"pn-empty",children:u.error}),u?.text!=null&&(0,se.jsx)("pre",{className:"ft-pre",children:(0,se.jsx)("code",{ref:_,className:`language-${u.language??"plaintext"}`,children:u.text})})]})]})}var _t,se,B4,hM=ce(()=>{_t=ae(Mt(),1);ln();qn();Cl();Tn();Pr();lf();dl();_s();wi();cM();Jd();Y_();se=ae(Le(),1);B4=e=>w(`panel.gitKind.${e}`)});function dM(){let{state:e,version:t}=ms(),i=An(l=>l.pending),n=lt(l=>l.providers),[s,r]=(0,Nu.useState)(!1),[a,o]=(0,Nu.useState)(!1);return(0,Nu.useEffect)(()=>{let l=u=>{(u.ctrlKey||u.metaKey)&&u.key.toLowerCase()==="k"&&(u.preventDefault(),r(h=>!h))},c=()=>o(!0);return window.addEventListener("keydown",l),window.addEventListener("open-settings",c),()=>{window.removeEventListener("keydown",l),window.removeEventListener("open-settings",c)}},[]),e==="down"?(0,ai.jsx)("div",{className:"boot-screen",children:(0,ai.jsxs)("div",{className:"boot-wrap",children:[(0,ai.jsx)("span",{children:w("boot.serviceDown")}),(0,ai.jsx)("button",{className:"btn primary",onClick:()=>location.reload(),children:w("boot.retry")})]})}):e==="connecting"&&!t?(0,ai.jsxs)("div",{className:"boot-screen",children:[(0,ai.jsx)("div",{className:"boot-dot","data-state":e}),(0,ai.jsx)("span",{className:"boot-label",children:w("boot.connecting")})]}):(0,ai.jsxs)(qE,{sidebar:(0,ai.jsx)(XE,{pendingByThread:new Set(i.map(l=>An.getState().threadId).filter(Boolean))}),topbar:(0,ai.jsx)(Jk,{pendingCount:i.length}),panel:(0,ai.jsx)(uM,{}),children:[e==="reconnecting"&&(0,ai.jsx)("div",{className:"connbar",children:w("boot.reconnecting")}),(0,ai.jsx)(XT,{}),s&&(0,ai.jsx)(JT,{onClose:()=>r(!1)}),a&&(0,ai.jsx)(nv,{onClose:()=>o(!1),providers:n}),(0,ai.jsx)(jE,{})]})}var Nu,ai,fM=ce(()=>{Pc();KE();ZE();eT();ZT();Cl();qn();Nu=ae(Mt(),1);eN();hM();iu();_s();wi();ai=ae(Le(),1)});function pM(){let{state:e,version:t}=ms(),[i,n]=(0,ki.useState)([]),[s,r]=(0,ki.useState)([]),[a,o]=(0,ki.useState)(""),[l,c]=(0,ki.useState)(""),[u,h]=(0,ki.useState)([]),[d,f]=(0,ki.useState)([]),[p,_]=(0,ki.useState)([]),[v,g]=(0,ki.useState)(""),[m,b]=(0,ki.useState)(""),S=(0,ki.useRef)(null);(0,ki.useEffect)(()=>{e==="open"&&(Zr("projects.list").then(O=>n(O??[])),Zr("threads.list").then(O=>r(O??[])))},[e]),(0,ki.useEffect)(()=>{if(S.current?.(),S.current=null,h([]),f([]),_([]),!(!l||e!=="open"))return Zr("threads.get",{id:l}).then(O=>{let q=O;h(q.events??[]),f(q.pending??[]),_(q.queue??[])}),S.current=te.subscribe(`thread:${l}`,(O,q)=>{let G=q;if(G.type==="event"&&G.event&&(h(I=>[...I,G.event]),G.event.type==="permission_resolved"||G.event.type==="question_answered")){let I=G.event.requestId;f(P=>P.filter(R=>R.requestId!==I))}G.type==="queue"&&G.queue&&_(G.queue)}),()=>S.current?.()},[l,e]),(0,ki.useEffect)(()=>{let O=u.filter(I=>I.type==="permission_request"||I.type==="question"),q=new Set(u.filter(I=>I.type==="permission_resolved"||I.type==="question_answered").map(I=>I.requestId)),G=O.filter(I=>!q.has(I.requestId)).map(I=>({requestId:I.requestId??"",kind:I.type==="question"?"question":"permission",options:I.options}));f(I=>{let P=new Map(I.map(R=>[R.requestId,R]));for(let R of G)P.set(R.requestId,R);return[...P.values()]})},[u]);let x=async()=>{if(!l)return;let O=await Zr("threads.get",{id:l}).catch(()=>null);O&&(h(O.events??[]),f(q=>{let G=new Map(q.map(I=>[I.requestId,I]));for(let I of O.pending??[])G.set(I.requestId,I);return[...G.values()]}),_(O.queue??[]))},C=async O=>{if(b(""),!l||!v.trim())return;let q=v;g("");try{await Zr("thread.send",{id:l,text:q,behavior:O})}catch(G){b(String(G?.message??G))}await x()},N=async(O,q,G)=>{await Zr("thread.respond",{id:l,requestId:O,optionId:q,answers:G}).catch(I=>b(String(I?.message??I))),setTimeout(()=>{x()},1500)},M=async()=>{if(!a)return;let O=await Zr("threads.create",{projectId:a,provider:"mock"}).catch(q=>(b(String(q?.message??q)),null));O&&(r(q=>[O,...q]),c(O.id))};return(0,nt.jsxs)("div",{style:{display:"flex",height:"100vh",font:"13px/1.5 system-ui",color:"var(--fg)"},children:[(0,nt.jsxs)("div",{style:{width:260,borderRight:"1px solid var(--border)",padding:12,overflowY:"auto"},children:[(0,nt.jsx)("div",{style:{marginBottom:8},children:e==="open"?`\u5DF2\u8FDE\u63A5 \xB7 ${t??""}`:"\u8FDE\u63A5\u4E2D\u2026"}),(0,nt.jsxs)("select",{value:a,onChange:O=>o(O.target.value),style:{width:"100%"},children:[(0,nt.jsx)("option",{value:"",children:"\u9009\u62E9\u9879\u76EE"}),i.map(O=>(0,nt.jsx)("option",{value:O.id,children:O.name},O.id))]}),(0,nt.jsx)("button",{onClick:()=>{M()},disabled:!a,style:{width:"100%",marginTop:8},children:"\u65B0\u5EFA\u5BF9\u8BDD\uFF08mock\uFF09"}),(0,nt.jsx)("div",{style:{marginTop:12},children:s.filter(O=>!a||O.projectId===a).map(O=>(0,nt.jsxs)("div",{onClick:()=>c(O.id),style:{padding:"6px 8px",cursor:"pointer",borderRadius:4,background:O.id===l?"var(--bg-active, #333)":"transparent"},children:[O.title," ",(0,nt.jsxs)("span",{style:{opacity:.6},children:["(",O.status,")"]})]},O.id))})]}),(0,nt.jsxs)("div",{style:{flex:1,display:"flex",flexDirection:"column"},children:[(0,nt.jsxs)("div",{style:{flex:1,overflowY:"auto",padding:12},children:[u.map((O,q)=>(0,nt.jsx)("pre",{style:{margin:"4px 0",fontSize:11,whiteSpace:"pre-wrap",borderBottom:"1px solid var(--border)",paddingBottom:4},children:(O.seq??"")+" "+(O.type??"?")+" "+JSON.stringify(O).slice(0,400)},q)),d.map(O=>(0,nt.jsxs)("div",{style:{border:"1px solid var(--warn, orange)",borderRadius:6,padding:8,margin:"8px 0"},children:[(0,nt.jsxs)("div",{children:["\u6388\u6743/\u63D0\u95EE ",O.requestId]}),O.options?.map(q=>(0,nt.jsx)("button",{onClick:()=>{N(O.requestId,q.id)},style:{marginRight:8},children:q.label},q.id)),O.kind==="question"&&(0,nt.jsx)("button",{onClick:()=>{N(O.requestId,void 0,{q1:"staging",q2:""})},children:"\u586B\u8868\u63D0\u4EA4"}),(0,nt.jsx)("button",{onClick:()=>{N(O.requestId,void 0,void 0)},children:"\u53D6\u6D88"})]},O.requestId))]}),p.length>0&&(0,nt.jsxs)("div",{style:{padding:"4px 12px",opacity:.7},children:["\u6392\u961F\u4E2D\uFF1A",p.length," \u6761"]}),m&&(0,nt.jsx)("div",{style:{padding:"4px 12px",color:"var(--danger, red)"},children:m}),(0,nt.jsxs)("div",{style:{display:"flex",gap:8,padding:12,borderTop:"1px solid var(--border)"},children:[(0,nt.jsx)("input",{value:v,onChange:O=>g(O.target.value),onKeyDown:O=>{O.key==="Enter"&&C()},placeholder:"/perm /plan /slow /exit \u2026",style:{flex:1}}),(0,nt.jsx)("button",{onClick:()=>{C()},children:"\u53D1\u9001"}),(0,nt.jsx)("button",{onClick:()=>{C("steer")},children:"\u63D2\u8BDD"}),(0,nt.jsx)("button",{onClick:()=>{Zr("thread.interrupt",{id:l})},children:"\u6253\u65AD"})]})]})]})}var ki,nt,Zr,mM=ce(()=>{ki=ae(Mt(),1);Pc();Tn();nt=ae(Le(),1),Zr=(e,t)=>te.call(e,t)});var gM,wb,H4,Eb,zf,F4,te,q4,Tn=ce(()=>{Zb();Qb();Jb();e0();t0();gM=ae(SE(),1);EE();wi();NE();Pc();ln();qn();fM();mM();af();wb=ae(Le(),1),H4=kl(),Eb=new URLSearchParams(location.search),zf=Eb.get("theme");TE(location.search);wE(location.search);F4=window.matchMedia?.("(prefers-color-scheme: dark)").matches;document.documentElement.dataset.theme=zf==="light"||zf==="dark"?zf:F4?"dark":"light";te=new kd(H4,Ed());window.__ws=te;window.__stores={useData:lt,useUi:fe,useConnection:ms};Promise.resolve().then(()=>(Cl(),NT)).then(e=>{window.__tl=e.useTimeline});te.onState(e=>ms.getState().set({state:e}));te.connect();te.waitHello().then(async e=>{ms.getState().set({version:e.version??null}),fe.getState().bind(te);try{let t=await te.call("settings.get");if(fe.getState().hydrate(t),!zf){let{applyTheme:i}=await Promise.resolve().then(()=>(iu(),HT));i(t.theme??"auto")}}catch{}await lt.getState().bind(te)});setInterval(()=>te.ping(),1e4);q4=Eb.get("debug")==="1";(0,gM.createRoot)(document.getElementById("root")).render(q4?(0,wb.jsx)(pM,{}):(0,wb.jsx)(dM,{}));Eb.get("audit")==="1"&&setTimeout(()=>{try{let e=window.innerWidth,t=document.documentElement.scrollWidth,i=new Set,n=[],s=0,r=getComputedStyle(document.documentElement).getPropertyValue("--accent").trim(),a=c=>c.top<window.innerHeight&&c.bottom>0&&c.width>0;document.querySelectorAll("*").forEach(c=>{let u=c,h=getComputedStyle(u),d=u.getBoundingClientRect();if(!a(d)||h.display==="none"||h.visibility==="hidden"||d.width<3||d.height<3)return;i.add(h.fontSize),h.borderTopWidth!=="0px"&&h.borderTopStyle!=="none"&&s++,h.borderBottomWidth!=="0px"&&h.borderBottomStyle!=="none"&&s++;let f=h.backgroundColor,p=h.color;if(r&&(f===r||p===r)){let _=(u.getAttribute("class")??"").split(" ")[0];n.includes(_)||n.push(_)}});let o={vw:e,docW:t,noHScroll:t<=e+1,fontSizes:[...i].sort(),bordersFirstScreen:s,accentEls:n},l=document.createElement("pre");l.id="audit",l.style.display="none",l.textContent=JSON.stringify(o),document.body.appendChild(l)}catch(e){let t=document.createElement("pre");t.id="audit",t.textContent=JSON.stringify({error:String(e)}),document.body.appendChild(t)}},1500)});Tn();})();
127
+ /*! Bundled license information:
128
+
129
+ scheduler/cjs/scheduler.production.js:
130
+ (**
131
+ * @license React
132
+ * scheduler.production.js
133
+ *
134
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
135
+ *
136
+ * This source code is licensed under the MIT license found in the
137
+ * LICENSE file in the root directory of this source tree.
138
+ *)
139
+
140
+ react/cjs/react.production.js:
141
+ (**
142
+ * @license React
143
+ * react.production.js
144
+ *
145
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
146
+ *
147
+ * This source code is licensed under the MIT license found in the
148
+ * LICENSE file in the root directory of this source tree.
149
+ *)
150
+
151
+ react-dom/cjs/react-dom.production.js:
152
+ (**
153
+ * @license React
154
+ * react-dom.production.js
155
+ *
156
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
157
+ *
158
+ * This source code is licensed under the MIT license found in the
159
+ * LICENSE file in the root directory of this source tree.
160
+ *)
161
+
162
+ react-dom/cjs/react-dom-client.production.js:
163
+ (**
164
+ * @license React
165
+ * react-dom-client.production.js
166
+ *
167
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
168
+ *
169
+ * This source code is licensed under the MIT license found in the
170
+ * LICENSE file in the root directory of this source tree.
171
+ *)
172
+
173
+ react/cjs/react-jsx-runtime.production.js:
174
+ (**
175
+ * @license React
176
+ * react-jsx-runtime.production.js
177
+ *
178
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
179
+ *
180
+ * This source code is licensed under the MIT license found in the
181
+ * LICENSE file in the root directory of this source tree.
182
+ *)
183
+
184
+ dompurify/dist/purify.es.mjs:
185
+ (*! @license DOMPurify 3.4.17 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.4.17/LICENSE *)
186
+ (*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE *)
187
+
188
+ @xterm/xterm/lib/xterm.mjs:
189
+ @xterm/addon-fit/lib/addon-fit.mjs:
190
+ (**
191
+ * Copyright (c) 2014-2024 The xterm.js authors. All rights reserved.
192
+ * @license MIT
193
+ *
194
+ * Copyright (c) 2012-2013, Christopher Jeffrey (MIT License)
195
+ * @license MIT
196
+ *
197
+ * Originally forked from (with the author's permission):
198
+ * Fabrice Bellard's javascript vt100 for jslinux:
199
+ * http://bellard.org/jslinux/
200
+ * Copyright (c) 2011 Fabrice Bellard
201
+ *)
202
+ */