@dotobokuri/fleet-console 1.9.0 → 1.10.1
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 +4 -4
- package/dist/cli-bin.mjs +571 -344
- package/dist/cli.mjs +571 -344
- package/dist/client/assets/{_baseUniq-_nKBty4x.js → _baseUniq-e_j340KJ.js} +1 -1
- package/dist/client/assets/{arc-DEjqUlkY.js → arc-CioNx0k6.js} +1 -1
- package/dist/client/assets/{architectureDiagram-Q4EWVU46-CPF3RLab.js → architectureDiagram-Q4EWVU46-B_8HDSCb.js} +1 -1
- package/dist/client/assets/{blockDiagram-DXYQGD6D-DguupB0e.js → blockDiagram-DXYQGD6D-CpHdrypQ.js} +1 -1
- package/dist/client/assets/{c4Diagram-AHTNJAMY-Dd7AVc09.js → c4Diagram-AHTNJAMY-CkitEGpF.js} +1 -1
- package/dist/client/assets/channel-CEwT4AXW.js +1 -0
- package/dist/client/assets/{chunk-4BX2VUAB-CSIihHG7.js → chunk-4BX2VUAB-DxyXXSCc.js} +1 -1
- package/dist/client/assets/{chunk-4TB4RGXK-DR_cPI3H.js → chunk-4TB4RGXK-C2-nU4zS.js} +1 -1
- package/dist/client/assets/{chunk-55IACEB6-97czQ3iV.js → chunk-55IACEB6-Ch5DNHFU.js} +1 -1
- package/dist/client/assets/{chunk-EDXVE4YY-piQCPtjQ.js → chunk-EDXVE4YY-CHE6KKZa.js} +1 -1
- package/dist/client/assets/{chunk-FMBD7UC4-BIeV9l0L.js → chunk-FMBD7UC4-PFqCeOs6.js} +1 -1
- package/dist/client/assets/{chunk-OYMX7WX6-DWUJBKm_.js → chunk-OYMX7WX6-DHE5_rgO.js} +1 -1
- package/dist/client/assets/{chunk-QZHKN3VN-DHL5fPU4.js → chunk-QZHKN3VN-BNsfe2Ai.js} +1 -1
- package/dist/client/assets/{chunk-YZCP3GAM-Dk19Wldz.js → chunk-YZCP3GAM-Du6aAWOS.js} +1 -1
- package/dist/client/assets/classDiagram-6PBFFD2Q-BcAsKAPs.js +1 -0
- package/dist/client/assets/classDiagram-v2-HSJHXN6E-BcAsKAPs.js +1 -0
- package/dist/client/assets/clone-BbRCSYXZ.js +1 -0
- package/dist/client/assets/{cose-bilkent-S5V4N54A-CcROwyfn.js → cose-bilkent-S5V4N54A-BMbRb2Ij.js} +1 -1
- package/dist/client/assets/{dagre-KV5264BT-kdHN8OcZ.js → dagre-KV5264BT-BIYIuU4t.js} +1 -1
- package/dist/client/assets/{diagram-5BDNPKRD-yqi72mWd.js → diagram-5BDNPKRD-DE58KlL0.js} +1 -1
- package/dist/client/assets/{diagram-G4DWMVQ6-CTjHbP--.js → diagram-G4DWMVQ6-BBHYXkDj.js} +1 -1
- package/dist/client/assets/{diagram-MMDJMWI5-BCGN9v8i.js → diagram-MMDJMWI5-BGA4ZKw3.js} +1 -1
- package/dist/client/assets/{diagram-TYMM5635-p6gtwFXr.js → diagram-TYMM5635-DusN1Hix.js} +1 -1
- package/dist/client/assets/{erDiagram-SMLLAGMA-BHNCT04F.js → erDiagram-SMLLAGMA-84E-AJKo.js} +1 -1
- package/dist/client/assets/{flowDiagram-DWJPFMVM-DP-E6Gb1.js → flowDiagram-DWJPFMVM-Dpap9NqV.js} +1 -1
- package/dist/client/assets/{ganttDiagram-T4ZO3ILL-COKcadl7.js → ganttDiagram-T4ZO3ILL-CukRJAaM.js} +1 -1
- package/dist/client/assets/{gitGraphDiagram-UUTBAWPF-CVkte06j.js → gitGraphDiagram-UUTBAWPF-DuAwiTii.js} +1 -1
- package/dist/client/assets/{graph-BljmCiGu.js → graph-B7irxl7Q.js} +1 -1
- package/dist/client/assets/index-CTyjGQHF.css +1 -0
- package/dist/client/assets/index-Uidvbtqb.js +777 -0
- package/dist/client/assets/{infoDiagram-42DDH7IO-Dh_U82lE.js → infoDiagram-42DDH7IO-Gdh2w_Ry.js} +1 -1
- package/dist/client/assets/{ishikawaDiagram-UXIWVN3A-BtZhb0mv.js → ishikawaDiagram-UXIWVN3A-DvbqJman.js} +1 -1
- package/dist/client/assets/{journeyDiagram-VCZTEJTY-_Zd4No67.js → journeyDiagram-VCZTEJTY-DIQYAsjN.js} +1 -1
- package/dist/client/assets/{kanban-definition-6JOO6SKY-CpIIMkPJ.js → kanban-definition-6JOO6SKY-8BBtOuAV.js} +1 -1
- package/dist/client/assets/{layout-ButG21vs.js → layout-DDUpLunD.js} +1 -1
- package/dist/client/assets/{linear-C-frnGuN.js → linear-BzLoJVdP.js} +1 -1
- package/dist/client/assets/{mermaid.core-ISlBhdkY.js → mermaid.core-Ddi7z3V3.js} +4 -4
- package/dist/client/assets/{min-CalB2Q9y.js → min-CEKwugI-.js} +1 -1
- package/dist/client/assets/{mindmap-definition-QFDTVHPH-BfilPIUD.js → mindmap-definition-QFDTVHPH-y-V-6GIi.js} +1 -1
- package/dist/client/assets/{pieDiagram-DEJITSTG-Dm_1WIPT.js → pieDiagram-DEJITSTG-DjqTUefi.js} +1 -1
- package/dist/client/assets/{quadrantDiagram-34T5L4WZ-DMzRgLeF.js → quadrantDiagram-34T5L4WZ-BZbwyDuC.js} +1 -1
- package/dist/client/assets/{requirementDiagram-MS252O5E-Bl1lUR6U.js → requirementDiagram-MS252O5E-M2epVejI.js} +1 -1
- package/dist/client/assets/{sankeyDiagram-XADWPNL6-VxDrFumf.js → sankeyDiagram-XADWPNL6-DQHzVL6h.js} +1 -1
- package/dist/client/assets/{sequenceDiagram-FGHM5R23-BoB_k7L2.js → sequenceDiagram-FGHM5R23-Dldq08WJ.js} +1 -1
- package/dist/client/assets/{stateDiagram-FHFEXIEX-C8DFihD3.js → stateDiagram-FHFEXIEX-B32muPdI.js} +1 -1
- package/dist/client/assets/stateDiagram-v2-QKLJ7IA2-Ct3tm_Bq.js +1 -0
- package/dist/client/assets/{timeline-definition-GMOUNBTQ-G5hn4rEl.js → timeline-definition-GMOUNBTQ-nSYYEX6t.js} +1 -1
- package/dist/client/assets/{vennDiagram-DHZGUBPP-D_jMNDmm.js → vennDiagram-DHZGUBPP-DPIMKKCQ.js} +1 -1
- package/dist/client/assets/{wardley-RL74JXVD-Clc5Li47.js → wardley-RL74JXVD-DArerB6Y.js} +1 -1
- package/dist/client/assets/{wardleyDiagram-NUSXRM2D-Bygn2On7.js → wardleyDiagram-NUSXRM2D-DRvimWEN.js} +1 -1
- package/dist/client/assets/{xychartDiagram-5P7HB3ND-arK3uijt.js → xychartDiagram-5P7HB3ND-D0VCX3ps.js} +1 -1
- package/dist/client/index.html +2 -2
- package/package.json +1 -1
- package/dist/client/assets/channel-DA6xE92d.js +0 -1
- package/dist/client/assets/classDiagram-6PBFFD2Q-D46R_D_e.js +0 -1
- package/dist/client/assets/classDiagram-v2-HSJHXN6E-D46R_D_e.js +0 -1
- package/dist/client/assets/clone-DV233GSJ.js +0 -1
- package/dist/client/assets/index-B7IECSX7.css +0 -1
- package/dist/client/assets/index-CSTdaEyG.js +0 -777
- package/dist/client/assets/stateDiagram-v2-QKLJ7IA2-DlDadEC7.js +0 -1
|
@@ -0,0 +1,777 @@
|
|
|
1
|
+
(function(){const n=document.createElement("link").relList;if(n&&n.supports&&n.supports("modulepreload"))return;for(const l of document.querySelectorAll('link[rel="modulepreload"]'))a(l);new MutationObserver(l=>{for(const f of l)if(f.type==="childList")for(const m of f.addedNodes)m.tagName==="LINK"&&m.rel==="modulepreload"&&a(m)}).observe(document,{childList:!0,subtree:!0});function r(l){const f={};return l.integrity&&(f.integrity=l.integrity),l.referrerPolicy&&(f.referrerPolicy=l.referrerPolicy),l.crossOrigin==="use-credentials"?f.credentials="include":l.crossOrigin==="anonymous"?f.credentials="omit":f.credentials="same-origin",f}function a(l){if(l.ep)return;l.ep=!0;const f=r(l);fetch(l.href,f)}})();function eE(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function q7(e){if(Object.prototype.hasOwnProperty.call(e,"__esModule"))return e;var n=e.default;if(typeof n=="function"){var r=function a(){var l=!1;try{l=this instanceof a}catch{}return l?Reflect.construct(n,arguments,this.constructor):n.apply(this,arguments)};r.prototype=n.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(e).forEach(function(a){var l=Object.getOwnPropertyDescriptor(e,a);Object.defineProperty(r,a,l.get?l:{enumerable:!0,get:function(){return e[a]}})}),r}var mf={exports:{}},al={};var z0;function tE(){if(z0)return al;z0=1;var e=Symbol.for("react.transitional.element"),n=Symbol.for("react.fragment");function r(a,l,f){var m=null;if(f!==void 0&&(m=""+f),l.key!==void 0&&(m=""+l.key),"key"in l){f={};for(var c in l)c!=="key"&&(f[c]=l[c])}else f=l;return l=f.ref,{$$typeof:e,type:a,key:m,ref:l!==void 0?l:null,props:f}}return al.Fragment=n,al.jsx=r,al.jsxs=r,al}var $0;function nE(){return $0||($0=1,mf.exports=tE()),mf.exports}var S=nE(),_f={exports:{}},Ue={};var P0;function iE(){if(P0)return Ue;P0=1;var e=Symbol.for("react.transitional.element"),n=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),a=Symbol.for("react.strict_mode"),l=Symbol.for("react.profiler"),f=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"),y=Symbol.for("react.lazy"),g=Symbol.for("react.activity"),C=Symbol.iterator;function E(N){return N===null||typeof N!="object"?null:(N=C&&N[C]||N["@@iterator"],typeof N=="function"?N:null)}var A={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},T=Object.assign,p={};function v(N,P,Z){this.props=N,this.context=P,this.refs=p,this.updater=Z||A}v.prototype.isReactComponent={},v.prototype.setState=function(N,P){if(typeof N!="object"&&typeof N!="function"&&N!=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,N,P,"setState")},v.prototype.forceUpdate=function(N){this.updater.enqueueForceUpdate(this,N,"forceUpdate")};function d(){}d.prototype=v.prototype;function b(N,P,Z){this.props=N,this.context=P,this.refs=p,this.updater=Z||A}var x=b.prototype=new d;x.constructor=b,T(x,v.prototype),x.isPureReactComponent=!0;var L=Array.isArray;function R(){}var M={H:null,A:null,T:null,S:null},k=Object.prototype.hasOwnProperty;function O(N,P,Z){var ae=Z.ref;return{$$typeof:e,type:N,key:P,ref:ae!==void 0?ae:null,props:Z}}function U(N,P){return O(N.type,P,N.props)}function F(N){return typeof N=="object"&&N!==null&&N.$$typeof===e}function G(N){var P={"=":"=0",":":"=2"};return"$"+N.replace(/[=:]/g,function(Z){return P[Z]})}var I=/\/+/g;function K(N,P){return typeof N=="object"&&N!==null&&N.key!=null?G(""+N.key):P.toString(36)}function te(N){switch(N.status){case"fulfilled":return N.value;case"rejected":throw N.reason;default:switch(typeof N.status=="string"?N.then(R,R):(N.status="pending",N.then(function(P){N.status==="pending"&&(N.status="fulfilled",N.value=P)},function(P){N.status==="pending"&&(N.status="rejected",N.reason=P)})),N.status){case"fulfilled":return N.value;case"rejected":throw N.reason}}throw N}function q(N,P,Z,ae,ce){var _e=typeof N;(_e==="undefined"||_e==="boolean")&&(N=null);var Q=!1;if(N===null)Q=!0;else switch(_e){case"bigint":case"string":case"number":Q=!0;break;case"object":switch(N.$$typeof){case e:case n:Q=!0;break;case y:return Q=N._init,q(Q(N._payload),P,Z,ae,ce)}}if(Q)return ce=ce(N),Q=ae===""?"."+K(N,0):ae,L(ce)?(Z="",Q!=null&&(Z=Q.replace(I,"$&/")+"/"),q(ce,P,Z,"",function(ge){return ge})):ce!=null&&(F(ce)&&(ce=U(ce,Z+(ce.key==null||N&&N.key===ce.key?"":(""+ce.key).replace(I,"$&/")+"/")+Q)),P.push(ce)),1;Q=0;var $=ae===""?".":ae+":";if(L(N))for(var oe=0;oe<N.length;oe++)ae=N[oe],_e=$+K(ae,oe),Q+=q(ae,P,Z,_e,ce);else if(oe=E(N),typeof oe=="function")for(N=oe.call(N),oe=0;!(ae=N.next()).done;)ae=ae.value,_e=$+K(ae,oe++),Q+=q(ae,P,Z,_e,ce);else if(_e==="object"){if(typeof N.then=="function")return q(te(N),P,Z,ae,ce);throw P=String(N),Error("Objects are not valid as a React child (found: "+(P==="[object Object]"?"object with keys {"+Object.keys(N).join(", ")+"}":P)+"). If you meant to render a collection of children, use an array instead.")}return Q}function W(N,P,Z){if(N==null)return N;var ae=[],ce=0;return q(N,ae,"","",function(_e){return P.call(Z,_e,ce++)}),ae}function Y(N){if(N._status===-1){var P=N._result;P=P(),P.then(function(Z){(N._status===0||N._status===-1)&&(N._status=1,N._result=Z)},function(Z){(N._status===0||N._status===-1)&&(N._status=2,N._result=Z)}),N._status===-1&&(N._status=0,N._result=P)}if(N._status===1)return N._result.default;throw N._result}var B=typeof reportError=="function"?reportError:function(N){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var P=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof N=="object"&&N!==null&&typeof N.message=="string"?String(N.message):String(N),error:N});if(!window.dispatchEvent(P))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",N);return}console.error(N)},z={map:W,forEach:function(N,P,Z){W(N,function(){P.apply(this,arguments)},Z)},count:function(N){var P=0;return W(N,function(){P++}),P},toArray:function(N){return W(N,function(P){return P})||[]},only:function(N){if(!F(N))throw Error("React.Children.only expected to receive a single React element child.");return N}};return Ue.Activity=g,Ue.Children=z,Ue.Component=v,Ue.Fragment=r,Ue.Profiler=l,Ue.PureComponent=b,Ue.StrictMode=a,Ue.Suspense=u,Ue.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=M,Ue.__COMPILER_RUNTIME={__proto__:null,c:function(N){return M.H.useMemoCache(N)}},Ue.cache=function(N){return function(){return N.apply(null,arguments)}},Ue.cacheSignal=function(){return null},Ue.cloneElement=function(N,P,Z){if(N==null)throw Error("The argument must be a React element, but you passed "+N+".");var ae=T({},N.props),ce=N.key;if(P!=null)for(_e in P.key!==void 0&&(ce=""+P.key),P)!k.call(P,_e)||_e==="key"||_e==="__self"||_e==="__source"||_e==="ref"&&P.ref===void 0||(ae[_e]=P[_e]);var _e=arguments.length-2;if(_e===1)ae.children=Z;else if(1<_e){for(var Q=Array(_e),$=0;$<_e;$++)Q[$]=arguments[$+2];ae.children=Q}return O(N.type,ce,ae)},Ue.createContext=function(N){return N={$$typeof:m,_currentValue:N,_currentValue2:N,_threadCount:0,Provider:null,Consumer:null},N.Provider=N,N.Consumer={$$typeof:f,_context:N},N},Ue.createElement=function(N,P,Z){var ae,ce={},_e=null;if(P!=null)for(ae in P.key!==void 0&&(_e=""+P.key),P)k.call(P,ae)&&ae!=="key"&&ae!=="__self"&&ae!=="__source"&&(ce[ae]=P[ae]);var Q=arguments.length-2;if(Q===1)ce.children=Z;else if(1<Q){for(var $=Array(Q),oe=0;oe<Q;oe++)$[oe]=arguments[oe+2];ce.children=$}if(N&&N.defaultProps)for(ae in Q=N.defaultProps,Q)ce[ae]===void 0&&(ce[ae]=Q[ae]);return O(N,_e,ce)},Ue.createRef=function(){return{current:null}},Ue.forwardRef=function(N){return{$$typeof:c,render:N}},Ue.isValidElement=F,Ue.lazy=function(N){return{$$typeof:y,_payload:{_status:-1,_result:N},_init:Y}},Ue.memo=function(N,P){return{$$typeof:h,type:N,compare:P===void 0?null:P}},Ue.startTransition=function(N){var P=M.T,Z={};M.T=Z;try{var ae=N(),ce=M.S;ce!==null&&ce(Z,ae),typeof ae=="object"&&ae!==null&&typeof ae.then=="function"&&ae.then(R,B)}catch(_e){B(_e)}finally{P!==null&&Z.types!==null&&(P.types=Z.types),M.T=P}},Ue.unstable_useCacheRefresh=function(){return M.H.useCacheRefresh()},Ue.use=function(N){return M.H.use(N)},Ue.useActionState=function(N,P,Z){return M.H.useActionState(N,P,Z)},Ue.useCallback=function(N,P){return M.H.useCallback(N,P)},Ue.useContext=function(N){return M.H.useContext(N)},Ue.useDebugValue=function(){},Ue.useDeferredValue=function(N,P){return M.H.useDeferredValue(N,P)},Ue.useEffect=function(N,P){return M.H.useEffect(N,P)},Ue.useEffectEvent=function(N){return M.H.useEffectEvent(N)},Ue.useId=function(){return M.H.useId()},Ue.useImperativeHandle=function(N,P,Z){return M.H.useImperativeHandle(N,P,Z)},Ue.useInsertionEffect=function(N,P){return M.H.useInsertionEffect(N,P)},Ue.useLayoutEffect=function(N,P){return M.H.useLayoutEffect(N,P)},Ue.useMemo=function(N,P){return M.H.useMemo(N,P)},Ue.useOptimistic=function(N,P){return M.H.useOptimistic(N,P)},Ue.useReducer=function(N,P,Z){return M.H.useReducer(N,P,Z)},Ue.useRef=function(N){return M.H.useRef(N)},Ue.useState=function(N){return M.H.useState(N)},Ue.useSyncExternalStore=function(N,P,Z){return M.H.useSyncExternalStore(N,P,Z)},Ue.useTransition=function(){return M.H.useTransition()},Ue.version="19.2.7",Ue}var H0;function vg(){return H0||(H0=1,_f.exports=iE()),_f.exports}var H=vg(),vf={exports:{}},ol={},bf={exports:{}},yf={};var U0;function rE(){return U0||(U0=1,(function(e){function n(q,W){var Y=q.length;q.push(W);e:for(;0<Y;){var B=Y-1>>>1,z=q[B];if(0<l(z,W))q[B]=W,q[Y]=z,Y=B;else break e}}function r(q){return q.length===0?null:q[0]}function a(q){if(q.length===0)return null;var W=q[0],Y=q.pop();if(Y!==W){q[0]=Y;e:for(var B=0,z=q.length,N=z>>>1;B<N;){var P=2*(B+1)-1,Z=q[P],ae=P+1,ce=q[ae];if(0>l(Z,Y))ae<z&&0>l(ce,Z)?(q[B]=ce,q[ae]=Y,B=ae):(q[B]=Z,q[P]=Y,B=P);else if(ae<z&&0>l(ce,Y))q[B]=ce,q[ae]=Y,B=ae;else break e}}return W}function l(q,W){var Y=q.sortIndex-W.sortIndex;return Y!==0?Y:q.id-W.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var f=performance;e.unstable_now=function(){return f.now()}}else{var m=Date,c=m.now();e.unstable_now=function(){return m.now()-c}}var u=[],h=[],y=1,g=null,C=3,E=!1,A=!1,T=!1,p=!1,v=typeof setTimeout=="function"?setTimeout:null,d=typeof clearTimeout=="function"?clearTimeout:null,b=typeof setImmediate<"u"?setImmediate:null;function x(q){for(var W=r(h);W!==null;){if(W.callback===null)a(h);else if(W.startTime<=q)a(h),W.sortIndex=W.expirationTime,n(u,W);else break;W=r(h)}}function L(q){if(T=!1,x(q),!A)if(r(u)!==null)A=!0,R||(R=!0,G());else{var W=r(h);W!==null&&te(L,W.startTime-q)}}var R=!1,M=-1,k=5,O=-1;function U(){return p?!0:!(e.unstable_now()-O<k)}function F(){if(p=!1,R){var q=e.unstable_now();O=q;var W=!0;try{e:{A=!1,T&&(T=!1,d(M),M=-1),E=!0;var Y=C;try{t:{for(x(q),g=r(u);g!==null&&!(g.expirationTime>q&&U());){var B=g.callback;if(typeof B=="function"){g.callback=null,C=g.priorityLevel;var z=B(g.expirationTime<=q);if(q=e.unstable_now(),typeof z=="function"){g.callback=z,x(q),W=!0;break t}g===r(u)&&a(u),x(q)}else a(u);g=r(u)}if(g!==null)W=!0;else{var N=r(h);N!==null&&te(L,N.startTime-q),W=!1}}break e}finally{g=null,C=Y,E=!1}W=void 0}}finally{W?G():R=!1}}}var G;if(typeof b=="function")G=function(){b(F)};else if(typeof MessageChannel<"u"){var I=new MessageChannel,K=I.port2;I.port1.onmessage=F,G=function(){K.postMessage(null)}}else G=function(){v(F,0)};function te(q,W){M=v(function(){q(e.unstable_now())},W)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(q){q.callback=null},e.unstable_forceFrameRate=function(q){0>q||125<q?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):k=0<q?Math.floor(1e3/q):5},e.unstable_getCurrentPriorityLevel=function(){return C},e.unstable_next=function(q){switch(C){case 1:case 2:case 3:var W=3;break;default:W=C}var Y=C;C=W;try{return q()}finally{C=Y}},e.unstable_requestPaint=function(){p=!0},e.unstable_runWithPriority=function(q,W){switch(q){case 1:case 2:case 3:case 4:case 5:break;default:q=3}var Y=C;C=q;try{return W()}finally{C=Y}},e.unstable_scheduleCallback=function(q,W,Y){var B=e.unstable_now();switch(typeof Y=="object"&&Y!==null?(Y=Y.delay,Y=typeof Y=="number"&&0<Y?B+Y:B):Y=B,q){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,q={id:y++,callback:W,priorityLevel:q,startTime:Y,expirationTime:z,sortIndex:-1},Y>B?(q.sortIndex=Y,n(h,q),r(u)===null&&q===r(h)&&(T?(d(M),M=-1):T=!0,te(L,Y-B))):(q.sortIndex=z,n(u,q),A||E||(A=!0,R||(R=!0,G()))),q},e.unstable_shouldYield=U,e.unstable_wrapCallback=function(q){var W=C;return function(){var Y=C;C=W;try{return q.apply(this,arguments)}finally{C=Y}}}})(yf)),yf}var F0;function sE(){return F0||(F0=1,bf.exports=rE()),bf.exports}var Sf={exports:{}},Dn={};var q0;function aE(){if(q0)return Dn;q0=1;var e=vg();function n(u){var h="https://react.dev/errors/"+u;if(1<arguments.length){h+="?args[]="+encodeURIComponent(arguments[1]);for(var y=2;y<arguments.length;y++)h+="&args[]="+encodeURIComponent(arguments[y])}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(n(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 f(u,h,y){var g=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:l,key:g==null?null:""+g,children:u,containerInfo:h,implementation:y}}var m=e.__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 Dn.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=a,Dn.createPortal=function(u,h){var y=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!h||h.nodeType!==1&&h.nodeType!==9&&h.nodeType!==11)throw Error(n(299));return f(u,h,null,y)},Dn.flushSync=function(u){var h=m.T,y=a.p;try{if(m.T=null,a.p=2,u)return u()}finally{m.T=h,a.p=y,a.d.f()}},Dn.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))},Dn.prefetchDNS=function(u){typeof u=="string"&&a.d.D(u)},Dn.preinit=function(u,h){if(typeof u=="string"&&h&&typeof h.as=="string"){var y=h.as,g=c(y,h.crossOrigin),C=typeof h.integrity=="string"?h.integrity:void 0,E=typeof h.fetchPriority=="string"?h.fetchPriority:void 0;y==="style"?a.d.S(u,typeof h.precedence=="string"?h.precedence:void 0,{crossOrigin:g,integrity:C,fetchPriority:E}):y==="script"&&a.d.X(u,{crossOrigin:g,integrity:C,fetchPriority:E,nonce:typeof h.nonce=="string"?h.nonce:void 0})}},Dn.preinitModule=function(u,h){if(typeof u=="string")if(typeof h=="object"&&h!==null){if(h.as==null||h.as==="script"){var y=c(h.as,h.crossOrigin);a.d.M(u,{crossOrigin:y,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)},Dn.preload=function(u,h){if(typeof u=="string"&&typeof h=="object"&&h!==null&&typeof h.as=="string"){var y=h.as,g=c(y,h.crossOrigin);a.d.L(u,y,{crossOrigin:g,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})}},Dn.preloadModule=function(u,h){if(typeof u=="string")if(h){var y=c(h.as,h.crossOrigin);a.d.m(u,{as:typeof h.as=="string"&&h.as!=="script"?h.as:void 0,crossOrigin:y,integrity:typeof h.integrity=="string"?h.integrity:void 0})}else a.d.m(u)},Dn.requestFormReset=function(u){a.d.r(u)},Dn.unstable_batchedUpdates=function(u,h){return u(h)},Dn.useFormState=function(u,h,y){return m.H.useFormState(u,h,y)},Dn.useFormStatus=function(){return m.H.useHostTransitionStatus()},Dn.version="19.2.7",Dn}var W0;function ky(){if(W0)return Sf.exports;W0=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(n){console.error(n)}}return e(),Sf.exports=aE(),Sf.exports}var G0;function oE(){if(G0)return ol;G0=1;var e=sE(),n=vg(),r=ky();function a(t){var i="https://react.dev/errors/"+t;if(1<arguments.length){i+="?args[]="+encodeURIComponent(arguments[1]);for(var s=2;s<arguments.length;s++)i+="&args[]="+encodeURIComponent(arguments[s])}return"Minified React error #"+t+"; visit "+i+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function l(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)}function f(t){var i=t,s=t;if(t.alternate)for(;i.return;)i=i.return;else{t=i;do i=t,(i.flags&4098)!==0&&(s=i.return),t=i.return;while(t)}return i.tag===3?s:null}function m(t){if(t.tag===13){var i=t.memoizedState;if(i===null&&(t=t.alternate,t!==null&&(i=t.memoizedState)),i!==null)return i.dehydrated}return null}function c(t){if(t.tag===31){var i=t.memoizedState;if(i===null&&(t=t.alternate,t!==null&&(i=t.memoizedState)),i!==null)return i.dehydrated}return null}function u(t){if(f(t)!==t)throw Error(a(188))}function h(t){var i=t.alternate;if(!i){if(i=f(t),i===null)throw Error(a(188));return i!==t?null:t}for(var s=t,o=i;;){var _=s.return;if(_===null)break;var w=_.alternate;if(w===null){if(o=_.return,o!==null){s=o;continue}break}if(_.child===w.child){for(w=_.child;w;){if(w===s)return u(_),t;if(w===o)return u(_),i;w=w.sibling}throw Error(a(188))}if(s.return!==o.return)s=_,o=w;else{for(var D=!1,j=_.child;j;){if(j===s){D=!0,s=_,o=w;break}if(j===o){D=!0,o=_,s=w;break}j=j.sibling}if(!D){for(j=w.child;j;){if(j===s){D=!0,s=w,o=_;break}if(j===o){D=!0,o=w,s=_;break}j=j.sibling}if(!D)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?t:i}function y(t){var i=t.tag;if(i===5||i===26||i===27||i===6)return t;for(t=t.child;t!==null;){if(i=y(t),i!==null)return i;t=t.sibling}return null}var g=Object.assign,C=Symbol.for("react.element"),E=Symbol.for("react.transitional.element"),A=Symbol.for("react.portal"),T=Symbol.for("react.fragment"),p=Symbol.for("react.strict_mode"),v=Symbol.for("react.profiler"),d=Symbol.for("react.consumer"),b=Symbol.for("react.context"),x=Symbol.for("react.forward_ref"),L=Symbol.for("react.suspense"),R=Symbol.for("react.suspense_list"),M=Symbol.for("react.memo"),k=Symbol.for("react.lazy"),O=Symbol.for("react.activity"),U=Symbol.for("react.memo_cache_sentinel"),F=Symbol.iterator;function G(t){return t===null||typeof t!="object"?null:(t=F&&t[F]||t["@@iterator"],typeof t=="function"?t:null)}var I=Symbol.for("react.client.reference");function K(t){if(t==null)return null;if(typeof t=="function")return t.$$typeof===I?null:t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case T:return"Fragment";case v:return"Profiler";case p:return"StrictMode";case L:return"Suspense";case R:return"SuspenseList";case O:return"Activity"}if(typeof t=="object")switch(t.$$typeof){case A:return"Portal";case b:return t.displayName||"Context";case d:return(t._context.displayName||"Context")+".Consumer";case x:var i=t.render;return t=t.displayName,t||(t=i.displayName||i.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case M:return i=t.displayName||null,i!==null?i:K(t.type)||"Memo";case k:i=t._payload,t=t._init;try{return K(t(i))}catch{}}return null}var te=Array.isArray,q=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,W=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 N(t){return{current:t}}function P(t){0>z||(t.current=B[z],B[z]=null,z--)}function Z(t,i){z++,B[z]=t.current,t.current=i}var ae=N(null),ce=N(null),_e=N(null),Q=N(null);function $(t,i){switch(Z(_e,i),Z(ce,t),Z(ae,null),i.nodeType){case 9:case 11:t=(t=i.documentElement)&&(t=t.namespaceURI)?o0(t):0;break;default:if(t=i.tagName,i=i.namespaceURI)i=o0(i),t=l0(i,t);else switch(t){case"svg":t=1;break;case"math":t=2;break;default:t=0}}P(ae),Z(ae,t)}function oe(){P(ae),P(ce),P(_e)}function ge(t){t.memoizedState!==null&&Z(Q,t);var i=ae.current,s=l0(i,t.type);i!==s&&(Z(ce,t),Z(ae,s))}function Se(t){ce.current===t&&(P(ae),P(ce)),Q.current===t&&(P(Q),nl._currentValue=Y)}var ye,$e;function Fe(t){if(ye===void 0)try{throw Error()}catch(s){var i=s.stack.trim().match(/\n( *(at )?)/);ye=i&&i[1]||"",$e=-1<s.stack.indexOf(`
|
|
2
|
+
at`)?" (<anonymous>)":-1<s.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
3
|
+
`+ye+t+$e}var Xe=!1;function xt(t,i){if(!t||Xe)return"";Xe=!0;var s=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var o={DetermineComponentFrameRoot:function(){try{if(i){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(t,[],fe)}else{try{fe.call()}catch(le){se=le}t.call(fe.prototype)}}else{try{throw Error()}catch(le){se=le}(fe=t())&&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 _=Object.getOwnPropertyDescriptor(o.DetermineComponentFrameRoot,"name");_&&_.configurable&&Object.defineProperty(o.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var w=o.DetermineComponentFrameRoot(),D=w[0],j=w[1];if(D&&j){var X=D.split(`
|
|
4
|
+
`),re=j.split(`
|
|
5
|
+
`);for(_=o=0;o<X.length&&!X[o].includes("DetermineComponentFrameRoot");)o++;for(;_<re.length&&!re[_].includes("DetermineComponentFrameRoot");)_++;if(o===X.length||_===re.length)for(o=X.length-1,_=re.length-1;1<=o&&0<=_&&X[o]!==re[_];)_--;for(;1<=o&&0<=_;o--,_--)if(X[o]!==re[_]){if(o!==1||_!==1)do if(o--,_--,0>_||X[o]!==re[_]){var ue=`
|
|
6
|
+
`+X[o].replace(" at new "," at ");return t.displayName&&ue.includes("<anonymous>")&&(ue=ue.replace("<anonymous>",t.displayName)),ue}while(1<=o&&0<=_);break}}}finally{Xe=!1,Error.prepareStackTrace=s}return(s=t?t.displayName||t.name:"")?Fe(s):""}function Ne(t,i){switch(t.tag){case 26:case 27:case 5:return Fe(t.type);case 16:return Fe("Lazy");case 13:return t.child!==i&&i!==null?Fe("Suspense Fallback"):Fe("Suspense");case 19:return Fe("SuspenseList");case 0:case 15:return xt(t.type,!1);case 11:return xt(t.type.render,!1);case 1:return xt(t.type,!0);case 31:return Fe("Activity");default:return""}}function en(t){try{var i="",s=null;do i+=Ne(t,s),s=t,t=t.return;while(t);return i}catch(o){return`
|
|
7
|
+
Error generating stack: `+o.message+`
|
|
8
|
+
`+o.stack}}var bn=Object.prototype.hasOwnProperty,yn=e.unstable_scheduleCallback,pi=e.unstable_cancelCallback,Mi=e.unstable_shouldYield,tn=e.unstable_requestPaint,ut=e.unstable_now,Vt=e.unstable_getCurrentPriorityLevel,zt=e.unstable_ImmediatePriority,$t=e.unstable_UserBlockingPriority,nn=e.unstable_NormalPriority,Di=e.unstable_LowPriority,Ln=e.unstable_IdlePriority,ni=e.log,dt=e.unstable_setDisableYieldValue,Hn=null,Yt=null;function Xt(t){if(typeof ni=="function"&&dt(t),Yt&&typeof Yt.setStrictMode=="function")try{Yt.setStrictMode(Hn,t)}catch{}}var Pt=Math.clz32?Math.clz32:sa,Cs=Math.log,or=Math.LN2;function sa(t){return t>>>=0,t===0?32:31-(Cs(t)/or|0)|0}var Oi=256,Gi=262144,lr=4194304;function rn(t){var i=t&42;if(i!==0)return i;switch(t&-t){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 t&261888;case 262144:case 524288:case 1048576:case 2097152:return t&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return t&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return t}}function J(t,i,s){var o=t.pendingLanes;if(o===0)return 0;var _=0,w=t.suspendedLanes,D=t.pingedLanes;t=t.warmLanes;var j=o&134217727;return j!==0?(o=j&~w,o!==0?_=rn(o):(D&=j,D!==0?_=rn(D):s||(s=j&~t,s!==0&&(_=rn(s))))):(j=o&~w,j!==0?_=rn(j):D!==0?_=rn(D):s||(s=o&~t,s!==0&&(_=rn(s)))),_===0?0:i!==0&&i!==_&&(i&w)===0&&(w=_&-_,s=i&-i,w>=s||w===32&&(s&4194048)!==0)?i:_}function he(t,i){return(t.pendingLanes&~(t.suspendedLanes&~t.pingedLanes)&i)===0}function ve(t,i){switch(t){case 1:case 2:case 4:case 8:case 64:return i+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 i+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 t=lr;return lr<<=1,(lr&62914560)===0&&(lr=4194304),t}function wt(t){for(var i=[],s=0;31>s;s++)i.push(t);return i}function ft(t,i){t.pendingLanes|=i,i!==268435456&&(t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0)}function Te(t,i,s,o,_,w){var D=t.pendingLanes;t.pendingLanes=s,t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0,t.expiredLanes&=s,t.entangledLanes&=s,t.errorRecoveryDisabledLanes&=s,t.shellSuspendCounter=0;var j=t.entanglements,X=t.expirationTimes,re=t.hiddenUpdates;for(s=D&~s;0<s;){var ue=31-Pt(s),fe=1<<ue;j[ue]=0,X[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&&Ce(t,o,0),w!==0&&_===0&&t.tag!==0&&(t.suspendedLanes|=w&~(D&~i))}function Ce(t,i,s){t.pendingLanes|=i,t.suspendedLanes&=~i;var o=31-Pt(i);t.entangledLanes|=i,t.entanglements[o]=t.entanglements[o]|1073741824|s&261930}function je(t,i){var s=t.entangledLanes|=i;for(t=t.entanglements;s;){var o=31-Pt(s),_=1<<o;_&i|t[o]&i&&(t[o]|=i),s&=~_}}function It(t,i){var s=i&-i;return s=(s&42)!==0?1:et(s),(s&(t.suspendedLanes|i))!==0?0:s}function et(t){switch(t){case 2:t=1;break;case 8:t=4;break;case 32:t=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:t=128;break;case 268435456:t=134217728;break;default:t=0}return t}function Sn(t){return t&=-t,2<t?8<t?(t&134217727)!==0?32:268435456:8:2}function cr(){var t=W.p;return t!==0?t:(t=window.event,t===void 0?32:M0(t.type))}function ur(t,i){var s=W.p;try{return W.p=t,i()}finally{W.p=s}}var Un=Math.random().toString(36).slice(2),At="__reactFiber$"+Un,Et="__reactProps$"+Un,Ni="__reactContainer$"+Un,Pr="__reactEvents$"+Un,aa="__reactListeners$"+Un,hr="__reactHandles$"+Un,xs="__reactResources$"+Un,Ki="__reactMarker$"+Un;function De(t){delete t[At],delete t[Et],delete t[Pr],delete t[aa],delete t[hr]}function V(t){var i=t[At];if(i)return i;for(var s=t.parentNode;s;){if(i=s[Ni]||s[At]){if(s=i.alternate,i.child!==null||s!==null&&s.child!==null)for(t=g0(t);t!==null;){if(s=t[At])return s;t=g0(t)}return i}t=s,s=t.parentNode}return null}function pe(t){if(t=t[At]||t[Ni]){var i=t.tag;if(i===5||i===6||i===13||i===31||i===26||i===27||i===3)return t}return null}function xe(t){var i=t.tag;if(i===5||i===26||i===27||i===6)return t.stateNode;throw Error(a(33))}function rt(t){var i=t[xs];return i||(i=t[xs]={hoistableStyles:new Map,hoistableScripts:new Map}),i}function Ze(t){t[Ki]=!0}var kt=new Set,Ht={};function Ut(t,i){me(t,i),me(t+"Capture",i)}function me(t,i){for(Ht[t]=i,t=0;t<i.length;t++)kt.add(i[t])}var Me=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={},at={};function Ot(t){return bn.call(at,t)?!0:bn.call(Oe,t)?!1:Me.test(t)?at[t]=!0:(Oe[t]=!0,!1)}function Mn(t,i,s){if(Ot(i))if(s===null)t.removeAttribute(i);else{switch(typeof s){case"undefined":case"function":case"symbol":t.removeAttribute(i);return;case"boolean":var o=i.toLowerCase().slice(0,5);if(o!=="data-"&&o!=="aria-"){t.removeAttribute(i);return}}t.setAttribute(i,""+s)}}function ii(t,i,s){if(s===null)t.removeAttribute(i);else{switch(typeof s){case"undefined":case"function":case"symbol":case"boolean":t.removeAttribute(i);return}t.setAttribute(i,""+s)}}function Fn(t,i,s,o){if(o===null)t.removeAttribute(s);else{switch(typeof o){case"undefined":case"function":case"symbol":case"boolean":t.removeAttribute(s);return}t.setAttributeNS(i,s,""+o)}}function Tt(t){switch(typeof t){case"bigint":case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function ri(t){var i=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(i==="checkbox"||i==="radio")}function Gl(t,i,s){var o=Object.getOwnPropertyDescriptor(t.constructor.prototype,i);if(!t.hasOwnProperty(i)&&typeof o<"u"&&typeof o.get=="function"&&typeof o.set=="function"){var _=o.get,w=o.set;return Object.defineProperty(t,i,{configurable:!0,get:function(){return _.call(this)},set:function(D){s=""+D,w.call(this,D)}}),Object.defineProperty(t,i,{enumerable:o.enumerable}),{getValue:function(){return s},setValue:function(D){s=""+D},stopTracking:function(){t._valueTracker=null,delete t[i]}}}}function oa(t){if(!t._valueTracker){var i=ri(t)?"checked":"value";t._valueTracker=Gl(t,i,""+t[i])}}function go(t){if(!t)return!1;var i=t._valueTracker;if(!i)return!0;var s=i.getValue(),o="";return t&&(o=ri(t)?t.checked?"true":"false":t.value),t=o,t!==s?(i.setValue(t),!0):!1}function la(t){if(t=t||(typeof document<"u"?document:void 0),typeof t>"u")return null;try{return t.activeElement||t.body}catch{return t.body}}var ph=/[\n"\\]/g;function qn(t){return t.replace(ph,function(i){return"\\"+i.charCodeAt(0).toString(16)+" "})}function mo(t,i,s,o,_,w,D,j){t.name="",D!=null&&typeof D!="function"&&typeof D!="symbol"&&typeof D!="boolean"?t.type=D:t.removeAttribute("type"),i!=null?D==="number"?(i===0&&t.value===""||t.value!=i)&&(t.value=""+Tt(i)):t.value!==""+Tt(i)&&(t.value=""+Tt(i)):D!=="submit"&&D!=="reset"||t.removeAttribute("value"),i!=null?ca(t,D,Tt(i)):s!=null?ca(t,D,Tt(s)):o!=null&&t.removeAttribute("value"),_==null&&w!=null&&(t.defaultChecked=!!w),_!=null&&(t.checked=_&&typeof _!="function"&&typeof _!="symbol"),j!=null&&typeof j!="function"&&typeof j!="symbol"&&typeof j!="boolean"?t.name=""+Tt(j):t.removeAttribute("name")}function Es(t,i,s,o,_,w,D,j){if(w!=null&&typeof w!="function"&&typeof w!="symbol"&&typeof w!="boolean"&&(t.type=w),i!=null||s!=null){if(!(w!=="submit"&&w!=="reset"||i!=null)){oa(t);return}s=s!=null?""+Tt(s):"",i=i!=null?""+Tt(i):s,j||i===t.value||(t.value=i),t.defaultValue=i}o=o??_,o=typeof o!="function"&&typeof o!="symbol"&&!!o,t.checked=j?t.checked:!!o,t.defaultChecked=!!o,D!=null&&typeof D!="function"&&typeof D!="symbol"&&typeof D!="boolean"&&(t.name=D),oa(t)}function ca(t,i,s){i==="number"&&la(t.ownerDocument)===t||t.defaultValue===""+s||(t.defaultValue=""+s)}function wn(t,i,s,o){if(t=t.options,i){i={};for(var _=0;_<s.length;_++)i["$"+s[_]]=!0;for(s=0;s<t.length;s++)_=i.hasOwnProperty("$"+t[s].value),t[s].selected!==_&&(t[s].selected=_),_&&o&&(t[s].defaultSelected=!0)}else{for(s=""+Tt(s),i=null,_=0;_<t.length;_++){if(t[_].value===s){t[_].selected=!0,o&&(t[_].defaultSelected=!0);return}i!==null||t[_].disabled||(i=t[_])}i!==null&&(i.selected=!0)}}function Kl(t,i,s){if(i!=null&&(i=""+Tt(i),i!==t.value&&(t.value=i),s==null)){t.defaultValue!==i&&(t.defaultValue=i);return}t.defaultValue=s!=null?""+Tt(s):""}function ua(t,i,s,o){if(i==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=""),i=s}s=Tt(i),t.defaultValue=s,o=t.textContent,o===s&&o!==""&&o!==null&&(t.value=o),oa(t)}function Pe(t,i){if(i){var s=t.firstChild;if(s&&s===t.lastChild&&s.nodeType===3){s.nodeValue=i;return}}t.textContent=i}var Vl=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 sn(t,i,s){var o=i.indexOf("--")===0;s==null||typeof s=="boolean"||s===""?o?t.setProperty(i,""):i==="float"?t.cssFloat="":t[i]="":o?t.setProperty(i,s):typeof s!="number"||s===0||Vl.has(i)?i==="float"?t.cssFloat=s:t[i]=(""+s).trim():t[i]=s+"px"}function pt(t,i,s){if(i!=null&&typeof i!="object")throw Error(a(62));if(t=t.style,s!=null){for(var o in s)!s.hasOwnProperty(o)||i!=null&&i.hasOwnProperty(o)||(o.indexOf("--")===0?t.setProperty(o,""):o==="float"?t.cssFloat="":t[o]="");for(var _ in i)o=i[_],i.hasOwnProperty(_)&&s[_]!==o&&sn(t,_,o)}else for(var w in i)i.hasOwnProperty(w)&&sn(t,w,i[w])}function Hr(t){if(t.indexOf("-")===-1)return!1;switch(t){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 dr=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"]]),_o=/^[\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 Ur(t){return _o.test(""+t)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":t}function we(){}var Re=null;function qe(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var tt=null,jt=null;function gi(t){var i=pe(t);if(i&&(t=i.stateNode)){var s=t[Et]||null;e:switch(t=i.stateNode,i.type){case"input":if(mo(t,s.value,s.defaultValue,s.defaultValue,s.checked,s.defaultChecked,s.type,s.name),i=s.name,s.type==="radio"&&i!=null){for(s=t;s.parentNode;)s=s.parentNode;for(s=s.querySelectorAll('input[name="'+qn(""+i)+'"][type="radio"]'),i=0;i<s.length;i++){var o=s[i];if(o!==t&&o.form===t.form){var _=o[Et]||null;if(!_)throw Error(a(90));mo(o,_.value,_.defaultValue,_.defaultValue,_.checked,_.defaultChecked,_.type,_.name)}}for(i=0;i<s.length;i++)o=s[i],o.form===t.form&&go(o)}break e;case"textarea":Kl(t,s.value,s.defaultValue);break e;case"select":i=s.value,i!=null&&wn(t,!!s.multiple,i,!1)}}}var vo=!1;function Yl(t,i,s){if(vo)return t(i,s);vo=!0;try{var o=t(i);return o}finally{if(vo=!1,(tt!==null||jt!==null)&&(Ic(),tt&&(i=tt,t=jt,jt=tt=null,gi(i),t)))for(i=0;i<t.length;i++)gi(t[i])}}function bo(t,i){var s=t.stateNode;if(s===null)return null;var o=s[Et]||null;if(o===null)return null;s=o[i];e:switch(i){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)||(t=t.type,o=!(t==="button"||t==="input"||t==="select"||t==="textarea")),t=!o;break e;default:t=!1}if(t)return null;if(s&&typeof s!="function")throw Error(a(231,i,typeof s));return s}var fr=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),gh=!1;if(fr)try{var yo={};Object.defineProperty(yo,"passive",{get:function(){gh=!0}}),window.addEventListener("test",yo,yo),window.removeEventListener("test",yo,yo)}catch{gh=!1}var Fr=null,mh=null,Xl=null;function lm(){if(Xl)return Xl;var t,i=mh,s=i.length,o,_="value"in Fr?Fr.value:Fr.textContent,w=_.length;for(t=0;t<s&&i[t]===_[t];t++);var D=s-t;for(o=1;o<=D&&i[s-o]===_[w-o];o++);return Xl=_.slice(t,1<o?1-o:void 0)}function Zl(t){var i=t.keyCode;return"charCode"in t?(t=t.charCode,t===0&&i===13&&(t=13)):t=i,t===10&&(t=13),32<=t||t===13?t:0}function Jl(){return!0}function cm(){return!1}function Wn(t){function i(s,o,_,w,D){this._reactName=s,this._targetInst=_,this.type=o,this.nativeEvent=w,this.target=D,this.currentTarget=null;for(var j in t)t.hasOwnProperty(j)&&(s=t[j],this[j]=s?s(w):w[j]);return this.isDefaultPrevented=(w.defaultPrevented!=null?w.defaultPrevented:w.returnValue===!1)?Jl:cm,this.isPropagationStopped=cm,this}return g(i.prototype,{preventDefault:function(){this.defaultPrevented=!0;var s=this.nativeEvent;s&&(s.preventDefault?s.preventDefault():typeof s.returnValue!="unknown"&&(s.returnValue=!1),this.isDefaultPrevented=Jl)},stopPropagation:function(){var s=this.nativeEvent;s&&(s.stopPropagation?s.stopPropagation():typeof s.cancelBubble!="unknown"&&(s.cancelBubble=!0),this.isPropagationStopped=Jl)},persist:function(){},isPersistent:Jl}),i}var Ts={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(t){return t.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Ql=Wn(Ts),So=g({},Ts,{view:0,detail:0}),JC=Wn(So),_h,vh,wo,ec=g({},So,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:yh,button:0,buttons:0,relatedTarget:function(t){return t.relatedTarget===void 0?t.fromElement===t.srcElement?t.toElement:t.fromElement:t.relatedTarget},movementX:function(t){return"movementX"in t?t.movementX:(t!==wo&&(wo&&t.type==="mousemove"?(_h=t.screenX-wo.screenX,vh=t.screenY-wo.screenY):vh=_h=0,wo=t),_h)},movementY:function(t){return"movementY"in t?t.movementY:vh}}),um=Wn(ec),QC=g({},ec,{dataTransfer:0}),ex=Wn(QC),tx=g({},So,{relatedTarget:0}),bh=Wn(tx),nx=g({},Ts,{animationName:0,elapsedTime:0,pseudoElement:0}),ix=Wn(nx),rx=g({},Ts,{clipboardData:function(t){return"clipboardData"in t?t.clipboardData:window.clipboardData}}),sx=Wn(rx),ax=g({},Ts,{data:0}),hm=Wn(ax),ox={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},lx={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"},cx={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function ux(t){var i=this.nativeEvent;return i.getModifierState?i.getModifierState(t):(t=cx[t])?!!i[t]:!1}function yh(){return ux}var hx=g({},So,{key:function(t){if(t.key){var i=ox[t.key]||t.key;if(i!=="Unidentified")return i}return t.type==="keypress"?(t=Zl(t),t===13?"Enter":String.fromCharCode(t)):t.type==="keydown"||t.type==="keyup"?lx[t.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:yh,charCode:function(t){return t.type==="keypress"?Zl(t):0},keyCode:function(t){return t.type==="keydown"||t.type==="keyup"?t.keyCode:0},which:function(t){return t.type==="keypress"?Zl(t):t.type==="keydown"||t.type==="keyup"?t.keyCode:0}}),dx=Wn(hx),fx=g({},ec,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),dm=Wn(fx),px=g({},So,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:yh}),gx=Wn(px),mx=g({},Ts,{propertyName:0,elapsedTime:0,pseudoElement:0}),_x=Wn(mx),vx=g({},ec,{deltaX:function(t){return"deltaX"in t?t.deltaX:"wheelDeltaX"in t?-t.wheelDeltaX:0},deltaY:function(t){return"deltaY"in t?t.deltaY:"wheelDeltaY"in t?-t.wheelDeltaY:"wheelDelta"in t?-t.wheelDelta:0},deltaZ:0,deltaMode:0}),bx=Wn(vx),yx=g({},Ts,{newState:0,oldState:0}),Sx=Wn(yx),wx=[9,13,27,32],Sh=fr&&"CompositionEvent"in window,Co=null;fr&&"documentMode"in document&&(Co=document.documentMode);var Cx=fr&&"TextEvent"in window&&!Co,fm=fr&&(!Sh||Co&&8<Co&&11>=Co),pm=" ",gm=!1;function mm(t,i){switch(t){case"keyup":return wx.indexOf(i.keyCode)!==-1;case"keydown":return i.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function _m(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var ha=!1;function xx(t,i){switch(t){case"compositionend":return _m(i);case"keypress":return i.which!==32?null:(gm=!0,pm);case"textInput":return t=i.data,t===pm&&gm?null:t;default:return null}}function Ex(t,i){if(ha)return t==="compositionend"||!Sh&&mm(t,i)?(t=lm(),Xl=mh=Fr=null,ha=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(i.ctrlKey||i.altKey||i.metaKey)||i.ctrlKey&&i.altKey){if(i.char&&1<i.char.length)return i.char;if(i.which)return String.fromCharCode(i.which)}return null;case"compositionend":return fm&&i.locale!=="ko"?null:i.data;default:return null}}var Tx={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 vm(t){var i=t&&t.nodeName&&t.nodeName.toLowerCase();return i==="input"?!!Tx[t.type]:i==="textarea"}function bm(t,i,s,o){tt?jt?jt.push(o):jt=[o]:tt=o,i=Fc(i,"onChange"),0<i.length&&(s=new Ql("onChange","change",null,s,o),t.push({event:s,listeners:i}))}var xo=null,Eo=null;function Ax(t){t0(t,0)}function tc(t){var i=xe(t);if(go(i))return t}function ym(t,i){if(t==="change")return i}var Sm=!1;if(fr){var wh;if(fr){var Ch="oninput"in document;if(!Ch){var wm=document.createElement("div");wm.setAttribute("oninput","return;"),Ch=typeof wm.oninput=="function"}wh=Ch}else wh=!1;Sm=wh&&(!document.documentMode||9<document.documentMode)}function Cm(){xo&&(xo.detachEvent("onpropertychange",xm),Eo=xo=null)}function xm(t){if(t.propertyName==="value"&&tc(Eo)){var i=[];bm(i,Eo,t,qe(t)),Yl(Ax,i)}}function kx(t,i,s){t==="focusin"?(Cm(),xo=i,Eo=s,xo.attachEvent("onpropertychange",xm)):t==="focusout"&&Cm()}function Rx(t){if(t==="selectionchange"||t==="keyup"||t==="keydown")return tc(Eo)}function Lx(t,i){if(t==="click")return tc(i)}function Mx(t,i){if(t==="input"||t==="change")return tc(i)}function Dx(t,i){return t===i&&(t!==0||1/t===1/i)||t!==t&&i!==i}var si=typeof Object.is=="function"?Object.is:Dx;function To(t,i){if(si(t,i))return!0;if(typeof t!="object"||t===null||typeof i!="object"||i===null)return!1;var s=Object.keys(t),o=Object.keys(i);if(s.length!==o.length)return!1;for(o=0;o<s.length;o++){var _=s[o];if(!bn.call(i,_)||!si(t[_],i[_]))return!1}return!0}function Em(t){for(;t&&t.firstChild;)t=t.firstChild;return t}function Tm(t,i){var s=Em(t);t=0;for(var o;s;){if(s.nodeType===3){if(o=t+s.textContent.length,t<=i&&o>=i)return{node:s,offset:i-t};t=o}e:{for(;s;){if(s.nextSibling){s=s.nextSibling;break e}s=s.parentNode}s=void 0}s=Em(s)}}function Am(t,i){return t&&i?t===i?!0:t&&t.nodeType===3?!1:i&&i.nodeType===3?Am(t,i.parentNode):"contains"in t?t.contains(i):t.compareDocumentPosition?!!(t.compareDocumentPosition(i)&16):!1:!1}function km(t){t=t!=null&&t.ownerDocument!=null&&t.ownerDocument.defaultView!=null?t.ownerDocument.defaultView:window;for(var i=la(t.document);i instanceof t.HTMLIFrameElement;){try{var s=typeof i.contentWindow.location.href=="string"}catch{s=!1}if(s)t=i.contentWindow;else break;i=la(t.document)}return i}function xh(t){var i=t&&t.nodeName&&t.nodeName.toLowerCase();return i&&(i==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||i==="textarea"||t.contentEditable==="true")}var Ox=fr&&"documentMode"in document&&11>=document.documentMode,da=null,Eh=null,Ao=null,Th=!1;function Rm(t,i,s){var o=s.window===s?s.document:s.nodeType===9?s:s.ownerDocument;Th||da==null||da!==la(o)||(o=da,"selectionStart"in o&&xh(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}),Ao&&To(Ao,o)||(Ao=o,o=Fc(Eh,"onSelect"),0<o.length&&(i=new Ql("onSelect","select",null,i,s),t.push({event:i,listeners:o}),i.target=da)))}function As(t,i){var s={};return s[t.toLowerCase()]=i.toLowerCase(),s["Webkit"+t]="webkit"+i,s["Moz"+t]="moz"+i,s}var fa={animationend:As("Animation","AnimationEnd"),animationiteration:As("Animation","AnimationIteration"),animationstart:As("Animation","AnimationStart"),transitionrun:As("Transition","TransitionRun"),transitionstart:As("Transition","TransitionStart"),transitioncancel:As("Transition","TransitionCancel"),transitionend:As("Transition","TransitionEnd")},Ah={},Lm={};fr&&(Lm=document.createElement("div").style,"AnimationEvent"in window||(delete fa.animationend.animation,delete fa.animationiteration.animation,delete fa.animationstart.animation),"TransitionEvent"in window||delete fa.transitionend.transition);function ks(t){if(Ah[t])return Ah[t];if(!fa[t])return t;var i=fa[t],s;for(s in i)if(i.hasOwnProperty(s)&&s in Lm)return Ah[t]=i[s];return t}var Mm=ks("animationend"),Dm=ks("animationiteration"),Om=ks("animationstart"),Nx=ks("transitionrun"),Bx=ks("transitionstart"),Ix=ks("transitioncancel"),Nm=ks("transitionend"),Bm=new Map,kh="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(" ");kh.push("scrollEnd");function Bi(t,i){Bm.set(t,i),Ut(i,[t])}var nc=typeof reportError=="function"?reportError:function(t){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var i=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof t=="object"&&t!==null&&typeof t.message=="string"?String(t.message):String(t),error:t});if(!window.dispatchEvent(i))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",t);return}console.error(t)},mi=[],pa=0,Rh=0;function ic(){for(var t=pa,i=Rh=pa=0;i<t;){var s=mi[i];mi[i++]=null;var o=mi[i];mi[i++]=null;var _=mi[i];mi[i++]=null;var w=mi[i];if(mi[i++]=null,o!==null&&_!==null){var D=o.pending;D===null?_.next=_:(_.next=D.next,D.next=_),o.pending=_}w!==0&&Im(s,_,w)}}function rc(t,i,s,o){mi[pa++]=t,mi[pa++]=i,mi[pa++]=s,mi[pa++]=o,Rh|=o,t.lanes|=o,t=t.alternate,t!==null&&(t.lanes|=o)}function Lh(t,i,s,o){return rc(t,i,s,o),sc(t)}function Rs(t,i){return rc(t,null,null,i),sc(t)}function Im(t,i,s){t.lanes|=s;var o=t.alternate;o!==null&&(o.lanes|=s);for(var _=!1,w=t.return;w!==null;)w.childLanes|=s,o=w.alternate,o!==null&&(o.childLanes|=s),w.tag===22&&(t=w.stateNode,t===null||t._visibility&1||(_=!0)),t=w,w=w.return;return t.tag===3?(w=t.stateNode,_&&i!==null&&(_=31-Pt(s),t=w.hiddenUpdates,o=t[_],o===null?t[_]=[i]:o.push(i),i.lane=s|536870912),w):null}function sc(t){if(50<Yo)throw Yo=0,$d=null,Error(a(185));for(var i=t.return;i!==null;)t=i,i=t.return;return t.tag===3?t.stateNode:null}var ga={};function jx(t,i,s,o){this.tag=t,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=i,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 ai(t,i,s,o){return new jx(t,i,s,o)}function Mh(t){return t=t.prototype,!(!t||!t.isReactComponent)}function pr(t,i){var s=t.alternate;return s===null?(s=ai(t.tag,i,t.key,t.mode),s.elementType=t.elementType,s.type=t.type,s.stateNode=t.stateNode,s.alternate=t,t.alternate=s):(s.pendingProps=i,s.type=t.type,s.flags=0,s.subtreeFlags=0,s.deletions=null),s.flags=t.flags&65011712,s.childLanes=t.childLanes,s.lanes=t.lanes,s.child=t.child,s.memoizedProps=t.memoizedProps,s.memoizedState=t.memoizedState,s.updateQueue=t.updateQueue,i=t.dependencies,s.dependencies=i===null?null:{lanes:i.lanes,firstContext:i.firstContext},s.sibling=t.sibling,s.index=t.index,s.ref=t.ref,s.refCleanup=t.refCleanup,s}function jm(t,i){t.flags&=65011714;var s=t.alternate;return s===null?(t.childLanes=0,t.lanes=i,t.child=null,t.subtreeFlags=0,t.memoizedProps=null,t.memoizedState=null,t.updateQueue=null,t.dependencies=null,t.stateNode=null):(t.childLanes=s.childLanes,t.lanes=s.lanes,t.child=s.child,t.subtreeFlags=0,t.deletions=null,t.memoizedProps=s.memoizedProps,t.memoizedState=s.memoizedState,t.updateQueue=s.updateQueue,t.type=s.type,i=s.dependencies,t.dependencies=i===null?null:{lanes:i.lanes,firstContext:i.firstContext}),t}function ac(t,i,s,o,_,w){var D=0;if(o=t,typeof t=="function")Mh(t)&&(D=1);else if(typeof t=="string")D=U2(t,s,ae.current)?26:t==="html"||t==="head"||t==="body"?27:5;else e:switch(t){case O:return t=ai(31,s,i,_),t.elementType=O,t.lanes=w,t;case T:return Ls(s.children,_,w,i);case p:D=8,_|=24;break;case v:return t=ai(12,s,i,_|2),t.elementType=v,t.lanes=w,t;case L:return t=ai(13,s,i,_),t.elementType=L,t.lanes=w,t;case R:return t=ai(19,s,i,_),t.elementType=R,t.lanes=w,t;default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case b:D=10;break e;case d:D=9;break e;case x:D=11;break e;case M:D=14;break e;case k:D=16,o=null;break e}D=29,s=Error(a(130,t===null?"null":typeof t,"")),o=null}return i=ai(D,s,i,_),i.elementType=t,i.type=o,i.lanes=w,i}function Ls(t,i,s,o){return t=ai(7,t,o,i),t.lanes=s,t}function Dh(t,i,s){return t=ai(6,t,null,i),t.lanes=s,t}function zm(t){var i=ai(18,null,null,0);return i.stateNode=t,i}function Oh(t,i,s){return i=ai(4,t.children!==null?t.children:[],t.key,i),i.lanes=s,i.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},i}var $m=new WeakMap;function _i(t,i){if(typeof t=="object"&&t!==null){var s=$m.get(t);return s!==void 0?s:(i={value:t,source:i,stack:en(i)},$m.set(t,i),i)}return{value:t,source:i,stack:en(i)}}var ma=[],_a=0,oc=null,ko=0,vi=[],bi=0,qr=null,Vi=1,Yi="";function gr(t,i){ma[_a++]=ko,ma[_a++]=oc,oc=t,ko=i}function Pm(t,i,s){vi[bi++]=Vi,vi[bi++]=Yi,vi[bi++]=qr,qr=t;var o=Vi;t=Yi;var _=32-Pt(o)-1;o&=~(1<<_),s+=1;var w=32-Pt(i)+_;if(30<w){var D=_-_%5;w=(o&(1<<D)-1).toString(32),o>>=D,_-=D,Vi=1<<32-Pt(i)+_|s<<_|o,Yi=w+t}else Vi=1<<w|s<<_|o,Yi=t}function Nh(t){t.return!==null&&(gr(t,1),Pm(t,1,0))}function Bh(t){for(;t===oc;)oc=ma[--_a],ma[_a]=null,ko=ma[--_a],ma[_a]=null;for(;t===qr;)qr=vi[--bi],vi[bi]=null,Yi=vi[--bi],vi[bi]=null,Vi=vi[--bi],vi[bi]=null}function Hm(t,i){vi[bi++]=Vi,vi[bi++]=Yi,vi[bi++]=qr,Vi=i.id,Yi=i.overflow,qr=t}var Cn=null,Rt=null,st=!1,Wr=null,yi=!1,Ih=Error(a(519));function Gr(t){var i=Error(a(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Ro(_i(i,t)),Ih}function Um(t){var i=t.stateNode,s=t.type,o=t.memoizedProps;switch(i[At]=t,i[Et]=o,s){case"dialog":Qe("cancel",i),Qe("close",i);break;case"iframe":case"object":case"embed":Qe("load",i);break;case"video":case"audio":for(s=0;s<Zo.length;s++)Qe(Zo[s],i);break;case"source":Qe("error",i);break;case"img":case"image":case"link":Qe("error",i),Qe("load",i);break;case"details":Qe("toggle",i);break;case"input":Qe("invalid",i),Es(i,o.value,o.defaultValue,o.checked,o.defaultChecked,o.type,o.name,!0);break;case"select":Qe("invalid",i);break;case"textarea":Qe("invalid",i),ua(i,o.value,o.defaultValue,o.children)}s=o.children,typeof s!="string"&&typeof s!="number"&&typeof s!="bigint"||i.textContent===""+s||o.suppressHydrationWarning===!0||s0(i.textContent,s)?(o.popover!=null&&(Qe("beforetoggle",i),Qe("toggle",i)),o.onScroll!=null&&Qe("scroll",i),o.onScrollEnd!=null&&Qe("scrollend",i),o.onClick!=null&&(i.onclick=we),i=!0):i=!1,i||Gr(t,!0)}function Fm(t){for(Cn=t.return;Cn;)switch(Cn.tag){case 5:case 31:case 13:yi=!1;return;case 27:case 3:yi=!0;return;default:Cn=Cn.return}}function va(t){if(t!==Cn)return!1;if(!st)return Fm(t),st=!0,!1;var i=t.tag,s;if((s=i!==3&&i!==27)&&((s=i===5)&&(s=t.type,s=!(s!=="form"&&s!=="button")||ef(t.type,t.memoizedProps)),s=!s),s&&Rt&&Gr(t),Fm(t),i===13){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(a(317));Rt=p0(t)}else if(i===31){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(a(317));Rt=p0(t)}else i===27?(i=Rt,as(t.type)?(t=af,af=null,Rt=t):Rt=i):Rt=Cn?wi(t.stateNode.nextSibling):null;return!0}function Ms(){Rt=Cn=null,st=!1}function jh(){var t=Wr;return t!==null&&(Yn===null?Yn=t:Yn.push.apply(Yn,t),Wr=null),t}function Ro(t){Wr===null?Wr=[t]:Wr.push(t)}var zh=N(null),Ds=null,mr=null;function Kr(t,i,s){Z(zh,i._currentValue),i._currentValue=s}function _r(t){t._currentValue=zh.current,P(zh)}function $h(t,i,s){for(;t!==null;){var o=t.alternate;if((t.childLanes&i)!==i?(t.childLanes|=i,o!==null&&(o.childLanes|=i)):o!==null&&(o.childLanes&i)!==i&&(o.childLanes|=i),t===s)break;t=t.return}}function Ph(t,i,s,o){var _=t.child;for(_!==null&&(_.return=t);_!==null;){var w=_.dependencies;if(w!==null){var D=_.child;w=w.firstContext;e:for(;w!==null;){var j=w;w=_;for(var X=0;X<i.length;X++)if(j.context===i[X]){w.lanes|=s,j=w.alternate,j!==null&&(j.lanes|=s),$h(w.return,s,t),o||(D=null);break e}w=j.next}}else if(_.tag===18){if(D=_.return,D===null)throw Error(a(341));D.lanes|=s,w=D.alternate,w!==null&&(w.lanes|=s),$h(D,s,t),D=null}else D=_.child;if(D!==null)D.return=_;else for(D=_;D!==null;){if(D===t){D=null;break}if(_=D.sibling,_!==null){_.return=D.return,D=_;break}D=D.return}_=D}}function ba(t,i,s,o){t=null;for(var _=i,w=!1;_!==null;){if(!w){if((_.flags&524288)!==0)w=!0;else if((_.flags&262144)!==0)break}if(_.tag===10){var D=_.alternate;if(D===null)throw Error(a(387));if(D=D.memoizedProps,D!==null){var j=_.type;si(_.pendingProps.value,D.value)||(t!==null?t.push(j):t=[j])}}else if(_===Q.current){if(D=_.alternate,D===null)throw Error(a(387));D.memoizedState.memoizedState!==_.memoizedState.memoizedState&&(t!==null?t.push(nl):t=[nl])}_=_.return}t!==null&&Ph(i,t,s,o),i.flags|=262144}function lc(t){for(t=t.firstContext;t!==null;){if(!si(t.context._currentValue,t.memoizedValue))return!0;t=t.next}return!1}function Os(t){Ds=t,mr=null,t=t.dependencies,t!==null&&(t.firstContext=null)}function xn(t){return qm(Ds,t)}function cc(t,i){return Ds===null&&Os(t),qm(t,i)}function qm(t,i){var s=i._currentValue;if(i={context:i,memoizedValue:s,next:null},mr===null){if(t===null)throw Error(a(308));mr=i,t.dependencies={lanes:0,firstContext:i},t.flags|=524288}else mr=mr.next=i;return s}var zx=typeof AbortController<"u"?AbortController:function(){var t=[],i=this.signal={aborted:!1,addEventListener:function(s,o){t.push(o)}};this.abort=function(){i.aborted=!0,t.forEach(function(s){return s()})}},$x=e.unstable_scheduleCallback,Px=e.unstable_NormalPriority,an={$$typeof:b,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Hh(){return{controller:new zx,data:new Map,refCount:0}}function Lo(t){t.refCount--,t.refCount===0&&$x(Px,function(){t.controller.abort()})}var Mo=null,Uh=0,ya=0,Sa=null;function Hx(t,i){if(Mo===null){var s=Mo=[];Uh=0,ya=Wd(),Sa={status:"pending",value:void 0,then:function(o){s.push(o)}}}return Uh++,i.then(Wm,Wm),i}function Wm(){if(--Uh===0&&Mo!==null){Sa!==null&&(Sa.status="fulfilled");var t=Mo;Mo=null,ya=0,Sa=null;for(var i=0;i<t.length;i++)(0,t[i])()}}function Ux(t,i){var s=[],o={status:"pending",value:null,reason:null,then:function(_){s.push(_)}};return t.then(function(){o.status="fulfilled",o.value=i;for(var _=0;_<s.length;_++)(0,s[_])(i)},function(_){for(o.status="rejected",o.reason=_,_=0;_<s.length;_++)(0,s[_])(void 0)}),o}var Gm=q.S;q.S=function(t,i){Rv=ut(),typeof i=="object"&&i!==null&&typeof i.then=="function"&&Hx(t,i),Gm!==null&&Gm(t,i)};var Ns=N(null);function Fh(){var t=Ns.current;return t!==null?t:Ct.pooledCache}function uc(t,i){i===null?Z(Ns,Ns.current):Z(Ns,i.pool)}function Km(){var t=Fh();return t===null?null:{parent:an._currentValue,pool:t}}var wa=Error(a(460)),qh=Error(a(474)),hc=Error(a(542)),dc={then:function(){}};function Vm(t){return t=t.status,t==="fulfilled"||t==="rejected"}function Ym(t,i,s){switch(s=t[s],s===void 0?t.push(i):s!==i&&(i.then(we,we),i=s),i.status){case"fulfilled":return i.value;case"rejected":throw t=i.reason,Zm(t),t;default:if(typeof i.status=="string")i.then(we,we);else{if(t=Ct,t!==null&&100<t.shellSuspendCounter)throw Error(a(482));t=i,t.status="pending",t.then(function(o){if(i.status==="pending"){var _=i;_.status="fulfilled",_.value=o}},function(o){if(i.status==="pending"){var _=i;_.status="rejected",_.reason=o}})}switch(i.status){case"fulfilled":return i.value;case"rejected":throw t=i.reason,Zm(t),t}throw Is=i,wa}}function Bs(t){try{var i=t._init;return i(t._payload)}catch(s){throw s!==null&&typeof s=="object"&&typeof s.then=="function"?(Is=s,wa):s}}var Is=null;function Xm(){if(Is===null)throw Error(a(459));var t=Is;return Is=null,t}function Zm(t){if(t===wa||t===hc)throw Error(a(483))}var Ca=null,Do=0;function fc(t){var i=Do;return Do+=1,Ca===null&&(Ca=[]),Ym(Ca,t,i)}function Oo(t,i){i=i.props.ref,t.ref=i!==void 0?i:null}function pc(t,i){throw i.$$typeof===C?Error(a(525)):(t=Object.prototype.toString.call(i),Error(a(31,t==="[object Object]"?"object with keys {"+Object.keys(i).join(", ")+"}":t)))}function Jm(t){function i(ne,ee){if(t){var ie=ne.deletions;ie===null?(ne.deletions=[ee],ne.flags|=16):ie.push(ee)}}function s(ne,ee){if(!t)return null;for(;ee!==null;)i(ne,ee),ee=ee.sibling;return null}function o(ne){for(var ee=new Map;ne!==null;)ne.key!==null?ee.set(ne.key,ne):ee.set(ne.index,ne),ne=ne.sibling;return ee}function _(ne,ee){return ne=pr(ne,ee),ne.index=0,ne.sibling=null,ne}function w(ne,ee,ie){return ne.index=ie,t?(ie=ne.alternate,ie!==null?(ie=ie.index,ie<ee?(ne.flags|=67108866,ee):ie):(ne.flags|=67108866,ee)):(ne.flags|=1048576,ee)}function D(ne){return t&&ne.alternate===null&&(ne.flags|=67108866),ne}function j(ne,ee,ie,de){return ee===null||ee.tag!==6?(ee=Dh(ie,ne.mode,de),ee.return=ne,ee):(ee=_(ee,ie),ee.return=ne,ee)}function X(ne,ee,ie,de){var Be=ie.type;return Be===T?ue(ne,ee,ie.props.children,de,ie.key):ee!==null&&(ee.elementType===Be||typeof Be=="object"&&Be!==null&&Be.$$typeof===k&&Bs(Be)===ee.type)?(ee=_(ee,ie.props),Oo(ee,ie),ee.return=ne,ee):(ee=ac(ie.type,ie.key,ie.props,null,ne.mode,de),Oo(ee,ie),ee.return=ne,ee)}function re(ne,ee,ie,de){return ee===null||ee.tag!==4||ee.stateNode.containerInfo!==ie.containerInfo||ee.stateNode.implementation!==ie.implementation?(ee=Oh(ie,ne.mode,de),ee.return=ne,ee):(ee=_(ee,ie.children||[]),ee.return=ne,ee)}function ue(ne,ee,ie,de,Be){return ee===null||ee.tag!==7?(ee=Ls(ie,ne.mode,de,Be),ee.return=ne,ee):(ee=_(ee,ie),ee.return=ne,ee)}function fe(ne,ee,ie){if(typeof ee=="string"&&ee!==""||typeof ee=="number"||typeof ee=="bigint")return ee=Dh(""+ee,ne.mode,ie),ee.return=ne,ee;if(typeof ee=="object"&&ee!==null){switch(ee.$$typeof){case E:return ie=ac(ee.type,ee.key,ee.props,null,ne.mode,ie),Oo(ie,ee),ie.return=ne,ie;case A:return ee=Oh(ee,ne.mode,ie),ee.return=ne,ee;case k:return ee=Bs(ee),fe(ne,ee,ie)}if(te(ee)||G(ee))return ee=Ls(ee,ne.mode,ie,null),ee.return=ne,ee;if(typeof ee.then=="function")return fe(ne,fc(ee),ie);if(ee.$$typeof===b)return fe(ne,cc(ne,ee),ie);pc(ne,ee)}return null}function se(ne,ee,ie,de){var Be=ee!==null?ee.key:null;if(typeof ie=="string"&&ie!==""||typeof ie=="number"||typeof ie=="bigint")return Be!==null?null:j(ne,ee,""+ie,de);if(typeof ie=="object"&&ie!==null){switch(ie.$$typeof){case E:return ie.key===Be?X(ne,ee,ie,de):null;case A:return ie.key===Be?re(ne,ee,ie,de):null;case k:return ie=Bs(ie),se(ne,ee,ie,de)}if(te(ie)||G(ie))return Be!==null?null:ue(ne,ee,ie,de,null);if(typeof ie.then=="function")return se(ne,ee,fc(ie),de);if(ie.$$typeof===b)return se(ne,ee,cc(ne,ie),de);pc(ne,ie)}return null}function le(ne,ee,ie,de,Be){if(typeof de=="string"&&de!==""||typeof de=="number"||typeof de=="bigint")return ne=ne.get(ie)||null,j(ee,ne,""+de,Be);if(typeof de=="object"&&de!==null){switch(de.$$typeof){case E:return ne=ne.get(de.key===null?ie:de.key)||null,X(ee,ne,de,Be);case A:return ne=ne.get(de.key===null?ie:de.key)||null,re(ee,ne,de,Be);case k:return de=Bs(de),le(ne,ee,ie,de,Be)}if(te(de)||G(de))return ne=ne.get(ie)||null,ue(ee,ne,de,Be,null);if(typeof de.then=="function")return le(ne,ee,ie,fc(de),Be);if(de.$$typeof===b)return le(ne,ee,ie,cc(ee,de),Be);pc(ee,de)}return null}function Ae(ne,ee,ie,de){for(var Be=null,ot=null,Le=ee,Ke=ee=0,it=null;Le!==null&&Ke<ie.length;Ke++){Le.index>Ke?(it=Le,Le=null):it=Le.sibling;var lt=se(ne,Le,ie[Ke],de);if(lt===null){Le===null&&(Le=it);break}t&&Le&<.alternate===null&&i(ne,Le),ee=w(lt,ee,Ke),ot===null?Be=lt:ot.sibling=lt,ot=lt,Le=it}if(Ke===ie.length)return s(ne,Le),st&&gr(ne,Ke),Be;if(Le===null){for(;Ke<ie.length;Ke++)Le=fe(ne,ie[Ke],de),Le!==null&&(ee=w(Le,ee,Ke),ot===null?Be=Le:ot.sibling=Le,ot=Le);return st&&gr(ne,Ke),Be}for(Le=o(Le);Ke<ie.length;Ke++)it=le(Le,ne,Ke,ie[Ke],de),it!==null&&(t&&it.alternate!==null&&Le.delete(it.key===null?Ke:it.key),ee=w(it,ee,Ke),ot===null?Be=it:ot.sibling=it,ot=it);return t&&Le.forEach(function(hs){return i(ne,hs)}),st&&gr(ne,Ke),Be}function ze(ne,ee,ie,de){if(ie==null)throw Error(a(151));for(var Be=null,ot=null,Le=ee,Ke=ee=0,it=null,lt=ie.next();Le!==null&&!lt.done;Ke++,lt=ie.next()){Le.index>Ke?(it=Le,Le=null):it=Le.sibling;var hs=se(ne,Le,lt.value,de);if(hs===null){Le===null&&(Le=it);break}t&&Le&&hs.alternate===null&&i(ne,Le),ee=w(hs,ee,Ke),ot===null?Be=hs:ot.sibling=hs,ot=hs,Le=it}if(lt.done)return s(ne,Le),st&&gr(ne,Ke),Be;if(Le===null){for(;!lt.done;Ke++,lt=ie.next())lt=fe(ne,lt.value,de),lt!==null&&(ee=w(lt,ee,Ke),ot===null?Be=lt:ot.sibling=lt,ot=lt);return st&&gr(ne,Ke),Be}for(Le=o(Le);!lt.done;Ke++,lt=ie.next())lt=le(Le,ne,Ke,lt.value,de),lt!==null&&(t&<.alternate!==null&&Le.delete(lt.key===null?Ke:lt.key),ee=w(lt,ee,Ke),ot===null?Be=lt:ot.sibling=lt,ot=lt);return t&&Le.forEach(function(Q2){return i(ne,Q2)}),st&&gr(ne,Ke),Be}function yt(ne,ee,ie,de){if(typeof ie=="object"&&ie!==null&&ie.type===T&&ie.key===null&&(ie=ie.props.children),typeof ie=="object"&&ie!==null){switch(ie.$$typeof){case E:e:{for(var Be=ie.key;ee!==null;){if(ee.key===Be){if(Be=ie.type,Be===T){if(ee.tag===7){s(ne,ee.sibling),de=_(ee,ie.props.children),de.return=ne,ne=de;break e}}else if(ee.elementType===Be||typeof Be=="object"&&Be!==null&&Be.$$typeof===k&&Bs(Be)===ee.type){s(ne,ee.sibling),de=_(ee,ie.props),Oo(de,ie),de.return=ne,ne=de;break e}s(ne,ee);break}else i(ne,ee);ee=ee.sibling}ie.type===T?(de=Ls(ie.props.children,ne.mode,de,ie.key),de.return=ne,ne=de):(de=ac(ie.type,ie.key,ie.props,null,ne.mode,de),Oo(de,ie),de.return=ne,ne=de)}return D(ne);case A:e:{for(Be=ie.key;ee!==null;){if(ee.key===Be)if(ee.tag===4&&ee.stateNode.containerInfo===ie.containerInfo&&ee.stateNode.implementation===ie.implementation){s(ne,ee.sibling),de=_(ee,ie.children||[]),de.return=ne,ne=de;break e}else{s(ne,ee);break}else i(ne,ee);ee=ee.sibling}de=Oh(ie,ne.mode,de),de.return=ne,ne=de}return D(ne);case k:return ie=Bs(ie),yt(ne,ee,ie,de)}if(te(ie))return Ae(ne,ee,ie,de);if(G(ie)){if(Be=G(ie),typeof Be!="function")throw Error(a(150));return ie=Be.call(ie),ze(ne,ee,ie,de)}if(typeof ie.then=="function")return yt(ne,ee,fc(ie),de);if(ie.$$typeof===b)return yt(ne,ee,cc(ne,ie),de);pc(ne,ie)}return typeof ie=="string"&&ie!==""||typeof ie=="number"||typeof ie=="bigint"?(ie=""+ie,ee!==null&&ee.tag===6?(s(ne,ee.sibling),de=_(ee,ie),de.return=ne,ne=de):(s(ne,ee),de=Dh(ie,ne.mode,de),de.return=ne,ne=de),D(ne)):s(ne,ee)}return function(ne,ee,ie,de){try{Do=0;var Be=yt(ne,ee,ie,de);return Ca=null,Be}catch(Le){if(Le===wa||Le===hc)throw Le;var ot=ai(29,Le,null,ne.mode);return ot.lanes=de,ot.return=ne,ot}}}var js=Jm(!0),Qm=Jm(!1),Vr=!1;function Wh(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Gh(t,i){t=t.updateQueue,i.updateQueue===t&&(i.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,callbacks:null})}function Yr(t){return{lane:t,tag:0,payload:null,callback:null,next:null}}function Xr(t,i,s){var o=t.updateQueue;if(o===null)return null;if(o=o.shared,(ht&2)!==0){var _=o.pending;return _===null?i.next=i:(i.next=_.next,_.next=i),o.pending=i,i=sc(t),Im(t,null,s),i}return rc(t,o,i,s),sc(t)}function No(t,i,s){if(i=i.updateQueue,i!==null&&(i=i.shared,(s&4194048)!==0)){var o=i.lanes;o&=t.pendingLanes,s|=o,i.lanes=s,je(t,s)}}function Kh(t,i){var s=t.updateQueue,o=t.alternate;if(o!==null&&(o=o.updateQueue,s===o)){var _=null,w=null;if(s=s.firstBaseUpdate,s!==null){do{var D={lane:s.lane,tag:s.tag,payload:s.payload,callback:null,next:null};w===null?_=w=D:w=w.next=D,s=s.next}while(s!==null);w===null?_=w=i:w=w.next=i}else _=w=i;s={baseState:o.baseState,firstBaseUpdate:_,lastBaseUpdate:w,shared:o.shared,callbacks:o.callbacks},t.updateQueue=s;return}t=s.lastBaseUpdate,t===null?s.firstBaseUpdate=i:t.next=i,s.lastBaseUpdate=i}var Vh=!1;function Bo(){if(Vh){var t=Sa;if(t!==null)throw t}}function Io(t,i,s,o){Vh=!1;var _=t.updateQueue;Vr=!1;var w=_.firstBaseUpdate,D=_.lastBaseUpdate,j=_.shared.pending;if(j!==null){_.shared.pending=null;var X=j,re=X.next;X.next=null,D===null?w=re:D.next=re,D=X;var ue=t.alternate;ue!==null&&(ue=ue.updateQueue,j=ue.lastBaseUpdate,j!==D&&(j===null?ue.firstBaseUpdate=re:j.next=re,ue.lastBaseUpdate=X))}if(w!==null){var fe=_.baseState;D=0,ue=re=X=null,j=w;do{var se=j.lane&-536870913,le=se!==j.lane;if(le?(nt&se)===se:(o&se)===se){se!==0&&se===ya&&(Vh=!0),ue!==null&&(ue=ue.next={lane:0,tag:j.tag,payload:j.payload,callback:null,next:null});e:{var Ae=t,ze=j;se=i;var yt=s;switch(ze.tag){case 1:if(Ae=ze.payload,typeof Ae=="function"){fe=Ae.call(yt,fe,se);break e}fe=Ae;break e;case 3:Ae.flags=Ae.flags&-65537|128;case 0:if(Ae=ze.payload,se=typeof Ae=="function"?Ae.call(yt,fe,se):Ae,se==null)break e;fe=g({},fe,se);break e;case 2:Vr=!0}}se=j.callback,se!==null&&(t.flags|=64,le&&(t.flags|=8192),le=_.callbacks,le===null?_.callbacks=[se]:le.push(se))}else le={lane:se,tag:j.tag,payload:j.payload,callback:j.callback,next:null},ue===null?(re=ue=le,X=fe):ue=ue.next=le,D|=se;if(j=j.next,j===null){if(j=_.shared.pending,j===null)break;le=j,j=le.next,le.next=null,_.lastBaseUpdate=le,_.shared.pending=null}}while(!0);ue===null&&(X=fe),_.baseState=X,_.firstBaseUpdate=re,_.lastBaseUpdate=ue,w===null&&(_.shared.lanes=0),ts|=D,t.lanes=D,t.memoizedState=fe}}function e_(t,i){if(typeof t!="function")throw Error(a(191,t));t.call(i)}function t_(t,i){var s=t.callbacks;if(s!==null)for(t.callbacks=null,t=0;t<s.length;t++)e_(s[t],i)}var xa=N(null),gc=N(0);function n_(t,i){t=Tr,Z(gc,t),Z(xa,i),Tr=t|i.baseLanes}function Yh(){Z(gc,Tr),Z(xa,xa.current)}function Xh(){Tr=gc.current,P(xa),P(gc)}var oi=N(null),Si=null;function Zr(t){var i=t.alternate;Z(Zt,Zt.current&1),Z(oi,t),Si===null&&(i===null||xa.current!==null||i.memoizedState!==null)&&(Si=t)}function Zh(t){Z(Zt,Zt.current),Z(oi,t),Si===null&&(Si=t)}function i_(t){t.tag===22?(Z(Zt,Zt.current),Z(oi,t),Si===null&&(Si=t)):Jr()}function Jr(){Z(Zt,Zt.current),Z(oi,oi.current)}function li(t){P(oi),Si===t&&(Si=null),P(Zt)}var Zt=N(0);function mc(t){for(var i=t;i!==null;){if(i.tag===13){var s=i.memoizedState;if(s!==null&&(s=s.dehydrated,s===null||rf(s)||sf(s)))return i}else if(i.tag===19&&(i.memoizedProps.revealOrder==="forwards"||i.memoizedProps.revealOrder==="backwards"||i.memoizedProps.revealOrder==="unstable_legacy-backwards"||i.memoizedProps.revealOrder==="together")){if((i.flags&128)!==0)return i}else if(i.child!==null){i.child.return=i,i=i.child;continue}if(i===t)break;for(;i.sibling===null;){if(i.return===null||i.return===t)return null;i=i.return}i.sibling.return=i.return,i=i.sibling}return null}var vr=0,We=null,vt=null,on=null,_c=!1,Ea=!1,zs=!1,vc=0,jo=0,Ta=null,Fx=0;function Ft(){throw Error(a(321))}function Jh(t,i){if(i===null)return!1;for(var s=0;s<i.length&&s<t.length;s++)if(!si(t[s],i[s]))return!1;return!0}function Qh(t,i,s,o,_,w){return vr=w,We=i,i.memoizedState=null,i.updateQueue=null,i.lanes=0,q.H=t===null||t.memoizedState===null?P_:pd,zs=!1,w=s(o,_),zs=!1,Ea&&(w=s_(i,s,o,_)),r_(t),w}function r_(t){q.H=Po;var i=vt!==null&&vt.next!==null;if(vr=0,on=vt=We=null,_c=!1,jo=0,Ta=null,i)throw Error(a(300));t===null||ln||(t=t.dependencies,t!==null&&lc(t)&&(ln=!0))}function s_(t,i,s,o){We=t;var _=0;do{if(Ea&&(Ta=null),jo=0,Ea=!1,25<=_)throw Error(a(301));if(_+=1,on=vt=null,t.updateQueue!=null){var w=t.updateQueue;w.lastEffect=null,w.events=null,w.stores=null,w.memoCache!=null&&(w.memoCache.index=0)}q.H=H_,w=i(s,o)}while(Ea);return w}function qx(){var t=q.H,i=t.useState()[0];return i=typeof i.then=="function"?zo(i):i,t=t.useState()[0],(vt!==null?vt.memoizedState:null)!==t&&(We.flags|=1024),i}function ed(){var t=vc!==0;return vc=0,t}function td(t,i,s){i.updateQueue=t.updateQueue,i.flags&=-2053,t.lanes&=~s}function nd(t){if(_c){for(t=t.memoizedState;t!==null;){var i=t.queue;i!==null&&(i.pending=null),t=t.next}_c=!1}vr=0,on=vt=We=null,Ea=!1,jo=vc=0,Ta=null}function Bn(){var t={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return on===null?We.memoizedState=on=t:on=on.next=t,on}function Jt(){if(vt===null){var t=We.alternate;t=t!==null?t.memoizedState:null}else t=vt.next;var i=on===null?We.memoizedState:on.next;if(i!==null)on=i,vt=t;else{if(t===null)throw We.alternate===null?Error(a(467)):Error(a(310));vt=t,t={memoizedState:vt.memoizedState,baseState:vt.baseState,baseQueue:vt.baseQueue,queue:vt.queue,next:null},on===null?We.memoizedState=on=t:on=on.next=t}return on}function bc(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function zo(t){var i=jo;return jo+=1,Ta===null&&(Ta=[]),t=Ym(Ta,t,i),i=We,(on===null?i.memoizedState:on.next)===null&&(i=i.alternate,q.H=i===null||i.memoizedState===null?P_:pd),t}function yc(t){if(t!==null&&typeof t=="object"){if(typeof t.then=="function")return zo(t);if(t.$$typeof===b)return xn(t)}throw Error(a(438,String(t)))}function id(t){var i=null,s=We.updateQueue;if(s!==null&&(i=s.memoCache),i==null){var o=We.alternate;o!==null&&(o=o.updateQueue,o!==null&&(o=o.memoCache,o!=null&&(i={data:o.data.map(function(_){return _.slice()}),index:0})))}if(i==null&&(i={data:[],index:0}),s===null&&(s=bc(),We.updateQueue=s),s.memoCache=i,s=i.data[i.index],s===void 0)for(s=i.data[i.index]=Array(t),o=0;o<t;o++)s[o]=U;return i.index++,s}function br(t,i){return typeof i=="function"?i(t):i}function Sc(t){var i=Jt();return rd(i,vt,t)}function rd(t,i,s){var o=t.queue;if(o===null)throw Error(a(311));o.lastRenderedReducer=s;var _=t.baseQueue,w=o.pending;if(w!==null){if(_!==null){var D=_.next;_.next=w.next,w.next=D}i.baseQueue=_=w,o.pending=null}if(w=t.baseState,_===null)t.memoizedState=w;else{i=_.next;var j=D=null,X=null,re=i,ue=!1;do{var fe=re.lane&-536870913;if(fe!==re.lane?(nt&fe)===fe:(vr&fe)===fe){var se=re.revertLane;if(se===0)X!==null&&(X=X.next={lane:0,revertLane:0,gesture:null,action:re.action,hasEagerState:re.hasEagerState,eagerState:re.eagerState,next:null}),fe===ya&&(ue=!0);else if((vr&se)===se){re=re.next,se===ya&&(ue=!0);continue}else fe={lane:0,revertLane:re.revertLane,gesture:null,action:re.action,hasEagerState:re.hasEagerState,eagerState:re.eagerState,next:null},X===null?(j=X=fe,D=w):X=X.next=fe,We.lanes|=se,ts|=se;fe=re.action,zs&&s(w,fe),w=re.hasEagerState?re.eagerState:s(w,fe)}else se={lane:fe,revertLane:re.revertLane,gesture:re.gesture,action:re.action,hasEagerState:re.hasEagerState,eagerState:re.eagerState,next:null},X===null?(j=X=se,D=w):X=X.next=se,We.lanes|=fe,ts|=fe;re=re.next}while(re!==null&&re!==i);if(X===null?D=w:X.next=j,!si(w,t.memoizedState)&&(ln=!0,ue&&(s=Sa,s!==null)))throw s;t.memoizedState=w,t.baseState=D,t.baseQueue=X,o.lastRenderedState=w}return _===null&&(o.lanes=0),[t.memoizedState,o.dispatch]}function sd(t){var i=Jt(),s=i.queue;if(s===null)throw Error(a(311));s.lastRenderedReducer=t;var o=s.dispatch,_=s.pending,w=i.memoizedState;if(_!==null){s.pending=null;var D=_=_.next;do w=t(w,D.action),D=D.next;while(D!==_);si(w,i.memoizedState)||(ln=!0),i.memoizedState=w,i.baseQueue===null&&(i.baseState=w),s.lastRenderedState=w}return[w,o]}function a_(t,i,s){var o=We,_=Jt(),w=st;if(w){if(s===void 0)throw Error(a(407));s=s()}else s=i();var D=!si((vt||_).memoizedState,s);if(D&&(_.memoizedState=s,ln=!0),_=_.queue,ld(c_.bind(null,o,_,t),[t]),_.getSnapshot!==i||D||on!==null&&on.memoizedState.tag&1){if(o.flags|=2048,Aa(9,{destroy:void 0},l_.bind(null,o,_,s,i),null),Ct===null)throw Error(a(349));w||(vr&127)!==0||o_(o,i,s)}return s}function o_(t,i,s){t.flags|=16384,t={getSnapshot:i,value:s},i=We.updateQueue,i===null?(i=bc(),We.updateQueue=i,i.stores=[t]):(s=i.stores,s===null?i.stores=[t]:s.push(t))}function l_(t,i,s,o){i.value=s,i.getSnapshot=o,u_(i)&&h_(t)}function c_(t,i,s){return s(function(){u_(i)&&h_(t)})}function u_(t){var i=t.getSnapshot;t=t.value;try{var s=i();return!si(t,s)}catch{return!0}}function h_(t){var i=Rs(t,2);i!==null&&Xn(i,t,2)}function ad(t){var i=Bn();if(typeof t=="function"){var s=t;if(t=s(),zs){Xt(!0);try{s()}finally{Xt(!1)}}}return i.memoizedState=i.baseState=t,i.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:br,lastRenderedState:t},i}function d_(t,i,s,o){return t.baseState=s,rd(t,vt,typeof o=="function"?o:br)}function Wx(t,i,s,o,_){if(xc(t))throw Error(a(485));if(t=i.action,t!==null){var w={payload:_,action:t,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(D){w.listeners.push(D)}};q.T!==null?s(!0):w.isTransition=!1,o(w),s=i.pending,s===null?(w.next=i.pending=w,f_(i,w)):(w.next=s.next,i.pending=s.next=w)}}function f_(t,i){var s=i.action,o=i.payload,_=t.state;if(i.isTransition){var w=q.T,D={};q.T=D;try{var j=s(_,o),X=q.S;X!==null&&X(D,j),p_(t,i,j)}catch(re){od(t,i,re)}finally{w!==null&&D.types!==null&&(w.types=D.types),q.T=w}}else try{w=s(_,o),p_(t,i,w)}catch(re){od(t,i,re)}}function p_(t,i,s){s!==null&&typeof s=="object"&&typeof s.then=="function"?s.then(function(o){g_(t,i,o)},function(o){return od(t,i,o)}):g_(t,i,s)}function g_(t,i,s){i.status="fulfilled",i.value=s,m_(i),t.state=s,i=t.pending,i!==null&&(s=i.next,s===i?t.pending=null:(s=s.next,i.next=s,f_(t,s)))}function od(t,i,s){var o=t.pending;if(t.pending=null,o!==null){o=o.next;do i.status="rejected",i.reason=s,m_(i),i=i.next;while(i!==o)}t.action=null}function m_(t){t=t.listeners;for(var i=0;i<t.length;i++)(0,t[i])()}function __(t,i){return i}function v_(t,i){if(st){var s=Ct.formState;if(s!==null){e:{var o=We;if(st){if(Rt){t:{for(var _=Rt,w=yi;_.nodeType!==8;){if(!w){_=null;break t}if(_=wi(_.nextSibling),_===null){_=null;break t}}w=_.data,_=w==="F!"||w==="F"?_:null}if(_){Rt=wi(_.nextSibling),o=_.data==="F!";break e}}Gr(o)}o=!1}o&&(i=s[0])}}return s=Bn(),s.memoizedState=s.baseState=i,o={pending:null,lanes:0,dispatch:null,lastRenderedReducer:__,lastRenderedState:i},s.queue=o,s=j_.bind(null,We,o),o.dispatch=s,o=ad(!1),w=fd.bind(null,We,!1,o.queue),o=Bn(),_={state:i,dispatch:null,action:t,pending:null},o.queue=_,s=Wx.bind(null,We,_,w,s),_.dispatch=s,o.memoizedState=t,[i,s,!1]}function b_(t){var i=Jt();return y_(i,vt,t)}function y_(t,i,s){if(i=rd(t,i,__)[0],t=Sc(br)[0],typeof i=="object"&&i!==null&&typeof i.then=="function")try{var o=zo(i)}catch(D){throw D===wa?hc:D}else o=i;i=Jt();var _=i.queue,w=_.dispatch;return s!==i.memoizedState&&(We.flags|=2048,Aa(9,{destroy:void 0},Gx.bind(null,_,s),null)),[o,w,t]}function Gx(t,i){t.action=i}function S_(t){var i=Jt(),s=vt;if(s!==null)return y_(i,s,t);Jt(),i=i.memoizedState,s=Jt();var o=s.queue.dispatch;return s.memoizedState=t,[i,o,!1]}function Aa(t,i,s,o){return t={tag:t,create:s,deps:o,inst:i,next:null},i=We.updateQueue,i===null&&(i=bc(),We.updateQueue=i),s=i.lastEffect,s===null?i.lastEffect=t.next=t:(o=s.next,s.next=t,t.next=o,i.lastEffect=t),t}function w_(){return Jt().memoizedState}function wc(t,i,s,o){var _=Bn();We.flags|=t,_.memoizedState=Aa(1|i,{destroy:void 0},s,o===void 0?null:o)}function Cc(t,i,s,o){var _=Jt();o=o===void 0?null:o;var w=_.memoizedState.inst;vt!==null&&o!==null&&Jh(o,vt.memoizedState.deps)?_.memoizedState=Aa(i,w,s,o):(We.flags|=t,_.memoizedState=Aa(1|i,w,s,o))}function C_(t,i){wc(8390656,8,t,i)}function ld(t,i){Cc(2048,8,t,i)}function Kx(t){We.flags|=4;var i=We.updateQueue;if(i===null)i=bc(),We.updateQueue=i,i.events=[t];else{var s=i.events;s===null?i.events=[t]:s.push(t)}}function x_(t){var i=Jt().memoizedState;return Kx({ref:i,nextImpl:t}),function(){if((ht&2)!==0)throw Error(a(440));return i.impl.apply(void 0,arguments)}}function E_(t,i){return Cc(4,2,t,i)}function T_(t,i){return Cc(4,4,t,i)}function A_(t,i){if(typeof i=="function"){t=t();var s=i(t);return function(){typeof s=="function"?s():i(null)}}if(i!=null)return t=t(),i.current=t,function(){i.current=null}}function k_(t,i,s){s=s!=null?s.concat([t]):null,Cc(4,4,A_.bind(null,i,t),s)}function cd(){}function R_(t,i){var s=Jt();i=i===void 0?null:i;var o=s.memoizedState;return i!==null&&Jh(i,o[1])?o[0]:(s.memoizedState=[t,i],t)}function L_(t,i){var s=Jt();i=i===void 0?null:i;var o=s.memoizedState;if(i!==null&&Jh(i,o[1]))return o[0];if(o=t(),zs){Xt(!0);try{t()}finally{Xt(!1)}}return s.memoizedState=[o,i],o}function ud(t,i,s){return s===void 0||(vr&1073741824)!==0&&(nt&261930)===0?t.memoizedState=i:(t.memoizedState=s,t=Mv(),We.lanes|=t,ts|=t,s)}function M_(t,i,s,o){return si(s,i)?s:xa.current!==null?(t=ud(t,s,o),si(t,i)||(ln=!0),t):(vr&42)===0||(vr&1073741824)!==0&&(nt&261930)===0?(ln=!0,t.memoizedState=s):(t=Mv(),We.lanes|=t,ts|=t,i)}function D_(t,i,s,o,_){var w=W.p;W.p=w!==0&&8>w?w:8;var D=q.T,j={};q.T=j,fd(t,!1,i,s);try{var X=_(),re=q.S;if(re!==null&&re(j,X),X!==null&&typeof X=="object"&&typeof X.then=="function"){var ue=Ux(X,o);$o(t,i,ue,hi(t))}else $o(t,i,o,hi(t))}catch(fe){$o(t,i,{then:function(){},status:"rejected",reason:fe},hi())}finally{W.p=w,D!==null&&j.types!==null&&(D.types=j.types),q.T=D}}function Vx(){}function hd(t,i,s,o){if(t.tag!==5)throw Error(a(476));var _=O_(t).queue;D_(t,_,i,Y,s===null?Vx:function(){return N_(t),s(o)})}function O_(t){var i=t.memoizedState;if(i!==null)return i;i={memoizedState:Y,baseState:Y,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:br,lastRenderedState:Y},next:null};var s={};return i.next={memoizedState:s,baseState:s,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:br,lastRenderedState:s},next:null},t.memoizedState=i,t=t.alternate,t!==null&&(t.memoizedState=i),i}function N_(t){var i=O_(t);i.next===null&&(i=t.alternate.memoizedState),$o(t,i.next.queue,{},hi())}function dd(){return xn(nl)}function B_(){return Jt().memoizedState}function I_(){return Jt().memoizedState}function Yx(t){for(var i=t.return;i!==null;){switch(i.tag){case 24:case 3:var s=hi();t=Yr(s);var o=Xr(i,t,s);o!==null&&(Xn(o,i,s),No(o,i,s)),i={cache:Hh()},t.payload=i;return}i=i.return}}function Xx(t,i,s){var o=hi();s={lane:o,revertLane:0,gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null},xc(t)?z_(i,s):(s=Lh(t,i,s,o),s!==null&&(Xn(s,t,o),$_(s,i,o)))}function j_(t,i,s){var o=hi();$o(t,i,s,o)}function $o(t,i,s,o){var _={lane:o,revertLane:0,gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null};if(xc(t))z_(i,_);else{var w=t.alternate;if(t.lanes===0&&(w===null||w.lanes===0)&&(w=i.lastRenderedReducer,w!==null))try{var D=i.lastRenderedState,j=w(D,s);if(_.hasEagerState=!0,_.eagerState=j,si(j,D))return rc(t,i,_,0),Ct===null&&ic(),!1}catch{}if(s=Lh(t,i,_,o),s!==null)return Xn(s,t,o),$_(s,i,o),!0}return!1}function fd(t,i,s,o){if(o={lane:2,revertLane:Wd(),gesture:null,action:o,hasEagerState:!1,eagerState:null,next:null},xc(t)){if(i)throw Error(a(479))}else i=Lh(t,s,o,2),i!==null&&Xn(i,t,2)}function xc(t){var i=t.alternate;return t===We||i!==null&&i===We}function z_(t,i){Ea=_c=!0;var s=t.pending;s===null?i.next=i:(i.next=s.next,s.next=i),t.pending=i}function $_(t,i,s){if((s&4194048)!==0){var o=i.lanes;o&=t.pendingLanes,s|=o,i.lanes=s,je(t,s)}}var Po={readContext:xn,use:yc,useCallback:Ft,useContext:Ft,useEffect:Ft,useImperativeHandle:Ft,useLayoutEffect:Ft,useInsertionEffect:Ft,useMemo:Ft,useReducer:Ft,useRef:Ft,useState:Ft,useDebugValue:Ft,useDeferredValue:Ft,useTransition:Ft,useSyncExternalStore:Ft,useId:Ft,useHostTransitionStatus:Ft,useFormState:Ft,useActionState:Ft,useOptimistic:Ft,useMemoCache:Ft,useCacheRefresh:Ft};Po.useEffectEvent=Ft;var P_={readContext:xn,use:yc,useCallback:function(t,i){return Bn().memoizedState=[t,i===void 0?null:i],t},useContext:xn,useEffect:C_,useImperativeHandle:function(t,i,s){s=s!=null?s.concat([t]):null,wc(4194308,4,A_.bind(null,i,t),s)},useLayoutEffect:function(t,i){return wc(4194308,4,t,i)},useInsertionEffect:function(t,i){wc(4,2,t,i)},useMemo:function(t,i){var s=Bn();i=i===void 0?null:i;var o=t();if(zs){Xt(!0);try{t()}finally{Xt(!1)}}return s.memoizedState=[o,i],o},useReducer:function(t,i,s){var o=Bn();if(s!==void 0){var _=s(i);if(zs){Xt(!0);try{s(i)}finally{Xt(!1)}}}else _=i;return o.memoizedState=o.baseState=_,t={pending:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:_},o.queue=t,t=t.dispatch=Xx.bind(null,We,t),[o.memoizedState,t]},useRef:function(t){var i=Bn();return t={current:t},i.memoizedState=t},useState:function(t){t=ad(t);var i=t.queue,s=j_.bind(null,We,i);return i.dispatch=s,[t.memoizedState,s]},useDebugValue:cd,useDeferredValue:function(t,i){var s=Bn();return ud(s,t,i)},useTransition:function(){var t=ad(!1);return t=D_.bind(null,We,t.queue,!0,!1),Bn().memoizedState=t,[!1,t]},useSyncExternalStore:function(t,i,s){var o=We,_=Bn();if(st){if(s===void 0)throw Error(a(407));s=s()}else{if(s=i(),Ct===null)throw Error(a(349));(nt&127)!==0||o_(o,i,s)}_.memoizedState=s;var w={value:s,getSnapshot:i};return _.queue=w,C_(c_.bind(null,o,w,t),[t]),o.flags|=2048,Aa(9,{destroy:void 0},l_.bind(null,o,w,s,i),null),s},useId:function(){var t=Bn(),i=Ct.identifierPrefix;if(st){var s=Yi,o=Vi;s=(o&~(1<<32-Pt(o)-1)).toString(32)+s,i="_"+i+"R_"+s,s=vc++,0<s&&(i+="H"+s.toString(32)),i+="_"}else s=Fx++,i="_"+i+"r_"+s.toString(32)+"_";return t.memoizedState=i},useHostTransitionStatus:dd,useFormState:v_,useActionState:v_,useOptimistic:function(t){var i=Bn();i.memoizedState=i.baseState=t;var s={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return i.queue=s,i=fd.bind(null,We,!0,s),s.dispatch=i,[t,i]},useMemoCache:id,useCacheRefresh:function(){return Bn().memoizedState=Yx.bind(null,We)},useEffectEvent:function(t){var i=Bn(),s={impl:t};return i.memoizedState=s,function(){if((ht&2)!==0)throw Error(a(440));return s.impl.apply(void 0,arguments)}}},pd={readContext:xn,use:yc,useCallback:R_,useContext:xn,useEffect:ld,useImperativeHandle:k_,useInsertionEffect:E_,useLayoutEffect:T_,useMemo:L_,useReducer:Sc,useRef:w_,useState:function(){return Sc(br)},useDebugValue:cd,useDeferredValue:function(t,i){var s=Jt();return M_(s,vt.memoizedState,t,i)},useTransition:function(){var t=Sc(br)[0],i=Jt().memoizedState;return[typeof t=="boolean"?t:zo(t),i]},useSyncExternalStore:a_,useId:B_,useHostTransitionStatus:dd,useFormState:b_,useActionState:b_,useOptimistic:function(t,i){var s=Jt();return d_(s,vt,t,i)},useMemoCache:id,useCacheRefresh:I_};pd.useEffectEvent=x_;var H_={readContext:xn,use:yc,useCallback:R_,useContext:xn,useEffect:ld,useImperativeHandle:k_,useInsertionEffect:E_,useLayoutEffect:T_,useMemo:L_,useReducer:sd,useRef:w_,useState:function(){return sd(br)},useDebugValue:cd,useDeferredValue:function(t,i){var s=Jt();return vt===null?ud(s,t,i):M_(s,vt.memoizedState,t,i)},useTransition:function(){var t=sd(br)[0],i=Jt().memoizedState;return[typeof t=="boolean"?t:zo(t),i]},useSyncExternalStore:a_,useId:B_,useHostTransitionStatus:dd,useFormState:S_,useActionState:S_,useOptimistic:function(t,i){var s=Jt();return vt!==null?d_(s,vt,t,i):(s.baseState=t,[t,s.queue.dispatch])},useMemoCache:id,useCacheRefresh:I_};H_.useEffectEvent=x_;function gd(t,i,s,o){i=t.memoizedState,s=s(o,i),s=s==null?i:g({},i,s),t.memoizedState=s,t.lanes===0&&(t.updateQueue.baseState=s)}var md={enqueueSetState:function(t,i,s){t=t._reactInternals;var o=hi(),_=Yr(o);_.payload=i,s!=null&&(_.callback=s),i=Xr(t,_,o),i!==null&&(Xn(i,t,o),No(i,t,o))},enqueueReplaceState:function(t,i,s){t=t._reactInternals;var o=hi(),_=Yr(o);_.tag=1,_.payload=i,s!=null&&(_.callback=s),i=Xr(t,_,o),i!==null&&(Xn(i,t,o),No(i,t,o))},enqueueForceUpdate:function(t,i){t=t._reactInternals;var s=hi(),o=Yr(s);o.tag=2,i!=null&&(o.callback=i),i=Xr(t,o,s),i!==null&&(Xn(i,t,s),No(i,t,s))}};function U_(t,i,s,o,_,w,D){return t=t.stateNode,typeof t.shouldComponentUpdate=="function"?t.shouldComponentUpdate(o,w,D):i.prototype&&i.prototype.isPureReactComponent?!To(s,o)||!To(_,w):!0}function F_(t,i,s,o){t=i.state,typeof i.componentWillReceiveProps=="function"&&i.componentWillReceiveProps(s,o),typeof i.UNSAFE_componentWillReceiveProps=="function"&&i.UNSAFE_componentWillReceiveProps(s,o),i.state!==t&&md.enqueueReplaceState(i,i.state,null)}function $s(t,i){var s=i;if("ref"in i){s={};for(var o in i)o!=="ref"&&(s[o]=i[o])}if(t=t.defaultProps){s===i&&(s=g({},s));for(var _ in t)s[_]===void 0&&(s[_]=t[_])}return s}function q_(t){nc(t)}function W_(t){console.error(t)}function G_(t){nc(t)}function Ec(t,i){try{var s=t.onUncaughtError;s(i.value,{componentStack:i.stack})}catch(o){setTimeout(function(){throw o})}}function K_(t,i,s){try{var o=t.onCaughtError;o(s.value,{componentStack:s.stack,errorBoundary:i.tag===1?i.stateNode:null})}catch(_){setTimeout(function(){throw _})}}function _d(t,i,s){return s=Yr(s),s.tag=3,s.payload={element:null},s.callback=function(){Ec(t,i)},s}function V_(t){return t=Yr(t),t.tag=3,t}function Y_(t,i,s,o){var _=s.type.getDerivedStateFromError;if(typeof _=="function"){var w=o.value;t.payload=function(){return _(w)},t.callback=function(){K_(i,s,o)}}var D=s.stateNode;D!==null&&typeof D.componentDidCatch=="function"&&(t.callback=function(){K_(i,s,o),typeof _!="function"&&(ns===null?ns=new Set([this]):ns.add(this));var j=o.stack;this.componentDidCatch(o.value,{componentStack:j!==null?j:""})})}function Zx(t,i,s,o,_){if(s.flags|=32768,o!==null&&typeof o=="object"&&typeof o.then=="function"){if(i=s.alternate,i!==null&&ba(i,s,_,!0),s=oi.current,s!==null){switch(s.tag){case 31:case 13:return Si===null?jc():s.alternate===null&&qt===0&&(qt=3),s.flags&=-257,s.flags|=65536,s.lanes=_,o===dc?s.flags|=16384:(i=s.updateQueue,i===null?s.updateQueue=new Set([o]):i.add(o),Ud(t,o,_)),!1;case 22:return s.flags|=65536,o===dc?s.flags|=16384:(i=s.updateQueue,i===null?(i={transitions:null,markerInstances:null,retryQueue:new Set([o])},s.updateQueue=i):(s=i.retryQueue,s===null?i.retryQueue=new Set([o]):s.add(o)),Ud(t,o,_)),!1}throw Error(a(435,s.tag))}return Ud(t,o,_),jc(),!1}if(st)return i=oi.current,i!==null?((i.flags&65536)===0&&(i.flags|=256),i.flags|=65536,i.lanes=_,o!==Ih&&(t=Error(a(422),{cause:o}),Ro(_i(t,s)))):(o!==Ih&&(i=Error(a(423),{cause:o}),Ro(_i(i,s))),t=t.current.alternate,t.flags|=65536,_&=-_,t.lanes|=_,o=_i(o,s),_=_d(t.stateNode,o,_),Kh(t,_),qt!==4&&(qt=2)),!1;var w=Error(a(520),{cause:o});if(w=_i(w,s),Vo===null?Vo=[w]:Vo.push(w),qt!==4&&(qt=2),i===null)return!0;o=_i(o,s),s=i;do{switch(s.tag){case 3:return s.flags|=65536,t=_&-_,s.lanes|=t,t=_d(s.stateNode,o,t),Kh(s,t),!1;case 1:if(i=s.type,w=s.stateNode,(s.flags&128)===0&&(typeof i.getDerivedStateFromError=="function"||w!==null&&typeof w.componentDidCatch=="function"&&(ns===null||!ns.has(w))))return s.flags|=65536,_&=-_,s.lanes|=_,_=V_(_),Y_(_,t,s,o),Kh(s,_),!1}s=s.return}while(s!==null);return!1}var vd=Error(a(461)),ln=!1;function En(t,i,s,o){i.child=t===null?Qm(i,null,s,o):js(i,t.child,s,o)}function X_(t,i,s,o,_){s=s.render;var w=i.ref;if("ref"in o){var D={};for(var j in o)j!=="ref"&&(D[j]=o[j])}else D=o;return Os(i),o=Qh(t,i,s,D,w,_),j=ed(),t!==null&&!ln?(td(t,i,_),yr(t,i,_)):(st&&j&&Nh(i),i.flags|=1,En(t,i,o,_),i.child)}function Z_(t,i,s,o,_){if(t===null){var w=s.type;return typeof w=="function"&&!Mh(w)&&w.defaultProps===void 0&&s.compare===null?(i.tag=15,i.type=w,J_(t,i,w,o,_)):(t=ac(s.type,null,o,i,i.mode,_),t.ref=i.ref,t.return=i,i.child=t)}if(w=t.child,!Td(t,_)){var D=w.memoizedProps;if(s=s.compare,s=s!==null?s:To,s(D,o)&&t.ref===i.ref)return yr(t,i,_)}return i.flags|=1,t=pr(w,o),t.ref=i.ref,t.return=i,i.child=t}function J_(t,i,s,o,_){if(t!==null){var w=t.memoizedProps;if(To(w,o)&&t.ref===i.ref)if(ln=!1,i.pendingProps=o=w,Td(t,_))(t.flags&131072)!==0&&(ln=!0);else return i.lanes=t.lanes,yr(t,i,_)}return bd(t,i,s,o,_)}function Q_(t,i,s,o){var _=o.children,w=t!==null?t.memoizedState:null;if(t===null&&i.stateNode===null&&(i.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),o.mode==="hidden"){if((i.flags&128)!==0){if(w=w!==null?w.baseLanes|s:s,t!==null){for(o=i.child=t.child,_=0;o!==null;)_=_|o.lanes|o.childLanes,o=o.sibling;o=_&~w}else o=0,i.child=null;return ev(t,i,w,s,o)}if((s&536870912)!==0)i.memoizedState={baseLanes:0,cachePool:null},t!==null&&uc(i,w!==null?w.cachePool:null),w!==null?n_(i,w):Yh(),i_(i);else return o=i.lanes=536870912,ev(t,i,w!==null?w.baseLanes|s:s,s,o)}else w!==null?(uc(i,w.cachePool),n_(i,w),Jr(),i.memoizedState=null):(t!==null&&uc(i,null),Yh(),Jr());return En(t,i,_,s),i.child}function Ho(t,i){return t!==null&&t.tag===22||i.stateNode!==null||(i.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),i.sibling}function ev(t,i,s,o,_){var w=Fh();return w=w===null?null:{parent:an._currentValue,pool:w},i.memoizedState={baseLanes:s,cachePool:w},t!==null&&uc(i,null),Yh(),i_(i),t!==null&&ba(t,i,o,!0),i.childLanes=_,null}function Tc(t,i){return i=kc({mode:i.mode,children:i.children},t.mode),i.ref=t.ref,t.child=i,i.return=t,i}function tv(t,i,s){return js(i,t.child,null,s),t=Tc(i,i.pendingProps),t.flags|=2,li(i),i.memoizedState=null,t}function Jx(t,i,s){var o=i.pendingProps,_=(i.flags&128)!==0;if(i.flags&=-129,t===null){if(st){if(o.mode==="hidden")return t=Tc(i,o),i.lanes=536870912,Ho(null,t);if(Zh(i),(t=Rt)?(t=f0(t,yi),t=t!==null&&t.data==="&"?t:null,t!==null&&(i.memoizedState={dehydrated:t,treeContext:qr!==null?{id:Vi,overflow:Yi}:null,retryLane:536870912,hydrationErrors:null},s=zm(t),s.return=i,i.child=s,Cn=i,Rt=null)):t=null,t===null)throw Gr(i);return i.lanes=536870912,null}return Tc(i,o)}var w=t.memoizedState;if(w!==null){var D=w.dehydrated;if(Zh(i),_)if(i.flags&256)i.flags&=-257,i=tv(t,i,s);else if(i.memoizedState!==null)i.child=t.child,i.flags|=128,i=null;else throw Error(a(558));else if(ln||ba(t,i,s,!1),_=(s&t.childLanes)!==0,ln||_){if(o=Ct,o!==null&&(D=It(o,s),D!==0&&D!==w.retryLane))throw w.retryLane=D,Rs(t,D),Xn(o,t,D),vd;jc(),i=tv(t,i,s)}else t=w.treeContext,Rt=wi(D.nextSibling),Cn=i,st=!0,Wr=null,yi=!1,t!==null&&Hm(i,t),i=Tc(i,o),i.flags|=4096;return i}return t=pr(t.child,{mode:o.mode,children:o.children}),t.ref=i.ref,i.child=t,t.return=i,t}function Ac(t,i){var s=i.ref;if(s===null)t!==null&&t.ref!==null&&(i.flags|=4194816);else{if(typeof s!="function"&&typeof s!="object")throw Error(a(284));(t===null||t.ref!==s)&&(i.flags|=4194816)}}function bd(t,i,s,o,_){return Os(i),s=Qh(t,i,s,o,void 0,_),o=ed(),t!==null&&!ln?(td(t,i,_),yr(t,i,_)):(st&&o&&Nh(i),i.flags|=1,En(t,i,s,_),i.child)}function nv(t,i,s,o,_,w){return Os(i),i.updateQueue=null,s=s_(i,o,s,_),r_(t),o=ed(),t!==null&&!ln?(td(t,i,w),yr(t,i,w)):(st&&o&&Nh(i),i.flags|=1,En(t,i,s,w),i.child)}function iv(t,i,s,o,_){if(Os(i),i.stateNode===null){var w=ga,D=s.contextType;typeof D=="object"&&D!==null&&(w=xn(D)),w=new s(o,w),i.memoizedState=w.state!==null&&w.state!==void 0?w.state:null,w.updater=md,i.stateNode=w,w._reactInternals=i,w=i.stateNode,w.props=o,w.state=i.memoizedState,w.refs={},Wh(i),D=s.contextType,w.context=typeof D=="object"&&D!==null?xn(D):ga,w.state=i.memoizedState,D=s.getDerivedStateFromProps,typeof D=="function"&&(gd(i,s,D,o),w.state=i.memoizedState),typeof s.getDerivedStateFromProps=="function"||typeof w.getSnapshotBeforeUpdate=="function"||typeof w.UNSAFE_componentWillMount!="function"&&typeof w.componentWillMount!="function"||(D=w.state,typeof w.componentWillMount=="function"&&w.componentWillMount(),typeof w.UNSAFE_componentWillMount=="function"&&w.UNSAFE_componentWillMount(),D!==w.state&&md.enqueueReplaceState(w,w.state,null),Io(i,o,w,_),Bo(),w.state=i.memoizedState),typeof w.componentDidMount=="function"&&(i.flags|=4194308),o=!0}else if(t===null){w=i.stateNode;var j=i.memoizedProps,X=$s(s,j);w.props=X;var re=w.context,ue=s.contextType;D=ga,typeof ue=="object"&&ue!==null&&(D=xn(ue));var fe=s.getDerivedStateFromProps;ue=typeof fe=="function"||typeof w.getSnapshotBeforeUpdate=="function",j=i.pendingProps!==j,ue||typeof w.UNSAFE_componentWillReceiveProps!="function"&&typeof w.componentWillReceiveProps!="function"||(j||re!==D)&&F_(i,w,o,D),Vr=!1;var se=i.memoizedState;w.state=se,Io(i,o,w,_),Bo(),re=i.memoizedState,j||se!==re||Vr?(typeof fe=="function"&&(gd(i,s,fe,o),re=i.memoizedState),(X=Vr||U_(i,s,X,o,se,re,D))?(ue||typeof w.UNSAFE_componentWillMount!="function"&&typeof w.componentWillMount!="function"||(typeof w.componentWillMount=="function"&&w.componentWillMount(),typeof w.UNSAFE_componentWillMount=="function"&&w.UNSAFE_componentWillMount()),typeof w.componentDidMount=="function"&&(i.flags|=4194308)):(typeof w.componentDidMount=="function"&&(i.flags|=4194308),i.memoizedProps=o,i.memoizedState=re),w.props=o,w.state=re,w.context=D,o=X):(typeof w.componentDidMount=="function"&&(i.flags|=4194308),o=!1)}else{w=i.stateNode,Gh(t,i),D=i.memoizedProps,ue=$s(s,D),w.props=ue,fe=i.pendingProps,se=w.context,re=s.contextType,X=ga,typeof re=="object"&&re!==null&&(X=xn(re)),j=s.getDerivedStateFromProps,(re=typeof j=="function"||typeof w.getSnapshotBeforeUpdate=="function")||typeof w.UNSAFE_componentWillReceiveProps!="function"&&typeof w.componentWillReceiveProps!="function"||(D!==fe||se!==X)&&F_(i,w,o,X),Vr=!1,se=i.memoizedState,w.state=se,Io(i,o,w,_),Bo();var le=i.memoizedState;D!==fe||se!==le||Vr||t!==null&&t.dependencies!==null&&lc(t.dependencies)?(typeof j=="function"&&(gd(i,s,j,o),le=i.memoizedState),(ue=Vr||U_(i,s,ue,o,se,le,X)||t!==null&&t.dependencies!==null&&lc(t.dependencies))?(re||typeof w.UNSAFE_componentWillUpdate!="function"&&typeof w.componentWillUpdate!="function"||(typeof w.componentWillUpdate=="function"&&w.componentWillUpdate(o,le,X),typeof w.UNSAFE_componentWillUpdate=="function"&&w.UNSAFE_componentWillUpdate(o,le,X)),typeof w.componentDidUpdate=="function"&&(i.flags|=4),typeof w.getSnapshotBeforeUpdate=="function"&&(i.flags|=1024)):(typeof w.componentDidUpdate!="function"||D===t.memoizedProps&&se===t.memoizedState||(i.flags|=4),typeof w.getSnapshotBeforeUpdate!="function"||D===t.memoizedProps&&se===t.memoizedState||(i.flags|=1024),i.memoizedProps=o,i.memoizedState=le),w.props=o,w.state=le,w.context=X,o=ue):(typeof w.componentDidUpdate!="function"||D===t.memoizedProps&&se===t.memoizedState||(i.flags|=4),typeof w.getSnapshotBeforeUpdate!="function"||D===t.memoizedProps&&se===t.memoizedState||(i.flags|=1024),o=!1)}return w=o,Ac(t,i),o=(i.flags&128)!==0,w||o?(w=i.stateNode,s=o&&typeof s.getDerivedStateFromError!="function"?null:w.render(),i.flags|=1,t!==null&&o?(i.child=js(i,t.child,null,_),i.child=js(i,null,s,_)):En(t,i,s,_),i.memoizedState=w.state,t=i.child):t=yr(t,i,_),t}function rv(t,i,s,o){return Ms(),i.flags|=256,En(t,i,s,o),i.child}var yd={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Sd(t){return{baseLanes:t,cachePool:Km()}}function wd(t,i,s){return t=t!==null?t.childLanes&~s:0,i&&(t|=ui),t}function sv(t,i,s){var o=i.pendingProps,_=!1,w=(i.flags&128)!==0,D;if((D=w)||(D=t!==null&&t.memoizedState===null?!1:(Zt.current&2)!==0),D&&(_=!0,i.flags&=-129),D=(i.flags&32)!==0,i.flags&=-33,t===null){if(st){if(_?Zr(i):Jr(),(t=Rt)?(t=f0(t,yi),t=t!==null&&t.data!=="&"?t:null,t!==null&&(i.memoizedState={dehydrated:t,treeContext:qr!==null?{id:Vi,overflow:Yi}:null,retryLane:536870912,hydrationErrors:null},s=zm(t),s.return=i,i.child=s,Cn=i,Rt=null)):t=null,t===null)throw Gr(i);return sf(t)?i.lanes=32:i.lanes=536870912,null}var j=o.children;return o=o.fallback,_?(Jr(),_=i.mode,j=kc({mode:"hidden",children:j},_),o=Ls(o,_,s,null),j.return=i,o.return=i,j.sibling=o,i.child=j,o=i.child,o.memoizedState=Sd(s),o.childLanes=wd(t,D,s),i.memoizedState=yd,Ho(null,o)):(Zr(i),Cd(i,j))}var X=t.memoizedState;if(X!==null&&(j=X.dehydrated,j!==null)){if(w)i.flags&256?(Zr(i),i.flags&=-257,i=xd(t,i,s)):i.memoizedState!==null?(Jr(),i.child=t.child,i.flags|=128,i=null):(Jr(),j=o.fallback,_=i.mode,o=kc({mode:"visible",children:o.children},_),j=Ls(j,_,s,null),j.flags|=2,o.return=i,j.return=i,o.sibling=j,i.child=o,js(i,t.child,null,s),o=i.child,o.memoizedState=Sd(s),o.childLanes=wd(t,D,s),i.memoizedState=yd,i=Ho(null,o));else if(Zr(i),sf(j)){if(D=j.nextSibling&&j.nextSibling.dataset,D)var re=D.dgst;D=re,o=Error(a(419)),o.stack="",o.digest=D,Ro({value:o,source:null,stack:null}),i=xd(t,i,s)}else if(ln||ba(t,i,s,!1),D=(s&t.childLanes)!==0,ln||D){if(D=Ct,D!==null&&(o=It(D,s),o!==0&&o!==X.retryLane))throw X.retryLane=o,Rs(t,o),Xn(D,t,o),vd;rf(j)||jc(),i=xd(t,i,s)}else rf(j)?(i.flags|=192,i.child=t.child,i=null):(t=X.treeContext,Rt=wi(j.nextSibling),Cn=i,st=!0,Wr=null,yi=!1,t!==null&&Hm(i,t),i=Cd(i,o.children),i.flags|=4096);return i}return _?(Jr(),j=o.fallback,_=i.mode,X=t.child,re=X.sibling,o=pr(X,{mode:"hidden",children:o.children}),o.subtreeFlags=X.subtreeFlags&65011712,re!==null?j=pr(re,j):(j=Ls(j,_,s,null),j.flags|=2),j.return=i,o.return=i,o.sibling=j,i.child=o,Ho(null,o),o=i.child,j=t.child.memoizedState,j===null?j=Sd(s):(_=j.cachePool,_!==null?(X=an._currentValue,_=_.parent!==X?{parent:X,pool:X}:_):_=Km(),j={baseLanes:j.baseLanes|s,cachePool:_}),o.memoizedState=j,o.childLanes=wd(t,D,s),i.memoizedState=yd,Ho(t.child,o)):(Zr(i),s=t.child,t=s.sibling,s=pr(s,{mode:"visible",children:o.children}),s.return=i,s.sibling=null,t!==null&&(D=i.deletions,D===null?(i.deletions=[t],i.flags|=16):D.push(t)),i.child=s,i.memoizedState=null,s)}function Cd(t,i){return i=kc({mode:"visible",children:i},t.mode),i.return=t,t.child=i}function kc(t,i){return t=ai(22,t,null,i),t.lanes=0,t}function xd(t,i,s){return js(i,t.child,null,s),t=Cd(i,i.pendingProps.children),t.flags|=2,i.memoizedState=null,t}function av(t,i,s){t.lanes|=i;var o=t.alternate;o!==null&&(o.lanes|=i),$h(t.return,i,s)}function Ed(t,i,s,o,_,w){var D=t.memoizedState;D===null?t.memoizedState={isBackwards:i,rendering:null,renderingStartTime:0,last:o,tail:s,tailMode:_,treeForkCount:w}:(D.isBackwards=i,D.rendering=null,D.renderingStartTime=0,D.last=o,D.tail=s,D.tailMode=_,D.treeForkCount=w)}function ov(t,i,s){var o=i.pendingProps,_=o.revealOrder,w=o.tail;o=o.children;var D=Zt.current,j=(D&2)!==0;if(j?(D=D&1|2,i.flags|=128):D&=1,Z(Zt,D),En(t,i,o,s),o=st?ko:0,!j&&t!==null&&(t.flags&128)!==0)e:for(t=i.child;t!==null;){if(t.tag===13)t.memoizedState!==null&&av(t,s,i);else if(t.tag===19)av(t,s,i);else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===i)break e;for(;t.sibling===null;){if(t.return===null||t.return===i)break e;t=t.return}t.sibling.return=t.return,t=t.sibling}switch(_){case"forwards":for(s=i.child,_=null;s!==null;)t=s.alternate,t!==null&&mc(t)===null&&(_=s),s=s.sibling;s=_,s===null?(_=i.child,i.child=null):(_=s.sibling,s.sibling=null),Ed(i,!1,_,s,w,o);break;case"backwards":case"unstable_legacy-backwards":for(s=null,_=i.child,i.child=null;_!==null;){if(t=_.alternate,t!==null&&mc(t)===null){i.child=_;break}t=_.sibling,_.sibling=s,s=_,_=t}Ed(i,!0,s,null,w,o);break;case"together":Ed(i,!1,null,null,void 0,o);break;default:i.memoizedState=null}return i.child}function yr(t,i,s){if(t!==null&&(i.dependencies=t.dependencies),ts|=i.lanes,(s&i.childLanes)===0)if(t!==null){if(ba(t,i,s,!1),(s&i.childLanes)===0)return null}else return null;if(t!==null&&i.child!==t.child)throw Error(a(153));if(i.child!==null){for(t=i.child,s=pr(t,t.pendingProps),i.child=s,s.return=i;t.sibling!==null;)t=t.sibling,s=s.sibling=pr(t,t.pendingProps),s.return=i;s.sibling=null}return i.child}function Td(t,i){return(t.lanes&i)!==0?!0:(t=t.dependencies,!!(t!==null&&lc(t)))}function Qx(t,i,s){switch(i.tag){case 3:$(i,i.stateNode.containerInfo),Kr(i,an,t.memoizedState.cache),Ms();break;case 27:case 5:ge(i);break;case 4:$(i,i.stateNode.containerInfo);break;case 10:Kr(i,i.type,i.memoizedProps.value);break;case 31:if(i.memoizedState!==null)return i.flags|=128,Zh(i),null;break;case 13:var o=i.memoizedState;if(o!==null)return o.dehydrated!==null?(Zr(i),i.flags|=128,null):(s&i.child.childLanes)!==0?sv(t,i,s):(Zr(i),t=yr(t,i,s),t!==null?t.sibling:null);Zr(i);break;case 19:var _=(t.flags&128)!==0;if(o=(s&i.childLanes)!==0,o||(ba(t,i,s,!1),o=(s&i.childLanes)!==0),_){if(o)return ov(t,i,s);i.flags|=128}if(_=i.memoizedState,_!==null&&(_.rendering=null,_.tail=null,_.lastEffect=null),Z(Zt,Zt.current),o)break;return null;case 22:return i.lanes=0,Q_(t,i,s,i.pendingProps);case 24:Kr(i,an,t.memoizedState.cache)}return yr(t,i,s)}function lv(t,i,s){if(t!==null)if(t.memoizedProps!==i.pendingProps)ln=!0;else{if(!Td(t,s)&&(i.flags&128)===0)return ln=!1,Qx(t,i,s);ln=(t.flags&131072)!==0}else ln=!1,st&&(i.flags&1048576)!==0&&Pm(i,ko,i.index);switch(i.lanes=0,i.tag){case 16:e:{var o=i.pendingProps;if(t=Bs(i.elementType),i.type=t,typeof t=="function")Mh(t)?(o=$s(t,o),i.tag=1,i=iv(null,i,t,o,s)):(i.tag=0,i=bd(null,i,t,o,s));else{if(t!=null){var _=t.$$typeof;if(_===x){i.tag=11,i=X_(null,i,t,o,s);break e}else if(_===M){i.tag=14,i=Z_(null,i,t,o,s);break e}}throw i=K(t)||t,Error(a(306,i,""))}}return i;case 0:return bd(t,i,i.type,i.pendingProps,s);case 1:return o=i.type,_=$s(o,i.pendingProps),iv(t,i,o,_,s);case 3:e:{if($(i,i.stateNode.containerInfo),t===null)throw Error(a(387));o=i.pendingProps;var w=i.memoizedState;_=w.element,Gh(t,i),Io(i,o,null,s);var D=i.memoizedState;if(o=D.cache,Kr(i,an,o),o!==w.cache&&Ph(i,[an],s,!0),Bo(),o=D.element,w.isDehydrated)if(w={element:o,isDehydrated:!1,cache:D.cache},i.updateQueue.baseState=w,i.memoizedState=w,i.flags&256){i=rv(t,i,o,s);break e}else if(o!==_){_=_i(Error(a(424)),i),Ro(_),i=rv(t,i,o,s);break e}else for(t=i.stateNode.containerInfo,t.nodeType===9?t=t.body:t=t.nodeName==="HTML"?t.ownerDocument.body:t,Rt=wi(t.firstChild),Cn=i,st=!0,Wr=null,yi=!0,s=Qm(i,null,o,s),i.child=s;s;)s.flags=s.flags&-3|4096,s=s.sibling;else{if(Ms(),o===_){i=yr(t,i,s);break e}En(t,i,o,s)}i=i.child}return i;case 26:return Ac(t,i),t===null?(s=b0(i.type,null,i.pendingProps,null))?i.memoizedState=s:st||(s=i.type,t=i.pendingProps,o=qc(_e.current).createElement(s),o[At]=i,o[Et]=t,Tn(o,s,t),Ze(o),i.stateNode=o):i.memoizedState=b0(i.type,t.memoizedProps,i.pendingProps,t.memoizedState),null;case 27:return ge(i),t===null&&st&&(o=i.stateNode=m0(i.type,i.pendingProps,_e.current),Cn=i,yi=!0,_=Rt,as(i.type)?(af=_,Rt=wi(o.firstChild)):Rt=_),En(t,i,i.pendingProps.children,s),Ac(t,i),t===null&&(i.flags|=4194304),i.child;case 5:return t===null&&st&&((_=o=Rt)&&(o=R2(o,i.type,i.pendingProps,yi),o!==null?(i.stateNode=o,Cn=i,Rt=wi(o.firstChild),yi=!1,_=!0):_=!1),_||Gr(i)),ge(i),_=i.type,w=i.pendingProps,D=t!==null?t.memoizedProps:null,o=w.children,ef(_,w)?o=null:D!==null&&ef(_,D)&&(i.flags|=32),i.memoizedState!==null&&(_=Qh(t,i,qx,null,null,s),nl._currentValue=_),Ac(t,i),En(t,i,o,s),i.child;case 6:return t===null&&st&&((t=s=Rt)&&(s=L2(s,i.pendingProps,yi),s!==null?(i.stateNode=s,Cn=i,Rt=null,t=!0):t=!1),t||Gr(i)),null;case 13:return sv(t,i,s);case 4:return $(i,i.stateNode.containerInfo),o=i.pendingProps,t===null?i.child=js(i,null,o,s):En(t,i,o,s),i.child;case 11:return X_(t,i,i.type,i.pendingProps,s);case 7:return En(t,i,i.pendingProps,s),i.child;case 8:return En(t,i,i.pendingProps.children,s),i.child;case 12:return En(t,i,i.pendingProps.children,s),i.child;case 10:return o=i.pendingProps,Kr(i,i.type,o.value),En(t,i,o.children,s),i.child;case 9:return _=i.type._context,o=i.pendingProps.children,Os(i),_=xn(_),o=o(_),i.flags|=1,En(t,i,o,s),i.child;case 14:return Z_(t,i,i.type,i.pendingProps,s);case 15:return J_(t,i,i.type,i.pendingProps,s);case 19:return ov(t,i,s);case 31:return Jx(t,i,s);case 22:return Q_(t,i,s,i.pendingProps);case 24:return Os(i),o=xn(an),t===null?(_=Fh(),_===null&&(_=Ct,w=Hh(),_.pooledCache=w,w.refCount++,w!==null&&(_.pooledCacheLanes|=s),_=w),i.memoizedState={parent:o,cache:_},Wh(i),Kr(i,an,_)):((t.lanes&s)!==0&&(Gh(t,i),Io(i,null,null,s),Bo()),_=t.memoizedState,w=i.memoizedState,_.parent!==o?(_={parent:o,cache:o},i.memoizedState=_,i.lanes===0&&(i.memoizedState=i.updateQueue.baseState=_),Kr(i,an,o)):(o=w.cache,Kr(i,an,o),o!==_.cache&&Ph(i,[an],s,!0))),En(t,i,i.pendingProps.children,s),i.child;case 29:throw i.pendingProps}throw Error(a(156,i.tag))}function Sr(t){t.flags|=4}function Ad(t,i,s,o,_){if((i=(t.mode&32)!==0)&&(i=!1),i){if(t.flags|=16777216,(_&335544128)===_)if(t.stateNode.complete)t.flags|=8192;else if(Bv())t.flags|=8192;else throw Is=dc,qh}else t.flags&=-16777217}function cv(t,i){if(i.type!=="stylesheet"||(i.state.loading&4)!==0)t.flags&=-16777217;else if(t.flags|=16777216,!x0(i))if(Bv())t.flags|=8192;else throw Is=dc,qh}function Rc(t,i){i!==null&&(t.flags|=4),t.flags&16384&&(i=t.tag!==22?Ie():536870912,t.lanes|=i,Ma|=i)}function Uo(t,i){if(!st)switch(t.tailMode){case"hidden":i=t.tail;for(var s=null;i!==null;)i.alternate!==null&&(s=i),i=i.sibling;s===null?t.tail=null:s.sibling=null;break;case"collapsed":s=t.tail;for(var o=null;s!==null;)s.alternate!==null&&(o=s),s=s.sibling;o===null?i||t.tail===null?t.tail=null:t.tail.sibling=null:o.sibling=null}}function Lt(t){var i=t.alternate!==null&&t.alternate.child===t.child,s=0,o=0;if(i)for(var _=t.child;_!==null;)s|=_.lanes|_.childLanes,o|=_.subtreeFlags&65011712,o|=_.flags&65011712,_.return=t,_=_.sibling;else for(_=t.child;_!==null;)s|=_.lanes|_.childLanes,o|=_.subtreeFlags,o|=_.flags,_.return=t,_=_.sibling;return t.subtreeFlags|=o,t.childLanes=s,i}function e2(t,i,s){var o=i.pendingProps;switch(Bh(i),i.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Lt(i),null;case 1:return Lt(i),null;case 3:return s=i.stateNode,o=null,t!==null&&(o=t.memoizedState.cache),i.memoizedState.cache!==o&&(i.flags|=2048),_r(an),oe(),s.pendingContext&&(s.context=s.pendingContext,s.pendingContext=null),(t===null||t.child===null)&&(va(i)?Sr(i):t===null||t.memoizedState.isDehydrated&&(i.flags&256)===0||(i.flags|=1024,jh())),Lt(i),null;case 26:var _=i.type,w=i.memoizedState;return t===null?(Sr(i),w!==null?(Lt(i),cv(i,w)):(Lt(i),Ad(i,_,null,o,s))):w?w!==t.memoizedState?(Sr(i),Lt(i),cv(i,w)):(Lt(i),i.flags&=-16777217):(t=t.memoizedProps,t!==o&&Sr(i),Lt(i),Ad(i,_,t,o,s)),null;case 27:if(Se(i),s=_e.current,_=i.type,t!==null&&i.stateNode!=null)t.memoizedProps!==o&&Sr(i);else{if(!o){if(i.stateNode===null)throw Error(a(166));return Lt(i),null}t=ae.current,va(i)?Um(i):(t=m0(_,o,s),i.stateNode=t,Sr(i))}return Lt(i),null;case 5:if(Se(i),_=i.type,t!==null&&i.stateNode!=null)t.memoizedProps!==o&&Sr(i);else{if(!o){if(i.stateNode===null)throw Error(a(166));return Lt(i),null}if(w=ae.current,va(i))Um(i);else{var D=qc(_e.current);switch(w){case 1:w=D.createElementNS("http://www.w3.org/2000/svg",_);break;case 2:w=D.createElementNS("http://www.w3.org/1998/Math/MathML",_);break;default:switch(_){case"svg":w=D.createElementNS("http://www.w3.org/2000/svg",_);break;case"math":w=D.createElementNS("http://www.w3.org/1998/Math/MathML",_);break;case"script":w=D.createElement("div"),w.innerHTML="<script><\/script>",w=w.removeChild(w.firstChild);break;case"select":w=typeof o.is=="string"?D.createElement("select",{is:o.is}):D.createElement("select"),o.multiple?w.multiple=!0:o.size&&(w.size=o.size);break;default:w=typeof o.is=="string"?D.createElement(_,{is:o.is}):D.createElement(_)}}w[At]=i,w[Et]=o;e:for(D=i.child;D!==null;){if(D.tag===5||D.tag===6)w.appendChild(D.stateNode);else if(D.tag!==4&&D.tag!==27&&D.child!==null){D.child.return=D,D=D.child;continue}if(D===i)break e;for(;D.sibling===null;){if(D.return===null||D.return===i)break e;D=D.return}D.sibling.return=D.return,D=D.sibling}i.stateNode=w;e:switch(Tn(w,_,o),_){case"button":case"input":case"select":case"textarea":o=!!o.autoFocus;break e;case"img":o=!0;break e;default:o=!1}o&&Sr(i)}}return Lt(i),Ad(i,i.type,t===null?null:t.memoizedProps,i.pendingProps,s),null;case 6:if(t&&i.stateNode!=null)t.memoizedProps!==o&&Sr(i);else{if(typeof o!="string"&&i.stateNode===null)throw Error(a(166));if(t=_e.current,va(i)){if(t=i.stateNode,s=i.memoizedProps,o=null,_=Cn,_!==null)switch(_.tag){case 27:case 5:o=_.memoizedProps}t[At]=i,t=!!(t.nodeValue===s||o!==null&&o.suppressHydrationWarning===!0||s0(t.nodeValue,s)),t||Gr(i,!0)}else t=qc(t).createTextNode(o),t[At]=i,i.stateNode=t}return Lt(i),null;case 31:if(s=i.memoizedState,t===null||t.memoizedState!==null){if(o=va(i),s!==null){if(t===null){if(!o)throw Error(a(318));if(t=i.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(a(557));t[At]=i}else Ms(),(i.flags&128)===0&&(i.memoizedState=null),i.flags|=4;Lt(i),t=!1}else s=jh(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=s),t=!0;if(!t)return i.flags&256?(li(i),i):(li(i),null);if((i.flags&128)!==0)throw Error(a(558))}return Lt(i),null;case 13:if(o=i.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(_=va(i),o!==null&&o.dehydrated!==null){if(t===null){if(!_)throw Error(a(318));if(_=i.memoizedState,_=_!==null?_.dehydrated:null,!_)throw Error(a(317));_[At]=i}else Ms(),(i.flags&128)===0&&(i.memoizedState=null),i.flags|=4;Lt(i),_=!1}else _=jh(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=_),_=!0;if(!_)return i.flags&256?(li(i),i):(li(i),null)}return li(i),(i.flags&128)!==0?(i.lanes=s,i):(s=o!==null,t=t!==null&&t.memoizedState!==null,s&&(o=i.child,_=null,o.alternate!==null&&o.alternate.memoizedState!==null&&o.alternate.memoizedState.cachePool!==null&&(_=o.alternate.memoizedState.cachePool.pool),w=null,o.memoizedState!==null&&o.memoizedState.cachePool!==null&&(w=o.memoizedState.cachePool.pool),w!==_&&(o.flags|=2048)),s!==t&&s&&(i.child.flags|=8192),Rc(i,i.updateQueue),Lt(i),null);case 4:return oe(),t===null&&Yd(i.stateNode.containerInfo),Lt(i),null;case 10:return _r(i.type),Lt(i),null;case 19:if(P(Zt),o=i.memoizedState,o===null)return Lt(i),null;if(_=(i.flags&128)!==0,w=o.rendering,w===null)if(_)Uo(o,!1);else{if(qt!==0||t!==null&&(t.flags&128)!==0)for(t=i.child;t!==null;){if(w=mc(t),w!==null){for(i.flags|=128,Uo(o,!1),t=w.updateQueue,i.updateQueue=t,Rc(i,t),i.subtreeFlags=0,t=s,s=i.child;s!==null;)jm(s,t),s=s.sibling;return Z(Zt,Zt.current&1|2),st&&gr(i,o.treeForkCount),i.child}t=t.sibling}o.tail!==null&&ut()>Nc&&(i.flags|=128,_=!0,Uo(o,!1),i.lanes=4194304)}else{if(!_)if(t=mc(w),t!==null){if(i.flags|=128,_=!0,t=t.updateQueue,i.updateQueue=t,Rc(i,t),Uo(o,!0),o.tail===null&&o.tailMode==="hidden"&&!w.alternate&&!st)return Lt(i),null}else 2*ut()-o.renderingStartTime>Nc&&s!==536870912&&(i.flags|=128,_=!0,Uo(o,!1),i.lanes=4194304);o.isBackwards?(w.sibling=i.child,i.child=w):(t=o.last,t!==null?t.sibling=w:i.child=w,o.last=w)}return o.tail!==null?(t=o.tail,o.rendering=t,o.tail=t.sibling,o.renderingStartTime=ut(),t.sibling=null,s=Zt.current,Z(Zt,_?s&1|2:s&1),st&&gr(i,o.treeForkCount),t):(Lt(i),null);case 22:case 23:return li(i),Xh(),o=i.memoizedState!==null,t!==null?t.memoizedState!==null!==o&&(i.flags|=8192):o&&(i.flags|=8192),o?(s&536870912)!==0&&(i.flags&128)===0&&(Lt(i),i.subtreeFlags&6&&(i.flags|=8192)):Lt(i),s=i.updateQueue,s!==null&&Rc(i,s.retryQueue),s=null,t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(s=t.memoizedState.cachePool.pool),o=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(o=i.memoizedState.cachePool.pool),o!==s&&(i.flags|=2048),t!==null&&P(Ns),null;case 24:return s=null,t!==null&&(s=t.memoizedState.cache),i.memoizedState.cache!==s&&(i.flags|=2048),_r(an),Lt(i),null;case 25:return null;case 30:return null}throw Error(a(156,i.tag))}function t2(t,i){switch(Bh(i),i.tag){case 1:return t=i.flags,t&65536?(i.flags=t&-65537|128,i):null;case 3:return _r(an),oe(),t=i.flags,(t&65536)!==0&&(t&128)===0?(i.flags=t&-65537|128,i):null;case 26:case 27:case 5:return Se(i),null;case 31:if(i.memoizedState!==null){if(li(i),i.alternate===null)throw Error(a(340));Ms()}return t=i.flags,t&65536?(i.flags=t&-65537|128,i):null;case 13:if(li(i),t=i.memoizedState,t!==null&&t.dehydrated!==null){if(i.alternate===null)throw Error(a(340));Ms()}return t=i.flags,t&65536?(i.flags=t&-65537|128,i):null;case 19:return P(Zt),null;case 4:return oe(),null;case 10:return _r(i.type),null;case 22:case 23:return li(i),Xh(),t!==null&&P(Ns),t=i.flags,t&65536?(i.flags=t&-65537|128,i):null;case 24:return _r(an),null;case 25:return null;default:return null}}function uv(t,i){switch(Bh(i),i.tag){case 3:_r(an),oe();break;case 26:case 27:case 5:Se(i);break;case 4:oe();break;case 31:i.memoizedState!==null&&li(i);break;case 13:li(i);break;case 19:P(Zt);break;case 10:_r(i.type);break;case 22:case 23:li(i),Xh(),t!==null&&P(Ns);break;case 24:_r(an)}}function Fo(t,i){try{var s=i.updateQueue,o=s!==null?s.lastEffect:null;if(o!==null){var _=o.next;s=_;do{if((s.tag&t)===t){o=void 0;var w=s.create,D=s.inst;o=w(),D.destroy=o}s=s.next}while(s!==_)}}catch(j){mt(i,i.return,j)}}function Qr(t,i,s){try{var o=i.updateQueue,_=o!==null?o.lastEffect:null;if(_!==null){var w=_.next;o=w;do{if((o.tag&t)===t){var D=o.inst,j=D.destroy;if(j!==void 0){D.destroy=void 0,_=i;var X=s,re=j;try{re()}catch(ue){mt(_,X,ue)}}}o=o.next}while(o!==w)}}catch(ue){mt(i,i.return,ue)}}function hv(t){var i=t.updateQueue;if(i!==null){var s=t.stateNode;try{t_(i,s)}catch(o){mt(t,t.return,o)}}}function dv(t,i,s){s.props=$s(t.type,t.memoizedProps),s.state=t.memoizedState;try{s.componentWillUnmount()}catch(o){mt(t,i,o)}}function qo(t,i){try{var s=t.ref;if(s!==null){switch(t.tag){case 26:case 27:case 5:var o=t.stateNode;break;case 30:o=t.stateNode;break;default:o=t.stateNode}typeof s=="function"?t.refCleanup=s(o):s.current=o}}catch(_){mt(t,i,_)}}function Xi(t,i){var s=t.ref,o=t.refCleanup;if(s!==null)if(typeof o=="function")try{o()}catch(_){mt(t,i,_)}finally{t.refCleanup=null,t=t.alternate,t!=null&&(t.refCleanup=null)}else if(typeof s=="function")try{s(null)}catch(_){mt(t,i,_)}else s.current=null}function fv(t){var i=t.type,s=t.memoizedProps,o=t.stateNode;try{e:switch(i){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(_){mt(t,t.return,_)}}function kd(t,i,s){try{var o=t.stateNode;C2(o,t.type,s,i),o[Et]=i}catch(_){mt(t,t.return,_)}}function pv(t){return t.tag===5||t.tag===3||t.tag===26||t.tag===27&&as(t.type)||t.tag===4}function Rd(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||pv(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;t.tag!==5&&t.tag!==6&&t.tag!==18;){if(t.tag===27&&as(t.type)||t.flags&2||t.child===null||t.tag===4)continue e;t.child.return=t,t=t.child}if(!(t.flags&2))return t.stateNode}}function Ld(t,i,s){var o=t.tag;if(o===5||o===6)t=t.stateNode,i?(s.nodeType===9?s.body:s.nodeName==="HTML"?s.ownerDocument.body:s).insertBefore(t,i):(i=s.nodeType===9?s.body:s.nodeName==="HTML"?s.ownerDocument.body:s,i.appendChild(t),s=s._reactRootContainer,s!=null||i.onclick!==null||(i.onclick=we));else if(o!==4&&(o===27&&as(t.type)&&(s=t.stateNode,i=null),t=t.child,t!==null))for(Ld(t,i,s),t=t.sibling;t!==null;)Ld(t,i,s),t=t.sibling}function Lc(t,i,s){var o=t.tag;if(o===5||o===6)t=t.stateNode,i?s.insertBefore(t,i):s.appendChild(t);else if(o!==4&&(o===27&&as(t.type)&&(s=t.stateNode),t=t.child,t!==null))for(Lc(t,i,s),t=t.sibling;t!==null;)Lc(t,i,s),t=t.sibling}function gv(t){var i=t.stateNode,s=t.memoizedProps;try{for(var o=t.type,_=i.attributes;_.length;)i.removeAttributeNode(_[0]);Tn(i,o,s),i[At]=t,i[Et]=s}catch(w){mt(t,t.return,w)}}var wr=!1,cn=!1,Md=!1,mv=typeof WeakSet=="function"?WeakSet:Set,pn=null;function n2(t,i){if(t=t.containerInfo,Jd=Zc,t=km(t),xh(t)){if("selectionStart"in t)var s={start:t.selectionStart,end:t.selectionEnd};else e:{s=(s=t.ownerDocument)&&s.defaultView||window;var o=s.getSelection&&s.getSelection();if(o&&o.rangeCount!==0){s=o.anchorNode;var _=o.anchorOffset,w=o.focusNode;o=o.focusOffset;try{s.nodeType,w.nodeType}catch{s=null;break e}var D=0,j=-1,X=-1,re=0,ue=0,fe=t,se=null;t:for(;;){for(var le;fe!==s||_!==0&&fe.nodeType!==3||(j=D+_),fe!==w||o!==0&&fe.nodeType!==3||(X=D+o),fe.nodeType===3&&(D+=fe.nodeValue.length),(le=fe.firstChild)!==null;)se=fe,fe=le;for(;;){if(fe===t)break t;if(se===s&&++re===_&&(j=D),se===w&&++ue===o&&(X=D),(le=fe.nextSibling)!==null)break;fe=se,se=fe.parentNode}fe=le}s=j===-1||X===-1?null:{start:j,end:X}}else s=null}s=s||{start:0,end:0}}else s=null;for(Qd={focusedElem:t,selectionRange:s},Zc=!1,pn=i;pn!==null;)if(i=pn,t=i.child,(i.subtreeFlags&1028)!==0&&t!==null)t.return=i,pn=t;else for(;pn!==null;){switch(i=pn,w=i.alternate,t=i.flags,i.tag){case 0:if((t&4)!==0&&(t=i.updateQueue,t=t!==null?t.events:null,t!==null))for(s=0;s<t.length;s++)_=t[s],_.ref.impl=_.nextImpl;break;case 11:case 15:break;case 1:if((t&1024)!==0&&w!==null){t=void 0,s=i,_=w.memoizedProps,w=w.memoizedState,o=s.stateNode;try{var Ae=$s(s.type,_);t=o.getSnapshotBeforeUpdate(Ae,w),o.__reactInternalSnapshotBeforeUpdate=t}catch(ze){mt(s,s.return,ze)}}break;case 3:if((t&1024)!==0){if(t=i.stateNode.containerInfo,s=t.nodeType,s===9)nf(t);else if(s===1)switch(t.nodeName){case"HEAD":case"HTML":case"BODY":nf(t);break;default:t.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((t&1024)!==0)throw Error(a(163))}if(t=i.sibling,t!==null){t.return=i.return,pn=t;break}pn=i.return}}function _v(t,i,s){var o=s.flags;switch(s.tag){case 0:case 11:case 15:xr(t,s),o&4&&Fo(5,s);break;case 1:if(xr(t,s),o&4)if(t=s.stateNode,i===null)try{t.componentDidMount()}catch(D){mt(s,s.return,D)}else{var _=$s(s.type,i.memoizedProps);i=i.memoizedState;try{t.componentDidUpdate(_,i,t.__reactInternalSnapshotBeforeUpdate)}catch(D){mt(s,s.return,D)}}o&64&&hv(s),o&512&&qo(s,s.return);break;case 3:if(xr(t,s),o&64&&(t=s.updateQueue,t!==null)){if(i=null,s.child!==null)switch(s.child.tag){case 27:case 5:i=s.child.stateNode;break;case 1:i=s.child.stateNode}try{t_(t,i)}catch(D){mt(s,s.return,D)}}break;case 27:i===null&&o&4&&gv(s);case 26:case 5:xr(t,s),i===null&&o&4&&fv(s),o&512&&qo(s,s.return);break;case 12:xr(t,s);break;case 31:xr(t,s),o&4&&yv(t,s);break;case 13:xr(t,s),o&4&&Sv(t,s),o&64&&(t=s.memoizedState,t!==null&&(t=t.dehydrated,t!==null&&(s=h2.bind(null,s),M2(t,s))));break;case 22:if(o=s.memoizedState!==null||wr,!o){i=i!==null&&i.memoizedState!==null||cn,_=wr;var w=cn;wr=o,(cn=i)&&!w?Er(t,s,(s.subtreeFlags&8772)!==0):xr(t,s),wr=_,cn=w}break;case 30:break;default:xr(t,s)}}function vv(t){var i=t.alternate;i!==null&&(t.alternate=null,vv(i)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(i=t.stateNode,i!==null&&De(i)),t.stateNode=null,t.return=null,t.dependencies=null,t.memoizedProps=null,t.memoizedState=null,t.pendingProps=null,t.stateNode=null,t.updateQueue=null}var Nt=null,Gn=!1;function Cr(t,i,s){for(s=s.child;s!==null;)bv(t,i,s),s=s.sibling}function bv(t,i,s){if(Yt&&typeof Yt.onCommitFiberUnmount=="function")try{Yt.onCommitFiberUnmount(Hn,s)}catch{}switch(s.tag){case 26:cn||Xi(s,i),Cr(t,i,s),s.memoizedState?s.memoizedState.count--:s.stateNode&&(s=s.stateNode,s.parentNode.removeChild(s));break;case 27:cn||Xi(s,i);var o=Nt,_=Gn;as(s.type)&&(Nt=s.stateNode,Gn=!1),Cr(t,i,s),Qo(s.stateNode),Nt=o,Gn=_;break;case 5:cn||Xi(s,i);case 6:if(o=Nt,_=Gn,Nt=null,Cr(t,i,s),Nt=o,Gn=_,Nt!==null)if(Gn)try{(Nt.nodeType===9?Nt.body:Nt.nodeName==="HTML"?Nt.ownerDocument.body:Nt).removeChild(s.stateNode)}catch(w){mt(s,i,w)}else try{Nt.removeChild(s.stateNode)}catch(w){mt(s,i,w)}break;case 18:Nt!==null&&(Gn?(t=Nt,h0(t.nodeType===9?t.body:t.nodeName==="HTML"?t.ownerDocument.body:t,s.stateNode),$a(t)):h0(Nt,s.stateNode));break;case 4:o=Nt,_=Gn,Nt=s.stateNode.containerInfo,Gn=!0,Cr(t,i,s),Nt=o,Gn=_;break;case 0:case 11:case 14:case 15:Qr(2,s,i),cn||Qr(4,s,i),Cr(t,i,s);break;case 1:cn||(Xi(s,i),o=s.stateNode,typeof o.componentWillUnmount=="function"&&dv(s,i,o)),Cr(t,i,s);break;case 21:Cr(t,i,s);break;case 22:cn=(o=cn)||s.memoizedState!==null,Cr(t,i,s),cn=o;break;default:Cr(t,i,s)}}function yv(t,i){if(i.memoizedState===null&&(t=i.alternate,t!==null&&(t=t.memoizedState,t!==null))){t=t.dehydrated;try{$a(t)}catch(s){mt(i,i.return,s)}}}function Sv(t,i){if(i.memoizedState===null&&(t=i.alternate,t!==null&&(t=t.memoizedState,t!==null&&(t=t.dehydrated,t!==null))))try{$a(t)}catch(s){mt(i,i.return,s)}}function i2(t){switch(t.tag){case 31:case 13:case 19:var i=t.stateNode;return i===null&&(i=t.stateNode=new mv),i;case 22:return t=t.stateNode,i=t._retryCache,i===null&&(i=t._retryCache=new mv),i;default:throw Error(a(435,t.tag))}}function Mc(t,i){var s=i2(t);i.forEach(function(o){if(!s.has(o)){s.add(o);var _=d2.bind(null,t,o);o.then(_,_)}})}function Kn(t,i){var s=i.deletions;if(s!==null)for(var o=0;o<s.length;o++){var _=s[o],w=t,D=i,j=D;e:for(;j!==null;){switch(j.tag){case 27:if(as(j.type)){Nt=j.stateNode,Gn=!1;break e}break;case 5:Nt=j.stateNode,Gn=!1;break e;case 3:case 4:Nt=j.stateNode.containerInfo,Gn=!0;break e}j=j.return}if(Nt===null)throw Error(a(160));bv(w,D,_),Nt=null,Gn=!1,w=_.alternate,w!==null&&(w.return=null),_.return=null}if(i.subtreeFlags&13886)for(i=i.child;i!==null;)wv(i,t),i=i.sibling}var Ii=null;function wv(t,i){var s=t.alternate,o=t.flags;switch(t.tag){case 0:case 11:case 14:case 15:Kn(i,t),Vn(t),o&4&&(Qr(3,t,t.return),Fo(3,t),Qr(5,t,t.return));break;case 1:Kn(i,t),Vn(t),o&512&&(cn||s===null||Xi(s,s.return)),o&64&&wr&&(t=t.updateQueue,t!==null&&(o=t.callbacks,o!==null&&(s=t.shared.hiddenCallbacks,t.shared.hiddenCallbacks=s===null?o:s.concat(o))));break;case 26:var _=Ii;if(Kn(i,t),Vn(t),o&512&&(cn||s===null||Xi(s,s.return)),o&4){var w=s!==null?s.memoizedState:null;if(o=t.memoizedState,s===null)if(o===null)if(t.stateNode===null){e:{o=t.type,s=t.memoizedProps,_=_.ownerDocument||_;t:switch(o){case"title":w=_.getElementsByTagName("title")[0],(!w||w[Ki]||w[At]||w.namespaceURI==="http://www.w3.org/2000/svg"||w.hasAttribute("itemprop"))&&(w=_.createElement(o),_.head.insertBefore(w,_.querySelector("head > title"))),Tn(w,o,s),w[At]=t,Ze(w),o=w;break e;case"link":var D=w0("link","href",_).get(o+(s.href||""));if(D){for(var j=0;j<D.length;j++)if(w=D[j],w.getAttribute("href")===(s.href==null||s.href===""?null:s.href)&&w.getAttribute("rel")===(s.rel==null?null:s.rel)&&w.getAttribute("title")===(s.title==null?null:s.title)&&w.getAttribute("crossorigin")===(s.crossOrigin==null?null:s.crossOrigin)){D.splice(j,1);break t}}w=_.createElement(o),Tn(w,o,s),_.head.appendChild(w);break;case"meta":if(D=w0("meta","content",_).get(o+(s.content||""))){for(j=0;j<D.length;j++)if(w=D[j],w.getAttribute("content")===(s.content==null?null:""+s.content)&&w.getAttribute("name")===(s.name==null?null:s.name)&&w.getAttribute("property")===(s.property==null?null:s.property)&&w.getAttribute("http-equiv")===(s.httpEquiv==null?null:s.httpEquiv)&&w.getAttribute("charset")===(s.charSet==null?null:s.charSet)){D.splice(j,1);break t}}w=_.createElement(o),Tn(w,o,s),_.head.appendChild(w);break;default:throw Error(a(468,o))}w[At]=t,Ze(w),o=w}t.stateNode=o}else C0(_,t.type,t.stateNode);else t.stateNode=S0(_,o,t.memoizedProps);else w!==o?(w===null?s.stateNode!==null&&(s=s.stateNode,s.parentNode.removeChild(s)):w.count--,o===null?C0(_,t.type,t.stateNode):S0(_,o,t.memoizedProps)):o===null&&t.stateNode!==null&&kd(t,t.memoizedProps,s.memoizedProps)}break;case 27:Kn(i,t),Vn(t),o&512&&(cn||s===null||Xi(s,s.return)),s!==null&&o&4&&kd(t,t.memoizedProps,s.memoizedProps);break;case 5:if(Kn(i,t),Vn(t),o&512&&(cn||s===null||Xi(s,s.return)),t.flags&32){_=t.stateNode;try{Pe(_,"")}catch(Ae){mt(t,t.return,Ae)}}o&4&&t.stateNode!=null&&(_=t.memoizedProps,kd(t,_,s!==null?s.memoizedProps:_)),o&1024&&(Md=!0);break;case 6:if(Kn(i,t),Vn(t),o&4){if(t.stateNode===null)throw Error(a(162));o=t.memoizedProps,s=t.stateNode;try{s.nodeValue=o}catch(Ae){mt(t,t.return,Ae)}}break;case 3:if(Kc=null,_=Ii,Ii=Wc(i.containerInfo),Kn(i,t),Ii=_,Vn(t),o&4&&s!==null&&s.memoizedState.isDehydrated)try{$a(i.containerInfo)}catch(Ae){mt(t,t.return,Ae)}Md&&(Md=!1,Cv(t));break;case 4:o=Ii,Ii=Wc(t.stateNode.containerInfo),Kn(i,t),Vn(t),Ii=o;break;case 12:Kn(i,t),Vn(t);break;case 31:Kn(i,t),Vn(t),o&4&&(o=t.updateQueue,o!==null&&(t.updateQueue=null,Mc(t,o)));break;case 13:Kn(i,t),Vn(t),t.child.flags&8192&&t.memoizedState!==null!=(s!==null&&s.memoizedState!==null)&&(Oc=ut()),o&4&&(o=t.updateQueue,o!==null&&(t.updateQueue=null,Mc(t,o)));break;case 22:_=t.memoizedState!==null;var X=s!==null&&s.memoizedState!==null,re=wr,ue=cn;if(wr=re||_,cn=ue||X,Kn(i,t),cn=ue,wr=re,Vn(t),o&8192)e:for(i=t.stateNode,i._visibility=_?i._visibility&-2:i._visibility|1,_&&(s===null||X||wr||cn||Ps(t)),s=null,i=t;;){if(i.tag===5||i.tag===26){if(s===null){X=s=i;try{if(w=X.stateNode,_)D=w.style,typeof D.setProperty=="function"?D.setProperty("display","none","important"):D.display="none";else{j=X.stateNode;var fe=X.memoizedProps.style,se=fe!=null&&fe.hasOwnProperty("display")?fe.display:null;j.style.display=se==null||typeof se=="boolean"?"":(""+se).trim()}}catch(Ae){mt(X,X.return,Ae)}}}else if(i.tag===6){if(s===null){X=i;try{X.stateNode.nodeValue=_?"":X.memoizedProps}catch(Ae){mt(X,X.return,Ae)}}}else if(i.tag===18){if(s===null){X=i;try{var le=X.stateNode;_?d0(le,!0):d0(X.stateNode,!1)}catch(Ae){mt(X,X.return,Ae)}}}else if((i.tag!==22&&i.tag!==23||i.memoizedState===null||i===t)&&i.child!==null){i.child.return=i,i=i.child;continue}if(i===t)break e;for(;i.sibling===null;){if(i.return===null||i.return===t)break e;s===i&&(s=null),i=i.return}s===i&&(s=null),i.sibling.return=i.return,i=i.sibling}o&4&&(o=t.updateQueue,o!==null&&(s=o.retryQueue,s!==null&&(o.retryQueue=null,Mc(t,s))));break;case 19:Kn(i,t),Vn(t),o&4&&(o=t.updateQueue,o!==null&&(t.updateQueue=null,Mc(t,o)));break;case 30:break;case 21:break;default:Kn(i,t),Vn(t)}}function Vn(t){var i=t.flags;if(i&2){try{for(var s,o=t.return;o!==null;){if(pv(o)){s=o;break}o=o.return}if(s==null)throw Error(a(160));switch(s.tag){case 27:var _=s.stateNode,w=Rd(t);Lc(t,w,_);break;case 5:var D=s.stateNode;s.flags&32&&(Pe(D,""),s.flags&=-33);var j=Rd(t);Lc(t,j,D);break;case 3:case 4:var X=s.stateNode.containerInfo,re=Rd(t);Ld(t,re,X);break;default:throw Error(a(161))}}catch(ue){mt(t,t.return,ue)}t.flags&=-3}i&4096&&(t.flags&=-4097)}function Cv(t){if(t.subtreeFlags&1024)for(t=t.child;t!==null;){var i=t;Cv(i),i.tag===5&&i.flags&1024&&i.stateNode.reset(),t=t.sibling}}function xr(t,i){if(i.subtreeFlags&8772)for(i=i.child;i!==null;)_v(t,i.alternate,i),i=i.sibling}function Ps(t){for(t=t.child;t!==null;){var i=t;switch(i.tag){case 0:case 11:case 14:case 15:Qr(4,i,i.return),Ps(i);break;case 1:Xi(i,i.return);var s=i.stateNode;typeof s.componentWillUnmount=="function"&&dv(i,i.return,s),Ps(i);break;case 27:Qo(i.stateNode);case 26:case 5:Xi(i,i.return),Ps(i);break;case 22:i.memoizedState===null&&Ps(i);break;case 30:Ps(i);break;default:Ps(i)}t=t.sibling}}function Er(t,i,s){for(s=s&&(i.subtreeFlags&8772)!==0,i=i.child;i!==null;){var o=i.alternate,_=t,w=i,D=w.flags;switch(w.tag){case 0:case 11:case 15:Er(_,w,s),Fo(4,w);break;case 1:if(Er(_,w,s),o=w,_=o.stateNode,typeof _.componentDidMount=="function")try{_.componentDidMount()}catch(re){mt(o,o.return,re)}if(o=w,_=o.updateQueue,_!==null){var j=o.stateNode;try{var X=_.shared.hiddenCallbacks;if(X!==null)for(_.shared.hiddenCallbacks=null,_=0;_<X.length;_++)e_(X[_],j)}catch(re){mt(o,o.return,re)}}s&&D&64&&hv(w),qo(w,w.return);break;case 27:gv(w);case 26:case 5:Er(_,w,s),s&&o===null&&D&4&&fv(w),qo(w,w.return);break;case 12:Er(_,w,s);break;case 31:Er(_,w,s),s&&D&4&&yv(_,w);break;case 13:Er(_,w,s),s&&D&4&&Sv(_,w);break;case 22:w.memoizedState===null&&Er(_,w,s),qo(w,w.return);break;case 30:break;default:Er(_,w,s)}i=i.sibling}}function Dd(t,i){var s=null;t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(s=t.memoizedState.cachePool.pool),t=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(t=i.memoizedState.cachePool.pool),t!==s&&(t!=null&&t.refCount++,s!=null&&Lo(s))}function Od(t,i){t=null,i.alternate!==null&&(t=i.alternate.memoizedState.cache),i=i.memoizedState.cache,i!==t&&(i.refCount++,t!=null&&Lo(t))}function ji(t,i,s,o){if(i.subtreeFlags&10256)for(i=i.child;i!==null;)xv(t,i,s,o),i=i.sibling}function xv(t,i,s,o){var _=i.flags;switch(i.tag){case 0:case 11:case 15:ji(t,i,s,o),_&2048&&Fo(9,i);break;case 1:ji(t,i,s,o);break;case 3:ji(t,i,s,o),_&2048&&(t=null,i.alternate!==null&&(t=i.alternate.memoizedState.cache),i=i.memoizedState.cache,i!==t&&(i.refCount++,t!=null&&Lo(t)));break;case 12:if(_&2048){ji(t,i,s,o),t=i.stateNode;try{var w=i.memoizedProps,D=w.id,j=w.onPostCommit;typeof j=="function"&&j(D,i.alternate===null?"mount":"update",t.passiveEffectDuration,-0)}catch(X){mt(i,i.return,X)}}else ji(t,i,s,o);break;case 31:ji(t,i,s,o);break;case 13:ji(t,i,s,o);break;case 23:break;case 22:w=i.stateNode,D=i.alternate,i.memoizedState!==null?w._visibility&2?ji(t,i,s,o):Wo(t,i):w._visibility&2?ji(t,i,s,o):(w._visibility|=2,ka(t,i,s,o,(i.subtreeFlags&10256)!==0||!1)),_&2048&&Dd(D,i);break;case 24:ji(t,i,s,o),_&2048&&Od(i.alternate,i);break;default:ji(t,i,s,o)}}function ka(t,i,s,o,_){for(_=_&&((i.subtreeFlags&10256)!==0||!1),i=i.child;i!==null;){var w=t,D=i,j=s,X=o,re=D.flags;switch(D.tag){case 0:case 11:case 15:ka(w,D,j,X,_),Fo(8,D);break;case 23:break;case 22:var ue=D.stateNode;D.memoizedState!==null?ue._visibility&2?ka(w,D,j,X,_):Wo(w,D):(ue._visibility|=2,ka(w,D,j,X,_)),_&&re&2048&&Dd(D.alternate,D);break;case 24:ka(w,D,j,X,_),_&&re&2048&&Od(D.alternate,D);break;default:ka(w,D,j,X,_)}i=i.sibling}}function Wo(t,i){if(i.subtreeFlags&10256)for(i=i.child;i!==null;){var s=t,o=i,_=o.flags;switch(o.tag){case 22:Wo(s,o),_&2048&&Dd(o.alternate,o);break;case 24:Wo(s,o),_&2048&&Od(o.alternate,o);break;default:Wo(s,o)}i=i.sibling}}var Go=8192;function Ra(t,i,s){if(t.subtreeFlags&Go)for(t=t.child;t!==null;)Ev(t,i,s),t=t.sibling}function Ev(t,i,s){switch(t.tag){case 26:Ra(t,i,s),t.flags&Go&&t.memoizedState!==null&&F2(s,Ii,t.memoizedState,t.memoizedProps);break;case 5:Ra(t,i,s);break;case 3:case 4:var o=Ii;Ii=Wc(t.stateNode.containerInfo),Ra(t,i,s),Ii=o;break;case 22:t.memoizedState===null&&(o=t.alternate,o!==null&&o.memoizedState!==null?(o=Go,Go=16777216,Ra(t,i,s),Go=o):Ra(t,i,s));break;default:Ra(t,i,s)}}function Tv(t){var i=t.alternate;if(i!==null&&(t=i.child,t!==null)){i.child=null;do i=t.sibling,t.sibling=null,t=i;while(t!==null)}}function Ko(t){var i=t.deletions;if((t.flags&16)!==0){if(i!==null)for(var s=0;s<i.length;s++){var o=i[s];pn=o,kv(o,t)}Tv(t)}if(t.subtreeFlags&10256)for(t=t.child;t!==null;)Av(t),t=t.sibling}function Av(t){switch(t.tag){case 0:case 11:case 15:Ko(t),t.flags&2048&&Qr(9,t,t.return);break;case 3:Ko(t);break;case 12:Ko(t);break;case 22:var i=t.stateNode;t.memoizedState!==null&&i._visibility&2&&(t.return===null||t.return.tag!==13)?(i._visibility&=-3,Dc(t)):Ko(t);break;default:Ko(t)}}function Dc(t){var i=t.deletions;if((t.flags&16)!==0){if(i!==null)for(var s=0;s<i.length;s++){var o=i[s];pn=o,kv(o,t)}Tv(t)}for(t=t.child;t!==null;){switch(i=t,i.tag){case 0:case 11:case 15:Qr(8,i,i.return),Dc(i);break;case 22:s=i.stateNode,s._visibility&2&&(s._visibility&=-3,Dc(i));break;default:Dc(i)}t=t.sibling}}function kv(t,i){for(;pn!==null;){var s=pn;switch(s.tag){case 0:case 11:case 15:Qr(8,s,i);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:Lo(s.memoizedState.cache)}if(o=s.child,o!==null)o.return=s,pn=o;else e:for(s=t;pn!==null;){o=pn;var _=o.sibling,w=o.return;if(vv(o),o===s){pn=null;break e}if(_!==null){_.return=w,pn=_;break e}pn=w}}}var r2={getCacheForType:function(t){var i=xn(an),s=i.data.get(t);return s===void 0&&(s=t(),i.data.set(t,s)),s},cacheSignal:function(){return xn(an).controller.signal}},s2=typeof WeakMap=="function"?WeakMap:Map,ht=0,Ct=null,Je=null,nt=0,gt=0,ci=null,es=!1,La=!1,Nd=!1,Tr=0,qt=0,ts=0,Hs=0,Bd=0,ui=0,Ma=0,Vo=null,Yn=null,Id=!1,Oc=0,Rv=0,Nc=1/0,Bc=null,ns=null,fn=0,is=null,Da=null,Ar=0,jd=0,zd=null,Lv=null,Yo=0,$d=null;function hi(){return(ht&2)!==0&&nt!==0?nt&-nt:q.T!==null?Wd():cr()}function Mv(){if(ui===0)if((nt&536870912)===0||st){var t=Gi;Gi<<=1,(Gi&3932160)===0&&(Gi=262144),ui=t}else ui=536870912;return t=oi.current,t!==null&&(t.flags|=32),ui}function Xn(t,i,s){(t===Ct&&(gt===2||gt===9)||t.cancelPendingCommit!==null)&&(Oa(t,0),rs(t,nt,ui,!1)),ft(t,s),((ht&2)===0||t!==Ct)&&(t===Ct&&((ht&2)===0&&(Hs|=s),qt===4&&rs(t,nt,ui,!1)),Zi(t))}function Dv(t,i,s){if((ht&6)!==0)throw Error(a(327));var o=!s&&(i&127)===0&&(i&t.expiredLanes)===0||he(t,i),_=o?l2(t,i):Hd(t,i,!0),w=o;do{if(_===0){La&&!o&&rs(t,i,0,!1);break}else{if(s=t.current.alternate,w&&!a2(s)){_=Hd(t,i,!1),w=!1;continue}if(_===2){if(w=i,t.errorRecoveryDisabledLanes&w)var D=0;else D=t.pendingLanes&-536870913,D=D!==0?D:D&536870912?536870912:0;if(D!==0){i=D;e:{var j=t;_=Vo;var X=j.current.memoizedState.isDehydrated;if(X&&(Oa(j,D).flags|=256),D=Hd(j,D,!1),D!==2){if(Nd&&!X){j.errorRecoveryDisabledLanes|=w,Hs|=w,_=4;break e}w=Yn,Yn=_,w!==null&&(Yn===null?Yn=w:Yn.push.apply(Yn,w))}_=D}if(w=!1,_!==2)continue}}if(_===1){Oa(t,0),rs(t,i,0,!0);break}e:{switch(o=t,w=_,w){case 0:case 1:throw Error(a(345));case 4:if((i&4194048)!==i)break;case 6:rs(o,i,ui,!es);break e;case 2:Yn=null;break;case 3:case 5:break;default:throw Error(a(329))}if((i&62914560)===i&&(_=Oc+300-ut(),10<_)){if(rs(o,i,ui,!es),J(o,0,!0)!==0)break e;Ar=i,o.timeoutHandle=c0(Ov.bind(null,o,s,Yn,Bc,Id,i,ui,Hs,Ma,es,w,"Throttled",-0,0),_);break e}Ov(o,s,Yn,Bc,Id,i,ui,Hs,Ma,es,w,null,-0,0)}}break}while(!0);Zi(t)}function Ov(t,i,s,o,_,w,D,j,X,re,ue,fe,se,le){if(t.timeoutHandle=-1,fe=i.subtreeFlags,fe&8192||(fe&16785408)===16785408){fe={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:we},Ev(i,w,fe);var Ae=(w&62914560)===w?Oc-ut():(w&4194048)===w?Rv-ut():0;if(Ae=q2(fe,Ae),Ae!==null){Ar=w,t.cancelPendingCommit=Ae(Hv.bind(null,t,i,w,s,o,_,D,j,X,ue,fe,null,se,le)),rs(t,w,D,!re);return}}Hv(t,i,w,s,o,_,D,j,X)}function a2(t){for(var i=t;;){var s=i.tag;if((s===0||s===11||s===15)&&i.flags&16384&&(s=i.updateQueue,s!==null&&(s=s.stores,s!==null)))for(var o=0;o<s.length;o++){var _=s[o],w=_.getSnapshot;_=_.value;try{if(!si(w(),_))return!1}catch{return!1}}if(s=i.child,i.subtreeFlags&16384&&s!==null)s.return=i,i=s;else{if(i===t)break;for(;i.sibling===null;){if(i.return===null||i.return===t)return!0;i=i.return}i.sibling.return=i.return,i=i.sibling}}return!0}function rs(t,i,s,o){i&=~Bd,i&=~Hs,t.suspendedLanes|=i,t.pingedLanes&=~i,o&&(t.warmLanes|=i),o=t.expirationTimes;for(var _=i;0<_;){var w=31-Pt(_),D=1<<w;o[w]=-1,_&=~D}s!==0&&Ce(t,s,i)}function Ic(){return(ht&6)===0?(Xo(0),!1):!0}function Pd(){if(Je!==null){if(gt===0)var t=Je.return;else t=Je,mr=Ds=null,nd(t),Ca=null,Do=0,t=Je;for(;t!==null;)uv(t.alternate,t),t=t.return;Je=null}}function Oa(t,i){var s=t.timeoutHandle;s!==-1&&(t.timeoutHandle=-1,T2(s)),s=t.cancelPendingCommit,s!==null&&(t.cancelPendingCommit=null,s()),Ar=0,Pd(),Ct=t,Je=s=pr(t.current,null),nt=i,gt=0,ci=null,es=!1,La=he(t,i),Nd=!1,Ma=ui=Bd=Hs=ts=qt=0,Yn=Vo=null,Id=!1,(i&8)!==0&&(i|=i&32);var o=t.entangledLanes;if(o!==0)for(t=t.entanglements,o&=i;0<o;){var _=31-Pt(o),w=1<<_;i|=t[_],o&=~w}return Tr=i,ic(),s}function Nv(t,i){We=null,q.H=Po,i===wa||i===hc?(i=Xm(),gt=3):i===qh?(i=Xm(),gt=4):gt=i===vd?8:i!==null&&typeof i=="object"&&typeof i.then=="function"?6:1,ci=i,Je===null&&(qt=1,Ec(t,_i(i,t.current)))}function Bv(){var t=oi.current;return t===null?!0:(nt&4194048)===nt?Si===null:(nt&62914560)===nt||(nt&536870912)!==0?t===Si:!1}function Iv(){var t=q.H;return q.H=Po,t===null?Po:t}function jv(){var t=q.A;return q.A=r2,t}function jc(){qt=4,es||(nt&4194048)!==nt&&oi.current!==null||(La=!0),(ts&134217727)===0&&(Hs&134217727)===0||Ct===null||rs(Ct,nt,ui,!1)}function Hd(t,i,s){var o=ht;ht|=2;var _=Iv(),w=jv();(Ct!==t||nt!==i)&&(Bc=null,Oa(t,i)),i=!1;var D=qt;e:do try{if(gt!==0&&Je!==null){var j=Je,X=ci;switch(gt){case 8:Pd(),D=6;break e;case 3:case 2:case 9:case 6:oi.current===null&&(i=!0);var re=gt;if(gt=0,ci=null,Na(t,j,X,re),s&&La){D=0;break e}break;default:re=gt,gt=0,ci=null,Na(t,j,X,re)}}o2(),D=qt;break}catch(ue){Nv(t,ue)}while(!0);return i&&t.shellSuspendCounter++,mr=Ds=null,ht=o,q.H=_,q.A=w,Je===null&&(Ct=null,nt=0,ic()),D}function o2(){for(;Je!==null;)zv(Je)}function l2(t,i){var s=ht;ht|=2;var o=Iv(),_=jv();Ct!==t||nt!==i?(Bc=null,Nc=ut()+500,Oa(t,i)):La=he(t,i);e:do try{if(gt!==0&&Je!==null){i=Je;var w=ci;t:switch(gt){case 1:gt=0,ci=null,Na(t,i,w,1);break;case 2:case 9:if(Vm(w)){gt=0,ci=null,$v(i);break}i=function(){gt!==2&>!==9||Ct!==t||(gt=7),Zi(t)},w.then(i,i);break e;case 3:gt=7;break e;case 4:gt=5;break e;case 7:Vm(w)?(gt=0,ci=null,$v(i)):(gt=0,ci=null,Na(t,i,w,7));break;case 5:var D=null;switch(Je.tag){case 26:D=Je.memoizedState;case 5:case 27:var j=Je;if(D?x0(D):j.stateNode.complete){gt=0,ci=null;var X=j.sibling;if(X!==null)Je=X;else{var re=j.return;re!==null?(Je=re,zc(re)):Je=null}break t}}gt=0,ci=null,Na(t,i,w,5);break;case 6:gt=0,ci=null,Na(t,i,w,6);break;case 8:Pd(),qt=6;break e;default:throw Error(a(462))}}c2();break}catch(ue){Nv(t,ue)}while(!0);return mr=Ds=null,q.H=o,q.A=_,ht=s,Je!==null?0:(Ct=null,nt=0,ic(),qt)}function c2(){for(;Je!==null&&!Mi();)zv(Je)}function zv(t){var i=lv(t.alternate,t,Tr);t.memoizedProps=t.pendingProps,i===null?zc(t):Je=i}function $v(t){var i=t,s=i.alternate;switch(i.tag){case 15:case 0:i=nv(s,i,i.pendingProps,i.type,void 0,nt);break;case 11:i=nv(s,i,i.pendingProps,i.type.render,i.ref,nt);break;case 5:nd(i);default:uv(s,i),i=Je=jm(i,Tr),i=lv(s,i,Tr)}t.memoizedProps=t.pendingProps,i===null?zc(t):Je=i}function Na(t,i,s,o){mr=Ds=null,nd(i),Ca=null,Do=0;var _=i.return;try{if(Zx(t,_,i,s,nt)){qt=1,Ec(t,_i(s,t.current)),Je=null;return}}catch(w){if(_!==null)throw Je=_,w;qt=1,Ec(t,_i(s,t.current)),Je=null;return}i.flags&32768?(st||o===1?t=!0:La||(nt&536870912)!==0?t=!1:(es=t=!0,(o===2||o===9||o===3||o===6)&&(o=oi.current,o!==null&&o.tag===13&&(o.flags|=16384))),Pv(i,t)):zc(i)}function zc(t){var i=t;do{if((i.flags&32768)!==0){Pv(i,es);return}t=i.return;var s=e2(i.alternate,i,Tr);if(s!==null){Je=s;return}if(i=i.sibling,i!==null){Je=i;return}Je=i=t}while(i!==null);qt===0&&(qt=5)}function Pv(t,i){do{var s=t2(t.alternate,t);if(s!==null){s.flags&=32767,Je=s;return}if(s=t.return,s!==null&&(s.flags|=32768,s.subtreeFlags=0,s.deletions=null),!i&&(t=t.sibling,t!==null)){Je=t;return}Je=t=s}while(t!==null);qt=6,Je=null}function Hv(t,i,s,o,_,w,D,j,X){t.cancelPendingCommit=null;do $c();while(fn!==0);if((ht&6)!==0)throw Error(a(327));if(i!==null){if(i===t.current)throw Error(a(177));if(w=i.lanes|i.childLanes,w|=Rh,Te(t,s,w,D,j,X),t===Ct&&(Je=Ct=null,nt=0),Da=i,is=t,Ar=s,jd=w,zd=_,Lv=o,(i.subtreeFlags&10256)!==0||(i.flags&10256)!==0?(t.callbackNode=null,t.callbackPriority=0,f2(nn,function(){return Gv(),null})):(t.callbackNode=null,t.callbackPriority=0),o=(i.flags&13878)!==0,(i.subtreeFlags&13878)!==0||o){o=q.T,q.T=null,_=W.p,W.p=2,D=ht,ht|=4;try{n2(t,i,s)}finally{ht=D,W.p=_,q.T=o}}fn=1,Uv(),Fv(),qv()}}function Uv(){if(fn===1){fn=0;var t=is,i=Da,s=(i.flags&13878)!==0;if((i.subtreeFlags&13878)!==0||s){s=q.T,q.T=null;var o=W.p;W.p=2;var _=ht;ht|=4;try{wv(i,t);var w=Qd,D=km(t.containerInfo),j=w.focusedElem,X=w.selectionRange;if(D!==j&&j&&j.ownerDocument&&Am(j.ownerDocument.documentElement,j)){if(X!==null&&xh(j)){var re=X.start,ue=X.end;if(ue===void 0&&(ue=re),"selectionStart"in j)j.selectionStart=re,j.selectionEnd=Math.min(ue,j.value.length);else{var fe=j.ownerDocument||document,se=fe&&fe.defaultView||window;if(se.getSelection){var le=se.getSelection(),Ae=j.textContent.length,ze=Math.min(X.start,Ae),yt=X.end===void 0?ze:Math.min(X.end,Ae);!le.extend&&ze>yt&&(D=yt,yt=ze,ze=D);var ne=Tm(j,ze),ee=Tm(j,yt);if(ne&&ee&&(le.rangeCount!==1||le.anchorNode!==ne.node||le.anchorOffset!==ne.offset||le.focusNode!==ee.node||le.focusOffset!==ee.offset)){var ie=fe.createRange();ie.setStart(ne.node,ne.offset),le.removeAllRanges(),ze>yt?(le.addRange(ie),le.extend(ee.node,ee.offset)):(ie.setEnd(ee.node,ee.offset),le.addRange(ie))}}}}for(fe=[],le=j;le=le.parentNode;)le.nodeType===1&&fe.push({element:le,left:le.scrollLeft,top:le.scrollTop});for(typeof j.focus=="function"&&j.focus(),j=0;j<fe.length;j++){var de=fe[j];de.element.scrollLeft=de.left,de.element.scrollTop=de.top}}Zc=!!Jd,Qd=Jd=null}finally{ht=_,W.p=o,q.T=s}}t.current=i,fn=2}}function Fv(){if(fn===2){fn=0;var t=is,i=Da,s=(i.flags&8772)!==0;if((i.subtreeFlags&8772)!==0||s){s=q.T,q.T=null;var o=W.p;W.p=2;var _=ht;ht|=4;try{_v(t,i.alternate,i)}finally{ht=_,W.p=o,q.T=s}}fn=3}}function qv(){if(fn===4||fn===3){fn=0,tn();var t=is,i=Da,s=Ar,o=Lv;(i.subtreeFlags&10256)!==0||(i.flags&10256)!==0?fn=5:(fn=0,Da=is=null,Wv(t,t.pendingLanes));var _=t.pendingLanes;if(_===0&&(ns=null),Sn(s),i=i.stateNode,Yt&&typeof Yt.onCommitFiberRoot=="function")try{Yt.onCommitFiberRoot(Hn,i,void 0,(i.current.flags&128)===128)}catch{}if(o!==null){i=q.T,_=W.p,W.p=2,q.T=null;try{for(var w=t.onRecoverableError,D=0;D<o.length;D++){var j=o[D];w(j.value,{componentStack:j.stack})}}finally{q.T=i,W.p=_}}(Ar&3)!==0&&$c(),Zi(t),_=t.pendingLanes,(s&261930)!==0&&(_&42)!==0?t===$d?Yo++:(Yo=0,$d=t):Yo=0,Xo(0)}}function Wv(t,i){(t.pooledCacheLanes&=i)===0&&(i=t.pooledCache,i!=null&&(t.pooledCache=null,Lo(i)))}function $c(){return Uv(),Fv(),qv(),Gv()}function Gv(){if(fn!==5)return!1;var t=is,i=jd;jd=0;var s=Sn(Ar),o=q.T,_=W.p;try{W.p=32>s?32:s,q.T=null,s=zd,zd=null;var w=is,D=Ar;if(fn=0,Da=is=null,Ar=0,(ht&6)!==0)throw Error(a(331));var j=ht;if(ht|=4,Av(w.current),xv(w,w.current,D,s),ht=j,Xo(0,!1),Yt&&typeof Yt.onPostCommitFiberRoot=="function")try{Yt.onPostCommitFiberRoot(Hn,w)}catch{}return!0}finally{W.p=_,q.T=o,Wv(t,i)}}function Kv(t,i,s){i=_i(s,i),i=_d(t.stateNode,i,2),t=Xr(t,i,2),t!==null&&(ft(t,2),Zi(t))}function mt(t,i,s){if(t.tag===3)Kv(t,t,s);else for(;i!==null;){if(i.tag===3){Kv(i,t,s);break}else if(i.tag===1){var o=i.stateNode;if(typeof i.type.getDerivedStateFromError=="function"||typeof o.componentDidCatch=="function"&&(ns===null||!ns.has(o))){t=_i(s,t),s=V_(2),o=Xr(i,s,2),o!==null&&(Y_(s,o,i,t),ft(o,2),Zi(o));break}}i=i.return}}function Ud(t,i,s){var o=t.pingCache;if(o===null){o=t.pingCache=new s2;var _=new Set;o.set(i,_)}else _=o.get(i),_===void 0&&(_=new Set,o.set(i,_));_.has(s)||(Nd=!0,_.add(s),t=u2.bind(null,t,i,s),i.then(t,t))}function u2(t,i,s){var o=t.pingCache;o!==null&&o.delete(i),t.pingedLanes|=t.suspendedLanes&s,t.warmLanes&=~s,Ct===t&&(nt&s)===s&&(qt===4||qt===3&&(nt&62914560)===nt&&300>ut()-Oc?(ht&2)===0&&Oa(t,0):Bd|=s,Ma===nt&&(Ma=0)),Zi(t)}function Vv(t,i){i===0&&(i=Ie()),t=Rs(t,i),t!==null&&(ft(t,i),Zi(t))}function h2(t){var i=t.memoizedState,s=0;i!==null&&(s=i.retryLane),Vv(t,s)}function d2(t,i){var s=0;switch(t.tag){case 31:case 13:var o=t.stateNode,_=t.memoizedState;_!==null&&(s=_.retryLane);break;case 19:o=t.stateNode;break;case 22:o=t.stateNode._retryCache;break;default:throw Error(a(314))}o!==null&&o.delete(i),Vv(t,s)}function f2(t,i){return yn(t,i)}var Pc=null,Ba=null,Fd=!1,Hc=!1,qd=!1,ss=0;function Zi(t){t!==Ba&&t.next===null&&(Ba===null?Pc=Ba=t:Ba=Ba.next=t),Hc=!0,Fd||(Fd=!0,g2())}function Xo(t,i){if(!qd&&Hc){qd=!0;do for(var s=!1,o=Pc;o!==null;){if(t!==0){var _=o.pendingLanes;if(_===0)var w=0;else{var D=o.suspendedLanes,j=o.pingedLanes;w=(1<<31-Pt(42|t)+1)-1,w&=_&~(D&~j),w=w&201326741?w&201326741|1:w?w|2:0}w!==0&&(s=!0,Jv(o,w))}else w=nt,w=J(o,o===Ct?w:0,o.cancelPendingCommit!==null||o.timeoutHandle!==-1),(w&3)===0||he(o,w)||(s=!0,Jv(o,w));o=o.next}while(s);qd=!1}}function p2(){Yv()}function Yv(){Hc=Fd=!1;var t=0;ss!==0&&E2()&&(t=ss);for(var i=ut(),s=null,o=Pc;o!==null;){var _=o.next,w=Xv(o,i);w===0?(o.next=null,s===null?Pc=_:s.next=_,_===null&&(Ba=s)):(s=o,(t!==0||(w&3)!==0)&&(Hc=!0)),o=_}fn!==0&&fn!==5||Xo(t),ss!==0&&(ss=0)}function Xv(t,i){for(var s=t.suspendedLanes,o=t.pingedLanes,_=t.expirationTimes,w=t.pendingLanes&-62914561;0<w;){var D=31-Pt(w),j=1<<D,X=_[D];X===-1?((j&s)===0||(j&o)!==0)&&(_[D]=ve(j,i)):X<=i&&(t.expiredLanes|=j),w&=~j}if(i=Ct,s=nt,s=J(t,t===i?s:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),o=t.callbackNode,s===0||t===i&&(gt===2||gt===9)||t.cancelPendingCommit!==null)return o!==null&&o!==null&&pi(o),t.callbackNode=null,t.callbackPriority=0;if((s&3)===0||he(t,s)){if(i=s&-s,i===t.callbackPriority)return i;switch(o!==null&&pi(o),Sn(s)){case 2:case 8:s=$t;break;case 32:s=nn;break;case 268435456:s=Ln;break;default:s=nn}return o=Zv.bind(null,t),s=yn(s,o),t.callbackPriority=i,t.callbackNode=s,i}return o!==null&&o!==null&&pi(o),t.callbackPriority=2,t.callbackNode=null,2}function Zv(t,i){if(fn!==0&&fn!==5)return t.callbackNode=null,t.callbackPriority=0,null;var s=t.callbackNode;if($c()&&t.callbackNode!==s)return null;var o=nt;return o=J(t,t===Ct?o:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),o===0?null:(Dv(t,o,i),Xv(t,ut()),t.callbackNode!=null&&t.callbackNode===s?Zv.bind(null,t):null)}function Jv(t,i){if($c())return null;Dv(t,i,!0)}function g2(){A2(function(){(ht&6)!==0?yn(zt,p2):Yv()})}function Wd(){if(ss===0){var t=ya;t===0&&(t=Oi,Oi<<=1,(Oi&261888)===0&&(Oi=256)),ss=t}return ss}function Qv(t){return t==null||typeof t=="symbol"||typeof t=="boolean"?null:typeof t=="function"?t:Ur(""+t)}function e0(t,i){var s=i.ownerDocument.createElement("input");return s.name=i.name,s.value=i.value,t.id&&s.setAttribute("form",t.id),i.parentNode.insertBefore(s,i),t=new FormData(t),s.parentNode.removeChild(s),t}function m2(t,i,s,o,_){if(i==="submit"&&s&&s.stateNode===_){var w=Qv((_[Et]||null).action),D=o.submitter;D&&(i=(i=D[Et]||null)?Qv(i.formAction):D.getAttribute("formAction"),i!==null&&(w=i,D=null));var j=new Ql("action","action",null,o,_);t.push({event:j,listeners:[{instance:null,listener:function(){if(o.defaultPrevented){if(ss!==0){var X=D?e0(_,D):new FormData(_);hd(s,{pending:!0,data:X,method:_.method,action:w},null,X)}}else typeof w=="function"&&(j.preventDefault(),X=D?e0(_,D):new FormData(_),hd(s,{pending:!0,data:X,method:_.method,action:w},w,X))},currentTarget:_}]})}}for(var Gd=0;Gd<kh.length;Gd++){var Kd=kh[Gd],_2=Kd.toLowerCase(),v2=Kd[0].toUpperCase()+Kd.slice(1);Bi(_2,"on"+v2)}Bi(Mm,"onAnimationEnd"),Bi(Dm,"onAnimationIteration"),Bi(Om,"onAnimationStart"),Bi("dblclick","onDoubleClick"),Bi("focusin","onFocus"),Bi("focusout","onBlur"),Bi(Nx,"onTransitionRun"),Bi(Bx,"onTransitionStart"),Bi(Ix,"onTransitionCancel"),Bi(Nm,"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 Zo="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(" "),b2=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Zo));function t0(t,i){i=(i&4)!==0;for(var s=0;s<t.length;s++){var o=t[s],_=o.event;o=o.listeners;e:{var w=void 0;if(i)for(var D=o.length-1;0<=D;D--){var j=o[D],X=j.instance,re=j.currentTarget;if(j=j.listener,X!==w&&_.isPropagationStopped())break e;w=j,_.currentTarget=re;try{w(_)}catch(ue){nc(ue)}_.currentTarget=null,w=X}else for(D=0;D<o.length;D++){if(j=o[D],X=j.instance,re=j.currentTarget,j=j.listener,X!==w&&_.isPropagationStopped())break e;w=j,_.currentTarget=re;try{w(_)}catch(ue){nc(ue)}_.currentTarget=null,w=X}}}}function Qe(t,i){var s=i[Pr];s===void 0&&(s=i[Pr]=new Set);var o=t+"__bubble";s.has(o)||(n0(i,t,2,!1),s.add(o))}function Vd(t,i,s){var o=0;i&&(o|=4),n0(s,t,o,i)}var Uc="_reactListening"+Math.random().toString(36).slice(2);function Yd(t){if(!t[Uc]){t[Uc]=!0,kt.forEach(function(s){s!=="selectionchange"&&(b2.has(s)||Vd(s,!1,t),Vd(s,!0,t))});var i=t.nodeType===9?t:t.ownerDocument;i===null||i[Uc]||(i[Uc]=!0,Vd("selectionchange",!1,i))}}function n0(t,i,s,o){switch(M0(i)){case 2:var _=K2;break;case 8:_=V2;break;default:_=hf}s=_.bind(null,i,s,t),_=void 0,!gh||i!=="touchstart"&&i!=="touchmove"&&i!=="wheel"||(_=!0),o?_!==void 0?t.addEventListener(i,s,{capture:!0,passive:_}):t.addEventListener(i,s,!0):_!==void 0?t.addEventListener(i,s,{passive:_}):t.addEventListener(i,s,!1)}function Xd(t,i,s,o,_){var w=o;if((i&1)===0&&(i&2)===0&&o!==null)e:for(;;){if(o===null)return;var D=o.tag;if(D===3||D===4){var j=o.stateNode.containerInfo;if(j===_)break;if(D===4)for(D=o.return;D!==null;){var X=D.tag;if((X===3||X===4)&&D.stateNode.containerInfo===_)return;D=D.return}for(;j!==null;){if(D=V(j),D===null)return;if(X=D.tag,X===5||X===6||X===26||X===27){o=w=D;continue e}j=j.parentNode}}o=o.return}Yl(function(){var re=w,ue=qe(s),fe=[];e:{var se=Bm.get(t);if(se!==void 0){var le=Ql,Ae=t;switch(t){case"keypress":if(Zl(s)===0)break e;case"keydown":case"keyup":le=dx;break;case"focusin":Ae="focus",le=bh;break;case"focusout":Ae="blur",le=bh;break;case"beforeblur":case"afterblur":le=bh;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=um;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":le=ex;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":le=gx;break;case Mm:case Dm:case Om:le=ix;break;case Nm:le=_x;break;case"scroll":case"scrollend":le=JC;break;case"wheel":le=bx;break;case"copy":case"cut":case"paste":le=sx;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":le=dm;break;case"toggle":case"beforetoggle":le=Sx}var ze=(i&4)!==0,yt=!ze&&(t==="scroll"||t==="scrollend"),ne=ze?se!==null?se+"Capture":null:se;ze=[];for(var ee=re,ie;ee!==null;){var de=ee;if(ie=de.stateNode,de=de.tag,de!==5&&de!==26&&de!==27||ie===null||ne===null||(de=bo(ee,ne),de!=null&&ze.push(Jo(ee,de,ie))),yt)break;ee=ee.return}0<ze.length&&(se=new le(se,Ae,null,s,ue),fe.push({event:se,listeners:ze}))}}if((i&7)===0){e:{if(se=t==="mouseover"||t==="pointerover",le=t==="mouseout"||t==="pointerout",se&&s!==Re&&(Ae=s.relatedTarget||s.fromElement)&&(V(Ae)||Ae[Ni]))break e;if((le||se)&&(se=ue.window===ue?ue:(se=ue.ownerDocument)?se.defaultView||se.parentWindow:window,le?(Ae=s.relatedTarget||s.toElement,le=re,Ae=Ae?V(Ae):null,Ae!==null&&(yt=f(Ae),ze=Ae.tag,Ae!==yt||ze!==5&&ze!==27&&ze!==6)&&(Ae=null)):(le=null,Ae=re),le!==Ae)){if(ze=um,de="onMouseLeave",ne="onMouseEnter",ee="mouse",(t==="pointerout"||t==="pointerover")&&(ze=dm,de="onPointerLeave",ne="onPointerEnter",ee="pointer"),yt=le==null?se:xe(le),ie=Ae==null?se:xe(Ae),se=new ze(de,ee+"leave",le,s,ue),se.target=yt,se.relatedTarget=ie,de=null,V(ue)===re&&(ze=new ze(ne,ee+"enter",Ae,s,ue),ze.target=ie,ze.relatedTarget=yt,de=ze),yt=de,le&&Ae)t:{for(ze=y2,ne=le,ee=Ae,ie=0,de=ne;de;de=ze(de))ie++;de=0;for(var Be=ee;Be;Be=ze(Be))de++;for(;0<ie-de;)ne=ze(ne),ie--;for(;0<de-ie;)ee=ze(ee),de--;for(;ie--;){if(ne===ee||ee!==null&&ne===ee.alternate){ze=ne;break t}ne=ze(ne),ee=ze(ee)}ze=null}else ze=null;le!==null&&i0(fe,se,le,ze,!1),Ae!==null&&yt!==null&&i0(fe,yt,Ae,ze,!0)}}e:{if(se=re?xe(re):window,le=se.nodeName&&se.nodeName.toLowerCase(),le==="select"||le==="input"&&se.type==="file")var ot=ym;else if(vm(se))if(Sm)ot=Mx;else{ot=Rx;var Le=kx}else le=se.nodeName,!le||le.toLowerCase()!=="input"||se.type!=="checkbox"&&se.type!=="radio"?re&&Hr(re.elementType)&&(ot=ym):ot=Lx;if(ot&&(ot=ot(t,re))){bm(fe,ot,s,ue);break e}Le&&Le(t,se,re),t==="focusout"&&re&&se.type==="number"&&re.memoizedProps.value!=null&&ca(se,"number",se.value)}switch(Le=re?xe(re):window,t){case"focusin":(vm(Le)||Le.contentEditable==="true")&&(da=Le,Eh=re,Ao=null);break;case"focusout":Ao=Eh=da=null;break;case"mousedown":Th=!0;break;case"contextmenu":case"mouseup":case"dragend":Th=!1,Rm(fe,s,ue);break;case"selectionchange":if(Ox)break;case"keydown":case"keyup":Rm(fe,s,ue)}var Ke;if(Sh)e:{switch(t){case"compositionstart":var it="onCompositionStart";break e;case"compositionend":it="onCompositionEnd";break e;case"compositionupdate":it="onCompositionUpdate";break e}it=void 0}else ha?mm(t,s)&&(it="onCompositionEnd"):t==="keydown"&&s.keyCode===229&&(it="onCompositionStart");it&&(fm&&s.locale!=="ko"&&(ha||it!=="onCompositionStart"?it==="onCompositionEnd"&&ha&&(Ke=lm()):(Fr=ue,mh="value"in Fr?Fr.value:Fr.textContent,ha=!0)),Le=Fc(re,it),0<Le.length&&(it=new hm(it,t,null,s,ue),fe.push({event:it,listeners:Le}),Ke?it.data=Ke:(Ke=_m(s),Ke!==null&&(it.data=Ke)))),(Ke=Cx?xx(t,s):Ex(t,s))&&(it=Fc(re,"onBeforeInput"),0<it.length&&(Le=new hm("onBeforeInput","beforeinput",null,s,ue),fe.push({event:Le,listeners:it}),Le.data=Ke)),m2(fe,t,re,s,ue)}t0(fe,i)})}function Jo(t,i,s){return{instance:t,listener:i,currentTarget:s}}function Fc(t,i){for(var s=i+"Capture",o=[];t!==null;){var _=t,w=_.stateNode;if(_=_.tag,_!==5&&_!==26&&_!==27||w===null||(_=bo(t,s),_!=null&&o.unshift(Jo(t,_,w)),_=bo(t,i),_!=null&&o.push(Jo(t,_,w))),t.tag===3)return o;t=t.return}return[]}function y2(t){if(t===null)return null;do t=t.return;while(t&&t.tag!==5&&t.tag!==27);return t||null}function i0(t,i,s,o,_){for(var w=i._reactName,D=[];s!==null&&s!==o;){var j=s,X=j.alternate,re=j.stateNode;if(j=j.tag,X!==null&&X===o)break;j!==5&&j!==26&&j!==27||re===null||(X=re,_?(re=bo(s,w),re!=null&&D.unshift(Jo(s,re,X))):_||(re=bo(s,w),re!=null&&D.push(Jo(s,re,X)))),s=s.return}D.length!==0&&t.push({event:i,listeners:D})}var S2=/\r\n?/g,w2=/\u0000|\uFFFD/g;function r0(t){return(typeof t=="string"?t:""+t).replace(S2,`
|
|
9
|
+
`).replace(w2,"")}function s0(t,i){return i=r0(i),r0(t)===i}function bt(t,i,s,o,_,w){switch(s){case"children":typeof o=="string"?i==="body"||i==="textarea"&&o===""||Pe(t,o):(typeof o=="number"||typeof o=="bigint")&&i!=="body"&&Pe(t,""+o);break;case"className":ii(t,"class",o);break;case"tabIndex":ii(t,"tabindex",o);break;case"dir":case"role":case"viewBox":case"width":case"height":ii(t,s,o);break;case"style":pt(t,o,w);break;case"data":if(i!=="object"){ii(t,"data",o);break}case"src":case"href":if(o===""&&(i!=="a"||s!=="href")){t.removeAttribute(s);break}if(o==null||typeof o=="function"||typeof o=="symbol"||typeof o=="boolean"){t.removeAttribute(s);break}o=Ur(""+o),t.setAttribute(s,o);break;case"action":case"formAction":if(typeof o=="function"){t.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 w=="function"&&(s==="formAction"?(i!=="input"&&bt(t,i,"name",_.name,_,null),bt(t,i,"formEncType",_.formEncType,_,null),bt(t,i,"formMethod",_.formMethod,_,null),bt(t,i,"formTarget",_.formTarget,_,null)):(bt(t,i,"encType",_.encType,_,null),bt(t,i,"method",_.method,_,null),bt(t,i,"target",_.target,_,null)));if(o==null||typeof o=="symbol"||typeof o=="boolean"){t.removeAttribute(s);break}o=Ur(""+o),t.setAttribute(s,o);break;case"onClick":o!=null&&(t.onclick=we);break;case"onScroll":o!=null&&Qe("scroll",t);break;case"onScrollEnd":o!=null&&Qe("scrollend",t);break;case"dangerouslySetInnerHTML":if(o!=null){if(typeof o!="object"||!("__html"in o))throw Error(a(61));if(s=o.__html,s!=null){if(_.children!=null)throw Error(a(60));t.innerHTML=s}}break;case"multiple":t.multiple=o&&typeof o!="function"&&typeof o!="symbol";break;case"muted":t.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"){t.removeAttribute("xlink:href");break}s=Ur(""+o),t.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"?t.setAttribute(s,""+o):t.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"?t.setAttribute(s,""):t.removeAttribute(s);break;case"capture":case"download":o===!0?t.setAttribute(s,""):o!==!1&&o!=null&&typeof o!="function"&&typeof o!="symbol"?t.setAttribute(s,o):t.removeAttribute(s);break;case"cols":case"rows":case"size":case"span":o!=null&&typeof o!="function"&&typeof o!="symbol"&&!isNaN(o)&&1<=o?t.setAttribute(s,o):t.removeAttribute(s);break;case"rowSpan":case"start":o==null||typeof o=="function"||typeof o=="symbol"||isNaN(o)?t.removeAttribute(s):t.setAttribute(s,o);break;case"popover":Qe("beforetoggle",t),Qe("toggle",t),Mn(t,"popover",o);break;case"xlinkActuate":Fn(t,"http://www.w3.org/1999/xlink","xlink:actuate",o);break;case"xlinkArcrole":Fn(t,"http://www.w3.org/1999/xlink","xlink:arcrole",o);break;case"xlinkRole":Fn(t,"http://www.w3.org/1999/xlink","xlink:role",o);break;case"xlinkShow":Fn(t,"http://www.w3.org/1999/xlink","xlink:show",o);break;case"xlinkTitle":Fn(t,"http://www.w3.org/1999/xlink","xlink:title",o);break;case"xlinkType":Fn(t,"http://www.w3.org/1999/xlink","xlink:type",o);break;case"xmlBase":Fn(t,"http://www.w3.org/XML/1998/namespace","xml:base",o);break;case"xmlLang":Fn(t,"http://www.w3.org/XML/1998/namespace","xml:lang",o);break;case"xmlSpace":Fn(t,"http://www.w3.org/XML/1998/namespace","xml:space",o);break;case"is":Mn(t,"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=dr.get(s)||s,Mn(t,s,o))}}function Zd(t,i,s,o,_,w){switch(s){case"style":pt(t,o,w);break;case"dangerouslySetInnerHTML":if(o!=null){if(typeof o!="object"||!("__html"in o))throw Error(a(61));if(s=o.__html,s!=null){if(_.children!=null)throw Error(a(60));t.innerHTML=s}}break;case"children":typeof o=="string"?Pe(t,o):(typeof o=="number"||typeof o=="bigint")&&Pe(t,""+o);break;case"onScroll":o!=null&&Qe("scroll",t);break;case"onScrollEnd":o!=null&&Qe("scrollend",t);break;case"onClick":o!=null&&(t.onclick=we);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"&&(_=s.endsWith("Capture"),i=s.slice(2,_?s.length-7:void 0),w=t[Et]||null,w=w!=null?w[s]:null,typeof w=="function"&&t.removeEventListener(i,w,_),typeof o=="function")){typeof w!="function"&&w!==null&&(s in t?t[s]=null:t.hasAttribute(s)&&t.removeAttribute(s)),t.addEventListener(i,o,_);break e}s in t?t[s]=o:o===!0?t.setAttribute(s,""):Mn(t,s,o)}}}function Tn(t,i,s){switch(i){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Qe("error",t),Qe("load",t);var o=!1,_=!1,w;for(w in s)if(s.hasOwnProperty(w)){var D=s[w];if(D!=null)switch(w){case"src":o=!0;break;case"srcSet":_=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(a(137,i));default:bt(t,i,w,D,s,null)}}_&&bt(t,i,"srcSet",s.srcSet,s,null),o&&bt(t,i,"src",s.src,s,null);return;case"input":Qe("invalid",t);var j=w=D=_=null,X=null,re=null;for(o in s)if(s.hasOwnProperty(o)){var ue=s[o];if(ue!=null)switch(o){case"name":_=ue;break;case"type":D=ue;break;case"checked":X=ue;break;case"defaultChecked":re=ue;break;case"value":w=ue;break;case"defaultValue":j=ue;break;case"children":case"dangerouslySetInnerHTML":if(ue!=null)throw Error(a(137,i));break;default:bt(t,i,o,ue,s,null)}}Es(t,w,j,X,re,D,_,!1);return;case"select":Qe("invalid",t),o=D=w=null;for(_ in s)if(s.hasOwnProperty(_)&&(j=s[_],j!=null))switch(_){case"value":w=j;break;case"defaultValue":D=j;break;case"multiple":o=j;default:bt(t,i,_,j,s,null)}i=w,s=D,t.multiple=!!o,i!=null?wn(t,!!o,i,!1):s!=null&&wn(t,!!o,s,!0);return;case"textarea":Qe("invalid",t),w=_=o=null;for(D in s)if(s.hasOwnProperty(D)&&(j=s[D],j!=null))switch(D){case"value":o=j;break;case"defaultValue":_=j;break;case"children":w=j;break;case"dangerouslySetInnerHTML":if(j!=null)throw Error(a(91));break;default:bt(t,i,D,j,s,null)}ua(t,o,_,w);return;case"option":for(X in s)s.hasOwnProperty(X)&&(o=s[X],o!=null)&&(X==="selected"?t.selected=o&&typeof o!="function"&&typeof o!="symbol":bt(t,i,X,o,s,null));return;case"dialog":Qe("beforetoggle",t),Qe("toggle",t),Qe("cancel",t),Qe("close",t);break;case"iframe":case"object":Qe("load",t);break;case"video":case"audio":for(o=0;o<Zo.length;o++)Qe(Zo[o],t);break;case"image":Qe("error",t),Qe("load",t);break;case"details":Qe("toggle",t);break;case"embed":case"source":case"link":Qe("error",t),Qe("load",t);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,i));default:bt(t,i,re,o,s,null)}return;default:if(Hr(i)){for(ue in s)s.hasOwnProperty(ue)&&(o=s[ue],o!==void 0&&Zd(t,i,ue,o,s,void 0));return}}for(j in s)s.hasOwnProperty(j)&&(o=s[j],o!=null&&bt(t,i,j,o,s,null))}function C2(t,i,s,o){switch(i){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var _=null,w=null,D=null,j=null,X=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":X=fe;default:o.hasOwnProperty(le)||bt(t,i,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":w=le;break;case"name":_=le;break;case"checked":re=le;break;case"defaultChecked":ue=le;break;case"value":D=le;break;case"defaultValue":j=le;break;case"children":case"dangerouslySetInnerHTML":if(le!=null)throw Error(a(137,i));break;default:le!==fe&&bt(t,i,se,le,o,fe)}}mo(t,D,j,X,re,ue,w,_);return;case"select":le=D=j=se=null;for(w in s)if(X=s[w],s.hasOwnProperty(w)&&X!=null)switch(w){case"value":break;case"multiple":le=X;default:o.hasOwnProperty(w)||bt(t,i,w,null,o,X)}for(_ in o)if(w=o[_],X=s[_],o.hasOwnProperty(_)&&(w!=null||X!=null))switch(_){case"value":se=w;break;case"defaultValue":j=w;break;case"multiple":D=w;default:w!==X&&bt(t,i,_,w,o,X)}i=j,s=D,o=le,se!=null?wn(t,!!s,se,!1):!!o!=!!s&&(i!=null?wn(t,!!s,i,!0):wn(t,!!s,s?[]:"",!1));return;case"textarea":le=se=null;for(j in s)if(_=s[j],s.hasOwnProperty(j)&&_!=null&&!o.hasOwnProperty(j))switch(j){case"value":break;case"children":break;default:bt(t,i,j,null,o,_)}for(D in o)if(_=o[D],w=s[D],o.hasOwnProperty(D)&&(_!=null||w!=null))switch(D){case"value":se=_;break;case"defaultValue":le=_;break;case"children":break;case"dangerouslySetInnerHTML":if(_!=null)throw Error(a(91));break;default:_!==w&&bt(t,i,D,_,o,w)}Kl(t,se,le);return;case"option":for(var Ae in s)se=s[Ae],s.hasOwnProperty(Ae)&&se!=null&&!o.hasOwnProperty(Ae)&&(Ae==="selected"?t.selected=!1:bt(t,i,Ae,null,o,se));for(X in o)se=o[X],le=s[X],o.hasOwnProperty(X)&&se!==le&&(se!=null||le!=null)&&(X==="selected"?t.selected=se&&typeof se!="function"&&typeof se!="symbol":bt(t,i,X,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)&&bt(t,i,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,i));break;default:bt(t,i,re,se,o,le)}return;default:if(Hr(i)){for(var yt in s)se=s[yt],s.hasOwnProperty(yt)&&se!==void 0&&!o.hasOwnProperty(yt)&&Zd(t,i,yt,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||Zd(t,i,ue,se,o,le);return}}for(var ne in s)se=s[ne],s.hasOwnProperty(ne)&&se!=null&&!o.hasOwnProperty(ne)&&bt(t,i,ne,null,o,se);for(fe in o)se=o[fe],le=s[fe],!o.hasOwnProperty(fe)||se===le||se==null&&le==null||bt(t,i,fe,se,o,le)}function a0(t){switch(t){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function x2(){if(typeof performance.getEntriesByType=="function"){for(var t=0,i=0,s=performance.getEntriesByType("resource"),o=0;o<s.length;o++){var _=s[o],w=_.transferSize,D=_.initiatorType,j=_.duration;if(w&&j&&a0(D)){for(D=0,j=_.responseEnd,o+=1;o<s.length;o++){var X=s[o],re=X.startTime;if(re>j)break;var ue=X.transferSize,fe=X.initiatorType;ue&&a0(fe)&&(X=X.responseEnd,D+=ue*(X<j?1:(j-re)/(X-re)))}if(--o,i+=8*(w+D)/(_.duration/1e3),t++,10<t)break}}if(0<t)return i/t/1e6}return navigator.connection&&(t=navigator.connection.downlink,typeof t=="number")?t:5}var Jd=null,Qd=null;function qc(t){return t.nodeType===9?t:t.ownerDocument}function o0(t){switch(t){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function l0(t,i){if(t===0)switch(i){case"svg":return 1;case"math":return 2;default:return 0}return t===1&&i==="foreignObject"?0:t}function ef(t,i){return t==="textarea"||t==="noscript"||typeof i.children=="string"||typeof i.children=="number"||typeof i.children=="bigint"||typeof i.dangerouslySetInnerHTML=="object"&&i.dangerouslySetInnerHTML!==null&&i.dangerouslySetInnerHTML.__html!=null}var tf=null;function E2(){var t=window.event;return t&&t.type==="popstate"?t===tf?!1:(tf=t,!0):(tf=null,!1)}var c0=typeof setTimeout=="function"?setTimeout:void 0,T2=typeof clearTimeout=="function"?clearTimeout:void 0,u0=typeof Promise=="function"?Promise:void 0,A2=typeof queueMicrotask=="function"?queueMicrotask:typeof u0<"u"?function(t){return u0.resolve(null).then(t).catch(k2)}:c0;function k2(t){setTimeout(function(){throw t})}function as(t){return t==="head"}function h0(t,i){var s=i,o=0;do{var _=s.nextSibling;if(t.removeChild(s),_&&_.nodeType===8)if(s=_.data,s==="/$"||s==="/&"){if(o===0){t.removeChild(_),$a(i);return}o--}else if(s==="$"||s==="$?"||s==="$~"||s==="$!"||s==="&")o++;else if(s==="html")Qo(t.ownerDocument.documentElement);else if(s==="head"){s=t.ownerDocument.head,Qo(s);for(var w=s.firstChild;w;){var D=w.nextSibling,j=w.nodeName;w[Ki]||j==="SCRIPT"||j==="STYLE"||j==="LINK"&&w.rel.toLowerCase()==="stylesheet"||s.removeChild(w),w=D}}else s==="body"&&Qo(t.ownerDocument.body);s=_}while(s);$a(i)}function d0(t,i){var s=t;t=0;do{var o=s.nextSibling;if(s.nodeType===1?i?(s._stashedDisplay=s.style.display,s.style.display="none"):(s.style.display=s._stashedDisplay||"",s.getAttribute("style")===""&&s.removeAttribute("style")):s.nodeType===3&&(i?(s._stashedText=s.nodeValue,s.nodeValue=""):s.nodeValue=s._stashedText||""),o&&o.nodeType===8)if(s=o.data,s==="/$"){if(t===0)break;t--}else s!=="$"&&s!=="$?"&&s!=="$~"&&s!=="$!"||t++;s=o}while(s)}function nf(t){var i=t.firstChild;for(i&&i.nodeType===10&&(i=i.nextSibling);i;){var s=i;switch(i=i.nextSibling,s.nodeName){case"HTML":case"HEAD":case"BODY":nf(s),De(s);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(s.rel.toLowerCase()==="stylesheet")continue}t.removeChild(s)}}function R2(t,i,s,o){for(;t.nodeType===1;){var _=s;if(t.nodeName.toLowerCase()!==i.toLowerCase()){if(!o&&(t.nodeName!=="INPUT"||t.type!=="hidden"))break}else if(o){if(!t[Ki])switch(i){case"meta":if(!t.hasAttribute("itemprop"))break;return t;case"link":if(w=t.getAttribute("rel"),w==="stylesheet"&&t.hasAttribute("data-precedence"))break;if(w!==_.rel||t.getAttribute("href")!==(_.href==null||_.href===""?null:_.href)||t.getAttribute("crossorigin")!==(_.crossOrigin==null?null:_.crossOrigin)||t.getAttribute("title")!==(_.title==null?null:_.title))break;return t;case"style":if(t.hasAttribute("data-precedence"))break;return t;case"script":if(w=t.getAttribute("src"),(w!==(_.src==null?null:_.src)||t.getAttribute("type")!==(_.type==null?null:_.type)||t.getAttribute("crossorigin")!==(_.crossOrigin==null?null:_.crossOrigin))&&w&&t.hasAttribute("async")&&!t.hasAttribute("itemprop"))break;return t;default:return t}}else if(i==="input"&&t.type==="hidden"){var w=_.name==null?null:""+_.name;if(_.type==="hidden"&&t.getAttribute("name")===w)return t}else return t;if(t=wi(t.nextSibling),t===null)break}return null}function L2(t,i,s){if(i==="")return null;for(;t.nodeType!==3;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!s||(t=wi(t.nextSibling),t===null))return null;return t}function f0(t,i){for(;t.nodeType!==8;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!i||(t=wi(t.nextSibling),t===null))return null;return t}function rf(t){return t.data==="$?"||t.data==="$~"}function sf(t){return t.data==="$!"||t.data==="$?"&&t.ownerDocument.readyState!=="loading"}function M2(t,i){var s=t.ownerDocument;if(t.data==="$~")t._reactRetry=i;else if(t.data!=="$?"||s.readyState!=="loading")i();else{var o=function(){i(),s.removeEventListener("DOMContentLoaded",o)};s.addEventListener("DOMContentLoaded",o),t._reactRetry=o}}function wi(t){for(;t!=null;t=t.nextSibling){var i=t.nodeType;if(i===1||i===3)break;if(i===8){if(i=t.data,i==="$"||i==="$!"||i==="$?"||i==="$~"||i==="&"||i==="F!"||i==="F")break;if(i==="/$"||i==="/&")return null}}return t}var af=null;function p0(t){t=t.nextSibling;for(var i=0;t;){if(t.nodeType===8){var s=t.data;if(s==="/$"||s==="/&"){if(i===0)return wi(t.nextSibling);i--}else s!=="$"&&s!=="$!"&&s!=="$?"&&s!=="$~"&&s!=="&"||i++}t=t.nextSibling}return null}function g0(t){t=t.previousSibling;for(var i=0;t;){if(t.nodeType===8){var s=t.data;if(s==="$"||s==="$!"||s==="$?"||s==="$~"||s==="&"){if(i===0)return t;i--}else s!=="/$"&&s!=="/&"||i++}t=t.previousSibling}return null}function m0(t,i,s){switch(i=qc(s),t){case"html":if(t=i.documentElement,!t)throw Error(a(452));return t;case"head":if(t=i.head,!t)throw Error(a(453));return t;case"body":if(t=i.body,!t)throw Error(a(454));return t;default:throw Error(a(451))}}function Qo(t){for(var i=t.attributes;i.length;)t.removeAttributeNode(i[0]);De(t)}var Ci=new Map,_0=new Set;function Wc(t){return typeof t.getRootNode=="function"?t.getRootNode():t.nodeType===9?t:t.ownerDocument}var kr=W.d;W.d={f:D2,r:O2,D:N2,C:B2,L:I2,m:j2,X:$2,S:z2,M:P2};function D2(){var t=kr.f(),i=Ic();return t||i}function O2(t){var i=pe(t);i!==null&&i.tag===5&&i.type==="form"?N_(i):kr.r(t)}var Ia=typeof document>"u"?null:document;function v0(t,i,s){var o=Ia;if(o&&typeof i=="string"&&i){var _=qn(i);_='link[rel="'+t+'"][href="'+_+'"]',typeof s=="string"&&(_+='[crossorigin="'+s+'"]'),_0.has(_)||(_0.add(_),t={rel:t,crossOrigin:s,href:i},o.querySelector(_)===null&&(i=o.createElement("link"),Tn(i,"link",t),Ze(i),o.head.appendChild(i)))}}function N2(t){kr.D(t),v0("dns-prefetch",t,null)}function B2(t,i){kr.C(t,i),v0("preconnect",t,i)}function I2(t,i,s){kr.L(t,i,s);var o=Ia;if(o&&t&&i){var _='link[rel="preload"][as="'+qn(i)+'"]';i==="image"&&s&&s.imageSrcSet?(_+='[imagesrcset="'+qn(s.imageSrcSet)+'"]',typeof s.imageSizes=="string"&&(_+='[imagesizes="'+qn(s.imageSizes)+'"]')):_+='[href="'+qn(t)+'"]';var w=_;switch(i){case"style":w=ja(t);break;case"script":w=za(t)}Ci.has(w)||(t=g({rel:"preload",href:i==="image"&&s&&s.imageSrcSet?void 0:t,as:i},s),Ci.set(w,t),o.querySelector(_)!==null||i==="style"&&o.querySelector(el(w))||i==="script"&&o.querySelector(tl(w))||(i=o.createElement("link"),Tn(i,"link",t),Ze(i),o.head.appendChild(i)))}}function j2(t,i){kr.m(t,i);var s=Ia;if(s&&t){var o=i&&typeof i.as=="string"?i.as:"script",_='link[rel="modulepreload"][as="'+qn(o)+'"][href="'+qn(t)+'"]',w=_;switch(o){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":w=za(t)}if(!Ci.has(w)&&(t=g({rel:"modulepreload",href:t},i),Ci.set(w,t),s.querySelector(_)===null)){switch(o){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(s.querySelector(tl(w)))return}o=s.createElement("link"),Tn(o,"link",t),Ze(o),s.head.appendChild(o)}}}function z2(t,i,s){kr.S(t,i,s);var o=Ia;if(o&&t){var _=rt(o).hoistableStyles,w=ja(t);i=i||"default";var D=_.get(w);if(!D){var j={loading:0,preload:null};if(D=o.querySelector(el(w)))j.loading=5;else{t=g({rel:"stylesheet",href:t,"data-precedence":i},s),(s=Ci.get(w))&&of(t,s);var X=D=o.createElement("link");Ze(X),Tn(X,"link",t),X._p=new Promise(function(re,ue){X.onload=re,X.onerror=ue}),X.addEventListener("load",function(){j.loading|=1}),X.addEventListener("error",function(){j.loading|=2}),j.loading|=4,Gc(D,i,o)}D={type:"stylesheet",instance:D,count:1,state:j},_.set(w,D)}}}function $2(t,i){kr.X(t,i);var s=Ia;if(s&&t){var o=rt(s).hoistableScripts,_=za(t),w=o.get(_);w||(w=s.querySelector(tl(_)),w||(t=g({src:t,async:!0},i),(i=Ci.get(_))&&lf(t,i),w=s.createElement("script"),Ze(w),Tn(w,"link",t),s.head.appendChild(w)),w={type:"script",instance:w,count:1,state:null},o.set(_,w))}}function P2(t,i){kr.M(t,i);var s=Ia;if(s&&t){var o=rt(s).hoistableScripts,_=za(t),w=o.get(_);w||(w=s.querySelector(tl(_)),w||(t=g({src:t,async:!0,type:"module"},i),(i=Ci.get(_))&&lf(t,i),w=s.createElement("script"),Ze(w),Tn(w,"link",t),s.head.appendChild(w)),w={type:"script",instance:w,count:1,state:null},o.set(_,w))}}function b0(t,i,s,o){var _=(_=_e.current)?Wc(_):null;if(!_)throw Error(a(446));switch(t){case"meta":case"title":return null;case"style":return typeof s.precedence=="string"&&typeof s.href=="string"?(i=ja(s.href),s=rt(_).hoistableStyles,o=s.get(i),o||(o={type:"style",instance:null,count:0,state:null},s.set(i,o)),o):{type:"void",instance:null,count:0,state:null};case"link":if(s.rel==="stylesheet"&&typeof s.href=="string"&&typeof s.precedence=="string"){t=ja(s.href);var w=rt(_).hoistableStyles,D=w.get(t);if(D||(_=_.ownerDocument||_,D={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},w.set(t,D),(w=_.querySelector(el(t)))&&!w._p&&(D.instance=w,D.state.loading=5),Ci.has(t)||(s={rel:"preload",as:"style",href:s.href,crossOrigin:s.crossOrigin,integrity:s.integrity,media:s.media,hrefLang:s.hrefLang,referrerPolicy:s.referrerPolicy},Ci.set(t,s),w||H2(_,t,s,D.state))),i&&o===null)throw Error(a(528,""));return D}if(i&&o!==null)throw Error(a(529,""));return null;case"script":return i=s.async,s=s.src,typeof s=="string"&&i&&typeof i!="function"&&typeof i!="symbol"?(i=za(s),s=rt(_).hoistableScripts,o=s.get(i),o||(o={type:"script",instance:null,count:0,state:null},s.set(i,o)),o):{type:"void",instance:null,count:0,state:null};default:throw Error(a(444,t))}}function ja(t){return'href="'+qn(t)+'"'}function el(t){return'link[rel="stylesheet"]['+t+"]"}function y0(t){return g({},t,{"data-precedence":t.precedence,precedence:null})}function H2(t,i,s,o){t.querySelector('link[rel="preload"][as="style"]['+i+"]")?o.loading=1:(i=t.createElement("link"),o.preload=i,i.addEventListener("load",function(){return o.loading|=1}),i.addEventListener("error",function(){return o.loading|=2}),Tn(i,"link",s),Ze(i),t.head.appendChild(i))}function za(t){return'[src="'+qn(t)+'"]'}function tl(t){return"script[async]"+t}function S0(t,i,s){if(i.count++,i.instance===null)switch(i.type){case"style":var o=t.querySelector('style[data-href~="'+qn(s.href)+'"]');if(o)return i.instance=o,Ze(o),o;var _=g({},s,{"data-href":s.href,"data-precedence":s.precedence,href:null,precedence:null});return o=(t.ownerDocument||t).createElement("style"),Ze(o),Tn(o,"style",_),Gc(o,s.precedence,t),i.instance=o;case"stylesheet":_=ja(s.href);var w=t.querySelector(el(_));if(w)return i.state.loading|=4,i.instance=w,Ze(w),w;o=y0(s),(_=Ci.get(_))&&of(o,_),w=(t.ownerDocument||t).createElement("link"),Ze(w);var D=w;return D._p=new Promise(function(j,X){D.onload=j,D.onerror=X}),Tn(w,"link",o),i.state.loading|=4,Gc(w,s.precedence,t),i.instance=w;case"script":return w=za(s.src),(_=t.querySelector(tl(w)))?(i.instance=_,Ze(_),_):(o=s,(_=Ci.get(w))&&(o=g({},s),lf(o,_)),t=t.ownerDocument||t,_=t.createElement("script"),Ze(_),Tn(_,"link",o),t.head.appendChild(_),i.instance=_);case"void":return null;default:throw Error(a(443,i.type))}else i.type==="stylesheet"&&(i.state.loading&4)===0&&(o=i.instance,i.state.loading|=4,Gc(o,s.precedence,t));return i.instance}function Gc(t,i,s){for(var o=s.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),_=o.length?o[o.length-1]:null,w=_,D=0;D<o.length;D++){var j=o[D];if(j.dataset.precedence===i)w=j;else if(w!==_)break}w?w.parentNode.insertBefore(t,w.nextSibling):(i=s.nodeType===9?s.head:s,i.insertBefore(t,i.firstChild))}function of(t,i){t.crossOrigin==null&&(t.crossOrigin=i.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=i.referrerPolicy),t.title==null&&(t.title=i.title)}function lf(t,i){t.crossOrigin==null&&(t.crossOrigin=i.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=i.referrerPolicy),t.integrity==null&&(t.integrity=i.integrity)}var Kc=null;function w0(t,i,s){if(Kc===null){var o=new Map,_=Kc=new Map;_.set(s,o)}else _=Kc,o=_.get(s),o||(o=new Map,_.set(s,o));if(o.has(t))return o;for(o.set(t,null),s=s.getElementsByTagName(t),_=0;_<s.length;_++){var w=s[_];if(!(w[Ki]||w[At]||t==="link"&&w.getAttribute("rel")==="stylesheet")&&w.namespaceURI!=="http://www.w3.org/2000/svg"){var D=w.getAttribute(i)||"";D=t+D;var j=o.get(D);j?j.push(w):o.set(D,[w])}}return o}function C0(t,i,s){t=t.ownerDocument||t,t.head.insertBefore(s,i==="title"?t.querySelector("head > title"):null)}function U2(t,i,s){if(s===1||i.itemProp!=null)return!1;switch(t){case"meta":case"title":return!0;case"style":if(typeof i.precedence!="string"||typeof i.href!="string"||i.href==="")break;return!0;case"link":if(typeof i.rel!="string"||typeof i.href!="string"||i.href===""||i.onLoad||i.onError)break;return i.rel==="stylesheet"?(t=i.disabled,typeof i.precedence=="string"&&t==null):!0;case"script":if(i.async&&typeof i.async!="function"&&typeof i.async!="symbol"&&!i.onLoad&&!i.onError&&i.src&&typeof i.src=="string")return!0}return!1}function x0(t){return!(t.type==="stylesheet"&&(t.state.loading&3)===0)}function F2(t,i,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 _=ja(o.href),w=i.querySelector(el(_));if(w){i=w._p,i!==null&&typeof i=="object"&&typeof i.then=="function"&&(t.count++,t=Vc.bind(t),i.then(t,t)),s.state.loading|=4,s.instance=w,Ze(w);return}w=i.ownerDocument||i,o=y0(o),(_=Ci.get(_))&&of(o,_),w=w.createElement("link"),Ze(w);var D=w;D._p=new Promise(function(j,X){D.onload=j,D.onerror=X}),Tn(w,"link",o),s.instance=w}t.stylesheets===null&&(t.stylesheets=new Map),t.stylesheets.set(s,i),(i=s.state.preload)&&(s.state.loading&3)===0&&(t.count++,s=Vc.bind(t),i.addEventListener("load",s),i.addEventListener("error",s))}}var cf=0;function q2(t,i){return t.stylesheets&&t.count===0&&Xc(t,t.stylesheets),0<t.count||0<t.imgCount?function(s){var o=setTimeout(function(){if(t.stylesheets&&Xc(t,t.stylesheets),t.unsuspend){var w=t.unsuspend;t.unsuspend=null,w()}},6e4+i);0<t.imgBytes&&cf===0&&(cf=62500*x2());var _=setTimeout(function(){if(t.waitingForImages=!1,t.count===0&&(t.stylesheets&&Xc(t,t.stylesheets),t.unsuspend)){var w=t.unsuspend;t.unsuspend=null,w()}},(t.imgBytes>cf?50:800)+i);return t.unsuspend=s,function(){t.unsuspend=null,clearTimeout(o),clearTimeout(_)}}:null}function Vc(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Xc(this,this.stylesheets);else if(this.unsuspend){var t=this.unsuspend;this.unsuspend=null,t()}}}var Yc=null;function Xc(t,i){t.stylesheets=null,t.unsuspend!==null&&(t.count++,Yc=new Map,i.forEach(W2,t),Yc=null,Vc.call(t))}function W2(t,i){if(!(i.state.loading&4)){var s=Yc.get(t);if(s)var o=s.get(null);else{s=new Map,Yc.set(t,s);for(var _=t.querySelectorAll("link[data-precedence],style[data-precedence]"),w=0;w<_.length;w++){var D=_[w];(D.nodeName==="LINK"||D.getAttribute("media")!=="not all")&&(s.set(D.dataset.precedence,D),o=D)}o&&s.set(null,o)}_=i.instance,D=_.getAttribute("data-precedence"),w=s.get(D)||o,w===o&&s.set(null,_),s.set(D,_),this.count++,o=Vc.bind(this),_.addEventListener("load",o),_.addEventListener("error",o),w?w.parentNode.insertBefore(_,w.nextSibling):(t=t.nodeType===9?t.head:t,t.insertBefore(_,t.firstChild)),i.state.loading|=4}}var nl={$$typeof:b,Provider:null,Consumer:null,_currentValue:Y,_currentValue2:Y,_threadCount:0};function G2(t,i,s,o,_,w,D,j,X){this.tag=1,this.containerInfo=t,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=wt(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=wt(0),this.hiddenUpdates=wt(null),this.identifierPrefix=o,this.onUncaughtError=_,this.onCaughtError=w,this.onRecoverableError=D,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=X,this.incompleteTransitions=new Map}function E0(t,i,s,o,_,w,D,j,X,re,ue,fe){return t=new G2(t,i,s,D,X,re,ue,fe,j),i=1,w===!0&&(i|=24),w=ai(3,null,null,i),t.current=w,w.stateNode=t,i=Hh(),i.refCount++,t.pooledCache=i,i.refCount++,w.memoizedState={element:o,isDehydrated:s,cache:i},Wh(w),t}function T0(t){return t?(t=ga,t):ga}function A0(t,i,s,o,_,w){_=T0(_),o.context===null?o.context=_:o.pendingContext=_,o=Yr(i),o.payload={element:s},w=w===void 0?null:w,w!==null&&(o.callback=w),s=Xr(t,o,i),s!==null&&(Xn(s,t,i),No(s,t,i))}function k0(t,i){if(t=t.memoizedState,t!==null&&t.dehydrated!==null){var s=t.retryLane;t.retryLane=s!==0&&s<i?s:i}}function uf(t,i){k0(t,i),(t=t.alternate)&&k0(t,i)}function R0(t){if(t.tag===13||t.tag===31){var i=Rs(t,67108864);i!==null&&Xn(i,t,67108864),uf(t,67108864)}}function L0(t){if(t.tag===13||t.tag===31){var i=hi();i=et(i);var s=Rs(t,i);s!==null&&Xn(s,t,i),uf(t,i)}}var Zc=!0;function K2(t,i,s,o){var _=q.T;q.T=null;var w=W.p;try{W.p=2,hf(t,i,s,o)}finally{W.p=w,q.T=_}}function V2(t,i,s,o){var _=q.T;q.T=null;var w=W.p;try{W.p=8,hf(t,i,s,o)}finally{W.p=w,q.T=_}}function hf(t,i,s,o){if(Zc){var _=df(o);if(_===null)Xd(t,i,o,Jc,s),D0(t,o);else if(X2(_,t,i,s,o))o.stopPropagation();else if(D0(t,o),i&4&&-1<Y2.indexOf(t)){for(;_!==null;){var w=pe(_);if(w!==null)switch(w.tag){case 3:if(w=w.stateNode,w.current.memoizedState.isDehydrated){var D=rn(w.pendingLanes);if(D!==0){var j=w;for(j.pendingLanes|=2,j.entangledLanes|=2;D;){var X=1<<31-Pt(D);j.entanglements[1]|=X,D&=~X}Zi(w),(ht&6)===0&&(Nc=ut()+500,Xo(0))}}break;case 31:case 13:j=Rs(w,2),j!==null&&Xn(j,w,2),Ic(),uf(w,2)}if(w=df(o),w===null&&Xd(t,i,o,Jc,s),w===_)break;_=w}_!==null&&o.stopPropagation()}else Xd(t,i,o,null,s)}}function df(t){return t=qe(t),ff(t)}var Jc=null;function ff(t){if(Jc=null,t=V(t),t!==null){var i=f(t);if(i===null)t=null;else{var s=i.tag;if(s===13){if(t=m(i),t!==null)return t;t=null}else if(s===31){if(t=c(i),t!==null)return t;t=null}else if(s===3){if(i.stateNode.current.memoizedState.isDehydrated)return i.tag===3?i.stateNode.containerInfo:null;t=null}else i!==t&&(t=null)}}return Jc=t,null}function M0(t){switch(t){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(Vt()){case zt:return 2;case $t:return 8;case nn:case Di:return 32;case Ln:return 268435456;default:return 32}default:return 32}}var pf=!1,os=null,ls=null,cs=null,il=new Map,rl=new Map,us=[],Y2="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 D0(t,i){switch(t){case"focusin":case"focusout":os=null;break;case"dragenter":case"dragleave":ls=null;break;case"mouseover":case"mouseout":cs=null;break;case"pointerover":case"pointerout":il.delete(i.pointerId);break;case"gotpointercapture":case"lostpointercapture":rl.delete(i.pointerId)}}function sl(t,i,s,o,_,w){return t===null||t.nativeEvent!==w?(t={blockedOn:i,domEventName:s,eventSystemFlags:o,nativeEvent:w,targetContainers:[_]},i!==null&&(i=pe(i),i!==null&&R0(i)),t):(t.eventSystemFlags|=o,i=t.targetContainers,_!==null&&i.indexOf(_)===-1&&i.push(_),t)}function X2(t,i,s,o,_){switch(i){case"focusin":return os=sl(os,t,i,s,o,_),!0;case"dragenter":return ls=sl(ls,t,i,s,o,_),!0;case"mouseover":return cs=sl(cs,t,i,s,o,_),!0;case"pointerover":var w=_.pointerId;return il.set(w,sl(il.get(w)||null,t,i,s,o,_)),!0;case"gotpointercapture":return w=_.pointerId,rl.set(w,sl(rl.get(w)||null,t,i,s,o,_)),!0}return!1}function O0(t){var i=V(t.target);if(i!==null){var s=f(i);if(s!==null){if(i=s.tag,i===13){if(i=m(s),i!==null){t.blockedOn=i,ur(t.priority,function(){L0(s)});return}}else if(i===31){if(i=c(s),i!==null){t.blockedOn=i,ur(t.priority,function(){L0(s)});return}}else if(i===3&&s.stateNode.current.memoizedState.isDehydrated){t.blockedOn=s.tag===3?s.stateNode.containerInfo:null;return}}}t.blockedOn=null}function Qc(t){if(t.blockedOn!==null)return!1;for(var i=t.targetContainers;0<i.length;){var s=df(t.nativeEvent);if(s===null){s=t.nativeEvent;var o=new s.constructor(s.type,s);Re=o,s.target.dispatchEvent(o),Re=null}else return i=pe(s),i!==null&&R0(i),t.blockedOn=s,!1;i.shift()}return!0}function N0(t,i,s){Qc(t)&&s.delete(i)}function Z2(){pf=!1,os!==null&&Qc(os)&&(os=null),ls!==null&&Qc(ls)&&(ls=null),cs!==null&&Qc(cs)&&(cs=null),il.forEach(N0),rl.forEach(N0)}function eu(t,i){t.blockedOn===i&&(t.blockedOn=null,pf||(pf=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,Z2)))}var tu=null;function B0(t){tu!==t&&(tu=t,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){tu===t&&(tu=null);for(var i=0;i<t.length;i+=3){var s=t[i],o=t[i+1],_=t[i+2];if(typeof o!="function"){if(ff(o||s)===null)continue;break}var w=pe(s);w!==null&&(t.splice(i,3),i-=3,hd(w,{pending:!0,data:_,method:s.method,action:o},o,_))}}))}function $a(t){function i(X){return eu(X,t)}os!==null&&eu(os,t),ls!==null&&eu(ls,t),cs!==null&&eu(cs,t),il.forEach(i),rl.forEach(i);for(var s=0;s<us.length;s++){var o=us[s];o.blockedOn===t&&(o.blockedOn=null)}for(;0<us.length&&(s=us[0],s.blockedOn===null);)O0(s),s.blockedOn===null&&us.shift();if(s=(t.ownerDocument||t).$$reactFormReplay,s!=null)for(o=0;o<s.length;o+=3){var _=s[o],w=s[o+1],D=_[Et]||null;if(typeof w=="function")D||B0(s);else if(D){var j=null;if(w&&w.hasAttribute("formAction")){if(_=w,D=w[Et]||null)j=D.formAction;else if(ff(_)!==null)continue}else j=D.action;typeof j=="function"?s[o+1]=j:(s.splice(o,3),o-=3),B0(s)}}}function I0(){function t(w){w.canIntercept&&w.info==="react-transition"&&w.intercept({handler:function(){return new Promise(function(D){return _=D})},focusReset:"manual",scroll:"manual"})}function i(){_!==null&&(_(),_=null),o||setTimeout(s,20)}function s(){if(!o&&!navigation.transition){var w=navigation.currentEntry;w&&w.url!=null&&navigation.navigate(w.url,{state:w.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var o=!1,_=null;return navigation.addEventListener("navigate",t),navigation.addEventListener("navigatesuccess",i),navigation.addEventListener("navigateerror",i),setTimeout(s,100),function(){o=!0,navigation.removeEventListener("navigate",t),navigation.removeEventListener("navigatesuccess",i),navigation.removeEventListener("navigateerror",i),_!==null&&(_(),_=null)}}}function gf(t){this._internalRoot=t}nu.prototype.render=gf.prototype.render=function(t){var i=this._internalRoot;if(i===null)throw Error(a(409));var s=i.current,o=hi();A0(s,o,t,i,null,null)},nu.prototype.unmount=gf.prototype.unmount=function(){var t=this._internalRoot;if(t!==null){this._internalRoot=null;var i=t.containerInfo;A0(t.current,2,null,t,null,null),Ic(),i[Ni]=null}};function nu(t){this._internalRoot=t}nu.prototype.unstable_scheduleHydration=function(t){if(t){var i=cr();t={blockedOn:null,target:t,priority:i};for(var s=0;s<us.length&&i!==0&&i<us[s].priority;s++);us.splice(s,0,t),s===0&&O0(t)}};var j0=n.version;if(j0!=="19.2.7")throw Error(a(527,j0,"19.2.7"));W.findDOMNode=function(t){var i=t._reactInternals;if(i===void 0)throw typeof t.render=="function"?Error(a(188)):(t=Object.keys(t).join(","),Error(a(268,t)));return t=h(i),t=t!==null?y(t):null,t=t===null?null:t.stateNode,t};var J2={bundleType:0,version:"19.2.7",rendererPackageName:"react-dom",currentDispatcherRef:q,reconcilerVersion:"19.2.7"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var iu=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!iu.isDisabled&&iu.supportsFiber)try{Hn=iu.inject(J2),Yt=iu}catch{}}return ol.createRoot=function(t,i){if(!l(t))throw Error(a(299));var s=!1,o="",_=q_,w=W_,D=G_;return i!=null&&(i.unstable_strictMode===!0&&(s=!0),i.identifierPrefix!==void 0&&(o=i.identifierPrefix),i.onUncaughtError!==void 0&&(_=i.onUncaughtError),i.onCaughtError!==void 0&&(w=i.onCaughtError),i.onRecoverableError!==void 0&&(D=i.onRecoverableError)),i=E0(t,1,!1,null,null,s,o,null,_,w,D,I0),t[Ni]=i.current,Yd(t),new gf(i)},ol.hydrateRoot=function(t,i,s){if(!l(t))throw Error(a(299));var o=!1,_="",w=q_,D=W_,j=G_,X=null;return s!=null&&(s.unstable_strictMode===!0&&(o=!0),s.identifierPrefix!==void 0&&(_=s.identifierPrefix),s.onUncaughtError!==void 0&&(w=s.onUncaughtError),s.onCaughtError!==void 0&&(D=s.onCaughtError),s.onRecoverableError!==void 0&&(j=s.onRecoverableError),s.formState!==void 0&&(X=s.formState)),i=E0(t,1,!0,i,s??null,o,_,X,w,D,j,I0),i.context=T0(null),s=i.current,o=hi(),o=et(o),_=Yr(o),_.callback=null,Xr(s,_,o),s=o,i.current.lanes=s,ft(i,s),Zi(i),t[Ni]=i.current,Yd(t),new nu(i)},ol.version="19.2.7",ol}var K0;function lE(){if(K0)return vf.exports;K0=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(n){console.error(n)}}return e(),vf.exports=oE(),vf.exports}var cE=lE();var V0="popstate";function Y0(e){return typeof e=="object"&&e!=null&&"pathname"in e&&"search"in e&&"hash"in e&&"state"in e&&"key"in e}function uE(e={}){function n(a,l){let f=l.state?.masked,{pathname:m,search:c,hash:u}=f||a.location;return mp("",{pathname:m,search:c,hash:u},l.state&&l.state.usr||null,l.state&&l.state.key||"default",f?{pathname:a.location.pathname,search:a.location.search,hash:a.location.hash}:void 0)}function r(a,l){return typeof l=="string"?l:Ml(l)}return dE(n,r,null,e)}function Bt(e,n){if(e===!1||e===null||typeof e>"u")throw new Error(n)}function qi(e,n){if(!e){typeof console<"u"&&console.warn(n);try{throw new Error(n)}catch{}}}function hE(){return Math.random().toString(36).substring(2,10)}function X0(e,n){return{usr:e.state,key:e.key,idx:n,masked:e.mask?{pathname:e.pathname,search:e.search,hash:e.hash}:void 0}}function mp(e,n,r=null,a,l){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof n=="string"?so(n):n,state:r,key:n&&n.key||a||hE(),mask:l}}function Ml({pathname:e="/",search:n="",hash:r=""}){return n&&n!=="?"&&(e+=n.charAt(0)==="?"?n:"?"+n),r&&r!=="#"&&(e+=r.charAt(0)==="#"?r:"#"+r),e}function so(e){let n={};if(e){let r=e.indexOf("#");r>=0&&(n.hash=e.substring(r),e=e.substring(0,r));let a=e.indexOf("?");a>=0&&(n.search=e.substring(a),e=e.substring(0,a)),e&&(n.pathname=e)}return n}function dE(e,n,r,a={}){let{window:l=document.defaultView,v5Compat:f=!1}=a,m=l.history,c="POP",u=null,h=y();h==null&&(h=0,m.replaceState({...m.state,idx:h},""));function y(){return(m.state||{idx:null}).idx}function g(){c="POP";let p=y(),v=p==null?null:p-h;h=p,u&&u({action:c,location:T.location,delta:v})}function C(p,v){c="PUSH";let d=Y0(p)?p:mp(T.location,p,v);h=y()+1;let b=X0(d,h),x=T.createHref(d.mask||d);try{m.pushState(b,"",x)}catch(L){if(L instanceof DOMException&&L.name==="DataCloneError")throw L;l.location.assign(x)}f&&u&&u({action:c,location:T.location,delta:1})}function E(p,v){c="REPLACE";let d=Y0(p)?p:mp(T.location,p,v);h=y();let b=X0(d,h),x=T.createHref(d.mask||d);m.replaceState(b,"",x),f&&u&&u({action:c,location:T.location,delta:0})}function A(p){return fE(l,p)}let T={get action(){return c},get location(){return e(l,m)},listen(p){if(u)throw new Error("A history only accepts one active listener");return l.addEventListener(V0,g),u=p,()=>{l.removeEventListener(V0,g),u=null}},createHref(p){return n(l,p)},createURL:A,encodeLocation(p){let v=A(p);return{pathname:v.pathname,search:v.search,hash:v.hash}},push:C,replace:E,go(p){return m.go(p)}};return T}function fE(e,n,r=!1){let a="http://localhost";e&&(a=e.location.origin!=="null"?e.location.origin:e.location.href),Bt(a,"No window.location.(origin|href) available to create URL");let l=typeof n=="string"?n:Ml(n);return l=l.replace(/ $/,"%20"),!r&&l.startsWith("//")&&(l=a+l),new URL(l,a)}function Ry(e,n,r="/"){return pE(e,n,r,!1)}function pE(e,n,r,a,l){let f=typeof n=="string"?so(n):n,m=zr(f.pathname||"/",r);if(m==null)return null;let c=gE(e),u=null,h=AE(m);for(let y=0;u==null&&y<c.length;++y)u=EE(c[y],h,a);return u}function gE(e){let n=Ly(e);return mE(n),n}function Ly(e,n=[],r=[],a="",l=!1){let f=(m,c,u=l,h)=>{let y={relativePath:h===void 0?m.path||"":h,caseSensitive:m.caseSensitive===!0,childrenIndex:c,route:m};if(y.relativePath.startsWith("/")){if(!y.relativePath.startsWith(a)&&u)return;Bt(y.relativePath.startsWith(a),`Absolute route path "${y.relativePath}" nested under path "${a}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),y.relativePath=y.relativePath.slice(a.length)}let g=Fi([a,y.relativePath]),C=r.concat(y);m.children&&m.children.length>0&&(Bt(m.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${g}".`),Ly(m.children,n,C,g,u)),!(m.path==null&&!m.index)&&n.push({path:g,score:CE(g,m.index),routesMeta:C})};return e.forEach((m,c)=>{if(m.path===""||!m.path?.includes("?"))f(m,c);else for(let u of My(m.path))f(m,c,!0,u)}),n}function My(e){let n=e.split("/");if(n.length===0)return[];let[r,...a]=n,l=r.endsWith("?"),f=r.replace(/\?$/,"");if(a.length===0)return l?[f,""]:[f];let m=My(a.join("/")),c=[];return c.push(...m.map(u=>u===""?f:[f,u].join("/"))),l&&c.push(...m),c.map(u=>e.startsWith("/")&&u===""?"/":u)}function mE(e){e.sort((n,r)=>n.score!==r.score?r.score-n.score:xE(n.routesMeta.map(a=>a.childrenIndex),r.routesMeta.map(a=>a.childrenIndex)))}var _E=/^:[\w-]+$/,vE=3,bE=2,yE=1,SE=10,wE=-2,Z0=e=>e==="*";function CE(e,n){let r=e.split("/"),a=r.length;return r.some(Z0)&&(a+=wE),n&&(a+=bE),r.filter(l=>!Z0(l)).reduce((l,f)=>l+(_E.test(f)?vE:f===""?yE:SE),a)}function xE(e,n){return e.length===n.length&&e.slice(0,-1).every((a,l)=>a===n[l])?e[e.length-1]-n[n.length-1]:0}function EE(e,n,r=!1){let{routesMeta:a}=e,l={},f="/",m=[];for(let c=0;c<a.length;++c){let u=a[c],h=c===a.length-1,y=f==="/"?n:n.slice(f.length)||"/",g=ju({path:u.relativePath,caseSensitive:u.caseSensitive,end:h},y),C=u.route;if(!g&&h&&r&&!a[a.length-1].route.index&&(g=ju({path:u.relativePath,caseSensitive:u.caseSensitive,end:!1},y)),!g)return null;Object.assign(l,g.params),m.push({params:l,pathname:Fi([f,g.pathname]),pathnameBase:ME(Fi([f,g.pathnameBase])),route:C}),g.pathnameBase!=="/"&&(f=Fi([f,g.pathnameBase]))}return m}function ju(e,n){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[r,a]=TE(e.path,e.caseSensitive,e.end),l=n.match(r);if(!l)return null;let f=l[0],m=f.replace(/(.)\/+$/,"$1"),c=l.slice(1);return{params:a.reduce((h,{paramName:y,isOptional:g},C)=>{if(y==="*"){let A=c[C]||"";m=f.slice(0,f.length-A.length).replace(/(.)\/+$/,"$1")}const E=c[C];return g&&!E?h[y]=void 0:h[y]=(E||"").replace(/%2F/g,"/"),h},{}),pathname:f,pathnameBase:m,pattern:e}}function TE(e,n=!1,r=!0){qi(e==="*"||!e.endsWith("*")||e.endsWith("/*"),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,"/*")}".`);let a=[],l="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(m,c,u,h,y)=>{if(a.push({paramName:c,isOptional:u!=null}),u){let g=y.charAt(h+m.length);return g&&g!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}return"/([^\\/]+)"}).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return e.endsWith("*")?(a.push({paramName:"*"}),l+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):r?l+="\\/*$":e!==""&&e!=="/"&&(l+="(?:(?=\\/|$))"),[new RegExp(l,n?void 0:"i"),a]}function AE(e){try{return e.split("/").map(n=>decodeURIComponent(n).replace(/\//g,"%2F")).join("/")}catch(n){return qi(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${n}).`),e}}function zr(e,n){if(n==="/")return e;if(!e.toLowerCase().startsWith(n.toLowerCase()))return null;let r=n.endsWith("/")?n.length-1:n.length,a=e.charAt(r);return a&&a!=="/"?null:e.slice(r)||"/"}var kE=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function RE(e,n="/"){let{pathname:r,search:a="",hash:l=""}=typeof e=="string"?so(e):e,f;return r?(r=Dy(r),r.startsWith("/")?f=J0(r.substring(1),"/"):f=J0(r,n)):f=n,{pathname:f,search:DE(a),hash:OE(l)}}function J0(e,n){let r=zu(n).split("/");return e.split("/").forEach(l=>{l===".."?r.length>1&&r.pop():l!=="."&&r.push(l)}),r.length>1?r.join("/"):"/"}function wf(e,n,r,a){return`Cannot include a '${e}' character in a manually specified \`to.${n}\` 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 LE(e){return e.filter((n,r)=>r===0||n.route.path&&n.route.path.length>0)}function bg(e){let n=LE(e);return n.map((r,a)=>a===n.length-1?r.pathname:r.pathnameBase)}function eh(e,n,r,a=!1){let l;typeof e=="string"?l=so(e):(l={...e},Bt(!l.pathname||!l.pathname.includes("?"),wf("?","pathname","search",l)),Bt(!l.pathname||!l.pathname.includes("#"),wf("#","pathname","hash",l)),Bt(!l.search||!l.search.includes("#"),wf("#","search","hash",l)));let f=e===""||l.pathname==="",m=f?"/":l.pathname,c;if(m==null)c=r;else{let g=n.length-1;if(!a&&m.startsWith("..")){let C=m.split("/");for(;C[0]==="..";)C.shift(),g-=1;l.pathname=C.join("/")}c=g>=0?n[g]:"/"}let u=RE(l,c),h=m&&m!=="/"&&m.endsWith("/"),y=(f||m===".")&&r.endsWith("/");return!u.pathname.endsWith("/")&&(h||y)&&(u.pathname+="/"),u}var Dy=e=>e.replace(/\/\/+/g,"/"),Fi=e=>Dy(e.join("/")),zu=e=>e.replace(/\/+$/,""),ME=e=>zu(e).replace(/^\/*/,"/"),DE=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,OE=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,NE=class{constructor(e,n,r,a=!1){this.status=e,this.statusText=n||"",this.internal=a,r instanceof Error?(this.data=r.toString(),this.error=r):this.data=r}};function BE(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}function IE(e){let n=e.map(r=>r.route.path).filter(Boolean);return Fi(n)||"/"}var Oy=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function Ny(e,n){let r=e;if(typeof r!="string"||!kE.test(r))return{absoluteURL:void 0,isExternal:!1,to:r};let a=r,l=!1;if(Oy)try{let f=new URL(window.location.href),m=r.startsWith("//")?new URL(f.protocol+r):new URL(r),c=zr(m.pathname,n);m.origin===f.origin&&c!=null?r=c+m.search+m.hash:l=!0}catch{qi(!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 By=["POST","PUT","PATCH","DELETE"];new Set(By);var jE=["GET",...By];new Set(jE);var ao=H.createContext(null);ao.displayName="DataRouter";var th=H.createContext(null);th.displayName="DataRouterState";var Iy=H.createContext(!1);function zE(){return H.useContext(Iy)}var jy=H.createContext({isTransitioning:!1});jy.displayName="ViewTransition";var $E=H.createContext(new Map);$E.displayName="Fetchers";var PE=H.createContext(null);PE.displayName="Await";var fi=H.createContext(null);fi.displayName="Navigation";var $l=H.createContext(null);$l.displayName="Location";var rr=H.createContext({outlet:null,matches:[],isDataRoute:!1});rr.displayName="Route";var yg=H.createContext(null);yg.displayName="RouteError";var zy="REACT_ROUTER_ERROR",HE="REDIRECT",UE="ROUTE_ERROR_RESPONSE";function FE(e){if(e.startsWith(`${zy}:${HE}:{`))try{let n=JSON.parse(e.slice(28));if(typeof n=="object"&&n&&typeof n.status=="number"&&typeof n.statusText=="string"&&typeof n.location=="string"&&typeof n.reloadDocument=="boolean"&&typeof n.replace=="boolean")return n}catch{}}function qE(e){if(e.startsWith(`${zy}:${UE}:{`))try{let n=JSON.parse(e.slice(40));if(typeof n=="object"&&n&&typeof n.status=="number"&&typeof n.statusText=="string")return new NE(n.status,n.statusText,n.data)}catch{}}function WE(e,{relative:n}={}){Bt(oo(),"useHref() may be used only in the context of a <Router> component.");let{basename:r,navigator:a}=H.useContext(fi),{hash:l,pathname:f,search:m}=Hl(e,{relative:n}),c=f;return r!=="/"&&(c=f==="/"?r:Fi([r,f])),a.createHref({pathname:c,search:m,hash:l})}function oo(){return H.useContext($l)!=null}function Li(){return Bt(oo(),"useLocation() may be used only in the context of a <Router> component."),H.useContext($l).location}var $y="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function Py(e){H.useContext(fi).static||H.useLayoutEffect(e)}function Pl(){let{isDataRoute:e}=H.useContext(rr);return e?r5():GE()}function GE(){Bt(oo(),"useNavigate() may be used only in the context of a <Router> component.");let e=H.useContext(ao),{basename:n,navigator:r}=H.useContext(fi),{matches:a}=H.useContext(rr),{pathname:l}=Li(),f=JSON.stringify(bg(a)),m=H.useRef(!1);return Py(()=>{m.current=!0}),H.useCallback((u,h={})=>{if(qi(m.current,$y),!m.current)return;if(typeof u=="number"){r.go(u);return}let y=eh(u,JSON.parse(f),l,h.relative==="path");e==null&&n!=="/"&&(y.pathname=y.pathname==="/"?n:Fi([n,y.pathname])),(h.replace?r.replace:r.push)(y,h.state,h)},[n,r,f,l,e])}H.createContext(null);function Hl(e,{relative:n}={}){let{matches:r}=H.useContext(rr),{pathname:a}=Li(),l=JSON.stringify(bg(r));return H.useMemo(()=>eh(e,JSON.parse(l),a,n==="path"),[e,l,a,n])}function KE(e,n){return Hy(e,n)}function Hy(e,n,r){Bt(oo(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:a}=H.useContext(fi),{matches:l}=H.useContext(rr),f=l[l.length-1],m=f?f.params:{},c=f?f.pathname:"/",u=f?f.pathnameBase:"/",h=f&&f.route;{let p=h&&h.path||"";Fy(c,!h||p.endsWith("*")||p.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${c}" (under <Route path="${p}">) 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="${p}"> to <Route path="${p==="/"?"*":`${p}/*`}">.`)}let y=Li(),g;if(n){let p=typeof n=="string"?so(n):n;Bt(u==="/"||p.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 "${p.pathname}" was given in the \`location\` prop.`),g=p}else g=y;let C=g.pathname||"/",E=C;if(u!=="/"){let p=u.replace(/^\//,"").split("/");E="/"+C.replace(/^\//,"").split("/").slice(p.length).join("/")}let A=r&&r.state.matches.length?r.state.matches.map(p=>Object.assign(p,{route:r.manifest[p.route.id]||p.route})):Ry(e,{pathname:E});qi(h||A!=null,`No routes matched location "${g.pathname}${g.search}${g.hash}" `),qi(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 "${g.pathname}${g.search}${g.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 T=JE(A&&A.map(p=>Object.assign({},p,{params:Object.assign({},m,p.params),pathname:Fi([u,a.encodeLocation?a.encodeLocation(p.pathname.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:p.pathname]),pathnameBase:p.pathnameBase==="/"?u:Fi([u,a.encodeLocation?a.encodeLocation(p.pathnameBase.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:p.pathnameBase])})),l,r);return n&&T?H.createElement($l.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",mask:void 0,...g},navigationType:"POP"}},T):T}function VE(){let e=i5(),n=BE(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),r=e instanceof Error?e.stack:null,a="rgba(200,200,200, 0.5)",l={padding:"0.5rem",backgroundColor:a},f={padding:"2px 4px",backgroundColor:a},m=null;return console.error("Error handled by React Router default ErrorBoundary:",e),m=H.createElement(H.Fragment,null,H.createElement("p",null,"💿 Hey developer 👋"),H.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",H.createElement("code",{style:f},"ErrorBoundary")," or"," ",H.createElement("code",{style:f},"errorElement")," prop on your route.")),H.createElement(H.Fragment,null,H.createElement("h2",null,"Unexpected Application Error!"),H.createElement("h3",{style:{fontStyle:"italic"}},n),r?H.createElement("pre",{style:l},r):null,m)}var YE=H.createElement(VE,null),Uy=class extends H.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,n){return n.location!==e.location||n.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:n.error,location:n.location,revalidation:e.revalidation||n.revalidation}}componentDidCatch(e,n){this.props.onError?this.props.onError(e,n):console.error("React Router caught the following error during render",e)}render(){let e=this.state.error;if(this.context&&typeof e=="object"&&e&&"digest"in e&&typeof e.digest=="string"){const r=qE(e.digest);r&&(e=r)}let n=e!==void 0?H.createElement(rr.Provider,{value:this.props.routeContext},H.createElement(yg.Provider,{value:e,children:this.props.component})):this.props.children;return this.context?H.createElement(XE,{error:e},n):n}};Uy.contextType=Iy;var Cf=new WeakMap;function XE({children:e,error:n}){let{basename:r}=H.useContext(fi);if(typeof n=="object"&&n&&"digest"in n&&typeof n.digest=="string"){let a=FE(n.digest);if(a){let l=Cf.get(n);if(l)throw l;let f=Ny(a.location,r);if(Oy&&!Cf.get(n))if(f.isExternal||a.reloadDocument)window.location.href=f.absoluteURL||f.to;else{const m=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(f.to,{replace:a.replace}));throw Cf.set(n,m),m}return H.createElement("meta",{httpEquiv:"refresh",content:`0;url=${f.absoluteURL||f.to}`})}}return e}function ZE({routeContext:e,match:n,children:r}){let a=H.useContext(ao);return a&&a.static&&a.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(a.staticContext._deepestRenderedBoundaryId=n.route.id),H.createElement(rr.Provider,{value:e},r)}function JE(e,n=[],r){let a=r?.state;if(e==null){if(!a)return null;if(a.errors)e=a.matches;else if(n.length===0&&!a.initialized&&a.matches.length>0)e=a.matches;else return null}let l=e,f=a?.errors;if(f!=null){let y=l.findIndex(g=>g.route.id&&f?.[g.route.id]!==void 0);Bt(y>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(f).join(",")}`),l=l.slice(0,Math.min(l.length,y+1))}let m=!1,c=-1;if(r&&a){m=a.renderFallback;for(let y=0;y<l.length;y++){let g=l[y];if((g.route.HydrateFallback||g.route.hydrateFallbackElement)&&(c=y),g.route.id){let{loaderData:C,errors:E}=a,A=g.route.loader&&!C.hasOwnProperty(g.route.id)&&(!E||E[g.route.id]===void 0);if(g.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?(y,g)=>{u(y,{location:a.location,params:a.matches?.[0]?.params??{},pattern:IE(a.matches),errorInfo:g})}:void 0;return l.reduceRight((y,g,C)=>{let E,A=!1,T=null,p=null;a&&(E=f&&g.route.id?f[g.route.id]:void 0,T=g.route.errorElement||YE,m&&(c<0&&C===0?(Fy("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),A=!0,p=null):c===C&&(A=!0,p=g.route.hydrateFallbackElement||null)));let v=n.concat(l.slice(0,C+1)),d=()=>{let b;return E?b=T:A?b=p:g.route.Component?b=H.createElement(g.route.Component,null):g.route.element?b=g.route.element:b=y,H.createElement(ZE,{match:g,routeContext:{outlet:y,matches:v,isDataRoute:a!=null},children:b})};return a&&(g.route.ErrorBoundary||g.route.errorElement||C===0)?H.createElement(Uy,{location:a.location,revalidation:a.revalidation,component:T,error:E,children:d(),routeContext:{outlet:null,matches:v,isDataRoute:!0},onError:h}):d()},null)}function Sg(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function QE(e){let n=H.useContext(ao);return Bt(n,Sg(e)),n}function e5(e){let n=H.useContext(th);return Bt(n,Sg(e)),n}function t5(e){let n=H.useContext(rr);return Bt(n,Sg(e)),n}function wg(e){let n=t5(e),r=n.matches[n.matches.length-1];return Bt(r.route.id,`${e} can only be used on routes that contain a unique "id"`),r.route.id}function n5(){return wg("useRouteId")}function i5(){let e=H.useContext(yg),n=e5("useRouteError"),r=wg("useRouteError");return e!==void 0?e:n.errors?.[r]}function r5(){let{router:e}=QE("useNavigate"),n=wg("useNavigate"),r=H.useRef(!1);return Py(()=>{r.current=!0}),H.useCallback(async(l,f={})=>{qi(r.current,$y),r.current&&(typeof l=="number"?await e.navigate(l):await e.navigate(l,{fromRouteId:n,...f}))},[e,n])}var Q0={};function Fy(e,n,r){!n&&!Q0[e]&&(Q0[e]=!0,qi(!1,r))}H.memo(s5);function s5({routes:e,manifest:n,future:r,state:a,isStatic:l,onError:f}){return Hy(e,void 0,{manifest:n,state:a,isStatic:l,onError:f})}function eb({to:e,replace:n,state:r,relative:a}){Bt(oo(),"<Navigate> may be used only in the context of a <Router> component.");let{static:l}=H.useContext(fi);qi(!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:f}=H.useContext(rr),{pathname:m}=Li(),c=Pl(),u=eh(e,bg(f),m,a==="path"),h=JSON.stringify(u);return H.useEffect(()=>{c(JSON.parse(h),{replace:n,state:r,relative:a})},[c,h,a,n,r]),null}function Ws(e){Bt(!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 a5({basename:e="/",children:n=null,location:r,navigationType:a="POP",navigator:l,static:f=!1,useTransitions:m}){Bt(!oo(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let c=e.replace(/^\/*/,"/"),u=H.useMemo(()=>({basename:c,navigator:l,static:f,useTransitions:m,future:{}}),[c,l,f,m]);typeof r=="string"&&(r=so(r));let{pathname:h="/",search:y="",hash:g="",state:C=null,key:E="default",mask:A}=r,T=H.useMemo(()=>{let p=zr(h,c);return p==null?null:{location:{pathname:p,search:y,hash:g,state:C,key:E,mask:A},navigationType:a}},[c,h,y,g,C,E,a,A]);return qi(T!=null,`<Router basename="${c}"> is not able to match the URL "${h}${y}${g}" because it does not start with the basename, so the <Router> won't render anything.`),T==null?null:H.createElement(fi.Provider,{value:u},H.createElement($l.Provider,{children:n,value:T}))}function o5({children:e,location:n}){return KE(_p(e),n)}function _p(e,n=[]){let r=[];return H.Children.forEach(e,(a,l)=>{if(!H.isValidElement(a))return;let f=[...n,l];if(a.type===H.Fragment){r.push.apply(r,_p(a.props.children,f));return}Bt(a.type===Ws,`[${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>`),Bt(!a.props.index||!a.props.children,"An index route cannot have child routes.");let m={id:a.props.id||f.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=_p(a.props.children,f)),r.push(m)}),r}var wu="get",Cu="application/x-www-form-urlencoded";function nh(e){return typeof HTMLElement<"u"&&e instanceof HTMLElement}function l5(e){return nh(e)&&e.tagName.toLowerCase()==="button"}function c5(e){return nh(e)&&e.tagName.toLowerCase()==="form"}function u5(e){return nh(e)&&e.tagName.toLowerCase()==="input"}function h5(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function d5(e,n){return e.button===0&&(!n||n==="_self")&&!h5(e)}var ru=null;function f5(){if(ru===null)try{new FormData(document.createElement("form"),0),ru=!1}catch{ru=!0}return ru}var p5=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function xf(e){return e!=null&&!p5.has(e)?(qi(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Cu}"`),null):e}function g5(e,n){let r,a,l,f,m;if(c5(e)){let c=e.getAttribute("action");a=c?zr(c,n):null,r=e.getAttribute("method")||wu,l=xf(e.getAttribute("enctype"))||Cu,f=new FormData(e)}else if(l5(e)||u5(e)&&(e.type==="submit"||e.type==="image")){let c=e.form;if(c==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let u=e.getAttribute("formaction")||c.getAttribute("action");if(a=u?zr(u,n):null,r=e.getAttribute("formmethod")||c.getAttribute("method")||wu,l=xf(e.getAttribute("formenctype"))||xf(c.getAttribute("enctype"))||Cu,f=new FormData(c,e),!f5()){let{name:h,type:y,value:g}=e;if(y==="image"){let C=h?`${h}.`:"";f.append(`${C}x`,"0"),f.append(`${C}y`,"0")}else h&&f.append(h,g)}}else{if(nh(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');r=wu,a=null,l=Cu,m=e}return f&&l==="text/plain"&&(m=f,f=void 0),{action:a,method:r.toLowerCase(),encType:l,formData:f,body:m}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function Cg(e,n){if(e===!1||e===null||typeof e>"u")throw new Error(n)}function qy(e,n,r,a){let l=typeof e=="string"?new URL(e,typeof window>"u"?"server://singlefetch/":window.location.origin):e;return r?l.pathname.endsWith("/")?l.pathname=`${l.pathname}_.${a}`:l.pathname=`${l.pathname}.${a}`:l.pathname==="/"?l.pathname=`_root.${a}`:n&&zr(l.pathname,n)==="/"?l.pathname=`${zu(n)}/_root.${a}`:l.pathname=`${zu(l.pathname)}.${a}`,l}async function m5(e,n){if(e.id in n)return n[e.id];try{let r=await import(e.module);return n[e.id]=r,r}catch(r){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(r),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function _5(e){return e==null?!1:e.href==null?e.rel==="preload"&&typeof e.imageSrcSet=="string"&&typeof e.imageSizes=="string":typeof e.rel=="string"&&typeof e.href=="string"}async function v5(e,n,r){let a=await Promise.all(e.map(async l=>{let f=n.routes[l.route.id];if(f){let m=await m5(f,r);return m.links?m.links():[]}return[]}));return w5(a.flat(1).filter(_5).filter(l=>l.rel==="stylesheet"||l.rel==="preload").map(l=>l.rel==="stylesheet"?{...l,rel:"prefetch",as:"style"}:{...l,rel:"prefetch"}))}function tb(e,n,r,a,l,f){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 f==="assets"?n.filter((u,h)=>m(u,h)||c(u,h)):f==="data"?n.filter((u,h)=>{let y=a.routes[u.route.id];if(!y||!y.hasLoader)return!1;if(m(u,h)||c(u,h))return!0;if(u.route.shouldRevalidate){let g=u.route.shouldRevalidate({currentUrl:new URL(l.pathname+l.search+l.hash,window.origin),currentParams:r[0]?.params||{},nextUrl:new URL(e,window.origin),nextParams:u.params,defaultShouldRevalidate:!0});if(typeof g=="boolean")return g}return!0}):[]}function b5(e,n,{includeHydrateFallback:r}={}){return y5(e.map(a=>{let l=n.routes[a.route.id];if(!l)return[];let f=[l.module];return l.clientActionModule&&(f=f.concat(l.clientActionModule)),l.clientLoaderModule&&(f=f.concat(l.clientLoaderModule)),r&&l.hydrateFallbackModule&&(f=f.concat(l.hydrateFallbackModule)),l.imports&&(f=f.concat(l.imports)),f}).flat(1))}function y5(e){return[...new Set(e)]}function S5(e){let n={},r=Object.keys(e).sort();for(let a of r)n[a]=e[a];return n}function w5(e,n){let r=new Set;return new Set(n),e.reduce((a,l)=>{let f=JSON.stringify(S5(l));return r.has(f)||(r.add(f),a.push({key:f,link:l})),a},[])}function xg(){let e=H.useContext(ao);return Cg(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function C5(){let e=H.useContext(th);return Cg(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var Eg=H.createContext(void 0);Eg.displayName="FrameworkContext";function Tg(){let e=H.useContext(Eg);return Cg(e,"You must render this element inside a <HydratedRouter> element"),e}function x5(e,n){let r=H.useContext(Eg),[a,l]=H.useState(!1),[f,m]=H.useState(!1),{onFocus:c,onBlur:u,onMouseEnter:h,onMouseLeave:y,onTouchStart:g}=n,C=H.useRef(null);H.useEffect(()=>{if(e==="render"&&m(!0),e==="viewport"){let T=v=>{v.forEach(d=>{m(d.isIntersecting)})},p=new IntersectionObserver(T,{threshold:.5});return C.current&&p.observe(C.current),()=>{p.disconnect()}}},[e]),H.useEffect(()=>{if(a){let T=setTimeout(()=>{m(!0)},100);return()=>{clearTimeout(T)}}},[a]);let E=()=>{l(!0)},A=()=>{l(!1),m(!1)};return r?e!=="intent"?[f,C,{}]:[f,C,{onFocus:ll(c,E),onBlur:ll(u,A),onMouseEnter:ll(h,E),onMouseLeave:ll(y,A),onTouchStart:ll(g,E)}]:[!1,C,{}]}function ll(e,n){return r=>{e&&e(r),r.defaultPrevented||n(r)}}function E5({page:e,...n}){let r=zE(),{router:a}=xg(),l=H.useMemo(()=>Ry(a.routes,e,a.basename),[a.routes,e,a.basename]);return l?r?H.createElement(A5,{page:e,matches:l,...n}):H.createElement(k5,{page:e,matches:l,...n}):null}function T5(e){let{manifest:n,routeModules:r}=Tg(),[a,l]=H.useState([]);return H.useEffect(()=>{let f=!1;return v5(e,n,r).then(m=>{f||l(m)}),()=>{f=!0}},[e,n,r]),a}function A5({page:e,matches:n,...r}){let a=Li(),{future:l}=Tg(),{basename:f}=xg(),m=H.useMemo(()=>{if(e===a.pathname+a.search+a.hash)return[];let c=qy(e,f,l.v8_trailingSlashAwareDataRequests,"rsc"),u=!1,h=[];for(let y of n)typeof y.route.shouldRevalidate=="function"?u=!0:h.push(y.route.id);return u&&h.length>0&&c.searchParams.set("_routes",h.join(",")),[c.pathname+c.search]},[f,l.v8_trailingSlashAwareDataRequests,e,a,n]);return H.createElement(H.Fragment,null,m.map(c=>H.createElement("link",{key:c,rel:"prefetch",as:"fetch",href:c,...r})))}function k5({page:e,matches:n,...r}){let a=Li(),{future:l,manifest:f,routeModules:m}=Tg(),{basename:c}=xg(),{loaderData:u,matches:h}=C5(),y=H.useMemo(()=>tb(e,n,h,f,a,"data"),[e,n,h,f,a]),g=H.useMemo(()=>tb(e,n,h,f,a,"assets"),[e,n,h,f,a]),C=H.useMemo(()=>{if(e===a.pathname+a.search+a.hash)return[];let T=new Set,p=!1;if(n.forEach(d=>{let b=f.routes[d.route.id];!b||!b.hasLoader||(!y.some(x=>x.route.id===d.route.id)&&d.route.id in u&&m[d.route.id]?.shouldRevalidate||b.hasClientLoader?p=!0:T.add(d.route.id))}),T.size===0)return[];let v=qy(e,c,l.v8_trailingSlashAwareDataRequests,"data");return p&&T.size>0&&v.searchParams.set("_routes",n.filter(d=>T.has(d.route.id)).map(d=>d.route.id).join(",")),[v.pathname+v.search]},[c,l.v8_trailingSlashAwareDataRequests,u,a,f,y,n,e,m]),E=H.useMemo(()=>b5(g,f),[g,f]),A=T5(g);return H.createElement(H.Fragment,null,C.map(T=>H.createElement("link",{key:T,rel:"prefetch",as:"fetch",href:T,...r})),E.map(T=>H.createElement("link",{key:T,rel:"modulepreload",href:T,...r})),A.map(({key:T,link:p})=>H.createElement("link",{key:T,nonce:r.nonce,...p,crossOrigin:p.crossOrigin??r.crossOrigin})))}function R5(...e){return n=>{e.forEach(r=>{typeof r=="function"?r(n):r!=null&&(r.current=n)})}}var L5=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{L5&&(window.__reactRouterVersion="7.17.0")}catch{}function M5({basename:e,children:n,useTransitions:r,window:a}){let l=H.useRef();l.current==null&&(l.current=uE({window:a,v5Compat:!0}));let f=l.current,[m,c]=H.useState({action:f.action,location:f.location}),u=H.useCallback(h=>{r===!1?c(h):H.startTransition(()=>c(h))},[r]);return H.useLayoutEffect(()=>f.listen(u),[f,u]),H.createElement(a5,{basename:e,children:n,location:m.location,navigationType:m.action,navigator:f,useTransitions:r})}var Wy=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Dl=H.forwardRef(function({onClick:n,discover:r="render",prefetch:a="none",relative:l,reloadDocument:f,replace:m,mask:c,state:u,target:h,to:y,preventScrollReset:g,viewTransition:C,defaultShouldRevalidate:E,...A},T){let{basename:p,navigator:v,useTransitions:d}=H.useContext(fi),b=typeof y=="string"&&Wy.test(y),x=Ny(y,p);y=x.to;let L=WE(y,{relative:l}),R=Li(),M=null;if(c){let te=eh(c,[],R.mask?R.mask.pathname:"/",!0);p!=="/"&&(te.pathname=te.pathname==="/"?p:Fi([p,te.pathname])),M=v.createHref(te)}let[k,O,U]=x5(a,A),F=N5(y,{replace:m,mask:c,state:u,target:h,preventScrollReset:g,relative:l,viewTransition:C,defaultShouldRevalidate:E,useTransitions:d});function G(te){n&&n(te),te.defaultPrevented||F(te)}let I=!(x.isExternal||f),K=H.createElement("a",{...A,...U,href:(I?M:void 0)||x.absoluteURL||L,onClick:I?G:n,ref:R5(T,O),target:h,"data-discover":!b&&r==="render"?"true":void 0});return k&&!b?H.createElement(H.Fragment,null,K,H.createElement(E5,{page:L})):K});Dl.displayName="Link";var vp=H.forwardRef(function({"aria-current":n="page",caseSensitive:r=!1,className:a="",end:l=!1,style:f,to:m,viewTransition:c,children:u,...h},y){let g=Hl(m,{relative:h.relative}),C=Li(),E=H.useContext(th),{navigator:A,basename:T}=H.useContext(fi),p=E!=null&&$5(g)&&c===!0,v=A.encodeLocation?A.encodeLocation(g).pathname:g.pathname,d=C.pathname,b=E&&E.navigation&&E.navigation.location?E.navigation.location.pathname:null;r||(d=d.toLowerCase(),b=b?b.toLowerCase():null,v=v.toLowerCase()),b&&T&&(b=zr(b,T)||b);const x=v!=="/"&&v.endsWith("/")?v.length-1:v.length;let L=d===v||!l&&d.startsWith(v)&&d.charAt(x)==="/",R=b!=null&&(b===v||!l&&b.startsWith(v)&&b.charAt(v.length)==="/"),M={isActive:L,isPending:R,isTransitioning:p},k=L?n:void 0,O;typeof a=="function"?O=a(M):O=[a,L?"active":null,R?"pending":null,p?"transitioning":null].filter(Boolean).join(" ");let U=typeof f=="function"?f(M):f;return H.createElement(Dl,{...h,"aria-current":k,className:O,ref:y,style:U,to:m,viewTransition:c},typeof u=="function"?u(M):u)});vp.displayName="NavLink";var D5=H.forwardRef(({discover:e="render",fetcherKey:n,navigate:r,reloadDocument:a,replace:l,state:f,method:m=wu,action:c,onSubmit:u,relative:h,preventScrollReset:y,viewTransition:g,defaultShouldRevalidate:C,...E},A)=>{let{useTransitions:T}=H.useContext(fi),p=j5(),v=z5(c,{relative:h}),d=m.toLowerCase()==="get"?"get":"post",b=typeof c=="string"&&Wy.test(c),x=L=>{if(u&&u(L),L.defaultPrevented)return;L.preventDefault();let R=L.nativeEvent.submitter,M=R?.getAttribute("formmethod")||m,k=()=>p(R||L.currentTarget,{fetcherKey:n,method:M,navigate:r,replace:l,state:f,relative:h,preventScrollReset:y,viewTransition:g,defaultShouldRevalidate:C});T&&r!==!1?H.startTransition(()=>k()):k()};return H.createElement("form",{ref:A,method:d,action:v,onSubmit:a?u:x,...E,"data-discover":!b&&e==="render"?"true":void 0})});D5.displayName="Form";function O5(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Gy(e){let n=H.useContext(ao);return Bt(n,O5(e)),n}function N5(e,{target:n,replace:r,mask:a,state:l,preventScrollReset:f,relative:m,viewTransition:c,defaultShouldRevalidate:u,useTransitions:h}={}){let y=Pl(),g=Li(),C=Hl(e,{relative:m});return H.useCallback(E=>{if(d5(E,n)){E.preventDefault();let A=r!==void 0?r:Ml(g)===Ml(C),T=()=>y(e,{replace:A,mask:a,state:l,preventScrollReset:f,relative:m,viewTransition:c,defaultShouldRevalidate:u});h?H.startTransition(()=>T()):T()}},[g,y,C,r,a,l,n,e,f,m,c,u,h])}var B5=0,I5=()=>`__${String(++B5)}__`;function j5(){let{router:e}=Gy("useSubmit"),{basename:n}=H.useContext(fi),r=n5(),a=e.fetch,l=e.navigate;return H.useCallback(async(f,m={})=>{let{action:c,method:u,encType:h,formData:y,body:g}=g5(f,n);if(m.navigate===!1){let C=m.fetcherKey||I5();await a(C,r,m.action||c,{defaultShouldRevalidate:m.defaultShouldRevalidate,preventScrollReset:m.preventScrollReset,formData:y,body:g,formMethod:m.method||u,formEncType:m.encType||h,flushSync:m.flushSync})}else await l(m.action||c,{defaultShouldRevalidate:m.defaultShouldRevalidate,preventScrollReset:m.preventScrollReset,formData:y,body:g,formMethod:m.method||u,formEncType:m.encType||h,replace:m.replace,state:m.state,fromRouteId:r,flushSync:m.flushSync,viewTransition:m.viewTransition})},[a,l,n,r])}function z5(e,{relative:n}={}){let{basename:r}=H.useContext(fi),a=H.useContext(rr);Bt(a,"useFormAction must be used inside a RouteContext");let[l]=a.matches.slice(-1),f={...Hl(e||".",{relative:n})},m=Li();if(e==null){f.search=m.search;let c=new URLSearchParams(f.search),u=c.getAll("index");if(u.some(y=>y==="")){c.delete("index"),u.filter(g=>g).forEach(g=>c.append("index",g));let y=c.toString();f.search=y?`?${y}`:""}}return(!e||e===".")&&l.route.index&&(f.search=f.search?f.search.replace(/^\?/,"?index&"):"?index"),r!=="/"&&(f.pathname=f.pathname==="/"?r:Fi([r,f.pathname])),Ml(f)}function $5(e,{relative:n}={}){let r=H.useContext(jy);Bt(r!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:a}=Gy("useViewTransitionState"),l=Hl(e,{relative:n});if(!r.isTransitioning)return!1;let f=zr(r.currentLocation.pathname,a)||r.currentLocation.pathname,m=zr(r.nextLocation.pathname,a)||r.nextLocation.pathname;return ju(l.pathname,m)!=null||ju(l.pathname,f)!=null}var P5=ky();const H5="fleet-console.canvas.",Ky="fleet-console.canvas.backgroundAnimation",Vy="fleet-console.canvas.maximized",Yy="fleet-console.canvas.dockExpanded",U5=400,bp=640,yp=400,nb=40,ib=96,F5=.25,q5=1,Ef=.2,rb=.5,W5=.001,Ka={x:0,y:0,zoom:1},Za={viewport:Ka,panels:{},minimized:[]},Sp=new Set,wp=new Set,Cp=new Set,xp=new Set;let Ol=null,ys=null,_t=Za,xu=bT(),El=ST(),Eu=CT(),bs=Ka,Ys=null,io=0;function Xy(e){return Sp.add(e),()=>{Sp.delete(e)}}function sb(){return _t}function G5(){return H.useSyncExternalStore(Xy,sb,sb)}function K5(){return H.useSyncExternalStore(lT,ab,ab)}function Zy(){return H.useSyncExternalStore(uT,ob,ob)}function V5(){return H.useSyncExternalStore(Xy,lb,lb)}function Y5(){return H.useSyncExternalStore(dT,cb,cb)}function tr(e){_t={viewport:e.viewport??_t.viewport,panels:e.panels??_t.panels,minimized:e.minimized??_t.minimized},gT(),Jy()}function Tu(e){Ag();const n=kg(e);bs=n,tr({viewport:n})}function X5(e){const n=kg(e);if(typeof window>"u"||typeof window.requestAnimationFrame!="function"||pT()){Tu(n);return}bs=n,Ys===null&&(Ys=window.requestAnimationFrame(Qy))}function Tl(e,n){const r=lo();tr({panels:{..._t.panels,[e]:{...Rg(n,r),zIndex:r}}})}function Z5(e){_t.minimized.includes(e)||tr({minimized:[..._t.minimized,e]})}function J5(e){if(!_t.minimized.includes(e))return;const n=_t.minimized.filter(l=>l!==e),r=_t.panels[e];if(!r){tr({minimized:n});return}const a=lo();tr({minimized:n,panels:{..._t.panels,[e]:{...r,zIndex:a}}})}function lo(){return io+=1,io}function Q5(e){io=Math.max(io,e)}function eT(e){const n=_t.panels[e];if(n)return n;const r=Object.keys(_t.panels).length,a={x:r*nb,y:r*nb,width:bp,height:yp,zIndex:lo()};return tr({panels:{..._t.panels,[e]:a}}),a}function tT(e){const n=new Set(e),r={};let a=!1;for(const[m,c]of Object.entries(_t.panels))n.has(m)?r[m]=c:a=!0;const l=_t.minimized.filter(m=>n.has(m)),f=l.length!==_t.minimized.length;(a||f)&&tr({panels:r,minimized:l})}function nT(e){mT(),Ag(),Ol=e,_t=e?vT(e):Za,bs=_t.viewport,io=Math.max(io,nS(_t.panels)),Jy()}function iT(e,n){const r=_t.panels[e];if(!r)return;const a=Math.max(F5,Math.min(q5,Math.min((n.width-ib)/r.width,(n.height-ib)/r.height))),l={x:n.width/2-(r.x+r.width/2)*a,y:n.height/2-(r.y+r.height/2)*a,zoom:a};Ag(),bs=l;const f=lo(),m=_t.minimized.includes(e);tr({viewport:l,panels:{..._t.panels,[e]:{...Rg(r,f),zIndex:f}},...m?{minimized:_t.minimized.filter(c=>c!==e)}:{}})}function rT(){xu=!xu,yT(xu),cT()}function sT(){aT(!El)}function aT(e){El!==e&&(El=e,wT(El),hT())}function oT(){Eu=!Eu,xT(Eu),fT()}function lT(e){return wp.add(e),()=>{wp.delete(e)}}function ab(){return xu}function Jy(){for(const e of Sp)e()}function cT(){for(const e of wp)e()}function uT(e){return Cp.add(e),()=>{Cp.delete(e)}}function ob(){return El}function lb(){return _t.minimized}function hT(){for(const e of Cp)e()}function dT(e){return xp.add(e),()=>{xp.delete(e)}}function cb(){return Eu}function fT(){for(const e of xp)e()}function Qy(){const e=_t.viewport,n=bs.x-e.x,r=bs.y-e.y,a=bs.zoom-e.zoom;if(Math.abs(n)<rb&&Math.abs(r)<rb&&Math.abs(a)<W5){Ys=null,tr({viewport:bs});return}tr({viewport:{x:e.x+n*Ef,y:e.y+r*Ef,zoom:e.zoom+a*Ef}}),Ys=typeof window<"u"?window.requestAnimationFrame(Qy):null}function Ag(){Ys===null||typeof window>"u"||(window.cancelAnimationFrame(Ys),Ys=null)}function pT(){return typeof window>"u"||typeof window.matchMedia!="function"?!1:window.matchMedia("(prefers-reduced-motion: reduce)").matches}function gT(){!Ol||typeof window>"u"||(_T(),ys=window.setTimeout(()=>{ys=null,eS(Ol,_t)},U5))}function mT(){!ys||!Ol||typeof window>"u"||(window.clearTimeout(ys),ys=null,eS(Ol,_t))}function _T(){!ys||typeof window>"u"||(window.clearTimeout(ys),ys=null)}function vT(e){if(typeof window>"u")return Za;try{const n=window.localStorage.getItem(tS(e));if(!n)return Za;const r=JSON.parse(n);return ET(r)}catch{return Za}}function eS(e,n){if(!(!e||typeof window>"u"))try{window.localStorage.setItem(tS(e),JSON.stringify(n))}catch{}}function bT(){if(typeof window>"u")return!0;try{const e=window.localStorage.getItem(Ky);return e===null?!0:e==="true"}catch{return!0}}function yT(e){if(!(typeof window>"u"))try{window.localStorage.setItem(Ky,String(e))}catch{}}function ST(){if(typeof window>"u")return!1;try{return window.localStorage.getItem(Vy)==="true"}catch{return!1}}function wT(e){if(!(typeof window>"u"))try{window.localStorage.setItem(Vy,String(e))}catch{}}function CT(){if(typeof window>"u")return!0;try{const e=window.localStorage.getItem(Yy);return e===null?!0:e==="true"}catch{return!0}}function xT(e){if(!(typeof window>"u"))try{window.localStorage.setItem(Yy,String(e))}catch{}}function tS(e){return`${H5}${e}`}function ET(e){if(!Nl(e))return Za;const n=AT(e.panels);return{viewport:kg(e.viewport),panels:n,minimized:TT(e.minimized,n)}}function TT(e,n){if(!Array.isArray(e))return[];const r=new Set,a=[];for(const l of e)typeof l!="string"||r.has(l)||!(l in n)||(r.add(l),a.push(l));return a}function kg(e){if(!Nl(e))return Ka;const n=Al(e.x,Ka.x),r=Al(e.y,Ka.y),a=Ep(e.zoom,Ka.zoom);return{x:n,y:r,zoom:a}}function AT(e){if(!Nl(e))return{};const n={};for(const[r,a]of Object.entries(e))Nl(a)&&(n[r]=Rg(a,kT(n)));return n}function Rg(e,n){return Nl(e)?{x:Al(e.x,0),y:Al(e.y,0),width:Ep(e.width,bp),height:Ep(e.height,yp),zIndex:Al(e.zIndex,n)}:{x:0,y:0,width:bp,height:yp,zIndex:n}}function kT(e){return nS(e)+1}function nS(e){return Math.max(0,...Object.values(e).map(n=>n.zIndex))}function Al(e,n){return typeof e=="number"&&Number.isFinite(e)?e:n}function Ep(e,n){return typeof e=="number"&&Number.isFinite(e)&&e>0?e:n}function Nl(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const iS="fleet-console.codex.view-mode",rS="fleet-console.codex.side-width",Tf="route",yl=460,RT=120,Tp=new Set;let Ap=NT(),kp=BT(),sS=!1;function LT(){return H.useSyncExternalStore(Lg,ub,ub)}function MT(e){if(sS=!0,Ap===e){Rp();return}Ap=e,lS(iS,e),Rp()}function DT(){return H.useSyncExternalStore(Lg,db,db)}function aS(){return H.useSyncExternalStore(Lg,hb,hb)}function OT(e){const n=oS(e);kp!==n&&(kp=n,lS(rS,String(n)),Rp())}function Lg(e){return Tp.add(e),()=>{Tp.delete(e)}}function ub(){return Ap}function hb(){return kp}function db(){return sS}function Rp(){for(const e of Tp)e()}function oS(e){return Number.isFinite(e)?Math.max(RT,Math.round(e)):yl}function NT(){if(typeof window>"u")return Tf;try{const e=window.localStorage.getItem(iS);return e==="route"||e==="side"?e:Tf}catch{return Tf}}function BT(){if(typeof window>"u")return yl;try{const e=window.localStorage.getItem(rS);if(e===null)return yl;const n=Number.parseInt(e,10);return Number.isNaN(n)?yl:oS(n)}catch{return yl}}function lS(e,n){if(!(typeof window>"u"))try{window.localStorage.setItem(e,n)}catch{}}const IT=["canonicalCwd","cwd","providerSession","ticket","token","transcriptPath"];class Ge extends Error{status;constructor(n,r){super(r),this.name="ApiError",this.status=n}}async function cS(e){const n=await fetch("/observer/tenants",{signal:e});await Nn(n);const r=await n.json();if(!Array.isArray(r.tenants))throw new Ge(n.status,"Invalid tenants response");return r.tenants.map(a=>XT(a,n.status))}async function jT(e){const n=await fetch("/observer/jobs",{signal:e});return await Nn(n),(await n.json()).tenants}async function zT(e){const n=await fetch("/observer/events",{signal:e});if(await Nn(n),!n.body)throw new Ge(n.status,"Observer stream unavailable");return n.body.getReader()}async function uS(e){const n=await fetch("/observer/theaters",{signal:e});await Nn(n);const r=await n.json();if(!Array.isArray(r.theaters))throw new Ge(n.status,"Invalid Theater response");const a=Array.isArray(r.agentClis)?r.agentClis.map(l=>YT(l,n.status)):[];return{theaters:r.theaters.map(l=>mS(l,n.status)),agentClis:a}}async function $T(e,n){const r=e?`?theaterId=${encodeURIComponent(e)}`:"",a=await fetch(`/observer/status${r}`,{signal:n});return await Nn(a),ZT(await a.json(),a.status)}async function PT(e){const n=await fetch("/update/apply",{method:"POST",signal:e});return await Nn(n),JT(await n.json(),n.status)}async function hS(e,n){const r=await fetch("/observer/theaters",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({folderGrantId:e}),signal:n});await Nn(r);const a=await r.json();return mS(a,r.status)}async function fb(e,n,r){const a=await fetch(`/observer/theaters/${encodeURIComponent(e)}/sessions`,{method:"POST",...n?{headers:{"Content-Type":"application/json"},body:JSON.stringify({cliId:n})}:{},signal:r});return await Nn(a),ih(await a.json(),a.status)}async function HT(e,n){const r=await fetch("/terminal/folders/list",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:e}),signal:n});return await Nn(r),KT(await r.json(),r.status)}async function dS(e,n){const r=await fetch("/terminal/folders/grants",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:e}),signal:n});await Nn(r);const a=await r.json();if(typeof a.folderGrantId!="string")throw new Ge(r.status,"Invalid folder grant response");return a.folderGrantId}async function fS(e,n){const r=await fetch(`/terminal/sessions/${encodeURIComponent(e)}`,{method:"DELETE",signal:n});await Nn(r)}async function pS(e,n){const r=await fetch(`/terminal/sessions/${encodeURIComponent(e)}/resume`,{method:"POST",signal:n});return await Nn(r),ih(await r.json(),r.status)}async function UT(e,n){const r=await fetch(`/observer/theaters/${encodeURIComponent(e)}`,{method:"DELETE",signal:n});await Nn(r)}async function FT(e,n){const r=await fetch(`/terminal/sessions/${encodeURIComponent(e)}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({label:n})});return await Nn(r),ih(await r.json(),r.status)}async function qT(e){const n=await fetch("/terminal/sessions",{signal:e});await Nn(n);const r=await n.json();if(!Array.isArray(r.sessions))throw new Ge(n.status,"Invalid terminal sessions response");return r.sessions.map(a=>ih(a,n.status))}async function WT(e,n){const r=GT(n),a=await fetch("/terminal/ticket",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({sessionId:e,...r.kind?{kind:r.kind}:{},...r.theaterId?{theaterId:r.theaterId}:{}}),signal:r.signal});await Nn(a);const l=await a.json();if(typeof l.ticket!="string"||typeof l.ttlMs!="number")throw new Ge(a.status,"Invalid terminal ticket response");return{ticket:l.ticket,ttlMs:l.ttlMs}}function GT(e){return e?e instanceof AbortSignal?{signal:e}:e:{}}function ih(e,n){const r=e;if(!r||typeof r.sessionId!="string"||typeof r.cwdLabel!="string"||typeof r.sequence!="number"||typeof r.status!="string"||typeof r.createdAt!="number"||gS(r))throw new Ge(n,"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,turnState:r.turnState==="running"||r.turnState==="ended"?r.turnState:"none",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 KT(e,n){const r=e;if(!r||typeof r.path!="string"||r.parentPath!==null&&typeof r.parentPath!="string"||!Array.isArray(r.roots)||!r.roots.every(a=>typeof a=="string")||!Array.isArray(r.entries))throw new Ge(n,"Invalid folder list response");return{path:r.path,parentPath:r.parentPath,roots:r.roots,entries:r.entries.map(a=>VT(a,n)),...r.truncated===!0?{truncated:!0}:{}}}function VT(e,n){const r=e;if(!r||typeof r.name!="string"||typeof r.path!="string"||r.kind!=="dir"||typeof r.accessible!="boolean")throw new Ge(n,"Invalid folder list response");return{name:r.name,path:r.path,kind:"dir",accessible:r.accessible}}function YT(e,n){const r=e;if(!r||typeof r.id!="string"||typeof r.label!="string"||typeof r.available!="boolean"||typeof r.signedIn!="boolean")throw new Ge(n,"Invalid Agent CLI metadata response");return{id:r.id,label:r.label,available:r.available,signedIn:r.signedIn}}function XT(e,n){const r=e;if(!r||typeof r.tenantId!="string"||typeof r.tenantLabel!="string"||typeof r.createdAt!="number"||typeof r.sessions!="number"||gS(r))throw new Ge(n,"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 gS(e){return IT.some(n=>n in e)}function ZT(e,n){const r=e;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 Ge(n,"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 JT(e,n){const r=e;if(!r||r.status!=="accepted"||"packageName"in r||"packageVersion"in r||"path"in r||"token"in r)throw new Ge(n,"Invalid update apply response");return{status:"accepted"}}function mS(e,n){const r=e;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 Ge(n,"Invalid Theater response");return{id:r.id,label:r.label,createdAt:r.createdAt,lastOpenedAt:r.lastOpenedAt,hasWiki:r.hasWiki,activeAdmiralCount:r.activeAdmiralCount}}async function Nn(e){if(e.ok)return;let n=e.statusText;try{n=(await e.json()).error??n}catch{}throw new Ge(e.status,n||`HTTP ${e.status}`)}const pb=120,QT="active",Lp=new Set(["done","error","aborted"]);function eA(e,n){let r=vS(e,n.jobId,n.updatedAt);for(const a of n.events)r=_S(r,a);return Lp.has(n.status)&&!Lp.has(r.status)&&(r={...r,status:n.status}),r}function _S(e,n){if(n.id<=e.lastEventId)return e;const r=n.event,a={...e,updatedAt:n.at,lastEventId:n.id,recentEvents:aA(e.recentEvents,n)};switch(n.type){case"job:registered":return rA(a,r);case"job:finalized":return{...a,status:un(r.status)??"done",finishedAt:ps(r.finishedAt)??n.at,summary:un(r.summary),error:un(r.error)};case"track:begin":return Pa(a,r,l=>({...l,startedAt:ps(r.startedAt)??n.at,requestPreview:un(r.requestPreview)}));case"track:status":return Pa(a,r,l=>({...l,status:un(r.status)??l.status}));case"track:text":return Pa(a,r,l=>({...l,status:"stream",text:l.text+(un(r.text)??""),sentTextLength:l.sentTextLength+(ps(r.textLength)??un(r.text)?.length??0)}));case"track:thought":return Pa(a,r,l=>({...l,thought:l.thought+(un(r.text)??""),sentThoughtLength:l.sentThoughtLength+(ps(r.textLength)??un(r.text)?.length??0)}));case"track:tool":return Pa(a,r,l=>({...l,status:"stream",tools:sA(l.tools,r)}));case"track:finalized":return Pa(a,r,l=>{const f=mb(l.text,l.sentTextLength,un(r.fallbackText),ps(r.fallbackTextLength)),m=mb(l.thought,l.sentThoughtLength,un(r.fallbackThought),ps(r.fallbackThoughtLength));return{...l,status:un(r.status)??"done",finishedAt:ps(r.finishedAt)??n.at,error:un(r.error),text:f.text,sentTextLength:f.sentLength,thought:m.text,sentThoughtLength:m.sentLength}});default:return a}}function vS(e,n,r){return{jobId:n,tenantId:e,status:QT,updatedAt:r,trackOrder:[],tracks:{},lastEventId:0,recentEvents:[]}}function Mg(e){return Lp.has(e)}function tA(e){return e.operationsViewActive?new Set:new Set}function nA(e,n){const r=[],a=[];for(const l of e)n.has(l.sessionId)?a.push(l):r.push(l);return{hidden:r,visible:a}}function gb(e){const n=new Map;for(const r of[...e].sort((a,l)=>l.lastRaisedSeq-a.lastRaisedSeq)){const a=r.theaterId??"__unknown__",l=n.get(a)??{theaterId:r.theaterId,theaterLabel:r.theaterLabel,notifications:[],totalCount:0};l.notifications.push(r),l.totalCount+=r.count,n.set(a,l)}return[...n.values()].sort((r,a)=>{const l=r.notifications[0]?.lastRaisedSeq??0;return(a.notifications[0]?.lastRaisedSeq??0)-l})}function iA(e,n){return n.globalMute||n.dnd?[]:e.filter(r=>!r.theaterId||n.mutedTheaterIds[r.theaterId]!==!0)}function rA(e,n){const r=Array.isArray(n.tracks)?n.tracks:[];let a=e.trackOrder,l=e.tracks;for(const f of r){if(!f.trackId)continue;const m=l[f.trackId],c={...m??bS(f.trackId),displayName:f.displayName??m?.displayName??f.trackId,displayCli:f.displayCli??m?.displayCli,model:f.model??m?.model,effort:f.effort??m?.effort,subtitle:f.subtitle??m?.subtitle,kind:f.kind??m?.kind,startedAt:f.startedAt??m?.startedAt};m||(a=[...a,f.trackId]),l={...l,[f.trackId]:c}}return{...e,label:un(n.label)??e.label,ownerCarrierId:un(n.ownerCarrierId)??e.ownerCarrierId,kind:un(n.kind)??e.kind,startedAt:ps(n.startedAt)??e.startedAt,trackOrder:a,tracks:l}}function Pa(e,n,r){const a=un(n.trackId);if(!a)return e;const l=e.tracks[a],f=r(l??bS(a));return{...e,trackOrder:l?e.trackOrder:[...e.trackOrder,a],tracks:{...e.tracks,[a]:f}}}function bS(e){return{trackId:e,displayName:e,status:"queued",text:"",thought:"",sentTextLength:0,sentThoughtLength:0,tools:[]}}function mb(e,n,r,a){const l=a??r?.length??0;return r!==void 0&&l>e.length?{text:r,sentLength:Math.max(l,n)}:{text:e,sentLength:Math.max(n,l)}}function sA(e,n){const r=un(n.title)??"tool",a=un(n.status)??"",l=un(n.toolCallId),f=l??`${r}#${e.length}`;if(l){const m=e.findIndex(c=>c.key===l);if(m>=0){const c=[...e];return c[m]={key:l,title:r,status:a},c}}return[...e,{key:f,title:r,status:a}]}function aA(e,n){const r=[...e,n];return r.length>pb?r.slice(-pb):r}function un(e){return typeof e=="string"?e:void 0}function ps(e){return typeof e=="number"&&Number.isFinite(e)?e:void 0}function yS(e){return new Date(e).toLocaleTimeString([],{hour12:!1})}function Ul(e){return e.label?.trim()||`#${e.sequence} Operation`}function oA(e,n){const r=Math.max(0,Math.round((n-e)/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 Mp(e){return e.length<=14?e:`${e.slice(0,6)}…${e.slice(-6)}`}function lA(e){return e&&e.charAt(0).toUpperCase()+e.slice(1)}function Dp(e){switch(e){case"active":return"running";case"done":return"done";case"error":return"error";case"aborted":return"aborted";default:return e}}function cA(e){switch(e){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 e}}function SS(e,n){return e.status==="dormant"?"tenant-beacon is-dormant":n>0?"tenant-beacon is-live":e.turnState==="running"?"tenant-beacon is-turn-running":e.turnState==="ended"?"tenant-beacon is-turn-ended":"tenant-beacon"}function rh(e){switch(e){case"stream":case"active":case"conn":return"live";case"done":return"ok";case"err":case"error":return"bad";default:return"idle"}}function uA(e){if(e.status!=="active")return null;const n=e.trackOrder.map(l=>e.tracks[l]).filter(l=>!!l),r=n.filter(l=>l.status==="stream"||l.status==="conn"),a=r.length>0?r:n;for(let l=a.length-1;l>=0;l--){const f=a[l],m=f?hA(f):null;if(m)return m}return null}function hA(e){return _b(e.text)??_b(e.thought)??e.tools[e.tools.length-1]?.title??null}function _b(e){if(!e)return null;const n=e.split(`
|
|
12
|
+
`);for(let r=n.length-1;r>=0;r--){const a=n[r]?.trim();if(a)return a}return null}const dA="__unassigned__";function fA(e){const n=new Map(e.theaters.map(a=>[a.id,a])),r=[];for(const a of e.sessionOrder){const l=e.sessions[a];l&&l.theaterId&&r.push(mA(l,n.get(l.theaterId)))}return r}function pA(e,n){const r=wS(n);return r.length===0?e:e.filter(a=>{const l=_A(a);return r.every(f=>l.includes(f))})}function gA(e){const n=[],r=new Map;for(const a of e){const l=a.theaterId??dA,f=r.get(l);if(f!==void 0){const m=n[f];m&&(n[f]={...m,entries:[...m.entries,a]});continue}r.set(l,n.length),n.push({theaterId:a.theaterId,theaterLabel:a.theaterLabel,entries:[a]})}return n}function wS(e){return e.trim().toLocaleLowerCase().split(/\s+/).filter(Boolean)}function mA(e,n){return{sessionId:e.sessionId,theaterId:e.theaterId??null,theaterLabel:n?.label??e.theaterId??"",operationName:Ul(e),cliLabel:e.cliLabel,status:e.status}}function _A(e){return[e.operationName,e.theaterLabel,e.cliLabel??""].join(" ").toLocaleLowerCase()}const vA="fleet-console.canvas.shell.",bA=400,vb=560,bb=360,Op=new Set;let ei={},Js=null,Qs=null,Ss=null;function yA(){return H.useSyncExternalStore(CS,wb,wb)}function SA(){return H.useSyncExternalStore(CS,yb,yb)}function yb(){return Js}function $u(e){Js!==e&&(Js=e,co())}function wA(e,n){const r=LA();return ei={...ei,[r]:{theaterId:e,geometry:n}},Dg(),co(),r}function Af(e,n){const r=ei[e];r&&(ei={...ei,[e]:{...r,geometry:n}},Dg(),co())}function Sb(e){if(!(e in ei))return;const n={...ei};delete n[e],ei=n,Js===e&&(Js=null),Dg(),co()}function CA(e){EA(),Qs=e,ei=e?TA(e):{},Js=null,Q5(RA(ei)),co()}function xA(e){if(typeof window<"u")try{window.sessionStorage.removeItem(Og(e))}catch{}Qs===e&&(xS(),Qs=null,ei={},Js=null,co())}function CS(e){return Op.add(e),()=>{Op.delete(e)}}function wb(){return ei}function co(){for(const e of Op)e()}function Dg(){!Qs||typeof window>"u"||(xS(),Ss=window.setTimeout(()=>{Ss=null,ES(Qs,ei)},bA))}function EA(){!Ss||!Qs||typeof window>"u"||(window.clearTimeout(Ss),Ss=null,ES(Qs,ei))}function xS(){!Ss||typeof window>"u"||(window.clearTimeout(Ss),Ss=null)}function TA(e){if(typeof window>"u")return{};try{const n=window.sessionStorage.getItem(Og(e));return n?AA(JSON.parse(n),e):{}}catch{return{}}}function ES(e,n){if(!(!e||typeof window>"u"))try{window.sessionStorage.setItem(Og(e),JSON.stringify({panels:n}))}catch{}}function Og(e){return`${vA}${e}`}function AA(e,n){if(!Au(e)||!Au(e.panels))return{};const r={};for(const[a,l]of Object.entries(e.panels))!a.startsWith("shell:")||!Au(l)||l.theaterId===n&&(r[a]={theaterId:n,geometry:kA(l.geometry)});return r}function kA(e){return Au(e)?{x:kf(e.x,0),y:kf(e.y,0),width:Cb(e.width,vb),height:Cb(e.height,bb),zIndex:kf(e.zIndex,0)}:{x:0,y:0,width:vb,height:bb,zIndex:0}}function RA(e){return Math.max(0,...Object.values(e).map(n=>n.geometry.zIndex))}function kf(e,n){return typeof e=="number"&&Number.isFinite(e)?e:n}function Cb(e,n){return typeof e=="number"&&Number.isFinite(e)&&e>0?e:n}function Au(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function LA(){return`shell:${typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():`${Date.now().toString(36)}-${Math.random().toString(36).slice(2,10)}`}`}const Pi={version:"1.10.1",date:"2026-06-21",sections:[{heading:"Fixed",items:["All backend API catalog descriptions in the Settings page are now shown in English; the remaining Korean entries have been translated."]}]},Np=200,Bp="fleet-console.activeTheaterId",TS="fleet-console.activeTheme",AS="fleet-console.terminalRenderer",kS="fleet-console.commissioningSeen",RS="fleet-console.whatsNewSeenVersion",LS="fleet-console.notificationPreferences",MS=1,Rf="maritime",Lf="webgl",su={globalMute:!1,dnd:!1,mutedTheaterIds:{}},Ip=new Set;let jp=null,be={connection:"connecting",connectionError:null,activeTheme:KS(),terminalRenderer:IA(),version:"",updateAvailable:!1,latestVersion:null,tenants:[],theaters:[],agentClis:[],activeTheaterId:null,addingTheater:!1,theaterError:null,sessions:{},sessionOrder:[],activeTerminalSessionId:null,operationsViewActive:!1,creatingTerminalSession:!1,terminalSessionError:null,tenantJobs:{},tenantOrder:[],timelineOpen:!1,operationSearchOpen:!1,shortcutsOpen:!1,whatsNewOpen:!1,onboardingOpen:!1,bootstrapped:!1,terminalSessionsHydrated:!1,pendingOperationFocus:null,selectedJobId:null,operationNotifications:{},notificationPreferences:ck()},xb=0;function Eb(){return be}function MA(e){return Ip.add(e),()=>{Ip.delete(e)}}function He(e){be={...be,...e},VS()}function DA(e){be.operationsViewActive!==e&&He({operationsViewActive:e})}function OA(){DS(KS())}function NA(e){dk(e),DS(e),He({activeTheme:e})}function BA(e){fk(e),He({terminalRenderer:e})}function IA(){if(typeof window>"u")return Lf;try{const e=window.localStorage.getItem(AS);return e==="webgl"||e==="dom"?e:Lf}catch{return Lf}}function jA(e){const n=Pi!==null&&Pi.version===e.version&&hk()!==e.version;He({version:e.version,updateAvailable:e.updateAvailable,latestVersion:e.latestVersion??null,whatsNewOpen:n?!0:be.whatsNewOpen})}function DS(e){if(!(typeof document>"u")){if(e==="maritime"){document.documentElement.removeAttribute("data-theme");return}document.documentElement.setAttribute("data-theme",e)}}function zA(e){const n={};for(const l of e)n[l.sessionId]=ah(l);const r=[...e].sort((l,f)=>f.createdAt-l.createdAt).map(l=>l.sessionId),a=WS(n,be.tenants);He({sessions:a,sessionOrder:r,activeTerminalSessionId:ws(be.activeTheaterId,a,r,be.activeTerminalSessionId),terminalSessionsHydrated:!0})}function OS(e){const n=GS(e.theaters,be.activeTheaterId);He({theaters:e.theaters,agentClis:e.agentClis,activeTheaterId:n,activeTerminalSessionId:ws(n,be.sessions,be.sessionOrder,be.activeTerminalSessionId),selectedJobId:null})}function $A(e){lh(e),He({activeTheaterId:e,activeTerminalSessionId:ws(e,be.sessions,be.sessionOrder,null),selectedJobId:null})}function NS(){He({addingTheater:!0,theaterError:null})}function BS(e){const n=[e,...be.theaters.filter(r=>r.id!==e.id)];lh(e.id),He({theaters:n,activeTheaterId:e.id,addingTheater:!1,theaterError:null,activeTerminalSessionId:ws(e.id,be.sessions,be.sessionOrder,null),selectedJobId:null})}function PA(){He({addingTheater:!1,theaterError:null})}function zp(e){He({addingTheater:!1,theaterError:e})}function Hi(e){He({activeTerminalSessionId:e,selectedJobId:null,operationNotifications:e?oh(be.operationNotifications,e):be.operationNotifications})}function Ng(e){const n=be.sessions[e];n&&(lh(n.theaterId??null),He({activeTheaterId:n.theaterId??null,activeTerminalSessionId:e,selectedJobId:null,pendingOperationFocus:e,operationNotifications:oh(be.operationNotifications,e)}))}function Tb(){be.pendingOperationFocus!==null&&He({pendingOperationFocus:null})}function HA(e,n,r){if(e.length===0)return null;const a=n?e.indexOf(n):-1,l=a===-1?r>0?0:e.length-1:(a+r+e.length)%e.length;return e[l]??null}function Mf(){He({operationSearchOpen:!1})}function UA(){He({operationSearchOpen:!be.operationSearchOpen})}function Ab(){He({creatingTerminalSession:!0,terminalSessionError:null})}function kb(e){const n=ah(e);He({sessions:{...be.sessions,[n.sessionId]:n},sessionOrder:[n.sessionId,...be.sessionOrder.filter(r=>r!==n.sessionId)],activeTerminalSessionId:!be.activeTheaterId||Hu(n,be.activeTheaterId)?n.sessionId:be.activeTerminalSessionId,creatingTerminalSession:!1,terminalSessionError:null,selectedJobId:null})}function sh(e){const n=be.sessions[e.sessionId],r=ah({...n??{},...e}),a=!!n,l={...be.sessions,[r.sessionId]:r},f=a?be.sessionOrder:[r.sessionId,...be.sessionOrder.filter(c=>c!==r.sessionId)],m=n?sk(be.operationNotifications,n,r):be.operationNotifications;He({sessions:l,sessionOrder:f,activeTerminalSessionId:ws(be.activeTheaterId,l,f,be.activeTerminalSessionId),operationNotifications:m})}function FA(e,n){const r=be.sessions[e.sessionId]??ah(e);n==="idle_prompt"&&qS(r)||He({operationNotifications:FS(be.operationNotifications,US("input-waiting",r))})}function qA(e){const n={...be.notificationPreferences,globalMute:e};Ig(n),He({notificationPreferences:n})}function WA(e){const n={...be.notificationPreferences,dnd:e};Ig(n),He({notificationPreferences:n})}function GA(e){const n={...be.notificationPreferences.mutedTheaterIds};n[e]?delete n[e]:n[e]=!0;const r={...be.notificationPreferences,mutedTheaterIds:n};Ig(r),He({notificationPreferences:r})}function Rb(e){He({creatingTerminalSession:!1,terminalSessionError:e})}function KA(){He({timelineOpen:!be.timelineOpen})}function VA(){be.shortcutsOpen||He({shortcutsOpen:!0})}function Df(){be.shortcutsOpen&&He({shortcutsOpen:!1})}function YA(){Pi===null||be.whatsNewOpen||He({whatsNewOpen:!0})}function au(){be.whatsNewOpen&&(be.version&&gk(be.version),He({whatsNewOpen:!1}))}function cl(){pk(!0),be.onboardingOpen&&He({onboardingOpen:!1})}function Lb(){if(be.bootstrapped)return;const e=be.theaters.length===0&&!uk();He({bootstrapped:!0,onboardingOpen:e?!0:be.onboardingOpen})}function IS(e){He({terminalSessionError:e})}function jS(e){He({terminalSessionError:e})}function XA(e){He({terminalSessionError:e})}function Mb(e){xA(e);const n=be.theaters.filter(m=>m.id!==e),r={},a=[];for(const m of be.sessionOrder){const c=be.sessions[m];!c||c.theaterId===e||(r[m]=c,a.push(m))}const l=GS(n,be.activeTheaterId===e?null:be.activeTheaterId),f=ak(be.operationNotifications,e);lh(l),He({theaters:n,sessions:r,sessionOrder:a,activeTheaterId:l,activeTerminalSessionId:ws(l,r,a,be.activeTerminalSessionId),selectedJobId:null,operationNotifications:f})}function zS(e){if(!be.sessions[e])return;const n={...be.sessions};delete n[e];const r=be.sessionOrder.filter(l=>l!==e),a=be.activeTerminalSessionId===e;He({sessions:n,sessionOrder:r,activeTerminalSessionId:a?ws(be.activeTheaterId,n,r,null):be.activeTerminalSessionId,selectedJobId:a?null:be.selectedJobId,operationNotifications:oh(be.operationNotifications,e)})}function $S(e){He({selectedJobId:be.selectedJobId===e?null:e})}function Of(){He({selectedJobId:null})}function PS(e){const n=new Set(e.map(l=>l.tenantId)),r=WS(be.sessions,e),a=[...e.map(l=>l.tenantId),...be.tenantOrder.filter(l=>!n.has(l)&&be.tenantJobs[l])];He({tenants:e,sessions:r,tenantOrder:a,activeTerminalSessionId:ws(be.activeTheaterId,r,be.sessionOrder,be.activeTerminalSessionId)})}function ZA(e){const n={},r=[];for(const l of e){const f={};for(const c of l.jobs)f[c.jobId]=eA(l.tenantId,c);const m=Object.values(f).sort((c,u)=>(c.startedAt??c.updatedAt)-(u.startedAt??u.updatedAt)).map(c=>c.jobId);n[l.tenantId]={tenantId:l.tenantId,tenantLabel:l.tenantLabel,jobOrder:m,jobs:f,truncation:l.truncation},r.push(l.tenantId)}const a=[...be.tenantOrder.filter(l=>n[l]),...r.filter(l=>!be.tenantOrder.includes(l))];He({tenantJobs:n,tenantOrder:a.length>0?a:r})}function JA(e,n){const r=be.tenantJobs[e.tenantId],a=!r&&!be.tenants.some(c=>c.tenantId===e.tenantId),l=r??{tenantId:e.tenantId,tenantLabel:n,jobOrder:[],jobs:{},truncation:{droppedCount:0}};let f=n&&l.tenantLabel!==n?{...l,tenantLabel:n}:l;if(e.jobId){const c=f.jobs[e.jobId],u=_S(c??vS(e.tenantId,e.jobId,e.at),e),h=c?f.jobOrder:[...f.jobOrder,e.jobId];f={...f,jobs:mk({...f.jobs,[e.jobId]:u},h),jobOrder:h.slice(-Np)}}const m={...be.tenantJobs,[e.tenantId]:f};return be={...be,connection:"live",connectionError:null,tenantJobs:m,tenantOrder:be.tenantOrder.includes(e.tenantId)?be.tenantOrder:[...be.tenantOrder,e.tenantId]},VS(),{unknownTenant:a}}function QA(e,n,r){const a=be.tenantJobs[e]??{tenantId:e,tenantLabel:n,jobOrder:[],jobs:{},truncation:{droppedCount:0}};He({tenantJobs:{...be.tenantJobs,[e]:{...a,truncation:r}},tenantOrder:be.tenantOrder.includes(e)?be.tenantOrder:[...be.tenantOrder,e]})}function ek(e){if(!e.selectedJobId||e.activeTheaterId&&e.activeTerminalSessionId&&!Pu(e).includes(e.activeTerminalSessionId))return null;const n=tk(e);return n?e.tenantJobs[n]?.jobs[e.selectedJobId]??null:null}function tk(e){return e.activeTerminalSessionId?Bg(e.sessions[e.activeTerminalSessionId]):null}function nk(e){return Pu(e).map(n=>e.sessions[n]).filter(n=>!!n)}function Pu(e){return e.activeTheaterId?e.sessionOrder.filter(n=>Hu(e.sessions[n],e.activeTheaterId)):[]}function ik(e){return fA(e)}function HS(e,n){const r=Bg(n);if(!r)return[];const a=e.tenantJobs[r];if(!a)return[];const l=[];for(const f of a.jobOrder){const m=a.jobs[f];m&&l.push({job:m,tenant:a})}return l}function Bg(e){return e?.tenantId??e?.sessionId??null}function ah(e){return{...e,terminalSessionId:e.terminalSessionId??e.sessionId,status:e.status==="starting"&&e.tenantId?"registered":e.status,turnState:e.turnState??"none",resumeAvailable:e.resumeAvailable===!0}}function rk(e){return e?be.theaters.find(n=>n.id===e)?.label??e:"—"}function US(e,n){return xb+=1,{kind:e,sessionId:n.sessionId,theaterId:n.theaterId??null,theaterLabel:rk(n.theaterId),operationLabel:Ul(n),count:1,lastRaisedSeq:xb}}function sk(e,n,r){return n.turnState!=="running"&&r.turnState==="running"?oh(e,r.sessionId):n.turnState!=="ended"&&r.turnState==="ended"&&!qS(r)?FS(e,US("ended",r)):e}function FS(e,n){const r=e[n.sessionId];return{...e,[n.sessionId]:{...n,count:r?.kind==="input-waiting"&&n.kind==="input-waiting"?r.count+1:1}}}function oh(e,n){if(!e[n])return e;const r={...e};return delete r[n],r}function ak(e,n){let r=!1;const a={};for(const[l,f]of Object.entries(e)){if(f.theaterId===n){r=!0;continue}a[l]=f}return r?a:e}function qS(e){const n=Bg(e);return n?ok(be.tenantJobs[n]):!1}function ok(e){return e?e.jobOrder.some(n=>{const r=e.jobs[n];return r?!r.finishedAt&&!Mg(r.status):!1}):!1}function WS(e,n){const r={...e};for(const a of n){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 GS(e,n){const r=new Set(e.map(l=>l.id)),a=lk();return a&&r.has(a)?a:n&&r.has(n)?n:e[0]?.id??null}function ws(e,n,r,a){return e?a&&Hu(n[a],e)&&ou(n[a])?a:r.find(l=>Hu(n[l],e)&&ou(n[l]))??null:a&&n[a]&&ou(n[a])?a:r.find(l=>ou(n[l]))??null}function Hu(e,n){return!e||!n?!1:e.theaterId===n}function ou(e){return!!(e&&e.status!=="dormant")}function lk(){if(typeof window>"u")return null;try{return window.localStorage.getItem(Bp)}catch{return null}}function lh(e){if(!(typeof window>"u"))try{e?window.localStorage.setItem(Bp,e):window.localStorage.removeItem(Bp)}catch{}}function KS(){if(typeof window>"u")return Rf;try{const e=window.localStorage.getItem(TS);return e==="maritime"||e==="carbon"?e:Rf}catch{return Rf}}function ck(){if(typeof window>"u")return su;try{const e=window.localStorage.getItem(LS);if(!e)return su;const n=JSON.parse(e);return _k(n)?{globalMute:n.preferences.globalMute,dnd:n.preferences.dnd,mutedTheaterIds:n.preferences.mutedTheaterIds}:su}catch{return su}}function uk(){if(typeof window>"u")return!1;try{return window.localStorage.getItem(kS)==="1"}catch{return!1}}function hk(){if(jp!==null)return jp;if(typeof window>"u")return null;try{return window.localStorage.getItem(RS)}catch{return null}}function dk(e){if(!(typeof window>"u"))try{window.localStorage.setItem(TS,e)}catch{}}function fk(e){if(!(typeof window>"u"))try{window.localStorage.setItem(AS,e)}catch{}}function Ig(e){if(!(typeof window>"u"))try{window.localStorage.setItem(LS,JSON.stringify({version:MS,preferences:e}))}catch{}}function pk(e){if(!(typeof window>"u"))try{window.localStorage.setItem(kS,e?"1":"0")}catch{}}function gk(e){if(jp=e,!(typeof window>"u"))try{window.localStorage.setItem(RS,e)}catch{}}function mk(e,n){if(n.length<=Np)return e;const r=new Set(n.slice(-Np)),a={};for(const l of Object.keys(e))r.has(l)&&(a[l]=e[l]);return a}function _k(e){if(!e||typeof e!="object")return!1;const n=e;if(n.version!==MS||!n.preferences||typeof n.preferences.globalMute!="boolean"||typeof n.preferences.dnd!="boolean")return!1;const r=n.preferences.mutedTheaterIds;return!!r&&typeof r=="object"&&!Array.isArray(r)}function VS(){for(const e of Ip)e()}const lu="directory-browser-sectors";function YS({open:e,onCancel:n,onConfirm:r}){const[a,l]=H.useState(null),[f,m]=H.useState(null),[c,u]=H.useState(null),[h,y]=H.useState(""),[g,C]=H.useState(0),E=H.useRef(null),A=H.useRef(null),T=async(O,U)=>{m(O),u(null),y(""),C(0);try{const F=await HT(O,U);l(F)}catch(F){if(F instanceof DOMException&&F.name==="AbortError")return;u(F instanceof Ge?F.message:String(F))}finally{m(null)}};H.useEffect(()=>{if(!e)return;const O=new AbortController;return T(null,O.signal),()=>O.abort()},[e]),H.useEffect(()=>{e&&E.current?.focus()},[e,a?.path]);const p=a?.entries??[],v=H.useMemo(()=>{const O=h.trim().toLowerCase();return O===""?p:p.filter(U=>U.name.toLowerCase().includes(O))},[p,h]),d=H.useMemo(()=>a?vk(a):[],[a]),b=v.length===0?-1:Math.min(g,v.length-1);if(H.useEffect(()=>{if(b<0)return;A.current?.querySelector(`[data-index="${b}"]`)?.scrollIntoView({block:"nearest"})},[b,a?.path]),!e)return null;const x=O=>{O.accessible&&f===null&&T(O.path)},L=()=>{a?.parentPath!=null&&f===null&&T(a.parentPath)},R=a?.path??null,M=b>=0?`${lu}-${b}`:void 0,k=O=>{switch(O.key){case"Escape":h!==""?y(""):n();return;case"ArrowDown":O.preventDefault(),C(U=>Math.min(U+1,Math.max(v.length-1,0)));return;case"ArrowUp":O.preventDefault(),C(U=>Math.max(U-1,0));return;case"Enter":{O.preventDefault();const U=v[b];U&&x(U);return}case"Backspace":h===""&&(O.preventDefault(),L());return;default:return}};return P5.createPortal(S.jsxs("div",{className:"directory-browser-overlay",role:"presentation",children:[S.jsx("button",{type:"button",className:"directory-browser-scrim","aria-label":"Close",onClick:n}),S.jsxs("section",{className:"directory-browser-card",role:"dialog","aria-modal":"true","aria-label":"Establish Theater of Operations",onKeyDown:k,children:[S.jsxs("header",{className:"directory-browser-header",children:[S.jsx("span",{className:"directory-browser-sigil","aria-hidden":"true",children:S.jsx(yk,{})}),S.jsxs("div",{className:"directory-browser-heading",children:[S.jsx("span",{className:"directory-browser-kicker",children:"Theater of Operations"}),S.jsx("h2",{children:"Establish Theater"})]}),S.jsx("button",{type:"button",className:"directory-browser-close",onClick:n,"aria-label":"Close",children:"×"})]}),S.jsx("nav",{className:"directory-browser-course","aria-label":"Path",children:d.map((O,U)=>{const F=U===d.length-1;return S.jsxs("span",{className:"directory-browser-course-seg",children:[U>0?S.jsx("span",{className:"directory-browser-course-sep","aria-hidden":"true",children:"›"}):null,S.jsx("button",{type:"button",className:`directory-browser-crumb ${F?"is-current":""}`,"aria-current":F?"location":void 0,disabled:F||f!==null,title:O.path,onClick:()=>{T(O.path)},children:O.label})]},O.path)})}),S.jsxs("div",{className:"directory-browser-toolbar",children:[S.jsxs("div",{className:"directory-browser-filter",children:[S.jsx("span",{className:"directory-browser-filter-glyph","aria-hidden":"true",children:S.jsx(wk,{})}),S.jsx("input",{ref:E,type:"text",className:"directory-browser-filter-input",placeholder:"Filter sectors…","aria-label":"Filter folders","aria-controls":lu,value:h,spellCheck:!1,autoComplete:"off",onChange:O=>{y(O.target.value),C(0)}})]}),S.jsxs("button",{type:"button",className:"directory-browser-up",disabled:a?.parentPath==null||f!==null,title:"Up one sector (Backspace)",onClick:L,children:[S.jsx(Ck,{}),S.jsx("span",{children:"Up"})]})]}),c?S.jsx("p",{className:"directory-browser-error",role:"alert",children:c}):null,S.jsx("div",{className:"directory-browser-list",id:lu,role:"listbox","aria-label":"Folders","aria-busy":f!==null,"aria-activedescendant":M,ref:A,children:f!==null?S.jsxs("p",{className:"directory-browser-state is-live",children:[S.jsx("span",{className:"directory-browser-scan-dot","aria-hidden":"true"}),"Scouting…"]}):v.length===0?S.jsx("p",{className:"directory-browser-state",children:h!==""?"No sectors match the filter.":"No sectors to advance into."}):v.map((O,U)=>S.jsxs("div",{id:`${lu}-${U}`,"data-index":U,role:"option","aria-selected":U===b,"aria-disabled":!O.accessible,className:`directory-browser-sector ${U===b?"is-active":""} ${O.accessible?"":"is-locked"}`,title:O.path,onClick:()=>{C(U),x(O)},children:[S.jsx("span",{className:"directory-browser-sector-glyph","aria-hidden":"true",children:S.jsx(Sk,{})}),S.jsx("span",{className:"directory-browser-sector-name",children:O.name}),O.accessible?S.jsx("span",{className:"directory-browser-sector-advance","aria-hidden":"true",children:"›"}):S.jsxs("span",{className:"directory-browser-sector-lock",children:[S.jsx(xk,{})," Locked"]})]},O.path))}),a?.truncated?S.jsx("p",{className:"directory-browser-note",children:"Charting first 500 sectors only."}):null,S.jsxs("footer",{className:"directory-browser-actions",children:[S.jsxs("div",{className:"directory-browser-target",children:[S.jsx("span",{className:"directory-browser-target-label",children:"Theater Root"}),S.jsx("span",{className:"directory-browser-target-path",title:R??"",children:R??"Scouting…"})]}),S.jsxs("div",{className:"directory-browser-buttons",children:[S.jsx("button",{type:"button",className:"directory-browser-button",onClick:n,children:"Cancel"}),S.jsx("button",{type:"button",className:"directory-browser-button is-primary",disabled:R===null||f!==null,onClick:()=>R&&r(R),children:"Establish Theater"})]})]})]})]}),document.body)}function vk(e){if(bk(e)==="/"){const m=[{label:"/",path:"/"}];let c="";for(const u of e.path.split("/").filter(Boolean))c+=`/${u}`,m.push({label:u,path:c});return m}const r=/^([A-Za-z]:)\\?/.exec(e.path),a=r?`${r[1]}\\`:e.roots[0]??"C:\\",l=[{label:a,path:a}];let f=a.replace(/\\$/,"");for(const m of e.path.slice(a.length).split("\\").filter(Boolean))f+=`\\${m}`,l.push({label:m,path:f});return l}function bk(e){return e.roots.some(n=>/^[A-Za-z]:\\$/.test(n))||/^[A-Za-z]:\\/.test(e.path)?"\\":"/"}function yk(){return S.jsxs("svg",{viewBox:"0 0 20 20","aria-hidden":"true",children:[S.jsx("circle",{cx:"10",cy:"10",r:"6.6",fill:"none",stroke:"currentColor",strokeWidth:"1.2"}),S.jsx("circle",{cx:"10",cy:"10",r:"2.1",fill:"currentColor"}),S.jsx("path",{d:"M10 1.6v3.2M10 15.2v3.2M1.6 10h3.2M15.2 10h3.2",fill:"none",stroke:"currentColor",strokeWidth:"1.2",strokeLinecap:"round"})]})}function Sk(){return S.jsx("svg",{viewBox:"0 0 18 18","aria-hidden":"true",children:S.jsx("path",{d:"M2.4 5.2c0-.7.6-1.3 1.3-1.3h2.7l1.4 1.5h6.5c.7 0 1.3.6 1.3 1.3v6.4c0 .7-.6 1.3-1.3 1.3H3.7c-.7 0-1.3-.6-1.3-1.3z",fill:"none",stroke:"currentColor",strokeWidth:"1.25",strokeLinejoin:"round"})})}function wk(){return S.jsxs("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:[S.jsx("circle",{cx:"7",cy:"7",r:"4.2",fill:"none",stroke:"currentColor",strokeWidth:"1.3"}),S.jsx("path",{d:"M10.2 10.2 13.5 13.5",fill:"none",stroke:"currentColor",strokeWidth:"1.3",strokeLinecap:"round"})]})}function Ck(){return S.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:S.jsx("path",{d:"M8 12.5V4M4.5 7.5 8 4l3.5 3.5",fill:"none",stroke:"currentColor",strokeWidth:"1.35",strokeLinecap:"round",strokeLinejoin:"round"})})}function xk(){return S.jsxs("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:[S.jsx("rect",{x:"3.6",y:"7",width:"8.8",height:"6.2",rx:"1.4",fill:"none",stroke:"currentColor",strokeWidth:"1.2"}),S.jsx("path",{d:"M5.6 7V5.4a2.4 2.4 0 0 1 4.8 0V7",fill:"none",stroke:"currentColor",strokeWidth:"1.2",strokeLinecap:"round"})]})}const Ek=["a[href]","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])","[tabindex]:not([tabindex='-1'])"].join(",");function Tk({state:e}){const[n,r]=H.useState(!1),a=H.useRef(null),l=H.useRef(null),f=H.useRef(null),m=e.theaters.length>0;if(H.useEffect(()=>{if(e.onboardingOpen)return a.current=document.activeElement,l.current?.focus(),()=>{const y=a.current;a.current=null,y?.focus?.()}},[e.onboardingOpen]),H.useEffect(()=>{if(!e.onboardingOpen)return;const y=g=>{n||(g.key==="Escape"?(g.preventDefault(),cl()):g.key==="Tab"&&Ak(g,f.current),g.stopImmediatePropagation())};return window.addEventListener("keydown",y,!0),()=>window.removeEventListener("keydown",y,!0)},[n,e.onboardingOpen]),!e.onboardingOpen)return null;const c=()=>{r(!0)},u=()=>{r(!1)},h=async y=>{r(!1),NS();try{const g=await dS(y),C=await hS(g);BS(C)}catch(g){zp(g instanceof Error?g.message:String(g))}};return S.jsxs("div",{className:"commissioning-overlay",role:"dialog","aria-modal":"true","aria-labelledby":"commissioning-title",children:[S.jsx("button",{type:"button",className:"commissioning-scrim",onClick:cl,"aria-label":"Close Commissioning guide"}),S.jsxs("section",{className:"commissioning-card",ref:f,children:[S.jsxs("header",{className:"commissioning-header",children:[S.jsx("span",{className:"commissioning-eyebrow",children:"COMMISSIONING · FLEET CONSOLE"}),S.jsx("h2",{id:"commissioning-title",children:"Bring your fleet online"}),S.jsx("p",{children:"Three steps to go from an empty bridge to live carrier operations."})]}),S.jsxs("ol",{className:"commissioning-steps",children:[S.jsxs("li",{className:`commissioning-step commissioning-step--primary ${m?"is-complete":"is-current"}`,children:[S.jsx("span",{className:"commissioning-step-node","aria-hidden":"true",children:m?"✓":"01"}),S.jsxs("div",{className:"commissioning-step-body",children:[S.jsx("h3",{children:"Register a Theater"}),S.jsx("p",{children:"A Theater is a project directory the fleet operates in. Choose the folder you want to work from."}),m?S.jsx(Dl,{ref:y=>{l.current=y},className:"commissioning-primary-action",to:"/operations",onClick:cl,children:"Go to Operations →"}):S.jsx("button",{ref:y=>{l.current=y},type:"button",className:"commissioning-primary-action is-live",disabled:e.addingTheater,onClick:c,children:e.addingTheater?"Adding Theater…":"Choose a folder…"}),e.theaterError?S.jsx("p",{className:"commissioning-error",role:"alert",children:e.theaterError}):null]})]}),S.jsxs("li",{className:"commissioning-step",children:[S.jsx("span",{className:"commissioning-step-node","aria-hidden":"true",children:"02"}),S.jsxs("div",{className:"commissioning-step-body",children:[S.jsx("h3",{children:"Open an Operation"}),S.jsx("p",{children:"An Operation is a live terminal session running an Agent CLI. Start one from the Operations tab to begin a working session."}),S.jsx(Dl,{className:"commissioning-secondary-link",to:"/operations",onClick:cl,children:"Go to Operations"})]})]}),S.jsxs("li",{className:"commissioning-step",children:[S.jsx("span",{className:"commissioning-step-node","aria-hidden":"true",children:"03"}),S.jsxs("div",{className:"commissioning-step-body",children:[S.jsx("h3",{children:"Observe carriers"}),S.jsx("p",{children:"Carriers are specialist agents your Admiral dispatches. Their sorties stream here in real time as they run."})]})]})]}),S.jsxs("footer",{className:"commissioning-footer",children:[S.jsx("p",{children:"Theaters with a Fleet Wiki knowledge root also unlock Codex — your decision log and reference library."}),S.jsx("button",{type:"button",className:"commissioning-skip",onClick:cl,children:"Skip for now"})]})]}),S.jsx(YS,{open:n,onCancel:u,onConfirm:h})]})}function Ak(e,n){if(!n)return;const r=Array.from(n.querySelectorAll(Ek)),a=r[0],l=r[r.length-1];!a||!l||(e.shiftKey&&document.activeElement===a?(e.preventDefault(),l.focus()):!e.shiftKey&&document.activeElement===l&&(e.preventDefault(),a.focus()))}function Fl(){return H.useSyncExternalStore(MA,Eb,Eb)}const kk={ended:"Stood down","input-waiting":"Awaiting orders"},XS="fleet-console.notificationsDockOpen",Nf=!1;function Rk(){const e=Fl(),n=Pl(),[r,a]=H.useState(Lk),[l,f]=H.useState(!1),m=H.useRef(null),c=H.useRef(null),u=H.useMemo(()=>Object.values(e.operationNotifications),[e.operationNotifications]),h=tA(e),y=nA(u,h).hidden,g=iA(y,e.notificationPreferences),C=gb(g),E=gb(y),A=C.reduce((O,U)=>O+U.totalCount,0),T=Db(C,"input-waiting"),p=Db(C,"ended");Dk(e.notificationPreferences);const v=C.length===0,d=v?"muted":T>0?"awaiting":"ended",b=H.useMemo(()=>g.reduce((O,U)=>Math.max(O,U.lastRaisedSeq),0),[g]),x=H.useRef(b),[L,R]=H.useState(0),M=H.useCallback(O=>{a(O),Mk(O)},[]);H.useEffect(()=>{b>x.current&&!r&&R(O=>O+1),x.current=b},[b,r]),H.useEffect(()=>{if(!r)return;const O=U=>{const F=U.target;if(!(F instanceof Node)){M(!1);return}c.current?.contains(F)||m.current?.contains(F)||M(!1)};return document.addEventListener("pointerdown",O),()=>{document.removeEventListener("pointerdown",O)}},[r,M]);const k=O=>{Ng(O.sessionId),n("/operations"),M(!1)};return r?S.jsx("div",{className:"notification-dock-layer",children:S.jsxs("aside",{ref:c,className:`notification-dock ${d==="awaiting"?"has-awaiting":""}`,"aria-live":"polite","aria-label":"Operation notifications",children:[S.jsxs("header",{className:"notification-dock-head",children:[S.jsx("span",{className:"notification-dock-eyebrow",children:"Notifications"}),v?null:S.jsxs("span",{className:"notification-dock-tallies","aria-hidden":"true",children:[T>0?S.jsx("span",{className:"notification-tally is-input-waiting",children:T}):null,p>0?S.jsx("span",{className:"notification-tally is-ended",children:p}):null]}),S.jsx("button",{type:"button",className:"notification-dock-icon",onClick:()=>f(!l),"aria-expanded":l,"aria-label":"Notification settings",title:"Notification settings",children:S.jsx(Bk,{})}),S.jsx("button",{type:"button",className:"notification-dock-icon",onClick:()=>M(!1),"aria-label":"Close notifications",title:"Close",children:S.jsx(Ik,{})})]}),l?S.jsx(Ok,{groups:E}):null,v?S.jsx("p",{className:"notification-dock-empty",children:"No active alerts"}):S.jsx("div",{className:"notification-dock-deck",children:C.map(O=>S.jsxs("section",{className:"notification-cluster-group",children:[S.jsxs("header",{className:"notification-cluster-group-head",children:[S.jsx("span",{className:"notification-cluster-theater",children:O.theaterLabel}),S.jsx("span",{className:"notification-cluster-group-count",children:O.totalCount})]}),S.jsx("ul",{className:"notification-cluster-roster",children:O.notifications.map(U=>S.jsxs("li",{className:`notification-row is-${U.kind}`,children:[S.jsx("span",{className:"notification-row-beacon","aria-hidden":"true"}),S.jsxs("span",{className:"notification-row-body",children:[S.jsx("span",{className:"notification-row-op",children:U.operationLabel}),S.jsx("span",{className:"notification-row-state",children:kk[U.kind]})]}),U.count>1?S.jsx("span",{className:"notification-row-count",children:U.count}):null,S.jsx("button",{type:"button",className:"notification-row-move",onClick:()=>k(U),"aria-label":`Open ${O.theaterLabel} ${U.operationLabel}`,children:"Open"})]},U.sessionId))})]},O.theaterId??"__unknown__"))})]})}):S.jsxs("button",{ref:m,type:"button",className:`notification-handle is-${d} ${d==="awaiting"?"has-awaiting":""}`,onClick:()=>M(!0),"aria-label":`Open notifications (${A})`,children:[S.jsx("span",{className:"notification-handle-count",children:v?0:A}),S.jsx("span",{className:"notification-handle-label",children:"Alerts"}),S.jsx(jk,{className:"notification-handle-chevron"}),L>0?S.jsx("span",{className:"notification-handle-pulse","aria-hidden":"true"},L):null]})}function Lk(){if(typeof window>"u")return Nf;try{const e=window.localStorage.getItem(XS);return e===null?Nf:e==="true"}catch{return Nf}}function Mk(e){if(!(typeof window>"u"))try{window.localStorage.setItem(XS,String(e))}catch{}}function Dk(e){return e.globalMute||e.dnd||Object.keys(e.mutedTheaterIds).length>0}function Db(e,n){let r=0;for(const a of e)for(const l of a.notifications)l.kind===n&&(r+=l.count);return r}function Ok({groups:e}){const n=Fl(),r=Nk(e,n.notificationPreferences.mutedTheaterIds,n.theaters);return S.jsxs("div",{className:"notification-cluster-settings",role:"dialog","aria-label":"Notification settings",children:[S.jsx("p",{className:"notification-cluster-settings-eyebrow",children:"Display"}),S.jsxs("label",{className:"notification-cluster-setting",children:[S.jsx("input",{type:"checkbox",checked:n.notificationPreferences.globalMute,onChange:a=>qA(a.currentTarget.checked)}),S.jsx("span",{children:"Mute all"})]}),S.jsxs("label",{className:"notification-cluster-setting",children:[S.jsx("input",{type:"checkbox",checked:n.notificationPreferences.dnd,onChange:a=>WA(a.currentTarget.checked)}),S.jsx("span",{children:"Do not disturb"})]}),r.length>0?S.jsx("p",{className:"notification-cluster-settings-eyebrow",children:"By Theater"}):null,r.map(a=>S.jsxs("label",{className:"notification-cluster-setting",children:[S.jsx("input",{type:"checkbox",checked:a.theaterId?n.notificationPreferences.mutedTheaterIds[a.theaterId]===!0:!1,onChange:()=>{a.theaterId&&GA(a.theaterId)}}),S.jsx("span",{children:a.theaterLabel})]},a.theaterId))]})}function Nk(e,n,r){const a=new Map;for(const l of e)l.theaterId&&a.set(l.theaterId,l);for(const l of Object.keys(n))a.has(l)||a.set(l,{theaterId:l,theaterLabel:r.find(f=>f.id===l)?.label??l,notifications:[],totalCount:0});return[...a.values()]}function Bk(){return S.jsxs("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:[S.jsx("path",{d:"M8 5.4a2.6 2.6 0 1 1 0 5.2 2.6 2.6 0 0 1 0-5.2Z",fill:"none",stroke:"currentColor",strokeWidth:"1.25"}),S.jsx("path",{d:"M8 2.2v1.6M8 12.2v1.6M3.9 3.9 5 5M11 11l1.1 1.1M2.2 8h1.6M12.2 8h1.6M3.9 12.1 5 11M11 5l1.1-1.1",fill:"none",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round"})]})}function Ik(){return S.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:S.jsx("path",{d:"M4 4l8 8M12 4l-8 8",fill:"none",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round"})})}function jk({className:e}){return S.jsx("svg",{className:e,viewBox:"0 0 16 16","aria-hidden":"true",children:S.jsx("path",{d:"M6 4l4 4-4 4",fill:"none",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round"})})}const ZS=[{title:"Console",entries:[{combos:[["Mod","K"]],description:"Search Operations across Theaters"},{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:[["Alt","←"],["Alt","→"]],description:"Focus the previous / next Operation"},{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:[["Right-click"]],description:"Open the canvas actions menu"},{combos:[["Double-click"]],description:"Focus a panel from its title bar; rename from its name"},{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"}]}],zk=/mac|iphone|ipad|ipod/i,$k=["a[href]","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])","[tabindex]:not([tabindex='-1'])"].join(",");function Pk({state:e}){const n=H.useRef(null),r=H.useRef(null),a=H.useRef(null);if(e.shortcutsOpen&&n.current===null&&(n.current=document.activeElement),H.useEffect(()=>{if(!e.shortcutsOpen)return;const f=m=>{m.key==="Escape"?(Df(),m.preventDefault()):m.key==="Tab"&&Uk(m,a.current),m.stopImmediatePropagation()};return r.current?.focus(),window.addEventListener("keydown",f,!0),()=>{window.removeEventListener("keydown",f,!0);const m=n.current;n.current=null,m?.focus?.()}},[e.shortcutsOpen]),!e.shortcutsOpen)return null;const l=Hk();return S.jsxs("div",{className:"shortcuts-overlay",role:"dialog","aria-modal":"true","aria-label":"Keyboard shortcuts",children:[S.jsx("button",{type:"button",className:"shortcuts-overlay-scrim",onClick:Df,"aria-label":"Close keyboard shortcuts"}),S.jsxs("section",{className:"shortcuts-overlay-card",ref:a,children:[S.jsxs("header",{className:"shortcuts-overlay-header",children:[S.jsx("span",{className:"shortcuts-overlay-kicker",children:"Reference Map"}),S.jsx("h2",{children:"Keyboard Shortcuts"})]}),S.jsx("button",{ref:r,type:"button",className:"shortcuts-overlay-close",onClick:Df,"aria-label":"Close keyboard shortcuts",children:"×"}),S.jsx("div",{className:"shortcuts-overlay-groups",children:ZS.map(f=>S.jsxs("section",{className:"shortcuts-group","aria-labelledby":`shortcuts-${f.title.toLowerCase()}`,children:[S.jsx("h3",{id:`shortcuts-${f.title.toLowerCase()}`,children:f.title}),S.jsx("dl",{className:"shortcuts-list",children:f.entries.map(m=>S.jsxs("div",{className:"shortcuts-entry",children:[S.jsx("dt",{className:"shortcuts-combos",children:m.combos.map((c,u)=>S.jsxs("span",{className:"shortcuts-combo",children:[u>0?S.jsx("span",{className:"shortcuts-combo-separator",children:"or"}):null,S.jsx("span",{className:"shortcuts-keyset",children:c.map(h=>S.jsx("kbd",{children:h==="Mod"?l:h},h))})]},`${m.description}:${c.join("+")}`))}),S.jsx("dd",{children:m.description})]},`${f.title}:${m.description}`))})]},f.title))})]})]})}function Hk(){const n=navigator.userAgentData?.platform??navigator.platform;return zk.test(n)?"⌘":"Ctrl"}function Uk(e,n){if(!n)return;const r=Array.from(n.querySelectorAll($k)),a=r[0],l=r[r.length-1];!a||!l||(e.shiftKey&&document.activeElement===a?(e.preventDefault(),l.focus()):!e.shiftKey&&document.activeElement===l&&(e.preventDefault(),a.focus()))}const Fk="a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex='-1'])",Ob="operation-search-listbox",JS="__unassigned__";function qk({state:e}){const n=Pl(),[r,a]=H.useState(""),[l,f]=H.useState(0),m=H.useRef(null),c=H.useRef(null),u=H.useRef(null),h=H.useRef(new Map),y=H.useMemo(()=>ik(e),[e]),g=H.useMemo(()=>pA(y,r),[y,r]),C=H.useMemo(()=>gA(g),[g]),E=H.useMemo(()=>wS(r),[r]),A=Nb(l,g.length),T=g[A]?Bb(g[A].sessionId):void 0;if(H.useEffect(()=>{if(!e.operationSearchOpen)return;u.current=document.activeElement instanceof HTMLElement?document.activeElement:null;const d=document.body.style.overflow;return document.body.style.overflow="hidden",window.setTimeout(()=>m.current?.focus(),0),()=>{document.body.style.overflow=d,u.current?.focus()}},[e.operationSearchOpen]),H.useEffect(()=>{if(!e.operationSearchOpen){a(""),f(0);return}f(0)},[e.operationSearchOpen,r]),H.useEffect(()=>{if(!e.operationSearchOpen)return;const d=g[A];d&&h.current.get(d.sessionId)?.scrollIntoView({block:"nearest"})},[A,g,e.operationSearchOpen]),!e.operationSearchOpen)return null;const p=d=>{Ng(d),n("/operations"),Mf()},v=d=>{if(d.key==="Escape"){d.preventDefault(),Mf();return}if(d.key==="ArrowDown"||d.key==="ArrowUp"){d.preventDefault(),f(b=>Nb(b+(d.key==="ArrowDown"?1:-1),g.length));return}if(d.key==="Enter"){const b=g[A];if(!b)return;d.preventDefault(),p(b.sessionId);return}d.key==="Tab"&&Vk(d,c.current)};return S.jsx("div",{className:"operation-search-overlay",onMouseDown:d=>{d.target===d.currentTarget&&Mf()},children:S.jsxs("section",{ref:c,className:"operation-search-card",role:"dialog","aria-modal":"true","aria-label":"Operation quick search",tabIndex:-1,onKeyDown:v,children:[S.jsxs("div",{className:"operation-search-field",children:[S.jsx(Yk,{}),S.jsx("input",{ref:m,id:"operation-search-input",type:"search",value:r,onChange:d=>a(d.target.value),placeholder:"Search Operations across Theaters",autoComplete:"off",role:"combobox","aria-expanded":!0,"aria-controls":Ob,"aria-activedescendant":T,"aria-autocomplete":"list",spellCheck:!1}),S.jsx("kbd",{children:"esc"})]}),S.jsx("div",{id:Ob,className:"operation-search-results",role:"listbox","aria-label":"Operation results",children:C.length>0?C.map(d=>{const b=Gk(d.theaterId);return S.jsxs("section",{className:"operation-search-section",role:"group","aria-labelledby":b,children:[S.jsx("h2",{id:b,className:"operation-search-section-heading",children:Bf(d.theaterLabel,E)}),d.entries.map(x=>{const L=g.indexOf(x),R=L===A;return S.jsxs("button",{id:Bb(x.sessionId),ref:M=>{M?h.current.set(x.sessionId,M):h.current.delete(x.sessionId)},type:"button",className:`operation-search-result ${R?"is-active":""}`,role:"option","aria-selected":R,onMouseEnter:()=>f(L),onClick:()=>p(x.sessionId),children:[S.jsxs("span",{className:"operation-search-result-text",children:[S.jsx("strong",{children:Bf(x.operationName,E)}),S.jsx("small",{children:Wk(x)})]}),S.jsx("span",{className:"operation-search-theater",children:Bf(x.theaterLabel,E)})]},x.sessionId)})]},d.theaterId??JS)}):S.jsx("p",{className:"operation-search-empty",children:"No matching Operations."})})]})})}function Nb(e,n){return n<=0?0:Math.max(0,Math.min(e,n-1))}function Wk(e){return[e.cliLabel,e.status].filter(Boolean).join(" · ")}function Gk(e){return`operation-search-heading-${QS(e??JS)}`}function Bb(e){return`operation-search-option-${QS(e)}`}function QS(e){return e.replace(/[^a-zA-Z0-9_-]/g,"-")}function Bf(e,n){if(n.length===0)return e;const r=[];let a=0;for(;a<e.length;){const l=Kk(e,n,a);if(!l){r.push(e.slice(a));break}l.start>a&&r.push(e.slice(a,l.start)),r.push(S.jsx("mark",{children:e.slice(l.start,l.end)},`${l.start}-${l.end}`)),a=l.end}return r}function Kk(e,n,r){const a=e.toLocaleLowerCase();let l=null;for(const f of n){const m=a.indexOf(f,r);m!==-1&&(!l||m<l.start)&&(l={start:m,end:m+f.length})}return l}function Vk(e,n){if(!n)return;const r=Array.from(n.querySelectorAll(Fk)).filter(f=>f.offsetParent!==null);if(r.length===0)return;const a=r[0],l=r[r.length-1];if(e.shiftKey&&document.activeElement===a){e.preventDefault(),l?.focus();return}!e.shiftKey&&document.activeElement===l&&(e.preventDefault(),a?.focus())}function Yk(){return S.jsx("svg",{viewBox:"0 0 20 20","aria-hidden":"true",children:S.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 Xk({open:e,title:n,message:r,tone:a="info",onDismiss:l}){return e?S.jsx("div",{className:"app-toast-host",children:S.jsxs("div",{className:`app-toast app-toast--${a}`,role:"status","aria-live":"polite",children:[S.jsx("span",{className:"app-toast-dot","aria-hidden":"true"}),S.jsxs("div",{className:"app-toast-body",children:[S.jsx("p",{className:"app-toast-title",children:n}),r?S.jsx("p",{className:"app-toast-message",children:r}):null]}),l?S.jsx("button",{type:"button",className:"app-toast-close",onClick:l,"aria-label":"Dismiss notification",children:"×"}):null]})}):null}function Zk({state:e}){if(Pi===null)return null;const n=Pi.version===e.version&&e.version?` v${Pi.version}`:"";return S.jsx("button",{type:"button",className:"topbar-whatsnew-button",onMouseDown:r=>r.preventDefault(),onClick:YA,"aria-label":`What's new${n}`,title:`What's new${n}`,children:S.jsx("span",{children:"What's new"})})}const Jk=1400,Qk="https://github.com/sbluemin/fleet-harness",e3="https://github.com/sbluemin/fleet-harness/stargazers",t3="https://api.github.com/repos/sbluemin/fleet-harness",jg="fleet-console.github-stars",n3=360*60*1e3;function i3({state:e}){const n=e.connectionError!==null,r=Li().pathname,a=r.startsWith("/codex")?S.jsx(S3,{}):r.startsWith("/carrier-settings")?S.jsx(jb,{}):r.startsWith("/settings")?S.jsx(Ib,{}):r.startsWith("/operations")?S.jsx(y3,{}):S.jsx(b3,{});return S.jsxs("header",{className:"topbar",children:[S.jsxs("div",{className:"topbar-lead",children:[S.jsxs(Dl,{className:"topbar-brand",to:"/operations","aria-label":"Operations로 이동",children:[S.jsx("span",{className:`topbar-sigil ${n?"is-alert":""}`,"aria-hidden":"true",title:e.connectionError??void 0,children:a}),S.jsxs("h1",{className:"topbar-title",children:["Fleet",S.jsx("span",{className:"topbar-title-thin",children:"Console"})]})]}),S.jsxs("span",{className:"topbar-preview-badge",children:[S.jsx("span",{className:"topbar-preview-label",children:"Research Preview"}),e.version?S.jsxs("span",{className:"topbar-preview-version",children:["v",e.version]}):null]}),S.jsx(c3,{}),S.jsx(Zk,{state:e})]}),S.jsx(l3,{state:e}),S.jsxs("div",{className:"topbar-meta",children:[e.updateAvailable?S.jsx(r3,{latestVersion:e.latestVersion}):null,S.jsx("button",{type:"button",className:"topbar-icon-button topbar-shortcuts-button",onMouseDown:l=>l.preventDefault(),onClick:VA,"aria-label":"Keyboard shortcuts",title:"Keyboard shortcuts",children:S.jsx(E3,{})}),S.jsxs(vp,{to:"/carrier-settings",className:({isActive:l})=>`topbar-nav-link ${l?"is-active":""}`,title:"Carrier settings",children:[S.jsx("span",{className:"topbar-nav-icon","aria-hidden":"true",children:S.jsx(jb,{})}),S.jsx("span",{children:"Carriers"})]}),S.jsxs(vp,{to:"/settings",className:({isActive:l})=>`topbar-nav-link ${l?"is-active":""}`,title:"Settings",children:[S.jsx("span",{className:"topbar-nav-icon","aria-hidden":"true",children:S.jsx(Ib,{})}),S.jsx("span",{children:"Settings"})]})]})]})}function r3({latestVersion:e}){const[n,r]=H.useState("idle"),[a,l]=H.useState(null),f=H.useRef(null),m=s3(n,a,e);H.useEffect(()=>()=>{f.current!==null&&window.clearTimeout(f.current)},[]);const c=async()=>{if(!m.disabled){f.current!==null&&(window.clearTimeout(f.current),f.current=null),r("applying"),l(null);try{if((await PT()).status!=="accepted"){r("error"),l("invalid_response");return}r("accepted"),f.current=window.setTimeout(()=>{f.current=null,r("completed")},Jk)}catch(u){const h=u instanceof Ge?u.message:"network_error";l(h),r(o3(h)?"blocked":"error")}}};return S.jsx("button",{type:"button",className:`topbar-update-badge topbar-update-badge--${m.tone}`,onClick:c,disabled:m.disabled,title:m.title,"aria-live":"polite",children:m.label})}function s3(e,n,r){const a=r?`최신 버전 ${r}`:"업데이트 가능";return e==="applying"?{label:"요청 중",title:"업데이트 적용 요청을 보내는 중입니다.",tone:"live",disabled:!0}:e==="accepted"?{label:"업데이트 중",title:"서버가 곧 재시작되고 새 창에서 콘솔을 엽니다.",tone:"live",disabled:!0}:e==="completed"?{label:"완료: 새 창에서 계속",title:"새 창에서 재시작된 콘솔을 계속 사용하세요.",tone:"live",disabled:!0}:e==="blocked"?a3(n):e==="error"?{label:"재시도",title:"업데이트 요청에 실패했습니다. 다시 시도할 수 있습니다.",tone:"error",disabled:!1}:{label:"Update available",title:a,tone:"warn",disabled:!1}}function a3(e){return e==="local_channel"?{label:"로컬 빌드",title:"로컬 개발 빌드는 콘솔에서 업데이트하지 않습니다.",tone:"blocked",disabled:!0}:e==="active_terminal_sessions"?{label:"세션 종료 필요",title:"실행 중인 Operation을 종료한 뒤 업데이트하세요.",tone:"blocked",disabled:!1}:e==="update_already_in_progress"?{label:"이미 진행 중",title:"다른 업데이트 적용이 이미 진행 중입니다.",tone:"blocked",disabled:!0}:e==="update_not_available"?{label:"업데이트 없음",title:"서버 재확인 결과 적용할 업데이트가 없습니다.",tone:"blocked",disabled:!0}:{label:"콘솔 준비 안 됨",title:"콘솔이 업데이트를 시작할 준비가 되지 않았습니다. 잠시 뒤 다시 시도하세요.",tone:"error",disabled:!1}}function o3(e){return e==="active_terminal_sessions"||e==="local_channel"||e==="update_already_in_progress"||e==="update_not_available"}function l3({state:e}){const[n,r]=H.useState(!1),[a,l]=H.useState(!1),f=H.useRef(null),m=H.useRef(null),c=H.useRef(null),u=e.theaters.find(p=>p.id===e.activeTheaterId)??null,h=u?.label??(e.theaters.length===0?"No Theaters":"Theater");H.useEffect(()=>{if(!n)return;const p=d=>{f.current?.contains(d.target)||r(!1)},v=d=>{d.key==="Escape"&&(r(!1),m.current?.focus())};return document.addEventListener("mousedown",p),document.addEventListener("keydown",v),()=>{document.removeEventListener("mousedown",p),document.removeEventListener("keydown",v)}},[n]),H.useEffect(()=>{if(!n)return;const p=c.current;if(!p)return;(p.querySelector('[data-active="true"]')??p.querySelector("[role^='menuitem']"))?.focus()},[n]);const y=p=>{$A(p),r(!1),m.current?.focus()},g=async()=>{r(!1),l(!0)},C=()=>{l(!1),PA()},E=async p=>{l(!1),NS();try{const v=await dS(p),d=await hS(v);BS(d)}catch(v){zp(v instanceof Error?v.message:String(v))}},A=async()=>{if(u){r(!1);try{await UT(u.id),Mb(u.id)}catch(p){if(p instanceof Ge&&p.status===404){Mb(u.id);return}zp(p instanceof Error?p.message:String(p))}}},T=p=>{if(p.key!=="ArrowDown"&&p.key!=="ArrowUp")return;p.preventDefault();const v=Array.from(c.current?.querySelectorAll("[role^='menuitem']")??[]);if(v.length===0)return;const d=v.indexOf(document.activeElement),b=p.key==="ArrowDown"?1:-1,x=(d+b+v.length)%v.length;v[x]?.focus()};return S.jsxs("div",{className:"theater-control",ref:f,children:[S.jsx("span",{className:"theater-eyebrow","aria-hidden":"true",children:"Theater"}),S.jsxs("button",{type:"button",ref:m,className:`theater-trigger ${n?"is-open":""}`,"aria-haspopup":"menu","aria-expanded":n,"aria-label":"Theater",title:u?.label??e.theaterError??void 0,onClick:()=>r(p=>!p),children:[S.jsx("span",{className:"theater-trigger-sigil","aria-hidden":"true",children:S.jsx(g3,{})}),S.jsx("span",{className:"theater-trigger-label",children:h}),S.jsx("span",{className:"theater-trigger-caret","aria-hidden":"true",children:S.jsx(m3,{})})]}),n?S.jsxs("div",{className:"theater-menu",role:"menu","aria-label":"Theater",ref:c,onKeyDown:T,children:[e.theaters.length>0?S.jsx("ul",{className:"theater-menu-list",children:e.theaters.map(p=>{const v=p.id===e.activeTheaterId;return S.jsx("li",{children:S.jsxs("button",{type:"button",role:"menuitemradio","aria-checked":v,"data-active":v?"true":void 0,className:`theater-menu-item ${v?"is-active":""}`,title:p.label,onClick:()=>y(p.id),children:[S.jsx("span",{className:"theater-menu-check","aria-hidden":"true",children:v?S.jsx(_3,{}):null}),S.jsx("span",{className:"theater-menu-label",children:p.label})]})},p.id)})}):S.jsx("p",{className:"theater-menu-empty",children:"No Theaters yet."}),S.jsx("div",{className:"theater-menu-divider",role:"separator"}),u?S.jsxs(S.Fragment,{children:[S.jsxs("button",{type:"button",role:"menuitem",className:"theater-menu-item theater-menu-forget",onClick:A,children:[S.jsx("span",{className:"theater-menu-check","aria-hidden":"true",children:S.jsx(v3,{})}),S.jsx("span",{className:"theater-menu-label",children:"Forget Theater"})]}),S.jsx("div",{className:"theater-menu-divider",role:"separator"})]}):null,S.jsxs("button",{type:"button",role:"menuitem",className:"theater-menu-item theater-menu-add",disabled:e.addingTheater,onClick:g,children:[S.jsx("span",{className:"theater-menu-check","aria-hidden":"true",children:S.jsx(w3,{})}),S.jsx("span",{className:"theater-menu-label",children:e.addingTheater?"Adding Theater…":"Add Theater…"})]}),e.theaterError?S.jsx("p",{className:"theater-menu-error",children:e.theaterError}):null]}):null,S.jsx(YS,{open:a,onCancel:C,onConfirm:E})]})}function c3(){const e=u3(),n=e.count!==null;return S.jsxs("div",{className:"topbar-github",role:"group","aria-label":"GitHub",children:[S.jsx("a",{className:"topbar-github-link",href:Qk,target:"_blank",rel:"noopener noreferrer","aria-label":"GitHub 저장소 열기",title:"GitHub 저장소",children:S.jsx(C3,{})}),S.jsxs("a",{className:"topbar-github-stars",href:e3,target:"_blank",rel:"noopener noreferrer","aria-label":n?`GitHub 스타 ${e.count.toLocaleString()}개 — 스타 누르기`:"GitHub에서 스타 누르기",title:"GitHub에서 스타 누르기",children:[S.jsx(x3,{}),n?S.jsx("span",{className:"topbar-github-stars-count",children:p3(e.count)}):null]})]})}function u3(){const[e,n]=H.useState(()=>{const r=h3();return r===null?{count:null,status:"idle"}:{count:r,status:"ready"}});return H.useEffect(()=>{if(d3())return;let r=!1;return n(a=>a.status==="ready"?a:{...a,status:"loading"}),fetch(t3,{headers:{Accept:"application/vnd.github+json"}}).then(a=>a.ok?a.json():Promise.reject(new Error(`status ${a.status}`))).then(a=>{if(r)return;const l=typeof a.stargazers_count=="number"?a.stargazers_count:null;if(l===null){n(f=>({count:f.count,status:f.count===null?"error":"ready"}));return}f3(l),n({count:l,status:"ready"})}).catch(()=>{r||n(a=>({count:a.count,status:a.count===null?"error":"ready"}))}),()=>{r=!0}},[]),e}function h3(){try{const e=window.localStorage.getItem(jg);if(!e)return null;const n=JSON.parse(e);return typeof n.count=="number"?n.count:null}catch{return null}}function d3(){try{const e=window.localStorage.getItem(jg);if(!e)return!1;const n=JSON.parse(e);return typeof n.at=="number"&&Date.now()-n.at<n3}catch{return!1}}function f3(e){try{window.localStorage.setItem(jg,JSON.stringify({count:e,at:Date.now()}))}catch{}}function p3(e){if(e<1e3)return String(e);const n=e/1e3;return n<10?`${n.toFixed(1)}k`:`${Math.round(n)}k`}function g3(){return S.jsxs("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:[S.jsx("circle",{cx:"8",cy:"3.2",r:"1.5",fill:"none",stroke:"currentColor",strokeWidth:"1.2"}),S.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 m3(){return S.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:S.jsx("path",{d:"M4.5 6.5 8 10l3.5-3.5",fill:"none",stroke:"currentColor",strokeWidth:"1.3",strokeLinecap:"round",strokeLinejoin:"round"})})}function _3(){return S.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:S.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 v3(){return S.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:S.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 b3(){return S.jsxs("svg",{viewBox:"0 0 16 16",width:"16",height:"16",children:[S.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"}),S.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 y3(){return S.jsxs("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:[S.jsx("circle",{cx:"8",cy:"8",r:"5.4",fill:"none",stroke:"currentColor",strokeWidth:"1.2"}),S.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"}),S.jsx("circle",{cx:"8",cy:"8",r:"1.1",fill:"currentColor"})]})}function S3(){return S.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[S.jsx("circle",{cx:"12",cy:"12",r:"9"}),S.jsx("circle",{cx:"12",cy:"12",r:"3.2",fill:"currentColor",stroke:"none",opacity:"0.16"}),S.jsx("path",{d:"M12 3v3.6M12 17.4V21M3 12h3.6M17.4 12H21"}),S.jsx("path",{d:"M12 8.6 14.2 12 12 15.4 9.8 12Z",fill:"currentColor",stroke:"none"})]})}function Ib(){return S.jsxs("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:[S.jsx("path",{d:"M3 4.4h10M3 8h10M3 11.6h10",fill:"none",stroke:"currentColor",strokeWidth:"1.2",strokeLinecap:"round"}),S.jsx("circle",{cx:"6.2",cy:"4.4",r:"1.3",fill:"var(--surface-glass-strong)",stroke:"currentColor",strokeWidth:"1.2"}),S.jsx("circle",{cx:"10",cy:"8",r:"1.3",fill:"var(--surface-glass-strong)",stroke:"currentColor",strokeWidth:"1.2"}),S.jsx("circle",{cx:"7.4",cy:"11.6",r:"1.3",fill:"var(--surface-glass-strong)",stroke:"currentColor",strokeWidth:"1.2"})]})}function jb(){return S.jsxs("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:[S.jsx("circle",{cx:"4",cy:"4.2",r:"1.15",fill:"currentColor"}),S.jsx("circle",{cx:"4",cy:"8",r:"1.15",fill:"currentColor"}),S.jsx("circle",{cx:"4",cy:"11.8",r:"1.15",fill:"currentColor"}),S.jsx("path",{d:"M7.2 4.2h6M7.2 8h6M7.2 11.8h6",fill:"none",stroke:"currentColor",strokeWidth:"1.2",strokeLinecap:"round"})]})}function w3(){return S.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:S.jsx("path",{d:"M8 3.4v9.2M3.4 8h9.2",fill:"none",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round"})})}function C3(){return S.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:S.jsx("path",{fill:"currentColor",d:"M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82a7.65 7.65 0 0 1 2-.27c.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.01 8.01 0 0 0 16 8c0-4.42-3.58-8-8-8Z"})})}function x3(){return S.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:S.jsx("path",{d:"M8 2.2 9.41 6.26 13.71 6.35 10.28 8.94 11.53 13.05 8 10.6 4.47 13.05 5.72 8.94 2.29 6.35 6.59 6.26Z",fill:"none",stroke:"currentColor",strokeWidth:"1.2",strokeLinejoin:"round"})})}function E3(){return S.jsxs("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:[S.jsx("rect",{x:"2.4",y:"4.1",width:"11.2",height:"7.8",rx:"1.8",fill:"none",stroke:"currentColor",strokeWidth:"1.2"}),S.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"})]})}const T3=["a[href]","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])","[tabindex]:not([tabindex='-1'])"].join(",");function A3({state:e}){const n=H.useRef(null),r=H.useRef(null),a=H.useRef(null),l=!e.bootstrapped||e.onboardingOpen||e.operationSearchOpen||e.shortcutsOpen||e.timelineOpen;return e.whatsNewOpen&&!l&&n.current===null&&(n.current=document.activeElement),H.useEffect(()=>{if(!e.whatsNewOpen||l)return;const f=m=>{m.key==="Escape"?(m.preventDefault(),au()):m.key==="Tab"&&R3(m,a.current),m.stopImmediatePropagation()};return r.current?.focus(),window.addEventListener("keydown",f,!0),()=>{window.removeEventListener("keydown",f,!0);const m=n.current;n.current=null,m?.focus?.()}},[e.whatsNewOpen,l]),!e.whatsNewOpen||l||Pi===null?null:S.jsxs("div",{className:"whatsnew-overlay",role:"dialog","aria-modal":"true","aria-labelledby":"whatsnew-title",children:[S.jsx("button",{type:"button",className:"whatsnew-scrim",onClick:au,"aria-label":"Close What's new"}),S.jsxs("section",{className:"whatsnew-card",ref:a,children:[S.jsxs("header",{className:"whatsnew-header",children:[S.jsxs("div",{className:"whatsnew-heading-row",children:[S.jsx("h2",{id:"whatsnew-title",children:"What's new"}),S.jsxs("span",{className:"whatsnew-version-badge",children:["v",Pi.version]})]}),S.jsxs("time",{className:"whatsnew-date",dateTime:Pi.date,children:["Released ",Pi.date]})]}),S.jsx("button",{ref:r,type:"button",className:"whatsnew-close",onClick:au,"aria-label":"Close What's new",children:"x"}),S.jsx("div",{className:"whatsnew-body",children:Pi.sections.map((f,m)=>S.jsx(k3,{section:f,index:m},f.heading))}),S.jsx("footer",{className:"whatsnew-footer",children:S.jsx("button",{type:"button",className:"whatsnew-done",onClick:au,children:"Close"})})]})]})}function k3({section:e,index:n}){const r=e.heading.toLowerCase().replaceAll(" ","-"),a={"--whatsnew-delay":`${n*55}ms`};return S.jsxs("section",{className:`whatsnew-section whatsnew-section--${r}`,style:a,children:[S.jsx("h3",{children:S.jsx("span",{className:"whatsnew-section-chip",children:e.heading})}),S.jsx("ul",{children:e.items.map(l=>S.jsx("li",{children:l},l))})]})}function R3(e,n){if(!n)return;const r=Array.from(n.querySelectorAll(T3)),a=r[0],l=r[r.length-1];!a||!l||(e.shiftKey&&document.activeElement===a?(e.preventDefault(),l.focus()):!e.shiftKey&&document.activeElement===l&&(e.preventDefault(),a.focus()))}const L3=new Set(["idle_prompt","permission_prompt","auth_success","elicitation_dialog","elicitation_complete","elicitation_response"]);function M3(){let e="";return n=>{e+=n;const r=[];let a=e.indexOf(`
|
|
13
|
+
|
|
14
|
+
`);for(;a>=0;){const l=e.slice(0,a);e=e.slice(a+2);const f=O3(l);f&&r.push(f),a=e.indexOf(`
|
|
15
|
+
|
|
16
|
+
`)}return r}}function D3(e){if(!e.data)return null;let n;try{n=JSON.parse(e.data)}catch{return null}if(e.event==="observer:truncated"){const a=n.tenant?.tenantId;return!a||!n.truncation?null:{kind:"truncation",tenantId:a,tenantLabel:n.tenant?.tenantLabel,truncation:n.truncation}}if(e.event==="session:updated"){const a=$b(n.session);return a?{kind:"session",tenantId:a.tenantId??a.sessionId,session:a}:null}if(e.event==="session:attention"){const a=$b(n.session);return a?{kind:"attention",tenantId:a.tenantId??a.sessionId,session:a,reason:N3(n.reason)}:null}const r=zb(n.event)??zb(n);return r?{kind:"event",tenantId:r.tenantId,tenantLabel:n.tenant?.tenantLabel,event:r}:null}function O3(e){const n=e.split(`
|
|
17
|
+
`),r=n.find(l=>l.startsWith("event:"))?.slice(6).trim()??"message",a=n.filter(l=>l.startsWith("data:")).map(l=>l.slice(5).trim()).join(`
|
|
18
|
+
`);return!a&&r==="message"?null:{event:r,data:a}}function zb(e){if(typeof e!="object"||e===null)return null;const n=e;return typeof n.id!="number"||typeof n.tenantId!="string"||typeof n.type!="string"||typeof n.at!="number"?null:typeof n.event!="object"||n.event===null?{...n,event:{}}:n}function $b(e){if(typeof e!="object"||e===null)return null;const n=e;return typeof n.sessionId!="string"||typeof n.cwdLabel!="string"||typeof n.sequence!="number"||typeof n.status!="string"||typeof n.createdAt!="number"||"cwd"in n||"canonicalCwd"in n||"providerSession"in n||"ticket"in n||"token"in n||"transcriptPath"in n?null:{sessionId:n.sessionId,terminalSessionId:typeof n.terminalSessionId=="string"?n.terminalSessionId:n.sessionId,cwdLabel:n.cwdLabel,sequence:n.sequence,label:typeof n.label=="string"?n.label:void 0,cliId:typeof n.cliId=="string"?n.cliId:void 0,cliLabel:typeof n.cliLabel=="string"?n.cliLabel:void 0,status:n.status,turnState:n.turnState==="running"||n.turnState==="ended"?n.turnState:"none",createdAt:n.createdAt,theaterId:typeof n.theaterId=="string"?n.theaterId:void 0,tenantId:typeof n.tenantId=="string"?n.tenantId:void 0,registrationId:typeof n.registrationId=="string"?n.registrationId:void 0,resumeAvailable:n.resumeAvailable===!0}}function N3(e){return typeof e=="string"&&L3.has(e)?e:void 0}const Pb=250,B3=5e3;function I3(){const e=new AbortController;return j3(e.signal),()=>e.abort()}async function j3(e){let n=Pb,r=!1;const a=async()=>{if(!r){r=!0;try{PS(await cS(e))}catch{}finally{r=!1}}};for(;!e.aborted;){He({connection:"connecting"});try{await $3(e);const l=await zT(e);He({connection:"live",connectionError:null}),n=Pb,await z3(l,e,a),e.aborted||He({connection:"connecting",connectionError:null})}catch(l){if(e.aborted)return;He({connection:"connecting",connectionError:l instanceof Error?l.message:String(l)})}if(e.aborted)return;await P3(n,e),n=Math.min(n*2,B3)}}async function z3(e,n,r){const a=new TextDecoder,l=M3();for(;!n.aborted;){const f=await e.read();if(f.done)return;for(const m of l(a.decode(f.value,{stream:!0}))){const c=D3(m);if(c){if(c.kind==="truncation"&&c.truncation){QA(c.tenantId,c.tenantLabel,c.truncation);continue}if(c.kind==="session"&&c.session){sh(c.session);continue}if(c.kind==="attention"&&c.session){FA(c.session,c.reason);continue}if(c.event){const{unknownTenant:u}=JA(c.event,c.tenantLabel);u&&r()}}}}}async function $3(e){const[n,r]=await Promise.all([cS(e),jT(e)]);PS(n),ZA(r)}async function P3(e,n){await new Promise(r=>{const a=()=>{clearTimeout(l),n.removeEventListener("abort",a),r()},l=setTimeout(a,e);n.addEventListener("abort",a)})}const H3=new Set(["token","credential","cwd","path","persona","prompt","toolAllowlist","allowedExecutorTools"]);async function ew(e){const n=await fetch("/carrier-settings/state",{signal:e});return await zg(n),tw(await n.json(),n.status)}async function U3(e){const n=await fetch("/carrier-settings/options",{signal:e});return await zg(n),V3(await n.json(),n.status)}async function F3(e,n,r){return uo(`/carrier-settings/carriers/${encodeURIComponent(e)}/cli`,"PUT",{cliType:n},r)}async function q3(e,n,r){return uo(`/carrier-settings/carriers/${encodeURIComponent(e)}/model`,"PUT",n,r)}async function W3(e,n,r){return uo(`/carrier-settings/carriers/${encodeURIComponent(e)}/display-name`,"PATCH",{displayName:n},r)}async function Hb(e,n,r){return uo(`/carrier-settings/carriers/${encodeURIComponent(e)}/agent-mode`,"PUT",{agentMode:n},r)}async function G3(e,n,r,a){return uo(`/carrier-settings/carriers/${encodeURIComponent(e)}/taskforce/${encodeURIComponent(n)}`,"PUT",r,a)}async function K3(e,n,r){return uo(`/carrier-settings/carriers/${encodeURIComponent(e)}/taskforce/${encodeURIComponent(n)}`,"DELETE",{},r)}async function uo(e,n,r,a){const l=await fetch(e,{method:n,headers:{"Content-Type":"application/json"},body:JSON.stringify(r),signal:a});await zg(l);const f=await l.json();if(!f||typeof f!="object"||!("state"in f))throw new Ge(l.status,"Invalid carrier settings mutation response");return{state:tw(f.state,l.status)}}async function zg(e){if(e.ok)return;let n=e.statusText||`HTTP ${e.status}`;try{const r=await e.json();typeof r.error=="string"&&(n=r.error)}catch{}throw new Ge(e.status,n)}function tw(e,n){nw(e,n);const r=e;if(!r||typeof r.generation!="number"||!Array.isArray(r.carriers))throw new Ge(n,"Invalid carrier settings state response");return{generation:r.generation,carriers:r.carriers.map(a=>Y3(a,n))}}function V3(e,n){nw(e,n);const r=e;if(!r||!Array.isArray(r.cliTypes)||!r.taskForceConstraints||typeof r.taskForceConstraints.minBackends!="number")throw new Ge(n,"Invalid carrier settings options response");return{cliTypes:r.cliTypes.map(a=>X3(a,n)),taskForceConstraints:{minBackends:r.taskForceConstraints.minBackends}}}function Y3(e,n){const r=e;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 Ge(n,"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=>J3(a,n))}}}function X3(e,n){const r=e;if(!r||typeof r.id!="string"||typeof r.displayName!="string"||typeof r.supportsSubagent!="boolean"||!Array.isArray(r.models)||typeof r.defaultModel!="string")throw new Ge(n,"Invalid carrier settings CLI option");return{id:r.id,displayName:r.displayName,supportsSubagent:r.supportsSubagent,models:r.models.map(a=>Z3(a,n)),defaultModel:r.defaultModel}}function Z3(e,n){const r=e;if(!r||typeof r.modelId!="string"||typeof r.name!="string")throw new Ge(n,"Invalid carrier settings model option");if(r.effort!==void 0&&(!Array.isArray(r.effort.levels)||typeof r.effort.default!="string"))throw new Ge(n,"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 J3(e,n){const r=e;if(!r||typeof r.cliType!="string"||typeof r.model!="string"||r.effort!==void 0&&typeof r.effort!="string")throw new Ge(n,"Invalid carrier settings Task Force backend");return{cliType:r.cliType,model:r.model,...r.effort?{effort:r.effort}:{}}}function nw(e,n){const r=[e];for(;r.length>0;){const a=r.pop();if(!(!a||typeof a!="object"))for(const[l,f]of Object.entries(a)){if(H3.has(l))throw new Ge(n,"Carrier settings response leaked a restricted field");f&&typeof f=="object"&&r.push(f)}}}const Q3={cliType:"",model:"",effort:"",displayName:"",agentMode:"cli",taskforce:{}},$p=new Set;let Rn={loading:!1,state:null,options:null,activeCarrierId:null,draft:Q3,savingActionId:null,error:null};function iw(){return H.useSyncExternalStore(eR,Ub,Ub)}function Ub(){return Rn}function eR(e){return $p.add(e),()=>{$p.delete(e)}}async function Fb(e){er({loading:!0,error:null});try{const[n,r]=await Promise.all([ew(e),U3(e)]);rw(n,r)}catch(n){if(e?.aborted)return;er({loading:!1,error:aw(n)})}}function tR(e){const n=Rn.state?.carriers.find(r=>r.carrierId===e);er({activeCarrierId:e,draft:n?$g(n,Rn.options):Rn.draft,error:null})}function Gs(e){er({draft:{...Rn.draft,...e},error:null})}function Pp(e,n){const r=Rn.draft.taskforce[e]??{model:"",effort:""};er({draft:{...Rn.draft,taskforce:{...Rn.draft.taskforce,[e]:{...r,...n}}},error:null})}function nR(){const e=sw();e&&er({draft:$g(e,Rn.options),error:null})}async function iR(e){const n=sw();return n?rR("save-all",async()=>{const r=Rn.draft;let a=null;r.displayName!==n.displayName&&(a=(await W3(n.carrierId,r.displayName)).state);const l=r.cliType!==n.cliType;return l&&(a=(await F3(n.carrierId,r.cliType)).state),(l||r.model!==n.model||(r.effort||"")!==(n.effort||""))&&(a=(await q3(n.carrierId,aR(r))).state),r.agentMode==="subagent"?(n.agentMode!=="subagent"||n.taskForceBackendCount>0)&&(a=(await Hb(n.carrierId,"subagent")).state):(n.agentMode!=="cli"&&(a=(await Hb(n.carrierId,"cli")).state),a=await oR(n,e,a)),{state:a??await ew()}}):!1}function rw(e,n){const r=lR(e,Rn.activeCarrierId),a=e.carriers.find(l=>l.carrierId===r)??null;er({loading:!1,state:e,options:n,activeCarrierId:r,draft:a?$g(a,n):Rn.draft,error:null})}async function rR(e,n){er({savingActionId:e,error:null});try{const r=await n();return rw(r.state,Rn.options??{cliTypes:[],taskForceConstraints:{minBackends:2}}),er({savingActionId:null}),!0}catch(r){return er({savingActionId:null,error:aw(r)}),!1}}function $g(e,n){const r=Object.fromEntries((n?.cliTypes??[]).map(a=>{const l=e.taskforce.backends.find(f=>f.cliType===a.id);return[a.id,{model:l?.model??a.defaultModel,effort:l?.effort??sR(a.id,l?.model??a.defaultModel,n)??""}]}));return{cliType:e.cliType,model:e.model,effort:e.effort??"",displayName:e.displayName,agentMode:e.agentMode,taskforce:r}}function sR(e,n,r){return r?.cliTypes.find(f=>f.id===e)?.models.find(f=>f.modelId===n)?.effort?.default??null}function aR(e){return{model:e.model,...e.effort?{effort:e.effort}:{}}}function sw(){return Rn.state?.carriers.find(e=>e.carrierId===Rn.activeCarrierId)??null}async function oR(e,n,r){const a=new Set(n.map(l=>l.cliType));for(const l of e.taskforce.backends)a.has(l.cliType)||(r=(await K3(e.carrierId,l.cliType)).state);for(const l of n){const f=e.taskforce.backends.find(m=>m.cliType===l.cliType);f&&f.model===l.model&&(f.effort||"")===(l.effort||"")||(r=(await G3(e.carrierId,l.cliType,{model:l.model,...l.effort?{effort:l.effort}:{}})).state)}return r}function lR(e,n){return n&&e.carriers.some(r=>r.carrierId===n)?n:e.carriers[0]?.carrierId??null}function er(e){Rn={...Rn,...e};for(const n of $p)n()}function aw(e){return e instanceof Error?e.message:String(e)}const cR=50,uR=2400,hR={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 dR(){const e=iw(),n=e.state?.carriers.find(d=>d.carrierId===e.activeCarrierId)??null,r=e.options?.cliTypes.find(d=>d.id===e.draft.cliType)??null,a=r?.models.find(d=>d.modelId===e.draft.model)??null,[l,f]=H.useState(!1),[m,c]=H.useState([]),[u,h]=H.useState("idle"),y=m.length>0,g=e.draft.agentMode==="subagent",C=e.draft.agentMode==="subagent",E=e.savingActionId==="save-all",A=n?vR(n,e.draft,m):!1,T=n?.taskforce.backends.map(d=>`${d.cliType}:${d.model}:${d.effort??""}`).join("|")??"";H.useEffect(()=>{const d=new AbortController;return Fb(d.signal),()=>d.abort()},[]),H.useEffect(()=>{f(!1),c(n?.taskforce.backends.map(d=>d.cliType)??[]),h("idle")},[n?.carrierId,T]),H.useEffect(()=>{if(u!=="saved")return;const d=window.setTimeout(()=>h("idle"),uR);return()=>window.clearTimeout(d)},[u]);function p(){n&&(nR(),c(n.taskforce.backends.map(d=>d.cliType)),f(!1),h("idle"))}async function v(){if(!n)return;if(h("saving"),!await iR(yR(m,e.draft.taskforce))){h("idle");return}f(!1),h("saved")}return S.jsxs("main",{className:"carrier-settings-page",children:[S.jsxs("section",{className:"carrier-settings-hero","aria-labelledby":"carrier-settings-title",children:[S.jsxs("div",{children:[S.jsx("p",{className:"bridge-kicker",children:"Carrier Control Surface"}),S.jsx("h2",{id:"carrier-settings-title",children:"Carrier Settings"})]}),S.jsxs("div",{className:"carrier-settings-hero-actions",children:[S.jsx("div",{className:`carrier-settings-save-status ${u==="saved"?"is-positive":""}`,role:"status","aria-live":"polite",children:u==="saving"||E?"Saving…":u==="saved"?"Saved ✓":""}),n?S.jsxs("div",{className:"carrier-settings-save-actions",children:[S.jsx("button",{type:"button",className:`carrier-settings-action-button ${A?"is-dirty":""}`,disabled:!A||E,onClick:()=>{v()},children:"Save"}),S.jsx("button",{type:"button",className:`carrier-settings-action-button ${A?"is-dirty":""}`,disabled:!A||E,onClick:p,children:"Discard"})]}):null,S.jsx("button",{type:"button",className:"carrier-settings-action-button carrier-settings-hero-refresh",disabled:e.loading,onClick:()=>{Fb()},children:"Refresh"})]})]}),e.error?S.jsx("p",{className:"carrier-settings-error",role:"alert",children:e.error}):null,S.jsxs("section",{className:"carrier-settings-grid",children:[S.jsxs("div",{className:"carrier-settings-list","aria-label":"Carrier list",children:[e.loading&&!e.state?S.jsx("p",{className:"carrier-settings-empty",children:"Loading carrier settings."}):null,e.state&&e.state.carriers.length===0?S.jsx("p",{className:"carrier-settings-empty",children:"No carriers registered."}):null,e.state?.carriers.map(d=>S.jsx(fR,{carrier:d,active:d.carrierId===e.activeCarrierId,minBackends:e.options?.taskForceConstraints.minBackends??2,onSelect:()=>tR(d.carrierId)},d.carrierId))]}),n&&e.options&&r?S.jsxs("div",{className:"carrier-settings-detail",style:cw(n.carrierId),children:[S.jsxs("div",{className:"carrier-settings-detail-head",children:[S.jsxs("div",{className:"carrier-settings-detail-title-block",children:[S.jsxs("div",{className:"carrier-settings-captain-id",children:[S.jsx("span",{children:"Captain"})," · ",n.carrierId.toUpperCase()]}),S.jsx("div",{className:`carrier-settings-name-line ${l?"is-editing":""}`,children:l?S.jsxs(S.Fragment,{children:[S.jsx("input",{id:"carrier-display-name",className:"carrier-settings-input carrier-settings-name-input",value:e.draft.displayName,maxLength:cR,onChange:d=>Gs({displayName:d.target.value})}),S.jsx("button",{type:"button",className:"carrier-settings-icon-button","aria-label":"Save display name",disabled:E,onClick:()=>{f(!1)},children:S.jsx(wR,{})}),S.jsx("button",{type:"button",className:"carrier-settings-icon-button","aria-label":"Cancel display name edit",onClick:()=>{Gs({displayName:n.displayName}),f(!1)},children:S.jsx(CR,{})})]}):S.jsxs(S.Fragment,{children:[S.jsx("h3",{className:"carrier-settings-captain-name",children:n.displayName}),S.jsx("button",{type:"button",className:"carrier-settings-icon-button","aria-label":"Edit display name",onClick:()=>{Gs({displayName:n.displayName}),f(!0)},children:S.jsx(SR,{})})]})}),S.jsx("div",{className:"carrier-settings-captain-role",children:n.role})]}),S.jsxs("div",{className:"carrier-settings-cli-badge",children:[S.jsx("span",{className:"ind","aria-hidden":"true"}),n.cliType]})]}),S.jsxs("div",{className:"carrier-settings-body",children:[S.jsxs("div",{className:"carrier-settings-control-group",children:[S.jsx("div",{className:"carrier-settings-resp-title",children:"Identity"}),S.jsxs("div",{className:"carrier-settings-mission",children:['"',n.roleDescription,'"']})]}),S.jsxs("div",{className:"carrier-settings-control-group",children:[S.jsx("div",{className:"carrier-settings-resp-title",children:"Runtime"}),S.jsxs("div",{className:"carrier-settings-runtime",children:[S.jsx("div",{className:"carrier-settings-runtime-row carrier-settings-runtime-row--cli",children:S.jsxs("div",{className:"carrier-settings-field carrier-settings-field--wide",children:[S.jsx("label",{className:"carrier-settings-label",htmlFor:"carrier-cli",children:"CLI"}),S.jsx("select",{id:"carrier-cli",className:"carrier-settings-select",value:e.draft.cliType,onChange:d=>gR(d.target.value,e.options?.cliTypes??[]),children:e.options.cliTypes.map(d=>S.jsx("option",{value:d.id,children:d.displayName},d.id))})]})}),S.jsxs("div",{className:"carrier-settings-runtime-row carrier-settings-runtime-row--model",children:[S.jsx(ow,{id:"carrier-model",label:"Model",models:r.models,value:e.draft.model,onChange:d=>mR(r,d)}),S.jsx(lw,{id:"carrier-effort",model:a,value:e.draft.effort,onChange:d=>Gs({effort:d})})]})]})]}),S.jsx("div",{className:"carrier-settings-control-group",children:S.jsxs("div",{className:"carrier-settings-toggle-row",children:[S.jsxs("div",{children:[S.jsx("p",{className:"carrier-settings-resp-title",children:"SubAgent"}),S.jsx("p",{className:"carrier-settings-help",children:y?"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."})]}),S.jsx("button",{type:"button",className:`carrier-settings-toggle ${g?"is-on":""}`,disabled:E||!g&&(!r.supportsSubagent||y),"aria-pressed":g,onClick:()=>Gs({agentMode:g?"cli":"subagent"}),children:S.jsx("span",{children:g?"On":"Off"})})]})}),S.jsx(pR,{carrier:n,cliOptions:e.options.cliTypes,minBackends:e.options.taskForceConstraints.minBackends,savingActionId:e.savingActionId,rows:m,disabled:C,onRowsChange:c})]})]},n.carrierId):S.jsx("div",{className:"carrier-settings-detail",children:S.jsx("p",{className:"carrier-settings-empty",children:"Select a carrier."})})]})]})}function fR({carrier:e,active:n,minBackends:r,onSelect:a}){const l=e.taskForceBackendCount>=r;return S.jsxs("button",{type:"button",className:`carrier-settings-row ${n?"is-active":""}`,style:cw(e.carrierId),onClick:a,children:[S.jsx("span",{className:"carrier-settings-captain-dot","aria-hidden":"true"}),S.jsxs("span",{className:"carrier-settings-row-text",children:[S.jsx("span",{className:"carrier-settings-row-name",children:e.displayName}),S.jsx("span",{className:"carrier-settings-row-role",children:e.role})]}),S.jsxs("span",{className:"carrier-settings-row-live","aria-hidden":"true",children:[S.jsx("span",{className:`carrier-settings-live-dot ${e.subagentMode?"is-live":""}`}),S.jsx("span",{className:`carrier-settings-live-dot ${l?"is-live":""}`})]})]})}function ow({id:e,label:n,models:r,value:a,disabled:l=!1,onChange:f}){return S.jsxs("div",{className:"carrier-settings-field",children:[S.jsx("label",{className:"carrier-settings-label",htmlFor:e,children:n}),S.jsx("select",{id:e,className:"carrier-settings-select",value:a,disabled:l,onChange:m=>f(m.target.value),children:r.map(m=>S.jsx("option",{value:m.modelId,children:m.name},m.modelId))})]})}function lw({id:e,model:n,value:r,disabled:a=!1,onChange:l}){return n?.effort?S.jsxs("div",{className:"carrier-settings-field",children:[S.jsx("label",{className:"carrier-settings-label",htmlFor:e,children:"Effort"}),S.jsx("select",{id:e,className:"carrier-settings-select",value:r||n.effort.default,disabled:a,onChange:f=>l(f.target.value),children:n.effort.levels.map(f=>S.jsx("option",{value:f,children:f},f))})]}):S.jsxs("div",{className:"carrier-settings-field",children:[S.jsx("span",{className:"carrier-settings-label",children:"Effort"}),S.jsx("p",{className:"carrier-settings-help",children:"Not supported for this model."})]})}function pR({carrier:e,cliOptions:n,minBackends:r,savingActionId:a,rows:l,disabled:f,onRowsChange:m}){const c=iw(),u=e.taskforce.backends.length,[h,y]=H.useState(u>0),[g,C]=H.useState(!1),[E,A]=H.useState(""),T=e.taskForceBackendCount>=r,p=n.filter(d=>!l.includes(d.id)),v=E||p[0]?.id||"";return S.jsxs("div",{className:`carrier-settings-control-group carrier-settings-control-group--taskforce ${h?"is-expanded":""} ${f?"is-disabled":""}`,children:[S.jsxs("div",{className:"carrier-settings-section-head",children:[S.jsxs("div",{children:[S.jsx("p",{className:"carrier-settings-resp-title",children:"Task Force"}),S.jsx("p",{className:"carrier-settings-help",children:f?"Disabled while SubAgent is on. Turn SubAgent off before composing Task Force backends.":u>0?`${u} backend${u===1?"":"s"} configured${T?" · active":` · needs ${r}+ to activate`}.`:`Run this carrier across multiple CLI backends. Needs at least ${r} to activate.`})]}),S.jsx("div",{className:"carrier-settings-tf-head-actions",children:S.jsx("button",{type:"button",className:"carrier-settings-tf-toggle","aria-expanded":h,onClick:()=>y(d=>!d),children:h?"Hide":"Configure"})})]}),h?S.jsxs("div",{className:"carrier-settings-tf-list",children:[l.length===0?S.jsx("p",{className:"carrier-settings-tf-empty",children:"No Task Force backend drafted."}):null,l.map(d=>{const b=n.find(M=>M.id===d);if(!b)return null;const x=c.draft.taskforce[b.id]??{model:b.defaultModel,effort:""},L=b.models.find(M=>M.modelId===x.model)??b.models[0]??null,R=e.taskforce.backends.some(M=>M.cliType===b.id);return S.jsxs("div",{className:`carrier-settings-tf-item ${R?"is-active":""}`,children:[S.jsxs("div",{className:"carrier-settings-tf-title",children:[S.jsx("span",{className:`carrier-settings-live-dot ${R?"is-live":""}`,"aria-hidden":"true"}),S.jsx("strong",{children:b.displayName})]}),S.jsx(ow,{id:`tf-${b.id}-model`,label:"Model",models:b.models,value:x.model,disabled:f,onChange:M=>_R(b,M)}),S.jsx(lw,{id:`tf-${b.id}-effort`,model:L,value:x.effort,disabled:f,onChange:M=>Pp(b.id,{effort:M})}),S.jsx("div",{className:"carrier-settings-tf-actions",children:S.jsx("button",{type:"button",className:"carrier-settings-ghost-button",disabled:f||a==="save-all",onClick:()=>m(l.filter(M=>M!==b.id)),children:"Remove"})})]},b.id)}),S.jsxs("div",{className:"carrier-settings-tf-add-row",children:[g&&p.length>0?S.jsx("select",{className:"carrier-settings-select carrier-settings-tf-add-select",value:v,onChange:d=>A(d.target.value),"aria-label":"Task Force CLI to add",children:p.map(d=>S.jsx("option",{value:d.id,children:d.displayName},d.id))}):null,S.jsx("button",{type:"button",className:"carrier-settings-ghost-button",disabled:f||p.length===0||a==="save-all",onClick:()=>{if(!g){C(!0);return}const d=v,b=n.find(L=>L.id===d),x=b?.models.find(L=>L.modelId===b.defaultModel)??b?.models[0]??null;!b||!x||(Pp(b.id,{model:x.modelId,effort:x.effort?.default??""}),m(l.includes(b.id)?l:[...l,b.id]),A(""),C(!1))},children:"Add"})]})]}):null]})}function gR(e,n){const r=n.find(f=>f.id===e),a=r?.models.find(f=>f.modelId===r.defaultModel)??r?.models[0]??null,l={cliType:e,model:a?.modelId??"",effort:a?.effort?.default??""};r?.supportsSubagent||(l.agentMode="cli"),Gs(l)}function mR(e,n){const r=e.models.find(a=>a.modelId===n);Gs({model:n,effort:r?.effort?.default??""})}function _R(e,n){const r=e.models.find(a=>a.modelId===n);Pp(e.id,{model:n,effort:r?.effort?.default??""})}function vR(e,n,r){return n.displayName!==e.displayName||n.cliType!==e.cliType||n.model!==e.model||(n.effort||"")!==(e.effort||"")||n.agentMode!==e.agentMode?!0:n.agentMode==="subagent"?e.taskForceBackendCount>0:bR(e,r,n.taskforce)}function bR(e,n,r){if(n.length!==e.taskforce.backends.length)return!0;const a=new Set(n);for(const l of e.taskforce.backends){if(!a.has(l.cliType))return!0;const f=r[l.cliType];if(!f||f.model!==l.model||(f.effort||"")!==(l.effort||""))return!0}return!1}function yR(e,n){return e.map(r=>{const a=n[r];return a?{cliType:r,model:a.model,...a.effort?{effort:a.effort}:{}}:null}).filter(r=>r!==null)}function cw(e){return{"--cap-color":hR[e]??"var(--brass)"}}function SR(){return S.jsxs("svg",{viewBox:"0 0 16 16","aria-hidden":"true",focusable:"false",children:[S.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"}),S.jsx("path",{d:"M9.7 3.4 12.6 6.3"})]})}function wR(){return S.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",focusable:"false",children:S.jsx("path",{d:"M3 8.3 6.4 11.7 13.2 4.5"})})}function CR(){return S.jsxs("svg",{viewBox:"0 0 16 16","aria-hidden":"true",focusable:"false",children:[S.jsx("path",{d:"M4.2 4.2 11.8 11.8"}),S.jsx("path",{d:"M11.8 4.2 4.2 11.8"})]})}function Ee(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">")}function Ye(e){return Ee(e).replace(/"/g,""")}const xR="contextual-knowledge-not-instructions";function ER(e,n,r){const a=r?.whyThisMatched??e.frontmatter.whyThisMatched,l=dw(e,n);return`
|
|
19
|
+
<div class="context-actions-grid">
|
|
20
|
+
<button class="context-action-btn" type="button" data-action="copy-compact-context">
|
|
21
|
+
<span class="context-action-label">Compact context</span>
|
|
22
|
+
<span class="context-action-meta">${ku(uw(e))} tok</span>
|
|
23
|
+
</button>
|
|
24
|
+
<button class="context-action-btn" type="button" data-action="copy-provenance-context">
|
|
25
|
+
<span class="context-action-label">Provenance</span>
|
|
26
|
+
<span class="context-action-meta">${ku(hw(e))} tok</span>
|
|
27
|
+
</button>
|
|
28
|
+
<button class="context-action-btn" type="button" data-action="copy-related-context">
|
|
29
|
+
<span class="context-action-label">Context pack</span>
|
|
30
|
+
<span class="context-action-meta">${ku(l)} tok</span>
|
|
31
|
+
</button>
|
|
32
|
+
${a?`
|
|
33
|
+
<button class="context-action-btn context-action-btn--secondary" type="button" data-action="toggle-why-matched">
|
|
34
|
+
<span class="context-action-label">Why this matched</span>
|
|
35
|
+
</button>
|
|
36
|
+
<div class="context-why-matched" hidden>${Ee(a)}</div>
|
|
37
|
+
`:""}
|
|
38
|
+
</div>
|
|
39
|
+
`}function uw(e){const n={id:e.frontmatter.id,title:e.frontmatter.title,status:e.frontmatter.status??null,tags:e.frontmatter.tags,updated:e.frontmatter.updated,summary:Pg(e.body)};return JSON.stringify({...n,token_estimate:ku(JSON.stringify(n))},null,2)}function hw(e){return[`# ${e.frontmatter.title} (\`${e.frontmatter.id}\`)`,"",`- updated: ${e.frontmatter.updated}`,`- status: ${e.frontmatter.status??"unknown"}`,`- raw_source_ref: ${e.frontmatter.rawSourceRef??"(none)"}`,`- raw_source_refs: ${(e.frontmatter.rawSourceRefs??[]).join(", ")||"(none)"}`,"","## Summary",Pg(e.body)].join(`
|
|
40
|
+
`)}function dw(e,n){const r=new Set([...e.frontmatter.related??[]]),a=n.filter(l=>r.has(l.id)).sort((l,f)=>l.title.localeCompare(f.title));return[`<fleet-wiki-context boundary="${xR}">`,"# Fleet Wiki Context Pack","",`## Entry: ${e.frontmatter.title} (\`${e.frontmatter.id}\`)`,"",`- updated: ${e.frontmatter.updated}`,`- status: ${e.frontmatter.status??"unknown"}`,`- tags: ${e.frontmatter.tags.join(", ")||"(none)"}`,"","### Summary",Pg(e.body),"","### Related Entries",...a.length>0?a.map(l=>`- [[wiki:${l.id}]] — ${l.title}`):["- (none)"],"","</fleet-wiki-context>"].join(`
|
|
41
|
+
`)}function ku(e){return Math.max(1,Math.ceil(e.length/4))}function Pg(e){return e.replace(/\s+/g," ").trim().slice(0,240)||"(empty)"}async function TR(){return sr(ti("/health"))}async function AR(){return sr(ti("/workspaces"))}async function kR(){return sr(ti("/index"))}async function RR(){return pw(ti("/index-md"))}async function LR(e){return sr(ti(`/entry/${encodeURIComponent(e)}`))}async function MR(e,n=[],r=!1){const a=new URLSearchParams;e&&a.set("q",e),n.length>0&&a.set("tags",n.join(",")),r&&a.set("enhanced","true");const l=a.toString();return sr(ti(`/search${l?`?${l}`:""}`))}async function DR(e){return pw(ti(`/raw?ref=${encodeURIComponent(e)}`))}async function ch(e){return sr(ti(`/queue?status=${encodeURIComponent(e)}`))}async function OR(e){return sr(ti(`/queue/${encodeURIComponent(e)}`))}async function NR(e){return gw(ti(`/queue/${encodeURIComponent(e)}/approve`),{})}async function BR(e,n){return gw(ti(`/queue/${encodeURIComponent(e)}/reject`),{reason:n})}async function fw(){return sr(ti("/conflicts"))}async function IR(e){return sr(ti(`/conflicts/${encodeURIComponent(e)}`))}async function jR(e){const n=typeof e=="number"?`?limit=${encodeURIComponent(String(e))}`:"";return sr(ti(`/log${n}`))}function ti(e){const n=window.location.pathname.match(/^\/console\/codex\/w\/([^/]+)(?:\/|$)/),r=e.startsWith("/")?e:`/${e}`;return n?`/console/codex/w/${encodeURIComponent(decodeURIComponent(n[1]??""))}/api${r}`:`/console/codex/api${r}`}async function sr(e){const n=await fetch(e,{headers:{accept:"application/json"}});if(!n.ok)throw new Error(await Hg(e,n));return n.json()}async function pw(e){const n=await fetch(e,{headers:{accept:"text/markdown,text/plain"}});if(!n.ok)throw new Error(await Hg(e,n));return n.text()}async function gw(e,n){const r=await fetch(e,{method:"POST",headers:{"content-type":"application/json",accept:"application/json"},body:JSON.stringify(n)});if(!r.ok)throw new Error(await Hg(e,r));return r.json()}async function Hg(e,n){return(await n.json().catch(()=>null))?.error??`${e} request failed: ${n.status}`}const zR=/^[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}$/,Ui="/console/codex",Hp=new Set;let Ja=null;function ql(){const e=GR(KR(yw(window.location.pathname)).pathname);return e.name==="queue"?{name:"queue",tab:new URLSearchParams(window.location.search).get("tab")==="archived"?"archived":"pending"}:e}function Up(){return bw(yw(window.location.pathname))?.wsId??null}function ea(e){e!==window.location.pathname+window.location.search&&(window.history.pushState({},"",e),Fg(ql()))}function $R(e){window.history.replaceState({},"",e),Fg(ql())}function PR(e){return Hp.add(e),()=>Hp.delete(e)}function HR(){Ja||(Ja=()=>Fg(ql()),window.addEventListener("popstate",Ja))}function UR(){Ja&&(window.removeEventListener("popstate",Ja),Ja=null)}function $r(e){return nr(`/entry/${encodeURIComponent(e)}`)}function mw(e){return nr(`/raw/${encodeURIComponent(e)}`)}function ro(e="pending"){return nr(e==="archived"?"/queue?tab=archived":"/queue")}function FR(e){return nr(`/queue/${encodeURIComponent(e)}`)}function qR(){return nr("/conflicts")}function WR(e){return nr(`/conflicts/${encodeURIComponent(e)}`)}function _w(){return nr("/index-md")}function vw(e){return nr(typeof e!="number"?"/log":`/log?limit=${encodeURIComponent(String(e))}`)}function Ug(){return nr("/")}function qb(e){return`${Ui}/w/${encodeURIComponent(e)}/`}function GR(e){if(e==="/index"||e==="/index-md")return{name:"index-md"};if(e==="/log"){const f=new URLSearchParams(window.location.search).get("limit"),m=Number(f??20);return{name:"log",limit:Number.isInteger(m)?m:20}}if(e==="/conflicts")return{name:"conflicts"};const n=e.match(/^\/conflicts\/([^/]+)$/);if(n)return{name:"conflict-detail",id:decodeURIComponent(n[1]??"")};const r=e.match(/^\/entry\/([^/]+)$/);if(r)return{name:"entry",id:decodeURIComponent(r[1]??"")};const a=e.match(/^\/raw\/(.+)$/);if(a)return{name:"raw",ref:decodeURIComponent(a[1]??"")};if(e==="/queue")return{name:"queue",tab:"pending"};const l=e.match(/^\/queue\/([^/]+)$/);if(l){const f=decodeURIComponent(l[1]??"");return zR.test(f)?{name:"queue-detail",patchId:f}:{name:"home"}}return{name:"home"}}function nr(e){const n=Up();return n?`${Ui}/w/${encodeURIComponent(n)}${e}`:`${Ui}${e}`}function KR(e){const n=bw(e);return n?{pathname:n.pathname,wsId:n.wsId}:{pathname:e,wsId:null}}function bw(e){const n=e.match(/^\/w\/([^/]+)(\/.*)?$/);return n?{wsId:decodeURIComponent(n[1]??""),pathname:n[2]??"/"}:null}function yw(e){return e===Ui||e===`${Ui}/`?"/":e.startsWith(`${Ui}/`)?e.slice(Ui.length)||"/":e}function Fg(e){for(const n of Hp)n(e)}const Sw="fleet-wiki-web-recent",Fp=new Set,ta={health:null,index:[],currentEntry:null,currentMatchHint:null,conflicts:[],currentConflict:null,indexMarkdown:null,log:null,loading:!1,error:null,recentIds:nL(),pendingPatchCount:0,currentWorkspaceId:null,workspaces:[]};function Ru(){return ta}function VR(e){return Fp.add(e),()=>Fp.delete(e)}async function YR(){Qt({loading:!0,error:null});try{const[e,n,r,a]=await Promise.all([TR(),kR(),ch("pending").catch(()=>null),AR().catch(()=>null)]);Qt({health:e,index:n,pendingPatchCount:r?.pendingCount??0,currentWorkspaceId:a?.currentWorkspaceId??null,workspaces:a?.workspaces??[],loading:!1})}catch(e){Qt({loading:!1,error:ho(e)})}}async function XR(e){Qt({loading:!0,error:null,currentEntry:null,currentMatchHint:ta.currentMatchHint?.id===e?ta.currentMatchHint:null,currentConflict:null,indexMarkdown:null,log:null});try{const n=await LR(e),r=tL(e);Qt({currentEntry:n,currentConflict:null,indexMarkdown:null,log:null,recentIds:r,loading:!1})}catch(n){Qt({loading:!1,error:ho(n)})}}async function ZR(){Qt({loading:!0,error:null,currentEntry:null,currentConflict:null,log:null});try{Qt({indexMarkdown:await RR(),loading:!1})}catch(e){Qt({loading:!1,error:ho(e)})}}async function JR(e){Qt({loading:!0,error:null,currentEntry:null,currentConflict:null,indexMarkdown:null});try{Qt({log:await jR(e),loading:!1})}catch(n){Qt({loading:!1,error:ho(n)})}}async function QR(){Qt({loading:!0,error:null,currentEntry:null,currentConflict:null,indexMarkdown:null,log:null});try{Qt({conflicts:await fw(),loading:!1})}catch(e){Qt({loading:!1,error:ho(e)})}}async function eL(e){Qt({loading:!0,error:null,currentEntry:null,indexMarkdown:null,log:null});try{const[n,r]=await Promise.all([IR(e),fw().catch(()=>ta.conflicts)]);Qt({currentConflict:n,conflicts:r,loading:!1})}catch(n){Qt({loading:!1,error:ho(n)})}}function If(){Qt({currentEntry:null,currentMatchHint:null,currentConflict:null,indexMarkdown:null,log:null,error:null,loading:!1})}function ww(e){Qt({currentMatchHint:e})}function qg(e){Qt({pendingPatchCount:e})}function Qt(e){Object.assign(ta,e);for(const n of Fp)n(ta)}function tL(e){const n=[e,...ta.recentIds.filter(r=>r!==e)].slice(0,8);return window.localStorage.setItem(Sw,JSON.stringify(n)),n}function nL(){try{const e=window.localStorage.getItem(Sw),n=e?JSON.parse(e):[];return Array.isArray(n)?n.filter(r=>typeof r=="string").slice(0,8):[]}catch{return[]}}function ho(e){return e instanceof Error?e.message:String(e)}const ke={open:!1,query:"",selectedIndex:0,results:[],debounceId:null,searchSeq:0,previousBodyOverflow:null,previousActiveElement:null};let qp=[],Wg=[];function iL(e,n){qp=e,Wg=n,ke.open&&!ke.query&&(ke.results=Gg(),ke.selectedIndex=0,Uu())}function Cw(){if(ke.open){Gb();return}ke.open=!0,ke.query="",ke.selectedIndex=0,ke.results=Gg(),ke.previousActiveElement=document.activeElement instanceof HTMLElement?document.activeElement:null,pL(),cL(),Uu(),Gb()}function Qa(){ke.open&&(ke.open=!1,ke.searchSeq++,ke.debounceId!==null&&(window.clearTimeout(ke.debounceId),ke.debounceId=null),uL(),gL(),mL())}function rL(){document.addEventListener("keydown",xw),document.addEventListener("input",Ew),document.addEventListener("click",Tw),document.addEventListener("mouseover",Aw)}function sL(){ke.open&&Qa(),document.removeEventListener("keydown",xw),document.removeEventListener("input",Ew),document.removeEventListener("click",Tw),document.removeEventListener("mouseover",Aw)}function aL(){return ke.open}function xw(e){if((e.metaKey||e.ctrlKey)&&e.key.toLowerCase()==="k"){e.preventDefault(),ke.open?Qa():Cw();return}if(ke.open){if(e.key==="Tab"){_L(e);return}if(e.key==="Escape"){e.preventDefault(),Qa();return}if(e.key==="ArrowDown"){e.preventDefault(),ke.selectedIndex=Math.min(ke.selectedIndex+1,Math.max(0,ke.results.length-1)),Wp({scroll:!0});return}if(e.key==="ArrowUp"){e.preventDefault(),ke.selectedIndex=Math.max(0,ke.selectedIndex-1),Wp({scroll:!0});return}if(e.key==="Enter"){e.preventDefault();const r=ke.results[ke.selectedIndex];if(!r)return;ww(r),ea($r(r.id)),Qa()}}}function Ew(e){const n=e.target;!(n instanceof HTMLInputElement)||n.id!=="command-input"||(ke.query=n.value.trim(),ke.selectedIndex=0,ke.debounceId!==null&&window.clearTimeout(ke.debounceId),ke.debounceId=window.setTimeout(()=>{oL(ke.query)},150))}function Tw(e){const n=e.target;if(!(n instanceof Element))return;if(n.matches("[data-action='open-command']")||n.closest("[data-action='open-command']")){Cw();return}if(!ke.open)return;if(n.classList.contains("command-overlay")){Qa();return}const r=n.closest("[data-command-entry-id]");if(r){const a=ke.results.find(l=>l.id===(r.dataset.commandEntryId??""));ww(a??null),ea($r(r.dataset.commandEntryId??"")),Qa()}}function Aw(e){if(!ke.open)return;const n=e.target;if(!(n instanceof Element))return;const r=n.closest("[data-command-index]");if(!r)return;const a=Number(r.dataset.commandIndex);!Number.isInteger(a)||a<0||a>=ke.results.length||(ke.selectedIndex=a,Wp({scroll:!1}))}async function oL(e){const n=++ke.searchSeq;if(!e){ke.results=Gg(),ke.selectedIndex=0,Uu();return}let r;try{r=await MR(e)}catch{r=[]}n!==ke.searchSeq||!ke.open||(ke.results=r,ke.selectedIndex=0,Uu())}function lL(){let e=document.querySelector("#command-palette-root");return e||(e=document.createElement("div"),e.id="command-palette-root",document.body.append(e)),e}function cL(){const e=lL();e.querySelector(".command-overlay")||(e.innerHTML=hL())}function uL(){const e=document.querySelector("#command-palette-root");e&&(e.innerHTML="")}function Uu(){const e=document.querySelector("#command-results-list");if(e){if(ke.results.length===0){e.innerHTML=`<p class="empty-state">${Ee("No results found.")}</p>`;return}e.innerHTML=ke.query?ke.results.map(kw).join(""):dL()}}function Wp(e={scroll:!0}){const n=document.querySelectorAll(".command-result");n.forEach((a,l)=>{a.classList.toggle("active",l===ke.selectedIndex)});const r=n[ke.selectedIndex];e.scroll&&r?.scrollIntoView({block:"nearest"})}function hL(){const e=Ye("Command palette"),n=Ye("Search titles · tags · content");return`
|
|
42
|
+
<div class="command-overlay">
|
|
43
|
+
<section class="command-card" role="dialog" aria-modal="true" aria-label="${e}" tabindex="-1">
|
|
44
|
+
<div class="command-search">
|
|
45
|
+
<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">
|
|
46
|
+
<circle cx="11" cy="11" r="6.5" />
|
|
47
|
+
<path d="m20 20-3.5-3.5" />
|
|
48
|
+
</svg>
|
|
49
|
+
<input id="command-input" type="search" autocomplete="off" spellcheck="false" placeholder="${n}" />
|
|
50
|
+
<kbd>esc</kbd>
|
|
51
|
+
</div>
|
|
52
|
+
<div class="command-results" id="command-results-list"></div>
|
|
53
|
+
</section>
|
|
54
|
+
</div>
|
|
55
|
+
`}function kw(e,n){const r=n===ke.selectedIndex?" active":"",a=Ye(e.title),l=e.tags.slice(0,2),f=e.tags.length-l.length,m=SL(e),c=l.map(h=>`<span class="chip chip-tag">${Ee(h)}</span>`).join(""),u=f>0?`<span class="chip chip-muted">+${f}</span>`:"";return`
|
|
56
|
+
<button class="command-result${r}" type="button" data-command-entry-id="${Ye(e.id)}" data-command-index="${n}" title="${a}">
|
|
57
|
+
<span class="command-result-text">
|
|
58
|
+
<strong>${bL(e.title,ke.query)}</strong>
|
|
59
|
+
<small>${Ee(yL(e))}</small>
|
|
60
|
+
${m?`<small class="command-result-excerpt">${Ee(m)}</small>`:""}
|
|
61
|
+
</span>
|
|
62
|
+
<span class="command-result-aside">${c}${u}</span>
|
|
63
|
+
</button>
|
|
64
|
+
`}function dL(){const e=fL(),n=ke.results.slice(0,e),r=ke.results.slice(e);return[n.length>0?Wb("Recent",n,0):"",r.length>0?Wb("All",r,e):""].join("")}function Wb(e,n,r){return`
|
|
65
|
+
<div class="command-section-heading">${Ee(e)}</div>
|
|
66
|
+
${n.map((a,l)=>kw(a,r+l)).join("")}
|
|
67
|
+
`}function Gg(){const e=new Set(Wg),n=Rw().map(a=>qp.find(l=>l.id===a)).filter(a=>!!a),r=qp.filter(a=>!e.has(a.id));return[...n,...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 fL(){return Rw().filter((e,n)=>ke.results[n]?.id===e).length}function Rw(){return Array.from(new Set(Wg))}function pL(){ke.previousBodyOverflow===null&&(ke.previousBodyOverflow=document.body.style.overflow,document.body.style.overflow="hidden")}function gL(){ke.previousBodyOverflow!==null&&(document.body.style.overflow=ke.previousBodyOverflow,ke.previousBodyOverflow=null)}function mL(){const e=ke.previousActiveElement;ke.previousActiveElement=null,e?.isConnected&&e.focus()}function Gb(){window.setTimeout(()=>{const e=document.querySelector("#command-input");e&&(e.focus(),e.select())},0)}function _L(e){const n=document.querySelector(".command-card");if(!n)return;const r=vL(n);if(r.length===0){e.preventDefault(),n.focus();return}const a=document.activeElement,l=a instanceof HTMLElement?r.indexOf(a):-1,f=e.shiftKey?l<=0?r.length-1:l-1:l===-1||l===r.length-1?0:l+1;(l===-1||e.shiftKey&&l===0||!e.shiftKey&&l===r.length-1)&&(e.preventDefault(),r[f]?.focus())}function vL(e){const n=["a[href]","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])","[tabindex]:not([tabindex='-1'])"].join(",");return Array.from(e.querySelectorAll(n)).filter(r=>!r.hasAttribute("hidden")&&r.offsetParent!==null)}function bL(e,n){if(!n)return Ee(e);const r=e.toLocaleLowerCase(),a=n.toLocaleLowerCase();if(!a)return Ee(e);let l=0,f="";for(;l<e.length;){const m=r.indexOf(a,l);if(m===-1)break;f+=Ee(e.slice(l,m)),f+=`<mark class="command-highlight">${Ee(e.slice(m,m+n.length))}</mark>`,l=m+n.length}return f+Ee(e.slice(l))}function yL(e){switch(e.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 SL(e){const n=e.matchedSnippets?.find(a=>a.field==="body")?.snippet;if(e.reason!=="body")return"";const r=n??e.excerpt;return wL(r??"")}function wL(e){return xL(CL(e)).replace(/\s+/g," ").trim().slice(0,180)}function CL(e){return e.replace(/<<<[^>]*>>>/g," ")}function xL(e){return e.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 Kg(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var ra=Kg();function Lw(e){ra=e}var kl={exec:()=>null};function ct(e,n=""){let r=typeof e=="string"?e:e.source,a={replace:(l,f)=>{let m=typeof f=="string"?f:f.source;return m=m.replace($n.caret,"$1"),r=r.replace(l,m),a},getRegex:()=>new RegExp(r,n)};return a}var EL=(()=>{try{return!!new RegExp("(?<=1)(?<!1)")}catch{return!1}})(),$n={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:e=>new RegExp(`^( {0,3}${e})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}#`),htmlBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}<(?:[a-z].*>|!--)`,"i")},TL=/^(?:[ \t]*(?:\n|$))+/,AL=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,kL=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,Wl=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,RL=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,Vg=/(?:[*+-]|\d{1,9}[.)])/,Mw=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,Dw=ct(Mw).replace(/bull/g,Vg).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(),LL=ct(Mw).replace(/bull/g,Vg).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(),Yg=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,ML=/^[^\n]+/,Xg=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,DL=ct(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",Xg).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),OL=ct(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,Vg).getRegex(),uh="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",Zg=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,NL=ct("^ {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",Zg).replace("tag",uh).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Ow=ct(Yg).replace("hr",Wl).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",uh).getRegex(),BL=ct(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",Ow).getRegex(),Jg={blockquote:BL,code:AL,def:DL,fences:kL,heading:RL,hr:Wl,html:NL,lheading:Dw,list:OL,newline:TL,paragraph:Ow,table:kl,text:ML},Kb=ct("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",Wl).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",uh).getRegex(),IL={...Jg,lheading:LL,table:Kb,paragraph:ct(Yg).replace("hr",Wl).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",Kb).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",uh).getRegex()},jL={...Jg,html:ct(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",Zg).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:kl,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:ct(Yg).replace("hr",Wl).replace("heading",` *#{1,6} *[^
|
|
68
|
+
]`).replace("lheading",Dw).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},zL=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,$L=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,Nw=/^( {2,}|\\)\n(?!\s*$)/,PL=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,hh=/[\p{P}\p{S}]/u,Qg=/[\s\p{P}\p{S}]/u,Bw=/[^\s\p{P}\p{S}]/u,HL=ct(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,Qg).getRegex(),Iw=/(?!~)[\p{P}\p{S}]/u,UL=/(?!~)[\s\p{P}\p{S}]/u,FL=/(?:[^\s\p{P}\p{S}]|~)/u,qL=ct(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",EL?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),jw=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,WL=ct(jw,"u").replace(/punct/g,hh).getRegex(),GL=ct(jw,"u").replace(/punct/g,Iw).getRegex(),zw="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",KL=ct(zw,"gu").replace(/notPunctSpace/g,Bw).replace(/punctSpace/g,Qg).replace(/punct/g,hh).getRegex(),VL=ct(zw,"gu").replace(/notPunctSpace/g,FL).replace(/punctSpace/g,UL).replace(/punct/g,Iw).getRegex(),YL=ct("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,Bw).replace(/punctSpace/g,Qg).replace(/punct/g,hh).getRegex(),XL=ct(/\\(punct)/,"gu").replace(/punct/g,hh).getRegex(),ZL=ct(/^<(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(),JL=ct(Zg).replace("(?:-->|$)","-->").getRegex(),QL=ct("^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",JL).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),Fu=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+[^`]*?`+(?!`)|[^\[\]\\`])*?/,eM=ct(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",Fu).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),$w=ct(/^!?\[(label)\]\[(ref)\]/).replace("label",Fu).replace("ref",Xg).getRegex(),Pw=ct(/^!?\[(ref)\](?:\[\])?/).replace("ref",Xg).getRegex(),tM=ct("reflink|nolink(?!\\()","g").replace("reflink",$w).replace("nolink",Pw).getRegex(),Vb=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,em={_backpedal:kl,anyPunctuation:XL,autolink:ZL,blockSkip:qL,br:Nw,code:$L,del:kl,emStrongLDelim:WL,emStrongRDelimAst:KL,emStrongRDelimUnd:YL,escape:zL,link:eM,nolink:Pw,punctuation:HL,reflink:$w,reflinkSearch:tM,tag:QL,text:PL,url:kl},nM={...em,link:ct(/^!?\[(label)\]\((.*?)\)/).replace("label",Fu).getRegex(),reflink:ct(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Fu).getRegex()},Gp={...em,emStrongRDelimAst:VL,emStrongLDelim:GL,url:ct(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",Vb).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:ct(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",Vb).getRegex()},iM={...Gp,br:ct(Nw).replace("{2,}","*").getRegex(),text:ct(Gp.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},cu={normal:Jg,gfm:IL,pedantic:jL},ul={normal:em,gfm:Gp,breaks:iM,pedantic:nM},rM={"&":"&","<":"<",">":">",'"':""","'":"'"},Yb=e=>rM[e];function Qi(e,n){if(n){if($n.escapeTest.test(e))return e.replace($n.escapeReplace,Yb)}else if($n.escapeTestNoEncode.test(e))return e.replace($n.escapeReplaceNoEncode,Yb);return e}function Xb(e){try{e=encodeURI(e).replace($n.percentDecode,"%")}catch{return null}return e}function Zb(e,n){let r=e.replace($n.findPipe,(f,m,c)=>{let u=!1,h=m;for(;--h>=0&&c[h]==="\\";)u=!u;return u?"|":" |"}),a=r.split($n.splitPipe),l=0;if(a[0].trim()||a.shift(),a.length>0&&!a.at(-1)?.trim()&&a.pop(),n)if(a.length>n)a.splice(n);else for(;a.length<n;)a.push("");for(;l<a.length;l++)a[l]=a[l].trim().replace($n.slashPipe,"|");return a}function hl(e,n,r){let a=e.length;if(a===0)return"";let l=0;for(;l<a&&e.charAt(a-l-1)===n;)l++;return e.slice(0,a-l)}function sM(e,n){if(e.indexOf(n[1])===-1)return-1;let r=0;for(let a=0;a<e.length;a++)if(e[a]==="\\")a++;else if(e[a]===n[0])r++;else if(e[a]===n[1]&&(r--,r<0))return a;return r>0?-2:-1}function Jb(e,n,r,a,l){let f=n.href,m=n.title||null,c=e[1].replace(l.other.outputLinkReplace,"$1");a.state.inLink=!0;let u={type:e[0].charAt(0)==="!"?"image":"link",raw:r,href:f,title:m,text:c,tokens:a.inlineTokens(c)};return a.state.inLink=!1,u}function aM(e,n,r){let a=e.match(r.other.indentCodeCompensation);if(a===null)return n;let l=a[1];return n.split(`
|
|
69
|
+
`).map(f=>{let m=f.match(r.other.beginningSpace);if(m===null)return f;let[c]=m;return c.length>=l.length?f.slice(l.length):f}).join(`
|
|
70
|
+
`)}var qu=class{options;rules;lexer;constructor(e){this.options=e||ra}space(e){let n=this.rules.block.newline.exec(e);if(n&&n[0].length>0)return{type:"space",raw:n[0]}}code(e){let n=this.rules.block.code.exec(e);if(n){let r=n[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:n[0],codeBlockStyle:"indented",text:this.options.pedantic?r:hl(r,`
|
|
71
|
+
`)}}}fences(e){let n=this.rules.block.fences.exec(e);if(n){let r=n[0],a=aM(r,n[3]||"",this.rules);return{type:"code",raw:r,lang:n[2]?n[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):n[2],text:a}}}heading(e){let n=this.rules.block.heading.exec(e);if(n){let r=n[2].trim();if(this.rules.other.endingHash.test(r)){let a=hl(r,"#");(this.options.pedantic||!a||this.rules.other.endingSpaceChar.test(a))&&(r=a.trim())}return{type:"heading",raw:n[0],depth:n[1].length,text:r,tokens:this.lexer.inline(r)}}}hr(e){let n=this.rules.block.hr.exec(e);if(n)return{type:"hr",raw:hl(n[0],`
|
|
72
|
+
`)}}blockquote(e){let n=this.rules.block.blockquote.exec(e);if(n){let r=hl(n[0],`
|
|
73
|
+
`).split(`
|
|
74
|
+
`),a="",l="",f=[];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(`
|
|
75
|
+
`),y=h.replace(this.rules.other.blockquoteSetextReplace,`
|
|
76
|
+
$1`).replace(this.rules.other.blockquoteSetextReplace2,"");a=a?`${a}
|
|
77
|
+
${h}`:h,l=l?`${l}
|
|
78
|
+
${y}`:y;let g=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(y,f,!0),this.lexer.state.top=g,r.length===0)break;let C=f.at(-1);if(C?.type==="code")break;if(C?.type==="blockquote"){let E=C,A=E.raw+`
|
|
79
|
+
`+r.join(`
|
|
80
|
+
`),T=this.blockquote(A);f[f.length-1]=T,a=a.substring(0,a.length-E.raw.length)+T.raw,l=l.substring(0,l.length-E.text.length)+T.text;break}else if(C?.type==="list"){let E=C,A=E.raw+`
|
|
81
|
+
`+r.join(`
|
|
82
|
+
`),T=this.list(A);f[f.length-1]=T,a=a.substring(0,a.length-C.raw.length)+T.raw,l=l.substring(0,l.length-E.raw.length)+T.raw,r=A.substring(f.at(-1).raw.length).split(`
|
|
83
|
+
`);continue}}return{type:"blockquote",raw:a,tokens:f,text:l}}}list(e){let n=this.rules.block.list.exec(e);if(n){let r=n[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 f=this.rules.other.listItemRegex(r),m=!1;for(;e;){let u=!1,h="",y="";if(!(n=f.exec(e))||this.rules.block.hr.test(e))break;h=n[0],e=e.substring(h.length);let g=n[2].split(`
|
|
84
|
+
`,1)[0].replace(this.rules.other.listReplaceTabs,v=>" ".repeat(3*v.length)),C=e.split(`
|
|
85
|
+
`,1)[0],E=!g.trim(),A=0;if(this.options.pedantic?(A=2,y=g.trimStart()):E?A=n[1].length+1:(A=n[2].search(this.rules.other.nonSpaceChar),A=A>4?1:A,y=g.slice(A),A+=n[1].length),E&&this.rules.other.blankLine.test(C)&&(h+=C+`
|
|
86
|
+
`,e=e.substring(C.length+1),u=!0),!u){let v=this.rules.other.nextBulletRegex(A),d=this.rules.other.hrRegex(A),b=this.rules.other.fencesBeginRegex(A),x=this.rules.other.headingBeginRegex(A),L=this.rules.other.htmlBeginRegex(A);for(;e;){let R=e.split(`
|
|
87
|
+
`,1)[0],M;if(C=R,this.options.pedantic?(C=C.replace(this.rules.other.listReplaceNesting," "),M=C):M=C.replace(this.rules.other.tabCharGlobal," "),b.test(C)||x.test(C)||L.test(C)||v.test(C)||d.test(C))break;if(M.search(this.rules.other.nonSpaceChar)>=A||!C.trim())y+=`
|
|
88
|
+
`+M.slice(A);else{if(E||g.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||b.test(g)||x.test(g)||d.test(g))break;y+=`
|
|
89
|
+
`+C}!E&&!C.trim()&&(E=!0),h+=R+`
|
|
90
|
+
`,e=e.substring(R.length+1),g=M.slice(A)}}l.loose||(m?l.loose=!0:this.rules.other.doubleBlankLine.test(h)&&(m=!0));let T=null,p;this.options.gfm&&(T=this.rules.other.listIsTask.exec(y),T&&(p=T[0]!=="[ ] ",y=y.replace(this.rules.other.listReplaceTask,""))),l.items.push({type:"list_item",raw:h,task:!!T,checked:p,loose:!1,text:y,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(g=>g.type==="space"),y=h.length>0&&h.some(g=>this.rules.other.anyLine.test(g.raw));l.loose=y}if(l.loose)for(let u=0;u<l.items.length;u++)l.items[u].loose=!0;return l}}html(e){let n=this.rules.block.html.exec(e);if(n)return{type:"html",block:!0,raw:n[0],pre:n[1]==="pre"||n[1]==="script"||n[1]==="style",text:n[0]}}def(e){let n=this.rules.block.def.exec(e);if(n){let r=n[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),a=n[2]?n[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",l=n[3]?n[3].substring(1,n[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):n[3];return{type:"def",tag:r,raw:n[0],href:a,title:l}}}table(e){let n=this.rules.block.table.exec(e);if(!n||!this.rules.other.tableDelimiter.test(n[2]))return;let r=Zb(n[1]),a=n[2].replace(this.rules.other.tableAlignChars,"").split("|"),l=n[3]?.trim()?n[3].replace(this.rules.other.tableRowBlankLine,"").split(`
|
|
91
|
+
`):[],f={type:"table",raw:n[0],header:[],align:[],rows:[]};if(r.length===a.length){for(let m of a)this.rules.other.tableAlignRight.test(m)?f.align.push("right"):this.rules.other.tableAlignCenter.test(m)?f.align.push("center"):this.rules.other.tableAlignLeft.test(m)?f.align.push("left"):f.align.push(null);for(let m=0;m<r.length;m++)f.header.push({text:r[m],tokens:this.lexer.inline(r[m]),header:!0,align:f.align[m]});for(let m of l)f.rows.push(Zb(m,f.header.length).map((c,u)=>({text:c,tokens:this.lexer.inline(c),header:!1,align:f.align[u]})));return f}}lheading(e){let n=this.rules.block.lheading.exec(e);if(n)return{type:"heading",raw:n[0],depth:n[2].charAt(0)==="="?1:2,text:n[1],tokens:this.lexer.inline(n[1])}}paragraph(e){let n=this.rules.block.paragraph.exec(e);if(n){let r=n[1].charAt(n[1].length-1)===`
|
|
92
|
+
`?n[1].slice(0,-1):n[1];return{type:"paragraph",raw:n[0],text:r,tokens:this.lexer.inline(r)}}}text(e){let n=this.rules.block.text.exec(e);if(n)return{type:"text",raw:n[0],text:n[0],tokens:this.lexer.inline(n[0])}}escape(e){let n=this.rules.inline.escape.exec(e);if(n)return{type:"escape",raw:n[0],text:n[1]}}tag(e){let n=this.rules.inline.tag.exec(e);if(n)return!this.lexer.state.inLink&&this.rules.other.startATag.test(n[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(n[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(n[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(n[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:n[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:n[0]}}link(e){let n=this.rules.inline.link.exec(e);if(n){let r=n[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(r)){if(!this.rules.other.endAngleBracket.test(r))return;let f=hl(r.slice(0,-1),"\\");if((r.length-f.length)%2===0)return}else{let f=sM(n[2],"()");if(f===-2)return;if(f>-1){let m=(n[0].indexOf("!")===0?5:4)+n[1].length+f;n[2]=n[2].substring(0,f),n[0]=n[0].substring(0,m).trim(),n[3]=""}}let a=n[2],l="";if(this.options.pedantic){let f=this.rules.other.pedanticHrefTitle.exec(a);f&&(a=f[1],l=f[3])}else l=n[3]?n[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)),Jb(n,{href:a&&a.replace(this.rules.inline.anyPunctuation,"$1"),title:l&&l.replace(this.rules.inline.anyPunctuation,"$1")},n[0],this.lexer,this.rules)}}reflink(e,n){let r;if((r=this.rules.inline.reflink.exec(e))||(r=this.rules.inline.nolink.exec(e))){let a=(r[2]||r[1]).replace(this.rules.other.multipleSpaceGlobal," "),l=n[a.toLowerCase()];if(!l){let f=r[0].charAt(0);return{type:"text",raw:f,text:f}}return Jb(r,l,r[0],this.lexer,this.rules)}}emStrong(e,n,r=""){let a=this.rules.inline.emStrongLDelim.exec(e);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,f,m,c=l,u=0,h=a[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(h.lastIndex=0,n=n.slice(-1*e.length+l);(a=h.exec(n))!=null;){if(f=a[1]||a[2]||a[3]||a[4]||a[5]||a[6],!f)continue;if(m=[...f].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 y=[...a[0]][0].length,g=e.slice(0,l+a.index+y+m);if(Math.min(l,m)%2){let E=g.slice(1,-1);return{type:"em",raw:g,text:E,tokens:this.lexer.inlineTokens(E)}}let C=g.slice(2,-2);return{type:"strong",raw:g,text:C,tokens:this.lexer.inlineTokens(C)}}}}codespan(e){let n=this.rules.inline.code.exec(e);if(n){let r=n[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:n[0],text:r}}}br(e){let n=this.rules.inline.br.exec(e);if(n)return{type:"br",raw:n[0]}}del(e){let n=this.rules.inline.del.exec(e);if(n)return{type:"del",raw:n[0],text:n[2],tokens:this.lexer.inlineTokens(n[2])}}autolink(e){let n=this.rules.inline.autolink.exec(e);if(n){let r,a;return n[2]==="@"?(r=n[1],a="mailto:"+r):(r=n[1],a=r),{type:"link",raw:n[0],text:r,href:a,tokens:[{type:"text",raw:r,text:r}]}}}url(e){let n;if(n=this.rules.inline.url.exec(e)){let r,a;if(n[2]==="@")r=n[0],a="mailto:"+r;else{let l;do l=n[0],n[0]=this.rules.inline._backpedal.exec(n[0])?.[0]??"";while(l!==n[0]);r=n[0],n[1]==="www."?a="http://"+n[0]:a=n[0]}return{type:"link",raw:n[0],text:r,href:a,tokens:[{type:"text",raw:r,text:r}]}}}inlineText(e){let n=this.rules.inline.text.exec(e);if(n){let r=this.lexer.state.inRawBlock;return{type:"text",raw:n[0],text:n[0],escaped:r}}}},zi=class Kp{tokens;options;state;tokenizer;inlineQueue;constructor(n){this.tokens=[],this.tokens.links=Object.create(null),this.options=n||ra,this.options.tokenizer=this.options.tokenizer||new qu,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:$n,block:cu.normal,inline:ul.normal};this.options.pedantic?(r.block=cu.pedantic,r.inline=ul.pedantic):this.options.gfm&&(r.block=cu.gfm,this.options.breaks?r.inline=ul.breaks:r.inline=ul.gfm),this.tokenizer.rules=r}static get rules(){return{block:cu,inline:ul}}static lex(n,r){return new Kp(r).lex(n)}static lexInline(n,r){return new Kp(r).inlineTokens(n)}lex(n){n=n.replace($n.carriageReturn,`
|
|
93
|
+
`),this.blockTokens(n,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(n,r=[],a=!1){for(this.options.pedantic&&(n=n.replace($n.tabCharGlobal," ").replace($n.spaceLine,""));n;){let l;if(this.options.extensions?.block?.some(m=>(l=m.call({lexer:this},n,r))?(n=n.substring(l.raw.length),r.push(l),!0):!1))continue;if(l=this.tokenizer.space(n)){n=n.substring(l.raw.length);let m=r.at(-1);l.raw.length===1&&m!==void 0?m.raw+=`
|
|
94
|
+
`:r.push(l);continue}if(l=this.tokenizer.code(n)){n=n.substring(l.raw.length);let m=r.at(-1);m?.type==="paragraph"||m?.type==="text"?(m.raw+=(m.raw.endsWith(`
|
|
95
|
+
`)?"":`
|
|
96
|
+
`)+l.raw,m.text+=`
|
|
97
|
+
`+l.text,this.inlineQueue.at(-1).src=m.text):r.push(l);continue}if(l=this.tokenizer.fences(n)){n=n.substring(l.raw.length),r.push(l);continue}if(l=this.tokenizer.heading(n)){n=n.substring(l.raw.length),r.push(l);continue}if(l=this.tokenizer.hr(n)){n=n.substring(l.raw.length),r.push(l);continue}if(l=this.tokenizer.blockquote(n)){n=n.substring(l.raw.length),r.push(l);continue}if(l=this.tokenizer.list(n)){n=n.substring(l.raw.length),r.push(l);continue}if(l=this.tokenizer.html(n)){n=n.substring(l.raw.length),r.push(l);continue}if(l=this.tokenizer.def(n)){n=n.substring(l.raw.length);let m=r.at(-1);m?.type==="paragraph"||m?.type==="text"?(m.raw+=(m.raw.endsWith(`
|
|
98
|
+
`)?"":`
|
|
99
|
+
`)+l.raw,m.text+=`
|
|
100
|
+
`+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(n)){n=n.substring(l.raw.length),r.push(l);continue}if(l=this.tokenizer.lheading(n)){n=n.substring(l.raw.length),r.push(l);continue}let f=n;if(this.options.extensions?.startBlock){let m=1/0,c=n.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&&(f=n.substring(0,m+1))}if(this.state.top&&(l=this.tokenizer.paragraph(f))){let m=r.at(-1);a&&m?.type==="paragraph"?(m.raw+=(m.raw.endsWith(`
|
|
101
|
+
`)?"":`
|
|
102
|
+
`)+l.raw,m.text+=`
|
|
103
|
+
`+l.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=m.text):r.push(l),a=f.length!==n.length,n=n.substring(l.raw.length);continue}if(l=this.tokenizer.text(n)){n=n.substring(l.raw.length);let m=r.at(-1);m?.type==="text"?(m.raw+=(m.raw.endsWith(`
|
|
104
|
+
`)?"":`
|
|
105
|
+
`)+l.raw,m.text+=`
|
|
106
|
+
`+l.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=m.text):r.push(l);continue}if(n){let m="Infinite loop on byte: "+n.charCodeAt(0);if(this.options.silent){console.error(m);break}else throw new Error(m)}}return this.state.top=!0,r}inline(n,r=[]){return this.inlineQueue.push({src:n,tokens:r}),r}inlineTokens(n,r=[]){let a=n,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 f;for(;(l=this.tokenizer.rules.inline.blockSkip.exec(a))!=null;)f=l[2]?l[2].length:0,a=a.slice(0,l.index+f)+"["+"a".repeat(l[0].length-f-2)+"]"+a.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);a=this.options.hooks?.emStrongMask?.call({lexer:this},a)??a;let m=!1,c="";for(;n;){m||(c=""),m=!1;let u;if(this.options.extensions?.inline?.some(y=>(u=y.call({lexer:this},n,r))?(n=n.substring(u.raw.length),r.push(u),!0):!1))continue;if(u=this.tokenizer.escape(n)){n=n.substring(u.raw.length),r.push(u);continue}if(u=this.tokenizer.tag(n)){n=n.substring(u.raw.length),r.push(u);continue}if(u=this.tokenizer.link(n)){n=n.substring(u.raw.length),r.push(u);continue}if(u=this.tokenizer.reflink(n,this.tokens.links)){n=n.substring(u.raw.length);let y=r.at(-1);u.type==="text"&&y?.type==="text"?(y.raw+=u.raw,y.text+=u.text):r.push(u);continue}if(u=this.tokenizer.emStrong(n,a,c)){n=n.substring(u.raw.length),r.push(u);continue}if(u=this.tokenizer.codespan(n)){n=n.substring(u.raw.length),r.push(u);continue}if(u=this.tokenizer.br(n)){n=n.substring(u.raw.length),r.push(u);continue}if(u=this.tokenizer.del(n)){n=n.substring(u.raw.length),r.push(u);continue}if(u=this.tokenizer.autolink(n)){n=n.substring(u.raw.length),r.push(u);continue}if(!this.state.inLink&&(u=this.tokenizer.url(n))){n=n.substring(u.raw.length),r.push(u);continue}let h=n;if(this.options.extensions?.startInline){let y=1/0,g=n.slice(1),C;this.options.extensions.startInline.forEach(E=>{C=E.call({lexer:this},g),typeof C=="number"&&C>=0&&(y=Math.min(y,C))}),y<1/0&&y>=0&&(h=n.substring(0,y+1))}if(u=this.tokenizer.inlineText(h)){n=n.substring(u.raw.length),u.raw.slice(-1)!=="_"&&(c=u.raw.slice(-1)),m=!0;let y=r.at(-1);y?.type==="text"?(y.raw+=u.raw,y.text+=u.text):r.push(u);continue}if(n){let y="Infinite loop on byte: "+n.charCodeAt(0);if(this.options.silent){console.error(y);break}else throw new Error(y)}}return r}},Wu=class{options;parser;constructor(e){this.options=e||ra}space(e){return""}code({text:e,lang:n,escaped:r}){let a=(n||"").match($n.notSpaceStart)?.[0],l=e.replace($n.endingNewline,"")+`
|
|
107
|
+
`;return a?'<pre><code class="language-'+Qi(a)+'">'+(r?l:Qi(l,!0))+`</code></pre>
|
|
108
|
+
`:"<pre><code>"+(r?l:Qi(l,!0))+`</code></pre>
|
|
109
|
+
`}blockquote({tokens:e}){return`<blockquote>
|
|
110
|
+
${this.parser.parse(e)}</blockquote>
|
|
111
|
+
`}html({text:e}){return e}def(e){return""}heading({tokens:e,depth:n}){return`<h${n}>${this.parser.parseInline(e)}</h${n}>
|
|
112
|
+
`}hr(e){return`<hr>
|
|
113
|
+
`}list(e){let n=e.ordered,r=e.start,a="";for(let m=0;m<e.items.length;m++){let c=e.items[m];a+=this.listitem(c)}let l=n?"ol":"ul",f=n&&r!==1?' start="'+r+'"':"";return"<"+l+f+`>
|
|
114
|
+
`+a+"</"+l+`>
|
|
115
|
+
`}listitem(e){let n="";if(e.task){let r=this.checkbox({checked:!!e.checked});e.loose?e.tokens[0]?.type==="paragraph"?(e.tokens[0].text=r+" "+e.tokens[0].text,e.tokens[0].tokens&&e.tokens[0].tokens.length>0&&e.tokens[0].tokens[0].type==="text"&&(e.tokens[0].tokens[0].text=r+" "+Qi(e.tokens[0].tokens[0].text),e.tokens[0].tokens[0].escaped=!0)):e.tokens.unshift({type:"text",raw:r+" ",text:r+" ",escaped:!0}):n+=r+" "}return n+=this.parser.parse(e.tokens,!!e.loose),`<li>${n}</li>
|
|
116
|
+
`}checkbox({checked:e}){return"<input "+(e?'checked="" ':"")+'disabled="" type="checkbox">'}paragraph({tokens:e}){return`<p>${this.parser.parseInline(e)}</p>
|
|
117
|
+
`}table(e){let n="",r="";for(let l=0;l<e.header.length;l++)r+=this.tablecell(e.header[l]);n+=this.tablerow({text:r});let a="";for(let l=0;l<e.rows.length;l++){let f=e.rows[l];r="";for(let m=0;m<f.length;m++)r+=this.tablecell(f[m]);a+=this.tablerow({text:r})}return a&&(a=`<tbody>${a}</tbody>`),`<table>
|
|
118
|
+
<thead>
|
|
119
|
+
`+n+`</thead>
|
|
120
|
+
`+a+`</table>
|
|
121
|
+
`}tablerow({text:e}){return`<tr>
|
|
122
|
+
${e}</tr>
|
|
123
|
+
`}tablecell(e){let n=this.parser.parseInline(e.tokens),r=e.header?"th":"td";return(e.align?`<${r} align="${e.align}">`:`<${r}>`)+n+`</${r}>
|
|
124
|
+
`}strong({tokens:e}){return`<strong>${this.parser.parseInline(e)}</strong>`}em({tokens:e}){return`<em>${this.parser.parseInline(e)}</em>`}codespan({text:e}){return`<code>${Qi(e,!0)}</code>`}br(e){return"<br>"}del({tokens:e}){return`<del>${this.parser.parseInline(e)}</del>`}link({href:e,title:n,tokens:r}){let a=this.parser.parseInline(r),l=Xb(e);if(l===null)return a;e=l;let f='<a href="'+e+'"';return n&&(f+=' title="'+Qi(n)+'"'),f+=">"+a+"</a>",f}image({href:e,title:n,text:r,tokens:a}){a&&(r=this.parser.parseInline(a,this.parser.textRenderer));let l=Xb(e);if(l===null)return Qi(r);e=l;let f=`<img src="${e}" alt="${r}"`;return n&&(f+=` title="${Qi(n)}"`),f+=">",f}text(e){return"tokens"in e&&e.tokens?this.parser.parseInline(e.tokens):"escaped"in e&&e.escaped?e.text:Qi(e.text)}},tm=class{strong({text:e}){return e}em({text:e}){return e}codespan({text:e}){return e}del({text:e}){return e}html({text:e}){return e}text({text:e}){return e}link({text:e}){return""+e}image({text:e}){return""+e}br(){return""}},$i=class Vp{options;renderer;textRenderer;constructor(n){this.options=n||ra,this.options.renderer=this.options.renderer||new Wu,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new tm}static parse(n,r){return new Vp(r).parse(n)}static parseInline(n,r){return new Vp(r).parseInline(n)}parse(n,r=!0){let a="";for(let l=0;l<n.length;l++){let f=n[l];if(this.options.extensions?.renderers?.[f.type]){let c=f,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=f;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<n.length&&n[l+1].type==="text";)c=n[++l],u+=`
|
|
125
|
+
`+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(n,r=this.renderer){let a="";for(let l=0;l<n.length;l++){let f=n[l];if(this.options.extensions?.renderers?.[f.type]){let c=this.options.extensions.renderers[f.type].call({parser:this},f);if(c!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(f.type)){a+=c||"";continue}}let m=f;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}},Sl=class{options;block;constructor(e){this.options=e||ra}static passThroughHooks=new Set(["preprocess","postprocess","processAllTokens","emStrongMask"]);static passThroughHooksRespectAsync=new Set(["preprocess","postprocess","processAllTokens"]);preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}emStrongMask(e){return e}provideLexer(){return this.block?zi.lex:zi.lexInline}provideParser(){return this.block?$i.parse:$i.parseInline}},Hw=class{defaults=Kg();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=$i;Renderer=Wu;TextRenderer=tm;Lexer=zi;Tokenizer=qu;Hooks=Sl;constructor(...n){this.use(...n)}walkTokens(n,r){let a=[];for(let l of n)switch(a=a.concat(r.call(this,l)),l.type){case"table":{let f=l;for(let m of f.header)a=a.concat(this.walkTokens(m.tokens,r));for(let m of f.rows)for(let c of m)a=a.concat(this.walkTokens(c.tokens,r));break}case"list":{let f=l;a=a.concat(this.walkTokens(f.items,r));break}default:{let f=l;this.defaults.extensions?.childTokens?.[f.type]?this.defaults.extensions.childTokens[f.type].forEach(m=>{let c=f[m].flat(1/0);a=a.concat(this.walkTokens(c,r))}):f.tokens&&(a=a.concat(this.walkTokens(f.tokens,r)))}}return a}use(...n){let r=this.defaults.extensions||{renderers:{},childTokens:{}};return n.forEach(a=>{let l={...a};if(l.async=this.defaults.async||l.async||!1,a.extensions&&(a.extensions.forEach(f=>{if(!f.name)throw new Error("extension name required");if("renderer"in f){let m=r.renderers[f.name];m?r.renderers[f.name]=function(...c){let u=f.renderer.apply(this,c);return u===!1&&(u=m.apply(this,c)),u}:r.renderers[f.name]=f.renderer}if("tokenizer"in f){if(!f.level||f.level!=="block"&&f.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let m=r[f.level];m?m.unshift(f.tokenizer):r[f.level]=[f.tokenizer],f.start&&(f.level==="block"?r.startBlock?r.startBlock.push(f.start):r.startBlock=[f.start]:f.level==="inline"&&(r.startInline?r.startInline.push(f.start):r.startInline=[f.start]))}"childTokens"in f&&f.childTokens&&(r.childTokens[f.name]=f.childTokens)}),l.extensions=r),a.renderer){let f=this.defaults.renderer||new Wu(this.defaults);for(let m in a.renderer){if(!(m in f))throw new Error(`renderer '${m}' does not exist`);if(["options","parser"].includes(m))continue;let c=m,u=a.renderer[c],h=f[c];f[c]=(...y)=>{let g=u.apply(f,y);return g===!1&&(g=h.apply(f,y)),g||""}}l.renderer=f}if(a.tokenizer){let f=this.defaults.tokenizer||new qu(this.defaults);for(let m in a.tokenizer){if(!(m in f))throw new Error(`tokenizer '${m}' does not exist`);if(["options","rules","lexer"].includes(m))continue;let c=m,u=a.tokenizer[c],h=f[c];f[c]=(...y)=>{let g=u.apply(f,y);return g===!1&&(g=h.apply(f,y)),g}}l.tokenizer=f}if(a.hooks){let f=this.defaults.hooks||new Sl;for(let m in a.hooks){if(!(m in f))throw new Error(`hook '${m}' does not exist`);if(["options","block"].includes(m))continue;let c=m,u=a.hooks[c],h=f[c];Sl.passThroughHooks.has(m)?f[c]=y=>{if(this.defaults.async&&Sl.passThroughHooksRespectAsync.has(m))return(async()=>{let C=await u.call(f,y);return h.call(f,C)})();let g=u.call(f,y);return h.call(f,g)}:f[c]=(...y)=>{if(this.defaults.async)return(async()=>{let C=await u.apply(f,y);return C===!1&&(C=await h.apply(f,y)),C})();let g=u.apply(f,y);return g===!1&&(g=h.apply(f,y)),g}}l.hooks=f}if(a.walkTokens){let f=this.defaults.walkTokens,m=a.walkTokens;l.walkTokens=function(c){let u=[];return u.push(m.call(this,c)),f&&(u=u.concat(f.call(this,c))),u}}this.defaults={...this.defaults,...l}}),this}setOptions(n){return this.defaults={...this.defaults,...n},this}lexer(n,r){return zi.lex(n,r??this.defaults)}parser(n,r){return $i.parse(n,r??this.defaults)}parseMarkdown(n){return(r,a)=>{let l={...a},f={...this.defaults,...l},m=this.onError(!!f.silent,!!f.async);if(this.defaults.async===!0&&l.async===!1)return m(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 r>"u"||r===null)return m(new Error("marked(): input parameter is undefined or null"));if(typeof r!="string")return m(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(r)+", string expected"));if(f.hooks&&(f.hooks.options=f,f.hooks.block=n),f.async)return(async()=>{let c=f.hooks?await f.hooks.preprocess(r):r,u=await(f.hooks?await f.hooks.provideLexer():n?zi.lex:zi.lexInline)(c,f),h=f.hooks?await f.hooks.processAllTokens(u):u;f.walkTokens&&await Promise.all(this.walkTokens(h,f.walkTokens));let y=await(f.hooks?await f.hooks.provideParser():n?$i.parse:$i.parseInline)(h,f);return f.hooks?await f.hooks.postprocess(y):y})().catch(m);try{f.hooks&&(r=f.hooks.preprocess(r));let c=(f.hooks?f.hooks.provideLexer():n?zi.lex:zi.lexInline)(r,f);f.hooks&&(c=f.hooks.processAllTokens(c)),f.walkTokens&&this.walkTokens(c,f.walkTokens);let u=(f.hooks?f.hooks.provideParser():n?$i.parse:$i.parseInline)(c,f);return f.hooks&&(u=f.hooks.postprocess(u)),u}catch(c){return m(c)}}}onError(n,r){return a=>{if(a.message+=`
|
|
126
|
+
Please report this to https://github.com/markedjs/marked.`,n){let l="<p>An error occurred:</p><pre>"+Qi(a.message+"",!0)+"</pre>";return r?Promise.resolve(l):l}if(r)return Promise.reject(a);throw a}}},na=new Hw;function St(e,n){return na.parse(e,n)}St.options=St.setOptions=function(e){return na.setOptions(e),St.defaults=na.defaults,Lw(St.defaults),St};St.getDefaults=Kg;St.defaults=ra;St.use=function(...e){return na.use(...e),St.defaults=na.defaults,Lw(St.defaults),St};St.walkTokens=function(e,n){return na.walkTokens(e,n)};St.parseInline=na.parseInline;St.Parser=$i;St.parser=$i.parse;St.Renderer=Wu;St.TextRenderer=tm;St.Lexer=zi;St.lexer=zi.lex;St.Tokenizer=qu;St.Hooks=Sl;St.parse=St;St.options;St.setOptions;St.use;St.walkTokens;St.parseInline;$i.parse;zi.lex;const{entries:Uw,setPrototypeOf:Qb,isFrozen:oM,getPrototypeOf:lM,getOwnPropertyDescriptor:cM}=Object;let{freeze:Pn,seal:Ri,create:qa}=Object,{apply:Yp,construct:Xp}=typeof Reflect<"u"&&Reflect;Pn||(Pn=function(n){return n});Ri||(Ri=function(n){return n});Yp||(Yp=function(n,r){for(var a=arguments.length,l=new Array(a>2?a-2:0),f=2;f<a;f++)l[f-2]=arguments[f];return n.apply(r,l)});Xp||(Xp=function(n){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 n(...a)});const dl=dn(Array.prototype.forEach),uM=dn(Array.prototype.lastIndexOf),e1=dn(Array.prototype.pop),fl=dn(Array.prototype.push),hM=dn(Array.prototype.splice),jn=Array.isArray,wl=dn(String.prototype.toLowerCase),jf=dn(String.prototype.toString),t1=dn(String.prototype.match),Ha=dn(String.prototype.replace),n1=dn(String.prototype.indexOf),dM=dn(String.prototype.trim),fM=dn(Number.prototype.toString),pM=dn(Boolean.prototype.toString),i1=typeof BigInt>"u"?null:dn(BigInt.prototype.toString),r1=typeof Symbol>"u"?null:dn(Symbol.prototype.toString),Gt=dn(Object.prototype.hasOwnProperty),pl=dn(Object.prototype.toString),kn=dn(RegExp.prototype.test),uu=gM(TypeError);function dn(e){return function(n){n instanceof RegExp&&(n.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 Yp(e,n,a)}}function gM(e){return function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return Xp(e,r)}}function Ve(e,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:wl;if(Qb&&Qb(e,null),!jn(n))return e;let a=n.length;for(;a--;){let l=n[a];if(typeof l=="string"){const f=r(l);f!==l&&(oM(n)||(n[a]=f),l=f)}e[l]=!0}return e}function mM(e){for(let n=0;n<e.length;n++)Gt(e,n)||(e[n]=null);return e}function Jn(e){const n=qa(null);for(const[r,a]of Uw(e))Gt(e,r)&&(jn(a)?n[r]=mM(a):a&&typeof a=="object"&&a.constructor===Object?n[r]=Jn(a):n[r]=a);return n}function _M(e){switch(typeof e){case"string":return e;case"number":return fM(e);case"boolean":return pM(e);case"bigint":return i1?i1(e):"0";case"symbol":return r1?r1(e):"Symbol()";case"undefined":return pl(e);case"function":case"object":{if(e===null)return pl(e);const n=e,r=Wa(n,"toString");if(typeof r=="function"){const a=r(n);return typeof a=="string"?a:pl(a)}return pl(e)}default:return pl(e)}}function Wa(e,n){for(;e!==null;){const a=cM(e,n);if(a){if(a.get)return dn(a.get);if(typeof a.value=="function")return dn(a.value)}e=lM(e)}function r(){return null}return r}function vM(e){try{return kn(e,""),!0}catch{return!1}}const s1=Pn(["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"]),zf=Pn(["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"]),$f=Pn(["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"]),bM=Pn(["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"]),Pf=Pn(["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"]),yM=Pn(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),a1=Pn(["#text"]),o1=Pn(["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"]),Hf=Pn(["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"]),l1=Pn(["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"]),hu=Pn(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),SM=Ri(/\{\{[\w\W]*|[\w\W]*\}\}/gm),wM=Ri(/<%[\w\W]*|[\w\W]*%>/gm),CM=Ri(/\$\{[\w\W]*/gm),xM=Ri(/^data-[\-\w.\u00B7-\uFFFF]+$/),EM=Ri(/^aria-[\-\w]+$/),Fw=Ri(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),TM=Ri(/^(?:\w+script|data):/i),AM=Ri(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),qw=Ri(/^html$/i),kM=Ri(/^[a-z][.\w]*(-[.\w]+)+$/i);var c1=Object.freeze({__proto__:null,ARIA_ATTR:EM,ATTR_WHITESPACE:AM,CUSTOM_ELEMENT:kM,DATA_ATTR:xM,DOCTYPE_NAME:qw,ERB_EXPR:wM,IS_ALLOWED_URI:Fw,IS_SCRIPT_OR_DATA:TM,MUSTACHE_EXPR:SM,TMPLIT_EXPR:CM});const gl={element:1,text:3,progressingInstruction:7,comment:8,document:9},RM=function(){return typeof window>"u"?null:window},LM=function(n,r){if(typeof n!="object"||typeof n.createPolicy!="function")return null;let a=null;const l="data-tt-policy-suffix";r&&r.hasAttribute(l)&&(a=r.getAttribute(l));const f="dompurify"+(a?"#"+a:"");try{return n.createPolicy(f,{createHTML(m){return m},createScriptURL(m){return m}})}catch{return console.warn("TrustedTypes policy "+f+" could not be created."),null}},u1=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function Ww(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:RM();const n=De=>Ww(De);if(n.version="3.4.2",n.removed=[],!e||!e.document||e.document.nodeType!==gl.document||!e.Element)return n.isSupported=!1,n;let{document:r}=e;const a=r,l=a.currentScript,{DocumentFragment:f,HTMLTemplateElement:m,Node:c,Element:u,NodeFilter:h,NamedNodeMap:y=e.NamedNodeMap||e.MozNamedAttrMap,HTMLFormElement:g,DOMParser:C,trustedTypes:E}=e,A=u.prototype,T=Wa(A,"cloneNode"),p=Wa(A,"remove"),v=Wa(A,"nextSibling"),d=Wa(A,"childNodes"),b=Wa(A,"parentNode");if(typeof m=="function"){const De=r.createElement("template");De.content&&De.content.ownerDocument&&(r=De.content.ownerDocument)}let x,L="";const{implementation:R,createNodeIterator:M,createDocumentFragment:k,getElementsByTagName:O}=r,{importNode:U}=a;let F=u1();n.isSupported=typeof Uw=="function"&&typeof b=="function"&&R&&R.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:G,ERB_EXPR:I,TMPLIT_EXPR:K,DATA_ATTR:te,ARIA_ATTR:q,IS_SCRIPT_OR_DATA:W,ATTR_WHITESPACE:Y,CUSTOM_ELEMENT:B}=c1;let{IS_ALLOWED_URI:z}=c1,N=null;const P=Ve({},[...s1,...zf,...$f,...Pf,...a1]);let Z=null;const ae=Ve({},[...o1,...Hf,...l1,...hu]);let ce=Object.seal(qa(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(qa(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let oe=!0,ge=!0,Se=!1,ye=!0,$e=!1,Fe=!0,Xe=!1,xt=!1,Ne=!1,en=!1,bn=!1,yn=!1,pi=!0,Mi=!1;const tn="user-content-";let ut=!0,Vt=!1,zt={},$t=null;const nn=Ve({},["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 Di=null;const Ln=Ve({},["audio","video","img","source","image","track"]);let ni=null;const dt=Ve({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Hn="http://www.w3.org/1998/Math/MathML",Yt="http://www.w3.org/2000/svg",Xt="http://www.w3.org/1999/xhtml";let Pt=Xt,Cs=!1,or=null;const sa=Ve({},[Hn,Yt,Xt],jf);let Oi=Ve({},["mi","mo","mn","ms","mtext"]),Gi=Ve({},["annotation-xml"]);const lr=Ve({},["title","style","font","a","script"]);let rn=null;const J=["application/xhtml+xml","text/html"],he="text/html";let ve=null,Ie=null;const wt=r.createElement("form"),ft=function(V){return V instanceof RegExp||V instanceof Function},Te=function(){let V=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(Ie&&Ie===V)return;(!V||typeof V!="object")&&(V={}),V=Jn(V),rn=J.indexOf(V.PARSER_MEDIA_TYPE)===-1?he:V.PARSER_MEDIA_TYPE,ve=rn==="application/xhtml+xml"?jf:wl,N=Gt(V,"ALLOWED_TAGS")&&jn(V.ALLOWED_TAGS)?Ve({},V.ALLOWED_TAGS,ve):P,Z=Gt(V,"ALLOWED_ATTR")&&jn(V.ALLOWED_ATTR)?Ve({},V.ALLOWED_ATTR,ve):ae,or=Gt(V,"ALLOWED_NAMESPACES")&&jn(V.ALLOWED_NAMESPACES)?Ve({},V.ALLOWED_NAMESPACES,jf):sa,ni=Gt(V,"ADD_URI_SAFE_ATTR")&&jn(V.ADD_URI_SAFE_ATTR)?Ve(Jn(dt),V.ADD_URI_SAFE_ATTR,ve):dt,Di=Gt(V,"ADD_DATA_URI_TAGS")&&jn(V.ADD_DATA_URI_TAGS)?Ve(Jn(Ln),V.ADD_DATA_URI_TAGS,ve):Ln,$t=Gt(V,"FORBID_CONTENTS")&&jn(V.FORBID_CONTENTS)?Ve({},V.FORBID_CONTENTS,ve):nn,_e=Gt(V,"FORBID_TAGS")&&jn(V.FORBID_TAGS)?Ve({},V.FORBID_TAGS,ve):Jn({}),Q=Gt(V,"FORBID_ATTR")&&jn(V.FORBID_ATTR)?Ve({},V.FORBID_ATTR,ve):Jn({}),zt=Gt(V,"USE_PROFILES")?V.USE_PROFILES&&typeof V.USE_PROFILES=="object"?Jn(V.USE_PROFILES):V.USE_PROFILES:!1,oe=V.ALLOW_ARIA_ATTR!==!1,ge=V.ALLOW_DATA_ATTR!==!1,Se=V.ALLOW_UNKNOWN_PROTOCOLS||!1,ye=V.ALLOW_SELF_CLOSE_IN_ATTR!==!1,$e=V.SAFE_FOR_TEMPLATES||!1,Fe=V.SAFE_FOR_XML!==!1,Xe=V.WHOLE_DOCUMENT||!1,en=V.RETURN_DOM||!1,bn=V.RETURN_DOM_FRAGMENT||!1,yn=V.RETURN_TRUSTED_TYPE||!1,Ne=V.FORCE_BODY||!1,pi=V.SANITIZE_DOM!==!1,Mi=V.SANITIZE_NAMED_PROPS||!1,ut=V.KEEP_CONTENT!==!1,Vt=V.IN_PLACE||!1,z=vM(V.ALLOWED_URI_REGEXP)?V.ALLOWED_URI_REGEXP:Fw,Pt=typeof V.NAMESPACE=="string"?V.NAMESPACE:Xt,Oi=Gt(V,"MATHML_TEXT_INTEGRATION_POINTS")&&V.MATHML_TEXT_INTEGRATION_POINTS&&typeof V.MATHML_TEXT_INTEGRATION_POINTS=="object"?Jn(V.MATHML_TEXT_INTEGRATION_POINTS):Ve({},["mi","mo","mn","ms","mtext"]),Gi=Gt(V,"HTML_INTEGRATION_POINTS")&&V.HTML_INTEGRATION_POINTS&&typeof V.HTML_INTEGRATION_POINTS=="object"?Jn(V.HTML_INTEGRATION_POINTS):Ve({},["annotation-xml"]);const pe=Gt(V,"CUSTOM_ELEMENT_HANDLING")&&V.CUSTOM_ELEMENT_HANDLING&&typeof V.CUSTOM_ELEMENT_HANDLING=="object"?Jn(V.CUSTOM_ELEMENT_HANDLING):qa(null);if(ce=qa(null),Gt(pe,"tagNameCheck")&&ft(pe.tagNameCheck)&&(ce.tagNameCheck=pe.tagNameCheck),Gt(pe,"attributeNameCheck")&&ft(pe.attributeNameCheck)&&(ce.attributeNameCheck=pe.attributeNameCheck),Gt(pe,"allowCustomizedBuiltInElements")&&typeof pe.allowCustomizedBuiltInElements=="boolean"&&(ce.allowCustomizedBuiltInElements=pe.allowCustomizedBuiltInElements),$e&&(ge=!1),bn&&(en=!0),zt&&(N=Ve({},a1),Z=qa(null),zt.html===!0&&(Ve(N,s1),Ve(Z,o1)),zt.svg===!0&&(Ve(N,zf),Ve(Z,Hf),Ve(Z,hu)),zt.svgFilters===!0&&(Ve(N,$f),Ve(Z,Hf),Ve(Z,hu)),zt.mathMl===!0&&(Ve(N,Pf),Ve(Z,l1),Ve(Z,hu))),$.tagCheck=null,$.attributeCheck=null,Gt(V,"ADD_TAGS")&&(typeof V.ADD_TAGS=="function"?$.tagCheck=V.ADD_TAGS:jn(V.ADD_TAGS)&&(N===P&&(N=Jn(N)),Ve(N,V.ADD_TAGS,ve))),Gt(V,"ADD_ATTR")&&(typeof V.ADD_ATTR=="function"?$.attributeCheck=V.ADD_ATTR:jn(V.ADD_ATTR)&&(Z===ae&&(Z=Jn(Z)),Ve(Z,V.ADD_ATTR,ve))),Gt(V,"ADD_URI_SAFE_ATTR")&&jn(V.ADD_URI_SAFE_ATTR)&&Ve(ni,V.ADD_URI_SAFE_ATTR,ve),Gt(V,"FORBID_CONTENTS")&&jn(V.FORBID_CONTENTS)&&($t===nn&&($t=Jn($t)),Ve($t,V.FORBID_CONTENTS,ve)),Gt(V,"ADD_FORBID_CONTENTS")&&jn(V.ADD_FORBID_CONTENTS)&&($t===nn&&($t=Jn($t)),Ve($t,V.ADD_FORBID_CONTENTS,ve)),ut&&(N["#text"]=!0),Xe&&Ve(N,["html","head","body"]),N.table&&(Ve(N,["tbody"]),delete _e.tbody),V.TRUSTED_TYPES_POLICY){if(typeof V.TRUSTED_TYPES_POLICY.createHTML!="function")throw uu('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof V.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw uu('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');x=V.TRUSTED_TYPES_POLICY,L=x.createHTML("")}else x===void 0&&(x=LM(E,l)),x!==null&&typeof L=="string"&&(L=x.createHTML(""));Pn&&Pn(V),Ie=V},Ce=Ve({},[...zf,...$f,...bM]),je=Ve({},[...Pf,...yM]),It=function(V){let pe=b(V);(!pe||!pe.tagName)&&(pe={namespaceURI:Pt,tagName:"template"});const xe=wl(V.tagName),rt=wl(pe.tagName);return or[V.namespaceURI]?V.namespaceURI===Yt?pe.namespaceURI===Xt?xe==="svg":pe.namespaceURI===Hn?xe==="svg"&&(rt==="annotation-xml"||Oi[rt]):!!Ce[xe]:V.namespaceURI===Hn?pe.namespaceURI===Xt?xe==="math":pe.namespaceURI===Yt?xe==="math"&&Gi[rt]:!!je[xe]:V.namespaceURI===Xt?pe.namespaceURI===Yt&&!Gi[rt]||pe.namespaceURI===Hn&&!Oi[rt]?!1:!je[xe]&&(lr[xe]||!Ce[xe]):!!(rn==="application/xhtml+xml"&&or[V.namespaceURI]):!1},et=function(V){fl(n.removed,{element:V});try{b(V).removeChild(V)}catch{p(V)}},Sn=function(V,pe){try{fl(n.removed,{attribute:pe.getAttributeNode(V),from:pe})}catch{fl(n.removed,{attribute:null,from:pe})}if(pe.removeAttribute(V),V==="is")if(en||bn)try{et(pe)}catch{}else try{pe.setAttribute(V,"")}catch{}},cr=function(V){let pe=null,xe=null;if(Ne)V="<remove></remove>"+V;else{const kt=t1(V,/^[\r\n\t ]+/);xe=kt&&kt[0]}rn==="application/xhtml+xml"&&Pt===Xt&&(V='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+V+"</body></html>");const rt=x?x.createHTML(V):V;if(Pt===Xt)try{pe=new C().parseFromString(rt,rn)}catch{}if(!pe||!pe.documentElement){pe=R.createDocument(Pt,"template",null);try{pe.documentElement.innerHTML=Cs?L:rt}catch{}}const Ze=pe.body||pe.documentElement;return V&&xe&&Ze.insertBefore(r.createTextNode(xe),Ze.childNodes[0]||null),Pt===Xt?O.call(pe,Xe?"html":"body")[0]:Xe?pe.documentElement:Ze},ur=function(V){return M.call(V.ownerDocument||V,V,h.SHOW_ELEMENT|h.SHOW_COMMENT|h.SHOW_TEXT|h.SHOW_PROCESSING_INSTRUCTION|h.SHOW_CDATA_SECTION,null)},Un=function(V){return V instanceof g&&(typeof V.nodeName!="string"||typeof V.textContent!="string"||typeof V.removeChild!="function"||!(V.attributes instanceof y)||typeof V.removeAttribute!="function"||typeof V.setAttribute!="function"||typeof V.namespaceURI!="string"||typeof V.insertBefore!="function"||typeof V.hasChildNodes!="function")},At=function(V){return typeof c=="function"&&V instanceof c};function Et(De,V,pe){dl(De,xe=>{xe.call(n,V,pe,Ie)})}const Ni=function(V){let pe=null;if(Et(F.beforeSanitizeElements,V,null),Un(V))return et(V),!0;const xe=ve(V.nodeName);if(Et(F.uponSanitizeElement,V,{tagName:xe,allowedTags:N}),Fe&&V.hasChildNodes()&&!At(V.firstElementChild)&&kn(/<[/\w!]/g,V.innerHTML)&&kn(/<[/\w!]/g,V.textContent)||Fe&&V.namespaceURI===Xt&&xe==="style"&&At(V.firstElementChild)||V.nodeType===gl.progressingInstruction||Fe&&V.nodeType===gl.comment&&kn(/<[/\w]/g,V.data))return et(V),!0;if(_e[xe]||!($.tagCheck instanceof Function&&$.tagCheck(xe))&&!N[xe]){if(!_e[xe]&&hr(xe)&&(ce.tagNameCheck instanceof RegExp&&kn(ce.tagNameCheck,xe)||ce.tagNameCheck instanceof Function&&ce.tagNameCheck(xe)))return!1;if(ut&&!$t[xe]){const rt=b(V)||V.parentNode,Ze=d(V)||V.childNodes;if(Ze&&rt){const kt=Ze.length;for(let Ht=kt-1;Ht>=0;--Ht){const Ut=T(Ze[Ht],!0);rt.insertBefore(Ut,v(V))}}}return et(V),!0}return V instanceof u&&!It(V)||(xe==="noscript"||xe==="noembed"||xe==="noframes")&&kn(/<\/no(script|embed|frames)/i,V.innerHTML)?(et(V),!0):($e&&V.nodeType===gl.text&&(pe=V.textContent,dl([G,I,K],rt=>{pe=Ha(pe,rt," ")}),V.textContent!==pe&&(fl(n.removed,{element:V.cloneNode()}),V.textContent=pe)),Et(F.afterSanitizeElements,V,null),!1)},Pr=function(V,pe,xe){if(Q[pe]||pi&&(pe==="id"||pe==="name")&&(xe in r||xe in wt))return!1;const rt=Z[pe]||$.attributeCheck instanceof Function&&$.attributeCheck(pe,V);if(!(ge&&!Q[pe]&&kn(te,pe))){if(!(oe&&kn(q,pe))){if(!rt||Q[pe]){if(!(hr(V)&&(ce.tagNameCheck instanceof RegExp&&kn(ce.tagNameCheck,V)||ce.tagNameCheck instanceof Function&&ce.tagNameCheck(V))&&(ce.attributeNameCheck instanceof RegExp&&kn(ce.attributeNameCheck,pe)||ce.attributeNameCheck instanceof Function&&ce.attributeNameCheck(pe,V))||pe==="is"&&ce.allowCustomizedBuiltInElements&&(ce.tagNameCheck instanceof RegExp&&kn(ce.tagNameCheck,xe)||ce.tagNameCheck instanceof Function&&ce.tagNameCheck(xe))))return!1}else if(!ni[pe]){if(!kn(z,Ha(xe,Y,""))){if(!((pe==="src"||pe==="xlink:href"||pe==="href")&&V!=="script"&&n1(xe,"data:")===0&&Di[V])){if(!(Se&&!kn(W,Ha(xe,Y,"")))){if(xe)return!1}}}}}}return!0},aa=Ve({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),hr=function(V){return!aa[wl(V)]&&kn(B,V)},xs=function(V){Et(F.beforeSanitizeAttributes,V,null);const{attributes:pe}=V;if(!pe||Un(V))return;const xe={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:Z,forceKeepAttr:void 0};let rt=pe.length;for(;rt--;){const Ze=pe[rt],{name:kt,namespaceURI:Ht,value:Ut}=Ze,me=ve(kt),Me=Ut;let Oe=kt==="value"?Me:dM(Me);if(xe.attrName=me,xe.attrValue=Oe,xe.keepAttr=!0,xe.forceKeepAttr=void 0,Et(F.uponSanitizeAttribute,V,xe),Oe=xe.attrValue,Mi&&(me==="id"||me==="name")&&n1(Oe,tn)!==0&&(Sn(kt,V),Oe=tn+Oe),Fe&&kn(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,Oe)){Sn(kt,V);continue}if(me==="attributename"&&t1(Oe,"href")){Sn(kt,V);continue}if(xe.forceKeepAttr)continue;if(!xe.keepAttr){Sn(kt,V);continue}if(!ye&&kn(/\/>/i,Oe)){Sn(kt,V);continue}$e&&dl([G,I,K],Ot=>{Oe=Ha(Oe,Ot," ")});const at=ve(V.nodeName);if(!Pr(at,me,Oe)){Sn(kt,V);continue}if(x&&typeof E=="object"&&typeof E.getAttributeType=="function"&&!Ht)switch(E.getAttributeType(at,me)){case"TrustedHTML":{Oe=x.createHTML(Oe);break}case"TrustedScriptURL":{Oe=x.createScriptURL(Oe);break}}if(Oe!==Me)try{Ht?V.setAttributeNS(Ht,kt,Oe):V.setAttribute(kt,Oe),Un(V)?et(V):e1(n.removed)}catch{Sn(kt,V)}}Et(F.afterSanitizeAttributes,V,null)},Ki=function(V){let pe=null;const xe=ur(V);for(Et(F.beforeSanitizeShadowDOM,V,null);pe=xe.nextNode();)Et(F.uponSanitizeShadowNode,pe,null),Ni(pe),xs(pe),pe.content instanceof f&&Ki(pe.content);Et(F.afterSanitizeShadowDOM,V,null)};return n.sanitize=function(De){let V=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},pe=null,xe=null,rt=null,Ze=null;if(Cs=!De,Cs&&(De="<!-->"),typeof De!="string"&&!At(De)&&(De=_M(De),typeof De!="string"))throw uu("dirty is not a string, aborting");if(!n.isSupported)return De;if(xt||Te(V),n.removed=[],typeof De=="string"&&(Vt=!1),Vt){const Ut=De.nodeName;if(typeof Ut=="string"){const me=ve(Ut);if(!N[me]||_e[me])throw uu("root node is forbidden and cannot be sanitized in-place")}}else if(De instanceof c)pe=cr("<!---->"),xe=pe.ownerDocument.importNode(De,!0),xe.nodeType===gl.element&&xe.nodeName==="BODY"||xe.nodeName==="HTML"?pe=xe:pe.appendChild(xe);else{if(!en&&!$e&&!Xe&&De.indexOf("<")===-1)return x&&yn?x.createHTML(De):De;if(pe=cr(De),!pe)return en?null:yn?L:""}pe&&Ne&&et(pe.firstChild);const kt=ur(Vt?De:pe);for(;rt=kt.nextNode();)Ni(rt),xs(rt),rt.content instanceof f&&Ki(rt.content);if(Vt)return De;if(en){if($e){pe.normalize();let Ut=pe.innerHTML;dl([G,I,K],me=>{Ut=Ha(Ut,me," ")}),pe.innerHTML=Ut}if(bn)for(Ze=k.call(pe.ownerDocument);pe.firstChild;)Ze.appendChild(pe.firstChild);else Ze=pe;return(Z.shadowroot||Z.shadowrootmode)&&(Ze=U.call(a,Ze,!0)),Ze}let Ht=Xe?pe.outerHTML:pe.innerHTML;return Xe&&N["!doctype"]&&pe.ownerDocument&&pe.ownerDocument.doctype&&pe.ownerDocument.doctype.name&&kn(qw,pe.ownerDocument.doctype.name)&&(Ht="<!DOCTYPE "+pe.ownerDocument.doctype.name+`>
|
|
127
|
+
`+Ht),$e&&dl([G,I,K],Ut=>{Ht=Ha(Ht,Ut," ")}),x&&yn?x.createHTML(Ht):Ht},n.setConfig=function(){let De=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Te(De),xt=!0},n.clearConfig=function(){Ie=null,xt=!1},n.isValidAttribute=function(De,V,pe){Ie||Te({});const xe=ve(De),rt=ve(V);return Pr(xe,rt,pe)},n.addHook=function(De,V){typeof V=="function"&&fl(F[De],V)},n.removeHook=function(De,V){if(V!==void 0){const pe=uM(F[De],V);return pe===-1?void 0:hM(F[De],pe,1)[0]}return e1(F[De])},n.removeHooks=function(De){F[De]=[]},n.removeAllHooks=function(){F=u1()},n}var Rl=Ww(),Uf,h1;function MM(){if(h1)return Uf;h1=1;function e(J){return J instanceof Map?J.clear=J.delete=J.set=function(){throw new Error("map is read-only")}:J instanceof Set&&(J.add=J.clear=J.delete=function(){throw new Error("set is read-only")}),Object.freeze(J),Object.getOwnPropertyNames(J).forEach(he=>{const ve=J[he],Ie=typeof ve;(Ie==="object"||Ie==="function")&&!Object.isFrozen(ve)&&e(ve)}),J}class n{constructor(he){he.data===void 0&&(he.data={}),this.data=he.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function r(J){return J.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function a(J,...he){const ve=Object.create(null);for(const Ie in J)ve[Ie]=J[Ie];return he.forEach(function(Ie){for(const wt in Ie)ve[wt]=Ie[wt]}),ve}const l="</span>",f=J=>!!J.scope,m=(J,{prefix:he})=>{if(J.startsWith("language:"))return J.replace("language:","language-");if(J.includes(".")){const ve=J.split(".");return[`${he}${ve.shift()}`,...ve.map((Ie,wt)=>`${Ie}${"_".repeat(wt+1)}`)].join(" ")}return`${he}${J}`};class c{constructor(he,ve){this.buffer="",this.classPrefix=ve.classPrefix,he.walk(this)}addText(he){this.buffer+=r(he)}openNode(he){if(!f(he))return;const ve=m(he.scope,{prefix:this.classPrefix});this.span(ve)}closeNode(he){f(he)&&(this.buffer+=l)}value(){return this.buffer}span(he){this.buffer+=`<span class="${he}">`}}const u=(J={})=>{const he={children:[]};return Object.assign(he,J),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 y 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 g(J){return J?typeof J=="string"?J:J.source:null}function C(J){return T("(?=",J,")")}function E(J){return T("(?:",J,")*")}function A(J){return T("(?:",J,")?")}function T(...J){return J.map(ve=>g(ve)).join("")}function p(J){const he=J[J.length-1];return typeof he=="object"&&he.constructor===Object?(J.splice(J.length-1,1),he):{}}function v(...J){return"("+(p(J).capture?"":"?:")+J.map(Ie=>g(Ie)).join("|")+")"}function d(J){return new RegExp(J.toString()+"|").exec("").length-1}function b(J,he){const ve=J&&J.exec(he);return ve&&ve.index===0}const x=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function L(J,{joinWith:he}){let ve=0;return J.map(Ie=>{ve+=1;const wt=ve;let ft=g(Ie),Te="";for(;ft.length>0;){const Ce=x.exec(ft);if(!Ce){Te+=ft;break}Te+=ft.substring(0,Ce.index),ft=ft.substring(Ce.index+Ce[0].length),Ce[0][0]==="\\"&&Ce[1]?Te+="\\"+String(Number(Ce[1])+wt):(Te+=Ce[0],Ce[0]==="("&&ve++)}return Te}).map(Ie=>`(${Ie})`).join(he)}const R=/\b\B/,M="[a-zA-Z]\\w*",k="[a-zA-Z_]\\w*",O="\\b\\d+(\\.\\d+)?",U="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",F="\\b(0b[01]+)",G="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",I=(J={})=>{const he=/^#![ ]*\//;return J.binary&&(J.begin=T(he,/.*\b/,J.binary,/\b.*/)),a({scope:"meta",begin:he,end:/$/,relevance:0,"on:begin":(ve,Ie)=>{ve.index!==0&&Ie.ignoreMatch()}},J)},K={begin:"\\\\[\\s\\S]",relevance:0},te={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[K]},q={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[K]},W={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(J,he,ve={}){const Ie=a({scope:"comment",begin:J,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 wt=v("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:T(/[ ]+/,"(",wt,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),Ie},B=Y("//","$"),z=Y("/\\*","\\*/"),N=Y("#","$"),P={scope:"number",begin:O,relevance:0},Z={scope:"number",begin:U,relevance:0},ae={scope:"number",begin:F,relevance:0},ce={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[K,{begin:/\[/,end:/\]/,relevance:0,contains:[K]}]},_e={scope:"title",begin:M,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:K,BINARY_NUMBER_MODE:ae,BINARY_NUMBER_RE:F,COMMENT:Y,C_BLOCK_COMMENT_MODE:z,C_LINE_COMMENT_MODE:B,C_NUMBER_MODE:Z,C_NUMBER_RE:U,END_SAME_AS_BEGIN:function(J){return Object.assign(J,{"on:begin":(he,ve)=>{ve.data._beginMatch=he[1]},"on:end":(he,ve)=>{ve.data._beginMatch!==he[1]&&ve.ignoreMatch()}})},HASH_COMMENT_MODE:N,IDENT_RE:M,MATCH_NOTHING_RE:R,METHOD_GUARD:$,NUMBER_MODE:P,NUMBER_RE:O,PHRASAL_WORDS_MODE:W,QUOTE_STRING_MODE:q,REGEXP_MODE:ce,RE_STARTERS_RE:G,SHEBANG:I,TITLE_MODE:_e,UNDERSCORE_IDENT_RE:k,UNDERSCORE_TITLE_MODE:Q});function Se(J,he){J.input[J.index-1]==="."&&he.ignoreMatch()}function ye(J,he){J.className!==void 0&&(J.scope=J.className,delete J.className)}function $e(J,he){he&&J.beginKeywords&&(J.begin="\\b("+J.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",J.__beforeBegin=Se,J.keywords=J.keywords||J.beginKeywords,delete J.beginKeywords,J.relevance===void 0&&(J.relevance=0))}function Fe(J,he){Array.isArray(J.illegal)&&(J.illegal=v(...J.illegal))}function Xe(J,he){if(J.match){if(J.begin||J.end)throw new Error("begin & end are not supported with match");J.begin=J.match,delete J.match}}function xt(J,he){J.relevance===void 0&&(J.relevance=1)}const Ne=(J,he)=>{if(!J.beforeMatch)return;if(J.starts)throw new Error("beforeMatch cannot be used with starts");const ve=Object.assign({},J);Object.keys(J).forEach(Ie=>{delete J[Ie]}),J.keywords=ve.keywords,J.begin=T(ve.beforeMatch,C(ve.begin)),J.starts={relevance:0,contains:[Object.assign(ve,{endsParent:!0})]},J.relevance=0,delete ve.beforeMatch},en=["of","and","for","in","not","or","if","then","parent","list","value"],bn="keyword";function yn(J,he,ve=bn){const Ie=Object.create(null);return typeof J=="string"?wt(ve,J.split(" ")):Array.isArray(J)?wt(ve,J):Object.keys(J).forEach(function(ft){Object.assign(Ie,yn(J[ft],he,ft))}),Ie;function wt(ft,Te){he&&(Te=Te.map(Ce=>Ce.toLowerCase())),Te.forEach(function(Ce){const je=Ce.split("|");Ie[je[0]]=[ft,pi(je[0],je[1])]})}}function pi(J,he){return he?Number(he):Mi(J)?0:1}function Mi(J){return en.includes(J.toLowerCase())}const tn={},ut=J=>{console.error(J)},Vt=(J,...he)=>{console.log(`WARN: ${J}`,...he)},zt=(J,he)=>{tn[`${J}/${he}`]||(console.log(`Deprecated as of ${J}. ${he}`),tn[`${J}/${he}`]=!0)},$t=new Error;function nn(J,he,{key:ve}){let Ie=0;const wt=J[ve],ft={},Te={};for(let Ce=1;Ce<=he.length;Ce++)Te[Ce+Ie]=wt[Ce],ft[Ce+Ie]=!0,Ie+=d(he[Ce-1]);J[ve]=Te,J[ve]._emit=ft,J[ve]._multi=!0}function Di(J){if(Array.isArray(J.begin)){if(J.skip||J.excludeBegin||J.returnBegin)throw ut("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),$t;if(typeof J.beginScope!="object"||J.beginScope===null)throw ut("beginScope must be object"),$t;nn(J,J.begin,{key:"beginScope"}),J.begin=L(J.begin,{joinWith:""})}}function Ln(J){if(Array.isArray(J.end)){if(J.skip||J.excludeEnd||J.returnEnd)throw ut("skip, excludeEnd, returnEnd not compatible with endScope: {}"),$t;if(typeof J.endScope!="object"||J.endScope===null)throw ut("endScope must be object"),$t;nn(J,J.end,{key:"endScope"}),J.end=L(J.end,{joinWith:""})}}function ni(J){J.scope&&typeof J.scope=="object"&&J.scope!==null&&(J.beginScope=J.scope,delete J.scope)}function dt(J){ni(J),typeof J.beginScope=="string"&&(J.beginScope={_wrap:J.beginScope}),typeof J.endScope=="string"&&(J.endScope={_wrap:J.endScope}),Di(J),Ln(J)}function Hn(J){function he(Te,Ce){return new RegExp(g(Te),"m"+(J.case_insensitive?"i":"")+(J.unicodeRegex?"u":"")+(Ce?"g":""))}class ve{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(Ce,je){je.position=this.position++,this.matchIndexes[this.matchAt]=je,this.regexes.push([je,Ce]),this.matchAt+=d(Ce)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);const Ce=this.regexes.map(je=>je[1]);this.matcherRe=he(L(Ce,{joinWith:"|"}),!0),this.lastIndex=0}exec(Ce){this.matcherRe.lastIndex=this.lastIndex;const je=this.matcherRe.exec(Ce);if(!je)return null;const It=je.findIndex((Sn,cr)=>cr>0&&Sn!==void 0),et=this.matchIndexes[It];return je.splice(0,It),Object.assign(je,et)}}class Ie{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(Ce){if(this.multiRegexes[Ce])return this.multiRegexes[Ce];const je=new ve;return this.rules.slice(Ce).forEach(([It,et])=>je.addRule(It,et)),je.compile(),this.multiRegexes[Ce]=je,je}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(Ce,je){this.rules.push([Ce,je]),je.type==="begin"&&this.count++}exec(Ce){const je=this.getMatcher(this.regexIndex);je.lastIndex=this.lastIndex;let It=je.exec(Ce);if(this.resumingScanAtSamePosition()&&!(It&&It.index===this.lastIndex)){const et=this.getMatcher(0);et.lastIndex=this.lastIndex+1,It=et.exec(Ce)}return It&&(this.regexIndex+=It.position+1,this.regexIndex===this.count&&this.considerAll()),It}}function wt(Te){const Ce=new Ie;return Te.contains.forEach(je=>Ce.addRule(je.begin,{rule:je,type:"begin"})),Te.terminatorEnd&&Ce.addRule(Te.terminatorEnd,{type:"end"}),Te.illegal&&Ce.addRule(Te.illegal,{type:"illegal"}),Ce}function ft(Te,Ce){const je=Te;if(Te.isCompiled)return je;[ye,Xe,dt,Ne].forEach(et=>et(Te,Ce)),J.compilerExtensions.forEach(et=>et(Te,Ce)),Te.__beforeBegin=null,[$e,Fe,xt].forEach(et=>et(Te,Ce)),Te.isCompiled=!0;let It=null;return typeof Te.keywords=="object"&&Te.keywords.$pattern&&(Te.keywords=Object.assign({},Te.keywords),It=Te.keywords.$pattern,delete Te.keywords.$pattern),It=It||/\w+/,Te.keywords&&(Te.keywords=yn(Te.keywords,J.case_insensitive)),je.keywordPatternRe=he(It,!0),Ce&&(Te.begin||(Te.begin=/\B|\b/),je.beginRe=he(je.begin),!Te.end&&!Te.endsWithParent&&(Te.end=/\B|\b/),Te.end&&(je.endRe=he(je.end)),je.terminatorEnd=g(je.end)||"",Te.endsWithParent&&Ce.terminatorEnd&&(je.terminatorEnd+=(Te.end?"|":"")+Ce.terminatorEnd)),Te.illegal&&(je.illegalRe=he(Te.illegal)),Te.contains||(Te.contains=[]),Te.contains=[].concat(...Te.contains.map(function(et){return Xt(et==="self"?Te:et)})),Te.contains.forEach(function(et){ft(et,je)}),Te.starts&&ft(Te.starts,Ce),je.matcher=wt(je),je}if(J.compilerExtensions||(J.compilerExtensions=[]),J.contains&&J.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return J.classNameAliases=a(J.classNameAliases||{}),ft(J)}function Yt(J){return J?J.endsWithParent||Yt(J.starts):!1}function Xt(J){return J.variants&&!J.cachedVariants&&(J.cachedVariants=J.variants.map(function(he){return a(J,{variants:null},he)})),J.cachedVariants?J.cachedVariants:Yt(J)?a(J,{starts:J.starts?a(J.starts):null}):Object.isFrozen(J)?a(J):J}var Pt="11.11.1";class Cs extends Error{constructor(he,ve){super(he),this.name="HTMLInjectionError",this.html=ve}}const or=r,sa=a,Oi=Symbol("nomatch"),Gi=7,lr=function(J){const he=Object.create(null),ve=Object.create(null),Ie=[];let wt=!0;const ft="Could not find the language '{}', did you forget to load/include a language module?",Te={disableAutodetect:!0,name:"Plain text",contains:[]};let Ce={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:y};function je(me){return Ce.noHighlightRe.test(me)}function It(me){let Me=me.className+" ";Me+=me.parentNode?me.parentNode.className:"";const Oe=Ce.languageDetectRe.exec(Me);if(Oe){const at=V(Oe[1]);return at||(Vt(ft.replace("{}",Oe[1])),Vt("Falling back to no-highlight mode for this block.",me)),at?Oe[1]:"no-highlight"}return Me.split(/\s+/).find(at=>je(at)||V(at))}function et(me,Me,Oe){let at="",Ot="";typeof Me=="object"?(at=me,Oe=Me.ignoreIllegals,Ot=Me.language):(zt("10.7.0","highlight(lang, code, ...args) has been deprecated."),zt("10.7.0",`Please use highlight(code, options) instead.
|
|
128
|
+
https://github.com/highlightjs/highlight.js/issues/2277`),Ot=me,at=Me),Oe===void 0&&(Oe=!0);const Mn={code:at,language:Ot};Ht("before:highlight",Mn);const ii=Mn.result?Mn.result:Sn(Mn.language,Mn.code,Oe);return ii.code=Mn.code,Ht("after:highlight",ii),ii}function Sn(me,Me,Oe,at){const Ot=Object.create(null);function Mn(we,Re){return we.keywords[Re]}function ii(){if(!Pe.keywords){sn.addText(pt);return}let we=0;Pe.keywordPatternRe.lastIndex=0;let Re=Pe.keywordPatternRe.exec(pt),qe="";for(;Re;){qe+=pt.substring(we,Re.index);const tt=wn.case_insensitive?Re[0].toLowerCase():Re[0],jt=Mn(Pe,tt);if(jt){const[gi,vo]=jt;if(sn.addText(qe),qe="",Ot[tt]=(Ot[tt]||0)+1,Ot[tt]<=Gi&&(Hr+=vo),gi.startsWith("_"))qe+=Re[0];else{const Yl=wn.classNameAliases[gi]||gi;ri(Re[0],Yl)}}else qe+=Re[0];we=Pe.keywordPatternRe.lastIndex,Re=Pe.keywordPatternRe.exec(pt)}qe+=pt.substring(we),sn.addText(qe)}function Fn(){if(pt==="")return;let we=null;if(typeof Pe.subLanguage=="string"){if(!he[Pe.subLanguage]){sn.addText(pt);return}we=Sn(Pe.subLanguage,pt,!0,Vl[Pe.subLanguage]),Vl[Pe.subLanguage]=we._top}else we=ur(pt,Pe.subLanguage.length?Pe.subLanguage:null);Pe.relevance>0&&(Hr+=we.relevance),sn.__addSublanguage(we._emitter,we.language)}function Tt(){Pe.subLanguage!=null?Fn():ii(),pt=""}function ri(we,Re){we!==""&&(sn.startScope(Re),sn.addText(we),sn.endScope())}function Gl(we,Re){let qe=1;const tt=Re.length-1;for(;qe<=tt;){if(!we._emit[qe]){qe++;continue}const jt=wn.classNameAliases[we[qe]]||we[qe],gi=Re[qe];jt?ri(gi,jt):(pt=gi,ii(),pt=""),qe++}}function oa(we,Re){return we.scope&&typeof we.scope=="string"&&sn.openNode(wn.classNameAliases[we.scope]||we.scope),we.beginScope&&(we.beginScope._wrap?(ri(pt,wn.classNameAliases[we.beginScope._wrap]||we.beginScope._wrap),pt=""):we.beginScope._multi&&(Gl(we.beginScope,Re),pt="")),Pe=Object.create(we,{parent:{value:Pe}}),Pe}function go(we,Re,qe){let tt=b(we.endRe,qe);if(tt){if(we["on:end"]){const jt=new n(we);we["on:end"](Re,jt),jt.isMatchIgnored&&(tt=!1)}if(tt){for(;we.endsParent&&we.parent;)we=we.parent;return we}}if(we.endsWithParent)return go(we.parent,Re,qe)}function la(we){return Pe.matcher.regexIndex===0?(pt+=we[0],1):(Ur=!0,0)}function ph(we){const Re=we[0],qe=we.rule,tt=new n(qe),jt=[qe.__beforeBegin,qe["on:begin"]];for(const gi of jt)if(gi&&(gi(we,tt),tt.isMatchIgnored))return la(Re);return qe.skip?pt+=Re:(qe.excludeBegin&&(pt+=Re),Tt(),!qe.returnBegin&&!qe.excludeBegin&&(pt=Re)),oa(qe,we),qe.returnBegin?0:Re.length}function qn(we){const Re=we[0],qe=Me.substring(we.index),tt=go(Pe,we,qe);if(!tt)return Oi;const jt=Pe;Pe.endScope&&Pe.endScope._wrap?(Tt(),ri(Re,Pe.endScope._wrap)):Pe.endScope&&Pe.endScope._multi?(Tt(),Gl(Pe.endScope,we)):jt.skip?pt+=Re:(jt.returnEnd||jt.excludeEnd||(pt+=Re),Tt(),jt.excludeEnd&&(pt=Re));do Pe.scope&&sn.closeNode(),!Pe.skip&&!Pe.subLanguage&&(Hr+=Pe.relevance),Pe=Pe.parent;while(Pe!==tt.parent);return tt.starts&&oa(tt.starts,we),jt.returnEnd?0:Re.length}function mo(){const we=[];for(let Re=Pe;Re!==wn;Re=Re.parent)Re.scope&&we.unshift(Re.scope);we.forEach(Re=>sn.openNode(Re))}let Es={};function ca(we,Re){const qe=Re&&Re[0];if(pt+=we,qe==null)return Tt(),0;if(Es.type==="begin"&&Re.type==="end"&&Es.index===Re.index&&qe===""){if(pt+=Me.slice(Re.index,Re.index+1),!wt){const tt=new Error(`0 width match regex (${me})`);throw tt.languageName=me,tt.badRule=Es.rule,tt}return 1}if(Es=Re,Re.type==="begin")return ph(Re);if(Re.type==="illegal"&&!Oe){const tt=new Error('Illegal lexeme "'+qe+'" for mode "'+(Pe.scope||"<unnamed>")+'"');throw tt.mode=Pe,tt}else if(Re.type==="end"){const tt=qn(Re);if(tt!==Oi)return tt}if(Re.type==="illegal"&&qe==="")return pt+=`
|
|
129
|
+
`,1;if(_o>1e5&&_o>Re.index*3)throw new Error("potential infinite loop, way more iterations than matches");return pt+=qe,qe.length}const wn=V(me);if(!wn)throw ut(ft.replace("{}",me)),new Error('Unknown language: "'+me+'"');const Kl=Hn(wn);let ua="",Pe=at||Kl;const Vl={},sn=new Ce.__emitter(Ce);mo();let pt="",Hr=0,dr=0,_o=0,Ur=!1;try{if(wn.__emitTokens)wn.__emitTokens(Me,sn);else{for(Pe.matcher.considerAll();;){_o++,Ur?Ur=!1:Pe.matcher.considerAll(),Pe.matcher.lastIndex=dr;const we=Pe.matcher.exec(Me);if(!we)break;const Re=Me.substring(dr,we.index),qe=ca(Re,we);dr=we.index+qe}ca(Me.substring(dr))}return sn.finalize(),ua=sn.toHTML(),{language:me,value:ua,relevance:Hr,illegal:!1,_emitter:sn,_top:Pe}}catch(we){if(we.message&&we.message.includes("Illegal"))return{language:me,value:or(Me),illegal:!0,relevance:0,_illegalBy:{message:we.message,index:dr,context:Me.slice(dr-100,dr+100),mode:we.mode,resultSoFar:ua},_emitter:sn};if(wt)return{language:me,value:or(Me),illegal:!1,relevance:0,errorRaised:we,_emitter:sn,_top:Pe};throw we}}function cr(me){const Me={value:or(me),illegal:!1,relevance:0,_top:Te,_emitter:new Ce.__emitter(Ce)};return Me._emitter.addText(me),Me}function ur(me,Me){Me=Me||Ce.languages||Object.keys(he);const Oe=cr(me),at=Me.filter(V).filter(xe).map(Tt=>Sn(Tt,me,!1));at.unshift(Oe);const Ot=at.sort((Tt,ri)=>{if(Tt.relevance!==ri.relevance)return ri.relevance-Tt.relevance;if(Tt.language&&ri.language){if(V(Tt.language).supersetOf===ri.language)return 1;if(V(ri.language).supersetOf===Tt.language)return-1}return 0}),[Mn,ii]=Ot,Fn=Mn;return Fn.secondBest=ii,Fn}function Un(me,Me,Oe){const at=Me&&ve[Me]||Oe;me.classList.add("hljs"),me.classList.add(`language-${at}`)}function At(me){let Me=null;const Oe=It(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&&(Ce.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)),Ce.throwUnescapedHTML))throw new Cs("One of your code blocks includes unescaped HTML.",me.innerHTML);Me=me;const at=Me.textContent,Ot=Oe?et(at,{language:Oe,ignoreIllegals:!0}):ur(at);me.innerHTML=Ot.value,me.dataset.highlighted="yes",Un(me,Oe,Ot.language),me.result={language:Ot.language,re:Ot.relevance,relevance:Ot.relevance},Ot.secondBest&&(me.secondBest={language:Ot.secondBest.language,relevance:Ot.secondBest.relevance}),Ht("after:highlightElement",{el:me,result:Ot,text:at})}function Et(me){Ce=sa(Ce,me)}const Ni=()=>{hr(),zt("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function Pr(){hr(),zt("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let aa=!1;function hr(){function me(){hr()}if(document.readyState==="loading"){aa||window.addEventListener("DOMContentLoaded",me,!1),aa=!0;return}document.querySelectorAll(Ce.cssSelector).forEach(At)}function xs(me,Me){let Oe=null;try{Oe=Me(J)}catch(at){if(ut("Language definition for '{}' could not be registered.".replace("{}",me)),wt)ut(at);else throw at;Oe=Te}Oe.name||(Oe.name=me),he[me]=Oe,Oe.rawDefinition=Me.bind(null,J),Oe.aliases&&pe(Oe.aliases,{languageName:me})}function Ki(me){delete he[me];for(const Me of Object.keys(ve))ve[Me]===me&&delete ve[Me]}function De(){return Object.keys(he)}function V(me){return me=(me||"").toLowerCase(),he[me]||he[ve[me]]}function pe(me,{languageName:Me}){typeof me=="string"&&(me=[me]),me.forEach(Oe=>{ve[Oe.toLowerCase()]=Me})}function xe(me){const Me=V(me);return Me&&!Me.disableAutodetect}function rt(me){me["before:highlightBlock"]&&!me["before:highlightElement"]&&(me["before:highlightElement"]=Me=>{me["before:highlightBlock"](Object.assign({block:Me.el},Me))}),me["after:highlightBlock"]&&!me["after:highlightElement"]&&(me["after:highlightElement"]=Me=>{me["after:highlightBlock"](Object.assign({block:Me.el},Me))})}function Ze(me){rt(me),Ie.push(me)}function kt(me){const Me=Ie.indexOf(me);Me!==-1&&Ie.splice(Me,1)}function Ht(me,Me){const Oe=me;Ie.forEach(function(at){at[Oe]&&at[Oe](Me)})}function Ut(me){return zt("10.7.0","highlightBlock will be removed entirely in v12.0"),zt("10.7.0","Please use highlightElement now."),At(me)}Object.assign(J,{highlight:et,highlightAuto:ur,highlightAll:hr,highlightElement:At,highlightBlock:Ut,configure:Et,initHighlighting:Ni,initHighlightingOnLoad:Pr,registerLanguage:xs,unregisterLanguage:Ki,listLanguages:De,getLanguage:V,registerAliases:pe,autoDetection:xe,inherit:sa,addPlugin:Ze,removePlugin:kt}),J.debugMode=function(){wt=!1},J.safeMode=function(){wt=!0},J.versionString=Pt,J.regex={concat:T,lookahead:C,either:v,optional:A,anyNumberOfTimes:E};for(const me in ge)typeof ge[me]=="object"&&e(ge[me]);return Object.assign(J,ge),J},rn=lr({});return rn.newInstance=()=>lr({}),Uf=rn,rn.HighlightJS=rn,rn.default=rn,Uf}var DM=MM();const xi=eE(DM);function d1(e){const n=e.regex,r={},a={begin:/\$\{/,end:/\}/,contains:["self",{begin:/:-/,contains:[r]}]};Object.assign(r,{className:"variable",variants:[{begin:n.concat(/\$[\w\d#@][\w\d_]*/,"(?![\\w\\d])(?![$])")},a]});const l={className:"subst",begin:/\$\(/,end:/\)/,contains:[e.BACKSLASH_ESCAPE]},f=e.inherit(e.COMMENT(),{match:[/(^|\s)/,/#.*$/],scope:{2:"comment"}}),m={begin:/<<-?\s*(?=\w+)/,starts:{contains:[e.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,className:"string"})]}},c={className:"string",begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,r,l]};l.contains.push(c);const u={match:/\\"/},h={className:"string",begin:/'/,end:/'/},y={match:/\\'/},g={begin:/\$?\(\(/,end:/\)\)/,contains:[{begin:/\d+#[0-9a-f]+/,className:"number"},e.NUMBER_MODE,r]},C=["fish","bash","zsh","sh","csh","ksh","tcsh","dash","scsh"],E=e.SHEBANG({binary:`(${C.join("|")})`,relevance:10}),A={className:"function",begin:/\w[\w\d_]*\s*\(\s*\)\s*\{/,returnBegin:!0,contains:[e.inherit(e.TITLE_MODE,{begin:/\w[\w\d_]*/})],relevance:0},T=["if","then","else","elif","fi","time","for","while","until","in","do","done","case","esac","coproc","function","select"],p=["true","false"],v={match:/(\/[a-z._-]+)+/},d=["break","cd","continue","eval","exec","exit","export","getopts","hash","pwd","readonly","return","shift","test","times","trap","umask","unset"],b=["alias","bind","builtin","caller","command","declare","echo","enable","help","let","local","logout","mapfile","printf","read","readarray","source","sudo","type","typeset","ulimit","unalias"],x=["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:T,literal:p,built_in:[...d,...b,"set","shopt",...x,...L]},contains:[E,e.SHEBANG(),A,g,f,m,v,c,u,h,y,r]}}const f1="[A-Za-z$_][0-9A-Za-z$_]*",OM=["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"],NM=["true","false","null","undefined","NaN","Infinity"],Gw=["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"],Kw=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],Vw=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],BM=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],IM=[].concat(Vw,Gw,Kw);function p1(e){const n=e.regex,r=(Y,{after:B})=>{const z="</"+Y[0].slice(1);return Y.input.indexOf(z,B)!==-1},a=f1,l={begin:"<>",end:"</>"},f=/<[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,N=Y.input[z];if(N==="<"||N===","){B.ignoreMatch();return}N===">"&&(r(Y,{after:z})||B.ignoreMatch());let P;const Z=Y.input.substring(z);if(P=Z.match(/^\s*=/)){B.ignoreMatch();return}if((P=Z.match(/^\s+extends\s+/))&&P.index===0){B.ignoreMatch();return}}},c={$pattern:f1,keyword:OM,literal:NM,built_in:IM,"variable.language":BM},u="[0-9](_?[0-9])*",h=`\\.(${u})`,y="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",g={className:"number",variants:[{begin:`(\\b(${y})((${h})|\\.)?|(${h}))[eE][+-]?(${u})\\b`},{begin:`\\b(${y})\\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:[]},E={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,C],subLanguage:"xml"}},A={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,C],subLanguage:"css"}},T={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,C],subLanguage:"graphql"}},p={className:"string",begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,C]},d={className:"comment",variants:[e.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:a+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]},b=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,E,A,T,p,{match:/\$\d+/},g];C.contains=b.concat({begin:/\{/,end:/\}/,keywords:c,contains:["self"].concat(b)});const x=[].concat(d,C.contains),L=x.concat([{begin:/(\s*)\(/,end:/\)/,keywords:c,contains:["self"].concat(x)}]),R={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:c,contains:L},M={variants:[{match:[/class/,/\s+/,a,/\s+/,/extends/,/\s+/,n.concat(a,"(",n.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:n.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:{_:[...Gw,...Kw]}},O={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},U={variants:[{match:[/function/,/\s+/,a,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[R],illegal:/%/},F={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function G(Y){return n.concat("(?!",Y.join("|"),")")}const I={match:n.concat(/\b/,G([...Vw,"super","import"].map(Y=>`${Y}\\s*\\(`)),a,n.lookahead(/\s*\(/)),className:"title.function",relevance:0},K={begin:n.concat(/\./,n.lookahead(n.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]},q="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",W={match:[/const|var|let/,/\s+/,a,/\s*/,/=\s*/,/(async\s*)?/,n.lookahead(q)],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:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),O,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,E,A,T,p,d,{match:/\$\d+/},g,k,{scope:"attr",match:a+n.lookahead(":"),relevance:0},W,{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[d,e.REGEXP_MODE,{className:"function",begin:q,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:e.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:c,contains:L}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:l.begin,end:l.end},{match:f},{begin:m.begin,"on:begin":m.isTrulyOpeningTag,end:m.end}],subLanguage:"xml",contains:[{begin:m.begin,end:m.end,skip:!0,contains:["self"]}]}]},U,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[R,e.inherit(e.TITLE_MODE,{begin:a,className:"title.function"})]},{match:/\.\.\./,relevance:0},K,{match:"\\$"+a,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[R]},I,F,M,te,{match:/\$[(.]/}]}}function jM(e){const n={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:[n,r,e.QUOTE_STRING_MODE,l,e.C_NUMBER_MODE,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE],illegal:"\\S"}}function g1(e){const n=e.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}]},f={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:n.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}/}]},y={className:"emphasis",contains:[],variants:[{begin:/\*(?![*\s])/,end:/\*/},{begin:/_(?![_\s])/,end:/_/,relevance:0}]},g=e.inherit(h,{contains:[]}),C=e.inherit(y,{contains:[]});h.contains.push(C),y.contains.push(g);let E=[r,u];return[h,y,g,C].forEach(v=>{v.contains=v.contains.concat(E)}),E=E.concat(h,y),{name:"Markdown",aliases:["md","mkdown","mkd"],contains:[{className:"section",variants:[{begin:"^#{1,6}",end:"$",contains:E},{begin:"(?=^.+?\\n[=-]{2,}$)",contains:[{begin:"^[=-]*$"},{begin:"^",end:"\\n",contains:E}]}]},r,f,h,y,{className:"quote",begin:"^>\\s+",contains:E,end:"$"},l,a,u,m,{scope:"literal",match:/&([a-zA-Z0-9]+|#[0-9]{1,7}|#[Xx][0-9a-fA-F]{1,6});/}]}}function m1(e){const n=e.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:/#/},y={begin:/\{\{/,relevance:0},g={className:"string",contains:[e.BACKSLASH_ESCAPE],variants:[{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,u],relevance:10},{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,u],relevance:10},{begin:/([fF][rR]|[rR][fF]|[fF])'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,u,y,h]},{begin:/([fF][rR]|[rR][fF]|[fF])"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,u,y,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:[e.BACKSLASH_ESCAPE,y,h]},{begin:/([fF][rR]|[rR][fF]|[fF])"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,y,h]},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},C="[0-9](_?[0-9])*",E=`(\\b(${C}))?\\.(${C})|\\b(${C})\\.`,A=`\\b|${a.join("|")}`,T={className:"number",relevance:0,variants:[{begin:`(\\b(${C})|(${E}))[eE][+-]?(${C})[jJ]?(?=${A})`},{begin:`(${E})[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})`}]},p={className:"comment",begin:n.lookahead(/# type:/),end:/$/,keywords:c,contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},v={className:"params",variants:[{className:"",begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:c,contains:["self",u,T,g,e.HASH_COMMENT_MODE]}]};return h.contains=[g,T,u],{name:"Python",aliases:["py","gyp","ipython"],unicodeRegex:!0,keywords:c,illegal:/(<\/|\?)|=>/,contains:[u,T,{scope:"variable.language",match:/\bself\b/},{beginKeywords:"if",relevance:0},{match:/\bor\b/,scope:"keyword"},g,p,e.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,r],scope:{1:"keyword",3:"title.function"},contains:[v]},{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:[T,v,g]}]}}const Gu="[A-Za-z$_][0-9A-Za-z$_]*",Yw=["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"],Xw=["true","false","null","undefined","NaN","Infinity"],Zw=["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"],Jw=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],Qw=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],eC=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],tC=[].concat(Qw,Zw,Jw);function zM(e){const n=e.regex,r=(Y,{after:B})=>{const z="</"+Y[0].slice(1);return Y.input.indexOf(z,B)!==-1},a=Gu,l={begin:"<>",end:"</>"},f=/<[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,N=Y.input[z];if(N==="<"||N===","){B.ignoreMatch();return}N===">"&&(r(Y,{after:z})||B.ignoreMatch());let P;const Z=Y.input.substring(z);if(P=Z.match(/^\s*=/)){B.ignoreMatch();return}if((P=Z.match(/^\s+extends\s+/))&&P.index===0){B.ignoreMatch();return}}},c={$pattern:Gu,keyword:Yw,literal:Xw,built_in:tC,"variable.language":eC},u="[0-9](_?[0-9])*",h=`\\.(${u})`,y="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",g={className:"number",variants:[{begin:`(\\b(${y})((${h})|\\.)?|(${h}))[eE][+-]?(${u})\\b`},{begin:`\\b(${y})\\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:[]},E={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,C],subLanguage:"xml"}},A={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,C],subLanguage:"css"}},T={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,C],subLanguage:"graphql"}},p={className:"string",begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,C]},d={className:"comment",variants:[e.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:a+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]},b=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,E,A,T,p,{match:/\$\d+/},g];C.contains=b.concat({begin:/\{/,end:/\}/,keywords:c,contains:["self"].concat(b)});const x=[].concat(d,C.contains),L=x.concat([{begin:/(\s*)\(/,end:/\)/,keywords:c,contains:["self"].concat(x)}]),R={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:c,contains:L},M={variants:[{match:[/class/,/\s+/,a,/\s+/,/extends/,/\s+/,n.concat(a,"(",n.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:n.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:{_:[...Zw,...Jw]}},O={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},U={variants:[{match:[/function/,/\s+/,a,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[R],illegal:/%/},F={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function G(Y){return n.concat("(?!",Y.join("|"),")")}const I={match:n.concat(/\b/,G([...Qw,"super","import"].map(Y=>`${Y}\\s*\\(`)),a,n.lookahead(/\s*\(/)),className:"title.function",relevance:0},K={begin:n.concat(/\./,n.lookahead(n.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]},q="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",W={match:[/const|var|let/,/\s+/,a,/\s*/,/=\s*/,/(async\s*)?/,n.lookahead(q)],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:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),O,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,E,A,T,p,d,{match:/\$\d+/},g,k,{scope:"attr",match:a+n.lookahead(":"),relevance:0},W,{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[d,e.REGEXP_MODE,{className:"function",begin:q,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:e.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:c,contains:L}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:l.begin,end:l.end},{match:f},{begin:m.begin,"on:begin":m.isTrulyOpeningTag,end:m.end}],subLanguage:"xml",contains:[{begin:m.begin,end:m.end,skip:!0,contains:["self"]}]}]},U,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[R,e.inherit(e.TITLE_MODE,{begin:a,className:"title.function"})]},{match:/\.\.\./,relevance:0},K,{match:"\\$"+a,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[R]},I,F,M,te,{match:/\$[(.]/}]}}function _1(e){const n=e.regex,r=zM(e),a=Gu,l=["any","void","number","boolean","string","object","never","symbol","bigint","unknown"],f={begin:[/namespace/,/\s+/,e.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:Gu,keyword:Yw.concat(u),literal:Xw,built_in:tC.concat(l),"variable.language":eC},y={className:"meta",begin:"@"+a},g=(T,p,v)=>{const d=T.contains.findIndex(b=>b.label===p);if(d===-1)throw new Error("can not find mode to replace");T.contains.splice(d,1,v)};Object.assign(r.keywords,h),r.exports.PARAMS_CONTAINS.push(y);const C=r.contains.find(T=>T.scope==="attr"),E=Object.assign({},C,{match:n.concat(a,n.lookahead(/\s*\?:/))});r.exports.PARAMS_CONTAINS.push([r.exports.CLASS_REFERENCE,C,E]),r.contains=r.contains.concat([y,f,m,E]),g(r,"shebang",e.SHEBANG()),g(r,"use_strict",c);const A=r.contains.find(T=>T.label==="func.def");return A.relevance=0,Object.assign(r,{name:"TypeScript",aliases:["ts","tsx","mts","cts"]}),r}const $M=/\[\[wiki:([^\]]+)\]\]/g,PM=new Hw({gfm:!0,breaks:!1}),v1={ALLOWED_URI_REGEXP:/^(?:(?:https?|mailto):|[#/]|\.{0,2}\/|[^:]+$)/i,ADD_ATTR:["target","rel","data-entry-id"]},Ff=ZM();function fo(e,n={}){const r=FM(e),a=PM.parse(r,{async:!1}),l=Rl.sanitize(a,v1),f=new DOMParser().parseFromString(l,"text/html");return WM(f,n.omitDuplicateTitle),qM(f),GM(f),VM(f),{html:Rl.sanitize(f.body.innerHTML,v1),toc:YM(f)}}function HM(e){const n=new TextEncoder().encode(e);let r="";for(const a of n)r+=String.fromCharCode(a);return btoa(r)}function UM(e){const n=atob(e),r=new Uint8Array(n.length);for(let a=0;a<n.length;a++)r[a]=n.charCodeAt(a);return new TextDecoder().decode(r)}function FM(e){return e.replace($M,(n,r)=>{const a=r.trim();if(!a)return"";const l=Ee(a),f=encodeURIComponent(a);return`<a href="${$r(a)}" data-entry-id="${f}">${l}</a>`})}function qM(e){const n=new Map;for(const r of e.querySelectorAll("h2, h3")){const a=r.textContent?.trim()??"",l=e6(a||"section"),f=n.get(l)??0;n.set(l,f+1),r.id=f===0?l:`${l}-${f+1}`}}function WM(e,n){if(!n)return;const r=e.body.querySelector("h1, h2, h3, h4, h5, h6");!r||r.tagName.toLowerCase()!=="h1"||b1(r.textContent??"")===b1(n)&&r.remove()}function GM(e){for(const n of e.querySelectorAll("pre > code")){const r=JM(n.className),a=n.textContent??"",l=n.parentElement;if(!l)continue;if(r==="mermaid"){const m=e.createElement("div");m.className="diagram-block",m.setAttribute("data-mermaid-source",HM(a)),m.setAttribute("data-diagram-state","pending"),l.replaceWith(m);continue}const f=XM(a,r);n.innerHTML=f,n.classList.add("hljs"),l.classList.add("code-block"),l.dataset.code=a,l.insertBefore(KM(e,r||"text"),l.firstChild)}}function KM(e,n){const r=e.createElement("div");r.className="code-block-toolbar";const a=e.createElement("span");a.className="code-block-dots",a.setAttribute("aria-hidden","true");for(let m=0;m<3;m++)a.append(e.createElement("span"));const l=e.createElement("span");l.className="code-block-language",l.textContent=n;const f=e.createElement("button");return f.className="copy-code",f.type="button",f.dataset.action="copy-code",f.setAttribute("aria-label",`Copy ${n} code`),f.textContent="Copy",r.append(a,l,f),r}function VM(e){for(const n of e.querySelectorAll("a")){const r=n.getAttribute("href")??"";QM(r)&&(n.setAttribute("target","_blank"),n.setAttribute("rel","noopener noreferrer"))}}function YM(e){return[...e.querySelectorAll("h2, h3")].map(n=>({id:n.id,text:n.textContent?.trim()??n.id,level:n.tagName.toLowerCase()==="h2"?2:3}))}function XM(e,n){return n&&Ff.getLanguage(n)?Ff.highlight(e,{language:n}).value:Ff.highlightAuto(e).value}function ZM(){return xi.registerLanguage("bash",d1),xi.registerLanguage("sh",d1),xi.registerLanguage("javascript",p1),xi.registerLanguage("js",p1),xi.registerLanguage("json",jM),xi.registerLanguage("markdown",g1),xi.registerLanguage("md",g1),xi.registerLanguage("python",m1),xi.registerLanguage("py",m1),xi.registerLanguage("typescript",_1),xi.registerLanguage("ts",_1),xi}function JM(e){return e.match(/language-([a-z0-9_-]+)/i)?.[1]?.toLowerCase()??null}function QM(e){return/^[a-z][a-z0-9+.-]*:/i.test(e)&&!e.startsWith(window.location.origin)}function e6(e){return e.trim().toLowerCase().replace(/[^\p{Letter}\p{Number}]+/gu,"-").replace(/^-+|-+$/g,"")||"section"}function b1(e){return e.trim().replace(/\s+/g," ").toLocaleLowerCase("en-US")}function t6(e){return`
|
|
130
|
+
<article class="document">
|
|
131
|
+
<header class="document-header">
|
|
132
|
+
<p class="eyebrow">MANIFEST · DRYDOCK</p>
|
|
133
|
+
<h1>Conflicts</h1>
|
|
134
|
+
</header>
|
|
135
|
+
${e.length>0?`
|
|
136
|
+
<ul class="conflict-list">
|
|
137
|
+
${e.map(n=>`
|
|
138
|
+
<li>
|
|
139
|
+
<a class="conflict-list-item" href="${WR(n.id)}">
|
|
140
|
+
<span class="conflict-list-copy">
|
|
141
|
+
<strong>${Ee(n.title)}</strong>
|
|
142
|
+
<small>${Ee(n.id)}</small>
|
|
143
|
+
</span>
|
|
144
|
+
<span class="chip ${n.status==="open"?"chip-coral":"chip"}">${Ee(n.status)}</span>
|
|
145
|
+
</a>
|
|
146
|
+
</li>
|
|
147
|
+
`).join("")}
|
|
148
|
+
</ul>
|
|
149
|
+
`:'<p class="empty-state">No conflicts to display.</p>'}
|
|
150
|
+
</article>
|
|
151
|
+
`}function n6(e){const n=[qf("Current",e.current),qf("Proposed",e.proposed),qf("Raw Source",e.rawSource)].filter(Boolean).join("");return`
|
|
152
|
+
<article class="document">
|
|
153
|
+
<header class="document-header">
|
|
154
|
+
<p class="eyebrow">MANIFEST · DRYDOCK</p>
|
|
155
|
+
<h1>${Ee(e.id)}</h1>
|
|
156
|
+
<div class="meta-chips">
|
|
157
|
+
<span class="chip chip-coral">${Ee(String(e.meta.status??"unknown"))}</span>
|
|
158
|
+
</div>
|
|
159
|
+
</header>
|
|
160
|
+
<section class="conflict-meta-card">
|
|
161
|
+
<pre>${Ee(JSON.stringify(e.meta,null,2))}</pre>
|
|
162
|
+
</section>
|
|
163
|
+
${n||'<p class="empty-state">No conflicts to display.</p>'}
|
|
164
|
+
</article>
|
|
165
|
+
`}function qf(e,n){if(!n)return"";const r=fo(n);return`
|
|
166
|
+
<section class="conflict-section">
|
|
167
|
+
<h2>${Ee(e)}</h2>
|
|
168
|
+
<div class="markdown-body">${r.html}</div>
|
|
169
|
+
</section>
|
|
170
|
+
`}function i6(e){return`
|
|
171
|
+
<article class="document">
|
|
172
|
+
<header class="document-header">
|
|
173
|
+
<p class="eyebrow">MANIFEST · CODEX</p>
|
|
174
|
+
<h1>Index</h1>
|
|
175
|
+
</header>
|
|
176
|
+
<div class="markdown-body">${fo(e).html}</div>
|
|
177
|
+
</article>
|
|
178
|
+
`}function Zp(e,n){try{return new Date(e).toLocaleString(n??"en-US",{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"})}catch{return e}}function Ku(e){const n=Date.now()-new Date(e).getTime(),r=Math.floor(n/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 r6=`
|
|
179
|
+
<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">
|
|
180
|
+
<path d="M7 17 17 7M9 7h8v8" />
|
|
181
|
+
</svg>
|
|
182
|
+
`;function s6(e,n,r){if(!e)return"";const{frontmatter:a}=e,l=Zp(a.created),f=Ku(a.created),m=Zp(a.updated),c=Ku(a.updated),u=ER(e,n,r),h=a.tags.length>0?`<div class="queue-card-chips">${a.tags.map(g=>`<span class="chip chip-muted">${Ee(g)}</span>`).join("")}</div>`:'<span class="queue-dl-muted">None</span>',y=a.rawSourceRef?`<a class="manifest-link queue-raw-link" href="${Ye(mw(a.rawSourceRef))}" data-raw-ref="${Ye(a.rawSourceRef)}">
|
|
183
|
+
<span class="manifest-ref">${Ee(a.rawSourceRef)}</span>
|
|
184
|
+
<span class="manifest-arrow" aria-hidden="true">${r6}</span>
|
|
185
|
+
</a>`:'<span class="queue-dl-muted">None</span>';return`
|
|
186
|
+
<details class="manifest-card" open>
|
|
187
|
+
<summary class="manifest-summary" aria-label="Toggle document manifest">
|
|
188
|
+
<span class="manifest-summary-copy">
|
|
189
|
+
<span class="drydock-eyebrow">MANIFEST · CODEX</span>
|
|
190
|
+
<span class="manifest-subtitle">Document Manifest</span>
|
|
191
|
+
</span>
|
|
192
|
+
<span class="manifest-summary-indicator" aria-hidden="true"></span>
|
|
193
|
+
</summary>
|
|
194
|
+
<dl class="queue-dl">
|
|
195
|
+
<dt class="queue-dl-key">Created</dt>
|
|
196
|
+
<dd class="queue-dl-value queue-dl-time">
|
|
197
|
+
<time datetime="${Ye(a.created)}" title="${Ye(l)}">
|
|
198
|
+
${Ee(l)}
|
|
199
|
+
<span class="queue-dl-relative">(${Ee(f)})</span>
|
|
200
|
+
</time>
|
|
201
|
+
</dd>
|
|
202
|
+
<dt class="queue-dl-key">Updated</dt>
|
|
203
|
+
<dd class="queue-dl-value queue-dl-time">
|
|
204
|
+
<time datetime="${Ye(a.updated)}" title="${Ye(m)}">
|
|
205
|
+
${Ee(m)}
|
|
206
|
+
<span class="queue-dl-relative">(${Ee(c)})</span>
|
|
207
|
+
</time>
|
|
208
|
+
</dd>
|
|
209
|
+
<dt class="queue-dl-key">Version</dt>
|
|
210
|
+
<dd class="queue-dl-value queue-dl-mono">v${a.version}</dd>
|
|
211
|
+
<dt class="queue-dl-key">Tags</dt>
|
|
212
|
+
<dd class="queue-dl-value">${h}</dd>
|
|
213
|
+
<dt class="queue-dl-key">Source</dt>
|
|
214
|
+
<dd class="queue-dl-value">${y}</dd>
|
|
215
|
+
</dl>
|
|
216
|
+
${u?`<div class="manifest-actions">${u}</div>`:""}
|
|
217
|
+
</details>
|
|
218
|
+
`}const a6="modulepreload",o6=function(e){return"/console/"+e},y1={},l6=function(n,r,a){let l=Promise.resolve();if(r&&r.length>0){let u=function(h){return Promise.all(h.map(y=>Promise.resolve(y).then(g=>({status:"fulfilled",value:g}),g=>({status:"rejected",reason:g}))))};document.getElementsByTagName("link");const m=document.querySelector("meta[property=csp-nonce]"),c=m?.nonce||m?.getAttribute("nonce");l=u(r.map(h=>{if(h=o6(h),h in y1)return;y1[h]=!0;const y=h.endsWith(".css"),g=y?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${h}"]${g}`))return;const C=document.createElement("link");if(C.rel=y?"stylesheet":a6,y||(C.as="script"),C.crossOrigin="",C.href=h,c&&C.setAttribute("nonce",c),document.head.appendChild(C),y)return new Promise((E,A)=>{C.addEventListener("load",E),C.addEventListener("error",()=>A(new Error(`Unable to preload CSS for ${h}`)))})}))}function f(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"&&f(c.reason);return n().catch(f)})},c6=".diagram-block[data-mermaid-source]:not([data-diagram-state='rendered']):not([data-diagram-state='error'])",u6=["a[href]","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])","[tabindex]:not([tabindex='-1'])"].join(","),h6=/^on/i,d6={USE_PROFILES:{svg:!0,svgFilters:!1},FORBID_TAGS:["foreignObject","script"],FORBID_ATTR:["href","xlink:href"]},S1="diagramInteractionBound",f6=/^oklch\s*\(\s*([^)]+)\s*\)$/i,p6=/^(-?\d+(?:\.\d+)?)(deg)?$/i,Ai=[25,50,75,100,125,150,200],g6=["pie1","pie2","pie3","pie4","pie5","pie6","pie7","pie8","pie9","pie10","pie11","pie12"];let Wf=null,w1=!1,m6=0,_6=0,Bl=null;function _s(e){const n=e.trim();if(!n)return n;const r=P6(n);return r?H6(r):n}function v6(e){if(w1)return;w1=!0,C1(e);const n=e instanceof Node?e:document.body;new MutationObserver(a=>{let l=!1;for(const f of a)if(f.type==="childList"){Bl&&!Bl.trigger.isConnected&&Cl(!1);for(const m of f.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&&C1(e)}).observe(n,{childList:!0,subtree:!0})}function C1(e){const n=e.querySelectorAll(c6);for(const r of n)r.dataset.diagramHydrating!=="true"&&(r.dataset.diagramHydrating="true",r.dataset.diagramState="pending",b6(r))}async function b6(e){const n=e.getAttribute("data-mermaid-source")??"";let r="";try{r=UM(n)}catch{Gf(e,"Invalid diagram source");return}if(!r.trim()){Gf(e,"Empty diagram source");return}try{const a=await S6(),l=`mermaid-diagram-${++m6}`,{svg:f}=await a.render(l,r);e.innerHTML=y6(f),x6(e,f),E6(e),T6(e),e.dataset.diagramState="rendered"}catch(a){const l=a instanceof Error?a.message:String(a);Gf(e,l)}}function Gf(e,n){e.dataset.diagramState="error",e.textContent=`Diagram render failed: ${n}`}function y6(e){const n=(r,a)=>{h6.test(a.attrName)&&(a.keepAttr=!1)};Rl.addHook("uponSanitizeAttribute",n);try{return Rl.sanitize(e,d6)}finally{Rl.removeHook("uponSanitizeAttribute",n)}}async function S6(){return Wf||(Wf=(async()=>{const e=await l6(()=>import("./mermaid.core-Ddi7z3V3.js").then(r=>r.bC),[]),n=e.default??e;return n.initialize({securityLevel:"strict",htmlLabels:!1,suppressErrorRendering:!0,startOnLoad:!1,theme:"base",look:"handDrawn",themeVariables:w6(),themeCSS:C6(),flowchart:{htmlLabels:!1,useMaxWidth:!1}}),n})()),Wf}function w6(){const e=getComputedStyle(document.documentElement),n=(T,p)=>{const v=e.getPropertyValue(T).trim();return _s(v||p)},r=(T,p)=>e.getPropertyValue(T).trim()||p,a=n("--brass","#c69a4a"),l=n("--brass-bright","#e6b86a"),f=n("--brass-deep","#a0782a"),m=n("--aurora","#8bd7e6"),c=n("--aurora-deep","#1f8aa8"),u=n("--coral","#ef7c63"),h=n("--ink-deep","#1d2734"),y=n("--ink-fog","#a6afbb"),g=n("--ink-pearl","#e6e9ef"),C=n("--ink-spectral","#bcc4d0"),E=[l,a,m,u,_s("oklch(70% 0.11 68)"),c,_s("oklch(76% 0.09 205)"),f,_s("oklch(68% 0.14 30)"),y,_s("oklch(62% 0.08 228)"),_s("oklch(52% 0.05 248)")],A=Object.fromEntries(g6.map((T,p)=>[T,E[p]??h]));return{background:"transparent",primaryColor:"transparent",primaryTextColor:g,primaryBorderColor:a,secondaryColor:"transparent",secondaryTextColor:g,secondaryBorderColor:l,tertiaryColor:"transparent",tertiaryTextColor:C,tertiaryBorderColor:a,lineColor:c,edgeLabelBackground:"transparent",titleColor:l,fontFamily:"JetBrains Mono Variable, ui-monospace, monospace",mainBkg:"transparent",nodeBorder:a,clusterBkg:"transparent",clusterBorder:a,pieTitleTextColor:l,pieTitleTextSize:r("--font-size-title-lg","19px"),pieSectionTextColor:g,pieSectionTextSize:r("--font-size-md","13px"),pieLegendTextColor:g,pieLegendTextSize:r("--font-size-lg","14px"),pieStrokeColor:f,pieStrokeWidth:"1.35px",pieOuterStrokeColor:l,pieOuterStrokeWidth:"2.5px",pieOpacity:"0.96",...A}}function C6(){const e=getComputedStyle(document.documentElement),n=(h,y)=>{const g=e.getPropertyValue(h).trim();return _s(g||y)},r=n("--brass-deep","#a0782a"),a=n("--brass-bright","#e6b86a"),l=n("--aurora-deep","#1f8aa8"),f=n("--ink-abyss","#131920"),m=_s("oklch(15% 0.04 250 / 34%)"),c=n("--surface-glass","#1d2734"),u=n("--ink-pearl","#e6e9ef");return`
|
|
219
|
+
.node rect, .node polygon, .node circle, .node ellipse, .actor, .classGroup rect {
|
|
220
|
+
stroke: ${r};
|
|
221
|
+
fill: ${c};
|
|
222
|
+
}
|
|
223
|
+
.edgePath path, .messageLine0, .messageLine1, .relation {
|
|
224
|
+
stroke: ${l};
|
|
225
|
+
}
|
|
226
|
+
.nodeLabel, .edgeLabel, .actor text, .messageText {
|
|
227
|
+
fill: ${u};
|
|
228
|
+
font-family: "Manrope Variable", "Manrope", ui-sans-serif, sans-serif;
|
|
229
|
+
}
|
|
230
|
+
.pieCircle {
|
|
231
|
+
stroke: ${r};
|
|
232
|
+
stroke-width: 1.35px;
|
|
233
|
+
opacity: 0.96;
|
|
234
|
+
filter: drop-shadow(0 0 1.5px ${m});
|
|
235
|
+
}
|
|
236
|
+
.pieOuterCircle {
|
|
237
|
+
stroke: ${a};
|
|
238
|
+
opacity: 0.7;
|
|
239
|
+
}
|
|
240
|
+
.slice, .legend text, .pieTitleText {
|
|
241
|
+
fill: ${u};
|
|
242
|
+
paint-order: stroke;
|
|
243
|
+
stroke: ${f};
|
|
244
|
+
stroke-width: 3px;
|
|
245
|
+
stroke-linejoin: round;
|
|
246
|
+
font-family: "Manrope Variable", "Manrope", ui-sans-serif, sans-serif;
|
|
247
|
+
}
|
|
248
|
+
.slice {
|
|
249
|
+
font-weight: 600;
|
|
250
|
+
letter-spacing: 0.04em;
|
|
251
|
+
font-style: italic;
|
|
252
|
+
}
|
|
253
|
+
.pieTitleText {
|
|
254
|
+
font-weight: 600;
|
|
255
|
+
letter-spacing: 0.12em;
|
|
256
|
+
font-style: italic;
|
|
257
|
+
}
|
|
258
|
+
.legend text {
|
|
259
|
+
font-weight: 500;
|
|
260
|
+
letter-spacing: 0.03em;
|
|
261
|
+
}
|
|
262
|
+
.legend rect {
|
|
263
|
+
rx: 999px;
|
|
264
|
+
ry: 999px;
|
|
265
|
+
opacity: 0.9;
|
|
266
|
+
stroke: ${f};
|
|
267
|
+
stroke-width: 1.5px;
|
|
268
|
+
paint-order: stroke;
|
|
269
|
+
filter: saturate(0.78) brightness(0.92) drop-shadow(0 0 0.55px ${a});
|
|
270
|
+
}
|
|
271
|
+
`}function x6(e,n){const r=new DOMParser().parseFromString(n,"image/svg+xml"),a=Array.from(r.querySelectorAll("a")),l=Array.from(e.querySelectorAll("a")),f=Math.min(a.length,l.length);for(let m=0;m<f;m++){const c=a[m],u=l[m];if(!c||!u)continue;const h=c.getAttribute("href")??c.getAttribute("xlink:href")??"",y=iC(h);y&&u.setAttribute("href",y)}}function E6(e){const n=e.querySelector("svg");if(!n)return;let r;try{r=n.getBBox()}catch{return}const{x:a,y:l,width:f,height:m}=r;!Number.isFinite(a)||!Number.isFinite(l)||!Number.isFinite(f)||!Number.isFinite(m)||a<0||l<0||f<=0||m<=0||n.setAttribute("viewBox",`${Va(a)} ${Va(l)} ${Va(f)} ${Va(m)}`)}function T6(e){e.tabIndex=0,e.setAttribute("aria-label","Open diagram in expanded view"),j6(e),e.dataset[S1]!=="true"&&(e.dataset[S1]="true",e.addEventListener("click",A6),e.addEventListener("keydown",k6))}function A6(e){if(e.metaKey||e.ctrlKey||e.shiftKey||e.altKey||e.button!==0||Vu(e.target))return;const n=e.currentTarget;n instanceof HTMLElement&&(e.preventDefault(),nC(n))}function k6(e){if(e.key!=="Enter"&&e.key!==" "||Vu(e.target))return;const n=e.currentTarget;n instanceof HTMLElement&&(e.preventDefault(),nC(n))}function nC(e){const n=e.querySelector("svg");if(!n)return;Cl(!1);const r=typeof HTMLDialogElement<"u"&&typeof HTMLDialogElement.prototype.showModal=="function",a=document.createElement(r?"dialog":"div"),l=++_6,f=`diagram-lightbox-title-${l}`;a.className="diagram-lightbox",a.setAttribute("aria-labelledby",f),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=f,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 y=document.createElement("div");y.className="diagram-lightbox__controls",y.setAttribute("aria-label","Diagram zoom controls");const g=du("−","Zoom out","out"),C=document.createElement("span");C.className="diagram-lightbox__zoom-readout",C.setAttribute("aria-live","polite");const E=du("+","Zoom in","in"),A=du("Fit","Fit diagram to viewport","fit"),T=du("Reset","Reset diagram zoom","reset");y.append(g,C,E,A,T);const p=document.createElement("div");p.className="diagram-lightbox__viewport";const v=M6(n),d=n.cloneNode(!0);d.removeAttribute("style"),O6(d,`diagram-lightbox-svg-${l}`),p.append(d),c.append(u,y,h),m.append(c,p),a.append(m),document.body.append(a);const b=new R6(p,d,C,v);g.addEventListener("click",()=>b.zoomOut()),E.addEventListener("click",()=>b.zoomIn()),A.addEventListener("click",()=>b.fit()),T.addEventListener("click",()=>b.reset());const x=N6(a),L=k=>{(k.target===a||k.target===h)&&Cl(!0)},R=k=>{if(k.key==="Escape"){k.preventDefault(),Cl(!0);return}b.handleKeyboard(k)||k.key==="Tab"&&I6(k,a)},M={dialog:a,trigger:e,inertStates:x,onClick:L,onKeyDown:R,cleanupPanZoom:()=>b.destroy()};r&&(M.onCancel=k=>{k.preventDefault(),Cl(!0)},a.addEventListener("cancel",M.onCancel),a.showModal()),a.addEventListener("click",L),document.addEventListener("keydown",R,!0),Bl=M,b.fit(),h.focus()}function du(e,n,r){const a=document.createElement("button");return a.className="diagram-lightbox__zoom-button",a.type="button",a.dataset.zoomAction=r,a.setAttribute("aria-label",n),a.textContent=e,a}class R6{constructor(n,r,a,l){this.viewport=n,this.svg=r,this.readout=a,this.baseSize=l,this.applyZoom(this.zoomIndex),n.addEventListener("pointerdown",this.onPointerDown),n.addEventListener("pointermove",this.onPointerMove),n.addEventListener("pointerup",this.onPointerEnd),n.addEventListener("pointercancel",this.onPointerEnd),n.addEventListener("wheel",this.onWheel,{passive:!1}),n.addEventListener("dblclick",this.onDoubleClick),window.addEventListener("resize",this.onResize)}viewport;svg;readout;baseSize;zoomIndex=Ai.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,Ai.length-1))}zoomOut(){this.zoomAroundViewportCenter(Math.max(this.zoomIndex-1,0))}reset(){this.zoomAroundViewportCenter(Ai.indexOf(100))}fit(){const n=this.viewport.clientWidth||this.viewport.getBoundingClientRect().width||this.baseSize.width,r=this.viewport.clientHeight||this.viewport.getBoundingClientRect().height||this.baseSize.height,a=Math.min(n/this.baseSize.width,r/this.baseSize.height),l=Math.floor(a*100),f=Ai.findIndex(c=>c>l),m=f===-1?Ai.length-1:Math.max(0,f-1);this.applyZoom(m),this.viewport.scrollLeft=Math.max(0,(this.svgWidth-n)/2),this.viewport.scrollTop=Math.max(0,(this.svgHeight-r)/2)}handleKeyboard(n){return n.key==="+"||n.key==="="?(n.preventDefault(),this.zoomIn(),!0):n.key==="-"||n.key==="_"?(n.preventDefault(),this.zoomOut(),!0):n.key==="0"?(n.preventDefault(),this.reset(),!0):n.key.toLowerCase()==="f"?(n.preventDefault(),this.fit(),!0):!1}get svgWidth(){return this.baseSize.width*(fu(this.zoomIndex)/100)}get svgHeight(){return this.baseSize.height*(fu(this.zoomIndex)/100)}applyZoom(n){this.zoomIndex=n;const r=fu(this.zoomIndex),a=r/100;this.svg.setAttribute("width",Va(this.baseSize.width*a)),this.svg.setAttribute("height",Va(this.baseSize.height*a)),this.readout.textContent=`${r}%`}zoomAroundViewportCenter(n){const r=this.viewport.getBoundingClientRect();this.zoomAroundPoint(n,r.left+r.width/2,r.top+r.height/2)}zoomAroundPoint(n,r,a){if(n===this.zoomIndex)return;const l=this.svgWidth,f=this.svgHeight,m=this.viewport.getBoundingClientRect(),c=this.viewport.scrollLeft+r-m.left,u=this.viewport.scrollTop+a-m.top;this.applyZoom(n),this.viewport.scrollLeft=c/l*this.svgWidth-(r-m.left),this.viewport.scrollTop=u/f*this.svgHeight-(a-m.top)}onPointerDown=n=>{if(n.button!==0||Vu(n.target))return;const r=n.pointerId??1;if(this.pointers.set(r,n),this.pointers.size===2){this.pinchStart={distance:this.pointerDistance(),zoomIndex:this.zoomIndex};return}this.dragStart={x:n.clientX,y:n.clientY,scrollLeft:this.viewport.scrollLeft,scrollTop:this.viewport.scrollTop,pointerId:r},this.viewport.setPointerCapture?.(r)};onPointerMove=n=>{const r=n.pointerId??1;if(this.pointers.has(r)&&this.pointers.set(r,n),this.pinchStart&&this.pointers.size>=2){const a=this.pointerDistance()/this.pinchStart.distance,l=fu(this.pinchStart.zoomIndex)*a;this.applyZoom(D6(l));return}!this.dragStart||this.dragStart.pointerId!==r||(n.preventDefault(),this.viewport.scrollLeft=this.dragStart.scrollLeft-(n.clientX-this.dragStart.x),this.viewport.scrollTop=this.dragStart.scrollTop-(n.clientY-this.dragStart.y))};onPointerEnd=n=>{const r=n.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=n=>{if(!n.ctrlKey&&!n.metaKey)return;n.preventDefault();const r=n.deltaY<0?Math.min(this.zoomIndex+1,Ai.length-1):Math.max(this.zoomIndex-1,0);this.zoomAroundPoint(r,n.clientX,n.clientY)};onDoubleClick=n=>{Vu(n.target)||(n.preventDefault(),this.zoomAroundPoint(this.zoomIndex===Ai.indexOf(200)?Ai.indexOf(100):Ai.indexOf(200),n.clientX,n.clientY))};onResize=()=>{this.fit()};pointerDistance(){const[n,r]=Array.from(this.pointers.values());return!n||!r?1:Math.hypot(r.clientX-n.clientX,r.clientY-n.clientY)}}function L6(e){const n=x1(e.getAttribute("width")),r=x1(e.getAttribute("height"));if(n&&r)return{width:n,height:r};const a=e.getAttribute("viewBox")?.trim().split(/[\s,]+/).map(Number)??[],l=a[2],f=a[3],m=l!==void 0&&Number.isFinite(l)&&l>0?l:null,c=f!==void 0&&Number.isFinite(f)&&f>0?f:null;return{width:n??m??800,height:r??c??600}}function M6(e){const n=e.getBoundingClientRect();return n.width>0&&n.height>0?{width:n.width,height:n.height}:L6(e)}function x1(e){if(!e)return null;const n=/^(\d+(?:\.\d+)?)/.exec(e.trim());if(!n)return null;const r=Number(n[1]);return Number.isFinite(r)&&r>0?r:null}function Va(e){return Number.isInteger(e)?String(e):e.toFixed(2).replace(/\.?0+$/,"")}function D6(e){let n=0,r=Number.POSITIVE_INFINITY;return Ai.forEach((a,l)=>{const f=Math.abs(a-e);f<r&&(r=f,n=l)}),n}function fu(e){return Ai[e]??Ai[0]}function O6(e,n){const r=e.getAttribute("id")??"";e.setAttribute("id",n);const a=e.querySelector("style");!r||!a?.textContent||(a.textContent=a.textContent.split(`#${r}`).join(`#${n}`))}function Cl(e){const n=Bl;n&&(n.dialog.removeEventListener("click",n.onClick),document.removeEventListener("keydown",n.onKeyDown,!0),n.onCancel&&n.dialog.removeEventListener("cancel",n.onCancel),n.cleanupPanZoom(),B6(n.inertStates),n.dialog instanceof HTMLDialogElement&&n.dialog.open&&typeof n.dialog.close=="function"&&n.dialog.close(),n.dialog.remove(),Bl=null,e&&n.trigger.isConnected&&n.trigger.focus())}function N6(e){const n=[];for(const r of Array.from(document.body.children))!(r instanceof HTMLElement)||r===e||(n.push({element:r,ariaHidden:r.getAttribute("aria-hidden"),inert:r.inert}),r.inert=!0,r.setAttribute("aria-hidden","true"));return n}function B6(e){for(const n of e)n.element.inert=n.inert,n.ariaHidden===null?n.element.removeAttribute("aria-hidden"):n.element.setAttribute("aria-hidden",n.ariaHidden)}function I6(e,n){const r=Array.from(n.querySelectorAll(u6)).filter($6);if(r.length===0){e.preventDefault(),n.focus();return}const a=r[0],l=r[r.length-1];!a||!l||(e.shiftKey&&document.activeElement===a?(e.preventDefault(),l.focus()):!e.shiftKey&&document.activeElement===l&&(e.preventDefault(),a.focus()))}function j6(e){e.querySelector("a[href]")?e.removeAttribute("role"):e.setAttribute("role","button")}function Vu(e){if(!(e instanceof Element))return!1;const n=e.closest("a[href]");return!n||!(n.getAttribute("href")?.trim()??"")?!1:!z6(n)}function z6(e){return Array.from(e.children).some(n=>n.tagName.toLowerCase()==="svg")}function $6(e){return!(e.inert||e.hidden||e.getAttribute("aria-hidden")==="true"||"disabled"in e&&e.disabled)}function iC(e){const n=e.trim();if(!n||n.includes(".."))return null;if(/^[a-z][a-z0-9+.-]*:/i.test(n)){if(/^javascript:/i.test(n)||/^data:/i.test(n))return null;let a;try{a=new URL(n)}catch{return null}return a.origin!==window.location.origin?null:iC(a.pathname)}if(/^\/entry\/[^/?#]+$/.exec(n)){const a=n.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(n)?`/entry/${encodeURIComponent(n)}`:null}function P6(e){const n=f6.exec(e);if(!n)return null;const r=n[1]?.trim();if(!r)return null;const a=r.indexOf("/"),l=a>=0?r.slice(0,a):r,f=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 y=Kf(c,1),g=Kf(u,.4),C=U6(h);if(y===null||g===null||C===null)return null;let E=1;if(a>=0){const A=Kf(f,1);if(A===null)return null;E=A}return{L:y,C:g,h:C,alpha:E}}function H6(e){const n=e.h*Math.PI/180,r=e.C*Math.cos(n),a=e.C*Math.sin(n),l=e.L,f=l+.3963377774*r+.2158037573*a,m=l-.1055613458*r-.0638541728*a,c=l-.0894841775*r-1.291485548*a,u=f**3,h=m**3,y=c**3,g=4.0767416621*u-3.3077115913*h+.2309699292*y,C=-1.2684380046*u+2.6097574011*h-.3413193965*y,E=-.0041960863*u-.7034186147*h+1.707614701*y,A=pu(Vf(g)),T=pu(Vf(C)),p=pu(Vf(E));if(e.alpha<1){const v=pu(e.alpha);return`#${Us(A)}${Us(T)}${Us(p)}${Us(v)}`}return`#${Us(A)}${Us(T)}${Us(p)}`}function Kf(e,n){if(!e)return null;if(e.endsWith("%")){const a=Number(e.slice(0,-1));return Number.isFinite(a)?a/100*n:null}const r=Number(e);return Number.isFinite(r)?r:null}function U6(e){const n=p6.exec(e);if(!n)return null;const r=Number(n[1]);return Number.isFinite(r)?r:null}function Vf(e){const n=Math.max(0,Math.min(1,e));return n>.0031308?1.055*Math.pow(n,1/2.4)-.055:12.92*n}function pu(e){return Math.round(Math.max(0,Math.min(1,e))*255)}function Us(e){return e.toString(16).padStart(2,"0")}function F6(e,n){const r=q6(e,n);return`
|
|
272
|
+
<nav class="breadcrumb" aria-label="Entry location">
|
|
273
|
+
<ol>
|
|
274
|
+
${r.map((a,l)=>`
|
|
275
|
+
<li>
|
|
276
|
+
${a.href?`<a href="${Ye(a.href)}">${Ee(a.label)}</a>`:`<span aria-current="${l===r.length-1?"page":"false"}">${Ee(a.label)}</span>`}
|
|
277
|
+
</li>
|
|
278
|
+
`).join("")}
|
|
279
|
+
</ol>
|
|
280
|
+
</nav>
|
|
281
|
+
`}function q6(e,n){const r=n.find(f=>f.id===e.frontmatter.id),a=e.frontmatter.tags[0]??r?.tags[0]??null,l=[{label:"Codex",href:Ug()},{label:"Index",href:_w()}];return a&&l.push({label:a}),l.push({label:e.frontmatter.title}),l}function W6(e){const n=e.tags.map(a=>`<span class="chip chip-tag">${Ee(a)}</span>`).join(""),r=K6(e);return`
|
|
282
|
+
<div class="meta-chips">
|
|
283
|
+
${n}
|
|
284
|
+
${r}
|
|
285
|
+
<span class="chip">Updated ${Ee(G6(e.updated))}</span>
|
|
286
|
+
</div>
|
|
287
|
+
`}function rC(e){return e.map(n=>`<span class="chip chip-muted">${Ee(n)}</span>`).join("")}function G6(e){const n=new Date(e);return Number.isNaN(n.getTime())?e:n.toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"})}function K6(e){const n=V6(e);return n?`<span class="chip ${n.tone==="deprecated"?"chip-coral":n.tone==="stale"?"chip-stale":""}" title="${Ye(n.title)}">${Ee(n.label)}</span>`:""}function V6(e,n=new Date){const r=e.status,a=typeof e.revalidateAfter=="string"&&!Number.isNaN(Date.parse(e.revalidateAfter))&&Date.parse(e.revalidateAfter)<n.getTime();return r==="deprecated"||r==="superseded"?{label:r,tone:"deprecated",title:a?`${r} · stale`:r}:a?{label:"stale",tone:"stale",title:e.revalidateAfter??"stale"}:r==="current"||r==="draft"?{label:r,tone:"neutral",title:r}:null}function Y6(e,n,r){const a=X6(e,n,r);return a.length===0?"":`
|
|
288
|
+
<section class="related-list">
|
|
289
|
+
<h2>Related entries</h2>
|
|
290
|
+
<div class="related-items">
|
|
291
|
+
${a.map(l=>`
|
|
292
|
+
<a class="related-card" href="${$r(l.entry.id)}" data-entry-id="${Ye(l.entry.id)}">
|
|
293
|
+
<strong>${Ee(l.entry.title)}</strong>
|
|
294
|
+
<span>${rC(l.matchingTags)}</span>
|
|
295
|
+
</a>
|
|
296
|
+
`).join("")}
|
|
297
|
+
</div>
|
|
298
|
+
</section>
|
|
299
|
+
`}function X6(e,n,r){const a=new Set(n),l="en-US";return r.filter(f=>f.id!==e).map(f=>({entry:f,matchingTags:f.tags.filter(m=>a.has(m))})).filter(f=>f.matchingTags.length>0).sort((f,m)=>m.matchingTags.length-f.matchingTags.length||f.entry.title.localeCompare(m.entry.title,l,{sensitivity:"base",numeric:!0})).slice(0,5)}const Z6=`
|
|
300
|
+
<svg viewBox="0 0 24 24" width="16" height="16" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
|
|
301
|
+
<path d="M6 6 18 18M18 6 6 18" />
|
|
302
|
+
</svg>
|
|
303
|
+
`,J6=`
|
|
304
|
+
<svg viewBox="0 0 24 24" width="16" height="16" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
|
|
305
|
+
<path d="M8 6h12M8 12h12M8 18h12" />
|
|
306
|
+
<path d="M4 6h.01M4 12h.01M4 18h.01" />
|
|
307
|
+
</svg>
|
|
308
|
+
`;function Q6(e){return e.length===0?"":`
|
|
309
|
+
<button class="toc-drawer-trigger" type="button" data-action="open-toc-drawer" aria-haspopup="dialog" aria-controls="toc-drawer">
|
|
310
|
+
${J6}
|
|
311
|
+
<span>Contents</span>
|
|
312
|
+
</button>
|
|
313
|
+
`}function e4(e){return e.length===0?"":`
|
|
314
|
+
<div class="toc-drawer" id="toc-drawer" role="dialog" aria-modal="true" aria-labelledby="toc-drawer-title" hidden>
|
|
315
|
+
<button class="toc-drawer-backdrop" type="button" data-action="close-toc-drawer" aria-label="Close contents"></button>
|
|
316
|
+
<section class="toc-drawer-panel">
|
|
317
|
+
<header class="toc-drawer-header">
|
|
318
|
+
<div>
|
|
319
|
+
<p class="drydock-eyebrow">Reading Position</p>
|
|
320
|
+
<h2 id="toc-drawer-title">Contents</h2>
|
|
321
|
+
</div>
|
|
322
|
+
<button class="icon-button" type="button" data-action="close-toc-drawer" aria-label="Close contents">${Z6}</button>
|
|
323
|
+
</header>
|
|
324
|
+
<nav class="toc-drawer-nav" aria-label="Document contents">
|
|
325
|
+
${e.map(n=>`
|
|
326
|
+
<a class="toc-drawer-link toc-level-${n.level}" href="#${Ye(n.id)}" data-toc-id="${Ye(n.id)}">
|
|
327
|
+
${Ee(n.text)}
|
|
328
|
+
</a>
|
|
329
|
+
`).join("")}
|
|
330
|
+
</nav>
|
|
331
|
+
</section>
|
|
332
|
+
</div>
|
|
333
|
+
`}const t4=`
|
|
334
|
+
<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">
|
|
335
|
+
<path d="M5 12h14M13 6l6 6-6 6" />
|
|
336
|
+
</svg>
|
|
337
|
+
`;function n4(e,n,r=!0){const a=e.length,l=e.slice(0,6),f=e[0]??null;return`
|
|
338
|
+
<article class="document welcome">
|
|
339
|
+
<header class="welcome-title">
|
|
340
|
+
<p class="eyebrow">Fleet · Codex</p>
|
|
341
|
+
<h1>The <em>Codex</em></h1>
|
|
342
|
+
</header>
|
|
343
|
+
<div class="welcome-divider"></div>
|
|
344
|
+
<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>
|
|
345
|
+
${r?"":'<p class="error-box">No workspace is registered in this daemon. Re-run <code>fleet-wiki</code> in the target directory.</p>'}
|
|
346
|
+
<div class="workspace-meta">
|
|
347
|
+
<span class="chip chip-aurora">${a} entries</span>
|
|
348
|
+
${n?`<span class="workspace-path">${Ee(n)}</span>`:""}
|
|
349
|
+
</div>
|
|
350
|
+
${f?`
|
|
351
|
+
<a class="primary-link" href="${Ye($r(f.id))}" data-entry-id="${Ye(f.id)}">
|
|
352
|
+
<span>Open first entry — ${Ee(f.title)}</span>
|
|
353
|
+
${t4}
|
|
354
|
+
</a>
|
|
355
|
+
`:'<p class="empty-state">No wiki entries yet. Add entries with <code>wiki_ingest</code>.</p>'}
|
|
356
|
+
${l.length>0?`
|
|
357
|
+
<div class="welcome-grid">
|
|
358
|
+
${l.map(m=>`
|
|
359
|
+
<a class="welcome-card" href="${Ye($r(m.id))}" data-entry-id="${Ye(m.id)}">
|
|
360
|
+
<strong>${Ee(m.title)}</strong>
|
|
361
|
+
<span class="welcome-card-tags">${rC(m.tags.slice(0,3))}</span>
|
|
362
|
+
</a>
|
|
363
|
+
`).join("")}
|
|
364
|
+
</div>
|
|
365
|
+
`:""}
|
|
366
|
+
</article>
|
|
367
|
+
`}function i4(e,n){const r=fo(e.body,{omitDuplicateTitle:e.frontmatter.title});return{toc:r.toc,html:`
|
|
368
|
+
<article class="document">
|
|
369
|
+
<header class="document-header">
|
|
370
|
+
${F6(e,n)}
|
|
371
|
+
<p class="eyebrow">Current Entry</p>
|
|
372
|
+
<h1>${Ee(e.frontmatter.title)}</h1>
|
|
373
|
+
${W6(e.frontmatter)}
|
|
374
|
+
${Q6(r.toc)}
|
|
375
|
+
</header>
|
|
376
|
+
<div class="markdown-body" id="markdown-body">
|
|
377
|
+
${r.html}
|
|
378
|
+
</div>
|
|
379
|
+
${Y6(e.frontmatter.id,e.frontmatter.tags,n)}
|
|
380
|
+
${e4(r.toc)}
|
|
381
|
+
</article>
|
|
382
|
+
`}}function r4(){return`
|
|
383
|
+
<article class="document">
|
|
384
|
+
<p class="loading">Loading entry</p>
|
|
385
|
+
</article>
|
|
386
|
+
`}function s4(e){return`
|
|
387
|
+
<article class="document">
|
|
388
|
+
<p class="error-box">${Ee(e)}</p>
|
|
389
|
+
</article>
|
|
390
|
+
`}const Lu=new Set;let Dr="entries";const a4=`
|
|
391
|
+
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
|
|
392
|
+
<circle cx="11" cy="11" r="6.5" />
|
|
393
|
+
<path d="m20 20-3.5-3.5" />
|
|
394
|
+
</svg>
|
|
395
|
+
`,o4=`
|
|
396
|
+
<svg class="caret" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
|
|
397
|
+
<path d="m6 9 6 6 6-6" />
|
|
398
|
+
</svg>
|
|
399
|
+
`,l4=`
|
|
400
|
+
<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">
|
|
401
|
+
<path d="M6 6 18 18M18 6 6 18" />
|
|
402
|
+
</svg>
|
|
403
|
+
`,c4=`
|
|
404
|
+
<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">
|
|
405
|
+
<circle cx="12" cy="5" r="2" />
|
|
406
|
+
<path d="M12 7v14M8 11H4a8 8 0 0 0 16 0h-4" />
|
|
407
|
+
</svg>
|
|
408
|
+
`;function u4(e,n,r,a=[],l=null,f){const m=e.length,c=f4(e),u=m===0?'<p class="empty-state">No wiki entries yet.</p>':Dr==="tags"?p4(e,n):g4(e,n),h=Dr==="tags"?`Tags · ${c}`:`Entries · ${m}`,y=Dr==="tags"?"tag-tree":"entry-list",g=Dr==="tags"?"Entries by tag":"All entries",C=v4(f??(typeof window<"u"?window.location.pathname:"")),E=C.startsWith("/queue"),A=C==="/index",T=C==="/log",p=C.startsWith("/conflicts"),v=r>0?`<span class="nav-drydock-badge">${r}</span>`:"";return`
|
|
409
|
+
<aside class="sidebar" id="sidebar">
|
|
410
|
+
<div class="sidebar-header">
|
|
411
|
+
<div class="sidebar-header-actions">
|
|
412
|
+
<button class="icon-button mobile-close" type="button" data-action="toggle-nav" aria-label="Close">${l4}</button>
|
|
413
|
+
</div>
|
|
414
|
+
</div>
|
|
415
|
+
<button class="command-entry" type="button" data-action="open-command">
|
|
416
|
+
<span class="command-entry-label">${a4}<span>Search entries</span></span>
|
|
417
|
+
<kbd>⌘K</kbd>
|
|
418
|
+
</button>
|
|
419
|
+
<div class="nav-drydock-section">
|
|
420
|
+
<a class="nav-drydock-link${E?" active":""}" href="${Ye(ro())}">
|
|
421
|
+
<span class="nav-drydock-icon">${c4}</span>
|
|
422
|
+
<span class="nav-drydock-label">Drydock</span>
|
|
423
|
+
${v}
|
|
424
|
+
</a>
|
|
425
|
+
<a class="nav-drydock-link${A?" active":""}" href="${Ye(_w())}">
|
|
426
|
+
<span class="nav-drydock-label">Index</span>
|
|
427
|
+
</a>
|
|
428
|
+
<a class="nav-drydock-link${T?" active":""}" href="${Ye(vw())}">
|
|
429
|
+
<span class="nav-drydock-label">Log</span>
|
|
430
|
+
</a>
|
|
431
|
+
<a class="nav-drydock-link${p?" active":""}" href="${Ye(qR())}">
|
|
432
|
+
<span class="nav-drydock-label">Conflicts</span>
|
|
433
|
+
</a>
|
|
434
|
+
</div>
|
|
435
|
+
<div class="nav-tabs" role="tablist" aria-label="Navigation mode">
|
|
436
|
+
<button class="nav-tab${Dr==="entries"?" active":""}" type="button" role="tab" aria-selected="${Dr==="entries"}" data-action="set-nav-mode" data-mode="entries">
|
|
437
|
+
Entries
|
|
438
|
+
</button>
|
|
439
|
+
<button class="nav-tab${Dr==="tags"?" active":""}" type="button" role="tab" aria-selected="${Dr==="tags"}" data-action="set-nav-mode" data-mode="tags">
|
|
440
|
+
Tags
|
|
441
|
+
</button>
|
|
442
|
+
</div>
|
|
443
|
+
<p class="nav-section-label">${h}</p>
|
|
444
|
+
<nav class="${y}" aria-label="${g}">
|
|
445
|
+
${u}
|
|
446
|
+
</nav>
|
|
447
|
+
</aside>
|
|
448
|
+
`}function h4(e){if(Lu.has(e)){Lu.delete(e);return}Lu.add(e)}function d4(e){Dr=e}function f4(e){const n=new Set;for(const r of e){if(r.tags.length===0){n.add("untagged");continue}for(const a of r.tags)n.add(a)}return n.size}function p4(e,n){return m4(e).map(a=>_4(a,n)).join("")}function g4(e,n){const r="en-US";return[...e].sort((l,f)=>l.title.localeCompare(f.title,r,{sensitivity:"base",numeric:!0})).map(l=>sC(l,n)).join("")}function m4(e){const n="en-US",r=new Map;for(const a of e){const l=a.tags.length>0?a.tags:["untagged"];for(const f of l){const m=r.get(f)??[];m.push(a),r.set(f,m)}}return[...r.entries()].map(([a,l])=>({tag:a,entries:l.sort((f,m)=>f.title.localeCompare(m.title,n,{sensitivity:"base",numeric:!0}))})).sort((a,l)=>a.tag.localeCompare(l.tag,n,{sensitivity:"base",numeric:!0}))}function _4(e,n){const r=Lu.has(e.tag),a=r?"":e.entries.map(l=>sC(l,n)).join("");return`
|
|
449
|
+
<section class="tag-group" data-collapsed="${r?"true":"false"}">
|
|
450
|
+
<button class="tag-group-button" type="button" data-action="toggle-tag" data-tag="${Ye(e.tag)}">
|
|
451
|
+
${o4}
|
|
452
|
+
<span>${e.tag==="untagged"?"Untagged":Ee(e.tag)}</span>
|
|
453
|
+
<span class="count">${e.entries.length}</span>
|
|
454
|
+
</button>
|
|
455
|
+
<div class="tag-group-list">${a}</div>
|
|
456
|
+
</section>
|
|
457
|
+
`}function sC(e,n){const r=e.id===n?" active":"",a=Ye(e.title);return`
|
|
458
|
+
<a class="nav-entry${r}" href="${$r(e.id)}" data-entry-id="${Ye(e.id)}" title="${a}">
|
|
459
|
+
<span class="nav-entry-text">${Ee(e.title)}</span>
|
|
460
|
+
</a>
|
|
461
|
+
`}function v4(e){const n=e===Ui||e===`${Ui}/`?"/":e.startsWith(`${Ui}/`)?e.slice(Ui.length)||"/":e,r=n.match(/^\/w\/[^/]+(\/.*)?$/);return r?r[1]??"/":n}const b4=`
|
|
462
|
+
<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">
|
|
463
|
+
<path d="M15 18 9 12l6-6" />
|
|
464
|
+
</svg>
|
|
465
|
+
`,y4=`
|
|
466
|
+
<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">
|
|
467
|
+
<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" />
|
|
468
|
+
<path d="M9 9h6M9 13h6" />
|
|
469
|
+
</svg>
|
|
470
|
+
`;function S4(e){const n=e.ref??"";let r;return e.loading?r='<p class="loading">Loading source</p>':e.error?r=`<p class="error-box">Failed to load source — ${Ee(e.error)}</p>`:e.content?r=`<div class="markdown-body">${fo(e.content).html}</div>`:r='<p class="empty-state">Source is empty.</p>',`
|
|
471
|
+
<div class="raw-shell">
|
|
472
|
+
<header class="raw-header">
|
|
473
|
+
<a class="raw-back" href="/" data-action="navigate-home" aria-label="Back to Codex">
|
|
474
|
+
${b4}
|
|
475
|
+
<span>Codex</span>
|
|
476
|
+
</a>
|
|
477
|
+
<div class="raw-meta">
|
|
478
|
+
<span class="raw-glyph">${y4}</span>
|
|
479
|
+
<div class="raw-meta-text">
|
|
480
|
+
<p class="eyebrow">Manifest · Raw Source</p>
|
|
481
|
+
<h1 class="raw-title">${Ee(n)}</h1>
|
|
482
|
+
</div>
|
|
483
|
+
</div>
|
|
484
|
+
<div class="raw-divider"></div>
|
|
485
|
+
</header>
|
|
486
|
+
<article class="raw-document">
|
|
487
|
+
${r}
|
|
488
|
+
</article>
|
|
489
|
+
</div>
|
|
490
|
+
`}function nm(e,n){const r=e==="create_wiki"||!n,a=r?"+":"↻",l=r?"CREATE":"UPDATE";return`<span class="op-badge ${r?"op-badge--create":"op-badge--update"}" aria-label="${l}">
|
|
491
|
+
<span class="op-badge-glyph" aria-hidden="true">${a}</span>
|
|
492
|
+
<span class="op-badge-label">${l}</span>
|
|
493
|
+
</span>`}function w4(e){const{tab:n,items:r,pendingCount:a,archivedCount:l,loading:f,error:m}=e;if(f&&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 — ${Ee(m)}</p></div>`;const c=r.length===0?C4(n):r.map(y=>x4(y)).join(""),u=a>0?`<span class="queue-badge">${a}</span>`:"",h=l>0?`<span class="queue-badge queue-badge--muted">${l}</span>`:"";return`
|
|
494
|
+
<div class="queue-view">
|
|
495
|
+
<div class="queue-header">
|
|
496
|
+
<p class="drydock-eyebrow">MANIFEST · DRYDOCK</p>
|
|
497
|
+
<h1 class="queue-title">Patch Queue</h1>
|
|
498
|
+
</div>
|
|
499
|
+
<div class="queue-tabs" role="tablist" aria-label="Queue tabs">
|
|
500
|
+
<a class="queue-tab${n==="pending"?" active":""}"
|
|
501
|
+
href="${Ye(ro("pending"))}"
|
|
502
|
+
role="tab"
|
|
503
|
+
aria-selected="${n==="pending"}">
|
|
504
|
+
Pending${u}
|
|
505
|
+
</a>
|
|
506
|
+
<a class="queue-tab${n==="archived"?" active":""}"
|
|
507
|
+
href="${Ye(ro("archived"))}"
|
|
508
|
+
role="tab"
|
|
509
|
+
aria-selected="${n==="archived"}">
|
|
510
|
+
Archived${h}
|
|
511
|
+
</a>
|
|
512
|
+
</div>
|
|
513
|
+
<div class="queue-list">
|
|
514
|
+
${c}
|
|
515
|
+
</div>
|
|
516
|
+
</div>
|
|
517
|
+
`}function C4(e){return`<p class="queue-empty">${e==="pending"?"No pending patches.":"No archived patches."}</p>`}function x4(e){const{id:n,meta:r,source:a,summary:l,op:f,target:m}=e,c=E4(r.status),u=Ku(r.createdAt),h=r.warnings??[],y=h.slice(0,3).map(p=>`<span class="chip chip-muted">${Ee(p)}</span>`).join(""),g=h.length>3?`<span class="chip chip-muted">+${h.length-3}</span>`:"",C=a==="archive"?`<span class="chip">${Ee(r.status)}</span>`:"",E=f?nm(f,!0):"",A=l?`<p class="queue-card-summary">${Ee(l)}</p>`:"",T=m?`<span class="queue-card-target">${Ee(m)}</span>`:"";return`
|
|
518
|
+
<a class="queue-card" href="${Ye(FR(n))}">
|
|
519
|
+
${A}
|
|
520
|
+
<div class="queue-card-top">
|
|
521
|
+
<span class="queue-card-id">${Ee(n)}</span>
|
|
522
|
+
${c}
|
|
523
|
+
</div>
|
|
524
|
+
<div class="queue-card-meta">
|
|
525
|
+
${E}
|
|
526
|
+
${T}
|
|
527
|
+
<span class="queue-card-time">${Ee(u)}</span>
|
|
528
|
+
${C}
|
|
529
|
+
<div class="queue-card-chips">
|
|
530
|
+
${y}${g}
|
|
531
|
+
</div>
|
|
532
|
+
</div>
|
|
533
|
+
</a>
|
|
534
|
+
`}function E4(e){return`<span class="status-dot ${e==="pending"?"status-dot--pending":e==="accepted"?"status-dot--accepted":"status-dot--rejected"}" aria-label="${Ye(e)}"></span>`}const T4=`
|
|
535
|
+
<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">
|
|
536
|
+
<path d="M15 18 9 12l6-6" />
|
|
537
|
+
</svg>
|
|
538
|
+
`,A4=`
|
|
539
|
+
<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">
|
|
540
|
+
<path d="M7 17 17 7M9 7h8v8" />
|
|
541
|
+
</svg>
|
|
542
|
+
`;function k4(e){const{current:n,loading:r,error:a}=e;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 — ${Ee(a)}</p></div>`:n?R4(n,e):'<div class="queue-detail-view"><p class="empty-state">Patch not found.</p></div>'}function R4(e,n){const{patch:r,meta:a,wikiEntry:l,targetExists:f}=e,{frontmatter:m}=r,c=fo(l.body),u=nm(m.op,f),h=a.rawSourceRef;return`
|
|
543
|
+
<div class="queue-detail-view">
|
|
544
|
+
<div class="queue-detail-layout">
|
|
545
|
+
<div class="queue-detail-main">
|
|
546
|
+
<a class="raw-back queue-back" href="${Ye(ro())}" aria-label="Back to Drydock">
|
|
547
|
+
${T4}
|
|
548
|
+
<span>Drydock</span>
|
|
549
|
+
</a>
|
|
550
|
+
<div class="queue-detail-header">
|
|
551
|
+
<p class="drydock-eyebrow">MANIFEST · PATCH</p>
|
|
552
|
+
<p class="queue-patch-id">${Ee(a.id)}</p>
|
|
553
|
+
<h1 class="queue-summary">${Ee(m.summary)}</h1>
|
|
554
|
+
${u}
|
|
555
|
+
</div>
|
|
556
|
+
<article class="document">
|
|
557
|
+
<div class="markdown-body" id="markdown-body">${c.html}</div>
|
|
558
|
+
</article>
|
|
559
|
+
</div>
|
|
560
|
+
<aside class="queue-rail">
|
|
561
|
+
${L4(e,h)}
|
|
562
|
+
${O4(c.toc)}
|
|
563
|
+
${D4(e)}
|
|
564
|
+
${M4(e,n)}
|
|
565
|
+
</aside>
|
|
566
|
+
</div>
|
|
567
|
+
</div>
|
|
568
|
+
`}function L4(e,n){const{patch:r,meta:a,targetExists:l}=e,{frontmatter:f}=r,m=nm(f.op,l),c=Zp(a.createdAt),u=Ku(a.createdAt),h=N4(a.status),y=a.warnings??[],g=n?`<dd class="queue-dl-value">
|
|
569
|
+
<a class="manifest-link queue-raw-link" href="${Ye(mw(n))}" data-raw-ref="${Ye(n)}">
|
|
570
|
+
<span class="manifest-ref">${Ee(n)}</span>
|
|
571
|
+
<span class="manifest-arrow">${A4}</span>
|
|
572
|
+
</a>
|
|
573
|
+
</dd>`:'<dd class="queue-dl-value queue-dl-muted">None</dd>',C=y.length>0?`<dt class="queue-dl-key">Warnings</dt>
|
|
574
|
+
<dd class="queue-dl-value">
|
|
575
|
+
<div class="queue-card-chips">
|
|
576
|
+
${y.map(E=>`<span class="chip chip-muted">${Ee(E)}</span>`).join("")}
|
|
577
|
+
</div>
|
|
578
|
+
</dd>`:"";return`
|
|
579
|
+
<div class="queue-rail-card">
|
|
580
|
+
<div class="queue-rail-header">
|
|
581
|
+
<p class="drydock-eyebrow">MANIFEST · PATCH</p>
|
|
582
|
+
<p class="queue-rail-subtitle">Patch Manifest</p>
|
|
583
|
+
</div>
|
|
584
|
+
<dl class="queue-dl">
|
|
585
|
+
<dt class="queue-dl-key">OP</dt>
|
|
586
|
+
<dd class="queue-dl-value">${m}</dd>
|
|
587
|
+
<dt class="queue-dl-key">Target</dt>
|
|
588
|
+
<dd class="queue-dl-value queue-dl-mono">${Ee(f.target)}</dd>
|
|
589
|
+
<dt class="queue-dl-key">Proposer</dt>
|
|
590
|
+
<dd class="queue-dl-value">${Ee(f.proposer)}</dd>
|
|
591
|
+
<dt class="queue-dl-key">Created</dt>
|
|
592
|
+
<dd class="queue-dl-value queue-dl-time">
|
|
593
|
+
<time datetime="${Ye(a.createdAt)}" title="${Ye(c)}">
|
|
594
|
+
${Ee(c)}
|
|
595
|
+
<span class="queue-dl-relative">(${Ee(u)})</span>
|
|
596
|
+
</time>
|
|
597
|
+
</dd>
|
|
598
|
+
<dt class="queue-dl-key">Status</dt>
|
|
599
|
+
<dd class="queue-dl-value queue-dl-status">${h}<span>${Ee(a.status)}</span></dd>
|
|
600
|
+
<dt class="queue-dl-key">Source</dt>
|
|
601
|
+
${g}
|
|
602
|
+
${C}
|
|
603
|
+
</dl>
|
|
604
|
+
</div>
|
|
605
|
+
`}function M4(e,n){const{meta:r,source:a}=e;if(r.status!=="pending"||a!=="queue")return"";const{actionPending:l,actionError:f}=n,m=l?" disabled":"",c=Ye(r.id),u=f?`<p class="queue-action-error">${Ee(f)}</p>`:"";return`
|
|
606
|
+
<div class="queue-rail-card queue-actions-card">
|
|
607
|
+
<div class="queue-rail-header">
|
|
608
|
+
<p class="drydock-eyebrow">ACTIONS</p>
|
|
609
|
+
<p class="queue-rail-subtitle">Decision</p>
|
|
610
|
+
</div>
|
|
611
|
+
${l?'<span class="queue-action-spinner" aria-label="Processing"></span>':""}
|
|
612
|
+
<div class="queue-action-buttons">
|
|
613
|
+
<button class="queue-action-btn queue-action-btn--approve" type="button"
|
|
614
|
+
data-action="queue-approve" data-patch-id="${c}"${m}
|
|
615
|
+
aria-label="Approve this patch">
|
|
616
|
+
<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>
|
|
617
|
+
Approve
|
|
618
|
+
</button>
|
|
619
|
+
<button class="queue-action-btn queue-action-btn--reject" type="button"
|
|
620
|
+
data-action="queue-reject-toggle"${m}
|
|
621
|
+
aria-label="Reject this patch">
|
|
622
|
+
<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>
|
|
623
|
+
Reject
|
|
624
|
+
</button>
|
|
625
|
+
</div>
|
|
626
|
+
<form class="queue-reject-form" hidden data-action="queue-reject-submit" data-patch-id="${c}">
|
|
627
|
+
<textarea class="queue-reject-textarea" name="reason" minlength="1" maxlength="256" required placeholder="Enter rejection reason (max 256 chars)"></textarea>
|
|
628
|
+
<div class="queue-action-buttons">
|
|
629
|
+
<button class="queue-action-btn queue-action-btn--reject-submit" type="submit"${m}>Confirm</button>
|
|
630
|
+
<button class="queue-action-btn queue-action-btn--cancel" type="button" data-action="queue-reject-cancel"${m}>Cancel</button>
|
|
631
|
+
</div>
|
|
632
|
+
</form>
|
|
633
|
+
${u}
|
|
634
|
+
</div>
|
|
635
|
+
`}function D4(e){const n=e.patchSet;return!n||n.members.length===0?"":`
|
|
636
|
+
<div class="queue-rail-card">
|
|
637
|
+
<div class="queue-rail-header">
|
|
638
|
+
<p class="drydock-eyebrow">MANIFEST · DRYDOCK</p>
|
|
639
|
+
<p class="queue-rail-subtitle">Patch Set</p>
|
|
640
|
+
</div>
|
|
641
|
+
<p class="queue-patch-id">${Ee(n.id)}</p>
|
|
642
|
+
<ul class="patch-set-list">
|
|
643
|
+
${n.members.map(r=>`
|
|
644
|
+
<li class="patch-set-item">
|
|
645
|
+
<span class="patch-set-item-copy">
|
|
646
|
+
<strong>${Ee(r.summary??r.id)}</strong>
|
|
647
|
+
<small>${Ee(r.target??r.id)}</small>
|
|
648
|
+
</span>
|
|
649
|
+
<span class="chip ${r.status==="rejected"?"chip-coral":""}">${Ee(r.status??r.source)}</span>
|
|
650
|
+
</li>
|
|
651
|
+
`).join("")}
|
|
652
|
+
</ul>
|
|
653
|
+
</div>
|
|
654
|
+
`}function O4(e){return e.length===0?"":`
|
|
655
|
+
<div class="queue-rail-card queue-toc-card">
|
|
656
|
+
<div class="queue-rail-header">
|
|
657
|
+
<p class="drydock-eyebrow">CONTENTS</p>
|
|
658
|
+
</div>
|
|
659
|
+
<nav class="queue-toc-nav" aria-label="Table of contents">
|
|
660
|
+
${e.map(r=>`<a class="queue-toc-link queue-toc-level-${r.level}" href="#${Ye(r.id)}">${Ee(r.text)}</a>`).join("")}
|
|
661
|
+
</nav>
|
|
662
|
+
</div>
|
|
663
|
+
`}function N4(e){return`<span class="status-dot ${e==="pending"?"status-dot--pending":e==="accepted"?"status-dot--accepted":"status-dot--rejected"}" aria-label="${Ye(e)}"></span>`}const B4="active",I4=".toc-panel a[data-toc-id], .toc-drawer-link[data-toc-id]";function j4(e){return e.length===0?"":`
|
|
664
|
+
<nav class="toc-panel" aria-label="Table of contents">
|
|
665
|
+
<h2>Contents</h2>
|
|
666
|
+
${e.map(n=>`
|
|
667
|
+
<a class="toc-level-${n.level}" href="#${Ye(n.id)}" data-toc-id="${Ye(n.id)}">
|
|
668
|
+
${Ee(n.text)}
|
|
669
|
+
</a>
|
|
670
|
+
`).join("")}
|
|
671
|
+
</nav>
|
|
672
|
+
`}function z4(e,n){if(n.length===0||typeof IntersectionObserver>"u")return()=>{};const r=[...e.querySelectorAll(I4)],a=new Set(n.map(u=>u.id)),l=[...e.querySelectorAll("#markdown-body h2[id], #markdown-body h3[id]")].filter(u=>a.has(u.id));if(r.length===0||l.length===0)return()=>{};const f=e instanceof HTMLElement?e.closest(".codex-host"):null,m=new Set,c=new IntersectionObserver(u=>{for(const y of u){const g=y.target instanceof HTMLElement?y.target.id:"";g&&(y.isIntersecting?m.add(g):m.delete(g))}const h=$4(l,m)??P4(l,f)??l[0]?.id??null;E1(r,h)},{root:f,rootMargin:"-20% 0px -65% 0px",threshold:[0,.2,.6,1]});for(const u of l)c.observe(u);return E1(r,l[0]?.id??null),()=>c.disconnect()}function $4(e,n){for(const r of e)if(n.has(r.id))return r.id;return null}function P4(e,n){const r=n?n.getBoundingClientRect().top:0;let a=null;for(const l of e)if(l.getBoundingClientRect().top-r<=80)a=l.id;else break;return a}function E1(e,n){for(const r of e){const a=!!(n&&r.dataset.tocId===n);r.classList.toggle(B4,a),a?r.setAttribute("aria-current","location"):r.removeAttribute("aria-current")}}function H4(e){const n=e.entries.join(`
|
|
673
|
+
|
|
674
|
+
`),r=fo(n);return`
|
|
675
|
+
<article class="document">
|
|
676
|
+
<header class="document-header">
|
|
677
|
+
<p class="eyebrow">MANIFEST · DRYDOCK</p>
|
|
678
|
+
<h1>Log</h1>
|
|
679
|
+
<div class="log-controls">
|
|
680
|
+
${[10,20,50,100].map(l=>`
|
|
681
|
+
<a class="chip ${l===e.limit?"chip-tag":""}" href="${vw(l)}">${l}</a>
|
|
682
|
+
`).join("")}
|
|
683
|
+
</div>
|
|
684
|
+
</header>
|
|
685
|
+
<p class="empty-state">${`Latest ${e.limit} of ${e.totalEntries} entries`}</p>
|
|
686
|
+
<div class="markdown-body">${r.html}</div>
|
|
687
|
+
</article>
|
|
688
|
+
`}const Jp=new Set,ia={tab:"pending",items:[],pendingCount:0,archivedCount:0,current:null,loading:!1,error:null,actionPending:!1,actionError:null};function Yu(){return ia}function U4(e){return Jp.add(e),()=>Jp.delete(e)}async function F4(e){Qn({tab:e,loading:!0,error:null,current:null});try{const n=await ch(e);Qn({items:n.items,pendingCount:n.pendingCount,archivedCount:n.archivedCount,loading:!1}),qg(n.pendingCount)}catch(n){Qn({loading:!1,error:dh(n)})}}async function q4(e){Qn({loading:!0,error:null,current:null});try{const n=await OR(e);Qn({current:n,loading:!1})}catch(n){Qn({loading:!1,error:dh(n)})}}function Fs(){Qn({items:[],current:null,error:null,loading:!1,actionPending:!1,actionError:null})}async function W4(){if(ia.actionPending)return;const e=ia.current?.meta.id;if(e){Qn({actionPending:!0,actionError:null});try{await NR(e);const n=await ch("pending");Qn({actionPending:!1,pendingCount:n.pendingCount,archivedCount:n.archivedCount}),qg(n.pendingCount),ea(ro("archived"))}catch(n){Qn({actionPending:!1,actionError:dh(n)})}}}async function G4(e){if(ia.actionPending)return;const n=ia.current?.meta.id;if(!n)return;const r=e.trim();if(!r||r.length>256){Qn({actionError:r?"Rejection reason must be 256 characters or less.":"Please enter a rejection reason."});return}Qn({actionPending:!0,actionError:null});try{await BR(n,r);const a=await ch("pending");Qn({actionPending:!1,pendingCount:a.pendingCount,archivedCount:a.archivedCount}),qg(a.pendingCount),ea(ro("archived"))}catch(a){Qn({actionPending:!1,actionError:dh(a)})}}function Qn(e){Object.assign(ia,e);for(const n of Jp)n(ia)}function dh(e){return e instanceof Error?e.message:String(e)}const Qp=new Set,vs={ref:null,content:null,loading:!1,error:null};function K4(){return vs}function V4(e){return Qp.add(e),()=>Qp.delete(e)}async function Y4(e){if(!(vs.ref===e&&vs.content!==null&&!vs.error)){Mu({ref:e,content:null,loading:!0,error:null});try{const n=await DR(e);if(vs.ref!==e)return;Mu({content:n,loading:!1})}catch(n){if(vs.ref!==e)return;Mu({loading:!1,error:X4(n)})}}}function ds(){Mu({ref:null,content:null,loading:!1,error:null})}function Mu(e){Object.assign(vs,e);for(const n of Qp)n(vs)}function X4(e){return e instanceof Error?e.message:String(e)}let eo,eg=!1;const aC="fleet-console.codex.nav-collapsed",oC="fleet-console.codex.rail-collapsed";let Xu=lC("nav"),Zu=lC("rail"),tg=null,ng=null,Ll="route";function Z4(e,n={}){eo=e,eg=!1,document.documentElement.lang="en",HR(),rL();const r=VR(()=>Ir()),a=V4(()=>Ir()),l=U4(()=>Ir()),f=PR(m=>{cC(m)});return document.addEventListener("click",A1),document.addEventListener("submit",R1),window.addEventListener("keydown",k1,!0),v6(e),n.initialWorkspaceId&&Up()!==n.initialWorkspaceId&&$R(qb(n.initialWorkspaceId)),tD(),{navigateToWorkspace(m){Up()!==m&&ea(qb(m))},destroy(){r(),a(),l(),f(),document.removeEventListener("click",A1),document.removeEventListener("submit",R1),window.removeEventListener("keydown",k1,!0),dC(),Il(!1),sL(),UR(),e.innerHTML=""}}}function J4(e,n){e==="nav"?Xu=n:Zu=n,eD(e,n),eo&&Ir()}function T1(e){return e==="nav"?Xu:Zu}function Q4(e){Ll!==e&&(Ll=e,eo&&Ir())}function lC(e){if(typeof window>"u")return!1;try{return window.localStorage.getItem(e==="nav"?aC:oC)==="true"}catch{return!1}}function eD(e,n){if(!(typeof window>"u"))try{window.localStorage.setItem(e==="nav"?aC:oC,String(n))}catch{}}async function tD(){Ir(),await YR(),await cC(ql())}async function cC(e){if(e.name==="entry"){Fs(),ds(),await XR(e.id);return}if(e.name==="raw"){Fs(),await Y4(e.ref);return}if(e.name==="queue"){If(),ds(),await F4(e.tab);return}if(e.name==="queue-detail"){If(),ds(),await q4(e.patchId);return}if(e.name==="index-md"){Fs(),ds(),await ZR();return}if(e.name==="log"){Fs(),ds(),await JR(e.limit);return}if(e.name==="conflicts"){Fs(),ds(),await QR();return}if(e.name==="conflict-detail"){Fs(),ds(),await eL(e.id);return}If(),ds(),Fs(),Ir()}function Ir(){const e=ql();nD(Ru(),e)}function nD(e,n){const r=n.name==="entry"?n.id:null,a=sD(n),l=Ll!=="side"||!Xu,f=!hC(n)&&(Ll!=="side"||!Zu),m=e.currentEntry?i4(e.currentEntry,e.index):null;iL(e.index,e.recentIds);const c=Ll==="side"?`${Xu?" app-shell--nav-collapsed":""}${Zu?" app-shell--rail-collapsed":""}`:"";dC(),Il(!1),eo.innerHTML=`
|
|
689
|
+
<div class="app-shell${a}${c}">
|
|
690
|
+
<button class="mobile-menu" type="button" data-action="toggle-nav" aria-label="Open menu">
|
|
691
|
+
<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">
|
|
692
|
+
<path d="M4 7h16M4 12h16M4 17h10" />
|
|
693
|
+
</svg>
|
|
694
|
+
</button>
|
|
695
|
+
${l?u4(e.index,r,e.pendingPatchCount,e.workspaces,e.currentWorkspaceId,window.location.pathname):""}
|
|
696
|
+
<main class="content">
|
|
697
|
+
${iD(e,n,m)}
|
|
698
|
+
</main>
|
|
699
|
+
${f?`<div class="rail">${rD(e,n,m)}</div>`:""}
|
|
700
|
+
</div>
|
|
701
|
+
<div class="toast" id="toast" aria-live="polite"></div>
|
|
702
|
+
`,eg?eo.classList.add("is-revealed"):eg=!0,n.name==="entry"&&m&&(tg=z4(eo,m.toc))}function iD(e,n,r){return n.name==="raw"?S4(K4()):n.name==="queue"?w4(Yu()):n.name==="queue-detail"?k4(Yu()):e.error?s4(e.error):e.loading&&!e.currentEntry&&!e.indexMarkdown&&!e.log&&!e.currentConflict?r4():n.name==="index-md"&&e.indexMarkdown?i6(e.indexMarkdown):n.name==="log"&&e.log?H4(e.log):n.name==="conflicts"?t6(e.conflicts):n.name==="conflict-detail"&&e.currentConflict?n6(e.currentConflict):e.currentEntry&&r?r.html:n4(e.index,e.health?.cwd??null,!!e.currentWorkspaceId)}function rD(e,n,r){return hC(n)?"":`
|
|
703
|
+
${r?j4(r.toc):""}
|
|
704
|
+
${s6(e.currentEntry,e.index,e.currentMatchHint)}
|
|
705
|
+
`}function sD(e){return e.name==="raw"?" app-shell--raw":uC(e)?" app-shell--wide":""}function uC(e){return e.name==="home"||e.name==="index-md"||e.name==="log"||e.name==="conflicts"||e.name==="queue"||e.name==="queue-detail"}function hC(e){return e.name==="raw"||uC(e)}function A1(e){const n=e.target;if(!(n instanceof Element))return;const r=n.closest("[data-action]");if(r?.dataset.action==="toggle-nav"){document.body.classList.toggle("nav-open");return}if(r?.dataset.action==="navigate-home"){if(M1(e))return;e.preventDefault(),document.body.classList.remove("nav-open"),ea(Ug());return}if(r?.dataset.action==="set-nav-mode"){const m=r.dataset.mode;(m==="tags"||m==="entries")&&(d4(m),Ir());return}if(r?.dataset.action==="toggle-tag"){h4(r.dataset.tag??""),Ir();return}if(r?.dataset.action==="open-toc-drawer"){oD(r);return}if(r?.dataset.action==="close-toc-drawer"){Il(!0);return}if(r?.dataset.action==="copy-code"){lD(r);return}if(r?.dataset.action==="copy-compact-context"){const m=Ru();m.currentEntry&&Du(uw(m.currentEntry),"Copied compact context.");return}if(r?.dataset.action==="copy-provenance-context"){const m=Ru();m.currentEntry&&Du(hw(m.currentEntry),"Copied provenance context.");return}if(r?.dataset.action==="copy-related-context"){const m=Ru();m.currentEntry&&Du(dw(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(Yu().actionPending||!confirm("Approve this patch?"))return;r.setAttribute("disabled",""),W4();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=n.closest("[data-toc-id]");if(a){e.preventDefault(),document.getElementById(a.dataset.tocId??"")?.scrollIntoView({block:"start"}),Il(!1);return}const l=n.closest("a");if(!l||M1(e))return;const f=cD(l);f&&(e.preventDefault(),document.body.classList.remove("nav-open"),ea(f))}function k1(e){const n=document.querySelector("#toc-drawer:not([hidden])");if(!n)return;if(e.key==="Escape"){e.preventDefault(),e.stopImmediatePropagation(),Il(!0);return}if(e.key==="Tab"){aD(n,e),e.stopImmediatePropagation();return}const r=e.target,a=r instanceof Node&&n.contains(r),l=e.metaKey||e.ctrlKey||e.altKey;(!a||l)&&(e.preventDefault(),e.stopImmediatePropagation())}function aD(e,n){const r=[...e.querySelectorAll("a[href], button:not([disabled])")].filter(m=>m.offsetParent!==null),a=r[0],l=r[r.length-1];if(!a||!l)return;const f=document.activeElement;e.contains(f)?n.shiftKey&&f===a?(n.preventDefault(),l.focus()):!n.shiftKey&&f===l&&(n.preventDefault(),a.focus()):(n.preventDefault(),a.focus())}function oD(e){const n=document.querySelector("#toc-drawer");n&&(ng=e,document.body.classList.remove("nav-open"),document.body.classList.add("toc-open"),n.hidden=!1,(n.querySelector(".toc-drawer-link")??n.querySelector(".toc-drawer-panel [data-action='close-toc-drawer']"))?.focus())}function Il(e){const n=document.querySelector("#toc-drawer");n&&(n.hidden=!0,document.body.classList.remove("toc-open"),e&&ng?.focus(),ng=null)}function dC(){tg?.(),tg=null}function R1(e){const n=e.target;if(n instanceof HTMLFormElement&&n.dataset.action==="queue-reject-submit"){if(e.preventDefault(),Yu().actionPending)return;const r=n.querySelector("button[type='submit']");r&&(r.disabled=!0);const a=n.querySelector("textarea[name='reason']");G4(a?.value??"")}}async function lD(e){const r=e.closest(".code-block")?.dataset.code??"";r&&await Du(r,"Code copied.")}async function Du(e,n){try{await navigator.clipboard.writeText(e),L1(n)}catch{L1("Failed to copy to clipboard.")}}function L1(e){const n=document.querySelector("#toast");n&&(n.textContent=e,n.classList.add("visible"),window.setTimeout(()=>n.classList.remove("visible"),1400))}function M1(e){return e.metaKey||e.ctrlKey||e.shiftKey||e.altKey||e.button!==0}function cD(e){const n=e.getAttribute("href")??"",r=e.dataset.entryId;if(r)return $r(decodeURIComponent(r));if(/^[a-z][a-z0-9+.-]*:/i.test(n)&&!n.startsWith(window.location.origin))return null;const a=new URL(n,window.location.origin);if(a.origin!==window.location.origin)return null;if(a.pathname==="/"||a.pathname==="/console/codex"||a.pathname==="/console/codex/")return Ug();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()??"",f=decodeURIComponent(l.replace(/\.md$/,""));return f?$r(f):null}let Ks=null,jl=null;function uD(e,n){const r=dD();r.parentElement!==e&&e.appendChild(r),jl||(jl=Z4(r,{initialWorkspaceId:n}))}function hD(e){jl?.navigateToWorkspace(e)}function D1(){jl?.destroy(),jl=null,Ks?.parentElement&&Ks.parentElement.removeChild(Ks)}function dD(){return Ks||(Ks=document.createElement("div"),Ks.className="codex-host"),Ks}function fD({state:e,mode:n,onClose:r}){const a=H.useRef(null),l=aS(),f=H.useRef(null),m=e.theaters.find(A=>A.id===e.activeTheaterId)??null,c=m?.id??null,u=!!m?.hasWiki;H.useEffect(()=>{if(!u){D1();return}return()=>{D1()}},[u]),H.useEffect(()=>{!u||!a.current||!c||(Q4(n),uD(a.current,c))},[n,u,c]),H.useEffect(()=>{!u||!c||hD(c)},[c,u]),H.useEffect(()=>{if(n==="route")return;const A=T=>{T.key!=="Escape"||aL()||(T.preventDefault(),r())};return window.addEventListener("keydown",A,!0),()=>window.removeEventListener("keydown",A,!0)},[n,r]);const h=A=>{A.preventDefault(),f.current={pointerId:A.pointerId,startX:A.clientX,startWidth:l},A.currentTarget.setPointerCapture(A.pointerId),A.currentTarget.classList.add("is-dragging")},y=A=>{const T=f.current;!T||T.pointerId!==A.pointerId||OT(T.startWidth+(T.startX-A.clientX))},g=A=>{f.current?.pointerId===A.pointerId&&(f.current=null,A.currentTarget.releasePointerCapture(A.pointerId),A.currentTarget.classList.remove("is-dragging"))},C=m?.label??"Fleet Wiki",E=u?S.jsx("div",{className:"codex-surface-host",ref:a}):S.jsx(gD,{activeTheater:m,hasTheaters:e.theaters.length>0});return n==="route"?S.jsx("section",{className:"codex-route-host","aria-label":"Codex",children:E}):S.jsx("aside",{className:"codex-side-layer",style:{"--codex-side-width":`${l}px`},role:"complementary","aria-label":"Codex",children:S.jsxs("div",{className:"codex-side-panel",children:[S.jsx("div",{className:"codex-side-resize",role:"separator","aria-orientation":"vertical","aria-label":"Resize Codex panel",onPointerDown:h,onPointerMove:y,onPointerUp:g,onPointerCancel:g}),S.jsx(pD,{title:C,onClose:r}),E]})})}function pD({title:e,onClose:n}){const[r,a]=H.useState(()=>T1("nav")),[l,f]=H.useState(()=>T1("rail")),m=c=>{const u=c==="nav"?!r:!l;J4(c,u),c==="nav"?a(u):f(u)};return S.jsxs("header",{className:"codex-surface-header",children:[S.jsxs("div",{className:"codex-surface-heading",children:[S.jsx("span",{className:"codex-surface-eyebrow",children:"Codex"}),S.jsx("h2",{className:"codex-surface-title",title:e,children:e})]}),S.jsxs("div",{className:"codex-surface-actions",children:[S.jsx("button",{type:"button",className:`codex-pane-toggle ${r?"is-collapsed":""}`,onClick:()=>m("nav"),"aria-pressed":!r,"aria-label":r?"Nav 펼치기":"Nav 접기",title:r?"Nav 펼치기":"Nav 접기",children:S.jsx(mD,{})}),S.jsx("button",{type:"button",className:`codex-pane-toggle ${l?"is-collapsed":""}`,onClick:()=>m("rail"),"aria-pressed":!l,"aria-label":l?"ToC 펼치기":"ToC 접기",title:l?"ToC 펼치기":"ToC 접기",children:S.jsx(_D,{})}),S.jsx("button",{type:"button",className:"codex-surface-close",onClick:n,"aria-label":"Close Codex",children:"×"})]})]})}function gD({activeTheater:e,hasTheaters:n}){return n?S.jsxs("section",{className:"codex-empty-state",children:[S.jsx("p",{className:"codex-empty-eyebrow",children:"Codex unavailable"}),S.jsx("h1",{children:e?.label??"This Theater"}),S.jsx("p",{children:"This Theater does not have Fleet Wiki data mounted."})]}):S.jsxs("section",{className:"codex-empty-state",children:[S.jsx("p",{className:"codex-empty-eyebrow",children:"Codex"}),S.jsx("h1",{children:"Add a Theater"}),S.jsx("p",{children:"Use the top bar Theater control to choose a project root before opening Codex."})]})}function mD(){return S.jsxs("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:[S.jsx("rect",{x:"2.5",y:"3.5",width:"11",height:"9",rx:"1.4",fill:"none",stroke:"currentColor",strokeWidth:"1.2"}),S.jsx("path",{d:"M6.1 3.5v9",fill:"none",stroke:"currentColor",strokeWidth:"1.2"}),S.jsx("rect",{x:"3.2",y:"4.2",width:"2.2",height:"7.6",rx:"0.7",fill:"currentColor",opacity:"0.5",stroke:"none"})]})}function _D(){return S.jsxs("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:[S.jsx("rect",{x:"2.5",y:"3.5",width:"11",height:"9",rx:"1.4",fill:"none",stroke:"currentColor",strokeWidth:"1.2"}),S.jsx("path",{d:"M9.9 3.5v9",fill:"none",stroke:"currentColor",strokeWidth:"1.2"}),S.jsx("rect",{x:"10.6",y:"4.2",width:"2.2",height:"7.6",rx:"0.7",fill:"currentColor",opacity:"0.5",stroke:"none"})]})}async function vD(e){const n=await fetch("/agent-cli/state",{signal:e});return await bD(n),yD(await n.json(),n.status)}async function bD(e){if(e.ok)return;let n=e.statusText||`HTTP ${e.status}`;try{const r=await e.json();typeof r.error=="string"&&(n=r.error)}catch{}throw new Ge(e.status,n)}function yD(e,n){const r=e;if(!r||typeof r!="object"||!Array.isArray(r.clis))throw new Ge(n,"Invalid agent CLI state response");return{clis:r.clis.map(a=>SD(a,n))}}function SD(e,n){const r=e;if(!r||typeof r!="object"||typeof r.id!="string"||typeof r.displayName!="string"||typeof r.available!="boolean"||!(r.version===null||typeof r.version=="string"))throw new Ge(n,"Invalid agent CLI status entry");if(Object.prototype.hasOwnProperty.call(r,"path"))throw new Ge(n,"Agent CLI status must not expose filesystem paths");return{id:r.id,displayName:r.displayName,available:r.available,version:r.version}}const ig=new Set;let rg={loading:!1,state:null,error:null};function wD(){return H.useSyncExternalStore(CD,O1,O1)}function O1(){return rg}function CD(e){return ig.add(e),()=>{ig.delete(e)}}async function xD(e){Yf({loading:!0,error:null});try{const n=await vD(e);Yf({loading:!1,state:n,error:null})}catch(n){if(e?.aborted)return;Yf({loading:!1,error:ED(n)})}}function Yf(e){rg={...rg,...e};for(const n of ig)n()}function ED(e){return e instanceof Error?e.message:String(e)}function TD(){const e=wD();return H.useEffect(()=>{const n=new AbortController;return xD(n.signal),()=>n.abort()},[]),S.jsxs("section",{className:"global-settings-card","aria-label":"Agent CLI availability",children:[S.jsxs("div",{className:"agent-cli-head",children:[S.jsx("p",{className:"global-settings-resp-title",children:"Agent CLI"}),S.jsx("p",{className:"global-settings-help",children:"Whether each Agent CLI is installed and discoverable on this machine's PATH, with its detected version. Carriers can only run on an Agent CLI shown as available here."})]}),e.error?S.jsx("p",{className:"global-settings-error",role:"alert",children:e.error}):null,e.loading&&!e.state?S.jsx("p",{className:"global-settings-help",children:"Checking Agent CLIs."}):null,e.state?.clis.map(n=>S.jsx(AD,{cli:n},n.id)),S.jsx("p",{className:"global-settings-foot",children:"Install or update a CLI, then reopen this page to re-check availability."})]})}function AD({cli:e}){return S.jsxs("div",{className:"agent-cli-row",children:[S.jsx("span",{className:"agent-cli-name",children:e.displayName}),S.jsxs("span",{className:"agent-cli-meta",children:[e.available&&e.version?S.jsx("span",{className:"agent-cli-version",children:e.version}):null,S.jsx("span",{className:`agent-cli-status ${e.available?"is-on":""}`,children:e.available?"Available":"Not found"})]})]})}async function kD(e){const n=await fetch("/observer/api-catalog",{signal:e});return await RD(n),LD(await n.json(),n.status).routes}async function RD(e){if(e.ok)return;let n=e.statusText||`HTTP ${e.status}`;try{const r=await e.json();typeof r.error=="string"&&(n=r.error)}catch{}throw new Ge(e.status,n)}function LD(e,n){const r=e;if(!r||typeof r!="object"||!("version"in r)||!Array.isArray(r.routes))throw new Ge(n,"Invalid backend API catalog response");return{routes:r.routes.map(a=>MD(a,n))}}function MD(e,n){const r=e;if(!r||typeof r!="object"||typeof r.method!="string"||typeof r.path!="string"||typeof r.summary!="string"||typeof r.category!="string"||typeof r.gate!="string")throw new Ge(n,"Invalid backend API catalog entry");return{method:r.method,path:r.path,summary:r.summary,category:r.category,gate:r.gate}}const sg=new Set;let ag={loading:!1,state:null,error:null};function DD(){return H.useSyncExternalStore(OD,N1,N1)}function N1(){return ag}function OD(e){return sg.add(e),()=>{sg.delete(e)}}async function ND(e){Xf({loading:!0,error:null});try{const n=await kD(e);Xf({loading:!1,state:n,error:null})}catch(n){if(e?.aborted)return;Xf({loading:!1,error:BD(n)})}}function Xf(e){ag={...ag,...e};for(const n of sg)n()}function BD(e){return e instanceof Error?e.message:String(e)}function ID(){const e=DD(),[n,r]=H.useState(!0),a=H.useMemo(()=>$D(e.state??[]),[e.state]),l=e.state?.length??0,f=a.length;return H.useEffect(()=>{const m=new AbortController;return ND(m.signal),()=>m.abort()},[]),S.jsxs("section",{className:"global-settings-card backend-api-section","aria-label":"Backend API catalog",children:[S.jsx("div",{className:`backend-api-control carrier-settings-control-group--taskforce ${n?"is-expanded":""}`,children:S.jsxs("div",{className:"carrier-settings-section-head",children:[S.jsxs("div",{className:"backend-api-head",children:[S.jsx("p",{className:"global-settings-resp-title",children:"Backend API"}),S.jsx("p",{className:"global-settings-help",children:l>0?`${l} loopback route${l===1?"":"s"} across ${f} categor${f===1?"y":"ies"} reported by backend introspection.`:"Backend introspection route list for this console."})]}),S.jsx("div",{className:"carrier-settings-tf-head-actions",children:S.jsx("button",{type:"button",className:"carrier-settings-tf-toggle","aria-expanded":n,onClick:()=>r(m=>!m),children:n?"Hide":"Show"})})]})}),e.error?S.jsx("p",{className:"global-settings-error",role:"alert",children:e.error}):null,e.loading&&!e.state?S.jsx("p",{className:"global-settings-help",children:"Loading backend API catalog."}):null,n?S.jsxs("div",{className:"backend-api-groups",children:[a.length>0?a.map(m=>S.jsx(jD,{group:m},m.category)):null,e.state&&a.length===0?S.jsx("p",{className:"global-settings-help",children:"No backend API routes reported."}):null]}):null,S.jsx("p",{className:"global-settings-foot",children:"Console backend routes are fetched from GET /observer/api-catalog, so newly registered routes appear here automatically. The Codex/Fleet Wiki API surface is not included."})]})}function jD({group:e}){return S.jsxs("div",{className:"backend-api-group",children:[S.jsxs("div",{className:"backend-api-group-head",children:[S.jsx("span",{children:e.category}),S.jsx("span",{children:e.entries.length})]}),S.jsx("div",{className:"backend-api-list",children:e.entries.map(n=>S.jsx(zD,{entry:n},`${n.method}:${n.path}`))})]})}function zD({entry:e}){return S.jsxs("div",{className:"backend-api-row",children:[S.jsx("span",{className:"backend-api-method",children:e.method.toUpperCase()}),S.jsx("code",{className:"backend-api-path",children:e.path}),S.jsx("span",{className:"backend-api-summary",children:e.summary}),S.jsx("span",{className:"backend-api-gate",children:e.gate})]})}function $D(e){const n=new Map;for(const r of e){const a=r.category.trim()||"Uncategorized",l=n.get(a);l?l.push(r):n.set(a,[r])}return Array.from(n.entries()).map(([r,a])=>({category:r,entries:a}))}async function PD(e){const n=await fetch("/model-auth/state",{signal:e});return await im(n),pC(await n.json(),n.status)}async function HD(e,n,r){const a=await fetch(`/model-auth/providers/${encodeURIComponent(e)}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({apiKey:n}),signal:r});return await im(a),fC(await a.json(),a.status)}async function UD(e,n){const r=await fetch(`/model-auth/providers/${encodeURIComponent(e)}`,{method:"DELETE",signal:n});return await im(r),fC(await r.json(),r.status)}async function im(e){if(e.ok)return;let n=e.statusText||`HTTP ${e.status}`;try{const r=await e.json();typeof r.error=="string"&&(n=r.error)}catch{}throw new Ge(e.status,n)}function fC(e,n){const r=e;if(!r||typeof r!="object"||!("state"in r))throw new Ge(n,"Invalid model auth mutation response");return{state:pC(r.state,n)}}function pC(e,n){const r=e;if(!r||typeof r!="object"||!Array.isArray(r.providers))throw new Ge(n,"Invalid model auth state response");return{providers:r.providers.map(a=>FD(a,n))}}function FD(e,n){const r=e;if(typeof r.cli!="string"||typeof r.displayName!="string"||typeof r.signedIn!="boolean")throw new Ge(n,"Invalid model auth provider response");return{cli:r.cli,displayName:r.displayName,signedIn:r.signedIn}}const og=new Set;let lg={loading:!1,state:null,busyCli:null,error:null};function qD(){return H.useSyncExternalStore(WD,B1,B1)}function B1(){return lg}function WD(e){return og.add(e),()=>{og.delete(e)}}async function GD(e){jr({loading:!0,error:null});try{const n=await PD(e);jr({loading:!1,state:n,error:null})}catch(n){if(e?.aborted)return;jr({loading:!1,error:rm(n)})}}async function KD(e,n){jr({busyCli:e,error:null});try{const r=await HD(e,n);return jr({state:r.state,busyCli:null,error:null}),await gC(),!0}catch(r){return jr({busyCli:null,error:rm(r)}),!1}}async function VD(e){jr({busyCli:e,error:null});try{const n=await UD(e);return jr({state:n.state,busyCli:null,error:null}),await gC(),!0}catch(n){return jr({busyCli:null,error:rm(n)}),!1}}async function gC(){try{OS(await uS())}catch{}}function jr(e){lg={...lg,...e};for(const n of og)n()}function rm(e){return e instanceof Error?e.message:String(e)}function YD(){const e=qD();return H.useEffect(()=>{const n=new AbortController;return GD(n.signal),()=>n.abort()},[]),S.jsxs("section",{className:"global-settings-card","aria-label":"Model sign-in",children:[S.jsxs("div",{className:"model-auth-head",children:[S.jsx("p",{className:"global-settings-resp-title",children:"Model Sign-in"}),S.jsx("p",{className:"global-settings-help",children:"Register a provider API key so carriers can run on that model. Keys are validated against the provider, stored locally, and never shown back in the browser."})]}),e.error?S.jsx("p",{className:"global-settings-error",role:"alert",children:e.error}):null,e.loading&&!e.state?S.jsx("p",{className:"global-settings-help",children:"Loading sign-in state."}):null,e.state?.providers.map(n=>S.jsx(XD,{provider:n,busy:e.busyCli===n.cli},n.cli)),S.jsx("p",{className:"global-settings-foot",children:"Sign-in changes apply to newly launched sessions. Running sessions keep their current credentials until relaunched."})]})}function XD({provider:e,busy:n}){const[r,a]=H.useState(""),l=async()=>{await KD(e.cli,r)&&a("")},f=async()=>{await VD(e.cli)};return S.jsxs("div",{className:"model-auth-row",children:[S.jsxs("div",{className:"model-auth-row-head",children:[S.jsx("span",{className:"model-auth-name",children:e.displayName}),S.jsx("span",{className:`model-auth-status ${e.signedIn?"is-on":""}`,children:e.signedIn?"Signed in":"Not signed in"})]}),e.signedIn?S.jsx("div",{className:"model-auth-actions",children:S.jsx("button",{type:"button",className:"model-auth-button",disabled:n,onClick:()=>{f()},children:n?"Working…":"Sign out"})}):S.jsxs("form",{className:"model-auth-form",onSubmit:m=>{m.preventDefault(),l()},children:[S.jsx("input",{type:"password",className:"model-auth-input",placeholder:"API key",value:r,autoComplete:"off",spellCheck:!1,disabled:n,"aria-label":`${e.displayName} API key`,onChange:m=>a(m.target.value)}),S.jsx("button",{type:"submit",className:"model-auth-button is-primary",disabled:n||r.trim().length===0,children:n?"Verifying…":"Sign in"})]})]})}async function ZD(e){const n=await fetch("/global-settings/state",{signal:e});return await mC(n),_C(await n.json(),n.status)}async function JD(e,n){const r=await fetch("/global-settings",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e),signal:n});await mC(r);const a=await r.json();if(!a||typeof a!="object"||!("state"in a))throw new Ge(r.status,"Invalid global settings mutation response");return{state:_C(a.state,r.status)}}async function mC(e){if(e.ok)return;let n=e.statusText||`HTTP ${e.status}`;try{const r=await e.json();typeof r.error=="string"&&(n=r.error)}catch{}throw new Ge(e.status,n)}function _C(e,n){const r=e;if(!r||typeof r.replaceSystemPrompt!="boolean"||typeof r.enableMetaphor!="boolean")throw new Ge(n,"Invalid global settings state response");return{replaceSystemPrompt:r.replaceSystemPrompt,enableMetaphor:r.enableMetaphor}}const cg=new Set;let ug={loading:!1,state:null,savingField:null,error:null};function QD(){return H.useSyncExternalStore(eO,I1,I1)}function I1(){return ug}function eO(e){return cg.add(e),()=>{cg.delete(e)}}async function tO(e){to({loading:!0,error:null});try{const n=await ZD(e);to({loading:!1,state:n,error:null})}catch(n){if(e?.aborted)return;to({loading:!1,error:vC(n)})}}async function j1(e,n){to({savingField:e,error:null});try{const r=await JD({[e]:n});return to({state:r.state,savingField:null,error:null}),!0}catch(r){return to({savingField:null,error:vC(r)}),!1}}function to(e){ug={...ug,...e};for(const n of cg)n()}function vC(e){return e instanceof Error?e.message:String(e)}const nO=[{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)"]}],iO=[{id:"webgl",label:"WebGL"},{id:"dom",label:"DOM"}],rO=[{id:"appearance",label:"Appearance",eyebrow:"Theme · Renderer"},{id:"general",label:"General",eyebrow:"Prompt · Metaphor"},{id:"agent-cli",label:"Agent CLI",eyebrow:"Availability · Sign-in"},{id:"backend-api",label:"Backend API",eyebrow:"Loopback routes"}];function sO(){const e=QD(),n=e.state,r=e.savingField!==null,[a,l]=H.useState("appearance");return H.useEffect(()=>{const f=new AbortController;return tO(f.signal),()=>f.abort()},[]),S.jsxs("main",{className:"global-settings-page",children:[S.jsxs("section",{className:"global-settings-hero","aria-labelledby":"global-settings-title",children:[S.jsxs("div",{children:[S.jsx("p",{className:"bridge-kicker",children:"Fleet Control Surface"}),S.jsx("h2",{id:"global-settings-title",children:"Settings"})]}),S.jsx("div",{className:"global-settings-status",role:"status","aria-live":"polite",children:r?"Saving…":""})]}),e.error?S.jsx("p",{className:"global-settings-error",role:"alert",children:e.error}):null,S.jsxs("section",{className:"global-settings-grid",children:[S.jsx("div",{className:"global-settings-list","aria-label":"Settings sections",children:rO.map(f=>S.jsxs("button",{type:"button",className:`global-settings-nav-item ${f.id===a?"is-active":""}`,"aria-pressed":f.id===a,onClick:()=>l(f.id),children:[S.jsx("span",{className:"global-settings-nav-label",children:f.label}),S.jsx("span",{className:"global-settings-nav-eyebrow",children:f.eyebrow})]},f.id))}),S.jsx("div",{className:"global-settings-detail",children:aO(a,n,r)},a)]})]})}function aO(e,n,r){switch(e){case"appearance":return S.jsx(oO,{});case"general":return S.jsx(lO,{state:n,saving:r});case"agent-cli":return S.jsxs(S.Fragment,{children:[S.jsx(TD,{}),S.jsx(YD,{})]});case"backend-api":return S.jsx(ID,{})}}function oO(){const{activeTheme:e,terminalRenderer:n}=Fl();return S.jsxs("section",{className:"global-settings-card","aria-label":"Appearance",children:[S.jsxs("div",{className:"global-settings-row",children:[S.jsxs("div",{className:"global-settings-row-text",children:[S.jsx("p",{className:"global-settings-resp-title",children:"Theme"}),S.jsx("p",{className:"global-settings-help",children:"Console color scheme. Applies immediately and is remembered on this browser."})]}),S.jsx("div",{className:"theme-picker",role:"group","aria-label":"Theme",children:nO.map(r=>{const a=r.id===e;return S.jsxs("button",{type:"button","aria-pressed":a,className:`theme-card ${a?"is-active":""}`,onClick:()=>NA(r.id),children:[S.jsx("span",{className:"theme-card-swatch","aria-hidden":"true",children:r.swatch.map(l=>S.jsx("i",{style:{background:l}},l))}),S.jsx("span",{className:"theme-card-label",children:r.label}),S.jsx("span",{className:"theme-card-check","aria-hidden":"true",children:a?S.jsx(cO,{}):null})]},r.id)})})]}),S.jsxs("div",{className:"global-settings-row",children:[S.jsxs("div",{className:"global-settings-row-text",children:[S.jsx("p",{className:"global-settings-resp-title",children:"Terminal Renderer"}),S.jsx("p",{className:"global-settings-help",children:"WebGL paints the terminal on the GPU for sharper, faster output; DOM is a compatibility fallback. Switching applies to the live terminal instantly without dropping the session."})]}),S.jsx("div",{className:"segmented",role:"group","aria-label":"Terminal renderer",children:iO.map(r=>{const a=r.id===n;return S.jsx("button",{type:"button","aria-pressed":a,className:`segmented-option ${a?"is-active":""}`,onClick:()=>BA(r.id),children:r.label},r.id)})})]}),S.jsx("p",{className:"global-settings-foot",children:"Appearance preferences apply immediately and are stored per browser, separate from session settings."})]})}function lO({state:e,saving:n}){return S.jsxs("section",{className:"global-settings-card","aria-label":"General",children:[e?S.jsxs(S.Fragment,{children:[S.jsx(z1,{title:"System Prompt Injection",help:"Append keeps the Agent CLI's built-in system prompt and layers Fleet doctrine on top. Replace swaps it entirely for Fleet doctrine. Affects Claude-family CLIs only; Codex always receives doctrine through its profile.",onLabel:"Replace",offLabel:"Append",value:e.replaceSystemPrompt,disabled:n,onToggle:()=>{j1("replaceSystemPrompt",!e.replaceSystemPrompt)}}),S.jsx(z1,{title:"Metaphor",help:"Enabled layers the naval tone overlay — clipped reporting cadence and Fleet vocabulary — onto every session. Off keeps the Admiral persona without the tone.",onLabel:"Enabled",offLabel:"Off",value:e.enableMetaphor,disabled:n,onToggle:()=>{j1("enableMetaphor",!e.enableMetaphor)}})]}):S.jsx("p",{className:"global-settings-help",children:"Loading settings."}),S.jsx("p",{className:"global-settings-foot",children:"Changes apply to newly launched sessions. Running sessions keep their current configuration until relaunched."})]})}function z1({title:e,help:n,onLabel:r,offLabel:a,value:l,disabled:f,onToggle:m}){return S.jsxs("div",{className:"global-settings-row",children:[S.jsxs("div",{className:"global-settings-row-text",children:[S.jsx("p",{className:"global-settings-resp-title",children:e}),S.jsx("p",{className:"global-settings-help",children:n})]}),S.jsx("button",{type:"button",className:`global-settings-toggle ${l?"is-on":""}`,disabled:f,"aria-pressed":l,onClick:m,children:S.jsx("span",{children:l?r:a})})]})}function cO(){return S.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:S.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"})})}const uO="button",hO=184,dO=320,gu=12;function fO({state:e,onSelect:n,mode:r=uO,anchor:a,viewportBounds:l,onClose:f}){const[m,c]=H.useState(r==="menu"),u=H.useRef(null),h=H.useRef(null),y=H.useRef(null),g=e.creatingTerminalSession||e.addingTheater||!e.activeTheaterId||e.agentClis.length===0,C=r==="menu"||m;H.useEffect(()=>{r==="menu"&&c(!0)},[r,a?.x,a?.y]),H.useEffect(()=>{if(!C)return;const p=d=>{u.current?.contains(d.target)||E()},v=d=>{d.key==="Escape"&&(E(),h.current?.focus())};return document.addEventListener("mousedown",p),document.addEventListener("keydown",v),()=>{document.removeEventListener("mousedown",p),document.removeEventListener("keydown",v)}},[C]),H.useEffect(()=>{C&&y.current?.focus()},[C]);const E=()=>{c(!1),f?.()},A=async p=>{g||hg(p)!==null||(c(!1),h.current?.focus(),await n(p))},T=p=>{if(p.key!=="ArrowDown"&&p.key!=="ArrowUp")return;p.preventDefault();const v=Array.from(y.current?.querySelectorAll("[role^='menuitem']:not(:disabled)")??[]);if(v.length===0)return;const d=v.indexOf(document.activeElement),b=d===-1?p.key==="ArrowDown"?0:v.length-1:(d+(p.key==="ArrowDown"?1:-1)+v.length)%v.length;v[b]?.focus()};return S.jsxs("div",{className:`operation-launch-control ${r==="menu"?"operation-launch-control--canvas":""}`,ref:u,style:a?pO(a,l):void 0,"data-canvas-blocker":!0,children:[r==="button"?S.jsx("button",{type:"button",ref:h,className:`workspace-add-button ${m?"is-open":""}`,onClick:()=>c(p=>!p),disabled:g,"aria-haspopup":"menu","aria-expanded":m,"aria-label":"Launch operation",children:S.jsx(gO,{})}):null,C?S.jsx("div",{className:"operation-launch-menu theater-menu",role:"menu","aria-label":"Launch operation",tabIndex:-1,ref:y,onKeyDown:T,children:e.agentClis.length>0?S.jsx("ul",{className:"theater-menu-list",children:e.agentClis.map(p=>{const v=hg(p),d=g||v!==null;return S.jsx("li",{children:S.jsxs("button",{type:"button",role:"menuitem",className:"theater-menu-item operation-launch-menu-item",disabled:d,"aria-disabled":d,title:v??void 0,onClick:()=>{A(p)},children:[S.jsx("span",{className:"theater-menu-check","aria-hidden":"true",children:bC(p.id)}),S.jsx("span",{className:"theater-menu-label",children:p.label}),v?S.jsx("span",{className:"operation-launch-menu-reason",children:v}):null]})},p.id)})}):S.jsx("p",{className:"theater-menu-empty",children:"No Agent CLI available."})}):null]})}function hg(e){return e.available?e.signedIn?null:"Sign-in required":"Not installed"}function pO(e,n){return n?{left:Math.max(gu,Math.min(e.x,n.width-hO-gu)),top:Math.max(gu,Math.min(e.y,n.height-dO-gu))}:{left:e.x,top:e.y}}function gO(){return S.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:S.jsx("path",{d:"M8 3.4v9.2M3.4 8h9.2",fill:"none",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round"})})}function bC(e){return e==="claude"?S.jsx(mO,{}):e==="claude-kimi"?S.jsx(_O,{}):e==="claude-glm"?S.jsx(vO,{}):e==="codex"?S.jsx(bO,{}):S.jsx(yO,{})}function mO(){return S.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:S.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 _O(){return S.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:S.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 vO(){return S.jsx("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none",style:{display:"inline-block",verticalAlign:"middle"},children:S.jsx("polygon",{points:"5,1 8.5,3 8.5,7 5,9 1.5,7 1.5,3",stroke:"currentColor",strokeWidth:"1.2",fill:"none"})})}function bO(){return S.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:S.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 yO(){return S.jsxs("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:[S.jsx("rect",{x:"2.8",y:"3.4",width:"10.4",height:"8.2",rx:"1.4",fill:"none",stroke:"currentColor",strokeWidth:"1.15"}),S.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 SO=208,wO=360,mu=12;function CO({state:e,anchor:n,viewportBounds:r,onLaunchCli:a,onOpenShell:l,onResetView:f,onClose:m}){const c=H.useRef(null),u=H.useRef(null),h=e.creatingTerminalSession||e.addingTheater||!e.activeTheaterId||e.agentClis.length===0,y=!e.activeTheaterId;return H.useEffect(()=>{const g=E=>{c.current?.contains(E.target)||m()},C=E=>{E.key==="Escape"&&m()};return document.addEventListener("mousedown",g),document.addEventListener("keydown",C),()=>{document.removeEventListener("mousedown",g),document.removeEventListener("keydown",C)}},[m]),H.useEffect(()=>{u.current?.focus()},[]),S.jsx("div",{className:"operation-launch-control operation-launch-control--canvas",ref:c,style:xO(n,r),"data-canvas-blocker":!0,children:S.jsxs("div",{className:"operation-launch-menu theater-menu canvas-context-menu",role:"menu","aria-label":"Canvas actions",tabIndex:-1,ref:u,children:[S.jsx("p",{className:"canvas-context-menu-group",children:"New Operation"}),e.agentClis.length>0?S.jsx("ul",{className:"theater-menu-list",children:e.agentClis.map(g=>{const C=hg(g),E=h||C!==null;return S.jsx("li",{children:S.jsxs("button",{type:"button",role:"menuitem",className:"theater-menu-item operation-launch-menu-item",disabled:E,"aria-disabled":E,title:C??void 0,onClick:()=>{C===null&&!h&&a(g)},children:[S.jsx("span",{className:"theater-menu-check","aria-hidden":"true",children:bC(g.id)}),S.jsx("span",{className:"theater-menu-label",children:g.label}),C?S.jsx("span",{className:"operation-launch-menu-reason",children:C}):null]})},g.id)})}):S.jsx("p",{className:"theater-menu-empty",children:"No Agent CLI available."}),S.jsx("div",{className:"theater-menu-divider",role:"separator"}),S.jsxs("button",{type:"button",role:"menuitem",className:"theater-menu-item canvas-context-menu-item",disabled:y,onClick:l,children:[S.jsx("span",{className:"theater-menu-check","aria-hidden":"true",children:S.jsx(EO,{})}),S.jsx("span",{className:"theater-menu-label",children:"Open Shell"})]}),S.jsx("div",{className:"theater-menu-divider",role:"separator"}),S.jsxs("button",{type:"button",role:"menuitem",className:"theater-menu-item canvas-context-menu-item",onClick:f,children:[S.jsx("span",{className:"theater-menu-check","aria-hidden":"true",children:S.jsx(TO,{})}),S.jsx("span",{className:"theater-menu-label",children:"Reset view"})]})]})})}function xO(e,n){return n?{left:Math.max(mu,Math.min(e.x,n.width-SO-mu)),top:Math.max(mu,Math.min(e.y,n.height-wO-mu))}:{left:e.x,top:e.y}}function EO(){return S.jsxs("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:[S.jsx("rect",{x:"2.8",y:"3.4",width:"10.4",height:"9.2",rx:"1.4",fill:"none",stroke:"currentColor",strokeWidth:"1.15"}),S.jsx("path",{d:"M5 6.6 6.8 8.4 5 10.2M8.4 10.2h2.8",fill:"none",stroke:"currentColor",strokeWidth:"1.15",strokeLinecap:"round",strokeLinejoin:"round"})]})}function TO(){return S.jsxs("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:[S.jsx("path",{d:"M4.4 7.2A4 4 0 1 1 4 9.2",fill:"none",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round"}),S.jsx("path",{d:"M2.4 4.6v2.8h2.8",fill:"none",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round"})]})}const $1=256,P1=176,Zf=12,_u=220,yC="fleet-console.map.radarCollapsed";function AO({panels:e,shellPanels:n,viewport:r,canvasSize:a,onJump:l}){const f=H.useRef(null),m=H.useRef(!1),[c,u]=H.useState(kO);if(a.width<=0||a.height<=0||r.zoom<=0)return null;const h=[...Object.entries(e).map(([I,K])=>({id:I,kind:"op",x:K.x,y:K.y,width:K.width,height:K.height})),...Object.entries(n).map(([I,K])=>({id:I,kind:"shell",x:K.geometry.x,y:K.geometry.y,width:K.geometry.width,height:K.geometry.height}))];if(h.length===0)return null;const y=()=>{u(I=>{const K=!I;return RO(K),K})};if(c)return S.jsx("button",{type:"button",className:"canvas-minimap-fab","data-canvas-blocker":!0,onClick:y,"aria-label":"Radar 펼치기",title:"Show radar",children:S.jsx(MO,{})});const g=$1-Zf*2,C=P1-Zf*2,E={x:-r.x/r.zoom,y:-r.y/r.zoom,width:a.width/r.zoom,height:a.height/r.zoom};let A=Math.min(E.x,...h.map(I=>I.x)),T=Math.min(E.y,...h.map(I=>I.y)),p=Math.max(E.x+E.width,...h.map(I=>I.x+I.width)),v=Math.max(E.y+E.height,...h.map(I=>I.y+I.height));A-=_u,T-=_u,p+=_u,v+=_u;const d=p-A,b=v-T,x=Math.min(g/d,C/b),L=(g-d*x)/2,R=(C-b*x)/2,M=I=>L+(I-A)*x,k=I=>R+(I-T)*x,O=I=>{const K=f.current?.getBoundingClientRect();if(!K)return;const te=I.clientX-K.left,q=I.clientY-K.top;l({x:A+(te-L)/x,y:T+(q-R)/x})},U=I=>{I.stopPropagation(),m.current=!0,I.currentTarget.setPointerCapture(I.pointerId),O(I)},F=I=>{m.current&&(I.stopPropagation(),O(I))},G=I=>{m.current=!1;try{I.currentTarget.releasePointerCapture(I.pointerId)}catch{}};return S.jsxs("div",{className:"canvas-minimap","data-canvas-blocker":!0,style:{width:$1,height:P1},children:[S.jsx("span",{className:"canvas-minimap-label","aria-hidden":"true",children:"Radar"}),S.jsx("button",{type:"button",className:"canvas-minimap-toggle",onClick:y,"aria-label":"Radar 접기",title:"Collapse radar",children:S.jsx(LO,{})}),S.jsxs("div",{ref:f,className:"canvas-minimap-inner",style:{inset:Zf},onPointerDown:U,onPointerMove:F,onPointerUp:G,onPointerCancel:G,role:"presentation","aria-label":"Canvas minimap — drag to navigate",children:[h.map(I=>S.jsx("div",{className:`canvas-minimap-panel ${I.kind==="shell"?"is-shell":""}`,style:{left:M(I.x),top:k(I.y),width:Math.max(2,I.width*x),height:Math.max(2,I.height*x)}},I.id)),S.jsx("div",{className:"canvas-minimap-view",style:{left:M(E.x),top:k(E.y),width:E.width*x,height:E.height*x}})]})]})}function kO(){if(typeof window>"u")return!1;try{return window.localStorage.getItem(yC)==="true"}catch{return!1}}function RO(e){if(!(typeof window>"u"))try{window.localStorage.setItem(yC,String(e))}catch{}}function LO(){return S.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:S.jsx("path",{d:"M5.5 4.5 10.5 8l-5 3.5M11 8H5.5",fill:"none",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round"})})}function MO(){return S.jsxs("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:[S.jsx("rect",{x:"2",y:"3",width:"12",height:"10",rx:"2",fill:"none",stroke:"currentColor",strokeWidth:"1.2"}),S.jsx("rect",{x:"4.2",y:"5",width:"4.2",height:"3.1",rx:"0.6",fill:"none",stroke:"currentColor",strokeWidth:"1"}),S.jsx("circle",{cx:"11",cy:"10.2",r:"0.95",fill:"currentColor"})]})}function DO({jobs:e,selectedJobId:n,onSelect:r}){const a=r??$S;return S.jsx("ol",{className:"terminal-job-lines",children:e.map(l=>S.jsx(OO,{job:l,active:n===l.jobId,onSelect:a},l.jobId))})}function OO({job:e,active:n,onSelect:r}){const a=rh(e.status),l=uA(e),f=e.ownerCarrierId?`${lA(e.ownerCarrierId)} · ${Dp(e.status)}`:Dp(e.status);return S.jsx("li",{children:S.jsxs("button",{type:"button",className:`terminal-job-line ${n?"is-active":""}`,onClick:()=>r(e.jobId),"aria-current":n||void 0,children:[S.jsx("span",{className:`status-dot status-dot--${a}`,"aria-hidden":"true"}),S.jsx("span",{className:"terminal-job-line-label",children:e.label??Mp(e.jobId)}),S.jsx("span",{className:"terminal-job-line-meta",children:f}),l?S.jsxs(S.Fragment,{children:[S.jsx("span",{className:"terminal-job-line-sep","aria-hidden":"true",children:"-"}),S.jsx("span",{className:"terminal-job-line-stream",children:l})]}):null]})})}var Jf={exports:{}},H1;function NO(){return H1||(H1=1,(function(e,n){(function(r,a){e.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 f=this._terminal._core;this._terminal.rows===l.rows&&this._terminal.cols===l.cols||(f._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,f=l._renderService.dimensions;if(f.css.cell.width===0||f.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"))),y=window.getComputedStyle(this._terminal.element),g=u-(parseInt(y.getPropertyValue("padding-top"))+parseInt(y.getPropertyValue("padding-bottom"))),C=h-(parseInt(y.getPropertyValue("padding-right"))+parseInt(y.getPropertyValue("padding-left")))-m;return{cols:Math.max(2,Math.floor(C/f.css.cell.width)),rows:Math.max(1,Math.floor(g/f.css.cell.height))}}}})(),r})()))})(Jf)),Jf.exports}var BO=NO(),Ou={exports:{}},IO=Ou.exports,U1;function jO(){return U1||(U1=1,(function(e,n){(function(r,a){e.exports=a()})(IO,(()=>(()=>{var r={433:(m,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.UnicodeV11=void 0;const h=u(938),y=[[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]],g=[[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]],E=[[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 T(p,v){let d,b=0,x=v.length-1;if(p<v[0][0]||p>v[x][1])return!1;for(;x>=b;)if(d=b+x>>1,p>v[d][1])b=d+1;else{if(!(p<v[d][0]))return!0;x=d-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 p=0;p<y.length;++p)A.fill(0,y[p][0],y[p][1]+1);for(let p=0;p<C.length;++p)A.fill(2,C[p][0],C[p][1]+1)}}wcwidth(p){return p<32?0:p<127?1:p<65536?A[p]:T(p,g)?0:T(p,E)?2:1}charProperties(p,v){let d=this.wcwidth(p),b=d===0&&v!==0;if(b){const x=h.UnicodeService.extractWidth(v);x===0?b=!1:x>d&&(d=x)}return h.UnicodeService.createPropertyValue(0,d,b)}}},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 y=[];for(let g=0;g<this._listeners.length;g++)y.push(this._listeners[g]);for(let g=0;g<y.length;g++)y[g].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((y=>h.fire(y)))},c.runAndSubscribe=function(u,h){return h(void 0),u((y=>h(y)))}},490:(m,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.UnicodeV6=void 0;const h=u(938),y=[[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]],g=[[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 E=0;E<y.length;++E)C.fill(0,y[E][0],y[E][1]+1)}}wcwidth(E){return E<32?0:E<127?1:E<65536?C[E]:(function(A,T){let p,v=0,d=T.length-1;if(A<T[0][0]||A>T[d][1])return!1;for(;d>=v;)if(p=v+d>>1,A>T[p][1])v=p+1;else{if(!(A<T[p][0]))return!0;d=p-1}return!1})(E,g)?0:E>=131072&&E<=196605||E>=196608&&E<=262141?2:1}charProperties(E,A){let T=this.wcwidth(E),p=T===0&&A!==0;if(p){const v=h.UnicodeService.extractWidth(A);v===0?p=!1:v>T&&(T=v)}return h.UnicodeService.createPropertyValue(0,T,p)}}},938:(m,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.UnicodeService=void 0;const h=u(345),y=u(490);class g{static extractShouldJoin(E){return(1&E)!=0}static extractWidth(E){return E>>1&3}static extractCharKind(E){return E>>3}static createPropertyValue(E,A,T=!1){return(16777215&E)<<3|(3&A)<<1|(T?1:0)}constructor(){this._providers=Object.create(null),this._active="",this._onChange=new h.EventEmitter,this.onChange=this._onChange.event;const E=new y.UnicodeV6;this.register(E),this._active=E.version,this._activeProvider=E}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(E){if(!this._providers[E])throw new Error(`unknown Unicode version "${E}"`);this._active=E,this._activeProvider=this._providers[E],this._onChange.fire(E)}register(E){this._providers[E.version]=E}wcwidth(E){return this._activeProvider.wcwidth(E)}getStringCellWidth(E){let A=0,T=0;const p=E.length;for(let v=0;v<p;++v){let d=E.charCodeAt(v);if(55296<=d&&d<=56319){if(++v>=p)return A+this.wcwidth(d);const L=E.charCodeAt(v);56320<=L&&L<=57343?d=1024*(d-55296)+L-56320+65536:A+=this.wcwidth(L)}const b=this.charProperties(d,T);let x=g.extractWidth(b);g.extractShouldJoin(b)&&(x-=g.extractWidth(T)),A+=x,T=b}return A}charProperties(E,A){return this._activeProvider.charProperties(E,A)}}c.UnicodeService=g}},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 f={};return(()=>{var m=f;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(){}}})(),f})()))})(Ou)),Ou.exports}var zO=jO();var $O=(e,n,r,a)=>{for(var l=n,f=e.length-1,m;f>=0;f--)(m=e[f])&&(l=m(l)||l);return l},PO=(e,n)=>(r,a)=>n(r,a,e),HO=class{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(e){setTimeout(()=>{throw e.stack?F1.isErrorNoTelemetry(e)?new F1(e.message+`
|
|
706
|
+
|
|
707
|
+
`+e.stack):new Error(e.message+`
|
|
708
|
+
|
|
709
|
+
`+e.stack):e},0)}}addListener(e){return this.listeners.push(e),()=>{this._removeListener(e)}}emit(e){this.listeners.forEach(n=>{n(e)})}_removeListener(e){this.listeners.splice(this.listeners.indexOf(e),1)}setUnexpectedErrorHandler(e){this.unexpectedErrorHandler=e}getUnexpectedErrorHandler(){return this.unexpectedErrorHandler}onUnexpectedError(e){this.unexpectedErrorHandler(e),this.emit(e)}onUnexpectedExternalError(e){this.unexpectedErrorHandler(e)}},UO=new HO;function Qf(e){FO(e)||UO.onUnexpectedError(e)}var dg="Canceled";function FO(e){return e instanceof qO?!0:e instanceof Error&&e.name===dg&&e.message===dg}var qO=class extends Error{constructor(){super(dg),this.name=this.message}},F1=class fg extends Error{constructor(n){super(n),this.name="CodeExpectedError"}static fromError(n){if(n instanceof fg)return n;let r=new fg;return r.message=n.message,r.stack=n.stack,r}static isErrorNoTelemetry(n){return n.name==="CodeExpectedError"}},WO;(e=>{function n(f){return f<0}e.isLessThan=n;function r(f){return f<=0}e.isLessThanOrEqual=r;function a(f){return f>0}e.isGreaterThan=a;function l(f){return f===0}e.isNeitherLessOrGreaterThan=l,e.greaterThan=1,e.lessThan=-1,e.neitherLessOrGreaterThan=0})(WO||={});function GO(e,n){let r=this,a=!1,l;return function(){return a||(a=!0,n||(l=e.apply(r,arguments))),l}}var SC;(e=>{function n(x){return x&&typeof x=="object"&&typeof x[Symbol.iterator]=="function"}e.is=n;let r=Object.freeze([]);function a(){return r}e.empty=a;function*l(x){yield x}e.single=l;function f(x){return n(x)?x:l(x)}e.wrap=f;function m(x){return x||r}e.from=m;function*c(x){for(let L=x.length-1;L>=0;L--)yield x[L]}e.reverse=c;function u(x){return!x||x[Symbol.iterator]().next().done===!0}e.isEmpty=u;function h(x){return x[Symbol.iterator]().next().value}e.first=h;function y(x,L){let R=0;for(let M of x)if(L(M,R++))return!0;return!1}e.some=y;function g(x,L){for(let R of x)if(L(R))return R}e.find=g;function*C(x,L){for(let R of x)L(R)&&(yield R)}e.filter=C;function*E(x,L){let R=0;for(let M of x)yield L(M,R++)}e.map=E;function*A(x,L){let R=0;for(let M of x)yield*L(M,R++)}e.flatMap=A;function*T(...x){for(let L of x)yield*L}e.concat=T;function p(x,L,R){let M=R;for(let k of x)M=L(M,k);return M}e.reduce=p;function*v(x,L,R=x.length){for(L<0&&(L+=x.length),R<0?R+=x.length:R>x.length&&(R=x.length);L<R;L++)yield x[L]}e.slice=v;function d(x,L=Number.POSITIVE_INFINITY){let R=[];if(L===0)return[R,x];let M=x[Symbol.iterator]();for(let k=0;k<L;k++){let O=M.next();if(O.done)return[R,e.empty()];R.push(O.value)}return[R,{[Symbol.iterator](){return M}}]}e.consume=d;async function b(x){let L=[];for await(let R of x)L.push(R);return Promise.resolve(L)}e.asyncToArray=b})(SC||={});function wC(e){if(SC.is(e)){let n=[];for(let r of e)if(r)try{r.dispose()}catch(a){n.push(a)}if(n.length===1)throw n[0];if(n.length>1)throw new AggregateError(n,"Encountered errors while disposing of store");return Array.isArray(e)?[]:e}else if(e)return e.dispose(),e}function CC(...e){return On(()=>wC(e))}function On(e){return{dispose:GO(()=>{e()})}}var xC=class EC{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{wC(this._toDispose)}finally{this._toDispose.clear()}}add(n){if(!n)return n;if(n===this)throw new Error("Cannot register a disposable on itself!");return this._isDisposed?EC.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(n),n}delete(n){if(n){if(n===this)throw new Error("Cannot dispose a disposable on itself!");this._toDispose.delete(n),n.dispose()}}deleteAndLeak(n){n&&this._toDispose.has(n)&&(this._toDispose.delete(n),void 0)}};xC.DISABLE_DISPOSED_WARNING=!1;var no=xC,Wi=class{constructor(){this._store=new no,this._store}dispose(){this._store.dispose()}_register(e){if(e===this)throw new Error("Cannot register a disposable on itself!");return this._store.add(e)}};Wi.None=Object.freeze({dispose(){}});var ml=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(e){this._isDisposed||e===this._value||(this._value?.dispose(),this._value=e)}clear(){this.value=void 0}dispose(){this._isDisposed=!0,this._value?.dispose(),this._value=void 0}clearAndLeak(){let e=this._value;return this._value=void 0,e}},sm=typeof process<"u"&&"title"in process,fh=sm?"node":navigator.userAgent,KO=sm?"node":navigator.platform,VO=fh.includes("Firefox"),YO=fh.includes("Edge"),TC=/^((?!chrome|android).)*safari/i.test(fh);function XO(){if(!TC)return 0;let e=fh.match(/Version\/(\d+)/);return e===null||e.length<2?0:parseInt(e[1])}KO.indexOf("Linux")>=0;var ZO="",mn=0,_n=0,vn=0,Kt=0,Ei={css:"#00000000",rgba:0},zn;(e=>{function n(l,f,m,c){return c!==void 0?`#${qs(l)}${qs(f)}${qs(m)}${qs(c)}`:`#${qs(l)}${qs(f)}${qs(m)}`}e.toCss=n;function r(l,f,m,c=255){return(l<<24|f<<16|m<<8|c)>>>0}e.toRgba=r;function a(l,f,m,c){return{css:e.toCss(l,f,m,c),rgba:e.toRgba(l,f,m,c)}}e.toColor=a})(zn||={});var xl;(e=>{function n(u,h){if(Kt=(h.rgba&255)/255,Kt===1)return{css:h.css,rgba:h.rgba};let y=h.rgba>>24&255,g=h.rgba>>16&255,C=h.rgba>>8&255,E=u.rgba>>24&255,A=u.rgba>>16&255,T=u.rgba>>8&255;mn=E+Math.round((y-E)*Kt),_n=A+Math.round((g-A)*Kt),vn=T+Math.round((C-T)*Kt);let p=zn.toCss(mn,_n,vn),v=zn.toRgba(mn,_n,vn);return{css:p,rgba:v}}e.blend=n;function r(u){return(u.rgba&255)===255}e.isOpaque=r;function a(u,h,y){let g=Xs.ensureContrastRatio(u.rgba,h.rgba,y);if(g)return zn.toColor(g>>24&255,g>>16&255,g>>8&255)}e.ensureContrastRatio=a;function l(u){let h=(u.rgba|255)>>>0;return[mn,_n,vn]=Xs.toChannels(h),{css:zn.toCss(mn,_n,vn),rgba:h}}e.opaque=l;function f(u,h){return Kt=Math.round(h*255),[mn,_n,vn]=Xs.toChannels(u.rgba),{css:zn.toCss(mn,_n,vn,Kt),rgba:zn.toRgba(mn,_n,vn,Kt)}}e.opacity=f;function m(u,h){return Kt=u.rgba&255,f(u,Kt*h/255)}e.multiplyOpacity=m;function c(u){return[u.rgba>>24&255,u.rgba>>16&255,u.rgba>>8&255]}e.toColorRGB=c})(xl||={});var JO;(e=>{let n,r;try{let l=document.createElement("canvas");l.width=1,l.height=1;let f=l.getContext("2d",{willReadFrequently:!0});f&&(n=f,n.globalCompositeOperation="copy",r=n.createLinearGradient(0,0,1,1))}catch{}function a(l){if(l.match(/#[\da-f]{3,8}/i))switch(l.length){case 4:return mn=parseInt(l.slice(1,2).repeat(2),16),_n=parseInt(l.slice(2,3).repeat(2),16),vn=parseInt(l.slice(3,4).repeat(2),16),zn.toColor(mn,_n,vn);case 5:return mn=parseInt(l.slice(1,2).repeat(2),16),_n=parseInt(l.slice(2,3).repeat(2),16),vn=parseInt(l.slice(3,4).repeat(2),16),Kt=parseInt(l.slice(4,5).repeat(2),16),zn.toColor(mn,_n,vn,Kt);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 f=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(f)return mn=parseInt(f[1]),_n=parseInt(f[2]),vn=parseInt(f[3]),Kt=Math.round((f[5]===void 0?1:parseFloat(f[5]))*255),zn.toColor(mn,_n,vn,Kt);if(!n||!r)throw new Error("css.toColor: Unsupported css format");if(n.fillStyle=r,n.fillStyle=l,typeof n.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(n.fillRect(0,0,1,1),[mn,_n,vn,Kt]=n.getImageData(0,0,1,1).data,Kt!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:zn.toRgba(mn,_n,vn,Kt),css:l}}e.toColor=a})(JO||={});var In;(e=>{function n(a){return r(a>>16&255,a>>8&255,a&255)}e.relativeLuminance=n;function r(a,l,f){let m=a/255,c=l/255,u=f/255,h=m<=.03928?m/12.92:Math.pow((m+.055)/1.055,2.4),y=c<=.03928?c/12.92:Math.pow((c+.055)/1.055,2.4),g=u<=.03928?u/12.92:Math.pow((u+.055)/1.055,2.4);return h*.2126+y*.7152+g*.0722}e.relativeLuminance2=r})(In||={});var Xs;(e=>{function n(m,c){if(Kt=(c&255)/255,Kt===1)return c;let u=c>>24&255,h=c>>16&255,y=c>>8&255,g=m>>24&255,C=m>>16&255,E=m>>8&255;return mn=g+Math.round((u-g)*Kt),_n=C+Math.round((h-C)*Kt),vn=E+Math.round((y-E)*Kt),zn.toRgba(mn,_n,vn)}e.blend=n;function r(m,c,u){let h=In.relativeLuminance(m>>8),y=In.relativeLuminance(c>>8);if(Rr(h,y)<u){if(y<h){let E=a(m,c,u),A=Rr(h,In.relativeLuminance(E>>8));if(A<u){let T=l(m,c,u),p=Rr(h,In.relativeLuminance(T>>8));return A>p?E:T}return E}let g=l(m,c,u),C=Rr(h,In.relativeLuminance(g>>8));if(C<u){let E=a(m,c,u),A=Rr(h,In.relativeLuminance(E>>8));return C>A?g:E}return g}}e.ensureContrastRatio=r;function a(m,c,u){let h=m>>24&255,y=m>>16&255,g=m>>8&255,C=c>>24&255,E=c>>16&255,A=c>>8&255,T=Rr(In.relativeLuminance2(C,E,A),In.relativeLuminance2(h,y,g));for(;T<u&&(C>0||E>0||A>0);)C-=Math.max(0,Math.ceil(C*.1)),E-=Math.max(0,Math.ceil(E*.1)),A-=Math.max(0,Math.ceil(A*.1)),T=Rr(In.relativeLuminance2(C,E,A),In.relativeLuminance2(h,y,g));return(C<<24|E<<16|A<<8|255)>>>0}e.reduceLuminance=a;function l(m,c,u){let h=m>>24&255,y=m>>16&255,g=m>>8&255,C=c>>24&255,E=c>>16&255,A=c>>8&255,T=Rr(In.relativeLuminance2(C,E,A),In.relativeLuminance2(h,y,g));for(;T<u&&(C<255||E<255||A<255);)C=Math.min(255,C+Math.ceil((255-C)*.1)),E=Math.min(255,E+Math.ceil((255-E)*.1)),A=Math.min(255,A+Math.ceil((255-A)*.1)),T=Rr(In.relativeLuminance2(C,E,A),In.relativeLuminance2(h,y,g));return(C<<24|E<<16|A<<8|255)>>>0}e.increaseLuminance=l;function f(m){return[m>>24&255,m>>16&255,m>>8&255,m&255]}e.toChannels=f})(Xs||={});function qs(e){let n=e.toString(16);return n.length<2?"0"+n:n}function Rr(e,n){return e<n?(n+.05)/(e+.05):(e+.05)/(n+.05)}function hn(e){if(!e)throw new Error("value must not be falsy");return e}function am(e){return 57508<=e&&e<=57558}function QO(e){return 57520<=e&&e<=57527}function e8(e){return 57344<=e&&e<=63743}function t8(e){return 9472<=e&&e<=9631}function n8(e){return e>=128512&&e<=128591||e>=127744&&e<=128511||e>=128640&&e<=128767||e>=9728&&e<=9983||e>=9984&&e<=10175||e>=65024&&e<=65039||e>=129280&&e<=129535||e>=127462&&e<=127487}function i8(e,n,r,a){return n===1&&r>Math.ceil(a*1.5)&&e!==void 0&&e>255&&!n8(e)&&!am(e)&&!e8(e)}function AC(e){return am(e)||t8(e)}function r8(){return{css:{canvas:vu(),cell:vu()},device:{canvas:vu(),cell:vu(),char:{width:0,height:0,left:0,top:0}}}}function vu(){return{width:0,height:0}}function s8(e,n,r=0){return(e-(Math.round(n)*2-r))%(Math.round(n)*2)}var An=0,gn=0,Ji=!1,Lr=!1,bu=!1,Zn,ep=0,a8=class{constructor(e,n,r,a,l,f){this._terminal=e,this._optionService=n,this._selectionRenderModel=r,this._decorationService=a,this._coreBrowserService=l,this._themeService=f,this.result={fg:0,bg:0,ext:0}}resolve(e,n,r,a){if(this.result.bg=e.bg,this.result.fg=e.fg,this.result.ext=e.bg&268435456?e.extended.ext:0,gn=0,An=0,Lr=!1,Ji=!1,bu=!1,Zn=this._themeService.colors,ep=0,e.getCode()!==0&&e.extended.underlineStyle===4){let l=Math.max(1,Math.floor(this._optionService.rawOptions.fontSize*this._coreBrowserService.dpr/15));ep=n*a%(Math.round(l)*2)}if(this._decorationService.forEachDecorationAtCell(n,r,"bottom",l=>{l.backgroundColorRGB&&(gn=l.backgroundColorRGB.rgba>>8&16777215,Lr=!0),l.foregroundColorRGB&&(An=l.foregroundColorRGB.rgba>>8&16777215,Ji=!0)}),bu=this._selectionRenderModel.isCellSelected(this._terminal,n,r),bu){if(this.result.fg&67108864||(this.result.bg&50331648)!==0){if(this.result.fg&67108864)switch(this.result.fg&50331648){case 16777216:case 33554432:gn=this._themeService.colors.ansi[this.result.fg&255].rgba;break;case 50331648:gn=(this.result.fg&16777215)<<8|255;break;default:gn=this._themeService.colors.foreground.rgba}else switch(this.result.bg&50331648){case 16777216:case 33554432:gn=this._themeService.colors.ansi[this.result.bg&255].rgba;break;case 50331648:gn=(this.result.bg&16777215)<<8|255;break}gn=Xs.blend(gn,(this._coreBrowserService.isFocused?Zn.selectionBackgroundOpaque:Zn.selectionInactiveBackgroundOpaque).rgba&4294967040|128)>>8&16777215}else gn=(this._coreBrowserService.isFocused?Zn.selectionBackgroundOpaque:Zn.selectionInactiveBackgroundOpaque).rgba>>8&16777215;if(Lr=!0,Zn.selectionForeground&&(An=Zn.selectionForeground.rgba>>8&16777215,Ji=!0),AC(e.getCode())){if(this.result.fg&67108864&&(this.result.bg&50331648)===0)An=(this._coreBrowserService.isFocused?Zn.selectionBackgroundOpaque:Zn.selectionInactiveBackgroundOpaque).rgba>>8&16777215;else{if(this.result.fg&67108864)switch(this.result.bg&50331648){case 16777216:case 33554432:An=this._themeService.colors.ansi[this.result.bg&255].rgba;break;case 50331648:An=(this.result.bg&16777215)<<8|255;break}else switch(this.result.fg&50331648){case 16777216:case 33554432:An=this._themeService.colors.ansi[this.result.fg&255].rgba;break;case 50331648:An=(this.result.fg&16777215)<<8|255;break;default:An=this._themeService.colors.foreground.rgba}An=Xs.blend(An,(this._coreBrowserService.isFocused?Zn.selectionBackgroundOpaque:Zn.selectionInactiveBackgroundOpaque).rgba&4294967040|128)>>8&16777215}Ji=!0}}this._decorationService.forEachDecorationAtCell(n,r,"top",l=>{l.backgroundColorRGB&&(gn=l.backgroundColorRGB.rgba>>8&16777215,Lr=!0),l.foregroundColorRGB&&(An=l.foregroundColorRGB.rgba>>8&16777215,Ji=!0)}),Lr&&(bu?gn=e.bg&-16777216&-134217729|gn|50331648:gn=e.bg&-16777216|gn|50331648),Ji&&(An=e.fg&-16777216&-67108865|An|50331648),this.result.fg&67108864&&(Lr&&!Ji&&((this.result.bg&50331648)===0?An=this.result.fg&-134217728|Zn.background.rgba>>8&16777215&16777215|50331648:An=this.result.fg&-134217728|this.result.bg&67108863,Ji=!0),!Lr&&Ji&&((this.result.fg&50331648)===0?gn=this.result.bg&-67108864|Zn.foreground.rgba>>8&16777215&16777215|50331648:gn=this.result.bg&-67108864|this.result.fg&67108863,Lr=!0)),Zn=void 0,this.result.bg=Lr?gn:this.result.bg,this.result.fg=Ji?An:this.result.fg,this.result.ext&=536870911,this.result.ext|=ep<<29&3758096384}},o8=.5,kC=VO||YO?"bottom":"ideographic",l8={"▀":[{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}]},c8={"░":[[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]]},u8={"─":{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:(e,n)=>`M0,${.5-n} L1,${.5-n} M0,${.5+n} L1,${.5+n}`},"║":{1:(e,n)=>`M${.5-e},0 L${.5-e},1 M${.5+e},0 L${.5+e},1`},"╒":{1:(e,n)=>`M.5,1 L.5,${.5-n} L1,${.5-n} M.5,${.5+n} L1,${.5+n}`},"╓":{1:(e,n)=>`M${.5-e},1 L${.5-e},.5 L1,.5 M${.5+e},.5 L${.5+e},1`},"╔":{1:(e,n)=>`M1,${.5-n} L${.5-e},${.5-n} L${.5-e},1 M1,${.5+n} L${.5+e},${.5+n} L${.5+e},1`},"╕":{1:(e,n)=>`M0,${.5-n} L.5,${.5-n} L.5,1 M0,${.5+n} L.5,${.5+n}`},"╖":{1:(e,n)=>`M${.5+e},1 L${.5+e},.5 L0,.5 M${.5-e},.5 L${.5-e},1`},"╗":{1:(e,n)=>`M0,${.5+n} L${.5-e},${.5+n} L${.5-e},1 M0,${.5-n} L${.5+e},${.5-n} L${.5+e},1`},"╘":{1:(e,n)=>`M.5,0 L.5,${.5+n} L1,${.5+n} M.5,${.5-n} L1,${.5-n}`},"╙":{1:(e,n)=>`M1,.5 L${.5-e},.5 L${.5-e},0 M${.5+e},.5 L${.5+e},0`},"╚":{1:(e,n)=>`M1,${.5-n} L${.5+e},${.5-n} L${.5+e},0 M1,${.5+n} L${.5-e},${.5+n} L${.5-e},0`},"╛":{1:(e,n)=>`M0,${.5+n} L.5,${.5+n} L.5,0 M0,${.5-n} L.5,${.5-n}`},"╜":{1:(e,n)=>`M0,.5 L${.5+e},.5 L${.5+e},0 M${.5-e},.5 L${.5-e},0`},"╝":{1:(e,n)=>`M0,${.5-n} L${.5-e},${.5-n} L${.5-e},0 M0,${.5+n} L${.5+e},${.5+n} L${.5+e},0`},"╞":{1:(e,n)=>`M.5,0 L.5,1 M.5,${.5-n} L1,${.5-n} M.5,${.5+n} L1,${.5+n}`},"╟":{1:(e,n)=>`M${.5-e},0 L${.5-e},1 M${.5+e},0 L${.5+e},1 M${.5+e},.5 L1,.5`},"╠":{1:(e,n)=>`M${.5-e},0 L${.5-e},1 M1,${.5+n} L${.5+e},${.5+n} L${.5+e},1 M1,${.5-n} L${.5+e},${.5-n} L${.5+e},0`},"╡":{1:(e,n)=>`M.5,0 L.5,1 M0,${.5-n} L.5,${.5-n} M0,${.5+n} L.5,${.5+n}`},"╢":{1:(e,n)=>`M0,.5 L${.5-e},.5 M${.5-e},0 L${.5-e},1 M${.5+e},0 L${.5+e},1`},"╣":{1:(e,n)=>`M${.5+e},0 L${.5+e},1 M0,${.5+n} L${.5-e},${.5+n} L${.5-e},1 M0,${.5-n} L${.5-e},${.5-n} L${.5-e},0`},"╤":{1:(e,n)=>`M0,${.5-n} L1,${.5-n} M0,${.5+n} L1,${.5+n} M.5,${.5+n} L.5,1`},"╥":{1:(e,n)=>`M0,.5 L1,.5 M${.5-e},.5 L${.5-e},1 M${.5+e},.5 L${.5+e},1`},"╦":{1:(e,n)=>`M0,${.5-n} L1,${.5-n} M0,${.5+n} L${.5-e},${.5+n} L${.5-e},1 M1,${.5+n} L${.5+e},${.5+n} L${.5+e},1`},"╧":{1:(e,n)=>`M.5,0 L.5,${.5-n} M0,${.5-n} L1,${.5-n} M0,${.5+n} L1,${.5+n}`},"╨":{1:(e,n)=>`M0,.5 L1,.5 M${.5-e},.5 L${.5-e},0 M${.5+e},.5 L${.5+e},0`},"╩":{1:(e,n)=>`M0,${.5+n} L1,${.5+n} M0,${.5-n} L${.5-e},${.5-n} L${.5-e},0 M1,${.5-n} L${.5+e},${.5-n} L${.5+e},0`},"╪":{1:(e,n)=>`M.5,0 L.5,1 M0,${.5-n} L1,${.5-n} M0,${.5+n} L1,${.5+n}`},"╫":{1:(e,n)=>`M0,.5 L1,.5 M${.5-e},0 L${.5-e},1 M${.5+e},0 L${.5+e},1`},"╬":{1:(e,n)=>`M0,${.5+n} L${.5-e},${.5+n} L${.5-e},1 M1,${.5+n} L${.5+e},${.5+n} L${.5+e},1 M0,${.5-n} L${.5-e},${.5-n} L${.5-e},0 M1,${.5-n} L${.5+e},${.5-n} L${.5+e},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:(e,n)=>`M.5,1 L.5,${.5+n/.15*.5} C.5,${.5+n/.15*.5},.5,.5,1,.5`},"╮":{1:(e,n)=>`M.5,1 L.5,${.5+n/.15*.5} C.5,${.5+n/.15*.5},.5,.5,0,.5`},"╯":{1:(e,n)=>`M.5,0 L.5,${.5-n/.15*.5} C.5,${.5-n/.15*.5},.5,.5,0,.5`},"╰":{1:(e,n)=>`M.5,0 L.5,${.5-n/.15*.5} C.5,${.5-n/.15*.5},.5,.5,1,.5`}},zl={"":{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}};zl[""]=zl[""];zl[""]=zl[""];function h8(e,n,r,a,l,f,m,c){let u=l8[n];if(u)return d8(e,u,r,a,l,f),!0;let h=c8[n];if(h)return f8(e,h,r,a,l,f),!0;let y=u8[n];if(y)return p8(e,y,r,a,l,f,c),!0;let g=zl[n];return g?(g8(e,g,r,a,l,f,m,c),!0):!1}function d8(e,n,r,a,l,f){for(let m=0;m<n.length;m++){let c=n[m],u=l/8,h=f/8;e.fillRect(r+c.x*u,a+c.y*h,c.w*u,c.h*h)}}var q1=new Map;function f8(e,n,r,a,l,f){let m=q1.get(n);m||(m=new Map,q1.set(n,m));let c=e.fillStyle;if(typeof c!="string")throw new Error(`Unexpected fillStyle type "${c}"`);let u=m.get(c);if(!u){let h=n[0].length,y=n.length,g=e.canvas.ownerDocument.createElement("canvas");g.width=h,g.height=y;let C=hn(g.getContext("2d")),E=new ImageData(h,y),A,T,p,v;if(c.startsWith("#"))A=parseInt(c.slice(1,3),16),T=parseInt(c.slice(3,5),16),p=parseInt(c.slice(5,7),16),v=c.length>7&&parseInt(c.slice(7,9),16)||1;else if(c.startsWith("rgba"))[A,T,p,v]=c.substring(5,c.length-1).split(",").map(d=>parseFloat(d));else throw new Error(`Unexpected fillStyle color format "${c}" when drawing pattern glyph`);for(let d=0;d<y;d++)for(let b=0;b<h;b++)E.data[(d*h+b)*4]=A,E.data[(d*h+b)*4+1]=T,E.data[(d*h+b)*4+2]=p,E.data[(d*h+b)*4+3]=n[d][b]*(v*255);C.putImageData(E,0,0),u=hn(e.createPattern(g,null)),m.set(c,u)}e.fillStyle=u,e.fillRect(r,a,l,f)}function p8(e,n,r,a,l,f,m){e.strokeStyle=e.fillStyle;for(let[c,u]of Object.entries(n)){e.beginPath(),e.lineWidth=m*Number.parseInt(c);let h;if(typeof u=="function"){let y=.15/f*l;h=u(.15,y)}else h=u;for(let y of h.split(" ")){let g=y[0],C=RC[g];if(!C){console.error(`Could not find drawing instructions for "${g}"`);continue}let E=y.substring(1).split(",");!E[0]||!E[1]||C(e,LC(E,l,f,r,a,!0,m))}e.stroke(),e.closePath()}}function g8(e,n,r,a,l,f,m,c){let u=new Path2D;u.rect(r,a,l,f),e.clip(u),e.beginPath();let h=m/12;e.lineWidth=c*h;for(let y of n.d.split(" ")){let g=y[0],C=RC[g];if(!C){console.error(`Could not find drawing instructions for "${g}"`);continue}let E=y.substring(1).split(",");!E[0]||!E[1]||C(e,LC(E,l,f,r,a,!1,c,(n.leftPadding??0)*(h/2),(n.rightPadding??0)*(h/2)))}n.type===1?(e.strokeStyle=e.fillStyle,e.stroke()):e.fill(),e.closePath()}function W1(e,n,r=0){return Math.max(Math.min(e,n),r)}var RC={C:(e,n)=>e.bezierCurveTo(n[0],n[1],n[2],n[3],n[4],n[5]),L:(e,n)=>e.lineTo(n[0],n[1]),M:(e,n)=>e.moveTo(n[0],n[1])};function LC(e,n,r,a,l,f,m,c=0,u=0){let h=e.map(y=>parseFloat(y)||parseInt(y));if(h.length<2)throw new Error("Too few arguments for instruction");for(let y=0;y<h.length;y+=2)h[y]*=n-c*m-u*m,f&&h[y]!==0&&(h[y]=W1(Math.round(h[y]+.5)-.5,n,0)),h[y]+=a+c*m;for(let y=1;y<h.length;y+=2)h[y]*=r,f&&h[y]!==0&&(h[y]=W1(Math.round(h[y]+.5)-.5,r,0)),h[y]+=l;return h}var G1=class{constructor(){this._data={}}set(e,n,r){this._data[e]||(this._data[e]={}),this._data[e][n]=r}get(e,n){return this._data[e]?this._data[e][n]:void 0}clear(){this._data={}}},K1=class{constructor(){this._data=new G1}set(e,n,r,a,l){this._data.get(e,n)||this._data.set(e,n,new G1),this._data.get(e,n).set(r,a,l)}get(e,n,r,a){return this._data.get(e,n)?.get(r,a)}clear(){this._data.clear()}},MC=class{constructor(){this._tasks=[],this._i=0}enqueue(e){this._tasks.push(e),this._start()}flush(){for(;this._i<this._tasks.length;)this._tasks[this._i]()||this._i++;this.clear()}clear(){this._idleCallback&&(this._cancelCallback(this._idleCallback),this._idleCallback=void 0),this._i=0,this._tasks.length=0}_start(){this._idleCallback||(this._idleCallback=this._requestCallback(this._process.bind(this)))}_process(e){this._idleCallback=void 0;let n=0,r=0,a=e.timeRemaining(),l=0;for(;this._i<this._tasks.length;){if(n=performance.now(),this._tasks[this._i]()||this._i++,n=Math.max(1,performance.now()-n),r=Math.max(n,r),l=e.timeRemaining(),r*1.5>l){a-n<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(a-n))}ms`),this._start();return}a=l}this.clear()}},m8=class extends MC{_requestCallback(e){return setTimeout(()=>e(this._createDeadline(16)))}_cancelCallback(e){clearTimeout(e)}_createDeadline(e){let n=performance.now()+e;return{timeRemaining:()=>Math.max(0,n-performance.now())}}},_8=class extends MC{_requestCallback(e){return requestIdleCallback(e)}_cancelCallback(e){cancelIdleCallback(e)}},v8=!sm&&"requestIdleCallback"in window?_8:m8,Ya=class DC{constructor(){this.fg=0,this.bg=0,this.extended=new OC}static toColorRGB(n){return[n>>>16&255,n>>>8&255,n&255]}static fromColorRGB(n){return(n[0]&255)<<16|(n[1]&255)<<8|n[2]&255}clone(){let n=new DC;return n.fg=this.fg,n.bg=this.bg,n.extended=this.extended.clone(),n}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}},OC=class NC{constructor(n=0,r=0){this._ext=0,this._urlId=0,this._ext=n,this._urlId=r}get ext(){return this._urlId?this._ext&-469762049|this.underlineStyle<<26:this._ext}set ext(n){this._ext=n}get underlineStyle(){return this._urlId?5:(this._ext&469762048)>>26}set underlineStyle(n){this._ext&=-469762049,this._ext|=n<<26&469762048}get underlineColor(){return this._ext&67108863}set underlineColor(n){this._ext&=-67108864,this._ext|=n&67108863}get urlId(){return this._urlId}set urlId(n){this._urlId=n}get underlineVariantOffset(){let n=(this._ext&3758096384)>>29;return n<0?n^4294967288:n}set underlineVariantOffset(n){this._ext&=536870911,this._ext|=n<<29&3758096384}clone(){return new NC(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}},b8=globalThis.performance&&typeof globalThis.performance.now=="function",y8=class BC{static create(n){return new BC(n)}constructor(n){this._now=b8&&n===!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}},Br;(e=>{e.None=()=>Wi.None;function n(G,I){return g(G,()=>{},0,void 0,!0,void 0,I)}e.defer=n;function r(G){return(I,K=null,te)=>{let q=!1,W;return W=G(Y=>{if(!q)return W?W.dispose():q=!0,I.call(K,Y)},null,te),q&&W.dispose(),W}}e.once=r;function a(G,I,K){return h((te,q=null,W)=>G(Y=>te.call(q,I(Y)),null,W),K)}e.map=a;function l(G,I,K){return h((te,q=null,W)=>G(Y=>{I(Y),te.call(q,Y)},null,W),K)}e.forEach=l;function f(G,I,K){return h((te,q=null,W)=>G(Y=>I(Y)&&te.call(q,Y),null,W),K)}e.filter=f;function m(G){return G}e.signal=m;function c(...G){return(I,K=null,te)=>{let q=CC(...G.map(W=>W(Y=>I.call(K,Y))));return y(q,te)}}e.any=c;function u(G,I,K,te){let q=K;return a(G,W=>(q=I(q,W),q),te)}e.reduce=u;function h(G,I){let K,te={onWillAddFirstListener(){K=G(q.fire,q)},onDidRemoveLastListener(){K?.dispose()}},q=new Dt(te);return I?.add(q),q.event}function y(G,I){return I instanceof Array?I.push(G):I&&I.add(G),G}function g(G,I,K=100,te=!1,q=!1,W,Y){let B,z,N,P=0,Z,ae={leakWarningThreshold:W,onWillAddFirstListener(){B=G(_e=>{P++,z=I(z,_e),te&&!N&&(ce.fire(z),z=void 0),Z=()=>{let Q=z;z=void 0,N=void 0,(!te||P>1)&&ce.fire(Q),P=0},typeof K=="number"?(clearTimeout(N),N=setTimeout(Z,K)):N===void 0&&(N=0,queueMicrotask(Z))})},onWillRemoveListener(){q&&P>0&&Z?.()},onDidRemoveLastListener(){Z=void 0,B.dispose()}},ce=new Dt(ae);return Y?.add(ce),ce.event}e.debounce=g;function C(G,I=0,K){return e.debounce(G,(te,q)=>te?(te.push(q),te):[q],I,void 0,!0,void 0,K)}e.accumulate=C;function E(G,I=(te,q)=>te===q,K){let te=!0,q;return f(G,W=>{let Y=te||!I(W,q);return te=!1,q=W,Y},K)}e.latch=E;function A(G,I,K){return[e.filter(G,I,K),e.filter(G,te=>!I(te),K)]}e.split=A;function T(G,I=!1,K=[],te){let q=K.slice(),W=G(z=>{q?q.push(z):B.fire(z)});te&&te.add(W);let Y=()=>{q?.forEach(z=>B.fire(z)),q=null},B=new Dt({onWillAddFirstListener(){W||(W=G(z=>B.fire(z)),te&&te.add(W))},onDidAddFirstListener(){q&&(I?setTimeout(Y):Y())},onDidRemoveLastListener(){W&&W.dispose(),W=null}});return te&&te.add(B),B.event}e.buffer=T;function p(G,I){return(K,te,q)=>{let W=I(new d);return G(function(Y){let B=W.evaluate(Y);B!==v&&K.call(te,B)},void 0,q)}}e.chain=p;let v=Symbol("HaltChainable");class d{constructor(){this.steps=[]}map(I){return this.steps.push(I),this}forEach(I){return this.steps.push(K=>(I(K),K)),this}filter(I){return this.steps.push(K=>I(K)?K:v),this}reduce(I,K){let te=K;return this.steps.push(q=>(te=I(te,q),te)),this}latch(I=(K,te)=>K===te){let K=!0,te;return this.steps.push(q=>{let W=K||!I(q,te);return K=!1,te=q,W?q:v}),this}evaluate(I){for(let K of this.steps)if(I=K(I),I===v)break;return I}}function b(G,I,K=te=>te){let te=(...B)=>Y.fire(K(...B)),q=()=>G.on(I,te),W=()=>G.removeListener(I,te),Y=new Dt({onWillAddFirstListener:q,onDidRemoveLastListener:W});return Y.event}e.fromNodeEventEmitter=b;function x(G,I,K=te=>te){let te=(...B)=>Y.fire(K(...B)),q=()=>G.addEventListener(I,te),W=()=>G.removeEventListener(I,te),Y=new Dt({onWillAddFirstListener:q,onDidRemoveLastListener:W});return Y.event}e.fromDOMEventEmitter=x;function L(G){return new Promise(I=>r(G)(I))}e.toPromise=L;function R(G){let I=new Dt;return G.then(K=>{I.fire(K)},()=>{I.fire(void 0)}).finally(()=>{I.dispose()}),I.event}e.fromPromise=R;function M(G,I){return G(K=>I.fire(K))}e.forward=M;function k(G,I,K){return I(K),G(te=>I(te))}e.runAndSubscribe=k;class O{constructor(I,K){this._observable=I,this._counter=0,this._hasChanged=!1;let te={onWillAddFirstListener:()=>{I.addObserver(this)},onDidRemoveLastListener:()=>{I.removeObserver(this)}};this.emitter=new Dt(te),K&&K.add(this.emitter)}beginUpdate(I){this._counter++}handlePossibleChange(I){}handleChange(I,K){this._hasChanged=!0}endUpdate(I){this._counter--,this._counter===0&&(this._observable.reportChanges(),this._hasChanged&&(this._hasChanged=!1,this.emitter.fire(this._observable.get())))}}function U(G,I){return new O(G,I).emitter.event}e.fromObservable=U;function F(G){return(I,K,te)=>{let q=0,W=!1,Y={beginUpdate(){q++},endUpdate(){q--,q===0&&(G.reportChanges(),W&&(W=!1,I.call(K)))},handlePossibleChange(){},handleChange(){W=!0}};G.addObserver(Y),G.reportChanges();let B={dispose(){G.removeObserver(Y)}};return te instanceof no?te.add(B):Array.isArray(te)&&te.push(B),B}}e.fromObservableLight=F})(Br||={});var pg=class gg{constructor(n){this.listenerCount=0,this.invocationCount=0,this.elapsedOverall=0,this.durations=[],this.name=`${n}_${gg._idPool++}`,gg.all.add(this)}start(n){this._stopWatch=new y8,this.listenerCount=n}stop(){if(this._stopWatch){let n=this._stopWatch.elapsed();this.durations.push(n),this.elapsedOverall+=n,this.invocationCount+=1,this._stopWatch=void 0}}};pg.all=new Set,pg._idPool=0;var S8=pg,w8=-1,IC=class jC{constructor(n,r,a=(jC._idPool++).toString(16).padStart(3,"0")){this._errorHandler=n,this.threshold=r,this.name=a,this._warnCountdown=0}dispose(){this._stacks?.clear()}check(n,r){let a=this.threshold;if(a<=0||r<a)return;this._stacks||(this._stacks=new Map);let l=this._stacks.get(n.value)||0;if(this._stacks.set(n.value,l+1),this._warnCountdown-=1,this._warnCountdown<=0){this._warnCountdown=a*.5;let[f,m]=this.getMostFrequentStack(),c=`[${this.name}] potential listener LEAK detected, having ${r} listeners already. MOST frequent listener (${m}):`;console.warn(c),console.warn(f);let u=new E8(c,f);this._errorHandler(u)}return()=>{let f=this._stacks.get(n.value)||0;this._stacks.set(n.value,f-1)}}getMostFrequentStack(){if(!this._stacks)return;let n,r=0;for(let[a,l]of this._stacks)(!n||r<l)&&(n=[a,l],r=l);return n}};IC._idPool=1;var C8=IC,x8=class zC{constructor(n){this.value=n}static create(){let n=new Error;return new zC(n.stack??"")}print(){console.warn(this.value.split(`
|
|
710
|
+
`).slice(2).join(`
|
|
711
|
+
`))}},E8=class extends Error{constructor(e,n){super(e),this.name="ListenerLeakError",this.stack=n}},T8=class extends Error{constructor(e,n){super(e),this.name="ListenerRefusalError",this.stack=n}},A8=0,tp=class{constructor(e){this.value=e,this.id=A8++}},k8=2,R8,Dt=class{constructor(e){this._size=0,this._options=e,this._leakageMon=this._options?.leakWarningThreshold?new C8(e?.onListenerError??Qf,this._options?.leakWarningThreshold??w8):void 0,this._perfMon=this._options?._profName?new S8(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??=(e,n,r)=>{if(this._leakageMon&&this._size>this._leakageMon.threshold**2){let m=`[${this._leakageMon.name}] REFUSES to accept new listeners because it exceeded its threshold by far (${this._size} vs ${this._leakageMon.threshold})`;console.warn(m);let c=this._leakageMon.getMostFrequentStack()??["UNKNOWN stack",-1],u=new T8(`${m}. HINT: Stack shows most frequent listener (${c[1]}-times)`,c[0]);return(this._options?.onListenerError||Qf)(u),Wi.None}if(this._disposed)return Wi.None;n&&(e=e.bind(n));let a=new tp(e),l;this._leakageMon&&this._size>=Math.ceil(this._leakageMon.threshold*.2)&&(a.stack=x8.create(),l=this._leakageMon.check(a.stack,this._size+1)),this._listeners?this._listeners instanceof tp?(this._deliveryQueue??=new L8,this._listeners=[this._listeners,a]):this._listeners.push(a):(this._options?.onWillAddFirstListener?.(this),this._listeners=a,this._options?.onDidAddFirstListener?.(this)),this._size++;let f=On(()=>{l?.(),this._removeListener(a)});return r instanceof no?r.add(f):Array.isArray(r)&&r.push(f),f},this._event}_removeListener(e){if(this._options?.onWillRemoveListener?.(this),!this._listeners)return;if(this._size===1){this._listeners=void 0,this._options?.onDidRemoveLastListener?.(this),this._size=0;return}let n=this._listeners,r=n.indexOf(e);if(r===-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--,n[r]=void 0;let a=this._deliveryQueue.current===this;if(this._size*k8<=n.length){let l=0;for(let f=0;f<n.length;f++)n[f]?n[l++]=n[f]:a&&(this._deliveryQueue.end--,l<this._deliveryQueue.i&&this._deliveryQueue.i--);n.length=l}}_deliver(e,n){if(!e)return;let r=this._options?.onListenerError||Qf;if(!r){e.value(n);return}try{e.value(n)}catch(a){r(a)}}_deliverQueue(e){let n=e.current._listeners;for(;e.i<e.end;)this._deliver(n[e.i++],e.value);e.reset()}fire(e){if(this._deliveryQueue?.current&&(this._deliverQueue(this._deliveryQueue),this._perfMon?.stop()),this._perfMon?.start(this._size),this._listeners)if(this._listeners instanceof tp)this._deliver(this._listeners,e);else{let n=this._deliveryQueue;n.enqueue(this,e,this._listeners.length),this._deliverQueue(n)}this._perfMon?.stop()}hasListeners(){return this._size>0}},L8=class{constructor(){this.i=-1,this.end=0}enqueue(e,n,r){this.i=0,this.end=r,this.current=e,this.value=n}reset(){this.i=this.end,this.current=void 0,this.value=void 0}},V1={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}},_l=2,vl,gs=class Ga{constructor(n,r,a){this._document=n,this._config=r,this._unicodeService=a,this._didWarmUp=!1,this._cacheMap=new K1,this._cacheMapCombined=new K1,this._pages=[],this._activePages=[],this._workBoundingBox={top:0,left:0,bottom:0,right:0},this._workAttributeData=new Ya,this._textureSize=512,this._onAddTextureAtlasCanvas=new Dt,this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event,this._onRemoveTextureAtlasCanvas=new Dt,this.onRemoveTextureAtlasCanvas=this._onRemoveTextureAtlasCanvas.event,this._requestClearModel=!1,this._createNewPage(),this._tmpCanvas=$C(n,this._config.deviceCellWidth*4+_l*2,this._config.deviceCellHeight+_l*2),this._tmpCtx=hn(this._tmpCanvas.getContext("2d",{alpha:this._config.allowTransparency,willReadFrequently:!0}))}get pages(){return this._pages}dispose(){this._tmpCanvas.remove();for(let n of this.pages)n.canvas.remove();this._onAddTextureAtlasCanvas.dispose()}warmUp(){this._didWarmUp||(this._doWarmUp(),this._didWarmUp=!0)}_doWarmUp(){let n=new v8;for(let r=33;r<126;r++)n.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 n of this._pages)n.clear();this._cacheMap.clear(),this._cacheMapCombined.clear(),this._didWarmUp=!1}}_createNewPage(){if(Ga.maxAtlasPages&&this._pages.length>=Math.max(4,Ga.maxAtlasPages)){let r=this._pages.filter(h=>h.canvas.width*2<=(Ga.maxTextureSize||4096)).sort((h,y)=>y.canvas.width!==h.canvas.width?y.canvas.width-h.canvas.width:y.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 f=r.slice(a,a+4),m=f.map(h=>h.glyphs[0].texturePage).sort((h,y)=>h>y?1:-1),c=this.pages.length-f.length,u=this._mergePages(f,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 n=new np(this._document,this._textureSize);return this._pages.push(n),this._activePages.push(n),this._onAddTextureAtlasCanvas.fire(n.canvas),n}_mergePages(n,r){let a=n[0].canvas.width*2,l=new np(this._document,a,n);for(let[f,m]of n.entries()){let c=f*m.canvas.width%a,u=Math.floor(f/2)*m.canvas.height;l.ctx.drawImage(m.canvas,c,u);for(let y of m.glyphs)y.texturePage=r,y.sizeClipSpace.x=y.size.x/a,y.sizeClipSpace.y=y.size.y/a,y.texturePosition.x+=c,y.texturePosition.y+=u,y.texturePositionClipSpace.x=y.texturePosition.x/a,y.texturePositionClipSpace.y=y.texturePosition.y/a;this._onRemoveTextureAtlasCanvas.fire(m.canvas);let h=this._activePages.indexOf(m);h!==-1&&this._activePages.splice(h,1)}return l}_deletePage(n){this._pages.splice(n,1);for(let r=n;r<this._pages.length;r++){let a=this._pages[r];for(let l of a.glyphs)l.texturePage--;a.version++}}getRasterizedGlyphCombinedChar(n,r,a,l,f,m){return this._getFromCacheMap(this._cacheMapCombined,n,r,a,l,f,m)}getRasterizedGlyph(n,r,a,l,f,m){return this._getFromCacheMap(this._cacheMap,n,r,a,l,f,m)}_getFromCacheMap(n,r,a,l,f,m,c){return vl=n.get(r,a,l,f),vl||(vl=this._drawToCache(r,a,l,f,m,c),n.set(r,a,l,f,vl)),vl}_getColorFromAnsiIndex(n){if(n>=this._config.colors.ansi.length)throw new Error("No color found for idx "+n);return this._config.colors.ansi[n]}_getBackgroundColor(n,r,a,l){if(this._config.allowTransparency)return Ei;let f;switch(n){case 16777216:case 33554432:f=this._getColorFromAnsiIndex(r);break;case 50331648:let m=Ya.toColorRGB(r);f=zn.toColor(m[0],m[1],m[2]);break;default:a?f=xl.opaque(this._config.colors.foreground):f=this._config.colors.background;break}return this._config.allowTransparency||(f=xl.opaque(f)),f}_getForegroundColor(n,r,a,l,f,m,c,u,h,y){let g=this._getMinimumContrastColor(n,r,a,l,f,m,c,h,u,y);if(g)return g;let C;switch(f){case 16777216:case 33554432:this._config.drawBoldTextInBrightColors&&h&&m<8&&(m+=8),C=this._getColorFromAnsiIndex(m);break;case 50331648:let E=Ya.toColorRGB(m);C=zn.toColor(E[0],E[1],E[2]);break;default:c?C=this._config.colors.background:C=this._config.colors.foreground}return this._config.allowTransparency&&(C=xl.opaque(C)),u&&(C=xl.multiplyOpacity(C,o8)),C}_resolveBackgroundRgba(n,r,a){switch(n){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(n,r,a,l){switch(n){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(n,r,a,l,f,m,c,u,h,y){if(this._config.minimumContrastRatio===1||y)return;let g=this._getContrastCache(h),C=g.getColor(n,l);if(C!==void 0)return C||void 0;let E=this._resolveBackgroundRgba(r,a,c),A=this._resolveForegroundRgba(f,m,c,u),T=Xs.ensureContrastRatio(E,A,this._config.minimumContrastRatio/(h?2:1));if(!T){g.setColor(n,l,null);return}let p=zn.toColor(T>>24&255,T>>16&255,T>>8&255);return g.setColor(n,l,p),p}_getContrastCache(n){return n?this._config.colors.halfContrastCache:this._config.colors.contrastCache}_drawToCache(n,r,a,l,f,m){let c=typeof n=="number"?String.fromCharCode(n):n;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)+_l*2,this._config.deviceMaxTextureSize);this._tmpCanvas.width<u&&(this._tmpCanvas.width=u);let h=Math.min(this._config.deviceCellHeight+_l*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 V1;let y=!!this._workAttributeData.isBold(),g=!!this._workAttributeData.isInverse(),C=!!this._workAttributeData.isDim(),E=!!this._workAttributeData.isItalic(),A=!!this._workAttributeData.isUnderline(),T=!!this._workAttributeData.isStrikethrough(),p=!!this._workAttributeData.isOverline(),v=this._workAttributeData.getFgColor(),d=this._workAttributeData.getFgColorMode(),b=this._workAttributeData.getBgColor(),x=this._workAttributeData.getBgColorMode();if(g){let z=v;v=b,b=z;let N=d;d=x,x=N}let L=this._getBackgroundColor(x,b,g,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=y?this._config.fontWeightBold:this._config.fontWeight,M=E?"italic":"";this._tmpCtx.font=`${M} ${R} ${this._config.fontSize*this._config.devicePixelRatio}px ${this._config.fontFamily}`,this._tmpCtx.textBaseline=kC;let k=c.length===1&&am(c.charCodeAt(0)),O=c.length===1&&QO(c.charCodeAt(0)),U=this._getForegroundColor(r,x,b,a,d,v,g,C,y,AC(c.charCodeAt(0)));this._tmpCtx.fillStyle=U.css;let F=O?0:_l*2,G=!1;this._config.customGlyphs!==!1&&(G=h8(this._tmpCtx,c,F,F,this._config.deviceCellWidth,this._config.deviceCellHeight,this._config.fontSize,this._config.devicePixelRatio));let I=!k,K;if(typeof n=="number"?K=this._unicodeService.wcwidth(n):K=this._unicodeService.getStringCellWidth(n),A){this._tmpCtx.save();let z=Math.max(1,Math.floor(this._config.fontSize*this._config.devicePixelRatio/15)),N=z%2===1?.5:0;if(this._tmpCtx.lineWidth=z,this._workAttributeData.isUnderlineColorDefault())this._tmpCtx.strokeStyle=this._tmpCtx.fillStyle;else if(this._workAttributeData.isUnderlineColorRGB())I=!1,this._tmpCtx.strokeStyle=`rgb(${Ya.toColorRGB(this._workAttributeData.getUnderlineColor()).join(",")})`;else{I=!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 P=F,Z=Math.ceil(F+this._config.deviceCharHeight)-N-(f?z*2:0),ae=Z+z,ce=Z+z*2,_e=this._workAttributeData.getUnderlineVariantOffset();for(let Q=0;Q<K;Q++){this._tmpCtx.save();let $=P+Q*this._config.deviceCellWidth,oe=P+(Q+1)*this._config.deviceCellWidth,ge=$+this._config.deviceCellWidth/2;switch(this._workAttributeData.extended.underlineStyle){case 2:this._tmpCtx.moveTo($,Z),this._tmpCtx.lineTo(oe,Z),this._tmpCtx.moveTo($,ce),this._tmpCtx.lineTo(oe,ce);break;case 3:let Se=z<=1?ce:Math.ceil(F+this._config.deviceCharHeight-z/2)-N,ye=z<=1?Z:Math.ceil(F+this._config.deviceCharHeight+z/2)-N,$e=new Path2D;$e.rect($,Z,this._config.deviceCellWidth,ce-Z),this._tmpCtx.clip($e),this._tmpCtx.moveTo($-this._config.deviceCellWidth/2,ae),this._tmpCtx.bezierCurveTo($-this._config.deviceCellWidth/2,ye,$,ye,$,ae),this._tmpCtx.bezierCurveTo($,Se,ge,Se,ge,ae),this._tmpCtx.bezierCurveTo(ge,ye,oe,ye,oe,ae),this._tmpCtx.bezierCurveTo(oe,Se,oe+this._config.deviceCellWidth/2,Se,oe+this._config.deviceCellWidth/2,ae);break;case 4:let Fe=_e===0?0:_e>=z?z*2-_e:z-_e;_e>=z||Fe===0?(this._tmpCtx.setLineDash([Math.round(z),Math.round(z)]),this._tmpCtx.moveTo($+Fe,Z),this._tmpCtx.lineTo(oe,Z)):(this._tmpCtx.setLineDash([Math.round(z),Math.round(z)]),this._tmpCtx.moveTo($,Z),this._tmpCtx.lineTo($+Fe,Z),this._tmpCtx.moveTo($+Fe+z,Z),this._tmpCtx.lineTo(oe,Z)),_e=s8(oe-$,z,_e);break;case 5:let Xe=.6,xt=.3,Ne=oe-$,en=Math.floor(Xe*Ne),bn=Math.floor(xt*Ne),yn=Ne-en-bn;this._tmpCtx.setLineDash([en,bn,yn]),this._tmpCtx.moveTo($,Z),this._tmpCtx.lineTo(oe,Z);break;default:this._tmpCtx.moveTo($,Z),this._tmpCtx.lineTo(oe,Z);break}this._tmpCtx.stroke(),this._tmpCtx.restore()}if(this._tmpCtx.restore(),!G&&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(P,Z-Math.ceil(z/2),this._config.deviceCellWidth*K,ce-Z+Math.ceil(z/2)),this._tmpCtx.clip($),this._tmpCtx.lineWidth=this._config.devicePixelRatio*3,this._tmpCtx.strokeStyle=L.css,this._tmpCtx.strokeText(c,F,F+this._config.deviceCharHeight),this._tmpCtx.restore()}}}if(p){let z=Math.max(1,Math.floor(this._config.fontSize*this._config.devicePixelRatio/15)),N=z%2===1?.5:0;this._tmpCtx.lineWidth=z,this._tmpCtx.strokeStyle=this._tmpCtx.fillStyle,this._tmpCtx.beginPath(),this._tmpCtx.moveTo(F,F+N),this._tmpCtx.lineTo(F+this._config.deviceCharWidth*K,F+N),this._tmpCtx.stroke()}if(G||this._tmpCtx.fillText(c,F,F+this._config.deviceCharHeight),c==="_"&&!this._config.allowTransparency){let z=ip(this._tmpCtx.getImageData(F,F,this._config.deviceCellWidth,this._config.deviceCellHeight),L,U,I);if(z)for(let N=1;N<=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,F,F+this._config.deviceCharHeight-N),z=ip(this._tmpCtx.getImageData(F,F,this._config.deviceCellWidth,this._config.deviceCellHeight),L,U,I),!!z);N++);}if(T){let z=Math.max(1,Math.floor(this._config.fontSize*this._config.devicePixelRatio/10)),N=this._tmpCtx.lineWidth%2===1?.5:0;this._tmpCtx.lineWidth=z,this._tmpCtx.strokeStyle=this._tmpCtx.fillStyle,this._tmpCtx.beginPath(),this._tmpCtx.moveTo(F,F+Math.floor(this._config.deviceCharHeight/2)-N),this._tmpCtx.lineTo(F+this._config.deviceCharWidth*K,F+Math.floor(this._config.deviceCharHeight/2)-N),this._tmpCtx.stroke()}this._tmpCtx.restore();let te=this._tmpCtx.getImageData(0,0,this._tmpCanvas.width,this._tmpCanvas.height),q;if(this._config.allowTransparency?q=M8(te):q=ip(te,L,U,I),q)return V1;let W=this._findGlyphBoundingBox(te,this._workBoundingBox,u,O,G,F),Y,B;for(;;){if(this._activePages.length===0){let z=this._createNewPage();Y=z,B=z.currentRow,B.height=W.size.y;break}Y=this._activePages[this._activePages.length-1],B=Y.currentRow;for(let z of this._activePages)W.size.y<=z.currentRow.height&&(Y=z,B=z.currentRow);for(let z=this._activePages.length-1;z>=0;z--)for(let N of this._activePages[z].fixedRows)N.height<=B.height&&W.size.y<=N.height&&(Y=this._activePages[z],B=N);if(W.size.x>this._textureSize){this._overflowSizePage||(this._overflowSizePage=new np(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+W.size.x>=Y.canvas.width&&(B.x=0,B.y+=B.height,B.height=0);break}if(B.y+W.size.y>=Y.canvas.height||B.height>W.size.y+2){let z=!1;if(Y.currentRow.y+Y.currentRow.height+W.size.y>=Y.canvas.height){let N;for(let P of this._activePages)if(P.currentRow.y+P.currentRow.height+W.size.y<P.canvas.height){N=P;break}if(N)Y=N;else if(Ga.maxAtlasPages&&this._pages.length>=Ga.maxAtlasPages&&B.y+W.size.y<=Y.canvas.height&&B.height>=W.size.y&&B.x+W.size.x<=Y.canvas.width)z=!0;else{let P=this._createNewPage();Y=P,B=P.currentRow,B.height=W.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:W.size.y},Y.fixedRows.push(B),Y.currentRow={x:0,y:B.y+B.height,height:0})}if(B.x+W.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 W.texturePage=this._pages.indexOf(Y),W.texturePosition.x=B.x,W.texturePosition.y=B.y,W.texturePositionClipSpace.x=B.x/Y.canvas.width,W.texturePositionClipSpace.y=B.y/Y.canvas.height,W.sizeClipSpace.x/=Y.canvas.width,W.sizeClipSpace.y/=Y.canvas.height,B.height=Math.max(B.height,W.size.y),B.x+=W.size.x,Y.ctx.putImageData(te,W.texturePosition.x-this._workBoundingBox.left,W.texturePosition.y-this._workBoundingBox.top,this._workBoundingBox.left,this._workBoundingBox.top,W.size.x,W.size.y),Y.addGlyph(W),Y.version++,W}_findGlyphBoundingBox(n,r,a,l,f,m){r.top=0;let c=l?this._config.deviceCellHeight:this._tmpCanvas.height,u=l?this._config.deviceCellWidth:a,h=!1;for(let y=0;y<c;y++){for(let g=0;g<u;g++){let C=y*this._tmpCanvas.width*4+g*4+3;if(n.data[C]!==0){r.top=y,h=!0;break}}if(h)break}r.left=0,h=!1;for(let y=0;y<m+u;y++){for(let g=0;g<c;g++){let C=g*this._tmpCanvas.width*4+y*4+3;if(n.data[C]!==0){r.left=y,h=!0;break}}if(h)break}r.right=u,h=!1;for(let y=m+u-1;y>=m;y--){for(let g=0;g<c;g++){let C=g*this._tmpCanvas.width*4+y*4+3;if(n.data[C]!==0){r.right=y,h=!0;break}}if(h)break}r.bottom=c,h=!1;for(let y=c-1;y>=0;y--){for(let g=0;g<u;g++){let C=y*this._tmpCanvas.width*4+g*4+3;if(n.data[C]!==0){r.bottom=y,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||f?Math.floor((this._config.deviceCellWidth-this._config.deviceCharWidth)/2):0),y:-r.top+m+(l||f?this._config.lineHeight===1?0:Math.round((this._config.deviceCellHeight-this._config.deviceCharHeight)/2):0)}}}},np=class{constructor(e,n,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=$C(e,n,n),this.ctx=hn(this.canvas.getContext("2d",{alpha:!0}))}get percentageUsed(){return this._usedPixels/(this.canvas.width*this.canvas.height)}get glyphs(){return this._glyphs}addGlyph(e){this._glyphs.push(e),this._usedPixels+=e.size.x*e.size.y}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 ip(e,n,r,a){let l=n.rgba>>>24,f=n.rgba>>>16&255,m=n.rgba>>>8&255,c=r.rgba>>>24,u=r.rgba>>>16&255,h=r.rgba>>>8&255,y=Math.floor((Math.abs(l-c)+Math.abs(f-u)+Math.abs(m-h))/12),g=!0;for(let C=0;C<e.data.length;C+=4)e.data[C]===l&&e.data[C+1]===f&&e.data[C+2]===m||a&&Math.abs(e.data[C]-l)+Math.abs(e.data[C+1]-f)+Math.abs(e.data[C+2]-m)<y?e.data[C+3]=0:g=!1;return g}function M8(e){for(let n=0;n<e.data.length;n+=4)if(e.data[n+3]>0)return!1;return!0}function $C(e,n,r){let a=e.createElement("canvas");return a.width=n,a.height=r,a}function D8(e,n,r,a,l,f,m,c){let u={foreground:f.foreground,background:f.background,cursor:Ei,cursorAccent:Ei,selectionForeground:Ei,selectionBackgroundTransparent:Ei,selectionBackgroundOpaque:Ei,selectionInactiveBackgroundTransparent:Ei,selectionInactiveBackgroundOpaque:Ei,overviewRulerBorder:Ei,scrollbarSliderBackground:Ei,scrollbarSliderHoverBackground:Ei,scrollbarSliderActiveBackground:Ei,ansi:f.ansi.slice(),contrastCache:f.contrastCache,halfContrastCache:f.halfContrastCache};return{customGlyphs:l.customGlyphs,devicePixelRatio:m,deviceMaxTextureSize:c,letterSpacing:l.letterSpacing,lineHeight:l.lineHeight,deviceCellWidth:e,deviceCellHeight:n,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 Y1(e,n){for(let r=0;r<e.colors.ansi.length;r++)if(e.colors.ansi[r].rgba!==n.colors.ansi[r].rgba)return!1;return e.devicePixelRatio===n.devicePixelRatio&&e.customGlyphs===n.customGlyphs&&e.lineHeight===n.lineHeight&&e.letterSpacing===n.letterSpacing&&e.fontFamily===n.fontFamily&&e.fontSize===n.fontSize&&e.fontWeight===n.fontWeight&&e.fontWeightBold===n.fontWeightBold&&e.allowTransparency===n.allowTransparency&&e.deviceCharWidth===n.deviceCharWidth&&e.deviceCharHeight===n.deviceCharHeight&&e.drawBoldTextInBrightColors===n.drawBoldTextInBrightColors&&e.minimumContrastRatio===n.minimumContrastRatio&&e.colors.foreground.rgba===n.colors.foreground.rgba&&e.colors.background.rgba===n.colors.background.rgba}function O8(e){return(e&50331648)===16777216||(e&50331648)===33554432}var ki=[];function PC(e,n,r,a,l,f,m,c,u){let h=D8(a,l,f,m,n,r,c,u);for(let C=0;C<ki.length;C++){let E=ki[C],A=E.ownedBy.indexOf(e);if(A>=0){if(Y1(E.config,h))return E.atlas;E.ownedBy.length===1?(E.atlas.dispose(),ki.splice(C,1)):E.ownedBy.splice(A,1);break}}for(let C=0;C<ki.length;C++){let E=ki[C];if(Y1(E.config,h))return E.ownedBy.push(e),E.atlas}let y=e._core,g={atlas:new gs(document,h,y.unicodeService),config:h,ownedBy:[e]};return ki.push(g),g.atlas}function X1(e){for(let n=0;n<ki.length;n++){let r=ki[n].ownedBy.indexOf(e);if(r!==-1){ki[n].ownedBy.length===1?(ki[n].atlas.dispose(),ki.splice(n,1)):ki[n].ownedBy.splice(r,1);break}}}var yu=600,N8=class{constructor(e,n){this._renderCallback=e,this._coreBrowserService=n,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(e=yu){this._blinkInterval&&(this._coreBrowserService.window.clearInterval(this._blinkInterval),this._blinkInterval=void 0),this._blinkStartTimeout=this._coreBrowserService.window.setTimeout(()=>{if(this._animationTimeRestarted){let n=yu-(Date.now()-this._animationTimeRestarted);if(this._animationTimeRestarted=void 0,n>0){this._restartInterval(n);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 n=yu-(Date.now()-this._animationTimeRestarted);this._animationTimeRestarted=void 0,this._restartInterval(n);return}this.isCursorVisible=!this.isCursorVisible,this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>{this._renderCallback(),this._animationFrame=void 0})},yu)},e)}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 Z1(e,n,r){let a=new n.ResizeObserver(l=>{let f=l.find(u=>u.target===e);if(!f)return;if(!("devicePixelContentBoxSize"in f)){a?.disconnect(),a=void 0;return}let m=f.devicePixelContentBoxSize[0].inlineSize,c=f.devicePixelContentBoxSize[0].blockSize;m>0&&c>0&&r(m,c)});try{a.observe(e,{box:["device-pixel-content-box"]})}catch{a.disconnect(),a=void 0}return On(()=>a?.disconnect())}function B8(e){return e>65535?(e-=65536,String.fromCharCode((e>>10)+55296)+String.fromCharCode(e%1024+56320)):String.fromCharCode(e)}var J1=class HC extends Ya{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new OC,this.combinedData=""}static fromCharData(n){let r=new HC;return r.setFromCharData(n),r}isCombined(){return this.content&2097152}getWidth(){return this.content>>22}getChars(){return this.content&2097152?this.combinedData:this.content&2097151?B8(this.content&2097151):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):this.content&2097151}setFromCharData(n){this.fg=n[0],this.bg=0;let r=!1;if(n[1].length>2)r=!0;else if(n[1].length===2){let a=n[1].charCodeAt(0);if(55296<=a&&a<=56319){let l=n[1].charCodeAt(1);56320<=l&&l<=57343?this.content=(a-55296)*1024+l-56320+65536|n[2]<<22:r=!0}else r=!0}else this.content=n[1].charCodeAt(0)|n[2]<<22;r&&(this.combinedData=n[1],this.content=2097152|n[2]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}},UC=new Float32Array([2,0,0,0,0,-2,0,0,0,0,1,0,-1,1,0,1]);function FC(e,n,r){let a=hn(e.createProgram());if(e.attachShader(a,hn(Q1(e,e.VERTEX_SHADER,n))),e.attachShader(a,hn(Q1(e,e.FRAGMENT_SHADER,r))),e.linkProgram(a),e.getProgramParameter(a,e.LINK_STATUS))return a;console.error(e.getProgramInfoLog(a)),e.deleteProgram(a)}function Q1(e,n,r){let a=hn(e.createShader(n));if(e.shaderSource(a,r),e.compileShader(a),e.getShaderParameter(a,e.COMPILE_STATUS))return a;console.error(e.getShaderInfoLog(a)),e.deleteShader(a)}function I8(e,n){let r=Math.min(e.length*2,n),a=new Float32Array(r);for(let l=0;l<e.length;l++)a[l]=e[l];return a}var j8=class{constructor(e){this.texture=e,this.version=-1}},z8=`#version 300 es
|
|
712
|
+
layout (location = 0) in vec2 a_unitquad;
|
|
713
|
+
layout (location = 1) in vec2 a_cellpos;
|
|
714
|
+
layout (location = 2) in vec2 a_offset;
|
|
715
|
+
layout (location = 3) in vec2 a_size;
|
|
716
|
+
layout (location = 4) in float a_texpage;
|
|
717
|
+
layout (location = 5) in vec2 a_texcoord;
|
|
718
|
+
layout (location = 6) in vec2 a_texsize;
|
|
719
|
+
|
|
720
|
+
uniform mat4 u_projection;
|
|
721
|
+
uniform vec2 u_resolution;
|
|
722
|
+
|
|
723
|
+
out vec2 v_texcoord;
|
|
724
|
+
flat out int v_texpage;
|
|
725
|
+
|
|
726
|
+
void main() {
|
|
727
|
+
vec2 zeroToOne = (a_offset / u_resolution) + a_cellpos + (a_unitquad * a_size);
|
|
728
|
+
gl_Position = u_projection * vec4(zeroToOne, 0.0, 1.0);
|
|
729
|
+
v_texpage = int(a_texpage);
|
|
730
|
+
v_texcoord = a_texcoord + a_unitquad * a_texsize;
|
|
731
|
+
}`;function $8(e){let n="";for(let r=1;r<e;r++)n+=` else if (v_texpage == ${r}) { outColor = texture(u_texture[${r}], v_texcoord); }`;return`#version 300 es
|
|
732
|
+
precision lowp float;
|
|
733
|
+
|
|
734
|
+
in vec2 v_texcoord;
|
|
735
|
+
flat in int v_texpage;
|
|
736
|
+
|
|
737
|
+
uniform sampler2D u_texture[${e}];
|
|
738
|
+
|
|
739
|
+
out vec4 outColor;
|
|
740
|
+
|
|
741
|
+
void main() {
|
|
742
|
+
if (v_texpage == 0) {
|
|
743
|
+
outColor = texture(u_texture[0], v_texcoord);
|
|
744
|
+
} ${n}
|
|
745
|
+
}`}var ms=11,Ua=ms*Float32Array.BYTES_PER_ELEMENT,P8=2,Wt=0,Mt,rp=0,bl=0,H8=class extends Wi{constructor(e,n,r,a){super(),this._terminal=e,this._gl=n,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;gs.maxAtlasPages===void 0&&(gs.maxAtlasPages=Math.min(32,hn(l.getParameter(l.MAX_TEXTURE_IMAGE_UNITS))),gs.maxTextureSize=hn(l.getParameter(l.MAX_TEXTURE_SIZE))),this._program=hn(FC(l,z8,$8(gs.maxAtlasPages))),this._register(On(()=>l.deleteProgram(this._program))),this._projectionLocation=hn(l.getUniformLocation(this._program,"u_projection")),this._resolutionLocation=hn(l.getUniformLocation(this._program,"u_resolution")),this._textureLocation=hn(l.getUniformLocation(this._program,"u_texture")),this._vertexArrayObject=l.createVertexArray(),l.bindVertexArray(this._vertexArrayObject);let f=new Float32Array([0,0,1,0,0,1,1,1]),m=l.createBuffer();this._register(On(()=>l.deleteBuffer(m))),l.bindBuffer(l.ARRAY_BUFFER,m),l.bufferData(l.ARRAY_BUFFER,f,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(On(()=>l.deleteBuffer(u))),l.bindBuffer(l.ELEMENT_ARRAY_BUFFER,u),l.bufferData(l.ELEMENT_ARRAY_BUFFER,c,l.STATIC_DRAW),this._attributesBuffer=hn(l.createBuffer()),this._register(On(()=>l.deleteBuffer(this._attributesBuffer))),l.bindBuffer(l.ARRAY_BUFFER,this._attributesBuffer),l.enableVertexAttribArray(2),l.vertexAttribPointer(2,2,l.FLOAT,!1,Ua,0),l.vertexAttribDivisor(2,1),l.enableVertexAttribArray(3),l.vertexAttribPointer(3,2,l.FLOAT,!1,Ua,2*Float32Array.BYTES_PER_ELEMENT),l.vertexAttribDivisor(3,1),l.enableVertexAttribArray(4),l.vertexAttribPointer(4,1,l.FLOAT,!1,Ua,4*Float32Array.BYTES_PER_ELEMENT),l.vertexAttribDivisor(4,1),l.enableVertexAttribArray(5),l.vertexAttribPointer(5,2,l.FLOAT,!1,Ua,5*Float32Array.BYTES_PER_ELEMENT),l.vertexAttribDivisor(5,1),l.enableVertexAttribArray(6),l.vertexAttribPointer(6,2,l.FLOAT,!1,Ua,7*Float32Array.BYTES_PER_ELEMENT),l.vertexAttribDivisor(6,1),l.enableVertexAttribArray(1),l.vertexAttribPointer(1,2,l.FLOAT,!1,Ua,9*Float32Array.BYTES_PER_ELEMENT),l.vertexAttribDivisor(1,1),l.useProgram(this._program);let h=new Int32Array(gs.maxAtlasPages);for(let y=0;y<gs.maxAtlasPages;y++)h[y]=y;l.uniform1iv(this._textureLocation,h),l.uniformMatrix4fv(this._projectionLocation,!1,UC),this._atlasTextures=[];for(let y=0;y<gs.maxAtlasPages;y++){let g=new j8(hn(l.createTexture()));this._register(On(()=>l.deleteTexture(g.texture))),l.activeTexture(l.TEXTURE0+y),l.bindTexture(l.TEXTURE_2D,g.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[y]=g}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(e,n,r,a,l,f,m,c,u){this._updateCell(this._vertices.attributes,e,n,r,a,l,f,m,c,u)}_updateCell(e,n,r,a,l,f,m,c,u,h){if(Wt=(r*this._terminal.cols+n)*ms,a===0||a===void 0){e.fill(0,Wt,Wt+ms-1-P8);return}this._atlas&&(c&&c.length>1?Mt=this._atlas.getRasterizedGlyphCombinedChar(c,l,f,m,!1,this._terminal.element):Mt=this._atlas.getRasterizedGlyph(a,l,f,m,!1,this._terminal.element),rp=Math.floor((this._dimensions.device.cell.width-this._dimensions.device.char.width)/2),l!==h&&Mt.offset.x>rp?(bl=Mt.offset.x-rp,e[Wt]=-(Mt.offset.x-bl)+this._dimensions.device.char.left,e[Wt+1]=-Mt.offset.y+this._dimensions.device.char.top,e[Wt+2]=(Mt.size.x-bl)/this._dimensions.device.canvas.width,e[Wt+3]=Mt.size.y/this._dimensions.device.canvas.height,e[Wt+4]=Mt.texturePage,e[Wt+5]=Mt.texturePositionClipSpace.x+bl/this._atlas.pages[Mt.texturePage].canvas.width,e[Wt+6]=Mt.texturePositionClipSpace.y,e[Wt+7]=Mt.sizeClipSpace.x-bl/this._atlas.pages[Mt.texturePage].canvas.width,e[Wt+8]=Mt.sizeClipSpace.y):(e[Wt]=-Mt.offset.x+this._dimensions.device.char.left,e[Wt+1]=-Mt.offset.y+this._dimensions.device.char.top,e[Wt+2]=Mt.size.x/this._dimensions.device.canvas.width,e[Wt+3]=Mt.size.y/this._dimensions.device.canvas.height,e[Wt+4]=Mt.texturePage,e[Wt+5]=Mt.texturePositionClipSpace.x,e[Wt+6]=Mt.texturePositionClipSpace.y,e[Wt+7]=Mt.sizeClipSpace.x,e[Wt+8]=Mt.sizeClipSpace.y),this._optionsService.rawOptions.rescaleOverlappingGlyphs&&i8(a,u,Mt.size.x,this._dimensions.device.cell.width)&&(e[Wt+2]=(this._dimensions.device.cell.width-1)/this._dimensions.device.canvas.width))}clear(){let e=this._terminal,n=e.cols*e.rows*ms;this._vertices.count!==n?this._vertices.attributes=new Float32Array(n):this._vertices.attributes.fill(0);let r=0;for(;r<this._vertices.attributesBuffers.length;r++)this._vertices.count!==n?this._vertices.attributesBuffers[r]=new Float32Array(n):this._vertices.attributesBuffers[r].fill(0);this._vertices.count=n,r=0;for(let a=0;a<e.rows;a++)for(let l=0;l<e.cols;l++)this._vertices.attributes[r+9]=l/e.cols,this._vertices.attributes[r+10]=a/e.rows,r+=ms}handleResize(){let e=this._gl;e.useProgram(this._program),e.viewport(0,0,e.canvas.width,e.canvas.height),e.uniform2f(this._resolutionLocation,e.canvas.width,e.canvas.height),this.clear()}render(e){if(!this._atlas)return;let n=this._gl;n.useProgram(this._program),n.bindVertexArray(this._vertexArrayObject),this._activeBuffer=(this._activeBuffer+1)%2;let r=this._vertices.attributesBuffers[this._activeBuffer],a=0;for(let l=0;l<e.lineLengths.length;l++){let f=l*this._terminal.cols*ms,m=this._vertices.attributes.subarray(f,f+e.lineLengths[l]*ms);r.set(m,a),a+=m.length}n.bindBuffer(n.ARRAY_BUFFER,this._attributesBuffer),n.bufferData(n.ARRAY_BUFFER,r.subarray(0,a),n.STREAM_DRAW);for(let l=0;l<this._atlas.pages.length;l++)this._atlas.pages[l].version!==this._atlasTextures[l].version&&this._bindAtlasPageTexture(n,this._atlas,l);n.drawElementsInstanced(n.TRIANGLE_STRIP,4,n.UNSIGNED_BYTE,0,a/ms)}setAtlas(e){this._atlas=e;for(let n of this._atlasTextures)n.version=-1}_bindAtlasPageTexture(e,n,r){e.activeTexture(e.TEXTURE0+r),e.bindTexture(e.TEXTURE_2D,this._atlasTextures[r].texture),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE),e.texImage2D(e.TEXTURE_2D,0,e.RGBA,e.RGBA,e.UNSIGNED_BYTE,n.pages[r].canvas),e.generateMipmap(e.TEXTURE_2D),this._atlasTextures[r].version=n.pages[r].version}setDimensions(e){this._dimensions=e}},U8=class{constructor(){this.clear()}clear(){this.hasSelection=!1,this.columnSelectMode=!1,this.viewportStartRow=0,this.viewportEndRow=0,this.viewportCappedStartRow=0,this.viewportCappedEndRow=0,this.startCol=0,this.endCol=0,this.selectionStart=void 0,this.selectionEnd=void 0}update(e,n,r,a=!1){if(this.selectionStart=n,this.selectionEnd=r,!n||!r||n[0]===r[0]&&n[1]===r[1]){this.clear();return}let l=e.buffers.active.ydisp,f=n[1]-l,m=r[1]-l,c=Math.max(f,0),u=Math.min(m,e.rows-1);if(c>=e.rows||u<0){this.clear();return}this.hasSelection=!0,this.columnSelectMode=a,this.viewportStartRow=f,this.viewportEndRow=m,this.viewportCappedStartRow=c,this.viewportCappedEndRow=u,this.startCol=n[0],this.endCol=r[0]}isCellSelected(e,n,r){return this.hasSelection?(r-=e.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?n>=this.startCol&&r>=this.viewportCappedStartRow&&n<this.endCol&&r<=this.viewportCappedEndRow:n<this.startCol&&r>=this.viewportCappedStartRow&&n>=this.endCol&&r<=this.viewportCappedEndRow:r>this.viewportStartRow&&r<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&r===this.viewportStartRow&&n>=this.startCol&&n<this.endCol||this.viewportStartRow<this.viewportEndRow&&r===this.viewportEndRow&&n<this.endCol||this.viewportStartRow<this.viewportEndRow&&r===this.viewportStartRow&&n>=this.startCol):!1}};function F8(){return new U8}var Ju=4,Nu=1,Bu=2,sp=3,q8=2147483648,W8=class{constructor(){this.cells=new Uint32Array(0),this.lineLengths=new Uint32Array(0),this.selection=F8()}resize(e,n){let r=e*n*Ju;r!==this.cells.length&&(this.cells=new Uint32Array(r),this.lineLengths=new Uint32Array(n))}clear(){this.cells.fill(0,0),this.lineLengths.fill(0,0)}},G8=`#version 300 es
|
|
746
|
+
layout (location = 0) in vec2 a_position;
|
|
747
|
+
layout (location = 1) in vec2 a_size;
|
|
748
|
+
layout (location = 2) in vec4 a_color;
|
|
749
|
+
layout (location = 3) in vec2 a_unitquad;
|
|
750
|
+
|
|
751
|
+
uniform mat4 u_projection;
|
|
752
|
+
|
|
753
|
+
out vec4 v_color;
|
|
754
|
+
|
|
755
|
+
void main() {
|
|
756
|
+
vec2 zeroToOne = a_position + (a_unitquad * a_size);
|
|
757
|
+
gl_Position = u_projection * vec4(zeroToOne, 0.0, 1.0);
|
|
758
|
+
v_color = a_color;
|
|
759
|
+
}`,K8=`#version 300 es
|
|
760
|
+
precision lowp float;
|
|
761
|
+
|
|
762
|
+
in vec4 v_color;
|
|
763
|
+
|
|
764
|
+
out vec4 outColor;
|
|
765
|
+
|
|
766
|
+
void main() {
|
|
767
|
+
outColor = v_color;
|
|
768
|
+
}`,Nr=8,ap=Nr*Float32Array.BYTES_PER_ELEMENT,V8=20*Nr,ey=class{constructor(){this.attributes=new Float32Array(V8),this.count=0}},Mr=0,ty=0,ny=0,iy=0,ry=0,sy=0,ay=0,Y8=class extends Wi{constructor(e,n,r,a){super(),this._terminal=e,this._gl=n,this._dimensions=r,this._themeService=a,this._vertices=new ey,this._verticesCursor=new ey;let l=this._gl;this._program=hn(FC(l,G8,K8)),this._register(On(()=>l.deleteProgram(this._program))),this._projectionLocation=hn(l.getUniformLocation(this._program,"u_projection")),this._vertexArrayObject=l.createVertexArray(),l.bindVertexArray(this._vertexArrayObject);let f=new Float32Array([0,0,1,0,0,1,1,1]),m=l.createBuffer();this._register(On(()=>l.deleteBuffer(m))),l.bindBuffer(l.ARRAY_BUFFER,m),l.bufferData(l.ARRAY_BUFFER,f,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(On(()=>l.deleteBuffer(u))),l.bindBuffer(l.ELEMENT_ARRAY_BUFFER,u),l.bufferData(l.ELEMENT_ARRAY_BUFFER,c,l.STATIC_DRAW),this._attributesBuffer=hn(l.createBuffer()),this._register(On(()=>l.deleteBuffer(this._attributesBuffer))),l.bindBuffer(l.ARRAY_BUFFER,this._attributesBuffer),l.enableVertexAttribArray(0),l.vertexAttribPointer(0,2,l.FLOAT,!1,ap,0),l.vertexAttribDivisor(0,1),l.enableVertexAttribArray(1),l.vertexAttribPointer(1,2,l.FLOAT,!1,ap,2*Float32Array.BYTES_PER_ELEMENT),l.vertexAttribDivisor(1,1),l.enableVertexAttribArray(2),l.vertexAttribPointer(2,4,l.FLOAT,!1,ap,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(e){let n=this._gl;n.useProgram(this._program),n.bindVertexArray(this._vertexArrayObject),n.uniformMatrix4fv(this._projectionLocation,!1,UC),n.bindBuffer(n.ARRAY_BUFFER,this._attributesBuffer),n.bufferData(n.ARRAY_BUFFER,e.attributes,n.DYNAMIC_DRAW),n.drawElementsInstanced(this._gl.TRIANGLE_STRIP,4,n.UNSIGNED_BYTE,0,e.count)}handleResize(){this._updateViewportRectangle()}setDimensions(e){this._dimensions=e}_updateCachedColors(e){this._bgFloat=this._colorToFloat32Array(e.background),this._cursorFloat=this._colorToFloat32Array(e.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(e){let n=this._terminal,r=this._vertices,a=1,l,f,m,c,u,h,y,g,C,E,A;for(l=0;l<n.rows;l++){for(m=-1,c=0,u=0,h=!1,f=0;f<n.cols;f++)y=(l*n.cols+f)*Ju,g=e.cells[y+Nu],C=e.cells[y+Bu],E=!!(C&67108864),(g!==c||C!==u&&(h||E))&&((c!==0||h&&u!==0)&&(A=a++*Nr,this._updateRectangle(r,A,u,c,m,f,l)),m=f,c=g,u=C,h=E);(c!==0||h&&u!==0)&&(A=a++*Nr,this._updateRectangle(r,A,u,c,m,n.cols,l))}r.count=a}updateCursor(e){let n=this._verticesCursor,r=e.cursor;if(!r||r.style==="block"){n.count=0;return}let a,l=0;(r.style==="bar"||r.style==="outline")&&(a=l++*Nr,this._addRectangleFloat(n.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++*Nr,this._addRectangleFloat(n.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++*Nr,this._addRectangleFloat(n.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++*Nr,this._addRectangleFloat(n.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)),n.count=l}_updateRectangle(e,n,r,a,l,f,m){if(r&67108864)switch(r&50331648){case 16777216:case 33554432:Mr=this._themeService.colors.ansi[r&255].rgba;break;case 50331648:Mr=(r&16777215)<<8;break;default:Mr=this._themeService.colors.foreground.rgba}else switch(a&50331648){case 16777216:case 33554432:Mr=this._themeService.colors.ansi[a&255].rgba;break;case 50331648:Mr=(a&16777215)<<8;break;default:Mr=this._themeService.colors.background.rgba}e.attributes.length<n+4&&(e.attributes=I8(e.attributes,this._terminal.rows*this._terminal.cols*Nr)),ty=l*this._dimensions.device.cell.width,ny=m*this._dimensions.device.cell.height,iy=(Mr>>24&255)/255,ry=(Mr>>16&255)/255,sy=(Mr>>8&255)/255,ay=1,this._addRectangle(e.attributes,n,ty,ny,(f-l)*this._dimensions.device.cell.width,this._dimensions.device.cell.height,iy,ry,sy,ay)}_addRectangle(e,n,r,a,l,f,m,c,u,h){e[n]=r/this._dimensions.device.canvas.width,e[n+1]=a/this._dimensions.device.canvas.height,e[n+2]=l/this._dimensions.device.canvas.width,e[n+3]=f/this._dimensions.device.canvas.height,e[n+4]=m,e[n+5]=c,e[n+6]=u,e[n+7]=h}_addRectangleFloat(e,n,r,a,l,f,m){e[n]=r/this._dimensions.device.canvas.width,e[n+1]=a/this._dimensions.device.canvas.height,e[n+2]=l/this._dimensions.device.canvas.width,e[n+3]=f/this._dimensions.device.canvas.height,e[n+4]=m[0],e[n+5]=m[1],e[n+6]=m[2],e[n+7]=m[3]}_colorToFloat32Array(e){return new Float32Array([(e.rgba>>24&255)/255,(e.rgba>>16&255)/255,(e.rgba>>8&255)/255,(e.rgba&255)/255])}},X8=class extends Wi{constructor(e,n,r,a,l,f,m,c){super(),this._container=n,this._alpha=l,this._coreBrowserService=f,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(e,u),this.reset(e)})),this._register(On(()=>{this._canvas.remove()}))}_initCanvas(){this._ctx=hn(this._canvas.getContext("2d",{alpha:this._alpha})),this._alpha||this._clearAll()}handleBlur(e){}handleFocus(e){}handleCursorMove(e){}handleGridChanged(e,n,r){}handleSelectionChanged(e,n,r,a=!1){}_setTransparency(e,n){if(n===this._alpha)return;let r=this._canvas;this._alpha=n,this._canvas=this._canvas.cloneNode(),this._initCanvas(),this._container.replaceChild(this._canvas,r),this._refreshCharAtlas(e,this._themeService.colors),this.handleGridChanged(e,0,e.rows-1)}_refreshCharAtlas(e,n){this._deviceCharWidth<=0&&this._deviceCharHeight<=0||(this._charAtlas=PC(e,this._optionsService.rawOptions,n,this._deviceCellWidth,this._deviceCellHeight,this._deviceCharWidth,this._deviceCharHeight,this._coreBrowserService.dpr,2048),this._charAtlas.warmUp())}resize(e,n){this._deviceCellWidth=n.device.cell.width,this._deviceCellHeight=n.device.cell.height,this._deviceCharWidth=n.device.char.width,this._deviceCharHeight=n.device.char.height,this._deviceCharLeft=n.device.char.left,this._deviceCharTop=n.device.char.top,this._canvas.width=n.device.canvas.width,this._canvas.height=n.device.canvas.height,this._canvas.style.width=`${n.css.canvas.width}px`,this._canvas.style.height=`${n.css.canvas.height}px`,this._alpha||this._clearAll(),this._refreshCharAtlas(e,this._themeService.colors)}_fillBottomLineAtCells(e,n,r=1){this._ctx.fillRect(e*this._deviceCellWidth,(n+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(e,n,r,a){this._alpha?this._ctx.clearRect(e*this._deviceCellWidth,n*this._deviceCellHeight,r*this._deviceCellWidth,a*this._deviceCellHeight):(this._ctx.fillStyle=this._themeService.colors.background.css,this._ctx.fillRect(e*this._deviceCellWidth,n*this._deviceCellHeight,r*this._deviceCellWidth,a*this._deviceCellHeight))}_fillCharTrueColor(e,n,r,a){this._ctx.font=this._getFont(e,!1,!1),this._ctx.textBaseline=kC,this._clipCell(r,a,n.getWidth()),this._ctx.fillText(n.getChars(),r*this._deviceCellWidth+this._deviceCharLeft,a*this._deviceCellHeight+this._deviceCharTop+this._deviceCharHeight)}_clipCell(e,n,r){this._ctx.beginPath(),this._ctx.rect(e*this._deviceCellWidth,n*this._deviceCellHeight,r*this._deviceCellWidth,this._deviceCellHeight),this._ctx.clip()}_getFont(e,n,r){let a=n?e.options.fontWeightBold:e.options.fontWeight;return`${r?"italic":""} ${a} ${e.options.fontSize*this._coreBrowserService.dpr}px ${e.options.fontFamily}`}},Z8=class extends X8{constructor(e,n,r,a,l,f,m){super(r,e,"link",n,!0,l,f,m),this._register(a.onShowLinkUnderline(c=>this._handleShowLinkUnderline(c))),this._register(a.onHideLinkUnderline(c=>this._handleHideLinkUnderline(c)))}resize(e,n){super.resize(e,n),this._state=void 0}reset(e){this._clearCurrentLink()}_clearCurrentLink(){if(this._state){this._clearCells(this._state.x1,this._state.y1,this._state.cols-this._state.x1,1);let e=this._state.y2-this._state.y1-1;e>0&&this._clearCells(0,this._state.y1+1,this._state.cols,e),this._clearCells(0,this._state.y2,this._state.x2,1),this._state=void 0}}_handleShowLinkUnderline(e){if(e.fg===257?this._ctx.fillStyle=this._themeService.colors.background.css:e.fg!==void 0&&O8(e.fg)?this._ctx.fillStyle=this._themeService.colors.ansi[e.fg].css:this._ctx.fillStyle=this._themeService.colors.foreground.css,e.y1===e.y2)this._fillBottomLineAtCells(e.x1,e.y1,e.x2-e.x1);else{this._fillBottomLineAtCells(e.x1,e.y1,e.cols-e.x1);for(let n=e.y1+1;n<e.y2;n++)this._fillBottomLineAtCells(0,n,e.cols);this._fillBottomLineAtCells(0,e.y2,e.x2)}this._state=e}_handleHideLinkUnderline(e){this._clearCurrentLink()}},Vs=typeof window=="object"?window:globalThis,mg=class{constructor(){this.mapWindowIdToZoomLevel=new Map,this._onDidChangeZoomLevel=new Dt,this.onDidChangeZoomLevel=this._onDidChangeZoomLevel.event,this.mapWindowIdToZoomFactor=new Map,this._onDidChangeFullscreen=new Dt,this.onDidChangeFullscreen=this._onDidChangeFullscreen.event,this.mapWindowIdToFullScreen=new Map}getZoomLevel(n){return this.mapWindowIdToZoomLevel.get(this.getWindowId(n))??0}setZoomLevel(n,r){if(this.getZoomLevel(r)===n)return;let a=this.getWindowId(r);this.mapWindowIdToZoomLevel.set(a,n),this._onDidChangeZoomLevel.fire(a)}getZoomFactor(n){return this.mapWindowIdToZoomFactor.get(this.getWindowId(n))??1}setZoomFactor(n,r){this.mapWindowIdToZoomFactor.set(this.getWindowId(r),n)}setFullscreen(n,r){if(this.isFullscreen(r)===n)return;let a=this.getWindowId(r);this.mapWindowIdToFullScreen.set(a,n),this._onDidChangeFullscreen.fire(a)}isFullscreen(n){return!!this.mapWindowIdToFullScreen.get(this.getWindowId(n))}getWindowId(n){return n.vscodeWindowId}};mg.INSTANCE=new mg;var qC=mg;function J8(e,n,r){typeof n=="string"&&(n=e.matchMedia(n)),n.addEventListener("change",r)}qC.INSTANCE.onDidChangeZoomLevel;qC.INSTANCE.onDidChangeFullscreen;var po=typeof navigator=="object"?navigator.userAgent:"";po.indexOf("Firefox")>=0;po.indexOf("AppleWebKit")>=0;var Q8=po.indexOf("Chrome")>=0;!Q8&&po.indexOf("Safari")>=0;po.indexOf("Electron/")>=0;po.indexOf("Android")>=0;var op=!1;if(typeof Vs.matchMedia=="function"){let e=Vs.matchMedia("(display-mode: standalone) or (display-mode: window-controls-overlay)"),n=Vs.matchMedia("(display-mode: fullscreen)");op=e.matches,J8(Vs,e,({matches:r})=>{op&&n.matches||(op=r)})}var Xa="en",lp=!1,WC=!1,Su,Iu=Xa,oy=Xa,eN,Or,Zs=globalThis,di;typeof Zs.vscode<"u"&&typeof Zs.vscode.process<"u"?di=Zs.vscode.process:typeof process<"u"&&typeof process?.versions?.node=="string"&&(di=process);var tN=typeof di?.versions?.electron=="string",nN=tN&&di?.type==="renderer";if(typeof di=="object"){di.platform,di.platform,lp=di.platform==="linux",lp&&di.env.SNAP&&di.env.SNAP_REVISION,di.env.CI||di.env.BUILD_ARTIFACTSTAGINGDIRECTORY,Su=Xa,Iu=Xa;let e=di.env.VSCODE_NLS_CONFIG;if(e)try{let n=JSON.parse(e);Su=n.userLocale,oy=n.osLocale,Iu=n.resolvedLanguage||Xa,eN=n.languagePack?.translationsConfigFile}catch{}WC=!0}else typeof navigator=="object"&&!nN?(Or=navigator.userAgent,Or.indexOf("Windows")>=0,Or.indexOf("Macintosh")>=0,(Or.indexOf("Macintosh")>=0||Or.indexOf("iPad")>=0||Or.indexOf("iPhone")>=0)&&navigator.maxTouchPoints&&navigator.maxTouchPoints>0,lp=Or.indexOf("Linux")>=0,Or?.indexOf("Mobi")>=0,Iu=globalThis._VSCODE_NLS_LANGUAGE||Xa,Su=navigator.language.toLowerCase(),oy=Su):console.error("Unable to resolve platform.");var ly=WC,ir=Or,fs=Iu,iN;(e=>{function n(){return fs}e.value=n;function r(){return fs.length===2?fs==="en":fs.length>=3?fs[0]==="e"&&fs[1]==="n"&&fs[2]==="-":!1}e.isDefaultVariant=r;function a(){return fs==="en"}e.isDefault=a})(iN||={});var rN=typeof Zs.postMessage=="function"&&!Zs.importScripts;(()=>{if(rN){let e=[];Zs.addEventListener("message",r=>{if(r.data&&r.data.vscodeScheduleAsyncWork)for(let a=0,l=e.length;a<l;a++){let f=e[a];if(f.id===r.data.vscodeScheduleAsyncWork){e.splice(a,1),f.callback();return}}});let n=0;return r=>{let a=++n;e.push({id:a,callback:r}),Zs.postMessage({vscodeScheduleAsyncWork:a},"*")}}return e=>setTimeout(e)})();var sN=!!(ir&&ir.indexOf("Chrome")>=0);ir&&ir.indexOf("Firefox")>=0;!sN&&ir&&ir.indexOf("Safari")>=0;ir&&ir.indexOf("Edg/")>=0;ir&&ir.indexOf("Android")>=0;var Fa=typeof navigator=="object"?navigator:{};ly||document.queryCommandSupported&&document.queryCommandSupported("copy")||Fa&&Fa.clipboard&&Fa.clipboard.writeText,ly||Fa&&Fa.clipboard&&Fa.clipboard.readText;var om=class{constructor(){this._keyCodeToStr=[],this._strToKeyCode=Object.create(null)}define(e,n){this._keyCodeToStr[e]=n,this._strToKeyCode[n.toLowerCase()]=e}keyCodeToStr(e){return this._keyCodeToStr[e]}strToKeyCode(e){return this._strToKeyCode[e.toLowerCase()]||0}},cp=new om,cy=new om,uy=new om;new Array(230);var aN;(e=>{function n(c){return cp.keyCodeToStr(c)}e.toString=n;function r(c){return cp.strToKeyCode(c)}e.fromString=r;function a(c){return cy.keyCodeToStr(c)}e.toUserSettingsUS=a;function l(c){return uy.keyCodeToStr(c)}e.toUserSettingsGeneral=l;function f(c){return cy.strToKeyCode(c)||uy.strToKeyCode(c)}e.fromUserSettings=f;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 cp.keyCodeToStr(c)}e.toElectronAccelerator=m})(aN||={});var GC=Object.freeze(function(e,n){let r=setTimeout(e.bind(n),0);return{dispose(){clearTimeout(r)}}}),oN;(e=>{function n(r){return r===e.None||r===e.Cancelled||r instanceof lN?!0:!r||typeof r!="object"?!1:typeof r.isCancellationRequested=="boolean"&&typeof r.onCancellationRequested=="function"}e.isCancellationToken=n,e.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:Br.None}),e.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:GC})})(oN||={});var lN=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?GC:(this._emitter||(this._emitter=new Dt),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=null)}},cN;(e=>{async function n(a){let l,f=await Promise.all(a.map(m=>m.then(c=>c,c=>{l||(l=c)})));if(typeof l<"u")throw l;return f}e.settled=n;function r(a){return new Promise(async(l,f)=>{try{await a(l,f)}catch(m){f(m)}})}e.withAsyncBody=r})(cN||={});var hy=class Ti{static fromArray(n){return new Ti(r=>{r.emitMany(n)})}static fromPromise(n){return new Ti(async r=>{r.emitMany(await n)})}static fromPromises(n){return new Ti(async r=>{await Promise.all(n.map(async a=>r.emitOne(await a)))})}static merge(n){return new Ti(async r=>{await Promise.all(n.map(async a=>{for await(let l of a)r.emitOne(l)}))})}constructor(n,r){this._state=0,this._results=[],this._error=null,this._onReturn=r,this._onStateChanged=new Dt,queueMicrotask(async()=>{let a={emitOne:l=>this.emitOne(l),emitMany:l=>this.emitMany(l),reject:l=>this.reject(l)};try{await Promise.resolve(n(a)),this.resolve()}catch(l){this.reject(l)}finally{a.emitOne=void 0,a.emitMany=void 0,a.reject=void 0}})}[Symbol.asyncIterator](){let n=0;return{next:async()=>{do{if(this._state===2)throw this._error;if(n<this._results.length)return{done:!1,value:this._results[n++]};if(this._state===1)return{done:!0,value:void 0};await Br.toPromise(this._onStateChanged.event)}while(!0)},return:async()=>(this._onReturn?.(),{done:!0,value:void 0})}}static map(n,r){return new Ti(async a=>{for await(let l of n)a.emitOne(r(l))})}map(n){return Ti.map(this,n)}static filter(n,r){return new Ti(async a=>{for await(let l of n)r(l)&&a.emitOne(l)})}filter(n){return Ti.filter(this,n)}static coalesce(n){return Ti.filter(n,r=>!!r)}coalesce(){return Ti.coalesce(this)}static async toPromise(n){let r=[];for await(let a of n)r.push(a);return r}toPromise(){return Ti.toPromise(this)}emitOne(n){this._state===0&&(this._results.push(n),this._onStateChanged.fire())}emitMany(n){this._state===0&&(this._results=this._results.concat(n),this._onStateChanged.fire())}resolve(){this._state===0&&(this._state=1,this._onStateChanged.fire())}reject(n){this._state===0&&(this._state=2,this._error=n,this._onStateChanged.fire())}};hy.EMPTY=hy.fromArray([]);var{getWindow:uN}=(function(){let e=new Map,n={window:Vs,disposables:new no};e.set(Vs.vscodeWindowId,n);let r=new Dt,a=new Dt,l=new Dt;function f(m,c){return(typeof m=="number"?e.get(m):void 0)??(c?n:void 0)}return{onDidRegisterWindow:r.event,onWillUnregisterWindow:l.event,onDidUnregisterWindow:a.event,registerWindow(m){if(e.has(m.vscodeWindowId))return Wi.None;let c=new no,u={window:m,disposables:c.add(new no)};return e.set(m.vscodeWindowId,u),c.add(On(()=>{e.delete(m.vscodeWindowId),a.fire(m)})),c.add(_g(m,dN.BEFORE_UNLOAD,()=>{l.fire(m)})),r.fire(u),c},getWindows(){return e.values()},getWindowsCount(){return e.size},getWindowId(m){return m.vscodeWindowId},hasWindow(m){return e.has(m)},getWindowById:f,getWindow(m){let c=m;if(c?.ownerDocument?.defaultView)return c.ownerDocument.defaultView.window;let u=m;return u?.view?u.view.window:Vs},getDocument(m){return uN(m).document}}})(),hN=class{constructor(e,n,r,a){this._node=e,this._type=n,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 _g(e,n,r,a){return new hN(e,n,r,a)}var dN={BEFORE_UNLOAD:"beforeunload"},fN=class extends Wi{constructor(e,n,r,a,l,f,m,c,u){super(),this._terminal=e,this._characterJoinerService=n,this._charSizeService=r,this._coreBrowserService=a,this._coreService=l,this._decorationService=f,this._optionsService=m,this._themeService=c,this._cursorBlinkStateManager=new ml,this._charAtlasDisposable=this._register(new ml),this._observerDisposable=this._register(new ml),this._model=new W8,this._workCell=new J1,this._workCell2=new J1,this._rectangleRenderer=this._register(new ml),this._glyphRenderer=this._register(new ml),this._onChangeTextureAtlas=this._register(new Dt),this.onChangeTextureAtlas=this._onChangeTextureAtlas.event,this._onAddTextureAtlasCanvas=this._register(new Dt),this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event,this._onRemoveTextureAtlasCanvas=this._register(new Dt),this.onRemoveTextureAtlasCanvas=this._onRemoveTextureAtlasCanvas.event,this._onRequestRedraw=this._register(new Dt),this.onRequestRedraw=this._onRequestRedraw.event,this._onContextLoss=this._register(new Dt),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 a8(this._terminal,this._optionsService,this._model.selection,this._decorationService,this._coreBrowserService,this._themeService),this._core=this._terminal._core,this._renderLayers=[new Z8(this._core.screenElement,2,this._terminal,this._core.linkifier,this._coreBrowserService,m,this._themeService)],this.dimensions=r8(),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(_g(this._canvas,"webglcontextlost",y=>{console.log("webglcontextlost event received"),y.preventDefault(),this._contextRestorationTimeout=setTimeout(()=>{this._contextRestorationTimeout=void 0,console.warn("webgl context not restored; firing onContextLoss"),this._onContextLoss.fire(y)},3e3)})),this._register(_g(this._canvas,"webglcontextrestored",y=>{console.warn("webglcontextrestored event received"),clearTimeout(this._contextRestorationTimeout),this._contextRestorationTimeout=void 0,X1(this._terminal),this._initializeWebGLState(),this._requestRedrawViewport()})),this._observerDisposable.value=Z1(this._canvas,this._coreBrowserService.window,(y,g)=>this._setCanvasDevicePixelDimensions(y,g)),this._register(this._coreBrowserService.onWindowChange(y=>{this._observerDisposable.value=Z1(this._canvas,y,(g,C)=>this._setCanvasDevicePixelDimensions(g,C))})),this._core.screenElement.appendChild(this._canvas),[this._rectangleRenderer.value,this._glyphRenderer.value]=this._initializeWebGLState(),this._isAttached=this._core.screenElement.isConnected,this._register(On(()=>{for(let y of this._renderLayers)y.dispose();this._canvas.parentElement?.removeChild(this._canvas),X1(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(e,n){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 e of this._renderLayers)e.handleBlur(this._terminal);this._cursorBlinkStateManager.value?.pause(),this._requestRedrawViewport()}handleFocus(){for(let e of this._renderLayers)e.handleFocus(this._terminal);this._cursorBlinkStateManager.value?.resume(),this._requestRedrawViewport()}handleSelectionChanged(e,n,r){for(let a of this._renderLayers)a.handleSelectionChanged(this._terminal,e,n,r);this._model.selection.update(this._core,e,n,r),this._requestRedrawViewport()}handleCursorMove(){for(let e of this._renderLayers)e.handleCursorMove(this._terminal);this._cursorBlinkStateManager.value?.restartBlinkAnimation()}_handleOptionsChanged(){this._updateDimensions(),this._refreshCharAtlas(),this._updateCursorBlink()}_initializeWebGLState(){return this._rectangleRenderer.value=new Y8(this._terminal,this._gl,this.dimensions,this._themeService),this._glyphRenderer.value=new H8(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 e=PC(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!==e&&(this._onChangeTextureAtlas.fire(e.pages[0].canvas),this._charAtlasDisposable.value=CC(Br.forward(e.onAddTextureAtlasCanvas,this._onAddTextureAtlasCanvas),Br.forward(e.onRemoveTextureAtlasCanvas,this._onRemoveTextureAtlasCanvas))),this._charAtlas=e,this._charAtlas.warmUp(),this._glyphRenderer.value?.setAtlas(this._charAtlas)}_clearModel(e){this._model.clear(),e&&this._glyphRenderer.value?.clear()}clearTextureAtlas(){this._charAtlas?.clearTexture(),this._clearModel(!0),this._requestRedrawViewport()}clear(){this._clearModel(!0);for(let e of this._renderLayers)e.reset(this._terminal);this._cursorBlinkStateManager.value?.restartBlinkAnimation(),this._updateCursorBlink()}renderRows(e,n){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,e,n);!this._glyphRenderer.value||!this._rectangleRenderer.value||(this._glyphRenderer.value.beginFrame()?(this._clearModel(!0),this._updateModel(0,this._terminal.rows-1)):this._updateModel(e,n),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 N8(()=>{this._requestRedrawCursor()},this._coreBrowserService):this._cursorBlinkStateManager.clear(),this._requestRedrawCursor()}_updateModel(e,n){let r=this._core,a=this._workCell,l,f,m,c,u,h,y=0,g=!0,C,E,A,T,p,v,d,b,x;e=dy(e,r.rows-1,0),n=dy(n,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,M=R-r.buffer.ydisp,k=Math.min(this._terminal.buffer.active.cursorX,r.cols-1),O=-1,U=this._coreService.isCursorInitialized&&!this._coreService.isCursorHidden&&(!this._cursorBlinkStateManager.value||this._cursorBlinkStateManager.value.isCursorVisible);this._model.cursor=void 0;let F=!1;for(f=e;f<=n;f++)for(m=f+r.buffer.ydisp,c=r.buffer.lines.get(m),this._model.lineLengths[f]=0,A=R===m,y=0,u=this._characterJoinerService.getJoinedCharacters(m),b=0;b<r.cols;b++){if(l=this._cellColorResolver.result.bg,c.loadCell(b,a),b===0&&(l=this._cellColorResolver.result.bg),h=!1,g=b>=y,C=b,u.length>0&&b===u[0][0]&&g){E=u.shift();let G=this._model.selection.isCellSelected(this._terminal,E[0],m);for(d=E[0]+1;d<E[1];d++)g&&=G===this._model.selection.isCellSelected(this._terminal,d,m);g&&=!A||k<E[0]||k>=E[1],g?(h=!0,a=new pN(a,c.translateToString(!0,E[0],E[1]),E[1]-E[0]),C=E[1]-1):y=E[1]}if(T=a.getChars(),p=a.getCode(),d=(f*r.cols+b)*Ju,this._cellColorResolver.resolve(a,b,m,this.dimensions.device.cell.width),U&&m===R&&(b===k&&(this._model.cursor={x:k,y:M,width:a.getWidth(),style:this._coreBrowserService.isFocused?L:r.options.cursorInactiveStyle,cursorWidth:r.options.cursorWidth,dpr:this._devicePixelRatio},O=k+a.getWidth()-1),b>=k&&b<=O&&(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)),p!==0&&(this._model.lineLengths[f]=b+1),!(this._model.cells[d]===p&&this._model.cells[d+Nu]===this._cellColorResolver.result.bg&&this._model.cells[d+Bu]===this._cellColorResolver.result.fg&&this._model.cells[d+sp]===this._cellColorResolver.result.ext)&&(F=!0,T.length>1&&(p|=q8),this._model.cells[d]=p,this._model.cells[d+Nu]=this._cellColorResolver.result.bg,this._model.cells[d+Bu]=this._cellColorResolver.result.fg,this._model.cells[d+sp]=this._cellColorResolver.result.ext,v=a.getWidth(),this._glyphRenderer.value.updateCell(b,f,p,this._cellColorResolver.result.bg,this._cellColorResolver.result.fg,this._cellColorResolver.result.ext,T,v,l),h)){for(a=this._workCell,b++;b<=C;b++)x=(f*r.cols+b)*Ju,this._glyphRenderer.value.updateCell(b,f,0,0,0,0,ZO,0,0),this._model.cells[x]=0,this._model.cells[x+Nu]=this._cellColorResolver.result.bg,this._model.cells[x+Bu]=this._cellColorResolver.result.fg,this._model.cells[x+sp]=this._cellColorResolver.result.ext;b--}}F&&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(e,n){this._canvas.width===e&&this._canvas.height===n||(this._canvas.width=e,this._canvas.height=n,this._requestRedrawViewport())}_requestRedrawViewport(){this._onRequestRedraw.fire({start:0,end:this._terminal.rows-1})}_requestRedrawCursor(){let e=this._terminal.buffer.active.cursorY;this._onRequestRedraw.fire({start:e,end:e})}},pN=class extends Ya{constructor(e,n,r){super(),this.content=0,this.combinedData="",this.fg=e.fg,this.bg=e.bg,this.combinedData=n,this._width=r}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(e){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}};function dy(e,n,r=0){return Math.max(Math.min(e,n),r)}var fy="di$target",py="di$dependencies",up=new Map;function ar(e){if(up.has(e))return up.get(e);let n=function(r,a,l){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");gN(n,r,l)};return n._id=e,up.set(e,n),n}function gN(e,n,r){n[fy]===n?n[py].push({id:e,index:r}):(n[py]=[{id:e,index:r}],n[fy]=n)}ar("BufferService");ar("CoreMouseService");ar("CoreService");ar("CharsetService");ar("InstantiationService");ar("LogService");var mN=ar("OptionsService");ar("OscLinkService");ar("UnicodeService");ar("DecorationService");var _N={trace:0,debug:1,info:2,warn:3,error:4,off:5},vN="xterm.js: ",gy=class extends Wi{constructor(e){super(),this._optionsService=e,this._logLevel=5,this._updateLogLevel(),this._register(this._optionsService.onSpecificOptionChange("logLevel",()=>this._updateLogLevel()))}get logLevel(){return this._logLevel}_updateLogLevel(){this._logLevel=_N[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(e){for(let n=0;n<e.length;n++)typeof e[n]=="function"&&(e[n]=e[n]())}_log(e,n,r){this._evalLazyOptionalParams(r),e.call(console,(this._optionsService.options.logger?"":vN)+n,...r)}trace(e,...n){this._logLevel<=0&&this._log(this._optionsService.options.logger?.trace.bind(this._optionsService.options.logger)??console.log,e,n)}debug(e,...n){this._logLevel<=1&&this._log(this._optionsService.options.logger?.debug.bind(this._optionsService.options.logger)??console.log,e,n)}info(e,...n){this._logLevel<=2&&this._log(this._optionsService.options.logger?.info.bind(this._optionsService.options.logger)??console.info,e,n)}warn(e,...n){this._logLevel<=3&&this._log(this._optionsService.options.logger?.warn.bind(this._optionsService.options.logger)??console.warn,e,n)}error(e,...n){this._logLevel<=4&&this._log(this._optionsService.options.logger?.error.bind(this._optionsService.options.logger)??console.error,e,n)}};gy=$O([PO(0,mN)],gy);var bN=class extends Wi{constructor(e){if(TC&&XO()<16){let n={antialias:!1,depth:!1,preserveDrawingBuffer:!0};if(!document.createElement("canvas").getContext("webgl2",n))throw new Error("Webgl2 is only supported on Safari 16 and above")}super(),this._preserveDrawingBuffer=e,this._onChangeTextureAtlas=this._register(new Dt),this.onChangeTextureAtlas=this._onChangeTextureAtlas.event,this._onAddTextureAtlasCanvas=this._register(new Dt),this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event,this._onRemoveTextureAtlasCanvas=this._register(new Dt),this.onRemoveTextureAtlasCanvas=this._onRemoveTextureAtlasCanvas.event,this._onContextLoss=this._register(new Dt),this.onContextLoss=this._onContextLoss.event}activate(e){let n=e._core;if(!e.element){this._register(n.onWillOpen(()=>this.activate(e)));return}this._terminal=e;let r=n.coreService,a=n.optionsService,l=n,f=l._renderService,m=l._characterJoinerService,c=l._charSizeService,u=l._coreBrowserService,h=l._decorationService;l._logService;let y=l._themeService;this._renderer=this._register(new fN(e,m,c,u,r,h,a,y,this._preserveDrawingBuffer)),this._register(Br.forward(this._renderer.onContextLoss,this._onContextLoss)),this._register(Br.forward(this._renderer.onChangeTextureAtlas,this._onChangeTextureAtlas)),this._register(Br.forward(this._renderer.onAddTextureAtlasCanvas,this._onAddTextureAtlasCanvas)),this._register(Br.forward(this._renderer.onRemoveTextureAtlasCanvas,this._onRemoveTextureAtlasCanvas)),f.setRenderer(this._renderer),this._register(On(()=>{if(this._terminal._core._store._isDisposed)return;let g=this._terminal._core._renderService;g.setRenderer(this._terminal._core._createRenderer()),g.handleResize(e.cols,e.rows)}))}get textureAtlas(){return this._renderer?.textureAtlas}clearTextureAtlas(){this._renderer?.clearTextureAtlas()}},hp={exports:{}},my;function yN(){return my||(my=1,(function(e,n){(function(r,a){e.exports=a()})(globalThis,(()=>(()=>{var r={4567:function(m,c,u){var h=this&&this.__decorate||function(d,b,x,L){var R,M=arguments.length,k=M<3?b:L===null?L=Object.getOwnPropertyDescriptor(b,x):L;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")k=Reflect.decorate(d,b,x,L);else for(var O=d.length-1;O>=0;O--)(R=d[O])&&(k=(M<3?R(k):M>3?R(b,x,k):R(b,x))||k);return M>3&&k&&Object.defineProperty(b,x,k),k},y=this&&this.__param||function(d,b){return function(x,L){b(x,L,d)}};Object.defineProperty(c,"__esModule",{value:!0}),c.AccessibilityManager=void 0;const g=u(9042),C=u(9924),E=u(844),A=u(4725),T=u(2585),p=u(3656);let v=c.AccessibilityManager=class extends E.Disposable{constructor(d,b,x,L){super(),this._terminal=d,this._coreBrowserService=x,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(`
|
|
769
|
+
`)))),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,p.addDisposableDomListener)(document,"selectionchange",(()=>this._handleSelectionChange()))),this.register(this._coreBrowserService.onDprChange((()=>this._refreshRowsDimensions()))),this._refreshRows(),this.register((0,E.toDisposable)((()=>{this._accessibilityContainer.remove(),this._rowElements.length=0})))}_handleTab(d){for(let b=0;b<d;b++)this._handleChar(" ")}_handleChar(d){this._liveRegionLineCount<21&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==d&&(this._charsToAnnounce+=d):this._charsToAnnounce+=d,d===`
|
|
770
|
+
`&&(this._liveRegionLineCount++,this._liveRegionLineCount===21&&(this._liveRegion.textContent+=g.tooMuchOutput)))}_clearLiveRegion(){this._liveRegion.textContent="",this._liveRegionLineCount=0}_handleKey(d){this._clearLiveRegion(),new RegExp("\\p{Control}","u").test(d)||this._charsToConsume.push(d)}_refreshRows(d,b){this._liveRegionDebouncer.refresh(d,b,this._terminal.rows)}_renderRows(d,b){const x=this._terminal.buffer,L=x.lines.length.toString();for(let R=d;R<=b;R++){const M=x.lines.get(x.ydisp+R),k=[],O=M?.translateToString(!0,void 0,void 0,k)||"",U=(x.ydisp+R+1).toString(),F=this._rowElements[R];F&&(O.length===0?(F.innerText=" ",this._rowColumns.set(F,[0,1])):(F.textContent=O,this._rowColumns.set(F,k)),F.setAttribute("aria-posinset",U),F.setAttribute("aria-setsize",L))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(d,b){const x=d.target,L=this._rowElements[b===0?1:this._rowElements.length-2];if(x.getAttribute("aria-posinset")===(b===0?"1":`${this._terminal.buffer.lines.length}`)||d.relatedTarget!==L)return;let R,M;if(b===0?(R=x,M=this._rowElements.pop(),this._rowContainer.removeChild(M)):(R=this._rowElements.shift(),M=x,this._rowContainer.removeChild(R)),R.removeEventListener("focus",this._topBoundaryFocusListener),M.removeEventListener("focus",this._bottomBoundaryFocusListener),b===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(b===0?-1:1),this._rowElements[b===0?1:this._rowElements.length-2].focus(),d.preventDefault(),d.stopImmediatePropagation()}_handleSelectionChange(){if(this._rowElements.length===0)return;const d=document.getSelection();if(!d)return;if(d.isCollapsed)return void(this._rowContainer.contains(d.anchorNode)&&this._terminal.clearSelection());if(!d.anchorNode||!d.focusNode)return void console.error("anchorNode and/or focusNode are null");let b={node:d.anchorNode,offset:d.anchorOffset},x={node:d.focusNode,offset:d.focusOffset};if((b.node.compareDocumentPosition(x.node)&Node.DOCUMENT_POSITION_PRECEDING||b.node===x.node&&b.offset>x.offset)&&([b,x]=[x,b]),b.node.compareDocumentPosition(this._rowElements[0])&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_FOLLOWING)&&(b={node:this._rowElements[0].childNodes[0],offset:0}),!this._rowContainer.contains(b.node))return;const L=this._rowElements.slice(-1)[0];if(x.node.compareDocumentPosition(L)&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_PRECEDING)&&(x={node:L,offset:L.textContent?.length??0}),!this._rowContainer.contains(x.node))return;const R=({node:O,offset:U})=>{const F=O instanceof Text?O.parentNode:O;let G=parseInt(F?.getAttribute("aria-posinset"),10)-1;if(isNaN(G))return console.warn("row is invalid. Race condition?"),null;const I=this._rowColumns.get(F);if(!I)return console.warn("columns is null. Race condition?"),null;let K=U<I.length?I[U]:I.slice(-1)[0]+1;return K>=this._terminal.cols&&(++G,K=0),{row:G,column:K}},M=R(b),k=R(x);if(M&&k){if(M.row>k.row||M.row===k.row&&M.column>=k.column)throw new Error("invalid range");this._terminal.select(M.column,M.row,(k.row-M.row)*this._terminal.cols-M.column+k.column)}}_handleResize(d){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(let b=this._rowContainer.children.length;b<this._terminal.rows;b++)this._rowElements[b]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[b]);for(;this._rowElements.length>d;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){const d=this._coreBrowserService.mainDocument.createElement("div");return d.setAttribute("role","listitem"),d.tabIndex=-1,this._refreshRowDimensions(d),d}_refreshRowsDimensions(){if(this._renderService.dimensions.css.cell.height){this._accessibilityContainer.style.width=`${this._renderService.dimensions.css.canvas.width}px`,this._rowElements.length!==this._terminal.rows&&this._handleResize(this._terminal.rows);for(let d=0;d<this._terminal.rows;d++)this._refreshRowDimensions(this._rowElements[d])}}_refreshRowDimensions(d){d.style.height=`${this._renderService.dimensions.css.cell.height}px`}};c.AccessibilityManager=v=h([y(1,T.IInstantiationService),y(2,A.ICoreBrowserService),y(3,A.IRenderService)],v)},3614:(m,c)=>{function u(C){return C.replace(/\r?\n/g,"\r")}function h(C,E){return E?"\x1B[200~"+C+"\x1B[201~":C}function y(C,E,A,T){C=h(C=u(C),A.decPrivateModes.bracketedPasteMode&&T.rawOptions.ignoreBracketedPasteMode!==!0),A.triggerDataEvent(C,!0),E.value=""}function g(C,E,A){const T=A.getBoundingClientRect(),p=C.clientX-T.left-10,v=C.clientY-T.top-10;E.style.width="20px",E.style.height="20px",E.style.left=`${p}px`,E.style.top=`${v}px`,E.style.zIndex="1000",E.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,E){C.clipboardData&&C.clipboardData.setData("text/plain",E.selectionText),C.preventDefault()},c.handlePasteEvent=function(C,E,A,T){C.stopPropagation(),C.clipboardData&&y(C.clipboardData.getData("text/plain"),E,A,T)},c.paste=y,c.moveTextAreaUnderMouseCursor=g,c.rightClickHandler=function(C,E,A,T,p){g(C,E,A),p&&T.rightClickSelect(C),E.value=T.selectionText,E.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(y,g,C){this._css.set(y,g,C)}getCss(y,g){return this._css.get(y,g)}setColor(y,g,C){this._color.set(y,g,C)}getColor(y,g){return this._color.get(y,g)}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,y,g){u.addEventListener(h,y,g);let C=!1;return{dispose:()=>{C||(C=!0,u.removeEventListener(h,y,g))}}}},3551:function(m,c,u){var h=this&&this.__decorate||function(v,d,b,x){var L,R=arguments.length,M=R<3?d:x===null?x=Object.getOwnPropertyDescriptor(d,b):x;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")M=Reflect.decorate(v,d,b,x);else for(var k=v.length-1;k>=0;k--)(L=v[k])&&(M=(R<3?L(M):R>3?L(d,b,M):L(d,b))||M);return R>3&&M&&Object.defineProperty(d,b,M),M},y=this&&this.__param||function(v,d){return function(b,x){d(b,x,v)}};Object.defineProperty(c,"__esModule",{value:!0}),c.Linkifier=void 0;const g=u(3656),C=u(8460),E=u(844),A=u(2585),T=u(4725);let p=c.Linkifier=class extends E.Disposable{get currentLink(){return this._currentLink}constructor(v,d,b,x,L){super(),this._element=v,this._mouseService=d,this._renderService=b,this._bufferService=x,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,E.getDisposeArrayDisposable)(this._linkCacheDisposables)),this.register((0,E.toDisposable)((()=>{this._lastMouseEvent=void 0,this._activeProviderReplies?.clear()}))),this.register(this._bufferService.onResize((()=>{this._clearCurrentLink(),this._wasResized=!0}))),this.register((0,g.addDisposableDomListener)(this._element,"mouseleave",(()=>{this._isMouseOut=!0,this._clearCurrentLink()}))),this.register((0,g.addDisposableDomListener)(this._element,"mousemove",this._handleMouseMove.bind(this))),this.register((0,g.addDisposableDomListener)(this._element,"mousedown",this._handleMouseDown.bind(this))),this.register((0,g.addDisposableDomListener)(this._element,"mouseup",this._handleMouseUp.bind(this)))}_handleMouseMove(v){this._lastMouseEvent=v;const d=this._positionFromMouseEvent(v,this._element,this._mouseService);if(!d)return;this._isMouseOut=!1;const b=v.composedPath();for(let x=0;x<b.length;x++){const L=b[x];if(L.classList.contains("xterm"))break;if(L.classList.contains("xterm-hover"))return}this._lastBufferCell&&d.x===this._lastBufferCell.x&&d.y===this._lastBufferCell.y||(this._handleHover(d),this._lastBufferCell=d)}_handleHover(v){if(this._activeLine!==v.y||this._wasResized)return this._clearCurrentLink(),this._askForLink(v,!1),void(this._wasResized=!1);this._currentLink&&this._linkAtPosition(this._currentLink.link,v)||(this._clearCurrentLink(),this._askForLink(v,!0))}_askForLink(v,d){this._activeProviderReplies&&d||(this._activeProviderReplies?.forEach((x=>{x?.forEach((L=>{L.link.dispose&&L.link.dispose()}))})),this._activeProviderReplies=new Map,this._activeLine=v.y);let b=!1;for(const[x,L]of this._linkProviderService.linkProviders.entries())d?this._activeProviderReplies?.get(x)&&(b=this._checkLinkProviderResult(x,v,b)):L.provideLinks(v.y,(R=>{if(this._isMouseOut)return;const M=R?.map((k=>({link:k})));this._activeProviderReplies?.set(x,M),b=this._checkLinkProviderResult(x,v,b),this._activeProviderReplies?.size===this._linkProviderService.linkProviders.length&&this._removeIntersectingLinks(v.y,this._activeProviderReplies)}))}_removeIntersectingLinks(v,d){const b=new Set;for(let x=0;x<d.size;x++){const L=d.get(x);if(L)for(let R=0;R<L.length;R++){const M=L[R],k=M.link.range.start.y<v?0:M.link.range.start.x,O=M.link.range.end.y>v?this._bufferService.cols:M.link.range.end.x;for(let U=k;U<=O;U++){if(b.has(U)){L.splice(R--,1);break}b.add(U)}}}}_checkLinkProviderResult(v,d,b){if(!this._activeProviderReplies)return b;const x=this._activeProviderReplies.get(v);let L=!1;for(let R=0;R<v;R++)this._activeProviderReplies.has(R)&&!this._activeProviderReplies.get(R)||(L=!0);if(!L&&x){const R=x.find((M=>this._linkAtPosition(M.link,d)));R&&(b=!0,this._handleNewLink(R))}if(this._activeProviderReplies.size===this._linkProviderService.linkProviders.length&&!b)for(let R=0;R<this._activeProviderReplies.size;R++){const M=this._activeProviderReplies.get(R)?.find((k=>this._linkAtPosition(k.link,d)));if(M){b=!0,this._handleNewLink(M);break}}return b}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(v){if(!this._currentLink)return;const d=this._positionFromMouseEvent(v,this._element,this._mouseService);d&&this._mouseDownLink===this._currentLink&&this._linkAtPosition(this._currentLink.link,d)&&this._currentLink.link.activate(v,this._currentLink.link.text)}_clearCurrentLink(v,d){this._currentLink&&this._lastMouseEvent&&(!v||!d||this._currentLink.link.range.start.y>=v&&this._currentLink.link.range.end.y<=d)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,(0,E.disposeArray)(this._linkCacheDisposables))}_handleNewLink(v){if(!this._lastMouseEvent)return;const d=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);d&&this._linkAtPosition(v.link,d)&&(this._currentLink=v,this._currentLink.state={decorations:{underline:v.link.decorations===void 0||v.link.decorations.underline,pointerCursor:v.link.decorations===void 0||v.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,v.link,this._lastMouseEvent),v.link.decorations={},Object.defineProperties(v.link.decorations,{pointerCursor:{get:()=>this._currentLink?.state?.decorations.pointerCursor,set:b=>{this._currentLink?.state&&this._currentLink.state.decorations.pointerCursor!==b&&(this._currentLink.state.decorations.pointerCursor=b,this._currentLink.state.isHovered&&this._element.classList.toggle("xterm-cursor-pointer",b))}},underline:{get:()=>this._currentLink?.state?.decorations.underline,set:b=>{this._currentLink?.state&&this._currentLink?.state?.decorations.underline!==b&&(this._currentLink.state.decorations.underline=b,this._currentLink.state.isHovered&&this._fireUnderlineEvent(v.link,b))}}}),this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange((b=>{if(!this._currentLink)return;const x=b.start===0?0:b.start+1+this._bufferService.buffer.ydisp,L=this._bufferService.buffer.ydisp+1+b.end;if(this._currentLink.link.range.start.y>=x&&this._currentLink.link.range.end.y<=L&&(this._clearCurrentLink(x,L),this._lastMouseEvent)){const R=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);R&&this._askForLink(R,!1)}}))))}_linkHover(v,d,b){this._currentLink?.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(d,!0),this._currentLink.state.decorations.pointerCursor&&v.classList.add("xterm-cursor-pointer")),d.hover&&d.hover(b,d.text)}_fireUnderlineEvent(v,d){const b=v.range,x=this._bufferService.buffer.ydisp,L=this._createLinkUnderlineEvent(b.start.x-1,b.start.y-x-1,b.end.x,b.end.y-x-1,void 0);(d?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(L)}_linkLeave(v,d,b){this._currentLink?.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(d,!1),this._currentLink.state.decorations.pointerCursor&&v.classList.remove("xterm-cursor-pointer")),d.leave&&d.leave(b,d.text)}_linkAtPosition(v,d){const b=v.range.start.y*this._bufferService.cols+v.range.start.x,x=v.range.end.y*this._bufferService.cols+v.range.end.x,L=d.y*this._bufferService.cols+d.x;return b<=L&&L<=x}_positionFromMouseEvent(v,d,b){const x=b.getCoords(v,d,this._bufferService.cols,this._bufferService.rows);if(x)return{x:x[0],y:x[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(v,d,b,x,L){return{x1:v,y1:d,x2:b,y2:x,cols:this._bufferService.cols,fg:L}}};c.Linkifier=p=h([y(1,T.IMouseService),y(2,T.IRenderService),y(3,A.IBufferService),y(4,T.ILinkProviderService)],p)},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(T,p,v,d){var b,x=arguments.length,L=x<3?p:d===null?d=Object.getOwnPropertyDescriptor(p,v):d;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")L=Reflect.decorate(T,p,v,d);else for(var R=T.length-1;R>=0;R--)(b=T[R])&&(L=(x<3?b(L):x>3?b(p,v,L):b(p,v))||L);return x>3&&L&&Object.defineProperty(p,v,L),L},y=this&&this.__param||function(T,p){return function(v,d){p(v,d,T)}};Object.defineProperty(c,"__esModule",{value:!0}),c.OscLinkProvider=void 0;const g=u(511),C=u(2585);let E=c.OscLinkProvider=class{constructor(T,p,v){this._bufferService=T,this._optionsService=p,this._oscLinkService=v}provideLinks(T,p){const v=this._bufferService.buffer.lines.get(T-1);if(!v)return void p(void 0);const d=[],b=this._optionsService.rawOptions.linkHandler,x=new g.CellData,L=v.getTrimmedLength();let R=-1,M=-1,k=!1;for(let O=0;O<L;O++)if(M!==-1||v.hasContent(O)){if(v.loadCell(O,x),x.hasExtendedAttrs()&&x.extended.urlId){if(M===-1){M=O,R=x.extended.urlId;continue}k=x.extended.urlId!==R}else M!==-1&&(k=!0);if(k||M!==-1&&O===L-1){const U=this._oscLinkService.getLinkData(R)?.uri;if(U){const F={start:{x:M+1,y:T},end:{x:O+(k||O!==L-1?0:1),y:T}};let G=!1;if(!b?.allowNonHttpProtocols)try{const I=new URL(U);["http:","https:"].includes(I.protocol)||(G=!0)}catch{G=!0}G||d.push({text:U,range:F,activate:(I,K)=>b?b.activate(I,K,F):A(0,K),hover:(I,K)=>b?.hover?.(I,K,F),leave:(I,K)=>b?.leave?.(I,K,F)})}k=!1,x.hasExtendedAttrs()&&x.extended.urlId?(M=O,R=x.extended.urlId):(M=-1,R=-1)}}p(d)}};function A(T,p){if(confirm(`Do you want to navigate to ${p}?
|
|
771
|
+
|
|
772
|
+
WARNING: This link could potentially be dangerous`)){const v=window.open();if(v){try{v.opener=null}catch{}v.location.href=p}else console.warn("Opening link blocked as opener could not be cleared")}}c.OscLinkProvider=E=h([y(0,C.IBufferService),y(1,C.IOptionsService),y(2,C.IOscLinkService)],E)},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,y){this._rowCount=y,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),y=u(3656),g=u(3551),C=u(9042),E=u(3730),A=u(1680),T=u(3107),p=u(5744),v=u(2950),d=u(1296),b=u(428),x=u(4269),L=u(5114),R=u(8934),M=u(3230),k=u(9312),O=u(4725),U=u(6731),F=u(8055),G=u(8969),I=u(8460),K=u(844),te=u(6114),q=u(8437),W=u(2584),Y=u(7399),B=u(5941),z=u(9074),N=u(2585),P=u(5435),Z=u(4567),ae=u(779);class ce extends G.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 K.MutableDisposable),this._onCursorMove=this.register(new I.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onKey=this.register(new I.EventEmitter),this.onKey=this._onKey.event,this._onRender=this.register(new I.EventEmitter),this.onRender=this._onRender.event,this._onSelectionChange=this.register(new I.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onTitleChange=this.register(new I.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onBell=this.register(new I.EventEmitter),this.onBell=this._onBell.event,this._onFocus=this.register(new I.EventEmitter),this._onBlur=this.register(new I.EventEmitter),this._onA11yCharEmitter=this.register(new I.EventEmitter),this._onA11yTabEmitter=this.register(new I.EventEmitter),this._onWillOpen=this.register(new I.EventEmitter),this._setup(),this._decorationService=this._instantiationService.createInstance(z.DecorationService),this._instantiationService.setService(N.IDecorationService,this._decorationService),this._linkProviderService=this._instantiationService.createInstance(ae.LinkProviderService),this._instantiationService.setService(O.ILinkProviderService,this._linkProviderService),this._linkProviderService.registerLinkProvider(this._instantiationService.createInstance(E.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,I.forwardEvent)(this._inputHandler.onCursorMove,this._onCursorMove)),this.register((0,I.forwardEvent)(this._inputHandler.onTitleChange,this._onTitleChange)),this.register((0,I.forwardEvent)(this._inputHandler.onA11yChar,this._onA11yCharEmitter)),this.register((0,I.forwardEvent)(this._inputHandler.onA11yTab,this._onA11yTabEmitter)),this.register(this._bufferService.onResize(($=>this._afterResize($.cols,$.rows)))),this.register((0,K.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 Se=F.color.toColorRGB(oe==="ansi"?this._themeService.colors.ansi[$.index]:this._themeService.colors[oe]);this.coreService.triggerDataEvent(`${W.C0.ESC}]${ge};${(0,B.toRgbString)(Se)}${W.C1_ESCAPED.ST}`);break;case 1:if(oe==="ansi")this._themeService.modifyColors((ye=>ye.ansi[$.index]=F.channels.toColor(...$.color)));else{const ye=oe;this._themeService.modifyColors(($e=>$e[ye]=F.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(Z.AccessibilityManager,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(Q){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(W.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(W.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,Se=$.getWidth(oe),ye=this._renderService.dimensions.css.cell.width*Se,$e=this.buffer.y*this._renderService.dimensions.css.cell.height,Fe=oe*this._renderService.dimensions.css.cell.width;this.textarea.style.left=Fe+"px",this.textarea.style.top=$e+"px",this.textarea.style.width=ye+"px",this.textarea.style.height=ge+"px",this.textarea.style.lineHeight=ge+"px",this.textarea.style.zIndex="-5"}_initGlobal(){this._bindKeys(),this.register((0,y.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,y.addDisposableDomListener)(this.textarea,"paste",Q)),this.register((0,y.addDisposableDomListener)(this.element,"paste",Q)),te.isFirefox?this.register((0,y.addDisposableDomListener)(this.element,"mousedown",($=>{$.button===2&&(0,h.rightClickHandler)($,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))):this.register((0,y.addDisposableDomListener)(this.element,"contextmenu",($=>{(0,h.rightClickHandler)($,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))),te.isLinux&&this.register((0,y.addDisposableDomListener)(this.element,"auxclick",($=>{$.button===1&&(0,h.moveTextAreaUnderMouseCursor)($,this.textarea,this.screenElement)})))}_bindKeys(){this.register((0,y.addDisposableDomListener)(this.textarea,"keyup",(Q=>this._keyUp(Q)),!0)),this.register((0,y.addDisposableDomListener)(this.textarea,"keydown",(Q=>this._keyDown(Q)),!0)),this.register((0,y.addDisposableDomListener)(this.textarea,"keypress",(Q=>this._keyPress(Q)),!0)),this.register((0,y.addDisposableDomListener)(this.textarea,"compositionstart",(()=>this._compositionHelper.compositionstart()))),this.register((0,y.addDisposableDomListener)(this.textarea,"compositionupdate",(Q=>this._compositionHelper.compositionupdate(Q)))),this.register((0,y.addDisposableDomListener)(this.textarea,"compositionend",(()=>this._compositionHelper.compositionend()))),this.register((0,y.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,y.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(O.ICoreBrowserService,this._coreBrowserService),this.register((0,y.addDisposableDomListener)(this.textarea,"focus",(oe=>this._handleTextAreaFocus(oe)))),this.register((0,y.addDisposableDomListener)(this.textarea,"blur",(()=>this._handleTextAreaBlur()))),this._helperContainer.appendChild(this.textarea),this._charSizeService=this._instantiationService.createInstance(b.CharSizeService,this._document,this._helperContainer),this._instantiationService.setService(O.ICharSizeService,this._charSizeService),this._themeService=this._instantiationService.createInstance(U.ThemeService),this._instantiationService.setService(O.IThemeService,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(x.CharacterJoinerService),this._instantiationService.setService(O.ICharacterJoinerService,this._characterJoinerService),this._renderService=this.register(this._instantiationService.createInstance(M.RenderService,this.rows,this.screenElement)),this._instantiationService.setService(O.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(v.CompositionHelper,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this._mouseService=this._instantiationService.createInstance(R.MouseService),this._instantiationService.setService(O.IMouseService,this._mouseService),this.linkifier=this.register(this._instantiationService.createInstance(g.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(O.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,y.addDisposableDomListener)(this._viewportElement,"scroll",(()=>this._selectionService.refresh()))),this.register(this._instantiationService.createInstance(T.BufferDecorationRenderer,this.screenElement)),this.register((0,y.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(Z.AccessibilityManager,this)),this.register(this.optionsService.onSpecificOptionChange("screenReaderMode",(oe=>this._handleScreenReaderModeOptionChange(oe)))),this.options.overviewRulerWidth&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(p.OverviewRulerRenderer,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRulerWidth",(oe=>{!this._overviewRulerRenderer&&oe&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(p.OverviewRulerRenderer,this._viewportElement,this.screenElement)))})),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()}_createRenderer(){return this._instantiationService.createInstance(d.DomRenderer,this,this._document,this.element,this.screenElement,this._viewportElement,this._helperContainer,this.linkifier)}bindMouse(){const Q=this,$=this.element;function oe(ye){const $e=Q._mouseService.getMouseReportCoords(ye,Q.screenElement);if(!$e)return!1;let Fe,Xe;switch(ye.overrideType||ye.type){case"mousemove":Xe=32,ye.buttons===void 0?(Fe=3,ye.button!==void 0&&(Fe=ye.button<3?ye.button:3)):Fe=1&ye.buttons?0:4&ye.buttons?1:2&ye.buttons?2:3;break;case"mouseup":Xe=0,Fe=ye.button<3?ye.button:3;break;case"mousedown":Xe=1,Fe=ye.button<3?ye.button:3;break;case"wheel":if(Q._customWheelEventHandler&&Q._customWheelEventHandler(ye)===!1||Q.viewport.getLinesScrolled(ye)===0)return!1;Xe=ye.deltaY<0?0:1,Fe=4;break;default:return!1}return!(Xe===void 0||Fe===void 0||Fe>4)&&Q.coreMouseService.triggerMouseEvent({col:$e.col,row:$e.row,x:$e.x,y:$e.y,button:Fe,action:Xe,ctrl:ye.ctrlKey,alt:ye.altKey,shift:ye.shiftKey})}const ge={mouseup:null,wheel:null,mousedrag:null,mousemove:null},Se={mouseup:ye=>(oe(ye),ye.buttons||(this._document.removeEventListener("mouseup",ge.mouseup),ge.mousedrag&&this._document.removeEventListener("mousemove",ge.mousedrag)),this.cancel(ye)),wheel:ye=>(oe(ye),this.cancel(ye,!0)),mousedrag:ye=>{ye.buttons&&oe(ye)},mousemove:ye=>{ye.buttons||oe(ye)}};this.register(this.coreMouseService.onProtocolChange((ye=>{ye?(this.optionsService.rawOptions.logLevel==="debug"&&this._logService.debug("Binding to mouse events:",this.coreMouseService.explainEvents(ye)),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&ye?ge.mousemove||($.addEventListener("mousemove",Se.mousemove),ge.mousemove=Se.mousemove):($.removeEventListener("mousemove",ge.mousemove),ge.mousemove=null),16&ye?ge.wheel||($.addEventListener("wheel",Se.wheel,{passive:!1}),ge.wheel=Se.wheel):($.removeEventListener("wheel",ge.wheel),ge.wheel=null),2&ye?ge.mouseup||(ge.mouseup=Se.mouseup):(this._document.removeEventListener("mouseup",ge.mouseup),ge.mouseup=null),4&ye?ge.mousedrag||(ge.mousedrag=Se.mousedrag):(this._document.removeEventListener("mousemove",ge.mousedrag),ge.mousedrag=null)}))),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this.register((0,y.addDisposableDomListener)($,"mousedown",(ye=>{if(ye.preventDefault(),this.focus(),this.coreMouseService.areMouseEventsActive&&!this._selectionService.shouldForceSelection(ye))return oe(ye),ge.mouseup&&this._document.addEventListener("mouseup",ge.mouseup),ge.mousedrag&&this._document.addEventListener("mousemove",ge.mousedrag),this.cancel(ye)}))),this.register((0,y.addDisposableDomListener)($,"wheel",(ye=>{if(!ge.wheel){if(this._customWheelEventHandler&&this._customWheelEventHandler(ye)===!1)return!1;if(!this.buffer.hasScrollback){const $e=this.viewport.getLinesScrolled(ye);if($e===0)return;const Fe=W.C0.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(ye.deltaY<0?"A":"B");let Xe="";for(let xt=0;xt<Math.abs($e);xt++)Xe+=Fe;return this.coreService.triggerDataEvent(Xe,!0),this.cancel(ye,!0)}return this.viewport.handleWheel(ye)?this.cancel(ye):void 0}}),{passive:!1})),this.register((0,y.addDisposableDomListener)($,"touchstart",(ye=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchStart(ye),this.cancel(ye)}),{passive:!0})),this.register((0,y.addDisposableDomListener)($,"touchmove",(ye=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchMove(ye)?void 0:this.cancel(ye)}),{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!==W.C0.ETX&&oe.key!==W.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(q.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(W.C0.ESC+"[I"):this.coreService.triggerDataEvent(W.C0.ESC+"[O")}_reportWindowsOptions(Q){if(this._renderService)switch(Q){case P.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(`${W.C0.ESC}[4;${oe};${$}t`);break;case P.WindowsOptionsReportType.GET_CELL_SIZE_PIXELS:const ge=this._renderService.dimensions.css.cell.width.toFixed(0),Se=this._renderService.dimensions.css.cell.height.toFixed(0);this.coreService.triggerDataEvent(`${W.C0.ESC}[6;${Se};${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,y){this._rowCount=y,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 g=Date.now();if(g-this._lastRefreshMs>=this._debounceThresholdMS)this._lastRefreshMs=g,this._innerRefresh();else if(!this._additionalRefreshRequested){const C=g-this._lastRefreshMs,E=this._debounceThresholdMS-C;this._additionalRefreshRequested=!0,this._refreshTimeoutID=window.setTimeout((()=>{this._lastRefreshMs=Date.now(),this._innerRefresh(),this._additionalRefreshRequested=!1,this._refreshTimeoutID=void 0}),E)}}_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(v,d,b,x){var L,R=arguments.length,M=R<3?d:x===null?x=Object.getOwnPropertyDescriptor(d,b):x;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")M=Reflect.decorate(v,d,b,x);else for(var k=v.length-1;k>=0;k--)(L=v[k])&&(M=(R<3?L(M):R>3?L(d,b,M):L(d,b))||M);return R>3&&M&&Object.defineProperty(d,b,M),M},y=this&&this.__param||function(v,d){return function(b,x){d(b,x,v)}};Object.defineProperty(c,"__esModule",{value:!0}),c.Viewport=void 0;const g=u(3656),C=u(4725),E=u(8460),A=u(844),T=u(2585);let p=c.Viewport=class extends A.Disposable{constructor(v,d,b,x,L,R,M,k){super(),this._viewportElement=v,this._scrollArea=d,this._bufferService=b,this._optionsService=x,this._charSizeService=L,this._renderService=R,this._coreBrowserService=M,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 E.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this.scrollBarWidth=this._viewportElement.offsetWidth-this._scrollArea.offsetWidth||15,this.register((0,g.addDisposableDomListener)(this._viewportElement,"scroll",this._handleScroll.bind(this))),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate((O=>this._activeBuffer=O.activeBuffer))),this._renderDimensions=this._renderService.dimensions,this.register(this._renderService.onDimensionsChange((O=>this._renderDimensions=O))),this._handleThemeChange(k.colors),this.register(k.onChangeColors((O=>this._handleThemeChange(O)))),this.register(this._optionsService.onSpecificOptionChange("scrollback",(()=>this.syncScrollArea()))),setTimeout((()=>this.syncScrollArea()))}_handleThemeChange(v){this._viewportElement.style.backgroundColor=v.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(v){if(v)return this._innerRefresh(),void(this._refreshAnimationFrame!==null&&this._coreBrowserService.window.cancelAnimationFrame(this._refreshAnimationFrame));this._refreshAnimationFrame===null&&(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._innerRefresh())))}_innerRefresh(){if(this._charSizeService.height>0){this._currentRowHeight=this._renderDimensions.device.cell.height/this._coreBrowserService.dpr,this._currentDeviceCellHeight=this._renderDimensions.device.cell.height,this._lastRecordedViewportHeight=this._viewportElement.offsetHeight;const d=Math.round(this._currentRowHeight*this._lastRecordedBufferLength)+(this._lastRecordedViewportHeight-this._renderDimensions.css.canvas.height);this._lastRecordedBufferHeight!==d&&(this._lastRecordedBufferHeight=d,this._scrollArea.style.height=this._lastRecordedBufferHeight+"px")}const v=this._bufferService.buffer.ydisp*this._currentRowHeight;this._viewportElement.scrollTop!==v&&(this._ignoreNextScrollEvent=!0,this._viewportElement.scrollTop=v),this._refreshAnimationFrame=null}syncScrollArea(v=!1){if(this._lastRecordedBufferLength!==this._bufferService.buffer.lines.length)return this._lastRecordedBufferLength=this._bufferService.buffer.lines.length,void this._refresh(v);this._lastRecordedViewportHeight===this._renderService.dimensions.css.canvas.height&&this._lastScrollTop===this._activeBuffer.ydisp*this._currentRowHeight&&this._renderDimensions.device.cell.height===this._currentDeviceCellHeight||this._refresh(v)}_handleScroll(v){if(this._lastScrollTop=this._viewportElement.scrollTop,!this._viewportElement.offsetParent)return;if(this._ignoreNextScrollEvent)return this._ignoreNextScrollEvent=!1,void this._onRequestScrollLines.fire({amount:0,suppressScrollEvent:!0});const d=Math.round(this._lastScrollTop/this._currentRowHeight)-this._bufferService.buffer.ydisp;this._onRequestScrollLines.fire({amount:d,suppressScrollEvent:!0})}_smoothScroll(){if(this._isDisposed||this._smoothScrollState.origin===-1||this._smoothScrollState.target===-1)return;const v=this._smoothScrollPercent();this._viewportElement.scrollTop=this._smoothScrollState.origin+Math.round(v*(this._smoothScrollState.target-this._smoothScrollState.origin)),v<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(v,d){const b=this._viewportElement.scrollTop+this._lastRecordedViewportHeight;return!(d<0&&this._viewportElement.scrollTop!==0||d>0&&b<this._lastRecordedBufferHeight)||(v.cancelable&&v.preventDefault(),!1)}handleWheel(v){const d=this._getPixelsScrolled(v);return d!==0&&(this._optionsService.rawOptions.smoothScrollDuration?(this._smoothScrollState.startTime=Date.now(),this._smoothScrollPercent()<1?(this._smoothScrollState.origin=this._viewportElement.scrollTop,this._smoothScrollState.target===-1?this._smoothScrollState.target=this._viewportElement.scrollTop+d:this._smoothScrollState.target+=d,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()):this._viewportElement.scrollTop+=d,this._bubbleScroll(v,d))}scrollLines(v){if(v!==0)if(this._optionsService.rawOptions.smoothScrollDuration){const d=v*this._currentRowHeight;this._smoothScrollState.startTime=Date.now(),this._smoothScrollPercent()<1?(this._smoothScrollState.origin=this._viewportElement.scrollTop,this._smoothScrollState.target=this._smoothScrollState.origin+d,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()}else this._onRequestScrollLines.fire({amount:v,suppressScrollEvent:!1})}_getPixelsScrolled(v){if(v.deltaY===0||v.shiftKey)return 0;let d=this._applyScrollModifier(v.deltaY,v);return v.deltaMode===WheelEvent.DOM_DELTA_LINE?d*=this._currentRowHeight:v.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(d*=this._currentRowHeight*this._bufferService.rows),d}getBufferElements(v,d){let b,x="";const L=[],R=d??this._bufferService.buffer.lines.length,M=this._bufferService.buffer.lines;for(let k=v;k<R;k++){const O=M.get(k);if(!O)continue;const U=M.get(k+1)?.isWrapped;if(x+=O.translateToString(!U),!U||k===M.length-1){const F=document.createElement("div");F.textContent=x,L.push(F),x.length>0&&(b=F),x=""}}return{bufferElements:L,cursorElement:b}}getLinesScrolled(v){if(v.deltaY===0||v.shiftKey)return 0;let d=this._applyScrollModifier(v.deltaY,v);return v.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(d/=this._currentRowHeight+0,this._wheelPartialScroll+=d,d=Math.floor(Math.abs(this._wheelPartialScroll))*(this._wheelPartialScroll>0?1:-1),this._wheelPartialScroll%=1):v.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(d*=this._bufferService.rows),d}_applyScrollModifier(v,d){const b=this._optionsService.rawOptions.fastScrollModifier;return b==="alt"&&d.altKey||b==="ctrl"&&d.ctrlKey||b==="shift"&&d.shiftKey?v*this._optionsService.rawOptions.fastScrollSensitivity*this._optionsService.rawOptions.scrollSensitivity:v*this._optionsService.rawOptions.scrollSensitivity}handleTouchStart(v){this._lastTouchY=v.touches[0].pageY}handleTouchMove(v){const d=this._lastTouchY-v.touches[0].pageY;return this._lastTouchY=v.touches[0].pageY,d!==0&&(this._viewportElement.scrollTop+=d,this._bubbleScroll(v,d))}};c.Viewport=p=h([y(2,T.IBufferService),y(3,T.IOptionsService),y(4,C.ICharSizeService),y(5,C.IRenderService),y(6,C.ICoreBrowserService),y(7,C.IThemeService)],p)},3107:function(m,c,u){var h=this&&this.__decorate||function(T,p,v,d){var b,x=arguments.length,L=x<3?p:d===null?d=Object.getOwnPropertyDescriptor(p,v):d;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")L=Reflect.decorate(T,p,v,d);else for(var R=T.length-1;R>=0;R--)(b=T[R])&&(L=(x<3?b(L):x>3?b(p,v,L):b(p,v))||L);return x>3&&L&&Object.defineProperty(p,v,L),L},y=this&&this.__param||function(T,p){return function(v,d){p(v,d,T)}};Object.defineProperty(c,"__esModule",{value:!0}),c.BufferDecorationRenderer=void 0;const g=u(4725),C=u(844),E=u(2585);let A=c.BufferDecorationRenderer=class extends C.Disposable{constructor(T,p,v,d,b){super(),this._screenElement=T,this._bufferService=p,this._coreBrowserService=v,this._decorationService=d,this._renderService=b,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((x=>this._removeDecoration(x)))),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 T of this._decorationService.decorations)this._renderDecoration(T);this._dimensionsChanged=!1}_renderDecoration(T){this._refreshStyle(T),this._dimensionsChanged&&this._refreshXPosition(T)}_createElement(T){const p=this._coreBrowserService.mainDocument.createElement("div");p.classList.add("xterm-decoration"),p.classList.toggle("xterm-decoration-top-layer",T?.options?.layer==="top"),p.style.width=`${Math.round((T.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,p.style.height=(T.options.height||1)*this._renderService.dimensions.css.cell.height+"px",p.style.top=(T.marker.line-this._bufferService.buffers.active.ydisp)*this._renderService.dimensions.css.cell.height+"px",p.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`;const v=T.options.x??0;return v&&v>this._bufferService.cols&&(p.style.display="none"),this._refreshXPosition(T,p),p}_refreshStyle(T){const p=T.marker.line-this._bufferService.buffers.active.ydisp;if(p<0||p>=this._bufferService.rows)T.element&&(T.element.style.display="none",T.onRenderEmitter.fire(T.element));else{let v=this._decorationElements.get(T);v||(v=this._createElement(T),T.element=v,this._decorationElements.set(T,v),this._container.appendChild(v),T.onDispose((()=>{this._decorationElements.delete(T),v.remove()}))),v.style.top=p*this._renderService.dimensions.css.cell.height+"px",v.style.display=this._altBufferIsActive?"none":"block",T.onRenderEmitter.fire(v)}}_refreshXPosition(T,p=T.element){if(!p)return;const v=T.options.x??0;(T.options.anchor||"left")==="right"?p.style.right=v?v*this._renderService.dimensions.css.cell.width+"px":"":p.style.left=v?v*this._renderService.dimensions.css.cell.width+"px":""}_removeDecoration(T){this._decorationElements.get(T)?.remove(),this._decorationElements.delete(T),T.dispose()}};c.BufferDecorationRenderer=A=h([y(1,E.IBufferService),y(2,g.ICoreBrowserService),y(3,E.IDecorationService),y(4,g.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,y){return h>=u.startBufferLine-this._linePadding[y||"full"]&&h<=u.endBufferLine+this._linePadding[y||"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(b,x,L,R){var M,k=arguments.length,O=k<3?x:R===null?R=Object.getOwnPropertyDescriptor(x,L):R;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")O=Reflect.decorate(b,x,L,R);else for(var U=b.length-1;U>=0;U--)(M=b[U])&&(O=(k<3?M(O):k>3?M(x,L,O):M(x,L))||O);return k>3&&O&&Object.defineProperty(x,L,O),O},y=this&&this.__param||function(b,x){return function(L,R){x(L,R,b)}};Object.defineProperty(c,"__esModule",{value:!0}),c.OverviewRulerRenderer=void 0;const g=u(5871),C=u(4725),E=u(844),A=u(2585),T={full:0,left:0,center:0,right:0},p={full:0,left:0,center:0,right:0},v={full:0,left:0,center:0,right:0};let d=c.OverviewRulerRenderer=class extends E.Disposable{get _width(){return this._optionsService.options.overviewRulerWidth||0}constructor(b,x,L,R,M,k,O){super(),this._viewportElement=b,this._screenElement=x,this._bufferService=L,this._decorationService=R,this._renderService=M,this._optionsService=k,this._coreBrowserService=O,this._colorZoneStore=new g.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 U=this._canvas.getContext("2d");if(!U)throw new Error("Ctx cannot be null");this._ctx=U,this._registerDecorationListeners(),this._registerBufferChangeListeners(),this._registerDimensionChangeListeners(),this.register((0,E.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 b=Math.floor(this._canvas.width/3),x=Math.ceil(this._canvas.width/3);p.full=this._canvas.width,p.left=b,p.center=x,p.right=b,this._refreshDrawHeightConstants(),v.full=0,v.left=0,v.center=p.left,v.right=p.left+p.center}_refreshDrawHeightConstants(){T.full=Math.round(2*this._coreBrowserService.dpr);const b=this._canvas.height/this._bufferService.buffer.lines.length,x=Math.round(Math.max(Math.min(b,12),6)*this._coreBrowserService.dpr);T.left=x,T.center=x,T.right=x}_refreshColorZonePadding(){this._colorZoneStore.setPadding({full:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*T.full),left:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*T.left),center:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*T.center),right:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*T.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 x of this._decorationService.decorations)this._colorZoneStore.addDecoration(x);this._ctx.lineWidth=1;const b=this._colorZoneStore.zones;for(const x of b)x.position!=="full"&&this._renderColorZone(x);for(const x of b)x.position==="full"&&this._renderColorZone(x);this._shouldUpdateDimensions=!1,this._shouldUpdateAnchor=!1}_renderColorZone(b){this._ctx.fillStyle=b.color,this._ctx.fillRect(v[b.position||"full"],Math.round((this._canvas.height-1)*(b.startBufferLine/this._bufferService.buffers.active.lines.length)-T[b.position||"full"]/2),p[b.position||"full"],Math.round((this._canvas.height-1)*((b.endBufferLine-b.startBufferLine)/this._bufferService.buffers.active.lines.length)+T[b.position||"full"]))}_queueRefresh(b,x){this._shouldUpdateDimensions=b||this._shouldUpdateDimensions,this._shouldUpdateAnchor=x||this._shouldUpdateAnchor,this._animationFrame===void 0&&(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>{this._refreshDecorations(),this._animationFrame=void 0})))}};c.OverviewRulerRenderer=d=h([y(2,A.IBufferService),y(3,A.IDecorationService),y(4,C.IRenderService),y(5,A.IOptionsService),y(6,C.ICoreBrowserService)],d)},2950:function(m,c,u){var h=this&&this.__decorate||function(T,p,v,d){var b,x=arguments.length,L=x<3?p:d===null?d=Object.getOwnPropertyDescriptor(p,v):d;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")L=Reflect.decorate(T,p,v,d);else for(var R=T.length-1;R>=0;R--)(b=T[R])&&(L=(x<3?b(L):x>3?b(p,v,L):b(p,v))||L);return x>3&&L&&Object.defineProperty(p,v,L),L},y=this&&this.__param||function(T,p){return function(v,d){p(v,d,T)}};Object.defineProperty(c,"__esModule",{value:!0}),c.CompositionHelper=void 0;const g=u(4725),C=u(2585),E=u(2584);let A=c.CompositionHelper=class{get isComposing(){return this._isComposing}constructor(T,p,v,d,b,x){this._textarea=T,this._compositionView=p,this._bufferService=v,this._optionsService=d,this._coreService=b,this._renderService=x,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(T){this._compositionView.textContent=T.data,this.updateCompositionElements(),setTimeout((()=>{this._compositionPosition.end=this._textarea.value.length}),0)}compositionend(){this._finalizeComposition(!0)}keydown(T){if(this._isComposing||this._isSendingComposition){if(T.keyCode===229||T.keyCode===16||T.keyCode===17||T.keyCode===18)return!1;this._finalizeComposition(!1)}return T.keyCode!==229||(this._handleAnyTextareaChanges(),!1)}_finalizeComposition(T){if(this._compositionView.classList.remove("active"),this._isComposing=!1,T){const p={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout((()=>{if(this._isSendingComposition){let v;this._isSendingComposition=!1,p.start+=this._dataAlreadySent.length,v=this._isComposing?this._textarea.value.substring(p.start,p.end):this._textarea.value.substring(p.start),v.length>0&&this._coreService.triggerDataEvent(v,!0)}}),0)}else{this._isSendingComposition=!1;const p=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(p,!0)}}_handleAnyTextareaChanges(){const T=this._textarea.value;setTimeout((()=>{if(!this._isComposing){const p=this._textarea.value,v=p.replace(T,"");this._dataAlreadySent=v,p.length>T.length?this._coreService.triggerDataEvent(v,!0):p.length<T.length?this._coreService.triggerDataEvent(`${E.C0.DEL}`,!0):p.length===T.length&&p!==T&&this._coreService.triggerDataEvent(p,!0)}}),0)}updateCompositionElements(T){if(this._isComposing){if(this._bufferService.buffer.isCursorInViewport){const p=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1),v=this._renderService.dimensions.css.cell.height,d=this._bufferService.buffer.y*this._renderService.dimensions.css.cell.height,b=p*this._renderService.dimensions.css.cell.width;this._compositionView.style.left=b+"px",this._compositionView.style.top=d+"px",this._compositionView.style.height=v+"px",this._compositionView.style.lineHeight=v+"px",this._compositionView.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._compositionView.style.fontSize=this._optionsService.rawOptions.fontSize+"px";const x=this._compositionView.getBoundingClientRect();this._textarea.style.left=b+"px",this._textarea.style.top=d+"px",this._textarea.style.width=Math.max(x.width,1)+"px",this._textarea.style.height=Math.max(x.height,1)+"px",this._textarea.style.lineHeight=x.height+"px"}T||setTimeout((()=>this.updateCompositionElements(!0)),0)}}};c.CompositionHelper=A=h([y(2,C.IBufferService),y(3,C.IOptionsService),y(4,C.ICoreService),y(5,g.IRenderService)],A)},9806:(m,c)=>{function u(h,y,g){const C=g.getBoundingClientRect(),E=h.getComputedStyle(g),A=parseInt(E.getPropertyValue("padding-left")),T=parseInt(E.getPropertyValue("padding-top"));return[y.clientX-C.left-A,y.clientY-C.top-T]}Object.defineProperty(c,"__esModule",{value:!0}),c.getCoords=c.getCoordsRelativeToElement=void 0,c.getCoordsRelativeToElement=u,c.getCoords=function(h,y,g,C,E,A,T,p,v){if(!A)return;const d=u(h,y,g);return d?(d[0]=Math.ceil((d[0]+(v?T/2:0))/T),d[1]=Math.ceil(d[1]/p),d[0]=Math.min(Math.max(d[0],1),C+(v?1:0)),d[1]=Math.min(Math.max(d[1],1),E),d):void 0}},9504:(m,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.moveToCellSequence=void 0;const h=u(2584);function y(p,v,d,b){const x=p-g(p,d),L=v-g(v,d),R=Math.abs(x-L)-(function(M,k,O){let U=0;const F=M-g(M,O),G=k-g(k,O);for(let I=0;I<Math.abs(F-G);I++){const K=C(M,k)==="A"?-1:1;O.buffer.lines.get(F+K*I)?.isWrapped&&U++}return U})(p,v,d);return T(R,A(C(p,v),b))}function g(p,v){let d=0,b=v.buffer.lines.get(p),x=b?.isWrapped;for(;x&&p>=0&&p<v.rows;)d++,b=v.buffer.lines.get(--p),x=b?.isWrapped;return d}function C(p,v){return p>v?"A":"B"}function E(p,v,d,b,x,L){let R=p,M=v,k="";for(;R!==d||M!==b;)R+=x?1:-1,x&&R>L.cols-1?(k+=L.buffer.translateBufferLineToString(M,!1,p,R),R=0,p=0,M++):!x&&R<0&&(k+=L.buffer.translateBufferLineToString(M,!1,0,p+1),R=L.cols-1,p=R,M--);return k+L.buffer.translateBufferLineToString(M,!1,p,R)}function A(p,v){const d=v?"O":"[";return h.C0.ESC+d+p}function T(p,v){p=Math.floor(p);let d="";for(let b=0;b<p;b++)d+=v;return d}c.moveToCellSequence=function(p,v,d,b){const x=d.buffer.x,L=d.buffer.y;if(!d.buffer.hasScrollback)return(function(k,O,U,F,G,I){return y(O,F,G,I).length===0?"":T(E(k,O,k,O-g(O,G),!1,G).length,A("D",I))})(x,L,0,v,d,b)+y(L,v,d,b)+(function(k,O,U,F,G,I){let K;K=y(O,F,G,I).length>0?F-g(F,G):O;const te=F,q=(function(W,Y,B,z,N,P){let Z;return Z=y(B,z,N,P).length>0?z-g(z,N):Y,W<B&&Z<=z||W>=B&&Z<z?"C":"D"})(k,O,U,F,G,I);return T(E(k,K,U,te,q==="C",G).length,A(q,I))})(x,L,p,v,d,b);let R;if(L===v)return R=x>p?"D":"C",T(Math.abs(x-p),A(R,b));R=L>v?"D":"C";const M=Math.abs(L-v);return T((function(k,O){return O.cols-k})(L>v?p:x,d)+(M-1)*d.cols+1+((L>v?x:p)-1),A(R,b))}},1296:function(m,c,u){var h=this&&this.__decorate||function(I,K,te,q){var W,Y=arguments.length,B=Y<3?K:q===null?q=Object.getOwnPropertyDescriptor(K,te):q;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")B=Reflect.decorate(I,K,te,q);else for(var z=I.length-1;z>=0;z--)(W=I[z])&&(B=(Y<3?W(B):Y>3?W(K,te,B):W(K,te))||B);return Y>3&&B&&Object.defineProperty(K,te,B),B},y=this&&this.__param||function(I,K){return function(te,q){K(te,q,I)}};Object.defineProperty(c,"__esModule",{value:!0}),c.DomRenderer=void 0;const g=u(3787),C=u(2550),E=u(2223),A=u(6171),T=u(6052),p=u(4725),v=u(8055),d=u(8460),b=u(844),x=u(2585),L="xterm-dom-renderer-owner-",R="xterm-rows",M="xterm-fg-",k="xterm-bg-",O="xterm-focus",U="xterm-selection";let F=1,G=c.DomRenderer=class extends b.Disposable{constructor(I,K,te,q,W,Y,B,z,N,P,Z,ae,ce){super(),this._terminal=I,this._document=K,this._element=te,this._screenElement=q,this._viewportElement=W,this._helperContainer=Y,this._linkifier2=B,this._charSizeService=N,this._optionsService=P,this._bufferService=Z,this._coreBrowserService=ae,this._themeService=ce,this._terminalClass=F++,this._rowElements=[],this._selectionRenderModel=(0,T.createSelectionRenderModel)(),this.onRequestRedraw=this.register(new d.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(U),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(g.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,b.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 I=this._coreBrowserService.dpr;this.dimensions.device.char.width=this._charSizeService.width*I,this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*I),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/I),this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/I),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 K=`${this._terminalSelector} .${R} span { display: inline-block; height: 100%; vertical-align: top;}`;this._dimensionsStyleElement.textContent=K,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(I){this._themeStyleElement||(this._themeStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._themeStyleElement));let K=`${this._terminalSelector} .${R} { color: ${I.foreground.css}; font-family: ${this._optionsService.rawOptions.fontFamily}; font-size: ${this._optionsService.rawOptions.fontSize}px; font-kerning: none; white-space: pre}`;K+=`${this._terminalSelector} .${R} .xterm-dim { color: ${v.color.multiplyOpacity(I.foreground,.5).css};}`,K+=`${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}`,q=`blink_bar_${this._terminalClass}`,W=`blink_block_${this._terminalClass}`;K+=`@keyframes ${te} { 50% { border-bottom-style: hidden; }}`,K+=`@keyframes ${q} { 50% { box-shadow: none; }}`,K+=`@keyframes ${W} { 0% { background-color: ${I.cursor.css}; color: ${I.cursorAccent.css}; } 50% { background-color: inherit; color: ${I.cursor.css}; }}`,K+=`${this._terminalSelector} .${R}.${O} .xterm-cursor.xterm-cursor-blink.xterm-cursor-underline { animation: ${te} 1s step-end infinite;}${this._terminalSelector} .${R}.${O} .xterm-cursor.xterm-cursor-blink.xterm-cursor-bar { animation: ${q} 1s step-end infinite;}${this._terminalSelector} .${R}.${O} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: ${W} 1s step-end infinite;}${this._terminalSelector} .${R} .xterm-cursor.xterm-cursor-block { background-color: ${I.cursor.css}; color: ${I.cursorAccent.css};}${this._terminalSelector} .${R} .xterm-cursor.xterm-cursor-block:not(.xterm-cursor-blink) { background-color: ${I.cursor.css} !important; color: ${I.cursorAccent.css} !important;}${this._terminalSelector} .${R} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${I.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${R} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${I.cursor.css} inset;}${this._terminalSelector} .${R} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${I.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,K+=`${this._terminalSelector} .${U} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${U} div { position: absolute; background-color: ${I.selectionBackgroundOpaque.css};}${this._terminalSelector} .${U} div { position: absolute; background-color: ${I.selectionInactiveBackgroundOpaque.css};}`;for(const[Y,B]of I.ansi.entries())K+=`${this._terminalSelector} .${M}${Y} { color: ${B.css}; }${this._terminalSelector} .${M}${Y}.xterm-dim { color: ${v.color.multiplyOpacity(B,.5).css}; }${this._terminalSelector} .${k}${Y} { background-color: ${B.css}; }`;K+=`${this._terminalSelector} .${M}${E.INVERTED_DEFAULT_COLOR} { color: ${v.color.opaque(I.background).css}; }${this._terminalSelector} .${M}${E.INVERTED_DEFAULT_COLOR}.xterm-dim { color: ${v.color.multiplyOpacity(v.color.opaque(I.background),.5).css}; }${this._terminalSelector} .${k}${E.INVERTED_DEFAULT_COLOR} { background-color: ${I.foreground.css}; }`,this._themeStyleElement.textContent=K}_setDefaultSpacing(){const I=this.dimensions.css.cell.width-this._widthCache.get("W",!1,!1);this._rowContainer.style.letterSpacing=`${I}px`,this._rowFactory.defaultSpacing=I}handleDevicePixelRatioChange(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}_refreshRowElements(I,K){for(let te=this._rowElements.length;te<=K;te++){const q=this._document.createElement("div");this._rowContainer.appendChild(q),this._rowElements.push(q)}for(;this._rowElements.length>K;)this._rowContainer.removeChild(this._rowElements.pop())}handleResize(I,K){this._refreshRowElements(I,K),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(O),this.renderRows(0,this._bufferService.rows-1)}handleFocus(){this._rowContainer.classList.add(O),this.renderRows(this._bufferService.buffer.y,this._bufferService.buffer.y)}handleSelectionChanged(I,K,te){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged(I,K,te),this.renderRows(0,this._bufferService.rows-1),!I||!K)return;this._selectionRenderModel.update(this._terminal,I,K,te);const q=this._selectionRenderModel.viewportStartRow,W=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 N=I[0]>K[0];z.appendChild(this._createSelectionElement(Y,N?K[0]:I[0],N?I[0]:K[0],B-Y+1))}else{const N=q===Y?I[0]:0,P=Y===W?K[0]:this._bufferService.cols;z.appendChild(this._createSelectionElement(Y,N,P));const Z=B-Y-1;if(z.appendChild(this._createSelectionElement(Y+1,0,this._bufferService.cols,Z)),Y!==B){const ae=W===B?K[0]:this._bufferService.cols;z.appendChild(this._createSelectionElement(B,0,ae))}}this._selectionContainer.appendChild(z)}_createSelectionElement(I,K,te,q=1){const W=this._document.createElement("div"),Y=K*this.dimensions.css.cell.width;let B=this.dimensions.css.cell.width*(te-K);return Y+B>this.dimensions.css.canvas.width&&(B=this.dimensions.css.canvas.width-Y),W.style.height=q*this.dimensions.css.cell.height+"px",W.style.top=I*this.dimensions.css.cell.height+"px",W.style.left=`${Y}px`,W.style.width=`${B}px`,W}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 I of this._rowElements)I.replaceChildren()}renderRows(I,K){const te=this._bufferService.buffer,q=te.ybase+te.y,W=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 N=I;N<=K;N++){const P=N+te.ydisp,Z=this._rowElements[N],ae=te.lines.get(P);if(!Z||!ae)break;Z.replaceChildren(...this._rowFactory.createRow(ae,P,P===q,B,z,W,Y,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${L}${this._terminalClass}`}_handleLinkHover(I){this._setCellUnderline(I.x1,I.x2,I.y1,I.y2,I.cols,!0)}_handleLinkLeave(I){this._setCellUnderline(I.x1,I.x2,I.y1,I.y2,I.cols,!1)}_setCellUnderline(I,K,te,q,W,Y){te<0&&(I=0),q<0&&(K=0);const B=this._bufferService.rows-1;te=Math.max(Math.min(te,B),0),q=Math.max(Math.min(q,B),0),W=Math.min(W,this._bufferService.cols);const z=this._bufferService.buffer,N=z.ybase+z.y,P=Math.min(z.x,W-1),Z=this._optionsService.rawOptions.cursorBlink,ae=this._optionsService.rawOptions.cursorStyle,ce=this._optionsService.rawOptions.cursorInactiveStyle;for(let _e=te;_e<=q;++_e){const Q=_e+z.ydisp,$=this._rowElements[_e],oe=z.lines.get(Q);if(!$||!oe)break;$.replaceChildren(...this._rowFactory.createRow(oe,Q,Q===N,ae,ce,P,Z,this.dimensions.css.cell.width,this._widthCache,Y?_e===te?I:0:-1,Y?(_e===q?K:W)-1:-1))}}};c.DomRenderer=G=h([y(7,x.IInstantiationService),y(8,p.ICharSizeService),y(9,x.IOptionsService),y(10,x.IBufferService),y(11,p.ICoreBrowserService),y(12,p.IThemeService)],G)},3787:function(m,c,u){var h=this&&this.__decorate||function(R,M,k,O){var U,F=arguments.length,G=F<3?M:O===null?O=Object.getOwnPropertyDescriptor(M,k):O;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")G=Reflect.decorate(R,M,k,O);else for(var I=R.length-1;I>=0;I--)(U=R[I])&&(G=(F<3?U(G):F>3?U(M,k,G):U(M,k))||G);return F>3&&G&&Object.defineProperty(M,k,G),G},y=this&&this.__param||function(R,M){return function(k,O){M(k,O,R)}};Object.defineProperty(c,"__esModule",{value:!0}),c.DomRendererRowFactory=void 0;const g=u(2223),C=u(643),E=u(511),A=u(2585),T=u(8055),p=u(4725),v=u(4269),d=u(6171),b=u(3734);let x=c.DomRendererRowFactory=class{constructor(R,M,k,O,U,F,G){this._document=R,this._characterJoinerService=M,this._optionsService=k,this._coreBrowserService=O,this._coreService=U,this._decorationService=F,this._themeService=G,this._workCell=new E.CellData,this._columnSelectMode=!1,this.defaultSpacing=0}handleSelectionChanged(R,M,k){this._selectionStart=R,this._selectionEnd=M,this._columnSelectMode=k}createRow(R,M,k,O,U,F,G,I,K,te,q){const W=[],Y=this._characterJoinerService.getJoinedCharacters(M),B=this._themeService.colors;let z,N=R.getNoBgTrimmedLength();k&&N<F+1&&(N=F+1);let P=0,Z="",ae=0,ce=0,_e=0,Q=!1,$=0,oe=!1,ge=0;const Se=[],ye=te!==-1&&q!==-1;for(let $e=0;$e<N;$e++){R.loadCell($e,this._workCell);let Fe=this._workCell.getWidth();if(Fe===0)continue;let Xe=!1,xt=$e,Ne=this._workCell;if(Y.length>0&&$e===Y[0][0]){Xe=!0;const dt=Y.shift();Ne=new v.JoinedCellData(this._workCell,R.translateToString(!0,dt[0],dt[1]),dt[1]-dt[0]),xt=dt[1]-1,Fe=Ne.getWidth()}const en=this._isCellInSelection($e,M),bn=k&&$e===F,yn=ye&&$e>=te&&$e<=q;let pi=!1;this._decorationService.forEachDecorationAtCell($e,M,void 0,(dt=>{pi=!0}));let Mi=Ne.getChars()||C.WHITESPACE_CELL_CHAR;if(Mi===" "&&(Ne.isUnderline()||Ne.isOverline())&&(Mi=" "),ge=Fe*I-K.get(Mi,Ne.isBold(),Ne.isItalic()),z){if(P&&(en&&oe||!en&&!oe&&Ne.bg===ae)&&(en&&oe&&B.selectionForeground||Ne.fg===ce)&&Ne.extended.ext===_e&&yn===Q&&ge===$&&!bn&&!Xe&&!pi){Ne.isInvisible()?Z+=C.WHITESPACE_CELL_CHAR:Z+=Mi,P++;continue}P&&(z.textContent=Z),z=this._document.createElement("span"),P=0,Z=""}else z=this._document.createElement("span");if(ae=Ne.bg,ce=Ne.fg,_e=Ne.extended.ext,Q=yn,$=ge,oe=en,Xe&&F>=$e&&F<=xt&&(F=$e),!this._coreService.isCursorHidden&&bn&&this._coreService.isCursorInitialized){if(Se.push("xterm-cursor"),this._coreBrowserService.isFocused)G&&Se.push("xterm-cursor-blink"),Se.push(O==="bar"?"xterm-cursor-bar":O==="underline"?"xterm-cursor-underline":"xterm-cursor-block");else if(U)switch(U){case"outline":Se.push("xterm-cursor-outline");break;case"block":Se.push("xterm-cursor-block");break;case"bar":Se.push("xterm-cursor-bar");break;case"underline":Se.push("xterm-cursor-underline")}}if(Ne.isBold()&&Se.push("xterm-bold"),Ne.isItalic()&&Se.push("xterm-italic"),Ne.isDim()&&Se.push("xterm-dim"),Z=Ne.isInvisible()?C.WHITESPACE_CELL_CHAR:Ne.getChars()||C.WHITESPACE_CELL_CHAR,Ne.isUnderline()&&(Se.push(`xterm-underline-${Ne.extended.underlineStyle}`),Z===" "&&(Z=" "),!Ne.isUnderlineColorDefault()))if(Ne.isUnderlineColorRGB())z.style.textDecorationColor=`rgb(${b.AttributeData.toColorRGB(Ne.getUnderlineColor()).join(",")})`;else{let dt=Ne.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&Ne.isBold()&&dt<8&&(dt+=8),z.style.textDecorationColor=B.ansi[dt].css}Ne.isOverline()&&(Se.push("xterm-overline"),Z===" "&&(Z=" ")),Ne.isStrikethrough()&&Se.push("xterm-strikethrough"),yn&&(z.style.textDecoration="underline");let tn=Ne.getFgColor(),ut=Ne.getFgColorMode(),Vt=Ne.getBgColor(),zt=Ne.getBgColorMode();const $t=!!Ne.isInverse();if($t){const dt=tn;tn=Vt,Vt=dt;const Hn=ut;ut=zt,zt=Hn}let nn,Di,Ln,ni=!1;switch(this._decorationService.forEachDecorationAtCell($e,M,void 0,(dt=>{dt.options.layer!=="top"&&ni||(dt.backgroundColorRGB&&(zt=50331648,Vt=dt.backgroundColorRGB.rgba>>8&16777215,nn=dt.backgroundColorRGB),dt.foregroundColorRGB&&(ut=50331648,tn=dt.foregroundColorRGB.rgba>>8&16777215,Di=dt.foregroundColorRGB),ni=dt.options.layer==="top")})),!ni&&en&&(nn=this._coreBrowserService.isFocused?B.selectionBackgroundOpaque:B.selectionInactiveBackgroundOpaque,Vt=nn.rgba>>8&16777215,zt=50331648,ni=!0,B.selectionForeground&&(ut=50331648,tn=B.selectionForeground.rgba>>8&16777215,Di=B.selectionForeground)),ni&&Se.push("xterm-decoration-top"),zt){case 16777216:case 33554432:Ln=B.ansi[Vt],Se.push(`xterm-bg-${Vt}`);break;case 50331648:Ln=T.channels.toColor(Vt>>16,Vt>>8&255,255&Vt),this._addStyle(z,`background-color:#${L((Vt>>>0).toString(16),"0",6)}`);break;default:$t?(Ln=B.foreground,Se.push(`xterm-bg-${g.INVERTED_DEFAULT_COLOR}`)):Ln=B.background}switch(nn||Ne.isDim()&&(nn=T.color.multiplyOpacity(Ln,.5)),ut){case 16777216:case 33554432:Ne.isBold()&&tn<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(tn+=8),this._applyMinimumContrast(z,Ln,B.ansi[tn],Ne,nn,void 0)||Se.push(`xterm-fg-${tn}`);break;case 50331648:const dt=T.channels.toColor(tn>>16&255,tn>>8&255,255&tn);this._applyMinimumContrast(z,Ln,dt,Ne,nn,Di)||this._addStyle(z,`color:#${L(tn.toString(16),"0",6)}`);break;default:this._applyMinimumContrast(z,Ln,B.foreground,Ne,nn,Di)||$t&&Se.push(`xterm-fg-${g.INVERTED_DEFAULT_COLOR}`)}Se.length&&(z.className=Se.join(" "),Se.length=0),bn||Xe||pi?z.textContent=Z:P++,ge!==this.defaultSpacing&&(z.style.letterSpacing=`${ge}px`),W.push(z),$e=xt}return z&&P&&(z.textContent=Z),W}_applyMinimumContrast(R,M,k,O,U,F){if(this._optionsService.rawOptions.minimumContrastRatio===1||(0,d.treatGlyphAsBackgroundColor)(O.getCode()))return!1;const G=this._getContrastCache(O);let I;if(U||F||(I=G.getColor(M.rgba,k.rgba)),I===void 0){const K=this._optionsService.rawOptions.minimumContrastRatio/(O.isDim()?2:1);I=T.color.ensureContrastRatio(U||M,F||k,K),G.setColor((U||M).rgba,(F||k).rgba,I??null)}return!!I&&(this._addStyle(R,`color:${I.css}`),!0)}_getContrastCache(R){return R.isDim()?this._themeService.colors.halfContrastCache:this._themeService.colors.contrastCache}_addStyle(R,M){R.setAttribute("style",`${R.getAttribute("style")||""}${M};`)}_isCellInSelection(R,M){const k=this._selectionStart,O=this._selectionEnd;return!(!k||!O)&&(this._columnSelectMode?k[0]<=O[0]?R>=k[0]&&M>=k[1]&&R<O[0]&&M<=O[1]:R<k[0]&&M>=k[1]&&R>=O[0]&&M<=O[1]:M>k[1]&&M<O[1]||k[1]===O[1]&&M===k[1]&&R>=k[0]&&R<O[0]||k[1]<O[1]&&M===O[1]&&R<O[0]||k[1]<O[1]&&M===k[1]&&R>=k[0])}};function L(R,M,k){for(;R.length<k;)R=M+R;return R}c.DomRendererRowFactory=x=h([y(1,p.ICharacterJoinerService),y(2,A.IOptionsService),y(3,p.ICoreBrowserService),y(4,A.ICoreService),y(5,A.IDecorationService),y(6,p.IThemeService)],x)},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 y=u.createElement("span");y.classList.add("xterm-char-measure-element");const g=u.createElement("span");g.classList.add("xterm-char-measure-element"),g.style.fontWeight="bold";const C=u.createElement("span");C.classList.add("xterm-char-measure-element"),C.style.fontStyle="italic";const E=u.createElement("span");E.classList.add("xterm-char-measure-element"),E.style.fontWeight="bold",E.style.fontStyle="italic",this._measureElements=[y,g,C,E],this._container.appendChild(y),this._container.appendChild(g),this._container.appendChild(C),this._container.appendChild(E),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,y,g){u===this._font&&h===this._fontSize&&y===this._weight&&g===this._weightBold||(this._font=u,this._fontSize=h,this._weight=y,this._weightBold=g,this._container.style.fontFamily=this._font,this._container.style.fontSize=`${this._fontSize}px`,this._measureElements[0].style.fontWeight=`${y}`,this._measureElements[1].style.fontWeight=`${g}`,this._measureElements[2].style.fontWeight=`${y}`,this._measureElements[3].style.fontWeight=`${g}`,this.clear())}get(u,h,y){let g=0;if(!h&&!y&&u.length===1&&(g=u.charCodeAt(0))<256){if(this._flat[g]!==-9999)return this._flat[g];const A=this._measure(u,0);return A>0&&(this._flat[g]=A),A}let C=u;h&&(C+="B"),y&&(C+="I");let E=this._holey.get(C);if(E===void 0){let A=0;h&&(A|=1),y&&(A|=2),E=this._measure(u,A),E>0&&this._holey.set(C,E)}return E}_measure(u,h){const y=this._measureElements[h];return y.textContent=u.repeat(32),y.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(y){return 57508<=y&&y<=57558}function h(y){return y>=128512&&y<=128591||y>=127744&&y<=128511||y>=128640&&y<=128767||y>=9728&&y<=9983||y>=9984&&y<=10175||y>=65024&&y<=65039||y>=129280&&y<=129535||y>=127462&&y<=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(y){if(!y)throw new Error("value must not be falsy");return y},c.isPowerlineGlyph=u,c.isRestrictedPowerlineGlyph=function(y){return 57520<=y&&y<=57527},c.isEmoji=h,c.allowRescaling=function(y,g,C,E){return g===1&&C>Math.ceil(1.5*E)&&y!==void 0&&y>255&&!h(y)&&!u(y)&&!(function(A){return 57344<=A&&A<=63743})(y)},c.treatGlyphAsBackgroundColor=function(y){return u(y)||(function(g){return 9472<=g&&g<=9631})(y)},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(y,g,C=0){return(y-(2*Math.round(g)-C))%(2*Math.round(g))}},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(y,g,C,E=!1){if(this.selectionStart=g,this.selectionEnd=C,!g||!C||g[0]===C[0]&&g[1]===C[1])return void this.clear();const A=y.buffers.active.ydisp,T=g[1]-A,p=C[1]-A,v=Math.max(T,0),d=Math.min(p,y.rows-1);v>=y.rows||d<0?this.clear():(this.hasSelection=!0,this.columnSelectMode=E,this.viewportStartRow=T,this.viewportEndRow=p,this.viewportCappedStartRow=v,this.viewportCappedEndRow=d,this.startCol=g[0],this.endCol=C[0])}isCellSelected(y,g,C){return!!this.hasSelection&&(C-=y.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?g>=this.startCol&&C>=this.viewportCappedStartRow&&g<this.endCol&&C<=this.viewportCappedEndRow:g<this.startCol&&C>=this.viewportCappedStartRow&&g>=this.endCol&&C<=this.viewportCappedEndRow:C>this.viewportStartRow&&C<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&C===this.viewportStartRow&&g>=this.startCol&&g<this.endCol||this.viewportStartRow<this.viewportEndRow&&C===this.viewportEndRow&&g<this.endCol||this.viewportStartRow<this.viewportEndRow&&C===this.viewportStartRow&&g>=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(d,b,x,L){var R,M=arguments.length,k=M<3?b:L===null?L=Object.getOwnPropertyDescriptor(b,x):L;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")k=Reflect.decorate(d,b,x,L);else for(var O=d.length-1;O>=0;O--)(R=d[O])&&(k=(M<3?R(k):M>3?R(b,x,k):R(b,x))||k);return M>3&&k&&Object.defineProperty(b,x,k),k},y=this&&this.__param||function(d,b){return function(x,L){b(x,L,d)}};Object.defineProperty(c,"__esModule",{value:!0}),c.CharSizeService=void 0;const g=u(2585),C=u(8460),E=u(844);let A=c.CharSizeService=class extends E.Disposable{get hasValidSize(){return this.width>0&&this.height>0}constructor(d,b,x){super(),this._optionsService=x,this.width=0,this.height=0,this._onCharSizeChange=this.register(new C.EventEmitter),this.onCharSizeChange=this._onCharSizeChange.event;try{this._measureStrategy=this.register(new v(this._optionsService))}catch{this._measureStrategy=this.register(new p(d,b,this._optionsService))}this.register(this._optionsService.onMultipleOptionChange(["fontFamily","fontSize"],(()=>this.measure())))}measure(){const d=this._measureStrategy.measure();d.width===this.width&&d.height===this.height||(this.width=d.width,this.height=d.height,this._onCharSizeChange.fire())}};c.CharSizeService=A=h([y(2,g.IOptionsService)],A);class T extends E.Disposable{constructor(){super(...arguments),this._result={width:0,height:0}}_validateAndSet(b,x){b!==void 0&&b>0&&x!==void 0&&x>0&&(this._result.width=b,this._result.height=x)}}class p extends T{constructor(b,x,L){super(),this._document=b,this._parentElement=x,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 v extends T{constructor(b){super(),this._optionsService=b,this._canvas=new OffscreenCanvas(100,100),this._ctx=this._canvas.getContext("2d");const x=this._ctx.measureText("W");if(!("width"in x&&"fontBoundingBoxAscent"in x&&"fontBoundingBoxDescent"in x))throw new Error("Required font metrics not supported")}measure(){this._ctx.font=`${this._optionsService.rawOptions.fontSize}px ${this._optionsService.rawOptions.fontFamily}`;const b=this._ctx.measureText("W");return this._validateAndSet(b.width,b.fontBoundingBoxAscent+b.fontBoundingBoxDescent),this._result}}},4269:function(m,c,u){var h=this&&this.__decorate||function(v,d,b,x){var L,R=arguments.length,M=R<3?d:x===null?x=Object.getOwnPropertyDescriptor(d,b):x;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")M=Reflect.decorate(v,d,b,x);else for(var k=v.length-1;k>=0;k--)(L=v[k])&&(M=(R<3?L(M):R>3?L(d,b,M):L(d,b))||M);return R>3&&M&&Object.defineProperty(d,b,M),M},y=this&&this.__param||function(v,d){return function(b,x){d(b,x,v)}};Object.defineProperty(c,"__esModule",{value:!0}),c.CharacterJoinerService=c.JoinedCellData=void 0;const g=u(3734),C=u(643),E=u(511),A=u(2585);class T extends g.AttributeData{constructor(d,b,x){super(),this.content=0,this.combinedData="",this.fg=d.fg,this.bg=d.bg,this.combinedData=b,this._width=x}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(d){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}c.JoinedCellData=T;let p=c.CharacterJoinerService=class KC{constructor(d){this._bufferService=d,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new E.CellData}register(d){const b={id:this._nextCharacterJoinerId++,handler:d};return this._characterJoiners.push(b),b.id}deregister(d){for(let b=0;b<this._characterJoiners.length;b++)if(this._characterJoiners[b].id===d)return this._characterJoiners.splice(b,1),!0;return!1}getJoinedCharacters(d){if(this._characterJoiners.length===0)return[];const b=this._bufferService.buffer.lines.get(d);if(!b||b.length===0)return[];const x=[],L=b.translateToString(!0);let R=0,M=0,k=0,O=b.getFg(0),U=b.getBg(0);for(let F=0;F<b.getTrimmedLength();F++)if(b.loadCell(F,this._workCell),this._workCell.getWidth()!==0){if(this._workCell.fg!==O||this._workCell.bg!==U){if(F-R>1){const G=this._getJoinedRanges(L,k,M,b,R);for(let I=0;I<G.length;I++)x.push(G[I])}R=F,k=M,O=this._workCell.fg,U=this._workCell.bg}M+=this._workCell.getChars().length||C.WHITESPACE_CELL_CHAR.length}if(this._bufferService.cols-R>1){const F=this._getJoinedRanges(L,k,M,b,R);for(let G=0;G<F.length;G++)x.push(F[G])}return x}_getJoinedRanges(d,b,x,L,R){const M=d.substring(b,x);let k=[];try{k=this._characterJoiners[0].handler(M)}catch(O){console.error(O)}for(let O=1;O<this._characterJoiners.length;O++)try{const U=this._characterJoiners[O].handler(M);for(let F=0;F<U.length;F++)KC._mergeRanges(k,U[F])}catch(U){console.error(U)}return this._stringRangesToCellRanges(k,L,R),k}_stringRangesToCellRanges(d,b,x){let L=0,R=!1,M=0,k=d[L];if(k){for(let O=x;O<this._bufferService.cols;O++){const U=b.getWidth(O),F=b.getString(O).length||C.WHITESPACE_CELL_CHAR.length;if(U!==0){if(!R&&k[0]<=M&&(k[0]=O,R=!0),k[1]<=M){if(k[1]=O,k=d[++L],!k)break;k[0]<=M?(k[0]=O,R=!0):R=!1}M+=F}}k&&(k[1]=this._bufferService.cols)}}static _mergeRanges(d,b){let x=!1;for(let L=0;L<d.length;L++){const R=d[L];if(x){if(b[1]<=R[0])return d[L-1][1]=b[1],d;if(b[1]<=R[1])return d[L-1][1]=Math.max(b[1],R[1]),d.splice(L,1),d;d.splice(L,1),L--}else{if(b[1]<=R[0])return d.splice(L,0,b),d;if(b[1]<=R[1])return R[0]=Math.min(b[0],R[0]),d;b[0]<R[1]&&(R[0]=Math.min(b[0],R[0]),x=!0)}}return x?d[d.length-1][1]=b[1]:d.push(b),d}};c.CharacterJoinerService=p=h([y(0,A.IBufferService)],p)},5114:(m,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.CoreBrowserService=void 0;const h=u(844),y=u(8460),g=u(3656);class C extends h.Disposable{constructor(T,p,v){super(),this._textarea=T,this._window=p,this.mainDocument=v,this._isFocused=!1,this._cachedIsFocused=void 0,this._screenDprMonitor=new E(this._window),this._onDprChange=this.register(new y.EventEmitter),this.onDprChange=this._onDprChange.event,this._onWindowChange=this.register(new y.EventEmitter),this.onWindowChange=this._onWindowChange.event,this.register(this.onWindowChange((d=>this._screenDprMonitor.setWindow(d)))),this.register((0,y.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(T){this._window!==T&&(this._window=T,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 E extends h.Disposable{constructor(T){super(),this._parentWindow=T,this._windowResizeListener=this.register(new h.MutableDisposable),this._onDprChange=this.register(new y.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(T){this._parentWindow=T,this._setWindowResizeListener(),this._setDprAndFireIfDiffers()}_setWindowResizeListener(){this._windowResizeListener.value=(0,g.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 y 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 E=this.linkProviders.indexOf(C);E!==-1&&this.linkProviders.splice(E,1)}}}}c.LinkProviderService=y},8934:function(m,c,u){var h=this&&this.__decorate||function(A,T,p,v){var d,b=arguments.length,x=b<3?T:v===null?v=Object.getOwnPropertyDescriptor(T,p):v;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")x=Reflect.decorate(A,T,p,v);else for(var L=A.length-1;L>=0;L--)(d=A[L])&&(x=(b<3?d(x):b>3?d(T,p,x):d(T,p))||x);return b>3&&x&&Object.defineProperty(T,p,x),x},y=this&&this.__param||function(A,T){return function(p,v){T(p,v,A)}};Object.defineProperty(c,"__esModule",{value:!0}),c.MouseService=void 0;const g=u(4725),C=u(9806);let E=c.MouseService=class{constructor(A,T){this._renderService=A,this._charSizeService=T}getCoords(A,T,p,v,d){return(0,C.getCoords)(window,A,T,p,v,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,d)}getMouseReportCoords(A,T){const p=(0,C.getCoordsRelativeToElement)(window,A,T);if(this._charSizeService.hasValidSize)return p[0]=Math.min(Math.max(p[0],0),this._renderService.dimensions.css.canvas.width-1),p[1]=Math.min(Math.max(p[1],0),this._renderService.dimensions.css.canvas.height-1),{col:Math.floor(p[0]/this._renderService.dimensions.css.cell.width),row:Math.floor(p[1]/this._renderService.dimensions.css.cell.height),x:Math.floor(p[0]),y:Math.floor(p[1])}}};c.MouseService=E=h([y(0,g.IRenderService),y(1,g.ICharSizeService)],E)},3230:function(m,c,u){var h=this&&this.__decorate||function(d,b,x,L){var R,M=arguments.length,k=M<3?b:L===null?L=Object.getOwnPropertyDescriptor(b,x):L;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")k=Reflect.decorate(d,b,x,L);else for(var O=d.length-1;O>=0;O--)(R=d[O])&&(k=(M<3?R(k):M>3?R(b,x,k):R(b,x))||k);return M>3&&k&&Object.defineProperty(b,x,k),k},y=this&&this.__param||function(d,b){return function(x,L){b(x,L,d)}};Object.defineProperty(c,"__esModule",{value:!0}),c.RenderService=void 0;const g=u(6193),C=u(4725),E=u(8460),A=u(844),T=u(7226),p=u(2585);let v=c.RenderService=class extends A.Disposable{get dimensions(){return this._renderer.value.dimensions}constructor(d,b,x,L,R,M,k,O){super(),this._rowCount=d,this._charSizeService=L,this._renderer=this.register(new A.MutableDisposable),this._pausedResizeTask=new T.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 E.EventEmitter),this.onDimensionsChange=this._onDimensionsChange.event,this._onRenderedViewportChange=this.register(new E.EventEmitter),this.onRenderedViewportChange=this._onRenderedViewportChange.event,this._onRender=this.register(new E.EventEmitter),this.onRender=this._onRender.event,this._onRefreshRequest=this.register(new E.EventEmitter),this.onRefreshRequest=this._onRefreshRequest.event,this._renderDebouncer=new g.RenderDebouncer(((U,F)=>this._renderRows(U,F)),k),this.register(this._renderDebouncer),this.register(k.onDprChange((()=>this.handleDevicePixelRatioChange()))),this.register(M.onResize((()=>this._fullRefresh()))),this.register(M.buffers.onBufferActivate((()=>this._renderer.value?.clear()))),this.register(x.onOptionChange((()=>this._handleOptionsChanged()))),this.register(this._charSizeService.onCharSizeChange((()=>this.handleCharSizeChanged()))),this.register(R.onDecorationRegistered((()=>this._fullRefresh()))),this.register(R.onDecorationRemoved((()=>this._fullRefresh()))),this.register(x.onMultipleOptionChange(["customGlyphs","drawBoldTextInBrightColors","letterSpacing","lineHeight","fontFamily","fontSize","fontWeight","fontWeightBold","minimumContrastRatio","rescaleOverlappingGlyphs"],(()=>{this.clear(),this.handleResize(M.cols,M.rows),this._fullRefresh()}))),this.register(x.onMultipleOptionChange(["cursorBlink","cursorStyle"],(()=>this.refreshRows(M.buffer.y,M.buffer.y,!0)))),this.register(O.onChangeColors((()=>this._fullRefresh()))),this._registerIntersectionObserver(k.window,b),this.register(k.onWindowChange((U=>this._registerIntersectionObserver(U,b))))}_registerIntersectionObserver(d,b){if("IntersectionObserver"in d){const x=new d.IntersectionObserver((L=>this._handleIntersectionChange(L[L.length-1])),{threshold:0});x.observe(b),this._observerDisposable.value=(0,A.toDisposable)((()=>x.disconnect()))}}_handleIntersectionChange(d){this._isPaused=d.isIntersecting===void 0?d.intersectionRatio===0:!d.isIntersecting,this._isPaused||this._charSizeService.hasValidSize||this._charSizeService.measure(),!this._isPaused&&this._needsFullRefresh&&(this._pausedResizeTask.flush(),this.refreshRows(0,this._rowCount-1),this._needsFullRefresh=!1)}refreshRows(d,b,x=!1){this._isPaused?this._needsFullRefresh=!0:(x||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(d,b,this._rowCount))}_renderRows(d,b){this._renderer.value&&(d=Math.min(d,this._rowCount-1),b=Math.min(b,this._rowCount-1),this._renderer.value.renderRows(d,b),this._needsSelectionRefresh&&(this._renderer.value.handleSelectionChanged(this._selectionState.start,this._selectionState.end,this._selectionState.columnSelectMode),this._needsSelectionRefresh=!1),this._isNextRenderRedrawOnly||this._onRenderedViewportChange.fire({start:d,end:b}),this._onRender.fire({start:d,end:b}),this._isNextRenderRedrawOnly=!0)}resize(d,b){this._rowCount=b,this._fireOnCanvasResize()}_handleOptionsChanged(){this._renderer.value&&(this.refreshRows(0,this._rowCount-1),this._fireOnCanvasResize())}_fireOnCanvasResize(){this._renderer.value&&(this._renderer.value.dimensions.css.canvas.width===this._canvasWidth&&this._renderer.value.dimensions.css.canvas.height===this._canvasHeight||this._onDimensionsChange.fire(this._renderer.value.dimensions))}hasRenderer(){return!!this._renderer.value}setRenderer(d){this._renderer.value=d,this._renderer.value&&(this._renderer.value.onRequestRedraw((b=>this.refreshRows(b.start,b.end,!0))),this._needsSelectionRefresh=!0,this._fullRefresh())}addRefreshCallback(d){return this._renderDebouncer.addRefreshCallback(d)}_fullRefresh(){this._isPaused?this._needsFullRefresh=!0:this.refreshRows(0,this._rowCount-1)}clearTextureAtlas(){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(d,b){this._renderer.value&&(this._isPaused?this._pausedResizeTask.set((()=>this._renderer.value?.handleResize(d,b))):this._renderer.value.handleResize(d,b),this._fullRefresh())}handleCharSizeChanged(){this._renderer.value?.handleCharSizeChanged()}handleBlur(){this._renderer.value?.handleBlur()}handleFocus(){this._renderer.value?.handleFocus()}handleSelectionChanged(d,b,x){this._selectionState.start=d,this._selectionState.end=b,this._selectionState.columnSelectMode=x,this._renderer.value?.handleSelectionChanged(d,b,x)}handleCursorMove(){this._renderer.value?.handleCursorMove()}clear(){this._renderer.value?.clear()}};c.RenderService=v=h([y(2,p.IOptionsService),y(3,C.ICharSizeService),y(4,p.IDecorationService),y(5,p.IBufferService),y(6,C.ICoreBrowserService),y(7,C.IThemeService)],v)},9312:function(m,c,u){var h=this&&this.__decorate||function(k,O,U,F){var G,I=arguments.length,K=I<3?O:F===null?F=Object.getOwnPropertyDescriptor(O,U):F;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")K=Reflect.decorate(k,O,U,F);else for(var te=k.length-1;te>=0;te--)(G=k[te])&&(K=(I<3?G(K):I>3?G(O,U,K):G(O,U))||K);return I>3&&K&&Object.defineProperty(O,U,K),K},y=this&&this.__param||function(k,O){return function(U,F){O(U,F,k)}};Object.defineProperty(c,"__esModule",{value:!0}),c.SelectionService=void 0;const g=u(9806),C=u(9504),E=u(456),A=u(4725),T=u(8460),p=u(844),v=u(6114),d=u(4841),b=u(511),x=u(2585),L=" ",R=new RegExp(L,"g");let M=c.SelectionService=class extends p.Disposable{constructor(k,O,U,F,G,I,K,te,q){super(),this._element=k,this._screenElement=O,this._linkifier=U,this._bufferService=F,this._coreService=G,this._mouseService=I,this._optionsService=K,this._renderService=te,this._coreBrowserService=q,this._dragScrollAmount=0,this._enabled=!0,this._workCell=new b.CellData,this._mouseDownTimeStamp=0,this._oldHasSelection=!1,this._oldSelectionStart=void 0,this._oldSelectionEnd=void 0,this._onLinuxMouseSelection=this.register(new T.EventEmitter),this.onLinuxMouseSelection=this._onLinuxMouseSelection.event,this._onRedrawRequest=this.register(new T.EventEmitter),this.onRequestRedraw=this._onRedrawRequest.event,this._onSelectionChange=this.register(new T.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onRequestScrollLines=this.register(new T.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this._mouseMoveListener=W=>this._handleMouseMove(W),this._mouseUpListener=W=>this._handleMouseUp(W),this._coreService.onUserInput((()=>{this.hasSelection&&this.clearSelection()})),this._trimListener=this._bufferService.buffer.lines.onTrim((W=>this._handleTrim(W))),this.register(this._bufferService.buffers.onBufferActivate((W=>this._handleBufferActivate(W)))),this.enable(),this._model=new E.SelectionModel(this._bufferService),this._activeSelectionMode=0,this.register((0,p.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,O=this._model.finalSelectionEnd;return!(!k||!O||k[0]===O[0]&&k[1]===O[1])}get selectionText(){const k=this._model.finalSelectionStart,O=this._model.finalSelectionEnd;if(!k||!O)return"";const U=this._bufferService.buffer,F=[];if(this._activeSelectionMode===3){if(k[0]===O[0])return"";const G=k[0]<O[0]?k[0]:O[0],I=k[0]<O[0]?O[0]:k[0];for(let K=k[1];K<=O[1];K++){const te=U.translateBufferLineToString(K,!0,G,I);F.push(te)}}else{const G=k[1]===O[1]?O[0]:void 0;F.push(U.translateBufferLineToString(k[1],!0,k[0],G));for(let I=k[1]+1;I<=O[1]-1;I++){const K=U.lines.get(I),te=U.translateBufferLineToString(I,!0);K?.isWrapped?F[F.length-1]+=te:F.push(te)}if(k[1]!==O[1]){const I=U.lines.get(O[1]),K=U.translateBufferLineToString(O[1],!0,0,O[0]);I&&I.isWrapped?F[F.length-1]+=K:F.push(K)}}return F.map((G=>G.replace(R," "))).join(v.isWindows?`\r
|
|
773
|
+
`:`
|
|
774
|
+
`)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(k){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._refresh()))),v.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 O=this._getMouseBufferCoords(k),U=this._model.finalSelectionStart,F=this._model.finalSelectionEnd;return!!(U&&F&&O)&&this._areCoordsInSelection(O,U,F)}isCellInSelection(k,O){const U=this._model.finalSelectionStart,F=this._model.finalSelectionEnd;return!(!U||!F)&&this._areCoordsInSelection([k,O],U,F)}_areCoordsInSelection(k,O,U){return k[1]>O[1]&&k[1]<U[1]||O[1]===U[1]&&k[1]===O[1]&&k[0]>=O[0]&&k[0]<U[0]||O[1]<U[1]&&k[1]===U[1]&&k[0]<U[0]||O[1]<U[1]&&k[1]===O[1]&&k[0]>=O[0]}_selectWordAtCursor(k,O){const U=this._linkifier.currentLink?.link?.range;if(U)return this._model.selectionStart=[U.start.x-1,U.start.y-1],this._model.selectionStartLength=(0,d.getRangeLength)(U,this._bufferService.cols),this._model.selectionEnd=void 0,!0;const F=this._getMouseBufferCoords(k);return!!F&&(this._selectWordAt(F,O),this._model.selectionEnd=void 0,!0)}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(k,O){this._model.clearSelection(),k=Math.max(k,0),O=Math.min(O,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,k],this._model.selectionEnd=[this._bufferService.cols,O],this.refresh(),this._onSelectionChange.fire()}_handleTrim(k){this._model.handleTrim(k)&&this.refresh()}_getMouseBufferCoords(k){const O=this._mouseService.getCoords(k,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(O)return O[0]--,O[1]--,O[1]+=this._bufferService.buffer.ydisp,O}_getMouseEventScrollAmount(k){let O=(0,g.getCoordsRelativeToElement)(this._coreBrowserService.window,k,this._screenElement)[1];const U=this._renderService.dimensions.css.canvas.height;return O>=0&&O<=U?0:(O>U&&(O-=U),O=Math.min(Math.max(O,-50),50),O/=50,O/Math.abs(O)+Math.round(14*O))}shouldForceSelection(k){return v.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 O=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);O&&O.length!==this._model.selectionStart[0]&&O.hasWidth(this._model.selectionStart[0])===0&&this._model.selectionStart[0]++}_handleDoubleClick(k){this._selectWordAtCursor(k,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(k){const O=this._getMouseBufferCoords(k);O&&(this._activeSelectionMode=2,this._selectLineAt(O[1]))}shouldColumnSelect(k){return k.altKey&&!(v.isMac&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(k){if(k.stopImmediatePropagation(),!this._model.selectionStart)return;const O=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 U=this._bufferService.buffer;if(this._model.selectionEnd[1]<U.lines.length){const F=U.lines.get(this._model.selectionEnd[1]);F&&F.hasWidth(this._model.selectionEnd[0])===0&&this._model.selectionEnd[0]<this._bufferService.cols&&this._model.selectionEnd[0]++}O&&O[0]===this._model.selectionEnd[0]&&O[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 O=k.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&O<500&&k.altKey&&this._optionsService.rawOptions.altClickMovesCursor){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){const U=this._mouseService.getCoords(k,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(U&&U[0]!==void 0&&U[1]!==void 0){const F=(0,C.moveToCellSequence)(U[0]-1,U[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(F,!0)}}}else this._fireEventIfSelectionChanged()}_fireEventIfSelectionChanged(){const k=this._model.finalSelectionStart,O=this._model.finalSelectionEnd,U=!(!k||!O||k[0]===O[0]&&k[1]===O[1]);U?k&&O&&(this._oldSelectionStart&&this._oldSelectionEnd&&k[0]===this._oldSelectionStart[0]&&k[1]===this._oldSelectionStart[1]&&O[0]===this._oldSelectionEnd[0]&&O[1]===this._oldSelectionEnd[1]||this._fireOnSelectionChange(k,O,U)):this._oldHasSelection&&this._fireOnSelectionChange(k,O,U)}_fireOnSelectionChange(k,O,U){this._oldSelectionStart=k,this._oldSelectionEnd=O,this._oldHasSelection=U,this._onSelectionChange.fire()}_handleBufferActivate(k){this.clearSelection(),this._trimListener.dispose(),this._trimListener=k.activeBuffer.lines.onTrim((O=>this._handleTrim(O)))}_convertViewportColToCharacterIndex(k,O){let U=O;for(let F=0;O>=F;F++){const G=k.loadCell(F,this._workCell).getChars().length;this._workCell.getWidth()===0?U--:G>1&&O!==F&&(U+=G-1)}return U}setSelection(k,O,U){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[k,O],this._model.selectionStartLength=U,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(k){this._isClickInSelection(k)||(this._selectWordAtCursor(k,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(k,O,U=!0,F=!0){if(k[0]>=this._bufferService.cols)return;const G=this._bufferService.buffer,I=G.lines.get(k[1]);if(!I)return;const K=G.translateBufferLineToString(k[1],!1);let te=this._convertViewportColToCharacterIndex(I,k[0]),q=te;const W=k[0]-te;let Y=0,B=0,z=0,N=0;if(K.charAt(te)===" "){for(;te>0&&K.charAt(te-1)===" ";)te--;for(;q<K.length&&K.charAt(q+1)===" ";)q++}else{let ae=k[0],ce=k[0];I.getWidth(ae)===0&&(Y++,ae--),I.getWidth(ce)===2&&(B++,ce++);const _e=I.getString(ce).length;for(_e>1&&(N+=_e-1,q+=_e-1);ae>0&&te>0&&!this._isCharWordSeparator(I.loadCell(ae-1,this._workCell));){I.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<I.length&&q+1<K.length&&!this._isCharWordSeparator(I.loadCell(ce+1,this._workCell));){I.loadCell(ce+1,this._workCell);const Q=this._workCell.getChars().length;this._workCell.getWidth()===2?(B++,ce++):Q>1&&(N+=Q-1,q+=Q-1),q++,ce++}}q++;let P=te+W-Y+z,Z=Math.min(this._bufferService.cols,q-te+Y+B-z-N);if(O||K.slice(te,q).trim()!==""){if(U&&P===0&&I.getCodePoint(0)!==32){const ae=G.lines.get(k[1]-1);if(ae&&I.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;P-=_e,Z+=_e}}}if(F&&P+Z===this._bufferService.cols&&I.getCodePoint(this._bufferService.cols-1)!==32){const ae=G.lines.get(k[1]+1);if(ae?.isWrapped&&ae.getCodePoint(0)!==32){const ce=this._getWordAt([0,k[1]+1],!1,!1,!0);ce&&(Z+=ce.length)}}return{start:P,length:Z}}}_selectWordAt(k,O){const U=this._getWordAt(k,O);if(U){for(;U.start<0;)U.start+=this._bufferService.cols,k[1]--;this._model.selectionStart=[U.start,k[1]],this._model.selectionStartLength=U.length}}_selectToWordAt(k){const O=this._getWordAt(k,!0);if(O){let U=k[1];for(;O.start<0;)O.start+=this._bufferService.cols,U--;if(!this._model.areSelectionValuesReversed())for(;O.start+O.length>this._bufferService.cols;)O.length-=this._bufferService.cols,U++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?O.start:O.start+O.length,U]}}_isCharWordSeparator(k){return k.getWidth()!==0&&this._optionsService.rawOptions.wordSeparator.indexOf(k.getChars())>=0}_selectLineAt(k){const O=this._bufferService.buffer.getWrappedRangeForLine(k),U={start:{x:0,y:O.first},end:{x:this._bufferService.cols-1,y:O.last}};this._model.selectionStart=[0,O.first],this._model.selectionEnd=void 0,this._model.selectionStartLength=(0,d.getRangeLength)(U,this._bufferService.cols)}};c.SelectionService=M=h([y(3,x.IBufferService),y(4,x.ICoreService),y(5,A.IMouseService),y(6,x.IOptionsService),y(7,A.IRenderService),y(8,A.ICoreBrowserService)],M)},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(M,k,O,U){var F,G=arguments.length,I=G<3?k:U===null?U=Object.getOwnPropertyDescriptor(k,O):U;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")I=Reflect.decorate(M,k,O,U);else for(var K=M.length-1;K>=0;K--)(F=M[K])&&(I=(G<3?F(I):G>3?F(k,O,I):F(k,O))||I);return G>3&&I&&Object.defineProperty(k,O,I),I},y=this&&this.__param||function(M,k){return function(O,U){k(O,U,M)}};Object.defineProperty(c,"__esModule",{value:!0}),c.ThemeService=c.DEFAULT_ANSI_COLORS=void 0;const g=u(7239),C=u(8055),E=u(8460),A=u(844),T=u(2585),p=C.css.toColor("#ffffff"),v=C.css.toColor("#000000"),d=C.css.toColor("#ffffff"),b=C.css.toColor("#000000"),x={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117};c.DEFAULT_ANSI_COLORS=Object.freeze((()=>{const M=[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 O=0;O<216;O++){const U=k[O/36%6|0],F=k[O/6%6|0],G=k[O%6];M.push({css:C.channels.toCss(U,F,G),rgba:C.channels.toRgba(U,F,G)})}for(let O=0;O<24;O++){const U=8+10*O;M.push({css:C.channels.toCss(U,U,U),rgba:C.channels.toRgba(U,U,U)})}return M})());let L=c.ThemeService=class extends A.Disposable{get colors(){return this._colors}constructor(M){super(),this._optionsService=M,this._contrastCache=new g.ColorContrastCache,this._halfContrastCache=new g.ColorContrastCache,this._onChangeColors=this.register(new E.EventEmitter),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:p,background:v,cursor:d,cursorAccent:b,selectionForeground:void 0,selectionBackgroundTransparent:x,selectionBackgroundOpaque:C.color.blend(v,x),selectionInactiveBackgroundTransparent:x,selectionInactiveBackgroundOpaque:C.color.blend(v,x),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(M={}){const k=this._colors;if(k.foreground=R(M.foreground,p),k.background=R(M.background,v),k.cursor=R(M.cursor,d),k.cursorAccent=R(M.cursorAccent,b),k.selectionBackgroundTransparent=R(M.selectionBackground,x),k.selectionBackgroundOpaque=C.color.blend(k.background,k.selectionBackgroundTransparent),k.selectionInactiveBackgroundTransparent=R(M.selectionInactiveBackground,k.selectionBackgroundTransparent),k.selectionInactiveBackgroundOpaque=C.color.blend(k.background,k.selectionInactiveBackgroundTransparent),k.selectionForeground=M.selectionForeground?R(M.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(M.black,c.DEFAULT_ANSI_COLORS[0]),k.ansi[1]=R(M.red,c.DEFAULT_ANSI_COLORS[1]),k.ansi[2]=R(M.green,c.DEFAULT_ANSI_COLORS[2]),k.ansi[3]=R(M.yellow,c.DEFAULT_ANSI_COLORS[3]),k.ansi[4]=R(M.blue,c.DEFAULT_ANSI_COLORS[4]),k.ansi[5]=R(M.magenta,c.DEFAULT_ANSI_COLORS[5]),k.ansi[6]=R(M.cyan,c.DEFAULT_ANSI_COLORS[6]),k.ansi[7]=R(M.white,c.DEFAULT_ANSI_COLORS[7]),k.ansi[8]=R(M.brightBlack,c.DEFAULT_ANSI_COLORS[8]),k.ansi[9]=R(M.brightRed,c.DEFAULT_ANSI_COLORS[9]),k.ansi[10]=R(M.brightGreen,c.DEFAULT_ANSI_COLORS[10]),k.ansi[11]=R(M.brightYellow,c.DEFAULT_ANSI_COLORS[11]),k.ansi[12]=R(M.brightBlue,c.DEFAULT_ANSI_COLORS[12]),k.ansi[13]=R(M.brightMagenta,c.DEFAULT_ANSI_COLORS[13]),k.ansi[14]=R(M.brightCyan,c.DEFAULT_ANSI_COLORS[14]),k.ansi[15]=R(M.brightWhite,c.DEFAULT_ANSI_COLORS[15]),M.extendedAnsi){const O=Math.min(k.ansi.length-16,M.extendedAnsi.length);for(let U=0;U<O;U++)k.ansi[U+16]=R(M.extendedAnsi[U],c.DEFAULT_ANSI_COLORS[U+16])}this._contrastCache.clear(),this._halfContrastCache.clear(),this._updateRestoreColors(),this._onChangeColors.fire(this.colors)}restoreColor(M){this._restoreColor(M),this._onChangeColors.fire(this.colors)}_restoreColor(M){if(M!==void 0)switch(M){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[M]=this._restoreColors.ansi[M]}else for(let k=0;k<this._restoreColors.ansi.length;++k)this._colors.ansi[k]=this._restoreColors.ansi[k]}modifyColors(M){M(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(M,k){if(M!==void 0)try{return C.css.toColor(M)}catch{}return k}c.ThemeService=L=h([y(0,T.IOptionsService)],L)},6349:(m,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.CircularList=void 0;const h=u(8460),y=u(844);class g extends y.Disposable{constructor(E){super(),this._maxLength=E,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(E){if(this._maxLength===E)return;const A=new Array(E);for(let T=0;T<Math.min(E,this.length);T++)A[T]=this._array[this._getCyclicIndex(T)];this._array=A,this._maxLength=E,this._startIndex=0}get length(){return this._length}set length(E){if(E>this._length)for(let A=this._length;A<E;A++)this._array[A]=void 0;this._length=E}get(E){return this._array[this._getCyclicIndex(E)]}set(E,A){this._array[this._getCyclicIndex(E)]=A}push(E){this._array[this._getCyclicIndex(this._length)]=E,this._length===this._maxLength?(this._startIndex=++this._startIndex%this._maxLength,this.onTrimEmitter.fire(1)):this._length++}recycle(){if(this._length!==this._maxLength)throw new Error("Can only recycle when the buffer is full");return this._startIndex=++this._startIndex%this._maxLength,this.onTrimEmitter.fire(1),this._array[this._getCyclicIndex(this._length-1)]}get isFull(){return this._length===this._maxLength}pop(){return this._array[this._getCyclicIndex(this._length---1)]}splice(E,A,...T){if(A){for(let p=E;p<this._length-A;p++)this._array[this._getCyclicIndex(p)]=this._array[this._getCyclicIndex(p+A)];this._length-=A,this.onDeleteEmitter.fire({index:E,amount:A})}for(let p=this._length-1;p>=E;p--)this._array[this._getCyclicIndex(p+T.length)]=this._array[this._getCyclicIndex(p)];for(let p=0;p<T.length;p++)this._array[this._getCyclicIndex(E+p)]=T[p];if(T.length&&this.onInsertEmitter.fire({index:E,amount:T.length}),this._length+T.length>this._maxLength){const p=this._length+T.length-this._maxLength;this._startIndex+=p,this._length=this._maxLength,this.onTrimEmitter.fire(p)}else this._length+=T.length}trimStart(E){E>this._length&&(E=this._length),this._startIndex+=E,this._length-=E,this.onTrimEmitter.fire(E)}shiftElements(E,A,T){if(!(A<=0)){if(E<0||E>=this._length)throw new Error("start argument out of range");if(E+T<0)throw new Error("Cannot shift elements in list beyond index 0");if(T>0){for(let v=A-1;v>=0;v--)this.set(E+v+T,this.get(E+v));const p=E+A+T-this._length;if(p>0)for(this._length+=p;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(let p=0;p<A;p++)this.set(E+p+T,this.get(E+p))}}_getCyclicIndex(E){return(this._startIndex+E)%this._maxLength}}c.CircularList=g},1439:(m,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.clone=void 0,c.clone=function u(h,y=5){if(typeof h!="object")return h;const g=Array.isArray(h)?[]:{};for(const C in h)g[C]=y<=1?h[C]:h[C]&&u(h[C],y-1);return g}},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,y=0,g=0;var C,E,A,T,p;function v(b){const x=b.toString(16);return x.length<2?"0"+x:x}function d(b,x){return b<x?(x+.05)/(b+.05):(b+.05)/(x+.05)}c.NULL_COLOR={css:"#00000000",rgba:0},(function(b){b.toCss=function(x,L,R,M){return M!==void 0?`#${v(x)}${v(L)}${v(R)}${v(M)}`:`#${v(x)}${v(L)}${v(R)}`},b.toRgba=function(x,L,R,M=255){return(x<<24|L<<16|R<<8|M)>>>0},b.toColor=function(x,L,R,M){return{css:b.toCss(x,L,R,M),rgba:b.toRgba(x,L,R,M)}}})(C||(c.channels=C={})),(function(b){function x(L,R){return g=Math.round(255*R),[u,h,y]=p.toChannels(L.rgba),{css:C.toCss(u,h,y,g),rgba:C.toRgba(u,h,y,g)}}b.blend=function(L,R){if(g=(255&R.rgba)/255,g===1)return{css:R.css,rgba:R.rgba};const M=R.rgba>>24&255,k=R.rgba>>16&255,O=R.rgba>>8&255,U=L.rgba>>24&255,F=L.rgba>>16&255,G=L.rgba>>8&255;return u=U+Math.round((M-U)*g),h=F+Math.round((k-F)*g),y=G+Math.round((O-G)*g),{css:C.toCss(u,h,y),rgba:C.toRgba(u,h,y)}},b.isOpaque=function(L){return(255&L.rgba)==255},b.ensureContrastRatio=function(L,R,M){const k=p.ensureContrastRatio(L.rgba,R.rgba,M);if(k)return C.toColor(k>>24&255,k>>16&255,k>>8&255)},b.opaque=function(L){const R=(255|L.rgba)>>>0;return[u,h,y]=p.toChannels(R),{css:C.toCss(u,h,y),rgba:R}},b.opacity=x,b.multiplyOpacity=function(L,R){return g=255&L.rgba,x(L,g*R/255)},b.toColorRGB=function(L){return[L.rgba>>24&255,L.rgba>>16&255,L.rgba>>8&255]}})(E||(c.color=E={})),(function(b){let x,L;try{const R=document.createElement("canvas");R.width=1,R.height=1;const M=R.getContext("2d",{willReadFrequently:!0});M&&(x=M,x.globalCompositeOperation="copy",L=x.createLinearGradient(0,0,1,1))}catch{}b.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),y=parseInt(R.slice(3,4).repeat(2),16),C.toColor(u,h,y);case 5:return u=parseInt(R.slice(1,2).repeat(2),16),h=parseInt(R.slice(2,3).repeat(2),16),y=parseInt(R.slice(3,4).repeat(2),16),g=parseInt(R.slice(4,5).repeat(2),16),C.toColor(u,h,y,g);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 M=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(M)return u=parseInt(M[1]),h=parseInt(M[2]),y=parseInt(M[3]),g=Math.round(255*(M[5]===void 0?1:parseFloat(M[5]))),C.toColor(u,h,y,g);if(!x||!L)throw new Error("css.toColor: Unsupported css format");if(x.fillStyle=L,x.fillStyle=R,typeof x.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(x.fillRect(0,0,1,1),[u,h,y,g]=x.getImageData(0,0,1,1).data,g!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:C.toRgba(u,h,y,g),css:R}}})(A||(c.css=A={})),(function(b){function x(L,R,M){const k=L/255,O=R/255,U=M/255;return .2126*(k<=.03928?k/12.92:Math.pow((k+.055)/1.055,2.4))+.7152*(O<=.03928?O/12.92:Math.pow((O+.055)/1.055,2.4))+.0722*(U<=.03928?U/12.92:Math.pow((U+.055)/1.055,2.4))}b.relativeLuminance=function(L){return x(L>>16&255,L>>8&255,255&L)},b.relativeLuminance2=x})(T||(c.rgb=T={})),(function(b){function x(R,M,k){const O=R>>24&255,U=R>>16&255,F=R>>8&255;let G=M>>24&255,I=M>>16&255,K=M>>8&255,te=d(T.relativeLuminance2(G,I,K),T.relativeLuminance2(O,U,F));for(;te<k&&(G>0||I>0||K>0);)G-=Math.max(0,Math.ceil(.1*G)),I-=Math.max(0,Math.ceil(.1*I)),K-=Math.max(0,Math.ceil(.1*K)),te=d(T.relativeLuminance2(G,I,K),T.relativeLuminance2(O,U,F));return(G<<24|I<<16|K<<8|255)>>>0}function L(R,M,k){const O=R>>24&255,U=R>>16&255,F=R>>8&255;let G=M>>24&255,I=M>>16&255,K=M>>8&255,te=d(T.relativeLuminance2(G,I,K),T.relativeLuminance2(O,U,F));for(;te<k&&(G<255||I<255||K<255);)G=Math.min(255,G+Math.ceil(.1*(255-G))),I=Math.min(255,I+Math.ceil(.1*(255-I))),K=Math.min(255,K+Math.ceil(.1*(255-K))),te=d(T.relativeLuminance2(G,I,K),T.relativeLuminance2(O,U,F));return(G<<24|I<<16|K<<8|255)>>>0}b.blend=function(R,M){if(g=(255&M)/255,g===1)return M;const k=M>>24&255,O=M>>16&255,U=M>>8&255,F=R>>24&255,G=R>>16&255,I=R>>8&255;return u=F+Math.round((k-F)*g),h=G+Math.round((O-G)*g),y=I+Math.round((U-I)*g),C.toRgba(u,h,y)},b.ensureContrastRatio=function(R,M,k){const O=T.relativeLuminance(R>>8),U=T.relativeLuminance(M>>8);if(d(O,U)<k){if(U<O){const I=x(R,M,k),K=d(O,T.relativeLuminance(I>>8));if(K<k){const te=L(R,M,k);return K>d(O,T.relativeLuminance(te>>8))?I:te}return I}const F=L(R,M,k),G=d(O,T.relativeLuminance(F>>8));if(G<k){const I=x(R,M,k);return G>d(O,T.relativeLuminance(I>>8))?F:I}return F}},b.reduceLuminance=x,b.increaseLuminance=L,b.toChannels=function(R){return[R>>24&255,R>>16&255,R>>8&255,255&R]}})(p||(c.rgba=p={})),c.toPaddedHex=v,c.contrastRatio=d},8969:(m,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.CoreTerminal=void 0;const h=u(844),y=u(2585),g=u(4348),C=u(7866),E=u(744),A=u(7302),T=u(6975),p=u(8460),v=u(1753),d=u(1480),b=u(7994),x=u(9282),L=u(5435),R=u(5981),M=u(2660);let k=!1;class O extends h.Disposable{get onScroll(){return this._onScrollApi||(this._onScrollApi=this.register(new p.EventEmitter),this._onScroll.event((F=>{this._onScrollApi?.fire(F.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(F){for(const G in F)this.optionsService.options[G]=F[G]}constructor(F){super(),this._windowsWrappingHeuristics=this.register(new h.MutableDisposable),this._onBinary=this.register(new p.EventEmitter),this.onBinary=this._onBinary.event,this._onData=this.register(new p.EventEmitter),this.onData=this._onData.event,this._onLineFeed=this.register(new p.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onResize=this.register(new p.EventEmitter),this.onResize=this._onResize.event,this._onWriteParsed=this.register(new p.EventEmitter),this.onWriteParsed=this._onWriteParsed.event,this._onScroll=this.register(new p.EventEmitter),this._instantiationService=new g.InstantiationService,this.optionsService=this.register(new A.OptionsService(F)),this._instantiationService.setService(y.IOptionsService,this.optionsService),this._bufferService=this.register(this._instantiationService.createInstance(E.BufferService)),this._instantiationService.setService(y.IBufferService,this._bufferService),this._logService=this.register(this._instantiationService.createInstance(C.LogService)),this._instantiationService.setService(y.ILogService,this._logService),this.coreService=this.register(this._instantiationService.createInstance(T.CoreService)),this._instantiationService.setService(y.ICoreService,this.coreService),this.coreMouseService=this.register(this._instantiationService.createInstance(v.CoreMouseService)),this._instantiationService.setService(y.ICoreMouseService,this.coreMouseService),this.unicodeService=this.register(this._instantiationService.createInstance(d.UnicodeService)),this._instantiationService.setService(y.IUnicodeService,this.unicodeService),this._charsetService=this._instantiationService.createInstance(b.CharsetService),this._instantiationService.setService(y.ICharsetService,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(M.OscLinkService),this._instantiationService.setService(y.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,p.forwardEvent)(this._inputHandler.onLineFeed,this._onLineFeed)),this.register(this._inputHandler),this.register((0,p.forwardEvent)(this._bufferService.onResize,this._onResize)),this.register((0,p.forwardEvent)(this.coreService.onData,this._onData)),this.register((0,p.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((G=>{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((G=>{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(((G,I)=>this._inputHandler.parse(G,I)))),this.register((0,p.forwardEvent)(this._writeBuffer.onWriteParsed,this._onWriteParsed))}write(F,G){this._writeBuffer.write(F,G)}writeSync(F,G){this._logService.logLevel<=y.LogLevelEnum.WARN&&!k&&(this._logService.warn("writeSync is unreliable and will be removed soon."),k=!0),this._writeBuffer.writeSync(F,G)}input(F,G=!0){this.coreService.triggerDataEvent(F,G)}resize(F,G){isNaN(F)||isNaN(G)||(F=Math.max(F,E.MINIMUM_COLS),G=Math.max(G,E.MINIMUM_ROWS),this._bufferService.resize(F,G))}scroll(F,G=!1){this._bufferService.scroll(F,G)}scrollLines(F,G,I){this._bufferService.scrollLines(F,G,I)}scrollPages(F){this.scrollLines(F*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(){this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(F){const G=F-this._bufferService.buffer.ydisp;G!==0&&this.scrollLines(G)}registerEscHandler(F,G){return this._inputHandler.registerEscHandler(F,G)}registerDcsHandler(F,G){return this._inputHandler.registerDcsHandler(F,G)}registerCsiHandler(F,G){return this._inputHandler.registerCsiHandler(F,G)}registerOscHandler(F,G){return this._inputHandler.registerOscHandler(F,G)}_setup(){this._handleWindowsPtyOptionChange()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_handleWindowsPtyOptionChange(){let F=!1;const G=this.optionsService.rawOptions.windowsPty;G&&G.buildNumber!==void 0&&G.buildNumber!==void 0?F=G.backend==="conpty"&&G.buildNumber<21376:this.optionsService.rawOptions.windowsMode&&(F=!0),F?this._enableWindowsWrappingHeuristics():this._windowsWrappingHeuristics.clear()}_enableWindowsWrappingHeuristics(){if(!this._windowsWrappingHeuristics.value){const F=[];F.push(this.onLineFeed(x.updateWindowsModeWrappedState.bind(null,this._bufferService))),F.push(this.registerCsiHandler({final:"H"},(()=>((0,x.updateWindowsModeWrappedState)(this._bufferService),!1)))),this._windowsWrappingHeuristics.value=(0,h.toDisposable)((()=>{for(const G of F)G.dispose()}))}}}c.CoreTerminal=O},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 y=[];for(let g=0;g<this._listeners.length;g++)y.push(this._listeners[g]);for(let g=0;g<y.length;g++)y[g].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((y=>h.fire(y)))},c.runAndSubscribe=function(u,h){return h(void 0),u((y=>h(y)))}},5435:function(m,c,u){var h=this&&this.__decorate||function(Y,B,z,N){var P,Z=arguments.length,ae=Z<3?B:N===null?N=Object.getOwnPropertyDescriptor(B,z):N;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")ae=Reflect.decorate(Y,B,z,N);else for(var ce=Y.length-1;ce>=0;ce--)(P=Y[ce])&&(ae=(Z<3?P(ae):Z>3?P(B,z,ae):P(B,z))||ae);return Z>3&&ae&&Object.defineProperty(B,z,ae),ae},y=this&&this.__param||function(Y,B){return function(z,N){B(z,N,Y)}};Object.defineProperty(c,"__esModule",{value:!0}),c.InputHandler=c.WindowsOptionsReportType=void 0;const g=u(2584),C=u(7116),E=u(2015),A=u(844),T=u(482),p=u(8437),v=u(8460),d=u(643),b=u(511),x=u(3734),L=u(2585),R=u(1480),M=u(6242),k=u(6351),O=u(5941),U={"(":0,")":1,"*":2,"+":3,"-":1,".":2},F=131072;function G(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 I;(function(Y){Y[Y.GET_WIN_SIZE_PIXELS=0]="GET_WIN_SIZE_PIXELS",Y[Y.GET_CELL_SIZE_PIXELS=1]="GET_CELL_SIZE_PIXELS"})(I||(c.WindowsOptionsReportType=I={}));let K=0;class te extends A.Disposable{getAttrData(){return this._curAttrData}constructor(B,z,N,P,Z,ae,ce,_e,Q=new E.EscapeSequenceParser){super(),this._bufferService=B,this._charsetService=z,this._coreService=N,this._logService=P,this._optionsService=Z,this._oscLinkService=ae,this._coreMouseService=ce,this._unicodeService=_e,this._parser=Q,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new T.StringToUtf32,this._utf8Decoder=new T.Utf8ToUtf32,this._workCell=new b.CellData,this._windowTitle="",this._iconName="",this._windowTitleStack=[],this._iconNameStack=[],this._curAttrData=p.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=p.DEFAULT_ATTR_DATA.clone(),this._onRequestBell=this.register(new v.EventEmitter),this.onRequestBell=this._onRequestBell.event,this._onRequestRefreshRows=this.register(new v.EventEmitter),this.onRequestRefreshRows=this._onRequestRefreshRows.event,this._onRequestReset=this.register(new v.EventEmitter),this.onRequestReset=this._onRequestReset.event,this._onRequestSendFocus=this.register(new v.EventEmitter),this.onRequestSendFocus=this._onRequestSendFocus.event,this._onRequestSyncScrollBar=this.register(new v.EventEmitter),this.onRequestSyncScrollBar=this._onRequestSyncScrollBar.event,this._onRequestWindowsOptionsReport=this.register(new v.EventEmitter),this.onRequestWindowsOptionsReport=this._onRequestWindowsOptionsReport.event,this._onA11yChar=this.register(new v.EventEmitter),this.onA11yChar=this._onA11yChar.event,this._onA11yTab=this.register(new v.EventEmitter),this.onA11yTab=this._onA11yTab.event,this._onCursorMove=this.register(new v.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onLineFeed=this.register(new v.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onScroll=this.register(new v.EventEmitter),this.onScroll=this._onScroll.event,this._onTitleChange=this.register(new v.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onColor=this.register(new v.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 q(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(g.C0.BEL,(()=>this.bell())),this._parser.setExecuteHandler(g.C0.LF,(()=>this.lineFeed())),this._parser.setExecuteHandler(g.C0.VT,(()=>this.lineFeed())),this._parser.setExecuteHandler(g.C0.FF,(()=>this.lineFeed())),this._parser.setExecuteHandler(g.C0.CR,(()=>this.carriageReturn())),this._parser.setExecuteHandler(g.C0.BS,(()=>this.backspace())),this._parser.setExecuteHandler(g.C0.HT,(()=>this.tab())),this._parser.setExecuteHandler(g.C0.SO,(()=>this.shiftOut())),this._parser.setExecuteHandler(g.C0.SI,(()=>this.shiftIn())),this._parser.setExecuteHandler(g.C1.IND,(()=>this.index())),this._parser.setExecuteHandler(g.C1.NEL,(()=>this.nextLine())),this._parser.setExecuteHandler(g.C1.HTS,(()=>this.tabSet())),this._parser.registerOscHandler(0,new M.OscHandler(($=>(this.setTitle($),this.setIconName($),!0)))),this._parser.registerOscHandler(1,new M.OscHandler(($=>this.setIconName($)))),this._parser.registerOscHandler(2,new M.OscHandler(($=>this.setTitle($)))),this._parser.registerOscHandler(4,new M.OscHandler(($=>this.setOrReportIndexedColor($)))),this._parser.registerOscHandler(8,new M.OscHandler(($=>this.setHyperlink($)))),this._parser.registerOscHandler(10,new M.OscHandler(($=>this.setOrReportFgColor($)))),this._parser.registerOscHandler(11,new M.OscHandler(($=>this.setOrReportBgColor($)))),this._parser.registerOscHandler(12,new M.OscHandler(($=>this.setOrReportCursorColor($)))),this._parser.registerOscHandler(104,new M.OscHandler(($=>this.restoreIndexedColor($)))),this._parser.registerOscHandler(110,new M.OscHandler(($=>this.restoreFgColor($)))),this._parser.registerOscHandler(111,new M.OscHandler(($=>this.restoreBgColor($)))),this._parser.registerOscHandler(112,new M.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,N,P){this._parseStack.paused=!0,this._parseStack.cursorStartX=B,this._parseStack.cursorStartY=z,this._parseStack.decodedLength=N,this._parseStack.position=P}_logSlowResolvingAsync(B){this._logService.logLevel<=L.LogLevelEnum.WARN&&Promise.race([B,new Promise(((z,N)=>setTimeout((()=>N("#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 N,P=this._activeBuffer.x,Z=this._activeBuffer.y,ae=0;const ce=this._parseStack.paused;if(ce){if(N=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,z))return this._logSlowResolvingAsync(N),N;P=this._parseStack.cursorStartX,Z=this._parseStack.cursorStartY,this._parseStack.paused=!1,B.length>F&&(ae=this._parseStack.position+F)}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<F&&(this._parseBuffer=new Uint32Array(Math.min(B.length,F))),ce||this._dirtyRowTracker.clearRange(),B.length>F)for(let $=ae;$<B.length;$+=F){const oe=$+F<B.length?$+F:B.length,ge=typeof B=="string"?this._stringDecoder.decode(B.substring($,oe),this._parseBuffer):this._utf8Decoder.decode(B.subarray($,oe),this._parseBuffer);if(N=this._parser.parse(this._parseBuffer,ge))return this._preserveStack(P,Z,ge,$),this._logSlowResolvingAsync(N),N}else if(!ce){const $=typeof B=="string"?this._stringDecoder.decode(B,this._parseBuffer):this._utf8Decoder.decode(B,this._parseBuffer);if(N=this._parser.parse(this._parseBuffer,$))return this._preserveStack(P,Z,$,0),this._logSlowResolvingAsync(N),N}this._activeBuffer.x===P&&this._activeBuffer.y===Z||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,N){let P,Z;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&&N-z>0&&ge.getWidth(this._activeBuffer.x-1)===2&&ge.setCellFromCodepoint(this._activeBuffer.x-1,0,1,oe);let Se=this._parser.precedingJoinState;for(let ye=z;ye<N;++ye){if(P=B[ye],P<127&&ae){const xt=ae[String.fromCharCode(P)];xt&&(P=xt.charCodeAt(0))}const $e=this._unicodeService.charProperties(P,Se);Z=R.UnicodeService.extractWidth($e);const Fe=R.UnicodeService.extractShouldJoin($e),Xe=Fe?R.UnicodeService.extractWidth(Se):0;if(Se=$e,ce&&this._onA11yChar.fire((0,T.stringFromCodePoint)(P)),this._getCurrentLinkId()&&this._oscLinkService.addLineToLink(this._getCurrentLinkId(),this._activeBuffer.ybase+this._activeBuffer.y),this._activeBuffer.x+Z-Xe>_e){if(Q){const xt=ge;let Ne=this._activeBuffer.x-Xe;for(this._activeBuffer.x=Xe,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),Xe>0&&ge instanceof p.BufferLine&&ge.copyCellsFrom(xt,Ne,0,Xe,!1);Ne<_e;)xt.setCellFromCodepoint(Ne++,0,1,oe)}else if(this._activeBuffer.x=_e-1,Z===2)continue}if(Fe&&this._activeBuffer.x){const xt=ge.getWidth(this._activeBuffer.x-1)?1:2;ge.addCodepointToCell(this._activeBuffer.x-xt,P,Z);for(let Ne=Z-Xe;--Ne>=0;)ge.setCellFromCodepoint(this._activeBuffer.x++,0,0,oe)}else if($&&(ge.insertCells(this._activeBuffer.x,Z-Xe,this._activeBuffer.getNullCell(oe)),ge.getWidth(_e-1)===2&&ge.setCellFromCodepoint(_e-1,d.NULL_CELL_CODE,d.NULL_CELL_WIDTH,oe)),ge.setCellFromCodepoint(this._activeBuffer.x++,P,Z,oe),Z>0)for(;--Z;)ge.setCellFromCodepoint(this._activeBuffer.x++,0,0,oe)}this._parser.precedingJoinState=Se,this._activeBuffer.x<_e&&N-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,(N=>!G(N.params[0],this._optionsService.rawOptions.windowOptions)||z(N)))}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 M.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,N,P=!1,Z=!1){const ae=this._activeBuffer.lines.get(this._activeBuffer.ybase+B);ae.replaceCells(z,N,this._activeBuffer.getNullCell(this._eraseAttrData()),Z),P&&(ae.isWrapped=!1)}_resetBufferLine(B,z=!1){const N=this._activeBuffer.lines.get(this._activeBuffer.ybase+B);N&&(N.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),z),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+B),N.isWrapped=!1)}eraseInDisplay(B,z=!1){let N;switch(this._restrictCursor(this._bufferService.cols),B.params[0]){case 0:for(N=this._activeBuffer.y,this._dirtyRowTracker.markDirty(N),this._eraseInBufferLine(N++,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,z);N<this._bufferService.rows;N++)this._resetBufferLine(N,z);this._dirtyRowTracker.markDirty(N);break;case 1:for(N=this._activeBuffer.y,this._dirtyRowTracker.markDirty(N),this._eraseInBufferLine(N,0,this._activeBuffer.x+1,!0,z),this._activeBuffer.x+1>=this._bufferService.cols&&(this._activeBuffer.lines.get(N+1).isWrapped=!1);N--;)this._resetBufferLine(N,z);this._dirtyRowTracker.markDirty(0);break;case 2:for(N=this._bufferService.rows,this._dirtyRowTracker.markDirty(N-1);N--;)this._resetBufferLine(N,z);this._dirtyRowTracker.markDirty(0);break;case 3:const P=this._activeBuffer.lines.length-this._bufferService.rows;P>0&&(this._activeBuffer.lines.trimStart(P),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-P,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-P,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 N=this._activeBuffer.ybase+this._activeBuffer.y,P=this._bufferService.rows-1-this._activeBuffer.scrollBottom,Z=this._bufferService.rows-1+this._activeBuffer.ybase-P+1;for(;z--;)this._activeBuffer.lines.splice(Z-1,1),this._activeBuffer.lines.splice(N,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}deleteLines(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 N=this._activeBuffer.ybase+this._activeBuffer.y;let P;for(P=this._bufferService.rows-1-this._activeBuffer.scrollBottom,P=this._bufferService.rows-1+this._activeBuffer.ybase-P;z--;)this._activeBuffer.lines.splice(N,1),this._activeBuffer.lines.splice(P,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(p.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 N=this._activeBuffer.scrollTop;N<=this._activeBuffer.scrollBottom;++N){const P=this._activeBuffer.lines.get(this._activeBuffer.ybase+N);P.deleteCells(0,z,this._activeBuffer.getNullCell(this._eraseAttrData())),P.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 N=this._activeBuffer.scrollTop;N<=this._activeBuffer.scrollBottom;++N){const P=this._activeBuffer.lines.get(this._activeBuffer.ybase+N);P.insertCells(0,z,this._activeBuffer.getNullCell(this._eraseAttrData())),P.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 N=this._activeBuffer.scrollTop;N<=this._activeBuffer.scrollBottom;++N){const P=this._activeBuffer.lines.get(this._activeBuffer.ybase+N);P.insertCells(this._activeBuffer.x,z,this._activeBuffer.getNullCell(this._eraseAttrData())),P.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 N=this._activeBuffer.scrollTop;N<=this._activeBuffer.scrollBottom;++N){const P=this._activeBuffer.lines.get(this._activeBuffer.ybase+N);P.deleteCells(this._activeBuffer.x,z,this._activeBuffer.getNullCell(this._eraseAttrData())),P.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 N=B.params[0]||1,P=R.UnicodeService.extractWidth(z),Z=this._activeBuffer.x-P,ae=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).getString(Z),ce=new Uint32Array(ae.length*N);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;$<N;++$)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(g.C0.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(g.C0.ESC+"[?6c")),!0}sendDeviceAttributesSecondary(B){return B.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(g.C0.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(g.C0.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(B.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(g.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 N=this._coreService.decPrivateModes,{activeProtocol:P,activeEncoding:Z}=this._coreMouseService,ae=this._coreService,{buffers:ce,cols:_e}=this._bufferService,{active:Q,alt:$}=ce,oe=this._optionsService.rawOptions,ge=Fe=>Fe?1:2,Se=B.params[0];return ye=Se,$e=z?Se===2?4:Se===4?ge(ae.modes.insertMode):Se===12?3:Se===20?ge(oe.convertEol):0:Se===1?ge(N.applicationCursorKeys):Se===3?oe.windowOptions.setWinLines?_e===80?2:_e===132?1:0:0:Se===6?ge(N.origin):Se===7?ge(N.wraparound):Se===8?3:Se===9?ge(P==="X10"):Se===12?ge(oe.cursorBlink):Se===25?ge(!ae.isCursorHidden):Se===45?ge(N.reverseWraparound):Se===66?ge(N.applicationKeypad):Se===67?4:Se===1e3?ge(P==="VT200"):Se===1002?ge(P==="DRAG"):Se===1003?ge(P==="ANY"):Se===1004?ge(N.sendFocus):Se===1005?4:Se===1006?ge(Z==="SGR"):Se===1015?4:Se===1016?ge(Z==="SGR_PIXELS"):Se===1048?1:Se===47||Se===1047||Se===1049?ge(Q===$):Se===2004?ge(N.bracketedPasteMode):0,ae.triggerDataEvent(`${g.C0.ESC}[${z?"":"?"}${ye};${$e}$y`),!0;var ye,$e}_updateAttrColor(B,z,N,P,Z){return z===2?(B|=50331648,B&=-16777216,B|=x.AttributeData.fromColorRGB([N,P,Z])):z===5&&(B&=-50331904,B|=33554432|255&N),B}_extractColor(B,z,N){const P=[0,0,-1,0,0,0];let Z=0,ae=0;do{if(P[ae+Z]=B.params[z+ae],B.hasSubParams(z+ae)){const ce=B.getSubParams(z+ae);let _e=0;do P[1]===5&&(Z=1),P[ae+_e+1+Z]=ce[_e];while(++_e<ce.length&&_e+ae+1+Z<P.length);break}if(P[1]===5&&ae+Z>=2||P[1]===2&&ae+Z>=5)break;P[1]&&(Z=1)}while(++ae+z<B.length&&ae+Z<P.length);for(let ce=2;ce<P.length;++ce)P[ce]===-1&&(P[ce]=0);switch(P[0]){case 38:N.fg=this._updateAttrColor(N.fg,P[1],P[3],P[4],P[5]);break;case 48:N.bg=this._updateAttrColor(N.bg,P[1],P[3],P[4],P[5]);break;case 58:N.extended=N.extended.clone(),N.extended.underlineColor=this._updateAttrColor(N.extended.underlineColor,P[1],P[3],P[4],P[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=p.DEFAULT_ATTR_DATA.fg,B.bg=p.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 N;const P=this._curAttrData;for(let Z=0;Z<z;Z++)N=B.params[Z],N>=30&&N<=37?(P.fg&=-50331904,P.fg|=16777216|N-30):N>=40&&N<=47?(P.bg&=-50331904,P.bg|=16777216|N-40):N>=90&&N<=97?(P.fg&=-50331904,P.fg|=16777224|N-90):N>=100&&N<=107?(P.bg&=-50331904,P.bg|=16777224|N-100):N===0?this._processSGR0(P):N===1?P.fg|=134217728:N===3?P.bg|=67108864:N===4?(P.fg|=268435456,this._processUnderline(B.hasSubParams(Z)?B.getSubParams(Z)[0]:1,P)):N===5?P.fg|=536870912:N===7?P.fg|=67108864:N===8?P.fg|=1073741824:N===9?P.fg|=2147483648:N===2?P.bg|=134217728:N===21?this._processUnderline(2,P):N===22?(P.fg&=-134217729,P.bg&=-134217729):N===23?P.bg&=-67108865:N===24?(P.fg&=-268435457,this._processUnderline(0,P)):N===25?P.fg&=-536870913:N===27?P.fg&=-67108865:N===28?P.fg&=-1073741825:N===29?P.fg&=2147483647:N===39?(P.fg&=-67108864,P.fg|=16777215&p.DEFAULT_ATTR_DATA.fg):N===49?(P.bg&=-67108864,P.bg|=16777215&p.DEFAULT_ATTR_DATA.bg):N===38||N===48||N===58?Z+=this._extractColor(B,Z,P):N===53?P.bg|=1073741824:N===55?P.bg&=-1073741825:N===59?(P.extended=P.extended.clone(),P.extended.underlineColor=-1,P.updateExtended()):N===100?(P.fg&=-67108864,P.fg|=16777215&p.DEFAULT_ATTR_DATA.fg,P.bg&=-67108864,P.bg|=16777215&p.DEFAULT_ATTR_DATA.bg):this._logService.debug("Unknown SGR attribute: %d.",N);return!0}deviceStatus(B){switch(B.params[0]){case 5:this._coreService.triggerDataEvent(`${g.C0.ESC}[0n`);break;case 6:const z=this._activeBuffer.y+1,N=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${g.C0.ESC}[${z};${N}R`)}return!0}deviceStatusPrivate(B){if(B.params[0]===6){const z=this._activeBuffer.y+1,N=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${g.C0.ESC}[?${z};${N}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=p.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 N=z%2==1;return this._optionsService.options.cursorBlink=N,!0}setScrollRegion(B){const z=B.params[0]||1;let N;return(B.length<2||(N=B.params[1])>this._bufferService.rows||N===0)&&(N=this._bufferService.rows),N>z&&(this._activeBuffer.scrollTop=z-1,this._activeBuffer.scrollBottom=N-1,this._setCursor(0,0)),!0}windowOptions(B){if(!G(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(I.GET_WIN_SIZE_PIXELS);break;case 16:this._onRequestWindowsOptionsReport.fire(I.GET_CELL_SIZE_PIXELS);break;case 18:this._bufferService&&this._coreService.triggerDataEvent(`${g.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=[],N=B.split(";");for(;N.length>1;){const P=N.shift(),Z=N.shift();if(/^\d+$/.exec(P)){const ae=parseInt(P);if(W(ae))if(Z==="?")z.push({type:0,index:ae});else{const ce=(0,O.parseColor)(Z);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 N=B.split(":");let P;const Z=N.findIndex((ae=>ae.startsWith("id=")));return Z!==-1&&(P=N[Z].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:P,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 N=B.split(";");for(let P=0;P<N.length&&!(z>=this._specialColors.length);++P,++z)if(N[P]==="?")this._onColor.fire([{type:0,index:this._specialColors[z]}]);else{const Z=(0,O.parseColor)(N[P]);Z&&this._onColor.fire([{type:1,index:this._specialColors[z],color:Z}])}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=[],N=B.split(";");for(let P=0;P<N.length;++P)if(/^\d+$/.exec(N[P])){const Z=parseInt(N[P]);W(Z)&&z.push({type:2,index:Z})}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(U[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=p.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=p.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 b.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 N=this._activeBuffer.ybase+this._activeBuffer.y+z,P=this._activeBuffer.lines.get(N);P&&(P.fill(B),P.isWrapped=!1)}return this._dirtyRowTracker.markAllDirty(),this._setCursor(0,0),!0}requestStatusString(B,z){const N=this._bufferService.buffer,P=this._optionsService.rawOptions;return(Z=>(this._coreService.triggerDataEvent(`${g.C0.ESC}${Z}${g.C0.ESC}\\`),!0))(B==='"q'?`P1$r${this._curAttrData.isProtected()?1:0}"q`:B==='"p'?'P1$r61;1"p':B==="r"?`P1$r${N.scrollTop+1};${N.scrollBottom+1}r`:B==="m"?"P1$r0m":B===" q"?`P1$r${{block:2,underline:4,bar:6}[P.cursorStyle]-(P.cursorBlink?1:0)} q`:"P0$r")}markRangeDirty(B,z){this._dirtyRowTracker.markRangeDirty(B,z)}}c.InputHandler=te;let q=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&&(K=Y,Y=B,B=K),Y<this.start&&(this.start=Y),B>this.end&&(this.end=B)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};function W(Y){return 0<=Y&&Y<256}q=h([y(0,L.IBufferService)],q)},844:(m,c)=>{function u(h){for(const y of h)y.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 y=this._disposables.indexOf(h);y!==-1&&this._disposables.splice(y,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(y,g,C){this._data[y]||(this._data[y]={}),this._data[y][g]=C}get(y,g){return this._data[y]?this._data[y][g]:void 0}clear(){this._data={}}}c.TwoKeyMap=u,c.FourKeyMap=class{constructor(){this._data=new u}set(h,y,g,C,E){this._data.get(h,y)||this._data.set(h,y,new u),this._data.get(h,y).set(g,C,E)}get(h,y,g,C){return this._data.get(h,y)?.get(g,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 y=u.match(/Version\/(\d+)/);return y===null||y.length<2?0:parseInt(y[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 y=this._getKey(h);if(y===void 0||(u=this._search(y),u===-1)||this._getKey(this._array[u])!==y)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])===y);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,y){if(this._array.length!==0&&(u=this._search(h),!(u<0||u>=this._array.length)&&this._getKey(this._array[u])===h))do y(this._array[u]);while(++u<this._array.length&&this._getKey(this._array[u])===h)}values(){return[...this._array].values()}_search(h){let y=0,g=this._array.length-1;for(;g>=y;){let C=y+g>>1;const E=this._getKey(this._array[C]);if(E>h)g=C-1;else{if(!(E<h)){for(;C>0&&this._getKey(this._array[C-1])===h;)C--;return C}y=C+1}}return y}}},7226:(m,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.DebouncedIdleTask=c.IdleTaskQueue=c.PriorityTaskQueue=void 0;const h=u(6114);class y{constructor(){this._tasks=[],this._i=0}enqueue(E){this._tasks.push(E),this._start()}flush(){for(;this._i<this._tasks.length;)this._tasks[this._i]()||this._i++;this.clear()}clear(){this._idleCallback&&(this._cancelCallback(this._idleCallback),this._idleCallback=void 0),this._i=0,this._tasks.length=0}_start(){this._idleCallback||(this._idleCallback=this._requestCallback(this._process.bind(this)))}_process(E){this._idleCallback=void 0;let A=0,T=0,p=E.timeRemaining(),v=0;for(;this._i<this._tasks.length;){if(A=Date.now(),this._tasks[this._i]()||this._i++,A=Math.max(1,Date.now()-A),T=Math.max(A,T),v=E.timeRemaining(),1.5*T>v)return p-A<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(p-A))}ms`),void this._start();p=v}this.clear()}}class g extends y{_requestCallback(E){return setTimeout((()=>E(this._createDeadline(16))))}_cancelCallback(E){clearTimeout(E)}_createDeadline(E){const A=Date.now()+E;return{timeRemaining:()=>Math.max(0,A-Date.now())}}}c.PriorityTaskQueue=g,c.IdleTaskQueue=!h.isNode&&"requestIdleCallback"in window?class extends y{_requestCallback(C){return requestIdleCallback(C)}_cancelCallback(C){cancelIdleCallback(C)}}:g,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(y){const g=y.buffer.lines.get(y.buffer.ybase+y.buffer.y-1),C=g?.get(y.cols-1),E=y.buffer.lines.get(y.buffer.ybase+y.buffer.y);E&&C&&(E.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(g){return[g>>>16&255,g>>>8&255,255&g]}static fromColorRGB(g){return(255&g[0])<<16|(255&g[1])<<8|255&g[2]}clone(){const g=new u;return g.fg=this.fg,g.bg=this.bg,g.extended=this.extended.clone(),g}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(g){this._ext=g}get underlineStyle(){return this._urlId?5:(469762048&this._ext)>>26}set underlineStyle(g){this._ext&=-469762049,this._ext|=g<<26&469762048}get underlineColor(){return 67108863&this._ext}set underlineColor(g){this._ext&=-67108864,this._ext|=67108863&g}get urlId(){return this._urlId}set urlId(g){this._urlId=g}get underlineVariantOffset(){const g=(3758096384&this._ext)>>29;return g<0?4294967288^g:g}set underlineVariantOffset(g){this._ext&=536870911,this._ext|=g<<29&3758096384}constructor(g=0,C=0){this._ext=0,this._urlId=0,this._ext=g,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),y=u(7226),g=u(3734),C=u(8437),E=u(4634),A=u(511),T=u(643),p=u(4863),v=u(7116);c.MAX_BUFFER_SIZE=4294967295,c.Buffer=class{constructor(d,b,x){this._hasScrollback=d,this._optionsService=b,this._bufferService=x,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=v.DEFAULT_CHARSET,this.markers=[],this._nullCell=A.CellData.fromCharData([0,T.NULL_CELL_CHAR,T.NULL_CELL_WIDTH,T.NULL_CELL_CODE]),this._whitespaceCell=A.CellData.fromCharData([0,T.WHITESPACE_CELL_CHAR,T.WHITESPACE_CELL_WIDTH,T.WHITESPACE_CELL_CODE]),this._isClearing=!1,this._memoryCleanupQueue=new y.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(d){return d?(this._nullCell.fg=d.fg,this._nullCell.bg=d.bg,this._nullCell.extended=d.extended):(this._nullCell.fg=0,this._nullCell.bg=0,this._nullCell.extended=new g.ExtendedAttrs),this._nullCell}getWhitespaceCell(d){return d?(this._whitespaceCell.fg=d.fg,this._whitespaceCell.bg=d.bg,this._whitespaceCell.extended=d.extended):(this._whitespaceCell.fg=0,this._whitespaceCell.bg=0,this._whitespaceCell.extended=new g.ExtendedAttrs),this._whitespaceCell}getBlankLine(d,b){return new C.BufferLine(this._bufferService.cols,this.getNullCell(d),b)}get hasScrollback(){return this._hasScrollback&&this.lines.maxLength>this._rows}get isCursorInViewport(){const d=this.ybase+this.y-this.ydisp;return d>=0&&d<this._rows}_getCorrectBufferLength(d){if(!this._hasScrollback)return d;const b=d+this._optionsService.rawOptions.scrollback;return b>c.MAX_BUFFER_SIZE?c.MAX_BUFFER_SIZE:b}fillViewportRows(d){if(this.lines.length===0){d===void 0&&(d=C.DEFAULT_ATTR_DATA);let b=this._rows;for(;b--;)this.lines.push(this.getBlankLine(d))}}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(d,b){const x=this.getNullCell(C.DEFAULT_ATTR_DATA);let L=0;const R=this._getCorrectBufferLength(b);if(R>this.lines.maxLength&&(this.lines.maxLength=R),this.lines.length>0){if(this._cols<d)for(let k=0;k<this.lines.length;k++)L+=+this.lines.get(k).resize(d,x);let M=0;if(this._rows<b)for(let k=this._rows;k<b;k++)this.lines.length<b+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(d,x)):this.ybase>0&&this.lines.length<=this.ybase+this.y+M+1?(this.ybase--,M++,this.ydisp>0&&this.ydisp--):this.lines.push(new C.BufferLine(d,x)));else for(let k=this._rows;k>b;k--)this.lines.length>b+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,d-1),this.y=Math.min(this.y,b-1),M&&(this.y+=M),this.savedX=Math.min(this.savedX,d-1),this.scrollTop=0}if(this.scrollBottom=b-1,this._isReflowEnabled&&(this._reflow(d,b),this._cols>d))for(let M=0;M<this.lines.length;M++)L+=+this.lines.get(M).resize(d,x);this._cols=d,this._rows=b,this._memoryCleanupQueue.clear(),L>.1*this.lines.length&&(this._memoryCleanupPosition=0,this._memoryCleanupQueue.enqueue((()=>this._batchedMemoryCleanup())))}_batchedMemoryCleanup(){let d=!0;this._memoryCleanupPosition>=this.lines.length&&(this._memoryCleanupPosition=0,d=!1);let b=0;for(;this._memoryCleanupPosition<this.lines.length;)if(b+=this.lines.get(this._memoryCleanupPosition++).cleanupMemory(),b>100)return!0;return d}get _isReflowEnabled(){const d=this._optionsService.rawOptions.windowsPty;return d&&d.buildNumber?this._hasScrollback&&d.backend==="conpty"&&d.buildNumber>=21376:this._hasScrollback&&!this._optionsService.rawOptions.windowsMode}_reflow(d,b){this._cols!==d&&(d>this._cols?this._reflowLarger(d,b):this._reflowSmaller(d,b))}_reflowLarger(d,b){const x=(0,E.reflowLargerGetLinesToRemove)(this.lines,this._cols,d,this.ybase+this.y,this.getNullCell(C.DEFAULT_ATTR_DATA));if(x.length>0){const L=(0,E.reflowLargerCreateNewLayout)(this.lines,x);(0,E.reflowLargerApplyNewLayout)(this.lines,L.layout),this._reflowLargerAdjustViewport(d,b,L.countRemoved)}}_reflowLargerAdjustViewport(d,b,x){const L=this.getNullCell(C.DEFAULT_ATTR_DATA);let R=x;for(;R-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length<b&&this.lines.push(new C.BufferLine(d,L))):(this.ydisp===this.ybase&&this.ydisp--,this.ybase--);this.savedY=Math.max(this.savedY-x,0)}_reflowSmaller(d,b){const x=this.getNullCell(C.DEFAULT_ATTR_DATA),L=[];let R=0;for(let M=this.lines.length-1;M>=0;M--){let k=this.lines.get(M);if(!k||!k.isWrapped&&k.getTrimmedLength()<=d)continue;const O=[k];for(;k.isWrapped&&M>0;)k=this.lines.get(--M),O.unshift(k);const U=this.ybase+this.y;if(U>=M&&U<M+O.length)continue;const F=O[O.length-1].getTrimmedLength(),G=(0,E.reflowSmallerGetNewLineLengths)(O,this._cols,d),I=G.length-O.length;let K;K=this.ybase===0&&this.y!==this.lines.length-1?Math.max(0,this.y-this.lines.maxLength+I):Math.max(0,this.lines.length-this.lines.maxLength+I);const te=[];for(let N=0;N<I;N++){const P=this.getBlankLine(C.DEFAULT_ATTR_DATA,!0);te.push(P)}te.length>0&&(L.push({start:M+O.length+R,newLines:te}),R+=te.length),O.push(...te);let q=G.length-1,W=G[q];W===0&&(q--,W=G[q]);let Y=O.length-I-1,B=F;for(;Y>=0;){const N=Math.min(B,W);if(O[q]===void 0)break;if(O[q].copyCellsFrom(O[Y],B-N,W-N,N,!0),W-=N,W===0&&(q--,W=G[q]),B-=N,B===0){Y--;const P=Math.max(Y,0);B=(0,E.getWrappedLineTrimmedLength)(O,P,this._cols)}}for(let N=0;N<O.length;N++)G[N]<d&&O[N].setCell(G[N],x);let z=I-K;for(;z-- >0;)this.ybase===0?this.y<b-1?(this.y++,this.lines.pop()):(this.ybase++,this.ydisp++):this.ybase<Math.min(this.lines.maxLength,this.lines.length+R)-b&&(this.ybase===this.ydisp&&this.ydisp++,this.ybase++);this.savedY=Math.min(this.savedY+I,this.ybase+b-1)}if(L.length>0){const M=[],k=[];for(let q=0;q<this.lines.length;q++)k.push(this.lines.get(q));const O=this.lines.length;let U=O-1,F=0,G=L[F];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+R);let I=0;for(let q=Math.min(this.lines.maxLength-1,O+R-1);q>=0;q--)if(G&&G.start>U+I){for(let W=G.newLines.length-1;W>=0;W--)this.lines.set(q--,G.newLines[W]);q++,M.push({index:U+1,amount:G.newLines.length}),I+=G.newLines.length,G=L[++F]}else this.lines.set(q,k[U--]);let K=0;for(let q=M.length-1;q>=0;q--)M[q].index+=K,this.lines.onInsertEmitter.fire(M[q]),K+=M[q].amount;const te=Math.max(0,O+R-this.lines.maxLength);te>0&&this.lines.onTrimEmitter.fire(te)}}translateBufferLineToString(d,b,x=0,L){const R=this.lines.get(d);return R?R.translateToString(b,x,L):""}getWrappedRangeForLine(d){let b=d,x=d;for(;b>0&&this.lines.get(b).isWrapped;)b--;for(;x+1<this.lines.length&&this.lines.get(x+1).isWrapped;)x++;return{first:b,last:x}}setupTabStops(d){for(d!=null?this.tabs[d]||(d=this.prevStop(d)):(this.tabs={},d=0);d<this._cols;d+=this._optionsService.rawOptions.tabStopWidth)this.tabs[d]=!0}prevStop(d){for(d==null&&(d=this.x);!this.tabs[--d]&&d>0;);return d>=this._cols?this._cols-1:d<0?0:d}nextStop(d){for(d==null&&(d=this.x);!this.tabs[++d]&&d<this._cols;);return d>=this._cols?this._cols-1:d<0?0:d}clearMarkers(d){this._isClearing=!0;for(let b=0;b<this.markers.length;b++)this.markers[b].line===d&&(this.markers[b].dispose(),this.markers.splice(b--,1));this._isClearing=!1}clearAllMarkers(){this._isClearing=!0;for(let d=0;d<this.markers.length;d++)this.markers[d].dispose(),this.markers.splice(d--,1);this._isClearing=!1}addMarker(d){const b=new p.Marker(d);return this.markers.push(b),b.register(this.lines.onTrim((x=>{b.line-=x,b.line<0&&b.dispose()}))),b.register(this.lines.onInsert((x=>{b.line>=x.index&&(b.line+=x.amount)}))),b.register(this.lines.onDelete((x=>{b.line>=x.index&&b.line<x.index+x.amount&&b.dispose(),b.line>x.index&&(b.line-=x.amount)}))),b.register(b.onDispose((()=>this._removeMarker(b)))),b}_removeMarker(d){this._isClearing||this.markers.splice(this.markers.indexOf(d),1)}}},8437:(m,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.BufferLine=c.DEFAULT_ATTR_DATA=void 0;const h=u(3734),y=u(511),g=u(643),C=u(482);c.DEFAULT_ATTR_DATA=Object.freeze(new h.AttributeData);let E=0;class A{constructor(p,v,d=!1){this.isWrapped=d,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(3*p);const b=v||y.CellData.fromCharData([0,g.NULL_CELL_CHAR,g.NULL_CELL_WIDTH,g.NULL_CELL_CODE]);for(let x=0;x<p;++x)this.setCell(x,b);this.length=p}get(p){const v=this._data[3*p+0],d=2097151&v;return[this._data[3*p+1],2097152&v?this._combined[p]:d?(0,C.stringFromCodePoint)(d):"",v>>22,2097152&v?this._combined[p].charCodeAt(this._combined[p].length-1):d]}set(p,v){this._data[3*p+1]=v[g.CHAR_DATA_ATTR_INDEX],v[g.CHAR_DATA_CHAR_INDEX].length>1?(this._combined[p]=v[1],this._data[3*p+0]=2097152|p|v[g.CHAR_DATA_WIDTH_INDEX]<<22):this._data[3*p+0]=v[g.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|v[g.CHAR_DATA_WIDTH_INDEX]<<22}getWidth(p){return this._data[3*p+0]>>22}hasWidth(p){return 12582912&this._data[3*p+0]}getFg(p){return this._data[3*p+1]}getBg(p){return this._data[3*p+2]}hasContent(p){return 4194303&this._data[3*p+0]}getCodePoint(p){const v=this._data[3*p+0];return 2097152&v?this._combined[p].charCodeAt(this._combined[p].length-1):2097151&v}isCombined(p){return 2097152&this._data[3*p+0]}getString(p){const v=this._data[3*p+0];return 2097152&v?this._combined[p]:2097151&v?(0,C.stringFromCodePoint)(2097151&v):""}isProtected(p){return 536870912&this._data[3*p+2]}loadCell(p,v){return E=3*p,v.content=this._data[E+0],v.fg=this._data[E+1],v.bg=this._data[E+2],2097152&v.content&&(v.combinedData=this._combined[p]),268435456&v.bg&&(v.extended=this._extendedAttrs[p]),v}setCell(p,v){2097152&v.content&&(this._combined[p]=v.combinedData),268435456&v.bg&&(this._extendedAttrs[p]=v.extended),this._data[3*p+0]=v.content,this._data[3*p+1]=v.fg,this._data[3*p+2]=v.bg}setCellFromCodepoint(p,v,d,b){268435456&b.bg&&(this._extendedAttrs[p]=b.extended),this._data[3*p+0]=v|d<<22,this._data[3*p+1]=b.fg,this._data[3*p+2]=b.bg}addCodepointToCell(p,v,d){let b=this._data[3*p+0];2097152&b?this._combined[p]+=(0,C.stringFromCodePoint)(v):2097151&b?(this._combined[p]=(0,C.stringFromCodePoint)(2097151&b)+(0,C.stringFromCodePoint)(v),b&=-2097152,b|=2097152):b=v|4194304,d&&(b&=-12582913,b|=d<<22),this._data[3*p+0]=b}insertCells(p,v,d){if((p%=this.length)&&this.getWidth(p-1)===2&&this.setCellFromCodepoint(p-1,0,1,d),v<this.length-p){const b=new y.CellData;for(let x=this.length-p-v-1;x>=0;--x)this.setCell(p+v+x,this.loadCell(p+x,b));for(let x=0;x<v;++x)this.setCell(p+x,d)}else for(let b=p;b<this.length;++b)this.setCell(b,d);this.getWidth(this.length-1)===2&&this.setCellFromCodepoint(this.length-1,0,1,d)}deleteCells(p,v,d){if(p%=this.length,v<this.length-p){const b=new y.CellData;for(let x=0;x<this.length-p-v;++x)this.setCell(p+x,this.loadCell(p+v+x,b));for(let x=this.length-v;x<this.length;++x)this.setCell(x,d)}else for(let b=p;b<this.length;++b)this.setCell(b,d);p&&this.getWidth(p-1)===2&&this.setCellFromCodepoint(p-1,0,1,d),this.getWidth(p)!==0||this.hasContent(p)||this.setCellFromCodepoint(p,0,1,d)}replaceCells(p,v,d,b=!1){if(b)for(p&&this.getWidth(p-1)===2&&!this.isProtected(p-1)&&this.setCellFromCodepoint(p-1,0,1,d),v<this.length&&this.getWidth(v-1)===2&&!this.isProtected(v)&&this.setCellFromCodepoint(v,0,1,d);p<v&&p<this.length;)this.isProtected(p)||this.setCell(p,d),p++;else for(p&&this.getWidth(p-1)===2&&this.setCellFromCodepoint(p-1,0,1,d),v<this.length&&this.getWidth(v-1)===2&&this.setCellFromCodepoint(v,0,1,d);p<v&&p<this.length;)this.setCell(p++,d)}resize(p,v){if(p===this.length)return 4*this._data.length*2<this._data.buffer.byteLength;const d=3*p;if(p>this.length){if(this._data.buffer.byteLength>=4*d)this._data=new Uint32Array(this._data.buffer,0,d);else{const b=new Uint32Array(d);b.set(this._data),this._data=b}for(let b=this.length;b<p;++b)this.setCell(b,v)}else{this._data=this._data.subarray(0,d);const b=Object.keys(this._combined);for(let L=0;L<b.length;L++){const R=parseInt(b[L],10);R>=p&&delete this._combined[R]}const x=Object.keys(this._extendedAttrs);for(let L=0;L<x.length;L++){const R=parseInt(x[L],10);R>=p&&delete this._extendedAttrs[R]}}return this.length=p,4*d*2<this._data.buffer.byteLength}cleanupMemory(){if(4*this._data.length*2<this._data.buffer.byteLength){const p=new Uint32Array(this._data.length);return p.set(this._data),this._data=p,1}return 0}fill(p,v=!1){if(v)for(let d=0;d<this.length;++d)this.isProtected(d)||this.setCell(d,p);else{this._combined={},this._extendedAttrs={};for(let d=0;d<this.length;++d)this.setCell(d,p)}}copyFrom(p){this.length!==p.length?this._data=new Uint32Array(p._data):this._data.set(p._data),this.length=p.length,this._combined={};for(const v in p._combined)this._combined[v]=p._combined[v];this._extendedAttrs={};for(const v in p._extendedAttrs)this._extendedAttrs[v]=p._extendedAttrs[v];this.isWrapped=p.isWrapped}clone(){const p=new A(0);p._data=new Uint32Array(this._data),p.length=this.length;for(const v in this._combined)p._combined[v]=this._combined[v];for(const v in this._extendedAttrs)p._extendedAttrs[v]=this._extendedAttrs[v];return p.isWrapped=this.isWrapped,p}getTrimmedLength(){for(let p=this.length-1;p>=0;--p)if(4194303&this._data[3*p+0])return p+(this._data[3*p+0]>>22);return 0}getNoBgTrimmedLength(){for(let p=this.length-1;p>=0;--p)if(4194303&this._data[3*p+0]||50331648&this._data[3*p+2])return p+(this._data[3*p+0]>>22);return 0}copyCellsFrom(p,v,d,b,x){const L=p._data;if(x)for(let M=b-1;M>=0;M--){for(let k=0;k<3;k++)this._data[3*(d+M)+k]=L[3*(v+M)+k];268435456&L[3*(v+M)+2]&&(this._extendedAttrs[d+M]=p._extendedAttrs[v+M])}else for(let M=0;M<b;M++){for(let k=0;k<3;k++)this._data[3*(d+M)+k]=L[3*(v+M)+k];268435456&L[3*(v+M)+2]&&(this._extendedAttrs[d+M]=p._extendedAttrs[v+M])}const R=Object.keys(p._combined);for(let M=0;M<R.length;M++){const k=parseInt(R[M],10);k>=v&&(this._combined[k-v+d]=p._combined[k])}}translateToString(p,v,d,b){v=v??0,d=d??this.length,p&&(d=Math.min(d,this.getTrimmedLength())),b&&(b.length=0);let x="";for(;v<d;){const L=this._data[3*v+0],R=2097151&L,M=2097152&L?this._combined[v]:R?(0,C.stringFromCodePoint)(R):g.WHITESPACE_CELL_CHAR;if(x+=M,b)for(let k=0;k<M.length;++k)b.push(v);v+=L>>22||1}return b&&b.push(v),x}}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,y,g){if(y===h.length-1)return h[y].getTrimmedLength();const C=!h[y].hasContent(g-1)&&h[y].getWidth(g-1)===1,E=h[y+1].getWidth(0)===2;return C&&E?g-1:g}Object.defineProperty(c,"__esModule",{value:!0}),c.getWrappedLineTrimmedLength=c.reflowSmallerGetNewLineLengths=c.reflowLargerApplyNewLayout=c.reflowLargerCreateNewLayout=c.reflowLargerGetLinesToRemove=void 0,c.reflowLargerGetLinesToRemove=function(h,y,g,C,E){const A=[];for(let T=0;T<h.length-1;T++){let p=T,v=h.get(++p);if(!v.isWrapped)continue;const d=[h.get(T)];for(;p<h.length&&v.isWrapped;)d.push(v),v=h.get(++p);if(C>=T&&C<p){T+=d.length-1;continue}let b=0,x=u(d,b,y),L=1,R=0;for(;L<d.length;){const k=u(d,L,y),O=k-R,U=g-x,F=Math.min(O,U);d[b].copyCellsFrom(d[L],R,x,F,!1),x+=F,x===g&&(b++,x=0),R+=F,R===k&&(L++,R=0),x===0&&b!==0&&d[b-1].getWidth(g-1)===2&&(d[b].copyCellsFrom(d[b-1],g-1,x++,1,!1),d[b-1].setCell(g-1,E))}d[b].replaceCells(x,g,E);let M=0;for(let k=d.length-1;k>0&&(k>b||d[k].getTrimmedLength()===0);k--)M++;M>0&&(A.push(T+d.length-M),A.push(M)),T+=d.length-1}return A},c.reflowLargerCreateNewLayout=function(h,y){const g=[];let C=0,E=y[C],A=0;for(let T=0;T<h.length;T++)if(E===T){const p=y[++C];h.onDeleteEmitter.fire({index:T-A,amount:p}),T+=p-1,A+=p,E=y[++C]}else g.push(T);return{layout:g,countRemoved:A}},c.reflowLargerApplyNewLayout=function(h,y){const g=[];for(let C=0;C<y.length;C++)g.push(h.get(y[C]));for(let C=0;C<g.length;C++)h.set(C,g[C]);h.length=y.length},c.reflowSmallerGetNewLineLengths=function(h,y,g){const C=[],E=h.map(((v,d)=>u(h,d,y))).reduce(((v,d)=>v+d));let A=0,T=0,p=0;for(;p<E;){if(E-p<g){C.push(E-p);break}A+=g;const v=u(h,T,y);A>v&&(A-=v,T++);const d=h[T].getWidth(A-1)===2;d&&A--;const b=d?g-1:g;C.push(b),p+=b}return C},c.getWrappedLineTrimmedLength=u},5295:(m,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.BufferSet=void 0;const h=u(8460),y=u(844),g=u(9092);class C extends y.Disposable{constructor(A,T){super(),this._optionsService=A,this._bufferService=T,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 g.Buffer(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new g.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,T){this._normal.resize(A,T),this._alt.resize(A,T),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),y=u(643),g=u(3734);class C extends g.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new g.ExtendedAttrs,this.combinedData=""}static fromCharData(A){const T=new C;return T.setFromCharData(A),T}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[y.CHAR_DATA_ATTR_INDEX],this.bg=0;let T=!1;if(A[y.CHAR_DATA_CHAR_INDEX].length>2)T=!0;else if(A[y.CHAR_DATA_CHAR_INDEX].length===2){const p=A[y.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=p&&p<=56319){const v=A[y.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=v&&v<=57343?this.content=1024*(p-55296)+v-56320+65536|A[y.CHAR_DATA_WIDTH_INDEX]<<22:T=!0}else T=!0}else this.content=A[y.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|A[y.CHAR_DATA_WIDTH_INDEX]<<22;T&&(this.combinedData=A[y.CHAR_DATA_CHAR_INDEX],this.content=2097152|A[y.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),y=u(844);class g{get id(){return this._id}constructor(E){this.line=E,this.isDisposed=!1,this._disposables=[],this._id=g._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,y.disposeArray)(this._disposables),this._disposables.length=0)}register(E){return this._disposables.push(E),E}}c.Marker=g,g._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,y;Object.defineProperty(c,"__esModule",{value:!0}),c.C1_ESCAPED=c.C1=c.C0=void 0,(function(g){g.NUL="\0",g.SOH="",g.STX="",g.ETX="",g.EOT="",g.ENQ="",g.ACK="",g.BEL="\x07",g.BS="\b",g.HT=" ",g.LF=`
|
|
775
|
+
`,g.VT="\v",g.FF="\f",g.CR="\r",g.SO="",g.SI="",g.DLE="",g.DC1="",g.DC2="",g.DC3="",g.DC4="",g.NAK="",g.SYN="",g.ETB="",g.CAN="",g.EM="",g.SUB="",g.ESC="\x1B",g.FS="",g.GS="",g.RS="",g.US="",g.SP=" ",g.DEL=""})(u||(c.C0=u={})),(function(g){g.PAD="",g.HOP="",g.BPH="",g.NBH="",g.IND="",g.NEL="
",g.SSA="",g.ESA="",g.HTS="",g.HTJ="",g.VTS="",g.PLD="",g.PLU="",g.RI="",g.SS2="",g.SS3="",g.DCS="",g.PU1="",g.PU2="",g.STS="",g.CCH="",g.MW="",g.SPA="",g.EPA="",g.SOS="",g.SGCI="",g.SCI="",g.CSI="",g.ST="",g.OSC="",g.PM="",g.APC=""})(h||(c.C1=h={})),(function(g){g.ST=`${u.ESC}\\`})(y||(c.C1_ESCAPED=y={}))},7399:(m,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.evaluateKeyboardEvent=void 0;const h=u(2584),y={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(g,C,E,A){const T={type:0,cancel:!1,key:void 0},p=(g.shiftKey?1:0)|(g.altKey?2:0)|(g.ctrlKey?4:0)|(g.metaKey?8:0);switch(g.keyCode){case 0:g.key==="UIKeyInputUpArrow"?T.key=C?h.C0.ESC+"OA":h.C0.ESC+"[A":g.key==="UIKeyInputLeftArrow"?T.key=C?h.C0.ESC+"OD":h.C0.ESC+"[D":g.key==="UIKeyInputRightArrow"?T.key=C?h.C0.ESC+"OC":h.C0.ESC+"[C":g.key==="UIKeyInputDownArrow"&&(T.key=C?h.C0.ESC+"OB":h.C0.ESC+"[B");break;case 8:T.key=g.ctrlKey?"\b":h.C0.DEL,g.altKey&&(T.key=h.C0.ESC+T.key);break;case 9:if(g.shiftKey){T.key=h.C0.ESC+"[Z";break}T.key=h.C0.HT,T.cancel=!0;break;case 13:T.key=g.altKey?h.C0.ESC+h.C0.CR:h.C0.CR,T.cancel=!0;break;case 27:T.key=h.C0.ESC,g.altKey&&(T.key=h.C0.ESC+h.C0.ESC),T.cancel=!0;break;case 37:if(g.metaKey)break;p?(T.key=h.C0.ESC+"[1;"+(p+1)+"D",T.key===h.C0.ESC+"[1;3D"&&(T.key=h.C0.ESC+(E?"b":"[1;5D"))):T.key=C?h.C0.ESC+"OD":h.C0.ESC+"[D";break;case 39:if(g.metaKey)break;p?(T.key=h.C0.ESC+"[1;"+(p+1)+"C",T.key===h.C0.ESC+"[1;3C"&&(T.key=h.C0.ESC+(E?"f":"[1;5C"))):T.key=C?h.C0.ESC+"OC":h.C0.ESC+"[C";break;case 38:if(g.metaKey)break;p?(T.key=h.C0.ESC+"[1;"+(p+1)+"A",E||T.key!==h.C0.ESC+"[1;3A"||(T.key=h.C0.ESC+"[1;5A")):T.key=C?h.C0.ESC+"OA":h.C0.ESC+"[A";break;case 40:if(g.metaKey)break;p?(T.key=h.C0.ESC+"[1;"+(p+1)+"B",E||T.key!==h.C0.ESC+"[1;3B"||(T.key=h.C0.ESC+"[1;5B")):T.key=C?h.C0.ESC+"OB":h.C0.ESC+"[B";break;case 45:g.shiftKey||g.ctrlKey||(T.key=h.C0.ESC+"[2~");break;case 46:T.key=p?h.C0.ESC+"[3;"+(p+1)+"~":h.C0.ESC+"[3~";break;case 36:T.key=p?h.C0.ESC+"[1;"+(p+1)+"H":C?h.C0.ESC+"OH":h.C0.ESC+"[H";break;case 35:T.key=p?h.C0.ESC+"[1;"+(p+1)+"F":C?h.C0.ESC+"OF":h.C0.ESC+"[F";break;case 33:g.shiftKey?T.type=2:g.ctrlKey?T.key=h.C0.ESC+"[5;"+(p+1)+"~":T.key=h.C0.ESC+"[5~";break;case 34:g.shiftKey?T.type=3:g.ctrlKey?T.key=h.C0.ESC+"[6;"+(p+1)+"~":T.key=h.C0.ESC+"[6~";break;case 112:T.key=p?h.C0.ESC+"[1;"+(p+1)+"P":h.C0.ESC+"OP";break;case 113:T.key=p?h.C0.ESC+"[1;"+(p+1)+"Q":h.C0.ESC+"OQ";break;case 114:T.key=p?h.C0.ESC+"[1;"+(p+1)+"R":h.C0.ESC+"OR";break;case 115:T.key=p?h.C0.ESC+"[1;"+(p+1)+"S":h.C0.ESC+"OS";break;case 116:T.key=p?h.C0.ESC+"[15;"+(p+1)+"~":h.C0.ESC+"[15~";break;case 117:T.key=p?h.C0.ESC+"[17;"+(p+1)+"~":h.C0.ESC+"[17~";break;case 118:T.key=p?h.C0.ESC+"[18;"+(p+1)+"~":h.C0.ESC+"[18~";break;case 119:T.key=p?h.C0.ESC+"[19;"+(p+1)+"~":h.C0.ESC+"[19~";break;case 120:T.key=p?h.C0.ESC+"[20;"+(p+1)+"~":h.C0.ESC+"[20~";break;case 121:T.key=p?h.C0.ESC+"[21;"+(p+1)+"~":h.C0.ESC+"[21~";break;case 122:T.key=p?h.C0.ESC+"[23;"+(p+1)+"~":h.C0.ESC+"[23~";break;case 123:T.key=p?h.C0.ESC+"[24;"+(p+1)+"~":h.C0.ESC+"[24~";break;default:if(!g.ctrlKey||g.shiftKey||g.altKey||g.metaKey)if(E&&!A||!g.altKey||g.metaKey)!E||g.altKey||g.ctrlKey||g.shiftKey||!g.metaKey?g.key&&!g.ctrlKey&&!g.altKey&&!g.metaKey&&g.keyCode>=48&&g.key.length===1?T.key=g.key:g.key&&g.ctrlKey&&(g.key==="_"&&(T.key=h.C0.US),g.key==="@"&&(T.key=h.C0.NUL)):g.keyCode===65&&(T.type=1);else{const v=y[g.keyCode],d=v?.[g.shiftKey?1:0];if(d)T.key=h.C0.ESC+d;else if(g.keyCode>=65&&g.keyCode<=90){const b=g.ctrlKey?g.keyCode-64:g.keyCode+32;let x=String.fromCharCode(b);g.shiftKey&&(x=x.toUpperCase()),T.key=h.C0.ESC+x}else if(g.keyCode===32)T.key=h.C0.ESC+(g.ctrlKey?h.C0.NUL:" ");else if(g.key==="Dead"&&g.code.startsWith("Key")){let b=g.code.slice(3,4);g.shiftKey||(b=b.toLowerCase()),T.key=h.C0.ESC+b,T.cancel=!0}}else g.keyCode>=65&&g.keyCode<=90?T.key=String.fromCharCode(g.keyCode-64):g.keyCode===32?T.key=h.C0.NUL:g.keyCode>=51&&g.keyCode<=55?T.key=String.fromCharCode(g.keyCode-51+27):g.keyCode===56?T.key=h.C0.DEL:g.keyCode===219?T.key=h.C0.ESC:g.keyCode===220?T.key=h.C0.FS:g.keyCode===221&&(T.key=h.C0.GS)}return T}},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,y=u.length){let g="";for(let C=h;C<y;++C){let E=u[C];E>65535?(E-=65536,g+=String.fromCharCode(55296+(E>>10))+String.fromCharCode(E%1024+56320)):g+=String.fromCharCode(E)}return g},c.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(u,h){const y=u.length;if(!y)return 0;let g=0,C=0;if(this._interim){const E=u.charCodeAt(C++);56320<=E&&E<=57343?h[g++]=1024*(this._interim-55296)+E-56320+65536:(h[g++]=this._interim,h[g++]=E),this._interim=0}for(let E=C;E<y;++E){const A=u.charCodeAt(E);if(55296<=A&&A<=56319){if(++E>=y)return this._interim=A,g;const T=u.charCodeAt(E);56320<=T&&T<=57343?h[g++]=1024*(A-55296)+T-56320+65536:(h[g++]=A,h[g++]=T)}else A!==65279&&(h[g++]=A)}return g}},c.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(u,h){const y=u.length;if(!y)return 0;let g,C,E,A,T=0,p=0,v=0;if(this.interim[0]){let x=!1,L=this.interim[0];L&=(224&L)==192?31:(240&L)==224?15:7;let R,M=0;for(;(R=63&this.interim[++M])&&M<4;)L<<=6,L|=R;const k=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,O=k-M;for(;v<O;){if(v>=y)return 0;if(R=u[v++],(192&R)!=128){v--,x=!0;break}this.interim[M++]=R,L<<=6,L|=63&R}x||(k===2?L<128?v--:h[T++]=L:k===3?L<2048||L>=55296&&L<=57343||L===65279||(h[T++]=L):L<65536||L>1114111||(h[T++]=L)),this.interim.fill(0)}const d=y-4;let b=v;for(;b<y;){for(;!(!(b<d)||128&(g=u[b])||128&(C=u[b+1])||128&(E=u[b+2])||128&(A=u[b+3]));)h[T++]=g,h[T++]=C,h[T++]=E,h[T++]=A,b+=4;if(g=u[b++],g<128)h[T++]=g;else if((224&g)==192){if(b>=y)return this.interim[0]=g,T;if(C=u[b++],(192&C)!=128){b--;continue}if(p=(31&g)<<6|63&C,p<128){b--;continue}h[T++]=p}else if((240&g)==224){if(b>=y)return this.interim[0]=g,T;if(C=u[b++],(192&C)!=128){b--;continue}if(b>=y)return this.interim[0]=g,this.interim[1]=C,T;if(E=u[b++],(192&E)!=128){b--;continue}if(p=(15&g)<<12|(63&C)<<6|63&E,p<2048||p>=55296&&p<=57343||p===65279)continue;h[T++]=p}else if((248&g)==240){if(b>=y)return this.interim[0]=g,T;if(C=u[b++],(192&C)!=128){b--;continue}if(b>=y)return this.interim[0]=g,this.interim[1]=C,T;if(E=u[b++],(192&E)!=128){b--;continue}if(b>=y)return this.interim[0]=g,this.interim[1]=C,this.interim[2]=E,T;if(A=u[b++],(192&A)!=128){b--;continue}if(p=(7&g)<<18|(63&C)<<12|(63&E)<<6|63&A,p<65536||p>1114111)continue;h[T++]=p}}return T}}},225:(m,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.UnicodeV6=void 0;const h=u(1480),y=[[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]],g=[[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 E=0;E<y.length;++E)C.fill(0,y[E][0],y[E][1]+1)}}wcwidth(E){return E<32?0:E<127?1:E<65536?C[E]:(function(A,T){let p,v=0,d=T.length-1;if(A<T[0][0]||A>T[d][1])return!1;for(;d>=v;)if(p=v+d>>1,A>T[p][1])v=p+1;else{if(!(A<T[p][0]))return!0;d=p-1}return!1})(E,g)?0:E>=131072&&E<=196605||E>=196608&&E<=262141?2:1}charProperties(E,A){let T=this.wcwidth(E),p=T===0&&A!==0;if(p){const v=h.UnicodeService.extractWidth(A);v===0?p=!1:v>T&&(T=v)}return h.UnicodeService.createPropertyValue(0,T,p)}}},5981:(m,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.WriteBuffer=void 0;const h=u(8460),y=u(844);class g extends y.Disposable{constructor(E){super(),this._action=E,this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=0,this._isSyncWriting=!1,this._syncCalls=0,this._didUserInput=!1,this._onWriteParsed=this.register(new h.EventEmitter),this.onWriteParsed=this._onWriteParsed.event}handleUserInput(){this._didUserInput=!0}writeSync(E,A){if(A!==void 0&&this._syncCalls>A)return void(this._syncCalls=0);if(this._pendingData+=E.length,this._writeBuffer.push(E),this._callbacks.push(void 0),this._syncCalls++,this._isSyncWriting)return;let T;for(this._isSyncWriting=!0;T=this._writeBuffer.shift();){this._action(T);const p=this._callbacks.shift();p&&p()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(E,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+=E.length,this._writeBuffer.push(E),this._callbacks.push(A),void this._innerWrite();setTimeout((()=>this._innerWrite()))}this._pendingData+=E.length,this._writeBuffer.push(E),this._callbacks.push(A)}_innerWrite(E=0,A=!0){const T=E||Date.now();for(;this._writeBuffer.length>this._bufferOffset;){const p=this._writeBuffer[this._bufferOffset],v=this._action(p,A);if(v){const b=x=>Date.now()-T>=12?setTimeout((()=>this._innerWrite(0,x))):this._innerWrite(T,x);return void v.catch((x=>(queueMicrotask((()=>{throw x})),Promise.resolve(!1)))).then(b)}const d=this._callbacks[this._bufferOffset];if(d&&d(),this._bufferOffset++,this._pendingData-=p.length,Date.now()-T>=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=g},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 y(g,C){const E=g.toString(16),A=E.length<2?"0"+E:E;switch(C){case 4:return E[0];case 8:return A;case 12:return(A+A).slice(0,3);default:return A+A}}c.parseColor=function(g){if(!g)return;let C=g.toLowerCase();if(C.indexOf("rgb:")===0){C=C.slice(4);const E=u.exec(C);if(E){const A=E[1]?15:E[4]?255:E[7]?4095:65535;return[Math.round(parseInt(E[1]||E[4]||E[7]||E[10],16)/A*255),Math.round(parseInt(E[2]||E[5]||E[8]||E[11],16)/A*255),Math.round(parseInt(E[3]||E[6]||E[9]||E[12],16)/A*255)]}}else if(C.indexOf("#")===0&&(C=C.slice(1),h.exec(C)&&[3,6,9,12].includes(C.length))){const E=C.length/3,A=[0,0,0];for(let T=0;T<3;++T){const p=parseInt(C.slice(E*T,E*T+E),16);A[T]=E===1?p<<4:E===2?p:E===3?p>>4:p>>8}return A}},c.toRgbString=function(g,C=16){const[E,A,T]=g;return`rgb:${y(E,C)}/${y(A,C)}/${y(T,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),y=u(8742),g=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,T){this._handlers[A]===void 0&&(this._handlers[A]=[]);const p=this._handlers[A];return p.push(T),{dispose:()=>{const v=p.indexOf(T);v!==-1&&p.splice(v,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,T){if(this.reset(),this._ident=A,this._active=this._handlers[A]||C,this._active.length)for(let p=this._active.length-1;p>=0;p--)this._active[p].hook(T);else this._handlerFb(this._ident,"HOOK",T)}put(A,T,p){if(this._active.length)for(let v=this._active.length-1;v>=0;v--)this._active[v].put(A,T,p);else this._handlerFb(this._ident,"PUT",(0,h.utf32ToString)(A,T,p))}unhook(A,T=!0){if(this._active.length){let p=!1,v=this._active.length-1,d=!1;if(this._stack.paused&&(v=this._stack.loopPosition-1,p=T,d=this._stack.fallThrough,this._stack.paused=!1),!d&&p===!1){for(;v>=0&&(p=this._active[v].unhook(A),p!==!0);v--)if(p instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=v,this._stack.fallThrough=!1,p;v--}for(;v>=0;v--)if(p=this._active[v].unhook(!1),p instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=v,this._stack.fallThrough=!0,p}else this._handlerFb(this._ident,"UNHOOK",A);this._active=C,this._ident=0}};const E=new y.Params;E.addParam(0),c.DcsHandler=class{constructor(A){this._handler=A,this._data="",this._params=E,this._hitLimit=!1}hook(A){this._params=A.length>1||A.params[0]?A.clone():E,this._data="",this._hitLimit=!1}put(A,T,p){this._hitLimit||(this._data+=(0,h.utf32ToString)(A,T,p),this._data.length>g.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}unhook(A){let T=!1;if(this._hitLimit)T=!1;else if(A&&(T=this._handler(this._data,this._params),T instanceof Promise))return T.then((p=>(this._params=E,this._data="",this._hitLimit=!1,p)));return this._params=E,this._data="",this._hitLimit=!1,T}}},2015:(m,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.EscapeSequenceParser=c.VT500_TRANSITION_TABLE=c.TransitionTable=void 0;const h=u(844),y=u(8742),g=u(6242),C=u(6351);class E{constructor(v){this.table=new Uint8Array(v)}setDefault(v,d){this.table.fill(v<<4|d)}add(v,d,b,x){this.table[d<<8|v]=b<<4|x}addMany(v,d,b,x){for(let L=0;L<v.length;L++)this.table[d<<8|v[L]]=b<<4|x}}c.TransitionTable=E;const A=160;c.VT500_TRANSITION_TABLE=(function(){const p=new E(4095),v=Array.apply(null,Array(256)).map(((M,k)=>k)),d=(M,k)=>v.slice(M,k),b=d(32,127),x=d(0,24);x.push(25),x.push.apply(x,d(28,32));const L=d(0,14);let R;for(R in p.setDefault(1,0),p.addMany(b,0,2,0),L)p.addMany([24,26,153,154],R,3,0),p.addMany(d(128,144),R,3,0),p.addMany(d(144,152),R,3,0),p.add(156,R,0,0),p.add(27,R,11,1),p.add(157,R,4,8),p.addMany([152,158,159],R,0,7),p.add(155,R,11,3),p.add(144,R,11,9);return p.addMany(x,0,3,0),p.addMany(x,1,3,1),p.add(127,1,0,1),p.addMany(x,8,0,8),p.addMany(x,3,3,3),p.add(127,3,0,3),p.addMany(x,4,3,4),p.add(127,4,0,4),p.addMany(x,6,3,6),p.addMany(x,5,3,5),p.add(127,5,0,5),p.addMany(x,2,3,2),p.add(127,2,0,2),p.add(93,1,4,8),p.addMany(b,8,5,8),p.add(127,8,5,8),p.addMany([156,27,24,26,7],8,6,0),p.addMany(d(28,32),8,0,8),p.addMany([88,94,95],1,0,7),p.addMany(b,7,0,7),p.addMany(x,7,0,7),p.add(156,7,0,0),p.add(127,7,0,7),p.add(91,1,11,3),p.addMany(d(64,127),3,7,0),p.addMany(d(48,60),3,8,4),p.addMany([60,61,62,63],3,9,4),p.addMany(d(48,60),4,8,4),p.addMany(d(64,127),4,7,0),p.addMany([60,61,62,63],4,0,6),p.addMany(d(32,64),6,0,6),p.add(127,6,0,6),p.addMany(d(64,127),6,0,0),p.addMany(d(32,48),3,9,5),p.addMany(d(32,48),5,9,5),p.addMany(d(48,64),5,0,6),p.addMany(d(64,127),5,7,0),p.addMany(d(32,48),4,9,5),p.addMany(d(32,48),1,9,2),p.addMany(d(32,48),2,9,2),p.addMany(d(48,127),2,10,0),p.addMany(d(48,80),1,10,0),p.addMany(d(81,88),1,10,0),p.addMany([89,90,92],1,10,0),p.addMany(d(96,127),1,10,0),p.add(80,1,11,9),p.addMany(x,9,0,9),p.add(127,9,0,9),p.addMany(d(28,32),9,0,9),p.addMany(d(32,48),9,9,12),p.addMany(d(48,60),9,8,10),p.addMany([60,61,62,63],9,9,10),p.addMany(x,11,0,11),p.addMany(d(32,128),11,0,11),p.addMany(d(28,32),11,0,11),p.addMany(x,10,0,10),p.add(127,10,0,10),p.addMany(d(28,32),10,0,10),p.addMany(d(48,60),10,8,10),p.addMany([60,61,62,63],10,0,11),p.addMany(d(32,48),10,9,12),p.addMany(x,12,0,12),p.add(127,12,0,12),p.addMany(d(28,32),12,0,12),p.addMany(d(32,48),12,9,12),p.addMany(d(48,64),12,0,11),p.addMany(d(64,127),12,12,13),p.addMany(d(64,127),10,12,13),p.addMany(d(64,127),9,12,13),p.addMany(x,13,13,13),p.addMany(b,13,13,13),p.add(127,13,0,13),p.addMany([27,156,24,26],13,14,0),p.add(A,0,2,0),p.add(A,8,5,8),p.add(A,6,0,6),p.add(A,11,0,11),p.add(A,13,13,13),p})();class T extends h.Disposable{constructor(v=c.VT500_TRANSITION_TABLE){super(),this._transitions=v,this._parseStack={state:0,handlers:[],handlerPos:0,transition:0,chunkPos:0},this.initialState=0,this.currentState=this.initialState,this._params=new y.Params,this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._printHandlerFb=(d,b,x)=>{},this._executeHandlerFb=d=>{},this._csiHandlerFb=(d,b)=>{},this._escHandlerFb=d=>{},this._errorHandlerFb=d=>d,this._printHandler=this._printHandlerFb,this._executeHandlers=Object.create(null),this._csiHandlers=Object.create(null),this._escHandlers=Object.create(null),this.register((0,h.toDisposable)((()=>{this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null)}))),this._oscParser=this.register(new g.OscParser),this._dcsParser=this.register(new C.DcsParser),this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:"\\"},(()=>!0))}_identifier(v,d=[64,126]){let b=0;if(v.prefix){if(v.prefix.length>1)throw new Error("only one byte as prefix supported");if(b=v.prefix.charCodeAt(0),b&&60>b||b>63)throw new Error("prefix must be in range 0x3c .. 0x3f")}if(v.intermediates){if(v.intermediates.length>2)throw new Error("only two bytes as intermediates are supported");for(let L=0;L<v.intermediates.length;++L){const R=v.intermediates.charCodeAt(L);if(32>R||R>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");b<<=8,b|=R}}if(v.final.length!==1)throw new Error("final must be a single byte");const x=v.final.charCodeAt(0);if(d[0]>x||x>d[1])throw new Error(`final must be in range ${d[0]} .. ${d[1]}`);return b<<=8,b|=x,b}identToString(v){const d=[];for(;v;)d.push(String.fromCharCode(255&v)),v>>=8;return d.reverse().join("")}setPrintHandler(v){this._printHandler=v}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(v,d){const b=this._identifier(v,[48,126]);this._escHandlers[b]===void 0&&(this._escHandlers[b]=[]);const x=this._escHandlers[b];return x.push(d),{dispose:()=>{const L=x.indexOf(d);L!==-1&&x.splice(L,1)}}}clearEscHandler(v){this._escHandlers[this._identifier(v,[48,126])]&&delete this._escHandlers[this._identifier(v,[48,126])]}setEscHandlerFallback(v){this._escHandlerFb=v}setExecuteHandler(v,d){this._executeHandlers[v.charCodeAt(0)]=d}clearExecuteHandler(v){this._executeHandlers[v.charCodeAt(0)]&&delete this._executeHandlers[v.charCodeAt(0)]}setExecuteHandlerFallback(v){this._executeHandlerFb=v}registerCsiHandler(v,d){const b=this._identifier(v);this._csiHandlers[b]===void 0&&(this._csiHandlers[b]=[]);const x=this._csiHandlers[b];return x.push(d),{dispose:()=>{const L=x.indexOf(d);L!==-1&&x.splice(L,1)}}}clearCsiHandler(v){this._csiHandlers[this._identifier(v)]&&delete this._csiHandlers[this._identifier(v)]}setCsiHandlerFallback(v){this._csiHandlerFb=v}registerDcsHandler(v,d){return this._dcsParser.registerHandler(this._identifier(v),d)}clearDcsHandler(v){this._dcsParser.clearHandler(this._identifier(v))}setDcsHandlerFallback(v){this._dcsParser.setHandlerFallback(v)}registerOscHandler(v,d){return this._oscParser.registerHandler(v,d)}clearOscHandler(v){this._oscParser.clearHandler(v)}setOscHandlerFallback(v){this._oscParser.setHandlerFallback(v)}setErrorHandler(v){this._errorHandler=v}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(v,d,b,x,L){this._parseStack.state=v,this._parseStack.handlers=d,this._parseStack.handlerPos=b,this._parseStack.transition=x,this._parseStack.chunkPos=L}parse(v,d,b){let x,L=0,R=0,M=0;if(this._parseStack.state)if(this._parseStack.state===2)this._parseStack.state=0,M=this._parseStack.chunkPos+1;else{if(b===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 O=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(b===!1&&O>-1){for(;O>=0&&(x=k[O](this._params),x!==!0);O--)if(x instanceof Promise)return this._parseStack.handlerPos=O,x}this._parseStack.handlers=[];break;case 4:if(b===!1&&O>-1){for(;O>=0&&(x=k[O](),x!==!0);O--)if(x instanceof Promise)return this._parseStack.handlerPos=O,x}this._parseStack.handlers=[];break;case 6:if(L=v[this._parseStack.chunkPos],x=this._dcsParser.unhook(L!==24&&L!==26,b),x)return x;L===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(L=v[this._parseStack.chunkPos],x=this._oscParser.end(L!==24&&L!==26,b),x)return x;L===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0}this._parseStack.state=0,M=this._parseStack.chunkPos+1,this.precedingJoinState=0,this.currentState=15&this._parseStack.transition}for(let k=M;k<d;++k){switch(L=v[k],R=this._transitions.table[this.currentState<<8|(L<160?L:A)],R>>4){case 2:for(let I=k+1;;++I){if(I>=d||(L=v[I])<32||L>126&&L<A){this._printHandler(v,k,I),k=I-1;break}if(++I>=d||(L=v[I])<32||L>126&&L<A){this._printHandler(v,k,I),k=I-1;break}if(++I>=d||(L=v[I])<32||L>126&&L<A){this._printHandler(v,k,I),k=I-1;break}if(++I>=d||(L=v[I])<32||L>126&&L<A){this._printHandler(v,k,I),k=I-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 O=this._csiHandlers[this._collect<<8|L];let U=O?O.length-1:-1;for(;U>=0&&(x=O[U](this._params),x!==!0);U--)if(x instanceof Promise)return this._preserveStack(3,O,U,R,k),x;U<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<d&&(L=v[k])>47&&L<60);k--;break;case 9:this._collect<<=8,this._collect|=L;break;case 10:const F=this._escHandlers[this._collect<<8|L];let G=F?F.length-1:-1;for(;G>=0&&(x=F[G](),x!==!0);G--)if(x instanceof Promise)return this._preserveStack(4,F,G,R,k),x;G<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 I=k+1;;++I)if(I>=d||(L=v[I])===24||L===26||L===27||L>127&&L<A){this._dcsParser.put(v,k,I),k=I-1;break}break;case 14:if(x=this._dcsParser.unhook(L!==24&&L!==26),x)return this._preserveStack(6,[],0,R,k),x;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 I=k+1;;I++)if(I>=d||(L=v[I])<32||L>127&&L<A){this._oscParser.put(v,k,I),k=I-1;break}break;case 6:if(x=this._oscParser.end(L!==24&&L!==26),x)return this._preserveStack(5,[],0,R,k),x;L===27&&(R|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0}this.currentState=15&R}}}c.EscapeSequenceParser=T},6242:(m,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.OscHandler=c.OscParser=void 0;const h=u(5770),y=u(482),g=[];c.OscParser=class{constructor(){this._state=0,this._active=g,this._id=-1,this._handlers=Object.create(null),this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}registerHandler(C,E){this._handlers[C]===void 0&&(this._handlers[C]=[]);const A=this._handlers[C];return A.push(E),{dispose:()=>{const T=A.indexOf(E);T!==-1&&A.splice(T,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=g}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=g,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||g,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,E,A){if(this._active.length)for(let T=this._active.length-1;T>=0;T--)this._active[T].put(C,E,A);else this._handlerFb(this._id,"PUT",(0,y.utf32ToString)(C,E,A))}start(){this.reset(),this._state=1}put(C,E,A){if(this._state!==3){if(this._state===1)for(;E<A;){const T=C[E++];if(T===59){this._state=2,this._start();break}if(T<48||57<T)return void(this._state=3);this._id===-1&&(this._id=0),this._id=10*this._id+T-48}this._state===2&&A-E>0&&this._put(C,E,A)}}end(C,E=!0){if(this._state!==0){if(this._state!==3)if(this._state===1&&this._start(),this._active.length){let A=!1,T=this._active.length-1,p=!1;if(this._stack.paused&&(T=this._stack.loopPosition-1,A=E,p=this._stack.fallThrough,this._stack.paused=!1),!p&&A===!1){for(;T>=0&&(A=this._active[T].end(C),A!==!0);T--)if(A instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=T,this._stack.fallThrough=!1,A;T--}for(;T>=0;T--)if(A=this._active[T].end(!1),A instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=T,this._stack.fallThrough=!0,A}else this._handlerFb(this._id,"END",C);this._active=g,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,E,A){this._hitLimit||(this._data+=(0,y.utf32ToString)(C,E,A),this._data.length>h.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}end(C){let E=!1;if(this._hitLimit)E=!1;else if(C&&(E=this._handler(this._data),E instanceof Promise))return E.then((A=>(this._data="",this._hitLimit=!1,A)));return this._data="",this._hitLimit=!1,E}}},8742:(m,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.Params=void 0;const u=2147483647;class h{static fromArray(g){const C=new h;if(!g.length)return C;for(let E=Array.isArray(g[0])?1:0;E<g.length;++E){const A=g[E];if(Array.isArray(A))for(let T=0;T<A.length;++T)C.addSubParam(A[T]);else C.addParam(A)}return C}constructor(g=32,C=32){if(this.maxLength=g,this.maxSubParamsLength=C,C>256)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(g),this.length=0,this._subParams=new Int32Array(C),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(g),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}clone(){const g=new h(this.maxLength,this.maxSubParamsLength);return g.params.set(this.params),g.length=this.length,g._subParams.set(this._subParams),g._subParamsLength=this._subParamsLength,g._subParamsIdx.set(this._subParamsIdx),g._rejectDigits=this._rejectDigits,g._rejectSubDigits=this._rejectSubDigits,g._digitIsSub=this._digitIsSub,g}toArray(){const g=[];for(let C=0;C<this.length;++C){g.push(this.params[C]);const E=this._subParamsIdx[C]>>8,A=255&this._subParamsIdx[C];A-E>0&&g.push(Array.prototype.slice.call(this._subParams,E,A))}return g}reset(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}addParam(g){if(this._digitIsSub=!1,this.length>=this.maxLength)this._rejectDigits=!0;else{if(g<-1)throw new Error("values lesser than -1 are not allowed");this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=g>u?u:g}}addSubParam(g){if(this._digitIsSub=!0,this.length)if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength)this._rejectSubDigits=!0;else{if(g<-1)throw new Error("values lesser than -1 are not allowed");this._subParams[this._subParamsLength++]=g>u?u:g,this._subParamsIdx[this.length-1]++}}hasSubParams(g){return(255&this._subParamsIdx[g])-(this._subParamsIdx[g]>>8)>0}getSubParams(g){const C=this._subParamsIdx[g]>>8,E=255&this._subParamsIdx[g];return E-C>0?this._subParams.subarray(C,E):null}getSubParamsAll(){const g={};for(let C=0;C<this.length;++C){const E=this._subParamsIdx[C]>>8,A=255&this._subParamsIdx[C];A-E>0&&(g[C]=this._subParams.slice(E,A))}return g}addDigit(g){let C;if(this._rejectDigits||!(C=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;const E=this._digitIsSub?this._subParams:this.params,A=E[C-1];E[C-1]=~A?Math.min(10*A+g,u):g}}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 y={instance:h,dispose:h.dispose,isDisposed:!1};this._addons.push(y),h.dispose=()=>this._wrappedAddonDispose(y),h.activate(u)}_wrappedAddonDispose(u){if(u.isDisposed)return;let h=-1;for(let y=0;y<this._addons.length;y++)if(this._addons[y]===u){h=y;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),y=u(511);c.BufferApiView=class{constructor(g,C){this._buffer=g,this.type=C}init(g){return this._buffer=g,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(g){const C=this._buffer.lines.get(g);if(C)return new h.BufferLineApiView(C)}getNullCell(){return new y.CellData}}},3785:(m,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.BufferLineApiView=void 0;const h=u(511);c.BufferLineApiView=class{constructor(y){this._line=y}get isWrapped(){return this._line.isWrapped}get length(){return this._line.length}getCell(y,g){if(!(y<0||y>=this._line.length))return g?(this._line.loadCell(y,g),g):this._line.loadCell(y,new h.CellData)}translateToString(y,g,C){return this._line.translateToString(y,g,C)}}},8285:(m,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.BufferNamespaceApi=void 0;const h=u(8771),y=u(8460),g=u(844);class C extends g.Disposable{constructor(A){super(),this._core=A,this._onBufferChange=this.register(new y.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,(y=>h(y.toArray())))}addCsiHandler(u,h){return this.registerCsiHandler(u,h)}registerDcsHandler(u,h){return this._core.registerDcsHandler(u,((y,g)=>h(y,g.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(p,v,d,b){var x,L=arguments.length,R=L<3?v:b===null?b=Object.getOwnPropertyDescriptor(v,d):b;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")R=Reflect.decorate(p,v,d,b);else for(var M=p.length-1;M>=0;M--)(x=p[M])&&(R=(L<3?x(R):L>3?x(v,d,R):x(v,d))||R);return L>3&&R&&Object.defineProperty(v,d,R),R},y=this&&this.__param||function(p,v){return function(d,b){v(d,b,p)}};Object.defineProperty(c,"__esModule",{value:!0}),c.BufferService=c.MINIMUM_ROWS=c.MINIMUM_COLS=void 0;const g=u(8460),C=u(844),E=u(5295),A=u(2585);c.MINIMUM_COLS=2,c.MINIMUM_ROWS=1;let T=c.BufferService=class extends C.Disposable{get buffer(){return this.buffers.active}constructor(p){super(),this.isUserScrolling=!1,this._onResize=this.register(new g.EventEmitter),this.onResize=this._onResize.event,this._onScroll=this.register(new g.EventEmitter),this.onScroll=this._onScroll.event,this.cols=Math.max(p.rawOptions.cols||0,c.MINIMUM_COLS),this.rows=Math.max(p.rawOptions.rows||0,c.MINIMUM_ROWS),this.buffers=this.register(new E.BufferSet(p,this))}resize(p,v){this.cols=p,this.rows=v,this.buffers.resize(p,v),this._onResize.fire({cols:p,rows:v})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(p,v=!1){const d=this.buffer;let b;b=this._cachedBlankLine,b&&b.length===this.cols&&b.getFg(0)===p.fg&&b.getBg(0)===p.bg||(b=d.getBlankLine(p,v),this._cachedBlankLine=b),b.isWrapped=v;const x=d.ybase+d.scrollTop,L=d.ybase+d.scrollBottom;if(d.scrollTop===0){const R=d.lines.isFull;L===d.lines.length-1?R?d.lines.recycle().copyFrom(b):d.lines.push(b.clone()):d.lines.splice(L+1,0,b.clone()),R?this.isUserScrolling&&(d.ydisp=Math.max(d.ydisp-1,0)):(d.ybase++,this.isUserScrolling||d.ydisp++)}else{const R=L-x+1;d.lines.shiftElements(x+1,R-1,-1),d.lines.set(L,b.clone())}this.isUserScrolling||(d.ydisp=d.ybase),this._onScroll.fire(d.ydisp)}scrollLines(p,v,d){const b=this.buffer;if(p<0){if(b.ydisp===0)return;this.isUserScrolling=!0}else p+b.ydisp>=b.ybase&&(this.isUserScrolling=!1);const x=b.ydisp;b.ydisp=Math.max(Math.min(b.ydisp+p,b.ybase),0),x!==b.ydisp&&(v||this._onScroll.fire(b.ydisp))}};c.BufferService=T=h([y(0,A.IOptionsService)],T)},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(b,x,L,R){var M,k=arguments.length,O=k<3?x:R===null?R=Object.getOwnPropertyDescriptor(x,L):R;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")O=Reflect.decorate(b,x,L,R);else for(var U=b.length-1;U>=0;U--)(M=b[U])&&(O=(k<3?M(O):k>3?M(x,L,O):M(x,L))||O);return k>3&&O&&Object.defineProperty(x,L,O),O},y=this&&this.__param||function(b,x){return function(L,R){x(L,R,b)}};Object.defineProperty(c,"__esModule",{value:!0}),c.CoreMouseService=void 0;const g=u(2585),C=u(8460),E=u(844),A={NONE:{events:0,restrict:()=>!1},X10:{events:1,restrict:b=>b.button!==4&&b.action===1&&(b.ctrl=!1,b.alt=!1,b.shift=!1,!0)},VT200:{events:19,restrict:b=>b.action!==32},DRAG:{events:23,restrict:b=>b.action!==32||b.button!==3},ANY:{events:31,restrict:b=>!0}};function T(b,x){let L=(b.ctrl?16:0)|(b.shift?4:0)|(b.alt?8:0);return b.button===4?(L|=64,L|=b.action):(L|=3&b.button,4&b.button&&(L|=64),8&b.button&&(L|=128),b.action===32?L|=32:b.action!==0||x||(L|=3)),L}const p=String.fromCharCode,v={DEFAULT:b=>{const x=[T(b,!1)+32,b.col+32,b.row+32];return x[0]>255||x[1]>255||x[2]>255?"":`\x1B[M${p(x[0])}${p(x[1])}${p(x[2])}`},SGR:b=>{const x=b.action===0&&b.button!==4?"m":"M";return`\x1B[<${T(b,!0)};${b.col};${b.row}${x}`},SGR_PIXELS:b=>{const x=b.action===0&&b.button!==4?"m":"M";return`\x1B[<${T(b,!0)};${b.x};${b.y}${x}`}};let d=c.CoreMouseService=class extends E.Disposable{constructor(b,x){super(),this._bufferService=b,this._coreService=x,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(v))this.addEncoding(L,v[L]);this.reset()}addProtocol(b,x){this._protocols[b]=x}addEncoding(b,x){this._encodings[b]=x}get activeProtocol(){return this._activeProtocol}get areMouseEventsActive(){return this._protocols[this._activeProtocol].events!==0}set activeProtocol(b){if(!this._protocols[b])throw new Error(`unknown protocol "${b}"`);this._activeProtocol=b,this._onProtocolChange.fire(this._protocols[b].events)}get activeEncoding(){return this._activeEncoding}set activeEncoding(b){if(!this._encodings[b])throw new Error(`unknown encoding "${b}"`);this._activeEncoding=b}reset(){this.activeProtocol="NONE",this.activeEncoding="DEFAULT",this._lastEvent=null}triggerMouseEvent(b){if(b.col<0||b.col>=this._bufferService.cols||b.row<0||b.row>=this._bufferService.rows||b.button===4&&b.action===32||b.button===3&&b.action!==32||b.button!==4&&(b.action===2||b.action===3)||(b.col++,b.row++,b.action===32&&this._lastEvent&&this._equalEvents(this._lastEvent,b,this._activeEncoding==="SGR_PIXELS"))||!this._protocols[this._activeProtocol].restrict(b))return!1;const x=this._encodings[this._activeEncoding](b);return x&&(this._activeEncoding==="DEFAULT"?this._coreService.triggerBinaryEvent(x):this._coreService.triggerDataEvent(x,!0)),this._lastEvent=b,!0}explainEvents(b){return{down:!!(1&b),up:!!(2&b),drag:!!(4&b),move:!!(8&b),wheel:!!(16&b)}}_equalEvents(b,x,L){if(L){if(b.x!==x.x||b.y!==x.y)return!1}else if(b.col!==x.col||b.row!==x.row)return!1;return b.button===x.button&&b.action===x.action&&b.ctrl===x.ctrl&&b.alt===x.alt&&b.shift===x.shift}};c.CoreMouseService=d=h([y(0,g.IBufferService),y(1,g.ICoreService)],d)},6975:function(m,c,u){var h=this&&this.__decorate||function(d,b,x,L){var R,M=arguments.length,k=M<3?b:L===null?L=Object.getOwnPropertyDescriptor(b,x):L;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")k=Reflect.decorate(d,b,x,L);else for(var O=d.length-1;O>=0;O--)(R=d[O])&&(k=(M<3?R(k):M>3?R(b,x,k):R(b,x))||k);return M>3&&k&&Object.defineProperty(b,x,k),k},y=this&&this.__param||function(d,b){return function(x,L){b(x,L,d)}};Object.defineProperty(c,"__esModule",{value:!0}),c.CoreService=void 0;const g=u(1439),C=u(8460),E=u(844),A=u(2585),T=Object.freeze({insertMode:!1}),p=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,origin:!1,reverseWraparound:!1,sendFocus:!1,wraparound:!0});let v=c.CoreService=class extends E.Disposable{constructor(d,b,x){super(),this._bufferService=d,this._logService=b,this._optionsService=x,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,g.clone)(T),this.decPrivateModes=(0,g.clone)(p)}reset(){this.modes=(0,g.clone)(T),this.decPrivateModes=(0,g.clone)(p)}triggerDataEvent(d,b=!1){if(this._optionsService.rawOptions.disableStdin)return;const x=this._bufferService.buffer;b&&this._optionsService.rawOptions.scrollOnUserInput&&x.ybase!==x.ydisp&&this._onRequestScrollToBottom.fire(),b&&this._onUserInput.fire(),this._logService.debug(`sending data "${d}"`,(()=>d.split("").map((L=>L.charCodeAt(0))))),this._onData.fire(d)}triggerBinaryEvent(d){this._optionsService.rawOptions.disableStdin||(this._logService.debug(`sending binary "${d}"`,(()=>d.split("").map((b=>b.charCodeAt(0))))),this._onBinary.fire(d))}};c.CoreService=v=h([y(0,A.IBufferService),y(1,A.ILogService),y(2,A.IOptionsService)],v)},9074:(m,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.DecorationService=void 0;const h=u(8055),y=u(8460),g=u(844),C=u(6106);let E=0,A=0;class T extends g.Disposable{get decorations(){return this._decorations.values()}constructor(){super(),this._decorations=new C.SortedList((d=>d?.marker.line)),this._onDecorationRegistered=this.register(new y.EventEmitter),this.onDecorationRegistered=this._onDecorationRegistered.event,this._onDecorationRemoved=this.register(new y.EventEmitter),this.onDecorationRemoved=this._onDecorationRemoved.event,this.register((0,g.toDisposable)((()=>this.reset())))}registerDecoration(d){if(d.marker.isDisposed)return;const b=new p(d);if(b){const x=b.marker.onDispose((()=>b.dispose()));b.onDispose((()=>{b&&(this._decorations.delete(b)&&this._onDecorationRemoved.fire(b),x.dispose())})),this._decorations.insert(b),this._onDecorationRegistered.fire(b)}return b}reset(){for(const d of this._decorations.values())d.dispose();this._decorations.clear()}*getDecorationsAtCell(d,b,x){let L=0,R=0;for(const M of this._decorations.getKeyIterator(b))L=M.options.x??0,R=L+(M.options.width??1),d>=L&&d<R&&(!x||(M.options.layer??"bottom")===x)&&(yield M)}forEachDecorationAtCell(d,b,x,L){this._decorations.forEachByKey(b,(R=>{E=R.options.x??0,A=E+(R.options.width??1),d>=E&&d<A&&(!x||(R.options.layer??"bottom")===x)&&L(R)}))}}c.DecorationService=T;class p extends g.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(d){super(),this.options=d,this.onRenderEmitter=this.register(new y.EventEmitter),this.onRender=this.onRenderEmitter.event,this._onDispose=this.register(new y.EventEmitter),this.onDispose=this._onDispose.event,this._cachedBg=null,this._cachedFg=null,this.marker=d.marker,this.options.overviewRulerOptions&&!this.options.overviewRulerOptions.position&&(this.options.overviewRulerOptions.position="full")}dispose(){this._onDispose.fire(),super.dispose()}}},4348:(m,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.InstantiationService=c.ServiceCollection=void 0;const h=u(2585),y=u(8343);class g{constructor(...E){this._entries=new Map;for(const[A,T]of E)this.set(A,T)}set(E,A){const T=this._entries.get(E);return this._entries.set(E,A),T}forEach(E){for(const[A,T]of this._entries.entries())E(A,T)}has(E){return this._entries.has(E)}get(E){return this._entries.get(E)}}c.ServiceCollection=g,c.InstantiationService=class{constructor(){this._services=new g,this._services.set(h.IInstantiationService,this)}setService(C,E){this._services.set(C,E)}getService(C){return this._services.get(C)}createInstance(C,...E){const A=(0,y.getServiceDependencies)(C).sort(((v,d)=>v.index-d.index)),T=[];for(const v of A){const d=this._services.get(v.id);if(!d)throw new Error(`[createInstance] ${C.name} depends on UNKNOWN service ${v.id}.`);T.push(d)}const p=A.length>0?A[0].index:E.length;if(E.length!==p)throw new Error(`[createInstance] First service dependency of ${C.name} at position ${p+1} conflicts with ${E.length} static arguments`);return new C(...E,...T)}}},7866:function(m,c,u){var h=this&&this.__decorate||function(p,v,d,b){var x,L=arguments.length,R=L<3?v:b===null?b=Object.getOwnPropertyDescriptor(v,d):b;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")R=Reflect.decorate(p,v,d,b);else for(var M=p.length-1;M>=0;M--)(x=p[M])&&(R=(L<3?x(R):L>3?x(v,d,R):x(v,d))||R);return L>3&&R&&Object.defineProperty(v,d,R),R},y=this&&this.__param||function(p,v){return function(d,b){v(d,b,p)}};Object.defineProperty(c,"__esModule",{value:!0}),c.traceCall=c.setTraceLogger=c.LogService=void 0;const g=u(844),C=u(2585),E={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,T=c.LogService=class extends g.Disposable{get logLevel(){return this._logLevel}constructor(p){super(),this._optionsService=p,this._logLevel=C.LogLevelEnum.OFF,this._updateLogLevel(),this.register(this._optionsService.onSpecificOptionChange("logLevel",(()=>this._updateLogLevel()))),A=this}_updateLogLevel(){this._logLevel=E[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(p){for(let v=0;v<p.length;v++)typeof p[v]=="function"&&(p[v]=p[v]())}_log(p,v,d){this._evalLazyOptionalParams(d),p.call(console,(this._optionsService.options.logger?"":"xterm.js: ")+v,...d)}trace(p,...v){this._logLevel<=C.LogLevelEnum.TRACE&&this._log(this._optionsService.options.logger?.trace.bind(this._optionsService.options.logger)??console.log,p,v)}debug(p,...v){this._logLevel<=C.LogLevelEnum.DEBUG&&this._log(this._optionsService.options.logger?.debug.bind(this._optionsService.options.logger)??console.log,p,v)}info(p,...v){this._logLevel<=C.LogLevelEnum.INFO&&this._log(this._optionsService.options.logger?.info.bind(this._optionsService.options.logger)??console.info,p,v)}warn(p,...v){this._logLevel<=C.LogLevelEnum.WARN&&this._log(this._optionsService.options.logger?.warn.bind(this._optionsService.options.logger)??console.warn,p,v)}error(p,...v){this._logLevel<=C.LogLevelEnum.ERROR&&this._log(this._optionsService.options.logger?.error.bind(this._optionsService.options.logger)??console.error,p,v)}};c.LogService=T=h([y(0,C.IOptionsService)],T),c.setTraceLogger=function(p){A=p},c.traceCall=function(p,v,d){if(typeof d.value!="function")throw new Error("not supported");const b=d.value;d.value=function(...x){if(A.logLevel!==C.LogLevelEnum.TRACE)return b.apply(this,x);A.trace(`GlyphRenderer#${b.name}(${x.map((R=>JSON.stringify(R))).join(", ")})`);const L=b.apply(this,x);return A.trace(`GlyphRenderer#${b.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),y=u(844),g=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:g.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 E extends y.Disposable{constructor(T){super(),this._onOptionChange=this.register(new h.EventEmitter),this.onOptionChange=this._onOptionChange.event;const p={...c.DEFAULT_OPTIONS};for(const v in T)if(v in p)try{const d=T[v];p[v]=this._sanitizeAndValidateOption(v,d)}catch(d){console.error(d)}this.rawOptions=p,this.options={...p},this._setupOptions(),this.register((0,y.toDisposable)((()=>{this.rawOptions.linkHandler=null,this.rawOptions.documentOverride=null})))}onSpecificOptionChange(T,p){return this.onOptionChange((v=>{v===T&&p(this.rawOptions[T])}))}onMultipleOptionChange(T,p){return this.onOptionChange((v=>{T.indexOf(v)!==-1&&p()}))}_setupOptions(){const T=v=>{if(!(v in c.DEFAULT_OPTIONS))throw new Error(`No option with key "${v}"`);return this.rawOptions[v]},p=(v,d)=>{if(!(v in c.DEFAULT_OPTIONS))throw new Error(`No option with key "${v}"`);d=this._sanitizeAndValidateOption(v,d),this.rawOptions[v]!==d&&(this.rawOptions[v]=d,this._onOptionChange.fire(v))};for(const v in this.rawOptions){const d={get:T.bind(this,v),set:p.bind(this,v)};Object.defineProperty(this.options,v,d)}}_sanitizeAndValidateOption(T,p){switch(T){case"cursorStyle":if(p||(p=c.DEFAULT_OPTIONS[T]),!(function(v){return v==="block"||v==="underline"||v==="bar"})(p))throw new Error(`"${p}" is not a valid value for ${T}`);break;case"wordSeparator":p||(p=c.DEFAULT_OPTIONS[T]);break;case"fontWeight":case"fontWeightBold":if(typeof p=="number"&&1<=p&&p<=1e3)break;p=C.includes(p)?p:c.DEFAULT_OPTIONS[T];break;case"cursorWidth":p=Math.floor(p);case"lineHeight":case"tabStopWidth":if(p<1)throw new Error(`${T} cannot be less than 1, value: ${p}`);break;case"minimumContrastRatio":p=Math.max(1,Math.min(21,Math.round(10*p)/10));break;case"scrollback":if((p=Math.min(p,4294967295))<0)throw new Error(`${T} cannot be less than 0, value: ${p}`);break;case"fastScrollSensitivity":case"scrollSensitivity":if(p<=0)throw new Error(`${T} cannot be less than or equal to 0, value: ${p}`);break;case"rows":case"cols":if(!p&&p!==0)throw new Error(`${T} must be numeric, value: ${p}`);break;case"windowsPty":p=p??{}}return p}}c.OptionsService=E},2660:function(m,c,u){var h=this&&this.__decorate||function(E,A,T,p){var v,d=arguments.length,b=d<3?A:p===null?p=Object.getOwnPropertyDescriptor(A,T):p;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")b=Reflect.decorate(E,A,T,p);else for(var x=E.length-1;x>=0;x--)(v=E[x])&&(b=(d<3?v(b):d>3?v(A,T,b):v(A,T))||b);return d>3&&b&&Object.defineProperty(A,T,b),b},y=this&&this.__param||function(E,A){return function(T,p){A(T,p,E)}};Object.defineProperty(c,"__esModule",{value:!0}),c.OscLinkService=void 0;const g=u(2585);let C=c.OscLinkService=class{constructor(E){this._bufferService=E,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(E){const A=this._bufferService.buffer;if(E.id===void 0){const x=A.addMarker(A.ybase+A.y),L={data:E,id:this._nextId++,lines:[x]};return x.onDispose((()=>this._removeMarkerFromLink(L,x))),this._dataByLinkId.set(L.id,L),L.id}const T=E,p=this._getEntryIdKey(T),v=this._entriesWithId.get(p);if(v)return this.addLineToLink(v.id,A.ybase+A.y),v.id;const d=A.addMarker(A.ybase+A.y),b={id:this._nextId++,key:this._getEntryIdKey(T),data:T,lines:[d]};return d.onDispose((()=>this._removeMarkerFromLink(b,d))),this._entriesWithId.set(b.key,b),this._dataByLinkId.set(b.id,b),b.id}addLineToLink(E,A){const T=this._dataByLinkId.get(E);if(T&&T.lines.every((p=>p.line!==A))){const p=this._bufferService.buffer.addMarker(A);T.lines.push(p),p.onDispose((()=>this._removeMarkerFromLink(T,p)))}}getLinkData(E){return this._dataByLinkId.get(E)?.data}_getEntryIdKey(E){return`${E.id};;${E.uri}`}_removeMarkerFromLink(E,A){const T=E.lines.indexOf(A);T!==-1&&(E.lines.splice(T,1),E.lines.length===0&&(E.data.id!==void 0&&this._entriesWithId.delete(E.key),this._dataByLinkId.delete(E.id)))}};c.OscLinkService=C=h([y(0,g.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(y){return y[h]||[]},c.createDecorator=function(y){if(c.serviceRegistry.has(y))return c.serviceRegistry.get(y);const g=function(C,E,A){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");(function(T,p,v){p[u]===p?p[h].push({id:T,index:v}):(p[h]=[{id:T,index:v}],p[u]=p)})(g,C,A)};return g.toString=()=>y,c.serviceRegistry.set(y,g),g}},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 y;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(g){g[g.TRACE=0]="TRACE",g[g.DEBUG=1]="DEBUG",g[g.INFO=2]="INFO",g[g.WARN=3]="WARN",g[g.ERROR=4]="ERROR",g[g.OFF=5]="OFF"})(y||(c.LogLevelEnum=y={})),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),y=u(225);class g{static extractShouldJoin(E){return(1&E)!=0}static extractWidth(E){return E>>1&3}static extractCharKind(E){return E>>3}static createPropertyValue(E,A,T=!1){return(16777215&E)<<3|(3&A)<<1|(T?1:0)}constructor(){this._providers=Object.create(null),this._active="",this._onChange=new h.EventEmitter,this.onChange=this._onChange.event;const E=new y.UnicodeV6;this.register(E),this._active=E.version,this._activeProvider=E}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(E){if(!this._providers[E])throw new Error(`unknown Unicode version "${E}"`);this._active=E,this._activeProvider=this._providers[E],this._onChange.fire(E)}register(E){this._providers[E.version]=E}wcwidth(E){return this._activeProvider.wcwidth(E)}getStringCellWidth(E){let A=0,T=0;const p=E.length;for(let v=0;v<p;++v){let d=E.charCodeAt(v);if(55296<=d&&d<=56319){if(++v>=p)return A+this.wcwidth(d);const L=E.charCodeAt(v);56320<=L&&L<=57343?d=1024*(d-55296)+L-56320+65536:A+=this.wcwidth(L)}const b=this.charProperties(d,T);let x=g.extractWidth(b);g.extractShouldJoin(b)&&(x-=g.extractWidth(T)),A+=x,T=b}return A}charProperties(E,A){return this._activeProvider.charProperties(E,A)}}c.UnicodeService=g}},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 f={};return(()=>{var m=f;Object.defineProperty(m,"__esModule",{value:!0}),m.Terminal=void 0;const c=l(9042),u=l(3236),h=l(844),y=l(5741),g=l(8285),C=l(7975),E=l(7090),A=["cols","rows"];class T extends h.Disposable{constructor(v){super(),this._core=this.register(new u.Terminal(v)),this._addonManager=this.register(new y.AddonManager),this._publicOptions={...this._core.options};const d=x=>this._core.options[x],b=(x,L)=>{this._checkReadonlyOptions(x),this._core.options[x]=L};for(const x in this._core.options){const L={get:d.bind(this,x),set:b.bind(this,x)};Object.defineProperty(this._publicOptions,x,L)}}_checkReadonlyOptions(v){if(A.includes(v))throw new Error(`Option "${v}" 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 E.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 g.BufferNamespaceApi(this._core))),this._buffer}get markers(){return this._checkProposedApi(),this._core.markers}get modes(){const v=this._core.coreService.decPrivateModes;let d="none";switch(this._core.coreMouseService.activeProtocol){case"X10":d="x10";break;case"VT200":d="vt200";break;case"DRAG":d="drag";break;case"ANY":d="any"}return{applicationCursorKeysMode:v.applicationCursorKeys,applicationKeypadMode:v.applicationKeypad,bracketedPasteMode:v.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:d,originMode:v.origin,reverseWraparoundMode:v.reverseWraparound,sendFocusMode:v.sendFocus,wraparoundMode:v.wraparound}}get options(){return this._publicOptions}set options(v){for(const d in v)this._publicOptions[d]=v[d]}blur(){this._core.blur()}focus(){this._core.focus()}input(v,d=!0){this._core.input(v,d)}resize(v,d){this._verifyIntegers(v,d),this._core.resize(v,d)}open(v){this._core.open(v)}attachCustomKeyEventHandler(v){this._core.attachCustomKeyEventHandler(v)}attachCustomWheelEventHandler(v){this._core.attachCustomWheelEventHandler(v)}registerLinkProvider(v){return this._core.registerLinkProvider(v)}registerCharacterJoiner(v){return this._checkProposedApi(),this._core.registerCharacterJoiner(v)}deregisterCharacterJoiner(v){this._checkProposedApi(),this._core.deregisterCharacterJoiner(v)}registerMarker(v=0){return this._verifyIntegers(v),this._core.registerMarker(v)}registerDecoration(v){return this._checkProposedApi(),this._verifyPositiveIntegers(v.x??0,v.width??0,v.height??0),this._core.registerDecoration(v)}hasSelection(){return this._core.hasSelection()}select(v,d,b){this._verifyIntegers(v,d,b),this._core.select(v,d,b)}getSelection(){return this._core.getSelection()}getSelectionPosition(){return this._core.getSelectionPosition()}clearSelection(){this._core.clearSelection()}selectAll(){this._core.selectAll()}selectLines(v,d){this._verifyIntegers(v,d),this._core.selectLines(v,d)}dispose(){super.dispose()}scrollLines(v){this._verifyIntegers(v),this._core.scrollLines(v)}scrollPages(v){this._verifyIntegers(v),this._core.scrollPages(v)}scrollToTop(){this._core.scrollToTop()}scrollToBottom(){this._core.scrollToBottom()}scrollToLine(v){this._verifyIntegers(v),this._core.scrollToLine(v)}clear(){this._core.clear()}write(v,d){this._core.write(v,d)}writeln(v,d){this._core.write(v),this._core.write(`\r
|
|
776
|
+
`,d)}paste(v){this._core.paste(v)}refresh(v,d){this._verifyIntegers(v,d),this._core.refresh(v,d)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(v){this._addonManager.loadAddon(this,v)}static get strings(){return c}_verifyIntegers(...v){for(const d of v)if(d===1/0||isNaN(d)||d%1!=0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...v){for(const d of v)if(d&&(d===1/0||isNaN(d)||d%1!=0||d<0))throw new Error("This API only accepts positive integers")}}m.Terminal=T})(),f})()))})(hp)),hp.exports}var SN=yN();const _y=250,wN=5e3,vy=1,CN=4e3,xN=4001;function EN(e){const n=new AbortController,r=new TextEncoder;let a=_y,l=null,f=null,m=null,c=!1;const u=()=>{f?.dispose(),f=null},h=(C,E)=>{m={cols:C,rows:E},l?.readyState===vy&&l.send(JSON.stringify({type:"resize",cols:C,rows:E}))},y=async()=>{for(;!n.signal.aborted;){e.onStatus?.("connecting");try{const C=e.fetchTicket??WT,{ticket:E}=await C(e.sessionId,{kind:e.kind,theaterId:e.theaterId,signal:n.signal});if(n.signal.aborted)return;await g(TN(E,e.location),e),a=_y}catch(C){if(n.signal.aborted)return;e.onStatus?.("connecting",C instanceof Error?C.message:String(C))}await kN(a,n.signal),a=Math.min(a*2,wN)}},g=async(C,E)=>{await new Promise((A,T)=>{const p=(E.webSocketFactory??AN)(C);l=p,p.binaryType="arraybuffer",p.onopen=()=>{E.onStatus?.("live"),u(),f=E.terminal.onData(v=>{p.readyState===vy&&p.send(r.encode(v))}),m&&h(m.cols,m.rows)},p.onmessage=v=>{v.data instanceof ArrayBuffer&&E.terminal.write(new Uint8Array(v.data))},p.onerror=()=>{T(new Error("Terminal WebSocket error"))},p.onclose=v=>{u(),l===p&&(l=null);const d=v?.code;d===CN?n.abort():d===xN&&(n.abort(),E.onExit?.()),A()}})};return{start:()=>{c||(c=!0,y())},resize:h,dispose:()=>{n.abort(),u(),e.onStatus?.("closed"),l?.close(),l=null}}}function TN(e,n=window.location){return`${n.protocol==="https:"?"wss":"ws"}://${n.host}/terminal/ws?ticket=${encodeURIComponent(e)}`}function AN(e){return new WebSocket(e)}async function kN(e,n){await new Promise(r=>{const a=()=>{clearTimeout(l),n.removeEventListener("abort",a),r()},l=setTimeout(a,e);n.addEventListener("abort",a)})}const VC=14,RN={allowProposedApi:!0,convertEol:!0,cursorBlink:!0,cursorStyle:"block",fontFamily:'"Cascadia Code", "Cascadia Mono", "JetBrains Mono Variable", ui-monospace, "SF Mono", Menlo, monospace',fontSize:VC,lineHeight:1.2},LN=80,MN=120,DN={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)"},ON={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 YC({sessionId:e,kind:n,theaterId:r,onExit:a,active:l,zoom:f=1}){const{activeTheme:m,terminalRenderer:c}=Fl(),u=H.useRef(null),h=H.useRef(null),y=H.useRef(null),g=H.useRef(null),C=H.useRef(null),[E,A]=H.useState(f),T=H.useRef(a);T.current=a;const p=H.useRef(l);p.current=l;const[v,d]=H.useState("connecting");H.useEffect(()=>{const L=u.current;if(!L)return;let R=!1;const M=new SN.Terminal({...RN,theme:by(m)});h.current=M;const k=new BO.FitAddon;C.current=k,M.loadAddon(k),M.open(L),M.loadAddon(new zO.Unicode11Addon),M.unicode.activeVersion="11",M.attachCustomKeyEventHandler(q=>q.key==="Enter"&&q.shiftKey?(q.type==="keydown"&&M.input(`
|
|
777
|
+
`),!1):!0);const O=EN({sessionId:e,kind:n,theaterId:r,terminal:M,onExit:()=>T.current?.(),onStatus:(q,W)=>{d(W?`${q}: ${W}`:q)}});y.current=O;let U=null;const F=()=>{k.fit(),O.resize(M.cols,M.rows)},G=()=>{F(),M.refresh(0,M.rows-1)},I=()=>{U&&clearTimeout(U),U=setTimeout(()=>{U=null,R||G()},LN)},K=async()=>{await document.fonts?.ready,!R&&(F(),O.start(),p.current!==!1&&M.focus())},te=new ResizeObserver(I);return te.observe(L),K(),()=>{R=!0,te.disconnect(),U&&clearTimeout(U),O.dispose(),h.current=null,y.current=null,C.current=null;try{M.dispose()}catch{}}},[n,e,r]),H.useEffect(()=>{l&&h.current?.focus()},[l]),H.useEffect(()=>{const L=h.current;if(!L)return;let R=!1;if(c==="webgl")try{const M=new bN;g.current=M,M.onContextLoss(()=>{if(!R){try{M.dispose()}catch{}g.current===M&&(g.current=null)}}),L.loadAddon(M)}catch{try{g.current?.dispose()}catch{}g.current=null}return()=>{R=!0;const M=g.current;if(M){g.current=null;try{M.dispose()}catch{}}}},[c,n,e]),H.useEffect(()=>{const L=h.current;L&&(L.options.theme=by(m))},[m]),H.useEffect(()=>{if(f===E)return;const L=setTimeout(()=>A(f),MN);return()=>clearTimeout(L)},[f,E]),H.useEffect(()=>{const L=h.current,R=C.current;!L||!R||(L.options.fontSize=VC*E,R.fit(),L.refresh(0,L.rows-1))},[E]);const b=v.startsWith("live"),x=E===1?void 0:{width:`${E*100}%`,height:`${E*100}%`,transform:`scale(${1/E})`,transformOrigin:"0 0"};return S.jsx("section",{className:"terminal-stage","aria-label":n==="shell"?"Shell terminal":"Fleet terminal",children:S.jsxs("div",{className:"terminal-shell",children:[b?null:S.jsxs("div",{className:"terminal-status","aria-live":"polite",children:[S.jsx("span",{className:"terminal-status-dot","aria-hidden":"true"}),v]}),S.jsx("div",{className:"terminal-viewport",children:S.jsx("div",{className:"terminal-canvas",ref:u,style:x})})]})})}function by(e){return e==="carbon"?ON:DN}const NN=["n","ne","e","se","s","sw","w","nw"],dp=320,fp=200;function XC({geometry:e,zoom:n,onResize:r}){const a=H.useRef(null),l=(c,u)=>{u.preventDefault(),u.stopPropagation(),a.current={direction:c,pointerId:u.pointerId,startX:u.clientX,startY:u.clientY,geometry:e},u.currentTarget.setPointerCapture(u.pointerId)},f=c=>{const u=a.current;if(!u||u.pointerId!==c.pointerId)return;c.preventDefault(),c.stopPropagation();const h=(c.clientX-u.startX)/n,y=(c.clientY-u.startY)/n;r(BN(u.geometry,u.direction,h,y))},m=c=>{a.current?.pointerId===c.pointerId&&(c.preventDefault(),c.stopPropagation(),a.current=null,c.currentTarget.releasePointerCapture(c.pointerId))};return S.jsx(S.Fragment,{children:NN.map(c=>S.jsx("div",{className:`canvas-panel-resize canvas-panel-resize--${c}`,onPointerDown:u=>l(c,u),onPointerMove:f,onPointerUp:m,onPointerCancel:m,"data-canvas-blocker":!0,"aria-hidden":"true"},c))})}function BN(e,n,r,a){let{x:l,y:f,width:m,height:c}=e;return n.includes("e")&&(m+=r),n.includes("s")&&(c+=a),n.includes("w")&&(l+=r,m-=r),n.includes("n")&&(f+=a,c-=a),m<dp&&(n.includes("w")&&(l-=dp-m),m=dp),c<fp&&(n.includes("n")&&(f-=fp-c),c=fp),{...e,x:l,y:f,width:m,height:c}}function IN({state:e,session:n,geometry:r,viewport:a,active:l}){const f=H.useRef(null),[m,c]=H.useState(!1),[u,h]=H.useState(""),y=H.useRef(null),g=H.useRef(!1),C=H.useRef(!1),A=HS(e,n).filter(({job:W})=>!Mg(W.status)).map(({job:W})=>W),T=A.length,p=n.status==="dormant",v=Ul(n),d=e.operationNotifications[n.sessionId]?.kind==="input-waiting",b=p?null:d?"awaiting":T>0?"live":n.turnState==="running"?"turn":null,x=()=>{Hi(n.sessionId),Tl(n.sessionId,r)},L=W=>{l||Hi(n.sessionId),$S(W)},R=W=>{W.button===0&&(W.preventDefault(),W.stopPropagation(),x(),f.current={pointerId:W.pointerId,startX:W.clientX,startY:W.clientY,geometry:r},W.currentTarget.setPointerCapture(W.pointerId))},M=W=>{const Y=f.current;!Y||Y.pointerId!==W.pointerId||(W.preventDefault(),W.stopPropagation(),Tl(n.sessionId,{...Y.geometry,x:Y.geometry.x+(W.clientX-Y.startX)/a.zoom,y:Y.geometry.y+(W.clientY-Y.startY)/a.zoom}))},k=W=>{f.current?.pointerId===W.pointerId&&(W.preventDefault(),W.stopPropagation(),f.current=null,W.currentTarget.releasePointerCapture(W.pointerId))},O=W=>{W.stopPropagation()};H.useEffect(()=>{m&&(y.current?.focus(),y.current?.select())},[m]);const U=()=>{x(),C.current=!1,h(v),c(!0)},F=()=>{C.current=!0,c(!1),h("")},G=async()=>{if(!g.current){g.current=!0;try{sh(await FT(n.sessionId,u))}catch(W){XA(W instanceof Error?W.message:String(W))}finally{g.current=!1,C.current=!0,c(!1)}}},I=W=>{if(W.key==="Enter"){W.preventDefault(),G();return}W.key==="Escape"&&(W.preventDefault(),F())},K=W=>{W.stopPropagation(),x()},te=W=>{W.stopPropagation(),x()},q=W=>{W.stopPropagation()};return S.jsxs(S.Fragment,{children:[S.jsxs("article",{className:`canvas-panel ${l?"is-active":""} ${b?`is-running is-running--${b}`:""}`,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 ${v}`,children:[S.jsxs("div",{className:"canvas-panel-titlebar",onPointerDown:R,onPointerMove:M,onPointerUp:k,onPointerCancel:k,"data-canvas-blocker":!0,children:[S.jsx("span",{className:SS(n,T),"aria-hidden":"true"}),m?S.jsx("input",{ref:y,className:"canvas-panel-rename-input",value:u,"aria-label":`${v} 이름 변경`,onPointerDown:W=>W.stopPropagation(),onChange:W=>h(W.target.value),onKeyDown:I,onBlur:()=>{if(C.current){C.current=!1;return}G()}}):S.jsx("span",{className:"canvas-panel-title",onPointerDown:K,onDoubleClick:U,title:"Double-click to rename",children:v}),S.jsx("span",{className:"canvas-panel-cli",children:n.cliLabel??n.cliId??"CLI"}),T>0?S.jsx("span",{className:"canvas-panel-job-count",children:T}):null,S.jsx("button",{type:"button",className:"canvas-panel-icon-button",onPointerDown:O,onClick:()=>{Z5(n.sessionId)},"aria-label":`Minimize operation ${v}`,title:"Minimize panel",children:S.jsx($N,{})}),S.jsx("button",{type:"button",className:"canvas-panel-icon-button",onPointerDown:O,onClick:()=>{zN(n.sessionId)},"aria-label":`${p?"Forget":"Terminate"} operation ${v}`,title:p?"Forget operation":"Terminate operation",children:S.jsx(PN,{})})]}),S.jsx("div",{className:"canvas-panel-terminal",onPointerDown:te,onWheel:q,"data-canvas-blocker":!0,children:p?S.jsxs("button",{type:"button",className:"canvas-panel-dormant",onClick:()=>{jN(n.sessionId)},children:[S.jsx("span",{className:"canvas-panel-dormant-status",children:"Dormant"}),S.jsx("span",{className:"canvas-panel-dormant-action",children:"Resume"})]}):S.jsx(YC,{sessionId:n.sessionId,active:l,zoom:a.zoom,onExit:()=>zS(n.sessionId)})}),S.jsx(XC,{geometry:r,zoom:a.zoom,onResize:W=>Tl(n.sessionId,W)})]}),A.length>0?S.jsx("div",{className:"canvas-panel-jobdock",style:{left:r.x,top:r.y+r.height,width:r.width,zIndex:r.zIndex},"data-canvas-blocker":!0,"aria-label":`Active carrier jobs for ${v}`,children:S.jsx(DO,{jobs:A,selectedJobId:e.selectedJobId,onSelect:L})}):null]})}async function jN(e){try{const n=await pS(e);sh(n),Hi(n.sessionId)}catch(n){jS(n instanceof Error?n.message:String(n))}}async function zN(e){try{await fS(e)}catch(n){IS(n instanceof Error?n.message:String(n));return}zS(e)}function $N(){return S.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:S.jsx("path",{d:"M3.5 11.5h9",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})})}function PN(){return S.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:S.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"})})}const HN={overflow:!1,atStart:!1,atEnd:!0,page:1,pages:1};function UN({state:e,sessions:n,minimized:r}){const a=Y5(),l=H.useRef(null),f=H.useRef(!0),[m,c]=H.useState(HN),u=new Map(n.map(v=>[v.sessionId,v])),h=r.map(v=>u.get(v)).filter(v=>!!v).map(v=>{const d=HS(e,v).filter(({job:x})=>!Mg(x.status)).length,b=v.status==="dormant"?null:d>0?"live":v.turnState==="running"?"turn":null;return{session:v,activeJobCount:d,underway:b,active:e.activeTerminalSessionId===v.sessionId}}),y=h.map(v=>v.session.sessionId).join(","),g=h.map(v=>`${Ul(v.session)}${v.session.cliLabel??v.session.cliId??""}${v.activeJobCount}`).join(""),C=H.useCallback(()=>{const v=l.current;if(!v)return;const{scrollLeft:d,clientWidth:b,clientHeight:x,scrollWidth:L}=v,R=Math.max(0,L-b),M=b>0&&x>0&&R>1,k=M?Math.max(1,Math.ceil(L/b)):1,O=d>=R-1,U=M?O?1:Math.min(k,Math.ceil((R-d)/b)+1):1;c({overflow:M,atStart:d<=1,atEnd:O,page:U,pages:k})},[]);if(H.useEffect(()=>{const v=l.current;if(!v)return;f.current=!0,a&&(v.scrollLeft=v.scrollWidth),C();const d=typeof ResizeObserver<"u"?new ResizeObserver(()=>{f.current&&(v.scrollLeft=v.scrollWidth),C()}):null;d?.observe(v);const b=()=>{const x=Math.max(0,v.scrollWidth-v.clientWidth);f.current=v.scrollLeft>=x-1,C()};return v.addEventListener("scroll",b,{passive:!0}),()=>{d?.disconnect(),v.removeEventListener("scroll",b)}},[a,y,C]),H.useEffect(()=>{const v=l.current;!v||!a||(f.current&&(v.scrollLeft=v.scrollWidth),C())},[a,g,C]),h.length===0)return null;const E=h.some(v=>v.underway==="live")?"live":h.some(v=>v.underway==="turn")?"turn":null,A=["canvas-dock-toggle",E?`canvas-dock-toggle--attention-${E}`:""].filter(Boolean).join(" "),T=a&&m.overflow,p=v=>{const d=l.current;if(!d)return;const b=typeof window<"u"&&typeof window.matchMedia=="function"&&window.matchMedia("(prefers-reduced-motion: reduce)").matches;d.scrollBy({left:v*d.clientWidth,behavior:b?"auto":"smooth"})};return S.jsxs("div",{className:`canvas-dock ${a?"is-expanded":""}`,"data-canvas-blocker":!0,children:[S.jsxs("button",{type:"button",className:A,onClick:oT,"aria-expanded":a,"aria-label":a?"Collapse minimized panels":"Expand minimized panels",title:a?"Collapse":"Expand",children:[S.jsx("span",{className:"canvas-dock-toggle-beacon","aria-hidden":"true"}),S.jsx("span",{className:"canvas-dock-toggle-chevron","aria-hidden":"true",children:S.jsx(qN,{})}),S.jsx("span",{className:"canvas-dock-toggle-count",children:h.length})]}),S.jsxs("div",{className:"canvas-dock-rail",role:"toolbar","aria-label":"Minimized operations","aria-hidden":!a,inert:!a,children:[T?S.jsx("button",{type:"button",className:"canvas-dock-pager canvas-dock-pager--prev",onClick:()=>p(-1),disabled:m.atStart,"aria-label":"Show older minimized operations",title:"Older",children:S.jsx(yy,{direction:"prev"})}):null,S.jsx("div",{className:"canvas-dock-chips",ref:l,children:h.map((v,d)=>S.jsx(FN,{entry:v,index:d},v.session.sessionId))}),T?S.jsx("button",{type:"button",className:"canvas-dock-pager canvas-dock-pager--next",onClick:()=>p(1),disabled:m.atEnd,"aria-label":"Show newer minimized operations",title:"Newer",children:S.jsx(yy,{direction:"next"})}):null,T?S.jsxs("span",{className:"canvas-dock-page","aria-label":`Page ${m.page} of ${m.pages}`,children:[m.page,"/",m.pages]}):null]})]})}function FN({entry:e,index:n}){const{session:r,activeJobCount:a,underway:l,active:f}=e,m=Ul(r),c=()=>{J5(r.sessionId),Hi(r.sessionId)},u=["canvas-dock-chip",f?"canvas-dock-chip--active":"",l?`canvas-dock-chip--underway canvas-dock-chip--underway-${l}`:""].filter(Boolean).join(" ");return S.jsxs("div",{className:u,role:"button",tabIndex:0,"aria-label":`Restore operation ${m}`,title:"Click to restore",style:{"--i":n},onClick:c,onKeyDown:h=>{(h.key==="Enter"||h.key===" ")&&(h.preventDefault(),c())},children:[S.jsx("span",{className:SS(r,a),"aria-hidden":"true"}),S.jsx("span",{className:"canvas-dock-chip-name",children:m}),S.jsx("span",{className:"canvas-dock-chip-cli",children:r.cliLabel??r.cliId??"CLI"}),a>0?S.jsx("span",{className:"canvas-dock-chip-count",children:a}):null]})}function qN(){return S.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:S.jsx("path",{d:"M4 10l4-4 4 4",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round"})})}function yy({direction:e}){return S.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:S.jsx("path",{d:e==="prev"?"M10 3.5 5.5 8 10 12.5":"M6 3.5 10.5 8 6 12.5",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}const WN="is-animation-paused";function GN({viewport:e,backgroundAnimationEnabled:n}){const[r,a]=H.useState(()=>document.hidden);return H.useEffect(()=>{function l(){a(document.hidden)}return document.addEventListener("visibilitychange",l),()=>{document.removeEventListener("visibilitychange",l)}},[]),S.jsxs("div",{className:"operations-canvas-background","aria-hidden":"true",children:[S.jsx("div",{className:"operations-canvas-sea"}),S.jsx("div",{className:"operations-canvas-grid",style:{backgroundPosition:`${e.x}px ${e.y}px`,backgroundSize:`${48*e.zoom}px ${48*e.zoom}px, ${12*e.zoom}px ${12*e.zoom}px`}}),n?S.jsxs("div",{className:`operations-radar${r?` ${WN}`:""}`,children:[S.jsx("span",{className:"operations-radar-ring operations-radar-ring--outer"}),S.jsx("span",{className:"operations-radar-ring operations-radar-ring--middle"}),S.jsx("span",{className:"operations-radar-ring operations-radar-ring--inner"}),S.jsx("span",{className:"operations-radar-sweep"})]}):null]})}const ZC="fleet-console.map.shortcutsCollapsed",Sy=ZS.find(e=>e.title==="Map")??null;function KN(){const[e,n]=H.useState(VN);if(!Sy)return null;const r=()=>{n(a=>{const l=!a;return YN(l),l})};return e?S.jsx("button",{type:"button",className:"map-shortcuts-fab","data-canvas-blocker":!0,onClick:r,"aria-label":"맵 단축키 보기",title:"Map shortcuts",children:S.jsx(XN,{})}):S.jsxs("aside",{className:"map-shortcuts","data-canvas-blocker":!0,"aria-label":"Map shortcuts",children:[S.jsxs("div",{className:"map-shortcuts-head",children:[S.jsx("span",{className:"map-shortcuts-label",children:"Shortcuts"}),S.jsx("button",{type:"button",className:"map-shortcuts-toggle",onClick:r,"aria-label":"맵 단축키 접기",title:"Collapse",children:S.jsx(ZN,{})})]}),S.jsx("dl",{className:"map-shortcuts-list",children:Sy.entries.map(a=>S.jsxs("div",{className:"map-shortcuts-entry",children:[S.jsx("dt",{className:"map-shortcuts-combos",children:a.combos.map((l,f)=>S.jsxs("span",{className:"map-shortcuts-combo",children:[f>0?S.jsx("span",{className:"map-shortcuts-or",children:"or"}):null,S.jsx("span",{className:"map-shortcuts-keyset",children:l.map(m=>S.jsx("kbd",{children:m},m))})]},l.join("+")))}),S.jsx("dd",{children:a.description})]},a.description))})]})}function VN(){if(typeof window>"u")return!1;try{return window.localStorage.getItem(ZC)==="true"}catch{return!1}}function YN(e){if(!(typeof window>"u"))try{window.localStorage.setItem(ZC,String(e))}catch{}}function XN(){return S.jsxs("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:[S.jsx("circle",{cx:"8",cy:"8",r:"6",fill:"none",stroke:"currentColor",strokeWidth:"1.2"}),S.jsx("path",{d:"M6.3 6.1a1.8 1.8 0 1 1 2.5 1.7c-.5.3-.8.6-.8 1.2v.3",fill:"none",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round"}),S.jsx("circle",{cx:"8",cy:"11.4",r:".8",fill:"currentColor"})]})}function ZN(){return S.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:S.jsx("path",{d:"M10.5 4.5 5.5 8l5 3.5M11 8H5.5",fill:"none",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round"})})}function JN(e,n){return{x:e.x*n.zoom+n.x,y:e.y*n.zoom+n.y}}function Qu(e,n){return{x:(e.x-n.x)/n.zoom,y:(e.y-n.y)/n.zoom}}function QN(e,n){return{...JN(e,n),width:e.width*n.zoom,height:e.height*n.zoom}}function e7({rect:e,viewport:n}){const r=QN(e,n);return S.jsx("div",{className:"canvas-rubber-band",style:{left:r.x,top:r.y,width:r.width,height:r.height},"aria-hidden":"true"})}function t7({id:e,theaterId:n,geometry:r,viewport:a,active:l}){const f=H.useRef(null),m=()=>{Hi(null),$u(e),Af(e,{...r,zIndex:lo()})},c=A=>{A.button===0&&(A.preventDefault(),A.stopPropagation(),m(),f.current={pointerId:A.pointerId,startX:A.clientX,startY:A.clientY,geometry:r},A.currentTarget.setPointerCapture(A.pointerId))},u=A=>{const T=f.current;!T||T.pointerId!==A.pointerId||(A.preventDefault(),A.stopPropagation(),Af(e,{...T.geometry,x:T.geometry.x+(A.clientX-T.startX)/a.zoom,y:T.geometry.y+(A.clientY-T.startY)/a.zoom}))},h=A=>{f.current?.pointerId===A.pointerId&&(A.preventDefault(),A.stopPropagation(),f.current=null,A.currentTarget.releasePointerCapture(A.pointerId))},y=A=>{A.stopPropagation()},g=A=>{A.stopPropagation(),m()},C=A=>{A.stopPropagation()},E=()=>{Sb(e),fS(e).catch(A=>{IS(A instanceof Error?A.message:String(A))})};return S.jsxs("article",{className:`canvas-panel canvas-panel--shell ${l?"is-active":""}`,style:{left:r.x,top:r.y,width:r.width,height:r.height,zIndex:r.zIndex},onPointerDown:m,"data-canvas-panel":!0,"aria-label":"Shell panel",children:[S.jsxs("div",{className:"canvas-panel-titlebar",onPointerDown:c,onPointerMove:u,onPointerUp:h,onPointerCancel:h,"data-canvas-blocker":!0,children:[S.jsx("span",{className:"tenant-beacon is-live","aria-hidden":"true"}),S.jsx("span",{className:"canvas-panel-title",children:"Shell"}),S.jsx("span",{className:"canvas-panel-cli",children:"shell"}),S.jsx("button",{type:"button",className:"canvas-panel-icon-button",onPointerDown:y,onClick:E,"aria-label":"Close shell panel",title:"Close shell",children:S.jsx(n7,{})})]}),S.jsx("div",{className:"canvas-panel-terminal",onPointerDown:g,onWheel:C,"data-canvas-blocker":!0,children:S.jsx(YC,{sessionId:e,kind:"shell",theaterId:n,active:l,zoom:a.zoom,onExit:()=>Sb(e)})}),S.jsx(XC,{geometry:r,zoom:a.zoom,onResize:A=>Af(e,A)})]})}function n7(){return S.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:S.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"})})}const i7=.25,r7=2,s7=200,a7=150,wy=5,o7=.0018;function l7({viewport:e,disabled:n=!1,consumePointerDown:r=!1,onViewportChange:a,onZoom:l,onCreate:f,onConsumePointerDown:m,onClick:c}){const u=H.useRef(null),h=H.useRef(e),[y,g]=H.useState(null),[C,E]=H.useState(!1),[A,T]=H.useState(!1);H.useEffect(()=>{h.current=e},[e]),H.useEffect(()=>{const R=k=>{k.key==="Shift"&&T(!0),!c7(k.target)&&k.code==="Space"&&(k.preventDefault(),E(!0))},M=k=>{k.key==="Shift"&&T(!1),k.code==="Space"&&E(!1)};return window.addEventListener("keydown",R),window.addEventListener("keyup",M),()=>{window.removeEventListener("keydown",R),window.removeEventListener("keyup",M)}},[]);const p=R=>{if(n||Cy(R.target)||R.button!==0&&R.button!==1)return;if(R.preventDefault(),r){m?.();return}const M=gp(R),k=R.shiftKey&&R.button===0&&!C?"create":"pan";u.current={pointerId:R.pointerId,mode:k,startScreen:M,currentScreen:M,startViewport:h.current},R.currentTarget.setPointerCapture(R.pointerId),k==="create"&&g(pp(M,M,h.current))},v=R=>{const M=u.current;if(!M||M.pointerId!==R.pointerId)return;R.preventDefault();const k=gp(R);if(u.current={...M,currentScreen:k},M.mode==="pan"){a({...M.startViewport,x:M.startViewport.x+k.x-M.startScreen.x,y:M.startViewport.y+k.y-M.startScreen.y});return}g(pp(M.startScreen,k,h.current))},d=R=>{L(R,!0)},b=R=>{L(R,!1)},x=R=>{if(n||Cy(R.target))return;R.preventDefault();const M=gp(R),k=h.current,O=u7(k.zoom*Math.exp(-R.deltaY*o7),i7,r7),U=Qu(M,k);l({x:M.x-U.x*O,y:M.y-U.y*O,zoom:O})},L=(R,M)=>{const k=u.current;if(!k||k.pointerId!==R.pointerId||(u.current=null,R.currentTarget.releasePointerCapture(R.pointerId),g(null),!M))return;const O=Math.abs(k.currentScreen.x-k.startScreen.x),U=Math.abs(k.currentScreen.y-k.startScreen.y);if(O<wy&&U<wy){c?.();return}if(k.mode!=="create")return;const F=pp(k.startScreen,k.currentScreen,h.current),G={x:F.x,y:F.y,width:Math.max(F.width,s7),height:Math.max(F.height,a7)};f(G,k.currentScreen)};return{rubberBand:y,spaceActive:C,shiftActive:A,onPointerDown:p,onPointerMove:v,onPointerUp:d,onPointerCancel:b,onWheel:x}}function pp(e,n,r){const a=Qu(e,r),l=Qu(n,r),f=Math.min(a.x,l.x),m=Math.min(a.y,l.y);return{x:f,y:m,width:Math.abs(a.x-l.x),height:Math.abs(a.y-l.y)}}function gp(e){const n=e.currentTarget.getBoundingClientRect();return{x:e.clientX-n.left,y:e.clientY-n.top}}function Cy(e){return e instanceof Element&&!!e.closest("[data-canvas-blocker], [data-canvas-panel]")}function c7(e){return e instanceof HTMLElement&&!!e.closest("input, textarea, select, [contenteditable='true']")}function u7(e,n,r){return Math.min(r,Math.max(n,e))}const h7="Shift-drag to create an Operation. Right-click for actions. Drag to pan; scroll to zoom.",d7=640,f7=400,p7=560,g7=360,m7={x:0,y:0,zoom:1};function _7({state:e}){const n=H.useRef(null),r=G5(),a=K5(),l=Zy(),f=V5(),m=yA(),c=SA(),u=nk(e),[h,y]=H.useState(null),[g,C]=H.useState(null),[E,A]=H.useState({width:0,height:0}),T=!e.activeTheaterId||e.agentClis.length===0||e.creatingTerminalSession||e.addingTheater;H.useEffect(()=>{const O=n.current;if(!O||typeof ResizeObserver>"u")return;const U=()=>A({width:O.clientWidth,height:O.clientHeight});U();const F=new ResizeObserver(U);return F.observe(O),()=>F.disconnect()},[]),H.useEffect(()=>{e.activeTerminalSessionId!==null&&$u(null)},[e.activeTerminalSessionId]),H.useEffect(()=>{e.activeTerminalSessionId!==null&&f.includes(e.activeTerminalSessionId)&&Hi(null)},[e.activeTerminalSessionId,f]);const p=l7({viewport:r.viewport,disabled:T,onViewportChange:Tu,onZoom:X5,onCreate:(O,U)=>{C(null),y({rect:O,anchor:U})},consumePointerDown:h!==null||g!==null,onConsumePointerDown:()=>{y(null),C(null)},onClick:S7}),v=async O=>{if(!(!e.activeTheaterId||!h)){Ab();try{const U=await fb(e.activeTheaterId,O.id);Tl(U.sessionId,w7(h.rect)),kb(U),Hi(U.sessionId),y(null)}catch(U){Rb(U instanceof Error?U.message:String(U))}}},d=async O=>{const U=g?.canvasPoint;if(C(null),!(!e.activeTheaterId||!U)){Ab();try{const F=await fb(e.activeTheaterId,O.id);Tl(F.sessionId,Ey(U,d7,f7)),kb(F),Hi(F.sessionId)}catch(F){Rb(F instanceof Error?F.message:String(F))}}},b=()=>{const O=g?.canvasPoint;if(C(null),!e.activeTheaterId||!O)return;Hi(null);const U=wA(e.activeTheaterId,{...Ey(O,p7,g7),zIndex:lo()});$u(U)},x=()=>{C(null),Tu({...m7})},L=O=>{if(O.target instanceof Element&&O.target.closest("[data-canvas-blocker], [data-canvas-panel]"))return;O.preventDefault();const U=n.current?.getBoundingClientRect();if(!U)return;const F={x:O.clientX-U.left,y:O.clientY-U.top};y(null),C({anchor:F,canvasPoint:Qu(F,r.viewport)})},R=new Set(f),M=Object.fromEntries(Object.entries(r.panels).filter(([O])=>!R.has(O))),k=u.length>0||Object.keys(m).length>0;return S.jsxs("main",{className:`operations-canvas ${p.spaceActive?"is-panning":""} ${p.shiftActive?"is-creating":""}`,onPointerDown:p.onPointerDown,onPointerMove:p.onPointerMove,onPointerUp:p.onPointerUp,onPointerCancel:p.onPointerCancel,onWheel:p.onWheel,onContextMenu:L,ref:n,children:[S.jsx(GN,{viewport:r.viewport,backgroundAnimationEnabled:a}),S.jsx("button",{type:"button",className:`canvas-background-toggle canvas-maximize-toggle ${l?"is-active":""}`,onClick:sT,"data-canvas-blocker":!0,"aria-label":l?"맵 최대화 해제":"맵 최대화","aria-pressed":l,title:l?"Exit fullscreen":"Maximize map",children:l?S.jsx(y7,{}):S.jsx(b7,{})}),S.jsx("button",{type:"button",className:`canvas-background-toggle ${a?"is-active":""}`,onClick:rT,"data-canvas-blocker":!0,"aria-label":a?"배경 애니메이션 끄기":"배경 애니메이션 켜기",title:a?"Background animation: on":"Background animation: off",children:S.jsx(v7,{})}),S.jsxs("div",{className:"operations-canvas-world",style:{transform:`translate(${r.viewport.x}px, ${r.viewport.y}px) scale(${r.viewport.zoom})`},children:[u.map(O=>{const U=r.panels[O.sessionId];return!U||R.has(O.sessionId)?null:S.jsx(IN,{state:e,session:O,geometry:U,viewport:r.viewport,active:e.activeTerminalSessionId===O.sessionId},O.sessionId)}),Object.entries(m).map(([O,U])=>S.jsx(t7,{id:O,theaterId:U.theaterId,geometry:U.geometry,viewport:r.viewport,active:c===O},O))]}),k?null:S.jsxs("div",{className:"operations-canvas-empty","data-canvas-blocker":!0,children:[S.jsx("span",{className:"operations-canvas-empty-mark","aria-hidden":"true"}),S.jsx("p",{children:e.activeTheaterId?h7:"Add a Theater from the top bar to start operations."}),e.terminalSessionError?S.jsx("p",{className:"operations-canvas-error",children:e.terminalSessionError}):null]}),p.rubberBand?S.jsx(e7,{rect:p.rubberBand,viewport:r.viewport}):null,h?S.jsx(fO,{state:e,mode:"menu",anchor:h.anchor,viewportBounds:xy(n.current),onSelect:v,onClose:()=>y(null)},`${h.anchor.x}:${h.anchor.y}`):null,g?S.jsx(CO,{state:e,anchor:g.anchor,viewportBounds:xy(n.current),onLaunchCli:O=>{d(O)},onOpenShell:b,onResetView:x,onClose:()=>C(null)},`${g.anchor.x}:${g.anchor.y}`):null,S.jsx(AO,{panels:M,shellPanels:m,viewport:r.viewport,canvasSize:E,onJump:O=>Tu({x:E.width/2-O.x*r.viewport.zoom,y:E.height/2-O.y*r.viewport.zoom,zoom:r.viewport.zoom})}),k?S.jsx(KN,{}):null,S.jsx(UN,{state:e,sessions:u,minimized:f})]})}function v7(){return S.jsxs("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:[S.jsx("circle",{cx:"8",cy:"8",r:"5.2",fill:"none",stroke:"currentColor",strokeWidth:"1.1",strokeDasharray:"2 2"}),S.jsx("circle",{cx:"8",cy:"8",r:"2.6",fill:"none",stroke:"currentColor",strokeWidth:"1.1",opacity:"0.72"}),S.jsx("path",{d:"M8 8 12.2 5.8",fill:"none",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round"}),S.jsx("circle",{cx:"8",cy:"8",r:".9",fill:"currentColor"})]})}function b7(){return S.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:S.jsx("path",{d:"M3 6.4V3h3.4M13 6.4V3H9.6M3 9.6V13h3.4M13 9.6V13H9.6",fill:"none",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round"})})}function y7(){return S.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:S.jsx("path",{d:"M6.4 3v3.4H3M9.6 3v3.4H13M6.4 13V9.6H3M9.6 13V9.6H13",fill:"none",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round"})})}function xy(e){if(!e)return;const n=e.getBoundingClientRect();return{width:n.width,height:n.height}}function S7(){if(typeof document<"u"){const e=document.activeElement;e instanceof HTMLElement&&e.blur()}Hi(null),$u(null)}function w7(e){return{x:e.x,y:e.y,width:e.width,height:e.height,zIndex:0}}function Ey(e,n,r){return{x:e.x,y:e.y,width:n,height:r,zIndex:0}}const C7=56;function x7(e,n){const r=H.useRef(null),a=H.useRef(!0),[l,f]=H.useState(!0),m=H.useCallback(u=>{a.current!==u&&(a.current=u,f(u))},[]);H.useEffect(()=>{const u=r.current;if(!u)return;const h=()=>{const y=u.scrollHeight-u.scrollTop-u.clientHeight;m(y<=C7)};return u.addEventListener("scroll",h,{passive:!0}),()=>u.removeEventListener("scroll",h)},[m]),H.useLayoutEffect(()=>{m(!0);const u=r.current;u&&(u.scrollTop=u.scrollHeight)},[e,m]),H.useLayoutEffect(()=>{const u=r.current;!u||!a.current||(u.scrollTop=u.scrollHeight)},[n]);const c=H.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 Ty=400,E7=["text","fallbackText","fallbackThought"],T7=H.memo(function({events:n}){return S.jsxs("ol",{className:"timeline","aria-label":"Raw event timeline",children:[n.length===0?S.jsx("li",{className:"timeline-empty",children:"No events observed."}):null,n.map((r,a)=>{const l=n[n.length-1-a];return l?S.jsx(A7,{event:l},l.id):null})]})}),A7=H.memo(function({event:n}){return S.jsxs("li",{className:"timeline-row",children:[S.jsx("time",{className:"timeline-time",children:yS(n.at)}),S.jsx("span",{className:"timeline-type",children:n.type}),S.jsx("code",{className:"timeline-payload",children:k7(n.event)})]})});function k7(e){const n={...e};delete n.type;for(const a of E7){const l=n[a];typeof l=="string"&&(n[a]=l.length>60?`${l.slice(0,60)}… (${l.length} chars)`:l)}const r=JSON.stringify(n);return r.length>Ty?`${r.slice(0,Ty)}…`:r}const R7=H.memo(function({track:n}){const r=rh(n.status),a=n.status==="stream",l=n.sentTextLength>n.text.length||n.sentThoughtLength>n.thought.length,f=n.sentTextLength+n.sentThoughtLength;return S.jsxs("article",{className:`track-card track-card--${r}`,children:[S.jsxs("header",{className:"track-head",children:[S.jsx("span",{className:`status-dot status-dot--${r}`,"aria-hidden":"true"}),S.jsx("h3",{className:"track-name",children:n.displayName}),n.displayCli?S.jsx("span",{className:"track-tag",children:n.displayCli}):null,n.model?S.jsx("span",{className:"track-tag track-tag--dim",children:n.model}):null,n.effort?S.jsx("span",{className:"track-tag track-tag--dim",children:n.effort}):null,S.jsx("span",{className:`track-status track-status--${r}`,children:cA(n.status)})]}),n.subtitle?S.jsx("p",{className:"track-subtitle",children:n.subtitle}):null,n.requestPreview?S.jsx(L7,{preview:n.requestPreview}):null,n.thought?S.jsx(M7,{thought:n.thought,streaming:a&&!n.text}):null,S.jsx(D7,{track:n}),n.text?S.jsx("div",{className:"track-output","data-streaming":a||void 0,children:S.jsxs("pre",{className:"track-text",children:[n.text,a?S.jsx("span",{className:"stream-caret","aria-hidden":"true"}):null]})}):a||n.status==="conn"||n.status==="queued"?S.jsxs("p",{className:"track-waiting",children:[S.jsx("span",{className:"stream-caret","aria-hidden":"true"})," awaiting output"]}):null,l?S.jsxs("p",{className:"track-notice",children:["Output partially retained — ",f.toLocaleString()," chars emitted in total."]}):null,n.error?S.jsx("p",{className:"track-error",children:n.error}):null]})});function L7({preview:e}){return S.jsxs("p",{className:"track-request",title:e,children:[S.jsx("span",{className:"track-request-mark","aria-hidden":"true",children:"▸"}),e]})}function M7({thought:e,streaming:n}){const[r,a]=H.useState(!1);return S.jsxs("div",{className:`thought-fold ${r?"is-open":""}`,children:[S.jsxs("button",{type:"button",className:"thought-toggle",onClick:()=>a(l=>!l),"aria-expanded":r,children:[S.jsx("span",{className:"thought-chevron","aria-hidden":"true",children:r?"▾":"▸"}),"reasoning",n?S.jsx("span",{className:"stream-caret stream-caret--dim","aria-hidden":"true"}):null]}),r?S.jsx("pre",{className:"thought-text",children:e}):null]})}function D7({track:e}){return e.tools.length===0?null:S.jsx("ul",{className:"tool-rail","aria-label":"Tool calls",children:e.tools.map(n=>S.jsxs("li",{className:`tool-chip tool-chip--${O7(n.status)}`,children:[S.jsx("span",{className:"tool-chip-glyph","aria-hidden":"true",children:"⚙"}),S.jsx("span",{className:"tool-chip-title",children:n.title}),n.status?S.jsx("span",{className:"tool-chip-status",children:n.status}):null]},n.key))})}function O7(e){const n=e.toLowerCase();return n.includes("error")||n.includes("fail")?"bad":n.includes("done")||n.includes("ok")||n.includes("complete")?"ok":n.includes("run")||n.includes("progress")||n.includes("stream")?"live":"idle"}function N7({job:e,timelineOpen:n}){const{containerRef:r,pinned:a,jumpToLatest:l}=x7(e?.jobId??"none",e?.lastEventId??0);return e?S.jsxs("main",{className:"stage",children:[S.jsx(B7,{job:e}),S.jsxs("div",{className:"stage-stream",children:[S.jsx("div",{className:"stage-scroll",ref:r,tabIndex:-1,children:S.jsxs("div",{className:"stage-content",children:[e.trackOrder.length===0?S.jsxs("p",{className:"stage-waiting",children:[S.jsx("span",{className:"stream-caret","aria-hidden":"true"})," waiting for track registration"]}):e.trackOrder.map(f=>{const m=e.tracks[f];return m?S.jsx(R7,{track:m},`${e.jobId}:${f}`):null}),e.summary?S.jsx(I7,{summary:e.summary,status:e.status,error:e.error}):null]})}),a?null:S.jsx("button",{type:"button",className:"follow-button",onClick:l,children:"↓ Follow stream"})]}),S.jsxs("section",{className:`timeline-dock ${n?"is-open":""}`,children:[S.jsxs("button",{type:"button",className:"timeline-toggle",onClick:KA,"aria-expanded":n,children:[S.jsx("span",{className:"timeline-chevron","aria-hidden":"true",children:n?"▾":"▴"}),"Event timeline",S.jsx("span",{className:"timeline-count",children:e.recentEvents.length})]}),n?S.jsx(T7,{events:e.recentEvents}):null]})]}):S.jsx("main",{className:"stage",children:S.jsxs("div",{className:"stage-idle",children:[S.jsx("p",{className:"stage-idle-mark","aria-hidden":"true",children:"▵"}),S.jsx("h2",{children:"Standing by"}),S.jsx("p",{children:"Select a job from the left rail, or dispatch carriers from a Fleet session."})]})})}const B7=H.memo(function({job:n}){const r=rh(n.status),a=n.startedAt?oA(n.startedAt,n.finishedAt??n.updatedAt):null;return S.jsxs("header",{className:"job-head",children:[S.jsxs("div",{className:"job-head-id",children:[S.jsx("span",{className:`status-dot status-dot--${r} status-dot--lg`,"aria-hidden":"true"}),S.jsxs("div",{children:[S.jsx("h2",{className:"job-title",children:n.label??Mp(n.jobId)}),S.jsxs("p",{className:"job-meta",children:[S.jsx("span",{className:`job-status job-status--${r}`,children:Dp(n.status)}),n.ownerCarrierId?S.jsxs("span",{children:["· ",n.ownerCarrierId]}):null,n.kind?S.jsxs("span",{children:["· ",n.kind]}):null,a?S.jsxs("span",{children:["· ",a]}):null,n.startedAt?S.jsxs("span",{children:["· started ",yS(n.startedAt)]}):null]})]})]}),S.jsx("code",{className:"job-id",title:n.jobId,children:Mp(n.jobId)})]})});function I7({summary:e,status:n,error:r}){return S.jsxs("aside",{className:`job-summary job-summary--${rh(n)}`,children:[S.jsx("p",{className:"job-summary-eyebrow",children:n==="error"?"Finalized with error":"Finalized"}),S.jsx("p",{className:"job-summary-text",children:e}),r?S.jsx("p",{className:"job-summary-error",children:r}):null]})}function j7({state:e}){const n=ek(e);return H.useEffect(()=>{const r=a=>{a.key==="Escape"&&Of()};return window.addEventListener("keydown",r),()=>window.removeEventListener("keydown",r)},[]),n?S.jsxs("div",{className:"job-overlay",role:"dialog","aria-modal":"true","aria-label":"Carrier job stream",children:[S.jsx("button",{type:"button",className:"job-overlay-scrim",onClick:Of,"aria-label":"Close job stream"}),S.jsxs("div",{className:"job-overlay-card",children:[S.jsx("button",{type:"button",className:"job-overlay-close",onClick:Of,"aria-label":"Close job stream",children:"×"}),S.jsx(N7,{job:n,timelineOpen:e.timelineOpen})]})]}):null}function z7({state:e}){return S.jsx("div",{className:"floating-job-overlay","data-canvas-blocker":!0,children:S.jsx(j7,{state:e})})}function $7({state:e}){const n=H.useRef(null),r=H.useMemo(()=>Pu(e),[e.sessions,e.sessionOrder,e.activeTheaterId]),a=H.useRef(e);return a.current=e,H.useEffect(()=>{nT(e.activeTheaterId),CA(e.activeTheaterId)},[e.activeTheaterId]),H.useEffect(()=>{const l=f=>{if(!f.altKey||f.metaKey||f.ctrlKey||f.key!=="ArrowLeft"&&f.key!=="ArrowRight")return;const m=document.activeElement;if(m instanceof HTMLElement&&m.matches("input, textarea, [contenteditable='true']")&&!m.closest(".xterm"))return;const c=Pu(a.current);if(c.length===0)return;f.preventDefault(),f.stopImmediatePropagation();const u=HA(c,a.current.activeTerminalSessionId,f.key==="ArrowRight"?1:-1);u&&Ng(u)};return window.addEventListener("keydown",l,!0),()=>window.removeEventListener("keydown",l,!0)},[]),H.useEffect(()=>{for(const l of r)eT(l);e.terminalSessionsHydrated&&tT(r)},[r,e.terminalSessionsHydrated]),H.useEffect(()=>{const l=e.pendingOperationFocus;if(l===null)return;let f=!1;return(async()=>{let c=l;if(e.sessions[l]?.status==="dormant")try{const y=await pS(l);if(f)return;sh(y),Hi(y.sessionId),c=y.sessionId}catch(y){f||jS(y instanceof Error?y.message:String(y)),Tb();return}if(f)return;const h=P7(n.current);h&&iT(c,h),Tb()})(),()=>{f=!0}},[e.pendingOperationFocus]),S.jsxs("div",{className:"console-body is-canvas",ref:n,children:[S.jsx(_7,{state:e}),S.jsx(z7,{state:e})]})}function P7(e){if(!e)return null;const n=e.getBoundingClientRect();return{width:n.width,height:n.height}}const H7=6e3;function U7(){const e=Fl(),n=Li(),r=n.pathname,a=Pl(),l=Zy(),f=LT(),m=DT(),c=aS(),u=r.startsWith("/codex"),h=H.useRef(n),y=H.useRef(!u),g=l&&r.startsWith("/operations"),C=u&&f!=="route"&&(y.current||m),E=C?f:"route",A=u&&E==="side",T=y.current?h.current:{pathname:"/operations",search:"",hash:"",state:null,key:"codex-fallback"},p=C?T:n,v=p.pathname.startsWith("/operations");H.useEffect(()=>I3(),[]),H.useEffect(()=>{u||(h.current=n,y.current=!0)},[u,n]),H.useEffect(()=>{DA(v)},[v]),H.useEffect(()=>{const{body:x}=document;return A?(x.dataset.codexSide="true",x.style.setProperty("--codex-side-width",`${c}px`)):(delete x.dataset.codexSide,x.style.removeProperty("--codex-side-width")),()=>{delete x.dataset.codexSide,x.style.removeProperty("--codex-side-width")}},[A,c]),H.useEffect(()=>{const x=document.querySelector(".topbar");if(!x)return;const L=()=>{document.documentElement.style.setProperty("--console-topbar-offset",`${Math.round(x.getBoundingClientRect().bottom)}px`)};L();const R=new ResizeObserver(L);return R.observe(x),window.addEventListener("resize",L),()=>{R.disconnect(),window.removeEventListener("resize",L)}},[]),H.useEffect(()=>{const x=new AbortController;uS(x.signal).then(M=>{OS(M),Lb()}).catch(M=>{x.signal.aborted||(He({theaterError:M instanceof Error?M.message:String(M)}),Lb())}),qT(x.signal).then(zA).catch(M=>{x.signal.aborted||He({terminalSessionError:M instanceof Error?M.message:String(M)})});const L=()=>{$T(e.activeTheaterId,x.signal).then(jA).catch(()=>{})};L();const R=window.setTimeout(L,H7);return()=>{window.clearTimeout(R),x.abort()}},[]),H.useEffect(()=>{const x=L=>{window.location.pathname.includes("/codex")||(L.metaKey||L.ctrlKey)&&L.key.toLowerCase()==="k"&&(L.preventDefault(),L.stopImmediatePropagation(),UA())};return window.addEventListener("keydown",x,!0),()=>window.removeEventListener("keydown",x,!0)},[]);const d=()=>{const x=h.current;y.current?a({pathname:x.pathname,search:x.search,hash:x.hash},{state:x.state}):a("/operations")},b=()=>{a("/codex"),MT("side")};return S.jsxs("div",{className:`console-shell ${g?"is-maximized":""}`,children:[S.jsx(i3,{state:e}),S.jsxs(o5,{location:p,children:[S.jsx(Ws,{path:"/",element:S.jsx(eb,{to:"/operations",replace:!0})}),S.jsx(Ws,{path:"/operations",element:S.jsx($7,{state:e})}),S.jsx(Ws,{path:"/carrier-settings",element:S.jsx(dR,{})}),S.jsx(Ws,{path:"/settings",element:S.jsx(sO,{})}),S.jsx(Ws,{path:"/codex/*",element:null}),S.jsx(Ws,{path:"*",element:S.jsx(eb,{to:"/operations",replace:!0})})]}),u?S.jsx(fD,{state:e,mode:E,onClose:d}):null,u?null:S.jsx(F7,{onOpen:b}),S.jsx(qk,{state:e}),S.jsx(Pk,{state:e}),S.jsx(A3,{state:e}),S.jsx(Tk,{state:e}),S.jsx(Xk,{open:e.connectionError!==null,tone:"error",title:"Console link interrupted",message:e.connectionError??void 0}),S.jsx(Rk,{})]})}function F7({onOpen:e}){return S.jsxs("button",{type:"button",className:"codex-edge-handle",onClick:e,"aria-label":"Open Codex side panel",title:"Codex (Side)",children:[S.jsx("span",{className:"codex-edge-handle-chevron","aria-hidden":"true",children:S.jsx("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:S.jsx("path",{d:"M9.5 4 5.5 8l4 4"})})}),S.jsx("span",{className:"codex-edge-handle-label",children:"Codex"})]})}OA();const Ay=document.querySelector("#app");Ay&&cE.createRoot(Ay).render(S.jsx(H.StrictMode,{children:S.jsx(M5,{basename:"/console",children:S.jsx(U7,{})})}));export{l6 as _,q7 as a,eE as g,St as k,Rl as p};
|