@dotobokuri/fleet-console 1.5.5 → 1.6.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/AGENTS.md +13 -11
- package/dist/cli-bin.mjs +1566 -495
- package/dist/cli.d.ts +6 -1
- package/dist/cli.mjs +1566 -495
- package/dist/client/assets/{_baseUniq-CpEjig2A.js → _baseUniq-CYDnUUwD.js} +1 -1
- package/dist/client/assets/{arc-BmymS_Kz.js → arc-C2kUi1S_.js} +1 -1
- package/dist/client/assets/{architectureDiagram-Q4EWVU46-D1d0KVz1.js → architectureDiagram-Q4EWVU46-CsfgL2zC.js} +1 -1
- package/dist/client/assets/{blockDiagram-DXYQGD6D-Cwuv0sNk.js → blockDiagram-DXYQGD6D-uqim2Pmo.js} +1 -1
- package/dist/client/assets/{c4Diagram-AHTNJAMY-Bsk-GjC_.js → c4Diagram-AHTNJAMY-CRz88GqP.js} +1 -1
- package/dist/client/assets/channel-BDggAVtM.js +1 -0
- package/dist/client/assets/{chunk-4BX2VUAB-ZM4i9T4D.js → chunk-4BX2VUAB-DNgf85a7.js} +1 -1
- package/dist/client/assets/{chunk-4TB4RGXK-Sw5ODKRj.js → chunk-4TB4RGXK-Ds39jFtV.js} +1 -1
- package/dist/client/assets/{chunk-55IACEB6-DDDLwVg4.js → chunk-55IACEB6-Bv7hCHgD.js} +1 -1
- package/dist/client/assets/{chunk-EDXVE4YY-BNk5Xk1Q.js → chunk-EDXVE4YY-BUjgWLOR.js} +1 -1
- package/dist/client/assets/{chunk-FMBD7UC4-C_CC6grw.js → chunk-FMBD7UC4-WVMeE3Je.js} +1 -1
- package/dist/client/assets/{chunk-OYMX7WX6-DTbaYVUc.js → chunk-OYMX7WX6-Bd5Z4NNL.js} +1 -1
- package/dist/client/assets/{chunk-QZHKN3VN-i7z9jXPR.js → chunk-QZHKN3VN-BfIbGoT4.js} +1 -1
- package/dist/client/assets/{chunk-YZCP3GAM-cTSeZOtz.js → chunk-YZCP3GAM-T_CDhFqg.js} +1 -1
- package/dist/client/assets/classDiagram-6PBFFD2Q-AVod154E.js +1 -0
- package/dist/client/assets/classDiagram-v2-HSJHXN6E-AVod154E.js +1 -0
- package/dist/client/assets/clone-DMJcvMWj.js +1 -0
- package/dist/client/assets/{cose-bilkent-S5V4N54A-uVW4wTRq.js → cose-bilkent-S5V4N54A-M6EvTH7M.js} +1 -1
- package/dist/client/assets/{dagre-KV5264BT-CclQ97X6.js → dagre-KV5264BT-UUCScvPY.js} +1 -1
- package/dist/client/assets/{diagram-5BDNPKRD-eZaXK0Xj.js → diagram-5BDNPKRD-BnmEvwtB.js} +1 -1
- package/dist/client/assets/{diagram-G4DWMVQ6-DIQ8qOFv.js → diagram-G4DWMVQ6-QHdTQz1G.js} +1 -1
- package/dist/client/assets/{diagram-MMDJMWI5-B_EbeR8B.js → diagram-MMDJMWI5-B-4tZ6wC.js} +1 -1
- package/dist/client/assets/{diagram-TYMM5635-DI64qX-Y.js → diagram-TYMM5635-D5KVosUo.js} +1 -1
- package/dist/client/assets/{erDiagram-SMLLAGMA-DLkwbOsk.js → erDiagram-SMLLAGMA-B-FwpOjI.js} +1 -1
- package/dist/client/assets/{flowDiagram-DWJPFMVM-BWvMzejD.js → flowDiagram-DWJPFMVM-CO00mjhm.js} +1 -1
- package/dist/client/assets/fraunces-latin-ext-standard-italic-CGbN9UgK.woff2 +0 -0
- package/dist/client/assets/fraunces-latin-standard-italic-lSdLDfvT.woff2 +0 -0
- package/dist/client/assets/fraunces-vietnamese-standard-italic-DxWqP7Ku.woff2 +0 -0
- package/dist/client/assets/{ganttDiagram-T4ZO3ILL-B4qUxmRl.js → ganttDiagram-T4ZO3ILL-ChcRAmXN.js} +1 -1
- package/dist/client/assets/{gitGraphDiagram-UUTBAWPF-CnvcLURP.js → gitGraphDiagram-UUTBAWPF-BWSq2uT3.js} +1 -1
- package/dist/client/assets/{graph-N4oFFLXe.js → graph-mErvxWG_.js} +1 -1
- package/dist/client/assets/index-B4QPttGw.css +1 -0
- package/dist/client/assets/index-GN6Lp6Jj.js +734 -0
- package/dist/client/assets/{infoDiagram-42DDH7IO-3uxP8aX_.js → infoDiagram-42DDH7IO-CchQFIPi.js} +1 -1
- package/dist/client/assets/{ishikawaDiagram-UXIWVN3A-DQomHvSO.js → ishikawaDiagram-UXIWVN3A-BAsF6BnZ.js} +1 -1
- package/dist/client/assets/{journeyDiagram-VCZTEJTY-C_Ogwo77.js → journeyDiagram-VCZTEJTY-DE0wiQxC.js} +1 -1
- package/dist/client/assets/{kanban-definition-6JOO6SKY-CGOeur5D.js → kanban-definition-6JOO6SKY-BzPJLpKw.js} +1 -1
- package/dist/client/assets/{layout-DKlBkSB9.js → layout-CO0unZG0.js} +1 -1
- package/dist/client/assets/{linear-2pQUtBdp.js → linear-CkDoVGz5.js} +1 -1
- package/dist/client/assets/{mermaid.core-BrseLPLb.js → mermaid.core-BWqsf-WS.js} +4 -4
- package/dist/client/assets/{min-OFtHLPyF.js → min-BMb-G34C.js} +1 -1
- package/dist/client/assets/{mindmap-definition-QFDTVHPH-DQk9T3wA.js → mindmap-definition-QFDTVHPH-XVxnUTPw.js} +1 -1
- package/dist/client/assets/{pieDiagram-DEJITSTG-Btu4aJWj.js → pieDiagram-DEJITSTG-CKM6Cfhz.js} +1 -1
- package/dist/client/assets/{quadrantDiagram-34T5L4WZ-BHMDVip9.js → quadrantDiagram-34T5L4WZ-Dn_2AZqA.js} +1 -1
- package/dist/client/assets/{requirementDiagram-MS252O5E-CbXi80dX.js → requirementDiagram-MS252O5E-uNgGGE60.js} +1 -1
- package/dist/client/assets/{sankeyDiagram-XADWPNL6-D5c7vUw4.js → sankeyDiagram-XADWPNL6-B75Ahck1.js} +1 -1
- package/dist/client/assets/{sequenceDiagram-FGHM5R23-CGuRanG_.js → sequenceDiagram-FGHM5R23-Cw5UNG2_.js} +1 -1
- package/dist/client/assets/{stateDiagram-FHFEXIEX-CVD3CB69.js → stateDiagram-FHFEXIEX-C6u6py_B.js} +1 -1
- package/dist/client/assets/stateDiagram-v2-QKLJ7IA2-BMBsbsoy.js +1 -0
- package/dist/client/assets/{timeline-definition-GMOUNBTQ-DMTeeglq.js → timeline-definition-GMOUNBTQ-Bi50wA17.js} +1 -1
- package/dist/client/assets/{vennDiagram-DHZGUBPP-CQ6TwRhb.js → vennDiagram-DHZGUBPP-CufQGlDN.js} +1 -1
- package/dist/client/assets/{wardley-RL74JXVD-DdgusU4o.js → wardley-RL74JXVD-BQLghHpH.js} +1 -1
- package/dist/client/assets/{wardleyDiagram-NUSXRM2D-BFsWqK49.js → wardleyDiagram-NUSXRM2D-C-_4o-CK.js} +1 -1
- package/dist/client/assets/{xychartDiagram-5P7HB3ND-Hca3jUV6.js → xychartDiagram-5P7HB3ND-e4ekvSc7.js} +1 -1
- package/dist/client/index.html +2 -2
- package/package.json +1 -1
- package/dist/client/assets/channel--qpYuR58.js +0 -1
- package/dist/client/assets/classDiagram-6PBFFD2Q-BAI-fNQ3.js +0 -1
- package/dist/client/assets/classDiagram-v2-HSJHXN6E-BAI-fNQ3.js +0 -1
- package/dist/client/assets/clone-CqNqlAzp.js +0 -1
- package/dist/client/assets/index-DfJLxHX8.js +0 -734
- package/dist/client/assets/index-uNbiLDxs.css +0 -1
- package/dist/client/assets/stateDiagram-v2-QKLJ7IA2-BevvDvg0.js +0 -1
|
@@ -0,0 +1,734 @@
|
|
|
1
|
+
(function(){const i=document.createElement("link").relList;if(i&&i.supports&&i.supports("modulepreload"))return;for(const l of document.querySelectorAll('link[rel="modulepreload"]'))a(l);new MutationObserver(l=>{for(const v of l)if(v.type==="childList")for(const m of v.addedNodes)m.tagName==="LINK"&&m.rel==="modulepreload"&&a(m)}).observe(document,{childList:!0,subtree:!0});function r(l){const v={};return l.integrity&&(v.integrity=l.integrity),l.referrerPolicy&&(v.referrerPolicy=l.referrerPolicy),l.crossOrigin==="use-credentials"?v.credentials="include":l.crossOrigin==="anonymous"?v.credentials="omit":v.credentials="same-origin",v}function a(l){if(l.ep)return;l.ep=!0;const v=r(l);fetch(l.href,v)}})();function zw(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function R4(t){if(Object.prototype.hasOwnProperty.call(t,"__esModule"))return t;var i=t.default;if(typeof i=="function"){var r=function a(){var l=!1;try{l=this instanceof a}catch{}return l?Reflect.construct(i,arguments,this.constructor):i.apply(this,arguments)};r.prototype=i.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(t).forEach(function(a){var l=Object.getOwnPropertyDescriptor(t,a);Object.defineProperty(r,a,l.get?l:{enumerable:!0,get:function(){return t[a]}})}),r}var qd={exports:{}},Yo={};var Kv;function $w(){if(Kv)return Yo;Kv=1;var t=Symbol.for("react.transitional.element"),i=Symbol.for("react.fragment");function r(a,l,v){var m=null;if(v!==void 0&&(m=""+v),l.key!==void 0&&(m=""+l.key),"key"in l){v={};for(var c in l)c!=="key"&&(v[c]=l[c])}else v=l;return l=v.ref,{$$typeof:t,type:a,key:m,ref:l!==void 0?l:null,props:v}}return Yo.Fragment=i,Yo.jsx=r,Yo.jsxs=r,Yo}var Yv;function Hw(){return Yv||(Yv=1,qd.exports=$w()),qd.exports}var T=Hw(),Wd={exports:{}},Ue={};var Vv;function Uw(){if(Vv)return Ue;Vv=1;var t=Symbol.for("react.transitional.element"),i=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),a=Symbol.for("react.strict_mode"),l=Symbol.for("react.profiler"),v=Symbol.for("react.consumer"),m=Symbol.for("react.context"),c=Symbol.for("react.forward_ref"),u=Symbol.for("react.suspense"),h=Symbol.for("react.memo"),b=Symbol.for("react.lazy"),p=Symbol.for("react.activity"),C=Symbol.iterator;function w(O){return O===null||typeof O!="object"?null:(O=C&&O[C]||O["@@iterator"],typeof O=="function"?O:null)}var A={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},x=Object.assign,g={};function y(O,H,X){this.props=O,this.context=H,this.refs=g,this.updater=X||A}y.prototype.isReactComponent={},y.prototype.setState=function(O,H){if(typeof O!="object"&&typeof O!="function"&&O!=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,O,H,"setState")},y.prototype.forceUpdate=function(O){this.updater.enqueueForceUpdate(this,O,"forceUpdate")};function f(){}f.prototype=y.prototype;function _(O,H,X){this.props=O,this.context=H,this.refs=g,this.updater=X||A}var E=_.prototype=new f;E.constructor=_,x(E,y.prototype),E.isPureReactComponent=!0;var L=Array.isArray;function R(){}var D={H:null,A:null,T:null,S:null},k=Object.prototype.hasOwnProperty;function N(O,H,X){var ae=X.ref;return{$$typeof:t,type:O,key:H,ref:ae!==void 0?ae:null,props:X}}function W(O,H){return N(O.type,H,O.props)}function U(O){return typeof O=="object"&&O!==null&&O.$$typeof===t}function F(O){var H={"=":"=0",":":"=2"};return"$"+O.replace(/[=:]/g,function(X){return H[X]})}var j=/\/+/g;function J(O,H){return typeof O=="object"&&O!==null&&O.key!=null?F(""+O.key):H.toString(36)}function te(O){switch(O.status){case"fulfilled":return O.value;case"rejected":throw O.reason;default:switch(typeof O.status=="string"?O.then(R,R):(O.status="pending",O.then(function(H){O.status==="pending"&&(O.status="fulfilled",O.value=H)},function(H){O.status==="pending"&&(O.status="rejected",O.reason=H)})),O.status){case"fulfilled":return O.value;case"rejected":throw O.reason}}throw O}function P(O,H,X,ae,ce){var _e=typeof O;(_e==="undefined"||_e==="boolean")&&(O=null);var Q=!1;if(O===null)Q=!0;else switch(_e){case"bigint":case"string":case"number":Q=!0;break;case"object":switch(O.$$typeof){case t:case i:Q=!0;break;case b:return Q=O._init,P(Q(O._payload),H,X,ae,ce)}}if(Q)return ce=ce(O),Q=ae===""?"."+J(O,0):ae,L(ce)?(X="",Q!=null&&(X=Q.replace(j,"$&/")+"/"),P(ce,H,X,"",function(ge){return ge})):ce!=null&&(U(ce)&&(ce=W(ce,X+(ce.key==null||O&&O.key===ce.key?"":(""+ce.key).replace(j,"$&/")+"/")+Q)),H.push(ce)),1;Q=0;var $=ae===""?".":ae+":";if(L(O))for(var oe=0;oe<O.length;oe++)ae=O[oe],_e=$+J(ae,oe),Q+=P(ae,H,X,_e,ce);else if(oe=w(O),typeof oe=="function")for(O=oe.call(O),oe=0;!(ae=O.next()).done;)ae=ae.value,_e=$+J(ae,oe++),Q+=P(ae,H,X,_e,ce);else if(_e==="object"){if(typeof O.then=="function")return P(te(O),H,X,ae,ce);throw H=String(O),Error("Objects are not valid as a React child (found: "+(H==="[object Object]"?"object with keys {"+Object.keys(O).join(", ")+"}":H)+"). If you meant to render a collection of children, use an array instead.")}return Q}function V(O,H,X){if(O==null)return O;var ae=[],ce=0;return P(O,ae,"","",function(_e){return H.call(X,_e,ce++)}),ae}function Y(O){if(O._status===-1){var H=O._result;H=H(),H.then(function(X){(O._status===0||O._status===-1)&&(O._status=1,O._result=X)},function(X){(O._status===0||O._status===-1)&&(O._status=2,O._result=X)}),O._status===-1&&(O._status=0,O._result=H)}if(O._status===1)return O._result.default;throw O._result}var B=typeof reportError=="function"?reportError:function(O){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var H=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof O=="object"&&O!==null&&typeof O.message=="string"?String(O.message):String(O),error:O});if(!window.dispatchEvent(H))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",O);return}console.error(O)},z={map:V,forEach:function(O,H,X){V(O,function(){H.apply(this,arguments)},X)},count:function(O){var H=0;return V(O,function(){H++}),H},toArray:function(O){return V(O,function(H){return H})||[]},only:function(O){if(!U(O))throw Error("React.Children.only expected to receive a single React element child.");return O}};return Ue.Activity=p,Ue.Children=z,Ue.Component=y,Ue.Fragment=r,Ue.Profiler=l,Ue.PureComponent=_,Ue.StrictMode=a,Ue.Suspense=u,Ue.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=D,Ue.__COMPILER_RUNTIME={__proto__:null,c:function(O){return D.H.useMemoCache(O)}},Ue.cache=function(O){return function(){return O.apply(null,arguments)}},Ue.cacheSignal=function(){return null},Ue.cloneElement=function(O,H,X){if(O==null)throw Error("The argument must be a React element, but you passed "+O+".");var ae=x({},O.props),ce=O.key;if(H!=null)for(_e in H.key!==void 0&&(ce=""+H.key),H)!k.call(H,_e)||_e==="key"||_e==="__self"||_e==="__source"||_e==="ref"&&H.ref===void 0||(ae[_e]=H[_e]);var _e=arguments.length-2;if(_e===1)ae.children=X;else if(1<_e){for(var Q=Array(_e),$=0;$<_e;$++)Q[$]=arguments[$+2];ae.children=Q}return N(O.type,ce,ae)},Ue.createContext=function(O){return O={$$typeof:m,_currentValue:O,_currentValue2:O,_threadCount:0,Provider:null,Consumer:null},O.Provider=O,O.Consumer={$$typeof:v,_context:O},O},Ue.createElement=function(O,H,X){var ae,ce={},_e=null;if(H!=null)for(ae in H.key!==void 0&&(_e=""+H.key),H)k.call(H,ae)&&ae!=="key"&&ae!=="__self"&&ae!=="__source"&&(ce[ae]=H[ae]);var Q=arguments.length-2;if(Q===1)ce.children=X;else if(1<Q){for(var $=Array(Q),oe=0;oe<Q;oe++)$[oe]=arguments[oe+2];ce.children=$}if(O&&O.defaultProps)for(ae in Q=O.defaultProps,Q)ce[ae]===void 0&&(ce[ae]=Q[ae]);return N(O,_e,ce)},Ue.createRef=function(){return{current:null}},Ue.forwardRef=function(O){return{$$typeof:c,render:O}},Ue.isValidElement=U,Ue.lazy=function(O){return{$$typeof:b,_payload:{_status:-1,_result:O},_init:Y}},Ue.memo=function(O,H){return{$$typeof:h,type:O,compare:H===void 0?null:H}},Ue.startTransition=function(O){var H=D.T,X={};D.T=X;try{var ae=O(),ce=D.S;ce!==null&&ce(X,ae),typeof ae=="object"&&ae!==null&&typeof ae.then=="function"&&ae.then(R,B)}catch(_e){B(_e)}finally{H!==null&&X.types!==null&&(H.types=X.types),D.T=H}},Ue.unstable_useCacheRefresh=function(){return D.H.useCacheRefresh()},Ue.use=function(O){return D.H.use(O)},Ue.useActionState=function(O,H,X){return D.H.useActionState(O,H,X)},Ue.useCallback=function(O,H){return D.H.useCallback(O,H)},Ue.useContext=function(O){return D.H.useContext(O)},Ue.useDebugValue=function(){},Ue.useDeferredValue=function(O,H){return D.H.useDeferredValue(O,H)},Ue.useEffect=function(O,H){return D.H.useEffect(O,H)},Ue.useEffectEvent=function(O){return D.H.useEffectEvent(O)},Ue.useId=function(){return D.H.useId()},Ue.useImperativeHandle=function(O,H,X){return D.H.useImperativeHandle(O,H,X)},Ue.useInsertionEffect=function(O,H){return D.H.useInsertionEffect(O,H)},Ue.useLayoutEffect=function(O,H){return D.H.useLayoutEffect(O,H)},Ue.useMemo=function(O,H){return D.H.useMemo(O,H)},Ue.useOptimistic=function(O,H){return D.H.useOptimistic(O,H)},Ue.useReducer=function(O,H,X){return D.H.useReducer(O,H,X)},Ue.useRef=function(O){return D.H.useRef(O)},Ue.useState=function(O){return D.H.useState(O)},Ue.useSyncExternalStore=function(O,H,X){return D.H.useSyncExternalStore(O,H,X)},Ue.useTransition=function(){return D.H.useTransition()},Ue.version="19.2.7",Ue}var Xv;function wp(){return Xv||(Xv=1,Wd.exports=Uw()),Wd.exports}var q=wp(),Gd={exports:{}},Vo={},Kd={exports:{}},Yd={};var Zv;function Pw(){return Zv||(Zv=1,(function(t){function i(P,V){var Y=P.length;P.push(V);e:for(;0<Y;){var B=Y-1>>>1,z=P[B];if(0<l(z,V))P[B]=V,P[Y]=z,Y=B;else break e}}function r(P){return P.length===0?null:P[0]}function a(P){if(P.length===0)return null;var V=P[0],Y=P.pop();if(Y!==V){P[0]=Y;e:for(var B=0,z=P.length,O=z>>>1;B<O;){var H=2*(B+1)-1,X=P[H],ae=H+1,ce=P[ae];if(0>l(X,Y))ae<z&&0>l(ce,X)?(P[B]=ce,P[ae]=Y,B=ae):(P[B]=X,P[H]=Y,B=H);else if(ae<z&&0>l(ce,Y))P[B]=ce,P[ae]=Y,B=ae;else break e}}return V}function l(P,V){var Y=P.sortIndex-V.sortIndex;return Y!==0?Y:P.id-V.id}if(t.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var v=performance;t.unstable_now=function(){return v.now()}}else{var m=Date,c=m.now();t.unstable_now=function(){return m.now()-c}}var u=[],h=[],b=1,p=null,C=3,w=!1,A=!1,x=!1,g=!1,y=typeof setTimeout=="function"?setTimeout:null,f=typeof clearTimeout=="function"?clearTimeout:null,_=typeof setImmediate<"u"?setImmediate:null;function E(P){for(var V=r(h);V!==null;){if(V.callback===null)a(h);else if(V.startTime<=P)a(h),V.sortIndex=V.expirationTime,i(u,V);else break;V=r(h)}}function L(P){if(x=!1,E(P),!A)if(r(u)!==null)A=!0,R||(R=!0,F());else{var V=r(h);V!==null&&te(L,V.startTime-P)}}var R=!1,D=-1,k=5,N=-1;function W(){return g?!0:!(t.unstable_now()-N<k)}function U(){if(g=!1,R){var P=t.unstable_now();N=P;var V=!0;try{e:{A=!1,x&&(x=!1,f(D),D=-1),w=!0;var Y=C;try{t:{for(E(P),p=r(u);p!==null&&!(p.expirationTime>P&&W());){var B=p.callback;if(typeof B=="function"){p.callback=null,C=p.priorityLevel;var z=B(p.expirationTime<=P);if(P=t.unstable_now(),typeof z=="function"){p.callback=z,E(P),V=!0;break t}p===r(u)&&a(u),E(P)}else a(u);p=r(u)}if(p!==null)V=!0;else{var O=r(h);O!==null&&te(L,O.startTime-P),V=!1}}break e}finally{p=null,C=Y,w=!1}V=void 0}}finally{V?F():R=!1}}}var F;if(typeof _=="function")F=function(){_(U)};else if(typeof MessageChannel<"u"){var j=new MessageChannel,J=j.port2;j.port1.onmessage=U,F=function(){J.postMessage(null)}}else F=function(){y(U,0)};function te(P,V){D=y(function(){P(t.unstable_now())},V)}t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(P){P.callback=null},t.unstable_forceFrameRate=function(P){0>P||125<P?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):k=0<P?Math.floor(1e3/P):5},t.unstable_getCurrentPriorityLevel=function(){return C},t.unstable_next=function(P){switch(C){case 1:case 2:case 3:var V=3;break;default:V=C}var Y=C;C=V;try{return P()}finally{C=Y}},t.unstable_requestPaint=function(){g=!0},t.unstable_runWithPriority=function(P,V){switch(P){case 1:case 2:case 3:case 4:case 5:break;default:P=3}var Y=C;C=P;try{return V()}finally{C=Y}},t.unstable_scheduleCallback=function(P,V,Y){var B=t.unstable_now();switch(typeof Y=="object"&&Y!==null?(Y=Y.delay,Y=typeof Y=="number"&&0<Y?B+Y:B):Y=B,P){case 1:var z=-1;break;case 2:z=250;break;case 5:z=1073741823;break;case 4:z=1e4;break;default:z=5e3}return z=Y+z,P={id:b++,callback:V,priorityLevel:P,startTime:Y,expirationTime:z,sortIndex:-1},Y>B?(P.sortIndex=Y,i(h,P),r(u)===null&&P===r(h)&&(x?(f(D),D=-1):x=!0,te(L,Y-B))):(P.sortIndex=z,i(u,P),A||w||(A=!0,R||(R=!0,F()))),P},t.unstable_shouldYield=W,t.unstable_wrapCallback=function(P){var V=C;return function(){var Y=C;C=V;try{return P.apply(this,arguments)}finally{C=Y}}}})(Yd)),Yd}var Jv;function Fw(){return Jv||(Jv=1,Kd.exports=Pw()),Kd.exports}var Vd={exports:{}},Li={};var Qv;function qw(){if(Qv)return Li;Qv=1;var t=wp();function i(u){var h="https://react.dev/errors/"+u;if(1<arguments.length){h+="?args[]="+encodeURIComponent(arguments[1]);for(var b=2;b<arguments.length;b++)h+="&args[]="+encodeURIComponent(arguments[b])}return"Minified React error #"+u+"; visit "+h+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function r(){}var a={d:{f:r,r:function(){throw Error(i(522))},D:r,C:r,L:r,m:r,X:r,S:r,M:r},p:0,findDOMNode:null},l=Symbol.for("react.portal");function v(u,h,b){var p=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:l,key:p==null?null:""+p,children:u,containerInfo:h,implementation:b}}var m=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function c(u,h){if(u==="font")return"";if(typeof h=="string")return h==="use-credentials"?h:""}return Li.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=a,Li.createPortal=function(u,h){var b=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!h||h.nodeType!==1&&h.nodeType!==9&&h.nodeType!==11)throw Error(i(299));return v(u,h,null,b)},Li.flushSync=function(u){var h=m.T,b=a.p;try{if(m.T=null,a.p=2,u)return u()}finally{m.T=h,a.p=b,a.d.f()}},Li.preconnect=function(u,h){typeof u=="string"&&(h?(h=h.crossOrigin,h=typeof h=="string"?h==="use-credentials"?h:"":void 0):h=null,a.d.C(u,h))},Li.prefetchDNS=function(u){typeof u=="string"&&a.d.D(u)},Li.preinit=function(u,h){if(typeof u=="string"&&h&&typeof h.as=="string"){var b=h.as,p=c(b,h.crossOrigin),C=typeof h.integrity=="string"?h.integrity:void 0,w=typeof h.fetchPriority=="string"?h.fetchPriority:void 0;b==="style"?a.d.S(u,typeof h.precedence=="string"?h.precedence:void 0,{crossOrigin:p,integrity:C,fetchPriority:w}):b==="script"&&a.d.X(u,{crossOrigin:p,integrity:C,fetchPriority:w,nonce:typeof h.nonce=="string"?h.nonce:void 0})}},Li.preinitModule=function(u,h){if(typeof u=="string")if(typeof h=="object"&&h!==null){if(h.as==null||h.as==="script"){var b=c(h.as,h.crossOrigin);a.d.M(u,{crossOrigin:b,integrity:typeof h.integrity=="string"?h.integrity:void 0,nonce:typeof h.nonce=="string"?h.nonce:void 0})}}else h==null&&a.d.M(u)},Li.preload=function(u,h){if(typeof u=="string"&&typeof h=="object"&&h!==null&&typeof h.as=="string"){var b=h.as,p=c(b,h.crossOrigin);a.d.L(u,b,{crossOrigin:p,integrity:typeof h.integrity=="string"?h.integrity:void 0,nonce:typeof h.nonce=="string"?h.nonce:void 0,type:typeof h.type=="string"?h.type:void 0,fetchPriority:typeof h.fetchPriority=="string"?h.fetchPriority:void 0,referrerPolicy:typeof h.referrerPolicy=="string"?h.referrerPolicy:void 0,imageSrcSet:typeof h.imageSrcSet=="string"?h.imageSrcSet:void 0,imageSizes:typeof h.imageSizes=="string"?h.imageSizes:void 0,media:typeof h.media=="string"?h.media:void 0})}},Li.preloadModule=function(u,h){if(typeof u=="string")if(h){var b=c(h.as,h.crossOrigin);a.d.m(u,{as:typeof h.as=="string"&&h.as!=="script"?h.as:void 0,crossOrigin:b,integrity:typeof h.integrity=="string"?h.integrity:void 0})}else a.d.m(u)},Li.requestFormReset=function(u){a.d.r(u)},Li.unstable_batchedUpdates=function(u,h){return u(h)},Li.useFormState=function(u,h,b){return m.H.useFormState(u,h,b)},Li.useFormStatus=function(){return m.H.useHostTransitionStatus()},Li.version="19.2.7",Li}var e0;function Ww(){if(e0)return Vd.exports;e0=1;function t(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(i){console.error(i)}}return t(),Vd.exports=qw(),Vd.exports}var t0;function Gw(){if(t0)return Vo;t0=1;var t=Fw(),i=wp(),r=Ww();function a(e){var n="https://react.dev/errors/"+e;if(1<arguments.length){n+="?args[]="+encodeURIComponent(arguments[1]);for(var s=2;s<arguments.length;s++)n+="&args[]="+encodeURIComponent(arguments[s])}return"Minified React error #"+e+"; visit "+n+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function l(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function v(e){var n=e,s=e;if(e.alternate)for(;n.return;)n=n.return;else{e=n;do n=e,(n.flags&4098)!==0&&(s=n.return),e=n.return;while(e)}return n.tag===3?s:null}function m(e){if(e.tag===13){var n=e.memoizedState;if(n===null&&(e=e.alternate,e!==null&&(n=e.memoizedState)),n!==null)return n.dehydrated}return null}function c(e){if(e.tag===31){var n=e.memoizedState;if(n===null&&(e=e.alternate,e!==null&&(n=e.memoizedState)),n!==null)return n.dehydrated}return null}function u(e){if(v(e)!==e)throw Error(a(188))}function h(e){var n=e.alternate;if(!n){if(n=v(e),n===null)throw Error(a(188));return n!==e?null:e}for(var s=e,o=n;;){var d=s.return;if(d===null)break;var S=d.alternate;if(S===null){if(o=d.return,o!==null){s=o;continue}break}if(d.child===S.child){for(S=d.child;S;){if(S===s)return u(d),e;if(S===o)return u(d),n;S=S.sibling}throw Error(a(188))}if(s.return!==o.return)s=d,o=S;else{for(var M=!1,I=d.child;I;){if(I===s){M=!0,s=d,o=S;break}if(I===o){M=!0,o=d,s=S;break}I=I.sibling}if(!M){for(I=S.child;I;){if(I===s){M=!0,s=S,o=d;break}if(I===o){M=!0,o=S,s=d;break}I=I.sibling}if(!M)throw Error(a(189))}}if(s.alternate!==o)throw Error(a(190))}if(s.tag!==3)throw Error(a(188));return s.stateNode.current===s?e:n}function b(e){var n=e.tag;if(n===5||n===26||n===27||n===6)return e;for(e=e.child;e!==null;){if(n=b(e),n!==null)return n;e=e.sibling}return null}var p=Object.assign,C=Symbol.for("react.element"),w=Symbol.for("react.transitional.element"),A=Symbol.for("react.portal"),x=Symbol.for("react.fragment"),g=Symbol.for("react.strict_mode"),y=Symbol.for("react.profiler"),f=Symbol.for("react.consumer"),_=Symbol.for("react.context"),E=Symbol.for("react.forward_ref"),L=Symbol.for("react.suspense"),R=Symbol.for("react.suspense_list"),D=Symbol.for("react.memo"),k=Symbol.for("react.lazy"),N=Symbol.for("react.activity"),W=Symbol.for("react.memo_cache_sentinel"),U=Symbol.iterator;function F(e){return e===null||typeof e!="object"?null:(e=U&&e[U]||e["@@iterator"],typeof e=="function"?e:null)}var j=Symbol.for("react.client.reference");function J(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===j?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case x:return"Fragment";case y:return"Profiler";case g:return"StrictMode";case L:return"Suspense";case R:return"SuspenseList";case N:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case A:return"Portal";case _:return e.displayName||"Context";case f:return(e._context.displayName||"Context")+".Consumer";case E:var n=e.render;return e=e.displayName,e||(e=n.displayName||n.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case D:return n=e.displayName||null,n!==null?n:J(e.type)||"Memo";case k:n=e._payload,e=e._init;try{return J(e(n))}catch{}}return null}var te=Array.isArray,P=i.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,V=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Y={pending:!1,data:null,method:null,action:null},B=[],z=-1;function O(e){return{current:e}}function H(e){0>z||(e.current=B[z],B[z]=null,z--)}function X(e,n){z++,B[z]=e.current,e.current=n}var ae=O(null),ce=O(null),_e=O(null),Q=O(null);function $(e,n){switch(X(_e,n),X(ce,e),X(ae,null),n.nodeType){case 9:case 11:e=(e=n.documentElement)&&(e=e.namespaceURI)?mv(e):0;break;default:if(e=n.tagName,n=n.namespaceURI)n=mv(n),e=_v(n,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}H(ae),X(ae,e)}function oe(){H(ae),H(ce),H(_e)}function ge(e){e.memoizedState!==null&&X(Q,e);var n=ae.current,s=_v(n,e.type);n!==s&&(X(ce,e),X(ae,s))}function ye(e){ce.current===e&&(H(ae),H(ce)),Q.current===e&&(H(Q),qo._currentValue=Y)}var be,$e;function Pe(e){if(be===void 0)try{throw Error()}catch(s){var n=s.stack.trim().match(/\n( *(at )?)/);be=n&&n[1]||"",$e=-1<s.stack.indexOf(`
|
|
2
|
+
at`)?" (<anonymous>)":-1<s.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
3
|
+
`+be+e+$e}var Ye=!1;function Ct(e,n){if(!e||Ye)return"";Ye=!0;var s=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var o={DetermineComponentFrameRoot:function(){try{if(n){var fe=function(){throw Error()};if(Object.defineProperty(fe.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(fe,[])}catch(le){var se=le}Reflect.construct(e,[],fe)}else{try{fe.call()}catch(le){se=le}e.call(fe.prototype)}}else{try{throw Error()}catch(le){se=le}(fe=e())&&typeof fe.catch=="function"&&fe.catch(function(){})}}catch(le){if(le&&se&&typeof le.stack=="string")return[le.stack,se.stack]}return[null,null]}};o.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var d=Object.getOwnPropertyDescriptor(o.DetermineComponentFrameRoot,"name");d&&d.configurable&&Object.defineProperty(o.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var S=o.DetermineComponentFrameRoot(),M=S[0],I=S[1];if(M&&I){var K=M.split(`
|
|
4
|
+
`),re=I.split(`
|
|
5
|
+
`);for(d=o=0;o<K.length&&!K[o].includes("DetermineComponentFrameRoot");)o++;for(;d<re.length&&!re[d].includes("DetermineComponentFrameRoot");)d++;if(o===K.length||d===re.length)for(o=K.length-1,d=re.length-1;1<=o&&0<=d&&K[o]!==re[d];)d--;for(;1<=o&&0<=d;o--,d--)if(K[o]!==re[d]){if(o!==1||d!==1)do if(o--,d--,0>d||K[o]!==re[d]){var ue=`
|
|
6
|
+
`+K[o].replace(" at new "," at ");return e.displayName&&ue.includes("<anonymous>")&&(ue=ue.replace("<anonymous>",e.displayName)),ue}while(1<=o&&0<=d);break}}}finally{Ye=!1,Error.prepareStackTrace=s}return(s=e?e.displayName||e.name:"")?Pe(s):""}function Be(e,n){switch(e.tag){case 26:case 27:case 5:return Pe(e.type);case 16:return Pe("Lazy");case 13:return e.child!==n&&n!==null?Pe("Suspense Fallback"):Pe("Suspense");case 19:return Pe("SuspenseList");case 0:case 15:return Ct(e.type,!1);case 11:return Ct(e.type.render,!1);case 1:return Ct(e.type,!0);case 31:return Pe("Activity");default:return""}}function Qt(e){try{var n="",s=null;do n+=Be(e,s),s=e,e=e.return;while(e);return n}catch(o){return`
|
|
7
|
+
Error generating stack: `+o.message+`
|
|
8
|
+
`+o.stack}}var _i=Object.prototype.hasOwnProperty,vi=t.unstable_scheduleCallback,fn=t.unstable_cancelCallback,Rn=t.unstable_shouldYield,ei=t.unstable_requestPaint,ct=t.unstable_now,Kt=t.unstable_getCurrentPriorityLevel,jt=t.unstable_ImmediatePriority,zt=t.unstable_UserBlockingPriority,ti=t.unstable_NormalPriority,Ln=t.unstable_LowPriority,ki=t.unstable_IdlePriority,en=t.log,ht=t.unstable_setDisableYieldValue,zi=null,Yt=null;function Vt(e){if(typeof en=="function"&&ht(e),Yt&&typeof Yt.setStrictMode=="function")try{Yt.setStrictMode(zi,e)}catch{}}var $t=Math.clz32?Math.clz32:Js,vs=Math.log,rr=Math.LN2;function Js(e){return e>>>=0,e===0?32:31-(vs(e)/rr|0)|0}var Mn=256,Fn=262144,sr=4194304;function ii(e){var n=e&42;if(n!==0)return n;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&261888;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 Z(e,n,s){var o=e.pendingLanes;if(o===0)return 0;var d=0,S=e.suspendedLanes,M=e.pingedLanes;e=e.warmLanes;var I=o&134217727;return I!==0?(o=I&~S,o!==0?d=ii(o):(M&=I,M!==0?d=ii(M):s||(s=I&~e,s!==0&&(d=ii(s))))):(I=o&~S,I!==0?d=ii(I):M!==0?d=ii(M):s||(s=o&~e,s!==0&&(d=ii(s)))),d===0?0:n!==0&&n!==d&&(n&S)===0&&(S=d&-d,s=n&-n,S>=s||S===32&&(s&4194048)!==0)?n:d}function he(e,n){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&n)===0}function ve(e,n){switch(e){case 1:case 2:case 4:case 8:case 64:return n+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 n+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 Ie(){var e=sr;return sr<<=1,(sr&62914560)===0&&(sr=4194304),e}function yt(e){for(var n=[],s=0;31>s;s++)n.push(e);return n}function dt(e,n){e.pendingLanes|=n,n!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function Ee(e,n,s,o,d,S){var M=e.pendingLanes;e.pendingLanes=s,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=s,e.entangledLanes&=s,e.errorRecoveryDisabledLanes&=s,e.shellSuspendCounter=0;var I=e.entanglements,K=e.expirationTimes,re=e.hiddenUpdates;for(s=M&~s;0<s;){var ue=31-$t(s),fe=1<<ue;I[ue]=0,K[ue]=-1;var se=re[ue];if(se!==null)for(re[ue]=null,ue=0;ue<se.length;ue++){var le=se[ue];le!==null&&(le.lane&=-536870913)}s&=~fe}o!==0&&we(e,o,0),S!==0&&d===0&&e.tag!==0&&(e.suspendedLanes|=S&~(M&~n))}function we(e,n,s){e.pendingLanes|=n,e.suspendedLanes&=~n;var o=31-$t(n);e.entangledLanes|=n,e.entanglements[o]=e.entanglements[o]|1073741824|s&261930}function je(e,n){var s=e.entangledLanes|=n;for(e=e.entanglements;s;){var o=31-$t(s),d=1<<o;d&n|e[o]&n&&(e[o]|=n),s&=~d}}function Nt(e,n){var s=n&-n;return s=(s&42)!==0?1:Qe(s),(s&(e.suspendedLanes|n))!==0?0:s}function Qe(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 bi(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function ar(){var e=V.p;return e!==0?e:(e=window.event,e===void 0?32:Hv(e.type))}function or(e,n){var s=V.p;try{return V.p=e,n()}finally{V.p=s}}var $i=Math.random().toString(36).slice(2),Et="__reactFiber$"+$i,wt="__reactProps$"+$i,Dn="__reactContainer$"+$i,Ir="__reactEvents$"+$i,Qs="__reactListeners$"+$i,lr="__reactHandles$"+$i,bs="__reactResources$"+$i,qn="__reactMarker$"+$i;function De(e){delete e[Et],delete e[wt],delete e[Ir],delete e[Qs],delete e[lr]}function G(e){var n=e[Et];if(n)return n;for(var s=e.parentNode;s;){if(n=s[Dn]||s[Et]){if(s=n.alternate,n.child!==null||s!==null&&s.child!==null)for(e=xv(e);e!==null;){if(s=e[Et])return s;e=xv(e)}return n}e=s,s=e.parentNode}return null}function pe(e){if(e=e[Et]||e[Dn]){var n=e.tag;if(n===5||n===6||n===13||n===31||n===26||n===27||n===3)return e}return null}function xe(e){var n=e.tag;if(n===5||n===26||n===27||n===6)return e.stateNode;throw Error(a(33))}function nt(e){var n=e[bs];return n||(n=e[bs]={hoistableStyles:new Map,hoistableScripts:new Map}),n}function Ve(e){e[qn]=!0}var Tt=new Set,Ht={};function Ut(e,n){me(e,n),me(e+"Capture",n)}function me(e,n){for(Ht[e]=n,e=0;e<n.length;e++)Tt.add(n[e])}var Le=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]*$"),Oe={},st={};function Mt(e){return _i.call(st,e)?!0:_i.call(Oe,e)?!1:Le.test(e)?st[e]=!0:(Oe[e]=!0,!1)}function Ri(e,n,s){if(Mt(n))if(s===null)e.removeAttribute(n);else{switch(typeof s){case"undefined":case"function":case"symbol":e.removeAttribute(n);return;case"boolean":var o=n.toLowerCase().slice(0,5);if(o!=="data-"&&o!=="aria-"){e.removeAttribute(n);return}}e.setAttribute(n,""+s)}}function tn(e,n,s){if(s===null)e.removeAttribute(n);else{switch(typeof s){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(n);return}e.setAttribute(n,""+s)}}function Hi(e,n,s,o){if(o===null)e.removeAttribute(s);else{switch(typeof o){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(s);return}e.setAttributeNS(n,s,""+o)}}function xt(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function nn(e){var n=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(n==="checkbox"||n==="radio")}function Ll(e,n,s){var o=Object.getOwnPropertyDescriptor(e.constructor.prototype,n);if(!e.hasOwnProperty(n)&&typeof o<"u"&&typeof o.get=="function"&&typeof o.set=="function"){var d=o.get,S=o.set;return Object.defineProperty(e,n,{configurable:!0,get:function(){return d.call(this)},set:function(M){s=""+M,S.call(this,M)}}),Object.defineProperty(e,n,{enumerable:o.enumerable}),{getValue:function(){return s},setValue:function(M){s=""+M},stopTracking:function(){e._valueTracker=null,delete e[n]}}}}function ea(e){if(!e._valueTracker){var n=nn(e)?"checked":"value";e._valueTracker=Ll(e,n,""+e[n])}}function io(e){if(!e)return!1;var n=e._valueTracker;if(!n)return!0;var s=n.getValue(),o="";return e&&(o=nn(e)?e.checked?"true":"false":e.value),e=o,e!==s?(n.setValue(e),!0):!1}function ta(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}}var Fu=/[\n"\\]/g;function Ui(e){return e.replace(Fu,function(n){return"\\"+n.charCodeAt(0).toString(16)+" "})}function no(e,n,s,o,d,S,M,I){e.name="",M!=null&&typeof M!="function"&&typeof M!="symbol"&&typeof M!="boolean"?e.type=M:e.removeAttribute("type"),n!=null?M==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+xt(n)):e.value!==""+xt(n)&&(e.value=""+xt(n)):M!=="submit"&&M!=="reset"||e.removeAttribute("value"),n!=null?ia(e,M,xt(n)):s!=null?ia(e,M,xt(s)):o!=null&&e.removeAttribute("value"),d==null&&S!=null&&(e.defaultChecked=!!S),d!=null&&(e.checked=d&&typeof d!="function"&&typeof d!="symbol"),I!=null&&typeof I!="function"&&typeof I!="symbol"&&typeof I!="boolean"?e.name=""+xt(I):e.removeAttribute("name")}function ys(e,n,s,o,d,S,M,I){if(S!=null&&typeof S!="function"&&typeof S!="symbol"&&typeof S!="boolean"&&(e.type=S),n!=null||s!=null){if(!(S!=="submit"&&S!=="reset"||n!=null)){ea(e);return}s=s!=null?""+xt(s):"",n=n!=null?""+xt(n):s,I||n===e.value||(e.value=n),e.defaultValue=n}o=o??d,o=typeof o!="function"&&typeof o!="symbol"&&!!o,e.checked=I?e.checked:!!o,e.defaultChecked=!!o,M!=null&&typeof M!="function"&&typeof M!="symbol"&&typeof M!="boolean"&&(e.name=M),ea(e)}function ia(e,n,s){n==="number"&&ta(e.ownerDocument)===e||e.defaultValue===""+s||(e.defaultValue=""+s)}function yi(e,n,s,o){if(e=e.options,n){n={};for(var d=0;d<s.length;d++)n["$"+s[d]]=!0;for(s=0;s<e.length;s++)d=n.hasOwnProperty("$"+e[s].value),e[s].selected!==d&&(e[s].selected=d),d&&o&&(e[s].defaultSelected=!0)}else{for(s=""+xt(s),n=null,d=0;d<e.length;d++){if(e[d].value===s){e[d].selected=!0,o&&(e[d].defaultSelected=!0);return}n!==null||e[d].disabled||(n=e[d])}n!==null&&(n.selected=!0)}}function Ml(e,n,s){if(n!=null&&(n=""+xt(n),n!==e.value&&(e.value=n),s==null)){e.defaultValue!==n&&(e.defaultValue=n);return}e.defaultValue=s!=null?""+xt(s):""}function na(e,n,s,o){if(n==null){if(o!=null){if(s!=null)throw Error(a(92));if(te(o)){if(1<o.length)throw Error(a(93));o=o[0]}s=o}s==null&&(s=""),n=s}s=xt(n),e.defaultValue=s,o=e.textContent,o===s&&o!==""&&o!==null&&(e.value=o),ea(e)}function He(e,n){if(n){var s=e.firstChild;if(s&&s===e.lastChild&&s.nodeType===3){s.nodeValue=n;return}}e.textContent=n}var Dl=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 ni(e,n,s){var o=n.indexOf("--")===0;s==null||typeof s=="boolean"||s===""?o?e.setProperty(n,""):n==="float"?e.cssFloat="":e[n]="":o?e.setProperty(n,s):typeof s!="number"||s===0||Dl.has(n)?n==="float"?e.cssFloat=s:e[n]=(""+s).trim():e[n]=s+"px"}function ft(e,n,s){if(n!=null&&typeof n!="object")throw Error(a(62));if(e=e.style,s!=null){for(var o in s)!s.hasOwnProperty(o)||n!=null&&n.hasOwnProperty(o)||(o.indexOf("--")===0?e.setProperty(o,""):o==="float"?e.cssFloat="":e[o]="");for(var d in n)o=n[d],n.hasOwnProperty(d)&&s[d]!==o&&ni(e,d,o)}else for(var S in n)n.hasOwnProperty(S)&&ni(e,S,n[S])}function jr(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 cr=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"],["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"]]),ro=/^[\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 zr(e){return ro.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function Se(){}var ke=null;function Fe(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var et=null,It=null;function pn(e){var n=pe(e);if(n&&(e=n.stateNode)){var s=e[wt]||null;e:switch(e=n.stateNode,n.type){case"input":if(no(e,s.value,s.defaultValue,s.defaultValue,s.checked,s.defaultChecked,s.type,s.name),n=s.name,s.type==="radio"&&n!=null){for(s=e;s.parentNode;)s=s.parentNode;for(s=s.querySelectorAll('input[name="'+Ui(""+n)+'"][type="radio"]'),n=0;n<s.length;n++){var o=s[n];if(o!==e&&o.form===e.form){var d=o[wt]||null;if(!d)throw Error(a(90));no(o,d.value,d.defaultValue,d.defaultValue,d.checked,d.defaultChecked,d.type,d.name)}}for(n=0;n<s.length;n++)o=s[n],o.form===e.form&&io(o)}break e;case"textarea":Ml(e,s.value,s.defaultValue);break e;case"select":n=s.value,n!=null&&yi(e,!!s.multiple,n,!1)}}}var so=!1;function Ol(e,n,s){if(so)return e(n,s);so=!0;try{var o=e(n);return o}finally{if(so=!1,(et!==null||It!==null)&&(yc(),et&&(n=et,e=It,It=et=null,pn(n),e)))for(n=0;n<e.length;n++)pn(e[n])}}function ao(e,n){var s=e.stateNode;if(s===null)return null;var o=s[wt]||null;if(o===null)return null;s=o[n];e:switch(n){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(o=!o.disabled)||(e=e.type,o=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!o;break e;default:e=!1}if(e)return null;if(s&&typeof s!="function")throw Error(a(231,n,typeof s));return s}var ur=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),qu=!1;if(ur)try{var oo={};Object.defineProperty(oo,"passive",{get:function(){qu=!0}}),window.addEventListener("test",oo,oo),window.removeEventListener("test",oo,oo)}catch{qu=!1}var $r=null,Wu=null,Bl=null;function _g(){if(Bl)return Bl;var e,n=Wu,s=n.length,o,d="value"in $r?$r.value:$r.textContent,S=d.length;for(e=0;e<s&&n[e]===d[e];e++);var M=s-e;for(o=1;o<=M&&n[s-o]===d[S-o];o++);return Bl=d.slice(e,1<o?1-o:void 0)}function Nl(e){var n=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&n===13&&(e=13)):e=n,e===10&&(e=13),32<=e||e===13?e:0}function Il(){return!0}function vg(){return!1}function Pi(e){function n(s,o,d,S,M){this._reactName=s,this._targetInst=d,this.type=o,this.nativeEvent=S,this.target=M,this.currentTarget=null;for(var I in e)e.hasOwnProperty(I)&&(s=e[I],this[I]=s?s(S):S[I]);return this.isDefaultPrevented=(S.defaultPrevented!=null?S.defaultPrevented:S.returnValue===!1)?Il:vg,this.isPropagationStopped=vg,this}return p(n.prototype,{preventDefault:function(){this.defaultPrevented=!0;var s=this.nativeEvent;s&&(s.preventDefault?s.preventDefault():typeof s.returnValue!="unknown"&&(s.returnValue=!1),this.isDefaultPrevented=Il)},stopPropagation:function(){var s=this.nativeEvent;s&&(s.stopPropagation?s.stopPropagation():typeof s.cancelBubble!="unknown"&&(s.cancelBubble=!0),this.isPropagationStopped=Il)},persist:function(){},isPersistent:Il}),n}var Ss={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},jl=Pi(Ss),lo=p({},Ss,{view:0,detail:0}),IS=Pi(lo),Gu,Ku,co,zl=p({},lo,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Vu,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!==co&&(co&&e.type==="mousemove"?(Gu=e.screenX-co.screenX,Ku=e.screenY-co.screenY):Ku=Gu=0,co=e),Gu)},movementY:function(e){return"movementY"in e?e.movementY:Ku}}),bg=Pi(zl),jS=p({},zl,{dataTransfer:0}),zS=Pi(jS),$S=p({},lo,{relatedTarget:0}),Yu=Pi($S),HS=p({},Ss,{animationName:0,elapsedTime:0,pseudoElement:0}),US=Pi(HS),PS=p({},Ss,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),FS=Pi(PS),qS=p({},Ss,{data:0}),yg=Pi(qS),WS={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},GS={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"},KS={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function YS(e){var n=this.nativeEvent;return n.getModifierState?n.getModifierState(e):(e=KS[e])?!!n[e]:!1}function Vu(){return YS}var VS=p({},lo,{key:function(e){if(e.key){var n=WS[e.key]||e.key;if(n!=="Unidentified")return n}return e.type==="keypress"?(e=Nl(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?GS[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Vu,charCode:function(e){return e.type==="keypress"?Nl(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Nl(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),XS=Pi(VS),ZS=p({},zl,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Sg=Pi(ZS),JS=p({},lo,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Vu}),QS=Pi(JS),eC=p({},Ss,{propertyName:0,elapsedTime:0,pseudoElement:0}),tC=Pi(eC),iC=p({},zl,{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}),nC=Pi(iC),rC=p({},Ss,{newState:0,oldState:0}),sC=Pi(rC),aC=[9,13,27,32],Xu=ur&&"CompositionEvent"in window,uo=null;ur&&"documentMode"in document&&(uo=document.documentMode);var oC=ur&&"TextEvent"in window&&!uo,Cg=ur&&(!Xu||uo&&8<uo&&11>=uo),wg=" ",xg=!1;function Eg(e,n){switch(e){case"keyup":return aC.indexOf(n.keyCode)!==-1;case"keydown":return n.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Tg(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var ra=!1;function lC(e,n){switch(e){case"compositionend":return Tg(n);case"keypress":return n.which!==32?null:(xg=!0,wg);case"textInput":return e=n.data,e===wg&&xg?null:e;default:return null}}function cC(e,n){if(ra)return e==="compositionend"||!Xu&&Eg(e,n)?(e=_g(),Bl=Wu=$r=null,ra=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(n.ctrlKey||n.altKey||n.metaKey)||n.ctrlKey&&n.altKey){if(n.char&&1<n.char.length)return n.char;if(n.which)return String.fromCharCode(n.which)}return null;case"compositionend":return Cg&&n.locale!=="ko"?null:n.data;default:return null}}var uC={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 Ag(e){var n=e&&e.nodeName&&e.nodeName.toLowerCase();return n==="input"?!!uC[e.type]:n==="textarea"}function kg(e,n,s,o){et?It?It.push(o):It=[o]:et=o,n=Ac(n,"onChange"),0<n.length&&(s=new jl("onChange","change",null,s,o),e.push({event:s,listeners:n}))}var ho=null,fo=null;function hC(e){uv(e,0)}function $l(e){var n=xe(e);if(io(n))return e}function Rg(e,n){if(e==="change")return n}var Lg=!1;if(ur){var Zu;if(ur){var Ju="oninput"in document;if(!Ju){var Mg=document.createElement("div");Mg.setAttribute("oninput","return;"),Ju=typeof Mg.oninput=="function"}Zu=Ju}else Zu=!1;Lg=Zu&&(!document.documentMode||9<document.documentMode)}function Dg(){ho&&(ho.detachEvent("onpropertychange",Og),fo=ho=null)}function Og(e){if(e.propertyName==="value"&&$l(fo)){var n=[];kg(n,fo,e,Fe(e)),Ol(hC,n)}}function dC(e,n,s){e==="focusin"?(Dg(),ho=n,fo=s,ho.attachEvent("onpropertychange",Og)):e==="focusout"&&Dg()}function fC(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return $l(fo)}function pC(e,n){if(e==="click")return $l(n)}function gC(e,n){if(e==="input"||e==="change")return $l(n)}function mC(e,n){return e===n&&(e!==0||1/e===1/n)||e!==e&&n!==n}var rn=typeof Object.is=="function"?Object.is:mC;function po(e,n){if(rn(e,n))return!0;if(typeof e!="object"||e===null||typeof n!="object"||n===null)return!1;var s=Object.keys(e),o=Object.keys(n);if(s.length!==o.length)return!1;for(o=0;o<s.length;o++){var d=s[o];if(!_i.call(n,d)||!rn(e[d],n[d]))return!1}return!0}function Bg(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Ng(e,n){var s=Bg(e);e=0;for(var o;s;){if(s.nodeType===3){if(o=e+s.textContent.length,e<=n&&o>=n)return{node:s,offset:n-e};e=o}e:{for(;s;){if(s.nextSibling){s=s.nextSibling;break e}s=s.parentNode}s=void 0}s=Bg(s)}}function Ig(e,n){return e&&n?e===n?!0:e&&e.nodeType===3?!1:n&&n.nodeType===3?Ig(e,n.parentNode):"contains"in e?e.contains(n):e.compareDocumentPosition?!!(e.compareDocumentPosition(n)&16):!1:!1}function jg(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var n=ta(e.document);n instanceof e.HTMLIFrameElement;){try{var s=typeof n.contentWindow.location.href=="string"}catch{s=!1}if(s)e=n.contentWindow;else break;n=ta(e.document)}return n}function Qu(e){var n=e&&e.nodeName&&e.nodeName.toLowerCase();return n&&(n==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||n==="textarea"||e.contentEditable==="true")}var _C=ur&&"documentMode"in document&&11>=document.documentMode,sa=null,eh=null,go=null,th=!1;function zg(e,n,s){var o=s.window===s?s.document:s.nodeType===9?s:s.ownerDocument;th||sa==null||sa!==ta(o)||(o=sa,"selectionStart"in o&&Qu(o)?o={start:o.selectionStart,end:o.selectionEnd}:(o=(o.ownerDocument&&o.ownerDocument.defaultView||window).getSelection(),o={anchorNode:o.anchorNode,anchorOffset:o.anchorOffset,focusNode:o.focusNode,focusOffset:o.focusOffset}),go&&po(go,o)||(go=o,o=Ac(eh,"onSelect"),0<o.length&&(n=new jl("onSelect","select",null,n,s),e.push({event:n,listeners:o}),n.target=sa)))}function Cs(e,n){var s={};return s[e.toLowerCase()]=n.toLowerCase(),s["Webkit"+e]="webkit"+n,s["Moz"+e]="moz"+n,s}var aa={animationend:Cs("Animation","AnimationEnd"),animationiteration:Cs("Animation","AnimationIteration"),animationstart:Cs("Animation","AnimationStart"),transitionrun:Cs("Transition","TransitionRun"),transitionstart:Cs("Transition","TransitionStart"),transitioncancel:Cs("Transition","TransitionCancel"),transitionend:Cs("Transition","TransitionEnd")},ih={},$g={};ur&&($g=document.createElement("div").style,"AnimationEvent"in window||(delete aa.animationend.animation,delete aa.animationiteration.animation,delete aa.animationstart.animation),"TransitionEvent"in window||delete aa.transitionend.transition);function ws(e){if(ih[e])return ih[e];if(!aa[e])return e;var n=aa[e],s;for(s in n)if(n.hasOwnProperty(s)&&s in $g)return ih[e]=n[s];return e}var Hg=ws("animationend"),Ug=ws("animationiteration"),Pg=ws("animationstart"),vC=ws("transitionrun"),bC=ws("transitionstart"),yC=ws("transitioncancel"),Fg=ws("transitionend"),qg=new Map,nh="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");nh.push("scrollEnd");function On(e,n){qg.set(e,n),Ut(n,[e])}var Hl=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var n=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(n))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)},gn=[],oa=0,rh=0;function Ul(){for(var e=oa,n=rh=oa=0;n<e;){var s=gn[n];gn[n++]=null;var o=gn[n];gn[n++]=null;var d=gn[n];gn[n++]=null;var S=gn[n];if(gn[n++]=null,o!==null&&d!==null){var M=o.pending;M===null?d.next=d:(d.next=M.next,M.next=d),o.pending=d}S!==0&&Wg(s,d,S)}}function Pl(e,n,s,o){gn[oa++]=e,gn[oa++]=n,gn[oa++]=s,gn[oa++]=o,rh|=o,e.lanes|=o,e=e.alternate,e!==null&&(e.lanes|=o)}function sh(e,n,s,o){return Pl(e,n,s,o),Fl(e)}function xs(e,n){return Pl(e,null,null,n),Fl(e)}function Wg(e,n,s){e.lanes|=s;var o=e.alternate;o!==null&&(o.lanes|=s);for(var d=!1,S=e.return;S!==null;)S.childLanes|=s,o=S.alternate,o!==null&&(o.childLanes|=s),S.tag===22&&(e=S.stateNode,e===null||e._visibility&1||(d=!0)),e=S,S=S.return;return e.tag===3?(S=e.stateNode,d&&n!==null&&(d=31-$t(s),e=S.hiddenUpdates,o=e[d],o===null?e[d]=[n]:o.push(n),n.lane=s|536870912),S):null}function Fl(e){if(50<jo)throw jo=0,pd=null,Error(a(185));for(var n=e.return;n!==null;)e=n,n=e.return;return e.tag===3?e.stateNode:null}var la={};function SC(e,n,s,o){this.tag=e,this.key=s,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=n,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=o,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function sn(e,n,s,o){return new SC(e,n,s,o)}function ah(e){return e=e.prototype,!(!e||!e.isReactComponent)}function hr(e,n){var s=e.alternate;return s===null?(s=sn(e.tag,n,e.key,e.mode),s.elementType=e.elementType,s.type=e.type,s.stateNode=e.stateNode,s.alternate=e,e.alternate=s):(s.pendingProps=n,s.type=e.type,s.flags=0,s.subtreeFlags=0,s.deletions=null),s.flags=e.flags&65011712,s.childLanes=e.childLanes,s.lanes=e.lanes,s.child=e.child,s.memoizedProps=e.memoizedProps,s.memoizedState=e.memoizedState,s.updateQueue=e.updateQueue,n=e.dependencies,s.dependencies=n===null?null:{lanes:n.lanes,firstContext:n.firstContext},s.sibling=e.sibling,s.index=e.index,s.ref=e.ref,s.refCleanup=e.refCleanup,s}function Gg(e,n){e.flags&=65011714;var s=e.alternate;return s===null?(e.childLanes=0,e.lanes=n,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=s.childLanes,e.lanes=s.lanes,e.child=s.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=s.memoizedProps,e.memoizedState=s.memoizedState,e.updateQueue=s.updateQueue,e.type=s.type,n=s.dependencies,e.dependencies=n===null?null:{lanes:n.lanes,firstContext:n.firstContext}),e}function ql(e,n,s,o,d,S){var M=0;if(o=e,typeof e=="function")ah(e)&&(M=1);else if(typeof e=="string")M=Tw(e,s,ae.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case N:return e=sn(31,s,n,d),e.elementType=N,e.lanes=S,e;case x:return Es(s.children,d,S,n);case g:M=8,d|=24;break;case y:return e=sn(12,s,n,d|2),e.elementType=y,e.lanes=S,e;case L:return e=sn(13,s,n,d),e.elementType=L,e.lanes=S,e;case R:return e=sn(19,s,n,d),e.elementType=R,e.lanes=S,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case _:M=10;break e;case f:M=9;break e;case E:M=11;break e;case D:M=14;break e;case k:M=16,o=null;break e}M=29,s=Error(a(130,e===null?"null":typeof e,"")),o=null}return n=sn(M,s,n,d),n.elementType=e,n.type=o,n.lanes=S,n}function Es(e,n,s,o){return e=sn(7,e,o,n),e.lanes=s,e}function oh(e,n,s){return e=sn(6,e,null,n),e.lanes=s,e}function Kg(e){var n=sn(18,null,null,0);return n.stateNode=e,n}function lh(e,n,s){return n=sn(4,e.children!==null?e.children:[],e.key,n),n.lanes=s,n.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},n}var Yg=new WeakMap;function mn(e,n){if(typeof e=="object"&&e!==null){var s=Yg.get(e);return s!==void 0?s:(n={value:e,source:n,stack:Qt(n)},Yg.set(e,n),n)}return{value:e,source:n,stack:Qt(n)}}var ca=[],ua=0,Wl=null,mo=0,_n=[],vn=0,Hr=null,Wn=1,Gn="";function dr(e,n){ca[ua++]=mo,ca[ua++]=Wl,Wl=e,mo=n}function Vg(e,n,s){_n[vn++]=Wn,_n[vn++]=Gn,_n[vn++]=Hr,Hr=e;var o=Wn;e=Gn;var d=32-$t(o)-1;o&=~(1<<d),s+=1;var S=32-$t(n)+d;if(30<S){var M=d-d%5;S=(o&(1<<M)-1).toString(32),o>>=M,d-=M,Wn=1<<32-$t(n)+d|s<<d|o,Gn=S+e}else Wn=1<<S|s<<d|o,Gn=e}function ch(e){e.return!==null&&(dr(e,1),Vg(e,1,0))}function uh(e){for(;e===Wl;)Wl=ca[--ua],ca[ua]=null,mo=ca[--ua],ca[ua]=null;for(;e===Hr;)Hr=_n[--vn],_n[vn]=null,Gn=_n[--vn],_n[vn]=null,Wn=_n[--vn],_n[vn]=null}function Xg(e,n){_n[vn++]=Wn,_n[vn++]=Gn,_n[vn++]=Hr,Wn=n.id,Gn=n.overflow,Hr=e}var Si=null,At=null,rt=!1,Ur=null,bn=!1,hh=Error(a(519));function Pr(e){var n=Error(a(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw _o(mn(n,e)),hh}function Zg(e){var n=e.stateNode,s=e.type,o=e.memoizedProps;switch(n[Et]=e,n[wt]=o,s){case"dialog":Ze("cancel",n),Ze("close",n);break;case"iframe":case"object":case"embed":Ze("load",n);break;case"video":case"audio":for(s=0;s<$o.length;s++)Ze($o[s],n);break;case"source":Ze("error",n);break;case"img":case"image":case"link":Ze("error",n),Ze("load",n);break;case"details":Ze("toggle",n);break;case"input":Ze("invalid",n),ys(n,o.value,o.defaultValue,o.checked,o.defaultChecked,o.type,o.name,!0);break;case"select":Ze("invalid",n);break;case"textarea":Ze("invalid",n),na(n,o.value,o.defaultValue,o.children)}s=o.children,typeof s!="string"&&typeof s!="number"&&typeof s!="bigint"||n.textContent===""+s||o.suppressHydrationWarning===!0||pv(n.textContent,s)?(o.popover!=null&&(Ze("beforetoggle",n),Ze("toggle",n)),o.onScroll!=null&&Ze("scroll",n),o.onScrollEnd!=null&&Ze("scrollend",n),o.onClick!=null&&(n.onclick=Se),n=!0):n=!1,n||Pr(e,!0)}function Jg(e){for(Si=e.return;Si;)switch(Si.tag){case 5:case 31:case 13:bn=!1;return;case 27:case 3:bn=!0;return;default:Si=Si.return}}function ha(e){if(e!==Si)return!1;if(!rt)return Jg(e),rt=!0,!1;var n=e.tag,s;if((s=n!==3&&n!==27)&&((s=n===5)&&(s=e.type,s=!(s!=="form"&&s!=="button")||Rd(e.type,e.memoizedProps)),s=!s),s&&At&&Pr(e),Jg(e),n===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(a(317));At=wv(e)}else if(n===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(a(317));At=wv(e)}else n===27?(n=At,is(e.type)?(e=Bd,Bd=null,At=e):At=n):At=Si?Sn(e.stateNode.nextSibling):null;return!0}function Ts(){At=Si=null,rt=!1}function dh(){var e=Ur;return e!==null&&(Gi===null?Gi=e:Gi.push.apply(Gi,e),Ur=null),e}function _o(e){Ur===null?Ur=[e]:Ur.push(e)}var fh=O(null),As=null,fr=null;function Fr(e,n,s){X(fh,n._currentValue),n._currentValue=s}function pr(e){e._currentValue=fh.current,H(fh)}function ph(e,n,s){for(;e!==null;){var o=e.alternate;if((e.childLanes&n)!==n?(e.childLanes|=n,o!==null&&(o.childLanes|=n)):o!==null&&(o.childLanes&n)!==n&&(o.childLanes|=n),e===s)break;e=e.return}}function gh(e,n,s,o){var d=e.child;for(d!==null&&(d.return=e);d!==null;){var S=d.dependencies;if(S!==null){var M=d.child;S=S.firstContext;e:for(;S!==null;){var I=S;S=d;for(var K=0;K<n.length;K++)if(I.context===n[K]){S.lanes|=s,I=S.alternate,I!==null&&(I.lanes|=s),ph(S.return,s,e),o||(M=null);break e}S=I.next}}else if(d.tag===18){if(M=d.return,M===null)throw Error(a(341));M.lanes|=s,S=M.alternate,S!==null&&(S.lanes|=s),ph(M,s,e),M=null}else M=d.child;if(M!==null)M.return=d;else for(M=d;M!==null;){if(M===e){M=null;break}if(d=M.sibling,d!==null){d.return=M.return,M=d;break}M=M.return}d=M}}function da(e,n,s,o){e=null;for(var d=n,S=!1;d!==null;){if(!S){if((d.flags&524288)!==0)S=!0;else if((d.flags&262144)!==0)break}if(d.tag===10){var M=d.alternate;if(M===null)throw Error(a(387));if(M=M.memoizedProps,M!==null){var I=d.type;rn(d.pendingProps.value,M.value)||(e!==null?e.push(I):e=[I])}}else if(d===Q.current){if(M=d.alternate,M===null)throw Error(a(387));M.memoizedState.memoizedState!==d.memoizedState.memoizedState&&(e!==null?e.push(qo):e=[qo])}d=d.return}e!==null&&gh(n,e,s,o),n.flags|=262144}function Gl(e){for(e=e.firstContext;e!==null;){if(!rn(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function ks(e){As=e,fr=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Ci(e){return Qg(As,e)}function Kl(e,n){return As===null&&ks(e),Qg(e,n)}function Qg(e,n){var s=n._currentValue;if(n={context:n,memoizedValue:s,next:null},fr===null){if(e===null)throw Error(a(308));fr=n,e.dependencies={lanes:0,firstContext:n},e.flags|=524288}else fr=fr.next=n;return s}var CC=typeof AbortController<"u"?AbortController:function(){var e=[],n=this.signal={aborted:!1,addEventListener:function(s,o){e.push(o)}};this.abort=function(){n.aborted=!0,e.forEach(function(s){return s()})}},wC=t.unstable_scheduleCallback,xC=t.unstable_NormalPriority,ri={$$typeof:_,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function mh(){return{controller:new CC,data:new Map,refCount:0}}function vo(e){e.refCount--,e.refCount===0&&wC(xC,function(){e.controller.abort()})}var bo=null,_h=0,fa=0,pa=null;function EC(e,n){if(bo===null){var s=bo=[];_h=0,fa=yd(),pa={status:"pending",value:void 0,then:function(o){s.push(o)}}}return _h++,n.then(em,em),n}function em(){if(--_h===0&&bo!==null){pa!==null&&(pa.status="fulfilled");var e=bo;bo=null,fa=0,pa=null;for(var n=0;n<e.length;n++)(0,e[n])()}}function TC(e,n){var s=[],o={status:"pending",value:null,reason:null,then:function(d){s.push(d)}};return e.then(function(){o.status="fulfilled",o.value=n;for(var d=0;d<s.length;d++)(0,s[d])(n)},function(d){for(o.status="rejected",o.reason=d,d=0;d<s.length;d++)(0,s[d])(void 0)}),o}var tm=P.S;P.S=function(e,n){z_=ct(),typeof n=="object"&&n!==null&&typeof n.then=="function"&&EC(e,n),tm!==null&&tm(e,n)};var Rs=O(null);function vh(){var e=Rs.current;return e!==null?e:St.pooledCache}function Yl(e,n){n===null?X(Rs,Rs.current):X(Rs,n.pool)}function im(){var e=vh();return e===null?null:{parent:ri._currentValue,pool:e}}var ga=Error(a(460)),bh=Error(a(474)),Vl=Error(a(542)),Xl={then:function(){}};function nm(e){return e=e.status,e==="fulfilled"||e==="rejected"}function rm(e,n,s){switch(s=e[s],s===void 0?e.push(n):s!==n&&(n.then(Se,Se),n=s),n.status){case"fulfilled":return n.value;case"rejected":throw e=n.reason,am(e),e;default:if(typeof n.status=="string")n.then(Se,Se);else{if(e=St,e!==null&&100<e.shellSuspendCounter)throw Error(a(482));e=n,e.status="pending",e.then(function(o){if(n.status==="pending"){var d=n;d.status="fulfilled",d.value=o}},function(o){if(n.status==="pending"){var d=n;d.status="rejected",d.reason=o}})}switch(n.status){case"fulfilled":return n.value;case"rejected":throw e=n.reason,am(e),e}throw Ms=n,ga}}function Ls(e){try{var n=e._init;return n(e._payload)}catch(s){throw s!==null&&typeof s=="object"&&typeof s.then=="function"?(Ms=s,ga):s}}var Ms=null;function sm(){if(Ms===null)throw Error(a(459));var e=Ms;return Ms=null,e}function am(e){if(e===ga||e===Vl)throw Error(a(483))}var ma=null,yo=0;function Zl(e){var n=yo;return yo+=1,ma===null&&(ma=[]),rm(ma,e,n)}function So(e,n){n=n.props.ref,e.ref=n!==void 0?n:null}function Jl(e,n){throw n.$$typeof===C?Error(a(525)):(e=Object.prototype.toString.call(n),Error(a(31,e==="[object Object]"?"object with keys {"+Object.keys(n).join(", ")+"}":e)))}function om(e){function n(ie,ee){if(e){var ne=ie.deletions;ne===null?(ie.deletions=[ee],ie.flags|=16):ne.push(ee)}}function s(ie,ee){if(!e)return null;for(;ee!==null;)n(ie,ee),ee=ee.sibling;return null}function o(ie){for(var ee=new Map;ie!==null;)ie.key!==null?ee.set(ie.key,ie):ee.set(ie.index,ie),ie=ie.sibling;return ee}function d(ie,ee){return ie=hr(ie,ee),ie.index=0,ie.sibling=null,ie}function S(ie,ee,ne){return ie.index=ne,e?(ne=ie.alternate,ne!==null?(ne=ne.index,ne<ee?(ie.flags|=67108866,ee):ne):(ie.flags|=67108866,ee)):(ie.flags|=1048576,ee)}function M(ie){return e&&ie.alternate===null&&(ie.flags|=67108866),ie}function I(ie,ee,ne,de){return ee===null||ee.tag!==6?(ee=oh(ne,ie.mode,de),ee.return=ie,ee):(ee=d(ee,ne),ee.return=ie,ee)}function K(ie,ee,ne,de){var Ne=ne.type;return Ne===x?ue(ie,ee,ne.props.children,de,ne.key):ee!==null&&(ee.elementType===Ne||typeof Ne=="object"&&Ne!==null&&Ne.$$typeof===k&&Ls(Ne)===ee.type)?(ee=d(ee,ne.props),So(ee,ne),ee.return=ie,ee):(ee=ql(ne.type,ne.key,ne.props,null,ie.mode,de),So(ee,ne),ee.return=ie,ee)}function re(ie,ee,ne,de){return ee===null||ee.tag!==4||ee.stateNode.containerInfo!==ne.containerInfo||ee.stateNode.implementation!==ne.implementation?(ee=lh(ne,ie.mode,de),ee.return=ie,ee):(ee=d(ee,ne.children||[]),ee.return=ie,ee)}function ue(ie,ee,ne,de,Ne){return ee===null||ee.tag!==7?(ee=Es(ne,ie.mode,de,Ne),ee.return=ie,ee):(ee=d(ee,ne),ee.return=ie,ee)}function fe(ie,ee,ne){if(typeof ee=="string"&&ee!==""||typeof ee=="number"||typeof ee=="bigint")return ee=oh(""+ee,ie.mode,ne),ee.return=ie,ee;if(typeof ee=="object"&&ee!==null){switch(ee.$$typeof){case w:return ne=ql(ee.type,ee.key,ee.props,null,ie.mode,ne),So(ne,ee),ne.return=ie,ne;case A:return ee=lh(ee,ie.mode,ne),ee.return=ie,ee;case k:return ee=Ls(ee),fe(ie,ee,ne)}if(te(ee)||F(ee))return ee=Es(ee,ie.mode,ne,null),ee.return=ie,ee;if(typeof ee.then=="function")return fe(ie,Zl(ee),ne);if(ee.$$typeof===_)return fe(ie,Kl(ie,ee),ne);Jl(ie,ee)}return null}function se(ie,ee,ne,de){var Ne=ee!==null?ee.key:null;if(typeof ne=="string"&&ne!==""||typeof ne=="number"||typeof ne=="bigint")return Ne!==null?null:I(ie,ee,""+ne,de);if(typeof ne=="object"&&ne!==null){switch(ne.$$typeof){case w:return ne.key===Ne?K(ie,ee,ne,de):null;case A:return ne.key===Ne?re(ie,ee,ne,de):null;case k:return ne=Ls(ne),se(ie,ee,ne,de)}if(te(ne)||F(ne))return Ne!==null?null:ue(ie,ee,ne,de,null);if(typeof ne.then=="function")return se(ie,ee,Zl(ne),de);if(ne.$$typeof===_)return se(ie,ee,Kl(ie,ne),de);Jl(ie,ne)}return null}function le(ie,ee,ne,de,Ne){if(typeof de=="string"&&de!==""||typeof de=="number"||typeof de=="bigint")return ie=ie.get(ne)||null,I(ee,ie,""+de,Ne);if(typeof de=="object"&&de!==null){switch(de.$$typeof){case w:return ie=ie.get(de.key===null?ne:de.key)||null,K(ee,ie,de,Ne);case A:return ie=ie.get(de.key===null?ne:de.key)||null,re(ee,ie,de,Ne);case k:return de=Ls(de),le(ie,ee,ne,de,Ne)}if(te(de)||F(de))return ie=ie.get(ne)||null,ue(ee,ie,de,Ne,null);if(typeof de.then=="function")return le(ie,ee,ne,Zl(de),Ne);if(de.$$typeof===_)return le(ie,ee,ne,Kl(ee,de),Ne);Jl(ee,de)}return null}function Te(ie,ee,ne,de){for(var Ne=null,at=null,Re=ee,We=ee=0,it=null;Re!==null&&We<ne.length;We++){Re.index>We?(it=Re,Re=null):it=Re.sibling;var ot=se(ie,Re,ne[We],de);if(ot===null){Re===null&&(Re=it);break}e&&Re&&ot.alternate===null&&n(ie,Re),ee=S(ot,ee,We),at===null?Ne=ot:at.sibling=ot,at=ot,Re=it}if(We===ne.length)return s(ie,Re),rt&&dr(ie,We),Ne;if(Re===null){for(;We<ne.length;We++)Re=fe(ie,ne[We],de),Re!==null&&(ee=S(Re,ee,We),at===null?Ne=Re:at.sibling=Re,at=Re);return rt&&dr(ie,We),Ne}for(Re=o(Re);We<ne.length;We++)it=le(Re,ie,We,ne[We],de),it!==null&&(e&&it.alternate!==null&&Re.delete(it.key===null?We:it.key),ee=S(it,ee,We),at===null?Ne=it:at.sibling=it,at=it);return e&&Re.forEach(function(os){return n(ie,os)}),rt&&dr(ie,We),Ne}function ze(ie,ee,ne,de){if(ne==null)throw Error(a(151));for(var Ne=null,at=null,Re=ee,We=ee=0,it=null,ot=ne.next();Re!==null&&!ot.done;We++,ot=ne.next()){Re.index>We?(it=Re,Re=null):it=Re.sibling;var os=se(ie,Re,ot.value,de);if(os===null){Re===null&&(Re=it);break}e&&Re&&os.alternate===null&&n(ie,Re),ee=S(os,ee,We),at===null?Ne=os:at.sibling=os,at=os,Re=it}if(ot.done)return s(ie,Re),rt&&dr(ie,We),Ne;if(Re===null){for(;!ot.done;We++,ot=ne.next())ot=fe(ie,ot.value,de),ot!==null&&(ee=S(ot,ee,We),at===null?Ne=ot:at.sibling=ot,at=ot);return rt&&dr(ie,We),Ne}for(Re=o(Re);!ot.done;We++,ot=ne.next())ot=le(Re,ie,We,ot.value,de),ot!==null&&(e&&ot.alternate!==null&&Re.delete(ot.key===null?We:ot.key),ee=S(ot,ee,We),at===null?Ne=ot:at.sibling=ot,at=ot);return e&&Re.forEach(function(jw){return n(ie,jw)}),rt&&dr(ie,We),Ne}function vt(ie,ee,ne,de){if(typeof ne=="object"&&ne!==null&&ne.type===x&&ne.key===null&&(ne=ne.props.children),typeof ne=="object"&&ne!==null){switch(ne.$$typeof){case w:e:{for(var Ne=ne.key;ee!==null;){if(ee.key===Ne){if(Ne=ne.type,Ne===x){if(ee.tag===7){s(ie,ee.sibling),de=d(ee,ne.props.children),de.return=ie,ie=de;break e}}else if(ee.elementType===Ne||typeof Ne=="object"&&Ne!==null&&Ne.$$typeof===k&&Ls(Ne)===ee.type){s(ie,ee.sibling),de=d(ee,ne.props),So(de,ne),de.return=ie,ie=de;break e}s(ie,ee);break}else n(ie,ee);ee=ee.sibling}ne.type===x?(de=Es(ne.props.children,ie.mode,de,ne.key),de.return=ie,ie=de):(de=ql(ne.type,ne.key,ne.props,null,ie.mode,de),So(de,ne),de.return=ie,ie=de)}return M(ie);case A:e:{for(Ne=ne.key;ee!==null;){if(ee.key===Ne)if(ee.tag===4&&ee.stateNode.containerInfo===ne.containerInfo&&ee.stateNode.implementation===ne.implementation){s(ie,ee.sibling),de=d(ee,ne.children||[]),de.return=ie,ie=de;break e}else{s(ie,ee);break}else n(ie,ee);ee=ee.sibling}de=lh(ne,ie.mode,de),de.return=ie,ie=de}return M(ie);case k:return ne=Ls(ne),vt(ie,ee,ne,de)}if(te(ne))return Te(ie,ee,ne,de);if(F(ne)){if(Ne=F(ne),typeof Ne!="function")throw Error(a(150));return ne=Ne.call(ne),ze(ie,ee,ne,de)}if(typeof ne.then=="function")return vt(ie,ee,Zl(ne),de);if(ne.$$typeof===_)return vt(ie,ee,Kl(ie,ne),de);Jl(ie,ne)}return typeof ne=="string"&&ne!==""||typeof ne=="number"||typeof ne=="bigint"?(ne=""+ne,ee!==null&&ee.tag===6?(s(ie,ee.sibling),de=d(ee,ne),de.return=ie,ie=de):(s(ie,ee),de=oh(ne,ie.mode,de),de.return=ie,ie=de),M(ie)):s(ie,ee)}return function(ie,ee,ne,de){try{yo=0;var Ne=vt(ie,ee,ne,de);return ma=null,Ne}catch(Re){if(Re===ga||Re===Vl)throw Re;var at=sn(29,Re,null,ie.mode);return at.lanes=de,at.return=ie,at}}}var Ds=om(!0),lm=om(!1),qr=!1;function yh(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Sh(e,n){e=e.updateQueue,n.updateQueue===e&&(n.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function Wr(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Gr(e,n,s){var o=e.updateQueue;if(o===null)return null;if(o=o.shared,(ut&2)!==0){var d=o.pending;return d===null?n.next=n:(n.next=d.next,d.next=n),o.pending=n,n=Fl(e),Wg(e,null,s),n}return Pl(e,o,n,s),Fl(e)}function Co(e,n,s){if(n=n.updateQueue,n!==null&&(n=n.shared,(s&4194048)!==0)){var o=n.lanes;o&=e.pendingLanes,s|=o,n.lanes=s,je(e,s)}}function Ch(e,n){var s=e.updateQueue,o=e.alternate;if(o!==null&&(o=o.updateQueue,s===o)){var d=null,S=null;if(s=s.firstBaseUpdate,s!==null){do{var M={lane:s.lane,tag:s.tag,payload:s.payload,callback:null,next:null};S===null?d=S=M:S=S.next=M,s=s.next}while(s!==null);S===null?d=S=n:S=S.next=n}else d=S=n;s={baseState:o.baseState,firstBaseUpdate:d,lastBaseUpdate:S,shared:o.shared,callbacks:o.callbacks},e.updateQueue=s;return}e=s.lastBaseUpdate,e===null?s.firstBaseUpdate=n:e.next=n,s.lastBaseUpdate=n}var wh=!1;function wo(){if(wh){var e=pa;if(e!==null)throw e}}function xo(e,n,s,o){wh=!1;var d=e.updateQueue;qr=!1;var S=d.firstBaseUpdate,M=d.lastBaseUpdate,I=d.shared.pending;if(I!==null){d.shared.pending=null;var K=I,re=K.next;K.next=null,M===null?S=re:M.next=re,M=K;var ue=e.alternate;ue!==null&&(ue=ue.updateQueue,I=ue.lastBaseUpdate,I!==M&&(I===null?ue.firstBaseUpdate=re:I.next=re,ue.lastBaseUpdate=K))}if(S!==null){var fe=d.baseState;M=0,ue=re=K=null,I=S;do{var se=I.lane&-536870913,le=se!==I.lane;if(le?(tt&se)===se:(o&se)===se){se!==0&&se===fa&&(wh=!0),ue!==null&&(ue=ue.next={lane:0,tag:I.tag,payload:I.payload,callback:null,next:null});e:{var Te=e,ze=I;se=n;var vt=s;switch(ze.tag){case 1:if(Te=ze.payload,typeof Te=="function"){fe=Te.call(vt,fe,se);break e}fe=Te;break e;case 3:Te.flags=Te.flags&-65537|128;case 0:if(Te=ze.payload,se=typeof Te=="function"?Te.call(vt,fe,se):Te,se==null)break e;fe=p({},fe,se);break e;case 2:qr=!0}}se=I.callback,se!==null&&(e.flags|=64,le&&(e.flags|=8192),le=d.callbacks,le===null?d.callbacks=[se]:le.push(se))}else le={lane:se,tag:I.tag,payload:I.payload,callback:I.callback,next:null},ue===null?(re=ue=le,K=fe):ue=ue.next=le,M|=se;if(I=I.next,I===null){if(I=d.shared.pending,I===null)break;le=I,I=le.next,le.next=null,d.lastBaseUpdate=le,d.shared.pending=null}}while(!0);ue===null&&(K=fe),d.baseState=K,d.firstBaseUpdate=re,d.lastBaseUpdate=ue,S===null&&(d.shared.lanes=0),Zr|=M,e.lanes=M,e.memoizedState=fe}}function cm(e,n){if(typeof e!="function")throw Error(a(191,e));e.call(n)}function um(e,n){var s=e.callbacks;if(s!==null)for(e.callbacks=null,e=0;e<s.length;e++)cm(s[e],n)}var _a=O(null),Ql=O(0);function hm(e,n){e=wr,X(Ql,e),X(_a,n),wr=e|n.baseLanes}function xh(){X(Ql,wr),X(_a,_a.current)}function Eh(){wr=Ql.current,H(_a),H(Ql)}var an=O(null),yn=null;function Kr(e){var n=e.alternate;X(Xt,Xt.current&1),X(an,e),yn===null&&(n===null||_a.current!==null||n.memoizedState!==null)&&(yn=e)}function Th(e){X(Xt,Xt.current),X(an,e),yn===null&&(yn=e)}function dm(e){e.tag===22?(X(Xt,Xt.current),X(an,e),yn===null&&(yn=e)):Yr()}function Yr(){X(Xt,Xt.current),X(an,an.current)}function on(e){H(an),yn===e&&(yn=null),H(Xt)}var Xt=O(0);function ec(e){for(var n=e;n!==null;){if(n.tag===13){var s=n.memoizedState;if(s!==null&&(s=s.dehydrated,s===null||Dd(s)||Od(s)))return n}else if(n.tag===19&&(n.memoizedProps.revealOrder==="forwards"||n.memoizedProps.revealOrder==="backwards"||n.memoizedProps.revealOrder==="unstable_legacy-backwards"||n.memoizedProps.revealOrder==="together")){if((n.flags&128)!==0)return n}else if(n.child!==null){n.child.return=n,n=n.child;continue}if(n===e)break;for(;n.sibling===null;){if(n.return===null||n.return===e)return null;n=n.return}n.sibling.return=n.return,n=n.sibling}return null}var gr=0,qe=null,mt=null,si=null,tc=!1,va=!1,Os=!1,ic=0,Eo=0,ba=null,AC=0;function Pt(){throw Error(a(321))}function Ah(e,n){if(n===null)return!1;for(var s=0;s<n.length&&s<e.length;s++)if(!rn(e[s],n[s]))return!1;return!0}function kh(e,n,s,o,d,S){return gr=S,qe=n,n.memoizedState=null,n.updateQueue=null,n.lanes=0,P.H=e===null||e.memoizedState===null?Vm:Fh,Os=!1,S=s(o,d),Os=!1,va&&(S=pm(n,s,o,d)),fm(e),S}function fm(e){P.H=ko;var n=mt!==null&&mt.next!==null;if(gr=0,si=mt=qe=null,tc=!1,Eo=0,ba=null,n)throw Error(a(300));e===null||ai||(e=e.dependencies,e!==null&&Gl(e)&&(ai=!0))}function pm(e,n,s,o){qe=e;var d=0;do{if(va&&(ba=null),Eo=0,va=!1,25<=d)throw Error(a(301));if(d+=1,si=mt=null,e.updateQueue!=null){var S=e.updateQueue;S.lastEffect=null,S.events=null,S.stores=null,S.memoCache!=null&&(S.memoCache.index=0)}P.H=Xm,S=n(s,o)}while(va);return S}function kC(){var e=P.H,n=e.useState()[0];return n=typeof n.then=="function"?To(n):n,e=e.useState()[0],(mt!==null?mt.memoizedState:null)!==e&&(qe.flags|=1024),n}function Rh(){var e=ic!==0;return ic=0,e}function Lh(e,n,s){n.updateQueue=e.updateQueue,n.flags&=-2053,e.lanes&=~s}function Mh(e){if(tc){for(e=e.memoizedState;e!==null;){var n=e.queue;n!==null&&(n.pending=null),e=e.next}tc=!1}gr=0,si=mt=qe=null,va=!1,Eo=ic=0,ba=null}function Di(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return si===null?qe.memoizedState=si=e:si=si.next=e,si}function Zt(){if(mt===null){var e=qe.alternate;e=e!==null?e.memoizedState:null}else e=mt.next;var n=si===null?qe.memoizedState:si.next;if(n!==null)si=n,mt=e;else{if(e===null)throw qe.alternate===null?Error(a(467)):Error(a(310));mt=e,e={memoizedState:mt.memoizedState,baseState:mt.baseState,baseQueue:mt.baseQueue,queue:mt.queue,next:null},si===null?qe.memoizedState=si=e:si=si.next=e}return si}function nc(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function To(e){var n=Eo;return Eo+=1,ba===null&&(ba=[]),e=rm(ba,e,n),n=qe,(si===null?n.memoizedState:si.next)===null&&(n=n.alternate,P.H=n===null||n.memoizedState===null?Vm:Fh),e}function rc(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return To(e);if(e.$$typeof===_)return Ci(e)}throw Error(a(438,String(e)))}function Dh(e){var n=null,s=qe.updateQueue;if(s!==null&&(n=s.memoCache),n==null){var o=qe.alternate;o!==null&&(o=o.updateQueue,o!==null&&(o=o.memoCache,o!=null&&(n={data:o.data.map(function(d){return d.slice()}),index:0})))}if(n==null&&(n={data:[],index:0}),s===null&&(s=nc(),qe.updateQueue=s),s.memoCache=n,s=n.data[n.index],s===void 0)for(s=n.data[n.index]=Array(e),o=0;o<e;o++)s[o]=W;return n.index++,s}function mr(e,n){return typeof n=="function"?n(e):n}function sc(e){var n=Zt();return Oh(n,mt,e)}function Oh(e,n,s){var o=e.queue;if(o===null)throw Error(a(311));o.lastRenderedReducer=s;var d=e.baseQueue,S=o.pending;if(S!==null){if(d!==null){var M=d.next;d.next=S.next,S.next=M}n.baseQueue=d=S,o.pending=null}if(S=e.baseState,d===null)e.memoizedState=S;else{n=d.next;var I=M=null,K=null,re=n,ue=!1;do{var fe=re.lane&-536870913;if(fe!==re.lane?(tt&fe)===fe:(gr&fe)===fe){var se=re.revertLane;if(se===0)K!==null&&(K=K.next={lane:0,revertLane:0,gesture:null,action:re.action,hasEagerState:re.hasEagerState,eagerState:re.eagerState,next:null}),fe===fa&&(ue=!0);else if((gr&se)===se){re=re.next,se===fa&&(ue=!0);continue}else fe={lane:0,revertLane:re.revertLane,gesture:null,action:re.action,hasEagerState:re.hasEagerState,eagerState:re.eagerState,next:null},K===null?(I=K=fe,M=S):K=K.next=fe,qe.lanes|=se,Zr|=se;fe=re.action,Os&&s(S,fe),S=re.hasEagerState?re.eagerState:s(S,fe)}else se={lane:fe,revertLane:re.revertLane,gesture:re.gesture,action:re.action,hasEagerState:re.hasEagerState,eagerState:re.eagerState,next:null},K===null?(I=K=se,M=S):K=K.next=se,qe.lanes|=fe,Zr|=fe;re=re.next}while(re!==null&&re!==n);if(K===null?M=S:K.next=I,!rn(S,e.memoizedState)&&(ai=!0,ue&&(s=pa,s!==null)))throw s;e.memoizedState=S,e.baseState=M,e.baseQueue=K,o.lastRenderedState=S}return d===null&&(o.lanes=0),[e.memoizedState,o.dispatch]}function Bh(e){var n=Zt(),s=n.queue;if(s===null)throw Error(a(311));s.lastRenderedReducer=e;var o=s.dispatch,d=s.pending,S=n.memoizedState;if(d!==null){s.pending=null;var M=d=d.next;do S=e(S,M.action),M=M.next;while(M!==d);rn(S,n.memoizedState)||(ai=!0),n.memoizedState=S,n.baseQueue===null&&(n.baseState=S),s.lastRenderedState=S}return[S,o]}function gm(e,n,s){var o=qe,d=Zt(),S=rt;if(S){if(s===void 0)throw Error(a(407));s=s()}else s=n();var M=!rn((mt||d).memoizedState,s);if(M&&(d.memoizedState=s,ai=!0),d=d.queue,jh(vm.bind(null,o,d,e),[e]),d.getSnapshot!==n||M||si!==null&&si.memoizedState.tag&1){if(o.flags|=2048,ya(9,{destroy:void 0},_m.bind(null,o,d,s,n),null),St===null)throw Error(a(349));S||(gr&127)!==0||mm(o,n,s)}return s}function mm(e,n,s){e.flags|=16384,e={getSnapshot:n,value:s},n=qe.updateQueue,n===null?(n=nc(),qe.updateQueue=n,n.stores=[e]):(s=n.stores,s===null?n.stores=[e]:s.push(e))}function _m(e,n,s,o){n.value=s,n.getSnapshot=o,bm(n)&&ym(e)}function vm(e,n,s){return s(function(){bm(n)&&ym(e)})}function bm(e){var n=e.getSnapshot;e=e.value;try{var s=n();return!rn(e,s)}catch{return!0}}function ym(e){var n=xs(e,2);n!==null&&Ki(n,e,2)}function Nh(e){var n=Di();if(typeof e=="function"){var s=e;if(e=s(),Os){Vt(!0);try{s()}finally{Vt(!1)}}}return n.memoizedState=n.baseState=e,n.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:mr,lastRenderedState:e},n}function Sm(e,n,s,o){return e.baseState=s,Oh(e,mt,typeof o=="function"?o:mr)}function RC(e,n,s,o,d){if(lc(e))throw Error(a(485));if(e=n.action,e!==null){var S={payload:d,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(M){S.listeners.push(M)}};P.T!==null?s(!0):S.isTransition=!1,o(S),s=n.pending,s===null?(S.next=n.pending=S,Cm(n,S)):(S.next=s.next,n.pending=s.next=S)}}function Cm(e,n){var s=n.action,o=n.payload,d=e.state;if(n.isTransition){var S=P.T,M={};P.T=M;try{var I=s(d,o),K=P.S;K!==null&&K(M,I),wm(e,n,I)}catch(re){Ih(e,n,re)}finally{S!==null&&M.types!==null&&(S.types=M.types),P.T=S}}else try{S=s(d,o),wm(e,n,S)}catch(re){Ih(e,n,re)}}function wm(e,n,s){s!==null&&typeof s=="object"&&typeof s.then=="function"?s.then(function(o){xm(e,n,o)},function(o){return Ih(e,n,o)}):xm(e,n,s)}function xm(e,n,s){n.status="fulfilled",n.value=s,Em(n),e.state=s,n=e.pending,n!==null&&(s=n.next,s===n?e.pending=null:(s=s.next,n.next=s,Cm(e,s)))}function Ih(e,n,s){var o=e.pending;if(e.pending=null,o!==null){o=o.next;do n.status="rejected",n.reason=s,Em(n),n=n.next;while(n!==o)}e.action=null}function Em(e){e=e.listeners;for(var n=0;n<e.length;n++)(0,e[n])()}function Tm(e,n){return n}function Am(e,n){if(rt){var s=St.formState;if(s!==null){e:{var o=qe;if(rt){if(At){t:{for(var d=At,S=bn;d.nodeType!==8;){if(!S){d=null;break t}if(d=Sn(d.nextSibling),d===null){d=null;break t}}S=d.data,d=S==="F!"||S==="F"?d:null}if(d){At=Sn(d.nextSibling),o=d.data==="F!";break e}}Pr(o)}o=!1}o&&(n=s[0])}}return s=Di(),s.memoizedState=s.baseState=n,o={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Tm,lastRenderedState:n},s.queue=o,s=Gm.bind(null,qe,o),o.dispatch=s,o=Nh(!1),S=Ph.bind(null,qe,!1,o.queue),o=Di(),d={state:n,dispatch:null,action:e,pending:null},o.queue=d,s=RC.bind(null,qe,d,S,s),d.dispatch=s,o.memoizedState=e,[n,s,!1]}function km(e){var n=Zt();return Rm(n,mt,e)}function Rm(e,n,s){if(n=Oh(e,n,Tm)[0],e=sc(mr)[0],typeof n=="object"&&n!==null&&typeof n.then=="function")try{var o=To(n)}catch(M){throw M===ga?Vl:M}else o=n;n=Zt();var d=n.queue,S=d.dispatch;return s!==n.memoizedState&&(qe.flags|=2048,ya(9,{destroy:void 0},LC.bind(null,d,s),null)),[o,S,e]}function LC(e,n){e.action=n}function Lm(e){var n=Zt(),s=mt;if(s!==null)return Rm(n,s,e);Zt(),n=n.memoizedState,s=Zt();var o=s.queue.dispatch;return s.memoizedState=e,[n,o,!1]}function ya(e,n,s,o){return e={tag:e,create:s,deps:o,inst:n,next:null},n=qe.updateQueue,n===null&&(n=nc(),qe.updateQueue=n),s=n.lastEffect,s===null?n.lastEffect=e.next=e:(o=s.next,s.next=e,e.next=o,n.lastEffect=e),e}function Mm(){return Zt().memoizedState}function ac(e,n,s,o){var d=Di();qe.flags|=e,d.memoizedState=ya(1|n,{destroy:void 0},s,o===void 0?null:o)}function oc(e,n,s,o){var d=Zt();o=o===void 0?null:o;var S=d.memoizedState.inst;mt!==null&&o!==null&&Ah(o,mt.memoizedState.deps)?d.memoizedState=ya(n,S,s,o):(qe.flags|=e,d.memoizedState=ya(1|n,S,s,o))}function Dm(e,n){ac(8390656,8,e,n)}function jh(e,n){oc(2048,8,e,n)}function MC(e){qe.flags|=4;var n=qe.updateQueue;if(n===null)n=nc(),qe.updateQueue=n,n.events=[e];else{var s=n.events;s===null?n.events=[e]:s.push(e)}}function Om(e){var n=Zt().memoizedState;return MC({ref:n,nextImpl:e}),function(){if((ut&2)!==0)throw Error(a(440));return n.impl.apply(void 0,arguments)}}function Bm(e,n){return oc(4,2,e,n)}function Nm(e,n){return oc(4,4,e,n)}function Im(e,n){if(typeof n=="function"){e=e();var s=n(e);return function(){typeof s=="function"?s():n(null)}}if(n!=null)return e=e(),n.current=e,function(){n.current=null}}function jm(e,n,s){s=s!=null?s.concat([e]):null,oc(4,4,Im.bind(null,n,e),s)}function zh(){}function zm(e,n){var s=Zt();n=n===void 0?null:n;var o=s.memoizedState;return n!==null&&Ah(n,o[1])?o[0]:(s.memoizedState=[e,n],e)}function $m(e,n){var s=Zt();n=n===void 0?null:n;var o=s.memoizedState;if(n!==null&&Ah(n,o[1]))return o[0];if(o=e(),Os){Vt(!0);try{e()}finally{Vt(!1)}}return s.memoizedState=[o,n],o}function $h(e,n,s){return s===void 0||(gr&1073741824)!==0&&(tt&261930)===0?e.memoizedState=n:(e.memoizedState=s,e=H_(),qe.lanes|=e,Zr|=e,s)}function Hm(e,n,s,o){return rn(s,n)?s:_a.current!==null?(e=$h(e,s,o),rn(e,n)||(ai=!0),e):(gr&42)===0||(gr&1073741824)!==0&&(tt&261930)===0?(ai=!0,e.memoizedState=s):(e=H_(),qe.lanes|=e,Zr|=e,n)}function Um(e,n,s,o,d){var S=V.p;V.p=S!==0&&8>S?S:8;var M=P.T,I={};P.T=I,Ph(e,!1,n,s);try{var K=d(),re=P.S;if(re!==null&&re(I,K),K!==null&&typeof K=="object"&&typeof K.then=="function"){var ue=TC(K,o);Ao(e,n,ue,un(e))}else Ao(e,n,o,un(e))}catch(fe){Ao(e,n,{then:function(){},status:"rejected",reason:fe},un())}finally{V.p=S,M!==null&&I.types!==null&&(M.types=I.types),P.T=M}}function DC(){}function Hh(e,n,s,o){if(e.tag!==5)throw Error(a(476));var d=Pm(e).queue;Um(e,d,n,Y,s===null?DC:function(){return Fm(e),s(o)})}function Pm(e){var n=e.memoizedState;if(n!==null)return n;n={memoizedState:Y,baseState:Y,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:mr,lastRenderedState:Y},next:null};var s={};return n.next={memoizedState:s,baseState:s,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:mr,lastRenderedState:s},next:null},e.memoizedState=n,e=e.alternate,e!==null&&(e.memoizedState=n),n}function Fm(e){var n=Pm(e);n.next===null&&(n=e.alternate.memoizedState),Ao(e,n.next.queue,{},un())}function Uh(){return Ci(qo)}function qm(){return Zt().memoizedState}function Wm(){return Zt().memoizedState}function OC(e){for(var n=e.return;n!==null;){switch(n.tag){case 24:case 3:var s=un();e=Wr(s);var o=Gr(n,e,s);o!==null&&(Ki(o,n,s),Co(o,n,s)),n={cache:mh()},e.payload=n;return}n=n.return}}function BC(e,n,s){var o=un();s={lane:o,revertLane:0,gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null},lc(e)?Km(n,s):(s=sh(e,n,s,o),s!==null&&(Ki(s,e,o),Ym(s,n,o)))}function Gm(e,n,s){var o=un();Ao(e,n,s,o)}function Ao(e,n,s,o){var d={lane:o,revertLane:0,gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null};if(lc(e))Km(n,d);else{var S=e.alternate;if(e.lanes===0&&(S===null||S.lanes===0)&&(S=n.lastRenderedReducer,S!==null))try{var M=n.lastRenderedState,I=S(M,s);if(d.hasEagerState=!0,d.eagerState=I,rn(I,M))return Pl(e,n,d,0),St===null&&Ul(),!1}catch{}if(s=sh(e,n,d,o),s!==null)return Ki(s,e,o),Ym(s,n,o),!0}return!1}function Ph(e,n,s,o){if(o={lane:2,revertLane:yd(),gesture:null,action:o,hasEagerState:!1,eagerState:null,next:null},lc(e)){if(n)throw Error(a(479))}else n=sh(e,s,o,2),n!==null&&Ki(n,e,2)}function lc(e){var n=e.alternate;return e===qe||n!==null&&n===qe}function Km(e,n){va=tc=!0;var s=e.pending;s===null?n.next=n:(n.next=s.next,s.next=n),e.pending=n}function Ym(e,n,s){if((s&4194048)!==0){var o=n.lanes;o&=e.pendingLanes,s|=o,n.lanes=s,je(e,s)}}var ko={readContext:Ci,use:rc,useCallback:Pt,useContext:Pt,useEffect:Pt,useImperativeHandle:Pt,useLayoutEffect:Pt,useInsertionEffect:Pt,useMemo:Pt,useReducer:Pt,useRef:Pt,useState:Pt,useDebugValue:Pt,useDeferredValue:Pt,useTransition:Pt,useSyncExternalStore:Pt,useId:Pt,useHostTransitionStatus:Pt,useFormState:Pt,useActionState:Pt,useOptimistic:Pt,useMemoCache:Pt,useCacheRefresh:Pt};ko.useEffectEvent=Pt;var Vm={readContext:Ci,use:rc,useCallback:function(e,n){return Di().memoizedState=[e,n===void 0?null:n],e},useContext:Ci,useEffect:Dm,useImperativeHandle:function(e,n,s){s=s!=null?s.concat([e]):null,ac(4194308,4,Im.bind(null,n,e),s)},useLayoutEffect:function(e,n){return ac(4194308,4,e,n)},useInsertionEffect:function(e,n){ac(4,2,e,n)},useMemo:function(e,n){var s=Di();n=n===void 0?null:n;var o=e();if(Os){Vt(!0);try{e()}finally{Vt(!1)}}return s.memoizedState=[o,n],o},useReducer:function(e,n,s){var o=Di();if(s!==void 0){var d=s(n);if(Os){Vt(!0);try{s(n)}finally{Vt(!1)}}}else d=n;return o.memoizedState=o.baseState=d,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:d},o.queue=e,e=e.dispatch=BC.bind(null,qe,e),[o.memoizedState,e]},useRef:function(e){var n=Di();return e={current:e},n.memoizedState=e},useState:function(e){e=Nh(e);var n=e.queue,s=Gm.bind(null,qe,n);return n.dispatch=s,[e.memoizedState,s]},useDebugValue:zh,useDeferredValue:function(e,n){var s=Di();return $h(s,e,n)},useTransition:function(){var e=Nh(!1);return e=Um.bind(null,qe,e.queue,!0,!1),Di().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,n,s){var o=qe,d=Di();if(rt){if(s===void 0)throw Error(a(407));s=s()}else{if(s=n(),St===null)throw Error(a(349));(tt&127)!==0||mm(o,n,s)}d.memoizedState=s;var S={value:s,getSnapshot:n};return d.queue=S,Dm(vm.bind(null,o,S,e),[e]),o.flags|=2048,ya(9,{destroy:void 0},_m.bind(null,o,S,s,n),null),s},useId:function(){var e=Di(),n=St.identifierPrefix;if(rt){var s=Gn,o=Wn;s=(o&~(1<<32-$t(o)-1)).toString(32)+s,n="_"+n+"R_"+s,s=ic++,0<s&&(n+="H"+s.toString(32)),n+="_"}else s=AC++,n="_"+n+"r_"+s.toString(32)+"_";return e.memoizedState=n},useHostTransitionStatus:Uh,useFormState:Am,useActionState:Am,useOptimistic:function(e){var n=Di();n.memoizedState=n.baseState=e;var s={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return n.queue=s,n=Ph.bind(null,qe,!0,s),s.dispatch=n,[e,n]},useMemoCache:Dh,useCacheRefresh:function(){return Di().memoizedState=OC.bind(null,qe)},useEffectEvent:function(e){var n=Di(),s={impl:e};return n.memoizedState=s,function(){if((ut&2)!==0)throw Error(a(440));return s.impl.apply(void 0,arguments)}}},Fh={readContext:Ci,use:rc,useCallback:zm,useContext:Ci,useEffect:jh,useImperativeHandle:jm,useInsertionEffect:Bm,useLayoutEffect:Nm,useMemo:$m,useReducer:sc,useRef:Mm,useState:function(){return sc(mr)},useDebugValue:zh,useDeferredValue:function(e,n){var s=Zt();return Hm(s,mt.memoizedState,e,n)},useTransition:function(){var e=sc(mr)[0],n=Zt().memoizedState;return[typeof e=="boolean"?e:To(e),n]},useSyncExternalStore:gm,useId:qm,useHostTransitionStatus:Uh,useFormState:km,useActionState:km,useOptimistic:function(e,n){var s=Zt();return Sm(s,mt,e,n)},useMemoCache:Dh,useCacheRefresh:Wm};Fh.useEffectEvent=Om;var Xm={readContext:Ci,use:rc,useCallback:zm,useContext:Ci,useEffect:jh,useImperativeHandle:jm,useInsertionEffect:Bm,useLayoutEffect:Nm,useMemo:$m,useReducer:Bh,useRef:Mm,useState:function(){return Bh(mr)},useDebugValue:zh,useDeferredValue:function(e,n){var s=Zt();return mt===null?$h(s,e,n):Hm(s,mt.memoizedState,e,n)},useTransition:function(){var e=Bh(mr)[0],n=Zt().memoizedState;return[typeof e=="boolean"?e:To(e),n]},useSyncExternalStore:gm,useId:qm,useHostTransitionStatus:Uh,useFormState:Lm,useActionState:Lm,useOptimistic:function(e,n){var s=Zt();return mt!==null?Sm(s,mt,e,n):(s.baseState=e,[e,s.queue.dispatch])},useMemoCache:Dh,useCacheRefresh:Wm};Xm.useEffectEvent=Om;function qh(e,n,s,o){n=e.memoizedState,s=s(o,n),s=s==null?n:p({},n,s),e.memoizedState=s,e.lanes===0&&(e.updateQueue.baseState=s)}var Wh={enqueueSetState:function(e,n,s){e=e._reactInternals;var o=un(),d=Wr(o);d.payload=n,s!=null&&(d.callback=s),n=Gr(e,d,o),n!==null&&(Ki(n,e,o),Co(n,e,o))},enqueueReplaceState:function(e,n,s){e=e._reactInternals;var o=un(),d=Wr(o);d.tag=1,d.payload=n,s!=null&&(d.callback=s),n=Gr(e,d,o),n!==null&&(Ki(n,e,o),Co(n,e,o))},enqueueForceUpdate:function(e,n){e=e._reactInternals;var s=un(),o=Wr(s);o.tag=2,n!=null&&(o.callback=n),n=Gr(e,o,s),n!==null&&(Ki(n,e,s),Co(n,e,s))}};function Zm(e,n,s,o,d,S,M){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(o,S,M):n.prototype&&n.prototype.isPureReactComponent?!po(s,o)||!po(d,S):!0}function Jm(e,n,s,o){e=n.state,typeof n.componentWillReceiveProps=="function"&&n.componentWillReceiveProps(s,o),typeof n.UNSAFE_componentWillReceiveProps=="function"&&n.UNSAFE_componentWillReceiveProps(s,o),n.state!==e&&Wh.enqueueReplaceState(n,n.state,null)}function Bs(e,n){var s=n;if("ref"in n){s={};for(var o in n)o!=="ref"&&(s[o]=n[o])}if(e=e.defaultProps){s===n&&(s=p({},s));for(var d in e)s[d]===void 0&&(s[d]=e[d])}return s}function Qm(e){Hl(e)}function e_(e){console.error(e)}function t_(e){Hl(e)}function cc(e,n){try{var s=e.onUncaughtError;s(n.value,{componentStack:n.stack})}catch(o){setTimeout(function(){throw o})}}function i_(e,n,s){try{var o=e.onCaughtError;o(s.value,{componentStack:s.stack,errorBoundary:n.tag===1?n.stateNode:null})}catch(d){setTimeout(function(){throw d})}}function Gh(e,n,s){return s=Wr(s),s.tag=3,s.payload={element:null},s.callback=function(){cc(e,n)},s}function n_(e){return e=Wr(e),e.tag=3,e}function r_(e,n,s,o){var d=s.type.getDerivedStateFromError;if(typeof d=="function"){var S=o.value;e.payload=function(){return d(S)},e.callback=function(){i_(n,s,o)}}var M=s.stateNode;M!==null&&typeof M.componentDidCatch=="function"&&(e.callback=function(){i_(n,s,o),typeof d!="function"&&(Jr===null?Jr=new Set([this]):Jr.add(this));var I=o.stack;this.componentDidCatch(o.value,{componentStack:I!==null?I:""})})}function NC(e,n,s,o,d){if(s.flags|=32768,o!==null&&typeof o=="object"&&typeof o.then=="function"){if(n=s.alternate,n!==null&&da(n,s,d,!0),s=an.current,s!==null){switch(s.tag){case 31:case 13:return yn===null?Sc():s.alternate===null&&Ft===0&&(Ft=3),s.flags&=-257,s.flags|=65536,s.lanes=d,o===Xl?s.flags|=16384:(n=s.updateQueue,n===null?s.updateQueue=new Set([o]):n.add(o),_d(e,o,d)),!1;case 22:return s.flags|=65536,o===Xl?s.flags|=16384:(n=s.updateQueue,n===null?(n={transitions:null,markerInstances:null,retryQueue:new Set([o])},s.updateQueue=n):(s=n.retryQueue,s===null?n.retryQueue=new Set([o]):s.add(o)),_d(e,o,d)),!1}throw Error(a(435,s.tag))}return _d(e,o,d),Sc(),!1}if(rt)return n=an.current,n!==null?((n.flags&65536)===0&&(n.flags|=256),n.flags|=65536,n.lanes=d,o!==hh&&(e=Error(a(422),{cause:o}),_o(mn(e,s)))):(o!==hh&&(n=Error(a(423),{cause:o}),_o(mn(n,s))),e=e.current.alternate,e.flags|=65536,d&=-d,e.lanes|=d,o=mn(o,s),d=Gh(e.stateNode,o,d),Ch(e,d),Ft!==4&&(Ft=2)),!1;var S=Error(a(520),{cause:o});if(S=mn(S,s),Io===null?Io=[S]:Io.push(S),Ft!==4&&(Ft=2),n===null)return!0;o=mn(o,s),s=n;do{switch(s.tag){case 3:return s.flags|=65536,e=d&-d,s.lanes|=e,e=Gh(s.stateNode,o,e),Ch(s,e),!1;case 1:if(n=s.type,S=s.stateNode,(s.flags&128)===0&&(typeof n.getDerivedStateFromError=="function"||S!==null&&typeof S.componentDidCatch=="function"&&(Jr===null||!Jr.has(S))))return s.flags|=65536,d&=-d,s.lanes|=d,d=n_(d),r_(d,e,s,o),Ch(s,d),!1}s=s.return}while(s!==null);return!1}var Kh=Error(a(461)),ai=!1;function wi(e,n,s,o){n.child=e===null?lm(n,null,s,o):Ds(n,e.child,s,o)}function s_(e,n,s,o,d){s=s.render;var S=n.ref;if("ref"in o){var M={};for(var I in o)I!=="ref"&&(M[I]=o[I])}else M=o;return ks(n),o=kh(e,n,s,M,S,d),I=Rh(),e!==null&&!ai?(Lh(e,n,d),_r(e,n,d)):(rt&&I&&ch(n),n.flags|=1,wi(e,n,o,d),n.child)}function a_(e,n,s,o,d){if(e===null){var S=s.type;return typeof S=="function"&&!ah(S)&&S.defaultProps===void 0&&s.compare===null?(n.tag=15,n.type=S,o_(e,n,S,o,d)):(e=ql(s.type,null,o,n,n.mode,d),e.ref=n.ref,e.return=n,n.child=e)}if(S=e.child,!td(e,d)){var M=S.memoizedProps;if(s=s.compare,s=s!==null?s:po,s(M,o)&&e.ref===n.ref)return _r(e,n,d)}return n.flags|=1,e=hr(S,o),e.ref=n.ref,e.return=n,n.child=e}function o_(e,n,s,o,d){if(e!==null){var S=e.memoizedProps;if(po(S,o)&&e.ref===n.ref)if(ai=!1,n.pendingProps=o=S,td(e,d))(e.flags&131072)!==0&&(ai=!0);else return n.lanes=e.lanes,_r(e,n,d)}return Yh(e,n,s,o,d)}function l_(e,n,s,o){var d=o.children,S=e!==null?e.memoizedState:null;if(e===null&&n.stateNode===null&&(n.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),o.mode==="hidden"){if((n.flags&128)!==0){if(S=S!==null?S.baseLanes|s:s,e!==null){for(o=n.child=e.child,d=0;o!==null;)d=d|o.lanes|o.childLanes,o=o.sibling;o=d&~S}else o=0,n.child=null;return c_(e,n,S,s,o)}if((s&536870912)!==0)n.memoizedState={baseLanes:0,cachePool:null},e!==null&&Yl(n,S!==null?S.cachePool:null),S!==null?hm(n,S):xh(),dm(n);else return o=n.lanes=536870912,c_(e,n,S!==null?S.baseLanes|s:s,s,o)}else S!==null?(Yl(n,S.cachePool),hm(n,S),Yr(),n.memoizedState=null):(e!==null&&Yl(n,null),xh(),Yr());return wi(e,n,d,s),n.child}function Ro(e,n){return e!==null&&e.tag===22||n.stateNode!==null||(n.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),n.sibling}function c_(e,n,s,o,d){var S=vh();return S=S===null?null:{parent:ri._currentValue,pool:S},n.memoizedState={baseLanes:s,cachePool:S},e!==null&&Yl(n,null),xh(),dm(n),e!==null&&da(e,n,o,!0),n.childLanes=d,null}function uc(e,n){return n=dc({mode:n.mode,children:n.children},e.mode),n.ref=e.ref,e.child=n,n.return=e,n}function u_(e,n,s){return Ds(n,e.child,null,s),e=uc(n,n.pendingProps),e.flags|=2,on(n),n.memoizedState=null,e}function IC(e,n,s){var o=n.pendingProps,d=(n.flags&128)!==0;if(n.flags&=-129,e===null){if(rt){if(o.mode==="hidden")return e=uc(n,o),n.lanes=536870912,Ro(null,e);if(Th(n),(e=At)?(e=Cv(e,bn),e=e!==null&&e.data==="&"?e:null,e!==null&&(n.memoizedState={dehydrated:e,treeContext:Hr!==null?{id:Wn,overflow:Gn}:null,retryLane:536870912,hydrationErrors:null},s=Kg(e),s.return=n,n.child=s,Si=n,At=null)):e=null,e===null)throw Pr(n);return n.lanes=536870912,null}return uc(n,o)}var S=e.memoizedState;if(S!==null){var M=S.dehydrated;if(Th(n),d)if(n.flags&256)n.flags&=-257,n=u_(e,n,s);else if(n.memoizedState!==null)n.child=e.child,n.flags|=128,n=null;else throw Error(a(558));else if(ai||da(e,n,s,!1),d=(s&e.childLanes)!==0,ai||d){if(o=St,o!==null&&(M=Nt(o,s),M!==0&&M!==S.retryLane))throw S.retryLane=M,xs(e,M),Ki(o,e,M),Kh;Sc(),n=u_(e,n,s)}else e=S.treeContext,At=Sn(M.nextSibling),Si=n,rt=!0,Ur=null,bn=!1,e!==null&&Xg(n,e),n=uc(n,o),n.flags|=4096;return n}return e=hr(e.child,{mode:o.mode,children:o.children}),e.ref=n.ref,n.child=e,e.return=n,e}function hc(e,n){var s=n.ref;if(s===null)e!==null&&e.ref!==null&&(n.flags|=4194816);else{if(typeof s!="function"&&typeof s!="object")throw Error(a(284));(e===null||e.ref!==s)&&(n.flags|=4194816)}}function Yh(e,n,s,o,d){return ks(n),s=kh(e,n,s,o,void 0,d),o=Rh(),e!==null&&!ai?(Lh(e,n,d),_r(e,n,d)):(rt&&o&&ch(n),n.flags|=1,wi(e,n,s,d),n.child)}function h_(e,n,s,o,d,S){return ks(n),n.updateQueue=null,s=pm(n,o,s,d),fm(e),o=Rh(),e!==null&&!ai?(Lh(e,n,S),_r(e,n,S)):(rt&&o&&ch(n),n.flags|=1,wi(e,n,s,S),n.child)}function d_(e,n,s,o,d){if(ks(n),n.stateNode===null){var S=la,M=s.contextType;typeof M=="object"&&M!==null&&(S=Ci(M)),S=new s(o,S),n.memoizedState=S.state!==null&&S.state!==void 0?S.state:null,S.updater=Wh,n.stateNode=S,S._reactInternals=n,S=n.stateNode,S.props=o,S.state=n.memoizedState,S.refs={},yh(n),M=s.contextType,S.context=typeof M=="object"&&M!==null?Ci(M):la,S.state=n.memoizedState,M=s.getDerivedStateFromProps,typeof M=="function"&&(qh(n,s,M,o),S.state=n.memoizedState),typeof s.getDerivedStateFromProps=="function"||typeof S.getSnapshotBeforeUpdate=="function"||typeof S.UNSAFE_componentWillMount!="function"&&typeof S.componentWillMount!="function"||(M=S.state,typeof S.componentWillMount=="function"&&S.componentWillMount(),typeof S.UNSAFE_componentWillMount=="function"&&S.UNSAFE_componentWillMount(),M!==S.state&&Wh.enqueueReplaceState(S,S.state,null),xo(n,o,S,d),wo(),S.state=n.memoizedState),typeof S.componentDidMount=="function"&&(n.flags|=4194308),o=!0}else if(e===null){S=n.stateNode;var I=n.memoizedProps,K=Bs(s,I);S.props=K;var re=S.context,ue=s.contextType;M=la,typeof ue=="object"&&ue!==null&&(M=Ci(ue));var fe=s.getDerivedStateFromProps;ue=typeof fe=="function"||typeof S.getSnapshotBeforeUpdate=="function",I=n.pendingProps!==I,ue||typeof S.UNSAFE_componentWillReceiveProps!="function"&&typeof S.componentWillReceiveProps!="function"||(I||re!==M)&&Jm(n,S,o,M),qr=!1;var se=n.memoizedState;S.state=se,xo(n,o,S,d),wo(),re=n.memoizedState,I||se!==re||qr?(typeof fe=="function"&&(qh(n,s,fe,o),re=n.memoizedState),(K=qr||Zm(n,s,K,o,se,re,M))?(ue||typeof S.UNSAFE_componentWillMount!="function"&&typeof S.componentWillMount!="function"||(typeof S.componentWillMount=="function"&&S.componentWillMount(),typeof S.UNSAFE_componentWillMount=="function"&&S.UNSAFE_componentWillMount()),typeof S.componentDidMount=="function"&&(n.flags|=4194308)):(typeof S.componentDidMount=="function"&&(n.flags|=4194308),n.memoizedProps=o,n.memoizedState=re),S.props=o,S.state=re,S.context=M,o=K):(typeof S.componentDidMount=="function"&&(n.flags|=4194308),o=!1)}else{S=n.stateNode,Sh(e,n),M=n.memoizedProps,ue=Bs(s,M),S.props=ue,fe=n.pendingProps,se=S.context,re=s.contextType,K=la,typeof re=="object"&&re!==null&&(K=Ci(re)),I=s.getDerivedStateFromProps,(re=typeof I=="function"||typeof S.getSnapshotBeforeUpdate=="function")||typeof S.UNSAFE_componentWillReceiveProps!="function"&&typeof S.componentWillReceiveProps!="function"||(M!==fe||se!==K)&&Jm(n,S,o,K),qr=!1,se=n.memoizedState,S.state=se,xo(n,o,S,d),wo();var le=n.memoizedState;M!==fe||se!==le||qr||e!==null&&e.dependencies!==null&&Gl(e.dependencies)?(typeof I=="function"&&(qh(n,s,I,o),le=n.memoizedState),(ue=qr||Zm(n,s,ue,o,se,le,K)||e!==null&&e.dependencies!==null&&Gl(e.dependencies))?(re||typeof S.UNSAFE_componentWillUpdate!="function"&&typeof S.componentWillUpdate!="function"||(typeof S.componentWillUpdate=="function"&&S.componentWillUpdate(o,le,K),typeof S.UNSAFE_componentWillUpdate=="function"&&S.UNSAFE_componentWillUpdate(o,le,K)),typeof S.componentDidUpdate=="function"&&(n.flags|=4),typeof S.getSnapshotBeforeUpdate=="function"&&(n.flags|=1024)):(typeof S.componentDidUpdate!="function"||M===e.memoizedProps&&se===e.memoizedState||(n.flags|=4),typeof S.getSnapshotBeforeUpdate!="function"||M===e.memoizedProps&&se===e.memoizedState||(n.flags|=1024),n.memoizedProps=o,n.memoizedState=le),S.props=o,S.state=le,S.context=K,o=ue):(typeof S.componentDidUpdate!="function"||M===e.memoizedProps&&se===e.memoizedState||(n.flags|=4),typeof S.getSnapshotBeforeUpdate!="function"||M===e.memoizedProps&&se===e.memoizedState||(n.flags|=1024),o=!1)}return S=o,hc(e,n),o=(n.flags&128)!==0,S||o?(S=n.stateNode,s=o&&typeof s.getDerivedStateFromError!="function"?null:S.render(),n.flags|=1,e!==null&&o?(n.child=Ds(n,e.child,null,d),n.child=Ds(n,null,s,d)):wi(e,n,s,d),n.memoizedState=S.state,e=n.child):e=_r(e,n,d),e}function f_(e,n,s,o){return Ts(),n.flags|=256,wi(e,n,s,o),n.child}var Vh={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Xh(e){return{baseLanes:e,cachePool:im()}}function Zh(e,n,s){return e=e!==null?e.childLanes&~s:0,n&&(e|=cn),e}function p_(e,n,s){var o=n.pendingProps,d=!1,S=(n.flags&128)!==0,M;if((M=S)||(M=e!==null&&e.memoizedState===null?!1:(Xt.current&2)!==0),M&&(d=!0,n.flags&=-129),M=(n.flags&32)!==0,n.flags&=-33,e===null){if(rt){if(d?Kr(n):Yr(),(e=At)?(e=Cv(e,bn),e=e!==null&&e.data!=="&"?e:null,e!==null&&(n.memoizedState={dehydrated:e,treeContext:Hr!==null?{id:Wn,overflow:Gn}:null,retryLane:536870912,hydrationErrors:null},s=Kg(e),s.return=n,n.child=s,Si=n,At=null)):e=null,e===null)throw Pr(n);return Od(e)?n.lanes=32:n.lanes=536870912,null}var I=o.children;return o=o.fallback,d?(Yr(),d=n.mode,I=dc({mode:"hidden",children:I},d),o=Es(o,d,s,null),I.return=n,o.return=n,I.sibling=o,n.child=I,o=n.child,o.memoizedState=Xh(s),o.childLanes=Zh(e,M,s),n.memoizedState=Vh,Ro(null,o)):(Kr(n),Jh(n,I))}var K=e.memoizedState;if(K!==null&&(I=K.dehydrated,I!==null)){if(S)n.flags&256?(Kr(n),n.flags&=-257,n=Qh(e,n,s)):n.memoizedState!==null?(Yr(),n.child=e.child,n.flags|=128,n=null):(Yr(),I=o.fallback,d=n.mode,o=dc({mode:"visible",children:o.children},d),I=Es(I,d,s,null),I.flags|=2,o.return=n,I.return=n,o.sibling=I,n.child=o,Ds(n,e.child,null,s),o=n.child,o.memoizedState=Xh(s),o.childLanes=Zh(e,M,s),n.memoizedState=Vh,n=Ro(null,o));else if(Kr(n),Od(I)){if(M=I.nextSibling&&I.nextSibling.dataset,M)var re=M.dgst;M=re,o=Error(a(419)),o.stack="",o.digest=M,_o({value:o,source:null,stack:null}),n=Qh(e,n,s)}else if(ai||da(e,n,s,!1),M=(s&e.childLanes)!==0,ai||M){if(M=St,M!==null&&(o=Nt(M,s),o!==0&&o!==K.retryLane))throw K.retryLane=o,xs(e,o),Ki(M,e,o),Kh;Dd(I)||Sc(),n=Qh(e,n,s)}else Dd(I)?(n.flags|=192,n.child=e.child,n=null):(e=K.treeContext,At=Sn(I.nextSibling),Si=n,rt=!0,Ur=null,bn=!1,e!==null&&Xg(n,e),n=Jh(n,o.children),n.flags|=4096);return n}return d?(Yr(),I=o.fallback,d=n.mode,K=e.child,re=K.sibling,o=hr(K,{mode:"hidden",children:o.children}),o.subtreeFlags=K.subtreeFlags&65011712,re!==null?I=hr(re,I):(I=Es(I,d,s,null),I.flags|=2),I.return=n,o.return=n,o.sibling=I,n.child=o,Ro(null,o),o=n.child,I=e.child.memoizedState,I===null?I=Xh(s):(d=I.cachePool,d!==null?(K=ri._currentValue,d=d.parent!==K?{parent:K,pool:K}:d):d=im(),I={baseLanes:I.baseLanes|s,cachePool:d}),o.memoizedState=I,o.childLanes=Zh(e,M,s),n.memoizedState=Vh,Ro(e.child,o)):(Kr(n),s=e.child,e=s.sibling,s=hr(s,{mode:"visible",children:o.children}),s.return=n,s.sibling=null,e!==null&&(M=n.deletions,M===null?(n.deletions=[e],n.flags|=16):M.push(e)),n.child=s,n.memoizedState=null,s)}function Jh(e,n){return n=dc({mode:"visible",children:n},e.mode),n.return=e,e.child=n}function dc(e,n){return e=sn(22,e,null,n),e.lanes=0,e}function Qh(e,n,s){return Ds(n,e.child,null,s),e=Jh(n,n.pendingProps.children),e.flags|=2,n.memoizedState=null,e}function g_(e,n,s){e.lanes|=n;var o=e.alternate;o!==null&&(o.lanes|=n),ph(e.return,n,s)}function ed(e,n,s,o,d,S){var M=e.memoizedState;M===null?e.memoizedState={isBackwards:n,rendering:null,renderingStartTime:0,last:o,tail:s,tailMode:d,treeForkCount:S}:(M.isBackwards=n,M.rendering=null,M.renderingStartTime=0,M.last=o,M.tail=s,M.tailMode=d,M.treeForkCount=S)}function m_(e,n,s){var o=n.pendingProps,d=o.revealOrder,S=o.tail;o=o.children;var M=Xt.current,I=(M&2)!==0;if(I?(M=M&1|2,n.flags|=128):M&=1,X(Xt,M),wi(e,n,o,s),o=rt?mo:0,!I&&e!==null&&(e.flags&128)!==0)e:for(e=n.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&g_(e,s,n);else if(e.tag===19)g_(e,s,n);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===n)break e;for(;e.sibling===null;){if(e.return===null||e.return===n)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(d){case"forwards":for(s=n.child,d=null;s!==null;)e=s.alternate,e!==null&&ec(e)===null&&(d=s),s=s.sibling;s=d,s===null?(d=n.child,n.child=null):(d=s.sibling,s.sibling=null),ed(n,!1,d,s,S,o);break;case"backwards":case"unstable_legacy-backwards":for(s=null,d=n.child,n.child=null;d!==null;){if(e=d.alternate,e!==null&&ec(e)===null){n.child=d;break}e=d.sibling,d.sibling=s,s=d,d=e}ed(n,!0,s,null,S,o);break;case"together":ed(n,!1,null,null,void 0,o);break;default:n.memoizedState=null}return n.child}function _r(e,n,s){if(e!==null&&(n.dependencies=e.dependencies),Zr|=n.lanes,(s&n.childLanes)===0)if(e!==null){if(da(e,n,s,!1),(s&n.childLanes)===0)return null}else return null;if(e!==null&&n.child!==e.child)throw Error(a(153));if(n.child!==null){for(e=n.child,s=hr(e,e.pendingProps),n.child=s,s.return=n;e.sibling!==null;)e=e.sibling,s=s.sibling=hr(e,e.pendingProps),s.return=n;s.sibling=null}return n.child}function td(e,n){return(e.lanes&n)!==0?!0:(e=e.dependencies,!!(e!==null&&Gl(e)))}function jC(e,n,s){switch(n.tag){case 3:$(n,n.stateNode.containerInfo),Fr(n,ri,e.memoizedState.cache),Ts();break;case 27:case 5:ge(n);break;case 4:$(n,n.stateNode.containerInfo);break;case 10:Fr(n,n.type,n.memoizedProps.value);break;case 31:if(n.memoizedState!==null)return n.flags|=128,Th(n),null;break;case 13:var o=n.memoizedState;if(o!==null)return o.dehydrated!==null?(Kr(n),n.flags|=128,null):(s&n.child.childLanes)!==0?p_(e,n,s):(Kr(n),e=_r(e,n,s),e!==null?e.sibling:null);Kr(n);break;case 19:var d=(e.flags&128)!==0;if(o=(s&n.childLanes)!==0,o||(da(e,n,s,!1),o=(s&n.childLanes)!==0),d){if(o)return m_(e,n,s);n.flags|=128}if(d=n.memoizedState,d!==null&&(d.rendering=null,d.tail=null,d.lastEffect=null),X(Xt,Xt.current),o)break;return null;case 22:return n.lanes=0,l_(e,n,s,n.pendingProps);case 24:Fr(n,ri,e.memoizedState.cache)}return _r(e,n,s)}function __(e,n,s){if(e!==null)if(e.memoizedProps!==n.pendingProps)ai=!0;else{if(!td(e,s)&&(n.flags&128)===0)return ai=!1,jC(e,n,s);ai=(e.flags&131072)!==0}else ai=!1,rt&&(n.flags&1048576)!==0&&Vg(n,mo,n.index);switch(n.lanes=0,n.tag){case 16:e:{var o=n.pendingProps;if(e=Ls(n.elementType),n.type=e,typeof e=="function")ah(e)?(o=Bs(e,o),n.tag=1,n=d_(null,n,e,o,s)):(n.tag=0,n=Yh(null,n,e,o,s));else{if(e!=null){var d=e.$$typeof;if(d===E){n.tag=11,n=s_(null,n,e,o,s);break e}else if(d===D){n.tag=14,n=a_(null,n,e,o,s);break e}}throw n=J(e)||e,Error(a(306,n,""))}}return n;case 0:return Yh(e,n,n.type,n.pendingProps,s);case 1:return o=n.type,d=Bs(o,n.pendingProps),d_(e,n,o,d,s);case 3:e:{if($(n,n.stateNode.containerInfo),e===null)throw Error(a(387));o=n.pendingProps;var S=n.memoizedState;d=S.element,Sh(e,n),xo(n,o,null,s);var M=n.memoizedState;if(o=M.cache,Fr(n,ri,o),o!==S.cache&&gh(n,[ri],s,!0),wo(),o=M.element,S.isDehydrated)if(S={element:o,isDehydrated:!1,cache:M.cache},n.updateQueue.baseState=S,n.memoizedState=S,n.flags&256){n=f_(e,n,o,s);break e}else if(o!==d){d=mn(Error(a(424)),n),_o(d),n=f_(e,n,o,s);break e}else for(e=n.stateNode.containerInfo,e.nodeType===9?e=e.body:e=e.nodeName==="HTML"?e.ownerDocument.body:e,At=Sn(e.firstChild),Si=n,rt=!0,Ur=null,bn=!0,s=lm(n,null,o,s),n.child=s;s;)s.flags=s.flags&-3|4096,s=s.sibling;else{if(Ts(),o===d){n=_r(e,n,s);break e}wi(e,n,o,s)}n=n.child}return n;case 26:return hc(e,n),e===null?(s=kv(n.type,null,n.pendingProps,null))?n.memoizedState=s:rt||(s=n.type,e=n.pendingProps,o=kc(_e.current).createElement(s),o[Et]=n,o[wt]=e,xi(o,s,e),Ve(o),n.stateNode=o):n.memoizedState=kv(n.type,e.memoizedProps,n.pendingProps,e.memoizedState),null;case 27:return ge(n),e===null&&rt&&(o=n.stateNode=Ev(n.type,n.pendingProps,_e.current),Si=n,bn=!0,d=At,is(n.type)?(Bd=d,At=Sn(o.firstChild)):At=d),wi(e,n,n.pendingProps.children,s),hc(e,n),e===null&&(n.flags|=4194304),n.child;case 5:return e===null&&rt&&((d=o=At)&&(o=fw(o,n.type,n.pendingProps,bn),o!==null?(n.stateNode=o,Si=n,At=Sn(o.firstChild),bn=!1,d=!0):d=!1),d||Pr(n)),ge(n),d=n.type,S=n.pendingProps,M=e!==null?e.memoizedProps:null,o=S.children,Rd(d,S)?o=null:M!==null&&Rd(d,M)&&(n.flags|=32),n.memoizedState!==null&&(d=kh(e,n,kC,null,null,s),qo._currentValue=d),hc(e,n),wi(e,n,o,s),n.child;case 6:return e===null&&rt&&((e=s=At)&&(s=pw(s,n.pendingProps,bn),s!==null?(n.stateNode=s,Si=n,At=null,e=!0):e=!1),e||Pr(n)),null;case 13:return p_(e,n,s);case 4:return $(n,n.stateNode.containerInfo),o=n.pendingProps,e===null?n.child=Ds(n,null,o,s):wi(e,n,o,s),n.child;case 11:return s_(e,n,n.type,n.pendingProps,s);case 7:return wi(e,n,n.pendingProps,s),n.child;case 8:return wi(e,n,n.pendingProps.children,s),n.child;case 12:return wi(e,n,n.pendingProps.children,s),n.child;case 10:return o=n.pendingProps,Fr(n,n.type,o.value),wi(e,n,o.children,s),n.child;case 9:return d=n.type._context,o=n.pendingProps.children,ks(n),d=Ci(d),o=o(d),n.flags|=1,wi(e,n,o,s),n.child;case 14:return a_(e,n,n.type,n.pendingProps,s);case 15:return o_(e,n,n.type,n.pendingProps,s);case 19:return m_(e,n,s);case 31:return IC(e,n,s);case 22:return l_(e,n,s,n.pendingProps);case 24:return ks(n),o=Ci(ri),e===null?(d=vh(),d===null&&(d=St,S=mh(),d.pooledCache=S,S.refCount++,S!==null&&(d.pooledCacheLanes|=s),d=S),n.memoizedState={parent:o,cache:d},yh(n),Fr(n,ri,d)):((e.lanes&s)!==0&&(Sh(e,n),xo(n,null,null,s),wo()),d=e.memoizedState,S=n.memoizedState,d.parent!==o?(d={parent:o,cache:o},n.memoizedState=d,n.lanes===0&&(n.memoizedState=n.updateQueue.baseState=d),Fr(n,ri,o)):(o=S.cache,Fr(n,ri,o),o!==d.cache&&gh(n,[ri],s,!0))),wi(e,n,n.pendingProps.children,s),n.child;case 29:throw n.pendingProps}throw Error(a(156,n.tag))}function vr(e){e.flags|=4}function id(e,n,s,o,d){if((n=(e.mode&32)!==0)&&(n=!1),n){if(e.flags|=16777216,(d&335544128)===d)if(e.stateNode.complete)e.flags|=8192;else if(q_())e.flags|=8192;else throw Ms=Xl,bh}else e.flags&=-16777217}function v_(e,n){if(n.type!=="stylesheet"||(n.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!Ov(n))if(q_())e.flags|=8192;else throw Ms=Xl,bh}function fc(e,n){n!==null&&(e.flags|=4),e.flags&16384&&(n=e.tag!==22?Ie():536870912,e.lanes|=n,xa|=n)}function Lo(e,n){if(!rt)switch(e.tailMode){case"hidden":n=e.tail;for(var s=null;n!==null;)n.alternate!==null&&(s=n),n=n.sibling;s===null?e.tail=null:s.sibling=null;break;case"collapsed":s=e.tail;for(var o=null;s!==null;)s.alternate!==null&&(o=s),s=s.sibling;o===null?n||e.tail===null?e.tail=null:e.tail.sibling=null:o.sibling=null}}function kt(e){var n=e.alternate!==null&&e.alternate.child===e.child,s=0,o=0;if(n)for(var d=e.child;d!==null;)s|=d.lanes|d.childLanes,o|=d.subtreeFlags&65011712,o|=d.flags&65011712,d.return=e,d=d.sibling;else for(d=e.child;d!==null;)s|=d.lanes|d.childLanes,o|=d.subtreeFlags,o|=d.flags,d.return=e,d=d.sibling;return e.subtreeFlags|=o,e.childLanes=s,n}function zC(e,n,s){var o=n.pendingProps;switch(uh(n),n.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return kt(n),null;case 1:return kt(n),null;case 3:return s=n.stateNode,o=null,e!==null&&(o=e.memoizedState.cache),n.memoizedState.cache!==o&&(n.flags|=2048),pr(ri),oe(),s.pendingContext&&(s.context=s.pendingContext,s.pendingContext=null),(e===null||e.child===null)&&(ha(n)?vr(n):e===null||e.memoizedState.isDehydrated&&(n.flags&256)===0||(n.flags|=1024,dh())),kt(n),null;case 26:var d=n.type,S=n.memoizedState;return e===null?(vr(n),S!==null?(kt(n),v_(n,S)):(kt(n),id(n,d,null,o,s))):S?S!==e.memoizedState?(vr(n),kt(n),v_(n,S)):(kt(n),n.flags&=-16777217):(e=e.memoizedProps,e!==o&&vr(n),kt(n),id(n,d,e,o,s)),null;case 27:if(ye(n),s=_e.current,d=n.type,e!==null&&n.stateNode!=null)e.memoizedProps!==o&&vr(n);else{if(!o){if(n.stateNode===null)throw Error(a(166));return kt(n),null}e=ae.current,ha(n)?Zg(n):(e=Ev(d,o,s),n.stateNode=e,vr(n))}return kt(n),null;case 5:if(ye(n),d=n.type,e!==null&&n.stateNode!=null)e.memoizedProps!==o&&vr(n);else{if(!o){if(n.stateNode===null)throw Error(a(166));return kt(n),null}if(S=ae.current,ha(n))Zg(n);else{var M=kc(_e.current);switch(S){case 1:S=M.createElementNS("http://www.w3.org/2000/svg",d);break;case 2:S=M.createElementNS("http://www.w3.org/1998/Math/MathML",d);break;default:switch(d){case"svg":S=M.createElementNS("http://www.w3.org/2000/svg",d);break;case"math":S=M.createElementNS("http://www.w3.org/1998/Math/MathML",d);break;case"script":S=M.createElement("div"),S.innerHTML="<script><\/script>",S=S.removeChild(S.firstChild);break;case"select":S=typeof o.is=="string"?M.createElement("select",{is:o.is}):M.createElement("select"),o.multiple?S.multiple=!0:o.size&&(S.size=o.size);break;default:S=typeof o.is=="string"?M.createElement(d,{is:o.is}):M.createElement(d)}}S[Et]=n,S[wt]=o;e:for(M=n.child;M!==null;){if(M.tag===5||M.tag===6)S.appendChild(M.stateNode);else if(M.tag!==4&&M.tag!==27&&M.child!==null){M.child.return=M,M=M.child;continue}if(M===n)break e;for(;M.sibling===null;){if(M.return===null||M.return===n)break e;M=M.return}M.sibling.return=M.return,M=M.sibling}n.stateNode=S;e:switch(xi(S,d,o),d){case"button":case"input":case"select":case"textarea":o=!!o.autoFocus;break e;case"img":o=!0;break e;default:o=!1}o&&vr(n)}}return kt(n),id(n,n.type,e===null?null:e.memoizedProps,n.pendingProps,s),null;case 6:if(e&&n.stateNode!=null)e.memoizedProps!==o&&vr(n);else{if(typeof o!="string"&&n.stateNode===null)throw Error(a(166));if(e=_e.current,ha(n)){if(e=n.stateNode,s=n.memoizedProps,o=null,d=Si,d!==null)switch(d.tag){case 27:case 5:o=d.memoizedProps}e[Et]=n,e=!!(e.nodeValue===s||o!==null&&o.suppressHydrationWarning===!0||pv(e.nodeValue,s)),e||Pr(n,!0)}else e=kc(e).createTextNode(o),e[Et]=n,n.stateNode=e}return kt(n),null;case 31:if(s=n.memoizedState,e===null||e.memoizedState!==null){if(o=ha(n),s!==null){if(e===null){if(!o)throw Error(a(318));if(e=n.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(a(557));e[Et]=n}else Ts(),(n.flags&128)===0&&(n.memoizedState=null),n.flags|=4;kt(n),e=!1}else s=dh(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=s),e=!0;if(!e)return n.flags&256?(on(n),n):(on(n),null);if((n.flags&128)!==0)throw Error(a(558))}return kt(n),null;case 13:if(o=n.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(d=ha(n),o!==null&&o.dehydrated!==null){if(e===null){if(!d)throw Error(a(318));if(d=n.memoizedState,d=d!==null?d.dehydrated:null,!d)throw Error(a(317));d[Et]=n}else Ts(),(n.flags&128)===0&&(n.memoizedState=null),n.flags|=4;kt(n),d=!1}else d=dh(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=d),d=!0;if(!d)return n.flags&256?(on(n),n):(on(n),null)}return on(n),(n.flags&128)!==0?(n.lanes=s,n):(s=o!==null,e=e!==null&&e.memoizedState!==null,s&&(o=n.child,d=null,o.alternate!==null&&o.alternate.memoizedState!==null&&o.alternate.memoizedState.cachePool!==null&&(d=o.alternate.memoizedState.cachePool.pool),S=null,o.memoizedState!==null&&o.memoizedState.cachePool!==null&&(S=o.memoizedState.cachePool.pool),S!==d&&(o.flags|=2048)),s!==e&&s&&(n.child.flags|=8192),fc(n,n.updateQueue),kt(n),null);case 4:return oe(),e===null&&xd(n.stateNode.containerInfo),kt(n),null;case 10:return pr(n.type),kt(n),null;case 19:if(H(Xt),o=n.memoizedState,o===null)return kt(n),null;if(d=(n.flags&128)!==0,S=o.rendering,S===null)if(d)Lo(o,!1);else{if(Ft!==0||e!==null&&(e.flags&128)!==0)for(e=n.child;e!==null;){if(S=ec(e),S!==null){for(n.flags|=128,Lo(o,!1),e=S.updateQueue,n.updateQueue=e,fc(n,e),n.subtreeFlags=0,e=s,s=n.child;s!==null;)Gg(s,e),s=s.sibling;return X(Xt,Xt.current&1|2),rt&&dr(n,o.treeForkCount),n.child}e=e.sibling}o.tail!==null&&ct()>vc&&(n.flags|=128,d=!0,Lo(o,!1),n.lanes=4194304)}else{if(!d)if(e=ec(S),e!==null){if(n.flags|=128,d=!0,e=e.updateQueue,n.updateQueue=e,fc(n,e),Lo(o,!0),o.tail===null&&o.tailMode==="hidden"&&!S.alternate&&!rt)return kt(n),null}else 2*ct()-o.renderingStartTime>vc&&s!==536870912&&(n.flags|=128,d=!0,Lo(o,!1),n.lanes=4194304);o.isBackwards?(S.sibling=n.child,n.child=S):(e=o.last,e!==null?e.sibling=S:n.child=S,o.last=S)}return o.tail!==null?(e=o.tail,o.rendering=e,o.tail=e.sibling,o.renderingStartTime=ct(),e.sibling=null,s=Xt.current,X(Xt,d?s&1|2:s&1),rt&&dr(n,o.treeForkCount),e):(kt(n),null);case 22:case 23:return on(n),Eh(),o=n.memoizedState!==null,e!==null?e.memoizedState!==null!==o&&(n.flags|=8192):o&&(n.flags|=8192),o?(s&536870912)!==0&&(n.flags&128)===0&&(kt(n),n.subtreeFlags&6&&(n.flags|=8192)):kt(n),s=n.updateQueue,s!==null&&fc(n,s.retryQueue),s=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(s=e.memoizedState.cachePool.pool),o=null,n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(o=n.memoizedState.cachePool.pool),o!==s&&(n.flags|=2048),e!==null&&H(Rs),null;case 24:return s=null,e!==null&&(s=e.memoizedState.cache),n.memoizedState.cache!==s&&(n.flags|=2048),pr(ri),kt(n),null;case 25:return null;case 30:return null}throw Error(a(156,n.tag))}function $C(e,n){switch(uh(n),n.tag){case 1:return e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 3:return pr(ri),oe(),e=n.flags,(e&65536)!==0&&(e&128)===0?(n.flags=e&-65537|128,n):null;case 26:case 27:case 5:return ye(n),null;case 31:if(n.memoizedState!==null){if(on(n),n.alternate===null)throw Error(a(340));Ts()}return e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 13:if(on(n),e=n.memoizedState,e!==null&&e.dehydrated!==null){if(n.alternate===null)throw Error(a(340));Ts()}return e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 19:return H(Xt),null;case 4:return oe(),null;case 10:return pr(n.type),null;case 22:case 23:return on(n),Eh(),e!==null&&H(Rs),e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 24:return pr(ri),null;case 25:return null;default:return null}}function b_(e,n){switch(uh(n),n.tag){case 3:pr(ri),oe();break;case 26:case 27:case 5:ye(n);break;case 4:oe();break;case 31:n.memoizedState!==null&&on(n);break;case 13:on(n);break;case 19:H(Xt);break;case 10:pr(n.type);break;case 22:case 23:on(n),Eh(),e!==null&&H(Rs);break;case 24:pr(ri)}}function Mo(e,n){try{var s=n.updateQueue,o=s!==null?s.lastEffect:null;if(o!==null){var d=o.next;s=d;do{if((s.tag&e)===e){o=void 0;var S=s.create,M=s.inst;o=S(),M.destroy=o}s=s.next}while(s!==d)}}catch(I){gt(n,n.return,I)}}function Vr(e,n,s){try{var o=n.updateQueue,d=o!==null?o.lastEffect:null;if(d!==null){var S=d.next;o=S;do{if((o.tag&e)===e){var M=o.inst,I=M.destroy;if(I!==void 0){M.destroy=void 0,d=n;var K=s,re=I;try{re()}catch(ue){gt(d,K,ue)}}}o=o.next}while(o!==S)}}catch(ue){gt(n,n.return,ue)}}function y_(e){var n=e.updateQueue;if(n!==null){var s=e.stateNode;try{um(n,s)}catch(o){gt(e,e.return,o)}}}function S_(e,n,s){s.props=Bs(e.type,e.memoizedProps),s.state=e.memoizedState;try{s.componentWillUnmount()}catch(o){gt(e,n,o)}}function Do(e,n){try{var s=e.ref;if(s!==null){switch(e.tag){case 26:case 27:case 5:var o=e.stateNode;break;case 30:o=e.stateNode;break;default:o=e.stateNode}typeof s=="function"?e.refCleanup=s(o):s.current=o}}catch(d){gt(e,n,d)}}function Kn(e,n){var s=e.ref,o=e.refCleanup;if(s!==null)if(typeof o=="function")try{o()}catch(d){gt(e,n,d)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof s=="function")try{s(null)}catch(d){gt(e,n,d)}else s.current=null}function C_(e){var n=e.type,s=e.memoizedProps,o=e.stateNode;try{e:switch(n){case"button":case"input":case"select":case"textarea":s.autoFocus&&o.focus();break e;case"img":s.src?o.src=s.src:s.srcSet&&(o.srcset=s.srcSet)}}catch(d){gt(e,e.return,d)}}function nd(e,n,s){try{var o=e.stateNode;ow(o,e.type,s,n),o[wt]=n}catch(d){gt(e,e.return,d)}}function w_(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&is(e.type)||e.tag===4}function rd(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||w_(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&&is(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 sd(e,n,s){var o=e.tag;if(o===5||o===6)e=e.stateNode,n?(s.nodeType===9?s.body:s.nodeName==="HTML"?s.ownerDocument.body:s).insertBefore(e,n):(n=s.nodeType===9?s.body:s.nodeName==="HTML"?s.ownerDocument.body:s,n.appendChild(e),s=s._reactRootContainer,s!=null||n.onclick!==null||(n.onclick=Se));else if(o!==4&&(o===27&&is(e.type)&&(s=e.stateNode,n=null),e=e.child,e!==null))for(sd(e,n,s),e=e.sibling;e!==null;)sd(e,n,s),e=e.sibling}function pc(e,n,s){var o=e.tag;if(o===5||o===6)e=e.stateNode,n?s.insertBefore(e,n):s.appendChild(e);else if(o!==4&&(o===27&&is(e.type)&&(s=e.stateNode),e=e.child,e!==null))for(pc(e,n,s),e=e.sibling;e!==null;)pc(e,n,s),e=e.sibling}function x_(e){var n=e.stateNode,s=e.memoizedProps;try{for(var o=e.type,d=n.attributes;d.length;)n.removeAttributeNode(d[0]);xi(n,o,s),n[Et]=e,n[wt]=s}catch(S){gt(e,e.return,S)}}var br=!1,oi=!1,ad=!1,E_=typeof WeakSet=="function"?WeakSet:Set,di=null;function HC(e,n){if(e=e.containerInfo,Ad=Nc,e=jg(e),Qu(e)){if("selectionStart"in e)var s={start:e.selectionStart,end:e.selectionEnd};else e:{s=(s=e.ownerDocument)&&s.defaultView||window;var o=s.getSelection&&s.getSelection();if(o&&o.rangeCount!==0){s=o.anchorNode;var d=o.anchorOffset,S=o.focusNode;o=o.focusOffset;try{s.nodeType,S.nodeType}catch{s=null;break e}var M=0,I=-1,K=-1,re=0,ue=0,fe=e,se=null;t:for(;;){for(var le;fe!==s||d!==0&&fe.nodeType!==3||(I=M+d),fe!==S||o!==0&&fe.nodeType!==3||(K=M+o),fe.nodeType===3&&(M+=fe.nodeValue.length),(le=fe.firstChild)!==null;)se=fe,fe=le;for(;;){if(fe===e)break t;if(se===s&&++re===d&&(I=M),se===S&&++ue===o&&(K=M),(le=fe.nextSibling)!==null)break;fe=se,se=fe.parentNode}fe=le}s=I===-1||K===-1?null:{start:I,end:K}}else s=null}s=s||{start:0,end:0}}else s=null;for(kd={focusedElem:e,selectionRange:s},Nc=!1,di=n;di!==null;)if(n=di,e=n.child,(n.subtreeFlags&1028)!==0&&e!==null)e.return=n,di=e;else for(;di!==null;){switch(n=di,S=n.alternate,e=n.flags,n.tag){case 0:if((e&4)!==0&&(e=n.updateQueue,e=e!==null?e.events:null,e!==null))for(s=0;s<e.length;s++)d=e[s],d.ref.impl=d.nextImpl;break;case 11:case 15:break;case 1:if((e&1024)!==0&&S!==null){e=void 0,s=n,d=S.memoizedProps,S=S.memoizedState,o=s.stateNode;try{var Te=Bs(s.type,d);e=o.getSnapshotBeforeUpdate(Te,S),o.__reactInternalSnapshotBeforeUpdate=e}catch(ze){gt(s,s.return,ze)}}break;case 3:if((e&1024)!==0){if(e=n.stateNode.containerInfo,s=e.nodeType,s===9)Md(e);else if(s===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":Md(e);break;default:e.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((e&1024)!==0)throw Error(a(163))}if(e=n.sibling,e!==null){e.return=n.return,di=e;break}di=n.return}}function T_(e,n,s){var o=s.flags;switch(s.tag){case 0:case 11:case 15:Sr(e,s),o&4&&Mo(5,s);break;case 1:if(Sr(e,s),o&4)if(e=s.stateNode,n===null)try{e.componentDidMount()}catch(M){gt(s,s.return,M)}else{var d=Bs(s.type,n.memoizedProps);n=n.memoizedState;try{e.componentDidUpdate(d,n,e.__reactInternalSnapshotBeforeUpdate)}catch(M){gt(s,s.return,M)}}o&64&&y_(s),o&512&&Do(s,s.return);break;case 3:if(Sr(e,s),o&64&&(e=s.updateQueue,e!==null)){if(n=null,s.child!==null)switch(s.child.tag){case 27:case 5:n=s.child.stateNode;break;case 1:n=s.child.stateNode}try{um(e,n)}catch(M){gt(s,s.return,M)}}break;case 27:n===null&&o&4&&x_(s);case 26:case 5:Sr(e,s),n===null&&o&4&&C_(s),o&512&&Do(s,s.return);break;case 12:Sr(e,s);break;case 31:Sr(e,s),o&4&&R_(e,s);break;case 13:Sr(e,s),o&4&&L_(e,s),o&64&&(e=s.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(s=VC.bind(null,s),gw(e,s))));break;case 22:if(o=s.memoizedState!==null||br,!o){n=n!==null&&n.memoizedState!==null||oi,d=br;var S=oi;br=o,(oi=n)&&!S?Cr(e,s,(s.subtreeFlags&8772)!==0):Sr(e,s),br=d,oi=S}break;case 30:break;default:Sr(e,s)}}function A_(e){var n=e.alternate;n!==null&&(e.alternate=null,A_(n)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(n=e.stateNode,n!==null&&De(n)),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 Dt=null,Fi=!1;function yr(e,n,s){for(s=s.child;s!==null;)k_(e,n,s),s=s.sibling}function k_(e,n,s){if(Yt&&typeof Yt.onCommitFiberUnmount=="function")try{Yt.onCommitFiberUnmount(zi,s)}catch{}switch(s.tag){case 26:oi||Kn(s,n),yr(e,n,s),s.memoizedState?s.memoizedState.count--:s.stateNode&&(s=s.stateNode,s.parentNode.removeChild(s));break;case 27:oi||Kn(s,n);var o=Dt,d=Fi;is(s.type)&&(Dt=s.stateNode,Fi=!1),yr(e,n,s),Uo(s.stateNode),Dt=o,Fi=d;break;case 5:oi||Kn(s,n);case 6:if(o=Dt,d=Fi,Dt=null,yr(e,n,s),Dt=o,Fi=d,Dt!==null)if(Fi)try{(Dt.nodeType===9?Dt.body:Dt.nodeName==="HTML"?Dt.ownerDocument.body:Dt).removeChild(s.stateNode)}catch(S){gt(s,n,S)}else try{Dt.removeChild(s.stateNode)}catch(S){gt(s,n,S)}break;case 18:Dt!==null&&(Fi?(e=Dt,yv(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,s.stateNode),Da(e)):yv(Dt,s.stateNode));break;case 4:o=Dt,d=Fi,Dt=s.stateNode.containerInfo,Fi=!0,yr(e,n,s),Dt=o,Fi=d;break;case 0:case 11:case 14:case 15:Vr(2,s,n),oi||Vr(4,s,n),yr(e,n,s);break;case 1:oi||(Kn(s,n),o=s.stateNode,typeof o.componentWillUnmount=="function"&&S_(s,n,o)),yr(e,n,s);break;case 21:yr(e,n,s);break;case 22:oi=(o=oi)||s.memoizedState!==null,yr(e,n,s),oi=o;break;default:yr(e,n,s)}}function R_(e,n){if(n.memoizedState===null&&(e=n.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Da(e)}catch(s){gt(n,n.return,s)}}}function L_(e,n){if(n.memoizedState===null&&(e=n.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Da(e)}catch(s){gt(n,n.return,s)}}function UC(e){switch(e.tag){case 31:case 13:case 19:var n=e.stateNode;return n===null&&(n=e.stateNode=new E_),n;case 22:return e=e.stateNode,n=e._retryCache,n===null&&(n=e._retryCache=new E_),n;default:throw Error(a(435,e.tag))}}function gc(e,n){var s=UC(e);n.forEach(function(o){if(!s.has(o)){s.add(o);var d=XC.bind(null,e,o);o.then(d,d)}})}function qi(e,n){var s=n.deletions;if(s!==null)for(var o=0;o<s.length;o++){var d=s[o],S=e,M=n,I=M;e:for(;I!==null;){switch(I.tag){case 27:if(is(I.type)){Dt=I.stateNode,Fi=!1;break e}break;case 5:Dt=I.stateNode,Fi=!1;break e;case 3:case 4:Dt=I.stateNode.containerInfo,Fi=!0;break e}I=I.return}if(Dt===null)throw Error(a(160));k_(S,M,d),Dt=null,Fi=!1,S=d.alternate,S!==null&&(S.return=null),d.return=null}if(n.subtreeFlags&13886)for(n=n.child;n!==null;)M_(n,e),n=n.sibling}var Bn=null;function M_(e,n){var s=e.alternate,o=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:qi(n,e),Wi(e),o&4&&(Vr(3,e,e.return),Mo(3,e),Vr(5,e,e.return));break;case 1:qi(n,e),Wi(e),o&512&&(oi||s===null||Kn(s,s.return)),o&64&&br&&(e=e.updateQueue,e!==null&&(o=e.callbacks,o!==null&&(s=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=s===null?o:s.concat(o))));break;case 26:var d=Bn;if(qi(n,e),Wi(e),o&512&&(oi||s===null||Kn(s,s.return)),o&4){var S=s!==null?s.memoizedState:null;if(o=e.memoizedState,s===null)if(o===null)if(e.stateNode===null){e:{o=e.type,s=e.memoizedProps,d=d.ownerDocument||d;t:switch(o){case"title":S=d.getElementsByTagName("title")[0],(!S||S[qn]||S[Et]||S.namespaceURI==="http://www.w3.org/2000/svg"||S.hasAttribute("itemprop"))&&(S=d.createElement(o),d.head.insertBefore(S,d.querySelector("head > title"))),xi(S,o,s),S[Et]=e,Ve(S),o=S;break e;case"link":var M=Mv("link","href",d).get(o+(s.href||""));if(M){for(var I=0;I<M.length;I++)if(S=M[I],S.getAttribute("href")===(s.href==null||s.href===""?null:s.href)&&S.getAttribute("rel")===(s.rel==null?null:s.rel)&&S.getAttribute("title")===(s.title==null?null:s.title)&&S.getAttribute("crossorigin")===(s.crossOrigin==null?null:s.crossOrigin)){M.splice(I,1);break t}}S=d.createElement(o),xi(S,o,s),d.head.appendChild(S);break;case"meta":if(M=Mv("meta","content",d).get(o+(s.content||""))){for(I=0;I<M.length;I++)if(S=M[I],S.getAttribute("content")===(s.content==null?null:""+s.content)&&S.getAttribute("name")===(s.name==null?null:s.name)&&S.getAttribute("property")===(s.property==null?null:s.property)&&S.getAttribute("http-equiv")===(s.httpEquiv==null?null:s.httpEquiv)&&S.getAttribute("charset")===(s.charSet==null?null:s.charSet)){M.splice(I,1);break t}}S=d.createElement(o),xi(S,o,s),d.head.appendChild(S);break;default:throw Error(a(468,o))}S[Et]=e,Ve(S),o=S}e.stateNode=o}else Dv(d,e.type,e.stateNode);else e.stateNode=Lv(d,o,e.memoizedProps);else S!==o?(S===null?s.stateNode!==null&&(s=s.stateNode,s.parentNode.removeChild(s)):S.count--,o===null?Dv(d,e.type,e.stateNode):Lv(d,o,e.memoizedProps)):o===null&&e.stateNode!==null&&nd(e,e.memoizedProps,s.memoizedProps)}break;case 27:qi(n,e),Wi(e),o&512&&(oi||s===null||Kn(s,s.return)),s!==null&&o&4&&nd(e,e.memoizedProps,s.memoizedProps);break;case 5:if(qi(n,e),Wi(e),o&512&&(oi||s===null||Kn(s,s.return)),e.flags&32){d=e.stateNode;try{He(d,"")}catch(Te){gt(e,e.return,Te)}}o&4&&e.stateNode!=null&&(d=e.memoizedProps,nd(e,d,s!==null?s.memoizedProps:d)),o&1024&&(ad=!0);break;case 6:if(qi(n,e),Wi(e),o&4){if(e.stateNode===null)throw Error(a(162));o=e.memoizedProps,s=e.stateNode;try{s.nodeValue=o}catch(Te){gt(e,e.return,Te)}}break;case 3:if(Mc=null,d=Bn,Bn=Rc(n.containerInfo),qi(n,e),Bn=d,Wi(e),o&4&&s!==null&&s.memoizedState.isDehydrated)try{Da(n.containerInfo)}catch(Te){gt(e,e.return,Te)}ad&&(ad=!1,D_(e));break;case 4:o=Bn,Bn=Rc(e.stateNode.containerInfo),qi(n,e),Wi(e),Bn=o;break;case 12:qi(n,e),Wi(e);break;case 31:qi(n,e),Wi(e),o&4&&(o=e.updateQueue,o!==null&&(e.updateQueue=null,gc(e,o)));break;case 13:qi(n,e),Wi(e),e.child.flags&8192&&e.memoizedState!==null!=(s!==null&&s.memoizedState!==null)&&(_c=ct()),o&4&&(o=e.updateQueue,o!==null&&(e.updateQueue=null,gc(e,o)));break;case 22:d=e.memoizedState!==null;var K=s!==null&&s.memoizedState!==null,re=br,ue=oi;if(br=re||d,oi=ue||K,qi(n,e),oi=ue,br=re,Wi(e),o&8192)e:for(n=e.stateNode,n._visibility=d?n._visibility&-2:n._visibility|1,d&&(s===null||K||br||oi||Ns(e)),s=null,n=e;;){if(n.tag===5||n.tag===26){if(s===null){K=s=n;try{if(S=K.stateNode,d)M=S.style,typeof M.setProperty=="function"?M.setProperty("display","none","important"):M.display="none";else{I=K.stateNode;var fe=K.memoizedProps.style,se=fe!=null&&fe.hasOwnProperty("display")?fe.display:null;I.style.display=se==null||typeof se=="boolean"?"":(""+se).trim()}}catch(Te){gt(K,K.return,Te)}}}else if(n.tag===6){if(s===null){K=n;try{K.stateNode.nodeValue=d?"":K.memoizedProps}catch(Te){gt(K,K.return,Te)}}}else if(n.tag===18){if(s===null){K=n;try{var le=K.stateNode;d?Sv(le,!0):Sv(K.stateNode,!1)}catch(Te){gt(K,K.return,Te)}}}else if((n.tag!==22&&n.tag!==23||n.memoizedState===null||n===e)&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===e)break e;for(;n.sibling===null;){if(n.return===null||n.return===e)break e;s===n&&(s=null),n=n.return}s===n&&(s=null),n.sibling.return=n.return,n=n.sibling}o&4&&(o=e.updateQueue,o!==null&&(s=o.retryQueue,s!==null&&(o.retryQueue=null,gc(e,s))));break;case 19:qi(n,e),Wi(e),o&4&&(o=e.updateQueue,o!==null&&(e.updateQueue=null,gc(e,o)));break;case 30:break;case 21:break;default:qi(n,e),Wi(e)}}function Wi(e){var n=e.flags;if(n&2){try{for(var s,o=e.return;o!==null;){if(w_(o)){s=o;break}o=o.return}if(s==null)throw Error(a(160));switch(s.tag){case 27:var d=s.stateNode,S=rd(e);pc(e,S,d);break;case 5:var M=s.stateNode;s.flags&32&&(He(M,""),s.flags&=-33);var I=rd(e);pc(e,I,M);break;case 3:case 4:var K=s.stateNode.containerInfo,re=rd(e);sd(e,re,K);break;default:throw Error(a(161))}}catch(ue){gt(e,e.return,ue)}e.flags&=-3}n&4096&&(e.flags&=-4097)}function D_(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var n=e;D_(n),n.tag===5&&n.flags&1024&&n.stateNode.reset(),e=e.sibling}}function Sr(e,n){if(n.subtreeFlags&8772)for(n=n.child;n!==null;)T_(e,n.alternate,n),n=n.sibling}function Ns(e){for(e=e.child;e!==null;){var n=e;switch(n.tag){case 0:case 11:case 14:case 15:Vr(4,n,n.return),Ns(n);break;case 1:Kn(n,n.return);var s=n.stateNode;typeof s.componentWillUnmount=="function"&&S_(n,n.return,s),Ns(n);break;case 27:Uo(n.stateNode);case 26:case 5:Kn(n,n.return),Ns(n);break;case 22:n.memoizedState===null&&Ns(n);break;case 30:Ns(n);break;default:Ns(n)}e=e.sibling}}function Cr(e,n,s){for(s=s&&(n.subtreeFlags&8772)!==0,n=n.child;n!==null;){var o=n.alternate,d=e,S=n,M=S.flags;switch(S.tag){case 0:case 11:case 15:Cr(d,S,s),Mo(4,S);break;case 1:if(Cr(d,S,s),o=S,d=o.stateNode,typeof d.componentDidMount=="function")try{d.componentDidMount()}catch(re){gt(o,o.return,re)}if(o=S,d=o.updateQueue,d!==null){var I=o.stateNode;try{var K=d.shared.hiddenCallbacks;if(K!==null)for(d.shared.hiddenCallbacks=null,d=0;d<K.length;d++)cm(K[d],I)}catch(re){gt(o,o.return,re)}}s&&M&64&&y_(S),Do(S,S.return);break;case 27:x_(S);case 26:case 5:Cr(d,S,s),s&&o===null&&M&4&&C_(S),Do(S,S.return);break;case 12:Cr(d,S,s);break;case 31:Cr(d,S,s),s&&M&4&&R_(d,S);break;case 13:Cr(d,S,s),s&&M&4&&L_(d,S);break;case 22:S.memoizedState===null&&Cr(d,S,s),Do(S,S.return);break;case 30:break;default:Cr(d,S,s)}n=n.sibling}}function od(e,n){var s=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(s=e.memoizedState.cachePool.pool),e=null,n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(e=n.memoizedState.cachePool.pool),e!==s&&(e!=null&&e.refCount++,s!=null&&vo(s))}function ld(e,n){e=null,n.alternate!==null&&(e=n.alternate.memoizedState.cache),n=n.memoizedState.cache,n!==e&&(n.refCount++,e!=null&&vo(e))}function Nn(e,n,s,o){if(n.subtreeFlags&10256)for(n=n.child;n!==null;)O_(e,n,s,o),n=n.sibling}function O_(e,n,s,o){var d=n.flags;switch(n.tag){case 0:case 11:case 15:Nn(e,n,s,o),d&2048&&Mo(9,n);break;case 1:Nn(e,n,s,o);break;case 3:Nn(e,n,s,o),d&2048&&(e=null,n.alternate!==null&&(e=n.alternate.memoizedState.cache),n=n.memoizedState.cache,n!==e&&(n.refCount++,e!=null&&vo(e)));break;case 12:if(d&2048){Nn(e,n,s,o),e=n.stateNode;try{var S=n.memoizedProps,M=S.id,I=S.onPostCommit;typeof I=="function"&&I(M,n.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(K){gt(n,n.return,K)}}else Nn(e,n,s,o);break;case 31:Nn(e,n,s,o);break;case 13:Nn(e,n,s,o);break;case 23:break;case 22:S=n.stateNode,M=n.alternate,n.memoizedState!==null?S._visibility&2?Nn(e,n,s,o):Oo(e,n):S._visibility&2?Nn(e,n,s,o):(S._visibility|=2,Sa(e,n,s,o,(n.subtreeFlags&10256)!==0||!1)),d&2048&&od(M,n);break;case 24:Nn(e,n,s,o),d&2048&&ld(n.alternate,n);break;default:Nn(e,n,s,o)}}function Sa(e,n,s,o,d){for(d=d&&((n.subtreeFlags&10256)!==0||!1),n=n.child;n!==null;){var S=e,M=n,I=s,K=o,re=M.flags;switch(M.tag){case 0:case 11:case 15:Sa(S,M,I,K,d),Mo(8,M);break;case 23:break;case 22:var ue=M.stateNode;M.memoizedState!==null?ue._visibility&2?Sa(S,M,I,K,d):Oo(S,M):(ue._visibility|=2,Sa(S,M,I,K,d)),d&&re&2048&&od(M.alternate,M);break;case 24:Sa(S,M,I,K,d),d&&re&2048&&ld(M.alternate,M);break;default:Sa(S,M,I,K,d)}n=n.sibling}}function Oo(e,n){if(n.subtreeFlags&10256)for(n=n.child;n!==null;){var s=e,o=n,d=o.flags;switch(o.tag){case 22:Oo(s,o),d&2048&&od(o.alternate,o);break;case 24:Oo(s,o),d&2048&&ld(o.alternate,o);break;default:Oo(s,o)}n=n.sibling}}var Bo=8192;function Ca(e,n,s){if(e.subtreeFlags&Bo)for(e=e.child;e!==null;)B_(e,n,s),e=e.sibling}function B_(e,n,s){switch(e.tag){case 26:Ca(e,n,s),e.flags&Bo&&e.memoizedState!==null&&Aw(s,Bn,e.memoizedState,e.memoizedProps);break;case 5:Ca(e,n,s);break;case 3:case 4:var o=Bn;Bn=Rc(e.stateNode.containerInfo),Ca(e,n,s),Bn=o;break;case 22:e.memoizedState===null&&(o=e.alternate,o!==null&&o.memoizedState!==null?(o=Bo,Bo=16777216,Ca(e,n,s),Bo=o):Ca(e,n,s));break;default:Ca(e,n,s)}}function N_(e){var n=e.alternate;if(n!==null&&(e=n.child,e!==null)){n.child=null;do n=e.sibling,e.sibling=null,e=n;while(e!==null)}}function No(e){var n=e.deletions;if((e.flags&16)!==0){if(n!==null)for(var s=0;s<n.length;s++){var o=n[s];di=o,j_(o,e)}N_(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)I_(e),e=e.sibling}function I_(e){switch(e.tag){case 0:case 11:case 15:No(e),e.flags&2048&&Vr(9,e,e.return);break;case 3:No(e);break;case 12:No(e);break;case 22:var n=e.stateNode;e.memoizedState!==null&&n._visibility&2&&(e.return===null||e.return.tag!==13)?(n._visibility&=-3,mc(e)):No(e);break;default:No(e)}}function mc(e){var n=e.deletions;if((e.flags&16)!==0){if(n!==null)for(var s=0;s<n.length;s++){var o=n[s];di=o,j_(o,e)}N_(e)}for(e=e.child;e!==null;){switch(n=e,n.tag){case 0:case 11:case 15:Vr(8,n,n.return),mc(n);break;case 22:s=n.stateNode,s._visibility&2&&(s._visibility&=-3,mc(n));break;default:mc(n)}e=e.sibling}}function j_(e,n){for(;di!==null;){var s=di;switch(s.tag){case 0:case 11:case 15:Vr(8,s,n);break;case 23:case 22:if(s.memoizedState!==null&&s.memoizedState.cachePool!==null){var o=s.memoizedState.cachePool.pool;o!=null&&o.refCount++}break;case 24:vo(s.memoizedState.cache)}if(o=s.child,o!==null)o.return=s,di=o;else e:for(s=e;di!==null;){o=di;var d=o.sibling,S=o.return;if(A_(o),o===s){di=null;break e}if(d!==null){d.return=S,di=d;break e}di=S}}}var PC={getCacheForType:function(e){var n=Ci(ri),s=n.data.get(e);return s===void 0&&(s=e(),n.data.set(e,s)),s},cacheSignal:function(){return Ci(ri).controller.signal}},FC=typeof WeakMap=="function"?WeakMap:Map,ut=0,St=null,Xe=null,tt=0,pt=0,ln=null,Xr=!1,wa=!1,cd=!1,wr=0,Ft=0,Zr=0,Is=0,ud=0,cn=0,xa=0,Io=null,Gi=null,hd=!1,_c=0,z_=0,vc=1/0,bc=null,Jr=null,hi=0,Qr=null,Ea=null,xr=0,dd=0,fd=null,$_=null,jo=0,pd=null;function un(){return(ut&2)!==0&&tt!==0?tt&-tt:P.T!==null?yd():ar()}function H_(){if(cn===0)if((tt&536870912)===0||rt){var e=Fn;Fn<<=1,(Fn&3932160)===0&&(Fn=262144),cn=e}else cn=536870912;return e=an.current,e!==null&&(e.flags|=32),cn}function Ki(e,n,s){(e===St&&(pt===2||pt===9)||e.cancelPendingCommit!==null)&&(Ta(e,0),es(e,tt,cn,!1)),dt(e,s),((ut&2)===0||e!==St)&&(e===St&&((ut&2)===0&&(Is|=s),Ft===4&&es(e,tt,cn,!1)),Yn(e))}function U_(e,n,s){if((ut&6)!==0)throw Error(a(327));var o=!s&&(n&127)===0&&(n&e.expiredLanes)===0||he(e,n),d=o?GC(e,n):md(e,n,!0),S=o;do{if(d===0){wa&&!o&&es(e,n,0,!1);break}else{if(s=e.current.alternate,S&&!qC(s)){d=md(e,n,!1),S=!1;continue}if(d===2){if(S=n,e.errorRecoveryDisabledLanes&S)var M=0;else M=e.pendingLanes&-536870913,M=M!==0?M:M&536870912?536870912:0;if(M!==0){n=M;e:{var I=e;d=Io;var K=I.current.memoizedState.isDehydrated;if(K&&(Ta(I,M).flags|=256),M=md(I,M,!1),M!==2){if(cd&&!K){I.errorRecoveryDisabledLanes|=S,Is|=S,d=4;break e}S=Gi,Gi=d,S!==null&&(Gi===null?Gi=S:Gi.push.apply(Gi,S))}d=M}if(S=!1,d!==2)continue}}if(d===1){Ta(e,0),es(e,n,0,!0);break}e:{switch(o=e,S=d,S){case 0:case 1:throw Error(a(345));case 4:if((n&4194048)!==n)break;case 6:es(o,n,cn,!Xr);break e;case 2:Gi=null;break;case 3:case 5:break;default:throw Error(a(329))}if((n&62914560)===n&&(d=_c+300-ct(),10<d)){if(es(o,n,cn,!Xr),Z(o,0,!0)!==0)break e;xr=n,o.timeoutHandle=vv(P_.bind(null,o,s,Gi,bc,hd,n,cn,Is,xa,Xr,S,"Throttled",-0,0),d);break e}P_(o,s,Gi,bc,hd,n,cn,Is,xa,Xr,S,null,-0,0)}}break}while(!0);Yn(e)}function P_(e,n,s,o,d,S,M,I,K,re,ue,fe,se,le){if(e.timeoutHandle=-1,fe=n.subtreeFlags,fe&8192||(fe&16785408)===16785408){fe={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Se},B_(n,S,fe);var Te=(S&62914560)===S?_c-ct():(S&4194048)===S?z_-ct():0;if(Te=kw(fe,Te),Te!==null){xr=S,e.cancelPendingCommit=Te(X_.bind(null,e,n,S,s,o,d,M,I,K,ue,fe,null,se,le)),es(e,S,M,!re);return}}X_(e,n,S,s,o,d,M,I,K)}function qC(e){for(var n=e;;){var s=n.tag;if((s===0||s===11||s===15)&&n.flags&16384&&(s=n.updateQueue,s!==null&&(s=s.stores,s!==null)))for(var o=0;o<s.length;o++){var d=s[o],S=d.getSnapshot;d=d.value;try{if(!rn(S(),d))return!1}catch{return!1}}if(s=n.child,n.subtreeFlags&16384&&s!==null)s.return=n,n=s;else{if(n===e)break;for(;n.sibling===null;){if(n.return===null||n.return===e)return!0;n=n.return}n.sibling.return=n.return,n=n.sibling}}return!0}function es(e,n,s,o){n&=~ud,n&=~Is,e.suspendedLanes|=n,e.pingedLanes&=~n,o&&(e.warmLanes|=n),o=e.expirationTimes;for(var d=n;0<d;){var S=31-$t(d),M=1<<S;o[S]=-1,d&=~M}s!==0&&we(e,s,n)}function yc(){return(ut&6)===0?(zo(0),!1):!0}function gd(){if(Xe!==null){if(pt===0)var e=Xe.return;else e=Xe,fr=As=null,Mh(e),ma=null,yo=0,e=Xe;for(;e!==null;)b_(e.alternate,e),e=e.return;Xe=null}}function Ta(e,n){var s=e.timeoutHandle;s!==-1&&(e.timeoutHandle=-1,uw(s)),s=e.cancelPendingCommit,s!==null&&(e.cancelPendingCommit=null,s()),xr=0,gd(),St=e,Xe=s=hr(e.current,null),tt=n,pt=0,ln=null,Xr=!1,wa=he(e,n),cd=!1,xa=cn=ud=Is=Zr=Ft=0,Gi=Io=null,hd=!1,(n&8)!==0&&(n|=n&32);var o=e.entangledLanes;if(o!==0)for(e=e.entanglements,o&=n;0<o;){var d=31-$t(o),S=1<<d;n|=e[d],o&=~S}return wr=n,Ul(),s}function F_(e,n){qe=null,P.H=ko,n===ga||n===Vl?(n=sm(),pt=3):n===bh?(n=sm(),pt=4):pt=n===Kh?8:n!==null&&typeof n=="object"&&typeof n.then=="function"?6:1,ln=n,Xe===null&&(Ft=1,cc(e,mn(n,e.current)))}function q_(){var e=an.current;return e===null?!0:(tt&4194048)===tt?yn===null:(tt&62914560)===tt||(tt&536870912)!==0?e===yn:!1}function W_(){var e=P.H;return P.H=ko,e===null?ko:e}function G_(){var e=P.A;return P.A=PC,e}function Sc(){Ft=4,Xr||(tt&4194048)!==tt&&an.current!==null||(wa=!0),(Zr&134217727)===0&&(Is&134217727)===0||St===null||es(St,tt,cn,!1)}function md(e,n,s){var o=ut;ut|=2;var d=W_(),S=G_();(St!==e||tt!==n)&&(bc=null,Ta(e,n)),n=!1;var M=Ft;e:do try{if(pt!==0&&Xe!==null){var I=Xe,K=ln;switch(pt){case 8:gd(),M=6;break e;case 3:case 2:case 9:case 6:an.current===null&&(n=!0);var re=pt;if(pt=0,ln=null,Aa(e,I,K,re),s&&wa){M=0;break e}break;default:re=pt,pt=0,ln=null,Aa(e,I,K,re)}}WC(),M=Ft;break}catch(ue){F_(e,ue)}while(!0);return n&&e.shellSuspendCounter++,fr=As=null,ut=o,P.H=d,P.A=S,Xe===null&&(St=null,tt=0,Ul()),M}function WC(){for(;Xe!==null;)K_(Xe)}function GC(e,n){var s=ut;ut|=2;var o=W_(),d=G_();St!==e||tt!==n?(bc=null,vc=ct()+500,Ta(e,n)):wa=he(e,n);e:do try{if(pt!==0&&Xe!==null){n=Xe;var S=ln;t:switch(pt){case 1:pt=0,ln=null,Aa(e,n,S,1);break;case 2:case 9:if(nm(S)){pt=0,ln=null,Y_(n);break}n=function(){pt!==2&&pt!==9||St!==e||(pt=7),Yn(e)},S.then(n,n);break e;case 3:pt=7;break e;case 4:pt=5;break e;case 7:nm(S)?(pt=0,ln=null,Y_(n)):(pt=0,ln=null,Aa(e,n,S,7));break;case 5:var M=null;switch(Xe.tag){case 26:M=Xe.memoizedState;case 5:case 27:var I=Xe;if(M?Ov(M):I.stateNode.complete){pt=0,ln=null;var K=I.sibling;if(K!==null)Xe=K;else{var re=I.return;re!==null?(Xe=re,Cc(re)):Xe=null}break t}}pt=0,ln=null,Aa(e,n,S,5);break;case 6:pt=0,ln=null,Aa(e,n,S,6);break;case 8:gd(),Ft=6;break e;default:throw Error(a(462))}}KC();break}catch(ue){F_(e,ue)}while(!0);return fr=As=null,P.H=o,P.A=d,ut=s,Xe!==null?0:(St=null,tt=0,Ul(),Ft)}function KC(){for(;Xe!==null&&!Rn();)K_(Xe)}function K_(e){var n=__(e.alternate,e,wr);e.memoizedProps=e.pendingProps,n===null?Cc(e):Xe=n}function Y_(e){var n=e,s=n.alternate;switch(n.tag){case 15:case 0:n=h_(s,n,n.pendingProps,n.type,void 0,tt);break;case 11:n=h_(s,n,n.pendingProps,n.type.render,n.ref,tt);break;case 5:Mh(n);default:b_(s,n),n=Xe=Gg(n,wr),n=__(s,n,wr)}e.memoizedProps=e.pendingProps,n===null?Cc(e):Xe=n}function Aa(e,n,s,o){fr=As=null,Mh(n),ma=null,yo=0;var d=n.return;try{if(NC(e,d,n,s,tt)){Ft=1,cc(e,mn(s,e.current)),Xe=null;return}}catch(S){if(d!==null)throw Xe=d,S;Ft=1,cc(e,mn(s,e.current)),Xe=null;return}n.flags&32768?(rt||o===1?e=!0:wa||(tt&536870912)!==0?e=!1:(Xr=e=!0,(o===2||o===9||o===3||o===6)&&(o=an.current,o!==null&&o.tag===13&&(o.flags|=16384))),V_(n,e)):Cc(n)}function Cc(e){var n=e;do{if((n.flags&32768)!==0){V_(n,Xr);return}e=n.return;var s=zC(n.alternate,n,wr);if(s!==null){Xe=s;return}if(n=n.sibling,n!==null){Xe=n;return}Xe=n=e}while(n!==null);Ft===0&&(Ft=5)}function V_(e,n){do{var s=$C(e.alternate,e);if(s!==null){s.flags&=32767,Xe=s;return}if(s=e.return,s!==null&&(s.flags|=32768,s.subtreeFlags=0,s.deletions=null),!n&&(e=e.sibling,e!==null)){Xe=e;return}Xe=e=s}while(e!==null);Ft=6,Xe=null}function X_(e,n,s,o,d,S,M,I,K){e.cancelPendingCommit=null;do wc();while(hi!==0);if((ut&6)!==0)throw Error(a(327));if(n!==null){if(n===e.current)throw Error(a(177));if(S=n.lanes|n.childLanes,S|=rh,Ee(e,s,S,M,I,K),e===St&&(Xe=St=null,tt=0),Ea=n,Qr=e,xr=s,dd=S,fd=d,$_=o,(n.subtreeFlags&10256)!==0||(n.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,ZC(ti,function(){return tv(),null})):(e.callbackNode=null,e.callbackPriority=0),o=(n.flags&13878)!==0,(n.subtreeFlags&13878)!==0||o){o=P.T,P.T=null,d=V.p,V.p=2,M=ut,ut|=4;try{HC(e,n,s)}finally{ut=M,V.p=d,P.T=o}}hi=1,Z_(),J_(),Q_()}}function Z_(){if(hi===1){hi=0;var e=Qr,n=Ea,s=(n.flags&13878)!==0;if((n.subtreeFlags&13878)!==0||s){s=P.T,P.T=null;var o=V.p;V.p=2;var d=ut;ut|=4;try{M_(n,e);var S=kd,M=jg(e.containerInfo),I=S.focusedElem,K=S.selectionRange;if(M!==I&&I&&I.ownerDocument&&Ig(I.ownerDocument.documentElement,I)){if(K!==null&&Qu(I)){var re=K.start,ue=K.end;if(ue===void 0&&(ue=re),"selectionStart"in I)I.selectionStart=re,I.selectionEnd=Math.min(ue,I.value.length);else{var fe=I.ownerDocument||document,se=fe&&fe.defaultView||window;if(se.getSelection){var le=se.getSelection(),Te=I.textContent.length,ze=Math.min(K.start,Te),vt=K.end===void 0?ze:Math.min(K.end,Te);!le.extend&&ze>vt&&(M=vt,vt=ze,ze=M);var ie=Ng(I,ze),ee=Ng(I,vt);if(ie&&ee&&(le.rangeCount!==1||le.anchorNode!==ie.node||le.anchorOffset!==ie.offset||le.focusNode!==ee.node||le.focusOffset!==ee.offset)){var ne=fe.createRange();ne.setStart(ie.node,ie.offset),le.removeAllRanges(),ze>vt?(le.addRange(ne),le.extend(ee.node,ee.offset)):(ne.setEnd(ee.node,ee.offset),le.addRange(ne))}}}}for(fe=[],le=I;le=le.parentNode;)le.nodeType===1&&fe.push({element:le,left:le.scrollLeft,top:le.scrollTop});for(typeof I.focus=="function"&&I.focus(),I=0;I<fe.length;I++){var de=fe[I];de.element.scrollLeft=de.left,de.element.scrollTop=de.top}}Nc=!!Ad,kd=Ad=null}finally{ut=d,V.p=o,P.T=s}}e.current=n,hi=2}}function J_(){if(hi===2){hi=0;var e=Qr,n=Ea,s=(n.flags&8772)!==0;if((n.subtreeFlags&8772)!==0||s){s=P.T,P.T=null;var o=V.p;V.p=2;var d=ut;ut|=4;try{T_(e,n.alternate,n)}finally{ut=d,V.p=o,P.T=s}}hi=3}}function Q_(){if(hi===4||hi===3){hi=0,ei();var e=Qr,n=Ea,s=xr,o=$_;(n.subtreeFlags&10256)!==0||(n.flags&10256)!==0?hi=5:(hi=0,Ea=Qr=null,ev(e,e.pendingLanes));var d=e.pendingLanes;if(d===0&&(Jr=null),bi(s),n=n.stateNode,Yt&&typeof Yt.onCommitFiberRoot=="function")try{Yt.onCommitFiberRoot(zi,n,void 0,(n.current.flags&128)===128)}catch{}if(o!==null){n=P.T,d=V.p,V.p=2,P.T=null;try{for(var S=e.onRecoverableError,M=0;M<o.length;M++){var I=o[M];S(I.value,{componentStack:I.stack})}}finally{P.T=n,V.p=d}}(xr&3)!==0&&wc(),Yn(e),d=e.pendingLanes,(s&261930)!==0&&(d&42)!==0?e===pd?jo++:(jo=0,pd=e):jo=0,zo(0)}}function ev(e,n){(e.pooledCacheLanes&=n)===0&&(n=e.pooledCache,n!=null&&(e.pooledCache=null,vo(n)))}function wc(){return Z_(),J_(),Q_(),tv()}function tv(){if(hi!==5)return!1;var e=Qr,n=dd;dd=0;var s=bi(xr),o=P.T,d=V.p;try{V.p=32>s?32:s,P.T=null,s=fd,fd=null;var S=Qr,M=xr;if(hi=0,Ea=Qr=null,xr=0,(ut&6)!==0)throw Error(a(331));var I=ut;if(ut|=4,I_(S.current),O_(S,S.current,M,s),ut=I,zo(0,!1),Yt&&typeof Yt.onPostCommitFiberRoot=="function")try{Yt.onPostCommitFiberRoot(zi,S)}catch{}return!0}finally{V.p=d,P.T=o,ev(e,n)}}function iv(e,n,s){n=mn(s,n),n=Gh(e.stateNode,n,2),e=Gr(e,n,2),e!==null&&(dt(e,2),Yn(e))}function gt(e,n,s){if(e.tag===3)iv(e,e,s);else for(;n!==null;){if(n.tag===3){iv(n,e,s);break}else if(n.tag===1){var o=n.stateNode;if(typeof n.type.getDerivedStateFromError=="function"||typeof o.componentDidCatch=="function"&&(Jr===null||!Jr.has(o))){e=mn(s,e),s=n_(2),o=Gr(n,s,2),o!==null&&(r_(s,o,n,e),dt(o,2),Yn(o));break}}n=n.return}}function _d(e,n,s){var o=e.pingCache;if(o===null){o=e.pingCache=new FC;var d=new Set;o.set(n,d)}else d=o.get(n),d===void 0&&(d=new Set,o.set(n,d));d.has(s)||(cd=!0,d.add(s),e=YC.bind(null,e,n,s),n.then(e,e))}function YC(e,n,s){var o=e.pingCache;o!==null&&o.delete(n),e.pingedLanes|=e.suspendedLanes&s,e.warmLanes&=~s,St===e&&(tt&s)===s&&(Ft===4||Ft===3&&(tt&62914560)===tt&&300>ct()-_c?(ut&2)===0&&Ta(e,0):ud|=s,xa===tt&&(xa=0)),Yn(e)}function nv(e,n){n===0&&(n=Ie()),e=xs(e,n),e!==null&&(dt(e,n),Yn(e))}function VC(e){var n=e.memoizedState,s=0;n!==null&&(s=n.retryLane),nv(e,s)}function XC(e,n){var s=0;switch(e.tag){case 31:case 13:var o=e.stateNode,d=e.memoizedState;d!==null&&(s=d.retryLane);break;case 19:o=e.stateNode;break;case 22:o=e.stateNode._retryCache;break;default:throw Error(a(314))}o!==null&&o.delete(n),nv(e,s)}function ZC(e,n){return vi(e,n)}var xc=null,ka=null,vd=!1,Ec=!1,bd=!1,ts=0;function Yn(e){e!==ka&&e.next===null&&(ka===null?xc=ka=e:ka=ka.next=e),Ec=!0,vd||(vd=!0,QC())}function zo(e,n){if(!bd&&Ec){bd=!0;do for(var s=!1,o=xc;o!==null;){if(e!==0){var d=o.pendingLanes;if(d===0)var S=0;else{var M=o.suspendedLanes,I=o.pingedLanes;S=(1<<31-$t(42|e)+1)-1,S&=d&~(M&~I),S=S&201326741?S&201326741|1:S?S|2:0}S!==0&&(s=!0,ov(o,S))}else S=tt,S=Z(o,o===St?S:0,o.cancelPendingCommit!==null||o.timeoutHandle!==-1),(S&3)===0||he(o,S)||(s=!0,ov(o,S));o=o.next}while(s);bd=!1}}function JC(){rv()}function rv(){Ec=vd=!1;var e=0;ts!==0&&cw()&&(e=ts);for(var n=ct(),s=null,o=xc;o!==null;){var d=o.next,S=sv(o,n);S===0?(o.next=null,s===null?xc=d:s.next=d,d===null&&(ka=s)):(s=o,(e!==0||(S&3)!==0)&&(Ec=!0)),o=d}hi!==0&&hi!==5||zo(e),ts!==0&&(ts=0)}function sv(e,n){for(var s=e.suspendedLanes,o=e.pingedLanes,d=e.expirationTimes,S=e.pendingLanes&-62914561;0<S;){var M=31-$t(S),I=1<<M,K=d[M];K===-1?((I&s)===0||(I&o)!==0)&&(d[M]=ve(I,n)):K<=n&&(e.expiredLanes|=I),S&=~I}if(n=St,s=tt,s=Z(e,e===n?s:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),o=e.callbackNode,s===0||e===n&&(pt===2||pt===9)||e.cancelPendingCommit!==null)return o!==null&&o!==null&&fn(o),e.callbackNode=null,e.callbackPriority=0;if((s&3)===0||he(e,s)){if(n=s&-s,n===e.callbackPriority)return n;switch(o!==null&&fn(o),bi(s)){case 2:case 8:s=zt;break;case 32:s=ti;break;case 268435456:s=ki;break;default:s=ti}return o=av.bind(null,e),s=vi(s,o),e.callbackPriority=n,e.callbackNode=s,n}return o!==null&&o!==null&&fn(o),e.callbackPriority=2,e.callbackNode=null,2}function av(e,n){if(hi!==0&&hi!==5)return e.callbackNode=null,e.callbackPriority=0,null;var s=e.callbackNode;if(wc()&&e.callbackNode!==s)return null;var o=tt;return o=Z(e,e===St?o:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),o===0?null:(U_(e,o,n),sv(e,ct()),e.callbackNode!=null&&e.callbackNode===s?av.bind(null,e):null)}function ov(e,n){if(wc())return null;U_(e,n,!0)}function QC(){hw(function(){(ut&6)!==0?vi(jt,JC):rv()})}function yd(){if(ts===0){var e=fa;e===0&&(e=Mn,Mn<<=1,(Mn&261888)===0&&(Mn=256)),ts=e}return ts}function lv(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:zr(""+e)}function cv(e,n){var s=n.ownerDocument.createElement("input");return s.name=n.name,s.value=n.value,e.id&&s.setAttribute("form",e.id),n.parentNode.insertBefore(s,n),e=new FormData(e),s.parentNode.removeChild(s),e}function ew(e,n,s,o,d){if(n==="submit"&&s&&s.stateNode===d){var S=lv((d[wt]||null).action),M=o.submitter;M&&(n=(n=M[wt]||null)?lv(n.formAction):M.getAttribute("formAction"),n!==null&&(S=n,M=null));var I=new jl("action","action",null,o,d);e.push({event:I,listeners:[{instance:null,listener:function(){if(o.defaultPrevented){if(ts!==0){var K=M?cv(d,M):new FormData(d);Hh(s,{pending:!0,data:K,method:d.method,action:S},null,K)}}else typeof S=="function"&&(I.preventDefault(),K=M?cv(d,M):new FormData(d),Hh(s,{pending:!0,data:K,method:d.method,action:S},S,K))},currentTarget:d}]})}}for(var Sd=0;Sd<nh.length;Sd++){var Cd=nh[Sd],tw=Cd.toLowerCase(),iw=Cd[0].toUpperCase()+Cd.slice(1);On(tw,"on"+iw)}On(Hg,"onAnimationEnd"),On(Ug,"onAnimationIteration"),On(Pg,"onAnimationStart"),On("dblclick","onDoubleClick"),On("focusin","onFocus"),On("focusout","onBlur"),On(vC,"onTransitionRun"),On(bC,"onTransitionStart"),On(yC,"onTransitionCancel"),On(Fg,"onTransitionEnd"),me("onMouseEnter",["mouseout","mouseover"]),me("onMouseLeave",["mouseout","mouseover"]),me("onPointerEnter",["pointerout","pointerover"]),me("onPointerLeave",["pointerout","pointerover"]),Ut("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Ut("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Ut("onBeforeInput",["compositionend","keypress","textInput","paste"]),Ut("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Ut("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Ut("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var $o="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(" "),nw=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat($o));function uv(e,n){n=(n&4)!==0;for(var s=0;s<e.length;s++){var o=e[s],d=o.event;o=o.listeners;e:{var S=void 0;if(n)for(var M=o.length-1;0<=M;M--){var I=o[M],K=I.instance,re=I.currentTarget;if(I=I.listener,K!==S&&d.isPropagationStopped())break e;S=I,d.currentTarget=re;try{S(d)}catch(ue){Hl(ue)}d.currentTarget=null,S=K}else for(M=0;M<o.length;M++){if(I=o[M],K=I.instance,re=I.currentTarget,I=I.listener,K!==S&&d.isPropagationStopped())break e;S=I,d.currentTarget=re;try{S(d)}catch(ue){Hl(ue)}d.currentTarget=null,S=K}}}}function Ze(e,n){var s=n[Ir];s===void 0&&(s=n[Ir]=new Set);var o=e+"__bubble";s.has(o)||(hv(n,e,2,!1),s.add(o))}function wd(e,n,s){var o=0;n&&(o|=4),hv(s,e,o,n)}var Tc="_reactListening"+Math.random().toString(36).slice(2);function xd(e){if(!e[Tc]){e[Tc]=!0,Tt.forEach(function(s){s!=="selectionchange"&&(nw.has(s)||wd(s,!1,e),wd(s,!0,e))});var n=e.nodeType===9?e:e.ownerDocument;n===null||n[Tc]||(n[Tc]=!0,wd("selectionchange",!1,n))}}function hv(e,n,s,o){switch(Hv(n)){case 2:var d=Mw;break;case 8:d=Dw;break;default:d=$d}s=d.bind(null,n,s,e),d=void 0,!qu||n!=="touchstart"&&n!=="touchmove"&&n!=="wheel"||(d=!0),o?d!==void 0?e.addEventListener(n,s,{capture:!0,passive:d}):e.addEventListener(n,s,!0):d!==void 0?e.addEventListener(n,s,{passive:d}):e.addEventListener(n,s,!1)}function Ed(e,n,s,o,d){var S=o;if((n&1)===0&&(n&2)===0&&o!==null)e:for(;;){if(o===null)return;var M=o.tag;if(M===3||M===4){var I=o.stateNode.containerInfo;if(I===d)break;if(M===4)for(M=o.return;M!==null;){var K=M.tag;if((K===3||K===4)&&M.stateNode.containerInfo===d)return;M=M.return}for(;I!==null;){if(M=G(I),M===null)return;if(K=M.tag,K===5||K===6||K===26||K===27){o=S=M;continue e}I=I.parentNode}}o=o.return}Ol(function(){var re=S,ue=Fe(s),fe=[];e:{var se=qg.get(e);if(se!==void 0){var le=jl,Te=e;switch(e){case"keypress":if(Nl(s)===0)break e;case"keydown":case"keyup":le=XS;break;case"focusin":Te="focus",le=Yu;break;case"focusout":Te="blur",le=Yu;break;case"beforeblur":case"afterblur":le=Yu;break;case"click":if(s.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":le=bg;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":le=zS;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":le=QS;break;case Hg:case Ug:case Pg:le=US;break;case Fg:le=tC;break;case"scroll":case"scrollend":le=IS;break;case"wheel":le=nC;break;case"copy":case"cut":case"paste":le=FS;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":le=Sg;break;case"toggle":case"beforetoggle":le=sC}var ze=(n&4)!==0,vt=!ze&&(e==="scroll"||e==="scrollend"),ie=ze?se!==null?se+"Capture":null:se;ze=[];for(var ee=re,ne;ee!==null;){var de=ee;if(ne=de.stateNode,de=de.tag,de!==5&&de!==26&&de!==27||ne===null||ie===null||(de=ao(ee,ie),de!=null&&ze.push(Ho(ee,de,ne))),vt)break;ee=ee.return}0<ze.length&&(se=new le(se,Te,null,s,ue),fe.push({event:se,listeners:ze}))}}if((n&7)===0){e:{if(se=e==="mouseover"||e==="pointerover",le=e==="mouseout"||e==="pointerout",se&&s!==ke&&(Te=s.relatedTarget||s.fromElement)&&(G(Te)||Te[Dn]))break e;if((le||se)&&(se=ue.window===ue?ue:(se=ue.ownerDocument)?se.defaultView||se.parentWindow:window,le?(Te=s.relatedTarget||s.toElement,le=re,Te=Te?G(Te):null,Te!==null&&(vt=v(Te),ze=Te.tag,Te!==vt||ze!==5&&ze!==27&&ze!==6)&&(Te=null)):(le=null,Te=re),le!==Te)){if(ze=bg,de="onMouseLeave",ie="onMouseEnter",ee="mouse",(e==="pointerout"||e==="pointerover")&&(ze=Sg,de="onPointerLeave",ie="onPointerEnter",ee="pointer"),vt=le==null?se:xe(le),ne=Te==null?se:xe(Te),se=new ze(de,ee+"leave",le,s,ue),se.target=vt,se.relatedTarget=ne,de=null,G(ue)===re&&(ze=new ze(ie,ee+"enter",Te,s,ue),ze.target=ne,ze.relatedTarget=vt,de=ze),vt=de,le&&Te)t:{for(ze=rw,ie=le,ee=Te,ne=0,de=ie;de;de=ze(de))ne++;de=0;for(var Ne=ee;Ne;Ne=ze(Ne))de++;for(;0<ne-de;)ie=ze(ie),ne--;for(;0<de-ne;)ee=ze(ee),de--;for(;ne--;){if(ie===ee||ee!==null&&ie===ee.alternate){ze=ie;break t}ie=ze(ie),ee=ze(ee)}ze=null}else ze=null;le!==null&&dv(fe,se,le,ze,!1),Te!==null&&vt!==null&&dv(fe,vt,Te,ze,!0)}}e:{if(se=re?xe(re):window,le=se.nodeName&&se.nodeName.toLowerCase(),le==="select"||le==="input"&&se.type==="file")var at=Rg;else if(Ag(se))if(Lg)at=gC;else{at=fC;var Re=dC}else le=se.nodeName,!le||le.toLowerCase()!=="input"||se.type!=="checkbox"&&se.type!=="radio"?re&&jr(re.elementType)&&(at=Rg):at=pC;if(at&&(at=at(e,re))){kg(fe,at,s,ue);break e}Re&&Re(e,se,re),e==="focusout"&&re&&se.type==="number"&&re.memoizedProps.value!=null&&ia(se,"number",se.value)}switch(Re=re?xe(re):window,e){case"focusin":(Ag(Re)||Re.contentEditable==="true")&&(sa=Re,eh=re,go=null);break;case"focusout":go=eh=sa=null;break;case"mousedown":th=!0;break;case"contextmenu":case"mouseup":case"dragend":th=!1,zg(fe,s,ue);break;case"selectionchange":if(_C)break;case"keydown":case"keyup":zg(fe,s,ue)}var We;if(Xu)e:{switch(e){case"compositionstart":var it="onCompositionStart";break e;case"compositionend":it="onCompositionEnd";break e;case"compositionupdate":it="onCompositionUpdate";break e}it=void 0}else ra?Eg(e,s)&&(it="onCompositionEnd"):e==="keydown"&&s.keyCode===229&&(it="onCompositionStart");it&&(Cg&&s.locale!=="ko"&&(ra||it!=="onCompositionStart"?it==="onCompositionEnd"&&ra&&(We=_g()):($r=ue,Wu="value"in $r?$r.value:$r.textContent,ra=!0)),Re=Ac(re,it),0<Re.length&&(it=new yg(it,e,null,s,ue),fe.push({event:it,listeners:Re}),We?it.data=We:(We=Tg(s),We!==null&&(it.data=We)))),(We=oC?lC(e,s):cC(e,s))&&(it=Ac(re,"onBeforeInput"),0<it.length&&(Re=new yg("onBeforeInput","beforeinput",null,s,ue),fe.push({event:Re,listeners:it}),Re.data=We)),ew(fe,e,re,s,ue)}uv(fe,n)})}function Ho(e,n,s){return{instance:e,listener:n,currentTarget:s}}function Ac(e,n){for(var s=n+"Capture",o=[];e!==null;){var d=e,S=d.stateNode;if(d=d.tag,d!==5&&d!==26&&d!==27||S===null||(d=ao(e,s),d!=null&&o.unshift(Ho(e,d,S)),d=ao(e,n),d!=null&&o.push(Ho(e,d,S))),e.tag===3)return o;e=e.return}return[]}function rw(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function dv(e,n,s,o,d){for(var S=n._reactName,M=[];s!==null&&s!==o;){var I=s,K=I.alternate,re=I.stateNode;if(I=I.tag,K!==null&&K===o)break;I!==5&&I!==26&&I!==27||re===null||(K=re,d?(re=ao(s,S),re!=null&&M.unshift(Ho(s,re,K))):d||(re=ao(s,S),re!=null&&M.push(Ho(s,re,K)))),s=s.return}M.length!==0&&e.push({event:n,listeners:M})}var sw=/\r\n?/g,aw=/\u0000|\uFFFD/g;function fv(e){return(typeof e=="string"?e:""+e).replace(sw,`
|
|
9
|
+
`).replace(aw,"")}function pv(e,n){return n=fv(n),fv(e)===n}function _t(e,n,s,o,d,S){switch(s){case"children":typeof o=="string"?n==="body"||n==="textarea"&&o===""||He(e,o):(typeof o=="number"||typeof o=="bigint")&&n!=="body"&&He(e,""+o);break;case"className":tn(e,"class",o);break;case"tabIndex":tn(e,"tabindex",o);break;case"dir":case"role":case"viewBox":case"width":case"height":tn(e,s,o);break;case"style":ft(e,o,S);break;case"data":if(n!=="object"){tn(e,"data",o);break}case"src":case"href":if(o===""&&(n!=="a"||s!=="href")){e.removeAttribute(s);break}if(o==null||typeof o=="function"||typeof o=="symbol"||typeof o=="boolean"){e.removeAttribute(s);break}o=zr(""+o),e.setAttribute(s,o);break;case"action":case"formAction":if(typeof o=="function"){e.setAttribute(s,"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 S=="function"&&(s==="formAction"?(n!=="input"&&_t(e,n,"name",d.name,d,null),_t(e,n,"formEncType",d.formEncType,d,null),_t(e,n,"formMethod",d.formMethod,d,null),_t(e,n,"formTarget",d.formTarget,d,null)):(_t(e,n,"encType",d.encType,d,null),_t(e,n,"method",d.method,d,null),_t(e,n,"target",d.target,d,null)));if(o==null||typeof o=="symbol"||typeof o=="boolean"){e.removeAttribute(s);break}o=zr(""+o),e.setAttribute(s,o);break;case"onClick":o!=null&&(e.onclick=Se);break;case"onScroll":o!=null&&Ze("scroll",e);break;case"onScrollEnd":o!=null&&Ze("scrollend",e);break;case"dangerouslySetInnerHTML":if(o!=null){if(typeof o!="object"||!("__html"in o))throw Error(a(61));if(s=o.__html,s!=null){if(d.children!=null)throw Error(a(60));e.innerHTML=s}}break;case"multiple":e.multiple=o&&typeof o!="function"&&typeof o!="symbol";break;case"muted":e.muted=o&&typeof o!="function"&&typeof o!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(o==null||typeof o=="function"||typeof o=="boolean"||typeof o=="symbol"){e.removeAttribute("xlink:href");break}s=zr(""+o),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",s);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":o!=null&&typeof o!="function"&&typeof o!="symbol"?e.setAttribute(s,""+o):e.removeAttribute(s);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":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":o&&typeof o!="function"&&typeof o!="symbol"?e.setAttribute(s,""):e.removeAttribute(s);break;case"capture":case"download":o===!0?e.setAttribute(s,""):o!==!1&&o!=null&&typeof o!="function"&&typeof o!="symbol"?e.setAttribute(s,o):e.removeAttribute(s);break;case"cols":case"rows":case"size":case"span":o!=null&&typeof o!="function"&&typeof o!="symbol"&&!isNaN(o)&&1<=o?e.setAttribute(s,o):e.removeAttribute(s);break;case"rowSpan":case"start":o==null||typeof o=="function"||typeof o=="symbol"||isNaN(o)?e.removeAttribute(s):e.setAttribute(s,o);break;case"popover":Ze("beforetoggle",e),Ze("toggle",e),Ri(e,"popover",o);break;case"xlinkActuate":Hi(e,"http://www.w3.org/1999/xlink","xlink:actuate",o);break;case"xlinkArcrole":Hi(e,"http://www.w3.org/1999/xlink","xlink:arcrole",o);break;case"xlinkRole":Hi(e,"http://www.w3.org/1999/xlink","xlink:role",o);break;case"xlinkShow":Hi(e,"http://www.w3.org/1999/xlink","xlink:show",o);break;case"xlinkTitle":Hi(e,"http://www.w3.org/1999/xlink","xlink:title",o);break;case"xlinkType":Hi(e,"http://www.w3.org/1999/xlink","xlink:type",o);break;case"xmlBase":Hi(e,"http://www.w3.org/XML/1998/namespace","xml:base",o);break;case"xmlLang":Hi(e,"http://www.w3.org/XML/1998/namespace","xml:lang",o);break;case"xmlSpace":Hi(e,"http://www.w3.org/XML/1998/namespace","xml:space",o);break;case"is":Ri(e,"is",o);break;case"innerText":case"textContent":break;default:(!(2<s.length)||s[0]!=="o"&&s[0]!=="O"||s[1]!=="n"&&s[1]!=="N")&&(s=cr.get(s)||s,Ri(e,s,o))}}function Td(e,n,s,o,d,S){switch(s){case"style":ft(e,o,S);break;case"dangerouslySetInnerHTML":if(o!=null){if(typeof o!="object"||!("__html"in o))throw Error(a(61));if(s=o.__html,s!=null){if(d.children!=null)throw Error(a(60));e.innerHTML=s}}break;case"children":typeof o=="string"?He(e,o):(typeof o=="number"||typeof o=="bigint")&&He(e,""+o);break;case"onScroll":o!=null&&Ze("scroll",e);break;case"onScrollEnd":o!=null&&Ze("scrollend",e);break;case"onClick":o!=null&&(e.onclick=Se);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Ht.hasOwnProperty(s))e:{if(s[0]==="o"&&s[1]==="n"&&(d=s.endsWith("Capture"),n=s.slice(2,d?s.length-7:void 0),S=e[wt]||null,S=S!=null?S[s]:null,typeof S=="function"&&e.removeEventListener(n,S,d),typeof o=="function")){typeof S!="function"&&S!==null&&(s in e?e[s]=null:e.hasAttribute(s)&&e.removeAttribute(s)),e.addEventListener(n,o,d);break e}s in e?e[s]=o:o===!0?e.setAttribute(s,""):Ri(e,s,o)}}}function xi(e,n,s){switch(n){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Ze("error",e),Ze("load",e);var o=!1,d=!1,S;for(S in s)if(s.hasOwnProperty(S)){var M=s[S];if(M!=null)switch(S){case"src":o=!0;break;case"srcSet":d=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(a(137,n));default:_t(e,n,S,M,s,null)}}d&&_t(e,n,"srcSet",s.srcSet,s,null),o&&_t(e,n,"src",s.src,s,null);return;case"input":Ze("invalid",e);var I=S=M=d=null,K=null,re=null;for(o in s)if(s.hasOwnProperty(o)){var ue=s[o];if(ue!=null)switch(o){case"name":d=ue;break;case"type":M=ue;break;case"checked":K=ue;break;case"defaultChecked":re=ue;break;case"value":S=ue;break;case"defaultValue":I=ue;break;case"children":case"dangerouslySetInnerHTML":if(ue!=null)throw Error(a(137,n));break;default:_t(e,n,o,ue,s,null)}}ys(e,S,I,K,re,M,d,!1);return;case"select":Ze("invalid",e),o=M=S=null;for(d in s)if(s.hasOwnProperty(d)&&(I=s[d],I!=null))switch(d){case"value":S=I;break;case"defaultValue":M=I;break;case"multiple":o=I;default:_t(e,n,d,I,s,null)}n=S,s=M,e.multiple=!!o,n!=null?yi(e,!!o,n,!1):s!=null&&yi(e,!!o,s,!0);return;case"textarea":Ze("invalid",e),S=d=o=null;for(M in s)if(s.hasOwnProperty(M)&&(I=s[M],I!=null))switch(M){case"value":o=I;break;case"defaultValue":d=I;break;case"children":S=I;break;case"dangerouslySetInnerHTML":if(I!=null)throw Error(a(91));break;default:_t(e,n,M,I,s,null)}na(e,o,d,S);return;case"option":for(K in s)s.hasOwnProperty(K)&&(o=s[K],o!=null)&&(K==="selected"?e.selected=o&&typeof o!="function"&&typeof o!="symbol":_t(e,n,K,o,s,null));return;case"dialog":Ze("beforetoggle",e),Ze("toggle",e),Ze("cancel",e),Ze("close",e);break;case"iframe":case"object":Ze("load",e);break;case"video":case"audio":for(o=0;o<$o.length;o++)Ze($o[o],e);break;case"image":Ze("error",e),Ze("load",e);break;case"details":Ze("toggle",e);break;case"embed":case"source":case"link":Ze("error",e),Ze("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(re in s)if(s.hasOwnProperty(re)&&(o=s[re],o!=null))switch(re){case"children":case"dangerouslySetInnerHTML":throw Error(a(137,n));default:_t(e,n,re,o,s,null)}return;default:if(jr(n)){for(ue in s)s.hasOwnProperty(ue)&&(o=s[ue],o!==void 0&&Td(e,n,ue,o,s,void 0));return}}for(I in s)s.hasOwnProperty(I)&&(o=s[I],o!=null&&_t(e,n,I,o,s,null))}function ow(e,n,s,o){switch(n){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var d=null,S=null,M=null,I=null,K=null,re=null,ue=null;for(le in s){var fe=s[le];if(s.hasOwnProperty(le)&&fe!=null)switch(le){case"checked":break;case"value":break;case"defaultValue":K=fe;default:o.hasOwnProperty(le)||_t(e,n,le,null,o,fe)}}for(var se in o){var le=o[se];if(fe=s[se],o.hasOwnProperty(se)&&(le!=null||fe!=null))switch(se){case"type":S=le;break;case"name":d=le;break;case"checked":re=le;break;case"defaultChecked":ue=le;break;case"value":M=le;break;case"defaultValue":I=le;break;case"children":case"dangerouslySetInnerHTML":if(le!=null)throw Error(a(137,n));break;default:le!==fe&&_t(e,n,se,le,o,fe)}}no(e,M,I,K,re,ue,S,d);return;case"select":le=M=I=se=null;for(S in s)if(K=s[S],s.hasOwnProperty(S)&&K!=null)switch(S){case"value":break;case"multiple":le=K;default:o.hasOwnProperty(S)||_t(e,n,S,null,o,K)}for(d in o)if(S=o[d],K=s[d],o.hasOwnProperty(d)&&(S!=null||K!=null))switch(d){case"value":se=S;break;case"defaultValue":I=S;break;case"multiple":M=S;default:S!==K&&_t(e,n,d,S,o,K)}n=I,s=M,o=le,se!=null?yi(e,!!s,se,!1):!!o!=!!s&&(n!=null?yi(e,!!s,n,!0):yi(e,!!s,s?[]:"",!1));return;case"textarea":le=se=null;for(I in s)if(d=s[I],s.hasOwnProperty(I)&&d!=null&&!o.hasOwnProperty(I))switch(I){case"value":break;case"children":break;default:_t(e,n,I,null,o,d)}for(M in o)if(d=o[M],S=s[M],o.hasOwnProperty(M)&&(d!=null||S!=null))switch(M){case"value":se=d;break;case"defaultValue":le=d;break;case"children":break;case"dangerouslySetInnerHTML":if(d!=null)throw Error(a(91));break;default:d!==S&&_t(e,n,M,d,o,S)}Ml(e,se,le);return;case"option":for(var Te in s)se=s[Te],s.hasOwnProperty(Te)&&se!=null&&!o.hasOwnProperty(Te)&&(Te==="selected"?e.selected=!1:_t(e,n,Te,null,o,se));for(K in o)se=o[K],le=s[K],o.hasOwnProperty(K)&&se!==le&&(se!=null||le!=null)&&(K==="selected"?e.selected=se&&typeof se!="function"&&typeof se!="symbol":_t(e,n,K,se,o,le));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 ze in s)se=s[ze],s.hasOwnProperty(ze)&&se!=null&&!o.hasOwnProperty(ze)&&_t(e,n,ze,null,o,se);for(re in o)if(se=o[re],le=s[re],o.hasOwnProperty(re)&&se!==le&&(se!=null||le!=null))switch(re){case"children":case"dangerouslySetInnerHTML":if(se!=null)throw Error(a(137,n));break;default:_t(e,n,re,se,o,le)}return;default:if(jr(n)){for(var vt in s)se=s[vt],s.hasOwnProperty(vt)&&se!==void 0&&!o.hasOwnProperty(vt)&&Td(e,n,vt,void 0,o,se);for(ue in o)se=o[ue],le=s[ue],!o.hasOwnProperty(ue)||se===le||se===void 0&&le===void 0||Td(e,n,ue,se,o,le);return}}for(var ie in s)se=s[ie],s.hasOwnProperty(ie)&&se!=null&&!o.hasOwnProperty(ie)&&_t(e,n,ie,null,o,se);for(fe in o)se=o[fe],le=s[fe],!o.hasOwnProperty(fe)||se===le||se==null&&le==null||_t(e,n,fe,se,o,le)}function gv(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function lw(){if(typeof performance.getEntriesByType=="function"){for(var e=0,n=0,s=performance.getEntriesByType("resource"),o=0;o<s.length;o++){var d=s[o],S=d.transferSize,M=d.initiatorType,I=d.duration;if(S&&I&&gv(M)){for(M=0,I=d.responseEnd,o+=1;o<s.length;o++){var K=s[o],re=K.startTime;if(re>I)break;var ue=K.transferSize,fe=K.initiatorType;ue&&gv(fe)&&(K=K.responseEnd,M+=ue*(K<I?1:(I-re)/(K-re)))}if(--o,n+=8*(S+M)/(d.duration/1e3),e++,10<e)break}}if(0<e)return n/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e=="number")?e:5}var Ad=null,kd=null;function kc(e){return e.nodeType===9?e:e.ownerDocument}function mv(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 _v(e,n){if(e===0)switch(n){case"svg":return 1;case"math":return 2;default:return 0}return e===1&&n==="foreignObject"?0:e}function Rd(e,n){return e==="textarea"||e==="noscript"||typeof n.children=="string"||typeof n.children=="number"||typeof n.children=="bigint"||typeof n.dangerouslySetInnerHTML=="object"&&n.dangerouslySetInnerHTML!==null&&n.dangerouslySetInnerHTML.__html!=null}var Ld=null;function cw(){var e=window.event;return e&&e.type==="popstate"?e===Ld?!1:(Ld=e,!0):(Ld=null,!1)}var vv=typeof setTimeout=="function"?setTimeout:void 0,uw=typeof clearTimeout=="function"?clearTimeout:void 0,bv=typeof Promise=="function"?Promise:void 0,hw=typeof queueMicrotask=="function"?queueMicrotask:typeof bv<"u"?function(e){return bv.resolve(null).then(e).catch(dw)}:vv;function dw(e){setTimeout(function(){throw e})}function is(e){return e==="head"}function yv(e,n){var s=n,o=0;do{var d=s.nextSibling;if(e.removeChild(s),d&&d.nodeType===8)if(s=d.data,s==="/$"||s==="/&"){if(o===0){e.removeChild(d),Da(n);return}o--}else if(s==="$"||s==="$?"||s==="$~"||s==="$!"||s==="&")o++;else if(s==="html")Uo(e.ownerDocument.documentElement);else if(s==="head"){s=e.ownerDocument.head,Uo(s);for(var S=s.firstChild;S;){var M=S.nextSibling,I=S.nodeName;S[qn]||I==="SCRIPT"||I==="STYLE"||I==="LINK"&&S.rel.toLowerCase()==="stylesheet"||s.removeChild(S),S=M}}else s==="body"&&Uo(e.ownerDocument.body);s=d}while(s);Da(n)}function Sv(e,n){var s=e;e=0;do{var o=s.nextSibling;if(s.nodeType===1?n?(s._stashedDisplay=s.style.display,s.style.display="none"):(s.style.display=s._stashedDisplay||"",s.getAttribute("style")===""&&s.removeAttribute("style")):s.nodeType===3&&(n?(s._stashedText=s.nodeValue,s.nodeValue=""):s.nodeValue=s._stashedText||""),o&&o.nodeType===8)if(s=o.data,s==="/$"){if(e===0)break;e--}else s!=="$"&&s!=="$?"&&s!=="$~"&&s!=="$!"||e++;s=o}while(s)}function Md(e){var n=e.firstChild;for(n&&n.nodeType===10&&(n=n.nextSibling);n;){var s=n;switch(n=n.nextSibling,s.nodeName){case"HTML":case"HEAD":case"BODY":Md(s),De(s);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(s.rel.toLowerCase()==="stylesheet")continue}e.removeChild(s)}}function fw(e,n,s,o){for(;e.nodeType===1;){var d=s;if(e.nodeName.toLowerCase()!==n.toLowerCase()){if(!o&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(o){if(!e[qn])switch(n){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(S=e.getAttribute("rel"),S==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(S!==d.rel||e.getAttribute("href")!==(d.href==null||d.href===""?null:d.href)||e.getAttribute("crossorigin")!==(d.crossOrigin==null?null:d.crossOrigin)||e.getAttribute("title")!==(d.title==null?null:d.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(S=e.getAttribute("src"),(S!==(d.src==null?null:d.src)||e.getAttribute("type")!==(d.type==null?null:d.type)||e.getAttribute("crossorigin")!==(d.crossOrigin==null?null:d.crossOrigin))&&S&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(n==="input"&&e.type==="hidden"){var S=d.name==null?null:""+d.name;if(d.type==="hidden"&&e.getAttribute("name")===S)return e}else return e;if(e=Sn(e.nextSibling),e===null)break}return null}function pw(e,n,s){if(n==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!s||(e=Sn(e.nextSibling),e===null))return null;return e}function Cv(e,n){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!n||(e=Sn(e.nextSibling),e===null))return null;return e}function Dd(e){return e.data==="$?"||e.data==="$~"}function Od(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function gw(e,n){var s=e.ownerDocument;if(e.data==="$~")e._reactRetry=n;else if(e.data!=="$?"||s.readyState!=="loading")n();else{var o=function(){n(),s.removeEventListener("DOMContentLoaded",o)};s.addEventListener("DOMContentLoaded",o),e._reactRetry=o}}function Sn(e){for(;e!=null;e=e.nextSibling){var n=e.nodeType;if(n===1||n===3)break;if(n===8){if(n=e.data,n==="$"||n==="$!"||n==="$?"||n==="$~"||n==="&"||n==="F!"||n==="F")break;if(n==="/$"||n==="/&")return null}}return e}var Bd=null;function wv(e){e=e.nextSibling;for(var n=0;e;){if(e.nodeType===8){var s=e.data;if(s==="/$"||s==="/&"){if(n===0)return Sn(e.nextSibling);n--}else s!=="$"&&s!=="$!"&&s!=="$?"&&s!=="$~"&&s!=="&"||n++}e=e.nextSibling}return null}function xv(e){e=e.previousSibling;for(var n=0;e;){if(e.nodeType===8){var s=e.data;if(s==="$"||s==="$!"||s==="$?"||s==="$~"||s==="&"){if(n===0)return e;n--}else s!=="/$"&&s!=="/&"||n++}e=e.previousSibling}return null}function Ev(e,n,s){switch(n=kc(s),e){case"html":if(e=n.documentElement,!e)throw Error(a(452));return e;case"head":if(e=n.head,!e)throw Error(a(453));return e;case"body":if(e=n.body,!e)throw Error(a(454));return e;default:throw Error(a(451))}}function Uo(e){for(var n=e.attributes;n.length;)e.removeAttributeNode(n[0]);De(e)}var Cn=new Map,Tv=new Set;function Rc(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var Er=V.d;V.d={f:mw,r:_w,D:vw,C:bw,L:yw,m:Sw,X:ww,S:Cw,M:xw};function mw(){var e=Er.f(),n=yc();return e||n}function _w(e){var n=pe(e);n!==null&&n.tag===5&&n.type==="form"?Fm(n):Er.r(e)}var Ra=typeof document>"u"?null:document;function Av(e,n,s){var o=Ra;if(o&&typeof n=="string"&&n){var d=Ui(n);d='link[rel="'+e+'"][href="'+d+'"]',typeof s=="string"&&(d+='[crossorigin="'+s+'"]'),Tv.has(d)||(Tv.add(d),e={rel:e,crossOrigin:s,href:n},o.querySelector(d)===null&&(n=o.createElement("link"),xi(n,"link",e),Ve(n),o.head.appendChild(n)))}}function vw(e){Er.D(e),Av("dns-prefetch",e,null)}function bw(e,n){Er.C(e,n),Av("preconnect",e,n)}function yw(e,n,s){Er.L(e,n,s);var o=Ra;if(o&&e&&n){var d='link[rel="preload"][as="'+Ui(n)+'"]';n==="image"&&s&&s.imageSrcSet?(d+='[imagesrcset="'+Ui(s.imageSrcSet)+'"]',typeof s.imageSizes=="string"&&(d+='[imagesizes="'+Ui(s.imageSizes)+'"]')):d+='[href="'+Ui(e)+'"]';var S=d;switch(n){case"style":S=La(e);break;case"script":S=Ma(e)}Cn.has(S)||(e=p({rel:"preload",href:n==="image"&&s&&s.imageSrcSet?void 0:e,as:n},s),Cn.set(S,e),o.querySelector(d)!==null||n==="style"&&o.querySelector(Po(S))||n==="script"&&o.querySelector(Fo(S))||(n=o.createElement("link"),xi(n,"link",e),Ve(n),o.head.appendChild(n)))}}function Sw(e,n){Er.m(e,n);var s=Ra;if(s&&e){var o=n&&typeof n.as=="string"?n.as:"script",d='link[rel="modulepreload"][as="'+Ui(o)+'"][href="'+Ui(e)+'"]',S=d;switch(o){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":S=Ma(e)}if(!Cn.has(S)&&(e=p({rel:"modulepreload",href:e},n),Cn.set(S,e),s.querySelector(d)===null)){switch(o){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(s.querySelector(Fo(S)))return}o=s.createElement("link"),xi(o,"link",e),Ve(o),s.head.appendChild(o)}}}function Cw(e,n,s){Er.S(e,n,s);var o=Ra;if(o&&e){var d=nt(o).hoistableStyles,S=La(e);n=n||"default";var M=d.get(S);if(!M){var I={loading:0,preload:null};if(M=o.querySelector(Po(S)))I.loading=5;else{e=p({rel:"stylesheet",href:e,"data-precedence":n},s),(s=Cn.get(S))&&Nd(e,s);var K=M=o.createElement("link");Ve(K),xi(K,"link",e),K._p=new Promise(function(re,ue){K.onload=re,K.onerror=ue}),K.addEventListener("load",function(){I.loading|=1}),K.addEventListener("error",function(){I.loading|=2}),I.loading|=4,Lc(M,n,o)}M={type:"stylesheet",instance:M,count:1,state:I},d.set(S,M)}}}function ww(e,n){Er.X(e,n);var s=Ra;if(s&&e){var o=nt(s).hoistableScripts,d=Ma(e),S=o.get(d);S||(S=s.querySelector(Fo(d)),S||(e=p({src:e,async:!0},n),(n=Cn.get(d))&&Id(e,n),S=s.createElement("script"),Ve(S),xi(S,"link",e),s.head.appendChild(S)),S={type:"script",instance:S,count:1,state:null},o.set(d,S))}}function xw(e,n){Er.M(e,n);var s=Ra;if(s&&e){var o=nt(s).hoistableScripts,d=Ma(e),S=o.get(d);S||(S=s.querySelector(Fo(d)),S||(e=p({src:e,async:!0,type:"module"},n),(n=Cn.get(d))&&Id(e,n),S=s.createElement("script"),Ve(S),xi(S,"link",e),s.head.appendChild(S)),S={type:"script",instance:S,count:1,state:null},o.set(d,S))}}function kv(e,n,s,o){var d=(d=_e.current)?Rc(d):null;if(!d)throw Error(a(446));switch(e){case"meta":case"title":return null;case"style":return typeof s.precedence=="string"&&typeof s.href=="string"?(n=La(s.href),s=nt(d).hoistableStyles,o=s.get(n),o||(o={type:"style",instance:null,count:0,state:null},s.set(n,o)),o):{type:"void",instance:null,count:0,state:null};case"link":if(s.rel==="stylesheet"&&typeof s.href=="string"&&typeof s.precedence=="string"){e=La(s.href);var S=nt(d).hoistableStyles,M=S.get(e);if(M||(d=d.ownerDocument||d,M={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},S.set(e,M),(S=d.querySelector(Po(e)))&&!S._p&&(M.instance=S,M.state.loading=5),Cn.has(e)||(s={rel:"preload",as:"style",href:s.href,crossOrigin:s.crossOrigin,integrity:s.integrity,media:s.media,hrefLang:s.hrefLang,referrerPolicy:s.referrerPolicy},Cn.set(e,s),S||Ew(d,e,s,M.state))),n&&o===null)throw Error(a(528,""));return M}if(n&&o!==null)throw Error(a(529,""));return null;case"script":return n=s.async,s=s.src,typeof s=="string"&&n&&typeof n!="function"&&typeof n!="symbol"?(n=Ma(s),s=nt(d).hoistableScripts,o=s.get(n),o||(o={type:"script",instance:null,count:0,state:null},s.set(n,o)),o):{type:"void",instance:null,count:0,state:null};default:throw Error(a(444,e))}}function La(e){return'href="'+Ui(e)+'"'}function Po(e){return'link[rel="stylesheet"]['+e+"]"}function Rv(e){return p({},e,{"data-precedence":e.precedence,precedence:null})}function Ew(e,n,s,o){e.querySelector('link[rel="preload"][as="style"]['+n+"]")?o.loading=1:(n=e.createElement("link"),o.preload=n,n.addEventListener("load",function(){return o.loading|=1}),n.addEventListener("error",function(){return o.loading|=2}),xi(n,"link",s),Ve(n),e.head.appendChild(n))}function Ma(e){return'[src="'+Ui(e)+'"]'}function Fo(e){return"script[async]"+e}function Lv(e,n,s){if(n.count++,n.instance===null)switch(n.type){case"style":var o=e.querySelector('style[data-href~="'+Ui(s.href)+'"]');if(o)return n.instance=o,Ve(o),o;var d=p({},s,{"data-href":s.href,"data-precedence":s.precedence,href:null,precedence:null});return o=(e.ownerDocument||e).createElement("style"),Ve(o),xi(o,"style",d),Lc(o,s.precedence,e),n.instance=o;case"stylesheet":d=La(s.href);var S=e.querySelector(Po(d));if(S)return n.state.loading|=4,n.instance=S,Ve(S),S;o=Rv(s),(d=Cn.get(d))&&Nd(o,d),S=(e.ownerDocument||e).createElement("link"),Ve(S);var M=S;return M._p=new Promise(function(I,K){M.onload=I,M.onerror=K}),xi(S,"link",o),n.state.loading|=4,Lc(S,s.precedence,e),n.instance=S;case"script":return S=Ma(s.src),(d=e.querySelector(Fo(S)))?(n.instance=d,Ve(d),d):(o=s,(d=Cn.get(S))&&(o=p({},s),Id(o,d)),e=e.ownerDocument||e,d=e.createElement("script"),Ve(d),xi(d,"link",o),e.head.appendChild(d),n.instance=d);case"void":return null;default:throw Error(a(443,n.type))}else n.type==="stylesheet"&&(n.state.loading&4)===0&&(o=n.instance,n.state.loading|=4,Lc(o,s.precedence,e));return n.instance}function Lc(e,n,s){for(var o=s.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),d=o.length?o[o.length-1]:null,S=d,M=0;M<o.length;M++){var I=o[M];if(I.dataset.precedence===n)S=I;else if(S!==d)break}S?S.parentNode.insertBefore(e,S.nextSibling):(n=s.nodeType===9?s.head:s,n.insertBefore(e,n.firstChild))}function Nd(e,n){e.crossOrigin==null&&(e.crossOrigin=n.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=n.referrerPolicy),e.title==null&&(e.title=n.title)}function Id(e,n){e.crossOrigin==null&&(e.crossOrigin=n.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=n.referrerPolicy),e.integrity==null&&(e.integrity=n.integrity)}var Mc=null;function Mv(e,n,s){if(Mc===null){var o=new Map,d=Mc=new Map;d.set(s,o)}else d=Mc,o=d.get(s),o||(o=new Map,d.set(s,o));if(o.has(e))return o;for(o.set(e,null),s=s.getElementsByTagName(e),d=0;d<s.length;d++){var S=s[d];if(!(S[qn]||S[Et]||e==="link"&&S.getAttribute("rel")==="stylesheet")&&S.namespaceURI!=="http://www.w3.org/2000/svg"){var M=S.getAttribute(n)||"";M=e+M;var I=o.get(M);I?I.push(S):o.set(M,[S])}}return o}function Dv(e,n,s){e=e.ownerDocument||e,e.head.insertBefore(s,n==="title"?e.querySelector("head > title"):null)}function Tw(e,n,s){if(s===1||n.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof n.precedence!="string"||typeof n.href!="string"||n.href==="")break;return!0;case"link":if(typeof n.rel!="string"||typeof n.href!="string"||n.href===""||n.onLoad||n.onError)break;return n.rel==="stylesheet"?(e=n.disabled,typeof n.precedence=="string"&&e==null):!0;case"script":if(n.async&&typeof n.async!="function"&&typeof n.async!="symbol"&&!n.onLoad&&!n.onError&&n.src&&typeof n.src=="string")return!0}return!1}function Ov(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function Aw(e,n,s,o){if(s.type==="stylesheet"&&(typeof o.media!="string"||matchMedia(o.media).matches!==!1)&&(s.state.loading&4)===0){if(s.instance===null){var d=La(o.href),S=n.querySelector(Po(d));if(S){n=S._p,n!==null&&typeof n=="object"&&typeof n.then=="function"&&(e.count++,e=Dc.bind(e),n.then(e,e)),s.state.loading|=4,s.instance=S,Ve(S);return}S=n.ownerDocument||n,o=Rv(o),(d=Cn.get(d))&&Nd(o,d),S=S.createElement("link"),Ve(S);var M=S;M._p=new Promise(function(I,K){M.onload=I,M.onerror=K}),xi(S,"link",o),s.instance=S}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(s,n),(n=s.state.preload)&&(s.state.loading&3)===0&&(e.count++,s=Dc.bind(e),n.addEventListener("load",s),n.addEventListener("error",s))}}var jd=0;function kw(e,n){return e.stylesheets&&e.count===0&&Bc(e,e.stylesheets),0<e.count||0<e.imgCount?function(s){var o=setTimeout(function(){if(e.stylesheets&&Bc(e,e.stylesheets),e.unsuspend){var S=e.unsuspend;e.unsuspend=null,S()}},6e4+n);0<e.imgBytes&&jd===0&&(jd=62500*lw());var d=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&Bc(e,e.stylesheets),e.unsuspend)){var S=e.unsuspend;e.unsuspend=null,S()}},(e.imgBytes>jd?50:800)+n);return e.unsuspend=s,function(){e.unsuspend=null,clearTimeout(o),clearTimeout(d)}}:null}function Dc(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Bc(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Oc=null;function Bc(e,n){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Oc=new Map,n.forEach(Rw,e),Oc=null,Dc.call(e))}function Rw(e,n){if(!(n.state.loading&4)){var s=Oc.get(e);if(s)var o=s.get(null);else{s=new Map,Oc.set(e,s);for(var d=e.querySelectorAll("link[data-precedence],style[data-precedence]"),S=0;S<d.length;S++){var M=d[S];(M.nodeName==="LINK"||M.getAttribute("media")!=="not all")&&(s.set(M.dataset.precedence,M),o=M)}o&&s.set(null,o)}d=n.instance,M=d.getAttribute("data-precedence"),S=s.get(M)||o,S===o&&s.set(null,d),s.set(M,d),this.count++,o=Dc.bind(this),d.addEventListener("load",o),d.addEventListener("error",o),S?S.parentNode.insertBefore(d,S.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(d,e.firstChild)),n.state.loading|=4}}var qo={$$typeof:_,Provider:null,Consumer:null,_currentValue:Y,_currentValue2:Y,_threadCount:0};function Lw(e,n,s,o,d,S,M,I,K){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=yt(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=yt(0),this.hiddenUpdates=yt(null),this.identifierPrefix=o,this.onUncaughtError=d,this.onCaughtError=S,this.onRecoverableError=M,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=K,this.incompleteTransitions=new Map}function Bv(e,n,s,o,d,S,M,I,K,re,ue,fe){return e=new Lw(e,n,s,M,K,re,ue,fe,I),n=1,S===!0&&(n|=24),S=sn(3,null,null,n),e.current=S,S.stateNode=e,n=mh(),n.refCount++,e.pooledCache=n,n.refCount++,S.memoizedState={element:o,isDehydrated:s,cache:n},yh(S),e}function Nv(e){return e?(e=la,e):la}function Iv(e,n,s,o,d,S){d=Nv(d),o.context===null?o.context=d:o.pendingContext=d,o=Wr(n),o.payload={element:s},S=S===void 0?null:S,S!==null&&(o.callback=S),s=Gr(e,o,n),s!==null&&(Ki(s,e,n),Co(s,e,n))}function jv(e,n){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var s=e.retryLane;e.retryLane=s!==0&&s<n?s:n}}function zd(e,n){jv(e,n),(e=e.alternate)&&jv(e,n)}function zv(e){if(e.tag===13||e.tag===31){var n=xs(e,67108864);n!==null&&Ki(n,e,67108864),zd(e,67108864)}}function $v(e){if(e.tag===13||e.tag===31){var n=un();n=Qe(n);var s=xs(e,n);s!==null&&Ki(s,e,n),zd(e,n)}}var Nc=!0;function Mw(e,n,s,o){var d=P.T;P.T=null;var S=V.p;try{V.p=2,$d(e,n,s,o)}finally{V.p=S,P.T=d}}function Dw(e,n,s,o){var d=P.T;P.T=null;var S=V.p;try{V.p=8,$d(e,n,s,o)}finally{V.p=S,P.T=d}}function $d(e,n,s,o){if(Nc){var d=Hd(o);if(d===null)Ed(e,n,o,Ic,s),Uv(e,o);else if(Bw(d,e,n,s,o))o.stopPropagation();else if(Uv(e,o),n&4&&-1<Ow.indexOf(e)){for(;d!==null;){var S=pe(d);if(S!==null)switch(S.tag){case 3:if(S=S.stateNode,S.current.memoizedState.isDehydrated){var M=ii(S.pendingLanes);if(M!==0){var I=S;for(I.pendingLanes|=2,I.entangledLanes|=2;M;){var K=1<<31-$t(M);I.entanglements[1]|=K,M&=~K}Yn(S),(ut&6)===0&&(vc=ct()+500,zo(0))}}break;case 31:case 13:I=xs(S,2),I!==null&&Ki(I,S,2),yc(),zd(S,2)}if(S=Hd(o),S===null&&Ed(e,n,o,Ic,s),S===d)break;d=S}d!==null&&o.stopPropagation()}else Ed(e,n,o,null,s)}}function Hd(e){return e=Fe(e),Ud(e)}var Ic=null;function Ud(e){if(Ic=null,e=G(e),e!==null){var n=v(e);if(n===null)e=null;else{var s=n.tag;if(s===13){if(e=m(n),e!==null)return e;e=null}else if(s===31){if(e=c(n),e!==null)return e;e=null}else if(s===3){if(n.stateNode.current.memoizedState.isDehydrated)return n.tag===3?n.stateNode.containerInfo:null;e=null}else n!==e&&(e=null)}}return Ic=e,null}function Hv(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"resize":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"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"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(Kt()){case jt:return 2;case zt:return 8;case ti:case Ln:return 32;case ki:return 268435456;default:return 32}default:return 32}}var Pd=!1,ns=null,rs=null,ss=null,Wo=new Map,Go=new Map,as=[],Ow="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 Uv(e,n){switch(e){case"focusin":case"focusout":ns=null;break;case"dragenter":case"dragleave":rs=null;break;case"mouseover":case"mouseout":ss=null;break;case"pointerover":case"pointerout":Wo.delete(n.pointerId);break;case"gotpointercapture":case"lostpointercapture":Go.delete(n.pointerId)}}function Ko(e,n,s,o,d,S){return e===null||e.nativeEvent!==S?(e={blockedOn:n,domEventName:s,eventSystemFlags:o,nativeEvent:S,targetContainers:[d]},n!==null&&(n=pe(n),n!==null&&zv(n)),e):(e.eventSystemFlags|=o,n=e.targetContainers,d!==null&&n.indexOf(d)===-1&&n.push(d),e)}function Bw(e,n,s,o,d){switch(n){case"focusin":return ns=Ko(ns,e,n,s,o,d),!0;case"dragenter":return rs=Ko(rs,e,n,s,o,d),!0;case"mouseover":return ss=Ko(ss,e,n,s,o,d),!0;case"pointerover":var S=d.pointerId;return Wo.set(S,Ko(Wo.get(S)||null,e,n,s,o,d)),!0;case"gotpointercapture":return S=d.pointerId,Go.set(S,Ko(Go.get(S)||null,e,n,s,o,d)),!0}return!1}function Pv(e){var n=G(e.target);if(n!==null){var s=v(n);if(s!==null){if(n=s.tag,n===13){if(n=m(s),n!==null){e.blockedOn=n,or(e.priority,function(){$v(s)});return}}else if(n===31){if(n=c(s),n!==null){e.blockedOn=n,or(e.priority,function(){$v(s)});return}}else if(n===3&&s.stateNode.current.memoizedState.isDehydrated){e.blockedOn=s.tag===3?s.stateNode.containerInfo:null;return}}}e.blockedOn=null}function jc(e){if(e.blockedOn!==null)return!1;for(var n=e.targetContainers;0<n.length;){var s=Hd(e.nativeEvent);if(s===null){s=e.nativeEvent;var o=new s.constructor(s.type,s);ke=o,s.target.dispatchEvent(o),ke=null}else return n=pe(s),n!==null&&zv(n),e.blockedOn=s,!1;n.shift()}return!0}function Fv(e,n,s){jc(e)&&s.delete(n)}function Nw(){Pd=!1,ns!==null&&jc(ns)&&(ns=null),rs!==null&&jc(rs)&&(rs=null),ss!==null&&jc(ss)&&(ss=null),Wo.forEach(Fv),Go.forEach(Fv)}function zc(e,n){e.blockedOn===n&&(e.blockedOn=null,Pd||(Pd=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,Nw)))}var $c=null;function qv(e){$c!==e&&($c=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){$c===e&&($c=null);for(var n=0;n<e.length;n+=3){var s=e[n],o=e[n+1],d=e[n+2];if(typeof o!="function"){if(Ud(o||s)===null)continue;break}var S=pe(s);S!==null&&(e.splice(n,3),n-=3,Hh(S,{pending:!0,data:d,method:s.method,action:o},o,d))}}))}function Da(e){function n(K){return zc(K,e)}ns!==null&&zc(ns,e),rs!==null&&zc(rs,e),ss!==null&&zc(ss,e),Wo.forEach(n),Go.forEach(n);for(var s=0;s<as.length;s++){var o=as[s];o.blockedOn===e&&(o.blockedOn=null)}for(;0<as.length&&(s=as[0],s.blockedOn===null);)Pv(s),s.blockedOn===null&&as.shift();if(s=(e.ownerDocument||e).$$reactFormReplay,s!=null)for(o=0;o<s.length;o+=3){var d=s[o],S=s[o+1],M=d[wt]||null;if(typeof S=="function")M||qv(s);else if(M){var I=null;if(S&&S.hasAttribute("formAction")){if(d=S,M=S[wt]||null)I=M.formAction;else if(Ud(d)!==null)continue}else I=M.action;typeof I=="function"?s[o+1]=I:(s.splice(o,3),o-=3),qv(s)}}}function Wv(){function e(S){S.canIntercept&&S.info==="react-transition"&&S.intercept({handler:function(){return new Promise(function(M){return d=M})},focusReset:"manual",scroll:"manual"})}function n(){d!==null&&(d(),d=null),o||setTimeout(s,20)}function s(){if(!o&&!navigation.transition){var S=navigation.currentEntry;S&&S.url!=null&&navigation.navigate(S.url,{state:S.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var o=!1,d=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",n),navigation.addEventListener("navigateerror",n),setTimeout(s,100),function(){o=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",n),navigation.removeEventListener("navigateerror",n),d!==null&&(d(),d=null)}}}function Fd(e){this._internalRoot=e}Hc.prototype.render=Fd.prototype.render=function(e){var n=this._internalRoot;if(n===null)throw Error(a(409));var s=n.current,o=un();Iv(s,o,e,n,null,null)},Hc.prototype.unmount=Fd.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var n=e.containerInfo;Iv(e.current,2,null,e,null,null),yc(),n[Dn]=null}};function Hc(e){this._internalRoot=e}Hc.prototype.unstable_scheduleHydration=function(e){if(e){var n=ar();e={blockedOn:null,target:e,priority:n};for(var s=0;s<as.length&&n!==0&&n<as[s].priority;s++);as.splice(s,0,e),s===0&&Pv(e)}};var Gv=i.version;if(Gv!=="19.2.7")throw Error(a(527,Gv,"19.2.7"));V.findDOMNode=function(e){var n=e._reactInternals;if(n===void 0)throw typeof e.render=="function"?Error(a(188)):(e=Object.keys(e).join(","),Error(a(268,e)));return e=h(n),e=e!==null?b(e):null,e=e===null?null:e.stateNode,e};var Iw={bundleType:0,version:"19.2.7",rendererPackageName:"react-dom",currentDispatcherRef:P,reconcilerVersion:"19.2.7"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Uc=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Uc.isDisabled&&Uc.supportsFiber)try{zi=Uc.inject(Iw),Yt=Uc}catch{}}return Vo.createRoot=function(e,n){if(!l(e))throw Error(a(299));var s=!1,o="",d=Qm,S=e_,M=t_;return n!=null&&(n.unstable_strictMode===!0&&(s=!0),n.identifierPrefix!==void 0&&(o=n.identifierPrefix),n.onUncaughtError!==void 0&&(d=n.onUncaughtError),n.onCaughtError!==void 0&&(S=n.onCaughtError),n.onRecoverableError!==void 0&&(M=n.onRecoverableError)),n=Bv(e,1,!1,null,null,s,o,null,d,S,M,Wv),e[Dn]=n.current,xd(e),new Fd(n)},Vo.hydrateRoot=function(e,n,s){if(!l(e))throw Error(a(299));var o=!1,d="",S=Qm,M=e_,I=t_,K=null;return s!=null&&(s.unstable_strictMode===!0&&(o=!0),s.identifierPrefix!==void 0&&(d=s.identifierPrefix),s.onUncaughtError!==void 0&&(S=s.onUncaughtError),s.onCaughtError!==void 0&&(M=s.onCaughtError),s.onRecoverableError!==void 0&&(I=s.onRecoverableError),s.formState!==void 0&&(K=s.formState)),n=Bv(e,1,!0,n,s??null,o,d,K,S,M,I,Wv),n.context=Nv(null),s=n.current,o=un(),o=Qe(o),d=Wr(o),d.callback=null,Gr(s,d,o),s=o,n.current.lanes=s,dt(n,s),Yn(n),e[Dn]=n.current,xd(e),new Hc(n)},Vo.version="19.2.7",Vo}var i0;function Kw(){if(i0)return Gd.exports;i0=1;function t(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(i){console.error(i)}}return t(),Gd.exports=Gw(),Gd.exports}var Yw=Kw();var n0="popstate";function r0(t){return typeof t=="object"&&t!=null&&"pathname"in t&&"search"in t&&"hash"in t&&"state"in t&&"key"in t}function Vw(t={}){function i(a,l){let v=l.state?.masked,{pathname:m,search:c,hash:u}=v||a.location;return Hf("",{pathname:m,search:c,hash:u},l.state&&l.state.usr||null,l.state&&l.state.key||"default",v?{pathname:a.location.pathname,search:a.location.search,hash:a.location.hash}:void 0)}function r(a,l){return typeof l=="string"?l:_l(l)}return Zw(i,r,null,t)}function Ot(t,i){if(t===!1||t===null||typeof t>"u")throw new Error(i)}function Hn(t,i){if(!t){typeof console<"u"&&console.warn(i);try{throw new Error(i)}catch{}}}function Xw(){return Math.random().toString(36).substring(2,10)}function s0(t,i){return{usr:t.state,key:t.key,idx:i,masked:t.mask?{pathname:t.pathname,search:t.search,hash:t.hash}:void 0}}function Hf(t,i,r=null,a,l){return{pathname:typeof t=="string"?t:t.pathname,search:"",hash:"",...typeof i=="string"?Ya(i):i,state:r,key:i&&i.key||a||Xw(),mask:l}}function _l({pathname:t="/",search:i="",hash:r=""}){return i&&i!=="?"&&(t+=i.charAt(0)==="?"?i:"?"+i),r&&r!=="#"&&(t+=r.charAt(0)==="#"?r:"#"+r),t}function Ya(t){let i={};if(t){let r=t.indexOf("#");r>=0&&(i.hash=t.substring(r),t=t.substring(0,r));let a=t.indexOf("?");a>=0&&(i.search=t.substring(a),t=t.substring(0,a)),t&&(i.pathname=t)}return i}function Zw(t,i,r,a={}){let{window:l=document.defaultView,v5Compat:v=!1}=a,m=l.history,c="POP",u=null,h=b();h==null&&(h=0,m.replaceState({...m.state,idx:h},""));function b(){return(m.state||{idx:null}).idx}function p(){c="POP";let g=b(),y=g==null?null:g-h;h=g,u&&u({action:c,location:x.location,delta:y})}function C(g,y){c="PUSH";let f=r0(g)?g:Hf(x.location,g,y);h=b()+1;let _=s0(f,h),E=x.createHref(f.mask||f);try{m.pushState(_,"",E)}catch(L){if(L instanceof DOMException&&L.name==="DataCloneError")throw L;l.location.assign(E)}v&&u&&u({action:c,location:x.location,delta:1})}function w(g,y){c="REPLACE";let f=r0(g)?g:Hf(x.location,g,y);h=b();let _=s0(f,h),E=x.createHref(f.mask||f);m.replaceState(_,"",E),v&&u&&u({action:c,location:x.location,delta:0})}function A(g){return Jw(l,g)}let x={get action(){return c},get location(){return t(l,m)},listen(g){if(u)throw new Error("A history only accepts one active listener");return l.addEventListener(n0,p),u=g,()=>{l.removeEventListener(n0,p),u=null}},createHref(g){return i(l,g)},createURL:A,encodeLocation(g){let y=A(g);return{pathname:y.pathname,search:y.search,hash:y.hash}},push:C,replace:w,go(g){return m.go(g)}};return x}function Jw(t,i,r=!1){let a="http://localhost";t&&(a=t.location.origin!=="null"?t.location.origin:t.location.href),Ot(a,"No window.location.(origin|href) available to create URL");let l=typeof i=="string"?i:_l(i);return l=l.replace(/ $/,"%20"),!r&&l.startsWith("//")&&(l=a+l),new URL(l,a)}function tb(t,i,r="/"){return Qw(t,i,r,!1)}function Qw(t,i,r,a,l){let v=typeof i=="string"?Ya(i):i,m=Or(v.pathname||"/",r);if(m==null)return null;let c=e2(t),u=null,h=d2(m);for(let b=0;u==null&&b<c.length;++b)u=u2(c[b],h,a);return u}function e2(t){let i=ib(t);return t2(i),i}function ib(t,i=[],r=[],a="",l=!1){let v=(m,c,u=l,h)=>{let b={relativePath:h===void 0?m.path||"":h,caseSensitive:m.caseSensitive===!0,childrenIndex:c,route:m};if(b.relativePath.startsWith("/")){if(!b.relativePath.startsWith(a)&&u)return;Ot(b.relativePath.startsWith(a),`Absolute route path "${b.relativePath}" nested under path "${a}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),b.relativePath=b.relativePath.slice(a.length)}let p=$n([a,b.relativePath]),C=r.concat(b);m.children&&m.children.length>0&&(Ot(m.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${p}".`),ib(m.children,i,C,p,u)),!(m.path==null&&!m.index)&&i.push({path:p,score:l2(p,m.index),routesMeta:C})};return t.forEach((m,c)=>{if(m.path===""||!m.path?.includes("?"))v(m,c);else for(let u of nb(m.path))v(m,c,!0,u)}),i}function nb(t){let i=t.split("/");if(i.length===0)return[];let[r,...a]=i,l=r.endsWith("?"),v=r.replace(/\?$/,"");if(a.length===0)return l?[v,""]:[v];let m=nb(a.join("/")),c=[];return c.push(...m.map(u=>u===""?v:[v,u].join("/"))),l&&c.push(...m),c.map(u=>t.startsWith("/")&&u===""?"/":u)}function t2(t){t.sort((i,r)=>i.score!==r.score?r.score-i.score:c2(i.routesMeta.map(a=>a.childrenIndex),r.routesMeta.map(a=>a.childrenIndex)))}var i2=/^:[\w-]+$/,n2=3,r2=2,s2=1,a2=10,o2=-2,a0=t=>t==="*";function l2(t,i){let r=t.split("/"),a=r.length;return r.some(a0)&&(a+=o2),i&&(a+=r2),r.filter(l=>!a0(l)).reduce((l,v)=>l+(i2.test(v)?n2:v===""?s2:a2),a)}function c2(t,i){return t.length===i.length&&t.slice(0,-1).every((a,l)=>a===i[l])?t[t.length-1]-i[i.length-1]:0}function u2(t,i,r=!1){let{routesMeta:a}=t,l={},v="/",m=[];for(let c=0;c<a.length;++c){let u=a[c],h=c===a.length-1,b=v==="/"?i:i.slice(v.length)||"/",p=gu({path:u.relativePath,caseSensitive:u.caseSensitive,end:h},b),C=u.route;if(!p&&h&&r&&!a[a.length-1].route.index&&(p=gu({path:u.relativePath,caseSensitive:u.caseSensitive,end:!1},b)),!p)return null;Object.assign(l,p.params),m.push({params:l,pathname:$n([v,p.pathname]),pathnameBase:m2($n([v,p.pathnameBase])),route:C}),p.pathnameBase!=="/"&&(v=$n([v,p.pathnameBase]))}return m}function gu(t,i){typeof t=="string"&&(t={path:t,caseSensitive:!1,end:!0});let[r,a]=h2(t.path,t.caseSensitive,t.end),l=i.match(r);if(!l)return null;let v=l[0],m=v.replace(/(.)\/+$/,"$1"),c=l.slice(1);return{params:a.reduce((h,{paramName:b,isOptional:p},C)=>{if(b==="*"){let A=c[C]||"";m=v.slice(0,v.length-A.length).replace(/(.)\/+$/,"$1")}const w=c[C];return p&&!w?h[b]=void 0:h[b]=(w||"").replace(/%2F/g,"/"),h},{}),pathname:v,pathnameBase:m,pattern:t}}function h2(t,i=!1,r=!0){Hn(t==="*"||!t.endsWith("*")||t.endsWith("/*"),`Route path "${t}" will be treated as if it were "${t.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${t.replace(/\*$/,"/*")}".`);let a=[],l="^"+t.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(m,c,u,h,b)=>{if(a.push({paramName:c,isOptional:u!=null}),u){let p=b.charAt(h+m.length);return p&&p!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}return"/([^\\/]+)"}).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return t.endsWith("*")?(a.push({paramName:"*"}),l+=t==="*"||t==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):r?l+="\\/*$":t!==""&&t!=="/"&&(l+="(?:(?=\\/|$))"),[new RegExp(l,i?void 0:"i"),a]}function d2(t){try{return t.split("/").map(i=>decodeURIComponent(i).replace(/\//g,"%2F")).join("/")}catch(i){return Hn(!1,`The URL path "${t}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${i}).`),t}}function Or(t,i){if(i==="/")return t;if(!t.toLowerCase().startsWith(i.toLowerCase()))return null;let r=i.endsWith("/")?i.length-1:i.length,a=t.charAt(r);return a&&a!=="/"?null:t.slice(r)||"/"}var f2=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function p2(t,i="/"){let{pathname:r,search:a="",hash:l=""}=typeof t=="string"?Ya(t):t,v;return r?(r=rb(r),r.startsWith("/")?v=o0(r.substring(1),"/"):v=o0(r,i)):v=i,{pathname:v,search:_2(a),hash:v2(l)}}function o0(t,i){let r=mu(i).split("/");return t.split("/").forEach(l=>{l===".."?r.length>1&&r.pop():l!=="."&&r.push(l)}),r.length>1?r.join("/"):"/"}function Xd(t,i,r,a){return`Cannot include a '${t}' character in a manually specified \`to.${i}\` field [${JSON.stringify(a)}]. Please separate it out to the \`to.${r}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function g2(t){return t.filter((i,r)=>r===0||i.route.path&&i.route.path.length>0)}function xp(t){let i=g2(t);return i.map((r,a)=>a===i.length-1?r.pathname:r.pathnameBase)}function ku(t,i,r,a=!1){let l;typeof t=="string"?l=Ya(t):(l={...t},Ot(!l.pathname||!l.pathname.includes("?"),Xd("?","pathname","search",l)),Ot(!l.pathname||!l.pathname.includes("#"),Xd("#","pathname","hash",l)),Ot(!l.search||!l.search.includes("#"),Xd("#","search","hash",l)));let v=t===""||l.pathname==="",m=v?"/":l.pathname,c;if(m==null)c=r;else{let p=i.length-1;if(!a&&m.startsWith("..")){let C=m.split("/");for(;C[0]==="..";)C.shift(),p-=1;l.pathname=C.join("/")}c=p>=0?i[p]:"/"}let u=p2(l,c),h=m&&m!=="/"&&m.endsWith("/"),b=(v||m===".")&&r.endsWith("/");return!u.pathname.endsWith("/")&&(h||b)&&(u.pathname+="/"),u}var rb=t=>t.replace(/\/\/+/g,"/"),$n=t=>rb(t.join("/")),mu=t=>t.replace(/\/+$/,""),m2=t=>mu(t).replace(/^\/*/,"/"),_2=t=>!t||t==="?"?"":t.startsWith("?")?t:"?"+t,v2=t=>!t||t==="#"?"":t.startsWith("#")?t:"#"+t,b2=class{constructor(t,i,r,a=!1){this.status=t,this.statusText=i||"",this.internal=a,r instanceof Error?(this.data=r.toString(),this.error=r):this.data=r}};function y2(t){return t!=null&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.internal=="boolean"&&"data"in t}function S2(t){let i=t.map(r=>r.route.path).filter(Boolean);return $n(i)||"/"}var sb=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function ab(t,i){let r=t;if(typeof r!="string"||!f2.test(r))return{absoluteURL:void 0,isExternal:!1,to:r};let a=r,l=!1;if(sb)try{let v=new URL(window.location.href),m=r.startsWith("//")?new URL(v.protocol+r):new URL(r),c=Or(m.pathname,i);m.origin===v.origin&&c!=null?r=c+m.search+m.hash:l=!0}catch{Hn(!1,`<Link to="${r}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:a,isExternal:l,to:r}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var ob=["POST","PUT","PATCH","DELETE"];new Set(ob);var C2=["GET",...ob];new Set(C2);var Va=q.createContext(null);Va.displayName="DataRouter";var Ru=q.createContext(null);Ru.displayName="DataRouterState";var lb=q.createContext(!1);function w2(){return q.useContext(lb)}var cb=q.createContext({isTransitioning:!1});cb.displayName="ViewTransition";var x2=q.createContext(new Map);x2.displayName="Fetchers";var E2=q.createContext(null);E2.displayName="Await";var dn=q.createContext(null);dn.displayName="Navigation";var xl=q.createContext(null);xl.displayName="Location";var tr=q.createContext({outlet:null,matches:[],isDataRoute:!1});tr.displayName="Route";var Ep=q.createContext(null);Ep.displayName="RouteError";var ub="REACT_ROUTER_ERROR",T2="REDIRECT",A2="ROUTE_ERROR_RESPONSE";function k2(t){if(t.startsWith(`${ub}:${T2}:{`))try{let i=JSON.parse(t.slice(28));if(typeof i=="object"&&i&&typeof i.status=="number"&&typeof i.statusText=="string"&&typeof i.location=="string"&&typeof i.reloadDocument=="boolean"&&typeof i.replace=="boolean")return i}catch{}}function R2(t){if(t.startsWith(`${ub}:${A2}:{`))try{let i=JSON.parse(t.slice(40));if(typeof i=="object"&&i&&typeof i.status=="number"&&typeof i.statusText=="string")return new b2(i.status,i.statusText,i.data)}catch{}}function L2(t,{relative:i}={}){Ot(Xa(),"useHref() may be used only in the context of a <Router> component.");let{basename:r,navigator:a}=q.useContext(dn),{hash:l,pathname:v,search:m}=El(t,{relative:i}),c=v;return r!=="/"&&(c=v==="/"?r:$n([r,v])),a.createHref({pathname:c,search:m,hash:l})}function Xa(){return q.useContext(xl)!=null}function Pn(){return Ot(Xa(),"useLocation() may be used only in the context of a <Router> component."),q.useContext(xl).location}var hb="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function db(t){q.useContext(dn).static||q.useLayoutEffect(t)}function Tp(){let{isDataRoute:t}=q.useContext(tr);return t?F2():M2()}function M2(){Ot(Xa(),"useNavigate() may be used only in the context of a <Router> component.");let t=q.useContext(Va),{basename:i,navigator:r}=q.useContext(dn),{matches:a}=q.useContext(tr),{pathname:l}=Pn(),v=JSON.stringify(xp(a)),m=q.useRef(!1);return db(()=>{m.current=!0}),q.useCallback((u,h={})=>{if(Hn(m.current,hb),!m.current)return;if(typeof u=="number"){r.go(u);return}let b=ku(u,JSON.parse(v),l,h.relative==="path");t==null&&i!=="/"&&(b.pathname=b.pathname==="/"?i:$n([i,b.pathname])),(h.replace?r.replace:r.push)(b,h.state,h)},[i,r,v,l,t])}q.createContext(null);function El(t,{relative:i}={}){let{matches:r}=q.useContext(tr),{pathname:a}=Pn(),l=JSON.stringify(xp(r));return q.useMemo(()=>ku(t,JSON.parse(l),a,i==="path"),[t,l,a,i])}function D2(t,i){return fb(t,i)}function fb(t,i,r){Ot(Xa(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:a}=q.useContext(dn),{matches:l}=q.useContext(tr),v=l[l.length-1],m=v?v.params:{},c=v?v.pathname:"/",u=v?v.pathnameBase:"/",h=v&&v.route;{let g=h&&h.path||"";gb(c,!h||g.endsWith("*")||g.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${c}" (under <Route path="${g}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
|
|
10
|
+
|
|
11
|
+
Please change the parent <Route path="${g}"> to <Route path="${g==="/"?"*":`${g}/*`}">.`)}let b=Pn(),p;if(i){let g=typeof i=="string"?Ya(i):i;Ot(u==="/"||g.pathname?.startsWith(u),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${u}" but pathname "${g.pathname}" was given in the \`location\` prop.`),p=g}else p=b;let C=p.pathname||"/",w=C;if(u!=="/"){let g=u.replace(/^\//,"").split("/");w="/"+C.replace(/^\//,"").split("/").slice(g.length).join("/")}let A=r&&r.state.matches.length?r.state.matches.map(g=>Object.assign(g,{route:r.manifest[g.route.id]||g.route})):tb(t,{pathname:w});Hn(h||A!=null,`No routes matched location "${p.pathname}${p.search}${p.hash}" `),Hn(A==null||A[A.length-1].route.element!==void 0||A[A.length-1].route.Component!==void 0||A[A.length-1].route.lazy!==void 0,`Matched leaf route at location "${p.pathname}${p.search}${p.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let x=j2(A&&A.map(g=>Object.assign({},g,{params:Object.assign({},m,g.params),pathname:$n([u,a.encodeLocation?a.encodeLocation(g.pathname.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:g.pathname]),pathnameBase:g.pathnameBase==="/"?u:$n([u,a.encodeLocation?a.encodeLocation(g.pathnameBase.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:g.pathnameBase])})),l,r);return i&&x?q.createElement(xl.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",mask:void 0,...p},navigationType:"POP"}},x):x}function O2(){let t=P2(),i=y2(t)?`${t.status} ${t.statusText}`:t instanceof Error?t.message:JSON.stringify(t),r=t instanceof Error?t.stack:null,a="rgba(200,200,200, 0.5)",l={padding:"0.5rem",backgroundColor:a},v={padding:"2px 4px",backgroundColor:a},m=null;return console.error("Error handled by React Router default ErrorBoundary:",t),m=q.createElement(q.Fragment,null,q.createElement("p",null,"💿 Hey developer 👋"),q.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",q.createElement("code",{style:v},"ErrorBoundary")," or"," ",q.createElement("code",{style:v},"errorElement")," prop on your route.")),q.createElement(q.Fragment,null,q.createElement("h2",null,"Unexpected Application Error!"),q.createElement("h3",{style:{fontStyle:"italic"}},i),r?q.createElement("pre",{style:l},r):null,m)}var B2=q.createElement(O2,null),pb=class extends q.Component{constructor(t){super(t),this.state={location:t.location,revalidation:t.revalidation,error:t.error}}static getDerivedStateFromError(t){return{error:t}}static getDerivedStateFromProps(t,i){return i.location!==t.location||i.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error!==void 0?t.error:i.error,location:i.location,revalidation:t.revalidation||i.revalidation}}componentDidCatch(t,i){this.props.onError?this.props.onError(t,i):console.error("React Router caught the following error during render",t)}render(){let t=this.state.error;if(this.context&&typeof t=="object"&&t&&"digest"in t&&typeof t.digest=="string"){const r=R2(t.digest);r&&(t=r)}let i=t!==void 0?q.createElement(tr.Provider,{value:this.props.routeContext},q.createElement(Ep.Provider,{value:t,children:this.props.component})):this.props.children;return this.context?q.createElement(N2,{error:t},i):i}};pb.contextType=lb;var Zd=new WeakMap;function N2({children:t,error:i}){let{basename:r}=q.useContext(dn);if(typeof i=="object"&&i&&"digest"in i&&typeof i.digest=="string"){let a=k2(i.digest);if(a){let l=Zd.get(i);if(l)throw l;let v=ab(a.location,r);if(sb&&!Zd.get(i))if(v.isExternal||a.reloadDocument)window.location.href=v.absoluteURL||v.to;else{const m=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(v.to,{replace:a.replace}));throw Zd.set(i,m),m}return q.createElement("meta",{httpEquiv:"refresh",content:`0;url=${v.absoluteURL||v.to}`})}}return t}function I2({routeContext:t,match:i,children:r}){let a=q.useContext(Va);return a&&a.static&&a.staticContext&&(i.route.errorElement||i.route.ErrorBoundary)&&(a.staticContext._deepestRenderedBoundaryId=i.route.id),q.createElement(tr.Provider,{value:t},r)}function j2(t,i=[],r){let a=r?.state;if(t==null){if(!a)return null;if(a.errors)t=a.matches;else if(i.length===0&&!a.initialized&&a.matches.length>0)t=a.matches;else return null}let l=t,v=a?.errors;if(v!=null){let b=l.findIndex(p=>p.route.id&&v?.[p.route.id]!==void 0);Ot(b>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(v).join(",")}`),l=l.slice(0,Math.min(l.length,b+1))}let m=!1,c=-1;if(r&&a){m=a.renderFallback;for(let b=0;b<l.length;b++){let p=l[b];if((p.route.HydrateFallback||p.route.hydrateFallbackElement)&&(c=b),p.route.id){let{loaderData:C,errors:w}=a,A=p.route.loader&&!C.hasOwnProperty(p.route.id)&&(!w||w[p.route.id]===void 0);if(p.route.lazy||A){r.isStatic&&(m=!0),c>=0?l=l.slice(0,c+1):l=[l[0]];break}}}}let u=r?.onError,h=a&&u?(b,p)=>{u(b,{location:a.location,params:a.matches?.[0]?.params??{},pattern:S2(a.matches),errorInfo:p})}:void 0;return l.reduceRight((b,p,C)=>{let w,A=!1,x=null,g=null;a&&(w=v&&p.route.id?v[p.route.id]:void 0,x=p.route.errorElement||B2,m&&(c<0&&C===0?(gb("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),A=!0,g=null):c===C&&(A=!0,g=p.route.hydrateFallbackElement||null)));let y=i.concat(l.slice(0,C+1)),f=()=>{let _;return w?_=x:A?_=g:p.route.Component?_=q.createElement(p.route.Component,null):p.route.element?_=p.route.element:_=b,q.createElement(I2,{match:p,routeContext:{outlet:b,matches:y,isDataRoute:a!=null},children:_})};return a&&(p.route.ErrorBoundary||p.route.errorElement||C===0)?q.createElement(pb,{location:a.location,revalidation:a.revalidation,component:x,error:w,children:f(),routeContext:{outlet:null,matches:y,isDataRoute:!0},onError:h}):f()},null)}function Ap(t){return`${t} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function z2(t){let i=q.useContext(Va);return Ot(i,Ap(t)),i}function $2(t){let i=q.useContext(Ru);return Ot(i,Ap(t)),i}function H2(t){let i=q.useContext(tr);return Ot(i,Ap(t)),i}function kp(t){let i=H2(t),r=i.matches[i.matches.length-1];return Ot(r.route.id,`${t} can only be used on routes that contain a unique "id"`),r.route.id}function U2(){return kp("useRouteId")}function P2(){let t=q.useContext(Ep),i=$2("useRouteError"),r=kp("useRouteError");return t!==void 0?t:i.errors?.[r]}function F2(){let{router:t}=z2("useNavigate"),i=kp("useNavigate"),r=q.useRef(!1);return db(()=>{r.current=!0}),q.useCallback(async(l,v={})=>{Hn(r.current,hb),r.current&&(typeof l=="number"?await t.navigate(l):await t.navigate(l,{fromRouteId:i,...v}))},[t,i])}var l0={};function gb(t,i,r){!i&&!l0[t]&&(l0[t]=!0,Hn(!1,r))}q.memo(q2);function q2({routes:t,manifest:i,future:r,state:a,isStatic:l,onError:v}){return fb(t,void 0,{manifest:i,state:a,isStatic:l,onError:v})}function W2({to:t,replace:i,state:r,relative:a}){Ot(Xa(),"<Navigate> may be used only in the context of a <Router> component.");let{static:l}=q.useContext(dn);Hn(!l,"<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.");let{matches:v}=q.useContext(tr),{pathname:m}=Pn(),c=Tp(),u=ku(t,xp(v),m,a==="path"),h=JSON.stringify(u);return q.useEffect(()=>{c(JSON.parse(h),{replace:i,state:r,relative:a})},[c,h,a,i,r]),null}function ja(t){Ot(!1,"A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.")}function G2({basename:t="/",children:i=null,location:r,navigationType:a="POP",navigator:l,static:v=!1,useTransitions:m}){Ot(!Xa(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let c=t.replace(/^\/*/,"/"),u=q.useMemo(()=>({basename:c,navigator:l,static:v,useTransitions:m,future:{}}),[c,l,v,m]);typeof r=="string"&&(r=Ya(r));let{pathname:h="/",search:b="",hash:p="",state:C=null,key:w="default",mask:A}=r,x=q.useMemo(()=>{let g=Or(h,c);return g==null?null:{location:{pathname:g,search:b,hash:p,state:C,key:w,mask:A},navigationType:a}},[c,h,b,p,C,w,a,A]);return Hn(x!=null,`<Router basename="${c}"> is not able to match the URL "${h}${b}${p}" because it does not start with the basename, so the <Router> won't render anything.`),x==null?null:q.createElement(dn.Provider,{value:u},q.createElement(xl.Provider,{children:i,value:x}))}function K2({children:t,location:i}){return D2(Uf(t),i)}function Uf(t,i=[]){let r=[];return q.Children.forEach(t,(a,l)=>{if(!q.isValidElement(a))return;let v=[...i,l];if(a.type===q.Fragment){r.push.apply(r,Uf(a.props.children,v));return}Ot(a.type===ja,`[${typeof a.type=="string"?a.type:a.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),Ot(!a.props.index||!a.props.children,"An index route cannot have child routes.");let m={id:a.props.id||v.join("-"),caseSensitive:a.props.caseSensitive,element:a.props.element,Component:a.props.Component,index:a.props.index,path:a.props.path,middleware:a.props.middleware,loader:a.props.loader,action:a.props.action,hydrateFallbackElement:a.props.hydrateFallbackElement,HydrateFallback:a.props.HydrateFallback,errorElement:a.props.errorElement,ErrorBoundary:a.props.ErrorBoundary,hasErrorBoundary:a.props.hasErrorBoundary===!0||a.props.ErrorBoundary!=null||a.props.errorElement!=null,shouldRevalidate:a.props.shouldRevalidate,handle:a.props.handle,lazy:a.props.lazy};a.props.children&&(m.children=Uf(a.props.children,v)),r.push(m)}),r}var nu="get",ru="application/x-www-form-urlencoded";function Lu(t){return typeof HTMLElement<"u"&&t instanceof HTMLElement}function Y2(t){return Lu(t)&&t.tagName.toLowerCase()==="button"}function V2(t){return Lu(t)&&t.tagName.toLowerCase()==="form"}function X2(t){return Lu(t)&&t.tagName.toLowerCase()==="input"}function Z2(t){return!!(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)}function J2(t,i){return t.button===0&&(!i||i==="_self")&&!Z2(t)}var Pc=null;function Q2(){if(Pc===null)try{new FormData(document.createElement("form"),0),Pc=!1}catch{Pc=!0}return Pc}var ex=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Jd(t){return t!=null&&!ex.has(t)?(Hn(!1,`"${t}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${ru}"`),null):t}function tx(t,i){let r,a,l,v,m;if(V2(t)){let c=t.getAttribute("action");a=c?Or(c,i):null,r=t.getAttribute("method")||nu,l=Jd(t.getAttribute("enctype"))||ru,v=new FormData(t)}else if(Y2(t)||X2(t)&&(t.type==="submit"||t.type==="image")){let c=t.form;if(c==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let u=t.getAttribute("formaction")||c.getAttribute("action");if(a=u?Or(u,i):null,r=t.getAttribute("formmethod")||c.getAttribute("method")||nu,l=Jd(t.getAttribute("formenctype"))||Jd(c.getAttribute("enctype"))||ru,v=new FormData(c,t),!Q2()){let{name:h,type:b,value:p}=t;if(b==="image"){let C=h?`${h}.`:"";v.append(`${C}x`,"0"),v.append(`${C}y`,"0")}else h&&v.append(h,p)}}else{if(Lu(t))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');r=nu,a=null,l=ru,m=t}return v&&l==="text/plain"&&(m=v,v=void 0),{action:a,method:r.toLowerCase(),encType:l,formData:v,body:m}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function Rp(t,i){if(t===!1||t===null||typeof t>"u")throw new Error(i)}function mb(t,i,r,a){let l=typeof t=="string"?new URL(t,typeof window>"u"?"server://singlefetch/":window.location.origin):t;return r?l.pathname.endsWith("/")?l.pathname=`${l.pathname}_.${a}`:l.pathname=`${l.pathname}.${a}`:l.pathname==="/"?l.pathname=`_root.${a}`:i&&Or(l.pathname,i)==="/"?l.pathname=`${mu(i)}/_root.${a}`:l.pathname=`${mu(l.pathname)}.${a}`,l}async function ix(t,i){if(t.id in i)return i[t.id];try{let r=await import(t.module);return i[t.id]=r,r}catch(r){return console.error(`Error loading route module \`${t.module}\`, reloading page...`),console.error(r),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function nx(t){return t==null?!1:t.href==null?t.rel==="preload"&&typeof t.imageSrcSet=="string"&&typeof t.imageSizes=="string":typeof t.rel=="string"&&typeof t.href=="string"}async function rx(t,i,r){let a=await Promise.all(t.map(async l=>{let v=i.routes[l.route.id];if(v){let m=await ix(v,r);return m.links?m.links():[]}return[]}));return lx(a.flat(1).filter(nx).filter(l=>l.rel==="stylesheet"||l.rel==="preload").map(l=>l.rel==="stylesheet"?{...l,rel:"prefetch",as:"style"}:{...l,rel:"prefetch"}))}function c0(t,i,r,a,l,v){let m=(u,h)=>r[h]?u.route.id!==r[h].route.id:!0,c=(u,h)=>r[h].pathname!==u.pathname||r[h].route.path?.endsWith("*")&&r[h].params["*"]!==u.params["*"];return v==="assets"?i.filter((u,h)=>m(u,h)||c(u,h)):v==="data"?i.filter((u,h)=>{let b=a.routes[u.route.id];if(!b||!b.hasLoader)return!1;if(m(u,h)||c(u,h))return!0;if(u.route.shouldRevalidate){let p=u.route.shouldRevalidate({currentUrl:new URL(l.pathname+l.search+l.hash,window.origin),currentParams:r[0]?.params||{},nextUrl:new URL(t,window.origin),nextParams:u.params,defaultShouldRevalidate:!0});if(typeof p=="boolean")return p}return!0}):[]}function sx(t,i,{includeHydrateFallback:r}={}){return ax(t.map(a=>{let l=i.routes[a.route.id];if(!l)return[];let v=[l.module];return l.clientActionModule&&(v=v.concat(l.clientActionModule)),l.clientLoaderModule&&(v=v.concat(l.clientLoaderModule)),r&&l.hydrateFallbackModule&&(v=v.concat(l.hydrateFallbackModule)),l.imports&&(v=v.concat(l.imports)),v}).flat(1))}function ax(t){return[...new Set(t)]}function ox(t){let i={},r=Object.keys(t).sort();for(let a of r)i[a]=t[a];return i}function lx(t,i){let r=new Set;return new Set(i),t.reduce((a,l)=>{let v=JSON.stringify(ox(l));return r.has(v)||(r.add(v),a.push({key:v,link:l})),a},[])}function Lp(){let t=q.useContext(Va);return Rp(t,"You must render this element inside a <DataRouterContext.Provider> element"),t}function cx(){let t=q.useContext(Ru);return Rp(t,"You must render this element inside a <DataRouterStateContext.Provider> element"),t}var Mp=q.createContext(void 0);Mp.displayName="FrameworkContext";function Dp(){let t=q.useContext(Mp);return Rp(t,"You must render this element inside a <HydratedRouter> element"),t}function ux(t,i){let r=q.useContext(Mp),[a,l]=q.useState(!1),[v,m]=q.useState(!1),{onFocus:c,onBlur:u,onMouseEnter:h,onMouseLeave:b,onTouchStart:p}=i,C=q.useRef(null);q.useEffect(()=>{if(t==="render"&&m(!0),t==="viewport"){let x=y=>{y.forEach(f=>{m(f.isIntersecting)})},g=new IntersectionObserver(x,{threshold:.5});return C.current&&g.observe(C.current),()=>{g.disconnect()}}},[t]),q.useEffect(()=>{if(a){let x=setTimeout(()=>{m(!0)},100);return()=>{clearTimeout(x)}}},[a]);let w=()=>{l(!0)},A=()=>{l(!1),m(!1)};return r?t!=="intent"?[v,C,{}]:[v,C,{onFocus:Xo(c,w),onBlur:Xo(u,A),onMouseEnter:Xo(h,w),onMouseLeave:Xo(b,A),onTouchStart:Xo(p,w)}]:[!1,C,{}]}function Xo(t,i){return r=>{t&&t(r),r.defaultPrevented||i(r)}}function hx({page:t,...i}){let r=w2(),{router:a}=Lp(),l=q.useMemo(()=>tb(a.routes,t,a.basename),[a.routes,t,a.basename]);return l?r?q.createElement(fx,{page:t,matches:l,...i}):q.createElement(px,{page:t,matches:l,...i}):null}function dx(t){let{manifest:i,routeModules:r}=Dp(),[a,l]=q.useState([]);return q.useEffect(()=>{let v=!1;return rx(t,i,r).then(m=>{v||l(m)}),()=>{v=!0}},[t,i,r]),a}function fx({page:t,matches:i,...r}){let a=Pn(),{future:l}=Dp(),{basename:v}=Lp(),m=q.useMemo(()=>{if(t===a.pathname+a.search+a.hash)return[];let c=mb(t,v,l.v8_trailingSlashAwareDataRequests,"rsc"),u=!1,h=[];for(let b of i)typeof b.route.shouldRevalidate=="function"?u=!0:h.push(b.route.id);return u&&h.length>0&&c.searchParams.set("_routes",h.join(",")),[c.pathname+c.search]},[v,l.v8_trailingSlashAwareDataRequests,t,a,i]);return q.createElement(q.Fragment,null,m.map(c=>q.createElement("link",{key:c,rel:"prefetch",as:"fetch",href:c,...r})))}function px({page:t,matches:i,...r}){let a=Pn(),{future:l,manifest:v,routeModules:m}=Dp(),{basename:c}=Lp(),{loaderData:u,matches:h}=cx(),b=q.useMemo(()=>c0(t,i,h,v,a,"data"),[t,i,h,v,a]),p=q.useMemo(()=>c0(t,i,h,v,a,"assets"),[t,i,h,v,a]),C=q.useMemo(()=>{if(t===a.pathname+a.search+a.hash)return[];let x=new Set,g=!1;if(i.forEach(f=>{let _=v.routes[f.route.id];!_||!_.hasLoader||(!b.some(E=>E.route.id===f.route.id)&&f.route.id in u&&m[f.route.id]?.shouldRevalidate||_.hasClientLoader?g=!0:x.add(f.route.id))}),x.size===0)return[];let y=mb(t,c,l.v8_trailingSlashAwareDataRequests,"data");return g&&x.size>0&&y.searchParams.set("_routes",i.filter(f=>x.has(f.route.id)).map(f=>f.route.id).join(",")),[y.pathname+y.search]},[c,l.v8_trailingSlashAwareDataRequests,u,a,v,b,i,t,m]),w=q.useMemo(()=>sx(p,v),[p,v]),A=dx(p);return q.createElement(q.Fragment,null,C.map(x=>q.createElement("link",{key:x,rel:"prefetch",as:"fetch",href:x,...r})),w.map(x=>q.createElement("link",{key:x,rel:"modulepreload",href:x,...r})),A.map(({key:x,link:g})=>q.createElement("link",{key:x,nonce:r.nonce,...g,crossOrigin:g.crossOrigin??r.crossOrigin})))}function gx(...t){return i=>{t.forEach(r=>{typeof r=="function"?r(i):r!=null&&(r.current=i)})}}var mx=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{mx&&(window.__reactRouterVersion="7.17.0")}catch{}function _x({basename:t,children:i,useTransitions:r,window:a}){let l=q.useRef();l.current==null&&(l.current=Vw({window:a,v5Compat:!0}));let v=l.current,[m,c]=q.useState({action:v.action,location:v.location}),u=q.useCallback(h=>{r===!1?c(h):q.startTransition(()=>c(h))},[r]);return q.useLayoutEffect(()=>v.listen(u),[v,u]),q.createElement(G2,{basename:t,children:i,location:m.location,navigationType:m.action,navigator:v,useTransitions:r})}var _b=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Op=q.forwardRef(function({onClick:i,discover:r="render",prefetch:a="none",relative:l,reloadDocument:v,replace:m,mask:c,state:u,target:h,to:b,preventScrollReset:p,viewTransition:C,defaultShouldRevalidate:w,...A},x){let{basename:g,navigator:y,useTransitions:f}=q.useContext(dn),_=typeof b=="string"&&_b.test(b),E=ab(b,g);b=E.to;let L=L2(b,{relative:l}),R=Pn(),D=null;if(c){let te=ku(c,[],R.mask?R.mask.pathname:"/",!0);g!=="/"&&(te.pathname=te.pathname==="/"?g:$n([g,te.pathname])),D=y.createHref(te)}let[k,N,W]=ux(a,A),U=yx(b,{replace:m,mask:c,state:u,target:h,preventScrollReset:p,relative:l,viewTransition:C,defaultShouldRevalidate:w,useTransitions:f});function F(te){i&&i(te),te.defaultPrevented||U(te)}let j=!(E.isExternal||v),J=q.createElement("a",{...A,...W,href:(j?D:void 0)||E.absoluteURL||L,onClick:j?F:i,ref:gx(x,N),target:h,"data-discover":!_&&r==="render"?"true":void 0});return k&&!_?q.createElement(q.Fragment,null,J,q.createElement(hx,{page:L})):J});Op.displayName="Link";var Pf=q.forwardRef(function({"aria-current":i="page",caseSensitive:r=!1,className:a="",end:l=!1,style:v,to:m,viewTransition:c,children:u,...h},b){let p=El(m,{relative:h.relative}),C=Pn(),w=q.useContext(Ru),{navigator:A,basename:x}=q.useContext(dn),g=w!=null&&Ex(p)&&c===!0,y=A.encodeLocation?A.encodeLocation(p).pathname:p.pathname,f=C.pathname,_=w&&w.navigation&&w.navigation.location?w.navigation.location.pathname:null;r||(f=f.toLowerCase(),_=_?_.toLowerCase():null,y=y.toLowerCase()),_&&x&&(_=Or(_,x)||_);const E=y!=="/"&&y.endsWith("/")?y.length-1:y.length;let L=f===y||!l&&f.startsWith(y)&&f.charAt(E)==="/",R=_!=null&&(_===y||!l&&_.startsWith(y)&&_.charAt(y.length)==="/"),D={isActive:L,isPending:R,isTransitioning:g},k=L?i:void 0,N;typeof a=="function"?N=a(D):N=[a,L?"active":null,R?"pending":null,g?"transitioning":null].filter(Boolean).join(" ");let W=typeof v=="function"?v(D):v;return q.createElement(Op,{...h,"aria-current":k,className:N,ref:b,style:W,to:m,viewTransition:c},typeof u=="function"?u(D):u)});Pf.displayName="NavLink";var vx=q.forwardRef(({discover:t="render",fetcherKey:i,navigate:r,reloadDocument:a,replace:l,state:v,method:m=nu,action:c,onSubmit:u,relative:h,preventScrollReset:b,viewTransition:p,defaultShouldRevalidate:C,...w},A)=>{let{useTransitions:x}=q.useContext(dn),g=wx(),y=xx(c,{relative:h}),f=m.toLowerCase()==="get"?"get":"post",_=typeof c=="string"&&_b.test(c),E=L=>{if(u&&u(L),L.defaultPrevented)return;L.preventDefault();let R=L.nativeEvent.submitter,D=R?.getAttribute("formmethod")||m,k=()=>g(R||L.currentTarget,{fetcherKey:i,method:D,navigate:r,replace:l,state:v,relative:h,preventScrollReset:b,viewTransition:p,defaultShouldRevalidate:C});x&&r!==!1?q.startTransition(()=>k()):k()};return q.createElement("form",{ref:A,method:f,action:y,onSubmit:a?u:E,...w,"data-discover":!_&&t==="render"?"true":void 0})});vx.displayName="Form";function bx(t){return`${t} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function vb(t){let i=q.useContext(Va);return Ot(i,bx(t)),i}function yx(t,{target:i,replace:r,mask:a,state:l,preventScrollReset:v,relative:m,viewTransition:c,defaultShouldRevalidate:u,useTransitions:h}={}){let b=Tp(),p=Pn(),C=El(t,{relative:m});return q.useCallback(w=>{if(J2(w,i)){w.preventDefault();let A=r!==void 0?r:_l(p)===_l(C),x=()=>b(t,{replace:A,mask:a,state:l,preventScrollReset:v,relative:m,viewTransition:c,defaultShouldRevalidate:u});h?q.startTransition(()=>x()):x()}},[p,b,C,r,a,l,i,t,v,m,c,u,h])}var Sx=0,Cx=()=>`__${String(++Sx)}__`;function wx(){let{router:t}=vb("useSubmit"),{basename:i}=q.useContext(dn),r=U2(),a=t.fetch,l=t.navigate;return q.useCallback(async(v,m={})=>{let{action:c,method:u,encType:h,formData:b,body:p}=tx(v,i);if(m.navigate===!1){let C=m.fetcherKey||Cx();await a(C,r,m.action||c,{defaultShouldRevalidate:m.defaultShouldRevalidate,preventScrollReset:m.preventScrollReset,formData:b,body:p,formMethod:m.method||u,formEncType:m.encType||h,flushSync:m.flushSync})}else await l(m.action||c,{defaultShouldRevalidate:m.defaultShouldRevalidate,preventScrollReset:m.preventScrollReset,formData:b,body:p,formMethod:m.method||u,formEncType:m.encType||h,replace:m.replace,state:m.state,fromRouteId:r,flushSync:m.flushSync,viewTransition:m.viewTransition})},[a,l,i,r])}function xx(t,{relative:i}={}){let{basename:r}=q.useContext(dn),a=q.useContext(tr);Ot(a,"useFormAction must be used inside a RouteContext");let[l]=a.matches.slice(-1),v={...El(t||".",{relative:i})},m=Pn();if(t==null){v.search=m.search;let c=new URLSearchParams(v.search),u=c.getAll("index");if(u.some(b=>b==="")){c.delete("index"),u.filter(p=>p).forEach(p=>c.append("index",p));let b=c.toString();v.search=b?`?${b}`:""}}return(!t||t===".")&&l.route.index&&(v.search=v.search?v.search.replace(/^\?/,"?index&"):"?index"),r!=="/"&&(v.pathname=v.pathname==="/"?r:$n([r,v.pathname])),_l(v)}function Ex(t,{relative:i}={}){let r=q.useContext(cb);Ot(r!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:a}=vb("useViewTransitionState"),l=El(t,{relative:i});if(!r.isTransitioning)return!1;let v=Or(r.currentLocation.pathname,a)||r.currentLocation.pathname,m=Or(r.nextLocation.pathname,a)||r.nextLocation.pathname;return gu(l.pathname,m)!=null||gu(l.pathname,v)!=null}const Tx=["canonicalCwd","cwd","providerSession","ticket","token","transcriptPath"];class Bt extends Error{status;constructor(i,r){super(r),this.name="ApiError",this.status=i}}async function bb(t){const i=await fetch("/observer/tenants",{signal:t});await Ji(i);const r=await i.json();if(!Array.isArray(r.tenants))throw new Bt(i.status,"Invalid tenants response");return r.tenants.map(a=>jx(a,i.status))}async function Ax(t){const i=await fetch("/observer/jobs",{signal:t});return await Ji(i),(await i.json()).tenants}async function kx(t){const i=await fetch("/observer/events",{signal:t});if(await Ji(i),!i.body)throw new Bt(i.status,"Observer stream unavailable");return i.body.getReader()}async function Rx(t){const i=await fetch("/observer/theaters",{signal:t});await Ji(i);const r=await i.json();if(!Array.isArray(r.theaters))throw new Bt(i.status,"Invalid Theater response");const a=Array.isArray(r.agentClis)?r.agentClis.map(l=>Ix(l,i.status)):[];return{theaters:r.theaters.map(l=>wb(l,i.status)),agentClis:a}}async function yb(t,i){const r=t?`?theaterId=${encodeURIComponent(t)}`:"",a=await fetch(`/observer/status${r}`,{signal:i});return await Ji(a),zx(await a.json(),a.status)}async function Lx(t){const i=await fetch("/observer/carriers",{signal:t});await Ji(i);const r=await i.json();if(!Array.isArray(r.carriers))throw new Bt(i.status,"Invalid carrier readiness response");return r.carriers.map(a=>$x(a,i.status))}async function Mx(t){const i=await fetch("/observer/theaters",{method:"POST",signal:t});await Ji(i);const r=await i.json();return typeof r=="object"&&r!==null&&r.cancelled===!0?{cancelled:!0}:wb(r,i.status)}async function Bp(t,i,r){const a=await fetch(`/observer/theaters/${encodeURIComponent(t)}/sessions`,{method:"POST",...i?{headers:{"Content-Type":"application/json"},body:JSON.stringify({cliId:i})}:{},signal:r});return await Ji(a),Du(await a.json(),a.status)}async function Np(t,i){const r=await fetch(`/terminal/sessions/${encodeURIComponent(t)}`,{method:"DELETE",signal:i});await Ji(r)}async function Mu(t,i){const r=await fetch(`/terminal/sessions/${encodeURIComponent(t)}/resume`,{method:"POST",signal:i});return await Ji(r),Du(await r.json(),r.status)}async function Dx(t,i){const r=await fetch(`/observer/theaters/${encodeURIComponent(t)}`,{method:"DELETE",signal:i});await Ji(r)}async function Sb(t,i){const r=await fetch(`/terminal/sessions/${encodeURIComponent(t)}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({label:i})});return await Ji(r),Du(await r.json(),r.status)}async function Ox(t){const i=await fetch("/terminal/sessions",{signal:t});await Ji(i);const r=await i.json();if(!Array.isArray(r.sessions))throw new Bt(i.status,"Invalid terminal sessions response");return r.sessions.map(a=>Du(a,i.status))}async function Bx(t,i){const r=Nx(i),a=await fetch("/terminal/ticket",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({sessionId:t,...r.kind?{kind:r.kind}:{}}),signal:r.signal});await Ji(a);const l=await a.json();if(typeof l.ticket!="string"||typeof l.ttlMs!="number")throw new Bt(a.status,"Invalid terminal ticket response");return{ticket:l.ticket,ttlMs:l.ttlMs}}function Nx(t){return t?t instanceof AbortSignal?{signal:t}:t:{}}function Du(t,i){const r=t;if(!r||typeof r.sessionId!="string"||typeof r.cwdLabel!="string"||typeof r.sequence!="number"||typeof r.status!="string"||typeof r.createdAt!="number"||Cb(r))throw new Bt(i,"Invalid terminal session response");return{sessionId:r.sessionId,terminalSessionId:typeof r.terminalSessionId=="string"?r.terminalSessionId:r.sessionId,cwdLabel:r.cwdLabel,sequence:r.sequence,label:typeof r.label=="string"?r.label:void 0,cliId:typeof r.cliId=="string"?r.cliId:void 0,cliLabel:typeof r.cliLabel=="string"?r.cliLabel:void 0,status:r.status,createdAt:r.createdAt,theaterId:typeof r.theaterId=="string"?r.theaterId:void 0,tenantId:typeof r.tenantId=="string"?r.tenantId:void 0,registrationId:typeof r.registrationId=="string"?r.registrationId:void 0,resumeAvailable:r.resumeAvailable===!0}}function Ix(t,i){const r=t;if(!r||typeof r.id!="string"||typeof r.label!="string")throw new Bt(i,"Invalid Agent CLI metadata response");return{id:r.id,label:r.label}}function jx(t,i){const r=t;if(!r||typeof r.tenantId!="string"||typeof r.tenantLabel!="string"||typeof r.createdAt!="number"||typeof r.sessions!="number"||Cb(r))throw new Bt(i,"Invalid tenants response");return{tenantId:r.tenantId,tenantLabel:r.tenantLabel,createdAt:r.createdAt,sessions:r.sessions,status:r.status,cliRunId:typeof r.cliRunId=="string"?r.cliRunId:void 0,registrationId:typeof r.registrationId=="string"?r.registrationId:void 0,theaterId:typeof r.theaterId=="string"?r.theaterId:void 0,terminalSessionId:typeof r.terminalSessionId=="string"?r.terminalSessionId:void 0}}function Cb(t){return Tx.some(i=>i in t)}function zx(t,i){const r=t;if(!r||typeof r.workspaces!="number"||typeof r.jobs!="number"||typeof r.version!="string"||r.channel!=="stable"&&r.channel!=="local"&&r.channel!=="unknown"||typeof r.updateAvailable!="boolean"||r.latestVersion!==void 0&&typeof r.latestVersion!="string"||typeof r.port!="number"||r.wikiServerStatus!=="available"&&r.wikiServerStatus!=="unavailable"&&r.wikiServerStatus!=="unknown"||"token"in r||"path"in r||"cwd"in r||"knowledgeRoot"in r)throw new Bt(i,"Invalid observer status response");return{workspaces:r.workspaces,jobs:r.jobs,version:r.version,channel:r.channel,updateAvailable:r.updateAvailable,...r.latestVersion!==void 0?{latestVersion:r.latestVersion}:{},port:r.port,wikiServerStatus:r.wikiServerStatus}}function $x(t,i){const r=t;if(!r||typeof r.carrierId!="string"||typeof r.displayName!="string"||r.role!==null&&typeof r.role!="string"||typeof r.model!="string"||r.effort!==null&&typeof r.effort!="string"||typeof r.taskForceBackendCount!="number"||typeof r.subagentMode!="boolean"||r.category!==void 0&&r.category!=="strategy"&&r.category!=="planning"&&r.category!=="operations"||typeof r.slot!="number"||typeof r.cliType!="string"||"token"in r||"key"in r||"credential"in r||"cwd"in r||"path"in r||"persona"in r||"prompt"in r||"toolAllowlist"in r||"allowedExecutorTools"in r)throw new Bt(i,"Invalid carrier readiness response");return{carrierId:r.carrierId,displayName:r.displayName,role:r.role,model:r.model,effort:r.effort,taskForceBackendCount:r.taskForceBackendCount,subagentMode:r.subagentMode,...r.category?{category:r.category}:{},slot:r.slot,cliType:r.cliType}}function wb(t,i){const r=t;if(!r||typeof r.id!="string"||typeof r.label!="string"||"path"in r||typeof r.createdAt!="string"||typeof r.lastOpenedAt!="string"||typeof r.hasWiki!="boolean"||typeof r.activeAdmiralCount!="number")throw new Bt(i,"Invalid Theater response");return{id:r.id,label:r.label,createdAt:r.createdAt,lastOpenedAt:r.lastOpenedAt,hasWiki:r.hasWiki,activeAdmiralCount:r.activeAdmiralCount}}async function Ji(t){if(t.ok)return;let i=t.statusText;try{i=(await t.json()).error??i}catch{}throw new Bt(t.status,i||`HTTP ${t.status}`)}const Hx=[{title:"Console",entries:[{combos:[["Mod","K"]],description:"Search Operations across Theaters"},{combos:[["Mod","`"]],description:"Toggle the local shell"},{combos:[["Esc"]],description:"Close the open overlay or menu"}]},{title:"Operations",entries:[{combos:[["Esc"]],description:"Close the carrier job stream"},{combos:[["Shift","Enter"]],description:"Insert a newline in the terminal instead of submitting"},{combos:[["Enter"],["Esc"]],description:"Confirm or cancel a session rename"},{combos:[["↑"],["↓"]],description:"Move between Theater, Theme, and launch menu items"}]},{title:"Map",entries:[{combos:[["Drag"]],description:"Pan the operations map"},{combos:[["Shift","Drag"]],description:"Draw a new Operation terminal"},{combos:[["Space","Drag"]],description:"Pan even while a terminal has focus"},{combos:[["Scroll"]],description:"Zoom the map in or out"},{combos:[["Click"]],description:"Clear terminal focus on the empty canvas"}]},{title:"Codex",entries:[{combos:[["Mod","K"]],description:"Toggle the command palette"},{combos:[["↑"],["↓"]],description:"Move through command palette results"},{combos:[["Enter"]],description:"Open the selected result"},{combos:[["Tab"]],description:"Move focus within the command palette"},{combos:[["Esc"]],description:"Close the command palette or diagram lightbox"},{combos:[["+"],["−"],["0"]],description:"Zoom the diagram lightbox in / out / reset"},{combos:[["F"]],description:"Fit the diagram lightbox to the viewport"}]}],u0=120,Ux="active",Ff=new Set(["done","error","aborted"]);function Px(t,i){let r=Eb(t,i.jobId,i.updatedAt);for(const a of i.events)r=xb(r,a);return Ff.has(i.status)&&!Ff.has(r.status)&&(r={...r,status:i.status}),r}function xb(t,i){if(i.id<=t.lastEventId)return t;const r=i.event,a={...t,updatedAt:i.at,lastEventId:i.id,recentEvents:Wx(t.recentEvents,i)};switch(i.type){case"job:registered":return Fx(a,r);case"job:finalized":return{...a,status:li(r.status)??"done",finishedAt:us(r.finishedAt)??i.at,summary:li(r.summary),error:li(r.error)};case"track:begin":return Oa(a,r,l=>({...l,startedAt:us(r.startedAt)??i.at,requestPreview:li(r.requestPreview)}));case"track:status":return Oa(a,r,l=>({...l,status:li(r.status)??l.status}));case"track:text":return Oa(a,r,l=>({...l,status:"stream",text:l.text+(li(r.text)??""),sentTextLength:l.sentTextLength+(us(r.textLength)??li(r.text)?.length??0)}));case"track:thought":return Oa(a,r,l=>({...l,thought:l.thought+(li(r.text)??""),sentThoughtLength:l.sentThoughtLength+(us(r.textLength)??li(r.text)?.length??0)}));case"track:tool":return Oa(a,r,l=>({...l,status:"stream",tools:qx(l.tools,r)}));case"track:finalized":return Oa(a,r,l=>{const v=h0(l.text,l.sentTextLength,li(r.fallbackText),us(r.fallbackTextLength)),m=h0(l.thought,l.sentThoughtLength,li(r.fallbackThought),us(r.fallbackThoughtLength));return{...l,status:li(r.status)??"done",finishedAt:us(r.finishedAt)??i.at,error:li(r.error),text:v.text,sentTextLength:v.sentLength,thought:m.text,sentThoughtLength:m.sentLength}});default:return a}}function Eb(t,i,r){return{jobId:i,tenantId:t,status:Ux,updatedAt:r,trackOrder:[],tracks:{},lastEventId:0,recentEvents:[]}}function Zn(t){return Ff.has(t)}function Fx(t,i){const r=Array.isArray(i.tracks)?i.tracks:[];let a=t.trackOrder,l=t.tracks;for(const v of r){if(!v.trackId)continue;const m=l[v.trackId],c={...m??Tb(v.trackId),displayName:v.displayName??m?.displayName??v.trackId,displayCli:v.displayCli??m?.displayCli,model:v.model??m?.model,effort:v.effort??m?.effort,subtitle:v.subtitle??m?.subtitle,kind:v.kind??m?.kind,startedAt:v.startedAt??m?.startedAt};m||(a=[...a,v.trackId]),l={...l,[v.trackId]:c}}return{...t,label:li(i.label)??t.label,ownerCarrierId:li(i.ownerCarrierId)??t.ownerCarrierId,kind:li(i.kind)??t.kind,startedAt:us(i.startedAt)??t.startedAt,trackOrder:a,tracks:l}}function Oa(t,i,r){const a=li(i.trackId);if(!a)return t;const l=t.tracks[a],v=r(l??Tb(a));return{...t,trackOrder:l?t.trackOrder:[...t.trackOrder,a],tracks:{...t.tracks,[a]:v}}}function Tb(t){return{trackId:t,displayName:t,status:"queued",text:"",thought:"",sentTextLength:0,sentThoughtLength:0,tools:[]}}function h0(t,i,r,a){const l=a??r?.length??0;return r!==void 0&&l>t.length?{text:r,sentLength:Math.max(l,i)}:{text:t,sentLength:Math.max(i,l)}}function qx(t,i){const r=li(i.title)??"tool",a=li(i.status)??"",l=li(i.toolCallId),v=l??`${r}#${t.length}`;if(l){const m=t.findIndex(c=>c.key===l);if(m>=0){const c=[...t];return c[m]={key:l,title:r,status:a},c}}return[...t,{key:v,title:r,status:a}]}function Wx(t,i){const r=[...t,i];return r.length>u0?r.slice(-u0):r}function li(t){return typeof t=="string"?t:void 0}function us(t){return typeof t=="number"&&Number.isFinite(t)?t:void 0}function Ab(t){return new Date(t).toLocaleTimeString([],{hour12:!1})}function Tl(t){return t.label?.trim()||`#${t.sequence} Operation`}function Gx(t,i){const r=Math.max(0,Math.round((i-t)/1e3)),a=Math.floor(r/60),l=r%60;return a===0?`${l}s`:a<60?`${a}m ${String(l).padStart(2,"0")}s`:`${Math.floor(a/60)}h ${String(a%60).padStart(2,"0")}m`}function vl(t){return t.length<=14?t:`${t.slice(0,6)}…${t.slice(-6)}`}function Ip(t){return t&&t.charAt(0).toUpperCase()+t.slice(1)}function Ws(t){switch(t){case"active":return"running";case"done":return"done";case"error":return"error";case"aborted":return"aborted";default:return t}}function Kx(t){switch(t){case"queued":return"queued";case"conn":return"connecting";case"stream":return"streaming";case"done":return"done";case"err":return"error";case"aborted":return"aborted";default:return t}}function ms(t){switch(t){case"stream":case"active":case"conn":return"live";case"done":return"ok";case"err":case"error":return"bad";default:return"idle"}}function Yx(t){if(t.status!=="active")return null;const i=t.trackOrder.map(l=>t.tracks[l]).filter(l=>!!l),r=i.filter(l=>l.status==="stream"||l.status==="conn"),a=r.length>0?r:i;for(let l=a.length-1;l>=0;l--){const v=a[l],m=v?Vx(v):null;if(m)return m}return null}function Vx(t){return d0(t.text)??d0(t.thought)??t.tools[t.tools.length-1]?.title??null}function d0(t){if(!t)return null;const i=t.split(`
|
|
12
|
+
`);for(let r=i.length-1;r>=0;r--){const a=i[r]?.trim();if(a)return a}return null}const Xx="__unassigned__";function Zx(t){const i=new Map(t.theaters.map(a=>[a.id,a])),r=[];for(const a of t.sessionOrder){const l=t.sessions[a];l&&l.theaterId&&r.push(eE(l,i.get(l.theaterId)))}return r}function Jx(t,i){const r=kb(i);return r.length===0?t:t.filter(a=>{const l=tE(a);return r.every(v=>l.includes(v))})}function Qx(t){const i=[],r=new Map;for(const a of t){const l=a.theaterId??Xx,v=r.get(l);if(v!==void 0){const m=i[v];m&&(i[v]={...m,entries:[...m.entries,a]});continue}r.set(l,i.length),i.push({theaterId:a.theaterId,theaterLabel:a.theaterLabel,entries:[a]})}return i}function kb(t){return t.trim().toLocaleLowerCase().split(/\s+/).filter(Boolean)}function eE(t,i){return{sessionId:t.sessionId,theaterId:t.theaterId??null,theaterLabel:i?.label??t.theaterId??"",operationName:Tl(t),cliLabel:t.cliLabel,status:t.status}}function tE(t){return[t.operationName,t.theaterLabel,t.cliLabel??""].join(" ").toLocaleLowerCase()}const qf=200,Wf="fleet-console.activeTheaterId",Rb="fleet-console.activeTheme",Lb="fleet-console.terminalRenderer",Mb="fleet-console.expandedSessions",Qd="maritime",ef="webgl",f0="shell",Gf=new Set;let Ce={connection:"connecting",connectionError:null,activeTheme:$b(),terminalRenderer:aE(),updateAvailable:!1,latestVersion:null,tenants:[],theaters:[],agentClis:[],activeTheaterId:null,addingTheater:!1,theaterError:null,sessions:{},sessionOrder:[],activeTerminalSessionId:null,creatingTerminalSession:!1,terminalSessionError:null,tenantJobs:{},tenantOrder:[],timelineOpen:!1,shellOpen:!1,operationSearchOpen:!1,shortcutsOpen:!1,pendingOperationFocus:null,selectedJobId:null,expandedSessionIds:RE()};function p0(){return Ce}function iE(t){return Gf.add(t),()=>{Gf.delete(t)}}function Ke(t){Ce={...Ce,...t},Hb()}function nE(){Db($b())}function rE(t){LE(t),Db(t),Ke({activeTheme:t})}function sE(t){ME(t),Ke({terminalRenderer:t})}function aE(){if(typeof window>"u")return ef;try{const t=window.localStorage.getItem(Lb);return t==="webgl"||t==="dom"?t:ef}catch{return ef}}function oE(t){Ke({updateAvailable:t.updateAvailable,latestVersion:t.latestVersion??null})}function Db(t){if(!(typeof document>"u")){if(t==="maritime"){document.documentElement.removeAttribute("data-theme");return}document.documentElement.setAttribute("data-theme",t)}}function lE(t){const i={};for(const l of t)i[l.sessionId]=Up(l);const r=[...t].sort((l,v)=>v.createdAt-l.createdAt).map(l=>l.sessionId),a=jb(i,Ce.tenants);Ke({sessions:a,sessionOrder:r,activeTerminalSessionId:_s(Ce.activeTheaterId,a,r,Ce.activeTerminalSessionId)})}function cE(t){const i=zb(t.theaters,Ce.activeTheaterId);Ke({theaters:t.theaters,agentClis:t.agentClis,activeTheaterId:i,activeTerminalSessionId:_s(i,Ce.sessions,Ce.sessionOrder,Ce.activeTerminalSessionId),selectedJobId:null})}function uE(t){Iu(t),Ke({activeTheaterId:t,activeTerminalSessionId:_s(t,Ce.sessions,Ce.sessionOrder,null),selectedJobId:null})}function hE(){Ke({addingTheater:!0,theaterError:null})}function dE(t){const i=[t,...Ce.theaters.filter(r=>r.id!==t.id)];Iu(t.id),Ke({theaters:i,activeTheaterId:t.id,addingTheater:!1,theaterError:null,activeTerminalSessionId:_s(t.id,Ce.sessions,Ce.sessionOrder,null),selectedJobId:null})}function fE(){Ke({addingTheater:!1,theaterError:null})}function g0(t){Ke({addingTheater:!1,theaterError:t})}function Br(t){Ke({activeTerminalSessionId:t,selectedJobId:null})}function pE(t){const i=Ce.sessions[t];i&&(Iu(i.theaterId??null),Ke({activeTheaterId:i.theaterId??null,activeTerminalSessionId:t,selectedJobId:null,pendingOperationFocus:t}))}function tf(){Ce.pendingOperationFocus!==null&&Ke({pendingOperationFocus:null})}function nf(){Ke({operationSearchOpen:!1})}function gE(){Ke({operationSearchOpen:!Ce.operationSearchOpen})}function jp(){Ke({creatingTerminalSession:!0,terminalSessionError:null})}function zp(t){const i=Up(t);Ke({sessions:{...Ce.sessions,[i.sessionId]:i},sessionOrder:[i.sessionId,...Ce.sessionOrder.filter(r=>r!==i.sessionId)],activeTerminalSessionId:!Ce.activeTheaterId||_u(i,Ce.activeTheaterId)?i.sessionId:Ce.activeTerminalSessionId,creatingTerminalSession:!1,terminalSessionError:null,selectedJobId:null})}function Gs(t){const i=Ce.sessions[t.sessionId],r=Up({...i??{},...t}),a=!!i,l={...Ce.sessions,[r.sessionId]:r},v=a?Ce.sessionOrder:[r.sessionId,...Ce.sessionOrder.filter(m=>m!==r.sessionId)];Ke({sessions:l,sessionOrder:v,activeTerminalSessionId:_s(Ce.activeTheaterId,l,v,Ce.activeTerminalSessionId)})}function $p(t){Ke({creatingTerminalSession:!1,terminalSessionError:t})}function mE(){Ke({timelineOpen:!Ce.timelineOpen})}function Ob(){if(Ce.shellOpen){ol();return}Ke({shellOpen:!0})}function ol(){Ce.shellOpen&&Ke({shellOpen:!1})}function _E(){Ce.shortcutsOpen||Ke({shortcutsOpen:!0})}function rf(){Ce.shortcutsOpen&&Ke({shortcutsOpen:!1})}function vE(t){const i=Ce.expandedSessionIds.includes(t)?Ce.expandedSessionIds.filter(r=>r!==t):[...Ce.expandedSessionIds,t];Pp(i),Ke({expandedSessionIds:i})}function Hp(t){Ke({terminalSessionError:t})}function Ou(t){Ke({terminalSessionError:t})}function Bb(t){Ke({terminalSessionError:t})}function bE(t){const i=Ce.theaters.filter(m=>m.id!==t),r={},a=[];for(const m of Ce.sessionOrder){const c=Ce.sessions[m];!c||c.theaterId===t||(r[m]=c,a.push(m))}const l=zb(i,Ce.activeTheaterId===t?null:Ce.activeTheaterId),v=Ce.expandedSessionIds.filter(m=>r[m]);Iu(l),Pp(v),Ke({theaters:i,sessions:r,sessionOrder:a,activeTheaterId:l,activeTerminalSessionId:_s(l,r,a,Ce.activeTerminalSessionId),selectedJobId:null,expandedSessionIds:v})}function Al(t){if(!Ce.sessions[t])return;const i={...Ce.sessions};delete i[t];const r=Ce.sessionOrder.filter(v=>v!==t),a=Ce.expandedSessionIds.filter(v=>v!==t),l=Ce.activeTerminalSessionId===t;Pp(a),Ke({sessions:i,sessionOrder:r,activeTerminalSessionId:l?_s(Ce.activeTheaterId,i,r,null):Ce.activeTerminalSessionId,selectedJobId:l?null:Ce.selectedJobId,expandedSessionIds:a})}function Bu(t){Ke({selectedJobId:Ce.selectedJobId===t?null:t})}function sf(){Ke({selectedJobId:null})}function Nb(t){const i=new Set(t.map(l=>l.tenantId)),r=jb(Ce.sessions,t),a=[...t.map(l=>l.tenantId),...Ce.tenantOrder.filter(l=>!i.has(l)&&Ce.tenantJobs[l])];Ke({tenants:t,sessions:r,tenantOrder:a,activeTerminalSessionId:_s(Ce.activeTheaterId,r,Ce.sessionOrder,Ce.activeTerminalSessionId)})}function yE(t){const i={},r=[];for(const l of t){const v={};for(const c of l.jobs)v[c.jobId]=Px(l.tenantId,c);const m=Object.values(v).sort((c,u)=>(c.startedAt??c.updatedAt)-(u.startedAt??u.updatedAt)).map(c=>c.jobId);i[l.tenantId]={tenantId:l.tenantId,tenantLabel:l.tenantLabel,jobOrder:m,jobs:v,truncation:l.truncation},r.push(l.tenantId)}const a=[...Ce.tenantOrder.filter(l=>i[l]),...r.filter(l=>!Ce.tenantOrder.includes(l))];Ke({tenantJobs:i,tenantOrder:a.length>0?a:r})}function SE(t,i){const r=Ce.tenantJobs[t.tenantId],a=!r&&!Ce.tenants.some(c=>c.tenantId===t.tenantId),l=r??{tenantId:t.tenantId,tenantLabel:i,jobOrder:[],jobs:{},truncation:{droppedCount:0}};let v=i&&l.tenantLabel!==i?{...l,tenantLabel:i}:l;if(t.jobId){const c=v.jobs[t.jobId],u=xb(c??Eb(t.tenantId,t.jobId,t.at),t),h=c?v.jobOrder:[...v.jobOrder,t.jobId];v={...v,jobs:DE({...v.jobs,[t.jobId]:u},h),jobOrder:h.slice(-qf)}}const m={...Ce.tenantJobs,[t.tenantId]:v};return Ce={...Ce,connection:"live",connectionError:null,tenantJobs:m,tenantOrder:Ce.tenantOrder.includes(t.tenantId)?Ce.tenantOrder:[...Ce.tenantOrder,t.tenantId]},Hb(),{unknownTenant:a}}function CE(t,i,r){const a=Ce.tenantJobs[t]??{tenantId:t,tenantLabel:i,jobOrder:[],jobs:{},truncation:{droppedCount:0}};Ke({tenantJobs:{...Ce.tenantJobs,[t]:{...a,truncation:r}},tenantOrder:Ce.tenantOrder.includes(t)?Ce.tenantOrder:[...Ce.tenantOrder,t]})}function wE(t){if(!t.selectedJobId||t.activeTheaterId&&t.activeTerminalSessionId&&!Za(t).includes(t.activeTerminalSessionId))return null;const i=xE(t);return i?t.tenantJobs[i]?.jobs[t.selectedJobId]??null:null}function xE(t){return t.activeTerminalSessionId?Ib(t.sessions[t.activeTerminalSessionId]):null}function EE(t){return Za(t).map(i=>t.sessions[i]).filter(i=>!!i)}function Za(t){return t.activeTheaterId?t.sessionOrder.filter(i=>_u(t.sessions[i],t.activeTheaterId)):[]}function TE(t){return Zx(t)}function Nu(t,i){const r=Ib(i);if(!r)return[];const a=t.tenantJobs[r];if(!a)return[];const l=[];for(const v of a.jobOrder){const m=a.jobs[v];m&&l.push({job:m,tenant:a})}return l}function AE(t,i){return i?t.expandedSessionIds.includes(i):!1}function Ib(t){return t?.tenantId??t?.sessionId??null}function Up(t){return{...t,terminalSessionId:t.terminalSessionId??t.sessionId,status:t.status==="starting"&&t.tenantId?"registered":t.status,resumeAvailable:t.resumeAvailable===!0}}function jb(t,i){const r={...t};for(const a of i){if(!a.terminalSessionId)continue;const l=r[a.terminalSessionId];l&&(r[a.terminalSessionId]={...l,status:a.status==="closed"?"closed":a.status==="dormant"?"dormant":"registered",tenantId:a.tenantId,registrationId:a.registrationId,theaterId:a.theaterId??l.theaterId})}return r}function zb(t,i){const r=new Set(t.map(l=>l.id)),a=kE();return a&&r.has(a)?a:i&&r.has(i)?i:t[0]?.id??null}function _s(t,i,r,a){return t?a&&_u(i[a],t)&&Fc(i[a])?a:r.find(l=>_u(i[l],t)&&Fc(i[l]))??null:a&&i[a]&&Fc(i[a])?a:r.find(l=>Fc(i[l]))??null}function _u(t,i){return!t||!i?!1:t.theaterId===i}function Fc(t){return!!(t&&t.status!=="dormant")}function kE(){if(typeof window>"u")return null;try{return window.localStorage.getItem(Wf)}catch{return null}}function Iu(t){if(!(typeof window>"u"))try{t?window.localStorage.setItem(Wf,t):window.localStorage.removeItem(Wf)}catch{}}function $b(){if(typeof window>"u")return Qd;try{const t=window.localStorage.getItem(Rb);return t==="maritime"||t==="carbon"?t:Qd}catch{return Qd}}function RE(){if(typeof window>"u")return[];try{const t=window.localStorage.getItem(Mb);if(!t)return[];const i=JSON.parse(t);return Array.isArray(i)?i.filter(r=>typeof r=="string"):[]}catch{return[]}}function LE(t){if(!(typeof window>"u"))try{window.localStorage.setItem(Rb,t)}catch{}}function ME(t){if(!(typeof window>"u"))try{window.localStorage.setItem(Lb,t)}catch{}}function Pp(t){if(!(typeof window>"u"))try{window.localStorage.setItem(Mb,JSON.stringify(t))}catch{}}function DE(t,i){if(i.length<=qf)return t;const r=new Set(i.slice(-qf)),a={};for(const l of Object.keys(t))r.has(l)&&(a[l]=t[l]);return a}function Hb(){for(const t of Gf)t()}const OE=/mac|iphone|ipad|ipod/i,BE=["a[href]","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])","[tabindex]:not([tabindex='-1'])"].join(",");function NE({state:t}){const i=q.useRef(null),r=q.useRef(null),a=q.useRef(null);if(t.shortcutsOpen&&i.current===null&&(i.current=document.activeElement),q.useEffect(()=>{if(!t.shortcutsOpen)return;const v=m=>{m.key==="Escape"?(rf(),m.preventDefault()):m.key==="Tab"&&jE(m,a.current),m.stopImmediatePropagation()};return r.current?.focus(),window.addEventListener("keydown",v,!0),()=>{window.removeEventListener("keydown",v,!0);const m=i.current;i.current=null,m?.focus?.()}},[t.shortcutsOpen]),!t.shortcutsOpen)return null;const l=IE();return T.jsxs("div",{className:"shortcuts-overlay",role:"dialog","aria-modal":"true","aria-label":"Keyboard shortcuts",children:[T.jsx("button",{type:"button",className:"shortcuts-overlay-scrim",onClick:rf,"aria-label":"Close keyboard shortcuts"}),T.jsxs("section",{className:"shortcuts-overlay-card",ref:a,children:[T.jsxs("header",{className:"shortcuts-overlay-header",children:[T.jsx("span",{className:"shortcuts-overlay-kicker",children:"Reference Map"}),T.jsx("h2",{children:"Keyboard Shortcuts"})]}),T.jsx("button",{ref:r,type:"button",className:"shortcuts-overlay-close",onClick:rf,"aria-label":"Close keyboard shortcuts",children:"×"}),T.jsx("div",{className:"shortcuts-overlay-groups",children:Hx.map(v=>T.jsxs("section",{className:"shortcuts-group","aria-labelledby":`shortcuts-${v.title.toLowerCase()}`,children:[T.jsx("h3",{id:`shortcuts-${v.title.toLowerCase()}`,children:v.title}),T.jsx("dl",{className:"shortcuts-list",children:v.entries.map(m=>T.jsxs("div",{className:"shortcuts-entry",children:[T.jsx("dt",{className:"shortcuts-combos",children:m.combos.map((c,u)=>T.jsxs("span",{className:"shortcuts-combo",children:[u>0?T.jsx("span",{className:"shortcuts-combo-separator",children:"or"}):null,T.jsx("span",{className:"shortcuts-keyset",children:c.map(h=>T.jsx("kbd",{children:h==="Mod"?l:h},h))})]},`${m.description}:${c.join("+")}`))}),T.jsx("dd",{children:m.description})]},`${v.title}:${m.description}`))})]},v.title))})]})]})}function IE(){const i=navigator.userAgentData?.platform??navigator.platform;return OE.test(i)?"⌘":"Ctrl"}function jE(t,i){if(!i)return;const r=Array.from(i.querySelectorAll(BE)),a=r[0],l=r[r.length-1];!a||!l||(t.shiftKey&&document.activeElement===a?(t.preventDefault(),l.focus()):!t.shiftKey&&document.activeElement===l&&(t.preventDefault(),a.focus()))}var af={exports:{}},m0;function zE(){return m0||(m0=1,(function(t,i){(function(r,a){t.exports=a()})(self,(()=>(()=>{var r={};return(()=>{var a=r;Object.defineProperty(a,"__esModule",{value:!0}),a.FitAddon=void 0,a.FitAddon=class{activate(l){this._terminal=l}dispose(){}fit(){const l=this.proposeDimensions();if(!l||!this._terminal||isNaN(l.cols)||isNaN(l.rows))return;const v=this._terminal._core;this._terminal.rows===l.rows&&this._terminal.cols===l.cols||(v._renderService.clear(),this._terminal.resize(l.cols,l.rows))}proposeDimensions(){if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;const l=this._terminal._core,v=l._renderService.dimensions;if(v.css.cell.width===0||v.css.cell.height===0)return;const m=this._terminal.options.scrollback===0?0:l.viewport.scrollBarWidth,c=window.getComputedStyle(this._terminal.element.parentElement),u=parseInt(c.getPropertyValue("height")),h=Math.max(0,parseInt(c.getPropertyValue("width"))),b=window.getComputedStyle(this._terminal.element),p=u-(parseInt(b.getPropertyValue("padding-top"))+parseInt(b.getPropertyValue("padding-bottom"))),C=h-(parseInt(b.getPropertyValue("padding-right"))+parseInt(b.getPropertyValue("padding-left")))-m;return{cols:Math.max(2,Math.floor(C/v.css.cell.width)),rows:Math.max(1,Math.floor(p/v.css.cell.height))}}}})(),r})()))})(af)),af.exports}var $E=zE(),su={exports:{}},HE=su.exports,_0;function UE(){return _0||(_0=1,(function(t,i){(function(r,a){t.exports=a()})(HE,(()=>(()=>{var r={433:(m,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.UnicodeV11=void 0;const h=u(938),b=[[768,879],[1155,1161],[1425,1469],[1471,1471],[1473,1474],[1476,1477],[1479,1479],[1536,1541],[1552,1562],[1564,1564],[1611,1631],[1648,1648],[1750,1757],[1759,1764],[1767,1768],[1770,1773],[1807,1807],[1809,1809],[1840,1866],[1958,1968],[2027,2035],[2045,2045],[2070,2073],[2075,2083],[2085,2087],[2089,2093],[2137,2139],[2259,2306],[2362,2362],[2364,2364],[2369,2376],[2381,2381],[2385,2391],[2402,2403],[2433,2433],[2492,2492],[2497,2500],[2509,2509],[2530,2531],[2558,2558],[2561,2562],[2620,2620],[2625,2626],[2631,2632],[2635,2637],[2641,2641],[2672,2673],[2677,2677],[2689,2690],[2748,2748],[2753,2757],[2759,2760],[2765,2765],[2786,2787],[2810,2815],[2817,2817],[2876,2876],[2879,2879],[2881,2884],[2893,2893],[2902,2902],[2914,2915],[2946,2946],[3008,3008],[3021,3021],[3072,3072],[3076,3076],[3134,3136],[3142,3144],[3146,3149],[3157,3158],[3170,3171],[3201,3201],[3260,3260],[3263,3263],[3270,3270],[3276,3277],[3298,3299],[3328,3329],[3387,3388],[3393,3396],[3405,3405],[3426,3427],[3530,3530],[3538,3540],[3542,3542],[3633,3633],[3636,3642],[3655,3662],[3761,3761],[3764,3772],[3784,3789],[3864,3865],[3893,3893],[3895,3895],[3897,3897],[3953,3966],[3968,3972],[3974,3975],[3981,3991],[3993,4028],[4038,4038],[4141,4144],[4146,4151],[4153,4154],[4157,4158],[4184,4185],[4190,4192],[4209,4212],[4226,4226],[4229,4230],[4237,4237],[4253,4253],[4448,4607],[4957,4959],[5906,5908],[5938,5940],[5970,5971],[6002,6003],[6068,6069],[6071,6077],[6086,6086],[6089,6099],[6109,6109],[6155,6158],[6277,6278],[6313,6313],[6432,6434],[6439,6440],[6450,6450],[6457,6459],[6679,6680],[6683,6683],[6742,6742],[6744,6750],[6752,6752],[6754,6754],[6757,6764],[6771,6780],[6783,6783],[6832,6846],[6912,6915],[6964,6964],[6966,6970],[6972,6972],[6978,6978],[7019,7027],[7040,7041],[7074,7077],[7080,7081],[7083,7085],[7142,7142],[7144,7145],[7149,7149],[7151,7153],[7212,7219],[7222,7223],[7376,7378],[7380,7392],[7394,7400],[7405,7405],[7412,7412],[7416,7417],[7616,7673],[7675,7679],[8203,8207],[8234,8238],[8288,8292],[8294,8303],[8400,8432],[11503,11505],[11647,11647],[11744,11775],[12330,12333],[12441,12442],[42607,42610],[42612,42621],[42654,42655],[42736,42737],[43010,43010],[43014,43014],[43019,43019],[43045,43046],[43204,43205],[43232,43249],[43263,43263],[43302,43309],[43335,43345],[43392,43394],[43443,43443],[43446,43449],[43452,43453],[43493,43493],[43561,43566],[43569,43570],[43573,43574],[43587,43587],[43596,43596],[43644,43644],[43696,43696],[43698,43700],[43703,43704],[43710,43711],[43713,43713],[43756,43757],[43766,43766],[44005,44005],[44008,44008],[44013,44013],[64286,64286],[65024,65039],[65056,65071],[65279,65279],[65529,65531]],p=[[66045,66045],[66272,66272],[66422,66426],[68097,68099],[68101,68102],[68108,68111],[68152,68154],[68159,68159],[68325,68326],[68900,68903],[69446,69456],[69633,69633],[69688,69702],[69759,69761],[69811,69814],[69817,69818],[69821,69821],[69837,69837],[69888,69890],[69927,69931],[69933,69940],[70003,70003],[70016,70017],[70070,70078],[70089,70092],[70191,70193],[70196,70196],[70198,70199],[70206,70206],[70367,70367],[70371,70378],[70400,70401],[70459,70460],[70464,70464],[70502,70508],[70512,70516],[70712,70719],[70722,70724],[70726,70726],[70750,70750],[70835,70840],[70842,70842],[70847,70848],[70850,70851],[71090,71093],[71100,71101],[71103,71104],[71132,71133],[71219,71226],[71229,71229],[71231,71232],[71339,71339],[71341,71341],[71344,71349],[71351,71351],[71453,71455],[71458,71461],[71463,71467],[71727,71735],[71737,71738],[72148,72151],[72154,72155],[72160,72160],[72193,72202],[72243,72248],[72251,72254],[72263,72263],[72273,72278],[72281,72283],[72330,72342],[72344,72345],[72752,72758],[72760,72765],[72767,72767],[72850,72871],[72874,72880],[72882,72883],[72885,72886],[73009,73014],[73018,73018],[73020,73021],[73023,73029],[73031,73031],[73104,73105],[73109,73109],[73111,73111],[73459,73460],[78896,78904],[92912,92916],[92976,92982],[94031,94031],[94095,94098],[113821,113822],[113824,113827],[119143,119145],[119155,119170],[119173,119179],[119210,119213],[119362,119364],[121344,121398],[121403,121452],[121461,121461],[121476,121476],[121499,121503],[121505,121519],[122880,122886],[122888,122904],[122907,122913],[122915,122916],[122918,122922],[123184,123190],[123628,123631],[125136,125142],[125252,125258],[917505,917505],[917536,917631],[917760,917999]],C=[[4352,4447],[8986,8987],[9001,9002],[9193,9196],[9200,9200],[9203,9203],[9725,9726],[9748,9749],[9800,9811],[9855,9855],[9875,9875],[9889,9889],[9898,9899],[9917,9918],[9924,9925],[9934,9934],[9940,9940],[9962,9962],[9970,9971],[9973,9973],[9978,9978],[9981,9981],[9989,9989],[9994,9995],[10024,10024],[10060,10060],[10062,10062],[10067,10069],[10071,10071],[10133,10135],[10160,10160],[10175,10175],[11035,11036],[11088,11088],[11093,11093],[11904,11929],[11931,12019],[12032,12245],[12272,12283],[12288,12329],[12334,12350],[12353,12438],[12443,12543],[12549,12591],[12593,12686],[12688,12730],[12736,12771],[12784,12830],[12832,12871],[12880,19903],[19968,42124],[42128,42182],[43360,43388],[44032,55203],[63744,64255],[65040,65049],[65072,65106],[65108,65126],[65128,65131],[65281,65376],[65504,65510]],w=[[94176,94179],[94208,100343],[100352,101106],[110592,110878],[110928,110930],[110948,110951],[110960,111355],[126980,126980],[127183,127183],[127374,127374],[127377,127386],[127488,127490],[127504,127547],[127552,127560],[127568,127569],[127584,127589],[127744,127776],[127789,127797],[127799,127868],[127870,127891],[127904,127946],[127951,127955],[127968,127984],[127988,127988],[127992,128062],[128064,128064],[128066,128252],[128255,128317],[128331,128334],[128336,128359],[128378,128378],[128405,128406],[128420,128420],[128507,128591],[128640,128709],[128716,128716],[128720,128722],[128725,128725],[128747,128748],[128756,128762],[128992,129003],[129293,129393],[129395,129398],[129402,129442],[129445,129450],[129454,129482],[129485,129535],[129648,129651],[129656,129658],[129664,129666],[129680,129685],[131072,196605],[196608,262141]];let A;function x(g,y){let f,_=0,E=y.length-1;if(g<y[0][0]||g>y[E][1])return!1;for(;E>=_;)if(f=_+E>>1,g>y[f][1])_=f+1;else{if(!(g<y[f][0]))return!0;E=f-1}return!1}c.UnicodeV11=class{constructor(){if(this.version="11",!A){A=new Uint8Array(65536),A.fill(1),A[0]=0,A.fill(0,1,32),A.fill(0,127,160);for(let g=0;g<b.length;++g)A.fill(0,b[g][0],b[g][1]+1);for(let g=0;g<C.length;++g)A.fill(2,C[g][0],C[g][1]+1)}}wcwidth(g){return g<32?0:g<127?1:g<65536?A[g]:x(g,p)?0:x(g,w)?2:1}charProperties(g,y){let f=this.wcwidth(g),_=f===0&&y!==0;if(_){const E=h.UnicodeService.extractWidth(y);E===0?_=!1:E>f&&(f=E)}return h.UnicodeService.createPropertyValue(0,f,_)}}},345:(m,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.runAndSubscribe=c.forwardEvent=c.EventEmitter=void 0,c.EventEmitter=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||(this._event=u=>(this._listeners.push(u),{dispose:()=>{if(!this._disposed){for(let h=0;h<this._listeners.length;h++)if(this._listeners[h]===u)return void this._listeners.splice(h,1)}}})),this._event}fire(u,h){const b=[];for(let p=0;p<this._listeners.length;p++)b.push(this._listeners[p]);for(let p=0;p<b.length;p++)b[p].call(void 0,u,h)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},c.forwardEvent=function(u,h){return u((b=>h.fire(b)))},c.runAndSubscribe=function(u,h){return h(void 0),u((b=>h(b)))}},490:(m,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.UnicodeV6=void 0;const h=u(938),b=[[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]],p=[[68097,68099],[68101,68102],[68108,68111],[68152,68154],[68159,68159],[119143,119145],[119155,119170],[119173,119179],[119210,119213],[119362,119364],[917505,917505],[917536,917631],[917760,917999]];let C;c.UnicodeV6=class{constructor(){if(this.version="6",!C){C=new Uint8Array(65536),C.fill(1),C[0]=0,C.fill(0,1,32),C.fill(0,127,160),C.fill(2,4352,4448),C[9001]=2,C[9002]=2,C.fill(2,11904,42192),C[12351]=1,C.fill(2,44032,55204),C.fill(2,63744,64256),C.fill(2,65040,65050),C.fill(2,65072,65136),C.fill(2,65280,65377),C.fill(2,65504,65511);for(let w=0;w<b.length;++w)C.fill(0,b[w][0],b[w][1]+1)}}wcwidth(w){return w<32?0:w<127?1:w<65536?C[w]:(function(A,x){let g,y=0,f=x.length-1;if(A<x[0][0]||A>x[f][1])return!1;for(;f>=y;)if(g=y+f>>1,A>x[g][1])y=g+1;else{if(!(A<x[g][0]))return!0;f=g-1}return!1})(w,p)?0:w>=131072&&w<=196605||w>=196608&&w<=262141?2:1}charProperties(w,A){let x=this.wcwidth(w),g=x===0&&A!==0;if(g){const y=h.UnicodeService.extractWidth(A);y===0?g=!1:y>x&&(x=y)}return h.UnicodeService.createPropertyValue(0,x,g)}}},938:(m,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.UnicodeService=void 0;const h=u(345),b=u(490);class p{static extractShouldJoin(w){return(1&w)!=0}static extractWidth(w){return w>>1&3}static extractCharKind(w){return w>>3}static createPropertyValue(w,A,x=!1){return(16777215&w)<<3|(3&A)<<1|(x?1:0)}constructor(){this._providers=Object.create(null),this._active="",this._onChange=new h.EventEmitter,this.onChange=this._onChange.event;const w=new b.UnicodeV6;this.register(w),this._active=w.version,this._activeProvider=w}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(w){if(!this._providers[w])throw new Error(`unknown Unicode version "${w}"`);this._active=w,this._activeProvider=this._providers[w],this._onChange.fire(w)}register(w){this._providers[w.version]=w}wcwidth(w){return this._activeProvider.wcwidth(w)}getStringCellWidth(w){let A=0,x=0;const g=w.length;for(let y=0;y<g;++y){let f=w.charCodeAt(y);if(55296<=f&&f<=56319){if(++y>=g)return A+this.wcwidth(f);const L=w.charCodeAt(y);56320<=L&&L<=57343?f=1024*(f-55296)+L-56320+65536:A+=this.wcwidth(L)}const _=this.charProperties(f,x);let E=p.extractWidth(_);p.extractShouldJoin(_)&&(E-=p.extractWidth(x)),A+=E,x=_}return A}charProperties(w,A){return this._activeProvider.charProperties(w,A)}}c.UnicodeService=p}},a={};function l(m){var c=a[m];if(c!==void 0)return c.exports;var u=a[m]={exports:{}};return r[m](u,u.exports,l),u.exports}var v={};return(()=>{var m=v;Object.defineProperty(m,"__esModule",{value:!0}),m.Unicode11Addon=void 0;const c=l(433);m.Unicode11Addon=class{activate(u){u.unicode.register(new c.UnicodeV11)}dispose(){}}})(),v})()))})(su)),su.exports}var PE=UE();var FE=(t,i,r,a)=>{for(var l=i,v=t.length-1,m;v>=0;v--)(m=t[v])&&(l=m(l)||l);return l},qE=(t,i)=>(r,a)=>i(r,a,t),WE=class{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(t){setTimeout(()=>{throw t.stack?v0.isErrorNoTelemetry(t)?new v0(t.message+`
|
|
13
|
+
|
|
14
|
+
`+t.stack):new Error(t.message+`
|
|
15
|
+
|
|
16
|
+
`+t.stack):t},0)}}addListener(t){return this.listeners.push(t),()=>{this._removeListener(t)}}emit(t){this.listeners.forEach(i=>{i(t)})}_removeListener(t){this.listeners.splice(this.listeners.indexOf(t),1)}setUnexpectedErrorHandler(t){this.unexpectedErrorHandler=t}getUnexpectedErrorHandler(){return this.unexpectedErrorHandler}onUnexpectedError(t){this.unexpectedErrorHandler(t),this.emit(t)}onUnexpectedExternalError(t){this.unexpectedErrorHandler(t)}},GE=new WE;function of(t){KE(t)||GE.onUnexpectedError(t)}var Kf="Canceled";function KE(t){return t instanceof YE?!0:t instanceof Error&&t.name===Kf&&t.message===Kf}var YE=class extends Error{constructor(){super(Kf),this.name=this.message}},v0=class Yf extends Error{constructor(i){super(i),this.name="CodeExpectedError"}static fromError(i){if(i instanceof Yf)return i;let r=new Yf;return r.message=i.message,r.stack=i.stack,r}static isErrorNoTelemetry(i){return i.name==="CodeExpectedError"}},VE;(t=>{function i(v){return v<0}t.isLessThan=i;function r(v){return v<=0}t.isLessThanOrEqual=r;function a(v){return v>0}t.isGreaterThan=a;function l(v){return v===0}t.isNeitherLessOrGreaterThan=l,t.greaterThan=1,t.lessThan=-1,t.neitherLessOrGreaterThan=0})(VE||={});function XE(t,i){let r=this,a=!1,l;return function(){return a||(a=!0,i||(l=t.apply(r,arguments))),l}}var Ub;(t=>{function i(E){return E&&typeof E=="object"&&typeof E[Symbol.iterator]=="function"}t.is=i;let r=Object.freeze([]);function a(){return r}t.empty=a;function*l(E){yield E}t.single=l;function v(E){return i(E)?E:l(E)}t.wrap=v;function m(E){return E||r}t.from=m;function*c(E){for(let L=E.length-1;L>=0;L--)yield E[L]}t.reverse=c;function u(E){return!E||E[Symbol.iterator]().next().done===!0}t.isEmpty=u;function h(E){return E[Symbol.iterator]().next().value}t.first=h;function b(E,L){let R=0;for(let D of E)if(L(D,R++))return!0;return!1}t.some=b;function p(E,L){for(let R of E)if(L(R))return R}t.find=p;function*C(E,L){for(let R of E)L(R)&&(yield R)}t.filter=C;function*w(E,L){let R=0;for(let D of E)yield L(D,R++)}t.map=w;function*A(E,L){let R=0;for(let D of E)yield*L(D,R++)}t.flatMap=A;function*x(...E){for(let L of E)yield*L}t.concat=x;function g(E,L,R){let D=R;for(let k of E)D=L(D,k);return D}t.reduce=g;function*y(E,L,R=E.length){for(L<0&&(L+=E.length),R<0?R+=E.length:R>E.length&&(R=E.length);L<R;L++)yield E[L]}t.slice=y;function f(E,L=Number.POSITIVE_INFINITY){let R=[];if(L===0)return[R,E];let D=E[Symbol.iterator]();for(let k=0;k<L;k++){let N=D.next();if(N.done)return[R,t.empty()];R.push(N.value)}return[R,{[Symbol.iterator](){return D}}]}t.consume=f;async function _(E){let L=[];for await(let R of E)L.push(R);return Promise.resolve(L)}t.asyncToArray=_})(Ub||={});function Pb(t){if(Ub.is(t)){let i=[];for(let r of t)if(r)try{r.dispose()}catch(a){i.push(a)}if(i.length===1)throw i[0];if(i.length>1)throw new AggregateError(i,"Encountered errors while disposing of store");return Array.isArray(t)?[]:t}else if(t)return t.dispose(),t}function Fb(...t){return Mi(()=>Pb(t))}function Mi(t){return{dispose:XE(()=>{t()})}}var qb=class Wb{constructor(){this._toDispose=new Set,this._isDisposed=!1}dispose(){this._isDisposed||(this._isDisposed=!0,this.clear())}get isDisposed(){return this._isDisposed}clear(){if(this._toDispose.size!==0)try{Pb(this._toDispose)}finally{this._toDispose.clear()}}add(i){if(!i)return i;if(i===this)throw new Error("Cannot register a disposable on itself!");return this._isDisposed?Wb.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(i),i}delete(i){if(i){if(i===this)throw new Error("Cannot dispose a disposable on itself!");this._toDispose.delete(i),i.dispose()}}deleteAndLeak(i){i&&this._toDispose.has(i)&&(this._toDispose.delete(i),void 0)}};qb.DISABLE_DISPOSED_WARNING=!1;var Wa=qb,Un=class{constructor(){this._store=new Wa,this._store}dispose(){this._store.dispose()}_register(i){if(i===this)throw new Error("Cannot register a disposable on itself!");return this._store.add(i)}};Un.None=Object.freeze({dispose(){}});var Zo=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(i){this._isDisposed||i===this._value||(this._value?.dispose(),this._value=i)}clear(){this.value=void 0}dispose(){this._isDisposed=!0,this._value?.dispose(),this._value=void 0}clearAndLeak(){let i=this._value;return this._value=void 0,i}},Fp=typeof process<"u"&&"title"in process,ju=Fp?"node":navigator.userAgent,ZE=Fp?"node":navigator.platform,JE=ju.includes("Firefox"),QE=ju.includes("Edge"),Gb=/^((?!chrome|android).)*safari/i.test(ju);function e5(){if(!Gb)return 0;let t=ju.match(/Version\/(\d+)/);return t===null||t.length<2?0:parseInt(t[1])}ZE.indexOf("Linux")>=0;var t5="",pi=0,gi=0,mi=0,Gt=0,xn={css:"#00000000",rgba:0},Ni;(t=>{function i(l,v,m,c){return c!==void 0?`#${js(l)}${js(v)}${js(m)}${js(c)}`:`#${js(l)}${js(v)}${js(m)}`}t.toCss=i;function r(l,v,m,c=255){return(l<<24|v<<16|m<<8|c)>>>0}t.toRgba=r;function a(l,v,m,c){return{css:t.toCss(l,v,m,c),rgba:t.toRgba(l,v,m,c)}}t.toColor=a})(Ni||={});var ll;(t=>{function i(u,h){if(Gt=(h.rgba&255)/255,Gt===1)return{css:h.css,rgba:h.rgba};let b=h.rgba>>24&255,p=h.rgba>>16&255,C=h.rgba>>8&255,w=u.rgba>>24&255,A=u.rgba>>16&255,x=u.rgba>>8&255;pi=w+Math.round((b-w)*Gt),gi=A+Math.round((p-A)*Gt),mi=x+Math.round((C-x)*Gt);let g=Ni.toCss(pi,gi,mi),y=Ni.toRgba(pi,gi,mi);return{css:g,rgba:y}}t.blend=i;function r(u){return(u.rgba&255)===255}t.isOpaque=r;function a(u,h,b){let p=Ps.ensureContrastRatio(u.rgba,h.rgba,b);if(p)return Ni.toColor(p>>24&255,p>>16&255,p>>8&255)}t.ensureContrastRatio=a;function l(u){let h=(u.rgba|255)>>>0;return[pi,gi,mi]=Ps.toChannels(h),{css:Ni.toCss(pi,gi,mi),rgba:h}}t.opaque=l;function v(u,h){return Gt=Math.round(h*255),[pi,gi,mi]=Ps.toChannels(u.rgba),{css:Ni.toCss(pi,gi,mi,Gt),rgba:Ni.toRgba(pi,gi,mi,Gt)}}t.opacity=v;function m(u,h){return Gt=u.rgba&255,v(u,Gt*h/255)}t.multiplyOpacity=m;function c(u){return[u.rgba>>24&255,u.rgba>>16&255,u.rgba>>8&255]}t.toColorRGB=c})(ll||={});var i5;(t=>{let i,r;try{let l=document.createElement("canvas");l.width=1,l.height=1;let v=l.getContext("2d",{willReadFrequently:!0});v&&(i=v,i.globalCompositeOperation="copy",r=i.createLinearGradient(0,0,1,1))}catch{}function a(l){if(l.match(/#[\da-f]{3,8}/i))switch(l.length){case 4:return pi=parseInt(l.slice(1,2).repeat(2),16),gi=parseInt(l.slice(2,3).repeat(2),16),mi=parseInt(l.slice(3,4).repeat(2),16),Ni.toColor(pi,gi,mi);case 5:return pi=parseInt(l.slice(1,2).repeat(2),16),gi=parseInt(l.slice(2,3).repeat(2),16),mi=parseInt(l.slice(3,4).repeat(2),16),Gt=parseInt(l.slice(4,5).repeat(2),16),Ni.toColor(pi,gi,mi,Gt);case 7:return{css:l,rgba:(parseInt(l.slice(1),16)<<8|255)>>>0};case 9:return{css:l,rgba:parseInt(l.slice(1),16)>>>0}}let v=l.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(v)return pi=parseInt(v[1]),gi=parseInt(v[2]),mi=parseInt(v[3]),Gt=Math.round((v[5]===void 0?1:parseFloat(v[5]))*255),Ni.toColor(pi,gi,mi,Gt);if(!i||!r)throw new Error("css.toColor: Unsupported css format");if(i.fillStyle=r,i.fillStyle=l,typeof i.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(i.fillRect(0,0,1,1),[pi,gi,mi,Gt]=i.getImageData(0,0,1,1).data,Gt!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:Ni.toRgba(pi,gi,mi,Gt),css:l}}t.toColor=a})(i5||={});var Oi;(t=>{function i(a){return r(a>>16&255,a>>8&255,a&255)}t.relativeLuminance=i;function r(a,l,v){let m=a/255,c=l/255,u=v/255,h=m<=.03928?m/12.92:Math.pow((m+.055)/1.055,2.4),b=c<=.03928?c/12.92:Math.pow((c+.055)/1.055,2.4),p=u<=.03928?u/12.92:Math.pow((u+.055)/1.055,2.4);return h*.2126+b*.7152+p*.0722}t.relativeLuminance2=r})(Oi||={});var Ps;(t=>{function i(m,c){if(Gt=(c&255)/255,Gt===1)return c;let u=c>>24&255,h=c>>16&255,b=c>>8&255,p=m>>24&255,C=m>>16&255,w=m>>8&255;return pi=p+Math.round((u-p)*Gt),gi=C+Math.round((h-C)*Gt),mi=w+Math.round((b-w)*Gt),Ni.toRgba(pi,gi,mi)}t.blend=i;function r(m,c,u){let h=Oi.relativeLuminance(m>>8),b=Oi.relativeLuminance(c>>8);if(Tr(h,b)<u){if(b<h){let w=a(m,c,u),A=Tr(h,Oi.relativeLuminance(w>>8));if(A<u){let x=l(m,c,u),g=Tr(h,Oi.relativeLuminance(x>>8));return A>g?w:x}return w}let p=l(m,c,u),C=Tr(h,Oi.relativeLuminance(p>>8));if(C<u){let w=a(m,c,u),A=Tr(h,Oi.relativeLuminance(w>>8));return C>A?p:w}return p}}t.ensureContrastRatio=r;function a(m,c,u){let h=m>>24&255,b=m>>16&255,p=m>>8&255,C=c>>24&255,w=c>>16&255,A=c>>8&255,x=Tr(Oi.relativeLuminance2(C,w,A),Oi.relativeLuminance2(h,b,p));for(;x<u&&(C>0||w>0||A>0);)C-=Math.max(0,Math.ceil(C*.1)),w-=Math.max(0,Math.ceil(w*.1)),A-=Math.max(0,Math.ceil(A*.1)),x=Tr(Oi.relativeLuminance2(C,w,A),Oi.relativeLuminance2(h,b,p));return(C<<24|w<<16|A<<8|255)>>>0}t.reduceLuminance=a;function l(m,c,u){let h=m>>24&255,b=m>>16&255,p=m>>8&255,C=c>>24&255,w=c>>16&255,A=c>>8&255,x=Tr(Oi.relativeLuminance2(C,w,A),Oi.relativeLuminance2(h,b,p));for(;x<u&&(C<255||w<255||A<255);)C=Math.min(255,C+Math.ceil((255-C)*.1)),w=Math.min(255,w+Math.ceil((255-w)*.1)),A=Math.min(255,A+Math.ceil((255-A)*.1)),x=Tr(Oi.relativeLuminance2(C,w,A),Oi.relativeLuminance2(h,b,p));return(C<<24|w<<16|A<<8|255)>>>0}t.increaseLuminance=l;function v(m){return[m>>24&255,m>>16&255,m>>8&255,m&255]}t.toChannels=v})(Ps||={});function js(t){let i=t.toString(16);return i.length<2?"0"+i:i}function Tr(t,i){return t<i?(i+.05)/(t+.05):(t+.05)/(i+.05)}function ci(t){if(!t)throw new Error("value must not be falsy");return t}function qp(t){return 57508<=t&&t<=57558}function n5(t){return 57520<=t&&t<=57527}function r5(t){return 57344<=t&&t<=63743}function s5(t){return 9472<=t&&t<=9631}function a5(t){return t>=128512&&t<=128591||t>=127744&&t<=128511||t>=128640&&t<=128767||t>=9728&&t<=9983||t>=9984&&t<=10175||t>=65024&&t<=65039||t>=129280&&t<=129535||t>=127462&&t<=127487}function o5(t,i,r,a){return i===1&&r>Math.ceil(a*1.5)&&t!==void 0&&t>255&&!a5(t)&&!qp(t)&&!r5(t)}function Kb(t){return qp(t)||s5(t)}function l5(){return{css:{canvas:qc(),cell:qc()},device:{canvas:qc(),cell:qc(),char:{width:0,height:0,left:0,top:0}}}}function qc(){return{width:0,height:0}}function c5(t,i,r=0){return(t-(Math.round(i)*2-r))%(Math.round(i)*2)}var Ei=0,fi=0,Vn=!1,Ar=!1,Wc=!1,Yi,lf=0,u5=class{constructor(t,i,r,a,l,v){this._terminal=t,this._optionService=i,this._selectionRenderModel=r,this._decorationService=a,this._coreBrowserService=l,this._themeService=v,this.result={fg:0,bg:0,ext:0}}resolve(t,i,r,a){if(this.result.bg=t.bg,this.result.fg=t.fg,this.result.ext=t.bg&268435456?t.extended.ext:0,fi=0,Ei=0,Ar=!1,Vn=!1,Wc=!1,Yi=this._themeService.colors,lf=0,t.getCode()!==0&&t.extended.underlineStyle===4){let l=Math.max(1,Math.floor(this._optionService.rawOptions.fontSize*this._coreBrowserService.dpr/15));lf=i*a%(Math.round(l)*2)}if(this._decorationService.forEachDecorationAtCell(i,r,"bottom",l=>{l.backgroundColorRGB&&(fi=l.backgroundColorRGB.rgba>>8&16777215,Ar=!0),l.foregroundColorRGB&&(Ei=l.foregroundColorRGB.rgba>>8&16777215,Vn=!0)}),Wc=this._selectionRenderModel.isCellSelected(this._terminal,i,r),Wc){if(this.result.fg&67108864||(this.result.bg&50331648)!==0){if(this.result.fg&67108864)switch(this.result.fg&50331648){case 16777216:case 33554432:fi=this._themeService.colors.ansi[this.result.fg&255].rgba;break;case 50331648:fi=(this.result.fg&16777215)<<8|255;break;default:fi=this._themeService.colors.foreground.rgba}else switch(this.result.bg&50331648){case 16777216:case 33554432:fi=this._themeService.colors.ansi[this.result.bg&255].rgba;break;case 50331648:fi=(this.result.bg&16777215)<<8|255;break}fi=Ps.blend(fi,(this._coreBrowserService.isFocused?Yi.selectionBackgroundOpaque:Yi.selectionInactiveBackgroundOpaque).rgba&4294967040|128)>>8&16777215}else fi=(this._coreBrowserService.isFocused?Yi.selectionBackgroundOpaque:Yi.selectionInactiveBackgroundOpaque).rgba>>8&16777215;if(Ar=!0,Yi.selectionForeground&&(Ei=Yi.selectionForeground.rgba>>8&16777215,Vn=!0),Kb(t.getCode())){if(this.result.fg&67108864&&(this.result.bg&50331648)===0)Ei=(this._coreBrowserService.isFocused?Yi.selectionBackgroundOpaque:Yi.selectionInactiveBackgroundOpaque).rgba>>8&16777215;else{if(this.result.fg&67108864)switch(this.result.bg&50331648){case 16777216:case 33554432:Ei=this._themeService.colors.ansi[this.result.bg&255].rgba;break;case 50331648:Ei=(this.result.bg&16777215)<<8|255;break}else switch(this.result.fg&50331648){case 16777216:case 33554432:Ei=this._themeService.colors.ansi[this.result.fg&255].rgba;break;case 50331648:Ei=(this.result.fg&16777215)<<8|255;break;default:Ei=this._themeService.colors.foreground.rgba}Ei=Ps.blend(Ei,(this._coreBrowserService.isFocused?Yi.selectionBackgroundOpaque:Yi.selectionInactiveBackgroundOpaque).rgba&4294967040|128)>>8&16777215}Vn=!0}}this._decorationService.forEachDecorationAtCell(i,r,"top",l=>{l.backgroundColorRGB&&(fi=l.backgroundColorRGB.rgba>>8&16777215,Ar=!0),l.foregroundColorRGB&&(Ei=l.foregroundColorRGB.rgba>>8&16777215,Vn=!0)}),Ar&&(Wc?fi=t.bg&-16777216&-134217729|fi|50331648:fi=t.bg&-16777216|fi|50331648),Vn&&(Ei=t.fg&-16777216&-67108865|Ei|50331648),this.result.fg&67108864&&(Ar&&!Vn&&((this.result.bg&50331648)===0?Ei=this.result.fg&-134217728|Yi.background.rgba>>8&16777215&16777215|50331648:Ei=this.result.fg&-134217728|this.result.bg&67108863,Vn=!0),!Ar&&Vn&&((this.result.fg&50331648)===0?fi=this.result.bg&-67108864|Yi.foreground.rgba>>8&16777215&16777215|50331648:fi=this.result.bg&-67108864|this.result.fg&67108863,Ar=!0)),Yi=void 0,this.result.bg=Ar?fi:this.result.bg,this.result.fg=Vn?Ei:this.result.fg,this.result.ext&=536870911,this.result.ext|=lf<<29&3758096384}},h5=.5,Yb=JE||QE?"bottom":"ideographic",d5={"▀":[{x:0,y:0,w:8,h:4}],"▁":[{x:0,y:7,w:8,h:1}],"▂":[{x:0,y:6,w:8,h:2}],"▃":[{x:0,y:5,w:8,h:3}],"▄":[{x:0,y:4,w:8,h:4}],"▅":[{x:0,y:3,w:8,h:5}],"▆":[{x:0,y:2,w:8,h:6}],"▇":[{x:0,y:1,w:8,h:7}],"█":[{x:0,y:0,w:8,h:8}],"▉":[{x:0,y:0,w:7,h:8}],"▊":[{x:0,y:0,w:6,h:8}],"▋":[{x:0,y:0,w:5,h:8}],"▌":[{x:0,y:0,w:4,h:8}],"▍":[{x:0,y:0,w:3,h:8}],"▎":[{x:0,y:0,w:2,h:8}],"▏":[{x:0,y:0,w:1,h:8}],"▐":[{x:4,y:0,w:4,h:8}],"▔":[{x:0,y:0,w:8,h:1}],"▕":[{x:7,y:0,w:1,h:8}],"▖":[{x:0,y:4,w:4,h:4}],"▗":[{x:4,y:4,w:4,h:4}],"▘":[{x:0,y:0,w:4,h:4}],"▙":[{x:0,y:0,w:4,h:8},{x:0,y:4,w:8,h:4}],"▚":[{x:0,y:0,w:4,h:4},{x:4,y:4,w:4,h:4}],"▛":[{x:0,y:0,w:4,h:8},{x:4,y:0,w:4,h:4}],"▜":[{x:0,y:0,w:8,h:4},{x:4,y:0,w:4,h:8}],"▝":[{x:4,y:0,w:4,h:4}],"▞":[{x:4,y:0,w:4,h:4},{x:0,y:4,w:4,h:4}],"▟":[{x:4,y:0,w:4,h:8},{x:0,y:4,w:8,h:4}],"🭰":[{x:1,y:0,w:1,h:8}],"🭱":[{x:2,y:0,w:1,h:8}],"🭲":[{x:3,y:0,w:1,h:8}],"🭳":[{x:4,y:0,w:1,h:8}],"🭴":[{x:5,y:0,w:1,h:8}],"🭵":[{x:6,y:0,w:1,h:8}],"🭶":[{x:0,y:1,w:8,h:1}],"🭷":[{x:0,y:2,w:8,h:1}],"🭸":[{x:0,y:3,w:8,h:1}],"🭹":[{x:0,y:4,w:8,h:1}],"🭺":[{x:0,y:5,w:8,h:1}],"🭻":[{x:0,y:6,w:8,h:1}],"🭼":[{x:0,y:0,w:1,h:8},{x:0,y:7,w:8,h:1}],"🭽":[{x:0,y:0,w:1,h:8},{x:0,y:0,w:8,h:1}],"🭾":[{x:7,y:0,w:1,h:8},{x:0,y:0,w:8,h:1}],"🭿":[{x:7,y:0,w:1,h:8},{x:0,y:7,w:8,h:1}],"🮀":[{x:0,y:0,w:8,h:1},{x:0,y:7,w:8,h:1}],"🮁":[{x:0,y:0,w:8,h:1},{x:0,y:2,w:8,h:1},{x:0,y:4,w:8,h:1},{x:0,y:7,w:8,h:1}],"🮂":[{x:0,y:0,w:8,h:2}],"🮃":[{x:0,y:0,w:8,h:3}],"🮄":[{x:0,y:0,w:8,h:5}],"🮅":[{x:0,y:0,w:8,h:6}],"🮆":[{x:0,y:0,w:8,h:7}],"🮇":[{x:6,y:0,w:2,h:8}],"🮈":[{x:5,y:0,w:3,h:8}],"🮉":[{x:3,y:0,w:5,h:8}],"🮊":[{x:2,y:0,w:6,h:8}],"🮋":[{x:1,y:0,w:7,h:8}],"🮕":[{x:0,y:0,w:2,h:2},{x:4,y:0,w:2,h:2},{x:2,y:2,w:2,h:2},{x:6,y:2,w:2,h:2},{x:0,y:4,w:2,h:2},{x:4,y:4,w:2,h:2},{x:2,y:6,w:2,h:2},{x:6,y:6,w:2,h:2}],"🮖":[{x:2,y:0,w:2,h:2},{x:6,y:0,w:2,h:2},{x:0,y:2,w:2,h:2},{x:4,y:2,w:2,h:2},{x:2,y:4,w:2,h:2},{x:6,y:4,w:2,h:2},{x:0,y:6,w:2,h:2},{x:4,y:6,w:2,h:2}],"🮗":[{x:0,y:2,w:8,h:2},{x:0,y:6,w:8,h:2}]},f5={"░":[[1,0,0,0],[0,0,0,0],[0,0,1,0],[0,0,0,0]],"▒":[[1,0],[0,0],[0,1],[0,0]],"▓":[[0,1],[1,1],[1,0],[1,1]]},p5={"─":{1:"M0,.5 L1,.5"},"━":{3:"M0,.5 L1,.5"},"│":{1:"M.5,0 L.5,1"},"┃":{3:"M.5,0 L.5,1"},"┌":{1:"M0.5,1 L.5,.5 L1,.5"},"┏":{3:"M0.5,1 L.5,.5 L1,.5"},"┐":{1:"M0,.5 L.5,.5 L.5,1"},"┓":{3:"M0,.5 L.5,.5 L.5,1"},"└":{1:"M.5,0 L.5,.5 L1,.5"},"┗":{3:"M.5,0 L.5,.5 L1,.5"},"┘":{1:"M.5,0 L.5,.5 L0,.5"},"┛":{3:"M.5,0 L.5,.5 L0,.5"},"├":{1:"M.5,0 L.5,1 M.5,.5 L1,.5"},"┣":{3:"M.5,0 L.5,1 M.5,.5 L1,.5"},"┤":{1:"M.5,0 L.5,1 M.5,.5 L0,.5"},"┫":{3:"M.5,0 L.5,1 M.5,.5 L0,.5"},"┬":{1:"M0,.5 L1,.5 M.5,.5 L.5,1"},"┳":{3:"M0,.5 L1,.5 M.5,.5 L.5,1"},"┴":{1:"M0,.5 L1,.5 M.5,.5 L.5,0"},"┻":{3:"M0,.5 L1,.5 M.5,.5 L.5,0"},"┼":{1:"M0,.5 L1,.5 M.5,0 L.5,1"},"╋":{3:"M0,.5 L1,.5 M.5,0 L.5,1"},"╴":{1:"M.5,.5 L0,.5"},"╸":{3:"M.5,.5 L0,.5"},"╵":{1:"M.5,.5 L.5,0"},"╹":{3:"M.5,.5 L.5,0"},"╶":{1:"M.5,.5 L1,.5"},"╺":{3:"M.5,.5 L1,.5"},"╷":{1:"M.5,.5 L.5,1"},"╻":{3:"M.5,.5 L.5,1"},"═":{1:(t,i)=>`M0,${.5-i} L1,${.5-i} M0,${.5+i} L1,${.5+i}`},"║":{1:(t,i)=>`M${.5-t},0 L${.5-t},1 M${.5+t},0 L${.5+t},1`},"╒":{1:(t,i)=>`M.5,1 L.5,${.5-i} L1,${.5-i} M.5,${.5+i} L1,${.5+i}`},"╓":{1:(t,i)=>`M${.5-t},1 L${.5-t},.5 L1,.5 M${.5+t},.5 L${.5+t},1`},"╔":{1:(t,i)=>`M1,${.5-i} L${.5-t},${.5-i} L${.5-t},1 M1,${.5+i} L${.5+t},${.5+i} L${.5+t},1`},"╕":{1:(t,i)=>`M0,${.5-i} L.5,${.5-i} L.5,1 M0,${.5+i} L.5,${.5+i}`},"╖":{1:(t,i)=>`M${.5+t},1 L${.5+t},.5 L0,.5 M${.5-t},.5 L${.5-t},1`},"╗":{1:(t,i)=>`M0,${.5+i} L${.5-t},${.5+i} L${.5-t},1 M0,${.5-i} L${.5+t},${.5-i} L${.5+t},1`},"╘":{1:(t,i)=>`M.5,0 L.5,${.5+i} L1,${.5+i} M.5,${.5-i} L1,${.5-i}`},"╙":{1:(t,i)=>`M1,.5 L${.5-t},.5 L${.5-t},0 M${.5+t},.5 L${.5+t},0`},"╚":{1:(t,i)=>`M1,${.5-i} L${.5+t},${.5-i} L${.5+t},0 M1,${.5+i} L${.5-t},${.5+i} L${.5-t},0`},"╛":{1:(t,i)=>`M0,${.5+i} L.5,${.5+i} L.5,0 M0,${.5-i} L.5,${.5-i}`},"╜":{1:(t,i)=>`M0,.5 L${.5+t},.5 L${.5+t},0 M${.5-t},.5 L${.5-t},0`},"╝":{1:(t,i)=>`M0,${.5-i} L${.5-t},${.5-i} L${.5-t},0 M0,${.5+i} L${.5+t},${.5+i} L${.5+t},0`},"╞":{1:(t,i)=>`M.5,0 L.5,1 M.5,${.5-i} L1,${.5-i} M.5,${.5+i} L1,${.5+i}`},"╟":{1:(t,i)=>`M${.5-t},0 L${.5-t},1 M${.5+t},0 L${.5+t},1 M${.5+t},.5 L1,.5`},"╠":{1:(t,i)=>`M${.5-t},0 L${.5-t},1 M1,${.5+i} L${.5+t},${.5+i} L${.5+t},1 M1,${.5-i} L${.5+t},${.5-i} L${.5+t},0`},"╡":{1:(t,i)=>`M.5,0 L.5,1 M0,${.5-i} L.5,${.5-i} M0,${.5+i} L.5,${.5+i}`},"╢":{1:(t,i)=>`M0,.5 L${.5-t},.5 M${.5-t},0 L${.5-t},1 M${.5+t},0 L${.5+t},1`},"╣":{1:(t,i)=>`M${.5+t},0 L${.5+t},1 M0,${.5+i} L${.5-t},${.5+i} L${.5-t},1 M0,${.5-i} L${.5-t},${.5-i} L${.5-t},0`},"╤":{1:(t,i)=>`M0,${.5-i} L1,${.5-i} M0,${.5+i} L1,${.5+i} M.5,${.5+i} L.5,1`},"╥":{1:(t,i)=>`M0,.5 L1,.5 M${.5-t},.5 L${.5-t},1 M${.5+t},.5 L${.5+t},1`},"╦":{1:(t,i)=>`M0,${.5-i} L1,${.5-i} M0,${.5+i} L${.5-t},${.5+i} L${.5-t},1 M1,${.5+i} L${.5+t},${.5+i} L${.5+t},1`},"╧":{1:(t,i)=>`M.5,0 L.5,${.5-i} M0,${.5-i} L1,${.5-i} M0,${.5+i} L1,${.5+i}`},"╨":{1:(t,i)=>`M0,.5 L1,.5 M${.5-t},.5 L${.5-t},0 M${.5+t},.5 L${.5+t},0`},"╩":{1:(t,i)=>`M0,${.5+i} L1,${.5+i} M0,${.5-i} L${.5-t},${.5-i} L${.5-t},0 M1,${.5-i} L${.5+t},${.5-i} L${.5+t},0`},"╪":{1:(t,i)=>`M.5,0 L.5,1 M0,${.5-i} L1,${.5-i} M0,${.5+i} L1,${.5+i}`},"╫":{1:(t,i)=>`M0,.5 L1,.5 M${.5-t},0 L${.5-t},1 M${.5+t},0 L${.5+t},1`},"╬":{1:(t,i)=>`M0,${.5+i} L${.5-t},${.5+i} L${.5-t},1 M1,${.5+i} L${.5+t},${.5+i} L${.5+t},1 M0,${.5-i} L${.5-t},${.5-i} L${.5-t},0 M1,${.5-i} L${.5+t},${.5-i} L${.5+t},0`},"╱":{1:"M1,0 L0,1"},"╲":{1:"M0,0 L1,1"},"╳":{1:"M1,0 L0,1 M0,0 L1,1"},"╼":{1:"M.5,.5 L0,.5",3:"M.5,.5 L1,.5"},"╽":{1:"M.5,.5 L.5,0",3:"M.5,.5 L.5,1"},"╾":{1:"M.5,.5 L1,.5",3:"M.5,.5 L0,.5"},"╿":{1:"M.5,.5 L.5,1",3:"M.5,.5 L.5,0"},"┍":{1:"M.5,.5 L.5,1",3:"M.5,.5 L1,.5"},"┎":{1:"M.5,.5 L1,.5",3:"M.5,.5 L.5,1"},"┑":{1:"M.5,.5 L.5,1",3:"M.5,.5 L0,.5"},"┒":{1:"M.5,.5 L0,.5",3:"M.5,.5 L.5,1"},"┕":{1:"M.5,.5 L.5,0",3:"M.5,.5 L1,.5"},"┖":{1:"M.5,.5 L1,.5",3:"M.5,.5 L.5,0"},"┙":{1:"M.5,.5 L.5,0",3:"M.5,.5 L0,.5"},"┚":{1:"M.5,.5 L0,.5",3:"M.5,.5 L.5,0"},"┝":{1:"M.5,0 L.5,1",3:"M.5,.5 L1,.5"},"┞":{1:"M0.5,1 L.5,.5 L1,.5",3:"M.5,.5 L.5,0"},"┟":{1:"M.5,0 L.5,.5 L1,.5",3:"M.5,.5 L.5,1"},"┠":{1:"M.5,.5 L1,.5",3:"M.5,0 L.5,1"},"┡":{1:"M.5,.5 L.5,1",3:"M.5,0 L.5,.5 L1,.5"},"┢":{1:"M.5,.5 L.5,0",3:"M0.5,1 L.5,.5 L1,.5"},"┥":{1:"M.5,0 L.5,1",3:"M.5,.5 L0,.5"},"┦":{1:"M0,.5 L.5,.5 L.5,1",3:"M.5,.5 L.5,0"},"┧":{1:"M.5,0 L.5,.5 L0,.5",3:"M.5,.5 L.5,1"},"┨":{1:"M.5,.5 L0,.5",3:"M.5,0 L.5,1"},"┩":{1:"M.5,.5 L.5,1",3:"M.5,0 L.5,.5 L0,.5"},"┪":{1:"M.5,.5 L.5,0",3:"M0,.5 L.5,.5 L.5,1"},"┭":{1:"M0.5,1 L.5,.5 L1,.5",3:"M.5,.5 L0,.5"},"┮":{1:"M0,.5 L.5,.5 L.5,1",3:"M.5,.5 L1,.5"},"┯":{1:"M.5,.5 L.5,1",3:"M0,.5 L1,.5"},"┰":{1:"M0,.5 L1,.5",3:"M.5,.5 L.5,1"},"┱":{1:"M.5,.5 L1,.5",3:"M0,.5 L.5,.5 L.5,1"},"┲":{1:"M.5,.5 L0,.5",3:"M0.5,1 L.5,.5 L1,.5"},"┵":{1:"M.5,0 L.5,.5 L1,.5",3:"M.5,.5 L0,.5"},"┶":{1:"M.5,0 L.5,.5 L0,.5",3:"M.5,.5 L1,.5"},"┷":{1:"M.5,.5 L.5,0",3:"M0,.5 L1,.5"},"┸":{1:"M0,.5 L1,.5",3:"M.5,.5 L.5,0"},"┹":{1:"M.5,.5 L1,.5",3:"M.5,0 L.5,.5 L0,.5"},"┺":{1:"M.5,.5 L0,.5",3:"M.5,0 L.5,.5 L1,.5"},"┽":{1:"M.5,0 L.5,1 M.5,.5 L1,.5",3:"M.5,.5 L0,.5"},"┾":{1:"M.5,0 L.5,1 M.5,.5 L0,.5",3:"M.5,.5 L1,.5"},"┿":{1:"M.5,0 L.5,1",3:"M0,.5 L1,.5"},"╀":{1:"M0,.5 L1,.5 M.5,.5 L.5,1",3:"M.5,.5 L.5,0"},"╁":{1:"M.5,.5 L.5,0 M0,.5 L1,.5",3:"M.5,.5 L.5,1"},"╂":{1:"M0,.5 L1,.5",3:"M.5,0 L.5,1"},"╃":{1:"M0.5,1 L.5,.5 L1,.5",3:"M.5,0 L.5,.5 L0,.5"},"╄":{1:"M0,.5 L.5,.5 L.5,1",3:"M.5,0 L.5,.5 L1,.5"},"╅":{1:"M.5,0 L.5,.5 L1,.5",3:"M0,.5 L.5,.5 L.5,1"},"╆":{1:"M.5,0 L.5,.5 L0,.5",3:"M0.5,1 L.5,.5 L1,.5"},"╇":{1:"M.5,.5 L.5,1",3:"M.5,.5 L.5,0 M0,.5 L1,.5"},"╈":{1:"M.5,.5 L.5,0",3:"M0,.5 L1,.5 M.5,.5 L.5,1"},"╉":{1:"M.5,.5 L1,.5",3:"M.5,0 L.5,1 M.5,.5 L0,.5"},"╊":{1:"M.5,.5 L0,.5",3:"M.5,0 L.5,1 M.5,.5 L1,.5"},"╌":{1:"M.1,.5 L.4,.5 M.6,.5 L.9,.5"},"╍":{3:"M.1,.5 L.4,.5 M.6,.5 L.9,.5"},"┄":{1:"M.0667,.5 L.2667,.5 M.4,.5 L.6,.5 M.7333,.5 L.9333,.5"},"┅":{3:"M.0667,.5 L.2667,.5 M.4,.5 L.6,.5 M.7333,.5 L.9333,.5"},"┈":{1:"M.05,.5 L.2,.5 M.3,.5 L.45,.5 M.55,.5 L.7,.5 M.8,.5 L.95,.5"},"┉":{3:"M.05,.5 L.2,.5 M.3,.5 L.45,.5 M.55,.5 L.7,.5 M.8,.5 L.95,.5"},"╎":{1:"M.5,.1 L.5,.4 M.5,.6 L.5,.9"},"╏":{3:"M.5,.1 L.5,.4 M.5,.6 L.5,.9"},"┆":{1:"M.5,.0667 L.5,.2667 M.5,.4 L.5,.6 M.5,.7333 L.5,.9333"},"┇":{3:"M.5,.0667 L.5,.2667 M.5,.4 L.5,.6 M.5,.7333 L.5,.9333"},"┊":{1:"M.5,.05 L.5,.2 M.5,.3 L.5,.45 L.5,.55 M.5,.7 L.5,.95"},"┋":{3:"M.5,.05 L.5,.2 M.5,.3 L.5,.45 L.5,.55 M.5,.7 L.5,.95"},"╭":{1:(t,i)=>`M.5,1 L.5,${.5+i/.15*.5} C.5,${.5+i/.15*.5},.5,.5,1,.5`},"╮":{1:(t,i)=>`M.5,1 L.5,${.5+i/.15*.5} C.5,${.5+i/.15*.5},.5,.5,0,.5`},"╯":{1:(t,i)=>`M.5,0 L.5,${.5-i/.15*.5} C.5,${.5-i/.15*.5},.5,.5,0,.5`},"╰":{1:(t,i)=>`M.5,0 L.5,${.5-i/.15*.5} C.5,${.5-i/.15*.5},.5,.5,1,.5`}},bl={"":{d:"M.3,1 L.03,1 L.03,.88 C.03,.82,.06,.78,.11,.73 C.15,.7,.2,.68,.28,.65 L.43,.6 C.49,.58,.53,.56,.56,.53 C.59,.5,.6,.47,.6,.43 L.6,.27 L.4,.27 L.69,.1 L.98,.27 L.78,.27 L.78,.46 C.78,.52,.76,.56,.72,.61 C.68,.66,.63,.67,.56,.7 L.48,.72 C.42,.74,.38,.76,.35,.78 C.32,.8,.31,.84,.31,.88 L.31,1 M.3,.5 L.03,.59 L.03,.09 L.3,.09 L.3,.655",type:0},"":{d:"M.7,.4 L.7,.47 L.2,.47 L.2,.03 L.355,.03 L.355,.4 L.705,.4 M.7,.5 L.86,.5 L.86,.95 L.69,.95 L.44,.66 L.46,.86 L.46,.95 L.3,.95 L.3,.49 L.46,.49 L.71,.78 L.69,.565 L.69,.5",type:0},"":{d:"M.25,.94 C.16,.94,.11,.92,.11,.87 L.11,.53 C.11,.48,.15,.455,.23,.45 L.23,.3 C.23,.25,.26,.22,.31,.19 C.36,.16,.43,.15,.51,.15 C.59,.15,.66,.16,.71,.19 C.77,.22,.79,.26,.79,.3 L.79,.45 C.87,.45,.91,.48,.91,.53 L.91,.87 C.91,.92,.86,.94,.77,.94 L.24,.94 M.53,.2 C.49,.2,.45,.21,.42,.23 C.39,.25,.38,.27,.38,.3 L.38,.45 L.68,.45 L.68,.3 C.68,.27,.67,.25,.64,.23 C.61,.21,.58,.2,.53,.2 M.58,.82 L.58,.66 C.63,.65,.65,.63,.65,.6 C.65,.58,.64,.57,.61,.56 C.58,.55,.56,.54,.52,.54 C.48,.54,.46,.55,.43,.56 C.4,.57,.39,.59,.39,.6 C.39,.63,.41,.64,.46,.66 L.46,.82 L.57,.82",type:0},"":{d:"M0,0 L1,.5 L0,1",type:0,rightPadding:2},"":{d:"M-1,-.5 L1,.5 L-1,1.5",type:1,leftPadding:1,rightPadding:1},"":{d:"M1,0 L0,.5 L1,1",type:0,leftPadding:2},"":{d:"M2,-.5 L0,.5 L2,1.5",type:1,leftPadding:1,rightPadding:1},"":{d:"M0,0 L0,1 C0.552,1,1,0.776,1,.5 C1,0.224,0.552,0,0,0",type:0,rightPadding:1},"":{d:"M.2,1 C.422,1,.8,.826,.78,.5 C.8,.174,0.422,0,.2,0",type:1,rightPadding:1},"":{d:"M1,0 L1,1 C0.448,1,0,0.776,0,.5 C0,0.224,0.448,0,1,0",type:0,leftPadding:1},"":{d:"M.8,1 C0.578,1,0.2,.826,.22,.5 C0.2,0.174,0.578,0,0.8,0",type:1,leftPadding:1},"":{d:"M-.5,-.5 L1.5,1.5 L-.5,1.5",type:0},"":{d:"M-.5,-.5 L1.5,1.5",type:1,leftPadding:1,rightPadding:1},"":{d:"M1.5,-.5 L-.5,1.5 L1.5,1.5",type:0},"":{d:"M1.5,-.5 L-.5,1.5 L-.5,-.5",type:0},"":{d:"M1.5,-.5 L-.5,1.5",type:1,leftPadding:1,rightPadding:1},"":{d:"M-.5,-.5 L1.5,1.5 L1.5,-.5",type:0}};bl[""]=bl[""];bl[""]=bl[""];function g5(t,i,r,a,l,v,m,c){let u=d5[i];if(u)return m5(t,u,r,a,l,v),!0;let h=f5[i];if(h)return _5(t,h,r,a,l,v),!0;let b=p5[i];if(b)return v5(t,b,r,a,l,v,c),!0;let p=bl[i];return p?(b5(t,p,r,a,l,v,m,c),!0):!1}function m5(t,i,r,a,l,v){for(let m=0;m<i.length;m++){let c=i[m],u=l/8,h=v/8;t.fillRect(r+c.x*u,a+c.y*h,c.w*u,c.h*h)}}var b0=new Map;function _5(t,i,r,a,l,v){let m=b0.get(i);m||(m=new Map,b0.set(i,m));let c=t.fillStyle;if(typeof c!="string")throw new Error(`Unexpected fillStyle type "${c}"`);let u=m.get(c);if(!u){let h=i[0].length,b=i.length,p=t.canvas.ownerDocument.createElement("canvas");p.width=h,p.height=b;let C=ci(p.getContext("2d")),w=new ImageData(h,b),A,x,g,y;if(c.startsWith("#"))A=parseInt(c.slice(1,3),16),x=parseInt(c.slice(3,5),16),g=parseInt(c.slice(5,7),16),y=c.length>7&&parseInt(c.slice(7,9),16)||1;else if(c.startsWith("rgba"))[A,x,g,y]=c.substring(5,c.length-1).split(",").map(f=>parseFloat(f));else throw new Error(`Unexpected fillStyle color format "${c}" when drawing pattern glyph`);for(let f=0;f<b;f++)for(let _=0;_<h;_++)w.data[(f*h+_)*4]=A,w.data[(f*h+_)*4+1]=x,w.data[(f*h+_)*4+2]=g,w.data[(f*h+_)*4+3]=i[f][_]*(y*255);C.putImageData(w,0,0),u=ci(t.createPattern(p,null)),m.set(c,u)}t.fillStyle=u,t.fillRect(r,a,l,v)}function v5(t,i,r,a,l,v,m){t.strokeStyle=t.fillStyle;for(let[c,u]of Object.entries(i)){t.beginPath(),t.lineWidth=m*Number.parseInt(c);let h;if(typeof u=="function"){let b=.15/v*l;h=u(.15,b)}else h=u;for(let b of h.split(" ")){let p=b[0],C=Vb[p];if(!C){console.error(`Could not find drawing instructions for "${p}"`);continue}let w=b.substring(1).split(",");!w[0]||!w[1]||C(t,Xb(w,l,v,r,a,!0,m))}t.stroke(),t.closePath()}}function b5(t,i,r,a,l,v,m,c){let u=new Path2D;u.rect(r,a,l,v),t.clip(u),t.beginPath();let h=m/12;t.lineWidth=c*h;for(let b of i.d.split(" ")){let p=b[0],C=Vb[p];if(!C){console.error(`Could not find drawing instructions for "${p}"`);continue}let w=b.substring(1).split(",");!w[0]||!w[1]||C(t,Xb(w,l,v,r,a,!1,c,(i.leftPadding??0)*(h/2),(i.rightPadding??0)*(h/2)))}i.type===1?(t.strokeStyle=t.fillStyle,t.stroke()):t.fill(),t.closePath()}function y0(t,i,r=0){return Math.max(Math.min(t,i),r)}var Vb={C:(t,i)=>t.bezierCurveTo(i[0],i[1],i[2],i[3],i[4],i[5]),L:(t,i)=>t.lineTo(i[0],i[1]),M:(t,i)=>t.moveTo(i[0],i[1])};function Xb(t,i,r,a,l,v,m,c=0,u=0){let h=t.map(b=>parseFloat(b)||parseInt(b));if(h.length<2)throw new Error("Too few arguments for instruction");for(let b=0;b<h.length;b+=2)h[b]*=i-c*m-u*m,v&&h[b]!==0&&(h[b]=y0(Math.round(h[b]+.5)-.5,i,0)),h[b]+=a+c*m;for(let b=1;b<h.length;b+=2)h[b]*=r,v&&h[b]!==0&&(h[b]=y0(Math.round(h[b]+.5)-.5,r,0)),h[b]+=l;return h}var S0=class{constructor(){this._data={}}set(t,i,r){this._data[t]||(this._data[t]={}),this._data[t][i]=r}get(t,i){return this._data[t]?this._data[t][i]:void 0}clear(){this._data={}}},C0=class{constructor(){this._data=new S0}set(t,i,r,a,l){this._data.get(t,i)||this._data.set(t,i,new S0),this._data.get(t,i).set(r,a,l)}get(t,i,r,a){return this._data.get(t,i)?.get(r,a)}clear(){this._data.clear()}},Zb=class{constructor(){this._tasks=[],this._i=0}enqueue(t){this._tasks.push(t),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(t){this._idleCallback=void 0;let i=0,r=0,a=t.timeRemaining(),l=0;for(;this._i<this._tasks.length;){if(i=performance.now(),this._tasks[this._i]()||this._i++,i=Math.max(1,performance.now()-i),r=Math.max(i,r),l=t.timeRemaining(),r*1.5>l){a-i<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(a-i))}ms`),this._start();return}a=l}this.clear()}},y5=class extends Zb{_requestCallback(t){return setTimeout(()=>t(this._createDeadline(16)))}_cancelCallback(t){clearTimeout(t)}_createDeadline(t){let i=performance.now()+t;return{timeRemaining:()=>Math.max(0,i-performance.now())}}},S5=class extends Zb{_requestCallback(t){return requestIdleCallback(t)}_cancelCallback(t){cancelIdleCallback(t)}},C5=!Fp&&"requestIdleCallback"in window?S5:y5,Ua=class Jb{constructor(){this.fg=0,this.bg=0,this.extended=new Qb}static toColorRGB(i){return[i>>>16&255,i>>>8&255,i&255]}static fromColorRGB(i){return(i[0]&255)<<16|(i[1]&255)<<8|i[2]&255}clone(){let i=new Jb;return i.fg=this.fg,i.bg=this.bg,i.extended=this.extended.clone(),i}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}},Qb=class ey{constructor(i=0,r=0){this._ext=0,this._urlId=0,this._ext=i,this._urlId=r}get ext(){return this._urlId?this._ext&-469762049|this.underlineStyle<<26:this._ext}set ext(i){this._ext=i}get underlineStyle(){return this._urlId?5:(this._ext&469762048)>>26}set underlineStyle(i){this._ext&=-469762049,this._ext|=i<<26&469762048}get underlineColor(){return this._ext&67108863}set underlineColor(i){this._ext&=-67108864,this._ext|=i&67108863}get urlId(){return this._urlId}set urlId(i){this._urlId=i}get underlineVariantOffset(){let i=(this._ext&3758096384)>>29;return i<0?i^4294967288:i}set underlineVariantOffset(i){this._ext&=536870911,this._ext|=i<<29&3758096384}clone(){return new ey(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}},w5=globalThis.performance&&typeof globalThis.performance.now=="function",x5=class ty{static create(i){return new ty(i)}constructor(i){this._now=w5&&i===!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}},Dr;(t=>{t.None=()=>Un.None;function i(F,j){return p(F,()=>{},0,void 0,!0,void 0,j)}t.defer=i;function r(F){return(j,J=null,te)=>{let P=!1,V;return V=F(Y=>{if(!P)return V?V.dispose():P=!0,j.call(J,Y)},null,te),P&&V.dispose(),V}}t.once=r;function a(F,j,J){return h((te,P=null,V)=>F(Y=>te.call(P,j(Y)),null,V),J)}t.map=a;function l(F,j,J){return h((te,P=null,V)=>F(Y=>{j(Y),te.call(P,Y)},null,V),J)}t.forEach=l;function v(F,j,J){return h((te,P=null,V)=>F(Y=>j(Y)&&te.call(P,Y),null,V),J)}t.filter=v;function m(F){return F}t.signal=m;function c(...F){return(j,J=null,te)=>{let P=Fb(...F.map(V=>V(Y=>j.call(J,Y))));return b(P,te)}}t.any=c;function u(F,j,J,te){let P=J;return a(F,V=>(P=j(P,V),P),te)}t.reduce=u;function h(F,j){let J,te={onWillAddFirstListener(){J=F(P.fire,P)},onDidRemoveLastListener(){J?.dispose()}},P=new Lt(te);return j?.add(P),P.event}function b(F,j){return j instanceof Array?j.push(F):j&&j.add(F),F}function p(F,j,J=100,te=!1,P=!1,V,Y){let B,z,O,H=0,X,ae={leakWarningThreshold:V,onWillAddFirstListener(){B=F(_e=>{H++,z=j(z,_e),te&&!O&&(ce.fire(z),z=void 0),X=()=>{let Q=z;z=void 0,O=void 0,(!te||H>1)&&ce.fire(Q),H=0},typeof J=="number"?(clearTimeout(O),O=setTimeout(X,J)):O===void 0&&(O=0,queueMicrotask(X))})},onWillRemoveListener(){P&&H>0&&X?.()},onDidRemoveLastListener(){X=void 0,B.dispose()}},ce=new Lt(ae);return Y?.add(ce),ce.event}t.debounce=p;function C(F,j=0,J){return t.debounce(F,(te,P)=>te?(te.push(P),te):[P],j,void 0,!0,void 0,J)}t.accumulate=C;function w(F,j=(te,P)=>te===P,J){let te=!0,P;return v(F,V=>{let Y=te||!j(V,P);return te=!1,P=V,Y},J)}t.latch=w;function A(F,j,J){return[t.filter(F,j,J),t.filter(F,te=>!j(te),J)]}t.split=A;function x(F,j=!1,J=[],te){let P=J.slice(),V=F(z=>{P?P.push(z):B.fire(z)});te&&te.add(V);let Y=()=>{P?.forEach(z=>B.fire(z)),P=null},B=new Lt({onWillAddFirstListener(){V||(V=F(z=>B.fire(z)),te&&te.add(V))},onDidAddFirstListener(){P&&(j?setTimeout(Y):Y())},onDidRemoveLastListener(){V&&V.dispose(),V=null}});return te&&te.add(B),B.event}t.buffer=x;function g(F,j){return(J,te,P)=>{let V=j(new f);return F(function(Y){let B=V.evaluate(Y);B!==y&&J.call(te,B)},void 0,P)}}t.chain=g;let y=Symbol("HaltChainable");class f{constructor(){this.steps=[]}map(j){return this.steps.push(j),this}forEach(j){return this.steps.push(J=>(j(J),J)),this}filter(j){return this.steps.push(J=>j(J)?J:y),this}reduce(j,J){let te=J;return this.steps.push(P=>(te=j(te,P),te)),this}latch(j=(J,te)=>J===te){let J=!0,te;return this.steps.push(P=>{let V=J||!j(P,te);return J=!1,te=P,V?P:y}),this}evaluate(j){for(let J of this.steps)if(j=J(j),j===y)break;return j}}function _(F,j,J=te=>te){let te=(...B)=>Y.fire(J(...B)),P=()=>F.on(j,te),V=()=>F.removeListener(j,te),Y=new Lt({onWillAddFirstListener:P,onDidRemoveLastListener:V});return Y.event}t.fromNodeEventEmitter=_;function E(F,j,J=te=>te){let te=(...B)=>Y.fire(J(...B)),P=()=>F.addEventListener(j,te),V=()=>F.removeEventListener(j,te),Y=new Lt({onWillAddFirstListener:P,onDidRemoveLastListener:V});return Y.event}t.fromDOMEventEmitter=E;function L(F){return new Promise(j=>r(F)(j))}t.toPromise=L;function R(F){let j=new Lt;return F.then(J=>{j.fire(J)},()=>{j.fire(void 0)}).finally(()=>{j.dispose()}),j.event}t.fromPromise=R;function D(F,j){return F(J=>j.fire(J))}t.forward=D;function k(F,j,J){return j(J),F(te=>j(te))}t.runAndSubscribe=k;class N{constructor(j,J){this._observable=j,this._counter=0,this._hasChanged=!1;let te={onWillAddFirstListener:()=>{j.addObserver(this)},onDidRemoveLastListener:()=>{j.removeObserver(this)}};this.emitter=new Lt(te),J&&J.add(this.emitter)}beginUpdate(j){this._counter++}handlePossibleChange(j){}handleChange(j,J){this._hasChanged=!0}endUpdate(j){this._counter--,this._counter===0&&(this._observable.reportChanges(),this._hasChanged&&(this._hasChanged=!1,this.emitter.fire(this._observable.get())))}}function W(F,j){return new N(F,j).emitter.event}t.fromObservable=W;function U(F){return(j,J,te)=>{let P=0,V=!1,Y={beginUpdate(){P++},endUpdate(){P--,P===0&&(F.reportChanges(),V&&(V=!1,j.call(J)))},handlePossibleChange(){},handleChange(){V=!0}};F.addObserver(Y),F.reportChanges();let B={dispose(){F.removeObserver(Y)}};return te instanceof Wa?te.add(B):Array.isArray(te)&&te.push(B),B}}t.fromObservableLight=U})(Dr||={});var Vf=class Xf{constructor(i){this.listenerCount=0,this.invocationCount=0,this.elapsedOverall=0,this.durations=[],this.name=`${i}_${Xf._idPool++}`,Xf.all.add(this)}start(i){this._stopWatch=new x5,this.listenerCount=i}stop(){if(this._stopWatch){let i=this._stopWatch.elapsed();this.durations.push(i),this.elapsedOverall+=i,this.invocationCount+=1,this._stopWatch=void 0}}};Vf.all=new Set,Vf._idPool=0;var E5=Vf,T5=-1,iy=class ny{constructor(i,r,a=(ny._idPool++).toString(16).padStart(3,"0")){this._errorHandler=i,this.threshold=r,this.name=a,this._warnCountdown=0}dispose(){this._stacks?.clear()}check(i,r){let a=this.threshold;if(a<=0||r<a)return;this._stacks||(this._stacks=new Map);let l=this._stacks.get(i.value)||0;if(this._stacks.set(i.value,l+1),this._warnCountdown-=1,this._warnCountdown<=0){this._warnCountdown=a*.5;let[v,m]=this.getMostFrequentStack(),c=`[${this.name}] potential listener LEAK detected, having ${r} listeners already. MOST frequent listener (${m}):`;console.warn(c),console.warn(v);let u=new R5(c,v);this._errorHandler(u)}return()=>{let v=this._stacks.get(i.value)||0;this._stacks.set(i.value,v-1)}}getMostFrequentStack(){if(!this._stacks)return;let i,r=0;for(let[a,l]of this._stacks)(!i||r<l)&&(i=[a,l],r=l);return i}};iy._idPool=1;var A5=iy,k5=class ry{constructor(i){this.value=i}static create(){let i=new Error;return new ry(i.stack??"")}print(){console.warn(this.value.split(`
|
|
17
|
+
`).slice(2).join(`
|
|
18
|
+
`))}},R5=class extends Error{constructor(t,i){super(t),this.name="ListenerLeakError",this.stack=i}},L5=class extends Error{constructor(t,i){super(t),this.name="ListenerRefusalError",this.stack=i}},M5=0,cf=class{constructor(i){this.value=i,this.id=M5++}},D5=2,O5,Lt=class{constructor(i){this._size=0,this._options=i,this._leakageMon=this._options?.leakWarningThreshold?new A5(i?.onListenerError??of,this._options?.leakWarningThreshold??T5):void 0,this._perfMon=this._options?._profName?new E5(this._options._profName):void 0,this._deliveryQueue=this._options?.deliveryQueue}dispose(){this._disposed||(this._disposed=!0,this._deliveryQueue?.current===this&&this._deliveryQueue.reset(),this._listeners&&(this._listeners=void 0,this._size=0),this._options?.onDidRemoveLastListener?.(),this._leakageMon?.dispose())}get event(){return this._event??=(i,r,a)=>{if(this._leakageMon&&this._size>this._leakageMon.threshold**2){let c=`[${this._leakageMon.name}] REFUSES to accept new listeners because it exceeded its threshold by far (${this._size} vs ${this._leakageMon.threshold})`;console.warn(c);let u=this._leakageMon.getMostFrequentStack()??["UNKNOWN stack",-1],h=new L5(`${c}. HINT: Stack shows most frequent listener (${u[1]}-times)`,u[0]);return(this._options?.onListenerError||of)(h),Un.None}if(this._disposed)return Un.None;r&&(i=i.bind(r));let l=new cf(i),v;this._leakageMon&&this._size>=Math.ceil(this._leakageMon.threshold*.2)&&(l.stack=k5.create(),v=this._leakageMon.check(l.stack,this._size+1)),this._listeners?this._listeners instanceof cf?(this._deliveryQueue??=new B5,this._listeners=[this._listeners,l]):this._listeners.push(l):(this._options?.onWillAddFirstListener?.(this),this._listeners=l,this._options?.onDidAddFirstListener?.(this)),this._size++;let m=Mi(()=>{v?.(),this._removeListener(l)});return a instanceof Wa?a.add(m):Array.isArray(a)&&a.push(m),m},this._event}_removeListener(i){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 r=this._listeners,a=r.indexOf(i);if(a===-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--,r[a]=void 0;let l=this._deliveryQueue.current===this;if(this._size*D5<=r.length){let v=0;for(let m=0;m<r.length;m++)r[m]?r[v++]=r[m]:l&&(this._deliveryQueue.end--,v<this._deliveryQueue.i&&this._deliveryQueue.i--);r.length=v}}_deliver(i,r){if(!i)return;let a=this._options?.onListenerError||of;if(!a){i.value(r);return}try{i.value(r)}catch(l){a(l)}}_deliverQueue(i){let r=i.current._listeners;for(;i.i<i.end;)this._deliver(r[i.i++],i.value);i.reset()}fire(i){if(this._deliveryQueue?.current&&(this._deliverQueue(this._deliveryQueue),this._perfMon?.stop()),this._perfMon?.start(this._size),this._listeners)if(this._listeners instanceof cf)this._deliver(this._listeners,i);else{let r=this._deliveryQueue;r.enqueue(this,i,this._listeners.length),this._deliverQueue(r)}this._perfMon?.stop()}hasListeners(){return this._size>0}},B5=class{constructor(){this.i=-1,this.end=0}enqueue(t,i,r){this.i=0,this.end=r,this.current=t,this.value=i}reset(){this.i=this.end,this.current=void 0,this.value=void 0}},w0={texturePage:0,texturePosition:{x:0,y:0},texturePositionClipSpace:{x:0,y:0},offset:{x:0,y:0},size:{x:0,y:0},sizeClipSpace:{x:0,y:0}},Jo=2,Qo,hs=class za{constructor(i,r,a){this._document=i,this._config=r,this._unicodeService=a,this._didWarmUp=!1,this._cacheMap=new C0,this._cacheMapCombined=new C0,this._pages=[],this._activePages=[],this._workBoundingBox={top:0,left:0,bottom:0,right:0},this._workAttributeData=new Ua,this._textureSize=512,this._onAddTextureAtlasCanvas=new Lt,this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event,this._onRemoveTextureAtlasCanvas=new Lt,this.onRemoveTextureAtlasCanvas=this._onRemoveTextureAtlasCanvas.event,this._requestClearModel=!1,this._createNewPage(),this._tmpCanvas=sy(i,this._config.deviceCellWidth*4+Jo*2,this._config.deviceCellHeight+Jo*2),this._tmpCtx=ci(this._tmpCanvas.getContext("2d",{alpha:this._config.allowTransparency,willReadFrequently:!0}))}get pages(){return this._pages}dispose(){this._tmpCanvas.remove();for(let i of this.pages)i.canvas.remove();this._onAddTextureAtlasCanvas.dispose()}warmUp(){this._didWarmUp||(this._doWarmUp(),this._didWarmUp=!0)}_doWarmUp(){let i=new C5;for(let r=33;r<126;r++)i.enqueue(()=>{if(!this._cacheMap.get(r,0,0,0)){let a=this._drawToCache(r,0,0,0,!1,void 0);this._cacheMap.set(r,0,0,0,a)}})}beginFrame(){return this._requestClearModel}clearTexture(){if(!(this._pages[0].currentRow.x===0&&this._pages[0].currentRow.y===0)){for(let i of this._pages)i.clear();this._cacheMap.clear(),this._cacheMapCombined.clear(),this._didWarmUp=!1}}_createNewPage(){if(za.maxAtlasPages&&this._pages.length>=Math.max(4,za.maxAtlasPages)){let r=this._pages.filter(h=>h.canvas.width*2<=(za.maxTextureSize||4096)).sort((h,b)=>b.canvas.width!==h.canvas.width?b.canvas.width-h.canvas.width:b.percentageUsed-h.percentageUsed),a=-1,l=0;for(let h=0;h<r.length;h++)if(r[h].canvas.width!==l)a=h,l=r[h].canvas.width;else if(h-a===3)break;let v=r.slice(a,a+4),m=v.map(h=>h.glyphs[0].texturePage).sort((h,b)=>h>b?1:-1),c=this.pages.length-v.length,u=this._mergePages(v,c);u.version++;for(let h=m.length-1;h>=0;h--)this._deletePage(m[h]);this.pages.push(u),this._requestClearModel=!0,this._onAddTextureAtlasCanvas.fire(u.canvas)}let i=new uf(this._document,this._textureSize);return this._pages.push(i),this._activePages.push(i),this._onAddTextureAtlasCanvas.fire(i.canvas),i}_mergePages(i,r){let a=i[0].canvas.width*2,l=new uf(this._document,a,i);for(let[v,m]of i.entries()){let c=v*m.canvas.width%a,u=Math.floor(v/2)*m.canvas.height;l.ctx.drawImage(m.canvas,c,u);for(let b of m.glyphs)b.texturePage=r,b.sizeClipSpace.x=b.size.x/a,b.sizeClipSpace.y=b.size.y/a,b.texturePosition.x+=c,b.texturePosition.y+=u,b.texturePositionClipSpace.x=b.texturePosition.x/a,b.texturePositionClipSpace.y=b.texturePosition.y/a;this._onRemoveTextureAtlasCanvas.fire(m.canvas);let h=this._activePages.indexOf(m);h!==-1&&this._activePages.splice(h,1)}return l}_deletePage(i){this._pages.splice(i,1);for(let r=i;r<this._pages.length;r++){let a=this._pages[r];for(let l of a.glyphs)l.texturePage--;a.version++}}getRasterizedGlyphCombinedChar(i,r,a,l,v,m){return this._getFromCacheMap(this._cacheMapCombined,i,r,a,l,v,m)}getRasterizedGlyph(i,r,a,l,v,m){return this._getFromCacheMap(this._cacheMap,i,r,a,l,v,m)}_getFromCacheMap(i,r,a,l,v,m,c){return Qo=i.get(r,a,l,v),Qo||(Qo=this._drawToCache(r,a,l,v,m,c),i.set(r,a,l,v,Qo)),Qo}_getColorFromAnsiIndex(i){if(i>=this._config.colors.ansi.length)throw new Error("No color found for idx "+i);return this._config.colors.ansi[i]}_getBackgroundColor(i,r,a,l){if(this._config.allowTransparency)return xn;let v;switch(i){case 16777216:case 33554432:v=this._getColorFromAnsiIndex(r);break;case 50331648:let m=Ua.toColorRGB(r);v=Ni.toColor(m[0],m[1],m[2]);break;default:a?v=ll.opaque(this._config.colors.foreground):v=this._config.colors.background;break}return this._config.allowTransparency||(v=ll.opaque(v)),v}_getForegroundColor(i,r,a,l,v,m,c,u,h,b){let p=this._getMinimumContrastColor(i,r,a,l,v,m,c,h,u,b);if(p)return p;let C;switch(v){case 16777216:case 33554432:this._config.drawBoldTextInBrightColors&&h&&m<8&&(m+=8),C=this._getColorFromAnsiIndex(m);break;case 50331648:let w=Ua.toColorRGB(m);C=Ni.toColor(w[0],w[1],w[2]);break;default:c?C=this._config.colors.background:C=this._config.colors.foreground}return this._config.allowTransparency&&(C=ll.opaque(C)),u&&(C=ll.multiplyOpacity(C,h5)),C}_resolveBackgroundRgba(i,r,a){switch(i){case 16777216:case 33554432:return this._getColorFromAnsiIndex(r).rgba;case 50331648:return r<<8;default:return a?this._config.colors.foreground.rgba:this._config.colors.background.rgba}}_resolveForegroundRgba(i,r,a,l){switch(i){case 16777216:case 33554432:return this._config.drawBoldTextInBrightColors&&l&&r<8&&(r+=8),this._getColorFromAnsiIndex(r).rgba;case 50331648:return r<<8;default:return a?this._config.colors.background.rgba:this._config.colors.foreground.rgba}}_getMinimumContrastColor(i,r,a,l,v,m,c,u,h,b){if(this._config.minimumContrastRatio===1||b)return;let p=this._getContrastCache(h),C=p.getColor(i,l);if(C!==void 0)return C||void 0;let w=this._resolveBackgroundRgba(r,a,c),A=this._resolveForegroundRgba(v,m,c,u),x=Ps.ensureContrastRatio(w,A,this._config.minimumContrastRatio/(h?2:1));if(!x){p.setColor(i,l,null);return}let g=Ni.toColor(x>>24&255,x>>16&255,x>>8&255);return p.setColor(i,l,g),g}_getContrastCache(i){return i?this._config.colors.halfContrastCache:this._config.colors.contrastCache}_drawToCache(i,r,a,l,v,m){let c=typeof i=="number"?String.fromCharCode(i):i;m&&this._tmpCanvas.parentElement!==m&&(this._tmpCanvas.style.display="none",m.append(this._tmpCanvas));let u=Math.min(this._config.deviceCellWidth*Math.max(c.length,2)+Jo*2,this._config.deviceMaxTextureSize);this._tmpCanvas.width<u&&(this._tmpCanvas.width=u);let h=Math.min(this._config.deviceCellHeight+Jo*4,this._textureSize);if(this._tmpCanvas.height<h&&(this._tmpCanvas.height=h),this._tmpCtx.save(),this._workAttributeData.fg=a,this._workAttributeData.bg=r,this._workAttributeData.extended.ext=l,!!this._workAttributeData.isInvisible())return w0;let b=!!this._workAttributeData.isBold(),p=!!this._workAttributeData.isInverse(),C=!!this._workAttributeData.isDim(),w=!!this._workAttributeData.isItalic(),A=!!this._workAttributeData.isUnderline(),x=!!this._workAttributeData.isStrikethrough(),g=!!this._workAttributeData.isOverline(),y=this._workAttributeData.getFgColor(),f=this._workAttributeData.getFgColorMode(),_=this._workAttributeData.getBgColor(),E=this._workAttributeData.getBgColorMode();if(p){let z=y;y=_,_=z;let O=f;f=E,E=O}let L=this._getBackgroundColor(E,_,p,C);this._tmpCtx.globalCompositeOperation="copy",this._tmpCtx.fillStyle=L.css,this._tmpCtx.fillRect(0,0,this._tmpCanvas.width,this._tmpCanvas.height),this._tmpCtx.globalCompositeOperation="source-over";let R=b?this._config.fontWeightBold:this._config.fontWeight,D=w?"italic":"";this._tmpCtx.font=`${D} ${R} ${this._config.fontSize*this._config.devicePixelRatio}px ${this._config.fontFamily}`,this._tmpCtx.textBaseline=Yb;let k=c.length===1&&qp(c.charCodeAt(0)),N=c.length===1&&n5(c.charCodeAt(0)),W=this._getForegroundColor(r,E,_,a,f,y,p,C,b,Kb(c.charCodeAt(0)));this._tmpCtx.fillStyle=W.css;let U=N?0:Jo*2,F=!1;this._config.customGlyphs!==!1&&(F=g5(this._tmpCtx,c,U,U,this._config.deviceCellWidth,this._config.deviceCellHeight,this._config.fontSize,this._config.devicePixelRatio));let j=!k,J;if(typeof i=="number"?J=this._unicodeService.wcwidth(i):J=this._unicodeService.getStringCellWidth(i),A){this._tmpCtx.save();let z=Math.max(1,Math.floor(this._config.fontSize*this._config.devicePixelRatio/15)),O=z%2===1?.5:0;if(this._tmpCtx.lineWidth=z,this._workAttributeData.isUnderlineColorDefault())this._tmpCtx.strokeStyle=this._tmpCtx.fillStyle;else if(this._workAttributeData.isUnderlineColorRGB())j=!1,this._tmpCtx.strokeStyle=`rgb(${Ua.toColorRGB(this._workAttributeData.getUnderlineColor()).join(",")})`;else{j=!1;let Q=this._workAttributeData.getUnderlineColor();this._config.drawBoldTextInBrightColors&&this._workAttributeData.isBold()&&Q<8&&(Q+=8),this._tmpCtx.strokeStyle=this._getColorFromAnsiIndex(Q).css}this._tmpCtx.beginPath();let H=U,X=Math.ceil(U+this._config.deviceCharHeight)-O-(v?z*2:0),ae=X+z,ce=X+z*2,_e=this._workAttributeData.getUnderlineVariantOffset();for(let Q=0;Q<J;Q++){this._tmpCtx.save();let $=H+Q*this._config.deviceCellWidth,oe=H+(Q+1)*this._config.deviceCellWidth,ge=$+this._config.deviceCellWidth/2;switch(this._workAttributeData.extended.underlineStyle){case 2:this._tmpCtx.moveTo($,X),this._tmpCtx.lineTo(oe,X),this._tmpCtx.moveTo($,ce),this._tmpCtx.lineTo(oe,ce);break;case 3:let ye=z<=1?ce:Math.ceil(U+this._config.deviceCharHeight-z/2)-O,be=z<=1?X:Math.ceil(U+this._config.deviceCharHeight+z/2)-O,$e=new Path2D;$e.rect($,X,this._config.deviceCellWidth,ce-X),this._tmpCtx.clip($e),this._tmpCtx.moveTo($-this._config.deviceCellWidth/2,ae),this._tmpCtx.bezierCurveTo($-this._config.deviceCellWidth/2,be,$,be,$,ae),this._tmpCtx.bezierCurveTo($,ye,ge,ye,ge,ae),this._tmpCtx.bezierCurveTo(ge,be,oe,be,oe,ae),this._tmpCtx.bezierCurveTo(oe,ye,oe+this._config.deviceCellWidth/2,ye,oe+this._config.deviceCellWidth/2,ae);break;case 4:let Pe=_e===0?0:_e>=z?z*2-_e:z-_e;_e>=z||Pe===0?(this._tmpCtx.setLineDash([Math.round(z),Math.round(z)]),this._tmpCtx.moveTo($+Pe,X),this._tmpCtx.lineTo(oe,X)):(this._tmpCtx.setLineDash([Math.round(z),Math.round(z)]),this._tmpCtx.moveTo($,X),this._tmpCtx.lineTo($+Pe,X),this._tmpCtx.moveTo($+Pe+z,X),this._tmpCtx.lineTo(oe,X)),_e=c5(oe-$,z,_e);break;case 5:let Ye=.6,Ct=.3,Be=oe-$,Qt=Math.floor(Ye*Be),_i=Math.floor(Ct*Be),vi=Be-Qt-_i;this._tmpCtx.setLineDash([Qt,_i,vi]),this._tmpCtx.moveTo($,X),this._tmpCtx.lineTo(oe,X);break;default:this._tmpCtx.moveTo($,X),this._tmpCtx.lineTo(oe,X);break}this._tmpCtx.stroke(),this._tmpCtx.restore()}if(this._tmpCtx.restore(),!F&&this._config.fontSize>=12&&!this._config.allowTransparency&&c!==" "){this._tmpCtx.save(),this._tmpCtx.textBaseline="alphabetic";let Q=this._tmpCtx.measureText(c);if(this._tmpCtx.restore(),"actualBoundingBoxDescent"in Q&&Q.actualBoundingBoxDescent>0){this._tmpCtx.save();let $=new Path2D;$.rect(H,X-Math.ceil(z/2),this._config.deviceCellWidth*J,ce-X+Math.ceil(z/2)),this._tmpCtx.clip($),this._tmpCtx.lineWidth=this._config.devicePixelRatio*3,this._tmpCtx.strokeStyle=L.css,this._tmpCtx.strokeText(c,U,U+this._config.deviceCharHeight),this._tmpCtx.restore()}}}if(g){let z=Math.max(1,Math.floor(this._config.fontSize*this._config.devicePixelRatio/15)),O=z%2===1?.5:0;this._tmpCtx.lineWidth=z,this._tmpCtx.strokeStyle=this._tmpCtx.fillStyle,this._tmpCtx.beginPath(),this._tmpCtx.moveTo(U,U+O),this._tmpCtx.lineTo(U+this._config.deviceCharWidth*J,U+O),this._tmpCtx.stroke()}if(F||this._tmpCtx.fillText(c,U,U+this._config.deviceCharHeight),c==="_"&&!this._config.allowTransparency){let z=hf(this._tmpCtx.getImageData(U,U,this._config.deviceCellWidth,this._config.deviceCellHeight),L,W,j);if(z)for(let O=1;O<=5&&(this._tmpCtx.save(),this._tmpCtx.fillStyle=L.css,this._tmpCtx.fillRect(0,0,this._tmpCanvas.width,this._tmpCanvas.height),this._tmpCtx.restore(),this._tmpCtx.fillText(c,U,U+this._config.deviceCharHeight-O),z=hf(this._tmpCtx.getImageData(U,U,this._config.deviceCellWidth,this._config.deviceCellHeight),L,W,j),!!z);O++);}if(x){let z=Math.max(1,Math.floor(this._config.fontSize*this._config.devicePixelRatio/10)),O=this._tmpCtx.lineWidth%2===1?.5:0;this._tmpCtx.lineWidth=z,this._tmpCtx.strokeStyle=this._tmpCtx.fillStyle,this._tmpCtx.beginPath(),this._tmpCtx.moveTo(U,U+Math.floor(this._config.deviceCharHeight/2)-O),this._tmpCtx.lineTo(U+this._config.deviceCharWidth*J,U+Math.floor(this._config.deviceCharHeight/2)-O),this._tmpCtx.stroke()}this._tmpCtx.restore();let te=this._tmpCtx.getImageData(0,0,this._tmpCanvas.width,this._tmpCanvas.height),P;if(this._config.allowTransparency?P=N5(te):P=hf(te,L,W,j),P)return w0;let V=this._findGlyphBoundingBox(te,this._workBoundingBox,u,N,F,U),Y,B;for(;;){if(this._activePages.length===0){let z=this._createNewPage();Y=z,B=z.currentRow,B.height=V.size.y;break}Y=this._activePages[this._activePages.length-1],B=Y.currentRow;for(let z of this._activePages)V.size.y<=z.currentRow.height&&(Y=z,B=z.currentRow);for(let z=this._activePages.length-1;z>=0;z--)for(let O of this._activePages[z].fixedRows)O.height<=B.height&&V.size.y<=O.height&&(Y=this._activePages[z],B=O);if(V.size.x>this._textureSize){this._overflowSizePage||(this._overflowSizePage=new uf(this._document,this._config.deviceMaxTextureSize),this.pages.push(this._overflowSizePage),this._requestClearModel=!0,this._onAddTextureAtlasCanvas.fire(this._overflowSizePage.canvas)),Y=this._overflowSizePage,B=this._overflowSizePage.currentRow,B.x+V.size.x>=Y.canvas.width&&(B.x=0,B.y+=B.height,B.height=0);break}if(B.y+V.size.y>=Y.canvas.height||B.height>V.size.y+2){let z=!1;if(Y.currentRow.y+Y.currentRow.height+V.size.y>=Y.canvas.height){let O;for(let H of this._activePages)if(H.currentRow.y+H.currentRow.height+V.size.y<H.canvas.height){O=H;break}if(O)Y=O;else if(za.maxAtlasPages&&this._pages.length>=za.maxAtlasPages&&B.y+V.size.y<=Y.canvas.height&&B.height>=V.size.y&&B.x+V.size.x<=Y.canvas.width)z=!0;else{let H=this._createNewPage();Y=H,B=H.currentRow,B.height=V.size.y,z=!0}}z||(Y.currentRow.height>0&&Y.fixedRows.push(Y.currentRow),B={x:0,y:Y.currentRow.y+Y.currentRow.height,height:V.size.y},Y.fixedRows.push(B),Y.currentRow={x:0,y:B.y+B.height,height:0})}if(B.x+V.size.x<=Y.canvas.width)break;B===Y.currentRow?(B.x=0,B.y+=B.height,B.height=0):Y.fixedRows.splice(Y.fixedRows.indexOf(B),1)}return V.texturePage=this._pages.indexOf(Y),V.texturePosition.x=B.x,V.texturePosition.y=B.y,V.texturePositionClipSpace.x=B.x/Y.canvas.width,V.texturePositionClipSpace.y=B.y/Y.canvas.height,V.sizeClipSpace.x/=Y.canvas.width,V.sizeClipSpace.y/=Y.canvas.height,B.height=Math.max(B.height,V.size.y),B.x+=V.size.x,Y.ctx.putImageData(te,V.texturePosition.x-this._workBoundingBox.left,V.texturePosition.y-this._workBoundingBox.top,this._workBoundingBox.left,this._workBoundingBox.top,V.size.x,V.size.y),Y.addGlyph(V),Y.version++,V}_findGlyphBoundingBox(i,r,a,l,v,m){r.top=0;let c=l?this._config.deviceCellHeight:this._tmpCanvas.height,u=l?this._config.deviceCellWidth:a,h=!1;for(let b=0;b<c;b++){for(let p=0;p<u;p++){let C=b*this._tmpCanvas.width*4+p*4+3;if(i.data[C]!==0){r.top=b,h=!0;break}}if(h)break}r.left=0,h=!1;for(let b=0;b<m+u;b++){for(let p=0;p<c;p++){let C=p*this._tmpCanvas.width*4+b*4+3;if(i.data[C]!==0){r.left=b,h=!0;break}}if(h)break}r.right=u,h=!1;for(let b=m+u-1;b>=m;b--){for(let p=0;p<c;p++){let C=p*this._tmpCanvas.width*4+b*4+3;if(i.data[C]!==0){r.right=b,h=!0;break}}if(h)break}r.bottom=c,h=!1;for(let b=c-1;b>=0;b--){for(let p=0;p<u;p++){let C=b*this._tmpCanvas.width*4+p*4+3;if(i.data[C]!==0){r.bottom=b,h=!0;break}}if(h)break}return{texturePage:0,texturePosition:{x:0,y:0},texturePositionClipSpace:{x:0,y:0},size:{x:r.right-r.left+1,y:r.bottom-r.top+1},sizeClipSpace:{x:r.right-r.left+1,y:r.bottom-r.top+1},offset:{x:-r.left+m+(l||v?Math.floor((this._config.deviceCellWidth-this._config.deviceCharWidth)/2):0),y:-r.top+m+(l||v?this._config.lineHeight===1?0:Math.round((this._config.deviceCellHeight-this._config.deviceCharHeight)/2):0)}}}},uf=class{constructor(t,i,r){if(this._usedPixels=0,this._glyphs=[],this.version=0,this.currentRow={x:0,y:0,height:0},this.fixedRows=[],r)for(let a of r)this._glyphs.push(...a.glyphs),this._usedPixels+=a._usedPixels;this.canvas=sy(t,i,i),this.ctx=ci(this.canvas.getContext("2d",{alpha:!0}))}get percentageUsed(){return this._usedPixels/(this.canvas.width*this.canvas.height)}get glyphs(){return this._glyphs}addGlyph(t){this._glyphs.push(t),this._usedPixels+=t.size.x*t.size.y}clear(){this.ctx.clearRect(0,0,this.canvas.width,this.canvas.height),this.currentRow.x=0,this.currentRow.y=0,this.currentRow.height=0,this.fixedRows.length=0,this.version++}};function hf(t,i,r,a){let l=i.rgba>>>24,v=i.rgba>>>16&255,m=i.rgba>>>8&255,c=r.rgba>>>24,u=r.rgba>>>16&255,h=r.rgba>>>8&255,b=Math.floor((Math.abs(l-c)+Math.abs(v-u)+Math.abs(m-h))/12),p=!0;for(let C=0;C<t.data.length;C+=4)t.data[C]===l&&t.data[C+1]===v&&t.data[C+2]===m||a&&Math.abs(t.data[C]-l)+Math.abs(t.data[C+1]-v)+Math.abs(t.data[C+2]-m)<b?t.data[C+3]=0:p=!1;return p}function N5(t){for(let i=0;i<t.data.length;i+=4)if(t.data[i+3]>0)return!1;return!0}function sy(t,i,r){let a=t.createElement("canvas");return a.width=i,a.height=r,a}function I5(t,i,r,a,l,v,m,c){let u={foreground:v.foreground,background:v.background,cursor:xn,cursorAccent:xn,selectionForeground:xn,selectionBackgroundTransparent:xn,selectionBackgroundOpaque:xn,selectionInactiveBackgroundTransparent:xn,selectionInactiveBackgroundOpaque:xn,overviewRulerBorder:xn,scrollbarSliderBackground:xn,scrollbarSliderHoverBackground:xn,scrollbarSliderActiveBackground:xn,ansi:v.ansi.slice(),contrastCache:v.contrastCache,halfContrastCache:v.halfContrastCache};return{customGlyphs:l.customGlyphs,devicePixelRatio:m,deviceMaxTextureSize:c,letterSpacing:l.letterSpacing,lineHeight:l.lineHeight,deviceCellWidth:t,deviceCellHeight:i,deviceCharWidth:r,deviceCharHeight:a,fontFamily:l.fontFamily,fontSize:l.fontSize,fontWeight:l.fontWeight,fontWeightBold:l.fontWeightBold,allowTransparency:l.allowTransparency,drawBoldTextInBrightColors:l.drawBoldTextInBrightColors,minimumContrastRatio:l.minimumContrastRatio,colors:u}}function x0(t,i){for(let r=0;r<t.colors.ansi.length;r++)if(t.colors.ansi[r].rgba!==i.colors.ansi[r].rgba)return!1;return t.devicePixelRatio===i.devicePixelRatio&&t.customGlyphs===i.customGlyphs&&t.lineHeight===i.lineHeight&&t.letterSpacing===i.letterSpacing&&t.fontFamily===i.fontFamily&&t.fontSize===i.fontSize&&t.fontWeight===i.fontWeight&&t.fontWeightBold===i.fontWeightBold&&t.allowTransparency===i.allowTransparency&&t.deviceCharWidth===i.deviceCharWidth&&t.deviceCharHeight===i.deviceCharHeight&&t.drawBoldTextInBrightColors===i.drawBoldTextInBrightColors&&t.minimumContrastRatio===i.minimumContrastRatio&&t.colors.foreground.rgba===i.colors.foreground.rgba&&t.colors.background.rgba===i.colors.background.rgba}function j5(t){return(t&50331648)===16777216||(t&50331648)===33554432}var An=[];function ay(t,i,r,a,l,v,m,c,u){let h=I5(a,l,v,m,i,r,c,u);for(let C=0;C<An.length;C++){let w=An[C],A=w.ownedBy.indexOf(t);if(A>=0){if(x0(w.config,h))return w.atlas;w.ownedBy.length===1?(w.atlas.dispose(),An.splice(C,1)):w.ownedBy.splice(A,1);break}}for(let C=0;C<An.length;C++){let w=An[C];if(x0(w.config,h))return w.ownedBy.push(t),w.atlas}let b=t._core,p={atlas:new hs(document,h,b.unicodeService),config:h,ownedBy:[t]};return An.push(p),p.atlas}function E0(t){for(let i=0;i<An.length;i++){let r=An[i].ownedBy.indexOf(t);if(r!==-1){An[i].ownedBy.length===1?(An[i].atlas.dispose(),An.splice(i,1)):An[i].ownedBy.splice(r,1);break}}}var Gc=600,z5=class{constructor(t,i){this._renderCallback=t,this._coreBrowserService=i,this.isCursorVisible=!0,this._coreBrowserService.isFocused&&this._restartInterval()}get isPaused(){return!(this._blinkStartTimeout||this._blinkInterval)}dispose(){this._blinkInterval&&(this._coreBrowserService.window.clearInterval(this._blinkInterval),this._blinkInterval=void 0),this._blinkStartTimeout&&(this._coreBrowserService.window.clearTimeout(this._blinkStartTimeout),this._blinkStartTimeout=void 0),this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}restartBlinkAnimation(){this.isPaused||(this._animationTimeRestarted=Date.now(),this.isCursorVisible=!0,this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>{this._renderCallback(),this._animationFrame=void 0})))}_restartInterval(t=Gc){this._blinkInterval&&(this._coreBrowserService.window.clearInterval(this._blinkInterval),this._blinkInterval=void 0),this._blinkStartTimeout=this._coreBrowserService.window.setTimeout(()=>{if(this._animationTimeRestarted){let i=Gc-(Date.now()-this._animationTimeRestarted);if(this._animationTimeRestarted=void 0,i>0){this._restartInterval(i);return}}this.isCursorVisible=!1,this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>{this._renderCallback(),this._animationFrame=void 0}),this._blinkInterval=this._coreBrowserService.window.setInterval(()=>{if(this._animationTimeRestarted){let i=Gc-(Date.now()-this._animationTimeRestarted);this._animationTimeRestarted=void 0,this._restartInterval(i);return}this.isCursorVisible=!this.isCursorVisible,this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>{this._renderCallback(),this._animationFrame=void 0})},Gc)},t)}pause(){this.isCursorVisible=!0,this._blinkInterval&&(this._coreBrowserService.window.clearInterval(this._blinkInterval),this._blinkInterval=void 0),this._blinkStartTimeout&&(this._coreBrowserService.window.clearTimeout(this._blinkStartTimeout),this._blinkStartTimeout=void 0),this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}resume(){this.pause(),this._animationTimeRestarted=void 0,this._restartInterval(),this.restartBlinkAnimation()}};function T0(t,i,r){let a=new i.ResizeObserver(l=>{let v=l.find(u=>u.target===t);if(!v)return;if(!("devicePixelContentBoxSize"in v)){a?.disconnect(),a=void 0;return}let m=v.devicePixelContentBoxSize[0].inlineSize,c=v.devicePixelContentBoxSize[0].blockSize;m>0&&c>0&&r(m,c)});try{a.observe(t,{box:["device-pixel-content-box"]})}catch{a.disconnect(),a=void 0}return Mi(()=>a?.disconnect())}function $5(t){return t>65535?(t-=65536,String.fromCharCode((t>>10)+55296)+String.fromCharCode(t%1024+56320)):String.fromCharCode(t)}var A0=class oy extends Ua{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new Qb,this.combinedData=""}static fromCharData(i){let r=new oy;return r.setFromCharData(i),r}isCombined(){return this.content&2097152}getWidth(){return this.content>>22}getChars(){return this.content&2097152?this.combinedData:this.content&2097151?$5(this.content&2097151):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):this.content&2097151}setFromCharData(i){this.fg=i[0],this.bg=0;let r=!1;if(i[1].length>2)r=!0;else if(i[1].length===2){let a=i[1].charCodeAt(0);if(55296<=a&&a<=56319){let l=i[1].charCodeAt(1);56320<=l&&l<=57343?this.content=(a-55296)*1024+l-56320+65536|i[2]<<22:r=!0}else r=!0}else this.content=i[1].charCodeAt(0)|i[2]<<22;r&&(this.combinedData=i[1],this.content=2097152|i[2]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}},ly=new Float32Array([2,0,0,0,0,-2,0,0,0,0,1,0,-1,1,0,1]);function cy(t,i,r){let a=ci(t.createProgram());if(t.attachShader(a,ci(k0(t,t.VERTEX_SHADER,i))),t.attachShader(a,ci(k0(t,t.FRAGMENT_SHADER,r))),t.linkProgram(a),t.getProgramParameter(a,t.LINK_STATUS))return a;console.error(t.getProgramInfoLog(a)),t.deleteProgram(a)}function k0(t,i,r){let a=ci(t.createShader(i));if(t.shaderSource(a,r),t.compileShader(a),t.getShaderParameter(a,t.COMPILE_STATUS))return a;console.error(t.getShaderInfoLog(a)),t.deleteShader(a)}function H5(t,i){let r=Math.min(t.length*2,i),a=new Float32Array(r);for(let l=0;l<t.length;l++)a[l]=t[l];return a}var U5=class{constructor(t){this.texture=t,this.version=-1}},P5=`#version 300 es
|
|
19
|
+
layout (location = 0) in vec2 a_unitquad;
|
|
20
|
+
layout (location = 1) in vec2 a_cellpos;
|
|
21
|
+
layout (location = 2) in vec2 a_offset;
|
|
22
|
+
layout (location = 3) in vec2 a_size;
|
|
23
|
+
layout (location = 4) in float a_texpage;
|
|
24
|
+
layout (location = 5) in vec2 a_texcoord;
|
|
25
|
+
layout (location = 6) in vec2 a_texsize;
|
|
26
|
+
|
|
27
|
+
uniform mat4 u_projection;
|
|
28
|
+
uniform vec2 u_resolution;
|
|
29
|
+
|
|
30
|
+
out vec2 v_texcoord;
|
|
31
|
+
flat out int v_texpage;
|
|
32
|
+
|
|
33
|
+
void main() {
|
|
34
|
+
vec2 zeroToOne = (a_offset / u_resolution) + a_cellpos + (a_unitquad * a_size);
|
|
35
|
+
gl_Position = u_projection * vec4(zeroToOne, 0.0, 1.0);
|
|
36
|
+
v_texpage = int(a_texpage);
|
|
37
|
+
v_texcoord = a_texcoord + a_unitquad * a_texsize;
|
|
38
|
+
}`;function F5(t){let i="";for(let r=1;r<t;r++)i+=` else if (v_texpage == ${r}) { outColor = texture(u_texture[${r}], v_texcoord); }`;return`#version 300 es
|
|
39
|
+
precision lowp float;
|
|
40
|
+
|
|
41
|
+
in vec2 v_texcoord;
|
|
42
|
+
flat in int v_texpage;
|
|
43
|
+
|
|
44
|
+
uniform sampler2D u_texture[${t}];
|
|
45
|
+
|
|
46
|
+
out vec4 outColor;
|
|
47
|
+
|
|
48
|
+
void main() {
|
|
49
|
+
if (v_texpage == 0) {
|
|
50
|
+
outColor = texture(u_texture[0], v_texcoord);
|
|
51
|
+
} ${i}
|
|
52
|
+
}`}var ds=11,Ba=ds*Float32Array.BYTES_PER_ELEMENT,q5=2,qt=0,Rt,df=0,el=0,W5=class extends Un{constructor(t,i,r,a){super(),this._terminal=t,this._gl=i,this._dimensions=r,this._optionsService=a,this._activeBuffer=0,this._vertices={count:0,attributes:new Float32Array(0),attributesBuffers:[new Float32Array(0),new Float32Array(0)]};let l=this._gl;hs.maxAtlasPages===void 0&&(hs.maxAtlasPages=Math.min(32,ci(l.getParameter(l.MAX_TEXTURE_IMAGE_UNITS))),hs.maxTextureSize=ci(l.getParameter(l.MAX_TEXTURE_SIZE))),this._program=ci(cy(l,P5,F5(hs.maxAtlasPages))),this._register(Mi(()=>l.deleteProgram(this._program))),this._projectionLocation=ci(l.getUniformLocation(this._program,"u_projection")),this._resolutionLocation=ci(l.getUniformLocation(this._program,"u_resolution")),this._textureLocation=ci(l.getUniformLocation(this._program,"u_texture")),this._vertexArrayObject=l.createVertexArray(),l.bindVertexArray(this._vertexArrayObject);let v=new Float32Array([0,0,1,0,0,1,1,1]),m=l.createBuffer();this._register(Mi(()=>l.deleteBuffer(m))),l.bindBuffer(l.ARRAY_BUFFER,m),l.bufferData(l.ARRAY_BUFFER,v,l.STATIC_DRAW),l.enableVertexAttribArray(0),l.vertexAttribPointer(0,2,this._gl.FLOAT,!1,0,0);let c=new Uint8Array([0,1,2,3]),u=l.createBuffer();this._register(Mi(()=>l.deleteBuffer(u))),l.bindBuffer(l.ELEMENT_ARRAY_BUFFER,u),l.bufferData(l.ELEMENT_ARRAY_BUFFER,c,l.STATIC_DRAW),this._attributesBuffer=ci(l.createBuffer()),this._register(Mi(()=>l.deleteBuffer(this._attributesBuffer))),l.bindBuffer(l.ARRAY_BUFFER,this._attributesBuffer),l.enableVertexAttribArray(2),l.vertexAttribPointer(2,2,l.FLOAT,!1,Ba,0),l.vertexAttribDivisor(2,1),l.enableVertexAttribArray(3),l.vertexAttribPointer(3,2,l.FLOAT,!1,Ba,2*Float32Array.BYTES_PER_ELEMENT),l.vertexAttribDivisor(3,1),l.enableVertexAttribArray(4),l.vertexAttribPointer(4,1,l.FLOAT,!1,Ba,4*Float32Array.BYTES_PER_ELEMENT),l.vertexAttribDivisor(4,1),l.enableVertexAttribArray(5),l.vertexAttribPointer(5,2,l.FLOAT,!1,Ba,5*Float32Array.BYTES_PER_ELEMENT),l.vertexAttribDivisor(5,1),l.enableVertexAttribArray(6),l.vertexAttribPointer(6,2,l.FLOAT,!1,Ba,7*Float32Array.BYTES_PER_ELEMENT),l.vertexAttribDivisor(6,1),l.enableVertexAttribArray(1),l.vertexAttribPointer(1,2,l.FLOAT,!1,Ba,9*Float32Array.BYTES_PER_ELEMENT),l.vertexAttribDivisor(1,1),l.useProgram(this._program);let h=new Int32Array(hs.maxAtlasPages);for(let b=0;b<hs.maxAtlasPages;b++)h[b]=b;l.uniform1iv(this._textureLocation,h),l.uniformMatrix4fv(this._projectionLocation,!1,ly),this._atlasTextures=[];for(let b=0;b<hs.maxAtlasPages;b++){let p=new U5(ci(l.createTexture()));this._register(Mi(()=>l.deleteTexture(p.texture))),l.activeTexture(l.TEXTURE0+b),l.bindTexture(l.TEXTURE_2D,p.texture),l.texParameteri(l.TEXTURE_2D,l.TEXTURE_WRAP_S,l.CLAMP_TO_EDGE),l.texParameteri(l.TEXTURE_2D,l.TEXTURE_WRAP_T,l.CLAMP_TO_EDGE),l.texImage2D(l.TEXTURE_2D,0,l.RGBA,1,1,0,l.RGBA,l.UNSIGNED_BYTE,new Uint8Array([255,0,0,255])),this._atlasTextures[b]=p}l.enable(l.BLEND),l.blendFunc(l.SRC_ALPHA,l.ONE_MINUS_SRC_ALPHA),this.handleResize()}beginFrame(){return this._atlas?this._atlas.beginFrame():!0}updateCell(t,i,r,a,l,v,m,c,u){this._updateCell(this._vertices.attributes,t,i,r,a,l,v,m,c,u)}_updateCell(t,i,r,a,l,v,m,c,u,h){if(qt=(r*this._terminal.cols+i)*ds,a===0||a===void 0){t.fill(0,qt,qt+ds-1-q5);return}this._atlas&&(c&&c.length>1?Rt=this._atlas.getRasterizedGlyphCombinedChar(c,l,v,m,!1,this._terminal.element):Rt=this._atlas.getRasterizedGlyph(a,l,v,m,!1,this._terminal.element),df=Math.floor((this._dimensions.device.cell.width-this._dimensions.device.char.width)/2),l!==h&&Rt.offset.x>df?(el=Rt.offset.x-df,t[qt]=-(Rt.offset.x-el)+this._dimensions.device.char.left,t[qt+1]=-Rt.offset.y+this._dimensions.device.char.top,t[qt+2]=(Rt.size.x-el)/this._dimensions.device.canvas.width,t[qt+3]=Rt.size.y/this._dimensions.device.canvas.height,t[qt+4]=Rt.texturePage,t[qt+5]=Rt.texturePositionClipSpace.x+el/this._atlas.pages[Rt.texturePage].canvas.width,t[qt+6]=Rt.texturePositionClipSpace.y,t[qt+7]=Rt.sizeClipSpace.x-el/this._atlas.pages[Rt.texturePage].canvas.width,t[qt+8]=Rt.sizeClipSpace.y):(t[qt]=-Rt.offset.x+this._dimensions.device.char.left,t[qt+1]=-Rt.offset.y+this._dimensions.device.char.top,t[qt+2]=Rt.size.x/this._dimensions.device.canvas.width,t[qt+3]=Rt.size.y/this._dimensions.device.canvas.height,t[qt+4]=Rt.texturePage,t[qt+5]=Rt.texturePositionClipSpace.x,t[qt+6]=Rt.texturePositionClipSpace.y,t[qt+7]=Rt.sizeClipSpace.x,t[qt+8]=Rt.sizeClipSpace.y),this._optionsService.rawOptions.rescaleOverlappingGlyphs&&o5(a,u,Rt.size.x,this._dimensions.device.cell.width)&&(t[qt+2]=(this._dimensions.device.cell.width-1)/this._dimensions.device.canvas.width))}clear(){let t=this._terminal,i=t.cols*t.rows*ds;this._vertices.count!==i?this._vertices.attributes=new Float32Array(i):this._vertices.attributes.fill(0);let r=0;for(;r<this._vertices.attributesBuffers.length;r++)this._vertices.count!==i?this._vertices.attributesBuffers[r]=new Float32Array(i):this._vertices.attributesBuffers[r].fill(0);this._vertices.count=i,r=0;for(let a=0;a<t.rows;a++)for(let l=0;l<t.cols;l++)this._vertices.attributes[r+9]=l/t.cols,this._vertices.attributes[r+10]=a/t.rows,r+=ds}handleResize(){let t=this._gl;t.useProgram(this._program),t.viewport(0,0,t.canvas.width,t.canvas.height),t.uniform2f(this._resolutionLocation,t.canvas.width,t.canvas.height),this.clear()}render(t){if(!this._atlas)return;let i=this._gl;i.useProgram(this._program),i.bindVertexArray(this._vertexArrayObject),this._activeBuffer=(this._activeBuffer+1)%2;let r=this._vertices.attributesBuffers[this._activeBuffer],a=0;for(let l=0;l<t.lineLengths.length;l++){let v=l*this._terminal.cols*ds,m=this._vertices.attributes.subarray(v,v+t.lineLengths[l]*ds);r.set(m,a),a+=m.length}i.bindBuffer(i.ARRAY_BUFFER,this._attributesBuffer),i.bufferData(i.ARRAY_BUFFER,r.subarray(0,a),i.STREAM_DRAW);for(let l=0;l<this._atlas.pages.length;l++)this._atlas.pages[l].version!==this._atlasTextures[l].version&&this._bindAtlasPageTexture(i,this._atlas,l);i.drawElementsInstanced(i.TRIANGLE_STRIP,4,i.UNSIGNED_BYTE,0,a/ds)}setAtlas(t){this._atlas=t;for(let i of this._atlasTextures)i.version=-1}_bindAtlasPageTexture(t,i,r){t.activeTexture(t.TEXTURE0+r),t.bindTexture(t.TEXTURE_2D,this._atlasTextures[r].texture),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,t.RGBA,t.UNSIGNED_BYTE,i.pages[r].canvas),t.generateMipmap(t.TEXTURE_2D),this._atlasTextures[r].version=i.pages[r].version}setDimensions(t){this._dimensions=t}},G5=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(t,i,r,a=!1){if(this.selectionStart=i,this.selectionEnd=r,!i||!r||i[0]===r[0]&&i[1]===r[1]){this.clear();return}let l=t.buffers.active.ydisp,v=i[1]-l,m=r[1]-l,c=Math.max(v,0),u=Math.min(m,t.rows-1);if(c>=t.rows||u<0){this.clear();return}this.hasSelection=!0,this.columnSelectMode=a,this.viewportStartRow=v,this.viewportEndRow=m,this.viewportCappedStartRow=c,this.viewportCappedEndRow=u,this.startCol=i[0],this.endCol=r[0]}isCellSelected(t,i,r){return this.hasSelection?(r-=t.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?i>=this.startCol&&r>=this.viewportCappedStartRow&&i<this.endCol&&r<=this.viewportCappedEndRow:i<this.startCol&&r>=this.viewportCappedStartRow&&i>=this.endCol&&r<=this.viewportCappedEndRow:r>this.viewportStartRow&&r<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&r===this.viewportStartRow&&i>=this.startCol&&i<this.endCol||this.viewportStartRow<this.viewportEndRow&&r===this.viewportEndRow&&i<this.endCol||this.viewportStartRow<this.viewportEndRow&&r===this.viewportStartRow&&i>=this.startCol):!1}};function K5(){return new G5}var vu=4,au=1,ou=2,ff=3,Y5=2147483648,V5=class{constructor(){this.cells=new Uint32Array(0),this.lineLengths=new Uint32Array(0),this.selection=K5()}resize(t,i){let r=t*i*vu;r!==this.cells.length&&(this.cells=new Uint32Array(r),this.lineLengths=new Uint32Array(i))}clear(){this.cells.fill(0,0),this.lineLengths.fill(0,0)}},X5=`#version 300 es
|
|
53
|
+
layout (location = 0) in vec2 a_position;
|
|
54
|
+
layout (location = 1) in vec2 a_size;
|
|
55
|
+
layout (location = 2) in vec4 a_color;
|
|
56
|
+
layout (location = 3) in vec2 a_unitquad;
|
|
57
|
+
|
|
58
|
+
uniform mat4 u_projection;
|
|
59
|
+
|
|
60
|
+
out vec4 v_color;
|
|
61
|
+
|
|
62
|
+
void main() {
|
|
63
|
+
vec2 zeroToOne = a_position + (a_unitquad * a_size);
|
|
64
|
+
gl_Position = u_projection * vec4(zeroToOne, 0.0, 1.0);
|
|
65
|
+
v_color = a_color;
|
|
66
|
+
}`,Z5=`#version 300 es
|
|
67
|
+
precision lowp float;
|
|
68
|
+
|
|
69
|
+
in vec4 v_color;
|
|
70
|
+
|
|
71
|
+
out vec4 outColor;
|
|
72
|
+
|
|
73
|
+
void main() {
|
|
74
|
+
outColor = v_color;
|
|
75
|
+
}`,Mr=8,pf=Mr*Float32Array.BYTES_PER_ELEMENT,J5=20*Mr,R0=class{constructor(){this.attributes=new Float32Array(J5),this.count=0}},kr=0,L0=0,M0=0,D0=0,O0=0,B0=0,N0=0,Q5=class extends Un{constructor(t,i,r,a){super(),this._terminal=t,this._gl=i,this._dimensions=r,this._themeService=a,this._vertices=new R0,this._verticesCursor=new R0;let l=this._gl;this._program=ci(cy(l,X5,Z5)),this._register(Mi(()=>l.deleteProgram(this._program))),this._projectionLocation=ci(l.getUniformLocation(this._program,"u_projection")),this._vertexArrayObject=l.createVertexArray(),l.bindVertexArray(this._vertexArrayObject);let v=new Float32Array([0,0,1,0,0,1,1,1]),m=l.createBuffer();this._register(Mi(()=>l.deleteBuffer(m))),l.bindBuffer(l.ARRAY_BUFFER,m),l.bufferData(l.ARRAY_BUFFER,v,l.STATIC_DRAW),l.enableVertexAttribArray(3),l.vertexAttribPointer(3,2,this._gl.FLOAT,!1,0,0);let c=new Uint8Array([0,1,2,3]),u=l.createBuffer();this._register(Mi(()=>l.deleteBuffer(u))),l.bindBuffer(l.ELEMENT_ARRAY_BUFFER,u),l.bufferData(l.ELEMENT_ARRAY_BUFFER,c,l.STATIC_DRAW),this._attributesBuffer=ci(l.createBuffer()),this._register(Mi(()=>l.deleteBuffer(this._attributesBuffer))),l.bindBuffer(l.ARRAY_BUFFER,this._attributesBuffer),l.enableVertexAttribArray(0),l.vertexAttribPointer(0,2,l.FLOAT,!1,pf,0),l.vertexAttribDivisor(0,1),l.enableVertexAttribArray(1),l.vertexAttribPointer(1,2,l.FLOAT,!1,pf,2*Float32Array.BYTES_PER_ELEMENT),l.vertexAttribDivisor(1,1),l.enableVertexAttribArray(2),l.vertexAttribPointer(2,4,l.FLOAT,!1,pf,4*Float32Array.BYTES_PER_ELEMENT),l.vertexAttribDivisor(2,1),this._updateCachedColors(a.colors),this._register(this._themeService.onChangeColors(h=>{this._updateCachedColors(h),this._updateViewportRectangle()}))}renderBackgrounds(){this._renderVertices(this._vertices)}renderCursor(){this._renderVertices(this._verticesCursor)}_renderVertices(t){let i=this._gl;i.useProgram(this._program),i.bindVertexArray(this._vertexArrayObject),i.uniformMatrix4fv(this._projectionLocation,!1,ly),i.bindBuffer(i.ARRAY_BUFFER,this._attributesBuffer),i.bufferData(i.ARRAY_BUFFER,t.attributes,i.DYNAMIC_DRAW),i.drawElementsInstanced(this._gl.TRIANGLE_STRIP,4,i.UNSIGNED_BYTE,0,t.count)}handleResize(){this._updateViewportRectangle()}setDimensions(t){this._dimensions=t}_updateCachedColors(t){this._bgFloat=this._colorToFloat32Array(t.background),this._cursorFloat=this._colorToFloat32Array(t.cursor)}_updateViewportRectangle(){this._addRectangleFloat(this._vertices.attributes,0,0,0,this._terminal.cols*this._dimensions.device.cell.width,this._terminal.rows*this._dimensions.device.cell.height,this._bgFloat)}updateBackgrounds(t){let i=this._terminal,r=this._vertices,a=1,l,v,m,c,u,h,b,p,C,w,A;for(l=0;l<i.rows;l++){for(m=-1,c=0,u=0,h=!1,v=0;v<i.cols;v++)b=(l*i.cols+v)*vu,p=t.cells[b+au],C=t.cells[b+ou],w=!!(C&67108864),(p!==c||C!==u&&(h||w))&&((c!==0||h&&u!==0)&&(A=a++*Mr,this._updateRectangle(r,A,u,c,m,v,l)),m=v,c=p,u=C,h=w);(c!==0||h&&u!==0)&&(A=a++*Mr,this._updateRectangle(r,A,u,c,m,i.cols,l))}r.count=a}updateCursor(t){let i=this._verticesCursor,r=t.cursor;if(!r||r.style==="block"){i.count=0;return}let a,l=0;(r.style==="bar"||r.style==="outline")&&(a=l++*Mr,this._addRectangleFloat(i.attributes,a,r.x*this._dimensions.device.cell.width,r.y*this._dimensions.device.cell.height,r.style==="bar"?r.dpr*r.cursorWidth:r.dpr,this._dimensions.device.cell.height,this._cursorFloat)),(r.style==="underline"||r.style==="outline")&&(a=l++*Mr,this._addRectangleFloat(i.attributes,a,r.x*this._dimensions.device.cell.width,(r.y+1)*this._dimensions.device.cell.height-r.dpr,r.width*this._dimensions.device.cell.width,r.dpr,this._cursorFloat)),r.style==="outline"&&(a=l++*Mr,this._addRectangleFloat(i.attributes,a,r.x*this._dimensions.device.cell.width,r.y*this._dimensions.device.cell.height,r.width*this._dimensions.device.cell.width,r.dpr,this._cursorFloat),a=l++*Mr,this._addRectangleFloat(i.attributes,a,(r.x+r.width)*this._dimensions.device.cell.width-r.dpr,r.y*this._dimensions.device.cell.height,r.dpr,this._dimensions.device.cell.height,this._cursorFloat)),i.count=l}_updateRectangle(t,i,r,a,l,v,m){if(r&67108864)switch(r&50331648){case 16777216:case 33554432:kr=this._themeService.colors.ansi[r&255].rgba;break;case 50331648:kr=(r&16777215)<<8;break;default:kr=this._themeService.colors.foreground.rgba}else switch(a&50331648){case 16777216:case 33554432:kr=this._themeService.colors.ansi[a&255].rgba;break;case 50331648:kr=(a&16777215)<<8;break;default:kr=this._themeService.colors.background.rgba}t.attributes.length<i+4&&(t.attributes=H5(t.attributes,this._terminal.rows*this._terminal.cols*Mr)),L0=l*this._dimensions.device.cell.width,M0=m*this._dimensions.device.cell.height,D0=(kr>>24&255)/255,O0=(kr>>16&255)/255,B0=(kr>>8&255)/255,N0=1,this._addRectangle(t.attributes,i,L0,M0,(v-l)*this._dimensions.device.cell.width,this._dimensions.device.cell.height,D0,O0,B0,N0)}_addRectangle(t,i,r,a,l,v,m,c,u,h){t[i]=r/this._dimensions.device.canvas.width,t[i+1]=a/this._dimensions.device.canvas.height,t[i+2]=l/this._dimensions.device.canvas.width,t[i+3]=v/this._dimensions.device.canvas.height,t[i+4]=m,t[i+5]=c,t[i+6]=u,t[i+7]=h}_addRectangleFloat(t,i,r,a,l,v,m){t[i]=r/this._dimensions.device.canvas.width,t[i+1]=a/this._dimensions.device.canvas.height,t[i+2]=l/this._dimensions.device.canvas.width,t[i+3]=v/this._dimensions.device.canvas.height,t[i+4]=m[0],t[i+5]=m[1],t[i+6]=m[2],t[i+7]=m[3]}_colorToFloat32Array(t){return new Float32Array([(t.rgba>>24&255)/255,(t.rgba>>16&255)/255,(t.rgba>>8&255)/255,(t.rgba&255)/255])}},eT=class extends Un{constructor(t,i,r,a,l,v,m,c){super(),this._container=i,this._alpha=l,this._coreBrowserService=v,this._optionsService=m,this._themeService=c,this._deviceCharWidth=0,this._deviceCharHeight=0,this._deviceCellWidth=0,this._deviceCellHeight=0,this._deviceCharLeft=0,this._deviceCharTop=0,this._canvas=this._coreBrowserService.mainDocument.createElement("canvas"),this._canvas.classList.add(`xterm-${r}-layer`),this._canvas.style.zIndex=a.toString(),this._initCanvas(),this._container.appendChild(this._canvas),this._register(this._themeService.onChangeColors(u=>{this._refreshCharAtlas(t,u),this.reset(t)})),this._register(Mi(()=>{this._canvas.remove()}))}_initCanvas(){this._ctx=ci(this._canvas.getContext("2d",{alpha:this._alpha})),this._alpha||this._clearAll()}handleBlur(t){}handleFocus(t){}handleCursorMove(t){}handleGridChanged(t,i,r){}handleSelectionChanged(t,i,r,a=!1){}_setTransparency(t,i){if(i===this._alpha)return;let r=this._canvas;this._alpha=i,this._canvas=this._canvas.cloneNode(),this._initCanvas(),this._container.replaceChild(this._canvas,r),this._refreshCharAtlas(t,this._themeService.colors),this.handleGridChanged(t,0,t.rows-1)}_refreshCharAtlas(t,i){this._deviceCharWidth<=0&&this._deviceCharHeight<=0||(this._charAtlas=ay(t,this._optionsService.rawOptions,i,this._deviceCellWidth,this._deviceCellHeight,this._deviceCharWidth,this._deviceCharHeight,this._coreBrowserService.dpr,2048),this._charAtlas.warmUp())}resize(t,i){this._deviceCellWidth=i.device.cell.width,this._deviceCellHeight=i.device.cell.height,this._deviceCharWidth=i.device.char.width,this._deviceCharHeight=i.device.char.height,this._deviceCharLeft=i.device.char.left,this._deviceCharTop=i.device.char.top,this._canvas.width=i.device.canvas.width,this._canvas.height=i.device.canvas.height,this._canvas.style.width=`${i.css.canvas.width}px`,this._canvas.style.height=`${i.css.canvas.height}px`,this._alpha||this._clearAll(),this._refreshCharAtlas(t,this._themeService.colors)}_fillBottomLineAtCells(t,i,r=1){this._ctx.fillRect(t*this._deviceCellWidth,(i+1)*this._deviceCellHeight-this._coreBrowserService.dpr-1,r*this._deviceCellWidth,this._coreBrowserService.dpr)}_clearAll(){this._alpha?this._ctx.clearRect(0,0,this._canvas.width,this._canvas.height):(this._ctx.fillStyle=this._themeService.colors.background.css,this._ctx.fillRect(0,0,this._canvas.width,this._canvas.height))}_clearCells(t,i,r,a){this._alpha?this._ctx.clearRect(t*this._deviceCellWidth,i*this._deviceCellHeight,r*this._deviceCellWidth,a*this._deviceCellHeight):(this._ctx.fillStyle=this._themeService.colors.background.css,this._ctx.fillRect(t*this._deviceCellWidth,i*this._deviceCellHeight,r*this._deviceCellWidth,a*this._deviceCellHeight))}_fillCharTrueColor(t,i,r,a){this._ctx.font=this._getFont(t,!1,!1),this._ctx.textBaseline=Yb,this._clipCell(r,a,i.getWidth()),this._ctx.fillText(i.getChars(),r*this._deviceCellWidth+this._deviceCharLeft,a*this._deviceCellHeight+this._deviceCharTop+this._deviceCharHeight)}_clipCell(t,i,r){this._ctx.beginPath(),this._ctx.rect(t*this._deviceCellWidth,i*this._deviceCellHeight,r*this._deviceCellWidth,this._deviceCellHeight),this._ctx.clip()}_getFont(t,i,r){let a=i?t.options.fontWeightBold:t.options.fontWeight;return`${r?"italic":""} ${a} ${t.options.fontSize*this._coreBrowserService.dpr}px ${t.options.fontFamily}`}},tT=class extends eT{constructor(t,i,r,a,l,v,m){super(r,t,"link",i,!0,l,v,m),this._register(a.onShowLinkUnderline(c=>this._handleShowLinkUnderline(c))),this._register(a.onHideLinkUnderline(c=>this._handleHideLinkUnderline(c)))}resize(t,i){super.resize(t,i),this._state=void 0}reset(t){this._clearCurrentLink()}_clearCurrentLink(){if(this._state){this._clearCells(this._state.x1,this._state.y1,this._state.cols-this._state.x1,1);let t=this._state.y2-this._state.y1-1;t>0&&this._clearCells(0,this._state.y1+1,this._state.cols,t),this._clearCells(0,this._state.y2,this._state.x2,1),this._state=void 0}}_handleShowLinkUnderline(t){if(t.fg===257?this._ctx.fillStyle=this._themeService.colors.background.css:t.fg!==void 0&&j5(t.fg)?this._ctx.fillStyle=this._themeService.colors.ansi[t.fg].css:this._ctx.fillStyle=this._themeService.colors.foreground.css,t.y1===t.y2)this._fillBottomLineAtCells(t.x1,t.y1,t.x2-t.x1);else{this._fillBottomLineAtCells(t.x1,t.y1,t.cols-t.x1);for(let i=t.y1+1;i<t.y2;i++)this._fillBottomLineAtCells(0,i,t.cols);this._fillBottomLineAtCells(0,t.y2,t.x2)}this._state=t}_handleHideLinkUnderline(t){this._clearCurrentLink()}},Us=typeof window=="object"?window:globalThis,Zf=class{constructor(){this.mapWindowIdToZoomLevel=new Map,this._onDidChangeZoomLevel=new Lt,this.onDidChangeZoomLevel=this._onDidChangeZoomLevel.event,this.mapWindowIdToZoomFactor=new Map,this._onDidChangeFullscreen=new Lt,this.onDidChangeFullscreen=this._onDidChangeFullscreen.event,this.mapWindowIdToFullScreen=new Map}getZoomLevel(i){return this.mapWindowIdToZoomLevel.get(this.getWindowId(i))??0}setZoomLevel(i,r){if(this.getZoomLevel(r)===i)return;let a=this.getWindowId(r);this.mapWindowIdToZoomLevel.set(a,i),this._onDidChangeZoomLevel.fire(a)}getZoomFactor(i){return this.mapWindowIdToZoomFactor.get(this.getWindowId(i))??1}setZoomFactor(i,r){this.mapWindowIdToZoomFactor.set(this.getWindowId(r),i)}setFullscreen(i,r){if(this.isFullscreen(r)===i)return;let a=this.getWindowId(r);this.mapWindowIdToFullScreen.set(a,i),this._onDidChangeFullscreen.fire(a)}isFullscreen(i){return!!this.mapWindowIdToFullScreen.get(this.getWindowId(i))}getWindowId(i){return i.vscodeWindowId}};Zf.INSTANCE=new Zf;var uy=Zf;function iT(t,i,r){typeof i=="string"&&(i=t.matchMedia(i)),i.addEventListener("change",r)}uy.INSTANCE.onDidChangeZoomLevel;uy.INSTANCE.onDidChangeFullscreen;var Ja=typeof navigator=="object"?navigator.userAgent:"";Ja.indexOf("Firefox")>=0;Ja.indexOf("AppleWebKit")>=0;var nT=Ja.indexOf("Chrome")>=0;!nT&&Ja.indexOf("Safari")>=0;Ja.indexOf("Electron/")>=0;Ja.indexOf("Android")>=0;var gf=!1;if(typeof Us.matchMedia=="function"){let t=Us.matchMedia("(display-mode: standalone) or (display-mode: window-controls-overlay)"),i=Us.matchMedia("(display-mode: fullscreen)");gf=t.matches,iT(Us,t,({matches:r})=>{gf&&i.matches||(gf=r)})}var Pa="en",mf=!1,hy=!1,Kc,lu=Pa,I0=Pa,rT,Rr,Fs=globalThis,hn;typeof Fs.vscode<"u"&&typeof Fs.vscode.process<"u"?hn=Fs.vscode.process:typeof process<"u"&&typeof process?.versions?.node=="string"&&(hn=process);var sT=typeof hn?.versions?.electron=="string",aT=sT&&hn?.type==="renderer";if(typeof hn=="object"){hn.platform,hn.platform,mf=hn.platform==="linux",mf&&hn.env.SNAP&&hn.env.SNAP_REVISION,hn.env.CI||hn.env.BUILD_ARTIFACTSTAGINGDIRECTORY,Kc=Pa,lu=Pa;let t=hn.env.VSCODE_NLS_CONFIG;if(t)try{let i=JSON.parse(t);Kc=i.userLocale,I0=i.osLocale,lu=i.resolvedLanguage||Pa,rT=i.languagePack?.translationsConfigFile}catch{}hy=!0}else typeof navigator=="object"&&!aT?(Rr=navigator.userAgent,Rr.indexOf("Windows")>=0,Rr.indexOf("Macintosh")>=0,(Rr.indexOf("Macintosh")>=0||Rr.indexOf("iPad")>=0||Rr.indexOf("iPhone")>=0)&&navigator.maxTouchPoints&&navigator.maxTouchPoints>0,mf=Rr.indexOf("Linux")>=0,Rr?.indexOf("Mobi")>=0,lu=globalThis._VSCODE_NLS_LANGUAGE||Pa,Kc=navigator.language.toLowerCase(),I0=Kc):console.error("Unable to resolve platform.");var j0=hy,Qn=Rr,ls=lu,oT;(t=>{function i(){return ls}t.value=i;function r(){return ls.length===2?ls==="en":ls.length>=3?ls[0]==="e"&&ls[1]==="n"&&ls[2]==="-":!1}t.isDefaultVariant=r;function a(){return ls==="en"}t.isDefault=a})(oT||={});var lT=typeof Fs.postMessage=="function"&&!Fs.importScripts;(()=>{if(lT){let t=[];Fs.addEventListener("message",r=>{if(r.data&&r.data.vscodeScheduleAsyncWork)for(let a=0,l=t.length;a<l;a++){let v=t[a];if(v.id===r.data.vscodeScheduleAsyncWork){t.splice(a,1),v.callback();return}}});let i=0;return r=>{let a=++i;t.push({id:a,callback:r}),Fs.postMessage({vscodeScheduleAsyncWork:a},"*")}}return t=>setTimeout(t)})();var cT=!!(Qn&&Qn.indexOf("Chrome")>=0);Qn&&Qn.indexOf("Firefox")>=0;!cT&&Qn&&Qn.indexOf("Safari")>=0;Qn&&Qn.indexOf("Edg/")>=0;Qn&&Qn.indexOf("Android")>=0;var Na=typeof navigator=="object"?navigator:{};j0||document.queryCommandSupported&&document.queryCommandSupported("copy")||Na&&Na.clipboard&&Na.clipboard.writeText,j0||Na&&Na.clipboard&&Na.clipboard.readText;var Wp=class{constructor(){this._keyCodeToStr=[],this._strToKeyCode=Object.create(null)}define(t,i){this._keyCodeToStr[t]=i,this._strToKeyCode[i.toLowerCase()]=t}keyCodeToStr(t){return this._keyCodeToStr[t]}strToKeyCode(t){return this._strToKeyCode[t.toLowerCase()]||0}},_f=new Wp,z0=new Wp,$0=new Wp;new Array(230);var uT;(t=>{function i(c){return _f.keyCodeToStr(c)}t.toString=i;function r(c){return _f.strToKeyCode(c)}t.fromString=r;function a(c){return z0.keyCodeToStr(c)}t.toUserSettingsUS=a;function l(c){return $0.keyCodeToStr(c)}t.toUserSettingsGeneral=l;function v(c){return z0.strToKeyCode(c)||$0.strToKeyCode(c)}t.fromUserSettings=v;function m(c){if(c>=98&&c<=113)return null;switch(c){case 16:return"Up";case 18:return"Down";case 15:return"Left";case 17:return"Right"}return _f.keyCodeToStr(c)}t.toElectronAccelerator=m})(uT||={});var dy=Object.freeze(function(t,i){let r=setTimeout(t.bind(i),0);return{dispose(){clearTimeout(r)}}}),hT;(t=>{function i(r){return r===t.None||r===t.Cancelled||r instanceof dT?!0:!r||typeof r!="object"?!1:typeof r.isCancellationRequested=="boolean"&&typeof r.onCancellationRequested=="function"}t.isCancellationToken=i,t.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:Dr.None}),t.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:dy})})(hT||={});var dT=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?dy:(this._emitter||(this._emitter=new Lt),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=null)}},fT;(t=>{async function i(a){let l,v=await Promise.all(a.map(m=>m.then(c=>c,c=>{l||(l=c)})));if(typeof l<"u")throw l;return v}t.settled=i;function r(a){return new Promise(async(l,v)=>{try{await a(l,v)}catch(m){v(m)}})}t.withAsyncBody=r})(fT||={});var H0=class En{static fromArray(i){return new En(r=>{r.emitMany(i)})}static fromPromise(i){return new En(async r=>{r.emitMany(await i)})}static fromPromises(i){return new En(async r=>{await Promise.all(i.map(async a=>r.emitOne(await a)))})}static merge(i){return new En(async r=>{await Promise.all(i.map(async a=>{for await(let l of a)r.emitOne(l)}))})}constructor(i,r){this._state=0,this._results=[],this._error=null,this._onReturn=r,this._onStateChanged=new Lt,queueMicrotask(async()=>{let a={emitOne:l=>this.emitOne(l),emitMany:l=>this.emitMany(l),reject:l=>this.reject(l)};try{await Promise.resolve(i(a)),this.resolve()}catch(l){this.reject(l)}finally{a.emitOne=void 0,a.emitMany=void 0,a.reject=void 0}})}[Symbol.asyncIterator](){let i=0;return{next:async()=>{do{if(this._state===2)throw this._error;if(i<this._results.length)return{done:!1,value:this._results[i++]};if(this._state===1)return{done:!0,value:void 0};await Dr.toPromise(this._onStateChanged.event)}while(!0)},return:async()=>(this._onReturn?.(),{done:!0,value:void 0})}}static map(i,r){return new En(async a=>{for await(let l of i)a.emitOne(r(l))})}map(i){return En.map(this,i)}static filter(i,r){return new En(async a=>{for await(let l of i)r(l)&&a.emitOne(l)})}filter(i){return En.filter(this,i)}static coalesce(i){return En.filter(i,r=>!!r)}coalesce(){return En.coalesce(this)}static async toPromise(i){let r=[];for await(let a of i)r.push(a);return r}toPromise(){return En.toPromise(this)}emitOne(i){this._state===0&&(this._results.push(i),this._onStateChanged.fire())}emitMany(i){this._state===0&&(this._results=this._results.concat(i),this._onStateChanged.fire())}resolve(){this._state===0&&(this._state=1,this._onStateChanged.fire())}reject(i){this._state===0&&(this._state=2,this._error=i,this._onStateChanged.fire())}};H0.EMPTY=H0.fromArray([]);var{getWindow:pT}=(function(){let t=new Map,i={window:Us,disposables:new Wa};t.set(Us.vscodeWindowId,i);let r=new Lt,a=new Lt,l=new Lt;function v(m,c){return(typeof m=="number"?t.get(m):void 0)??(c?i:void 0)}return{onDidRegisterWindow:r.event,onWillUnregisterWindow:l.event,onDidUnregisterWindow:a.event,registerWindow(m){if(t.has(m.vscodeWindowId))return Un.None;let c=new Wa,u={window:m,disposables:c.add(new Wa)};return t.set(m.vscodeWindowId,u),c.add(Mi(()=>{t.delete(m.vscodeWindowId),a.fire(m)})),c.add(Jf(m,mT.BEFORE_UNLOAD,()=>{l.fire(m)})),r.fire(u),c},getWindows(){return t.values()},getWindowsCount(){return t.size},getWindowId(m){return m.vscodeWindowId},hasWindow(m){return t.has(m)},getWindowById:v,getWindow(m){let c=m;if(c?.ownerDocument?.defaultView)return c.ownerDocument.defaultView.window;let u=m;return u?.view?u.view.window:Us},getDocument(m){return pT(m).document}}})(),gT=class{constructor(t,i,r,a){this._node=t,this._type=i,this._handler=r,this._options=a||!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)}};function Jf(t,i,r,a){return new gT(t,i,r,a)}var mT={BEFORE_UNLOAD:"beforeunload"},_T=class extends Un{constructor(t,i,r,a,l,v,m,c,u){super(),this._terminal=t,this._characterJoinerService=i,this._charSizeService=r,this._coreBrowserService=a,this._coreService=l,this._decorationService=v,this._optionsService=m,this._themeService=c,this._cursorBlinkStateManager=new Zo,this._charAtlasDisposable=this._register(new Zo),this._observerDisposable=this._register(new Zo),this._model=new V5,this._workCell=new A0,this._workCell2=new A0,this._rectangleRenderer=this._register(new Zo),this._glyphRenderer=this._register(new Zo),this._onChangeTextureAtlas=this._register(new Lt),this.onChangeTextureAtlas=this._onChangeTextureAtlas.event,this._onAddTextureAtlasCanvas=this._register(new Lt),this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event,this._onRemoveTextureAtlasCanvas=this._register(new Lt),this.onRemoveTextureAtlasCanvas=this._onRemoveTextureAtlasCanvas.event,this._onRequestRedraw=this._register(new Lt),this.onRequestRedraw=this._onRequestRedraw.event,this._onContextLoss=this._register(new Lt),this.onContextLoss=this._onContextLoss.event,this._canvas=this._coreBrowserService.mainDocument.createElement("canvas");let h={antialias:!1,depth:!1,preserveDrawingBuffer:u};if(this._gl=this._canvas.getContext("webgl2",h),!this._gl)throw new Error("WebGL2 not supported "+this._gl);this._register(this._themeService.onChangeColors(()=>this._handleColorChange())),this._cellColorResolver=new u5(this._terminal,this._optionsService,this._model.selection,this._decorationService,this._coreBrowserService,this._themeService),this._core=this._terminal._core,this._renderLayers=[new tT(this._core.screenElement,2,this._terminal,this._core.linkifier,this._coreBrowserService,m,this._themeService)],this.dimensions=l5(),this._devicePixelRatio=this._coreBrowserService.dpr,this._updateDimensions(),this._updateCursorBlink(),this._register(m.onOptionChange(()=>this._handleOptionsChanged())),this._deviceMaxTextureSize=this._gl.getParameter(this._gl.MAX_TEXTURE_SIZE),this._register(Jf(this._canvas,"webglcontextlost",b=>{console.log("webglcontextlost event received"),b.preventDefault(),this._contextRestorationTimeout=setTimeout(()=>{this._contextRestorationTimeout=void 0,console.warn("webgl context not restored; firing onContextLoss"),this._onContextLoss.fire(b)},3e3)})),this._register(Jf(this._canvas,"webglcontextrestored",b=>{console.warn("webglcontextrestored event received"),clearTimeout(this._contextRestorationTimeout),this._contextRestorationTimeout=void 0,E0(this._terminal),this._initializeWebGLState(),this._requestRedrawViewport()})),this._observerDisposable.value=T0(this._canvas,this._coreBrowserService.window,(b,p)=>this._setCanvasDevicePixelDimensions(b,p)),this._register(this._coreBrowserService.onWindowChange(b=>{this._observerDisposable.value=T0(this._canvas,b,(p,C)=>this._setCanvasDevicePixelDimensions(p,C))})),this._core.screenElement.appendChild(this._canvas),[this._rectangleRenderer.value,this._glyphRenderer.value]=this._initializeWebGLState(),this._isAttached=this._core.screenElement.isConnected,this._register(Mi(()=>{for(let b of this._renderLayers)b.dispose();this._canvas.parentElement?.removeChild(this._canvas),E0(this._terminal)}))}get textureAtlas(){return this._charAtlas?.pages[0].canvas}_handleColorChange(){this._refreshCharAtlas(),this._clearModel(!0)}handleDevicePixelRatioChange(){this._devicePixelRatio!==this._coreBrowserService.dpr&&(this._devicePixelRatio=this._coreBrowserService.dpr,this.handleResize(this._terminal.cols,this._terminal.rows))}handleResize(t,i){this._updateDimensions(),this._model.resize(this._terminal.cols,this._terminal.rows);for(let r of this._renderLayers)r.resize(this._terminal,this.dimensions);this._canvas.width=this.dimensions.device.canvas.width,this._canvas.height=this.dimensions.device.canvas.height,this._canvas.style.width=`${this.dimensions.css.canvas.width}px`,this._canvas.style.height=`${this.dimensions.css.canvas.height}px`,this._core.screenElement.style.width=`${this.dimensions.css.canvas.width}px`,this._core.screenElement.style.height=`${this.dimensions.css.canvas.height}px`,this._rectangleRenderer.value?.setDimensions(this.dimensions),this._rectangleRenderer.value?.handleResize(),this._glyphRenderer.value?.setDimensions(this.dimensions),this._glyphRenderer.value?.handleResize(),this._refreshCharAtlas(),this._clearModel(!1)}handleCharSizeChanged(){this.handleResize(this._terminal.cols,this._terminal.rows)}handleBlur(){for(let t of this._renderLayers)t.handleBlur(this._terminal);this._cursorBlinkStateManager.value?.pause(),this._requestRedrawViewport()}handleFocus(){for(let t of this._renderLayers)t.handleFocus(this._terminal);this._cursorBlinkStateManager.value?.resume(),this._requestRedrawViewport()}handleSelectionChanged(t,i,r){for(let a of this._renderLayers)a.handleSelectionChanged(this._terminal,t,i,r);this._model.selection.update(this._core,t,i,r),this._requestRedrawViewport()}handleCursorMove(){for(let t of this._renderLayers)t.handleCursorMove(this._terminal);this._cursorBlinkStateManager.value?.restartBlinkAnimation()}_handleOptionsChanged(){this._updateDimensions(),this._refreshCharAtlas(),this._updateCursorBlink()}_initializeWebGLState(){return this._rectangleRenderer.value=new Q5(this._terminal,this._gl,this.dimensions,this._themeService),this._glyphRenderer.value=new W5(this._terminal,this._gl,this.dimensions,this._optionsService),this.handleCharSizeChanged(),[this._rectangleRenderer.value,this._glyphRenderer.value]}_refreshCharAtlas(){if(this.dimensions.device.char.width<=0&&this.dimensions.device.char.height<=0){this._isAttached=!1;return}let t=ay(this._terminal,this._optionsService.rawOptions,this._themeService.colors,this.dimensions.device.cell.width,this.dimensions.device.cell.height,this.dimensions.device.char.width,this.dimensions.device.char.height,this._coreBrowserService.dpr,this._deviceMaxTextureSize);this._charAtlas!==t&&(this._onChangeTextureAtlas.fire(t.pages[0].canvas),this._charAtlasDisposable.value=Fb(Dr.forward(t.onAddTextureAtlasCanvas,this._onAddTextureAtlasCanvas),Dr.forward(t.onRemoveTextureAtlasCanvas,this._onRemoveTextureAtlasCanvas))),this._charAtlas=t,this._charAtlas.warmUp(),this._glyphRenderer.value?.setAtlas(this._charAtlas)}_clearModel(t){this._model.clear(),t&&this._glyphRenderer.value?.clear()}clearTextureAtlas(){this._charAtlas?.clearTexture(),this._clearModel(!0),this._requestRedrawViewport()}clear(){this._clearModel(!0);for(let t of this._renderLayers)t.reset(this._terminal);this._cursorBlinkStateManager.value?.restartBlinkAnimation(),this._updateCursorBlink()}renderRows(t,i){if(!this._isAttached)if(this._core.screenElement?.isConnected&&this._charSizeService.width&&this._charSizeService.height)this._updateDimensions(),this._refreshCharAtlas(),this._isAttached=!0;else return;for(let r of this._renderLayers)r.handleGridChanged(this._terminal,t,i);!this._glyphRenderer.value||!this._rectangleRenderer.value||(this._glyphRenderer.value.beginFrame()?(this._clearModel(!0),this._updateModel(0,this._terminal.rows-1)):this._updateModel(t,i),this._rectangleRenderer.value.renderBackgrounds(),this._glyphRenderer.value.render(this._model),(!this._cursorBlinkStateManager.value||this._cursorBlinkStateManager.value.isCursorVisible)&&this._rectangleRenderer.value.renderCursor())}_updateCursorBlink(){this._coreService.decPrivateModes.cursorBlink??this._terminal.options.cursorBlink?this._cursorBlinkStateManager.value=new z5(()=>{this._requestRedrawCursor()},this._coreBrowserService):this._cursorBlinkStateManager.clear(),this._requestRedrawCursor()}_updateModel(t,i){let r=this._core,a=this._workCell,l,v,m,c,u,h,b=0,p=!0,C,w,A,x,g,y,f,_,E;t=U0(t,r.rows-1,0),i=U0(i,r.rows-1,0);let L=this._coreService.decPrivateModes.cursorStyle??r.options.cursorStyle??"block",R=this._terminal.buffer.active.baseY+this._terminal.buffer.active.cursorY,D=R-r.buffer.ydisp,k=Math.min(this._terminal.buffer.active.cursorX,r.cols-1),N=-1,W=this._coreService.isCursorInitialized&&!this._coreService.isCursorHidden&&(!this._cursorBlinkStateManager.value||this._cursorBlinkStateManager.value.isCursorVisible);this._model.cursor=void 0;let U=!1;for(v=t;v<=i;v++)for(m=v+r.buffer.ydisp,c=r.buffer.lines.get(m),this._model.lineLengths[v]=0,A=R===m,b=0,u=this._characterJoinerService.getJoinedCharacters(m),_=0;_<r.cols;_++){if(l=this._cellColorResolver.result.bg,c.loadCell(_,a),_===0&&(l=this._cellColorResolver.result.bg),h=!1,p=_>=b,C=_,u.length>0&&_===u[0][0]&&p){w=u.shift();let F=this._model.selection.isCellSelected(this._terminal,w[0],m);for(f=w[0]+1;f<w[1];f++)p&&=F===this._model.selection.isCellSelected(this._terminal,f,m);p&&=!A||k<w[0]||k>=w[1],p?(h=!0,a=new vT(a,c.translateToString(!0,w[0],w[1]),w[1]-w[0]),C=w[1]-1):b=w[1]}if(x=a.getChars(),g=a.getCode(),f=(v*r.cols+_)*vu,this._cellColorResolver.resolve(a,_,m,this.dimensions.device.cell.width),W&&m===R&&(_===k&&(this._model.cursor={x:k,y:D,width:a.getWidth(),style:this._coreBrowserService.isFocused?L:r.options.cursorInactiveStyle,cursorWidth:r.options.cursorWidth,dpr:this._devicePixelRatio},N=k+a.getWidth()-1),_>=k&&_<=N&&(this._coreBrowserService.isFocused&&L==="block"||this._coreBrowserService.isFocused===!1&&r.options.cursorInactiveStyle==="block")&&(this._cellColorResolver.result.fg=50331648|this._themeService.colors.cursorAccent.rgba>>8&16777215,this._cellColorResolver.result.bg=50331648|this._themeService.colors.cursor.rgba>>8&16777215)),g!==0&&(this._model.lineLengths[v]=_+1),!(this._model.cells[f]===g&&this._model.cells[f+au]===this._cellColorResolver.result.bg&&this._model.cells[f+ou]===this._cellColorResolver.result.fg&&this._model.cells[f+ff]===this._cellColorResolver.result.ext)&&(U=!0,x.length>1&&(g|=Y5),this._model.cells[f]=g,this._model.cells[f+au]=this._cellColorResolver.result.bg,this._model.cells[f+ou]=this._cellColorResolver.result.fg,this._model.cells[f+ff]=this._cellColorResolver.result.ext,y=a.getWidth(),this._glyphRenderer.value.updateCell(_,v,g,this._cellColorResolver.result.bg,this._cellColorResolver.result.fg,this._cellColorResolver.result.ext,x,y,l),h)){for(a=this._workCell,_++;_<=C;_++)E=(v*r.cols+_)*vu,this._glyphRenderer.value.updateCell(_,v,0,0,0,0,t5,0,0),this._model.cells[E]=0,this._model.cells[E+au]=this._cellColorResolver.result.bg,this._model.cells[E+ou]=this._cellColorResolver.result.fg,this._model.cells[E+ff]=this._cellColorResolver.result.ext;_--}}U&&this._rectangleRenderer.value.updateBackgrounds(this._model),this._rectangleRenderer.value.updateCursor(this._model)}_updateDimensions(){!this._charSizeService.width||!this._charSizeService.height||(this.dimensions.device.char.width=Math.floor(this._charSizeService.width*this._devicePixelRatio),this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*this._devicePixelRatio),this.dimensions.device.cell.height=Math.floor(this.dimensions.device.char.height*this._optionsService.rawOptions.lineHeight),this.dimensions.device.char.top=this._optionsService.rawOptions.lineHeight===1?0:Math.round((this.dimensions.device.cell.height-this.dimensions.device.char.height)/2),this.dimensions.device.cell.width=this.dimensions.device.char.width+Math.round(this._optionsService.rawOptions.letterSpacing),this.dimensions.device.char.left=Math.floor(this._optionsService.rawOptions.letterSpacing/2),this.dimensions.device.canvas.height=this._terminal.rows*this.dimensions.device.cell.height,this.dimensions.device.canvas.width=this._terminal.cols*this.dimensions.device.cell.width,this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/this._devicePixelRatio),this.dimensions.css.canvas.width=Math.round(this.dimensions.device.canvas.width/this._devicePixelRatio),this.dimensions.css.cell.height=this.dimensions.device.cell.height/this._devicePixelRatio,this.dimensions.css.cell.width=this.dimensions.device.cell.width/this._devicePixelRatio)}_setCanvasDevicePixelDimensions(t,i){this._canvas.width===t&&this._canvas.height===i||(this._canvas.width=t,this._canvas.height=i,this._requestRedrawViewport())}_requestRedrawViewport(){this._onRequestRedraw.fire({start:0,end:this._terminal.rows-1})}_requestRedrawCursor(){let t=this._terminal.buffer.active.cursorY;this._onRequestRedraw.fire({start:t,end:t})}},vT=class extends Ua{constructor(t,i,r){super(),this.content=0,this.combinedData="",this.fg=t.fg,this.bg=t.bg,this.combinedData=i,this._width=r}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(t){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}};function U0(t,i,r=0){return Math.max(Math.min(t,i),r)}var P0="di$target",F0="di$dependencies",vf=new Map;function ir(t){if(vf.has(t))return vf.get(t);let i=function(r,a,l){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");bT(i,r,l)};return i._id=t,vf.set(t,i),i}function bT(t,i,r){i[P0]===i?i[F0].push({id:t,index:r}):(i[F0]=[{id:t,index:r}],i[P0]=i)}ir("BufferService");ir("CoreMouseService");ir("CoreService");ir("CharsetService");ir("InstantiationService");ir("LogService");var yT=ir("OptionsService");ir("OscLinkService");ir("UnicodeService");ir("DecorationService");var ST={trace:0,debug:1,info:2,warn:3,error:4,off:5},CT="xterm.js: ",q0=class extends Un{constructor(t){super(),this._optionsService=t,this._logLevel=5,this._updateLogLevel(),this._register(this._optionsService.onSpecificOptionChange("logLevel",()=>this._updateLogLevel()))}get logLevel(){return this._logLevel}_updateLogLevel(){this._logLevel=ST[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(t){for(let i=0;i<t.length;i++)typeof t[i]=="function"&&(t[i]=t[i]())}_log(t,i,r){this._evalLazyOptionalParams(r),t.call(console,(this._optionsService.options.logger?"":CT)+i,...r)}trace(t,...i){this._logLevel<=0&&this._log(this._optionsService.options.logger?.trace.bind(this._optionsService.options.logger)??console.log,t,i)}debug(t,...i){this._logLevel<=1&&this._log(this._optionsService.options.logger?.debug.bind(this._optionsService.options.logger)??console.log,t,i)}info(t,...i){this._logLevel<=2&&this._log(this._optionsService.options.logger?.info.bind(this._optionsService.options.logger)??console.info,t,i)}warn(t,...i){this._logLevel<=3&&this._log(this._optionsService.options.logger?.warn.bind(this._optionsService.options.logger)??console.warn,t,i)}error(t,...i){this._logLevel<=4&&this._log(this._optionsService.options.logger?.error.bind(this._optionsService.options.logger)??console.error,t,i)}};q0=FE([qE(0,yT)],q0);var wT=class extends Un{constructor(t){if(Gb&&e5()<16){let i={antialias:!1,depth:!1,preserveDrawingBuffer:!0};if(!document.createElement("canvas").getContext("webgl2",i))throw new Error("Webgl2 is only supported on Safari 16 and above")}super(),this._preserveDrawingBuffer=t,this._onChangeTextureAtlas=this._register(new Lt),this.onChangeTextureAtlas=this._onChangeTextureAtlas.event,this._onAddTextureAtlasCanvas=this._register(new Lt),this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event,this._onRemoveTextureAtlasCanvas=this._register(new Lt),this.onRemoveTextureAtlasCanvas=this._onRemoveTextureAtlasCanvas.event,this._onContextLoss=this._register(new Lt),this.onContextLoss=this._onContextLoss.event}activate(t){let i=t._core;if(!t.element){this._register(i.onWillOpen(()=>this.activate(t)));return}this._terminal=t;let r=i.coreService,a=i.optionsService,l=i,v=l._renderService,m=l._characterJoinerService,c=l._charSizeService,u=l._coreBrowserService,h=l._decorationService;l._logService;let b=l._themeService;this._renderer=this._register(new _T(t,m,c,u,r,h,a,b,this._preserveDrawingBuffer)),this._register(Dr.forward(this._renderer.onContextLoss,this._onContextLoss)),this._register(Dr.forward(this._renderer.onChangeTextureAtlas,this._onChangeTextureAtlas)),this._register(Dr.forward(this._renderer.onAddTextureAtlasCanvas,this._onAddTextureAtlasCanvas)),this._register(Dr.forward(this._renderer.onRemoveTextureAtlasCanvas,this._onRemoveTextureAtlasCanvas)),v.setRenderer(this._renderer),this._register(Mi(()=>{if(this._terminal._core._store._isDisposed)return;let p=this._terminal._core._renderService;p.setRenderer(this._terminal._core._createRenderer()),p.handleResize(t.cols,t.rows)}))}get textureAtlas(){return this._renderer?.textureAtlas}clearTextureAtlas(){this._renderer?.clearTextureAtlas()}},bf={exports:{}},W0;function xT(){return W0||(W0=1,(function(t,i){(function(r,a){t.exports=a()})(globalThis,(()=>(()=>{var r={4567:function(m,c,u){var h=this&&this.__decorate||function(f,_,E,L){var R,D=arguments.length,k=D<3?_:L===null?L=Object.getOwnPropertyDescriptor(_,E):L;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")k=Reflect.decorate(f,_,E,L);else for(var N=f.length-1;N>=0;N--)(R=f[N])&&(k=(D<3?R(k):D>3?R(_,E,k):R(_,E))||k);return D>3&&k&&Object.defineProperty(_,E,k),k},b=this&&this.__param||function(f,_){return function(E,L){_(E,L,f)}};Object.defineProperty(c,"__esModule",{value:!0}),c.AccessibilityManager=void 0;const p=u(9042),C=u(9924),w=u(844),A=u(4725),x=u(2585),g=u(3656);let y=c.AccessibilityManager=class extends w.Disposable{constructor(f,_,E,L){super(),this._terminal=f,this._coreBrowserService=E,this._renderService=L,this._rowColumns=new WeakMap,this._liveRegionLineCount=0,this._charsToConsume=[],this._charsToAnnounce="",this._accessibilityContainer=this._coreBrowserService.mainDocument.createElement("div"),this._accessibilityContainer.classList.add("xterm-accessibility"),this._rowContainer=this._coreBrowserService.mainDocument.createElement("div"),this._rowContainer.setAttribute("role","list"),this._rowContainer.classList.add("xterm-accessibility-tree"),this._rowElements=[];for(let 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._refreshRowsDimensions(),this._accessibilityContainer.appendChild(this._rowContainer),this._liveRegion=this._coreBrowserService.mainDocument.createElement("div"),this._liveRegion.classList.add("live-region"),this._liveRegion.setAttribute("aria-live","assertive"),this._accessibilityContainer.appendChild(this._liveRegion),this._liveRegionDebouncer=this.register(new C.TimeBasedDebouncer(this._renderRows.bind(this))),!this._terminal.element)throw new Error("Cannot enable accessibility before Terminal.open");this._terminal.element.insertAdjacentElement("afterbegin",this._accessibilityContainer),this.register(this._terminal.onResize((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(`
|
|
76
|
+
`)))),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((0,g.addDisposableDomListener)(document,"selectionchange",(()=>this._handleSelectionChange()))),this.register(this._coreBrowserService.onDprChange((()=>this._refreshRowsDimensions()))),this._refreshRows(),this.register((0,w.toDisposable)((()=>{this._accessibilityContainer.remove(),this._rowElements.length=0})))}_handleTab(f){for(let _=0;_<f;_++)this._handleChar(" ")}_handleChar(f){this._liveRegionLineCount<21&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==f&&(this._charsToAnnounce+=f):this._charsToAnnounce+=f,f===`
|
|
77
|
+
`&&(this._liveRegionLineCount++,this._liveRegionLineCount===21&&(this._liveRegion.textContent+=p.tooMuchOutput)))}_clearLiveRegion(){this._liveRegion.textContent="",this._liveRegionLineCount=0}_handleKey(f){this._clearLiveRegion(),new RegExp("\\p{Control}","u").test(f)||this._charsToConsume.push(f)}_refreshRows(f,_){this._liveRegionDebouncer.refresh(f,_,this._terminal.rows)}_renderRows(f,_){const E=this._terminal.buffer,L=E.lines.length.toString();for(let R=f;R<=_;R++){const D=E.lines.get(E.ydisp+R),k=[],N=D?.translateToString(!0,void 0,void 0,k)||"",W=(E.ydisp+R+1).toString(),U=this._rowElements[R];U&&(N.length===0?(U.innerText=" ",this._rowColumns.set(U,[0,1])):(U.textContent=N,this._rowColumns.set(U,k)),U.setAttribute("aria-posinset",W),U.setAttribute("aria-setsize",L))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(f,_){const E=f.target,L=this._rowElements[_===0?1:this._rowElements.length-2];if(E.getAttribute("aria-posinset")===(_===0?"1":`${this._terminal.buffer.lines.length}`)||f.relatedTarget!==L)return;let R,D;if(_===0?(R=E,D=this._rowElements.pop(),this._rowContainer.removeChild(D)):(R=this._rowElements.shift(),D=E,this._rowContainer.removeChild(R)),R.removeEventListener("focus",this._topBoundaryFocusListener),D.removeEventListener("focus",this._bottomBoundaryFocusListener),_===0){const k=this._createAccessibilityTreeNode();this._rowElements.unshift(k),this._rowContainer.insertAdjacentElement("afterbegin",k)}else{const k=this._createAccessibilityTreeNode();this._rowElements.push(k),this._rowContainer.appendChild(k)}this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._terminal.scrollLines(_===0?-1:1),this._rowElements[_===0?1:this._rowElements.length-2].focus(),f.preventDefault(),f.stopImmediatePropagation()}_handleSelectionChange(){if(this._rowElements.length===0)return;const f=document.getSelection();if(!f)return;if(f.isCollapsed)return void(this._rowContainer.contains(f.anchorNode)&&this._terminal.clearSelection());if(!f.anchorNode||!f.focusNode)return void console.error("anchorNode and/or focusNode are null");let _={node:f.anchorNode,offset:f.anchorOffset},E={node:f.focusNode,offset:f.focusOffset};if((_.node.compareDocumentPosition(E.node)&Node.DOCUMENT_POSITION_PRECEDING||_.node===E.node&&_.offset>E.offset)&&([_,E]=[E,_]),_.node.compareDocumentPosition(this._rowElements[0])&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_FOLLOWING)&&(_={node:this._rowElements[0].childNodes[0],offset:0}),!this._rowContainer.contains(_.node))return;const L=this._rowElements.slice(-1)[0];if(E.node.compareDocumentPosition(L)&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_PRECEDING)&&(E={node:L,offset:L.textContent?.length??0}),!this._rowContainer.contains(E.node))return;const R=({node:N,offset:W})=>{const U=N instanceof Text?N.parentNode:N;let F=parseInt(U?.getAttribute("aria-posinset"),10)-1;if(isNaN(F))return console.warn("row is invalid. Race condition?"),null;const j=this._rowColumns.get(U);if(!j)return console.warn("columns is null. Race condition?"),null;let J=W<j.length?j[W]:j.slice(-1)[0]+1;return J>=this._terminal.cols&&(++F,J=0),{row:F,column:J}},D=R(_),k=R(E);if(D&&k){if(D.row>k.row||D.row===k.row&&D.column>=k.column)throw new Error("invalid range");this._terminal.select(D.column,D.row,(k.row-D.row)*this._terminal.cols-D.column+k.column)}}_handleResize(f){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(let _=this._rowContainer.children.length;_<this._terminal.rows;_++)this._rowElements[_]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[_]);for(;this._rowElements.length>f;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){const f=this._coreBrowserService.mainDocument.createElement("div");return f.setAttribute("role","listitem"),f.tabIndex=-1,this._refreshRowDimensions(f),f}_refreshRowsDimensions(){if(this._renderService.dimensions.css.cell.height){this._accessibilityContainer.style.width=`${this._renderService.dimensions.css.canvas.width}px`,this._rowElements.length!==this._terminal.rows&&this._handleResize(this._terminal.rows);for(let f=0;f<this._terminal.rows;f++)this._refreshRowDimensions(this._rowElements[f])}}_refreshRowDimensions(f){f.style.height=`${this._renderService.dimensions.css.cell.height}px`}};c.AccessibilityManager=y=h([b(1,x.IInstantiationService),b(2,A.ICoreBrowserService),b(3,A.IRenderService)],y)},3614:(m,c)=>{function u(C){return C.replace(/\r?\n/g,"\r")}function h(C,w){return w?"\x1B[200~"+C+"\x1B[201~":C}function b(C,w,A,x){C=h(C=u(C),A.decPrivateModes.bracketedPasteMode&&x.rawOptions.ignoreBracketedPasteMode!==!0),A.triggerDataEvent(C,!0),w.value=""}function p(C,w,A){const x=A.getBoundingClientRect(),g=C.clientX-x.left-10,y=C.clientY-x.top-10;w.style.width="20px",w.style.height="20px",w.style.left=`${g}px`,w.style.top=`${y}px`,w.style.zIndex="1000",w.focus()}Object.defineProperty(c,"__esModule",{value:!0}),c.rightClickHandler=c.moveTextAreaUnderMouseCursor=c.paste=c.handlePasteEvent=c.copyHandler=c.bracketTextForPaste=c.prepareTextForTerminal=void 0,c.prepareTextForTerminal=u,c.bracketTextForPaste=h,c.copyHandler=function(C,w){C.clipboardData&&C.clipboardData.setData("text/plain",w.selectionText),C.preventDefault()},c.handlePasteEvent=function(C,w,A,x){C.stopPropagation(),C.clipboardData&&b(C.clipboardData.getData("text/plain"),w,A,x)},c.paste=b,c.moveTextAreaUnderMouseCursor=p,c.rightClickHandler=function(C,w,A,x,g){p(C,w,A),g&&x.rightClickSelect(C),w.value=x.selectionText,w.select()}},7239:(m,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.ColorContrastCache=void 0;const h=u(1505);c.ColorContrastCache=class{constructor(){this._color=new h.TwoKeyMap,this._css=new h.TwoKeyMap}setCss(b,p,C){this._css.set(b,p,C)}getCss(b,p){return this._css.get(b,p)}setColor(b,p,C){this._color.set(b,p,C)}getColor(b,p){return this._color.get(b,p)}clear(){this._color.clear(),this._css.clear()}}},3656:(m,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.addDisposableDomListener=void 0,c.addDisposableDomListener=function(u,h,b,p){u.addEventListener(h,b,p);let C=!1;return{dispose:()=>{C||(C=!0,u.removeEventListener(h,b,p))}}}},3551:function(m,c,u){var h=this&&this.__decorate||function(y,f,_,E){var L,R=arguments.length,D=R<3?f:E===null?E=Object.getOwnPropertyDescriptor(f,_):E;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")D=Reflect.decorate(y,f,_,E);else for(var k=y.length-1;k>=0;k--)(L=y[k])&&(D=(R<3?L(D):R>3?L(f,_,D):L(f,_))||D);return R>3&&D&&Object.defineProperty(f,_,D),D},b=this&&this.__param||function(y,f){return function(_,E){f(_,E,y)}};Object.defineProperty(c,"__esModule",{value:!0}),c.Linkifier=void 0;const p=u(3656),C=u(8460),w=u(844),A=u(2585),x=u(4725);let g=c.Linkifier=class extends w.Disposable{get currentLink(){return this._currentLink}constructor(y,f,_,E,L){super(),this._element=y,this._mouseService=f,this._renderService=_,this._bufferService=E,this._linkProviderService=L,this._linkCacheDisposables=[],this._isMouseOut=!0,this._wasResized=!1,this._activeLine=-1,this._onShowLinkUnderline=this.register(new C.EventEmitter),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this.register(new C.EventEmitter),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this.register((0,w.getDisposeArrayDisposable)(this._linkCacheDisposables)),this.register((0,w.toDisposable)((()=>{this._lastMouseEvent=void 0,this._activeProviderReplies?.clear()}))),this.register(this._bufferService.onResize((()=>{this._clearCurrentLink(),this._wasResized=!0}))),this.register((0,p.addDisposableDomListener)(this._element,"mouseleave",(()=>{this._isMouseOut=!0,this._clearCurrentLink()}))),this.register((0,p.addDisposableDomListener)(this._element,"mousemove",this._handleMouseMove.bind(this))),this.register((0,p.addDisposableDomListener)(this._element,"mousedown",this._handleMouseDown.bind(this))),this.register((0,p.addDisposableDomListener)(this._element,"mouseup",this._handleMouseUp.bind(this)))}_handleMouseMove(y){this._lastMouseEvent=y;const f=this._positionFromMouseEvent(y,this._element,this._mouseService);if(!f)return;this._isMouseOut=!1;const _=y.composedPath();for(let E=0;E<_.length;E++){const L=_[E];if(L.classList.contains("xterm"))break;if(L.classList.contains("xterm-hover"))return}this._lastBufferCell&&f.x===this._lastBufferCell.x&&f.y===this._lastBufferCell.y||(this._handleHover(f),this._lastBufferCell=f)}_handleHover(y){if(this._activeLine!==y.y||this._wasResized)return this._clearCurrentLink(),this._askForLink(y,!1),void(this._wasResized=!1);this._currentLink&&this._linkAtPosition(this._currentLink.link,y)||(this._clearCurrentLink(),this._askForLink(y,!0))}_askForLink(y,f){this._activeProviderReplies&&f||(this._activeProviderReplies?.forEach((E=>{E?.forEach((L=>{L.link.dispose&&L.link.dispose()}))})),this._activeProviderReplies=new Map,this._activeLine=y.y);let _=!1;for(const[E,L]of this._linkProviderService.linkProviders.entries())f?this._activeProviderReplies?.get(E)&&(_=this._checkLinkProviderResult(E,y,_)):L.provideLinks(y.y,(R=>{if(this._isMouseOut)return;const D=R?.map((k=>({link:k})));this._activeProviderReplies?.set(E,D),_=this._checkLinkProviderResult(E,y,_),this._activeProviderReplies?.size===this._linkProviderService.linkProviders.length&&this._removeIntersectingLinks(y.y,this._activeProviderReplies)}))}_removeIntersectingLinks(y,f){const _=new Set;for(let E=0;E<f.size;E++){const L=f.get(E);if(L)for(let R=0;R<L.length;R++){const D=L[R],k=D.link.range.start.y<y?0:D.link.range.start.x,N=D.link.range.end.y>y?this._bufferService.cols:D.link.range.end.x;for(let W=k;W<=N;W++){if(_.has(W)){L.splice(R--,1);break}_.add(W)}}}}_checkLinkProviderResult(y,f,_){if(!this._activeProviderReplies)return _;const E=this._activeProviderReplies.get(y);let L=!1;for(let R=0;R<y;R++)this._activeProviderReplies.has(R)&&!this._activeProviderReplies.get(R)||(L=!0);if(!L&&E){const R=E.find((D=>this._linkAtPosition(D.link,f)));R&&(_=!0,this._handleNewLink(R))}if(this._activeProviderReplies.size===this._linkProviderService.linkProviders.length&&!_)for(let R=0;R<this._activeProviderReplies.size;R++){const D=this._activeProviderReplies.get(R)?.find((k=>this._linkAtPosition(k.link,f)));if(D){_=!0,this._handleNewLink(D);break}}return _}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(y){if(!this._currentLink)return;const f=this._positionFromMouseEvent(y,this._element,this._mouseService);f&&this._mouseDownLink===this._currentLink&&this._linkAtPosition(this._currentLink.link,f)&&this._currentLink.link.activate(y,this._currentLink.link.text)}_clearCurrentLink(y,f){this._currentLink&&this._lastMouseEvent&&(!y||!f||this._currentLink.link.range.start.y>=y&&this._currentLink.link.range.end.y<=f)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,(0,w.disposeArray)(this._linkCacheDisposables))}_handleNewLink(y){if(!this._lastMouseEvent)return;const f=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);f&&this._linkAtPosition(y.link,f)&&(this._currentLink=y,this._currentLink.state={decorations:{underline:y.link.decorations===void 0||y.link.decorations.underline,pointerCursor:y.link.decorations===void 0||y.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,y.link,this._lastMouseEvent),y.link.decorations={},Object.defineProperties(y.link.decorations,{pointerCursor:{get:()=>this._currentLink?.state?.decorations.pointerCursor,set:_=>{this._currentLink?.state&&this._currentLink.state.decorations.pointerCursor!==_&&(this._currentLink.state.decorations.pointerCursor=_,this._currentLink.state.isHovered&&this._element.classList.toggle("xterm-cursor-pointer",_))}},underline:{get:()=>this._currentLink?.state?.decorations.underline,set:_=>{this._currentLink?.state&&this._currentLink?.state?.decorations.underline!==_&&(this._currentLink.state.decorations.underline=_,this._currentLink.state.isHovered&&this._fireUnderlineEvent(y.link,_))}}}),this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange((_=>{if(!this._currentLink)return;const E=_.start===0?0:_.start+1+this._bufferService.buffer.ydisp,L=this._bufferService.buffer.ydisp+1+_.end;if(this._currentLink.link.range.start.y>=E&&this._currentLink.link.range.end.y<=L&&(this._clearCurrentLink(E,L),this._lastMouseEvent)){const R=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);R&&this._askForLink(R,!1)}}))))}_linkHover(y,f,_){this._currentLink?.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(f,!0),this._currentLink.state.decorations.pointerCursor&&y.classList.add("xterm-cursor-pointer")),f.hover&&f.hover(_,f.text)}_fireUnderlineEvent(y,f){const _=y.range,E=this._bufferService.buffer.ydisp,L=this._createLinkUnderlineEvent(_.start.x-1,_.start.y-E-1,_.end.x,_.end.y-E-1,void 0);(f?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(L)}_linkLeave(y,f,_){this._currentLink?.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(f,!1),this._currentLink.state.decorations.pointerCursor&&y.classList.remove("xterm-cursor-pointer")),f.leave&&f.leave(_,f.text)}_linkAtPosition(y,f){const _=y.range.start.y*this._bufferService.cols+y.range.start.x,E=y.range.end.y*this._bufferService.cols+y.range.end.x,L=f.y*this._bufferService.cols+f.x;return _<=L&&L<=E}_positionFromMouseEvent(y,f,_){const E=_.getCoords(y,f,this._bufferService.cols,this._bufferService.rows);if(E)return{x:E[0],y:E[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(y,f,_,E,L){return{x1:y,y1:f,x2:_,y2:E,cols:this._bufferService.cols,fg:L}}};c.Linkifier=g=h([b(1,x.IMouseService),b(2,x.IRenderService),b(3,A.IBufferService),b(4,x.ILinkProviderService)],g)},9042:(m,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.tooMuchOutput=c.promptLabel=void 0,c.promptLabel="Terminal input",c.tooMuchOutput="Too much output to announce, navigate to rows manually to read"},3730:function(m,c,u){var h=this&&this.__decorate||function(x,g,y,f){var _,E=arguments.length,L=E<3?g:f===null?f=Object.getOwnPropertyDescriptor(g,y):f;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")L=Reflect.decorate(x,g,y,f);else for(var R=x.length-1;R>=0;R--)(_=x[R])&&(L=(E<3?_(L):E>3?_(g,y,L):_(g,y))||L);return E>3&&L&&Object.defineProperty(g,y,L),L},b=this&&this.__param||function(x,g){return function(y,f){g(y,f,x)}};Object.defineProperty(c,"__esModule",{value:!0}),c.OscLinkProvider=void 0;const p=u(511),C=u(2585);let w=c.OscLinkProvider=class{constructor(x,g,y){this._bufferService=x,this._optionsService=g,this._oscLinkService=y}provideLinks(x,g){const y=this._bufferService.buffer.lines.get(x-1);if(!y)return void g(void 0);const f=[],_=this._optionsService.rawOptions.linkHandler,E=new p.CellData,L=y.getTrimmedLength();let R=-1,D=-1,k=!1;for(let N=0;N<L;N++)if(D!==-1||y.hasContent(N)){if(y.loadCell(N,E),E.hasExtendedAttrs()&&E.extended.urlId){if(D===-1){D=N,R=E.extended.urlId;continue}k=E.extended.urlId!==R}else D!==-1&&(k=!0);if(k||D!==-1&&N===L-1){const W=this._oscLinkService.getLinkData(R)?.uri;if(W){const U={start:{x:D+1,y:x},end:{x:N+(k||N!==L-1?0:1),y:x}};let F=!1;if(!_?.allowNonHttpProtocols)try{const j=new URL(W);["http:","https:"].includes(j.protocol)||(F=!0)}catch{F=!0}F||f.push({text:W,range:U,activate:(j,J)=>_?_.activate(j,J,U):A(0,J),hover:(j,J)=>_?.hover?.(j,J,U),leave:(j,J)=>_?.leave?.(j,J,U)})}k=!1,E.hasExtendedAttrs()&&E.extended.urlId?(D=N,R=E.extended.urlId):(D=-1,R=-1)}}g(f)}};function A(x,g){if(confirm(`Do you want to navigate to ${g}?
|
|
78
|
+
|
|
79
|
+
WARNING: This link could potentially be dangerous`)){const y=window.open();if(y){try{y.opener=null}catch{}y.location.href=g}else console.warn("Opening link blocked as opener could not be cleared")}}c.OscLinkProvider=w=h([b(0,C.IBufferService),b(1,C.IOptionsService),b(2,C.IOscLinkService)],w)},6193:(m,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.RenderDebouncer=void 0,c.RenderDebouncer=class{constructor(u,h){this._renderCallback=u,this._coreBrowserService=h,this._refreshCallbacks=[]}dispose(){this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}addRefreshCallback(u){return this._refreshCallbacks.push(u),this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._innerRefresh()))),this._animationFrame}refresh(u,h,b){this._rowCount=b,u=u!==void 0?u:0,h=h!==void 0?h:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,u):u,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,h):h,this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._innerRefresh())))}_innerRefresh(){if(this._animationFrame=void 0,this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return void this._runRefreshCallbacks();const u=Math.max(this._rowStart,0),h=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(u,h),this._runRefreshCallbacks()}_runRefreshCallbacks(){for(const u of this._refreshCallbacks)u(0);this._refreshCallbacks=[]}}},3236:(m,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.Terminal=void 0;const h=u(3614),b=u(3656),p=u(3551),C=u(9042),w=u(3730),A=u(1680),x=u(3107),g=u(5744),y=u(2950),f=u(1296),_=u(428),E=u(4269),L=u(5114),R=u(8934),D=u(3230),k=u(9312),N=u(4725),W=u(6731),U=u(8055),F=u(8969),j=u(8460),J=u(844),te=u(6114),P=u(8437),V=u(2584),Y=u(7399),B=u(5941),z=u(9074),O=u(2585),H=u(5435),X=u(4567),ae=u(779);class ce extends F.CoreTerminal{get onFocus(){return this._onFocus.event}get onBlur(){return this._onBlur.event}get onA11yChar(){return this._onA11yCharEmitter.event}get onA11yTab(){return this._onA11yTabEmitter.event}get onWillOpen(){return this._onWillOpen.event}constructor(Q={}){super(Q),this.browser=te,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this.register(new J.MutableDisposable),this._onCursorMove=this.register(new j.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onKey=this.register(new j.EventEmitter),this.onKey=this._onKey.event,this._onRender=this.register(new j.EventEmitter),this.onRender=this._onRender.event,this._onSelectionChange=this.register(new j.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onTitleChange=this.register(new j.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onBell=this.register(new j.EventEmitter),this.onBell=this._onBell.event,this._onFocus=this.register(new j.EventEmitter),this._onBlur=this.register(new j.EventEmitter),this._onA11yCharEmitter=this.register(new j.EventEmitter),this._onA11yTabEmitter=this.register(new j.EventEmitter),this._onWillOpen=this.register(new j.EventEmitter),this._setup(),this._decorationService=this._instantiationService.createInstance(z.DecorationService),this._instantiationService.setService(O.IDecorationService,this._decorationService),this._linkProviderService=this._instantiationService.createInstance(ae.LinkProviderService),this._instantiationService.setService(N.ILinkProviderService,this._linkProviderService),this._linkProviderService.registerLinkProvider(this._instantiationService.createInstance(w.OscLinkProvider)),this.register(this._inputHandler.onRequestBell((()=>this._onBell.fire()))),this.register(this._inputHandler.onRequestRefreshRows((($,oe)=>this.refresh($,oe)))),this.register(this._inputHandler.onRequestSendFocus((()=>this._reportFocus()))),this.register(this._inputHandler.onRequestReset((()=>this.reset()))),this.register(this._inputHandler.onRequestWindowsOptionsReport(($=>this._reportWindowsOptions($)))),this.register(this._inputHandler.onColor(($=>this._handleColorEvent($)))),this.register((0,j.forwardEvent)(this._inputHandler.onCursorMove,this._onCursorMove)),this.register((0,j.forwardEvent)(this._inputHandler.onTitleChange,this._onTitleChange)),this.register((0,j.forwardEvent)(this._inputHandler.onA11yChar,this._onA11yCharEmitter)),this.register((0,j.forwardEvent)(this._inputHandler.onA11yTab,this._onA11yTabEmitter)),this.register(this._bufferService.onResize(($=>this._afterResize($.cols,$.rows)))),this.register((0,J.toDisposable)((()=>{this._customKeyEventHandler=void 0,this.element?.parentNode?.removeChild(this.element)})))}_handleColorEvent(Q){if(this._themeService)for(const $ of Q){let oe,ge="";switch($.index){case 256:oe="foreground",ge="10";break;case 257:oe="background",ge="11";break;case 258:oe="cursor",ge="12";break;default:oe="ansi",ge="4;"+$.index}switch($.type){case 0:const ye=U.color.toColorRGB(oe==="ansi"?this._themeService.colors.ansi[$.index]:this._themeService.colors[oe]);this.coreService.triggerDataEvent(`${V.C0.ESC}]${ge};${(0,B.toRgbString)(ye)}${V.C1_ESCAPED.ST}`);break;case 1:if(oe==="ansi")this._themeService.modifyColors((be=>be.ansi[$.index]=U.channels.toColor(...$.color)));else{const be=oe;this._themeService.modifyColors(($e=>$e[be]=U.channels.toColor(...$.color)))}break;case 2:this._themeService.restoreColor($.index)}}}_setup(){super._setup(),this._customKeyEventHandler=void 0}get buffer(){return this.buffers.active}focus(){this.textarea&&this.textarea.focus({preventScroll:!0})}_handleScreenReaderModeOptionChange(Q){Q?!this._accessibilityManager.value&&this._renderService&&(this._accessibilityManager.value=this._instantiationService.createInstance(X.AccessibilityManager,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(Q){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(V.C0.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(V.C0.ESC+"[O"),this.element.classList.remove("focus"),this._onBlur.fire()}_syncTextArea(){if(!this.textarea||!this.buffer.isCursorInViewport||this._compositionHelper.isComposing||!this._renderService)return;const Q=this.buffer.ybase+this.buffer.y,$=this.buffer.lines.get(Q);if(!$)return;const oe=Math.min(this.buffer.x,this.cols-1),ge=this._renderService.dimensions.css.cell.height,ye=$.getWidth(oe),be=this._renderService.dimensions.css.cell.width*ye,$e=this.buffer.y*this._renderService.dimensions.css.cell.height,Pe=oe*this._renderService.dimensions.css.cell.width;this.textarea.style.left=Pe+"px",this.textarea.style.top=$e+"px",this.textarea.style.width=be+"px",this.textarea.style.height=ge+"px",this.textarea.style.lineHeight=ge+"px",this.textarea.style.zIndex="-5"}_initGlobal(){this._bindKeys(),this.register((0,b.addDisposableDomListener)(this.element,"copy",($=>{this.hasSelection()&&(0,h.copyHandler)($,this._selectionService)})));const Q=$=>(0,h.handlePasteEvent)($,this.textarea,this.coreService,this.optionsService);this.register((0,b.addDisposableDomListener)(this.textarea,"paste",Q)),this.register((0,b.addDisposableDomListener)(this.element,"paste",Q)),te.isFirefox?this.register((0,b.addDisposableDomListener)(this.element,"mousedown",($=>{$.button===2&&(0,h.rightClickHandler)($,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))):this.register((0,b.addDisposableDomListener)(this.element,"contextmenu",($=>{(0,h.rightClickHandler)($,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))),te.isLinux&&this.register((0,b.addDisposableDomListener)(this.element,"auxclick",($=>{$.button===1&&(0,h.moveTextAreaUnderMouseCursor)($,this.textarea,this.screenElement)})))}_bindKeys(){this.register((0,b.addDisposableDomListener)(this.textarea,"keyup",(Q=>this._keyUp(Q)),!0)),this.register((0,b.addDisposableDomListener)(this.textarea,"keydown",(Q=>this._keyDown(Q)),!0)),this.register((0,b.addDisposableDomListener)(this.textarea,"keypress",(Q=>this._keyPress(Q)),!0)),this.register((0,b.addDisposableDomListener)(this.textarea,"compositionstart",(()=>this._compositionHelper.compositionstart()))),this.register((0,b.addDisposableDomListener)(this.textarea,"compositionupdate",(Q=>this._compositionHelper.compositionupdate(Q)))),this.register((0,b.addDisposableDomListener)(this.textarea,"compositionend",(()=>this._compositionHelper.compositionend()))),this.register((0,b.addDisposableDomListener)(this.textarea,"input",(Q=>this._inputEvent(Q)),!0)),this.register(this.onRender((()=>this._compositionHelper.updateCompositionElements())))}open(Q){if(!Q)throw new Error("Terminal requires a parent element.");if(Q.isConnected||this._logService.debug("Terminal.open was called on an element that was not attached to the DOM"),this.element?.ownerDocument.defaultView&&this._coreBrowserService)return void(this.element.ownerDocument.defaultView!==this._coreBrowserService.window&&(this._coreBrowserService.window=this.element.ownerDocument.defaultView));this._document=Q.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"),Q.appendChild(this.element);const $=this._document.createDocumentFragment();this._viewportElement=this._document.createElement("div"),this._viewportElement.classList.add("xterm-viewport"),$.appendChild(this._viewportElement),this._viewportScrollArea=this._document.createElement("div"),this._viewportScrollArea.classList.add("xterm-scroll-area"),this._viewportElement.appendChild(this._viewportScrollArea),this.screenElement=this._document.createElement("div"),this.screenElement.classList.add("xterm-screen"),this.register((0,b.addDisposableDomListener)(this.screenElement,"mousemove",(oe=>this.updateCursorStyle(oe)))),this._helperContainer=this._document.createElement("div"),this._helperContainer.classList.add("xterm-helpers"),this.screenElement.appendChild(this._helperContainer),$.appendChild(this.screenElement),this.textarea=this._document.createElement("textarea"),this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",C.promptLabel),te.isChromeOS||this.textarea.setAttribute("aria-multiline","false"),this.textarea.setAttribute("autocorrect","off"),this.textarea.setAttribute("autocapitalize","off"),this.textarea.setAttribute("spellcheck","false"),this.textarea.tabIndex=0,this._coreBrowserService=this.register(this._instantiationService.createInstance(L.CoreBrowserService,this.textarea,Q.ownerDocument.defaultView??window,this._document??typeof window<"u"?window.document:null)),this._instantiationService.setService(N.ICoreBrowserService,this._coreBrowserService),this.register((0,b.addDisposableDomListener)(this.textarea,"focus",(oe=>this._handleTextAreaFocus(oe)))),this.register((0,b.addDisposableDomListener)(this.textarea,"blur",(()=>this._handleTextAreaBlur()))),this._helperContainer.appendChild(this.textarea),this._charSizeService=this._instantiationService.createInstance(_.CharSizeService,this._document,this._helperContainer),this._instantiationService.setService(N.ICharSizeService,this._charSizeService),this._themeService=this._instantiationService.createInstance(W.ThemeService),this._instantiationService.setService(N.IThemeService,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(E.CharacterJoinerService),this._instantiationService.setService(N.ICharacterJoinerService,this._characterJoinerService),this._renderService=this.register(this._instantiationService.createInstance(D.RenderService,this.rows,this.screenElement)),this._instantiationService.setService(N.IRenderService,this._renderService),this.register(this._renderService.onRenderedViewportChange((oe=>this._onRender.fire(oe)))),this.onResize((oe=>this._renderService.resize(oe.cols,oe.rows))),this._compositionView=this._document.createElement("div"),this._compositionView.classList.add("composition-view"),this._compositionHelper=this._instantiationService.createInstance(y.CompositionHelper,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this._mouseService=this._instantiationService.createInstance(R.MouseService),this._instantiationService.setService(N.IMouseService,this._mouseService),this.linkifier=this.register(this._instantiationService.createInstance(p.Linkifier,this.screenElement)),this.element.appendChild($);try{this._onWillOpen.fire(this.element)}catch{}this._renderService.hasRenderer()||this._renderService.setRenderer(this._createRenderer()),this.viewport=this._instantiationService.createInstance(A.Viewport,this._viewportElement,this._viewportScrollArea),this.viewport.onRequestScrollLines((oe=>this.scrollLines(oe.amount,oe.suppressScrollEvent,1))),this.register(this._inputHandler.onRequestSyncScrollBar((()=>this.viewport.syncScrollArea()))),this.register(this.viewport),this.register(this.onCursorMove((()=>{this._renderService.handleCursorMove(),this._syncTextArea()}))),this.register(this.onResize((()=>this._renderService.handleResize(this.cols,this.rows)))),this.register(this.onBlur((()=>this._renderService.handleBlur()))),this.register(this.onFocus((()=>this._renderService.handleFocus()))),this.register(this._renderService.onDimensionsChange((()=>this.viewport.syncScrollArea()))),this._selectionService=this.register(this._instantiationService.createInstance(k.SelectionService,this.element,this.screenElement,this.linkifier)),this._instantiationService.setService(N.ISelectionService,this._selectionService),this.register(this._selectionService.onRequestScrollLines((oe=>this.scrollLines(oe.amount,oe.suppressScrollEvent)))),this.register(this._selectionService.onSelectionChange((()=>this._onSelectionChange.fire()))),this.register(this._selectionService.onRequestRedraw((oe=>this._renderService.handleSelectionChanged(oe.start,oe.end,oe.columnSelectMode)))),this.register(this._selectionService.onLinuxMouseSelection((oe=>{this.textarea.value=oe,this.textarea.focus(),this.textarea.select()}))),this.register(this._onScroll.event((oe=>{this.viewport.syncScrollArea(),this._selectionService.refresh()}))),this.register((0,b.addDisposableDomListener)(this._viewportElement,"scroll",(()=>this._selectionService.refresh()))),this.register(this._instantiationService.createInstance(x.BufferDecorationRenderer,this.screenElement)),this.register((0,b.addDisposableDomListener)(this.element,"mousedown",(oe=>this._selectionService.handleMouseDown(oe)))),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(X.AccessibilityManager,this)),this.register(this.optionsService.onSpecificOptionChange("screenReaderMode",(oe=>this._handleScreenReaderModeOptionChange(oe)))),this.options.overviewRulerWidth&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(g.OverviewRulerRenderer,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRulerWidth",(oe=>{!this._overviewRulerRenderer&&oe&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(g.OverviewRulerRenderer,this._viewportElement,this.screenElement)))})),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()}_createRenderer(){return this._instantiationService.createInstance(f.DomRenderer,this,this._document,this.element,this.screenElement,this._viewportElement,this._helperContainer,this.linkifier)}bindMouse(){const Q=this,$=this.element;function oe(be){const $e=Q._mouseService.getMouseReportCoords(be,Q.screenElement);if(!$e)return!1;let Pe,Ye;switch(be.overrideType||be.type){case"mousemove":Ye=32,be.buttons===void 0?(Pe=3,be.button!==void 0&&(Pe=be.button<3?be.button:3)):Pe=1&be.buttons?0:4&be.buttons?1:2&be.buttons?2:3;break;case"mouseup":Ye=0,Pe=be.button<3?be.button:3;break;case"mousedown":Ye=1,Pe=be.button<3?be.button:3;break;case"wheel":if(Q._customWheelEventHandler&&Q._customWheelEventHandler(be)===!1||Q.viewport.getLinesScrolled(be)===0)return!1;Ye=be.deltaY<0?0:1,Pe=4;break;default:return!1}return!(Ye===void 0||Pe===void 0||Pe>4)&&Q.coreMouseService.triggerMouseEvent({col:$e.col,row:$e.row,x:$e.x,y:$e.y,button:Pe,action:Ye,ctrl:be.ctrlKey,alt:be.altKey,shift:be.shiftKey})}const ge={mouseup:null,wheel:null,mousedrag:null,mousemove:null},ye={mouseup:be=>(oe(be),be.buttons||(this._document.removeEventListener("mouseup",ge.mouseup),ge.mousedrag&&this._document.removeEventListener("mousemove",ge.mousedrag)),this.cancel(be)),wheel:be=>(oe(be),this.cancel(be,!0)),mousedrag:be=>{be.buttons&&oe(be)},mousemove:be=>{be.buttons||oe(be)}};this.register(this.coreMouseService.onProtocolChange((be=>{be?(this.optionsService.rawOptions.logLevel==="debug"&&this._logService.debug("Binding to mouse events:",this.coreMouseService.explainEvents(be)),this.element.classList.add("enable-mouse-events"),this._selectionService.disable()):(this._logService.debug("Unbinding from mouse events."),this.element.classList.remove("enable-mouse-events"),this._selectionService.enable()),8&be?ge.mousemove||($.addEventListener("mousemove",ye.mousemove),ge.mousemove=ye.mousemove):($.removeEventListener("mousemove",ge.mousemove),ge.mousemove=null),16&be?ge.wheel||($.addEventListener("wheel",ye.wheel,{passive:!1}),ge.wheel=ye.wheel):($.removeEventListener("wheel",ge.wheel),ge.wheel=null),2&be?ge.mouseup||(ge.mouseup=ye.mouseup):(this._document.removeEventListener("mouseup",ge.mouseup),ge.mouseup=null),4&be?ge.mousedrag||(ge.mousedrag=ye.mousedrag):(this._document.removeEventListener("mousemove",ge.mousedrag),ge.mousedrag=null)}))),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this.register((0,b.addDisposableDomListener)($,"mousedown",(be=>{if(be.preventDefault(),this.focus(),this.coreMouseService.areMouseEventsActive&&!this._selectionService.shouldForceSelection(be))return oe(be),ge.mouseup&&this._document.addEventListener("mouseup",ge.mouseup),ge.mousedrag&&this._document.addEventListener("mousemove",ge.mousedrag),this.cancel(be)}))),this.register((0,b.addDisposableDomListener)($,"wheel",(be=>{if(!ge.wheel){if(this._customWheelEventHandler&&this._customWheelEventHandler(be)===!1)return!1;if(!this.buffer.hasScrollback){const $e=this.viewport.getLinesScrolled(be);if($e===0)return;const Pe=V.C0.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(be.deltaY<0?"A":"B");let Ye="";for(let Ct=0;Ct<Math.abs($e);Ct++)Ye+=Pe;return this.coreService.triggerDataEvent(Ye,!0),this.cancel(be,!0)}return this.viewport.handleWheel(be)?this.cancel(be):void 0}}),{passive:!1})),this.register((0,b.addDisposableDomListener)($,"touchstart",(be=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchStart(be),this.cancel(be)}),{passive:!0})),this.register((0,b.addDisposableDomListener)($,"touchmove",(be=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchMove(be)?void 0:this.cancel(be)}),{passive:!1}))}refresh(Q,$){this._renderService?.refreshRows(Q,$)}updateCursorStyle(Q){this._selectionService?.shouldColumnSelect(Q)?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(Q,$,oe=0){oe===1?(super.scrollLines(Q,$,oe),this.refresh(0,this.rows-1)):this.viewport?.scrollLines(Q)}paste(Q){(0,h.paste)(Q,this.textarea,this.coreService,this.optionsService)}attachCustomKeyEventHandler(Q){this._customKeyEventHandler=Q}attachCustomWheelEventHandler(Q){this._customWheelEventHandler=Q}registerLinkProvider(Q){return this._linkProviderService.registerLinkProvider(Q)}registerCharacterJoiner(Q){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");const $=this._characterJoinerService.register(Q);return this.refresh(0,this.rows-1),$}deregisterCharacterJoiner(Q){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");this._characterJoinerService.deregister(Q)&&this.refresh(0,this.rows-1)}get markers(){return this.buffer.markers}registerMarker(Q){return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+Q)}registerDecoration(Q){return this._decorationService.registerDecoration(Q)}hasSelection(){return!!this._selectionService&&this._selectionService.hasSelection}select(Q,$,oe){this._selectionService.setSelection(Q,$,oe)}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(Q,$){this._selectionService?.selectLines(Q,$)}_keyDown(Q){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&this._customKeyEventHandler(Q)===!1)return!1;const $=this.browser.isMac&&this.options.macOptionIsMeta&&Q.altKey;if(!$&&!this._compositionHelper.keydown(Q))return this.options.scrollOnUserInput&&this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(),!1;$||Q.key!=="Dead"&&Q.key!=="AltGraph"||(this._unprocessedDeadKey=!0);const oe=(0,Y.evaluateKeyboardEvent)(Q,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(Q),oe.type===3||oe.type===2){const ge=this.rows-1;return this.scrollLines(oe.type===2?-ge:ge),this.cancel(Q,!0)}return oe.type===1&&this.selectAll(),!!this._isThirdLevelShift(this.browser,Q)||(oe.cancel&&this.cancel(Q,!0),!oe.key||!!(Q.key&&!Q.ctrlKey&&!Q.altKey&&!Q.metaKey&&Q.key.length===1&&Q.key.charCodeAt(0)>=65&&Q.key.charCodeAt(0)<=90)||(this._unprocessedDeadKey?(this._unprocessedDeadKey=!1,!0):(oe.key!==V.C0.ETX&&oe.key!==V.C0.CR||(this.textarea.value=""),this._onKey.fire({key:oe.key,domEvent:Q}),this._showCursor(),this.coreService.triggerDataEvent(oe.key,!0),!this.optionsService.rawOptions.screenReaderMode||Q.altKey||Q.ctrlKey?this.cancel(Q,!0):void(this._keyDownHandled=!0))))}_isThirdLevelShift(Q,$){const oe=Q.isMac&&!this.options.macOptionIsMeta&&$.altKey&&!$.ctrlKey&&!$.metaKey||Q.isWindows&&$.altKey&&$.ctrlKey&&!$.metaKey||Q.isWindows&&$.getModifierState("AltGraph");return $.type==="keypress"?oe:oe&&(!$.keyCode||$.keyCode>47)}_keyUp(Q){this._keyDownSeen=!1,this._customKeyEventHandler&&this._customKeyEventHandler(Q)===!1||((function($){return $.keyCode===16||$.keyCode===17||$.keyCode===18})(Q)||this.focus(),this.updateCursorStyle(Q),this._keyPressHandled=!1)}_keyPress(Q){let $;if(this._keyPressHandled=!1,this._keyDownHandled||this._customKeyEventHandler&&this._customKeyEventHandler(Q)===!1)return!1;if(this.cancel(Q),Q.charCode)$=Q.charCode;else if(Q.which===null||Q.which===void 0)$=Q.keyCode;else{if(Q.which===0||Q.charCode===0)return!1;$=Q.which}return!(!$||(Q.altKey||Q.ctrlKey||Q.metaKey)&&!this._isThirdLevelShift(this.browser,Q)||($=String.fromCharCode($),this._onKey.fire({key:$,domEvent:Q}),this._showCursor(),this.coreService.triggerDataEvent($,!0),this._keyPressHandled=!0,this._unprocessedDeadKey=!1,0))}_inputEvent(Q){if(Q.data&&Q.inputType==="insertText"&&(!Q.composed||!this._keyDownSeen)&&!this.optionsService.rawOptions.screenReaderMode){if(this._keyPressHandled)return!1;this._unprocessedDeadKey=!1;const $=Q.data;return this.coreService.triggerDataEvent($,!0),this.cancel(Q),!0}return!1}resize(Q,$){Q!==this.cols||$!==this.rows?super.resize(Q,$):this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure()}_afterResize(Q,$){this._charSizeService?.measure(),this.viewport?.syncScrollArea(!0)}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 Q=1;Q<this.rows;Q++)this.buffer.lines.push(this.buffer.getBlankLine(P.DEFAULT_ATTR_DATA));this._onScroll.fire({position:this.buffer.ydisp,source:0}),this.viewport?.reset(),this.refresh(0,this.rows-1)}}reset(){this.options.rows=this.rows,this.options.cols=this.cols;const Q=this._customKeyEventHandler;this._setup(),super.reset(),this._selectionService?.reset(),this._decorationService.reset(),this.viewport?.reset(),this._customKeyEventHandler=Q,this.refresh(0,this.rows-1)}clearTextureAtlas(){this._renderService?.clearTextureAtlas()}_reportFocus(){this.element?.classList.contains("focus")?this.coreService.triggerDataEvent(V.C0.ESC+"[I"):this.coreService.triggerDataEvent(V.C0.ESC+"[O")}_reportWindowsOptions(Q){if(this._renderService)switch(Q){case H.WindowsOptionsReportType.GET_WIN_SIZE_PIXELS:const $=this._renderService.dimensions.css.canvas.width.toFixed(0),oe=this._renderService.dimensions.css.canvas.height.toFixed(0);this.coreService.triggerDataEvent(`${V.C0.ESC}[4;${oe};${$}t`);break;case H.WindowsOptionsReportType.GET_CELL_SIZE_PIXELS:const ge=this._renderService.dimensions.css.cell.width.toFixed(0),ye=this._renderService.dimensions.css.cell.height.toFixed(0);this.coreService.triggerDataEvent(`${V.C0.ESC}[6;${ye};${ge}t`)}}cancel(Q,$){if(this.options.cancelEvents||$)return Q.preventDefault(),Q.stopPropagation(),!1}}c.Terminal=ce},9924:(m,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.TimeBasedDebouncer=void 0,c.TimeBasedDebouncer=class{constructor(u,h=1e3){this._renderCallback=u,this._debounceThresholdMS=h,this._lastRefreshMs=0,this._additionalRefreshRequested=!1}dispose(){this._refreshTimeoutID&&clearTimeout(this._refreshTimeoutID)}refresh(u,h,b){this._rowCount=b,u=u!==void 0?u:0,h=h!==void 0?h:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,u):u,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,h):h;const p=Date.now();if(p-this._lastRefreshMs>=this._debounceThresholdMS)this._lastRefreshMs=p,this._innerRefresh();else if(!this._additionalRefreshRequested){const C=p-this._lastRefreshMs,w=this._debounceThresholdMS-C;this._additionalRefreshRequested=!0,this._refreshTimeoutID=window.setTimeout((()=>{this._lastRefreshMs=Date.now(),this._innerRefresh(),this._additionalRefreshRequested=!1,this._refreshTimeoutID=void 0}),w)}}_innerRefresh(){if(this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return;const u=Math.max(this._rowStart,0),h=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(u,h)}}},1680:function(m,c,u){var h=this&&this.__decorate||function(y,f,_,E){var L,R=arguments.length,D=R<3?f:E===null?E=Object.getOwnPropertyDescriptor(f,_):E;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")D=Reflect.decorate(y,f,_,E);else for(var k=y.length-1;k>=0;k--)(L=y[k])&&(D=(R<3?L(D):R>3?L(f,_,D):L(f,_))||D);return R>3&&D&&Object.defineProperty(f,_,D),D},b=this&&this.__param||function(y,f){return function(_,E){f(_,E,y)}};Object.defineProperty(c,"__esModule",{value:!0}),c.Viewport=void 0;const p=u(3656),C=u(4725),w=u(8460),A=u(844),x=u(2585);let g=c.Viewport=class extends A.Disposable{constructor(y,f,_,E,L,R,D,k){super(),this._viewportElement=y,this._scrollArea=f,this._bufferService=_,this._optionsService=E,this._charSizeService=L,this._renderService=R,this._coreBrowserService=D,this.scrollBarWidth=0,this._currentRowHeight=0,this._currentDeviceCellHeight=0,this._lastRecordedBufferLength=0,this._lastRecordedViewportHeight=0,this._lastRecordedBufferHeight=0,this._lastTouchY=0,this._lastScrollTop=0,this._wheelPartialScroll=0,this._refreshAnimationFrame=null,this._ignoreNextScrollEvent=!1,this._smoothScrollState={startTime:0,origin:-1,target:-1},this._onRequestScrollLines=this.register(new w.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this.scrollBarWidth=this._viewportElement.offsetWidth-this._scrollArea.offsetWidth||15,this.register((0,p.addDisposableDomListener)(this._viewportElement,"scroll",this._handleScroll.bind(this))),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate((N=>this._activeBuffer=N.activeBuffer))),this._renderDimensions=this._renderService.dimensions,this.register(this._renderService.onDimensionsChange((N=>this._renderDimensions=N))),this._handleThemeChange(k.colors),this.register(k.onChangeColors((N=>this._handleThemeChange(N)))),this.register(this._optionsService.onSpecificOptionChange("scrollback",(()=>this.syncScrollArea()))),setTimeout((()=>this.syncScrollArea()))}_handleThemeChange(y){this._viewportElement.style.backgroundColor=y.background.css}reset(){this._currentRowHeight=0,this._currentDeviceCellHeight=0,this._lastRecordedBufferLength=0,this._lastRecordedViewportHeight=0,this._lastRecordedBufferHeight=0,this._lastTouchY=0,this._lastScrollTop=0,this._coreBrowserService.window.requestAnimationFrame((()=>this.syncScrollArea()))}_refresh(y){if(y)return this._innerRefresh(),void(this._refreshAnimationFrame!==null&&this._coreBrowserService.window.cancelAnimationFrame(this._refreshAnimationFrame));this._refreshAnimationFrame===null&&(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._innerRefresh())))}_innerRefresh(){if(this._charSizeService.height>0){this._currentRowHeight=this._renderDimensions.device.cell.height/this._coreBrowserService.dpr,this._currentDeviceCellHeight=this._renderDimensions.device.cell.height,this._lastRecordedViewportHeight=this._viewportElement.offsetHeight;const f=Math.round(this._currentRowHeight*this._lastRecordedBufferLength)+(this._lastRecordedViewportHeight-this._renderDimensions.css.canvas.height);this._lastRecordedBufferHeight!==f&&(this._lastRecordedBufferHeight=f,this._scrollArea.style.height=this._lastRecordedBufferHeight+"px")}const y=this._bufferService.buffer.ydisp*this._currentRowHeight;this._viewportElement.scrollTop!==y&&(this._ignoreNextScrollEvent=!0,this._viewportElement.scrollTop=y),this._refreshAnimationFrame=null}syncScrollArea(y=!1){if(this._lastRecordedBufferLength!==this._bufferService.buffer.lines.length)return this._lastRecordedBufferLength=this._bufferService.buffer.lines.length,void this._refresh(y);this._lastRecordedViewportHeight===this._renderService.dimensions.css.canvas.height&&this._lastScrollTop===this._activeBuffer.ydisp*this._currentRowHeight&&this._renderDimensions.device.cell.height===this._currentDeviceCellHeight||this._refresh(y)}_handleScroll(y){if(this._lastScrollTop=this._viewportElement.scrollTop,!this._viewportElement.offsetParent)return;if(this._ignoreNextScrollEvent)return this._ignoreNextScrollEvent=!1,void this._onRequestScrollLines.fire({amount:0,suppressScrollEvent:!0});const f=Math.round(this._lastScrollTop/this._currentRowHeight)-this._bufferService.buffer.ydisp;this._onRequestScrollLines.fire({amount:f,suppressScrollEvent:!0})}_smoothScroll(){if(this._isDisposed||this._smoothScrollState.origin===-1||this._smoothScrollState.target===-1)return;const y=this._smoothScrollPercent();this._viewportElement.scrollTop=this._smoothScrollState.origin+Math.round(y*(this._smoothScrollState.target-this._smoothScrollState.origin)),y<1?this._coreBrowserService.window.requestAnimationFrame((()=>this._smoothScroll())):this._clearSmoothScrollState()}_smoothScrollPercent(){return this._optionsService.rawOptions.smoothScrollDuration&&this._smoothScrollState.startTime?Math.max(Math.min((Date.now()-this._smoothScrollState.startTime)/this._optionsService.rawOptions.smoothScrollDuration,1),0):1}_clearSmoothScrollState(){this._smoothScrollState.startTime=0,this._smoothScrollState.origin=-1,this._smoothScrollState.target=-1}_bubbleScroll(y,f){const _=this._viewportElement.scrollTop+this._lastRecordedViewportHeight;return!(f<0&&this._viewportElement.scrollTop!==0||f>0&&_<this._lastRecordedBufferHeight)||(y.cancelable&&y.preventDefault(),!1)}handleWheel(y){const f=this._getPixelsScrolled(y);return f!==0&&(this._optionsService.rawOptions.smoothScrollDuration?(this._smoothScrollState.startTime=Date.now(),this._smoothScrollPercent()<1?(this._smoothScrollState.origin=this._viewportElement.scrollTop,this._smoothScrollState.target===-1?this._smoothScrollState.target=this._viewportElement.scrollTop+f:this._smoothScrollState.target+=f,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()):this._viewportElement.scrollTop+=f,this._bubbleScroll(y,f))}scrollLines(y){if(y!==0)if(this._optionsService.rawOptions.smoothScrollDuration){const f=y*this._currentRowHeight;this._smoothScrollState.startTime=Date.now(),this._smoothScrollPercent()<1?(this._smoothScrollState.origin=this._viewportElement.scrollTop,this._smoothScrollState.target=this._smoothScrollState.origin+f,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()}else this._onRequestScrollLines.fire({amount:y,suppressScrollEvent:!1})}_getPixelsScrolled(y){if(y.deltaY===0||y.shiftKey)return 0;let f=this._applyScrollModifier(y.deltaY,y);return y.deltaMode===WheelEvent.DOM_DELTA_LINE?f*=this._currentRowHeight:y.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(f*=this._currentRowHeight*this._bufferService.rows),f}getBufferElements(y,f){let _,E="";const L=[],R=f??this._bufferService.buffer.lines.length,D=this._bufferService.buffer.lines;for(let k=y;k<R;k++){const N=D.get(k);if(!N)continue;const W=D.get(k+1)?.isWrapped;if(E+=N.translateToString(!W),!W||k===D.length-1){const U=document.createElement("div");U.textContent=E,L.push(U),E.length>0&&(_=U),E=""}}return{bufferElements:L,cursorElement:_}}getLinesScrolled(y){if(y.deltaY===0||y.shiftKey)return 0;let f=this._applyScrollModifier(y.deltaY,y);return y.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(f/=this._currentRowHeight+0,this._wheelPartialScroll+=f,f=Math.floor(Math.abs(this._wheelPartialScroll))*(this._wheelPartialScroll>0?1:-1),this._wheelPartialScroll%=1):y.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(f*=this._bufferService.rows),f}_applyScrollModifier(y,f){const _=this._optionsService.rawOptions.fastScrollModifier;return _==="alt"&&f.altKey||_==="ctrl"&&f.ctrlKey||_==="shift"&&f.shiftKey?y*this._optionsService.rawOptions.fastScrollSensitivity*this._optionsService.rawOptions.scrollSensitivity:y*this._optionsService.rawOptions.scrollSensitivity}handleTouchStart(y){this._lastTouchY=y.touches[0].pageY}handleTouchMove(y){const f=this._lastTouchY-y.touches[0].pageY;return this._lastTouchY=y.touches[0].pageY,f!==0&&(this._viewportElement.scrollTop+=f,this._bubbleScroll(y,f))}};c.Viewport=g=h([b(2,x.IBufferService),b(3,x.IOptionsService),b(4,C.ICharSizeService),b(5,C.IRenderService),b(6,C.ICoreBrowserService),b(7,C.IThemeService)],g)},3107:function(m,c,u){var h=this&&this.__decorate||function(x,g,y,f){var _,E=arguments.length,L=E<3?g:f===null?f=Object.getOwnPropertyDescriptor(g,y):f;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")L=Reflect.decorate(x,g,y,f);else for(var R=x.length-1;R>=0;R--)(_=x[R])&&(L=(E<3?_(L):E>3?_(g,y,L):_(g,y))||L);return E>3&&L&&Object.defineProperty(g,y,L),L},b=this&&this.__param||function(x,g){return function(y,f){g(y,f,x)}};Object.defineProperty(c,"__esModule",{value:!0}),c.BufferDecorationRenderer=void 0;const p=u(4725),C=u(844),w=u(2585);let A=c.BufferDecorationRenderer=class extends C.Disposable{constructor(x,g,y,f,_){super(),this._screenElement=x,this._bufferService=g,this._coreBrowserService=y,this._decorationService=f,this._renderService=_,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((E=>this._removeDecoration(E)))),this.register((0,C.toDisposable)((()=>{this._container.remove(),this._decorationElements.clear()})))}_queueRefresh(){this._animationFrame===void 0&&(this._animationFrame=this._renderService.addRefreshCallback((()=>{this._doRefreshDecorations(),this._animationFrame=void 0})))}_doRefreshDecorations(){for(const x of this._decorationService.decorations)this._renderDecoration(x);this._dimensionsChanged=!1}_renderDecoration(x){this._refreshStyle(x),this._dimensionsChanged&&this._refreshXPosition(x)}_createElement(x){const g=this._coreBrowserService.mainDocument.createElement("div");g.classList.add("xterm-decoration"),g.classList.toggle("xterm-decoration-top-layer",x?.options?.layer==="top"),g.style.width=`${Math.round((x.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,g.style.height=(x.options.height||1)*this._renderService.dimensions.css.cell.height+"px",g.style.top=(x.marker.line-this._bufferService.buffers.active.ydisp)*this._renderService.dimensions.css.cell.height+"px",g.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`;const y=x.options.x??0;return y&&y>this._bufferService.cols&&(g.style.display="none"),this._refreshXPosition(x,g),g}_refreshStyle(x){const g=x.marker.line-this._bufferService.buffers.active.ydisp;if(g<0||g>=this._bufferService.rows)x.element&&(x.element.style.display="none",x.onRenderEmitter.fire(x.element));else{let y=this._decorationElements.get(x);y||(y=this._createElement(x),x.element=y,this._decorationElements.set(x,y),this._container.appendChild(y),x.onDispose((()=>{this._decorationElements.delete(x),y.remove()}))),y.style.top=g*this._renderService.dimensions.css.cell.height+"px",y.style.display=this._altBufferIsActive?"none":"block",x.onRenderEmitter.fire(y)}}_refreshXPosition(x,g=x.element){if(!g)return;const y=x.options.x??0;(x.options.anchor||"left")==="right"?g.style.right=y?y*this._renderService.dimensions.css.cell.width+"px":"":g.style.left=y?y*this._renderService.dimensions.css.cell.width+"px":""}_removeDecoration(x){this._decorationElements.get(x)?.remove(),this._decorationElements.delete(x),x.dispose()}};c.BufferDecorationRenderer=A=h([b(1,w.IBufferService),b(2,p.ICoreBrowserService),b(3,w.IDecorationService),b(4,p.IRenderService)],A)},5871:(m,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.ColorZoneStore=void 0,c.ColorZoneStore=class{constructor(){this._zones=[],this._zonePool=[],this._zonePoolIndex=0,this._linePadding={full:0,left:0,center:0,right:0}}get zones(){return this._zonePool.length=Math.min(this._zonePool.length,this._zones.length),this._zones}clear(){this._zones.length=0,this._zonePoolIndex=0}addDecoration(u){if(u.options.overviewRulerOptions){for(const h of this._zones)if(h.color===u.options.overviewRulerOptions.color&&h.position===u.options.overviewRulerOptions.position){if(this._lineIntersectsZone(h,u.marker.line))return;if(this._lineAdjacentToZone(h,u.marker.line,u.options.overviewRulerOptions.position))return void this._addLineToZone(h,u.marker.line)}if(this._zonePoolIndex<this._zonePool.length)return this._zonePool[this._zonePoolIndex].color=u.options.overviewRulerOptions.color,this._zonePool[this._zonePoolIndex].position=u.options.overviewRulerOptions.position,this._zonePool[this._zonePoolIndex].startBufferLine=u.marker.line,this._zonePool[this._zonePoolIndex].endBufferLine=u.marker.line,void this._zones.push(this._zonePool[this._zonePoolIndex++]);this._zones.push({color:u.options.overviewRulerOptions.color,position:u.options.overviewRulerOptions.position,startBufferLine:u.marker.line,endBufferLine:u.marker.line}),this._zonePool.push(this._zones[this._zones.length-1]),this._zonePoolIndex++}}setPadding(u){this._linePadding=u}_lineIntersectsZone(u,h){return h>=u.startBufferLine&&h<=u.endBufferLine}_lineAdjacentToZone(u,h,b){return h>=u.startBufferLine-this._linePadding[b||"full"]&&h<=u.endBufferLine+this._linePadding[b||"full"]}_addLineToZone(u,h){u.startBufferLine=Math.min(u.startBufferLine,h),u.endBufferLine=Math.max(u.endBufferLine,h)}}},5744:function(m,c,u){var h=this&&this.__decorate||function(_,E,L,R){var D,k=arguments.length,N=k<3?E:R===null?R=Object.getOwnPropertyDescriptor(E,L):R;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")N=Reflect.decorate(_,E,L,R);else for(var W=_.length-1;W>=0;W--)(D=_[W])&&(N=(k<3?D(N):k>3?D(E,L,N):D(E,L))||N);return k>3&&N&&Object.defineProperty(E,L,N),N},b=this&&this.__param||function(_,E){return function(L,R){E(L,R,_)}};Object.defineProperty(c,"__esModule",{value:!0}),c.OverviewRulerRenderer=void 0;const p=u(5871),C=u(4725),w=u(844),A=u(2585),x={full:0,left:0,center:0,right:0},g={full:0,left:0,center:0,right:0},y={full:0,left:0,center:0,right:0};let f=c.OverviewRulerRenderer=class extends w.Disposable{get _width(){return this._optionsService.options.overviewRulerWidth||0}constructor(_,E,L,R,D,k,N){super(),this._viewportElement=_,this._screenElement=E,this._bufferService=L,this._decorationService=R,this._renderService=D,this._optionsService=k,this._coreBrowserService=N,this._colorZoneStore=new p.ColorZoneStore,this._shouldUpdateDimensions=!0,this._shouldUpdateAnchor=!0,this._lastKnownBufferLength=0,this._canvas=this._coreBrowserService.mainDocument.createElement("canvas"),this._canvas.classList.add("xterm-decoration-overview-ruler"),this._refreshCanvasDimensions(),this._viewportElement.parentElement?.insertBefore(this._canvas,this._viewportElement);const W=this._canvas.getContext("2d");if(!W)throw new Error("Ctx cannot be null");this._ctx=W,this._registerDecorationListeners(),this._registerBufferChangeListeners(),this._registerDimensionChangeListeners(),this.register((0,w.toDisposable)((()=>{this._canvas?.remove()})))}_registerDecorationListeners(){this.register(this._decorationService.onDecorationRegistered((()=>this._queueRefresh(void 0,!0)))),this.register(this._decorationService.onDecorationRemoved((()=>this._queueRefresh(void 0,!0))))}_registerBufferChangeListeners(){this.register(this._renderService.onRenderedViewportChange((()=>this._queueRefresh()))),this.register(this._bufferService.buffers.onBufferActivate((()=>{this._canvas.style.display=this._bufferService.buffer===this._bufferService.buffers.alt?"none":"block"}))),this.register(this._bufferService.onScroll((()=>{this._lastKnownBufferLength!==this._bufferService.buffers.normal.lines.length&&(this._refreshDrawHeightConstants(),this._refreshColorZonePadding())})))}_registerDimensionChangeListeners(){this.register(this._renderService.onRender((()=>{this._containerHeight&&this._containerHeight===this._screenElement.clientHeight||(this._queueRefresh(!0),this._containerHeight=this._screenElement.clientHeight)}))),this.register(this._optionsService.onSpecificOptionChange("overviewRulerWidth",(()=>this._queueRefresh(!0)))),this.register(this._coreBrowserService.onDprChange((()=>this._queueRefresh(!0)))),this._queueRefresh(!0)}_refreshDrawConstants(){const _=Math.floor(this._canvas.width/3),E=Math.ceil(this._canvas.width/3);g.full=this._canvas.width,g.left=_,g.center=E,g.right=_,this._refreshDrawHeightConstants(),y.full=0,y.left=0,y.center=g.left,y.right=g.left+g.center}_refreshDrawHeightConstants(){x.full=Math.round(2*this._coreBrowserService.dpr);const _=this._canvas.height/this._bufferService.buffer.lines.length,E=Math.round(Math.max(Math.min(_,12),6)*this._coreBrowserService.dpr);x.left=E,x.center=E,x.right=E}_refreshColorZonePadding(){this._colorZoneStore.setPadding({full:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*x.full),left:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*x.left),center:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*x.center),right:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*x.right)}),this._lastKnownBufferLength=this._bufferService.buffers.normal.lines.length}_refreshCanvasDimensions(){this._canvas.style.width=`${this._width}px`,this._canvas.width=Math.round(this._width*this._coreBrowserService.dpr),this._canvas.style.height=`${this._screenElement.clientHeight}px`,this._canvas.height=Math.round(this._screenElement.clientHeight*this._coreBrowserService.dpr),this._refreshDrawConstants(),this._refreshColorZonePadding()}_refreshDecorations(){this._shouldUpdateDimensions&&this._refreshCanvasDimensions(),this._ctx.clearRect(0,0,this._canvas.width,this._canvas.height),this._colorZoneStore.clear();for(const E of this._decorationService.decorations)this._colorZoneStore.addDecoration(E);this._ctx.lineWidth=1;const _=this._colorZoneStore.zones;for(const E of _)E.position!=="full"&&this._renderColorZone(E);for(const E of _)E.position==="full"&&this._renderColorZone(E);this._shouldUpdateDimensions=!1,this._shouldUpdateAnchor=!1}_renderColorZone(_){this._ctx.fillStyle=_.color,this._ctx.fillRect(y[_.position||"full"],Math.round((this._canvas.height-1)*(_.startBufferLine/this._bufferService.buffers.active.lines.length)-x[_.position||"full"]/2),g[_.position||"full"],Math.round((this._canvas.height-1)*((_.endBufferLine-_.startBufferLine)/this._bufferService.buffers.active.lines.length)+x[_.position||"full"]))}_queueRefresh(_,E){this._shouldUpdateDimensions=_||this._shouldUpdateDimensions,this._shouldUpdateAnchor=E||this._shouldUpdateAnchor,this._animationFrame===void 0&&(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>{this._refreshDecorations(),this._animationFrame=void 0})))}};c.OverviewRulerRenderer=f=h([b(2,A.IBufferService),b(3,A.IDecorationService),b(4,C.IRenderService),b(5,A.IOptionsService),b(6,C.ICoreBrowserService)],f)},2950:function(m,c,u){var h=this&&this.__decorate||function(x,g,y,f){var _,E=arguments.length,L=E<3?g:f===null?f=Object.getOwnPropertyDescriptor(g,y):f;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")L=Reflect.decorate(x,g,y,f);else for(var R=x.length-1;R>=0;R--)(_=x[R])&&(L=(E<3?_(L):E>3?_(g,y,L):_(g,y))||L);return E>3&&L&&Object.defineProperty(g,y,L),L},b=this&&this.__param||function(x,g){return function(y,f){g(y,f,x)}};Object.defineProperty(c,"__esModule",{value:!0}),c.CompositionHelper=void 0;const p=u(4725),C=u(2585),w=u(2584);let A=c.CompositionHelper=class{get isComposing(){return this._isComposing}constructor(x,g,y,f,_,E){this._textarea=x,this._compositionView=g,this._bufferService=y,this._optionsService=f,this._coreService=_,this._renderService=E,this._isComposing=!1,this._isSendingComposition=!1,this._compositionPosition={start:0,end:0},this._dataAlreadySent=""}compositionstart(){this._isComposing=!0,this._compositionPosition.start=this._textarea.value.length,this._compositionView.textContent="",this._dataAlreadySent="",this._compositionView.classList.add("active")}compositionupdate(x){this._compositionView.textContent=x.data,this.updateCompositionElements(),setTimeout((()=>{this._compositionPosition.end=this._textarea.value.length}),0)}compositionend(){this._finalizeComposition(!0)}keydown(x){if(this._isComposing||this._isSendingComposition){if(x.keyCode===229||x.keyCode===16||x.keyCode===17||x.keyCode===18)return!1;this._finalizeComposition(!1)}return x.keyCode!==229||(this._handleAnyTextareaChanges(),!1)}_finalizeComposition(x){if(this._compositionView.classList.remove("active"),this._isComposing=!1,x){const g={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout((()=>{if(this._isSendingComposition){let y;this._isSendingComposition=!1,g.start+=this._dataAlreadySent.length,y=this._isComposing?this._textarea.value.substring(g.start,g.end):this._textarea.value.substring(g.start),y.length>0&&this._coreService.triggerDataEvent(y,!0)}}),0)}else{this._isSendingComposition=!1;const g=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(g,!0)}}_handleAnyTextareaChanges(){const x=this._textarea.value;setTimeout((()=>{if(!this._isComposing){const g=this._textarea.value,y=g.replace(x,"");this._dataAlreadySent=y,g.length>x.length?this._coreService.triggerDataEvent(y,!0):g.length<x.length?this._coreService.triggerDataEvent(`${w.C0.DEL}`,!0):g.length===x.length&&g!==x&&this._coreService.triggerDataEvent(g,!0)}}),0)}updateCompositionElements(x){if(this._isComposing){if(this._bufferService.buffer.isCursorInViewport){const g=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1),y=this._renderService.dimensions.css.cell.height,f=this._bufferService.buffer.y*this._renderService.dimensions.css.cell.height,_=g*this._renderService.dimensions.css.cell.width;this._compositionView.style.left=_+"px",this._compositionView.style.top=f+"px",this._compositionView.style.height=y+"px",this._compositionView.style.lineHeight=y+"px",this._compositionView.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._compositionView.style.fontSize=this._optionsService.rawOptions.fontSize+"px";const E=this._compositionView.getBoundingClientRect();this._textarea.style.left=_+"px",this._textarea.style.top=f+"px",this._textarea.style.width=Math.max(E.width,1)+"px",this._textarea.style.height=Math.max(E.height,1)+"px",this._textarea.style.lineHeight=E.height+"px"}x||setTimeout((()=>this.updateCompositionElements(!0)),0)}}};c.CompositionHelper=A=h([b(2,C.IBufferService),b(3,C.IOptionsService),b(4,C.ICoreService),b(5,p.IRenderService)],A)},9806:(m,c)=>{function u(h,b,p){const C=p.getBoundingClientRect(),w=h.getComputedStyle(p),A=parseInt(w.getPropertyValue("padding-left")),x=parseInt(w.getPropertyValue("padding-top"));return[b.clientX-C.left-A,b.clientY-C.top-x]}Object.defineProperty(c,"__esModule",{value:!0}),c.getCoords=c.getCoordsRelativeToElement=void 0,c.getCoordsRelativeToElement=u,c.getCoords=function(h,b,p,C,w,A,x,g,y){if(!A)return;const f=u(h,b,p);return f?(f[0]=Math.ceil((f[0]+(y?x/2:0))/x),f[1]=Math.ceil(f[1]/g),f[0]=Math.min(Math.max(f[0],1),C+(y?1:0)),f[1]=Math.min(Math.max(f[1],1),w),f):void 0}},9504:(m,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.moveToCellSequence=void 0;const h=u(2584);function b(g,y,f,_){const E=g-p(g,f),L=y-p(y,f),R=Math.abs(E-L)-(function(D,k,N){let W=0;const U=D-p(D,N),F=k-p(k,N);for(let j=0;j<Math.abs(U-F);j++){const J=C(D,k)==="A"?-1:1;N.buffer.lines.get(U+J*j)?.isWrapped&&W++}return W})(g,y,f);return x(R,A(C(g,y),_))}function p(g,y){let f=0,_=y.buffer.lines.get(g),E=_?.isWrapped;for(;E&&g>=0&&g<y.rows;)f++,_=y.buffer.lines.get(--g),E=_?.isWrapped;return f}function C(g,y){return g>y?"A":"B"}function w(g,y,f,_,E,L){let R=g,D=y,k="";for(;R!==f||D!==_;)R+=E?1:-1,E&&R>L.cols-1?(k+=L.buffer.translateBufferLineToString(D,!1,g,R),R=0,g=0,D++):!E&&R<0&&(k+=L.buffer.translateBufferLineToString(D,!1,0,g+1),R=L.cols-1,g=R,D--);return k+L.buffer.translateBufferLineToString(D,!1,g,R)}function A(g,y){const f=y?"O":"[";return h.C0.ESC+f+g}function x(g,y){g=Math.floor(g);let f="";for(let _=0;_<g;_++)f+=y;return f}c.moveToCellSequence=function(g,y,f,_){const E=f.buffer.x,L=f.buffer.y;if(!f.buffer.hasScrollback)return(function(k,N,W,U,F,j){return b(N,U,F,j).length===0?"":x(w(k,N,k,N-p(N,F),!1,F).length,A("D",j))})(E,L,0,y,f,_)+b(L,y,f,_)+(function(k,N,W,U,F,j){let J;J=b(N,U,F,j).length>0?U-p(U,F):N;const te=U,P=(function(V,Y,B,z,O,H){let X;return X=b(B,z,O,H).length>0?z-p(z,O):Y,V<B&&X<=z||V>=B&&X<z?"C":"D"})(k,N,W,U,F,j);return x(w(k,J,W,te,P==="C",F).length,A(P,j))})(E,L,g,y,f,_);let R;if(L===y)return R=E>g?"D":"C",x(Math.abs(E-g),A(R,_));R=L>y?"D":"C";const D=Math.abs(L-y);return x((function(k,N){return N.cols-k})(L>y?g:E,f)+(D-1)*f.cols+1+((L>y?E:g)-1),A(R,_))}},1296:function(m,c,u){var h=this&&this.__decorate||function(j,J,te,P){var V,Y=arguments.length,B=Y<3?J:P===null?P=Object.getOwnPropertyDescriptor(J,te):P;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")B=Reflect.decorate(j,J,te,P);else for(var z=j.length-1;z>=0;z--)(V=j[z])&&(B=(Y<3?V(B):Y>3?V(J,te,B):V(J,te))||B);return Y>3&&B&&Object.defineProperty(J,te,B),B},b=this&&this.__param||function(j,J){return function(te,P){J(te,P,j)}};Object.defineProperty(c,"__esModule",{value:!0}),c.DomRenderer=void 0;const p=u(3787),C=u(2550),w=u(2223),A=u(6171),x=u(6052),g=u(4725),y=u(8055),f=u(8460),_=u(844),E=u(2585),L="xterm-dom-renderer-owner-",R="xterm-rows",D="xterm-fg-",k="xterm-bg-",N="xterm-focus",W="xterm-selection";let U=1,F=c.DomRenderer=class extends _.Disposable{constructor(j,J,te,P,V,Y,B,z,O,H,X,ae,ce){super(),this._terminal=j,this._document=J,this._element=te,this._screenElement=P,this._viewportElement=V,this._helperContainer=Y,this._linkifier2=B,this._charSizeService=O,this._optionsService=H,this._bufferService=X,this._coreBrowserService=ae,this._themeService=ce,this._terminalClass=U++,this._rowElements=[],this._selectionRenderModel=(0,x.createSelectionRenderModel)(),this.onRequestRedraw=this.register(new f.EventEmitter).event,this._rowContainer=this._document.createElement("div"),this._rowContainer.classList.add(R),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(W),this._selectionContainer.setAttribute("aria-hidden","true"),this.dimensions=(0,A.createRenderDimensions)(),this._updateDimensions(),this.register(this._optionsService.onOptionChange((()=>this._handleOptionsChanged()))),this.register(this._themeService.onChangeColors((_e=>this._injectCss(_e)))),this._injectCss(this._themeService.colors),this._rowFactory=z.createInstance(p.DomRendererRowFactory,document),this._element.classList.add(L+this._terminalClass),this._screenElement.appendChild(this._rowContainer),this._screenElement.appendChild(this._selectionContainer),this.register(this._linkifier2.onShowLinkUnderline((_e=>this._handleLinkHover(_e)))),this.register(this._linkifier2.onHideLinkUnderline((_e=>this._handleLinkLeave(_e)))),this.register((0,_.toDisposable)((()=>{this._element.classList.remove(L+this._terminalClass),this._rowContainer.remove(),this._selectionContainer.remove(),this._widthCache.dispose(),this._themeStyleElement.remove(),this._dimensionsStyleElement.remove()}))),this._widthCache=new C.WidthCache(this._document,this._helperContainer),this._widthCache.setFont(this._optionsService.rawOptions.fontFamily,this._optionsService.rawOptions.fontSize,this._optionsService.rawOptions.fontWeight,this._optionsService.rawOptions.fontWeightBold),this._setDefaultSpacing()}_updateDimensions(){const j=this._coreBrowserService.dpr;this.dimensions.device.char.width=this._charSizeService.width*j,this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*j),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/j),this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/j),this.dimensions.css.cell.width=this.dimensions.css.canvas.width/this._bufferService.cols,this.dimensions.css.cell.height=this.dimensions.css.canvas.height/this._bufferService.rows;for(const te of this._rowElements)te.style.width=`${this.dimensions.css.canvas.width}px`,te.style.height=`${this.dimensions.css.cell.height}px`,te.style.lineHeight=`${this.dimensions.css.cell.height}px`,te.style.overflow="hidden";this._dimensionsStyleElement||(this._dimensionsStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._dimensionsStyleElement));const J=`${this._terminalSelector} .${R} span { display: inline-block; height: 100%; vertical-align: top;}`;this._dimensionsStyleElement.textContent=J,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(j){this._themeStyleElement||(this._themeStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._themeStyleElement));let J=`${this._terminalSelector} .${R} { color: ${j.foreground.css}; font-family: ${this._optionsService.rawOptions.fontFamily}; font-size: ${this._optionsService.rawOptions.fontSize}px; font-kerning: none; white-space: pre}`;J+=`${this._terminalSelector} .${R} .xterm-dim { color: ${y.color.multiplyOpacity(j.foreground,.5).css};}`,J+=`${this._terminalSelector} span:not(.xterm-bold) { font-weight: ${this._optionsService.rawOptions.fontWeight};}${this._terminalSelector} span.xterm-bold { font-weight: ${this._optionsService.rawOptions.fontWeightBold};}${this._terminalSelector} span.xterm-italic { font-style: italic;}`;const te=`blink_underline_${this._terminalClass}`,P=`blink_bar_${this._terminalClass}`,V=`blink_block_${this._terminalClass}`;J+=`@keyframes ${te} { 50% { border-bottom-style: hidden; }}`,J+=`@keyframes ${P} { 50% { box-shadow: none; }}`,J+=`@keyframes ${V} { 0% { background-color: ${j.cursor.css}; color: ${j.cursorAccent.css}; } 50% { background-color: inherit; color: ${j.cursor.css}; }}`,J+=`${this._terminalSelector} .${R}.${N} .xterm-cursor.xterm-cursor-blink.xterm-cursor-underline { animation: ${te} 1s step-end infinite;}${this._terminalSelector} .${R}.${N} .xterm-cursor.xterm-cursor-blink.xterm-cursor-bar { animation: ${P} 1s step-end infinite;}${this._terminalSelector} .${R}.${N} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: ${V} 1s step-end infinite;}${this._terminalSelector} .${R} .xterm-cursor.xterm-cursor-block { background-color: ${j.cursor.css}; color: ${j.cursorAccent.css};}${this._terminalSelector} .${R} .xterm-cursor.xterm-cursor-block:not(.xterm-cursor-blink) { background-color: ${j.cursor.css} !important; color: ${j.cursorAccent.css} !important;}${this._terminalSelector} .${R} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${j.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${R} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${j.cursor.css} inset;}${this._terminalSelector} .${R} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${j.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,J+=`${this._terminalSelector} .${W} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${W} div { position: absolute; background-color: ${j.selectionBackgroundOpaque.css};}${this._terminalSelector} .${W} div { position: absolute; background-color: ${j.selectionInactiveBackgroundOpaque.css};}`;for(const[Y,B]of j.ansi.entries())J+=`${this._terminalSelector} .${D}${Y} { color: ${B.css}; }${this._terminalSelector} .${D}${Y}.xterm-dim { color: ${y.color.multiplyOpacity(B,.5).css}; }${this._terminalSelector} .${k}${Y} { background-color: ${B.css}; }`;J+=`${this._terminalSelector} .${D}${w.INVERTED_DEFAULT_COLOR} { color: ${y.color.opaque(j.background).css}; }${this._terminalSelector} .${D}${w.INVERTED_DEFAULT_COLOR}.xterm-dim { color: ${y.color.multiplyOpacity(y.color.opaque(j.background),.5).css}; }${this._terminalSelector} .${k}${w.INVERTED_DEFAULT_COLOR} { background-color: ${j.foreground.css}; }`,this._themeStyleElement.textContent=J}_setDefaultSpacing(){const j=this.dimensions.css.cell.width-this._widthCache.get("W",!1,!1);this._rowContainer.style.letterSpacing=`${j}px`,this._rowFactory.defaultSpacing=j}handleDevicePixelRatioChange(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}_refreshRowElements(j,J){for(let te=this._rowElements.length;te<=J;te++){const P=this._document.createElement("div");this._rowContainer.appendChild(P),this._rowElements.push(P)}for(;this._rowElements.length>J;)this._rowContainer.removeChild(this._rowElements.pop())}handleResize(j,J){this._refreshRowElements(j,J),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(N),this.renderRows(0,this._bufferService.rows-1)}handleFocus(){this._rowContainer.classList.add(N),this.renderRows(this._bufferService.buffer.y,this._bufferService.buffer.y)}handleSelectionChanged(j,J,te){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged(j,J,te),this.renderRows(0,this._bufferService.rows-1),!j||!J)return;this._selectionRenderModel.update(this._terminal,j,J,te);const P=this._selectionRenderModel.viewportStartRow,V=this._selectionRenderModel.viewportEndRow,Y=this._selectionRenderModel.viewportCappedStartRow,B=this._selectionRenderModel.viewportCappedEndRow;if(Y>=this._bufferService.rows||B<0)return;const z=this._document.createDocumentFragment();if(te){const O=j[0]>J[0];z.appendChild(this._createSelectionElement(Y,O?J[0]:j[0],O?j[0]:J[0],B-Y+1))}else{const O=P===Y?j[0]:0,H=Y===V?J[0]:this._bufferService.cols;z.appendChild(this._createSelectionElement(Y,O,H));const X=B-Y-1;if(z.appendChild(this._createSelectionElement(Y+1,0,this._bufferService.cols,X)),Y!==B){const ae=V===B?J[0]:this._bufferService.cols;z.appendChild(this._createSelectionElement(B,0,ae))}}this._selectionContainer.appendChild(z)}_createSelectionElement(j,J,te,P=1){const V=this._document.createElement("div"),Y=J*this.dimensions.css.cell.width;let B=this.dimensions.css.cell.width*(te-J);return Y+B>this.dimensions.css.canvas.width&&(B=this.dimensions.css.canvas.width-Y),V.style.height=P*this.dimensions.css.cell.height+"px",V.style.top=j*this.dimensions.css.cell.height+"px",V.style.left=`${Y}px`,V.style.width=`${B}px`,V}handleCursorMove(){}_handleOptionsChanged(){this._updateDimensions(),this._injectCss(this._themeService.colors),this._widthCache.setFont(this._optionsService.rawOptions.fontFamily,this._optionsService.rawOptions.fontSize,this._optionsService.rawOptions.fontWeight,this._optionsService.rawOptions.fontWeightBold),this._setDefaultSpacing()}clear(){for(const j of this._rowElements)j.replaceChildren()}renderRows(j,J){const te=this._bufferService.buffer,P=te.ybase+te.y,V=Math.min(te.x,this._bufferService.cols-1),Y=this._optionsService.rawOptions.cursorBlink,B=this._optionsService.rawOptions.cursorStyle,z=this._optionsService.rawOptions.cursorInactiveStyle;for(let O=j;O<=J;O++){const H=O+te.ydisp,X=this._rowElements[O],ae=te.lines.get(H);if(!X||!ae)break;X.replaceChildren(...this._rowFactory.createRow(ae,H,H===P,B,z,V,Y,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${L}${this._terminalClass}`}_handleLinkHover(j){this._setCellUnderline(j.x1,j.x2,j.y1,j.y2,j.cols,!0)}_handleLinkLeave(j){this._setCellUnderline(j.x1,j.x2,j.y1,j.y2,j.cols,!1)}_setCellUnderline(j,J,te,P,V,Y){te<0&&(j=0),P<0&&(J=0);const B=this._bufferService.rows-1;te=Math.max(Math.min(te,B),0),P=Math.max(Math.min(P,B),0),V=Math.min(V,this._bufferService.cols);const z=this._bufferService.buffer,O=z.ybase+z.y,H=Math.min(z.x,V-1),X=this._optionsService.rawOptions.cursorBlink,ae=this._optionsService.rawOptions.cursorStyle,ce=this._optionsService.rawOptions.cursorInactiveStyle;for(let _e=te;_e<=P;++_e){const Q=_e+z.ydisp,$=this._rowElements[_e],oe=z.lines.get(Q);if(!$||!oe)break;$.replaceChildren(...this._rowFactory.createRow(oe,Q,Q===O,ae,ce,H,X,this.dimensions.css.cell.width,this._widthCache,Y?_e===te?j:0:-1,Y?(_e===P?J:V)-1:-1))}}};c.DomRenderer=F=h([b(7,E.IInstantiationService),b(8,g.ICharSizeService),b(9,E.IOptionsService),b(10,E.IBufferService),b(11,g.ICoreBrowserService),b(12,g.IThemeService)],F)},3787:function(m,c,u){var h=this&&this.__decorate||function(R,D,k,N){var W,U=arguments.length,F=U<3?D:N===null?N=Object.getOwnPropertyDescriptor(D,k):N;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")F=Reflect.decorate(R,D,k,N);else for(var j=R.length-1;j>=0;j--)(W=R[j])&&(F=(U<3?W(F):U>3?W(D,k,F):W(D,k))||F);return U>3&&F&&Object.defineProperty(D,k,F),F},b=this&&this.__param||function(R,D){return function(k,N){D(k,N,R)}};Object.defineProperty(c,"__esModule",{value:!0}),c.DomRendererRowFactory=void 0;const p=u(2223),C=u(643),w=u(511),A=u(2585),x=u(8055),g=u(4725),y=u(4269),f=u(6171),_=u(3734);let E=c.DomRendererRowFactory=class{constructor(R,D,k,N,W,U,F){this._document=R,this._characterJoinerService=D,this._optionsService=k,this._coreBrowserService=N,this._coreService=W,this._decorationService=U,this._themeService=F,this._workCell=new w.CellData,this._columnSelectMode=!1,this.defaultSpacing=0}handleSelectionChanged(R,D,k){this._selectionStart=R,this._selectionEnd=D,this._columnSelectMode=k}createRow(R,D,k,N,W,U,F,j,J,te,P){const V=[],Y=this._characterJoinerService.getJoinedCharacters(D),B=this._themeService.colors;let z,O=R.getNoBgTrimmedLength();k&&O<U+1&&(O=U+1);let H=0,X="",ae=0,ce=0,_e=0,Q=!1,$=0,oe=!1,ge=0;const ye=[],be=te!==-1&&P!==-1;for(let $e=0;$e<O;$e++){R.loadCell($e,this._workCell);let Pe=this._workCell.getWidth();if(Pe===0)continue;let Ye=!1,Ct=$e,Be=this._workCell;if(Y.length>0&&$e===Y[0][0]){Ye=!0;const ht=Y.shift();Be=new y.JoinedCellData(this._workCell,R.translateToString(!0,ht[0],ht[1]),ht[1]-ht[0]),Ct=ht[1]-1,Pe=Be.getWidth()}const Qt=this._isCellInSelection($e,D),_i=k&&$e===U,vi=be&&$e>=te&&$e<=P;let fn=!1;this._decorationService.forEachDecorationAtCell($e,D,void 0,(ht=>{fn=!0}));let Rn=Be.getChars()||C.WHITESPACE_CELL_CHAR;if(Rn===" "&&(Be.isUnderline()||Be.isOverline())&&(Rn=" "),ge=Pe*j-J.get(Rn,Be.isBold(),Be.isItalic()),z){if(H&&(Qt&&oe||!Qt&&!oe&&Be.bg===ae)&&(Qt&&oe&&B.selectionForeground||Be.fg===ce)&&Be.extended.ext===_e&&vi===Q&&ge===$&&!_i&&!Ye&&!fn){Be.isInvisible()?X+=C.WHITESPACE_CELL_CHAR:X+=Rn,H++;continue}H&&(z.textContent=X),z=this._document.createElement("span"),H=0,X=""}else z=this._document.createElement("span");if(ae=Be.bg,ce=Be.fg,_e=Be.extended.ext,Q=vi,$=ge,oe=Qt,Ye&&U>=$e&&U<=Ct&&(U=$e),!this._coreService.isCursorHidden&&_i&&this._coreService.isCursorInitialized){if(ye.push("xterm-cursor"),this._coreBrowserService.isFocused)F&&ye.push("xterm-cursor-blink"),ye.push(N==="bar"?"xterm-cursor-bar":N==="underline"?"xterm-cursor-underline":"xterm-cursor-block");else if(W)switch(W){case"outline":ye.push("xterm-cursor-outline");break;case"block":ye.push("xterm-cursor-block");break;case"bar":ye.push("xterm-cursor-bar");break;case"underline":ye.push("xterm-cursor-underline")}}if(Be.isBold()&&ye.push("xterm-bold"),Be.isItalic()&&ye.push("xterm-italic"),Be.isDim()&&ye.push("xterm-dim"),X=Be.isInvisible()?C.WHITESPACE_CELL_CHAR:Be.getChars()||C.WHITESPACE_CELL_CHAR,Be.isUnderline()&&(ye.push(`xterm-underline-${Be.extended.underlineStyle}`),X===" "&&(X=" "),!Be.isUnderlineColorDefault()))if(Be.isUnderlineColorRGB())z.style.textDecorationColor=`rgb(${_.AttributeData.toColorRGB(Be.getUnderlineColor()).join(",")})`;else{let ht=Be.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&Be.isBold()&&ht<8&&(ht+=8),z.style.textDecorationColor=B.ansi[ht].css}Be.isOverline()&&(ye.push("xterm-overline"),X===" "&&(X=" ")),Be.isStrikethrough()&&ye.push("xterm-strikethrough"),vi&&(z.style.textDecoration="underline");let ei=Be.getFgColor(),ct=Be.getFgColorMode(),Kt=Be.getBgColor(),jt=Be.getBgColorMode();const zt=!!Be.isInverse();if(zt){const ht=ei;ei=Kt,Kt=ht;const zi=ct;ct=jt,jt=zi}let ti,Ln,ki,en=!1;switch(this._decorationService.forEachDecorationAtCell($e,D,void 0,(ht=>{ht.options.layer!=="top"&&en||(ht.backgroundColorRGB&&(jt=50331648,Kt=ht.backgroundColorRGB.rgba>>8&16777215,ti=ht.backgroundColorRGB),ht.foregroundColorRGB&&(ct=50331648,ei=ht.foregroundColorRGB.rgba>>8&16777215,Ln=ht.foregroundColorRGB),en=ht.options.layer==="top")})),!en&&Qt&&(ti=this._coreBrowserService.isFocused?B.selectionBackgroundOpaque:B.selectionInactiveBackgroundOpaque,Kt=ti.rgba>>8&16777215,jt=50331648,en=!0,B.selectionForeground&&(ct=50331648,ei=B.selectionForeground.rgba>>8&16777215,Ln=B.selectionForeground)),en&&ye.push("xterm-decoration-top"),jt){case 16777216:case 33554432:ki=B.ansi[Kt],ye.push(`xterm-bg-${Kt}`);break;case 50331648:ki=x.channels.toColor(Kt>>16,Kt>>8&255,255&Kt),this._addStyle(z,`background-color:#${L((Kt>>>0).toString(16),"0",6)}`);break;default:zt?(ki=B.foreground,ye.push(`xterm-bg-${p.INVERTED_DEFAULT_COLOR}`)):ki=B.background}switch(ti||Be.isDim()&&(ti=x.color.multiplyOpacity(ki,.5)),ct){case 16777216:case 33554432:Be.isBold()&&ei<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(ei+=8),this._applyMinimumContrast(z,ki,B.ansi[ei],Be,ti,void 0)||ye.push(`xterm-fg-${ei}`);break;case 50331648:const ht=x.channels.toColor(ei>>16&255,ei>>8&255,255&ei);this._applyMinimumContrast(z,ki,ht,Be,ti,Ln)||this._addStyle(z,`color:#${L(ei.toString(16),"0",6)}`);break;default:this._applyMinimumContrast(z,ki,B.foreground,Be,ti,Ln)||zt&&ye.push(`xterm-fg-${p.INVERTED_DEFAULT_COLOR}`)}ye.length&&(z.className=ye.join(" "),ye.length=0),_i||Ye||fn?z.textContent=X:H++,ge!==this.defaultSpacing&&(z.style.letterSpacing=`${ge}px`),V.push(z),$e=Ct}return z&&H&&(z.textContent=X),V}_applyMinimumContrast(R,D,k,N,W,U){if(this._optionsService.rawOptions.minimumContrastRatio===1||(0,f.treatGlyphAsBackgroundColor)(N.getCode()))return!1;const F=this._getContrastCache(N);let j;if(W||U||(j=F.getColor(D.rgba,k.rgba)),j===void 0){const J=this._optionsService.rawOptions.minimumContrastRatio/(N.isDim()?2:1);j=x.color.ensureContrastRatio(W||D,U||k,J),F.setColor((W||D).rgba,(U||k).rgba,j??null)}return!!j&&(this._addStyle(R,`color:${j.css}`),!0)}_getContrastCache(R){return R.isDim()?this._themeService.colors.halfContrastCache:this._themeService.colors.contrastCache}_addStyle(R,D){R.setAttribute("style",`${R.getAttribute("style")||""}${D};`)}_isCellInSelection(R,D){const k=this._selectionStart,N=this._selectionEnd;return!(!k||!N)&&(this._columnSelectMode?k[0]<=N[0]?R>=k[0]&&D>=k[1]&&R<N[0]&&D<=N[1]:R<k[0]&&D>=k[1]&&R>=N[0]&&D<=N[1]:D>k[1]&&D<N[1]||k[1]===N[1]&&D===k[1]&&R>=k[0]&&R<N[0]||k[1]<N[1]&&D===N[1]&&R<N[0]||k[1]<N[1]&&D===k[1]&&R>=k[0])}};function L(R,D,k){for(;R.length<k;)R=D+R;return R}c.DomRendererRowFactory=E=h([b(1,g.ICharacterJoinerService),b(2,A.IOptionsService),b(3,g.ICoreBrowserService),b(4,A.ICoreService),b(5,A.IDecorationService),b(6,g.IThemeService)],E)},2550:(m,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.WidthCache=void 0,c.WidthCache=class{constructor(u,h){this._flat=new Float32Array(256),this._font="",this._fontSize=0,this._weight="normal",this._weightBold="bold",this._measureElements=[],this._container=u.createElement("div"),this._container.classList.add("xterm-width-cache-measure-container"),this._container.setAttribute("aria-hidden","true"),this._container.style.whiteSpace="pre",this._container.style.fontKerning="none";const b=u.createElement("span");b.classList.add("xterm-char-measure-element");const p=u.createElement("span");p.classList.add("xterm-char-measure-element"),p.style.fontWeight="bold";const C=u.createElement("span");C.classList.add("xterm-char-measure-element"),C.style.fontStyle="italic";const w=u.createElement("span");w.classList.add("xterm-char-measure-element"),w.style.fontWeight="bold",w.style.fontStyle="italic",this._measureElements=[b,p,C,w],this._container.appendChild(b),this._container.appendChild(p),this._container.appendChild(C),this._container.appendChild(w),h.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(u,h,b,p){u===this._font&&h===this._fontSize&&b===this._weight&&p===this._weightBold||(this._font=u,this._fontSize=h,this._weight=b,this._weightBold=p,this._container.style.fontFamily=this._font,this._container.style.fontSize=`${this._fontSize}px`,this._measureElements[0].style.fontWeight=`${b}`,this._measureElements[1].style.fontWeight=`${p}`,this._measureElements[2].style.fontWeight=`${b}`,this._measureElements[3].style.fontWeight=`${p}`,this.clear())}get(u,h,b){let p=0;if(!h&&!b&&u.length===1&&(p=u.charCodeAt(0))<256){if(this._flat[p]!==-9999)return this._flat[p];const A=this._measure(u,0);return A>0&&(this._flat[p]=A),A}let C=u;h&&(C+="B"),b&&(C+="I");let w=this._holey.get(C);if(w===void 0){let A=0;h&&(A|=1),b&&(A|=2),w=this._measure(u,A),w>0&&this._holey.set(C,w)}return w}_measure(u,h){const b=this._measureElements[h];return b.textContent=u.repeat(32),b.offsetWidth/32}}},2223:(m,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.TEXT_BASELINE=c.DIM_OPACITY=c.INVERTED_DEFAULT_COLOR=void 0;const h=u(6114);c.INVERTED_DEFAULT_COLOR=257,c.DIM_OPACITY=.5,c.TEXT_BASELINE=h.isFirefox||h.isLegacyEdge?"bottom":"ideographic"},6171:(m,c)=>{function u(b){return 57508<=b&&b<=57558}function h(b){return b>=128512&&b<=128591||b>=127744&&b<=128511||b>=128640&&b<=128767||b>=9728&&b<=9983||b>=9984&&b<=10175||b>=65024&&b<=65039||b>=129280&&b<=129535||b>=127462&&b<=127487}Object.defineProperty(c,"__esModule",{value:!0}),c.computeNextVariantOffset=c.createRenderDimensions=c.treatGlyphAsBackgroundColor=c.allowRescaling=c.isEmoji=c.isRestrictedPowerlineGlyph=c.isPowerlineGlyph=c.throwIfFalsy=void 0,c.throwIfFalsy=function(b){if(!b)throw new Error("value must not be falsy");return b},c.isPowerlineGlyph=u,c.isRestrictedPowerlineGlyph=function(b){return 57520<=b&&b<=57527},c.isEmoji=h,c.allowRescaling=function(b,p,C,w){return p===1&&C>Math.ceil(1.5*w)&&b!==void 0&&b>255&&!h(b)&&!u(b)&&!(function(A){return 57344<=A&&A<=63743})(b)},c.treatGlyphAsBackgroundColor=function(b){return u(b)||(function(p){return 9472<=p&&p<=9631})(b)},c.createRenderDimensions=function(){return{css:{canvas:{width:0,height:0},cell:{width:0,height:0}},device:{canvas:{width:0,height:0},cell:{width:0,height:0},char:{width:0,height:0,left:0,top:0}}}},c.computeNextVariantOffset=function(b,p,C=0){return(b-(2*Math.round(p)-C))%(2*Math.round(p))}},6052:(m,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.createSelectionRenderModel=void 0;class u{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(b,p,C,w=!1){if(this.selectionStart=p,this.selectionEnd=C,!p||!C||p[0]===C[0]&&p[1]===C[1])return void this.clear();const A=b.buffers.active.ydisp,x=p[1]-A,g=C[1]-A,y=Math.max(x,0),f=Math.min(g,b.rows-1);y>=b.rows||f<0?this.clear():(this.hasSelection=!0,this.columnSelectMode=w,this.viewportStartRow=x,this.viewportEndRow=g,this.viewportCappedStartRow=y,this.viewportCappedEndRow=f,this.startCol=p[0],this.endCol=C[0])}isCellSelected(b,p,C){return!!this.hasSelection&&(C-=b.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?p>=this.startCol&&C>=this.viewportCappedStartRow&&p<this.endCol&&C<=this.viewportCappedEndRow:p<this.startCol&&C>=this.viewportCappedStartRow&&p>=this.endCol&&C<=this.viewportCappedEndRow:C>this.viewportStartRow&&C<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&C===this.viewportStartRow&&p>=this.startCol&&p<this.endCol||this.viewportStartRow<this.viewportEndRow&&C===this.viewportEndRow&&p<this.endCol||this.viewportStartRow<this.viewportEndRow&&C===this.viewportStartRow&&p>=this.startCol)}}c.createSelectionRenderModel=function(){return new u}},456:(m,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.SelectionModel=void 0,c.SelectionModel=class{constructor(u){this._bufferService=u,this.isSelectAllActive=!1,this.selectionStartLength=0}clearSelection(){this.selectionStart=void 0,this.selectionEnd=void 0,this.isSelectAllActive=!1,this.selectionStartLength=0}get finalSelectionStart(){return this.isSelectAllActive?[0,0]:this.selectionEnd&&this.selectionStart&&this.areSelectionValuesReversed()?this.selectionEnd:this.selectionStart}get finalSelectionEnd(){if(this.isSelectAllActive)return[this._bufferService.cols,this._bufferService.buffer.ybase+this._bufferService.rows-1];if(this.selectionStart){if(!this.selectionEnd||this.areSelectionValuesReversed()){const u=this.selectionStart[0]+this.selectionStartLength;return u>this._bufferService.cols?u%this._bufferService.cols==0?[this._bufferService.cols,this.selectionStart[1]+Math.floor(u/this._bufferService.cols)-1]:[u%this._bufferService.cols,this.selectionStart[1]+Math.floor(u/this._bufferService.cols)]:[u,this.selectionStart[1]]}if(this.selectionStartLength&&this.selectionEnd[1]===this.selectionStart[1]){const u=this.selectionStart[0]+this.selectionStartLength;return u>this._bufferService.cols?[u%this._bufferService.cols,this.selectionStart[1]+Math.floor(u/this._bufferService.cols)]:[Math.max(u,this.selectionEnd[0]),this.selectionEnd[1]]}return this.selectionEnd}}areSelectionValuesReversed(){const u=this.selectionStart,h=this.selectionEnd;return!(!u||!h)&&(u[1]>h[1]||u[1]===h[1]&&u[0]>h[0])}handleTrim(u){return this.selectionStart&&(this.selectionStart[1]-=u),this.selectionEnd&&(this.selectionEnd[1]-=u),this.selectionEnd&&this.selectionEnd[1]<0?(this.clearSelection(),!0):(this.selectionStart&&this.selectionStart[1]<0&&(this.selectionStart[1]=0),!1)}}},428:function(m,c,u){var h=this&&this.__decorate||function(f,_,E,L){var R,D=arguments.length,k=D<3?_:L===null?L=Object.getOwnPropertyDescriptor(_,E):L;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")k=Reflect.decorate(f,_,E,L);else for(var N=f.length-1;N>=0;N--)(R=f[N])&&(k=(D<3?R(k):D>3?R(_,E,k):R(_,E))||k);return D>3&&k&&Object.defineProperty(_,E,k),k},b=this&&this.__param||function(f,_){return function(E,L){_(E,L,f)}};Object.defineProperty(c,"__esModule",{value:!0}),c.CharSizeService=void 0;const p=u(2585),C=u(8460),w=u(844);let A=c.CharSizeService=class extends w.Disposable{get hasValidSize(){return this.width>0&&this.height>0}constructor(f,_,E){super(),this._optionsService=E,this.width=0,this.height=0,this._onCharSizeChange=this.register(new C.EventEmitter),this.onCharSizeChange=this._onCharSizeChange.event;try{this._measureStrategy=this.register(new y(this._optionsService))}catch{this._measureStrategy=this.register(new g(f,_,this._optionsService))}this.register(this._optionsService.onMultipleOptionChange(["fontFamily","fontSize"],(()=>this.measure())))}measure(){const f=this._measureStrategy.measure();f.width===this.width&&f.height===this.height||(this.width=f.width,this.height=f.height,this._onCharSizeChange.fire())}};c.CharSizeService=A=h([b(2,p.IOptionsService)],A);class x extends w.Disposable{constructor(){super(...arguments),this._result={width:0,height:0}}_validateAndSet(_,E){_!==void 0&&_>0&&E!==void 0&&E>0&&(this._result.width=_,this._result.height=E)}}class g extends x{constructor(_,E,L){super(),this._document=_,this._parentElement=E,this._optionsService=L,this._measureElement=this._document.createElement("span"),this._measureElement.classList.add("xterm-char-measure-element"),this._measureElement.textContent="W".repeat(32),this._measureElement.setAttribute("aria-hidden","true"),this._measureElement.style.whiteSpace="pre",this._measureElement.style.fontKerning="none",this._parentElement.appendChild(this._measureElement)}measure(){return this._measureElement.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._measureElement.style.fontSize=`${this._optionsService.rawOptions.fontSize}px`,this._validateAndSet(Number(this._measureElement.offsetWidth)/32,Number(this._measureElement.offsetHeight)),this._result}}class y extends x{constructor(_){super(),this._optionsService=_,this._canvas=new OffscreenCanvas(100,100),this._ctx=this._canvas.getContext("2d");const E=this._ctx.measureText("W");if(!("width"in E&&"fontBoundingBoxAscent"in E&&"fontBoundingBoxDescent"in E))throw new Error("Required font metrics not supported")}measure(){this._ctx.font=`${this._optionsService.rawOptions.fontSize}px ${this._optionsService.rawOptions.fontFamily}`;const _=this._ctx.measureText("W");return this._validateAndSet(_.width,_.fontBoundingBoxAscent+_.fontBoundingBoxDescent),this._result}}},4269:function(m,c,u){var h=this&&this.__decorate||function(y,f,_,E){var L,R=arguments.length,D=R<3?f:E===null?E=Object.getOwnPropertyDescriptor(f,_):E;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")D=Reflect.decorate(y,f,_,E);else for(var k=y.length-1;k>=0;k--)(L=y[k])&&(D=(R<3?L(D):R>3?L(f,_,D):L(f,_))||D);return R>3&&D&&Object.defineProperty(f,_,D),D},b=this&&this.__param||function(y,f){return function(_,E){f(_,E,y)}};Object.defineProperty(c,"__esModule",{value:!0}),c.CharacterJoinerService=c.JoinedCellData=void 0;const p=u(3734),C=u(643),w=u(511),A=u(2585);class x extends p.AttributeData{constructor(f,_,E){super(),this.content=0,this.combinedData="",this.fg=f.fg,this.bg=f.bg,this.combinedData=_,this._width=E}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(f){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}c.JoinedCellData=x;let g=c.CharacterJoinerService=class fy{constructor(f){this._bufferService=f,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new w.CellData}register(f){const _={id:this._nextCharacterJoinerId++,handler:f};return this._characterJoiners.push(_),_.id}deregister(f){for(let _=0;_<this._characterJoiners.length;_++)if(this._characterJoiners[_].id===f)return this._characterJoiners.splice(_,1),!0;return!1}getJoinedCharacters(f){if(this._characterJoiners.length===0)return[];const _=this._bufferService.buffer.lines.get(f);if(!_||_.length===0)return[];const E=[],L=_.translateToString(!0);let R=0,D=0,k=0,N=_.getFg(0),W=_.getBg(0);for(let U=0;U<_.getTrimmedLength();U++)if(_.loadCell(U,this._workCell),this._workCell.getWidth()!==0){if(this._workCell.fg!==N||this._workCell.bg!==W){if(U-R>1){const F=this._getJoinedRanges(L,k,D,_,R);for(let j=0;j<F.length;j++)E.push(F[j])}R=U,k=D,N=this._workCell.fg,W=this._workCell.bg}D+=this._workCell.getChars().length||C.WHITESPACE_CELL_CHAR.length}if(this._bufferService.cols-R>1){const U=this._getJoinedRanges(L,k,D,_,R);for(let F=0;F<U.length;F++)E.push(U[F])}return E}_getJoinedRanges(f,_,E,L,R){const D=f.substring(_,E);let k=[];try{k=this._characterJoiners[0].handler(D)}catch(N){console.error(N)}for(let N=1;N<this._characterJoiners.length;N++)try{const W=this._characterJoiners[N].handler(D);for(let U=0;U<W.length;U++)fy._mergeRanges(k,W[U])}catch(W){console.error(W)}return this._stringRangesToCellRanges(k,L,R),k}_stringRangesToCellRanges(f,_,E){let L=0,R=!1,D=0,k=f[L];if(k){for(let N=E;N<this._bufferService.cols;N++){const W=_.getWidth(N),U=_.getString(N).length||C.WHITESPACE_CELL_CHAR.length;if(W!==0){if(!R&&k[0]<=D&&(k[0]=N,R=!0),k[1]<=D){if(k[1]=N,k=f[++L],!k)break;k[0]<=D?(k[0]=N,R=!0):R=!1}D+=U}}k&&(k[1]=this._bufferService.cols)}}static _mergeRanges(f,_){let E=!1;for(let L=0;L<f.length;L++){const R=f[L];if(E){if(_[1]<=R[0])return f[L-1][1]=_[1],f;if(_[1]<=R[1])return f[L-1][1]=Math.max(_[1],R[1]),f.splice(L,1),f;f.splice(L,1),L--}else{if(_[1]<=R[0])return f.splice(L,0,_),f;if(_[1]<=R[1])return R[0]=Math.min(_[0],R[0]),f;_[0]<R[1]&&(R[0]=Math.min(_[0],R[0]),E=!0)}}return E?f[f.length-1][1]=_[1]:f.push(_),f}};c.CharacterJoinerService=g=h([b(0,A.IBufferService)],g)},5114:(m,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.CoreBrowserService=void 0;const h=u(844),b=u(8460),p=u(3656);class C extends h.Disposable{constructor(x,g,y){super(),this._textarea=x,this._window=g,this.mainDocument=y,this._isFocused=!1,this._cachedIsFocused=void 0,this._screenDprMonitor=new w(this._window),this._onDprChange=this.register(new b.EventEmitter),this.onDprChange=this._onDprChange.event,this._onWindowChange=this.register(new b.EventEmitter),this.onWindowChange=this._onWindowChange.event,this.register(this.onWindowChange((f=>this._screenDprMonitor.setWindow(f)))),this.register((0,b.forwardEvent)(this._screenDprMonitor.onDprChange,this._onDprChange)),this._textarea.addEventListener("focus",(()=>this._isFocused=!0)),this._textarea.addEventListener("blur",(()=>this._isFocused=!1))}get window(){return this._window}set window(x){this._window!==x&&(this._window=x,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}}c.CoreBrowserService=C;class w extends h.Disposable{constructor(x){super(),this._parentWindow=x,this._windowResizeListener=this.register(new h.MutableDisposable),this._onDprChange=this.register(new b.EventEmitter),this.onDprChange=this._onDprChange.event,this._outerListener=()=>this._setDprAndFireIfDiffers(),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._updateDpr(),this._setWindowResizeListener(),this.register((0,h.toDisposable)((()=>this.clearListener())))}setWindow(x){this._parentWindow=x,this._setWindowResizeListener(),this._setDprAndFireIfDiffers()}_setWindowResizeListener(){this._windowResizeListener.value=(0,p.addDisposableDomListener)(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)}}},779:(m,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.LinkProviderService=void 0;const h=u(844);class b extends h.Disposable{constructor(){super(),this.linkProviders=[],this.register((0,h.toDisposable)((()=>this.linkProviders.length=0)))}registerLinkProvider(C){return this.linkProviders.push(C),{dispose:()=>{const w=this.linkProviders.indexOf(C);w!==-1&&this.linkProviders.splice(w,1)}}}}c.LinkProviderService=b},8934:function(m,c,u){var h=this&&this.__decorate||function(A,x,g,y){var f,_=arguments.length,E=_<3?x:y===null?y=Object.getOwnPropertyDescriptor(x,g):y;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")E=Reflect.decorate(A,x,g,y);else for(var L=A.length-1;L>=0;L--)(f=A[L])&&(E=(_<3?f(E):_>3?f(x,g,E):f(x,g))||E);return _>3&&E&&Object.defineProperty(x,g,E),E},b=this&&this.__param||function(A,x){return function(g,y){x(g,y,A)}};Object.defineProperty(c,"__esModule",{value:!0}),c.MouseService=void 0;const p=u(4725),C=u(9806);let w=c.MouseService=class{constructor(A,x){this._renderService=A,this._charSizeService=x}getCoords(A,x,g,y,f){return(0,C.getCoords)(window,A,x,g,y,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,f)}getMouseReportCoords(A,x){const g=(0,C.getCoordsRelativeToElement)(window,A,x);if(this._charSizeService.hasValidSize)return g[0]=Math.min(Math.max(g[0],0),this._renderService.dimensions.css.canvas.width-1),g[1]=Math.min(Math.max(g[1],0),this._renderService.dimensions.css.canvas.height-1),{col:Math.floor(g[0]/this._renderService.dimensions.css.cell.width),row:Math.floor(g[1]/this._renderService.dimensions.css.cell.height),x:Math.floor(g[0]),y:Math.floor(g[1])}}};c.MouseService=w=h([b(0,p.IRenderService),b(1,p.ICharSizeService)],w)},3230:function(m,c,u){var h=this&&this.__decorate||function(f,_,E,L){var R,D=arguments.length,k=D<3?_:L===null?L=Object.getOwnPropertyDescriptor(_,E):L;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")k=Reflect.decorate(f,_,E,L);else for(var N=f.length-1;N>=0;N--)(R=f[N])&&(k=(D<3?R(k):D>3?R(_,E,k):R(_,E))||k);return D>3&&k&&Object.defineProperty(_,E,k),k},b=this&&this.__param||function(f,_){return function(E,L){_(E,L,f)}};Object.defineProperty(c,"__esModule",{value:!0}),c.RenderService=void 0;const p=u(6193),C=u(4725),w=u(8460),A=u(844),x=u(7226),g=u(2585);let y=c.RenderService=class extends A.Disposable{get dimensions(){return this._renderer.value.dimensions}constructor(f,_,E,L,R,D,k,N){super(),this._rowCount=f,this._charSizeService=L,this._renderer=this.register(new A.MutableDisposable),this._pausedResizeTask=new x.DebouncedIdleTask,this._observerDisposable=this.register(new A.MutableDisposable),this._isPaused=!1,this._needsFullRefresh=!1,this._isNextRenderRedrawOnly=!0,this._needsSelectionRefresh=!1,this._canvasWidth=0,this._canvasHeight=0,this._selectionState={start:void 0,end:void 0,columnSelectMode:!1},this._onDimensionsChange=this.register(new w.EventEmitter),this.onDimensionsChange=this._onDimensionsChange.event,this._onRenderedViewportChange=this.register(new w.EventEmitter),this.onRenderedViewportChange=this._onRenderedViewportChange.event,this._onRender=this.register(new w.EventEmitter),this.onRender=this._onRender.event,this._onRefreshRequest=this.register(new w.EventEmitter),this.onRefreshRequest=this._onRefreshRequest.event,this._renderDebouncer=new p.RenderDebouncer(((W,U)=>this._renderRows(W,U)),k),this.register(this._renderDebouncer),this.register(k.onDprChange((()=>this.handleDevicePixelRatioChange()))),this.register(D.onResize((()=>this._fullRefresh()))),this.register(D.buffers.onBufferActivate((()=>this._renderer.value?.clear()))),this.register(E.onOptionChange((()=>this._handleOptionsChanged()))),this.register(this._charSizeService.onCharSizeChange((()=>this.handleCharSizeChanged()))),this.register(R.onDecorationRegistered((()=>this._fullRefresh()))),this.register(R.onDecorationRemoved((()=>this._fullRefresh()))),this.register(E.onMultipleOptionChange(["customGlyphs","drawBoldTextInBrightColors","letterSpacing","lineHeight","fontFamily","fontSize","fontWeight","fontWeightBold","minimumContrastRatio","rescaleOverlappingGlyphs"],(()=>{this.clear(),this.handleResize(D.cols,D.rows),this._fullRefresh()}))),this.register(E.onMultipleOptionChange(["cursorBlink","cursorStyle"],(()=>this.refreshRows(D.buffer.y,D.buffer.y,!0)))),this.register(N.onChangeColors((()=>this._fullRefresh()))),this._registerIntersectionObserver(k.window,_),this.register(k.onWindowChange((W=>this._registerIntersectionObserver(W,_))))}_registerIntersectionObserver(f,_){if("IntersectionObserver"in f){const E=new f.IntersectionObserver((L=>this._handleIntersectionChange(L[L.length-1])),{threshold:0});E.observe(_),this._observerDisposable.value=(0,A.toDisposable)((()=>E.disconnect()))}}_handleIntersectionChange(f){this._isPaused=f.isIntersecting===void 0?f.intersectionRatio===0:!f.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(f,_,E=!1){this._isPaused?this._needsFullRefresh=!0:(E||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(f,_,this._rowCount))}_renderRows(f,_){this._renderer.value&&(f=Math.min(f,this._rowCount-1),_=Math.min(_,this._rowCount-1),this._renderer.value.renderRows(f,_),this._needsSelectionRefresh&&(this._renderer.value.handleSelectionChanged(this._selectionState.start,this._selectionState.end,this._selectionState.columnSelectMode),this._needsSelectionRefresh=!1),this._isNextRenderRedrawOnly||this._onRenderedViewportChange.fire({start:f,end:_}),this._onRender.fire({start:f,end:_}),this._isNextRenderRedrawOnly=!0)}resize(f,_){this._rowCount=_,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(f){this._renderer.value=f,this._renderer.value&&(this._renderer.value.onRequestRedraw((_=>this.refreshRows(_.start,_.end,!0))),this._needsSelectionRefresh=!0,this._fullRefresh())}addRefreshCallback(f){return this._renderDebouncer.addRefreshCallback(f)}_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(f,_){this._renderer.value&&(this._isPaused?this._pausedResizeTask.set((()=>this._renderer.value?.handleResize(f,_))):this._renderer.value.handleResize(f,_),this._fullRefresh())}handleCharSizeChanged(){this._renderer.value?.handleCharSizeChanged()}handleBlur(){this._renderer.value?.handleBlur()}handleFocus(){this._renderer.value?.handleFocus()}handleSelectionChanged(f,_,E){this._selectionState.start=f,this._selectionState.end=_,this._selectionState.columnSelectMode=E,this._renderer.value?.handleSelectionChanged(f,_,E)}handleCursorMove(){this._renderer.value?.handleCursorMove()}clear(){this._renderer.value?.clear()}};c.RenderService=y=h([b(2,g.IOptionsService),b(3,C.ICharSizeService),b(4,g.IDecorationService),b(5,g.IBufferService),b(6,C.ICoreBrowserService),b(7,C.IThemeService)],y)},9312:function(m,c,u){var h=this&&this.__decorate||function(k,N,W,U){var F,j=arguments.length,J=j<3?N:U===null?U=Object.getOwnPropertyDescriptor(N,W):U;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")J=Reflect.decorate(k,N,W,U);else for(var te=k.length-1;te>=0;te--)(F=k[te])&&(J=(j<3?F(J):j>3?F(N,W,J):F(N,W))||J);return j>3&&J&&Object.defineProperty(N,W,J),J},b=this&&this.__param||function(k,N){return function(W,U){N(W,U,k)}};Object.defineProperty(c,"__esModule",{value:!0}),c.SelectionService=void 0;const p=u(9806),C=u(9504),w=u(456),A=u(4725),x=u(8460),g=u(844),y=u(6114),f=u(4841),_=u(511),E=u(2585),L=" ",R=new RegExp(L,"g");let D=c.SelectionService=class extends g.Disposable{constructor(k,N,W,U,F,j,J,te,P){super(),this._element=k,this._screenElement=N,this._linkifier=W,this._bufferService=U,this._coreService=F,this._mouseService=j,this._optionsService=J,this._renderService=te,this._coreBrowserService=P,this._dragScrollAmount=0,this._enabled=!0,this._workCell=new _.CellData,this._mouseDownTimeStamp=0,this._oldHasSelection=!1,this._oldSelectionStart=void 0,this._oldSelectionEnd=void 0,this._onLinuxMouseSelection=this.register(new x.EventEmitter),this.onLinuxMouseSelection=this._onLinuxMouseSelection.event,this._onRedrawRequest=this.register(new x.EventEmitter),this.onRequestRedraw=this._onRedrawRequest.event,this._onSelectionChange=this.register(new x.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onRequestScrollLines=this.register(new x.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this._mouseMoveListener=V=>this._handleMouseMove(V),this._mouseUpListener=V=>this._handleMouseUp(V),this._coreService.onUserInput((()=>{this.hasSelection&&this.clearSelection()})),this._trimListener=this._bufferService.buffer.lines.onTrim((V=>this._handleTrim(V))),this.register(this._bufferService.buffers.onBufferActivate((V=>this._handleBufferActivate(V)))),this.enable(),this._model=new w.SelectionModel(this._bufferService),this._activeSelectionMode=0,this.register((0,g.toDisposable)((()=>{this._removeMouseDownListeners()})))}reset(){this.clearSelection()}disable(){this.clearSelection(),this._enabled=!1}enable(){this._enabled=!0}get selectionStart(){return this._model.finalSelectionStart}get selectionEnd(){return this._model.finalSelectionEnd}get hasSelection(){const k=this._model.finalSelectionStart,N=this._model.finalSelectionEnd;return!(!k||!N||k[0]===N[0]&&k[1]===N[1])}get selectionText(){const k=this._model.finalSelectionStart,N=this._model.finalSelectionEnd;if(!k||!N)return"";const W=this._bufferService.buffer,U=[];if(this._activeSelectionMode===3){if(k[0]===N[0])return"";const F=k[0]<N[0]?k[0]:N[0],j=k[0]<N[0]?N[0]:k[0];for(let J=k[1];J<=N[1];J++){const te=W.translateBufferLineToString(J,!0,F,j);U.push(te)}}else{const F=k[1]===N[1]?N[0]:void 0;U.push(W.translateBufferLineToString(k[1],!0,k[0],F));for(let j=k[1]+1;j<=N[1]-1;j++){const J=W.lines.get(j),te=W.translateBufferLineToString(j,!0);J?.isWrapped?U[U.length-1]+=te:U.push(te)}if(k[1]!==N[1]){const j=W.lines.get(N[1]),J=W.translateBufferLineToString(N[1],!0,0,N[0]);j&&j.isWrapped?U[U.length-1]+=J:U.push(J)}}return U.map((F=>F.replace(R," "))).join(y.isWindows?`\r
|
|
80
|
+
`:`
|
|
81
|
+
`)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(k){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._refresh()))),y.isLinux&&k&&this.selectionText.length&&this._onLinuxMouseSelection.fire(this.selectionText)}_refresh(){this._refreshAnimationFrame=void 0,this._onRedrawRequest.fire({start:this._model.finalSelectionStart,end:this._model.finalSelectionEnd,columnSelectMode:this._activeSelectionMode===3})}_isClickInSelection(k){const N=this._getMouseBufferCoords(k),W=this._model.finalSelectionStart,U=this._model.finalSelectionEnd;return!!(W&&U&&N)&&this._areCoordsInSelection(N,W,U)}isCellInSelection(k,N){const W=this._model.finalSelectionStart,U=this._model.finalSelectionEnd;return!(!W||!U)&&this._areCoordsInSelection([k,N],W,U)}_areCoordsInSelection(k,N,W){return k[1]>N[1]&&k[1]<W[1]||N[1]===W[1]&&k[1]===N[1]&&k[0]>=N[0]&&k[0]<W[0]||N[1]<W[1]&&k[1]===W[1]&&k[0]<W[0]||N[1]<W[1]&&k[1]===N[1]&&k[0]>=N[0]}_selectWordAtCursor(k,N){const W=this._linkifier.currentLink?.link?.range;if(W)return this._model.selectionStart=[W.start.x-1,W.start.y-1],this._model.selectionStartLength=(0,f.getRangeLength)(W,this._bufferService.cols),this._model.selectionEnd=void 0,!0;const U=this._getMouseBufferCoords(k);return!!U&&(this._selectWordAt(U,N),this._model.selectionEnd=void 0,!0)}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(k,N){this._model.clearSelection(),k=Math.max(k,0),N=Math.min(N,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,k],this._model.selectionEnd=[this._bufferService.cols,N],this.refresh(),this._onSelectionChange.fire()}_handleTrim(k){this._model.handleTrim(k)&&this.refresh()}_getMouseBufferCoords(k){const N=this._mouseService.getCoords(k,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(N)return N[0]--,N[1]--,N[1]+=this._bufferService.buffer.ydisp,N}_getMouseEventScrollAmount(k){let N=(0,p.getCoordsRelativeToElement)(this._coreBrowserService.window,k,this._screenElement)[1];const W=this._renderService.dimensions.css.canvas.height;return N>=0&&N<=W?0:(N>W&&(N-=W),N=Math.min(Math.max(N,-50),50),N/=50,N/Math.abs(N)+Math.round(14*N))}shouldForceSelection(k){return y.isMac?k.altKey&&this._optionsService.rawOptions.macOptionClickForcesSelection:k.shiftKey}handleMouseDown(k){if(this._mouseDownTimeStamp=k.timeStamp,(k.button!==2||!this.hasSelection)&&k.button===0){if(!this._enabled){if(!this.shouldForceSelection(k))return;k.stopPropagation()}k.preventDefault(),this._dragScrollAmount=0,this._enabled&&k.shiftKey?this._handleIncrementalClick(k):k.detail===1?this._handleSingleClick(k):k.detail===2?this._handleDoubleClick(k):k.detail===3&&this._handleTripleClick(k),this._addMouseDownListeners(),this.refresh(!0)}}_addMouseDownListeners(){this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.addEventListener("mousemove",this._mouseMoveListener),this._screenElement.ownerDocument.addEventListener("mouseup",this._mouseUpListener)),this._dragScrollIntervalTimer=this._coreBrowserService.window.setInterval((()=>this._dragScroll()),50)}_removeMouseDownListeners(){this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.removeEventListener("mousemove",this._mouseMoveListener),this._screenElement.ownerDocument.removeEventListener("mouseup",this._mouseUpListener)),this._coreBrowserService.window.clearInterval(this._dragScrollIntervalTimer),this._dragScrollIntervalTimer=void 0}_handleIncrementalClick(k){this._model.selectionStart&&(this._model.selectionEnd=this._getMouseBufferCoords(k))}_handleSingleClick(k){if(this._model.selectionStartLength=0,this._model.isSelectAllActive=!1,this._activeSelectionMode=this.shouldColumnSelect(k)?3:0,this._model.selectionStart=this._getMouseBufferCoords(k),!this._model.selectionStart)return;this._model.selectionEnd=void 0;const N=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);N&&N.length!==this._model.selectionStart[0]&&N.hasWidth(this._model.selectionStart[0])===0&&this._model.selectionStart[0]++}_handleDoubleClick(k){this._selectWordAtCursor(k,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(k){const N=this._getMouseBufferCoords(k);N&&(this._activeSelectionMode=2,this._selectLineAt(N[1]))}shouldColumnSelect(k){return k.altKey&&!(y.isMac&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(k){if(k.stopImmediatePropagation(),!this._model.selectionStart)return;const N=this._model.selectionEnd?[this._model.selectionEnd[0],this._model.selectionEnd[1]]:null;if(this._model.selectionEnd=this._getMouseBufferCoords(k),!this._model.selectionEnd)return void this.refresh(!0);this._activeSelectionMode===2?this._model.selectionEnd[1]<this._model.selectionStart[1]?this._model.selectionEnd[0]=0:this._model.selectionEnd[0]=this._bufferService.cols:this._activeSelectionMode===1&&this._selectToWordAt(this._model.selectionEnd),this._dragScrollAmount=this._getMouseEventScrollAmount(k),this._activeSelectionMode!==3&&(this._dragScrollAmount>0?this._model.selectionEnd[0]=this._bufferService.cols:this._dragScrollAmount<0&&(this._model.selectionEnd[0]=0));const W=this._bufferService.buffer;if(this._model.selectionEnd[1]<W.lines.length){const U=W.lines.get(this._model.selectionEnd[1]);U&&U.hasWidth(this._model.selectionEnd[0])===0&&this._model.selectionEnd[0]<this._bufferService.cols&&this._model.selectionEnd[0]++}N&&N[0]===this._model.selectionEnd[0]&&N[1]===this._model.selectionEnd[1]||this.refresh(!0)}_dragScroll(){if(this._model.selectionEnd&&this._model.selectionStart&&this._dragScrollAmount){this._onRequestScrollLines.fire({amount:this._dragScrollAmount,suppressScrollEvent:!1});const k=this._bufferService.buffer;this._dragScrollAmount>0?(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=this._bufferService.cols),this._model.selectionEnd[1]=Math.min(k.ydisp+this._bufferService.rows,k.lines.length-1)):(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=0),this._model.selectionEnd[1]=k.ydisp),this.refresh()}}_handleMouseUp(k){const N=k.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&N<500&&k.altKey&&this._optionsService.rawOptions.altClickMovesCursor){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){const W=this._mouseService.getCoords(k,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(W&&W[0]!==void 0&&W[1]!==void 0){const U=(0,C.moveToCellSequence)(W[0]-1,W[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(U,!0)}}}else this._fireEventIfSelectionChanged()}_fireEventIfSelectionChanged(){const k=this._model.finalSelectionStart,N=this._model.finalSelectionEnd,W=!(!k||!N||k[0]===N[0]&&k[1]===N[1]);W?k&&N&&(this._oldSelectionStart&&this._oldSelectionEnd&&k[0]===this._oldSelectionStart[0]&&k[1]===this._oldSelectionStart[1]&&N[0]===this._oldSelectionEnd[0]&&N[1]===this._oldSelectionEnd[1]||this._fireOnSelectionChange(k,N,W)):this._oldHasSelection&&this._fireOnSelectionChange(k,N,W)}_fireOnSelectionChange(k,N,W){this._oldSelectionStart=k,this._oldSelectionEnd=N,this._oldHasSelection=W,this._onSelectionChange.fire()}_handleBufferActivate(k){this.clearSelection(),this._trimListener.dispose(),this._trimListener=k.activeBuffer.lines.onTrim((N=>this._handleTrim(N)))}_convertViewportColToCharacterIndex(k,N){let W=N;for(let U=0;N>=U;U++){const F=k.loadCell(U,this._workCell).getChars().length;this._workCell.getWidth()===0?W--:F>1&&N!==U&&(W+=F-1)}return W}setSelection(k,N,W){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[k,N],this._model.selectionStartLength=W,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(k){this._isClickInSelection(k)||(this._selectWordAtCursor(k,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(k,N,W=!0,U=!0){if(k[0]>=this._bufferService.cols)return;const F=this._bufferService.buffer,j=F.lines.get(k[1]);if(!j)return;const J=F.translateBufferLineToString(k[1],!1);let te=this._convertViewportColToCharacterIndex(j,k[0]),P=te;const V=k[0]-te;let Y=0,B=0,z=0,O=0;if(J.charAt(te)===" "){for(;te>0&&J.charAt(te-1)===" ";)te--;for(;P<J.length&&J.charAt(P+1)===" ";)P++}else{let ae=k[0],ce=k[0];j.getWidth(ae)===0&&(Y++,ae--),j.getWidth(ce)===2&&(B++,ce++);const _e=j.getString(ce).length;for(_e>1&&(O+=_e-1,P+=_e-1);ae>0&&te>0&&!this._isCharWordSeparator(j.loadCell(ae-1,this._workCell));){j.loadCell(ae-1,this._workCell);const Q=this._workCell.getChars().length;this._workCell.getWidth()===0?(Y++,ae--):Q>1&&(z+=Q-1,te-=Q-1),te--,ae--}for(;ce<j.length&&P+1<J.length&&!this._isCharWordSeparator(j.loadCell(ce+1,this._workCell));){j.loadCell(ce+1,this._workCell);const Q=this._workCell.getChars().length;this._workCell.getWidth()===2?(B++,ce++):Q>1&&(O+=Q-1,P+=Q-1),P++,ce++}}P++;let H=te+V-Y+z,X=Math.min(this._bufferService.cols,P-te+Y+B-z-O);if(N||J.slice(te,P).trim()!==""){if(W&&H===0&&j.getCodePoint(0)!==32){const ae=F.lines.get(k[1]-1);if(ae&&j.isWrapped&&ae.getCodePoint(this._bufferService.cols-1)!==32){const ce=this._getWordAt([this._bufferService.cols-1,k[1]-1],!1,!0,!1);if(ce){const _e=this._bufferService.cols-ce.start;H-=_e,X+=_e}}}if(U&&H+X===this._bufferService.cols&&j.getCodePoint(this._bufferService.cols-1)!==32){const ae=F.lines.get(k[1]+1);if(ae?.isWrapped&&ae.getCodePoint(0)!==32){const ce=this._getWordAt([0,k[1]+1],!1,!1,!0);ce&&(X+=ce.length)}}return{start:H,length:X}}}_selectWordAt(k,N){const W=this._getWordAt(k,N);if(W){for(;W.start<0;)W.start+=this._bufferService.cols,k[1]--;this._model.selectionStart=[W.start,k[1]],this._model.selectionStartLength=W.length}}_selectToWordAt(k){const N=this._getWordAt(k,!0);if(N){let W=k[1];for(;N.start<0;)N.start+=this._bufferService.cols,W--;if(!this._model.areSelectionValuesReversed())for(;N.start+N.length>this._bufferService.cols;)N.length-=this._bufferService.cols,W++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?N.start:N.start+N.length,W]}}_isCharWordSeparator(k){return k.getWidth()!==0&&this._optionsService.rawOptions.wordSeparator.indexOf(k.getChars())>=0}_selectLineAt(k){const N=this._bufferService.buffer.getWrappedRangeForLine(k),W={start:{x:0,y:N.first},end:{x:this._bufferService.cols-1,y:N.last}};this._model.selectionStart=[0,N.first],this._model.selectionEnd=void 0,this._model.selectionStartLength=(0,f.getRangeLength)(W,this._bufferService.cols)}};c.SelectionService=D=h([b(3,E.IBufferService),b(4,E.ICoreService),b(5,A.IMouseService),b(6,E.IOptionsService),b(7,A.IRenderService),b(8,A.ICoreBrowserService)],D)},4725:(m,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.ILinkProviderService=c.IThemeService=c.ICharacterJoinerService=c.ISelectionService=c.IRenderService=c.IMouseService=c.ICoreBrowserService=c.ICharSizeService=void 0;const h=u(8343);c.ICharSizeService=(0,h.createDecorator)("CharSizeService"),c.ICoreBrowserService=(0,h.createDecorator)("CoreBrowserService"),c.IMouseService=(0,h.createDecorator)("MouseService"),c.IRenderService=(0,h.createDecorator)("RenderService"),c.ISelectionService=(0,h.createDecorator)("SelectionService"),c.ICharacterJoinerService=(0,h.createDecorator)("CharacterJoinerService"),c.IThemeService=(0,h.createDecorator)("ThemeService"),c.ILinkProviderService=(0,h.createDecorator)("LinkProviderService")},6731:function(m,c,u){var h=this&&this.__decorate||function(D,k,N,W){var U,F=arguments.length,j=F<3?k:W===null?W=Object.getOwnPropertyDescriptor(k,N):W;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")j=Reflect.decorate(D,k,N,W);else for(var J=D.length-1;J>=0;J--)(U=D[J])&&(j=(F<3?U(j):F>3?U(k,N,j):U(k,N))||j);return F>3&&j&&Object.defineProperty(k,N,j),j},b=this&&this.__param||function(D,k){return function(N,W){k(N,W,D)}};Object.defineProperty(c,"__esModule",{value:!0}),c.ThemeService=c.DEFAULT_ANSI_COLORS=void 0;const p=u(7239),C=u(8055),w=u(8460),A=u(844),x=u(2585),g=C.css.toColor("#ffffff"),y=C.css.toColor("#000000"),f=C.css.toColor("#ffffff"),_=C.css.toColor("#000000"),E={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117};c.DEFAULT_ANSI_COLORS=Object.freeze((()=>{const D=[C.css.toColor("#2e3436"),C.css.toColor("#cc0000"),C.css.toColor("#4e9a06"),C.css.toColor("#c4a000"),C.css.toColor("#3465a4"),C.css.toColor("#75507b"),C.css.toColor("#06989a"),C.css.toColor("#d3d7cf"),C.css.toColor("#555753"),C.css.toColor("#ef2929"),C.css.toColor("#8ae234"),C.css.toColor("#fce94f"),C.css.toColor("#729fcf"),C.css.toColor("#ad7fa8"),C.css.toColor("#34e2e2"),C.css.toColor("#eeeeec")],k=[0,95,135,175,215,255];for(let N=0;N<216;N++){const W=k[N/36%6|0],U=k[N/6%6|0],F=k[N%6];D.push({css:C.channels.toCss(W,U,F),rgba:C.channels.toRgba(W,U,F)})}for(let N=0;N<24;N++){const W=8+10*N;D.push({css:C.channels.toCss(W,W,W),rgba:C.channels.toRgba(W,W,W)})}return D})());let L=c.ThemeService=class extends A.Disposable{get colors(){return this._colors}constructor(D){super(),this._optionsService=D,this._contrastCache=new p.ColorContrastCache,this._halfContrastCache=new p.ColorContrastCache,this._onChangeColors=this.register(new w.EventEmitter),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:g,background:y,cursor:f,cursorAccent:_,selectionForeground:void 0,selectionBackgroundTransparent:E,selectionBackgroundOpaque:C.color.blend(y,E),selectionInactiveBackgroundTransparent:E,selectionInactiveBackgroundOpaque:C.color.blend(y,E),ansi:c.DEFAULT_ANSI_COLORS.slice(),contrastCache:this._contrastCache,halfContrastCache:this._halfContrastCache},this._updateRestoreColors(),this._setTheme(this._optionsService.rawOptions.theme),this.register(this._optionsService.onSpecificOptionChange("minimumContrastRatio",(()=>this._contrastCache.clear()))),this.register(this._optionsService.onSpecificOptionChange("theme",(()=>this._setTheme(this._optionsService.rawOptions.theme))))}_setTheme(D={}){const k=this._colors;if(k.foreground=R(D.foreground,g),k.background=R(D.background,y),k.cursor=R(D.cursor,f),k.cursorAccent=R(D.cursorAccent,_),k.selectionBackgroundTransparent=R(D.selectionBackground,E),k.selectionBackgroundOpaque=C.color.blend(k.background,k.selectionBackgroundTransparent),k.selectionInactiveBackgroundTransparent=R(D.selectionInactiveBackground,k.selectionBackgroundTransparent),k.selectionInactiveBackgroundOpaque=C.color.blend(k.background,k.selectionInactiveBackgroundTransparent),k.selectionForeground=D.selectionForeground?R(D.selectionForeground,C.NULL_COLOR):void 0,k.selectionForeground===C.NULL_COLOR&&(k.selectionForeground=void 0),C.color.isOpaque(k.selectionBackgroundTransparent)&&(k.selectionBackgroundTransparent=C.color.opacity(k.selectionBackgroundTransparent,.3)),C.color.isOpaque(k.selectionInactiveBackgroundTransparent)&&(k.selectionInactiveBackgroundTransparent=C.color.opacity(k.selectionInactiveBackgroundTransparent,.3)),k.ansi=c.DEFAULT_ANSI_COLORS.slice(),k.ansi[0]=R(D.black,c.DEFAULT_ANSI_COLORS[0]),k.ansi[1]=R(D.red,c.DEFAULT_ANSI_COLORS[1]),k.ansi[2]=R(D.green,c.DEFAULT_ANSI_COLORS[2]),k.ansi[3]=R(D.yellow,c.DEFAULT_ANSI_COLORS[3]),k.ansi[4]=R(D.blue,c.DEFAULT_ANSI_COLORS[4]),k.ansi[5]=R(D.magenta,c.DEFAULT_ANSI_COLORS[5]),k.ansi[6]=R(D.cyan,c.DEFAULT_ANSI_COLORS[6]),k.ansi[7]=R(D.white,c.DEFAULT_ANSI_COLORS[7]),k.ansi[8]=R(D.brightBlack,c.DEFAULT_ANSI_COLORS[8]),k.ansi[9]=R(D.brightRed,c.DEFAULT_ANSI_COLORS[9]),k.ansi[10]=R(D.brightGreen,c.DEFAULT_ANSI_COLORS[10]),k.ansi[11]=R(D.brightYellow,c.DEFAULT_ANSI_COLORS[11]),k.ansi[12]=R(D.brightBlue,c.DEFAULT_ANSI_COLORS[12]),k.ansi[13]=R(D.brightMagenta,c.DEFAULT_ANSI_COLORS[13]),k.ansi[14]=R(D.brightCyan,c.DEFAULT_ANSI_COLORS[14]),k.ansi[15]=R(D.brightWhite,c.DEFAULT_ANSI_COLORS[15]),D.extendedAnsi){const N=Math.min(k.ansi.length-16,D.extendedAnsi.length);for(let W=0;W<N;W++)k.ansi[W+16]=R(D.extendedAnsi[W],c.DEFAULT_ANSI_COLORS[W+16])}this._contrastCache.clear(),this._halfContrastCache.clear(),this._updateRestoreColors(),this._onChangeColors.fire(this.colors)}restoreColor(D){this._restoreColor(D),this._onChangeColors.fire(this.colors)}_restoreColor(D){if(D!==void 0)switch(D){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[D]=this._restoreColors.ansi[D]}else for(let k=0;k<this._restoreColors.ansi.length;++k)this._colors.ansi[k]=this._restoreColors.ansi[k]}modifyColors(D){D(this._colors),this._onChangeColors.fire(this.colors)}_updateRestoreColors(){this._restoreColors={foreground:this._colors.foreground,background:this._colors.background,cursor:this._colors.cursor,ansi:this._colors.ansi.slice()}}};function R(D,k){if(D!==void 0)try{return C.css.toColor(D)}catch{}return k}c.ThemeService=L=h([b(0,x.IOptionsService)],L)},6349:(m,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.CircularList=void 0;const h=u(8460),b=u(844);class p extends b.Disposable{constructor(w){super(),this._maxLength=w,this.onDeleteEmitter=this.register(new h.EventEmitter),this.onDelete=this.onDeleteEmitter.event,this.onInsertEmitter=this.register(new h.EventEmitter),this.onInsert=this.onInsertEmitter.event,this.onTrimEmitter=this.register(new h.EventEmitter),this.onTrim=this.onTrimEmitter.event,this._array=new Array(this._maxLength),this._startIndex=0,this._length=0}get maxLength(){return this._maxLength}set maxLength(w){if(this._maxLength===w)return;const A=new Array(w);for(let x=0;x<Math.min(w,this.length);x++)A[x]=this._array[this._getCyclicIndex(x)];this._array=A,this._maxLength=w,this._startIndex=0}get length(){return this._length}set length(w){if(w>this._length)for(let A=this._length;A<w;A++)this._array[A]=void 0;this._length=w}get(w){return this._array[this._getCyclicIndex(w)]}set(w,A){this._array[this._getCyclicIndex(w)]=A}push(w){this._array[this._getCyclicIndex(this._length)]=w,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(w,A,...x){if(A){for(let g=w;g<this._length-A;g++)this._array[this._getCyclicIndex(g)]=this._array[this._getCyclicIndex(g+A)];this._length-=A,this.onDeleteEmitter.fire({index:w,amount:A})}for(let g=this._length-1;g>=w;g--)this._array[this._getCyclicIndex(g+x.length)]=this._array[this._getCyclicIndex(g)];for(let g=0;g<x.length;g++)this._array[this._getCyclicIndex(w+g)]=x[g];if(x.length&&this.onInsertEmitter.fire({index:w,amount:x.length}),this._length+x.length>this._maxLength){const g=this._length+x.length-this._maxLength;this._startIndex+=g,this._length=this._maxLength,this.onTrimEmitter.fire(g)}else this._length+=x.length}trimStart(w){w>this._length&&(w=this._length),this._startIndex+=w,this._length-=w,this.onTrimEmitter.fire(w)}shiftElements(w,A,x){if(!(A<=0)){if(w<0||w>=this._length)throw new Error("start argument out of range");if(w+x<0)throw new Error("Cannot shift elements in list beyond index 0");if(x>0){for(let y=A-1;y>=0;y--)this.set(w+y+x,this.get(w+y));const g=w+A+x-this._length;if(g>0)for(this._length+=g;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(let g=0;g<A;g++)this.set(w+g+x,this.get(w+g))}}_getCyclicIndex(w){return(this._startIndex+w)%this._maxLength}}c.CircularList=p},1439:(m,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.clone=void 0,c.clone=function u(h,b=5){if(typeof h!="object")return h;const p=Array.isArray(h)?[]:{};for(const C in h)p[C]=b<=1?h[C]:h[C]&&u(h[C],b-1);return p}},8055:(m,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.contrastRatio=c.toPaddedHex=c.rgba=c.rgb=c.css=c.color=c.channels=c.NULL_COLOR=void 0;let u=0,h=0,b=0,p=0;var C,w,A,x,g;function y(_){const E=_.toString(16);return E.length<2?"0"+E:E}function f(_,E){return _<E?(E+.05)/(_+.05):(_+.05)/(E+.05)}c.NULL_COLOR={css:"#00000000",rgba:0},(function(_){_.toCss=function(E,L,R,D){return D!==void 0?`#${y(E)}${y(L)}${y(R)}${y(D)}`:`#${y(E)}${y(L)}${y(R)}`},_.toRgba=function(E,L,R,D=255){return(E<<24|L<<16|R<<8|D)>>>0},_.toColor=function(E,L,R,D){return{css:_.toCss(E,L,R,D),rgba:_.toRgba(E,L,R,D)}}})(C||(c.channels=C={})),(function(_){function E(L,R){return p=Math.round(255*R),[u,h,b]=g.toChannels(L.rgba),{css:C.toCss(u,h,b,p),rgba:C.toRgba(u,h,b,p)}}_.blend=function(L,R){if(p=(255&R.rgba)/255,p===1)return{css:R.css,rgba:R.rgba};const D=R.rgba>>24&255,k=R.rgba>>16&255,N=R.rgba>>8&255,W=L.rgba>>24&255,U=L.rgba>>16&255,F=L.rgba>>8&255;return u=W+Math.round((D-W)*p),h=U+Math.round((k-U)*p),b=F+Math.round((N-F)*p),{css:C.toCss(u,h,b),rgba:C.toRgba(u,h,b)}},_.isOpaque=function(L){return(255&L.rgba)==255},_.ensureContrastRatio=function(L,R,D){const k=g.ensureContrastRatio(L.rgba,R.rgba,D);if(k)return C.toColor(k>>24&255,k>>16&255,k>>8&255)},_.opaque=function(L){const R=(255|L.rgba)>>>0;return[u,h,b]=g.toChannels(R),{css:C.toCss(u,h,b),rgba:R}},_.opacity=E,_.multiplyOpacity=function(L,R){return p=255&L.rgba,E(L,p*R/255)},_.toColorRGB=function(L){return[L.rgba>>24&255,L.rgba>>16&255,L.rgba>>8&255]}})(w||(c.color=w={})),(function(_){let E,L;try{const R=document.createElement("canvas");R.width=1,R.height=1;const D=R.getContext("2d",{willReadFrequently:!0});D&&(E=D,E.globalCompositeOperation="copy",L=E.createLinearGradient(0,0,1,1))}catch{}_.toColor=function(R){if(R.match(/#[\da-f]{3,8}/i))switch(R.length){case 4:return u=parseInt(R.slice(1,2).repeat(2),16),h=parseInt(R.slice(2,3).repeat(2),16),b=parseInt(R.slice(3,4).repeat(2),16),C.toColor(u,h,b);case 5:return u=parseInt(R.slice(1,2).repeat(2),16),h=parseInt(R.slice(2,3).repeat(2),16),b=parseInt(R.slice(3,4).repeat(2),16),p=parseInt(R.slice(4,5).repeat(2),16),C.toColor(u,h,b,p);case 7:return{css:R,rgba:(parseInt(R.slice(1),16)<<8|255)>>>0};case 9:return{css:R,rgba:parseInt(R.slice(1),16)>>>0}}const D=R.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(D)return u=parseInt(D[1]),h=parseInt(D[2]),b=parseInt(D[3]),p=Math.round(255*(D[5]===void 0?1:parseFloat(D[5]))),C.toColor(u,h,b,p);if(!E||!L)throw new Error("css.toColor: Unsupported css format");if(E.fillStyle=L,E.fillStyle=R,typeof E.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(E.fillRect(0,0,1,1),[u,h,b,p]=E.getImageData(0,0,1,1).data,p!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:C.toRgba(u,h,b,p),css:R}}})(A||(c.css=A={})),(function(_){function E(L,R,D){const k=L/255,N=R/255,W=D/255;return .2126*(k<=.03928?k/12.92:Math.pow((k+.055)/1.055,2.4))+.7152*(N<=.03928?N/12.92:Math.pow((N+.055)/1.055,2.4))+.0722*(W<=.03928?W/12.92:Math.pow((W+.055)/1.055,2.4))}_.relativeLuminance=function(L){return E(L>>16&255,L>>8&255,255&L)},_.relativeLuminance2=E})(x||(c.rgb=x={})),(function(_){function E(R,D,k){const N=R>>24&255,W=R>>16&255,U=R>>8&255;let F=D>>24&255,j=D>>16&255,J=D>>8&255,te=f(x.relativeLuminance2(F,j,J),x.relativeLuminance2(N,W,U));for(;te<k&&(F>0||j>0||J>0);)F-=Math.max(0,Math.ceil(.1*F)),j-=Math.max(0,Math.ceil(.1*j)),J-=Math.max(0,Math.ceil(.1*J)),te=f(x.relativeLuminance2(F,j,J),x.relativeLuminance2(N,W,U));return(F<<24|j<<16|J<<8|255)>>>0}function L(R,D,k){const N=R>>24&255,W=R>>16&255,U=R>>8&255;let F=D>>24&255,j=D>>16&255,J=D>>8&255,te=f(x.relativeLuminance2(F,j,J),x.relativeLuminance2(N,W,U));for(;te<k&&(F<255||j<255||J<255);)F=Math.min(255,F+Math.ceil(.1*(255-F))),j=Math.min(255,j+Math.ceil(.1*(255-j))),J=Math.min(255,J+Math.ceil(.1*(255-J))),te=f(x.relativeLuminance2(F,j,J),x.relativeLuminance2(N,W,U));return(F<<24|j<<16|J<<8|255)>>>0}_.blend=function(R,D){if(p=(255&D)/255,p===1)return D;const k=D>>24&255,N=D>>16&255,W=D>>8&255,U=R>>24&255,F=R>>16&255,j=R>>8&255;return u=U+Math.round((k-U)*p),h=F+Math.round((N-F)*p),b=j+Math.round((W-j)*p),C.toRgba(u,h,b)},_.ensureContrastRatio=function(R,D,k){const N=x.relativeLuminance(R>>8),W=x.relativeLuminance(D>>8);if(f(N,W)<k){if(W<N){const j=E(R,D,k),J=f(N,x.relativeLuminance(j>>8));if(J<k){const te=L(R,D,k);return J>f(N,x.relativeLuminance(te>>8))?j:te}return j}const U=L(R,D,k),F=f(N,x.relativeLuminance(U>>8));if(F<k){const j=E(R,D,k);return F>f(N,x.relativeLuminance(j>>8))?U:j}return U}},_.reduceLuminance=E,_.increaseLuminance=L,_.toChannels=function(R){return[R>>24&255,R>>16&255,R>>8&255,255&R]}})(g||(c.rgba=g={})),c.toPaddedHex=y,c.contrastRatio=f},8969:(m,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.CoreTerminal=void 0;const h=u(844),b=u(2585),p=u(4348),C=u(7866),w=u(744),A=u(7302),x=u(6975),g=u(8460),y=u(1753),f=u(1480),_=u(7994),E=u(9282),L=u(5435),R=u(5981),D=u(2660);let k=!1;class N extends h.Disposable{get onScroll(){return this._onScrollApi||(this._onScrollApi=this.register(new g.EventEmitter),this._onScroll.event((U=>{this._onScrollApi?.fire(U.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(U){for(const F in U)this.optionsService.options[F]=U[F]}constructor(U){super(),this._windowsWrappingHeuristics=this.register(new h.MutableDisposable),this._onBinary=this.register(new g.EventEmitter),this.onBinary=this._onBinary.event,this._onData=this.register(new g.EventEmitter),this.onData=this._onData.event,this._onLineFeed=this.register(new g.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onResize=this.register(new g.EventEmitter),this.onResize=this._onResize.event,this._onWriteParsed=this.register(new g.EventEmitter),this.onWriteParsed=this._onWriteParsed.event,this._onScroll=this.register(new g.EventEmitter),this._instantiationService=new p.InstantiationService,this.optionsService=this.register(new A.OptionsService(U)),this._instantiationService.setService(b.IOptionsService,this.optionsService),this._bufferService=this.register(this._instantiationService.createInstance(w.BufferService)),this._instantiationService.setService(b.IBufferService,this._bufferService),this._logService=this.register(this._instantiationService.createInstance(C.LogService)),this._instantiationService.setService(b.ILogService,this._logService),this.coreService=this.register(this._instantiationService.createInstance(x.CoreService)),this._instantiationService.setService(b.ICoreService,this.coreService),this.coreMouseService=this.register(this._instantiationService.createInstance(y.CoreMouseService)),this._instantiationService.setService(b.ICoreMouseService,this.coreMouseService),this.unicodeService=this.register(this._instantiationService.createInstance(f.UnicodeService)),this._instantiationService.setService(b.IUnicodeService,this.unicodeService),this._charsetService=this._instantiationService.createInstance(_.CharsetService),this._instantiationService.setService(b.ICharsetService,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(D.OscLinkService),this._instantiationService.setService(b.IOscLinkService,this._oscLinkService),this._inputHandler=this.register(new L.InputHandler(this._bufferService,this._charsetService,this.coreService,this._logService,this.optionsService,this._oscLinkService,this.coreMouseService,this.unicodeService)),this.register((0,g.forwardEvent)(this._inputHandler.onLineFeed,this._onLineFeed)),this.register(this._inputHandler),this.register((0,g.forwardEvent)(this._bufferService.onResize,this._onResize)),this.register((0,g.forwardEvent)(this.coreService.onData,this._onData)),this.register((0,g.forwardEvent)(this.coreService.onBinary,this._onBinary)),this.register(this.coreService.onRequestScrollToBottom((()=>this.scrollToBottom()))),this.register(this.coreService.onUserInput((()=>this._writeBuffer.handleUserInput()))),this.register(this.optionsService.onMultipleOptionChange(["windowsMode","windowsPty"],(()=>this._handleWindowsPtyOptionChange()))),this.register(this._bufferService.onScroll((F=>{this._onScroll.fire({position:this._bufferService.buffer.ydisp,source:0}),this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)}))),this.register(this._inputHandler.onScroll((F=>{this._onScroll.fire({position:this._bufferService.buffer.ydisp,source:0}),this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)}))),this._writeBuffer=this.register(new R.WriteBuffer(((F,j)=>this._inputHandler.parse(F,j)))),this.register((0,g.forwardEvent)(this._writeBuffer.onWriteParsed,this._onWriteParsed))}write(U,F){this._writeBuffer.write(U,F)}writeSync(U,F){this._logService.logLevel<=b.LogLevelEnum.WARN&&!k&&(this._logService.warn("writeSync is unreliable and will be removed soon."),k=!0),this._writeBuffer.writeSync(U,F)}input(U,F=!0){this.coreService.triggerDataEvent(U,F)}resize(U,F){isNaN(U)||isNaN(F)||(U=Math.max(U,w.MINIMUM_COLS),F=Math.max(F,w.MINIMUM_ROWS),this._bufferService.resize(U,F))}scroll(U,F=!1){this._bufferService.scroll(U,F)}scrollLines(U,F,j){this._bufferService.scrollLines(U,F,j)}scrollPages(U){this.scrollLines(U*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(){this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(U){const F=U-this._bufferService.buffer.ydisp;F!==0&&this.scrollLines(F)}registerEscHandler(U,F){return this._inputHandler.registerEscHandler(U,F)}registerDcsHandler(U,F){return this._inputHandler.registerDcsHandler(U,F)}registerCsiHandler(U,F){return this._inputHandler.registerCsiHandler(U,F)}registerOscHandler(U,F){return this._inputHandler.registerOscHandler(U,F)}_setup(){this._handleWindowsPtyOptionChange()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_handleWindowsPtyOptionChange(){let U=!1;const F=this.optionsService.rawOptions.windowsPty;F&&F.buildNumber!==void 0&&F.buildNumber!==void 0?U=F.backend==="conpty"&&F.buildNumber<21376:this.optionsService.rawOptions.windowsMode&&(U=!0),U?this._enableWindowsWrappingHeuristics():this._windowsWrappingHeuristics.clear()}_enableWindowsWrappingHeuristics(){if(!this._windowsWrappingHeuristics.value){const U=[];U.push(this.onLineFeed(E.updateWindowsModeWrappedState.bind(null,this._bufferService))),U.push(this.registerCsiHandler({final:"H"},(()=>((0,E.updateWindowsModeWrappedState)(this._bufferService),!1)))),this._windowsWrappingHeuristics.value=(0,h.toDisposable)((()=>{for(const F of U)F.dispose()}))}}}c.CoreTerminal=N},8460:(m,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.runAndSubscribe=c.forwardEvent=c.EventEmitter=void 0,c.EventEmitter=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||(this._event=u=>(this._listeners.push(u),{dispose:()=>{if(!this._disposed){for(let h=0;h<this._listeners.length;h++)if(this._listeners[h]===u)return void this._listeners.splice(h,1)}}})),this._event}fire(u,h){const b=[];for(let p=0;p<this._listeners.length;p++)b.push(this._listeners[p]);for(let p=0;p<b.length;p++)b[p].call(void 0,u,h)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},c.forwardEvent=function(u,h){return u((b=>h.fire(b)))},c.runAndSubscribe=function(u,h){return h(void 0),u((b=>h(b)))}},5435:function(m,c,u){var h=this&&this.__decorate||function(Y,B,z,O){var H,X=arguments.length,ae=X<3?B:O===null?O=Object.getOwnPropertyDescriptor(B,z):O;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")ae=Reflect.decorate(Y,B,z,O);else for(var ce=Y.length-1;ce>=0;ce--)(H=Y[ce])&&(ae=(X<3?H(ae):X>3?H(B,z,ae):H(B,z))||ae);return X>3&&ae&&Object.defineProperty(B,z,ae),ae},b=this&&this.__param||function(Y,B){return function(z,O){B(z,O,Y)}};Object.defineProperty(c,"__esModule",{value:!0}),c.InputHandler=c.WindowsOptionsReportType=void 0;const p=u(2584),C=u(7116),w=u(2015),A=u(844),x=u(482),g=u(8437),y=u(8460),f=u(643),_=u(511),E=u(3734),L=u(2585),R=u(1480),D=u(6242),k=u(6351),N=u(5941),W={"(":0,")":1,"*":2,"+":3,"-":1,".":2},U=131072;function F(Y,B){if(Y>24)return B.setWinLines||!1;switch(Y){case 1:return!!B.restoreWin;case 2:return!!B.minimizeWin;case 3:return!!B.setWinPosition;case 4:return!!B.setWinSizePixels;case 5:return!!B.raiseWin;case 6:return!!B.lowerWin;case 7:return!!B.refreshWin;case 8:return!!B.setWinSizeChars;case 9:return!!B.maximizeWin;case 10:return!!B.fullscreenWin;case 11:return!!B.getWinState;case 13:return!!B.getWinPosition;case 14:return!!B.getWinSizePixels;case 15:return!!B.getScreenSizePixels;case 16:return!!B.getCellSizePixels;case 18:return!!B.getWinSizeChars;case 19:return!!B.getScreenSizeChars;case 20:return!!B.getIconTitle;case 21:return!!B.getWinTitle;case 22:return!!B.pushTitle;case 23:return!!B.popTitle;case 24:return!!B.setWinLines}return!1}var j;(function(Y){Y[Y.GET_WIN_SIZE_PIXELS=0]="GET_WIN_SIZE_PIXELS",Y[Y.GET_CELL_SIZE_PIXELS=1]="GET_CELL_SIZE_PIXELS"})(j||(c.WindowsOptionsReportType=j={}));let J=0;class te extends A.Disposable{getAttrData(){return this._curAttrData}constructor(B,z,O,H,X,ae,ce,_e,Q=new w.EscapeSequenceParser){super(),this._bufferService=B,this._charsetService=z,this._coreService=O,this._logService=H,this._optionsService=X,this._oscLinkService=ae,this._coreMouseService=ce,this._unicodeService=_e,this._parser=Q,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new x.StringToUtf32,this._utf8Decoder=new x.Utf8ToUtf32,this._workCell=new _.CellData,this._windowTitle="",this._iconName="",this._windowTitleStack=[],this._iconNameStack=[],this._curAttrData=g.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=g.DEFAULT_ATTR_DATA.clone(),this._onRequestBell=this.register(new y.EventEmitter),this.onRequestBell=this._onRequestBell.event,this._onRequestRefreshRows=this.register(new y.EventEmitter),this.onRequestRefreshRows=this._onRequestRefreshRows.event,this._onRequestReset=this.register(new y.EventEmitter),this.onRequestReset=this._onRequestReset.event,this._onRequestSendFocus=this.register(new y.EventEmitter),this.onRequestSendFocus=this._onRequestSendFocus.event,this._onRequestSyncScrollBar=this.register(new y.EventEmitter),this.onRequestSyncScrollBar=this._onRequestSyncScrollBar.event,this._onRequestWindowsOptionsReport=this.register(new y.EventEmitter),this.onRequestWindowsOptionsReport=this._onRequestWindowsOptionsReport.event,this._onA11yChar=this.register(new y.EventEmitter),this.onA11yChar=this._onA11yChar.event,this._onA11yTab=this.register(new y.EventEmitter),this.onA11yTab=this._onA11yTab.event,this._onCursorMove=this.register(new y.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onLineFeed=this.register(new y.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onScroll=this.register(new y.EventEmitter),this.onScroll=this._onScroll.event,this._onTitleChange=this.register(new y.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onColor=this.register(new y.EventEmitter),this.onColor=this._onColor.event,this._parseStack={paused:!1,cursorStartX:0,cursorStartY:0,decodedLength:0,position:0},this._specialColors=[256,257,258],this.register(this._parser),this._dirtyRowTracker=new P(this._bufferService),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate(($=>this._activeBuffer=$.activeBuffer))),this._parser.setCsiHandlerFallback((($,oe)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString($),params:oe.toArray()})})),this._parser.setEscHandlerFallback(($=>{this._logService.debug("Unknown ESC code: ",{identifier:this._parser.identToString($)})})),this._parser.setExecuteHandlerFallback(($=>{this._logService.debug("Unknown EXECUTE code: ",{code:$})})),this._parser.setOscHandlerFallback((($,oe,ge)=>{this._logService.debug("Unknown OSC code: ",{identifier:$,action:oe,data:ge})})),this._parser.setDcsHandlerFallback((($,oe,ge)=>{oe==="HOOK"&&(ge=ge.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString($),action:oe,payload:ge})})),this._parser.setPrintHandler((($,oe,ge)=>this.print($,oe,ge))),this._parser.registerCsiHandler({final:"@"},($=>this.insertChars($))),this._parser.registerCsiHandler({intermediates:" ",final:"@"},($=>this.scrollLeft($))),this._parser.registerCsiHandler({final:"A"},($=>this.cursorUp($))),this._parser.registerCsiHandler({intermediates:" ",final:"A"},($=>this.scrollRight($))),this._parser.registerCsiHandler({final:"B"},($=>this.cursorDown($))),this._parser.registerCsiHandler({final:"C"},($=>this.cursorForward($))),this._parser.registerCsiHandler({final:"D"},($=>this.cursorBackward($))),this._parser.registerCsiHandler({final:"E"},($=>this.cursorNextLine($))),this._parser.registerCsiHandler({final:"F"},($=>this.cursorPrecedingLine($))),this._parser.registerCsiHandler({final:"G"},($=>this.cursorCharAbsolute($))),this._parser.registerCsiHandler({final:"H"},($=>this.cursorPosition($))),this._parser.registerCsiHandler({final:"I"},($=>this.cursorForwardTab($))),this._parser.registerCsiHandler({final:"J"},($=>this.eraseInDisplay($,!1))),this._parser.registerCsiHandler({prefix:"?",final:"J"},($=>this.eraseInDisplay($,!0))),this._parser.registerCsiHandler({final:"K"},($=>this.eraseInLine($,!1))),this._parser.registerCsiHandler({prefix:"?",final:"K"},($=>this.eraseInLine($,!0))),this._parser.registerCsiHandler({final:"L"},($=>this.insertLines($))),this._parser.registerCsiHandler({final:"M"},($=>this.deleteLines($))),this._parser.registerCsiHandler({final:"P"},($=>this.deleteChars($))),this._parser.registerCsiHandler({final:"S"},($=>this.scrollUp($))),this._parser.registerCsiHandler({final:"T"},($=>this.scrollDown($))),this._parser.registerCsiHandler({final:"X"},($=>this.eraseChars($))),this._parser.registerCsiHandler({final:"Z"},($=>this.cursorBackwardTab($))),this._parser.registerCsiHandler({final:"`"},($=>this.charPosAbsolute($))),this._parser.registerCsiHandler({final:"a"},($=>this.hPositionRelative($))),this._parser.registerCsiHandler({final:"b"},($=>this.repeatPrecedingCharacter($))),this._parser.registerCsiHandler({final:"c"},($=>this.sendDeviceAttributesPrimary($))),this._parser.registerCsiHandler({prefix:">",final:"c"},($=>this.sendDeviceAttributesSecondary($))),this._parser.registerCsiHandler({final:"d"},($=>this.linePosAbsolute($))),this._parser.registerCsiHandler({final:"e"},($=>this.vPositionRelative($))),this._parser.registerCsiHandler({final:"f"},($=>this.hVPosition($))),this._parser.registerCsiHandler({final:"g"},($=>this.tabClear($))),this._parser.registerCsiHandler({final:"h"},($=>this.setMode($))),this._parser.registerCsiHandler({prefix:"?",final:"h"},($=>this.setModePrivate($))),this._parser.registerCsiHandler({final:"l"},($=>this.resetMode($))),this._parser.registerCsiHandler({prefix:"?",final:"l"},($=>this.resetModePrivate($))),this._parser.registerCsiHandler({final:"m"},($=>this.charAttributes($))),this._parser.registerCsiHandler({final:"n"},($=>this.deviceStatus($))),this._parser.registerCsiHandler({prefix:"?",final:"n"},($=>this.deviceStatusPrivate($))),this._parser.registerCsiHandler({intermediates:"!",final:"p"},($=>this.softReset($))),this._parser.registerCsiHandler({intermediates:" ",final:"q"},($=>this.setCursorStyle($))),this._parser.registerCsiHandler({final:"r"},($=>this.setScrollRegion($))),this._parser.registerCsiHandler({final:"s"},($=>this.saveCursor($))),this._parser.registerCsiHandler({final:"t"},($=>this.windowOptions($))),this._parser.registerCsiHandler({final:"u"},($=>this.restoreCursor($))),this._parser.registerCsiHandler({intermediates:"'",final:"}"},($=>this.insertColumns($))),this._parser.registerCsiHandler({intermediates:"'",final:"~"},($=>this.deleteColumns($))),this._parser.registerCsiHandler({intermediates:'"',final:"q"},($=>this.selectProtected($))),this._parser.registerCsiHandler({intermediates:"$",final:"p"},($=>this.requestMode($,!0))),this._parser.registerCsiHandler({prefix:"?",intermediates:"$",final:"p"},($=>this.requestMode($,!1))),this._parser.setExecuteHandler(p.C0.BEL,(()=>this.bell())),this._parser.setExecuteHandler(p.C0.LF,(()=>this.lineFeed())),this._parser.setExecuteHandler(p.C0.VT,(()=>this.lineFeed())),this._parser.setExecuteHandler(p.C0.FF,(()=>this.lineFeed())),this._parser.setExecuteHandler(p.C0.CR,(()=>this.carriageReturn())),this._parser.setExecuteHandler(p.C0.BS,(()=>this.backspace())),this._parser.setExecuteHandler(p.C0.HT,(()=>this.tab())),this._parser.setExecuteHandler(p.C0.SO,(()=>this.shiftOut())),this._parser.setExecuteHandler(p.C0.SI,(()=>this.shiftIn())),this._parser.setExecuteHandler(p.C1.IND,(()=>this.index())),this._parser.setExecuteHandler(p.C1.NEL,(()=>this.nextLine())),this._parser.setExecuteHandler(p.C1.HTS,(()=>this.tabSet())),this._parser.registerOscHandler(0,new D.OscHandler(($=>(this.setTitle($),this.setIconName($),!0)))),this._parser.registerOscHandler(1,new D.OscHandler(($=>this.setIconName($)))),this._parser.registerOscHandler(2,new D.OscHandler(($=>this.setTitle($)))),this._parser.registerOscHandler(4,new D.OscHandler(($=>this.setOrReportIndexedColor($)))),this._parser.registerOscHandler(8,new D.OscHandler(($=>this.setHyperlink($)))),this._parser.registerOscHandler(10,new D.OscHandler(($=>this.setOrReportFgColor($)))),this._parser.registerOscHandler(11,new D.OscHandler(($=>this.setOrReportBgColor($)))),this._parser.registerOscHandler(12,new D.OscHandler(($=>this.setOrReportCursorColor($)))),this._parser.registerOscHandler(104,new D.OscHandler(($=>this.restoreIndexedColor($)))),this._parser.registerOscHandler(110,new D.OscHandler(($=>this.restoreFgColor($)))),this._parser.registerOscHandler(111,new D.OscHandler(($=>this.restoreBgColor($)))),this._parser.registerOscHandler(112,new D.OscHandler(($=>this.restoreCursorColor($)))),this._parser.registerEscHandler({final:"7"},(()=>this.saveCursor())),this._parser.registerEscHandler({final:"8"},(()=>this.restoreCursor())),this._parser.registerEscHandler({final:"D"},(()=>this.index())),this._parser.registerEscHandler({final:"E"},(()=>this.nextLine())),this._parser.registerEscHandler({final:"H"},(()=>this.tabSet())),this._parser.registerEscHandler({final:"M"},(()=>this.reverseIndex())),this._parser.registerEscHandler({final:"="},(()=>this.keypadApplicationMode())),this._parser.registerEscHandler({final:">"},(()=>this.keypadNumericMode())),this._parser.registerEscHandler({final:"c"},(()=>this.fullReset())),this._parser.registerEscHandler({final:"n"},(()=>this.setgLevel(2))),this._parser.registerEscHandler({final:"o"},(()=>this.setgLevel(3))),this._parser.registerEscHandler({final:"|"},(()=>this.setgLevel(3))),this._parser.registerEscHandler({final:"}"},(()=>this.setgLevel(2))),this._parser.registerEscHandler({final:"~"},(()=>this.setgLevel(1))),this._parser.registerEscHandler({intermediates:"%",final:"@"},(()=>this.selectDefaultCharset())),this._parser.registerEscHandler({intermediates:"%",final:"G"},(()=>this.selectDefaultCharset()));for(const $ in C.CHARSETS)this._parser.registerEscHandler({intermediates:"(",final:$},(()=>this.selectCharset("("+$))),this._parser.registerEscHandler({intermediates:")",final:$},(()=>this.selectCharset(")"+$))),this._parser.registerEscHandler({intermediates:"*",final:$},(()=>this.selectCharset("*"+$))),this._parser.registerEscHandler({intermediates:"+",final:$},(()=>this.selectCharset("+"+$))),this._parser.registerEscHandler({intermediates:"-",final:$},(()=>this.selectCharset("-"+$))),this._parser.registerEscHandler({intermediates:".",final:$},(()=>this.selectCharset("."+$))),this._parser.registerEscHandler({intermediates:"/",final:$},(()=>this.selectCharset("/"+$)));this._parser.registerEscHandler({intermediates:"#",final:"8"},(()=>this.screenAlignmentPattern())),this._parser.setErrorHandler(($=>(this._logService.error("Parsing error: ",$),$))),this._parser.registerDcsHandler({intermediates:"$",final:"q"},new k.DcsHandler((($,oe)=>this.requestStatusString($,oe))))}_preserveStack(B,z,O,H){this._parseStack.paused=!0,this._parseStack.cursorStartX=B,this._parseStack.cursorStartY=z,this._parseStack.decodedLength=O,this._parseStack.position=H}_logSlowResolvingAsync(B){this._logService.logLevel<=L.LogLevelEnum.WARN&&Promise.race([B,new Promise(((z,O)=>setTimeout((()=>O("#SLOW_TIMEOUT")),5e3)))]).catch((z=>{if(z!=="#SLOW_TIMEOUT")throw z;console.warn("async parser handler taking longer than 5000 ms")}))}_getCurrentLinkId(){return this._curAttrData.extended.urlId}parse(B,z){let O,H=this._activeBuffer.x,X=this._activeBuffer.y,ae=0;const ce=this._parseStack.paused;if(ce){if(O=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,z))return this._logSlowResolvingAsync(O),O;H=this._parseStack.cursorStartX,X=this._parseStack.cursorStartY,this._parseStack.paused=!1,B.length>U&&(ae=this._parseStack.position+U)}if(this._logService.logLevel<=L.LogLevelEnum.DEBUG&&this._logService.debug("parsing data"+(typeof B=="string"?` "${B}"`:` "${Array.prototype.map.call(B,($=>String.fromCharCode($))).join("")}"`),typeof B=="string"?B.split("").map(($=>$.charCodeAt(0))):B),this._parseBuffer.length<B.length&&this._parseBuffer.length<U&&(this._parseBuffer=new Uint32Array(Math.min(B.length,U))),ce||this._dirtyRowTracker.clearRange(),B.length>U)for(let $=ae;$<B.length;$+=U){const oe=$+U<B.length?$+U:B.length,ge=typeof B=="string"?this._stringDecoder.decode(B.substring($,oe),this._parseBuffer):this._utf8Decoder.decode(B.subarray($,oe),this._parseBuffer);if(O=this._parser.parse(this._parseBuffer,ge))return this._preserveStack(H,X,ge,$),this._logSlowResolvingAsync(O),O}else if(!ce){const $=typeof B=="string"?this._stringDecoder.decode(B,this._parseBuffer):this._utf8Decoder.decode(B,this._parseBuffer);if(O=this._parser.parse(this._parseBuffer,$))return this._preserveStack(H,X,$,0),this._logSlowResolvingAsync(O),O}this._activeBuffer.x===H&&this._activeBuffer.y===X||this._onCursorMove.fire();const _e=this._dirtyRowTracker.end+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp),Q=this._dirtyRowTracker.start+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp);Q<this._bufferService.rows&&this._onRequestRefreshRows.fire(Math.min(Q,this._bufferService.rows-1),Math.min(_e,this._bufferService.rows-1))}print(B,z,O){let H,X;const ae=this._charsetService.charset,ce=this._optionsService.rawOptions.screenReaderMode,_e=this._bufferService.cols,Q=this._coreService.decPrivateModes.wraparound,$=this._coreService.modes.insertMode,oe=this._curAttrData;let ge=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._activeBuffer.x&&O-z>0&&ge.getWidth(this._activeBuffer.x-1)===2&&ge.setCellFromCodepoint(this._activeBuffer.x-1,0,1,oe);let ye=this._parser.precedingJoinState;for(let be=z;be<O;++be){if(H=B[be],H<127&&ae){const Ct=ae[String.fromCharCode(H)];Ct&&(H=Ct.charCodeAt(0))}const $e=this._unicodeService.charProperties(H,ye);X=R.UnicodeService.extractWidth($e);const Pe=R.UnicodeService.extractShouldJoin($e),Ye=Pe?R.UnicodeService.extractWidth(ye):0;if(ye=$e,ce&&this._onA11yChar.fire((0,x.stringFromCodePoint)(H)),this._getCurrentLinkId()&&this._oscLinkService.addLineToLink(this._getCurrentLinkId(),this._activeBuffer.ybase+this._activeBuffer.y),this._activeBuffer.x+X-Ye>_e){if(Q){const Ct=ge;let Be=this._activeBuffer.x-Ye;for(this._activeBuffer.x=Ye,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),ge=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y),Ye>0&&ge instanceof g.BufferLine&&ge.copyCellsFrom(Ct,Be,0,Ye,!1);Be<_e;)Ct.setCellFromCodepoint(Be++,0,1,oe)}else if(this._activeBuffer.x=_e-1,X===2)continue}if(Pe&&this._activeBuffer.x){const Ct=ge.getWidth(this._activeBuffer.x-1)?1:2;ge.addCodepointToCell(this._activeBuffer.x-Ct,H,X);for(let Be=X-Ye;--Be>=0;)ge.setCellFromCodepoint(this._activeBuffer.x++,0,0,oe)}else if($&&(ge.insertCells(this._activeBuffer.x,X-Ye,this._activeBuffer.getNullCell(oe)),ge.getWidth(_e-1)===2&&ge.setCellFromCodepoint(_e-1,f.NULL_CELL_CODE,f.NULL_CELL_WIDTH,oe)),ge.setCellFromCodepoint(this._activeBuffer.x++,H,X,oe),X>0)for(;--X;)ge.setCellFromCodepoint(this._activeBuffer.x++,0,0,oe)}this._parser.precedingJoinState=ye,this._activeBuffer.x<_e&&O-z>0&&ge.getWidth(this._activeBuffer.x)===0&&!ge.hasContent(this._activeBuffer.x)&&ge.setCellFromCodepoint(this._activeBuffer.x,0,1,oe),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler(B,z){return B.final!=="t"||B.prefix||B.intermediates?this._parser.registerCsiHandler(B,z):this._parser.registerCsiHandler(B,(O=>!F(O.params[0],this._optionsService.rawOptions.windowOptions)||z(O)))}registerDcsHandler(B,z){return this._parser.registerDcsHandler(B,new k.DcsHandler(z))}registerEscHandler(B,z){return this._parser.registerEscHandler(B,z)}registerOscHandler(B,z){return this._parser.registerOscHandler(B,new D.OscHandler(z))}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;const B=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);B.hasWidth(this._activeBuffer.x)&&!B.hasContent(this._activeBuffer.x)&&this._activeBuffer.x--}return this._restrictCursor(),!0}tab(){if(this._activeBuffer.x>=this._bufferService.cols)return!0;const B=this._activeBuffer.x;return this._activeBuffer.x=this._activeBuffer.nextStop(),this._optionsService.rawOptions.screenReaderMode&&this._onA11yTab.fire(this._activeBuffer.x-B),!0}shiftOut(){return this._charsetService.setgLevel(1),!0}shiftIn(){return this._charsetService.setgLevel(0),!0}_restrictCursor(B=this._bufferService.cols-1){this._activeBuffer.x=Math.min(B,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(B,z){this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=B,this._activeBuffer.y=this._activeBuffer.scrollTop+z):(this._activeBuffer.x=B,this._activeBuffer.y=z),this._restrictCursor(),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_moveCursor(B,z){this._restrictCursor(),this._setCursor(this._activeBuffer.x+B,this._activeBuffer.y+z)}cursorUp(B){const z=this._activeBuffer.y-this._activeBuffer.scrollTop;return z>=0?this._moveCursor(0,-Math.min(z,B.params[0]||1)):this._moveCursor(0,-(B.params[0]||1)),!0}cursorDown(B){const z=this._activeBuffer.scrollBottom-this._activeBuffer.y;return z>=0?this._moveCursor(0,Math.min(z,B.params[0]||1)):this._moveCursor(0,B.params[0]||1),!0}cursorForward(B){return this._moveCursor(B.params[0]||1,0),!0}cursorBackward(B){return this._moveCursor(-(B.params[0]||1),0),!0}cursorNextLine(B){return this.cursorDown(B),this._activeBuffer.x=0,!0}cursorPrecedingLine(B){return this.cursorUp(B),this._activeBuffer.x=0,!0}cursorCharAbsolute(B){return this._setCursor((B.params[0]||1)-1,this._activeBuffer.y),!0}cursorPosition(B){return this._setCursor(B.length>=2?(B.params[1]||1)-1:0,(B.params[0]||1)-1),!0}charPosAbsolute(B){return this._setCursor((B.params[0]||1)-1,this._activeBuffer.y),!0}hPositionRelative(B){return this._moveCursor(B.params[0]||1,0),!0}linePosAbsolute(B){return this._setCursor(this._activeBuffer.x,(B.params[0]||1)-1),!0}vPositionRelative(B){return this._moveCursor(0,B.params[0]||1),!0}hVPosition(B){return this.cursorPosition(B),!0}tabClear(B){const z=B.params[0];return z===0?delete this._activeBuffer.tabs[this._activeBuffer.x]:z===3&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(B){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let z=B.params[0]||1;for(;z--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0}cursorBackwardTab(B){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let z=B.params[0]||1;for(;z--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0}selectProtected(B){const z=B.params[0];return z===1&&(this._curAttrData.bg|=536870912),z!==2&&z!==0||(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine(B,z,O,H=!1,X=!1){const ae=this._activeBuffer.lines.get(this._activeBuffer.ybase+B);ae.replaceCells(z,O,this._activeBuffer.getNullCell(this._eraseAttrData()),X),H&&(ae.isWrapped=!1)}_resetBufferLine(B,z=!1){const O=this._activeBuffer.lines.get(this._activeBuffer.ybase+B);O&&(O.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),z),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+B),O.isWrapped=!1)}eraseInDisplay(B,z=!1){let O;switch(this._restrictCursor(this._bufferService.cols),B.params[0]){case 0:for(O=this._activeBuffer.y,this._dirtyRowTracker.markDirty(O),this._eraseInBufferLine(O++,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,z);O<this._bufferService.rows;O++)this._resetBufferLine(O,z);this._dirtyRowTracker.markDirty(O);break;case 1:for(O=this._activeBuffer.y,this._dirtyRowTracker.markDirty(O),this._eraseInBufferLine(O,0,this._activeBuffer.x+1,!0,z),this._activeBuffer.x+1>=this._bufferService.cols&&(this._activeBuffer.lines.get(O+1).isWrapped=!1);O--;)this._resetBufferLine(O,z);this._dirtyRowTracker.markDirty(0);break;case 2:for(O=this._bufferService.rows,this._dirtyRowTracker.markDirty(O-1);O--;)this._resetBufferLine(O,z);this._dirtyRowTracker.markDirty(0);break;case 3:const H=this._activeBuffer.lines.length-this._bufferService.rows;H>0&&(this._activeBuffer.lines.trimStart(H),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-H,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-H,0),this._onScroll.fire(0))}return!0}eraseInLine(B,z=!1){switch(this._restrictCursor(this._bufferService.cols),B.params[0]){case 0:this._eraseInBufferLine(this._activeBuffer.y,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,z);break;case 1:this._eraseInBufferLine(this._activeBuffer.y,0,this._activeBuffer.x+1,!1,z);break;case 2:this._eraseInBufferLine(this._activeBuffer.y,0,this._bufferService.cols,!0,z)}return this._dirtyRowTracker.markDirty(this._activeBuffer.y),!0}insertLines(B){this._restrictCursor();let z=B.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const O=this._activeBuffer.ybase+this._activeBuffer.y,H=this._bufferService.rows-1-this._activeBuffer.scrollBottom,X=this._bufferService.rows-1+this._activeBuffer.ybase-H+1;for(;z--;)this._activeBuffer.lines.splice(X-1,1),this._activeBuffer.lines.splice(O,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}deleteLines(B){this._restrictCursor();let z=B.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const O=this._activeBuffer.ybase+this._activeBuffer.y;let H;for(H=this._bufferService.rows-1-this._activeBuffer.scrollBottom,H=this._bufferService.rows-1+this._activeBuffer.ybase-H;z--;)this._activeBuffer.lines.splice(O,1),this._activeBuffer.lines.splice(H,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}insertChars(B){this._restrictCursor();const z=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return z&&(z.insertCells(this._activeBuffer.x,B.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}deleteChars(B){this._restrictCursor();const z=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return z&&(z.deleteCells(this._activeBuffer.x,B.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}scrollUp(B){let z=B.params[0]||1;for(;z--;)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(B){let z=B.params[0]||1;for(;z--;)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(g.DEFAULT_ATTR_DATA));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollLeft(B){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const z=B.params[0]||1;for(let O=this._activeBuffer.scrollTop;O<=this._activeBuffer.scrollBottom;++O){const H=this._activeBuffer.lines.get(this._activeBuffer.ybase+O);H.deleteCells(0,z,this._activeBuffer.getNullCell(this._eraseAttrData())),H.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollRight(B){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const z=B.params[0]||1;for(let O=this._activeBuffer.scrollTop;O<=this._activeBuffer.scrollBottom;++O){const H=this._activeBuffer.lines.get(this._activeBuffer.ybase+O);H.insertCells(0,z,this._activeBuffer.getNullCell(this._eraseAttrData())),H.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}insertColumns(B){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const z=B.params[0]||1;for(let O=this._activeBuffer.scrollTop;O<=this._activeBuffer.scrollBottom;++O){const H=this._activeBuffer.lines.get(this._activeBuffer.ybase+O);H.insertCells(this._activeBuffer.x,z,this._activeBuffer.getNullCell(this._eraseAttrData())),H.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}deleteColumns(B){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const z=B.params[0]||1;for(let O=this._activeBuffer.scrollTop;O<=this._activeBuffer.scrollBottom;++O){const H=this._activeBuffer.lines.get(this._activeBuffer.ybase+O);H.deleteCells(this._activeBuffer.x,z,this._activeBuffer.getNullCell(this._eraseAttrData())),H.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}eraseChars(B){this._restrictCursor();const z=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return z&&(z.replaceCells(this._activeBuffer.x,this._activeBuffer.x+(B.params[0]||1),this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}repeatPrecedingCharacter(B){const z=this._parser.precedingJoinState;if(!z)return!0;const O=B.params[0]||1,H=R.UnicodeService.extractWidth(z),X=this._activeBuffer.x-H,ae=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).getString(X),ce=new Uint32Array(ae.length*O);let _e=0;for(let $=0;$<ae.length;){const oe=ae.codePointAt($)||0;ce[_e++]=oe,$+=oe>65535?2:1}let Q=_e;for(let $=1;$<O;++$)ce.copyWithin(Q,0,_e),Q+=_e;return this.print(ce,0,Q),!0}sendDeviceAttributesPrimary(B){return B.params[0]>0||(this._is("xterm")||this._is("rxvt-unicode")||this._is("screen")?this._coreService.triggerDataEvent(p.C0.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(p.C0.ESC+"[?6c")),!0}sendDeviceAttributesSecondary(B){return B.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(p.C0.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(p.C0.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(B.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(p.C0.ESC+"[>83;40003;0c")),!0}_is(B){return(this._optionsService.rawOptions.termName+"").indexOf(B)===0}setMode(B){for(let z=0;z<B.length;z++)switch(B.params[z]){case 4:this._coreService.modes.insertMode=!0;break;case 20:this._optionsService.options.convertEol=!0}return!0}setModePrivate(B){for(let z=0;z<B.length;z++)switch(B.params[z]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!0;break;case 2:this._charsetService.setgCharset(0,C.DEFAULT_CHARSET),this._charsetService.setgCharset(1,C.DEFAULT_CHARSET),this._charsetService.setgCharset(2,C.DEFAULT_CHARSET),this._charsetService.setgCharset(3,C.DEFAULT_CHARSET);break;case 3:this._optionsService.rawOptions.windowOptions.setWinLines&&(this._bufferService.resize(132,this._bufferService.rows),this._onRequestReset.fire());break;case 6:this._coreService.decPrivateModes.origin=!0,this._setCursor(0,0);break;case 7:this._coreService.decPrivateModes.wraparound=!0;break;case 12:this._optionsService.options.cursorBlink=!0;break;case 45:this._coreService.decPrivateModes.reverseWraparound=!0;break;case 66:this._logService.debug("Serial port requested application keypad."),this._coreService.decPrivateModes.applicationKeypad=!0,this._onRequestSyncScrollBar.fire();break;case 9:this._coreMouseService.activeProtocol="X10";break;case 1e3:this._coreMouseService.activeProtocol="VT200";break;case 1002:this._coreMouseService.activeProtocol="DRAG";break;case 1003:this._coreMouseService.activeProtocol="ANY";break;case 1004:this._coreService.decPrivateModes.sendFocus=!0,this._onRequestSendFocus.fire();break;case 1005:this._logService.debug("DECSET 1005 not supported (see #2507)");break;case 1006:this._coreMouseService.activeEncoding="SGR";break;case 1015:this._logService.debug("DECSET 1015 not supported (see #2507)");break;case 1016:this._coreMouseService.activeEncoding="SGR_PIXELS";break;case 25:this._coreService.isCursorHidden=!1;break;case 1048:this.saveCursor();break;case 1049:this.saveCursor();case 47:case 1047:this._bufferService.buffers.activateAltBuffer(this._eraseAttrData()),this._coreService.isCursorInitialized=!0,this._onRequestRefreshRows.fire(0,this._bufferService.rows-1),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!0}return!0}resetMode(B){for(let z=0;z<B.length;z++)switch(B.params[z]){case 4:this._coreService.modes.insertMode=!1;break;case 20:this._optionsService.options.convertEol=!1}return!0}resetModePrivate(B){for(let z=0;z<B.length;z++)switch(B.params[z]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!1;break;case 3:this._optionsService.rawOptions.windowOptions.setWinLines&&(this._bufferService.resize(80,this._bufferService.rows),this._onRequestReset.fire());break;case 6:this._coreService.decPrivateModes.origin=!1,this._setCursor(0,0);break;case 7:this._coreService.decPrivateModes.wraparound=!1;break;case 12:this._optionsService.options.cursorBlink=!1;break;case 45:this._coreService.decPrivateModes.reverseWraparound=!1;break;case 66:this._logService.debug("Switching back to normal keypad."),this._coreService.decPrivateModes.applicationKeypad=!1,this._onRequestSyncScrollBar.fire();break;case 9:case 1e3:case 1002:case 1003:this._coreMouseService.activeProtocol="NONE";break;case 1004:this._coreService.decPrivateModes.sendFocus=!1;break;case 1005:this._logService.debug("DECRST 1005 not supported (see #2507)");break;case 1006:case 1016:this._coreMouseService.activeEncoding="DEFAULT";break;case 1015:this._logService.debug("DECRST 1015 not supported (see #2507)");break;case 25:this._coreService.isCursorHidden=!0;break;case 1048:this.restoreCursor();break;case 1049:case 47:case 1047:this._bufferService.buffers.activateNormalBuffer(),B.params[z]===1049&&this.restoreCursor(),this._coreService.isCursorInitialized=!0,this._onRequestRefreshRows.fire(0,this._bufferService.rows-1),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!1}return!0}requestMode(B,z){const O=this._coreService.decPrivateModes,{activeProtocol:H,activeEncoding:X}=this._coreMouseService,ae=this._coreService,{buffers:ce,cols:_e}=this._bufferService,{active:Q,alt:$}=ce,oe=this._optionsService.rawOptions,ge=Pe=>Pe?1:2,ye=B.params[0];return be=ye,$e=z?ye===2?4:ye===4?ge(ae.modes.insertMode):ye===12?3:ye===20?ge(oe.convertEol):0:ye===1?ge(O.applicationCursorKeys):ye===3?oe.windowOptions.setWinLines?_e===80?2:_e===132?1:0:0:ye===6?ge(O.origin):ye===7?ge(O.wraparound):ye===8?3:ye===9?ge(H==="X10"):ye===12?ge(oe.cursorBlink):ye===25?ge(!ae.isCursorHidden):ye===45?ge(O.reverseWraparound):ye===66?ge(O.applicationKeypad):ye===67?4:ye===1e3?ge(H==="VT200"):ye===1002?ge(H==="DRAG"):ye===1003?ge(H==="ANY"):ye===1004?ge(O.sendFocus):ye===1005?4:ye===1006?ge(X==="SGR"):ye===1015?4:ye===1016?ge(X==="SGR_PIXELS"):ye===1048?1:ye===47||ye===1047||ye===1049?ge(Q===$):ye===2004?ge(O.bracketedPasteMode):0,ae.triggerDataEvent(`${p.C0.ESC}[${z?"":"?"}${be};${$e}$y`),!0;var be,$e}_updateAttrColor(B,z,O,H,X){return z===2?(B|=50331648,B&=-16777216,B|=E.AttributeData.fromColorRGB([O,H,X])):z===5&&(B&=-50331904,B|=33554432|255&O),B}_extractColor(B,z,O){const H=[0,0,-1,0,0,0];let X=0,ae=0;do{if(H[ae+X]=B.params[z+ae],B.hasSubParams(z+ae)){const ce=B.getSubParams(z+ae);let _e=0;do H[1]===5&&(X=1),H[ae+_e+1+X]=ce[_e];while(++_e<ce.length&&_e+ae+1+X<H.length);break}if(H[1]===5&&ae+X>=2||H[1]===2&&ae+X>=5)break;H[1]&&(X=1)}while(++ae+z<B.length&&ae+X<H.length);for(let ce=2;ce<H.length;++ce)H[ce]===-1&&(H[ce]=0);switch(H[0]){case 38:O.fg=this._updateAttrColor(O.fg,H[1],H[3],H[4],H[5]);break;case 48:O.bg=this._updateAttrColor(O.bg,H[1],H[3],H[4],H[5]);break;case 58:O.extended=O.extended.clone(),O.extended.underlineColor=this._updateAttrColor(O.extended.underlineColor,H[1],H[3],H[4],H[5])}return ae}_processUnderline(B,z){z.extended=z.extended.clone(),(!~B||B>5)&&(B=1),z.extended.underlineStyle=B,z.fg|=268435456,B===0&&(z.fg&=-268435457),z.updateExtended()}_processSGR0(B){B.fg=g.DEFAULT_ATTR_DATA.fg,B.bg=g.DEFAULT_ATTR_DATA.bg,B.extended=B.extended.clone(),B.extended.underlineStyle=0,B.extended.underlineColor&=-67108864,B.updateExtended()}charAttributes(B){if(B.length===1&&B.params[0]===0)return this._processSGR0(this._curAttrData),!0;const z=B.length;let O;const H=this._curAttrData;for(let X=0;X<z;X++)O=B.params[X],O>=30&&O<=37?(H.fg&=-50331904,H.fg|=16777216|O-30):O>=40&&O<=47?(H.bg&=-50331904,H.bg|=16777216|O-40):O>=90&&O<=97?(H.fg&=-50331904,H.fg|=16777224|O-90):O>=100&&O<=107?(H.bg&=-50331904,H.bg|=16777224|O-100):O===0?this._processSGR0(H):O===1?H.fg|=134217728:O===3?H.bg|=67108864:O===4?(H.fg|=268435456,this._processUnderline(B.hasSubParams(X)?B.getSubParams(X)[0]:1,H)):O===5?H.fg|=536870912:O===7?H.fg|=67108864:O===8?H.fg|=1073741824:O===9?H.fg|=2147483648:O===2?H.bg|=134217728:O===21?this._processUnderline(2,H):O===22?(H.fg&=-134217729,H.bg&=-134217729):O===23?H.bg&=-67108865:O===24?(H.fg&=-268435457,this._processUnderline(0,H)):O===25?H.fg&=-536870913:O===27?H.fg&=-67108865:O===28?H.fg&=-1073741825:O===29?H.fg&=2147483647:O===39?(H.fg&=-67108864,H.fg|=16777215&g.DEFAULT_ATTR_DATA.fg):O===49?(H.bg&=-67108864,H.bg|=16777215&g.DEFAULT_ATTR_DATA.bg):O===38||O===48||O===58?X+=this._extractColor(B,X,H):O===53?H.bg|=1073741824:O===55?H.bg&=-1073741825:O===59?(H.extended=H.extended.clone(),H.extended.underlineColor=-1,H.updateExtended()):O===100?(H.fg&=-67108864,H.fg|=16777215&g.DEFAULT_ATTR_DATA.fg,H.bg&=-67108864,H.bg|=16777215&g.DEFAULT_ATTR_DATA.bg):this._logService.debug("Unknown SGR attribute: %d.",O);return!0}deviceStatus(B){switch(B.params[0]){case 5:this._coreService.triggerDataEvent(`${p.C0.ESC}[0n`);break;case 6:const z=this._activeBuffer.y+1,O=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${p.C0.ESC}[${z};${O}R`)}return!0}deviceStatusPrivate(B){if(B.params[0]===6){const z=this._activeBuffer.y+1,O=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${p.C0.ESC}[?${z};${O}R`)}return!0}softReset(B){return this._coreService.isCursorHidden=!1,this._onRequestSyncScrollBar.fire(),this._activeBuffer.scrollTop=0,this._activeBuffer.scrollBottom=this._bufferService.rows-1,this._curAttrData=g.DEFAULT_ATTR_DATA.clone(),this._coreService.reset(),this._charsetService.reset(),this._activeBuffer.savedX=0,this._activeBuffer.savedY=this._activeBuffer.ybase,this._activeBuffer.savedCurAttrData.fg=this._curAttrData.fg,this._activeBuffer.savedCurAttrData.bg=this._curAttrData.bg,this._activeBuffer.savedCharset=this._charsetService.charset,this._coreService.decPrivateModes.origin=!1,!0}setCursorStyle(B){const z=B.params[0]||1;switch(z){case 1:case 2:this._optionsService.options.cursorStyle="block";break;case 3:case 4:this._optionsService.options.cursorStyle="underline";break;case 5:case 6:this._optionsService.options.cursorStyle="bar"}const O=z%2==1;return this._optionsService.options.cursorBlink=O,!0}setScrollRegion(B){const z=B.params[0]||1;let O;return(B.length<2||(O=B.params[1])>this._bufferService.rows||O===0)&&(O=this._bufferService.rows),O>z&&(this._activeBuffer.scrollTop=z-1,this._activeBuffer.scrollBottom=O-1,this._setCursor(0,0)),!0}windowOptions(B){if(!F(B.params[0],this._optionsService.rawOptions.windowOptions))return!0;const z=B.length>1?B.params[1]:0;switch(B.params[0]){case 14:z!==2&&this._onRequestWindowsOptionsReport.fire(j.GET_WIN_SIZE_PIXELS);break;case 16:this._onRequestWindowsOptionsReport.fire(j.GET_CELL_SIZE_PIXELS);break;case 18:this._bufferService&&this._coreService.triggerDataEvent(`${p.C0.ESC}[8;${this._bufferService.rows};${this._bufferService.cols}t`);break;case 22:z!==0&&z!==2||(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>10&&this._windowTitleStack.shift()),z!==0&&z!==1||(this._iconNameStack.push(this._iconName),this._iconNameStack.length>10&&this._iconNameStack.shift());break;case 23:z!==0&&z!==2||this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),z!==0&&z!==1||this._iconNameStack.length&&this.setIconName(this._iconNameStack.pop())}return!0}saveCursor(B){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(B){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(B){return this._windowTitle=B,this._onTitleChange.fire(B),!0}setIconName(B){return this._iconName=B,!0}setOrReportIndexedColor(B){const z=[],O=B.split(";");for(;O.length>1;){const H=O.shift(),X=O.shift();if(/^\d+$/.exec(H)){const ae=parseInt(H);if(V(ae))if(X==="?")z.push({type:0,index:ae});else{const ce=(0,N.parseColor)(X);ce&&z.push({type:1,index:ae,color:ce})}}}return z.length&&this._onColor.fire(z),!0}setHyperlink(B){const z=B.split(";");return!(z.length<2)&&(z[1]?this._createHyperlink(z[0],z[1]):!z[0]&&this._finishHyperlink())}_createHyperlink(B,z){this._getCurrentLinkId()&&this._finishHyperlink();const O=B.split(":");let H;const X=O.findIndex((ae=>ae.startsWith("id=")));return X!==-1&&(H=O[X].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:H,uri:z}),this._curAttrData.updateExtended(),!0}_finishHyperlink(){return this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=0,this._curAttrData.updateExtended(),!0}_setOrReportSpecialColor(B,z){const O=B.split(";");for(let H=0;H<O.length&&!(z>=this._specialColors.length);++H,++z)if(O[H]==="?")this._onColor.fire([{type:0,index:this._specialColors[z]}]);else{const X=(0,N.parseColor)(O[H]);X&&this._onColor.fire([{type:1,index:this._specialColors[z],color:X}])}return!0}setOrReportFgColor(B){return this._setOrReportSpecialColor(B,0)}setOrReportBgColor(B){return this._setOrReportSpecialColor(B,1)}setOrReportCursorColor(B){return this._setOrReportSpecialColor(B,2)}restoreIndexedColor(B){if(!B)return this._onColor.fire([{type:2}]),!0;const z=[],O=B.split(";");for(let H=0;H<O.length;++H)if(/^\d+$/.exec(O[H])){const X=parseInt(O[H]);V(X)&&z.push({type:2,index:X})}return z.length&&this._onColor.fire(z),!0}restoreFgColor(B){return this._onColor.fire([{type:2,index:256}]),!0}restoreBgColor(B){return this._onColor.fire([{type:2,index:257}]),!0}restoreCursorColor(B){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,C.DEFAULT_CHARSET),!0}selectCharset(B){return B.length!==2?(this.selectDefaultCharset(),!0):(B[0]==="/"||this._charsetService.setgCharset(W[B[0]],C.CHARSETS[B[1]]||C.DEFAULT_CHARSET),!0)}index(){return this._restrictCursor(),this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData())):this._activeBuffer.y>=this._bufferService.rows&&(this._activeBuffer.y=this._bufferService.rows-1),this._restrictCursor(),!0}tabSet(){return this._activeBuffer.tabs[this._activeBuffer.x]=!0,!0}reverseIndex(){if(this._restrictCursor(),this._activeBuffer.y===this._activeBuffer.scrollTop){const B=this._activeBuffer.scrollBottom-this._activeBuffer.scrollTop;this._activeBuffer.lines.shiftElements(this._activeBuffer.ybase+this._activeBuffer.y,B,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=g.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=g.DEFAULT_ATTR_DATA.clone()}_eraseAttrData(){return this._eraseAttrDataInternal.bg&=-67108864,this._eraseAttrDataInternal.bg|=67108863&this._curAttrData.bg,this._eraseAttrDataInternal}setgLevel(B){return this._charsetService.setgLevel(B),!0}screenAlignmentPattern(){const B=new _.CellData;B.content=4194373,B.fg=this._curAttrData.fg,B.bg=this._curAttrData.bg,this._setCursor(0,0);for(let z=0;z<this._bufferService.rows;++z){const O=this._activeBuffer.ybase+this._activeBuffer.y+z,H=this._activeBuffer.lines.get(O);H&&(H.fill(B),H.isWrapped=!1)}return this._dirtyRowTracker.markAllDirty(),this._setCursor(0,0),!0}requestStatusString(B,z){const O=this._bufferService.buffer,H=this._optionsService.rawOptions;return(X=>(this._coreService.triggerDataEvent(`${p.C0.ESC}${X}${p.C0.ESC}\\`),!0))(B==='"q'?`P1$r${this._curAttrData.isProtected()?1:0}"q`:B==='"p'?'P1$r61;1"p':B==="r"?`P1$r${O.scrollTop+1};${O.scrollBottom+1}r`:B==="m"?"P1$r0m":B===" q"?`P1$r${{block:2,underline:4,bar:6}[H.cursorStyle]-(H.cursorBlink?1:0)} q`:"P0$r")}markRangeDirty(B,z){this._dirtyRowTracker.markRangeDirty(B,z)}}c.InputHandler=te;let P=class{constructor(Y){this._bufferService=Y,this.clearRange()}clearRange(){this.start=this._bufferService.buffer.y,this.end=this._bufferService.buffer.y}markDirty(Y){Y<this.start?this.start=Y:Y>this.end&&(this.end=Y)}markRangeDirty(Y,B){Y>B&&(J=Y,Y=B,B=J),Y<this.start&&(this.start=Y),B>this.end&&(this.end=B)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};function V(Y){return 0<=Y&&Y<256}P=h([b(0,L.IBufferService)],P)},844:(m,c)=>{function u(h){for(const b of h)b.dispose();h.length=0}Object.defineProperty(c,"__esModule",{value:!0}),c.getDisposeArrayDisposable=c.disposeArray=c.toDisposable=c.MutableDisposable=c.Disposable=void 0,c.Disposable=class{constructor(){this._disposables=[],this._isDisposed=!1}dispose(){this._isDisposed=!0;for(const h of this._disposables)h.dispose();this._disposables.length=0}register(h){return this._disposables.push(h),h}unregister(h){const b=this._disposables.indexOf(h);b!==-1&&this._disposables.splice(b,1)}},c.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(h){this._isDisposed||h===this._value||(this._value?.dispose(),this._value=h)}clear(){this.value=void 0}dispose(){this._isDisposed=!0,this._value?.dispose(),this._value=void 0}},c.toDisposable=function(h){return{dispose:h}},c.disposeArray=u,c.getDisposeArrayDisposable=function(h){return{dispose:()=>u(h)}}},1505:(m,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.FourKeyMap=c.TwoKeyMap=void 0;class u{constructor(){this._data={}}set(b,p,C){this._data[b]||(this._data[b]={}),this._data[b][p]=C}get(b,p){return this._data[b]?this._data[b][p]:void 0}clear(){this._data={}}}c.TwoKeyMap=u,c.FourKeyMap=class{constructor(){this._data=new u}set(h,b,p,C,w){this._data.get(h,b)||this._data.set(h,b,new u),this._data.get(h,b).set(p,C,w)}get(h,b,p,C){return this._data.get(h,b)?.get(p,C)}clear(){this._data.clear()}}},6114:(m,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.isChromeOS=c.isLinux=c.isWindows=c.isIphone=c.isIpad=c.isMac=c.getSafariVersion=c.isSafari=c.isLegacyEdge=c.isFirefox=c.isNode=void 0,c.isNode=typeof process<"u"&&"title"in process;const u=c.isNode?"node":navigator.userAgent,h=c.isNode?"node":navigator.platform;c.isFirefox=u.includes("Firefox"),c.isLegacyEdge=u.includes("Edge"),c.isSafari=/^((?!chrome|android).)*safari/i.test(u),c.getSafariVersion=function(){if(!c.isSafari)return 0;const b=u.match(/Version\/(\d+)/);return b===null||b.length<2?0:parseInt(b[1])},c.isMac=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(h),c.isIpad=h==="iPad",c.isIphone=h==="iPhone",c.isWindows=["Windows","Win16","Win32","WinCE"].includes(h),c.isLinux=h.indexOf("Linux")>=0,c.isChromeOS=/\bCrOS\b/.test(u)},6106:(m,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.SortedList=void 0;let u=0;c.SortedList=class{constructor(h){this._getKey=h,this._array=[]}clear(){this._array.length=0}insert(h){this._array.length!==0?(u=this._search(this._getKey(h)),this._array.splice(u,0,h)):this._array.push(h)}delete(h){if(this._array.length===0)return!1;const b=this._getKey(h);if(b===void 0||(u=this._search(b),u===-1)||this._getKey(this._array[u])!==b)return!1;do if(this._array[u]===h)return this._array.splice(u,1),!0;while(++u<this._array.length&&this._getKey(this._array[u])===b);return!1}*getKeyIterator(h){if(this._array.length!==0&&(u=this._search(h),!(u<0||u>=this._array.length)&&this._getKey(this._array[u])===h))do yield this._array[u];while(++u<this._array.length&&this._getKey(this._array[u])===h)}forEachByKey(h,b){if(this._array.length!==0&&(u=this._search(h),!(u<0||u>=this._array.length)&&this._getKey(this._array[u])===h))do b(this._array[u]);while(++u<this._array.length&&this._getKey(this._array[u])===h)}values(){return[...this._array].values()}_search(h){let b=0,p=this._array.length-1;for(;p>=b;){let C=b+p>>1;const w=this._getKey(this._array[C]);if(w>h)p=C-1;else{if(!(w<h)){for(;C>0&&this._getKey(this._array[C-1])===h;)C--;return C}b=C+1}}return b}}},7226:(m,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.DebouncedIdleTask=c.IdleTaskQueue=c.PriorityTaskQueue=void 0;const h=u(6114);class b{constructor(){this._tasks=[],this._i=0}enqueue(w){this._tasks.push(w),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(w){this._idleCallback=void 0;let A=0,x=0,g=w.timeRemaining(),y=0;for(;this._i<this._tasks.length;){if(A=Date.now(),this._tasks[this._i]()||this._i++,A=Math.max(1,Date.now()-A),x=Math.max(A,x),y=w.timeRemaining(),1.5*x>y)return g-A<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(g-A))}ms`),void this._start();g=y}this.clear()}}class p extends b{_requestCallback(w){return setTimeout((()=>w(this._createDeadline(16))))}_cancelCallback(w){clearTimeout(w)}_createDeadline(w){const A=Date.now()+w;return{timeRemaining:()=>Math.max(0,A-Date.now())}}}c.PriorityTaskQueue=p,c.IdleTaskQueue=!h.isNode&&"requestIdleCallback"in window?class extends b{_requestCallback(C){return requestIdleCallback(C)}_cancelCallback(C){cancelIdleCallback(C)}}:p,c.DebouncedIdleTask=class{constructor(){this._queue=new c.IdleTaskQueue}set(C){this._queue.clear(),this._queue.enqueue(C)}flush(){this._queue.flush()}}},9282:(m,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.updateWindowsModeWrappedState=void 0;const h=u(643);c.updateWindowsModeWrappedState=function(b){const p=b.buffer.lines.get(b.buffer.ybase+b.buffer.y-1),C=p?.get(b.cols-1),w=b.buffer.lines.get(b.buffer.ybase+b.buffer.y);w&&C&&(w.isWrapped=C[h.CHAR_DATA_CODE_INDEX]!==h.NULL_CELL_CODE&&C[h.CHAR_DATA_CODE_INDEX]!==h.WHITESPACE_CELL_CODE)}},3734:(m,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.ExtendedAttrs=c.AttributeData=void 0;class u{constructor(){this.fg=0,this.bg=0,this.extended=new h}static toColorRGB(p){return[p>>>16&255,p>>>8&255,255&p]}static fromColorRGB(p){return(255&p[0])<<16|(255&p[1])<<8|255&p[2]}clone(){const p=new u;return p.fg=this.fg,p.bg=this.bg,p.extended=this.extended.clone(),p}isInverse(){return 67108864&this.fg}isBold(){return 134217728&this.fg}isUnderline(){return this.hasExtendedAttrs()&&this.extended.underlineStyle!==0?1:268435456&this.fg}isBlink(){return 536870912&this.fg}isInvisible(){return 1073741824&this.fg}isItalic(){return 67108864&this.bg}isDim(){return 134217728&this.bg}isStrikethrough(){return 2147483648&this.fg}isProtected(){return 536870912&this.bg}isOverline(){return 1073741824&this.bg}getFgColorMode(){return 50331648&this.fg}getBgColorMode(){return 50331648&this.bg}isFgRGB(){return(50331648&this.fg)==50331648}isBgRGB(){return(50331648&this.bg)==50331648}isFgPalette(){return(50331648&this.fg)==16777216||(50331648&this.fg)==33554432}isBgPalette(){return(50331648&this.bg)==16777216||(50331648&this.bg)==33554432}isFgDefault(){return(50331648&this.fg)==0}isBgDefault(){return(50331648&this.bg)==0}isAttributeDefault(){return this.fg===0&&this.bg===0}getFgColor(){switch(50331648&this.fg){case 16777216:case 33554432:return 255&this.fg;case 50331648:return 16777215&this.fg;default:return-1}}getBgColor(){switch(50331648&this.bg){case 16777216:case 33554432:return 255&this.bg;case 50331648:return 16777215&this.bg;default:return-1}}hasExtendedAttrs(){return 268435456&this.bg}updateExtended(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456}getUnderlineColor(){if(268435456&this.bg&&~this.extended.underlineColor)switch(50331648&this.extended.underlineColor){case 16777216:case 33554432:return 255&this.extended.underlineColor;case 50331648:return 16777215&this.extended.underlineColor;default:return this.getFgColor()}return this.getFgColor()}getUnderlineColorMode(){return 268435456&this.bg&&~this.extended.underlineColor?50331648&this.extended.underlineColor:this.getFgColorMode()}isUnderlineColorRGB(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==50331648:this.isFgRGB()}isUnderlineColorPalette(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==16777216||(50331648&this.extended.underlineColor)==33554432:this.isFgPalette()}isUnderlineColorDefault(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==0:this.isFgDefault()}getUnderlineStyle(){return 268435456&this.fg?268435456&this.bg?this.extended.underlineStyle:1:0}getUnderlineVariantOffset(){return this.extended.underlineVariantOffset}}c.AttributeData=u;class h{get ext(){return this._urlId?-469762049&this._ext|this.underlineStyle<<26:this._ext}set ext(p){this._ext=p}get underlineStyle(){return this._urlId?5:(469762048&this._ext)>>26}set underlineStyle(p){this._ext&=-469762049,this._ext|=p<<26&469762048}get underlineColor(){return 67108863&this._ext}set underlineColor(p){this._ext&=-67108864,this._ext|=67108863&p}get urlId(){return this._urlId}set urlId(p){this._urlId=p}get underlineVariantOffset(){const p=(3758096384&this._ext)>>29;return p<0?4294967288^p:p}set underlineVariantOffset(p){this._ext&=536870911,this._ext|=p<<29&3758096384}constructor(p=0,C=0){this._ext=0,this._urlId=0,this._ext=p,this._urlId=C}clone(){return new h(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}}c.ExtendedAttrs=h},9092:(m,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.Buffer=c.MAX_BUFFER_SIZE=void 0;const h=u(6349),b=u(7226),p=u(3734),C=u(8437),w=u(4634),A=u(511),x=u(643),g=u(4863),y=u(7116);c.MAX_BUFFER_SIZE=4294967295,c.Buffer=class{constructor(f,_,E){this._hasScrollback=f,this._optionsService=_,this._bufferService=E,this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.tabs={},this.savedY=0,this.savedX=0,this.savedCurAttrData=C.DEFAULT_ATTR_DATA.clone(),this.savedCharset=y.DEFAULT_CHARSET,this.markers=[],this._nullCell=A.CellData.fromCharData([0,x.NULL_CELL_CHAR,x.NULL_CELL_WIDTH,x.NULL_CELL_CODE]),this._whitespaceCell=A.CellData.fromCharData([0,x.WHITESPACE_CELL_CHAR,x.WHITESPACE_CELL_WIDTH,x.WHITESPACE_CELL_CODE]),this._isClearing=!1,this._memoryCleanupQueue=new b.IdleTaskQueue,this._memoryCleanupPosition=0,this._cols=this._bufferService.cols,this._rows=this._bufferService.rows,this.lines=new h.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}getNullCell(f){return f?(this._nullCell.fg=f.fg,this._nullCell.bg=f.bg,this._nullCell.extended=f.extended):(this._nullCell.fg=0,this._nullCell.bg=0,this._nullCell.extended=new p.ExtendedAttrs),this._nullCell}getWhitespaceCell(f){return f?(this._whitespaceCell.fg=f.fg,this._whitespaceCell.bg=f.bg,this._whitespaceCell.extended=f.extended):(this._whitespaceCell.fg=0,this._whitespaceCell.bg=0,this._whitespaceCell.extended=new p.ExtendedAttrs),this._whitespaceCell}getBlankLine(f,_){return new C.BufferLine(this._bufferService.cols,this.getNullCell(f),_)}get hasScrollback(){return this._hasScrollback&&this.lines.maxLength>this._rows}get isCursorInViewport(){const f=this.ybase+this.y-this.ydisp;return f>=0&&f<this._rows}_getCorrectBufferLength(f){if(!this._hasScrollback)return f;const _=f+this._optionsService.rawOptions.scrollback;return _>c.MAX_BUFFER_SIZE?c.MAX_BUFFER_SIZE:_}fillViewportRows(f){if(this.lines.length===0){f===void 0&&(f=C.DEFAULT_ATTR_DATA);let _=this._rows;for(;_--;)this.lines.push(this.getBlankLine(f))}}clear(){this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.lines=new h.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}resize(f,_){const E=this.getNullCell(C.DEFAULT_ATTR_DATA);let L=0;const R=this._getCorrectBufferLength(_);if(R>this.lines.maxLength&&(this.lines.maxLength=R),this.lines.length>0){if(this._cols<f)for(let k=0;k<this.lines.length;k++)L+=+this.lines.get(k).resize(f,E);let D=0;if(this._rows<_)for(let k=this._rows;k<_;k++)this.lines.length<_+this.ybase&&(this._optionsService.rawOptions.windowsMode||this._optionsService.rawOptions.windowsPty.backend!==void 0||this._optionsService.rawOptions.windowsPty.buildNumber!==void 0?this.lines.push(new C.BufferLine(f,E)):this.ybase>0&&this.lines.length<=this.ybase+this.y+D+1?(this.ybase--,D++,this.ydisp>0&&this.ydisp--):this.lines.push(new C.BufferLine(f,E)));else for(let k=this._rows;k>_;k--)this.lines.length>_+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(R<this.lines.maxLength){const k=this.lines.length-R;k>0&&(this.lines.trimStart(k),this.ybase=Math.max(this.ybase-k,0),this.ydisp=Math.max(this.ydisp-k,0),this.savedY=Math.max(this.savedY-k,0)),this.lines.maxLength=R}this.x=Math.min(this.x,f-1),this.y=Math.min(this.y,_-1),D&&(this.y+=D),this.savedX=Math.min(this.savedX,f-1),this.scrollTop=0}if(this.scrollBottom=_-1,this._isReflowEnabled&&(this._reflow(f,_),this._cols>f))for(let D=0;D<this.lines.length;D++)L+=+this.lines.get(D).resize(f,E);this._cols=f,this._rows=_,this._memoryCleanupQueue.clear(),L>.1*this.lines.length&&(this._memoryCleanupPosition=0,this._memoryCleanupQueue.enqueue((()=>this._batchedMemoryCleanup())))}_batchedMemoryCleanup(){let f=!0;this._memoryCleanupPosition>=this.lines.length&&(this._memoryCleanupPosition=0,f=!1);let _=0;for(;this._memoryCleanupPosition<this.lines.length;)if(_+=this.lines.get(this._memoryCleanupPosition++).cleanupMemory(),_>100)return!0;return f}get _isReflowEnabled(){const f=this._optionsService.rawOptions.windowsPty;return f&&f.buildNumber?this._hasScrollback&&f.backend==="conpty"&&f.buildNumber>=21376:this._hasScrollback&&!this._optionsService.rawOptions.windowsMode}_reflow(f,_){this._cols!==f&&(f>this._cols?this._reflowLarger(f,_):this._reflowSmaller(f,_))}_reflowLarger(f,_){const E=(0,w.reflowLargerGetLinesToRemove)(this.lines,this._cols,f,this.ybase+this.y,this.getNullCell(C.DEFAULT_ATTR_DATA));if(E.length>0){const L=(0,w.reflowLargerCreateNewLayout)(this.lines,E);(0,w.reflowLargerApplyNewLayout)(this.lines,L.layout),this._reflowLargerAdjustViewport(f,_,L.countRemoved)}}_reflowLargerAdjustViewport(f,_,E){const L=this.getNullCell(C.DEFAULT_ATTR_DATA);let R=E;for(;R-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length<_&&this.lines.push(new C.BufferLine(f,L))):(this.ydisp===this.ybase&&this.ydisp--,this.ybase--);this.savedY=Math.max(this.savedY-E,0)}_reflowSmaller(f,_){const E=this.getNullCell(C.DEFAULT_ATTR_DATA),L=[];let R=0;for(let D=this.lines.length-1;D>=0;D--){let k=this.lines.get(D);if(!k||!k.isWrapped&&k.getTrimmedLength()<=f)continue;const N=[k];for(;k.isWrapped&&D>0;)k=this.lines.get(--D),N.unshift(k);const W=this.ybase+this.y;if(W>=D&&W<D+N.length)continue;const U=N[N.length-1].getTrimmedLength(),F=(0,w.reflowSmallerGetNewLineLengths)(N,this._cols,f),j=F.length-N.length;let J;J=this.ybase===0&&this.y!==this.lines.length-1?Math.max(0,this.y-this.lines.maxLength+j):Math.max(0,this.lines.length-this.lines.maxLength+j);const te=[];for(let O=0;O<j;O++){const H=this.getBlankLine(C.DEFAULT_ATTR_DATA,!0);te.push(H)}te.length>0&&(L.push({start:D+N.length+R,newLines:te}),R+=te.length),N.push(...te);let P=F.length-1,V=F[P];V===0&&(P--,V=F[P]);let Y=N.length-j-1,B=U;for(;Y>=0;){const O=Math.min(B,V);if(N[P]===void 0)break;if(N[P].copyCellsFrom(N[Y],B-O,V-O,O,!0),V-=O,V===0&&(P--,V=F[P]),B-=O,B===0){Y--;const H=Math.max(Y,0);B=(0,w.getWrappedLineTrimmedLength)(N,H,this._cols)}}for(let O=0;O<N.length;O++)F[O]<f&&N[O].setCell(F[O],E);let z=j-J;for(;z-- >0;)this.ybase===0?this.y<_-1?(this.y++,this.lines.pop()):(this.ybase++,this.ydisp++):this.ybase<Math.min(this.lines.maxLength,this.lines.length+R)-_&&(this.ybase===this.ydisp&&this.ydisp++,this.ybase++);this.savedY=Math.min(this.savedY+j,this.ybase+_-1)}if(L.length>0){const D=[],k=[];for(let P=0;P<this.lines.length;P++)k.push(this.lines.get(P));const N=this.lines.length;let W=N-1,U=0,F=L[U];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+R);let j=0;for(let P=Math.min(this.lines.maxLength-1,N+R-1);P>=0;P--)if(F&&F.start>W+j){for(let V=F.newLines.length-1;V>=0;V--)this.lines.set(P--,F.newLines[V]);P++,D.push({index:W+1,amount:F.newLines.length}),j+=F.newLines.length,F=L[++U]}else this.lines.set(P,k[W--]);let J=0;for(let P=D.length-1;P>=0;P--)D[P].index+=J,this.lines.onInsertEmitter.fire(D[P]),J+=D[P].amount;const te=Math.max(0,N+R-this.lines.maxLength);te>0&&this.lines.onTrimEmitter.fire(te)}}translateBufferLineToString(f,_,E=0,L){const R=this.lines.get(f);return R?R.translateToString(_,E,L):""}getWrappedRangeForLine(f){let _=f,E=f;for(;_>0&&this.lines.get(_).isWrapped;)_--;for(;E+1<this.lines.length&&this.lines.get(E+1).isWrapped;)E++;return{first:_,last:E}}setupTabStops(f){for(f!=null?this.tabs[f]||(f=this.prevStop(f)):(this.tabs={},f=0);f<this._cols;f+=this._optionsService.rawOptions.tabStopWidth)this.tabs[f]=!0}prevStop(f){for(f==null&&(f=this.x);!this.tabs[--f]&&f>0;);return f>=this._cols?this._cols-1:f<0?0:f}nextStop(f){for(f==null&&(f=this.x);!this.tabs[++f]&&f<this._cols;);return f>=this._cols?this._cols-1:f<0?0:f}clearMarkers(f){this._isClearing=!0;for(let _=0;_<this.markers.length;_++)this.markers[_].line===f&&(this.markers[_].dispose(),this.markers.splice(_--,1));this._isClearing=!1}clearAllMarkers(){this._isClearing=!0;for(let f=0;f<this.markers.length;f++)this.markers[f].dispose(),this.markers.splice(f--,1);this._isClearing=!1}addMarker(f){const _=new g.Marker(f);return this.markers.push(_),_.register(this.lines.onTrim((E=>{_.line-=E,_.line<0&&_.dispose()}))),_.register(this.lines.onInsert((E=>{_.line>=E.index&&(_.line+=E.amount)}))),_.register(this.lines.onDelete((E=>{_.line>=E.index&&_.line<E.index+E.amount&&_.dispose(),_.line>E.index&&(_.line-=E.amount)}))),_.register(_.onDispose((()=>this._removeMarker(_)))),_}_removeMarker(f){this._isClearing||this.markers.splice(this.markers.indexOf(f),1)}}},8437:(m,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.BufferLine=c.DEFAULT_ATTR_DATA=void 0;const h=u(3734),b=u(511),p=u(643),C=u(482);c.DEFAULT_ATTR_DATA=Object.freeze(new h.AttributeData);let w=0;class A{constructor(g,y,f=!1){this.isWrapped=f,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(3*g);const _=y||b.CellData.fromCharData([0,p.NULL_CELL_CHAR,p.NULL_CELL_WIDTH,p.NULL_CELL_CODE]);for(let E=0;E<g;++E)this.setCell(E,_);this.length=g}get(g){const y=this._data[3*g+0],f=2097151&y;return[this._data[3*g+1],2097152&y?this._combined[g]:f?(0,C.stringFromCodePoint)(f):"",y>>22,2097152&y?this._combined[g].charCodeAt(this._combined[g].length-1):f]}set(g,y){this._data[3*g+1]=y[p.CHAR_DATA_ATTR_INDEX],y[p.CHAR_DATA_CHAR_INDEX].length>1?(this._combined[g]=y[1],this._data[3*g+0]=2097152|g|y[p.CHAR_DATA_WIDTH_INDEX]<<22):this._data[3*g+0]=y[p.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|y[p.CHAR_DATA_WIDTH_INDEX]<<22}getWidth(g){return this._data[3*g+0]>>22}hasWidth(g){return 12582912&this._data[3*g+0]}getFg(g){return this._data[3*g+1]}getBg(g){return this._data[3*g+2]}hasContent(g){return 4194303&this._data[3*g+0]}getCodePoint(g){const y=this._data[3*g+0];return 2097152&y?this._combined[g].charCodeAt(this._combined[g].length-1):2097151&y}isCombined(g){return 2097152&this._data[3*g+0]}getString(g){const y=this._data[3*g+0];return 2097152&y?this._combined[g]:2097151&y?(0,C.stringFromCodePoint)(2097151&y):""}isProtected(g){return 536870912&this._data[3*g+2]}loadCell(g,y){return w=3*g,y.content=this._data[w+0],y.fg=this._data[w+1],y.bg=this._data[w+2],2097152&y.content&&(y.combinedData=this._combined[g]),268435456&y.bg&&(y.extended=this._extendedAttrs[g]),y}setCell(g,y){2097152&y.content&&(this._combined[g]=y.combinedData),268435456&y.bg&&(this._extendedAttrs[g]=y.extended),this._data[3*g+0]=y.content,this._data[3*g+1]=y.fg,this._data[3*g+2]=y.bg}setCellFromCodepoint(g,y,f,_){268435456&_.bg&&(this._extendedAttrs[g]=_.extended),this._data[3*g+0]=y|f<<22,this._data[3*g+1]=_.fg,this._data[3*g+2]=_.bg}addCodepointToCell(g,y,f){let _=this._data[3*g+0];2097152&_?this._combined[g]+=(0,C.stringFromCodePoint)(y):2097151&_?(this._combined[g]=(0,C.stringFromCodePoint)(2097151&_)+(0,C.stringFromCodePoint)(y),_&=-2097152,_|=2097152):_=y|4194304,f&&(_&=-12582913,_|=f<<22),this._data[3*g+0]=_}insertCells(g,y,f){if((g%=this.length)&&this.getWidth(g-1)===2&&this.setCellFromCodepoint(g-1,0,1,f),y<this.length-g){const _=new b.CellData;for(let E=this.length-g-y-1;E>=0;--E)this.setCell(g+y+E,this.loadCell(g+E,_));for(let E=0;E<y;++E)this.setCell(g+E,f)}else for(let _=g;_<this.length;++_)this.setCell(_,f);this.getWidth(this.length-1)===2&&this.setCellFromCodepoint(this.length-1,0,1,f)}deleteCells(g,y,f){if(g%=this.length,y<this.length-g){const _=new b.CellData;for(let E=0;E<this.length-g-y;++E)this.setCell(g+E,this.loadCell(g+y+E,_));for(let E=this.length-y;E<this.length;++E)this.setCell(E,f)}else for(let _=g;_<this.length;++_)this.setCell(_,f);g&&this.getWidth(g-1)===2&&this.setCellFromCodepoint(g-1,0,1,f),this.getWidth(g)!==0||this.hasContent(g)||this.setCellFromCodepoint(g,0,1,f)}replaceCells(g,y,f,_=!1){if(_)for(g&&this.getWidth(g-1)===2&&!this.isProtected(g-1)&&this.setCellFromCodepoint(g-1,0,1,f),y<this.length&&this.getWidth(y-1)===2&&!this.isProtected(y)&&this.setCellFromCodepoint(y,0,1,f);g<y&&g<this.length;)this.isProtected(g)||this.setCell(g,f),g++;else for(g&&this.getWidth(g-1)===2&&this.setCellFromCodepoint(g-1,0,1,f),y<this.length&&this.getWidth(y-1)===2&&this.setCellFromCodepoint(y,0,1,f);g<y&&g<this.length;)this.setCell(g++,f)}resize(g,y){if(g===this.length)return 4*this._data.length*2<this._data.buffer.byteLength;const f=3*g;if(g>this.length){if(this._data.buffer.byteLength>=4*f)this._data=new Uint32Array(this._data.buffer,0,f);else{const _=new Uint32Array(f);_.set(this._data),this._data=_}for(let _=this.length;_<g;++_)this.setCell(_,y)}else{this._data=this._data.subarray(0,f);const _=Object.keys(this._combined);for(let L=0;L<_.length;L++){const R=parseInt(_[L],10);R>=g&&delete this._combined[R]}const E=Object.keys(this._extendedAttrs);for(let L=0;L<E.length;L++){const R=parseInt(E[L],10);R>=g&&delete this._extendedAttrs[R]}}return this.length=g,4*f*2<this._data.buffer.byteLength}cleanupMemory(){if(4*this._data.length*2<this._data.buffer.byteLength){const g=new Uint32Array(this._data.length);return g.set(this._data),this._data=g,1}return 0}fill(g,y=!1){if(y)for(let f=0;f<this.length;++f)this.isProtected(f)||this.setCell(f,g);else{this._combined={},this._extendedAttrs={};for(let f=0;f<this.length;++f)this.setCell(f,g)}}copyFrom(g){this.length!==g.length?this._data=new Uint32Array(g._data):this._data.set(g._data),this.length=g.length,this._combined={};for(const y in g._combined)this._combined[y]=g._combined[y];this._extendedAttrs={};for(const y in g._extendedAttrs)this._extendedAttrs[y]=g._extendedAttrs[y];this.isWrapped=g.isWrapped}clone(){const g=new A(0);g._data=new Uint32Array(this._data),g.length=this.length;for(const y in this._combined)g._combined[y]=this._combined[y];for(const y in this._extendedAttrs)g._extendedAttrs[y]=this._extendedAttrs[y];return g.isWrapped=this.isWrapped,g}getTrimmedLength(){for(let g=this.length-1;g>=0;--g)if(4194303&this._data[3*g+0])return g+(this._data[3*g+0]>>22);return 0}getNoBgTrimmedLength(){for(let g=this.length-1;g>=0;--g)if(4194303&this._data[3*g+0]||50331648&this._data[3*g+2])return g+(this._data[3*g+0]>>22);return 0}copyCellsFrom(g,y,f,_,E){const L=g._data;if(E)for(let D=_-1;D>=0;D--){for(let k=0;k<3;k++)this._data[3*(f+D)+k]=L[3*(y+D)+k];268435456&L[3*(y+D)+2]&&(this._extendedAttrs[f+D]=g._extendedAttrs[y+D])}else for(let D=0;D<_;D++){for(let k=0;k<3;k++)this._data[3*(f+D)+k]=L[3*(y+D)+k];268435456&L[3*(y+D)+2]&&(this._extendedAttrs[f+D]=g._extendedAttrs[y+D])}const R=Object.keys(g._combined);for(let D=0;D<R.length;D++){const k=parseInt(R[D],10);k>=y&&(this._combined[k-y+f]=g._combined[k])}}translateToString(g,y,f,_){y=y??0,f=f??this.length,g&&(f=Math.min(f,this.getTrimmedLength())),_&&(_.length=0);let E="";for(;y<f;){const L=this._data[3*y+0],R=2097151&L,D=2097152&L?this._combined[y]:R?(0,C.stringFromCodePoint)(R):p.WHITESPACE_CELL_CHAR;if(E+=D,_)for(let k=0;k<D.length;++k)_.push(y);y+=L>>22||1}return _&&_.push(y),E}}c.BufferLine=A},4841:(m,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.getRangeLength=void 0,c.getRangeLength=function(u,h){if(u.start.y>u.end.y)throw new Error(`Buffer range end (${u.end.x}, ${u.end.y}) cannot be before start (${u.start.x}, ${u.start.y})`);return h*(u.end.y-u.start.y)+(u.end.x-u.start.x+1)}},4634:(m,c)=>{function u(h,b,p){if(b===h.length-1)return h[b].getTrimmedLength();const C=!h[b].hasContent(p-1)&&h[b].getWidth(p-1)===1,w=h[b+1].getWidth(0)===2;return C&&w?p-1:p}Object.defineProperty(c,"__esModule",{value:!0}),c.getWrappedLineTrimmedLength=c.reflowSmallerGetNewLineLengths=c.reflowLargerApplyNewLayout=c.reflowLargerCreateNewLayout=c.reflowLargerGetLinesToRemove=void 0,c.reflowLargerGetLinesToRemove=function(h,b,p,C,w){const A=[];for(let x=0;x<h.length-1;x++){let g=x,y=h.get(++g);if(!y.isWrapped)continue;const f=[h.get(x)];for(;g<h.length&&y.isWrapped;)f.push(y),y=h.get(++g);if(C>=x&&C<g){x+=f.length-1;continue}let _=0,E=u(f,_,b),L=1,R=0;for(;L<f.length;){const k=u(f,L,b),N=k-R,W=p-E,U=Math.min(N,W);f[_].copyCellsFrom(f[L],R,E,U,!1),E+=U,E===p&&(_++,E=0),R+=U,R===k&&(L++,R=0),E===0&&_!==0&&f[_-1].getWidth(p-1)===2&&(f[_].copyCellsFrom(f[_-1],p-1,E++,1,!1),f[_-1].setCell(p-1,w))}f[_].replaceCells(E,p,w);let D=0;for(let k=f.length-1;k>0&&(k>_||f[k].getTrimmedLength()===0);k--)D++;D>0&&(A.push(x+f.length-D),A.push(D)),x+=f.length-1}return A},c.reflowLargerCreateNewLayout=function(h,b){const p=[];let C=0,w=b[C],A=0;for(let x=0;x<h.length;x++)if(w===x){const g=b[++C];h.onDeleteEmitter.fire({index:x-A,amount:g}),x+=g-1,A+=g,w=b[++C]}else p.push(x);return{layout:p,countRemoved:A}},c.reflowLargerApplyNewLayout=function(h,b){const p=[];for(let C=0;C<b.length;C++)p.push(h.get(b[C]));for(let C=0;C<p.length;C++)h.set(C,p[C]);h.length=b.length},c.reflowSmallerGetNewLineLengths=function(h,b,p){const C=[],w=h.map(((y,f)=>u(h,f,b))).reduce(((y,f)=>y+f));let A=0,x=0,g=0;for(;g<w;){if(w-g<p){C.push(w-g);break}A+=p;const y=u(h,x,b);A>y&&(A-=y,x++);const f=h[x].getWidth(A-1)===2;f&&A--;const _=f?p-1:p;C.push(_),g+=_}return C},c.getWrappedLineTrimmedLength=u},5295:(m,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.BufferSet=void 0;const h=u(8460),b=u(844),p=u(9092);class C extends b.Disposable{constructor(A,x){super(),this._optionsService=A,this._bufferService=x,this._onBufferActivate=this.register(new h.EventEmitter),this.onBufferActivate=this._onBufferActivate.event,this.reset(),this.register(this._optionsService.onSpecificOptionChange("scrollback",(()=>this.resize(this._bufferService.cols,this._bufferService.rows)))),this.register(this._optionsService.onSpecificOptionChange("tabStopWidth",(()=>this.setupTabStops())))}reset(){this._normal=new p.Buffer(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new p.Buffer(!1,this._optionsService,this._bufferService),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}),this.setupTabStops()}get alt(){return this._alt}get active(){return this._activeBuffer}get normal(){return this._normal}activateNormalBuffer(){this._activeBuffer!==this._normal&&(this._normal.x=this._alt.x,this._normal.y=this._alt.y,this._alt.clearAllMarkers(),this._alt.clear(),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}))}activateAltBuffer(A){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(A),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(A,x){this._normal.resize(A,x),this._alt.resize(A,x),this.setupTabStops(A)}setupTabStops(A){this._normal.setupTabStops(A),this._alt.setupTabStops(A)}}c.BufferSet=C},511:(m,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.CellData=void 0;const h=u(482),b=u(643),p=u(3734);class C extends p.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new p.ExtendedAttrs,this.combinedData=""}static fromCharData(A){const x=new C;return x.setFromCharData(A),x}isCombined(){return 2097152&this.content}getWidth(){return this.content>>22}getChars(){return 2097152&this.content?this.combinedData:2097151&this.content?(0,h.stringFromCodePoint)(2097151&this.content):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content}setFromCharData(A){this.fg=A[b.CHAR_DATA_ATTR_INDEX],this.bg=0;let x=!1;if(A[b.CHAR_DATA_CHAR_INDEX].length>2)x=!0;else if(A[b.CHAR_DATA_CHAR_INDEX].length===2){const g=A[b.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=g&&g<=56319){const y=A[b.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=y&&y<=57343?this.content=1024*(g-55296)+y-56320+65536|A[b.CHAR_DATA_WIDTH_INDEX]<<22:x=!0}else x=!0}else this.content=A[b.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|A[b.CHAR_DATA_WIDTH_INDEX]<<22;x&&(this.combinedData=A[b.CHAR_DATA_CHAR_INDEX],this.content=2097152|A[b.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}c.CellData=C},643:(m,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.WHITESPACE_CELL_CODE=c.WHITESPACE_CELL_WIDTH=c.WHITESPACE_CELL_CHAR=c.NULL_CELL_CODE=c.NULL_CELL_WIDTH=c.NULL_CELL_CHAR=c.CHAR_DATA_CODE_INDEX=c.CHAR_DATA_WIDTH_INDEX=c.CHAR_DATA_CHAR_INDEX=c.CHAR_DATA_ATTR_INDEX=c.DEFAULT_EXT=c.DEFAULT_ATTR=c.DEFAULT_COLOR=void 0,c.DEFAULT_COLOR=0,c.DEFAULT_ATTR=256|c.DEFAULT_COLOR<<9,c.DEFAULT_EXT=0,c.CHAR_DATA_ATTR_INDEX=0,c.CHAR_DATA_CHAR_INDEX=1,c.CHAR_DATA_WIDTH_INDEX=2,c.CHAR_DATA_CODE_INDEX=3,c.NULL_CELL_CHAR="",c.NULL_CELL_WIDTH=1,c.NULL_CELL_CODE=0,c.WHITESPACE_CELL_CHAR=" ",c.WHITESPACE_CELL_WIDTH=1,c.WHITESPACE_CELL_CODE=32},4863:(m,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.Marker=void 0;const h=u(8460),b=u(844);class p{get id(){return this._id}constructor(w){this.line=w,this.isDisposed=!1,this._disposables=[],this._id=p._nextId++,this._onDispose=this.register(new h.EventEmitter),this.onDispose=this._onDispose.event}dispose(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire(),(0,b.disposeArray)(this._disposables),this._disposables.length=0)}register(w){return this._disposables.push(w),w}}c.Marker=p,p._nextId=1},7116:(m,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.DEFAULT_CHARSET=c.CHARSETS=void 0,c.CHARSETS={},c.DEFAULT_CHARSET=c.CHARSETS.B,c.CHARSETS[0]={"`":"◆",a:"▒",b:"␉",c:"␌",d:"␍",e:"␊",f:"°",g:"±",h:"",i:"␋",j:"┘",k:"┐",l:"┌",m:"└",n:"┼",o:"⎺",p:"⎻",q:"─",r:"⎼",s:"⎽",t:"├",u:"┤",v:"┴",w:"┬",x:"│",y:"≤",z:"≥","{":"π","|":"≠","}":"£","~":"·"},c.CHARSETS.A={"#":"£"},c.CHARSETS.B=void 0,c.CHARSETS[4]={"#":"£","@":"¾","[":"ij","\\":"½","]":"|","{":"¨","|":"f","}":"¼","~":"´"},c.CHARSETS.C=c.CHARSETS[5]={"[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},c.CHARSETS.R={"#":"£","@":"à","[":"°","\\":"ç","]":"§","{":"é","|":"ù","}":"è","~":"¨"},c.CHARSETS.Q={"@":"à","[":"â","\\":"ç","]":"ê","^":"î","`":"ô","{":"é","|":"ù","}":"è","~":"û"},c.CHARSETS.K={"@":"§","[":"Ä","\\":"Ö","]":"Ü","{":"ä","|":"ö","}":"ü","~":"ß"},c.CHARSETS.Y={"#":"£","@":"§","[":"°","\\":"ç","]":"é","`":"ù","{":"à","|":"ò","}":"è","~":"ì"},c.CHARSETS.E=c.CHARSETS[6]={"@":"Ä","[":"Æ","\\":"Ø","]":"Å","^":"Ü","`":"ä","{":"æ","|":"ø","}":"å","~":"ü"},c.CHARSETS.Z={"#":"£","@":"§","[":"¡","\\":"Ñ","]":"¿","{":"°","|":"ñ","}":"ç"},c.CHARSETS.H=c.CHARSETS[7]={"@":"É","[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},c.CHARSETS["="]={"#":"ù","@":"à","[":"é","\\":"ç","]":"ê","^":"î",_:"è","`":"ô","{":"ä","|":"ö","}":"ü","~":"û"}},2584:(m,c)=>{var u,h,b;Object.defineProperty(c,"__esModule",{value:!0}),c.C1_ESCAPED=c.C1=c.C0=void 0,(function(p){p.NUL="\0",p.SOH="",p.STX="",p.ETX="",p.EOT="",p.ENQ="",p.ACK="",p.BEL="\x07",p.BS="\b",p.HT=" ",p.LF=`
|
|
82
|
+
`,p.VT="\v",p.FF="\f",p.CR="\r",p.SO="",p.SI="",p.DLE="",p.DC1="",p.DC2="",p.DC3="",p.DC4="",p.NAK="",p.SYN="",p.ETB="",p.CAN="",p.EM="",p.SUB="",p.ESC="\x1B",p.FS="",p.GS="",p.RS="",p.US="",p.SP=" ",p.DEL=""})(u||(c.C0=u={})),(function(p){p.PAD="",p.HOP="",p.BPH="",p.NBH="",p.IND="",p.NEL="
",p.SSA="",p.ESA="",p.HTS="",p.HTJ="",p.VTS="",p.PLD="",p.PLU="",p.RI="",p.SS2="",p.SS3="",p.DCS="",p.PU1="",p.PU2="",p.STS="",p.CCH="",p.MW="",p.SPA="",p.EPA="",p.SOS="",p.SGCI="",p.SCI="",p.CSI="",p.ST="",p.OSC="",p.PM="",p.APC=""})(h||(c.C1=h={})),(function(p){p.ST=`${u.ESC}\\`})(b||(c.C1_ESCAPED=b={}))},7399:(m,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.evaluateKeyboardEvent=void 0;const h=u(2584),b={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:["'",'"']};c.evaluateKeyboardEvent=function(p,C,w,A){const x={type:0,cancel:!1,key:void 0},g=(p.shiftKey?1:0)|(p.altKey?2:0)|(p.ctrlKey?4:0)|(p.metaKey?8:0);switch(p.keyCode){case 0:p.key==="UIKeyInputUpArrow"?x.key=C?h.C0.ESC+"OA":h.C0.ESC+"[A":p.key==="UIKeyInputLeftArrow"?x.key=C?h.C0.ESC+"OD":h.C0.ESC+"[D":p.key==="UIKeyInputRightArrow"?x.key=C?h.C0.ESC+"OC":h.C0.ESC+"[C":p.key==="UIKeyInputDownArrow"&&(x.key=C?h.C0.ESC+"OB":h.C0.ESC+"[B");break;case 8:x.key=p.ctrlKey?"\b":h.C0.DEL,p.altKey&&(x.key=h.C0.ESC+x.key);break;case 9:if(p.shiftKey){x.key=h.C0.ESC+"[Z";break}x.key=h.C0.HT,x.cancel=!0;break;case 13:x.key=p.altKey?h.C0.ESC+h.C0.CR:h.C0.CR,x.cancel=!0;break;case 27:x.key=h.C0.ESC,p.altKey&&(x.key=h.C0.ESC+h.C0.ESC),x.cancel=!0;break;case 37:if(p.metaKey)break;g?(x.key=h.C0.ESC+"[1;"+(g+1)+"D",x.key===h.C0.ESC+"[1;3D"&&(x.key=h.C0.ESC+(w?"b":"[1;5D"))):x.key=C?h.C0.ESC+"OD":h.C0.ESC+"[D";break;case 39:if(p.metaKey)break;g?(x.key=h.C0.ESC+"[1;"+(g+1)+"C",x.key===h.C0.ESC+"[1;3C"&&(x.key=h.C0.ESC+(w?"f":"[1;5C"))):x.key=C?h.C0.ESC+"OC":h.C0.ESC+"[C";break;case 38:if(p.metaKey)break;g?(x.key=h.C0.ESC+"[1;"+(g+1)+"A",w||x.key!==h.C0.ESC+"[1;3A"||(x.key=h.C0.ESC+"[1;5A")):x.key=C?h.C0.ESC+"OA":h.C0.ESC+"[A";break;case 40:if(p.metaKey)break;g?(x.key=h.C0.ESC+"[1;"+(g+1)+"B",w||x.key!==h.C0.ESC+"[1;3B"||(x.key=h.C0.ESC+"[1;5B")):x.key=C?h.C0.ESC+"OB":h.C0.ESC+"[B";break;case 45:p.shiftKey||p.ctrlKey||(x.key=h.C0.ESC+"[2~");break;case 46:x.key=g?h.C0.ESC+"[3;"+(g+1)+"~":h.C0.ESC+"[3~";break;case 36:x.key=g?h.C0.ESC+"[1;"+(g+1)+"H":C?h.C0.ESC+"OH":h.C0.ESC+"[H";break;case 35:x.key=g?h.C0.ESC+"[1;"+(g+1)+"F":C?h.C0.ESC+"OF":h.C0.ESC+"[F";break;case 33:p.shiftKey?x.type=2:p.ctrlKey?x.key=h.C0.ESC+"[5;"+(g+1)+"~":x.key=h.C0.ESC+"[5~";break;case 34:p.shiftKey?x.type=3:p.ctrlKey?x.key=h.C0.ESC+"[6;"+(g+1)+"~":x.key=h.C0.ESC+"[6~";break;case 112:x.key=g?h.C0.ESC+"[1;"+(g+1)+"P":h.C0.ESC+"OP";break;case 113:x.key=g?h.C0.ESC+"[1;"+(g+1)+"Q":h.C0.ESC+"OQ";break;case 114:x.key=g?h.C0.ESC+"[1;"+(g+1)+"R":h.C0.ESC+"OR";break;case 115:x.key=g?h.C0.ESC+"[1;"+(g+1)+"S":h.C0.ESC+"OS";break;case 116:x.key=g?h.C0.ESC+"[15;"+(g+1)+"~":h.C0.ESC+"[15~";break;case 117:x.key=g?h.C0.ESC+"[17;"+(g+1)+"~":h.C0.ESC+"[17~";break;case 118:x.key=g?h.C0.ESC+"[18;"+(g+1)+"~":h.C0.ESC+"[18~";break;case 119:x.key=g?h.C0.ESC+"[19;"+(g+1)+"~":h.C0.ESC+"[19~";break;case 120:x.key=g?h.C0.ESC+"[20;"+(g+1)+"~":h.C0.ESC+"[20~";break;case 121:x.key=g?h.C0.ESC+"[21;"+(g+1)+"~":h.C0.ESC+"[21~";break;case 122:x.key=g?h.C0.ESC+"[23;"+(g+1)+"~":h.C0.ESC+"[23~";break;case 123:x.key=g?h.C0.ESC+"[24;"+(g+1)+"~":h.C0.ESC+"[24~";break;default:if(!p.ctrlKey||p.shiftKey||p.altKey||p.metaKey)if(w&&!A||!p.altKey||p.metaKey)!w||p.altKey||p.ctrlKey||p.shiftKey||!p.metaKey?p.key&&!p.ctrlKey&&!p.altKey&&!p.metaKey&&p.keyCode>=48&&p.key.length===1?x.key=p.key:p.key&&p.ctrlKey&&(p.key==="_"&&(x.key=h.C0.US),p.key==="@"&&(x.key=h.C0.NUL)):p.keyCode===65&&(x.type=1);else{const y=b[p.keyCode],f=y?.[p.shiftKey?1:0];if(f)x.key=h.C0.ESC+f;else if(p.keyCode>=65&&p.keyCode<=90){const _=p.ctrlKey?p.keyCode-64:p.keyCode+32;let E=String.fromCharCode(_);p.shiftKey&&(E=E.toUpperCase()),x.key=h.C0.ESC+E}else if(p.keyCode===32)x.key=h.C0.ESC+(p.ctrlKey?h.C0.NUL:" ");else if(p.key==="Dead"&&p.code.startsWith("Key")){let _=p.code.slice(3,4);p.shiftKey||(_=_.toLowerCase()),x.key=h.C0.ESC+_,x.cancel=!0}}else p.keyCode>=65&&p.keyCode<=90?x.key=String.fromCharCode(p.keyCode-64):p.keyCode===32?x.key=h.C0.NUL:p.keyCode>=51&&p.keyCode<=55?x.key=String.fromCharCode(p.keyCode-51+27):p.keyCode===56?x.key=h.C0.DEL:p.keyCode===219?x.key=h.C0.ESC:p.keyCode===220?x.key=h.C0.FS:p.keyCode===221&&(x.key=h.C0.GS)}return x}},482:(m,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.Utf8ToUtf32=c.StringToUtf32=c.utf32ToString=c.stringFromCodePoint=void 0,c.stringFromCodePoint=function(u){return u>65535?(u-=65536,String.fromCharCode(55296+(u>>10))+String.fromCharCode(u%1024+56320)):String.fromCharCode(u)},c.utf32ToString=function(u,h=0,b=u.length){let p="";for(let C=h;C<b;++C){let w=u[C];w>65535?(w-=65536,p+=String.fromCharCode(55296+(w>>10))+String.fromCharCode(w%1024+56320)):p+=String.fromCharCode(w)}return p},c.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(u,h){const b=u.length;if(!b)return 0;let p=0,C=0;if(this._interim){const w=u.charCodeAt(C++);56320<=w&&w<=57343?h[p++]=1024*(this._interim-55296)+w-56320+65536:(h[p++]=this._interim,h[p++]=w),this._interim=0}for(let w=C;w<b;++w){const A=u.charCodeAt(w);if(55296<=A&&A<=56319){if(++w>=b)return this._interim=A,p;const x=u.charCodeAt(w);56320<=x&&x<=57343?h[p++]=1024*(A-55296)+x-56320+65536:(h[p++]=A,h[p++]=x)}else A!==65279&&(h[p++]=A)}return p}},c.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(u,h){const b=u.length;if(!b)return 0;let p,C,w,A,x=0,g=0,y=0;if(this.interim[0]){let E=!1,L=this.interim[0];L&=(224&L)==192?31:(240&L)==224?15:7;let R,D=0;for(;(R=63&this.interim[++D])&&D<4;)L<<=6,L|=R;const k=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,N=k-D;for(;y<N;){if(y>=b)return 0;if(R=u[y++],(192&R)!=128){y--,E=!0;break}this.interim[D++]=R,L<<=6,L|=63&R}E||(k===2?L<128?y--:h[x++]=L:k===3?L<2048||L>=55296&&L<=57343||L===65279||(h[x++]=L):L<65536||L>1114111||(h[x++]=L)),this.interim.fill(0)}const f=b-4;let _=y;for(;_<b;){for(;!(!(_<f)||128&(p=u[_])||128&(C=u[_+1])||128&(w=u[_+2])||128&(A=u[_+3]));)h[x++]=p,h[x++]=C,h[x++]=w,h[x++]=A,_+=4;if(p=u[_++],p<128)h[x++]=p;else if((224&p)==192){if(_>=b)return this.interim[0]=p,x;if(C=u[_++],(192&C)!=128){_--;continue}if(g=(31&p)<<6|63&C,g<128){_--;continue}h[x++]=g}else if((240&p)==224){if(_>=b)return this.interim[0]=p,x;if(C=u[_++],(192&C)!=128){_--;continue}if(_>=b)return this.interim[0]=p,this.interim[1]=C,x;if(w=u[_++],(192&w)!=128){_--;continue}if(g=(15&p)<<12|(63&C)<<6|63&w,g<2048||g>=55296&&g<=57343||g===65279)continue;h[x++]=g}else if((248&p)==240){if(_>=b)return this.interim[0]=p,x;if(C=u[_++],(192&C)!=128){_--;continue}if(_>=b)return this.interim[0]=p,this.interim[1]=C,x;if(w=u[_++],(192&w)!=128){_--;continue}if(_>=b)return this.interim[0]=p,this.interim[1]=C,this.interim[2]=w,x;if(A=u[_++],(192&A)!=128){_--;continue}if(g=(7&p)<<18|(63&C)<<12|(63&w)<<6|63&A,g<65536||g>1114111)continue;h[x++]=g}}return x}}},225:(m,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.UnicodeV6=void 0;const h=u(1480),b=[[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]],p=[[68097,68099],[68101,68102],[68108,68111],[68152,68154],[68159,68159],[119143,119145],[119155,119170],[119173,119179],[119210,119213],[119362,119364],[917505,917505],[917536,917631],[917760,917999]];let C;c.UnicodeV6=class{constructor(){if(this.version="6",!C){C=new Uint8Array(65536),C.fill(1),C[0]=0,C.fill(0,1,32),C.fill(0,127,160),C.fill(2,4352,4448),C[9001]=2,C[9002]=2,C.fill(2,11904,42192),C[12351]=1,C.fill(2,44032,55204),C.fill(2,63744,64256),C.fill(2,65040,65050),C.fill(2,65072,65136),C.fill(2,65280,65377),C.fill(2,65504,65511);for(let w=0;w<b.length;++w)C.fill(0,b[w][0],b[w][1]+1)}}wcwidth(w){return w<32?0:w<127?1:w<65536?C[w]:(function(A,x){let g,y=0,f=x.length-1;if(A<x[0][0]||A>x[f][1])return!1;for(;f>=y;)if(g=y+f>>1,A>x[g][1])y=g+1;else{if(!(A<x[g][0]))return!0;f=g-1}return!1})(w,p)?0:w>=131072&&w<=196605||w>=196608&&w<=262141?2:1}charProperties(w,A){let x=this.wcwidth(w),g=x===0&&A!==0;if(g){const y=h.UnicodeService.extractWidth(A);y===0?g=!1:y>x&&(x=y)}return h.UnicodeService.createPropertyValue(0,x,g)}}},5981:(m,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.WriteBuffer=void 0;const h=u(8460),b=u(844);class p extends b.Disposable{constructor(w){super(),this._action=w,this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=0,this._isSyncWriting=!1,this._syncCalls=0,this._didUserInput=!1,this._onWriteParsed=this.register(new h.EventEmitter),this.onWriteParsed=this._onWriteParsed.event}handleUserInput(){this._didUserInput=!0}writeSync(w,A){if(A!==void 0&&this._syncCalls>A)return void(this._syncCalls=0);if(this._pendingData+=w.length,this._writeBuffer.push(w),this._callbacks.push(void 0),this._syncCalls++,this._isSyncWriting)return;let x;for(this._isSyncWriting=!0;x=this._writeBuffer.shift();){this._action(x);const g=this._callbacks.shift();g&&g()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(w,A){if(this._pendingData>5e7)throw new Error("write data discarded, use flow control to avoid losing data");if(!this._writeBuffer.length){if(this._bufferOffset=0,this._didUserInput)return this._didUserInput=!1,this._pendingData+=w.length,this._writeBuffer.push(w),this._callbacks.push(A),void this._innerWrite();setTimeout((()=>this._innerWrite()))}this._pendingData+=w.length,this._writeBuffer.push(w),this._callbacks.push(A)}_innerWrite(w=0,A=!0){const x=w||Date.now();for(;this._writeBuffer.length>this._bufferOffset;){const g=this._writeBuffer[this._bufferOffset],y=this._action(g,A);if(y){const _=E=>Date.now()-x>=12?setTimeout((()=>this._innerWrite(0,E))):this._innerWrite(x,E);return void y.catch((E=>(queueMicrotask((()=>{throw E})),Promise.resolve(!1)))).then(_)}const f=this._callbacks[this._bufferOffset];if(f&&f(),this._bufferOffset++,this._pendingData-=g.length,Date.now()-x>=12)break}this._writeBuffer.length>this._bufferOffset?(this._bufferOffset>50&&(this._writeBuffer=this._writeBuffer.slice(this._bufferOffset),this._callbacks=this._callbacks.slice(this._bufferOffset),this._bufferOffset=0),setTimeout((()=>this._innerWrite()))):(this._writeBuffer.length=0,this._callbacks.length=0,this._pendingData=0,this._bufferOffset=0),this._onWriteParsed.fire()}}c.WriteBuffer=p},5941:(m,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.toRgbString=c.parseColor=void 0;const u=/^([\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})$/,h=/^[\da-f]+$/;function b(p,C){const w=p.toString(16),A=w.length<2?"0"+w:w;switch(C){case 4:return w[0];case 8:return A;case 12:return(A+A).slice(0,3);default:return A+A}}c.parseColor=function(p){if(!p)return;let C=p.toLowerCase();if(C.indexOf("rgb:")===0){C=C.slice(4);const w=u.exec(C);if(w){const A=w[1]?15:w[4]?255:w[7]?4095:65535;return[Math.round(parseInt(w[1]||w[4]||w[7]||w[10],16)/A*255),Math.round(parseInt(w[2]||w[5]||w[8]||w[11],16)/A*255),Math.round(parseInt(w[3]||w[6]||w[9]||w[12],16)/A*255)]}}else if(C.indexOf("#")===0&&(C=C.slice(1),h.exec(C)&&[3,6,9,12].includes(C.length))){const w=C.length/3,A=[0,0,0];for(let x=0;x<3;++x){const g=parseInt(C.slice(w*x,w*x+w),16);A[x]=w===1?g<<4:w===2?g:w===3?g>>4:g>>8}return A}},c.toRgbString=function(p,C=16){const[w,A,x]=p;return`rgb:${b(w,C)}/${b(A,C)}/${b(x,C)}`}},5770:(m,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.PAYLOAD_LIMIT=void 0,c.PAYLOAD_LIMIT=1e7},6351:(m,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.DcsHandler=c.DcsParser=void 0;const h=u(482),b=u(8742),p=u(5770),C=[];c.DcsParser=class{constructor(){this._handlers=Object.create(null),this._active=C,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=C}registerHandler(A,x){this._handlers[A]===void 0&&(this._handlers[A]=[]);const g=this._handlers[A];return g.push(x),{dispose:()=>{const y=g.indexOf(x);y!==-1&&g.splice(y,1)}}}clearHandler(A){this._handlers[A]&&delete this._handlers[A]}setHandlerFallback(A){this._handlerFb=A}reset(){if(this._active.length)for(let A=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;A>=0;--A)this._active[A].unhook(!1);this._stack.paused=!1,this._active=C,this._ident=0}hook(A,x){if(this.reset(),this._ident=A,this._active=this._handlers[A]||C,this._active.length)for(let g=this._active.length-1;g>=0;g--)this._active[g].hook(x);else this._handlerFb(this._ident,"HOOK",x)}put(A,x,g){if(this._active.length)for(let y=this._active.length-1;y>=0;y--)this._active[y].put(A,x,g);else this._handlerFb(this._ident,"PUT",(0,h.utf32ToString)(A,x,g))}unhook(A,x=!0){if(this._active.length){let g=!1,y=this._active.length-1,f=!1;if(this._stack.paused&&(y=this._stack.loopPosition-1,g=x,f=this._stack.fallThrough,this._stack.paused=!1),!f&&g===!1){for(;y>=0&&(g=this._active[y].unhook(A),g!==!0);y--)if(g instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=y,this._stack.fallThrough=!1,g;y--}for(;y>=0;y--)if(g=this._active[y].unhook(!1),g instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=y,this._stack.fallThrough=!0,g}else this._handlerFb(this._ident,"UNHOOK",A);this._active=C,this._ident=0}};const w=new b.Params;w.addParam(0),c.DcsHandler=class{constructor(A){this._handler=A,this._data="",this._params=w,this._hitLimit=!1}hook(A){this._params=A.length>1||A.params[0]?A.clone():w,this._data="",this._hitLimit=!1}put(A,x,g){this._hitLimit||(this._data+=(0,h.utf32ToString)(A,x,g),this._data.length>p.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}unhook(A){let x=!1;if(this._hitLimit)x=!1;else if(A&&(x=this._handler(this._data,this._params),x instanceof Promise))return x.then((g=>(this._params=w,this._data="",this._hitLimit=!1,g)));return this._params=w,this._data="",this._hitLimit=!1,x}}},2015:(m,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.EscapeSequenceParser=c.VT500_TRANSITION_TABLE=c.TransitionTable=void 0;const h=u(844),b=u(8742),p=u(6242),C=u(6351);class w{constructor(y){this.table=new Uint8Array(y)}setDefault(y,f){this.table.fill(y<<4|f)}add(y,f,_,E){this.table[f<<8|y]=_<<4|E}addMany(y,f,_,E){for(let L=0;L<y.length;L++)this.table[f<<8|y[L]]=_<<4|E}}c.TransitionTable=w;const A=160;c.VT500_TRANSITION_TABLE=(function(){const g=new w(4095),y=Array.apply(null,Array(256)).map(((D,k)=>k)),f=(D,k)=>y.slice(D,k),_=f(32,127),E=f(0,24);E.push(25),E.push.apply(E,f(28,32));const L=f(0,14);let R;for(R in g.setDefault(1,0),g.addMany(_,0,2,0),L)g.addMany([24,26,153,154],R,3,0),g.addMany(f(128,144),R,3,0),g.addMany(f(144,152),R,3,0),g.add(156,R,0,0),g.add(27,R,11,1),g.add(157,R,4,8),g.addMany([152,158,159],R,0,7),g.add(155,R,11,3),g.add(144,R,11,9);return g.addMany(E,0,3,0),g.addMany(E,1,3,1),g.add(127,1,0,1),g.addMany(E,8,0,8),g.addMany(E,3,3,3),g.add(127,3,0,3),g.addMany(E,4,3,4),g.add(127,4,0,4),g.addMany(E,6,3,6),g.addMany(E,5,3,5),g.add(127,5,0,5),g.addMany(E,2,3,2),g.add(127,2,0,2),g.add(93,1,4,8),g.addMany(_,8,5,8),g.add(127,8,5,8),g.addMany([156,27,24,26,7],8,6,0),g.addMany(f(28,32),8,0,8),g.addMany([88,94,95],1,0,7),g.addMany(_,7,0,7),g.addMany(E,7,0,7),g.add(156,7,0,0),g.add(127,7,0,7),g.add(91,1,11,3),g.addMany(f(64,127),3,7,0),g.addMany(f(48,60),3,8,4),g.addMany([60,61,62,63],3,9,4),g.addMany(f(48,60),4,8,4),g.addMany(f(64,127),4,7,0),g.addMany([60,61,62,63],4,0,6),g.addMany(f(32,64),6,0,6),g.add(127,6,0,6),g.addMany(f(64,127),6,0,0),g.addMany(f(32,48),3,9,5),g.addMany(f(32,48),5,9,5),g.addMany(f(48,64),5,0,6),g.addMany(f(64,127),5,7,0),g.addMany(f(32,48),4,9,5),g.addMany(f(32,48),1,9,2),g.addMany(f(32,48),2,9,2),g.addMany(f(48,127),2,10,0),g.addMany(f(48,80),1,10,0),g.addMany(f(81,88),1,10,0),g.addMany([89,90,92],1,10,0),g.addMany(f(96,127),1,10,0),g.add(80,1,11,9),g.addMany(E,9,0,9),g.add(127,9,0,9),g.addMany(f(28,32),9,0,9),g.addMany(f(32,48),9,9,12),g.addMany(f(48,60),9,8,10),g.addMany([60,61,62,63],9,9,10),g.addMany(E,11,0,11),g.addMany(f(32,128),11,0,11),g.addMany(f(28,32),11,0,11),g.addMany(E,10,0,10),g.add(127,10,0,10),g.addMany(f(28,32),10,0,10),g.addMany(f(48,60),10,8,10),g.addMany([60,61,62,63],10,0,11),g.addMany(f(32,48),10,9,12),g.addMany(E,12,0,12),g.add(127,12,0,12),g.addMany(f(28,32),12,0,12),g.addMany(f(32,48),12,9,12),g.addMany(f(48,64),12,0,11),g.addMany(f(64,127),12,12,13),g.addMany(f(64,127),10,12,13),g.addMany(f(64,127),9,12,13),g.addMany(E,13,13,13),g.addMany(_,13,13,13),g.add(127,13,0,13),g.addMany([27,156,24,26],13,14,0),g.add(A,0,2,0),g.add(A,8,5,8),g.add(A,6,0,6),g.add(A,11,0,11),g.add(A,13,13,13),g})();class x extends h.Disposable{constructor(y=c.VT500_TRANSITION_TABLE){super(),this._transitions=y,this._parseStack={state:0,handlers:[],handlerPos:0,transition:0,chunkPos:0},this.initialState=0,this.currentState=this.initialState,this._params=new b.Params,this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._printHandlerFb=(f,_,E)=>{},this._executeHandlerFb=f=>{},this._csiHandlerFb=(f,_)=>{},this._escHandlerFb=f=>{},this._errorHandlerFb=f=>f,this._printHandler=this._printHandlerFb,this._executeHandlers=Object.create(null),this._csiHandlers=Object.create(null),this._escHandlers=Object.create(null),this.register((0,h.toDisposable)((()=>{this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null)}))),this._oscParser=this.register(new p.OscParser),this._dcsParser=this.register(new C.DcsParser),this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:"\\"},(()=>!0))}_identifier(y,f=[64,126]){let _=0;if(y.prefix){if(y.prefix.length>1)throw new Error("only one byte as prefix supported");if(_=y.prefix.charCodeAt(0),_&&60>_||_>63)throw new Error("prefix must be in range 0x3c .. 0x3f")}if(y.intermediates){if(y.intermediates.length>2)throw new Error("only two bytes as intermediates are supported");for(let L=0;L<y.intermediates.length;++L){const R=y.intermediates.charCodeAt(L);if(32>R||R>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");_<<=8,_|=R}}if(y.final.length!==1)throw new Error("final must be a single byte");const E=y.final.charCodeAt(0);if(f[0]>E||E>f[1])throw new Error(`final must be in range ${f[0]} .. ${f[1]}`);return _<<=8,_|=E,_}identToString(y){const f=[];for(;y;)f.push(String.fromCharCode(255&y)),y>>=8;return f.reverse().join("")}setPrintHandler(y){this._printHandler=y}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(y,f){const _=this._identifier(y,[48,126]);this._escHandlers[_]===void 0&&(this._escHandlers[_]=[]);const E=this._escHandlers[_];return E.push(f),{dispose:()=>{const L=E.indexOf(f);L!==-1&&E.splice(L,1)}}}clearEscHandler(y){this._escHandlers[this._identifier(y,[48,126])]&&delete this._escHandlers[this._identifier(y,[48,126])]}setEscHandlerFallback(y){this._escHandlerFb=y}setExecuteHandler(y,f){this._executeHandlers[y.charCodeAt(0)]=f}clearExecuteHandler(y){this._executeHandlers[y.charCodeAt(0)]&&delete this._executeHandlers[y.charCodeAt(0)]}setExecuteHandlerFallback(y){this._executeHandlerFb=y}registerCsiHandler(y,f){const _=this._identifier(y);this._csiHandlers[_]===void 0&&(this._csiHandlers[_]=[]);const E=this._csiHandlers[_];return E.push(f),{dispose:()=>{const L=E.indexOf(f);L!==-1&&E.splice(L,1)}}}clearCsiHandler(y){this._csiHandlers[this._identifier(y)]&&delete this._csiHandlers[this._identifier(y)]}setCsiHandlerFallback(y){this._csiHandlerFb=y}registerDcsHandler(y,f){return this._dcsParser.registerHandler(this._identifier(y),f)}clearDcsHandler(y){this._dcsParser.clearHandler(this._identifier(y))}setDcsHandlerFallback(y){this._dcsParser.setHandlerFallback(y)}registerOscHandler(y,f){return this._oscParser.registerHandler(y,f)}clearOscHandler(y){this._oscParser.clearHandler(y)}setOscHandlerFallback(y){this._oscParser.setHandlerFallback(y)}setErrorHandler(y){this._errorHandler=y}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(y,f,_,E,L){this._parseStack.state=y,this._parseStack.handlers=f,this._parseStack.handlerPos=_,this._parseStack.transition=E,this._parseStack.chunkPos=L}parse(y,f,_){let E,L=0,R=0,D=0;if(this._parseStack.state)if(this._parseStack.state===2)this._parseStack.state=0,D=this._parseStack.chunkPos+1;else{if(_===void 0||this._parseStack.state===1)throw this._parseStack.state=1,new Error("improper continuation due to previous async handler, giving up parsing");const k=this._parseStack.handlers;let N=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(_===!1&&N>-1){for(;N>=0&&(E=k[N](this._params),E!==!0);N--)if(E instanceof Promise)return this._parseStack.handlerPos=N,E}this._parseStack.handlers=[];break;case 4:if(_===!1&&N>-1){for(;N>=0&&(E=k[N](),E!==!0);N--)if(E instanceof Promise)return this._parseStack.handlerPos=N,E}this._parseStack.handlers=[];break;case 6:if(L=y[this._parseStack.chunkPos],E=this._dcsParser.unhook(L!==24&&L!==26,_),E)return E;L===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(L=y[this._parseStack.chunkPos],E=this._oscParser.end(L!==24&&L!==26,_),E)return E;L===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0}this._parseStack.state=0,D=this._parseStack.chunkPos+1,this.precedingJoinState=0,this.currentState=15&this._parseStack.transition}for(let k=D;k<f;++k){switch(L=y[k],R=this._transitions.table[this.currentState<<8|(L<160?L:A)],R>>4){case 2:for(let j=k+1;;++j){if(j>=f||(L=y[j])<32||L>126&&L<A){this._printHandler(y,k,j),k=j-1;break}if(++j>=f||(L=y[j])<32||L>126&&L<A){this._printHandler(y,k,j),k=j-1;break}if(++j>=f||(L=y[j])<32||L>126&&L<A){this._printHandler(y,k,j),k=j-1;break}if(++j>=f||(L=y[j])<32||L>126&&L<A){this._printHandler(y,k,j),k=j-1;break}}break;case 3:this._executeHandlers[L]?this._executeHandlers[L]():this._executeHandlerFb(L),this.precedingJoinState=0;break;case 0:break;case 1:if(this._errorHandler({position:k,code:L,currentState:this.currentState,collect:this._collect,params:this._params,abort:!1}).abort)return;break;case 7:const N=this._csiHandlers[this._collect<<8|L];let W=N?N.length-1:-1;for(;W>=0&&(E=N[W](this._params),E!==!0);W--)if(E instanceof Promise)return this._preserveStack(3,N,W,R,k),E;W<0&&this._csiHandlerFb(this._collect<<8|L,this._params),this.precedingJoinState=0;break;case 8:do switch(L){case 59:this._params.addParam(0);break;case 58:this._params.addSubParam(-1);break;default:this._params.addDigit(L-48)}while(++k<f&&(L=y[k])>47&&L<60);k--;break;case 9:this._collect<<=8,this._collect|=L;break;case 10:const U=this._escHandlers[this._collect<<8|L];let F=U?U.length-1:-1;for(;F>=0&&(E=U[F](),E!==!0);F--)if(E instanceof Promise)return this._preserveStack(4,U,F,R,k),E;F<0&&this._escHandlerFb(this._collect<<8|L),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|L,this._params);break;case 13:for(let j=k+1;;++j)if(j>=f||(L=y[j])===24||L===26||L===27||L>127&&L<A){this._dcsParser.put(y,k,j),k=j-1;break}break;case 14:if(E=this._dcsParser.unhook(L!==24&&L!==26),E)return this._preserveStack(6,[],0,R,k),E;L===27&&(R|=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 j=k+1;;j++)if(j>=f||(L=y[j])<32||L>127&&L<A){this._oscParser.put(y,k,j),k=j-1;break}break;case 6:if(E=this._oscParser.end(L!==24&&L!==26),E)return this._preserveStack(5,[],0,R,k),E;L===27&&(R|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0}this.currentState=15&R}}}c.EscapeSequenceParser=x},6242:(m,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.OscHandler=c.OscParser=void 0;const h=u(5770),b=u(482),p=[];c.OscParser=class{constructor(){this._state=0,this._active=p,this._id=-1,this._handlers=Object.create(null),this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}registerHandler(C,w){this._handlers[C]===void 0&&(this._handlers[C]=[]);const A=this._handlers[C];return A.push(w),{dispose:()=>{const x=A.indexOf(w);x!==-1&&A.splice(x,1)}}}clearHandler(C){this._handlers[C]&&delete this._handlers[C]}setHandlerFallback(C){this._handlerFb=C}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=p}reset(){if(this._state===2)for(let C=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;C>=0;--C)this._active[C].end(!1);this._stack.paused=!1,this._active=p,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||p,this._active.length)for(let C=this._active.length-1;C>=0;C--)this._active[C].start();else this._handlerFb(this._id,"START")}_put(C,w,A){if(this._active.length)for(let x=this._active.length-1;x>=0;x--)this._active[x].put(C,w,A);else this._handlerFb(this._id,"PUT",(0,b.utf32ToString)(C,w,A))}start(){this.reset(),this._state=1}put(C,w,A){if(this._state!==3){if(this._state===1)for(;w<A;){const x=C[w++];if(x===59){this._state=2,this._start();break}if(x<48||57<x)return void(this._state=3);this._id===-1&&(this._id=0),this._id=10*this._id+x-48}this._state===2&&A-w>0&&this._put(C,w,A)}}end(C,w=!0){if(this._state!==0){if(this._state!==3)if(this._state===1&&this._start(),this._active.length){let A=!1,x=this._active.length-1,g=!1;if(this._stack.paused&&(x=this._stack.loopPosition-1,A=w,g=this._stack.fallThrough,this._stack.paused=!1),!g&&A===!1){for(;x>=0&&(A=this._active[x].end(C),A!==!0);x--)if(A instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=x,this._stack.fallThrough=!1,A;x--}for(;x>=0;x--)if(A=this._active[x].end(!1),A instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=x,this._stack.fallThrough=!0,A}else this._handlerFb(this._id,"END",C);this._active=p,this._id=-1,this._state=0}}},c.OscHandler=class{constructor(C){this._handler=C,this._data="",this._hitLimit=!1}start(){this._data="",this._hitLimit=!1}put(C,w,A){this._hitLimit||(this._data+=(0,b.utf32ToString)(C,w,A),this._data.length>h.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}end(C){let w=!1;if(this._hitLimit)w=!1;else if(C&&(w=this._handler(this._data),w instanceof Promise))return w.then((A=>(this._data="",this._hitLimit=!1,A)));return this._data="",this._hitLimit=!1,w}}},8742:(m,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.Params=void 0;const u=2147483647;class h{static fromArray(p){const C=new h;if(!p.length)return C;for(let w=Array.isArray(p[0])?1:0;w<p.length;++w){const A=p[w];if(Array.isArray(A))for(let x=0;x<A.length;++x)C.addSubParam(A[x]);else C.addParam(A)}return C}constructor(p=32,C=32){if(this.maxLength=p,this.maxSubParamsLength=C,C>256)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(p),this.length=0,this._subParams=new Int32Array(C),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(p),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}clone(){const p=new h(this.maxLength,this.maxSubParamsLength);return p.params.set(this.params),p.length=this.length,p._subParams.set(this._subParams),p._subParamsLength=this._subParamsLength,p._subParamsIdx.set(this._subParamsIdx),p._rejectDigits=this._rejectDigits,p._rejectSubDigits=this._rejectSubDigits,p._digitIsSub=this._digitIsSub,p}toArray(){const p=[];for(let C=0;C<this.length;++C){p.push(this.params[C]);const w=this._subParamsIdx[C]>>8,A=255&this._subParamsIdx[C];A-w>0&&p.push(Array.prototype.slice.call(this._subParams,w,A))}return p}reset(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}addParam(p){if(this._digitIsSub=!1,this.length>=this.maxLength)this._rejectDigits=!0;else{if(p<-1)throw new Error("values lesser than -1 are not allowed");this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=p>u?u:p}}addSubParam(p){if(this._digitIsSub=!0,this.length)if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength)this._rejectSubDigits=!0;else{if(p<-1)throw new Error("values lesser than -1 are not allowed");this._subParams[this._subParamsLength++]=p>u?u:p,this._subParamsIdx[this.length-1]++}}hasSubParams(p){return(255&this._subParamsIdx[p])-(this._subParamsIdx[p]>>8)>0}getSubParams(p){const C=this._subParamsIdx[p]>>8,w=255&this._subParamsIdx[p];return w-C>0?this._subParams.subarray(C,w):null}getSubParamsAll(){const p={};for(let C=0;C<this.length;++C){const w=this._subParamsIdx[C]>>8,A=255&this._subParamsIdx[C];A-w>0&&(p[C]=this._subParams.slice(w,A))}return p}addDigit(p){let C;if(this._rejectDigits||!(C=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;const w=this._digitIsSub?this._subParams:this.params,A=w[C-1];w[C-1]=~A?Math.min(10*A+p,u):p}}c.Params=h},5741:(m,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.AddonManager=void 0,c.AddonManager=class{constructor(){this._addons=[]}dispose(){for(let u=this._addons.length-1;u>=0;u--)this._addons[u].instance.dispose()}loadAddon(u,h){const b={instance:h,dispose:h.dispose,isDisposed:!1};this._addons.push(b),h.dispose=()=>this._wrappedAddonDispose(b),h.activate(u)}_wrappedAddonDispose(u){if(u.isDisposed)return;let h=-1;for(let b=0;b<this._addons.length;b++)if(this._addons[b]===u){h=b;break}if(h===-1)throw new Error("Could not dispose an addon that has not been loaded");u.isDisposed=!0,u.dispose.apply(u.instance),this._addons.splice(h,1)}}},8771:(m,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.BufferApiView=void 0;const h=u(3785),b=u(511);c.BufferApiView=class{constructor(p,C){this._buffer=p,this.type=C}init(p){return this._buffer=p,this}get cursorY(){return this._buffer.y}get cursorX(){return this._buffer.x}get viewportY(){return this._buffer.ydisp}get baseY(){return this._buffer.ybase}get length(){return this._buffer.lines.length}getLine(p){const C=this._buffer.lines.get(p);if(C)return new h.BufferLineApiView(C)}getNullCell(){return new b.CellData}}},3785:(m,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.BufferLineApiView=void 0;const h=u(511);c.BufferLineApiView=class{constructor(b){this._line=b}get isWrapped(){return this._line.isWrapped}get length(){return this._line.length}getCell(b,p){if(!(b<0||b>=this._line.length))return p?(this._line.loadCell(b,p),p):this._line.loadCell(b,new h.CellData)}translateToString(b,p,C){return this._line.translateToString(b,p,C)}}},8285:(m,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.BufferNamespaceApi=void 0;const h=u(8771),b=u(8460),p=u(844);class C extends p.Disposable{constructor(A){super(),this._core=A,this._onBufferChange=this.register(new b.EventEmitter),this.onBufferChange=this._onBufferChange.event,this._normal=new h.BufferApiView(this._core.buffers.normal,"normal"),this._alternate=new h.BufferApiView(this._core.buffers.alt,"alternate"),this._core.buffers.onBufferActivate((()=>this._onBufferChange.fire(this.active)))}get active(){if(this._core.buffers.active===this._core.buffers.normal)return this.normal;if(this._core.buffers.active===this._core.buffers.alt)return this.alternate;throw new Error("Active buffer is neither normal nor alternate")}get normal(){return this._normal.init(this._core.buffers.normal)}get alternate(){return this._alternate.init(this._core.buffers.alt)}}c.BufferNamespaceApi=C},7975:(m,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.ParserApi=void 0,c.ParserApi=class{constructor(u){this._core=u}registerCsiHandler(u,h){return this._core.registerCsiHandler(u,(b=>h(b.toArray())))}addCsiHandler(u,h){return this.registerCsiHandler(u,h)}registerDcsHandler(u,h){return this._core.registerDcsHandler(u,((b,p)=>h(b,p.toArray())))}addDcsHandler(u,h){return this.registerDcsHandler(u,h)}registerEscHandler(u,h){return this._core.registerEscHandler(u,h)}addEscHandler(u,h){return this.registerEscHandler(u,h)}registerOscHandler(u,h){return this._core.registerOscHandler(u,h)}addOscHandler(u,h){return this.registerOscHandler(u,h)}}},7090:(m,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.UnicodeApi=void 0,c.UnicodeApi=class{constructor(u){this._core=u}register(u){this._core.unicodeService.register(u)}get versions(){return this._core.unicodeService.versions}get activeVersion(){return this._core.unicodeService.activeVersion}set activeVersion(u){this._core.unicodeService.activeVersion=u}}},744:function(m,c,u){var h=this&&this.__decorate||function(g,y,f,_){var E,L=arguments.length,R=L<3?y:_===null?_=Object.getOwnPropertyDescriptor(y,f):_;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")R=Reflect.decorate(g,y,f,_);else for(var D=g.length-1;D>=0;D--)(E=g[D])&&(R=(L<3?E(R):L>3?E(y,f,R):E(y,f))||R);return L>3&&R&&Object.defineProperty(y,f,R),R},b=this&&this.__param||function(g,y){return function(f,_){y(f,_,g)}};Object.defineProperty(c,"__esModule",{value:!0}),c.BufferService=c.MINIMUM_ROWS=c.MINIMUM_COLS=void 0;const p=u(8460),C=u(844),w=u(5295),A=u(2585);c.MINIMUM_COLS=2,c.MINIMUM_ROWS=1;let x=c.BufferService=class extends C.Disposable{get buffer(){return this.buffers.active}constructor(g){super(),this.isUserScrolling=!1,this._onResize=this.register(new p.EventEmitter),this.onResize=this._onResize.event,this._onScroll=this.register(new p.EventEmitter),this.onScroll=this._onScroll.event,this.cols=Math.max(g.rawOptions.cols||0,c.MINIMUM_COLS),this.rows=Math.max(g.rawOptions.rows||0,c.MINIMUM_ROWS),this.buffers=this.register(new w.BufferSet(g,this))}resize(g,y){this.cols=g,this.rows=y,this.buffers.resize(g,y),this._onResize.fire({cols:g,rows:y})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(g,y=!1){const f=this.buffer;let _;_=this._cachedBlankLine,_&&_.length===this.cols&&_.getFg(0)===g.fg&&_.getBg(0)===g.bg||(_=f.getBlankLine(g,y),this._cachedBlankLine=_),_.isWrapped=y;const E=f.ybase+f.scrollTop,L=f.ybase+f.scrollBottom;if(f.scrollTop===0){const R=f.lines.isFull;L===f.lines.length-1?R?f.lines.recycle().copyFrom(_):f.lines.push(_.clone()):f.lines.splice(L+1,0,_.clone()),R?this.isUserScrolling&&(f.ydisp=Math.max(f.ydisp-1,0)):(f.ybase++,this.isUserScrolling||f.ydisp++)}else{const R=L-E+1;f.lines.shiftElements(E+1,R-1,-1),f.lines.set(L,_.clone())}this.isUserScrolling||(f.ydisp=f.ybase),this._onScroll.fire(f.ydisp)}scrollLines(g,y,f){const _=this.buffer;if(g<0){if(_.ydisp===0)return;this.isUserScrolling=!0}else g+_.ydisp>=_.ybase&&(this.isUserScrolling=!1);const E=_.ydisp;_.ydisp=Math.max(Math.min(_.ydisp+g,_.ybase),0),E!==_.ydisp&&(y||this._onScroll.fire(_.ydisp))}};c.BufferService=x=h([b(0,A.IOptionsService)],x)},7994:(m,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.CharsetService=void 0,c.CharsetService=class{constructor(){this.glevel=0,this._charsets=[]}reset(){this.charset=void 0,this._charsets=[],this.glevel=0}setgLevel(u){this.glevel=u,this.charset=this._charsets[u]}setgCharset(u,h){this._charsets[u]=h,this.glevel===u&&(this.charset=h)}}},1753:function(m,c,u){var h=this&&this.__decorate||function(_,E,L,R){var D,k=arguments.length,N=k<3?E:R===null?R=Object.getOwnPropertyDescriptor(E,L):R;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")N=Reflect.decorate(_,E,L,R);else for(var W=_.length-1;W>=0;W--)(D=_[W])&&(N=(k<3?D(N):k>3?D(E,L,N):D(E,L))||N);return k>3&&N&&Object.defineProperty(E,L,N),N},b=this&&this.__param||function(_,E){return function(L,R){E(L,R,_)}};Object.defineProperty(c,"__esModule",{value:!0}),c.CoreMouseService=void 0;const p=u(2585),C=u(8460),w=u(844),A={NONE:{events:0,restrict:()=>!1},X10:{events:1,restrict:_=>_.button!==4&&_.action===1&&(_.ctrl=!1,_.alt=!1,_.shift=!1,!0)},VT200:{events:19,restrict:_=>_.action!==32},DRAG:{events:23,restrict:_=>_.action!==32||_.button!==3},ANY:{events:31,restrict:_=>!0}};function x(_,E){let L=(_.ctrl?16:0)|(_.shift?4:0)|(_.alt?8:0);return _.button===4?(L|=64,L|=_.action):(L|=3&_.button,4&_.button&&(L|=64),8&_.button&&(L|=128),_.action===32?L|=32:_.action!==0||E||(L|=3)),L}const g=String.fromCharCode,y={DEFAULT:_=>{const E=[x(_,!1)+32,_.col+32,_.row+32];return E[0]>255||E[1]>255||E[2]>255?"":`\x1B[M${g(E[0])}${g(E[1])}${g(E[2])}`},SGR:_=>{const E=_.action===0&&_.button!==4?"m":"M";return`\x1B[<${x(_,!0)};${_.col};${_.row}${E}`},SGR_PIXELS:_=>{const E=_.action===0&&_.button!==4?"m":"M";return`\x1B[<${x(_,!0)};${_.x};${_.y}${E}`}};let f=c.CoreMouseService=class extends w.Disposable{constructor(_,E){super(),this._bufferService=_,this._coreService=E,this._protocols={},this._encodings={},this._activeProtocol="",this._activeEncoding="",this._lastEvent=null,this._onProtocolChange=this.register(new C.EventEmitter),this.onProtocolChange=this._onProtocolChange.event;for(const L of Object.keys(A))this.addProtocol(L,A[L]);for(const L of Object.keys(y))this.addEncoding(L,y[L]);this.reset()}addProtocol(_,E){this._protocols[_]=E}addEncoding(_,E){this._encodings[_]=E}get activeProtocol(){return this._activeProtocol}get areMouseEventsActive(){return this._protocols[this._activeProtocol].events!==0}set activeProtocol(_){if(!this._protocols[_])throw new Error(`unknown protocol "${_}"`);this._activeProtocol=_,this._onProtocolChange.fire(this._protocols[_].events)}get activeEncoding(){return this._activeEncoding}set activeEncoding(_){if(!this._encodings[_])throw new Error(`unknown encoding "${_}"`);this._activeEncoding=_}reset(){this.activeProtocol="NONE",this.activeEncoding="DEFAULT",this._lastEvent=null}triggerMouseEvent(_){if(_.col<0||_.col>=this._bufferService.cols||_.row<0||_.row>=this._bufferService.rows||_.button===4&&_.action===32||_.button===3&&_.action!==32||_.button!==4&&(_.action===2||_.action===3)||(_.col++,_.row++,_.action===32&&this._lastEvent&&this._equalEvents(this._lastEvent,_,this._activeEncoding==="SGR_PIXELS"))||!this._protocols[this._activeProtocol].restrict(_))return!1;const E=this._encodings[this._activeEncoding](_);return E&&(this._activeEncoding==="DEFAULT"?this._coreService.triggerBinaryEvent(E):this._coreService.triggerDataEvent(E,!0)),this._lastEvent=_,!0}explainEvents(_){return{down:!!(1&_),up:!!(2&_),drag:!!(4&_),move:!!(8&_),wheel:!!(16&_)}}_equalEvents(_,E,L){if(L){if(_.x!==E.x||_.y!==E.y)return!1}else if(_.col!==E.col||_.row!==E.row)return!1;return _.button===E.button&&_.action===E.action&&_.ctrl===E.ctrl&&_.alt===E.alt&&_.shift===E.shift}};c.CoreMouseService=f=h([b(0,p.IBufferService),b(1,p.ICoreService)],f)},6975:function(m,c,u){var h=this&&this.__decorate||function(f,_,E,L){var R,D=arguments.length,k=D<3?_:L===null?L=Object.getOwnPropertyDescriptor(_,E):L;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")k=Reflect.decorate(f,_,E,L);else for(var N=f.length-1;N>=0;N--)(R=f[N])&&(k=(D<3?R(k):D>3?R(_,E,k):R(_,E))||k);return D>3&&k&&Object.defineProperty(_,E,k),k},b=this&&this.__param||function(f,_){return function(E,L){_(E,L,f)}};Object.defineProperty(c,"__esModule",{value:!0}),c.CoreService=void 0;const p=u(1439),C=u(8460),w=u(844),A=u(2585),x=Object.freeze({insertMode:!1}),g=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,origin:!1,reverseWraparound:!1,sendFocus:!1,wraparound:!0});let y=c.CoreService=class extends w.Disposable{constructor(f,_,E){super(),this._bufferService=f,this._logService=_,this._optionsService=E,this.isCursorInitialized=!1,this.isCursorHidden=!1,this._onData=this.register(new C.EventEmitter),this.onData=this._onData.event,this._onUserInput=this.register(new C.EventEmitter),this.onUserInput=this._onUserInput.event,this._onBinary=this.register(new C.EventEmitter),this.onBinary=this._onBinary.event,this._onRequestScrollToBottom=this.register(new C.EventEmitter),this.onRequestScrollToBottom=this._onRequestScrollToBottom.event,this.modes=(0,p.clone)(x),this.decPrivateModes=(0,p.clone)(g)}reset(){this.modes=(0,p.clone)(x),this.decPrivateModes=(0,p.clone)(g)}triggerDataEvent(f,_=!1){if(this._optionsService.rawOptions.disableStdin)return;const E=this._bufferService.buffer;_&&this._optionsService.rawOptions.scrollOnUserInput&&E.ybase!==E.ydisp&&this._onRequestScrollToBottom.fire(),_&&this._onUserInput.fire(),this._logService.debug(`sending data "${f}"`,(()=>f.split("").map((L=>L.charCodeAt(0))))),this._onData.fire(f)}triggerBinaryEvent(f){this._optionsService.rawOptions.disableStdin||(this._logService.debug(`sending binary "${f}"`,(()=>f.split("").map((_=>_.charCodeAt(0))))),this._onBinary.fire(f))}};c.CoreService=y=h([b(0,A.IBufferService),b(1,A.ILogService),b(2,A.IOptionsService)],y)},9074:(m,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.DecorationService=void 0;const h=u(8055),b=u(8460),p=u(844),C=u(6106);let w=0,A=0;class x extends p.Disposable{get decorations(){return this._decorations.values()}constructor(){super(),this._decorations=new C.SortedList((f=>f?.marker.line)),this._onDecorationRegistered=this.register(new b.EventEmitter),this.onDecorationRegistered=this._onDecorationRegistered.event,this._onDecorationRemoved=this.register(new b.EventEmitter),this.onDecorationRemoved=this._onDecorationRemoved.event,this.register((0,p.toDisposable)((()=>this.reset())))}registerDecoration(f){if(f.marker.isDisposed)return;const _=new g(f);if(_){const E=_.marker.onDispose((()=>_.dispose()));_.onDispose((()=>{_&&(this._decorations.delete(_)&&this._onDecorationRemoved.fire(_),E.dispose())})),this._decorations.insert(_),this._onDecorationRegistered.fire(_)}return _}reset(){for(const f of this._decorations.values())f.dispose();this._decorations.clear()}*getDecorationsAtCell(f,_,E){let L=0,R=0;for(const D of this._decorations.getKeyIterator(_))L=D.options.x??0,R=L+(D.options.width??1),f>=L&&f<R&&(!E||(D.options.layer??"bottom")===E)&&(yield D)}forEachDecorationAtCell(f,_,E,L){this._decorations.forEachByKey(_,(R=>{w=R.options.x??0,A=w+(R.options.width??1),f>=w&&f<A&&(!E||(R.options.layer??"bottom")===E)&&L(R)}))}}c.DecorationService=x;class g extends p.Disposable{get isDisposed(){return this._isDisposed}get backgroundColorRGB(){return this._cachedBg===null&&(this.options.backgroundColor?this._cachedBg=h.css.toColor(this.options.backgroundColor):this._cachedBg=void 0),this._cachedBg}get foregroundColorRGB(){return this._cachedFg===null&&(this.options.foregroundColor?this._cachedFg=h.css.toColor(this.options.foregroundColor):this._cachedFg=void 0),this._cachedFg}constructor(f){super(),this.options=f,this.onRenderEmitter=this.register(new b.EventEmitter),this.onRender=this.onRenderEmitter.event,this._onDispose=this.register(new b.EventEmitter),this.onDispose=this._onDispose.event,this._cachedBg=null,this._cachedFg=null,this.marker=f.marker,this.options.overviewRulerOptions&&!this.options.overviewRulerOptions.position&&(this.options.overviewRulerOptions.position="full")}dispose(){this._onDispose.fire(),super.dispose()}}},4348:(m,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.InstantiationService=c.ServiceCollection=void 0;const h=u(2585),b=u(8343);class p{constructor(...w){this._entries=new Map;for(const[A,x]of w)this.set(A,x)}set(w,A){const x=this._entries.get(w);return this._entries.set(w,A),x}forEach(w){for(const[A,x]of this._entries.entries())w(A,x)}has(w){return this._entries.has(w)}get(w){return this._entries.get(w)}}c.ServiceCollection=p,c.InstantiationService=class{constructor(){this._services=new p,this._services.set(h.IInstantiationService,this)}setService(C,w){this._services.set(C,w)}getService(C){return this._services.get(C)}createInstance(C,...w){const A=(0,b.getServiceDependencies)(C).sort(((y,f)=>y.index-f.index)),x=[];for(const y of A){const f=this._services.get(y.id);if(!f)throw new Error(`[createInstance] ${C.name} depends on UNKNOWN service ${y.id}.`);x.push(f)}const g=A.length>0?A[0].index:w.length;if(w.length!==g)throw new Error(`[createInstance] First service dependency of ${C.name} at position ${g+1} conflicts with ${w.length} static arguments`);return new C(...w,...x)}}},7866:function(m,c,u){var h=this&&this.__decorate||function(g,y,f,_){var E,L=arguments.length,R=L<3?y:_===null?_=Object.getOwnPropertyDescriptor(y,f):_;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")R=Reflect.decorate(g,y,f,_);else for(var D=g.length-1;D>=0;D--)(E=g[D])&&(R=(L<3?E(R):L>3?E(y,f,R):E(y,f))||R);return L>3&&R&&Object.defineProperty(y,f,R),R},b=this&&this.__param||function(g,y){return function(f,_){y(f,_,g)}};Object.defineProperty(c,"__esModule",{value:!0}),c.traceCall=c.setTraceLogger=c.LogService=void 0;const p=u(844),C=u(2585),w={trace:C.LogLevelEnum.TRACE,debug:C.LogLevelEnum.DEBUG,info:C.LogLevelEnum.INFO,warn:C.LogLevelEnum.WARN,error:C.LogLevelEnum.ERROR,off:C.LogLevelEnum.OFF};let A,x=c.LogService=class extends p.Disposable{get logLevel(){return this._logLevel}constructor(g){super(),this._optionsService=g,this._logLevel=C.LogLevelEnum.OFF,this._updateLogLevel(),this.register(this._optionsService.onSpecificOptionChange("logLevel",(()=>this._updateLogLevel()))),A=this}_updateLogLevel(){this._logLevel=w[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(g){for(let y=0;y<g.length;y++)typeof g[y]=="function"&&(g[y]=g[y]())}_log(g,y,f){this._evalLazyOptionalParams(f),g.call(console,(this._optionsService.options.logger?"":"xterm.js: ")+y,...f)}trace(g,...y){this._logLevel<=C.LogLevelEnum.TRACE&&this._log(this._optionsService.options.logger?.trace.bind(this._optionsService.options.logger)??console.log,g,y)}debug(g,...y){this._logLevel<=C.LogLevelEnum.DEBUG&&this._log(this._optionsService.options.logger?.debug.bind(this._optionsService.options.logger)??console.log,g,y)}info(g,...y){this._logLevel<=C.LogLevelEnum.INFO&&this._log(this._optionsService.options.logger?.info.bind(this._optionsService.options.logger)??console.info,g,y)}warn(g,...y){this._logLevel<=C.LogLevelEnum.WARN&&this._log(this._optionsService.options.logger?.warn.bind(this._optionsService.options.logger)??console.warn,g,y)}error(g,...y){this._logLevel<=C.LogLevelEnum.ERROR&&this._log(this._optionsService.options.logger?.error.bind(this._optionsService.options.logger)??console.error,g,y)}};c.LogService=x=h([b(0,C.IOptionsService)],x),c.setTraceLogger=function(g){A=g},c.traceCall=function(g,y,f){if(typeof f.value!="function")throw new Error("not supported");const _=f.value;f.value=function(...E){if(A.logLevel!==C.LogLevelEnum.TRACE)return _.apply(this,E);A.trace(`GlyphRenderer#${_.name}(${E.map((R=>JSON.stringify(R))).join(", ")})`);const L=_.apply(this,E);return A.trace(`GlyphRenderer#${_.name} return`,L),L}}},7302:(m,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.OptionsService=c.DEFAULT_OPTIONS=void 0;const h=u(8460),b=u(844),p=u(6114);c.DEFAULT_OPTIONS={cols:80,rows:24,cursorBlink:!1,cursorStyle:"block",cursorWidth:1,cursorInactiveStyle:"outline",customGlyphs:!0,drawBoldTextInBrightColors:!0,documentOverride:null,fastScrollModifier:"alt",fastScrollSensitivity:5,fontFamily:"courier-new, courier, monospace",fontSize:15,fontWeight:"normal",fontWeightBold:"bold",ignoreBracketedPasteMode:!1,lineHeight:1,letterSpacing:0,linkHandler:null,logLevel:"info",logger:null,scrollback:1e3,scrollOnUserInput:!0,scrollSensitivity:1,screenReaderMode:!1,smoothScrollDuration:0,macOptionIsMeta:!1,macOptionClickForcesSelection:!1,minimumContrastRatio:1,disableStdin:!1,allowProposedApi:!1,allowTransparency:!1,tabStopWidth:8,theme:{},rescaleOverlappingGlyphs:!1,rightClickSelectsWord:p.isMac,windowOptions:{},windowsMode:!1,windowsPty:{},wordSeparator:" ()[]{}',\"`",altClickMovesCursor:!0,convertEol:!1,termName:"xterm",cancelEvents:!1,overviewRulerWidth:0};const C=["normal","bold","100","200","300","400","500","600","700","800","900"];class w extends b.Disposable{constructor(x){super(),this._onOptionChange=this.register(new h.EventEmitter),this.onOptionChange=this._onOptionChange.event;const g={...c.DEFAULT_OPTIONS};for(const y in x)if(y in g)try{const f=x[y];g[y]=this._sanitizeAndValidateOption(y,f)}catch(f){console.error(f)}this.rawOptions=g,this.options={...g},this._setupOptions(),this.register((0,b.toDisposable)((()=>{this.rawOptions.linkHandler=null,this.rawOptions.documentOverride=null})))}onSpecificOptionChange(x,g){return this.onOptionChange((y=>{y===x&&g(this.rawOptions[x])}))}onMultipleOptionChange(x,g){return this.onOptionChange((y=>{x.indexOf(y)!==-1&&g()}))}_setupOptions(){const x=y=>{if(!(y in c.DEFAULT_OPTIONS))throw new Error(`No option with key "${y}"`);return this.rawOptions[y]},g=(y,f)=>{if(!(y in c.DEFAULT_OPTIONS))throw new Error(`No option with key "${y}"`);f=this._sanitizeAndValidateOption(y,f),this.rawOptions[y]!==f&&(this.rawOptions[y]=f,this._onOptionChange.fire(y))};for(const y in this.rawOptions){const f={get:x.bind(this,y),set:g.bind(this,y)};Object.defineProperty(this.options,y,f)}}_sanitizeAndValidateOption(x,g){switch(x){case"cursorStyle":if(g||(g=c.DEFAULT_OPTIONS[x]),!(function(y){return y==="block"||y==="underline"||y==="bar"})(g))throw new Error(`"${g}" is not a valid value for ${x}`);break;case"wordSeparator":g||(g=c.DEFAULT_OPTIONS[x]);break;case"fontWeight":case"fontWeightBold":if(typeof g=="number"&&1<=g&&g<=1e3)break;g=C.includes(g)?g:c.DEFAULT_OPTIONS[x];break;case"cursorWidth":g=Math.floor(g);case"lineHeight":case"tabStopWidth":if(g<1)throw new Error(`${x} cannot be less than 1, value: ${g}`);break;case"minimumContrastRatio":g=Math.max(1,Math.min(21,Math.round(10*g)/10));break;case"scrollback":if((g=Math.min(g,4294967295))<0)throw new Error(`${x} cannot be less than 0, value: ${g}`);break;case"fastScrollSensitivity":case"scrollSensitivity":if(g<=0)throw new Error(`${x} cannot be less than or equal to 0, value: ${g}`);break;case"rows":case"cols":if(!g&&g!==0)throw new Error(`${x} must be numeric, value: ${g}`);break;case"windowsPty":g=g??{}}return g}}c.OptionsService=w},2660:function(m,c,u){var h=this&&this.__decorate||function(w,A,x,g){var y,f=arguments.length,_=f<3?A:g===null?g=Object.getOwnPropertyDescriptor(A,x):g;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")_=Reflect.decorate(w,A,x,g);else for(var E=w.length-1;E>=0;E--)(y=w[E])&&(_=(f<3?y(_):f>3?y(A,x,_):y(A,x))||_);return f>3&&_&&Object.defineProperty(A,x,_),_},b=this&&this.__param||function(w,A){return function(x,g){A(x,g,w)}};Object.defineProperty(c,"__esModule",{value:!0}),c.OscLinkService=void 0;const p=u(2585);let C=c.OscLinkService=class{constructor(w){this._bufferService=w,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(w){const A=this._bufferService.buffer;if(w.id===void 0){const E=A.addMarker(A.ybase+A.y),L={data:w,id:this._nextId++,lines:[E]};return E.onDispose((()=>this._removeMarkerFromLink(L,E))),this._dataByLinkId.set(L.id,L),L.id}const x=w,g=this._getEntryIdKey(x),y=this._entriesWithId.get(g);if(y)return this.addLineToLink(y.id,A.ybase+A.y),y.id;const f=A.addMarker(A.ybase+A.y),_={id:this._nextId++,key:this._getEntryIdKey(x),data:x,lines:[f]};return f.onDispose((()=>this._removeMarkerFromLink(_,f))),this._entriesWithId.set(_.key,_),this._dataByLinkId.set(_.id,_),_.id}addLineToLink(w,A){const x=this._dataByLinkId.get(w);if(x&&x.lines.every((g=>g.line!==A))){const g=this._bufferService.buffer.addMarker(A);x.lines.push(g),g.onDispose((()=>this._removeMarkerFromLink(x,g)))}}getLinkData(w){return this._dataByLinkId.get(w)?.data}_getEntryIdKey(w){return`${w.id};;${w.uri}`}_removeMarkerFromLink(w,A){const x=w.lines.indexOf(A);x!==-1&&(w.lines.splice(x,1),w.lines.length===0&&(w.data.id!==void 0&&this._entriesWithId.delete(w.key),this._dataByLinkId.delete(w.id)))}};c.OscLinkService=C=h([b(0,p.IBufferService)],C)},8343:(m,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.createDecorator=c.getServiceDependencies=c.serviceRegistry=void 0;const u="di$target",h="di$dependencies";c.serviceRegistry=new Map,c.getServiceDependencies=function(b){return b[h]||[]},c.createDecorator=function(b){if(c.serviceRegistry.has(b))return c.serviceRegistry.get(b);const p=function(C,w,A){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");(function(x,g,y){g[u]===g?g[h].push({id:x,index:y}):(g[h]=[{id:x,index:y}],g[u]=g)})(p,C,A)};return p.toString=()=>b,c.serviceRegistry.set(b,p),p}},2585:(m,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.IDecorationService=c.IUnicodeService=c.IOscLinkService=c.IOptionsService=c.ILogService=c.LogLevelEnum=c.IInstantiationService=c.ICharsetService=c.ICoreService=c.ICoreMouseService=c.IBufferService=void 0;const h=u(8343);var b;c.IBufferService=(0,h.createDecorator)("BufferService"),c.ICoreMouseService=(0,h.createDecorator)("CoreMouseService"),c.ICoreService=(0,h.createDecorator)("CoreService"),c.ICharsetService=(0,h.createDecorator)("CharsetService"),c.IInstantiationService=(0,h.createDecorator)("InstantiationService"),(function(p){p[p.TRACE=0]="TRACE",p[p.DEBUG=1]="DEBUG",p[p.INFO=2]="INFO",p[p.WARN=3]="WARN",p[p.ERROR=4]="ERROR",p[p.OFF=5]="OFF"})(b||(c.LogLevelEnum=b={})),c.ILogService=(0,h.createDecorator)("LogService"),c.IOptionsService=(0,h.createDecorator)("OptionsService"),c.IOscLinkService=(0,h.createDecorator)("OscLinkService"),c.IUnicodeService=(0,h.createDecorator)("UnicodeService"),c.IDecorationService=(0,h.createDecorator)("DecorationService")},1480:(m,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.UnicodeService=void 0;const h=u(8460),b=u(225);class p{static extractShouldJoin(w){return(1&w)!=0}static extractWidth(w){return w>>1&3}static extractCharKind(w){return w>>3}static createPropertyValue(w,A,x=!1){return(16777215&w)<<3|(3&A)<<1|(x?1:0)}constructor(){this._providers=Object.create(null),this._active="",this._onChange=new h.EventEmitter,this.onChange=this._onChange.event;const w=new b.UnicodeV6;this.register(w),this._active=w.version,this._activeProvider=w}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(w){if(!this._providers[w])throw new Error(`unknown Unicode version "${w}"`);this._active=w,this._activeProvider=this._providers[w],this._onChange.fire(w)}register(w){this._providers[w.version]=w}wcwidth(w){return this._activeProvider.wcwidth(w)}getStringCellWidth(w){let A=0,x=0;const g=w.length;for(let y=0;y<g;++y){let f=w.charCodeAt(y);if(55296<=f&&f<=56319){if(++y>=g)return A+this.wcwidth(f);const L=w.charCodeAt(y);56320<=L&&L<=57343?f=1024*(f-55296)+L-56320+65536:A+=this.wcwidth(L)}const _=this.charProperties(f,x);let E=p.extractWidth(_);p.extractShouldJoin(_)&&(E-=p.extractWidth(x)),A+=E,x=_}return A}charProperties(w,A){return this._activeProvider.charProperties(w,A)}}c.UnicodeService=p}},a={};function l(m){var c=a[m];if(c!==void 0)return c.exports;var u=a[m]={exports:{}};return r[m].call(u.exports,u,u.exports,l),u.exports}var v={};return(()=>{var m=v;Object.defineProperty(m,"__esModule",{value:!0}),m.Terminal=void 0;const c=l(9042),u=l(3236),h=l(844),b=l(5741),p=l(8285),C=l(7975),w=l(7090),A=["cols","rows"];class x extends h.Disposable{constructor(y){super(),this._core=this.register(new u.Terminal(y)),this._addonManager=this.register(new b.AddonManager),this._publicOptions={...this._core.options};const f=E=>this._core.options[E],_=(E,L)=>{this._checkReadonlyOptions(E),this._core.options[E]=L};for(const E in this._core.options){const L={get:f.bind(this,E),set:_.bind(this,E)};Object.defineProperty(this._publicOptions,E,L)}}_checkReadonlyOptions(y){if(A.includes(y))throw new Error(`Option "${y}" 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 C.ParserApi(this._core)),this._parser}get unicode(){return this._checkProposedApi(),new w.UnicodeApi(this._core)}get textarea(){return this._core.textarea}get rows(){return this._core.rows}get cols(){return this._core.cols}get buffer(){return this._buffer||(this._buffer=this.register(new p.BufferNamespaceApi(this._core))),this._buffer}get markers(){return this._checkProposedApi(),this._core.markers}get modes(){const y=this._core.coreService.decPrivateModes;let f="none";switch(this._core.coreMouseService.activeProtocol){case"X10":f="x10";break;case"VT200":f="vt200";break;case"DRAG":f="drag";break;case"ANY":f="any"}return{applicationCursorKeysMode:y.applicationCursorKeys,applicationKeypadMode:y.applicationKeypad,bracketedPasteMode:y.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:f,originMode:y.origin,reverseWraparoundMode:y.reverseWraparound,sendFocusMode:y.sendFocus,wraparoundMode:y.wraparound}}get options(){return this._publicOptions}set options(y){for(const f in y)this._publicOptions[f]=y[f]}blur(){this._core.blur()}focus(){this._core.focus()}input(y,f=!0){this._core.input(y,f)}resize(y,f){this._verifyIntegers(y,f),this._core.resize(y,f)}open(y){this._core.open(y)}attachCustomKeyEventHandler(y){this._core.attachCustomKeyEventHandler(y)}attachCustomWheelEventHandler(y){this._core.attachCustomWheelEventHandler(y)}registerLinkProvider(y){return this._core.registerLinkProvider(y)}registerCharacterJoiner(y){return this._checkProposedApi(),this._core.registerCharacterJoiner(y)}deregisterCharacterJoiner(y){this._checkProposedApi(),this._core.deregisterCharacterJoiner(y)}registerMarker(y=0){return this._verifyIntegers(y),this._core.registerMarker(y)}registerDecoration(y){return this._checkProposedApi(),this._verifyPositiveIntegers(y.x??0,y.width??0,y.height??0),this._core.registerDecoration(y)}hasSelection(){return this._core.hasSelection()}select(y,f,_){this._verifyIntegers(y,f,_),this._core.select(y,f,_)}getSelection(){return this._core.getSelection()}getSelectionPosition(){return this._core.getSelectionPosition()}clearSelection(){this._core.clearSelection()}selectAll(){this._core.selectAll()}selectLines(y,f){this._verifyIntegers(y,f),this._core.selectLines(y,f)}dispose(){super.dispose()}scrollLines(y){this._verifyIntegers(y),this._core.scrollLines(y)}scrollPages(y){this._verifyIntegers(y),this._core.scrollPages(y)}scrollToTop(){this._core.scrollToTop()}scrollToBottom(){this._core.scrollToBottom()}scrollToLine(y){this._verifyIntegers(y),this._core.scrollToLine(y)}clear(){this._core.clear()}write(y,f){this._core.write(y,f)}writeln(y,f){this._core.write(y),this._core.write(`\r
|
|
83
|
+
`,f)}paste(y){this._core.paste(y)}refresh(y,f){this._verifyIntegers(y,f),this._core.refresh(y,f)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(y){this._addonManager.loadAddon(this,y)}static get strings(){return c}_verifyIntegers(...y){for(const f of y)if(f===1/0||isNaN(f)||f%1!=0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...y){for(const f of y)if(f&&(f===1/0||isNaN(f)||f%1!=0||f<0))throw new Error("This API only accepts positive integers")}}m.Terminal=x})(),v})()))})(bf)),bf.exports}var ET=xT();function py(){return q.useSyncExternalStore(iE,p0,p0)}const G0=250,TT=5e3,K0=1,AT=4e3,kT=4001;function RT(t){const i=new AbortController,r=new TextEncoder;let a=G0,l=null,v=null,m=null,c=!1;const u=()=>{v?.dispose(),v=null},h=(C,w)=>{m={cols:C,rows:w},l?.readyState===K0&&l.send(JSON.stringify({type:"resize",cols:C,rows:w}))},b=async()=>{for(;!i.signal.aborted;){t.onStatus?.("connecting");try{const C=t.fetchTicket??Bx,{ticket:w}=await C(t.sessionId,{kind:t.kind,signal:i.signal});if(i.signal.aborted)return;await p(LT(w,t.location),t),a=G0}catch(C){if(i.signal.aborted)return;t.onStatus?.("connecting",C instanceof Error?C.message:String(C))}await DT(a,i.signal),a=Math.min(a*2,TT)}},p=async(C,w)=>{await new Promise((A,x)=>{const g=(w.webSocketFactory??MT)(C);l=g,g.binaryType="arraybuffer",g.onopen=()=>{w.onStatus?.("live"),u(),v=w.terminal.onData(y=>{g.readyState===K0&&g.send(r.encode(y))}),m&&h(m.cols,m.rows)},g.onmessage=y=>{y.data instanceof ArrayBuffer&&w.terminal.write(new Uint8Array(y.data))},g.onerror=()=>{x(new Error("Terminal WebSocket error"))},g.onclose=y=>{u(),l===g&&(l=null);const f=y?.code;f===AT?i.abort():f===kT&&(i.abort(),w.onExit?.()),A()}})};return{start:()=>{c||(c=!0,b())},resize:h,dispose:()=>{i.abort(),u(),t.onStatus?.("closed"),l?.close(),l=null}}}function LT(t,i=window.location){return`${i.protocol==="https:"?"wss":"ws"}://${i.host}/terminal/ws?ticket=${encodeURIComponent(t)}`}function MT(t){return new WebSocket(t)}async function DT(t,i){await new Promise(r=>{const a=()=>{clearTimeout(l),i.removeEventListener("abort",a),r()},l=setTimeout(a,t);i.addEventListener("abort",a)})}const OT={allowProposedApi:!0,convertEol:!0,cursorBlink:!0,cursorStyle:"block",fontFamily:'"Cascadia Code", "Cascadia Mono", "JetBrains Mono Variable", ui-monospace, "SF Mono", Menlo, monospace',fontSize:14,lineHeight:1.2},BT=80,NT={background:"oklch(23% 0.03 248)",foreground:"oklch(86% 0.018 90)",cursor:"oklch(82% 0.13 195)",selectionBackground:"oklch(78% 0.13 75 / 28%)",black:"oklch(18% 0.045 248)",brightBlack:"oklch(48% 0.03 248)",red:"oklch(72% 0.17 25)",green:"oklch(82% 0.13 195)",yellow:"oklch(86% 0.16 78)",blue:"oklch(70% 0.08 248)",magenta:"oklch(75% 0.11 320)",cyan:"oklch(82% 0.13 195)",white:"oklch(82% 0.018 90)",brightRed:"oklch(78% 0.18 25)",brightGreen:"oklch(88% 0.14 195)",brightYellow:"oklch(90% 0.16 78)",brightBlue:"oklch(78% 0.09 248)",brightMagenta:"oklch(82% 0.12 320)",brightCyan:"oklch(88% 0.14 195)",brightWhite:"oklch(96% 0.012 88)"},IT={background:"oklch(19% 0.008 252)",foreground:"oklch(85% 0.005 250)",cursor:"oklch(80% 0.105 205)",selectionBackground:"oklch(76% 0.115 62 / 28%)",black:"oklch(16% 0.008 252)",brightBlack:"oklch(46% 0.006 250)",red:"oklch(72% 0.17 25)",green:"oklch(80% 0.11 205)",yellow:"oklch(84% 0.14 64)",blue:"oklch(68% 0.05 250)",magenta:"oklch(75% 0.11 320)",cyan:"oklch(80% 0.11 205)",white:"oklch(81% 0.005 250)",brightRed:"oklch(78% 0.18 25)",brightGreen:"oklch(86% 0.13 205)",brightYellow:"oklch(88% 0.15 66)",brightBlue:"oklch(74% 0.06 250)",brightMagenta:"oklch(82% 0.12 320)",brightCyan:"oklch(86% 0.13 205)",brightWhite:"oklch(95% 0.003 250)"};function Gp({sessionId:t,kind:i,onExit:r,active:a}){const{activeTheme:l,terminalRenderer:v}=py(),m=q.useRef(null),c=q.useRef(null),u=q.useRef(null),h=q.useRef(null),b=q.useRef(r);b.current=r;const p=q.useRef(a);p.current=a;const[C,w]=q.useState("connecting");q.useEffect(()=>{const x=m.current;if(!x)return;let g=!1;const y=new ET.Terminal({...OT,theme:Y0(l)});c.current=y;const f=new $E.FitAddon;y.loadAddon(f),y.open(x),y.loadAddon(new PE.Unicode11Addon),y.unicode.activeVersion="11",y.attachCustomKeyEventHandler(W=>W.key==="Enter"&&W.shiftKey?(W.type==="keydown"&&y.input(`
|
|
84
|
+
`),!1):!0);const _=RT({sessionId:t,kind:i,terminal:y,onExit:()=>b.current?.(),onStatus:(W,U)=>{w(U?`${W}: ${U}`:W)}});u.current=_;let E=null;const L=()=>{f.fit(),_.resize(y.cols,y.rows)},R=()=>{L(),y.refresh(0,y.rows-1)},D=()=>{E&&clearTimeout(E),E=setTimeout(()=>{E=null,g||R()},BT)},k=async()=>{await document.fonts?.ready,!g&&(L(),_.start(),p.current!==!1&&y.focus())},N=new ResizeObserver(D);return N.observe(x),k(),()=>{g=!0,N.disconnect(),E&&clearTimeout(E),_.dispose(),c.current=null,u.current=null;try{y.dispose()}catch{}}},[i,t]),q.useEffect(()=>{a&&c.current?.focus()},[a]),q.useEffect(()=>{const x=c.current;if(!x)return;let g=!1;if(v==="webgl")try{const y=new wT;h.current=y,y.onContextLoss(()=>{if(!g){try{y.dispose()}catch{}h.current===y&&(h.current=null)}}),x.loadAddon(y)}catch{try{h.current?.dispose()}catch{}h.current=null}return()=>{g=!0;const y=h.current;if(y){h.current=null;try{y.dispose()}catch{}}}},[v,i,t]),q.useEffect(()=>{const x=c.current;x&&(x.options.theme=Y0(l))},[l]);const A=C.startsWith("live");return T.jsx("section",{className:"terminal-stage","aria-label":i==="shell"?"Shell terminal":"Fleet terminal",children:T.jsxs("div",{className:"terminal-shell",children:[A?null:T.jsxs("div",{className:"terminal-status","aria-live":"polite",children:[T.jsx("span",{className:"terminal-status-dot","aria-hidden":"true"}),C]}),T.jsx("div",{className:"terminal-canvas",ref:m})]})})}function Y0(t){return t==="carbon"?IT:NT}function jT({state:t}){const i=q.useRef(null);return t.shellOpen&&i.current===null&&(i.current=document.activeElement),q.useEffect(()=>{if(!t.shellOpen)return;const r=a=>{a.key==="Escape"&&ol()};return window.addEventListener("keydown",r),()=>{window.removeEventListener("keydown",r);const a=i.current;i.current=null,a?.focus?.()}},[t.shellOpen]),t.shellOpen?T.jsxs("div",{className:"shell-overlay",role:"dialog","aria-modal":"true","aria-label":"Shell",children:[T.jsx("button",{type:"button",className:"shell-overlay-scrim",onClick:ol,"aria-label":"Close shell"}),T.jsxs("section",{className:"shell-overlay-card",children:[T.jsxs("header",{className:"shell-overlay-header",children:[T.jsx("span",{className:"shell-overlay-kicker",children:"Free Shell"}),T.jsx("h2",{children:"Local Shell"})]}),T.jsx("button",{type:"button",className:"shell-overlay-close",onClick:ol,"aria-label":"Close shell",children:"×"}),T.jsx("div",{className:"shell-overlay-terminal",children:T.jsx(Gp,{sessionId:f0,kind:"shell",onExit:ol},f0)})]})]}):null}const zT="a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex='-1'])",V0="operation-search-listbox",gy="__unassigned__";function $T({state:t}){const i=Tp(),[r,a]=q.useState(""),[l,v]=q.useState(0),m=q.useRef(null),c=q.useRef(null),u=q.useRef(null),h=q.useRef(new Map),b=q.useMemo(()=>TE(t),[t]),p=q.useMemo(()=>Jx(b,r),[b,r]),C=q.useMemo(()=>Qx(p),[p]),w=q.useMemo(()=>kb(r),[r]),A=X0(l,p.length),x=p[A]?Z0(p[A].sessionId):void 0;if(q.useEffect(()=>{if(!t.operationSearchOpen)return;u.current=document.activeElement instanceof HTMLElement?document.activeElement:null;const f=document.body.style.overflow;return document.body.style.overflow="hidden",window.setTimeout(()=>m.current?.focus(),0),()=>{document.body.style.overflow=f,u.current?.focus()}},[t.operationSearchOpen]),q.useEffect(()=>{if(!t.operationSearchOpen){a(""),v(0);return}v(0)},[t.operationSearchOpen,r]),q.useEffect(()=>{if(!t.operationSearchOpen)return;const f=p[A];f&&h.current.get(f.sessionId)?.scrollIntoView({block:"nearest"})},[A,p,t.operationSearchOpen]),!t.operationSearchOpen)return null;const g=f=>{pE(f),i("/operations"),nf()},y=f=>{if(f.key==="Escape"){f.preventDefault(),nf();return}if(f.key==="ArrowDown"||f.key==="ArrowUp"){f.preventDefault(),v(_=>X0(_+(f.key==="ArrowDown"?1:-1),p.length));return}if(f.key==="Enter"){const _=p[A];if(!_)return;f.preventDefault(),g(_.sessionId);return}f.key==="Tab"&&FT(f,c.current)};return T.jsx("div",{className:"operation-search-overlay",onMouseDown:f=>{f.target===f.currentTarget&&nf()},children:T.jsxs("section",{ref:c,className:"operation-search-card",role:"dialog","aria-modal":"true","aria-label":"Operation quick search",tabIndex:-1,onKeyDown:y,children:[T.jsxs("div",{className:"operation-search-field",children:[T.jsx(qT,{}),T.jsx("input",{ref:m,id:"operation-search-input",type:"search",value:r,onChange:f=>a(f.target.value),placeholder:"Search Operations across Theaters",autoComplete:"off",role:"combobox","aria-expanded":!0,"aria-controls":V0,"aria-activedescendant":x,"aria-autocomplete":"list",spellCheck:!1}),T.jsx("kbd",{children:"esc"})]}),T.jsx("div",{id:V0,className:"operation-search-results",role:"listbox","aria-label":"Operation results",children:C.length>0?C.map(f=>{const _=UT(f.theaterId);return T.jsxs("section",{className:"operation-search-section",role:"group","aria-labelledby":_,children:[T.jsx("h2",{id:_,className:"operation-search-section-heading",children:yf(f.theaterLabel,w)}),f.entries.map(E=>{const L=p.indexOf(E),R=L===A;return T.jsxs("button",{id:Z0(E.sessionId),ref:D=>{D?h.current.set(E.sessionId,D):h.current.delete(E.sessionId)},type:"button",className:`operation-search-result ${R?"is-active":""}`,role:"option","aria-selected":R,onMouseEnter:()=>v(L),onClick:()=>g(E.sessionId),children:[T.jsxs("span",{className:"operation-search-result-text",children:[T.jsx("strong",{children:yf(E.operationName,w)}),T.jsx("small",{children:HT(E)})]}),T.jsx("span",{className:"operation-search-theater",children:yf(E.theaterLabel,w)})]},E.sessionId)})]},f.theaterId??gy)}):T.jsx("p",{className:"operation-search-empty",children:"No matching Operations."})})]})})}function X0(t,i){return i<=0?0:Math.max(0,Math.min(t,i-1))}function HT(t){return[t.cliLabel,t.status].filter(Boolean).join(" · ")}function UT(t){return`operation-search-heading-${my(t??gy)}`}function Z0(t){return`operation-search-option-${my(t)}`}function my(t){return t.replace(/[^a-zA-Z0-9_-]/g,"-")}function yf(t,i){if(i.length===0)return t;const r=[];let a=0;for(;a<t.length;){const l=PT(t,i,a);if(!l){r.push(t.slice(a));break}l.start>a&&r.push(t.slice(a,l.start)),r.push(T.jsx("mark",{children:t.slice(l.start,l.end)},`${l.start}-${l.end}`)),a=l.end}return r}function PT(t,i,r){const a=t.toLocaleLowerCase();let l=null;for(const v of i){const m=a.indexOf(v,r);m!==-1&&(!l||m<l.start)&&(l={start:m,end:m+v.length})}return l}function FT(t,i){if(!i)return;const r=Array.from(i.querySelectorAll(zT)).filter(v=>v.offsetParent!==null);if(r.length===0)return;const a=r[0],l=r[r.length-1];if(t.shiftKey&&document.activeElement===a){t.preventDefault(),l?.focus();return}!t.shiftKey&&document.activeElement===l&&(t.preventDefault(),a?.focus())}function qT(){return T.jsx("svg",{viewBox:"0 0 20 20","aria-hidden":"true",children:T.jsx("path",{d:"m14.2 14.2 3 3M8.9 15.2a6.3 6.3 0 1 1 0-12.6 6.3 6.3 0 0 1 0 12.6Z",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round"})})}function WT({open:t,title:i,message:r,tone:a="info",onDismiss:l}){return t?T.jsx("div",{className:"app-toast-host",children:T.jsxs("div",{className:`app-toast app-toast--${a}`,role:"status","aria-live":"polite",children:[T.jsx("span",{className:"app-toast-dot","aria-hidden":"true"}),T.jsxs("div",{className:"app-toast-body",children:[T.jsx("p",{className:"app-toast-title",children:i}),r?T.jsx("p",{className:"app-toast-message",children:r}):null]}),l?T.jsx("button",{type:"button",className:"app-toast-close",onClick:l,"aria-label":"Dismiss notification",children:"×"}):null]})}):null}const _y="fleet-console.operations.mode",Sf="canvas",Qf=new Set;let ep=YT();function vy(){return q.useSyncExternalStore(GT,Q0,Q0)}function J0(t){ep!==t&&(ep=t,VT(t),KT())}function GT(t){return Qf.add(t),()=>{Qf.delete(t)}}function Q0(){return ep}function KT(){for(const t of Qf)t()}function YT(){if(typeof window>"u")return Sf;try{const t=window.localStorage.getItem(_y);return t==="classic"||t==="canvas"?t:Sf}catch{return Sf}}function VT(t){if(!(typeof window>"u"))try{window.localStorage.setItem(_y,t)}catch{}}const XT=[{to:"/operations",label:"Operation",end:!1,icon:"operations"},{to:"/codex",label:"Codex",end:!1,icon:"codex"}],Cf=[{id:"maritime",label:"Maritime",swatch:["oklch(78% 0.13 75)","oklch(82% 0.13 195)","oklch(32% 0.04 248)"]},{id:"carbon",label:"Carbon",swatch:["oklch(76% 0.115 62)","oklch(80% 0.105 205)","oklch(25% 0.007 252)"]}];function ZT({state:t}){const i=t.connectionError!==null,r=Pn().pathname,a=vy(),l=r.startsWith("/operations"),v=r.startsWith("/codex")?T.jsx(t1,{}):r.startsWith("/carrier-settings")?T.jsx(i1,{}):r.startsWith("/operations")?T.jsx(e1,{}):T.jsx(aA,{});return T.jsxs("header",{className:"topbar",children:[T.jsxs("div",{className:"topbar-lead",children:[T.jsxs(Op,{className:"topbar-brand",to:"/","aria-label":"Welcome으로 이동",children:[T.jsx("span",{className:`topbar-sigil ${i?"is-alert":""}`,"aria-hidden":"true",title:t.connectionError??void 0,children:v}),T.jsxs("h1",{className:"topbar-title",children:["Fleet",T.jsx("span",{className:"topbar-title-thin",children:"Console"})]})]}),T.jsx("span",{className:"topbar-preview-badge",children:"Research Preview"})]}),T.jsx(QT,{state:t}),T.jsxs("div",{className:"topbar-meta",children:[t.updateAvailable?T.jsx("a",{className:"topbar-update-badge",href:"https://www.npmjs.com/package/@dotobokuri/fleet-console",target:"_blank",rel:"noreferrer",title:t.latestVersion?`Latest version: ${t.latestVersion}`:"Update available",children:"Update available"}):null,T.jsx("nav",{className:"topbar-nav","aria-label":"주 내비게이션",children:XT.map(m=>T.jsxs(q.Fragment,{children:[T.jsxs(Pf,{to:m.to,end:m.end,className:({isActive:c})=>`topbar-nav-link ${c?"is-active":""}`,children:[T.jsx("span",{className:"topbar-nav-icon","aria-hidden":"true",children:m.icon==="operations"?T.jsx(e1,{}):T.jsx(t1,{})}),T.jsx("span",{children:m.label})]}),m.icon==="operations"&&l?T.jsx(JT,{mode:a}):null]},m.to))}),T.jsxs("button",{type:"button",className:"topbar-shell-button",onMouseDown:m=>m.preventDefault(),onClick:Ob,"aria-label":"Shell",title:"Shell (⌘`)",children:[T.jsx(lA,{}),T.jsx("span",{children:"Shell"})]}),T.jsx("button",{type:"button",className:"topbar-shell-button topbar-shortcuts-button",onMouseDown:m=>m.preventDefault(),onClick:_E,"aria-label":"Keyboard shortcuts",title:"Keyboard shortcuts",children:T.jsx(cA,{})}),T.jsxs(Pf,{to:"/carrier-settings",className:({isActive:m})=>`topbar-nav-link ${m?"is-active":""}`,title:"Carrier settings",children:[T.jsx("span",{className:"topbar-nav-icon","aria-hidden":"true",children:T.jsx(i1,{})}),T.jsx("span",{children:"Settings"})]}),T.jsx(eA,{activeTheme:t.activeTheme}),T.jsx(tA,{renderer:t.terminalRenderer})]})]})}function JT({mode:t}){return T.jsxs("div",{className:"operations-mode-toggle",role:"group","aria-label":"Operation view mode",children:[T.jsx("button",{type:"button",className:`operations-mode-option ${t==="canvas"?"is-active":""}`,onClick:()=>J0("canvas"),"aria-pressed":t==="canvas",title:"Operation mode: Map",children:"Map"}),T.jsx("button",{type:"button",className:`operations-mode-option ${t==="classic"?"is-active":""}`,onClick:()=>J0("classic"),"aria-pressed":t==="classic",title:"Operation mode: Helm",children:"Helm"})]})}function QT({state:t}){const[i,r]=q.useState(!1),a=q.useRef(null),l=q.useRef(null),v=q.useRef(null),m=t.theaters.find(C=>C.id===t.activeTheaterId)??null,c=m?.label??(t.theaters.length===0?"No Theaters":"Theater");q.useEffect(()=>{if(!i)return;const C=A=>{a.current?.contains(A.target)||r(!1)},w=A=>{A.key==="Escape"&&(r(!1),l.current?.focus())};return document.addEventListener("mousedown",C),document.addEventListener("keydown",w),()=>{document.removeEventListener("mousedown",C),document.removeEventListener("keydown",w)}},[i]),q.useEffect(()=>{if(!i)return;const C=v.current;if(!C)return;(C.querySelector('[data-active="true"]')??C.querySelector("[role^='menuitem']"))?.focus()},[i]);const u=C=>{uE(C),r(!1),l.current?.focus()},h=async()=>{r(!1),hE();try{const C=await Mx();if("cancelled"in C){fE();return}dE(C)}catch(C){g0(C instanceof Error?C.message:String(C))}},b=async()=>{if(m){r(!1);try{await Dx(m.id),bE(m.id)}catch(C){g0(C instanceof Error?C.message:String(C))}}},p=C=>{if(C.key!=="ArrowDown"&&C.key!=="ArrowUp")return;C.preventDefault();const w=Array.from(v.current?.querySelectorAll("[role^='menuitem']")??[]);if(w.length===0)return;const A=w.indexOf(document.activeElement),x=C.key==="ArrowDown"?1:-1,g=(A+x+w.length)%w.length;w[g]?.focus()};return T.jsxs("div",{className:"theater-control",ref:a,children:[T.jsx("span",{className:"theater-eyebrow","aria-hidden":"true",children:"Theater"}),T.jsxs("button",{type:"button",ref:l,className:`theater-trigger ${i?"is-open":""}`,"aria-haspopup":"menu","aria-expanded":i,"aria-label":"Theater",title:m?.label??t.theaterError??void 0,onClick:()=>r(C=>!C),children:[T.jsx("span",{className:"theater-trigger-sigil","aria-hidden":"true",children:T.jsx(iA,{})}),T.jsx("span",{className:"theater-trigger-label",children:c}),T.jsx("span",{className:"theater-trigger-caret","aria-hidden":"true",children:T.jsx(by,{})})]}),i?T.jsxs("div",{className:"theater-menu",role:"menu","aria-label":"Theater",ref:v,onKeyDown:p,children:[t.theaters.length>0?T.jsx("ul",{className:"theater-menu-list",children:t.theaters.map(C=>{const w=C.id===t.activeTheaterId;return T.jsx("li",{children:T.jsxs("button",{type:"button",role:"menuitemradio","aria-checked":w,"data-active":w?"true":void 0,className:`theater-menu-item ${w?"is-active":""}`,title:C.label,onClick:()=>u(C.id),children:[T.jsx("span",{className:"theater-menu-check","aria-hidden":"true",children:w?T.jsx(yy,{}):null}),T.jsx("span",{className:"theater-menu-label",children:C.label})]})},C.id)})}):T.jsx("p",{className:"theater-menu-empty",children:"No Theaters yet."}),T.jsx("div",{className:"theater-menu-divider",role:"separator"}),m?T.jsxs(T.Fragment,{children:[T.jsxs("button",{type:"button",role:"menuitem",className:"theater-menu-item theater-menu-forget",onClick:b,children:[T.jsx("span",{className:"theater-menu-check","aria-hidden":"true",children:T.jsx(rA,{})}),T.jsx("span",{className:"theater-menu-label",children:"Forget Theater"})]}),T.jsx("div",{className:"theater-menu-divider",role:"separator"})]}):null,T.jsxs("button",{type:"button",role:"menuitem",className:"theater-menu-item theater-menu-add",disabled:t.addingTheater,onClick:h,children:[T.jsx("span",{className:"theater-menu-check","aria-hidden":"true",children:T.jsx(oA,{})}),T.jsx("span",{className:"theater-menu-label",children:t.addingTheater?"Adding Theater…":"Add Theater…"})]}),t.theaterError?T.jsx("p",{className:"theater-menu-error",children:t.theaterError}):null]}):null]})}function eA({activeTheme:t}){const[i,r]=q.useState(!1),a=q.useRef(null),l=q.useRef(null),v=q.useRef(null),m=Cf.find(h=>h.id===t)??Cf[0];q.useEffect(()=>{if(!i)return;const h=p=>{a.current?.contains(p.target)||r(!1)},b=p=>{p.key==="Escape"&&(r(!1),l.current?.focus())};return document.addEventListener("mousedown",h),document.addEventListener("keydown",b),()=>{document.removeEventListener("mousedown",h),document.removeEventListener("keydown",b)}},[i]),q.useEffect(()=>{if(!i)return;const h=v.current;if(!h)return;(h.querySelector('[data-active="true"]')??h.querySelector("[role^='menuitem']"))?.focus()},[i]);const c=h=>{rE(h),r(!1),l.current?.focus()},u=h=>{if(h.key!=="ArrowDown"&&h.key!=="ArrowUp")return;h.preventDefault();const b=Array.from(v.current?.querySelectorAll("[role^='menuitem']")??[]);if(b.length===0)return;const p=b.indexOf(document.activeElement),C=h.key==="ArrowDown"?1:-1,w=(p+C+b.length)%b.length;b[w]?.focus()};return T.jsxs("div",{className:"theme-control",ref:a,children:[T.jsxs("button",{type:"button",ref:l,className:`theme-trigger ${i?"is-open":""}`,"aria-haspopup":"menu","aria-expanded":i,"aria-label":"Theme",onClick:()=>r(h=>!h),children:[T.jsx(sA,{}),T.jsx("span",{className:"theme-trigger-label",children:m.label}),T.jsx("span",{className:"theme-trigger-caret","aria-hidden":"true",children:T.jsx(by,{})})]}),i?T.jsx("div",{className:"theme-menu",role:"menu","aria-label":"Theme",ref:v,onKeyDown:u,children:Cf.map(h=>{const b=h.id===t;return T.jsxs("button",{type:"button",role:"menuitemradio","aria-checked":b,"data-active":b?"true":void 0,className:`theme-menu-item ${b?"is-active":""}`,onClick:()=>c(h.id),children:[T.jsx("span",{className:"theme-swatch","aria-hidden":"true",children:h.swatch.map(p=>T.jsx("i",{style:{background:p}},p))}),T.jsx("span",{className:"theme-menu-label",children:h.label}),T.jsx("span",{className:"theme-menu-check","aria-hidden":"true",children:b?T.jsx(yy,{}):null})]},h.id)})}):null]})}function tA({renderer:t}){const i=t==="webgl"?"dom":"webgl",r=t==="webgl"?"WebGL":"DOM";return T.jsxs("button",{type:"button",className:"theme-trigger","aria-label":`Terminal renderer: ${r}`,title:`Terminal renderer: ${r}`,onClick:()=>sE(i),children:[T.jsx(nA,{}),T.jsx("span",{className:"theme-trigger-label",children:r})]})}function iA(){return T.jsxs("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:[T.jsx("circle",{cx:"8",cy:"3.2",r:"1.5",fill:"none",stroke:"currentColor",strokeWidth:"1.2"}),T.jsx("path",{d:"M8 4.7v8.1M4.3 8.2H11.7M3.4 9.1A4.7 4.7 0 0 0 12.6 9.1",fill:"none",stroke:"currentColor",strokeWidth:"1.2",strokeLinecap:"round"})]})}function nA(){return T.jsxs("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:[T.jsx("rect",{x:"2.5",y:"3",width:"11",height:"8",rx:"1.2",fill:"none",stroke:"currentColor",strokeWidth:"1.2"}),T.jsx("path",{d:"M5.2 13h5.6M8 11v2",fill:"none",stroke:"currentColor",strokeWidth:"1.2",strokeLinecap:"round"})]})}function by(){return T.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:T.jsx("path",{d:"M4.5 6.5 8 10l3.5-3.5",fill:"none",stroke:"currentColor",strokeWidth:"1.3",strokeLinecap:"round",strokeLinejoin:"round"})})}function yy(){return T.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:T.jsx("path",{d:"M3.5 8.5 6.5 11.5 12.5 5",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}function rA(){return T.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:T.jsx("path",{d:"M4.7 4.7 11.3 11.3M11.3 4.7 4.7 11.3",fill:"none",stroke:"currentColor",strokeWidth:"1.35",strokeLinecap:"round"})})}function sA(){return T.jsxs("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:[T.jsx("path",{d:"M8 2.6a5.4 5.4 0 0 0-5.4 5.5c0 2.4 1.8 4.5 4.2 5 .8.2 1.2-.2 1.2-.8 0-.5-.4-.8-.4-1.3 0-.7.6-1.1 1.3-1.1h1.1c1.9 0 3.4-1.5 3.4-3.3C13.4 4.4 11 2.6 8 2.6Z",fill:"none",stroke:"currentColor",strokeWidth:"1.15",strokeLinejoin:"round"}),T.jsx("circle",{cx:"5.6",cy:"6.4",r:".75",fill:"currentColor"}),T.jsx("circle",{cx:"8",cy:"5.2",r:".75",fill:"currentColor"}),T.jsx("circle",{cx:"10.4",cy:"6.5",r:".75",fill:"currentColor"})]})}function aA(){return T.jsxs("svg",{viewBox:"0 0 16 16",width:"16",height:"16",children:[T.jsx("path",{d:"M8 1.8 9.5 6.5 14.2 8 9.5 9.5 8 14.2 6.5 9.5 1.8 8 6.5 6.5Z",fill:"none",stroke:"currentColor",strokeWidth:"1.2",strokeLinejoin:"round"}),T.jsx("path",{d:"M8 4.7 8.7 7.3 11.3 8 8.7 8.7 8 11.3 7.3 8.7 4.7 8 7.3 7.3Z",fill:"currentColor"})]})}function e1(){return T.jsxs("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:[T.jsx("circle",{cx:"8",cy:"8",r:"5.4",fill:"none",stroke:"currentColor",strokeWidth:"1.2"}),T.jsx("path",{d:"M8 3.7v2.1M8 10.2v2.1M3.7 8h2.1M10.2 8h2.1M8 8l3.1-2.1",fill:"none",stroke:"currentColor",strokeWidth:"1.2",strokeLinecap:"round"}),T.jsx("circle",{cx:"8",cy:"8",r:"1.1",fill:"currentColor"})]})}function t1(){return T.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[T.jsx("circle",{cx:"12",cy:"12",r:"9"}),T.jsx("circle",{cx:"12",cy:"12",r:"3.2",fill:"currentColor",stroke:"none",opacity:"0.16"}),T.jsx("path",{d:"M12 3v3.6M12 17.4V21M3 12h3.6M17.4 12H21"}),T.jsx("path",{d:"M12 8.6 14.2 12 12 15.4 9.8 12Z",fill:"currentColor",stroke:"none"})]})}function i1(){return T.jsxs("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:[T.jsx("path",{d:"M3 4.4h10M3 8h10M3 11.6h10",fill:"none",stroke:"currentColor",strokeWidth:"1.2",strokeLinecap:"round"}),T.jsx("circle",{cx:"6.2",cy:"4.4",r:"1.3",fill:"var(--surface-glass-strong)",stroke:"currentColor",strokeWidth:"1.2"}),T.jsx("circle",{cx:"10",cy:"8",r:"1.3",fill:"var(--surface-glass-strong)",stroke:"currentColor",strokeWidth:"1.2"}),T.jsx("circle",{cx:"7.4",cy:"11.6",r:"1.3",fill:"var(--surface-glass-strong)",stroke:"currentColor",strokeWidth:"1.2"})]})}function oA(){return T.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:T.jsx("path",{d:"M8 3.4v9.2M3.4 8h9.2",fill:"none",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round"})})}function lA(){return T.jsxs("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:[T.jsx("path",{d:"M2.8 4.2h10.4v7.6H2.8z",fill:"none",stroke:"currentColor",strokeWidth:"1.2",strokeLinejoin:"round"}),T.jsx("path",{d:"M5 6.7 6.8 8 5 9.3M8.2 9.4h2.6",fill:"none",stroke:"currentColor",strokeWidth:"1.2",strokeLinecap:"round",strokeLinejoin:"round"})]})}function cA(){return T.jsxs("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:[T.jsx("rect",{x:"2.4",y:"4.1",width:"11.2",height:"7.8",rx:"1.8",fill:"none",stroke:"currentColor",strokeWidth:"1.2"}),T.jsx("path",{d:"M4.5 6.3h.1M6.8 6.3h.1M9.1 6.3h.1M11.4 6.3h.1M4.5 8.2h.1M6.8 8.2h.1M9.1 8.2h.1M11.4 8.2h.1M5.8 10.1h4.4",fill:"none",stroke:"currentColor",strokeWidth:"1.2",strokeLinecap:"round"})]})}function uA(){let t="";return i=>{t+=i;const r=[];let a=t.indexOf(`
|
|
85
|
+
|
|
86
|
+
`);for(;a>=0;){const l=t.slice(0,a);t=t.slice(a+2);const v=dA(l);v&&r.push(v),a=t.indexOf(`
|
|
87
|
+
|
|
88
|
+
`)}return r}}function hA(t){if(!t.data)return null;let i;try{i=JSON.parse(t.data)}catch{return null}if(t.event==="observer:truncated"){const a=i.tenant?.tenantId;return!a||!i.truncation?null:{kind:"truncation",tenantId:a,tenantLabel:i.tenant?.tenantLabel,truncation:i.truncation}}if(t.event==="session:updated"){const a=fA(i.session);return a?{kind:"session",tenantId:a.tenantId??a.sessionId,session:a}:null}const r=n1(i.event)??n1(i);return r?{kind:"event",tenantId:r.tenantId,tenantLabel:i.tenant?.tenantLabel,event:r}:null}function dA(t){const i=t.split(`
|
|
89
|
+
`),r=i.find(l=>l.startsWith("event:"))?.slice(6).trim()??"message",a=i.filter(l=>l.startsWith("data:")).map(l=>l.slice(5).trim()).join(`
|
|
90
|
+
`);return!a&&r==="message"?null:{event:r,data:a}}function n1(t){if(typeof t!="object"||t===null)return null;const i=t;return typeof i.id!="number"||typeof i.tenantId!="string"||typeof i.type!="string"||typeof i.at!="number"?null:typeof i.event!="object"||i.event===null?{...i,event:{}}:i}function fA(t){if(typeof t!="object"||t===null)return null;const i=t;return typeof i.sessionId!="string"||typeof i.cwdLabel!="string"||typeof i.sequence!="number"||typeof i.status!="string"||typeof i.createdAt!="number"||"cwd"in i||"canonicalCwd"in i||"providerSession"in i||"ticket"in i||"token"in i||"transcriptPath"in i?null:{sessionId:i.sessionId,terminalSessionId:typeof i.terminalSessionId=="string"?i.terminalSessionId:i.sessionId,cwdLabel:i.cwdLabel,sequence:i.sequence,label:typeof i.label=="string"?i.label:void 0,cliId:typeof i.cliId=="string"?i.cliId:void 0,cliLabel:typeof i.cliLabel=="string"?i.cliLabel:void 0,status:i.status,createdAt:i.createdAt,theaterId:typeof i.theaterId=="string"?i.theaterId:void 0,tenantId:typeof i.tenantId=="string"?i.tenantId:void 0,registrationId:typeof i.registrationId=="string"?i.registrationId:void 0,resumeAvailable:i.resumeAvailable===!0}}const r1=250,pA=5e3;function gA(){const t=new AbortController;return mA(t.signal),()=>t.abort()}async function mA(t){let i=r1,r=!1;const a=async()=>{if(!r){r=!0;try{Nb(await bb(t))}catch{}finally{r=!1}}};for(;!t.aborted;){Ke({connection:"connecting"});try{await vA(t);const l=await kx(t);Ke({connection:"live",connectionError:null}),i=r1,await _A(l,t,a),t.aborted||Ke({connection:"connecting",connectionError:null})}catch(l){if(t.aborted)return;Ke({connection:"connecting",connectionError:l instanceof Error?l.message:String(l)})}if(t.aborted)return;await bA(i,t),i=Math.min(i*2,pA)}}async function _A(t,i,r){const a=new TextDecoder,l=uA();for(;!i.aborted;){const v=await t.read();if(v.done)return;for(const m of l(a.decode(v.value,{stream:!0}))){const c=hA(m);if(c){if(c.kind==="truncation"&&c.truncation){CE(c.tenantId,c.tenantLabel,c.truncation);continue}if(c.kind==="session"&&c.session){Gs(c.session);continue}if(c.event){const{unknownTenant:u}=SE(c.event,c.tenantLabel);u&&r()}}}}}async function vA(t){const[i,r]=await Promise.all([bb(t),Ax(t)]);Nb(i),yE(r)}async function bA(t,i){await new Promise(r=>{const a=()=>{clearTimeout(l),i.removeEventListener("abort",a),r()},l=setTimeout(a,t);i.addEventListener("abort",a)})}const yA=new Set(["token","credential","cwd","path","persona","prompt","toolAllowlist","allowedExecutorTools"]);async function Sy(t){const i=await fetch("/carrier-settings/state",{signal:t});return await Kp(i),Cy(await i.json(),i.status)}async function SA(t){const i=await fetch("/carrier-settings/options",{signal:t});return await Kp(i),AA(await i.json(),i.status)}async function CA(t,i,r){return Qa(`/carrier-settings/carriers/${encodeURIComponent(t)}/cli`,"PUT",{cliType:i},r)}async function wA(t,i,r){return Qa(`/carrier-settings/carriers/${encodeURIComponent(t)}/model`,"PUT",i,r)}async function xA(t,i,r){return Qa(`/carrier-settings/carriers/${encodeURIComponent(t)}/display-name`,"PATCH",{displayName:i},r)}async function s1(t,i,r){return Qa(`/carrier-settings/carriers/${encodeURIComponent(t)}/agent-mode`,"PUT",{agentMode:i},r)}async function EA(t,i,r,a){return Qa(`/carrier-settings/carriers/${encodeURIComponent(t)}/taskforce/${encodeURIComponent(i)}`,"PUT",r,a)}async function TA(t,i,r){return Qa(`/carrier-settings/carriers/${encodeURIComponent(t)}/taskforce/${encodeURIComponent(i)}`,"DELETE",{},r)}async function Qa(t,i,r,a){const l=await fetch(t,{method:i,headers:{"Content-Type":"application/json"},body:JSON.stringify(r),signal:a});await Kp(l);const v=await l.json();if(!v||typeof v!="object"||!("state"in v))throw new Bt(l.status,"Invalid carrier settings mutation response");return{state:Cy(v.state,l.status)}}async function Kp(t){if(t.ok)return;let i=t.statusText||`HTTP ${t.status}`;try{const r=await t.json();typeof r.error=="string"&&(i=r.error)}catch{}throw new Bt(t.status,i)}function Cy(t,i){wy(t,i);const r=t;if(!r||typeof r.generation!="number"||!Array.isArray(r.carriers))throw new Bt(i,"Invalid carrier settings state response");return{generation:r.generation,carriers:r.carriers.map(a=>kA(a,i))}}function AA(t,i){wy(t,i);const r=t;if(!r||!Array.isArray(r.cliTypes)||!r.taskForceConstraints||typeof r.taskForceConstraints.minBackends!="number")throw new Bt(i,"Invalid carrier settings options response");return{cliTypes:r.cliTypes.map(a=>RA(a,i)),taskForceConstraints:{minBackends:r.taskForceConstraints.minBackends}}}function kA(t,i){const r=t;if(!r||typeof r.carrierId!="string"||typeof r.displayName!="string"||typeof r.sourceDisplayName!="string"||typeof r.role!="string"||typeof r.roleDescription!="string"||typeof r.slot!="number"||typeof r.cliType!="string"||typeof r.defaultCliType!="string"||typeof r.model!="string"||r.effort!==void 0&&typeof r.effort!="string"||r.agentMode!=="cli"&&r.agentMode!=="subagent"||typeof r.subagentMode!="boolean"||typeof r.taskForceBackendCount!="number"||!r.taskforce||!Array.isArray(r.taskforce.backends))throw new Bt(i,"Invalid carrier settings carrier response");return{carrierId:r.carrierId,displayName:r.displayName,sourceDisplayName:r.sourceDisplayName,role:r.role,roleDescription:r.roleDescription,...r.category?{category:r.category}:{},slot:r.slot,cliType:r.cliType,defaultCliType:r.defaultCliType,model:r.model,...r.effort?{effort:r.effort}:{},agentMode:r.agentMode,subagentMode:r.subagentMode,taskForceBackendCount:r.taskForceBackendCount,taskforce:{backends:r.taskforce.backends.map(a=>MA(a,i))}}}function RA(t,i){const r=t;if(!r||typeof r.id!="string"||typeof r.displayName!="string"||typeof r.supportsSubagent!="boolean"||!Array.isArray(r.models)||typeof r.defaultModel!="string")throw new Bt(i,"Invalid carrier settings CLI option");return{id:r.id,displayName:r.displayName,supportsSubagent:r.supportsSubagent,models:r.models.map(a=>LA(a,i)),defaultModel:r.defaultModel}}function LA(t,i){const r=t;if(!r||typeof r.modelId!="string"||typeof r.name!="string")throw new Bt(i,"Invalid carrier settings model option");if(r.effort!==void 0&&(!Array.isArray(r.effort.levels)||typeof r.effort.default!="string"))throw new Bt(i,"Invalid carrier settings effort option");return{modelId:r.modelId,name:r.name,...r.effort?{effort:{levels:r.effort.levels.filter(a=>typeof a=="string"),default:r.effort.default}}:{}}}function MA(t,i){const r=t;if(!r||typeof r.cliType!="string"||typeof r.model!="string"||r.effort!==void 0&&typeof r.effort!="string")throw new Bt(i,"Invalid carrier settings Task Force backend");return{cliType:r.cliType,model:r.model,...r.effort?{effort:r.effort}:{}}}function wy(t,i){const r=[t];for(;r.length>0;){const a=r.pop();if(!(!a||typeof a!="object"))for(const[l,v]of Object.entries(a)){if(yA.has(l))throw new Bt(i,"Carrier settings response leaked a restricted field");v&&typeof v=="object"&&r.push(v)}}}const DA={cliType:"",model:"",effort:"",displayName:"",agentMode:"cli",taskforce:{}},tp=new Set;let Ai={loading:!1,state:null,options:null,activeCarrierId:null,draft:DA,savingActionId:null,error:null};function xy(){return q.useSyncExternalStore(OA,a1,a1)}function a1(){return Ai}function OA(t){return tp.add(t),()=>{tp.delete(t)}}async function o1(t){Jn({loading:!0,error:null});try{const[i,r]=await Promise.all([Sy(t),SA(t)]);Ey(i,r)}catch(i){if(t?.aborted)return;Jn({loading:!1,error:Ay(i)})}}function BA(t){const i=Ai.state?.carriers.find(r=>r.carrierId===t);Jn({activeCarrierId:t,draft:i?Yp(i,Ai.options):Ai.draft,error:null})}function Hs(t){Jn({draft:{...Ai.draft,...t},error:null})}function ip(t,i){const r=Ai.draft.taskforce[t]??{model:"",effort:""};Jn({draft:{...Ai.draft,taskforce:{...Ai.draft.taskforce,[t]:{...r,...i}}},error:null})}function NA(){const t=Ty();t&&Jn({draft:Yp(t,Ai.options),error:null})}async function IA(t){const i=Ty();return i?jA("save-all",async()=>{const r=Ai.draft;let a=null;r.displayName!==i.displayName&&(a=(await xA(i.carrierId,r.displayName)).state);const l=r.cliType!==i.cliType;return l&&(a=(await CA(i.carrierId,r.cliType)).state),(l||r.model!==i.model||(r.effort||"")!==(i.effort||""))&&(a=(await wA(i.carrierId,$A(r))).state),r.agentMode==="subagent"?(i.agentMode!=="subagent"||i.taskForceBackendCount>0)&&(a=(await s1(i.carrierId,"subagent")).state):(i.agentMode!=="cli"&&(a=(await s1(i.carrierId,"cli")).state),a=await HA(i,t,a)),{state:a??await Sy()}}):!1}function Ey(t,i){const r=UA(t,Ai.activeCarrierId),a=t.carriers.find(l=>l.carrierId===r)??null;Jn({loading:!1,state:t,options:i,activeCarrierId:r,draft:a?Yp(a,i):Ai.draft,error:null})}async function jA(t,i){Jn({savingActionId:t,error:null});try{const r=await i();return Ey(r.state,Ai.options??{cliTypes:[],taskForceConstraints:{minBackends:2}}),Jn({savingActionId:null}),!0}catch(r){return Jn({savingActionId:null,error:Ay(r)}),!1}}function Yp(t,i){const r=Object.fromEntries((i?.cliTypes??[]).map(a=>{const l=t.taskforce.backends.find(v=>v.cliType===a.id);return[a.id,{model:l?.model??a.defaultModel,effort:l?.effort??zA(a.id,l?.model??a.defaultModel,i)??""}]}));return{cliType:t.cliType,model:t.model,effort:t.effort??"",displayName:t.displayName,agentMode:t.agentMode,taskforce:r}}function zA(t,i,r){return r?.cliTypes.find(v=>v.id===t)?.models.find(v=>v.modelId===i)?.effort?.default??null}function $A(t){return{model:t.model,...t.effort?{effort:t.effort}:{}}}function Ty(){return Ai.state?.carriers.find(t=>t.carrierId===Ai.activeCarrierId)??null}async function HA(t,i,r){const a=new Set(i.map(l=>l.cliType));for(const l of t.taskforce.backends)a.has(l.cliType)||(r=(await TA(t.carrierId,l.cliType)).state);for(const l of i){const v=t.taskforce.backends.find(m=>m.cliType===l.cliType);v&&v.model===l.model&&(v.effort||"")===(l.effort||"")||(r=(await EA(t.carrierId,l.cliType,{model:l.model,...l.effort?{effort:l.effort}:{}})).state)}return r}function UA(t,i){return i&&t.carriers.some(r=>r.carrierId===i)?i:t.carriers[0]?.carrierId??null}function Jn(t){Ai={...Ai,...t};for(const i of tp)i()}function Ay(t){return t instanceof Error?t.message:String(t)}const PA=50,FA=2400,qA={nimitz:"var(--captain-nimitz)",kirov:"var(--captain-kirov)",genesis:"var(--captain-genesis)",ohio:"var(--captain-ohio)",sentinel:"var(--captain-sentinel)",vanguard:"var(--captain-vanguard)",tempest:"var(--captain-tempest)",chronicle:"var(--captain-chronicle)"};function WA(){const t=xy(),i=t.state?.carriers.find(f=>f.carrierId===t.activeCarrierId)??null,r=t.options?.cliTypes.find(f=>f.id===t.draft.cliType)??null,a=r?.models.find(f=>f.modelId===t.draft.model)??null,[l,v]=q.useState(!1),[m,c]=q.useState([]),[u,h]=q.useState("idle"),b=m.length>0,p=t.draft.agentMode==="subagent",C=t.draft.agentMode==="subagent",w=t.savingActionId==="save-all",A=i?ZA(i,t.draft,m):!1,x=i?.taskforce.backends.map(f=>`${f.cliType}:${f.model}:${f.effort??""}`).join("|")??"";q.useEffect(()=>{const f=new AbortController;return o1(f.signal),()=>f.abort()},[]),q.useEffect(()=>{v(!1),c(i?.taskforce.backends.map(f=>f.cliType)??[]),h("idle")},[i?.carrierId,x]),q.useEffect(()=>{if(u!=="saved")return;const f=window.setTimeout(()=>h("idle"),FA);return()=>window.clearTimeout(f)},[u]);function g(){i&&(NA(),c(i.taskforce.backends.map(f=>f.cliType)),v(!1),h("idle"))}async function y(){if(!i)return;if(h("saving"),!await IA(QA(m,t.draft.taskforce))){h("idle");return}v(!1),h("saved")}return T.jsxs("main",{className:"carrier-settings-page",children:[T.jsxs("section",{className:"carrier-settings-hero","aria-labelledby":"carrier-settings-title",children:[T.jsxs("div",{children:[T.jsx("p",{className:"bridge-kicker",children:"Carrier Control Surface"}),T.jsx("h2",{id:"carrier-settings-title",children:"Carrier Settings"})]}),T.jsxs("div",{className:"carrier-settings-hero-actions",children:[T.jsx("div",{className:`carrier-settings-save-status ${u==="saved"?"is-positive":""}`,role:"status","aria-live":"polite",children:u==="saving"||w?"Saving…":u==="saved"?"Saved ✓":""}),i?T.jsxs("div",{className:"carrier-settings-save-actions",children:[T.jsx("button",{type:"button",className:`carrier-settings-action-button ${A?"is-dirty":""}`,disabled:!A||w,onClick:()=>{y()},children:"Save"}),T.jsx("button",{type:"button",className:`carrier-settings-action-button ${A?"is-dirty":""}`,disabled:!A||w,onClick:g,children:"Discard"})]}):null,T.jsx("button",{type:"button",className:"carrier-settings-action-button carrier-settings-hero-refresh",disabled:t.loading,onClick:()=>{o1()},children:"Refresh"})]})]}),t.error?T.jsx("p",{className:"carrier-settings-error",role:"alert",children:t.error}):null,T.jsxs("section",{className:"carrier-settings-grid",children:[T.jsxs("div",{className:"carrier-settings-list","aria-label":"Carrier list",children:[t.loading&&!t.state?T.jsx("p",{className:"carrier-settings-empty",children:"Loading carrier settings."}):null,t.state&&t.state.carriers.length===0?T.jsx("p",{className:"carrier-settings-empty",children:"No carriers registered."}):null,t.state?.carriers.map(f=>T.jsx(GA,{carrier:f,active:f.carrierId===t.activeCarrierId,minBackends:t.options?.taskForceConstraints.minBackends??2,onSelect:()=>BA(f.carrierId)},f.carrierId))]}),i&&t.options&&r?T.jsxs("div",{className:"carrier-settings-detail",style:Ly(i.carrierId),children:[T.jsxs("div",{className:"carrier-settings-detail-head",children:[T.jsxs("div",{className:"carrier-settings-detail-title-block",children:[T.jsxs("div",{className:"carrier-settings-captain-id",children:[T.jsx("span",{children:"Captain"})," · ",i.carrierId.toUpperCase()]}),T.jsx("div",{className:`carrier-settings-name-line ${l?"is-editing":""}`,children:l?T.jsxs(T.Fragment,{children:[T.jsx("input",{id:"carrier-display-name",className:"carrier-settings-input carrier-settings-name-input",value:t.draft.displayName,maxLength:PA,onChange:f=>Hs({displayName:f.target.value})}),T.jsx("button",{type:"button",className:"carrier-settings-icon-button","aria-label":"Save display name",disabled:w,onClick:()=>{v(!1)},children:T.jsx(t3,{})}),T.jsx("button",{type:"button",className:"carrier-settings-icon-button","aria-label":"Cancel display name edit",onClick:()=>{Hs({displayName:i.displayName}),v(!1)},children:T.jsx(i3,{})})]}):T.jsxs(T.Fragment,{children:[T.jsx("h3",{className:"carrier-settings-captain-name",children:i.displayName}),T.jsx("button",{type:"button",className:"carrier-settings-icon-button","aria-label":"Edit display name",onClick:()=>{Hs({displayName:i.displayName}),v(!0)},children:T.jsx(e3,{})})]})}),T.jsx("div",{className:"carrier-settings-captain-role",children:i.role})]}),T.jsxs("div",{className:"carrier-settings-cli-badge",children:[T.jsx("span",{className:"ind","aria-hidden":"true"}),i.cliType]})]}),T.jsxs("div",{className:"carrier-settings-body",children:[T.jsxs("div",{className:"carrier-settings-control-group",children:[T.jsx("div",{className:"carrier-settings-resp-title",children:"Identity"}),T.jsxs("div",{className:"carrier-settings-mission",children:['"',i.roleDescription,'"']})]}),T.jsxs("div",{className:"carrier-settings-control-group",children:[T.jsx("div",{className:"carrier-settings-resp-title",children:"Runtime"}),T.jsxs("div",{className:"carrier-settings-runtime",children:[T.jsx("div",{className:"carrier-settings-runtime-row carrier-settings-runtime-row--cli",children:T.jsxs("div",{className:"carrier-settings-field carrier-settings-field--wide",children:[T.jsx("label",{className:"carrier-settings-label",htmlFor:"carrier-cli",children:"CLI"}),T.jsx("select",{id:"carrier-cli",className:"carrier-settings-select",value:t.draft.cliType,onChange:f=>YA(f.target.value,t.options?.cliTypes??[]),children:t.options.cliTypes.map(f=>T.jsx("option",{value:f.id,children:f.displayName},f.id))})]})}),T.jsxs("div",{className:"carrier-settings-runtime-row carrier-settings-runtime-row--model",children:[T.jsx(ky,{id:"carrier-model",label:"Model",models:r.models,value:t.draft.model,onChange:f=>VA(r,f)}),T.jsx(Ry,{id:"carrier-effort",model:a,value:t.draft.effort,onChange:f=>Hs({effort:f})})]})]})]}),T.jsx("div",{className:"carrier-settings-control-group",children:T.jsxs("div",{className:"carrier-settings-toggle-row",children:[T.jsxs("div",{children:[T.jsx("p",{className:"carrier-settings-resp-title",children:"SubAgent"}),T.jsx("p",{className:"carrier-settings-help",children:b?"Task Force draft is present. Remove every backend to enable SubAgent.":r.supportsSubagent?"Enabling SubAgent clears Task Force backends when saved.":"This CLI does not support SubAgent mode."})]}),T.jsx("button",{type:"button",className:`carrier-settings-toggle ${p?"is-on":""}`,disabled:w||!p&&(!r.supportsSubagent||b),"aria-pressed":p,onClick:()=>Hs({agentMode:p?"cli":"subagent"}),children:T.jsx("span",{children:p?"On":"Off"})})]})}),T.jsx(KA,{carrier:i,cliOptions:t.options.cliTypes,minBackends:t.options.taskForceConstraints.minBackends,savingActionId:t.savingActionId,rows:m,disabled:C,onRowsChange:c})]})]},i.carrierId):T.jsx("div",{className:"carrier-settings-detail",children:T.jsx("p",{className:"carrier-settings-empty",children:"Select a carrier."})})]})]})}function GA({carrier:t,active:i,minBackends:r,onSelect:a}){const l=t.taskForceBackendCount>=r;return T.jsxs("button",{type:"button",className:`carrier-settings-row ${i?"is-active":""}`,style:Ly(t.carrierId),onClick:a,children:[T.jsx("span",{className:"carrier-settings-captain-dot","aria-hidden":"true"}),T.jsxs("span",{className:"carrier-settings-row-text",children:[T.jsx("span",{className:"carrier-settings-row-name",children:t.displayName}),T.jsx("span",{className:"carrier-settings-row-role",children:t.role})]}),T.jsxs("span",{className:"carrier-settings-row-live","aria-hidden":"true",children:[T.jsx("span",{className:`carrier-settings-live-dot ${t.subagentMode?"is-live":""}`}),T.jsx("span",{className:`carrier-settings-live-dot ${l?"is-live":""}`})]})]})}function ky({id:t,label:i,models:r,value:a,disabled:l=!1,onChange:v}){return T.jsxs("div",{className:"carrier-settings-field",children:[T.jsx("label",{className:"carrier-settings-label",htmlFor:t,children:i}),T.jsx("select",{id:t,className:"carrier-settings-select",value:a,disabled:l,onChange:m=>v(m.target.value),children:r.map(m=>T.jsx("option",{value:m.modelId,children:m.name},m.modelId))})]})}function Ry({id:t,model:i,value:r,disabled:a=!1,onChange:l}){return i?.effort?T.jsxs("div",{className:"carrier-settings-field",children:[T.jsx("label",{className:"carrier-settings-label",htmlFor:t,children:"Effort"}),T.jsx("select",{id:t,className:"carrier-settings-select",value:r||i.effort.default,disabled:a,onChange:v=>l(v.target.value),children:i.effort.levels.map(v=>T.jsx("option",{value:v,children:v},v))})]}):T.jsxs("div",{className:"carrier-settings-field",children:[T.jsx("span",{className:"carrier-settings-label",children:"Effort"}),T.jsx("p",{className:"carrier-settings-help",children:"Not supported for this model."})]})}function KA({carrier:t,cliOptions:i,minBackends:r,savingActionId:a,rows:l,disabled:v,onRowsChange:m}){const c=xy(),u=t.taskforce.backends.length,[h,b]=q.useState(u>0),[p,C]=q.useState(!1),[w,A]=q.useState(""),x=t.taskForceBackendCount>=r,g=i.filter(f=>!l.includes(f.id)),y=w||g[0]?.id||"";return T.jsxs("div",{className:`carrier-settings-control-group carrier-settings-control-group--taskforce ${h?"is-expanded":""} ${v?"is-disabled":""}`,children:[T.jsxs("div",{className:"carrier-settings-section-head",children:[T.jsxs("div",{children:[T.jsx("p",{className:"carrier-settings-resp-title",children:"Task Force"}),T.jsx("p",{className:"carrier-settings-help",children:v?"Disabled while SubAgent is on. Turn SubAgent off before composing Task Force backends.":u>0?`${u} backend${u===1?"":"s"} configured${x?" · active":` · needs ${r}+ to activate`}.`:`Run this carrier across multiple CLI backends. Needs at least ${r} to activate.`})]}),T.jsx("div",{className:"carrier-settings-tf-head-actions",children:T.jsx("button",{type:"button",className:"carrier-settings-tf-toggle","aria-expanded":h,onClick:()=>b(f=>!f),children:h?"Hide":"Configure"})})]}),h?T.jsxs("div",{className:"carrier-settings-tf-list",children:[l.length===0?T.jsx("p",{className:"carrier-settings-tf-empty",children:"No Task Force backend drafted."}):null,l.map(f=>{const _=i.find(D=>D.id===f);if(!_)return null;const E=c.draft.taskforce[_.id]??{model:_.defaultModel,effort:""},L=_.models.find(D=>D.modelId===E.model)??_.models[0]??null,R=t.taskforce.backends.some(D=>D.cliType===_.id);return T.jsxs("div",{className:`carrier-settings-tf-item ${R?"is-active":""}`,children:[T.jsxs("div",{className:"carrier-settings-tf-title",children:[T.jsx("span",{className:`carrier-settings-live-dot ${R?"is-live":""}`,"aria-hidden":"true"}),T.jsx("strong",{children:_.displayName})]}),T.jsx(ky,{id:`tf-${_.id}-model`,label:"Model",models:_.models,value:E.model,disabled:v,onChange:D=>XA(_,D)}),T.jsx(Ry,{id:`tf-${_.id}-effort`,model:L,value:E.effort,disabled:v,onChange:D=>ip(_.id,{effort:D})}),T.jsx("div",{className:"carrier-settings-tf-actions",children:T.jsx("button",{type:"button",className:"carrier-settings-ghost-button",disabled:v||a==="save-all",onClick:()=>m(l.filter(D=>D!==_.id)),children:"Remove"})})]},_.id)}),T.jsxs("div",{className:"carrier-settings-tf-add-row",children:[p&&g.length>0?T.jsx("select",{className:"carrier-settings-select carrier-settings-tf-add-select",value:y,onChange:f=>A(f.target.value),"aria-label":"Task Force CLI to add",children:g.map(f=>T.jsx("option",{value:f.id,children:f.displayName},f.id))}):null,T.jsx("button",{type:"button",className:"carrier-settings-ghost-button",disabled:v||g.length===0||a==="save-all",onClick:()=>{if(!p){C(!0);return}const f=y,_=i.find(L=>L.id===f),E=_?.models.find(L=>L.modelId===_.defaultModel)??_?.models[0]??null;!_||!E||(ip(_.id,{model:E.modelId,effort:E.effort?.default??""}),m(l.includes(_.id)?l:[...l,_.id]),A(""),C(!1))},children:"Add"})]})]}):null]})}function YA(t,i){const r=i.find(v=>v.id===t),a=r?.models.find(v=>v.modelId===r.defaultModel)??r?.models[0]??null,l={cliType:t,model:a?.modelId??"",effort:a?.effort?.default??""};r?.supportsSubagent||(l.agentMode="cli"),Hs(l)}function VA(t,i){const r=t.models.find(a=>a.modelId===i);Hs({model:i,effort:r?.effort?.default??""})}function XA(t,i){const r=t.models.find(a=>a.modelId===i);ip(t.id,{model:i,effort:r?.effort?.default??""})}function ZA(t,i,r){return i.displayName!==t.displayName||i.cliType!==t.cliType||i.model!==t.model||(i.effort||"")!==(t.effort||"")||i.agentMode!==t.agentMode?!0:i.agentMode==="subagent"?t.taskForceBackendCount>0:JA(t,r,i.taskforce)}function JA(t,i,r){if(i.length!==t.taskforce.backends.length)return!0;const a=new Set(i);for(const l of t.taskforce.backends){if(!a.has(l.cliType))return!0;const v=r[l.cliType];if(!v||v.model!==l.model||(v.effort||"")!==(l.effort||""))return!0}return!1}function QA(t,i){return t.map(r=>{const a=i[r];return a?{cliType:r,model:a.model,...a.effort?{effort:a.effort}:{}}:null}).filter(r=>r!==null)}function Ly(t){return{"--cap-color":qA[t]??"var(--brass)"}}function e3(){return T.jsxs("svg",{viewBox:"0 0 16 16","aria-hidden":"true",focusable:"false",children:[T.jsx("path",{d:"M10.8 2.2 13.8 5.2 5.2 13.8 2 14.5 2.7 11.3 10.8 2.2Z"}),T.jsx("path",{d:"M9.7 3.4 12.6 6.3"})]})}function t3(){return T.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",focusable:"false",children:T.jsx("path",{d:"M3 8.3 6.4 11.7 13.2 4.5"})})}function i3(){return T.jsxs("svg",{viewBox:"0 0 16 16","aria-hidden":"true",focusable:"false",children:[T.jsx("path",{d:"M4.2 4.2 11.8 11.8"}),T.jsx("path",{d:"M11.8 4.2 4.2 11.8"})]})}function Ae(t){return t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">")}function Je(t){return Ae(t).replace(/"/g,""")}const n3="contextual-knowledge-not-instructions";function r3(t,i,r){const a=r?.whyThisMatched??t.frontmatter.whyThisMatched,l=Oy(t,i);return`
|
|
91
|
+
<div class="context-actions-grid">
|
|
92
|
+
<button class="context-action-btn" type="button" data-action="copy-compact-context">
|
|
93
|
+
<span class="context-action-label">Compact context</span>
|
|
94
|
+
<span class="context-action-meta">${cu(My(t))} tok</span>
|
|
95
|
+
</button>
|
|
96
|
+
<button class="context-action-btn" type="button" data-action="copy-provenance-context">
|
|
97
|
+
<span class="context-action-label">Provenance</span>
|
|
98
|
+
<span class="context-action-meta">${cu(Dy(t))} tok</span>
|
|
99
|
+
</button>
|
|
100
|
+
<button class="context-action-btn" type="button" data-action="copy-related-context">
|
|
101
|
+
<span class="context-action-label">Context pack</span>
|
|
102
|
+
<span class="context-action-meta">${cu(l)} tok</span>
|
|
103
|
+
</button>
|
|
104
|
+
${a?`
|
|
105
|
+
<button class="context-action-btn context-action-btn--secondary" type="button" data-action="toggle-why-matched">
|
|
106
|
+
<span class="context-action-label">Why this matched</span>
|
|
107
|
+
</button>
|
|
108
|
+
<div class="context-why-matched" hidden>${Ae(a)}</div>
|
|
109
|
+
`:""}
|
|
110
|
+
</div>
|
|
111
|
+
`}function My(t){const i={id:t.frontmatter.id,title:t.frontmatter.title,status:t.frontmatter.status??null,tags:t.frontmatter.tags,updated:t.frontmatter.updated,summary:Vp(t.body)};return JSON.stringify({...i,token_estimate:cu(JSON.stringify(i))},null,2)}function Dy(t){return[`# ${t.frontmatter.title} (\`${t.frontmatter.id}\`)`,"",`- updated: ${t.frontmatter.updated}`,`- status: ${t.frontmatter.status??"unknown"}`,`- raw_source_ref: ${t.frontmatter.rawSourceRef??"(none)"}`,`- raw_source_refs: ${(t.frontmatter.rawSourceRefs??[]).join(", ")||"(none)"}`,"","## Summary",Vp(t.body)].join(`
|
|
112
|
+
`)}function Oy(t,i){const r=new Set([...t.frontmatter.related??[]]),a=i.filter(l=>r.has(l.id)).sort((l,v)=>l.title.localeCompare(v.title));return[`<fleet-wiki-context boundary="${n3}">`,"# Fleet Wiki Context Pack","",`## Entry: ${t.frontmatter.title} (\`${t.frontmatter.id}\`)`,"",`- updated: ${t.frontmatter.updated}`,`- status: ${t.frontmatter.status??"unknown"}`,`- tags: ${t.frontmatter.tags.join(", ")||"(none)"}`,"","### Summary",Vp(t.body),"","### Related Entries",...a.length>0?a.map(l=>`- [[wiki:${l.id}]] — ${l.title}`):["- (none)"],"","</fleet-wiki-context>"].join(`
|
|
113
|
+
`)}function cu(t){return Math.max(1,Math.ceil(t.length/4))}function Vp(t){return t.replace(/\s+/g," ").trim().slice(0,240)||"(empty)"}async function s3(){return nr(Qi("/health"))}async function a3(){return nr(Qi("/workspaces"))}async function o3(){return nr(Qi("/index"))}async function l3(){return Ny(Qi("/index-md"))}async function c3(t){return nr(Qi(`/entry/${encodeURIComponent(t)}`))}async function u3(t,i=[],r=!1){const a=new URLSearchParams;t&&a.set("q",t),i.length>0&&a.set("tags",i.join(",")),r&&a.set("enhanced","true");const l=a.toString();return nr(Qi(`/search${l?`?${l}`:""}`))}async function h3(t){return Ny(Qi(`/raw?ref=${encodeURIComponent(t)}`))}async function zu(t){return nr(Qi(`/queue?status=${encodeURIComponent(t)}`))}async function d3(t){return nr(Qi(`/queue/${encodeURIComponent(t)}`))}async function f3(t){return Iy(Qi(`/queue/${encodeURIComponent(t)}/approve`),{})}async function p3(t,i){return Iy(Qi(`/queue/${encodeURIComponent(t)}/reject`),{reason:i})}async function By(){return nr(Qi("/conflicts"))}async function g3(t){return nr(Qi(`/conflicts/${encodeURIComponent(t)}`))}async function m3(t){const i=typeof t=="number"?`?limit=${encodeURIComponent(String(t))}`:"";return nr(Qi(`/log${i}`))}function Qi(t){const i=window.location.pathname.match(/^\/console\/codex\/w\/([^/]+)(?:\/|$)/),r=t.startsWith("/")?t:`/${t}`;return i?`/console/codex/w/${encodeURIComponent(decodeURIComponent(i[1]??""))}/api${r}`:`/console/codex/api${r}`}async function nr(t){const i=await fetch(t,{headers:{accept:"application/json"}});if(!i.ok)throw new Error(await Xp(t,i));return i.json()}async function Ny(t){const i=await fetch(t,{headers:{accept:"text/markdown,text/plain"}});if(!i.ok)throw new Error(await Xp(t,i));return i.text()}async function Iy(t,i){const r=await fetch(t,{method:"POST",headers:{"content-type":"application/json",accept:"application/json"},body:JSON.stringify(i)});if(!r.ok)throw new Error(await Xp(t,r));return r.json()}async function Xp(t,i){return(await i.json().catch(()=>null))?.error??`${t} request failed: ${i.status}`}const _3=/^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}-[0-9]{2}-[0-9]{2}-[0-9]{3}Z-[0-9a-f]{8}$/,zn="/console/codex",np=new Set;function kl(){const t=E3(T3(Uy(window.location.pathname)).pathname);return t.name==="queue"?{name:"queue",tab:new URLSearchParams(window.location.search).get("tab")==="archived"?"archived":"pending"}:t}function rp(){return Hy(Uy(window.location.pathname))?.wsId??null}function Ks(t){t!==window.location.pathname+window.location.search&&(window.history.pushState({},"",t),Zp(kl()))}function v3(t){window.history.replaceState({},"",t),Zp(kl())}function b3(t){return np.add(t),()=>np.delete(t)}function y3(){window.addEventListener("popstate",()=>Zp(kl()))}function Nr(t){return er(`/entry/${encodeURIComponent(t)}`)}function jy(t){return er(`/raw/${encodeURIComponent(t)}`)}function Ka(t="pending"){return er(t==="archived"?"/queue?tab=archived":"/queue")}function S3(t){return er(`/queue/${encodeURIComponent(t)}`)}function C3(){return er("/conflicts")}function w3(t){return er(`/conflicts/${encodeURIComponent(t)}`)}function x3(){return er("/index-md")}function zy(t){return er(typeof t!="number"?"/log":`/log?limit=${encodeURIComponent(String(t))}`)}function $y(){return er("/")}function l1(t){return`${zn}/w/${encodeURIComponent(t)}/`}function E3(t){if(t==="/index"||t==="/index-md")return{name:"index-md"};if(t==="/log"){const v=new URLSearchParams(window.location.search).get("limit"),m=Number(v??20);return{name:"log",limit:Number.isInteger(m)?m:20}}if(t==="/conflicts")return{name:"conflicts"};const i=t.match(/^\/conflicts\/([^/]+)$/);if(i)return{name:"conflict-detail",id:decodeURIComponent(i[1]??"")};const r=t.match(/^\/entry\/([^/]+)$/);if(r)return{name:"entry",id:decodeURIComponent(r[1]??"")};const a=t.match(/^\/raw\/(.+)$/);if(a)return{name:"raw",ref:decodeURIComponent(a[1]??"")};if(t==="/queue")return{name:"queue",tab:"pending"};const l=t.match(/^\/queue\/([^/]+)$/);if(l){const v=decodeURIComponent(l[1]??"");return _3.test(v)?{name:"queue-detail",patchId:v}:{name:"home"}}return{name:"home"}}function er(t){const i=rp();return i?`${zn}/w/${encodeURIComponent(i)}${t}`:`${zn}${t}`}function T3(t){const i=Hy(t);return i?{pathname:i.pathname,wsId:i.wsId}:{pathname:t,wsId:null}}function Hy(t){const i=t.match(/^\/w\/([^/]+)(\/.*)?$/);return i?{wsId:decodeURIComponent(i[1]??""),pathname:i[2]??"/"}:null}function Uy(t){return t===zn||t===`${zn}/`?"/":t.startsWith(`${zn}/`)?t.slice(zn.length)||"/":t}function Zp(t){for(const i of np)i(t)}const Py="fleet-wiki-web-recent",sp=new Set,Ys={health:null,index:[],currentEntry:null,currentMatchHint:null,conflicts:[],currentConflict:null,indexMarkdown:null,log:null,loading:!1,error:null,recentIds:N3(),pendingPatchCount:0,currentWorkspaceId:null,workspaces:[]};function uu(){return Ys}function A3(t){return sp.add(t),()=>sp.delete(t)}async function k3(){Jt({loading:!0,error:null});try{const[t,i,r,a]=await Promise.all([s3(),o3(),zu("pending").catch(()=>null),a3().catch(()=>null)]);Jt({health:t,index:i,pendingPatchCount:r?.pendingCount??0,currentWorkspaceId:a?.currentWorkspaceId??null,workspaces:a?.workspaces??[],loading:!1})}catch(t){Jt({loading:!1,error:eo(t)})}}async function R3(t){Jt({loading:!0,error:null,currentEntry:null,currentMatchHint:Ys.currentMatchHint?.id===t?Ys.currentMatchHint:null,currentConflict:null,indexMarkdown:null,log:null});try{const i=await c3(t),r=B3(t);Jt({currentEntry:i,currentConflict:null,indexMarkdown:null,log:null,recentIds:r,loading:!1})}catch(i){Jt({loading:!1,error:eo(i)})}}async function L3(){Jt({loading:!0,error:null,currentEntry:null,currentConflict:null,log:null});try{Jt({indexMarkdown:await l3(),loading:!1})}catch(t){Jt({loading:!1,error:eo(t)})}}async function M3(t){Jt({loading:!0,error:null,currentEntry:null,currentConflict:null,indexMarkdown:null});try{Jt({log:await m3(t),loading:!1})}catch(i){Jt({loading:!1,error:eo(i)})}}async function D3(){Jt({loading:!0,error:null,currentEntry:null,currentConflict:null,indexMarkdown:null,log:null});try{Jt({conflicts:await By(),loading:!1})}catch(t){Jt({loading:!1,error:eo(t)})}}async function O3(t){Jt({loading:!0,error:null,currentEntry:null,indexMarkdown:null,log:null});try{const[i,r]=await Promise.all([g3(t),By().catch(()=>Ys.conflicts)]);Jt({currentConflict:i,conflicts:r,loading:!1})}catch(i){Jt({loading:!1,error:eo(i)})}}function wf(){Jt({currentEntry:null,currentMatchHint:null,currentConflict:null,indexMarkdown:null,log:null,error:null,loading:!1})}function Fy(t){Jt({currentMatchHint:t})}function Jp(t){Jt({pendingPatchCount:t})}function Jt(t){Object.assign(Ys,t);for(const i of sp)i(Ys)}function B3(t){const i=[t,...Ys.recentIds.filter(r=>r!==t)].slice(0,8);return window.localStorage.setItem(Py,JSON.stringify(i)),i}function N3(){try{const t=window.localStorage.getItem(Py),i=t?JSON.parse(t):[];return Array.isArray(i)?i.filter(r=>typeof r=="string").slice(0,8):[]}catch{return[]}}function eo(t){return t instanceof Error?t.message:String(t)}const Me={open:!1,query:"",selectedIndex:0,results:[],debounceId:null,searchSeq:0,previousBodyOverflow:null,previousActiveElement:null};let ap=[],Qp=[];function I3(t,i){ap=t,Qp=i,Me.open&&!Me.query&&(Me.results=eg(),Me.selectedIndex=0,bu())}function qy(){if(Me.open){u1();return}Me.open=!0,Me.query="",Me.selectedIndex=0,Me.results=eg(),Me.previousActiveElement=document.activeElement instanceof HTMLElement?document.activeElement:null,V3(),q3(),bu(),u1()}function fl(){Me.open&&(Me.open=!1,Me.searchSeq++,Me.debounceId!==null&&(window.clearTimeout(Me.debounceId),Me.debounceId=null),W3(),X3(),Z3())}function j3(){document.addEventListener("keydown",z3),document.addEventListener("input",$3),document.addEventListener("click",H3),document.addEventListener("mouseover",U3)}function z3(t){if((t.metaKey||t.ctrlKey)&&t.key.toLowerCase()==="k"){t.preventDefault(),Me.open?fl():qy();return}if(Me.open){if(t.key==="Tab"){J3(t);return}if(t.key==="Escape"){t.preventDefault(),fl();return}if(t.key==="ArrowDown"){t.preventDefault(),Me.selectedIndex=Math.min(Me.selectedIndex+1,Math.max(0,Me.results.length-1)),op({scroll:!0});return}if(t.key==="ArrowUp"){t.preventDefault(),Me.selectedIndex=Math.max(0,Me.selectedIndex-1),op({scroll:!0});return}if(t.key==="Enter"){t.preventDefault();const r=Me.results[Me.selectedIndex];if(!r)return;Fy(r),Ks(Nr(r.id)),fl()}}}function $3(t){const i=t.target;!(i instanceof HTMLInputElement)||i.id!=="command-input"||(Me.query=i.value.trim(),Me.selectedIndex=0,Me.debounceId!==null&&window.clearTimeout(Me.debounceId),Me.debounceId=window.setTimeout(()=>{P3(Me.query)},150))}function H3(t){const i=t.target;if(!(i instanceof Element))return;if(i.matches("[data-action='open-command']")||i.closest("[data-action='open-command']")){qy();return}if(!Me.open)return;if(i.classList.contains("command-overlay")){fl();return}const r=i.closest("[data-command-entry-id]");if(r){const a=Me.results.find(l=>l.id===(r.dataset.commandEntryId??""));Fy(a??null),Ks(Nr(r.dataset.commandEntryId??"")),fl()}}function U3(t){if(!Me.open)return;const i=t.target;if(!(i instanceof Element))return;const r=i.closest("[data-command-index]");if(!r)return;const a=Number(r.dataset.commandIndex);!Number.isInteger(a)||a<0||a>=Me.results.length||(Me.selectedIndex=a,op({scroll:!1}))}async function P3(t){const i=++Me.searchSeq;if(!t){Me.results=eg(),Me.selectedIndex=0,bu();return}let r;try{r=await u3(t)}catch{r=[]}i!==Me.searchSeq||!Me.open||(Me.results=r,Me.selectedIndex=0,bu())}function F3(){let t=document.querySelector("#command-palette-root");return t||(t=document.createElement("div"),t.id="command-palette-root",document.body.append(t)),t}function q3(){const t=F3();t.querySelector(".command-overlay")||(t.innerHTML=G3())}function W3(){const t=document.querySelector("#command-palette-root");t&&(t.innerHTML="")}function bu(){const t=document.querySelector("#command-results-list");if(t){if(Me.results.length===0){t.innerHTML=`<p class="empty-state">${Ae("No results found.")}</p>`;return}t.innerHTML=Me.query?Me.results.map(Wy).join(""):K3()}}function op(t={scroll:!0}){const i=document.querySelectorAll(".command-result");i.forEach((a,l)=>{a.classList.toggle("active",l===Me.selectedIndex)});const r=i[Me.selectedIndex];t.scroll&&r?.scrollIntoView({block:"nearest"})}function G3(){const t=Je("Command palette"),i=Je("Search titles · tags · content");return`
|
|
114
|
+
<div class="command-overlay">
|
|
115
|
+
<section class="command-card" role="dialog" aria-modal="true" aria-label="${t}" tabindex="-1">
|
|
116
|
+
<div class="command-search">
|
|
117
|
+
<svg viewBox="0 0 24 24" width="18" height="18" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
|
|
118
|
+
<circle cx="11" cy="11" r="6.5" />
|
|
119
|
+
<path d="m20 20-3.5-3.5" />
|
|
120
|
+
</svg>
|
|
121
|
+
<input id="command-input" type="search" autocomplete="off" spellcheck="false" placeholder="${i}" />
|
|
122
|
+
<kbd>esc</kbd>
|
|
123
|
+
</div>
|
|
124
|
+
<div class="command-results" id="command-results-list"></div>
|
|
125
|
+
</section>
|
|
126
|
+
</div>
|
|
127
|
+
`}function Wy(t,i){const r=i===Me.selectedIndex?" active":"",a=Je(t.title),l=t.tags.slice(0,2),v=t.tags.length-l.length,m=ik(t),c=l.map(h=>`<span class="chip chip-tag">${Ae(h)}</span>`).join(""),u=v>0?`<span class="chip chip-muted">+${v}</span>`:"";return`
|
|
128
|
+
<button class="command-result${r}" type="button" data-command-entry-id="${Je(t.id)}" data-command-index="${i}" title="${a}">
|
|
129
|
+
<span class="command-result-text">
|
|
130
|
+
<strong>${ek(t.title,Me.query)}</strong>
|
|
131
|
+
<small>${Ae(tk(t))}</small>
|
|
132
|
+
${m?`<small class="command-result-excerpt">${Ae(m)}</small>`:""}
|
|
133
|
+
</span>
|
|
134
|
+
<span class="command-result-aside">${c}${u}</span>
|
|
135
|
+
</button>
|
|
136
|
+
`}function K3(){const t=Y3(),i=Me.results.slice(0,t),r=Me.results.slice(t);return[i.length>0?c1("Recent",i,0):"",r.length>0?c1("All",r,t):""].join("")}function c1(t,i,r){return`
|
|
137
|
+
<div class="command-section-heading">${Ae(t)}</div>
|
|
138
|
+
${i.map((a,l)=>Wy(a,r+l)).join("")}
|
|
139
|
+
`}function eg(){const t=new Set(Qp),i=Gy().map(a=>ap.find(l=>l.id===a)).filter(a=>!!a),r=ap.filter(a=>!t.has(a.id));return[...i,...r].slice(0,12).map((a,l)=>({id:a.id,title:a.title,score:Math.max(1,100-l),reason:"title",excerpt:"",path:a.path,tags:a.tags,updated:a.updated}))}function Y3(){return Gy().filter((t,i)=>Me.results[i]?.id===t).length}function Gy(){return Array.from(new Set(Qp))}function V3(){Me.previousBodyOverflow===null&&(Me.previousBodyOverflow=document.body.style.overflow,document.body.style.overflow="hidden")}function X3(){Me.previousBodyOverflow!==null&&(document.body.style.overflow=Me.previousBodyOverflow,Me.previousBodyOverflow=null)}function Z3(){const t=Me.previousActiveElement;Me.previousActiveElement=null,t?.isConnected&&t.focus()}function u1(){window.setTimeout(()=>{const t=document.querySelector("#command-input");t&&(t.focus(),t.select())},0)}function J3(t){const i=document.querySelector(".command-card");if(!i)return;const r=Q3(i);if(r.length===0){t.preventDefault(),i.focus();return}const a=document.activeElement,l=a instanceof HTMLElement?r.indexOf(a):-1,v=t.shiftKey?l<=0?r.length-1:l-1:l===-1||l===r.length-1?0:l+1;(l===-1||t.shiftKey&&l===0||!t.shiftKey&&l===r.length-1)&&(t.preventDefault(),r[v]?.focus())}function Q3(t){const i=["a[href]","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])","[tabindex]:not([tabindex='-1'])"].join(",");return Array.from(t.querySelectorAll(i)).filter(r=>!r.hasAttribute("hidden")&&r.offsetParent!==null)}function ek(t,i){if(!i)return Ae(t);const r=t.toLocaleLowerCase(),a=i.toLocaleLowerCase();if(!a)return Ae(t);let l=0,v="";for(;l<t.length;){const m=r.indexOf(a,l);if(m===-1)break;v+=Ae(t.slice(l,m)),v+=`<mark class="command-highlight">${Ae(t.slice(m,m+i.length))}</mark>`,l=m+i.length}return v+Ae(t.slice(l))}function tk(t){switch(t.reason){case"id":return"id match";case"alias":return"alias match";case"tag":return"tag match";case"title":return"title match";case"body":return"body match";default:return"match"}}function ik(t){const i=t.matchedSnippets?.find(a=>a.field==="body")?.snippet;if(t.reason!=="body")return"";const r=i??t.excerpt;return nk(r??"")}function nk(t){return sk(rk(t)).replace(/\s+/g," ").trim().slice(0,180)}function rk(t){return t.replace(/<<<[^>]*>>>/g," ")}function sk(t){return t.replace(/!\[[^\]]*]\([^)]*\)/g," ").replace(/\[\[wiki:([^\]\|]+)(?:\|[^\]]*)?]]/g,"$1").replace(/\[([^\]]+)]\([^)]*\)/g,"$1").replace(/^#{1,6}\s+/gm,"").replace(/^\s*(?:[-*]\s+|\d+\.\s+)/gm,"").replace(/^\s*>\s?/gm,"").replace(/`+/g,"").replace(/\*\*([^*]+)\*\*/g,"$1").replace(/__([^_]+)__/g,"$1").replace(/\*([^*\n]+)\*/g,"$1").replace(/_([^_\n]+)_/g,"$1")}function tg(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var Zs=tg();function Ky(t){Zs=t}var pl={exec:()=>null};function lt(t,i=""){let r=typeof t=="string"?t:t.source,a={replace:(l,v)=>{let m=typeof v=="string"?v:v.source;return m=m.replace(Ii.caret,"$1"),r=r.replace(l,m),a},getRegex:()=>new RegExp(r,i)};return a}var ak=(()=>{try{return!!new RegExp("(?<=1)(?<!1)")}catch{return!1}})(),Ii={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceTabs:/^\t+/,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] /,listReplaceTask:/^\[[ 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,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,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:t=>new RegExp(`^( {0,3}${t})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}#`),htmlBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}<(?:[a-z].*>|!--)`,"i")},ok=/^(?:[ \t]*(?:\n|$))+/,lk=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,ck=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,Rl=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,uk=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,ig=/(?:[*+-]|\d{1,9}[.)])/,Yy=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,Vy=lt(Yy).replace(/bull/g,ig).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}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),hk=lt(Yy).replace(/bull/g,ig).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}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),ng=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,dk=/^[^\n]+/,rg=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,fk=lt(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",rg).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),pk=lt(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,ig).getRegex(),$u="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",sg=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,gk=lt("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",sg).replace("tag",$u).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Xy=lt(ng).replace("hr",Rl).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",$u).getRegex(),mk=lt(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",Xy).getRegex(),ag={blockquote:mk,code:lk,def:fk,fences:ck,heading:uk,hr:Rl,html:gk,lheading:Vy,list:pk,newline:ok,paragraph:Xy,table:pl,text:dk},h1=lt("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",Rl).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",$u).getRegex(),_k={...ag,lheading:hk,table:h1,paragraph:lt(ng).replace("hr",Rl).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",h1).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",$u).getRegex()},vk={...ag,html:lt(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",sg).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:pl,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:lt(ng).replace("hr",Rl).replace("heading",` *#{1,6} *[^
|
|
140
|
+
]`).replace("lheading",Vy).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},bk=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,yk=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,Zy=/^( {2,}|\\)\n(?!\s*$)/,Sk=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,Hu=/[\p{P}\p{S}]/u,og=/[\s\p{P}\p{S}]/u,Jy=/[^\s\p{P}\p{S}]/u,Ck=lt(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,og).getRegex(),Qy=/(?!~)[\p{P}\p{S}]/u,wk=/(?!~)[\s\p{P}\p{S}]/u,xk=/(?:[^\s\p{P}\p{S}]|~)/u,Ek=lt(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",ak?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),eS=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,Tk=lt(eS,"u").replace(/punct/g,Hu).getRegex(),Ak=lt(eS,"u").replace(/punct/g,Qy).getRegex(),tS="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",kk=lt(tS,"gu").replace(/notPunctSpace/g,Jy).replace(/punctSpace/g,og).replace(/punct/g,Hu).getRegex(),Rk=lt(tS,"gu").replace(/notPunctSpace/g,xk).replace(/punctSpace/g,wk).replace(/punct/g,Qy).getRegex(),Lk=lt("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,Jy).replace(/punctSpace/g,og).replace(/punct/g,Hu).getRegex(),Mk=lt(/\\(punct)/,"gu").replace(/punct/g,Hu).getRegex(),Dk=lt(/^<(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(),Ok=lt(sg).replace("(?:-->|$)","-->").getRegex(),Bk=lt("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",Ok).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),yu=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+[^`]*?`+(?!`)|[^\[\]\\`])*?/,Nk=lt(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",yu).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),iS=lt(/^!?\[(label)\]\[(ref)\]/).replace("label",yu).replace("ref",rg).getRegex(),nS=lt(/^!?\[(ref)\](?:\[\])?/).replace("ref",rg).getRegex(),Ik=lt("reflink|nolink(?!\\()","g").replace("reflink",iS).replace("nolink",nS).getRegex(),d1=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,lg={_backpedal:pl,anyPunctuation:Mk,autolink:Dk,blockSkip:Ek,br:Zy,code:yk,del:pl,emStrongLDelim:Tk,emStrongRDelimAst:kk,emStrongRDelimUnd:Lk,escape:bk,link:Nk,nolink:nS,punctuation:Ck,reflink:iS,reflinkSearch:Ik,tag:Bk,text:Sk,url:pl},jk={...lg,link:lt(/^!?\[(label)\]\((.*?)\)/).replace("label",yu).getRegex(),reflink:lt(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",yu).getRegex()},lp={...lg,emStrongRDelimAst:Rk,emStrongLDelim:Ak,url:lt(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",d1).replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:lt(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",d1).getRegex()},zk={...lp,br:lt(Zy).replace("{2,}","*").getRegex(),text:lt(lp.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},Yc={normal:ag,gfm:_k,pedantic:vk},tl={normal:lg,gfm:lp,breaks:zk,pedantic:jk},$k={"&":"&","<":"<",">":">",'"':""","'":"'"},f1=t=>$k[t];function Xn(t,i){if(i){if(Ii.escapeTest.test(t))return t.replace(Ii.escapeReplace,f1)}else if(Ii.escapeTestNoEncode.test(t))return t.replace(Ii.escapeReplaceNoEncode,f1);return t}function p1(t){try{t=encodeURI(t).replace(Ii.percentDecode,"%")}catch{return null}return t}function g1(t,i){let r=t.replace(Ii.findPipe,(v,m,c)=>{let u=!1,h=m;for(;--h>=0&&c[h]==="\\";)u=!u;return u?"|":" |"}),a=r.split(Ii.splitPipe),l=0;if(a[0].trim()||a.shift(),a.length>0&&!a.at(-1)?.trim()&&a.pop(),i)if(a.length>i)a.splice(i);else for(;a.length<i;)a.push("");for(;l<a.length;l++)a[l]=a[l].trim().replace(Ii.slashPipe,"|");return a}function il(t,i,r){let a=t.length;if(a===0)return"";let l=0;for(;l<a&&t.charAt(a-l-1)===i;)l++;return t.slice(0,a-l)}function Hk(t,i){if(t.indexOf(i[1])===-1)return-1;let r=0;for(let a=0;a<t.length;a++)if(t[a]==="\\")a++;else if(t[a]===i[0])r++;else if(t[a]===i[1]&&(r--,r<0))return a;return r>0?-2:-1}function m1(t,i,r,a,l){let v=i.href,m=i.title||null,c=t[1].replace(l.other.outputLinkReplace,"$1");a.state.inLink=!0;let u={type:t[0].charAt(0)==="!"?"image":"link",raw:r,href:v,title:m,text:c,tokens:a.inlineTokens(c)};return a.state.inLink=!1,u}function Uk(t,i,r){let a=t.match(r.other.indentCodeCompensation);if(a===null)return i;let l=a[1];return i.split(`
|
|
141
|
+
`).map(v=>{let m=v.match(r.other.beginningSpace);if(m===null)return v;let[c]=m;return c.length>=l.length?v.slice(l.length):v}).join(`
|
|
142
|
+
`)}var Su=class{options;rules;lexer;constructor(t){this.options=t||Zs}space(t){let i=this.rules.block.newline.exec(t);if(i&&i[0].length>0)return{type:"space",raw:i[0]}}code(t){let i=this.rules.block.code.exec(t);if(i){let r=i[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:i[0],codeBlockStyle:"indented",text:this.options.pedantic?r:il(r,`
|
|
143
|
+
`)}}}fences(t){let i=this.rules.block.fences.exec(t);if(i){let r=i[0],a=Uk(r,i[3]||"",this.rules);return{type:"code",raw:r,lang:i[2]?i[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):i[2],text:a}}}heading(t){let i=this.rules.block.heading.exec(t);if(i){let r=i[2].trim();if(this.rules.other.endingHash.test(r)){let a=il(r,"#");(this.options.pedantic||!a||this.rules.other.endingSpaceChar.test(a))&&(r=a.trim())}return{type:"heading",raw:i[0],depth:i[1].length,text:r,tokens:this.lexer.inline(r)}}}hr(t){let i=this.rules.block.hr.exec(t);if(i)return{type:"hr",raw:il(i[0],`
|
|
144
|
+
`)}}blockquote(t){let i=this.rules.block.blockquote.exec(t);if(i){let r=il(i[0],`
|
|
145
|
+
`).split(`
|
|
146
|
+
`),a="",l="",v=[];for(;r.length>0;){let m=!1,c=[],u;for(u=0;u<r.length;u++)if(this.rules.other.blockquoteStart.test(r[u]))c.push(r[u]),m=!0;else if(!m)c.push(r[u]);else break;r=r.slice(u);let h=c.join(`
|
|
147
|
+
`),b=h.replace(this.rules.other.blockquoteSetextReplace,`
|
|
148
|
+
$1`).replace(this.rules.other.blockquoteSetextReplace2,"");a=a?`${a}
|
|
149
|
+
${h}`:h,l=l?`${l}
|
|
150
|
+
${b}`:b;let p=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(b,v,!0),this.lexer.state.top=p,r.length===0)break;let C=v.at(-1);if(C?.type==="code")break;if(C?.type==="blockquote"){let w=C,A=w.raw+`
|
|
151
|
+
`+r.join(`
|
|
152
|
+
`),x=this.blockquote(A);v[v.length-1]=x,a=a.substring(0,a.length-w.raw.length)+x.raw,l=l.substring(0,l.length-w.text.length)+x.text;break}else if(C?.type==="list"){let w=C,A=w.raw+`
|
|
153
|
+
`+r.join(`
|
|
154
|
+
`),x=this.list(A);v[v.length-1]=x,a=a.substring(0,a.length-C.raw.length)+x.raw,l=l.substring(0,l.length-w.raw.length)+x.raw,r=A.substring(v.at(-1).raw.length).split(`
|
|
155
|
+
`);continue}}return{type:"blockquote",raw:a,tokens:v,text:l}}}list(t){let i=this.rules.block.list.exec(t);if(i){let r=i[1].trim(),a=r.length>1,l={type:"list",raw:"",ordered:a,start:a?+r.slice(0,-1):"",loose:!1,items:[]};r=a?`\\d{1,9}\\${r.slice(-1)}`:`\\${r}`,this.options.pedantic&&(r=a?r:"[*+-]");let v=this.rules.other.listItemRegex(r),m=!1;for(;t;){let u=!1,h="",b="";if(!(i=v.exec(t))||this.rules.block.hr.test(t))break;h=i[0],t=t.substring(h.length);let p=i[2].split(`
|
|
156
|
+
`,1)[0].replace(this.rules.other.listReplaceTabs,y=>" ".repeat(3*y.length)),C=t.split(`
|
|
157
|
+
`,1)[0],w=!p.trim(),A=0;if(this.options.pedantic?(A=2,b=p.trimStart()):w?A=i[1].length+1:(A=i[2].search(this.rules.other.nonSpaceChar),A=A>4?1:A,b=p.slice(A),A+=i[1].length),w&&this.rules.other.blankLine.test(C)&&(h+=C+`
|
|
158
|
+
`,t=t.substring(C.length+1),u=!0),!u){let y=this.rules.other.nextBulletRegex(A),f=this.rules.other.hrRegex(A),_=this.rules.other.fencesBeginRegex(A),E=this.rules.other.headingBeginRegex(A),L=this.rules.other.htmlBeginRegex(A);for(;t;){let R=t.split(`
|
|
159
|
+
`,1)[0],D;if(C=R,this.options.pedantic?(C=C.replace(this.rules.other.listReplaceNesting," "),D=C):D=C.replace(this.rules.other.tabCharGlobal," "),_.test(C)||E.test(C)||L.test(C)||y.test(C)||f.test(C))break;if(D.search(this.rules.other.nonSpaceChar)>=A||!C.trim())b+=`
|
|
160
|
+
`+D.slice(A);else{if(w||p.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||_.test(p)||E.test(p)||f.test(p))break;b+=`
|
|
161
|
+
`+C}!w&&!C.trim()&&(w=!0),h+=R+`
|
|
162
|
+
`,t=t.substring(R.length+1),p=D.slice(A)}}l.loose||(m?l.loose=!0:this.rules.other.doubleBlankLine.test(h)&&(m=!0));let x=null,g;this.options.gfm&&(x=this.rules.other.listIsTask.exec(b),x&&(g=x[0]!=="[ ] ",b=b.replace(this.rules.other.listReplaceTask,""))),l.items.push({type:"list_item",raw:h,task:!!x,checked:g,loose:!1,text:b,tokens:[]}),l.raw+=h}let c=l.items.at(-1);if(c)c.raw=c.raw.trimEnd(),c.text=c.text.trimEnd();else return;l.raw=l.raw.trimEnd();for(let u=0;u<l.items.length;u++)if(this.lexer.state.top=!1,l.items[u].tokens=this.lexer.blockTokens(l.items[u].text,[]),!l.loose){let h=l.items[u].tokens.filter(p=>p.type==="space"),b=h.length>0&&h.some(p=>this.rules.other.anyLine.test(p.raw));l.loose=b}if(l.loose)for(let u=0;u<l.items.length;u++)l.items[u].loose=!0;return l}}html(t){let i=this.rules.block.html.exec(t);if(i)return{type:"html",block:!0,raw:i[0],pre:i[1]==="pre"||i[1]==="script"||i[1]==="style",text:i[0]}}def(t){let i=this.rules.block.def.exec(t);if(i){let r=i[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),a=i[2]?i[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",l=i[3]?i[3].substring(1,i[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):i[3];return{type:"def",tag:r,raw:i[0],href:a,title:l}}}table(t){let i=this.rules.block.table.exec(t);if(!i||!this.rules.other.tableDelimiter.test(i[2]))return;let r=g1(i[1]),a=i[2].replace(this.rules.other.tableAlignChars,"").split("|"),l=i[3]?.trim()?i[3].replace(this.rules.other.tableRowBlankLine,"").split(`
|
|
163
|
+
`):[],v={type:"table",raw:i[0],header:[],align:[],rows:[]};if(r.length===a.length){for(let m of a)this.rules.other.tableAlignRight.test(m)?v.align.push("right"):this.rules.other.tableAlignCenter.test(m)?v.align.push("center"):this.rules.other.tableAlignLeft.test(m)?v.align.push("left"):v.align.push(null);for(let m=0;m<r.length;m++)v.header.push({text:r[m],tokens:this.lexer.inline(r[m]),header:!0,align:v.align[m]});for(let m of l)v.rows.push(g1(m,v.header.length).map((c,u)=>({text:c,tokens:this.lexer.inline(c),header:!1,align:v.align[u]})));return v}}lheading(t){let i=this.rules.block.lheading.exec(t);if(i)return{type:"heading",raw:i[0],depth:i[2].charAt(0)==="="?1:2,text:i[1],tokens:this.lexer.inline(i[1])}}paragraph(t){let i=this.rules.block.paragraph.exec(t);if(i){let r=i[1].charAt(i[1].length-1)===`
|
|
164
|
+
`?i[1].slice(0,-1):i[1];return{type:"paragraph",raw:i[0],text:r,tokens:this.lexer.inline(r)}}}text(t){let i=this.rules.block.text.exec(t);if(i)return{type:"text",raw:i[0],text:i[0],tokens:this.lexer.inline(i[0])}}escape(t){let i=this.rules.inline.escape.exec(t);if(i)return{type:"escape",raw:i[0],text:i[1]}}tag(t){let i=this.rules.inline.tag.exec(t);if(i)return!this.lexer.state.inLink&&this.rules.other.startATag.test(i[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(i[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(i[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(i[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:i[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:i[0]}}link(t){let i=this.rules.inline.link.exec(t);if(i){let r=i[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(r)){if(!this.rules.other.endAngleBracket.test(r))return;let v=il(r.slice(0,-1),"\\");if((r.length-v.length)%2===0)return}else{let v=Hk(i[2],"()");if(v===-2)return;if(v>-1){let m=(i[0].indexOf("!")===0?5:4)+i[1].length+v;i[2]=i[2].substring(0,v),i[0]=i[0].substring(0,m).trim(),i[3]=""}}let a=i[2],l="";if(this.options.pedantic){let v=this.rules.other.pedanticHrefTitle.exec(a);v&&(a=v[1],l=v[3])}else l=i[3]?i[3].slice(1,-1):"";return a=a.trim(),this.rules.other.startAngleBracket.test(a)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(r)?a=a.slice(1):a=a.slice(1,-1)),m1(i,{href:a&&a.replace(this.rules.inline.anyPunctuation,"$1"),title:l&&l.replace(this.rules.inline.anyPunctuation,"$1")},i[0],this.lexer,this.rules)}}reflink(t,i){let r;if((r=this.rules.inline.reflink.exec(t))||(r=this.rules.inline.nolink.exec(t))){let a=(r[2]||r[1]).replace(this.rules.other.multipleSpaceGlobal," "),l=i[a.toLowerCase()];if(!l){let v=r[0].charAt(0);return{type:"text",raw:v,text:v}}return m1(r,l,r[0],this.lexer,this.rules)}}emStrong(t,i,r=""){let a=this.rules.inline.emStrongLDelim.exec(t);if(!(!a||a[3]&&r.match(this.rules.other.unicodeAlphaNumeric))&&(!(a[1]||a[2])||!r||this.rules.inline.punctuation.exec(r))){let l=[...a[0]].length-1,v,m,c=l,u=0,h=a[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(h.lastIndex=0,i=i.slice(-1*t.length+l);(a=h.exec(i))!=null;){if(v=a[1]||a[2]||a[3]||a[4]||a[5]||a[6],!v)continue;if(m=[...v].length,a[3]||a[4]){c+=m;continue}else if((a[5]||a[6])&&l%3&&!((l+m)%3)){u+=m;continue}if(c-=m,c>0)continue;m=Math.min(m,m+c+u);let b=[...a[0]][0].length,p=t.slice(0,l+a.index+b+m);if(Math.min(l,m)%2){let w=p.slice(1,-1);return{type:"em",raw:p,text:w,tokens:this.lexer.inlineTokens(w)}}let C=p.slice(2,-2);return{type:"strong",raw:p,text:C,tokens:this.lexer.inlineTokens(C)}}}}codespan(t){let i=this.rules.inline.code.exec(t);if(i){let r=i[2].replace(this.rules.other.newLineCharGlobal," "),a=this.rules.other.nonSpaceChar.test(r),l=this.rules.other.startingSpaceChar.test(r)&&this.rules.other.endingSpaceChar.test(r);return a&&l&&(r=r.substring(1,r.length-1)),{type:"codespan",raw:i[0],text:r}}}br(t){let i=this.rules.inline.br.exec(t);if(i)return{type:"br",raw:i[0]}}del(t){let i=this.rules.inline.del.exec(t);if(i)return{type:"del",raw:i[0],text:i[2],tokens:this.lexer.inlineTokens(i[2])}}autolink(t){let i=this.rules.inline.autolink.exec(t);if(i){let r,a;return i[2]==="@"?(r=i[1],a="mailto:"+r):(r=i[1],a=r),{type:"link",raw:i[0],text:r,href:a,tokens:[{type:"text",raw:r,text:r}]}}}url(t){let i;if(i=this.rules.inline.url.exec(t)){let r,a;if(i[2]==="@")r=i[0],a="mailto:"+r;else{let l;do l=i[0],i[0]=this.rules.inline._backpedal.exec(i[0])?.[0]??"";while(l!==i[0]);r=i[0],i[1]==="www."?a="http://"+i[0]:a=i[0]}return{type:"link",raw:i[0],text:r,href:a,tokens:[{type:"text",raw:r,text:r}]}}}inlineText(t){let i=this.rules.inline.text.exec(t);if(i){let r=this.lexer.state.inRawBlock;return{type:"text",raw:i[0],text:i[0],escaped:r}}}},In=class cp{tokens;options;state;tokenizer;inlineQueue;constructor(i){this.tokens=[],this.tokens.links=Object.create(null),this.options=i||Zs,this.options.tokenizer=this.options.tokenizer||new Su,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let r={other:Ii,block:Yc.normal,inline:tl.normal};this.options.pedantic?(r.block=Yc.pedantic,r.inline=tl.pedantic):this.options.gfm&&(r.block=Yc.gfm,this.options.breaks?r.inline=tl.breaks:r.inline=tl.gfm),this.tokenizer.rules=r}static get rules(){return{block:Yc,inline:tl}}static lex(i,r){return new cp(r).lex(i)}static lexInline(i,r){return new cp(r).inlineTokens(i)}lex(i){i=i.replace(Ii.carriageReturn,`
|
|
165
|
+
`),this.blockTokens(i,this.tokens);for(let r=0;r<this.inlineQueue.length;r++){let a=this.inlineQueue[r];this.inlineTokens(a.src,a.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(i,r=[],a=!1){for(this.options.pedantic&&(i=i.replace(Ii.tabCharGlobal," ").replace(Ii.spaceLine,""));i;){let l;if(this.options.extensions?.block?.some(m=>(l=m.call({lexer:this},i,r))?(i=i.substring(l.raw.length),r.push(l),!0):!1))continue;if(l=this.tokenizer.space(i)){i=i.substring(l.raw.length);let m=r.at(-1);l.raw.length===1&&m!==void 0?m.raw+=`
|
|
166
|
+
`:r.push(l);continue}if(l=this.tokenizer.code(i)){i=i.substring(l.raw.length);let m=r.at(-1);m?.type==="paragraph"||m?.type==="text"?(m.raw+=(m.raw.endsWith(`
|
|
167
|
+
`)?"":`
|
|
168
|
+
`)+l.raw,m.text+=`
|
|
169
|
+
`+l.text,this.inlineQueue.at(-1).src=m.text):r.push(l);continue}if(l=this.tokenizer.fences(i)){i=i.substring(l.raw.length),r.push(l);continue}if(l=this.tokenizer.heading(i)){i=i.substring(l.raw.length),r.push(l);continue}if(l=this.tokenizer.hr(i)){i=i.substring(l.raw.length),r.push(l);continue}if(l=this.tokenizer.blockquote(i)){i=i.substring(l.raw.length),r.push(l);continue}if(l=this.tokenizer.list(i)){i=i.substring(l.raw.length),r.push(l);continue}if(l=this.tokenizer.html(i)){i=i.substring(l.raw.length),r.push(l);continue}if(l=this.tokenizer.def(i)){i=i.substring(l.raw.length);let m=r.at(-1);m?.type==="paragraph"||m?.type==="text"?(m.raw+=(m.raw.endsWith(`
|
|
170
|
+
`)?"":`
|
|
171
|
+
`)+l.raw,m.text+=`
|
|
172
|
+
`+l.raw,this.inlineQueue.at(-1).src=m.text):this.tokens.links[l.tag]||(this.tokens.links[l.tag]={href:l.href,title:l.title},r.push(l));continue}if(l=this.tokenizer.table(i)){i=i.substring(l.raw.length),r.push(l);continue}if(l=this.tokenizer.lheading(i)){i=i.substring(l.raw.length),r.push(l);continue}let v=i;if(this.options.extensions?.startBlock){let m=1/0,c=i.slice(1),u;this.options.extensions.startBlock.forEach(h=>{u=h.call({lexer:this},c),typeof u=="number"&&u>=0&&(m=Math.min(m,u))}),m<1/0&&m>=0&&(v=i.substring(0,m+1))}if(this.state.top&&(l=this.tokenizer.paragraph(v))){let m=r.at(-1);a&&m?.type==="paragraph"?(m.raw+=(m.raw.endsWith(`
|
|
173
|
+
`)?"":`
|
|
174
|
+
`)+l.raw,m.text+=`
|
|
175
|
+
`+l.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=m.text):r.push(l),a=v.length!==i.length,i=i.substring(l.raw.length);continue}if(l=this.tokenizer.text(i)){i=i.substring(l.raw.length);let m=r.at(-1);m?.type==="text"?(m.raw+=(m.raw.endsWith(`
|
|
176
|
+
`)?"":`
|
|
177
|
+
`)+l.raw,m.text+=`
|
|
178
|
+
`+l.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=m.text):r.push(l);continue}if(i){let m="Infinite loop on byte: "+i.charCodeAt(0);if(this.options.silent){console.error(m);break}else throw new Error(m)}}return this.state.top=!0,r}inline(i,r=[]){return this.inlineQueue.push({src:i,tokens:r}),r}inlineTokens(i,r=[]){let a=i,l=null;if(this.tokens.links){let u=Object.keys(this.tokens.links);if(u.length>0)for(;(l=this.tokenizer.rules.inline.reflinkSearch.exec(a))!=null;)u.includes(l[0].slice(l[0].lastIndexOf("[")+1,-1))&&(a=a.slice(0,l.index)+"["+"a".repeat(l[0].length-2)+"]"+a.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(l=this.tokenizer.rules.inline.anyPunctuation.exec(a))!=null;)a=a.slice(0,l.index)+"++"+a.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);let v;for(;(l=this.tokenizer.rules.inline.blockSkip.exec(a))!=null;)v=l[2]?l[2].length:0,a=a.slice(0,l.index+v)+"["+"a".repeat(l[0].length-v-2)+"]"+a.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);a=this.options.hooks?.emStrongMask?.call({lexer:this},a)??a;let m=!1,c="";for(;i;){m||(c=""),m=!1;let u;if(this.options.extensions?.inline?.some(b=>(u=b.call({lexer:this},i,r))?(i=i.substring(u.raw.length),r.push(u),!0):!1))continue;if(u=this.tokenizer.escape(i)){i=i.substring(u.raw.length),r.push(u);continue}if(u=this.tokenizer.tag(i)){i=i.substring(u.raw.length),r.push(u);continue}if(u=this.tokenizer.link(i)){i=i.substring(u.raw.length),r.push(u);continue}if(u=this.tokenizer.reflink(i,this.tokens.links)){i=i.substring(u.raw.length);let b=r.at(-1);u.type==="text"&&b?.type==="text"?(b.raw+=u.raw,b.text+=u.text):r.push(u);continue}if(u=this.tokenizer.emStrong(i,a,c)){i=i.substring(u.raw.length),r.push(u);continue}if(u=this.tokenizer.codespan(i)){i=i.substring(u.raw.length),r.push(u);continue}if(u=this.tokenizer.br(i)){i=i.substring(u.raw.length),r.push(u);continue}if(u=this.tokenizer.del(i)){i=i.substring(u.raw.length),r.push(u);continue}if(u=this.tokenizer.autolink(i)){i=i.substring(u.raw.length),r.push(u);continue}if(!this.state.inLink&&(u=this.tokenizer.url(i))){i=i.substring(u.raw.length),r.push(u);continue}let h=i;if(this.options.extensions?.startInline){let b=1/0,p=i.slice(1),C;this.options.extensions.startInline.forEach(w=>{C=w.call({lexer:this},p),typeof C=="number"&&C>=0&&(b=Math.min(b,C))}),b<1/0&&b>=0&&(h=i.substring(0,b+1))}if(u=this.tokenizer.inlineText(h)){i=i.substring(u.raw.length),u.raw.slice(-1)!=="_"&&(c=u.raw.slice(-1)),m=!0;let b=r.at(-1);b?.type==="text"?(b.raw+=u.raw,b.text+=u.text):r.push(u);continue}if(i){let b="Infinite loop on byte: "+i.charCodeAt(0);if(this.options.silent){console.error(b);break}else throw new Error(b)}}return r}},Cu=class{options;parser;constructor(t){this.options=t||Zs}space(t){return""}code({text:t,lang:i,escaped:r}){let a=(i||"").match(Ii.notSpaceStart)?.[0],l=t.replace(Ii.endingNewline,"")+`
|
|
179
|
+
`;return a?'<pre><code class="language-'+Xn(a)+'">'+(r?l:Xn(l,!0))+`</code></pre>
|
|
180
|
+
`:"<pre><code>"+(r?l:Xn(l,!0))+`</code></pre>
|
|
181
|
+
`}blockquote({tokens:t}){return`<blockquote>
|
|
182
|
+
${this.parser.parse(t)}</blockquote>
|
|
183
|
+
`}html({text:t}){return t}def(t){return""}heading({tokens:t,depth:i}){return`<h${i}>${this.parser.parseInline(t)}</h${i}>
|
|
184
|
+
`}hr(t){return`<hr>
|
|
185
|
+
`}list(t){let i=t.ordered,r=t.start,a="";for(let m=0;m<t.items.length;m++){let c=t.items[m];a+=this.listitem(c)}let l=i?"ol":"ul",v=i&&r!==1?' start="'+r+'"':"";return"<"+l+v+`>
|
|
186
|
+
`+a+"</"+l+`>
|
|
187
|
+
`}listitem(t){let i="";if(t.task){let r=this.checkbox({checked:!!t.checked});t.loose?t.tokens[0]?.type==="paragraph"?(t.tokens[0].text=r+" "+t.tokens[0].text,t.tokens[0].tokens&&t.tokens[0].tokens.length>0&&t.tokens[0].tokens[0].type==="text"&&(t.tokens[0].tokens[0].text=r+" "+Xn(t.tokens[0].tokens[0].text),t.tokens[0].tokens[0].escaped=!0)):t.tokens.unshift({type:"text",raw:r+" ",text:r+" ",escaped:!0}):i+=r+" "}return i+=this.parser.parse(t.tokens,!!t.loose),`<li>${i}</li>
|
|
188
|
+
`}checkbox({checked:t}){return"<input "+(t?'checked="" ':"")+'disabled="" type="checkbox">'}paragraph({tokens:t}){return`<p>${this.parser.parseInline(t)}</p>
|
|
189
|
+
`}table(t){let i="",r="";for(let l=0;l<t.header.length;l++)r+=this.tablecell(t.header[l]);i+=this.tablerow({text:r});let a="";for(let l=0;l<t.rows.length;l++){let v=t.rows[l];r="";for(let m=0;m<v.length;m++)r+=this.tablecell(v[m]);a+=this.tablerow({text:r})}return a&&(a=`<tbody>${a}</tbody>`),`<table>
|
|
190
|
+
<thead>
|
|
191
|
+
`+i+`</thead>
|
|
192
|
+
`+a+`</table>
|
|
193
|
+
`}tablerow({text:t}){return`<tr>
|
|
194
|
+
${t}</tr>
|
|
195
|
+
`}tablecell(t){let i=this.parser.parseInline(t.tokens),r=t.header?"th":"td";return(t.align?`<${r} align="${t.align}">`:`<${r}>`)+i+`</${r}>
|
|
196
|
+
`}strong({tokens:t}){return`<strong>${this.parser.parseInline(t)}</strong>`}em({tokens:t}){return`<em>${this.parser.parseInline(t)}</em>`}codespan({text:t}){return`<code>${Xn(t,!0)}</code>`}br(t){return"<br>"}del({tokens:t}){return`<del>${this.parser.parseInline(t)}</del>`}link({href:t,title:i,tokens:r}){let a=this.parser.parseInline(r),l=p1(t);if(l===null)return a;t=l;let v='<a href="'+t+'"';return i&&(v+=' title="'+Xn(i)+'"'),v+=">"+a+"</a>",v}image({href:t,title:i,text:r,tokens:a}){a&&(r=this.parser.parseInline(a,this.parser.textRenderer));let l=p1(t);if(l===null)return Xn(r);t=l;let v=`<img src="${t}" alt="${r}"`;return i&&(v+=` title="${Xn(i)}"`),v+=">",v}text(t){return"tokens"in t&&t.tokens?this.parser.parseInline(t.tokens):"escaped"in t&&t.escaped?t.text:Xn(t.text)}},cg=class{strong({text:t}){return t}em({text:t}){return t}codespan({text:t}){return t}del({text:t}){return t}html({text:t}){return t}text({text:t}){return t}link({text:t}){return""+t}image({text:t}){return""+t}br(){return""}},jn=class up{options;renderer;textRenderer;constructor(i){this.options=i||Zs,this.options.renderer=this.options.renderer||new Cu,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new cg}static parse(i,r){return new up(r).parse(i)}static parseInline(i,r){return new up(r).parseInline(i)}parse(i,r=!0){let a="";for(let l=0;l<i.length;l++){let v=i[l];if(this.options.extensions?.renderers?.[v.type]){let c=v,u=this.options.extensions.renderers[c.type].call({parser:this},c);if(u!==!1||!["space","hr","heading","code","table","blockquote","list","html","def","paragraph","text"].includes(c.type)){a+=u||"";continue}}let m=v;switch(m.type){case"space":{a+=this.renderer.space(m);continue}case"hr":{a+=this.renderer.hr(m);continue}case"heading":{a+=this.renderer.heading(m);continue}case"code":{a+=this.renderer.code(m);continue}case"table":{a+=this.renderer.table(m);continue}case"blockquote":{a+=this.renderer.blockquote(m);continue}case"list":{a+=this.renderer.list(m);continue}case"html":{a+=this.renderer.html(m);continue}case"def":{a+=this.renderer.def(m);continue}case"paragraph":{a+=this.renderer.paragraph(m);continue}case"text":{let c=m,u=this.renderer.text(c);for(;l+1<i.length&&i[l+1].type==="text";)c=i[++l],u+=`
|
|
197
|
+
`+this.renderer.text(c);r?a+=this.renderer.paragraph({type:"paragraph",raw:u,text:u,tokens:[{type:"text",raw:u,text:u,escaped:!0}]}):a+=u;continue}default:{let c='Token with "'+m.type+'" type was not found.';if(this.options.silent)return console.error(c),"";throw new Error(c)}}}return a}parseInline(i,r=this.renderer){let a="";for(let l=0;l<i.length;l++){let v=i[l];if(this.options.extensions?.renderers?.[v.type]){let c=this.options.extensions.renderers[v.type].call({parser:this},v);if(c!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(v.type)){a+=c||"";continue}}let m=v;switch(m.type){case"escape":{a+=r.text(m);break}case"html":{a+=r.html(m);break}case"link":{a+=r.link(m);break}case"image":{a+=r.image(m);break}case"strong":{a+=r.strong(m);break}case"em":{a+=r.em(m);break}case"codespan":{a+=r.codespan(m);break}case"br":{a+=r.br(m);break}case"del":{a+=r.del(m);break}case"text":{a+=r.text(m);break}default:{let c='Token with "'+m.type+'" type was not found.';if(this.options.silent)return console.error(c),"";throw new Error(c)}}}return a}},cl=class{options;block;constructor(t){this.options=t||Zs}static passThroughHooks=new Set(["preprocess","postprocess","processAllTokens","emStrongMask"]);static passThroughHooksRespectAsync=new Set(["preprocess","postprocess","processAllTokens"]);preprocess(t){return t}postprocess(t){return t}processAllTokens(t){return t}emStrongMask(t){return t}provideLexer(){return this.block?In.lex:In.lexInline}provideParser(){return this.block?jn.parse:jn.parseInline}},rS=class{defaults=tg();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=jn;Renderer=Cu;TextRenderer=cg;Lexer=In;Tokenizer=Su;Hooks=cl;constructor(...t){this.use(...t)}walkTokens(t,i){let r=[];for(let a of t)switch(r=r.concat(i.call(this,a)),a.type){case"table":{let l=a;for(let v of l.header)r=r.concat(this.walkTokens(v.tokens,i));for(let v of l.rows)for(let m of v)r=r.concat(this.walkTokens(m.tokens,i));break}case"list":{let l=a;r=r.concat(this.walkTokens(l.items,i));break}default:{let l=a;this.defaults.extensions?.childTokens?.[l.type]?this.defaults.extensions.childTokens[l.type].forEach(v=>{let m=l[v].flat(1/0);r=r.concat(this.walkTokens(m,i))}):l.tokens&&(r=r.concat(this.walkTokens(l.tokens,i)))}}return r}use(...t){let i=this.defaults.extensions||{renderers:{},childTokens:{}};return t.forEach(r=>{let a={...r};if(a.async=this.defaults.async||a.async||!1,r.extensions&&(r.extensions.forEach(l=>{if(!l.name)throw new Error("extension name required");if("renderer"in l){let v=i.renderers[l.name];v?i.renderers[l.name]=function(...m){let c=l.renderer.apply(this,m);return c===!1&&(c=v.apply(this,m)),c}:i.renderers[l.name]=l.renderer}if("tokenizer"in l){if(!l.level||l.level!=="block"&&l.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let v=i[l.level];v?v.unshift(l.tokenizer):i[l.level]=[l.tokenizer],l.start&&(l.level==="block"?i.startBlock?i.startBlock.push(l.start):i.startBlock=[l.start]:l.level==="inline"&&(i.startInline?i.startInline.push(l.start):i.startInline=[l.start]))}"childTokens"in l&&l.childTokens&&(i.childTokens[l.name]=l.childTokens)}),a.extensions=i),r.renderer){let l=this.defaults.renderer||new Cu(this.defaults);for(let v in r.renderer){if(!(v in l))throw new Error(`renderer '${v}' does not exist`);if(["options","parser"].includes(v))continue;let m=v,c=r.renderer[m],u=l[m];l[m]=(...h)=>{let b=c.apply(l,h);return b===!1&&(b=u.apply(l,h)),b||""}}a.renderer=l}if(r.tokenizer){let l=this.defaults.tokenizer||new Su(this.defaults);for(let v in r.tokenizer){if(!(v in l))throw new Error(`tokenizer '${v}' does not exist`);if(["options","rules","lexer"].includes(v))continue;let m=v,c=r.tokenizer[m],u=l[m];l[m]=(...h)=>{let b=c.apply(l,h);return b===!1&&(b=u.apply(l,h)),b}}a.tokenizer=l}if(r.hooks){let l=this.defaults.hooks||new cl;for(let v in r.hooks){if(!(v in l))throw new Error(`hook '${v}' does not exist`);if(["options","block"].includes(v))continue;let m=v,c=r.hooks[m],u=l[m];cl.passThroughHooks.has(v)?l[m]=h=>{if(this.defaults.async&&cl.passThroughHooksRespectAsync.has(v))return(async()=>{let p=await c.call(l,h);return u.call(l,p)})();let b=c.call(l,h);return u.call(l,b)}:l[m]=(...h)=>{if(this.defaults.async)return(async()=>{let p=await c.apply(l,h);return p===!1&&(p=await u.apply(l,h)),p})();let b=c.apply(l,h);return b===!1&&(b=u.apply(l,h)),b}}a.hooks=l}if(r.walkTokens){let l=this.defaults.walkTokens,v=r.walkTokens;a.walkTokens=function(m){let c=[];return c.push(v.call(this,m)),l&&(c=c.concat(l.call(this,m))),c}}this.defaults={...this.defaults,...a}}),this}setOptions(t){return this.defaults={...this.defaults,...t},this}lexer(t,i){return In.lex(t,i??this.defaults)}parser(t,i){return jn.parse(t,i??this.defaults)}parseMarkdown(t){return(i,r)=>{let a={...r},l={...this.defaults,...a},v=this.onError(!!l.silent,!!l.async);if(this.defaults.async===!0&&a.async===!1)return v(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 i>"u"||i===null)return v(new Error("marked(): input parameter is undefined or null"));if(typeof i!="string")return v(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(i)+", string expected"));if(l.hooks&&(l.hooks.options=l,l.hooks.block=t),l.async)return(async()=>{let m=l.hooks?await l.hooks.preprocess(i):i,c=await(l.hooks?await l.hooks.provideLexer():t?In.lex:In.lexInline)(m,l),u=l.hooks?await l.hooks.processAllTokens(c):c;l.walkTokens&&await Promise.all(this.walkTokens(u,l.walkTokens));let h=await(l.hooks?await l.hooks.provideParser():t?jn.parse:jn.parseInline)(u,l);return l.hooks?await l.hooks.postprocess(h):h})().catch(v);try{l.hooks&&(i=l.hooks.preprocess(i));let m=(l.hooks?l.hooks.provideLexer():t?In.lex:In.lexInline)(i,l);l.hooks&&(m=l.hooks.processAllTokens(m)),l.walkTokens&&this.walkTokens(m,l.walkTokens);let c=(l.hooks?l.hooks.provideParser():t?jn.parse:jn.parseInline)(m,l);return l.hooks&&(c=l.hooks.postprocess(c)),c}catch(m){return v(m)}}}onError(t,i){return r=>{if(r.message+=`
|
|
198
|
+
Please report this to https://github.com/markedjs/marked.`,t){let a="<p>An error occurred:</p><pre>"+Xn(r.message+"",!0)+"</pre>";return i?Promise.resolve(a):a}if(i)return Promise.reject(r);throw r}}},Vs=new rS;function bt(t,i){return Vs.parse(t,i)}bt.options=bt.setOptions=function(t){return Vs.setOptions(t),bt.defaults=Vs.defaults,Ky(bt.defaults),bt};bt.getDefaults=tg;bt.defaults=Zs;bt.use=function(...t){return Vs.use(...t),bt.defaults=Vs.defaults,Ky(bt.defaults),bt};bt.walkTokens=function(t,i){return Vs.walkTokens(t,i)};bt.parseInline=Vs.parseInline;bt.Parser=jn;bt.parser=jn.parse;bt.Renderer=Cu;bt.TextRenderer=cg;bt.Lexer=In;bt.lexer=In.lex;bt.Tokenizer=Su;bt.Hooks=cl;bt.parse=bt;bt.options;bt.setOptions;bt.use;bt.walkTokens;bt.parseInline;jn.parse;In.lex;const{entries:sS,setPrototypeOf:_1,isFrozen:Pk,getPrototypeOf:Fk,getOwnPropertyDescriptor:qk}=Object;let{freeze:ji,seal:kn,create:$a}=Object,{apply:hp,construct:dp}=typeof Reflect<"u"&&Reflect;ji||(ji=function(i){return i});kn||(kn=function(i){return i});hp||(hp=function(i,r){for(var a=arguments.length,l=new Array(a>2?a-2:0),v=2;v<a;v++)l[v-2]=arguments[v];return i.apply(r,l)});dp||(dp=function(i){for(var r=arguments.length,a=new Array(r>1?r-1:0),l=1;l<r;l++)a[l-1]=arguments[l];return new i(...a)});const nl=ui(Array.prototype.forEach),Wk=ui(Array.prototype.lastIndexOf),v1=ui(Array.prototype.pop),rl=ui(Array.prototype.push),Gk=ui(Array.prototype.splice),Bi=Array.isArray,ul=ui(String.prototype.toLowerCase),xf=ui(String.prototype.toString),b1=ui(String.prototype.match),Ia=ui(String.prototype.replace),y1=ui(String.prototype.indexOf),Kk=ui(String.prototype.trim),Yk=ui(Number.prototype.toString),Vk=ui(Boolean.prototype.toString),S1=typeof BigInt>"u"?null:ui(BigInt.prototype.toString),C1=typeof Symbol>"u"?null:ui(Symbol.prototype.toString),Wt=ui(Object.prototype.hasOwnProperty),sl=ui(Object.prototype.toString),Ti=ui(RegExp.prototype.test),Vc=Xk(TypeError);function ui(t){return function(i){i instanceof RegExp&&(i.lastIndex=0);for(var r=arguments.length,a=new Array(r>1?r-1:0),l=1;l<r;l++)a[l-1]=arguments[l];return hp(t,i,a)}}function Xk(t){return function(){for(var i=arguments.length,r=new Array(i),a=0;a<i;a++)r[a]=arguments[a];return dp(t,r)}}function Ge(t,i){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:ul;if(_1&&_1(t,null),!Bi(i))return t;let a=i.length;for(;a--;){let l=i[a];if(typeof l=="string"){const v=r(l);v!==l&&(Pk(i)||(i[a]=v),l=v)}t[l]=!0}return t}function Zk(t){for(let i=0;i<t.length;i++)Wt(t,i)||(t[i]=null);return t}function Vi(t){const i=$a(null);for(const[r,a]of sS(t))Wt(t,r)&&(Bi(a)?i[r]=Zk(a):a&&typeof a=="object"&&a.constructor===Object?i[r]=Vi(a):i[r]=a);return i}function Jk(t){switch(typeof t){case"string":return t;case"number":return Yk(t);case"boolean":return Vk(t);case"bigint":return S1?S1(t):"0";case"symbol":return C1?C1(t):"Symbol()";case"undefined":return sl(t);case"function":case"object":{if(t===null)return sl(t);const i=t,r=Ha(i,"toString");if(typeof r=="function"){const a=r(i);return typeof a=="string"?a:sl(a)}return sl(t)}default:return sl(t)}}function Ha(t,i){for(;t!==null;){const a=qk(t,i);if(a){if(a.get)return ui(a.get);if(typeof a.value=="function")return ui(a.value)}t=Fk(t)}function r(){return null}return r}function Qk(t){try{return Ti(t,""),!0}catch{return!1}}const w1=ji(["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"]),Ef=ji(["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"]),Tf=ji(["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"]),eR=ji(["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"]),Af=ji(["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"]),tR=ji(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),x1=ji(["#text"]),E1=ji(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","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"]),kf=ji(["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","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","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-rendering","textlength","type","u1","u2","unicode","values","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"]),T1=ji(["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"]),Xc=ji(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),iR=kn(/\{\{[\w\W]*|[\w\W]*\}\}/gm),nR=kn(/<%[\w\W]*|[\w\W]*%>/gm),rR=kn(/\$\{[\w\W]*/gm),sR=kn(/^data-[\-\w.\u00B7-\uFFFF]+$/),aR=kn(/^aria-[\-\w]+$/),aS=kn(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),oR=kn(/^(?:\w+script|data):/i),lR=kn(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),oS=kn(/^html$/i),cR=kn(/^[a-z][.\w]*(-[.\w]+)+$/i);var A1=Object.freeze({__proto__:null,ARIA_ATTR:aR,ATTR_WHITESPACE:lR,CUSTOM_ELEMENT:cR,DATA_ATTR:sR,DOCTYPE_NAME:oS,ERB_EXPR:nR,IS_ALLOWED_URI:aS,IS_SCRIPT_OR_DATA:oR,MUSTACHE_EXPR:iR,TMPLIT_EXPR:rR});const al={element:1,text:3,progressingInstruction:7,comment:8,document:9},uR=function(){return typeof window>"u"?null:window},hR=function(i,r){if(typeof i!="object"||typeof i.createPolicy!="function")return null;let a=null;const l="data-tt-policy-suffix";r&&r.hasAttribute(l)&&(a=r.getAttribute(l));const v="dompurify"+(a?"#"+a:"");try{return i.createPolicy(v,{createHTML(m){return m},createScriptURL(m){return m}})}catch{return console.warn("TrustedTypes policy "+v+" could not be created."),null}},k1=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function lS(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:uR();const i=De=>lS(De);if(i.version="3.4.2",i.removed=[],!t||!t.document||t.document.nodeType!==al.document||!t.Element)return i.isSupported=!1,i;let{document:r}=t;const a=r,l=a.currentScript,{DocumentFragment:v,HTMLTemplateElement:m,Node:c,Element:u,NodeFilter:h,NamedNodeMap:b=t.NamedNodeMap||t.MozNamedAttrMap,HTMLFormElement:p,DOMParser:C,trustedTypes:w}=t,A=u.prototype,x=Ha(A,"cloneNode"),g=Ha(A,"remove"),y=Ha(A,"nextSibling"),f=Ha(A,"childNodes"),_=Ha(A,"parentNode");if(typeof m=="function"){const De=r.createElement("template");De.content&&De.content.ownerDocument&&(r=De.content.ownerDocument)}let E,L="";const{implementation:R,createNodeIterator:D,createDocumentFragment:k,getElementsByTagName:N}=r,{importNode:W}=a;let U=k1();i.isSupported=typeof sS=="function"&&typeof _=="function"&&R&&R.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:F,ERB_EXPR:j,TMPLIT_EXPR:J,DATA_ATTR:te,ARIA_ATTR:P,IS_SCRIPT_OR_DATA:V,ATTR_WHITESPACE:Y,CUSTOM_ELEMENT:B}=A1;let{IS_ALLOWED_URI:z}=A1,O=null;const H=Ge({},[...w1,...Ef,...Tf,...Af,...x1]);let X=null;const ae=Ge({},[...E1,...kf,...T1,...Xc]);let ce=Object.seal($a(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}})),_e=null,Q=null;const $=Object.seal($a(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let oe=!0,ge=!0,ye=!1,be=!0,$e=!1,Pe=!0,Ye=!1,Ct=!1,Be=!1,Qt=!1,_i=!1,vi=!1,fn=!0,Rn=!1;const ei="user-content-";let ct=!0,Kt=!1,jt={},zt=null;const ti=Ge({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let Ln=null;const ki=Ge({},["audio","video","img","source","image","track"]);let en=null;const ht=Ge({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),zi="http://www.w3.org/1998/Math/MathML",Yt="http://www.w3.org/2000/svg",Vt="http://www.w3.org/1999/xhtml";let $t=Vt,vs=!1,rr=null;const Js=Ge({},[zi,Yt,Vt],xf);let Mn=Ge({},["mi","mo","mn","ms","mtext"]),Fn=Ge({},["annotation-xml"]);const sr=Ge({},["title","style","font","a","script"]);let ii=null;const Z=["application/xhtml+xml","text/html"],he="text/html";let ve=null,Ie=null;const yt=r.createElement("form"),dt=function(G){return G instanceof RegExp||G instanceof Function},Ee=function(){let G=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(Ie&&Ie===G)return;(!G||typeof G!="object")&&(G={}),G=Vi(G),ii=Z.indexOf(G.PARSER_MEDIA_TYPE)===-1?he:G.PARSER_MEDIA_TYPE,ve=ii==="application/xhtml+xml"?xf:ul,O=Wt(G,"ALLOWED_TAGS")&&Bi(G.ALLOWED_TAGS)?Ge({},G.ALLOWED_TAGS,ve):H,X=Wt(G,"ALLOWED_ATTR")&&Bi(G.ALLOWED_ATTR)?Ge({},G.ALLOWED_ATTR,ve):ae,rr=Wt(G,"ALLOWED_NAMESPACES")&&Bi(G.ALLOWED_NAMESPACES)?Ge({},G.ALLOWED_NAMESPACES,xf):Js,en=Wt(G,"ADD_URI_SAFE_ATTR")&&Bi(G.ADD_URI_SAFE_ATTR)?Ge(Vi(ht),G.ADD_URI_SAFE_ATTR,ve):ht,Ln=Wt(G,"ADD_DATA_URI_TAGS")&&Bi(G.ADD_DATA_URI_TAGS)?Ge(Vi(ki),G.ADD_DATA_URI_TAGS,ve):ki,zt=Wt(G,"FORBID_CONTENTS")&&Bi(G.FORBID_CONTENTS)?Ge({},G.FORBID_CONTENTS,ve):ti,_e=Wt(G,"FORBID_TAGS")&&Bi(G.FORBID_TAGS)?Ge({},G.FORBID_TAGS,ve):Vi({}),Q=Wt(G,"FORBID_ATTR")&&Bi(G.FORBID_ATTR)?Ge({},G.FORBID_ATTR,ve):Vi({}),jt=Wt(G,"USE_PROFILES")?G.USE_PROFILES&&typeof G.USE_PROFILES=="object"?Vi(G.USE_PROFILES):G.USE_PROFILES:!1,oe=G.ALLOW_ARIA_ATTR!==!1,ge=G.ALLOW_DATA_ATTR!==!1,ye=G.ALLOW_UNKNOWN_PROTOCOLS||!1,be=G.ALLOW_SELF_CLOSE_IN_ATTR!==!1,$e=G.SAFE_FOR_TEMPLATES||!1,Pe=G.SAFE_FOR_XML!==!1,Ye=G.WHOLE_DOCUMENT||!1,Qt=G.RETURN_DOM||!1,_i=G.RETURN_DOM_FRAGMENT||!1,vi=G.RETURN_TRUSTED_TYPE||!1,Be=G.FORCE_BODY||!1,fn=G.SANITIZE_DOM!==!1,Rn=G.SANITIZE_NAMED_PROPS||!1,ct=G.KEEP_CONTENT!==!1,Kt=G.IN_PLACE||!1,z=Qk(G.ALLOWED_URI_REGEXP)?G.ALLOWED_URI_REGEXP:aS,$t=typeof G.NAMESPACE=="string"?G.NAMESPACE:Vt,Mn=Wt(G,"MATHML_TEXT_INTEGRATION_POINTS")&&G.MATHML_TEXT_INTEGRATION_POINTS&&typeof G.MATHML_TEXT_INTEGRATION_POINTS=="object"?Vi(G.MATHML_TEXT_INTEGRATION_POINTS):Ge({},["mi","mo","mn","ms","mtext"]),Fn=Wt(G,"HTML_INTEGRATION_POINTS")&&G.HTML_INTEGRATION_POINTS&&typeof G.HTML_INTEGRATION_POINTS=="object"?Vi(G.HTML_INTEGRATION_POINTS):Ge({},["annotation-xml"]);const pe=Wt(G,"CUSTOM_ELEMENT_HANDLING")&&G.CUSTOM_ELEMENT_HANDLING&&typeof G.CUSTOM_ELEMENT_HANDLING=="object"?Vi(G.CUSTOM_ELEMENT_HANDLING):$a(null);if(ce=$a(null),Wt(pe,"tagNameCheck")&&dt(pe.tagNameCheck)&&(ce.tagNameCheck=pe.tagNameCheck),Wt(pe,"attributeNameCheck")&&dt(pe.attributeNameCheck)&&(ce.attributeNameCheck=pe.attributeNameCheck),Wt(pe,"allowCustomizedBuiltInElements")&&typeof pe.allowCustomizedBuiltInElements=="boolean"&&(ce.allowCustomizedBuiltInElements=pe.allowCustomizedBuiltInElements),$e&&(ge=!1),_i&&(Qt=!0),jt&&(O=Ge({},x1),X=$a(null),jt.html===!0&&(Ge(O,w1),Ge(X,E1)),jt.svg===!0&&(Ge(O,Ef),Ge(X,kf),Ge(X,Xc)),jt.svgFilters===!0&&(Ge(O,Tf),Ge(X,kf),Ge(X,Xc)),jt.mathMl===!0&&(Ge(O,Af),Ge(X,T1),Ge(X,Xc))),$.tagCheck=null,$.attributeCheck=null,Wt(G,"ADD_TAGS")&&(typeof G.ADD_TAGS=="function"?$.tagCheck=G.ADD_TAGS:Bi(G.ADD_TAGS)&&(O===H&&(O=Vi(O)),Ge(O,G.ADD_TAGS,ve))),Wt(G,"ADD_ATTR")&&(typeof G.ADD_ATTR=="function"?$.attributeCheck=G.ADD_ATTR:Bi(G.ADD_ATTR)&&(X===ae&&(X=Vi(X)),Ge(X,G.ADD_ATTR,ve))),Wt(G,"ADD_URI_SAFE_ATTR")&&Bi(G.ADD_URI_SAFE_ATTR)&&Ge(en,G.ADD_URI_SAFE_ATTR,ve),Wt(G,"FORBID_CONTENTS")&&Bi(G.FORBID_CONTENTS)&&(zt===ti&&(zt=Vi(zt)),Ge(zt,G.FORBID_CONTENTS,ve)),Wt(G,"ADD_FORBID_CONTENTS")&&Bi(G.ADD_FORBID_CONTENTS)&&(zt===ti&&(zt=Vi(zt)),Ge(zt,G.ADD_FORBID_CONTENTS,ve)),ct&&(O["#text"]=!0),Ye&&Ge(O,["html","head","body"]),O.table&&(Ge(O,["tbody"]),delete _e.tbody),G.TRUSTED_TYPES_POLICY){if(typeof G.TRUSTED_TYPES_POLICY.createHTML!="function")throw Vc('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof G.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw Vc('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');E=G.TRUSTED_TYPES_POLICY,L=E.createHTML("")}else E===void 0&&(E=hR(w,l)),E!==null&&typeof L=="string"&&(L=E.createHTML(""));ji&&ji(G),Ie=G},we=Ge({},[...Ef,...Tf,...eR]),je=Ge({},[...Af,...tR]),Nt=function(G){let pe=_(G);(!pe||!pe.tagName)&&(pe={namespaceURI:$t,tagName:"template"});const xe=ul(G.tagName),nt=ul(pe.tagName);return rr[G.namespaceURI]?G.namespaceURI===Yt?pe.namespaceURI===Vt?xe==="svg":pe.namespaceURI===zi?xe==="svg"&&(nt==="annotation-xml"||Mn[nt]):!!we[xe]:G.namespaceURI===zi?pe.namespaceURI===Vt?xe==="math":pe.namespaceURI===Yt?xe==="math"&&Fn[nt]:!!je[xe]:G.namespaceURI===Vt?pe.namespaceURI===Yt&&!Fn[nt]||pe.namespaceURI===zi&&!Mn[nt]?!1:!je[xe]&&(sr[xe]||!we[xe]):!!(ii==="application/xhtml+xml"&&rr[G.namespaceURI]):!1},Qe=function(G){rl(i.removed,{element:G});try{_(G).removeChild(G)}catch{g(G)}},bi=function(G,pe){try{rl(i.removed,{attribute:pe.getAttributeNode(G),from:pe})}catch{rl(i.removed,{attribute:null,from:pe})}if(pe.removeAttribute(G),G==="is")if(Qt||_i)try{Qe(pe)}catch{}else try{pe.setAttribute(G,"")}catch{}},ar=function(G){let pe=null,xe=null;if(Be)G="<remove></remove>"+G;else{const Tt=b1(G,/^[\r\n\t ]+/);xe=Tt&&Tt[0]}ii==="application/xhtml+xml"&&$t===Vt&&(G='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+G+"</body></html>");const nt=E?E.createHTML(G):G;if($t===Vt)try{pe=new C().parseFromString(nt,ii)}catch{}if(!pe||!pe.documentElement){pe=R.createDocument($t,"template",null);try{pe.documentElement.innerHTML=vs?L:nt}catch{}}const Ve=pe.body||pe.documentElement;return G&&xe&&Ve.insertBefore(r.createTextNode(xe),Ve.childNodes[0]||null),$t===Vt?N.call(pe,Ye?"html":"body")[0]:Ye?pe.documentElement:Ve},or=function(G){return D.call(G.ownerDocument||G,G,h.SHOW_ELEMENT|h.SHOW_COMMENT|h.SHOW_TEXT|h.SHOW_PROCESSING_INSTRUCTION|h.SHOW_CDATA_SECTION,null)},$i=function(G){return G instanceof p&&(typeof G.nodeName!="string"||typeof G.textContent!="string"||typeof G.removeChild!="function"||!(G.attributes instanceof b)||typeof G.removeAttribute!="function"||typeof G.setAttribute!="function"||typeof G.namespaceURI!="string"||typeof G.insertBefore!="function"||typeof G.hasChildNodes!="function")},Et=function(G){return typeof c=="function"&&G instanceof c};function wt(De,G,pe){nl(De,xe=>{xe.call(i,G,pe,Ie)})}const Dn=function(G){let pe=null;if(wt(U.beforeSanitizeElements,G,null),$i(G))return Qe(G),!0;const xe=ve(G.nodeName);if(wt(U.uponSanitizeElement,G,{tagName:xe,allowedTags:O}),Pe&&G.hasChildNodes()&&!Et(G.firstElementChild)&&Ti(/<[/\w!]/g,G.innerHTML)&&Ti(/<[/\w!]/g,G.textContent)||Pe&&G.namespaceURI===Vt&&xe==="style"&&Et(G.firstElementChild)||G.nodeType===al.progressingInstruction||Pe&&G.nodeType===al.comment&&Ti(/<[/\w]/g,G.data))return Qe(G),!0;if(_e[xe]||!($.tagCheck instanceof Function&&$.tagCheck(xe))&&!O[xe]){if(!_e[xe]&&lr(xe)&&(ce.tagNameCheck instanceof RegExp&&Ti(ce.tagNameCheck,xe)||ce.tagNameCheck instanceof Function&&ce.tagNameCheck(xe)))return!1;if(ct&&!zt[xe]){const nt=_(G)||G.parentNode,Ve=f(G)||G.childNodes;if(Ve&&nt){const Tt=Ve.length;for(let Ht=Tt-1;Ht>=0;--Ht){const Ut=x(Ve[Ht],!0);nt.insertBefore(Ut,y(G))}}}return Qe(G),!0}return G instanceof u&&!Nt(G)||(xe==="noscript"||xe==="noembed"||xe==="noframes")&&Ti(/<\/no(script|embed|frames)/i,G.innerHTML)?(Qe(G),!0):($e&&G.nodeType===al.text&&(pe=G.textContent,nl([F,j,J],nt=>{pe=Ia(pe,nt," ")}),G.textContent!==pe&&(rl(i.removed,{element:G.cloneNode()}),G.textContent=pe)),wt(U.afterSanitizeElements,G,null),!1)},Ir=function(G,pe,xe){if(Q[pe]||fn&&(pe==="id"||pe==="name")&&(xe in r||xe in yt))return!1;const nt=X[pe]||$.attributeCheck instanceof Function&&$.attributeCheck(pe,G);if(!(ge&&!Q[pe]&&Ti(te,pe))){if(!(oe&&Ti(P,pe))){if(!nt||Q[pe]){if(!(lr(G)&&(ce.tagNameCheck instanceof RegExp&&Ti(ce.tagNameCheck,G)||ce.tagNameCheck instanceof Function&&ce.tagNameCheck(G))&&(ce.attributeNameCheck instanceof RegExp&&Ti(ce.attributeNameCheck,pe)||ce.attributeNameCheck instanceof Function&&ce.attributeNameCheck(pe,G))||pe==="is"&&ce.allowCustomizedBuiltInElements&&(ce.tagNameCheck instanceof RegExp&&Ti(ce.tagNameCheck,xe)||ce.tagNameCheck instanceof Function&&ce.tagNameCheck(xe))))return!1}else if(!en[pe]){if(!Ti(z,Ia(xe,Y,""))){if(!((pe==="src"||pe==="xlink:href"||pe==="href")&&G!=="script"&&y1(xe,"data:")===0&&Ln[G])){if(!(ye&&!Ti(V,Ia(xe,Y,"")))){if(xe)return!1}}}}}}return!0},Qs=Ge({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),lr=function(G){return!Qs[ul(G)]&&Ti(B,G)},bs=function(G){wt(U.beforeSanitizeAttributes,G,null);const{attributes:pe}=G;if(!pe||$i(G))return;const xe={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:X,forceKeepAttr:void 0};let nt=pe.length;for(;nt--;){const Ve=pe[nt],{name:Tt,namespaceURI:Ht,value:Ut}=Ve,me=ve(Tt),Le=Ut;let Oe=Tt==="value"?Le:Kk(Le);if(xe.attrName=me,xe.attrValue=Oe,xe.keepAttr=!0,xe.forceKeepAttr=void 0,wt(U.uponSanitizeAttribute,G,xe),Oe=xe.attrValue,Rn&&(me==="id"||me==="name")&&y1(Oe,ei)!==0&&(bi(Tt,G),Oe=ei+Oe),Pe&&Ti(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,Oe)){bi(Tt,G);continue}if(me==="attributename"&&b1(Oe,"href")){bi(Tt,G);continue}if(xe.forceKeepAttr)continue;if(!xe.keepAttr){bi(Tt,G);continue}if(!be&&Ti(/\/>/i,Oe)){bi(Tt,G);continue}$e&&nl([F,j,J],Mt=>{Oe=Ia(Oe,Mt," ")});const st=ve(G.nodeName);if(!Ir(st,me,Oe)){bi(Tt,G);continue}if(E&&typeof w=="object"&&typeof w.getAttributeType=="function"&&!Ht)switch(w.getAttributeType(st,me)){case"TrustedHTML":{Oe=E.createHTML(Oe);break}case"TrustedScriptURL":{Oe=E.createScriptURL(Oe);break}}if(Oe!==Le)try{Ht?G.setAttributeNS(Ht,Tt,Oe):G.setAttribute(Tt,Oe),$i(G)?Qe(G):v1(i.removed)}catch{bi(Tt,G)}}wt(U.afterSanitizeAttributes,G,null)},qn=function(G){let pe=null;const xe=or(G);for(wt(U.beforeSanitizeShadowDOM,G,null);pe=xe.nextNode();)wt(U.uponSanitizeShadowNode,pe,null),Dn(pe),bs(pe),pe.content instanceof v&&qn(pe.content);wt(U.afterSanitizeShadowDOM,G,null)};return i.sanitize=function(De){let G=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},pe=null,xe=null,nt=null,Ve=null;if(vs=!De,vs&&(De="<!-->"),typeof De!="string"&&!Et(De)&&(De=Jk(De),typeof De!="string"))throw Vc("dirty is not a string, aborting");if(!i.isSupported)return De;if(Ct||Ee(G),i.removed=[],typeof De=="string"&&(Kt=!1),Kt){const Ut=De.nodeName;if(typeof Ut=="string"){const me=ve(Ut);if(!O[me]||_e[me])throw Vc("root node is forbidden and cannot be sanitized in-place")}}else if(De instanceof c)pe=ar("<!---->"),xe=pe.ownerDocument.importNode(De,!0),xe.nodeType===al.element&&xe.nodeName==="BODY"||xe.nodeName==="HTML"?pe=xe:pe.appendChild(xe);else{if(!Qt&&!$e&&!Ye&&De.indexOf("<")===-1)return E&&vi?E.createHTML(De):De;if(pe=ar(De),!pe)return Qt?null:vi?L:""}pe&&Be&&Qe(pe.firstChild);const Tt=or(Kt?De:pe);for(;nt=Tt.nextNode();)Dn(nt),bs(nt),nt.content instanceof v&&qn(nt.content);if(Kt)return De;if(Qt){if($e){pe.normalize();let Ut=pe.innerHTML;nl([F,j,J],me=>{Ut=Ia(Ut,me," ")}),pe.innerHTML=Ut}if(_i)for(Ve=k.call(pe.ownerDocument);pe.firstChild;)Ve.appendChild(pe.firstChild);else Ve=pe;return(X.shadowroot||X.shadowrootmode)&&(Ve=W.call(a,Ve,!0)),Ve}let Ht=Ye?pe.outerHTML:pe.innerHTML;return Ye&&O["!doctype"]&&pe.ownerDocument&&pe.ownerDocument.doctype&&pe.ownerDocument.doctype.name&&Ti(oS,pe.ownerDocument.doctype.name)&&(Ht="<!DOCTYPE "+pe.ownerDocument.doctype.name+`>
|
|
199
|
+
`+Ht),$e&&nl([F,j,J],Ut=>{Ht=Ia(Ht,Ut," ")}),E&&vi?E.createHTML(Ht):Ht},i.setConfig=function(){let De=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Ee(De),Ct=!0},i.clearConfig=function(){Ie=null,Ct=!1},i.isValidAttribute=function(De,G,pe){Ie||Ee({});const xe=ve(De),nt=ve(G);return Ir(xe,nt,pe)},i.addHook=function(De,G){typeof G=="function"&&rl(U[De],G)},i.removeHook=function(De,G){if(G!==void 0){const pe=Wk(U[De],G);return pe===-1?void 0:Gk(U[De],pe,1)[0]}return v1(U[De])},i.removeHooks=function(De){U[De]=[]},i.removeAllHooks=function(){U=k1()},i}var gl=lS(),Rf,R1;function dR(){if(R1)return Rf;R1=1;function t(Z){return Z instanceof Map?Z.clear=Z.delete=Z.set=function(){throw new Error("map is read-only")}:Z instanceof Set&&(Z.add=Z.clear=Z.delete=function(){throw new Error("set is read-only")}),Object.freeze(Z),Object.getOwnPropertyNames(Z).forEach(he=>{const ve=Z[he],Ie=typeof ve;(Ie==="object"||Ie==="function")&&!Object.isFrozen(ve)&&t(ve)}),Z}class i{constructor(he){he.data===void 0&&(he.data={}),this.data=he.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function r(Z){return Z.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function a(Z,...he){const ve=Object.create(null);for(const Ie in Z)ve[Ie]=Z[Ie];return he.forEach(function(Ie){for(const yt in Ie)ve[yt]=Ie[yt]}),ve}const l="</span>",v=Z=>!!Z.scope,m=(Z,{prefix:he})=>{if(Z.startsWith("language:"))return Z.replace("language:","language-");if(Z.includes(".")){const ve=Z.split(".");return[`${he}${ve.shift()}`,...ve.map((Ie,yt)=>`${Ie}${"_".repeat(yt+1)}`)].join(" ")}return`${he}${Z}`};class c{constructor(he,ve){this.buffer="",this.classPrefix=ve.classPrefix,he.walk(this)}addText(he){this.buffer+=r(he)}openNode(he){if(!v(he))return;const ve=m(he.scope,{prefix:this.classPrefix});this.span(ve)}closeNode(he){v(he)&&(this.buffer+=l)}value(){return this.buffer}span(he){this.buffer+=`<span class="${he}">`}}const u=(Z={})=>{const he={children:[]};return Object.assign(he,Z),he};class h{constructor(){this.rootNode=u(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(he){this.top.children.push(he)}openNode(he){const ve=u({scope:he});this.add(ve),this.stack.push(ve)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(he){return this.constructor._walk(he,this.rootNode)}static _walk(he,ve){return typeof ve=="string"?he.addText(ve):ve.children&&(he.openNode(ve),ve.children.forEach(Ie=>this._walk(he,Ie)),he.closeNode(ve)),he}static _collapse(he){typeof he!="string"&&he.children&&(he.children.every(ve=>typeof ve=="string")?he.children=[he.children.join("")]:he.children.forEach(ve=>{h._collapse(ve)}))}}class b extends h{constructor(he){super(),this.options=he}addText(he){he!==""&&this.add(he)}startScope(he){this.openNode(he)}endScope(){this.closeNode()}__addSublanguage(he,ve){const Ie=he.root;ve&&(Ie.scope=`language:${ve}`),this.add(Ie)}toHTML(){return new c(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}}function p(Z){return Z?typeof Z=="string"?Z:Z.source:null}function C(Z){return x("(?=",Z,")")}function w(Z){return x("(?:",Z,")*")}function A(Z){return x("(?:",Z,")?")}function x(...Z){return Z.map(ve=>p(ve)).join("")}function g(Z){const he=Z[Z.length-1];return typeof he=="object"&&he.constructor===Object?(Z.splice(Z.length-1,1),he):{}}function y(...Z){return"("+(g(Z).capture?"":"?:")+Z.map(Ie=>p(Ie)).join("|")+")"}function f(Z){return new RegExp(Z.toString()+"|").exec("").length-1}function _(Z,he){const ve=Z&&Z.exec(he);return ve&&ve.index===0}const E=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function L(Z,{joinWith:he}){let ve=0;return Z.map(Ie=>{ve+=1;const yt=ve;let dt=p(Ie),Ee="";for(;dt.length>0;){const we=E.exec(dt);if(!we){Ee+=dt;break}Ee+=dt.substring(0,we.index),dt=dt.substring(we.index+we[0].length),we[0][0]==="\\"&&we[1]?Ee+="\\"+String(Number(we[1])+yt):(Ee+=we[0],we[0]==="("&&ve++)}return Ee}).map(Ie=>`(${Ie})`).join(he)}const R=/\b\B/,D="[a-zA-Z]\\w*",k="[a-zA-Z_]\\w*",N="\\b\\d+(\\.\\d+)?",W="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",U="\\b(0b[01]+)",F="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",j=(Z={})=>{const he=/^#![ ]*\//;return Z.binary&&(Z.begin=x(he,/.*\b/,Z.binary,/\b.*/)),a({scope:"meta",begin:he,end:/$/,relevance:0,"on:begin":(ve,Ie)=>{ve.index!==0&&Ie.ignoreMatch()}},Z)},J={begin:"\\\\[\\s\\S]",relevance:0},te={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[J]},P={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[J]},V={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/},Y=function(Z,he,ve={}){const Ie=a({scope:"comment",begin:Z,end:he,contains:[]},ve);Ie.contains.push({scope:"doctag",begin:"[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)",end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0});const yt=y("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 Ie.contains.push({begin:x(/[ ]+/,"(",yt,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),Ie},B=Y("//","$"),z=Y("/\\*","\\*/"),O=Y("#","$"),H={scope:"number",begin:N,relevance:0},X={scope:"number",begin:W,relevance:0},ae={scope:"number",begin:U,relevance:0},ce={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[J,{begin:/\[/,end:/\]/,relevance:0,contains:[J]}]},_e={scope:"title",begin:D,relevance:0},Q={scope:"title",begin:k,relevance:0},$={begin:"\\.\\s*"+k,relevance:0};var ge=Object.freeze({__proto__:null,APOS_STRING_MODE:te,BACKSLASH_ESCAPE:J,BINARY_NUMBER_MODE:ae,BINARY_NUMBER_RE:U,COMMENT:Y,C_BLOCK_COMMENT_MODE:z,C_LINE_COMMENT_MODE:B,C_NUMBER_MODE:X,C_NUMBER_RE:W,END_SAME_AS_BEGIN:function(Z){return Object.assign(Z,{"on:begin":(he,ve)=>{ve.data._beginMatch=he[1]},"on:end":(he,ve)=>{ve.data._beginMatch!==he[1]&&ve.ignoreMatch()}})},HASH_COMMENT_MODE:O,IDENT_RE:D,MATCH_NOTHING_RE:R,METHOD_GUARD:$,NUMBER_MODE:H,NUMBER_RE:N,PHRASAL_WORDS_MODE:V,QUOTE_STRING_MODE:P,REGEXP_MODE:ce,RE_STARTERS_RE:F,SHEBANG:j,TITLE_MODE:_e,UNDERSCORE_IDENT_RE:k,UNDERSCORE_TITLE_MODE:Q});function ye(Z,he){Z.input[Z.index-1]==="."&&he.ignoreMatch()}function be(Z,he){Z.className!==void 0&&(Z.scope=Z.className,delete Z.className)}function $e(Z,he){he&&Z.beginKeywords&&(Z.begin="\\b("+Z.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",Z.__beforeBegin=ye,Z.keywords=Z.keywords||Z.beginKeywords,delete Z.beginKeywords,Z.relevance===void 0&&(Z.relevance=0))}function Pe(Z,he){Array.isArray(Z.illegal)&&(Z.illegal=y(...Z.illegal))}function Ye(Z,he){if(Z.match){if(Z.begin||Z.end)throw new Error("begin & end are not supported with match");Z.begin=Z.match,delete Z.match}}function Ct(Z,he){Z.relevance===void 0&&(Z.relevance=1)}const Be=(Z,he)=>{if(!Z.beforeMatch)return;if(Z.starts)throw new Error("beforeMatch cannot be used with starts");const ve=Object.assign({},Z);Object.keys(Z).forEach(Ie=>{delete Z[Ie]}),Z.keywords=ve.keywords,Z.begin=x(ve.beforeMatch,C(ve.begin)),Z.starts={relevance:0,contains:[Object.assign(ve,{endsParent:!0})]},Z.relevance=0,delete ve.beforeMatch},Qt=["of","and","for","in","not","or","if","then","parent","list","value"],_i="keyword";function vi(Z,he,ve=_i){const Ie=Object.create(null);return typeof Z=="string"?yt(ve,Z.split(" ")):Array.isArray(Z)?yt(ve,Z):Object.keys(Z).forEach(function(dt){Object.assign(Ie,vi(Z[dt],he,dt))}),Ie;function yt(dt,Ee){he&&(Ee=Ee.map(we=>we.toLowerCase())),Ee.forEach(function(we){const je=we.split("|");Ie[je[0]]=[dt,fn(je[0],je[1])]})}}function fn(Z,he){return he?Number(he):Rn(Z)?0:1}function Rn(Z){return Qt.includes(Z.toLowerCase())}const ei={},ct=Z=>{console.error(Z)},Kt=(Z,...he)=>{console.log(`WARN: ${Z}`,...he)},jt=(Z,he)=>{ei[`${Z}/${he}`]||(console.log(`Deprecated as of ${Z}. ${he}`),ei[`${Z}/${he}`]=!0)},zt=new Error;function ti(Z,he,{key:ve}){let Ie=0;const yt=Z[ve],dt={},Ee={};for(let we=1;we<=he.length;we++)Ee[we+Ie]=yt[we],dt[we+Ie]=!0,Ie+=f(he[we-1]);Z[ve]=Ee,Z[ve]._emit=dt,Z[ve]._multi=!0}function Ln(Z){if(Array.isArray(Z.begin)){if(Z.skip||Z.excludeBegin||Z.returnBegin)throw ct("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),zt;if(typeof Z.beginScope!="object"||Z.beginScope===null)throw ct("beginScope must be object"),zt;ti(Z,Z.begin,{key:"beginScope"}),Z.begin=L(Z.begin,{joinWith:""})}}function ki(Z){if(Array.isArray(Z.end)){if(Z.skip||Z.excludeEnd||Z.returnEnd)throw ct("skip, excludeEnd, returnEnd not compatible with endScope: {}"),zt;if(typeof Z.endScope!="object"||Z.endScope===null)throw ct("endScope must be object"),zt;ti(Z,Z.end,{key:"endScope"}),Z.end=L(Z.end,{joinWith:""})}}function en(Z){Z.scope&&typeof Z.scope=="object"&&Z.scope!==null&&(Z.beginScope=Z.scope,delete Z.scope)}function ht(Z){en(Z),typeof Z.beginScope=="string"&&(Z.beginScope={_wrap:Z.beginScope}),typeof Z.endScope=="string"&&(Z.endScope={_wrap:Z.endScope}),Ln(Z),ki(Z)}function zi(Z){function he(Ee,we){return new RegExp(p(Ee),"m"+(Z.case_insensitive?"i":"")+(Z.unicodeRegex?"u":"")+(we?"g":""))}class ve{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(we,je){je.position=this.position++,this.matchIndexes[this.matchAt]=je,this.regexes.push([je,we]),this.matchAt+=f(we)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);const we=this.regexes.map(je=>je[1]);this.matcherRe=he(L(we,{joinWith:"|"}),!0),this.lastIndex=0}exec(we){this.matcherRe.lastIndex=this.lastIndex;const je=this.matcherRe.exec(we);if(!je)return null;const Nt=je.findIndex((bi,ar)=>ar>0&&bi!==void 0),Qe=this.matchIndexes[Nt];return je.splice(0,Nt),Object.assign(je,Qe)}}class Ie{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(we){if(this.multiRegexes[we])return this.multiRegexes[we];const je=new ve;return this.rules.slice(we).forEach(([Nt,Qe])=>je.addRule(Nt,Qe)),je.compile(),this.multiRegexes[we]=je,je}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(we,je){this.rules.push([we,je]),je.type==="begin"&&this.count++}exec(we){const je=this.getMatcher(this.regexIndex);je.lastIndex=this.lastIndex;let Nt=je.exec(we);if(this.resumingScanAtSamePosition()&&!(Nt&&Nt.index===this.lastIndex)){const Qe=this.getMatcher(0);Qe.lastIndex=this.lastIndex+1,Nt=Qe.exec(we)}return Nt&&(this.regexIndex+=Nt.position+1,this.regexIndex===this.count&&this.considerAll()),Nt}}function yt(Ee){const we=new Ie;return Ee.contains.forEach(je=>we.addRule(je.begin,{rule:je,type:"begin"})),Ee.terminatorEnd&&we.addRule(Ee.terminatorEnd,{type:"end"}),Ee.illegal&&we.addRule(Ee.illegal,{type:"illegal"}),we}function dt(Ee,we){const je=Ee;if(Ee.isCompiled)return je;[be,Ye,ht,Be].forEach(Qe=>Qe(Ee,we)),Z.compilerExtensions.forEach(Qe=>Qe(Ee,we)),Ee.__beforeBegin=null,[$e,Pe,Ct].forEach(Qe=>Qe(Ee,we)),Ee.isCompiled=!0;let Nt=null;return typeof Ee.keywords=="object"&&Ee.keywords.$pattern&&(Ee.keywords=Object.assign({},Ee.keywords),Nt=Ee.keywords.$pattern,delete Ee.keywords.$pattern),Nt=Nt||/\w+/,Ee.keywords&&(Ee.keywords=vi(Ee.keywords,Z.case_insensitive)),je.keywordPatternRe=he(Nt,!0),we&&(Ee.begin||(Ee.begin=/\B|\b/),je.beginRe=he(je.begin),!Ee.end&&!Ee.endsWithParent&&(Ee.end=/\B|\b/),Ee.end&&(je.endRe=he(je.end)),je.terminatorEnd=p(je.end)||"",Ee.endsWithParent&&we.terminatorEnd&&(je.terminatorEnd+=(Ee.end?"|":"")+we.terminatorEnd)),Ee.illegal&&(je.illegalRe=he(Ee.illegal)),Ee.contains||(Ee.contains=[]),Ee.contains=[].concat(...Ee.contains.map(function(Qe){return Vt(Qe==="self"?Ee:Qe)})),Ee.contains.forEach(function(Qe){dt(Qe,je)}),Ee.starts&&dt(Ee.starts,we),je.matcher=yt(je),je}if(Z.compilerExtensions||(Z.compilerExtensions=[]),Z.contains&&Z.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return Z.classNameAliases=a(Z.classNameAliases||{}),dt(Z)}function Yt(Z){return Z?Z.endsWithParent||Yt(Z.starts):!1}function Vt(Z){return Z.variants&&!Z.cachedVariants&&(Z.cachedVariants=Z.variants.map(function(he){return a(Z,{variants:null},he)})),Z.cachedVariants?Z.cachedVariants:Yt(Z)?a(Z,{starts:Z.starts?a(Z.starts):null}):Object.isFrozen(Z)?a(Z):Z}var $t="11.11.1";class vs extends Error{constructor(he,ve){super(he),this.name="HTMLInjectionError",this.html=ve}}const rr=r,Js=a,Mn=Symbol("nomatch"),Fn=7,sr=function(Z){const he=Object.create(null),ve=Object.create(null),Ie=[];let yt=!0;const dt="Could not find the language '{}', did you forget to load/include a language module?",Ee={disableAutodetect:!0,name:"Plain text",contains:[]};let we={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:b};function je(me){return we.noHighlightRe.test(me)}function Nt(me){let Le=me.className+" ";Le+=me.parentNode?me.parentNode.className:"";const Oe=we.languageDetectRe.exec(Le);if(Oe){const st=G(Oe[1]);return st||(Kt(dt.replace("{}",Oe[1])),Kt("Falling back to no-highlight mode for this block.",me)),st?Oe[1]:"no-highlight"}return Le.split(/\s+/).find(st=>je(st)||G(st))}function Qe(me,Le,Oe){let st="",Mt="";typeof Le=="object"?(st=me,Oe=Le.ignoreIllegals,Mt=Le.language):(jt("10.7.0","highlight(lang, code, ...args) has been deprecated."),jt("10.7.0",`Please use highlight(code, options) instead.
|
|
200
|
+
https://github.com/highlightjs/highlight.js/issues/2277`),Mt=me,st=Le),Oe===void 0&&(Oe=!0);const Ri={code:st,language:Mt};Ht("before:highlight",Ri);const tn=Ri.result?Ri.result:bi(Ri.language,Ri.code,Oe);return tn.code=Ri.code,Ht("after:highlight",tn),tn}function bi(me,Le,Oe,st){const Mt=Object.create(null);function Ri(Se,ke){return Se.keywords[ke]}function tn(){if(!He.keywords){ni.addText(ft);return}let Se=0;He.keywordPatternRe.lastIndex=0;let ke=He.keywordPatternRe.exec(ft),Fe="";for(;ke;){Fe+=ft.substring(Se,ke.index);const et=yi.case_insensitive?ke[0].toLowerCase():ke[0],It=Ri(He,et);if(It){const[pn,so]=It;if(ni.addText(Fe),Fe="",Mt[et]=(Mt[et]||0)+1,Mt[et]<=Fn&&(jr+=so),pn.startsWith("_"))Fe+=ke[0];else{const Ol=yi.classNameAliases[pn]||pn;nn(ke[0],Ol)}}else Fe+=ke[0];Se=He.keywordPatternRe.lastIndex,ke=He.keywordPatternRe.exec(ft)}Fe+=ft.substring(Se),ni.addText(Fe)}function Hi(){if(ft==="")return;let Se=null;if(typeof He.subLanguage=="string"){if(!he[He.subLanguage]){ni.addText(ft);return}Se=bi(He.subLanguage,ft,!0,Dl[He.subLanguage]),Dl[He.subLanguage]=Se._top}else Se=or(ft,He.subLanguage.length?He.subLanguage:null);He.relevance>0&&(jr+=Se.relevance),ni.__addSublanguage(Se._emitter,Se.language)}function xt(){He.subLanguage!=null?Hi():tn(),ft=""}function nn(Se,ke){Se!==""&&(ni.startScope(ke),ni.addText(Se),ni.endScope())}function Ll(Se,ke){let Fe=1;const et=ke.length-1;for(;Fe<=et;){if(!Se._emit[Fe]){Fe++;continue}const It=yi.classNameAliases[Se[Fe]]||Se[Fe],pn=ke[Fe];It?nn(pn,It):(ft=pn,tn(),ft=""),Fe++}}function ea(Se,ke){return Se.scope&&typeof Se.scope=="string"&&ni.openNode(yi.classNameAliases[Se.scope]||Se.scope),Se.beginScope&&(Se.beginScope._wrap?(nn(ft,yi.classNameAliases[Se.beginScope._wrap]||Se.beginScope._wrap),ft=""):Se.beginScope._multi&&(Ll(Se.beginScope,ke),ft="")),He=Object.create(Se,{parent:{value:He}}),He}function io(Se,ke,Fe){let et=_(Se.endRe,Fe);if(et){if(Se["on:end"]){const It=new i(Se);Se["on:end"](ke,It),It.isMatchIgnored&&(et=!1)}if(et){for(;Se.endsParent&&Se.parent;)Se=Se.parent;return Se}}if(Se.endsWithParent)return io(Se.parent,ke,Fe)}function ta(Se){return He.matcher.regexIndex===0?(ft+=Se[0],1):(zr=!0,0)}function Fu(Se){const ke=Se[0],Fe=Se.rule,et=new i(Fe),It=[Fe.__beforeBegin,Fe["on:begin"]];for(const pn of It)if(pn&&(pn(Se,et),et.isMatchIgnored))return ta(ke);return Fe.skip?ft+=ke:(Fe.excludeBegin&&(ft+=ke),xt(),!Fe.returnBegin&&!Fe.excludeBegin&&(ft=ke)),ea(Fe,Se),Fe.returnBegin?0:ke.length}function Ui(Se){const ke=Se[0],Fe=Le.substring(Se.index),et=io(He,Se,Fe);if(!et)return Mn;const It=He;He.endScope&&He.endScope._wrap?(xt(),nn(ke,He.endScope._wrap)):He.endScope&&He.endScope._multi?(xt(),Ll(He.endScope,Se)):It.skip?ft+=ke:(It.returnEnd||It.excludeEnd||(ft+=ke),xt(),It.excludeEnd&&(ft=ke));do He.scope&&ni.closeNode(),!He.skip&&!He.subLanguage&&(jr+=He.relevance),He=He.parent;while(He!==et.parent);return et.starts&&ea(et.starts,Se),It.returnEnd?0:ke.length}function no(){const Se=[];for(let ke=He;ke!==yi;ke=ke.parent)ke.scope&&Se.unshift(ke.scope);Se.forEach(ke=>ni.openNode(ke))}let ys={};function ia(Se,ke){const Fe=ke&&ke[0];if(ft+=Se,Fe==null)return xt(),0;if(ys.type==="begin"&&ke.type==="end"&&ys.index===ke.index&&Fe===""){if(ft+=Le.slice(ke.index,ke.index+1),!yt){const et=new Error(`0 width match regex (${me})`);throw et.languageName=me,et.badRule=ys.rule,et}return 1}if(ys=ke,ke.type==="begin")return Fu(ke);if(ke.type==="illegal"&&!Oe){const et=new Error('Illegal lexeme "'+Fe+'" for mode "'+(He.scope||"<unnamed>")+'"');throw et.mode=He,et}else if(ke.type==="end"){const et=Ui(ke);if(et!==Mn)return et}if(ke.type==="illegal"&&Fe==="")return ft+=`
|
|
201
|
+
`,1;if(ro>1e5&&ro>ke.index*3)throw new Error("potential infinite loop, way more iterations than matches");return ft+=Fe,Fe.length}const yi=G(me);if(!yi)throw ct(dt.replace("{}",me)),new Error('Unknown language: "'+me+'"');const Ml=zi(yi);let na="",He=st||Ml;const Dl={},ni=new we.__emitter(we);no();let ft="",jr=0,cr=0,ro=0,zr=!1;try{if(yi.__emitTokens)yi.__emitTokens(Le,ni);else{for(He.matcher.considerAll();;){ro++,zr?zr=!1:He.matcher.considerAll(),He.matcher.lastIndex=cr;const Se=He.matcher.exec(Le);if(!Se)break;const ke=Le.substring(cr,Se.index),Fe=ia(ke,Se);cr=Se.index+Fe}ia(Le.substring(cr))}return ni.finalize(),na=ni.toHTML(),{language:me,value:na,relevance:jr,illegal:!1,_emitter:ni,_top:He}}catch(Se){if(Se.message&&Se.message.includes("Illegal"))return{language:me,value:rr(Le),illegal:!0,relevance:0,_illegalBy:{message:Se.message,index:cr,context:Le.slice(cr-100,cr+100),mode:Se.mode,resultSoFar:na},_emitter:ni};if(yt)return{language:me,value:rr(Le),illegal:!1,relevance:0,errorRaised:Se,_emitter:ni,_top:He};throw Se}}function ar(me){const Le={value:rr(me),illegal:!1,relevance:0,_top:Ee,_emitter:new we.__emitter(we)};return Le._emitter.addText(me),Le}function or(me,Le){Le=Le||we.languages||Object.keys(he);const Oe=ar(me),st=Le.filter(G).filter(xe).map(xt=>bi(xt,me,!1));st.unshift(Oe);const Mt=st.sort((xt,nn)=>{if(xt.relevance!==nn.relevance)return nn.relevance-xt.relevance;if(xt.language&&nn.language){if(G(xt.language).supersetOf===nn.language)return 1;if(G(nn.language).supersetOf===xt.language)return-1}return 0}),[Ri,tn]=Mt,Hi=Ri;return Hi.secondBest=tn,Hi}function $i(me,Le,Oe){const st=Le&&ve[Le]||Oe;me.classList.add("hljs"),me.classList.add(`language-${st}`)}function Et(me){let Le=null;const Oe=Nt(me);if(je(Oe))return;if(Ht("before:highlightElement",{el:me,language:Oe}),me.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",me);return}if(me.children.length>0&&(we.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(me)),we.throwUnescapedHTML))throw new vs("One of your code blocks includes unescaped HTML.",me.innerHTML);Le=me;const st=Le.textContent,Mt=Oe?Qe(st,{language:Oe,ignoreIllegals:!0}):or(st);me.innerHTML=Mt.value,me.dataset.highlighted="yes",$i(me,Oe,Mt.language),me.result={language:Mt.language,re:Mt.relevance,relevance:Mt.relevance},Mt.secondBest&&(me.secondBest={language:Mt.secondBest.language,relevance:Mt.secondBest.relevance}),Ht("after:highlightElement",{el:me,result:Mt,text:st})}function wt(me){we=Js(we,me)}const Dn=()=>{lr(),jt("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function Ir(){lr(),jt("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let Qs=!1;function lr(){function me(){lr()}if(document.readyState==="loading"){Qs||window.addEventListener("DOMContentLoaded",me,!1),Qs=!0;return}document.querySelectorAll(we.cssSelector).forEach(Et)}function bs(me,Le){let Oe=null;try{Oe=Le(Z)}catch(st){if(ct("Language definition for '{}' could not be registered.".replace("{}",me)),yt)ct(st);else throw st;Oe=Ee}Oe.name||(Oe.name=me),he[me]=Oe,Oe.rawDefinition=Le.bind(null,Z),Oe.aliases&&pe(Oe.aliases,{languageName:me})}function qn(me){delete he[me];for(const Le of Object.keys(ve))ve[Le]===me&&delete ve[Le]}function De(){return Object.keys(he)}function G(me){return me=(me||"").toLowerCase(),he[me]||he[ve[me]]}function pe(me,{languageName:Le}){typeof me=="string"&&(me=[me]),me.forEach(Oe=>{ve[Oe.toLowerCase()]=Le})}function xe(me){const Le=G(me);return Le&&!Le.disableAutodetect}function nt(me){me["before:highlightBlock"]&&!me["before:highlightElement"]&&(me["before:highlightElement"]=Le=>{me["before:highlightBlock"](Object.assign({block:Le.el},Le))}),me["after:highlightBlock"]&&!me["after:highlightElement"]&&(me["after:highlightElement"]=Le=>{me["after:highlightBlock"](Object.assign({block:Le.el},Le))})}function Ve(me){nt(me),Ie.push(me)}function Tt(me){const Le=Ie.indexOf(me);Le!==-1&&Ie.splice(Le,1)}function Ht(me,Le){const Oe=me;Ie.forEach(function(st){st[Oe]&&st[Oe](Le)})}function Ut(me){return jt("10.7.0","highlightBlock will be removed entirely in v12.0"),jt("10.7.0","Please use highlightElement now."),Et(me)}Object.assign(Z,{highlight:Qe,highlightAuto:or,highlightAll:lr,highlightElement:Et,highlightBlock:Ut,configure:wt,initHighlighting:Dn,initHighlightingOnLoad:Ir,registerLanguage:bs,unregisterLanguage:qn,listLanguages:De,getLanguage:G,registerAliases:pe,autoDetection:xe,inherit:Js,addPlugin:Ve,removePlugin:Tt}),Z.debugMode=function(){yt=!1},Z.safeMode=function(){yt=!0},Z.versionString=$t,Z.regex={concat:x,lookahead:C,either:y,optional:A,anyNumberOfTimes:w};for(const me in ge)typeof ge[me]=="object"&&t(ge[me]);return Object.assign(Z,ge),Z},ii=sr({});return ii.newInstance=()=>sr({}),Rf=ii,ii.HighlightJS=ii,ii.default=ii,Rf}var fR=dR();const wn=zw(fR);function L1(t){const i=t.regex,r={},a={begin:/\$\{/,end:/\}/,contains:["self",{begin:/:-/,contains:[r]}]};Object.assign(r,{className:"variable",variants:[{begin:i.concat(/\$[\w\d#@][\w\d_]*/,"(?![\\w\\d])(?![$])")},a]});const l={className:"subst",begin:/\$\(/,end:/\)/,contains:[t.BACKSLASH_ESCAPE]},v=t.inherit(t.COMMENT(),{match:[/(^|\s)/,/#.*$/],scope:{2:"comment"}}),m={begin:/<<-?\s*(?=\w+)/,starts:{contains:[t.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,className:"string"})]}},c={className:"string",begin:/"/,end:/"/,contains:[t.BACKSLASH_ESCAPE,r,l]};l.contains.push(c);const u={match:/\\"/},h={className:"string",begin:/'/,end:/'/},b={match:/\\'/},p={begin:/\$?\(\(/,end:/\)\)/,contains:[{begin:/\d+#[0-9a-f]+/,className:"number"},t.NUMBER_MODE,r]},C=["fish","bash","zsh","sh","csh","ksh","tcsh","dash","scsh"],w=t.SHEBANG({binary:`(${C.join("|")})`,relevance:10}),A={className:"function",begin:/\w[\w\d_]*\s*\(\s*\)\s*\{/,returnBegin:!0,contains:[t.inherit(t.TITLE_MODE,{begin:/\w[\w\d_]*/})],relevance:0},x=["if","then","else","elif","fi","time","for","while","until","in","do","done","case","esac","coproc","function","select"],g=["true","false"],y={match:/(\/[a-z._-]+)+/},f=["break","cd","continue","eval","exec","exit","export","getopts","hash","pwd","readonly","return","shift","test","times","trap","umask","unset"],_=["alias","bind","builtin","caller","command","declare","echo","enable","help","let","local","logout","mapfile","printf","read","readarray","source","sudo","type","typeset","ulimit","unalias"],E=["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"],L=["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:x,literal:g,built_in:[...f,..._,"set","shopt",...E,...L]},contains:[w,t.SHEBANG(),A,p,v,m,y,c,u,h,b,r]}}const M1="[A-Za-z$_][0-9A-Za-z$_]*",pR=["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"],gR=["true","false","null","undefined","NaN","Infinity"],cS=["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"],uS=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],hS=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],mR=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],_R=[].concat(hS,cS,uS);function D1(t){const i=t.regex,r=(Y,{after:B})=>{const z="</"+Y[0].slice(1);return Y.input.indexOf(z,B)!==-1},a=M1,l={begin:"<>",end:"</>"},v=/<[A-Za-z0-9\\._:-]+\s*\/>/,m={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(Y,B)=>{const z=Y[0].length+Y.index,O=Y.input[z];if(O==="<"||O===","){B.ignoreMatch();return}O===">"&&(r(Y,{after:z})||B.ignoreMatch());let H;const X=Y.input.substring(z);if(H=X.match(/^\s*=/)){B.ignoreMatch();return}if((H=X.match(/^\s+extends\s+/))&&H.index===0){B.ignoreMatch();return}}},c={$pattern:M1,keyword:pR,literal:gR,built_in:_R,"variable.language":mR},u="[0-9](_?[0-9])*",h=`\\.(${u})`,b="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",p={className:"number",variants:[{begin:`(\\b(${b})((${h})|\\.)?|(${h}))[eE][+-]?(${u})\\b`},{begin:`\\b(${b})\\b((${h})\\b|\\.)?|(${h})\\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},C={className:"subst",begin:"\\$\\{",end:"\\}",keywords:c,contains:[]},w={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,C],subLanguage:"xml"}},A={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,C],subLanguage:"css"}},x={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,C],subLanguage:"graphql"}},g={className:"string",begin:"`",end:"`",contains:[t.BACKSLASH_ESCAPE,C]},f={className:"comment",variants:[t.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:a+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),t.C_BLOCK_COMMENT_MODE,t.C_LINE_COMMENT_MODE]},_=[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,w,A,x,g,{match:/\$\d+/},p];C.contains=_.concat({begin:/\{/,end:/\}/,keywords:c,contains:["self"].concat(_)});const E=[].concat(f,C.contains),L=E.concat([{begin:/(\s*)\(/,end:/\)/,keywords:c,contains:["self"].concat(E)}]),R={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:c,contains:L},D={variants:[{match:[/class/,/\s+/,a,/\s+/,/extends/,/\s+/,i.concat(a,"(",i.concat(/\./,a),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,a],scope:{1:"keyword",3:"title.class"}}]},k={relevance:0,match:i.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:{_:[...cS,...uS]}},N={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},W={variants:[{match:[/function/,/\s+/,a,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[R],illegal:/%/},U={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function F(Y){return i.concat("(?!",Y.join("|"),")")}const j={match:i.concat(/\b/,F([...hS,"super","import"].map(Y=>`${Y}\\s*\\(`)),a,i.lookahead(/\s*\(/)),className:"title.function",relevance:0},J={begin:i.concat(/\./,i.lookahead(i.concat(a,/(?![0-9A-Za-z$_(])/))),end:a,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},te={match:[/get|set/,/\s+/,a,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},R]},P="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+t.UNDERSCORE_IDENT_RE+")\\s*=>",V={match:[/const|var|let/,/\s+/,a,/\s*/,/=\s*/,/(async\s*)?/,i.lookahead(P)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[R]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:c,exports:{PARAMS_CONTAINS:L,CLASS_REFERENCE:k},illegal:/#(?![$_A-z])/,contains:[t.SHEBANG({label:"shebang",binary:"node",relevance:5}),N,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,w,A,x,g,f,{match:/\$\d+/},p,k,{scope:"attr",match:a+i.lookahead(":"),relevance:0},V,{begin:"("+t.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[f,t.REGEXP_MODE,{className:"function",begin:P,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:t.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:c,contains:L}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:l.begin,end:l.end},{match:v},{begin:m.begin,"on:begin":m.isTrulyOpeningTag,end:m.end}],subLanguage:"xml",contains:[{begin:m.begin,end:m.end,skip:!0,contains:["self"]}]}]},W,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+t.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[R,t.inherit(t.TITLE_MODE,{begin:a,className:"title.function"})]},{match:/\.\.\./,relevance:0},J,{match:"\\$"+a,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[R]},j,U,D,te,{match:/\$[(.]/}]}}function vR(t){const i={className:"attr",begin:/"(\\.|[^\\"\r\n])*"(?=\s*:)/,relevance:1.01},r={match:/[{}[\],:]/,className:"punctuation",relevance:0},a=["true","false","null"],l={scope:"literal",beginKeywords:a.join(" ")};return{name:"JSON",aliases:["jsonc"],keywords:{literal:a},contains:[i,r,t.QUOTE_STRING_MODE,l,t.C_NUMBER_MODE,t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE],illegal:"\\S"}}function O1(t){const i=t.regex,r={begin:/<\/?[A-Za-z_]/,end:">",subLanguage:"xml",relevance:0},a={begin:"^[-\\*]{3,}",end:"$"},l={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}]},v={className:"bullet",begin:"^[ ]*([*+-]|(\\d+\\.))(?=\\s+)",end:"\\s+",excludeEnd:!0},m={begin:/^\[[^\n]+\]:/,returnBegin:!0,contains:[{className:"symbol",begin:/\[/,end:/\]/,excludeBegin:!0,excludeEnd:!0},{className:"link",begin:/:\s*/,end:/$/,excludeBegin:!0}]},c=/[A-Za-z][A-Za-z0-9+.-]*/,u={variants:[{begin:/\[.+?\]\[.*?\]/,relevance:0},{begin:/\[.+?\]\(((data|javascript|mailto):|(?:http|ftp)s?:\/\/).*?\)/,relevance:2},{begin:i.concat(/\[.+?\]\(/,c,/:\/\/.*?\)/),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}]},h={className:"strong",contains:[],variants:[{begin:/_{2}(?!\s)/,end:/_{2}/},{begin:/\*{2}(?!\s)/,end:/\*{2}/}]},b={className:"emphasis",contains:[],variants:[{begin:/\*(?![*\s])/,end:/\*/},{begin:/_(?![_\s])/,end:/_/,relevance:0}]},p=t.inherit(h,{contains:[]}),C=t.inherit(b,{contains:[]});h.contains.push(C),b.contains.push(p);let w=[r,u];return[h,b,p,C].forEach(y=>{y.contains=y.contains.concat(w)}),w=w.concat(h,b),{name:"Markdown",aliases:["md","mkdown","mkd"],contains:[{className:"section",variants:[{begin:"^#{1,6}",end:"$",contains:w},{begin:"(?=^.+?\\n[=-]{2,}$)",contains:[{begin:"^[=-]*$"},{begin:"^",end:"\\n",contains:w}]}]},r,v,h,b,{className:"quote",begin:"^>\\s+",contains:w,end:"$"},l,a,u,m,{scope:"literal",match:/&([a-zA-Z0-9]+|#[0-9]{1,7}|#[Xx][0-9a-fA-F]{1,6});/}]}}function B1(t){const i=t.regex,r=new RegExp("[\\p{XID_Start}_]\\p{XID_Continue}*","u"),a=["and","as","assert","async","await","break","case","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","in","is","lambda","match","nonlocal|10","not","or","pass","raise","return","try","while","with","yield"],c={$pattern:/[A-Za-z]\w+|__\w+__/,keyword:a,built_in:["__import__","abs","all","any","ascii","bin","bool","breakpoint","bytearray","bytes","callable","chr","classmethod","compile","complex","delattr","dict","dir","divmod","enumerate","eval","exec","filter","float","format","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","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"]},u={className:"meta",begin:/^(>>>|\.\.\.) /},h={className:"subst",begin:/\{/,end:/\}/,keywords:c,illegal:/#/},b={begin:/\{\{/,relevance:0},p={className:"string",contains:[t.BACKSLASH_ESCAPE],variants:[{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?'''/,end:/'''/,contains:[t.BACKSLASH_ESCAPE,u],relevance:10},{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?"""/,end:/"""/,contains:[t.BACKSLASH_ESCAPE,u],relevance:10},{begin:/([fF][rR]|[rR][fF]|[fF])'''/,end:/'''/,contains:[t.BACKSLASH_ESCAPE,u,b,h]},{begin:/([fF][rR]|[rR][fF]|[fF])"""/,end:/"""/,contains:[t.BACKSLASH_ESCAPE,u,b,h]},{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:/([fF][rR]|[rR][fF]|[fF])'/,end:/'/,contains:[t.BACKSLASH_ESCAPE,b,h]},{begin:/([fF][rR]|[rR][fF]|[fF])"/,end:/"/,contains:[t.BACKSLASH_ESCAPE,b,h]},t.APOS_STRING_MODE,t.QUOTE_STRING_MODE]},C="[0-9](_?[0-9])*",w=`(\\b(${C}))?\\.(${C})|\\b(${C})\\.`,A=`\\b|${a.join("|")}`,x={className:"number",relevance:0,variants:[{begin:`(\\b(${C})|(${w}))[eE][+-]?(${C})[jJ]?(?=${A})`},{begin:`(${w})[jJ]?`},{begin:`\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${A})`},{begin:`\\b0[bB](_?[01])+[lL]?(?=${A})`},{begin:`\\b0[oO](_?[0-7])+[lL]?(?=${A})`},{begin:`\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${A})`},{begin:`\\b(${C})[jJ](?=${A})`}]},g={className:"comment",begin:i.lookahead(/# type:/),end:/$/,keywords:c,contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},y={className:"params",variants:[{className:"",begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:c,contains:["self",u,x,p,t.HASH_COMMENT_MODE]}]};return h.contains=[p,x,u],{name:"Python",aliases:["py","gyp","ipython"],unicodeRegex:!0,keywords:c,illegal:/(<\/|\?)|=>/,contains:[u,x,{scope:"variable.language",match:/\bself\b/},{beginKeywords:"if",relevance:0},{match:/\bor\b/,scope:"keyword"},p,g,t.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,r],scope:{1:"keyword",3:"title.function"},contains:[y]},{variants:[{match:[/\bclass/,/\s+/,r,/\s*/,/\(\s*/,r,/\s*\)/]},{match:[/\bclass/,/\s+/,r]}],scope:{1:"keyword",3:"title.class",6:"title.class.inherited"}},{className:"meta",begin:/^[\t ]*@/,end:/(?=#)|$/,contains:[x,y,p]}]}}const wu="[A-Za-z$_][0-9A-Za-z$_]*",dS=["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"],fS=["true","false","null","undefined","NaN","Infinity"],pS=["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"],gS=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],mS=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],_S=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],vS=[].concat(mS,pS,gS);function bR(t){const i=t.regex,r=(Y,{after:B})=>{const z="</"+Y[0].slice(1);return Y.input.indexOf(z,B)!==-1},a=wu,l={begin:"<>",end:"</>"},v=/<[A-Za-z0-9\\._:-]+\s*\/>/,m={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(Y,B)=>{const z=Y[0].length+Y.index,O=Y.input[z];if(O==="<"||O===","){B.ignoreMatch();return}O===">"&&(r(Y,{after:z})||B.ignoreMatch());let H;const X=Y.input.substring(z);if(H=X.match(/^\s*=/)){B.ignoreMatch();return}if((H=X.match(/^\s+extends\s+/))&&H.index===0){B.ignoreMatch();return}}},c={$pattern:wu,keyword:dS,literal:fS,built_in:vS,"variable.language":_S},u="[0-9](_?[0-9])*",h=`\\.(${u})`,b="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",p={className:"number",variants:[{begin:`(\\b(${b})((${h})|\\.)?|(${h}))[eE][+-]?(${u})\\b`},{begin:`\\b(${b})\\b((${h})\\b|\\.)?|(${h})\\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},C={className:"subst",begin:"\\$\\{",end:"\\}",keywords:c,contains:[]},w={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,C],subLanguage:"xml"}},A={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,C],subLanguage:"css"}},x={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,C],subLanguage:"graphql"}},g={className:"string",begin:"`",end:"`",contains:[t.BACKSLASH_ESCAPE,C]},f={className:"comment",variants:[t.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:a+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),t.C_BLOCK_COMMENT_MODE,t.C_LINE_COMMENT_MODE]},_=[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,w,A,x,g,{match:/\$\d+/},p];C.contains=_.concat({begin:/\{/,end:/\}/,keywords:c,contains:["self"].concat(_)});const E=[].concat(f,C.contains),L=E.concat([{begin:/(\s*)\(/,end:/\)/,keywords:c,contains:["self"].concat(E)}]),R={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:c,contains:L},D={variants:[{match:[/class/,/\s+/,a,/\s+/,/extends/,/\s+/,i.concat(a,"(",i.concat(/\./,a),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,a],scope:{1:"keyword",3:"title.class"}}]},k={relevance:0,match:i.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:{_:[...pS,...gS]}},N={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},W={variants:[{match:[/function/,/\s+/,a,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[R],illegal:/%/},U={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function F(Y){return i.concat("(?!",Y.join("|"),")")}const j={match:i.concat(/\b/,F([...mS,"super","import"].map(Y=>`${Y}\\s*\\(`)),a,i.lookahead(/\s*\(/)),className:"title.function",relevance:0},J={begin:i.concat(/\./,i.lookahead(i.concat(a,/(?![0-9A-Za-z$_(])/))),end:a,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},te={match:[/get|set/,/\s+/,a,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},R]},P="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+t.UNDERSCORE_IDENT_RE+")\\s*=>",V={match:[/const|var|let/,/\s+/,a,/\s*/,/=\s*/,/(async\s*)?/,i.lookahead(P)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[R]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:c,exports:{PARAMS_CONTAINS:L,CLASS_REFERENCE:k},illegal:/#(?![$_A-z])/,contains:[t.SHEBANG({label:"shebang",binary:"node",relevance:5}),N,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,w,A,x,g,f,{match:/\$\d+/},p,k,{scope:"attr",match:a+i.lookahead(":"),relevance:0},V,{begin:"("+t.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[f,t.REGEXP_MODE,{className:"function",begin:P,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:t.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:c,contains:L}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:l.begin,end:l.end},{match:v},{begin:m.begin,"on:begin":m.isTrulyOpeningTag,end:m.end}],subLanguage:"xml",contains:[{begin:m.begin,end:m.end,skip:!0,contains:["self"]}]}]},W,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+t.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[R,t.inherit(t.TITLE_MODE,{begin:a,className:"title.function"})]},{match:/\.\.\./,relevance:0},J,{match:"\\$"+a,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[R]},j,U,D,te,{match:/\$[(.]/}]}}function N1(t){const i=t.regex,r=bR(t),a=wu,l=["any","void","number","boolean","string","object","never","symbol","bigint","unknown"],v={begin:[/namespace/,/\s+/,t.IDENT_RE],beginScope:{1:"keyword",3:"title.class"}},m={beginKeywords:"interface",end:/\{/,excludeEnd:!0,keywords:{keyword:"interface extends",built_in:l},contains:[r.exports.CLASS_REFERENCE]},c={className:"meta",relevance:10,begin:/^\s*['"]use strict['"]/},u=["type","interface","public","private","protected","implements","declare","abstract","readonly","enum","override","satisfies"],h={$pattern:wu,keyword:dS.concat(u),literal:fS,built_in:vS.concat(l),"variable.language":_S},b={className:"meta",begin:"@"+a},p=(x,g,y)=>{const f=x.contains.findIndex(_=>_.label===g);if(f===-1)throw new Error("can not find mode to replace");x.contains.splice(f,1,y)};Object.assign(r.keywords,h),r.exports.PARAMS_CONTAINS.push(b);const C=r.contains.find(x=>x.scope==="attr"),w=Object.assign({},C,{match:i.concat(a,i.lookahead(/\s*\?:/))});r.exports.PARAMS_CONTAINS.push([r.exports.CLASS_REFERENCE,C,w]),r.contains=r.contains.concat([b,v,m,w]),p(r,"shebang",t.SHEBANG()),p(r,"use_strict",c);const A=r.contains.find(x=>x.label==="func.def");return A.relevance=0,Object.assign(r,{name:"TypeScript",aliases:["ts","tsx","mts","cts"]}),r}const yR=/\[\[wiki:([^\]]+)\]\]/g,SR=new rS({gfm:!0,breaks:!1}),I1={ALLOWED_URI_REGEXP:/^(?:(?:https?|mailto):|[#/]|\.{0,2}\/|[^:]+$)/i,ADD_ATTR:["target","rel","data-entry-id"]},Lf=MR();function to(t){const i=xR(t),r=SR.parse(i,{async:!1}),a=gl.sanitize(r,I1),l=new DOMParser().parseFromString(a,"text/html");return ER(l),TR(l),kR(l),{html:gl.sanitize(l.body.innerHTML,I1),toc:RR(l)}}function CR(t){const i=new TextEncoder().encode(t);let r="";for(const a of i)r+=String.fromCharCode(a);return btoa(r)}function wR(t){const i=atob(t),r=new Uint8Array(i.length);for(let a=0;a<i.length;a++)r[a]=i.charCodeAt(a);return new TextDecoder().decode(r)}function xR(t){return t.replace(yR,(i,r)=>{const a=r.trim();if(!a)return"";const l=Ae(a),v=encodeURIComponent(a);return`<a href="${Nr(a)}" data-entry-id="${v}">${l}</a>`})}function ER(t){const i=new Map;for(const r of t.querySelectorAll("h2, h3")){const a=r.textContent?.trim()??"",l=BR(a||"section"),v=i.get(l)??0;i.set(l,v+1),r.id=v===0?l:`${l}-${v+1}`}}function TR(t){for(const i of t.querySelectorAll("pre > code")){const r=DR(i.className),a=i.textContent??"",l=i.parentElement;if(!l)continue;if(r==="mermaid"){const m=t.createElement("div");m.className="diagram-block",m.setAttribute("data-mermaid-source",CR(a)),m.setAttribute("data-diagram-state","pending"),l.replaceWith(m);continue}const v=LR(a,r);i.innerHTML=v,i.classList.add("hljs"),l.classList.add("code-block"),l.dataset.code=a,l.insertBefore(AR(t,r||"text"),l.firstChild)}}function AR(t,i){const r=t.createElement("div");r.className="code-block-toolbar";const a=t.createElement("span");a.className="code-block-dots",a.setAttribute("aria-hidden","true");for(let m=0;m<3;m++)a.append(t.createElement("span"));const l=t.createElement("span");l.className="code-block-language",l.textContent=i;const v=t.createElement("button");return v.className="copy-code",v.type="button",v.dataset.action="copy-code",v.textContent="복사",r.append(a,l,v),r}function kR(t){for(const i of t.querySelectorAll("a")){const r=i.getAttribute("href")??"";OR(r)&&(i.setAttribute("target","_blank"),i.setAttribute("rel","noopener noreferrer"))}}function RR(t){return[...t.querySelectorAll("h2, h3")].map(i=>({id:i.id,text:i.textContent?.trim()??i.id,level:i.tagName.toLowerCase()==="h2"?2:3}))}function LR(t,i){return i&&Lf.getLanguage(i)?Lf.highlight(t,{language:i}).value:Lf.highlightAuto(t).value}function MR(){return wn.registerLanguage("bash",L1),wn.registerLanguage("sh",L1),wn.registerLanguage("javascript",D1),wn.registerLanguage("js",D1),wn.registerLanguage("json",vR),wn.registerLanguage("markdown",O1),wn.registerLanguage("md",O1),wn.registerLanguage("python",B1),wn.registerLanguage("py",B1),wn.registerLanguage("typescript",N1),wn.registerLanguage("ts",N1),wn}function DR(t){return t.match(/language-([a-z0-9_-]+)/i)?.[1]?.toLowerCase()??null}function OR(t){return/^[a-z][a-z0-9+.-]*:/i.test(t)&&!t.startsWith(window.location.origin)}function BR(t){return t.trim().toLowerCase().replace(/[^\p{Letter}\p{Number}]+/gu,"-").replace(/^-+|-+$/g,"")||"section"}function NR(t){return`
|
|
202
|
+
<article class="document">
|
|
203
|
+
<header class="document-header">
|
|
204
|
+
<p class="eyebrow">MANIFEST · DRYDOCK</p>
|
|
205
|
+
<h1>Conflicts</h1>
|
|
206
|
+
</header>
|
|
207
|
+
${t.length>0?`
|
|
208
|
+
<ul class="conflict-list">
|
|
209
|
+
${t.map(i=>`
|
|
210
|
+
<li>
|
|
211
|
+
<a class="conflict-list-item" href="${w3(i.id)}">
|
|
212
|
+
<span class="conflict-list-copy">
|
|
213
|
+
<strong>${Ae(i.title)}</strong>
|
|
214
|
+
<small>${Ae(i.id)}</small>
|
|
215
|
+
</span>
|
|
216
|
+
<span class="chip ${i.status==="open"?"chip-coral":"chip"}">${Ae(i.status)}</span>
|
|
217
|
+
</a>
|
|
218
|
+
</li>
|
|
219
|
+
`).join("")}
|
|
220
|
+
</ul>
|
|
221
|
+
`:'<p class="empty-state">No conflicts to display.</p>'}
|
|
222
|
+
</article>
|
|
223
|
+
`}function IR(t){const i=[Mf("Current",t.current),Mf("Proposed",t.proposed),Mf("Raw Source",t.rawSource)].filter(Boolean).join("");return`
|
|
224
|
+
<article class="document">
|
|
225
|
+
<header class="document-header">
|
|
226
|
+
<p class="eyebrow">MANIFEST · DRYDOCK</p>
|
|
227
|
+
<h1>${Ae(t.id)}</h1>
|
|
228
|
+
<div class="meta-chips">
|
|
229
|
+
<span class="chip chip-coral">${Ae(String(t.meta.status??"unknown"))}</span>
|
|
230
|
+
</div>
|
|
231
|
+
</header>
|
|
232
|
+
<section class="conflict-meta-card">
|
|
233
|
+
<pre>${Ae(JSON.stringify(t.meta,null,2))}</pre>
|
|
234
|
+
</section>
|
|
235
|
+
${i||'<p class="empty-state">No conflicts to display.</p>'}
|
|
236
|
+
</article>
|
|
237
|
+
`}function Mf(t,i){if(!i)return"";const r=to(i);return`
|
|
238
|
+
<section class="conflict-section">
|
|
239
|
+
<h2>${Ae(t)}</h2>
|
|
240
|
+
<div class="markdown-body">${r.html}</div>
|
|
241
|
+
</section>
|
|
242
|
+
`}function jR(t){return`
|
|
243
|
+
<article class="document">
|
|
244
|
+
<header class="document-header">
|
|
245
|
+
<p class="eyebrow">MANIFEST · CODEX</p>
|
|
246
|
+
<h1>Index</h1>
|
|
247
|
+
</header>
|
|
248
|
+
<div class="markdown-body">${to(t).html}</div>
|
|
249
|
+
</article>
|
|
250
|
+
`}function fp(t,i){try{return new Date(t).toLocaleString(i??"en-US",{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"})}catch{return t}}function xu(t){const i=Date.now()-new Date(t).getTime(),r=Math.floor(i/6e4);if(r<1)return"just now";if(r<60)return`${r} min ago`;const a=Math.floor(r/60);if(a<24)return`${a} hr ago`;const l=Math.floor(a/24);return l<30?`${l} days ago`:`${Math.floor(l/30)} months ago`}const zR=`
|
|
251
|
+
<svg viewBox="0 0 24 24" width="14" height="14" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
|
|
252
|
+
<path d="M7 17 17 7M9 7h8v8" />
|
|
253
|
+
</svg>
|
|
254
|
+
`;function $R(t,i,r){if(!t)return"";const{frontmatter:a}=t,l=fp(a.created),v=xu(a.created),m=fp(a.updated),c=xu(a.updated),u=r3(t,i,r),h=a.tags.length>0?`<div class="queue-card-chips">${a.tags.map(p=>`<span class="chip chip-muted">${Ae(p)}</span>`).join("")}</div>`:'<span class="queue-dl-muted">None</span>',b=a.rawSourceRef?`<a class="manifest-link queue-raw-link" href="${Je(jy(a.rawSourceRef))}" data-raw-ref="${Je(a.rawSourceRef)}">
|
|
255
|
+
<span class="manifest-ref">${Ae(a.rawSourceRef)}</span>
|
|
256
|
+
<span class="manifest-arrow" aria-hidden="true">${zR}</span>
|
|
257
|
+
</a>`:'<span class="queue-dl-muted">None</span>';return`
|
|
258
|
+
<aside class="manifest-card">
|
|
259
|
+
<div class="manifest-header">
|
|
260
|
+
<div class="manifest-titles">
|
|
261
|
+
<p class="drydock-eyebrow">MANIFEST · CODEX</p>
|
|
262
|
+
<p class="manifest-subtitle">Document Manifest</p>
|
|
263
|
+
</div>
|
|
264
|
+
</div>
|
|
265
|
+
<dl class="queue-dl">
|
|
266
|
+
<dt class="queue-dl-key">Created</dt>
|
|
267
|
+
<dd class="queue-dl-value queue-dl-time">
|
|
268
|
+
<time datetime="${Je(a.created)}" title="${Je(l)}">
|
|
269
|
+
${Ae(l)}
|
|
270
|
+
<span class="queue-dl-relative">(${Ae(v)})</span>
|
|
271
|
+
</time>
|
|
272
|
+
</dd>
|
|
273
|
+
<dt class="queue-dl-key">Updated</dt>
|
|
274
|
+
<dd class="queue-dl-value queue-dl-time">
|
|
275
|
+
<time datetime="${Je(a.updated)}" title="${Je(m)}">
|
|
276
|
+
${Ae(m)}
|
|
277
|
+
<span class="queue-dl-relative">(${Ae(c)})</span>
|
|
278
|
+
</time>
|
|
279
|
+
</dd>
|
|
280
|
+
<dt class="queue-dl-key">Version</dt>
|
|
281
|
+
<dd class="queue-dl-value queue-dl-mono">v${a.version}</dd>
|
|
282
|
+
<dt class="queue-dl-key">Tags</dt>
|
|
283
|
+
<dd class="queue-dl-value">${h}</dd>
|
|
284
|
+
<dt class="queue-dl-key">Source</dt>
|
|
285
|
+
<dd class="queue-dl-value">${b}</dd>
|
|
286
|
+
</dl>
|
|
287
|
+
${u?`<div class="manifest-actions">${u}</div>`:""}
|
|
288
|
+
</aside>
|
|
289
|
+
`}const HR="modulepreload",UR=function(t){return"/console/"+t},j1={},PR=function(i,r,a){let l=Promise.resolve();if(r&&r.length>0){let u=function(h){return Promise.all(h.map(b=>Promise.resolve(b).then(p=>({status:"fulfilled",value:p}),p=>({status:"rejected",reason:p}))))};document.getElementsByTagName("link");const m=document.querySelector("meta[property=csp-nonce]"),c=m?.nonce||m?.getAttribute("nonce");l=u(r.map(h=>{if(h=UR(h),h in j1)return;j1[h]=!0;const b=h.endsWith(".css"),p=b?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${h}"]${p}`))return;const C=document.createElement("link");if(C.rel=b?"stylesheet":HR,b||(C.as="script"),C.crossOrigin="",C.href=h,c&&C.setAttribute("nonce",c),document.head.appendChild(C),b)return new Promise((w,A)=>{C.addEventListener("load",w),C.addEventListener("error",()=>A(new Error(`Unable to preload CSS for ${h}`)))})}))}function v(m){const c=new Event("vite:preloadError",{cancelable:!0});if(c.payload=m,window.dispatchEvent(c),!c.defaultPrevented)throw m}return l.then(m=>{for(const c of m||[])c.status==="rejected"&&v(c.reason);return i().catch(v)})},FR=".diagram-block[data-mermaid-source]:not([data-diagram-state='rendered']):not([data-diagram-state='error'])",qR=["a[href]","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])","[tabindex]:not([tabindex='-1'])"].join(","),WR=/^on/i,GR={USE_PROFILES:{svg:!0,svgFilters:!1},FORBID_TAGS:["foreignObject","script"],FORBID_ATTR:["href","xlink:href"]},z1="diagramInteractionBound",KR=/^oklch\s*\(\s*([^)]+)\s*\)$/i,YR=/^(-?\d+(?:\.\d+)?)(deg)?$/i,Tn=[25,50,75,100,125,150,200,300,400],VR=["pie1","pie2","pie3","pie4","pie5","pie6","pie7","pie8","pie9","pie10","pie11","pie12"];let Df=null,$1=!1,XR=0,ZR=0,yl=null;function fs(t){const i=t.trim();if(!i)return i;const r=yL(i);return r?SL(r):i}function JR(t){if($1)return;$1=!0,H1(t);const i=t instanceof Node?t:document.body;new MutationObserver(a=>{let l=!1;for(const v of a)if(v.type==="childList"){yl&&!yl.trigger.isConnected&&hl(!1);for(const m of v.addedNodes)if(m instanceof Element&&(m.matches?.(".diagram-block[data-mermaid-source]")||m.querySelector?.(".diagram-block[data-mermaid-source]"))){l=!0;break}if(l)break}l&&H1(t)}).observe(i,{childList:!0,subtree:!0})}function H1(t){const i=t.querySelectorAll(FR);for(const r of i)r.dataset.diagramHydrating!=="true"&&(r.dataset.diagramHydrating="true",r.dataset.diagramState="pending",QR(r))}async function QR(t){const i=t.getAttribute("data-mermaid-source")??"";let r="";try{r=wR(i)}catch{Of(t,"Invalid diagram source");return}if(!r.trim()){Of(t,"Empty diagram source");return}try{const a=await tL(),l=`mermaid-diagram-${++XR}`,{svg:v}=await a.render(l,r);t.innerHTML=eL(v),rL(t,v),sL(t),aL(t),t.dataset.diagramState="rendered"}catch(a){const l=a instanceof Error?a.message:String(a);Of(t,l)}}function Of(t,i){t.dataset.diagramState="error",t.textContent=`Diagram render failed: ${i}`}function eL(t){const i=(r,a)=>{WR.test(a.attrName)&&(a.keepAttr=!1)};gl.addHook("uponSanitizeAttribute",i);try{return gl.sanitize(t,GR)}finally{gl.removeHook("uponSanitizeAttribute",i)}}async function tL(){return Df||(Df=(async()=>{const t=await PR(()=>import("./mermaid.core-BWqsf-WS.js").then(r=>r.bC),[]),i=t.default??t;return i.initialize({securityLevel:"strict",htmlLabels:!1,suppressErrorRendering:!0,startOnLoad:!1,theme:"base",look:"handDrawn",themeVariables:iL(),themeCSS:nL(),flowchart:{htmlLabels:!1,useMaxWidth:!1}}),i})()),Df}function iL(){const t=getComputedStyle(document.documentElement),i=(A,x)=>{const g=t.getPropertyValue(A).trim();return fs(g||x)},r=i("--brass","#c69a4a"),a=i("--brass-bright","#e6b86a"),l=i("--brass-deep","#a0782a"),v=i("--aurora","#8bd7e6"),m=i("--aurora-deep","#1f8aa8"),c=i("--coral","#ef7c63"),u=i("--ink-deep","#1d2734"),h=i("--ink-fog","#a6afbb"),b=i("--ink-pearl","#e6e9ef"),p=i("--ink-spectral","#bcc4d0"),C=[a,r,v,c,fs("oklch(70% 0.11 68)"),m,fs("oklch(76% 0.09 205)"),l,fs("oklch(68% 0.14 30)"),h,fs("oklch(62% 0.08 228)"),fs("oklch(52% 0.05 248)")],w=Object.fromEntries(VR.map((A,x)=>[A,C[x]??u]));return{background:"transparent",primaryColor:"transparent",primaryTextColor:b,primaryBorderColor:r,secondaryColor:"transparent",secondaryTextColor:b,secondaryBorderColor:a,tertiaryColor:"transparent",tertiaryTextColor:p,tertiaryBorderColor:r,lineColor:m,edgeLabelBackground:"transparent",titleColor:a,fontFamily:"JetBrains Mono Variable, ui-monospace, monospace",mainBkg:"transparent",nodeBorder:r,clusterBkg:"transparent",clusterBorder:r,pieTitleTextColor:a,pieTitleTextSize:"19px",pieSectionTextColor:b,pieSectionTextSize:"13px",pieLegendTextColor:b,pieLegendTextSize:"14px",pieStrokeColor:l,pieStrokeWidth:"1.35px",pieOuterStrokeColor:a,pieOuterStrokeWidth:"2.5px",pieOpacity:"0.96",...w}}function nL(){const t=getComputedStyle(document.documentElement),i=(h,b)=>{const p=t.getPropertyValue(h).trim();return fs(p||b)},r=i("--brass-deep","#a0782a"),a=i("--brass-bright","#e6b86a"),l=i("--aurora-deep","#1f8aa8"),v=i("--ink-abyss","#131920"),m=fs("oklch(15% 0.04 250 / 34%)"),c=i("--surface-glass","#1d2734"),u=i("--ink-pearl","#e6e9ef");return`
|
|
290
|
+
.node rect, .node polygon, .node circle, .node ellipse, .actor, .classGroup rect {
|
|
291
|
+
stroke: ${r};
|
|
292
|
+
fill: ${c};
|
|
293
|
+
}
|
|
294
|
+
.edgePath path, .messageLine0, .messageLine1, .relation {
|
|
295
|
+
stroke: ${l};
|
|
296
|
+
}
|
|
297
|
+
.nodeLabel, .edgeLabel, .actor text, .messageText {
|
|
298
|
+
fill: ${u};
|
|
299
|
+
font-family: "Manrope Variable", "Manrope", ui-sans-serif, sans-serif;
|
|
300
|
+
}
|
|
301
|
+
.pieCircle {
|
|
302
|
+
stroke: ${r};
|
|
303
|
+
stroke-width: 1.35px;
|
|
304
|
+
opacity: 0.96;
|
|
305
|
+
filter: drop-shadow(0 0 1.5px ${m});
|
|
306
|
+
}
|
|
307
|
+
.pieOuterCircle {
|
|
308
|
+
stroke: ${a};
|
|
309
|
+
opacity: 0.7;
|
|
310
|
+
}
|
|
311
|
+
.slice, .legend text, .pieTitleText {
|
|
312
|
+
fill: ${u};
|
|
313
|
+
paint-order: stroke;
|
|
314
|
+
stroke: ${v};
|
|
315
|
+
stroke-width: 3px;
|
|
316
|
+
stroke-linejoin: round;
|
|
317
|
+
font-family: "Manrope Variable", "Manrope", ui-sans-serif, sans-serif;
|
|
318
|
+
}
|
|
319
|
+
.slice {
|
|
320
|
+
font-weight: 600;
|
|
321
|
+
letter-spacing: 0.04em;
|
|
322
|
+
font-style: italic;
|
|
323
|
+
}
|
|
324
|
+
.pieTitleText {
|
|
325
|
+
font-weight: 600;
|
|
326
|
+
letter-spacing: 0.12em;
|
|
327
|
+
font-style: italic;
|
|
328
|
+
}
|
|
329
|
+
.legend text {
|
|
330
|
+
font-weight: 500;
|
|
331
|
+
letter-spacing: 0.03em;
|
|
332
|
+
}
|
|
333
|
+
.legend rect {
|
|
334
|
+
rx: 999px;
|
|
335
|
+
ry: 999px;
|
|
336
|
+
opacity: 0.9;
|
|
337
|
+
stroke: ${v};
|
|
338
|
+
stroke-width: 1.5px;
|
|
339
|
+
paint-order: stroke;
|
|
340
|
+
filter: saturate(0.78) brightness(0.92) drop-shadow(0 0 0.55px ${a});
|
|
341
|
+
}
|
|
342
|
+
`}function rL(t,i){const r=new DOMParser().parseFromString(i,"image/svg+xml"),a=Array.from(r.querySelectorAll("a")),l=Array.from(t.querySelectorAll("a")),v=Math.min(a.length,l.length);for(let m=0;m<v;m++){const c=a[m],u=l[m];if(!c||!u)continue;const h=c.getAttribute("href")??c.getAttribute("xlink:href")??"",b=yS(h);b&&u.setAttribute("href",b)}}function sL(t){const i=t.querySelector("svg");if(!i)return;let r;try{r=i.getBBox()}catch{return}const{x:a,y:l,width:v,height:m}=r;!Number.isFinite(a)||!Number.isFinite(l)||!Number.isFinite(v)||!Number.isFinite(m)||a<0||l<0||v<=0||m<=0||i.setAttribute("viewBox",`${Fa(a)} ${Fa(l)} ${Fa(v)} ${Fa(m)}`)}function aL(t){t.tabIndex=0,t.setAttribute("aria-label","Open diagram in expanded view"),_L(t),t.dataset[z1]!=="true"&&(t.dataset[z1]="true",t.addEventListener("click",oL),t.addEventListener("keydown",lL))}function oL(t){if(t.metaKey||t.ctrlKey||t.shiftKey||t.altKey||t.button!==0||Eu(t.target))return;const i=t.currentTarget;i instanceof HTMLElement&&(t.preventDefault(),bS(i))}function lL(t){if(t.key!=="Enter"&&t.key!==" "||Eu(t.target))return;const i=t.currentTarget;i instanceof HTMLElement&&(t.preventDefault(),bS(i))}function bS(t){const i=t.querySelector("svg");if(!i)return;hl(!1);const r=typeof HTMLDialogElement<"u"&&typeof HTMLDialogElement.prototype.showModal=="function",a=document.createElement(r?"dialog":"div"),l=++ZR,v=`diagram-lightbox-title-${l}`;a.className="diagram-lightbox",a.setAttribute("aria-labelledby",v),r||(a.setAttribute("role","dialog"),a.setAttribute("aria-modal","true"),a.tabIndex=-1);const m=document.createElement("div");m.className="diagram-lightbox__frame";const c=document.createElement("div");c.className="diagram-lightbox__header";const u=document.createElement("h2");u.id=v,u.textContent="MANIFEST · DIAGRAM";const h=document.createElement("button");h.className="diagram-lightbox__close",h.type="button",h.setAttribute("aria-label","Close expanded diagram"),h.textContent="Close";const b=document.createElement("div");b.className="diagram-lightbox__controls",b.setAttribute("aria-label","Diagram zoom controls");const p=Zc("−","Zoom out","out"),C=document.createElement("span");C.className="diagram-lightbox__zoom-readout",C.setAttribute("aria-live","polite");const w=Zc("+","Zoom in","in"),A=Zc("Fit","Fit diagram to viewport","fit"),x=Zc("Reset","Reset diagram zoom","reset");b.append(p,C,w,A,x);const g=document.createElement("div");g.className="diagram-lightbox__viewport";const y=hL(i),f=i.cloneNode(!0);f.removeAttribute("style"),fL(f,`diagram-lightbox-svg-${l}`),g.append(f),c.append(u,b,h),m.append(c,g),a.append(m),document.body.append(a);const _=new cL(g,f,C,y);p.addEventListener("click",()=>_.zoomOut()),w.addEventListener("click",()=>_.zoomIn()),A.addEventListener("click",()=>_.fit()),x.addEventListener("click",()=>_.reset());const E=pL(a),L=k=>{(k.target===a||k.target===h)&&hl(!0)},R=k=>{if(k.key==="Escape"){k.preventDefault(),hl(!0);return}_.handleKeyboard(k)||k.key==="Tab"&&mL(k,a)},D={dialog:a,trigger:t,inertStates:E,onClick:L,onKeyDown:R,cleanupPanZoom:()=>_.destroy()};r&&(D.onCancel=k=>{k.preventDefault(),hl(!0)},a.addEventListener("cancel",D.onCancel),a.showModal()),a.addEventListener("click",L),document.addEventListener("keydown",R,!0),yl=D,_.fit(),h.focus()}function Zc(t,i,r){const a=document.createElement("button");return a.className="diagram-lightbox__zoom-button",a.type="button",a.dataset.zoomAction=r,a.setAttribute("aria-label",i),a.textContent=t,a}class cL{constructor(i,r,a,l){this.viewport=i,this.svg=r,this.readout=a,this.baseSize=l,this.applyZoom(this.zoomIndex),i.addEventListener("pointerdown",this.onPointerDown),i.addEventListener("pointermove",this.onPointerMove),i.addEventListener("pointerup",this.onPointerEnd),i.addEventListener("pointercancel",this.onPointerEnd),i.addEventListener("wheel",this.onWheel,{passive:!1}),i.addEventListener("dblclick",this.onDoubleClick),window.addEventListener("resize",this.onResize)}viewport;svg;readout;baseSize;zoomIndex=Tn.indexOf(100);dragStart=null;pinchStart=null;pointers=new Map;destroy(){this.viewport.removeEventListener("pointerdown",this.onPointerDown),this.viewport.removeEventListener("pointermove",this.onPointerMove),this.viewport.removeEventListener("pointerup",this.onPointerEnd),this.viewport.removeEventListener("pointercancel",this.onPointerEnd),this.viewport.removeEventListener("wheel",this.onWheel),this.viewport.removeEventListener("dblclick",this.onDoubleClick),window.removeEventListener("resize",this.onResize),this.pointers.clear()}zoomIn(){this.zoomAroundViewportCenter(Math.min(this.zoomIndex+1,Tn.length-1))}zoomOut(){this.zoomAroundViewportCenter(Math.max(this.zoomIndex-1,0))}reset(){this.zoomAroundViewportCenter(Tn.indexOf(100))}fit(){const i=this.viewport.clientWidth||this.viewport.getBoundingClientRect().width||this.baseSize.width,r=this.viewport.clientHeight||this.viewport.getBoundingClientRect().height||this.baseSize.height,a=Math.min(i/this.baseSize.width,r/this.baseSize.height),l=Math.floor(a*100),v=Tn.findIndex(c=>c>l),m=v===-1?Tn.length-1:Math.max(0,v-1);this.applyZoom(m),this.viewport.scrollLeft=Math.max(0,(this.svgWidth-i)/2),this.viewport.scrollTop=Math.max(0,(this.svgHeight-r)/2)}handleKeyboard(i){return i.key==="+"||i.key==="="?(i.preventDefault(),this.zoomIn(),!0):i.key==="-"||i.key==="_"?(i.preventDefault(),this.zoomOut(),!0):i.key==="0"?(i.preventDefault(),this.reset(),!0):i.key.toLowerCase()==="f"?(i.preventDefault(),this.fit(),!0):!1}get svgWidth(){return this.baseSize.width*(Jc(this.zoomIndex)/100)}get svgHeight(){return this.baseSize.height*(Jc(this.zoomIndex)/100)}applyZoom(i){this.zoomIndex=i;const r=Jc(this.zoomIndex),a=r/100;this.svg.setAttribute("width",Fa(this.baseSize.width*a)),this.svg.setAttribute("height",Fa(this.baseSize.height*a)),this.readout.textContent=`${r}%`}zoomAroundViewportCenter(i){const r=this.viewport.getBoundingClientRect();this.zoomAroundPoint(i,r.left+r.width/2,r.top+r.height/2)}zoomAroundPoint(i,r,a){if(i===this.zoomIndex)return;const l=this.svgWidth,v=this.svgHeight,m=this.viewport.getBoundingClientRect(),c=this.viewport.scrollLeft+r-m.left,u=this.viewport.scrollTop+a-m.top;this.applyZoom(i),this.viewport.scrollLeft=c/l*this.svgWidth-(r-m.left),this.viewport.scrollTop=u/v*this.svgHeight-(a-m.top)}onPointerDown=i=>{if(i.button!==0||Eu(i.target))return;const r=i.pointerId??1;if(this.pointers.set(r,i),this.pointers.size===2){this.pinchStart={distance:this.pointerDistance(),zoomIndex:this.zoomIndex};return}this.dragStart={x:i.clientX,y:i.clientY,scrollLeft:this.viewport.scrollLeft,scrollTop:this.viewport.scrollTop,pointerId:r},this.viewport.setPointerCapture?.(r)};onPointerMove=i=>{const r=i.pointerId??1;if(this.pointers.has(r)&&this.pointers.set(r,i),this.pinchStart&&this.pointers.size>=2){const a=this.pointerDistance()/this.pinchStart.distance,l=Jc(this.pinchStart.zoomIndex)*a;this.applyZoom(dL(l));return}!this.dragStart||this.dragStart.pointerId!==r||(i.preventDefault(),this.viewport.scrollLeft=this.dragStart.scrollLeft-(i.clientX-this.dragStart.x),this.viewport.scrollTop=this.dragStart.scrollTop-(i.clientY-this.dragStart.y))};onPointerEnd=i=>{const r=i.pointerId??1;this.pointers.delete(r),this.viewport.releasePointerCapture?.(r),this.dragStart?.pointerId===r&&(this.dragStart=null),this.pointers.size<2&&(this.pinchStart=null)};onWheel=i=>{if(!i.ctrlKey&&!i.metaKey)return;i.preventDefault();const r=i.deltaY<0?Math.min(this.zoomIndex+1,Tn.length-1):Math.max(this.zoomIndex-1,0);this.zoomAroundPoint(r,i.clientX,i.clientY)};onDoubleClick=i=>{Eu(i.target)||(i.preventDefault(),this.zoomAroundPoint(this.zoomIndex===Tn.indexOf(200)?Tn.indexOf(100):Tn.indexOf(200),i.clientX,i.clientY))};onResize=()=>{this.fit()};pointerDistance(){const[i,r]=Array.from(this.pointers.values());return!i||!r?1:Math.hypot(r.clientX-i.clientX,r.clientY-i.clientY)}}function uL(t){const i=U1(t.getAttribute("width")),r=U1(t.getAttribute("height"));if(i&&r)return{width:i,height:r};const a=t.getAttribute("viewBox")?.trim().split(/[\s,]+/).map(Number)??[],l=a[2],v=a[3],m=l!==void 0&&Number.isFinite(l)&&l>0?l:null,c=v!==void 0&&Number.isFinite(v)&&v>0?v:null;return{width:i??m??800,height:r??c??600}}function hL(t){const i=t.getBoundingClientRect();return i.width>0&&i.height>0?{width:i.width,height:i.height}:uL(t)}function U1(t){if(!t)return null;const i=/^(\d+(?:\.\d+)?)/.exec(t.trim());if(!i)return null;const r=Number(i[1]);return Number.isFinite(r)&&r>0?r:null}function Fa(t){return Number.isInteger(t)?String(t):t.toFixed(2).replace(/\.?0+$/,"")}function dL(t){let i=0,r=Number.POSITIVE_INFINITY;return Tn.forEach((a,l)=>{const v=Math.abs(a-t);v<r&&(r=v,i=l)}),i}function Jc(t){return Tn[t]??Tn[0]}function fL(t,i){const r=t.getAttribute("id")??"";t.setAttribute("id",i);const a=t.querySelector("style");!r||!a?.textContent||(a.textContent=a.textContent.split(`#${r}`).join(`#${i}`))}function hl(t){const i=yl;i&&(i.dialog.removeEventListener("click",i.onClick),document.removeEventListener("keydown",i.onKeyDown,!0),i.onCancel&&i.dialog.removeEventListener("cancel",i.onCancel),i.cleanupPanZoom(),gL(i.inertStates),i.dialog instanceof HTMLDialogElement&&i.dialog.open&&typeof i.dialog.close=="function"&&i.dialog.close(),i.dialog.remove(),yl=null,t&&i.trigger.isConnected&&i.trigger.focus())}function pL(t){const i=[];for(const r of Array.from(document.body.children))!(r instanceof HTMLElement)||r===t||(i.push({element:r,ariaHidden:r.getAttribute("aria-hidden"),inert:r.inert}),r.inert=!0,r.setAttribute("aria-hidden","true"));return i}function gL(t){for(const i of t)i.element.inert=i.inert,i.ariaHidden===null?i.element.removeAttribute("aria-hidden"):i.element.setAttribute("aria-hidden",i.ariaHidden)}function mL(t,i){const r=Array.from(i.querySelectorAll(qR)).filter(bL);if(r.length===0){t.preventDefault(),i.focus();return}const a=r[0],l=r[r.length-1];!a||!l||(t.shiftKey&&document.activeElement===a?(t.preventDefault(),l.focus()):!t.shiftKey&&document.activeElement===l&&(t.preventDefault(),a.focus()))}function _L(t){t.querySelector("a[href]")?t.removeAttribute("role"):t.setAttribute("role","button")}function Eu(t){if(!(t instanceof Element))return!1;const i=t.closest("a[href]");return!i||!(i.getAttribute("href")?.trim()??"")?!1:!vL(i)}function vL(t){return Array.from(t.children).some(i=>i.tagName.toLowerCase()==="svg")}function bL(t){return!(t.inert||t.hidden||t.getAttribute("aria-hidden")==="true"||"disabled"in t&&t.disabled)}function yS(t){const i=t.trim();if(!i||i.includes(".."))return null;if(/^[a-z][a-z0-9+.-]*:/i.test(i)){if(/^javascript:/i.test(i)||/^data:/i.test(i))return null;let a;try{a=new URL(i)}catch{return null}return a.origin!==window.location.origin?null:yS(a.pathname)}if(/^\/entry\/[^/?#]+$/.exec(i)){const a=i.slice(7);let l;try{l=decodeURIComponent(a)}catch{return null}return/^[A-Za-z0-9][A-Za-z0-9._-]{0,127}$/.test(l)?`/entry/${encodeURIComponent(l)}`:null}return/^[A-Za-z0-9][A-Za-z0-9._-]{0,127}$/.test(i)?`/entry/${encodeURIComponent(i)}`:null}function yL(t){const i=KR.exec(t);if(!i)return null;const r=i[1]?.trim();if(!r)return null;const a=r.indexOf("/"),l=a>=0?r.slice(0,a):r,v=a>=0?r.slice(a+1).trim():"",m=l.trim().split(/[\s,]+/).filter(Boolean);if(m.length!==3)return null;const[c,u,h]=m;if(!c||!u||!h)return null;const b=Bf(c,1),p=Bf(u,.4),C=CL(h);if(b===null||p===null||C===null)return null;let w=1;if(a>=0){const A=Bf(v,1);if(A===null)return null;w=A}return{L:b,C:p,h:C,alpha:w}}function SL(t){const i=t.h*Math.PI/180,r=t.C*Math.cos(i),a=t.C*Math.sin(i),l=t.L,v=l+.3963377774*r+.2158037573*a,m=l-.1055613458*r-.0638541728*a,c=l-.0894841775*r-1.291485548*a,u=v**3,h=m**3,b=c**3,p=4.0767416621*u-3.3077115913*h+.2309699292*b,C=-1.2684380046*u+2.6097574011*h-.3413193965*b,w=-.0041960863*u-.7034186147*h+1.707614701*b,A=Qc(Nf(p)),x=Qc(Nf(C)),g=Qc(Nf(w));if(t.alpha<1){const y=Qc(t.alpha);return`#${zs(A)}${zs(x)}${zs(g)}${zs(y)}`}return`#${zs(A)}${zs(x)}${zs(g)}`}function Bf(t,i){if(!t)return null;if(t.endsWith("%")){const a=Number(t.slice(0,-1));return Number.isFinite(a)?a/100*i:null}const r=Number(t);return Number.isFinite(r)?r:null}function CL(t){const i=YR.exec(t);if(!i)return null;const r=Number(i[1]);return Number.isFinite(r)?r:null}function Nf(t){const i=Math.max(0,Math.min(1,t));return i>.0031308?1.055*Math.pow(i,1/2.4)-.055:12.92*i}function Qc(t){return Math.round(Math.max(0,Math.min(1,t))*255)}function zs(t){return t.toString(16).padStart(2,"0")}function wL(t){const i=t.tags.map(a=>`<span class="chip chip-tag">${Ae(a)}</span>`).join(""),r=EL(t);return`
|
|
343
|
+
<div class="meta-chips">
|
|
344
|
+
${i}
|
|
345
|
+
${r}
|
|
346
|
+
<span class="chip">Updated ${Ae(xL(t.updated))}</span>
|
|
347
|
+
</div>
|
|
348
|
+
`}function SS(t){return t.map(i=>`<span class="chip chip-muted">${Ae(i)}</span>`).join("")}function xL(t){const i=new Date(t);return Number.isNaN(i.getTime())?t:i.toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"})}function EL(t){const i=TL(t);return i?`<span class="chip ${i.tone==="deprecated"?"chip-coral":i.tone==="stale"?"chip-stale":""}" title="${Je(i.title)}">${Ae(i.label)}</span>`:""}function TL(t,i=new Date){const r=t.status,a=typeof t.revalidateAfter=="string"&&!Number.isNaN(Date.parse(t.revalidateAfter))&&Date.parse(t.revalidateAfter)<i.getTime();return r==="deprecated"||r==="superseded"?{label:r,tone:"deprecated",title:a?`${r} · stale`:r}:a?{label:"stale",tone:"stale",title:t.revalidateAfter??"stale"}:r==="current"||r==="draft"?{label:r,tone:"neutral",title:r}:null}function AL(t,i,r){const a=kL(t,i,r);return a.length===0?"":`
|
|
349
|
+
<section class="related-list">
|
|
350
|
+
<h2>Related entries</h2>
|
|
351
|
+
<div class="related-items">
|
|
352
|
+
${a.map(l=>`
|
|
353
|
+
<a class="related-card" href="${Nr(l.entry.id)}" data-entry-id="${Je(l.entry.id)}">
|
|
354
|
+
<strong>${Ae(l.entry.title)}</strong>
|
|
355
|
+
<span>${SS(l.matchingTags)}</span>
|
|
356
|
+
</a>
|
|
357
|
+
`).join("")}
|
|
358
|
+
</div>
|
|
359
|
+
</section>
|
|
360
|
+
`}function kL(t,i,r){const a=new Set(i),l="en-US";return r.filter(v=>v.id!==t).map(v=>({entry:v,matchingTags:v.tags.filter(m=>a.has(m))})).filter(v=>v.matchingTags.length>0).sort((v,m)=>m.matchingTags.length-v.matchingTags.length||v.entry.title.localeCompare(m.entry.title,l,{sensitivity:"base",numeric:!0})).slice(0,5)}const RL=`
|
|
361
|
+
<svg class="arrow" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" width="16" height="16">
|
|
362
|
+
<path d="M5 12h14M13 6l6 6-6 6" />
|
|
363
|
+
</svg>
|
|
364
|
+
`;function LL(t,i,r=!0){const a=t.length,l=t.slice(0,6),v=t[0]??null;return`
|
|
365
|
+
<article class="document welcome">
|
|
366
|
+
<header class="welcome-title">
|
|
367
|
+
<p class="eyebrow">Fleet · Codex</p>
|
|
368
|
+
<h1>The <em>Codex</em></h1>
|
|
369
|
+
</header>
|
|
370
|
+
<div class="welcome-divider"></div>
|
|
371
|
+
<p class="lead">Navigate your workspace Fleet Wiki. Browse entries by tag from the left compass, or jump instantly with the <kbd>⌘K</kbd> command palette.</p>
|
|
372
|
+
${r?"":'<p class="error-box">No workspace is registered in this daemon. Re-run <code>fleet-wiki</code> in the target directory.</p>'}
|
|
373
|
+
<div class="workspace-meta">
|
|
374
|
+
<span class="chip chip-aurora">${a} entries</span>
|
|
375
|
+
${i?`<span class="workspace-path">${Ae(i)}</span>`:""}
|
|
376
|
+
</div>
|
|
377
|
+
${v?`
|
|
378
|
+
<a class="primary-link" href="${Je(Nr(v.id))}" data-entry-id="${Je(v.id)}">
|
|
379
|
+
<span>Open first entry — ${Ae(v.title)}</span>
|
|
380
|
+
${RL}
|
|
381
|
+
</a>
|
|
382
|
+
`:'<p class="empty-state">No wiki entries yet. Add entries with <code>wiki_ingest</code>.</p>'}
|
|
383
|
+
${l.length>0?`
|
|
384
|
+
<div class="welcome-grid">
|
|
385
|
+
${l.map(m=>`
|
|
386
|
+
<a class="welcome-card" href="${Je(Nr(m.id))}" data-entry-id="${Je(m.id)}">
|
|
387
|
+
<strong>${Ae(m.title)}</strong>
|
|
388
|
+
<span class="welcome-card-tags">${SS(m.tags.slice(0,3))}</span>
|
|
389
|
+
</a>
|
|
390
|
+
`).join("")}
|
|
391
|
+
</div>
|
|
392
|
+
`:""}
|
|
393
|
+
</article>
|
|
394
|
+
`}function ML(t,i){const r=to(t.body);return{toc:r.toc,html:`
|
|
395
|
+
<article class="document">
|
|
396
|
+
<header class="document-header">
|
|
397
|
+
<p class="eyebrow">Wiki Entry</p>
|
|
398
|
+
<h1>${Ae(t.frontmatter.title)}</h1>
|
|
399
|
+
${wL(t.frontmatter)}
|
|
400
|
+
</header>
|
|
401
|
+
<div class="markdown-body" id="markdown-body">
|
|
402
|
+
${r.html}
|
|
403
|
+
</div>
|
|
404
|
+
${AL(t.frontmatter.id,t.frontmatter.tags,i)}
|
|
405
|
+
</article>
|
|
406
|
+
`}}function DL(){return`
|
|
407
|
+
<article class="document">
|
|
408
|
+
<p class="loading">Loading entry</p>
|
|
409
|
+
</article>
|
|
410
|
+
`}function OL(t){return`
|
|
411
|
+
<article class="document">
|
|
412
|
+
<p class="error-box">${Ae(t)}</p>
|
|
413
|
+
</article>
|
|
414
|
+
`}const hu=new Set;let Lr="entries";const BL=`
|
|
415
|
+
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
|
|
416
|
+
<circle cx="11" cy="11" r="6.5" />
|
|
417
|
+
<path d="m20 20-3.5-3.5" />
|
|
418
|
+
</svg>
|
|
419
|
+
`,NL=`
|
|
420
|
+
<svg class="caret" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
|
|
421
|
+
<path d="m6 9 6 6 6-6" />
|
|
422
|
+
</svg>
|
|
423
|
+
`,IL=`
|
|
424
|
+
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" width="14" height="14">
|
|
425
|
+
<path d="M6 6 18 18M18 6 6 18" />
|
|
426
|
+
</svg>
|
|
427
|
+
`,jL=`
|
|
428
|
+
<svg viewBox="0 0 24 24" width="13" height="13" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
|
|
429
|
+
<circle cx="12" cy="5" r="2" />
|
|
430
|
+
<path d="M12 7v14M8 11H4a8 8 0 0 0 16 0h-4" />
|
|
431
|
+
</svg>
|
|
432
|
+
`;function zL(t,i,r,a=[],l=null,v){const m=t.length,c=UL(t),u=m===0?'<p class="empty-state">No wiki entries yet.</p>':Lr==="tags"?PL(t,i):FL(t,i),h=Lr==="tags"?`Tags · ${c}`:`Entries · ${m}`,b=Lr==="tags"?"tag-tree":"entry-list",p=Lr==="tags"?"Entries by tag":"All entries",C=GL(v??(typeof window<"u"?window.location.pathname:"")),w=C.startsWith("/queue"),A=C==="/index",x=C==="/log",g=C.startsWith("/conflicts"),y=r>0?`<span class="nav-drydock-badge">${r}</span>`:"";return`
|
|
433
|
+
<aside class="sidebar" id="sidebar">
|
|
434
|
+
<div class="sidebar-header">
|
|
435
|
+
<div class="sidebar-header-actions">
|
|
436
|
+
<button class="icon-button mobile-close" type="button" data-action="toggle-nav" aria-label="Close">${IL}</button>
|
|
437
|
+
</div>
|
|
438
|
+
</div>
|
|
439
|
+
<button class="command-entry" type="button" data-action="open-command">
|
|
440
|
+
<span class="command-entry-label">${BL}<span>Search entries</span></span>
|
|
441
|
+
<kbd>⌘K</kbd>
|
|
442
|
+
</button>
|
|
443
|
+
<div class="nav-drydock-section">
|
|
444
|
+
<a class="nav-drydock-link${w?" active":""}" href="${Je(Ka())}">
|
|
445
|
+
<span class="nav-drydock-icon">${jL}</span>
|
|
446
|
+
<span class="nav-drydock-label">Drydock</span>
|
|
447
|
+
${y}
|
|
448
|
+
</a>
|
|
449
|
+
<a class="nav-drydock-link${A?" active":""}" href="${Je(x3())}">
|
|
450
|
+
<span class="nav-drydock-label">Index</span>
|
|
451
|
+
</a>
|
|
452
|
+
<a class="nav-drydock-link${x?" active":""}" href="${Je(zy())}">
|
|
453
|
+
<span class="nav-drydock-label">Log</span>
|
|
454
|
+
</a>
|
|
455
|
+
<a class="nav-drydock-link${g?" active":""}" href="${Je(C3())}">
|
|
456
|
+
<span class="nav-drydock-label">Conflicts</span>
|
|
457
|
+
</a>
|
|
458
|
+
</div>
|
|
459
|
+
<div class="nav-tabs" role="tablist" aria-label="Navigation mode">
|
|
460
|
+
<button class="nav-tab${Lr==="entries"?" active":""}" type="button" role="tab" aria-selected="${Lr==="entries"}" data-action="set-nav-mode" data-mode="entries">
|
|
461
|
+
Entries
|
|
462
|
+
</button>
|
|
463
|
+
<button class="nav-tab${Lr==="tags"?" active":""}" type="button" role="tab" aria-selected="${Lr==="tags"}" data-action="set-nav-mode" data-mode="tags">
|
|
464
|
+
Tags
|
|
465
|
+
</button>
|
|
466
|
+
</div>
|
|
467
|
+
<p class="nav-section-label">${h}</p>
|
|
468
|
+
<nav class="${b}" aria-label="${p}">
|
|
469
|
+
${u}
|
|
470
|
+
</nav>
|
|
471
|
+
</aside>
|
|
472
|
+
`}function $L(t){if(hu.has(t)){hu.delete(t);return}hu.add(t)}function HL(t){Lr=t}function UL(t){const i=new Set;for(const r of t){if(r.tags.length===0){i.add("untagged");continue}for(const a of r.tags)i.add(a)}return i.size}function PL(t,i){return qL(t).map(a=>WL(a,i)).join("")}function FL(t,i){const r="en-US";return[...t].sort((l,v)=>l.title.localeCompare(v.title,r,{sensitivity:"base",numeric:!0})).map(l=>CS(l,i)).join("")}function qL(t){const i="en-US",r=new Map;for(const a of t){const l=a.tags.length>0?a.tags:["untagged"];for(const v of l){const m=r.get(v)??[];m.push(a),r.set(v,m)}}return[...r.entries()].map(([a,l])=>({tag:a,entries:l.sort((v,m)=>v.title.localeCompare(m.title,i,{sensitivity:"base",numeric:!0}))})).sort((a,l)=>a.tag.localeCompare(l.tag,i,{sensitivity:"base",numeric:!0}))}function WL(t,i){const r=hu.has(t.tag),a=r?"":t.entries.map(l=>CS(l,i)).join("");return`
|
|
473
|
+
<section class="tag-group" data-collapsed="${r?"true":"false"}">
|
|
474
|
+
<button class="tag-group-button" type="button" data-action="toggle-tag" data-tag="${Je(t.tag)}">
|
|
475
|
+
${NL}
|
|
476
|
+
<span>${t.tag==="untagged"?"Untagged":Ae(t.tag)}</span>
|
|
477
|
+
<span class="count">${t.entries.length}</span>
|
|
478
|
+
</button>
|
|
479
|
+
<div class="tag-group-list">${a}</div>
|
|
480
|
+
</section>
|
|
481
|
+
`}function CS(t,i){const r=t.id===i?" active":"",a=Je(t.title);return`
|
|
482
|
+
<a class="nav-entry${r}" href="${Nr(t.id)}" data-entry-id="${Je(t.id)}" title="${a}">
|
|
483
|
+
<span class="nav-entry-text">${Ae(t.title)}</span>
|
|
484
|
+
</a>
|
|
485
|
+
`}function GL(t){const i=t===zn||t===`${zn}/`?"/":t.startsWith(`${zn}/`)?t.slice(zn.length)||"/":t,r=i.match(/^\/w\/[^/]+(\/.*)?$/);return r?r[1]??"/":i}const KL=`
|
|
486
|
+
<svg viewBox="0 0 24 24" width="14" height="14" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
|
|
487
|
+
<path d="M15 18 9 12l6-6" />
|
|
488
|
+
</svg>
|
|
489
|
+
`,YL=`
|
|
490
|
+
<svg viewBox="0 0 24 24" width="18" height="18" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
|
|
491
|
+
<path d="M5 4h11a3 3 0 0 1 3 3v9.5a3.5 3.5 0 0 1-3.5 3.5H8a3 3 0 0 1-3-3V4z" />
|
|
492
|
+
<path d="M9 9h6M9 13h6" />
|
|
493
|
+
</svg>
|
|
494
|
+
`;function VL(t){const i=t.ref??"";let r;return t.loading?r='<p class="loading">Loading source</p>':t.error?r=`<p class="error-box">Failed to load source — ${Ae(t.error)}</p>`:t.content?r=`<div class="markdown-body">${to(t.content).html}</div>`:r='<p class="empty-state">Source is empty.</p>',`
|
|
495
|
+
<div class="raw-shell">
|
|
496
|
+
<header class="raw-header">
|
|
497
|
+
<a class="raw-back" href="/" data-action="navigate-home" aria-label="Back to Codex">
|
|
498
|
+
${KL}
|
|
499
|
+
<span>Codex</span>
|
|
500
|
+
</a>
|
|
501
|
+
<div class="raw-meta">
|
|
502
|
+
<span class="raw-glyph">${YL}</span>
|
|
503
|
+
<div class="raw-meta-text">
|
|
504
|
+
<p class="eyebrow">Manifest · Raw Source</p>
|
|
505
|
+
<h1 class="raw-title">${Ae(i)}</h1>
|
|
506
|
+
</div>
|
|
507
|
+
</div>
|
|
508
|
+
<div class="raw-divider"></div>
|
|
509
|
+
</header>
|
|
510
|
+
<article class="raw-document">
|
|
511
|
+
${r}
|
|
512
|
+
</article>
|
|
513
|
+
</div>
|
|
514
|
+
`}function ug(t,i){const r=t==="create_wiki"||!i,a=r?"+":"↻",l=r?"CREATE":"UPDATE";return`<span class="op-badge ${r?"op-badge--create":"op-badge--update"}" aria-label="${l}">
|
|
515
|
+
<span class="op-badge-glyph" aria-hidden="true">${a}</span>
|
|
516
|
+
<span class="op-badge-label">${l}</span>
|
|
517
|
+
</span>`}function XL(t){const{tab:i,items:r,pendingCount:a,archivedCount:l,loading:v,error:m}=t;if(v&&r.length===0)return'<div class="queue-view"><p class="loading">Loading patch queue</p></div>';if(m)return`<div class="queue-view"><p class="error-box">Failed to load queue — ${Ae(m)}</p></div>`;const c=r.length===0?ZL(i):r.map(b=>JL(b)).join(""),u=a>0?`<span class="queue-badge">${a}</span>`:"",h=l>0?`<span class="queue-badge queue-badge--muted">${l}</span>`:"";return`
|
|
518
|
+
<div class="queue-view">
|
|
519
|
+
<div class="queue-header">
|
|
520
|
+
<p class="drydock-eyebrow">MANIFEST · DRYDOCK</p>
|
|
521
|
+
<h1 class="queue-title">Patch Queue</h1>
|
|
522
|
+
</div>
|
|
523
|
+
<div class="queue-tabs" role="tablist" aria-label="Queue tabs">
|
|
524
|
+
<a class="queue-tab${i==="pending"?" active":""}"
|
|
525
|
+
href="${Je(Ka("pending"))}"
|
|
526
|
+
role="tab"
|
|
527
|
+
aria-selected="${i==="pending"}">
|
|
528
|
+
Pending${u}
|
|
529
|
+
</a>
|
|
530
|
+
<a class="queue-tab${i==="archived"?" active":""}"
|
|
531
|
+
href="${Je(Ka("archived"))}"
|
|
532
|
+
role="tab"
|
|
533
|
+
aria-selected="${i==="archived"}">
|
|
534
|
+
Archived${h}
|
|
535
|
+
</a>
|
|
536
|
+
</div>
|
|
537
|
+
<div class="queue-list">
|
|
538
|
+
${c}
|
|
539
|
+
</div>
|
|
540
|
+
</div>
|
|
541
|
+
`}function ZL(t){return`<p class="queue-empty">${t==="pending"?"No pending patches.":"No archived patches."}</p>`}function JL(t){const{id:i,meta:r,source:a,summary:l,op:v,target:m}=t,c=QL(r.status),u=xu(r.createdAt),h=r.warnings??[],b=h.slice(0,3).map(g=>`<span class="chip chip-muted">${Ae(g)}</span>`).join(""),p=h.length>3?`<span class="chip chip-muted">+${h.length-3}</span>`:"",C=a==="archive"?`<span class="chip">${Ae(r.status)}</span>`:"",w=v?ug(v,!0):"",A=l?`<p class="queue-card-summary">${Ae(l)}</p>`:"",x=m?`<span class="queue-card-target">${Ae(m)}</span>`:"";return`
|
|
542
|
+
<a class="queue-card" href="${Je(S3(i))}">
|
|
543
|
+
${A}
|
|
544
|
+
<div class="queue-card-top">
|
|
545
|
+
<span class="queue-card-id">${Ae(i)}</span>
|
|
546
|
+
${c}
|
|
547
|
+
</div>
|
|
548
|
+
<div class="queue-card-meta">
|
|
549
|
+
${w}
|
|
550
|
+
${x}
|
|
551
|
+
<span class="queue-card-time">${Ae(u)}</span>
|
|
552
|
+
${C}
|
|
553
|
+
<div class="queue-card-chips">
|
|
554
|
+
${b}${p}
|
|
555
|
+
</div>
|
|
556
|
+
</div>
|
|
557
|
+
</a>
|
|
558
|
+
`}function QL(t){return`<span class="status-dot ${t==="pending"?"status-dot--pending":t==="accepted"?"status-dot--accepted":"status-dot--rejected"}" aria-label="${Je(t)}"></span>`}const eM=`
|
|
559
|
+
<svg viewBox="0 0 24 24" width="14" height="14" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
|
|
560
|
+
<path d="M15 18 9 12l6-6" />
|
|
561
|
+
</svg>
|
|
562
|
+
`,tM=`
|
|
563
|
+
<svg viewBox="0 0 24 24" width="14" height="14" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
|
|
564
|
+
<path d="M7 17 17 7M9 7h8v8" />
|
|
565
|
+
</svg>
|
|
566
|
+
`;function iM(t){const{current:i,loading:r,error:a}=t;return r?'<div class="queue-detail-view"><p class="loading">Loading patch</p></div>':a?`<div class="queue-detail-view"><p class="error-box">Failed to load patch — ${Ae(a)}</p></div>`:i?nM(i,t):'<div class="queue-detail-view"><p class="empty-state">Patch not found.</p></div>'}function nM(t,i){const{patch:r,meta:a,wikiEntry:l,targetExists:v}=t,{frontmatter:m}=r,c=to(l.body),u=ug(m.op,v),h=a.rawSourceRef;return`
|
|
567
|
+
<div class="queue-detail-view">
|
|
568
|
+
<div class="queue-detail-layout">
|
|
569
|
+
<div class="queue-detail-main">
|
|
570
|
+
<a class="raw-back queue-back" href="${Je(Ka())}" aria-label="Back to Drydock">
|
|
571
|
+
${eM}
|
|
572
|
+
<span>Drydock</span>
|
|
573
|
+
</a>
|
|
574
|
+
<div class="queue-detail-header">
|
|
575
|
+
<p class="drydock-eyebrow">MANIFEST · PATCH</p>
|
|
576
|
+
<p class="queue-patch-id">${Ae(a.id)}</p>
|
|
577
|
+
<h1 class="queue-summary">${Ae(m.summary)}</h1>
|
|
578
|
+
${u}
|
|
579
|
+
</div>
|
|
580
|
+
<article class="document">
|
|
581
|
+
<div class="markdown-body" id="markdown-body">${c.html}</div>
|
|
582
|
+
</article>
|
|
583
|
+
</div>
|
|
584
|
+
<aside class="queue-rail">
|
|
585
|
+
${rM(t,h)}
|
|
586
|
+
${oM(c.toc)}
|
|
587
|
+
${aM(t)}
|
|
588
|
+
${sM(t,i)}
|
|
589
|
+
</aside>
|
|
590
|
+
</div>
|
|
591
|
+
</div>
|
|
592
|
+
`}function rM(t,i){const{patch:r,meta:a,targetExists:l}=t,{frontmatter:v}=r,m=ug(v.op,l),c=fp(a.createdAt),u=xu(a.createdAt),h=lM(a.status),b=a.warnings??[],p=i?`<dd class="queue-dl-value">
|
|
593
|
+
<a class="manifest-link queue-raw-link" href="${Je(jy(i))}" data-raw-ref="${Je(i)}">
|
|
594
|
+
<span class="manifest-ref">${Ae(i)}</span>
|
|
595
|
+
<span class="manifest-arrow">${tM}</span>
|
|
596
|
+
</a>
|
|
597
|
+
</dd>`:'<dd class="queue-dl-value queue-dl-muted">None</dd>',C=b.length>0?`<dt class="queue-dl-key">Warnings</dt>
|
|
598
|
+
<dd class="queue-dl-value">
|
|
599
|
+
<div class="queue-card-chips">
|
|
600
|
+
${b.map(w=>`<span class="chip chip-muted">${Ae(w)}</span>`).join("")}
|
|
601
|
+
</div>
|
|
602
|
+
</dd>`:"";return`
|
|
603
|
+
<div class="queue-rail-card">
|
|
604
|
+
<div class="queue-rail-header">
|
|
605
|
+
<p class="drydock-eyebrow">MANIFEST · PATCH</p>
|
|
606
|
+
<p class="queue-rail-subtitle">Patch Manifest</p>
|
|
607
|
+
</div>
|
|
608
|
+
<dl class="queue-dl">
|
|
609
|
+
<dt class="queue-dl-key">OP</dt>
|
|
610
|
+
<dd class="queue-dl-value">${m}</dd>
|
|
611
|
+
<dt class="queue-dl-key">Target</dt>
|
|
612
|
+
<dd class="queue-dl-value queue-dl-mono">${Ae(v.target)}</dd>
|
|
613
|
+
<dt class="queue-dl-key">Proposer</dt>
|
|
614
|
+
<dd class="queue-dl-value">${Ae(v.proposer)}</dd>
|
|
615
|
+
<dt class="queue-dl-key">Created</dt>
|
|
616
|
+
<dd class="queue-dl-value queue-dl-time">
|
|
617
|
+
<time datetime="${Je(a.createdAt)}" title="${Je(c)}">
|
|
618
|
+
${Ae(c)}
|
|
619
|
+
<span class="queue-dl-relative">(${Ae(u)})</span>
|
|
620
|
+
</time>
|
|
621
|
+
</dd>
|
|
622
|
+
<dt class="queue-dl-key">Status</dt>
|
|
623
|
+
<dd class="queue-dl-value queue-dl-status">${h}<span>${Ae(a.status)}</span></dd>
|
|
624
|
+
<dt class="queue-dl-key">Source</dt>
|
|
625
|
+
${p}
|
|
626
|
+
${C}
|
|
627
|
+
</dl>
|
|
628
|
+
</div>
|
|
629
|
+
`}function sM(t,i){const{meta:r,source:a}=t;if(r.status!=="pending"||a!=="queue")return"";const{actionPending:l,actionError:v}=i,m=l?" disabled":"",c=Je(r.id),u=v?`<p class="queue-action-error">${Ae(v)}</p>`:"";return`
|
|
630
|
+
<div class="queue-rail-card queue-actions-card">
|
|
631
|
+
<div class="queue-rail-header">
|
|
632
|
+
<p class="drydock-eyebrow">ACTIONS</p>
|
|
633
|
+
<p class="queue-rail-subtitle">Decision</p>
|
|
634
|
+
</div>
|
|
635
|
+
${l?'<span class="queue-action-spinner" aria-label="Processing"></span>':""}
|
|
636
|
+
<div class="queue-action-buttons">
|
|
637
|
+
<button class="queue-action-btn queue-action-btn--approve" type="button"
|
|
638
|
+
data-action="queue-approve" data-patch-id="${c}"${m}
|
|
639
|
+
aria-label="Approve this patch">
|
|
640
|
+
<svg viewBox="0 0 24 24" width="14" height="14" fill="none" stroke="currentColor" stroke-width="2.2" stroke-linecap="round" aria-hidden="true"><path d="M5 12h14M12 5l7 7-7 7"/></svg>
|
|
641
|
+
Approve
|
|
642
|
+
</button>
|
|
643
|
+
<button class="queue-action-btn queue-action-btn--reject" type="button"
|
|
644
|
+
data-action="queue-reject-toggle"${m}
|
|
645
|
+
aria-label="Reject this patch">
|
|
646
|
+
<svg viewBox="0 0 24 24" width="14" height="14" fill="none" stroke="currentColor" stroke-width="2.2" stroke-linecap="round" aria-hidden="true"><path d="M18 6 6 18M6 6l12 12"/></svg>
|
|
647
|
+
Reject
|
|
648
|
+
</button>
|
|
649
|
+
</div>
|
|
650
|
+
<form class="queue-reject-form" hidden data-action="queue-reject-submit" data-patch-id="${c}">
|
|
651
|
+
<textarea class="queue-reject-textarea" name="reason" minlength="1" maxlength="256" required placeholder="Enter rejection reason (max 256 chars)"></textarea>
|
|
652
|
+
<div class="queue-action-buttons">
|
|
653
|
+
<button class="queue-action-btn queue-action-btn--reject-submit" type="submit"${m}>Confirm</button>
|
|
654
|
+
<button class="queue-action-btn queue-action-btn--cancel" type="button" data-action="queue-reject-cancel"${m}>Cancel</button>
|
|
655
|
+
</div>
|
|
656
|
+
</form>
|
|
657
|
+
${u}
|
|
658
|
+
</div>
|
|
659
|
+
`}function aM(t){const i=t.patchSet;return!i||i.members.length===0?"":`
|
|
660
|
+
<div class="queue-rail-card">
|
|
661
|
+
<div class="queue-rail-header">
|
|
662
|
+
<p class="drydock-eyebrow">MANIFEST · DRYDOCK</p>
|
|
663
|
+
<p class="queue-rail-subtitle">Patch Set</p>
|
|
664
|
+
</div>
|
|
665
|
+
<p class="queue-patch-id">${Ae(i.id)}</p>
|
|
666
|
+
<ul class="patch-set-list">
|
|
667
|
+
${i.members.map(r=>`
|
|
668
|
+
<li class="patch-set-item">
|
|
669
|
+
<span class="patch-set-item-copy">
|
|
670
|
+
<strong>${Ae(r.summary??r.id)}</strong>
|
|
671
|
+
<small>${Ae(r.target??r.id)}</small>
|
|
672
|
+
</span>
|
|
673
|
+
<span class="chip ${r.status==="rejected"?"chip-coral":""}">${Ae(r.status??r.source)}</span>
|
|
674
|
+
</li>
|
|
675
|
+
`).join("")}
|
|
676
|
+
</ul>
|
|
677
|
+
</div>
|
|
678
|
+
`}function oM(t){return t.length===0?"":`
|
|
679
|
+
<div class="queue-rail-card queue-toc-card">
|
|
680
|
+
<div class="queue-rail-header">
|
|
681
|
+
<p class="drydock-eyebrow">CONTENTS</p>
|
|
682
|
+
</div>
|
|
683
|
+
<nav class="queue-toc-nav" aria-label="Table of contents">
|
|
684
|
+
${t.map(r=>`<a class="queue-toc-link queue-toc-level-${r.level}" href="#${Je(r.id)}">${Ae(r.text)}</a>`).join("")}
|
|
685
|
+
</nav>
|
|
686
|
+
</div>
|
|
687
|
+
`}function lM(t){return`<span class="status-dot ${t==="pending"?"status-dot--pending":t==="accepted"?"status-dot--accepted":"status-dot--rejected"}" aria-label="${Je(t)}"></span>`}function cM(t){return t.length===0?"":`
|
|
688
|
+
<nav class="toc-panel" aria-label="Table of contents">
|
|
689
|
+
<h2>Contents</h2>
|
|
690
|
+
${t.map(i=>`
|
|
691
|
+
<a class="toc-level-${i.level}" href="#${Je(i.id)}" data-toc-id="${Je(i.id)}">
|
|
692
|
+
${Ae(i.text)}
|
|
693
|
+
</a>
|
|
694
|
+
`).join("")}
|
|
695
|
+
</nav>
|
|
696
|
+
`}function uM(t){const i=t.entries.join(`
|
|
697
|
+
|
|
698
|
+
`),r=to(i);return`
|
|
699
|
+
<article class="document">
|
|
700
|
+
<header class="document-header">
|
|
701
|
+
<p class="eyebrow">MANIFEST · DRYDOCK</p>
|
|
702
|
+
<h1>Log</h1>
|
|
703
|
+
<div class="log-controls">
|
|
704
|
+
${[10,20,50,100].map(l=>`
|
|
705
|
+
<a class="chip ${l===t.limit?"chip-tag":""}" href="${zy(l)}">${l}</a>
|
|
706
|
+
`).join("")}
|
|
707
|
+
</div>
|
|
708
|
+
</header>
|
|
709
|
+
<p class="empty-state">${`Latest ${t.limit} of ${t.totalEntries} entries`}</p>
|
|
710
|
+
<div class="markdown-body">${r.html}</div>
|
|
711
|
+
</article>
|
|
712
|
+
`}const pp=new Set,Xs={tab:"pending",items:[],pendingCount:0,archivedCount:0,current:null,loading:!1,error:null,actionPending:!1,actionError:null};function Tu(){return Xs}function hM(t){return pp.add(t),()=>pp.delete(t)}async function dM(t){Xi({tab:t,loading:!0,error:null,current:null});try{const i=await zu(t);Xi({items:i.items,pendingCount:i.pendingCount,archivedCount:i.archivedCount,loading:!1}),Jp(i.pendingCount)}catch(i){Xi({loading:!1,error:Uu(i)})}}async function fM(t){Xi({loading:!0,error:null,current:null});try{const i=await d3(t);Xi({current:i,loading:!1})}catch(i){Xi({loading:!1,error:Uu(i)})}}function $s(){Xi({items:[],current:null,error:null,loading:!1,actionPending:!1,actionError:null})}async function pM(){if(Xs.actionPending)return;const t=Xs.current?.meta.id;if(t){Xi({actionPending:!0,actionError:null});try{await f3(t);const i=await zu("pending");Xi({actionPending:!1,pendingCount:i.pendingCount,archivedCount:i.archivedCount}),Jp(i.pendingCount),Ks(Ka("archived"))}catch(i){Xi({actionPending:!1,actionError:Uu(i)})}}}async function gM(t){if(Xs.actionPending)return;const i=Xs.current?.meta.id;if(!i)return;const r=t.trim();if(!r||r.length>256){Xi({actionError:r?"Rejection reason must be 256 characters or less.":"Please enter a rejection reason."});return}Xi({actionPending:!0,actionError:null});try{await p3(i,r);const a=await zu("pending");Xi({actionPending:!1,pendingCount:a.pendingCount,archivedCount:a.archivedCount}),Jp(a.pendingCount),Ks(Ka("archived"))}catch(a){Xi({actionPending:!1,actionError:Uu(a)})}}function Xi(t){Object.assign(Xs,t);for(const i of pp)i(Xs)}function Uu(t){return t instanceof Error?t.message:String(t)}const gp=new Set,ps={ref:null,content:null,loading:!1,error:null};function mM(){return ps}function _M(t){return gp.add(t),()=>gp.delete(t)}async function vM(t){if(!(ps.ref===t&&ps.content!==null&&!ps.error)){du({ref:t,content:null,loading:!0,error:null});try{const i=await h3(t);if(ps.ref!==t)return;du({content:i,loading:!1})}catch(i){if(ps.ref!==t)return;du({loading:!1,error:bM(i)})}}}function cs(){du({ref:null,content:null,loading:!1,error:null})}function du(t){Object.assign(ps,t);for(const i of gp)i(ps)}function bM(t){return t instanceof Error?t.message:String(t)}let Au,mp=!1;function yM(t,i={}){Au=t,mp=!1,document.documentElement.lang="en",y3(),j3();const r=A3(()=>qs()),a=_M(()=>qs()),l=hM(()=>qs()),v=b3(m=>{wS(m)});return document.addEventListener("click",P1),document.addEventListener("submit",F1),JR(t),i.initialWorkspaceId&&rp()!==i.initialWorkspaceId&&v3(l1(i.initialWorkspaceId)),SM(),{navigateToWorkspace(m){rp()!==m&&Ks(l1(m))},destroy(){r(),a(),l(),v(),document.removeEventListener("click",P1),document.removeEventListener("submit",F1),t.innerHTML=""}}}async function SM(){qs(),await k3(),await wS(kl())}async function wS(t){if(t.name==="entry"){$s(),cs(),await R3(t.id);return}if(t.name==="raw"){$s(),await vM(t.ref);return}if(t.name==="queue"){wf(),cs(),await dM(t.tab);return}if(t.name==="queue-detail"){wf(),cs(),await fM(t.patchId);return}if(t.name==="index-md"){$s(),cs(),await L3();return}if(t.name==="log"){$s(),cs(),await M3(t.limit);return}if(t.name==="conflicts"){$s(),cs(),await D3();return}if(t.name==="conflict-detail"){$s(),cs(),await O3(t.id);return}wf(),cs(),$s(),qs()}function qs(){const t=kl();if(t.name==="raw"){CM();return}wM(uu(),t)}function CM(){Au.innerHTML=`
|
|
713
|
+
${VL(mM())}
|
|
714
|
+
<div class="toast" id="toast" aria-live="polite"></div>
|
|
715
|
+
`}function wM(t,i){const r=i.name==="entry"?i.id:null,a=i.name==="queue"||i.name==="queue-detail",l=t.currentEntry?ML(t.currentEntry,t.index):null;I3(t.index,t.recentIds),Au.innerHTML=`
|
|
716
|
+
<div class="app-shell${a?" app-shell--wide":""}">
|
|
717
|
+
<button class="mobile-menu" type="button" data-action="toggle-nav" aria-label="Open menu">
|
|
718
|
+
<svg viewBox="0 0 24 24" width="18" height="18" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
|
|
719
|
+
<path d="M4 7h16M4 12h16M4 17h10" />
|
|
720
|
+
</svg>
|
|
721
|
+
</button>
|
|
722
|
+
${zL(t.index,r,t.pendingPatchCount,t.workspaces,t.currentWorkspaceId,window.location.pathname)}
|
|
723
|
+
<main class="content">
|
|
724
|
+
${xM(t,i,l)}
|
|
725
|
+
</main>
|
|
726
|
+
<div class="rail">
|
|
727
|
+
${EM(t,i,l)}
|
|
728
|
+
</div>
|
|
729
|
+
</div>
|
|
730
|
+
<div class="toast" id="toast" aria-live="polite"></div>
|
|
731
|
+
`,mp?Au.classList.add("is-revealed"):mp=!0}function xM(t,i,r){return i.name==="queue"?XL(Tu()):i.name==="queue-detail"?iM(Tu()):t.error?OL(t.error):t.loading&&!t.currentEntry&&!t.indexMarkdown&&!t.log&&!t.currentConflict?DL():i.name==="index-md"&&t.indexMarkdown?jR(t.indexMarkdown):i.name==="log"&&t.log?uM(t.log):i.name==="conflicts"?NR(t.conflicts):i.name==="conflict-detail"&&t.currentConflict?IR(t.currentConflict):t.currentEntry&&r?r.html:LL(t.index,t.health?.cwd??null,!!t.currentWorkspaceId)}function EM(t,i,r){return i.name==="queue"||i.name==="queue-detail"?"":`
|
|
732
|
+
${$R(t.currentEntry,t.index,t.currentMatchHint)}
|
|
733
|
+
${r?cM(r.toc):""}
|
|
734
|
+
`}function P1(t){const i=t.target;if(!(i instanceof Element))return;const r=i.closest("[data-action]");if(r?.dataset.action==="toggle-nav"){document.body.classList.toggle("nav-open");return}if(r?.dataset.action==="navigate-home"){if(W1(t))return;t.preventDefault(),document.body.classList.remove("nav-open"),Ks($y());return}if(r?.dataset.action==="set-nav-mode"){const m=r.dataset.mode;(m==="tags"||m==="entries")&&(HL(m),qs());return}if(r?.dataset.action==="toggle-tag"){$L(r.dataset.tag??""),qs();return}if(r?.dataset.action==="copy-code"){TM(r);return}if(r?.dataset.action==="copy-compact-context"){const m=uu();m.currentEntry&&fu(My(m.currentEntry),"Copied compact context.");return}if(r?.dataset.action==="copy-provenance-context"){const m=uu();m.currentEntry&&fu(Dy(m.currentEntry),"Copied provenance context.");return}if(r?.dataset.action==="copy-related-context"){const m=uu();m.currentEntry&&fu(Oy(m.currentEntry,m.index),"Copied related context pack.");return}if(r?.dataset.action==="toggle-why-matched"){const m=r.closest(".context-actions-grid")?.querySelector(".context-why-matched");m&&(m.hidden=!m.hidden);return}if(r?.dataset.action==="queue-approve"){if(Tu().actionPending||!confirm("Approve this patch?"))return;r.setAttribute("disabled",""),pM();return}if(r?.dataset.action==="queue-reject-toggle"){const c=r.closest(".queue-actions-card")?.querySelector(".queue-reject-form");c&&(c.hidden=!c.hidden,c.hidden||c.querySelector("textarea")?.focus());return}if(r?.dataset.action==="queue-reject-cancel"){const c=r.closest(".queue-actions-card")?.querySelector(".queue-reject-form");c&&(c.hidden=!0);return}const a=i.closest("[data-toc-id]");if(a){t.preventDefault(),document.getElementById(a.dataset.tocId??"")?.scrollIntoView({behavior:"smooth",block:"start"});return}const l=i.closest("a");if(!l||W1(t))return;const v=AM(l);v&&(t.preventDefault(),document.body.classList.remove("nav-open"),Ks(v))}function F1(t){const i=t.target;if(i instanceof HTMLFormElement&&i.dataset.action==="queue-reject-submit"){if(t.preventDefault(),Tu().actionPending)return;const r=i.querySelector("button[type='submit']");r&&(r.disabled=!0);const a=i.querySelector("textarea[name='reason']");gM(a?.value??"")}}async function TM(t){const r=t.closest(".code-block")?.dataset.code??"";r&&await fu(r,"Code copied.")}async function fu(t,i){try{await navigator.clipboard.writeText(t),q1(i)}catch{q1("Failed to copy to clipboard.")}}function q1(t){const i=document.querySelector("#toast");i&&(i.textContent=t,i.classList.add("visible"),window.setTimeout(()=>i.classList.remove("visible"),1400))}function W1(t){return t.metaKey||t.ctrlKey||t.shiftKey||t.altKey||t.button!==0}function AM(t){const i=t.getAttribute("href")??"",r=t.dataset.entryId;if(r)return Nr(decodeURIComponent(r));if(/^[a-z][a-z0-9+.-]*:/i.test(i)&&!i.startsWith(window.location.origin))return null;const a=new URL(i,window.location.origin);if(a.origin!==window.location.origin)return null;if(a.pathname==="/"||a.pathname==="/console/codex"||a.pathname==="/console/codex/")return $y();if(a.pathname.match(/^\/w\/[^/]+(\/|$)/)||a.pathname.match(/^\/console\/codex\/w\/[^/]+(\/|$)/))return a.pathname+a.search;if(a.pathname.startsWith("/console/codex/entry/")||a.pathname.startsWith("/console/codex/raw/"))return a.pathname;if(a.pathname.startsWith("/console/codex/queue")||a.pathname.startsWith("/console/codex/conflicts")||a.pathname==="/console/codex/index"||a.pathname==="/console/codex/index-md"||a.pathname==="/console/codex/log")return a.pathname+a.search;if(a.pathname.startsWith("/entry/")||a.pathname.startsWith("/raw/"))return a.pathname;if(a.pathname.startsWith("/queue")||a.pathname.startsWith("/conflicts")||a.pathname==="/index"||a.pathname==="/index-md"||a.pathname==="/log")return a.pathname+a.search;if(!a.pathname.endsWith(".md"))return null;const l=a.pathname.split("/").pop()??"",v=decodeURIComponent(l.replace(/\.md$/,""));return v?Nr(v):null}function kM({state:t}){const i=q.useRef(null),r=q.useRef(null),a=t.theaters.find(m=>m.id===t.activeTheaterId)??null,l=a?.id??null,v=!!a?.hasWiki;return q.useEffect(()=>{if(!v){r.current?.destroy(),r.current=null;return}const m=i.current;if(!m||!l||r.current)return;const c=yM(m,{initialWorkspaceId:l});return r.current=c,()=>{c.destroy(),r.current===c&&(r.current=null)}},[v]),q.useEffect(()=>{!v||!l||r.current?.navigateToWorkspace(l)},[l,v]),!t.activeTheaterId||t.theaters.length===0?T.jsxs("section",{className:"codex-empty-state",children:[T.jsx("p",{className:"codex-empty-eyebrow",children:"Codex"}),T.jsx("h1",{children:"Add a Theater"}),T.jsx("p",{children:"Use the top bar Theater control to choose a project root before opening Codex."})]}):a?.hasWiki?T.jsx("div",{className:"codex-host",ref:i}):T.jsxs("section",{className:"codex-empty-state",children:[T.jsx("p",{className:"codex-empty-eyebrow",children:"Codex unavailable"}),T.jsx("h1",{children:a?.label??"This Theater"}),T.jsx("p",{children:"This Theater does not have Fleet Wiki data mounted."})]})}const RM="button",LM=184,MM=320,eu=12;function hg({state:t,onSelect:i,mode:r=RM,anchor:a,viewportBounds:l,onClose:v}){const[m,c]=q.useState(r==="menu"),u=q.useRef(null),h=q.useRef(null),b=q.useRef(null),p=t.creatingTerminalSession||t.addingTheater||!t.activeTheaterId||t.agentClis.length===0,C=r==="menu"||m;q.useEffect(()=>{r==="menu"&&c(!0)},[r,a?.x,a?.y]),q.useEffect(()=>{if(!C)return;const g=f=>{u.current?.contains(f.target)||w()},y=f=>{f.key==="Escape"&&(w(),h.current?.focus())};return document.addEventListener("mousedown",g),document.addEventListener("keydown",y),()=>{document.removeEventListener("mousedown",g),document.removeEventListener("keydown",y)}},[C]),q.useEffect(()=>{C&&b.current?.focus()},[C]);const w=()=>{c(!1),v?.()},A=async g=>{p||(c(!1),h.current?.focus(),await i(g))},x=g=>{if(g.key!=="ArrowDown"&&g.key!=="ArrowUp")return;g.preventDefault();const y=Array.from(b.current?.querySelectorAll("[role^='menuitem']")??[]);if(y.length===0)return;const f=y.indexOf(document.activeElement),_=f===-1?g.key==="ArrowDown"?0:y.length-1:(f+(g.key==="ArrowDown"?1:-1)+y.length)%y.length;y[_]?.focus()};return T.jsxs("div",{className:`operation-launch-control ${r==="menu"?"operation-launch-control--canvas":""}`,ref:u,style:a?DM(a,l):void 0,"data-canvas-blocker":!0,children:[r==="button"?T.jsx("button",{type:"button",ref:h,className:`workspace-add-button ${m?"is-open":""}`,onClick:()=>c(g=>!g),disabled:p,"aria-haspopup":"menu","aria-expanded":m,"aria-label":"Launch operation",children:T.jsx(OM,{})}):null,C?T.jsx("div",{className:"operation-launch-menu theater-menu",role:"menu","aria-label":"Launch operation",tabIndex:-1,ref:b,onKeyDown:x,children:t.agentClis.length>0?T.jsx("ul",{className:"theater-menu-list",children:t.agentClis.map(g=>T.jsx("li",{children:T.jsxs("button",{type:"button",role:"menuitem",className:"theater-menu-item operation-launch-menu-item",disabled:p,onClick:()=>{A(g)},children:[T.jsx("span",{className:"theater-menu-check","aria-hidden":"true",children:BM(g.id)}),T.jsx("span",{className:"theater-menu-label",children:g.label})]})},g.id))}):T.jsx("p",{className:"theater-menu-empty",children:"No Agent CLI available."})}):null]})}function DM(t,i){return i?{left:Math.max(eu,Math.min(t.x,i.width-LM-eu)),top:Math.max(eu,Math.min(t.y,i.height-MM-eu))}:{left:t.x,top:t.y}}function OM(){return T.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:T.jsx("path",{d:"M8 3.4v9.2M3.4 8h9.2",fill:"none",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round"})})}function BM(t){return t==="claude"?T.jsx(NM,{}):t==="claude-kimi"?T.jsx(IM,{}):t==="codex"?T.jsx(jM,{}):T.jsx(zM,{})}function NM(){return T.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:T.jsx("path",{d:"M8 2.6 9.15 6.85 13.4 8 9.15 9.15 8 13.4 6.85 9.15 2.6 8 6.85 6.85Z",fill:"none",stroke:"currentColor",strokeWidth:"1.15",strokeLinejoin:"round"})})}function IM(){return T.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:T.jsx("path",{d:"M9.7 3.2A5 5 0 1 0 9.7 12.8 4 4 0 1 1 9.7 3.2Z",fill:"none",stroke:"currentColor",strokeWidth:"1.15",strokeLinejoin:"round"})})}function jM(){return T.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:T.jsx("path",{d:"M6.2 4.8 3.2 8 6.2 11.2M9.8 4.8 12.8 8 9.8 11.2",fill:"none",stroke:"currentColor",strokeWidth:"1.15",strokeLinecap:"round",strokeLinejoin:"round"})})}function zM(){return T.jsxs("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:[T.jsx("rect",{x:"2.8",y:"3.4",width:"10.4",height:"8.2",rx:"1.4",fill:"none",stroke:"currentColor",strokeWidth:"1.15"}),T.jsx("path",{d:"M5 6.2 6.7 8 5 9.8M7.8 9.8h3",fill:"none",stroke:"currentColor",strokeWidth:"1.15",strokeLinecap:"round",strokeLinejoin:"round"})]})}const $M="fleet-console.canvas.",xS="fleet-console.canvas.backgroundAnimation",HM=400,_p=640,vp=400,G1=40,K1=96,UM=.25,PM=1,dl={x:0,y:0,zoom:1},Ga={viewport:dl,panels:{}},bp=new Set,yp=new Set;let Sl=null,gs=null,Zi=Ga,pu=t6();function FM(t){return bp.add(t),()=>{bp.delete(t)}}function Y1(){return Zi}function qM(){return q.useSyncExternalStore(FM,Y1,Y1)}function WM(){return q.useSyncExternalStore(VM,V1,V1)}function Pu(t){Zi={viewport:t.viewport??Zi.viewport,panels:t.panels??Zi.panels},ZM(),AS()}function ES(t){Pu({viewport:LS(t)})}function qa(t,i){Pu({panels:{...Zi.panels,[t]:{...fg(i,Cl()),zIndex:Cl()}}})}function TS(t){const i=Zi.panels[t];if(i)return i;const r=Object.keys(Zi.panels).length,a={x:r*G1,y:r*G1,width:_p,height:vp,zIndex:Cl()};return qa(t,a),a}function GM(t){const i=new Set(t),r={};let a=!1;for(const[l,v]of Object.entries(Zi.panels))i.has(l)?r[l]=v:a=!0;a&&Pu({panels:r})}function KM(t){JM(),Sl=t,Zi=t?e6(t):Ga,AS()}function dg(t,i){const r=Zi.panels[t];if(!r)return;const a=Math.max(UM,Math.min(PM,Math.min((i.width-K1)/r.width,(i.height-K1)/r.height)));Pu({viewport:{x:i.width/2-(r.x+r.width/2)*a,y:i.height/2-(r.y+r.height/2)*a,zoom:a},panels:{...Zi.panels,[t]:{...fg(r,Cl()),zIndex:Cl()}}})}function YM(){pu=!pu,i6(pu),XM()}function VM(t){return yp.add(t),()=>{yp.delete(t)}}function V1(){return pu}function AS(){for(const t of bp)t()}function XM(){for(const t of yp)t()}function ZM(){!Sl||typeof window>"u"||(QM(),gs=window.setTimeout(()=>{gs=null,kS(Sl,Zi)},HM))}function JM(){!gs||!Sl||typeof window>"u"||(window.clearTimeout(gs),gs=null,kS(Sl,Zi))}function QM(){!gs||typeof window>"u"||(window.clearTimeout(gs),gs=null)}function e6(t){if(typeof window>"u")return Ga;try{const i=window.localStorage.getItem(RS(t));if(!i)return Ga;const r=JSON.parse(i);return n6(r)}catch{return Ga}}function kS(t,i){if(!(!t||typeof window>"u"))try{window.localStorage.setItem(RS(t),JSON.stringify(i))}catch{}}function t6(){if(typeof window>"u")return!0;try{const t=window.localStorage.getItem(xS);return t===null?!0:t==="true"}catch{return!0}}function i6(t){if(!(typeof window>"u"))try{window.localStorage.setItem(xS,String(t))}catch{}}function RS(t){return`${$M}${t}`}function n6(t){return wl(t)?{viewport:LS(t.viewport),panels:r6(t.panels)}:Ga}function LS(t){if(!wl(t))return dl;const i=ml(t.x,dl.x),r=ml(t.y,dl.y),a=Sp(t.zoom,dl.zoom);return{x:i,y:r,zoom:a}}function r6(t){if(!wl(t))return{};const i={};for(const[r,a]of Object.entries(t))wl(a)&&(i[r]=fg(a,MS(i)));return i}function fg(t,i){return wl(t)?{x:ml(t.x,0),y:ml(t.y,0),width:Sp(t.width,_p),height:Sp(t.height,vp),zIndex:ml(t.zIndex,i)}:{x:0,y:0,width:_p,height:vp,zIndex:i}}function Cl(){return MS(Zi.panels)}function MS(t){return Math.max(0,...Object.values(t).map(i=>i.zIndex))+1}function ml(t,i){return typeof t=="number"&&Number.isFinite(t)?t:i}function Sp(t,i){return typeof t=="number"&&Number.isFinite(t)&&t>0?t:i}function wl(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}function DS({jobs:t,selectedJobId:i,onSelect:r}){const a=r??Bu;return T.jsx("ol",{className:"terminal-job-lines",children:t.map(l=>T.jsx(s6,{job:l,active:i===l.jobId,onSelect:a},l.jobId))})}function s6({job:t,active:i,onSelect:r}){const a=ms(t.status),l=Yx(t),v=t.ownerCarrierId?`${Ip(t.ownerCarrierId)} · ${Ws(t.status)}`:Ws(t.status);return T.jsx("li",{children:T.jsxs("button",{type:"button",className:`terminal-job-line ${i?"is-active":""}`,onClick:()=>r(t.jobId),"aria-current":i||void 0,children:[T.jsx("span",{className:`status-dot status-dot--${a}`,"aria-hidden":"true"}),T.jsx("span",{className:"terminal-job-line-label",children:t.label??vl(t.jobId)}),T.jsx("span",{className:"terminal-job-line-meta",children:v}),l?T.jsxs(T.Fragment,{children:[T.jsx("span",{className:"terminal-job-line-sep","aria-hidden":"true",children:"-"}),T.jsx("span",{className:"terminal-job-line-stream",children:l})]}):null]})})}const a6=["n","ne","e","se","s","sw","w","nw"],If=320,jf=200;function o6({geometry:t,zoom:i,onResize:r}){const a=q.useRef(null),l=(c,u)=>{u.preventDefault(),u.stopPropagation(),a.current={direction:c,pointerId:u.pointerId,startX:u.clientX,startY:u.clientY,geometry:t},u.currentTarget.setPointerCapture(u.pointerId)},v=c=>{const u=a.current;if(!u||u.pointerId!==c.pointerId)return;c.preventDefault(),c.stopPropagation();const h=(c.clientX-u.startX)/i,b=(c.clientY-u.startY)/i;r(l6(u.geometry,u.direction,h,b))},m=c=>{a.current?.pointerId===c.pointerId&&(c.preventDefault(),c.stopPropagation(),a.current=null,c.currentTarget.releasePointerCapture(c.pointerId))};return T.jsx(T.Fragment,{children:a6.map(c=>T.jsx("div",{className:`canvas-panel-resize canvas-panel-resize--${c}`,onPointerDown:u=>l(c,u),onPointerMove:v,onPointerUp:m,onPointerCancel:m,"data-canvas-blocker":!0,"aria-hidden":"true"},c))})}function l6(t,i,r,a){let{x:l,y:v,width:m,height:c}=t;return i.includes("e")&&(m+=r),i.includes("s")&&(c+=a),i.includes("w")&&(l+=r,m-=r),i.includes("n")&&(v+=a,c-=a),m<If&&(i.includes("w")&&(l-=If-m),m=If),c<jf&&(i.includes("n")&&(v-=jf-c),c=jf),{...t,x:l,y:v,width:m,height:c}}function c6({state:t,session:i,geometry:r,viewport:a,active:l,getCanvasRect:v}){const m=q.useRef(null),[c,u]=q.useState(null),b=Nu(t,i).filter(({job:k})=>!Zn(k.status)).map(({job:k})=>k),p=b.length,C=i.status==="dormant",w=p>0||i.status==="registered"||i.status==="live"||i.status==="terminal-only",A=Tl(i),x=()=>{Br(i.sessionId),qa(i.sessionId,r)},g=k=>{l||Br(i.sessionId),Bu(k)},y=k=>{k.button===0&&(k.preventDefault(),k.stopPropagation(),x(),m.current={pointerId:k.pointerId,startX:k.clientX,startY:k.clientY,geometry:r},k.currentTarget.setPointerCapture(k.pointerId))},f=k=>{const N=m.current;!N||N.pointerId!==k.pointerId||(k.preventDefault(),k.stopPropagation(),qa(i.sessionId,{...N.geometry,x:N.geometry.x+(k.clientX-N.startX)/a.zoom,y:N.geometry.y+(k.clientY-N.startY)/a.zoom}))},_=k=>{m.current?.pointerId===k.pointerId&&(k.preventDefault(),k.stopPropagation(),m.current=null,k.currentTarget.releasePointerCapture(k.pointerId))},E=k=>{k.stopPropagation()},L=()=>{if(x(),c){ES(c),u(null);return}const k=v();k&&(u(a),qa(i.sessionId,r),dg(i.sessionId,{width:k.width,height:k.height}))},R=k=>{k.stopPropagation(),x()},D=k=>{k.stopPropagation()};return T.jsxs(T.Fragment,{children:[T.jsxs("article",{className:`canvas-panel ${l?"is-active":""}`,style:{left:r.x,top:r.y,width:r.width,height:r.height,zIndex:r.zIndex},onPointerDown:x,"data-canvas-panel":!0,"aria-label":`Operation ${A}`,children:[T.jsxs("div",{className:"canvas-panel-titlebar",onPointerDown:y,onPointerMove:f,onPointerUp:_,onPointerCancel:_,"data-canvas-blocker":!0,children:[T.jsx("span",{className:`tenant-beacon ${w?"is-live":C?"is-dormant":""}`,"aria-hidden":"true"}),T.jsx("span",{className:"canvas-panel-title",children:A}),T.jsx("span",{className:"canvas-panel-cli",children:i.cliLabel??i.cliId??"CLI"}),p>0?T.jsx("span",{className:"canvas-panel-job-count",children:p}):null,T.jsx("button",{type:"button",className:`canvas-panel-icon-button ${c?"is-active":""}`,onPointerDown:E,onClick:L,"aria-label":c?"터미널 포커스 복귀":"터미널 확대 포커스",title:c?"Restore canvas":"Focus terminal",children:c?T.jsx(f6,{}):T.jsx(d6,{})}),T.jsx("button",{type:"button",className:"canvas-panel-icon-button",onPointerDown:E,onClick:()=>{h6(i.sessionId)},"aria-label":`${C?"Forget":"Terminate"} operation ${A}`,title:C?"Forget operation":"Terminate operation",children:T.jsx(p6,{})})]}),T.jsx("div",{className:"canvas-panel-terminal",onPointerDown:R,onWheel:D,"data-canvas-blocker":!0,children:C?T.jsxs("button",{type:"button",className:"canvas-panel-dormant",onClick:()=>{u6(i.sessionId)},children:[T.jsx("span",{className:"canvas-panel-dormant-status",children:"Dormant"}),T.jsx("span",{className:"canvas-panel-dormant-action",children:"Resume"})]}):T.jsx(Gp,{sessionId:i.sessionId,active:l,onExit:()=>Al(i.sessionId)})}),T.jsx(o6,{geometry:r,zoom:a.zoom,onResize:k=>qa(i.sessionId,k)})]}),b.length>0?T.jsx("div",{className:"canvas-panel-jobdock",style:{left:r.x,top:r.y,width:r.width,zIndex:r.zIndex},"data-canvas-blocker":!0,"aria-label":`Active carrier jobs for ${A}`,children:T.jsx(DS,{jobs:b,selectedJobId:t.selectedJobId,onSelect:g})}):null]})}async function u6(t){try{const i=await Mu(t);Gs(i),Br(i.sessionId)}catch(i){Ou(i instanceof Error?i.message:String(i))}}async function h6(t){try{await Np(t)}catch(i){Hp(i instanceof Error?i.message:String(i));return}Al(t)}function d6(){return T.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:T.jsx("path",{d:"M5.8 3.4H3.4v2.4M10.2 3.4h2.4v2.4M5.8 12.6H3.4v-2.4M10.2 12.6h2.4v-2.4",fill:"none",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round"})})}function f6(){return T.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:T.jsx("path",{d:"M3.8 6h2.4V3.6M12.2 6H9.8V3.6M3.8 10h2.4v2.4M12.2 10H9.8v2.4",fill:"none",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round"})})}function p6(){return T.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:T.jsx("path",{d:"M4.6 4.6 11.4 11.4M11.4 4.6 4.6 11.4",fill:"none",stroke:"currentColor",strokeWidth:"1.35",strokeLinecap:"round"})})}function g6({viewport:t,backgroundAnimationEnabled:i}){return T.jsxs("div",{className:"operations-canvas-background","aria-hidden":"true",children:[T.jsx("div",{className:"operations-canvas-sea"}),T.jsx("div",{className:"operations-canvas-grid",style:{backgroundPosition:`${t.x}px ${t.y}px`,backgroundSize:`${48*t.zoom}px ${48*t.zoom}px, ${12*t.zoom}px ${12*t.zoom}px`}}),i?T.jsxs("div",{className:"operations-radar",children:[T.jsx("span",{className:"operations-radar-ring operations-radar-ring--outer"}),T.jsx("span",{className:"operations-radar-ring operations-radar-ring--middle"}),T.jsx("span",{className:"operations-radar-ring operations-radar-ring--inner"}),T.jsx("span",{className:"operations-radar-sweep"})]}):null]})}function m6(t,i){return{x:t.x*i.zoom+i.x,y:t.y*i.zoom+i.y}}function Cp(t,i){return{x:(t.x-i.x)/i.zoom,y:(t.y-i.y)/i.zoom}}function _6(t,i){return{...m6(t,i),width:t.width*i.zoom,height:t.height*i.zoom}}function v6({rect:t,viewport:i}){const r=_6(t,i);return T.jsx("div",{className:"canvas-rubber-band",style:{left:r.x,top:r.y,width:r.width,height:r.height},"aria-hidden":"true"})}const b6=.25,y6=2,S6=200,C6=150,X1=5,w6=.0018;function x6({viewport:t,disabled:i=!1,consumePointerDown:r=!1,onViewportChange:a,onCreate:l,onConsumePointerDown:v,onClick:m}){const c=q.useRef(null),u=q.useRef(t),[h,b]=q.useState(null),[p,C]=q.useState(!1),[w,A]=q.useState(!1);q.useEffect(()=>{u.current=t},[t]),q.useEffect(()=>{const L=D=>{D.key==="Shift"&&A(!0),!E6(D.target)&&D.code==="Space"&&(D.preventDefault(),C(!0))},R=D=>{D.key==="Shift"&&A(!1),D.code==="Space"&&C(!1)};return window.addEventListener("keydown",L),window.addEventListener("keyup",R),()=>{window.removeEventListener("keydown",L),window.removeEventListener("keyup",R)}},[]);const x=L=>{if(i||Z1(L.target)||L.button!==0&&L.button!==1)return;if(L.preventDefault(),r){v?.();return}const R=$f(L),D=L.shiftKey&&L.button===0&&!p?"create":"pan";c.current={pointerId:L.pointerId,mode:D,startScreen:R,currentScreen:R,startViewport:u.current},L.currentTarget.setPointerCapture(L.pointerId),D==="create"&&b(zf(R,R,u.current))},g=L=>{const R=c.current;if(!R||R.pointerId!==L.pointerId)return;L.preventDefault();const D=$f(L);if(c.current={...R,currentScreen:D},R.mode==="pan"){a({...R.startViewport,x:R.startViewport.x+D.x-R.startScreen.x,y:R.startViewport.y+D.y-R.startScreen.y});return}b(zf(R.startScreen,D,u.current))},y=L=>{E(L,!0)},f=L=>{E(L,!1)},_=L=>{if(i||Z1(L.target))return;L.preventDefault();const R=$f(L),D=u.current,k=T6(D.zoom*Math.exp(-L.deltaY*w6),b6,y6),N=Cp(R,D);a({x:R.x-N.x*k,y:R.y-N.y*k,zoom:k})},E=(L,R)=>{const D=c.current;if(!D||D.pointerId!==L.pointerId||(c.current=null,L.currentTarget.releasePointerCapture(L.pointerId),b(null),!R))return;const k=Math.abs(D.currentScreen.x-D.startScreen.x),N=Math.abs(D.currentScreen.y-D.startScreen.y);if(k<X1&&N<X1){m?.();return}if(D.mode!=="create")return;const W=zf(D.startScreen,D.currentScreen,u.current),U={x:W.x,y:W.y,width:Math.max(W.width,S6),height:Math.max(W.height,C6)};l(U,D.currentScreen)};return{rubberBand:h,spaceActive:p,shiftActive:w,onPointerDown:x,onPointerMove:g,onPointerUp:y,onPointerCancel:f,onWheel:_}}function zf(t,i,r){const a=Cp(t,r),l=Cp(i,r),v=Math.min(a.x,l.x),m=Math.min(a.y,l.y);return{x:v,y:m,width:Math.abs(a.x-l.x),height:Math.abs(a.y-l.y)}}function $f(t){const i=t.currentTarget.getBoundingClientRect();return{x:t.clientX-i.left,y:t.clientY-i.top}}function Z1(t){return t instanceof Element&&!!t.closest("[data-canvas-blocker], [data-canvas-panel]")}function E6(t){return t instanceof HTMLElement&&!!t.closest("input, textarea, select, [contenteditable='true']")}function T6(t,i,r){return Math.min(r,Math.max(i,t))}const A6="Shift-drag to create an Operation. Drag to pan; scroll to zoom.";function k6({state:t}){const i=q.useRef(null),r=qM(),a=WM(),l=EE(t),[v,m]=q.useState(null),c=!t.activeTheaterId||t.agentClis.length===0||t.creatingTerminalSession||t.addingTheater,u=x6({viewport:r.viewport,disabled:c,onViewportChange:ES,onCreate:(b,p)=>m({rect:b,anchor:p}),consumePointerDown:v!==null,onConsumePointerDown:()=>m(null),onClick:M6}),h=async b=>{if(!(!t.activeTheaterId||!v)){jp();try{const p=await Bp(t.activeTheaterId,b.id);qa(p.sessionId,D6(v.rect)),zp(p),Br(p.sessionId),m(null)}catch(p){$p(p instanceof Error?p.message:String(p))}}};return T.jsxs("main",{className:`operations-canvas ${u.spaceActive?"is-panning":""} ${u.shiftActive?"is-creating":""}`,onPointerDown:u.onPointerDown,onPointerMove:u.onPointerMove,onPointerUp:u.onPointerUp,onPointerCancel:u.onPointerCancel,onWheel:u.onWheel,ref:i,children:[T.jsx(g6,{viewport:r.viewport,backgroundAnimationEnabled:a}),T.jsx("button",{type:"button",className:`canvas-background-toggle ${a?"is-active":""}`,onClick:YM,"data-canvas-blocker":!0,"aria-label":a?"배경 애니메이션 끄기":"배경 애니메이션 켜기",title:a?"Background animation: on":"Background animation: off",children:T.jsx(R6,{})}),T.jsx("div",{className:"operations-canvas-world",style:{transform:`translate(${r.viewport.x}px, ${r.viewport.y}px) scale(${r.viewport.zoom})`},children:l.map(b=>{const p=r.panels[b.sessionId];return p?T.jsx(c6,{state:t,session:b,geometry:p,viewport:r.viewport,active:t.activeTerminalSessionId===b.sessionId,getCanvasRect:()=>i.current?.getBoundingClientRect()??null},b.sessionId):null})}),l.length===0?T.jsxs("div",{className:"operations-canvas-empty","data-canvas-blocker":!0,children:[T.jsx("span",{className:"operations-canvas-empty-mark","aria-hidden":"true"}),T.jsx("p",{children:t.activeTheaterId?A6:"Add a Theater from the top bar to start operations."}),t.terminalSessionError?T.jsx("p",{className:"operations-canvas-error",children:t.terminalSessionError}):null]}):null,u.rubberBand?T.jsx(v6,{rect:u.rubberBand,viewport:r.viewport}):null,v?T.jsx(hg,{state:t,mode:"menu",anchor:v.anchor,viewportBounds:L6(i.current),onSelect:h,onClose:()=>m(null)},`${v.anchor.x}:${v.anchor.y}`):null]})}function R6(){return T.jsxs("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:[T.jsx("circle",{cx:"8",cy:"8",r:"5.2",fill:"none",stroke:"currentColor",strokeWidth:"1.1",strokeDasharray:"2 2"}),T.jsx("circle",{cx:"8",cy:"8",r:"2.6",fill:"none",stroke:"currentColor",strokeWidth:"1.1",opacity:"0.72"}),T.jsx("path",{d:"M8 8 12.2 5.8",fill:"none",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round"}),T.jsx("circle",{cx:"8",cy:"8",r:".9",fill:"currentColor"})]})}function L6(t){if(!t)return;const i=t.getBoundingClientRect();return{width:i.width,height:i.height}}function M6(){if(typeof document<"u"){const t=document.activeElement;t instanceof HTMLElement&&t.blur()}Br(null)}function D6(t){return{x:t.x,y:t.y,width:t.width,height:t.height,zIndex:Date.now()}}const O6=56;function B6(t,i){const r=q.useRef(null),a=q.useRef(!0),[l,v]=q.useState(!0),m=q.useCallback(u=>{a.current!==u&&(a.current=u,v(u))},[]);q.useEffect(()=>{const u=r.current;if(!u)return;const h=()=>{const b=u.scrollHeight-u.scrollTop-u.clientHeight;m(b<=O6)};return u.addEventListener("scroll",h,{passive:!0}),()=>u.removeEventListener("scroll",h)},[m]),q.useLayoutEffect(()=>{m(!0);const u=r.current;u&&(u.scrollTop=u.scrollHeight)},[t,m]),q.useLayoutEffect(()=>{const u=r.current;!u||!a.current||(u.scrollTop=u.scrollHeight)},[i]);const c=q.useCallback(()=>{const u=r.current;u&&(u.scrollTop=u.scrollHeight,u.focus({preventScroll:!0}),m(!0))},[m]);return{containerRef:r,pinned:l,jumpToLatest:c}}const J1=400,N6=["text","fallbackText","fallbackThought"],I6=q.memo(function({events:i}){return T.jsxs("ol",{className:"timeline","aria-label":"Raw event timeline",children:[i.length===0?T.jsx("li",{className:"timeline-empty",children:"No events observed."}):null,i.map((r,a)=>{const l=i[i.length-1-a];return l?T.jsx(j6,{event:l},l.id):null})]})}),j6=q.memo(function({event:i}){return T.jsxs("li",{className:"timeline-row",children:[T.jsx("time",{className:"timeline-time",children:Ab(i.at)}),T.jsx("span",{className:"timeline-type",children:i.type}),T.jsx("code",{className:"timeline-payload",children:z6(i.event)})]})});function z6(t){const i={...t};delete i.type;for(const a of N6){const l=i[a];typeof l=="string"&&(i[a]=l.length>60?`${l.slice(0,60)}… (${l.length} chars)`:l)}const r=JSON.stringify(i);return r.length>J1?`${r.slice(0,J1)}…`:r}const $6=q.memo(function({track:i}){const r=ms(i.status),a=i.status==="stream",l=i.sentTextLength>i.text.length||i.sentThoughtLength>i.thought.length,v=i.sentTextLength+i.sentThoughtLength;return T.jsxs("article",{className:`track-card track-card--${r}`,children:[T.jsxs("header",{className:"track-head",children:[T.jsx("span",{className:`status-dot status-dot--${r}`,"aria-hidden":"true"}),T.jsx("h3",{className:"track-name",children:i.displayName}),i.displayCli?T.jsx("span",{className:"track-tag",children:i.displayCli}):null,i.model?T.jsx("span",{className:"track-tag track-tag--dim",children:i.model}):null,i.effort?T.jsx("span",{className:"track-tag track-tag--dim",children:i.effort}):null,T.jsx("span",{className:`track-status track-status--${r}`,children:Kx(i.status)})]}),i.subtitle?T.jsx("p",{className:"track-subtitle",children:i.subtitle}):null,i.requestPreview?T.jsx(H6,{preview:i.requestPreview}):null,i.thought?T.jsx(U6,{thought:i.thought,streaming:a&&!i.text}):null,T.jsx(P6,{track:i}),i.text?T.jsx("div",{className:"track-output","data-streaming":a||void 0,children:T.jsxs("pre",{className:"track-text",children:[i.text,a?T.jsx("span",{className:"stream-caret","aria-hidden":"true"}):null]})}):a||i.status==="conn"||i.status==="queued"?T.jsxs("p",{className:"track-waiting",children:[T.jsx("span",{className:"stream-caret","aria-hidden":"true"})," awaiting output"]}):null,l?T.jsxs("p",{className:"track-notice",children:["Output partially retained — ",v.toLocaleString()," chars emitted in total."]}):null,i.error?T.jsx("p",{className:"track-error",children:i.error}):null]})});function H6({preview:t}){return T.jsxs("p",{className:"track-request",title:t,children:[T.jsx("span",{className:"track-request-mark","aria-hidden":"true",children:"▸"}),t]})}function U6({thought:t,streaming:i}){const[r,a]=q.useState(!1);return T.jsxs("div",{className:`thought-fold ${r?"is-open":""}`,children:[T.jsxs("button",{type:"button",className:"thought-toggle",onClick:()=>a(l=>!l),"aria-expanded":r,children:[T.jsx("span",{className:"thought-chevron","aria-hidden":"true",children:r?"▾":"▸"}),"reasoning",i?T.jsx("span",{className:"stream-caret stream-caret--dim","aria-hidden":"true"}):null]}),r?T.jsx("pre",{className:"thought-text",children:t}):null]})}function P6({track:t}){return t.tools.length===0?null:T.jsx("ul",{className:"tool-rail","aria-label":"Tool calls",children:t.tools.map(i=>T.jsxs("li",{className:`tool-chip tool-chip--${F6(i.status)}`,children:[T.jsx("span",{className:"tool-chip-glyph","aria-hidden":"true",children:"⚙"}),T.jsx("span",{className:"tool-chip-title",children:i.title}),i.status?T.jsx("span",{className:"tool-chip-status",children:i.status}):null]},i.key))})}function F6(t){const i=t.toLowerCase();return i.includes("error")||i.includes("fail")?"bad":i.includes("done")||i.includes("ok")||i.includes("complete")?"ok":i.includes("run")||i.includes("progress")||i.includes("stream")?"live":"idle"}function q6({job:t,timelineOpen:i}){const{containerRef:r,pinned:a,jumpToLatest:l}=B6(t?.jobId??"none",t?.lastEventId??0);return t?T.jsxs("main",{className:"stage",children:[T.jsx(W6,{job:t}),T.jsxs("div",{className:"stage-stream",children:[T.jsx("div",{className:"stage-scroll",ref:r,tabIndex:-1,children:T.jsxs("div",{className:"stage-content",children:[t.trackOrder.length===0?T.jsxs("p",{className:"stage-waiting",children:[T.jsx("span",{className:"stream-caret","aria-hidden":"true"})," waiting for track registration"]}):t.trackOrder.map(v=>{const m=t.tracks[v];return m?T.jsx($6,{track:m},`${t.jobId}:${v}`):null}),t.summary?T.jsx(G6,{summary:t.summary,status:t.status,error:t.error}):null]})}),a?null:T.jsx("button",{type:"button",className:"follow-button",onClick:l,children:"↓ Follow stream"})]}),T.jsxs("section",{className:`timeline-dock ${i?"is-open":""}`,children:[T.jsxs("button",{type:"button",className:"timeline-toggle",onClick:mE,"aria-expanded":i,children:[T.jsx("span",{className:"timeline-chevron","aria-hidden":"true",children:i?"▾":"▴"}),"Event timeline",T.jsx("span",{className:"timeline-count",children:t.recentEvents.length})]}),i?T.jsx(I6,{events:t.recentEvents}):null]})]}):T.jsx("main",{className:"stage",children:T.jsxs("div",{className:"stage-idle",children:[T.jsx("p",{className:"stage-idle-mark","aria-hidden":"true",children:"▵"}),T.jsx("h2",{children:"Standing by"}),T.jsx("p",{children:"Select a job from the left rail, or dispatch carriers from a Fleet session."})]})})}const W6=q.memo(function({job:i}){const r=ms(i.status),a=i.startedAt?Gx(i.startedAt,i.finishedAt??i.updatedAt):null;return T.jsxs("header",{className:"job-head",children:[T.jsxs("div",{className:"job-head-id",children:[T.jsx("span",{className:`status-dot status-dot--${r} status-dot--lg`,"aria-hidden":"true"}),T.jsxs("div",{children:[T.jsx("h2",{className:"job-title",children:i.label??vl(i.jobId)}),T.jsxs("p",{className:"job-meta",children:[T.jsx("span",{className:`job-status job-status--${r}`,children:Ws(i.status)}),i.ownerCarrierId?T.jsxs("span",{children:["· ",i.ownerCarrierId]}):null,i.kind?T.jsxs("span",{children:["· ",i.kind]}):null,a?T.jsxs("span",{children:["· ",a]}):null,i.startedAt?T.jsxs("span",{children:["· started ",Ab(i.startedAt)]}):null]})]})]}),T.jsx("code",{className:"job-id",title:i.jobId,children:vl(i.jobId)})]})});function G6({summary:t,status:i,error:r}){return T.jsxs("aside",{className:`job-summary job-summary--${ms(i)}`,children:[T.jsx("p",{className:"job-summary-eyebrow",children:i==="error"?"Finalized with error":"Finalized"}),T.jsx("p",{className:"job-summary-text",children:t}),r?T.jsx("p",{className:"job-summary-error",children:r}):null]})}function OS({state:t}){const i=wE(t);return q.useEffect(()=>{const r=a=>{a.key==="Escape"&&sf()};return window.addEventListener("keydown",r),()=>window.removeEventListener("keydown",r)},[]),i?T.jsxs("div",{className:"job-overlay",role:"dialog","aria-modal":"true","aria-label":"Carrier job stream",children:[T.jsx("button",{type:"button",className:"job-overlay-scrim",onClick:sf,"aria-label":"Close job stream"}),T.jsxs("div",{className:"job-overlay-card",children:[T.jsx("button",{type:"button",className:"job-overlay-close",onClick:sf,"aria-label":"Close job stream",children:"×"}),T.jsx(q6,{job:i,timelineOpen:t.timelineOpen})]})]}):null}function K6({state:t}){return T.jsx("div",{className:"floating-job-overlay","data-canvas-blocker":!0,children:T.jsx(OS,{state:t})})}function Y6({state:t,getViewportSize:i}){const[r,a]=q.useState(!1),l=Za(t),v=async c=>{const u=t.sessions[c];let h=c;if(u?.status==="dormant")try{const p=await Mu(c);Gs(p),h=p.sessionId}catch(p){Ou(p instanceof Error?p.message:String(p));return}Br(h),TS(h);const b=i();b&&dg(h,b)},m=async c=>{if(!(t.creatingTerminalSession||t.addingTheater||!t.activeTheaterId)){jp();try{const u=await Bp(t.activeTheaterId,c.id);zp(u),v(u.sessionId)}catch(u){$p(u instanceof Error?u.message:String(u))}}};return T.jsx("aside",{className:`floating-sidebar-layer ${r?"is-collapsed":""}`,"data-canvas-blocker":!0,children:T.jsxs("section",{className:"floating-sidebar","aria-label":"Floating operations list",children:[T.jsxs("div",{className:"floating-sidebar-heading",children:[T.jsx("p",{className:"sidebar-eyebrow",children:"Operations"}),T.jsxs("div",{className:"floating-sidebar-actions",children:[T.jsx(hg,{state:t,onSelect:m}),T.jsx("button",{type:"button",className:"floating-sidebar-toggle",onClick:()=>a(c=>!c),"aria-expanded":!r,"aria-label":r?"Operations 목록 펼치기":"Operations 목록 접기",children:r?T.jsx(Q6,{}):T.jsx(J6,{})})]})]}),r?null:T.jsxs(T.Fragment,{children:[l.length>0?T.jsx("ol",{className:"floating-session-list",children:l.map(c=>{const u=t.sessions[c];return u?T.jsx(V6,{session:u,active:t.activeTerminalSessionId===c,jobs:Nu(t,u),selectedJobId:t.selectedJobId,onFocus:v},c):null})}):null,t.terminalSessionError?T.jsx("p",{className:"sidebar-error",children:t.terminalSessionError}):null,l.length===0?T.jsxs("p",{className:"sidebar-empty",children:[t.activeTheaterId?"No operations in this Theater.":"No Theaters registered.",T.jsx("br",{}),t.activeTheaterId?"Drag on the canvas or use +.":"Add a Theater from the top bar."]}):null]})]})})}const V6=q.memo(function({session:i,active:r,jobs:a,selectedJobId:l,onFocus:v}){const[m,c]=q.useState(!1),[u,h]=q.useState(""),b=q.useRef(null),p=q.useRef(!1),C=q.useRef(!1),w=a.filter(({job:R})=>!Zn(R.status)).length,A=i.status==="dormant",x=w>0||i.status==="registered"||i.status==="live"||i.status==="terminal-only",g=Tl(i),y=[...a].sort((R,D)=>Number(Zn(R.job.status))-Number(Zn(D.job.status)));q.useEffect(()=>{m&&(b.current?.focus(),b.current?.select())},[m]);const f=()=>{C.current=!1,h(g),c(!0)},_=()=>{C.current=!0,c(!1),h("")},E=async()=>{if(!p.current){p.current=!0;try{Gs(await Sb(i.sessionId,u))}catch(R){Bb(R instanceof Error?R.message:String(R))}finally{p.current=!1,C.current=!0,c(!1)}}},L=R=>{if(R.key==="Enter"){R.preventDefault(),E();return}R.key==="Escape"&&(R.preventDefault(),_())};return T.jsxs("li",{className:`session-item ${r?"is-active":""}`,children:[T.jsxs("div",{className:"session-row-shell",children:[m?T.jsxs("div",{className:`session-row session-row-edit ${r?"is-active":""}`,children:[T.jsx("span",{className:`tenant-beacon ${x?"is-live":A?"is-dormant":""}`,"aria-hidden":"true"}),T.jsx("input",{ref:b,className:"session-rename-input",value:u,"aria-label":`${g} 이름 변경`,onChange:R=>h(R.target.value),onKeyDown:L,onBlur:()=>{if(C.current){C.current=!1;return}E()}})]}):T.jsxs("button",{type:"button",className:`session-row ${r?"is-active":""}`,onClick:()=>{v(i.sessionId)},onDoubleClick:f,"aria-current":r||void 0,"aria-label":`Operation ${g}`,children:[T.jsx("span",{className:`tenant-beacon ${x?"is-live":A?"is-dormant":""}`,"aria-hidden":"true"}),T.jsxs("span",{className:"tenant-row-text",children:[T.jsx("span",{className:"tenant-label",children:g}),A?T.jsx("span",{className:"job-row-meta",children:"Dormant"}):null]}),A?T.jsx("span",{className:"tenant-count",children:"Open"}):!r&&a.length>0?T.jsx("span",{className:"tenant-count",children:a.length}):null]}),T.jsx("button",{type:"button",className:"session-close",onClick:()=>{Z6(i.sessionId)},"aria-label":`${A?"Forget":"Terminate"} operation ${g}`,title:A?"Forget operation":"Terminate operation",children:T.jsx(e4,{})})]}),r?T.jsx("ol",{className:"session-job-list",children:y.length>0?y.map(({job:R})=>T.jsx(X6,{job:R,active:R.jobId===l},R.jobId)):T.jsx("li",{className:"job-list-empty",children:"No carrier jobs in this session."})}):null]})}),X6=q.memo(function({job:i,active:r}){const a=ms(i.status);return T.jsx("li",{children:T.jsxs("button",{type:"button",className:`job-row ${r?"is-active":""}`,onClick:()=>Bu(i.jobId),"aria-current":r||void 0,children:[T.jsx("span",{className:`status-dot status-dot--${a}`,"aria-hidden":"true"}),T.jsxs("span",{className:"job-row-text",children:[T.jsx("span",{className:"job-row-label",children:i.label??vl(i.jobId)}),T.jsx("span",{className:"job-row-meta",children:i.ownerCarrierId?`${Ip(i.ownerCarrierId)} · ${Ws(i.status)}`:Ws(i.status)})]})]})})});async function Z6(t){try{await Np(t)}catch(i){Hp(i instanceof Error?i.message:String(i));return}Al(t)}function J6(){return T.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:T.jsx("path",{d:"M4 5h8M4 8h5.5M4 11h8",fill:"none",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round"})})}function Q6(){return T.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:T.jsx("path",{d:"M5 4.6 9 8l-4 3.4M10.5 4.6 14 8l-3.5 3.4",fill:"none",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round"})})}function e4(){return T.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:T.jsx("path",{d:"M4.6 4.6 11.4 11.4M11.4 4.6 4.6 11.4",fill:"none",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round"})})}function t4({creating:t,error:i,hasTheaters:r,activeTheaterId:a}){const l=r?a?"No operations in this Theater":"Choose a Theater":"Add a Theater",v=r?a?"Launch an operation from the Operations sidebar.":"Theater-scoped operations and carrier activity will appear here.":"Use the top bar Theater control to add a project root.";return T.jsxs("section",{className:"operations-landing","aria-label":"Operations workspace landing",children:[T.jsx("div",{className:"operations-landing-mark","aria-hidden":"true"}),T.jsxs("div",{children:[T.jsx("p",{className:"operations-landing-eyebrow",children:"Operation"}),T.jsx("h1",{children:l}),T.jsx("p",{children:v})]}),T.jsx("p",{className:`operations-landing-status ${t?"is-live":""}`,children:t?"Launching operation":"No terminal session selected"}),i?T.jsx("p",{className:"operations-landing-error",children:i}):null]})}function i4({state:t}){const i=Za(t);return T.jsxs("nav",{className:"operations-sidebar","aria-label":"Operation sessions and carrier jobs",children:[T.jsxs("div",{className:"sidebar-heading",children:[T.jsx("p",{className:"sidebar-eyebrow",children:"Operations"}),T.jsx(hg,{state:t,onSelect:r=>a4(t,r)})]}),i.length>0?T.jsx("ol",{className:"session-list",children:i.map(r=>{const a=t.sessions[r];return a?T.jsx(n4,{session:a,active:t.activeTerminalSessionId===r,jobs:Nu(t,a),selectedJobId:t.selectedJobId},r):null})}):null,t.terminalSessionError?T.jsx("p",{className:"sidebar-error",children:t.terminalSessionError}):null,i.length===0?T.jsxs("p",{className:"sidebar-empty",children:[t.activeTheaterId?"No operations in this Theater.":"No Theaters registered.",T.jsx("br",{}),t.activeTheaterId?"Use + to launch one here.":"Add a Theater from the top bar."]}):null]})}const n4=q.memo(function({session:i,active:r,jobs:a,selectedJobId:l}){const[v,m]=q.useState(!1),[c,u]=q.useState(""),h=q.useRef(null),b=q.useRef(!1),p=q.useRef(!1),w=a.filter(({job:R})=>!Zn(R.status)).length>0||i.status==="registered"||i.status==="live"||i.status==="terminal-only",A=i.status==="dormant",x=Tl(i),g=[...a].sort((R,D)=>Number(Zn(R.job.status))-Number(Zn(D.job.status)));q.useEffect(()=>{v&&(h.current?.focus(),h.current?.select())},[v]);const y=()=>{p.current=!1,u(x),m(!0)},f=()=>{p.current=!0,m(!1),u("")},_=async()=>{if(!b.current){b.current=!0;try{Gs(await Sb(i.sessionId,c))}catch(R){Bb(R instanceof Error?R.message:String(R))}finally{b.current=!1,p.current=!0,m(!1)}}},E=R=>{if(R.key==="Enter"){R.preventDefault(),_();return}R.key==="Escape"&&(R.preventDefault(),f())},L=async()=>{if(!A){Br(i.sessionId);return}try{const R=await Mu(i.sessionId);Gs(R),Br(R.sessionId)}catch(R){Ou(R instanceof Error?R.message:String(R))}};return T.jsxs("li",{className:`session-item ${r?"is-active":""}`,children:[T.jsxs("div",{className:"session-row-shell",children:[v?T.jsxs("div",{className:`session-row session-row-edit ${r?"is-active":""}`,children:[T.jsx("span",{className:`tenant-beacon ${w?"is-live":""}`,"aria-hidden":"true"}),T.jsx("input",{ref:h,className:"session-rename-input",value:c,"aria-label":`${x} 이름 변경`,onChange:R=>u(R.target.value),onKeyDown:E,onBlur:()=>{if(p.current){p.current=!1;return}_()}})]}):T.jsxs("button",{type:"button",className:`session-row ${r?"is-active":""}`,onClick:()=>{L()},onDoubleClick:y,"aria-current":r||void 0,"aria-label":`Operation ${x}`,children:[T.jsx("span",{className:`tenant-beacon ${w?"is-live":A?"is-dormant":""}`,"aria-hidden":"true"}),T.jsxs("span",{className:"tenant-row-text",children:[T.jsx("span",{className:"tenant-label",children:x}),A?T.jsx("span",{className:"job-row-meta",children:"Dormant"}):null]}),A?T.jsx("span",{className:"tenant-count",children:"Open"}):!r&&a.length>0?T.jsx("span",{className:"tenant-count",children:a.length}):null]}),T.jsx("button",{type:"button",className:"session-close",onClick:()=>{s4(i.sessionId)},"aria-label":`Terminate operation ${x}`,title:"Terminate operation",children:T.jsx(o4,{})})]}),r?T.jsx("ol",{className:"session-job-list",children:g.length>0?g.map(({job:R})=>T.jsx(r4,{job:R,active:R.jobId===l},R.jobId)):T.jsx("li",{className:"job-list-empty",children:"No carrier jobs in this session."})}):null]})}),r4=q.memo(function({job:i,active:r}){const a=ms(i.status);return T.jsx("li",{children:T.jsxs("button",{type:"button",className:`job-row ${r?"is-active":""}`,onClick:()=>Bu(i.jobId),"aria-current":r||void 0,children:[T.jsx("span",{className:`status-dot status-dot--${a}`,"aria-hidden":"true"}),T.jsxs("span",{className:"job-row-text",children:[T.jsx("span",{className:"job-row-label",children:i.label??vl(i.jobId)}),T.jsx("span",{className:"job-row-meta",children:i.ownerCarrierId?`${Ip(i.ownerCarrierId)} · ${Ws(i.status)}`:Ws(i.status)})]})]})})});async function s4(t){try{await Np(t)}catch(i){Hp(i instanceof Error?i.message:String(i));return}Al(t)}async function a4(t,i){if(!(t.creatingTerminalSession||t.addingTheater||!t.activeTheaterId)){jp();try{zp(await Bp(t.activeTheaterId,i.id))}catch(r){$p(r instanceof Error?r.message:String(r))}}}function o4(){return T.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:T.jsx("path",{d:"M4.6 4.6 11.4 11.4M11.4 4.6 4.6 11.4",fill:"none",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round"})})}function l4({state:t,sessionId:i,expanded:r}){const a=t.sessions[i],l=a?Nu(t,a).filter(({job:v})=>!Zn(v.status)).map(({job:v})=>v):[];return T.jsxs(T.Fragment,{children:[T.jsx("button",{type:"button",className:`terminal-zoom-toggle ${r?"is-expanded":""}`,onClick:()=>vE(i),"aria-label":r?"터미널 축소":"터미널 확대",title:r?"터미널 축소":"터미널 확대",children:r?T.jsx(u4,{}):T.jsx(c4,{})}),l.length>0?T.jsx("div",{className:"terminal-job-dock","aria-label":"Active carrier jobs in terminal",children:T.jsx(DS,{jobs:l,selectedJobId:t.selectedJobId})}):null]})}function c4(){return T.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:T.jsx("path",{d:"M6.4 3.2H3.2v3.2M3.4 3.4l4.1 4.1M9.6 12.8h3.2V9.6M12.6 12.6 8.5 8.5",fill:"none",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round"})})}function u4(){return T.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:T.jsx("path",{d:"M7 7H3.8M3.8 7V3.8M3.9 7.1l4-4M9 9h3.2M12.2 9v3.2M12.1 8.9l-4 4",fill:"none",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round"})})}function h4({state:t}){const i=t.activeTerminalSessionId&&Za(t).includes(t.activeTerminalSessionId)?t.activeTerminalSessionId:null,r=i?AE(t,i):!1;return T.jsxs("div",{className:`console-body is-classic ${r?"is-expanded":""}`,children:[r?null:T.jsx(i4,{state:t}),T.jsx("main",{className:"operations-terminal-stage",children:i?T.jsxs(T.Fragment,{children:[T.jsx(Gp,{sessionId:i,onExit:()=>Al(i)},i),T.jsx(l4,{state:t,sessionId:i,expanded:r}),T.jsx(OS,{state:t})]}):T.jsx(t4,{creating:t.creatingTerminalSession,error:t.terminalSessionError,hasTheaters:t.theaters.length>0,activeTheaterId:t.activeTheaterId})})]})}function d4({state:t}){const i=q.useRef(null),r=vy(),a=Za(t);return q.useEffect(()=>{KM(t.activeTheaterId)},[t.activeTheaterId]),q.useEffect(()=>{for(const l of a)TS(l);GM(a)},[a]),q.useEffect(()=>{const l=t.pendingOperationFocus;if(l===null)return;if(r==="classic"){tf();return}let v=!1;return(async()=>{let c=l;if(t.sessions[l]?.status==="dormant")try{const b=await Mu(l);if(v)return;Gs(b),Br(b.sessionId),c=b.sessionId}catch(b){v||Ou(b instanceof Error?b.message:String(b)),tf();return}if(v)return;const h=Q1(i.current);h&&dg(c,h),tf()})(),()=>{v=!0}},[t.pendingOperationFocus,r]),r==="classic"?T.jsx(h4,{state:t}):T.jsxs("div",{className:"console-body is-canvas",ref:i,children:[T.jsx(k6,{state:t}),T.jsx(Y6,{state:t,getViewportSize:()=>Q1(i.current)}),T.jsx(K6,{state:t})]})}function Q1(t){if(!t)return null;const i=t.getBoundingClientRect();return{width:i.width,height:i.height}}function f4(t){return{activeTheater:m4(t),readiness:g4(t,t.activeTheaterId),theaters:p4(t),connection:t.connection,connectionError:t.connectionError}}function p4(t){return t.theaters.map(i=>{const r=pg(t,i.id),a=gg(t,i.id),l=mg(t,a);return{id:i.id,label:i.label,hasWiki:i.hasWiki,activeAdmiralCount:i.activeAdmiralCount,terminalSessionCount:r.length,liveJobCount:l.filter(v=>ms(v.status)==="live").length,lastActivityAt:BS([Date.parse(i.lastOpenedAt),...r.map(v=>v.createdAt),...a.map(v=>v.createdAt),...l.map(v=>v.updatedAt)]),active:i.id===t.activeTheaterId}})}function g4(t,i){const r=i?pg(t,i):[],a=i?gg(t,i):[],l=mg(t,a),v=l.filter(h=>ms(h.status)==="live").length,m=l.filter(h=>Zn(h.status)&&h.status==="done").length,c=l.filter(h=>Zn(h.status)&&(h.status==="error"||h.status==="aborted")).length,u=t.activeTerminalSessionId?t.sessions[t.activeTerminalSessionId]:void 0;return{activeSessionLabel:u&&i&&u.theaterId===i?Tl(u):"No active session",terminalSessionCount:r.length,liveJobCount:v,completedJobCount:m,failedJobCount:c,emptyState:_4(t,r,l)}}function m4(t){const i=t.theaters.find(v=>v.id===t.activeTheaterId);if(!i)return null;const r=pg(t,i.id),a=gg(t,i.id),l=mg(t,a);return{id:i.id,label:i.label,hasWiki:i.hasWiki,activeAdmiralCount:i.activeAdmiralCount,terminalSessionCount:r.length,registeredTenantCount:a.filter(v=>v.status!=="closed").length,lastActivityAt:BS([Date.parse(i.lastOpenedAt),...r.map(v=>v.createdAt),...a.map(v=>v.createdAt),...l.map(v=>v.updatedAt)])}}function pg(t,i){return t.sessionOrder.map(r=>t.sessions[r]).filter(r=>r!==void 0&&r.theaterId===i)}function gg(t,i){return t.tenants.filter(r=>r.theaterId===i)}function mg(t,i){const r=[];for(const a of i){const l=t.tenantJobs[a.tenantId];if(l)for(const v of l.jobOrder){const m=l.jobs[v];m&&r.push(m)}}return r}function _4(t,i,r){return t.theaters.length===0?"no-theaters":i.length===0?"no-sessions":r.length===0?"no-jobs":null}function BS(t){const i=t.filter(r=>Number.isFinite(r));return i.length===0?null:Math.max(...i)}async function v4(t,i){const[r,a,l,v]=await Promise.all([tu(t,"/index",i),tu(t,"/queue?status=all",i),tu(t,"/conflicts",i),tu(t,"/log?limit=3",i)]);return{entryCount:Array.isArray(r)?r.length:0,pendingQueueCount:typeof a.pendingCount=="number"?a.pendingCount:0,archivedQueueCount:typeof a.archivedCount=="number"?a.archivedCount:0,openConflictCount:Array.isArray(l)?l.length:0,logEntryCount:typeof v.totalEntries=="number"?v.totalEntries:Array.isArray(v.entries)?v.entries.length:0,latestLogStatus:Array.isArray(v.entries)&&v.entries.length>0?"available":"empty"}}async function tu(t,i,r){const a=i.startsWith("/")?i:`/${i}`,l=await fetch(`/console/codex/w/${encodeURIComponent(t)}/api${a}`,{signal:r});if(!l.ok)throw new Bt(l.status,l.statusText||`HTTP ${l.status}`);return l.json()}const iu={loading:!1,value:null,error:null},b4=15e3;function y4({state:t}){const i=f4(t),r=i.activeTheater,[a,l]=q.useState(iu),[v,m]=q.useState(iu),[c,u]=q.useState(iu);return q.useEffect(()=>{if(!r?.hasWiki){l(iu);return}const h=new AbortController;return l({loading:!0,value:null,error:null}),v4(r.id,h.signal).then(b=>l({loading:!1,value:b,error:null})).catch(b=>{h.signal.aborted||l({loading:!1,value:null,error:b instanceof Error?b.message:String(b)})}),()=>h.abort()},[r?.hasWiki,r?.id]),q.useEffect(()=>{const h=new AbortController;return m(b=>({loading:!0,value:b.value,error:null})),yb(r?.id??null,h.signal).then(b=>m({loading:!1,value:b,error:null})).catch(b=>{h.signal.aborted||m({loading:!1,value:null,error:b instanceof Error?b.message:String(b)})}),()=>h.abort()},[r?.id]),q.useEffect(()=>{const h=new AbortController,b=()=>{u(C=>({loading:!0,value:C.value,error:null})),Lx(h.signal).then(C=>u({loading:!1,value:C,error:null})).catch(C=>{h.signal.aborted||u(w=>({loading:!1,value:w.value,error:C instanceof Error?C.message:String(C)}))})};b();const p=window.setInterval(b,b4);return()=>{window.clearInterval(p),h.abort()}},[]),T.jsxs("main",{className:"welcome-page",children:[T.jsxs("section",{className:"bridge-matrix","aria-labelledby":"bridge-matrix-title",children:[T.jsxs("div",{className:"bridge-section-heading",children:[T.jsx("p",{className:"bridge-kicker",children:"Theater Capability Matrix"}),T.jsx("h3",{id:"bridge-matrix-title",children:"Registered Theaters"})]}),T.jsxs("div",{className:"bridge-matrix-table",role:"table","aria-label":"Theater capability matrix",children:[T.jsxs("div",{className:"bridge-matrix-row bridge-matrix-head",role:"row",children:[T.jsx("span",{role:"columnheader",children:"Theater"}),T.jsx("span",{role:"columnheader",children:"Codex"}),T.jsx("span",{role:"columnheader",children:"Active"}),T.jsx("span",{role:"columnheader",children:"Terminals"}),T.jsx("span",{role:"columnheader",children:"Updated"})]}),i.theaters.length>0?i.theaters.map(h=>T.jsx(x4,{theater:h},h.id)):T.jsx("p",{className:"bridge-matrix-empty",children:"No Theaters registered."})]})]}),T.jsxs("section",{className:"bridge-carriers","aria-labelledby":"bridge-carriers-title",children:[T.jsxs("div",{className:"bridge-section-heading",children:[T.jsx("p",{className:"bridge-kicker",children:"Carrier Readiness Matrix"}),T.jsx("h3",{id:"bridge-carriers-title",children:"Carrier roster"})]}),T.jsx(w4,{carriers:c})]}),T.jsxs("section",{className:"bridge-knowledge","aria-labelledby":"bridge-knowledge-title",children:[T.jsxs("div",{className:"bridge-section-heading",children:[T.jsx("p",{className:"bridge-kicker",children:"Knowledge Readiness Panel"}),T.jsx("h3",{id:"bridge-knowledge-title",children:"Codex readiness"})]}),T.jsx(S4,{activeTheater:r,knowledge:a})]}),T.jsxs("section",{className:"bridge-health","aria-labelledby":"bridge-health-title",children:[T.jsxs("div",{className:"bridge-section-heading",children:[T.jsx("p",{className:"bridge-kicker",children:"System Information"}),T.jsx("h3",{id:"bridge-health-title",children:"Runtime status"})]}),T.jsx(C4,{health:v})]})]})}function S4({activeTheater:t,knowledge:i}){if(!t)return T.jsx("div",{className:"bridge-empty",children:T.jsx("p",{children:"Add a Theater to inspect Codex readiness."})});if(!t.hasWiki)return T.jsx("div",{className:"bridge-empty",children:T.jsx("p",{children:"Codex unavailable for this Theater."})});if(i.error)return T.jsx("div",{className:"bridge-empty bridge-empty--warn",children:T.jsx("p",{children:"Codex summary degraded."})});const r=i.value,a=[{label:"Entries",value:r?String(r.entryCount):"…",caption:"Indexed knowledge entries"},{label:"Pending",value:r?String(r.pendingQueueCount):"…",caption:"Drydock queue"},{label:"Archived",value:r?String(r.archivedQueueCount):"…",caption:"Archived decisions"},{label:"Conflicts",value:r?String(r.openConflictCount):"…",caption:"Open conflict files",tone:r&&r.openConflictCount>0?"warn":void 0},{label:"Log",value:r?r.latestLogStatus:i.loading?"loading":"empty",caption:r?`${r.logEntryCount} total entries`:"Latest log tail",tone:r?.latestLogStatus==="available"?"good":void 0}];return T.jsx("div",{className:"bridge-knowledge-grid",children:a.map(l=>T.jsx(NS,{metric:l},l.label))})}function C4({health:t}){const i=t.value,r=[{label:"Version",value:i?.version??"…",caption:"Console runtime"},{label:"Channel",value:i?.channel??"…",caption:"Release channel"},{label:"Port",value:i?String(i.port):"…",caption:"Loopback listener"},{label:"Codex",value:i?.wikiServerStatus??"unknown",caption:"Active Theater status",tone:i?.wikiServerStatus==="available"?"good":i?.wikiServerStatus==="unavailable"?"bad":void 0},{label:"Observer",value:i?`${i.workspaces}/${i.jobs}`:t.loading?"loading":"unknown",caption:"Workspaces / jobs"}];return T.jsxs(T.Fragment,{children:[T.jsx("div",{className:"bridge-health-strip",children:r.map(a=>T.jsx(NS,{metric:a},a.label))}),t.error?T.jsx("p",{className:"bridge-health-error",children:"System health unavailable."}):null]})}function w4({carriers:t}){if(t.error)return T.jsx("div",{className:"bridge-empty bridge-empty--warn",children:T.jsx("p",{children:"Carrier readiness degraded."})});const i=t.value??[];return i.length===0?T.jsx("div",{className:"bridge-empty",children:T.jsx("p",{children:t.loading?"Loading carrier readiness.":"No carrier readiness entries available."})}):T.jsxs("div",{className:"bridge-carrier-table",role:"table","aria-label":"Carrier readiness matrix",children:[T.jsxs("div",{className:"bridge-carrier-row bridge-carrier-head",role:"row",children:[T.jsx("span",{role:"columnheader",children:"Carrier"}),T.jsx("span",{role:"columnheader",children:"Role"}),T.jsx("span",{role:"columnheader",children:"Model"}),T.jsx("span",{role:"columnheader",children:"Effort"}),T.jsx("span",{role:"columnheader",children:"Task Force"}),T.jsx("span",{role:"columnheader",children:"Mode"})]}),i.map(r=>T.jsxs("div",{className:"bridge-carrier-row",role:"row",children:[T.jsxs("span",{role:"cell",className:"bridge-carrier-name","data-signature":T4(r),children:[T.jsx("strong",{children:r.displayName}),T.jsx("small",{children:r.category??"unknown"})]}),T.jsx("span",{role:"cell",children:r.role??r.category??"unknown"}),T.jsx("span",{role:"cell",children:r.model||"unknown"}),T.jsx("span",{role:"cell",children:r.effort??"default"}),T.jsx("span",{role:"cell",children:r.taskForceBackendCount}),T.jsx("span",{role:"cell",children:r.subagentMode?"subagent":r.cliType||"cli"})]},r.carrierId))]})}function NS({metric:t}){return T.jsxs("article",{className:`bridge-card ${t.tone?`bridge-card--${t.tone}`:""}`,children:[T.jsx("p",{className:"bridge-card-label",children:t.label}),T.jsx("strong",{children:t.value}),T.jsx("p",{children:t.caption})]})}function x4({theater:t}){return T.jsxs("div",{className:`bridge-matrix-row ${t.active?"is-active":""}`,role:"row",children:[T.jsxs("span",{role:"cell",children:[T.jsx("span",{className:`bridge-theater-live ${t.liveJobCount>0?"is-live":""}`,"aria-hidden":"true"}),t.label]}),T.jsx("span",{role:"cell",children:t.hasWiki?"available":"unavailable"}),T.jsx("span",{role:"cell",children:t.activeAdmiralCount}),T.jsx("span",{role:"cell",children:t.terminalSessionCount}),T.jsx("span",{role:"cell",children:E4(t.lastActivityAt)})]})}function E4(t){return t?new Date(t).toLocaleString([],{month:"short",day:"2-digit",hour:"2-digit",minute:"2-digit"}):"none"}function T4(t){return!t.subagentMode&&t.taskForceBackendCount>=2?"taskforce":t.cliType}const A4=6e3;function k4(){const t=py();return q.useEffect(()=>gA(),[]),q.useEffect(()=>{const i=new AbortController;Rx(i.signal).then(cE).catch(l=>{i.signal.aborted||Ke({theaterError:l instanceof Error?l.message:String(l)})}),Ox(i.signal).then(lE).catch(l=>{i.signal.aborted||Ke({terminalSessionError:l instanceof Error?l.message:String(l)})});const r=()=>{yb(t.activeTheaterId,i.signal).then(oE).catch(()=>{})};r();const a=window.setTimeout(r,A4);return()=>{window.clearTimeout(a),i.abort()}},[]),q.useEffect(()=>{const i=r=>{window.location.pathname.includes("/codex")||(r.metaKey||r.ctrlKey)&&r.key.toLowerCase()==="k"&&(r.preventDefault(),r.stopImmediatePropagation(),gE())};return window.addEventListener("keydown",i,!0),()=>window.removeEventListener("keydown",i,!0)},[]),q.useEffect(()=>{const i=r=>{(r.metaKey||r.ctrlKey)&&r.key==="`"&&(r.preventDefault(),Ob())};return window.addEventListener("keydown",i),()=>window.removeEventListener("keydown",i)},[]),T.jsxs("div",{className:"console-shell",children:[T.jsx(ZT,{state:t}),T.jsxs(K2,{children:[T.jsx(ja,{path:"/",element:T.jsx(y4,{state:t})}),T.jsx(ja,{path:"/operations",element:T.jsx(d4,{state:t})}),T.jsx(ja,{path:"/carrier-settings",element:T.jsx(WA,{})}),T.jsx(ja,{path:"/codex/*",element:T.jsx(kM,{state:t})}),T.jsx(ja,{path:"*",element:T.jsx(W2,{to:"/",replace:!0})})]}),T.jsx(jT,{state:t}),T.jsx($T,{state:t}),T.jsx(NE,{state:t}),T.jsx(WT,{open:t.connectionError!==null,tone:"error",title:"Console link interrupted",message:t.connectionError??void 0})]})}nE();const eb=document.querySelector("#app");eb&&Yw.createRoot(eb).render(T.jsx(q.StrictMode,{children:T.jsx(_x,{basename:"/console",children:T.jsx(k4,{})})}));export{PR as _,R4 as a,zw as g,bt as k,gl as p};
|