@dotobokuri/fleet-console 1.17.0 → 1.17.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/dist/client/assets/{_baseUniq-24vRkv8i.js → _baseUniq-B7sqIsqm.js} +1 -1
- package/dist/client/assets/{arc-BTiCiQ57.js → arc-CvtYLN8U.js} +1 -1
- package/dist/client/assets/{architectureDiagram-Q4EWVU46-B24oDJvB.js → architectureDiagram-Q4EWVU46-rlI7pNrR.js} +1 -1
- package/dist/client/assets/{blockDiagram-DXYQGD6D-BOAE3FdW.js → blockDiagram-DXYQGD6D-nwx9BNRz.js} +1 -1
- package/dist/client/assets/{c4Diagram-AHTNJAMY-C0W9raQx.js → c4Diagram-AHTNJAMY-CRL_0Ism.js} +1 -1
- package/dist/client/assets/channel-Ct9EqqyG.js +1 -0
- package/dist/client/assets/{chunk-4BX2VUAB-DvyhIkzo.js → chunk-4BX2VUAB-DEkncDR3.js} +1 -1
- package/dist/client/assets/{chunk-4TB4RGXK-CMV1UZLH.js → chunk-4TB4RGXK-Bnot0Ti1.js} +1 -1
- package/dist/client/assets/{chunk-55IACEB6-CG75wbs4.js → chunk-55IACEB6-EgKmMTlI.js} +1 -1
- package/dist/client/assets/{chunk-EDXVE4YY-9CjdVkNM.js → chunk-EDXVE4YY-BKiKnVQE.js} +1 -1
- package/dist/client/assets/{chunk-FMBD7UC4-i496V3zS.js → chunk-FMBD7UC4-BRC398vL.js} +1 -1
- package/dist/client/assets/{chunk-OYMX7WX6-CeRfBoEk.js → chunk-OYMX7WX6-D82gQaXN.js} +1 -1
- package/dist/client/assets/{chunk-QZHKN3VN-D1mXQVL_.js → chunk-QZHKN3VN-BYdI5fky.js} +1 -1
- package/dist/client/assets/{chunk-YZCP3GAM-DUXK6jpB.js → chunk-YZCP3GAM-BhBgOoc0.js} +1 -1
- package/dist/client/assets/classDiagram-6PBFFD2Q-CPMS8Qpo.js +1 -0
- package/dist/client/assets/classDiagram-v2-HSJHXN6E-CPMS8Qpo.js +1 -0
- package/dist/client/assets/clone-C5XNYXHD.js +1 -0
- package/dist/client/assets/{cose-bilkent-S5V4N54A-Cw97IMZH.js → cose-bilkent-S5V4N54A-J8dfEdWD.js} +1 -1
- package/dist/client/assets/{dagre-KV5264BT-CyY9URRi.js → dagre-KV5264BT-zGd_6_Kv.js} +1 -1
- package/dist/client/assets/{diagram-5BDNPKRD-BEVj5KaK.js → diagram-5BDNPKRD-BQpQGgZ3.js} +1 -1
- package/dist/client/assets/{diagram-G4DWMVQ6-IXOT_4VL.js → diagram-G4DWMVQ6-BbgPVITm.js} +1 -1
- package/dist/client/assets/{diagram-MMDJMWI5-CO2p0poL.js → diagram-MMDJMWI5-lJsMf0Ic.js} +1 -1
- package/dist/client/assets/{diagram-TYMM5635-DvRDFMNM.js → diagram-TYMM5635-BpEKTzOh.js} +1 -1
- package/dist/client/assets/{erDiagram-SMLLAGMA-C5uteguB.js → erDiagram-SMLLAGMA-CHHVwJ_a.js} +1 -1
- package/dist/client/assets/{flowDiagram-DWJPFMVM-JekEx60D.js → flowDiagram-DWJPFMVM-Cun8a4NF.js} +1 -1
- package/dist/client/assets/{ganttDiagram-T4ZO3ILL-DRKjnKDn.js → ganttDiagram-T4ZO3ILL-CGCwH_yf.js} +1 -1
- package/dist/client/assets/{gitGraphDiagram-UUTBAWPF-Dhnk3n7N.js → gitGraphDiagram-UUTBAWPF-BkY4qdoV.js} +1 -1
- package/dist/client/assets/{graph-DE-kEMug.js → graph-HbRzXQtt.js} +1 -1
- package/dist/client/assets/index-CzCMC0e-.js +402 -0
- package/dist/client/assets/{infoDiagram-42DDH7IO-DG9M_7T9.js → infoDiagram-42DDH7IO-B21Xtz8v.js} +1 -1
- package/dist/client/assets/{ishikawaDiagram-UXIWVN3A-CiP4wnqc.js → ishikawaDiagram-UXIWVN3A-DiABngEH.js} +1 -1
- package/dist/client/assets/{journeyDiagram-VCZTEJTY-DklSog3d.js → journeyDiagram-VCZTEJTY-BKZ-Uivu.js} +1 -1
- package/dist/client/assets/{kanban-definition-6JOO6SKY-BVB77h52.js → kanban-definition-6JOO6SKY-CoJzTtsH.js} +1 -1
- package/dist/client/assets/{layout-CAevigwv.js → layout-D5tmQpxt.js} +1 -1
- package/dist/client/assets/{linear-CB_shmWV.js → linear-B_riNOXk.js} +1 -1
- package/dist/client/assets/{mermaid.core-DPLCTlKT.js → mermaid.core-CyRCP3U3.js} +4 -4
- package/dist/client/assets/{min-Cimc7NFp.js → min-Cn8LZZXB.js} +1 -1
- package/dist/client/assets/{mindmap-definition-QFDTVHPH-DnyowBeF.js → mindmap-definition-QFDTVHPH-BN_7mZUt.js} +1 -1
- package/dist/client/assets/{pieDiagram-DEJITSTG-B1mr5ZWu.js → pieDiagram-DEJITSTG-DPP2-sYA.js} +1 -1
- package/dist/client/assets/{quadrantDiagram-34T5L4WZ-CJla4J4E.js → quadrantDiagram-34T5L4WZ-CQ_oo-f9.js} +1 -1
- package/dist/client/assets/{requirementDiagram-MS252O5E-Bduy03Er.js → requirementDiagram-MS252O5E-BkGq7nxD.js} +1 -1
- package/dist/client/assets/{sankeyDiagram-XADWPNL6-G7I_cbR7.js → sankeyDiagram-XADWPNL6-BVcoktBR.js} +1 -1
- package/dist/client/assets/{sequenceDiagram-FGHM5R23-D4Uf0SLt.js → sequenceDiagram-FGHM5R23-B5rr_VYJ.js} +1 -1
- package/dist/client/assets/{stateDiagram-FHFEXIEX-Fr0IevW-.js → stateDiagram-FHFEXIEX-BV8RqzB9.js} +1 -1
- package/dist/client/assets/stateDiagram-v2-QKLJ7IA2-Bx_fpQWQ.js +1 -0
- package/dist/client/assets/{timeline-definition-GMOUNBTQ-CzR6FMOJ.js → timeline-definition-GMOUNBTQ-CJ8TM-3t.js} +1 -1
- package/dist/client/assets/{vennDiagram-DHZGUBPP-CCzsRm3-.js → vennDiagram-DHZGUBPP-BETSq-Pu.js} +1 -1
- package/dist/client/assets/{wardley-RL74JXVD-C9U_HC7W.js → wardley-RL74JXVD-CyT2qapq.js} +1 -1
- package/dist/client/assets/{wardleyDiagram-NUSXRM2D-BkwkDUKo.js → wardleyDiagram-NUSXRM2D-CWHaiUEG.js} +1 -1
- package/dist/client/assets/{xychartDiagram-5P7HB3ND-CZ45hysw.js → xychartDiagram-5P7HB3ND-oVPlZ_Yn.js} +1 -1
- package/dist/client/index.html +1 -1
- package/package.json +1 -1
- package/dist/client/assets/channel-yb1CkB_S.js +0 -1
- package/dist/client/assets/classDiagram-6PBFFD2Q-DgNTT8Lb.js +0 -1
- package/dist/client/assets/classDiagram-v2-HSJHXN6E-DgNTT8Lb.js +0 -1
- package/dist/client/assets/clone-BLvG1gy6.js +0 -1
- package/dist/client/assets/index-BY_CeGCl.js +0 -402
- package/dist/client/assets/stateDiagram-v2-QKLJ7IA2-DXt_OYu8.js +0 -1
|
@@ -1,402 +0,0 @@
|
|
|
1
|
-
function AS(e,n){for(var i=0;i<n.length;i++){const s=n[i];if(typeof s!="string"&&!Array.isArray(s)){for(const o in s)if(o!=="default"&&!(o in e)){const f=Object.getOwnPropertyDescriptor(s,o);f&&Object.defineProperty(e,o,f.get?f:{enumerable:!0,get:()=>s[o]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const n=document.createElement("link").relList;if(n&&n.supports&&n.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))s(o);new MutationObserver(o=>{for(const f of o)if(f.type==="childList")for(const _ of f.addedNodes)_.tagName==="LINK"&&_.rel==="modulepreload"&&s(_)}).observe(document,{childList:!0,subtree:!0});function i(o){const f={};return o.integrity&&(f.integrity=o.integrity),o.referrerPolicy&&(f.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?f.credentials="include":o.crossOrigin==="anonymous"?f.credentials="omit":f.credentials="same-origin",f}function s(o){if(o.ep)return;o.ep=!0;const f=i(o);fetch(o.href,f)}})();function Vg(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function o9(e){if(Object.prototype.hasOwnProperty.call(e,"__esModule"))return e;var n=e.default;if(typeof n=="function"){var i=function s(){var o=!1;try{o=this instanceof s}catch{}return o?Reflect.construct(n,arguments,this.constructor):n.apply(this,arguments)};i.prototype=n.prototype}else i={};return Object.defineProperty(i,"__esModule",{value:!0}),Object.keys(e).forEach(function(s){var o=Object.getOwnPropertyDescriptor(e,s);Object.defineProperty(i,s,o.get?o:{enumerable:!0,get:function(){return e[s]}})}),i}var If={exports:{}},pl={};var yb;function w5(){if(yb)return pl;yb=1;var e=Symbol.for("react.transitional.element"),n=Symbol.for("react.fragment");function i(s,o,f){var _=null;if(f!==void 0&&(_=""+f),o.key!==void 0&&(_=""+o.key),"key"in o){f={};for(var c in o)c!=="key"&&(f[c]=o[c])}else f=o;return o=f.ref,{$$typeof:e,type:s,key:_,ref:o!==void 0?o:null,props:f}}return pl.Fragment=n,pl.jsx=i,pl.jsxs=i,pl}var Sb;function x5(){return Sb||(Sb=1,If.exports=w5()),If.exports}var u=x5();const C5=Vg(u),E5=AS({__proto__:null,default:C5},[u]);var Bf={exports:{}},We={};var wb;function k5(){if(wb)return We;wb=1;var e=Symbol.for("react.transitional.element"),n=Symbol.for("react.portal"),i=Symbol.for("react.fragment"),s=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),f=Symbol.for("react.consumer"),_=Symbol.for("react.context"),c=Symbol.for("react.forward_ref"),h=Symbol.for("react.suspense"),d=Symbol.for("react.memo"),y=Symbol.for("react.lazy"),p=Symbol.for("react.activity"),w=Symbol.iterator;function C(D){return D===null||typeof D!="object"?null:(D=w&&D[w]||D["@@iterator"],typeof D=="function"?D:null)}var T={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},E=Object.assign,g={};function v(D,U,G){this.props=D,this.context=U,this.refs=g,this.updater=G||T}v.prototype.isReactComponent={},v.prototype.setState=function(D,U){if(typeof D!="object"&&typeof D!="function"&&D!=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,D,U,"setState")},v.prototype.forceUpdate=function(D){this.updater.enqueueForceUpdate(this,D,"forceUpdate")};function m(){}m.prototype=v.prototype;function S(D,U,G){this.props=D,this.context=U,this.refs=g,this.updater=G||T}var k=S.prototype=new m;k.constructor=S,E(k,v.prototype),k.isPureReactComponent=!0;var L=Array.isArray;function R(){}var M={H:null,A:null,T:null,S:null},A=Object.prototype.hasOwnProperty;function B(D,U,G){var Y=G.ref;return{$$typeof:e,type:D,key:U,ref:Y!==void 0?Y:null,props:G}}function K(D,U){return B(D.type,U,D.props)}function F(D){return typeof D=="object"&&D!==null&&D.$$typeof===e}function W(D){var U={"=":"=0",":":"=2"};return"$"+D.replace(/[=:]/g,function(G){return U[G]})}var I=/\/+/g;function Z(D,U){return typeof D=="object"&&D!==null&&D.key!=null?W(""+D.key):U.toString(36)}function X(D){switch(D.status){case"fulfilled":return D.value;case"rejected":throw D.reason;default:switch(typeof D.status=="string"?D.then(R,R):(D.status="pending",D.then(function(U){D.status==="pending"&&(D.status="fulfilled",D.value=U)},function(U){D.status==="pending"&&(D.status="rejected",D.reason=U)})),D.status){case"fulfilled":return D.value;case"rejected":throw D.reason}}throw D}function z(D,U,G,Y,ie){var se=typeof D;(se==="undefined"||se==="boolean")&&(D=null);var J=!1;if(D===null)J=!0;else switch(se){case"bigint":case"string":case"number":J=!0;break;case"object":switch(D.$$typeof){case e:case n:J=!0;break;case y:return J=D._init,z(J(D._payload),U,G,Y,ie)}}if(J)return ie=ie(D),J=Y===""?"."+Z(D,0):Y,L(ie)?(G="",J!=null&&(G=J.replace(I,"$&/")+"/"),z(ie,U,G,"",function(de){return de})):ie!=null&&(F(ie)&&(ie=K(ie,G+(ie.key==null||D&&D.key===ie.key?"":(""+ie.key).replace(I,"$&/")+"/")+J)),U.push(ie)),1;J=0;var H=Y===""?".":Y+":";if(L(D))for(var ae=0;ae<D.length;ae++)Y=D[ae],se=H+Z(Y,ae),J+=z(Y,U,G,se,ie);else if(ae=C(D),typeof ae=="function")for(D=ae.call(D),ae=0;!(Y=D.next()).done;)Y=Y.value,se=H+Z(Y,ae++),J+=z(Y,U,G,se,ie);else if(se==="object"){if(typeof D.then=="function")return z(X(D),U,G,Y,ie);throw U=String(D),Error("Objects are not valid as a React child (found: "+(U==="[object Object]"?"object with keys {"+Object.keys(D).join(", ")+"}":U)+"). If you meant to render a collection of children, use an array instead.")}return J}function q(D,U,G){if(D==null)return D;var Y=[],ie=0;return z(D,Y,"","",function(se){return U.call(G,se,ie++)}),Y}function V(D){if(D._status===-1){var U=D._result;U=U(),U.then(function(G){(D._status===0||D._status===-1)&&(D._status=1,D._result=G)},function(G){(D._status===0||D._status===-1)&&(D._status=2,D._result=G)}),D._status===-1&&(D._status=0,D._result=U)}if(D._status===1)return D._result.default;throw D._result}var j=typeof reportError=="function"?reportError:function(D){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var U=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof D=="object"&&D!==null&&typeof D.message=="string"?String(D.message):String(D),error:D});if(!window.dispatchEvent(U))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",D);return}console.error(D)},P={map:q,forEach:function(D,U,G){q(D,function(){U.apply(this,arguments)},G)},count:function(D){var U=0;return q(D,function(){U++}),U},toArray:function(D){return q(D,function(U){return U})||[]},only:function(D){if(!F(D))throw Error("React.Children.only expected to receive a single React element child.");return D}};return We.Activity=p,We.Children=P,We.Component=v,We.Fragment=i,We.Profiler=o,We.PureComponent=S,We.StrictMode=s,We.Suspense=h,We.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=M,We.__COMPILER_RUNTIME={__proto__:null,c:function(D){return M.H.useMemoCache(D)}},We.cache=function(D){return function(){return D.apply(null,arguments)}},We.cacheSignal=function(){return null},We.cloneElement=function(D,U,G){if(D==null)throw Error("The argument must be a React element, but you passed "+D+".");var Y=E({},D.props),ie=D.key;if(U!=null)for(se in U.key!==void 0&&(ie=""+U.key),U)!A.call(U,se)||se==="key"||se==="__self"||se==="__source"||se==="ref"&&U.ref===void 0||(Y[se]=U[se]);var se=arguments.length-2;if(se===1)Y.children=G;else if(1<se){for(var J=Array(se),H=0;H<se;H++)J[H]=arguments[H+2];Y.children=J}return B(D.type,ie,Y)},We.createContext=function(D){return D={$$typeof:_,_currentValue:D,_currentValue2:D,_threadCount:0,Provider:null,Consumer:null},D.Provider=D,D.Consumer={$$typeof:f,_context:D},D},We.createElement=function(D,U,G){var Y,ie={},se=null;if(U!=null)for(Y in U.key!==void 0&&(se=""+U.key),U)A.call(U,Y)&&Y!=="key"&&Y!=="__self"&&Y!=="__source"&&(ie[Y]=U[Y]);var J=arguments.length-2;if(J===1)ie.children=G;else if(1<J){for(var H=Array(J),ae=0;ae<J;ae++)H[ae]=arguments[ae+2];ie.children=H}if(D&&D.defaultProps)for(Y in J=D.defaultProps,J)ie[Y]===void 0&&(ie[Y]=J[Y]);return B(D,se,ie)},We.createRef=function(){return{current:null}},We.forwardRef=function(D){return{$$typeof:c,render:D}},We.isValidElement=F,We.lazy=function(D){return{$$typeof:y,_payload:{_status:-1,_result:D},_init:V}},We.memo=function(D,U){return{$$typeof:d,type:D,compare:U===void 0?null:U}},We.startTransition=function(D){var U=M.T,G={};M.T=G;try{var Y=D(),ie=M.S;ie!==null&&ie(G,Y),typeof Y=="object"&&Y!==null&&typeof Y.then=="function"&&Y.then(R,j)}catch(se){j(se)}finally{U!==null&&G.types!==null&&(U.types=G.types),M.T=U}},We.unstable_useCacheRefresh=function(){return M.H.useCacheRefresh()},We.use=function(D){return M.H.use(D)},We.useActionState=function(D,U,G){return M.H.useActionState(D,U,G)},We.useCallback=function(D,U){return M.H.useCallback(D,U)},We.useContext=function(D){return M.H.useContext(D)},We.useDebugValue=function(){},We.useDeferredValue=function(D,U){return M.H.useDeferredValue(D,U)},We.useEffect=function(D,U){return M.H.useEffect(D,U)},We.useEffectEvent=function(D){return M.H.useEffectEvent(D)},We.useId=function(){return M.H.useId()},We.useImperativeHandle=function(D,U,G){return M.H.useImperativeHandle(D,U,G)},We.useInsertionEffect=function(D,U){return M.H.useInsertionEffect(D,U)},We.useLayoutEffect=function(D,U){return M.H.useLayoutEffect(D,U)},We.useMemo=function(D,U){return M.H.useMemo(D,U)},We.useOptimistic=function(D,U){return M.H.useOptimistic(D,U)},We.useReducer=function(D,U,G){return M.H.useReducer(D,U,G)},We.useRef=function(D){return M.H.useRef(D)},We.useState=function(D){return M.H.useState(D)},We.useSyncExternalStore=function(D,U,G){return M.H.useSyncExternalStore(D,U,G)},We.useTransition=function(){return M.H.useTransition()},We.version="19.2.7",We}var xb;function Yg(){return xb||(xb=1,Bf.exports=k5()),Bf.exports}var N=Yg();const T5=Vg(N),Qu=AS({__proto__:null,default:T5},[N]),A5="fc-operation-body";let qn=class extends Error{status;constructor(n,i){super(i),this.name="ApiError",this.status=n}};async function RS(e){const n=await fetch("/api/v1/operations/catalog",{signal:e});if(!n.ok)throw new qn(n.status,`Operation catalog request failed: ${n.status}`);const i=await n.json();return Array.isArray(i.plugins)?i.plugins.map(L5).filter(s=>s!==null):[]}function eh(e){const n=e;if(!n||typeof n.id!="string"||typeof n.theaterId!="string"||typeof n.type!="string"||typeof n.pluginId!="string"||typeof n.title!="string"||!n.payload||typeof n.payload!="object"||Array.isArray(n.payload)||LS(n))throw new qn(500,"Invalid operation response");return n}function LS(e){return zp(e,new Set(["canonicalCwd","cwd","persona","prompt","providerSession","ticket","token","toolAllowlist","tools","transcriptPath"]))}function R5({children:e,className:n}){return u.jsx("div",{className:N5(A5,n),children:e})}function L5(e){if(!MS(e)||typeof e.id!="string"||typeof e.title!="string"||!Array.isArray(e.kinds))return null;const n=e.kinds.map(M5).filter(i=>i!==null);return n.length===0?null:{id:e.id,title:e.title,kinds:n}}function M5(e){return!MS(e)||typeof e.id!="string"||typeof e.type!="string"||typeof e.title!="string"?null:{id:e.id,type:e.type,title:e.title,...typeof e.disabled=="boolean"?{disabled:e.disabled}:{},...typeof e.disabledReason=="string"?{disabledReason:e.disabledReason}:{}}}function MS(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function zp(e,n){return!e||typeof e!="object"?!1:Array.isArray(e)?e.some(i=>zp(i,n)):Object.entries(e).some(([i,s])=>n.has(i)||zp(s,n))}function N5(...e){return e.filter(n=>!!n).join(" ")}const O5=Object.freeze(Object.defineProperty({__proto__:null,ApiError:qn,OperationBody:R5,assertOperationNode:eh,fetchOperationCatalog:RS,hasForbiddenBrowserPayloadKey:LS},Symbol.toStringTag,{value:"Module"}));function D5(e){return e}function j5(e){return e}function NS(e=()=>{}){const n=new Set;return{api:{fetch:(i,s,o)=>fetch(Pf(i,s),o).then($5),subscribe:(i,s,o)=>{const f=new EventSource(Pf(i,s));f.onmessage=o;const _=()=>f.close();return n.add(_),()=>{_(),n.delete(_)}},resync:e},lifecycle:{onDispose:i=>(n.add(i),()=>n.delete(i))},terminal:{requestTicket:async(i,s,o,f)=>{const _=await fetch(Pf(i,s),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({operationId:o}),signal:f});if(!_.ok)throw new qn(_.status,`Terminal ticket request failed: ${_.status}`);const c=await _.json();if(typeof c.ticket!="string"||typeof c.ttlMs!="number")throw new qn(_.status,"Invalid terminal ticket response");return{ticket:c.ticket,ttlMs:c.ttlMs}}},notifications:{emit:()=>{},dismiss:()=>{}},operations:{create:async i=>{const s=await fetch("/api/v1/operations",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(i)});if(!s.ok)throw new qn(s.status,`Operation create failed: ${s.status}`);const o=await s.json();return eh(o.operation)},rename:async(i,s)=>{const o=await fetch(`/api/v1/operations/${encodeURIComponent(i)}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({title:s})});if(!o.ok)throw new qn(o.status,`Operation rename failed: ${o.status}`);const f=await o.json();return eh(f.operation)},remove:async i=>{const s=await fetch(`/api/v1/operations/${encodeURIComponent(i)}`,{method:"DELETE"});if(!s.ok)throw new qn(s.status,`Operation remove failed: ${s.status}`)}},preferences:{read:(i,s)=>F5(i,s),write:(i,s)=>W5(i,s)},settings:{read:async i=>{const s=await fetch(Cb(i));if(!s.ok)throw new qn(s.status,`Plugin settings read failed: ${s.status}`);const f=(await s.json()).value;return typeof f=="object"&&f!==null&&!Array.isArray(f)?f:null},write:async(i,s)=>{const o=await fetch(Cb(i),{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(s)});if(!o.ok)throw new qn(o.status,`Plugin settings write failed: ${o.status}`)}},status:{set:()=>{},clear:()=>{}}}}function OS(e,n){return N.useSyncExternalStore(e,n,n)}function I5(){const[e,n]=N.useState([]),i=N.useCallback(async()=>{const s=await fetch("/api/v1/operations");if(!s.ok)throw new qn(s.status,`Operations request failed: ${s.status}`);const o=await s.json();n(Array.isArray(o.operations)?o.operations.map(eh):[])},[]);return N.useEffect(()=>{i()},[i]),{operations:e,refresh:i}}function B5(e,n){return N.useMemo(()=>({fetch:(i,s)=>e.fetch(n,i,s),subscribe:(i,s)=>e.subscribe(n,i,s)}),[e,n])}function P5(e,n){return N.useMemo(()=>({read:()=>e.read(n),write:i=>e.write(n,i)}),[e,n])}function z5(e,n,i){const[s,o]=N.useState(()=>e.read(n,i)),f=N.useCallback(_=>{o(_),e.write(n,_)},[e,n]);return[s,f]}function H5(e,n){return N.useMemo(()=>({set:i=>e.set(n,i),clear:()=>e.clear(n)}),[e,n])}async function $5(e){if(!e.ok)throw new qn(e.status,`Plugin request failed: ${e.status}`);return e}function Pf(e,n){if(!/^[a-z0-9][a-z0-9._-]*$/i.test(e))throw new qn(400,"Invalid plugin id");const i=n.startsWith("/")?n:`/${n}`;if(i.includes(".."))throw new qn(400,"Invalid plugin path");return`/plugins/${e}${i}`}const U5=/^[a-z0-9][a-z0-9._-]*$/;function Cb(e){if(!U5.test(e))throw new qn(400,"Invalid plugin id");return`/api/v1/settings/plugins/${encodeURIComponent(e)}`}function F5(e,n){if(typeof window>"u")return n;try{const i=window.localStorage.getItem(`fleet-plugin.${e}`);return i===null?n:JSON.parse(i)}catch{return n}}function W5(e,n){if(!(typeof window>"u"))try{window.localStorage.setItem(`fleet-plugin.${e}`,JSON.stringify(n))}catch{}}const G5=Object.freeze(Object.defineProperty({__proto__:null,React:Qu,createClientCapabilities:NS,defineOperationKind:j5,definePlugin:D5,useOperationStatus:H5,useOperations:I5,usePluginApi:B5,usePluginSettings:P5,usePluginStorage:z5,useStoreSnapshot:OS},Symbol.toStringTag,{value:"Module"}));function q5(e){return e}function K5({title:e,description:n,children:i}){return u.jsxs("section",{className:"fc-settings-card",children:[e?u.jsx("h3",{className:"fc-settings-card__title",children:e}):null,n?u.jsx("p",{className:"fc-settings-card__desc",children:n}):null,u.jsx("div",{className:"fc-settings-card__body",children:i})]})}function V5({label:e,hint:n,children:i}){const s=N.useId(),o=N.useId();return u.jsxs("div",{className:"fc-settings-row",role:"group","aria-labelledby":s,"aria-describedby":n?o:void 0,children:[u.jsxs("div",{className:"fc-settings-row__copy",children:[u.jsx("div",{className:"fc-settings-row__label",id:s,children:e}),n?u.jsx("div",{className:"fc-settings-row__hint",id:o,children:n}):null]}),u.jsx("div",{className:"fc-settings-row__control",children:i})]})}function Y5({checked:e,onChange:n,label:i,disabled:s=!1}){const o=N.useId();return u.jsxs("label",{className:"fc-settings-toggle",htmlFor:o,children:[u.jsx("input",{id:o,className:"fc-settings-toggle__input",type:"checkbox",checked:e,disabled:s,"aria-label":i?void 0:"Toggle setting",onChange:f=>n(f.currentTarget.checked)}),u.jsx("span",{className:"fc-settings-toggle__control","aria-hidden":"true"}),i?u.jsx("span",{className:"fc-settings-toggle__label",children:i}):null]})}function X5({value:e,options:n,onChange:i,label:s,disabled:o=!1}){const f=N.useId(),_=u.jsx("select",{id:f,className:"fc-settings-select__control",value:e,disabled:o,"aria-label":s?void 0:"Select setting",onChange:c=>i(c.currentTarget.value),children:n.map(c=>u.jsx("option",{value:c.value,children:c.label},c.value))});return s?u.jsxs("label",{className:"fc-settings-select",htmlFor:f,children:[u.jsx("span",{className:"fc-settings-select__label",children:s}),_]}):u.jsx("div",{className:"fc-settings-select",children:_})}function Z5({label:e,hint:n,children:i}){const s=N.useId(),o=N.useId();return u.jsxs("div",{className:"fc-settings-field",role:"group","aria-labelledby":s,"aria-describedby":n?o:void 0,children:[u.jsx("div",{className:"fc-settings-field__label",id:s,children:e}),n?u.jsx("div",{className:"fc-settings-field__hint",id:o,children:n}):null,u.jsx("div",{className:"fc-settings-field__control",children:i})]})}const J5=Object.freeze(Object.defineProperty({__proto__:null,SettingsCard:K5,SettingsField:Z5,SettingsRow:V5,SettingsSelect:X5,SettingsToggle:Y5,defineSettingsSection:q5},Symbol.toStringTag,{value:"Module"}));function Q5(e){return e}const ek=Object.freeze(Object.defineProperty({__proto__:null,defineNotificationKind:Q5},Symbol.toStringTag,{value:"Module"})),tk=u.jsx("div",{className:"fc-plugin-error",children:"Plugin failed to render."});class Xg extends N.Component{state={hasError:!1};static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(n){this.props.onError?.(n)}render(){return this.state.hasError?this.props.fallback??tk:this.props.children}}const nk=Object.freeze(Object.defineProperty({__proto__:null,PluginErrorBoundary:Xg,React:Qu,default:Qu},Symbol.toStringTag,{value:"Module"}));var zf={exports:{}},gl={},Hf={exports:{}},$f={};var Eb;function ik(){return Eb||(Eb=1,(function(e){function n(z,q){var V=z.length;z.push(q);e:for(;0<V;){var j=V-1>>>1,P=z[j];if(0<o(P,q))z[j]=q,z[V]=P,V=j;else break e}}function i(z){return z.length===0?null:z[0]}function s(z){if(z.length===0)return null;var q=z[0],V=z.pop();if(V!==q){z[0]=V;e:for(var j=0,P=z.length,D=P>>>1;j<D;){var U=2*(j+1)-1,G=z[U],Y=U+1,ie=z[Y];if(0>o(G,V))Y<P&&0>o(ie,G)?(z[j]=ie,z[Y]=V,j=Y):(z[j]=G,z[U]=V,j=U);else if(Y<P&&0>o(ie,V))z[j]=ie,z[Y]=V,j=Y;else break e}}return q}function o(z,q){var V=z.sortIndex-q.sortIndex;return V!==0?V:z.id-q.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 _=Date,c=_.now();e.unstable_now=function(){return _.now()-c}}var h=[],d=[],y=1,p=null,w=3,C=!1,T=!1,E=!1,g=!1,v=typeof setTimeout=="function"?setTimeout:null,m=typeof clearTimeout=="function"?clearTimeout:null,S=typeof setImmediate<"u"?setImmediate:null;function k(z){for(var q=i(d);q!==null;){if(q.callback===null)s(d);else if(q.startTime<=z)s(d),q.sortIndex=q.expirationTime,n(h,q);else break;q=i(d)}}function L(z){if(E=!1,k(z),!T)if(i(h)!==null)T=!0,R||(R=!0,W());else{var q=i(d);q!==null&&X(L,q.startTime-z)}}var R=!1,M=-1,A=5,B=-1;function K(){return g?!0:!(e.unstable_now()-B<A)}function F(){if(g=!1,R){var z=e.unstable_now();B=z;var q=!0;try{e:{T=!1,E&&(E=!1,m(M),M=-1),C=!0;var V=w;try{t:{for(k(z),p=i(h);p!==null&&!(p.expirationTime>z&&K());){var j=p.callback;if(typeof j=="function"){p.callback=null,w=p.priorityLevel;var P=j(p.expirationTime<=z);if(z=e.unstable_now(),typeof P=="function"){p.callback=P,k(z),q=!0;break t}p===i(h)&&s(h),k(z)}else s(h);p=i(h)}if(p!==null)q=!0;else{var D=i(d);D!==null&&X(L,D.startTime-z),q=!1}}break e}finally{p=null,w=V,C=!1}q=void 0}}finally{q?W():R=!1}}}var W;if(typeof S=="function")W=function(){S(F)};else if(typeof MessageChannel<"u"){var I=new MessageChannel,Z=I.port2;I.port1.onmessage=F,W=function(){Z.postMessage(null)}}else W=function(){v(F,0)};function X(z,q){M=v(function(){z(e.unstable_now())},q)}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(z){z.callback=null},e.unstable_forceFrameRate=function(z){0>z||125<z?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):A=0<z?Math.floor(1e3/z):5},e.unstable_getCurrentPriorityLevel=function(){return w},e.unstable_next=function(z){switch(w){case 1:case 2:case 3:var q=3;break;default:q=w}var V=w;w=q;try{return z()}finally{w=V}},e.unstable_requestPaint=function(){g=!0},e.unstable_runWithPriority=function(z,q){switch(z){case 1:case 2:case 3:case 4:case 5:break;default:z=3}var V=w;w=z;try{return q()}finally{w=V}},e.unstable_scheduleCallback=function(z,q,V){var j=e.unstable_now();switch(typeof V=="object"&&V!==null?(V=V.delay,V=typeof V=="number"&&0<V?j+V:j):V=j,z){case 1:var P=-1;break;case 2:P=250;break;case 5:P=1073741823;break;case 4:P=1e4;break;default:P=5e3}return P=V+P,z={id:y++,callback:q,priorityLevel:z,startTime:V,expirationTime:P,sortIndex:-1},V>j?(z.sortIndex=V,n(d,z),i(h)===null&&z===i(d)&&(E?(m(M),M=-1):E=!0,X(L,V-j))):(z.sortIndex=P,n(h,z),T||C||(T=!0,R||(R=!0,W()))),z},e.unstable_shouldYield=K,e.unstable_wrapCallback=function(z){var q=w;return function(){var V=w;w=q;try{return z.apply(this,arguments)}finally{w=V}}}})($f)),$f}var kb;function rk(){return kb||(kb=1,Hf.exports=ik()),Hf.exports}var Uf={exports:{}},Hn={};var Tb;function sk(){if(Tb)return Hn;Tb=1;var e=Yg();function n(h){var d="https://react.dev/errors/"+h;if(1<arguments.length){d+="?args[]="+encodeURIComponent(arguments[1]);for(var y=2;y<arguments.length;y++)d+="&args[]="+encodeURIComponent(arguments[y])}return"Minified React error #"+h+"; visit "+d+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function i(){}var s={d:{f:i,r:function(){throw Error(n(522))},D:i,C:i,L:i,m:i,X:i,S:i,M:i},p:0,findDOMNode:null},o=Symbol.for("react.portal");function f(h,d,y){var p=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:o,key:p==null?null:""+p,children:h,containerInfo:d,implementation:y}}var _=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function c(h,d){if(h==="font")return"";if(typeof d=="string")return d==="use-credentials"?d:""}return Hn.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=s,Hn.createPortal=function(h,d){var y=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!d||d.nodeType!==1&&d.nodeType!==9&&d.nodeType!==11)throw Error(n(299));return f(h,d,null,y)},Hn.flushSync=function(h){var d=_.T,y=s.p;try{if(_.T=null,s.p=2,h)return h()}finally{_.T=d,s.p=y,s.d.f()}},Hn.preconnect=function(h,d){typeof h=="string"&&(d?(d=d.crossOrigin,d=typeof d=="string"?d==="use-credentials"?d:"":void 0):d=null,s.d.C(h,d))},Hn.prefetchDNS=function(h){typeof h=="string"&&s.d.D(h)},Hn.preinit=function(h,d){if(typeof h=="string"&&d&&typeof d.as=="string"){var y=d.as,p=c(y,d.crossOrigin),w=typeof d.integrity=="string"?d.integrity:void 0,C=typeof d.fetchPriority=="string"?d.fetchPriority:void 0;y==="style"?s.d.S(h,typeof d.precedence=="string"?d.precedence:void 0,{crossOrigin:p,integrity:w,fetchPriority:C}):y==="script"&&s.d.X(h,{crossOrigin:p,integrity:w,fetchPriority:C,nonce:typeof d.nonce=="string"?d.nonce:void 0})}},Hn.preinitModule=function(h,d){if(typeof h=="string")if(typeof d=="object"&&d!==null){if(d.as==null||d.as==="script"){var y=c(d.as,d.crossOrigin);s.d.M(h,{crossOrigin:y,integrity:typeof d.integrity=="string"?d.integrity:void 0,nonce:typeof d.nonce=="string"?d.nonce:void 0})}}else d==null&&s.d.M(h)},Hn.preload=function(h,d){if(typeof h=="string"&&typeof d=="object"&&d!==null&&typeof d.as=="string"){var y=d.as,p=c(y,d.crossOrigin);s.d.L(h,y,{crossOrigin:p,integrity:typeof d.integrity=="string"?d.integrity:void 0,nonce:typeof d.nonce=="string"?d.nonce:void 0,type:typeof d.type=="string"?d.type:void 0,fetchPriority:typeof d.fetchPriority=="string"?d.fetchPriority:void 0,referrerPolicy:typeof d.referrerPolicy=="string"?d.referrerPolicy:void 0,imageSrcSet:typeof d.imageSrcSet=="string"?d.imageSrcSet:void 0,imageSizes:typeof d.imageSizes=="string"?d.imageSizes:void 0,media:typeof d.media=="string"?d.media:void 0})}},Hn.preloadModule=function(h,d){if(typeof h=="string")if(d){var y=c(d.as,d.crossOrigin);s.d.m(h,{as:typeof d.as=="string"&&d.as!=="script"?d.as:void 0,crossOrigin:y,integrity:typeof d.integrity=="string"?d.integrity:void 0})}else s.d.m(h)},Hn.requestFormReset=function(h){s.d.r(h)},Hn.unstable_batchedUpdates=function(h,d){return h(d)},Hn.useFormState=function(h,d,y){return _.H.useFormState(h,d,y)},Hn.useFormStatus=function(){return _.H.useHostTransitionStatus()},Hn.version="19.2.7",Hn}var Ab;function DS(){if(Ab)return Uf.exports;Ab=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(),Uf.exports=sk(),Uf.exports}var Rb;function ak(){if(Rb)return gl;Rb=1;var e=rk(),n=Yg(),i=DS();function s(t){var r="https://react.dev/errors/"+t;if(1<arguments.length){r+="?args[]="+encodeURIComponent(arguments[1]);for(var a=2;a<arguments.length;a++)r+="&args[]="+encodeURIComponent(arguments[a])}return"Minified React error #"+t+"; visit "+r+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function o(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)}function f(t){var r=t,a=t;if(t.alternate)for(;r.return;)r=r.return;else{t=r;do r=t,(r.flags&4098)!==0&&(a=r.return),t=r.return;while(t)}return r.tag===3?a:null}function _(t){if(t.tag===13){var r=t.memoizedState;if(r===null&&(t=t.alternate,t!==null&&(r=t.memoizedState)),r!==null)return r.dehydrated}return null}function c(t){if(t.tag===31){var r=t.memoizedState;if(r===null&&(t=t.alternate,t!==null&&(r=t.memoizedState)),r!==null)return r.dehydrated}return null}function h(t){if(f(t)!==t)throw Error(s(188))}function d(t){var r=t.alternate;if(!r){if(r=f(t),r===null)throw Error(s(188));return r!==t?null:t}for(var a=t,l=r;;){var b=a.return;if(b===null)break;var x=b.alternate;if(x===null){if(l=b.return,l!==null){a=l;continue}break}if(b.child===x.child){for(x=b.child;x;){if(x===a)return h(b),t;if(x===l)return h(b),r;x=x.sibling}throw Error(s(188))}if(a.return!==l.return)a=b,l=x;else{for(var O=!1,$=b.child;$;){if($===a){O=!0,a=b,l=x;break}if($===l){O=!0,l=b,a=x;break}$=$.sibling}if(!O){for($=x.child;$;){if($===a){O=!0,a=x,l=b;break}if($===l){O=!0,l=x,a=b;break}$=$.sibling}if(!O)throw Error(s(189))}}if(a.alternate!==l)throw Error(s(190))}if(a.tag!==3)throw Error(s(188));return a.stateNode.current===a?t:r}function y(t){var r=t.tag;if(r===5||r===26||r===27||r===6)return t;for(t=t.child;t!==null;){if(r=y(t),r!==null)return r;t=t.sibling}return null}var p=Object.assign,w=Symbol.for("react.element"),C=Symbol.for("react.transitional.element"),T=Symbol.for("react.portal"),E=Symbol.for("react.fragment"),g=Symbol.for("react.strict_mode"),v=Symbol.for("react.profiler"),m=Symbol.for("react.consumer"),S=Symbol.for("react.context"),k=Symbol.for("react.forward_ref"),L=Symbol.for("react.suspense"),R=Symbol.for("react.suspense_list"),M=Symbol.for("react.memo"),A=Symbol.for("react.lazy"),B=Symbol.for("react.activity"),K=Symbol.for("react.memo_cache_sentinel"),F=Symbol.iterator;function W(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 Z(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 E:return"Fragment";case v:return"Profiler";case g:return"StrictMode";case L:return"Suspense";case R:return"SuspenseList";case B:return"Activity"}if(typeof t=="object")switch(t.$$typeof){case T:return"Portal";case S:return t.displayName||"Context";case m:return(t._context.displayName||"Context")+".Consumer";case k:var r=t.render;return t=t.displayName,t||(t=r.displayName||r.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case M:return r=t.displayName||null,r!==null?r:Z(t.type)||"Memo";case A:r=t._payload,t=t._init;try{return Z(t(r))}catch{}}return null}var X=Array.isArray,z=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,q=i.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,V={pending:!1,data:null,method:null,action:null},j=[],P=-1;function D(t){return{current:t}}function U(t){0>P||(t.current=j[P],j[P]=null,P--)}function G(t,r){P++,j[P]=t.current,t.current=r}var Y=D(null),ie=D(null),se=D(null),J=D(null);function H(t,r){switch(G(se,r),G(ie,t),G(Y,null),r.nodeType){case 9:case 11:t=(t=r.documentElement)&&(t=t.namespaceURI)?F0(t):0;break;default:if(t=r.tagName,r=r.namespaceURI)r=F0(r),t=W0(r,t);else switch(t){case"svg":t=1;break;case"math":t=2;break;default:t=0}}U(Y),G(Y,t)}function ae(){U(Y),U(ie),U(se)}function de(t){t.memoizedState!==null&&G(J,t);var r=Y.current,a=W0(r,t.type);r!==a&&(G(ie,t),G(Y,a))}function we(t){ie.current===t&&(U(Y),U(ie)),J.current===t&&(U(J),ul._currentValue=V)}var ye,Le;function Oe(t){if(ye===void 0)try{throw Error()}catch(a){var r=a.stack.trim().match(/\n( *(at )?)/);ye=r&&r[1]||"",Le=-1<a.stack.indexOf(`
|
|
2
|
-
at`)?" (<anonymous>)":-1<a.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
3
|
-
`+ye+t+Le}var Fe=!1;function ut(t,r){if(!t||Fe)return"";Fe=!0;var a=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var l={DetermineComponentFrameRoot:function(){try{if(r){var me=function(){throw Error()};if(Object.defineProperty(me.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(me,[])}catch(he){var ue=he}Reflect.construct(t,[],me)}else{try{me.call()}catch(he){ue=he}t.call(me.prototype)}}else{try{throw Error()}catch(he){ue=he}(me=t())&&typeof me.catch=="function"&&me.catch(function(){})}}catch(he){if(he&&ue&&typeof he.stack=="string")return[he.stack,ue.stack]}return[null,null]}};l.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var b=Object.getOwnPropertyDescriptor(l.DetermineComponentFrameRoot,"name");b&&b.configurable&&Object.defineProperty(l.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var x=l.DetermineComponentFrameRoot(),O=x[0],$=x[1];if(O&&$){var te=O.split(`
|
|
4
|
-
`),ce=$.split(`
|
|
5
|
-
`);for(b=l=0;l<te.length&&!te[l].includes("DetermineComponentFrameRoot");)l++;for(;b<ce.length&&!ce[b].includes("DetermineComponentFrameRoot");)b++;if(l===te.length||b===ce.length)for(l=te.length-1,b=ce.length-1;1<=l&&0<=b&&te[l]!==ce[b];)b--;for(;1<=l&&0<=b;l--,b--)if(te[l]!==ce[b]){if(l!==1||b!==1)do if(l--,b--,0>b||te[l]!==ce[b]){var fe=`
|
|
6
|
-
`+te[l].replace(" at new "," at ");return t.displayName&&fe.includes("<anonymous>")&&(fe=fe.replace("<anonymous>",t.displayName)),fe}while(1<=l&&0<=b);break}}}finally{Fe=!1,Error.prepareStackTrace=a}return(a=t?t.displayName||t.name:"")?Oe(a):""}function Me(t,r){switch(t.tag){case 26:case 27:case 5:return Oe(t.type);case 16:return Oe("Lazy");case 13:return t.child!==r&&r!==null?Oe("Suspense Fallback"):Oe("Suspense");case 19:return Oe("SuspenseList");case 0:case 15:return ut(t.type,!1);case 11:return ut(t.type.render,!1);case 1:return ut(t.type,!0);case 31:return Oe("Activity");default:return""}}function Rt(t){try{var r="",a=null;do r+=Me(t,a),a=t,t=t.return;while(t);return r}catch(l){return`
|
|
7
|
-
Error generating stack: `+l.message+`
|
|
8
|
-
`+l.stack}}var Xt=Object.prototype.hasOwnProperty,vn=e.unstable_scheduleCallback,an=e.unstable_cancelCallback,kn=e.unstable_shouldYield,Zt=e.unstable_requestPaint,ht=e.unstable_now,Lt=e.unstable_getCurrentPriorityLevel,Ct=e.unstable_ImmediatePriority,Ft=e.unstable_UserBlockingPriority,Kt=e.unstable_NormalPriority,Jn=e.unstable_LowPriority,bn=e.unstable_IdlePriority,Pn=e.log,ft=e.unstable_setDisableYieldValue,Tn=null,ve=null;function $e(t){if(typeof Pn=="function"&&ft(t),ve&&typeof ve.setStrictMode=="function")try{ve.setStrictMode(Tn,t)}catch{}}var Ze=Math.clz32?Math.clz32:on,at=Math.log,Ve=Math.LN2;function on(t){return t>>>=0,t===0?32:31-(at(t)/Ve|0)|0}var Dt=256,An=262144,Un=4194304;function jt(t){var r=t&42;if(r!==0)return r;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 ee(t,r,a){var l=t.pendingLanes;if(l===0)return 0;var b=0,x=t.suspendedLanes,O=t.pingedLanes;t=t.warmLanes;var $=l&134217727;return $!==0?(l=$&~x,l!==0?b=jt(l):(O&=$,O!==0?b=jt(O):a||(a=$&~t,a!==0&&(b=jt(a))))):($=l&~x,$!==0?b=jt($):O!==0?b=jt(O):a||(a=l&~t,a!==0&&(b=jt(a)))),b===0?0:r!==0&&r!==b&&(r&x)===0&&(x=b&-b,a=r&-r,x>=a||x===32&&(a&4194048)!==0)?r:b}function pe(t,r){return(t.pendingLanes&~(t.suspendedLanes&~t.pingedLanes)&r)===0}function Se(t,r){switch(t){case 1:case 2:case 4:case 8:case 64:return r+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 r+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 je(){var t=Un;return Un<<=1,(Un&62914560)===0&&(Un=4194304),t}function bt(t){for(var r=[],a=0;31>a;a++)r.push(t);return r}function dt(t,r){t.pendingLanes|=r,r!==268435456&&(t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0)}function ke(t,r,a,l,b,x){var O=t.pendingLanes;t.pendingLanes=a,t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0,t.expiredLanes&=a,t.entangledLanes&=a,t.errorRecoveryDisabledLanes&=a,t.shellSuspendCounter=0;var $=t.entanglements,te=t.expirationTimes,ce=t.hiddenUpdates;for(a=O&~a;0<a;){var fe=31-Ze(a),me=1<<fe;$[fe]=0,te[fe]=-1;var ue=ce[fe];if(ue!==null)for(ce[fe]=null,fe=0;fe<ue.length;fe++){var he=ue[fe];he!==null&&(he.lane&=-536870913)}a&=~me}l!==0&&Ce(t,l,0),x!==0&&b===0&&t.tag!==0&&(t.suspendedLanes|=x&~(O&~r))}function Ce(t,r,a){t.pendingLanes|=r,t.suspendedLanes&=~r;var l=31-Ze(r);t.entangledLanes|=r,t.entanglements[l]=t.entanglements[l]|1073741824|a&261930}function Pe(t,r){var a=t.entangledLanes|=r;for(t=t.entanglements;a;){var l=31-Ze(a),b=1<<l;b&r|t[l]&r&&(t[l]|=r),a&=~b}}function Vt(t,r){var a=r&-r;return a=(a&42)!==0?1:nt(a),(a&(t.suspendedLanes|r))!==0?0:a}function nt(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 Rn(t){return t&=-t,2<t?8<t?(t&134217727)!==0?32:268435456:8:2}function dr(){var t=q.p;return t!==0?t:(t=window.event,t===void 0?32:fb(t.type))}function fr(t,r){var a=q.p;try{return q.p=t,r()}finally{q.p=a}}var Qn=Math.random().toString(36).slice(2),It="__reactFiber$"+Qn,Nt="__reactProps$"+Qn,Fi="__reactContainer$"+Qn,Wr="__reactEvents$"+Qn,ua="__reactListeners$"+Qn,pr="__reactHandles$"+Qn,Rs="__reactResources$"+Qn,er="__reactMarker$"+Qn;function De(t){delete t[It],delete t[Nt],delete t[Wr],delete t[ua],delete t[pr]}function Q(t){var r=t[It];if(r)return r;for(var a=t.parentNode;a;){if(r=a[Fi]||a[It]){if(a=r.alternate,r.child!==null||a!==null&&a.child!==null)for(t=Z0(t);t!==null;){if(a=t[It])return a;t=Z0(t)}return r}t=a,a=t.parentNode}return null}function _e(t){if(t=t[It]||t[Fi]){var r=t.tag;if(r===5||r===6||r===13||r===31||r===26||r===27||r===3)return t}return null}function Ee(t){var r=t.tag;if(r===5||r===26||r===27||r===6)return t.stateNode;throw Error(s(33))}function ot(t){var r=t[Rs];return r||(r=t[Rs]={hoistableStyles:new Map,hoistableScripts:new Map}),r}function Je(t){t[er]=!0}var Bt=new Set,Jt={};function Qt(t,r){be(t,r),be(t+"Capture",r)}function be(t,r){for(Jt[t]=r,t=0;t<r.length;t++)Bt.add(r[t])}var Ne=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]*$"),Ie={},pt={};function Wt(t){return Xt.call(pt,t)?!0:Xt.call(Ie,t)?!1:Ne.test(t)?pt[t]=!0:(Ie[t]=!0,!1)}function zn(t,r,a){if(Wt(r))if(a===null)t.removeAttribute(r);else{switch(typeof a){case"undefined":case"function":case"symbol":t.removeAttribute(r);return;case"boolean":var l=r.toLowerCase().slice(0,5);if(l!=="data-"&&l!=="aria-"){t.removeAttribute(r);return}}t.setAttribute(r,""+a)}}function hi(t,r,a){if(a===null)t.removeAttribute(r);else{switch(typeof a){case"undefined":case"function":case"symbol":case"boolean":t.removeAttribute(r);return}t.setAttribute(r,""+a)}}function ei(t,r,a,l){if(l===null)t.removeAttribute(a);else{switch(typeof l){case"undefined":case"function":case"symbol":case"boolean":t.removeAttribute(a);return}t.setAttributeNS(r,a,""+l)}}function Ot(t){switch(typeof t){case"bigint":case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function di(t){var r=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(r==="checkbox"||r==="radio")}function oc(t,r,a){var l=Object.getOwnPropertyDescriptor(t.constructor.prototype,r);if(!t.hasOwnProperty(r)&&typeof l<"u"&&typeof l.get=="function"&&typeof l.set=="function"){var b=l.get,x=l.set;return Object.defineProperty(t,r,{configurable:!0,get:function(){return b.call(this)},set:function(O){a=""+O,x.call(this,O)}}),Object.defineProperty(t,r,{enumerable:l.enumerable}),{getValue:function(){return a},setValue:function(O){a=""+O},stopTracking:function(){t._valueTracker=null,delete t[r]}}}}function ha(t){if(!t._valueTracker){var r=di(t)?"checked":"value";t._valueTracker=oc(t,r,""+t[r])}}function xo(t){if(!t)return!1;var r=t._valueTracker;if(!r)return!0;var a=r.getValue(),l="";return t&&(l=di(t)?t.checked?"true":"false":t.value),t=l,t!==a?(r.setValue(t),!0):!1}function da(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 Dh=/[\n"\\]/g;function ti(t){return t.replace(Dh,function(r){return"\\"+r.charCodeAt(0).toString(16)+" "})}function Co(t,r,a,l,b,x,O,$){t.name="",O!=null&&typeof O!="function"&&typeof O!="symbol"&&typeof O!="boolean"?t.type=O:t.removeAttribute("type"),r!=null?O==="number"?(r===0&&t.value===""||t.value!=r)&&(t.value=""+Ot(r)):t.value!==""+Ot(r)&&(t.value=""+Ot(r)):O!=="submit"&&O!=="reset"||t.removeAttribute("value"),r!=null?fa(t,O,Ot(r)):a!=null?fa(t,O,Ot(a)):l!=null&&t.removeAttribute("value"),b==null&&x!=null&&(t.defaultChecked=!!x),b!=null&&(t.checked=b&&typeof b!="function"&&typeof b!="symbol"),$!=null&&typeof $!="function"&&typeof $!="symbol"&&typeof $!="boolean"?t.name=""+Ot($):t.removeAttribute("name")}function Ls(t,r,a,l,b,x,O,$){if(x!=null&&typeof x!="function"&&typeof x!="symbol"&&typeof x!="boolean"&&(t.type=x),r!=null||a!=null){if(!(x!=="submit"&&x!=="reset"||r!=null)){ha(t);return}a=a!=null?""+Ot(a):"",r=r!=null?""+Ot(r):a,$||r===t.value||(t.value=r),t.defaultValue=r}l=l??b,l=typeof l!="function"&&typeof l!="symbol"&&!!l,t.checked=$?t.checked:!!l,t.defaultChecked=!!l,O!=null&&typeof O!="function"&&typeof O!="symbol"&&typeof O!="boolean"&&(t.name=O),ha(t)}function fa(t,r,a){r==="number"&&da(t.ownerDocument)===t||t.defaultValue===""+a||(t.defaultValue=""+a)}function Ln(t,r,a,l){if(t=t.options,r){r={};for(var b=0;b<a.length;b++)r["$"+a[b]]=!0;for(a=0;a<t.length;a++)b=r.hasOwnProperty("$"+t[a].value),t[a].selected!==b&&(t[a].selected=b),b&&l&&(t[a].defaultSelected=!0)}else{for(a=""+Ot(a),r=null,b=0;b<t.length;b++){if(t[b].value===a){t[b].selected=!0,l&&(t[b].defaultSelected=!0);return}r!==null||t[b].disabled||(r=t[b])}r!==null&&(r.selected=!0)}}function lc(t,r,a){if(r!=null&&(r=""+Ot(r),r!==t.value&&(t.value=r),a==null)){t.defaultValue!==r&&(t.defaultValue=r);return}t.defaultValue=a!=null?""+Ot(a):""}function pa(t,r,a,l){if(r==null){if(l!=null){if(a!=null)throw Error(s(92));if(X(l)){if(1<l.length)throw Error(s(93));l=l[0]}a=l}a==null&&(a=""),r=a}a=Ot(r),t.defaultValue=a,l=t.textContent,l===a&&l!==""&&l!==null&&(t.value=l),ha(t)}function Ue(t,r){if(r){var a=t.firstChild;if(a&&a===t.lastChild&&a.nodeType===3){a.nodeValue=r;return}}t.textContent=r}var cc=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 hn(t,r,a){var l=r.indexOf("--")===0;a==null||typeof a=="boolean"||a===""?l?t.setProperty(r,""):r==="float"?t.cssFloat="":t[r]="":l?t.setProperty(r,a):typeof a!="number"||a===0||cc.has(r)?r==="float"?t.cssFloat=a:t[r]=(""+a).trim():t[r]=a+"px"}function yt(t,r,a){if(r!=null&&typeof r!="object")throw Error(s(62));if(t=t.style,a!=null){for(var l in a)!a.hasOwnProperty(l)||r!=null&&r.hasOwnProperty(l)||(l.indexOf("--")===0?t.setProperty(l,""):l==="float"?t.cssFloat="":t[l]="");for(var b in r)l=r[b],r.hasOwnProperty(b)&&a[b]!==l&&hn(t,b,l)}else for(var x in r)r.hasOwnProperty(x)&&hn(t,x,r[x])}function Gr(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 gr=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"]]),Eo=/^[\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 qr(t){return Eo.test(""+t)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":t}function xe(){}var Ae=null;function Ge(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var it=null,Yt=null;function Ei(t){var r=_e(t);if(r&&(t=r.stateNode)){var a=t[Nt]||null;e:switch(t=r.stateNode,r.type){case"input":if(Co(t,a.value,a.defaultValue,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name),r=a.name,a.type==="radio"&&r!=null){for(a=t;a.parentNode;)a=a.parentNode;for(a=a.querySelectorAll('input[name="'+ti(""+r)+'"][type="radio"]'),r=0;r<a.length;r++){var l=a[r];if(l!==t&&l.form===t.form){var b=l[Nt]||null;if(!b)throw Error(s(90));Co(l,b.value,b.defaultValue,b.defaultValue,b.checked,b.defaultChecked,b.type,b.name)}}for(r=0;r<a.length;r++)l=a[r],l.form===t.form&&xo(l)}break e;case"textarea":lc(t,a.value,a.defaultValue);break e;case"select":r=a.value,r!=null&&Ln(t,!!a.multiple,r,!1)}}}var ko=!1;function uc(t,r,a){if(ko)return t(r,a);ko=!0;try{var l=t(r);return l}finally{if(ko=!1,(it!==null||Yt!==null)&&(Zc(),it&&(r=it,t=Yt,Yt=it=null,Ei(r),t)))for(r=0;r<t.length;r++)Ei(t[r])}}function To(t,r){var a=t.stateNode;if(a===null)return null;var l=a[Nt]||null;if(l===null)return null;a=l[r];e:switch(r){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(l=!l.disabled)||(t=t.type,l=!(t==="button"||t==="input"||t==="select"||t==="textarea")),t=!l;break e;default:t=!1}if(t)return null;if(a&&typeof a!="function")throw Error(s(231,r,typeof a));return a}var mr=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),jh=!1;if(mr)try{var Ao={};Object.defineProperty(Ao,"passive",{get:function(){jh=!0}}),window.addEventListener("test",Ao,Ao),window.removeEventListener("test",Ao,Ao)}catch{jh=!1}var Kr=null,Ih=null,hc=null;function Wm(){if(hc)return hc;var t,r=Ih,a=r.length,l,b="value"in Kr?Kr.value:Kr.textContent,x=b.length;for(t=0;t<a&&r[t]===b[t];t++);var O=a-t;for(l=1;l<=O&&r[a-l]===b[x-l];l++);return hc=b.slice(t,1<l?1-l:void 0)}function dc(t){var r=t.keyCode;return"charCode"in t?(t=t.charCode,t===0&&r===13&&(t=13)):t=r,t===10&&(t=13),32<=t||t===13?t:0}function fc(){return!0}function Gm(){return!1}function ni(t){function r(a,l,b,x,O){this._reactName=a,this._targetInst=b,this.type=l,this.nativeEvent=x,this.target=O,this.currentTarget=null;for(var $ in t)t.hasOwnProperty($)&&(a=t[$],this[$]=a?a(x):x[$]);return this.isDefaultPrevented=(x.defaultPrevented!=null?x.defaultPrevented:x.returnValue===!1)?fc:Gm,this.isPropagationStopped=Gm,this}return p(r.prototype,{preventDefault:function(){this.defaultPrevented=!0;var a=this.nativeEvent;a&&(a.preventDefault?a.preventDefault():typeof a.returnValue!="unknown"&&(a.returnValue=!1),this.isDefaultPrevented=fc)},stopPropagation:function(){var a=this.nativeEvent;a&&(a.stopPropagation?a.stopPropagation():typeof a.cancelBubble!="unknown"&&(a.cancelBubble=!0),this.isPropagationStopped=fc)},persist:function(){},isPersistent:fc}),r}var Ms={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(t){return t.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},pc=ni(Ms),Ro=p({},Ms,{view:0,detail:0}),y2=ni(Ro),Bh,Ph,Lo,gc=p({},Ro,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Hh,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!==Lo&&(Lo&&t.type==="mousemove"?(Bh=t.screenX-Lo.screenX,Ph=t.screenY-Lo.screenY):Ph=Bh=0,Lo=t),Bh)},movementY:function(t){return"movementY"in t?t.movementY:Ph}}),qm=ni(gc),S2=p({},gc,{dataTransfer:0}),w2=ni(S2),x2=p({},Ro,{relatedTarget:0}),zh=ni(x2),C2=p({},Ms,{animationName:0,elapsedTime:0,pseudoElement:0}),E2=ni(C2),k2=p({},Ms,{clipboardData:function(t){return"clipboardData"in t?t.clipboardData:window.clipboardData}}),T2=ni(k2),A2=p({},Ms,{data:0}),Km=ni(A2),R2={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},L2={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"},M2={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function N2(t){var r=this.nativeEvent;return r.getModifierState?r.getModifierState(t):(t=M2[t])?!!r[t]:!1}function Hh(){return N2}var O2=p({},Ro,{key:function(t){if(t.key){var r=R2[t.key]||t.key;if(r!=="Unidentified")return r}return t.type==="keypress"?(t=dc(t),t===13?"Enter":String.fromCharCode(t)):t.type==="keydown"||t.type==="keyup"?L2[t.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Hh,charCode:function(t){return t.type==="keypress"?dc(t):0},keyCode:function(t){return t.type==="keydown"||t.type==="keyup"?t.keyCode:0},which:function(t){return t.type==="keypress"?dc(t):t.type==="keydown"||t.type==="keyup"?t.keyCode:0}}),D2=ni(O2),j2=p({},gc,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Vm=ni(j2),I2=p({},Ro,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Hh}),B2=ni(I2),P2=p({},Ms,{propertyName:0,elapsedTime:0,pseudoElement:0}),z2=ni(P2),H2=p({},gc,{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}),$2=ni(H2),U2=p({},Ms,{newState:0,oldState:0}),F2=ni(U2),W2=[9,13,27,32],$h=mr&&"CompositionEvent"in window,Mo=null;mr&&"documentMode"in document&&(Mo=document.documentMode);var G2=mr&&"TextEvent"in window&&!Mo,Ym=mr&&(!$h||Mo&&8<Mo&&11>=Mo),Xm=" ",Zm=!1;function Jm(t,r){switch(t){case"keyup":return W2.indexOf(r.keyCode)!==-1;case"keydown":return r.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Qm(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var ga=!1;function q2(t,r){switch(t){case"compositionend":return Qm(r);case"keypress":return r.which!==32?null:(Zm=!0,Xm);case"textInput":return t=r.data,t===Xm&&Zm?null:t;default:return null}}function K2(t,r){if(ga)return t==="compositionend"||!$h&&Jm(t,r)?(t=Wm(),hc=Ih=Kr=null,ga=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(r.ctrlKey||r.altKey||r.metaKey)||r.ctrlKey&&r.altKey){if(r.char&&1<r.char.length)return r.char;if(r.which)return String.fromCharCode(r.which)}return null;case"compositionend":return Ym&&r.locale!=="ko"?null:r.data;default:return null}}var V2={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 e_(t){var r=t&&t.nodeName&&t.nodeName.toLowerCase();return r==="input"?!!V2[t.type]:r==="textarea"}function t_(t,r,a,l){it?Yt?Yt.push(l):Yt=[l]:it=l,r=ru(r,"onChange"),0<r.length&&(a=new pc("onChange","change",null,a,l),t.push({event:a,listeners:r}))}var No=null,Oo=null;function Y2(t){B0(t,0)}function mc(t){var r=Ee(t);if(xo(r))return t}function n_(t,r){if(t==="change")return r}var i_=!1;if(mr){var Uh;if(mr){var Fh="oninput"in document;if(!Fh){var r_=document.createElement("div");r_.setAttribute("oninput","return;"),Fh=typeof r_.oninput=="function"}Uh=Fh}else Uh=!1;i_=Uh&&(!document.documentMode||9<document.documentMode)}function s_(){No&&(No.detachEvent("onpropertychange",a_),Oo=No=null)}function a_(t){if(t.propertyName==="value"&&mc(Oo)){var r=[];t_(r,Oo,t,Ge(t)),uc(Y2,r)}}function X2(t,r,a){t==="focusin"?(s_(),No=r,Oo=a,No.attachEvent("onpropertychange",a_)):t==="focusout"&&s_()}function Z2(t){if(t==="selectionchange"||t==="keyup"||t==="keydown")return mc(Oo)}function J2(t,r){if(t==="click")return mc(r)}function Q2(t,r){if(t==="input"||t==="change")return mc(r)}function eE(t,r){return t===r&&(t!==0||1/t===1/r)||t!==t&&r!==r}var fi=typeof Object.is=="function"?Object.is:eE;function Do(t,r){if(fi(t,r))return!0;if(typeof t!="object"||t===null||typeof r!="object"||r===null)return!1;var a=Object.keys(t),l=Object.keys(r);if(a.length!==l.length)return!1;for(l=0;l<a.length;l++){var b=a[l];if(!Xt.call(r,b)||!fi(t[b],r[b]))return!1}return!0}function o_(t){for(;t&&t.firstChild;)t=t.firstChild;return t}function l_(t,r){var a=o_(t);t=0;for(var l;a;){if(a.nodeType===3){if(l=t+a.textContent.length,t<=r&&l>=r)return{node:a,offset:r-t};t=l}e:{for(;a;){if(a.nextSibling){a=a.nextSibling;break e}a=a.parentNode}a=void 0}a=o_(a)}}function c_(t,r){return t&&r?t===r?!0:t&&t.nodeType===3?!1:r&&r.nodeType===3?c_(t,r.parentNode):"contains"in t?t.contains(r):t.compareDocumentPosition?!!(t.compareDocumentPosition(r)&16):!1:!1}function u_(t){t=t!=null&&t.ownerDocument!=null&&t.ownerDocument.defaultView!=null?t.ownerDocument.defaultView:window;for(var r=da(t.document);r instanceof t.HTMLIFrameElement;){try{var a=typeof r.contentWindow.location.href=="string"}catch{a=!1}if(a)t=r.contentWindow;else break;r=da(t.document)}return r}function Wh(t){var r=t&&t.nodeName&&t.nodeName.toLowerCase();return r&&(r==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||r==="textarea"||t.contentEditable==="true")}var tE=mr&&"documentMode"in document&&11>=document.documentMode,ma=null,Gh=null,jo=null,qh=!1;function h_(t,r,a){var l=a.window===a?a.document:a.nodeType===9?a:a.ownerDocument;qh||ma==null||ma!==da(l)||(l=ma,"selectionStart"in l&&Wh(l)?l={start:l.selectionStart,end:l.selectionEnd}:(l=(l.ownerDocument&&l.ownerDocument.defaultView||window).getSelection(),l={anchorNode:l.anchorNode,anchorOffset:l.anchorOffset,focusNode:l.focusNode,focusOffset:l.focusOffset}),jo&&Do(jo,l)||(jo=l,l=ru(Gh,"onSelect"),0<l.length&&(r=new pc("onSelect","select",null,r,a),t.push({event:r,listeners:l}),r.target=ma)))}function Ns(t,r){var a={};return a[t.toLowerCase()]=r.toLowerCase(),a["Webkit"+t]="webkit"+r,a["Moz"+t]="moz"+r,a}var _a={animationend:Ns("Animation","AnimationEnd"),animationiteration:Ns("Animation","AnimationIteration"),animationstart:Ns("Animation","AnimationStart"),transitionrun:Ns("Transition","TransitionRun"),transitionstart:Ns("Transition","TransitionStart"),transitioncancel:Ns("Transition","TransitionCancel"),transitionend:Ns("Transition","TransitionEnd")},Kh={},d_={};mr&&(d_=document.createElement("div").style,"AnimationEvent"in window||(delete _a.animationend.animation,delete _a.animationiteration.animation,delete _a.animationstart.animation),"TransitionEvent"in window||delete _a.transitionend.transition);function Os(t){if(Kh[t])return Kh[t];if(!_a[t])return t;var r=_a[t],a;for(a in r)if(r.hasOwnProperty(a)&&a in d_)return Kh[t]=r[a];return t}var f_=Os("animationend"),p_=Os("animationiteration"),g_=Os("animationstart"),nE=Os("transitionrun"),iE=Os("transitionstart"),rE=Os("transitioncancel"),m_=Os("transitionend"),__=new Map,Vh="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(" ");Vh.push("scrollEnd");function Wi(t,r){__.set(t,r),Qt(r,[t])}var _c=typeof reportError=="function"?reportError:function(t){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var r=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(r))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",t);return}console.error(t)},ki=[],va=0,Yh=0;function vc(){for(var t=va,r=Yh=va=0;r<t;){var a=ki[r];ki[r++]=null;var l=ki[r];ki[r++]=null;var b=ki[r];ki[r++]=null;var x=ki[r];if(ki[r++]=null,l!==null&&b!==null){var O=l.pending;O===null?b.next=b:(b.next=O.next,O.next=b),l.pending=b}x!==0&&v_(a,b,x)}}function bc(t,r,a,l){ki[va++]=t,ki[va++]=r,ki[va++]=a,ki[va++]=l,Yh|=l,t.lanes|=l,t=t.alternate,t!==null&&(t.lanes|=l)}function Xh(t,r,a,l){return bc(t,r,a,l),yc(t)}function Ds(t,r){return bc(t,null,null,r),yc(t)}function v_(t,r,a){t.lanes|=a;var l=t.alternate;l!==null&&(l.lanes|=a);for(var b=!1,x=t.return;x!==null;)x.childLanes|=a,l=x.alternate,l!==null&&(l.childLanes|=a),x.tag===22&&(t=x.stateNode,t===null||t._visibility&1||(b=!0)),t=x,x=x.return;return t.tag===3?(x=t.stateNode,b&&r!==null&&(b=31-Ze(a),t=x.hiddenUpdates,l=t[b],l===null?t[b]=[r]:l.push(r),r.lane=a|536870912),x):null}function yc(t){if(50<il)throw il=0,af=null,Error(s(185));for(var r=t.return;r!==null;)t=r,r=t.return;return t.tag===3?t.stateNode:null}var ba={};function sE(t,r,a,l){this.tag=t,this.key=a,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=r,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=l,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function pi(t,r,a,l){return new sE(t,r,a,l)}function Zh(t){return t=t.prototype,!(!t||!t.isReactComponent)}function _r(t,r){var a=t.alternate;return a===null?(a=pi(t.tag,r,t.key,t.mode),a.elementType=t.elementType,a.type=t.type,a.stateNode=t.stateNode,a.alternate=t,t.alternate=a):(a.pendingProps=r,a.type=t.type,a.flags=0,a.subtreeFlags=0,a.deletions=null),a.flags=t.flags&65011712,a.childLanes=t.childLanes,a.lanes=t.lanes,a.child=t.child,a.memoizedProps=t.memoizedProps,a.memoizedState=t.memoizedState,a.updateQueue=t.updateQueue,r=t.dependencies,a.dependencies=r===null?null:{lanes:r.lanes,firstContext:r.firstContext},a.sibling=t.sibling,a.index=t.index,a.ref=t.ref,a.refCleanup=t.refCleanup,a}function b_(t,r){t.flags&=65011714;var a=t.alternate;return a===null?(t.childLanes=0,t.lanes=r,t.child=null,t.subtreeFlags=0,t.memoizedProps=null,t.memoizedState=null,t.updateQueue=null,t.dependencies=null,t.stateNode=null):(t.childLanes=a.childLanes,t.lanes=a.lanes,t.child=a.child,t.subtreeFlags=0,t.deletions=null,t.memoizedProps=a.memoizedProps,t.memoizedState=a.memoizedState,t.updateQueue=a.updateQueue,t.type=a.type,r=a.dependencies,t.dependencies=r===null?null:{lanes:r.lanes,firstContext:r.firstContext}),t}function Sc(t,r,a,l,b,x){var O=0;if(l=t,typeof t=="function")Zh(t)&&(O=1);else if(typeof t=="string")O=u5(t,a,Y.current)?26:t==="html"||t==="head"||t==="body"?27:5;else e:switch(t){case B:return t=pi(31,a,r,b),t.elementType=B,t.lanes=x,t;case E:return js(a.children,b,x,r);case g:O=8,b|=24;break;case v:return t=pi(12,a,r,b|2),t.elementType=v,t.lanes=x,t;case L:return t=pi(13,a,r,b),t.elementType=L,t.lanes=x,t;case R:return t=pi(19,a,r,b),t.elementType=R,t.lanes=x,t;default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case S:O=10;break e;case m:O=9;break e;case k:O=11;break e;case M:O=14;break e;case A:O=16,l=null;break e}O=29,a=Error(s(130,t===null?"null":typeof t,"")),l=null}return r=pi(O,a,r,b),r.elementType=t,r.type=l,r.lanes=x,r}function js(t,r,a,l){return t=pi(7,t,l,r),t.lanes=a,t}function Jh(t,r,a){return t=pi(6,t,null,r),t.lanes=a,t}function y_(t){var r=pi(18,null,null,0);return r.stateNode=t,r}function Qh(t,r,a){return r=pi(4,t.children!==null?t.children:[],t.key,r),r.lanes=a,r.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},r}var S_=new WeakMap;function Ti(t,r){if(typeof t=="object"&&t!==null){var a=S_.get(t);return a!==void 0?a:(r={value:t,source:r,stack:Rt(r)},S_.set(t,r),r)}return{value:t,source:r,stack:Rt(r)}}var ya=[],Sa=0,wc=null,Io=0,Ai=[],Ri=0,Vr=null,tr=1,nr="";function vr(t,r){ya[Sa++]=Io,ya[Sa++]=wc,wc=t,Io=r}function w_(t,r,a){Ai[Ri++]=tr,Ai[Ri++]=nr,Ai[Ri++]=Vr,Vr=t;var l=tr;t=nr;var b=32-Ze(l)-1;l&=~(1<<b),a+=1;var x=32-Ze(r)+b;if(30<x){var O=b-b%5;x=(l&(1<<O)-1).toString(32),l>>=O,b-=O,tr=1<<32-Ze(r)+b|a<<b|l,nr=x+t}else tr=1<<x|a<<b|l,nr=t}function ed(t){t.return!==null&&(vr(t,1),w_(t,1,0))}function td(t){for(;t===wc;)wc=ya[--Sa],ya[Sa]=null,Io=ya[--Sa],ya[Sa]=null;for(;t===Vr;)Vr=Ai[--Ri],Ai[Ri]=null,nr=Ai[--Ri],Ai[Ri]=null,tr=Ai[--Ri],Ai[Ri]=null}function x_(t,r){Ai[Ri++]=tr,Ai[Ri++]=nr,Ai[Ri++]=Vr,tr=r.id,nr=r.overflow,Vr=t}var Mn=null,Pt=null,lt=!1,Yr=null,Li=!1,nd=Error(s(519));function Xr(t){var r=Error(s(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Bo(Ti(r,t)),nd}function C_(t){var r=t.stateNode,a=t.type,l=t.memoizedProps;switch(r[It]=t,r[Nt]=l,a){case"dialog":et("cancel",r),et("close",r);break;case"iframe":case"object":case"embed":et("load",r);break;case"video":case"audio":for(a=0;a<sl.length;a++)et(sl[a],r);break;case"source":et("error",r);break;case"img":case"image":case"link":et("error",r),et("load",r);break;case"details":et("toggle",r);break;case"input":et("invalid",r),Ls(r,l.value,l.defaultValue,l.checked,l.defaultChecked,l.type,l.name,!0);break;case"select":et("invalid",r);break;case"textarea":et("invalid",r),pa(r,l.value,l.defaultValue,l.children)}a=l.children,typeof a!="string"&&typeof a!="number"&&typeof a!="bigint"||r.textContent===""+a||l.suppressHydrationWarning===!0||$0(r.textContent,a)?(l.popover!=null&&(et("beforetoggle",r),et("toggle",r)),l.onScroll!=null&&et("scroll",r),l.onScrollEnd!=null&&et("scrollend",r),l.onClick!=null&&(r.onclick=xe),r=!0):r=!1,r||Xr(t,!0)}function E_(t){for(Mn=t.return;Mn;)switch(Mn.tag){case 5:case 31:case 13:Li=!1;return;case 27:case 3:Li=!0;return;default:Mn=Mn.return}}function wa(t){if(t!==Mn)return!1;if(!lt)return E_(t),lt=!0,!1;var r=t.tag,a;if((a=r!==3&&r!==27)&&((a=r===5)&&(a=t.type,a=!(a!=="form"&&a!=="button")||Sf(t.type,t.memoizedProps)),a=!a),a&&Pt&&Xr(t),E_(t),r===13){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(s(317));Pt=X0(t)}else if(r===31){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(s(317));Pt=X0(t)}else r===27?(r=Pt,us(t.type)?(t=kf,kf=null,Pt=t):Pt=r):Pt=Mn?Ni(t.stateNode.nextSibling):null;return!0}function Is(){Pt=Mn=null,lt=!1}function id(){var t=Yr;return t!==null&&(ai===null?ai=t:ai.push.apply(ai,t),Yr=null),t}function Bo(t){Yr===null?Yr=[t]:Yr.push(t)}var rd=D(null),Bs=null,br=null;function Zr(t,r,a){G(rd,r._currentValue),r._currentValue=a}function yr(t){t._currentValue=rd.current,U(rd)}function sd(t,r,a){for(;t!==null;){var l=t.alternate;if((t.childLanes&r)!==r?(t.childLanes|=r,l!==null&&(l.childLanes|=r)):l!==null&&(l.childLanes&r)!==r&&(l.childLanes|=r),t===a)break;t=t.return}}function ad(t,r,a,l){var b=t.child;for(b!==null&&(b.return=t);b!==null;){var x=b.dependencies;if(x!==null){var O=b.child;x=x.firstContext;e:for(;x!==null;){var $=x;x=b;for(var te=0;te<r.length;te++)if($.context===r[te]){x.lanes|=a,$=x.alternate,$!==null&&($.lanes|=a),sd(x.return,a,t),l||(O=null);break e}x=$.next}}else if(b.tag===18){if(O=b.return,O===null)throw Error(s(341));O.lanes|=a,x=O.alternate,x!==null&&(x.lanes|=a),sd(O,a,t),O=null}else O=b.child;if(O!==null)O.return=b;else for(O=b;O!==null;){if(O===t){O=null;break}if(b=O.sibling,b!==null){b.return=O.return,O=b;break}O=O.return}b=O}}function xa(t,r,a,l){t=null;for(var b=r,x=!1;b!==null;){if(!x){if((b.flags&524288)!==0)x=!0;else if((b.flags&262144)!==0)break}if(b.tag===10){var O=b.alternate;if(O===null)throw Error(s(387));if(O=O.memoizedProps,O!==null){var $=b.type;fi(b.pendingProps.value,O.value)||(t!==null?t.push($):t=[$])}}else if(b===J.current){if(O=b.alternate,O===null)throw Error(s(387));O.memoizedState.memoizedState!==b.memoizedState.memoizedState&&(t!==null?t.push(ul):t=[ul])}b=b.return}t!==null&&ad(r,t,a,l),r.flags|=262144}function xc(t){for(t=t.firstContext;t!==null;){if(!fi(t.context._currentValue,t.memoizedValue))return!0;t=t.next}return!1}function Ps(t){Bs=t,br=null,t=t.dependencies,t!==null&&(t.firstContext=null)}function Nn(t){return k_(Bs,t)}function Cc(t,r){return Bs===null&&Ps(t),k_(t,r)}function k_(t,r){var a=r._currentValue;if(r={context:r,memoizedValue:a,next:null},br===null){if(t===null)throw Error(s(308));br=r,t.dependencies={lanes:0,firstContext:r},t.flags|=524288}else br=br.next=r;return a}var aE=typeof AbortController<"u"?AbortController:function(){var t=[],r=this.signal={aborted:!1,addEventListener:function(a,l){t.push(l)}};this.abort=function(){r.aborted=!0,t.forEach(function(a){return a()})}},oE=e.unstable_scheduleCallback,lE=e.unstable_NormalPriority,dn={$$typeof:S,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function od(){return{controller:new aE,data:new Map,refCount:0}}function Po(t){t.refCount--,t.refCount===0&&oE(lE,function(){t.controller.abort()})}var zo=null,ld=0,Ca=0,Ea=null;function cE(t,r){if(zo===null){var a=zo=[];ld=0,Ca=df(),Ea={status:"pending",value:void 0,then:function(l){a.push(l)}}}return ld++,r.then(T_,T_),r}function T_(){if(--ld===0&&zo!==null){Ea!==null&&(Ea.status="fulfilled");var t=zo;zo=null,Ca=0,Ea=null;for(var r=0;r<t.length;r++)(0,t[r])()}}function uE(t,r){var a=[],l={status:"pending",value:null,reason:null,then:function(b){a.push(b)}};return t.then(function(){l.status="fulfilled",l.value=r;for(var b=0;b<a.length;b++)(0,a[b])(r)},function(b){for(l.status="rejected",l.reason=b,b=0;b<a.length;b++)(0,a[b])(void 0)}),l}var A_=z.S;z.S=function(t,r){h0=ht(),typeof r=="object"&&r!==null&&typeof r.then=="function"&&cE(t,r),A_!==null&&A_(t,r)};var zs=D(null);function cd(){var t=zs.current;return t!==null?t:Mt.pooledCache}function Ec(t,r){r===null?G(zs,zs.current):G(zs,r.pool)}function R_(){var t=cd();return t===null?null:{parent:dn._currentValue,pool:t}}var ka=Error(s(460)),ud=Error(s(474)),kc=Error(s(542)),Tc={then:function(){}};function L_(t){return t=t.status,t==="fulfilled"||t==="rejected"}function M_(t,r,a){switch(a=t[a],a===void 0?t.push(r):a!==r&&(r.then(xe,xe),r=a),r.status){case"fulfilled":return r.value;case"rejected":throw t=r.reason,O_(t),t;default:if(typeof r.status=="string")r.then(xe,xe);else{if(t=Mt,t!==null&&100<t.shellSuspendCounter)throw Error(s(482));t=r,t.status="pending",t.then(function(l){if(r.status==="pending"){var b=r;b.status="fulfilled",b.value=l}},function(l){if(r.status==="pending"){var b=r;b.status="rejected",b.reason=l}})}switch(r.status){case"fulfilled":return r.value;case"rejected":throw t=r.reason,O_(t),t}throw $s=r,ka}}function Hs(t){try{var r=t._init;return r(t._payload)}catch(a){throw a!==null&&typeof a=="object"&&typeof a.then=="function"?($s=a,ka):a}}var $s=null;function N_(){if($s===null)throw Error(s(459));var t=$s;return $s=null,t}function O_(t){if(t===ka||t===kc)throw Error(s(483))}var Ta=null,Ho=0;function Ac(t){var r=Ho;return Ho+=1,Ta===null&&(Ta=[]),M_(Ta,t,r)}function $o(t,r){r=r.props.ref,t.ref=r!==void 0?r:null}function Rc(t,r){throw r.$$typeof===w?Error(s(525)):(t=Object.prototype.toString.call(r),Error(s(31,t==="[object Object]"?"object with keys {"+Object.keys(r).join(", ")+"}":t)))}function D_(t){function r(re,ne){if(t){var le=re.deletions;le===null?(re.deletions=[ne],re.flags|=16):le.push(ne)}}function a(re,ne){if(!t)return null;for(;ne!==null;)r(re,ne),ne=ne.sibling;return null}function l(re){for(var ne=new Map;re!==null;)re.key!==null?ne.set(re.key,re):ne.set(re.index,re),re=re.sibling;return ne}function b(re,ne){return re=_r(re,ne),re.index=0,re.sibling=null,re}function x(re,ne,le){return re.index=le,t?(le=re.alternate,le!==null?(le=le.index,le<ne?(re.flags|=67108866,ne):le):(re.flags|=67108866,ne)):(re.flags|=1048576,ne)}function O(re){return t&&re.alternate===null&&(re.flags|=67108866),re}function $(re,ne,le,ge){return ne===null||ne.tag!==6?(ne=Jh(le,re.mode,ge),ne.return=re,ne):(ne=b(ne,le),ne.return=re,ne)}function te(re,ne,le,ge){var Be=le.type;return Be===E?fe(re,ne,le.props.children,ge,le.key):ne!==null&&(ne.elementType===Be||typeof Be=="object"&&Be!==null&&Be.$$typeof===A&&Hs(Be)===ne.type)?(ne=b(ne,le.props),$o(ne,le),ne.return=re,ne):(ne=Sc(le.type,le.key,le.props,null,re.mode,ge),$o(ne,le),ne.return=re,ne)}function ce(re,ne,le,ge){return ne===null||ne.tag!==4||ne.stateNode.containerInfo!==le.containerInfo||ne.stateNode.implementation!==le.implementation?(ne=Qh(le,re.mode,ge),ne.return=re,ne):(ne=b(ne,le.children||[]),ne.return=re,ne)}function fe(re,ne,le,ge,Be){return ne===null||ne.tag!==7?(ne=js(le,re.mode,ge,Be),ne.return=re,ne):(ne=b(ne,le),ne.return=re,ne)}function me(re,ne,le){if(typeof ne=="string"&&ne!==""||typeof ne=="number"||typeof ne=="bigint")return ne=Jh(""+ne,re.mode,le),ne.return=re,ne;if(typeof ne=="object"&&ne!==null){switch(ne.$$typeof){case C:return le=Sc(ne.type,ne.key,ne.props,null,re.mode,le),$o(le,ne),le.return=re,le;case T:return ne=Qh(ne,re.mode,le),ne.return=re,ne;case A:return ne=Hs(ne),me(re,ne,le)}if(X(ne)||W(ne))return ne=js(ne,re.mode,le,null),ne.return=re,ne;if(typeof ne.then=="function")return me(re,Ac(ne),le);if(ne.$$typeof===S)return me(re,Cc(re,ne),le);Rc(re,ne)}return null}function ue(re,ne,le,ge){var Be=ne!==null?ne.key:null;if(typeof le=="string"&&le!==""||typeof le=="number"||typeof le=="bigint")return Be!==null?null:$(re,ne,""+le,ge);if(typeof le=="object"&&le!==null){switch(le.$$typeof){case C:return le.key===Be?te(re,ne,le,ge):null;case T:return le.key===Be?ce(re,ne,le,ge):null;case A:return le=Hs(le),ue(re,ne,le,ge)}if(X(le)||W(le))return Be!==null?null:fe(re,ne,le,ge,null);if(typeof le.then=="function")return ue(re,ne,Ac(le),ge);if(le.$$typeof===S)return ue(re,ne,Cc(re,le),ge);Rc(re,le)}return null}function he(re,ne,le,ge,Be){if(typeof ge=="string"&&ge!==""||typeof ge=="number"||typeof ge=="bigint")return re=re.get(le)||null,$(ne,re,""+ge,Be);if(typeof ge=="object"&&ge!==null){switch(ge.$$typeof){case C:return re=re.get(ge.key===null?le:ge.key)||null,te(ne,re,ge,Be);case T:return re=re.get(ge.key===null?le:ge.key)||null,ce(ne,re,ge,Be);case A:return ge=Hs(ge),he(re,ne,le,ge,Be)}if(X(ge)||W(ge))return re=re.get(le)||null,fe(ne,re,ge,Be,null);if(typeof ge.then=="function")return he(re,ne,le,Ac(ge),Be);if(ge.$$typeof===S)return he(re,ne,le,Cc(ne,ge),Be);Rc(ne,ge)}return null}function Te(re,ne,le,ge){for(var Be=null,gt=null,Re=ne,Ye=ne=0,st=null;Re!==null&&Ye<le.length;Ye++){Re.index>Ye?(st=Re,Re=null):st=Re.sibling;var mt=ue(re,Re,le[Ye],ge);if(mt===null){Re===null&&(Re=st);break}t&&Re&&mt.alternate===null&&r(re,Re),ne=x(mt,ne,Ye),gt===null?Be=mt:gt.sibling=mt,gt=mt,Re=st}if(Ye===le.length)return a(re,Re),lt&&vr(re,Ye),Be;if(Re===null){for(;Ye<le.length;Ye++)Re=me(re,le[Ye],ge),Re!==null&&(ne=x(Re,ne,Ye),gt===null?Be=Re:gt.sibling=Re,gt=Re);return lt&&vr(re,Ye),Be}for(Re=l(Re);Ye<le.length;Ye++)st=he(Re,re,Ye,le[Ye],ge),st!==null&&(t&&st.alternate!==null&&Re.delete(st.key===null?Ye:st.key),ne=x(st,ne,Ye),gt===null?Be=st:gt.sibling=st,gt=st);return t&&Re.forEach(function(gs){return r(re,gs)}),lt&&vr(re,Ye),Be}function ze(re,ne,le,ge){if(le==null)throw Error(s(151));for(var Be=null,gt=null,Re=ne,Ye=ne=0,st=null,mt=le.next();Re!==null&&!mt.done;Ye++,mt=le.next()){Re.index>Ye?(st=Re,Re=null):st=Re.sibling;var gs=ue(re,Re,mt.value,ge);if(gs===null){Re===null&&(Re=st);break}t&&Re&&gs.alternate===null&&r(re,Re),ne=x(gs,ne,Ye),gt===null?Be=gs:gt.sibling=gs,gt=gs,Re=st}if(mt.done)return a(re,Re),lt&&vr(re,Ye),Be;if(Re===null){for(;!mt.done;Ye++,mt=le.next())mt=me(re,mt.value,ge),mt!==null&&(ne=x(mt,ne,Ye),gt===null?Be=mt:gt.sibling=mt,gt=mt);return lt&&vr(re,Ye),Be}for(Re=l(Re);!mt.done;Ye++,mt=le.next())mt=he(Re,re,Ye,mt.value,ge),mt!==null&&(t&&mt.alternate!==null&&Re.delete(mt.key===null?Ye:mt.key),ne=x(mt,ne,Ye),gt===null?Be=mt:gt.sibling=mt,gt=mt);return t&&Re.forEach(function(S5){return r(re,S5)}),lt&&vr(re,Ye),Be}function Tt(re,ne,le,ge){if(typeof le=="object"&&le!==null&&le.type===E&&le.key===null&&(le=le.props.children),typeof le=="object"&&le!==null){switch(le.$$typeof){case C:e:{for(var Be=le.key;ne!==null;){if(ne.key===Be){if(Be=le.type,Be===E){if(ne.tag===7){a(re,ne.sibling),ge=b(ne,le.props.children),ge.return=re,re=ge;break e}}else if(ne.elementType===Be||typeof Be=="object"&&Be!==null&&Be.$$typeof===A&&Hs(Be)===ne.type){a(re,ne.sibling),ge=b(ne,le.props),$o(ge,le),ge.return=re,re=ge;break e}a(re,ne);break}else r(re,ne);ne=ne.sibling}le.type===E?(ge=js(le.props.children,re.mode,ge,le.key),ge.return=re,re=ge):(ge=Sc(le.type,le.key,le.props,null,re.mode,ge),$o(ge,le),ge.return=re,re=ge)}return O(re);case T:e:{for(Be=le.key;ne!==null;){if(ne.key===Be)if(ne.tag===4&&ne.stateNode.containerInfo===le.containerInfo&&ne.stateNode.implementation===le.implementation){a(re,ne.sibling),ge=b(ne,le.children||[]),ge.return=re,re=ge;break e}else{a(re,ne);break}else r(re,ne);ne=ne.sibling}ge=Qh(le,re.mode,ge),ge.return=re,re=ge}return O(re);case A:return le=Hs(le),Tt(re,ne,le,ge)}if(X(le))return Te(re,ne,le,ge);if(W(le)){if(Be=W(le),typeof Be!="function")throw Error(s(150));return le=Be.call(le),ze(re,ne,le,ge)}if(typeof le.then=="function")return Tt(re,ne,Ac(le),ge);if(le.$$typeof===S)return Tt(re,ne,Cc(re,le),ge);Rc(re,le)}return typeof le=="string"&&le!==""||typeof le=="number"||typeof le=="bigint"?(le=""+le,ne!==null&&ne.tag===6?(a(re,ne.sibling),ge=b(ne,le),ge.return=re,re=ge):(a(re,ne),ge=Jh(le,re.mode,ge),ge.return=re,re=ge),O(re)):a(re,ne)}return function(re,ne,le,ge){try{Ho=0;var Be=Tt(re,ne,le,ge);return Ta=null,Be}catch(Re){if(Re===ka||Re===kc)throw Re;var gt=pi(29,Re,null,re.mode);return gt.lanes=ge,gt.return=re,gt}}}var Us=D_(!0),j_=D_(!1),Jr=!1;function hd(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function dd(t,r){t=t.updateQueue,r.updateQueue===t&&(r.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,callbacks:null})}function Qr(t){return{lane:t,tag:0,payload:null,callback:null,next:null}}function es(t,r,a){var l=t.updateQueue;if(l===null)return null;if(l=l.shared,(vt&2)!==0){var b=l.pending;return b===null?r.next=r:(r.next=b.next,b.next=r),l.pending=r,r=yc(t),v_(t,null,a),r}return bc(t,l,r,a),yc(t)}function Uo(t,r,a){if(r=r.updateQueue,r!==null&&(r=r.shared,(a&4194048)!==0)){var l=r.lanes;l&=t.pendingLanes,a|=l,r.lanes=a,Pe(t,a)}}function fd(t,r){var a=t.updateQueue,l=t.alternate;if(l!==null&&(l=l.updateQueue,a===l)){var b=null,x=null;if(a=a.firstBaseUpdate,a!==null){do{var O={lane:a.lane,tag:a.tag,payload:a.payload,callback:null,next:null};x===null?b=x=O:x=x.next=O,a=a.next}while(a!==null);x===null?b=x=r:x=x.next=r}else b=x=r;a={baseState:l.baseState,firstBaseUpdate:b,lastBaseUpdate:x,shared:l.shared,callbacks:l.callbacks},t.updateQueue=a;return}t=a.lastBaseUpdate,t===null?a.firstBaseUpdate=r:t.next=r,a.lastBaseUpdate=r}var pd=!1;function Fo(){if(pd){var t=Ea;if(t!==null)throw t}}function Wo(t,r,a,l){pd=!1;var b=t.updateQueue;Jr=!1;var x=b.firstBaseUpdate,O=b.lastBaseUpdate,$=b.shared.pending;if($!==null){b.shared.pending=null;var te=$,ce=te.next;te.next=null,O===null?x=ce:O.next=ce,O=te;var fe=t.alternate;fe!==null&&(fe=fe.updateQueue,$=fe.lastBaseUpdate,$!==O&&($===null?fe.firstBaseUpdate=ce:$.next=ce,fe.lastBaseUpdate=te))}if(x!==null){var me=b.baseState;O=0,fe=ce=te=null,$=x;do{var ue=$.lane&-536870913,he=ue!==$.lane;if(he?(rt&ue)===ue:(l&ue)===ue){ue!==0&&ue===Ca&&(pd=!0),fe!==null&&(fe=fe.next={lane:0,tag:$.tag,payload:$.payload,callback:null,next:null});e:{var Te=t,ze=$;ue=r;var Tt=a;switch(ze.tag){case 1:if(Te=ze.payload,typeof Te=="function"){me=Te.call(Tt,me,ue);break e}me=Te;break e;case 3:Te.flags=Te.flags&-65537|128;case 0:if(Te=ze.payload,ue=typeof Te=="function"?Te.call(Tt,me,ue):Te,ue==null)break e;me=p({},me,ue);break e;case 2:Jr=!0}}ue=$.callback,ue!==null&&(t.flags|=64,he&&(t.flags|=8192),he=b.callbacks,he===null?b.callbacks=[ue]:he.push(ue))}else he={lane:ue,tag:$.tag,payload:$.payload,callback:$.callback,next:null},fe===null?(ce=fe=he,te=me):fe=fe.next=he,O|=ue;if($=$.next,$===null){if($=b.shared.pending,$===null)break;he=$,$=he.next,he.next=null,b.lastBaseUpdate=he,b.shared.pending=null}}while(!0);fe===null&&(te=me),b.baseState=te,b.firstBaseUpdate=ce,b.lastBaseUpdate=fe,x===null&&(b.shared.lanes=0),ss|=O,t.lanes=O,t.memoizedState=me}}function I_(t,r){if(typeof t!="function")throw Error(s(191,t));t.call(r)}function B_(t,r){var a=t.callbacks;if(a!==null)for(t.callbacks=null,t=0;t<a.length;t++)I_(a[t],r)}var Aa=D(null),Lc=D(0);function P_(t,r){t=Rr,G(Lc,t),G(Aa,r),Rr=t|r.baseLanes}function gd(){G(Lc,Rr),G(Aa,Aa.current)}function md(){Rr=Lc.current,U(Aa),U(Lc)}var gi=D(null),Mi=null;function ts(t){var r=t.alternate;G(ln,ln.current&1),G(gi,t),Mi===null&&(r===null||Aa.current!==null||r.memoizedState!==null)&&(Mi=t)}function _d(t){G(ln,ln.current),G(gi,t),Mi===null&&(Mi=t)}function z_(t){t.tag===22?(G(ln,ln.current),G(gi,t),Mi===null&&(Mi=t)):ns()}function ns(){G(ln,ln.current),G(gi,gi.current)}function mi(t){U(gi),Mi===t&&(Mi=null),U(ln)}var ln=D(0);function Mc(t){for(var r=t;r!==null;){if(r.tag===13){var a=r.memoizedState;if(a!==null&&(a=a.dehydrated,a===null||Cf(a)||Ef(a)))return r}else if(r.tag===19&&(r.memoizedProps.revealOrder==="forwards"||r.memoizedProps.revealOrder==="backwards"||r.memoizedProps.revealOrder==="unstable_legacy-backwards"||r.memoizedProps.revealOrder==="together")){if((r.flags&128)!==0)return r}else if(r.child!==null){r.child.return=r,r=r.child;continue}if(r===t)break;for(;r.sibling===null;){if(r.return===null||r.return===t)return null;r=r.return}r.sibling.return=r.return,r=r.sibling}return null}var Sr=0,qe=null,Et=null,fn=null,Nc=!1,Ra=!1,Fs=!1,Oc=0,Go=0,La=null,hE=0;function en(){throw Error(s(321))}function vd(t,r){if(r===null)return!1;for(var a=0;a<r.length&&a<t.length;a++)if(!fi(t[a],r[a]))return!1;return!0}function bd(t,r,a,l,b,x){return Sr=x,qe=r,r.memoizedState=null,r.updateQueue=null,r.lanes=0,z.H=t===null||t.memoizedState===null?wv:Dd,Fs=!1,x=a(l,b),Fs=!1,Ra&&(x=$_(r,a,l,b)),H_(t),x}function H_(t){z.H=Vo;var r=Et!==null&&Et.next!==null;if(Sr=0,fn=Et=qe=null,Nc=!1,Go=0,La=null,r)throw Error(s(300));t===null||pn||(t=t.dependencies,t!==null&&xc(t)&&(pn=!0))}function $_(t,r,a,l){qe=t;var b=0;do{if(Ra&&(La=null),Go=0,Ra=!1,25<=b)throw Error(s(301));if(b+=1,fn=Et=null,t.updateQueue!=null){var x=t.updateQueue;x.lastEffect=null,x.events=null,x.stores=null,x.memoCache!=null&&(x.memoCache.index=0)}z.H=xv,x=r(a,l)}while(Ra);return x}function dE(){var t=z.H,r=t.useState()[0];return r=typeof r.then=="function"?qo(r):r,t=t.useState()[0],(Et!==null?Et.memoizedState:null)!==t&&(qe.flags|=1024),r}function yd(){var t=Oc!==0;return Oc=0,t}function Sd(t,r,a){r.updateQueue=t.updateQueue,r.flags&=-2053,t.lanes&=~a}function wd(t){if(Nc){for(t=t.memoizedState;t!==null;){var r=t.queue;r!==null&&(r.pending=null),t=t.next}Nc=!1}Sr=0,fn=Et=qe=null,Ra=!1,Go=Oc=0,La=null}function Fn(){var t={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return fn===null?qe.memoizedState=fn=t:fn=fn.next=t,fn}function cn(){if(Et===null){var t=qe.alternate;t=t!==null?t.memoizedState:null}else t=Et.next;var r=fn===null?qe.memoizedState:fn.next;if(r!==null)fn=r,Et=t;else{if(t===null)throw qe.alternate===null?Error(s(467)):Error(s(310));Et=t,t={memoizedState:Et.memoizedState,baseState:Et.baseState,baseQueue:Et.baseQueue,queue:Et.queue,next:null},fn===null?qe.memoizedState=fn=t:fn=fn.next=t}return fn}function Dc(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function qo(t){var r=Go;return Go+=1,La===null&&(La=[]),t=M_(La,t,r),r=qe,(fn===null?r.memoizedState:fn.next)===null&&(r=r.alternate,z.H=r===null||r.memoizedState===null?wv:Dd),t}function jc(t){if(t!==null&&typeof t=="object"){if(typeof t.then=="function")return qo(t);if(t.$$typeof===S)return Nn(t)}throw Error(s(438,String(t)))}function xd(t){var r=null,a=qe.updateQueue;if(a!==null&&(r=a.memoCache),r==null){var l=qe.alternate;l!==null&&(l=l.updateQueue,l!==null&&(l=l.memoCache,l!=null&&(r={data:l.data.map(function(b){return b.slice()}),index:0})))}if(r==null&&(r={data:[],index:0}),a===null&&(a=Dc(),qe.updateQueue=a),a.memoCache=r,a=r.data[r.index],a===void 0)for(a=r.data[r.index]=Array(t),l=0;l<t;l++)a[l]=K;return r.index++,a}function wr(t,r){return typeof r=="function"?r(t):r}function Ic(t){var r=cn();return Cd(r,Et,t)}function Cd(t,r,a){var l=t.queue;if(l===null)throw Error(s(311));l.lastRenderedReducer=a;var b=t.baseQueue,x=l.pending;if(x!==null){if(b!==null){var O=b.next;b.next=x.next,x.next=O}r.baseQueue=b=x,l.pending=null}if(x=t.baseState,b===null)t.memoizedState=x;else{r=b.next;var $=O=null,te=null,ce=r,fe=!1;do{var me=ce.lane&-536870913;if(me!==ce.lane?(rt&me)===me:(Sr&me)===me){var ue=ce.revertLane;if(ue===0)te!==null&&(te=te.next={lane:0,revertLane:0,gesture:null,action:ce.action,hasEagerState:ce.hasEagerState,eagerState:ce.eagerState,next:null}),me===Ca&&(fe=!0);else if((Sr&ue)===ue){ce=ce.next,ue===Ca&&(fe=!0);continue}else me={lane:0,revertLane:ce.revertLane,gesture:null,action:ce.action,hasEagerState:ce.hasEagerState,eagerState:ce.eagerState,next:null},te===null?($=te=me,O=x):te=te.next=me,qe.lanes|=ue,ss|=ue;me=ce.action,Fs&&a(x,me),x=ce.hasEagerState?ce.eagerState:a(x,me)}else ue={lane:me,revertLane:ce.revertLane,gesture:ce.gesture,action:ce.action,hasEagerState:ce.hasEagerState,eagerState:ce.eagerState,next:null},te===null?($=te=ue,O=x):te=te.next=ue,qe.lanes|=me,ss|=me;ce=ce.next}while(ce!==null&&ce!==r);if(te===null?O=x:te.next=$,!fi(x,t.memoizedState)&&(pn=!0,fe&&(a=Ea,a!==null)))throw a;t.memoizedState=x,t.baseState=O,t.baseQueue=te,l.lastRenderedState=x}return b===null&&(l.lanes=0),[t.memoizedState,l.dispatch]}function Ed(t){var r=cn(),a=r.queue;if(a===null)throw Error(s(311));a.lastRenderedReducer=t;var l=a.dispatch,b=a.pending,x=r.memoizedState;if(b!==null){a.pending=null;var O=b=b.next;do x=t(x,O.action),O=O.next;while(O!==b);fi(x,r.memoizedState)||(pn=!0),r.memoizedState=x,r.baseQueue===null&&(r.baseState=x),a.lastRenderedState=x}return[x,l]}function U_(t,r,a){var l=qe,b=cn(),x=lt;if(x){if(a===void 0)throw Error(s(407));a=a()}else a=r();var O=!fi((Et||b).memoizedState,a);if(O&&(b.memoizedState=a,pn=!0),b=b.queue,Ad(G_.bind(null,l,b,t),[t]),b.getSnapshot!==r||O||fn!==null&&fn.memoizedState.tag&1){if(l.flags|=2048,Ma(9,{destroy:void 0},W_.bind(null,l,b,a,r),null),Mt===null)throw Error(s(349));x||(Sr&127)!==0||F_(l,r,a)}return a}function F_(t,r,a){t.flags|=16384,t={getSnapshot:r,value:a},r=qe.updateQueue,r===null?(r=Dc(),qe.updateQueue=r,r.stores=[t]):(a=r.stores,a===null?r.stores=[t]:a.push(t))}function W_(t,r,a,l){r.value=a,r.getSnapshot=l,q_(r)&&K_(t)}function G_(t,r,a){return a(function(){q_(r)&&K_(t)})}function q_(t){var r=t.getSnapshot;t=t.value;try{var a=r();return!fi(t,a)}catch{return!0}}function K_(t){var r=Ds(t,2);r!==null&&oi(r,t,2)}function kd(t){var r=Fn();if(typeof t=="function"){var a=t;if(t=a(),Fs){$e(!0);try{a()}finally{$e(!1)}}}return r.memoizedState=r.baseState=t,r.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:wr,lastRenderedState:t},r}function V_(t,r,a,l){return t.baseState=a,Cd(t,Et,typeof l=="function"?l:wr)}function fE(t,r,a,l,b){if(zc(t))throw Error(s(485));if(t=r.action,t!==null){var x={payload:b,action:t,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(O){x.listeners.push(O)}};z.T!==null?a(!0):x.isTransition=!1,l(x),a=r.pending,a===null?(x.next=r.pending=x,Y_(r,x)):(x.next=a.next,r.pending=a.next=x)}}function Y_(t,r){var a=r.action,l=r.payload,b=t.state;if(r.isTransition){var x=z.T,O={};z.T=O;try{var $=a(b,l),te=z.S;te!==null&&te(O,$),X_(t,r,$)}catch(ce){Td(t,r,ce)}finally{x!==null&&O.types!==null&&(x.types=O.types),z.T=x}}else try{x=a(b,l),X_(t,r,x)}catch(ce){Td(t,r,ce)}}function X_(t,r,a){a!==null&&typeof a=="object"&&typeof a.then=="function"?a.then(function(l){Z_(t,r,l)},function(l){return Td(t,r,l)}):Z_(t,r,a)}function Z_(t,r,a){r.status="fulfilled",r.value=a,J_(r),t.state=a,r=t.pending,r!==null&&(a=r.next,a===r?t.pending=null:(a=a.next,r.next=a,Y_(t,a)))}function Td(t,r,a){var l=t.pending;if(t.pending=null,l!==null){l=l.next;do r.status="rejected",r.reason=a,J_(r),r=r.next;while(r!==l)}t.action=null}function J_(t){t=t.listeners;for(var r=0;r<t.length;r++)(0,t[r])()}function Q_(t,r){return r}function ev(t,r){if(lt){var a=Mt.formState;if(a!==null){e:{var l=qe;if(lt){if(Pt){t:{for(var b=Pt,x=Li;b.nodeType!==8;){if(!x){b=null;break t}if(b=Ni(b.nextSibling),b===null){b=null;break t}}x=b.data,b=x==="F!"||x==="F"?b:null}if(b){Pt=Ni(b.nextSibling),l=b.data==="F!";break e}}Xr(l)}l=!1}l&&(r=a[0])}}return a=Fn(),a.memoizedState=a.baseState=r,l={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Q_,lastRenderedState:r},a.queue=l,a=bv.bind(null,qe,l),l.dispatch=a,l=kd(!1),x=Od.bind(null,qe,!1,l.queue),l=Fn(),b={state:r,dispatch:null,action:t,pending:null},l.queue=b,a=fE.bind(null,qe,b,x,a),b.dispatch=a,l.memoizedState=t,[r,a,!1]}function tv(t){var r=cn();return nv(r,Et,t)}function nv(t,r,a){if(r=Cd(t,r,Q_)[0],t=Ic(wr)[0],typeof r=="object"&&r!==null&&typeof r.then=="function")try{var l=qo(r)}catch(O){throw O===ka?kc:O}else l=r;r=cn();var b=r.queue,x=b.dispatch;return a!==r.memoizedState&&(qe.flags|=2048,Ma(9,{destroy:void 0},pE.bind(null,b,a),null)),[l,x,t]}function pE(t,r){t.action=r}function iv(t){var r=cn(),a=Et;if(a!==null)return nv(r,a,t);cn(),r=r.memoizedState,a=cn();var l=a.queue.dispatch;return a.memoizedState=t,[r,l,!1]}function Ma(t,r,a,l){return t={tag:t,create:a,deps:l,inst:r,next:null},r=qe.updateQueue,r===null&&(r=Dc(),qe.updateQueue=r),a=r.lastEffect,a===null?r.lastEffect=t.next=t:(l=a.next,a.next=t,t.next=l,r.lastEffect=t),t}function rv(){return cn().memoizedState}function Bc(t,r,a,l){var b=Fn();qe.flags|=t,b.memoizedState=Ma(1|r,{destroy:void 0},a,l===void 0?null:l)}function Pc(t,r,a,l){var b=cn();l=l===void 0?null:l;var x=b.memoizedState.inst;Et!==null&&l!==null&&vd(l,Et.memoizedState.deps)?b.memoizedState=Ma(r,x,a,l):(qe.flags|=t,b.memoizedState=Ma(1|r,x,a,l))}function sv(t,r){Bc(8390656,8,t,r)}function Ad(t,r){Pc(2048,8,t,r)}function gE(t){qe.flags|=4;var r=qe.updateQueue;if(r===null)r=Dc(),qe.updateQueue=r,r.events=[t];else{var a=r.events;a===null?r.events=[t]:a.push(t)}}function av(t){var r=cn().memoizedState;return gE({ref:r,nextImpl:t}),function(){if((vt&2)!==0)throw Error(s(440));return r.impl.apply(void 0,arguments)}}function ov(t,r){return Pc(4,2,t,r)}function lv(t,r){return Pc(4,4,t,r)}function cv(t,r){if(typeof r=="function"){t=t();var a=r(t);return function(){typeof a=="function"?a():r(null)}}if(r!=null)return t=t(),r.current=t,function(){r.current=null}}function uv(t,r,a){a=a!=null?a.concat([t]):null,Pc(4,4,cv.bind(null,r,t),a)}function Rd(){}function hv(t,r){var a=cn();r=r===void 0?null:r;var l=a.memoizedState;return r!==null&&vd(r,l[1])?l[0]:(a.memoizedState=[t,r],t)}function dv(t,r){var a=cn();r=r===void 0?null:r;var l=a.memoizedState;if(r!==null&&vd(r,l[1]))return l[0];if(l=t(),Fs){$e(!0);try{t()}finally{$e(!1)}}return a.memoizedState=[l,r],l}function Ld(t,r,a){return a===void 0||(Sr&1073741824)!==0&&(rt&261930)===0?t.memoizedState=r:(t.memoizedState=a,t=f0(),qe.lanes|=t,ss|=t,a)}function fv(t,r,a,l){return fi(a,r)?a:Aa.current!==null?(t=Ld(t,a,l),fi(t,r)||(pn=!0),t):(Sr&42)===0||(Sr&1073741824)!==0&&(rt&261930)===0?(pn=!0,t.memoizedState=a):(t=f0(),qe.lanes|=t,ss|=t,r)}function pv(t,r,a,l,b){var x=q.p;q.p=x!==0&&8>x?x:8;var O=z.T,$={};z.T=$,Od(t,!1,r,a);try{var te=b(),ce=z.S;if(ce!==null&&ce($,te),te!==null&&typeof te=="object"&&typeof te.then=="function"){var fe=uE(te,l);Ko(t,r,fe,bi(t))}else Ko(t,r,l,bi(t))}catch(me){Ko(t,r,{then:function(){},status:"rejected",reason:me},bi())}finally{q.p=x,O!==null&&$.types!==null&&(O.types=$.types),z.T=O}}function mE(){}function Md(t,r,a,l){if(t.tag!==5)throw Error(s(476));var b=gv(t).queue;pv(t,b,r,V,a===null?mE:function(){return mv(t),a(l)})}function gv(t){var r=t.memoizedState;if(r!==null)return r;r={memoizedState:V,baseState:V,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:wr,lastRenderedState:V},next:null};var a={};return r.next={memoizedState:a,baseState:a,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:wr,lastRenderedState:a},next:null},t.memoizedState=r,t=t.alternate,t!==null&&(t.memoizedState=r),r}function mv(t){var r=gv(t);r.next===null&&(r=t.alternate.memoizedState),Ko(t,r.next.queue,{},bi())}function Nd(){return Nn(ul)}function _v(){return cn().memoizedState}function vv(){return cn().memoizedState}function _E(t){for(var r=t.return;r!==null;){switch(r.tag){case 24:case 3:var a=bi();t=Qr(a);var l=es(r,t,a);l!==null&&(oi(l,r,a),Uo(l,r,a)),r={cache:od()},t.payload=r;return}r=r.return}}function vE(t,r,a){var l=bi();a={lane:l,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null},zc(t)?yv(r,a):(a=Xh(t,r,a,l),a!==null&&(oi(a,t,l),Sv(a,r,l)))}function bv(t,r,a){var l=bi();Ko(t,r,a,l)}function Ko(t,r,a,l){var b={lane:l,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null};if(zc(t))yv(r,b);else{var x=t.alternate;if(t.lanes===0&&(x===null||x.lanes===0)&&(x=r.lastRenderedReducer,x!==null))try{var O=r.lastRenderedState,$=x(O,a);if(b.hasEagerState=!0,b.eagerState=$,fi($,O))return bc(t,r,b,0),Mt===null&&vc(),!1}catch{}if(a=Xh(t,r,b,l),a!==null)return oi(a,t,l),Sv(a,r,l),!0}return!1}function Od(t,r,a,l){if(l={lane:2,revertLane:df(),gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},zc(t)){if(r)throw Error(s(479))}else r=Xh(t,a,l,2),r!==null&&oi(r,t,2)}function zc(t){var r=t.alternate;return t===qe||r!==null&&r===qe}function yv(t,r){Ra=Nc=!0;var a=t.pending;a===null?r.next=r:(r.next=a.next,a.next=r),t.pending=r}function Sv(t,r,a){if((a&4194048)!==0){var l=r.lanes;l&=t.pendingLanes,a|=l,r.lanes=a,Pe(t,a)}}var Vo={readContext:Nn,use:jc,useCallback:en,useContext:en,useEffect:en,useImperativeHandle:en,useLayoutEffect:en,useInsertionEffect:en,useMemo:en,useReducer:en,useRef:en,useState:en,useDebugValue:en,useDeferredValue:en,useTransition:en,useSyncExternalStore:en,useId:en,useHostTransitionStatus:en,useFormState:en,useActionState:en,useOptimistic:en,useMemoCache:en,useCacheRefresh:en};Vo.useEffectEvent=en;var wv={readContext:Nn,use:jc,useCallback:function(t,r){return Fn().memoizedState=[t,r===void 0?null:r],t},useContext:Nn,useEffect:sv,useImperativeHandle:function(t,r,a){a=a!=null?a.concat([t]):null,Bc(4194308,4,cv.bind(null,r,t),a)},useLayoutEffect:function(t,r){return Bc(4194308,4,t,r)},useInsertionEffect:function(t,r){Bc(4,2,t,r)},useMemo:function(t,r){var a=Fn();r=r===void 0?null:r;var l=t();if(Fs){$e(!0);try{t()}finally{$e(!1)}}return a.memoizedState=[l,r],l},useReducer:function(t,r,a){var l=Fn();if(a!==void 0){var b=a(r);if(Fs){$e(!0);try{a(r)}finally{$e(!1)}}}else b=r;return l.memoizedState=l.baseState=b,t={pending:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:b},l.queue=t,t=t.dispatch=vE.bind(null,qe,t),[l.memoizedState,t]},useRef:function(t){var r=Fn();return t={current:t},r.memoizedState=t},useState:function(t){t=kd(t);var r=t.queue,a=bv.bind(null,qe,r);return r.dispatch=a,[t.memoizedState,a]},useDebugValue:Rd,useDeferredValue:function(t,r){var a=Fn();return Ld(a,t,r)},useTransition:function(){var t=kd(!1);return t=pv.bind(null,qe,t.queue,!0,!1),Fn().memoizedState=t,[!1,t]},useSyncExternalStore:function(t,r,a){var l=qe,b=Fn();if(lt){if(a===void 0)throw Error(s(407));a=a()}else{if(a=r(),Mt===null)throw Error(s(349));(rt&127)!==0||F_(l,r,a)}b.memoizedState=a;var x={value:a,getSnapshot:r};return b.queue=x,sv(G_.bind(null,l,x,t),[t]),l.flags|=2048,Ma(9,{destroy:void 0},W_.bind(null,l,x,a,r),null),a},useId:function(){var t=Fn(),r=Mt.identifierPrefix;if(lt){var a=nr,l=tr;a=(l&~(1<<32-Ze(l)-1)).toString(32)+a,r="_"+r+"R_"+a,a=Oc++,0<a&&(r+="H"+a.toString(32)),r+="_"}else a=hE++,r="_"+r+"r_"+a.toString(32)+"_";return t.memoizedState=r},useHostTransitionStatus:Nd,useFormState:ev,useActionState:ev,useOptimistic:function(t){var r=Fn();r.memoizedState=r.baseState=t;var a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return r.queue=a,r=Od.bind(null,qe,!0,a),a.dispatch=r,[t,r]},useMemoCache:xd,useCacheRefresh:function(){return Fn().memoizedState=_E.bind(null,qe)},useEffectEvent:function(t){var r=Fn(),a={impl:t};return r.memoizedState=a,function(){if((vt&2)!==0)throw Error(s(440));return a.impl.apply(void 0,arguments)}}},Dd={readContext:Nn,use:jc,useCallback:hv,useContext:Nn,useEffect:Ad,useImperativeHandle:uv,useInsertionEffect:ov,useLayoutEffect:lv,useMemo:dv,useReducer:Ic,useRef:rv,useState:function(){return Ic(wr)},useDebugValue:Rd,useDeferredValue:function(t,r){var a=cn();return fv(a,Et.memoizedState,t,r)},useTransition:function(){var t=Ic(wr)[0],r=cn().memoizedState;return[typeof t=="boolean"?t:qo(t),r]},useSyncExternalStore:U_,useId:_v,useHostTransitionStatus:Nd,useFormState:tv,useActionState:tv,useOptimistic:function(t,r){var a=cn();return V_(a,Et,t,r)},useMemoCache:xd,useCacheRefresh:vv};Dd.useEffectEvent=av;var xv={readContext:Nn,use:jc,useCallback:hv,useContext:Nn,useEffect:Ad,useImperativeHandle:uv,useInsertionEffect:ov,useLayoutEffect:lv,useMemo:dv,useReducer:Ed,useRef:rv,useState:function(){return Ed(wr)},useDebugValue:Rd,useDeferredValue:function(t,r){var a=cn();return Et===null?Ld(a,t,r):fv(a,Et.memoizedState,t,r)},useTransition:function(){var t=Ed(wr)[0],r=cn().memoizedState;return[typeof t=="boolean"?t:qo(t),r]},useSyncExternalStore:U_,useId:_v,useHostTransitionStatus:Nd,useFormState:iv,useActionState:iv,useOptimistic:function(t,r){var a=cn();return Et!==null?V_(a,Et,t,r):(a.baseState=t,[t,a.queue.dispatch])},useMemoCache:xd,useCacheRefresh:vv};xv.useEffectEvent=av;function jd(t,r,a,l){r=t.memoizedState,a=a(l,r),a=a==null?r:p({},r,a),t.memoizedState=a,t.lanes===0&&(t.updateQueue.baseState=a)}var Id={enqueueSetState:function(t,r,a){t=t._reactInternals;var l=bi(),b=Qr(l);b.payload=r,a!=null&&(b.callback=a),r=es(t,b,l),r!==null&&(oi(r,t,l),Uo(r,t,l))},enqueueReplaceState:function(t,r,a){t=t._reactInternals;var l=bi(),b=Qr(l);b.tag=1,b.payload=r,a!=null&&(b.callback=a),r=es(t,b,l),r!==null&&(oi(r,t,l),Uo(r,t,l))},enqueueForceUpdate:function(t,r){t=t._reactInternals;var a=bi(),l=Qr(a);l.tag=2,r!=null&&(l.callback=r),r=es(t,l,a),r!==null&&(oi(r,t,a),Uo(r,t,a))}};function Cv(t,r,a,l,b,x,O){return t=t.stateNode,typeof t.shouldComponentUpdate=="function"?t.shouldComponentUpdate(l,x,O):r.prototype&&r.prototype.isPureReactComponent?!Do(a,l)||!Do(b,x):!0}function Ev(t,r,a,l){t=r.state,typeof r.componentWillReceiveProps=="function"&&r.componentWillReceiveProps(a,l),typeof r.UNSAFE_componentWillReceiveProps=="function"&&r.UNSAFE_componentWillReceiveProps(a,l),r.state!==t&&Id.enqueueReplaceState(r,r.state,null)}function Ws(t,r){var a=r;if("ref"in r){a={};for(var l in r)l!=="ref"&&(a[l]=r[l])}if(t=t.defaultProps){a===r&&(a=p({},a));for(var b in t)a[b]===void 0&&(a[b]=t[b])}return a}function kv(t){_c(t)}function Tv(t){console.error(t)}function Av(t){_c(t)}function Hc(t,r){try{var a=t.onUncaughtError;a(r.value,{componentStack:r.stack})}catch(l){setTimeout(function(){throw l})}}function Rv(t,r,a){try{var l=t.onCaughtError;l(a.value,{componentStack:a.stack,errorBoundary:r.tag===1?r.stateNode:null})}catch(b){setTimeout(function(){throw b})}}function Bd(t,r,a){return a=Qr(a),a.tag=3,a.payload={element:null},a.callback=function(){Hc(t,r)},a}function Lv(t){return t=Qr(t),t.tag=3,t}function Mv(t,r,a,l){var b=a.type.getDerivedStateFromError;if(typeof b=="function"){var x=l.value;t.payload=function(){return b(x)},t.callback=function(){Rv(r,a,l)}}var O=a.stateNode;O!==null&&typeof O.componentDidCatch=="function"&&(t.callback=function(){Rv(r,a,l),typeof b!="function"&&(as===null?as=new Set([this]):as.add(this));var $=l.stack;this.componentDidCatch(l.value,{componentStack:$!==null?$:""})})}function bE(t,r,a,l,b){if(a.flags|=32768,l!==null&&typeof l=="object"&&typeof l.then=="function"){if(r=a.alternate,r!==null&&xa(r,a,b,!0),a=gi.current,a!==null){switch(a.tag){case 31:case 13:return Mi===null?Jc():a.alternate===null&&tn===0&&(tn=3),a.flags&=-257,a.flags|=65536,a.lanes=b,l===Tc?a.flags|=16384:(r=a.updateQueue,r===null?a.updateQueue=new Set([l]):r.add(l),cf(t,l,b)),!1;case 22:return a.flags|=65536,l===Tc?a.flags|=16384:(r=a.updateQueue,r===null?(r={transitions:null,markerInstances:null,retryQueue:new Set([l])},a.updateQueue=r):(a=r.retryQueue,a===null?r.retryQueue=new Set([l]):a.add(l)),cf(t,l,b)),!1}throw Error(s(435,a.tag))}return cf(t,l,b),Jc(),!1}if(lt)return r=gi.current,r!==null?((r.flags&65536)===0&&(r.flags|=256),r.flags|=65536,r.lanes=b,l!==nd&&(t=Error(s(422),{cause:l}),Bo(Ti(t,a)))):(l!==nd&&(r=Error(s(423),{cause:l}),Bo(Ti(r,a))),t=t.current.alternate,t.flags|=65536,b&=-b,t.lanes|=b,l=Ti(l,a),b=Bd(t.stateNode,l,b),fd(t,b),tn!==4&&(tn=2)),!1;var x=Error(s(520),{cause:l});if(x=Ti(x,a),nl===null?nl=[x]:nl.push(x),tn!==4&&(tn=2),r===null)return!0;l=Ti(l,a),a=r;do{switch(a.tag){case 3:return a.flags|=65536,t=b&-b,a.lanes|=t,t=Bd(a.stateNode,l,t),fd(a,t),!1;case 1:if(r=a.type,x=a.stateNode,(a.flags&128)===0&&(typeof r.getDerivedStateFromError=="function"||x!==null&&typeof x.componentDidCatch=="function"&&(as===null||!as.has(x))))return a.flags|=65536,b&=-b,a.lanes|=b,b=Lv(b),Mv(b,t,a,l),fd(a,b),!1}a=a.return}while(a!==null);return!1}var Pd=Error(s(461)),pn=!1;function On(t,r,a,l){r.child=t===null?j_(r,null,a,l):Us(r,t.child,a,l)}function Nv(t,r,a,l,b){a=a.render;var x=r.ref;if("ref"in l){var O={};for(var $ in l)$!=="ref"&&(O[$]=l[$])}else O=l;return Ps(r),l=bd(t,r,a,O,x,b),$=yd(),t!==null&&!pn?(Sd(t,r,b),xr(t,r,b)):(lt&&$&&ed(r),r.flags|=1,On(t,r,l,b),r.child)}function Ov(t,r,a,l,b){if(t===null){var x=a.type;return typeof x=="function"&&!Zh(x)&&x.defaultProps===void 0&&a.compare===null?(r.tag=15,r.type=x,Dv(t,r,x,l,b)):(t=Sc(a.type,null,l,r,r.mode,b),t.ref=r.ref,t.return=r,r.child=t)}if(x=t.child,!qd(t,b)){var O=x.memoizedProps;if(a=a.compare,a=a!==null?a:Do,a(O,l)&&t.ref===r.ref)return xr(t,r,b)}return r.flags|=1,t=_r(x,l),t.ref=r.ref,t.return=r,r.child=t}function Dv(t,r,a,l,b){if(t!==null){var x=t.memoizedProps;if(Do(x,l)&&t.ref===r.ref)if(pn=!1,r.pendingProps=l=x,qd(t,b))(t.flags&131072)!==0&&(pn=!0);else return r.lanes=t.lanes,xr(t,r,b)}return zd(t,r,a,l,b)}function jv(t,r,a,l){var b=l.children,x=t!==null?t.memoizedState:null;if(t===null&&r.stateNode===null&&(r.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),l.mode==="hidden"){if((r.flags&128)!==0){if(x=x!==null?x.baseLanes|a:a,t!==null){for(l=r.child=t.child,b=0;l!==null;)b=b|l.lanes|l.childLanes,l=l.sibling;l=b&~x}else l=0,r.child=null;return Iv(t,r,x,a,l)}if((a&536870912)!==0)r.memoizedState={baseLanes:0,cachePool:null},t!==null&&Ec(r,x!==null?x.cachePool:null),x!==null?P_(r,x):gd(),z_(r);else return l=r.lanes=536870912,Iv(t,r,x!==null?x.baseLanes|a:a,a,l)}else x!==null?(Ec(r,x.cachePool),P_(r,x),ns(),r.memoizedState=null):(t!==null&&Ec(r,null),gd(),ns());return On(t,r,b,a),r.child}function Yo(t,r){return t!==null&&t.tag===22||r.stateNode!==null||(r.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),r.sibling}function Iv(t,r,a,l,b){var x=cd();return x=x===null?null:{parent:dn._currentValue,pool:x},r.memoizedState={baseLanes:a,cachePool:x},t!==null&&Ec(r,null),gd(),z_(r),t!==null&&xa(t,r,l,!0),r.childLanes=b,null}function $c(t,r){return r=Fc({mode:r.mode,children:r.children},t.mode),r.ref=t.ref,t.child=r,r.return=t,r}function Bv(t,r,a){return Us(r,t.child,null,a),t=$c(r,r.pendingProps),t.flags|=2,mi(r),r.memoizedState=null,t}function yE(t,r,a){var l=r.pendingProps,b=(r.flags&128)!==0;if(r.flags&=-129,t===null){if(lt){if(l.mode==="hidden")return t=$c(r,l),r.lanes=536870912,Yo(null,t);if(_d(r),(t=Pt)?(t=Y0(t,Li),t=t!==null&&t.data==="&"?t:null,t!==null&&(r.memoizedState={dehydrated:t,treeContext:Vr!==null?{id:tr,overflow:nr}:null,retryLane:536870912,hydrationErrors:null},a=y_(t),a.return=r,r.child=a,Mn=r,Pt=null)):t=null,t===null)throw Xr(r);return r.lanes=536870912,null}return $c(r,l)}var x=t.memoizedState;if(x!==null){var O=x.dehydrated;if(_d(r),b)if(r.flags&256)r.flags&=-257,r=Bv(t,r,a);else if(r.memoizedState!==null)r.child=t.child,r.flags|=128,r=null;else throw Error(s(558));else if(pn||xa(t,r,a,!1),b=(a&t.childLanes)!==0,pn||b){if(l=Mt,l!==null&&(O=Vt(l,a),O!==0&&O!==x.retryLane))throw x.retryLane=O,Ds(t,O),oi(l,t,O),Pd;Jc(),r=Bv(t,r,a)}else t=x.treeContext,Pt=Ni(O.nextSibling),Mn=r,lt=!0,Yr=null,Li=!1,t!==null&&x_(r,t),r=$c(r,l),r.flags|=4096;return r}return t=_r(t.child,{mode:l.mode,children:l.children}),t.ref=r.ref,r.child=t,t.return=r,t}function Uc(t,r){var a=r.ref;if(a===null)t!==null&&t.ref!==null&&(r.flags|=4194816);else{if(typeof a!="function"&&typeof a!="object")throw Error(s(284));(t===null||t.ref!==a)&&(r.flags|=4194816)}}function zd(t,r,a,l,b){return Ps(r),a=bd(t,r,a,l,void 0,b),l=yd(),t!==null&&!pn?(Sd(t,r,b),xr(t,r,b)):(lt&&l&&ed(r),r.flags|=1,On(t,r,a,b),r.child)}function Pv(t,r,a,l,b,x){return Ps(r),r.updateQueue=null,a=$_(r,l,a,b),H_(t),l=yd(),t!==null&&!pn?(Sd(t,r,x),xr(t,r,x)):(lt&&l&&ed(r),r.flags|=1,On(t,r,a,x),r.child)}function zv(t,r,a,l,b){if(Ps(r),r.stateNode===null){var x=ba,O=a.contextType;typeof O=="object"&&O!==null&&(x=Nn(O)),x=new a(l,x),r.memoizedState=x.state!==null&&x.state!==void 0?x.state:null,x.updater=Id,r.stateNode=x,x._reactInternals=r,x=r.stateNode,x.props=l,x.state=r.memoizedState,x.refs={},hd(r),O=a.contextType,x.context=typeof O=="object"&&O!==null?Nn(O):ba,x.state=r.memoizedState,O=a.getDerivedStateFromProps,typeof O=="function"&&(jd(r,a,O,l),x.state=r.memoizedState),typeof a.getDerivedStateFromProps=="function"||typeof x.getSnapshotBeforeUpdate=="function"||typeof x.UNSAFE_componentWillMount!="function"&&typeof x.componentWillMount!="function"||(O=x.state,typeof x.componentWillMount=="function"&&x.componentWillMount(),typeof x.UNSAFE_componentWillMount=="function"&&x.UNSAFE_componentWillMount(),O!==x.state&&Id.enqueueReplaceState(x,x.state,null),Wo(r,l,x,b),Fo(),x.state=r.memoizedState),typeof x.componentDidMount=="function"&&(r.flags|=4194308),l=!0}else if(t===null){x=r.stateNode;var $=r.memoizedProps,te=Ws(a,$);x.props=te;var ce=x.context,fe=a.contextType;O=ba,typeof fe=="object"&&fe!==null&&(O=Nn(fe));var me=a.getDerivedStateFromProps;fe=typeof me=="function"||typeof x.getSnapshotBeforeUpdate=="function",$=r.pendingProps!==$,fe||typeof x.UNSAFE_componentWillReceiveProps!="function"&&typeof x.componentWillReceiveProps!="function"||($||ce!==O)&&Ev(r,x,l,O),Jr=!1;var ue=r.memoizedState;x.state=ue,Wo(r,l,x,b),Fo(),ce=r.memoizedState,$||ue!==ce||Jr?(typeof me=="function"&&(jd(r,a,me,l),ce=r.memoizedState),(te=Jr||Cv(r,a,te,l,ue,ce,O))?(fe||typeof x.UNSAFE_componentWillMount!="function"&&typeof x.componentWillMount!="function"||(typeof x.componentWillMount=="function"&&x.componentWillMount(),typeof x.UNSAFE_componentWillMount=="function"&&x.UNSAFE_componentWillMount()),typeof x.componentDidMount=="function"&&(r.flags|=4194308)):(typeof x.componentDidMount=="function"&&(r.flags|=4194308),r.memoizedProps=l,r.memoizedState=ce),x.props=l,x.state=ce,x.context=O,l=te):(typeof x.componentDidMount=="function"&&(r.flags|=4194308),l=!1)}else{x=r.stateNode,dd(t,r),O=r.memoizedProps,fe=Ws(a,O),x.props=fe,me=r.pendingProps,ue=x.context,ce=a.contextType,te=ba,typeof ce=="object"&&ce!==null&&(te=Nn(ce)),$=a.getDerivedStateFromProps,(ce=typeof $=="function"||typeof x.getSnapshotBeforeUpdate=="function")||typeof x.UNSAFE_componentWillReceiveProps!="function"&&typeof x.componentWillReceiveProps!="function"||(O!==me||ue!==te)&&Ev(r,x,l,te),Jr=!1,ue=r.memoizedState,x.state=ue,Wo(r,l,x,b),Fo();var he=r.memoizedState;O!==me||ue!==he||Jr||t!==null&&t.dependencies!==null&&xc(t.dependencies)?(typeof $=="function"&&(jd(r,a,$,l),he=r.memoizedState),(fe=Jr||Cv(r,a,fe,l,ue,he,te)||t!==null&&t.dependencies!==null&&xc(t.dependencies))?(ce||typeof x.UNSAFE_componentWillUpdate!="function"&&typeof x.componentWillUpdate!="function"||(typeof x.componentWillUpdate=="function"&&x.componentWillUpdate(l,he,te),typeof x.UNSAFE_componentWillUpdate=="function"&&x.UNSAFE_componentWillUpdate(l,he,te)),typeof x.componentDidUpdate=="function"&&(r.flags|=4),typeof x.getSnapshotBeforeUpdate=="function"&&(r.flags|=1024)):(typeof x.componentDidUpdate!="function"||O===t.memoizedProps&&ue===t.memoizedState||(r.flags|=4),typeof x.getSnapshotBeforeUpdate!="function"||O===t.memoizedProps&&ue===t.memoizedState||(r.flags|=1024),r.memoizedProps=l,r.memoizedState=he),x.props=l,x.state=he,x.context=te,l=fe):(typeof x.componentDidUpdate!="function"||O===t.memoizedProps&&ue===t.memoizedState||(r.flags|=4),typeof x.getSnapshotBeforeUpdate!="function"||O===t.memoizedProps&&ue===t.memoizedState||(r.flags|=1024),l=!1)}return x=l,Uc(t,r),l=(r.flags&128)!==0,x||l?(x=r.stateNode,a=l&&typeof a.getDerivedStateFromError!="function"?null:x.render(),r.flags|=1,t!==null&&l?(r.child=Us(r,t.child,null,b),r.child=Us(r,null,a,b)):On(t,r,a,b),r.memoizedState=x.state,t=r.child):t=xr(t,r,b),t}function Hv(t,r,a,l){return Is(),r.flags|=256,On(t,r,a,l),r.child}var Hd={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function $d(t){return{baseLanes:t,cachePool:R_()}}function Ud(t,r,a){return t=t!==null?t.childLanes&~a:0,r&&(t|=vi),t}function $v(t,r,a){var l=r.pendingProps,b=!1,x=(r.flags&128)!==0,O;if((O=x)||(O=t!==null&&t.memoizedState===null?!1:(ln.current&2)!==0),O&&(b=!0,r.flags&=-129),O=(r.flags&32)!==0,r.flags&=-33,t===null){if(lt){if(b?ts(r):ns(),(t=Pt)?(t=Y0(t,Li),t=t!==null&&t.data!=="&"?t:null,t!==null&&(r.memoizedState={dehydrated:t,treeContext:Vr!==null?{id:tr,overflow:nr}:null,retryLane:536870912,hydrationErrors:null},a=y_(t),a.return=r,r.child=a,Mn=r,Pt=null)):t=null,t===null)throw Xr(r);return Ef(t)?r.lanes=32:r.lanes=536870912,null}var $=l.children;return l=l.fallback,b?(ns(),b=r.mode,$=Fc({mode:"hidden",children:$},b),l=js(l,b,a,null),$.return=r,l.return=r,$.sibling=l,r.child=$,l=r.child,l.memoizedState=$d(a),l.childLanes=Ud(t,O,a),r.memoizedState=Hd,Yo(null,l)):(ts(r),Fd(r,$))}var te=t.memoizedState;if(te!==null&&($=te.dehydrated,$!==null)){if(x)r.flags&256?(ts(r),r.flags&=-257,r=Wd(t,r,a)):r.memoizedState!==null?(ns(),r.child=t.child,r.flags|=128,r=null):(ns(),$=l.fallback,b=r.mode,l=Fc({mode:"visible",children:l.children},b),$=js($,b,a,null),$.flags|=2,l.return=r,$.return=r,l.sibling=$,r.child=l,Us(r,t.child,null,a),l=r.child,l.memoizedState=$d(a),l.childLanes=Ud(t,O,a),r.memoizedState=Hd,r=Yo(null,l));else if(ts(r),Ef($)){if(O=$.nextSibling&&$.nextSibling.dataset,O)var ce=O.dgst;O=ce,l=Error(s(419)),l.stack="",l.digest=O,Bo({value:l,source:null,stack:null}),r=Wd(t,r,a)}else if(pn||xa(t,r,a,!1),O=(a&t.childLanes)!==0,pn||O){if(O=Mt,O!==null&&(l=Vt(O,a),l!==0&&l!==te.retryLane))throw te.retryLane=l,Ds(t,l),oi(O,t,l),Pd;Cf($)||Jc(),r=Wd(t,r,a)}else Cf($)?(r.flags|=192,r.child=t.child,r=null):(t=te.treeContext,Pt=Ni($.nextSibling),Mn=r,lt=!0,Yr=null,Li=!1,t!==null&&x_(r,t),r=Fd(r,l.children),r.flags|=4096);return r}return b?(ns(),$=l.fallback,b=r.mode,te=t.child,ce=te.sibling,l=_r(te,{mode:"hidden",children:l.children}),l.subtreeFlags=te.subtreeFlags&65011712,ce!==null?$=_r(ce,$):($=js($,b,a,null),$.flags|=2),$.return=r,l.return=r,l.sibling=$,r.child=l,Yo(null,l),l=r.child,$=t.child.memoizedState,$===null?$=$d(a):(b=$.cachePool,b!==null?(te=dn._currentValue,b=b.parent!==te?{parent:te,pool:te}:b):b=R_(),$={baseLanes:$.baseLanes|a,cachePool:b}),l.memoizedState=$,l.childLanes=Ud(t,O,a),r.memoizedState=Hd,Yo(t.child,l)):(ts(r),a=t.child,t=a.sibling,a=_r(a,{mode:"visible",children:l.children}),a.return=r,a.sibling=null,t!==null&&(O=r.deletions,O===null?(r.deletions=[t],r.flags|=16):O.push(t)),r.child=a,r.memoizedState=null,a)}function Fd(t,r){return r=Fc({mode:"visible",children:r},t.mode),r.return=t,t.child=r}function Fc(t,r){return t=pi(22,t,null,r),t.lanes=0,t}function Wd(t,r,a){return Us(r,t.child,null,a),t=Fd(r,r.pendingProps.children),t.flags|=2,r.memoizedState=null,t}function Uv(t,r,a){t.lanes|=r;var l=t.alternate;l!==null&&(l.lanes|=r),sd(t.return,r,a)}function Gd(t,r,a,l,b,x){var O=t.memoizedState;O===null?t.memoizedState={isBackwards:r,rendering:null,renderingStartTime:0,last:l,tail:a,tailMode:b,treeForkCount:x}:(O.isBackwards=r,O.rendering=null,O.renderingStartTime=0,O.last=l,O.tail=a,O.tailMode=b,O.treeForkCount=x)}function Fv(t,r,a){var l=r.pendingProps,b=l.revealOrder,x=l.tail;l=l.children;var O=ln.current,$=(O&2)!==0;if($?(O=O&1|2,r.flags|=128):O&=1,G(ln,O),On(t,r,l,a),l=lt?Io:0,!$&&t!==null&&(t.flags&128)!==0)e:for(t=r.child;t!==null;){if(t.tag===13)t.memoizedState!==null&&Uv(t,a,r);else if(t.tag===19)Uv(t,a,r);else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===r)break e;for(;t.sibling===null;){if(t.return===null||t.return===r)break e;t=t.return}t.sibling.return=t.return,t=t.sibling}switch(b){case"forwards":for(a=r.child,b=null;a!==null;)t=a.alternate,t!==null&&Mc(t)===null&&(b=a),a=a.sibling;a=b,a===null?(b=r.child,r.child=null):(b=a.sibling,a.sibling=null),Gd(r,!1,b,a,x,l);break;case"backwards":case"unstable_legacy-backwards":for(a=null,b=r.child,r.child=null;b!==null;){if(t=b.alternate,t!==null&&Mc(t)===null){r.child=b;break}t=b.sibling,b.sibling=a,a=b,b=t}Gd(r,!0,a,null,x,l);break;case"together":Gd(r,!1,null,null,void 0,l);break;default:r.memoizedState=null}return r.child}function xr(t,r,a){if(t!==null&&(r.dependencies=t.dependencies),ss|=r.lanes,(a&r.childLanes)===0)if(t!==null){if(xa(t,r,a,!1),(a&r.childLanes)===0)return null}else return null;if(t!==null&&r.child!==t.child)throw Error(s(153));if(r.child!==null){for(t=r.child,a=_r(t,t.pendingProps),r.child=a,a.return=r;t.sibling!==null;)t=t.sibling,a=a.sibling=_r(t,t.pendingProps),a.return=r;a.sibling=null}return r.child}function qd(t,r){return(t.lanes&r)!==0?!0:(t=t.dependencies,!!(t!==null&&xc(t)))}function SE(t,r,a){switch(r.tag){case 3:H(r,r.stateNode.containerInfo),Zr(r,dn,t.memoizedState.cache),Is();break;case 27:case 5:de(r);break;case 4:H(r,r.stateNode.containerInfo);break;case 10:Zr(r,r.type,r.memoizedProps.value);break;case 31:if(r.memoizedState!==null)return r.flags|=128,_d(r),null;break;case 13:var l=r.memoizedState;if(l!==null)return l.dehydrated!==null?(ts(r),r.flags|=128,null):(a&r.child.childLanes)!==0?$v(t,r,a):(ts(r),t=xr(t,r,a),t!==null?t.sibling:null);ts(r);break;case 19:var b=(t.flags&128)!==0;if(l=(a&r.childLanes)!==0,l||(xa(t,r,a,!1),l=(a&r.childLanes)!==0),b){if(l)return Fv(t,r,a);r.flags|=128}if(b=r.memoizedState,b!==null&&(b.rendering=null,b.tail=null,b.lastEffect=null),G(ln,ln.current),l)break;return null;case 22:return r.lanes=0,jv(t,r,a,r.pendingProps);case 24:Zr(r,dn,t.memoizedState.cache)}return xr(t,r,a)}function Wv(t,r,a){if(t!==null)if(t.memoizedProps!==r.pendingProps)pn=!0;else{if(!qd(t,a)&&(r.flags&128)===0)return pn=!1,SE(t,r,a);pn=(t.flags&131072)!==0}else pn=!1,lt&&(r.flags&1048576)!==0&&w_(r,Io,r.index);switch(r.lanes=0,r.tag){case 16:e:{var l=r.pendingProps;if(t=Hs(r.elementType),r.type=t,typeof t=="function")Zh(t)?(l=Ws(t,l),r.tag=1,r=zv(null,r,t,l,a)):(r.tag=0,r=zd(null,r,t,l,a));else{if(t!=null){var b=t.$$typeof;if(b===k){r.tag=11,r=Nv(null,r,t,l,a);break e}else if(b===M){r.tag=14,r=Ov(null,r,t,l,a);break e}}throw r=Z(t)||t,Error(s(306,r,""))}}return r;case 0:return zd(t,r,r.type,r.pendingProps,a);case 1:return l=r.type,b=Ws(l,r.pendingProps),zv(t,r,l,b,a);case 3:e:{if(H(r,r.stateNode.containerInfo),t===null)throw Error(s(387));l=r.pendingProps;var x=r.memoizedState;b=x.element,dd(t,r),Wo(r,l,null,a);var O=r.memoizedState;if(l=O.cache,Zr(r,dn,l),l!==x.cache&&ad(r,[dn],a,!0),Fo(),l=O.element,x.isDehydrated)if(x={element:l,isDehydrated:!1,cache:O.cache},r.updateQueue.baseState=x,r.memoizedState=x,r.flags&256){r=Hv(t,r,l,a);break e}else if(l!==b){b=Ti(Error(s(424)),r),Bo(b),r=Hv(t,r,l,a);break e}else for(t=r.stateNode.containerInfo,t.nodeType===9?t=t.body:t=t.nodeName==="HTML"?t.ownerDocument.body:t,Pt=Ni(t.firstChild),Mn=r,lt=!0,Yr=null,Li=!0,a=j_(r,null,l,a),r.child=a;a;)a.flags=a.flags&-3|4096,a=a.sibling;else{if(Is(),l===b){r=xr(t,r,a);break e}On(t,r,l,a)}r=r.child}return r;case 26:return Uc(t,r),t===null?(a=tb(r.type,null,r.pendingProps,null))?r.memoizedState=a:lt||(a=r.type,t=r.pendingProps,l=su(se.current).createElement(a),l[It]=r,l[Nt]=t,Dn(l,a,t),Je(l),r.stateNode=l):r.memoizedState=tb(r.type,t.memoizedProps,r.pendingProps,t.memoizedState),null;case 27:return de(r),t===null&<&&(l=r.stateNode=J0(r.type,r.pendingProps,se.current),Mn=r,Li=!0,b=Pt,us(r.type)?(kf=b,Pt=Ni(l.firstChild)):Pt=b),On(t,r,r.pendingProps.children,a),Uc(t,r),t===null&&(r.flags|=4194304),r.child;case 5:return t===null&<&&((b=l=Pt)&&(l=ZE(l,r.type,r.pendingProps,Li),l!==null?(r.stateNode=l,Mn=r,Pt=Ni(l.firstChild),Li=!1,b=!0):b=!1),b||Xr(r)),de(r),b=r.type,x=r.pendingProps,O=t!==null?t.memoizedProps:null,l=x.children,Sf(b,x)?l=null:O!==null&&Sf(b,O)&&(r.flags|=32),r.memoizedState!==null&&(b=bd(t,r,dE,null,null,a),ul._currentValue=b),Uc(t,r),On(t,r,l,a),r.child;case 6:return t===null&<&&((t=a=Pt)&&(a=JE(a,r.pendingProps,Li),a!==null?(r.stateNode=a,Mn=r,Pt=null,t=!0):t=!1),t||Xr(r)),null;case 13:return $v(t,r,a);case 4:return H(r,r.stateNode.containerInfo),l=r.pendingProps,t===null?r.child=Us(r,null,l,a):On(t,r,l,a),r.child;case 11:return Nv(t,r,r.type,r.pendingProps,a);case 7:return On(t,r,r.pendingProps,a),r.child;case 8:return On(t,r,r.pendingProps.children,a),r.child;case 12:return On(t,r,r.pendingProps.children,a),r.child;case 10:return l=r.pendingProps,Zr(r,r.type,l.value),On(t,r,l.children,a),r.child;case 9:return b=r.type._context,l=r.pendingProps.children,Ps(r),b=Nn(b),l=l(b),r.flags|=1,On(t,r,l,a),r.child;case 14:return Ov(t,r,r.type,r.pendingProps,a);case 15:return Dv(t,r,r.type,r.pendingProps,a);case 19:return Fv(t,r,a);case 31:return yE(t,r,a);case 22:return jv(t,r,a,r.pendingProps);case 24:return Ps(r),l=Nn(dn),t===null?(b=cd(),b===null&&(b=Mt,x=od(),b.pooledCache=x,x.refCount++,x!==null&&(b.pooledCacheLanes|=a),b=x),r.memoizedState={parent:l,cache:b},hd(r),Zr(r,dn,b)):((t.lanes&a)!==0&&(dd(t,r),Wo(r,null,null,a),Fo()),b=t.memoizedState,x=r.memoizedState,b.parent!==l?(b={parent:l,cache:l},r.memoizedState=b,r.lanes===0&&(r.memoizedState=r.updateQueue.baseState=b),Zr(r,dn,l)):(l=x.cache,Zr(r,dn,l),l!==b.cache&&ad(r,[dn],a,!0))),On(t,r,r.pendingProps.children,a),r.child;case 29:throw r.pendingProps}throw Error(s(156,r.tag))}function Cr(t){t.flags|=4}function Kd(t,r,a,l,b){if((r=(t.mode&32)!==0)&&(r=!1),r){if(t.flags|=16777216,(b&335544128)===b)if(t.stateNode.complete)t.flags|=8192;else if(_0())t.flags|=8192;else throw $s=Tc,ud}else t.flags&=-16777217}function Gv(t,r){if(r.type!=="stylesheet"||(r.state.loading&4)!==0)t.flags&=-16777217;else if(t.flags|=16777216,!ab(r))if(_0())t.flags|=8192;else throw $s=Tc,ud}function Wc(t,r){r!==null&&(t.flags|=4),t.flags&16384&&(r=t.tag!==22?je():536870912,t.lanes|=r,ja|=r)}function Xo(t,r){if(!lt)switch(t.tailMode){case"hidden":r=t.tail;for(var a=null;r!==null;)r.alternate!==null&&(a=r),r=r.sibling;a===null?t.tail=null:a.sibling=null;break;case"collapsed":a=t.tail;for(var l=null;a!==null;)a.alternate!==null&&(l=a),a=a.sibling;l===null?r||t.tail===null?t.tail=null:t.tail.sibling=null:l.sibling=null}}function zt(t){var r=t.alternate!==null&&t.alternate.child===t.child,a=0,l=0;if(r)for(var b=t.child;b!==null;)a|=b.lanes|b.childLanes,l|=b.subtreeFlags&65011712,l|=b.flags&65011712,b.return=t,b=b.sibling;else for(b=t.child;b!==null;)a|=b.lanes|b.childLanes,l|=b.subtreeFlags,l|=b.flags,b.return=t,b=b.sibling;return t.subtreeFlags|=l,t.childLanes=a,r}function wE(t,r,a){var l=r.pendingProps;switch(td(r),r.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return zt(r),null;case 1:return zt(r),null;case 3:return a=r.stateNode,l=null,t!==null&&(l=t.memoizedState.cache),r.memoizedState.cache!==l&&(r.flags|=2048),yr(dn),ae(),a.pendingContext&&(a.context=a.pendingContext,a.pendingContext=null),(t===null||t.child===null)&&(wa(r)?Cr(r):t===null||t.memoizedState.isDehydrated&&(r.flags&256)===0||(r.flags|=1024,id())),zt(r),null;case 26:var b=r.type,x=r.memoizedState;return t===null?(Cr(r),x!==null?(zt(r),Gv(r,x)):(zt(r),Kd(r,b,null,l,a))):x?x!==t.memoizedState?(Cr(r),zt(r),Gv(r,x)):(zt(r),r.flags&=-16777217):(t=t.memoizedProps,t!==l&&Cr(r),zt(r),Kd(r,b,t,l,a)),null;case 27:if(we(r),a=se.current,b=r.type,t!==null&&r.stateNode!=null)t.memoizedProps!==l&&Cr(r);else{if(!l){if(r.stateNode===null)throw Error(s(166));return zt(r),null}t=Y.current,wa(r)?C_(r):(t=J0(b,l,a),r.stateNode=t,Cr(r))}return zt(r),null;case 5:if(we(r),b=r.type,t!==null&&r.stateNode!=null)t.memoizedProps!==l&&Cr(r);else{if(!l){if(r.stateNode===null)throw Error(s(166));return zt(r),null}if(x=Y.current,wa(r))C_(r);else{var O=su(se.current);switch(x){case 1:x=O.createElementNS("http://www.w3.org/2000/svg",b);break;case 2:x=O.createElementNS("http://www.w3.org/1998/Math/MathML",b);break;default:switch(b){case"svg":x=O.createElementNS("http://www.w3.org/2000/svg",b);break;case"math":x=O.createElementNS("http://www.w3.org/1998/Math/MathML",b);break;case"script":x=O.createElement("div"),x.innerHTML="<script><\/script>",x=x.removeChild(x.firstChild);break;case"select":x=typeof l.is=="string"?O.createElement("select",{is:l.is}):O.createElement("select"),l.multiple?x.multiple=!0:l.size&&(x.size=l.size);break;default:x=typeof l.is=="string"?O.createElement(b,{is:l.is}):O.createElement(b)}}x[It]=r,x[Nt]=l;e:for(O=r.child;O!==null;){if(O.tag===5||O.tag===6)x.appendChild(O.stateNode);else if(O.tag!==4&&O.tag!==27&&O.child!==null){O.child.return=O,O=O.child;continue}if(O===r)break e;for(;O.sibling===null;){if(O.return===null||O.return===r)break e;O=O.return}O.sibling.return=O.return,O=O.sibling}r.stateNode=x;e:switch(Dn(x,b,l),b){case"button":case"input":case"select":case"textarea":l=!!l.autoFocus;break e;case"img":l=!0;break e;default:l=!1}l&&Cr(r)}}return zt(r),Kd(r,r.type,t===null?null:t.memoizedProps,r.pendingProps,a),null;case 6:if(t&&r.stateNode!=null)t.memoizedProps!==l&&Cr(r);else{if(typeof l!="string"&&r.stateNode===null)throw Error(s(166));if(t=se.current,wa(r)){if(t=r.stateNode,a=r.memoizedProps,l=null,b=Mn,b!==null)switch(b.tag){case 27:case 5:l=b.memoizedProps}t[It]=r,t=!!(t.nodeValue===a||l!==null&&l.suppressHydrationWarning===!0||$0(t.nodeValue,a)),t||Xr(r,!0)}else t=su(t).createTextNode(l),t[It]=r,r.stateNode=t}return zt(r),null;case 31:if(a=r.memoizedState,t===null||t.memoizedState!==null){if(l=wa(r),a!==null){if(t===null){if(!l)throw Error(s(318));if(t=r.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(s(557));t[It]=r}else Is(),(r.flags&128)===0&&(r.memoizedState=null),r.flags|=4;zt(r),t=!1}else a=id(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=a),t=!0;if(!t)return r.flags&256?(mi(r),r):(mi(r),null);if((r.flags&128)!==0)throw Error(s(558))}return zt(r),null;case 13:if(l=r.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(b=wa(r),l!==null&&l.dehydrated!==null){if(t===null){if(!b)throw Error(s(318));if(b=r.memoizedState,b=b!==null?b.dehydrated:null,!b)throw Error(s(317));b[It]=r}else Is(),(r.flags&128)===0&&(r.memoizedState=null),r.flags|=4;zt(r),b=!1}else b=id(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=b),b=!0;if(!b)return r.flags&256?(mi(r),r):(mi(r),null)}return mi(r),(r.flags&128)!==0?(r.lanes=a,r):(a=l!==null,t=t!==null&&t.memoizedState!==null,a&&(l=r.child,b=null,l.alternate!==null&&l.alternate.memoizedState!==null&&l.alternate.memoizedState.cachePool!==null&&(b=l.alternate.memoizedState.cachePool.pool),x=null,l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(x=l.memoizedState.cachePool.pool),x!==b&&(l.flags|=2048)),a!==t&&a&&(r.child.flags|=8192),Wc(r,r.updateQueue),zt(r),null);case 4:return ae(),t===null&&mf(r.stateNode.containerInfo),zt(r),null;case 10:return yr(r.type),zt(r),null;case 19:if(U(ln),l=r.memoizedState,l===null)return zt(r),null;if(b=(r.flags&128)!==0,x=l.rendering,x===null)if(b)Xo(l,!1);else{if(tn!==0||t!==null&&(t.flags&128)!==0)for(t=r.child;t!==null;){if(x=Mc(t),x!==null){for(r.flags|=128,Xo(l,!1),t=x.updateQueue,r.updateQueue=t,Wc(r,t),r.subtreeFlags=0,t=a,a=r.child;a!==null;)b_(a,t),a=a.sibling;return G(ln,ln.current&1|2),lt&&vr(r,l.treeForkCount),r.child}t=t.sibling}l.tail!==null&&ht()>Yc&&(r.flags|=128,b=!0,Xo(l,!1),r.lanes=4194304)}else{if(!b)if(t=Mc(x),t!==null){if(r.flags|=128,b=!0,t=t.updateQueue,r.updateQueue=t,Wc(r,t),Xo(l,!0),l.tail===null&&l.tailMode==="hidden"&&!x.alternate&&!lt)return zt(r),null}else 2*ht()-l.renderingStartTime>Yc&&a!==536870912&&(r.flags|=128,b=!0,Xo(l,!1),r.lanes=4194304);l.isBackwards?(x.sibling=r.child,r.child=x):(t=l.last,t!==null?t.sibling=x:r.child=x,l.last=x)}return l.tail!==null?(t=l.tail,l.rendering=t,l.tail=t.sibling,l.renderingStartTime=ht(),t.sibling=null,a=ln.current,G(ln,b?a&1|2:a&1),lt&&vr(r,l.treeForkCount),t):(zt(r),null);case 22:case 23:return mi(r),md(),l=r.memoizedState!==null,t!==null?t.memoizedState!==null!==l&&(r.flags|=8192):l&&(r.flags|=8192),l?(a&536870912)!==0&&(r.flags&128)===0&&(zt(r),r.subtreeFlags&6&&(r.flags|=8192)):zt(r),a=r.updateQueue,a!==null&&Wc(r,a.retryQueue),a=null,t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(a=t.memoizedState.cachePool.pool),l=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(l=r.memoizedState.cachePool.pool),l!==a&&(r.flags|=2048),t!==null&&U(zs),null;case 24:return a=null,t!==null&&(a=t.memoizedState.cache),r.memoizedState.cache!==a&&(r.flags|=2048),yr(dn),zt(r),null;case 25:return null;case 30:return null}throw Error(s(156,r.tag))}function xE(t,r){switch(td(r),r.tag){case 1:return t=r.flags,t&65536?(r.flags=t&-65537|128,r):null;case 3:return yr(dn),ae(),t=r.flags,(t&65536)!==0&&(t&128)===0?(r.flags=t&-65537|128,r):null;case 26:case 27:case 5:return we(r),null;case 31:if(r.memoizedState!==null){if(mi(r),r.alternate===null)throw Error(s(340));Is()}return t=r.flags,t&65536?(r.flags=t&-65537|128,r):null;case 13:if(mi(r),t=r.memoizedState,t!==null&&t.dehydrated!==null){if(r.alternate===null)throw Error(s(340));Is()}return t=r.flags,t&65536?(r.flags=t&-65537|128,r):null;case 19:return U(ln),null;case 4:return ae(),null;case 10:return yr(r.type),null;case 22:case 23:return mi(r),md(),t!==null&&U(zs),t=r.flags,t&65536?(r.flags=t&-65537|128,r):null;case 24:return yr(dn),null;case 25:return null;default:return null}}function qv(t,r){switch(td(r),r.tag){case 3:yr(dn),ae();break;case 26:case 27:case 5:we(r);break;case 4:ae();break;case 31:r.memoizedState!==null&&mi(r);break;case 13:mi(r);break;case 19:U(ln);break;case 10:yr(r.type);break;case 22:case 23:mi(r),md(),t!==null&&U(zs);break;case 24:yr(dn)}}function Zo(t,r){try{var a=r.updateQueue,l=a!==null?a.lastEffect:null;if(l!==null){var b=l.next;a=b;do{if((a.tag&t)===t){l=void 0;var x=a.create,O=a.inst;l=x(),O.destroy=l}a=a.next}while(a!==b)}}catch($){wt(r,r.return,$)}}function is(t,r,a){try{var l=r.updateQueue,b=l!==null?l.lastEffect:null;if(b!==null){var x=b.next;l=x;do{if((l.tag&t)===t){var O=l.inst,$=O.destroy;if($!==void 0){O.destroy=void 0,b=r;var te=a,ce=$;try{ce()}catch(fe){wt(b,te,fe)}}}l=l.next}while(l!==x)}}catch(fe){wt(r,r.return,fe)}}function Kv(t){var r=t.updateQueue;if(r!==null){var a=t.stateNode;try{B_(r,a)}catch(l){wt(t,t.return,l)}}}function Vv(t,r,a){a.props=Ws(t.type,t.memoizedProps),a.state=t.memoizedState;try{a.componentWillUnmount()}catch(l){wt(t,r,l)}}function Jo(t,r){try{var a=t.ref;if(a!==null){switch(t.tag){case 26:case 27:case 5:var l=t.stateNode;break;case 30:l=t.stateNode;break;default:l=t.stateNode}typeof a=="function"?t.refCleanup=a(l):a.current=l}}catch(b){wt(t,r,b)}}function ir(t,r){var a=t.ref,l=t.refCleanup;if(a!==null)if(typeof l=="function")try{l()}catch(b){wt(t,r,b)}finally{t.refCleanup=null,t=t.alternate,t!=null&&(t.refCleanup=null)}else if(typeof a=="function")try{a(null)}catch(b){wt(t,r,b)}else a.current=null}function Yv(t){var r=t.type,a=t.memoizedProps,l=t.stateNode;try{e:switch(r){case"button":case"input":case"select":case"textarea":a.autoFocus&&l.focus();break e;case"img":a.src?l.src=a.src:a.srcSet&&(l.srcset=a.srcSet)}}catch(b){wt(t,t.return,b)}}function Vd(t,r,a){try{var l=t.stateNode;GE(l,t.type,a,r),l[Nt]=r}catch(b){wt(t,t.return,b)}}function Xv(t){return t.tag===5||t.tag===3||t.tag===26||t.tag===27&&us(t.type)||t.tag===4}function Yd(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||Xv(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&&us(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 Xd(t,r,a){var l=t.tag;if(l===5||l===6)t=t.stateNode,r?(a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a).insertBefore(t,r):(r=a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a,r.appendChild(t),a=a._reactRootContainer,a!=null||r.onclick!==null||(r.onclick=xe));else if(l!==4&&(l===27&&us(t.type)&&(a=t.stateNode,r=null),t=t.child,t!==null))for(Xd(t,r,a),t=t.sibling;t!==null;)Xd(t,r,a),t=t.sibling}function Gc(t,r,a){var l=t.tag;if(l===5||l===6)t=t.stateNode,r?a.insertBefore(t,r):a.appendChild(t);else if(l!==4&&(l===27&&us(t.type)&&(a=t.stateNode),t=t.child,t!==null))for(Gc(t,r,a),t=t.sibling;t!==null;)Gc(t,r,a),t=t.sibling}function Zv(t){var r=t.stateNode,a=t.memoizedProps;try{for(var l=t.type,b=r.attributes;b.length;)r.removeAttributeNode(b[0]);Dn(r,l,a),r[It]=t,r[Nt]=a}catch(x){wt(t,t.return,x)}}var Er=!1,gn=!1,Zd=!1,Jv=typeof WeakSet=="function"?WeakSet:Set,Sn=null;function CE(t,r){if(t=t.containerInfo,bf=du,t=u_(t),Wh(t)){if("selectionStart"in t)var a={start:t.selectionStart,end:t.selectionEnd};else e:{a=(a=t.ownerDocument)&&a.defaultView||window;var l=a.getSelection&&a.getSelection();if(l&&l.rangeCount!==0){a=l.anchorNode;var b=l.anchorOffset,x=l.focusNode;l=l.focusOffset;try{a.nodeType,x.nodeType}catch{a=null;break e}var O=0,$=-1,te=-1,ce=0,fe=0,me=t,ue=null;t:for(;;){for(var he;me!==a||b!==0&&me.nodeType!==3||($=O+b),me!==x||l!==0&&me.nodeType!==3||(te=O+l),me.nodeType===3&&(O+=me.nodeValue.length),(he=me.firstChild)!==null;)ue=me,me=he;for(;;){if(me===t)break t;if(ue===a&&++ce===b&&($=O),ue===x&&++fe===l&&(te=O),(he=me.nextSibling)!==null)break;me=ue,ue=me.parentNode}me=he}a=$===-1||te===-1?null:{start:$,end:te}}else a=null}a=a||{start:0,end:0}}else a=null;for(yf={focusedElem:t,selectionRange:a},du=!1,Sn=r;Sn!==null;)if(r=Sn,t=r.child,(r.subtreeFlags&1028)!==0&&t!==null)t.return=r,Sn=t;else for(;Sn!==null;){switch(r=Sn,x=r.alternate,t=r.flags,r.tag){case 0:if((t&4)!==0&&(t=r.updateQueue,t=t!==null?t.events:null,t!==null))for(a=0;a<t.length;a++)b=t[a],b.ref.impl=b.nextImpl;break;case 11:case 15:break;case 1:if((t&1024)!==0&&x!==null){t=void 0,a=r,b=x.memoizedProps,x=x.memoizedState,l=a.stateNode;try{var Te=Ws(a.type,b);t=l.getSnapshotBeforeUpdate(Te,x),l.__reactInternalSnapshotBeforeUpdate=t}catch(ze){wt(a,a.return,ze)}}break;case 3:if((t&1024)!==0){if(t=r.stateNode.containerInfo,a=t.nodeType,a===9)xf(t);else if(a===1)switch(t.nodeName){case"HEAD":case"HTML":case"BODY":xf(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(s(163))}if(t=r.sibling,t!==null){t.return=r.return,Sn=t;break}Sn=r.return}}function Qv(t,r,a){var l=a.flags;switch(a.tag){case 0:case 11:case 15:Tr(t,a),l&4&&Zo(5,a);break;case 1:if(Tr(t,a),l&4)if(t=a.stateNode,r===null)try{t.componentDidMount()}catch(O){wt(a,a.return,O)}else{var b=Ws(a.type,r.memoizedProps);r=r.memoizedState;try{t.componentDidUpdate(b,r,t.__reactInternalSnapshotBeforeUpdate)}catch(O){wt(a,a.return,O)}}l&64&&Kv(a),l&512&&Jo(a,a.return);break;case 3:if(Tr(t,a),l&64&&(t=a.updateQueue,t!==null)){if(r=null,a.child!==null)switch(a.child.tag){case 27:case 5:r=a.child.stateNode;break;case 1:r=a.child.stateNode}try{B_(t,r)}catch(O){wt(a,a.return,O)}}break;case 27:r===null&&l&4&&Zv(a);case 26:case 5:Tr(t,a),r===null&&l&4&&Yv(a),l&512&&Jo(a,a.return);break;case 12:Tr(t,a);break;case 31:Tr(t,a),l&4&&n0(t,a);break;case 13:Tr(t,a),l&4&&i0(t,a),l&64&&(t=a.memoizedState,t!==null&&(t=t.dehydrated,t!==null&&(a=OE.bind(null,a),QE(t,a))));break;case 22:if(l=a.memoizedState!==null||Er,!l){r=r!==null&&r.memoizedState!==null||gn,b=Er;var x=gn;Er=l,(gn=r)&&!x?Ar(t,a,(a.subtreeFlags&8772)!==0):Tr(t,a),Er=b,gn=x}break;case 30:break;default:Tr(t,a)}}function e0(t){var r=t.alternate;r!==null&&(t.alternate=null,e0(r)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(r=t.stateNode,r!==null&&De(r)),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 Gt=null,ii=!1;function kr(t,r,a){for(a=a.child;a!==null;)t0(t,r,a),a=a.sibling}function t0(t,r,a){if(ve&&typeof ve.onCommitFiberUnmount=="function")try{ve.onCommitFiberUnmount(Tn,a)}catch{}switch(a.tag){case 26:gn||ir(a,r),kr(t,r,a),a.memoizedState?a.memoizedState.count--:a.stateNode&&(a=a.stateNode,a.parentNode.removeChild(a));break;case 27:gn||ir(a,r);var l=Gt,b=ii;us(a.type)&&(Gt=a.stateNode,ii=!1),kr(t,r,a),ol(a.stateNode),Gt=l,ii=b;break;case 5:gn||ir(a,r);case 6:if(l=Gt,b=ii,Gt=null,kr(t,r,a),Gt=l,ii=b,Gt!==null)if(ii)try{(Gt.nodeType===9?Gt.body:Gt.nodeName==="HTML"?Gt.ownerDocument.body:Gt).removeChild(a.stateNode)}catch(x){wt(a,r,x)}else try{Gt.removeChild(a.stateNode)}catch(x){wt(a,r,x)}break;case 18:Gt!==null&&(ii?(t=Gt,K0(t.nodeType===9?t.body:t.nodeName==="HTML"?t.ownerDocument.body:t,a.stateNode),Fa(t)):K0(Gt,a.stateNode));break;case 4:l=Gt,b=ii,Gt=a.stateNode.containerInfo,ii=!0,kr(t,r,a),Gt=l,ii=b;break;case 0:case 11:case 14:case 15:is(2,a,r),gn||is(4,a,r),kr(t,r,a);break;case 1:gn||(ir(a,r),l=a.stateNode,typeof l.componentWillUnmount=="function"&&Vv(a,r,l)),kr(t,r,a);break;case 21:kr(t,r,a);break;case 22:gn=(l=gn)||a.memoizedState!==null,kr(t,r,a),gn=l;break;default:kr(t,r,a)}}function n0(t,r){if(r.memoizedState===null&&(t=r.alternate,t!==null&&(t=t.memoizedState,t!==null))){t=t.dehydrated;try{Fa(t)}catch(a){wt(r,r.return,a)}}}function i0(t,r){if(r.memoizedState===null&&(t=r.alternate,t!==null&&(t=t.memoizedState,t!==null&&(t=t.dehydrated,t!==null))))try{Fa(t)}catch(a){wt(r,r.return,a)}}function EE(t){switch(t.tag){case 31:case 13:case 19:var r=t.stateNode;return r===null&&(r=t.stateNode=new Jv),r;case 22:return t=t.stateNode,r=t._retryCache,r===null&&(r=t._retryCache=new Jv),r;default:throw Error(s(435,t.tag))}}function qc(t,r){var a=EE(t);r.forEach(function(l){if(!a.has(l)){a.add(l);var b=DE.bind(null,t,l);l.then(b,b)}})}function ri(t,r){var a=r.deletions;if(a!==null)for(var l=0;l<a.length;l++){var b=a[l],x=t,O=r,$=O;e:for(;$!==null;){switch($.tag){case 27:if(us($.type)){Gt=$.stateNode,ii=!1;break e}break;case 5:Gt=$.stateNode,ii=!1;break e;case 3:case 4:Gt=$.stateNode.containerInfo,ii=!0;break e}$=$.return}if(Gt===null)throw Error(s(160));t0(x,O,b),Gt=null,ii=!1,x=b.alternate,x!==null&&(x.return=null),b.return=null}if(r.subtreeFlags&13886)for(r=r.child;r!==null;)r0(r,t),r=r.sibling}var Gi=null;function r0(t,r){var a=t.alternate,l=t.flags;switch(t.tag){case 0:case 11:case 14:case 15:ri(r,t),si(t),l&4&&(is(3,t,t.return),Zo(3,t),is(5,t,t.return));break;case 1:ri(r,t),si(t),l&512&&(gn||a===null||ir(a,a.return)),l&64&&Er&&(t=t.updateQueue,t!==null&&(l=t.callbacks,l!==null&&(a=t.shared.hiddenCallbacks,t.shared.hiddenCallbacks=a===null?l:a.concat(l))));break;case 26:var b=Gi;if(ri(r,t),si(t),l&512&&(gn||a===null||ir(a,a.return)),l&4){var x=a!==null?a.memoizedState:null;if(l=t.memoizedState,a===null)if(l===null)if(t.stateNode===null){e:{l=t.type,a=t.memoizedProps,b=b.ownerDocument||b;t:switch(l){case"title":x=b.getElementsByTagName("title")[0],(!x||x[er]||x[It]||x.namespaceURI==="http://www.w3.org/2000/svg"||x.hasAttribute("itemprop"))&&(x=b.createElement(l),b.head.insertBefore(x,b.querySelector("head > title"))),Dn(x,l,a),x[It]=t,Je(x),l=x;break e;case"link":var O=rb("link","href",b).get(l+(a.href||""));if(O){for(var $=0;$<O.length;$++)if(x=O[$],x.getAttribute("href")===(a.href==null||a.href===""?null:a.href)&&x.getAttribute("rel")===(a.rel==null?null:a.rel)&&x.getAttribute("title")===(a.title==null?null:a.title)&&x.getAttribute("crossorigin")===(a.crossOrigin==null?null:a.crossOrigin)){O.splice($,1);break t}}x=b.createElement(l),Dn(x,l,a),b.head.appendChild(x);break;case"meta":if(O=rb("meta","content",b).get(l+(a.content||""))){for($=0;$<O.length;$++)if(x=O[$],x.getAttribute("content")===(a.content==null?null:""+a.content)&&x.getAttribute("name")===(a.name==null?null:a.name)&&x.getAttribute("property")===(a.property==null?null:a.property)&&x.getAttribute("http-equiv")===(a.httpEquiv==null?null:a.httpEquiv)&&x.getAttribute("charset")===(a.charSet==null?null:a.charSet)){O.splice($,1);break t}}x=b.createElement(l),Dn(x,l,a),b.head.appendChild(x);break;default:throw Error(s(468,l))}x[It]=t,Je(x),l=x}t.stateNode=l}else sb(b,t.type,t.stateNode);else t.stateNode=ib(b,l,t.memoizedProps);else x!==l?(x===null?a.stateNode!==null&&(a=a.stateNode,a.parentNode.removeChild(a)):x.count--,l===null?sb(b,t.type,t.stateNode):ib(b,l,t.memoizedProps)):l===null&&t.stateNode!==null&&Vd(t,t.memoizedProps,a.memoizedProps)}break;case 27:ri(r,t),si(t),l&512&&(gn||a===null||ir(a,a.return)),a!==null&&l&4&&Vd(t,t.memoizedProps,a.memoizedProps);break;case 5:if(ri(r,t),si(t),l&512&&(gn||a===null||ir(a,a.return)),t.flags&32){b=t.stateNode;try{Ue(b,"")}catch(Te){wt(t,t.return,Te)}}l&4&&t.stateNode!=null&&(b=t.memoizedProps,Vd(t,b,a!==null?a.memoizedProps:b)),l&1024&&(Zd=!0);break;case 6:if(ri(r,t),si(t),l&4){if(t.stateNode===null)throw Error(s(162));l=t.memoizedProps,a=t.stateNode;try{a.nodeValue=l}catch(Te){wt(t,t.return,Te)}}break;case 3:if(lu=null,b=Gi,Gi=au(r.containerInfo),ri(r,t),Gi=b,si(t),l&4&&a!==null&&a.memoizedState.isDehydrated)try{Fa(r.containerInfo)}catch(Te){wt(t,t.return,Te)}Zd&&(Zd=!1,s0(t));break;case 4:l=Gi,Gi=au(t.stateNode.containerInfo),ri(r,t),si(t),Gi=l;break;case 12:ri(r,t),si(t);break;case 31:ri(r,t),si(t),l&4&&(l=t.updateQueue,l!==null&&(t.updateQueue=null,qc(t,l)));break;case 13:ri(r,t),si(t),t.child.flags&8192&&t.memoizedState!==null!=(a!==null&&a.memoizedState!==null)&&(Vc=ht()),l&4&&(l=t.updateQueue,l!==null&&(t.updateQueue=null,qc(t,l)));break;case 22:b=t.memoizedState!==null;var te=a!==null&&a.memoizedState!==null,ce=Er,fe=gn;if(Er=ce||b,gn=fe||te,ri(r,t),gn=fe,Er=ce,si(t),l&8192)e:for(r=t.stateNode,r._visibility=b?r._visibility&-2:r._visibility|1,b&&(a===null||te||Er||gn||Gs(t)),a=null,r=t;;){if(r.tag===5||r.tag===26){if(a===null){te=a=r;try{if(x=te.stateNode,b)O=x.style,typeof O.setProperty=="function"?O.setProperty("display","none","important"):O.display="none";else{$=te.stateNode;var me=te.memoizedProps.style,ue=me!=null&&me.hasOwnProperty("display")?me.display:null;$.style.display=ue==null||typeof ue=="boolean"?"":(""+ue).trim()}}catch(Te){wt(te,te.return,Te)}}}else if(r.tag===6){if(a===null){te=r;try{te.stateNode.nodeValue=b?"":te.memoizedProps}catch(Te){wt(te,te.return,Te)}}}else if(r.tag===18){if(a===null){te=r;try{var he=te.stateNode;b?V0(he,!0):V0(te.stateNode,!1)}catch(Te){wt(te,te.return,Te)}}}else if((r.tag!==22&&r.tag!==23||r.memoizedState===null||r===t)&&r.child!==null){r.child.return=r,r=r.child;continue}if(r===t)break e;for(;r.sibling===null;){if(r.return===null||r.return===t)break e;a===r&&(a=null),r=r.return}a===r&&(a=null),r.sibling.return=r.return,r=r.sibling}l&4&&(l=t.updateQueue,l!==null&&(a=l.retryQueue,a!==null&&(l.retryQueue=null,qc(t,a))));break;case 19:ri(r,t),si(t),l&4&&(l=t.updateQueue,l!==null&&(t.updateQueue=null,qc(t,l)));break;case 30:break;case 21:break;default:ri(r,t),si(t)}}function si(t){var r=t.flags;if(r&2){try{for(var a,l=t.return;l!==null;){if(Xv(l)){a=l;break}l=l.return}if(a==null)throw Error(s(160));switch(a.tag){case 27:var b=a.stateNode,x=Yd(t);Gc(t,x,b);break;case 5:var O=a.stateNode;a.flags&32&&(Ue(O,""),a.flags&=-33);var $=Yd(t);Gc(t,$,O);break;case 3:case 4:var te=a.stateNode.containerInfo,ce=Yd(t);Xd(t,ce,te);break;default:throw Error(s(161))}}catch(fe){wt(t,t.return,fe)}t.flags&=-3}r&4096&&(t.flags&=-4097)}function s0(t){if(t.subtreeFlags&1024)for(t=t.child;t!==null;){var r=t;s0(r),r.tag===5&&r.flags&1024&&r.stateNode.reset(),t=t.sibling}}function Tr(t,r){if(r.subtreeFlags&8772)for(r=r.child;r!==null;)Qv(t,r.alternate,r),r=r.sibling}function Gs(t){for(t=t.child;t!==null;){var r=t;switch(r.tag){case 0:case 11:case 14:case 15:is(4,r,r.return),Gs(r);break;case 1:ir(r,r.return);var a=r.stateNode;typeof a.componentWillUnmount=="function"&&Vv(r,r.return,a),Gs(r);break;case 27:ol(r.stateNode);case 26:case 5:ir(r,r.return),Gs(r);break;case 22:r.memoizedState===null&&Gs(r);break;case 30:Gs(r);break;default:Gs(r)}t=t.sibling}}function Ar(t,r,a){for(a=a&&(r.subtreeFlags&8772)!==0,r=r.child;r!==null;){var l=r.alternate,b=t,x=r,O=x.flags;switch(x.tag){case 0:case 11:case 15:Ar(b,x,a),Zo(4,x);break;case 1:if(Ar(b,x,a),l=x,b=l.stateNode,typeof b.componentDidMount=="function")try{b.componentDidMount()}catch(ce){wt(l,l.return,ce)}if(l=x,b=l.updateQueue,b!==null){var $=l.stateNode;try{var te=b.shared.hiddenCallbacks;if(te!==null)for(b.shared.hiddenCallbacks=null,b=0;b<te.length;b++)I_(te[b],$)}catch(ce){wt(l,l.return,ce)}}a&&O&64&&Kv(x),Jo(x,x.return);break;case 27:Zv(x);case 26:case 5:Ar(b,x,a),a&&l===null&&O&4&&Yv(x),Jo(x,x.return);break;case 12:Ar(b,x,a);break;case 31:Ar(b,x,a),a&&O&4&&n0(b,x);break;case 13:Ar(b,x,a),a&&O&4&&i0(b,x);break;case 22:x.memoizedState===null&&Ar(b,x,a),Jo(x,x.return);break;case 30:break;default:Ar(b,x,a)}r=r.sibling}}function Jd(t,r){var a=null;t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(a=t.memoizedState.cachePool.pool),t=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(t=r.memoizedState.cachePool.pool),t!==a&&(t!=null&&t.refCount++,a!=null&&Po(a))}function Qd(t,r){t=null,r.alternate!==null&&(t=r.alternate.memoizedState.cache),r=r.memoizedState.cache,r!==t&&(r.refCount++,t!=null&&Po(t))}function qi(t,r,a,l){if(r.subtreeFlags&10256)for(r=r.child;r!==null;)a0(t,r,a,l),r=r.sibling}function a0(t,r,a,l){var b=r.flags;switch(r.tag){case 0:case 11:case 15:qi(t,r,a,l),b&2048&&Zo(9,r);break;case 1:qi(t,r,a,l);break;case 3:qi(t,r,a,l),b&2048&&(t=null,r.alternate!==null&&(t=r.alternate.memoizedState.cache),r=r.memoizedState.cache,r!==t&&(r.refCount++,t!=null&&Po(t)));break;case 12:if(b&2048){qi(t,r,a,l),t=r.stateNode;try{var x=r.memoizedProps,O=x.id,$=x.onPostCommit;typeof $=="function"&&$(O,r.alternate===null?"mount":"update",t.passiveEffectDuration,-0)}catch(te){wt(r,r.return,te)}}else qi(t,r,a,l);break;case 31:qi(t,r,a,l);break;case 13:qi(t,r,a,l);break;case 23:break;case 22:x=r.stateNode,O=r.alternate,r.memoizedState!==null?x._visibility&2?qi(t,r,a,l):Qo(t,r):x._visibility&2?qi(t,r,a,l):(x._visibility|=2,Na(t,r,a,l,(r.subtreeFlags&10256)!==0||!1)),b&2048&&Jd(O,r);break;case 24:qi(t,r,a,l),b&2048&&Qd(r.alternate,r);break;default:qi(t,r,a,l)}}function Na(t,r,a,l,b){for(b=b&&((r.subtreeFlags&10256)!==0||!1),r=r.child;r!==null;){var x=t,O=r,$=a,te=l,ce=O.flags;switch(O.tag){case 0:case 11:case 15:Na(x,O,$,te,b),Zo(8,O);break;case 23:break;case 22:var fe=O.stateNode;O.memoizedState!==null?fe._visibility&2?Na(x,O,$,te,b):Qo(x,O):(fe._visibility|=2,Na(x,O,$,te,b)),b&&ce&2048&&Jd(O.alternate,O);break;case 24:Na(x,O,$,te,b),b&&ce&2048&&Qd(O.alternate,O);break;default:Na(x,O,$,te,b)}r=r.sibling}}function Qo(t,r){if(r.subtreeFlags&10256)for(r=r.child;r!==null;){var a=t,l=r,b=l.flags;switch(l.tag){case 22:Qo(a,l),b&2048&&Jd(l.alternate,l);break;case 24:Qo(a,l),b&2048&&Qd(l.alternate,l);break;default:Qo(a,l)}r=r.sibling}}var el=8192;function Oa(t,r,a){if(t.subtreeFlags&el)for(t=t.child;t!==null;)o0(t,r,a),t=t.sibling}function o0(t,r,a){switch(t.tag){case 26:Oa(t,r,a),t.flags&el&&t.memoizedState!==null&&h5(a,Gi,t.memoizedState,t.memoizedProps);break;case 5:Oa(t,r,a);break;case 3:case 4:var l=Gi;Gi=au(t.stateNode.containerInfo),Oa(t,r,a),Gi=l;break;case 22:t.memoizedState===null&&(l=t.alternate,l!==null&&l.memoizedState!==null?(l=el,el=16777216,Oa(t,r,a),el=l):Oa(t,r,a));break;default:Oa(t,r,a)}}function l0(t){var r=t.alternate;if(r!==null&&(t=r.child,t!==null)){r.child=null;do r=t.sibling,t.sibling=null,t=r;while(t!==null)}}function tl(t){var r=t.deletions;if((t.flags&16)!==0){if(r!==null)for(var a=0;a<r.length;a++){var l=r[a];Sn=l,u0(l,t)}l0(t)}if(t.subtreeFlags&10256)for(t=t.child;t!==null;)c0(t),t=t.sibling}function c0(t){switch(t.tag){case 0:case 11:case 15:tl(t),t.flags&2048&&is(9,t,t.return);break;case 3:tl(t);break;case 12:tl(t);break;case 22:var r=t.stateNode;t.memoizedState!==null&&r._visibility&2&&(t.return===null||t.return.tag!==13)?(r._visibility&=-3,Kc(t)):tl(t);break;default:tl(t)}}function Kc(t){var r=t.deletions;if((t.flags&16)!==0){if(r!==null)for(var a=0;a<r.length;a++){var l=r[a];Sn=l,u0(l,t)}l0(t)}for(t=t.child;t!==null;){switch(r=t,r.tag){case 0:case 11:case 15:is(8,r,r.return),Kc(r);break;case 22:a=r.stateNode,a._visibility&2&&(a._visibility&=-3,Kc(r));break;default:Kc(r)}t=t.sibling}}function u0(t,r){for(;Sn!==null;){var a=Sn;switch(a.tag){case 0:case 11:case 15:is(8,a,r);break;case 23:case 22:if(a.memoizedState!==null&&a.memoizedState.cachePool!==null){var l=a.memoizedState.cachePool.pool;l!=null&&l.refCount++}break;case 24:Po(a.memoizedState.cache)}if(l=a.child,l!==null)l.return=a,Sn=l;else e:for(a=t;Sn!==null;){l=Sn;var b=l.sibling,x=l.return;if(e0(l),l===a){Sn=null;break e}if(b!==null){b.return=x,Sn=b;break e}Sn=x}}}var kE={getCacheForType:function(t){var r=Nn(dn),a=r.data.get(t);return a===void 0&&(a=t(),r.data.set(t,a)),a},cacheSignal:function(){return Nn(dn).controller.signal}},TE=typeof WeakMap=="function"?WeakMap:Map,vt=0,Mt=null,Qe=null,rt=0,St=0,_i=null,rs=!1,Da=!1,ef=!1,Rr=0,tn=0,ss=0,qs=0,tf=0,vi=0,ja=0,nl=null,ai=null,nf=!1,Vc=0,h0=0,Yc=1/0,Xc=null,as=null,yn=0,os=null,Ia=null,Lr=0,rf=0,sf=null,d0=null,il=0,af=null;function bi(){return(vt&2)!==0&&rt!==0?rt&-rt:z.T!==null?df():dr()}function f0(){if(vi===0)if((rt&536870912)===0||lt){var t=An;An<<=1,(An&3932160)===0&&(An=262144),vi=t}else vi=536870912;return t=gi.current,t!==null&&(t.flags|=32),vi}function oi(t,r,a){(t===Mt&&(St===2||St===9)||t.cancelPendingCommit!==null)&&(Ba(t,0),ls(t,rt,vi,!1)),dt(t,a),((vt&2)===0||t!==Mt)&&(t===Mt&&((vt&2)===0&&(qs|=a),tn===4&&ls(t,rt,vi,!1)),rr(t))}function p0(t,r,a){if((vt&6)!==0)throw Error(s(327));var l=!a&&(r&127)===0&&(r&t.expiredLanes)===0||pe(t,r),b=l?LE(t,r):lf(t,r,!0),x=l;do{if(b===0){Da&&!l&&ls(t,r,0,!1);break}else{if(a=t.current.alternate,x&&!AE(a)){b=lf(t,r,!1),x=!1;continue}if(b===2){if(x=r,t.errorRecoveryDisabledLanes&x)var O=0;else O=t.pendingLanes&-536870913,O=O!==0?O:O&536870912?536870912:0;if(O!==0){r=O;e:{var $=t;b=nl;var te=$.current.memoizedState.isDehydrated;if(te&&(Ba($,O).flags|=256),O=lf($,O,!1),O!==2){if(ef&&!te){$.errorRecoveryDisabledLanes|=x,qs|=x,b=4;break e}x=ai,ai=b,x!==null&&(ai===null?ai=x:ai.push.apply(ai,x))}b=O}if(x=!1,b!==2)continue}}if(b===1){Ba(t,0),ls(t,r,0,!0);break}e:{switch(l=t,x=b,x){case 0:case 1:throw Error(s(345));case 4:if((r&4194048)!==r)break;case 6:ls(l,r,vi,!rs);break e;case 2:ai=null;break;case 3:case 5:break;default:throw Error(s(329))}if((r&62914560)===r&&(b=Vc+300-ht(),10<b)){if(ls(l,r,vi,!rs),ee(l,0,!0)!==0)break e;Lr=r,l.timeoutHandle=G0(g0.bind(null,l,a,ai,Xc,nf,r,vi,qs,ja,rs,x,"Throttled",-0,0),b);break e}g0(l,a,ai,Xc,nf,r,vi,qs,ja,rs,x,null,-0,0)}}break}while(!0);rr(t)}function g0(t,r,a,l,b,x,O,$,te,ce,fe,me,ue,he){if(t.timeoutHandle=-1,me=r.subtreeFlags,me&8192||(me&16785408)===16785408){me={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:xe},o0(r,x,me);var Te=(x&62914560)===x?Vc-ht():(x&4194048)===x?h0-ht():0;if(Te=d5(me,Te),Te!==null){Lr=x,t.cancelPendingCommit=Te(x0.bind(null,t,r,x,a,l,b,O,$,te,fe,me,null,ue,he)),ls(t,x,O,!ce);return}}x0(t,r,x,a,l,b,O,$,te)}function AE(t){for(var r=t;;){var a=r.tag;if((a===0||a===11||a===15)&&r.flags&16384&&(a=r.updateQueue,a!==null&&(a=a.stores,a!==null)))for(var l=0;l<a.length;l++){var b=a[l],x=b.getSnapshot;b=b.value;try{if(!fi(x(),b))return!1}catch{return!1}}if(a=r.child,r.subtreeFlags&16384&&a!==null)a.return=r,r=a;else{if(r===t)break;for(;r.sibling===null;){if(r.return===null||r.return===t)return!0;r=r.return}r.sibling.return=r.return,r=r.sibling}}return!0}function ls(t,r,a,l){r&=~tf,r&=~qs,t.suspendedLanes|=r,t.pingedLanes&=~r,l&&(t.warmLanes|=r),l=t.expirationTimes;for(var b=r;0<b;){var x=31-Ze(b),O=1<<x;l[x]=-1,b&=~O}a!==0&&Ce(t,a,r)}function Zc(){return(vt&6)===0?(rl(0),!1):!0}function of(){if(Qe!==null){if(St===0)var t=Qe.return;else t=Qe,br=Bs=null,wd(t),Ta=null,Ho=0,t=Qe;for(;t!==null;)qv(t.alternate,t),t=t.return;Qe=null}}function Ba(t,r){var a=t.timeoutHandle;a!==-1&&(t.timeoutHandle=-1,VE(a)),a=t.cancelPendingCommit,a!==null&&(t.cancelPendingCommit=null,a()),Lr=0,of(),Mt=t,Qe=a=_r(t.current,null),rt=r,St=0,_i=null,rs=!1,Da=pe(t,r),ef=!1,ja=vi=tf=qs=ss=tn=0,ai=nl=null,nf=!1,(r&8)!==0&&(r|=r&32);var l=t.entangledLanes;if(l!==0)for(t=t.entanglements,l&=r;0<l;){var b=31-Ze(l),x=1<<b;r|=t[b],l&=~x}return Rr=r,vc(),a}function m0(t,r){qe=null,z.H=Vo,r===ka||r===kc?(r=N_(),St=3):r===ud?(r=N_(),St=4):St=r===Pd?8:r!==null&&typeof r=="object"&&typeof r.then=="function"?6:1,_i=r,Qe===null&&(tn=1,Hc(t,Ti(r,t.current)))}function _0(){var t=gi.current;return t===null?!0:(rt&4194048)===rt?Mi===null:(rt&62914560)===rt||(rt&536870912)!==0?t===Mi:!1}function v0(){var t=z.H;return z.H=Vo,t===null?Vo:t}function b0(){var t=z.A;return z.A=kE,t}function Jc(){tn=4,rs||(rt&4194048)!==rt&&gi.current!==null||(Da=!0),(ss&134217727)===0&&(qs&134217727)===0||Mt===null||ls(Mt,rt,vi,!1)}function lf(t,r,a){var l=vt;vt|=2;var b=v0(),x=b0();(Mt!==t||rt!==r)&&(Xc=null,Ba(t,r)),r=!1;var O=tn;e:do try{if(St!==0&&Qe!==null){var $=Qe,te=_i;switch(St){case 8:of(),O=6;break e;case 3:case 2:case 9:case 6:gi.current===null&&(r=!0);var ce=St;if(St=0,_i=null,Pa(t,$,te,ce),a&&Da){O=0;break e}break;default:ce=St,St=0,_i=null,Pa(t,$,te,ce)}}RE(),O=tn;break}catch(fe){m0(t,fe)}while(!0);return r&&t.shellSuspendCounter++,br=Bs=null,vt=l,z.H=b,z.A=x,Qe===null&&(Mt=null,rt=0,vc()),O}function RE(){for(;Qe!==null;)y0(Qe)}function LE(t,r){var a=vt;vt|=2;var l=v0(),b=b0();Mt!==t||rt!==r?(Xc=null,Yc=ht()+500,Ba(t,r)):Da=pe(t,r);e:do try{if(St!==0&&Qe!==null){r=Qe;var x=_i;t:switch(St){case 1:St=0,_i=null,Pa(t,r,x,1);break;case 2:case 9:if(L_(x)){St=0,_i=null,S0(r);break}r=function(){St!==2&&St!==9||Mt!==t||(St=7),rr(t)},x.then(r,r);break e;case 3:St=7;break e;case 4:St=5;break e;case 7:L_(x)?(St=0,_i=null,S0(r)):(St=0,_i=null,Pa(t,r,x,7));break;case 5:var O=null;switch(Qe.tag){case 26:O=Qe.memoizedState;case 5:case 27:var $=Qe;if(O?ab(O):$.stateNode.complete){St=0,_i=null;var te=$.sibling;if(te!==null)Qe=te;else{var ce=$.return;ce!==null?(Qe=ce,Qc(ce)):Qe=null}break t}}St=0,_i=null,Pa(t,r,x,5);break;case 6:St=0,_i=null,Pa(t,r,x,6);break;case 8:of(),tn=6;break e;default:throw Error(s(462))}}ME();break}catch(fe){m0(t,fe)}while(!0);return br=Bs=null,z.H=l,z.A=b,vt=a,Qe!==null?0:(Mt=null,rt=0,vc(),tn)}function ME(){for(;Qe!==null&&!kn();)y0(Qe)}function y0(t){var r=Wv(t.alternate,t,Rr);t.memoizedProps=t.pendingProps,r===null?Qc(t):Qe=r}function S0(t){var r=t,a=r.alternate;switch(r.tag){case 15:case 0:r=Pv(a,r,r.pendingProps,r.type,void 0,rt);break;case 11:r=Pv(a,r,r.pendingProps,r.type.render,r.ref,rt);break;case 5:wd(r);default:qv(a,r),r=Qe=b_(r,Rr),r=Wv(a,r,Rr)}t.memoizedProps=t.pendingProps,r===null?Qc(t):Qe=r}function Pa(t,r,a,l){br=Bs=null,wd(r),Ta=null,Ho=0;var b=r.return;try{if(bE(t,b,r,a,rt)){tn=1,Hc(t,Ti(a,t.current)),Qe=null;return}}catch(x){if(b!==null)throw Qe=b,x;tn=1,Hc(t,Ti(a,t.current)),Qe=null;return}r.flags&32768?(lt||l===1?t=!0:Da||(rt&536870912)!==0?t=!1:(rs=t=!0,(l===2||l===9||l===3||l===6)&&(l=gi.current,l!==null&&l.tag===13&&(l.flags|=16384))),w0(r,t)):Qc(r)}function Qc(t){var r=t;do{if((r.flags&32768)!==0){w0(r,rs);return}t=r.return;var a=wE(r.alternate,r,Rr);if(a!==null){Qe=a;return}if(r=r.sibling,r!==null){Qe=r;return}Qe=r=t}while(r!==null);tn===0&&(tn=5)}function w0(t,r){do{var a=xE(t.alternate,t);if(a!==null){a.flags&=32767,Qe=a;return}if(a=t.return,a!==null&&(a.flags|=32768,a.subtreeFlags=0,a.deletions=null),!r&&(t=t.sibling,t!==null)){Qe=t;return}Qe=t=a}while(t!==null);tn=6,Qe=null}function x0(t,r,a,l,b,x,O,$,te){t.cancelPendingCommit=null;do eu();while(yn!==0);if((vt&6)!==0)throw Error(s(327));if(r!==null){if(r===t.current)throw Error(s(177));if(x=r.lanes|r.childLanes,x|=Yh,ke(t,a,x,O,$,te),t===Mt&&(Qe=Mt=null,rt=0),Ia=r,os=t,Lr=a,rf=x,sf=b,d0=l,(r.subtreeFlags&10256)!==0||(r.flags&10256)!==0?(t.callbackNode=null,t.callbackPriority=0,jE(Kt,function(){return A0(),null})):(t.callbackNode=null,t.callbackPriority=0),l=(r.flags&13878)!==0,(r.subtreeFlags&13878)!==0||l){l=z.T,z.T=null,b=q.p,q.p=2,O=vt,vt|=4;try{CE(t,r,a)}finally{vt=O,q.p=b,z.T=l}}yn=1,C0(),E0(),k0()}}function C0(){if(yn===1){yn=0;var t=os,r=Ia,a=(r.flags&13878)!==0;if((r.subtreeFlags&13878)!==0||a){a=z.T,z.T=null;var l=q.p;q.p=2;var b=vt;vt|=4;try{r0(r,t);var x=yf,O=u_(t.containerInfo),$=x.focusedElem,te=x.selectionRange;if(O!==$&&$&&$.ownerDocument&&c_($.ownerDocument.documentElement,$)){if(te!==null&&Wh($)){var ce=te.start,fe=te.end;if(fe===void 0&&(fe=ce),"selectionStart"in $)$.selectionStart=ce,$.selectionEnd=Math.min(fe,$.value.length);else{var me=$.ownerDocument||document,ue=me&&me.defaultView||window;if(ue.getSelection){var he=ue.getSelection(),Te=$.textContent.length,ze=Math.min(te.start,Te),Tt=te.end===void 0?ze:Math.min(te.end,Te);!he.extend&&ze>Tt&&(O=Tt,Tt=ze,ze=O);var re=l_($,ze),ne=l_($,Tt);if(re&&ne&&(he.rangeCount!==1||he.anchorNode!==re.node||he.anchorOffset!==re.offset||he.focusNode!==ne.node||he.focusOffset!==ne.offset)){var le=me.createRange();le.setStart(re.node,re.offset),he.removeAllRanges(),ze>Tt?(he.addRange(le),he.extend(ne.node,ne.offset)):(le.setEnd(ne.node,ne.offset),he.addRange(le))}}}}for(me=[],he=$;he=he.parentNode;)he.nodeType===1&&me.push({element:he,left:he.scrollLeft,top:he.scrollTop});for(typeof $.focus=="function"&&$.focus(),$=0;$<me.length;$++){var ge=me[$];ge.element.scrollLeft=ge.left,ge.element.scrollTop=ge.top}}du=!!bf,yf=bf=null}finally{vt=b,q.p=l,z.T=a}}t.current=r,yn=2}}function E0(){if(yn===2){yn=0;var t=os,r=Ia,a=(r.flags&8772)!==0;if((r.subtreeFlags&8772)!==0||a){a=z.T,z.T=null;var l=q.p;q.p=2;var b=vt;vt|=4;try{Qv(t,r.alternate,r)}finally{vt=b,q.p=l,z.T=a}}yn=3}}function k0(){if(yn===4||yn===3){yn=0,Zt();var t=os,r=Ia,a=Lr,l=d0;(r.subtreeFlags&10256)!==0||(r.flags&10256)!==0?yn=5:(yn=0,Ia=os=null,T0(t,t.pendingLanes));var b=t.pendingLanes;if(b===0&&(as=null),Rn(a),r=r.stateNode,ve&&typeof ve.onCommitFiberRoot=="function")try{ve.onCommitFiberRoot(Tn,r,void 0,(r.current.flags&128)===128)}catch{}if(l!==null){r=z.T,b=q.p,q.p=2,z.T=null;try{for(var x=t.onRecoverableError,O=0;O<l.length;O++){var $=l[O];x($.value,{componentStack:$.stack})}}finally{z.T=r,q.p=b}}(Lr&3)!==0&&eu(),rr(t),b=t.pendingLanes,(a&261930)!==0&&(b&42)!==0?t===af?il++:(il=0,af=t):il=0,rl(0)}}function T0(t,r){(t.pooledCacheLanes&=r)===0&&(r=t.pooledCache,r!=null&&(t.pooledCache=null,Po(r)))}function eu(){return C0(),E0(),k0(),A0()}function A0(){if(yn!==5)return!1;var t=os,r=rf;rf=0;var a=Rn(Lr),l=z.T,b=q.p;try{q.p=32>a?32:a,z.T=null,a=sf,sf=null;var x=os,O=Lr;if(yn=0,Ia=os=null,Lr=0,(vt&6)!==0)throw Error(s(331));var $=vt;if(vt|=4,c0(x.current),a0(x,x.current,O,a),vt=$,rl(0,!1),ve&&typeof ve.onPostCommitFiberRoot=="function")try{ve.onPostCommitFiberRoot(Tn,x)}catch{}return!0}finally{q.p=b,z.T=l,T0(t,r)}}function R0(t,r,a){r=Ti(a,r),r=Bd(t.stateNode,r,2),t=es(t,r,2),t!==null&&(dt(t,2),rr(t))}function wt(t,r,a){if(t.tag===3)R0(t,t,a);else for(;r!==null;){if(r.tag===3){R0(r,t,a);break}else if(r.tag===1){var l=r.stateNode;if(typeof r.type.getDerivedStateFromError=="function"||typeof l.componentDidCatch=="function"&&(as===null||!as.has(l))){t=Ti(a,t),a=Lv(2),l=es(r,a,2),l!==null&&(Mv(a,l,r,t),dt(l,2),rr(l));break}}r=r.return}}function cf(t,r,a){var l=t.pingCache;if(l===null){l=t.pingCache=new TE;var b=new Set;l.set(r,b)}else b=l.get(r),b===void 0&&(b=new Set,l.set(r,b));b.has(a)||(ef=!0,b.add(a),t=NE.bind(null,t,r,a),r.then(t,t))}function NE(t,r,a){var l=t.pingCache;l!==null&&l.delete(r),t.pingedLanes|=t.suspendedLanes&a,t.warmLanes&=~a,Mt===t&&(rt&a)===a&&(tn===4||tn===3&&(rt&62914560)===rt&&300>ht()-Vc?(vt&2)===0&&Ba(t,0):tf|=a,ja===rt&&(ja=0)),rr(t)}function L0(t,r){r===0&&(r=je()),t=Ds(t,r),t!==null&&(dt(t,r),rr(t))}function OE(t){var r=t.memoizedState,a=0;r!==null&&(a=r.retryLane),L0(t,a)}function DE(t,r){var a=0;switch(t.tag){case 31:case 13:var l=t.stateNode,b=t.memoizedState;b!==null&&(a=b.retryLane);break;case 19:l=t.stateNode;break;case 22:l=t.stateNode._retryCache;break;default:throw Error(s(314))}l!==null&&l.delete(r),L0(t,a)}function jE(t,r){return vn(t,r)}var tu=null,za=null,uf=!1,nu=!1,hf=!1,cs=0;function rr(t){t!==za&&t.next===null&&(za===null?tu=za=t:za=za.next=t),nu=!0,uf||(uf=!0,BE())}function rl(t,r){if(!hf&&nu){hf=!0;do for(var a=!1,l=tu;l!==null;){if(t!==0){var b=l.pendingLanes;if(b===0)var x=0;else{var O=l.suspendedLanes,$=l.pingedLanes;x=(1<<31-Ze(42|t)+1)-1,x&=b&~(O&~$),x=x&201326741?x&201326741|1:x?x|2:0}x!==0&&(a=!0,D0(l,x))}else x=rt,x=ee(l,l===Mt?x:0,l.cancelPendingCommit!==null||l.timeoutHandle!==-1),(x&3)===0||pe(l,x)||(a=!0,D0(l,x));l=l.next}while(a);hf=!1}}function IE(){M0()}function M0(){nu=uf=!1;var t=0;cs!==0&&KE()&&(t=cs);for(var r=ht(),a=null,l=tu;l!==null;){var b=l.next,x=N0(l,r);x===0?(l.next=null,a===null?tu=b:a.next=b,b===null&&(za=a)):(a=l,(t!==0||(x&3)!==0)&&(nu=!0)),l=b}yn!==0&&yn!==5||rl(t),cs!==0&&(cs=0)}function N0(t,r){for(var a=t.suspendedLanes,l=t.pingedLanes,b=t.expirationTimes,x=t.pendingLanes&-62914561;0<x;){var O=31-Ze(x),$=1<<O,te=b[O];te===-1?(($&a)===0||($&l)!==0)&&(b[O]=Se($,r)):te<=r&&(t.expiredLanes|=$),x&=~$}if(r=Mt,a=rt,a=ee(t,t===r?a:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),l=t.callbackNode,a===0||t===r&&(St===2||St===9)||t.cancelPendingCommit!==null)return l!==null&&l!==null&&an(l),t.callbackNode=null,t.callbackPriority=0;if((a&3)===0||pe(t,a)){if(r=a&-a,r===t.callbackPriority)return r;switch(l!==null&&an(l),Rn(a)){case 2:case 8:a=Ft;break;case 32:a=Kt;break;case 268435456:a=bn;break;default:a=Kt}return l=O0.bind(null,t),a=vn(a,l),t.callbackPriority=r,t.callbackNode=a,r}return l!==null&&l!==null&&an(l),t.callbackPriority=2,t.callbackNode=null,2}function O0(t,r){if(yn!==0&&yn!==5)return t.callbackNode=null,t.callbackPriority=0,null;var a=t.callbackNode;if(eu()&&t.callbackNode!==a)return null;var l=rt;return l=ee(t,t===Mt?l:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),l===0?null:(p0(t,l,r),N0(t,ht()),t.callbackNode!=null&&t.callbackNode===a?O0.bind(null,t):null)}function D0(t,r){if(eu())return null;p0(t,r,!0)}function BE(){YE(function(){(vt&6)!==0?vn(Ct,IE):M0()})}function df(){if(cs===0){var t=Ca;t===0&&(t=Dt,Dt<<=1,(Dt&261888)===0&&(Dt=256)),cs=t}return cs}function j0(t){return t==null||typeof t=="symbol"||typeof t=="boolean"?null:typeof t=="function"?t:qr(""+t)}function I0(t,r){var a=r.ownerDocument.createElement("input");return a.name=r.name,a.value=r.value,t.id&&a.setAttribute("form",t.id),r.parentNode.insertBefore(a,r),t=new FormData(t),a.parentNode.removeChild(a),t}function PE(t,r,a,l,b){if(r==="submit"&&a&&a.stateNode===b){var x=j0((b[Nt]||null).action),O=l.submitter;O&&(r=(r=O[Nt]||null)?j0(r.formAction):O.getAttribute("formAction"),r!==null&&(x=r,O=null));var $=new pc("action","action",null,l,b);t.push({event:$,listeners:[{instance:null,listener:function(){if(l.defaultPrevented){if(cs!==0){var te=O?I0(b,O):new FormData(b);Md(a,{pending:!0,data:te,method:b.method,action:x},null,te)}}else typeof x=="function"&&($.preventDefault(),te=O?I0(b,O):new FormData(b),Md(a,{pending:!0,data:te,method:b.method,action:x},x,te))},currentTarget:b}]})}}for(var ff=0;ff<Vh.length;ff++){var pf=Vh[ff],zE=pf.toLowerCase(),HE=pf[0].toUpperCase()+pf.slice(1);Wi(zE,"on"+HE)}Wi(f_,"onAnimationEnd"),Wi(p_,"onAnimationIteration"),Wi(g_,"onAnimationStart"),Wi("dblclick","onDoubleClick"),Wi("focusin","onFocus"),Wi("focusout","onBlur"),Wi(nE,"onTransitionRun"),Wi(iE,"onTransitionStart"),Wi(rE,"onTransitionCancel"),Wi(m_,"onTransitionEnd"),be("onMouseEnter",["mouseout","mouseover"]),be("onMouseLeave",["mouseout","mouseover"]),be("onPointerEnter",["pointerout","pointerover"]),be("onPointerLeave",["pointerout","pointerover"]),Qt("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Qt("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Qt("onBeforeInput",["compositionend","keypress","textInput","paste"]),Qt("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Qt("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Qt("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var sl="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(" "),$E=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(sl));function B0(t,r){r=(r&4)!==0;for(var a=0;a<t.length;a++){var l=t[a],b=l.event;l=l.listeners;e:{var x=void 0;if(r)for(var O=l.length-1;0<=O;O--){var $=l[O],te=$.instance,ce=$.currentTarget;if($=$.listener,te!==x&&b.isPropagationStopped())break e;x=$,b.currentTarget=ce;try{x(b)}catch(fe){_c(fe)}b.currentTarget=null,x=te}else for(O=0;O<l.length;O++){if($=l[O],te=$.instance,ce=$.currentTarget,$=$.listener,te!==x&&b.isPropagationStopped())break e;x=$,b.currentTarget=ce;try{x(b)}catch(fe){_c(fe)}b.currentTarget=null,x=te}}}}function et(t,r){var a=r[Wr];a===void 0&&(a=r[Wr]=new Set);var l=t+"__bubble";a.has(l)||(P0(r,t,2,!1),a.add(l))}function gf(t,r,a){var l=0;r&&(l|=4),P0(a,t,l,r)}var iu="_reactListening"+Math.random().toString(36).slice(2);function mf(t){if(!t[iu]){t[iu]=!0,Bt.forEach(function(a){a!=="selectionchange"&&($E.has(a)||gf(a,!1,t),gf(a,!0,t))});var r=t.nodeType===9?t:t.ownerDocument;r===null||r[iu]||(r[iu]=!0,gf("selectionchange",!1,r))}}function P0(t,r,a,l){switch(fb(r)){case 2:var b=g5;break;case 8:b=m5;break;default:b=Mf}a=b.bind(null,r,a,t),b=void 0,!jh||r!=="touchstart"&&r!=="touchmove"&&r!=="wheel"||(b=!0),l?b!==void 0?t.addEventListener(r,a,{capture:!0,passive:b}):t.addEventListener(r,a,!0):b!==void 0?t.addEventListener(r,a,{passive:b}):t.addEventListener(r,a,!1)}function _f(t,r,a,l,b){var x=l;if((r&1)===0&&(r&2)===0&&l!==null)e:for(;;){if(l===null)return;var O=l.tag;if(O===3||O===4){var $=l.stateNode.containerInfo;if($===b)break;if(O===4)for(O=l.return;O!==null;){var te=O.tag;if((te===3||te===4)&&O.stateNode.containerInfo===b)return;O=O.return}for(;$!==null;){if(O=Q($),O===null)return;if(te=O.tag,te===5||te===6||te===26||te===27){l=x=O;continue e}$=$.parentNode}}l=l.return}uc(function(){var ce=x,fe=Ge(a),me=[];e:{var ue=__.get(t);if(ue!==void 0){var he=pc,Te=t;switch(t){case"keypress":if(dc(a)===0)break e;case"keydown":case"keyup":he=D2;break;case"focusin":Te="focus",he=zh;break;case"focusout":Te="blur",he=zh;break;case"beforeblur":case"afterblur":he=zh;break;case"click":if(a.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":he=qm;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":he=w2;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":he=B2;break;case f_:case p_:case g_:he=E2;break;case m_:he=z2;break;case"scroll":case"scrollend":he=y2;break;case"wheel":he=$2;break;case"copy":case"cut":case"paste":he=T2;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":he=Vm;break;case"toggle":case"beforetoggle":he=F2}var ze=(r&4)!==0,Tt=!ze&&(t==="scroll"||t==="scrollend"),re=ze?ue!==null?ue+"Capture":null:ue;ze=[];for(var ne=ce,le;ne!==null;){var ge=ne;if(le=ge.stateNode,ge=ge.tag,ge!==5&&ge!==26&&ge!==27||le===null||re===null||(ge=To(ne,re),ge!=null&&ze.push(al(ne,ge,le))),Tt)break;ne=ne.return}0<ze.length&&(ue=new he(ue,Te,null,a,fe),me.push({event:ue,listeners:ze}))}}if((r&7)===0){e:{if(ue=t==="mouseover"||t==="pointerover",he=t==="mouseout"||t==="pointerout",ue&&a!==Ae&&(Te=a.relatedTarget||a.fromElement)&&(Q(Te)||Te[Fi]))break e;if((he||ue)&&(ue=fe.window===fe?fe:(ue=fe.ownerDocument)?ue.defaultView||ue.parentWindow:window,he?(Te=a.relatedTarget||a.toElement,he=ce,Te=Te?Q(Te):null,Te!==null&&(Tt=f(Te),ze=Te.tag,Te!==Tt||ze!==5&&ze!==27&&ze!==6)&&(Te=null)):(he=null,Te=ce),he!==Te)){if(ze=qm,ge="onMouseLeave",re="onMouseEnter",ne="mouse",(t==="pointerout"||t==="pointerover")&&(ze=Vm,ge="onPointerLeave",re="onPointerEnter",ne="pointer"),Tt=he==null?ue:Ee(he),le=Te==null?ue:Ee(Te),ue=new ze(ge,ne+"leave",he,a,fe),ue.target=Tt,ue.relatedTarget=le,ge=null,Q(fe)===ce&&(ze=new ze(re,ne+"enter",Te,a,fe),ze.target=le,ze.relatedTarget=Tt,ge=ze),Tt=ge,he&&Te)t:{for(ze=UE,re=he,ne=Te,le=0,ge=re;ge;ge=ze(ge))le++;ge=0;for(var Be=ne;Be;Be=ze(Be))ge++;for(;0<le-ge;)re=ze(re),le--;for(;0<ge-le;)ne=ze(ne),ge--;for(;le--;){if(re===ne||ne!==null&&re===ne.alternate){ze=re;break t}re=ze(re),ne=ze(ne)}ze=null}else ze=null;he!==null&&z0(me,ue,he,ze,!1),Te!==null&&Tt!==null&&z0(me,Tt,Te,ze,!0)}}e:{if(ue=ce?Ee(ce):window,he=ue.nodeName&&ue.nodeName.toLowerCase(),he==="select"||he==="input"&&ue.type==="file")var gt=n_;else if(e_(ue))if(i_)gt=Q2;else{gt=Z2;var Re=X2}else he=ue.nodeName,!he||he.toLowerCase()!=="input"||ue.type!=="checkbox"&&ue.type!=="radio"?ce&&Gr(ce.elementType)&&(gt=n_):gt=J2;if(gt&&(gt=gt(t,ce))){t_(me,gt,a,fe);break e}Re&&Re(t,ue,ce),t==="focusout"&&ce&&ue.type==="number"&&ce.memoizedProps.value!=null&&fa(ue,"number",ue.value)}switch(Re=ce?Ee(ce):window,t){case"focusin":(e_(Re)||Re.contentEditable==="true")&&(ma=Re,Gh=ce,jo=null);break;case"focusout":jo=Gh=ma=null;break;case"mousedown":qh=!0;break;case"contextmenu":case"mouseup":case"dragend":qh=!1,h_(me,a,fe);break;case"selectionchange":if(tE)break;case"keydown":case"keyup":h_(me,a,fe)}var Ye;if($h)e:{switch(t){case"compositionstart":var st="onCompositionStart";break e;case"compositionend":st="onCompositionEnd";break e;case"compositionupdate":st="onCompositionUpdate";break e}st=void 0}else ga?Jm(t,a)&&(st="onCompositionEnd"):t==="keydown"&&a.keyCode===229&&(st="onCompositionStart");st&&(Ym&&a.locale!=="ko"&&(ga||st!=="onCompositionStart"?st==="onCompositionEnd"&&ga&&(Ye=Wm()):(Kr=fe,Ih="value"in Kr?Kr.value:Kr.textContent,ga=!0)),Re=ru(ce,st),0<Re.length&&(st=new Km(st,t,null,a,fe),me.push({event:st,listeners:Re}),Ye?st.data=Ye:(Ye=Qm(a),Ye!==null&&(st.data=Ye)))),(Ye=G2?q2(t,a):K2(t,a))&&(st=ru(ce,"onBeforeInput"),0<st.length&&(Re=new Km("onBeforeInput","beforeinput",null,a,fe),me.push({event:Re,listeners:st}),Re.data=Ye)),PE(me,t,ce,a,fe)}B0(me,r)})}function al(t,r,a){return{instance:t,listener:r,currentTarget:a}}function ru(t,r){for(var a=r+"Capture",l=[];t!==null;){var b=t,x=b.stateNode;if(b=b.tag,b!==5&&b!==26&&b!==27||x===null||(b=To(t,a),b!=null&&l.unshift(al(t,b,x)),b=To(t,r),b!=null&&l.push(al(t,b,x))),t.tag===3)return l;t=t.return}return[]}function UE(t){if(t===null)return null;do t=t.return;while(t&&t.tag!==5&&t.tag!==27);return t||null}function z0(t,r,a,l,b){for(var x=r._reactName,O=[];a!==null&&a!==l;){var $=a,te=$.alternate,ce=$.stateNode;if($=$.tag,te!==null&&te===l)break;$!==5&&$!==26&&$!==27||ce===null||(te=ce,b?(ce=To(a,x),ce!=null&&O.unshift(al(a,ce,te))):b||(ce=To(a,x),ce!=null&&O.push(al(a,ce,te)))),a=a.return}O.length!==0&&t.push({event:r,listeners:O})}var FE=/\r\n?/g,WE=/\u0000|\uFFFD/g;function H0(t){return(typeof t=="string"?t:""+t).replace(FE,`
|
|
9
|
-
`).replace(WE,"")}function $0(t,r){return r=H0(r),H0(t)===r}function kt(t,r,a,l,b,x){switch(a){case"children":typeof l=="string"?r==="body"||r==="textarea"&&l===""||Ue(t,l):(typeof l=="number"||typeof l=="bigint")&&r!=="body"&&Ue(t,""+l);break;case"className":hi(t,"class",l);break;case"tabIndex":hi(t,"tabindex",l);break;case"dir":case"role":case"viewBox":case"width":case"height":hi(t,a,l);break;case"style":yt(t,l,x);break;case"data":if(r!=="object"){hi(t,"data",l);break}case"src":case"href":if(l===""&&(r!=="a"||a!=="href")){t.removeAttribute(a);break}if(l==null||typeof l=="function"||typeof l=="symbol"||typeof l=="boolean"){t.removeAttribute(a);break}l=qr(""+l),t.setAttribute(a,l);break;case"action":case"formAction":if(typeof l=="function"){t.setAttribute(a,"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 x=="function"&&(a==="formAction"?(r!=="input"&&kt(t,r,"name",b.name,b,null),kt(t,r,"formEncType",b.formEncType,b,null),kt(t,r,"formMethod",b.formMethod,b,null),kt(t,r,"formTarget",b.formTarget,b,null)):(kt(t,r,"encType",b.encType,b,null),kt(t,r,"method",b.method,b,null),kt(t,r,"target",b.target,b,null)));if(l==null||typeof l=="symbol"||typeof l=="boolean"){t.removeAttribute(a);break}l=qr(""+l),t.setAttribute(a,l);break;case"onClick":l!=null&&(t.onclick=xe);break;case"onScroll":l!=null&&et("scroll",t);break;case"onScrollEnd":l!=null&&et("scrollend",t);break;case"dangerouslySetInnerHTML":if(l!=null){if(typeof l!="object"||!("__html"in l))throw Error(s(61));if(a=l.__html,a!=null){if(b.children!=null)throw Error(s(60));t.innerHTML=a}}break;case"multiple":t.multiple=l&&typeof l!="function"&&typeof l!="symbol";break;case"muted":t.muted=l&&typeof l!="function"&&typeof l!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(l==null||typeof l=="function"||typeof l=="boolean"||typeof l=="symbol"){t.removeAttribute("xlink:href");break}a=qr(""+l),t.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",a);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":l!=null&&typeof l!="function"&&typeof l!="symbol"?t.setAttribute(a,""+l):t.removeAttribute(a);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":l&&typeof l!="function"&&typeof l!="symbol"?t.setAttribute(a,""):t.removeAttribute(a);break;case"capture":case"download":l===!0?t.setAttribute(a,""):l!==!1&&l!=null&&typeof l!="function"&&typeof l!="symbol"?t.setAttribute(a,l):t.removeAttribute(a);break;case"cols":case"rows":case"size":case"span":l!=null&&typeof l!="function"&&typeof l!="symbol"&&!isNaN(l)&&1<=l?t.setAttribute(a,l):t.removeAttribute(a);break;case"rowSpan":case"start":l==null||typeof l=="function"||typeof l=="symbol"||isNaN(l)?t.removeAttribute(a):t.setAttribute(a,l);break;case"popover":et("beforetoggle",t),et("toggle",t),zn(t,"popover",l);break;case"xlinkActuate":ei(t,"http://www.w3.org/1999/xlink","xlink:actuate",l);break;case"xlinkArcrole":ei(t,"http://www.w3.org/1999/xlink","xlink:arcrole",l);break;case"xlinkRole":ei(t,"http://www.w3.org/1999/xlink","xlink:role",l);break;case"xlinkShow":ei(t,"http://www.w3.org/1999/xlink","xlink:show",l);break;case"xlinkTitle":ei(t,"http://www.w3.org/1999/xlink","xlink:title",l);break;case"xlinkType":ei(t,"http://www.w3.org/1999/xlink","xlink:type",l);break;case"xmlBase":ei(t,"http://www.w3.org/XML/1998/namespace","xml:base",l);break;case"xmlLang":ei(t,"http://www.w3.org/XML/1998/namespace","xml:lang",l);break;case"xmlSpace":ei(t,"http://www.w3.org/XML/1998/namespace","xml:space",l);break;case"is":zn(t,"is",l);break;case"innerText":case"textContent":break;default:(!(2<a.length)||a[0]!=="o"&&a[0]!=="O"||a[1]!=="n"&&a[1]!=="N")&&(a=gr.get(a)||a,zn(t,a,l))}}function vf(t,r,a,l,b,x){switch(a){case"style":yt(t,l,x);break;case"dangerouslySetInnerHTML":if(l!=null){if(typeof l!="object"||!("__html"in l))throw Error(s(61));if(a=l.__html,a!=null){if(b.children!=null)throw Error(s(60));t.innerHTML=a}}break;case"children":typeof l=="string"?Ue(t,l):(typeof l=="number"||typeof l=="bigint")&&Ue(t,""+l);break;case"onScroll":l!=null&&et("scroll",t);break;case"onScrollEnd":l!=null&&et("scrollend",t);break;case"onClick":l!=null&&(t.onclick=xe);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Jt.hasOwnProperty(a))e:{if(a[0]==="o"&&a[1]==="n"&&(b=a.endsWith("Capture"),r=a.slice(2,b?a.length-7:void 0),x=t[Nt]||null,x=x!=null?x[a]:null,typeof x=="function"&&t.removeEventListener(r,x,b),typeof l=="function")){typeof x!="function"&&x!==null&&(a in t?t[a]=null:t.hasAttribute(a)&&t.removeAttribute(a)),t.addEventListener(r,l,b);break e}a in t?t[a]=l:l===!0?t.setAttribute(a,""):zn(t,a,l)}}}function Dn(t,r,a){switch(r){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":et("error",t),et("load",t);var l=!1,b=!1,x;for(x in a)if(a.hasOwnProperty(x)){var O=a[x];if(O!=null)switch(x){case"src":l=!0;break;case"srcSet":b=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(s(137,r));default:kt(t,r,x,O,a,null)}}b&&kt(t,r,"srcSet",a.srcSet,a,null),l&&kt(t,r,"src",a.src,a,null);return;case"input":et("invalid",t);var $=x=O=b=null,te=null,ce=null;for(l in a)if(a.hasOwnProperty(l)){var fe=a[l];if(fe!=null)switch(l){case"name":b=fe;break;case"type":O=fe;break;case"checked":te=fe;break;case"defaultChecked":ce=fe;break;case"value":x=fe;break;case"defaultValue":$=fe;break;case"children":case"dangerouslySetInnerHTML":if(fe!=null)throw Error(s(137,r));break;default:kt(t,r,l,fe,a,null)}}Ls(t,x,$,te,ce,O,b,!1);return;case"select":et("invalid",t),l=O=x=null;for(b in a)if(a.hasOwnProperty(b)&&($=a[b],$!=null))switch(b){case"value":x=$;break;case"defaultValue":O=$;break;case"multiple":l=$;default:kt(t,r,b,$,a,null)}r=x,a=O,t.multiple=!!l,r!=null?Ln(t,!!l,r,!1):a!=null&&Ln(t,!!l,a,!0);return;case"textarea":et("invalid",t),x=b=l=null;for(O in a)if(a.hasOwnProperty(O)&&($=a[O],$!=null))switch(O){case"value":l=$;break;case"defaultValue":b=$;break;case"children":x=$;break;case"dangerouslySetInnerHTML":if($!=null)throw Error(s(91));break;default:kt(t,r,O,$,a,null)}pa(t,l,b,x);return;case"option":for(te in a)a.hasOwnProperty(te)&&(l=a[te],l!=null)&&(te==="selected"?t.selected=l&&typeof l!="function"&&typeof l!="symbol":kt(t,r,te,l,a,null));return;case"dialog":et("beforetoggle",t),et("toggle",t),et("cancel",t),et("close",t);break;case"iframe":case"object":et("load",t);break;case"video":case"audio":for(l=0;l<sl.length;l++)et(sl[l],t);break;case"image":et("error",t),et("load",t);break;case"details":et("toggle",t);break;case"embed":case"source":case"link":et("error",t),et("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(ce in a)if(a.hasOwnProperty(ce)&&(l=a[ce],l!=null))switch(ce){case"children":case"dangerouslySetInnerHTML":throw Error(s(137,r));default:kt(t,r,ce,l,a,null)}return;default:if(Gr(r)){for(fe in a)a.hasOwnProperty(fe)&&(l=a[fe],l!==void 0&&vf(t,r,fe,l,a,void 0));return}}for($ in a)a.hasOwnProperty($)&&(l=a[$],l!=null&&kt(t,r,$,l,a,null))}function GE(t,r,a,l){switch(r){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var b=null,x=null,O=null,$=null,te=null,ce=null,fe=null;for(he in a){var me=a[he];if(a.hasOwnProperty(he)&&me!=null)switch(he){case"checked":break;case"value":break;case"defaultValue":te=me;default:l.hasOwnProperty(he)||kt(t,r,he,null,l,me)}}for(var ue in l){var he=l[ue];if(me=a[ue],l.hasOwnProperty(ue)&&(he!=null||me!=null))switch(ue){case"type":x=he;break;case"name":b=he;break;case"checked":ce=he;break;case"defaultChecked":fe=he;break;case"value":O=he;break;case"defaultValue":$=he;break;case"children":case"dangerouslySetInnerHTML":if(he!=null)throw Error(s(137,r));break;default:he!==me&&kt(t,r,ue,he,l,me)}}Co(t,O,$,te,ce,fe,x,b);return;case"select":he=O=$=ue=null;for(x in a)if(te=a[x],a.hasOwnProperty(x)&&te!=null)switch(x){case"value":break;case"multiple":he=te;default:l.hasOwnProperty(x)||kt(t,r,x,null,l,te)}for(b in l)if(x=l[b],te=a[b],l.hasOwnProperty(b)&&(x!=null||te!=null))switch(b){case"value":ue=x;break;case"defaultValue":$=x;break;case"multiple":O=x;default:x!==te&&kt(t,r,b,x,l,te)}r=$,a=O,l=he,ue!=null?Ln(t,!!a,ue,!1):!!l!=!!a&&(r!=null?Ln(t,!!a,r,!0):Ln(t,!!a,a?[]:"",!1));return;case"textarea":he=ue=null;for($ in a)if(b=a[$],a.hasOwnProperty($)&&b!=null&&!l.hasOwnProperty($))switch($){case"value":break;case"children":break;default:kt(t,r,$,null,l,b)}for(O in l)if(b=l[O],x=a[O],l.hasOwnProperty(O)&&(b!=null||x!=null))switch(O){case"value":ue=b;break;case"defaultValue":he=b;break;case"children":break;case"dangerouslySetInnerHTML":if(b!=null)throw Error(s(91));break;default:b!==x&&kt(t,r,O,b,l,x)}lc(t,ue,he);return;case"option":for(var Te in a)ue=a[Te],a.hasOwnProperty(Te)&&ue!=null&&!l.hasOwnProperty(Te)&&(Te==="selected"?t.selected=!1:kt(t,r,Te,null,l,ue));for(te in l)ue=l[te],he=a[te],l.hasOwnProperty(te)&&ue!==he&&(ue!=null||he!=null)&&(te==="selected"?t.selected=ue&&typeof ue!="function"&&typeof ue!="symbol":kt(t,r,te,ue,l,he));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 a)ue=a[ze],a.hasOwnProperty(ze)&&ue!=null&&!l.hasOwnProperty(ze)&&kt(t,r,ze,null,l,ue);for(ce in l)if(ue=l[ce],he=a[ce],l.hasOwnProperty(ce)&&ue!==he&&(ue!=null||he!=null))switch(ce){case"children":case"dangerouslySetInnerHTML":if(ue!=null)throw Error(s(137,r));break;default:kt(t,r,ce,ue,l,he)}return;default:if(Gr(r)){for(var Tt in a)ue=a[Tt],a.hasOwnProperty(Tt)&&ue!==void 0&&!l.hasOwnProperty(Tt)&&vf(t,r,Tt,void 0,l,ue);for(fe in l)ue=l[fe],he=a[fe],!l.hasOwnProperty(fe)||ue===he||ue===void 0&&he===void 0||vf(t,r,fe,ue,l,he);return}}for(var re in a)ue=a[re],a.hasOwnProperty(re)&&ue!=null&&!l.hasOwnProperty(re)&&kt(t,r,re,null,l,ue);for(me in l)ue=l[me],he=a[me],!l.hasOwnProperty(me)||ue===he||ue==null&&he==null||kt(t,r,me,ue,l,he)}function U0(t){switch(t){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function qE(){if(typeof performance.getEntriesByType=="function"){for(var t=0,r=0,a=performance.getEntriesByType("resource"),l=0;l<a.length;l++){var b=a[l],x=b.transferSize,O=b.initiatorType,$=b.duration;if(x&&$&&U0(O)){for(O=0,$=b.responseEnd,l+=1;l<a.length;l++){var te=a[l],ce=te.startTime;if(ce>$)break;var fe=te.transferSize,me=te.initiatorType;fe&&U0(me)&&(te=te.responseEnd,O+=fe*(te<$?1:($-ce)/(te-ce)))}if(--l,r+=8*(x+O)/(b.duration/1e3),t++,10<t)break}}if(0<t)return r/t/1e6}return navigator.connection&&(t=navigator.connection.downlink,typeof t=="number")?t:5}var bf=null,yf=null;function su(t){return t.nodeType===9?t:t.ownerDocument}function F0(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 W0(t,r){if(t===0)switch(r){case"svg":return 1;case"math":return 2;default:return 0}return t===1&&r==="foreignObject"?0:t}function Sf(t,r){return t==="textarea"||t==="noscript"||typeof r.children=="string"||typeof r.children=="number"||typeof r.children=="bigint"||typeof r.dangerouslySetInnerHTML=="object"&&r.dangerouslySetInnerHTML!==null&&r.dangerouslySetInnerHTML.__html!=null}var wf=null;function KE(){var t=window.event;return t&&t.type==="popstate"?t===wf?!1:(wf=t,!0):(wf=null,!1)}var G0=typeof setTimeout=="function"?setTimeout:void 0,VE=typeof clearTimeout=="function"?clearTimeout:void 0,q0=typeof Promise=="function"?Promise:void 0,YE=typeof queueMicrotask=="function"?queueMicrotask:typeof q0<"u"?function(t){return q0.resolve(null).then(t).catch(XE)}:G0;function XE(t){setTimeout(function(){throw t})}function us(t){return t==="head"}function K0(t,r){var a=r,l=0;do{var b=a.nextSibling;if(t.removeChild(a),b&&b.nodeType===8)if(a=b.data,a==="/$"||a==="/&"){if(l===0){t.removeChild(b),Fa(r);return}l--}else if(a==="$"||a==="$?"||a==="$~"||a==="$!"||a==="&")l++;else if(a==="html")ol(t.ownerDocument.documentElement);else if(a==="head"){a=t.ownerDocument.head,ol(a);for(var x=a.firstChild;x;){var O=x.nextSibling,$=x.nodeName;x[er]||$==="SCRIPT"||$==="STYLE"||$==="LINK"&&x.rel.toLowerCase()==="stylesheet"||a.removeChild(x),x=O}}else a==="body"&&ol(t.ownerDocument.body);a=b}while(a);Fa(r)}function V0(t,r){var a=t;t=0;do{var l=a.nextSibling;if(a.nodeType===1?r?(a._stashedDisplay=a.style.display,a.style.display="none"):(a.style.display=a._stashedDisplay||"",a.getAttribute("style")===""&&a.removeAttribute("style")):a.nodeType===3&&(r?(a._stashedText=a.nodeValue,a.nodeValue=""):a.nodeValue=a._stashedText||""),l&&l.nodeType===8)if(a=l.data,a==="/$"){if(t===0)break;t--}else a!=="$"&&a!=="$?"&&a!=="$~"&&a!=="$!"||t++;a=l}while(a)}function xf(t){var r=t.firstChild;for(r&&r.nodeType===10&&(r=r.nextSibling);r;){var a=r;switch(r=r.nextSibling,a.nodeName){case"HTML":case"HEAD":case"BODY":xf(a),De(a);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(a.rel.toLowerCase()==="stylesheet")continue}t.removeChild(a)}}function ZE(t,r,a,l){for(;t.nodeType===1;){var b=a;if(t.nodeName.toLowerCase()!==r.toLowerCase()){if(!l&&(t.nodeName!=="INPUT"||t.type!=="hidden"))break}else if(l){if(!t[er])switch(r){case"meta":if(!t.hasAttribute("itemprop"))break;return t;case"link":if(x=t.getAttribute("rel"),x==="stylesheet"&&t.hasAttribute("data-precedence"))break;if(x!==b.rel||t.getAttribute("href")!==(b.href==null||b.href===""?null:b.href)||t.getAttribute("crossorigin")!==(b.crossOrigin==null?null:b.crossOrigin)||t.getAttribute("title")!==(b.title==null?null:b.title))break;return t;case"style":if(t.hasAttribute("data-precedence"))break;return t;case"script":if(x=t.getAttribute("src"),(x!==(b.src==null?null:b.src)||t.getAttribute("type")!==(b.type==null?null:b.type)||t.getAttribute("crossorigin")!==(b.crossOrigin==null?null:b.crossOrigin))&&x&&t.hasAttribute("async")&&!t.hasAttribute("itemprop"))break;return t;default:return t}}else if(r==="input"&&t.type==="hidden"){var x=b.name==null?null:""+b.name;if(b.type==="hidden"&&t.getAttribute("name")===x)return t}else return t;if(t=Ni(t.nextSibling),t===null)break}return null}function JE(t,r,a){if(r==="")return null;for(;t.nodeType!==3;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!a||(t=Ni(t.nextSibling),t===null))return null;return t}function Y0(t,r){for(;t.nodeType!==8;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!r||(t=Ni(t.nextSibling),t===null))return null;return t}function Cf(t){return t.data==="$?"||t.data==="$~"}function Ef(t){return t.data==="$!"||t.data==="$?"&&t.ownerDocument.readyState!=="loading"}function QE(t,r){var a=t.ownerDocument;if(t.data==="$~")t._reactRetry=r;else if(t.data!=="$?"||a.readyState!=="loading")r();else{var l=function(){r(),a.removeEventListener("DOMContentLoaded",l)};a.addEventListener("DOMContentLoaded",l),t._reactRetry=l}}function Ni(t){for(;t!=null;t=t.nextSibling){var r=t.nodeType;if(r===1||r===3)break;if(r===8){if(r=t.data,r==="$"||r==="$!"||r==="$?"||r==="$~"||r==="&"||r==="F!"||r==="F")break;if(r==="/$"||r==="/&")return null}}return t}var kf=null;function X0(t){t=t.nextSibling;for(var r=0;t;){if(t.nodeType===8){var a=t.data;if(a==="/$"||a==="/&"){if(r===0)return Ni(t.nextSibling);r--}else a!=="$"&&a!=="$!"&&a!=="$?"&&a!=="$~"&&a!=="&"||r++}t=t.nextSibling}return null}function Z0(t){t=t.previousSibling;for(var r=0;t;){if(t.nodeType===8){var a=t.data;if(a==="$"||a==="$!"||a==="$?"||a==="$~"||a==="&"){if(r===0)return t;r--}else a!=="/$"&&a!=="/&"||r++}t=t.previousSibling}return null}function J0(t,r,a){switch(r=su(a),t){case"html":if(t=r.documentElement,!t)throw Error(s(452));return t;case"head":if(t=r.head,!t)throw Error(s(453));return t;case"body":if(t=r.body,!t)throw Error(s(454));return t;default:throw Error(s(451))}}function ol(t){for(var r=t.attributes;r.length;)t.removeAttributeNode(r[0]);De(t)}var Oi=new Map,Q0=new Set;function au(t){return typeof t.getRootNode=="function"?t.getRootNode():t.nodeType===9?t:t.ownerDocument}var Mr=q.d;q.d={f:e5,r:t5,D:n5,C:i5,L:r5,m:s5,X:o5,S:a5,M:l5};function e5(){var t=Mr.f(),r=Zc();return t||r}function t5(t){var r=_e(t);r!==null&&r.tag===5&&r.type==="form"?mv(r):Mr.r(t)}var Ha=typeof document>"u"?null:document;function eb(t,r,a){var l=Ha;if(l&&typeof r=="string"&&r){var b=ti(r);b='link[rel="'+t+'"][href="'+b+'"]',typeof a=="string"&&(b+='[crossorigin="'+a+'"]'),Q0.has(b)||(Q0.add(b),t={rel:t,crossOrigin:a,href:r},l.querySelector(b)===null&&(r=l.createElement("link"),Dn(r,"link",t),Je(r),l.head.appendChild(r)))}}function n5(t){Mr.D(t),eb("dns-prefetch",t,null)}function i5(t,r){Mr.C(t,r),eb("preconnect",t,r)}function r5(t,r,a){Mr.L(t,r,a);var l=Ha;if(l&&t&&r){var b='link[rel="preload"][as="'+ti(r)+'"]';r==="image"&&a&&a.imageSrcSet?(b+='[imagesrcset="'+ti(a.imageSrcSet)+'"]',typeof a.imageSizes=="string"&&(b+='[imagesizes="'+ti(a.imageSizes)+'"]')):b+='[href="'+ti(t)+'"]';var x=b;switch(r){case"style":x=$a(t);break;case"script":x=Ua(t)}Oi.has(x)||(t=p({rel:"preload",href:r==="image"&&a&&a.imageSrcSet?void 0:t,as:r},a),Oi.set(x,t),l.querySelector(b)!==null||r==="style"&&l.querySelector(ll(x))||r==="script"&&l.querySelector(cl(x))||(r=l.createElement("link"),Dn(r,"link",t),Je(r),l.head.appendChild(r)))}}function s5(t,r){Mr.m(t,r);var a=Ha;if(a&&t){var l=r&&typeof r.as=="string"?r.as:"script",b='link[rel="modulepreload"][as="'+ti(l)+'"][href="'+ti(t)+'"]',x=b;switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":x=Ua(t)}if(!Oi.has(x)&&(t=p({rel:"modulepreload",href:t},r),Oi.set(x,t),a.querySelector(b)===null)){switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(a.querySelector(cl(x)))return}l=a.createElement("link"),Dn(l,"link",t),Je(l),a.head.appendChild(l)}}}function a5(t,r,a){Mr.S(t,r,a);var l=Ha;if(l&&t){var b=ot(l).hoistableStyles,x=$a(t);r=r||"default";var O=b.get(x);if(!O){var $={loading:0,preload:null};if(O=l.querySelector(ll(x)))$.loading=5;else{t=p({rel:"stylesheet",href:t,"data-precedence":r},a),(a=Oi.get(x))&&Tf(t,a);var te=O=l.createElement("link");Je(te),Dn(te,"link",t),te._p=new Promise(function(ce,fe){te.onload=ce,te.onerror=fe}),te.addEventListener("load",function(){$.loading|=1}),te.addEventListener("error",function(){$.loading|=2}),$.loading|=4,ou(O,r,l)}O={type:"stylesheet",instance:O,count:1,state:$},b.set(x,O)}}}function o5(t,r){Mr.X(t,r);var a=Ha;if(a&&t){var l=ot(a).hoistableScripts,b=Ua(t),x=l.get(b);x||(x=a.querySelector(cl(b)),x||(t=p({src:t,async:!0},r),(r=Oi.get(b))&&Af(t,r),x=a.createElement("script"),Je(x),Dn(x,"link",t),a.head.appendChild(x)),x={type:"script",instance:x,count:1,state:null},l.set(b,x))}}function l5(t,r){Mr.M(t,r);var a=Ha;if(a&&t){var l=ot(a).hoistableScripts,b=Ua(t),x=l.get(b);x||(x=a.querySelector(cl(b)),x||(t=p({src:t,async:!0,type:"module"},r),(r=Oi.get(b))&&Af(t,r),x=a.createElement("script"),Je(x),Dn(x,"link",t),a.head.appendChild(x)),x={type:"script",instance:x,count:1,state:null},l.set(b,x))}}function tb(t,r,a,l){var b=(b=se.current)?au(b):null;if(!b)throw Error(s(446));switch(t){case"meta":case"title":return null;case"style":return typeof a.precedence=="string"&&typeof a.href=="string"?(r=$a(a.href),a=ot(b).hoistableStyles,l=a.get(r),l||(l={type:"style",instance:null,count:0,state:null},a.set(r,l)),l):{type:"void",instance:null,count:0,state:null};case"link":if(a.rel==="stylesheet"&&typeof a.href=="string"&&typeof a.precedence=="string"){t=$a(a.href);var x=ot(b).hoistableStyles,O=x.get(t);if(O||(b=b.ownerDocument||b,O={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},x.set(t,O),(x=b.querySelector(ll(t)))&&!x._p&&(O.instance=x,O.state.loading=5),Oi.has(t)||(a={rel:"preload",as:"style",href:a.href,crossOrigin:a.crossOrigin,integrity:a.integrity,media:a.media,hrefLang:a.hrefLang,referrerPolicy:a.referrerPolicy},Oi.set(t,a),x||c5(b,t,a,O.state))),r&&l===null)throw Error(s(528,""));return O}if(r&&l!==null)throw Error(s(529,""));return null;case"script":return r=a.async,a=a.src,typeof a=="string"&&r&&typeof r!="function"&&typeof r!="symbol"?(r=Ua(a),a=ot(b).hoistableScripts,l=a.get(r),l||(l={type:"script",instance:null,count:0,state:null},a.set(r,l)),l):{type:"void",instance:null,count:0,state:null};default:throw Error(s(444,t))}}function $a(t){return'href="'+ti(t)+'"'}function ll(t){return'link[rel="stylesheet"]['+t+"]"}function nb(t){return p({},t,{"data-precedence":t.precedence,precedence:null})}function c5(t,r,a,l){t.querySelector('link[rel="preload"][as="style"]['+r+"]")?l.loading=1:(r=t.createElement("link"),l.preload=r,r.addEventListener("load",function(){return l.loading|=1}),r.addEventListener("error",function(){return l.loading|=2}),Dn(r,"link",a),Je(r),t.head.appendChild(r))}function Ua(t){return'[src="'+ti(t)+'"]'}function cl(t){return"script[async]"+t}function ib(t,r,a){if(r.count++,r.instance===null)switch(r.type){case"style":var l=t.querySelector('style[data-href~="'+ti(a.href)+'"]');if(l)return r.instance=l,Je(l),l;var b=p({},a,{"data-href":a.href,"data-precedence":a.precedence,href:null,precedence:null});return l=(t.ownerDocument||t).createElement("style"),Je(l),Dn(l,"style",b),ou(l,a.precedence,t),r.instance=l;case"stylesheet":b=$a(a.href);var x=t.querySelector(ll(b));if(x)return r.state.loading|=4,r.instance=x,Je(x),x;l=nb(a),(b=Oi.get(b))&&Tf(l,b),x=(t.ownerDocument||t).createElement("link"),Je(x);var O=x;return O._p=new Promise(function($,te){O.onload=$,O.onerror=te}),Dn(x,"link",l),r.state.loading|=4,ou(x,a.precedence,t),r.instance=x;case"script":return x=Ua(a.src),(b=t.querySelector(cl(x)))?(r.instance=b,Je(b),b):(l=a,(b=Oi.get(x))&&(l=p({},a),Af(l,b)),t=t.ownerDocument||t,b=t.createElement("script"),Je(b),Dn(b,"link",l),t.head.appendChild(b),r.instance=b);case"void":return null;default:throw Error(s(443,r.type))}else r.type==="stylesheet"&&(r.state.loading&4)===0&&(l=r.instance,r.state.loading|=4,ou(l,a.precedence,t));return r.instance}function ou(t,r,a){for(var l=a.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),b=l.length?l[l.length-1]:null,x=b,O=0;O<l.length;O++){var $=l[O];if($.dataset.precedence===r)x=$;else if(x!==b)break}x?x.parentNode.insertBefore(t,x.nextSibling):(r=a.nodeType===9?a.head:a,r.insertBefore(t,r.firstChild))}function Tf(t,r){t.crossOrigin==null&&(t.crossOrigin=r.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=r.referrerPolicy),t.title==null&&(t.title=r.title)}function Af(t,r){t.crossOrigin==null&&(t.crossOrigin=r.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=r.referrerPolicy),t.integrity==null&&(t.integrity=r.integrity)}var lu=null;function rb(t,r,a){if(lu===null){var l=new Map,b=lu=new Map;b.set(a,l)}else b=lu,l=b.get(a),l||(l=new Map,b.set(a,l));if(l.has(t))return l;for(l.set(t,null),a=a.getElementsByTagName(t),b=0;b<a.length;b++){var x=a[b];if(!(x[er]||x[It]||t==="link"&&x.getAttribute("rel")==="stylesheet")&&x.namespaceURI!=="http://www.w3.org/2000/svg"){var O=x.getAttribute(r)||"";O=t+O;var $=l.get(O);$?$.push(x):l.set(O,[x])}}return l}function sb(t,r,a){t=t.ownerDocument||t,t.head.insertBefore(a,r==="title"?t.querySelector("head > title"):null)}function u5(t,r,a){if(a===1||r.itemProp!=null)return!1;switch(t){case"meta":case"title":return!0;case"style":if(typeof r.precedence!="string"||typeof r.href!="string"||r.href==="")break;return!0;case"link":if(typeof r.rel!="string"||typeof r.href!="string"||r.href===""||r.onLoad||r.onError)break;return r.rel==="stylesheet"?(t=r.disabled,typeof r.precedence=="string"&&t==null):!0;case"script":if(r.async&&typeof r.async!="function"&&typeof r.async!="symbol"&&!r.onLoad&&!r.onError&&r.src&&typeof r.src=="string")return!0}return!1}function ab(t){return!(t.type==="stylesheet"&&(t.state.loading&3)===0)}function h5(t,r,a,l){if(a.type==="stylesheet"&&(typeof l.media!="string"||matchMedia(l.media).matches!==!1)&&(a.state.loading&4)===0){if(a.instance===null){var b=$a(l.href),x=r.querySelector(ll(b));if(x){r=x._p,r!==null&&typeof r=="object"&&typeof r.then=="function"&&(t.count++,t=cu.bind(t),r.then(t,t)),a.state.loading|=4,a.instance=x,Je(x);return}x=r.ownerDocument||r,l=nb(l),(b=Oi.get(b))&&Tf(l,b),x=x.createElement("link"),Je(x);var O=x;O._p=new Promise(function($,te){O.onload=$,O.onerror=te}),Dn(x,"link",l),a.instance=x}t.stylesheets===null&&(t.stylesheets=new Map),t.stylesheets.set(a,r),(r=a.state.preload)&&(a.state.loading&3)===0&&(t.count++,a=cu.bind(t),r.addEventListener("load",a),r.addEventListener("error",a))}}var Rf=0;function d5(t,r){return t.stylesheets&&t.count===0&&hu(t,t.stylesheets),0<t.count||0<t.imgCount?function(a){var l=setTimeout(function(){if(t.stylesheets&&hu(t,t.stylesheets),t.unsuspend){var x=t.unsuspend;t.unsuspend=null,x()}},6e4+r);0<t.imgBytes&&Rf===0&&(Rf=62500*qE());var b=setTimeout(function(){if(t.waitingForImages=!1,t.count===0&&(t.stylesheets&&hu(t,t.stylesheets),t.unsuspend)){var x=t.unsuspend;t.unsuspend=null,x()}},(t.imgBytes>Rf?50:800)+r);return t.unsuspend=a,function(){t.unsuspend=null,clearTimeout(l),clearTimeout(b)}}:null}function cu(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)hu(this,this.stylesheets);else if(this.unsuspend){var t=this.unsuspend;this.unsuspend=null,t()}}}var uu=null;function hu(t,r){t.stylesheets=null,t.unsuspend!==null&&(t.count++,uu=new Map,r.forEach(f5,t),uu=null,cu.call(t))}function f5(t,r){if(!(r.state.loading&4)){var a=uu.get(t);if(a)var l=a.get(null);else{a=new Map,uu.set(t,a);for(var b=t.querySelectorAll("link[data-precedence],style[data-precedence]"),x=0;x<b.length;x++){var O=b[x];(O.nodeName==="LINK"||O.getAttribute("media")!=="not all")&&(a.set(O.dataset.precedence,O),l=O)}l&&a.set(null,l)}b=r.instance,O=b.getAttribute("data-precedence"),x=a.get(O)||l,x===l&&a.set(null,b),a.set(O,b),this.count++,l=cu.bind(this),b.addEventListener("load",l),b.addEventListener("error",l),x?x.parentNode.insertBefore(b,x.nextSibling):(t=t.nodeType===9?t.head:t,t.insertBefore(b,t.firstChild)),r.state.loading|=4}}var ul={$$typeof:S,Provider:null,Consumer:null,_currentValue:V,_currentValue2:V,_threadCount:0};function p5(t,r,a,l,b,x,O,$,te){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=bt(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=bt(0),this.hiddenUpdates=bt(null),this.identifierPrefix=l,this.onUncaughtError=b,this.onCaughtError=x,this.onRecoverableError=O,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=te,this.incompleteTransitions=new Map}function ob(t,r,a,l,b,x,O,$,te,ce,fe,me){return t=new p5(t,r,a,O,te,ce,fe,me,$),r=1,x===!0&&(r|=24),x=pi(3,null,null,r),t.current=x,x.stateNode=t,r=od(),r.refCount++,t.pooledCache=r,r.refCount++,x.memoizedState={element:l,isDehydrated:a,cache:r},hd(x),t}function lb(t){return t?(t=ba,t):ba}function cb(t,r,a,l,b,x){b=lb(b),l.context===null?l.context=b:l.pendingContext=b,l=Qr(r),l.payload={element:a},x=x===void 0?null:x,x!==null&&(l.callback=x),a=es(t,l,r),a!==null&&(oi(a,t,r),Uo(a,t,r))}function ub(t,r){if(t=t.memoizedState,t!==null&&t.dehydrated!==null){var a=t.retryLane;t.retryLane=a!==0&&a<r?a:r}}function Lf(t,r){ub(t,r),(t=t.alternate)&&ub(t,r)}function hb(t){if(t.tag===13||t.tag===31){var r=Ds(t,67108864);r!==null&&oi(r,t,67108864),Lf(t,67108864)}}function db(t){if(t.tag===13||t.tag===31){var r=bi();r=nt(r);var a=Ds(t,r);a!==null&&oi(a,t,r),Lf(t,r)}}var du=!0;function g5(t,r,a,l){var b=z.T;z.T=null;var x=q.p;try{q.p=2,Mf(t,r,a,l)}finally{q.p=x,z.T=b}}function m5(t,r,a,l){var b=z.T;z.T=null;var x=q.p;try{q.p=8,Mf(t,r,a,l)}finally{q.p=x,z.T=b}}function Mf(t,r,a,l){if(du){var b=Nf(l);if(b===null)_f(t,r,l,fu,a),pb(t,l);else if(v5(b,t,r,a,l))l.stopPropagation();else if(pb(t,l),r&4&&-1<_5.indexOf(t)){for(;b!==null;){var x=_e(b);if(x!==null)switch(x.tag){case 3:if(x=x.stateNode,x.current.memoizedState.isDehydrated){var O=jt(x.pendingLanes);if(O!==0){var $=x;for($.pendingLanes|=2,$.entangledLanes|=2;O;){var te=1<<31-Ze(O);$.entanglements[1]|=te,O&=~te}rr(x),(vt&6)===0&&(Yc=ht()+500,rl(0))}}break;case 31:case 13:$=Ds(x,2),$!==null&&oi($,x,2),Zc(),Lf(x,2)}if(x=Nf(l),x===null&&_f(t,r,l,fu,a),x===b)break;b=x}b!==null&&l.stopPropagation()}else _f(t,r,l,null,a)}}function Nf(t){return t=Ge(t),Of(t)}var fu=null;function Of(t){if(fu=null,t=Q(t),t!==null){var r=f(t);if(r===null)t=null;else{var a=r.tag;if(a===13){if(t=_(r),t!==null)return t;t=null}else if(a===31){if(t=c(r),t!==null)return t;t=null}else if(a===3){if(r.stateNode.current.memoizedState.isDehydrated)return r.tag===3?r.stateNode.containerInfo:null;t=null}else r!==t&&(t=null)}}return fu=t,null}function fb(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(Lt()){case Ct:return 2;case Ft:return 8;case Kt:case Jn:return 32;case bn:return 268435456;default:return 32}default:return 32}}var Df=!1,hs=null,ds=null,fs=null,hl=new Map,dl=new Map,ps=[],_5="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 pb(t,r){switch(t){case"focusin":case"focusout":hs=null;break;case"dragenter":case"dragleave":ds=null;break;case"mouseover":case"mouseout":fs=null;break;case"pointerover":case"pointerout":hl.delete(r.pointerId);break;case"gotpointercapture":case"lostpointercapture":dl.delete(r.pointerId)}}function fl(t,r,a,l,b,x){return t===null||t.nativeEvent!==x?(t={blockedOn:r,domEventName:a,eventSystemFlags:l,nativeEvent:x,targetContainers:[b]},r!==null&&(r=_e(r),r!==null&&hb(r)),t):(t.eventSystemFlags|=l,r=t.targetContainers,b!==null&&r.indexOf(b)===-1&&r.push(b),t)}function v5(t,r,a,l,b){switch(r){case"focusin":return hs=fl(hs,t,r,a,l,b),!0;case"dragenter":return ds=fl(ds,t,r,a,l,b),!0;case"mouseover":return fs=fl(fs,t,r,a,l,b),!0;case"pointerover":var x=b.pointerId;return hl.set(x,fl(hl.get(x)||null,t,r,a,l,b)),!0;case"gotpointercapture":return x=b.pointerId,dl.set(x,fl(dl.get(x)||null,t,r,a,l,b)),!0}return!1}function gb(t){var r=Q(t.target);if(r!==null){var a=f(r);if(a!==null){if(r=a.tag,r===13){if(r=_(a),r!==null){t.blockedOn=r,fr(t.priority,function(){db(a)});return}}else if(r===31){if(r=c(a),r!==null){t.blockedOn=r,fr(t.priority,function(){db(a)});return}}else if(r===3&&a.stateNode.current.memoizedState.isDehydrated){t.blockedOn=a.tag===3?a.stateNode.containerInfo:null;return}}}t.blockedOn=null}function pu(t){if(t.blockedOn!==null)return!1;for(var r=t.targetContainers;0<r.length;){var a=Nf(t.nativeEvent);if(a===null){a=t.nativeEvent;var l=new a.constructor(a.type,a);Ae=l,a.target.dispatchEvent(l),Ae=null}else return r=_e(a),r!==null&&hb(r),t.blockedOn=a,!1;r.shift()}return!0}function mb(t,r,a){pu(t)&&a.delete(r)}function b5(){Df=!1,hs!==null&&pu(hs)&&(hs=null),ds!==null&&pu(ds)&&(ds=null),fs!==null&&pu(fs)&&(fs=null),hl.forEach(mb),dl.forEach(mb)}function gu(t,r){t.blockedOn===r&&(t.blockedOn=null,Df||(Df=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,b5)))}var mu=null;function _b(t){mu!==t&&(mu=t,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){mu===t&&(mu=null);for(var r=0;r<t.length;r+=3){var a=t[r],l=t[r+1],b=t[r+2];if(typeof l!="function"){if(Of(l||a)===null)continue;break}var x=_e(a);x!==null&&(t.splice(r,3),r-=3,Md(x,{pending:!0,data:b,method:a.method,action:l},l,b))}}))}function Fa(t){function r(te){return gu(te,t)}hs!==null&&gu(hs,t),ds!==null&&gu(ds,t),fs!==null&&gu(fs,t),hl.forEach(r),dl.forEach(r);for(var a=0;a<ps.length;a++){var l=ps[a];l.blockedOn===t&&(l.blockedOn=null)}for(;0<ps.length&&(a=ps[0],a.blockedOn===null);)gb(a),a.blockedOn===null&&ps.shift();if(a=(t.ownerDocument||t).$$reactFormReplay,a!=null)for(l=0;l<a.length;l+=3){var b=a[l],x=a[l+1],O=b[Nt]||null;if(typeof x=="function")O||_b(a);else if(O){var $=null;if(x&&x.hasAttribute("formAction")){if(b=x,O=x[Nt]||null)$=O.formAction;else if(Of(b)!==null)continue}else $=O.action;typeof $=="function"?a[l+1]=$:(a.splice(l,3),l-=3),_b(a)}}}function vb(){function t(x){x.canIntercept&&x.info==="react-transition"&&x.intercept({handler:function(){return new Promise(function(O){return b=O})},focusReset:"manual",scroll:"manual"})}function r(){b!==null&&(b(),b=null),l||setTimeout(a,20)}function a(){if(!l&&!navigation.transition){var x=navigation.currentEntry;x&&x.url!=null&&navigation.navigate(x.url,{state:x.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var l=!1,b=null;return navigation.addEventListener("navigate",t),navigation.addEventListener("navigatesuccess",r),navigation.addEventListener("navigateerror",r),setTimeout(a,100),function(){l=!0,navigation.removeEventListener("navigate",t),navigation.removeEventListener("navigatesuccess",r),navigation.removeEventListener("navigateerror",r),b!==null&&(b(),b=null)}}}function jf(t){this._internalRoot=t}_u.prototype.render=jf.prototype.render=function(t){var r=this._internalRoot;if(r===null)throw Error(s(409));var a=r.current,l=bi();cb(a,l,t,r,null,null)},_u.prototype.unmount=jf.prototype.unmount=function(){var t=this._internalRoot;if(t!==null){this._internalRoot=null;var r=t.containerInfo;cb(t.current,2,null,t,null,null),Zc(),r[Fi]=null}};function _u(t){this._internalRoot=t}_u.prototype.unstable_scheduleHydration=function(t){if(t){var r=dr();t={blockedOn:null,target:t,priority:r};for(var a=0;a<ps.length&&r!==0&&r<ps[a].priority;a++);ps.splice(a,0,t),a===0&&gb(t)}};var bb=n.version;if(bb!=="19.2.7")throw Error(s(527,bb,"19.2.7"));q.findDOMNode=function(t){var r=t._reactInternals;if(r===void 0)throw typeof t.render=="function"?Error(s(188)):(t=Object.keys(t).join(","),Error(s(268,t)));return t=d(r),t=t!==null?y(t):null,t=t===null?null:t.stateNode,t};var y5={bundleType:0,version:"19.2.7",rendererPackageName:"react-dom",currentDispatcherRef:z,reconcilerVersion:"19.2.7"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var vu=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!vu.isDisabled&&vu.supportsFiber)try{Tn=vu.inject(y5),ve=vu}catch{}}return gl.createRoot=function(t,r){if(!o(t))throw Error(s(299));var a=!1,l="",b=kv,x=Tv,O=Av;return r!=null&&(r.unstable_strictMode===!0&&(a=!0),r.identifierPrefix!==void 0&&(l=r.identifierPrefix),r.onUncaughtError!==void 0&&(b=r.onUncaughtError),r.onCaughtError!==void 0&&(x=r.onCaughtError),r.onRecoverableError!==void 0&&(O=r.onRecoverableError)),r=ob(t,1,!1,null,null,a,l,null,b,x,O,vb),t[Fi]=r.current,mf(t),new jf(r)},gl.hydrateRoot=function(t,r,a){if(!o(t))throw Error(s(299));var l=!1,b="",x=kv,O=Tv,$=Av,te=null;return a!=null&&(a.unstable_strictMode===!0&&(l=!0),a.identifierPrefix!==void 0&&(b=a.identifierPrefix),a.onUncaughtError!==void 0&&(x=a.onUncaughtError),a.onCaughtError!==void 0&&(O=a.onCaughtError),a.onRecoverableError!==void 0&&($=a.onRecoverableError),a.formState!==void 0&&(te=a.formState)),r=ob(t,1,!0,r,a??null,l,b,te,x,O,$,vb),r.context=lb(null),a=r.current,l=bi(),l=nt(l),b=Qr(l),b.callback=null,es(a,b,l),a=l,r.current.lanes=a,dt(r,a),rr(r),t[Fi]=r.current,mf(t),new _u(r)},gl.version="19.2.7",gl}var Lb;function ok(){if(Lb)return zf.exports;Lb=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(),zf.exports=ak(),zf.exports}var lk=ok();var Mb="popstate";function Nb(e){return typeof e=="object"&&e!=null&&"pathname"in e&&"search"in e&&"hash"in e&&"state"in e&&"key"in e}function ck(e={}){function n(s,o){let f=o.state?.masked,{pathname:_,search:c,hash:h}=f||s.location;return Hp("",{pathname:_,search:c,hash:h},o.state&&o.state.usr||null,o.state&&o.state.key||"default",f?{pathname:s.location.pathname,search:s.location.search,hash:s.location.hash}:void 0)}function i(s,o){return typeof o=="string"?o:Wl(o)}return hk(n,i,null,e)}function qt(e,n){if(e===!1||e===null||typeof e>"u")throw new Error(n)}function Zi(e,n){if(!e){typeof console<"u"&&console.warn(n);try{throw new Error(n)}catch{}}}function uk(){return Math.random().toString(36).substring(2,10)}function Ob(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 Hp(e,n,i=null,s,o){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof n=="string"?vo(n):n,state:i,key:n&&n.key||s||uk(),mask:o}}function Wl({pathname:e="/",search:n="",hash:i=""}){return n&&n!=="?"&&(e+=n.charAt(0)==="?"?n:"?"+n),i&&i!=="#"&&(e+=i.charAt(0)==="#"?i:"#"+i),e}function vo(e){let n={};if(e){let i=e.indexOf("#");i>=0&&(n.hash=e.substring(i),e=e.substring(0,i));let s=e.indexOf("?");s>=0&&(n.search=e.substring(s),e=e.substring(0,s)),e&&(n.pathname=e)}return n}function hk(e,n,i,s={}){let{window:o=document.defaultView,v5Compat:f=!1}=s,_=o.history,c="POP",h=null,d=y();d==null&&(d=0,_.replaceState({..._.state,idx:d},""));function y(){return(_.state||{idx:null}).idx}function p(){c="POP";let g=y(),v=g==null?null:g-d;d=g,h&&h({action:c,location:E.location,delta:v})}function w(g,v){c="PUSH";let m=Nb(g)?g:Hp(E.location,g,v);d=y()+1;let S=Ob(m,d),k=E.createHref(m.mask||m);try{_.pushState(S,"",k)}catch(L){if(L instanceof DOMException&&L.name==="DataCloneError")throw L;o.location.assign(k)}f&&h&&h({action:c,location:E.location,delta:1})}function C(g,v){c="REPLACE";let m=Nb(g)?g:Hp(E.location,g,v);d=y();let S=Ob(m,d),k=E.createHref(m.mask||m);_.replaceState(S,"",k),f&&h&&h({action:c,location:E.location,delta:0})}function T(g){return dk(o,g)}let E={get action(){return c},get location(){return e(o,_)},listen(g){if(h)throw new Error("A history only accepts one active listener");return o.addEventListener(Mb,p),h=g,()=>{o.removeEventListener(Mb,p),h=null}},createHref(g){return n(o,g)},createURL:T,encodeLocation(g){let v=T(g);return{pathname:v.pathname,search:v.search,hash:v.hash}},push:w,replace:C,go(g){return _.go(g)}};return E}function dk(e,n,i=!1){let s="http://localhost";e&&(s=e.location.origin!=="null"?e.location.origin:e.location.href),qt(s,"No window.location.(origin|href) available to create URL");let o=typeof n=="string"?n:Wl(n);return o=o.replace(/ $/,"%20"),!i&&o.startsWith("//")&&(o=s+o),new URL(o,s)}function jS(e,n,i="/"){return fk(e,n,i,!1)}function fk(e,n,i,s,o){let f=typeof n=="string"?vo(n):n,_=$r(f.pathname||"/",i);if(_==null)return null;let c=pk(e),h=null,d=kk(_);for(let y=0;h==null&&y<c.length;++y)h=Ck(c[y],d,s);return h}function pk(e){let n=IS(e);return gk(n),n}function IS(e,n=[],i=[],s="",o=!1){let f=(_,c,h=o,d)=>{let y={relativePath:d===void 0?_.path||"":d,caseSensitive:_.caseSensitive===!0,childrenIndex:c,route:_};if(y.relativePath.startsWith("/")){if(!y.relativePath.startsWith(s)&&h)return;qt(y.relativePath.startsWith(s),`Absolute route path "${y.relativePath}" nested under path "${s}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),y.relativePath=y.relativePath.slice(s.length)}let p=Xi([s,y.relativePath]),w=i.concat(y);_.children&&_.children.length>0&&(qt(_.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${p}".`),IS(_.children,n,w,p,h)),!(_.path==null&&!_.index)&&n.push({path:p,score:wk(p,_.index),routesMeta:w})};return e.forEach((_,c)=>{if(_.path===""||!_.path?.includes("?"))f(_,c);else for(let h of BS(_.path))f(_,c,!0,h)}),n}function BS(e){let n=e.split("/");if(n.length===0)return[];let[i,...s]=n,o=i.endsWith("?"),f=i.replace(/\?$/,"");if(s.length===0)return o?[f,""]:[f];let _=BS(s.join("/")),c=[];return c.push(..._.map(h=>h===""?f:[f,h].join("/"))),o&&c.push(..._),c.map(h=>e.startsWith("/")&&h===""?"/":h)}function gk(e){e.sort((n,i)=>n.score!==i.score?i.score-n.score:xk(n.routesMeta.map(s=>s.childrenIndex),i.routesMeta.map(s=>s.childrenIndex)))}var mk=/^:[\w-]+$/,_k=3,vk=2,bk=1,yk=10,Sk=-2,Db=e=>e==="*";function wk(e,n){let i=e.split("/"),s=i.length;return i.some(Db)&&(s+=Sk),n&&(s+=vk),i.filter(o=>!Db(o)).reduce((o,f)=>o+(mk.test(f)?_k:f===""?bk:yk),s)}function xk(e,n){return e.length===n.length&&e.slice(0,-1).every((s,o)=>s===n[o])?e[e.length-1]-n[n.length-1]:0}function Ck(e,n,i=!1){let{routesMeta:s}=e,o={},f="/",_=[];for(let c=0;c<s.length;++c){let h=s[c],d=c===s.length-1,y=f==="/"?n:n.slice(f.length)||"/",p=th({path:h.relativePath,caseSensitive:h.caseSensitive,end:d},y),w=h.route;if(!p&&d&&i&&!s[s.length-1].route.index&&(p=th({path:h.relativePath,caseSensitive:h.caseSensitive,end:!1},y)),!p)return null;Object.assign(o,p.params),_.push({params:o,pathname:Xi([f,p.pathname]),pathnameBase:Lk(Xi([f,p.pathnameBase])),route:w}),p.pathnameBase!=="/"&&(f=Xi([f,p.pathnameBase]))}return _}function th(e,n){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[i,s]=Ek(e.path,e.caseSensitive,e.end),o=n.match(i);if(!o)return null;let f=o[0],_=f.replace(/(.)\/+$/,"$1"),c=o.slice(1);return{params:s.reduce((d,{paramName:y,isOptional:p},w)=>{if(y==="*"){let T=c[w]||"";_=f.slice(0,f.length-T.length).replace(/(.)\/+$/,"$1")}const C=c[w];return p&&!C?d[y]=void 0:d[y]=(C||"").replace(/%2F/g,"/"),d},{}),pathname:f,pathnameBase:_,pattern:e}}function Ek(e,n=!1,i=!0){Zi(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 s=[],o="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(_,c,h,d,y)=>{if(s.push({paramName:c,isOptional:h!=null}),h){let p=y.charAt(d+_.length);return p&&p!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}return"/([^\\/]+)"}).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return e.endsWith("*")?(s.push({paramName:"*"}),o+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):i?o+="\\/*$":e!==""&&e!=="/"&&(o+="(?:(?=\\/|$))"),[new RegExp(o,n?void 0:"i"),s]}function kk(e){try{return e.split("/").map(n=>decodeURIComponent(n).replace(/\//g,"%2F")).join("/")}catch(n){return Zi(!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 $r(e,n){if(n==="/")return e;if(!e.toLowerCase().startsWith(n.toLowerCase()))return null;let i=n.endsWith("/")?n.length-1:n.length,s=e.charAt(i);return s&&s!=="/"?null:e.slice(i)||"/"}var Tk=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function Ak(e,n="/"){let{pathname:i,search:s="",hash:o=""}=typeof e=="string"?vo(e):e,f;return i?(i=PS(i),i.startsWith("/")?f=jb(i.substring(1),"/"):f=jb(i,n)):f=n,{pathname:f,search:Mk(s),hash:Nk(o)}}function jb(e,n){let i=nh(n).split("/");return e.split("/").forEach(o=>{o===".."?i.length>1&&i.pop():o!=="."&&i.push(o)}),i.length>1?i.join("/"):"/"}function Ff(e,n,i,s){return`Cannot include a '${e}' character in a manually specified \`to.${n}\` field [${JSON.stringify(s)}]. Please separate it out to the \`to.${i}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function Rk(e){return e.filter((n,i)=>i===0||n.route.path&&n.route.path.length>0)}function Zg(e){let n=Rk(e);return n.map((i,s)=>s===n.length-1?i.pathname:i.pathnameBase)}function bh(e,n,i,s=!1){let o;typeof e=="string"?o=vo(e):(o={...e},qt(!o.pathname||!o.pathname.includes("?"),Ff("?","pathname","search",o)),qt(!o.pathname||!o.pathname.includes("#"),Ff("#","pathname","hash",o)),qt(!o.search||!o.search.includes("#"),Ff("#","search","hash",o)));let f=e===""||o.pathname==="",_=f?"/":o.pathname,c;if(_==null)c=i;else{let p=n.length-1;if(!s&&_.startsWith("..")){let w=_.split("/");for(;w[0]==="..";)w.shift(),p-=1;o.pathname=w.join("/")}c=p>=0?n[p]:"/"}let h=Ak(o,c),d=_&&_!=="/"&&_.endsWith("/"),y=(f||_===".")&&i.endsWith("/");return!h.pathname.endsWith("/")&&(d||y)&&(h.pathname+="/"),h}var PS=e=>e.replace(/\/\/+/g,"/"),Xi=e=>PS(e.join("/")),nh=e=>e.replace(/\/+$/,""),Lk=e=>nh(e).replace(/^\/*/,"/"),Mk=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,Nk=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,Ok=class{constructor(e,n,i,s=!1){this.status=e,this.statusText=n||"",this.internal=s,i instanceof Error?(this.data=i.toString(),this.error=i):this.data=i}};function Dk(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}function jk(e){let n=e.map(i=>i.route.path).filter(Boolean);return Xi(n)||"/"}var zS=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function HS(e,n){let i=e;if(typeof i!="string"||!Tk.test(i))return{absoluteURL:void 0,isExternal:!1,to:i};let s=i,o=!1;if(zS)try{let f=new URL(window.location.href),_=i.startsWith("//")?new URL(f.protocol+i):new URL(i),c=$r(_.pathname,n);_.origin===f.origin&&c!=null?i=c+_.search+_.hash:o=!0}catch{Zi(!1,`<Link to="${i}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:s,isExternal:o,to:i}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var $S=["POST","PUT","PATCH","DELETE"];new Set($S);var Ik=["GET",...$S];new Set(Ik);var bo=N.createContext(null);bo.displayName="DataRouter";var yh=N.createContext(null);yh.displayName="DataRouterState";var US=N.createContext(!1);function Bk(){return N.useContext(US)}var FS=N.createContext({isTransitioning:!1});FS.displayName="ViewTransition";var Pk=N.createContext(new Map);Pk.displayName="Fetchers";var zk=N.createContext(null);zk.displayName="Await";var Ci=N.createContext(null);Ci.displayName="Navigation";var ic=N.createContext(null);ic.displayName="Location";var ur=N.createContext({outlet:null,matches:[],isDataRoute:!1});ur.displayName="Route";var Jg=N.createContext(null);Jg.displayName="RouteError";var WS="REACT_ROUTER_ERROR",Hk="REDIRECT",$k="ROUTE_ERROR_RESPONSE";function Uk(e){if(e.startsWith(`${WS}:${Hk}:{`))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 Fk(e){if(e.startsWith(`${WS}:${$k}:{`))try{let n=JSON.parse(e.slice(40));if(typeof n=="object"&&n&&typeof n.status=="number"&&typeof n.statusText=="string")return new Ok(n.status,n.statusText,n.data)}catch{}}function Wk(e,{relative:n}={}){qt(yo(),"useHref() may be used only in the context of a <Router> component.");let{basename:i,navigator:s}=N.useContext(Ci),{hash:o,pathname:f,search:_}=rc(e,{relative:n}),c=f;return i!=="/"&&(c=f==="/"?i:Xi([i,f])),s.createHref({pathname:c,search:_,hash:o})}function yo(){return N.useContext(ic)!=null}function Ui(){return qt(yo(),"useLocation() may be used only in the context of a <Router> component."),N.useContext(ic).location}var GS="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function qS(e){N.useContext(Ci).static||N.useLayoutEffect(e)}function Sh(){let{isDataRoute:e}=N.useContext(ur);return e?iT():Gk()}function Gk(){qt(yo(),"useNavigate() may be used only in the context of a <Router> component.");let e=N.useContext(bo),{basename:n,navigator:i}=N.useContext(Ci),{matches:s}=N.useContext(ur),{pathname:o}=Ui(),f=JSON.stringify(Zg(s)),_=N.useRef(!1);return qS(()=>{_.current=!0}),N.useCallback((h,d={})=>{if(Zi(_.current,GS),!_.current)return;if(typeof h=="number"){i.go(h);return}let y=bh(h,JSON.parse(f),o,d.relative==="path");e==null&&n!=="/"&&(y.pathname=y.pathname==="/"?n:Xi([n,y.pathname])),(d.replace?i.replace:i.push)(y,d.state,d)},[n,i,f,o,e])}N.createContext(null);function rc(e,{relative:n}={}){let{matches:i}=N.useContext(ur),{pathname:s}=Ui(),o=JSON.stringify(Zg(i));return N.useMemo(()=>bh(e,JSON.parse(o),s,n==="path"),[e,o,s,n])}function qk(e,n){return KS(e,n)}function KS(e,n,i){qt(yo(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:s}=N.useContext(Ci),{matches:o}=N.useContext(ur),f=o[o.length-1],_=f?f.params:{},c=f?f.pathname:"/",h=f?f.pathnameBase:"/",d=f&&f.route;{let g=d&&d.path||"";YS(c,!d||g.endsWith("*")||g.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${c}" (under <Route path="${g}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
|
|
10
|
-
|
|
11
|
-
Please change the parent <Route path="${g}"> to <Route path="${g==="/"?"*":`${g}/*`}">.`)}let y=Ui(),p;if(n){let g=typeof n=="string"?vo(n):n;qt(h==="/"||g.pathname?.startsWith(h),`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 "${h}" but pathname "${g.pathname}" was given in the \`location\` prop.`),p=g}else p=y;let w=p.pathname||"/",C=w;if(h!=="/"){let g=h.replace(/^\//,"").split("/");C="/"+w.replace(/^\//,"").split("/").slice(g.length).join("/")}let T=i&&i.state.matches.length?i.state.matches.map(g=>Object.assign(g,{route:i.manifest[g.route.id]||g.route})):jS(e,{pathname:C});Zi(d||T!=null,`No routes matched location "${p.pathname}${p.search}${p.hash}" `),Zi(T==null||T[T.length-1].route.element!==void 0||T[T.length-1].route.Component!==void 0||T[T.length-1].route.lazy!==void 0,`Matched leaf route at location "${p.pathname}${p.search}${p.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let E=Zk(T&&T.map(g=>Object.assign({},g,{params:Object.assign({},_,g.params),pathname:Xi([h,s.encodeLocation?s.encodeLocation(g.pathname.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:g.pathname]),pathnameBase:g.pathnameBase==="/"?h:Xi([h,s.encodeLocation?s.encodeLocation(g.pathnameBase.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:g.pathnameBase])})),o,i);return n&&E?N.createElement(ic.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",mask:void 0,...p},navigationType:"POP"}},E):E}function Kk(){let e=nT(),n=Dk(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),i=e instanceof Error?e.stack:null,s="rgba(200,200,200, 0.5)",o={padding:"0.5rem",backgroundColor:s},f={padding:"2px 4px",backgroundColor:s},_=null;return console.error("Error handled by React Router default ErrorBoundary:",e),_=N.createElement(N.Fragment,null,N.createElement("p",null,"💿 Hey developer 👋"),N.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",N.createElement("code",{style:f},"ErrorBoundary")," or"," ",N.createElement("code",{style:f},"errorElement")," prop on your route.")),N.createElement(N.Fragment,null,N.createElement("h2",null,"Unexpected Application Error!"),N.createElement("h3",{style:{fontStyle:"italic"}},n),i?N.createElement("pre",{style:o},i):null,_)}var Vk=N.createElement(Kk,null),VS=class extends N.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 i=Fk(e.digest);i&&(e=i)}let n=e!==void 0?N.createElement(ur.Provider,{value:this.props.routeContext},N.createElement(Jg.Provider,{value:e,children:this.props.component})):this.props.children;return this.context?N.createElement(Yk,{error:e},n):n}};VS.contextType=US;var Wf=new WeakMap;function Yk({children:e,error:n}){let{basename:i}=N.useContext(Ci);if(typeof n=="object"&&n&&"digest"in n&&typeof n.digest=="string"){let s=Uk(n.digest);if(s){let o=Wf.get(n);if(o)throw o;let f=HS(s.location,i);if(zS&&!Wf.get(n))if(f.isExternal||s.reloadDocument)window.location.href=f.absoluteURL||f.to;else{const _=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(f.to,{replace:s.replace}));throw Wf.set(n,_),_}return N.createElement("meta",{httpEquiv:"refresh",content:`0;url=${f.absoluteURL||f.to}`})}}return e}function Xk({routeContext:e,match:n,children:i}){let s=N.useContext(bo);return s&&s.static&&s.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(s.staticContext._deepestRenderedBoundaryId=n.route.id),N.createElement(ur.Provider,{value:e},i)}function Zk(e,n=[],i){let s=i?.state;if(e==null){if(!s)return null;if(s.errors)e=s.matches;else if(n.length===0&&!s.initialized&&s.matches.length>0)e=s.matches;else return null}let o=e,f=s?.errors;if(f!=null){let y=o.findIndex(p=>p.route.id&&f?.[p.route.id]!==void 0);qt(y>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(f).join(",")}`),o=o.slice(0,Math.min(o.length,y+1))}let _=!1,c=-1;if(i&&s){_=s.renderFallback;for(let y=0;y<o.length;y++){let p=o[y];if((p.route.HydrateFallback||p.route.hydrateFallbackElement)&&(c=y),p.route.id){let{loaderData:w,errors:C}=s,T=p.route.loader&&!w.hasOwnProperty(p.route.id)&&(!C||C[p.route.id]===void 0);if(p.route.lazy||T){i.isStatic&&(_=!0),c>=0?o=o.slice(0,c+1):o=[o[0]];break}}}}let h=i?.onError,d=s&&h?(y,p)=>{h(y,{location:s.location,params:s.matches?.[0]?.params??{},pattern:jk(s.matches),errorInfo:p})}:void 0;return o.reduceRight((y,p,w)=>{let C,T=!1,E=null,g=null;s&&(C=f&&p.route.id?f[p.route.id]:void 0,E=p.route.errorElement||Vk,_&&(c<0&&w===0?(YS("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),T=!0,g=null):c===w&&(T=!0,g=p.route.hydrateFallbackElement||null)));let v=n.concat(o.slice(0,w+1)),m=()=>{let S;return C?S=E:T?S=g:p.route.Component?S=N.createElement(p.route.Component,null):p.route.element?S=p.route.element:S=y,N.createElement(Xk,{match:p,routeContext:{outlet:y,matches:v,isDataRoute:s!=null},children:S})};return s&&(p.route.ErrorBoundary||p.route.errorElement||w===0)?N.createElement(VS,{location:s.location,revalidation:s.revalidation,component:E,error:C,children:m(),routeContext:{outlet:null,matches:v,isDataRoute:!0},onError:d}):m()},null)}function Qg(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Jk(e){let n=N.useContext(bo);return qt(n,Qg(e)),n}function Qk(e){let n=N.useContext(yh);return qt(n,Qg(e)),n}function eT(e){let n=N.useContext(ur);return qt(n,Qg(e)),n}function em(e){let n=eT(e),i=n.matches[n.matches.length-1];return qt(i.route.id,`${e} can only be used on routes that contain a unique "id"`),i.route.id}function tT(){return em("useRouteId")}function nT(){let e=N.useContext(Jg),n=Qk("useRouteError"),i=em("useRouteError");return e!==void 0?e:n.errors?.[i]}function iT(){let{router:e}=Jk("useNavigate"),n=em("useNavigate"),i=N.useRef(!1);return qS(()=>{i.current=!0}),N.useCallback(async(o,f={})=>{Zi(i.current,GS),i.current&&(typeof o=="number"?await e.navigate(o):await e.navigate(o,{fromRouteId:n,...f}))},[e,n])}var Ib={};function YS(e,n,i){!n&&!Ib[e]&&(Ib[e]=!0,Zi(!1,i))}N.memo(rT);function rT({routes:e,manifest:n,future:i,state:s,isStatic:o,onError:f}){return KS(e,void 0,{manifest:n,state:s,isStatic:o,onError:f})}function Bb({to:e,replace:n,state:i,relative:s}){qt(yo(),"<Navigate> may be used only in the context of a <Router> component.");let{static:o}=N.useContext(Ci);Zi(!o,"<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}=N.useContext(ur),{pathname:_}=Ui(),c=Sh(),h=bh(e,Zg(f),_,s==="path"),d=JSON.stringify(h);return N.useEffect(()=>{c(JSON.parse(d),{replace:n,state:i,relative:s})},[c,d,s,n,i]),null}function Ya(e){qt(!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 sT({basename:e="/",children:n=null,location:i,navigationType:s="POP",navigator:o,static:f=!1,useTransitions:_}){qt(!yo(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let c=e.replace(/^\/*/,"/"),h=N.useMemo(()=>({basename:c,navigator:o,static:f,useTransitions:_,future:{}}),[c,o,f,_]);typeof i=="string"&&(i=vo(i));let{pathname:d="/",search:y="",hash:p="",state:w=null,key:C="default",mask:T}=i,E=N.useMemo(()=>{let g=$r(d,c);return g==null?null:{location:{pathname:g,search:y,hash:p,state:w,key:C,mask:T},navigationType:s}},[c,d,y,p,w,C,s,T]);return Zi(E!=null,`<Router basename="${c}"> is not able to match the URL "${d}${y}${p}" because it does not start with the basename, so the <Router> won't render anything.`),E==null?null:N.createElement(Ci.Provider,{value:h},N.createElement(ic.Provider,{children:n,value:E}))}function aT({children:e,location:n}){return qk($p(e),n)}function $p(e,n=[]){let i=[];return N.Children.forEach(e,(s,o)=>{if(!N.isValidElement(s))return;let f=[...n,o];if(s.type===N.Fragment){i.push.apply(i,$p(s.props.children,f));return}qt(s.type===Ya,`[${typeof s.type=="string"?s.type:s.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),qt(!s.props.index||!s.props.children,"An index route cannot have child routes.");let _={id:s.props.id||f.join("-"),caseSensitive:s.props.caseSensitive,element:s.props.element,Component:s.props.Component,index:s.props.index,path:s.props.path,middleware:s.props.middleware,loader:s.props.loader,action:s.props.action,hydrateFallbackElement:s.props.hydrateFallbackElement,HydrateFallback:s.props.HydrateFallback,errorElement:s.props.errorElement,ErrorBoundary:s.props.ErrorBoundary,hasErrorBoundary:s.props.hasErrorBoundary===!0||s.props.ErrorBoundary!=null||s.props.errorElement!=null,shouldRevalidate:s.props.shouldRevalidate,handle:s.props.handle,lazy:s.props.lazy};s.props.children&&(_.children=$p(s.props.children,f)),i.push(_)}),i}var Pu="get",zu="application/x-www-form-urlencoded";function wh(e){return typeof HTMLElement<"u"&&e instanceof HTMLElement}function oT(e){return wh(e)&&e.tagName.toLowerCase()==="button"}function lT(e){return wh(e)&&e.tagName.toLowerCase()==="form"}function cT(e){return wh(e)&&e.tagName.toLowerCase()==="input"}function uT(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function hT(e,n){return e.button===0&&(!n||n==="_self")&&!uT(e)}var bu=null;function dT(){if(bu===null)try{new FormData(document.createElement("form"),0),bu=!1}catch{bu=!0}return bu}var fT=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Gf(e){return e!=null&&!fT.has(e)?(Zi(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${zu}"`),null):e}function pT(e,n){let i,s,o,f,_;if(lT(e)){let c=e.getAttribute("action");s=c?$r(c,n):null,i=e.getAttribute("method")||Pu,o=Gf(e.getAttribute("enctype"))||zu,f=new FormData(e)}else if(oT(e)||cT(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 h=e.getAttribute("formaction")||c.getAttribute("action");if(s=h?$r(h,n):null,i=e.getAttribute("formmethod")||c.getAttribute("method")||Pu,o=Gf(e.getAttribute("formenctype"))||Gf(c.getAttribute("enctype"))||zu,f=new FormData(c,e),!dT()){let{name:d,type:y,value:p}=e;if(y==="image"){let w=d?`${d}.`:"";f.append(`${w}x`,"0"),f.append(`${w}y`,"0")}else d&&f.append(d,p)}}else{if(wh(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');i=Pu,s=null,o=zu,_=e}return f&&o==="text/plain"&&(_=f,f=void 0),{action:s,method:i.toLowerCase(),encType:o,formData:f,body:_}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function tm(e,n){if(e===!1||e===null||typeof e>"u")throw new Error(n)}function XS(e,n,i,s){let o=typeof e=="string"?new URL(e,typeof window>"u"?"server://singlefetch/":window.location.origin):e;return i?o.pathname.endsWith("/")?o.pathname=`${o.pathname}_.${s}`:o.pathname=`${o.pathname}.${s}`:o.pathname==="/"?o.pathname=`_root.${s}`:n&&$r(o.pathname,n)==="/"?o.pathname=`${nh(n)}/_root.${s}`:o.pathname=`${nh(o.pathname)}.${s}`,o}async function gT(e,n){if(e.id in n)return n[e.id];try{let i=await import(e.module);return n[e.id]=i,i}catch(i){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(i),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function mT(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 _T(e,n,i){let s=await Promise.all(e.map(async o=>{let f=n.routes[o.route.id];if(f){let _=await gT(f,i);return _.links?_.links():[]}return[]}));return ST(s.flat(1).filter(mT).filter(o=>o.rel==="stylesheet"||o.rel==="preload").map(o=>o.rel==="stylesheet"?{...o,rel:"prefetch",as:"style"}:{...o,rel:"prefetch"}))}function Pb(e,n,i,s,o,f){let _=(h,d)=>i[d]?h.route.id!==i[d].route.id:!0,c=(h,d)=>i[d].pathname!==h.pathname||i[d].route.path?.endsWith("*")&&i[d].params["*"]!==h.params["*"];return f==="assets"?n.filter((h,d)=>_(h,d)||c(h,d)):f==="data"?n.filter((h,d)=>{let y=s.routes[h.route.id];if(!y||!y.hasLoader)return!1;if(_(h,d)||c(h,d))return!0;if(h.route.shouldRevalidate){let p=h.route.shouldRevalidate({currentUrl:new URL(o.pathname+o.search+o.hash,window.origin),currentParams:i[0]?.params||{},nextUrl:new URL(e,window.origin),nextParams:h.params,defaultShouldRevalidate:!0});if(typeof p=="boolean")return p}return!0}):[]}function vT(e,n,{includeHydrateFallback:i}={}){return bT(e.map(s=>{let o=n.routes[s.route.id];if(!o)return[];let f=[o.module];return o.clientActionModule&&(f=f.concat(o.clientActionModule)),o.clientLoaderModule&&(f=f.concat(o.clientLoaderModule)),i&&o.hydrateFallbackModule&&(f=f.concat(o.hydrateFallbackModule)),o.imports&&(f=f.concat(o.imports)),f}).flat(1))}function bT(e){return[...new Set(e)]}function yT(e){let n={},i=Object.keys(e).sort();for(let s of i)n[s]=e[s];return n}function ST(e,n){let i=new Set;return new Set(n),e.reduce((s,o)=>{let f=JSON.stringify(yT(o));return i.has(f)||(i.add(f),s.push({key:f,link:o})),s},[])}function nm(){let e=N.useContext(bo);return tm(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function wT(){let e=N.useContext(yh);return tm(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var im=N.createContext(void 0);im.displayName="FrameworkContext";function rm(){let e=N.useContext(im);return tm(e,"You must render this element inside a <HydratedRouter> element"),e}function xT(e,n){let i=N.useContext(im),[s,o]=N.useState(!1),[f,_]=N.useState(!1),{onFocus:c,onBlur:h,onMouseEnter:d,onMouseLeave:y,onTouchStart:p}=n,w=N.useRef(null);N.useEffect(()=>{if(e==="render"&&_(!0),e==="viewport"){let E=v=>{v.forEach(m=>{_(m.isIntersecting)})},g=new IntersectionObserver(E,{threshold:.5});return w.current&&g.observe(w.current),()=>{g.disconnect()}}},[e]),N.useEffect(()=>{if(s){let E=setTimeout(()=>{_(!0)},100);return()=>{clearTimeout(E)}}},[s]);let C=()=>{o(!0)},T=()=>{o(!1),_(!1)};return i?e!=="intent"?[f,w,{}]:[f,w,{onFocus:ml(c,C),onBlur:ml(h,T),onMouseEnter:ml(d,C),onMouseLeave:ml(y,T),onTouchStart:ml(p,C)}]:[!1,w,{}]}function ml(e,n){return i=>{e&&e(i),i.defaultPrevented||n(i)}}function CT({page:e,...n}){let i=Bk(),{router:s}=nm(),o=N.useMemo(()=>jS(s.routes,e,s.basename),[s.routes,e,s.basename]);return o?i?N.createElement(kT,{page:e,matches:o,...n}):N.createElement(TT,{page:e,matches:o,...n}):null}function ET(e){let{manifest:n,routeModules:i}=rm(),[s,o]=N.useState([]);return N.useEffect(()=>{let f=!1;return _T(e,n,i).then(_=>{f||o(_)}),()=>{f=!0}},[e,n,i]),s}function kT({page:e,matches:n,...i}){let s=Ui(),{future:o}=rm(),{basename:f}=nm(),_=N.useMemo(()=>{if(e===s.pathname+s.search+s.hash)return[];let c=XS(e,f,o.v8_trailingSlashAwareDataRequests,"rsc"),h=!1,d=[];for(let y of n)typeof y.route.shouldRevalidate=="function"?h=!0:d.push(y.route.id);return h&&d.length>0&&c.searchParams.set("_routes",d.join(",")),[c.pathname+c.search]},[f,o.v8_trailingSlashAwareDataRequests,e,s,n]);return N.createElement(N.Fragment,null,_.map(c=>N.createElement("link",{key:c,rel:"prefetch",as:"fetch",href:c,...i})))}function TT({page:e,matches:n,...i}){let s=Ui(),{future:o,manifest:f,routeModules:_}=rm(),{basename:c}=nm(),{loaderData:h,matches:d}=wT(),y=N.useMemo(()=>Pb(e,n,d,f,s,"data"),[e,n,d,f,s]),p=N.useMemo(()=>Pb(e,n,d,f,s,"assets"),[e,n,d,f,s]),w=N.useMemo(()=>{if(e===s.pathname+s.search+s.hash)return[];let E=new Set,g=!1;if(n.forEach(m=>{let S=f.routes[m.route.id];!S||!S.hasLoader||(!y.some(k=>k.route.id===m.route.id)&&m.route.id in h&&_[m.route.id]?.shouldRevalidate||S.hasClientLoader?g=!0:E.add(m.route.id))}),E.size===0)return[];let v=XS(e,c,o.v8_trailingSlashAwareDataRequests,"data");return g&&E.size>0&&v.searchParams.set("_routes",n.filter(m=>E.has(m.route.id)).map(m=>m.route.id).join(",")),[v.pathname+v.search]},[c,o.v8_trailingSlashAwareDataRequests,h,s,f,y,n,e,_]),C=N.useMemo(()=>vT(p,f),[p,f]),T=ET(p);return N.createElement(N.Fragment,null,w.map(E=>N.createElement("link",{key:E,rel:"prefetch",as:"fetch",href:E,...i})),C.map(E=>N.createElement("link",{key:E,rel:"modulepreload",href:E,...i})),T.map(({key:E,link:g})=>N.createElement("link",{key:E,nonce:i.nonce,...g,crossOrigin:g.crossOrigin??i.crossOrigin})))}function AT(...e){return n=>{e.forEach(i=>{typeof i=="function"?i(n):i!=null&&(i.current=n)})}}var RT=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{RT&&(window.__reactRouterVersion="7.17.0")}catch{}function LT({basename:e,children:n,useTransitions:i,window:s}){let o=N.useRef();o.current==null&&(o.current=ck({window:s,v5Compat:!0}));let f=o.current,[_,c]=N.useState({action:f.action,location:f.location}),h=N.useCallback(d=>{i===!1?c(d):N.startTransition(()=>c(d))},[i]);return N.useLayoutEffect(()=>f.listen(h),[f,h]),N.createElement(sT,{basename:e,children:n,location:_.location,navigationType:_.action,navigator:f,useTransitions:i})}var ZS=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Gl=N.forwardRef(function({onClick:n,discover:i="render",prefetch:s="none",relative:o,reloadDocument:f,replace:_,mask:c,state:h,target:d,to:y,preventScrollReset:p,viewTransition:w,defaultShouldRevalidate:C,...T},E){let{basename:g,navigator:v,useTransitions:m}=N.useContext(Ci),S=typeof y=="string"&&ZS.test(y),k=HS(y,g);y=k.to;let L=Wk(y,{relative:o}),R=Ui(),M=null;if(c){let X=bh(c,[],R.mask?R.mask.pathname:"/",!0);g!=="/"&&(X.pathname=X.pathname==="/"?g:Xi([g,X.pathname])),M=v.createHref(X)}let[A,B,K]=xT(s,T),F=OT(y,{replace:_,mask:c,state:h,target:d,preventScrollReset:p,relative:o,viewTransition:w,defaultShouldRevalidate:C,useTransitions:m});function W(X){n&&n(X),X.defaultPrevented||F(X)}let I=!(k.isExternal||f),Z=N.createElement("a",{...T,...K,href:(I?M:void 0)||k.absoluteURL||L,onClick:I?W:n,ref:AT(E,B),target:d,"data-discover":!S&&i==="render"?"true":void 0});return A&&!S?N.createElement(N.Fragment,null,Z,N.createElement(CT,{page:L})):Z});Gl.displayName="Link";var Up=N.forwardRef(function({"aria-current":n="page",caseSensitive:i=!1,className:s="",end:o=!1,style:f,to:_,viewTransition:c,children:h,...d},y){let p=rc(_,{relative:d.relative}),w=Ui(),C=N.useContext(yh),{navigator:T,basename:E}=N.useContext(Ci),g=C!=null&&PT(p)&&c===!0,v=T.encodeLocation?T.encodeLocation(p).pathname:p.pathname,m=w.pathname,S=C&&C.navigation&&C.navigation.location?C.navigation.location.pathname:null;i||(m=m.toLowerCase(),S=S?S.toLowerCase():null,v=v.toLowerCase()),S&&E&&(S=$r(S,E)||S);const k=v!=="/"&&v.endsWith("/")?v.length-1:v.length;let L=m===v||!o&&m.startsWith(v)&&m.charAt(k)==="/",R=S!=null&&(S===v||!o&&S.startsWith(v)&&S.charAt(v.length)==="/"),M={isActive:L,isPending:R,isTransitioning:g},A=L?n:void 0,B;typeof s=="function"?B=s(M):B=[s,L?"active":null,R?"pending":null,g?"transitioning":null].filter(Boolean).join(" ");let K=typeof f=="function"?f(M):f;return N.createElement(Gl,{...d,"aria-current":A,className:B,ref:y,style:K,to:_,viewTransition:c},typeof h=="function"?h(M):h)});Up.displayName="NavLink";var MT=N.forwardRef(({discover:e="render",fetcherKey:n,navigate:i,reloadDocument:s,replace:o,state:f,method:_=Pu,action:c,onSubmit:h,relative:d,preventScrollReset:y,viewTransition:p,defaultShouldRevalidate:w,...C},T)=>{let{useTransitions:E}=N.useContext(Ci),g=IT(),v=BT(c,{relative:d}),m=_.toLowerCase()==="get"?"get":"post",S=typeof c=="string"&&ZS.test(c),k=L=>{if(h&&h(L),L.defaultPrevented)return;L.preventDefault();let R=L.nativeEvent.submitter,M=R?.getAttribute("formmethod")||_,A=()=>g(R||L.currentTarget,{fetcherKey:n,method:M,navigate:i,replace:o,state:f,relative:d,preventScrollReset:y,viewTransition:p,defaultShouldRevalidate:w});E&&i!==!1?N.startTransition(()=>A()):A()};return N.createElement("form",{ref:T,method:m,action:v,onSubmit:s?h:k,...C,"data-discover":!S&&e==="render"?"true":void 0})});MT.displayName="Form";function NT(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function JS(e){let n=N.useContext(bo);return qt(n,NT(e)),n}function OT(e,{target:n,replace:i,mask:s,state:o,preventScrollReset:f,relative:_,viewTransition:c,defaultShouldRevalidate:h,useTransitions:d}={}){let y=Sh(),p=Ui(),w=rc(e,{relative:_});return N.useCallback(C=>{if(hT(C,n)){C.preventDefault();let T=i!==void 0?i:Wl(p)===Wl(w),E=()=>y(e,{replace:T,mask:s,state:o,preventScrollReset:f,relative:_,viewTransition:c,defaultShouldRevalidate:h});d?N.startTransition(()=>E()):E()}},[p,y,w,i,s,o,n,e,f,_,c,h,d])}var DT=0,jT=()=>`__${String(++DT)}__`;function IT(){let{router:e}=JS("useSubmit"),{basename:n}=N.useContext(Ci),i=tT(),s=e.fetch,o=e.navigate;return N.useCallback(async(f,_={})=>{let{action:c,method:h,encType:d,formData:y,body:p}=pT(f,n);if(_.navigate===!1){let w=_.fetcherKey||jT();await s(w,i,_.action||c,{defaultShouldRevalidate:_.defaultShouldRevalidate,preventScrollReset:_.preventScrollReset,formData:y,body:p,formMethod:_.method||h,formEncType:_.encType||d,flushSync:_.flushSync})}else await o(_.action||c,{defaultShouldRevalidate:_.defaultShouldRevalidate,preventScrollReset:_.preventScrollReset,formData:y,body:p,formMethod:_.method||h,formEncType:_.encType||d,replace:_.replace,state:_.state,fromRouteId:i,flushSync:_.flushSync,viewTransition:_.viewTransition})},[s,o,n,i])}function BT(e,{relative:n}={}){let{basename:i}=N.useContext(Ci),s=N.useContext(ur);qt(s,"useFormAction must be used inside a RouteContext");let[o]=s.matches.slice(-1),f={...rc(e||".",{relative:n})},_=Ui();if(e==null){f.search=_.search;let c=new URLSearchParams(f.search),h=c.getAll("index");if(h.some(y=>y==="")){c.delete("index"),h.filter(p=>p).forEach(p=>c.append("index",p));let y=c.toString();f.search=y?`?${y}`:""}}return(!e||e===".")&&o.route.index&&(f.search=f.search?f.search.replace(/^\?/,"?index&"):"?index"),i!=="/"&&(f.pathname=f.pathname==="/"?i:Xi([i,f.pathname])),Wl(f)}function PT(e,{relative:n}={}){let i=N.useContext(FS);qt(i!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:s}=JS("useViewTransitionState"),o=rc(e,{relative:n});if(!i.isTransitioning)return!1;let f=$r(i.currentLocation.pathname,s)||i.currentLocation.pathname,_=$r(i.nextLocation.pathname,s)||i.nextLocation.pathname;return th(o.pathname,_)!=null||th(o.pathname,f)!=null}var Es=DS();const zT="fleet-console.canvas.",sm="fleet-console.canvas.backgroundAnimation",am="fleet-console.canvas.perimeterAnimation",QS="fleet-console.canvas.maximized",HT=400,Fp=640,Wp=400,zb=40,Hb=96,$T=.25,UT=1,qf=.2,$b=.5,FT=.001,eo={x:0,y:0,zoom:1},so={viewport:eo,operations:{},operationOrder:[],operationAccent:{},minimized:[],collapsedGroups:[]},Gp=new Set,qp=new Set,Kp=new Set,Vp=new Set,Yp=new Set,ql=new Map;let wi=null,ks=null,Ke=so,ao=vA(),oo=SA(),Pl=CA(),Yn=null,xs=eo,ea=null,ih=0;function om(e){return Gp.add(e),()=>{Gp.delete(e)}}function fo(){return Ke}function Xp(){return Yn}function WT(){return wi}function ew(){return N.useSyncExternalStore(om,fo,fo)}function GT(){return N.useSyncExternalStore(sA,Fb,Fb)}function qT(){return N.useSyncExternalStore(aA,Wb,Wb)}function tw(){return N.useSyncExternalStore(oA,Gb,Gb)}function nw(){return N.useSyncExternalStore(lA,qb,qb)}function iw(){return N.useSyncExternalStore(om,Kb,Kb)}function xi(e){Ke={viewport:e.viewport??Ke.viewport,operations:e.operations??Ke.operations,operationOrder:e.operationOrder??Ke.operationOrder,operationAccent:e.operationAccent??Ke.operationAccent,minimized:e.minimized??Ke.minimized,collapsedGroups:e.collapsedGroups??Ke.collapsedGroups},pA(),sw()}function KT(e){const n=Ke.collapsedGroups.includes(e)?Ke.collapsedGroups.filter(i=>i!==e):[...Ke.collapsedGroups,e];xi({collapsedGroups:n})}function VT(){return N.useSyncExternalStore(om,Vb,Vb)}function Zp(e){cm();const n=um(e);xs=n,xi({viewport:n})}function rw(e){const n=um(e);if(typeof window>"u"||typeof window.requestAnimationFrame!="function"||fA()){Zp(n);return}xs=n,ea===null&&(ea=window.requestAnimationFrame(lw))}function Jp(e,n){const i=sa();xi({operations:{...Ke.operations,[e]:{...hm(n,i),zIndex:i}}})}function YT(e){Ke.minimized.includes(e)||(Yn===e&&po(),xi({minimized:[...Ke.minimized,e]}))}function XT(e){if(!Ke.minimized.includes(e))return;Yn===e&&po();const n=Ke.minimized.filter(o=>o!==e),i=Ke.operations[e];if(!i){xi({minimized:n});return}const s=sa();xi({minimized:n,operations:{...Ke.operations,[e]:{...i,zIndex:s}}})}function Kf(e){xi({operationOrder:hw(e)})}function sa(){return ih+=1,ih}function ZT(e){const n=Ke.operations[e];if(n)return n;const i=Object.keys(Ke.operations).length,s={x:i*zb,y:i*zb,width:Fp,height:Wp,zIndex:sa()};return xi({operations:{...Ke.operations,[e]:s}}),s}function JT(e){const n=new Set(e),i={};let s=!1;for(const[y,p]of Object.entries(Ke.operations))n.has(y)?i[y]=p:s=!0;const o=Ke.minimized.filter(y=>n.has(y)),f=o.length!==Ke.minimized.length,_=Ke.operationOrder.filter(y=>n.has(y)),c=_.length!==Ke.operationOrder.length,h=Object.fromEntries(Object.entries(Ke.operationAccent).filter(([y])=>n.has(y))),d=Object.keys(h).length!==Object.keys(Ke.operationAccent).length;Yn&&(!n.has(Yn)||o.includes(Yn))&&po(),(s||f||c||d)&&xi({operations:i,minimized:o,operationOrder:_,operationAccent:h})}function QT(e){gA(),cm(),uA(),wi=e,Ke=e?_A(e):so;const n=e?ql.get(e)??null:null,i=Yn!==n;Yn=n,xs=Ke.viewport,ih=Math.max(ih,dw(Ke.operations)),sw(),i&&lm()}function Ub(e,n){const i=Ke.operations[e];if(!i)return;const s=Math.max($T,Math.min(UT,Math.min((n.width-Hb)/i.width,(n.height-Hb)/i.height))),o={x:n.width/2-(i.x+i.width/2)*s,y:n.height/2-(i.y+i.height/2)*s,zoom:s};cm(),xs=o;const f=sa(),_=Ke.minimized.includes(e);xi({viewport:o,operations:{...Ke.operations,[e]:{...hm(i,f),zIndex:f}},..._?{minimized:Ke.minimized.filter(c=>c!==e)}:{}})}function eA(){ao=!ao,yA(ao),aw()}function tA(){oo=!oo,xA(oo),ow()}function nA(e){e==="local"&&(ao&&!bA()&&(ao=!1,aw()),oo&&!wA()&&(oo=!1,ow()))}function iA(){rA(!Pl)}function rA(e){Pl!==e&&(Pl=e,EA(Pl),cA())}function zl(e){wi&&ql.set(wi,e);const n=hA(e),i=!dA(Ke.minimized,n),s=Yn!==e;s&&(Yn=e),i&&xi({minimized:n}),s&&lm()}function po(){wi&&ql.delete(wi),Yn!==null&&(Yn=null,lm())}function sA(e){return qp.add(e),()=>{qp.delete(e)}}function Fb(){return ao}function aA(e){return Kp.add(e),()=>{Kp.delete(e)}}function Wb(){return oo}function sw(){for(const e of Gp)e()}function aw(){for(const e of qp)e()}function ow(){for(const e of Kp)e()}function oA(e){return Vp.add(e),()=>{Vp.delete(e)}}function Gb(){return Pl}function lA(e){return Yp.add(e),()=>{Yp.delete(e)}}function qb(){return Yn}function Kb(){return Ke.minimized}function Vb(){return Ke.collapsedGroups}function cA(){for(const e of Vp)e()}function lm(){for(const e of Yp)e()}function uA(){wi&&(Yn?ql.set(wi,Yn):ql.delete(wi))}function hA(e){return Object.keys(Ke.operations).filter(n=>n!==e)}function dA(e,n){return e.length===n.length&&e.every((i,s)=>i===n[s])}function lw(){const e=Ke.viewport,n=xs.x-e.x,i=xs.y-e.y,s=xs.zoom-e.zoom;if(Math.abs(n)<$b&&Math.abs(i)<$b&&Math.abs(s)<FT){ea=null,xi({viewport:xs});return}xi({viewport:{x:e.x+n*qf,y:e.y+i*qf,zoom:e.zoom+s*qf}}),ea=typeof window<"u"?window.requestAnimationFrame(lw):null}function cm(){ea===null||typeof window>"u"||(window.cancelAnimationFrame(ea),ea=null)}function fA(){return typeof window>"u"||typeof window.matchMedia!="function"?!1:window.matchMedia("(prefers-reduced-motion: reduce)").matches}function pA(){!wi||typeof window>"u"||(mA(),ks=window.setTimeout(()=>{ks=null,cw(wi,Ke)},HT))}function gA(){!ks||!wi||typeof window>"u"||(window.clearTimeout(ks),ks=null,cw(wi,Ke))}function mA(){!ks||typeof window>"u"||(window.clearTimeout(ks),ks=null)}function _A(e){if(typeof window>"u")return so;try{const n=window.localStorage.getItem(uw(e));if(!n)return so;const i=JSON.parse(n);return kA(i)}catch{return so}}function cw(e,n){if(!(!e||typeof window>"u"))try{window.localStorage.setItem(uw(e),JSON.stringify(n))}catch{}}function vA(){if(typeof window>"u")return!0;try{const e=window.localStorage.getItem(sm);return e===null?!0:e==="true"}catch{return!0}}function bA(){if(typeof window>"u")return!1;try{return window.localStorage.getItem(sm)!==null}catch{return!1}}function yA(e){if(!(typeof window>"u"))try{window.localStorage.setItem(sm,String(e))}catch{}}function SA(){if(typeof window>"u")return!0;try{const e=window.localStorage.getItem(am);return e===null?!0:e==="true"}catch{return!0}}function wA(){if(typeof window>"u")return!1;try{return window.localStorage.getItem(am)!==null}catch{return!1}}function xA(e){if(!(typeof window>"u"))try{window.localStorage.setItem(am,String(e))}catch{}}function CA(){if(typeof window>"u")return!1;try{return window.localStorage.getItem(QS)==="true"}catch{return!1}}function EA(e){if(!(typeof window>"u"))try{window.localStorage.setItem(QS,String(e))}catch{}}function uw(e){return`${zT}${e}`}function kA(e){if(!go(e))return so;const n=RA(e.operations);return{viewport:um(e.viewport),operations:n,operationOrder:hw(e.operationOrder),operationAccent:TA(e.operationAccent),minimized:AA(e.minimized,n),collapsedGroups:MA(e.collapsedGroups)}}function hw(e){if(!Array.isArray(e))return[];const n=new Set,i=[];for(const s of e)typeof s!="string"||n.has(s)||(n.add(s),i.push(s));return i}function TA(e){if(!go(e))return{};const n={};for(const[i,s]of Object.entries(e))typeof s=="string"&&(n[i]=s);return n}function AA(e,n){if(!Array.isArray(e))return[];const i=new Set,s=[];for(const o of e)typeof o!="string"||i.has(o)||!(o in n)||(i.add(o),s.push(o));return s}function um(e){if(!go(e))return eo;const n=Hl(e.x,eo.x),i=Hl(e.y,eo.y),s=Qp(e.zoom,eo.zoom);return{x:n,y:i,zoom:s}}function RA(e){if(!go(e))return{};const n={};for(const[i,s]of Object.entries(e))go(s)&&(n[i]=hm(s,LA(n)));return n}function hm(e,n){return go(e)?{x:Hl(e.x,0),y:Hl(e.y,0),width:Qp(e.width,Fp),height:Qp(e.height,Wp),zIndex:Hl(e.zIndex,n)}:{x:0,y:0,width:Fp,height:Wp,zIndex:n}}function LA(e){return dw(e)+1}function dw(e){return Math.max(0,...Object.values(e).map(n=>n.zIndex))}function Hl(e,n){return typeof e=="number"&&Number.isFinite(e)?e:n}function Qp(e,n){return typeof e=="number"&&Number.isFinite(e)&&e>0?e:n}function go(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function MA(e){if(!Array.isArray(e))return[];const n=new Set,i=[];for(const s of e)typeof s!="string"||n.has(s)||(n.add(s),i.push(s));return i}const NA=["canonicalCwd","cwd","providerSession","ticket","token","transcriptPath"];class ct extends Error{status;constructor(n,i){super(i),this.name="ApiError",this.status=n}}async function OA(e){const n=await fetch("/api/v1/theaters",{signal:e});await ui(n);const i=await n.json();if(!Array.isArray(i.theaters))throw new ct(n.status,"Invalid Theater response");return{theaters:i.theaters.map(s=>vw(s,n.status))}}async function DA(e,n){const i=e?`?theaterId=${encodeURIComponent(e)}`:"",s=await fetch(`/api/v1/status${i}`,{signal:n});return await ui(s),HA(await s.json(),s.status)}async function fw(e={}){const n=e.force?"?force=true":"",i=await fetch(`/api/v1/updates/release-notes${n}`,{signal:e.signal});return await ui(i),UA(await i.json(),i.status)}async function jA(e){const n=await fetch("/api/v1/updates/apply",{method:"POST",signal:e});return await ui(n),$A(await n.json(),n.status)}async function pw(e,n){const i=await fetch("/api/v1/theaters",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({folderGrantId:e}),signal:n});await ui(i);const s=await i.json();return vw(s,i.status)}async function IA(e,n){const i=await fetch("/api/v1/theaters/folder-listings",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:e}),signal:n});return await ui(i),qA(await i.json(),i.status)}async function gw(e,n){const i=await fetch("/api/v1/theaters/folder-grants",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:e}),signal:n});await ui(i);const s=await i.json();if(typeof s.folderGrantId!="string")throw new ct(i.status,"Invalid folder grant response");return s.folderGrantId}async function BA(e,n){const i=await fetch(`/api/v1/theaters/${encodeURIComponent(e)}`,{method:"DELETE",signal:n});await ui(i)}async function zi(e,n){const i=e?`?theaterId=${encodeURIComponent(e)}`:"",s=await fetch(`/api/v1/operations${i}`,{signal:n});await ui(s);const o=await s.json();if(!Array.isArray(o.operations))throw new ct(s.status,"Invalid operations response");return o.operations.map(f=>_w(f,s.status))}async function Ml(e,n){const s=await fetch("/api/v1/operations/groups",{signal:n});await ui(s);const o=await s.json();if(!Array.isArray(o.groups))throw new ct(s.status,"Invalid groups response");return o.groups.map(f=>dm(f,s.status))}async function PA(e,n){const i=await fetch("/api/v1/operations/groups",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e),signal:n});await ui(i);const s=await i.json();return dm(s.group,i.status)}async function Yb(e,n,i){const s=await fetch(`/api/v1/operations/groups/${encodeURIComponent(e)}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(n),signal:i});await ui(s);const o=await s.json();return dm(o.group,s.status)}async function zA(e,n){const i=await fetch(`/api/v1/operations/groups/${encodeURIComponent(e)}`,{method:"DELETE",signal:n});await ui(i)}async function mw(e,n,i){return Hu(e,{title:n},i)}async function Hu(e,n,i){const s=await fetch(`/api/v1/operations/${encodeURIComponent(e)}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(n),signal:i});await ui(s);const o=await s.json();return _w(o.operation,s.status)}function _w(e,n){const i=e;if(!i||typeof i.id!="string"||typeof i.theaterId!="string"||typeof i.type!="string"||typeof i.pluginId!="string"||typeof i.title!="string"||!i.payload||typeof i.payload!="object"||Array.isArray(i.payload)||!i.ts||typeof i.ts.createdAt!="number"||typeof i.ts.updatedAt!="number"||Kl(i)||Kl(i.payload))throw new ct(n,"Invalid operation response");return{id:i.id,theaterId:i.theaterId,type:i.type,pluginId:i.pluginId,title:i.title,payload:i.payload,geometry:i.geometry??null,accent:typeof i.accent=="string"?i.accent:null,groupId:i.groupId===null?null:typeof i.groupId=="string"?i.groupId:void 0,ts:i.ts}}function dm(e,n){const i=e;if(!i||typeof i.id!="string"||typeof i.theaterId!="string"||typeof i.name!="string"||typeof i.color!="string"||typeof i.order!="number"||typeof i.createdAt!="number")throw new ct(n,"Invalid group response");return{id:i.id,theaterId:i.theaterId,name:i.name,color:i.color,order:i.order,createdAt:i.createdAt}}function vw(e,n){const i=e;if(!i||typeof i.id!="string"||typeof i.label!="string"||typeof i.createdAt!="string"||typeof i.lastOpenedAt!="string"||typeof i.hasWiki!="boolean"||typeof i.activeAdmiralCount!="number"||Kl(i))throw new ct(n,"Invalid Theater response");return i}function HA(e,n){const i=e;if(!i||typeof i.workspaces!="number"||typeof i.version!="string"||i.channel!=="stable"&&i.channel!=="local"&&i.channel!=="unknown"||typeof i.updateAvailable!="boolean"||typeof i.port!="number"||i.portMode!=="dynamic"&&i.portMode!=="static"||i.requestedPort!==null&&typeof i.requestedPort!="number"||typeof i.effectivePort!="number"||typeof i.portHonored!="boolean"||i.wikiServerStatus!=="available"&&i.wikiServerStatus!=="unavailable"&&i.wikiServerStatus!=="unknown")throw new ct(n,"Invalid status response");return{workspaces:i.workspaces,version:i.version,channel:i.channel,updateAvailable:i.updateAvailable,latestVersion:typeof i.latestVersion=="string"?i.latestVersion:void 0,port:i.port,portMode:i.portMode,requestedPort:i.requestedPort,effectivePort:i.effectivePort,portHonored:i.portHonored,wikiServerStatus:i.wikiServerStatus}}function $A(e,n){const i=e;if(!i||i.status!=="accepted")throw new ct(n,"Invalid update response");return{status:"accepted"}}function UA(e,n){const i=e;if(!i||!Array.isArray(i.notes)||i.sourceRef!=="main"||typeof i.fetchedAt!="number"||typeof i.stale!="boolean"||"url"in i||"token"in i||"path"in i)throw new ct(n,"Invalid release notes response");return{notes:i.notes.map(s=>FA(s,n)),sourceRef:"main",fetchedAt:i.fetchedAt,stale:i.stale}}function FA(e,n){const i=e;if(!i||typeof i.version!="string"||i.date!==null&&typeof i.date!="string"||!Array.isArray(i.sections))throw new ct(n,"Invalid release notes response");return{version:i.version,date:i.date,sections:i.sections.map(s=>WA(s,n))}}function WA(e,n){const i=e;if(!i||i.heading!=="Added"&&i.heading!=="Changed"&&i.heading!=="Fixed"&&i.heading!=="Removed"&&i.heading!=="Breaking Changes"||!Array.isArray(i.items))throw new ct(n,"Invalid release notes response");return{heading:i.heading,items:i.items.map(s=>GA(s,n))}}function GA(e,n){const i=e;if(!i||!Array.isArray(i.packageTags)||!i.packageTags.every(s=>typeof s=="string")||typeof i.text!="string")throw new ct(n,"Invalid release notes response");return{packageTags:i.packageTags,text:i.text}}function qA(e,n){const i=e;if(!i||typeof i.path!="string"||i.parentPath!==null&&typeof i.parentPath!="string"||!Array.isArray(i.roots)||!Array.isArray(i.entries)||Kl(i))throw new ct(n,"Invalid folder list response");return{path:i.path,parentPath:i.parentPath??null,roots:i.roots.filter(s=>typeof s=="string"),entries:i.entries.map(s=>KA(s,n)),truncated:i.truncated===!0?!0:void 0}}function KA(e,n){const i=e;if(!i||typeof i.name!="string"||typeof i.path!="string"||i.kind!=="dir"||typeof i.accessible!="boolean"||Kl(i))throw new ct(n,"Invalid folder entry response");return{name:i.name,path:i.path,kind:"dir",accessible:i.accessible}}function Kl(e){if(!e||typeof e!="object")return!1;const n=e;return NA.some(i=>i in n)}async function ui(e){if(e.ok)return;let n=`${e.status} ${e.statusText}`;try{const i=await e.json();typeof i.error=="string"?n=i.error:typeof i.message=="string"&&(n=i.message)}catch{}throw new ct(e.status,n)}const VA="__unassigned__";function YA(e){const n=new Map(e.theaters.map(s=>[s.id,s])),i=[];for(const s of e.operations)s.theaterId&&i.push(JA(s,n.get(s.theaterId)));return i}function XA(e,n){const i=bw(n);return i.length===0?e:e.filter(s=>{const o=QA(s);return i.every(f=>o.includes(f))})}function ZA(e){const n=[],i=new Map;for(const s of e){const o=s.theaterId??VA,f=i.get(o);if(f!==void 0){const _=n[f];_&&(n[f]={..._,entries:[..._.entries,s]});continue}i.set(o,n.length),n.push({theaterId:s.theaterId,theaterLabel:s.theaterLabel,entries:[s]})}return n}function bw(e){return e.trim().toLocaleLowerCase().split(/\s+/).filter(Boolean)}function JA(e,n){return{operationId:e.id,theaterId:e.theaterId,theaterLabel:n?.label??e.theaterId,operationName:e.title,pluginId:e.pluginId,status:"operation"}}function QA(e){return[e.operationName,e.theaterLabel,e.pluginId].join(" ").toLocaleLowerCase()}const eg="fleet-console.activeTheaterId",yw="fleet-console.commissioningSeen",Sw="fleet-console.whatsNewSeenVersion",ww="fleet-console.notificationPreferences",xw=1,eR="maritime",yu={globalMute:!1,dnd:!1,mutedTheaterIds:{}},tg=new Set;let Xb=0,ng=null,He={connection:"connecting",connectionError:null,activeTheme:eR,version:"",updateAvailable:!1,latestVersion:null,portMode:"dynamic",requestedPort:null,effectivePort:0,portHonored:!0,theaters:[],operations:[],operationsHydrated:!1,groups:[],activeTheaterId:null,activeOperationId:null,operationStatus:{},addingTheater:!1,theaterError:null,operationsViewActive:!1,operationSearchOpen:!1,whatsNewOpen:!1,releaseNotes:[],releaseNotesLoading:!1,releaseNotesError:null,releaseNotesSourceRef:null,releaseNotesFetchedAt:null,releaseNotesStale:!1,automaticWhatsNewVersion:null,selectedReleaseNoteKey:null,onboardingOpen:!1,bootstrapped:!1,pendingOperationFocus:null,operationNotifications:{},notificationPreferences:ER(),codexReader:null,codexReaderExpanded:!1};function ig(){return He}function tR(e){return tg.add(e),()=>{tg.delete(e)}}function tt(e){He={...He,...e},SR()}function nR(e){He.operationsViewActive!==e&&tt({operationsViewActive:e})}function Cw(e){rR(e),tt({activeTheme:e})}function iR(e){nA(e.channel),tt({version:e.version,updateAvailable:e.updateAvailable,latestVersion:e.latestVersion??null,portMode:e.portMode,requestedPort:e.requestedPort,effectivePort:e.effectivePort,portHonored:e.portHonored,...Dw({...He,version:e.version})})}function Ew(){tt({releaseNotesLoading:!0,releaseNotesError:null})}function kw(e){const n={...He,releaseNotes:e.notes,releaseNotesLoading:!1,releaseNotesError:null,releaseNotesSourceRef:e.sourceRef,releaseNotesFetchedAt:e.fetchedAt,releaseNotesStale:e.stale,selectedReleaseNoteKey:He.selectedReleaseNoteKey&&Iw(e.notes,He.selectedReleaseNoteKey)?He.selectedReleaseNoteKey:jw(e.notes)};tt({releaseNotes:n.releaseNotes,releaseNotesLoading:n.releaseNotesLoading,releaseNotesError:n.releaseNotesError,releaseNotesSourceRef:n.releaseNotesSourceRef,releaseNotesFetchedAt:n.releaseNotesFetchedAt,releaseNotesStale:n.releaseNotesStale,...Dw(n)})}function Tw(e){tt({releaseNotesLoading:!1,releaseNotesError:e})}function rR(e){if(!(typeof document>"u")){if(e==="maritime"){document.documentElement.removeAttribute("data-theme");return}document.documentElement.setAttribute("data-theme",e)}}function sR(e){const n=Ow(e,He.activeTheaterId);tt({theaters:e,activeTheaterId:n})}function aR(e){sR(e.theaters)}function Hi(e){tt({operations:e,operationsHydrated:!0})}function Nl(e){tt({groups:e})}function oR(e){Ch(e),tt({activeTheaterId:e})}function or(e){He.activeOperationId!==e&&tt({activeOperationId:e})}function lR(e,n){if(n==="idle"){Aw(e);return}He.operationStatus[e]!==n&&tt({operationStatus:{...He.operationStatus,[e]:n}})}function Aw(e){if(!(e in He.operationStatus))return;const n={...He.operationStatus};delete n[e],tt({operationStatus:n})}function cR(e){if(!e.operationId)return;const n=He.operations.find(h=>h.id===e.operationId);if(!n)return;const i=n.theaterId??null,s=He.theaters.find(h=>h.id===i)?.label??i??"Unknown",o=n.title,f=xR(e.kind);Xb+=1;const _=He.operationNotifications[e.operationId],c=_?_.count+1:1;tt({operationNotifications:{...He.operationNotifications,[e.operationId]:{kind:f,operationId:e.operationId,theaterId:i,theaterLabel:s,operationLabel:o,count:c,lastRaisedSeq:Xb}}})}function Rw(){tt({addingTheater:!0,theaterError:null})}function Lw(e){const n=[e,...He.theaters.filter(i=>i.id!==e.id)];Ch(e.id),tt({theaters:n,activeTheaterId:e.id,addingTheater:!1,theaterError:null})}function uR(){tt({addingTheater:!1,theaterError:null})}function rg(e){tt({addingTheater:!1,theaterError:e})}function xh(e){const n=He.operations.find(i=>i.id===e);n&&(Ch(n.theaterId),tt({activeTheaterId:n.theaterId,activeOperationId:e,pendingOperationFocus:e,operationNotifications:Nw(He.operationNotifications,e)}),window.dispatchEvent(new CustomEvent("fleet-console:focus-operation",{detail:{operationId:e}})))}function Zb(){He.pendingOperationFocus!==null&&tt({pendingOperationFocus:null})}function hR(e,n,i){if(e.length===0)return null;const s=n?e.indexOf(n):-1,o=s===-1?i>0?0:e.length-1:(s+i+e.length)%e.length;return e[o]??null}function Mw(e,n){if(n.length===0)return[...e].sort(sg);const i=new Map(n.map((s,o)=>[s,o]));return[...e].sort((s,o)=>{const f=i.get(s.id),_=i.get(o.id);return f!==void 0&&_!==void 0?f-_:f!==void 0?-1:_!==void 0?1:sg(s,o)})}function dR(e,n,i,s=[]){const o=Mw(e,i),f=new Set(s),_=[...n].sort((h,d)=>h.order-d.order||h.createdAt-d.createdAt),c=new Map;for(const h of _)c.set(h.id,[]);c.set(null,[]);for(const h of o){const d=h.groupId??null;d!==null&&c.has(d)?c.get(d).push(h):c.get(null).push(h)}return[..._.filter(h=>!f.has(h.id)).flatMap(h=>c.get(h.id)??[]),...c.get(null)??[]]}function sg(e,n){return e.ts.createdAt-n.ts.createdAt||e.id.localeCompare(n.id)}function Vf(){tt({operationSearchOpen:!1})}function fR(){tt({operationSearchOpen:!He.operationSearchOpen})}function pR(){He.releaseNotes.length===0||He.whatsNewOpen||tt({whatsNewOpen:!0,selectedReleaseNoteKey:He.selectedReleaseNoteKey??jw(He.releaseNotes)})}function Su(){He.whatsNewOpen&&(He.automaticWhatsNewVersion&&RR(He.automaticWhatsNewVersion),tt({whatsNewOpen:!1,automaticWhatsNewVersion:null}))}function Jb(e){Iw(He.releaseNotes,e)&&tt({selectedReleaseNoteKey:e})}function _l(){TR(!0),He.onboardingOpen&&tt({onboardingOpen:!1})}function Br(e){tt({codexReader:e,codexReaderExpanded:!1})}function $u(){He.codexReader!==null&&tt({codexReaderExpanded:!0})}function gR(){tt({codexReaderExpanded:!1})}function Qb(){tt({codexReader:null,codexReaderExpanded:!1})}function e1(){if(He.bootstrapped)return;const e=He.theaters.length===0&&!kR();tt({bootstrapped:!0,onboardingOpen:e?!0:He.onboardingOpen})}function t1(e){const n=He.theaters.filter(_=>_.id!==e),i=Ow(n,He.activeTheaterId===e?null:He.activeTheaterId),s=wR(He.operationNotifications,e),o=new Set(He.operations.filter(_=>_.theaterId===e).map(_=>_.id)),f=He.activeOperationId&&o.has(He.activeOperationId)?null:He.activeOperationId;Ch(i),tt({theaters:n,activeTheaterId:i,activeOperationId:f,operationNotifications:s})}function mR(e){const n=Nw(He.operationNotifications,e);n!==He.operationNotifications&&tt({operationNotifications:n})}function _R(e){const n={...He.notificationPreferences,globalMute:e};pm(n),tt({notificationPreferences:n})}function vR(e){const n={...He.notificationPreferences,dnd:e};pm(n),tt({notificationPreferences:n})}function bR(e){const n={...He.notificationPreferences.mutedTheaterIds};n[e]?delete n[e]:n[e]=!0;const i={...He.notificationPreferences,mutedTheaterIds:n};pm(i),tt({notificationPreferences:i})}function yR(e){return YA(e)}function SR(){for(const e of tg)e()}function Nw(e,n){if(!e[n])return e;const i={...e};return delete i[n],i}function wR(e,n){let i=!1;const s={};for(const[o,f]of Object.entries(e)){if(f.theaterId===n){i=!0;continue}s[o]=f}return i?s:e}function Ow(e,n){const i=new Set(e.map(o=>o.id)),s=CR();return s&&i.has(s)?s:n&&i.has(n)?n:e[0]?.id??null}function xR(e){const n=e.toLowerCase();return n==="ended"||n.includes(".end")||n.includes("done")?"ended":"input-waiting"}function Dw(e){const n=e.releaseNotes.findIndex(s=>s.version!=="Unreleased"),i=n>=0?e.releaseNotes[n]:void 0;return!i||!e.version||i.version!==e.version||AR()===i.version?{whatsNewOpen:e.whatsNewOpen,automaticWhatsNewVersion:e.automaticWhatsNewVersion,selectedReleaseNoteKey:e.selectedReleaseNoteKey}:{whatsNewOpen:!0,automaticWhatsNewVersion:i.version,selectedReleaseNoteKey:fm(i.version,n)}}function jw(e){return e[0]?fm(e[0].version,0):null}function Iw(e,n){return e.some((i,s)=>fm(i.version,s)===n)}function fm(e,n){return`${e}:${n}`}function CR(){if(typeof window>"u")return null;try{return window.localStorage.getItem(eg)}catch{return null}}function Ch(e){if(!(typeof window>"u"))try{e?window.localStorage.setItem(eg,e):window.localStorage.removeItem(eg)}catch{}}function ER(){if(typeof window>"u")return yu;try{const e=window.localStorage.getItem(ww);if(!e)return yu;const n=JSON.parse(e);return LR(n)?{globalMute:n.preferences.globalMute,dnd:n.preferences.dnd,mutedTheaterIds:n.preferences.mutedTheaterIds}:yu}catch{return yu}}function kR(){if(typeof window>"u")return!1;try{return window.localStorage.getItem(yw)==="1"}catch{return!1}}function TR(e){if(!(typeof window>"u"))try{e&&window.localStorage.setItem(yw,"1")}catch{}}function AR(){if(ng!==null)return ng;if(typeof window>"u")return null;try{return window.localStorage.getItem(Sw)}catch{return null}}function RR(e){if(ng=e,!(typeof window>"u"))try{window.localStorage.setItem(Sw,e)}catch{}}function pm(e){if(!(typeof window>"u"))try{window.localStorage.setItem(ww,JSON.stringify({version:xw,preferences:e}))}catch{}}function LR(e){if(!e||typeof e!="object")return!1;const n=e;if(n.version!==xw||!n.preferences||typeof n.preferences!="object")return!1;const i=n.preferences;return typeof i.globalMute=="boolean"&&typeof i.dnd=="boolean"&&!!i.mutedTheaterIds&&typeof i.mutedTheaterIds=="object"}const wu="directory-browser-sectors";function Bw({open:e,onCancel:n,onConfirm:i}){const[s,o]=N.useState(null),[f,_]=N.useState(null),[c,h]=N.useState(null),[d,y]=N.useState(""),[p,w]=N.useState(""),[C,T]=N.useState(0),E=N.useRef(null),g=N.useRef(null),v=async(X,z)=>{_(X),h(null),y(""),T(0);try{const q=await IA(X,z);o(q)}catch(q){if(q instanceof DOMException&&q.name==="AbortError")return;h(q instanceof ct?q.message:String(q))}finally{_(null)}};N.useEffect(()=>{if(!e)return;const X=new AbortController;return v(null,X.signal),()=>X.abort()},[e]),N.useEffect(()=>{e&&E.current?.focus()},[e,s?.path]);const m=s?.entries??[],S=N.useMemo(()=>{const X=d.trim().toLowerCase();return X===""?m:m.filter(z=>z.name.toLowerCase().includes(X))},[m,d]),k=N.useMemo(()=>s?MR(s):[],[s]),L=s?n1(s.path):null,R=s?.roots??[],M=R.length>1,A=S.length===0?-1:Math.min(C,S.length-1);if(N.useEffect(()=>{if(A<0)return;g.current?.querySelector(`[data-index="${A}"]`)?.scrollIntoView({block:"nearest"})},[A,s?.path]),!e)return null;const B=X=>{X.accessible&&f===null&&v(X.path)},K=()=>{s?.parentPath!=null&&f===null&&v(s.parentPath)},F=()=>{const X=p.trim();X!==""&&f===null&&v(X)},W=s?.path??null,I=A>=0?`${wu}-${A}`:void 0,Z=X=>{switch(X.key){case"Escape":d!==""?y(""):n();return;case"ArrowDown":X.preventDefault(),T(z=>Math.min(z+1,Math.max(S.length-1,0)));return;case"ArrowUp":X.preventDefault(),T(z=>Math.max(z-1,0));return;case"Enter":{X.preventDefault();const z=S[A];z&&B(z);return}case"Backspace":d===""&&(X.preventDefault(),K());return;default:return}};return Es.createPortal(u.jsxs("div",{className:"directory-browser-overlay",role:"presentation",children:[u.jsx("button",{type:"button",className:"directory-browser-scrim","aria-label":"Close",onClick:n}),u.jsxs("section",{className:"directory-browser-card",role:"dialog","aria-modal":"true","aria-label":"Establish Theater of Operations",onKeyDown:Z,children:[u.jsxs("header",{className:"directory-browser-header",children:[u.jsx("span",{className:"directory-browser-sigil","aria-hidden":"true",children:u.jsx(DR,{})}),u.jsxs("div",{className:"directory-browser-heading",children:[u.jsx("span",{className:"directory-browser-kicker",children:"Theater of Operations"}),u.jsx("h2",{children:"Establish Theater"})]}),u.jsx("button",{type:"button",className:"directory-browser-close",onClick:n,"aria-label":"Close",children:"×"})]}),M?u.jsxs("div",{className:"directory-browser-roots",role:"group","aria-label":"Drives",children:[u.jsx("span",{className:"directory-browser-kicker",children:"Stations"}),u.jsx("div",{className:"directory-browser-root-chips",children:R.map(X=>{const z=L!=null&&n1(X)===L;return u.jsx("button",{type:"button",className:`directory-browser-root-chip ${z?"is-active":""}`,"aria-current":z?"location":void 0,disabled:f!==null,title:X,onClick:()=>{f===null&&v(X)},onKeyDown:q=>q.stopPropagation(),children:OR(X)},X)})})]}):null,u.jsx("nav",{className:"directory-browser-course","aria-label":"Path",children:k.map((X,z)=>{const q=z===k.length-1;return u.jsxs("span",{className:"directory-browser-course-seg",children:[z>0?u.jsx("span",{className:"directory-browser-course-sep","aria-hidden":"true",children:"›"}):null,u.jsx("button",{type:"button",className:`directory-browser-crumb ${q?"is-current":""}`,"aria-current":q?"location":void 0,disabled:q||f!==null,title:X.path,onClick:()=>{v(X.path)},children:X.label})]},X.path)})}),u.jsxs("div",{className:"directory-browser-toolbar",children:[u.jsxs("div",{className:"directory-browser-filter",children:[u.jsx("span",{className:"directory-browser-filter-glyph","aria-hidden":"true",children:u.jsx(IR,{})}),u.jsx("input",{ref:E,type:"text",className:"directory-browser-filter-input",placeholder:"Filter sectors…","aria-label":"Filter folders","aria-controls":wu,value:d,spellCheck:!1,autoComplete:"off",onChange:X=>{y(X.target.value),T(0)}})]}),u.jsxs("button",{type:"button",className:"directory-browser-up",disabled:s?.parentPath==null||f!==null,title:"Up one sector (Backspace)",onClick:K,children:[u.jsx(BR,{}),u.jsx("span",{children:"Up"})]})]}),u.jsxs("div",{className:"directory-browser-jump",children:[u.jsx("input",{type:"text",className:"directory-browser-jump-input",placeholder:"Or jump to a path — e.g. D:\\\\projects","aria-label":"Jump to absolute path",value:p,spellCheck:!1,autoComplete:"off",onChange:X=>w(X.target.value),onKeyDown:X=>{X.stopPropagation(),X.key==="Enter"&&(X.preventDefault(),F())}}),u.jsx("button",{type:"button",className:"directory-browser-jump-button",disabled:p.trim()===""||f!==null,onClick:F,onKeyDown:X=>X.stopPropagation(),children:"Go"})]}),c?u.jsx("p",{className:"directory-browser-error",role:"alert",children:c}):null,u.jsx("div",{className:"directory-browser-list",id:wu,role:"listbox","aria-label":"Folders","aria-busy":f!==null,"aria-activedescendant":I,ref:g,children:f!==null?u.jsxs("p",{className:"directory-browser-state is-live",children:[u.jsx("span",{className:"directory-browser-scan-dot","aria-hidden":"true"}),"Scouting…"]}):S.length===0?u.jsx("p",{className:"directory-browser-state",children:d!==""?"No sectors match the filter.":"No sectors to advance into."}):S.map((X,z)=>u.jsxs("div",{id:`${wu}-${z}`,"data-index":z,role:"option","aria-selected":z===A,"aria-disabled":!X.accessible,className:`directory-browser-sector ${z===A?"is-active":""} ${X.accessible?"":"is-locked"}`,title:X.path,onClick:()=>{T(z),B(X)},children:[u.jsx("span",{className:"directory-browser-sector-glyph","aria-hidden":"true",children:u.jsx(jR,{})}),u.jsx("span",{className:"directory-browser-sector-name",children:X.name}),X.accessible?u.jsx("span",{className:"directory-browser-sector-advance","aria-hidden":"true",children:"›"}):u.jsxs("span",{className:"directory-browser-sector-lock",children:[u.jsx(PR,{})," Locked"]})]},X.path))}),s?.truncated?u.jsx("p",{className:"directory-browser-note",children:"Charting first 500 sectors only."}):null,u.jsxs("footer",{className:"directory-browser-actions",children:[u.jsxs("div",{className:"directory-browser-target",children:[u.jsx("span",{className:"directory-browser-target-label",children:"Theater Root"}),u.jsx("span",{className:"directory-browser-target-path",title:W??"",children:W??"Scouting…"})]}),u.jsxs("div",{className:"directory-browser-buttons",children:[u.jsx("button",{type:"button",className:"directory-browser-button",onClick:n,children:"Cancel"}),u.jsx("button",{type:"button",className:"directory-browser-button is-primary",disabled:W===null||f!==null,onClick:()=>W&&i(W),children:"Establish Theater"})]})]})]})]}),document.body)}function MR(e){if(NR(e)==="/"){const _=[{label:"/",path:"/"}];let c="";for(const h of e.path.split("/").filter(Boolean))c+=`/${h}`,_.push({label:h,path:c});return _}const i=/^([A-Za-z]:)\\?/.exec(e.path),s=i?`${i[1]}\\`:e.roots[0]??"C:\\",o=[{label:s,path:s}];let f=s.replace(/\\$/,"");for(const _ of e.path.slice(s.length).split("\\").filter(Boolean))f+=`\\${_}`,o.push({label:_,path:f});return o}function NR(e){return e.roots.some(n=>/^[A-Za-z]:\\$/.test(n))||/^[A-Za-z]:\\/.test(e.path)?"\\":"/"}function n1(e){return/^([A-Za-z]:)\\?/.exec(e)?.[1]?.toLowerCase()??null}function OR(e){return e.replace(/[\\/]+$/,"")||e}function DR(){return u.jsxs("svg",{viewBox:"0 0 20 20","aria-hidden":"true",children:[u.jsx("circle",{cx:"10",cy:"10",r:"6.6",fill:"none",stroke:"currentColor",strokeWidth:"1.2"}),u.jsx("circle",{cx:"10",cy:"10",r:"2.1",fill:"currentColor"}),u.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 jR(){return u.jsx("svg",{viewBox:"0 0 18 18","aria-hidden":"true",children:u.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 IR(){return u.jsxs("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:[u.jsx("circle",{cx:"7",cy:"7",r:"4.2",fill:"none",stroke:"currentColor",strokeWidth:"1.3"}),u.jsx("path",{d:"M10.2 10.2 13.5 13.5",fill:"none",stroke:"currentColor",strokeWidth:"1.3",strokeLinecap:"round"})]})}function BR(){return u.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:u.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 PR(){return u.jsxs("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:[u.jsx("rect",{x:"3.6",y:"7",width:"8.8",height:"6.2",rx:"1.4",fill:"none",stroke:"currentColor",strokeWidth:"1.2"}),u.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 zR=["a[href]","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])","[tabindex]:not([tabindex='-1'])"].join(",");function HR({state:e}){const[n,i]=N.useState(!1),s=N.useRef(null),o=N.useRef(null),f=N.useRef(null),_=e.theaters.length>0;if(N.useEffect(()=>{if(e.onboardingOpen)return s.current=document.activeElement,o.current?.focus(),()=>{const y=s.current;s.current=null,y?.focus?.()}},[e.onboardingOpen]),N.useEffect(()=>{if(!e.onboardingOpen)return;const y=p=>{n||(p.key==="Escape"?(p.preventDefault(),_l()):p.key==="Tab"&&$R(p,f.current),p.stopImmediatePropagation())};return window.addEventListener("keydown",y,!0),()=>window.removeEventListener("keydown",y,!0)},[n,e.onboardingOpen]),!e.onboardingOpen)return null;const c=()=>{i(!0)},h=()=>{i(!1)},d=async y=>{i(!1),Rw();try{const p=await gw(y),w=await pw(p);Lw(w)}catch(p){rg(p instanceof Error?p.message:String(p))}};return u.jsxs("div",{className:"commissioning-overlay",role:"dialog","aria-modal":"true","aria-labelledby":"commissioning-title",children:[u.jsx("button",{type:"button",className:"commissioning-scrim",onClick:_l,"aria-label":"Close Commissioning guide"}),u.jsxs("section",{className:"commissioning-card",ref:f,children:[u.jsxs("header",{className:"commissioning-header",children:[u.jsx("span",{className:"commissioning-eyebrow",children:"COMMISSIONING · FLEET CONSOLE"}),u.jsx("h2",{id:"commissioning-title",children:"Bring your fleet online"}),u.jsx("p",{children:"Three steps to go from an empty bridge to live carrier operations."})]}),u.jsxs("ol",{className:"commissioning-steps",children:[u.jsxs("li",{className:`commissioning-step commissioning-step--primary ${_?"is-complete":"is-current"}`,children:[u.jsx("span",{className:"commissioning-step-node","aria-hidden":"true",children:_?"✓":"01"}),u.jsxs("div",{className:"commissioning-step-body",children:[u.jsx("h3",{children:"Register a Theater"}),u.jsx("p",{children:"A Theater is a project directory the fleet operates in. Choose the folder you want to work from."}),_?u.jsx(Gl,{ref:y=>{o.current=y},className:"commissioning-primary-action",to:"/operations",onClick:_l,children:"Go to Operations →"}):u.jsx("button",{ref:y=>{o.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?u.jsx("p",{className:"commissioning-error",role:"alert",children:e.theaterError}):null]})]}),u.jsxs("li",{className:"commissioning-step",children:[u.jsx("span",{className:"commissioning-step-node","aria-hidden":"true",children:"02"}),u.jsxs("div",{className:"commissioning-step-body",children:[u.jsx("h3",{children:"Open an Operation"}),u.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."}),u.jsx(Gl,{className:"commissioning-secondary-link",to:"/operations",onClick:_l,children:"Go to Operations"})]})]}),u.jsxs("li",{className:"commissioning-step",children:[u.jsx("span",{className:"commissioning-step-node","aria-hidden":"true",children:"03"}),u.jsxs("div",{className:"commissioning-step-body",children:[u.jsx("h3",{children:"Observe carriers"}),u.jsx("p",{children:"Carriers are specialist agents your Admiral dispatches. Their sorties stream here in real time as they run."})]})]})]}),u.jsxs("footer",{className:"commissioning-footer",children:[u.jsx("p",{children:"Theaters with a Fleet Wiki knowledge root also unlock Codex — your decision log and reference library."}),u.jsx("button",{type:"button",className:"commissioning-skip",onClick:_l,children:"Skip for now"})]})]}),u.jsx(Bw,{open:n,onCancel:h,onConfirm:d})]})}function $R(e,n){if(!n)return;const i=Array.from(n.querySelectorAll(zR)),s=i[0],o=i[i.length-1];!s||!o||(e.shiftKey&&document.activeElement===s?(e.preventDefault(),o.focus()):!e.shiftKey&&document.activeElement===o&&(e.preventDefault(),s.focus()))}const UR="a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex='-1'])",i1="operation-search-listbox",Pw="__unassigned__";function FR({state:e}){const n=Sh(),[i,s]=N.useState(""),[o,f]=N.useState(0),_=N.useRef(null),c=N.useRef(null),h=N.useRef(null),d=N.useRef(new Map),y=N.useMemo(()=>yR(e),[e]),p=N.useMemo(()=>XA(y,i),[y,i]),w=N.useMemo(()=>ZA(p),[p]),C=N.useMemo(()=>bw(i),[i]),T=r1(o,p.length),E=p[T]?s1(p[T].operationId):void 0;if(N.useEffect(()=>{if(!e.operationSearchOpen)return;h.current=document.activeElement instanceof HTMLElement?document.activeElement:null;const m=document.body.style.overflow;return document.body.style.overflow="hidden",window.setTimeout(()=>_.current?.focus(),0),()=>{document.body.style.overflow=m,h.current?.focus()}},[e.operationSearchOpen]),N.useEffect(()=>{if(!e.operationSearchOpen){s(""),f(0);return}f(0)},[e.operationSearchOpen,i]),N.useEffect(()=>{if(!e.operationSearchOpen)return;const m=p[T];m&&d.current.get(m.operationId)?.scrollIntoView({block:"nearest"})},[T,p,e.operationSearchOpen]),!e.operationSearchOpen)return null;const g=m=>{xh(m),n("/operations"),Vf()},v=m=>{if(m.key==="Escape"){m.preventDefault(),Vf();return}if(m.key==="ArrowDown"||m.key==="ArrowUp"){m.preventDefault(),f(S=>r1(S+(m.key==="ArrowDown"?1:-1),p.length));return}if(m.key==="Enter"){const S=p[T];if(!S)return;m.preventDefault(),g(S.operationId);return}m.key==="Tab"&&KR(m,c.current)};return u.jsx("div",{className:"operation-search-overlay",onMouseDown:m=>{m.target===m.currentTarget&&Vf()},children:u.jsxs("section",{ref:c,className:"operation-search-card",role:"dialog","aria-modal":"true","aria-label":"Operation quick search",tabIndex:-1,onKeyDown:v,children:[u.jsxs("div",{className:"operation-search-field",children:[u.jsx(VR,{}),u.jsx("input",{ref:_,id:"operation-search-input",type:"search",value:i,onChange:m=>s(m.target.value),placeholder:"Search Operations across Theaters",autoComplete:"off",role:"combobox","aria-expanded":!0,"aria-controls":i1,"aria-activedescendant":E,"aria-autocomplete":"list",spellCheck:!1}),u.jsx("kbd",{children:"esc"})]}),u.jsx("div",{id:i1,className:"operation-search-results",role:"listbox","aria-label":"Operation results",children:w.length>0?w.map(m=>{const S=GR(m.theaterId);return u.jsxs("section",{className:"operation-search-section",role:"group","aria-labelledby":S,children:[u.jsx("h2",{id:S,className:"operation-search-section-heading",children:Yf(m.theaterLabel,C)}),m.entries.map(k=>{const L=p.indexOf(k),R=L===T;return u.jsxs("button",{id:s1(k.operationId),ref:M=>{M?d.current.set(k.operationId,M):d.current.delete(k.operationId)},type:"button",className:`operation-search-result ${R?"is-active":""}`,role:"option","aria-selected":R,onMouseEnter:()=>f(L),onClick:()=>g(k.operationId),children:[u.jsxs("span",{className:"operation-search-result-text",children:[u.jsx("strong",{children:Yf(k.operationName,C)}),u.jsx("small",{children:WR(k)})]}),u.jsx("span",{className:"operation-search-theater",children:Yf(k.theaterLabel,C)})]},k.operationId)})]},m.theaterId??Pw)}):u.jsx("p",{className:"operation-search-empty",children:"No matching Operations."})})]})})}function r1(e,n){return n<=0?0:Math.max(0,Math.min(e,n-1))}function WR(e){return[e.pluginId,e.status].filter(Boolean).join(" · ")}function GR(e){return`operation-search-heading-${zw(e??Pw)}`}function s1(e){return`operation-search-option-${zw(e)}`}function zw(e){return e.replace(/[^a-zA-Z0-9_-]/g,"-")}function Yf(e,n){if(n.length===0)return e;const i=[];let s=0;for(;s<e.length;){const o=qR(e,n,s);if(!o){i.push(e.slice(s));break}o.start>s&&i.push(e.slice(s,o.start)),i.push(u.jsx("mark",{children:e.slice(o.start,o.end)},`${o.start}-${o.end}`)),s=o.end}return i}function qR(e,n,i){const s=e.toLocaleLowerCase();let o=null;for(const f of n){const _=s.indexOf(f,i);_!==-1&&(!o||_<o.start)&&(o={start:_,end:_+f.length})}return o}function KR(e,n){if(!n)return;const i=Array.from(n.querySelectorAll(UR)).filter(f=>f.offsetParent!==null);if(i.length===0)return;const s=i[0],o=i[i.length-1];if(e.shiftKey&&document.activeElement===s){e.preventDefault(),o?.focus();return}!e.shiftKey&&document.activeElement===o&&(e.preventDefault(),s?.focus())}function VR(){return u.jsx("svg",{viewBox:"0 0 20 20","aria-hidden":"true",children:u.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 YR({open:e,title:n,message:i,tone:s="info",onDismiss:o}){return e?u.jsx("div",{className:"app-toast-host",children:u.jsxs("div",{className:`app-toast app-toast--${s}`,role:"status","aria-live":"polite",children:[u.jsx("span",{className:"app-toast-dot","aria-hidden":"true"}),u.jsxs("div",{className:"app-toast-body",children:[u.jsx("p",{className:"app-toast-title",children:n}),i?u.jsx("p",{className:"app-toast-message",children:i}):null]}),o?u.jsx("button",{type:"button",className:"app-toast-close",onClick:o,"aria-label":"Dismiss notification",children:"×"}):null]})}):null}function XR({state:e}){if(e.releaseNotesLoading||e.releaseNotes.length===0||e.releaseNotesError&&!e.releaseNotesStale)return null;const n=e.releaseNotes.find(s=>s.version===e.version),i=n&&e.version?` v${n.version}`:"";return u.jsx("button",{type:"button",className:"topbar-whatsnew-button",onMouseDown:s=>s.preventDefault(),onClick:pR,"aria-label":`What's new${i}`,title:`What's new${i}`,children:u.jsx("span",{children:"What's new"})})}const ZR=1400,JR="https://github.com/sbluemin/fleet-harness",QR="https://github.com/sbluemin/fleet-harness/stargazers",e3="https://api.github.com/repos/sbluemin/fleet-harness",gm="fleet-console.github-stars",t3=360*60*1e3;function n3({state:e}){const n=e.connectionError!==null,i=Ui().pathname,s=i.startsWith("/carrier-settings")?u.jsx(o1,{}):i.startsWith("/settings")?u.jsx(a1,{}):i.startsWith("/operations")?u.jsx(b3,{}):u.jsx(v3,{});return u.jsxs("header",{className:"topbar",children:[u.jsxs("div",{className:"topbar-lead",children:[u.jsxs(Gl,{className:"topbar-brand",to:"/operations","aria-label":"Operations로 이동",children:[u.jsx("span",{className:`topbar-sigil ${n?"is-alert":""}`,"aria-hidden":"true",title:e.connectionError??void 0,children:s}),u.jsxs("h1",{className:"topbar-title",children:["Fleet",u.jsx("span",{className:"topbar-title-thin",children:"Console"})]})]}),u.jsxs("span",{className:"topbar-preview-badge",children:[u.jsx("span",{className:"topbar-preview-label",children:"Research Preview"}),e.version?u.jsxs("span",{className:"topbar-preview-version",children:["v",e.version]}):null]}),u.jsx(l3,{}),u.jsx(XR,{state:e})]}),u.jsx(o3,{state:e}),u.jsxs("div",{className:"topbar-meta",children:[e.updateAvailable?u.jsx(i3,{latestVersion:e.latestVersion}):null,u.jsxs(Up,{to:"/carrier-settings",className:({isActive:o})=>`topbar-nav-link ${o?"is-active":""}`,title:"Carrier settings",children:[u.jsx("span",{className:"topbar-nav-icon","aria-hidden":"true",children:u.jsx(o1,{})}),u.jsx("span",{children:"Carriers"})]}),u.jsxs(Up,{to:"/settings",className:({isActive:o})=>`topbar-nav-link ${o?"is-active":""}`,title:"Settings",children:[u.jsx("span",{className:"topbar-nav-icon","aria-hidden":"true",children:u.jsx(a1,{})}),u.jsx("span",{children:"Settings"})]})]})]})}function i3({latestVersion:e}){const[n,i]=N.useState("idle"),[s,o]=N.useState(null),f=N.useRef(null),_=r3(n,s,e);N.useEffect(()=>()=>{f.current!==null&&window.clearTimeout(f.current)},[]);const c=async()=>{if(!_.disabled){f.current!==null&&(window.clearTimeout(f.current),f.current=null),i("applying"),o(null);try{if((await jA()).status!=="accepted"){i("error"),o("invalid_response");return}i("accepted"),f.current=window.setTimeout(()=>{f.current=null,i("completed")},ZR)}catch(h){const d=h instanceof ct?h.message:"network_error";o(d),i(a3(d)?"blocked":"error")}}};return u.jsx("button",{type:"button",className:`topbar-update-badge topbar-update-badge--${_.tone}`,onClick:c,disabled:_.disabled,title:_.title,"aria-live":"polite",children:_.label})}function r3(e,n,i){const s=i?`최신 버전 ${i}`:"업데이트 가능";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"?s3(n):e==="error"?{label:"재시도",title:"업데이트 요청에 실패했습니다. 다시 시도할 수 있습니다.",tone:"error",disabled:!1}:{label:"Update available",title:s,tone:"warn",disabled:!1}}function s3(e){return e==="local_channel"?{label:"로컬 빌드",title:"로컬 개발 빌드는 콘솔에서 업데이트하지 않습니다.",tone:"blocked",disabled:!0}: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 a3(e){return e==="local_channel"||e==="update_already_in_progress"||e==="update_not_available"}function o3({state:e}){const[n,i]=N.useState(!1),[s,o]=N.useState(!1),f=N.useRef(null),_=N.useRef(null),c=N.useRef(null),h=e.theaters.find(g=>g.id===e.activeTheaterId)??null,d=h?.label??(e.theaters.length===0?"No Theaters":"Theater");N.useEffect(()=>{if(!n)return;const g=m=>{f.current?.contains(m.target)||i(!1)},v=m=>{m.key==="Escape"&&(i(!1),_.current?.focus())};return document.addEventListener("mousedown",g),document.addEventListener("keydown",v),()=>{document.removeEventListener("mousedown",g),document.removeEventListener("keydown",v)}},[n]),N.useEffect(()=>{if(!n)return;const g=c.current;if(!g)return;(g.querySelector('[data-active="true"]')??g.querySelector("[role^='menuitem']"))?.focus()},[n]);const y=g=>{oR(g),i(!1),_.current?.focus()},p=async()=>{i(!1),o(!0)},w=()=>{o(!1),uR()},C=async g=>{o(!1),Rw();try{const v=await gw(g),m=await pw(v);Lw(m)}catch(v){rg(v instanceof Error?v.message:String(v))}},T=async()=>{if(h){i(!1);try{await BA(h.id),t1(h.id)}catch(g){if(g instanceof ct&&g.status===404){t1(h.id);return}rg(g instanceof Error?g.message:String(g))}}},E=g=>{if(g.key!=="ArrowDown"&&g.key!=="ArrowUp")return;g.preventDefault();const v=Array.from(c.current?.querySelectorAll("[role^='menuitem']")??[]);if(v.length===0)return;const m=v.indexOf(document.activeElement),S=g.key==="ArrowDown"?1:-1,k=(m+S+v.length)%v.length;v[k]?.focus()};return u.jsxs("div",{className:"theater-control",ref:f,children:[u.jsx("span",{className:"theater-eyebrow","aria-hidden":"true",children:"Theater"}),u.jsxs("button",{type:"button",ref:_,className:`theater-trigger ${n?"is-open":""}`,"aria-haspopup":"menu","aria-expanded":n,"aria-label":"Theater",title:h?.label??e.theaterError??void 0,onClick:()=>i(g=>!g),children:[u.jsx("span",{className:"theater-trigger-sigil","aria-hidden":"true",children:u.jsx(p3,{})}),u.jsx("span",{className:"theater-trigger-label",children:d}),u.jsx("span",{className:"theater-trigger-caret","aria-hidden":"true",children:u.jsx(g3,{})})]}),n?u.jsxs("div",{className:"theater-menu",role:"menu","aria-label":"Theater",ref:c,onKeyDown:E,children:[e.theaters.length>0?u.jsx("ul",{className:"theater-menu-list",children:e.theaters.map(g=>{const v=g.id===e.activeTheaterId;return u.jsx("li",{children:u.jsxs("button",{type:"button",role:"menuitemradio","aria-checked":v,"data-active":v?"true":void 0,className:`theater-menu-item ${v?"is-active":""}`,title:g.label,onClick:()=>y(g.id),children:[u.jsx("span",{className:"theater-menu-check","aria-hidden":"true",children:v?u.jsx(m3,{}):null}),u.jsx("span",{className:"theater-menu-label",children:g.label})]})},g.id)})}):u.jsx("p",{className:"theater-menu-empty",children:"No Theaters yet."}),u.jsx("div",{className:"theater-menu-divider",role:"separator"}),h?u.jsxs(u.Fragment,{children:[u.jsxs("button",{type:"button",role:"menuitem",className:"theater-menu-item theater-menu-forget",onClick:T,children:[u.jsx("span",{className:"theater-menu-check","aria-hidden":"true",children:u.jsx(_3,{})}),u.jsx("span",{className:"theater-menu-label",children:"Forget Theater"})]}),u.jsx("div",{className:"theater-menu-divider",role:"separator"})]}):null,u.jsxs("button",{type:"button",role:"menuitem",className:"theater-menu-item theater-menu-add",disabled:e.addingTheater,onClick:p,children:[u.jsx("span",{className:"theater-menu-check","aria-hidden":"true",children:u.jsx(y3,{})}),u.jsx("span",{className:"theater-menu-label",children:e.addingTheater?"Adding Theater…":"Add Theater…"})]}),e.theaterError?u.jsx("p",{className:"theater-menu-error",children:e.theaterError}):null]}):null,u.jsx(Bw,{open:s,onCancel:w,onConfirm:C})]})}function l3(){const e=c3(),n=e.count!==null;return u.jsxs("div",{className:"topbar-github",role:"group","aria-label":"GitHub",children:[u.jsx("a",{className:"topbar-github-link",href:JR,target:"_blank",rel:"noopener noreferrer","aria-label":"GitHub 저장소 열기",title:"GitHub 저장소",children:u.jsx(S3,{})}),u.jsxs("a",{className:"topbar-github-stars",href:QR,target:"_blank",rel:"noopener noreferrer","aria-label":n?`GitHub 스타 ${e.count.toLocaleString()}개 — 스타 누르기`:"GitHub에서 스타 누르기",title:"GitHub에서 스타 누르기",children:[u.jsx(w3,{}),n?u.jsx("span",{className:"topbar-github-stars-count",children:f3(e.count)}):null]})]})}function c3(){const[e,n]=N.useState(()=>{const i=u3();return i===null?{count:null,status:"idle"}:{count:i,status:"ready"}});return N.useEffect(()=>{if(h3())return;let i=!1;return n(s=>s.status==="ready"?s:{...s,status:"loading"}),fetch(e3,{headers:{Accept:"application/vnd.github+json"}}).then(s=>s.ok?s.json():Promise.reject(new Error(`status ${s.status}`))).then(s=>{if(i)return;const o=typeof s.stargazers_count=="number"?s.stargazers_count:null;if(o===null){n(f=>({count:f.count,status:f.count===null?"error":"ready"}));return}d3(o),n({count:o,status:"ready"})}).catch(()=>{i||n(s=>({count:s.count,status:s.count===null?"error":"ready"}))}),()=>{i=!0}},[]),e}function u3(){try{const e=window.localStorage.getItem(gm);if(!e)return null;const n=JSON.parse(e);return typeof n.count=="number"?n.count:null}catch{return null}}function h3(){try{const e=window.localStorage.getItem(gm);if(!e)return!1;const n=JSON.parse(e);return typeof n.at=="number"&&Date.now()-n.at<t3}catch{return!1}}function d3(e){try{window.localStorage.setItem(gm,JSON.stringify({count:e,at:Date.now()}))}catch{}}function f3(e){if(e<1e3)return String(e);const n=e/1e3;return n<10?`${n.toFixed(1)}k`:`${Math.round(n)}k`}function p3(){return u.jsxs("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:[u.jsx("circle",{cx:"8",cy:"3.2",r:"1.5",fill:"none",stroke:"currentColor",strokeWidth:"1.2"}),u.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 g3(){return u.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:u.jsx("path",{d:"M4.5 6.5 8 10l3.5-3.5",fill:"none",stroke:"currentColor",strokeWidth:"1.3",strokeLinecap:"round",strokeLinejoin:"round"})})}function m3(){return u.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:u.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 _3(){return u.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:u.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 v3(){return u.jsxs("svg",{viewBox:"0 0 16 16",width:"16",height:"16",children:[u.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"}),u.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 b3(){return u.jsxs("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:[u.jsx("circle",{cx:"8",cy:"8",r:"5.4",fill:"none",stroke:"currentColor",strokeWidth:"1.2"}),u.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"}),u.jsx("circle",{cx:"8",cy:"8",r:"1.1",fill:"currentColor"})]})}function a1(){return u.jsxs("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:[u.jsx("path",{d:"M3 4.4h10M3 8h10M3 11.6h10",fill:"none",stroke:"currentColor",strokeWidth:"1.2",strokeLinecap:"round"}),u.jsx("circle",{cx:"6.2",cy:"4.4",r:"1.3",fill:"var(--surface-glass-strong)",stroke:"currentColor",strokeWidth:"1.2"}),u.jsx("circle",{cx:"10",cy:"8",r:"1.3",fill:"var(--surface-glass-strong)",stroke:"currentColor",strokeWidth:"1.2"}),u.jsx("circle",{cx:"7.4",cy:"11.6",r:"1.3",fill:"var(--surface-glass-strong)",stroke:"currentColor",strokeWidth:"1.2"})]})}function o1(){return u.jsxs("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:[u.jsx("circle",{cx:"4",cy:"4.2",r:"1.15",fill:"currentColor"}),u.jsx("circle",{cx:"4",cy:"8",r:"1.15",fill:"currentColor"}),u.jsx("circle",{cx:"4",cy:"11.8",r:"1.15",fill:"currentColor"}),u.jsx("path",{d:"M7.2 4.2h6M7.2 8h6M7.2 11.8h6",fill:"none",stroke:"currentColor",strokeWidth:"1.2",strokeLinecap:"round"})]})}function y3(){return u.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:u.jsx("path",{d:"M8 3.4v9.2M3.4 8h9.2",fill:"none",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round"})})}function S3(){return u.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:u.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 w3(){return u.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:u.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"})})}const x3=["a[href]","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])","[tabindex]:not([tabindex='-1'])"].join(","),vl=10;function C3({state:e}){const n=N.useRef(null),i=N.useRef(null),s=N.useRef(null),o=!e.bootstrapped||e.onboardingOpen||e.operationSearchOpen;if(e.whatsNewOpen&&!o&&n.current===null&&(n.current=document.activeElement),N.useEffect(()=>{if(!e.whatsNewOpen||o)return;const E=g=>{g.key==="Escape"?(g.preventDefault(),Su()):g.key==="Tab"&&T3(g,s.current),g.stopImmediatePropagation()};return i.current?.focus(),window.addEventListener("keydown",E,!0),()=>{window.removeEventListener("keydown",E,!0);const g=n.current;n.current=null,g?.focus?.()}},[e.whatsNewOpen,o]),!e.whatsNewOpen||o||e.releaseNotes.length===0)return null;const f=e.selectedReleaseNoteKey??Wa(e.releaseNotes[0]?.version??"",0),_=e.releaseNotes.findIndex((E,g)=>Wa(E.version,g)===f),c=e.releaseNotes[_]??e.releaseNotes[0],h=Wa(c.version,_>=0?_:0),d=()=>{Ew(),fw({force:!0}).then(kw).catch(E=>Tw(E instanceof Error?E.message:String(E)))},y=Math.max(1,Math.ceil(e.releaseNotes.length/vl)),p=Math.min(y-1,Math.floor((_>=0?_:0)/vl)),w=p*vl,C=e.releaseNotes.slice(w,w+vl),T=E=>{const g=p+E;if(g<0||g>=y)return;const v=g*vl,m=e.releaseNotes[v];m&&Jb(Wa(m.version,v))};return u.jsxs("div",{className:"whatsnew-overlay",role:"dialog","aria-modal":"true","aria-labelledby":"whatsnew-title",children:[u.jsx("button",{type:"button",className:"whatsnew-scrim",onClick:Su,"aria-label":"Close What's new"}),u.jsxs("section",{className:"whatsnew-card",ref:s,children:[u.jsxs("header",{className:"whatsnew-header",children:[u.jsxs("div",{className:"whatsnew-heading-row",children:[u.jsx("h2",{id:"whatsnew-title",children:"What's new"}),u.jsxs("span",{className:"whatsnew-version-badge",children:["v",c.version]})]}),u.jsxs("div",{className:"whatsnew-meta-row",children:[c.date?u.jsxs("time",{className:"whatsnew-date",dateTime:c.date,children:["Released ",c.date]}):u.jsx("span",{className:"whatsnew-date",children:"Unreleased"}),e.releaseNotesStale?u.jsx("span",{className:"whatsnew-stale",children:"Stale"}):null]})]}),u.jsx("button",{ref:i,type:"button",className:"whatsnew-close",onClick:Su,"aria-label":"Close What's new",children:"x"}),u.jsxs("div",{className:"whatsnew-body",children:[u.jsxs("div",{className:"whatsnew-version-selector",children:[u.jsx("select",{"aria-label":"Release version",value:h,onChange:E=>Jb(E.currentTarget.value),children:C.map((E,g)=>{const v=w+g;return u.jsxs("option",{value:Wa(E.version,v),children:[E.version==="Unreleased"?"Unreleased":`v${E.version}`,E.date?` · ${E.date}`:""]},Wa(E.version,v))})}),y>1?u.jsxs("div",{className:"whatsnew-pagination",children:[u.jsx("button",{type:"button",className:"whatsnew-page-button",onClick:()=>T(-1),disabled:p===0,"aria-label":"Newer versions",children:"‹"}),u.jsxs("span",{className:"whatsnew-page-status",children:[p+1," / ",y]}),u.jsx("button",{type:"button",className:"whatsnew-page-button",onClick:()=>T(1),disabled:p>=y-1,"aria-label":"Older versions",children:"›"})]}):null,u.jsx("button",{type:"button",className:"whatsnew-refresh",onClick:d,disabled:e.releaseNotesLoading,children:e.releaseNotesLoading?"Refreshing":"Refresh"})]}),e.releaseNotesError?u.jsx("p",{className:"whatsnew-error",children:"Release notes could not be refreshed."}):null,c.sections.map((E,g)=>u.jsx(E3,{section:E,index:g},E.heading))]}),u.jsx("footer",{className:"whatsnew-footer",children:u.jsx("button",{type:"button",className:"whatsnew-done",onClick:Su,children:"Close"})})]})]})}function E3({section:e,index:n}){const i=e.heading.toLowerCase().replaceAll(" ","-"),s={"--whatsnew-delay":`${n*55}ms`};return u.jsxs("section",{className:`whatsnew-section whatsnew-section--${i}`,style:s,children:[u.jsx("h3",{children:u.jsx("span",{className:"whatsnew-section-chip",children:e.heading})}),u.jsx("ul",{children:e.items.map((o,f)=>u.jsx("li",{children:u.jsx(k3,{item:o})},`${o.text}:${f}`))})]})}function k3({item:e}){return u.jsxs(u.Fragment,{children:[e.packageTags.map((n,i)=>u.jsx("span",{className:`whatsnew-package-chip whatsnew-package-chip--${i%2===0?"brass":"aurora"}`,children:n},`${n}:${i}`)),u.jsx("span",{children:e.text})]})}function Wa(e,n){return`${e}:${n}`}function T3(e,n){if(!n)return;const i=Array.from(n.querySelectorAll(x3)),s=i[0],o=i[i.length-1];!s||!o||(e.shiftKey&&document.activeElement===s?(e.preventDefault(),o.focus()):!e.shiftKey&&document.activeElement===o&&(e.preventDefault(),s.focus()))}function Ur(){return N.useSyncExternalStore(tR,ig,ig)}function Eh(e=()=>{}){return{...NS(e),notifications:{emit:i=>cR(i),dismiss:i=>mR(i)},status:{set:(i,s)=>lR(i,s),clear:i=>Aw(i)}}}const l1=250,A3=5e3,c1=1,R3=1013,L3=4e3,M3=4001;function N3(e){const n=new AbortController,i=new TextEncoder;let s=l1,o=null,f=null,_=null,c=!1;const h=()=>{f?.dispose(),f=null},d=(w,C)=>{_={cols:w,rows:C},o?.readyState===c1&&o.send(JSON.stringify({type:"resize",cols:w,rows:C}))},y=async()=>{for(;!n.signal.aborted;){e.onStatus?.("connecting");try{const{ticket:w}=await D3(e.ticketPath,e.operationId,n.signal);if(n.signal.aborted)return;await p(O3(w,e.location,e.wsPath),e),s=l1}catch(w){if(n.signal.aborted)return;e.onStatus?.("connecting",w instanceof Error?w.message:String(w))}await I3(s,n.signal),s=Math.min(s*2,A3)}},p=async(w,C)=>{await new Promise((T,E)=>{const g=(C.webSocketFactory??j3)(w);o=g,g.binaryType="arraybuffer",g.onopen=()=>{C.onStatus?.("live"),h(),f=C.terminal.onData(v=>{g.readyState===c1&&g.send(i.encode(v))}),_&&d(_.cols,_.rows)},g.onmessage=v=>{v.data instanceof ArrayBuffer&&C.terminal.write(new Uint8Array(v.data))},g.onerror=()=>{E(new Error("Terminal WebSocket error"))},g.onclose=v=>{h(),o===g&&(o=null);const m=v?.code;m===L3?(n.abort(),C.onStatus?.("closed","terminal_replaced")):m===M3?(n.abort(),C.onStatus?.("closed","terminal_closed"),C.onExit?.()):m===R3&&(n.abort(),C.onStatus?.("closed","terminal_unavailable")),T()}})};return{start:()=>{c||(c=!0,y())},resize:d,dispose:()=>{n.abort(),h(),e.onStatus?.("closed"),o?.close(),o=null}}}function O3(e,n=window.location,i){return`${n.protocol==="https:"?"wss":"ws"}://${n.host}${i}?ticket=${encodeURIComponent(e)}`}async function D3(e,n,i){const s=await fetch(e,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({operationId:n}),signal:i});if(!s.ok)throw new Error(`Terminal ticket request failed: ${s.status}`);const o=await s.json();if(typeof o.ticket!="string"||typeof o.ttlMs!="number")throw new Error("Invalid terminal ticket response");return{ticket:o.ticket,ttlMs:o.ttlMs}}function j3(e){return new WebSocket(e)}async function I3(e,n){await new Promise(i=>{const s=()=>{clearTimeout(o),n.removeEventListener("abort",s),i()},o=setTimeout(s,e);n.addEventListener("abort",s)})}var Xf={exports:{}},u1;function B3(){return u1||(u1=1,(function(e,n){(function(i,s){e.exports=s()})(self,(()=>(()=>{var i={};return(()=>{var s=i;Object.defineProperty(s,"__esModule",{value:!0}),s.FitAddon=void 0,s.FitAddon=class{activate(o){this._terminal=o}dispose(){}fit(){const o=this.proposeDimensions();if(!o||!this._terminal||isNaN(o.cols)||isNaN(o.rows))return;const f=this._terminal._core;this._terminal.rows===o.rows&&this._terminal.cols===o.cols||(f._renderService.clear(),this._terminal.resize(o.cols,o.rows))}proposeDimensions(){if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;const o=this._terminal._core,f=o._renderService.dimensions;if(f.css.cell.width===0||f.css.cell.height===0)return;const _=this._terminal.options.scrollback===0?0:o.viewport.scrollBarWidth,c=window.getComputedStyle(this._terminal.element.parentElement),h=parseInt(c.getPropertyValue("height")),d=Math.max(0,parseInt(c.getPropertyValue("width"))),y=window.getComputedStyle(this._terminal.element),p=h-(parseInt(y.getPropertyValue("padding-top"))+parseInt(y.getPropertyValue("padding-bottom"))),w=d-(parseInt(y.getPropertyValue("padding-right"))+parseInt(y.getPropertyValue("padding-left")))-_;return{cols:Math.max(2,Math.floor(w/f.css.cell.width)),rows:Math.max(1,Math.floor(p/f.css.cell.height))}}}})(),i})()))})(Xf)),Xf.exports}var P3=B3(),Uu={exports:{}},z3=Uu.exports,h1;function H3(){return h1||(h1=1,(function(e,n){(function(i,s){e.exports=s()})(z3,(()=>(()=>{var i={433:(_,c,h)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.UnicodeV11=void 0;const d=h(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]],p=[[66045,66045],[66272,66272],[66422,66426],[68097,68099],[68101,68102],[68108,68111],[68152,68154],[68159,68159],[68325,68326],[68900,68903],[69446,69456],[69633,69633],[69688,69702],[69759,69761],[69811,69814],[69817,69818],[69821,69821],[69837,69837],[69888,69890],[69927,69931],[69933,69940],[70003,70003],[70016,70017],[70070,70078],[70089,70092],[70191,70193],[70196,70196],[70198,70199],[70206,70206],[70367,70367],[70371,70378],[70400,70401],[70459,70460],[70464,70464],[70502,70508],[70512,70516],[70712,70719],[70722,70724],[70726,70726],[70750,70750],[70835,70840],[70842,70842],[70847,70848],[70850,70851],[71090,71093],[71100,71101],[71103,71104],[71132,71133],[71219,71226],[71229,71229],[71231,71232],[71339,71339],[71341,71341],[71344,71349],[71351,71351],[71453,71455],[71458,71461],[71463,71467],[71727,71735],[71737,71738],[72148,72151],[72154,72155],[72160,72160],[72193,72202],[72243,72248],[72251,72254],[72263,72263],[72273,72278],[72281,72283],[72330,72342],[72344,72345],[72752,72758],[72760,72765],[72767,72767],[72850,72871],[72874,72880],[72882,72883],[72885,72886],[73009,73014],[73018,73018],[73020,73021],[73023,73029],[73031,73031],[73104,73105],[73109,73109],[73111,73111],[73459,73460],[78896,78904],[92912,92916],[92976,92982],[94031,94031],[94095,94098],[113821,113822],[113824,113827],[119143,119145],[119155,119170],[119173,119179],[119210,119213],[119362,119364],[121344,121398],[121403,121452],[121461,121461],[121476,121476],[121499,121503],[121505,121519],[122880,122886],[122888,122904],[122907,122913],[122915,122916],[122918,122922],[123184,123190],[123628,123631],[125136,125142],[125252,125258],[917505,917505],[917536,917631],[917760,917999]],w=[[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]],C=[[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 T;function E(g,v){let m,S=0,k=v.length-1;if(g<v[0][0]||g>v[k][1])return!1;for(;k>=S;)if(m=S+k>>1,g>v[m][1])S=m+1;else{if(!(g<v[m][0]))return!0;k=m-1}return!1}c.UnicodeV11=class{constructor(){if(this.version="11",!T){T=new Uint8Array(65536),T.fill(1),T[0]=0,T.fill(0,1,32),T.fill(0,127,160);for(let g=0;g<y.length;++g)T.fill(0,y[g][0],y[g][1]+1);for(let g=0;g<w.length;++g)T.fill(2,w[g][0],w[g][1]+1)}}wcwidth(g){return g<32?0:g<127?1:g<65536?T[g]:E(g,p)?0:E(g,C)?2:1}charProperties(g,v){let m=this.wcwidth(g),S=m===0&&v!==0;if(S){const k=d.UnicodeService.extractWidth(v);k===0?S=!1:k>m&&(m=k)}return d.UnicodeService.createPropertyValue(0,m,S)}}},345:(_,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=h=>(this._listeners.push(h),{dispose:()=>{if(!this._disposed){for(let d=0;d<this._listeners.length;d++)if(this._listeners[d]===h)return void this._listeners.splice(d,1)}}})),this._event}fire(h,d){const y=[];for(let p=0;p<this._listeners.length;p++)y.push(this._listeners[p]);for(let p=0;p<y.length;p++)y[p].call(void 0,h,d)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},c.forwardEvent=function(h,d){return h((y=>d.fire(y)))},c.runAndSubscribe=function(h,d){return d(void 0),h((y=>d(y)))}},490:(_,c,h)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.UnicodeV6=void 0;const d=h(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]],p=[[68097,68099],[68101,68102],[68108,68111],[68152,68154],[68159,68159],[119143,119145],[119155,119170],[119173,119179],[119210,119213],[119362,119364],[917505,917505],[917536,917631],[917760,917999]];let w;c.UnicodeV6=class{constructor(){if(this.version="6",!w){w=new Uint8Array(65536),w.fill(1),w[0]=0,w.fill(0,1,32),w.fill(0,127,160),w.fill(2,4352,4448),w[9001]=2,w[9002]=2,w.fill(2,11904,42192),w[12351]=1,w.fill(2,44032,55204),w.fill(2,63744,64256),w.fill(2,65040,65050),w.fill(2,65072,65136),w.fill(2,65280,65377),w.fill(2,65504,65511);for(let C=0;C<y.length;++C)w.fill(0,y[C][0],y[C][1]+1)}}wcwidth(C){return C<32?0:C<127?1:C<65536?w[C]:(function(T,E){let g,v=0,m=E.length-1;if(T<E[0][0]||T>E[m][1])return!1;for(;m>=v;)if(g=v+m>>1,T>E[g][1])v=g+1;else{if(!(T<E[g][0]))return!0;m=g-1}return!1})(C,p)?0:C>=131072&&C<=196605||C>=196608&&C<=262141?2:1}charProperties(C,T){let E=this.wcwidth(C),g=E===0&&T!==0;if(g){const v=d.UnicodeService.extractWidth(T);v===0?g=!1:v>E&&(E=v)}return d.UnicodeService.createPropertyValue(0,E,g)}}},938:(_,c,h)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.UnicodeService=void 0;const d=h(345),y=h(490);class p{static extractShouldJoin(C){return(1&C)!=0}static extractWidth(C){return C>>1&3}static extractCharKind(C){return C>>3}static createPropertyValue(C,T,E=!1){return(16777215&C)<<3|(3&T)<<1|(E?1:0)}constructor(){this._providers=Object.create(null),this._active="",this._onChange=new d.EventEmitter,this.onChange=this._onChange.event;const C=new y.UnicodeV6;this.register(C),this._active=C.version,this._activeProvider=C}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(C){if(!this._providers[C])throw new Error(`unknown Unicode version "${C}"`);this._active=C,this._activeProvider=this._providers[C],this._onChange.fire(C)}register(C){this._providers[C.version]=C}wcwidth(C){return this._activeProvider.wcwidth(C)}getStringCellWidth(C){let T=0,E=0;const g=C.length;for(let v=0;v<g;++v){let m=C.charCodeAt(v);if(55296<=m&&m<=56319){if(++v>=g)return T+this.wcwidth(m);const L=C.charCodeAt(v);56320<=L&&L<=57343?m=1024*(m-55296)+L-56320+65536:T+=this.wcwidth(L)}const S=this.charProperties(m,E);let k=p.extractWidth(S);p.extractShouldJoin(S)&&(k-=p.extractWidth(E)),T+=k,E=S}return T}charProperties(C,T){return this._activeProvider.charProperties(C,T)}}c.UnicodeService=p}},s={};function o(_){var c=s[_];if(c!==void 0)return c.exports;var h=s[_]={exports:{}};return i[_](h,h.exports,o),h.exports}var f={};return(()=>{var _=f;Object.defineProperty(_,"__esModule",{value:!0}),_.Unicode11Addon=void 0;const c=o(433);_.Unicode11Addon=class{activate(h){h.unicode.register(new c.UnicodeV11)}dispose(){}}})(),f})()))})(Uu)),Uu.exports}var $3=H3();var U3=(e,n,i,s)=>{for(var o=n,f=e.length-1,_;f>=0;f--)(_=e[f])&&(o=_(o)||o);return o},F3=(e,n)=>(i,s)=>n(i,s,e),W3=class{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(e){setTimeout(()=>{throw e.stack?d1.isErrorNoTelemetry(e)?new d1(e.message+`
|
|
12
|
-
|
|
13
|
-
`+e.stack):new Error(e.message+`
|
|
14
|
-
|
|
15
|
-
`+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)}},G3=new W3;function Zf(e){q3(e)||G3.onUnexpectedError(e)}var ag="Canceled";function q3(e){return e instanceof K3?!0:e instanceof Error&&e.name===ag&&e.message===ag}var K3=class extends Error{constructor(){super(ag),this.name=this.message}},d1=class og extends Error{constructor(n){super(n),this.name="CodeExpectedError"}static fromError(n){if(n instanceof og)return n;let i=new og;return i.message=n.message,i.stack=n.stack,i}static isErrorNoTelemetry(n){return n.name==="CodeExpectedError"}},V3;(e=>{function n(f){return f<0}e.isLessThan=n;function i(f){return f<=0}e.isLessThanOrEqual=i;function s(f){return f>0}e.isGreaterThan=s;function o(f){return f===0}e.isNeitherLessOrGreaterThan=o,e.greaterThan=1,e.lessThan=-1,e.neitherLessOrGreaterThan=0})(V3||={});function Y3(e,n){let i=this,s=!1,o;return function(){return s||(s=!0,n||(o=e.apply(i,arguments))),o}}var Hw;(e=>{function n(k){return k&&typeof k=="object"&&typeof k[Symbol.iterator]=="function"}e.is=n;let i=Object.freeze([]);function s(){return i}e.empty=s;function*o(k){yield k}e.single=o;function f(k){return n(k)?k:o(k)}e.wrap=f;function _(k){return k||i}e.from=_;function*c(k){for(let L=k.length-1;L>=0;L--)yield k[L]}e.reverse=c;function h(k){return!k||k[Symbol.iterator]().next().done===!0}e.isEmpty=h;function d(k){return k[Symbol.iterator]().next().value}e.first=d;function y(k,L){let R=0;for(let M of k)if(L(M,R++))return!0;return!1}e.some=y;function p(k,L){for(let R of k)if(L(R))return R}e.find=p;function*w(k,L){for(let R of k)L(R)&&(yield R)}e.filter=w;function*C(k,L){let R=0;for(let M of k)yield L(M,R++)}e.map=C;function*T(k,L){let R=0;for(let M of k)yield*L(M,R++)}e.flatMap=T;function*E(...k){for(let L of k)yield*L}e.concat=E;function g(k,L,R){let M=R;for(let A of k)M=L(M,A);return M}e.reduce=g;function*v(k,L,R=k.length){for(L<0&&(L+=k.length),R<0?R+=k.length:R>k.length&&(R=k.length);L<R;L++)yield k[L]}e.slice=v;function m(k,L=Number.POSITIVE_INFINITY){let R=[];if(L===0)return[R,k];let M=k[Symbol.iterator]();for(let A=0;A<L;A++){let B=M.next();if(B.done)return[R,e.empty()];R.push(B.value)}return[R,{[Symbol.iterator](){return M}}]}e.consume=m;async function S(k){let L=[];for await(let R of k)L.push(R);return Promise.resolve(L)}e.asyncToArray=S})(Hw||={});function $w(e){if(Hw.is(e)){let n=[];for(let i of e)if(i)try{i.dispose()}catch(s){n.push(s)}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 Uw(...e){return $n(()=>$w(e))}function $n(e){return{dispose:Y3(()=>{e()})}}var Fw=class Ww{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{$w(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?Ww.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)}};Fw.DISABLE_DISPOSED_WARNING=!1;var lo=Fw,Ji=class{constructor(){this._store=new lo,this._store}dispose(){this._store.dispose()}_register(n){if(n===this)throw new Error("Cannot register a disposable on itself!");return this._store.add(n)}};Ji.None=Object.freeze({dispose(){}});var bl=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(n){this._isDisposed||n===this._value||(this._value?.dispose(),this._value=n)}clear(){this.value=void 0}dispose(){this._isDisposed=!0,this._value?.dispose(),this._value=void 0}clearAndLeak(){let n=this._value;return this._value=void 0,n}},mm=typeof process<"u"&&"title"in process,kh=mm?"node":navigator.userAgent,X3=mm?"node":navigator.platform,Z3=kh.includes("Firefox"),J3=kh.includes("Edge"),Gw=/^((?!chrome|android).)*safari/i.test(kh);function Q3(){if(!Gw)return 0;let e=kh.match(/Version\/(\d+)/);return e===null||e.length<2?0:parseInt(e[1])}X3.indexOf("Linux")>=0;var eL="",xn=0,Cn=0,En=0,sn=0,ji={css:"#00000000",rgba:0},Kn;(e=>{function n(o,f,_,c){return c!==void 0?`#${Ks(o)}${Ks(f)}${Ks(_)}${Ks(c)}`:`#${Ks(o)}${Ks(f)}${Ks(_)}`}e.toCss=n;function i(o,f,_,c=255){return(o<<24|f<<16|_<<8|c)>>>0}e.toRgba=i;function s(o,f,_,c){return{css:e.toCss(o,f,_,c),rgba:e.toRgba(o,f,_,c)}}e.toColor=s})(Kn||={});var Ol;(e=>{function n(h,d){if(sn=(d.rgba&255)/255,sn===1)return{css:d.css,rgba:d.rgba};let y=d.rgba>>24&255,p=d.rgba>>16&255,w=d.rgba>>8&255,C=h.rgba>>24&255,T=h.rgba>>16&255,E=h.rgba>>8&255;xn=C+Math.round((y-C)*sn),Cn=T+Math.round((p-T)*sn),En=E+Math.round((w-E)*sn);let g=Kn.toCss(xn,Cn,En),v=Kn.toRgba(xn,Cn,En);return{css:g,rgba:v}}e.blend=n;function i(h){return(h.rgba&255)===255}e.isOpaque=i;function s(h,d,y){let p=ta.ensureContrastRatio(h.rgba,d.rgba,y);if(p)return Kn.toColor(p>>24&255,p>>16&255,p>>8&255)}e.ensureContrastRatio=s;function o(h){let d=(h.rgba|255)>>>0;return[xn,Cn,En]=ta.toChannels(d),{css:Kn.toCss(xn,Cn,En),rgba:d}}e.opaque=o;function f(h,d){return sn=Math.round(d*255),[xn,Cn,En]=ta.toChannels(h.rgba),{css:Kn.toCss(xn,Cn,En,sn),rgba:Kn.toRgba(xn,Cn,En,sn)}}e.opacity=f;function _(h,d){return sn=h.rgba&255,f(h,sn*d/255)}e.multiplyOpacity=_;function c(h){return[h.rgba>>24&255,h.rgba>>16&255,h.rgba>>8&255]}e.toColorRGB=c})(Ol||={});var tL;(e=>{let n,i;try{let o=document.createElement("canvas");o.width=1,o.height=1;let f=o.getContext("2d",{willReadFrequently:!0});f&&(n=f,n.globalCompositeOperation="copy",i=n.createLinearGradient(0,0,1,1))}catch{}function s(o){if(o.match(/#[\da-f]{3,8}/i))switch(o.length){case 4:return xn=parseInt(o.slice(1,2).repeat(2),16),Cn=parseInt(o.slice(2,3).repeat(2),16),En=parseInt(o.slice(3,4).repeat(2),16),Kn.toColor(xn,Cn,En);case 5:return xn=parseInt(o.slice(1,2).repeat(2),16),Cn=parseInt(o.slice(2,3).repeat(2),16),En=parseInt(o.slice(3,4).repeat(2),16),sn=parseInt(o.slice(4,5).repeat(2),16),Kn.toColor(xn,Cn,En,sn);case 7:return{css:o,rgba:(parseInt(o.slice(1),16)<<8|255)>>>0};case 9:return{css:o,rgba:parseInt(o.slice(1),16)>>>0}}let f=o.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 xn=parseInt(f[1]),Cn=parseInt(f[2]),En=parseInt(f[3]),sn=Math.round((f[5]===void 0?1:parseFloat(f[5]))*255),Kn.toColor(xn,Cn,En,sn);if(!n||!i)throw new Error("css.toColor: Unsupported css format");if(n.fillStyle=i,n.fillStyle=o,typeof n.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(n.fillRect(0,0,1,1),[xn,Cn,En,sn]=n.getImageData(0,0,1,1).data,sn!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:Kn.toRgba(xn,Cn,En,sn),css:o}}e.toColor=s})(tL||={});var Wn;(e=>{function n(s){return i(s>>16&255,s>>8&255,s&255)}e.relativeLuminance=n;function i(s,o,f){let _=s/255,c=o/255,h=f/255,d=_<=.03928?_/12.92:Math.pow((_+.055)/1.055,2.4),y=c<=.03928?c/12.92:Math.pow((c+.055)/1.055,2.4),p=h<=.03928?h/12.92:Math.pow((h+.055)/1.055,2.4);return d*.2126+y*.7152+p*.0722}e.relativeLuminance2=i})(Wn||={});var ta;(e=>{function n(_,c){if(sn=(c&255)/255,sn===1)return c;let h=c>>24&255,d=c>>16&255,y=c>>8&255,p=_>>24&255,w=_>>16&255,C=_>>8&255;return xn=p+Math.round((h-p)*sn),Cn=w+Math.round((d-w)*sn),En=C+Math.round((y-C)*sn),Kn.toRgba(xn,Cn,En)}e.blend=n;function i(_,c,h){let d=Wn.relativeLuminance(_>>8),y=Wn.relativeLuminance(c>>8);if(Nr(d,y)<h){if(y<d){let C=s(_,c,h),T=Nr(d,Wn.relativeLuminance(C>>8));if(T<h){let E=o(_,c,h),g=Nr(d,Wn.relativeLuminance(E>>8));return T>g?C:E}return C}let p=o(_,c,h),w=Nr(d,Wn.relativeLuminance(p>>8));if(w<h){let C=s(_,c,h),T=Nr(d,Wn.relativeLuminance(C>>8));return w>T?p:C}return p}}e.ensureContrastRatio=i;function s(_,c,h){let d=_>>24&255,y=_>>16&255,p=_>>8&255,w=c>>24&255,C=c>>16&255,T=c>>8&255,E=Nr(Wn.relativeLuminance2(w,C,T),Wn.relativeLuminance2(d,y,p));for(;E<h&&(w>0||C>0||T>0);)w-=Math.max(0,Math.ceil(w*.1)),C-=Math.max(0,Math.ceil(C*.1)),T-=Math.max(0,Math.ceil(T*.1)),E=Nr(Wn.relativeLuminance2(w,C,T),Wn.relativeLuminance2(d,y,p));return(w<<24|C<<16|T<<8|255)>>>0}e.reduceLuminance=s;function o(_,c,h){let d=_>>24&255,y=_>>16&255,p=_>>8&255,w=c>>24&255,C=c>>16&255,T=c>>8&255,E=Nr(Wn.relativeLuminance2(w,C,T),Wn.relativeLuminance2(d,y,p));for(;E<h&&(w<255||C<255||T<255);)w=Math.min(255,w+Math.ceil((255-w)*.1)),C=Math.min(255,C+Math.ceil((255-C)*.1)),T=Math.min(255,T+Math.ceil((255-T)*.1)),E=Nr(Wn.relativeLuminance2(w,C,T),Wn.relativeLuminance2(d,y,p));return(w<<24|C<<16|T<<8|255)>>>0}e.increaseLuminance=o;function f(_){return[_>>24&255,_>>16&255,_>>8&255,_&255]}e.toChannels=f})(ta||={});function Ks(e){let n=e.toString(16);return n.length<2?"0"+n:n}function Nr(e,n){return e<n?(n+.05)/(e+.05):(e+.05)/(n+.05)}function mn(e){if(!e)throw new Error("value must not be falsy");return e}function _m(e){return 57508<=e&&e<=57558}function nL(e){return 57520<=e&&e<=57527}function iL(e){return 57344<=e&&e<=63743}function rL(e){return 9472<=e&&e<=9631}function sL(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 aL(e,n,i,s){return n===1&&i>Math.ceil(s*1.5)&&e!==void 0&&e>255&&!sL(e)&&!_m(e)&&!iL(e)}function qw(e){return _m(e)||rL(e)}function oL(){return{css:{canvas:xu(),cell:xu()},device:{canvas:xu(),cell:xu(),char:{width:0,height:0,left:0,top:0}}}}function xu(){return{width:0,height:0}}function lL(e,n,i=0){return(e-(Math.round(n)*2-i))%(Math.round(n)*2)}var jn=0,wn=0,sr=!1,Or=!1,Cu=!1,li,Jf=0,cL=class{constructor(e,n,i,s,o,f){this._terminal=e,this._optionService=n,this._selectionRenderModel=i,this._decorationService=s,this._coreBrowserService=o,this._themeService=f,this.result={fg:0,bg:0,ext:0}}resolve(e,n,i,s){if(this.result.bg=e.bg,this.result.fg=e.fg,this.result.ext=e.bg&268435456?e.extended.ext:0,wn=0,jn=0,Or=!1,sr=!1,Cu=!1,li=this._themeService.colors,Jf=0,e.getCode()!==0&&e.extended.underlineStyle===4){let o=Math.max(1,Math.floor(this._optionService.rawOptions.fontSize*this._coreBrowserService.dpr/15));Jf=n*s%(Math.round(o)*2)}if(this._decorationService.forEachDecorationAtCell(n,i,"bottom",o=>{o.backgroundColorRGB&&(wn=o.backgroundColorRGB.rgba>>8&16777215,Or=!0),o.foregroundColorRGB&&(jn=o.foregroundColorRGB.rgba>>8&16777215,sr=!0)}),Cu=this._selectionRenderModel.isCellSelected(this._terminal,n,i),Cu){if(this.result.fg&67108864||(this.result.bg&50331648)!==0){if(this.result.fg&67108864)switch(this.result.fg&50331648){case 16777216:case 33554432:wn=this._themeService.colors.ansi[this.result.fg&255].rgba;break;case 50331648:wn=(this.result.fg&16777215)<<8|255;break;default:wn=this._themeService.colors.foreground.rgba}else switch(this.result.bg&50331648){case 16777216:case 33554432:wn=this._themeService.colors.ansi[this.result.bg&255].rgba;break;case 50331648:wn=(this.result.bg&16777215)<<8|255;break}wn=ta.blend(wn,(this._coreBrowserService.isFocused?li.selectionBackgroundOpaque:li.selectionInactiveBackgroundOpaque).rgba&4294967040|128)>>8&16777215}else wn=(this._coreBrowserService.isFocused?li.selectionBackgroundOpaque:li.selectionInactiveBackgroundOpaque).rgba>>8&16777215;if(Or=!0,li.selectionForeground&&(jn=li.selectionForeground.rgba>>8&16777215,sr=!0),qw(e.getCode())){if(this.result.fg&67108864&&(this.result.bg&50331648)===0)jn=(this._coreBrowserService.isFocused?li.selectionBackgroundOpaque:li.selectionInactiveBackgroundOpaque).rgba>>8&16777215;else{if(this.result.fg&67108864)switch(this.result.bg&50331648){case 16777216:case 33554432:jn=this._themeService.colors.ansi[this.result.bg&255].rgba;break;case 50331648:jn=(this.result.bg&16777215)<<8|255;break}else switch(this.result.fg&50331648){case 16777216:case 33554432:jn=this._themeService.colors.ansi[this.result.fg&255].rgba;break;case 50331648:jn=(this.result.fg&16777215)<<8|255;break;default:jn=this._themeService.colors.foreground.rgba}jn=ta.blend(jn,(this._coreBrowserService.isFocused?li.selectionBackgroundOpaque:li.selectionInactiveBackgroundOpaque).rgba&4294967040|128)>>8&16777215}sr=!0}}this._decorationService.forEachDecorationAtCell(n,i,"top",o=>{o.backgroundColorRGB&&(wn=o.backgroundColorRGB.rgba>>8&16777215,Or=!0),o.foregroundColorRGB&&(jn=o.foregroundColorRGB.rgba>>8&16777215,sr=!0)}),Or&&(Cu?wn=e.bg&-16777216&-134217729|wn|50331648:wn=e.bg&-16777216|wn|50331648),sr&&(jn=e.fg&-16777216&-67108865|jn|50331648),this.result.fg&67108864&&(Or&&!sr&&((this.result.bg&50331648)===0?jn=this.result.fg&-134217728|li.background.rgba>>8&16777215&16777215|50331648:jn=this.result.fg&-134217728|this.result.bg&67108863,sr=!0),!Or&&sr&&((this.result.fg&50331648)===0?wn=this.result.bg&-67108864|li.foreground.rgba>>8&16777215&16777215|50331648:wn=this.result.bg&-67108864|this.result.fg&67108863,Or=!0)),li=void 0,this.result.bg=Or?wn:this.result.bg,this.result.fg=sr?jn:this.result.fg,this.result.ext&=536870911,this.result.ext|=Jf<<29&3758096384}},uL=.5,Kw=Z3||J3?"bottom":"ideographic",hL={"▀":[{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}]},dL={"░":[[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]]},fL={"─":{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`}},Vl={"":{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}};Vl[""]=Vl[""];Vl[""]=Vl[""];function pL(e,n,i,s,o,f,_,c){let h=hL[n];if(h)return gL(e,h,i,s,o,f),!0;let d=dL[n];if(d)return mL(e,d,i,s,o,f),!0;let y=fL[n];if(y)return _L(e,y,i,s,o,f,c),!0;let p=Vl[n];return p?(vL(e,p,i,s,o,f,_,c),!0):!1}function gL(e,n,i,s,o,f){for(let _=0;_<n.length;_++){let c=n[_],h=o/8,d=f/8;e.fillRect(i+c.x*h,s+c.y*d,c.w*h,c.h*d)}}var f1=new Map;function mL(e,n,i,s,o,f){let _=f1.get(n);_||(_=new Map,f1.set(n,_));let c=e.fillStyle;if(typeof c!="string")throw new Error(`Unexpected fillStyle type "${c}"`);let h=_.get(c);if(!h){let d=n[0].length,y=n.length,p=e.canvas.ownerDocument.createElement("canvas");p.width=d,p.height=y;let w=mn(p.getContext("2d")),C=new ImageData(d,y),T,E,g,v;if(c.startsWith("#"))T=parseInt(c.slice(1,3),16),E=parseInt(c.slice(3,5),16),g=parseInt(c.slice(5,7),16),v=c.length>7&&parseInt(c.slice(7,9),16)||1;else if(c.startsWith("rgba"))[T,E,g,v]=c.substring(5,c.length-1).split(",").map(m=>parseFloat(m));else throw new Error(`Unexpected fillStyle color format "${c}" when drawing pattern glyph`);for(let m=0;m<y;m++)for(let S=0;S<d;S++)C.data[(m*d+S)*4]=T,C.data[(m*d+S)*4+1]=E,C.data[(m*d+S)*4+2]=g,C.data[(m*d+S)*4+3]=n[m][S]*(v*255);w.putImageData(C,0,0),h=mn(e.createPattern(p,null)),_.set(c,h)}e.fillStyle=h,e.fillRect(i,s,o,f)}function _L(e,n,i,s,o,f,_){e.strokeStyle=e.fillStyle;for(let[c,h]of Object.entries(n)){e.beginPath(),e.lineWidth=_*Number.parseInt(c);let d;if(typeof h=="function"){let y=.15/f*o;d=h(.15,y)}else d=h;for(let y of d.split(" ")){let p=y[0],w=Vw[p];if(!w){console.error(`Could not find drawing instructions for "${p}"`);continue}let C=y.substring(1).split(",");!C[0]||!C[1]||w(e,Yw(C,o,f,i,s,!0,_))}e.stroke(),e.closePath()}}function vL(e,n,i,s,o,f,_,c){let h=new Path2D;h.rect(i,s,o,f),e.clip(h),e.beginPath();let d=_/12;e.lineWidth=c*d;for(let y of n.d.split(" ")){let p=y[0],w=Vw[p];if(!w){console.error(`Could not find drawing instructions for "${p}"`);continue}let C=y.substring(1).split(",");!C[0]||!C[1]||w(e,Yw(C,o,f,i,s,!1,c,(n.leftPadding??0)*(d/2),(n.rightPadding??0)*(d/2)))}n.type===1?(e.strokeStyle=e.fillStyle,e.stroke()):e.fill(),e.closePath()}function p1(e,n,i=0){return Math.max(Math.min(e,n),i)}var Vw={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 Yw(e,n,i,s,o,f,_,c=0,h=0){let d=e.map(y=>parseFloat(y)||parseInt(y));if(d.length<2)throw new Error("Too few arguments for instruction");for(let y=0;y<d.length;y+=2)d[y]*=n-c*_-h*_,f&&d[y]!==0&&(d[y]=p1(Math.round(d[y]+.5)-.5,n,0)),d[y]+=s+c*_;for(let y=1;y<d.length;y+=2)d[y]*=i,f&&d[y]!==0&&(d[y]=p1(Math.round(d[y]+.5)-.5,i,0)),d[y]+=o;return d}var g1=class{constructor(){this._data={}}set(e,n,i){this._data[e]||(this._data[e]={}),this._data[e][n]=i}get(e,n){return this._data[e]?this._data[e][n]:void 0}clear(){this._data={}}},m1=class{constructor(){this._data=new g1}set(e,n,i,s,o){this._data.get(e,n)||this._data.set(e,n,new g1),this._data.get(e,n).set(i,s,o)}get(e,n,i,s){return this._data.get(e,n)?.get(i,s)}clear(){this._data.clear()}},Xw=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,i=0,s=e.timeRemaining(),o=0;for(;this._i<this._tasks.length;){if(n=performance.now(),this._tasks[this._i]()||this._i++,n=Math.max(1,performance.now()-n),i=Math.max(n,i),o=e.timeRemaining(),i*1.5>o){s-n<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(s-n))}ms`),this._start();return}s=o}this.clear()}},bL=class extends Xw{_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())}}},yL=class extends Xw{_requestCallback(e){return requestIdleCallback(e)}_cancelCallback(e){cancelIdleCallback(e)}},SL=!mm&&"requestIdleCallback"in window?yL:bL,to=class Zw{constructor(){this.fg=0,this.bg=0,this.extended=new Jw}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 Zw;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}},Jw=class Qw{constructor(n=0,i=0){this._ext=0,this._urlId=0,this._ext=n,this._urlId=i}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 Qw(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}},wL=globalThis.performance&&typeof globalThis.performance.now=="function",xL=class ex{static create(n){return new ex(n)}constructor(n){this._now=wL&&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}},Pr;(e=>{e.None=()=>Ji.None;function n(W,I){return p(W,()=>{},0,void 0,!0,void 0,I)}e.defer=n;function i(W){return(I,Z=null,X)=>{let z=!1,q;return q=W(V=>{if(!z)return q?q.dispose():z=!0,I.call(Z,V)},null,X),z&&q.dispose(),q}}e.once=i;function s(W,I,Z){return d((X,z=null,q)=>W(V=>X.call(z,I(V)),null,q),Z)}e.map=s;function o(W,I,Z){return d((X,z=null,q)=>W(V=>{I(V),X.call(z,V)},null,q),Z)}e.forEach=o;function f(W,I,Z){return d((X,z=null,q)=>W(V=>I(V)&&X.call(z,V),null,q),Z)}e.filter=f;function _(W){return W}e.signal=_;function c(...W){return(I,Z=null,X)=>{let z=Uw(...W.map(q=>q(V=>I.call(Z,V))));return y(z,X)}}e.any=c;function h(W,I,Z,X){let z=Z;return s(W,q=>(z=I(z,q),z),X)}e.reduce=h;function d(W,I){let Z,X={onWillAddFirstListener(){Z=W(z.fire,z)},onDidRemoveLastListener(){Z?.dispose()}},z=new $t(X);return I?.add(z),z.event}function y(W,I){return I instanceof Array?I.push(W):I&&I.add(W),W}function p(W,I,Z=100,X=!1,z=!1,q,V){let j,P,D,U=0,G,Y={leakWarningThreshold:q,onWillAddFirstListener(){j=W(se=>{U++,P=I(P,se),X&&!D&&(ie.fire(P),P=void 0),G=()=>{let J=P;P=void 0,D=void 0,(!X||U>1)&&ie.fire(J),U=0},typeof Z=="number"?(clearTimeout(D),D=setTimeout(G,Z)):D===void 0&&(D=0,queueMicrotask(G))})},onWillRemoveListener(){z&&U>0&&G?.()},onDidRemoveLastListener(){G=void 0,j.dispose()}},ie=new $t(Y);return V?.add(ie),ie.event}e.debounce=p;function w(W,I=0,Z){return e.debounce(W,(X,z)=>X?(X.push(z),X):[z],I,void 0,!0,void 0,Z)}e.accumulate=w;function C(W,I=(X,z)=>X===z,Z){let X=!0,z;return f(W,q=>{let V=X||!I(q,z);return X=!1,z=q,V},Z)}e.latch=C;function T(W,I,Z){return[e.filter(W,I,Z),e.filter(W,X=>!I(X),Z)]}e.split=T;function E(W,I=!1,Z=[],X){let z=Z.slice(),q=W(P=>{z?z.push(P):j.fire(P)});X&&X.add(q);let V=()=>{z?.forEach(P=>j.fire(P)),z=null},j=new $t({onWillAddFirstListener(){q||(q=W(P=>j.fire(P)),X&&X.add(q))},onDidAddFirstListener(){z&&(I?setTimeout(V):V())},onDidRemoveLastListener(){q&&q.dispose(),q=null}});return X&&X.add(j),j.event}e.buffer=E;function g(W,I){return(Z,X,z)=>{let q=I(new m);return W(function(V){let j=q.evaluate(V);j!==v&&Z.call(X,j)},void 0,z)}}e.chain=g;let v=Symbol("HaltChainable");class m{constructor(){this.steps=[]}map(I){return this.steps.push(I),this}forEach(I){return this.steps.push(Z=>(I(Z),Z)),this}filter(I){return this.steps.push(Z=>I(Z)?Z:v),this}reduce(I,Z){let X=Z;return this.steps.push(z=>(X=I(X,z),X)),this}latch(I=(Z,X)=>Z===X){let Z=!0,X;return this.steps.push(z=>{let q=Z||!I(z,X);return Z=!1,X=z,q?z:v}),this}evaluate(I){for(let Z of this.steps)if(I=Z(I),I===v)break;return I}}function S(W,I,Z=X=>X){let X=(...j)=>V.fire(Z(...j)),z=()=>W.on(I,X),q=()=>W.removeListener(I,X),V=new $t({onWillAddFirstListener:z,onDidRemoveLastListener:q});return V.event}e.fromNodeEventEmitter=S;function k(W,I,Z=X=>X){let X=(...j)=>V.fire(Z(...j)),z=()=>W.addEventListener(I,X),q=()=>W.removeEventListener(I,X),V=new $t({onWillAddFirstListener:z,onDidRemoveLastListener:q});return V.event}e.fromDOMEventEmitter=k;function L(W){return new Promise(I=>i(W)(I))}e.toPromise=L;function R(W){let I=new $t;return W.then(Z=>{I.fire(Z)},()=>{I.fire(void 0)}).finally(()=>{I.dispose()}),I.event}e.fromPromise=R;function M(W,I){return W(Z=>I.fire(Z))}e.forward=M;function A(W,I,Z){return I(Z),W(X=>I(X))}e.runAndSubscribe=A;class B{constructor(I,Z){this._observable=I,this._counter=0,this._hasChanged=!1;let X={onWillAddFirstListener:()=>{I.addObserver(this)},onDidRemoveLastListener:()=>{I.removeObserver(this)}};this.emitter=new $t(X),Z&&Z.add(this.emitter)}beginUpdate(I){this._counter++}handlePossibleChange(I){}handleChange(I,Z){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 K(W,I){return new B(W,I).emitter.event}e.fromObservable=K;function F(W){return(I,Z,X)=>{let z=0,q=!1,V={beginUpdate(){z++},endUpdate(){z--,z===0&&(W.reportChanges(),q&&(q=!1,I.call(Z)))},handlePossibleChange(){},handleChange(){q=!0}};W.addObserver(V),W.reportChanges();let j={dispose(){W.removeObserver(V)}};return X instanceof lo?X.add(j):Array.isArray(X)&&X.push(j),j}}e.fromObservableLight=F})(Pr||={});var lg=class cg{constructor(n){this.listenerCount=0,this.invocationCount=0,this.elapsedOverall=0,this.durations=[],this.name=`${n}_${cg._idPool++}`,cg.all.add(this)}start(n){this._stopWatch=new xL,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}}};lg.all=new Set,lg._idPool=0;var CL=lg,EL=-1,tx=class nx{constructor(n,i,s=(nx._idPool++).toString(16).padStart(3,"0")){this._errorHandler=n,this.threshold=i,this.name=s,this._warnCountdown=0}dispose(){this._stacks?.clear()}check(n,i){let s=this.threshold;if(s<=0||i<s)return;this._stacks||(this._stacks=new Map);let o=this._stacks.get(n.value)||0;if(this._stacks.set(n.value,o+1),this._warnCountdown-=1,this._warnCountdown<=0){this._warnCountdown=s*.5;let[f,_]=this.getMostFrequentStack(),c=`[${this.name}] potential listener LEAK detected, having ${i} listeners already. MOST frequent listener (${_}):`;console.warn(c),console.warn(f);let h=new AL(c,f);this._errorHandler(h)}return()=>{let f=this._stacks.get(n.value)||0;this._stacks.set(n.value,f-1)}}getMostFrequentStack(){if(!this._stacks)return;let n,i=0;for(let[s,o]of this._stacks)(!n||i<o)&&(n=[s,o],i=o);return n}};tx._idPool=1;var kL=tx,TL=class ix{constructor(n){this.value=n}static create(){let n=new Error;return new ix(n.stack??"")}print(){console.warn(this.value.split(`
|
|
16
|
-
`).slice(2).join(`
|
|
17
|
-
`))}},AL=class extends Error{constructor(e,n){super(e),this.name="ListenerLeakError",this.stack=n}},RL=class extends Error{constructor(e,n){super(e),this.name="ListenerRefusalError",this.stack=n}},LL=0,Qf=class{constructor(n){this.value=n,this.id=LL++}},ML=2,NL,$t=class{constructor(n){this._size=0,this._options=n,this._leakageMon=this._options?.leakWarningThreshold?new kL(n?.onListenerError??Zf,this._options?.leakWarningThreshold??EL):void 0,this._perfMon=this._options?._profName?new CL(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??=(n,i,s)=>{if(this._leakageMon&&this._size>this._leakageMon.threshold**2){let c=`[${this._leakageMon.name}] REFUSES to accept new listeners because it exceeded its threshold by far (${this._size} vs ${this._leakageMon.threshold})`;console.warn(c);let h=this._leakageMon.getMostFrequentStack()??["UNKNOWN stack",-1],d=new RL(`${c}. HINT: Stack shows most frequent listener (${h[1]}-times)`,h[0]);return(this._options?.onListenerError||Zf)(d),Ji.None}if(this._disposed)return Ji.None;i&&(n=n.bind(i));let o=new Qf(n),f;this._leakageMon&&this._size>=Math.ceil(this._leakageMon.threshold*.2)&&(o.stack=TL.create(),f=this._leakageMon.check(o.stack,this._size+1)),this._listeners?this._listeners instanceof Qf?(this._deliveryQueue??=new OL,this._listeners=[this._listeners,o]):this._listeners.push(o):(this._options?.onWillAddFirstListener?.(this),this._listeners=o,this._options?.onDidAddFirstListener?.(this)),this._size++;let _=$n(()=>{f?.(),this._removeListener(o)});return s instanceof lo?s.add(_):Array.isArray(s)&&s.push(_),_},this._event}_removeListener(n){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 i=this._listeners,s=i.indexOf(n);if(s===-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--,i[s]=void 0;let o=this._deliveryQueue.current===this;if(this._size*ML<=i.length){let f=0;for(let _=0;_<i.length;_++)i[_]?i[f++]=i[_]:o&&(this._deliveryQueue.end--,f<this._deliveryQueue.i&&this._deliveryQueue.i--);i.length=f}}_deliver(n,i){if(!n)return;let s=this._options?.onListenerError||Zf;if(!s){n.value(i);return}try{n.value(i)}catch(o){s(o)}}_deliverQueue(n){let i=n.current._listeners;for(;n.i<n.end;)this._deliver(i[n.i++],n.value);n.reset()}fire(n){if(this._deliveryQueue?.current&&(this._deliverQueue(this._deliveryQueue),this._perfMon?.stop()),this._perfMon?.start(this._size),this._listeners)if(this._listeners instanceof Qf)this._deliver(this._listeners,n);else{let i=this._deliveryQueue;i.enqueue(this,n,this._listeners.length),this._deliverQueue(i)}this._perfMon?.stop()}hasListeners(){return this._size>0}},OL=class{constructor(){this.i=-1,this.end=0}enqueue(e,n,i){this.i=0,this.end=i,this.current=e,this.value=n}reset(){this.i=this.end,this.current=void 0,this.value=void 0}},_1={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}},yl=2,Sl,vs=class Xa{constructor(n,i,s){this._document=n,this._config=i,this._unicodeService=s,this._didWarmUp=!1,this._cacheMap=new m1,this._cacheMapCombined=new m1,this._pages=[],this._activePages=[],this._workBoundingBox={top:0,left:0,bottom:0,right:0},this._workAttributeData=new to,this._textureSize=512,this._onAddTextureAtlasCanvas=new $t,this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event,this._onRemoveTextureAtlasCanvas=new $t,this.onRemoveTextureAtlasCanvas=this._onRemoveTextureAtlasCanvas.event,this._requestClearModel=!1,this._createNewPage(),this._tmpCanvas=rx(n,this._config.deviceCellWidth*4+yl*2,this._config.deviceCellHeight+yl*2),this._tmpCtx=mn(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 SL;for(let i=33;i<126;i++)n.enqueue(()=>{if(!this._cacheMap.get(i,0,0,0)){let s=this._drawToCache(i,0,0,0,!1,void 0);this._cacheMap.set(i,0,0,0,s)}})}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(Xa.maxAtlasPages&&this._pages.length>=Math.max(4,Xa.maxAtlasPages)){let i=this._pages.filter(d=>d.canvas.width*2<=(Xa.maxTextureSize||4096)).sort((d,y)=>y.canvas.width!==d.canvas.width?y.canvas.width-d.canvas.width:y.percentageUsed-d.percentageUsed),s=-1,o=0;for(let d=0;d<i.length;d++)if(i[d].canvas.width!==o)s=d,o=i[d].canvas.width;else if(d-s===3)break;let f=i.slice(s,s+4),_=f.map(d=>d.glyphs[0].texturePage).sort((d,y)=>d>y?1:-1),c=this.pages.length-f.length,h=this._mergePages(f,c);h.version++;for(let d=_.length-1;d>=0;d--)this._deletePage(_[d]);this.pages.push(h),this._requestClearModel=!0,this._onAddTextureAtlasCanvas.fire(h.canvas)}let n=new ep(this._document,this._textureSize);return this._pages.push(n),this._activePages.push(n),this._onAddTextureAtlasCanvas.fire(n.canvas),n}_mergePages(n,i){let s=n[0].canvas.width*2,o=new ep(this._document,s,n);for(let[f,_]of n.entries()){let c=f*_.canvas.width%s,h=Math.floor(f/2)*_.canvas.height;o.ctx.drawImage(_.canvas,c,h);for(let y of _.glyphs)y.texturePage=i,y.sizeClipSpace.x=y.size.x/s,y.sizeClipSpace.y=y.size.y/s,y.texturePosition.x+=c,y.texturePosition.y+=h,y.texturePositionClipSpace.x=y.texturePosition.x/s,y.texturePositionClipSpace.y=y.texturePosition.y/s;this._onRemoveTextureAtlasCanvas.fire(_.canvas);let d=this._activePages.indexOf(_);d!==-1&&this._activePages.splice(d,1)}return o}_deletePage(n){this._pages.splice(n,1);for(let i=n;i<this._pages.length;i++){let s=this._pages[i];for(let o of s.glyphs)o.texturePage--;s.version++}}getRasterizedGlyphCombinedChar(n,i,s,o,f,_){return this._getFromCacheMap(this._cacheMapCombined,n,i,s,o,f,_)}getRasterizedGlyph(n,i,s,o,f,_){return this._getFromCacheMap(this._cacheMap,n,i,s,o,f,_)}_getFromCacheMap(n,i,s,o,f,_,c){return Sl=n.get(i,s,o,f),Sl||(Sl=this._drawToCache(i,s,o,f,_,c),n.set(i,s,o,f,Sl)),Sl}_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,i,s,o){if(this._config.allowTransparency)return ji;let f;switch(n){case 16777216:case 33554432:f=this._getColorFromAnsiIndex(i);break;case 50331648:let _=to.toColorRGB(i);f=Kn.toColor(_[0],_[1],_[2]);break;default:s?f=Ol.opaque(this._config.colors.foreground):f=this._config.colors.background;break}return this._config.allowTransparency||(f=Ol.opaque(f)),f}_getForegroundColor(n,i,s,o,f,_,c,h,d,y){let p=this._getMinimumContrastColor(n,i,s,o,f,_,c,d,h,y);if(p)return p;let w;switch(f){case 16777216:case 33554432:this._config.drawBoldTextInBrightColors&&d&&_<8&&(_+=8),w=this._getColorFromAnsiIndex(_);break;case 50331648:let C=to.toColorRGB(_);w=Kn.toColor(C[0],C[1],C[2]);break;default:c?w=this._config.colors.background:w=this._config.colors.foreground}return this._config.allowTransparency&&(w=Ol.opaque(w)),h&&(w=Ol.multiplyOpacity(w,uL)),w}_resolveBackgroundRgba(n,i,s){switch(n){case 16777216:case 33554432:return this._getColorFromAnsiIndex(i).rgba;case 50331648:return i<<8;default:return s?this._config.colors.foreground.rgba:this._config.colors.background.rgba}}_resolveForegroundRgba(n,i,s,o){switch(n){case 16777216:case 33554432:return this._config.drawBoldTextInBrightColors&&o&&i<8&&(i+=8),this._getColorFromAnsiIndex(i).rgba;case 50331648:return i<<8;default:return s?this._config.colors.background.rgba:this._config.colors.foreground.rgba}}_getMinimumContrastColor(n,i,s,o,f,_,c,h,d,y){if(this._config.minimumContrastRatio===1||y)return;let p=this._getContrastCache(d),w=p.getColor(n,o);if(w!==void 0)return w||void 0;let C=this._resolveBackgroundRgba(i,s,c),T=this._resolveForegroundRgba(f,_,c,h),E=ta.ensureContrastRatio(C,T,this._config.minimumContrastRatio/(d?2:1));if(!E){p.setColor(n,o,null);return}let g=Kn.toColor(E>>24&255,E>>16&255,E>>8&255);return p.setColor(n,o,g),g}_getContrastCache(n){return n?this._config.colors.halfContrastCache:this._config.colors.contrastCache}_drawToCache(n,i,s,o,f,_){let c=typeof n=="number"?String.fromCharCode(n):n;_&&this._tmpCanvas.parentElement!==_&&(this._tmpCanvas.style.display="none",_.append(this._tmpCanvas));let h=Math.min(this._config.deviceCellWidth*Math.max(c.length,2)+yl*2,this._config.deviceMaxTextureSize);this._tmpCanvas.width<h&&(this._tmpCanvas.width=h);let d=Math.min(this._config.deviceCellHeight+yl*4,this._textureSize);if(this._tmpCanvas.height<d&&(this._tmpCanvas.height=d),this._tmpCtx.save(),this._workAttributeData.fg=s,this._workAttributeData.bg=i,this._workAttributeData.extended.ext=o,!!this._workAttributeData.isInvisible())return _1;let y=!!this._workAttributeData.isBold(),p=!!this._workAttributeData.isInverse(),w=!!this._workAttributeData.isDim(),C=!!this._workAttributeData.isItalic(),T=!!this._workAttributeData.isUnderline(),E=!!this._workAttributeData.isStrikethrough(),g=!!this._workAttributeData.isOverline(),v=this._workAttributeData.getFgColor(),m=this._workAttributeData.getFgColorMode(),S=this._workAttributeData.getBgColor(),k=this._workAttributeData.getBgColorMode();if(p){let P=v;v=S,S=P;let D=m;m=k,k=D}let L=this._getBackgroundColor(k,S,p,w);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=C?"italic":"";this._tmpCtx.font=`${M} ${R} ${this._config.fontSize*this._config.devicePixelRatio}px ${this._config.fontFamily}`,this._tmpCtx.textBaseline=Kw;let A=c.length===1&&_m(c.charCodeAt(0)),B=c.length===1&&nL(c.charCodeAt(0)),K=this._getForegroundColor(i,k,S,s,m,v,p,w,y,qw(c.charCodeAt(0)));this._tmpCtx.fillStyle=K.css;let F=B?0:yl*2,W=!1;this._config.customGlyphs!==!1&&(W=pL(this._tmpCtx,c,F,F,this._config.deviceCellWidth,this._config.deviceCellHeight,this._config.fontSize,this._config.devicePixelRatio));let I=!A,Z;if(typeof n=="number"?Z=this._unicodeService.wcwidth(n):Z=this._unicodeService.getStringCellWidth(n),T){this._tmpCtx.save();let P=Math.max(1,Math.floor(this._config.fontSize*this._config.devicePixelRatio/15)),D=P%2===1?.5:0;if(this._tmpCtx.lineWidth=P,this._workAttributeData.isUnderlineColorDefault())this._tmpCtx.strokeStyle=this._tmpCtx.fillStyle;else if(this._workAttributeData.isUnderlineColorRGB())I=!1,this._tmpCtx.strokeStyle=`rgb(${to.toColorRGB(this._workAttributeData.getUnderlineColor()).join(",")})`;else{I=!1;let J=this._workAttributeData.getUnderlineColor();this._config.drawBoldTextInBrightColors&&this._workAttributeData.isBold()&&J<8&&(J+=8),this._tmpCtx.strokeStyle=this._getColorFromAnsiIndex(J).css}this._tmpCtx.beginPath();let U=F,G=Math.ceil(F+this._config.deviceCharHeight)-D-(f?P*2:0),Y=G+P,ie=G+P*2,se=this._workAttributeData.getUnderlineVariantOffset();for(let J=0;J<Z;J++){this._tmpCtx.save();let H=U+J*this._config.deviceCellWidth,ae=U+(J+1)*this._config.deviceCellWidth,de=H+this._config.deviceCellWidth/2;switch(this._workAttributeData.extended.underlineStyle){case 2:this._tmpCtx.moveTo(H,G),this._tmpCtx.lineTo(ae,G),this._tmpCtx.moveTo(H,ie),this._tmpCtx.lineTo(ae,ie);break;case 3:let we=P<=1?ie:Math.ceil(F+this._config.deviceCharHeight-P/2)-D,ye=P<=1?G:Math.ceil(F+this._config.deviceCharHeight+P/2)-D,Le=new Path2D;Le.rect(H,G,this._config.deviceCellWidth,ie-G),this._tmpCtx.clip(Le),this._tmpCtx.moveTo(H-this._config.deviceCellWidth/2,Y),this._tmpCtx.bezierCurveTo(H-this._config.deviceCellWidth/2,ye,H,ye,H,Y),this._tmpCtx.bezierCurveTo(H,we,de,we,de,Y),this._tmpCtx.bezierCurveTo(de,ye,ae,ye,ae,Y),this._tmpCtx.bezierCurveTo(ae,we,ae+this._config.deviceCellWidth/2,we,ae+this._config.deviceCellWidth/2,Y);break;case 4:let Oe=se===0?0:se>=P?P*2-se:P-se;se>=P||Oe===0?(this._tmpCtx.setLineDash([Math.round(P),Math.round(P)]),this._tmpCtx.moveTo(H+Oe,G),this._tmpCtx.lineTo(ae,G)):(this._tmpCtx.setLineDash([Math.round(P),Math.round(P)]),this._tmpCtx.moveTo(H,G),this._tmpCtx.lineTo(H+Oe,G),this._tmpCtx.moveTo(H+Oe+P,G),this._tmpCtx.lineTo(ae,G)),se=lL(ae-H,P,se);break;case 5:let Fe=.6,ut=.3,Me=ae-H,Rt=Math.floor(Fe*Me),Xt=Math.floor(ut*Me),vn=Me-Rt-Xt;this._tmpCtx.setLineDash([Rt,Xt,vn]),this._tmpCtx.moveTo(H,G),this._tmpCtx.lineTo(ae,G);break;default:this._tmpCtx.moveTo(H,G),this._tmpCtx.lineTo(ae,G);break}this._tmpCtx.stroke(),this._tmpCtx.restore()}if(this._tmpCtx.restore(),!W&&this._config.fontSize>=12&&!this._config.allowTransparency&&c!==" "){this._tmpCtx.save(),this._tmpCtx.textBaseline="alphabetic";let J=this._tmpCtx.measureText(c);if(this._tmpCtx.restore(),"actualBoundingBoxDescent"in J&&J.actualBoundingBoxDescent>0){this._tmpCtx.save();let H=new Path2D;H.rect(U,G-Math.ceil(P/2),this._config.deviceCellWidth*Z,ie-G+Math.ceil(P/2)),this._tmpCtx.clip(H),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(g){let P=Math.max(1,Math.floor(this._config.fontSize*this._config.devicePixelRatio/15)),D=P%2===1?.5:0;this._tmpCtx.lineWidth=P,this._tmpCtx.strokeStyle=this._tmpCtx.fillStyle,this._tmpCtx.beginPath(),this._tmpCtx.moveTo(F,F+D),this._tmpCtx.lineTo(F+this._config.deviceCharWidth*Z,F+D),this._tmpCtx.stroke()}if(W||this._tmpCtx.fillText(c,F,F+this._config.deviceCharHeight),c==="_"&&!this._config.allowTransparency){let P=tp(this._tmpCtx.getImageData(F,F,this._config.deviceCellWidth,this._config.deviceCellHeight),L,K,I);if(P)for(let D=1;D<=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-D),P=tp(this._tmpCtx.getImageData(F,F,this._config.deviceCellWidth,this._config.deviceCellHeight),L,K,I),!!P);D++);}if(E){let P=Math.max(1,Math.floor(this._config.fontSize*this._config.devicePixelRatio/10)),D=this._tmpCtx.lineWidth%2===1?.5:0;this._tmpCtx.lineWidth=P,this._tmpCtx.strokeStyle=this._tmpCtx.fillStyle,this._tmpCtx.beginPath(),this._tmpCtx.moveTo(F,F+Math.floor(this._config.deviceCharHeight/2)-D),this._tmpCtx.lineTo(F+this._config.deviceCharWidth*Z,F+Math.floor(this._config.deviceCharHeight/2)-D),this._tmpCtx.stroke()}this._tmpCtx.restore();let X=this._tmpCtx.getImageData(0,0,this._tmpCanvas.width,this._tmpCanvas.height),z;if(this._config.allowTransparency?z=DL(X):z=tp(X,L,K,I),z)return _1;let q=this._findGlyphBoundingBox(X,this._workBoundingBox,h,B,W,F),V,j;for(;;){if(this._activePages.length===0){let P=this._createNewPage();V=P,j=P.currentRow,j.height=q.size.y;break}V=this._activePages[this._activePages.length-1],j=V.currentRow;for(let P of this._activePages)q.size.y<=P.currentRow.height&&(V=P,j=P.currentRow);for(let P=this._activePages.length-1;P>=0;P--)for(let D of this._activePages[P].fixedRows)D.height<=j.height&&q.size.y<=D.height&&(V=this._activePages[P],j=D);if(q.size.x>this._textureSize){this._overflowSizePage||(this._overflowSizePage=new ep(this._document,this._config.deviceMaxTextureSize),this.pages.push(this._overflowSizePage),this._requestClearModel=!0,this._onAddTextureAtlasCanvas.fire(this._overflowSizePage.canvas)),V=this._overflowSizePage,j=this._overflowSizePage.currentRow,j.x+q.size.x>=V.canvas.width&&(j.x=0,j.y+=j.height,j.height=0);break}if(j.y+q.size.y>=V.canvas.height||j.height>q.size.y+2){let P=!1;if(V.currentRow.y+V.currentRow.height+q.size.y>=V.canvas.height){let D;for(let U of this._activePages)if(U.currentRow.y+U.currentRow.height+q.size.y<U.canvas.height){D=U;break}if(D)V=D;else if(Xa.maxAtlasPages&&this._pages.length>=Xa.maxAtlasPages&&j.y+q.size.y<=V.canvas.height&&j.height>=q.size.y&&j.x+q.size.x<=V.canvas.width)P=!0;else{let U=this._createNewPage();V=U,j=U.currentRow,j.height=q.size.y,P=!0}}P||(V.currentRow.height>0&&V.fixedRows.push(V.currentRow),j={x:0,y:V.currentRow.y+V.currentRow.height,height:q.size.y},V.fixedRows.push(j),V.currentRow={x:0,y:j.y+j.height,height:0})}if(j.x+q.size.x<=V.canvas.width)break;j===V.currentRow?(j.x=0,j.y+=j.height,j.height=0):V.fixedRows.splice(V.fixedRows.indexOf(j),1)}return q.texturePage=this._pages.indexOf(V),q.texturePosition.x=j.x,q.texturePosition.y=j.y,q.texturePositionClipSpace.x=j.x/V.canvas.width,q.texturePositionClipSpace.y=j.y/V.canvas.height,q.sizeClipSpace.x/=V.canvas.width,q.sizeClipSpace.y/=V.canvas.height,j.height=Math.max(j.height,q.size.y),j.x+=q.size.x,V.ctx.putImageData(X,q.texturePosition.x-this._workBoundingBox.left,q.texturePosition.y-this._workBoundingBox.top,this._workBoundingBox.left,this._workBoundingBox.top,q.size.x,q.size.y),V.addGlyph(q),V.version++,q}_findGlyphBoundingBox(n,i,s,o,f,_){i.top=0;let c=o?this._config.deviceCellHeight:this._tmpCanvas.height,h=o?this._config.deviceCellWidth:s,d=!1;for(let y=0;y<c;y++){for(let p=0;p<h;p++){let w=y*this._tmpCanvas.width*4+p*4+3;if(n.data[w]!==0){i.top=y,d=!0;break}}if(d)break}i.left=0,d=!1;for(let y=0;y<_+h;y++){for(let p=0;p<c;p++){let w=p*this._tmpCanvas.width*4+y*4+3;if(n.data[w]!==0){i.left=y,d=!0;break}}if(d)break}i.right=h,d=!1;for(let y=_+h-1;y>=_;y--){for(let p=0;p<c;p++){let w=p*this._tmpCanvas.width*4+y*4+3;if(n.data[w]!==0){i.right=y,d=!0;break}}if(d)break}i.bottom=c,d=!1;for(let y=c-1;y>=0;y--){for(let p=0;p<h;p++){let w=y*this._tmpCanvas.width*4+p*4+3;if(n.data[w]!==0){i.bottom=y,d=!0;break}}if(d)break}return{texturePage:0,texturePosition:{x:0,y:0},texturePositionClipSpace:{x:0,y:0},size:{x:i.right-i.left+1,y:i.bottom-i.top+1},sizeClipSpace:{x:i.right-i.left+1,y:i.bottom-i.top+1},offset:{x:-i.left+_+(o||f?Math.floor((this._config.deviceCellWidth-this._config.deviceCharWidth)/2):0),y:-i.top+_+(o||f?this._config.lineHeight===1?0:Math.round((this._config.deviceCellHeight-this._config.deviceCharHeight)/2):0)}}}},ep=class{constructor(e,n,i){if(this._usedPixels=0,this._glyphs=[],this.version=0,this.currentRow={x:0,y:0,height:0},this.fixedRows=[],i)for(let s of i)this._glyphs.push(...s.glyphs),this._usedPixels+=s._usedPixels;this.canvas=rx(e,n,n),this.ctx=mn(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 tp(e,n,i,s){let o=n.rgba>>>24,f=n.rgba>>>16&255,_=n.rgba>>>8&255,c=i.rgba>>>24,h=i.rgba>>>16&255,d=i.rgba>>>8&255,y=Math.floor((Math.abs(o-c)+Math.abs(f-h)+Math.abs(_-d))/12),p=!0;for(let w=0;w<e.data.length;w+=4)e.data[w]===o&&e.data[w+1]===f&&e.data[w+2]===_||s&&Math.abs(e.data[w]-o)+Math.abs(e.data[w+1]-f)+Math.abs(e.data[w+2]-_)<y?e.data[w+3]=0:p=!1;return p}function DL(e){for(let n=0;n<e.data.length;n+=4)if(e.data[n+3]>0)return!1;return!0}function rx(e,n,i){let s=e.createElement("canvas");return s.width=n,s.height=i,s}function jL(e,n,i,s,o,f,_,c){let h={foreground:f.foreground,background:f.background,cursor:ji,cursorAccent:ji,selectionForeground:ji,selectionBackgroundTransparent:ji,selectionBackgroundOpaque:ji,selectionInactiveBackgroundTransparent:ji,selectionInactiveBackgroundOpaque:ji,overviewRulerBorder:ji,scrollbarSliderBackground:ji,scrollbarSliderHoverBackground:ji,scrollbarSliderActiveBackground:ji,ansi:f.ansi.slice(),contrastCache:f.contrastCache,halfContrastCache:f.halfContrastCache};return{customGlyphs:o.customGlyphs,devicePixelRatio:_,deviceMaxTextureSize:c,letterSpacing:o.letterSpacing,lineHeight:o.lineHeight,deviceCellWidth:e,deviceCellHeight:n,deviceCharWidth:i,deviceCharHeight:s,fontFamily:o.fontFamily,fontSize:o.fontSize,fontWeight:o.fontWeight,fontWeightBold:o.fontWeightBold,allowTransparency:o.allowTransparency,drawBoldTextInBrightColors:o.drawBoldTextInBrightColors,minimumContrastRatio:o.minimumContrastRatio,colors:h}}function v1(e,n){for(let i=0;i<e.colors.ansi.length;i++)if(e.colors.ansi[i].rgba!==n.colors.ansi[i].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 IL(e){return(e&50331648)===16777216||(e&50331648)===33554432}var Pi=[];function sx(e,n,i,s,o,f,_,c,h){let d=jL(s,o,f,_,n,i,c,h);for(let w=0;w<Pi.length;w++){let C=Pi[w],T=C.ownedBy.indexOf(e);if(T>=0){if(v1(C.config,d))return C.atlas;C.ownedBy.length===1?(C.atlas.dispose(),Pi.splice(w,1)):C.ownedBy.splice(T,1);break}}for(let w=0;w<Pi.length;w++){let C=Pi[w];if(v1(C.config,d))return C.ownedBy.push(e),C.atlas}let y=e._core,p={atlas:new vs(document,d,y.unicodeService),config:d,ownedBy:[e]};return Pi.push(p),p.atlas}function b1(e){for(let n=0;n<Pi.length;n++){let i=Pi[n].ownedBy.indexOf(e);if(i!==-1){Pi[n].ownedBy.length===1?(Pi[n].atlas.dispose(),Pi.splice(n,1)):Pi[n].ownedBy.splice(i,1);break}}}var Eu=600,BL=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=Eu){this._blinkInterval&&(this._coreBrowserService.window.clearInterval(this._blinkInterval),this._blinkInterval=void 0),this._blinkStartTimeout=this._coreBrowserService.window.setTimeout(()=>{if(this._animationTimeRestarted){let n=Eu-(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=Eu-(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})},Eu)},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 y1(e,n,i){let s=new n.ResizeObserver(o=>{let f=o.find(h=>h.target===e);if(!f)return;if(!("devicePixelContentBoxSize"in f)){s?.disconnect(),s=void 0;return}let _=f.devicePixelContentBoxSize[0].inlineSize,c=f.devicePixelContentBoxSize[0].blockSize;_>0&&c>0&&i(_,c)});try{s.observe(e,{box:["device-pixel-content-box"]})}catch{s.disconnect(),s=void 0}return $n(()=>s?.disconnect())}function PL(e){return e>65535?(e-=65536,String.fromCharCode((e>>10)+55296)+String.fromCharCode(e%1024+56320)):String.fromCharCode(e)}var S1=class ax extends to{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new Jw,this.combinedData=""}static fromCharData(n){let i=new ax;return i.setFromCharData(n),i}isCombined(){return this.content&2097152}getWidth(){return this.content>>22}getChars(){return this.content&2097152?this.combinedData:this.content&2097151?PL(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 i=!1;if(n[1].length>2)i=!0;else if(n[1].length===2){let s=n[1].charCodeAt(0);if(55296<=s&&s<=56319){let o=n[1].charCodeAt(1);56320<=o&&o<=57343?this.content=(s-55296)*1024+o-56320+65536|n[2]<<22:i=!0}else i=!0}else this.content=n[1].charCodeAt(0)|n[2]<<22;i&&(this.combinedData=n[1],this.content=2097152|n[2]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}},ox=new Float32Array([2,0,0,0,0,-2,0,0,0,0,1,0,-1,1,0,1]);function lx(e,n,i){let s=mn(e.createProgram());if(e.attachShader(s,mn(w1(e,e.VERTEX_SHADER,n))),e.attachShader(s,mn(w1(e,e.FRAGMENT_SHADER,i))),e.linkProgram(s),e.getProgramParameter(s,e.LINK_STATUS))return s;console.error(e.getProgramInfoLog(s)),e.deleteProgram(s)}function w1(e,n,i){let s=mn(e.createShader(n));if(e.shaderSource(s,i),e.compileShader(s),e.getShaderParameter(s,e.COMPILE_STATUS))return s;console.error(e.getShaderInfoLog(s)),e.deleteShader(s)}function zL(e,n){let i=Math.min(e.length*2,n),s=new Float32Array(i);for(let o=0;o<e.length;o++)s[o]=e[o];return s}var HL=class{constructor(e){this.texture=e,this.version=-1}},$L=`#version 300 es
|
|
18
|
-
layout (location = 0) in vec2 a_unitquad;
|
|
19
|
-
layout (location = 1) in vec2 a_cellpos;
|
|
20
|
-
layout (location = 2) in vec2 a_offset;
|
|
21
|
-
layout (location = 3) in vec2 a_size;
|
|
22
|
-
layout (location = 4) in float a_texpage;
|
|
23
|
-
layout (location = 5) in vec2 a_texcoord;
|
|
24
|
-
layout (location = 6) in vec2 a_texsize;
|
|
25
|
-
|
|
26
|
-
uniform mat4 u_projection;
|
|
27
|
-
uniform vec2 u_resolution;
|
|
28
|
-
|
|
29
|
-
out vec2 v_texcoord;
|
|
30
|
-
flat out int v_texpage;
|
|
31
|
-
|
|
32
|
-
void main() {
|
|
33
|
-
vec2 zeroToOne = (a_offset / u_resolution) + a_cellpos + (a_unitquad * a_size);
|
|
34
|
-
gl_Position = u_projection * vec4(zeroToOne, 0.0, 1.0);
|
|
35
|
-
v_texpage = int(a_texpage);
|
|
36
|
-
v_texcoord = a_texcoord + a_unitquad * a_texsize;
|
|
37
|
-
}`;function UL(e){let n="";for(let i=1;i<e;i++)n+=` else if (v_texpage == ${i}) { outColor = texture(u_texture[${i}], v_texcoord); }`;return`#version 300 es
|
|
38
|
-
precision lowp float;
|
|
39
|
-
|
|
40
|
-
in vec2 v_texcoord;
|
|
41
|
-
flat in int v_texpage;
|
|
42
|
-
|
|
43
|
-
uniform sampler2D u_texture[${e}];
|
|
44
|
-
|
|
45
|
-
out vec4 outColor;
|
|
46
|
-
|
|
47
|
-
void main() {
|
|
48
|
-
if (v_texpage == 0) {
|
|
49
|
-
outColor = texture(u_texture[0], v_texcoord);
|
|
50
|
-
} ${n}
|
|
51
|
-
}`}var bs=11,Ga=bs*Float32Array.BYTES_PER_ELEMENT,FL=2,nn=0,Ht,np=0,wl=0,WL=class extends Ji{constructor(e,n,i,s){super(),this._terminal=e,this._gl=n,this._dimensions=i,this._optionsService=s,this._activeBuffer=0,this._vertices={count:0,attributes:new Float32Array(0),attributesBuffers:[new Float32Array(0),new Float32Array(0)]};let o=this._gl;vs.maxAtlasPages===void 0&&(vs.maxAtlasPages=Math.min(32,mn(o.getParameter(o.MAX_TEXTURE_IMAGE_UNITS))),vs.maxTextureSize=mn(o.getParameter(o.MAX_TEXTURE_SIZE))),this._program=mn(lx(o,$L,UL(vs.maxAtlasPages))),this._register($n(()=>o.deleteProgram(this._program))),this._projectionLocation=mn(o.getUniformLocation(this._program,"u_projection")),this._resolutionLocation=mn(o.getUniformLocation(this._program,"u_resolution")),this._textureLocation=mn(o.getUniformLocation(this._program,"u_texture")),this._vertexArrayObject=o.createVertexArray(),o.bindVertexArray(this._vertexArrayObject);let f=new Float32Array([0,0,1,0,0,1,1,1]),_=o.createBuffer();this._register($n(()=>o.deleteBuffer(_))),o.bindBuffer(o.ARRAY_BUFFER,_),o.bufferData(o.ARRAY_BUFFER,f,o.STATIC_DRAW),o.enableVertexAttribArray(0),o.vertexAttribPointer(0,2,this._gl.FLOAT,!1,0,0);let c=new Uint8Array([0,1,2,3]),h=o.createBuffer();this._register($n(()=>o.deleteBuffer(h))),o.bindBuffer(o.ELEMENT_ARRAY_BUFFER,h),o.bufferData(o.ELEMENT_ARRAY_BUFFER,c,o.STATIC_DRAW),this._attributesBuffer=mn(o.createBuffer()),this._register($n(()=>o.deleteBuffer(this._attributesBuffer))),o.bindBuffer(o.ARRAY_BUFFER,this._attributesBuffer),o.enableVertexAttribArray(2),o.vertexAttribPointer(2,2,o.FLOAT,!1,Ga,0),o.vertexAttribDivisor(2,1),o.enableVertexAttribArray(3),o.vertexAttribPointer(3,2,o.FLOAT,!1,Ga,2*Float32Array.BYTES_PER_ELEMENT),o.vertexAttribDivisor(3,1),o.enableVertexAttribArray(4),o.vertexAttribPointer(4,1,o.FLOAT,!1,Ga,4*Float32Array.BYTES_PER_ELEMENT),o.vertexAttribDivisor(4,1),o.enableVertexAttribArray(5),o.vertexAttribPointer(5,2,o.FLOAT,!1,Ga,5*Float32Array.BYTES_PER_ELEMENT),o.vertexAttribDivisor(5,1),o.enableVertexAttribArray(6),o.vertexAttribPointer(6,2,o.FLOAT,!1,Ga,7*Float32Array.BYTES_PER_ELEMENT),o.vertexAttribDivisor(6,1),o.enableVertexAttribArray(1),o.vertexAttribPointer(1,2,o.FLOAT,!1,Ga,9*Float32Array.BYTES_PER_ELEMENT),o.vertexAttribDivisor(1,1),o.useProgram(this._program);let d=new Int32Array(vs.maxAtlasPages);for(let y=0;y<vs.maxAtlasPages;y++)d[y]=y;o.uniform1iv(this._textureLocation,d),o.uniformMatrix4fv(this._projectionLocation,!1,ox),this._atlasTextures=[];for(let y=0;y<vs.maxAtlasPages;y++){let p=new HL(mn(o.createTexture()));this._register($n(()=>o.deleteTexture(p.texture))),o.activeTexture(o.TEXTURE0+y),o.bindTexture(o.TEXTURE_2D,p.texture),o.texParameteri(o.TEXTURE_2D,o.TEXTURE_WRAP_S,o.CLAMP_TO_EDGE),o.texParameteri(o.TEXTURE_2D,o.TEXTURE_WRAP_T,o.CLAMP_TO_EDGE),o.texImage2D(o.TEXTURE_2D,0,o.RGBA,1,1,0,o.RGBA,o.UNSIGNED_BYTE,new Uint8Array([255,0,0,255])),this._atlasTextures[y]=p}o.enable(o.BLEND),o.blendFunc(o.SRC_ALPHA,o.ONE_MINUS_SRC_ALPHA),this.handleResize()}beginFrame(){return this._atlas?this._atlas.beginFrame():!0}updateCell(e,n,i,s,o,f,_,c,h){this._updateCell(this._vertices.attributes,e,n,i,s,o,f,_,c,h)}_updateCell(e,n,i,s,o,f,_,c,h,d){if(nn=(i*this._terminal.cols+n)*bs,s===0||s===void 0){e.fill(0,nn,nn+bs-1-FL);return}this._atlas&&(c&&c.length>1?Ht=this._atlas.getRasterizedGlyphCombinedChar(c,o,f,_,!1,this._terminal.element):Ht=this._atlas.getRasterizedGlyph(s,o,f,_,!1,this._terminal.element),np=Math.floor((this._dimensions.device.cell.width-this._dimensions.device.char.width)/2),o!==d&&Ht.offset.x>np?(wl=Ht.offset.x-np,e[nn]=-(Ht.offset.x-wl)+this._dimensions.device.char.left,e[nn+1]=-Ht.offset.y+this._dimensions.device.char.top,e[nn+2]=(Ht.size.x-wl)/this._dimensions.device.canvas.width,e[nn+3]=Ht.size.y/this._dimensions.device.canvas.height,e[nn+4]=Ht.texturePage,e[nn+5]=Ht.texturePositionClipSpace.x+wl/this._atlas.pages[Ht.texturePage].canvas.width,e[nn+6]=Ht.texturePositionClipSpace.y,e[nn+7]=Ht.sizeClipSpace.x-wl/this._atlas.pages[Ht.texturePage].canvas.width,e[nn+8]=Ht.sizeClipSpace.y):(e[nn]=-Ht.offset.x+this._dimensions.device.char.left,e[nn+1]=-Ht.offset.y+this._dimensions.device.char.top,e[nn+2]=Ht.size.x/this._dimensions.device.canvas.width,e[nn+3]=Ht.size.y/this._dimensions.device.canvas.height,e[nn+4]=Ht.texturePage,e[nn+5]=Ht.texturePositionClipSpace.x,e[nn+6]=Ht.texturePositionClipSpace.y,e[nn+7]=Ht.sizeClipSpace.x,e[nn+8]=Ht.sizeClipSpace.y),this._optionsService.rawOptions.rescaleOverlappingGlyphs&&aL(s,h,Ht.size.x,this._dimensions.device.cell.width)&&(e[nn+2]=(this._dimensions.device.cell.width-1)/this._dimensions.device.canvas.width))}clear(){let e=this._terminal,n=e.cols*e.rows*bs;this._vertices.count!==n?this._vertices.attributes=new Float32Array(n):this._vertices.attributes.fill(0);let i=0;for(;i<this._vertices.attributesBuffers.length;i++)this._vertices.count!==n?this._vertices.attributesBuffers[i]=new Float32Array(n):this._vertices.attributesBuffers[i].fill(0);this._vertices.count=n,i=0;for(let s=0;s<e.rows;s++)for(let o=0;o<e.cols;o++)this._vertices.attributes[i+9]=o/e.cols,this._vertices.attributes[i+10]=s/e.rows,i+=bs}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 i=this._vertices.attributesBuffers[this._activeBuffer],s=0;for(let o=0;o<e.lineLengths.length;o++){let f=o*this._terminal.cols*bs,_=this._vertices.attributes.subarray(f,f+e.lineLengths[o]*bs);i.set(_,s),s+=_.length}n.bindBuffer(n.ARRAY_BUFFER,this._attributesBuffer),n.bufferData(n.ARRAY_BUFFER,i.subarray(0,s),n.STREAM_DRAW);for(let o=0;o<this._atlas.pages.length;o++)this._atlas.pages[o].version!==this._atlasTextures[o].version&&this._bindAtlasPageTexture(n,this._atlas,o);n.drawElementsInstanced(n.TRIANGLE_STRIP,4,n.UNSIGNED_BYTE,0,s/bs)}setAtlas(e){this._atlas=e;for(let n of this._atlasTextures)n.version=-1}_bindAtlasPageTexture(e,n,i){e.activeTexture(e.TEXTURE0+i),e.bindTexture(e.TEXTURE_2D,this._atlasTextures[i].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[i].canvas),e.generateMipmap(e.TEXTURE_2D),this._atlasTextures[i].version=n.pages[i].version}setDimensions(e){this._dimensions=e}},GL=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,i,s=!1){if(this.selectionStart=n,this.selectionEnd=i,!n||!i||n[0]===i[0]&&n[1]===i[1]){this.clear();return}let o=e.buffers.active.ydisp,f=n[1]-o,_=i[1]-o,c=Math.max(f,0),h=Math.min(_,e.rows-1);if(c>=e.rows||h<0){this.clear();return}this.hasSelection=!0,this.columnSelectMode=s,this.viewportStartRow=f,this.viewportEndRow=_,this.viewportCappedStartRow=c,this.viewportCappedEndRow=h,this.startCol=n[0],this.endCol=i[0]}isCellSelected(e,n,i){return this.hasSelection?(i-=e.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?n>=this.startCol&&i>=this.viewportCappedStartRow&&n<this.endCol&&i<=this.viewportCappedEndRow:n<this.startCol&&i>=this.viewportCappedStartRow&&n>=this.endCol&&i<=this.viewportCappedEndRow:i>this.viewportStartRow&&i<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&i===this.viewportStartRow&&n>=this.startCol&&n<this.endCol||this.viewportStartRow<this.viewportEndRow&&i===this.viewportEndRow&&n<this.endCol||this.viewportStartRow<this.viewportEndRow&&i===this.viewportStartRow&&n>=this.startCol):!1}};function qL(){return new GL}var rh=4,Fu=1,Wu=2,ip=3,KL=2147483648,VL=class{constructor(){this.cells=new Uint32Array(0),this.lineLengths=new Uint32Array(0),this.selection=qL()}resize(e,n){let i=e*n*rh;i!==this.cells.length&&(this.cells=new Uint32Array(i),this.lineLengths=new Uint32Array(n))}clear(){this.cells.fill(0,0),this.lineLengths.fill(0,0)}},YL=`#version 300 es
|
|
52
|
-
layout (location = 0) in vec2 a_position;
|
|
53
|
-
layout (location = 1) in vec2 a_size;
|
|
54
|
-
layout (location = 2) in vec4 a_color;
|
|
55
|
-
layout (location = 3) in vec2 a_unitquad;
|
|
56
|
-
|
|
57
|
-
uniform mat4 u_projection;
|
|
58
|
-
|
|
59
|
-
out vec4 v_color;
|
|
60
|
-
|
|
61
|
-
void main() {
|
|
62
|
-
vec2 zeroToOne = a_position + (a_unitquad * a_size);
|
|
63
|
-
gl_Position = u_projection * vec4(zeroToOne, 0.0, 1.0);
|
|
64
|
-
v_color = a_color;
|
|
65
|
-
}`,XL=`#version 300 es
|
|
66
|
-
precision lowp float;
|
|
67
|
-
|
|
68
|
-
in vec4 v_color;
|
|
69
|
-
|
|
70
|
-
out vec4 outColor;
|
|
71
|
-
|
|
72
|
-
void main() {
|
|
73
|
-
outColor = v_color;
|
|
74
|
-
}`,Ir=8,rp=Ir*Float32Array.BYTES_PER_ELEMENT,ZL=20*Ir,x1=class{constructor(){this.attributes=new Float32Array(ZL),this.count=0}},Dr=0,C1=0,E1=0,k1=0,T1=0,A1=0,R1=0,JL=class extends Ji{constructor(e,n,i,s){super(),this._terminal=e,this._gl=n,this._dimensions=i,this._themeService=s,this._vertices=new x1,this._verticesCursor=new x1;let o=this._gl;this._program=mn(lx(o,YL,XL)),this._register($n(()=>o.deleteProgram(this._program))),this._projectionLocation=mn(o.getUniformLocation(this._program,"u_projection")),this._vertexArrayObject=o.createVertexArray(),o.bindVertexArray(this._vertexArrayObject);let f=new Float32Array([0,0,1,0,0,1,1,1]),_=o.createBuffer();this._register($n(()=>o.deleteBuffer(_))),o.bindBuffer(o.ARRAY_BUFFER,_),o.bufferData(o.ARRAY_BUFFER,f,o.STATIC_DRAW),o.enableVertexAttribArray(3),o.vertexAttribPointer(3,2,this._gl.FLOAT,!1,0,0);let c=new Uint8Array([0,1,2,3]),h=o.createBuffer();this._register($n(()=>o.deleteBuffer(h))),o.bindBuffer(o.ELEMENT_ARRAY_BUFFER,h),o.bufferData(o.ELEMENT_ARRAY_BUFFER,c,o.STATIC_DRAW),this._attributesBuffer=mn(o.createBuffer()),this._register($n(()=>o.deleteBuffer(this._attributesBuffer))),o.bindBuffer(o.ARRAY_BUFFER,this._attributesBuffer),o.enableVertexAttribArray(0),o.vertexAttribPointer(0,2,o.FLOAT,!1,rp,0),o.vertexAttribDivisor(0,1),o.enableVertexAttribArray(1),o.vertexAttribPointer(1,2,o.FLOAT,!1,rp,2*Float32Array.BYTES_PER_ELEMENT),o.vertexAttribDivisor(1,1),o.enableVertexAttribArray(2),o.vertexAttribPointer(2,4,o.FLOAT,!1,rp,4*Float32Array.BYTES_PER_ELEMENT),o.vertexAttribDivisor(2,1),this._updateCachedColors(s.colors),this._register(this._themeService.onChangeColors(d=>{this._updateCachedColors(d),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,ox),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,i=this._vertices,s=1,o,f,_,c,h,d,y,p,w,C,T;for(o=0;o<n.rows;o++){for(_=-1,c=0,h=0,d=!1,f=0;f<n.cols;f++)y=(o*n.cols+f)*rh,p=e.cells[y+Fu],w=e.cells[y+Wu],C=!!(w&67108864),(p!==c||w!==h&&(d||C))&&((c!==0||d&&h!==0)&&(T=s++*Ir,this._updateRectangle(i,T,h,c,_,f,o)),_=f,c=p,h=w,d=C);(c!==0||d&&h!==0)&&(T=s++*Ir,this._updateRectangle(i,T,h,c,_,n.cols,o))}i.count=s}updateCursor(e){let n=this._verticesCursor,i=e.cursor;if(!i||i.style==="block"){n.count=0;return}let s,o=0;(i.style==="bar"||i.style==="outline")&&(s=o++*Ir,this._addRectangleFloat(n.attributes,s,i.x*this._dimensions.device.cell.width,i.y*this._dimensions.device.cell.height,i.style==="bar"?i.dpr*i.cursorWidth:i.dpr,this._dimensions.device.cell.height,this._cursorFloat)),(i.style==="underline"||i.style==="outline")&&(s=o++*Ir,this._addRectangleFloat(n.attributes,s,i.x*this._dimensions.device.cell.width,(i.y+1)*this._dimensions.device.cell.height-i.dpr,i.width*this._dimensions.device.cell.width,i.dpr,this._cursorFloat)),i.style==="outline"&&(s=o++*Ir,this._addRectangleFloat(n.attributes,s,i.x*this._dimensions.device.cell.width,i.y*this._dimensions.device.cell.height,i.width*this._dimensions.device.cell.width,i.dpr,this._cursorFloat),s=o++*Ir,this._addRectangleFloat(n.attributes,s,(i.x+i.width)*this._dimensions.device.cell.width-i.dpr,i.y*this._dimensions.device.cell.height,i.dpr,this._dimensions.device.cell.height,this._cursorFloat)),n.count=o}_updateRectangle(e,n,i,s,o,f,_){if(i&67108864)switch(i&50331648){case 16777216:case 33554432:Dr=this._themeService.colors.ansi[i&255].rgba;break;case 50331648:Dr=(i&16777215)<<8;break;default:Dr=this._themeService.colors.foreground.rgba}else switch(s&50331648){case 16777216:case 33554432:Dr=this._themeService.colors.ansi[s&255].rgba;break;case 50331648:Dr=(s&16777215)<<8;break;default:Dr=this._themeService.colors.background.rgba}e.attributes.length<n+4&&(e.attributes=zL(e.attributes,this._terminal.rows*this._terminal.cols*Ir)),C1=o*this._dimensions.device.cell.width,E1=_*this._dimensions.device.cell.height,k1=(Dr>>24&255)/255,T1=(Dr>>16&255)/255,A1=(Dr>>8&255)/255,R1=1,this._addRectangle(e.attributes,n,C1,E1,(f-o)*this._dimensions.device.cell.width,this._dimensions.device.cell.height,k1,T1,A1,R1)}_addRectangle(e,n,i,s,o,f,_,c,h,d){e[n]=i/this._dimensions.device.canvas.width,e[n+1]=s/this._dimensions.device.canvas.height,e[n+2]=o/this._dimensions.device.canvas.width,e[n+3]=f/this._dimensions.device.canvas.height,e[n+4]=_,e[n+5]=c,e[n+6]=h,e[n+7]=d}_addRectangleFloat(e,n,i,s,o,f,_){e[n]=i/this._dimensions.device.canvas.width,e[n+1]=s/this._dimensions.device.canvas.height,e[n+2]=o/this._dimensions.device.canvas.width,e[n+3]=f/this._dimensions.device.canvas.height,e[n+4]=_[0],e[n+5]=_[1],e[n+6]=_[2],e[n+7]=_[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])}},QL=class extends Ji{constructor(e,n,i,s,o,f,_,c){super(),this._container=n,this._alpha=o,this._coreBrowserService=f,this._optionsService=_,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-${i}-layer`),this._canvas.style.zIndex=s.toString(),this._initCanvas(),this._container.appendChild(this._canvas),this._register(this._themeService.onChangeColors(h=>{this._refreshCharAtlas(e,h),this.reset(e)})),this._register($n(()=>{this._canvas.remove()}))}_initCanvas(){this._ctx=mn(this._canvas.getContext("2d",{alpha:this._alpha})),this._alpha||this._clearAll()}handleBlur(e){}handleFocus(e){}handleCursorMove(e){}handleGridChanged(e,n,i){}handleSelectionChanged(e,n,i,s=!1){}_setTransparency(e,n){if(n===this._alpha)return;let i=this._canvas;this._alpha=n,this._canvas=this._canvas.cloneNode(),this._initCanvas(),this._container.replaceChild(this._canvas,i),this._refreshCharAtlas(e,this._themeService.colors),this.handleGridChanged(e,0,e.rows-1)}_refreshCharAtlas(e,n){this._deviceCharWidth<=0&&this._deviceCharHeight<=0||(this._charAtlas=sx(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,i=1){this._ctx.fillRect(e*this._deviceCellWidth,(n+1)*this._deviceCellHeight-this._coreBrowserService.dpr-1,i*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,i,s){this._alpha?this._ctx.clearRect(e*this._deviceCellWidth,n*this._deviceCellHeight,i*this._deviceCellWidth,s*this._deviceCellHeight):(this._ctx.fillStyle=this._themeService.colors.background.css,this._ctx.fillRect(e*this._deviceCellWidth,n*this._deviceCellHeight,i*this._deviceCellWidth,s*this._deviceCellHeight))}_fillCharTrueColor(e,n,i,s){this._ctx.font=this._getFont(e,!1,!1),this._ctx.textBaseline=Kw,this._clipCell(i,s,n.getWidth()),this._ctx.fillText(n.getChars(),i*this._deviceCellWidth+this._deviceCharLeft,s*this._deviceCellHeight+this._deviceCharTop+this._deviceCharHeight)}_clipCell(e,n,i){this._ctx.beginPath(),this._ctx.rect(e*this._deviceCellWidth,n*this._deviceCellHeight,i*this._deviceCellWidth,this._deviceCellHeight),this._ctx.clip()}_getFont(e,n,i){let s=n?e.options.fontWeightBold:e.options.fontWeight;return`${i?"italic":""} ${s} ${e.options.fontSize*this._coreBrowserService.dpr}px ${e.options.fontFamily}`}},eM=class extends QL{constructor(e,n,i,s,o,f,_){super(i,e,"link",n,!0,o,f,_),this._register(s.onShowLinkUnderline(c=>this._handleShowLinkUnderline(c))),this._register(s.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&&IL(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()}},Zs=typeof window=="object"?window:globalThis,ug=class{constructor(){this.mapWindowIdToZoomLevel=new Map,this._onDidChangeZoomLevel=new $t,this.onDidChangeZoomLevel=this._onDidChangeZoomLevel.event,this.mapWindowIdToZoomFactor=new Map,this._onDidChangeFullscreen=new $t,this.onDidChangeFullscreen=this._onDidChangeFullscreen.event,this.mapWindowIdToFullScreen=new Map}getZoomLevel(n){return this.mapWindowIdToZoomLevel.get(this.getWindowId(n))??0}setZoomLevel(n,i){if(this.getZoomLevel(i)===n)return;let s=this.getWindowId(i);this.mapWindowIdToZoomLevel.set(s,n),this._onDidChangeZoomLevel.fire(s)}getZoomFactor(n){return this.mapWindowIdToZoomFactor.get(this.getWindowId(n))??1}setZoomFactor(n,i){this.mapWindowIdToZoomFactor.set(this.getWindowId(i),n)}setFullscreen(n,i){if(this.isFullscreen(i)===n)return;let s=this.getWindowId(i);this.mapWindowIdToFullScreen.set(s,n),this._onDidChangeFullscreen.fire(s)}isFullscreen(n){return!!this.mapWindowIdToFullScreen.get(this.getWindowId(n))}getWindowId(n){return n.vscodeWindowId}};ug.INSTANCE=new ug;var cx=ug;function tM(e,n,i){typeof n=="string"&&(n=e.matchMedia(n)),n.addEventListener("change",i)}cx.INSTANCE.onDidChangeZoomLevel;cx.INSTANCE.onDidChangeFullscreen;var So=typeof navigator=="object"?navigator.userAgent:"";So.indexOf("Firefox")>=0;So.indexOf("AppleWebKit")>=0;var nM=So.indexOf("Chrome")>=0;!nM&&So.indexOf("Safari")>=0;So.indexOf("Electron/")>=0;So.indexOf("Android")>=0;var sp=!1;if(typeof Zs.matchMedia=="function"){let e=Zs.matchMedia("(display-mode: standalone) or (display-mode: window-controls-overlay)"),n=Zs.matchMedia("(display-mode: fullscreen)");sp=e.matches,tM(Zs,e,({matches:i})=>{sp&&n.matches||(sp=i)})}var no="en",ap=!1,ux=!1,ku,Gu=no,L1=no,iM,jr,na=globalThis,yi;typeof na.vscode<"u"&&typeof na.vscode.process<"u"?yi=na.vscode.process:typeof process<"u"&&typeof process?.versions?.node=="string"&&(yi=process);var rM=typeof yi?.versions?.electron=="string",sM=rM&&yi?.type==="renderer";if(typeof yi=="object"){yi.platform,yi.platform,ap=yi.platform==="linux",ap&&yi.env.SNAP&&yi.env.SNAP_REVISION,yi.env.CI||yi.env.BUILD_ARTIFACTSTAGINGDIRECTORY,ku=no,Gu=no;let e=yi.env.VSCODE_NLS_CONFIG;if(e)try{let n=JSON.parse(e);ku=n.userLocale,L1=n.osLocale,Gu=n.resolvedLanguage||no,iM=n.languagePack?.translationsConfigFile}catch{}ux=!0}else typeof navigator=="object"&&!sM?(jr=navigator.userAgent,jr.indexOf("Windows")>=0,jr.indexOf("Macintosh")>=0,(jr.indexOf("Macintosh")>=0||jr.indexOf("iPad")>=0||jr.indexOf("iPhone")>=0)&&navigator.maxTouchPoints&&navigator.maxTouchPoints>0,ap=jr.indexOf("Linux")>=0,jr?.indexOf("Mobi")>=0,Gu=globalThis._VSCODE_NLS_LANGUAGE||no,ku=navigator.language.toLowerCase(),L1=ku):console.error("Unable to resolve platform.");var M1=ux,cr=jr,ms=Gu,aM;(e=>{function n(){return ms}e.value=n;function i(){return ms.length===2?ms==="en":ms.length>=3?ms[0]==="e"&&ms[1]==="n"&&ms[2]==="-":!1}e.isDefaultVariant=i;function s(){return ms==="en"}e.isDefault=s})(aM||={});var oM=typeof na.postMessage=="function"&&!na.importScripts;(()=>{if(oM){let e=[];na.addEventListener("message",i=>{if(i.data&&i.data.vscodeScheduleAsyncWork)for(let s=0,o=e.length;s<o;s++){let f=e[s];if(f.id===i.data.vscodeScheduleAsyncWork){e.splice(s,1),f.callback();return}}});let n=0;return i=>{let s=++n;e.push({id:s,callback:i}),na.postMessage({vscodeScheduleAsyncWork:s},"*")}}return e=>setTimeout(e)})();var lM=!!(cr&&cr.indexOf("Chrome")>=0);cr&&cr.indexOf("Firefox")>=0;!lM&&cr&&cr.indexOf("Safari")>=0;cr&&cr.indexOf("Edg/")>=0;cr&&cr.indexOf("Android")>=0;var qa=typeof navigator=="object"?navigator:{};M1||document.queryCommandSupported&&document.queryCommandSupported("copy")||qa&&qa.clipboard&&qa.clipboard.writeText,M1||qa&&qa.clipboard&&qa.clipboard.readText;var vm=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}},op=new vm,N1=new vm,O1=new vm;new Array(230);var cM;(e=>{function n(c){return op.keyCodeToStr(c)}e.toString=n;function i(c){return op.strToKeyCode(c)}e.fromString=i;function s(c){return N1.keyCodeToStr(c)}e.toUserSettingsUS=s;function o(c){return O1.keyCodeToStr(c)}e.toUserSettingsGeneral=o;function f(c){return N1.strToKeyCode(c)||O1.strToKeyCode(c)}e.fromUserSettings=f;function _(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 op.keyCodeToStr(c)}e.toElectronAccelerator=_})(cM||={});var hx=Object.freeze(function(e,n){let i=setTimeout(e.bind(n),0);return{dispose(){clearTimeout(i)}}}),uM;(e=>{function n(i){return i===e.None||i===e.Cancelled||i instanceof hM?!0:!i||typeof i!="object"?!1:typeof i.isCancellationRequested=="boolean"&&typeof i.onCancellationRequested=="function"}e.isCancellationToken=n,e.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:Pr.None}),e.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:hx})})(uM||={});var hM=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?hx:(this._emitter||(this._emitter=new $t),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=null)}},dM;(e=>{async function n(s){let o,f=await Promise.all(s.map(_=>_.then(c=>c,c=>{o||(o=c)})));if(typeof o<"u")throw o;return f}e.settled=n;function i(s){return new Promise(async(o,f)=>{try{await s(o,f)}catch(_){f(_)}})}e.withAsyncBody=i})(dM||={});var D1=class Ii{static fromArray(n){return new Ii(i=>{i.emitMany(n)})}static fromPromise(n){return new Ii(async i=>{i.emitMany(await n)})}static fromPromises(n){return new Ii(async i=>{await Promise.all(n.map(async s=>i.emitOne(await s)))})}static merge(n){return new Ii(async i=>{await Promise.all(n.map(async s=>{for await(let o of s)i.emitOne(o)}))})}constructor(n,i){this._state=0,this._results=[],this._error=null,this._onReturn=i,this._onStateChanged=new $t,queueMicrotask(async()=>{let s={emitOne:o=>this.emitOne(o),emitMany:o=>this.emitMany(o),reject:o=>this.reject(o)};try{await Promise.resolve(n(s)),this.resolve()}catch(o){this.reject(o)}finally{s.emitOne=void 0,s.emitMany=void 0,s.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 Pr.toPromise(this._onStateChanged.event)}while(!0)},return:async()=>(this._onReturn?.(),{done:!0,value:void 0})}}static map(n,i){return new Ii(async s=>{for await(let o of n)s.emitOne(i(o))})}map(n){return Ii.map(this,n)}static filter(n,i){return new Ii(async s=>{for await(let o of n)i(o)&&s.emitOne(o)})}filter(n){return Ii.filter(this,n)}static coalesce(n){return Ii.filter(n,i=>!!i)}coalesce(){return Ii.coalesce(this)}static async toPromise(n){let i=[];for await(let s of n)i.push(s);return i}toPromise(){return Ii.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())}};D1.EMPTY=D1.fromArray([]);var{getWindow:fM}=(function(){let e=new Map,n={window:Zs,disposables:new lo};e.set(Zs.vscodeWindowId,n);let i=new $t,s=new $t,o=new $t;function f(_,c){return(typeof _=="number"?e.get(_):void 0)??(c?n:void 0)}return{onDidRegisterWindow:i.event,onWillUnregisterWindow:o.event,onDidUnregisterWindow:s.event,registerWindow(_){if(e.has(_.vscodeWindowId))return Ji.None;let c=new lo,h={window:_,disposables:c.add(new lo)};return e.set(_.vscodeWindowId,h),c.add($n(()=>{e.delete(_.vscodeWindowId),s.fire(_)})),c.add(hg(_,gM.BEFORE_UNLOAD,()=>{o.fire(_)})),i.fire(h),c},getWindows(){return e.values()},getWindowsCount(){return e.size},getWindowId(_){return _.vscodeWindowId},hasWindow(_){return e.has(_)},getWindowById:f,getWindow(_){let c=_;if(c?.ownerDocument?.defaultView)return c.ownerDocument.defaultView.window;let h=_;return h?.view?h.view.window:Zs},getDocument(_){return fM(_).document}}})(),pM=class{constructor(e,n,i,s){this._node=e,this._type=n,this._handler=i,this._options=s||!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 hg(e,n,i,s){return new pM(e,n,i,s)}var gM={BEFORE_UNLOAD:"beforeunload"},mM=class extends Ji{constructor(e,n,i,s,o,f,_,c,h){super(),this._terminal=e,this._characterJoinerService=n,this._charSizeService=i,this._coreBrowserService=s,this._coreService=o,this._decorationService=f,this._optionsService=_,this._themeService=c,this._cursorBlinkStateManager=new bl,this._charAtlasDisposable=this._register(new bl),this._observerDisposable=this._register(new bl),this._model=new VL,this._workCell=new S1,this._workCell2=new S1,this._rectangleRenderer=this._register(new bl),this._glyphRenderer=this._register(new bl),this._onChangeTextureAtlas=this._register(new $t),this.onChangeTextureAtlas=this._onChangeTextureAtlas.event,this._onAddTextureAtlasCanvas=this._register(new $t),this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event,this._onRemoveTextureAtlasCanvas=this._register(new $t),this.onRemoveTextureAtlasCanvas=this._onRemoveTextureAtlasCanvas.event,this._onRequestRedraw=this._register(new $t),this.onRequestRedraw=this._onRequestRedraw.event,this._onContextLoss=this._register(new $t),this.onContextLoss=this._onContextLoss.event,this._canvas=this._coreBrowserService.mainDocument.createElement("canvas");let d={antialias:!1,depth:!1,preserveDrawingBuffer:h};if(this._gl=this._canvas.getContext("webgl2",d),!this._gl)throw new Error("WebGL2 not supported "+this._gl);this._register(this._themeService.onChangeColors(()=>this._handleColorChange())),this._cellColorResolver=new cL(this._terminal,this._optionsService,this._model.selection,this._decorationService,this._coreBrowserService,this._themeService),this._core=this._terminal._core,this._renderLayers=[new eM(this._core.screenElement,2,this._terminal,this._core.linkifier,this._coreBrowserService,_,this._themeService)],this.dimensions=oL(),this._devicePixelRatio=this._coreBrowserService.dpr,this._updateDimensions(),this._updateCursorBlink(),this._register(_.onOptionChange(()=>this._handleOptionsChanged())),this._deviceMaxTextureSize=this._gl.getParameter(this._gl.MAX_TEXTURE_SIZE),this._register(hg(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(hg(this._canvas,"webglcontextrestored",y=>{console.warn("webglcontextrestored event received"),clearTimeout(this._contextRestorationTimeout),this._contextRestorationTimeout=void 0,b1(this._terminal),this._initializeWebGLState(),this._requestRedrawViewport()})),this._observerDisposable.value=y1(this._canvas,this._coreBrowserService.window,(y,p)=>this._setCanvasDevicePixelDimensions(y,p)),this._register(this._coreBrowserService.onWindowChange(y=>{this._observerDisposable.value=y1(this._canvas,y,(p,w)=>this._setCanvasDevicePixelDimensions(p,w))})),this._core.screenElement.appendChild(this._canvas),[this._rectangleRenderer.value,this._glyphRenderer.value]=this._initializeWebGLState(),this._isAttached=this._core.screenElement.isConnected,this._register($n(()=>{for(let y of this._renderLayers)y.dispose();this._canvas.parentElement?.removeChild(this._canvas),b1(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 i of this._renderLayers)i.resize(this._terminal,this.dimensions);this._canvas.width=this.dimensions.device.canvas.width,this._canvas.height=this.dimensions.device.canvas.height,this._canvas.style.width=`${this.dimensions.css.canvas.width}px`,this._canvas.style.height=`${this.dimensions.css.canvas.height}px`,this._core.screenElement.style.width=`${this.dimensions.css.canvas.width}px`,this._core.screenElement.style.height=`${this.dimensions.css.canvas.height}px`,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,i){for(let s of this._renderLayers)s.handleSelectionChanged(this._terminal,e,n,i);this._model.selection.update(this._core,e,n,i),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 JL(this._terminal,this._gl,this.dimensions,this._themeService),this._glyphRenderer.value=new WL(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=sx(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=Uw(Pr.forward(e.onAddTextureAtlasCanvas,this._onAddTextureAtlasCanvas),Pr.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 i of this._renderLayers)i.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 BL(()=>{this._requestRedrawCursor()},this._coreBrowserService):this._cursorBlinkStateManager.clear(),this._requestRedrawCursor()}_updateModel(e,n){let i=this._core,s=this._workCell,o,f,_,c,h,d,y=0,p=!0,w,C,T,E,g,v,m,S,k;e=j1(e,i.rows-1,0),n=j1(n,i.rows-1,0);let L=this._coreService.decPrivateModes.cursorStyle??i.options.cursorStyle??"block",R=this._terminal.buffer.active.baseY+this._terminal.buffer.active.cursorY,M=R-i.buffer.ydisp,A=Math.min(this._terminal.buffer.active.cursorX,i.cols-1),B=-1,K=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(_=f+i.buffer.ydisp,c=i.buffer.lines.get(_),this._model.lineLengths[f]=0,T=R===_,y=0,h=this._characterJoinerService.getJoinedCharacters(_),S=0;S<i.cols;S++){if(o=this._cellColorResolver.result.bg,c.loadCell(S,s),S===0&&(o=this._cellColorResolver.result.bg),d=!1,p=S>=y,w=S,h.length>0&&S===h[0][0]&&p){C=h.shift();let W=this._model.selection.isCellSelected(this._terminal,C[0],_);for(m=C[0]+1;m<C[1];m++)p&&=W===this._model.selection.isCellSelected(this._terminal,m,_);p&&=!T||A<C[0]||A>=C[1],p?(d=!0,s=new _M(s,c.translateToString(!0,C[0],C[1]),C[1]-C[0]),w=C[1]-1):y=C[1]}if(E=s.getChars(),g=s.getCode(),m=(f*i.cols+S)*rh,this._cellColorResolver.resolve(s,S,_,this.dimensions.device.cell.width),K&&_===R&&(S===A&&(this._model.cursor={x:A,y:M,width:s.getWidth(),style:this._coreBrowserService.isFocused?L:i.options.cursorInactiveStyle,cursorWidth:i.options.cursorWidth,dpr:this._devicePixelRatio},B=A+s.getWidth()-1),S>=A&&S<=B&&(this._coreBrowserService.isFocused&&L==="block"||this._coreBrowserService.isFocused===!1&&i.options.cursorInactiveStyle==="block")&&(this._cellColorResolver.result.fg=50331648|this._themeService.colors.cursorAccent.rgba>>8&16777215,this._cellColorResolver.result.bg=50331648|this._themeService.colors.cursor.rgba>>8&16777215)),g!==0&&(this._model.lineLengths[f]=S+1),!(this._model.cells[m]===g&&this._model.cells[m+Fu]===this._cellColorResolver.result.bg&&this._model.cells[m+Wu]===this._cellColorResolver.result.fg&&this._model.cells[m+ip]===this._cellColorResolver.result.ext)&&(F=!0,E.length>1&&(g|=KL),this._model.cells[m]=g,this._model.cells[m+Fu]=this._cellColorResolver.result.bg,this._model.cells[m+Wu]=this._cellColorResolver.result.fg,this._model.cells[m+ip]=this._cellColorResolver.result.ext,v=s.getWidth(),this._glyphRenderer.value.updateCell(S,f,g,this._cellColorResolver.result.bg,this._cellColorResolver.result.fg,this._cellColorResolver.result.ext,E,v,o),d)){for(s=this._workCell,S++;S<=w;S++)k=(f*i.cols+S)*rh,this._glyphRenderer.value.updateCell(S,f,0,0,0,0,eL,0,0),this._model.cells[k]=0,this._model.cells[k+Fu]=this._cellColorResolver.result.bg,this._model.cells[k+Wu]=this._cellColorResolver.result.fg,this._model.cells[k+ip]=this._cellColorResolver.result.ext;S--}}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})}},_M=class extends to{constructor(e,n,i){super(),this.content=0,this.combinedData="",this.fg=e.fg,this.bg=e.bg,this.combinedData=n,this._width=i}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(e){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}};function j1(e,n,i=0){return Math.max(Math.min(e,n),i)}var I1="di$target",B1="di$dependencies",lp=new Map;function hr(e){if(lp.has(e))return lp.get(e);let n=function(i,s,o){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");vM(n,i,o)};return n._id=e,lp.set(e,n),n}function vM(e,n,i){n[I1]===n?n[B1].push({id:e,index:i}):(n[B1]=[{id:e,index:i}],n[I1]=n)}hr("BufferService");hr("CoreMouseService");hr("CoreService");hr("CharsetService");hr("InstantiationService");hr("LogService");var bM=hr("OptionsService");hr("OscLinkService");hr("UnicodeService");hr("DecorationService");var yM={trace:0,debug:1,info:2,warn:3,error:4,off:5},SM="xterm.js: ",P1=class extends Ji{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=yM[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,i){this._evalLazyOptionalParams(i),e.call(console,(this._optionsService.options.logger?"":SM)+n,...i)}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)}};P1=U3([F3(0,bM)],P1);var wM=class extends Ji{constructor(e){if(Gw&&Q3()<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 $t),this.onChangeTextureAtlas=this._onChangeTextureAtlas.event,this._onAddTextureAtlasCanvas=this._register(new $t),this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event,this._onRemoveTextureAtlasCanvas=this._register(new $t),this.onRemoveTextureAtlasCanvas=this._onRemoveTextureAtlasCanvas.event,this._onContextLoss=this._register(new $t),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 i=n.coreService,s=n.optionsService,o=n,f=o._renderService,_=o._characterJoinerService,c=o._charSizeService,h=o._coreBrowserService,d=o._decorationService;o._logService;let y=o._themeService;this._renderer=this._register(new mM(e,_,c,h,i,d,s,y,this._preserveDrawingBuffer)),this._register(Pr.forward(this._renderer.onContextLoss,this._onContextLoss)),this._register(Pr.forward(this._renderer.onChangeTextureAtlas,this._onChangeTextureAtlas)),this._register(Pr.forward(this._renderer.onAddTextureAtlasCanvas,this._onAddTextureAtlasCanvas)),this._register(Pr.forward(this._renderer.onRemoveTextureAtlasCanvas,this._onRemoveTextureAtlasCanvas)),f.setRenderer(this._renderer),this._register($n(()=>{if(this._terminal._core._store._isDisposed)return;let p=this._terminal._core._renderService;p.setRenderer(this._terminal._core._createRenderer()),p.handleResize(e.cols,e.rows)}))}get textureAtlas(){return this._renderer?.textureAtlas}clearTextureAtlas(){this._renderer?.clearTextureAtlas()}},cp={exports:{}},z1;function xM(){return z1||(z1=1,(function(e,n){(function(i,s){e.exports=s()})(globalThis,(()=>(()=>{var i={4567:function(_,c,h){var d=this&&this.__decorate||function(m,S,k,L){var R,M=arguments.length,A=M<3?S:L===null?L=Object.getOwnPropertyDescriptor(S,k):L;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")A=Reflect.decorate(m,S,k,L);else for(var B=m.length-1;B>=0;B--)(R=m[B])&&(A=(M<3?R(A):M>3?R(S,k,A):R(S,k))||A);return M>3&&A&&Object.defineProperty(S,k,A),A},y=this&&this.__param||function(m,S){return function(k,L){S(k,L,m)}};Object.defineProperty(c,"__esModule",{value:!0}),c.AccessibilityManager=void 0;const p=h(9042),w=h(9924),C=h(844),T=h(4725),E=h(2585),g=h(3656);let v=c.AccessibilityManager=class extends C.Disposable{constructor(m,S,k,L){super(),this._terminal=m,this._coreBrowserService=k,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 w.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(`
|
|
75
|
-
`)))),this.register(this._terminal.onA11yTab((R=>this._handleTab(R)))),this.register(this._terminal.onKey((R=>this._handleKey(R.key)))),this.register(this._terminal.onBlur((()=>this._clearLiveRegion()))),this.register(this._renderService.onDimensionsChange((()=>this._refreshRowsDimensions()))),this.register((0,g.addDisposableDomListener)(document,"selectionchange",(()=>this._handleSelectionChange()))),this.register(this._coreBrowserService.onDprChange((()=>this._refreshRowsDimensions()))),this._refreshRows(),this.register((0,C.toDisposable)((()=>{this._accessibilityContainer.remove(),this._rowElements.length=0})))}_handleTab(m){for(let S=0;S<m;S++)this._handleChar(" ")}_handleChar(m){this._liveRegionLineCount<21&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==m&&(this._charsToAnnounce+=m):this._charsToAnnounce+=m,m===`
|
|
76
|
-
`&&(this._liveRegionLineCount++,this._liveRegionLineCount===21&&(this._liveRegion.textContent+=p.tooMuchOutput)))}_clearLiveRegion(){this._liveRegion.textContent="",this._liveRegionLineCount=0}_handleKey(m){this._clearLiveRegion(),new RegExp("\\p{Control}","u").test(m)||this._charsToConsume.push(m)}_refreshRows(m,S){this._liveRegionDebouncer.refresh(m,S,this._terminal.rows)}_renderRows(m,S){const k=this._terminal.buffer,L=k.lines.length.toString();for(let R=m;R<=S;R++){const M=k.lines.get(k.ydisp+R),A=[],B=M?.translateToString(!0,void 0,void 0,A)||"",K=(k.ydisp+R+1).toString(),F=this._rowElements[R];F&&(B.length===0?(F.innerText=" ",this._rowColumns.set(F,[0,1])):(F.textContent=B,this._rowColumns.set(F,A)),F.setAttribute("aria-posinset",K),F.setAttribute("aria-setsize",L))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(m,S){const k=m.target,L=this._rowElements[S===0?1:this._rowElements.length-2];if(k.getAttribute("aria-posinset")===(S===0?"1":`${this._terminal.buffer.lines.length}`)||m.relatedTarget!==L)return;let R,M;if(S===0?(R=k,M=this._rowElements.pop(),this._rowContainer.removeChild(M)):(R=this._rowElements.shift(),M=k,this._rowContainer.removeChild(R)),R.removeEventListener("focus",this._topBoundaryFocusListener),M.removeEventListener("focus",this._bottomBoundaryFocusListener),S===0){const A=this._createAccessibilityTreeNode();this._rowElements.unshift(A),this._rowContainer.insertAdjacentElement("afterbegin",A)}else{const A=this._createAccessibilityTreeNode();this._rowElements.push(A),this._rowContainer.appendChild(A)}this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._terminal.scrollLines(S===0?-1:1),this._rowElements[S===0?1:this._rowElements.length-2].focus(),m.preventDefault(),m.stopImmediatePropagation()}_handleSelectionChange(){if(this._rowElements.length===0)return;const m=document.getSelection();if(!m)return;if(m.isCollapsed)return void(this._rowContainer.contains(m.anchorNode)&&this._terminal.clearSelection());if(!m.anchorNode||!m.focusNode)return void console.error("anchorNode and/or focusNode are null");let S={node:m.anchorNode,offset:m.anchorOffset},k={node:m.focusNode,offset:m.focusOffset};if((S.node.compareDocumentPosition(k.node)&Node.DOCUMENT_POSITION_PRECEDING||S.node===k.node&&S.offset>k.offset)&&([S,k]=[k,S]),S.node.compareDocumentPosition(this._rowElements[0])&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_FOLLOWING)&&(S={node:this._rowElements[0].childNodes[0],offset:0}),!this._rowContainer.contains(S.node))return;const L=this._rowElements.slice(-1)[0];if(k.node.compareDocumentPosition(L)&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_PRECEDING)&&(k={node:L,offset:L.textContent?.length??0}),!this._rowContainer.contains(k.node))return;const R=({node:B,offset:K})=>{const F=B instanceof Text?B.parentNode:B;let W=parseInt(F?.getAttribute("aria-posinset"),10)-1;if(isNaN(W))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 Z=K<I.length?I[K]:I.slice(-1)[0]+1;return Z>=this._terminal.cols&&(++W,Z=0),{row:W,column:Z}},M=R(S),A=R(k);if(M&&A){if(M.row>A.row||M.row===A.row&&M.column>=A.column)throw new Error("invalid range");this._terminal.select(M.column,M.row,(A.row-M.row)*this._terminal.cols-M.column+A.column)}}_handleResize(m){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(let S=this._rowContainer.children.length;S<this._terminal.rows;S++)this._rowElements[S]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[S]);for(;this._rowElements.length>m;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){const m=this._coreBrowserService.mainDocument.createElement("div");return m.setAttribute("role","listitem"),m.tabIndex=-1,this._refreshRowDimensions(m),m}_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 m=0;m<this._terminal.rows;m++)this._refreshRowDimensions(this._rowElements[m])}}_refreshRowDimensions(m){m.style.height=`${this._renderService.dimensions.css.cell.height}px`}};c.AccessibilityManager=v=d([y(1,E.IInstantiationService),y(2,T.ICoreBrowserService),y(3,T.IRenderService)],v)},3614:(_,c)=>{function h(w){return w.replace(/\r?\n/g,"\r")}function d(w,C){return C?"\x1B[200~"+w+"\x1B[201~":w}function y(w,C,T,E){w=d(w=h(w),T.decPrivateModes.bracketedPasteMode&&E.rawOptions.ignoreBracketedPasteMode!==!0),T.triggerDataEvent(w,!0),C.value=""}function p(w,C,T){const E=T.getBoundingClientRect(),g=w.clientX-E.left-10,v=w.clientY-E.top-10;C.style.width="20px",C.style.height="20px",C.style.left=`${g}px`,C.style.top=`${v}px`,C.style.zIndex="1000",C.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=h,c.bracketTextForPaste=d,c.copyHandler=function(w,C){w.clipboardData&&w.clipboardData.setData("text/plain",C.selectionText),w.preventDefault()},c.handlePasteEvent=function(w,C,T,E){w.stopPropagation(),w.clipboardData&&y(w.clipboardData.getData("text/plain"),C,T,E)},c.paste=y,c.moveTextAreaUnderMouseCursor=p,c.rightClickHandler=function(w,C,T,E,g){p(w,C,T),g&&E.rightClickSelect(w),C.value=E.selectionText,C.select()}},7239:(_,c,h)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.ColorContrastCache=void 0;const d=h(1505);c.ColorContrastCache=class{constructor(){this._color=new d.TwoKeyMap,this._css=new d.TwoKeyMap}setCss(y,p,w){this._css.set(y,p,w)}getCss(y,p){return this._css.get(y,p)}setColor(y,p,w){this._color.set(y,p,w)}getColor(y,p){return this._color.get(y,p)}clear(){this._color.clear(),this._css.clear()}}},3656:(_,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.addDisposableDomListener=void 0,c.addDisposableDomListener=function(h,d,y,p){h.addEventListener(d,y,p);let w=!1;return{dispose:()=>{w||(w=!0,h.removeEventListener(d,y,p))}}}},3551:function(_,c,h){var d=this&&this.__decorate||function(v,m,S,k){var L,R=arguments.length,M=R<3?m:k===null?k=Object.getOwnPropertyDescriptor(m,S):k;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")M=Reflect.decorate(v,m,S,k);else for(var A=v.length-1;A>=0;A--)(L=v[A])&&(M=(R<3?L(M):R>3?L(m,S,M):L(m,S))||M);return R>3&&M&&Object.defineProperty(m,S,M),M},y=this&&this.__param||function(v,m){return function(S,k){m(S,k,v)}};Object.defineProperty(c,"__esModule",{value:!0}),c.Linkifier=void 0;const p=h(3656),w=h(8460),C=h(844),T=h(2585),E=h(4725);let g=c.Linkifier=class extends C.Disposable{get currentLink(){return this._currentLink}constructor(v,m,S,k,L){super(),this._element=v,this._mouseService=m,this._renderService=S,this._bufferService=k,this._linkProviderService=L,this._linkCacheDisposables=[],this._isMouseOut=!0,this._wasResized=!1,this._activeLine=-1,this._onShowLinkUnderline=this.register(new w.EventEmitter),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this.register(new w.EventEmitter),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this.register((0,C.getDisposeArrayDisposable)(this._linkCacheDisposables)),this.register((0,C.toDisposable)((()=>{this._lastMouseEvent=void 0,this._activeProviderReplies?.clear()}))),this.register(this._bufferService.onResize((()=>{this._clearCurrentLink(),this._wasResized=!0}))),this.register((0,p.addDisposableDomListener)(this._element,"mouseleave",(()=>{this._isMouseOut=!0,this._clearCurrentLink()}))),this.register((0,p.addDisposableDomListener)(this._element,"mousemove",this._handleMouseMove.bind(this))),this.register((0,p.addDisposableDomListener)(this._element,"mousedown",this._handleMouseDown.bind(this))),this.register((0,p.addDisposableDomListener)(this._element,"mouseup",this._handleMouseUp.bind(this)))}_handleMouseMove(v){this._lastMouseEvent=v;const m=this._positionFromMouseEvent(v,this._element,this._mouseService);if(!m)return;this._isMouseOut=!1;const S=v.composedPath();for(let k=0;k<S.length;k++){const L=S[k];if(L.classList.contains("xterm"))break;if(L.classList.contains("xterm-hover"))return}this._lastBufferCell&&m.x===this._lastBufferCell.x&&m.y===this._lastBufferCell.y||(this._handleHover(m),this._lastBufferCell=m)}_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,m){this._activeProviderReplies&&m||(this._activeProviderReplies?.forEach((k=>{k?.forEach((L=>{L.link.dispose&&L.link.dispose()}))})),this._activeProviderReplies=new Map,this._activeLine=v.y);let S=!1;for(const[k,L]of this._linkProviderService.linkProviders.entries())m?this._activeProviderReplies?.get(k)&&(S=this._checkLinkProviderResult(k,v,S)):L.provideLinks(v.y,(R=>{if(this._isMouseOut)return;const M=R?.map((A=>({link:A})));this._activeProviderReplies?.set(k,M),S=this._checkLinkProviderResult(k,v,S),this._activeProviderReplies?.size===this._linkProviderService.linkProviders.length&&this._removeIntersectingLinks(v.y,this._activeProviderReplies)}))}_removeIntersectingLinks(v,m){const S=new Set;for(let k=0;k<m.size;k++){const L=m.get(k);if(L)for(let R=0;R<L.length;R++){const M=L[R],A=M.link.range.start.y<v?0:M.link.range.start.x,B=M.link.range.end.y>v?this._bufferService.cols:M.link.range.end.x;for(let K=A;K<=B;K++){if(S.has(K)){L.splice(R--,1);break}S.add(K)}}}}_checkLinkProviderResult(v,m,S){if(!this._activeProviderReplies)return S;const k=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&&k){const R=k.find((M=>this._linkAtPosition(M.link,m)));R&&(S=!0,this._handleNewLink(R))}if(this._activeProviderReplies.size===this._linkProviderService.linkProviders.length&&!S)for(let R=0;R<this._activeProviderReplies.size;R++){const M=this._activeProviderReplies.get(R)?.find((A=>this._linkAtPosition(A.link,m)));if(M){S=!0,this._handleNewLink(M);break}}return S}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(v){if(!this._currentLink)return;const m=this._positionFromMouseEvent(v,this._element,this._mouseService);m&&this._mouseDownLink===this._currentLink&&this._linkAtPosition(this._currentLink.link,m)&&this._currentLink.link.activate(v,this._currentLink.link.text)}_clearCurrentLink(v,m){this._currentLink&&this._lastMouseEvent&&(!v||!m||this._currentLink.link.range.start.y>=v&&this._currentLink.link.range.end.y<=m)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,(0,C.disposeArray)(this._linkCacheDisposables))}_handleNewLink(v){if(!this._lastMouseEvent)return;const m=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);m&&this._linkAtPosition(v.link,m)&&(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:S=>{this._currentLink?.state&&this._currentLink.state.decorations.pointerCursor!==S&&(this._currentLink.state.decorations.pointerCursor=S,this._currentLink.state.isHovered&&this._element.classList.toggle("xterm-cursor-pointer",S))}},underline:{get:()=>this._currentLink?.state?.decorations.underline,set:S=>{this._currentLink?.state&&this._currentLink?.state?.decorations.underline!==S&&(this._currentLink.state.decorations.underline=S,this._currentLink.state.isHovered&&this._fireUnderlineEvent(v.link,S))}}}),this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange((S=>{if(!this._currentLink)return;const k=S.start===0?0:S.start+1+this._bufferService.buffer.ydisp,L=this._bufferService.buffer.ydisp+1+S.end;if(this._currentLink.link.range.start.y>=k&&this._currentLink.link.range.end.y<=L&&(this._clearCurrentLink(k,L),this._lastMouseEvent)){const R=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);R&&this._askForLink(R,!1)}}))))}_linkHover(v,m,S){this._currentLink?.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(m,!0),this._currentLink.state.decorations.pointerCursor&&v.classList.add("xterm-cursor-pointer")),m.hover&&m.hover(S,m.text)}_fireUnderlineEvent(v,m){const S=v.range,k=this._bufferService.buffer.ydisp,L=this._createLinkUnderlineEvent(S.start.x-1,S.start.y-k-1,S.end.x,S.end.y-k-1,void 0);(m?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(L)}_linkLeave(v,m,S){this._currentLink?.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(m,!1),this._currentLink.state.decorations.pointerCursor&&v.classList.remove("xterm-cursor-pointer")),m.leave&&m.leave(S,m.text)}_linkAtPosition(v,m){const S=v.range.start.y*this._bufferService.cols+v.range.start.x,k=v.range.end.y*this._bufferService.cols+v.range.end.x,L=m.y*this._bufferService.cols+m.x;return S<=L&&L<=k}_positionFromMouseEvent(v,m,S){const k=S.getCoords(v,m,this._bufferService.cols,this._bufferService.rows);if(k)return{x:k[0],y:k[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(v,m,S,k,L){return{x1:v,y1:m,x2:S,y2:k,cols:this._bufferService.cols,fg:L}}};c.Linkifier=g=d([y(1,E.IMouseService),y(2,E.IRenderService),y(3,T.IBufferService),y(4,E.ILinkProviderService)],g)},9042:(_,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(_,c,h){var d=this&&this.__decorate||function(E,g,v,m){var S,k=arguments.length,L=k<3?g:m===null?m=Object.getOwnPropertyDescriptor(g,v):m;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")L=Reflect.decorate(E,g,v,m);else for(var R=E.length-1;R>=0;R--)(S=E[R])&&(L=(k<3?S(L):k>3?S(g,v,L):S(g,v))||L);return k>3&&L&&Object.defineProperty(g,v,L),L},y=this&&this.__param||function(E,g){return function(v,m){g(v,m,E)}};Object.defineProperty(c,"__esModule",{value:!0}),c.OscLinkProvider=void 0;const p=h(511),w=h(2585);let C=c.OscLinkProvider=class{constructor(E,g,v){this._bufferService=E,this._optionsService=g,this._oscLinkService=v}provideLinks(E,g){const v=this._bufferService.buffer.lines.get(E-1);if(!v)return void g(void 0);const m=[],S=this._optionsService.rawOptions.linkHandler,k=new p.CellData,L=v.getTrimmedLength();let R=-1,M=-1,A=!1;for(let B=0;B<L;B++)if(M!==-1||v.hasContent(B)){if(v.loadCell(B,k),k.hasExtendedAttrs()&&k.extended.urlId){if(M===-1){M=B,R=k.extended.urlId;continue}A=k.extended.urlId!==R}else M!==-1&&(A=!0);if(A||M!==-1&&B===L-1){const K=this._oscLinkService.getLinkData(R)?.uri;if(K){const F={start:{x:M+1,y:E},end:{x:B+(A||B!==L-1?0:1),y:E}};let W=!1;if(!S?.allowNonHttpProtocols)try{const I=new URL(K);["http:","https:"].includes(I.protocol)||(W=!0)}catch{W=!0}W||m.push({text:K,range:F,activate:(I,Z)=>S?S.activate(I,Z,F):T(0,Z),hover:(I,Z)=>S?.hover?.(I,Z,F),leave:(I,Z)=>S?.leave?.(I,Z,F)})}A=!1,k.hasExtendedAttrs()&&k.extended.urlId?(M=B,R=k.extended.urlId):(M=-1,R=-1)}}g(m)}};function T(E,g){if(confirm(`Do you want to navigate to ${g}?
|
|
77
|
-
|
|
78
|
-
WARNING: This link could potentially be dangerous`)){const v=window.open();if(v){try{v.opener=null}catch{}v.location.href=g}else console.warn("Opening link blocked as opener could not be cleared")}}c.OscLinkProvider=C=d([y(0,w.IBufferService),y(1,w.IOptionsService),y(2,w.IOscLinkService)],C)},6193:(_,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.RenderDebouncer=void 0,c.RenderDebouncer=class{constructor(h,d){this._renderCallback=h,this._coreBrowserService=d,this._refreshCallbacks=[]}dispose(){this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}addRefreshCallback(h){return this._refreshCallbacks.push(h),this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._innerRefresh()))),this._animationFrame}refresh(h,d,y){this._rowCount=y,h=h!==void 0?h:0,d=d!==void 0?d:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,h):h,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,d):d,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 h=Math.max(this._rowStart,0),d=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(h,d),this._runRefreshCallbacks()}_runRefreshCallbacks(){for(const h of this._refreshCallbacks)h(0);this._refreshCallbacks=[]}}},3236:(_,c,h)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.Terminal=void 0;const d=h(3614),y=h(3656),p=h(3551),w=h(9042),C=h(3730),T=h(1680),E=h(3107),g=h(5744),v=h(2950),m=h(1296),S=h(428),k=h(4269),L=h(5114),R=h(8934),M=h(3230),A=h(9312),B=h(4725),K=h(6731),F=h(8055),W=h(8969),I=h(8460),Z=h(844),X=h(6114),z=h(8437),q=h(2584),V=h(7399),j=h(5941),P=h(9074),D=h(2585),U=h(5435),G=h(4567),Y=h(779);class ie extends W.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(J={}){super(J),this.browser=X,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this.register(new Z.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(P.DecorationService),this._instantiationService.setService(D.IDecorationService,this._decorationService),this._linkProviderService=this._instantiationService.createInstance(Y.LinkProviderService),this._instantiationService.setService(B.ILinkProviderService,this._linkProviderService),this._linkProviderService.registerLinkProvider(this._instantiationService.createInstance(C.OscLinkProvider)),this.register(this._inputHandler.onRequestBell((()=>this._onBell.fire()))),this.register(this._inputHandler.onRequestRefreshRows(((H,ae)=>this.refresh(H,ae)))),this.register(this._inputHandler.onRequestSendFocus((()=>this._reportFocus()))),this.register(this._inputHandler.onRequestReset((()=>this.reset()))),this.register(this._inputHandler.onRequestWindowsOptionsReport((H=>this._reportWindowsOptions(H)))),this.register(this._inputHandler.onColor((H=>this._handleColorEvent(H)))),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((H=>this._afterResize(H.cols,H.rows)))),this.register((0,Z.toDisposable)((()=>{this._customKeyEventHandler=void 0,this.element?.parentNode?.removeChild(this.element)})))}_handleColorEvent(J){if(this._themeService)for(const H of J){let ae,de="";switch(H.index){case 256:ae="foreground",de="10";break;case 257:ae="background",de="11";break;case 258:ae="cursor",de="12";break;default:ae="ansi",de="4;"+H.index}switch(H.type){case 0:const we=F.color.toColorRGB(ae==="ansi"?this._themeService.colors.ansi[H.index]:this._themeService.colors[ae]);this.coreService.triggerDataEvent(`${q.C0.ESC}]${de};${(0,j.toRgbString)(we)}${q.C1_ESCAPED.ST}`);break;case 1:if(ae==="ansi")this._themeService.modifyColors((ye=>ye.ansi[H.index]=F.channels.toColor(...H.color)));else{const ye=ae;this._themeService.modifyColors((Le=>Le[ye]=F.channels.toColor(...H.color)))}break;case 2:this._themeService.restoreColor(H.index)}}}_setup(){super._setup(),this._customKeyEventHandler=void 0}get buffer(){return this.buffers.active}focus(){this.textarea&&this.textarea.focus({preventScroll:!0})}_handleScreenReaderModeOptionChange(J){J?!this._accessibilityManager.value&&this._renderService&&(this._accessibilityManager.value=this._instantiationService.createInstance(G.AccessibilityManager,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(J){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(q.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(q.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 J=this.buffer.ybase+this.buffer.y,H=this.buffer.lines.get(J);if(!H)return;const ae=Math.min(this.buffer.x,this.cols-1),de=this._renderService.dimensions.css.cell.height,we=H.getWidth(ae),ye=this._renderService.dimensions.css.cell.width*we,Le=this.buffer.y*this._renderService.dimensions.css.cell.height,Oe=ae*this._renderService.dimensions.css.cell.width;this.textarea.style.left=Oe+"px",this.textarea.style.top=Le+"px",this.textarea.style.width=ye+"px",this.textarea.style.height=de+"px",this.textarea.style.lineHeight=de+"px",this.textarea.style.zIndex="-5"}_initGlobal(){this._bindKeys(),this.register((0,y.addDisposableDomListener)(this.element,"copy",(H=>{this.hasSelection()&&(0,d.copyHandler)(H,this._selectionService)})));const J=H=>(0,d.handlePasteEvent)(H,this.textarea,this.coreService,this.optionsService);this.register((0,y.addDisposableDomListener)(this.textarea,"paste",J)),this.register((0,y.addDisposableDomListener)(this.element,"paste",J)),X.isFirefox?this.register((0,y.addDisposableDomListener)(this.element,"mousedown",(H=>{H.button===2&&(0,d.rightClickHandler)(H,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))):this.register((0,y.addDisposableDomListener)(this.element,"contextmenu",(H=>{(0,d.rightClickHandler)(H,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))),X.isLinux&&this.register((0,y.addDisposableDomListener)(this.element,"auxclick",(H=>{H.button===1&&(0,d.moveTextAreaUnderMouseCursor)(H,this.textarea,this.screenElement)})))}_bindKeys(){this.register((0,y.addDisposableDomListener)(this.textarea,"keyup",(J=>this._keyUp(J)),!0)),this.register((0,y.addDisposableDomListener)(this.textarea,"keydown",(J=>this._keyDown(J)),!0)),this.register((0,y.addDisposableDomListener)(this.textarea,"keypress",(J=>this._keyPress(J)),!0)),this.register((0,y.addDisposableDomListener)(this.textarea,"compositionstart",(()=>this._compositionHelper.compositionstart()))),this.register((0,y.addDisposableDomListener)(this.textarea,"compositionupdate",(J=>this._compositionHelper.compositionupdate(J)))),this.register((0,y.addDisposableDomListener)(this.textarea,"compositionend",(()=>this._compositionHelper.compositionend()))),this.register((0,y.addDisposableDomListener)(this.textarea,"input",(J=>this._inputEvent(J)),!0)),this.register(this.onRender((()=>this._compositionHelper.updateCompositionElements())))}open(J){if(!J)throw new Error("Terminal requires a parent element.");if(J.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=J.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"),J.appendChild(this.element);const H=this._document.createDocumentFragment();this._viewportElement=this._document.createElement("div"),this._viewportElement.classList.add("xterm-viewport"),H.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",(ae=>this.updateCursorStyle(ae)))),this._helperContainer=this._document.createElement("div"),this._helperContainer.classList.add("xterm-helpers"),this.screenElement.appendChild(this._helperContainer),H.appendChild(this.screenElement),this.textarea=this._document.createElement("textarea"),this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",w.promptLabel),X.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,J.ownerDocument.defaultView??window,this._document??typeof window<"u"?window.document:null)),this._instantiationService.setService(B.ICoreBrowserService,this._coreBrowserService),this.register((0,y.addDisposableDomListener)(this.textarea,"focus",(ae=>this._handleTextAreaFocus(ae)))),this.register((0,y.addDisposableDomListener)(this.textarea,"blur",(()=>this._handleTextAreaBlur()))),this._helperContainer.appendChild(this.textarea),this._charSizeService=this._instantiationService.createInstance(S.CharSizeService,this._document,this._helperContainer),this._instantiationService.setService(B.ICharSizeService,this._charSizeService),this._themeService=this._instantiationService.createInstance(K.ThemeService),this._instantiationService.setService(B.IThemeService,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(k.CharacterJoinerService),this._instantiationService.setService(B.ICharacterJoinerService,this._characterJoinerService),this._renderService=this.register(this._instantiationService.createInstance(M.RenderService,this.rows,this.screenElement)),this._instantiationService.setService(B.IRenderService,this._renderService),this.register(this._renderService.onRenderedViewportChange((ae=>this._onRender.fire(ae)))),this.onResize((ae=>this._renderService.resize(ae.cols,ae.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(B.IMouseService,this._mouseService),this.linkifier=this.register(this._instantiationService.createInstance(p.Linkifier,this.screenElement)),this.element.appendChild(H);try{this._onWillOpen.fire(this.element)}catch{}this._renderService.hasRenderer()||this._renderService.setRenderer(this._createRenderer()),this.viewport=this._instantiationService.createInstance(T.Viewport,this._viewportElement,this._viewportScrollArea),this.viewport.onRequestScrollLines((ae=>this.scrollLines(ae.amount,ae.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(A.SelectionService,this.element,this.screenElement,this.linkifier)),this._instantiationService.setService(B.ISelectionService,this._selectionService),this.register(this._selectionService.onRequestScrollLines((ae=>this.scrollLines(ae.amount,ae.suppressScrollEvent)))),this.register(this._selectionService.onSelectionChange((()=>this._onSelectionChange.fire()))),this.register(this._selectionService.onRequestRedraw((ae=>this._renderService.handleSelectionChanged(ae.start,ae.end,ae.columnSelectMode)))),this.register(this._selectionService.onLinuxMouseSelection((ae=>{this.textarea.value=ae,this.textarea.focus(),this.textarea.select()}))),this.register(this._onScroll.event((ae=>{this.viewport.syncScrollArea(),this._selectionService.refresh()}))),this.register((0,y.addDisposableDomListener)(this._viewportElement,"scroll",(()=>this._selectionService.refresh()))),this.register(this._instantiationService.createInstance(E.BufferDecorationRenderer,this.screenElement)),this.register((0,y.addDisposableDomListener)(this.element,"mousedown",(ae=>this._selectionService.handleMouseDown(ae)))),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(G.AccessibilityManager,this)),this.register(this.optionsService.onSpecificOptionChange("screenReaderMode",(ae=>this._handleScreenReaderModeOptionChange(ae)))),this.options.overviewRulerWidth&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(g.OverviewRulerRenderer,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRulerWidth",(ae=>{!this._overviewRulerRenderer&&ae&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(g.OverviewRulerRenderer,this._viewportElement,this.screenElement)))})),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()}_createRenderer(){return this._instantiationService.createInstance(m.DomRenderer,this,this._document,this.element,this.screenElement,this._viewportElement,this._helperContainer,this.linkifier)}bindMouse(){const J=this,H=this.element;function ae(ye){const Le=J._mouseService.getMouseReportCoords(ye,J.screenElement);if(!Le)return!1;let Oe,Fe;switch(ye.overrideType||ye.type){case"mousemove":Fe=32,ye.buttons===void 0?(Oe=3,ye.button!==void 0&&(Oe=ye.button<3?ye.button:3)):Oe=1&ye.buttons?0:4&ye.buttons?1:2&ye.buttons?2:3;break;case"mouseup":Fe=0,Oe=ye.button<3?ye.button:3;break;case"mousedown":Fe=1,Oe=ye.button<3?ye.button:3;break;case"wheel":if(J._customWheelEventHandler&&J._customWheelEventHandler(ye)===!1||J.viewport.getLinesScrolled(ye)===0)return!1;Fe=ye.deltaY<0?0:1,Oe=4;break;default:return!1}return!(Fe===void 0||Oe===void 0||Oe>4)&&J.coreMouseService.triggerMouseEvent({col:Le.col,row:Le.row,x:Le.x,y:Le.y,button:Oe,action:Fe,ctrl:ye.ctrlKey,alt:ye.altKey,shift:ye.shiftKey})}const de={mouseup:null,wheel:null,mousedrag:null,mousemove:null},we={mouseup:ye=>(ae(ye),ye.buttons||(this._document.removeEventListener("mouseup",de.mouseup),de.mousedrag&&this._document.removeEventListener("mousemove",de.mousedrag)),this.cancel(ye)),wheel:ye=>(ae(ye),this.cancel(ye,!0)),mousedrag:ye=>{ye.buttons&&ae(ye)},mousemove:ye=>{ye.buttons||ae(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?de.mousemove||(H.addEventListener("mousemove",we.mousemove),de.mousemove=we.mousemove):(H.removeEventListener("mousemove",de.mousemove),de.mousemove=null),16&ye?de.wheel||(H.addEventListener("wheel",we.wheel,{passive:!1}),de.wheel=we.wheel):(H.removeEventListener("wheel",de.wheel),de.wheel=null),2&ye?de.mouseup||(de.mouseup=we.mouseup):(this._document.removeEventListener("mouseup",de.mouseup),de.mouseup=null),4&ye?de.mousedrag||(de.mousedrag=we.mousedrag):(this._document.removeEventListener("mousemove",de.mousedrag),de.mousedrag=null)}))),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this.register((0,y.addDisposableDomListener)(H,"mousedown",(ye=>{if(ye.preventDefault(),this.focus(),this.coreMouseService.areMouseEventsActive&&!this._selectionService.shouldForceSelection(ye))return ae(ye),de.mouseup&&this._document.addEventListener("mouseup",de.mouseup),de.mousedrag&&this._document.addEventListener("mousemove",de.mousedrag),this.cancel(ye)}))),this.register((0,y.addDisposableDomListener)(H,"wheel",(ye=>{if(!de.wheel){if(this._customWheelEventHandler&&this._customWheelEventHandler(ye)===!1)return!1;if(!this.buffer.hasScrollback){const Le=this.viewport.getLinesScrolled(ye);if(Le===0)return;const Oe=q.C0.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(ye.deltaY<0?"A":"B");let Fe="";for(let ut=0;ut<Math.abs(Le);ut++)Fe+=Oe;return this.coreService.triggerDataEvent(Fe,!0),this.cancel(ye,!0)}return this.viewport.handleWheel(ye)?this.cancel(ye):void 0}}),{passive:!1})),this.register((0,y.addDisposableDomListener)(H,"touchstart",(ye=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchStart(ye),this.cancel(ye)}),{passive:!0})),this.register((0,y.addDisposableDomListener)(H,"touchmove",(ye=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchMove(ye)?void 0:this.cancel(ye)}),{passive:!1}))}refresh(J,H){this._renderService?.refreshRows(J,H)}updateCursorStyle(J){this._selectionService?.shouldColumnSelect(J)?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(J,H,ae=0){ae===1?(super.scrollLines(J,H,ae),this.refresh(0,this.rows-1)):this.viewport?.scrollLines(J)}paste(J){(0,d.paste)(J,this.textarea,this.coreService,this.optionsService)}attachCustomKeyEventHandler(J){this._customKeyEventHandler=J}attachCustomWheelEventHandler(J){this._customWheelEventHandler=J}registerLinkProvider(J){return this._linkProviderService.registerLinkProvider(J)}registerCharacterJoiner(J){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");const H=this._characterJoinerService.register(J);return this.refresh(0,this.rows-1),H}deregisterCharacterJoiner(J){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");this._characterJoinerService.deregister(J)&&this.refresh(0,this.rows-1)}get markers(){return this.buffer.markers}registerMarker(J){return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+J)}registerDecoration(J){return this._decorationService.registerDecoration(J)}hasSelection(){return!!this._selectionService&&this._selectionService.hasSelection}select(J,H,ae){this._selectionService.setSelection(J,H,ae)}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(J,H){this._selectionService?.selectLines(J,H)}_keyDown(J){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&this._customKeyEventHandler(J)===!1)return!1;const H=this.browser.isMac&&this.options.macOptionIsMeta&&J.altKey;if(!H&&!this._compositionHelper.keydown(J))return this.options.scrollOnUserInput&&this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(),!1;H||J.key!=="Dead"&&J.key!=="AltGraph"||(this._unprocessedDeadKey=!0);const ae=(0,V.evaluateKeyboardEvent)(J,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(J),ae.type===3||ae.type===2){const de=this.rows-1;return this.scrollLines(ae.type===2?-de:de),this.cancel(J,!0)}return ae.type===1&&this.selectAll(),!!this._isThirdLevelShift(this.browser,J)||(ae.cancel&&this.cancel(J,!0),!ae.key||!!(J.key&&!J.ctrlKey&&!J.altKey&&!J.metaKey&&J.key.length===1&&J.key.charCodeAt(0)>=65&&J.key.charCodeAt(0)<=90)||(this._unprocessedDeadKey?(this._unprocessedDeadKey=!1,!0):(ae.key!==q.C0.ETX&&ae.key!==q.C0.CR||(this.textarea.value=""),this._onKey.fire({key:ae.key,domEvent:J}),this._showCursor(),this.coreService.triggerDataEvent(ae.key,!0),!this.optionsService.rawOptions.screenReaderMode||J.altKey||J.ctrlKey?this.cancel(J,!0):void(this._keyDownHandled=!0))))}_isThirdLevelShift(J,H){const ae=J.isMac&&!this.options.macOptionIsMeta&&H.altKey&&!H.ctrlKey&&!H.metaKey||J.isWindows&&H.altKey&&H.ctrlKey&&!H.metaKey||J.isWindows&&H.getModifierState("AltGraph");return H.type==="keypress"?ae:ae&&(!H.keyCode||H.keyCode>47)}_keyUp(J){this._keyDownSeen=!1,this._customKeyEventHandler&&this._customKeyEventHandler(J)===!1||((function(H){return H.keyCode===16||H.keyCode===17||H.keyCode===18})(J)||this.focus(),this.updateCursorStyle(J),this._keyPressHandled=!1)}_keyPress(J){let H;if(this._keyPressHandled=!1,this._keyDownHandled||this._customKeyEventHandler&&this._customKeyEventHandler(J)===!1)return!1;if(this.cancel(J),J.charCode)H=J.charCode;else if(J.which===null||J.which===void 0)H=J.keyCode;else{if(J.which===0||J.charCode===0)return!1;H=J.which}return!(!H||(J.altKey||J.ctrlKey||J.metaKey)&&!this._isThirdLevelShift(this.browser,J)||(H=String.fromCharCode(H),this._onKey.fire({key:H,domEvent:J}),this._showCursor(),this.coreService.triggerDataEvent(H,!0),this._keyPressHandled=!0,this._unprocessedDeadKey=!1,0))}_inputEvent(J){if(J.data&&J.inputType==="insertText"&&(!J.composed||!this._keyDownSeen)&&!this.optionsService.rawOptions.screenReaderMode){if(this._keyPressHandled)return!1;this._unprocessedDeadKey=!1;const H=J.data;return this.coreService.triggerDataEvent(H,!0),this.cancel(J),!0}return!1}resize(J,H){J!==this.cols||H!==this.rows?super.resize(J,H):this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure()}_afterResize(J,H){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 J=1;J<this.rows;J++)this.buffer.lines.push(this.buffer.getBlankLine(z.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 J=this._customKeyEventHandler;this._setup(),super.reset(),this._selectionService?.reset(),this._decorationService.reset(),this.viewport?.reset(),this._customKeyEventHandler=J,this.refresh(0,this.rows-1)}clearTextureAtlas(){this._renderService?.clearTextureAtlas()}_reportFocus(){this.element?.classList.contains("focus")?this.coreService.triggerDataEvent(q.C0.ESC+"[I"):this.coreService.triggerDataEvent(q.C0.ESC+"[O")}_reportWindowsOptions(J){if(this._renderService)switch(J){case U.WindowsOptionsReportType.GET_WIN_SIZE_PIXELS:const H=this._renderService.dimensions.css.canvas.width.toFixed(0),ae=this._renderService.dimensions.css.canvas.height.toFixed(0);this.coreService.triggerDataEvent(`${q.C0.ESC}[4;${ae};${H}t`);break;case U.WindowsOptionsReportType.GET_CELL_SIZE_PIXELS:const de=this._renderService.dimensions.css.cell.width.toFixed(0),we=this._renderService.dimensions.css.cell.height.toFixed(0);this.coreService.triggerDataEvent(`${q.C0.ESC}[6;${we};${de}t`)}}cancel(J,H){if(this.options.cancelEvents||H)return J.preventDefault(),J.stopPropagation(),!1}}c.Terminal=ie},9924:(_,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.TimeBasedDebouncer=void 0,c.TimeBasedDebouncer=class{constructor(h,d=1e3){this._renderCallback=h,this._debounceThresholdMS=d,this._lastRefreshMs=0,this._additionalRefreshRequested=!1}dispose(){this._refreshTimeoutID&&clearTimeout(this._refreshTimeoutID)}refresh(h,d,y){this._rowCount=y,h=h!==void 0?h:0,d=d!==void 0?d:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,h):h,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,d):d;const p=Date.now();if(p-this._lastRefreshMs>=this._debounceThresholdMS)this._lastRefreshMs=p,this._innerRefresh();else if(!this._additionalRefreshRequested){const w=p-this._lastRefreshMs,C=this._debounceThresholdMS-w;this._additionalRefreshRequested=!0,this._refreshTimeoutID=window.setTimeout((()=>{this._lastRefreshMs=Date.now(),this._innerRefresh(),this._additionalRefreshRequested=!1,this._refreshTimeoutID=void 0}),C)}}_innerRefresh(){if(this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return;const h=Math.max(this._rowStart,0),d=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(h,d)}}},1680:function(_,c,h){var d=this&&this.__decorate||function(v,m,S,k){var L,R=arguments.length,M=R<3?m:k===null?k=Object.getOwnPropertyDescriptor(m,S):k;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")M=Reflect.decorate(v,m,S,k);else for(var A=v.length-1;A>=0;A--)(L=v[A])&&(M=(R<3?L(M):R>3?L(m,S,M):L(m,S))||M);return R>3&&M&&Object.defineProperty(m,S,M),M},y=this&&this.__param||function(v,m){return function(S,k){m(S,k,v)}};Object.defineProperty(c,"__esModule",{value:!0}),c.Viewport=void 0;const p=h(3656),w=h(4725),C=h(8460),T=h(844),E=h(2585);let g=c.Viewport=class extends T.Disposable{constructor(v,m,S,k,L,R,M,A){super(),this._viewportElement=v,this._scrollArea=m,this._bufferService=S,this._optionsService=k,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 C.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this.scrollBarWidth=this._viewportElement.offsetWidth-this._scrollArea.offsetWidth||15,this.register((0,p.addDisposableDomListener)(this._viewportElement,"scroll",this._handleScroll.bind(this))),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate((B=>this._activeBuffer=B.activeBuffer))),this._renderDimensions=this._renderService.dimensions,this.register(this._renderService.onDimensionsChange((B=>this._renderDimensions=B))),this._handleThemeChange(A.colors),this.register(A.onChangeColors((B=>this._handleThemeChange(B)))),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 m=Math.round(this._currentRowHeight*this._lastRecordedBufferLength)+(this._lastRecordedViewportHeight-this._renderDimensions.css.canvas.height);this._lastRecordedBufferHeight!==m&&(this._lastRecordedBufferHeight=m,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 m=Math.round(this._lastScrollTop/this._currentRowHeight)-this._bufferService.buffer.ydisp;this._onRequestScrollLines.fire({amount:m,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,m){const S=this._viewportElement.scrollTop+this._lastRecordedViewportHeight;return!(m<0&&this._viewportElement.scrollTop!==0||m>0&&S<this._lastRecordedBufferHeight)||(v.cancelable&&v.preventDefault(),!1)}handleWheel(v){const m=this._getPixelsScrolled(v);return m!==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+m:this._smoothScrollState.target+=m,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()):this._viewportElement.scrollTop+=m,this._bubbleScroll(v,m))}scrollLines(v){if(v!==0)if(this._optionsService.rawOptions.smoothScrollDuration){const m=v*this._currentRowHeight;this._smoothScrollState.startTime=Date.now(),this._smoothScrollPercent()<1?(this._smoothScrollState.origin=this._viewportElement.scrollTop,this._smoothScrollState.target=this._smoothScrollState.origin+m,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 m=this._applyScrollModifier(v.deltaY,v);return v.deltaMode===WheelEvent.DOM_DELTA_LINE?m*=this._currentRowHeight:v.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(m*=this._currentRowHeight*this._bufferService.rows),m}getBufferElements(v,m){let S,k="";const L=[],R=m??this._bufferService.buffer.lines.length,M=this._bufferService.buffer.lines;for(let A=v;A<R;A++){const B=M.get(A);if(!B)continue;const K=M.get(A+1)?.isWrapped;if(k+=B.translateToString(!K),!K||A===M.length-1){const F=document.createElement("div");F.textContent=k,L.push(F),k.length>0&&(S=F),k=""}}return{bufferElements:L,cursorElement:S}}getLinesScrolled(v){if(v.deltaY===0||v.shiftKey)return 0;let m=this._applyScrollModifier(v.deltaY,v);return v.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(m/=this._currentRowHeight+0,this._wheelPartialScroll+=m,m=Math.floor(Math.abs(this._wheelPartialScroll))*(this._wheelPartialScroll>0?1:-1),this._wheelPartialScroll%=1):v.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(m*=this._bufferService.rows),m}_applyScrollModifier(v,m){const S=this._optionsService.rawOptions.fastScrollModifier;return S==="alt"&&m.altKey||S==="ctrl"&&m.ctrlKey||S==="shift"&&m.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 m=this._lastTouchY-v.touches[0].pageY;return this._lastTouchY=v.touches[0].pageY,m!==0&&(this._viewportElement.scrollTop+=m,this._bubbleScroll(v,m))}};c.Viewport=g=d([y(2,E.IBufferService),y(3,E.IOptionsService),y(4,w.ICharSizeService),y(5,w.IRenderService),y(6,w.ICoreBrowserService),y(7,w.IThemeService)],g)},3107:function(_,c,h){var d=this&&this.__decorate||function(E,g,v,m){var S,k=arguments.length,L=k<3?g:m===null?m=Object.getOwnPropertyDescriptor(g,v):m;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")L=Reflect.decorate(E,g,v,m);else for(var R=E.length-1;R>=0;R--)(S=E[R])&&(L=(k<3?S(L):k>3?S(g,v,L):S(g,v))||L);return k>3&&L&&Object.defineProperty(g,v,L),L},y=this&&this.__param||function(E,g){return function(v,m){g(v,m,E)}};Object.defineProperty(c,"__esModule",{value:!0}),c.BufferDecorationRenderer=void 0;const p=h(4725),w=h(844),C=h(2585);let T=c.BufferDecorationRenderer=class extends w.Disposable{constructor(E,g,v,m,S){super(),this._screenElement=E,this._bufferService=g,this._coreBrowserService=v,this._decorationService=m,this._renderService=S,this._decorationElements=new Map,this._altBufferIsActive=!1,this._dimensionsChanged=!1,this._container=document.createElement("div"),this._container.classList.add("xterm-decoration-container"),this._screenElement.appendChild(this._container),this.register(this._renderService.onRenderedViewportChange((()=>this._doRefreshDecorations()))),this.register(this._renderService.onDimensionsChange((()=>{this._dimensionsChanged=!0,this._queueRefresh()}))),this.register(this._coreBrowserService.onDprChange((()=>this._queueRefresh()))),this.register(this._bufferService.buffers.onBufferActivate((()=>{this._altBufferIsActive=this._bufferService.buffer===this._bufferService.buffers.alt}))),this.register(this._decorationService.onDecorationRegistered((()=>this._queueRefresh()))),this.register(this._decorationService.onDecorationRemoved((k=>this._removeDecoration(k)))),this.register((0,w.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 E of this._decorationService.decorations)this._renderDecoration(E);this._dimensionsChanged=!1}_renderDecoration(E){this._refreshStyle(E),this._dimensionsChanged&&this._refreshXPosition(E)}_createElement(E){const g=this._coreBrowserService.mainDocument.createElement("div");g.classList.add("xterm-decoration"),g.classList.toggle("xterm-decoration-top-layer",E?.options?.layer==="top"),g.style.width=`${Math.round((E.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,g.style.height=(E.options.height||1)*this._renderService.dimensions.css.cell.height+"px",g.style.top=(E.marker.line-this._bufferService.buffers.active.ydisp)*this._renderService.dimensions.css.cell.height+"px",g.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`;const v=E.options.x??0;return v&&v>this._bufferService.cols&&(g.style.display="none"),this._refreshXPosition(E,g),g}_refreshStyle(E){const g=E.marker.line-this._bufferService.buffers.active.ydisp;if(g<0||g>=this._bufferService.rows)E.element&&(E.element.style.display="none",E.onRenderEmitter.fire(E.element));else{let v=this._decorationElements.get(E);v||(v=this._createElement(E),E.element=v,this._decorationElements.set(E,v),this._container.appendChild(v),E.onDispose((()=>{this._decorationElements.delete(E),v.remove()}))),v.style.top=g*this._renderService.dimensions.css.cell.height+"px",v.style.display=this._altBufferIsActive?"none":"block",E.onRenderEmitter.fire(v)}}_refreshXPosition(E,g=E.element){if(!g)return;const v=E.options.x??0;(E.options.anchor||"left")==="right"?g.style.right=v?v*this._renderService.dimensions.css.cell.width+"px":"":g.style.left=v?v*this._renderService.dimensions.css.cell.width+"px":""}_removeDecoration(E){this._decorationElements.get(E)?.remove(),this._decorationElements.delete(E),E.dispose()}};c.BufferDecorationRenderer=T=d([y(1,C.IBufferService),y(2,p.ICoreBrowserService),y(3,C.IDecorationService),y(4,p.IRenderService)],T)},5871:(_,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(h){if(h.options.overviewRulerOptions){for(const d of this._zones)if(d.color===h.options.overviewRulerOptions.color&&d.position===h.options.overviewRulerOptions.position){if(this._lineIntersectsZone(d,h.marker.line))return;if(this._lineAdjacentToZone(d,h.marker.line,h.options.overviewRulerOptions.position))return void this._addLineToZone(d,h.marker.line)}if(this._zonePoolIndex<this._zonePool.length)return this._zonePool[this._zonePoolIndex].color=h.options.overviewRulerOptions.color,this._zonePool[this._zonePoolIndex].position=h.options.overviewRulerOptions.position,this._zonePool[this._zonePoolIndex].startBufferLine=h.marker.line,this._zonePool[this._zonePoolIndex].endBufferLine=h.marker.line,void this._zones.push(this._zonePool[this._zonePoolIndex++]);this._zones.push({color:h.options.overviewRulerOptions.color,position:h.options.overviewRulerOptions.position,startBufferLine:h.marker.line,endBufferLine:h.marker.line}),this._zonePool.push(this._zones[this._zones.length-1]),this._zonePoolIndex++}}setPadding(h){this._linePadding=h}_lineIntersectsZone(h,d){return d>=h.startBufferLine&&d<=h.endBufferLine}_lineAdjacentToZone(h,d,y){return d>=h.startBufferLine-this._linePadding[y||"full"]&&d<=h.endBufferLine+this._linePadding[y||"full"]}_addLineToZone(h,d){h.startBufferLine=Math.min(h.startBufferLine,d),h.endBufferLine=Math.max(h.endBufferLine,d)}}},5744:function(_,c,h){var d=this&&this.__decorate||function(S,k,L,R){var M,A=arguments.length,B=A<3?k:R===null?R=Object.getOwnPropertyDescriptor(k,L):R;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")B=Reflect.decorate(S,k,L,R);else for(var K=S.length-1;K>=0;K--)(M=S[K])&&(B=(A<3?M(B):A>3?M(k,L,B):M(k,L))||B);return A>3&&B&&Object.defineProperty(k,L,B),B},y=this&&this.__param||function(S,k){return function(L,R){k(L,R,S)}};Object.defineProperty(c,"__esModule",{value:!0}),c.OverviewRulerRenderer=void 0;const p=h(5871),w=h(4725),C=h(844),T=h(2585),E={full:0,left:0,center:0,right:0},g={full:0,left:0,center:0,right:0},v={full:0,left:0,center:0,right:0};let m=c.OverviewRulerRenderer=class extends C.Disposable{get _width(){return this._optionsService.options.overviewRulerWidth||0}constructor(S,k,L,R,M,A,B){super(),this._viewportElement=S,this._screenElement=k,this._bufferService=L,this._decorationService=R,this._renderService=M,this._optionsService=A,this._coreBrowserService=B,this._colorZoneStore=new p.ColorZoneStore,this._shouldUpdateDimensions=!0,this._shouldUpdateAnchor=!0,this._lastKnownBufferLength=0,this._canvas=this._coreBrowserService.mainDocument.createElement("canvas"),this._canvas.classList.add("xterm-decoration-overview-ruler"),this._refreshCanvasDimensions(),this._viewportElement.parentElement?.insertBefore(this._canvas,this._viewportElement);const K=this._canvas.getContext("2d");if(!K)throw new Error("Ctx cannot be null");this._ctx=K,this._registerDecorationListeners(),this._registerBufferChangeListeners(),this._registerDimensionChangeListeners(),this.register((0,C.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 S=Math.floor(this._canvas.width/3),k=Math.ceil(this._canvas.width/3);g.full=this._canvas.width,g.left=S,g.center=k,g.right=S,this._refreshDrawHeightConstants(),v.full=0,v.left=0,v.center=g.left,v.right=g.left+g.center}_refreshDrawHeightConstants(){E.full=Math.round(2*this._coreBrowserService.dpr);const S=this._canvas.height/this._bufferService.buffer.lines.length,k=Math.round(Math.max(Math.min(S,12),6)*this._coreBrowserService.dpr);E.left=k,E.center=k,E.right=k}_refreshColorZonePadding(){this._colorZoneStore.setPadding({full:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*E.full),left:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*E.left),center:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*E.center),right:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*E.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 k of this._decorationService.decorations)this._colorZoneStore.addDecoration(k);this._ctx.lineWidth=1;const S=this._colorZoneStore.zones;for(const k of S)k.position!=="full"&&this._renderColorZone(k);for(const k of S)k.position==="full"&&this._renderColorZone(k);this._shouldUpdateDimensions=!1,this._shouldUpdateAnchor=!1}_renderColorZone(S){this._ctx.fillStyle=S.color,this._ctx.fillRect(v[S.position||"full"],Math.round((this._canvas.height-1)*(S.startBufferLine/this._bufferService.buffers.active.lines.length)-E[S.position||"full"]/2),g[S.position||"full"],Math.round((this._canvas.height-1)*((S.endBufferLine-S.startBufferLine)/this._bufferService.buffers.active.lines.length)+E[S.position||"full"]))}_queueRefresh(S,k){this._shouldUpdateDimensions=S||this._shouldUpdateDimensions,this._shouldUpdateAnchor=k||this._shouldUpdateAnchor,this._animationFrame===void 0&&(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>{this._refreshDecorations(),this._animationFrame=void 0})))}};c.OverviewRulerRenderer=m=d([y(2,T.IBufferService),y(3,T.IDecorationService),y(4,w.IRenderService),y(5,T.IOptionsService),y(6,w.ICoreBrowserService)],m)},2950:function(_,c,h){var d=this&&this.__decorate||function(E,g,v,m){var S,k=arguments.length,L=k<3?g:m===null?m=Object.getOwnPropertyDescriptor(g,v):m;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")L=Reflect.decorate(E,g,v,m);else for(var R=E.length-1;R>=0;R--)(S=E[R])&&(L=(k<3?S(L):k>3?S(g,v,L):S(g,v))||L);return k>3&&L&&Object.defineProperty(g,v,L),L},y=this&&this.__param||function(E,g){return function(v,m){g(v,m,E)}};Object.defineProperty(c,"__esModule",{value:!0}),c.CompositionHelper=void 0;const p=h(4725),w=h(2585),C=h(2584);let T=c.CompositionHelper=class{get isComposing(){return this._isComposing}constructor(E,g,v,m,S,k){this._textarea=E,this._compositionView=g,this._bufferService=v,this._optionsService=m,this._coreService=S,this._renderService=k,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(E){this._compositionView.textContent=E.data,this.updateCompositionElements(),setTimeout((()=>{this._compositionPosition.end=this._textarea.value.length}),0)}compositionend(){this._finalizeComposition(!0)}keydown(E){if(this._isComposing||this._isSendingComposition){if(E.keyCode===229||E.keyCode===16||E.keyCode===17||E.keyCode===18)return!1;this._finalizeComposition(!1)}return E.keyCode!==229||(this._handleAnyTextareaChanges(),!1)}_finalizeComposition(E){if(this._compositionView.classList.remove("active"),this._isComposing=!1,E){const g={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout((()=>{if(this._isSendingComposition){let v;this._isSendingComposition=!1,g.start+=this._dataAlreadySent.length,v=this._isComposing?this._textarea.value.substring(g.start,g.end):this._textarea.value.substring(g.start),v.length>0&&this._coreService.triggerDataEvent(v,!0)}}),0)}else{this._isSendingComposition=!1;const g=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(g,!0)}}_handleAnyTextareaChanges(){const E=this._textarea.value;setTimeout((()=>{if(!this._isComposing){const g=this._textarea.value,v=g.replace(E,"");this._dataAlreadySent=v,g.length>E.length?this._coreService.triggerDataEvent(v,!0):g.length<E.length?this._coreService.triggerDataEvent(`${C.C0.DEL}`,!0):g.length===E.length&&g!==E&&this._coreService.triggerDataEvent(g,!0)}}),0)}updateCompositionElements(E){if(this._isComposing){if(this._bufferService.buffer.isCursorInViewport){const g=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1),v=this._renderService.dimensions.css.cell.height,m=this._bufferService.buffer.y*this._renderService.dimensions.css.cell.height,S=g*this._renderService.dimensions.css.cell.width;this._compositionView.style.left=S+"px",this._compositionView.style.top=m+"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 k=this._compositionView.getBoundingClientRect();this._textarea.style.left=S+"px",this._textarea.style.top=m+"px",this._textarea.style.width=Math.max(k.width,1)+"px",this._textarea.style.height=Math.max(k.height,1)+"px",this._textarea.style.lineHeight=k.height+"px"}E||setTimeout((()=>this.updateCompositionElements(!0)),0)}}};c.CompositionHelper=T=d([y(2,w.IBufferService),y(3,w.IOptionsService),y(4,w.ICoreService),y(5,p.IRenderService)],T)},9806:(_,c)=>{function h(d,y,p){const w=p.getBoundingClientRect(),C=d.getComputedStyle(p),T=parseInt(C.getPropertyValue("padding-left")),E=parseInt(C.getPropertyValue("padding-top"));return[y.clientX-w.left-T,y.clientY-w.top-E]}Object.defineProperty(c,"__esModule",{value:!0}),c.getCoords=c.getCoordsRelativeToElement=void 0,c.getCoordsRelativeToElement=h,c.getCoords=function(d,y,p,w,C,T,E,g,v){if(!T)return;const m=h(d,y,p);return m?(m[0]=Math.ceil((m[0]+(v?E/2:0))/E),m[1]=Math.ceil(m[1]/g),m[0]=Math.min(Math.max(m[0],1),w+(v?1:0)),m[1]=Math.min(Math.max(m[1],1),C),m):void 0}},9504:(_,c,h)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.moveToCellSequence=void 0;const d=h(2584);function y(g,v,m,S){const k=g-p(g,m),L=v-p(v,m),R=Math.abs(k-L)-(function(M,A,B){let K=0;const F=M-p(M,B),W=A-p(A,B);for(let I=0;I<Math.abs(F-W);I++){const Z=w(M,A)==="A"?-1:1;B.buffer.lines.get(F+Z*I)?.isWrapped&&K++}return K})(g,v,m);return E(R,T(w(g,v),S))}function p(g,v){let m=0,S=v.buffer.lines.get(g),k=S?.isWrapped;for(;k&&g>=0&&g<v.rows;)m++,S=v.buffer.lines.get(--g),k=S?.isWrapped;return m}function w(g,v){return g>v?"A":"B"}function C(g,v,m,S,k,L){let R=g,M=v,A="";for(;R!==m||M!==S;)R+=k?1:-1,k&&R>L.cols-1?(A+=L.buffer.translateBufferLineToString(M,!1,g,R),R=0,g=0,M++):!k&&R<0&&(A+=L.buffer.translateBufferLineToString(M,!1,0,g+1),R=L.cols-1,g=R,M--);return A+L.buffer.translateBufferLineToString(M,!1,g,R)}function T(g,v){const m=v?"O":"[";return d.C0.ESC+m+g}function E(g,v){g=Math.floor(g);let m="";for(let S=0;S<g;S++)m+=v;return m}c.moveToCellSequence=function(g,v,m,S){const k=m.buffer.x,L=m.buffer.y;if(!m.buffer.hasScrollback)return(function(A,B,K,F,W,I){return y(B,F,W,I).length===0?"":E(C(A,B,A,B-p(B,W),!1,W).length,T("D",I))})(k,L,0,v,m,S)+y(L,v,m,S)+(function(A,B,K,F,W,I){let Z;Z=y(B,F,W,I).length>0?F-p(F,W):B;const X=F,z=(function(q,V,j,P,D,U){let G;return G=y(j,P,D,U).length>0?P-p(P,D):V,q<j&&G<=P||q>=j&&G<P?"C":"D"})(A,B,K,F,W,I);return E(C(A,Z,K,X,z==="C",W).length,T(z,I))})(k,L,g,v,m,S);let R;if(L===v)return R=k>g?"D":"C",E(Math.abs(k-g),T(R,S));R=L>v?"D":"C";const M=Math.abs(L-v);return E((function(A,B){return B.cols-A})(L>v?g:k,m)+(M-1)*m.cols+1+((L>v?k:g)-1),T(R,S))}},1296:function(_,c,h){var d=this&&this.__decorate||function(I,Z,X,z){var q,V=arguments.length,j=V<3?Z:z===null?z=Object.getOwnPropertyDescriptor(Z,X):z;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")j=Reflect.decorate(I,Z,X,z);else for(var P=I.length-1;P>=0;P--)(q=I[P])&&(j=(V<3?q(j):V>3?q(Z,X,j):q(Z,X))||j);return V>3&&j&&Object.defineProperty(Z,X,j),j},y=this&&this.__param||function(I,Z){return function(X,z){Z(X,z,I)}};Object.defineProperty(c,"__esModule",{value:!0}),c.DomRenderer=void 0;const p=h(3787),w=h(2550),C=h(2223),T=h(6171),E=h(6052),g=h(4725),v=h(8055),m=h(8460),S=h(844),k=h(2585),L="xterm-dom-renderer-owner-",R="xterm-rows",M="xterm-fg-",A="xterm-bg-",B="xterm-focus",K="xterm-selection";let F=1,W=c.DomRenderer=class extends S.Disposable{constructor(I,Z,X,z,q,V,j,P,D,U,G,Y,ie){super(),this._terminal=I,this._document=Z,this._element=X,this._screenElement=z,this._viewportElement=q,this._helperContainer=V,this._linkifier2=j,this._charSizeService=D,this._optionsService=U,this._bufferService=G,this._coreBrowserService=Y,this._themeService=ie,this._terminalClass=F++,this._rowElements=[],this._selectionRenderModel=(0,E.createSelectionRenderModel)(),this.onRequestRedraw=this.register(new m.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(K),this._selectionContainer.setAttribute("aria-hidden","true"),this.dimensions=(0,T.createRenderDimensions)(),this._updateDimensions(),this.register(this._optionsService.onOptionChange((()=>this._handleOptionsChanged()))),this.register(this._themeService.onChangeColors((se=>this._injectCss(se)))),this._injectCss(this._themeService.colors),this._rowFactory=P.createInstance(p.DomRendererRowFactory,document),this._element.classList.add(L+this._terminalClass),this._screenElement.appendChild(this._rowContainer),this._screenElement.appendChild(this._selectionContainer),this.register(this._linkifier2.onShowLinkUnderline((se=>this._handleLinkHover(se)))),this.register(this._linkifier2.onHideLinkUnderline((se=>this._handleLinkLeave(se)))),this.register((0,S.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 w.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 X of this._rowElements)X.style.width=`${this.dimensions.css.canvas.width}px`,X.style.height=`${this.dimensions.css.cell.height}px`,X.style.lineHeight=`${this.dimensions.css.cell.height}px`,X.style.overflow="hidden";this._dimensionsStyleElement||(this._dimensionsStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._dimensionsStyleElement));const Z=`${this._terminalSelector} .${R} span { display: inline-block; height: 100%; vertical-align: top;}`;this._dimensionsStyleElement.textContent=Z,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 Z=`${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}`;Z+=`${this._terminalSelector} .${R} .xterm-dim { color: ${v.color.multiplyOpacity(I.foreground,.5).css};}`,Z+=`${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 X=`blink_underline_${this._terminalClass}`,z=`blink_bar_${this._terminalClass}`,q=`blink_block_${this._terminalClass}`;Z+=`@keyframes ${X} { 50% { border-bottom-style: hidden; }}`,Z+=`@keyframes ${z} { 50% { box-shadow: none; }}`,Z+=`@keyframes ${q} { 0% { background-color: ${I.cursor.css}; color: ${I.cursorAccent.css}; } 50% { background-color: inherit; color: ${I.cursor.css}; }}`,Z+=`${this._terminalSelector} .${R}.${B} .xterm-cursor.xterm-cursor-blink.xterm-cursor-underline { animation: ${X} 1s step-end infinite;}${this._terminalSelector} .${R}.${B} .xterm-cursor.xterm-cursor-blink.xterm-cursor-bar { animation: ${z} 1s step-end infinite;}${this._terminalSelector} .${R}.${B} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: ${q} 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);}`,Z+=`${this._terminalSelector} .${K} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${K} div { position: absolute; background-color: ${I.selectionBackgroundOpaque.css};}${this._terminalSelector} .${K} div { position: absolute; background-color: ${I.selectionInactiveBackgroundOpaque.css};}`;for(const[V,j]of I.ansi.entries())Z+=`${this._terminalSelector} .${M}${V} { color: ${j.css}; }${this._terminalSelector} .${M}${V}.xterm-dim { color: ${v.color.multiplyOpacity(j,.5).css}; }${this._terminalSelector} .${A}${V} { background-color: ${j.css}; }`;Z+=`${this._terminalSelector} .${M}${C.INVERTED_DEFAULT_COLOR} { color: ${v.color.opaque(I.background).css}; }${this._terminalSelector} .${M}${C.INVERTED_DEFAULT_COLOR}.xterm-dim { color: ${v.color.multiplyOpacity(v.color.opaque(I.background),.5).css}; }${this._terminalSelector} .${A}${C.INVERTED_DEFAULT_COLOR} { background-color: ${I.foreground.css}; }`,this._themeStyleElement.textContent=Z}_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,Z){for(let X=this._rowElements.length;X<=Z;X++){const z=this._document.createElement("div");this._rowContainer.appendChild(z),this._rowElements.push(z)}for(;this._rowElements.length>Z;)this._rowContainer.removeChild(this._rowElements.pop())}handleResize(I,Z){this._refreshRowElements(I,Z),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(B),this.renderRows(0,this._bufferService.rows-1)}handleFocus(){this._rowContainer.classList.add(B),this.renderRows(this._bufferService.buffer.y,this._bufferService.buffer.y)}handleSelectionChanged(I,Z,X){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged(I,Z,X),this.renderRows(0,this._bufferService.rows-1),!I||!Z)return;this._selectionRenderModel.update(this._terminal,I,Z,X);const z=this._selectionRenderModel.viewportStartRow,q=this._selectionRenderModel.viewportEndRow,V=this._selectionRenderModel.viewportCappedStartRow,j=this._selectionRenderModel.viewportCappedEndRow;if(V>=this._bufferService.rows||j<0)return;const P=this._document.createDocumentFragment();if(X){const D=I[0]>Z[0];P.appendChild(this._createSelectionElement(V,D?Z[0]:I[0],D?I[0]:Z[0],j-V+1))}else{const D=z===V?I[0]:0,U=V===q?Z[0]:this._bufferService.cols;P.appendChild(this._createSelectionElement(V,D,U));const G=j-V-1;if(P.appendChild(this._createSelectionElement(V+1,0,this._bufferService.cols,G)),V!==j){const Y=q===j?Z[0]:this._bufferService.cols;P.appendChild(this._createSelectionElement(j,0,Y))}}this._selectionContainer.appendChild(P)}_createSelectionElement(I,Z,X,z=1){const q=this._document.createElement("div"),V=Z*this.dimensions.css.cell.width;let j=this.dimensions.css.cell.width*(X-Z);return V+j>this.dimensions.css.canvas.width&&(j=this.dimensions.css.canvas.width-V),q.style.height=z*this.dimensions.css.cell.height+"px",q.style.top=I*this.dimensions.css.cell.height+"px",q.style.left=`${V}px`,q.style.width=`${j}px`,q}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,Z){const X=this._bufferService.buffer,z=X.ybase+X.y,q=Math.min(X.x,this._bufferService.cols-1),V=this._optionsService.rawOptions.cursorBlink,j=this._optionsService.rawOptions.cursorStyle,P=this._optionsService.rawOptions.cursorInactiveStyle;for(let D=I;D<=Z;D++){const U=D+X.ydisp,G=this._rowElements[D],Y=X.lines.get(U);if(!G||!Y)break;G.replaceChildren(...this._rowFactory.createRow(Y,U,U===z,j,P,q,V,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,Z,X,z,q,V){X<0&&(I=0),z<0&&(Z=0);const j=this._bufferService.rows-1;X=Math.max(Math.min(X,j),0),z=Math.max(Math.min(z,j),0),q=Math.min(q,this._bufferService.cols);const P=this._bufferService.buffer,D=P.ybase+P.y,U=Math.min(P.x,q-1),G=this._optionsService.rawOptions.cursorBlink,Y=this._optionsService.rawOptions.cursorStyle,ie=this._optionsService.rawOptions.cursorInactiveStyle;for(let se=X;se<=z;++se){const J=se+P.ydisp,H=this._rowElements[se],ae=P.lines.get(J);if(!H||!ae)break;H.replaceChildren(...this._rowFactory.createRow(ae,J,J===D,Y,ie,U,G,this.dimensions.css.cell.width,this._widthCache,V?se===X?I:0:-1,V?(se===z?Z:q)-1:-1))}}};c.DomRenderer=W=d([y(7,k.IInstantiationService),y(8,g.ICharSizeService),y(9,k.IOptionsService),y(10,k.IBufferService),y(11,g.ICoreBrowserService),y(12,g.IThemeService)],W)},3787:function(_,c,h){var d=this&&this.__decorate||function(R,M,A,B){var K,F=arguments.length,W=F<3?M:B===null?B=Object.getOwnPropertyDescriptor(M,A):B;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")W=Reflect.decorate(R,M,A,B);else for(var I=R.length-1;I>=0;I--)(K=R[I])&&(W=(F<3?K(W):F>3?K(M,A,W):K(M,A))||W);return F>3&&W&&Object.defineProperty(M,A,W),W},y=this&&this.__param||function(R,M){return function(A,B){M(A,B,R)}};Object.defineProperty(c,"__esModule",{value:!0}),c.DomRendererRowFactory=void 0;const p=h(2223),w=h(643),C=h(511),T=h(2585),E=h(8055),g=h(4725),v=h(4269),m=h(6171),S=h(3734);let k=c.DomRendererRowFactory=class{constructor(R,M,A,B,K,F,W){this._document=R,this._characterJoinerService=M,this._optionsService=A,this._coreBrowserService=B,this._coreService=K,this._decorationService=F,this._themeService=W,this._workCell=new C.CellData,this._columnSelectMode=!1,this.defaultSpacing=0}handleSelectionChanged(R,M,A){this._selectionStart=R,this._selectionEnd=M,this._columnSelectMode=A}createRow(R,M,A,B,K,F,W,I,Z,X,z){const q=[],V=this._characterJoinerService.getJoinedCharacters(M),j=this._themeService.colors;let P,D=R.getNoBgTrimmedLength();A&&D<F+1&&(D=F+1);let U=0,G="",Y=0,ie=0,se=0,J=!1,H=0,ae=!1,de=0;const we=[],ye=X!==-1&&z!==-1;for(let Le=0;Le<D;Le++){R.loadCell(Le,this._workCell);let Oe=this._workCell.getWidth();if(Oe===0)continue;let Fe=!1,ut=Le,Me=this._workCell;if(V.length>0&&Le===V[0][0]){Fe=!0;const ft=V.shift();Me=new v.JoinedCellData(this._workCell,R.translateToString(!0,ft[0],ft[1]),ft[1]-ft[0]),ut=ft[1]-1,Oe=Me.getWidth()}const Rt=this._isCellInSelection(Le,M),Xt=A&&Le===F,vn=ye&&Le>=X&&Le<=z;let an=!1;this._decorationService.forEachDecorationAtCell(Le,M,void 0,(ft=>{an=!0}));let kn=Me.getChars()||w.WHITESPACE_CELL_CHAR;if(kn===" "&&(Me.isUnderline()||Me.isOverline())&&(kn=" "),de=Oe*I-Z.get(kn,Me.isBold(),Me.isItalic()),P){if(U&&(Rt&&ae||!Rt&&!ae&&Me.bg===Y)&&(Rt&&ae&&j.selectionForeground||Me.fg===ie)&&Me.extended.ext===se&&vn===J&&de===H&&!Xt&&!Fe&&!an){Me.isInvisible()?G+=w.WHITESPACE_CELL_CHAR:G+=kn,U++;continue}U&&(P.textContent=G),P=this._document.createElement("span"),U=0,G=""}else P=this._document.createElement("span");if(Y=Me.bg,ie=Me.fg,se=Me.extended.ext,J=vn,H=de,ae=Rt,Fe&&F>=Le&&F<=ut&&(F=Le),!this._coreService.isCursorHidden&&Xt&&this._coreService.isCursorInitialized){if(we.push("xterm-cursor"),this._coreBrowserService.isFocused)W&&we.push("xterm-cursor-blink"),we.push(B==="bar"?"xterm-cursor-bar":B==="underline"?"xterm-cursor-underline":"xterm-cursor-block");else if(K)switch(K){case"outline":we.push("xterm-cursor-outline");break;case"block":we.push("xterm-cursor-block");break;case"bar":we.push("xterm-cursor-bar");break;case"underline":we.push("xterm-cursor-underline")}}if(Me.isBold()&&we.push("xterm-bold"),Me.isItalic()&&we.push("xterm-italic"),Me.isDim()&&we.push("xterm-dim"),G=Me.isInvisible()?w.WHITESPACE_CELL_CHAR:Me.getChars()||w.WHITESPACE_CELL_CHAR,Me.isUnderline()&&(we.push(`xterm-underline-${Me.extended.underlineStyle}`),G===" "&&(G=" "),!Me.isUnderlineColorDefault()))if(Me.isUnderlineColorRGB())P.style.textDecorationColor=`rgb(${S.AttributeData.toColorRGB(Me.getUnderlineColor()).join(",")})`;else{let ft=Me.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&Me.isBold()&&ft<8&&(ft+=8),P.style.textDecorationColor=j.ansi[ft].css}Me.isOverline()&&(we.push("xterm-overline"),G===" "&&(G=" ")),Me.isStrikethrough()&&we.push("xterm-strikethrough"),vn&&(P.style.textDecoration="underline");let Zt=Me.getFgColor(),ht=Me.getFgColorMode(),Lt=Me.getBgColor(),Ct=Me.getBgColorMode();const Ft=!!Me.isInverse();if(Ft){const ft=Zt;Zt=Lt,Lt=ft;const Tn=ht;ht=Ct,Ct=Tn}let Kt,Jn,bn,Pn=!1;switch(this._decorationService.forEachDecorationAtCell(Le,M,void 0,(ft=>{ft.options.layer!=="top"&&Pn||(ft.backgroundColorRGB&&(Ct=50331648,Lt=ft.backgroundColorRGB.rgba>>8&16777215,Kt=ft.backgroundColorRGB),ft.foregroundColorRGB&&(ht=50331648,Zt=ft.foregroundColorRGB.rgba>>8&16777215,Jn=ft.foregroundColorRGB),Pn=ft.options.layer==="top")})),!Pn&&Rt&&(Kt=this._coreBrowserService.isFocused?j.selectionBackgroundOpaque:j.selectionInactiveBackgroundOpaque,Lt=Kt.rgba>>8&16777215,Ct=50331648,Pn=!0,j.selectionForeground&&(ht=50331648,Zt=j.selectionForeground.rgba>>8&16777215,Jn=j.selectionForeground)),Pn&&we.push("xterm-decoration-top"),Ct){case 16777216:case 33554432:bn=j.ansi[Lt],we.push(`xterm-bg-${Lt}`);break;case 50331648:bn=E.channels.toColor(Lt>>16,Lt>>8&255,255&Lt),this._addStyle(P,`background-color:#${L((Lt>>>0).toString(16),"0",6)}`);break;default:Ft?(bn=j.foreground,we.push(`xterm-bg-${p.INVERTED_DEFAULT_COLOR}`)):bn=j.background}switch(Kt||Me.isDim()&&(Kt=E.color.multiplyOpacity(bn,.5)),ht){case 16777216:case 33554432:Me.isBold()&&Zt<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(Zt+=8),this._applyMinimumContrast(P,bn,j.ansi[Zt],Me,Kt,void 0)||we.push(`xterm-fg-${Zt}`);break;case 50331648:const ft=E.channels.toColor(Zt>>16&255,Zt>>8&255,255&Zt);this._applyMinimumContrast(P,bn,ft,Me,Kt,Jn)||this._addStyle(P,`color:#${L(Zt.toString(16),"0",6)}`);break;default:this._applyMinimumContrast(P,bn,j.foreground,Me,Kt,Jn)||Ft&&we.push(`xterm-fg-${p.INVERTED_DEFAULT_COLOR}`)}we.length&&(P.className=we.join(" "),we.length=0),Xt||Fe||an?P.textContent=G:U++,de!==this.defaultSpacing&&(P.style.letterSpacing=`${de}px`),q.push(P),Le=ut}return P&&U&&(P.textContent=G),q}_applyMinimumContrast(R,M,A,B,K,F){if(this._optionsService.rawOptions.minimumContrastRatio===1||(0,m.treatGlyphAsBackgroundColor)(B.getCode()))return!1;const W=this._getContrastCache(B);let I;if(K||F||(I=W.getColor(M.rgba,A.rgba)),I===void 0){const Z=this._optionsService.rawOptions.minimumContrastRatio/(B.isDim()?2:1);I=E.color.ensureContrastRatio(K||M,F||A,Z),W.setColor((K||M).rgba,(F||A).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 A=this._selectionStart,B=this._selectionEnd;return!(!A||!B)&&(this._columnSelectMode?A[0]<=B[0]?R>=A[0]&&M>=A[1]&&R<B[0]&&M<=B[1]:R<A[0]&&M>=A[1]&&R>=B[0]&&M<=B[1]:M>A[1]&&M<B[1]||A[1]===B[1]&&M===A[1]&&R>=A[0]&&R<B[0]||A[1]<B[1]&&M===B[1]&&R<B[0]||A[1]<B[1]&&M===A[1]&&R>=A[0])}};function L(R,M,A){for(;R.length<A;)R=M+R;return R}c.DomRendererRowFactory=k=d([y(1,g.ICharacterJoinerService),y(2,T.IOptionsService),y(3,g.ICoreBrowserService),y(4,T.ICoreService),y(5,T.IDecorationService),y(6,g.IThemeService)],k)},2550:(_,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.WidthCache=void 0,c.WidthCache=class{constructor(h,d){this._flat=new Float32Array(256),this._font="",this._fontSize=0,this._weight="normal",this._weightBold="bold",this._measureElements=[],this._container=h.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=h.createElement("span");y.classList.add("xterm-char-measure-element");const p=h.createElement("span");p.classList.add("xterm-char-measure-element"),p.style.fontWeight="bold";const w=h.createElement("span");w.classList.add("xterm-char-measure-element"),w.style.fontStyle="italic";const C=h.createElement("span");C.classList.add("xterm-char-measure-element"),C.style.fontWeight="bold",C.style.fontStyle="italic",this._measureElements=[y,p,w,C],this._container.appendChild(y),this._container.appendChild(p),this._container.appendChild(w),this._container.appendChild(C),d.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(h,d,y,p){h===this._font&&d===this._fontSize&&y===this._weight&&p===this._weightBold||(this._font=h,this._fontSize=d,this._weight=y,this._weightBold=p,this._container.style.fontFamily=this._font,this._container.style.fontSize=`${this._fontSize}px`,this._measureElements[0].style.fontWeight=`${y}`,this._measureElements[1].style.fontWeight=`${p}`,this._measureElements[2].style.fontWeight=`${y}`,this._measureElements[3].style.fontWeight=`${p}`,this.clear())}get(h,d,y){let p=0;if(!d&&!y&&h.length===1&&(p=h.charCodeAt(0))<256){if(this._flat[p]!==-9999)return this._flat[p];const T=this._measure(h,0);return T>0&&(this._flat[p]=T),T}let w=h;d&&(w+="B"),y&&(w+="I");let C=this._holey.get(w);if(C===void 0){let T=0;d&&(T|=1),y&&(T|=2),C=this._measure(h,T),C>0&&this._holey.set(w,C)}return C}_measure(h,d){const y=this._measureElements[d];return y.textContent=h.repeat(32),y.offsetWidth/32}}},2223:(_,c,h)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.TEXT_BASELINE=c.DIM_OPACITY=c.INVERTED_DEFAULT_COLOR=void 0;const d=h(6114);c.INVERTED_DEFAULT_COLOR=257,c.DIM_OPACITY=.5,c.TEXT_BASELINE=d.isFirefox||d.isLegacyEdge?"bottom":"ideographic"},6171:(_,c)=>{function h(y){return 57508<=y&&y<=57558}function d(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=h,c.isRestrictedPowerlineGlyph=function(y){return 57520<=y&&y<=57527},c.isEmoji=d,c.allowRescaling=function(y,p,w,C){return p===1&&w>Math.ceil(1.5*C)&&y!==void 0&&y>255&&!d(y)&&!h(y)&&!(function(T){return 57344<=T&&T<=63743})(y)},c.treatGlyphAsBackgroundColor=function(y){return h(y)||(function(p){return 9472<=p&&p<=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,p,w=0){return(y-(2*Math.round(p)-w))%(2*Math.round(p))}},6052:(_,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.createSelectionRenderModel=void 0;class h{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,p,w,C=!1){if(this.selectionStart=p,this.selectionEnd=w,!p||!w||p[0]===w[0]&&p[1]===w[1])return void this.clear();const T=y.buffers.active.ydisp,E=p[1]-T,g=w[1]-T,v=Math.max(E,0),m=Math.min(g,y.rows-1);v>=y.rows||m<0?this.clear():(this.hasSelection=!0,this.columnSelectMode=C,this.viewportStartRow=E,this.viewportEndRow=g,this.viewportCappedStartRow=v,this.viewportCappedEndRow=m,this.startCol=p[0],this.endCol=w[0])}isCellSelected(y,p,w){return!!this.hasSelection&&(w-=y.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?p>=this.startCol&&w>=this.viewportCappedStartRow&&p<this.endCol&&w<=this.viewportCappedEndRow:p<this.startCol&&w>=this.viewportCappedStartRow&&p>=this.endCol&&w<=this.viewportCappedEndRow:w>this.viewportStartRow&&w<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&w===this.viewportStartRow&&p>=this.startCol&&p<this.endCol||this.viewportStartRow<this.viewportEndRow&&w===this.viewportEndRow&&p<this.endCol||this.viewportStartRow<this.viewportEndRow&&w===this.viewportStartRow&&p>=this.startCol)}}c.createSelectionRenderModel=function(){return new h}},456:(_,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.SelectionModel=void 0,c.SelectionModel=class{constructor(h){this._bufferService=h,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 h=this.selectionStart[0]+this.selectionStartLength;return h>this._bufferService.cols?h%this._bufferService.cols==0?[this._bufferService.cols,this.selectionStart[1]+Math.floor(h/this._bufferService.cols)-1]:[h%this._bufferService.cols,this.selectionStart[1]+Math.floor(h/this._bufferService.cols)]:[h,this.selectionStart[1]]}if(this.selectionStartLength&&this.selectionEnd[1]===this.selectionStart[1]){const h=this.selectionStart[0]+this.selectionStartLength;return h>this._bufferService.cols?[h%this._bufferService.cols,this.selectionStart[1]+Math.floor(h/this._bufferService.cols)]:[Math.max(h,this.selectionEnd[0]),this.selectionEnd[1]]}return this.selectionEnd}}areSelectionValuesReversed(){const h=this.selectionStart,d=this.selectionEnd;return!(!h||!d)&&(h[1]>d[1]||h[1]===d[1]&&h[0]>d[0])}handleTrim(h){return this.selectionStart&&(this.selectionStart[1]-=h),this.selectionEnd&&(this.selectionEnd[1]-=h),this.selectionEnd&&this.selectionEnd[1]<0?(this.clearSelection(),!0):(this.selectionStart&&this.selectionStart[1]<0&&(this.selectionStart[1]=0),!1)}}},428:function(_,c,h){var d=this&&this.__decorate||function(m,S,k,L){var R,M=arguments.length,A=M<3?S:L===null?L=Object.getOwnPropertyDescriptor(S,k):L;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")A=Reflect.decorate(m,S,k,L);else for(var B=m.length-1;B>=0;B--)(R=m[B])&&(A=(M<3?R(A):M>3?R(S,k,A):R(S,k))||A);return M>3&&A&&Object.defineProperty(S,k,A),A},y=this&&this.__param||function(m,S){return function(k,L){S(k,L,m)}};Object.defineProperty(c,"__esModule",{value:!0}),c.CharSizeService=void 0;const p=h(2585),w=h(8460),C=h(844);let T=c.CharSizeService=class extends C.Disposable{get hasValidSize(){return this.width>0&&this.height>0}constructor(m,S,k){super(),this._optionsService=k,this.width=0,this.height=0,this._onCharSizeChange=this.register(new w.EventEmitter),this.onCharSizeChange=this._onCharSizeChange.event;try{this._measureStrategy=this.register(new v(this._optionsService))}catch{this._measureStrategy=this.register(new g(m,S,this._optionsService))}this.register(this._optionsService.onMultipleOptionChange(["fontFamily","fontSize"],(()=>this.measure())))}measure(){const m=this._measureStrategy.measure();m.width===this.width&&m.height===this.height||(this.width=m.width,this.height=m.height,this._onCharSizeChange.fire())}};c.CharSizeService=T=d([y(2,p.IOptionsService)],T);class E extends C.Disposable{constructor(){super(...arguments),this._result={width:0,height:0}}_validateAndSet(S,k){S!==void 0&&S>0&&k!==void 0&&k>0&&(this._result.width=S,this._result.height=k)}}class g extends E{constructor(S,k,L){super(),this._document=S,this._parentElement=k,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 E{constructor(S){super(),this._optionsService=S,this._canvas=new OffscreenCanvas(100,100),this._ctx=this._canvas.getContext("2d");const k=this._ctx.measureText("W");if(!("width"in k&&"fontBoundingBoxAscent"in k&&"fontBoundingBoxDescent"in k))throw new Error("Required font metrics not supported")}measure(){this._ctx.font=`${this._optionsService.rawOptions.fontSize}px ${this._optionsService.rawOptions.fontFamily}`;const S=this._ctx.measureText("W");return this._validateAndSet(S.width,S.fontBoundingBoxAscent+S.fontBoundingBoxDescent),this._result}}},4269:function(_,c,h){var d=this&&this.__decorate||function(v,m,S,k){var L,R=arguments.length,M=R<3?m:k===null?k=Object.getOwnPropertyDescriptor(m,S):k;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")M=Reflect.decorate(v,m,S,k);else for(var A=v.length-1;A>=0;A--)(L=v[A])&&(M=(R<3?L(M):R>3?L(m,S,M):L(m,S))||M);return R>3&&M&&Object.defineProperty(m,S,M),M},y=this&&this.__param||function(v,m){return function(S,k){m(S,k,v)}};Object.defineProperty(c,"__esModule",{value:!0}),c.CharacterJoinerService=c.JoinedCellData=void 0;const p=h(3734),w=h(643),C=h(511),T=h(2585);class E extends p.AttributeData{constructor(m,S,k){super(),this.content=0,this.combinedData="",this.fg=m.fg,this.bg=m.bg,this.combinedData=S,this._width=k}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(m){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}c.JoinedCellData=E;let g=c.CharacterJoinerService=class dx{constructor(m){this._bufferService=m,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new C.CellData}register(m){const S={id:this._nextCharacterJoinerId++,handler:m};return this._characterJoiners.push(S),S.id}deregister(m){for(let S=0;S<this._characterJoiners.length;S++)if(this._characterJoiners[S].id===m)return this._characterJoiners.splice(S,1),!0;return!1}getJoinedCharacters(m){if(this._characterJoiners.length===0)return[];const S=this._bufferService.buffer.lines.get(m);if(!S||S.length===0)return[];const k=[],L=S.translateToString(!0);let R=0,M=0,A=0,B=S.getFg(0),K=S.getBg(0);for(let F=0;F<S.getTrimmedLength();F++)if(S.loadCell(F,this._workCell),this._workCell.getWidth()!==0){if(this._workCell.fg!==B||this._workCell.bg!==K){if(F-R>1){const W=this._getJoinedRanges(L,A,M,S,R);for(let I=0;I<W.length;I++)k.push(W[I])}R=F,A=M,B=this._workCell.fg,K=this._workCell.bg}M+=this._workCell.getChars().length||w.WHITESPACE_CELL_CHAR.length}if(this._bufferService.cols-R>1){const F=this._getJoinedRanges(L,A,M,S,R);for(let W=0;W<F.length;W++)k.push(F[W])}return k}_getJoinedRanges(m,S,k,L,R){const M=m.substring(S,k);let A=[];try{A=this._characterJoiners[0].handler(M)}catch(B){console.error(B)}for(let B=1;B<this._characterJoiners.length;B++)try{const K=this._characterJoiners[B].handler(M);for(let F=0;F<K.length;F++)dx._mergeRanges(A,K[F])}catch(K){console.error(K)}return this._stringRangesToCellRanges(A,L,R),A}_stringRangesToCellRanges(m,S,k){let L=0,R=!1,M=0,A=m[L];if(A){for(let B=k;B<this._bufferService.cols;B++){const K=S.getWidth(B),F=S.getString(B).length||w.WHITESPACE_CELL_CHAR.length;if(K!==0){if(!R&&A[0]<=M&&(A[0]=B,R=!0),A[1]<=M){if(A[1]=B,A=m[++L],!A)break;A[0]<=M?(A[0]=B,R=!0):R=!1}M+=F}}A&&(A[1]=this._bufferService.cols)}}static _mergeRanges(m,S){let k=!1;for(let L=0;L<m.length;L++){const R=m[L];if(k){if(S[1]<=R[0])return m[L-1][1]=S[1],m;if(S[1]<=R[1])return m[L-1][1]=Math.max(S[1],R[1]),m.splice(L,1),m;m.splice(L,1),L--}else{if(S[1]<=R[0])return m.splice(L,0,S),m;if(S[1]<=R[1])return R[0]=Math.min(S[0],R[0]),m;S[0]<R[1]&&(R[0]=Math.min(S[0],R[0]),k=!0)}}return k?m[m.length-1][1]=S[1]:m.push(S),m}};c.CharacterJoinerService=g=d([y(0,T.IBufferService)],g)},5114:(_,c,h)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.CoreBrowserService=void 0;const d=h(844),y=h(8460),p=h(3656);class w extends d.Disposable{constructor(E,g,v){super(),this._textarea=E,this._window=g,this.mainDocument=v,this._isFocused=!1,this._cachedIsFocused=void 0,this._screenDprMonitor=new C(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((m=>this._screenDprMonitor.setWindow(m)))),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(E){this._window!==E&&(this._window=E,this._onWindowChange.fire(this._window))}get dpr(){return this.window.devicePixelRatio}get isFocused(){return this._cachedIsFocused===void 0&&(this._cachedIsFocused=this._isFocused&&this._textarea.ownerDocument.hasFocus(),queueMicrotask((()=>this._cachedIsFocused=void 0))),this._cachedIsFocused}}c.CoreBrowserService=w;class C extends d.Disposable{constructor(E){super(),this._parentWindow=E,this._windowResizeListener=this.register(new d.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,d.toDisposable)((()=>this.clearListener())))}setWindow(E){this._parentWindow=E,this._setWindowResizeListener(),this._setDprAndFireIfDiffers()}_setWindowResizeListener(){this._windowResizeListener.value=(0,p.addDisposableDomListener)(this._parentWindow,"resize",(()=>this._setDprAndFireIfDiffers()))}_setDprAndFireIfDiffers(){this._parentWindow.devicePixelRatio!==this._currentDevicePixelRatio&&this._onDprChange.fire(this._parentWindow.devicePixelRatio),this._updateDpr()}_updateDpr(){this._outerListener&&(this._resolutionMediaMatchList?.removeListener(this._outerListener),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._resolutionMediaMatchList=this._parentWindow.matchMedia(`screen and (resolution: ${this._parentWindow.devicePixelRatio}dppx)`),this._resolutionMediaMatchList.addListener(this._outerListener))}clearListener(){this._resolutionMediaMatchList&&this._outerListener&&(this._resolutionMediaMatchList.removeListener(this._outerListener),this._resolutionMediaMatchList=void 0,this._outerListener=void 0)}}},779:(_,c,h)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.LinkProviderService=void 0;const d=h(844);class y extends d.Disposable{constructor(){super(),this.linkProviders=[],this.register((0,d.toDisposable)((()=>this.linkProviders.length=0)))}registerLinkProvider(w){return this.linkProviders.push(w),{dispose:()=>{const C=this.linkProviders.indexOf(w);C!==-1&&this.linkProviders.splice(C,1)}}}}c.LinkProviderService=y},8934:function(_,c,h){var d=this&&this.__decorate||function(T,E,g,v){var m,S=arguments.length,k=S<3?E:v===null?v=Object.getOwnPropertyDescriptor(E,g):v;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")k=Reflect.decorate(T,E,g,v);else for(var L=T.length-1;L>=0;L--)(m=T[L])&&(k=(S<3?m(k):S>3?m(E,g,k):m(E,g))||k);return S>3&&k&&Object.defineProperty(E,g,k),k},y=this&&this.__param||function(T,E){return function(g,v){E(g,v,T)}};Object.defineProperty(c,"__esModule",{value:!0}),c.MouseService=void 0;const p=h(4725),w=h(9806);let C=c.MouseService=class{constructor(T,E){this._renderService=T,this._charSizeService=E}getCoords(T,E,g,v,m){return(0,w.getCoords)(window,T,E,g,v,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,m)}getMouseReportCoords(T,E){const g=(0,w.getCoordsRelativeToElement)(window,T,E);if(this._charSizeService.hasValidSize)return g[0]=Math.min(Math.max(g[0],0),this._renderService.dimensions.css.canvas.width-1),g[1]=Math.min(Math.max(g[1],0),this._renderService.dimensions.css.canvas.height-1),{col:Math.floor(g[0]/this._renderService.dimensions.css.cell.width),row:Math.floor(g[1]/this._renderService.dimensions.css.cell.height),x:Math.floor(g[0]),y:Math.floor(g[1])}}};c.MouseService=C=d([y(0,p.IRenderService),y(1,p.ICharSizeService)],C)},3230:function(_,c,h){var d=this&&this.__decorate||function(m,S,k,L){var R,M=arguments.length,A=M<3?S:L===null?L=Object.getOwnPropertyDescriptor(S,k):L;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")A=Reflect.decorate(m,S,k,L);else for(var B=m.length-1;B>=0;B--)(R=m[B])&&(A=(M<3?R(A):M>3?R(S,k,A):R(S,k))||A);return M>3&&A&&Object.defineProperty(S,k,A),A},y=this&&this.__param||function(m,S){return function(k,L){S(k,L,m)}};Object.defineProperty(c,"__esModule",{value:!0}),c.RenderService=void 0;const p=h(6193),w=h(4725),C=h(8460),T=h(844),E=h(7226),g=h(2585);let v=c.RenderService=class extends T.Disposable{get dimensions(){return this._renderer.value.dimensions}constructor(m,S,k,L,R,M,A,B){super(),this._rowCount=m,this._charSizeService=L,this._renderer=this.register(new T.MutableDisposable),this._pausedResizeTask=new E.DebouncedIdleTask,this._observerDisposable=this.register(new T.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 C.EventEmitter),this.onDimensionsChange=this._onDimensionsChange.event,this._onRenderedViewportChange=this.register(new C.EventEmitter),this.onRenderedViewportChange=this._onRenderedViewportChange.event,this._onRender=this.register(new C.EventEmitter),this.onRender=this._onRender.event,this._onRefreshRequest=this.register(new C.EventEmitter),this.onRefreshRequest=this._onRefreshRequest.event,this._renderDebouncer=new p.RenderDebouncer(((K,F)=>this._renderRows(K,F)),A),this.register(this._renderDebouncer),this.register(A.onDprChange((()=>this.handleDevicePixelRatioChange()))),this.register(M.onResize((()=>this._fullRefresh()))),this.register(M.buffers.onBufferActivate((()=>this._renderer.value?.clear()))),this.register(k.onOptionChange((()=>this._handleOptionsChanged()))),this.register(this._charSizeService.onCharSizeChange((()=>this.handleCharSizeChanged()))),this.register(R.onDecorationRegistered((()=>this._fullRefresh()))),this.register(R.onDecorationRemoved((()=>this._fullRefresh()))),this.register(k.onMultipleOptionChange(["customGlyphs","drawBoldTextInBrightColors","letterSpacing","lineHeight","fontFamily","fontSize","fontWeight","fontWeightBold","minimumContrastRatio","rescaleOverlappingGlyphs"],(()=>{this.clear(),this.handleResize(M.cols,M.rows),this._fullRefresh()}))),this.register(k.onMultipleOptionChange(["cursorBlink","cursorStyle"],(()=>this.refreshRows(M.buffer.y,M.buffer.y,!0)))),this.register(B.onChangeColors((()=>this._fullRefresh()))),this._registerIntersectionObserver(A.window,S),this.register(A.onWindowChange((K=>this._registerIntersectionObserver(K,S))))}_registerIntersectionObserver(m,S){if("IntersectionObserver"in m){const k=new m.IntersectionObserver((L=>this._handleIntersectionChange(L[L.length-1])),{threshold:0});k.observe(S),this._observerDisposable.value=(0,T.toDisposable)((()=>k.disconnect()))}}_handleIntersectionChange(m){this._isPaused=m.isIntersecting===void 0?m.intersectionRatio===0:!m.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(m,S,k=!1){this._isPaused?this._needsFullRefresh=!0:(k||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(m,S,this._rowCount))}_renderRows(m,S){this._renderer.value&&(m=Math.min(m,this._rowCount-1),S=Math.min(S,this._rowCount-1),this._renderer.value.renderRows(m,S),this._needsSelectionRefresh&&(this._renderer.value.handleSelectionChanged(this._selectionState.start,this._selectionState.end,this._selectionState.columnSelectMode),this._needsSelectionRefresh=!1),this._isNextRenderRedrawOnly||this._onRenderedViewportChange.fire({start:m,end:S}),this._onRender.fire({start:m,end:S}),this._isNextRenderRedrawOnly=!0)}resize(m,S){this._rowCount=S,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(m){this._renderer.value=m,this._renderer.value&&(this._renderer.value.onRequestRedraw((S=>this.refreshRows(S.start,S.end,!0))),this._needsSelectionRefresh=!0,this._fullRefresh())}addRefreshCallback(m){return this._renderDebouncer.addRefreshCallback(m)}_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(m,S){this._renderer.value&&(this._isPaused?this._pausedResizeTask.set((()=>this._renderer.value?.handleResize(m,S))):this._renderer.value.handleResize(m,S),this._fullRefresh())}handleCharSizeChanged(){this._renderer.value?.handleCharSizeChanged()}handleBlur(){this._renderer.value?.handleBlur()}handleFocus(){this._renderer.value?.handleFocus()}handleSelectionChanged(m,S,k){this._selectionState.start=m,this._selectionState.end=S,this._selectionState.columnSelectMode=k,this._renderer.value?.handleSelectionChanged(m,S,k)}handleCursorMove(){this._renderer.value?.handleCursorMove()}clear(){this._renderer.value?.clear()}};c.RenderService=v=d([y(2,g.IOptionsService),y(3,w.ICharSizeService),y(4,g.IDecorationService),y(5,g.IBufferService),y(6,w.ICoreBrowserService),y(7,w.IThemeService)],v)},9312:function(_,c,h){var d=this&&this.__decorate||function(A,B,K,F){var W,I=arguments.length,Z=I<3?B:F===null?F=Object.getOwnPropertyDescriptor(B,K):F;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")Z=Reflect.decorate(A,B,K,F);else for(var X=A.length-1;X>=0;X--)(W=A[X])&&(Z=(I<3?W(Z):I>3?W(B,K,Z):W(B,K))||Z);return I>3&&Z&&Object.defineProperty(B,K,Z),Z},y=this&&this.__param||function(A,B){return function(K,F){B(K,F,A)}};Object.defineProperty(c,"__esModule",{value:!0}),c.SelectionService=void 0;const p=h(9806),w=h(9504),C=h(456),T=h(4725),E=h(8460),g=h(844),v=h(6114),m=h(4841),S=h(511),k=h(2585),L=" ",R=new RegExp(L,"g");let M=c.SelectionService=class extends g.Disposable{constructor(A,B,K,F,W,I,Z,X,z){super(),this._element=A,this._screenElement=B,this._linkifier=K,this._bufferService=F,this._coreService=W,this._mouseService=I,this._optionsService=Z,this._renderService=X,this._coreBrowserService=z,this._dragScrollAmount=0,this._enabled=!0,this._workCell=new S.CellData,this._mouseDownTimeStamp=0,this._oldHasSelection=!1,this._oldSelectionStart=void 0,this._oldSelectionEnd=void 0,this._onLinuxMouseSelection=this.register(new E.EventEmitter),this.onLinuxMouseSelection=this._onLinuxMouseSelection.event,this._onRedrawRequest=this.register(new E.EventEmitter),this.onRequestRedraw=this._onRedrawRequest.event,this._onSelectionChange=this.register(new E.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onRequestScrollLines=this.register(new E.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this._mouseMoveListener=q=>this._handleMouseMove(q),this._mouseUpListener=q=>this._handleMouseUp(q),this._coreService.onUserInput((()=>{this.hasSelection&&this.clearSelection()})),this._trimListener=this._bufferService.buffer.lines.onTrim((q=>this._handleTrim(q))),this.register(this._bufferService.buffers.onBufferActivate((q=>this._handleBufferActivate(q)))),this.enable(),this._model=new C.SelectionModel(this._bufferService),this._activeSelectionMode=0,this.register((0,g.toDisposable)((()=>{this._removeMouseDownListeners()})))}reset(){this.clearSelection()}disable(){this.clearSelection(),this._enabled=!1}enable(){this._enabled=!0}get selectionStart(){return this._model.finalSelectionStart}get selectionEnd(){return this._model.finalSelectionEnd}get hasSelection(){const A=this._model.finalSelectionStart,B=this._model.finalSelectionEnd;return!(!A||!B||A[0]===B[0]&&A[1]===B[1])}get selectionText(){const A=this._model.finalSelectionStart,B=this._model.finalSelectionEnd;if(!A||!B)return"";const K=this._bufferService.buffer,F=[];if(this._activeSelectionMode===3){if(A[0]===B[0])return"";const W=A[0]<B[0]?A[0]:B[0],I=A[0]<B[0]?B[0]:A[0];for(let Z=A[1];Z<=B[1];Z++){const X=K.translateBufferLineToString(Z,!0,W,I);F.push(X)}}else{const W=A[1]===B[1]?B[0]:void 0;F.push(K.translateBufferLineToString(A[1],!0,A[0],W));for(let I=A[1]+1;I<=B[1]-1;I++){const Z=K.lines.get(I),X=K.translateBufferLineToString(I,!0);Z?.isWrapped?F[F.length-1]+=X:F.push(X)}if(A[1]!==B[1]){const I=K.lines.get(B[1]),Z=K.translateBufferLineToString(B[1],!0,0,B[0]);I&&I.isWrapped?F[F.length-1]+=Z:F.push(Z)}}return F.map((W=>W.replace(R," "))).join(v.isWindows?`\r
|
|
79
|
-
`:`
|
|
80
|
-
`)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(A){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._refresh()))),v.isLinux&&A&&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(A){const B=this._getMouseBufferCoords(A),K=this._model.finalSelectionStart,F=this._model.finalSelectionEnd;return!!(K&&F&&B)&&this._areCoordsInSelection(B,K,F)}isCellInSelection(A,B){const K=this._model.finalSelectionStart,F=this._model.finalSelectionEnd;return!(!K||!F)&&this._areCoordsInSelection([A,B],K,F)}_areCoordsInSelection(A,B,K){return A[1]>B[1]&&A[1]<K[1]||B[1]===K[1]&&A[1]===B[1]&&A[0]>=B[0]&&A[0]<K[0]||B[1]<K[1]&&A[1]===K[1]&&A[0]<K[0]||B[1]<K[1]&&A[1]===B[1]&&A[0]>=B[0]}_selectWordAtCursor(A,B){const K=this._linkifier.currentLink?.link?.range;if(K)return this._model.selectionStart=[K.start.x-1,K.start.y-1],this._model.selectionStartLength=(0,m.getRangeLength)(K,this._bufferService.cols),this._model.selectionEnd=void 0,!0;const F=this._getMouseBufferCoords(A);return!!F&&(this._selectWordAt(F,B),this._model.selectionEnd=void 0,!0)}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(A,B){this._model.clearSelection(),A=Math.max(A,0),B=Math.min(B,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,A],this._model.selectionEnd=[this._bufferService.cols,B],this.refresh(),this._onSelectionChange.fire()}_handleTrim(A){this._model.handleTrim(A)&&this.refresh()}_getMouseBufferCoords(A){const B=this._mouseService.getCoords(A,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(B)return B[0]--,B[1]--,B[1]+=this._bufferService.buffer.ydisp,B}_getMouseEventScrollAmount(A){let B=(0,p.getCoordsRelativeToElement)(this._coreBrowserService.window,A,this._screenElement)[1];const K=this._renderService.dimensions.css.canvas.height;return B>=0&&B<=K?0:(B>K&&(B-=K),B=Math.min(Math.max(B,-50),50),B/=50,B/Math.abs(B)+Math.round(14*B))}shouldForceSelection(A){return v.isMac?A.altKey&&this._optionsService.rawOptions.macOptionClickForcesSelection:A.shiftKey}handleMouseDown(A){if(this._mouseDownTimeStamp=A.timeStamp,(A.button!==2||!this.hasSelection)&&A.button===0){if(!this._enabled){if(!this.shouldForceSelection(A))return;A.stopPropagation()}A.preventDefault(),this._dragScrollAmount=0,this._enabled&&A.shiftKey?this._handleIncrementalClick(A):A.detail===1?this._handleSingleClick(A):A.detail===2?this._handleDoubleClick(A):A.detail===3&&this._handleTripleClick(A),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(A){this._model.selectionStart&&(this._model.selectionEnd=this._getMouseBufferCoords(A))}_handleSingleClick(A){if(this._model.selectionStartLength=0,this._model.isSelectAllActive=!1,this._activeSelectionMode=this.shouldColumnSelect(A)?3:0,this._model.selectionStart=this._getMouseBufferCoords(A),!this._model.selectionStart)return;this._model.selectionEnd=void 0;const B=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);B&&B.length!==this._model.selectionStart[0]&&B.hasWidth(this._model.selectionStart[0])===0&&this._model.selectionStart[0]++}_handleDoubleClick(A){this._selectWordAtCursor(A,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(A){const B=this._getMouseBufferCoords(A);B&&(this._activeSelectionMode=2,this._selectLineAt(B[1]))}shouldColumnSelect(A){return A.altKey&&!(v.isMac&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(A){if(A.stopImmediatePropagation(),!this._model.selectionStart)return;const B=this._model.selectionEnd?[this._model.selectionEnd[0],this._model.selectionEnd[1]]:null;if(this._model.selectionEnd=this._getMouseBufferCoords(A),!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(A),this._activeSelectionMode!==3&&(this._dragScrollAmount>0?this._model.selectionEnd[0]=this._bufferService.cols:this._dragScrollAmount<0&&(this._model.selectionEnd[0]=0));const K=this._bufferService.buffer;if(this._model.selectionEnd[1]<K.lines.length){const F=K.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]++}B&&B[0]===this._model.selectionEnd[0]&&B[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 A=this._bufferService.buffer;this._dragScrollAmount>0?(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=this._bufferService.cols),this._model.selectionEnd[1]=Math.min(A.ydisp+this._bufferService.rows,A.lines.length-1)):(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=0),this._model.selectionEnd[1]=A.ydisp),this.refresh()}}_handleMouseUp(A){const B=A.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&B<500&&A.altKey&&this._optionsService.rawOptions.altClickMovesCursor){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){const K=this._mouseService.getCoords(A,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(K&&K[0]!==void 0&&K[1]!==void 0){const F=(0,w.moveToCellSequence)(K[0]-1,K[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(F,!0)}}}else this._fireEventIfSelectionChanged()}_fireEventIfSelectionChanged(){const A=this._model.finalSelectionStart,B=this._model.finalSelectionEnd,K=!(!A||!B||A[0]===B[0]&&A[1]===B[1]);K?A&&B&&(this._oldSelectionStart&&this._oldSelectionEnd&&A[0]===this._oldSelectionStart[0]&&A[1]===this._oldSelectionStart[1]&&B[0]===this._oldSelectionEnd[0]&&B[1]===this._oldSelectionEnd[1]||this._fireOnSelectionChange(A,B,K)):this._oldHasSelection&&this._fireOnSelectionChange(A,B,K)}_fireOnSelectionChange(A,B,K){this._oldSelectionStart=A,this._oldSelectionEnd=B,this._oldHasSelection=K,this._onSelectionChange.fire()}_handleBufferActivate(A){this.clearSelection(),this._trimListener.dispose(),this._trimListener=A.activeBuffer.lines.onTrim((B=>this._handleTrim(B)))}_convertViewportColToCharacterIndex(A,B){let K=B;for(let F=0;B>=F;F++){const W=A.loadCell(F,this._workCell).getChars().length;this._workCell.getWidth()===0?K--:W>1&&B!==F&&(K+=W-1)}return K}setSelection(A,B,K){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[A,B],this._model.selectionStartLength=K,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(A){this._isClickInSelection(A)||(this._selectWordAtCursor(A,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(A,B,K=!0,F=!0){if(A[0]>=this._bufferService.cols)return;const W=this._bufferService.buffer,I=W.lines.get(A[1]);if(!I)return;const Z=W.translateBufferLineToString(A[1],!1);let X=this._convertViewportColToCharacterIndex(I,A[0]),z=X;const q=A[0]-X;let V=0,j=0,P=0,D=0;if(Z.charAt(X)===" "){for(;X>0&&Z.charAt(X-1)===" ";)X--;for(;z<Z.length&&Z.charAt(z+1)===" ";)z++}else{let Y=A[0],ie=A[0];I.getWidth(Y)===0&&(V++,Y--),I.getWidth(ie)===2&&(j++,ie++);const se=I.getString(ie).length;for(se>1&&(D+=se-1,z+=se-1);Y>0&&X>0&&!this._isCharWordSeparator(I.loadCell(Y-1,this._workCell));){I.loadCell(Y-1,this._workCell);const J=this._workCell.getChars().length;this._workCell.getWidth()===0?(V++,Y--):J>1&&(P+=J-1,X-=J-1),X--,Y--}for(;ie<I.length&&z+1<Z.length&&!this._isCharWordSeparator(I.loadCell(ie+1,this._workCell));){I.loadCell(ie+1,this._workCell);const J=this._workCell.getChars().length;this._workCell.getWidth()===2?(j++,ie++):J>1&&(D+=J-1,z+=J-1),z++,ie++}}z++;let U=X+q-V+P,G=Math.min(this._bufferService.cols,z-X+V+j-P-D);if(B||Z.slice(X,z).trim()!==""){if(K&&U===0&&I.getCodePoint(0)!==32){const Y=W.lines.get(A[1]-1);if(Y&&I.isWrapped&&Y.getCodePoint(this._bufferService.cols-1)!==32){const ie=this._getWordAt([this._bufferService.cols-1,A[1]-1],!1,!0,!1);if(ie){const se=this._bufferService.cols-ie.start;U-=se,G+=se}}}if(F&&U+G===this._bufferService.cols&&I.getCodePoint(this._bufferService.cols-1)!==32){const Y=W.lines.get(A[1]+1);if(Y?.isWrapped&&Y.getCodePoint(0)!==32){const ie=this._getWordAt([0,A[1]+1],!1,!1,!0);ie&&(G+=ie.length)}}return{start:U,length:G}}}_selectWordAt(A,B){const K=this._getWordAt(A,B);if(K){for(;K.start<0;)K.start+=this._bufferService.cols,A[1]--;this._model.selectionStart=[K.start,A[1]],this._model.selectionStartLength=K.length}}_selectToWordAt(A){const B=this._getWordAt(A,!0);if(B){let K=A[1];for(;B.start<0;)B.start+=this._bufferService.cols,K--;if(!this._model.areSelectionValuesReversed())for(;B.start+B.length>this._bufferService.cols;)B.length-=this._bufferService.cols,K++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?B.start:B.start+B.length,K]}}_isCharWordSeparator(A){return A.getWidth()!==0&&this._optionsService.rawOptions.wordSeparator.indexOf(A.getChars())>=0}_selectLineAt(A){const B=this._bufferService.buffer.getWrappedRangeForLine(A),K={start:{x:0,y:B.first},end:{x:this._bufferService.cols-1,y:B.last}};this._model.selectionStart=[0,B.first],this._model.selectionEnd=void 0,this._model.selectionStartLength=(0,m.getRangeLength)(K,this._bufferService.cols)}};c.SelectionService=M=d([y(3,k.IBufferService),y(4,k.ICoreService),y(5,T.IMouseService),y(6,k.IOptionsService),y(7,T.IRenderService),y(8,T.ICoreBrowserService)],M)},4725:(_,c,h)=>{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 d=h(8343);c.ICharSizeService=(0,d.createDecorator)("CharSizeService"),c.ICoreBrowserService=(0,d.createDecorator)("CoreBrowserService"),c.IMouseService=(0,d.createDecorator)("MouseService"),c.IRenderService=(0,d.createDecorator)("RenderService"),c.ISelectionService=(0,d.createDecorator)("SelectionService"),c.ICharacterJoinerService=(0,d.createDecorator)("CharacterJoinerService"),c.IThemeService=(0,d.createDecorator)("ThemeService"),c.ILinkProviderService=(0,d.createDecorator)("LinkProviderService")},6731:function(_,c,h){var d=this&&this.__decorate||function(M,A,B,K){var F,W=arguments.length,I=W<3?A:K===null?K=Object.getOwnPropertyDescriptor(A,B):K;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")I=Reflect.decorate(M,A,B,K);else for(var Z=M.length-1;Z>=0;Z--)(F=M[Z])&&(I=(W<3?F(I):W>3?F(A,B,I):F(A,B))||I);return W>3&&I&&Object.defineProperty(A,B,I),I},y=this&&this.__param||function(M,A){return function(B,K){A(B,K,M)}};Object.defineProperty(c,"__esModule",{value:!0}),c.ThemeService=c.DEFAULT_ANSI_COLORS=void 0;const p=h(7239),w=h(8055),C=h(8460),T=h(844),E=h(2585),g=w.css.toColor("#ffffff"),v=w.css.toColor("#000000"),m=w.css.toColor("#ffffff"),S=w.css.toColor("#000000"),k={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117};c.DEFAULT_ANSI_COLORS=Object.freeze((()=>{const M=[w.css.toColor("#2e3436"),w.css.toColor("#cc0000"),w.css.toColor("#4e9a06"),w.css.toColor("#c4a000"),w.css.toColor("#3465a4"),w.css.toColor("#75507b"),w.css.toColor("#06989a"),w.css.toColor("#d3d7cf"),w.css.toColor("#555753"),w.css.toColor("#ef2929"),w.css.toColor("#8ae234"),w.css.toColor("#fce94f"),w.css.toColor("#729fcf"),w.css.toColor("#ad7fa8"),w.css.toColor("#34e2e2"),w.css.toColor("#eeeeec")],A=[0,95,135,175,215,255];for(let B=0;B<216;B++){const K=A[B/36%6|0],F=A[B/6%6|0],W=A[B%6];M.push({css:w.channels.toCss(K,F,W),rgba:w.channels.toRgba(K,F,W)})}for(let B=0;B<24;B++){const K=8+10*B;M.push({css:w.channels.toCss(K,K,K),rgba:w.channels.toRgba(K,K,K)})}return M})());let L=c.ThemeService=class extends T.Disposable{get colors(){return this._colors}constructor(M){super(),this._optionsService=M,this._contrastCache=new p.ColorContrastCache,this._halfContrastCache=new p.ColorContrastCache,this._onChangeColors=this.register(new C.EventEmitter),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:g,background:v,cursor:m,cursorAccent:S,selectionForeground:void 0,selectionBackgroundTransparent:k,selectionBackgroundOpaque:w.color.blend(v,k),selectionInactiveBackgroundTransparent:k,selectionInactiveBackgroundOpaque:w.color.blend(v,k),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 A=this._colors;if(A.foreground=R(M.foreground,g),A.background=R(M.background,v),A.cursor=R(M.cursor,m),A.cursorAccent=R(M.cursorAccent,S),A.selectionBackgroundTransparent=R(M.selectionBackground,k),A.selectionBackgroundOpaque=w.color.blend(A.background,A.selectionBackgroundTransparent),A.selectionInactiveBackgroundTransparent=R(M.selectionInactiveBackground,A.selectionBackgroundTransparent),A.selectionInactiveBackgroundOpaque=w.color.blend(A.background,A.selectionInactiveBackgroundTransparent),A.selectionForeground=M.selectionForeground?R(M.selectionForeground,w.NULL_COLOR):void 0,A.selectionForeground===w.NULL_COLOR&&(A.selectionForeground=void 0),w.color.isOpaque(A.selectionBackgroundTransparent)&&(A.selectionBackgroundTransparent=w.color.opacity(A.selectionBackgroundTransparent,.3)),w.color.isOpaque(A.selectionInactiveBackgroundTransparent)&&(A.selectionInactiveBackgroundTransparent=w.color.opacity(A.selectionInactiveBackgroundTransparent,.3)),A.ansi=c.DEFAULT_ANSI_COLORS.slice(),A.ansi[0]=R(M.black,c.DEFAULT_ANSI_COLORS[0]),A.ansi[1]=R(M.red,c.DEFAULT_ANSI_COLORS[1]),A.ansi[2]=R(M.green,c.DEFAULT_ANSI_COLORS[2]),A.ansi[3]=R(M.yellow,c.DEFAULT_ANSI_COLORS[3]),A.ansi[4]=R(M.blue,c.DEFAULT_ANSI_COLORS[4]),A.ansi[5]=R(M.magenta,c.DEFAULT_ANSI_COLORS[5]),A.ansi[6]=R(M.cyan,c.DEFAULT_ANSI_COLORS[6]),A.ansi[7]=R(M.white,c.DEFAULT_ANSI_COLORS[7]),A.ansi[8]=R(M.brightBlack,c.DEFAULT_ANSI_COLORS[8]),A.ansi[9]=R(M.brightRed,c.DEFAULT_ANSI_COLORS[9]),A.ansi[10]=R(M.brightGreen,c.DEFAULT_ANSI_COLORS[10]),A.ansi[11]=R(M.brightYellow,c.DEFAULT_ANSI_COLORS[11]),A.ansi[12]=R(M.brightBlue,c.DEFAULT_ANSI_COLORS[12]),A.ansi[13]=R(M.brightMagenta,c.DEFAULT_ANSI_COLORS[13]),A.ansi[14]=R(M.brightCyan,c.DEFAULT_ANSI_COLORS[14]),A.ansi[15]=R(M.brightWhite,c.DEFAULT_ANSI_COLORS[15]),M.extendedAnsi){const B=Math.min(A.ansi.length-16,M.extendedAnsi.length);for(let K=0;K<B;K++)A.ansi[K+16]=R(M.extendedAnsi[K],c.DEFAULT_ANSI_COLORS[K+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 A=0;A<this._restoreColors.ansi.length;++A)this._colors.ansi[A]=this._restoreColors.ansi[A]}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,A){if(M!==void 0)try{return w.css.toColor(M)}catch{}return A}c.ThemeService=L=d([y(0,E.IOptionsService)],L)},6349:(_,c,h)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.CircularList=void 0;const d=h(8460),y=h(844);class p extends y.Disposable{constructor(C){super(),this._maxLength=C,this.onDeleteEmitter=this.register(new d.EventEmitter),this.onDelete=this.onDeleteEmitter.event,this.onInsertEmitter=this.register(new d.EventEmitter),this.onInsert=this.onInsertEmitter.event,this.onTrimEmitter=this.register(new d.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(C){if(this._maxLength===C)return;const T=new Array(C);for(let E=0;E<Math.min(C,this.length);E++)T[E]=this._array[this._getCyclicIndex(E)];this._array=T,this._maxLength=C,this._startIndex=0}get length(){return this._length}set length(C){if(C>this._length)for(let T=this._length;T<C;T++)this._array[T]=void 0;this._length=C}get(C){return this._array[this._getCyclicIndex(C)]}set(C,T){this._array[this._getCyclicIndex(C)]=T}push(C){this._array[this._getCyclicIndex(this._length)]=C,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(C,T,...E){if(T){for(let g=C;g<this._length-T;g++)this._array[this._getCyclicIndex(g)]=this._array[this._getCyclicIndex(g+T)];this._length-=T,this.onDeleteEmitter.fire({index:C,amount:T})}for(let g=this._length-1;g>=C;g--)this._array[this._getCyclicIndex(g+E.length)]=this._array[this._getCyclicIndex(g)];for(let g=0;g<E.length;g++)this._array[this._getCyclicIndex(C+g)]=E[g];if(E.length&&this.onInsertEmitter.fire({index:C,amount:E.length}),this._length+E.length>this._maxLength){const g=this._length+E.length-this._maxLength;this._startIndex+=g,this._length=this._maxLength,this.onTrimEmitter.fire(g)}else this._length+=E.length}trimStart(C){C>this._length&&(C=this._length),this._startIndex+=C,this._length-=C,this.onTrimEmitter.fire(C)}shiftElements(C,T,E){if(!(T<=0)){if(C<0||C>=this._length)throw new Error("start argument out of range");if(C+E<0)throw new Error("Cannot shift elements in list beyond index 0");if(E>0){for(let v=T-1;v>=0;v--)this.set(C+v+E,this.get(C+v));const g=C+T+E-this._length;if(g>0)for(this._length+=g;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(let g=0;g<T;g++)this.set(C+g+E,this.get(C+g))}}_getCyclicIndex(C){return(this._startIndex+C)%this._maxLength}}c.CircularList=p},1439:(_,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.clone=void 0,c.clone=function h(d,y=5){if(typeof d!="object")return d;const p=Array.isArray(d)?[]:{};for(const w in d)p[w]=y<=1?d[w]:d[w]&&h(d[w],y-1);return p}},8055:(_,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 h=0,d=0,y=0,p=0;var w,C,T,E,g;function v(S){const k=S.toString(16);return k.length<2?"0"+k:k}function m(S,k){return S<k?(k+.05)/(S+.05):(S+.05)/(k+.05)}c.NULL_COLOR={css:"#00000000",rgba:0},(function(S){S.toCss=function(k,L,R,M){return M!==void 0?`#${v(k)}${v(L)}${v(R)}${v(M)}`:`#${v(k)}${v(L)}${v(R)}`},S.toRgba=function(k,L,R,M=255){return(k<<24|L<<16|R<<8|M)>>>0},S.toColor=function(k,L,R,M){return{css:S.toCss(k,L,R,M),rgba:S.toRgba(k,L,R,M)}}})(w||(c.channels=w={})),(function(S){function k(L,R){return p=Math.round(255*R),[h,d,y]=g.toChannels(L.rgba),{css:w.toCss(h,d,y,p),rgba:w.toRgba(h,d,y,p)}}S.blend=function(L,R){if(p=(255&R.rgba)/255,p===1)return{css:R.css,rgba:R.rgba};const M=R.rgba>>24&255,A=R.rgba>>16&255,B=R.rgba>>8&255,K=L.rgba>>24&255,F=L.rgba>>16&255,W=L.rgba>>8&255;return h=K+Math.round((M-K)*p),d=F+Math.round((A-F)*p),y=W+Math.round((B-W)*p),{css:w.toCss(h,d,y),rgba:w.toRgba(h,d,y)}},S.isOpaque=function(L){return(255&L.rgba)==255},S.ensureContrastRatio=function(L,R,M){const A=g.ensureContrastRatio(L.rgba,R.rgba,M);if(A)return w.toColor(A>>24&255,A>>16&255,A>>8&255)},S.opaque=function(L){const R=(255|L.rgba)>>>0;return[h,d,y]=g.toChannels(R),{css:w.toCss(h,d,y),rgba:R}},S.opacity=k,S.multiplyOpacity=function(L,R){return p=255&L.rgba,k(L,p*R/255)},S.toColorRGB=function(L){return[L.rgba>>24&255,L.rgba>>16&255,L.rgba>>8&255]}})(C||(c.color=C={})),(function(S){let k,L;try{const R=document.createElement("canvas");R.width=1,R.height=1;const M=R.getContext("2d",{willReadFrequently:!0});M&&(k=M,k.globalCompositeOperation="copy",L=k.createLinearGradient(0,0,1,1))}catch{}S.toColor=function(R){if(R.match(/#[\da-f]{3,8}/i))switch(R.length){case 4:return h=parseInt(R.slice(1,2).repeat(2),16),d=parseInt(R.slice(2,3).repeat(2),16),y=parseInt(R.slice(3,4).repeat(2),16),w.toColor(h,d,y);case 5:return h=parseInt(R.slice(1,2).repeat(2),16),d=parseInt(R.slice(2,3).repeat(2),16),y=parseInt(R.slice(3,4).repeat(2),16),p=parseInt(R.slice(4,5).repeat(2),16),w.toColor(h,d,y,p);case 7:return{css:R,rgba:(parseInt(R.slice(1),16)<<8|255)>>>0};case 9:return{css:R,rgba:parseInt(R.slice(1),16)>>>0}}const 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 h=parseInt(M[1]),d=parseInt(M[2]),y=parseInt(M[3]),p=Math.round(255*(M[5]===void 0?1:parseFloat(M[5]))),w.toColor(h,d,y,p);if(!k||!L)throw new Error("css.toColor: Unsupported css format");if(k.fillStyle=L,k.fillStyle=R,typeof k.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(k.fillRect(0,0,1,1),[h,d,y,p]=k.getImageData(0,0,1,1).data,p!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:w.toRgba(h,d,y,p),css:R}}})(T||(c.css=T={})),(function(S){function k(L,R,M){const A=L/255,B=R/255,K=M/255;return .2126*(A<=.03928?A/12.92:Math.pow((A+.055)/1.055,2.4))+.7152*(B<=.03928?B/12.92:Math.pow((B+.055)/1.055,2.4))+.0722*(K<=.03928?K/12.92:Math.pow((K+.055)/1.055,2.4))}S.relativeLuminance=function(L){return k(L>>16&255,L>>8&255,255&L)},S.relativeLuminance2=k})(E||(c.rgb=E={})),(function(S){function k(R,M,A){const B=R>>24&255,K=R>>16&255,F=R>>8&255;let W=M>>24&255,I=M>>16&255,Z=M>>8&255,X=m(E.relativeLuminance2(W,I,Z),E.relativeLuminance2(B,K,F));for(;X<A&&(W>0||I>0||Z>0);)W-=Math.max(0,Math.ceil(.1*W)),I-=Math.max(0,Math.ceil(.1*I)),Z-=Math.max(0,Math.ceil(.1*Z)),X=m(E.relativeLuminance2(W,I,Z),E.relativeLuminance2(B,K,F));return(W<<24|I<<16|Z<<8|255)>>>0}function L(R,M,A){const B=R>>24&255,K=R>>16&255,F=R>>8&255;let W=M>>24&255,I=M>>16&255,Z=M>>8&255,X=m(E.relativeLuminance2(W,I,Z),E.relativeLuminance2(B,K,F));for(;X<A&&(W<255||I<255||Z<255);)W=Math.min(255,W+Math.ceil(.1*(255-W))),I=Math.min(255,I+Math.ceil(.1*(255-I))),Z=Math.min(255,Z+Math.ceil(.1*(255-Z))),X=m(E.relativeLuminance2(W,I,Z),E.relativeLuminance2(B,K,F));return(W<<24|I<<16|Z<<8|255)>>>0}S.blend=function(R,M){if(p=(255&M)/255,p===1)return M;const A=M>>24&255,B=M>>16&255,K=M>>8&255,F=R>>24&255,W=R>>16&255,I=R>>8&255;return h=F+Math.round((A-F)*p),d=W+Math.round((B-W)*p),y=I+Math.round((K-I)*p),w.toRgba(h,d,y)},S.ensureContrastRatio=function(R,M,A){const B=E.relativeLuminance(R>>8),K=E.relativeLuminance(M>>8);if(m(B,K)<A){if(K<B){const I=k(R,M,A),Z=m(B,E.relativeLuminance(I>>8));if(Z<A){const X=L(R,M,A);return Z>m(B,E.relativeLuminance(X>>8))?I:X}return I}const F=L(R,M,A),W=m(B,E.relativeLuminance(F>>8));if(W<A){const I=k(R,M,A);return W>m(B,E.relativeLuminance(I>>8))?F:I}return F}},S.reduceLuminance=k,S.increaseLuminance=L,S.toChannels=function(R){return[R>>24&255,R>>16&255,R>>8&255,255&R]}})(g||(c.rgba=g={})),c.toPaddedHex=v,c.contrastRatio=m},8969:(_,c,h)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.CoreTerminal=void 0;const d=h(844),y=h(2585),p=h(4348),w=h(7866),C=h(744),T=h(7302),E=h(6975),g=h(8460),v=h(1753),m=h(1480),S=h(7994),k=h(9282),L=h(5435),R=h(5981),M=h(2660);let A=!1;class B extends d.Disposable{get onScroll(){return this._onScrollApi||(this._onScrollApi=this.register(new g.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 W in F)this.optionsService.options[W]=F[W]}constructor(F){super(),this._windowsWrappingHeuristics=this.register(new d.MutableDisposable),this._onBinary=this.register(new g.EventEmitter),this.onBinary=this._onBinary.event,this._onData=this.register(new g.EventEmitter),this.onData=this._onData.event,this._onLineFeed=this.register(new g.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onResize=this.register(new g.EventEmitter),this.onResize=this._onResize.event,this._onWriteParsed=this.register(new g.EventEmitter),this.onWriteParsed=this._onWriteParsed.event,this._onScroll=this.register(new g.EventEmitter),this._instantiationService=new p.InstantiationService,this.optionsService=this.register(new T.OptionsService(F)),this._instantiationService.setService(y.IOptionsService,this.optionsService),this._bufferService=this.register(this._instantiationService.createInstance(C.BufferService)),this._instantiationService.setService(y.IBufferService,this._bufferService),this._logService=this.register(this._instantiationService.createInstance(w.LogService)),this._instantiationService.setService(y.ILogService,this._logService),this.coreService=this.register(this._instantiationService.createInstance(E.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(m.UnicodeService)),this._instantiationService.setService(y.IUnicodeService,this.unicodeService),this._charsetService=this._instantiationService.createInstance(S.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,g.forwardEvent)(this._inputHandler.onLineFeed,this._onLineFeed)),this.register(this._inputHandler),this.register((0,g.forwardEvent)(this._bufferService.onResize,this._onResize)),this.register((0,g.forwardEvent)(this.coreService.onData,this._onData)),this.register((0,g.forwardEvent)(this.coreService.onBinary,this._onBinary)),this.register(this.coreService.onRequestScrollToBottom((()=>this.scrollToBottom()))),this.register(this.coreService.onUserInput((()=>this._writeBuffer.handleUserInput()))),this.register(this.optionsService.onMultipleOptionChange(["windowsMode","windowsPty"],(()=>this._handleWindowsPtyOptionChange()))),this.register(this._bufferService.onScroll((W=>{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((W=>{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(((W,I)=>this._inputHandler.parse(W,I)))),this.register((0,g.forwardEvent)(this._writeBuffer.onWriteParsed,this._onWriteParsed))}write(F,W){this._writeBuffer.write(F,W)}writeSync(F,W){this._logService.logLevel<=y.LogLevelEnum.WARN&&!A&&(this._logService.warn("writeSync is unreliable and will be removed soon."),A=!0),this._writeBuffer.writeSync(F,W)}input(F,W=!0){this.coreService.triggerDataEvent(F,W)}resize(F,W){isNaN(F)||isNaN(W)||(F=Math.max(F,C.MINIMUM_COLS),W=Math.max(W,C.MINIMUM_ROWS),this._bufferService.resize(F,W))}scroll(F,W=!1){this._bufferService.scroll(F,W)}scrollLines(F,W,I){this._bufferService.scrollLines(F,W,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 W=F-this._bufferService.buffer.ydisp;W!==0&&this.scrollLines(W)}registerEscHandler(F,W){return this._inputHandler.registerEscHandler(F,W)}registerDcsHandler(F,W){return this._inputHandler.registerDcsHandler(F,W)}registerCsiHandler(F,W){return this._inputHandler.registerCsiHandler(F,W)}registerOscHandler(F,W){return this._inputHandler.registerOscHandler(F,W)}_setup(){this._handleWindowsPtyOptionChange()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_handleWindowsPtyOptionChange(){let F=!1;const W=this.optionsService.rawOptions.windowsPty;W&&W.buildNumber!==void 0&&W.buildNumber!==void 0?F=W.backend==="conpty"&&W.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(k.updateWindowsModeWrappedState.bind(null,this._bufferService))),F.push(this.registerCsiHandler({final:"H"},(()=>((0,k.updateWindowsModeWrappedState)(this._bufferService),!1)))),this._windowsWrappingHeuristics.value=(0,d.toDisposable)((()=>{for(const W of F)W.dispose()}))}}}c.CoreTerminal=B},8460:(_,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=h=>(this._listeners.push(h),{dispose:()=>{if(!this._disposed){for(let d=0;d<this._listeners.length;d++)if(this._listeners[d]===h)return void this._listeners.splice(d,1)}}})),this._event}fire(h,d){const y=[];for(let p=0;p<this._listeners.length;p++)y.push(this._listeners[p]);for(let p=0;p<y.length;p++)y[p].call(void 0,h,d)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},c.forwardEvent=function(h,d){return h((y=>d.fire(y)))},c.runAndSubscribe=function(h,d){return d(void 0),h((y=>d(y)))}},5435:function(_,c,h){var d=this&&this.__decorate||function(V,j,P,D){var U,G=arguments.length,Y=G<3?j:D===null?D=Object.getOwnPropertyDescriptor(j,P):D;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")Y=Reflect.decorate(V,j,P,D);else for(var ie=V.length-1;ie>=0;ie--)(U=V[ie])&&(Y=(G<3?U(Y):G>3?U(j,P,Y):U(j,P))||Y);return G>3&&Y&&Object.defineProperty(j,P,Y),Y},y=this&&this.__param||function(V,j){return function(P,D){j(P,D,V)}};Object.defineProperty(c,"__esModule",{value:!0}),c.InputHandler=c.WindowsOptionsReportType=void 0;const p=h(2584),w=h(7116),C=h(2015),T=h(844),E=h(482),g=h(8437),v=h(8460),m=h(643),S=h(511),k=h(3734),L=h(2585),R=h(1480),M=h(6242),A=h(6351),B=h(5941),K={"(":0,")":1,"*":2,"+":3,"-":1,".":2},F=131072;function W(V,j){if(V>24)return j.setWinLines||!1;switch(V){case 1:return!!j.restoreWin;case 2:return!!j.minimizeWin;case 3:return!!j.setWinPosition;case 4:return!!j.setWinSizePixels;case 5:return!!j.raiseWin;case 6:return!!j.lowerWin;case 7:return!!j.refreshWin;case 8:return!!j.setWinSizeChars;case 9:return!!j.maximizeWin;case 10:return!!j.fullscreenWin;case 11:return!!j.getWinState;case 13:return!!j.getWinPosition;case 14:return!!j.getWinSizePixels;case 15:return!!j.getScreenSizePixels;case 16:return!!j.getCellSizePixels;case 18:return!!j.getWinSizeChars;case 19:return!!j.getScreenSizeChars;case 20:return!!j.getIconTitle;case 21:return!!j.getWinTitle;case 22:return!!j.pushTitle;case 23:return!!j.popTitle;case 24:return!!j.setWinLines}return!1}var I;(function(V){V[V.GET_WIN_SIZE_PIXELS=0]="GET_WIN_SIZE_PIXELS",V[V.GET_CELL_SIZE_PIXELS=1]="GET_CELL_SIZE_PIXELS"})(I||(c.WindowsOptionsReportType=I={}));let Z=0;class X extends T.Disposable{getAttrData(){return this._curAttrData}constructor(j,P,D,U,G,Y,ie,se,J=new C.EscapeSequenceParser){super(),this._bufferService=j,this._charsetService=P,this._coreService=D,this._logService=U,this._optionsService=G,this._oscLinkService=Y,this._coreMouseService=ie,this._unicodeService=se,this._parser=J,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new E.StringToUtf32,this._utf8Decoder=new E.Utf8ToUtf32,this._workCell=new S.CellData,this._windowTitle="",this._iconName="",this._windowTitleStack=[],this._iconNameStack=[],this._curAttrData=g.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=g.DEFAULT_ATTR_DATA.clone(),this._onRequestBell=this.register(new 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 z(this._bufferService),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate((H=>this._activeBuffer=H.activeBuffer))),this._parser.setCsiHandlerFallback(((H,ae)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString(H),params:ae.toArray()})})),this._parser.setEscHandlerFallback((H=>{this._logService.debug("Unknown ESC code: ",{identifier:this._parser.identToString(H)})})),this._parser.setExecuteHandlerFallback((H=>{this._logService.debug("Unknown EXECUTE code: ",{code:H})})),this._parser.setOscHandlerFallback(((H,ae,de)=>{this._logService.debug("Unknown OSC code: ",{identifier:H,action:ae,data:de})})),this._parser.setDcsHandlerFallback(((H,ae,de)=>{ae==="HOOK"&&(de=de.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(H),action:ae,payload:de})})),this._parser.setPrintHandler(((H,ae,de)=>this.print(H,ae,de))),this._parser.registerCsiHandler({final:"@"},(H=>this.insertChars(H))),this._parser.registerCsiHandler({intermediates:" ",final:"@"},(H=>this.scrollLeft(H))),this._parser.registerCsiHandler({final:"A"},(H=>this.cursorUp(H))),this._parser.registerCsiHandler({intermediates:" ",final:"A"},(H=>this.scrollRight(H))),this._parser.registerCsiHandler({final:"B"},(H=>this.cursorDown(H))),this._parser.registerCsiHandler({final:"C"},(H=>this.cursorForward(H))),this._parser.registerCsiHandler({final:"D"},(H=>this.cursorBackward(H))),this._parser.registerCsiHandler({final:"E"},(H=>this.cursorNextLine(H))),this._parser.registerCsiHandler({final:"F"},(H=>this.cursorPrecedingLine(H))),this._parser.registerCsiHandler({final:"G"},(H=>this.cursorCharAbsolute(H))),this._parser.registerCsiHandler({final:"H"},(H=>this.cursorPosition(H))),this._parser.registerCsiHandler({final:"I"},(H=>this.cursorForwardTab(H))),this._parser.registerCsiHandler({final:"J"},(H=>this.eraseInDisplay(H,!1))),this._parser.registerCsiHandler({prefix:"?",final:"J"},(H=>this.eraseInDisplay(H,!0))),this._parser.registerCsiHandler({final:"K"},(H=>this.eraseInLine(H,!1))),this._parser.registerCsiHandler({prefix:"?",final:"K"},(H=>this.eraseInLine(H,!0))),this._parser.registerCsiHandler({final:"L"},(H=>this.insertLines(H))),this._parser.registerCsiHandler({final:"M"},(H=>this.deleteLines(H))),this._parser.registerCsiHandler({final:"P"},(H=>this.deleteChars(H))),this._parser.registerCsiHandler({final:"S"},(H=>this.scrollUp(H))),this._parser.registerCsiHandler({final:"T"},(H=>this.scrollDown(H))),this._parser.registerCsiHandler({final:"X"},(H=>this.eraseChars(H))),this._parser.registerCsiHandler({final:"Z"},(H=>this.cursorBackwardTab(H))),this._parser.registerCsiHandler({final:"`"},(H=>this.charPosAbsolute(H))),this._parser.registerCsiHandler({final:"a"},(H=>this.hPositionRelative(H))),this._parser.registerCsiHandler({final:"b"},(H=>this.repeatPrecedingCharacter(H))),this._parser.registerCsiHandler({final:"c"},(H=>this.sendDeviceAttributesPrimary(H))),this._parser.registerCsiHandler({prefix:">",final:"c"},(H=>this.sendDeviceAttributesSecondary(H))),this._parser.registerCsiHandler({final:"d"},(H=>this.linePosAbsolute(H))),this._parser.registerCsiHandler({final:"e"},(H=>this.vPositionRelative(H))),this._parser.registerCsiHandler({final:"f"},(H=>this.hVPosition(H))),this._parser.registerCsiHandler({final:"g"},(H=>this.tabClear(H))),this._parser.registerCsiHandler({final:"h"},(H=>this.setMode(H))),this._parser.registerCsiHandler({prefix:"?",final:"h"},(H=>this.setModePrivate(H))),this._parser.registerCsiHandler({final:"l"},(H=>this.resetMode(H))),this._parser.registerCsiHandler({prefix:"?",final:"l"},(H=>this.resetModePrivate(H))),this._parser.registerCsiHandler({final:"m"},(H=>this.charAttributes(H))),this._parser.registerCsiHandler({final:"n"},(H=>this.deviceStatus(H))),this._parser.registerCsiHandler({prefix:"?",final:"n"},(H=>this.deviceStatusPrivate(H))),this._parser.registerCsiHandler({intermediates:"!",final:"p"},(H=>this.softReset(H))),this._parser.registerCsiHandler({intermediates:" ",final:"q"},(H=>this.setCursorStyle(H))),this._parser.registerCsiHandler({final:"r"},(H=>this.setScrollRegion(H))),this._parser.registerCsiHandler({final:"s"},(H=>this.saveCursor(H))),this._parser.registerCsiHandler({final:"t"},(H=>this.windowOptions(H))),this._parser.registerCsiHandler({final:"u"},(H=>this.restoreCursor(H))),this._parser.registerCsiHandler({intermediates:"'",final:"}"},(H=>this.insertColumns(H))),this._parser.registerCsiHandler({intermediates:"'",final:"~"},(H=>this.deleteColumns(H))),this._parser.registerCsiHandler({intermediates:'"',final:"q"},(H=>this.selectProtected(H))),this._parser.registerCsiHandler({intermediates:"$",final:"p"},(H=>this.requestMode(H,!0))),this._parser.registerCsiHandler({prefix:"?",intermediates:"$",final:"p"},(H=>this.requestMode(H,!1))),this._parser.setExecuteHandler(p.C0.BEL,(()=>this.bell())),this._parser.setExecuteHandler(p.C0.LF,(()=>this.lineFeed())),this._parser.setExecuteHandler(p.C0.VT,(()=>this.lineFeed())),this._parser.setExecuteHandler(p.C0.FF,(()=>this.lineFeed())),this._parser.setExecuteHandler(p.C0.CR,(()=>this.carriageReturn())),this._parser.setExecuteHandler(p.C0.BS,(()=>this.backspace())),this._parser.setExecuteHandler(p.C0.HT,(()=>this.tab())),this._parser.setExecuteHandler(p.C0.SO,(()=>this.shiftOut())),this._parser.setExecuteHandler(p.C0.SI,(()=>this.shiftIn())),this._parser.setExecuteHandler(p.C1.IND,(()=>this.index())),this._parser.setExecuteHandler(p.C1.NEL,(()=>this.nextLine())),this._parser.setExecuteHandler(p.C1.HTS,(()=>this.tabSet())),this._parser.registerOscHandler(0,new M.OscHandler((H=>(this.setTitle(H),this.setIconName(H),!0)))),this._parser.registerOscHandler(1,new M.OscHandler((H=>this.setIconName(H)))),this._parser.registerOscHandler(2,new M.OscHandler((H=>this.setTitle(H)))),this._parser.registerOscHandler(4,new M.OscHandler((H=>this.setOrReportIndexedColor(H)))),this._parser.registerOscHandler(8,new M.OscHandler((H=>this.setHyperlink(H)))),this._parser.registerOscHandler(10,new M.OscHandler((H=>this.setOrReportFgColor(H)))),this._parser.registerOscHandler(11,new M.OscHandler((H=>this.setOrReportBgColor(H)))),this._parser.registerOscHandler(12,new M.OscHandler((H=>this.setOrReportCursorColor(H)))),this._parser.registerOscHandler(104,new M.OscHandler((H=>this.restoreIndexedColor(H)))),this._parser.registerOscHandler(110,new M.OscHandler((H=>this.restoreFgColor(H)))),this._parser.registerOscHandler(111,new M.OscHandler((H=>this.restoreBgColor(H)))),this._parser.registerOscHandler(112,new M.OscHandler((H=>this.restoreCursorColor(H)))),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 H in w.CHARSETS)this._parser.registerEscHandler({intermediates:"(",final:H},(()=>this.selectCharset("("+H))),this._parser.registerEscHandler({intermediates:")",final:H},(()=>this.selectCharset(")"+H))),this._parser.registerEscHandler({intermediates:"*",final:H},(()=>this.selectCharset("*"+H))),this._parser.registerEscHandler({intermediates:"+",final:H},(()=>this.selectCharset("+"+H))),this._parser.registerEscHandler({intermediates:"-",final:H},(()=>this.selectCharset("-"+H))),this._parser.registerEscHandler({intermediates:".",final:H},(()=>this.selectCharset("."+H))),this._parser.registerEscHandler({intermediates:"/",final:H},(()=>this.selectCharset("/"+H)));this._parser.registerEscHandler({intermediates:"#",final:"8"},(()=>this.screenAlignmentPattern())),this._parser.setErrorHandler((H=>(this._logService.error("Parsing error: ",H),H))),this._parser.registerDcsHandler({intermediates:"$",final:"q"},new A.DcsHandler(((H,ae)=>this.requestStatusString(H,ae))))}_preserveStack(j,P,D,U){this._parseStack.paused=!0,this._parseStack.cursorStartX=j,this._parseStack.cursorStartY=P,this._parseStack.decodedLength=D,this._parseStack.position=U}_logSlowResolvingAsync(j){this._logService.logLevel<=L.LogLevelEnum.WARN&&Promise.race([j,new Promise(((P,D)=>setTimeout((()=>D("#SLOW_TIMEOUT")),5e3)))]).catch((P=>{if(P!=="#SLOW_TIMEOUT")throw P;console.warn("async parser handler taking longer than 5000 ms")}))}_getCurrentLinkId(){return this._curAttrData.extended.urlId}parse(j,P){let D,U=this._activeBuffer.x,G=this._activeBuffer.y,Y=0;const ie=this._parseStack.paused;if(ie){if(D=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,P))return this._logSlowResolvingAsync(D),D;U=this._parseStack.cursorStartX,G=this._parseStack.cursorStartY,this._parseStack.paused=!1,j.length>F&&(Y=this._parseStack.position+F)}if(this._logService.logLevel<=L.LogLevelEnum.DEBUG&&this._logService.debug("parsing data"+(typeof j=="string"?` "${j}"`:` "${Array.prototype.map.call(j,(H=>String.fromCharCode(H))).join("")}"`),typeof j=="string"?j.split("").map((H=>H.charCodeAt(0))):j),this._parseBuffer.length<j.length&&this._parseBuffer.length<F&&(this._parseBuffer=new Uint32Array(Math.min(j.length,F))),ie||this._dirtyRowTracker.clearRange(),j.length>F)for(let H=Y;H<j.length;H+=F){const ae=H+F<j.length?H+F:j.length,de=typeof j=="string"?this._stringDecoder.decode(j.substring(H,ae),this._parseBuffer):this._utf8Decoder.decode(j.subarray(H,ae),this._parseBuffer);if(D=this._parser.parse(this._parseBuffer,de))return this._preserveStack(U,G,de,H),this._logSlowResolvingAsync(D),D}else if(!ie){const H=typeof j=="string"?this._stringDecoder.decode(j,this._parseBuffer):this._utf8Decoder.decode(j,this._parseBuffer);if(D=this._parser.parse(this._parseBuffer,H))return this._preserveStack(U,G,H,0),this._logSlowResolvingAsync(D),D}this._activeBuffer.x===U&&this._activeBuffer.y===G||this._onCursorMove.fire();const se=this._dirtyRowTracker.end+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp),J=this._dirtyRowTracker.start+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp);J<this._bufferService.rows&&this._onRequestRefreshRows.fire(Math.min(J,this._bufferService.rows-1),Math.min(se,this._bufferService.rows-1))}print(j,P,D){let U,G;const Y=this._charsetService.charset,ie=this._optionsService.rawOptions.screenReaderMode,se=this._bufferService.cols,J=this._coreService.decPrivateModes.wraparound,H=this._coreService.modes.insertMode,ae=this._curAttrData;let de=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._activeBuffer.x&&D-P>0&&de.getWidth(this._activeBuffer.x-1)===2&&de.setCellFromCodepoint(this._activeBuffer.x-1,0,1,ae);let we=this._parser.precedingJoinState;for(let ye=P;ye<D;++ye){if(U=j[ye],U<127&&Y){const ut=Y[String.fromCharCode(U)];ut&&(U=ut.charCodeAt(0))}const Le=this._unicodeService.charProperties(U,we);G=R.UnicodeService.extractWidth(Le);const Oe=R.UnicodeService.extractShouldJoin(Le),Fe=Oe?R.UnicodeService.extractWidth(we):0;if(we=Le,ie&&this._onA11yChar.fire((0,E.stringFromCodePoint)(U)),this._getCurrentLinkId()&&this._oscLinkService.addLineToLink(this._getCurrentLinkId(),this._activeBuffer.ybase+this._activeBuffer.y),this._activeBuffer.x+G-Fe>se){if(J){const ut=de;let Me=this._activeBuffer.x-Fe;for(this._activeBuffer.x=Fe,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),de=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y),Fe>0&&de instanceof g.BufferLine&&de.copyCellsFrom(ut,Me,0,Fe,!1);Me<se;)ut.setCellFromCodepoint(Me++,0,1,ae)}else if(this._activeBuffer.x=se-1,G===2)continue}if(Oe&&this._activeBuffer.x){const ut=de.getWidth(this._activeBuffer.x-1)?1:2;de.addCodepointToCell(this._activeBuffer.x-ut,U,G);for(let Me=G-Fe;--Me>=0;)de.setCellFromCodepoint(this._activeBuffer.x++,0,0,ae)}else if(H&&(de.insertCells(this._activeBuffer.x,G-Fe,this._activeBuffer.getNullCell(ae)),de.getWidth(se-1)===2&&de.setCellFromCodepoint(se-1,m.NULL_CELL_CODE,m.NULL_CELL_WIDTH,ae)),de.setCellFromCodepoint(this._activeBuffer.x++,U,G,ae),G>0)for(;--G;)de.setCellFromCodepoint(this._activeBuffer.x++,0,0,ae)}this._parser.precedingJoinState=we,this._activeBuffer.x<se&&D-P>0&&de.getWidth(this._activeBuffer.x)===0&&!de.hasContent(this._activeBuffer.x)&&de.setCellFromCodepoint(this._activeBuffer.x,0,1,ae),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler(j,P){return j.final!=="t"||j.prefix||j.intermediates?this._parser.registerCsiHandler(j,P):this._parser.registerCsiHandler(j,(D=>!W(D.params[0],this._optionsService.rawOptions.windowOptions)||P(D)))}registerDcsHandler(j,P){return this._parser.registerDcsHandler(j,new A.DcsHandler(P))}registerEscHandler(j,P){return this._parser.registerEscHandler(j,P)}registerOscHandler(j,P){return this._parser.registerOscHandler(j,new M.OscHandler(P))}bell(){return this._onRequestBell.fire(),!0}lineFeed(){return this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._optionsService.rawOptions.convertEol&&(this._activeBuffer.x=0),this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData())):this._activeBuffer.y>=this._bufferService.rows?this._activeBuffer.y=this._bufferService.rows-1:this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.x>=this._bufferService.cols&&this._activeBuffer.x--,this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._onLineFeed.fire(),!0}carriageReturn(){return this._activeBuffer.x=0,!0}backspace(){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 j=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);j.hasWidth(this._activeBuffer.x)&&!j.hasContent(this._activeBuffer.x)&&this._activeBuffer.x--}return this._restrictCursor(),!0}tab(){if(this._activeBuffer.x>=this._bufferService.cols)return!0;const j=this._activeBuffer.x;return this._activeBuffer.x=this._activeBuffer.nextStop(),this._optionsService.rawOptions.screenReaderMode&&this._onA11yTab.fire(this._activeBuffer.x-j),!0}shiftOut(){return this._charsetService.setgLevel(1),!0}shiftIn(){return this._charsetService.setgLevel(0),!0}_restrictCursor(j=this._bufferService.cols-1){this._activeBuffer.x=Math.min(j,Math.max(0,this._activeBuffer.x)),this._activeBuffer.y=this._coreService.decPrivateModes.origin?Math.min(this._activeBuffer.scrollBottom,Math.max(this._activeBuffer.scrollTop,this._activeBuffer.y)):Math.min(this._bufferService.rows-1,Math.max(0,this._activeBuffer.y)),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_setCursor(j,P){this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=j,this._activeBuffer.y=this._activeBuffer.scrollTop+P):(this._activeBuffer.x=j,this._activeBuffer.y=P),this._restrictCursor(),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_moveCursor(j,P){this._restrictCursor(),this._setCursor(this._activeBuffer.x+j,this._activeBuffer.y+P)}cursorUp(j){const P=this._activeBuffer.y-this._activeBuffer.scrollTop;return P>=0?this._moveCursor(0,-Math.min(P,j.params[0]||1)):this._moveCursor(0,-(j.params[0]||1)),!0}cursorDown(j){const P=this._activeBuffer.scrollBottom-this._activeBuffer.y;return P>=0?this._moveCursor(0,Math.min(P,j.params[0]||1)):this._moveCursor(0,j.params[0]||1),!0}cursorForward(j){return this._moveCursor(j.params[0]||1,0),!0}cursorBackward(j){return this._moveCursor(-(j.params[0]||1),0),!0}cursorNextLine(j){return this.cursorDown(j),this._activeBuffer.x=0,!0}cursorPrecedingLine(j){return this.cursorUp(j),this._activeBuffer.x=0,!0}cursorCharAbsolute(j){return this._setCursor((j.params[0]||1)-1,this._activeBuffer.y),!0}cursorPosition(j){return this._setCursor(j.length>=2?(j.params[1]||1)-1:0,(j.params[0]||1)-1),!0}charPosAbsolute(j){return this._setCursor((j.params[0]||1)-1,this._activeBuffer.y),!0}hPositionRelative(j){return this._moveCursor(j.params[0]||1,0),!0}linePosAbsolute(j){return this._setCursor(this._activeBuffer.x,(j.params[0]||1)-1),!0}vPositionRelative(j){return this._moveCursor(0,j.params[0]||1),!0}hVPosition(j){return this.cursorPosition(j),!0}tabClear(j){const P=j.params[0];return P===0?delete this._activeBuffer.tabs[this._activeBuffer.x]:P===3&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(j){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let P=j.params[0]||1;for(;P--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0}cursorBackwardTab(j){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let P=j.params[0]||1;for(;P--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0}selectProtected(j){const P=j.params[0];return P===1&&(this._curAttrData.bg|=536870912),P!==2&&P!==0||(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine(j,P,D,U=!1,G=!1){const Y=this._activeBuffer.lines.get(this._activeBuffer.ybase+j);Y.replaceCells(P,D,this._activeBuffer.getNullCell(this._eraseAttrData()),G),U&&(Y.isWrapped=!1)}_resetBufferLine(j,P=!1){const D=this._activeBuffer.lines.get(this._activeBuffer.ybase+j);D&&(D.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),P),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+j),D.isWrapped=!1)}eraseInDisplay(j,P=!1){let D;switch(this._restrictCursor(this._bufferService.cols),j.params[0]){case 0:for(D=this._activeBuffer.y,this._dirtyRowTracker.markDirty(D),this._eraseInBufferLine(D++,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,P);D<this._bufferService.rows;D++)this._resetBufferLine(D,P);this._dirtyRowTracker.markDirty(D);break;case 1:for(D=this._activeBuffer.y,this._dirtyRowTracker.markDirty(D),this._eraseInBufferLine(D,0,this._activeBuffer.x+1,!0,P),this._activeBuffer.x+1>=this._bufferService.cols&&(this._activeBuffer.lines.get(D+1).isWrapped=!1);D--;)this._resetBufferLine(D,P);this._dirtyRowTracker.markDirty(0);break;case 2:for(D=this._bufferService.rows,this._dirtyRowTracker.markDirty(D-1);D--;)this._resetBufferLine(D,P);this._dirtyRowTracker.markDirty(0);break;case 3:const U=this._activeBuffer.lines.length-this._bufferService.rows;U>0&&(this._activeBuffer.lines.trimStart(U),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-U,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-U,0),this._onScroll.fire(0))}return!0}eraseInLine(j,P=!1){switch(this._restrictCursor(this._bufferService.cols),j.params[0]){case 0:this._eraseInBufferLine(this._activeBuffer.y,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,P);break;case 1:this._eraseInBufferLine(this._activeBuffer.y,0,this._activeBuffer.x+1,!1,P);break;case 2:this._eraseInBufferLine(this._activeBuffer.y,0,this._bufferService.cols,!0,P)}return this._dirtyRowTracker.markDirty(this._activeBuffer.y),!0}insertLines(j){this._restrictCursor();let P=j.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const D=this._activeBuffer.ybase+this._activeBuffer.y,U=this._bufferService.rows-1-this._activeBuffer.scrollBottom,G=this._bufferService.rows-1+this._activeBuffer.ybase-U+1;for(;P--;)this._activeBuffer.lines.splice(G-1,1),this._activeBuffer.lines.splice(D,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}deleteLines(j){this._restrictCursor();let P=j.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const D=this._activeBuffer.ybase+this._activeBuffer.y;let U;for(U=this._bufferService.rows-1-this._activeBuffer.scrollBottom,U=this._bufferService.rows-1+this._activeBuffer.ybase-U;P--;)this._activeBuffer.lines.splice(D,1),this._activeBuffer.lines.splice(U,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}insertChars(j){this._restrictCursor();const P=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return P&&(P.insertCells(this._activeBuffer.x,j.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}deleteChars(j){this._restrictCursor();const P=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return P&&(P.deleteCells(this._activeBuffer.x,j.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}scrollUp(j){let P=j.params[0]||1;for(;P--;)this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollTop,1),this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollBottom,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollDown(j){let P=j.params[0]||1;for(;P--;)this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollBottom,1),this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollTop,0,this._activeBuffer.getBlankLine(g.DEFAULT_ATTR_DATA));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollLeft(j){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const P=j.params[0]||1;for(let D=this._activeBuffer.scrollTop;D<=this._activeBuffer.scrollBottom;++D){const U=this._activeBuffer.lines.get(this._activeBuffer.ybase+D);U.deleteCells(0,P,this._activeBuffer.getNullCell(this._eraseAttrData())),U.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollRight(j){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const P=j.params[0]||1;for(let D=this._activeBuffer.scrollTop;D<=this._activeBuffer.scrollBottom;++D){const U=this._activeBuffer.lines.get(this._activeBuffer.ybase+D);U.insertCells(0,P,this._activeBuffer.getNullCell(this._eraseAttrData())),U.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}insertColumns(j){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const P=j.params[0]||1;for(let D=this._activeBuffer.scrollTop;D<=this._activeBuffer.scrollBottom;++D){const U=this._activeBuffer.lines.get(this._activeBuffer.ybase+D);U.insertCells(this._activeBuffer.x,P,this._activeBuffer.getNullCell(this._eraseAttrData())),U.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}deleteColumns(j){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const P=j.params[0]||1;for(let D=this._activeBuffer.scrollTop;D<=this._activeBuffer.scrollBottom;++D){const U=this._activeBuffer.lines.get(this._activeBuffer.ybase+D);U.deleteCells(this._activeBuffer.x,P,this._activeBuffer.getNullCell(this._eraseAttrData())),U.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}eraseChars(j){this._restrictCursor();const P=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return P&&(P.replaceCells(this._activeBuffer.x,this._activeBuffer.x+(j.params[0]||1),this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}repeatPrecedingCharacter(j){const P=this._parser.precedingJoinState;if(!P)return!0;const D=j.params[0]||1,U=R.UnicodeService.extractWidth(P),G=this._activeBuffer.x-U,Y=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).getString(G),ie=new Uint32Array(Y.length*D);let se=0;for(let H=0;H<Y.length;){const ae=Y.codePointAt(H)||0;ie[se++]=ae,H+=ae>65535?2:1}let J=se;for(let H=1;H<D;++H)ie.copyWithin(J,0,se),J+=se;return this.print(ie,0,J),!0}sendDeviceAttributesPrimary(j){return j.params[0]>0||(this._is("xterm")||this._is("rxvt-unicode")||this._is("screen")?this._coreService.triggerDataEvent(p.C0.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(p.C0.ESC+"[?6c")),!0}sendDeviceAttributesSecondary(j){return j.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(p.C0.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(p.C0.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(j.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(p.C0.ESC+"[>83;40003;0c")),!0}_is(j){return(this._optionsService.rawOptions.termName+"").indexOf(j)===0}setMode(j){for(let P=0;P<j.length;P++)switch(j.params[P]){case 4:this._coreService.modes.insertMode=!0;break;case 20:this._optionsService.options.convertEol=!0}return!0}setModePrivate(j){for(let P=0;P<j.length;P++)switch(j.params[P]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!0;break;case 2:this._charsetService.setgCharset(0,w.DEFAULT_CHARSET),this._charsetService.setgCharset(1,w.DEFAULT_CHARSET),this._charsetService.setgCharset(2,w.DEFAULT_CHARSET),this._charsetService.setgCharset(3,w.DEFAULT_CHARSET);break;case 3:this._optionsService.rawOptions.windowOptions.setWinLines&&(this._bufferService.resize(132,this._bufferService.rows),this._onRequestReset.fire());break;case 6:this._coreService.decPrivateModes.origin=!0,this._setCursor(0,0);break;case 7:this._coreService.decPrivateModes.wraparound=!0;break;case 12:this._optionsService.options.cursorBlink=!0;break;case 45:this._coreService.decPrivateModes.reverseWraparound=!0;break;case 66:this._logService.debug("Serial port requested application keypad."),this._coreService.decPrivateModes.applicationKeypad=!0,this._onRequestSyncScrollBar.fire();break;case 9:this._coreMouseService.activeProtocol="X10";break;case 1e3:this._coreMouseService.activeProtocol="VT200";break;case 1002:this._coreMouseService.activeProtocol="DRAG";break;case 1003:this._coreMouseService.activeProtocol="ANY";break;case 1004:this._coreService.decPrivateModes.sendFocus=!0,this._onRequestSendFocus.fire();break;case 1005:this._logService.debug("DECSET 1005 not supported (see #2507)");break;case 1006:this._coreMouseService.activeEncoding="SGR";break;case 1015:this._logService.debug("DECSET 1015 not supported (see #2507)");break;case 1016:this._coreMouseService.activeEncoding="SGR_PIXELS";break;case 25:this._coreService.isCursorHidden=!1;break;case 1048:this.saveCursor();break;case 1049:this.saveCursor();case 47:case 1047:this._bufferService.buffers.activateAltBuffer(this._eraseAttrData()),this._coreService.isCursorInitialized=!0,this._onRequestRefreshRows.fire(0,this._bufferService.rows-1),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!0}return!0}resetMode(j){for(let P=0;P<j.length;P++)switch(j.params[P]){case 4:this._coreService.modes.insertMode=!1;break;case 20:this._optionsService.options.convertEol=!1}return!0}resetModePrivate(j){for(let P=0;P<j.length;P++)switch(j.params[P]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!1;break;case 3:this._optionsService.rawOptions.windowOptions.setWinLines&&(this._bufferService.resize(80,this._bufferService.rows),this._onRequestReset.fire());break;case 6:this._coreService.decPrivateModes.origin=!1,this._setCursor(0,0);break;case 7:this._coreService.decPrivateModes.wraparound=!1;break;case 12:this._optionsService.options.cursorBlink=!1;break;case 45:this._coreService.decPrivateModes.reverseWraparound=!1;break;case 66:this._logService.debug("Switching back to normal keypad."),this._coreService.decPrivateModes.applicationKeypad=!1,this._onRequestSyncScrollBar.fire();break;case 9:case 1e3:case 1002:case 1003:this._coreMouseService.activeProtocol="NONE";break;case 1004:this._coreService.decPrivateModes.sendFocus=!1;break;case 1005:this._logService.debug("DECRST 1005 not supported (see #2507)");break;case 1006:case 1016:this._coreMouseService.activeEncoding="DEFAULT";break;case 1015:this._logService.debug("DECRST 1015 not supported (see #2507)");break;case 25:this._coreService.isCursorHidden=!0;break;case 1048:this.restoreCursor();break;case 1049:case 47:case 1047:this._bufferService.buffers.activateNormalBuffer(),j.params[P]===1049&&this.restoreCursor(),this._coreService.isCursorInitialized=!0,this._onRequestRefreshRows.fire(0,this._bufferService.rows-1),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!1}return!0}requestMode(j,P){const D=this._coreService.decPrivateModes,{activeProtocol:U,activeEncoding:G}=this._coreMouseService,Y=this._coreService,{buffers:ie,cols:se}=this._bufferService,{active:J,alt:H}=ie,ae=this._optionsService.rawOptions,de=Oe=>Oe?1:2,we=j.params[0];return ye=we,Le=P?we===2?4:we===4?de(Y.modes.insertMode):we===12?3:we===20?de(ae.convertEol):0:we===1?de(D.applicationCursorKeys):we===3?ae.windowOptions.setWinLines?se===80?2:se===132?1:0:0:we===6?de(D.origin):we===7?de(D.wraparound):we===8?3:we===9?de(U==="X10"):we===12?de(ae.cursorBlink):we===25?de(!Y.isCursorHidden):we===45?de(D.reverseWraparound):we===66?de(D.applicationKeypad):we===67?4:we===1e3?de(U==="VT200"):we===1002?de(U==="DRAG"):we===1003?de(U==="ANY"):we===1004?de(D.sendFocus):we===1005?4:we===1006?de(G==="SGR"):we===1015?4:we===1016?de(G==="SGR_PIXELS"):we===1048?1:we===47||we===1047||we===1049?de(J===H):we===2004?de(D.bracketedPasteMode):0,Y.triggerDataEvent(`${p.C0.ESC}[${P?"":"?"}${ye};${Le}$y`),!0;var ye,Le}_updateAttrColor(j,P,D,U,G){return P===2?(j|=50331648,j&=-16777216,j|=k.AttributeData.fromColorRGB([D,U,G])):P===5&&(j&=-50331904,j|=33554432|255&D),j}_extractColor(j,P,D){const U=[0,0,-1,0,0,0];let G=0,Y=0;do{if(U[Y+G]=j.params[P+Y],j.hasSubParams(P+Y)){const ie=j.getSubParams(P+Y);let se=0;do U[1]===5&&(G=1),U[Y+se+1+G]=ie[se];while(++se<ie.length&&se+Y+1+G<U.length);break}if(U[1]===5&&Y+G>=2||U[1]===2&&Y+G>=5)break;U[1]&&(G=1)}while(++Y+P<j.length&&Y+G<U.length);for(let ie=2;ie<U.length;++ie)U[ie]===-1&&(U[ie]=0);switch(U[0]){case 38:D.fg=this._updateAttrColor(D.fg,U[1],U[3],U[4],U[5]);break;case 48:D.bg=this._updateAttrColor(D.bg,U[1],U[3],U[4],U[5]);break;case 58:D.extended=D.extended.clone(),D.extended.underlineColor=this._updateAttrColor(D.extended.underlineColor,U[1],U[3],U[4],U[5])}return Y}_processUnderline(j,P){P.extended=P.extended.clone(),(!~j||j>5)&&(j=1),P.extended.underlineStyle=j,P.fg|=268435456,j===0&&(P.fg&=-268435457),P.updateExtended()}_processSGR0(j){j.fg=g.DEFAULT_ATTR_DATA.fg,j.bg=g.DEFAULT_ATTR_DATA.bg,j.extended=j.extended.clone(),j.extended.underlineStyle=0,j.extended.underlineColor&=-67108864,j.updateExtended()}charAttributes(j){if(j.length===1&&j.params[0]===0)return this._processSGR0(this._curAttrData),!0;const P=j.length;let D;const U=this._curAttrData;for(let G=0;G<P;G++)D=j.params[G],D>=30&&D<=37?(U.fg&=-50331904,U.fg|=16777216|D-30):D>=40&&D<=47?(U.bg&=-50331904,U.bg|=16777216|D-40):D>=90&&D<=97?(U.fg&=-50331904,U.fg|=16777224|D-90):D>=100&&D<=107?(U.bg&=-50331904,U.bg|=16777224|D-100):D===0?this._processSGR0(U):D===1?U.fg|=134217728:D===3?U.bg|=67108864:D===4?(U.fg|=268435456,this._processUnderline(j.hasSubParams(G)?j.getSubParams(G)[0]:1,U)):D===5?U.fg|=536870912:D===7?U.fg|=67108864:D===8?U.fg|=1073741824:D===9?U.fg|=2147483648:D===2?U.bg|=134217728:D===21?this._processUnderline(2,U):D===22?(U.fg&=-134217729,U.bg&=-134217729):D===23?U.bg&=-67108865:D===24?(U.fg&=-268435457,this._processUnderline(0,U)):D===25?U.fg&=-536870913:D===27?U.fg&=-67108865:D===28?U.fg&=-1073741825:D===29?U.fg&=2147483647:D===39?(U.fg&=-67108864,U.fg|=16777215&g.DEFAULT_ATTR_DATA.fg):D===49?(U.bg&=-67108864,U.bg|=16777215&g.DEFAULT_ATTR_DATA.bg):D===38||D===48||D===58?G+=this._extractColor(j,G,U):D===53?U.bg|=1073741824:D===55?U.bg&=-1073741825:D===59?(U.extended=U.extended.clone(),U.extended.underlineColor=-1,U.updateExtended()):D===100?(U.fg&=-67108864,U.fg|=16777215&g.DEFAULT_ATTR_DATA.fg,U.bg&=-67108864,U.bg|=16777215&g.DEFAULT_ATTR_DATA.bg):this._logService.debug("Unknown SGR attribute: %d.",D);return!0}deviceStatus(j){switch(j.params[0]){case 5:this._coreService.triggerDataEvent(`${p.C0.ESC}[0n`);break;case 6:const P=this._activeBuffer.y+1,D=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${p.C0.ESC}[${P};${D}R`)}return!0}deviceStatusPrivate(j){if(j.params[0]===6){const P=this._activeBuffer.y+1,D=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${p.C0.ESC}[?${P};${D}R`)}return!0}softReset(j){return this._coreService.isCursorHidden=!1,this._onRequestSyncScrollBar.fire(),this._activeBuffer.scrollTop=0,this._activeBuffer.scrollBottom=this._bufferService.rows-1,this._curAttrData=g.DEFAULT_ATTR_DATA.clone(),this._coreService.reset(),this._charsetService.reset(),this._activeBuffer.savedX=0,this._activeBuffer.savedY=this._activeBuffer.ybase,this._activeBuffer.savedCurAttrData.fg=this._curAttrData.fg,this._activeBuffer.savedCurAttrData.bg=this._curAttrData.bg,this._activeBuffer.savedCharset=this._charsetService.charset,this._coreService.decPrivateModes.origin=!1,!0}setCursorStyle(j){const P=j.params[0]||1;switch(P){case 1:case 2:this._optionsService.options.cursorStyle="block";break;case 3:case 4:this._optionsService.options.cursorStyle="underline";break;case 5:case 6:this._optionsService.options.cursorStyle="bar"}const D=P%2==1;return this._optionsService.options.cursorBlink=D,!0}setScrollRegion(j){const P=j.params[0]||1;let D;return(j.length<2||(D=j.params[1])>this._bufferService.rows||D===0)&&(D=this._bufferService.rows),D>P&&(this._activeBuffer.scrollTop=P-1,this._activeBuffer.scrollBottom=D-1,this._setCursor(0,0)),!0}windowOptions(j){if(!W(j.params[0],this._optionsService.rawOptions.windowOptions))return!0;const P=j.length>1?j.params[1]:0;switch(j.params[0]){case 14:P!==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(`${p.C0.ESC}[8;${this._bufferService.rows};${this._bufferService.cols}t`);break;case 22:P!==0&&P!==2||(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>10&&this._windowTitleStack.shift()),P!==0&&P!==1||(this._iconNameStack.push(this._iconName),this._iconNameStack.length>10&&this._iconNameStack.shift());break;case 23:P!==0&&P!==2||this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),P!==0&&P!==1||this._iconNameStack.length&&this.setIconName(this._iconNameStack.pop())}return!0}saveCursor(j){return this._activeBuffer.savedX=this._activeBuffer.x,this._activeBuffer.savedY=this._activeBuffer.ybase+this._activeBuffer.y,this._activeBuffer.savedCurAttrData.fg=this._curAttrData.fg,this._activeBuffer.savedCurAttrData.bg=this._curAttrData.bg,this._activeBuffer.savedCharset=this._charsetService.charset,!0}restoreCursor(j){return this._activeBuffer.x=this._activeBuffer.savedX||0,this._activeBuffer.y=Math.max(this._activeBuffer.savedY-this._activeBuffer.ybase,0),this._curAttrData.fg=this._activeBuffer.savedCurAttrData.fg,this._curAttrData.bg=this._activeBuffer.savedCurAttrData.bg,this._charsetService.charset=this._savedCharset,this._activeBuffer.savedCharset&&(this._charsetService.charset=this._activeBuffer.savedCharset),this._restrictCursor(),!0}setTitle(j){return this._windowTitle=j,this._onTitleChange.fire(j),!0}setIconName(j){return this._iconName=j,!0}setOrReportIndexedColor(j){const P=[],D=j.split(";");for(;D.length>1;){const U=D.shift(),G=D.shift();if(/^\d+$/.exec(U)){const Y=parseInt(U);if(q(Y))if(G==="?")P.push({type:0,index:Y});else{const ie=(0,B.parseColor)(G);ie&&P.push({type:1,index:Y,color:ie})}}}return P.length&&this._onColor.fire(P),!0}setHyperlink(j){const P=j.split(";");return!(P.length<2)&&(P[1]?this._createHyperlink(P[0],P[1]):!P[0]&&this._finishHyperlink())}_createHyperlink(j,P){this._getCurrentLinkId()&&this._finishHyperlink();const D=j.split(":");let U;const G=D.findIndex((Y=>Y.startsWith("id=")));return G!==-1&&(U=D[G].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:U,uri:P}),this._curAttrData.updateExtended(),!0}_finishHyperlink(){return this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=0,this._curAttrData.updateExtended(),!0}_setOrReportSpecialColor(j,P){const D=j.split(";");for(let U=0;U<D.length&&!(P>=this._specialColors.length);++U,++P)if(D[U]==="?")this._onColor.fire([{type:0,index:this._specialColors[P]}]);else{const G=(0,B.parseColor)(D[U]);G&&this._onColor.fire([{type:1,index:this._specialColors[P],color:G}])}return!0}setOrReportFgColor(j){return this._setOrReportSpecialColor(j,0)}setOrReportBgColor(j){return this._setOrReportSpecialColor(j,1)}setOrReportCursorColor(j){return this._setOrReportSpecialColor(j,2)}restoreIndexedColor(j){if(!j)return this._onColor.fire([{type:2}]),!0;const P=[],D=j.split(";");for(let U=0;U<D.length;++U)if(/^\d+$/.exec(D[U])){const G=parseInt(D[U]);q(G)&&P.push({type:2,index:G})}return P.length&&this._onColor.fire(P),!0}restoreFgColor(j){return this._onColor.fire([{type:2,index:256}]),!0}restoreBgColor(j){return this._onColor.fire([{type:2,index:257}]),!0}restoreCursorColor(j){return this._onColor.fire([{type:2,index:258}]),!0}nextLine(){return this._activeBuffer.x=0,this.index(),!0}keypadApplicationMode(){return this._logService.debug("Serial port requested application keypad."),this._coreService.decPrivateModes.applicationKeypad=!0,this._onRequestSyncScrollBar.fire(),!0}keypadNumericMode(){return this._logService.debug("Switching back to normal keypad."),this._coreService.decPrivateModes.applicationKeypad=!1,this._onRequestSyncScrollBar.fire(),!0}selectDefaultCharset(){return this._charsetService.setgLevel(0),this._charsetService.setgCharset(0,w.DEFAULT_CHARSET),!0}selectCharset(j){return j.length!==2?(this.selectDefaultCharset(),!0):(j[0]==="/"||this._charsetService.setgCharset(K[j[0]],w.CHARSETS[j[1]]||w.DEFAULT_CHARSET),!0)}index(){return this._restrictCursor(),this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData())):this._activeBuffer.y>=this._bufferService.rows&&(this._activeBuffer.y=this._bufferService.rows-1),this._restrictCursor(),!0}tabSet(){return this._activeBuffer.tabs[this._activeBuffer.x]=!0,!0}reverseIndex(){if(this._restrictCursor(),this._activeBuffer.y===this._activeBuffer.scrollTop){const j=this._activeBuffer.scrollBottom-this._activeBuffer.scrollTop;this._activeBuffer.lines.shiftElements(this._activeBuffer.ybase+this._activeBuffer.y,j,1),this._activeBuffer.lines.set(this._activeBuffer.ybase+this._activeBuffer.y,this._activeBuffer.getBlankLine(this._eraseAttrData())),this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom)}else this._activeBuffer.y--,this._restrictCursor();return!0}fullReset(){return this._parser.reset(),this._onRequestReset.fire(),!0}reset(){this._curAttrData=g.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=g.DEFAULT_ATTR_DATA.clone()}_eraseAttrData(){return this._eraseAttrDataInternal.bg&=-67108864,this._eraseAttrDataInternal.bg|=67108863&this._curAttrData.bg,this._eraseAttrDataInternal}setgLevel(j){return this._charsetService.setgLevel(j),!0}screenAlignmentPattern(){const j=new S.CellData;j.content=4194373,j.fg=this._curAttrData.fg,j.bg=this._curAttrData.bg,this._setCursor(0,0);for(let P=0;P<this._bufferService.rows;++P){const D=this._activeBuffer.ybase+this._activeBuffer.y+P,U=this._activeBuffer.lines.get(D);U&&(U.fill(j),U.isWrapped=!1)}return this._dirtyRowTracker.markAllDirty(),this._setCursor(0,0),!0}requestStatusString(j,P){const D=this._bufferService.buffer,U=this._optionsService.rawOptions;return(G=>(this._coreService.triggerDataEvent(`${p.C0.ESC}${G}${p.C0.ESC}\\`),!0))(j==='"q'?`P1$r${this._curAttrData.isProtected()?1:0}"q`:j==='"p'?'P1$r61;1"p':j==="r"?`P1$r${D.scrollTop+1};${D.scrollBottom+1}r`:j==="m"?"P1$r0m":j===" q"?`P1$r${{block:2,underline:4,bar:6}[U.cursorStyle]-(U.cursorBlink?1:0)} q`:"P0$r")}markRangeDirty(j,P){this._dirtyRowTracker.markRangeDirty(j,P)}}c.InputHandler=X;let z=class{constructor(V){this._bufferService=V,this.clearRange()}clearRange(){this.start=this._bufferService.buffer.y,this.end=this._bufferService.buffer.y}markDirty(V){V<this.start?this.start=V:V>this.end&&(this.end=V)}markRangeDirty(V,j){V>j&&(Z=V,V=j,j=Z),V<this.start&&(this.start=V),j>this.end&&(this.end=j)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};function q(V){return 0<=V&&V<256}z=d([y(0,L.IBufferService)],z)},844:(_,c)=>{function h(d){for(const y of d)y.dispose();d.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 d of this._disposables)d.dispose();this._disposables.length=0}register(d){return this._disposables.push(d),d}unregister(d){const y=this._disposables.indexOf(d);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(d){this._isDisposed||d===this._value||(this._value?.dispose(),this._value=d)}clear(){this.value=void 0}dispose(){this._isDisposed=!0,this._value?.dispose(),this._value=void 0}},c.toDisposable=function(d){return{dispose:d}},c.disposeArray=h,c.getDisposeArrayDisposable=function(d){return{dispose:()=>h(d)}}},1505:(_,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.FourKeyMap=c.TwoKeyMap=void 0;class h{constructor(){this._data={}}set(y,p,w){this._data[y]||(this._data[y]={}),this._data[y][p]=w}get(y,p){return this._data[y]?this._data[y][p]:void 0}clear(){this._data={}}}c.TwoKeyMap=h,c.FourKeyMap=class{constructor(){this._data=new h}set(d,y,p,w,C){this._data.get(d,y)||this._data.set(d,y,new h),this._data.get(d,y).set(p,w,C)}get(d,y,p,w){return this._data.get(d,y)?.get(p,w)}clear(){this._data.clear()}}},6114:(_,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 h=c.isNode?"node":navigator.userAgent,d=c.isNode?"node":navigator.platform;c.isFirefox=h.includes("Firefox"),c.isLegacyEdge=h.includes("Edge"),c.isSafari=/^((?!chrome|android).)*safari/i.test(h),c.getSafariVersion=function(){if(!c.isSafari)return 0;const y=h.match(/Version\/(\d+)/);return y===null||y.length<2?0:parseInt(y[1])},c.isMac=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(d),c.isIpad=d==="iPad",c.isIphone=d==="iPhone",c.isWindows=["Windows","Win16","Win32","WinCE"].includes(d),c.isLinux=d.indexOf("Linux")>=0,c.isChromeOS=/\bCrOS\b/.test(h)},6106:(_,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.SortedList=void 0;let h=0;c.SortedList=class{constructor(d){this._getKey=d,this._array=[]}clear(){this._array.length=0}insert(d){this._array.length!==0?(h=this._search(this._getKey(d)),this._array.splice(h,0,d)):this._array.push(d)}delete(d){if(this._array.length===0)return!1;const y=this._getKey(d);if(y===void 0||(h=this._search(y),h===-1)||this._getKey(this._array[h])!==y)return!1;do if(this._array[h]===d)return this._array.splice(h,1),!0;while(++h<this._array.length&&this._getKey(this._array[h])===y);return!1}*getKeyIterator(d){if(this._array.length!==0&&(h=this._search(d),!(h<0||h>=this._array.length)&&this._getKey(this._array[h])===d))do yield this._array[h];while(++h<this._array.length&&this._getKey(this._array[h])===d)}forEachByKey(d,y){if(this._array.length!==0&&(h=this._search(d),!(h<0||h>=this._array.length)&&this._getKey(this._array[h])===d))do y(this._array[h]);while(++h<this._array.length&&this._getKey(this._array[h])===d)}values(){return[...this._array].values()}_search(d){let y=0,p=this._array.length-1;for(;p>=y;){let w=y+p>>1;const C=this._getKey(this._array[w]);if(C>d)p=w-1;else{if(!(C<d)){for(;w>0&&this._getKey(this._array[w-1])===d;)w--;return w}y=w+1}}return y}}},7226:(_,c,h)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.DebouncedIdleTask=c.IdleTaskQueue=c.PriorityTaskQueue=void 0;const d=h(6114);class y{constructor(){this._tasks=[],this._i=0}enqueue(C){this._tasks.push(C),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(C){this._idleCallback=void 0;let T=0,E=0,g=C.timeRemaining(),v=0;for(;this._i<this._tasks.length;){if(T=Date.now(),this._tasks[this._i]()||this._i++,T=Math.max(1,Date.now()-T),E=Math.max(T,E),v=C.timeRemaining(),1.5*E>v)return g-T<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(g-T))}ms`),void this._start();g=v}this.clear()}}class p extends y{_requestCallback(C){return setTimeout((()=>C(this._createDeadline(16))))}_cancelCallback(C){clearTimeout(C)}_createDeadline(C){const T=Date.now()+C;return{timeRemaining:()=>Math.max(0,T-Date.now())}}}c.PriorityTaskQueue=p,c.IdleTaskQueue=!d.isNode&&"requestIdleCallback"in window?class extends y{_requestCallback(w){return requestIdleCallback(w)}_cancelCallback(w){cancelIdleCallback(w)}}:p,c.DebouncedIdleTask=class{constructor(){this._queue=new c.IdleTaskQueue}set(w){this._queue.clear(),this._queue.enqueue(w)}flush(){this._queue.flush()}}},9282:(_,c,h)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.updateWindowsModeWrappedState=void 0;const d=h(643);c.updateWindowsModeWrappedState=function(y){const p=y.buffer.lines.get(y.buffer.ybase+y.buffer.y-1),w=p?.get(y.cols-1),C=y.buffer.lines.get(y.buffer.ybase+y.buffer.y);C&&w&&(C.isWrapped=w[d.CHAR_DATA_CODE_INDEX]!==d.NULL_CELL_CODE&&w[d.CHAR_DATA_CODE_INDEX]!==d.WHITESPACE_CELL_CODE)}},3734:(_,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.ExtendedAttrs=c.AttributeData=void 0;class h{constructor(){this.fg=0,this.bg=0,this.extended=new d}static toColorRGB(p){return[p>>>16&255,p>>>8&255,255&p]}static fromColorRGB(p){return(255&p[0])<<16|(255&p[1])<<8|255&p[2]}clone(){const p=new h;return p.fg=this.fg,p.bg=this.bg,p.extended=this.extended.clone(),p}isInverse(){return 67108864&this.fg}isBold(){return 134217728&this.fg}isUnderline(){return this.hasExtendedAttrs()&&this.extended.underlineStyle!==0?1:268435456&this.fg}isBlink(){return 536870912&this.fg}isInvisible(){return 1073741824&this.fg}isItalic(){return 67108864&this.bg}isDim(){return 134217728&this.bg}isStrikethrough(){return 2147483648&this.fg}isProtected(){return 536870912&this.bg}isOverline(){return 1073741824&this.bg}getFgColorMode(){return 50331648&this.fg}getBgColorMode(){return 50331648&this.bg}isFgRGB(){return(50331648&this.fg)==50331648}isBgRGB(){return(50331648&this.bg)==50331648}isFgPalette(){return(50331648&this.fg)==16777216||(50331648&this.fg)==33554432}isBgPalette(){return(50331648&this.bg)==16777216||(50331648&this.bg)==33554432}isFgDefault(){return(50331648&this.fg)==0}isBgDefault(){return(50331648&this.bg)==0}isAttributeDefault(){return this.fg===0&&this.bg===0}getFgColor(){switch(50331648&this.fg){case 16777216:case 33554432:return 255&this.fg;case 50331648:return 16777215&this.fg;default:return-1}}getBgColor(){switch(50331648&this.bg){case 16777216:case 33554432:return 255&this.bg;case 50331648:return 16777215&this.bg;default:return-1}}hasExtendedAttrs(){return 268435456&this.bg}updateExtended(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456}getUnderlineColor(){if(268435456&this.bg&&~this.extended.underlineColor)switch(50331648&this.extended.underlineColor){case 16777216:case 33554432:return 255&this.extended.underlineColor;case 50331648:return 16777215&this.extended.underlineColor;default:return this.getFgColor()}return this.getFgColor()}getUnderlineColorMode(){return 268435456&this.bg&&~this.extended.underlineColor?50331648&this.extended.underlineColor:this.getFgColorMode()}isUnderlineColorRGB(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==50331648:this.isFgRGB()}isUnderlineColorPalette(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==16777216||(50331648&this.extended.underlineColor)==33554432:this.isFgPalette()}isUnderlineColorDefault(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==0:this.isFgDefault()}getUnderlineStyle(){return 268435456&this.fg?268435456&this.bg?this.extended.underlineStyle:1:0}getUnderlineVariantOffset(){return this.extended.underlineVariantOffset}}c.AttributeData=h;class d{get ext(){return this._urlId?-469762049&this._ext|this.underlineStyle<<26:this._ext}set ext(p){this._ext=p}get underlineStyle(){return this._urlId?5:(469762048&this._ext)>>26}set underlineStyle(p){this._ext&=-469762049,this._ext|=p<<26&469762048}get underlineColor(){return 67108863&this._ext}set underlineColor(p){this._ext&=-67108864,this._ext|=67108863&p}get urlId(){return this._urlId}set urlId(p){this._urlId=p}get underlineVariantOffset(){const p=(3758096384&this._ext)>>29;return p<0?4294967288^p:p}set underlineVariantOffset(p){this._ext&=536870911,this._ext|=p<<29&3758096384}constructor(p=0,w=0){this._ext=0,this._urlId=0,this._ext=p,this._urlId=w}clone(){return new d(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}}c.ExtendedAttrs=d},9092:(_,c,h)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.Buffer=c.MAX_BUFFER_SIZE=void 0;const d=h(6349),y=h(7226),p=h(3734),w=h(8437),C=h(4634),T=h(511),E=h(643),g=h(4863),v=h(7116);c.MAX_BUFFER_SIZE=4294967295,c.Buffer=class{constructor(m,S,k){this._hasScrollback=m,this._optionsService=S,this._bufferService=k,this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.tabs={},this.savedY=0,this.savedX=0,this.savedCurAttrData=w.DEFAULT_ATTR_DATA.clone(),this.savedCharset=v.DEFAULT_CHARSET,this.markers=[],this._nullCell=T.CellData.fromCharData([0,E.NULL_CELL_CHAR,E.NULL_CELL_WIDTH,E.NULL_CELL_CODE]),this._whitespaceCell=T.CellData.fromCharData([0,E.WHITESPACE_CELL_CHAR,E.WHITESPACE_CELL_WIDTH,E.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 d.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}getNullCell(m){return m?(this._nullCell.fg=m.fg,this._nullCell.bg=m.bg,this._nullCell.extended=m.extended):(this._nullCell.fg=0,this._nullCell.bg=0,this._nullCell.extended=new p.ExtendedAttrs),this._nullCell}getWhitespaceCell(m){return m?(this._whitespaceCell.fg=m.fg,this._whitespaceCell.bg=m.bg,this._whitespaceCell.extended=m.extended):(this._whitespaceCell.fg=0,this._whitespaceCell.bg=0,this._whitespaceCell.extended=new p.ExtendedAttrs),this._whitespaceCell}getBlankLine(m,S){return new w.BufferLine(this._bufferService.cols,this.getNullCell(m),S)}get hasScrollback(){return this._hasScrollback&&this.lines.maxLength>this._rows}get isCursorInViewport(){const m=this.ybase+this.y-this.ydisp;return m>=0&&m<this._rows}_getCorrectBufferLength(m){if(!this._hasScrollback)return m;const S=m+this._optionsService.rawOptions.scrollback;return S>c.MAX_BUFFER_SIZE?c.MAX_BUFFER_SIZE:S}fillViewportRows(m){if(this.lines.length===0){m===void 0&&(m=w.DEFAULT_ATTR_DATA);let S=this._rows;for(;S--;)this.lines.push(this.getBlankLine(m))}}clear(){this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.lines=new d.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}resize(m,S){const k=this.getNullCell(w.DEFAULT_ATTR_DATA);let L=0;const R=this._getCorrectBufferLength(S);if(R>this.lines.maxLength&&(this.lines.maxLength=R),this.lines.length>0){if(this._cols<m)for(let A=0;A<this.lines.length;A++)L+=+this.lines.get(A).resize(m,k);let M=0;if(this._rows<S)for(let A=this._rows;A<S;A++)this.lines.length<S+this.ybase&&(this._optionsService.rawOptions.windowsMode||this._optionsService.rawOptions.windowsPty.backend!==void 0||this._optionsService.rawOptions.windowsPty.buildNumber!==void 0?this.lines.push(new w.BufferLine(m,k)):this.ybase>0&&this.lines.length<=this.ybase+this.y+M+1?(this.ybase--,M++,this.ydisp>0&&this.ydisp--):this.lines.push(new w.BufferLine(m,k)));else for(let A=this._rows;A>S;A--)this.lines.length>S+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(R<this.lines.maxLength){const A=this.lines.length-R;A>0&&(this.lines.trimStart(A),this.ybase=Math.max(this.ybase-A,0),this.ydisp=Math.max(this.ydisp-A,0),this.savedY=Math.max(this.savedY-A,0)),this.lines.maxLength=R}this.x=Math.min(this.x,m-1),this.y=Math.min(this.y,S-1),M&&(this.y+=M),this.savedX=Math.min(this.savedX,m-1),this.scrollTop=0}if(this.scrollBottom=S-1,this._isReflowEnabled&&(this._reflow(m,S),this._cols>m))for(let M=0;M<this.lines.length;M++)L+=+this.lines.get(M).resize(m,k);this._cols=m,this._rows=S,this._memoryCleanupQueue.clear(),L>.1*this.lines.length&&(this._memoryCleanupPosition=0,this._memoryCleanupQueue.enqueue((()=>this._batchedMemoryCleanup())))}_batchedMemoryCleanup(){let m=!0;this._memoryCleanupPosition>=this.lines.length&&(this._memoryCleanupPosition=0,m=!1);let S=0;for(;this._memoryCleanupPosition<this.lines.length;)if(S+=this.lines.get(this._memoryCleanupPosition++).cleanupMemory(),S>100)return!0;return m}get _isReflowEnabled(){const m=this._optionsService.rawOptions.windowsPty;return m&&m.buildNumber?this._hasScrollback&&m.backend==="conpty"&&m.buildNumber>=21376:this._hasScrollback&&!this._optionsService.rawOptions.windowsMode}_reflow(m,S){this._cols!==m&&(m>this._cols?this._reflowLarger(m,S):this._reflowSmaller(m,S))}_reflowLarger(m,S){const k=(0,C.reflowLargerGetLinesToRemove)(this.lines,this._cols,m,this.ybase+this.y,this.getNullCell(w.DEFAULT_ATTR_DATA));if(k.length>0){const L=(0,C.reflowLargerCreateNewLayout)(this.lines,k);(0,C.reflowLargerApplyNewLayout)(this.lines,L.layout),this._reflowLargerAdjustViewport(m,S,L.countRemoved)}}_reflowLargerAdjustViewport(m,S,k){const L=this.getNullCell(w.DEFAULT_ATTR_DATA);let R=k;for(;R-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length<S&&this.lines.push(new w.BufferLine(m,L))):(this.ydisp===this.ybase&&this.ydisp--,this.ybase--);this.savedY=Math.max(this.savedY-k,0)}_reflowSmaller(m,S){const k=this.getNullCell(w.DEFAULT_ATTR_DATA),L=[];let R=0;for(let M=this.lines.length-1;M>=0;M--){let A=this.lines.get(M);if(!A||!A.isWrapped&&A.getTrimmedLength()<=m)continue;const B=[A];for(;A.isWrapped&&M>0;)A=this.lines.get(--M),B.unshift(A);const K=this.ybase+this.y;if(K>=M&&K<M+B.length)continue;const F=B[B.length-1].getTrimmedLength(),W=(0,C.reflowSmallerGetNewLineLengths)(B,this._cols,m),I=W.length-B.length;let Z;Z=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 X=[];for(let D=0;D<I;D++){const U=this.getBlankLine(w.DEFAULT_ATTR_DATA,!0);X.push(U)}X.length>0&&(L.push({start:M+B.length+R,newLines:X}),R+=X.length),B.push(...X);let z=W.length-1,q=W[z];q===0&&(z--,q=W[z]);let V=B.length-I-1,j=F;for(;V>=0;){const D=Math.min(j,q);if(B[z]===void 0)break;if(B[z].copyCellsFrom(B[V],j-D,q-D,D,!0),q-=D,q===0&&(z--,q=W[z]),j-=D,j===0){V--;const U=Math.max(V,0);j=(0,C.getWrappedLineTrimmedLength)(B,U,this._cols)}}for(let D=0;D<B.length;D++)W[D]<m&&B[D].setCell(W[D],k);let P=I-Z;for(;P-- >0;)this.ybase===0?this.y<S-1?(this.y++,this.lines.pop()):(this.ybase++,this.ydisp++):this.ybase<Math.min(this.lines.maxLength,this.lines.length+R)-S&&(this.ybase===this.ydisp&&this.ydisp++,this.ybase++);this.savedY=Math.min(this.savedY+I,this.ybase+S-1)}if(L.length>0){const M=[],A=[];for(let z=0;z<this.lines.length;z++)A.push(this.lines.get(z));const B=this.lines.length;let K=B-1,F=0,W=L[F];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+R);let I=0;for(let z=Math.min(this.lines.maxLength-1,B+R-1);z>=0;z--)if(W&&W.start>K+I){for(let q=W.newLines.length-1;q>=0;q--)this.lines.set(z--,W.newLines[q]);z++,M.push({index:K+1,amount:W.newLines.length}),I+=W.newLines.length,W=L[++F]}else this.lines.set(z,A[K--]);let Z=0;for(let z=M.length-1;z>=0;z--)M[z].index+=Z,this.lines.onInsertEmitter.fire(M[z]),Z+=M[z].amount;const X=Math.max(0,B+R-this.lines.maxLength);X>0&&this.lines.onTrimEmitter.fire(X)}}translateBufferLineToString(m,S,k=0,L){const R=this.lines.get(m);return R?R.translateToString(S,k,L):""}getWrappedRangeForLine(m){let S=m,k=m;for(;S>0&&this.lines.get(S).isWrapped;)S--;for(;k+1<this.lines.length&&this.lines.get(k+1).isWrapped;)k++;return{first:S,last:k}}setupTabStops(m){for(m!=null?this.tabs[m]||(m=this.prevStop(m)):(this.tabs={},m=0);m<this._cols;m+=this._optionsService.rawOptions.tabStopWidth)this.tabs[m]=!0}prevStop(m){for(m==null&&(m=this.x);!this.tabs[--m]&&m>0;);return m>=this._cols?this._cols-1:m<0?0:m}nextStop(m){for(m==null&&(m=this.x);!this.tabs[++m]&&m<this._cols;);return m>=this._cols?this._cols-1:m<0?0:m}clearMarkers(m){this._isClearing=!0;for(let S=0;S<this.markers.length;S++)this.markers[S].line===m&&(this.markers[S].dispose(),this.markers.splice(S--,1));this._isClearing=!1}clearAllMarkers(){this._isClearing=!0;for(let m=0;m<this.markers.length;m++)this.markers[m].dispose(),this.markers.splice(m--,1);this._isClearing=!1}addMarker(m){const S=new g.Marker(m);return this.markers.push(S),S.register(this.lines.onTrim((k=>{S.line-=k,S.line<0&&S.dispose()}))),S.register(this.lines.onInsert((k=>{S.line>=k.index&&(S.line+=k.amount)}))),S.register(this.lines.onDelete((k=>{S.line>=k.index&&S.line<k.index+k.amount&&S.dispose(),S.line>k.index&&(S.line-=k.amount)}))),S.register(S.onDispose((()=>this._removeMarker(S)))),S}_removeMarker(m){this._isClearing||this.markers.splice(this.markers.indexOf(m),1)}}},8437:(_,c,h)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.BufferLine=c.DEFAULT_ATTR_DATA=void 0;const d=h(3734),y=h(511),p=h(643),w=h(482);c.DEFAULT_ATTR_DATA=Object.freeze(new d.AttributeData);let C=0;class T{constructor(g,v,m=!1){this.isWrapped=m,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(3*g);const S=v||y.CellData.fromCharData([0,p.NULL_CELL_CHAR,p.NULL_CELL_WIDTH,p.NULL_CELL_CODE]);for(let k=0;k<g;++k)this.setCell(k,S);this.length=g}get(g){const v=this._data[3*g+0],m=2097151&v;return[this._data[3*g+1],2097152&v?this._combined[g]:m?(0,w.stringFromCodePoint)(m):"",v>>22,2097152&v?this._combined[g].charCodeAt(this._combined[g].length-1):m]}set(g,v){this._data[3*g+1]=v[p.CHAR_DATA_ATTR_INDEX],v[p.CHAR_DATA_CHAR_INDEX].length>1?(this._combined[g]=v[1],this._data[3*g+0]=2097152|g|v[p.CHAR_DATA_WIDTH_INDEX]<<22):this._data[3*g+0]=v[p.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|v[p.CHAR_DATA_WIDTH_INDEX]<<22}getWidth(g){return this._data[3*g+0]>>22}hasWidth(g){return 12582912&this._data[3*g+0]}getFg(g){return this._data[3*g+1]}getBg(g){return this._data[3*g+2]}hasContent(g){return 4194303&this._data[3*g+0]}getCodePoint(g){const v=this._data[3*g+0];return 2097152&v?this._combined[g].charCodeAt(this._combined[g].length-1):2097151&v}isCombined(g){return 2097152&this._data[3*g+0]}getString(g){const v=this._data[3*g+0];return 2097152&v?this._combined[g]:2097151&v?(0,w.stringFromCodePoint)(2097151&v):""}isProtected(g){return 536870912&this._data[3*g+2]}loadCell(g,v){return C=3*g,v.content=this._data[C+0],v.fg=this._data[C+1],v.bg=this._data[C+2],2097152&v.content&&(v.combinedData=this._combined[g]),268435456&v.bg&&(v.extended=this._extendedAttrs[g]),v}setCell(g,v){2097152&v.content&&(this._combined[g]=v.combinedData),268435456&v.bg&&(this._extendedAttrs[g]=v.extended),this._data[3*g+0]=v.content,this._data[3*g+1]=v.fg,this._data[3*g+2]=v.bg}setCellFromCodepoint(g,v,m,S){268435456&S.bg&&(this._extendedAttrs[g]=S.extended),this._data[3*g+0]=v|m<<22,this._data[3*g+1]=S.fg,this._data[3*g+2]=S.bg}addCodepointToCell(g,v,m){let S=this._data[3*g+0];2097152&S?this._combined[g]+=(0,w.stringFromCodePoint)(v):2097151&S?(this._combined[g]=(0,w.stringFromCodePoint)(2097151&S)+(0,w.stringFromCodePoint)(v),S&=-2097152,S|=2097152):S=v|4194304,m&&(S&=-12582913,S|=m<<22),this._data[3*g+0]=S}insertCells(g,v,m){if((g%=this.length)&&this.getWidth(g-1)===2&&this.setCellFromCodepoint(g-1,0,1,m),v<this.length-g){const S=new y.CellData;for(let k=this.length-g-v-1;k>=0;--k)this.setCell(g+v+k,this.loadCell(g+k,S));for(let k=0;k<v;++k)this.setCell(g+k,m)}else for(let S=g;S<this.length;++S)this.setCell(S,m);this.getWidth(this.length-1)===2&&this.setCellFromCodepoint(this.length-1,0,1,m)}deleteCells(g,v,m){if(g%=this.length,v<this.length-g){const S=new y.CellData;for(let k=0;k<this.length-g-v;++k)this.setCell(g+k,this.loadCell(g+v+k,S));for(let k=this.length-v;k<this.length;++k)this.setCell(k,m)}else for(let S=g;S<this.length;++S)this.setCell(S,m);g&&this.getWidth(g-1)===2&&this.setCellFromCodepoint(g-1,0,1,m),this.getWidth(g)!==0||this.hasContent(g)||this.setCellFromCodepoint(g,0,1,m)}replaceCells(g,v,m,S=!1){if(S)for(g&&this.getWidth(g-1)===2&&!this.isProtected(g-1)&&this.setCellFromCodepoint(g-1,0,1,m),v<this.length&&this.getWidth(v-1)===2&&!this.isProtected(v)&&this.setCellFromCodepoint(v,0,1,m);g<v&&g<this.length;)this.isProtected(g)||this.setCell(g,m),g++;else for(g&&this.getWidth(g-1)===2&&this.setCellFromCodepoint(g-1,0,1,m),v<this.length&&this.getWidth(v-1)===2&&this.setCellFromCodepoint(v,0,1,m);g<v&&g<this.length;)this.setCell(g++,m)}resize(g,v){if(g===this.length)return 4*this._data.length*2<this._data.buffer.byteLength;const m=3*g;if(g>this.length){if(this._data.buffer.byteLength>=4*m)this._data=new Uint32Array(this._data.buffer,0,m);else{const S=new Uint32Array(m);S.set(this._data),this._data=S}for(let S=this.length;S<g;++S)this.setCell(S,v)}else{this._data=this._data.subarray(0,m);const S=Object.keys(this._combined);for(let L=0;L<S.length;L++){const R=parseInt(S[L],10);R>=g&&delete this._combined[R]}const k=Object.keys(this._extendedAttrs);for(let L=0;L<k.length;L++){const R=parseInt(k[L],10);R>=g&&delete this._extendedAttrs[R]}}return this.length=g,4*m*2<this._data.buffer.byteLength}cleanupMemory(){if(4*this._data.length*2<this._data.buffer.byteLength){const g=new Uint32Array(this._data.length);return g.set(this._data),this._data=g,1}return 0}fill(g,v=!1){if(v)for(let m=0;m<this.length;++m)this.isProtected(m)||this.setCell(m,g);else{this._combined={},this._extendedAttrs={};for(let m=0;m<this.length;++m)this.setCell(m,g)}}copyFrom(g){this.length!==g.length?this._data=new Uint32Array(g._data):this._data.set(g._data),this.length=g.length,this._combined={};for(const v in g._combined)this._combined[v]=g._combined[v];this._extendedAttrs={};for(const v in g._extendedAttrs)this._extendedAttrs[v]=g._extendedAttrs[v];this.isWrapped=g.isWrapped}clone(){const g=new T(0);g._data=new Uint32Array(this._data),g.length=this.length;for(const v in this._combined)g._combined[v]=this._combined[v];for(const v in this._extendedAttrs)g._extendedAttrs[v]=this._extendedAttrs[v];return g.isWrapped=this.isWrapped,g}getTrimmedLength(){for(let g=this.length-1;g>=0;--g)if(4194303&this._data[3*g+0])return g+(this._data[3*g+0]>>22);return 0}getNoBgTrimmedLength(){for(let g=this.length-1;g>=0;--g)if(4194303&this._data[3*g+0]||50331648&this._data[3*g+2])return g+(this._data[3*g+0]>>22);return 0}copyCellsFrom(g,v,m,S,k){const L=g._data;if(k)for(let M=S-1;M>=0;M--){for(let A=0;A<3;A++)this._data[3*(m+M)+A]=L[3*(v+M)+A];268435456&L[3*(v+M)+2]&&(this._extendedAttrs[m+M]=g._extendedAttrs[v+M])}else for(let M=0;M<S;M++){for(let A=0;A<3;A++)this._data[3*(m+M)+A]=L[3*(v+M)+A];268435456&L[3*(v+M)+2]&&(this._extendedAttrs[m+M]=g._extendedAttrs[v+M])}const R=Object.keys(g._combined);for(let M=0;M<R.length;M++){const A=parseInt(R[M],10);A>=v&&(this._combined[A-v+m]=g._combined[A])}}translateToString(g,v,m,S){v=v??0,m=m??this.length,g&&(m=Math.min(m,this.getTrimmedLength())),S&&(S.length=0);let k="";for(;v<m;){const L=this._data[3*v+0],R=2097151&L,M=2097152&L?this._combined[v]:R?(0,w.stringFromCodePoint)(R):p.WHITESPACE_CELL_CHAR;if(k+=M,S)for(let A=0;A<M.length;++A)S.push(v);v+=L>>22||1}return S&&S.push(v),k}}c.BufferLine=T},4841:(_,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.getRangeLength=void 0,c.getRangeLength=function(h,d){if(h.start.y>h.end.y)throw new Error(`Buffer range end (${h.end.x}, ${h.end.y}) cannot be before start (${h.start.x}, ${h.start.y})`);return d*(h.end.y-h.start.y)+(h.end.x-h.start.x+1)}},4634:(_,c)=>{function h(d,y,p){if(y===d.length-1)return d[y].getTrimmedLength();const w=!d[y].hasContent(p-1)&&d[y].getWidth(p-1)===1,C=d[y+1].getWidth(0)===2;return w&&C?p-1:p}Object.defineProperty(c,"__esModule",{value:!0}),c.getWrappedLineTrimmedLength=c.reflowSmallerGetNewLineLengths=c.reflowLargerApplyNewLayout=c.reflowLargerCreateNewLayout=c.reflowLargerGetLinesToRemove=void 0,c.reflowLargerGetLinesToRemove=function(d,y,p,w,C){const T=[];for(let E=0;E<d.length-1;E++){let g=E,v=d.get(++g);if(!v.isWrapped)continue;const m=[d.get(E)];for(;g<d.length&&v.isWrapped;)m.push(v),v=d.get(++g);if(w>=E&&w<g){E+=m.length-1;continue}let S=0,k=h(m,S,y),L=1,R=0;for(;L<m.length;){const A=h(m,L,y),B=A-R,K=p-k,F=Math.min(B,K);m[S].copyCellsFrom(m[L],R,k,F,!1),k+=F,k===p&&(S++,k=0),R+=F,R===A&&(L++,R=0),k===0&&S!==0&&m[S-1].getWidth(p-1)===2&&(m[S].copyCellsFrom(m[S-1],p-1,k++,1,!1),m[S-1].setCell(p-1,C))}m[S].replaceCells(k,p,C);let M=0;for(let A=m.length-1;A>0&&(A>S||m[A].getTrimmedLength()===0);A--)M++;M>0&&(T.push(E+m.length-M),T.push(M)),E+=m.length-1}return T},c.reflowLargerCreateNewLayout=function(d,y){const p=[];let w=0,C=y[w],T=0;for(let E=0;E<d.length;E++)if(C===E){const g=y[++w];d.onDeleteEmitter.fire({index:E-T,amount:g}),E+=g-1,T+=g,C=y[++w]}else p.push(E);return{layout:p,countRemoved:T}},c.reflowLargerApplyNewLayout=function(d,y){const p=[];for(let w=0;w<y.length;w++)p.push(d.get(y[w]));for(let w=0;w<p.length;w++)d.set(w,p[w]);d.length=y.length},c.reflowSmallerGetNewLineLengths=function(d,y,p){const w=[],C=d.map(((v,m)=>h(d,m,y))).reduce(((v,m)=>v+m));let T=0,E=0,g=0;for(;g<C;){if(C-g<p){w.push(C-g);break}T+=p;const v=h(d,E,y);T>v&&(T-=v,E++);const m=d[E].getWidth(T-1)===2;m&&T--;const S=m?p-1:p;w.push(S),g+=S}return w},c.getWrappedLineTrimmedLength=h},5295:(_,c,h)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.BufferSet=void 0;const d=h(8460),y=h(844),p=h(9092);class w extends y.Disposable{constructor(T,E){super(),this._optionsService=T,this._bufferService=E,this._onBufferActivate=this.register(new d.EventEmitter),this.onBufferActivate=this._onBufferActivate.event,this.reset(),this.register(this._optionsService.onSpecificOptionChange("scrollback",(()=>this.resize(this._bufferService.cols,this._bufferService.rows)))),this.register(this._optionsService.onSpecificOptionChange("tabStopWidth",(()=>this.setupTabStops())))}reset(){this._normal=new p.Buffer(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new p.Buffer(!1,this._optionsService,this._bufferService),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}),this.setupTabStops()}get alt(){return this._alt}get active(){return this._activeBuffer}get normal(){return this._normal}activateNormalBuffer(){this._activeBuffer!==this._normal&&(this._normal.x=this._alt.x,this._normal.y=this._alt.y,this._alt.clearAllMarkers(),this._alt.clear(),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}))}activateAltBuffer(T){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(T),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(T,E){this._normal.resize(T,E),this._alt.resize(T,E),this.setupTabStops(T)}setupTabStops(T){this._normal.setupTabStops(T),this._alt.setupTabStops(T)}}c.BufferSet=w},511:(_,c,h)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.CellData=void 0;const d=h(482),y=h(643),p=h(3734);class w extends p.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new p.ExtendedAttrs,this.combinedData=""}static fromCharData(T){const E=new w;return E.setFromCharData(T),E}isCombined(){return 2097152&this.content}getWidth(){return this.content>>22}getChars(){return 2097152&this.content?this.combinedData:2097151&this.content?(0,d.stringFromCodePoint)(2097151&this.content):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content}setFromCharData(T){this.fg=T[y.CHAR_DATA_ATTR_INDEX],this.bg=0;let E=!1;if(T[y.CHAR_DATA_CHAR_INDEX].length>2)E=!0;else if(T[y.CHAR_DATA_CHAR_INDEX].length===2){const g=T[y.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=g&&g<=56319){const v=T[y.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=v&&v<=57343?this.content=1024*(g-55296)+v-56320+65536|T[y.CHAR_DATA_WIDTH_INDEX]<<22:E=!0}else E=!0}else this.content=T[y.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|T[y.CHAR_DATA_WIDTH_INDEX]<<22;E&&(this.combinedData=T[y.CHAR_DATA_CHAR_INDEX],this.content=2097152|T[y.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}c.CellData=w},643:(_,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:(_,c,h)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.Marker=void 0;const d=h(8460),y=h(844);class p{get id(){return this._id}constructor(C){this.line=C,this.isDisposed=!1,this._disposables=[],this._id=p._nextId++,this._onDispose=this.register(new d.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(C){return this._disposables.push(C),C}}c.Marker=p,p._nextId=1},7116:(_,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:(_,c)=>{var h,d,y;Object.defineProperty(c,"__esModule",{value:!0}),c.C1_ESCAPED=c.C1=c.C0=void 0,(function(p){p.NUL="\0",p.SOH="",p.STX="",p.ETX="",p.EOT="",p.ENQ="",p.ACK="",p.BEL="\x07",p.BS="\b",p.HT=" ",p.LF=`
|
|
81
|
-
`,p.VT="\v",p.FF="\f",p.CR="\r",p.SO="",p.SI="",p.DLE="",p.DC1="",p.DC2="",p.DC3="",p.DC4="",p.NAK="",p.SYN="",p.ETB="",p.CAN="",p.EM="",p.SUB="",p.ESC="\x1B",p.FS="",p.GS="",p.RS="",p.US="",p.SP=" ",p.DEL=""})(h||(c.C0=h={})),(function(p){p.PAD="",p.HOP="",p.BPH="",p.NBH="",p.IND="",p.NEL="
",p.SSA="",p.ESA="",p.HTS="",p.HTJ="",p.VTS="",p.PLD="",p.PLU="",p.RI="",p.SS2="",p.SS3="",p.DCS="",p.PU1="",p.PU2="",p.STS="",p.CCH="",p.MW="",p.SPA="",p.EPA="",p.SOS="",p.SGCI="",p.SCI="",p.CSI="",p.ST="",p.OSC="",p.PM="",p.APC=""})(d||(c.C1=d={})),(function(p){p.ST=`${h.ESC}\\`})(y||(c.C1_ESCAPED=y={}))},7399:(_,c,h)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.evaluateKeyboardEvent=void 0;const d=h(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(p,w,C,T){const E={type:0,cancel:!1,key:void 0},g=(p.shiftKey?1:0)|(p.altKey?2:0)|(p.ctrlKey?4:0)|(p.metaKey?8:0);switch(p.keyCode){case 0:p.key==="UIKeyInputUpArrow"?E.key=w?d.C0.ESC+"OA":d.C0.ESC+"[A":p.key==="UIKeyInputLeftArrow"?E.key=w?d.C0.ESC+"OD":d.C0.ESC+"[D":p.key==="UIKeyInputRightArrow"?E.key=w?d.C0.ESC+"OC":d.C0.ESC+"[C":p.key==="UIKeyInputDownArrow"&&(E.key=w?d.C0.ESC+"OB":d.C0.ESC+"[B");break;case 8:E.key=p.ctrlKey?"\b":d.C0.DEL,p.altKey&&(E.key=d.C0.ESC+E.key);break;case 9:if(p.shiftKey){E.key=d.C0.ESC+"[Z";break}E.key=d.C0.HT,E.cancel=!0;break;case 13:E.key=p.altKey?d.C0.ESC+d.C0.CR:d.C0.CR,E.cancel=!0;break;case 27:E.key=d.C0.ESC,p.altKey&&(E.key=d.C0.ESC+d.C0.ESC),E.cancel=!0;break;case 37:if(p.metaKey)break;g?(E.key=d.C0.ESC+"[1;"+(g+1)+"D",E.key===d.C0.ESC+"[1;3D"&&(E.key=d.C0.ESC+(C?"b":"[1;5D"))):E.key=w?d.C0.ESC+"OD":d.C0.ESC+"[D";break;case 39:if(p.metaKey)break;g?(E.key=d.C0.ESC+"[1;"+(g+1)+"C",E.key===d.C0.ESC+"[1;3C"&&(E.key=d.C0.ESC+(C?"f":"[1;5C"))):E.key=w?d.C0.ESC+"OC":d.C0.ESC+"[C";break;case 38:if(p.metaKey)break;g?(E.key=d.C0.ESC+"[1;"+(g+1)+"A",C||E.key!==d.C0.ESC+"[1;3A"||(E.key=d.C0.ESC+"[1;5A")):E.key=w?d.C0.ESC+"OA":d.C0.ESC+"[A";break;case 40:if(p.metaKey)break;g?(E.key=d.C0.ESC+"[1;"+(g+1)+"B",C||E.key!==d.C0.ESC+"[1;3B"||(E.key=d.C0.ESC+"[1;5B")):E.key=w?d.C0.ESC+"OB":d.C0.ESC+"[B";break;case 45:p.shiftKey||p.ctrlKey||(E.key=d.C0.ESC+"[2~");break;case 46:E.key=g?d.C0.ESC+"[3;"+(g+1)+"~":d.C0.ESC+"[3~";break;case 36:E.key=g?d.C0.ESC+"[1;"+(g+1)+"H":w?d.C0.ESC+"OH":d.C0.ESC+"[H";break;case 35:E.key=g?d.C0.ESC+"[1;"+(g+1)+"F":w?d.C0.ESC+"OF":d.C0.ESC+"[F";break;case 33:p.shiftKey?E.type=2:p.ctrlKey?E.key=d.C0.ESC+"[5;"+(g+1)+"~":E.key=d.C0.ESC+"[5~";break;case 34:p.shiftKey?E.type=3:p.ctrlKey?E.key=d.C0.ESC+"[6;"+(g+1)+"~":E.key=d.C0.ESC+"[6~";break;case 112:E.key=g?d.C0.ESC+"[1;"+(g+1)+"P":d.C0.ESC+"OP";break;case 113:E.key=g?d.C0.ESC+"[1;"+(g+1)+"Q":d.C0.ESC+"OQ";break;case 114:E.key=g?d.C0.ESC+"[1;"+(g+1)+"R":d.C0.ESC+"OR";break;case 115:E.key=g?d.C0.ESC+"[1;"+(g+1)+"S":d.C0.ESC+"OS";break;case 116:E.key=g?d.C0.ESC+"[15;"+(g+1)+"~":d.C0.ESC+"[15~";break;case 117:E.key=g?d.C0.ESC+"[17;"+(g+1)+"~":d.C0.ESC+"[17~";break;case 118:E.key=g?d.C0.ESC+"[18;"+(g+1)+"~":d.C0.ESC+"[18~";break;case 119:E.key=g?d.C0.ESC+"[19;"+(g+1)+"~":d.C0.ESC+"[19~";break;case 120:E.key=g?d.C0.ESC+"[20;"+(g+1)+"~":d.C0.ESC+"[20~";break;case 121:E.key=g?d.C0.ESC+"[21;"+(g+1)+"~":d.C0.ESC+"[21~";break;case 122:E.key=g?d.C0.ESC+"[23;"+(g+1)+"~":d.C0.ESC+"[23~";break;case 123:E.key=g?d.C0.ESC+"[24;"+(g+1)+"~":d.C0.ESC+"[24~";break;default:if(!p.ctrlKey||p.shiftKey||p.altKey||p.metaKey)if(C&&!T||!p.altKey||p.metaKey)!C||p.altKey||p.ctrlKey||p.shiftKey||!p.metaKey?p.key&&!p.ctrlKey&&!p.altKey&&!p.metaKey&&p.keyCode>=48&&p.key.length===1?E.key=p.key:p.key&&p.ctrlKey&&(p.key==="_"&&(E.key=d.C0.US),p.key==="@"&&(E.key=d.C0.NUL)):p.keyCode===65&&(E.type=1);else{const v=y[p.keyCode],m=v?.[p.shiftKey?1:0];if(m)E.key=d.C0.ESC+m;else if(p.keyCode>=65&&p.keyCode<=90){const S=p.ctrlKey?p.keyCode-64:p.keyCode+32;let k=String.fromCharCode(S);p.shiftKey&&(k=k.toUpperCase()),E.key=d.C0.ESC+k}else if(p.keyCode===32)E.key=d.C0.ESC+(p.ctrlKey?d.C0.NUL:" ");else if(p.key==="Dead"&&p.code.startsWith("Key")){let S=p.code.slice(3,4);p.shiftKey||(S=S.toLowerCase()),E.key=d.C0.ESC+S,E.cancel=!0}}else p.keyCode>=65&&p.keyCode<=90?E.key=String.fromCharCode(p.keyCode-64):p.keyCode===32?E.key=d.C0.NUL:p.keyCode>=51&&p.keyCode<=55?E.key=String.fromCharCode(p.keyCode-51+27):p.keyCode===56?E.key=d.C0.DEL:p.keyCode===219?E.key=d.C0.ESC:p.keyCode===220?E.key=d.C0.FS:p.keyCode===221&&(E.key=d.C0.GS)}return E}},482:(_,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.Utf8ToUtf32=c.StringToUtf32=c.utf32ToString=c.stringFromCodePoint=void 0,c.stringFromCodePoint=function(h){return h>65535?(h-=65536,String.fromCharCode(55296+(h>>10))+String.fromCharCode(h%1024+56320)):String.fromCharCode(h)},c.utf32ToString=function(h,d=0,y=h.length){let p="";for(let w=d;w<y;++w){let C=h[w];C>65535?(C-=65536,p+=String.fromCharCode(55296+(C>>10))+String.fromCharCode(C%1024+56320)):p+=String.fromCharCode(C)}return p},c.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(h,d){const y=h.length;if(!y)return 0;let p=0,w=0;if(this._interim){const C=h.charCodeAt(w++);56320<=C&&C<=57343?d[p++]=1024*(this._interim-55296)+C-56320+65536:(d[p++]=this._interim,d[p++]=C),this._interim=0}for(let C=w;C<y;++C){const T=h.charCodeAt(C);if(55296<=T&&T<=56319){if(++C>=y)return this._interim=T,p;const E=h.charCodeAt(C);56320<=E&&E<=57343?d[p++]=1024*(T-55296)+E-56320+65536:(d[p++]=T,d[p++]=E)}else T!==65279&&(d[p++]=T)}return p}},c.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(h,d){const y=h.length;if(!y)return 0;let p,w,C,T,E=0,g=0,v=0;if(this.interim[0]){let k=!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 A=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,B=A-M;for(;v<B;){if(v>=y)return 0;if(R=h[v++],(192&R)!=128){v--,k=!0;break}this.interim[M++]=R,L<<=6,L|=63&R}k||(A===2?L<128?v--:d[E++]=L:A===3?L<2048||L>=55296&&L<=57343||L===65279||(d[E++]=L):L<65536||L>1114111||(d[E++]=L)),this.interim.fill(0)}const m=y-4;let S=v;for(;S<y;){for(;!(!(S<m)||128&(p=h[S])||128&(w=h[S+1])||128&(C=h[S+2])||128&(T=h[S+3]));)d[E++]=p,d[E++]=w,d[E++]=C,d[E++]=T,S+=4;if(p=h[S++],p<128)d[E++]=p;else if((224&p)==192){if(S>=y)return this.interim[0]=p,E;if(w=h[S++],(192&w)!=128){S--;continue}if(g=(31&p)<<6|63&w,g<128){S--;continue}d[E++]=g}else if((240&p)==224){if(S>=y)return this.interim[0]=p,E;if(w=h[S++],(192&w)!=128){S--;continue}if(S>=y)return this.interim[0]=p,this.interim[1]=w,E;if(C=h[S++],(192&C)!=128){S--;continue}if(g=(15&p)<<12|(63&w)<<6|63&C,g<2048||g>=55296&&g<=57343||g===65279)continue;d[E++]=g}else if((248&p)==240){if(S>=y)return this.interim[0]=p,E;if(w=h[S++],(192&w)!=128){S--;continue}if(S>=y)return this.interim[0]=p,this.interim[1]=w,E;if(C=h[S++],(192&C)!=128){S--;continue}if(S>=y)return this.interim[0]=p,this.interim[1]=w,this.interim[2]=C,E;if(T=h[S++],(192&T)!=128){S--;continue}if(g=(7&p)<<18|(63&w)<<12|(63&C)<<6|63&T,g<65536||g>1114111)continue;d[E++]=g}}return E}}},225:(_,c,h)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.UnicodeV6=void 0;const d=h(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]],p=[[68097,68099],[68101,68102],[68108,68111],[68152,68154],[68159,68159],[119143,119145],[119155,119170],[119173,119179],[119210,119213],[119362,119364],[917505,917505],[917536,917631],[917760,917999]];let w;c.UnicodeV6=class{constructor(){if(this.version="6",!w){w=new Uint8Array(65536),w.fill(1),w[0]=0,w.fill(0,1,32),w.fill(0,127,160),w.fill(2,4352,4448),w[9001]=2,w[9002]=2,w.fill(2,11904,42192),w[12351]=1,w.fill(2,44032,55204),w.fill(2,63744,64256),w.fill(2,65040,65050),w.fill(2,65072,65136),w.fill(2,65280,65377),w.fill(2,65504,65511);for(let C=0;C<y.length;++C)w.fill(0,y[C][0],y[C][1]+1)}}wcwidth(C){return C<32?0:C<127?1:C<65536?w[C]:(function(T,E){let g,v=0,m=E.length-1;if(T<E[0][0]||T>E[m][1])return!1;for(;m>=v;)if(g=v+m>>1,T>E[g][1])v=g+1;else{if(!(T<E[g][0]))return!0;m=g-1}return!1})(C,p)?0:C>=131072&&C<=196605||C>=196608&&C<=262141?2:1}charProperties(C,T){let E=this.wcwidth(C),g=E===0&&T!==0;if(g){const v=d.UnicodeService.extractWidth(T);v===0?g=!1:v>E&&(E=v)}return d.UnicodeService.createPropertyValue(0,E,g)}}},5981:(_,c,h)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.WriteBuffer=void 0;const d=h(8460),y=h(844);class p extends y.Disposable{constructor(C){super(),this._action=C,this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=0,this._isSyncWriting=!1,this._syncCalls=0,this._didUserInput=!1,this._onWriteParsed=this.register(new d.EventEmitter),this.onWriteParsed=this._onWriteParsed.event}handleUserInput(){this._didUserInput=!0}writeSync(C,T){if(T!==void 0&&this._syncCalls>T)return void(this._syncCalls=0);if(this._pendingData+=C.length,this._writeBuffer.push(C),this._callbacks.push(void 0),this._syncCalls++,this._isSyncWriting)return;let E;for(this._isSyncWriting=!0;E=this._writeBuffer.shift();){this._action(E);const g=this._callbacks.shift();g&&g()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(C,T){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+=C.length,this._writeBuffer.push(C),this._callbacks.push(T),void this._innerWrite();setTimeout((()=>this._innerWrite()))}this._pendingData+=C.length,this._writeBuffer.push(C),this._callbacks.push(T)}_innerWrite(C=0,T=!0){const E=C||Date.now();for(;this._writeBuffer.length>this._bufferOffset;){const g=this._writeBuffer[this._bufferOffset],v=this._action(g,T);if(v){const S=k=>Date.now()-E>=12?setTimeout((()=>this._innerWrite(0,k))):this._innerWrite(E,k);return void v.catch((k=>(queueMicrotask((()=>{throw k})),Promise.resolve(!1)))).then(S)}const m=this._callbacks[this._bufferOffset];if(m&&m(),this._bufferOffset++,this._pendingData-=g.length,Date.now()-E>=12)break}this._writeBuffer.length>this._bufferOffset?(this._bufferOffset>50&&(this._writeBuffer=this._writeBuffer.slice(this._bufferOffset),this._callbacks=this._callbacks.slice(this._bufferOffset),this._bufferOffset=0),setTimeout((()=>this._innerWrite()))):(this._writeBuffer.length=0,this._callbacks.length=0,this._pendingData=0,this._bufferOffset=0),this._onWriteParsed.fire()}}c.WriteBuffer=p},5941:(_,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.toRgbString=c.parseColor=void 0;const h=/^([\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})$/,d=/^[\da-f]+$/;function y(p,w){const C=p.toString(16),T=C.length<2?"0"+C:C;switch(w){case 4:return C[0];case 8:return T;case 12:return(T+T).slice(0,3);default:return T+T}}c.parseColor=function(p){if(!p)return;let w=p.toLowerCase();if(w.indexOf("rgb:")===0){w=w.slice(4);const C=h.exec(w);if(C){const T=C[1]?15:C[4]?255:C[7]?4095:65535;return[Math.round(parseInt(C[1]||C[4]||C[7]||C[10],16)/T*255),Math.round(parseInt(C[2]||C[5]||C[8]||C[11],16)/T*255),Math.round(parseInt(C[3]||C[6]||C[9]||C[12],16)/T*255)]}}else if(w.indexOf("#")===0&&(w=w.slice(1),d.exec(w)&&[3,6,9,12].includes(w.length))){const C=w.length/3,T=[0,0,0];for(let E=0;E<3;++E){const g=parseInt(w.slice(C*E,C*E+C),16);T[E]=C===1?g<<4:C===2?g:C===3?g>>4:g>>8}return T}},c.toRgbString=function(p,w=16){const[C,T,E]=p;return`rgb:${y(C,w)}/${y(T,w)}/${y(E,w)}`}},5770:(_,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.PAYLOAD_LIMIT=void 0,c.PAYLOAD_LIMIT=1e7},6351:(_,c,h)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.DcsHandler=c.DcsParser=void 0;const d=h(482),y=h(8742),p=h(5770),w=[];c.DcsParser=class{constructor(){this._handlers=Object.create(null),this._active=w,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=w}registerHandler(T,E){this._handlers[T]===void 0&&(this._handlers[T]=[]);const g=this._handlers[T];return g.push(E),{dispose:()=>{const v=g.indexOf(E);v!==-1&&g.splice(v,1)}}}clearHandler(T){this._handlers[T]&&delete this._handlers[T]}setHandlerFallback(T){this._handlerFb=T}reset(){if(this._active.length)for(let T=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;T>=0;--T)this._active[T].unhook(!1);this._stack.paused=!1,this._active=w,this._ident=0}hook(T,E){if(this.reset(),this._ident=T,this._active=this._handlers[T]||w,this._active.length)for(let g=this._active.length-1;g>=0;g--)this._active[g].hook(E);else this._handlerFb(this._ident,"HOOK",E)}put(T,E,g){if(this._active.length)for(let v=this._active.length-1;v>=0;v--)this._active[v].put(T,E,g);else this._handlerFb(this._ident,"PUT",(0,d.utf32ToString)(T,E,g))}unhook(T,E=!0){if(this._active.length){let g=!1,v=this._active.length-1,m=!1;if(this._stack.paused&&(v=this._stack.loopPosition-1,g=E,m=this._stack.fallThrough,this._stack.paused=!1),!m&&g===!1){for(;v>=0&&(g=this._active[v].unhook(T),g!==!0);v--)if(g instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=v,this._stack.fallThrough=!1,g;v--}for(;v>=0;v--)if(g=this._active[v].unhook(!1),g instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=v,this._stack.fallThrough=!0,g}else this._handlerFb(this._ident,"UNHOOK",T);this._active=w,this._ident=0}};const C=new y.Params;C.addParam(0),c.DcsHandler=class{constructor(T){this._handler=T,this._data="",this._params=C,this._hitLimit=!1}hook(T){this._params=T.length>1||T.params[0]?T.clone():C,this._data="",this._hitLimit=!1}put(T,E,g){this._hitLimit||(this._data+=(0,d.utf32ToString)(T,E,g),this._data.length>p.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}unhook(T){let E=!1;if(this._hitLimit)E=!1;else if(T&&(E=this._handler(this._data,this._params),E instanceof Promise))return E.then((g=>(this._params=C,this._data="",this._hitLimit=!1,g)));return this._params=C,this._data="",this._hitLimit=!1,E}}},2015:(_,c,h)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.EscapeSequenceParser=c.VT500_TRANSITION_TABLE=c.TransitionTable=void 0;const d=h(844),y=h(8742),p=h(6242),w=h(6351);class C{constructor(v){this.table=new Uint8Array(v)}setDefault(v,m){this.table.fill(v<<4|m)}add(v,m,S,k){this.table[m<<8|v]=S<<4|k}addMany(v,m,S,k){for(let L=0;L<v.length;L++)this.table[m<<8|v[L]]=S<<4|k}}c.TransitionTable=C;const T=160;c.VT500_TRANSITION_TABLE=(function(){const g=new C(4095),v=Array.apply(null,Array(256)).map(((M,A)=>A)),m=(M,A)=>v.slice(M,A),S=m(32,127),k=m(0,24);k.push(25),k.push.apply(k,m(28,32));const L=m(0,14);let R;for(R in g.setDefault(1,0),g.addMany(S,0,2,0),L)g.addMany([24,26,153,154],R,3,0),g.addMany(m(128,144),R,3,0),g.addMany(m(144,152),R,3,0),g.add(156,R,0,0),g.add(27,R,11,1),g.add(157,R,4,8),g.addMany([152,158,159],R,0,7),g.add(155,R,11,3),g.add(144,R,11,9);return g.addMany(k,0,3,0),g.addMany(k,1,3,1),g.add(127,1,0,1),g.addMany(k,8,0,8),g.addMany(k,3,3,3),g.add(127,3,0,3),g.addMany(k,4,3,4),g.add(127,4,0,4),g.addMany(k,6,3,6),g.addMany(k,5,3,5),g.add(127,5,0,5),g.addMany(k,2,3,2),g.add(127,2,0,2),g.add(93,1,4,8),g.addMany(S,8,5,8),g.add(127,8,5,8),g.addMany([156,27,24,26,7],8,6,0),g.addMany(m(28,32),8,0,8),g.addMany([88,94,95],1,0,7),g.addMany(S,7,0,7),g.addMany(k,7,0,7),g.add(156,7,0,0),g.add(127,7,0,7),g.add(91,1,11,3),g.addMany(m(64,127),3,7,0),g.addMany(m(48,60),3,8,4),g.addMany([60,61,62,63],3,9,4),g.addMany(m(48,60),4,8,4),g.addMany(m(64,127),4,7,0),g.addMany([60,61,62,63],4,0,6),g.addMany(m(32,64),6,0,6),g.add(127,6,0,6),g.addMany(m(64,127),6,0,0),g.addMany(m(32,48),3,9,5),g.addMany(m(32,48),5,9,5),g.addMany(m(48,64),5,0,6),g.addMany(m(64,127),5,7,0),g.addMany(m(32,48),4,9,5),g.addMany(m(32,48),1,9,2),g.addMany(m(32,48),2,9,2),g.addMany(m(48,127),2,10,0),g.addMany(m(48,80),1,10,0),g.addMany(m(81,88),1,10,0),g.addMany([89,90,92],1,10,0),g.addMany(m(96,127),1,10,0),g.add(80,1,11,9),g.addMany(k,9,0,9),g.add(127,9,0,9),g.addMany(m(28,32),9,0,9),g.addMany(m(32,48),9,9,12),g.addMany(m(48,60),9,8,10),g.addMany([60,61,62,63],9,9,10),g.addMany(k,11,0,11),g.addMany(m(32,128),11,0,11),g.addMany(m(28,32),11,0,11),g.addMany(k,10,0,10),g.add(127,10,0,10),g.addMany(m(28,32),10,0,10),g.addMany(m(48,60),10,8,10),g.addMany([60,61,62,63],10,0,11),g.addMany(m(32,48),10,9,12),g.addMany(k,12,0,12),g.add(127,12,0,12),g.addMany(m(28,32),12,0,12),g.addMany(m(32,48),12,9,12),g.addMany(m(48,64),12,0,11),g.addMany(m(64,127),12,12,13),g.addMany(m(64,127),10,12,13),g.addMany(m(64,127),9,12,13),g.addMany(k,13,13,13),g.addMany(S,13,13,13),g.add(127,13,0,13),g.addMany([27,156,24,26],13,14,0),g.add(T,0,2,0),g.add(T,8,5,8),g.add(T,6,0,6),g.add(T,11,0,11),g.add(T,13,13,13),g})();class E extends d.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=(m,S,k)=>{},this._executeHandlerFb=m=>{},this._csiHandlerFb=(m,S)=>{},this._escHandlerFb=m=>{},this._errorHandlerFb=m=>m,this._printHandler=this._printHandlerFb,this._executeHandlers=Object.create(null),this._csiHandlers=Object.create(null),this._escHandlers=Object.create(null),this.register((0,d.toDisposable)((()=>{this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null)}))),this._oscParser=this.register(new p.OscParser),this._dcsParser=this.register(new w.DcsParser),this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:"\\"},(()=>!0))}_identifier(v,m=[64,126]){let S=0;if(v.prefix){if(v.prefix.length>1)throw new Error("only one byte as prefix supported");if(S=v.prefix.charCodeAt(0),S&&60>S||S>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");S<<=8,S|=R}}if(v.final.length!==1)throw new Error("final must be a single byte");const k=v.final.charCodeAt(0);if(m[0]>k||k>m[1])throw new Error(`final must be in range ${m[0]} .. ${m[1]}`);return S<<=8,S|=k,S}identToString(v){const m=[];for(;v;)m.push(String.fromCharCode(255&v)),v>>=8;return m.reverse().join("")}setPrintHandler(v){this._printHandler=v}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(v,m){const S=this._identifier(v,[48,126]);this._escHandlers[S]===void 0&&(this._escHandlers[S]=[]);const k=this._escHandlers[S];return k.push(m),{dispose:()=>{const L=k.indexOf(m);L!==-1&&k.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,m){this._executeHandlers[v.charCodeAt(0)]=m}clearExecuteHandler(v){this._executeHandlers[v.charCodeAt(0)]&&delete this._executeHandlers[v.charCodeAt(0)]}setExecuteHandlerFallback(v){this._executeHandlerFb=v}registerCsiHandler(v,m){const S=this._identifier(v);this._csiHandlers[S]===void 0&&(this._csiHandlers[S]=[]);const k=this._csiHandlers[S];return k.push(m),{dispose:()=>{const L=k.indexOf(m);L!==-1&&k.splice(L,1)}}}clearCsiHandler(v){this._csiHandlers[this._identifier(v)]&&delete this._csiHandlers[this._identifier(v)]}setCsiHandlerFallback(v){this._csiHandlerFb=v}registerDcsHandler(v,m){return this._dcsParser.registerHandler(this._identifier(v),m)}clearDcsHandler(v){this._dcsParser.clearHandler(this._identifier(v))}setDcsHandlerFallback(v){this._dcsParser.setHandlerFallback(v)}registerOscHandler(v,m){return this._oscParser.registerHandler(v,m)}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,m,S,k,L){this._parseStack.state=v,this._parseStack.handlers=m,this._parseStack.handlerPos=S,this._parseStack.transition=k,this._parseStack.chunkPos=L}parse(v,m,S){let k,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(S===void 0||this._parseStack.state===1)throw this._parseStack.state=1,new Error("improper continuation due to previous async handler, giving up parsing");const A=this._parseStack.handlers;let B=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(S===!1&&B>-1){for(;B>=0&&(k=A[B](this._params),k!==!0);B--)if(k instanceof Promise)return this._parseStack.handlerPos=B,k}this._parseStack.handlers=[];break;case 4:if(S===!1&&B>-1){for(;B>=0&&(k=A[B](),k!==!0);B--)if(k instanceof Promise)return this._parseStack.handlerPos=B,k}this._parseStack.handlers=[];break;case 6:if(L=v[this._parseStack.chunkPos],k=this._dcsParser.unhook(L!==24&&L!==26,S),k)return k;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],k=this._oscParser.end(L!==24&&L!==26,S),k)return k;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 A=M;A<m;++A){switch(L=v[A],R=this._transitions.table[this.currentState<<8|(L<160?L:T)],R>>4){case 2:for(let I=A+1;;++I){if(I>=m||(L=v[I])<32||L>126&&L<T){this._printHandler(v,A,I),A=I-1;break}if(++I>=m||(L=v[I])<32||L>126&&L<T){this._printHandler(v,A,I),A=I-1;break}if(++I>=m||(L=v[I])<32||L>126&&L<T){this._printHandler(v,A,I),A=I-1;break}if(++I>=m||(L=v[I])<32||L>126&&L<T){this._printHandler(v,A,I),A=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:A,code:L,currentState:this.currentState,collect:this._collect,params:this._params,abort:!1}).abort)return;break;case 7:const B=this._csiHandlers[this._collect<<8|L];let K=B?B.length-1:-1;for(;K>=0&&(k=B[K](this._params),k!==!0);K--)if(k instanceof Promise)return this._preserveStack(3,B,K,R,A),k;K<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(++A<m&&(L=v[A])>47&&L<60);A--;break;case 9:this._collect<<=8,this._collect|=L;break;case 10:const F=this._escHandlers[this._collect<<8|L];let W=F?F.length-1:-1;for(;W>=0&&(k=F[W](),k!==!0);W--)if(k instanceof Promise)return this._preserveStack(4,F,W,R,A),k;W<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=A+1;;++I)if(I>=m||(L=v[I])===24||L===26||L===27||L>127&&L<T){this._dcsParser.put(v,A,I),A=I-1;break}break;case 14:if(k=this._dcsParser.unhook(L!==24&&L!==26),k)return this._preserveStack(6,[],0,R,A),k;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=A+1;;I++)if(I>=m||(L=v[I])<32||L>127&&L<T){this._oscParser.put(v,A,I),A=I-1;break}break;case 6:if(k=this._oscParser.end(L!==24&&L!==26),k)return this._preserveStack(5,[],0,R,A),k;L===27&&(R|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0}this.currentState=15&R}}}c.EscapeSequenceParser=E},6242:(_,c,h)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.OscHandler=c.OscParser=void 0;const d=h(5770),y=h(482),p=[];c.OscParser=class{constructor(){this._state=0,this._active=p,this._id=-1,this._handlers=Object.create(null),this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}registerHandler(w,C){this._handlers[w]===void 0&&(this._handlers[w]=[]);const T=this._handlers[w];return T.push(C),{dispose:()=>{const E=T.indexOf(C);E!==-1&&T.splice(E,1)}}}clearHandler(w){this._handlers[w]&&delete this._handlers[w]}setHandlerFallback(w){this._handlerFb=w}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=p}reset(){if(this._state===2)for(let w=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;w>=0;--w)this._active[w].end(!1);this._stack.paused=!1,this._active=p,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||p,this._active.length)for(let w=this._active.length-1;w>=0;w--)this._active[w].start();else this._handlerFb(this._id,"START")}_put(w,C,T){if(this._active.length)for(let E=this._active.length-1;E>=0;E--)this._active[E].put(w,C,T);else this._handlerFb(this._id,"PUT",(0,y.utf32ToString)(w,C,T))}start(){this.reset(),this._state=1}put(w,C,T){if(this._state!==3){if(this._state===1)for(;C<T;){const E=w[C++];if(E===59){this._state=2,this._start();break}if(E<48||57<E)return void(this._state=3);this._id===-1&&(this._id=0),this._id=10*this._id+E-48}this._state===2&&T-C>0&&this._put(w,C,T)}}end(w,C=!0){if(this._state!==0){if(this._state!==3)if(this._state===1&&this._start(),this._active.length){let T=!1,E=this._active.length-1,g=!1;if(this._stack.paused&&(E=this._stack.loopPosition-1,T=C,g=this._stack.fallThrough,this._stack.paused=!1),!g&&T===!1){for(;E>=0&&(T=this._active[E].end(w),T!==!0);E--)if(T instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=E,this._stack.fallThrough=!1,T;E--}for(;E>=0;E--)if(T=this._active[E].end(!1),T instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=E,this._stack.fallThrough=!0,T}else this._handlerFb(this._id,"END",w);this._active=p,this._id=-1,this._state=0}}},c.OscHandler=class{constructor(w){this._handler=w,this._data="",this._hitLimit=!1}start(){this._data="",this._hitLimit=!1}put(w,C,T){this._hitLimit||(this._data+=(0,y.utf32ToString)(w,C,T),this._data.length>d.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}end(w){let C=!1;if(this._hitLimit)C=!1;else if(w&&(C=this._handler(this._data),C instanceof Promise))return C.then((T=>(this._data="",this._hitLimit=!1,T)));return this._data="",this._hitLimit=!1,C}}},8742:(_,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.Params=void 0;const h=2147483647;class d{static fromArray(p){const w=new d;if(!p.length)return w;for(let C=Array.isArray(p[0])?1:0;C<p.length;++C){const T=p[C];if(Array.isArray(T))for(let E=0;E<T.length;++E)w.addSubParam(T[E]);else w.addParam(T)}return w}constructor(p=32,w=32){if(this.maxLength=p,this.maxSubParamsLength=w,w>256)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(p),this.length=0,this._subParams=new Int32Array(w),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(p),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}clone(){const p=new d(this.maxLength,this.maxSubParamsLength);return p.params.set(this.params),p.length=this.length,p._subParams.set(this._subParams),p._subParamsLength=this._subParamsLength,p._subParamsIdx.set(this._subParamsIdx),p._rejectDigits=this._rejectDigits,p._rejectSubDigits=this._rejectSubDigits,p._digitIsSub=this._digitIsSub,p}toArray(){const p=[];for(let w=0;w<this.length;++w){p.push(this.params[w]);const C=this._subParamsIdx[w]>>8,T=255&this._subParamsIdx[w];T-C>0&&p.push(Array.prototype.slice.call(this._subParams,C,T))}return p}reset(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}addParam(p){if(this._digitIsSub=!1,this.length>=this.maxLength)this._rejectDigits=!0;else{if(p<-1)throw new Error("values lesser than -1 are not allowed");this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=p>h?h:p}}addSubParam(p){if(this._digitIsSub=!0,this.length)if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength)this._rejectSubDigits=!0;else{if(p<-1)throw new Error("values lesser than -1 are not allowed");this._subParams[this._subParamsLength++]=p>h?h:p,this._subParamsIdx[this.length-1]++}}hasSubParams(p){return(255&this._subParamsIdx[p])-(this._subParamsIdx[p]>>8)>0}getSubParams(p){const w=this._subParamsIdx[p]>>8,C=255&this._subParamsIdx[p];return C-w>0?this._subParams.subarray(w,C):null}getSubParamsAll(){const p={};for(let w=0;w<this.length;++w){const C=this._subParamsIdx[w]>>8,T=255&this._subParamsIdx[w];T-C>0&&(p[w]=this._subParams.slice(C,T))}return p}addDigit(p){let w;if(this._rejectDigits||!(w=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;const C=this._digitIsSub?this._subParams:this.params,T=C[w-1];C[w-1]=~T?Math.min(10*T+p,h):p}}c.Params=d},5741:(_,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.AddonManager=void 0,c.AddonManager=class{constructor(){this._addons=[]}dispose(){for(let h=this._addons.length-1;h>=0;h--)this._addons[h].instance.dispose()}loadAddon(h,d){const y={instance:d,dispose:d.dispose,isDisposed:!1};this._addons.push(y),d.dispose=()=>this._wrappedAddonDispose(y),d.activate(h)}_wrappedAddonDispose(h){if(h.isDisposed)return;let d=-1;for(let y=0;y<this._addons.length;y++)if(this._addons[y]===h){d=y;break}if(d===-1)throw new Error("Could not dispose an addon that has not been loaded");h.isDisposed=!0,h.dispose.apply(h.instance),this._addons.splice(d,1)}}},8771:(_,c,h)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.BufferApiView=void 0;const d=h(3785),y=h(511);c.BufferApiView=class{constructor(p,w){this._buffer=p,this.type=w}init(p){return this._buffer=p,this}get cursorY(){return this._buffer.y}get cursorX(){return this._buffer.x}get viewportY(){return this._buffer.ydisp}get baseY(){return this._buffer.ybase}get length(){return this._buffer.lines.length}getLine(p){const w=this._buffer.lines.get(p);if(w)return new d.BufferLineApiView(w)}getNullCell(){return new y.CellData}}},3785:(_,c,h)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.BufferLineApiView=void 0;const d=h(511);c.BufferLineApiView=class{constructor(y){this._line=y}get isWrapped(){return this._line.isWrapped}get length(){return this._line.length}getCell(y,p){if(!(y<0||y>=this._line.length))return p?(this._line.loadCell(y,p),p):this._line.loadCell(y,new d.CellData)}translateToString(y,p,w){return this._line.translateToString(y,p,w)}}},8285:(_,c,h)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.BufferNamespaceApi=void 0;const d=h(8771),y=h(8460),p=h(844);class w extends p.Disposable{constructor(T){super(),this._core=T,this._onBufferChange=this.register(new y.EventEmitter),this.onBufferChange=this._onBufferChange.event,this._normal=new d.BufferApiView(this._core.buffers.normal,"normal"),this._alternate=new d.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=w},7975:(_,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.ParserApi=void 0,c.ParserApi=class{constructor(h){this._core=h}registerCsiHandler(h,d){return this._core.registerCsiHandler(h,(y=>d(y.toArray())))}addCsiHandler(h,d){return this.registerCsiHandler(h,d)}registerDcsHandler(h,d){return this._core.registerDcsHandler(h,((y,p)=>d(y,p.toArray())))}addDcsHandler(h,d){return this.registerDcsHandler(h,d)}registerEscHandler(h,d){return this._core.registerEscHandler(h,d)}addEscHandler(h,d){return this.registerEscHandler(h,d)}registerOscHandler(h,d){return this._core.registerOscHandler(h,d)}addOscHandler(h,d){return this.registerOscHandler(h,d)}}},7090:(_,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.UnicodeApi=void 0,c.UnicodeApi=class{constructor(h){this._core=h}register(h){this._core.unicodeService.register(h)}get versions(){return this._core.unicodeService.versions}get activeVersion(){return this._core.unicodeService.activeVersion}set activeVersion(h){this._core.unicodeService.activeVersion=h}}},744:function(_,c,h){var d=this&&this.__decorate||function(g,v,m,S){var k,L=arguments.length,R=L<3?v:S===null?S=Object.getOwnPropertyDescriptor(v,m):S;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")R=Reflect.decorate(g,v,m,S);else for(var M=g.length-1;M>=0;M--)(k=g[M])&&(R=(L<3?k(R):L>3?k(v,m,R):k(v,m))||R);return L>3&&R&&Object.defineProperty(v,m,R),R},y=this&&this.__param||function(g,v){return function(m,S){v(m,S,g)}};Object.defineProperty(c,"__esModule",{value:!0}),c.BufferService=c.MINIMUM_ROWS=c.MINIMUM_COLS=void 0;const p=h(8460),w=h(844),C=h(5295),T=h(2585);c.MINIMUM_COLS=2,c.MINIMUM_ROWS=1;let E=c.BufferService=class extends w.Disposable{get buffer(){return this.buffers.active}constructor(g){super(),this.isUserScrolling=!1,this._onResize=this.register(new p.EventEmitter),this.onResize=this._onResize.event,this._onScroll=this.register(new p.EventEmitter),this.onScroll=this._onScroll.event,this.cols=Math.max(g.rawOptions.cols||0,c.MINIMUM_COLS),this.rows=Math.max(g.rawOptions.rows||0,c.MINIMUM_ROWS),this.buffers=this.register(new C.BufferSet(g,this))}resize(g,v){this.cols=g,this.rows=v,this.buffers.resize(g,v),this._onResize.fire({cols:g,rows:v})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(g,v=!1){const m=this.buffer;let S;S=this._cachedBlankLine,S&&S.length===this.cols&&S.getFg(0)===g.fg&&S.getBg(0)===g.bg||(S=m.getBlankLine(g,v),this._cachedBlankLine=S),S.isWrapped=v;const k=m.ybase+m.scrollTop,L=m.ybase+m.scrollBottom;if(m.scrollTop===0){const R=m.lines.isFull;L===m.lines.length-1?R?m.lines.recycle().copyFrom(S):m.lines.push(S.clone()):m.lines.splice(L+1,0,S.clone()),R?this.isUserScrolling&&(m.ydisp=Math.max(m.ydisp-1,0)):(m.ybase++,this.isUserScrolling||m.ydisp++)}else{const R=L-k+1;m.lines.shiftElements(k+1,R-1,-1),m.lines.set(L,S.clone())}this.isUserScrolling||(m.ydisp=m.ybase),this._onScroll.fire(m.ydisp)}scrollLines(g,v,m){const S=this.buffer;if(g<0){if(S.ydisp===0)return;this.isUserScrolling=!0}else g+S.ydisp>=S.ybase&&(this.isUserScrolling=!1);const k=S.ydisp;S.ydisp=Math.max(Math.min(S.ydisp+g,S.ybase),0),k!==S.ydisp&&(v||this._onScroll.fire(S.ydisp))}};c.BufferService=E=d([y(0,T.IOptionsService)],E)},7994:(_,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(h){this.glevel=h,this.charset=this._charsets[h]}setgCharset(h,d){this._charsets[h]=d,this.glevel===h&&(this.charset=d)}}},1753:function(_,c,h){var d=this&&this.__decorate||function(S,k,L,R){var M,A=arguments.length,B=A<3?k:R===null?R=Object.getOwnPropertyDescriptor(k,L):R;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")B=Reflect.decorate(S,k,L,R);else for(var K=S.length-1;K>=0;K--)(M=S[K])&&(B=(A<3?M(B):A>3?M(k,L,B):M(k,L))||B);return A>3&&B&&Object.defineProperty(k,L,B),B},y=this&&this.__param||function(S,k){return function(L,R){k(L,R,S)}};Object.defineProperty(c,"__esModule",{value:!0}),c.CoreMouseService=void 0;const p=h(2585),w=h(8460),C=h(844),T={NONE:{events:0,restrict:()=>!1},X10:{events:1,restrict:S=>S.button!==4&&S.action===1&&(S.ctrl=!1,S.alt=!1,S.shift=!1,!0)},VT200:{events:19,restrict:S=>S.action!==32},DRAG:{events:23,restrict:S=>S.action!==32||S.button!==3},ANY:{events:31,restrict:S=>!0}};function E(S,k){let L=(S.ctrl?16:0)|(S.shift?4:0)|(S.alt?8:0);return S.button===4?(L|=64,L|=S.action):(L|=3&S.button,4&S.button&&(L|=64),8&S.button&&(L|=128),S.action===32?L|=32:S.action!==0||k||(L|=3)),L}const g=String.fromCharCode,v={DEFAULT:S=>{const k=[E(S,!1)+32,S.col+32,S.row+32];return k[0]>255||k[1]>255||k[2]>255?"":`\x1B[M${g(k[0])}${g(k[1])}${g(k[2])}`},SGR:S=>{const k=S.action===0&&S.button!==4?"m":"M";return`\x1B[<${E(S,!0)};${S.col};${S.row}${k}`},SGR_PIXELS:S=>{const k=S.action===0&&S.button!==4?"m":"M";return`\x1B[<${E(S,!0)};${S.x};${S.y}${k}`}};let m=c.CoreMouseService=class extends C.Disposable{constructor(S,k){super(),this._bufferService=S,this._coreService=k,this._protocols={},this._encodings={},this._activeProtocol="",this._activeEncoding="",this._lastEvent=null,this._onProtocolChange=this.register(new w.EventEmitter),this.onProtocolChange=this._onProtocolChange.event;for(const L of Object.keys(T))this.addProtocol(L,T[L]);for(const L of Object.keys(v))this.addEncoding(L,v[L]);this.reset()}addProtocol(S,k){this._protocols[S]=k}addEncoding(S,k){this._encodings[S]=k}get activeProtocol(){return this._activeProtocol}get areMouseEventsActive(){return this._protocols[this._activeProtocol].events!==0}set activeProtocol(S){if(!this._protocols[S])throw new Error(`unknown protocol "${S}"`);this._activeProtocol=S,this._onProtocolChange.fire(this._protocols[S].events)}get activeEncoding(){return this._activeEncoding}set activeEncoding(S){if(!this._encodings[S])throw new Error(`unknown encoding "${S}"`);this._activeEncoding=S}reset(){this.activeProtocol="NONE",this.activeEncoding="DEFAULT",this._lastEvent=null}triggerMouseEvent(S){if(S.col<0||S.col>=this._bufferService.cols||S.row<0||S.row>=this._bufferService.rows||S.button===4&&S.action===32||S.button===3&&S.action!==32||S.button!==4&&(S.action===2||S.action===3)||(S.col++,S.row++,S.action===32&&this._lastEvent&&this._equalEvents(this._lastEvent,S,this._activeEncoding==="SGR_PIXELS"))||!this._protocols[this._activeProtocol].restrict(S))return!1;const k=this._encodings[this._activeEncoding](S);return k&&(this._activeEncoding==="DEFAULT"?this._coreService.triggerBinaryEvent(k):this._coreService.triggerDataEvent(k,!0)),this._lastEvent=S,!0}explainEvents(S){return{down:!!(1&S),up:!!(2&S),drag:!!(4&S),move:!!(8&S),wheel:!!(16&S)}}_equalEvents(S,k,L){if(L){if(S.x!==k.x||S.y!==k.y)return!1}else if(S.col!==k.col||S.row!==k.row)return!1;return S.button===k.button&&S.action===k.action&&S.ctrl===k.ctrl&&S.alt===k.alt&&S.shift===k.shift}};c.CoreMouseService=m=d([y(0,p.IBufferService),y(1,p.ICoreService)],m)},6975:function(_,c,h){var d=this&&this.__decorate||function(m,S,k,L){var R,M=arguments.length,A=M<3?S:L===null?L=Object.getOwnPropertyDescriptor(S,k):L;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")A=Reflect.decorate(m,S,k,L);else for(var B=m.length-1;B>=0;B--)(R=m[B])&&(A=(M<3?R(A):M>3?R(S,k,A):R(S,k))||A);return M>3&&A&&Object.defineProperty(S,k,A),A},y=this&&this.__param||function(m,S){return function(k,L){S(k,L,m)}};Object.defineProperty(c,"__esModule",{value:!0}),c.CoreService=void 0;const p=h(1439),w=h(8460),C=h(844),T=h(2585),E=Object.freeze({insertMode:!1}),g=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,origin:!1,reverseWraparound:!1,sendFocus:!1,wraparound:!0});let v=c.CoreService=class extends C.Disposable{constructor(m,S,k){super(),this._bufferService=m,this._logService=S,this._optionsService=k,this.isCursorInitialized=!1,this.isCursorHidden=!1,this._onData=this.register(new w.EventEmitter),this.onData=this._onData.event,this._onUserInput=this.register(new w.EventEmitter),this.onUserInput=this._onUserInput.event,this._onBinary=this.register(new w.EventEmitter),this.onBinary=this._onBinary.event,this._onRequestScrollToBottom=this.register(new w.EventEmitter),this.onRequestScrollToBottom=this._onRequestScrollToBottom.event,this.modes=(0,p.clone)(E),this.decPrivateModes=(0,p.clone)(g)}reset(){this.modes=(0,p.clone)(E),this.decPrivateModes=(0,p.clone)(g)}triggerDataEvent(m,S=!1){if(this._optionsService.rawOptions.disableStdin)return;const k=this._bufferService.buffer;S&&this._optionsService.rawOptions.scrollOnUserInput&&k.ybase!==k.ydisp&&this._onRequestScrollToBottom.fire(),S&&this._onUserInput.fire(),this._logService.debug(`sending data "${m}"`,(()=>m.split("").map((L=>L.charCodeAt(0))))),this._onData.fire(m)}triggerBinaryEvent(m){this._optionsService.rawOptions.disableStdin||(this._logService.debug(`sending binary "${m}"`,(()=>m.split("").map((S=>S.charCodeAt(0))))),this._onBinary.fire(m))}};c.CoreService=v=d([y(0,T.IBufferService),y(1,T.ILogService),y(2,T.IOptionsService)],v)},9074:(_,c,h)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.DecorationService=void 0;const d=h(8055),y=h(8460),p=h(844),w=h(6106);let C=0,T=0;class E extends p.Disposable{get decorations(){return this._decorations.values()}constructor(){super(),this._decorations=new w.SortedList((m=>m?.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,p.toDisposable)((()=>this.reset())))}registerDecoration(m){if(m.marker.isDisposed)return;const S=new g(m);if(S){const k=S.marker.onDispose((()=>S.dispose()));S.onDispose((()=>{S&&(this._decorations.delete(S)&&this._onDecorationRemoved.fire(S),k.dispose())})),this._decorations.insert(S),this._onDecorationRegistered.fire(S)}return S}reset(){for(const m of this._decorations.values())m.dispose();this._decorations.clear()}*getDecorationsAtCell(m,S,k){let L=0,R=0;for(const M of this._decorations.getKeyIterator(S))L=M.options.x??0,R=L+(M.options.width??1),m>=L&&m<R&&(!k||(M.options.layer??"bottom")===k)&&(yield M)}forEachDecorationAtCell(m,S,k,L){this._decorations.forEachByKey(S,(R=>{C=R.options.x??0,T=C+(R.options.width??1),m>=C&&m<T&&(!k||(R.options.layer??"bottom")===k)&&L(R)}))}}c.DecorationService=E;class g extends p.Disposable{get isDisposed(){return this._isDisposed}get backgroundColorRGB(){return this._cachedBg===null&&(this.options.backgroundColor?this._cachedBg=d.css.toColor(this.options.backgroundColor):this._cachedBg=void 0),this._cachedBg}get foregroundColorRGB(){return this._cachedFg===null&&(this.options.foregroundColor?this._cachedFg=d.css.toColor(this.options.foregroundColor):this._cachedFg=void 0),this._cachedFg}constructor(m){super(),this.options=m,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=m.marker,this.options.overviewRulerOptions&&!this.options.overviewRulerOptions.position&&(this.options.overviewRulerOptions.position="full")}dispose(){this._onDispose.fire(),super.dispose()}}},4348:(_,c,h)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.InstantiationService=c.ServiceCollection=void 0;const d=h(2585),y=h(8343);class p{constructor(...C){this._entries=new Map;for(const[T,E]of C)this.set(T,E)}set(C,T){const E=this._entries.get(C);return this._entries.set(C,T),E}forEach(C){for(const[T,E]of this._entries.entries())C(T,E)}has(C){return this._entries.has(C)}get(C){return this._entries.get(C)}}c.ServiceCollection=p,c.InstantiationService=class{constructor(){this._services=new p,this._services.set(d.IInstantiationService,this)}setService(w,C){this._services.set(w,C)}getService(w){return this._services.get(w)}createInstance(w,...C){const T=(0,y.getServiceDependencies)(w).sort(((v,m)=>v.index-m.index)),E=[];for(const v of T){const m=this._services.get(v.id);if(!m)throw new Error(`[createInstance] ${w.name} depends on UNKNOWN service ${v.id}.`);E.push(m)}const g=T.length>0?T[0].index:C.length;if(C.length!==g)throw new Error(`[createInstance] First service dependency of ${w.name} at position ${g+1} conflicts with ${C.length} static arguments`);return new w(...C,...E)}}},7866:function(_,c,h){var d=this&&this.__decorate||function(g,v,m,S){var k,L=arguments.length,R=L<3?v:S===null?S=Object.getOwnPropertyDescriptor(v,m):S;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")R=Reflect.decorate(g,v,m,S);else for(var M=g.length-1;M>=0;M--)(k=g[M])&&(R=(L<3?k(R):L>3?k(v,m,R):k(v,m))||R);return L>3&&R&&Object.defineProperty(v,m,R),R},y=this&&this.__param||function(g,v){return function(m,S){v(m,S,g)}};Object.defineProperty(c,"__esModule",{value:!0}),c.traceCall=c.setTraceLogger=c.LogService=void 0;const p=h(844),w=h(2585),C={trace:w.LogLevelEnum.TRACE,debug:w.LogLevelEnum.DEBUG,info:w.LogLevelEnum.INFO,warn:w.LogLevelEnum.WARN,error:w.LogLevelEnum.ERROR,off:w.LogLevelEnum.OFF};let T,E=c.LogService=class extends p.Disposable{get logLevel(){return this._logLevel}constructor(g){super(),this._optionsService=g,this._logLevel=w.LogLevelEnum.OFF,this._updateLogLevel(),this.register(this._optionsService.onSpecificOptionChange("logLevel",(()=>this._updateLogLevel()))),T=this}_updateLogLevel(){this._logLevel=C[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(g){for(let v=0;v<g.length;v++)typeof g[v]=="function"&&(g[v]=g[v]())}_log(g,v,m){this._evalLazyOptionalParams(m),g.call(console,(this._optionsService.options.logger?"":"xterm.js: ")+v,...m)}trace(g,...v){this._logLevel<=w.LogLevelEnum.TRACE&&this._log(this._optionsService.options.logger?.trace.bind(this._optionsService.options.logger)??console.log,g,v)}debug(g,...v){this._logLevel<=w.LogLevelEnum.DEBUG&&this._log(this._optionsService.options.logger?.debug.bind(this._optionsService.options.logger)??console.log,g,v)}info(g,...v){this._logLevel<=w.LogLevelEnum.INFO&&this._log(this._optionsService.options.logger?.info.bind(this._optionsService.options.logger)??console.info,g,v)}warn(g,...v){this._logLevel<=w.LogLevelEnum.WARN&&this._log(this._optionsService.options.logger?.warn.bind(this._optionsService.options.logger)??console.warn,g,v)}error(g,...v){this._logLevel<=w.LogLevelEnum.ERROR&&this._log(this._optionsService.options.logger?.error.bind(this._optionsService.options.logger)??console.error,g,v)}};c.LogService=E=d([y(0,w.IOptionsService)],E),c.setTraceLogger=function(g){T=g},c.traceCall=function(g,v,m){if(typeof m.value!="function")throw new Error("not supported");const S=m.value;m.value=function(...k){if(T.logLevel!==w.LogLevelEnum.TRACE)return S.apply(this,k);T.trace(`GlyphRenderer#${S.name}(${k.map((R=>JSON.stringify(R))).join(", ")})`);const L=S.apply(this,k);return T.trace(`GlyphRenderer#${S.name} return`,L),L}}},7302:(_,c,h)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.OptionsService=c.DEFAULT_OPTIONS=void 0;const d=h(8460),y=h(844),p=h(6114);c.DEFAULT_OPTIONS={cols:80,rows:24,cursorBlink:!1,cursorStyle:"block",cursorWidth:1,cursorInactiveStyle:"outline",customGlyphs:!0,drawBoldTextInBrightColors:!0,documentOverride:null,fastScrollModifier:"alt",fastScrollSensitivity:5,fontFamily:"courier-new, courier, monospace",fontSize:15,fontWeight:"normal",fontWeightBold:"bold",ignoreBracketedPasteMode:!1,lineHeight:1,letterSpacing:0,linkHandler:null,logLevel:"info",logger:null,scrollback:1e3,scrollOnUserInput:!0,scrollSensitivity:1,screenReaderMode:!1,smoothScrollDuration:0,macOptionIsMeta:!1,macOptionClickForcesSelection:!1,minimumContrastRatio:1,disableStdin:!1,allowProposedApi:!1,allowTransparency:!1,tabStopWidth:8,theme:{},rescaleOverlappingGlyphs:!1,rightClickSelectsWord:p.isMac,windowOptions:{},windowsMode:!1,windowsPty:{},wordSeparator:" ()[]{}',\"`",altClickMovesCursor:!0,convertEol:!1,termName:"xterm",cancelEvents:!1,overviewRulerWidth:0};const w=["normal","bold","100","200","300","400","500","600","700","800","900"];class C extends y.Disposable{constructor(E){super(),this._onOptionChange=this.register(new d.EventEmitter),this.onOptionChange=this._onOptionChange.event;const g={...c.DEFAULT_OPTIONS};for(const v in E)if(v in g)try{const m=E[v];g[v]=this._sanitizeAndValidateOption(v,m)}catch(m){console.error(m)}this.rawOptions=g,this.options={...g},this._setupOptions(),this.register((0,y.toDisposable)((()=>{this.rawOptions.linkHandler=null,this.rawOptions.documentOverride=null})))}onSpecificOptionChange(E,g){return this.onOptionChange((v=>{v===E&&g(this.rawOptions[E])}))}onMultipleOptionChange(E,g){return this.onOptionChange((v=>{E.indexOf(v)!==-1&&g()}))}_setupOptions(){const E=v=>{if(!(v in c.DEFAULT_OPTIONS))throw new Error(`No option with key "${v}"`);return this.rawOptions[v]},g=(v,m)=>{if(!(v in c.DEFAULT_OPTIONS))throw new Error(`No option with key "${v}"`);m=this._sanitizeAndValidateOption(v,m),this.rawOptions[v]!==m&&(this.rawOptions[v]=m,this._onOptionChange.fire(v))};for(const v in this.rawOptions){const m={get:E.bind(this,v),set:g.bind(this,v)};Object.defineProperty(this.options,v,m)}}_sanitizeAndValidateOption(E,g){switch(E){case"cursorStyle":if(g||(g=c.DEFAULT_OPTIONS[E]),!(function(v){return v==="block"||v==="underline"||v==="bar"})(g))throw new Error(`"${g}" is not a valid value for ${E}`);break;case"wordSeparator":g||(g=c.DEFAULT_OPTIONS[E]);break;case"fontWeight":case"fontWeightBold":if(typeof g=="number"&&1<=g&&g<=1e3)break;g=w.includes(g)?g:c.DEFAULT_OPTIONS[E];break;case"cursorWidth":g=Math.floor(g);case"lineHeight":case"tabStopWidth":if(g<1)throw new Error(`${E} cannot be less than 1, value: ${g}`);break;case"minimumContrastRatio":g=Math.max(1,Math.min(21,Math.round(10*g)/10));break;case"scrollback":if((g=Math.min(g,4294967295))<0)throw new Error(`${E} cannot be less than 0, value: ${g}`);break;case"fastScrollSensitivity":case"scrollSensitivity":if(g<=0)throw new Error(`${E} cannot be less than or equal to 0, value: ${g}`);break;case"rows":case"cols":if(!g&&g!==0)throw new Error(`${E} must be numeric, value: ${g}`);break;case"windowsPty":g=g??{}}return g}}c.OptionsService=C},2660:function(_,c,h){var d=this&&this.__decorate||function(C,T,E,g){var v,m=arguments.length,S=m<3?T:g===null?g=Object.getOwnPropertyDescriptor(T,E):g;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")S=Reflect.decorate(C,T,E,g);else for(var k=C.length-1;k>=0;k--)(v=C[k])&&(S=(m<3?v(S):m>3?v(T,E,S):v(T,E))||S);return m>3&&S&&Object.defineProperty(T,E,S),S},y=this&&this.__param||function(C,T){return function(E,g){T(E,g,C)}};Object.defineProperty(c,"__esModule",{value:!0}),c.OscLinkService=void 0;const p=h(2585);let w=c.OscLinkService=class{constructor(C){this._bufferService=C,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(C){const T=this._bufferService.buffer;if(C.id===void 0){const k=T.addMarker(T.ybase+T.y),L={data:C,id:this._nextId++,lines:[k]};return k.onDispose((()=>this._removeMarkerFromLink(L,k))),this._dataByLinkId.set(L.id,L),L.id}const E=C,g=this._getEntryIdKey(E),v=this._entriesWithId.get(g);if(v)return this.addLineToLink(v.id,T.ybase+T.y),v.id;const m=T.addMarker(T.ybase+T.y),S={id:this._nextId++,key:this._getEntryIdKey(E),data:E,lines:[m]};return m.onDispose((()=>this._removeMarkerFromLink(S,m))),this._entriesWithId.set(S.key,S),this._dataByLinkId.set(S.id,S),S.id}addLineToLink(C,T){const E=this._dataByLinkId.get(C);if(E&&E.lines.every((g=>g.line!==T))){const g=this._bufferService.buffer.addMarker(T);E.lines.push(g),g.onDispose((()=>this._removeMarkerFromLink(E,g)))}}getLinkData(C){return this._dataByLinkId.get(C)?.data}_getEntryIdKey(C){return`${C.id};;${C.uri}`}_removeMarkerFromLink(C,T){const E=C.lines.indexOf(T);E!==-1&&(C.lines.splice(E,1),C.lines.length===0&&(C.data.id!==void 0&&this._entriesWithId.delete(C.key),this._dataByLinkId.delete(C.id)))}};c.OscLinkService=w=d([y(0,p.IBufferService)],w)},8343:(_,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.createDecorator=c.getServiceDependencies=c.serviceRegistry=void 0;const h="di$target",d="di$dependencies";c.serviceRegistry=new Map,c.getServiceDependencies=function(y){return y[d]||[]},c.createDecorator=function(y){if(c.serviceRegistry.has(y))return c.serviceRegistry.get(y);const p=function(w,C,T){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");(function(E,g,v){g[h]===g?g[d].push({id:E,index:v}):(g[d]=[{id:E,index:v}],g[h]=g)})(p,w,T)};return p.toString=()=>y,c.serviceRegistry.set(y,p),p}},2585:(_,c,h)=>{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 d=h(8343);var y;c.IBufferService=(0,d.createDecorator)("BufferService"),c.ICoreMouseService=(0,d.createDecorator)("CoreMouseService"),c.ICoreService=(0,d.createDecorator)("CoreService"),c.ICharsetService=(0,d.createDecorator)("CharsetService"),c.IInstantiationService=(0,d.createDecorator)("InstantiationService"),(function(p){p[p.TRACE=0]="TRACE",p[p.DEBUG=1]="DEBUG",p[p.INFO=2]="INFO",p[p.WARN=3]="WARN",p[p.ERROR=4]="ERROR",p[p.OFF=5]="OFF"})(y||(c.LogLevelEnum=y={})),c.ILogService=(0,d.createDecorator)("LogService"),c.IOptionsService=(0,d.createDecorator)("OptionsService"),c.IOscLinkService=(0,d.createDecorator)("OscLinkService"),c.IUnicodeService=(0,d.createDecorator)("UnicodeService"),c.IDecorationService=(0,d.createDecorator)("DecorationService")},1480:(_,c,h)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.UnicodeService=void 0;const d=h(8460),y=h(225);class p{static extractShouldJoin(C){return(1&C)!=0}static extractWidth(C){return C>>1&3}static extractCharKind(C){return C>>3}static createPropertyValue(C,T,E=!1){return(16777215&C)<<3|(3&T)<<1|(E?1:0)}constructor(){this._providers=Object.create(null),this._active="",this._onChange=new d.EventEmitter,this.onChange=this._onChange.event;const C=new y.UnicodeV6;this.register(C),this._active=C.version,this._activeProvider=C}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(C){if(!this._providers[C])throw new Error(`unknown Unicode version "${C}"`);this._active=C,this._activeProvider=this._providers[C],this._onChange.fire(C)}register(C){this._providers[C.version]=C}wcwidth(C){return this._activeProvider.wcwidth(C)}getStringCellWidth(C){let T=0,E=0;const g=C.length;for(let v=0;v<g;++v){let m=C.charCodeAt(v);if(55296<=m&&m<=56319){if(++v>=g)return T+this.wcwidth(m);const L=C.charCodeAt(v);56320<=L&&L<=57343?m=1024*(m-55296)+L-56320+65536:T+=this.wcwidth(L)}const S=this.charProperties(m,E);let k=p.extractWidth(S);p.extractShouldJoin(S)&&(k-=p.extractWidth(E)),T+=k,E=S}return T}charProperties(C,T){return this._activeProvider.charProperties(C,T)}}c.UnicodeService=p}},s={};function o(_){var c=s[_];if(c!==void 0)return c.exports;var h=s[_]={exports:{}};return i[_].call(h.exports,h,h.exports,o),h.exports}var f={};return(()=>{var _=f;Object.defineProperty(_,"__esModule",{value:!0}),_.Terminal=void 0;const c=o(9042),h=o(3236),d=o(844),y=o(5741),p=o(8285),w=o(7975),C=o(7090),T=["cols","rows"];class E extends d.Disposable{constructor(v){super(),this._core=this.register(new h.Terminal(v)),this._addonManager=this.register(new y.AddonManager),this._publicOptions={...this._core.options};const m=k=>this._core.options[k],S=(k,L)=>{this._checkReadonlyOptions(k),this._core.options[k]=L};for(const k in this._core.options){const L={get:m.bind(this,k),set:S.bind(this,k)};Object.defineProperty(this._publicOptions,k,L)}}_checkReadonlyOptions(v){if(T.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 w.ParserApi(this._core)),this._parser}get unicode(){return this._checkProposedApi(),new C.UnicodeApi(this._core)}get textarea(){return this._core.textarea}get rows(){return this._core.rows}get cols(){return this._core.cols}get buffer(){return this._buffer||(this._buffer=this.register(new p.BufferNamespaceApi(this._core))),this._buffer}get markers(){return this._checkProposedApi(),this._core.markers}get modes(){const v=this._core.coreService.decPrivateModes;let m="none";switch(this._core.coreMouseService.activeProtocol){case"X10":m="x10";break;case"VT200":m="vt200";break;case"DRAG":m="drag";break;case"ANY":m="any"}return{applicationCursorKeysMode:v.applicationCursorKeys,applicationKeypadMode:v.applicationKeypad,bracketedPasteMode:v.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:m,originMode:v.origin,reverseWraparoundMode:v.reverseWraparound,sendFocusMode:v.sendFocus,wraparoundMode:v.wraparound}}get options(){return this._publicOptions}set options(v){for(const m in v)this._publicOptions[m]=v[m]}blur(){this._core.blur()}focus(){this._core.focus()}input(v,m=!0){this._core.input(v,m)}resize(v,m){this._verifyIntegers(v,m),this._core.resize(v,m)}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,m,S){this._verifyIntegers(v,m,S),this._core.select(v,m,S)}getSelection(){return this._core.getSelection()}getSelectionPosition(){return this._core.getSelectionPosition()}clearSelection(){this._core.clearSelection()}selectAll(){this._core.selectAll()}selectLines(v,m){this._verifyIntegers(v,m),this._core.selectLines(v,m)}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,m){this._core.write(v,m)}writeln(v,m){this._core.write(v),this._core.write(`\r
|
|
82
|
-
`,m)}paste(v){this._core.paste(v)}refresh(v,m){this._verifyIntegers(v,m),this._core.refresh(v,m)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(v){this._addonManager.loadAddon(this,v)}static get strings(){return c}_verifyIntegers(...v){for(const m of v)if(m===1/0||isNaN(m)||m%1!=0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...v){for(const m of v)if(m&&(m===1/0||isNaN(m)||m%1!=0||m<0))throw new Error("This API only accepts positive integers")}}_.Terminal=E})(),f})()))})(cp)),cp.exports}var CM=xM();function EM(e){let n=!1,i=!1,s=!1,o=!1,f=null,_=null;const c=()=>{f!==null&&(clearTimeout(f),f=null),s=!1},h=()=>{_!==null&&(clearTimeout(_),_=null),i=!1},d=()=>{h(),i=!0,_=setTimeout(()=>{_=null,i=!1},0)},y=()=>{s=!1,f!==null&&clearTimeout(f),_!==null&&(clearTimeout(_),_=null),f=setTimeout(()=>{f=null,i=!1,e()},0)},p=()=>{n=!1,f===null&&(h(),s=!1)},w=()=>{n=!1,o=!1,h(),c()},C=T=>{if(f===null){if(n||i||TM(T)){s=!0,i&&!n?y():n=!0;return}e()}};return{onCompositionStart(){n=!0},onCompositionEnd(){n=!1,d(),s&&y()},onCompositionCancel:p,handleKeyEvent(T){return kM(T)&&T.shiftKey?(T.preventDefault?.(),T.type==="keydown"?(o=!0,C(T)):T.type==="keypress"?(o||C(T),o=!1):T.type==="keyup"&&(o=!1),!1):!0},dispose:w}}function kM(e){return e.key==="Enter"||e.code==="Enter"||e.keyCode===13||e.which===13}function TM(e){return e.isComposing===!0||e.keyCode===229||e.which===229}const bm=14,fx=10,px=22,AM=128,RM=.5,LM="mmmmmmmmmmwwwwiIl1 0O-_|┌ABCxyz",MM=/[\x00-\x1F\x7F]/g,H1={min:fx,max:px},NM="cascadia",Th=[{id:"cascadia",name:"Cascadia Code",familyName:"Cascadia Code Variable",family:'"Cascadia Code Variable", ui-monospace, "SF Mono", Menlo, monospace',meta:"Variable · terminal tuned"},{id:"jetbrains",name:"JetBrains Mono",familyName:"JetBrains Mono Variable",family:'"JetBrains Mono Variable", ui-monospace, "SF Mono", Menlo, monospace',meta:"Variable · console mono"},{id:"fira-code",name:"Fira Code",familyName:"Fira Code Variable",family:'"Fira Code Variable", ui-monospace, "SF Mono", Menlo, monospace',meta:"Variable · ligatures"},{id:"source-code-pro",name:"Source Code Pro",familyName:"Source Code Pro Variable",family:'"Source Code Pro Variable", ui-monospace, "SF Mono", Menlo, monospace',meta:"Variable · Adobe mono"}],ia=Th[0];function sh(e){return Th.find(n=>n.id===e)??ia}function Yl(){return{source:"curated",id:NM,customName:"",family:ia.family,size:bm}}function ym(e,n){const i=sh(e);return{source:"curated",id:i.id,customName:"",family:i.family,size:xm(n)}}function Sm(e,n){const i=IM(e);return{source:"custom",id:null,customName:i,family:i?`"${_x(i)}", ${ia.family}`:ia.family,size:xm(n)}}function gx(e){if(typeof e!="object"||e===null||Array.isArray(e))return null;const n=e,i=xm(typeof n.size=="number"?n.size:bm);return n.source==="custom"&&typeof n.customName=="string"?Sm(n.customName,i):typeof n.id=="string"&&jM(n.id)?ym(n.id,i):null}function wm(e){if(!e)return Yl();try{const n=gx(JSON.parse(e));if(n!==null)return n}catch{}return Yl()}function OM(e){return JSON.stringify({source:e.source,id:e.id,customName:e.customName,size:e.size})}function xm(e){return Number.isFinite(e)?Math.min(px,Math.max(fx,Math.round(e))):bm}function mx(e){return e.source==="curated"?{status:"self-hosted",fallbackName:ia.name}:e.customName?{status:DM(e.customName)?"resolved":"fallback",fallbackName:ia.name}:{status:"fallback",fallbackName:ia.name}}function DM(e){if(typeof document>"u")return!1;const n=document.createElement("canvas").getContext("2d");if(!n)return!1;for(const i of["monospace","serif","sans-serif"]){const s=$1(n,`"${_x(e)}", ${i}`),o=$1(n,i);if(Math.abs(s-o)>RM)return!0}return!1}function $1(e,n){return e.font=`28px ${n}`,e.measureText(LM).width}function jM(e){return Th.some(n=>n.id===e)}function IM(e){return e.replace(MM,"").trim().slice(0,AM)}function _x(e){return e.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}const ah="fleet-plugin.terminal.renderer",co="fleet-plugin.terminal.font",U1="fleet-console.terminalRenderer",F1="fleet-console.terminalFont",dg=new Set;let Ts=BM(),Xl=null,ra=0;function BM(){return typeof window>"u"?{renderer:"webgl",font:Yl()}:(PM(),{renderer:FM(),font:WM()})}function PM(){if(!(typeof window>"u"))try{if(window.localStorage.getItem(ah)!==null||window.localStorage.getItem(co)!==null)return;const e=window.localStorage.getItem(U1),n=window.localStorage.getItem(F1),i=e==="webgl"||e==="dom"?e:"webgl",s=wm(n);window.localStorage.setItem(ah,i),window.localStorage.setItem(co,OM(s)),window.localStorage.removeItem(U1),window.localStorage.removeItem(F1)}catch{}}function zM(e){ra+=1,Xl=e,UM()}function vx(){return N.useSyncExternalStore(KM,q1,q1)}function HM(e){GM(e),mo({renderer:e})}function $M(e){const n=ym(e,Ts.font.size);ra+=1,mo({font:n}),Ah(n)}function W1(e){const n=Sm(e,Ts.font.size);ra+=1,mo({font:n}),Ah(n)}function G1(e){const n=Ts.font.source==="custom"?Sm(Ts.font.customName,e):ym(Ts.font.id,e);ra+=1,mo({font:n}),Ah(n)}async function UM(){if(!Xl)return;const e=ra;try{const n=await Xl.read("terminal");if(n!==null){const i=gx(n.font);if(i!==null){if(e!==ra)return;mo({font:i});try{window.localStorage.removeItem(co)}catch{}return}}if(typeof window<"u"){let i=null;try{i=window.localStorage.getItem(co)}catch{}if(i!==null){const s=wm(i);if(e!==ra)return;mo({font:s}),Ah(s);try{window.localStorage.removeItem(co)}catch{}}}}catch{}}async function Ah(e){if(Xl)try{await Xl.write("terminal",{font:{source:e.source,id:e.id,customName:e.customName,size:e.size}})}catch{}}function FM(){if(typeof window>"u")return"webgl";try{const e=window.localStorage.getItem(ah);return e==="webgl"||e==="dom"?e:"webgl"}catch{return"webgl"}}function WM(){if(typeof window>"u")return Yl();try{return wm(window.localStorage.getItem(co))}catch{return Yl()}}function GM(e){if(!(typeof window>"u"))try{window.localStorage.setItem(ah,e)}catch{}}function qM(){for(const e of dg)e()}function mo(e){Ts={...Ts,...e},qM()}function KM(e){return dg.add(e),()=>{dg.delete(e)}}function q1(){return Ts}const VM={allowProposedApi:!0,convertEol:!0,cursorBlink:!0,cursorStyle:"block",lineHeight:1.2},YM=80,XM=16,ZM=250,JM=1024*1024,QM=120,e6={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)"},t6={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 bx({operationId:e,ticketPath:n,wsPath:i,theme:s="maritime",onExit:o,active:f,zoom:_=1}){const c=s,{renderer:h,font:d}=vx(),y=N.useRef(null),p=N.useRef(null),w=N.useRef(null),C=N.useRef(null),T=N.useRef(null),E=N.useRef(null),[g,v]=N.useState(_),m=N.useRef(o);m.current=o;const S=N.useRef(f);S.current=f;const[k,L]=N.useState("connecting");N.useEffect(()=>{const A=y.current;if(!A)return;let B=!1;const K=new CM.Terminal({...VM,fontFamily:d.family,fontSize:d.size*g,theme:K1(c)});p.current=K;const F=new P3.FitAddon;E.current=F,K.loadAddon(F),K.open(A),K.loadAddon(new $3.Unicode11Addon),K.unicode.activeVersion="11";const W=EM(()=>K.input(`
|
|
83
|
-
`)),I=A.querySelector("textarea.xterm-helper-textarea, textarea")??A;I.addEventListener("compositionstart",W.onCompositionStart),I.addEventListener("compositionend",W.onCompositionEnd),I.addEventListener("focusout",W.onCompositionCancel),K.attachCustomKeyEventHandler(W.handleKeyEvent);const Z=i6(K,S.current!==!1);T.current=Z;const X=N3({operationId:e,ticketPath:n,wsPath:i,terminal:{onData:U=>K.onData(U),write:Z.write},onExit:()=>m.current?.(),onStatus:(U,G)=>{L(G?`${U}: ${G}`:U)}});w.current=X;let z=null;const q=()=>{F.fit(),X.resize(K.cols,K.rows)},V=()=>{q(),K.refresh(0,K.rows-1)},j=()=>{z&&clearTimeout(z),z=setTimeout(()=>{z=null,B||V()},YM)},P=async()=>{await document.fonts?.ready,!B&&(q(),X.start(),S.current!==!1&&K.focus())},D=new ResizeObserver(j);return D.observe(A),P(),()=>{B=!0,D.disconnect(),z&&clearTimeout(z),I.removeEventListener("compositionstart",W.onCompositionStart),I.removeEventListener("compositionend",W.onCompositionEnd),I.removeEventListener("focusout",W.onCompositionCancel),W.dispose(),X.dispose(),Z.dispose(),p.current=null,w.current=null,T.current=null,E.current=null;try{K.dispose()}catch{}}},[e,n,i]),N.useEffect(()=>{if(T.current?.setActive(f!==!1),!f)return;n6(p.current);const A=window.requestAnimationFrame(()=>{S.current===!0&&yx(p.current)});return()=>window.cancelAnimationFrame(A)},[f]),N.useEffect(()=>{const A=p.current;if(!A)return;let B=!1;if(h==="webgl")try{const K=new wM;C.current=K,K.onContextLoss(()=>{if(!B){try{K.dispose()}catch{}C.current===K&&(C.current=null)}}),A.loadAddon(K)}catch{try{C.current?.dispose()}catch{}C.current=null}return()=>{B=!0;const K=C.current;if(K){C.current=null;try{K.dispose()}catch{}}}},[h,e]),N.useEffect(()=>{const A=p.current;A&&(A.options.theme=K1(c))},[c]),N.useEffect(()=>{const A=p.current;A&&(A.options.fontFamily=d.family,V1(A,E.current,w.current))},[d.family]),N.useEffect(()=>{if(_===g)return;const A=setTimeout(()=>v(_),QM);return()=>clearTimeout(A)},[_,g]),N.useEffect(()=>{const A=p.current;A&&(A.options.fontSize=d.size*g,V1(A,E.current,w.current))},[g,d.size]);const R=k.startsWith("live"),M=g===1?void 0:{width:`${g*100}%`,height:`${g*100}%`,transform:`scale(${1/g})`,transformOrigin:"0 0"};return u.jsx("section",{className:"terminal-stage","aria-label":"Terminal",children:u.jsxs("div",{className:"terminal-shell",children:[R?null:u.jsxs("div",{className:"terminal-status","aria-live":"polite",children:[u.jsx("span",{className:"terminal-status-dot","aria-hidden":"true"}),k]}),u.jsx("div",{className:"terminal-viewport",children:u.jsx("div",{className:"terminal-canvas",ref:y,style:M})})]})})}function K1(e){return e==="carbon"?t6:e6}function n6(e){e&&(e.focus(),yx(e))}function yx(e){e&&(e.scrollToBottom(),e.rows>0&&e.refresh(0,e.rows-1))}function i6(e,n){let i=n,s=!1,o=null,f=0,_=[];const c=()=>{o&&(clearTimeout(o),o=null)},h=()=>{if(c(),s||f===0)return;const y=r6(_,f);_=[],f=0,e.write(y)},d=()=>{s||o||f===0||(o=setTimeout(h,i?XM:ZM))};return{write:y=>{if(!(s||y.byteLength===0)){if(_.push(y),f+=y.byteLength,f>=JM){h();return}d()}},setActive:y=>{if(i!==y){if(i=y,c(),i){h();return}d()}},dispose:()=>{h(),s=!0,_=[],f=0,c()}}}function r6(e,n){if(e.length===1)return e[0]??new Uint8Array;const i=new Uint8Array(n);let s=0;for(const o of e)i.set(o,s),s+=o.byteLength;return i}function V1(e,n,i){n?.fit(),i?.resize(e.cols,e.rows),e.refresh(0,e.rows-1)}const s6=["canonicalCwd","cwd","providerSession","ticket","token","transcriptPath","prompt","persona","toolAllowlist"];class Qi extends Error{status;constructor(n,i){super(i),this.name="AgentApiError",this.status=n}}async function Sx(e){const n=await fetch("/plugins/terminal/agent/state",{signal:e});await Fr(n);const i=await n.json();if(!Array.isArray(i.agentClis))throw new Qi(n.status,"Invalid agent state response");return i.agentClis.map(s=>p6(s,n.status))}async function a6(e){const n=await fetch("/plugins/terminal/agent/agent-cli/state",{signal:e});await Fr(n);const i=await n.json();if(!Array.isArray(i.clis))throw new Qi(n.status,"Invalid Agent CLI state response");return i}async function o6(e){const n=await fetch("/plugins/terminal/agent/tenants",{signal:e});await Fr(n);const i=await n.json();if(!Array.isArray(i.tenants))throw new Qi(n.status,"Invalid tenants response");return i.tenants.map(s=>g6(s,n.status))}async function l6(e){const n=await fetch("/plugins/terminal/agent/jobs",{signal:e});await Fr(n);const i=await n.json();if(!Array.isArray(i.tenants))throw new Qi(n.status,"Invalid jobs response");return i.tenants}async function c6(e){const n=await fetch("/plugins/terminal/agent/sessions",{signal:e});await Fr(n);const i=await n.json();if(!Array.isArray(i.sessions))throw new Qi(n.status,"Invalid agent sessions response");return i.sessions.map(s=>Rh(s,n.status))}async function u6(e){const n=await fetch("/api/v1/operations",{signal:e});await Fr(n);const i=await n.json();if(!Array.isArray(i.operations))throw new Qi(n.status,"Invalid operations response");return{operations:i.operations.map(s=>m6(s,n.status))}}async function h6(e,n,i){const s=await fetch("/plugins/terminal/agent/sessions",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({theaterId:e,cliId:n}),signal:i});return await Fr(s),Rh(await s.json(),s.status)}async function d6(e,n){const i=await fetch(`/plugins/terminal/agent/sessions/${encodeURIComponent(e)}/resume`,{method:"POST",signal:n});return await Fr(i),Rh(await i.json(),i.status)}async function f6(e,n){const i=await fetch(`/plugins/terminal/agent/sessions/${encodeURIComponent(e)}`,{method:"DELETE",signal:n});await Fr(i)}function Rh(e,n){const i=e;if(!i||typeof i.sessionId!="string"||typeof i.cwdLabel!="string"||typeof i.status!="string"||typeof i.createdAt!="number"||fg(i))throw new Qi(n,"Invalid agent session response");return{sessionId:i.sessionId,terminalSessionId:typeof i.terminalSessionId=="string"?i.terminalSessionId:i.sessionId,cwdLabel:i.cwdLabel,label:typeof i.label=="string"?i.label:void 0,cliId:typeof i.cliId=="string"?i.cliId:void 0,cliLabel:typeof i.cliLabel=="string"?i.cliLabel:void 0,status:i.status,turnState:i.turnState==="running"||i.turnState==="ended"?i.turnState:"none",createdAt:i.createdAt,theaterId:typeof i.theaterId=="string"?i.theaterId:void 0,tenantId:typeof i.tenantId=="string"?i.tenantId:void 0,registrationId:typeof i.registrationId=="string"?i.registrationId:void 0,resumeAvailable:i.resumeAvailable===!0}}async function Fr(e){if(!e.ok)throw new Qi(e.status,`Agent plugin request failed: ${e.status}`)}function p6(e,n){const i=e;if(!i||typeof i.id!="string"||typeof i.label!="string")throw new Qi(n,"Invalid Agent CLI metadata response");return{id:i.id,label:i.label,available:i.available===!0,signedIn:i.signedIn!==!1}}function g6(e,n){const i=e;if(!i||typeof i.tenantId!="string"||typeof i.tenantLabel!="string"||typeof i.createdAt!="number"||typeof i.sessions!="number")throw new Qi(n,"Invalid tenant response");return i}function m6(e,n){const i=e;if(!i||typeof i.id!="string"||typeof i.theaterId!="string"||typeof i.type!="string"||typeof i.pluginId!="string"||typeof i.title!="string"||!i.payload||typeof i.payload!="object"||Array.isArray(i.payload)||!i.ts||typeof i.ts.createdAt!="number"||typeof i.ts.updatedAt!="number"||fg(i)||fg(i.payload))throw new Qi(n,"Invalid operation response");return{id:i.id,theaterId:i.theaterId,type:i.type,pluginId:i.pluginId,title:i.title,payload:i.payload,geometry:i.geometry??null,ts:i.ts}}function fg(e){return pg(e,new Set(s6))}function pg(e,n){return!e||typeof e!="object"?!1:Array.isArray(e)?e.some(i=>pg(i,n)):Object.entries(e).some(([i,s])=>n.has(i)||pg(s,n))}const _6="active",gg=new Set(["done","error","aborted"]);function v6(e,n){let i=mg(e,n.jobId,n.updatedAt);for(const s of n.events)i=wx(i,s);return gg.has(n.status)&&!gg.has(i.status)&&(i={...i,status:n.status}),i}function wx(e,n){if(n.id<=e.lastEventId)return e;const i=n.event,s={...e,updatedAt:n.at,lastEventId:n.id,recentEvents:S6(e.recentEvents,n)};switch(n.type){case"job:registered":return b6(s,i);case"job:finalized":return{...s,status:un(i.status)??"done",finishedAt:ys(i.finishedAt)??n.at,summary:un(i.summary),error:un(i.error)};case"track:begin":return Ka(s,i,o=>({...o,startedAt:ys(i.startedAt)??n.at,requestPreview:un(i.requestPreview)}));case"track:status":return Ka(s,i,o=>({...o,status:un(i.status)??o.status}));case"track:text":return Ka(s,i,o=>({...o,status:"stream",text:o.text+(un(i.text)??""),sentTextLength:o.sentTextLength+(ys(i.textLength)??un(i.text)?.length??0)}));case"track:thought":return Ka(s,i,o=>({...o,thought:o.thought+(un(i.text)??""),sentThoughtLength:o.sentThoughtLength+(ys(i.textLength)??un(i.text)?.length??0)}));case"track:tool":return Ka(s,i,o=>({...o,status:"stream",tools:y6(o.tools,i)}));case"track:finalized":return Ka(s,i,o=>{const f=Y1(o.text,o.sentTextLength,un(i.fallbackText),ys(i.fallbackTextLength)),_=Y1(o.thought,o.sentThoughtLength,un(i.fallbackThought),ys(i.fallbackThoughtLength));return{...o,status:un(i.status)??"done",finishedAt:ys(i.finishedAt)??n.at,error:un(i.error),text:f.text,sentTextLength:f.sentLength,thought:_.text,sentThoughtLength:_.sentLength}});default:return s}}function mg(e,n,i){return{jobId:n,tenantId:e,status:_6,updatedAt:i,trackOrder:[],tracks:{},lastEventId:0,recentEvents:[]}}function xx(e){return gg.has(e)}function b6(e,n){const i=Array.isArray(n.tracks)?n.tracks:[];let s=e.trackOrder,o=e.tracks;for(const f of i){if(!f.trackId)continue;const _=o[f.trackId],c={..._??Cx(f.trackId),displayName:f.displayName??_?.displayName??f.trackId,displayCli:f.displayCli??_?.displayCli,model:f.model??_?.model,effort:f.effort??_?.effort,subtitle:f.subtitle??_?.subtitle,kind:f.kind??_?.kind,startedAt:f.startedAt??_?.startedAt};_||(s=[...s,f.trackId]),o={...o,[f.trackId]:c}}return{...e,label:un(n.label)??e.label,ownerCarrierId:un(n.ownerCarrierId)??e.ownerCarrierId,kind:un(n.kind)??e.kind,startedAt:ys(n.startedAt)??e.startedAt,trackOrder:s,tracks:o}}function Ka(e,n,i){const s=un(n.trackId);if(!s)return e;const o=e.tracks[s],f=i(o??Cx(s));return{...e,trackOrder:o?e.trackOrder:[...e.trackOrder,s],tracks:{...e.tracks,[s]:f}}}function Cx(e){return{trackId:e,displayName:e,status:"active",text:"",thought:"",sentTextLength:0,sentThoughtLength:0,tools:[]}}function y6(e,n){const i=un(n.toolId)??un(n.id);if(!i)return e;const s={id:i,name:un(n.name),input:n.input,output:n.output,status:un(n.status)},o=e.findIndex(f=>f.id===i);return o>=0?[...e.slice(0,o),{...e[o],...s},...e.slice(o+1)]:[...e,s]}function Y1(e,n,i,s){return i?n>=(s??i.length)?{text:e,sentLength:n}:{text:i,sentLength:s??i.length}:{text:e,sentLength:n}}function S6(e,n){return[...e,n].slice(-120)}function un(e){return typeof e=="string"?e:void 0}function ys(e){return typeof e=="number"&&Number.isFinite(e)?e:void 0}const w6=new Set(["idle_prompt","permission_prompt","auth_success","elicitation_dialog","elicitation_complete","elicitation_response"]);function x6(){let e="";return n=>{e+=n;const i=[];let s=e.indexOf(`
|
|
84
|
-
|
|
85
|
-
`);for(;s>=0;){const o=e.slice(0,s);e=e.slice(s+2);const f=E6(o);f&&i.push(f),s=e.indexOf(`
|
|
86
|
-
|
|
87
|
-
`)}return i}}function C6(e){if(!e.data)return null;let n;try{n=JSON.parse(e.data)}catch{return null}if(e.event==="observer:truncated"){const s=n.tenant?.tenantId;return!s||!n.truncation?null:{kind:"truncation",tenantId:s,tenantLabel:n.tenant?.tenantLabel,truncation:n.truncation}}if(e.event==="session:updated"){const s=Z1(n.session);return s?{kind:"session",tenantId:s.tenantId??s.sessionId,session:s}:null}if(e.event==="session:attention"){const s=Z1(n.session);return s?{kind:"attention",tenantId:s.tenantId??s.sessionId,session:s,reason:k6(n.reason)}:null}const i=X1(n.event)??X1(n);return i?{kind:"event",tenantId:i.tenantId,tenantLabel:n.tenant?.tenantLabel,event:i}:null}function E6(e){const n=e.split(`
|
|
88
|
-
`),i=n.find(o=>o.startsWith("event:"))?.slice(6).trim()??"message",s=n.filter(o=>o.startsWith("data:")).map(o=>o.slice(5).trim()).join(`
|
|
89
|
-
`);return!s&&i==="message"?null:{event:i,data:s}}function X1(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:{...n,event:typeof n.event=="object"&&n.event!==null?n.event:{}}}function Z1(e){try{return Rh(e,200)}catch{return null}}function k6(e){return typeof e=="string"&&w6.has(e)?e:void 0}const Cm={droppedCount:0},_g=new Set;let Ut={connection:"connecting",connectionError:null,agentClis:[],sessions:{},sessionOrder:[],tenants:[],tenantJobs:{},tenantOrder:[],activeTerminalSessionId:null,turnState:{}};function T6(){return OS(A6,Ex)}function Ex(){return Ut}function A6(e){return _g.add(e),()=>{_g.delete(e)}}function Si(e){Ut={...Ut,...e},D6()}function kx(e){Si({agentClis:e})}function R6(e){const n={};for(const i of e)n[i.sessionId]=i;Si({sessions:n,sessionOrder:[...e].sort((i,s)=>s.createdAt-i.createdAt).map(i=>i.sessionId)})}function oh(e){const n=!!Ut.sessions[e.sessionId];Si({sessions:{...Ut.sessions,[e.sessionId]:e},sessionOrder:n?Ut.sessionOrder:[e.sessionId,...Ut.sessionOrder],turnState:{...Ut.turnState,[e.sessionId]:e.turnState}})}function Tx(e){const{[e]:n,...i}=Ut.sessions,{[e]:s,...o}=Ut.turnState;Si({sessions:i,sessionOrder:Ut.sessionOrder.filter(f=>f!==e),activeTerminalSessionId:Ut.activeTerminalSessionId===e?null:Ut.activeTerminalSessionId,turnState:o})}function Ax(e){Si({activeTerminalSessionId:e})}function L6(e){Si({tenants:e,tenantOrder:[...e.map(n=>n.tenantId),...Ut.tenantOrder.filter(n=>!e.some(i=>i.tenantId===n)&&Ut.tenantJobs[n])]})}function M6(e){const n={};for(const i of e){const s={};for(const o of i.jobs)s[o.jobId]=v6(i.tenantId,o);n[i.tenantId]={tenantId:i.tenantId,tenantLabel:i.tenantLabel,jobOrder:i.jobs.map(o=>o.jobId),jobs:s,truncation:i.truncation??Cm}}Si({tenantJobs:n,tenantOrder:[...e.map(i=>i.tenantId),...Ut.tenantOrder.filter(i=>n[i])]})}function N6(e,n){const i=e.tenantId,s=e.jobId??j6(e),o=Ut.tenantJobs[i]??{tenantId:i,tenantLabel:n,jobOrder:[],jobs:{},truncation:Cm},f=s?o.jobs[s]??mg(i,s,e.at):mg(i,"__unknown__",e.at),_=wx(f,e),c=s&&o.jobOrder.includes(s)?o.jobOrder:s?[s,...o.jobOrder]:o.jobOrder,h={...o,tenantLabel:n??o.tenantLabel,jobOrder:c,jobs:s?{...o.jobs,[s]:_}:o.jobs};return Si({tenantJobs:{...Ut.tenantJobs,[i]:h},tenantOrder:Ut.tenantOrder.includes(i)?Ut.tenantOrder:[i,...Ut.tenantOrder]}),{job:_,unknownTenant:!Ut.tenantJobs[i]}}function O6(e,n,i){const s=Ut.tenantJobs[e]??{tenantId:e,tenantLabel:n,jobOrder:[],jobs:{},truncation:Cm};Si({tenantJobs:{...Ut.tenantJobs,[e]:{...s,tenantLabel:n??s.tenantLabel,truncation:i}}})}function Rx(e){const n=e.tenantId;if(!n)return[];const i=Ut.tenantJobs[n];return i?i.jobOrder.map(s=>i.jobs[s]).filter(s=>!!s):[]}function D6(){for(const e of _g)e()}function j6(e){const n=e.event;return typeof n.jobId=="string"?n.jobId:null}const J1=250,I6=5e3,vg=new Map;function B6(e){const n=new AbortController;return P6(n.signal,e),()=>n.abort()}async function P6(e,n){let i=J1;for(;!e.aborted;){Si({connection:"connecting"});try{await U6(e,n);const s=await fetch("/plugins/terminal/agent/events",{signal:e});if(!s.ok||!s.body)throw new Error(`Agent stream failed: ${s.status}`);Si({connection:"live",connectionError:null}),i=J1,await z6(s.body.getReader(),e,n),e.aborted||Si({connection:"connecting",connectionError:null})}catch(s){if(e.aborted)return;Si({connection:"connecting",connectionError:s instanceof Error?s.message:String(s)})}if(e.aborted)return;await W6(i,e),i=Math.min(i*2,I6)}}async function z6(e,n,i){const s=new TextDecoder,o=x6();for(;!n.aborted;){const f=await e.read();if(f.done)return;for(const _ of o(s.decode(f.value,{stream:!0}))){const c=C6(_);if(c){if(c.kind==="truncation"&&c.truncation){O6(c.tenantId,c.tenantLabel,c.truncation);continue}if(c.kind==="session"&&c.session){oh(c.session),lh(i,c.session.sessionId,Em(c.session));continue}if(c.kind==="attention"&&c.session){oh(c.session),c.reason!=="idle_prompt"&&lh(i,c.session.sessionId,"awaiting");continue}c.event&&(N6(c.event,c.tenantLabel),$6(i,c.event.tenantId))}}}}function Em(e){return e.status==="dormant"?"dormant":e.turnState==="running"||e.turnState==="ended"&&H6(e)?"running":"idle"}function H6(e){return Rx(e).some(n=>!xx(n.status))}function lh(e,n,i){const s=vg.get(n);e.status.set(n,i),vg.set(n,i),s!==i&&(i==="awaiting"?e.notifications.emit({kind:"agent.attention",operationId:n,message:"Agent is waiting for input"}):i==="idle"&&(s==="running"||s==="awaiting")&&e.notifications.emit({kind:"agent.ended",operationId:n,message:"Agent turn ended"}))}function $6(e,n){const{sessions:i}=Ex();for(const s of Object.values(i))s.tenantId===n&&vg.get(s.sessionId)!=="awaiting"&&lh(e,s.sessionId,Em(s))}async function U6(e,n){const[i,s,o,f,_]=await Promise.all([Sx(e),c6(e),o6(e),l6(e),u6(e)]);kx(i),R6(s),L6(o),M6(f);for(const c of s)lh(n,c.sessionId,Em(c));F6(_.operations,n)}function F6(e,n){for(const i of e)i.pluginId==="terminal"&&i.type==="agent.streaming"&&n.operations.remove(i.id).catch(()=>{})}async function W6(e,n){await new Promise(i=>{const s=()=>{clearTimeout(o),n.removeEventListener("abort",s),i()},o=setTimeout(s,e);n.addEventListener("abort",s)})}class Lh extends Error{status;constructor(n,i){super(i),this.name="TerminalModelAuthApiError",this.status=n}}async function G6(e){const n=await fetch("/plugins/terminal/model-auth/state",{signal:e});return await km(n),Mx(await n.json(),n.status)}async function q6(e,n,i){const s=await fetch(`/plugins/terminal/model-auth/providers/${encodeURIComponent(e)}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({apiKey:n}),signal:i});return await km(s),Lx(await s.json(),s.status)}async function K6(e,n){const i=await fetch(`/plugins/terminal/model-auth/providers/${encodeURIComponent(e)}`,{method:"DELETE",signal:n});return await km(i),Lx(await i.json(),i.status)}async function km(e){if(e.ok)return;let n=e.statusText||`HTTP ${e.status}`;try{const i=await e.json();typeof i.error=="string"&&(n=i.error)}catch{}throw new Lh(e.status,n)}function Lx(e,n){const i=e;if(!i||typeof i!="object"||!("state"in i))throw new Lh(n,"Invalid model auth mutation response");return{state:Mx(i.state,n)}}function Mx(e,n){const i=e;if(!i||typeof i!="object"||!Array.isArray(i.providers))throw new Lh(n,"Invalid model auth state response");return{providers:i.providers.map(s=>V6(s,n))}}function V6(e,n){const i=e;if(typeof i.cli!="string"||typeof i.displayName!="string"||typeof i.signedIn!="boolean")throw new Lh(n,"Invalid model auth provider response");return{cli:i.cli,displayName:i.displayName,signedIn:i.signedIn}}const bg=new Set;let yg={loading:!1,state:null,busyCli:null,error:null},zr=0;function Y6(){return N.useSyncExternalStore(X6,Q1,Q1)}function Q1(){return yg}function X6(e){return bg.add(e),()=>{bg.delete(e)}}async function Z6(e){const n=++zr;Hr({loading:!0,error:null});try{const i=await G6(e);if(n!==zr)return;Hr({loading:!1,state:i,error:null})}catch(i){if(e?.aborted||n!==zr)return;Hr({loading:!1,error:Tm(i)})}}async function J6(e,n){const i=++zr;Hr({busyCli:e,error:null});try{const s=await q6(e,n);return i!==zr||(Hr({state:s.state,busyCli:null,error:null}),await Nx()),!0}catch(s){return i!==zr||Hr({busyCli:null,error:Tm(s)}),!1}}async function Q6(e){const n=++zr;Hr({busyCli:e,error:null});try{const i=await K6(e);return n!==zr||(Hr({state:i.state,busyCli:null,error:null}),await Nx()),!0}catch(i){return n!==zr||Hr({busyCli:null,error:Tm(i)}),!1}}async function Nx(){try{kx(await Sx())}catch{}}function Hr(e){yg={...yg,...e};for(const n of bg)n()}function Tm(e){return e instanceof Error?e.message:String(e)}class Ox extends Error{status;constructor(n,i){super(i),this.name="TerminalSettingsApiError",this.status=n}}async function e4(e){const n=await fetch("/plugins/terminal/settings",{signal:e});return await Dx(n),jx(await n.json(),n.status)}async function t4(e,n){const i=await fetch("/plugins/terminal/settings",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e),signal:n});return await Dx(i),jx(await i.json(),i.status)}async function Dx(e){if(e.ok)return;let n=e.statusText||`HTTP ${e.status}`;try{const i=await e.json();typeof i.error=="string"&&(n=i.error)}catch{}throw new Ox(e.status,n)}function jx(e,n){const i=e;if(!i||typeof i.replaceSystemPrompt!="boolean"||typeof i.enableMetaphor!="boolean")throw new Ox(n,"Invalid Terminal settings response");return{replaceSystemPrompt:i.replaceSystemPrompt,enableMetaphor:i.enableMetaphor}}const Sg=new Set;let ch={loading:!1,state:null,savingField:null,error:null},qu=0;function n4(){return N.useSyncExternalStore(i4,ey,ey)}function ey(){return ch}function i4(e){return Sg.add(e),()=>{Sg.delete(e)}}async function r4(e){const n=++qu;uo({loading:!0,error:null});try{const i=await e4(e);if(n!==qu)return;uo({loading:!1,state:i,error:null})}catch(i){if(e?.aborted||n!==qu)return;uo({loading:!1,error:Ix(i)})}}async function ty(e,n){const i=ch.state;if(!i)return!1;qu+=1;const s={...i,[e]:n};uo({state:s,savingField:e,error:null});try{const o=await t4(s);return uo({state:o,savingField:null,error:null}),!0}catch(o){return uo({state:i,savingField:null,error:Ix(o)}),!1}}function uo(e){ch={...ch,...e};for(const n of Sg)n()}function Ix(e){return e instanceof Error?e.message:String(e)}const s4=[{id:"webgl",label:"WebGL"},{id:"dom",label:"DOM"}],a4="/plugins/terminal/agent/ticket",o4="/plugins/terminal/ws",Bx={pluginId:"terminal",type:"agent",title:"Agent",subtitle:e=>Dl(e.payload,"cliLabel")??void 0,render:e=>u.jsx(u4,{context:e})},Px={id:"agent-cli",title:"Agent CLI",render:()=>u.jsx(h4,{})},zx={id:"agent.attention",title:"Agent input waiting"},l4={id:"agent.ended",title:"Agent turn ended"},Tu={id:"terminal",operationKinds:[Bx],settingsSections:[Px],notificationKinds:[zx,l4],install:e=>c4(e),closeOperation:async e=>{try{await f6(e)}finally{Tx(e)}},launch:async({theaterId:e,kind:n})=>{const i=await h6(e,n.id);return oh(i),Ax(i.sessionId),{id:i.sessionId}},renderLaunchIcon:()=>u.jsx(k4,{})};function c4(e){return B6({operations:e.operations,notifications:e.notifications,status:e.status,refreshOperations:e.api.resync})}function u4({context:e}){const i=T6().sessions[e.operationId]??b4(e),[s,o]=N.useState(!1),f=N.useRef(null),_=N.useRef(null),c=N.useRef(null),d=Rx(i).filter(C=>!xx(C.status)),y=d[0]??null,p=d.reduce((C,T)=>C+T.trackOrder.length,0),w=N.useCallback(()=>{o(!1),f.current?.focus()},[]);return N.useLayoutEffect(()=>{s&&_.current?.focus()},[s]),N.useEffect(()=>{if(!s)return;const C=T=>{if(T.key==="Escape"){T.stopPropagation(),w();return}if(T.key==="Tab"){const E=c.current;if(!E)return;const g=Array.from(E.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])')).filter(S=>!S.hasAttribute("disabled")),v=g[0],m=g[g.length-1];T.shiftKey&&document.activeElement===v?(T.preventDefault(),m?.focus()):!T.shiftKey&&document.activeElement===m&&(T.preventDefault(),v?.focus())}};return document.addEventListener("keydown",C,!0),()=>document.removeEventListener("keydown",C,!0)},[s,w]),i.status==="dormant"?u.jsxs("button",{type:"button",className:"canvas-operation-dormant",onClick:()=>{v4(i.sessionId)},children:[u.jsx("span",{className:"canvas-operation-dormant-status",children:"Dormant"}),u.jsx("span",{className:"canvas-operation-dormant-action",children:"Resume"})]}):u.jsxs("div",{className:"agent-stream-host",children:[y?u.jsxs("button",{ref:f,type:"button",className:"job-summary job-summary--banner job-summary--live","aria-label":d.length>1?`${d.length} carriers streaming${p>0?`, ${p} tracks`:""} — click to expand`:`${y.label??y.jobId}${p>0?`, ${p} tracks`:""} — click to expand`,onClick:()=>o(!0),children:[u.jsxs("span",{className:"job-summary-row",children:[u.jsx("span",{className:"job-summary-dot","aria-hidden":"true"}),u.jsx("span",{className:"job-summary-eyebrow",children:d.length>1?`${d.length} carriers`:y.ownerCarrierId??"Carrier"}),p>0?u.jsx("span",{className:"job-summary-count","aria-hidden":"true",children:p}):null,u.jsx("span",{className:"job-summary-chev","aria-hidden":"true",children:"›"})]}),u.jsx("p",{className:"job-summary-text",children:y.label??y.jobId})]}):null,u.jsx(bx,{operationId:i.sessionId,ticketPath:a4,wsPath:o4,active:e.active,zoom:e.zoom,theme:e.theme,onExit:()=>Tx(i.sessionId)}),s?u.jsxs("div",{ref:c,className:"job-overlay",role:"dialog","aria-modal":"true","aria-label":"Carrier stream details",children:[u.jsx("button",{type:"button",className:"job-overlay-scrim","aria-label":"Close",tabIndex:-1,onClick:w}),u.jsxs("div",{className:"job-overlay-card",children:[u.jsx("button",{ref:_,type:"button",className:"job-overlay-close","aria-label":"Close",onClick:w,children:"×"}),u.jsx("div",{className:"job-overlay-body",children:d.length===0?u.jsx("p",{className:"job-overlay-empty",children:"No active streams."}):d.map(C=>u.jsx(m4,{job:C},C.jobId))})]})]}):null]})}function h4(){const[e,n]=N.useState([]),[i,s]=N.useState(null),{renderer:o,font:f}=vx();return N.useEffect(()=>{const _=new AbortController;return a6(_.signal).then(c=>n(c.clis)).catch(c=>{_.signal.aborted||s(c instanceof Error?c.message:String(c))}),()=>_.abort()},[]),u.jsxs(u.Fragment,{children:[u.jsx(d4,{}),u.jsx(f4,{}),u.jsxs("section",{className:"global-settings-card","aria-label":"Agent CLI Available",children:[u.jsx("div",{className:"agent-cli-head",children:u.jsx("p",{className:"global-settings-resp-title",children:"Agent CLI Available"})}),u.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."}),i?u.jsx("p",{className:"settings-error",children:i}):null,u.jsx("div",{className:"agent-cli-list",children:e.map(_=>u.jsx(g4,{cli:_},_.id))}),u.jsx("p",{className:"global-settings-foot",children:"Install or update a CLI, then reopen this page to re-check availability."})]}),u.jsx(y4,{terminalFont:f}),u.jsx(S4,{terminalRenderer:o})]})}function d4(){const e=n4(),n=e.state,i=e.savingField!==null;return N.useEffect(()=>{const s=new AbortController;return r4(s.signal),()=>s.abort()},[]),u.jsxs("section",{className:"global-settings-card","aria-label":"System Prompt",children:[e.error?u.jsx("p",{className:"global-settings-error",role:"alert",children:e.error}):null,n?u.jsxs(u.Fragment,{children:[u.jsx(ny,{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:n.replaceSystemPrompt,disabled:i,onToggle:()=>{ty("replaceSystemPrompt",!n.replaceSystemPrompt)}}),u.jsx(ny,{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:n.enableMetaphor,disabled:i,onToggle:()=>{ty("enableMetaphor",!n.enableMetaphor)}})]}):u.jsx("p",{className:"global-settings-help",children:e.loading?"Loading settings.":"Settings unavailable."}),u.jsx("p",{className:"global-settings-foot",children:"Changes apply to newly launched sessions. Running sessions keep their current configuration until relaunched."})]})}function ny({title:e,help:n,onLabel:i,offLabel:s,value:o,disabled:f,onToggle:_}){return u.jsxs("div",{className:"global-settings-row",children:[u.jsxs("div",{className:"global-settings-row-text",children:[u.jsx("p",{className:"global-settings-resp-title",children:e}),u.jsx("p",{className:"global-settings-help",children:n})]}),u.jsx("button",{type:"button",className:`global-settings-toggle ${o?"is-on":""}`,disabled:f,"aria-pressed":o,onClick:_,children:u.jsx("span",{children:o?i:s})})]})}function f4(){const e=Y6();return N.useEffect(()=>{const n=new AbortController;return Z6(n.signal),()=>n.abort()},[]),u.jsxs("section",{className:"global-settings-card","aria-label":"Model sign-in",children:[u.jsxs("div",{className:"model-auth-head",children:[u.jsx("p",{className:"global-settings-resp-title",children:"Model Sign-in"}),u.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?u.jsx("p",{className:"global-settings-error",role:"alert",children:e.error}):null,e.loading&&!e.state?u.jsx("p",{className:"global-settings-help",children:"Loading sign-in state."}):null,e.state?.providers.map(n=>u.jsx(p4,{provider:n,busy:e.busyCli===n.cli},n.cli)),u.jsx("p",{className:"global-settings-foot",children:"Sign-in changes apply to newly launched sessions. Running sessions keep their current credentials until relaunched."})]})}function p4({provider:e,busy:n}){const[i,s]=N.useState(""),o=async()=>{await J6(e.cli,i)&&s("")},f=async()=>{await Q6(e.cli)};return u.jsxs("div",{className:"model-auth-row",children:[u.jsxs("div",{className:"model-auth-row-head",children:[u.jsx("span",{className:"model-auth-name",children:e.displayName}),u.jsx("span",{className:`model-auth-status ${e.signedIn?"is-on":""}`,children:e.signedIn?"Signed in":"Not signed in"})]}),e.signedIn?u.jsx("div",{className:"model-auth-actions",children:u.jsx("button",{type:"button",className:"model-auth-button",disabled:n,onClick:()=>{f()},children:n?"Working…":"Sign out"})}):u.jsxs("form",{className:"model-auth-form",onSubmit:_=>{_.preventDefault(),o()},children:[u.jsx("input",{type:"password",className:"model-auth-input",placeholder:"API key",value:i,autoComplete:"off",spellCheck:!1,disabled:n,"aria-label":`${e.displayName} API key`,onChange:_=>s(_.target.value)}),u.jsx("button",{type:"submit",className:"model-auth-button is-primary",disabled:n||i.trim().length===0,children:n?"Verifying…":"Sign in"})]})]})}function g4({cli:e}){return u.jsxs("div",{className:"agent-cli-row",children:[u.jsx("span",{className:"agent-cli-name",children:e.displayName}),u.jsxs("span",{className:"agent-cli-meta",children:[e.available&&e.version?u.jsx("span",{className:"agent-cli-version",children:e.version}):null,u.jsx("span",{className:`agent-cli-status ${e.available?"is-on":""}`,children:e.available?"Available":"Missing"})]})]})}function m4({job:e}){return u.jsxs(u.Fragment,{children:[u.jsxs("div",{className:"job-overlay-head",children:[u.jsx("span",{className:"job-overlay-kicker",children:e.status}),u.jsx("strong",{children:e.label??e.jobId})]}),u.jsx("div",{className:"job-overlay-tracks",children:e.trackOrder.map(n=>{const i=e.tracks[n];return i?u.jsx(_4,{track:i},i.trackId):null})})]})}function _4({track:e}){const n=E4(e.status),i=n==="track-card--live";return u.jsxs("article",{className:n?`track-card ${n}`:"track-card",children:[u.jsxs("header",{className:"track-card-head",children:[u.jsx("span",{className:"track-card-title",children:e.displayName}),u.jsx("span",{className:"track-card-status",children:e.status})]}),e.thought?u.jsxs("div",{className:"track-card-thought",role:"group","aria-label":"Thinking",children:[u.jsx("span",{className:"track-card-section-label","aria-hidden":"true",children:"thinking"}),u.jsx("pre",{children:e.thought})]}):null,e.text?u.jsxs("div",{className:"track-card-text",role:"group","aria-label":"Output",children:[u.jsx("span",{className:"track-card-section-label track-card-section-label--output","aria-hidden":"true",children:"output"}),u.jsxs("pre",{children:[e.text,i?u.jsx("span",{className:"track-card-caret","aria-hidden":"true"}):null]})]}):null,e.error?u.jsx("div",{className:"track-card-error",role:"group","aria-label":"Error",children:e.error}):null,e.tools.length>0?u.jsx("ul",{className:"track-card-tools",children:e.tools.map(s=>u.jsx("li",{children:s.name??s.id},s.id))}):null]})}async function v4(e){oh(await d6(e)),Ax(e)}function b4(e){return{sessionId:e.operation.id,terminalSessionId:e.operation.id,cwdLabel:e.operation.title||"Workspace",label:e.operation.title,cliId:Dl(e.operation.payload,"cliId")??void 0,cliLabel:Dl(e.operation.payload,"cliLabel")??void 0,status:"dormant",turnState:"none",createdAt:e.operation.ts.createdAt,theaterId:e.theaterId,tenantId:Dl(e.operation.payload,"tenantId")??void 0,registrationId:Dl(e.operation.payload,"registrationId")??void 0,resumeAvailable:!0}}function Dl(e,n){const i=e[n];return typeof i=="string"?i:null}function y4({terminalFont:e}){const n=mx(e),i=x4(e);return u.jsxs("section",{className:"global-settings-card","aria-label":"Terminal Font",children:[u.jsxs("div",{className:"global-settings-row is-stack",children:[u.jsxs("div",{className:"global-settings-row-text",children:[u.jsxs("p",{className:"global-settings-resp-title",children:["Terminal Font ",u.jsx("span",{className:"new-badge",children:"New"})]}),u.jsx("p",{className:"global-settings-help",id:"terminal-font-help",children:"Typeface and size for every terminal panel — agent-cli and shell alike. Applies live to all open terminals; remembered on this browser."})]}),u.jsxs("div",{className:"font-control","aria-describedby":"terminal-font-help",children:[u.jsxs("div",{className:"current-readout","aria-live":"polite",children:[u.jsx("span",{className:"cr-label",children:"Currently"}),u.jsx("span",{className:"cr-value",children:i}),u.jsx("span",{className:"cr-sep",children:"·"}),u.jsxs("span",{className:"cr-value",children:[e.size,"px"]}),u.jsx("span",{className:"cr-sep",children:"·"}),u.jsx("span",{className:`cr-value ${n.status==="fallback"?"is-fallback":"is-ok"}`,children:n.status})]}),u.jsxs("div",{className:"font-cards",role:"group","aria-label":"Terminal font family",children:[Th.map(s=>u.jsx(w4,{font:s,active:e.source==="curated"&&e.id===s.id,onSelect:()=>$M(s.id)},s.id)),u.jsxs("button",{type:"button","aria-pressed":e.source==="custom",className:`font-card ${e.source==="custom"?"is-active":""}`,onClick:()=>{e.source!=="custom"&&W1("")},children:[u.jsxs("span",{className:"fc-name",children:["Custom…",u.jsx("span",{className:"fc-check","aria-hidden":"true",children:"✓"})]}),u.jsx("span",{className:"fc-sample is-custom","aria-hidden":"true",children:"type a font"}),u.jsx("span",{className:"fc-meta",children:"your installed face"}),u.jsx("span",{className:"fc-bundled fc-addon",children:"local OS font"})]})]}),u.jsx("div",{className:`custom-reveal ${e.source==="custom"?"is-open":""}`,children:u.jsxs("div",{className:"font-field-wrap",children:[u.jsxs("label",{className:"font-field",children:[u.jsx("span",{className:"field-icon","aria-hidden":"true",children:"Aa"}),u.jsx("input",{type:"text",spellCheck:!1,value:e.customName,placeholder:"e.g. MesloLGS NF, Fira Code, IBM Plex Mono","aria-label":"Custom terminal font family",onChange:s=>W1(s.currentTarget.value)})]}),u.jsxs("div",{className:`resolve-chip ${n.status==="fallback"?"is-fallback":"is-ok"}`,"aria-live":"polite",children:[u.jsx("span",{className:"rc-dot","aria-hidden":"true"}),u.jsx("span",{children:C4(e)})]})]})}),u.jsxs("div",{className:"size-row",children:[u.jsxs("div",{className:"size-stepper",role:"group","aria-label":"Font size",children:[u.jsx("button",{type:"button","aria-label":"Decrease terminal font size",disabled:e.size<=H1.min,onClick:()=>G1(e.size-1),children:"−"}),u.jsxs("span",{className:"size-val",children:[e.size,u.jsx("span",{children:" px"})]}),u.jsx("button",{type:"button","aria-label":"Increase terminal font size",disabled:e.size>=H1.max,onClick:()=>G1(e.size+1),children:"+"})]}),u.jsx("span",{className:"size-label",children:"Cell size — rescales every panel; zoom stays relative"})]})]})]}),u.jsx("p",{className:"global-settings-foot",children:"Appearance preferences apply immediately and are stored per browser, separate from session settings."})]})}function S4({terminalRenderer:e}){return u.jsx("section",{className:"global-settings-card","aria-label":"Terminal Renderer",children:u.jsxs("div",{className:"global-settings-row",children:[u.jsxs("div",{className:"global-settings-row-text",children:[u.jsx("p",{className:"global-settings-resp-title",children:"Terminal Renderer"}),u.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."})]}),u.jsx("div",{className:"segmented",role:"group","aria-label":"Terminal renderer",children:s4.map(n=>{const i=n.id===e;return u.jsx("button",{type:"button","aria-pressed":i,className:`segmented-option ${i?"is-active":""}`,onClick:()=>HM(n.id),children:n.label},n.id)})})]})})}function w4({active:e,font:n,onSelect:i}){return u.jsxs("button",{type:"button","aria-pressed":e,className:`font-card ${e?"is-active":""}`,onClick:i,children:[u.jsxs("span",{className:"fc-name",children:[n.name,u.jsx("span",{className:"fc-check","aria-hidden":"true",children:"✓"})]}),u.jsx("span",{className:"fc-sample",style:{fontFamily:n.family},"aria-hidden":"true",children:"Ag 0O ─┼ =>"}),u.jsx("span",{className:"fc-meta",children:n.meta}),u.jsx("span",{className:"fc-bundled",children:"self-hosted"})]})}function x4(e){return e.source==="custom"?e.customName||`${sh(null).name} (default)`:sh(e.id).name}function C4(e){if(!e.customName)return`Empty — using default ${sh(null).name}`;const n=mx(e);return n.status==="resolved"?`"${e.customName}" resolves on this machine`:`"${e.customName}" not found — falls back to ${n.fallbackName}`}function E4(e){return e==="stream"||e==="live"||e==="running"||e==="active"?"track-card--live":e==="error"?"track-card--bad":e==="done"||e==="aborted"?"track-card--idle":""}function k4(){return u.jsxs("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:[u.jsx("path",{d:"M8 2.6 12.6 5.2v5.6L8 13.4 3.4 10.8V5.2Z",fill:"none",stroke:"currentColor",strokeWidth:"1.15",strokeLinejoin:"round"}),u.jsx("path",{d:"M6.2 7.9h3.6M8 6.1v3.6",fill:"none",stroke:"currentColor",strokeWidth:"1.15",strokeLinecap:"round"})]})}const T4="/plugins/terminal/shell/ticket",A4="/plugins/terminal/ws",Hx={pluginId:"terminal",type:"shell",title:"Shell",subtitle:()=>"shell",render:e=>N.createElement(R4,{context:e})},up={id:"terminal",operationKinds:[Hx],install:()=>{},closeOperation:async e=>{await fetch(`/plugins/terminal/shell/sessions/${encodeURIComponent(e)}`,{method:"DELETE"})},launch:async({theaterId:e,operations:n})=>({id:(await n.create({theaterId:e,type:"shell",pluginId:"terminal",title:"Shell",payload:{theaterId:e}})).id}),renderLaunchIcon:()=>u.jsx(L4,{})};function R4({context:e}){return u.jsx(bx,{operationId:e.operationId,active:e.active,zoom:e.zoom,ticketPath:T4,wsPath:A4,theme:e.theme,onExit:e.onClose})}function L4(){return u.jsxs("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:[u.jsx("rect",{x:"2.8",y:"3.4",width:"10.4",height:"9.2",rx:"1.4",fill:"none",stroke:"currentColor",strokeWidth:"1.15"}),u.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"})]})}const M4=new Set(["agent"]),N4={id:"terminal",operationKinds:[Hx,Bx],settingsSections:[Px],notificationKinds:[zx],install:e=>(zM(e.settings),Tu.install?.(e)),closeOperation:async e=>{const n=await D4(e);if(n?.type==="shell"){await up.closeOperation?.(e);return}n&&M4.has(n.type)&&await Tu.closeOperation?.(e)},launch:async e=>e.kind.type==="shell"?up.launch?.(e)??{id:""}:Tu.launch?.(e)??{id:""},renderLaunchIcon:e=>e.type==="shell"?up.renderLaunchIcon?.(e):Tu.renderLaunchIcon?.(e)},O4=[N4];async function D4(e){const n=await fetch(`/api/v1/operations/${encodeURIComponent(e)}`);if(!n.ok)return null;const i=await n.json();return typeof i.operation?.type=="string"?{type:i.operation.type}:null}const oe={ts:"ts",js:"js",json:"json",css:"css",html:"html",md:"md",py:"py",go:"go",rust:"rust",shell:"shell",config:"config",image:"image",data:"data",archive:"archive",binary:"binary",ruby:"ruby",folder:"folder",default:"default"},j4={src:oe.ts,lib:oe.ts,app:oe.ts,test:oe.shell,tests:oe.shell,__tests__:oe.shell,spec:oe.shell,specs:oe.shell,node_modules:oe.binary,vendor:oe.binary,dist:oe.config,build:oe.config,out:oe.config,target:oe.config,docs:oe.md,doc:oe.md,public:oe.data,assets:oe.data,static:oe.data,components:oe.image,scripts:oe.js,styles:oe.css,".git":oe.html,".github":oe.config,".vscode":oe.css},iy={ts:{shape:"angle",tone:oe.ts},tsx:{shape:"angle",tone:oe.ts},mts:{shape:"angle",tone:oe.ts},cts:{shape:"angle",tone:oe.ts},"d.ts":{shape:"angle",tone:oe.ts},js:{shape:"angle",tone:oe.js},jsx:{shape:"angle",tone:oe.js},mjs:{shape:"angle",tone:oe.js},cjs:{shape:"angle",tone:oe.js},json:{shape:"braces",tone:oe.json},jsonc:{shape:"braces",tone:oe.json},json5:{shape:"braces",tone:oe.json},jsonl:{shape:"braces",tone:oe.json},graphql:{shape:"braces",tone:oe.image},gql:{shape:"braces",tone:oe.image},proto:{shape:"braces",tone:oe.go},css:{shape:"hash",tone:oe.css},scss:{shape:"hash",tone:oe.css},sass:{shape:"hash",tone:oe.css},less:{shape:"hash",tone:oe.css},styl:{shape:"hash",tone:oe.css},html:{shape:"markup",tone:oe.html},htm:{shape:"markup",tone:oe.html},xml:{shape:"markup",tone:oe.html},xhtml:{shape:"markup",tone:oe.html},vue:{shape:"markup",tone:oe.shell},svelte:{shape:"markup",tone:oe.rust},astro:{shape:"markup",tone:oe.image},md:{shape:"doc",tone:oe.md},mdx:{shape:"doc",tone:oe.md},markdown:{shape:"doc",tone:oe.md},rst:{shape:"doc",tone:oe.md},txt:{shape:"doc",tone:oe.default},text:{shape:"doc",tone:oe.default},log:{shape:"doc",tone:oe.default},adoc:{shape:"doc",tone:oe.md},pdf:{shape:"doc",tone:oe.ruby},py:{shape:"angle",tone:oe.py},pyi:{shape:"angle",tone:oe.py},pyw:{shape:"angle",tone:oe.py},go:{shape:"angle",tone:oe.go},rs:{shape:"angle",tone:oe.rust},rb:{shape:"angle",tone:oe.ruby},rake:{shape:"angle",tone:oe.ruby},gemspec:{shape:"angle",tone:oe.ruby},java:{shape:"angle",tone:oe.html},kt:{shape:"angle",tone:oe.config},kts:{shape:"angle",tone:oe.config},scala:{shape:"angle",tone:oe.ruby},c:{shape:"angle",tone:oe.ts},h:{shape:"angle",tone:oe.ts},cpp:{shape:"angle",tone:oe.css},cc:{shape:"angle",tone:oe.css},cxx:{shape:"angle",tone:oe.css},hpp:{shape:"angle",tone:oe.css},cs:{shape:"angle",tone:oe.config},php:{shape:"angle",tone:oe.config},swift:{shape:"angle",tone:oe.html},lua:{shape:"angle",tone:oe.ts},dart:{shape:"angle",tone:oe.go},sh:{shape:"terminal",tone:oe.shell},bash:{shape:"terminal",tone:oe.shell},zsh:{shape:"terminal",tone:oe.shell},fish:{shape:"terminal",tone:oe.shell},ps1:{shape:"terminal",tone:oe.css},bat:{shape:"terminal",tone:oe.shell},cmd:{shape:"terminal",tone:oe.shell},yaml:{shape:"gear",tone:oe.config},yml:{shape:"gear",tone:oe.config},toml:{shape:"gear",tone:oe.config},ini:{shape:"gear",tone:oe.config},conf:{shape:"gear",tone:oe.config},cfg:{shape:"gear",tone:oe.config},properties:{shape:"gear",tone:oe.config},env:{shape:"gear",tone:oe.config},editorconfig:{shape:"gear",tone:oe.config},png:{shape:"image",tone:oe.image},jpg:{shape:"image",tone:oe.image},jpeg:{shape:"image",tone:oe.image},gif:{shape:"image",tone:oe.image},webp:{shape:"image",tone:oe.image},svg:{shape:"image",tone:oe.image},ico:{shape:"image",tone:oe.image},bmp:{shape:"image",tone:oe.image},avif:{shape:"image",tone:oe.image},tiff:{shape:"image",tone:oe.image},heic:{shape:"image",tone:oe.image},mp4:{shape:"image",tone:oe.data},mov:{shape:"image",tone:oe.data},webm:{shape:"image",tone:oe.data},mkv:{shape:"image",tone:oe.data},mp3:{shape:"chip",tone:oe.shell},wav:{shape:"chip",tone:oe.shell},flac:{shape:"chip",tone:oe.shell},ogg:{shape:"chip",tone:oe.shell},sql:{shape:"database",tone:oe.data},csv:{shape:"database",tone:oe.data},tsv:{shape:"database",tone:oe.data},db:{shape:"database",tone:oe.data},sqlite:{shape:"database",tone:oe.data},sqlite3:{shape:"database",tone:oe.data},parquet:{shape:"database",tone:oe.data},zip:{shape:"archive",tone:oe.archive},tar:{shape:"archive",tone:oe.archive},gz:{shape:"archive",tone:oe.archive},tgz:{shape:"archive",tone:oe.archive},bz2:{shape:"archive",tone:oe.archive},xz:{shape:"archive",tone:oe.archive},rar:{shape:"archive",tone:oe.archive},"7z":{shape:"archive",tone:oe.archive},zst:{shape:"archive",tone:oe.archive},bin:{shape:"chip",tone:oe.binary},exe:{shape:"chip",tone:oe.binary},dll:{shape:"chip",tone:oe.binary},so:{shape:"chip",tone:oe.binary},dylib:{shape:"chip",tone:oe.binary},wasm:{shape:"chip",tone:oe.config},class:{shape:"chip",tone:oe.binary},lock:{shape:"chip",tone:oe.binary},woff:{shape:"chip",tone:oe.config},woff2:{shape:"chip",tone:oe.config},ttf:{shape:"chip",tone:oe.config},otf:{shape:"chip",tone:oe.config}},I4={dockerfile:{shape:"chip",tone:oe.css},"docker-compose.yml":{shape:"gear",tone:oe.css},"docker-compose.yaml":{shape:"gear",tone:oe.css},makefile:{shape:"gear",tone:oe.html},"cmakelists.txt":{shape:"gear",tone:oe.html},".gitignore":{shape:"gear",tone:oe.html},".gitattributes":{shape:"gear",tone:oe.html},".dockerignore":{shape:"gear",tone:oe.html},".npmignore":{shape:"gear",tone:oe.html},".npmrc":{shape:"gear",tone:oe.ruby},"package.json":{shape:"braces",tone:oe.shell},"tsconfig.json":{shape:"braces",tone:oe.ts},license:{shape:"doc",tone:oe.json},"license.md":{shape:"doc",tone:oe.json},licence:{shape:"doc",tone:oe.json}},B4={shape:"default",tone:oe.default},wg={angle:u.jsxs(u.Fragment,{children:[u.jsx("path",{d:"M5.6 4.5 2.4 8l3.2 3.5",fill:"none",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round"}),u.jsx("path",{d:"M10.4 4.5 13.6 8l-3.2 3.5",fill:"none",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round"}),u.jsx("path",{d:"M9.1 3.4 6.9 12.6",fill:"none",stroke:"currentColor",strokeWidth:"1.3",strokeLinecap:"round",opacity:"0.55"})]}),braces:u.jsxs(u.Fragment,{children:[u.jsx("path",{d:"M6.4 3.4c-1.1 0-1.5.5-1.5 1.5v1.2c0 .9-.4 1.4-1.1 1.6v.6c.7.2 1.1.7 1.1 1.6v1.2c0 1 .4 1.5 1.5 1.5",fill:"none",stroke:"currentColor",strokeWidth:"1.3",strokeLinecap:"round",strokeLinejoin:"round"}),u.jsx("path",{d:"M9.6 3.4c1.1 0 1.5.5 1.5 1.5v1.2c0 .9.4 1.4 1.1 1.6v.6c-.7.2-1.1.7-1.1 1.6v1.2c0 1-.4 1.5-1.5 1.5",fill:"none",stroke:"currentColor",strokeWidth:"1.3",strokeLinecap:"round",strokeLinejoin:"round"}),u.jsx("circle",{cx:"8",cy:"8",r:"0.85",fill:"currentColor",opacity:"0.6"})]}),hash:u.jsxs(u.Fragment,{children:[u.jsx("path",{d:"M6.6 3 5.2 13M10.8 3 9.4 13",fill:"none",stroke:"currentColor",strokeWidth:"1.35",strokeLinecap:"round"}),u.jsx("path",{d:"M3.6 6.4h9M3.4 9.6h9",fill:"none",stroke:"currentColor",strokeWidth:"1.35",strokeLinecap:"round"})]}),doc:u.jsxs(u.Fragment,{children:[u.jsx("path",{d:"M4 2.5h5l3 3v8a.6.6 0 0 1-.6.6H4a.6.6 0 0 1-.6-.6V3.1a.6.6 0 0 1 .6-.6Z",fill:"currentColor",opacity:"0.16"}),u.jsx("path",{d:"M4 2.5h5l3 3v8a.6.6 0 0 1-.6.6H4a.6.6 0 0 1-.6-.6V3.1a.6.6 0 0 1 .6-.6Z",fill:"none",stroke:"currentColor",strokeWidth:"1.1",strokeLinejoin:"round"}),u.jsx("path",{d:"M9 2.7V5.5h2.8",fill:"none",stroke:"currentColor",strokeWidth:"1.1",strokeLinejoin:"round"}),u.jsx("path",{d:"M5.7 8.6h4.6M5.7 10.5h4.6M5.7 12.1h3",fill:"none",stroke:"currentColor",strokeWidth:"1",strokeLinecap:"round",opacity:"0.7"})]}),image:u.jsxs(u.Fragment,{children:[u.jsx("rect",{x:"2.5",y:"3.6",width:"11",height:"8.8",rx:"1.4",fill:"currentColor",opacity:"0.16"}),u.jsx("rect",{x:"2.5",y:"3.6",width:"11",height:"8.8",rx:"1.4",fill:"none",stroke:"currentColor",strokeWidth:"1.1"}),u.jsx("circle",{cx:"5.9",cy:"6.6",r:"1.1",fill:"currentColor"}),u.jsx("path",{d:"M3 11.4 6.6 7.9l2 2 1.9-1.7 2.5 2.3",fill:"none",stroke:"currentColor",strokeWidth:"1.1",strokeLinejoin:"round"})]}),terminal:u.jsxs(u.Fragment,{children:[u.jsx("rect",{x:"2.3",y:"3.3",width:"11.4",height:"9.4",rx:"1.5",fill:"currentColor",opacity:"0.16"}),u.jsx("rect",{x:"2.3",y:"3.3",width:"11.4",height:"9.4",rx:"1.5",fill:"none",stroke:"currentColor",strokeWidth:"1.1"}),u.jsx("path",{d:"M5 6.4 7.3 8 5 9.6",fill:"none",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round"}),u.jsx("path",{d:"M8.4 9.8h3",fill:"none",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round"})]}),gear:u.jsxs(u.Fragment,{children:[u.jsx("circle",{cx:"8",cy:"8",r:"2",fill:"none",stroke:"currentColor",strokeWidth:"1.25"}),u.jsx("circle",{cx:"8",cy:"8",r:"2",fill:"currentColor",opacity:"0.18"}),u.jsx("path",{d:"M8 2.4v2.1M8 11.5v2.1M13.6 8h-2.1M4.5 8H2.4M11.96 4.04l-1.49 1.49M5.53 10.47l-1.49 1.49M11.96 11.96l-1.49-1.49M5.53 5.53 4.04 4.04",fill:"none",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round"})]}),markup:u.jsxs(u.Fragment,{children:[u.jsx("path",{d:"M5.6 4.2 2.4 8l3.2 3.8",fill:"none",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round"}),u.jsx("path",{d:"M10.4 4.2 13.6 8l-3.2 3.8",fill:"none",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round"}),u.jsx("circle",{cx:"8",cy:"8",r:"1.15",fill:"currentColor"})]}),database:u.jsxs(u.Fragment,{children:[u.jsx("ellipse",{cx:"8",cy:"4.6",rx:"4.4",ry:"1.8",fill:"currentColor",opacity:"0.18"}),u.jsx("path",{d:"M3.6 4.6v6.8c0 1 2 1.8 4.4 1.8s4.4-.8 4.4-1.8V4.6",fill:"none",stroke:"currentColor",strokeWidth:"1.1"}),u.jsx("ellipse",{cx:"8",cy:"4.6",rx:"4.4",ry:"1.8",fill:"none",stroke:"currentColor",strokeWidth:"1.1"}),u.jsx("path",{d:"M3.6 8c0 1 2 1.8 4.4 1.8s4.4-.8 4.4-1.8",fill:"none",stroke:"currentColor",strokeWidth:"1.1",opacity:"0.65"})]}),archive:u.jsxs(u.Fragment,{children:[u.jsx("path",{d:"M3 5.2 8 3.1l5 2.1v5.6L8 12.9 3 10.8V5.2Z",fill:"currentColor",opacity:"0.16"}),u.jsx("path",{d:"M3 5.2 8 3.1l5 2.1v5.6L8 12.9 3 10.8V5.2Z",fill:"none",stroke:"currentColor",strokeWidth:"1.1",strokeLinejoin:"round"}),u.jsx("path",{d:"M3 5.2 8 7.3l5-2.1M8 7.3v5.6",fill:"none",stroke:"currentColor",strokeWidth:"1.1",strokeLinejoin:"round"}),u.jsx("path",{d:"M5.5 4.15 10.5 6.25",fill:"none",stroke:"currentColor",strokeWidth:"1",strokeLinecap:"round",opacity:"0.6"})]}),chip:u.jsxs(u.Fragment,{children:[u.jsx("rect",{x:"4.2",y:"4.2",width:"7.6",height:"7.6",rx:"1.1",fill:"currentColor",opacity:"0.16"}),u.jsx("rect",{x:"4.2",y:"4.2",width:"7.6",height:"7.6",rx:"1.1",fill:"none",stroke:"currentColor",strokeWidth:"1.1"}),u.jsx("rect",{x:"6.6",y:"6.6",width:"2.8",height:"2.8",rx:"0.5",fill:"currentColor",opacity:"0.5"}),u.jsx("path",{d:"M6.5 2.6v1.6M9.5 2.6v1.6M6.5 11.8v1.6M9.5 11.8v1.6M2.6 6.5h1.6M2.6 9.5h1.6M11.8 6.5h1.6M11.8 9.5h1.6",fill:"none",stroke:"currentColor",strokeWidth:"1",strokeLinecap:"round"})]}),default:u.jsxs(u.Fragment,{children:[u.jsx("path",{d:"M4 2.5h5l3 3v8a.6.6 0 0 1-.6.6H4a.6.6 0 0 1-.6-.6V3.1a.6.6 0 0 1 .6-.6Z",fill:"currentColor",opacity:"0.14"}),u.jsx("path",{d:"M4 2.5h5l3 3v8a.6.6 0 0 1-.6.6H4a.6.6 0 0 1-.6-.6V3.1a.6.6 0 0 1 .6-.6Z",fill:"none",stroke:"currentColor",strokeWidth:"1.1",strokeLinejoin:"round"}),u.jsx("path",{d:"M9 2.7V5.5h2.8",fill:"none",stroke:"currentColor",strokeWidth:"1.1",strokeLinejoin:"round"})]}),folderClosed:u.jsxs(u.Fragment,{children:[u.jsx("path",{d:"M2.4 5.4c0-.69.56-1.25 1.25-1.25h2.7c.33 0 .65.13.88.37l.72.72c.23.23.55.37.88.37h3.15c.69 0 1.25.56 1.25 1.25v4.05c0 .69-.56 1.25-1.25 1.25H3.65c-.69 0-1.25-.56-1.25-1.25V5.4Z",fill:"currentColor",opacity:"0.2"}),u.jsx("path",{d:"M2.4 5.4c0-.69.56-1.25 1.25-1.25h2.7c.33 0 .65.13.88.37l.72.72c.23.23.55.37.88.37h3.15c.69 0 1.25.56 1.25 1.25v4.05c0 .69-.56 1.25-1.25 1.25H3.65c-.69 0-1.25-.56-1.25-1.25V5.4Z",fill:"none",stroke:"currentColor",strokeWidth:"1.1",strokeLinejoin:"round"})]}),folderOpen:u.jsxs(u.Fragment,{children:[u.jsx("path",{d:"M2.4 5.2c0-.69.56-1.25 1.25-1.25h2.7c.33 0 .65.13.88.37l.72.72c.23.23.55.37.88.37h3.15c.69 0 1.25.56 1.25 1.25v1.1H2.4V5.2Z",fill:"currentColor",opacity:"0.18"}),u.jsx("path",{d:"M1.45 7.55h12.1l-1.16 3.88c-.17.56-.69.97-1.28.97H3.89c-.59 0-1.11-.41-1.28-.97L1.45 7.55Z",fill:"currentColor",opacity:"0.26"}),u.jsx("path",{d:"M2.4 5.2c0-.69.56-1.25 1.25-1.25h2.7c.33 0 .65.13.88.37l.72.72c.23.23.55.37.88.37h3.15c.69 0 1.25.56 1.25 1.25v.8",fill:"none",stroke:"currentColor",strokeWidth:"1.1",strokeLinejoin:"round"}),u.jsx("path",{d:"M1.45 7.55h12.1l-1.16 3.88c-.17.56-.69.97-1.28.97H3.89c-.59 0-1.11-.41-1.28-.97L1.45 7.55Z",fill:"none",stroke:"currentColor",strokeWidth:"1.1",strokeLinejoin:"round"})]})};function P4({name:e}){const n=H4(e);return u.jsx("svg",{className:"fexp-file-svg",width:"15",height:"15",viewBox:"0 0 16 16","aria-hidden":"true",style:{color:`var(--fexp-ic-${n.tone})`},children:wg[n.shape]})}function z4({name:e,open:n}){const i=j4[e.toLowerCase()]??oe.folder;return u.jsx("svg",{className:"fexp-file-svg",width:"15",height:"15",viewBox:"0 0 16 16","aria-hidden":"true",style:{color:`var(--fexp-ic-${i})`},children:n?wg.folderOpen:wg.folderClosed})}function H4(e){const n=e.toLowerCase(),i=I4[n];if(i)return i;if(n.startsWith(".env"))return{shape:"gear",tone:oe.config};if(n.startsWith("readme"))return{shape:"doc",tone:oe.md};if(n.endsWith(".d.ts"))return iy["d.ts"];const s=n.lastIndexOf(".");if(s>0&&s<n.length-1){const o=n.slice(s+1),f=iy[o];if(f)return f}return B4}const $4=200,Au=30,ry=5,$x="fleet-console.fileExplorer.showHidden";function Ux(e,n,i,s){for(const o of e)if(!(!s&&o.name.startsWith("."))){if(o.name.toLowerCase().includes(i))return!0;if(o.kind==="dir"){const f=n.get(o.relativePath)?.entries;if(f&&Ux(f,n,i,s))return!0}}return!1}function Fx(e,n,i,s,o,f,_,c){const h=[];for(const d of e)if(!(!c&&d.name.startsWith("."))){if(_){const y=d.name.toLowerCase().includes(_),p=d.kind==="dir"&&Ux(f.get(d.relativePath)?.entries??[],f,_,c);if(!y&&!p)continue}if(h.push({entry:d,depth:n,isSelected:i===d.relativePath,isExpanded:s.has(d.relativePath),isLoading:o.has(d.relativePath)}),d.kind==="dir"&&s.has(d.relativePath)){const y=f.get(d.relativePath)?.entries;y&&h.push(...Fx(y,n+1,i,s,o,f,_,c))}}return h}function U4({files:e,theaterId:n,selectedPath:i,onSelect:s}){const[o,f]=N.useState(null),[_,c]=N.useState(null),[h,d]=N.useState(""),[y,p]=N.useState(new Set),[w,C]=N.useState(new Set),[T,E]=N.useState(new Map),[g,v]=N.useState(""),[m,S]=N.useState(0),[k,L]=N.useState(600),[R,M]=N.useState(()=>F4()),A=N.useRef(null),B=N.useRef(y);B.current=y;const K=N.useRef(h);K.current=h;const F=N.useRef(e);F.current=e,N.useEffect(()=>{n&&(f(null),c(null),d(""),p(new Set),E(new Map),v(""))},[n]),N.useEffect(()=>{n&&e.listFolder(h||void 0).then(se=>{f(se),c(null)}).catch(se=>{c(se instanceof Error?se.message:"Unable to load folder")})},[n,h,e]),N.useEffect(()=>{const se=A.current;if(!se)return;const J=new ResizeObserver(()=>L(se.clientHeight));return J.observe(se),L(se.clientHeight),()=>J.disconnect()},[]),N.useEffect(()=>{if(!n)return;let se=!0;const J=`/plugins/file-explorer/files/watch?theaterId=${encodeURIComponent(n)}`,H=new EventSource(J),ae=()=>{F.current.listFolder(K.current||void 0).then(we=>{f(we),c(null)}).catch(()=>{})},de=()=>{ae();for(const we of B.current)F.current.listFolder(we).then(ye=>{E(Le=>new Map(Le).set(we,ye))}).catch(()=>{})};return H.addEventListener("change",we=>{let ye;try{ye=JSON.parse(we.data)}catch{return}typeof ye=="string"&&((ye===""||ye===K.current)&&ae(),ye!==""&&B.current.has(ye)&&F.current.listFolder(ye).then(Le=>{E(Oe=>new Map(Oe).set(ye,Le))}).catch(()=>{}))}),H.onopen=()=>{if(se){se=!1;return}de()},()=>{H.close()}},[n,e]);const W=N.useCallback(se=>{const J=se.relativePath,H=!y.has(J);p(ae=>{const de=new Set(ae);return de.has(J)?(de.delete(J),de):(de.add(J),de)}),H&&(C(ae=>new Set(ae).add(J)),e.listFolder(J).then(ae=>{E(de=>new Map(de).set(J,ae)),C(de=>{const we=new Set(de);return we.delete(J),we})}).catch(()=>{C(ae=>{const de=new Set(ae);return de.delete(J),de})}))},[e,y]),I=N.useCallback(se=>{se.kind==="dir"?W(se):s(se)},[W,s]),Z=N.useCallback(se=>{S(se.currentTarget.scrollTop)},[]),X=N.useCallback(()=>{M(se=>{const J=!se;try{localStorage.setItem($x,J?"1":"0")}catch{}return J})},[]),z=N.useCallback(()=>{if(n){e.listFolder(h||void 0).then(se=>{f(se),c(null)}).catch(se=>{c(se instanceof Error?se.message:"Unable to load folder")});for(const se of y)e.listFolder(se).then(J=>{E(H=>new Map(H).set(se,J))}).catch(()=>{})}},[e,h,y,n]),q=g.toLowerCase(),V=N.useMemo(()=>o?Fx(o.entries,0,i,y,w,T,q,R):[],[o,i,y,w,T,q,R]),j=!R&&o!==null&&o.entries.length>0&&V.length===0&&!g,P=V.length>$4,D=P?Math.max(0,Math.floor(m/Au)-ry):0,U=P?Math.min(V.length,Math.ceil((m+k)/Au)+ry):V.length,G=V.slice(D,U),Y=V.length*Au,ie=D*Au;return n?_&&!o?u.jsx("div",{className:"fexp-tree-error",children:_}):o?u.jsxs("div",{className:"fexp-tree-container",children:[u.jsxs("div",{className:"fexp-filter",children:[u.jsx("input",{type:"text",className:"fexp-filter-input",placeholder:"Filter…",value:g,onChange:se=>v(se.target.value),"aria-label":"Filter files"}),g&&u.jsx("button",{type:"button",className:"fexp-filter-clear",onClick:()=>v(""),"aria-label":"Clear filter",children:"✕"}),u.jsx("button",{type:"button",className:"fexp-refresh-btn",onClick:z,"aria-label":"Refresh file tree",title:"Refresh file tree",children:"↻"}),u.jsx("button",{type:"button",className:`fexp-hidden-toggle${R?" is-active":""}`,onClick:X,"aria-pressed":R,"aria-label":R?"Hide hidden files":"Show hidden files",title:R?"Hide hidden files":"Show hidden files",children:R?u.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:[u.jsx("ellipse",{cx:"8",cy:"8",rx:"5.5",ry:"3.5",stroke:"currentColor",strokeWidth:"1.4"}),u.jsx("circle",{cx:"8",cy:"8",r:"1.8",fill:"currentColor"})]}):u.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:[u.jsx("ellipse",{cx:"8",cy:"8",rx:"5.5",ry:"3.5",stroke:"currentColor",strokeWidth:"1.4"}),u.jsx("circle",{cx:"8",cy:"8",r:"1.8",fill:"currentColor"}),u.jsx("line",{x1:"3",y1:"13",x2:"13",y2:"3",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round"})]})})]}),u.jsxs("div",{ref:A,className:"fexp-tree",role:"tree","aria-label":"File tree",onScroll:P?Z:void 0,children:[o.parentRelativePath!==null&&!g&&u.jsx("button",{className:"fexp-tree-up",type:"button",onClick:()=>d(o.parentRelativePath??""),"aria-label":"Parent folder",children:"↑ .."}),P?u.jsx("div",{style:{height:Y,position:"relative"},children:u.jsx("div",{style:{transform:`translateY(${ie}px)`},children:G.map(se=>u.jsx(sy,{row:se,onEntryClick:I},se.entry.relativePath))})}):G.map(se=>u.jsx(sy,{row:se,onEntryClick:I},se.entry.relativePath)),V.length===0&&g&&u.jsx("div",{className:"fexp-tree-empty",children:"No matching items"}),V.length===0&&!g&&o.entries.length===0&&u.jsx("div",{className:"fexp-tree-empty",children:"This folder is empty"}),j&&u.jsx("div",{className:"fexp-tree-empty",children:"Only hidden items — use the eye icon to show them"})]})]}):u.jsx("div",{className:"fexp-tree-loading",children:"Loading…"}):u.jsx("div",{className:"fexp-tree-empty",children:"Select a Theater"})}function sy({row:e,onEntryClick:n}){const{entry:i,depth:s,isSelected:o,isExpanded:f,isLoading:_}=e,c=i.kind==="dir",h=s*16,d=N.useCallback(()=>n(i),[i,n]);return u.jsxs("button",{className:`fexp-tree-row${o?" is-cur":""}${c?" is-dir":" is-file"}`,style:{paddingLeft:`${h+12}px`},type:"button",role:"treeitem","aria-selected":o,"aria-expanded":c?f:void 0,onClick:d,children:[u.jsx("span",{className:"fexp-tree-icon","aria-hidden":"true",children:c?u.jsx(z4,{name:i.name,open:f}):u.jsx(P4,{name:i.name})}),u.jsx("span",{className:"fexp-tree-name",children:i.name}),_&&u.jsx("span",{className:"fexp-tree-spin","aria-hidden":"true",children:"⋯"})]})}function F4(){try{return localStorage.getItem($x)==="1"}catch{return!1}}function W4({name:e,sizeHint:n}){return u.jsxs("div",{className:"fexp-bin-wrap v-bin",children:[u.jsx("span",{className:"fexp-bin-glyph","aria-hidden":"true",children:"⊘"}),u.jsx("p",{className:"fexp-bin-name",children:e}),n&&u.jsx("p",{className:"fexp-bin-meta",children:n}),u.jsx("p",{className:"fexp-bin-hint",children:"Binary files can't be previewed"})]})}function G4(e,n){switch(n){case"typescript":case"javascript":return K4(e);case"json":return V4(e);case"python":return X4(e);case"css":case"scss":case"sass":case"less":return Z4(e);case"html":case"xml":return J4(e);case"bash":case"shell":return Q4(e);case"yaml":return eN(e);default:return[{kind:"text",value:e}]}}const q4=new Set(["abstract","as","async","await","break","case","catch","class","const","continue","debugger","declare","default","delete","do","else","enum","export","extends","false","finally","for","from","function","if","implements","import","in","instanceof","interface","is","keyof","let","namespace","new","null","of","override","package","private","protected","public","readonly","return","satisfies","static","super","switch","this","throw","true","try","type","typeof","undefined","var","void","while","with","yield"]);function K4(e){const n=[];let i=0;for(;i<e.length;){if(e.startsWith("/*",i)){const s=e.indexOf("*/",i+2),o=s===-1?e.slice(i):e.slice(i,s+2);n.push({kind:"com",value:o}),i+=o.length;continue}if(e.startsWith("//",i)){const s=e.indexOf(`
|
|
90
|
-
`,i),o=s===-1?e.slice(i):e.slice(i,s);n.push({kind:"com",value:o}),i+=o.length;continue}if(e[i]==="`"){const{slice:s,length:o}=As(e,i,"`","`");n.push({kind:"str",value:s}),i+=o;continue}if(e[i]==='"'||e[i]==="'"){const{slice:s,length:o}=As(e,i,e[i],e[i]);n.push({kind:"str",value:s}),i+=o;continue}if(/[0-9]/.test(e[i])||e[i]==="."&&/[0-9]/.test(e[i+1]??"")){const s=e.slice(i).match(/^(0x[\da-fA-F]+|0o[0-7]+|0b[01]+|[\d]*\.?[\d]+(?:[eE][+-]?\d+)?[nN]?)/);if(s){n.push({kind:"num",value:s[0]}),i+=s[0].length;continue}}if(/[a-zA-Z_$]/.test(e[i])){const s=e.slice(i).match(/^[a-zA-Z_$][\w$]*/);if(s){const o=s[0],f=e.slice(i+o.length).match(/^\s*\(/);q4.has(o)?n.push({kind:"key",value:o}):f?n.push({kind:"fn",value:o}):n.push({kind:"text",value:o}),i+=o.length;continue}}if(/[{}()[\];,.<>!?:|&^~%*+\-=/\\@#]/.test(e[i])){n.push({kind:"punct",value:e[i]}),i++;continue}n.push({kind:"text",value:e[i]}),i++}return n}function V4(e){const n=[];let i=0;for(;i<e.length;){if(e[i]==='"'){const{slice:s,length:o}=As(e,i,'"','"'),_=e.slice(i+o).trimStart().startsWith(":");n.push({kind:_?"attr":"str",value:s}),i+=o;continue}if(/[0-9\-]/.test(e[i])){const s=e.slice(i).match(/^-?[\d]*\.?[\d]+(?:[eE][+-]?\d+)?/);if(s){n.push({kind:"num",value:s[0]}),i+=s[0].length;continue}}if(e.startsWith("true",i)||e.startsWith("false",i)||e.startsWith("null",i)){const s=e.slice(i).match(/^(true|false|null)/);if(s){n.push({kind:"key",value:s[0]}),i+=s[0].length;continue}}if(/[{}[\]:,]/.test(e[i])){n.push({kind:"punct",value:e[i]}),i++;continue}n.push({kind:"text",value:e[i]}),i++}return n}const Y4=new Set(["False","None","True","and","as","assert","async","await","break","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","in","is","lambda","nonlocal","not","or","pass","raise","return","try","while","with","yield"]);function X4(e){const n=[];let i=0;for(;i<e.length;){if(e[i]==="#"){const s=e.indexOf(`
|
|
91
|
-
`,i),o=s===-1?e.slice(i):e.slice(i,s);n.push({kind:"com",value:o}),i+=o.length;continue}if(e.startsWith('"""',i)||e.startsWith("'''",i)){const s=e.slice(i,i+3),o=e.indexOf(s,i+3),f=o===-1?e.slice(i):e.slice(i,o+3);n.push({kind:"str",value:f}),i+=f.length;continue}if(e[i]==='"'||e[i]==="'"){const{slice:s,length:o}=As(e,i,e[i],e[i]);n.push({kind:"str",value:s}),i+=o;continue}if(/[0-9]/.test(e[i])){const s=e.slice(i).match(/^(0x[\da-fA-F]+|0o[0-7]+|0b[01]+|[\d]*\.?[\d]+(?:[eE][+-]?\d+)?)/);if(s){n.push({kind:"num",value:s[0]}),i+=s[0].length;continue}}if(/[a-zA-Z_]/.test(e[i])){const s=e.slice(i).match(/^[a-zA-Z_]\w*/);if(s){const o=s[0],f=e.slice(i+o.length).match(/^\s*\(/);Y4.has(o)?n.push({kind:"key",value:o}):f?n.push({kind:"fn",value:o}):n.push({kind:"text",value:o}),i+=o.length;continue}}n.push({kind:"text",value:e[i]}),i++}return n}function Z4(e){const n=[];let i=0;for(;i<e.length;){if(e.startsWith("/*",i)){const s=e.indexOf("*/",i+2),o=s===-1?e.slice(i):e.slice(i,s+2);n.push({kind:"com",value:o}),i+=o.length;continue}if(e.startsWith("//",i)){const s=e.indexOf(`
|
|
92
|
-
`,i),o=s===-1?e.slice(i):e.slice(i,s);n.push({kind:"com",value:o}),i+=o.length;continue}if(e[i]==='"'||e[i]==="'"){const{slice:s,length:o}=As(e,i,e[i],e[i]);n.push({kind:"str",value:s}),i+=o;continue}if(e[i]==="."||e[i]==="#"||e[i]===":"){const s=e.slice(i).match(/^[.#:][:a-zA-Z_-][\w-]*/);if(s){n.push({kind:"tag",value:s[0]}),i+=s[0].length;continue}}if(/[a-zA-Z-]/.test(e[i])){const s=e.slice(i).match(/^[a-zA-Z-][\w-]*/);if(s){const o=s[0];e.slice(i+o.length).trimStart().startsWith(":")?n.push({kind:"attr",value:o}):n.push({kind:"text",value:o}),i+=o.length;continue}}if(/[0-9]/.test(e[i])){const s=e.slice(i).match(/^[\d]*\.?[\d]+(?:[a-zA-Z%]*)/);if(s){n.push({kind:"num",value:s[0]}),i+=s[0].length;continue}}n.push({kind:"text",value:e[i]}),i++}return n}function J4(e){const n=[];let i=0;for(;i<e.length;){if(e.startsWith("<!--",i)){const s=e.indexOf("-->",i+4),o=s===-1?e.slice(i):e.slice(i,s+3);n.push({kind:"com",value:o}),i+=o.length;continue}if(e[i]==="<"){n.push({kind:"punct",value:"<"}),i++,e[i]==="/"&&(n.push({kind:"punct",value:"/"}),i++);const s=e.slice(i).match(/^[a-zA-Z][\w:-]*/);s&&(n.push({kind:"tag",value:s[0]}),i+=s[0].length);continue}if(e[i]==='"'||e[i]==="'"){const{slice:s,length:o}=As(e,i,e[i],e[i]);n.push({kind:"str",value:s}),i+=o;continue}if(/[a-zA-Z]/.test(e[i])){const s=e.slice(i).match(/^[a-zA-Z][\w:-]*/);if(s){const o=e.slice(i+s[0].length).trimStart();n.push({kind:o.startsWith("=")?"attr":"text",value:s[0]}),i+=s[0].length;continue}}n.push({kind:"text",value:e[i]}),i++}return n}function Q4(e){const n=[];let i=0;const s=new Set(["if","then","else","elif","fi","for","in","do","done","while","until","case","esac","function","return","local","export","readonly","declare","unset","echo","exit","shift","source","."]);for(;i<e.length;){if(e[i]==="#"){const o=e.indexOf(`
|
|
93
|
-
`,i),f=o===-1?e.slice(i):e.slice(i,o);n.push({kind:"com",value:f}),i+=f.length;continue}if(e[i]==='"'||e[i]==="'"){const{slice:o,length:f}=As(e,i,e[i],e[i]);n.push({kind:"str",value:o}),i+=f;continue}if(/[a-zA-Z_]/.test(e[i])){const o=e.slice(i).match(/^[a-zA-Z_][\w]*/);if(o){n.push({kind:s.has(o[0])?"key":"text",value:o[0]}),i+=o[0].length;continue}}n.push({kind:"text",value:e[i]}),i++}return n}function eN(e){const n=[];let i=0;for(;i<e.length;){if(e[i]==="#"){const s=e.indexOf(`
|
|
94
|
-
`,i),o=s===-1?e.slice(i):e.slice(i,s);n.push({kind:"com",value:o}),i+=o.length;continue}if(e[i]==='"'||e[i]==="'"){const{slice:s,length:o}=As(e,i,e[i],e[i]);n.push({kind:"str",value:s}),i+=o;continue}if(/[a-zA-Z_]/.test(e[i])){const s=e.slice(i).match(/^[a-zA-Z_][\w-]*/);if(s){e.slice(i+s[0].length).trimStart().startsWith(":")?n.push({kind:"attr",value:s[0]}):["true","false","null","yes","no","on","off"].includes(s[0])?n.push({kind:"key",value:s[0]}):n.push({kind:"text",value:s[0]}),i+=s[0].length;continue}}if(/[0-9\-]/.test(e[i])){const s=e.slice(i).match(/^-?[\d]*\.?[\d]+/);if(s){n.push({kind:"num",value:s[0]}),i+=s[0].length;continue}}n.push({kind:"text",value:e[i]}),i++}return n}function As(e,n,i,s){let o=n+i.length;for(;o<e.length;){if(e[o]==="\\"){o+=2;continue}if(e.startsWith(s,o)){o+=s.length;break}if(s!=="`"&&e[o]===`
|
|
95
|
-
`)break;o++}return{slice:e.slice(n,o),length:o-n}}function tN({content:e,lang:n,truncated:i}){const s=N.useMemo(()=>nN(e,n),[e,n]);return u.jsxs("div",{className:"fexp-code-wrap",children:[i&&u.jsx("div",{className:"fexp-truncated-badge",children:"File is too large — showing a partial preview"}),u.jsx("div",{className:"fexp-code-scroll",children:u.jsx("table",{className:"fexp-code-table","aria-label":"File contents",children:u.jsx("tbody",{children:s.map((o,f)=>u.jsxs("tr",{className:"fexp-code-row",children:[u.jsx("td",{className:"fexp-line-num","aria-hidden":"true",children:f+1}),u.jsx("td",{className:"fexp-line-code",dangerouslySetInnerHTML:{__html:o}})]},f))})})})]})}function nN(e,n){return e.split(`
|
|
96
|
-
`).map(s=>iN(s,n))}function iN(e,n){return n==="plaintext"||n==="markdown"?ay(e)||" ":G4(e,n).map(s=>{const o=ay(s.value);return s.kind==="text"?o:`<span class="syn-${s.kind}">${o}</span>`}).join("")||" "}function ay(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""")}function rN({src:e,name:n}){return u.jsxs("div",{className:"fexp-img-wrap",children:[u.jsx("div",{className:"fexp-img-stage",children:u.jsx("img",{src:e,alt:n,className:"fexp-img",draggable:!1})}),u.jsx("figcaption",{className:"fexp-img-caption",children:n})]})}function Am(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var oa=Am();function Wx(e){oa=e}var $l={exec:()=>null};function _t(e,n=""){let i=typeof e=="string"?e:e.source,s={replace:(o,f)=>{let _=typeof f=="string"?f:f.source;return _=_.replace(Vn.caret,"$1"),i=i.replace(o,_),s},getRegex:()=>new RegExp(i,n)};return s}var sN=(()=>{try{return!!new RegExp("(?<=1)(?<!1)")}catch{return!1}})(),Vn={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")},aN=/^(?:[ \t]*(?:\n|$))+/,oN=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,lN=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,sc=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,cN=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,Rm=/(?:[*+-]|\d{1,9}[.)])/,Gx=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,qx=_t(Gx).replace(/bull/g,Rm).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(),uN=_t(Gx).replace(/bull/g,Rm).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(),Lm=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,hN=/^[^\n]+/,Mm=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,dN=_t(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",Mm).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),fN=_t(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,Rm).getRegex(),Mh="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",Nm=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,pN=_t("^ {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",Nm).replace("tag",Mh).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Kx=_t(Lm).replace("hr",sc).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",Mh).getRegex(),gN=_t(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",Kx).getRegex(),Om={blockquote:gN,code:oN,def:dN,fences:lN,heading:cN,hr:sc,html:pN,lheading:qx,list:fN,newline:aN,paragraph:Kx,table:$l,text:hN},oy=_t("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",sc).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",Mh).getRegex(),mN={...Om,lheading:uN,table:oy,paragraph:_t(Lm).replace("hr",sc).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",oy).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",Mh).getRegex()},_N={...Om,html:_t(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",Nm).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:$l,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:_t(Lm).replace("hr",sc).replace("heading",` *#{1,6} *[^
|
|
97
|
-
]`).replace("lheading",qx).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},vN=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,bN=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,Vx=/^( {2,}|\\)\n(?!\s*$)/,yN=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,Nh=/[\p{P}\p{S}]/u,Dm=/[\s\p{P}\p{S}]/u,Yx=/[^\s\p{P}\p{S}]/u,SN=_t(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,Dm).getRegex(),Xx=/(?!~)[\p{P}\p{S}]/u,wN=/(?!~)[\s\p{P}\p{S}]/u,xN=/(?:[^\s\p{P}\p{S}]|~)/u,CN=_t(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",sN?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),Zx=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,EN=_t(Zx,"u").replace(/punct/g,Nh).getRegex(),kN=_t(Zx,"u").replace(/punct/g,Xx).getRegex(),Jx="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",TN=_t(Jx,"gu").replace(/notPunctSpace/g,Yx).replace(/punctSpace/g,Dm).replace(/punct/g,Nh).getRegex(),AN=_t(Jx,"gu").replace(/notPunctSpace/g,xN).replace(/punctSpace/g,wN).replace(/punct/g,Xx).getRegex(),RN=_t("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,Yx).replace(/punctSpace/g,Dm).replace(/punct/g,Nh).getRegex(),LN=_t(/\\(punct)/,"gu").replace(/punct/g,Nh).getRegex(),MN=_t(/^<(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(),NN=_t(Nm).replace("(?:-->|$)","-->").getRegex(),ON=_t("^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",NN).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),uh=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+[^`]*?`+(?!`)|[^\[\]\\`])*?/,DN=_t(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",uh).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),Qx=_t(/^!?\[(label)\]\[(ref)\]/).replace("label",uh).replace("ref",Mm).getRegex(),eC=_t(/^!?\[(ref)\](?:\[\])?/).replace("ref",Mm).getRegex(),jN=_t("reflink|nolink(?!\\()","g").replace("reflink",Qx).replace("nolink",eC).getRegex(),ly=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,jm={_backpedal:$l,anyPunctuation:LN,autolink:MN,blockSkip:CN,br:Vx,code:bN,del:$l,emStrongLDelim:EN,emStrongRDelimAst:TN,emStrongRDelimUnd:RN,escape:vN,link:DN,nolink:eC,punctuation:SN,reflink:Qx,reflinkSearch:jN,tag:ON,text:yN,url:$l},IN={...jm,link:_t(/^!?\[(label)\]\((.*?)\)/).replace("label",uh).getRegex(),reflink:_t(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",uh).getRegex()},xg={...jm,emStrongRDelimAst:AN,emStrongLDelim:kN,url:_t(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",ly).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:_t(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",ly).getRegex()},BN={...xg,br:_t(Vx).replace("{2,}","*").getRegex(),text:_t(xg.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},Ru={normal:Om,gfm:mN,pedantic:_N},xl={normal:jm,gfm:xg,breaks:BN,pedantic:IN},PN={"&":"&","<":"<",">":">",'"':""","'":"'"},cy=e=>PN[e];function ar(e,n){if(n){if(Vn.escapeTest.test(e))return e.replace(Vn.escapeReplace,cy)}else if(Vn.escapeTestNoEncode.test(e))return e.replace(Vn.escapeReplaceNoEncode,cy);return e}function uy(e){try{e=encodeURI(e).replace(Vn.percentDecode,"%")}catch{return null}return e}function hy(e,n){let i=e.replace(Vn.findPipe,(f,_,c)=>{let h=!1,d=_;for(;--d>=0&&c[d]==="\\";)h=!h;return h?"|":" |"}),s=i.split(Vn.splitPipe),o=0;if(s[0].trim()||s.shift(),s.length>0&&!s.at(-1)?.trim()&&s.pop(),n)if(s.length>n)s.splice(n);else for(;s.length<n;)s.push("");for(;o<s.length;o++)s[o]=s[o].trim().replace(Vn.slashPipe,"|");return s}function Cl(e,n,i){let s=e.length;if(s===0)return"";let o=0;for(;o<s&&e.charAt(s-o-1)===n;)o++;return e.slice(0,s-o)}function zN(e,n){if(e.indexOf(n[1])===-1)return-1;let i=0;for(let s=0;s<e.length;s++)if(e[s]==="\\")s++;else if(e[s]===n[0])i++;else if(e[s]===n[1]&&(i--,i<0))return s;return i>0?-2:-1}function dy(e,n,i,s,o){let f=n.href,_=n.title||null,c=e[1].replace(o.other.outputLinkReplace,"$1");s.state.inLink=!0;let h={type:e[0].charAt(0)==="!"?"image":"link",raw:i,href:f,title:_,text:c,tokens:s.inlineTokens(c)};return s.state.inLink=!1,h}function HN(e,n,i){let s=e.match(i.other.indentCodeCompensation);if(s===null)return n;let o=s[1];return n.split(`
|
|
98
|
-
`).map(f=>{let _=f.match(i.other.beginningSpace);if(_===null)return f;let[c]=_;return c.length>=o.length?f.slice(o.length):f}).join(`
|
|
99
|
-
`)}var hh=class{options;rules;lexer;constructor(e){this.options=e||oa}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 i=n[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:n[0],codeBlockStyle:"indented",text:this.options.pedantic?i:Cl(i,`
|
|
100
|
-
`)}}}fences(e){let n=this.rules.block.fences.exec(e);if(n){let i=n[0],s=HN(i,n[3]||"",this.rules);return{type:"code",raw:i,lang:n[2]?n[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):n[2],text:s}}}heading(e){let n=this.rules.block.heading.exec(e);if(n){let i=n[2].trim();if(this.rules.other.endingHash.test(i)){let s=Cl(i,"#");(this.options.pedantic||!s||this.rules.other.endingSpaceChar.test(s))&&(i=s.trim())}return{type:"heading",raw:n[0],depth:n[1].length,text:i,tokens:this.lexer.inline(i)}}}hr(e){let n=this.rules.block.hr.exec(e);if(n)return{type:"hr",raw:Cl(n[0],`
|
|
101
|
-
`)}}blockquote(e){let n=this.rules.block.blockquote.exec(e);if(n){let i=Cl(n[0],`
|
|
102
|
-
`).split(`
|
|
103
|
-
`),s="",o="",f=[];for(;i.length>0;){let _=!1,c=[],h;for(h=0;h<i.length;h++)if(this.rules.other.blockquoteStart.test(i[h]))c.push(i[h]),_=!0;else if(!_)c.push(i[h]);else break;i=i.slice(h);let d=c.join(`
|
|
104
|
-
`),y=d.replace(this.rules.other.blockquoteSetextReplace,`
|
|
105
|
-
$1`).replace(this.rules.other.blockquoteSetextReplace2,"");s=s?`${s}
|
|
106
|
-
${d}`:d,o=o?`${o}
|
|
107
|
-
${y}`:y;let p=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(y,f,!0),this.lexer.state.top=p,i.length===0)break;let w=f.at(-1);if(w?.type==="code")break;if(w?.type==="blockquote"){let C=w,T=C.raw+`
|
|
108
|
-
`+i.join(`
|
|
109
|
-
`),E=this.blockquote(T);f[f.length-1]=E,s=s.substring(0,s.length-C.raw.length)+E.raw,o=o.substring(0,o.length-C.text.length)+E.text;break}else if(w?.type==="list"){let C=w,T=C.raw+`
|
|
110
|
-
`+i.join(`
|
|
111
|
-
`),E=this.list(T);f[f.length-1]=E,s=s.substring(0,s.length-w.raw.length)+E.raw,o=o.substring(0,o.length-C.raw.length)+E.raw,i=T.substring(f.at(-1).raw.length).split(`
|
|
112
|
-
`);continue}}return{type:"blockquote",raw:s,tokens:f,text:o}}}list(e){let n=this.rules.block.list.exec(e);if(n){let i=n[1].trim(),s=i.length>1,o={type:"list",raw:"",ordered:s,start:s?+i.slice(0,-1):"",loose:!1,items:[]};i=s?`\\d{1,9}\\${i.slice(-1)}`:`\\${i}`,this.options.pedantic&&(i=s?i:"[*+-]");let f=this.rules.other.listItemRegex(i),_=!1;for(;e;){let h=!1,d="",y="";if(!(n=f.exec(e))||this.rules.block.hr.test(e))break;d=n[0],e=e.substring(d.length);let p=n[2].split(`
|
|
113
|
-
`,1)[0].replace(this.rules.other.listReplaceTabs,v=>" ".repeat(3*v.length)),w=e.split(`
|
|
114
|
-
`,1)[0],C=!p.trim(),T=0;if(this.options.pedantic?(T=2,y=p.trimStart()):C?T=n[1].length+1:(T=n[2].search(this.rules.other.nonSpaceChar),T=T>4?1:T,y=p.slice(T),T+=n[1].length),C&&this.rules.other.blankLine.test(w)&&(d+=w+`
|
|
115
|
-
`,e=e.substring(w.length+1),h=!0),!h){let v=this.rules.other.nextBulletRegex(T),m=this.rules.other.hrRegex(T),S=this.rules.other.fencesBeginRegex(T),k=this.rules.other.headingBeginRegex(T),L=this.rules.other.htmlBeginRegex(T);for(;e;){let R=e.split(`
|
|
116
|
-
`,1)[0],M;if(w=R,this.options.pedantic?(w=w.replace(this.rules.other.listReplaceNesting," "),M=w):M=w.replace(this.rules.other.tabCharGlobal," "),S.test(w)||k.test(w)||L.test(w)||v.test(w)||m.test(w))break;if(M.search(this.rules.other.nonSpaceChar)>=T||!w.trim())y+=`
|
|
117
|
-
`+M.slice(T);else{if(C||p.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||S.test(p)||k.test(p)||m.test(p))break;y+=`
|
|
118
|
-
`+w}!C&&!w.trim()&&(C=!0),d+=R+`
|
|
119
|
-
`,e=e.substring(R.length+1),p=M.slice(T)}}o.loose||(_?o.loose=!0:this.rules.other.doubleBlankLine.test(d)&&(_=!0));let E=null,g;this.options.gfm&&(E=this.rules.other.listIsTask.exec(y),E&&(g=E[0]!=="[ ] ",y=y.replace(this.rules.other.listReplaceTask,""))),o.items.push({type:"list_item",raw:d,task:!!E,checked:g,loose:!1,text:y,tokens:[]}),o.raw+=d}let c=o.items.at(-1);if(c)c.raw=c.raw.trimEnd(),c.text=c.text.trimEnd();else return;o.raw=o.raw.trimEnd();for(let h=0;h<o.items.length;h++)if(this.lexer.state.top=!1,o.items[h].tokens=this.lexer.blockTokens(o.items[h].text,[]),!o.loose){let d=o.items[h].tokens.filter(p=>p.type==="space"),y=d.length>0&&d.some(p=>this.rules.other.anyLine.test(p.raw));o.loose=y}if(o.loose)for(let h=0;h<o.items.length;h++)o.items[h].loose=!0;return o}}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 i=n[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),s=n[2]?n[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",o=n[3]?n[3].substring(1,n[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):n[3];return{type:"def",tag:i,raw:n[0],href:s,title:o}}}table(e){let n=this.rules.block.table.exec(e);if(!n||!this.rules.other.tableDelimiter.test(n[2]))return;let i=hy(n[1]),s=n[2].replace(this.rules.other.tableAlignChars,"").split("|"),o=n[3]?.trim()?n[3].replace(this.rules.other.tableRowBlankLine,"").split(`
|
|
120
|
-
`):[],f={type:"table",raw:n[0],header:[],align:[],rows:[]};if(i.length===s.length){for(let _ of s)this.rules.other.tableAlignRight.test(_)?f.align.push("right"):this.rules.other.tableAlignCenter.test(_)?f.align.push("center"):this.rules.other.tableAlignLeft.test(_)?f.align.push("left"):f.align.push(null);for(let _=0;_<i.length;_++)f.header.push({text:i[_],tokens:this.lexer.inline(i[_]),header:!0,align:f.align[_]});for(let _ of o)f.rows.push(hy(_,f.header.length).map((c,h)=>({text:c,tokens:this.lexer.inline(c),header:!1,align:f.align[h]})));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 i=n[1].charAt(n[1].length-1)===`
|
|
121
|
-
`?n[1].slice(0,-1):n[1];return{type:"paragraph",raw:n[0],text:i,tokens:this.lexer.inline(i)}}}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 i=n[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(i)){if(!this.rules.other.endAngleBracket.test(i))return;let f=Cl(i.slice(0,-1),"\\");if((i.length-f.length)%2===0)return}else{let f=zN(n[2],"()");if(f===-2)return;if(f>-1){let _=(n[0].indexOf("!")===0?5:4)+n[1].length+f;n[2]=n[2].substring(0,f),n[0]=n[0].substring(0,_).trim(),n[3]=""}}let s=n[2],o="";if(this.options.pedantic){let f=this.rules.other.pedanticHrefTitle.exec(s);f&&(s=f[1],o=f[3])}else o=n[3]?n[3].slice(1,-1):"";return s=s.trim(),this.rules.other.startAngleBracket.test(s)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(i)?s=s.slice(1):s=s.slice(1,-1)),dy(n,{href:s&&s.replace(this.rules.inline.anyPunctuation,"$1"),title:o&&o.replace(this.rules.inline.anyPunctuation,"$1")},n[0],this.lexer,this.rules)}}reflink(e,n){let i;if((i=this.rules.inline.reflink.exec(e))||(i=this.rules.inline.nolink.exec(e))){let s=(i[2]||i[1]).replace(this.rules.other.multipleSpaceGlobal," "),o=n[s.toLowerCase()];if(!o){let f=i[0].charAt(0);return{type:"text",raw:f,text:f}}return dy(i,o,i[0],this.lexer,this.rules)}}emStrong(e,n,i=""){let s=this.rules.inline.emStrongLDelim.exec(e);if(!(!s||s[3]&&i.match(this.rules.other.unicodeAlphaNumeric))&&(!(s[1]||s[2])||!i||this.rules.inline.punctuation.exec(i))){let o=[...s[0]].length-1,f,_,c=o,h=0,d=s[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(d.lastIndex=0,n=n.slice(-1*e.length+o);(s=d.exec(n))!=null;){if(f=s[1]||s[2]||s[3]||s[4]||s[5]||s[6],!f)continue;if(_=[...f].length,s[3]||s[4]){c+=_;continue}else if((s[5]||s[6])&&o%3&&!((o+_)%3)){h+=_;continue}if(c-=_,c>0)continue;_=Math.min(_,_+c+h);let y=[...s[0]][0].length,p=e.slice(0,o+s.index+y+_);if(Math.min(o,_)%2){let C=p.slice(1,-1);return{type:"em",raw:p,text:C,tokens:this.lexer.inlineTokens(C)}}let w=p.slice(2,-2);return{type:"strong",raw:p,text:w,tokens:this.lexer.inlineTokens(w)}}}}codespan(e){let n=this.rules.inline.code.exec(e);if(n){let i=n[2].replace(this.rules.other.newLineCharGlobal," "),s=this.rules.other.nonSpaceChar.test(i),o=this.rules.other.startingSpaceChar.test(i)&&this.rules.other.endingSpaceChar.test(i);return s&&o&&(i=i.substring(1,i.length-1)),{type:"codespan",raw:n[0],text:i}}}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 i,s;return n[2]==="@"?(i=n[1],s="mailto:"+i):(i=n[1],s=i),{type:"link",raw:n[0],text:i,href:s,tokens:[{type:"text",raw:i,text:i}]}}}url(e){let n;if(n=this.rules.inline.url.exec(e)){let i,s;if(n[2]==="@")i=n[0],s="mailto:"+i;else{let o;do o=n[0],n[0]=this.rules.inline._backpedal.exec(n[0])?.[0]??"";while(o!==n[0]);i=n[0],n[1]==="www."?s="http://"+n[0]:s=n[0]}return{type:"link",raw:n[0],text:i,href:s,tokens:[{type:"text",raw:i,text:i}]}}}inlineText(e){let n=this.rules.inline.text.exec(e);if(n){let i=this.lexer.state.inRawBlock;return{type:"text",raw:n[0],text:n[0],escaped:i}}}},Ki=class Cg{tokens;options;state;tokenizer;inlineQueue;constructor(n){this.tokens=[],this.tokens.links=Object.create(null),this.options=n||oa,this.options.tokenizer=this.options.tokenizer||new hh,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 i={other:Vn,block:Ru.normal,inline:xl.normal};this.options.pedantic?(i.block=Ru.pedantic,i.inline=xl.pedantic):this.options.gfm&&(i.block=Ru.gfm,this.options.breaks?i.inline=xl.breaks:i.inline=xl.gfm),this.tokenizer.rules=i}static get rules(){return{block:Ru,inline:xl}}static lex(n,i){return new Cg(i).lex(n)}static lexInline(n,i){return new Cg(i).inlineTokens(n)}lex(n){n=n.replace(Vn.carriageReturn,`
|
|
122
|
-
`),this.blockTokens(n,this.tokens);for(let i=0;i<this.inlineQueue.length;i++){let s=this.inlineQueue[i];this.inlineTokens(s.src,s.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(n,i=[],s=!1){for(this.options.pedantic&&(n=n.replace(Vn.tabCharGlobal," ").replace(Vn.spaceLine,""));n;){let o;if(this.options.extensions?.block?.some(_=>(o=_.call({lexer:this},n,i))?(n=n.substring(o.raw.length),i.push(o),!0):!1))continue;if(o=this.tokenizer.space(n)){n=n.substring(o.raw.length);let _=i.at(-1);o.raw.length===1&&_!==void 0?_.raw+=`
|
|
123
|
-
`:i.push(o);continue}if(o=this.tokenizer.code(n)){n=n.substring(o.raw.length);let _=i.at(-1);_?.type==="paragraph"||_?.type==="text"?(_.raw+=(_.raw.endsWith(`
|
|
124
|
-
`)?"":`
|
|
125
|
-
`)+o.raw,_.text+=`
|
|
126
|
-
`+o.text,this.inlineQueue.at(-1).src=_.text):i.push(o);continue}if(o=this.tokenizer.fences(n)){n=n.substring(o.raw.length),i.push(o);continue}if(o=this.tokenizer.heading(n)){n=n.substring(o.raw.length),i.push(o);continue}if(o=this.tokenizer.hr(n)){n=n.substring(o.raw.length),i.push(o);continue}if(o=this.tokenizer.blockquote(n)){n=n.substring(o.raw.length),i.push(o);continue}if(o=this.tokenizer.list(n)){n=n.substring(o.raw.length),i.push(o);continue}if(o=this.tokenizer.html(n)){n=n.substring(o.raw.length),i.push(o);continue}if(o=this.tokenizer.def(n)){n=n.substring(o.raw.length);let _=i.at(-1);_?.type==="paragraph"||_?.type==="text"?(_.raw+=(_.raw.endsWith(`
|
|
127
|
-
`)?"":`
|
|
128
|
-
`)+o.raw,_.text+=`
|
|
129
|
-
`+o.raw,this.inlineQueue.at(-1).src=_.text):this.tokens.links[o.tag]||(this.tokens.links[o.tag]={href:o.href,title:o.title},i.push(o));continue}if(o=this.tokenizer.table(n)){n=n.substring(o.raw.length),i.push(o);continue}if(o=this.tokenizer.lheading(n)){n=n.substring(o.raw.length),i.push(o);continue}let f=n;if(this.options.extensions?.startBlock){let _=1/0,c=n.slice(1),h;this.options.extensions.startBlock.forEach(d=>{h=d.call({lexer:this},c),typeof h=="number"&&h>=0&&(_=Math.min(_,h))}),_<1/0&&_>=0&&(f=n.substring(0,_+1))}if(this.state.top&&(o=this.tokenizer.paragraph(f))){let _=i.at(-1);s&&_?.type==="paragraph"?(_.raw+=(_.raw.endsWith(`
|
|
130
|
-
`)?"":`
|
|
131
|
-
`)+o.raw,_.text+=`
|
|
132
|
-
`+o.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=_.text):i.push(o),s=f.length!==n.length,n=n.substring(o.raw.length);continue}if(o=this.tokenizer.text(n)){n=n.substring(o.raw.length);let _=i.at(-1);_?.type==="text"?(_.raw+=(_.raw.endsWith(`
|
|
133
|
-
`)?"":`
|
|
134
|
-
`)+o.raw,_.text+=`
|
|
135
|
-
`+o.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=_.text):i.push(o);continue}if(n){let _="Infinite loop on byte: "+n.charCodeAt(0);if(this.options.silent){console.error(_);break}else throw new Error(_)}}return this.state.top=!0,i}inline(n,i=[]){return this.inlineQueue.push({src:n,tokens:i}),i}inlineTokens(n,i=[]){let s=n,o=null;if(this.tokens.links){let h=Object.keys(this.tokens.links);if(h.length>0)for(;(o=this.tokenizer.rules.inline.reflinkSearch.exec(s))!=null;)h.includes(o[0].slice(o[0].lastIndexOf("[")+1,-1))&&(s=s.slice(0,o.index)+"["+"a".repeat(o[0].length-2)+"]"+s.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(o=this.tokenizer.rules.inline.anyPunctuation.exec(s))!=null;)s=s.slice(0,o.index)+"++"+s.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);let f;for(;(o=this.tokenizer.rules.inline.blockSkip.exec(s))!=null;)f=o[2]?o[2].length:0,s=s.slice(0,o.index+f)+"["+"a".repeat(o[0].length-f-2)+"]"+s.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);s=this.options.hooks?.emStrongMask?.call({lexer:this},s)??s;let _=!1,c="";for(;n;){_||(c=""),_=!1;let h;if(this.options.extensions?.inline?.some(y=>(h=y.call({lexer:this},n,i))?(n=n.substring(h.raw.length),i.push(h),!0):!1))continue;if(h=this.tokenizer.escape(n)){n=n.substring(h.raw.length),i.push(h);continue}if(h=this.tokenizer.tag(n)){n=n.substring(h.raw.length),i.push(h);continue}if(h=this.tokenizer.link(n)){n=n.substring(h.raw.length),i.push(h);continue}if(h=this.tokenizer.reflink(n,this.tokens.links)){n=n.substring(h.raw.length);let y=i.at(-1);h.type==="text"&&y?.type==="text"?(y.raw+=h.raw,y.text+=h.text):i.push(h);continue}if(h=this.tokenizer.emStrong(n,s,c)){n=n.substring(h.raw.length),i.push(h);continue}if(h=this.tokenizer.codespan(n)){n=n.substring(h.raw.length),i.push(h);continue}if(h=this.tokenizer.br(n)){n=n.substring(h.raw.length),i.push(h);continue}if(h=this.tokenizer.del(n)){n=n.substring(h.raw.length),i.push(h);continue}if(h=this.tokenizer.autolink(n)){n=n.substring(h.raw.length),i.push(h);continue}if(!this.state.inLink&&(h=this.tokenizer.url(n))){n=n.substring(h.raw.length),i.push(h);continue}let d=n;if(this.options.extensions?.startInline){let y=1/0,p=n.slice(1),w;this.options.extensions.startInline.forEach(C=>{w=C.call({lexer:this},p),typeof w=="number"&&w>=0&&(y=Math.min(y,w))}),y<1/0&&y>=0&&(d=n.substring(0,y+1))}if(h=this.tokenizer.inlineText(d)){n=n.substring(h.raw.length),h.raw.slice(-1)!=="_"&&(c=h.raw.slice(-1)),_=!0;let y=i.at(-1);y?.type==="text"?(y.raw+=h.raw,y.text+=h.text):i.push(h);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 i}},dh=class{options;parser;constructor(e){this.options=e||oa}space(e){return""}code({text:e,lang:n,escaped:i}){let s=(n||"").match(Vn.notSpaceStart)?.[0],o=e.replace(Vn.endingNewline,"")+`
|
|
136
|
-
`;return s?'<pre><code class="language-'+ar(s)+'">'+(i?o:ar(o,!0))+`</code></pre>
|
|
137
|
-
`:"<pre><code>"+(i?o:ar(o,!0))+`</code></pre>
|
|
138
|
-
`}blockquote({tokens:e}){return`<blockquote>
|
|
139
|
-
${this.parser.parse(e)}</blockquote>
|
|
140
|
-
`}html({text:e}){return e}def(e){return""}heading({tokens:e,depth:n}){return`<h${n}>${this.parser.parseInline(e)}</h${n}>
|
|
141
|
-
`}hr(e){return`<hr>
|
|
142
|
-
`}list(e){let n=e.ordered,i=e.start,s="";for(let _=0;_<e.items.length;_++){let c=e.items[_];s+=this.listitem(c)}let o=n?"ol":"ul",f=n&&i!==1?' start="'+i+'"':"";return"<"+o+f+`>
|
|
143
|
-
`+s+"</"+o+`>
|
|
144
|
-
`}listitem(e){let n="";if(e.task){let i=this.checkbox({checked:!!e.checked});e.loose?e.tokens[0]?.type==="paragraph"?(e.tokens[0].text=i+" "+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=i+" "+ar(e.tokens[0].tokens[0].text),e.tokens[0].tokens[0].escaped=!0)):e.tokens.unshift({type:"text",raw:i+" ",text:i+" ",escaped:!0}):n+=i+" "}return n+=this.parser.parse(e.tokens,!!e.loose),`<li>${n}</li>
|
|
145
|
-
`}checkbox({checked:e}){return"<input "+(e?'checked="" ':"")+'disabled="" type="checkbox">'}paragraph({tokens:e}){return`<p>${this.parser.parseInline(e)}</p>
|
|
146
|
-
`}table(e){let n="",i="";for(let o=0;o<e.header.length;o++)i+=this.tablecell(e.header[o]);n+=this.tablerow({text:i});let s="";for(let o=0;o<e.rows.length;o++){let f=e.rows[o];i="";for(let _=0;_<f.length;_++)i+=this.tablecell(f[_]);s+=this.tablerow({text:i})}return s&&(s=`<tbody>${s}</tbody>`),`<table>
|
|
147
|
-
<thead>
|
|
148
|
-
`+n+`</thead>
|
|
149
|
-
`+s+`</table>
|
|
150
|
-
`}tablerow({text:e}){return`<tr>
|
|
151
|
-
${e}</tr>
|
|
152
|
-
`}tablecell(e){let n=this.parser.parseInline(e.tokens),i=e.header?"th":"td";return(e.align?`<${i} align="${e.align}">`:`<${i}>`)+n+`</${i}>
|
|
153
|
-
`}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>${ar(e,!0)}</code>`}br(e){return"<br>"}del({tokens:e}){return`<del>${this.parser.parseInline(e)}</del>`}link({href:e,title:n,tokens:i}){let s=this.parser.parseInline(i),o=uy(e);if(o===null)return s;e=o;let f='<a href="'+e+'"';return n&&(f+=' title="'+ar(n)+'"'),f+=">"+s+"</a>",f}image({href:e,title:n,text:i,tokens:s}){s&&(i=this.parser.parseInline(s,this.parser.textRenderer));let o=uy(e);if(o===null)return ar(i);e=o;let f=`<img src="${e}" alt="${i}"`;return n&&(f+=` title="${ar(n)}"`),f+=">",f}text(e){return"tokens"in e&&e.tokens?this.parser.parseInline(e.tokens):"escaped"in e&&e.escaped?e.text:ar(e.text)}},Im=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""}},Vi=class Eg{options;renderer;textRenderer;constructor(n){this.options=n||oa,this.options.renderer=this.options.renderer||new dh,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new Im}static parse(n,i){return new Eg(i).parse(n)}static parseInline(n,i){return new Eg(i).parseInline(n)}parse(n,i=!0){let s="";for(let o=0;o<n.length;o++){let f=n[o];if(this.options.extensions?.renderers?.[f.type]){let c=f,h=this.options.extensions.renderers[c.type].call({parser:this},c);if(h!==!1||!["space","hr","heading","code","table","blockquote","list","html","def","paragraph","text"].includes(c.type)){s+=h||"";continue}}let _=f;switch(_.type){case"space":{s+=this.renderer.space(_);continue}case"hr":{s+=this.renderer.hr(_);continue}case"heading":{s+=this.renderer.heading(_);continue}case"code":{s+=this.renderer.code(_);continue}case"table":{s+=this.renderer.table(_);continue}case"blockquote":{s+=this.renderer.blockquote(_);continue}case"list":{s+=this.renderer.list(_);continue}case"html":{s+=this.renderer.html(_);continue}case"def":{s+=this.renderer.def(_);continue}case"paragraph":{s+=this.renderer.paragraph(_);continue}case"text":{let c=_,h=this.renderer.text(c);for(;o+1<n.length&&n[o+1].type==="text";)c=n[++o],h+=`
|
|
154
|
-
`+this.renderer.text(c);i?s+=this.renderer.paragraph({type:"paragraph",raw:h,text:h,tokens:[{type:"text",raw:h,text:h,escaped:!0}]}):s+=h;continue}default:{let c='Token with "'+_.type+'" type was not found.';if(this.options.silent)return console.error(c),"";throw new Error(c)}}}return s}parseInline(n,i=this.renderer){let s="";for(let o=0;o<n.length;o++){let f=n[o];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)){s+=c||"";continue}}let _=f;switch(_.type){case"escape":{s+=i.text(_);break}case"html":{s+=i.html(_);break}case"link":{s+=i.link(_);break}case"image":{s+=i.image(_);break}case"strong":{s+=i.strong(_);break}case"em":{s+=i.em(_);break}case"codespan":{s+=i.codespan(_);break}case"br":{s+=i.br(_);break}case"del":{s+=i.del(_);break}case"text":{s+=i.text(_);break}default:{let c='Token with "'+_.type+'" type was not found.';if(this.options.silent)return console.error(c),"";throw new Error(c)}}}return s}},jl=class{options;block;constructor(e){this.options=e||oa}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?Ki.lex:Ki.lexInline}provideParser(){return this.block?Vi.parse:Vi.parseInline}},tC=class{defaults=Am();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=Vi;Renderer=dh;TextRenderer=Im;Lexer=Ki;Tokenizer=hh;Hooks=jl;constructor(...e){this.use(...e)}walkTokens(e,n){let i=[];for(let s of e)switch(i=i.concat(n.call(this,s)),s.type){case"table":{let o=s;for(let f of o.header)i=i.concat(this.walkTokens(f.tokens,n));for(let f of o.rows)for(let _ of f)i=i.concat(this.walkTokens(_.tokens,n));break}case"list":{let o=s;i=i.concat(this.walkTokens(o.items,n));break}default:{let o=s;this.defaults.extensions?.childTokens?.[o.type]?this.defaults.extensions.childTokens[o.type].forEach(f=>{let _=o[f].flat(1/0);i=i.concat(this.walkTokens(_,n))}):o.tokens&&(i=i.concat(this.walkTokens(o.tokens,n)))}}return i}use(...e){let n=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(i=>{let s={...i};if(s.async=this.defaults.async||s.async||!1,i.extensions&&(i.extensions.forEach(o=>{if(!o.name)throw new Error("extension name required");if("renderer"in o){let f=n.renderers[o.name];f?n.renderers[o.name]=function(..._){let c=o.renderer.apply(this,_);return c===!1&&(c=f.apply(this,_)),c}:n.renderers[o.name]=o.renderer}if("tokenizer"in o){if(!o.level||o.level!=="block"&&o.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let f=n[o.level];f?f.unshift(o.tokenizer):n[o.level]=[o.tokenizer],o.start&&(o.level==="block"?n.startBlock?n.startBlock.push(o.start):n.startBlock=[o.start]:o.level==="inline"&&(n.startInline?n.startInline.push(o.start):n.startInline=[o.start]))}"childTokens"in o&&o.childTokens&&(n.childTokens[o.name]=o.childTokens)}),s.extensions=n),i.renderer){let o=this.defaults.renderer||new dh(this.defaults);for(let f in i.renderer){if(!(f in o))throw new Error(`renderer '${f}' does not exist`);if(["options","parser"].includes(f))continue;let _=f,c=i.renderer[_],h=o[_];o[_]=(...d)=>{let y=c.apply(o,d);return y===!1&&(y=h.apply(o,d)),y||""}}s.renderer=o}if(i.tokenizer){let o=this.defaults.tokenizer||new hh(this.defaults);for(let f in i.tokenizer){if(!(f in o))throw new Error(`tokenizer '${f}' does not exist`);if(["options","rules","lexer"].includes(f))continue;let _=f,c=i.tokenizer[_],h=o[_];o[_]=(...d)=>{let y=c.apply(o,d);return y===!1&&(y=h.apply(o,d)),y}}s.tokenizer=o}if(i.hooks){let o=this.defaults.hooks||new jl;for(let f in i.hooks){if(!(f in o))throw new Error(`hook '${f}' does not exist`);if(["options","block"].includes(f))continue;let _=f,c=i.hooks[_],h=o[_];jl.passThroughHooks.has(f)?o[_]=d=>{if(this.defaults.async&&jl.passThroughHooksRespectAsync.has(f))return(async()=>{let p=await c.call(o,d);return h.call(o,p)})();let y=c.call(o,d);return h.call(o,y)}:o[_]=(...d)=>{if(this.defaults.async)return(async()=>{let p=await c.apply(o,d);return p===!1&&(p=await h.apply(o,d)),p})();let y=c.apply(o,d);return y===!1&&(y=h.apply(o,d)),y}}s.hooks=o}if(i.walkTokens){let o=this.defaults.walkTokens,f=i.walkTokens;s.walkTokens=function(_){let c=[];return c.push(f.call(this,_)),o&&(c=c.concat(o.call(this,_))),c}}this.defaults={...this.defaults,...s}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,n){return Ki.lex(e,n??this.defaults)}parser(e,n){return Vi.parse(e,n??this.defaults)}parseMarkdown(e){return(n,i)=>{let s={...i},o={...this.defaults,...s},f=this.onError(!!o.silent,!!o.async);if(this.defaults.async===!0&&s.async===!1)return f(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 n>"u"||n===null)return f(new Error("marked(): input parameter is undefined or null"));if(typeof n!="string")return f(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(n)+", string expected"));if(o.hooks&&(o.hooks.options=o,o.hooks.block=e),o.async)return(async()=>{let _=o.hooks?await o.hooks.preprocess(n):n,c=await(o.hooks?await o.hooks.provideLexer():e?Ki.lex:Ki.lexInline)(_,o),h=o.hooks?await o.hooks.processAllTokens(c):c;o.walkTokens&&await Promise.all(this.walkTokens(h,o.walkTokens));let d=await(o.hooks?await o.hooks.provideParser():e?Vi.parse:Vi.parseInline)(h,o);return o.hooks?await o.hooks.postprocess(d):d})().catch(f);try{o.hooks&&(n=o.hooks.preprocess(n));let _=(o.hooks?o.hooks.provideLexer():e?Ki.lex:Ki.lexInline)(n,o);o.hooks&&(_=o.hooks.processAllTokens(_)),o.walkTokens&&this.walkTokens(_,o.walkTokens);let c=(o.hooks?o.hooks.provideParser():e?Vi.parse:Vi.parseInline)(_,o);return o.hooks&&(c=o.hooks.postprocess(c)),c}catch(_){return f(_)}}}onError(e,n){return i=>{if(i.message+=`
|
|
155
|
-
Please report this to https://github.com/markedjs/marked.`,e){let s="<p>An error occurred:</p><pre>"+ar(i.message+"",!0)+"</pre>";return n?Promise.resolve(s):s}if(n)return Promise.reject(i);throw i}}},aa=new tC;function At(e,n){return aa.parse(e,n)}At.options=At.setOptions=function(e){return aa.setOptions(e),At.defaults=aa.defaults,Wx(At.defaults),At};At.getDefaults=Am;At.defaults=oa;At.use=function(...e){return aa.use(...e),At.defaults=aa.defaults,Wx(At.defaults),At};At.walkTokens=function(e,n){return aa.walkTokens(e,n)};At.parseInline=aa.parseInline;At.Parser=Vi;At.parser=Vi.parse;At.Renderer=dh;At.TextRenderer=Im;At.Lexer=Ki;At.lexer=Ki.lex;At.Tokenizer=hh;At.Hooks=jl;At.parse=At;At.options;At.setOptions;At.use;At.walkTokens;At.parseInline;Vi.parse;Ki.lex;const{entries:nC,setPrototypeOf:fy,isFrozen:$N,getPrototypeOf:UN,getOwnPropertyDescriptor:FN}=Object;let{freeze:Xn,seal:$i,create:Za}=Object,{apply:kg,construct:Tg}=typeof Reflect<"u"&&Reflect;Xn||(Xn=function(n){return n});$i||($i=function(n){return n});kg||(kg=function(n,i){for(var s=arguments.length,o=new Array(s>2?s-2:0),f=2;f<s;f++)o[f-2]=arguments[f];return n.apply(i,o)});Tg||(Tg=function(n){for(var i=arguments.length,s=new Array(i>1?i-1:0),o=1;o<i;o++)s[o-1]=arguments[o];return new n(...s)});const El=_n(Array.prototype.forEach),WN=_n(Array.prototype.lastIndexOf),py=_n(Array.prototype.pop),kl=_n(Array.prototype.push),GN=_n(Array.prototype.splice),Gn=Array.isArray,Il=_n(String.prototype.toLowerCase),hp=_n(String.prototype.toString),gy=_n(String.prototype.match),Va=_n(String.prototype.replace),my=_n(String.prototype.indexOf),qN=_n(String.prototype.trim),KN=_n(Number.prototype.toString),VN=_n(Boolean.prototype.toString),_y=typeof BigInt>"u"?null:_n(BigInt.prototype.toString),vy=typeof Symbol>"u"?null:_n(Symbol.prototype.toString),rn=_n(Object.prototype.hasOwnProperty),Tl=_n(Object.prototype.toString),In=_n(RegExp.prototype.test),Lu=YN(TypeError);function _n(e){return function(n){n instanceof RegExp&&(n.lastIndex=0);for(var i=arguments.length,s=new Array(i>1?i-1:0),o=1;o<i;o++)s[o-1]=arguments[o];return kg(e,n,s)}}function YN(e){return function(){for(var n=arguments.length,i=new Array(n),s=0;s<n;s++)i[s]=arguments[s];return Tg(e,i)}}function Xe(e,n){let i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Il;if(fy&&fy(e,null),!Gn(n))return e;let s=n.length;for(;s--;){let o=n[s];if(typeof o=="string"){const f=i(o);f!==o&&($N(n)||(n[s]=f),o=f)}e[o]=!0}return e}function XN(e){for(let n=0;n<e.length;n++)rn(e,n)||(e[n]=null);return e}function ci(e){const n=Za(null);for(const[i,s]of nC(e))rn(e,i)&&(Gn(s)?n[i]=XN(s):s&&typeof s=="object"&&s.constructor===Object?n[i]=ci(s):n[i]=s);return n}function ZN(e){switch(typeof e){case"string":return e;case"number":return KN(e);case"boolean":return VN(e);case"bigint":return _y?_y(e):"0";case"symbol":return vy?vy(e):"Symbol()";case"undefined":return Tl(e);case"function":case"object":{if(e===null)return Tl(e);const n=e,i=Ja(n,"toString");if(typeof i=="function"){const s=i(n);return typeof s=="string"?s:Tl(s)}return Tl(e)}default:return Tl(e)}}function Ja(e,n){for(;e!==null;){const s=FN(e,n);if(s){if(s.get)return _n(s.get);if(typeof s.value=="function")return _n(s.value)}e=UN(e)}function i(){return null}return i}function JN(e){try{return In(e,""),!0}catch{return!1}}const by=Xn(["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"]),dp=Xn(["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"]),fp=Xn(["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"]),QN=Xn(["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"]),pp=Xn(["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"]),eO=Xn(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),yy=Xn(["#text"]),Sy=Xn(["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"]),gp=Xn(["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"]),wy=Xn(["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"]),Mu=Xn(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),tO=$i(/\{\{[\w\W]*|[\w\W]*\}\}/gm),nO=$i(/<%[\w\W]*|[\w\W]*%>/gm),iO=$i(/\$\{[\w\W]*/gm),rO=$i(/^data-[\-\w.\u00B7-\uFFFF]+$/),sO=$i(/^aria-[\-\w]+$/),iC=$i(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),aO=$i(/^(?:\w+script|data):/i),oO=$i(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),rC=$i(/^html$/i),lO=$i(/^[a-z][.\w]*(-[.\w]+)+$/i);var xy=Object.freeze({__proto__:null,ARIA_ATTR:sO,ATTR_WHITESPACE:oO,CUSTOM_ELEMENT:lO,DATA_ATTR:rO,DOCTYPE_NAME:rC,ERB_EXPR:nO,IS_ALLOWED_URI:iC,IS_SCRIPT_OR_DATA:aO,MUSTACHE_EXPR:tO,TMPLIT_EXPR:iO});const Al={element:1,text:3,progressingInstruction:7,comment:8,document:9},cO=function(){return typeof window>"u"?null:window},uO=function(n,i){if(typeof n!="object"||typeof n.createPolicy!="function")return null;let s=null;const o="data-tt-policy-suffix";i&&i.hasAttribute(o)&&(s=i.getAttribute(o));const f="dompurify"+(s?"#"+s:"");try{return n.createPolicy(f,{createHTML(_){return _},createScriptURL(_){return _}})}catch{return console.warn("TrustedTypes policy "+f+" could not be created."),null}},Cy=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function sC(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:cO();const n=De=>sC(De);if(n.version="3.4.2",n.removed=[],!e||!e.document||e.document.nodeType!==Al.document||!e.Element)return n.isSupported=!1,n;let{document:i}=e;const s=i,o=s.currentScript,{DocumentFragment:f,HTMLTemplateElement:_,Node:c,Element:h,NodeFilter:d,NamedNodeMap:y=e.NamedNodeMap||e.MozNamedAttrMap,HTMLFormElement:p,DOMParser:w,trustedTypes:C}=e,T=h.prototype,E=Ja(T,"cloneNode"),g=Ja(T,"remove"),v=Ja(T,"nextSibling"),m=Ja(T,"childNodes"),S=Ja(T,"parentNode");if(typeof _=="function"){const De=i.createElement("template");De.content&&De.content.ownerDocument&&(i=De.content.ownerDocument)}let k,L="";const{implementation:R,createNodeIterator:M,createDocumentFragment:A,getElementsByTagName:B}=i,{importNode:K}=s;let F=Cy();n.isSupported=typeof nC=="function"&&typeof S=="function"&&R&&R.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:W,ERB_EXPR:I,TMPLIT_EXPR:Z,DATA_ATTR:X,ARIA_ATTR:z,IS_SCRIPT_OR_DATA:q,ATTR_WHITESPACE:V,CUSTOM_ELEMENT:j}=xy;let{IS_ALLOWED_URI:P}=xy,D=null;const U=Xe({},[...by,...dp,...fp,...pp,...yy]);let G=null;const Y=Xe({},[...Sy,...gp,...wy,...Mu]);let ie=Object.seal(Za(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}})),se=null,J=null;const H=Object.seal(Za(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let ae=!0,de=!0,we=!1,ye=!0,Le=!1,Oe=!0,Fe=!1,ut=!1,Me=!1,Rt=!1,Xt=!1,vn=!1,an=!0,kn=!1;const Zt="user-content-";let ht=!0,Lt=!1,Ct={},Ft=null;const Kt=Xe({},["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 Jn=null;const bn=Xe({},["audio","video","img","source","image","track"]);let Pn=null;const ft=Xe({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Tn="http://www.w3.org/1998/Math/MathML",ve="http://www.w3.org/2000/svg",$e="http://www.w3.org/1999/xhtml";let Ze=$e,at=!1,Ve=null;const on=Xe({},[Tn,ve,$e],hp);let Dt=Xe({},["mi","mo","mn","ms","mtext"]),An=Xe({},["annotation-xml"]);const Un=Xe({},["title","style","font","a","script"]);let jt=null;const ee=["application/xhtml+xml","text/html"],pe="text/html";let Se=null,je=null;const bt=i.createElement("form"),dt=function(Q){return Q instanceof RegExp||Q instanceof Function},ke=function(){let Q=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(je&&je===Q)return;(!Q||typeof Q!="object")&&(Q={}),Q=ci(Q),jt=ee.indexOf(Q.PARSER_MEDIA_TYPE)===-1?pe:Q.PARSER_MEDIA_TYPE,Se=jt==="application/xhtml+xml"?hp:Il,D=rn(Q,"ALLOWED_TAGS")&&Gn(Q.ALLOWED_TAGS)?Xe({},Q.ALLOWED_TAGS,Se):U,G=rn(Q,"ALLOWED_ATTR")&&Gn(Q.ALLOWED_ATTR)?Xe({},Q.ALLOWED_ATTR,Se):Y,Ve=rn(Q,"ALLOWED_NAMESPACES")&&Gn(Q.ALLOWED_NAMESPACES)?Xe({},Q.ALLOWED_NAMESPACES,hp):on,Pn=rn(Q,"ADD_URI_SAFE_ATTR")&&Gn(Q.ADD_URI_SAFE_ATTR)?Xe(ci(ft),Q.ADD_URI_SAFE_ATTR,Se):ft,Jn=rn(Q,"ADD_DATA_URI_TAGS")&&Gn(Q.ADD_DATA_URI_TAGS)?Xe(ci(bn),Q.ADD_DATA_URI_TAGS,Se):bn,Ft=rn(Q,"FORBID_CONTENTS")&&Gn(Q.FORBID_CONTENTS)?Xe({},Q.FORBID_CONTENTS,Se):Kt,se=rn(Q,"FORBID_TAGS")&&Gn(Q.FORBID_TAGS)?Xe({},Q.FORBID_TAGS,Se):ci({}),J=rn(Q,"FORBID_ATTR")&&Gn(Q.FORBID_ATTR)?Xe({},Q.FORBID_ATTR,Se):ci({}),Ct=rn(Q,"USE_PROFILES")?Q.USE_PROFILES&&typeof Q.USE_PROFILES=="object"?ci(Q.USE_PROFILES):Q.USE_PROFILES:!1,ae=Q.ALLOW_ARIA_ATTR!==!1,de=Q.ALLOW_DATA_ATTR!==!1,we=Q.ALLOW_UNKNOWN_PROTOCOLS||!1,ye=Q.ALLOW_SELF_CLOSE_IN_ATTR!==!1,Le=Q.SAFE_FOR_TEMPLATES||!1,Oe=Q.SAFE_FOR_XML!==!1,Fe=Q.WHOLE_DOCUMENT||!1,Rt=Q.RETURN_DOM||!1,Xt=Q.RETURN_DOM_FRAGMENT||!1,vn=Q.RETURN_TRUSTED_TYPE||!1,Me=Q.FORCE_BODY||!1,an=Q.SANITIZE_DOM!==!1,kn=Q.SANITIZE_NAMED_PROPS||!1,ht=Q.KEEP_CONTENT!==!1,Lt=Q.IN_PLACE||!1,P=JN(Q.ALLOWED_URI_REGEXP)?Q.ALLOWED_URI_REGEXP:iC,Ze=typeof Q.NAMESPACE=="string"?Q.NAMESPACE:$e,Dt=rn(Q,"MATHML_TEXT_INTEGRATION_POINTS")&&Q.MATHML_TEXT_INTEGRATION_POINTS&&typeof Q.MATHML_TEXT_INTEGRATION_POINTS=="object"?ci(Q.MATHML_TEXT_INTEGRATION_POINTS):Xe({},["mi","mo","mn","ms","mtext"]),An=rn(Q,"HTML_INTEGRATION_POINTS")&&Q.HTML_INTEGRATION_POINTS&&typeof Q.HTML_INTEGRATION_POINTS=="object"?ci(Q.HTML_INTEGRATION_POINTS):Xe({},["annotation-xml"]);const _e=rn(Q,"CUSTOM_ELEMENT_HANDLING")&&Q.CUSTOM_ELEMENT_HANDLING&&typeof Q.CUSTOM_ELEMENT_HANDLING=="object"?ci(Q.CUSTOM_ELEMENT_HANDLING):Za(null);if(ie=Za(null),rn(_e,"tagNameCheck")&&dt(_e.tagNameCheck)&&(ie.tagNameCheck=_e.tagNameCheck),rn(_e,"attributeNameCheck")&&dt(_e.attributeNameCheck)&&(ie.attributeNameCheck=_e.attributeNameCheck),rn(_e,"allowCustomizedBuiltInElements")&&typeof _e.allowCustomizedBuiltInElements=="boolean"&&(ie.allowCustomizedBuiltInElements=_e.allowCustomizedBuiltInElements),Le&&(de=!1),Xt&&(Rt=!0),Ct&&(D=Xe({},yy),G=Za(null),Ct.html===!0&&(Xe(D,by),Xe(G,Sy)),Ct.svg===!0&&(Xe(D,dp),Xe(G,gp),Xe(G,Mu)),Ct.svgFilters===!0&&(Xe(D,fp),Xe(G,gp),Xe(G,Mu)),Ct.mathMl===!0&&(Xe(D,pp),Xe(G,wy),Xe(G,Mu))),H.tagCheck=null,H.attributeCheck=null,rn(Q,"ADD_TAGS")&&(typeof Q.ADD_TAGS=="function"?H.tagCheck=Q.ADD_TAGS:Gn(Q.ADD_TAGS)&&(D===U&&(D=ci(D)),Xe(D,Q.ADD_TAGS,Se))),rn(Q,"ADD_ATTR")&&(typeof Q.ADD_ATTR=="function"?H.attributeCheck=Q.ADD_ATTR:Gn(Q.ADD_ATTR)&&(G===Y&&(G=ci(G)),Xe(G,Q.ADD_ATTR,Se))),rn(Q,"ADD_URI_SAFE_ATTR")&&Gn(Q.ADD_URI_SAFE_ATTR)&&Xe(Pn,Q.ADD_URI_SAFE_ATTR,Se),rn(Q,"FORBID_CONTENTS")&&Gn(Q.FORBID_CONTENTS)&&(Ft===Kt&&(Ft=ci(Ft)),Xe(Ft,Q.FORBID_CONTENTS,Se)),rn(Q,"ADD_FORBID_CONTENTS")&&Gn(Q.ADD_FORBID_CONTENTS)&&(Ft===Kt&&(Ft=ci(Ft)),Xe(Ft,Q.ADD_FORBID_CONTENTS,Se)),ht&&(D["#text"]=!0),Fe&&Xe(D,["html","head","body"]),D.table&&(Xe(D,["tbody"]),delete se.tbody),Q.TRUSTED_TYPES_POLICY){if(typeof Q.TRUSTED_TYPES_POLICY.createHTML!="function")throw Lu('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof Q.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw Lu('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');k=Q.TRUSTED_TYPES_POLICY,L=k.createHTML("")}else k===void 0&&(k=uO(C,o)),k!==null&&typeof L=="string"&&(L=k.createHTML(""));Xn&&Xn(Q),je=Q},Ce=Xe({},[...dp,...fp,...QN]),Pe=Xe({},[...pp,...eO]),Vt=function(Q){let _e=S(Q);(!_e||!_e.tagName)&&(_e={namespaceURI:Ze,tagName:"template"});const Ee=Il(Q.tagName),ot=Il(_e.tagName);return Ve[Q.namespaceURI]?Q.namespaceURI===ve?_e.namespaceURI===$e?Ee==="svg":_e.namespaceURI===Tn?Ee==="svg"&&(ot==="annotation-xml"||Dt[ot]):!!Ce[Ee]:Q.namespaceURI===Tn?_e.namespaceURI===$e?Ee==="math":_e.namespaceURI===ve?Ee==="math"&&An[ot]:!!Pe[Ee]:Q.namespaceURI===$e?_e.namespaceURI===ve&&!An[ot]||_e.namespaceURI===Tn&&!Dt[ot]?!1:!Pe[Ee]&&(Un[Ee]||!Ce[Ee]):!!(jt==="application/xhtml+xml"&&Ve[Q.namespaceURI]):!1},nt=function(Q){kl(n.removed,{element:Q});try{S(Q).removeChild(Q)}catch{g(Q)}},Rn=function(Q,_e){try{kl(n.removed,{attribute:_e.getAttributeNode(Q),from:_e})}catch{kl(n.removed,{attribute:null,from:_e})}if(_e.removeAttribute(Q),Q==="is")if(Rt||Xt)try{nt(_e)}catch{}else try{_e.setAttribute(Q,"")}catch{}},dr=function(Q){let _e=null,Ee=null;if(Me)Q="<remove></remove>"+Q;else{const Bt=gy(Q,/^[\r\n\t ]+/);Ee=Bt&&Bt[0]}jt==="application/xhtml+xml"&&Ze===$e&&(Q='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+Q+"</body></html>");const ot=k?k.createHTML(Q):Q;if(Ze===$e)try{_e=new w().parseFromString(ot,jt)}catch{}if(!_e||!_e.documentElement){_e=R.createDocument(Ze,"template",null);try{_e.documentElement.innerHTML=at?L:ot}catch{}}const Je=_e.body||_e.documentElement;return Q&&Ee&&Je.insertBefore(i.createTextNode(Ee),Je.childNodes[0]||null),Ze===$e?B.call(_e,Fe?"html":"body")[0]:Fe?_e.documentElement:Je},fr=function(Q){return M.call(Q.ownerDocument||Q,Q,d.SHOW_ELEMENT|d.SHOW_COMMENT|d.SHOW_TEXT|d.SHOW_PROCESSING_INSTRUCTION|d.SHOW_CDATA_SECTION,null)},Qn=function(Q){return Q instanceof p&&(typeof Q.nodeName!="string"||typeof Q.textContent!="string"||typeof Q.removeChild!="function"||!(Q.attributes instanceof y)||typeof Q.removeAttribute!="function"||typeof Q.setAttribute!="function"||typeof Q.namespaceURI!="string"||typeof Q.insertBefore!="function"||typeof Q.hasChildNodes!="function")},It=function(Q){return typeof c=="function"&&Q instanceof c};function Nt(De,Q,_e){El(De,Ee=>{Ee.call(n,Q,_e,je)})}const Fi=function(Q){let _e=null;if(Nt(F.beforeSanitizeElements,Q,null),Qn(Q))return nt(Q),!0;const Ee=Se(Q.nodeName);if(Nt(F.uponSanitizeElement,Q,{tagName:Ee,allowedTags:D}),Oe&&Q.hasChildNodes()&&!It(Q.firstElementChild)&&In(/<[/\w!]/g,Q.innerHTML)&&In(/<[/\w!]/g,Q.textContent)||Oe&&Q.namespaceURI===$e&&Ee==="style"&&It(Q.firstElementChild)||Q.nodeType===Al.progressingInstruction||Oe&&Q.nodeType===Al.comment&&In(/<[/\w]/g,Q.data))return nt(Q),!0;if(se[Ee]||!(H.tagCheck instanceof Function&&H.tagCheck(Ee))&&!D[Ee]){if(!se[Ee]&&pr(Ee)&&(ie.tagNameCheck instanceof RegExp&&In(ie.tagNameCheck,Ee)||ie.tagNameCheck instanceof Function&&ie.tagNameCheck(Ee)))return!1;if(ht&&!Ft[Ee]){const ot=S(Q)||Q.parentNode,Je=m(Q)||Q.childNodes;if(Je&&ot){const Bt=Je.length;for(let Jt=Bt-1;Jt>=0;--Jt){const Qt=E(Je[Jt],!0);ot.insertBefore(Qt,v(Q))}}}return nt(Q),!0}return Q instanceof h&&!Vt(Q)||(Ee==="noscript"||Ee==="noembed"||Ee==="noframes")&&In(/<\/no(script|embed|frames)/i,Q.innerHTML)?(nt(Q),!0):(Le&&Q.nodeType===Al.text&&(_e=Q.textContent,El([W,I,Z],ot=>{_e=Va(_e,ot," ")}),Q.textContent!==_e&&(kl(n.removed,{element:Q.cloneNode()}),Q.textContent=_e)),Nt(F.afterSanitizeElements,Q,null),!1)},Wr=function(Q,_e,Ee){if(J[_e]||an&&(_e==="id"||_e==="name")&&(Ee in i||Ee in bt))return!1;const ot=G[_e]||H.attributeCheck instanceof Function&&H.attributeCheck(_e,Q);if(!(de&&!J[_e]&&In(X,_e))){if(!(ae&&In(z,_e))){if(!ot||J[_e]){if(!(pr(Q)&&(ie.tagNameCheck instanceof RegExp&&In(ie.tagNameCheck,Q)||ie.tagNameCheck instanceof Function&&ie.tagNameCheck(Q))&&(ie.attributeNameCheck instanceof RegExp&&In(ie.attributeNameCheck,_e)||ie.attributeNameCheck instanceof Function&&ie.attributeNameCheck(_e,Q))||_e==="is"&&ie.allowCustomizedBuiltInElements&&(ie.tagNameCheck instanceof RegExp&&In(ie.tagNameCheck,Ee)||ie.tagNameCheck instanceof Function&&ie.tagNameCheck(Ee))))return!1}else if(!Pn[_e]){if(!In(P,Va(Ee,V,""))){if(!((_e==="src"||_e==="xlink:href"||_e==="href")&&Q!=="script"&&my(Ee,"data:")===0&&Jn[Q])){if(!(we&&!In(q,Va(Ee,V,"")))){if(Ee)return!1}}}}}}return!0},ua=Xe({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),pr=function(Q){return!ua[Il(Q)]&&In(j,Q)},Rs=function(Q){Nt(F.beforeSanitizeAttributes,Q,null);const{attributes:_e}=Q;if(!_e||Qn(Q))return;const Ee={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:G,forceKeepAttr:void 0};let ot=_e.length;for(;ot--;){const Je=_e[ot],{name:Bt,namespaceURI:Jt,value:Qt}=Je,be=Se(Bt),Ne=Qt;let Ie=Bt==="value"?Ne:qN(Ne);if(Ee.attrName=be,Ee.attrValue=Ie,Ee.keepAttr=!0,Ee.forceKeepAttr=void 0,Nt(F.uponSanitizeAttribute,Q,Ee),Ie=Ee.attrValue,kn&&(be==="id"||be==="name")&&my(Ie,Zt)!==0&&(Rn(Bt,Q),Ie=Zt+Ie),Oe&&In(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,Ie)){Rn(Bt,Q);continue}if(be==="attributename"&&gy(Ie,"href")){Rn(Bt,Q);continue}if(Ee.forceKeepAttr)continue;if(!Ee.keepAttr){Rn(Bt,Q);continue}if(!ye&&In(/\/>/i,Ie)){Rn(Bt,Q);continue}Le&&El([W,I,Z],Wt=>{Ie=Va(Ie,Wt," ")});const pt=Se(Q.nodeName);if(!Wr(pt,be,Ie)){Rn(Bt,Q);continue}if(k&&typeof C=="object"&&typeof C.getAttributeType=="function"&&!Jt)switch(C.getAttributeType(pt,be)){case"TrustedHTML":{Ie=k.createHTML(Ie);break}case"TrustedScriptURL":{Ie=k.createScriptURL(Ie);break}}if(Ie!==Ne)try{Jt?Q.setAttributeNS(Jt,Bt,Ie):Q.setAttribute(Bt,Ie),Qn(Q)?nt(Q):py(n.removed)}catch{Rn(Bt,Q)}}Nt(F.afterSanitizeAttributes,Q,null)},er=function(Q){let _e=null;const Ee=fr(Q);for(Nt(F.beforeSanitizeShadowDOM,Q,null);_e=Ee.nextNode();)Nt(F.uponSanitizeShadowNode,_e,null),Fi(_e),Rs(_e),_e.content instanceof f&&er(_e.content);Nt(F.afterSanitizeShadowDOM,Q,null)};return n.sanitize=function(De){let Q=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},_e=null,Ee=null,ot=null,Je=null;if(at=!De,at&&(De="<!-->"),typeof De!="string"&&!It(De)&&(De=ZN(De),typeof De!="string"))throw Lu("dirty is not a string, aborting");if(!n.isSupported)return De;if(ut||ke(Q),n.removed=[],typeof De=="string"&&(Lt=!1),Lt){const Qt=De.nodeName;if(typeof Qt=="string"){const be=Se(Qt);if(!D[be]||se[be])throw Lu("root node is forbidden and cannot be sanitized in-place")}}else if(De instanceof c)_e=dr("<!---->"),Ee=_e.ownerDocument.importNode(De,!0),Ee.nodeType===Al.element&&Ee.nodeName==="BODY"||Ee.nodeName==="HTML"?_e=Ee:_e.appendChild(Ee);else{if(!Rt&&!Le&&!Fe&&De.indexOf("<")===-1)return k&&vn?k.createHTML(De):De;if(_e=dr(De),!_e)return Rt?null:vn?L:""}_e&&Me&&nt(_e.firstChild);const Bt=fr(Lt?De:_e);for(;ot=Bt.nextNode();)Fi(ot),Rs(ot),ot.content instanceof f&&er(ot.content);if(Lt)return De;if(Rt){if(Le){_e.normalize();let Qt=_e.innerHTML;El([W,I,Z],be=>{Qt=Va(Qt,be," ")}),_e.innerHTML=Qt}if(Xt)for(Je=A.call(_e.ownerDocument);_e.firstChild;)Je.appendChild(_e.firstChild);else Je=_e;return(G.shadowroot||G.shadowrootmode)&&(Je=K.call(s,Je,!0)),Je}let Jt=Fe?_e.outerHTML:_e.innerHTML;return Fe&&D["!doctype"]&&_e.ownerDocument&&_e.ownerDocument.doctype&&_e.ownerDocument.doctype.name&&In(rC,_e.ownerDocument.doctype.name)&&(Jt="<!DOCTYPE "+_e.ownerDocument.doctype.name+`>
|
|
156
|
-
`+Jt),Le&&El([W,I,Z],Qt=>{Jt=Va(Jt,Qt," ")}),k&&vn?k.createHTML(Jt):Jt},n.setConfig=function(){let De=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};ke(De),ut=!0},n.clearConfig=function(){je=null,ut=!1},n.isValidAttribute=function(De,Q,_e){je||ke({});const Ee=Se(De),ot=Se(Q);return Wr(Ee,ot,_e)},n.addHook=function(De,Q){typeof Q=="function"&&kl(F[De],Q)},n.removeHook=function(De,Q){if(Q!==void 0){const _e=WN(F[De],Q);return _e===-1?void 0:GN(F[De],_e,1)[0]}return py(F[De])},n.removeHooks=function(De){F[De]=[]},n.removeAllHooks=function(){F=Cy()},n}var Ul=sC(),mp,Ey;function hO(){if(Ey)return mp;Ey=1;function e(ee){return ee instanceof Map?ee.clear=ee.delete=ee.set=function(){throw new Error("map is read-only")}:ee instanceof Set&&(ee.add=ee.clear=ee.delete=function(){throw new Error("set is read-only")}),Object.freeze(ee),Object.getOwnPropertyNames(ee).forEach(pe=>{const Se=ee[pe],je=typeof Se;(je==="object"||je==="function")&&!Object.isFrozen(Se)&&e(Se)}),ee}class n{constructor(pe){pe.data===void 0&&(pe.data={}),this.data=pe.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function i(ee){return ee.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function s(ee,...pe){const Se=Object.create(null);for(const je in ee)Se[je]=ee[je];return pe.forEach(function(je){for(const bt in je)Se[bt]=je[bt]}),Se}const o="</span>",f=ee=>!!ee.scope,_=(ee,{prefix:pe})=>{if(ee.startsWith("language:"))return ee.replace("language:","language-");if(ee.includes(".")){const Se=ee.split(".");return[`${pe}${Se.shift()}`,...Se.map((je,bt)=>`${je}${"_".repeat(bt+1)}`)].join(" ")}return`${pe}${ee}`};class c{constructor(pe,Se){this.buffer="",this.classPrefix=Se.classPrefix,pe.walk(this)}addText(pe){this.buffer+=i(pe)}openNode(pe){if(!f(pe))return;const Se=_(pe.scope,{prefix:this.classPrefix});this.span(Se)}closeNode(pe){f(pe)&&(this.buffer+=o)}value(){return this.buffer}span(pe){this.buffer+=`<span class="${pe}">`}}const h=(ee={})=>{const pe={children:[]};return Object.assign(pe,ee),pe};class d{constructor(){this.rootNode=h(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(pe){this.top.children.push(pe)}openNode(pe){const Se=h({scope:pe});this.add(Se),this.stack.push(Se)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(pe){return this.constructor._walk(pe,this.rootNode)}static _walk(pe,Se){return typeof Se=="string"?pe.addText(Se):Se.children&&(pe.openNode(Se),Se.children.forEach(je=>this._walk(pe,je)),pe.closeNode(Se)),pe}static _collapse(pe){typeof pe!="string"&&pe.children&&(pe.children.every(Se=>typeof Se=="string")?pe.children=[pe.children.join("")]:pe.children.forEach(Se=>{d._collapse(Se)}))}}class y extends d{constructor(pe){super(),this.options=pe}addText(pe){pe!==""&&this.add(pe)}startScope(pe){this.openNode(pe)}endScope(){this.closeNode()}__addSublanguage(pe,Se){const je=pe.root;Se&&(je.scope=`language:${Se}`),this.add(je)}toHTML(){return new c(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}}function p(ee){return ee?typeof ee=="string"?ee:ee.source:null}function w(ee){return E("(?=",ee,")")}function C(ee){return E("(?:",ee,")*")}function T(ee){return E("(?:",ee,")?")}function E(...ee){return ee.map(Se=>p(Se)).join("")}function g(ee){const pe=ee[ee.length-1];return typeof pe=="object"&&pe.constructor===Object?(ee.splice(ee.length-1,1),pe):{}}function v(...ee){return"("+(g(ee).capture?"":"?:")+ee.map(je=>p(je)).join("|")+")"}function m(ee){return new RegExp(ee.toString()+"|").exec("").length-1}function S(ee,pe){const Se=ee&&ee.exec(pe);return Se&&Se.index===0}const k=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function L(ee,{joinWith:pe}){let Se=0;return ee.map(je=>{Se+=1;const bt=Se;let dt=p(je),ke="";for(;dt.length>0;){const Ce=k.exec(dt);if(!Ce){ke+=dt;break}ke+=dt.substring(0,Ce.index),dt=dt.substring(Ce.index+Ce[0].length),Ce[0][0]==="\\"&&Ce[1]?ke+="\\"+String(Number(Ce[1])+bt):(ke+=Ce[0],Ce[0]==="("&&Se++)}return ke}).map(je=>`(${je})`).join(pe)}const R=/\b\B/,M="[a-zA-Z]\\w*",A="[a-zA-Z_]\\w*",B="\\b\\d+(\\.\\d+)?",K="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",F="\\b(0b[01]+)",W="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",I=(ee={})=>{const pe=/^#![ ]*\//;return ee.binary&&(ee.begin=E(pe,/.*\b/,ee.binary,/\b.*/)),s({scope:"meta",begin:pe,end:/$/,relevance:0,"on:begin":(Se,je)=>{Se.index!==0&&je.ignoreMatch()}},ee)},Z={begin:"\\\\[\\s\\S]",relevance:0},X={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[Z]},z={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[Z]},q={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/},V=function(ee,pe,Se={}){const je=s({scope:"comment",begin:ee,end:pe,contains:[]},Se);je.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 bt=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 je.contains.push({begin:E(/[ ]+/,"(",bt,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),je},j=V("//","$"),P=V("/\\*","\\*/"),D=V("#","$"),U={scope:"number",begin:B,relevance:0},G={scope:"number",begin:K,relevance:0},Y={scope:"number",begin:F,relevance:0},ie={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[Z,{begin:/\[/,end:/\]/,relevance:0,contains:[Z]}]},se={scope:"title",begin:M,relevance:0},J={scope:"title",begin:A,relevance:0},H={begin:"\\.\\s*"+A,relevance:0};var de=Object.freeze({__proto__:null,APOS_STRING_MODE:X,BACKSLASH_ESCAPE:Z,BINARY_NUMBER_MODE:Y,BINARY_NUMBER_RE:F,COMMENT:V,C_BLOCK_COMMENT_MODE:P,C_LINE_COMMENT_MODE:j,C_NUMBER_MODE:G,C_NUMBER_RE:K,END_SAME_AS_BEGIN:function(ee){return Object.assign(ee,{"on:begin":(pe,Se)=>{Se.data._beginMatch=pe[1]},"on:end":(pe,Se)=>{Se.data._beginMatch!==pe[1]&&Se.ignoreMatch()}})},HASH_COMMENT_MODE:D,IDENT_RE:M,MATCH_NOTHING_RE:R,METHOD_GUARD:H,NUMBER_MODE:U,NUMBER_RE:B,PHRASAL_WORDS_MODE:q,QUOTE_STRING_MODE:z,REGEXP_MODE:ie,RE_STARTERS_RE:W,SHEBANG:I,TITLE_MODE:se,UNDERSCORE_IDENT_RE:A,UNDERSCORE_TITLE_MODE:J});function we(ee,pe){ee.input[ee.index-1]==="."&&pe.ignoreMatch()}function ye(ee,pe){ee.className!==void 0&&(ee.scope=ee.className,delete ee.className)}function Le(ee,pe){pe&&ee.beginKeywords&&(ee.begin="\\b("+ee.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",ee.__beforeBegin=we,ee.keywords=ee.keywords||ee.beginKeywords,delete ee.beginKeywords,ee.relevance===void 0&&(ee.relevance=0))}function Oe(ee,pe){Array.isArray(ee.illegal)&&(ee.illegal=v(...ee.illegal))}function Fe(ee,pe){if(ee.match){if(ee.begin||ee.end)throw new Error("begin & end are not supported with match");ee.begin=ee.match,delete ee.match}}function ut(ee,pe){ee.relevance===void 0&&(ee.relevance=1)}const Me=(ee,pe)=>{if(!ee.beforeMatch)return;if(ee.starts)throw new Error("beforeMatch cannot be used with starts");const Se=Object.assign({},ee);Object.keys(ee).forEach(je=>{delete ee[je]}),ee.keywords=Se.keywords,ee.begin=E(Se.beforeMatch,w(Se.begin)),ee.starts={relevance:0,contains:[Object.assign(Se,{endsParent:!0})]},ee.relevance=0,delete Se.beforeMatch},Rt=["of","and","for","in","not","or","if","then","parent","list","value"],Xt="keyword";function vn(ee,pe,Se=Xt){const je=Object.create(null);return typeof ee=="string"?bt(Se,ee.split(" ")):Array.isArray(ee)?bt(Se,ee):Object.keys(ee).forEach(function(dt){Object.assign(je,vn(ee[dt],pe,dt))}),je;function bt(dt,ke){pe&&(ke=ke.map(Ce=>Ce.toLowerCase())),ke.forEach(function(Ce){const Pe=Ce.split("|");je[Pe[0]]=[dt,an(Pe[0],Pe[1])]})}}function an(ee,pe){return pe?Number(pe):kn(ee)?0:1}function kn(ee){return Rt.includes(ee.toLowerCase())}const Zt={},ht=ee=>{console.error(ee)},Lt=(ee,...pe)=>{console.log(`WARN: ${ee}`,...pe)},Ct=(ee,pe)=>{Zt[`${ee}/${pe}`]||(console.log(`Deprecated as of ${ee}. ${pe}`),Zt[`${ee}/${pe}`]=!0)},Ft=new Error;function Kt(ee,pe,{key:Se}){let je=0;const bt=ee[Se],dt={},ke={};for(let Ce=1;Ce<=pe.length;Ce++)ke[Ce+je]=bt[Ce],dt[Ce+je]=!0,je+=m(pe[Ce-1]);ee[Se]=ke,ee[Se]._emit=dt,ee[Se]._multi=!0}function Jn(ee){if(Array.isArray(ee.begin)){if(ee.skip||ee.excludeBegin||ee.returnBegin)throw ht("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),Ft;if(typeof ee.beginScope!="object"||ee.beginScope===null)throw ht("beginScope must be object"),Ft;Kt(ee,ee.begin,{key:"beginScope"}),ee.begin=L(ee.begin,{joinWith:""})}}function bn(ee){if(Array.isArray(ee.end)){if(ee.skip||ee.excludeEnd||ee.returnEnd)throw ht("skip, excludeEnd, returnEnd not compatible with endScope: {}"),Ft;if(typeof ee.endScope!="object"||ee.endScope===null)throw ht("endScope must be object"),Ft;Kt(ee,ee.end,{key:"endScope"}),ee.end=L(ee.end,{joinWith:""})}}function Pn(ee){ee.scope&&typeof ee.scope=="object"&&ee.scope!==null&&(ee.beginScope=ee.scope,delete ee.scope)}function ft(ee){Pn(ee),typeof ee.beginScope=="string"&&(ee.beginScope={_wrap:ee.beginScope}),typeof ee.endScope=="string"&&(ee.endScope={_wrap:ee.endScope}),Jn(ee),bn(ee)}function Tn(ee){function pe(ke,Ce){return new RegExp(p(ke),"m"+(ee.case_insensitive?"i":"")+(ee.unicodeRegex?"u":"")+(Ce?"g":""))}class Se{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(Ce,Pe){Pe.position=this.position++,this.matchIndexes[this.matchAt]=Pe,this.regexes.push([Pe,Ce]),this.matchAt+=m(Ce)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);const Ce=this.regexes.map(Pe=>Pe[1]);this.matcherRe=pe(L(Ce,{joinWith:"|"}),!0),this.lastIndex=0}exec(Ce){this.matcherRe.lastIndex=this.lastIndex;const Pe=this.matcherRe.exec(Ce);if(!Pe)return null;const Vt=Pe.findIndex((Rn,dr)=>dr>0&&Rn!==void 0),nt=this.matchIndexes[Vt];return Pe.splice(0,Vt),Object.assign(Pe,nt)}}class je{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 Pe=new Se;return this.rules.slice(Ce).forEach(([Vt,nt])=>Pe.addRule(Vt,nt)),Pe.compile(),this.multiRegexes[Ce]=Pe,Pe}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(Ce,Pe){this.rules.push([Ce,Pe]),Pe.type==="begin"&&this.count++}exec(Ce){const Pe=this.getMatcher(this.regexIndex);Pe.lastIndex=this.lastIndex;let Vt=Pe.exec(Ce);if(this.resumingScanAtSamePosition()&&!(Vt&&Vt.index===this.lastIndex)){const nt=this.getMatcher(0);nt.lastIndex=this.lastIndex+1,Vt=nt.exec(Ce)}return Vt&&(this.regexIndex+=Vt.position+1,this.regexIndex===this.count&&this.considerAll()),Vt}}function bt(ke){const Ce=new je;return ke.contains.forEach(Pe=>Ce.addRule(Pe.begin,{rule:Pe,type:"begin"})),ke.terminatorEnd&&Ce.addRule(ke.terminatorEnd,{type:"end"}),ke.illegal&&Ce.addRule(ke.illegal,{type:"illegal"}),Ce}function dt(ke,Ce){const Pe=ke;if(ke.isCompiled)return Pe;[ye,Fe,ft,Me].forEach(nt=>nt(ke,Ce)),ee.compilerExtensions.forEach(nt=>nt(ke,Ce)),ke.__beforeBegin=null,[Le,Oe,ut].forEach(nt=>nt(ke,Ce)),ke.isCompiled=!0;let Vt=null;return typeof ke.keywords=="object"&&ke.keywords.$pattern&&(ke.keywords=Object.assign({},ke.keywords),Vt=ke.keywords.$pattern,delete ke.keywords.$pattern),Vt=Vt||/\w+/,ke.keywords&&(ke.keywords=vn(ke.keywords,ee.case_insensitive)),Pe.keywordPatternRe=pe(Vt,!0),Ce&&(ke.begin||(ke.begin=/\B|\b/),Pe.beginRe=pe(Pe.begin),!ke.end&&!ke.endsWithParent&&(ke.end=/\B|\b/),ke.end&&(Pe.endRe=pe(Pe.end)),Pe.terminatorEnd=p(Pe.end)||"",ke.endsWithParent&&Ce.terminatorEnd&&(Pe.terminatorEnd+=(ke.end?"|":"")+Ce.terminatorEnd)),ke.illegal&&(Pe.illegalRe=pe(ke.illegal)),ke.contains||(ke.contains=[]),ke.contains=[].concat(...ke.contains.map(function(nt){return $e(nt==="self"?ke:nt)})),ke.contains.forEach(function(nt){dt(nt,Pe)}),ke.starts&&dt(ke.starts,Ce),Pe.matcher=bt(Pe),Pe}if(ee.compilerExtensions||(ee.compilerExtensions=[]),ee.contains&&ee.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return ee.classNameAliases=s(ee.classNameAliases||{}),dt(ee)}function ve(ee){return ee?ee.endsWithParent||ve(ee.starts):!1}function $e(ee){return ee.variants&&!ee.cachedVariants&&(ee.cachedVariants=ee.variants.map(function(pe){return s(ee,{variants:null},pe)})),ee.cachedVariants?ee.cachedVariants:ve(ee)?s(ee,{starts:ee.starts?s(ee.starts):null}):Object.isFrozen(ee)?s(ee):ee}var Ze="11.11.1";class at extends Error{constructor(pe,Se){super(pe),this.name="HTMLInjectionError",this.html=Se}}const Ve=i,on=s,Dt=Symbol("nomatch"),An=7,Un=function(ee){const pe=Object.create(null),Se=Object.create(null),je=[];let bt=!0;const dt="Could not find the language '{}', did you forget to load/include a language module?",ke={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 Pe(be){return Ce.noHighlightRe.test(be)}function Vt(be){let Ne=be.className+" ";Ne+=be.parentNode?be.parentNode.className:"";const Ie=Ce.languageDetectRe.exec(Ne);if(Ie){const pt=Q(Ie[1]);return pt||(Lt(dt.replace("{}",Ie[1])),Lt("Falling back to no-highlight mode for this block.",be)),pt?Ie[1]:"no-highlight"}return Ne.split(/\s+/).find(pt=>Pe(pt)||Q(pt))}function nt(be,Ne,Ie){let pt="",Wt="";typeof Ne=="object"?(pt=be,Ie=Ne.ignoreIllegals,Wt=Ne.language):(Ct("10.7.0","highlight(lang, code, ...args) has been deprecated."),Ct("10.7.0",`Please use highlight(code, options) instead.
|
|
157
|
-
https://github.com/highlightjs/highlight.js/issues/2277`),Wt=be,pt=Ne),Ie===void 0&&(Ie=!0);const zn={code:pt,language:Wt};Jt("before:highlight",zn);const hi=zn.result?zn.result:Rn(zn.language,zn.code,Ie);return hi.code=zn.code,Jt("after:highlight",hi),hi}function Rn(be,Ne,Ie,pt){const Wt=Object.create(null);function zn(xe,Ae){return xe.keywords[Ae]}function hi(){if(!Ue.keywords){hn.addText(yt);return}let xe=0;Ue.keywordPatternRe.lastIndex=0;let Ae=Ue.keywordPatternRe.exec(yt),Ge="";for(;Ae;){Ge+=yt.substring(xe,Ae.index);const it=Ln.case_insensitive?Ae[0].toLowerCase():Ae[0],Yt=zn(Ue,it);if(Yt){const[Ei,ko]=Yt;if(hn.addText(Ge),Ge="",Wt[it]=(Wt[it]||0)+1,Wt[it]<=An&&(Gr+=ko),Ei.startsWith("_"))Ge+=Ae[0];else{const uc=Ln.classNameAliases[Ei]||Ei;di(Ae[0],uc)}}else Ge+=Ae[0];xe=Ue.keywordPatternRe.lastIndex,Ae=Ue.keywordPatternRe.exec(yt)}Ge+=yt.substring(xe),hn.addText(Ge)}function ei(){if(yt==="")return;let xe=null;if(typeof Ue.subLanguage=="string"){if(!pe[Ue.subLanguage]){hn.addText(yt);return}xe=Rn(Ue.subLanguage,yt,!0,cc[Ue.subLanguage]),cc[Ue.subLanguage]=xe._top}else xe=fr(yt,Ue.subLanguage.length?Ue.subLanguage:null);Ue.relevance>0&&(Gr+=xe.relevance),hn.__addSublanguage(xe._emitter,xe.language)}function Ot(){Ue.subLanguage!=null?ei():hi(),yt=""}function di(xe,Ae){xe!==""&&(hn.startScope(Ae),hn.addText(xe),hn.endScope())}function oc(xe,Ae){let Ge=1;const it=Ae.length-1;for(;Ge<=it;){if(!xe._emit[Ge]){Ge++;continue}const Yt=Ln.classNameAliases[xe[Ge]]||xe[Ge],Ei=Ae[Ge];Yt?di(Ei,Yt):(yt=Ei,hi(),yt=""),Ge++}}function ha(xe,Ae){return xe.scope&&typeof xe.scope=="string"&&hn.openNode(Ln.classNameAliases[xe.scope]||xe.scope),xe.beginScope&&(xe.beginScope._wrap?(di(yt,Ln.classNameAliases[xe.beginScope._wrap]||xe.beginScope._wrap),yt=""):xe.beginScope._multi&&(oc(xe.beginScope,Ae),yt="")),Ue=Object.create(xe,{parent:{value:Ue}}),Ue}function xo(xe,Ae,Ge){let it=S(xe.endRe,Ge);if(it){if(xe["on:end"]){const Yt=new n(xe);xe["on:end"](Ae,Yt),Yt.isMatchIgnored&&(it=!1)}if(it){for(;xe.endsParent&&xe.parent;)xe=xe.parent;return xe}}if(xe.endsWithParent)return xo(xe.parent,Ae,Ge)}function da(xe){return Ue.matcher.regexIndex===0?(yt+=xe[0],1):(qr=!0,0)}function Dh(xe){const Ae=xe[0],Ge=xe.rule,it=new n(Ge),Yt=[Ge.__beforeBegin,Ge["on:begin"]];for(const Ei of Yt)if(Ei&&(Ei(xe,it),it.isMatchIgnored))return da(Ae);return Ge.skip?yt+=Ae:(Ge.excludeBegin&&(yt+=Ae),Ot(),!Ge.returnBegin&&!Ge.excludeBegin&&(yt=Ae)),ha(Ge,xe),Ge.returnBegin?0:Ae.length}function ti(xe){const Ae=xe[0],Ge=Ne.substring(xe.index),it=xo(Ue,xe,Ge);if(!it)return Dt;const Yt=Ue;Ue.endScope&&Ue.endScope._wrap?(Ot(),di(Ae,Ue.endScope._wrap)):Ue.endScope&&Ue.endScope._multi?(Ot(),oc(Ue.endScope,xe)):Yt.skip?yt+=Ae:(Yt.returnEnd||Yt.excludeEnd||(yt+=Ae),Ot(),Yt.excludeEnd&&(yt=Ae));do Ue.scope&&hn.closeNode(),!Ue.skip&&!Ue.subLanguage&&(Gr+=Ue.relevance),Ue=Ue.parent;while(Ue!==it.parent);return it.starts&&ha(it.starts,xe),Yt.returnEnd?0:Ae.length}function Co(){const xe=[];for(let Ae=Ue;Ae!==Ln;Ae=Ae.parent)Ae.scope&&xe.unshift(Ae.scope);xe.forEach(Ae=>hn.openNode(Ae))}let Ls={};function fa(xe,Ae){const Ge=Ae&&Ae[0];if(yt+=xe,Ge==null)return Ot(),0;if(Ls.type==="begin"&&Ae.type==="end"&&Ls.index===Ae.index&&Ge===""){if(yt+=Ne.slice(Ae.index,Ae.index+1),!bt){const it=new Error(`0 width match regex (${be})`);throw it.languageName=be,it.badRule=Ls.rule,it}return 1}if(Ls=Ae,Ae.type==="begin")return Dh(Ae);if(Ae.type==="illegal"&&!Ie){const it=new Error('Illegal lexeme "'+Ge+'" for mode "'+(Ue.scope||"<unnamed>")+'"');throw it.mode=Ue,it}else if(Ae.type==="end"){const it=ti(Ae);if(it!==Dt)return it}if(Ae.type==="illegal"&&Ge==="")return yt+=`
|
|
158
|
-
`,1;if(Eo>1e5&&Eo>Ae.index*3)throw new Error("potential infinite loop, way more iterations than matches");return yt+=Ge,Ge.length}const Ln=Q(be);if(!Ln)throw ht(dt.replace("{}",be)),new Error('Unknown language: "'+be+'"');const lc=Tn(Ln);let pa="",Ue=pt||lc;const cc={},hn=new Ce.__emitter(Ce);Co();let yt="",Gr=0,gr=0,Eo=0,qr=!1;try{if(Ln.__emitTokens)Ln.__emitTokens(Ne,hn);else{for(Ue.matcher.considerAll();;){Eo++,qr?qr=!1:Ue.matcher.considerAll(),Ue.matcher.lastIndex=gr;const xe=Ue.matcher.exec(Ne);if(!xe)break;const Ae=Ne.substring(gr,xe.index),Ge=fa(Ae,xe);gr=xe.index+Ge}fa(Ne.substring(gr))}return hn.finalize(),pa=hn.toHTML(),{language:be,value:pa,relevance:Gr,illegal:!1,_emitter:hn,_top:Ue}}catch(xe){if(xe.message&&xe.message.includes("Illegal"))return{language:be,value:Ve(Ne),illegal:!0,relevance:0,_illegalBy:{message:xe.message,index:gr,context:Ne.slice(gr-100,gr+100),mode:xe.mode,resultSoFar:pa},_emitter:hn};if(bt)return{language:be,value:Ve(Ne),illegal:!1,relevance:0,errorRaised:xe,_emitter:hn,_top:Ue};throw xe}}function dr(be){const Ne={value:Ve(be),illegal:!1,relevance:0,_top:ke,_emitter:new Ce.__emitter(Ce)};return Ne._emitter.addText(be),Ne}function fr(be,Ne){Ne=Ne||Ce.languages||Object.keys(pe);const Ie=dr(be),pt=Ne.filter(Q).filter(Ee).map(Ot=>Rn(Ot,be,!1));pt.unshift(Ie);const Wt=pt.sort((Ot,di)=>{if(Ot.relevance!==di.relevance)return di.relevance-Ot.relevance;if(Ot.language&&di.language){if(Q(Ot.language).supersetOf===di.language)return 1;if(Q(di.language).supersetOf===Ot.language)return-1}return 0}),[zn,hi]=Wt,ei=zn;return ei.secondBest=hi,ei}function Qn(be,Ne,Ie){const pt=Ne&&Se[Ne]||Ie;be.classList.add("hljs"),be.classList.add(`language-${pt}`)}function It(be){let Ne=null;const Ie=Vt(be);if(Pe(Ie))return;if(Jt("before:highlightElement",{el:be,language:Ie}),be.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",be);return}if(be.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(be)),Ce.throwUnescapedHTML))throw new at("One of your code blocks includes unescaped HTML.",be.innerHTML);Ne=be;const pt=Ne.textContent,Wt=Ie?nt(pt,{language:Ie,ignoreIllegals:!0}):fr(pt);be.innerHTML=Wt.value,be.dataset.highlighted="yes",Qn(be,Ie,Wt.language),be.result={language:Wt.language,re:Wt.relevance,relevance:Wt.relevance},Wt.secondBest&&(be.secondBest={language:Wt.secondBest.language,relevance:Wt.secondBest.relevance}),Jt("after:highlightElement",{el:be,result:Wt,text:pt})}function Nt(be){Ce=on(Ce,be)}const Fi=()=>{pr(),Ct("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function Wr(){pr(),Ct("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let ua=!1;function pr(){function be(){pr()}if(document.readyState==="loading"){ua||window.addEventListener("DOMContentLoaded",be,!1),ua=!0;return}document.querySelectorAll(Ce.cssSelector).forEach(It)}function Rs(be,Ne){let Ie=null;try{Ie=Ne(ee)}catch(pt){if(ht("Language definition for '{}' could not be registered.".replace("{}",be)),bt)ht(pt);else throw pt;Ie=ke}Ie.name||(Ie.name=be),pe[be]=Ie,Ie.rawDefinition=Ne.bind(null,ee),Ie.aliases&&_e(Ie.aliases,{languageName:be})}function er(be){delete pe[be];for(const Ne of Object.keys(Se))Se[Ne]===be&&delete Se[Ne]}function De(){return Object.keys(pe)}function Q(be){return be=(be||"").toLowerCase(),pe[be]||pe[Se[be]]}function _e(be,{languageName:Ne}){typeof be=="string"&&(be=[be]),be.forEach(Ie=>{Se[Ie.toLowerCase()]=Ne})}function Ee(be){const Ne=Q(be);return Ne&&!Ne.disableAutodetect}function ot(be){be["before:highlightBlock"]&&!be["before:highlightElement"]&&(be["before:highlightElement"]=Ne=>{be["before:highlightBlock"](Object.assign({block:Ne.el},Ne))}),be["after:highlightBlock"]&&!be["after:highlightElement"]&&(be["after:highlightElement"]=Ne=>{be["after:highlightBlock"](Object.assign({block:Ne.el},Ne))})}function Je(be){ot(be),je.push(be)}function Bt(be){const Ne=je.indexOf(be);Ne!==-1&&je.splice(Ne,1)}function Jt(be,Ne){const Ie=be;je.forEach(function(pt){pt[Ie]&&pt[Ie](Ne)})}function Qt(be){return Ct("10.7.0","highlightBlock will be removed entirely in v12.0"),Ct("10.7.0","Please use highlightElement now."),It(be)}Object.assign(ee,{highlight:nt,highlightAuto:fr,highlightAll:pr,highlightElement:It,highlightBlock:Qt,configure:Nt,initHighlighting:Fi,initHighlightingOnLoad:Wr,registerLanguage:Rs,unregisterLanguage:er,listLanguages:De,getLanguage:Q,registerAliases:_e,autoDetection:Ee,inherit:on,addPlugin:Je,removePlugin:Bt}),ee.debugMode=function(){bt=!1},ee.safeMode=function(){bt=!0},ee.versionString=Ze,ee.regex={concat:E,lookahead:w,either:v,optional:T,anyNumberOfTimes:C};for(const be in de)typeof de[be]=="object"&&e(de[be]);return Object.assign(ee,de),ee},jt=Un({});return jt.newInstance=()=>Un({}),mp=jt,jt.HighlightJS=jt,jt.default=jt,mp}var dO=hO();const Di=Vg(dO);function ky(e){const n=e.regex,i={},s={begin:/\$\{/,end:/\}/,contains:["self",{begin:/:-/,contains:[i]}]};Object.assign(i,{className:"variable",variants:[{begin:n.concat(/\$[\w\d#@][\w\d_]*/,"(?![\\w\\d])(?![$])")},s]});const o={className:"subst",begin:/\$\(/,end:/\)/,contains:[e.BACKSLASH_ESCAPE]},f=e.inherit(e.COMMENT(),{match:[/(^|\s)/,/#.*$/],scope:{2:"comment"}}),_={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,i,o]};o.contains.push(c);const h={match:/\\"/},d={className:"string",begin:/'/,end:/'/},y={match:/\\'/},p={begin:/\$?\(\(/,end:/\)\)/,contains:[{begin:/\d+#[0-9a-f]+/,className:"number"},e.NUMBER_MODE,i]},w=["fish","bash","zsh","sh","csh","ksh","tcsh","dash","scsh"],C=e.SHEBANG({binary:`(${w.join("|")})`,relevance:10}),T={className:"function",begin:/\w[\w\d_]*\s*\(\s*\)\s*\{/,returnBegin:!0,contains:[e.inherit(e.TITLE_MODE,{begin:/\w[\w\d_]*/})],relevance:0},E=["if","then","else","elif","fi","time","for","while","until","in","do","done","case","esac","coproc","function","select"],g=["true","false"],v={match:/(\/[a-z._-]+)+/},m=["break","cd","continue","eval","exec","exit","export","getopts","hash","pwd","readonly","return","shift","test","times","trap","umask","unset"],S=["alias","bind","builtin","caller","command","declare","echo","enable","help","let","local","logout","mapfile","printf","read","readarray","source","sudo","type","typeset","ulimit","unalias"],k=["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:E,literal:g,built_in:[...m,...S,"set","shopt",...k,...L]},contains:[C,e.SHEBANG(),T,p,f,_,v,c,h,d,y,i]}}const Ty="[A-Za-z$_][0-9A-Za-z$_]*",fO=["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"],pO=["true","false","null","undefined","NaN","Infinity"],aC=["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"],oC=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],lC=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],gO=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],mO=[].concat(lC,aC,oC);function Ay(e){const n=e.regex,i=(V,{after:j})=>{const P="</"+V[0].slice(1);return V.input.indexOf(P,j)!==-1},s=Ty,o={begin:"<>",end:"</>"},f=/<[A-Za-z0-9\\._:-]+\s*\/>/,_={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(V,j)=>{const P=V[0].length+V.index,D=V.input[P];if(D==="<"||D===","){j.ignoreMatch();return}D===">"&&(i(V,{after:P})||j.ignoreMatch());let U;const G=V.input.substring(P);if(U=G.match(/^\s*=/)){j.ignoreMatch();return}if((U=G.match(/^\s+extends\s+/))&&U.index===0){j.ignoreMatch();return}}},c={$pattern:Ty,keyword:fO,literal:pO,built_in:mO,"variable.language":gO},h="[0-9](_?[0-9])*",d=`\\.(${h})`,y="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",p={className:"number",variants:[{begin:`(\\b(${y})((${d})|\\.)?|(${d}))[eE][+-]?(${h})\\b`},{begin:`\\b(${y})\\b((${d})\\b|\\.)?|(${d})\\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},w={className:"subst",begin:"\\$\\{",end:"\\}",keywords:c,contains:[]},C={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,w],subLanguage:"xml"}},T={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,w],subLanguage:"css"}},E={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,w],subLanguage:"graphql"}},g={className:"string",begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,w]},m={className:"comment",variants:[e.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:s+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]},S=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,C,T,E,g,{match:/\$\d+/},p];w.contains=S.concat({begin:/\{/,end:/\}/,keywords:c,contains:["self"].concat(S)});const k=[].concat(m,w.contains),L=k.concat([{begin:/(\s*)\(/,end:/\)/,keywords:c,contains:["self"].concat(k)}]),R={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:c,contains:L},M={variants:[{match:[/class/,/\s+/,s,/\s+/,/extends/,/\s+/,n.concat(s,"(",n.concat(/\./,s),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,s],scope:{1:"keyword",3:"title.class"}}]},A={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:{_:[...aC,...oC]}},B={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},K={variants:[{match:[/function/,/\s+/,s,/(?=\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 W(V){return n.concat("(?!",V.join("|"),")")}const I={match:n.concat(/\b/,W([...lC,"super","import"].map(V=>`${V}\\s*\\(`)),s,n.lookahead(/\s*\(/)),className:"title.function",relevance:0},Z={begin:n.concat(/\./,n.lookahead(n.concat(s,/(?![0-9A-Za-z$_(])/))),end:s,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},X={match:[/get|set/,/\s+/,s,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},R]},z="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",q={match:[/const|var|let/,/\s+/,s,/\s*/,/=\s*/,/(async\s*)?/,n.lookahead(z)],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:A},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),B,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,C,T,E,g,m,{match:/\$\d+/},p,A,{scope:"attr",match:s+n.lookahead(":"),relevance:0},q,{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[m,e.REGEXP_MODE,{className:"function",begin:z,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:o.begin,end:o.end},{match:f},{begin:_.begin,"on:begin":_.isTrulyOpeningTag,end:_.end}],subLanguage:"xml",contains:[{begin:_.begin,end:_.end,skip:!0,contains:["self"]}]}]},K,{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:s,className:"title.function"})]},{match:/\.\.\./,relevance:0},Z,{match:"\\$"+s,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[R]},I,F,M,X,{match:/\$[(.]/}]}}function _O(e){const n={className:"attr",begin:/"(\\.|[^\\"\r\n])*"(?=\s*:)/,relevance:1.01},i={match:/[{}[\],:]/,className:"punctuation",relevance:0},s=["true","false","null"],o={scope:"literal",beginKeywords:s.join(" ")};return{name:"JSON",aliases:["jsonc"],keywords:{literal:s},contains:[n,i,e.QUOTE_STRING_MODE,o,e.C_NUMBER_MODE,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE],illegal:"\\S"}}function Ry(e){const n=e.regex,i={begin:/<\/?[A-Za-z_]/,end:">",subLanguage:"xml",relevance:0},s={begin:"^[-\\*]{3,}",end:"$"},o={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},_={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+.-]*/,h={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}]},d={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}]},p=e.inherit(d,{contains:[]}),w=e.inherit(y,{contains:[]});d.contains.push(w),y.contains.push(p);let C=[i,h];return[d,y,p,w].forEach(v=>{v.contains=v.contains.concat(C)}),C=C.concat(d,y),{name:"Markdown",aliases:["md","mkdown","mkd"],contains:[{className:"section",variants:[{begin:"^#{1,6}",end:"$",contains:C},{begin:"(?=^.+?\\n[=-]{2,}$)",contains:[{begin:"^[=-]*$"},{begin:"^",end:"\\n",contains:C}]}]},i,f,d,y,{className:"quote",begin:"^>\\s+",contains:C,end:"$"},o,s,h,_,{scope:"literal",match:/&([a-zA-Z0-9]+|#[0-9]{1,7}|#[Xx][0-9a-fA-F]{1,6});/}]}}function Ly(e){const n=e.regex,i=new RegExp("[\\p{XID_Start}_]\\p{XID_Continue}*","u"),s=["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:s,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"]},h={className:"meta",begin:/^(>>>|\.\.\.) /},d={className:"subst",begin:/\{/,end:/\}/,keywords:c,illegal:/#/},y={begin:/\{\{/,relevance:0},p={className:"string",contains:[e.BACKSLASH_ESCAPE],variants:[{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,h],relevance:10},{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,h],relevance:10},{begin:/([fF][rR]|[rR][fF]|[fF])'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,h,y,d]},{begin:/([fF][rR]|[rR][fF]|[fF])"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,h,y,d]},{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,d]},{begin:/([fF][rR]|[rR][fF]|[fF])"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,y,d]},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},w="[0-9](_?[0-9])*",C=`(\\b(${w}))?\\.(${w})|\\b(${w})\\.`,T=`\\b|${s.join("|")}`,E={className:"number",relevance:0,variants:[{begin:`(\\b(${w})|(${C}))[eE][+-]?(${w})[jJ]?(?=${T})`},{begin:`(${C})[jJ]?`},{begin:`\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${T})`},{begin:`\\b0[bB](_?[01])+[lL]?(?=${T})`},{begin:`\\b0[oO](_?[0-7])+[lL]?(?=${T})`},{begin:`\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${T})`},{begin:`\\b(${w})[jJ](?=${T})`}]},g={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",h,E,p,e.HASH_COMMENT_MODE]}]};return d.contains=[p,E,h],{name:"Python",aliases:["py","gyp","ipython"],unicodeRegex:!0,keywords:c,illegal:/(<\/|\?)|=>/,contains:[h,E,{scope:"variable.language",match:/\bself\b/},{beginKeywords:"if",relevance:0},{match:/\bor\b/,scope:"keyword"},p,g,e.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,i],scope:{1:"keyword",3:"title.function"},contains:[v]},{variants:[{match:[/\bclass/,/\s+/,i,/\s*/,/\(\s*/,i,/\s*\)/]},{match:[/\bclass/,/\s+/,i]}],scope:{1:"keyword",3:"title.class",6:"title.class.inherited"}},{className:"meta",begin:/^[\t ]*@/,end:/(?=#)|$/,contains:[E,v,p]}]}}const fh="[A-Za-z$_][0-9A-Za-z$_]*",cC=["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"],uC=["true","false","null","undefined","NaN","Infinity"],hC=["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"],dC=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],fC=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],pC=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],gC=[].concat(fC,hC,dC);function vO(e){const n=e.regex,i=(V,{after:j})=>{const P="</"+V[0].slice(1);return V.input.indexOf(P,j)!==-1},s=fh,o={begin:"<>",end:"</>"},f=/<[A-Za-z0-9\\._:-]+\s*\/>/,_={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(V,j)=>{const P=V[0].length+V.index,D=V.input[P];if(D==="<"||D===","){j.ignoreMatch();return}D===">"&&(i(V,{after:P})||j.ignoreMatch());let U;const G=V.input.substring(P);if(U=G.match(/^\s*=/)){j.ignoreMatch();return}if((U=G.match(/^\s+extends\s+/))&&U.index===0){j.ignoreMatch();return}}},c={$pattern:fh,keyword:cC,literal:uC,built_in:gC,"variable.language":pC},h="[0-9](_?[0-9])*",d=`\\.(${h})`,y="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",p={className:"number",variants:[{begin:`(\\b(${y})((${d})|\\.)?|(${d}))[eE][+-]?(${h})\\b`},{begin:`\\b(${y})\\b((${d})\\b|\\.)?|(${d})\\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},w={className:"subst",begin:"\\$\\{",end:"\\}",keywords:c,contains:[]},C={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,w],subLanguage:"xml"}},T={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,w],subLanguage:"css"}},E={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,w],subLanguage:"graphql"}},g={className:"string",begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,w]},m={className:"comment",variants:[e.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:s+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]},S=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,C,T,E,g,{match:/\$\d+/},p];w.contains=S.concat({begin:/\{/,end:/\}/,keywords:c,contains:["self"].concat(S)});const k=[].concat(m,w.contains),L=k.concat([{begin:/(\s*)\(/,end:/\)/,keywords:c,contains:["self"].concat(k)}]),R={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:c,contains:L},M={variants:[{match:[/class/,/\s+/,s,/\s+/,/extends/,/\s+/,n.concat(s,"(",n.concat(/\./,s),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,s],scope:{1:"keyword",3:"title.class"}}]},A={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:{_:[...hC,...dC]}},B={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},K={variants:[{match:[/function/,/\s+/,s,/(?=\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 W(V){return n.concat("(?!",V.join("|"),")")}const I={match:n.concat(/\b/,W([...fC,"super","import"].map(V=>`${V}\\s*\\(`)),s,n.lookahead(/\s*\(/)),className:"title.function",relevance:0},Z={begin:n.concat(/\./,n.lookahead(n.concat(s,/(?![0-9A-Za-z$_(])/))),end:s,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},X={match:[/get|set/,/\s+/,s,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},R]},z="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",q={match:[/const|var|let/,/\s+/,s,/\s*/,/=\s*/,/(async\s*)?/,n.lookahead(z)],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:A},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),B,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,C,T,E,g,m,{match:/\$\d+/},p,A,{scope:"attr",match:s+n.lookahead(":"),relevance:0},q,{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[m,e.REGEXP_MODE,{className:"function",begin:z,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:o.begin,end:o.end},{match:f},{begin:_.begin,"on:begin":_.isTrulyOpeningTag,end:_.end}],subLanguage:"xml",contains:[{begin:_.begin,end:_.end,skip:!0,contains:["self"]}]}]},K,{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:s,className:"title.function"})]},{match:/\.\.\./,relevance:0},Z,{match:"\\$"+s,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[R]},I,F,M,X,{match:/\$[(.]/}]}}function My(e){const n=e.regex,i=vO(e),s=fh,o=["any","void","number","boolean","string","object","never","symbol","bigint","unknown"],f={begin:[/namespace/,/\s+/,e.IDENT_RE],beginScope:{1:"keyword",3:"title.class"}},_={beginKeywords:"interface",end:/\{/,excludeEnd:!0,keywords:{keyword:"interface extends",built_in:o},contains:[i.exports.CLASS_REFERENCE]},c={className:"meta",relevance:10,begin:/^\s*['"]use strict['"]/},h=["type","interface","public","private","protected","implements","declare","abstract","readonly","enum","override","satisfies"],d={$pattern:fh,keyword:cC.concat(h),literal:uC,built_in:gC.concat(o),"variable.language":pC},y={className:"meta",begin:"@"+s},p=(E,g,v)=>{const m=E.contains.findIndex(S=>S.label===g);if(m===-1)throw new Error("can not find mode to replace");E.contains.splice(m,1,v)};Object.assign(i.keywords,d),i.exports.PARAMS_CONTAINS.push(y);const w=i.contains.find(E=>E.scope==="attr"),C=Object.assign({},w,{match:n.concat(s,n.lookahead(/\s*\?:/))});i.exports.PARAMS_CONTAINS.push([i.exports.CLASS_REFERENCE,w,C]),i.contains=i.contains.concat([y,f,_,C]),p(i,"shebang",e.SHEBANG()),p(i,"use_strict",c);const T=i.contains.find(E=>E.label==="func.def");return T.relevance=0,Object.assign(i,{name:"TypeScript",aliases:["ts","tsx","mts","cts"]}),i}const bO=/\[\[wiki:([^\]]+)\]\]/g,yO=/^\uFEFF?---[ \t]*\r?\n([\s\S]*?)\r?\n---[ \t]*(?:\r?\n|$)/,SO=/^(\S[^:]*?):[ \t]*(.*)$/,wO=new tC({gfm:!0,breaks:!1}),Ny={ALLOWED_URI_REGEXP:/^(?:(?:https?|mailto):|[#/]|\.{0,2}\/|[^:]+$)/i,ADD_ATTR:["target","rel","data-entry-id"]},_p=IO();function ph(e,n={}){const{entries:i,content:s}=EO(e),o=AO(s,n.resolveWikiLink),f=wO.parse(o,{async:!1}),_=TO(i),c=Ul.sanitize(_+f,Ny),h=new DOMParser().parseFromString(c,"text/html");return LO(h,n.omitDuplicateTitle),RO(h),MO(h),OO(h),{html:Ul.sanitize(h.body.innerHTML,Ny),toc:DO(h)}}function xO(e){const n=new TextEncoder().encode(e);let i="";for(const s of n)i+=String.fromCharCode(s);return btoa(i)}function CO(e){const n=atob(e),i=new Uint8Array(n.length);for(let s=0;s<n.length;s++)i[s]=n.charCodeAt(s);return new TextDecoder().decode(i)}function EO(e){const n=yO.exec(e);return n?{entries:kO(n[1]??""),content:e.slice(n[0].length)}:{entries:[],content:e}}function kO(e){const n=[];for(const i of e.split(/\r?\n/)){const s=i.replace(/\s+$/,"");if(s.trim()==="")continue;const o=SO.exec(s);if(o){const[,c="",h=""]=o;n.push({key:c.trim(),value:h.trim()});continue}const f=n[n.length-1];if(!f)continue;const _=s.trim();f.value=f.value?`${f.value} ${_}`:_}return n}function TO(e){return e.length===0?"":`<dl class="frontmatter">${e.map(i=>`<dt>${Fl(i.key)}</dt><dd>${Fl(i.value)}</dd>`).join("")}</dl>`}function AO(e,n){return e.replace(bO,(i,s)=>{const o=s.trim();if(!o)return"";if(!n)return Fl(`[[wiki:${o}]]`);const f=n(o);if(f===null)return Fl(`[[wiki:${o}]]`);const _=Fl(o),c=encodeURIComponent(o);return`<a href="${f}" data-entry-id="${c}">${_}</a>`})}function RO(e){const n=new Map;for(const i of e.querySelectorAll("h2, h3")){const s=i.textContent?.trim()??"",o=zO(s||"section"),f=n.get(o)??0;n.set(o,f+1),i.id=f===0?o:`${o}-${f+1}`}}function LO(e,n){if(!n)return;const i=e.body.querySelector("h1, h2, h3, h4, h5, h6");!i||i.tagName.toLowerCase()!=="h1"||Oy(i.textContent??"")===Oy(n)&&i.remove()}function MO(e){for(const n of e.querySelectorAll("pre > code")){const i=BO(n.className),s=n.textContent??"",o=n.parentElement;if(!o)continue;if(i==="mermaid"){const _=e.createElement("div");_.className="diagram-block",_.setAttribute("data-mermaid-source",xO(s)),_.setAttribute("data-diagram-state","pending"),o.replaceWith(_);continue}const f=jO(s,i);n.innerHTML=f,n.classList.add("hljs"),o.classList.add("code-block"),o.dataset.code=s,o.insertBefore(NO(e,i||"text"),o.firstChild)}}function NO(e,n){const i=e.createElement("div");i.className="code-block-toolbar";const s=e.createElement("span");s.className="code-block-dots",s.setAttribute("aria-hidden","true");for(let _=0;_<3;_++)s.append(e.createElement("span"));const o=e.createElement("span");o.className="code-block-language",o.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",i.append(s,o,f),i}function OO(e){for(const n of e.querySelectorAll("a")){const i=n.getAttribute("href")??"";PO(i)&&(n.setAttribute("target","_blank"),n.setAttribute("rel","noopener noreferrer"))}}function DO(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 jO(e,n){return n&&_p.getLanguage(n)?_p.highlight(e,{language:n}).value:_p.highlightAuto(e).value}function IO(){return Di.registerLanguage("bash",ky),Di.registerLanguage("sh",ky),Di.registerLanguage("javascript",Ay),Di.registerLanguage("js",Ay),Di.registerLanguage("json",_O),Di.registerLanguage("markdown",Ry),Di.registerLanguage("md",Ry),Di.registerLanguage("python",Ly),Di.registerLanguage("py",Ly),Di.registerLanguage("typescript",My),Di.registerLanguage("ts",My),Di}function BO(e){return e.match(/language-([a-z0-9_-]+)/i)?.[1]?.toLowerCase()??null}function PO(e){return/^[a-z][a-z0-9+.-]*:/i.test(e)&&!e.startsWith(window.location.origin)}function zO(e){return e.trim().toLowerCase().replace(/[^\p{Letter}\p{Number}]+/gu,"-").replace(/^-+|-+$/g,"")||"section"}function Oy(e){return e.trim().replace(/\s+/g," ").toLocaleLowerCase("en-US")}function Fl(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">")}const HO="modulepreload",$O=function(e){return"/console/"+e},Dy={},UO=function(n,i,s){let o=Promise.resolve();if(i&&i.length>0){let h=function(d){return Promise.all(d.map(y=>Promise.resolve(y).then(p=>({status:"fulfilled",value:p}),p=>({status:"rejected",reason:p}))))};document.getElementsByTagName("link");const _=document.querySelector("meta[property=csp-nonce]"),c=_?.nonce||_?.getAttribute("nonce");o=h(i.map(d=>{if(d=$O(d),d in Dy)return;Dy[d]=!0;const y=d.endsWith(".css"),p=y?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${d}"]${p}`))return;const w=document.createElement("link");if(w.rel=y?"stylesheet":HO,y||(w.as="script"),w.crossOrigin="",w.href=d,c&&w.setAttribute("nonce",c),document.head.appendChild(w),y)return new Promise((C,T)=>{w.addEventListener("load",C),w.addEventListener("error",()=>T(new Error(`Unable to preload CSS for ${d}`)))})}))}function f(_){const c=new Event("vite:preloadError",{cancelable:!0});if(c.payload=_,window.dispatchEvent(c),!c.defaultPrevented)throw _}return o.then(_=>{for(const c of _||[])c.status==="rejected"&&f(c.reason);return n().catch(f)})},FO=".diagram-block[data-mermaid-source]:not([data-diagram-state='rendered']):not([data-diagram-state='error'])",WO=["a[href]","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])","[tabindex]:not([tabindex='-1'])"].join(","),GO=/^on/i,qO={USE_PROFILES:{svg:!0,svgFilters:!1},FORBID_TAGS:["foreignObject","script"],FORBID_ATTR:["href","xlink:href"]},jy="diagramInteractionBound",KO=/^oklch\s*\(\s*([^)]+)\s*\)$/i,VO=/^(-?\d+(?:\.\d+)?)(deg)?$/i,Bi=[25,50,75,100,125,150,200],YO=["pie1","pie2","pie3","pie4","pie5","pie6","pie7","pie8","pie9","pie10","pie11","pie12"];let vp=null;const Iy=new WeakSet;let XO=0,ZO=0,Zl=null;function Ss(e){const n=e.trim();if(!n)return n;const i=bD(n);return i?yD(i):n}function mC(e){if(Iy.has(e))return;Iy.add(e),By(e);const n=e instanceof Node?e:document.body;new MutationObserver(s=>{let o=!1;for(const f of s)if(f.type==="childList"){Zl&&!Zl.trigger.isConnected&&Bl(!1);for(const _ of f.addedNodes)if(_ instanceof Element&&(_.matches?.(".diagram-block[data-mermaid-source]")||_.querySelector?.(".diagram-block[data-mermaid-source]"))){o=!0;break}if(o)break}o&&By(e)}).observe(n,{childList:!0,subtree:!0})}function By(e){const n=e.querySelectorAll(FO);for(const i of n)i.dataset.diagramHydrating!=="true"&&(i.dataset.diagramHydrating="true",i.dataset.diagramState="pending",JO(i))}async function JO(e){const n=e.getAttribute("data-mermaid-source")??"";let i="";try{i=CO(n)}catch{bp(e,"Invalid diagram source");return}if(!i.trim()){bp(e,"Empty diagram source");return}try{const s=await eD(),o=`mermaid-diagram-${++XO}`,{svg:f}=await s.render(o,i);e.innerHTML=QO(f),iD(e,f),rD(e),sD(e),e.dataset.diagramState="rendered"}catch(s){const o=s instanceof Error?s.message:String(s);bp(e,o)}}function bp(e,n){e.dataset.diagramState="error",e.textContent=`Diagram render failed: ${n}`}function QO(e){const n=(i,s)=>{GO.test(s.attrName)&&(s.keepAttr=!1)};Ul.addHook("uponSanitizeAttribute",n);try{return Ul.sanitize(e,qO)}finally{Ul.removeHook("uponSanitizeAttribute",n)}}async function eD(){return vp||(vp=(async()=>{const e=await UO(()=>import("./mermaid.core-DPLCTlKT.js").then(i=>i.bC),[]),n=e.default??e;return n.initialize({securityLevel:"strict",htmlLabels:!1,suppressErrorRendering:!0,startOnLoad:!1,theme:"base",look:"handDrawn",themeVariables:tD(),themeCSS:nD(),flowchart:{htmlLabels:!1,useMaxWidth:!1}}),n})()),vp}function tD(){const e=getComputedStyle(document.documentElement),n=(E,g)=>{const v=e.getPropertyValue(E).trim();return Ss(v||g)},i=(E,g)=>e.getPropertyValue(E).trim()||g,s=n("--brass","#c69a4a"),o=n("--brass-bright","#e6b86a"),f=n("--brass-deep","#a0782a"),_=n("--aurora","#8bd7e6"),c=n("--aurora-deep","#1f8aa8"),h=n("--coral","#ef7c63"),d=n("--ink-deep","#1d2734"),y=n("--ink-fog","#a6afbb"),p=n("--ink-pearl","#e6e9ef"),w=n("--ink-spectral","#bcc4d0"),C=[o,s,_,h,Ss("oklch(70% 0.11 68)"),c,Ss("oklch(76% 0.09 205)"),f,Ss("oklch(68% 0.14 30)"),y,Ss("oklch(62% 0.08 228)"),Ss("oklch(52% 0.05 248)")],T=Object.fromEntries(YO.map((E,g)=>[E,C[g]??d]));return{background:"transparent",primaryColor:"transparent",primaryTextColor:p,primaryBorderColor:s,secondaryColor:"transparent",secondaryTextColor:p,secondaryBorderColor:o,tertiaryColor:"transparent",tertiaryTextColor:w,tertiaryBorderColor:s,lineColor:c,edgeLabelBackground:"transparent",titleColor:o,fontFamily:"JetBrains Mono Variable, ui-monospace, monospace",mainBkg:"transparent",nodeBorder:s,clusterBkg:"transparent",clusterBorder:s,pieTitleTextColor:o,pieTitleTextSize:i("--font-size-title-lg","19px"),pieSectionTextColor:p,pieSectionTextSize:i("--font-size-md","13px"),pieLegendTextColor:p,pieLegendTextSize:i("--font-size-lg","14px"),pieStrokeColor:f,pieStrokeWidth:"1.35px",pieOuterStrokeColor:o,pieOuterStrokeWidth:"2.5px",pieOpacity:"0.96",...T}}function nD(){const e=getComputedStyle(document.documentElement),n=(d,y)=>{const p=e.getPropertyValue(d).trim();return Ss(p||y)},i=n("--brass-deep","#a0782a"),s=n("--brass-bright","#e6b86a"),o=n("--aurora-deep","#1f8aa8"),f=n("--ink-abyss","#131920"),_=Ss("oklch(15% 0.04 250 / 34%)"),c=n("--surface-glass","#1d2734"),h=n("--ink-pearl","#e6e9ef");return`
|
|
159
|
-
.node rect, .node polygon, .node circle, .node ellipse, .actor, .classGroup rect {
|
|
160
|
-
stroke: ${i};
|
|
161
|
-
fill: ${c};
|
|
162
|
-
}
|
|
163
|
-
.edgePath path, .messageLine0, .messageLine1, .relation {
|
|
164
|
-
stroke: ${o};
|
|
165
|
-
}
|
|
166
|
-
.nodeLabel, .edgeLabel, .actor text, .messageText {
|
|
167
|
-
fill: ${h};
|
|
168
|
-
font-family: "Manrope Variable", "Manrope", ui-sans-serif, sans-serif;
|
|
169
|
-
}
|
|
170
|
-
.pieCircle {
|
|
171
|
-
stroke: ${i};
|
|
172
|
-
stroke-width: 1.35px;
|
|
173
|
-
opacity: 0.96;
|
|
174
|
-
filter: drop-shadow(0 0 1.5px ${_});
|
|
175
|
-
}
|
|
176
|
-
.pieOuterCircle {
|
|
177
|
-
stroke: ${s};
|
|
178
|
-
opacity: 0.7;
|
|
179
|
-
}
|
|
180
|
-
.slice, .legend text, .pieTitleText {
|
|
181
|
-
fill: ${h};
|
|
182
|
-
paint-order: stroke;
|
|
183
|
-
stroke: ${f};
|
|
184
|
-
stroke-width: 3px;
|
|
185
|
-
stroke-linejoin: round;
|
|
186
|
-
font-family: "Manrope Variable", "Manrope", ui-sans-serif, sans-serif;
|
|
187
|
-
}
|
|
188
|
-
.slice {
|
|
189
|
-
font-weight: 600;
|
|
190
|
-
letter-spacing: 0.04em;
|
|
191
|
-
font-style: italic;
|
|
192
|
-
}
|
|
193
|
-
.pieTitleText {
|
|
194
|
-
font-weight: 600;
|
|
195
|
-
letter-spacing: 0.12em;
|
|
196
|
-
font-style: italic;
|
|
197
|
-
}
|
|
198
|
-
.legend text {
|
|
199
|
-
font-weight: 500;
|
|
200
|
-
letter-spacing: 0.03em;
|
|
201
|
-
}
|
|
202
|
-
.legend rect {
|
|
203
|
-
rx: 999px;
|
|
204
|
-
ry: 999px;
|
|
205
|
-
opacity: 0.9;
|
|
206
|
-
stroke: ${f};
|
|
207
|
-
stroke-width: 1.5px;
|
|
208
|
-
paint-order: stroke;
|
|
209
|
-
filter: saturate(0.78) brightness(0.92) drop-shadow(0 0 0.55px ${s});
|
|
210
|
-
}
|
|
211
|
-
`}function iD(e,n){const i=new DOMParser().parseFromString(n,"image/svg+xml"),s=Array.from(i.querySelectorAll("a")),o=Array.from(e.querySelectorAll("a")),f=Math.min(s.length,o.length);for(let _=0;_<f;_++){const c=s[_],h=o[_];if(!c||!h)continue;const d=c.getAttribute("href")??c.getAttribute("xlink:href")??"",y=vC(d);y&&h.setAttribute("href",y)}}function rD(e){const n=e.querySelector("svg");if(!n)return;let i;try{i=n.getBBox()}catch{return}const{x:s,y:o,width:f,height:_}=i;!Number.isFinite(s)||!Number.isFinite(o)||!Number.isFinite(f)||!Number.isFinite(_)||s<0||o<0||f<=0||_<=0||n.setAttribute("viewBox",`${io(s)} ${io(o)} ${io(f)} ${io(_)}`)}function sD(e){e.tabIndex=0,e.setAttribute("aria-label","Open diagram in expanded view"),mD(e),e.dataset[jy]!=="true"&&(e.dataset[jy]="true",e.addEventListener("click",aD),e.addEventListener("keydown",oD))}function aD(e){if(e.metaKey||e.ctrlKey||e.shiftKey||e.altKey||e.button!==0||gh(e.target))return;const n=e.currentTarget;n instanceof HTMLElement&&(e.preventDefault(),_C(n))}function oD(e){if(e.key!=="Enter"&&e.key!==" "||gh(e.target))return;const n=e.currentTarget;n instanceof HTMLElement&&(e.preventDefault(),_C(n))}function _C(e){const n=e.querySelector("svg");if(!n)return;Bl(!1);const i=typeof HTMLDialogElement<"u"&&typeof HTMLDialogElement.prototype.showModal=="function",s=document.createElement(i?"dialog":"div"),o=++ZO,f=`diagram-lightbox-title-${o}`;s.className="diagram-lightbox",s.setAttribute("aria-labelledby",f),i||(s.setAttribute("role","dialog"),s.setAttribute("aria-modal","true"),s.tabIndex=-1);const _=document.createElement("div");_.className="diagram-lightbox__frame";const c=document.createElement("div");c.className="diagram-lightbox__header";const h=document.createElement("h2");h.id=f,h.textContent="MANIFEST · DIAGRAM";const d=document.createElement("button");d.className="diagram-lightbox__close",d.type="button",d.setAttribute("aria-label","Close expanded diagram"),d.textContent="Close";const y=document.createElement("div");y.className="diagram-lightbox__controls",y.setAttribute("aria-label","Diagram zoom controls");const p=Nu("−","Zoom out","out"),w=document.createElement("span");w.className="diagram-lightbox__zoom-readout",w.setAttribute("aria-live","polite");const C=Nu("+","Zoom in","in"),T=Nu("Fit","Fit diagram to viewport","fit"),E=Nu("Reset","Reset diagram zoom","reset");y.append(p,w,C,T,E);const g=document.createElement("div");g.className="diagram-lightbox__viewport";const v=uD(n),m=n.cloneNode(!0);m.removeAttribute("style"),dD(m,`diagram-lightbox-svg-${o}`),g.append(m),c.append(h,y,d),_.append(c,g),s.append(_),document.body.append(s);const S=new lD(g,m,w,v);p.addEventListener("click",()=>S.zoomOut()),C.addEventListener("click",()=>S.zoomIn()),T.addEventListener("click",()=>S.fit()),E.addEventListener("click",()=>S.reset());const k=fD(s),L=A=>{(A.target===s||A.target===d)&&Bl(!0)},R=A=>{if(A.key==="Escape"){A.preventDefault(),Bl(!0);return}S.handleKeyboard(A)||A.key==="Tab"&&gD(A,s)},M={dialog:s,trigger:e,inertStates:k,onClick:L,onKeyDown:R,cleanupPanZoom:()=>S.destroy()};i&&(M.onCancel=A=>{A.preventDefault(),Bl(!0)},s.addEventListener("cancel",M.onCancel),s.showModal()),s.addEventListener("click",L),document.addEventListener("keydown",R,!0),Zl=M,S.fit(),d.focus()}function Nu(e,n,i){const s=document.createElement("button");return s.className="diagram-lightbox__zoom-button",s.type="button",s.dataset.zoomAction=i,s.setAttribute("aria-label",n),s.textContent=e,s}class lD{constructor(n,i,s,o){this.viewport=n,this.svg=i,this.readout=s,this.baseSize=o,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=Bi.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,Bi.length-1))}zoomOut(){this.zoomAroundViewportCenter(Math.max(this.zoomIndex-1,0))}reset(){this.zoomAroundViewportCenter(Bi.indexOf(100))}fit(){const n=this.viewport.clientWidth||this.viewport.getBoundingClientRect().width||this.baseSize.width,i=this.viewport.clientHeight||this.viewport.getBoundingClientRect().height||this.baseSize.height,s=Math.min(n/this.baseSize.width,i/this.baseSize.height),o=Math.floor(s*100),f=Bi.findIndex(c=>c>o),_=f===-1?Bi.length-1:Math.max(0,f-1);this.applyZoom(_),this.viewport.scrollLeft=Math.max(0,(this.svgWidth-n)/2),this.viewport.scrollTop=Math.max(0,(this.svgHeight-i)/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*(Ou(this.zoomIndex)/100)}get svgHeight(){return this.baseSize.height*(Ou(this.zoomIndex)/100)}applyZoom(n){this.zoomIndex=n;const i=Ou(this.zoomIndex),s=i/100;this.svg.setAttribute("width",io(this.baseSize.width*s)),this.svg.setAttribute("height",io(this.baseSize.height*s)),this.readout.textContent=`${i}%`}zoomAroundViewportCenter(n){const i=this.viewport.getBoundingClientRect();this.zoomAroundPoint(n,i.left+i.width/2,i.top+i.height/2)}zoomAroundPoint(n,i,s){if(n===this.zoomIndex)return;const o=this.svgWidth,f=this.svgHeight,_=this.viewport.getBoundingClientRect(),c=this.viewport.scrollLeft+i-_.left,h=this.viewport.scrollTop+s-_.top;this.applyZoom(n),this.viewport.scrollLeft=c/o*this.svgWidth-(i-_.left),this.viewport.scrollTop=h/f*this.svgHeight-(s-_.top)}onPointerDown=n=>{if(n.button!==0||gh(n.target))return;const i=n.pointerId??1;if(this.pointers.set(i,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:i},this.viewport.setPointerCapture?.(i)};onPointerMove=n=>{const i=n.pointerId??1;if(this.pointers.has(i)&&this.pointers.set(i,n),this.pinchStart&&this.pointers.size>=2){const s=this.pointerDistance()/this.pinchStart.distance,o=Ou(this.pinchStart.zoomIndex)*s;this.applyZoom(hD(o));return}!this.dragStart||this.dragStart.pointerId!==i||(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 i=n.pointerId??1;this.pointers.delete(i),this.viewport.releasePointerCapture?.(i),this.dragStart?.pointerId===i&&(this.dragStart=null),this.pointers.size<2&&(this.pinchStart=null)};onWheel=n=>{if(!n.ctrlKey&&!n.metaKey)return;n.preventDefault();const i=n.deltaY<0?Math.min(this.zoomIndex+1,Bi.length-1):Math.max(this.zoomIndex-1,0);this.zoomAroundPoint(i,n.clientX,n.clientY)};onDoubleClick=n=>{gh(n.target)||(n.preventDefault(),this.zoomAroundPoint(this.zoomIndex===Bi.indexOf(200)?Bi.indexOf(100):Bi.indexOf(200),n.clientX,n.clientY))};onResize=()=>{this.fit()};pointerDistance(){const[n,i]=Array.from(this.pointers.values());return!n||!i?1:Math.hypot(i.clientX-n.clientX,i.clientY-n.clientY)}}function cD(e){const n=Py(e.getAttribute("width")),i=Py(e.getAttribute("height"));if(n&&i)return{width:n,height:i};const s=e.getAttribute("viewBox")?.trim().split(/[\s,]+/).map(Number)??[],o=s[2],f=s[3],_=o!==void 0&&Number.isFinite(o)&&o>0?o:null,c=f!==void 0&&Number.isFinite(f)&&f>0?f:null;return{width:n??_??800,height:i??c??600}}function uD(e){const n=e.getBoundingClientRect();return n.width>0&&n.height>0?{width:n.width,height:n.height}:cD(e)}function Py(e){if(!e)return null;const n=/^(\d+(?:\.\d+)?)/.exec(e.trim());if(!n)return null;const i=Number(n[1]);return Number.isFinite(i)&&i>0?i:null}function io(e){return Number.isInteger(e)?String(e):e.toFixed(2).replace(/\.?0+$/,"")}function hD(e){let n=0,i=Number.POSITIVE_INFINITY;return Bi.forEach((s,o)=>{const f=Math.abs(s-e);f<i&&(i=f,n=o)}),n}function Ou(e){return Bi[e]??Bi[0]}function dD(e,n){const i=e.getAttribute("id")??"";e.setAttribute("id",n);const s=e.querySelector("style");!i||!s?.textContent||(s.textContent=s.textContent.split(`#${i}`).join(`#${n}`))}function Bl(e){const n=Zl;n&&(n.dialog.removeEventListener("click",n.onClick),document.removeEventListener("keydown",n.onKeyDown,!0),n.onCancel&&n.dialog.removeEventListener("cancel",n.onCancel),n.cleanupPanZoom(),pD(n.inertStates),n.dialog instanceof HTMLDialogElement&&n.dialog.open&&typeof n.dialog.close=="function"&&n.dialog.close(),n.dialog.remove(),Zl=null,e&&n.trigger.isConnected&&n.trigger.focus())}function fD(e){const n=[];for(const i of Array.from(document.body.children))!(i instanceof HTMLElement)||i===e||(n.push({element:i,ariaHidden:i.getAttribute("aria-hidden"),inert:i.inert}),i.inert=!0,i.setAttribute("aria-hidden","true"));return n}function pD(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 gD(e,n){const i=Array.from(n.querySelectorAll(WO)).filter(vD);if(i.length===0){e.preventDefault(),n.focus();return}const s=i[0],o=i[i.length-1];!s||!o||(e.shiftKey&&document.activeElement===s?(e.preventDefault(),o.focus()):!e.shiftKey&&document.activeElement===o&&(e.preventDefault(),s.focus()))}function mD(e){e.querySelector("a[href]")?e.removeAttribute("role"):e.setAttribute("role","button")}function gh(e){if(!(e instanceof Element))return!1;const n=e.closest("a[href]");return!n||!(n.getAttribute("href")?.trim()??"")?!1:!_D(n)}function _D(e){return Array.from(e.children).some(n=>n.tagName.toLowerCase()==="svg")}function vD(e){return!(e.inert||e.hidden||e.getAttribute("aria-hidden")==="true"||"disabled"in e&&e.disabled)}function vC(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 s;try{s=new URL(n)}catch{return null}return s.origin!==window.location.origin?null:vC(s.pathname)}if(/^\/entry\/[^/?#]+$/.exec(n)){const s=n.slice(7);let o;try{o=decodeURIComponent(s)}catch{return null}return/^[A-Za-z0-9][A-Za-z0-9._-]{0,127}$/.test(o)?`/entry/${encodeURIComponent(o)}`:null}return/^[A-Za-z0-9][A-Za-z0-9._-]{0,127}$/.test(n)?`/entry/${encodeURIComponent(n)}`:null}function bD(e){const n=KO.exec(e);if(!n)return null;const i=n[1]?.trim();if(!i)return null;const s=i.indexOf("/"),o=s>=0?i.slice(0,s):i,f=s>=0?i.slice(s+1).trim():"",_=o.trim().split(/[\s,]+/).filter(Boolean);if(_.length!==3)return null;const[c,h,d]=_;if(!c||!h||!d)return null;const y=yp(c,1),p=yp(h,.4),w=SD(d);if(y===null||p===null||w===null)return null;let C=1;if(s>=0){const T=yp(f,1);if(T===null)return null;C=T}return{L:y,C:p,h:w,alpha:C}}function yD(e){const n=e.h*Math.PI/180,i=e.C*Math.cos(n),s=e.C*Math.sin(n),o=e.L,f=o+.3963377774*i+.2158037573*s,_=o-.1055613458*i-.0638541728*s,c=o-.0894841775*i-1.291485548*s,h=f**3,d=_**3,y=c**3,p=4.0767416621*h-3.3077115913*d+.2309699292*y,w=-1.2684380046*h+2.6097574011*d-.3413193965*y,C=-.0041960863*h-.7034186147*d+1.707614701*y,T=Du(Sp(p)),E=Du(Sp(w)),g=Du(Sp(C));if(e.alpha<1){const v=Du(e.alpha);return`#${Vs(T)}${Vs(E)}${Vs(g)}${Vs(v)}`}return`#${Vs(T)}${Vs(E)}${Vs(g)}`}function yp(e,n){if(!e)return null;if(e.endsWith("%")){const s=Number(e.slice(0,-1));return Number.isFinite(s)?s/100*n:null}const i=Number(e);return Number.isFinite(i)?i:null}function SD(e){const n=VO.exec(e);if(!n)return null;const i=Number(n[1]);return Number.isFinite(i)?i:null}function Sp(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 Du(e){return Math.round(Math.max(0,Math.min(1,e))*255)}function Vs(e){return e.toString(16).padStart(2,"0")}function wD({content:e,truncated:n}){const i=N.useMemo(()=>{const f=ph(e).html,_=new DOMParser().parseFromString(f,"text/html");return wp(_.body),_.body.innerHTML},[e]),s=N.useRef(null);N.useEffect(()=>{const f=s.current;if(!f)return;mC(f),wp(f);const _=new MutationObserver(()=>wp(f));return _.observe(f,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["href","src","srcset"]}),()=>_.disconnect()},[i]);const o=N.useCallback(f=>{const _=f.target.closest('[data-action="copy-code"]');if(!_)return;const c=_.closest("pre")?.getAttribute("data-code");if(!c)return;navigator.clipboard?.writeText(c);const h=_.textContent;_.textContent="Copied",window.setTimeout(()=>{_.textContent=h},1200)},[]);return u.jsxs("div",{className:"fexp-md-wrap",children:[n&&u.jsx("div",{className:"fexp-truncated-badge",children:"File is too large — showing a partial preview"}),u.jsx("div",{ref:s,className:"markdown-body",onClick:o,dangerouslySetInnerHTML:{__html:i}})]})}function wp(e){for(const n of e.querySelectorAll("a[href]")){const i=n.getAttribute("href")??"";i&&!/^(https?:|mailto:|#)/i.test(i)&&(n.removeAttribute("href"),n.setAttribute("role","link"),n.setAttribute("aria-disabled","true"))}for(const n of e.querySelectorAll("img[src], img[srcset], source[src], source[srcset]"))n.removeAttribute("src"),n.removeAttribute("srcset"),n.tagName==="IMG"&&n.setAttribute("aria-hidden","true")}const xD=.55,Ag={selectedPath:null,viewState:{kind:"none"},splitRatio:xD},bC=new Map,Rg=new Set;function CD(){for(const e of Rg)e()}function yC(e){return bC.get(e)??Ag}function Bm(e,n){bC.set(e,{...yC(e),...n}),CD()}function ED(e){return Rg.add(e),()=>{Rg.delete(e)}}function kD(e){return N.useSyncExternalStore(ED,()=>e!=null?yC(e):Ag,()=>Ag)}function zy(e,n){e&&Bm(e,{selectedPath:n})}function Ys(e,n){e&&Bm(e,{viewState:n})}function TD(e,n){e&&Bm(e,{splitRatio:n})}const AD=new Set([".png",".jpg",".jpeg",".webp",".gif"]),Hy=200,$y=160,RD=360;function LD(e){return{listFolder:async n=>{if(!e)throw new Error("no_theater");const i=await fetch("/plugins/file-explorer/files/list",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({theaterId:e,relativePath:n??""})});if(!i.ok){const s=await i.json();throw new Error(s.error??"list_failed")}return i.json()}}}function MD({theaterId:e}){const{selectedPath:n,viewState:i,splitRatio:s}=kD(e),o=N.useRef(s);o.current=s;const f=N.useRef(null),[_,c]=N.useState(!1),h=N.useMemo(()=>LD(e),[e]),d=N.useCallback(async C=>{if(C.kind!=="file")return;zy(e,C.relativePath);const T=C.name,E=T.slice(T.lastIndexOf(".")).toLowerCase();if(AD.has(E)){const g=e?`/plugins/file-explorer/files/image?theaterId=${encodeURIComponent(e)}&path=${encodeURIComponent(C.relativePath)}`:"";Ys(e,{kind:"image",relativePath:C.relativePath,name:T,src:g});return}Ys(e,{kind:"loading"});try{const g=await fetch("/plugins/file-explorer/files/read",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({theaterId:e,relativePath:C.relativePath})});if(!g.ok){const m=await g.json();throw new Error(m.error??"read_failed")}const v=await g.json();if(v.binary){Ys(e,{kind:"binary",name:T});return}Ys(e,{kind:"code",relativePath:v.relativePath,content:v.content,lang:v.lang,truncated:v.truncated})}catch(g){const v=g instanceof Error?g.message:"Unable to load file";v==="binary_file"?Ys(e,{kind:"binary",name:T}):Ys(e,{kind:"error",message:v})}},[e]),y=N.useCallback(()=>{Ys(e,{kind:"none"}),zy(e,null)},[e]),p=N.useCallback(C=>{C.preventDefault();const T=f.current;if(!T)return;const E=T.getBoundingClientRect().width,g=C.clientX,v=o.current;c(!0);const m=k=>{const L=k.clientX-g,R=Math.max(Hy/E,Math.min(1-$y/E,v+L/E));o.current=R,TD(e,R)},S=()=>{document.removeEventListener("pointermove",m),document.removeEventListener("pointerup",S),c(!1)};document.addEventListener("pointermove",m),document.addEventListener("pointerup",S)},[e]),w=i.kind!=="none";return u.jsxs("div",{ref:f,className:`fexp-root${_?" is-dragging":""}`,style:{gridTemplateColumns:`minmax(${Hy}px, ${s}fr) 4px minmax(${$y}px, ${1-s}fr)`},children:[u.jsxs("div",{className:"fexp-viewer-pane",children:[u.jsxs("div",{className:"fexp-viewer-head",children:[u.jsx("span",{className:"fexp-viewer-filename",children:w&&i.kind!=="loading"&&i.kind!=="error"?"relativePath"in i?i.relativePath:i.name:""}),w&&u.jsx("button",{className:"fexp-viewer-close",type:"button",onClick:y,"aria-label":"Close viewer",children:"✕"})]}),u.jsxs("div",{className:"fexp-viewer-body",children:[i.kind==="none"&&u.jsx("div",{className:"fexp-viewer-empty",children:"Select an item in the file tree to preview its contents here."}),i.kind==="loading"&&u.jsx("div",{className:"fexp-viewer-loading",children:"Loading…"}),i.kind==="error"&&u.jsx("div",{className:"fexp-viewer-error",children:i.message}),i.kind==="code"&&i.lang==="markdown"&&u.jsx(wD,{content:i.content,truncated:i.truncated}),i.kind==="code"&&i.lang!=="markdown"&&u.jsx(tN,{content:i.content,lang:i.lang,truncated:i.truncated}),i.kind==="image"&&u.jsx(rN,{src:i.src,name:i.name}),i.kind==="binary"&&u.jsx(W4,{name:i.name})]})]}),u.jsx("div",{className:"fexp-divider",onPointerDown:p,"aria-hidden":"true"}),u.jsx("div",{className:"fexp-tree-pane",children:u.jsx(U4,{files:h,theaterId:e,selectedPath:n,onSelect:d})})]})}function ND(){return u.jsx("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none","aria-hidden":"true",children:u.jsx("path",{d:"M3 5a2 2 0 012-2h3.586a1 1 0 01.707.293L10.707 4.7A1 1 0 0011.414 5H15a2 2 0 012 2v8a2 2 0 01-2 2H5a2 2 0 01-2-2V5z",stroke:"currentColor",strokeWidth:"1.5",strokeLinejoin:"round"})})}const OD={id:"file-explorer",title:"Files",icon:ND,render:e=>u.jsx(MD,{...e}),preferredExtraWidth:RD},DD={id:"file-explorer",railPanels:[OD]},jD=[DD],ID={M:"M",A:"A",D:"D",R:"R",U:"U"};function BD(e){const n={dirs:{},files:[]};for(const i of e){const s=i.path.split("/");s.pop();let o=n;for(const f of s)o.dirs[f]||(o.dirs[f]={dirs:{},files:[]}),o=o.dirs[f];o.files.push(i)}return n}function PD({files:e,selectedPath:n,onSelect:i}){const s=BD(e);return u.jsx(SC,{node:s,depth:0,selectedPath:n,onSelect:i})}function SC({node:e,depth:n,selectedPath:i,onSelect:s}){return u.jsxs(u.Fragment,{children:[Object.entries(e.dirs).map(([o,f])=>u.jsx(zD,{dirKey:o,node:f,depth:n,selectedPath:i,onSelect:s},o)),e.files.map(o=>u.jsx(HD,{entry:o,depth:n,selectedPath:i,onSelect:s},o.path))]})}function zD({dirKey:e,node:n,depth:i,selectedPath:s,onSelect:o}){const[f,_]=N.useState(!1),c=N.useCallback(()=>_(p=>!p),[]);let h=e,d=n;for(;Object.keys(d.dirs).length===1&&d.files.length===0;){const p=Object.keys(d.dirs)[0];h+="/"+p,d=d.dirs[p]}const y=i*16+12;return u.jsxs("div",{className:`diff-folder${f?" is-collapsed":""}`,children:[u.jsxs("button",{type:"button",className:"diff-folder-row",style:{paddingLeft:`${y}px`},onClick:c,"aria-expanded":!f,children:[u.jsx("svg",{className:"diff-folder-chevron",viewBox:"0 0 12 12",fill:"none","aria-hidden":"true",children:u.jsx("path",{d:"M3 4.5L6 7.5L9 4.5",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round"})}),u.jsx("svg",{className:"diff-folder-icon",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:u.jsx("path",{d:"M2 4a1 1 0 011-1h3l1.2 1.2H13a1 1 0 011 1V12a1 1 0 01-1 1H3a1 1 0 01-1-1V4z",stroke:"currentColor",strokeWidth:"1.3",strokeLinejoin:"round"})}),u.jsx("span",{className:"diff-folder-name",children:h})]}),!f&&u.jsx(SC,{node:d,depth:i+1,selectedPath:s,onSelect:o})]})}function HD({entry:e,depth:n,selectedPath:i,onSelect:s}){const o=e.path===i,f=N.useCallback(()=>s(e),[e,s]),_=n*16+12,c=e.path.split("/").pop()??e.path;return u.jsxs("button",{type:"button",className:`diff-file-row${o?" is-cur":""}`,style:{paddingLeft:`${_}px`},title:e.path,onClick:f,children:[u.jsx("span",{className:`diff-status-glyph diff-status-${e.status.toLowerCase()}`,"aria-label":e.status,children:ID[e.status]??e.status}),u.jsx("span",{className:"diff-file-name",children:c}),u.jsxs("span",{className:"diff-nums",children:[e.additions>0&&u.jsxs("span",{className:"diff-additions",children:["+",e.additions]}),e.deletions>0&&u.jsxs("span",{className:"diff-deletions",children:["−",e.deletions]})]})]})}const Uy="fleet-console.diff.changesCollapsed",$D={M:"modified",A:"added",D:"deleted",R:"renamed",U:"untracked"};function UD(e){try{return localStorage.getItem(e)==="1"}catch{return!1}}function FD({ctx:e,viewMode:n,selectedPath:i,subPath:s,onSelect:o}){const[f,_]=N.useState({kind:"loading"}),[c,h]=N.useState(0),[d,y]=N.useState(()=>UD(Uy));N.useEffect(()=>{if(!e.theaterId){_({kind:"error",message:"no_theater"});return}let C=!1;return _({kind:"loading"}),fetch("/plugins/diff/changed",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({theaterId:e.theaterId,subPath:s})}).then(async T=>{if(!T.ok){const v=(await T.json()).error??"git_failed";C||_(v==="no_git_repo"||v==="git_unavailable"?{kind:"notice",reason:v}:{kind:"error",message:v});return}const E=await T.json();C||_({kind:"ok",files:E.files})}).catch(T=>{C||_({kind:"error",message:T instanceof Error?T.message:"unknown"})}),()=>{C=!0}},[e.theaterId,s,c]);const p=N.useCallback(()=>h(C=>C+1),[]),w=N.useCallback(()=>{y(C=>{const T=!C;try{localStorage.setItem(Uy,T?"1":"0")}catch{}return T})},[]);if(f.kind==="loading")return u.jsx("div",{className:"diff-sections-loading",children:"Loading…"});if(f.kind==="notice"){const C=f.reason==="no_git_repo"?"Not a Git repository":"Git isn't available",T=f.reason==="no_git_repo"?"This folder isn't a Git repository, so there are no changes to show.":"Git was not found on this system. Install Git and make sure it's on your PATH.";return u.jsxs("div",{className:"diff-sections-notice",children:[u.jsx("strong",{className:"diff-notice-title",children:C}),u.jsx("span",{className:"diff-notice-body",children:T}),u.jsx("button",{type:"button",className:"diff-refresh-btn",onClick:p,children:"Retry"})]})}return f.kind==="error"?u.jsxs("div",{className:"diff-sections-error",children:[u.jsx("span",{children:f.message}),u.jsx("button",{type:"button",className:"diff-refresh-btn",onClick:p,children:"Retry"})]}):u.jsx("div",{className:"diff-sections",children:u.jsxs("div",{className:`diff-section${d?" is-collapsed":""}`,children:[u.jsxs("button",{type:"button",className:"diff-section-head",onClick:w,children:[u.jsx("svg",{className:"diff-section-chevron",viewBox:"0 0 12 12",fill:"none","aria-hidden":"true",children:u.jsx("path",{d:"M3 4.5L6 7.5L9 4.5",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round"})}),u.jsx("span",{className:"diff-section-name",children:"Changes"}),u.jsx("span",{className:"diff-count-badge",children:f.files.length})]}),!d&&u.jsx("div",{className:"diff-section-rows",children:f.files.length===0?u.jsx("div",{className:"diff-empty-row",children:"No changes"}):n==="tree"?u.jsx(PD,{files:f.files,selectedPath:i,onSelect:o}):f.files.map(C=>u.jsx(WD,{entry:C,isSelected:C.path===i,onSelect:o},C.path))})]})})}function WD({entry:e,isSelected:n,onSelect:i}){const s=N.useCallback(()=>i(e),[e,i]),o=e.path.lastIndexOf("/"),f=o>=0?e.path.slice(0,o+1):"",_=o>=0?e.path.slice(o+1):e.path;return u.jsxs("button",{type:"button",className:`diff-file-row${n?" is-cur":""}`,title:e.path,onClick:s,children:[u.jsx("span",{className:`diff-status-glyph diff-status-${e.status.toLowerCase()}`,"aria-label":$D[e.status]??e.status,children:e.status}),u.jsxs("span",{className:"diff-file-name",children:[f&&u.jsx("span",{className:"diff-file-dir",children:f}),_]}),u.jsxs("span",{className:"diff-nums",children:[e.additions>0&&u.jsxs("span",{className:"diff-additions",children:["+",e.additions]}),e.deletions>0&&u.jsxs("span",{className:"diff-deletions",children:["−",e.deletions]})]})]})}const Lg=new Set;let Pm={file:null};function wC(){for(const e of Lg)e()}function GD(e){return Lg.add(e),()=>{Lg.delete(e)}}function Fy(){return Pm}function qD(e){const n=N.useSyncExternalStore(GD,Fy,Fy);return!n.file||n.file.theaterId!==e?null:n.file}function KD(e,n,i){Pm={file:{entry:e,subPath:n,theaterId:i}},wC()}function xp(){Pm={file:null},wC()}function VD(e){return e.split(`
|
|
212
|
-
`).map(n=>n.startsWith("@@")?{kind:"header",text:n}:n.startsWith("+")?{kind:"add",text:n}:n.startsWith("-")?{kind:"del",text:n}:{kind:"ctx",text:n})}function YD(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">")}function XD({ctx:e,file:n,mode:i,subPath:s}){const[o,f]=N.useState({kind:"loading"});if(N.useEffect(()=>{if(!e.theaterId){f({kind:"error",message:"no_theater"});return}let h=!1;return f({kind:"loading"}),e.api.fetch("diff","file",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({theaterId:e.theaterId,filePath:n.path,mode:i,subPath:s})}).then(async d=>{const y=await d.json();h||f({kind:"ok",result:y})}).catch(d=>{h||f({kind:"error",message:d instanceof Error?d.message:"unknown"})}),()=>{h=!0}},[e.api,n.path,i,s,e.theaterId]),o.kind==="loading")return u.jsx("div",{className:"diff-hunk-loading",children:"Loading…"});if(o.kind==="error")return u.jsx("div",{className:"diff-hunk-error",children:o.message});const{result:_}=o,c=VD(_.content);return u.jsxs("div",{className:"diff-hunk-wrap",children:[_.truncated&&u.jsx("div",{className:"diff-truncated-badge",children:"Diff truncated"}),u.jsx("div",{className:"diff-hunk-scroll",children:u.jsx("table",{className:"diff-hunk-table",cellSpacing:0,cellPadding:0,children:u.jsx("tbody",{children:c.map((h,d)=>u.jsx("tr",{className:`diff-line diff-line-${h.kind}`,children:u.jsx("td",{className:"diff-line-code",dangerouslySetInnerHTML:{__html:YD(h.text)}})},d))})})})]})}const xC="fleet-console.diff.viewMode",CC="fleet-console.diff.splitRatio",EC="fleet-console.diff.depth",kC="fleet-console.diff.repo.",Wy=130,Gy=100,ZD=.55,JD=3,QD=[{value:1,label:"1"},{value:2,label:"2"},{value:3,label:"3"},{value:4,label:"4"},{value:5,label:"5"},{value:8,label:"Max"}];function e8(){try{const e=localStorage.getItem(xC);if(e==="list"||e==="tree")return e}catch{}return"list"}function t8(){try{const e=localStorage.getItem(CC);if(e!==null){const n=parseFloat(e);if(!isNaN(n)&&n>0&&n<1)return n}}catch{}return ZD}function n8(){try{const e=localStorage.getItem(EC);if(e!==null){const n=parseInt(e,10);if(!isNaN(n)&&n>=1)return n}}catch{}return JD}function qy(e){try{return localStorage.getItem(kC+e)??""}catch{return""}}function i8(e,n){try{localStorage.setItem(kC+e,n)}catch{}}function r8(e){return e.entry.status==="U"?"untracked":"unified"}function s8(e){return e.split("/").filter(Boolean).pop()??e}function a8({repos:e,loading:n,truncated:i,activeSubPath:s,depth:o,onSelect:f,onDepthChange:_,onRescan:c,onClose:h}){const d=N.useCallback(p=>{p.stopPropagation()},[]),y=N.useCallback(p=>{p.stopPropagation();const w=parseInt(p.target.value,10);isNaN(w)||_(w)},[_]);return u.jsxs("div",{className:"diff-repo-menu",role:"listbox","aria-label":"Repositories",onClick:d,children:[u.jsxs("div",{className:"diff-repo-menu-eyebrow",children:[u.jsx("span",{children:"Repositories"}),!n&&u.jsxs("span",{children:[e.length," found"]})]}),n?u.jsxs("div",{className:"diff-repo-scan",children:[u.jsx("span",{className:"diff-repo-spin","aria-hidden":"true"}),"Scanning to depth ",o,"…"]}):e.length===0?u.jsxs("div",{className:"diff-repo-empty",children:["No Git repositories within depth ",o,"."]}):e.map(p=>{const w=p.relPath===s;return u.jsxs("button",{type:"button",role:"option","aria-selected":w,className:`diff-repo-opt${w?" is-cur":""}`,onClick:()=>{f(p.relPath),h()},children:[u.jsx("svg",{className:"diff-repo-mark",viewBox:"0 0 14 14",fill:"none","aria-hidden":"true",children:w&&u.jsx("path",{d:"M3 7.5L6 10.5L11 4",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round"})}),u.jsxs("span",{children:[u.jsxs("span",{className:"diff-repo-line1",children:[u.jsx("span",{className:"diff-repo-opt-name",children:p.name}),u.jsxs("span",{className:"diff-repo-branch",children:[u.jsx(TC,{}),u.jsx("span",{children:p.branch})]}),p.relPath===""&&u.jsx("span",{className:"diff-repo-badge",children:"root"})]}),u.jsx("span",{className:"diff-repo-opt-path",children:p.relPath===""?"· Theater root":p.relPath})]})]},p.relPath)}),!n&&i&&u.jsx("div",{className:"diff-repo-truncated",children:"List capped — reduce depth to see all repos."}),u.jsxs("div",{className:"diff-repo-menu-foot",children:[u.jsxs("label",{className:"diff-repo-depth",children:["Depth",u.jsx("select",{value:o,onChange:y,onClick:p=>p.stopPropagation(),onMouseDown:p=>p.stopPropagation(),children:QD.map(p=>u.jsx("option",{value:p.value,children:p.label},p.value))})]}),u.jsx("button",{type:"button",className:"diff-repo-rescan",onClick:p=>{p.stopPropagation(),c()},children:"⟳ Rescan"})]})]})}function o8(){return u.jsx("svg",{className:"fico",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:u.jsx("path",{d:"M2 4a1 1 0 011-1h3l1.2 1.2H13a1 1 0 011 1V12a1 1 0 01-1 1H3a1 1 0 01-1-1V4z",stroke:"currentColor",strokeWidth:"1.3",strokeLinejoin:"round"})})}function TC(){return u.jsxs("svg",{className:"bico",viewBox:"0 0 12 12",fill:"none","aria-hidden":"true",children:[u.jsx("circle",{cx:"3",cy:"3",r:"1.6",stroke:"currentColor",strokeWidth:"1.1"}),u.jsx("circle",{cx:"3",cy:"9",r:"1.6",stroke:"currentColor",strokeWidth:"1.1"}),u.jsx("circle",{cx:"9",cy:"3.4",r:"1.6",stroke:"currentColor",strokeWidth:"1.1"}),u.jsx("path",{d:"M3 4.6v2.8M4.4 3.2H7",stroke:"currentColor",strokeWidth:"1.1",strokeLinecap:"round"}),u.jsx("path",{d:"M7.4 4.8C6.4 5.4 4.4 5.6 3.6 7",stroke:"currentColor",strokeWidth:"1.1",strokeLinecap:"round"})]})}function l8(){return u.jsx("svg",{className:"chev",viewBox:"0 0 12 12",fill:"none","aria-hidden":"true",children:u.jsx("path",{d:"M3 4.5L6 7.5L9 4.5",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round"})})}function c8({ctx:e}){const[n,i]=N.useState(e8),s=qD(e.theaterId??null),[o,f]=N.useState(t8),_=N.useRef(o),c=N.useRef(null),[h,d]=N.useState(!1),[y,p]=N.useState(()=>e.theaterId?qy(e.theaterId):""),[w,C]=N.useState(n8),[T,E]=N.useState([]),[g,v]=N.useState(!1),[m,S]=N.useState(!1),[k,L]=N.useState(!1),[R,M]=N.useState(!1),A=N.useRef(0),B=N.useRef(w);B.current=w;const K=N.useCallback(Y=>{if(!e.theaterId)return;const ie=++A.current;v(!0),fetch("/plugins/diff/repos",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({theaterId:e.theaterId,maxDepth:Y})}).then(async se=>{if(ie!==A.current)return;if(!se.ok){v(!1);return}const J=await se.json();if(ie!==A.current)return;const H=J.repos;E(H),M(J.truncated??!1),L(!0),v(!1)}).catch(()=>{ie===A.current&&v(!1)})},[e.theaterId]);N.useEffect(()=>{if(!e.theaterId)return;const Y=qy(e.theaterId);p(Y),E([]),M(!1),L(!1),S(!1),xp(),K(B.current)},[e.theaterId,K]);const F=N.useCallback(Y=>{Y.stopPropagation(),S(ie=>!ie)},[]),W=N.useCallback(()=>S(!1),[]),I=N.useCallback(Y=>{Y!==y&&(p(Y),e.theaterId&&i8(e.theaterId,Y),xp())},[y,e.theaterId]),Z=N.useCallback(Y=>{C(Y);try{localStorage.setItem(EC,String(Y))}catch{}K(Y)},[K]),X=N.useCallback(()=>{K(w)},[K,w]);N.useEffect(()=>{if(!m)return;const Y=()=>S(!1);return document.addEventListener("click",Y),()=>document.removeEventListener("click",Y)},[m]),N.useEffect(()=>{if(!m)return;const Y=ie=>{ie.key==="Escape"&&S(!1)};return document.addEventListener("keydown",Y),()=>document.removeEventListener("keydown",Y)},[m]);const z=N.useCallback(Y=>{e.theaterId&&KD(Y,y,e.theaterId)},[e.theaterId,y]),q=N.useCallback(()=>{xp()},[]),V=N.useCallback(Y=>{i(Y);try{localStorage.setItem(xC,Y)}catch{}},[]),j=N.useCallback(Y=>{Y.preventDefault();const ie=c.current;if(!ie)return;const se=ie.getBoundingClientRect().width,J=Y.clientX,H=_.current;d(!0);const ae=we=>{const ye=we.clientX-J,Le=Wy/se,Oe=1-Gy/se,Fe=H+ye/se,ut=Le<=Oe?Math.max(Le,Math.min(Oe,Fe)):H;_.current=ut,f(ut)},de=()=>{document.removeEventListener("pointermove",ae),document.removeEventListener("pointerup",de),d(!1);try{localStorage.setItem(CC,String(_.current))}catch{}};document.addEventListener("pointermove",ae),document.addEventListener("pointerup",de)},[]),P=T.find(Y=>Y.relPath===y)??null,D=P?.name??(y===""?"Working tree":s8(y)||"Working tree"),U=P?.branch??null,G=s?r8(s):"unified";return u.jsxs("div",{ref:c,className:`diff-root${s?" has-hunk":""}${h?" is-dragging":""}`,style:s?{gridTemplateColumns:`minmax(${Wy}px, ${o}fr) 4px minmax(${Gy}px, ${1-o}fr)`}:void 0,children:[s&&u.jsxs("div",{className:"diff-hunk-pane",children:[u.jsxs("div",{className:"diff-hunk-head",children:[u.jsx("span",{className:"diff-hunk-filename",children:s.entry.path}),u.jsx("button",{type:"button",className:"diff-hunk-close","aria-label":"Close diff",onClick:q,children:"✕"})]}),u.jsx("div",{className:"diff-hunk-body",children:u.jsx(XD,{ctx:e,file:s.entry,mode:G,subPath:s.subPath})})]}),s&&u.jsx("div",{className:"diff-divider",onPointerDown:j,"aria-hidden":"true"}),u.jsxs("div",{className:"diff-tree-pane",children:[u.jsxs("div",{className:"diff-plugin-toolbar",children:[u.jsxs("button",{type:"button",className:"diff-repo-trigger","aria-haspopup":"listbox","aria-expanded":m,onClick:F,children:[u.jsx(o8,{}),u.jsx("span",{className:"nm",children:D}),U&&u.jsxs("span",{className:"brc",children:[u.jsx(TC,{}),u.jsx("span",{className:"bnm",children:U})]}),u.jsx(l8,{})]}),m&&u.jsx(a8,{theaterId:e.theaterId??"",repos:T,loading:g,truncated:R,activeSubPath:y,depth:w,onSelect:I,onDepthChange:Z,onRescan:X,onClose:W}),u.jsxs("div",{className:"diff-view-toggle",children:[u.jsx("button",{type:"button",className:`diff-toggle-btn${n==="list"?" is-active":""}`,title:"List view","aria-pressed":n==="list",onClick:()=>V("list"),children:u.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none","aria-hidden":"true",children:[u.jsx("line",{x1:"2",y1:"3.5",x2:"12",y2:"3.5",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round"}),u.jsx("line",{x1:"2",y1:"7",x2:"12",y2:"7",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round"}),u.jsx("line",{x1:"2",y1:"10.5",x2:"12",y2:"10.5",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round"})]})}),u.jsx("button",{type:"button",className:`diff-toggle-btn${n==="tree"?" is-active":""}`,title:"Tree view","aria-pressed":n==="tree",onClick:()=>V("tree"),children:u.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none","aria-hidden":"true",children:[u.jsx("rect",{x:"1",y:"1",width:"4",height:"4",rx:"1",stroke:"currentColor",strokeWidth:"1.3"}),u.jsx("rect",{x:"9",y:"1",width:"4",height:"4",rx:"1",stroke:"currentColor",strokeWidth:"1.3"}),u.jsx("rect",{x:"1",y:"9",width:"4",height:"4",rx:"1",stroke:"currentColor",strokeWidth:"1.3"}),u.jsx("rect",{x:"9",y:"9",width:"4",height:"4",rx:"1",stroke:"currentColor",strokeWidth:"1.3"})]})})]})]}),u.jsx(FD,{ctx:e,viewMode:n,selectedPath:s?.entry.path??null,subPath:y,onSelect:z})]})]})}function u8(){return u.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 18 18",fill:"none","aria-hidden":"true",children:[u.jsx("rect",{x:"2",y:"4",width:"6",height:"1.5",rx:"0.5",fill:"currentColor",opacity:"0.5"}),u.jsx("rect",{x:"2",y:"7",width:"10",height:"1.5",rx:"0.5",fill:"currentColor"}),u.jsx("rect",{x:"2",y:"10",width:"8",height:"1.5",rx:"0.5",fill:"currentColor",opacity:"0.5"}),u.jsx("rect",{x:"2",y:"13",width:"12",height:"1.5",rx:"0.5",fill:"currentColor"}),u.jsx("line",{x1:"14",y1:"2",x2:"14",y2:"16",stroke:"currentColor",strokeWidth:"1.2"}),u.jsx("polyline",{points:"12,4 14,2 16,4",stroke:"currentColor",strokeWidth:"1.2",fill:"none"}),u.jsx("polyline",{points:"12,14 14,16 16,14",stroke:"currentColor",strokeWidth:"1.2",fill:"none"})]})}const h8={id:"diff",title:"Diff",icon:()=>u.jsx(u8,{}),render:e=>u.jsx(c8,{ctx:e})},d8={id:"diff",railPanels:[h8]},f8=[d8],Ky=750;function AC(){const[e,n]=N.useState({status:"idle",lines:[]}),i=N.useRef(null),s=N.useCallback(()=>{i.current&&(clearTimeout(i.current),i.current=null)},[]);N.useEffect(()=>()=>s(),[s]);const o=N.useCallback(()=>{s(),n({status:"idle",lines:[]})},[s]),f=N.useCallback((_,c)=>{s(),n({status:"running",lines:[]}),(async()=>{const h=await fetch(_,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(c)}).catch(()=>null);if(!h?.ok){n({status:"error",lines:[]});return}const{jobId:d}=await h.json();let y=0;const p=async()=>{const w=await fetch(`/plugins/skills/jobs?jobId=${encodeURIComponent(d)}&cursor=${y}`).catch(()=>null);if(!w?.ok){n(T=>({...T,status:"error"}));return}const C=await w.json();y=C.nextCursor,n(T=>({...T,lines:[...T.lines,...C.lines]})),C.status==="running"?i.current=setTimeout(()=>{p()},Ky):n(T=>({...T,status:C.status}))};i.current=setTimeout(()=>{p()},Ky)})()},[s]);return{...e,start:f,reset:o}}const ju=["claude-code","codex","cursor","opencode"],p8={"claude-code":"Claude",codex:"Codex",cursor:"Cursor",opencode:"OpenCode"},g8="Skills run with full agent permissions. Review before use — open the name to read SKILL.md.",m8=1200;function _8({source:e,skill:n,theaterId:i,onCancel:s,onSuccess:o}){const[f,_]=N.useState(i?"project":"global"),[c,h]=N.useState(!0),[d,y]=N.useState(new Set(ju)),{status:p,lines:w,start:C}=AC(),T=p==="running",E=p==="done",g=p==="error";N.useEffect(()=>{if(!E)return;const k=setTimeout(()=>o(f),m8);return()=>clearTimeout(k)},[E,o,f]);const v=N.useCallback(()=>{h(!0),y(new Set(ju))},[]),m=N.useCallback(k=>{h(!1),y(L=>{const R=new Set(L);return R.has(k)?R.delete(k):R.add(k),R})},[]),S=N.useCallback(()=>{const k=c?ju:Array.from(d);if(k.length===0)return;const L={source:e,skill:n,scope:f,agents:k};f==="project"&&i&&(L.theaterId=i),C("/plugins/skills/install",L)},[c,d,e,n,f,i,C]);return u.jsxs("div",{className:"skills-install-flow",children:[u.jsxs("div",{className:"skills-scope-toggle",children:[u.jsx("button",{type:"button",className:`skills-scope-btn${f==="project"?" is-active":""}`,onClick:()=>_("project"),disabled:!i||T||E,title:i?void 0:"Select a Theater to install project skills",children:"Project"}),u.jsx("button",{type:"button",className:`skills-scope-btn${f==="global"?" is-active":""}`,onClick:()=>_("global"),disabled:T||E,children:"Global"})]}),u.jsxs("div",{className:"skills-agents-row",children:[u.jsx("button",{type:"button",className:`skills-agent-chip${c?" is-active":""}`,onClick:v,disabled:T||E,children:"All agents"}),ju.map(k=>u.jsx("button",{type:"button",className:`skills-agent-chip${!c&&d.has(k)?" is-active":""}`,onClick:()=>m(k),disabled:T||E,children:p8[k]},k))]}),u.jsx("p",{className:"skills-permission-warning",children:g8}),!T&&!E&&!g&&u.jsxs("div",{className:"skills-card-actions",children:[u.jsx("button",{type:"button",className:"skills-btn skills-btn--ghost",onClick:s,children:"Cancel"}),u.jsx("button",{type:"button",className:"skills-btn skills-btn--primary",onClick:S,disabled:!c&&d.size===0,children:"Install now"})]}),(T||E||g)&&u.jsxs("div",{className:"skills-update-log",children:[w.map((k,L)=>u.jsx("div",{className:"skills-update-log-line",children:k},L)),E&&u.jsx("div",{className:"skills-update-log-line skills-update-log-done",children:"✓ Installed"}),g&&u.jsx("div",{className:"skills-update-log-line skills-update-log-error",children:"✗ Install failed"})]})]})}const v8={activeTab:"installed",scope:"project",filterText:"",searchQuery:"",searchResults:[],searchLoading:!1,installedList:[],installedLoading:!1,updateJobId:null,updateJobScope:null,installFormOpenId:null},Mg=new Set;let Zn=v8;function la(){for(const e of Mg)e()}function b8(e){return Mg.add(e),()=>{Mg.delete(e)}}function Vy(){return Zn}function zm(){return N.useSyncExternalStore(b8,Vy,Vy)}function Iu(e){Zn={...Zn,activeTab:e},la()}function Yy(e){Zn={...Zn,scope:e},la()}function y8(e){Zn={...Zn,filterText:e},la()}function S8(e){Zn={...Zn,searchQuery:e},la()}function Qa(e,n){Zn={...Zn,searchResults:e,searchLoading:n},la()}function Cp(e,n){Zn={...Zn,installedList:e,installedLoading:n},la()}function RC(e){Zn={...Zn,installFormOpenId:e},la()}const w8=300,Ku=2;function x8(e){return e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}K`:String(e)}async function C8(e){if(e.length<Ku){Qa([],!1);return}Qa([],!0);try{const n=await fetch(`/plugins/skills/search?q=${encodeURIComponent(e)}&limit=10`);if(!n.ok){Qa([],!1);return}const i=await n.json();Qa(i.skills??[],!1)}catch{Qa([],!1)}}function E8({result:e,theaterId:n,isFormOpen:i,onInstallClick:s,onReadMore:o,onInstallSuccess:f}){const _={name:e.name,scope:"project",agents:[],source:e.source,displayPath:""};return u.jsxs("div",{className:`skills-card${i?" is-expanded":""}`,children:[u.jsxs("div",{className:"skills-card-header",children:[u.jsx("button",{type:"button",className:"skills-card-name-btn",onClick:()=>o(_,e.id),title:"Read SKILL.md preview",children:e.name}),e.installs>0&&u.jsx("span",{className:"skills-card-installs",children:x8(e.installs)})]}),u.jsx("span",{className:"skills-card-meta",children:e.source}),u.jsx("div",{className:"skills-card-actions",children:u.jsx("button",{type:"button",className:"skills-btn skills-btn--primary",onClick:s,children:i?"Cancel":"Install"})}),i&&u.jsx(_8,{source:e.source,skill:e.name,theaterId:n,onCancel:s,onSuccess:c=>{s(),f(e.name,c)}})]})}function k8({theaterId:e,onReadMore:n,onInstallSuccess:i}){const{searchQuery:s,searchResults:o,searchLoading:f,installFormOpenId:_}=zm(),c=N.useRef(null),h=N.useCallback(d=>{if(S8(d),c.current&&clearTimeout(c.current),d.length<Ku){Qa([],!1);return}c.current=setTimeout(()=>{C8(d)},w8)},[]);return N.useEffect(()=>()=>{c.current&&clearTimeout(c.current)},[]),u.jsxs("div",{className:"skills-tab-body",children:[u.jsx("input",{type:"search",className:"skills-filter-input",placeholder:"Search skills.sh registry…",value:s,onChange:d=>h(d.target.value),"aria-label":"Search skills registry"}),f&&u.jsx("div",{className:"skills-empty-state",children:"Searching…"}),!f&&s.length>=Ku&&o.length===0&&u.jsxs("div",{className:"skills-empty-state",children:['No results for "',s,'".']}),!f&&s.length>0&&s.length<Ku&&u.jsx("div",{className:"skills-empty-state",children:"Type at least 2 characters to search."}),u.jsx("div",{className:"skills-card-list",children:o.map(d=>u.jsx(E8,{result:d,theaterId:e,isFormOpen:_===d.id,onInstallClick:()=>RC(_===d.id?null:d.id),onReadMore:n,onInstallSuccess:i},d.id))})]})}const T8=2600;function A8({skill:e,onReadMore:n,onUpdate:i,onRemove:s,isUpdating:o}){const[f,_]=N.useState(!1),c=N.useRef(null),h=N.useCallback(()=>{c.current&&(clearTimeout(c.current),c.current=null)},[]),d=N.useCallback(()=>{f?(h(),_(!1),s?.(e.name,e.scope)):(_(!0),c.current=setTimeout(()=>_(!1),T8))},[f,h,s,e.name,e.scope]);return N.useEffect(()=>()=>h(),[h]),u.jsxs("div",{className:"skills-card",children:[u.jsxs("div",{className:"skills-card-header",children:[u.jsx("button",{type:"button",className:"skills-card-name-btn",onClick:()=>n?.(e),title:"Read SKILL.md",children:e.name}),u.jsx("span",{className:`skills-card-scope-badge skills-card-scope-badge--${e.scope}`,children:e.scope})]}),e.source&&u.jsx("span",{className:"skills-card-meta",children:e.source}),u.jsx("span",{className:"skills-card-meta skills-card-agents",children:e.agents.join(", ")}),u.jsxs("div",{className:"skills-card-actions",children:[i&&u.jsx("button",{type:"button",className:"skills-btn skills-btn--ghost",title:`Updates all ${e.scope} skills`,onClick:()=>i(e.scope),disabled:o,children:o?"Updating…":"Update all"}),s&&u.jsx("button",{type:"button",className:`skills-btn skills-btn--remove${f?" is-armed":""}`,onClick:d,"aria-label":f?`Confirm remove ${e.name}`:`Remove ${e.name}`,children:f?"Remove?":"✕"})]})]})}async function R8(e){const n=e?`?theaterId=${encodeURIComponent(e)}`:"",i=await fetch(`/plugins/skills/list${n}`);return i.ok?(await i.json()).skills??[]:[]}function L8({theaterId:e,onReadMore:n,refreshKey:i}){const{scope:s,filterText:o,installedList:f,installedLoading:_}=zm(),c=AC(),h=N.useRef(null),d=N.useCallback(E=>{Cp([],!0),R8(E).then(g=>Cp(g,!1)).catch(()=>Cp([],!1))},[]);N.useEffect(()=>{d(e)},[e,d,i]),N.useEffect(()=>{(c.status==="done"||c.status==="error")&&d(e)},[c.status,e,d]);const y=N.useCallback(E=>{const g=E;h.current=g;const v={scope:g};e&&(v.theaterId=e),c.start("/plugins/skills/update",v)},[e,c]),p=N.useCallback((E,g)=>{const v={scope:g,skill:E};e&&(v.theaterId=e),fetch("/plugins/skills/remove",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(v)}).then(()=>d(e)).catch(()=>null)},[e,d]),w=s==="project"&&!e?"global":s,C=f.filter(E=>E.scope!==w?!1:o?E.name.toLowerCase().includes(o.toLowerCase()):!0),T=c.status==="running"&&h.current===w;return u.jsxs("div",{className:"skills-tab-body",children:[u.jsxs("div",{className:"skills-scope-toggle",children:[u.jsx("button",{type:"button",className:`skills-scope-btn${w==="project"?" is-active":""}`,onClick:()=>Yy("project"),disabled:!e,title:e?void 0:"Select a Theater to view project skills",children:"Project"}),u.jsx("button",{type:"button",className:`skills-scope-btn${w==="global"?" is-active":""}`,onClick:()=>Yy("global"),children:"Global"})]}),u.jsx("input",{type:"search",className:"skills-filter-input",placeholder:"Filter installed skills…",value:o,onChange:E=>y8(E.target.value),"aria-label":"Filter installed skills"}),(c.status==="running"||c.status==="done"||c.status==="error")&&u.jsxs("div",{className:"skills-update-log",children:[c.lines.map((E,g)=>u.jsx("div",{className:"skills-update-log-line",children:E},g)),c.status==="done"&&u.jsx("div",{className:"skills-update-log-line skills-update-log-done",children:"✓ Update complete"}),c.status==="error"&&u.jsx("div",{className:"skills-update-log-line skills-update-log-error",children:"✗ Update failed"})]}),_&&u.jsx("div",{className:"skills-empty-state",children:"Loading…"}),!_&&C.length===0&&u.jsx("div",{className:"skills-empty-state",children:o?"No skills match the filter.":`No ${w} skills installed.`}),u.jsx("div",{className:"skills-card-list",children:C.map(E=>u.jsx(A8,{skill:E,onReadMore:n,onUpdate:y,onRemove:p,isUpdating:T},`${E.scope}:${E.name}`))})]})}function Ep(e){for(const n of e.querySelectorAll("a[href]")){const i=n.getAttribute("href")??"";i&&!/^(https?:|mailto:|#)/i.test(i)&&(n.removeAttribute("href"),n.setAttribute("role","link"),n.setAttribute("aria-disabled","true"))}for(const n of e.querySelectorAll("img[src], img[srcset], source[src], source[srcset]"))n.removeAttribute("src"),n.removeAttribute("srcset"),n.tagName==="IMG"&&n.setAttribute("aria-hidden","true")}function M8({content:e}){const n=N.useMemo(()=>{const o=ph(e).html,f=new DOMParser().parseFromString(o,"text/html");return Ep(f.body),f.body.innerHTML},[e]),i=N.useRef(null);N.useEffect(()=>{const o=i.current;if(!o)return;Ep(o);const f=new MutationObserver(()=>Ep(o));return f.observe(o,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["href","src","srcset"]}),()=>f.disconnect()},[n]);const s=N.useCallback(o=>{const f=o.target.closest('[data-action="copy-code"]');if(!f)return;const _=f.closest("pre")?.getAttribute("data-code");if(!_)return;navigator.clipboard?.writeText(_);const c=f.textContent;f.textContent="Copied",window.setTimeout(()=>{f.textContent=c},1200)},[]);return u.jsx("div",{ref:i,className:"markdown-body",onClick:s,dangerouslySetInnerHTML:{__html:n}})}const N8=["a[href]","button:not([disabled])","input:not([disabled])","[tabindex]:not([tabindex='-1'])"].join(","),O8="Skills run with full agent permissions. Review before use.";function D8(e,n){if(!n)return;const i=Array.from(n.querySelectorAll(N8)),s=i[0],o=i[i.length-1];!s||!o||(e.shiftKey&&document.activeElement===s?(e.preventDefault(),o.focus()):!e.shiftKey&&document.activeElement===o&&(e.preventDefault(),s.focus()))}function j8({skill:e,isInstalled:n,theaterId:i,onClose:s,onInstall:o}){const[f,_]=N.useState(null),[c,h]=N.useState(!1),d=N.useRef(null),y=N.useRef(null),p=N.useRef(null);if(N.useEffect(()=>{e&&d.current===null&&(d.current=document.activeElement)},[e]),N.useEffect(()=>{if(!e){_(null);return}h(!0),_(null);let C=!1;return(async()=>{try{let E;if(n){const v={scope:e.scope,skill:e.name};i&&(v.theaterId=i),E=await fetch("/plugins/skills/installed-file",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(v)})}else E=await fetch("/plugins/skills/preview",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({source:e.source,skill:e.name})});if(C)return;if(!E.ok){h(!1);return}const g=await E.json();C||(_(g.markdown??""),h(!1))}catch{C||h(!1)}})(),()=>{C=!0}},[e,n,i]),N.useEffect(()=>{if(!e)return;const C=T=>{T.key==="Escape"?(T.preventDefault(),s()):T.key==="Tab"&&D8(T,p.current),T.stopImmediatePropagation()};return y.current?.focus(),window.addEventListener("keydown",C,!0),()=>{window.removeEventListener("keydown",C,!0);const T=d.current;d.current=null,T?.focus?.()}},[e,s]),N.useEffect(()=>{if(e)return document.body.style.overflow="hidden",()=>{document.body.style.overflow=""}},[e]),!e)return null;const w=e.displayPath||e.source||null;return Es.createPortal(u.jsx("div",{className:"skills-overlay-backdrop",onClick:s,"aria-hidden":"true",children:u.jsxs("div",{ref:p,role:"dialog","aria-modal":"true","aria-label":`${e.name} SKILL.md`,className:"skills-overlay-dialog",onClick:C=>C.stopPropagation(),children:[u.jsxs("div",{className:"skills-overlay-header",children:[u.jsx("span",{className:"skills-overlay-title",children:e.name}),w&&u.jsx("span",{className:"skills-overlay-meta",children:w}),u.jsx("button",{ref:y,type:"button",className:"skills-overlay-close",onClick:s,"aria-label":"Close",children:"✕"})]}),u.jsxs("div",{className:"skills-overlay-body",children:[c&&u.jsx("div",{className:"skills-empty-state",children:"Loading SKILL.md…"}),!c&&f===null&&u.jsx("div",{className:"skills-empty-state",children:"Could not load SKILL.md."}),f!==null&&u.jsx(M8,{content:f})]}),u.jsxs("div",{className:"skills-overlay-footer",children:[u.jsx("p",{className:"skills-permission-warning",children:O8}),!n&&u.jsx("button",{type:"button",className:"skills-btn skills-btn--primary",onClick:()=>{s(),o()},children:"Install"})]})]})}),document.body)}const I8=3200;function B8({message:e,onDismiss:n}){return N.useEffect(()=>{if(!e)return;const i=setTimeout(n,I8);return()=>clearTimeout(i)},[e,n]),e?u.jsx("div",{className:"skills-toast",role:"status","aria-live":"polite",children:e}):null}function P8({ctx:e}){const{theaterId:n}=e,{activeTab:i,installedList:s}=zm(),[o,f]=N.useState(null),[_,c]=N.useState(null),[h,d]=N.useState(0),y=s.length,p=N.useCallback(E=>{f({skill:E,isInstalled:!0})},[]),w=N.useCallback((E,g)=>{f({skill:E,isInstalled:!1,registryId:g})},[]),C=N.useCallback((E,g)=>{c(`Installed ${E} to ${g}`),d(v=>v+1),Iu("installed")},[]),T=N.useCallback(()=>{o?.registryId&&(RC(o.registryId),Iu("find")),f(null)},[o]);return u.jsxs("div",{className:"skills-root",children:[u.jsxs("div",{className:"skills-tab-bar",role:"tablist","aria-label":"Skills panels",children:[u.jsxs("button",{type:"button",role:"tab","aria-selected":i==="installed",className:`skills-tab-btn${i==="installed"?" is-active":""}`,onClick:()=>Iu("installed"),children:["Installed",y>0?` ${y}`:""]}),u.jsx("button",{type:"button",role:"tab","aria-selected":i==="find",className:`skills-tab-btn${i==="find"?" is-active":""}`,onClick:()=>Iu("find"),children:"Find"})]}),i==="installed"?u.jsx(L8,{theaterId:n,onReadMore:p,refreshKey:h}):u.jsx(k8,{theaterId:n,onReadMore:w,onInstallSuccess:C}),u.jsx(B8,{message:_,onDismiss:()=>c(null)}),u.jsx(j8,{skill:o?.skill??null,isInstalled:o?.isInstalled??!1,theaterId:n,onClose:()=>f(null),onInstall:T})]})}function z8(){return u.jsx("svg",{width:"18",height:"18",viewBox:"0 0 18 18",fill:"none","aria-hidden":"true",children:u.jsx("path",{d:"M9 2L10.854 6.764L16 7.236L12.25 10.764L13.416 16L9 13.25L4.584 16L5.75 10.764L2 7.236L7.146 6.764Z",stroke:"currentColor",strokeWidth:"1.4",strokeLinejoin:"round"})})}const H8={id:"skills",title:"Skills",icon:z8,render:e=>u.jsx(P8,{ctx:e})},$8={id:"skills",railPanels:[H8]},U8=[$8],LC=[...O4,...jD,...f8,...U8],F8=NC(LC),MC=N.createContext(F8),W8=MC.Provider;async function G8(){const e=[...LC],n=new Set(e.map(s=>s.id)),i=await q8();for(const s of i){if(n.has(s.id)){console.warn(`Skipping external plugin with duplicate id: ${s.id}`);continue}const o=await K8(s);if(o){if(n.has(o.id)){console.warn(`Skipping external plugin with duplicate id: ${o.id}`);continue}n.add(o.id),e.push(o)}}return NC(e)}function ac(){return N.useContext(MC)}async function q8(){try{const e=await fetch("/plugin-runtime/manifest");if(!e.ok)return console.warn(`Plugin runtime manifest unavailable: ${e.status}`),[];const n=await e.json();return Array.isArray(n.plugins)?n.plugins.filter(Y8):[]}catch(e){return console.warn("Plugin runtime manifest failed to load.",e),[]}}async function K8(e){try{const n=await import(e.clientUrl),i=n.default??n.plugin;return V8(i)?i:(console.warn(`Skipping external plugin with invalid client module: ${e.id}`),null)}catch(n){return console.warn(`Skipping external plugin after client load failure: ${e.id}`,n),null}}function NC(e){const n=new Set,i=[];for(const s of e)for(const o of s.railPanels??[]){if(n.has(o.id)){console.warn(`Skipping rail panel with duplicate id: ${o.id}`);continue}n.add(o.id),i.push(o)}return{plugins:e,operationKinds:e.flatMap(s=>s.operationKinds??[]),settingsSections:e.flatMap(s=>s.settingsSections??[]),notificationKinds:e.flatMap(s=>s.notificationKinds??[]),railPanels:i}}function V8(e){return typeof e=="object"&&e!==null&&typeof e.id=="string"}function Y8(e){if(typeof e!="object"||e===null)return!1;const n=e;return typeof n.id=="string"&&typeof n.clientUrl=="string"&&Number.isInteger(n.apiVersion)}const X8=new Set(["token","credential","cwd","path","persona","prompt","toolAllowlist","allowedExecutorTools"]);async function OC(e){const n=await fetch("/api/v1/settings/carriers",{signal:e});return await $m(n),DC(await n.json(),n.status)}async function Z8(e){const n=await fetch("/api/v1/settings/carriers/options",{signal:e});return await $m(n),ej(await n.json(),n.status)}async function Rl(e,n,i){return Hm(`/api/v1/settings/carriers/${encodeURIComponent(e)}`,"PATCH",n,i)}async function J8(e,n,i,s){return Hm(`/api/v1/settings/carriers/${encodeURIComponent(e)}/taskforce/${encodeURIComponent(n)}`,"PUT",i,s)}async function Q8(e,n,i){return Hm(`/api/v1/settings/carriers/${encodeURIComponent(e)}/taskforce/${encodeURIComponent(n)}`,"DELETE",{},i)}async function Hm(e,n,i,s){const o=await fetch(e,{method:n,headers:{"Content-Type":"application/json"},body:JSON.stringify(i),signal:s});await $m(o);const f=await o.json();if(!f||typeof f!="object"||!("state"in f))throw new ct(o.status,"Invalid carrier settings mutation response");return{state:DC(f.state,o.status)}}async function $m(e){if(e.ok)return;let n=e.statusText||`HTTP ${e.status}`;try{const i=await e.json();typeof i.error=="string"&&(n=i.error)}catch{}throw new ct(e.status,n)}function DC(e,n){jC(e,n);const i=e;if(!i||typeof i.generation!="number"||!Array.isArray(i.carriers))throw new ct(n,"Invalid carrier settings state response");return{generation:i.generation,carriers:i.carriers.map(s=>tj(s,n))}}function ej(e,n){jC(e,n);const i=e;if(!i||!Array.isArray(i.cliTypes)||!i.taskForceConstraints||typeof i.taskForceConstraints.minBackends!="number")throw new ct(n,"Invalid carrier settings options response");return{cliTypes:i.cliTypes.map(s=>nj(s,n)),taskForceConstraints:{minBackends:i.taskForceConstraints.minBackends}}}function tj(e,n){const i=e;if(!i||typeof i.carrierId!="string"||typeof i.displayName!="string"||typeof i.sourceDisplayName!="string"||typeof i.role!="string"||typeof i.roleDescription!="string"||typeof i.slot!="number"||typeof i.cliType!="string"||typeof i.defaultCliType!="string"||typeof i.model!="string"||i.effort!==void 0&&typeof i.effort!="string"||i.agentMode!=="cli"&&i.agentMode!=="subagent"||typeof i.subagentMode!="boolean"||typeof i.taskForceBackendCount!="number"||!i.taskforce||!Array.isArray(i.taskforce.backends))throw new ct(n,"Invalid carrier settings carrier response");return{carrierId:i.carrierId,displayName:i.displayName,sourceDisplayName:i.sourceDisplayName,role:i.role,roleDescription:i.roleDescription,...i.category?{category:i.category}:{},slot:i.slot,cliType:i.cliType,defaultCliType:i.defaultCliType,model:i.model,...i.effort?{effort:i.effort}:{},agentMode:i.agentMode,subagentMode:i.subagentMode,taskForceBackendCount:i.taskForceBackendCount,taskforce:{backends:i.taskforce.backends.map(s=>rj(s,n))}}}function nj(e,n){const i=e;if(!i||typeof i.id!="string"||typeof i.displayName!="string"||typeof i.supportsSubagent!="boolean"||!Array.isArray(i.models)||typeof i.defaultModel!="string")throw new ct(n,"Invalid carrier settings CLI option");return{id:i.id,displayName:i.displayName,supportsSubagent:i.supportsSubagent,models:i.models.map(s=>ij(s,n)),defaultModel:i.defaultModel}}function ij(e,n){const i=e;if(!i||typeof i.modelId!="string"||typeof i.name!="string")throw new ct(n,"Invalid carrier settings model option");if(i.effort!==void 0&&(!Array.isArray(i.effort.levels)||typeof i.effort.default!="string"))throw new ct(n,"Invalid carrier settings effort option");return{modelId:i.modelId,name:i.name,...i.effort?{effort:{levels:i.effort.levels.filter(s=>typeof s=="string"),default:i.effort.default}}:{}}}function rj(e,n){const i=e;if(!i||typeof i.cliType!="string"||typeof i.model!="string"||i.effort!==void 0&&typeof i.effort!="string")throw new ct(n,"Invalid carrier settings Task Force backend");return{cliType:i.cliType,model:i.model,...i.effort?{effort:i.effort}:{}}}function jC(e,n){const i=[e];for(;i.length>0;){const s=i.pop();if(!(!s||typeof s!="object"))for(const[o,f]of Object.entries(s)){if(X8.has(o))throw new ct(n,"Carrier settings response leaked a restricted field");f&&typeof f=="object"&&i.push(f)}}}const sj={cliType:"",model:"",effort:"",displayName:"",agentMode:"cli",taskforce:{}},Ng=new Set;let Bn={loading:!1,state:null,options:null,activeCarrierId:null,draft:sj,savingActionId:null,error:null};function IC(){return N.useSyncExternalStore(aj,Xy,Xy)}function Xy(){return Bn}function aj(e){return Ng.add(e),()=>{Ng.delete(e)}}async function Zy(e){lr({loading:!0,error:null});try{const[n,i]=await Promise.all([OC(e),Z8(e)]);BC(n,i)}catch(n){if(e?.aborted)return;lr({loading:!1,error:zC(n)})}}function oj(e){const n=Bn.state?.carriers.find(i=>i.carrierId===e);lr({activeCarrierId:e,draft:n?Um(n,Bn.options):Bn.draft,error:null})}function Xs(e){lr({draft:{...Bn.draft,...e},error:null})}function Og(e,n){const i=Bn.draft.taskforce[e]??{model:"",effort:""};lr({draft:{...Bn.draft,taskforce:{...Bn.draft.taskforce,[e]:{...i,...n}}},error:null})}function lj(){const e=PC();e&&lr({draft:Um(e,Bn.options),error:null})}async function cj(e){const n=PC();return n?uj("save-all",async()=>{const i=Bn.draft;let s=null;i.displayName!==n.displayName&&(s=(await Rl(n.carrierId,{displayName:i.displayName})).state);const o=i.cliType!==n.cliType;return o&&(s=(await Rl(n.carrierId,{cli:i.cliType})).state),(o||i.model!==n.model||(i.effort||"")!==(n.effort||""))&&(s=(await Rl(n.carrierId,{model:dj(i)})).state),i.agentMode==="subagent"?(n.agentMode!=="subagent"||n.taskForceBackendCount>0)&&(s=(await Rl(n.carrierId,{agentMode:"subagent"})).state):(n.agentMode!=="cli"&&(s=(await Rl(n.carrierId,{agentMode:"cli"})).state),s=await fj(n,e,s)),{state:s??await OC()}}):!1}function BC(e,n){const i=pj(e,Bn.activeCarrierId),s=e.carriers.find(o=>o.carrierId===i)??null;lr({loading:!1,state:e,options:n,activeCarrierId:i,draft:s?Um(s,n):Bn.draft,error:null})}async function uj(e,n){lr({savingActionId:e,error:null});try{const i=await n();return BC(i.state,Bn.options??{cliTypes:[],taskForceConstraints:{minBackends:2}}),lr({savingActionId:null}),!0}catch(i){return lr({savingActionId:null,error:zC(i)}),!1}}function Um(e,n){const i=Object.fromEntries((n?.cliTypes??[]).map(s=>{const o=e.taskforce.backends.find(f=>f.cliType===s.id);return[s.id,{model:o?.model??s.defaultModel,effort:o?.effort??hj(s.id,o?.model??s.defaultModel,n)??""}]}));return{cliType:e.cliType,model:e.model,effort:e.effort??"",displayName:e.displayName,agentMode:e.agentMode,taskforce:i}}function hj(e,n,i){return i?.cliTypes.find(f=>f.id===e)?.models.find(f=>f.modelId===n)?.effort?.default??null}function dj(e){return{model:e.model,...e.effort?{effort:e.effort}:{}}}function PC(){return Bn.state?.carriers.find(e=>e.carrierId===Bn.activeCarrierId)??null}async function fj(e,n,i){const s=new Set(n.map(o=>o.cliType));for(const o of e.taskforce.backends)s.has(o.cliType)||(i=(await Q8(e.carrierId,o.cliType)).state);for(const o of n){const f=e.taskforce.backends.find(_=>_.cliType===o.cliType);f&&f.model===o.model&&(f.effort||"")===(o.effort||"")||(i=(await J8(e.carrierId,o.cliType,{model:o.model,...o.effort?{effort:o.effort}:{}})).state)}return i}function pj(e,n){return n&&e.carriers.some(i=>i.carrierId===n)?n:e.carriers[0]?.carrierId??null}function lr(e){Bn={...Bn,...e};for(const n of Ng)n()}function zC(e){return e instanceof Error?e.message:String(e)}const gj=50,mj=2400,_j={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 vj(){const e=IC(),n=e.state?.carriers.find(m=>m.carrierId===e.activeCarrierId)??null,i=e.options?.cliTypes.find(m=>m.id===e.draft.cliType)??null,s=i?.models.find(m=>m.modelId===e.draft.model)??null,[o,f]=N.useState(!1),[_,c]=N.useState([]),[h,d]=N.useState("idle"),y=_.length>0,p=e.draft.agentMode==="subagent",w=e.draft.agentMode==="subagent",C=e.savingActionId==="save-all",T=n?Cj(n,e.draft,_):!1,E=n?.taskforce.backends.map(m=>`${m.cliType}:${m.model}:${m.effort??""}`).join("|")??"";N.useEffect(()=>{const m=new AbortController;return Zy(m.signal),()=>m.abort()},[]),N.useEffect(()=>{f(!1),c(n?.taskforce.backends.map(m=>m.cliType)??[]),d("idle")},[n?.carrierId,E]),N.useEffect(()=>{if(h!=="saved")return;const m=window.setTimeout(()=>d("idle"),mj);return()=>window.clearTimeout(m)},[h]);function g(){n&&(lj(),c(n.taskforce.backends.map(m=>m.cliType)),f(!1),d("idle"))}async function v(){if(!n)return;if(d("saving"),!await cj(kj(_,e.draft.taskforce))){d("idle");return}f(!1),d("saved")}return u.jsxs("main",{className:"carrier-settings-page",children:[u.jsxs("section",{className:"carrier-settings-hero","aria-labelledby":"carrier-settings-title",children:[u.jsxs("div",{children:[u.jsx("p",{className:"bridge-kicker",children:"Carrier Control Surface"}),u.jsx("h2",{id:"carrier-settings-title",children:"Carrier Settings"})]}),u.jsxs("div",{className:"carrier-settings-hero-actions",children:[u.jsx("div",{className:`carrier-settings-save-status ${h==="saved"?"is-positive":""}`,role:"status","aria-live":"polite",children:h==="saving"||C?"Saving…":h==="saved"?"Saved ✓":""}),n?u.jsxs("div",{className:"carrier-settings-save-actions",children:[u.jsx("button",{type:"button",className:`carrier-settings-action-button ${T?"is-dirty":""}`,disabled:!T||C,onClick:()=>{v()},children:"Save"}),u.jsx("button",{type:"button",className:`carrier-settings-action-button ${T?"is-dirty":""}`,disabled:!T||C,onClick:g,children:"Discard"})]}):null,u.jsx("button",{type:"button",className:"carrier-settings-action-button carrier-settings-hero-refresh",disabled:e.loading,onClick:()=>{Zy()},children:"Refresh"})]})]}),e.error?u.jsx("p",{className:"carrier-settings-error",role:"alert",children:e.error}):null,u.jsxs("section",{className:"carrier-settings-grid",children:[u.jsxs("div",{className:"carrier-settings-list","aria-label":"Carrier list",children:[e.loading&&!e.state?u.jsx("p",{className:"carrier-settings-empty",children:"Loading carrier settings."}):null,e.state&&e.state.carriers.length===0?u.jsx("p",{className:"carrier-settings-empty",children:"No carriers registered."}):null,e.state?.carriers.map(m=>u.jsx(bj,{carrier:m,active:m.carrierId===e.activeCarrierId,minBackends:e.options?.taskForceConstraints.minBackends??2,onSelect:()=>oj(m.carrierId)},m.carrierId))]}),n&&e.options&&i?u.jsxs("div",{className:"carrier-settings-detail",style:UC(n.carrierId),children:[u.jsxs("div",{className:"carrier-settings-detail-head",children:[u.jsxs("div",{className:"carrier-settings-detail-title-block",children:[u.jsxs("div",{className:"carrier-settings-captain-id",children:[u.jsx("span",{children:"Captain"})," · ",n.carrierId.toUpperCase()]}),u.jsx("div",{className:`carrier-settings-name-line ${o?"is-editing":""}`,children:o?u.jsxs(u.Fragment,{children:[u.jsx("input",{id:"carrier-display-name",className:"carrier-settings-input carrier-settings-name-input",value:e.draft.displayName,maxLength:gj,onChange:m=>Xs({displayName:m.target.value})}),u.jsx("button",{type:"button",className:"carrier-settings-icon-button","aria-label":"Save display name",disabled:C,onClick:()=>{f(!1)},children:u.jsx(Aj,{})}),u.jsx("button",{type:"button",className:"carrier-settings-icon-button","aria-label":"Cancel display name edit",onClick:()=>{Xs({displayName:n.displayName}),f(!1)},children:u.jsx(Rj,{})})]}):u.jsxs(u.Fragment,{children:[u.jsx("h3",{className:"carrier-settings-captain-name",children:n.displayName}),u.jsx("button",{type:"button",className:"carrier-settings-icon-button","aria-label":"Edit display name",onClick:()=>{Xs({displayName:n.displayName}),f(!0)},children:u.jsx(Tj,{})})]})}),u.jsx("div",{className:"carrier-settings-captain-role",children:n.role})]}),u.jsxs("div",{className:"carrier-settings-cli-badge",children:[u.jsx("span",{className:"ind","aria-hidden":"true"}),n.cliType]})]}),u.jsxs("div",{className:"carrier-settings-body",children:[u.jsxs("div",{className:"carrier-settings-control-group",children:[u.jsx("div",{className:"carrier-settings-resp-title",children:"Identity"}),u.jsxs("div",{className:"carrier-settings-mission",children:['"',n.roleDescription,'"']})]}),u.jsxs("div",{className:"carrier-settings-control-group",children:[u.jsx("div",{className:"carrier-settings-resp-title",children:"Runtime"}),u.jsxs("div",{className:"carrier-settings-runtime",children:[u.jsx("div",{className:"carrier-settings-runtime-row carrier-settings-runtime-row--cli",children:u.jsxs("div",{className:"carrier-settings-field carrier-settings-field--wide",children:[u.jsx("label",{className:"carrier-settings-label",htmlFor:"carrier-cli",children:"CLI"}),u.jsx("select",{id:"carrier-cli",className:"carrier-settings-select",value:e.draft.cliType,onChange:m=>Sj(m.target.value,e.options?.cliTypes??[]),children:e.options.cliTypes.map(m=>u.jsx("option",{value:m.id,children:m.displayName},m.id))})]})}),u.jsxs("div",{className:"carrier-settings-runtime-row carrier-settings-runtime-row--model",children:[u.jsx(HC,{id:"carrier-model",label:"Model",models:i.models,value:e.draft.model,onChange:m=>wj(i,m)}),u.jsx($C,{id:"carrier-effort",model:s,value:e.draft.effort,onChange:m=>Xs({effort:m})})]})]})]}),u.jsx("div",{className:"carrier-settings-control-group",children:u.jsxs("div",{className:"carrier-settings-toggle-row",children:[u.jsxs("div",{children:[u.jsx("p",{className:"carrier-settings-resp-title",children:"SubAgent"}),u.jsx("p",{className:"carrier-settings-help",children:y?"Task Force draft is present. Remove every backend to enable SubAgent.":i.supportsSubagent?"Enabling SubAgent clears Task Force backends when saved.":"This CLI does not support SubAgent mode."})]}),u.jsx("button",{type:"button",className:`carrier-settings-toggle ${p?"is-on":""}`,disabled:C||!p&&(!i.supportsSubagent||y),"aria-pressed":p,onClick:()=>Xs({agentMode:p?"cli":"subagent"}),children:u.jsx("span",{children:p?"On":"Off"})})]})}),u.jsx(yj,{carrier:n,cliOptions:e.options.cliTypes,minBackends:e.options.taskForceConstraints.minBackends,savingActionId:e.savingActionId,rows:_,disabled:w,onRowsChange:c})]})]},n.carrierId):u.jsx("div",{className:"carrier-settings-detail",children:u.jsx("p",{className:"carrier-settings-empty",children:"Select a carrier."})})]})]})}function bj({carrier:e,active:n,minBackends:i,onSelect:s}){const o=e.taskForceBackendCount>=i;return u.jsxs("button",{type:"button",className:`carrier-settings-row ${n?"is-active":""}`,style:UC(e.carrierId),onClick:s,children:[u.jsx("span",{className:"carrier-settings-captain-dot","aria-hidden":"true"}),u.jsxs("span",{className:"carrier-settings-row-text",children:[u.jsx("span",{className:"carrier-settings-row-name",children:e.displayName}),u.jsx("span",{className:"carrier-settings-row-role",children:e.role})]}),u.jsxs("span",{className:"carrier-settings-row-live","aria-hidden":"true",children:[u.jsx("span",{className:`carrier-settings-live-dot ${e.subagentMode?"is-live":""}`}),u.jsx("span",{className:`carrier-settings-live-dot ${o?"is-live":""}`})]})]})}function HC({id:e,label:n,models:i,value:s,disabled:o=!1,onChange:f}){return u.jsxs("div",{className:"carrier-settings-field",children:[u.jsx("label",{className:"carrier-settings-label",htmlFor:e,children:n}),u.jsx("select",{id:e,className:"carrier-settings-select",value:s,disabled:o,onChange:_=>f(_.target.value),children:i.map(_=>u.jsx("option",{value:_.modelId,children:_.name},_.modelId))})]})}function $C({id:e,model:n,value:i,disabled:s=!1,onChange:o}){return n?.effort?u.jsxs("div",{className:"carrier-settings-field",children:[u.jsx("label",{className:"carrier-settings-label",htmlFor:e,children:"Effort"}),u.jsx("select",{id:e,className:"carrier-settings-select",value:i||n.effort.default,disabled:s,onChange:f=>o(f.target.value),children:n.effort.levels.map(f=>u.jsx("option",{value:f,children:f},f))})]}):u.jsxs("div",{className:"carrier-settings-field",children:[u.jsx("span",{className:"carrier-settings-label",children:"Effort"}),u.jsx("p",{className:"carrier-settings-help",children:"Not supported for this model."})]})}function yj({carrier:e,cliOptions:n,minBackends:i,savingActionId:s,rows:o,disabled:f,onRowsChange:_}){const c=IC(),h=e.taskforce.backends.length,[d,y]=N.useState(h>0),[p,w]=N.useState(!1),[C,T]=N.useState(""),E=e.taskForceBackendCount>=i,g=n.filter(m=>!o.includes(m.id)),v=C||g[0]?.id||"";return u.jsxs("div",{className:`carrier-settings-control-group carrier-settings-control-group--taskforce ${d?"is-expanded":""} ${f?"is-disabled":""}`,children:[u.jsxs("div",{className:"carrier-settings-section-head",children:[u.jsxs("div",{children:[u.jsx("p",{className:"carrier-settings-resp-title",children:"Task Force"}),u.jsx("p",{className:"carrier-settings-help",children:f?"Disabled while SubAgent is on. Turn SubAgent off before composing Task Force backends.":h>0?`${h} backend${h===1?"":"s"} configured${E?" · active":` · needs ${i}+ to activate`}.`:`Run this carrier across multiple CLI backends. Needs at least ${i} to activate.`})]}),u.jsx("div",{className:"carrier-settings-tf-head-actions",children:u.jsx("button",{type:"button",className:"carrier-settings-tf-toggle","aria-expanded":d,onClick:()=>y(m=>!m),children:d?"Hide":"Configure"})})]}),d?u.jsxs("div",{className:"carrier-settings-tf-list",children:[o.length===0?u.jsx("p",{className:"carrier-settings-tf-empty",children:"No Task Force backend drafted."}):null,o.map(m=>{const S=n.find(M=>M.id===m);if(!S)return null;const k=c.draft.taskforce[S.id]??{model:S.defaultModel,effort:""},L=S.models.find(M=>M.modelId===k.model)??S.models[0]??null,R=e.taskforce.backends.some(M=>M.cliType===S.id);return u.jsxs("div",{className:`carrier-settings-tf-item ${R?"is-active":""}`,children:[u.jsxs("div",{className:"carrier-settings-tf-title",children:[u.jsx("span",{className:`carrier-settings-live-dot ${R?"is-live":""}`,"aria-hidden":"true"}),u.jsx("strong",{children:S.displayName})]}),u.jsx(HC,{id:`tf-${S.id}-model`,label:"Model",models:S.models,value:k.model,disabled:f,onChange:M=>xj(S,M)}),u.jsx($C,{id:`tf-${S.id}-effort`,model:L,value:k.effort,disabled:f,onChange:M=>Og(S.id,{effort:M})}),u.jsx("div",{className:"carrier-settings-tf-actions",children:u.jsx("button",{type:"button",className:"carrier-settings-ghost-button",disabled:f||s==="save-all",onClick:()=>_(o.filter(M=>M!==S.id)),children:"Remove"})})]},S.id)}),u.jsxs("div",{className:"carrier-settings-tf-add-row",children:[p&&g.length>0?u.jsx("select",{className:"carrier-settings-select carrier-settings-tf-add-select",value:v,onChange:m=>T(m.target.value),"aria-label":"Task Force CLI to add",children:g.map(m=>u.jsx("option",{value:m.id,children:m.displayName},m.id))}):null,u.jsx("button",{type:"button",className:"carrier-settings-ghost-button",disabled:f||g.length===0||s==="save-all",onClick:()=>{if(!p){w(!0);return}const m=v,S=n.find(L=>L.id===m),k=S?.models.find(L=>L.modelId===S.defaultModel)??S?.models[0]??null;!S||!k||(Og(S.id,{model:k.modelId,effort:k.effort?.default??""}),_(o.includes(S.id)?o:[...o,S.id]),T(""),w(!1))},children:"Add"})]})]}):null]})}function Sj(e,n){const i=n.find(f=>f.id===e),s=i?.models.find(f=>f.modelId===i.defaultModel)??i?.models[0]??null,o={cliType:e,model:s?.modelId??"",effort:s?.effort?.default??""};i?.supportsSubagent||(o.agentMode="cli"),Xs(o)}function wj(e,n){const i=e.models.find(s=>s.modelId===n);Xs({model:n,effort:i?.effort?.default??""})}function xj(e,n){const i=e.models.find(s=>s.modelId===n);Og(e.id,{model:n,effort:i?.effort?.default??""})}function Cj(e,n,i){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:Ej(e,i,n.taskforce)}function Ej(e,n,i){if(n.length!==e.taskforce.backends.length)return!0;const s=new Set(n);for(const o of e.taskforce.backends){if(!s.has(o.cliType))return!0;const f=i[o.cliType];if(!f||f.model!==o.model||(f.effort||"")!==(o.effort||""))return!0}return!1}function kj(e,n){return e.map(i=>{const s=n[i];return s?{cliType:i,model:s.model,...s.effort?{effort:s.effort}:{}}:null}).filter(i=>i!==null)}function UC(e){return{"--cap-color":_j[e]??"var(--brass)"}}function Tj(){return u.jsxs("svg",{viewBox:"0 0 16 16","aria-hidden":"true",focusable:"false",children:[u.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"}),u.jsx("path",{d:"M9.7 3.4 12.6 6.3"})]})}function Aj(){return u.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",focusable:"false",children:u.jsx("path",{d:"M3 8.3 6.4 11.7 13.2 4.5"})})}function Rj(){return u.jsxs("svg",{viewBox:"0 0 16 16","aria-hidden":"true",focusable:"false",children:[u.jsx("path",{d:"M4.2 4.2 11.8 11.8"}),u.jsx("path",{d:"M11.8 4.2 4.2 11.8"})]})}async function Lj(e){const n=await fetch("/api/v1/settings/api-catalog",{signal:e});return await Mj(n),Nj(await n.json(),n.status).routes}async function Mj(e){if(e.ok)return;let n=e.statusText||`HTTP ${e.status}`;try{const i=await e.json();typeof i.error=="string"&&(n=i.error)}catch{}throw new ct(e.status,n)}function Nj(e,n){const i=e;if(!i||typeof i!="object"||!("version"in i)||!Array.isArray(i.routes))throw new ct(n,"Invalid backend API catalog response");return{routes:i.routes.map(s=>Oj(s,n))}}function Oj(e,n){const i=e;if(!i||typeof i!="object"||typeof i.method!="string"||typeof i.path!="string"||typeof i.summary!="string"||typeof i.category!="string"||typeof i.gate!="string")throw new ct(n,"Invalid backend API catalog entry");return{method:i.method,path:i.path,summary:i.summary,category:i.category,gate:i.gate}}const Dg=new Set;let jg={loading:!1,state:null,error:null};function Dj(){return N.useSyncExternalStore(jj,Jy,Jy)}function Jy(){return jg}function jj(e){return Dg.add(e),()=>{Dg.delete(e)}}async function Ij(e){kp({loading:!0,error:null});try{const n=await Lj(e);kp({loading:!1,state:n,error:null})}catch(n){if(e?.aborted)return;kp({loading:!1,error:Bj(n)})}}function kp(e){jg={...jg,...e};for(const n of Dg)n()}function Bj(e){return e instanceof Error?e.message:String(e)}function Pj(){const e=Dj(),[n,i]=N.useState(!0),s=N.useMemo(()=>$j(e.state??[]),[e.state]),o=e.state?.length??0,f=s.length;return N.useEffect(()=>{const _=new AbortController;return Ij(_.signal),()=>_.abort()},[]),u.jsxs("section",{className:"global-settings-card backend-api-section","aria-label":"Backend API catalog",children:[u.jsx("div",{className:`backend-api-control carrier-settings-control-group--taskforce ${n?"is-expanded":""}`,children:u.jsxs("div",{className:"carrier-settings-section-head",children:[u.jsxs("div",{className:"backend-api-head",children:[u.jsx("p",{className:"global-settings-resp-title",children:"Backend API"}),u.jsx("p",{className:"global-settings-help",children:o>0?`${o} loopback route${o===1?"":"s"} across ${f} categor${f===1?"y":"ies"} reported by backend introspection.`:"Backend introspection route list for this console."})]}),u.jsx("div",{className:"carrier-settings-tf-head-actions",children:u.jsx("button",{type:"button",className:"carrier-settings-tf-toggle","aria-expanded":n,onClick:()=>i(_=>!_),children:n?"Hide":"Show"})})]})}),e.error?u.jsx("p",{className:"global-settings-error",role:"alert",children:e.error}):null,e.loading&&!e.state?u.jsx("p",{className:"global-settings-help",children:"Loading backend API catalog."}):null,n?u.jsxs("div",{className:"backend-api-groups",children:[s.length>0?s.map(_=>u.jsx(zj,{group:_},_.category)):null,e.state&&s.length===0?u.jsx("p",{className:"global-settings-help",children:"No backend API routes reported."}):null]}):null,u.jsx("p",{className:"global-settings-foot",children:"Console backend routes are fetched from GET /api/v1/settings/api-catalog, so newly registered routes appear here automatically. The Codex/Fleet Wiki API surface is not included."})]})}function zj({group:e}){return u.jsxs("div",{className:"backend-api-group",children:[u.jsxs("div",{className:"backend-api-group-head",children:[u.jsx("span",{children:e.category}),u.jsx("span",{children:e.entries.length})]}),u.jsx("div",{className:"backend-api-list",children:e.entries.map(n=>u.jsx(Hj,{entry:n},`${n.method}:${n.path}`))})]})}function Hj({entry:e}){return u.jsxs("div",{className:"backend-api-row",children:[u.jsx("span",{className:"backend-api-method",children:e.method.toUpperCase()}),u.jsx("code",{className:"backend-api-path",children:e.path}),u.jsx("span",{className:"backend-api-summary",children:e.summary}),u.jsx("span",{className:"backend-api-gate",children:e.gate})]})}function $j(e){const n=new Map;for(const i of e){const s=i.category.trim()||"Uncategorized",o=n.get(s);o?o.push(i):n.set(s,[i])}return Array.from(n.entries()).map(([i,s])=>({category:i,entries:s}))}async function FC(e){const n=await fetch("/api/v1/settings/global",{signal:e});return await WC(n),GC(await n.json(),n.status)}async function Uj(e,n){const i=await fetch("/api/v1/settings/global",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e),signal:n});await WC(i);const s=await i.json();if(!s||typeof s!="object"||!("state"in s))throw new ct(i.status,"Invalid global settings mutation response");return{state:GC(s.state,i.status)}}async function WC(e){if(e.ok)return;let n=e.statusText||`HTTP ${e.status}`;try{const i=await e.json();typeof i.error=="string"&&(n=i.error)}catch{}throw new ct(e.status,n)}function GC(e,n){const i=e;if(!i||i.consolePortMode!=="dynamic"&&i.consolePortMode!=="static"||i.consoleStaticPort!==null&&!Fj(i.consoleStaticPort)||i.theme!=="maritime"&&i.theme!=="carbon")throw new ct(n,"Invalid global settings state response");return{consolePortMode:i.consolePortMode,consoleStaticPort:i.consoleStaticPort,theme:i.theme}}function Fj(e){return typeof e=="number"&&Number.isInteger(e)&&e>=1024&&e<=65535}const Ig=new Set;let Bg={loading:!1,state:null,savingField:null,error:null};function Wj(){return N.useSyncExternalStore(Gj,Qy,Qy)}function Qy(){return Bg}function Gj(e){return Ig.add(e),()=>{Ig.delete(e)}}async function qj(e){ho({loading:!0,error:null});try{const n=await FC(e);ho({loading:!1,state:n,error:null})}catch(n){if(e?.aborted)return;ho({loading:!1,error:qC(n)})}}async function Pg(e,n){ho({savingField:e,error:null});try{const i=await Uj({[e]:n});return ho({state:i.state,savingField:null,error:null}),!0}catch(i){return ho({savingField:null,error:qC(i)}),!1}}function ho(e){Bg={...Bg,...e};for(const n of Ig)n()}function qC(e){return e instanceof Error?e.message:String(e)}const Kj=[{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)"]}],Vj=[{id:"dynamic",label:"Dynamic"},{id:"static",label:"Static"}],Yj=1024,Xj=65535,Zj=[{id:"general",label:"General",eyebrow:"Theme · Port"},{id:"backend-api",label:"Backend API",eyebrow:"Loopback routes"}];function Jj(){const e=Wj(),n=e.state,i=e.savingField!==null,[s,o]=N.useState("general"),f=ac(),_=e7(f.plugins),c=t7(_);return N.useEffect(()=>{const h=new AbortController;return qj(h.signal),()=>h.abort()},[]),u.jsxs("main",{className:"global-settings-page",children:[u.jsxs("section",{className:"global-settings-hero","aria-labelledby":"global-settings-title",children:[u.jsxs("div",{children:[u.jsx("p",{className:"bridge-kicker",children:"Fleet Control Surface"}),u.jsx("h2",{id:"global-settings-title",children:"Settings"})]}),u.jsx("div",{className:"global-settings-status",role:"status","aria-live":"polite",children:i?"Saving…":""})]}),e.error?u.jsx("p",{className:"global-settings-error",role:"alert",children:e.error}):null,u.jsxs("section",{className:"global-settings-grid",children:[u.jsxs("div",{className:"global-settings-list","aria-label":"Settings sections",children:[u.jsx("p",{className:"global-settings-nav-group",children:"Console"}),Zj.map(h=>u.jsxs("button",{type:"button",className:`global-settings-nav-item ${h.id===s?"is-active":""}`,"aria-pressed":h.id===s,onClick:()=>o(h.id),children:[u.jsx("span",{className:"global-settings-nav-label",children:h.label}),u.jsx("span",{className:"global-settings-nav-eyebrow",children:h.eyebrow})]},h.id)),_.length>0?u.jsxs(u.Fragment,{children:[u.jsx("p",{className:"global-settings-nav-group",children:"Plugins"}),c.map(h=>u.jsxs("div",{className:"global-settings-plugin-group",children:[u.jsx("p",{className:"global-settings-plugin-heading",children:h.pluginLabel}),h.sections.map(d=>u.jsxs("button",{type:"button",className:`global-settings-nav-item ${d.id===s?"is-active":""}`,"aria-pressed":d.id===s,onClick:()=>o(d.id),children:[u.jsx("span",{className:"global-settings-nav-label",children:d.sectionTitle}),u.jsx("span",{className:"global-settings-nav-eyebrow",children:d.pluginLabel})]},d.id))]},h.pluginId))]}):null]}),u.jsx("div",{className:"global-settings-detail",children:Qj(s,n,i,_)},s)]})]})}function Qj(e,n,i,s){if(e.includes(":")){const o=s.find(f=>f.id===e);return o?.render?u.jsx(Xg,{fallback:u.jsx("div",{className:"fc-plugin-error",children:"Plugin settings failed to render."}),children:o.render()}):u.jsx("p",{className:"global-settings-help",children:"Plugin settings unavailable."})}switch(e){case"general":return u.jsxs(u.Fragment,{children:[u.jsx(i7,{}),u.jsx(r7,{state:n,saving:i})]});case"backend-api":return u.jsx(Pj,{})}}function e7(e){return e.flatMap(n=>(n.settingsSections??[]).map(i=>({id:`${n.id}:${i.id}`,pluginId:n.id,pluginLabel:n7(n.id),sectionTitle:i.title,render:i.render})))}function t7(e){const n=[];for(const i of e){const s=n.at(-1);if(s?.pluginId===i.pluginId){n[n.length-1]={...s,sections:[...s.sections,i]};continue}n.push({pluginId:i.pluginId,pluginLabel:i.pluginLabel,sections:[i]})}return n}function n7(e){return e==="terminal"?"Terminal":e.split(/[-_]/g).filter(Boolean).map(n=>n.charAt(0).toUpperCase()+n.slice(1)).join(" ")||e}function i7(){const{activeTheme:e}=Ur();return u.jsxs("section",{className:"global-settings-card","aria-label":"Theme",children:[u.jsxs("div",{className:"global-settings-row",children:[u.jsxs("div",{className:"global-settings-row-text",children:[u.jsx("p",{className:"global-settings-resp-title",children:"Theme"}),u.jsx("p",{className:"global-settings-help",children:"Console color scheme. Applies immediately and is saved server-side."})]}),u.jsx("div",{className:"theme-picker",role:"group","aria-label":"Theme",children:Kj.map(n=>{const i=n.id===e;return u.jsxs("button",{type:"button","aria-pressed":i,className:`theme-card ${i?"is-active":""}`,onClick:()=>{Cw(n.id),Pg("theme",n.id)},children:[u.jsx("span",{className:"theme-card-swatch","aria-hidden":"true",children:n.swatch.map(s=>u.jsx("i",{style:{background:s}},s))}),u.jsx("span",{className:"theme-card-label",children:n.label}),u.jsx("span",{className:"theme-card-check","aria-hidden":"true",children:i?u.jsx(a7,{}):null})]},n.id)})})]}),u.jsx("p",{className:"global-settings-foot",children:"Theme applies immediately and is stored server-side."})]})}function r7({state:e,saving:n}){const i=Ur();return u.jsxs("section",{className:"global-settings-card","aria-label":"General",children:[e?u.jsx(u.Fragment,{children:u.jsx(s7,{state:e,saving:n,consoleState:i})}):u.jsx("p",{className:"global-settings-help",children:"Loading settings."}),u.jsx("p",{className:"global-settings-foot",children:"Changes apply to newly launched sessions. Running sessions keep their current configuration until relaunched."})]})}function s7({state:e,saving:n,consoleState:i}){const[s,o]=N.useState(e.consoleStaticPort?.toString()??""),f=i.effectivePort,_=i.portMode==="static"&&!i.portHonored,c=i.requestedPort,h=e.consolePortMode==="static"&&e.consoleStaticPort!==null,d=s.trim(),y=Number(d),p=d.length>0,w=p&&eS(y),C=e.consolePortMode==="static"&&p&&!w;return N.useEffect(()=>{o(e.consoleStaticPort?.toString()??"")},[e.consoleStaticPort]),u.jsxs("div",{className:"global-settings-row is-stack console-port-row",children:[u.jsxs("div",{className:"global-settings-row-text",children:[u.jsxs("p",{className:"global-settings-resp-title",children:["Console Port ",u.jsx("span",{className:"new-badge",children:"New"})]}),u.jsx("p",{className:"global-settings-help",children:"Dynamic lets the OS pick a free loopback port each time the console starts. Static pins a port you choose so the console URL stays the same across restarts."})]}),u.jsxs("div",{className:"console-port-control",children:[u.jsx("div",{className:"segmented",role:"group","aria-label":"Console port mode",children:Vj.map(T=>{const E=e.consolePortMode===T.id;return u.jsx("button",{type:"button","aria-pressed":E,className:`segmented-option ${E?"is-active":""}`,disabled:n,onClick:()=>{Pg("consolePortMode",T.id)},children:T.label},T.id)})}),u.jsx("div",{className:`console-port-reveal ${e.consolePortMode==="static"?"is-open":""}`,children:u.jsxs("div",{className:"console-port-reveal-inner",children:[u.jsx("label",{className:"console-port-input-label",htmlFor:"console-static-port-input",children:"Static port"}),u.jsx("input",{id:"console-static-port-input",className:`console-port-input ${C?"is-invalid":""}`,inputMode:"numeric",placeholder:"8080",value:s,disabled:n,"aria-invalid":C,"aria-describedby":"console-static-port-hint",onChange:T=>{const E=T.target.value;o(E);const g=Number(E.trim());eS(g)&&Pg("consoleStaticPort",g)}}),u.jsx("span",{id:"console-static-port-hint",className:`console-port-hint ${C?"is-invalid":""}`,children:"1024–65535"})]})}),u.jsxs("div",{className:`console-port-effective ${_?"is-fallback":""}`,"aria-live":"polite",children:[u.jsx("span",{className:"console-port-effective-dot","aria-hidden":"true"}),u.jsxs("div",{children:[u.jsx("p",{className:"console-port-effective-label",children:"Currently reachable on"}),u.jsxs("p",{className:"console-port-effective-value",children:["127.0.0.1:",u.jsx("span",{children:f||"..."}),_?" · Dynamic":""]})]})]}),_&&c?u.jsxs("div",{className:"console-port-warning",role:"status",children:["Port ",u.jsx("strong",{children:c})," was unavailable — the console fell back to a ",u.jsx("strong",{children:"Dynamic"})," port and is running on ",u.jsxs("strong",{children:["127.0.0.1:",f||"..."]}),"."," ",h?u.jsxs(u.Fragment,{children:["Next restart will try ",u.jsx("strong",{children:e.consoleStaticPort}),"."]}):u.jsx(u.Fragment,{children:"Next restart will use a dynamic port."})]}):null,u.jsx("p",{className:"console-port-note",children:"Applies when the console restarts. Console-wide — shared across every browser."})]})]})}function eS(e){return Number.isInteger(e)&&e>=Yj&&e<=Xj}function a7(){return u.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:u.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 o7(e,n){return{x:e.x*n.zoom+n.x,y:e.y*n.zoom+n.y}}function Jl(e,n){return{x:(e.x-n.x)/n.zoom,y:(e.y-n.y)/n.zoom}}function l7(e,n){return{...o7(e,n),width:e.width*n.zoom,height:e.height*n.zoom}}const c7=[{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 an Operation 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"}]}],u7=288,h7=520,Ll=12,_s=[{id:"operations",label:"Operations"},{id:"map",label:"Map"},{id:"help",label:"Help"}],d7=/mac|iphone|ipad|ipod/i;function Vu({anchor:e,viewportBounds:n,placement:i="cursor",mode:s="full",catalog:o,canLaunch:f,mapFullscreen:_,radarEnabled:c,perimeterEnabled:h,renderKindIcon:d,onLaunchKind:y,onResetView:p,onMaximizeMap:w,onToggleRadar:C,onTogglePerimeter:T,onClose:E}){const g=N.useRef(null),v=N.useRef(null),m=N.useRef({operations:null,map:null,help:null}),[S,k]=N.useState(s==="controls"?"map":"operations"),L=g7(),R=s==="full",M=s==="full"||s==="launch",A=s==="full"||s==="controls";N.useEffect(()=>{const F=I=>{g.current?.contains(I.target)||E()},W=I=>{I.key==="Escape"&&E()};return document.addEventListener("mousedown",F),document.addEventListener("keydown",W),()=>{document.removeEventListener("mousedown",F),document.removeEventListener("keydown",W)}},[E]),N.useEffect(()=>{v.current?.focus()},[]);const B=(F,W=!1)=>{k(F),W&&window.requestAnimationFrame(()=>m.current[F]?.focus())},K=F=>{const W=_s.findIndex(Z=>Z.id===S),I=_s.length-1;if(F.key==="ArrowRight"||F.key==="ArrowLeft"){F.preventDefault();const Z=F.key==="ArrowRight"?1:-1,X=_s[(W+Z+_s.length)%_s.length];B(X.id,!0)}else F.key==="Home"?(F.preventDefault(),B(_s[0].id,!0)):F.key==="End"&&(F.preventDefault(),B(_s[I].id,!0))};return u.jsx("div",{className:`operation-launch-control operation-launch-control--canvas ${i==="above"?"operation-launch-control--up":""}`,ref:g,style:p7(e,n,i),"data-canvas-blocker":!0,children:u.jsxs("div",{className:"operation-launch-menu theater-menu canvas-context-menu",role:"dialog","aria-label":"Operations Control",tabIndex:-1,ref:v,children:[u.jsxs("div",{className:"canvas-context-menu-head",children:[u.jsx("span",{className:"canvas-context-menu-reticle","aria-hidden":"true",children:u.jsx(f7,{})}),u.jsx("span",{className:"canvas-context-menu-head-text",children:u.jsx("strong",{children:"Operations Control"})})]}),R?u.jsx("div",{className:"canvas-context-menu-tabs",role:"tablist","aria-label":"Operations Control sections",children:_s.map(F=>u.jsx("button",{ref:W=>{m.current[F.id]=W},type:"button",id:`canvas-control-tab-${F.id}`,className:"canvas-context-menu-tab",role:"tab","aria-selected":S===F.id,"aria-controls":`canvas-control-panel-${F.id}`,tabIndex:S===F.id?0:-1,onClick:()=>B(F.id),onKeyDown:K,children:F.label},F.id))}):null,M?u.jsxs("div",{id:"canvas-control-panel-operations",role:"tabpanel","aria-labelledby":"canvas-control-tab-operations",className:"canvas-context-menu-panel",hidden:R?S!=="operations":void 0,children:[u.jsx("p",{className:"canvas-context-menu-section",children:"Launch"}),o.length>0?o.map((F,W)=>u.jsxs("div",{children:[W>0?u.jsx("div",{className:"theater-menu-divider",role:"separator"}):null,u.jsx("p",{className:"canvas-context-menu-plugin",children:F.title}),F.kinds.map(I=>{const Z=I.disabled===!0||!f;return u.jsxs("button",{type:"button",role:"menuitem",className:"theater-menu-item canvas-context-menu-item operation-launch-menu-item",disabled:Z,title:I.disabledReason,onClick:()=>y(F.id,I),children:[u.jsx("span",{className:"theater-menu-check","aria-hidden":"true",children:d(F.id,I)??u.jsx(y7,{})}),u.jsx("span",{className:"theater-menu-label",children:I.title}),I.disabledReason?u.jsx("span",{className:"operation-launch-menu-reason",children:I.disabledReason}):null]},`${F.id}:${I.id}`)})]},F.id)):u.jsx("p",{className:"theater-menu-empty",children:"No operations available."})]}):null,A?u.jsxs(u.Fragment,{children:[u.jsxs("div",{id:"canvas-control-panel-map",role:"tabpanel","aria-labelledby":"canvas-control-tab-map",className:"canvas-context-menu-panel",hidden:R?S!=="map":void 0,children:[u.jsx("p",{className:"canvas-context-menu-section",children:"View"}),u.jsxs("button",{type:"button",role:"menuitem",className:"theater-menu-item canvas-context-menu-item",onClick:p,children:[u.jsx("span",{className:"theater-menu-check","aria-hidden":"true",children:u.jsx(m7,{})}),u.jsx("span",{className:"theater-menu-label",children:"Reset view"})]}),u.jsx("div",{className:"theater-menu-divider",role:"separator"}),u.jsx("p",{className:"canvas-context-menu-section",children:"Settings"}),w?u.jsx(Tp,{checked:!!_,label:"Maximized map",onClick:w,children:u.jsx(_7,{})}):null,C?u.jsx(Tp,{checked:!!c,label:"Radar sweep",onClick:C,children:u.jsx(v7,{})}):null,T?u.jsx(Tp,{checked:!!h,label:"Panel pulse",onClick:T,children:u.jsx(b7,{})}):null]}),u.jsx("div",{id:"canvas-control-panel-help",role:"tabpanel","aria-labelledby":"canvas-control-tab-help",className:"canvas-context-menu-panel canvas-context-menu-help",hidden:R?S!=="help":void 0,children:s==="controls"?u.jsxs("details",{className:"canvas-context-menu-help-details",children:[u.jsx("summary",{className:"canvas-context-menu-section canvas-context-menu-help-summary",children:"Shortcuts"}),u.jsx(tS,{modLabel:L})]}):u.jsx(tS,{modLabel:L})})]}):null]})})}function f7(){return u.jsxs("svg",{viewBox:"0 0 24 24","aria-hidden":"true",children:[u.jsx("circle",{cx:"12",cy:"12",r:"7",fill:"none",stroke:"currentColor",strokeWidth:"1.4"}),u.jsx("path",{d:"M12 2.4v3.4M12 18.2v3.4M2.4 12h3.4M18.2 12h3.4",fill:"none",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round"}),u.jsx("path",{d:"M12 9.2v5.6M9.2 12h5.6",fill:"none",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round"})]})}function p7(e,n,i){const s=n?Math.max(Ll,Math.min(e.x,n.width-u7-Ll)):e.x;if(i==="above")return{left:s,bottom:Math.max(Ll,e.y)};const o=n?Math.max(Ll,Math.min(e.y,n.height-h7-Ll)):e.y;return{left:s,top:o}}function tS({modLabel:e}){return u.jsx(u.Fragment,{children:c7.map(n=>u.jsxs("section",{className:"canvas-shortcuts-group","aria-labelledby":`canvas-shortcuts-${n.title.toLowerCase()}`,children:[u.jsx("h3",{id:`canvas-shortcuts-${n.title.toLowerCase()}`,children:n.title}),u.jsx("dl",{className:"canvas-shortcuts-list",children:n.entries.map(i=>u.jsxs("div",{className:"canvas-shortcuts-entry",children:[u.jsx("dt",{className:"canvas-shortcuts-combos",children:i.combos.map((s,o)=>u.jsxs("span",{className:"canvas-shortcuts-combo",children:[o>0?u.jsx("span",{className:"canvas-shortcuts-or",children:"or"}):null,u.jsx("span",{className:"canvas-shortcuts-keyset",children:s.map(f=>u.jsx("kbd",{children:f==="Mod"?e:f},f))})]},`${i.description}:${s.join("+")}`))}),u.jsx("dd",{children:i.description})]},`${n.title}:${i.description}`))})]},n.title))})}function Tp({checked:e,label:n,onClick:i,children:s}){return u.jsxs("button",{type:"button",role:"switch",className:`canvas-context-menu-switch ${e?"is-on":""}`,"aria-checked":e,onClick:i,children:[u.jsx("span",{className:"canvas-context-menu-switch-icon","aria-hidden":"true",children:s}),u.jsx("span",{className:"canvas-context-menu-switch-label",children:n}),u.jsx("span",{className:"canvas-context-menu-switch-track","aria-hidden":"true"})]})}function g7(){const n=navigator.userAgentData?.platform??navigator.platform;return d7.test(n)?"⌘":"Ctrl"}function m7(){return u.jsxs("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:[u.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"}),u.jsx("path",{d:"M2.4 4.6v2.8h2.8",fill:"none",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round"})]})}function _7(){return u.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:u.jsx("path",{d:"M9.5 3.5h3v3M12.5 3.5 9 7M6.5 12.5h-3v-3M3.5 12.5 7 9",fill:"none",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round"})})}function v7(){return u.jsxs("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:[u.jsx("circle",{cx:"8",cy:"8",r:"5.2",fill:"none",stroke:"currentColor",strokeWidth:"1.2"}),u.jsx("path",{d:"M8 8 12 5.6",fill:"none",stroke:"currentColor",strokeWidth:"1.2",strokeLinecap:"round"}),u.jsx("circle",{cx:"8",cy:"8",r:"1.1",fill:"currentColor"})]})}function b7(){return u.jsxs("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:[u.jsx("rect",{x:"3",y:"3.2",width:"10",height:"9.6",rx:"2",fill:"none",stroke:"currentColor",strokeWidth:"1.2"}),u.jsx("path",{d:"M10.9 3.2H13v2.1M5.1 12.8H3v-2.1",fill:"none",stroke:"currentColor",strokeWidth:"1.2",strokeLinecap:"round",strokeLinejoin:"round"}),u.jsx("path",{d:"M12.6 5.1c.5 1.4.4 2.9-.3 4.2M3.4 10.9c-.5-1.4-.4-2.9.3-4.2",fill:"none",stroke:"currentColor",strokeWidth:"1.2",strokeLinecap:"round"}),u.jsx("circle",{cx:"11.7",cy:"4.2",r:"0.9",fill:"currentColor"})]})}function y7(){return u.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:u.jsx("circle",{cx:"8",cy:"8",r:"3.2",fill:"currentColor",opacity:"0.86"})})}const nS=256,iS=176,Ap=12,Bu=220,KC="fleet-console.map.radarCollapsed";function S7({operations:e,pluginOperations:n,viewport:i,canvasSize:s,onJump:o}){const f=N.useRef(null),_=N.useRef(!1),[c,h]=N.useState(w7);if(s.width<=0||s.height<=0||i.zoom<=0)return null;const d=[...Object.entries(e).map(([I,Z])=>({id:I,kind:"op",x:Z.x,y:Z.y,width:Z.width,height:Z.height})),...Object.entries(n).map(([I,Z])=>({id:I,kind:"plugin",x:Z.geometry.x,y:Z.geometry.y,width:Z.geometry.width,height:Z.geometry.height}))];if(d.length===0)return null;const y=()=>{h(I=>{const Z=!I;return x7(Z),Z})};if(c)return u.jsx("button",{type:"button",className:"canvas-minimap-fab","data-canvas-blocker":!0,onClick:y,"aria-label":"Radar 펼치기",title:"Show radar",children:u.jsx(E7,{})});const p=nS-Ap*2,w=iS-Ap*2,C={x:-i.x/i.zoom,y:-i.y/i.zoom,width:s.width/i.zoom,height:s.height/i.zoom};let T=Math.min(C.x,...d.map(I=>I.x)),E=Math.min(C.y,...d.map(I=>I.y)),g=Math.max(C.x+C.width,...d.map(I=>I.x+I.width)),v=Math.max(C.y+C.height,...d.map(I=>I.y+I.height));T-=Bu,E-=Bu,g+=Bu,v+=Bu;const m=g-T,S=v-E,k=Math.min(p/m,w/S),L=(p-m*k)/2,R=(w-S*k)/2,M=I=>L+(I-T)*k,A=I=>R+(I-E)*k,B=I=>{const Z=f.current?.getBoundingClientRect();if(!Z)return;const X=I.clientX-Z.left,z=I.clientY-Z.top;o({x:T+(X-L)/k,y:E+(z-R)/k})},K=I=>{I.stopPropagation(),_.current=!0,I.currentTarget.setPointerCapture(I.pointerId),B(I)},F=I=>{_.current&&(I.stopPropagation(),B(I))},W=I=>{_.current=!1;try{I.currentTarget.releasePointerCapture(I.pointerId)}catch{}};return u.jsxs("div",{className:"canvas-minimap","data-canvas-blocker":!0,style:{width:nS,height:iS},children:[u.jsx("span",{className:"canvas-minimap-label","aria-hidden":"true",children:"Radar"}),u.jsx("button",{type:"button",className:"canvas-minimap-toggle",onClick:y,"aria-label":"Radar 접기",title:"Collapse radar",children:u.jsx(C7,{})}),u.jsxs("div",{ref:f,className:"canvas-minimap-inner",style:{inset:Ap},onPointerDown:K,onPointerMove:F,onPointerUp:W,onPointerCancel:W,role:"presentation","aria-label":"Canvas minimap — drag to navigate",children:[d.map(I=>u.jsx("div",{className:`canvas-minimap-operation ${I.kind==="plugin"?"is-plugin":""}`,style:{left:M(I.x),top:A(I.y),width:Math.max(2,I.width*k),height:Math.max(2,I.height*k)}},I.id)),u.jsx("div",{className:"canvas-minimap-view",style:{left:M(C.x),top:A(C.y),width:C.width*k,height:C.height*k}})]})]})}function w7(){if(typeof window>"u")return!1;try{return window.localStorage.getItem(KC)==="true"}catch{return!1}}function x7(e){if(!(typeof window>"u"))try{window.localStorage.setItem(KC,String(e))}catch{}}function C7(){return u.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:u.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 E7(){return u.jsxs("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:[u.jsx("rect",{x:"2",y:"3",width:"12",height:"10",rx:"2",fill:"none",stroke:"currentColor",strokeWidth:"1.2"}),u.jsx("rect",{x:"4.2",y:"5",width:"4.2",height:"3.1",rx:"0.6",fill:"none",stroke:"currentColor",strokeWidth:"1"}),u.jsx("circle",{cx:"11",cy:"10.2",r:"0.95",fill:"currentColor"})]})}const k7="is-animation-paused";function T7({viewport:e,backgroundAnimationEnabled:n}){const[i,s]=N.useState(()=>document.hidden);return N.useEffect(()=>{function o(){s(document.hidden)}return document.addEventListener("visibilitychange",o),()=>{document.removeEventListener("visibilitychange",o)}},[]),u.jsxs("div",{className:"operations-canvas-background","aria-hidden":"true",children:[u.jsx("div",{className:"operations-canvas-sea"}),u.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?u.jsxs("div",{className:`operations-radar${i?` ${k7}`:""}`,children:[u.jsx("span",{className:"operations-radar-ring operations-radar-ring--outer"}),u.jsx("span",{className:"operations-radar-ring operations-radar-ring--middle"}),u.jsx("span",{className:"operations-radar-ring operations-radar-ring--inner"}),u.jsx("span",{className:"operations-radar-sweep"})]}):null]})}const Oh=[{key:"red",label:"Red",color:"oklch(70% 0.12 25)"},{key:"orange",label:"Orange",color:"oklch(73% 0.12 50)"},{key:"amber",label:"Amber",color:"oklch(78% 0.11 70)"},{key:"yellow",label:"Yellow",color:"oklch(84% 0.11 95)"},{key:"lime",label:"Lime",color:"oklch(81% 0.12 120)"},{key:"green",label:"Green",color:"oklch(74% 0.12 145)"},{key:"emerald",label:"Emerald",color:"oklch(73% 0.10 165)"},{key:"teal",label:"Teal",color:"oklch(74% 0.09 185)"},{key:"cyan",label:"Cyan",color:"oklch(76% 0.09 205)"},{key:"sky",label:"Sky",color:"oklch(74% 0.10 230)"},{key:"blue",label:"Blue",color:"oklch(70% 0.11 255)"},{key:"indigo",label:"Indigo",color:"oklch(68% 0.11 278)"},{key:"violet",label:"Violet",color:"oklch(70% 0.11 300)"},{key:"purple",label:"Purple",color:"oklch(70% 0.12 320)"},{key:"magenta",label:"Magenta",color:"oklch(71% 0.12 340)"},{key:"rose",label:"Rose",color:"oklch(72% 0.11 5)"}];function Ql(e){return Oh.find(n=>n.key===e)?.color??null}function rS(e){return typeof e.accent=="string"?e.accent:null}const sS=8,A7=120;function R7({anchor:e,accentKey:n,onSelect:i,onClose:s}){const[o,f]=N.useState(void 0);N.useLayoutEffect(()=>{const c=Math.max(8,Math.min(e.left,window.innerWidth-8)),h=e.bottom+sS,d=h+A7>window.innerHeight;f(d?{position:"fixed",left:c,top:"auto",bottom:Math.round(window.innerHeight-e.top+sS)}:{position:"fixed",left:c,top:Math.round(h)})},[e]),N.useEffect(()=>{const c=h=>{h.key==="Escape"&&(h.preventDefault(),s())};return window.addEventListener("keydown",c),window.addEventListener("resize",s),window.addEventListener("scroll",s,!0),()=>{window.removeEventListener("keydown",c),window.removeEventListener("resize",s),window.removeEventListener("scroll",s,!0)}},[s]);const _=c=>{i(c),s()};return Es.createPortal(u.jsx("div",{className:"accent-popover-overlay",role:"presentation",onPointerDown:s,children:o?u.jsxs("div",{className:"accent-popover-card",role:"menu","aria-label":"Accent",style:o,onPointerDown:c=>c.stopPropagation(),children:[u.jsxs("button",{type:"button",className:"accent-popover-swatch accent-popover-swatch--clear",role:"menuitem","aria-label":"No accent","aria-pressed":n===null,onClick:()=>_(null),children:[u.jsx("span",{}),"None"]}),Oh.map(c=>u.jsx("button",{type:"button",className:"accent-popover-swatch",role:"menuitem","aria-label":c.label,"aria-pressed":n===c.key,onClick:()=>_(c.key),children:u.jsx("span",{style:{background:c.color}})},c.key))]}):null}),document.body)}function VC(e){const{currentTitle:n,onCommit:i,onBegin:s}=e,o=N.useRef(null),f=N.useRef(!1),_=N.useRef(!1),[c,h]=N.useState(!1),[d,y]=N.useState("");N.useEffect(()=>{c&&(o.current?.focus(),o.current?.select())},[c]);const p=()=>{s?.(),_.current=!1,y(n),h(!0)},w=()=>{_.current=!0,h(!1),y("")},C=()=>{if(!f.current){f.current=!0;try{i(d)}finally{f.current=!1,_.current=!0,h(!1)}}};return{renaming:c,draftTitle:d,inputRef:o,begin:p,cancel:w,commit:C,setDraftTitle:y,handleKeyDown:g=>{if(g.key==="Enter"){g.preventDefault(),C();return}g.key==="Escape"&&(g.preventDefault(),w())},handleBlur:()=>{if(_.current){_.current=!1;return}C()}}}const L7=["n","ne","e","se","s","sw","w","nw"],Rp=320,Lp=200;function M7({operation:e,active:n,geometry:i,zoom:s,subtitle:o,status:f,minimized:_=!1,maximized:c=!1,accentKey:h=null,children:d,onActivate:y,onClose:p,onMinimize:w,onMaximize:C,onRename:T,onSetAccent:E,onGeometryChange:g,onGeometryCommit:v}){const m=N.useRef(null),S=N.useRef(null),k=N.useRef(null),[L,R]=N.useState(null),M=e.title,A=VC({currentTitle:M,onCommit:T,onBegin:y}),B=h?Ql(h):null,K=["canvas-operation",n?"is-active":"",_?"is-minimized":"",c?"is-maximized":"",O7(f)].filter(Boolean).join(" "),F=G=>{c||G.button===0&&(G.preventDefault(),G.stopPropagation(),y(),S.current={pointerId:G.pointerId,startX:G.clientX,startY:G.clientY,geometry:i,latest:i},G.currentTarget.setPointerCapture(G.pointerId))},W=G=>{if(c)return;const Y=S.current;if(!Y||Y.pointerId!==G.pointerId)return;G.preventDefault(),G.stopPropagation();const ie={...Y.geometry,x:Y.geometry.x+(G.clientX-Y.startX)/s,y:Y.geometry.y+(G.clientY-Y.startY)/s};Y.latest=ie,g(ie)},I=G=>{if(c){S.current=null;return}const Y=S.current;!Y||Y.pointerId!==G.pointerId||(G.preventDefault(),G.stopPropagation(),S.current=null,G.currentTarget.releasePointerCapture(G.pointerId),v(Y.latest))},Z=(G,Y)=>{c||(Y.preventDefault(),Y.stopPropagation(),y(),k.current={direction:G,pointerId:Y.pointerId,startX:Y.clientX,startY:Y.clientY,geometry:i,latest:i},Y.currentTarget.setPointerCapture(Y.pointerId))},X=G=>{if(c)return;const Y=k.current;if(!Y||Y.pointerId!==G.pointerId)return;G.preventDefault(),G.stopPropagation();const ie=N7(Y.geometry,Y.direction,(G.clientX-Y.startX)/s,(G.clientY-Y.startY)/s);Y.latest=ie,g(ie)},z=G=>{if(c){k.current=null;return}const Y=k.current;!Y||Y.pointerId!==G.pointerId||(G.preventDefault(),G.stopPropagation(),k.current=null,G.currentTarget.releasePointerCapture(G.pointerId),v(Y.latest))},q=G=>{G.stopPropagation()},V=G=>{G.stopPropagation(),y()},j=G=>{G.stopPropagation(),y()},P=G=>{G.stopPropagation()},D=()=>{const G=typeof document<"u"?document.activeElement:null;G instanceof HTMLElement&&m.current?.contains(G)&&G.blur(),w()},U=G=>{y(),R(G)};return u.jsxs("article",{ref:m,className:K,style:{left:i.x,top:i.y,width:i.width,height:i.height,zIndex:i.zIndex,...B?{"--op-accent":B}:{}},onPointerDown:y,"data-canvas-operation":!0,"aria-label":`Operation ${M}`,inert:_?!0:void 0,children:[u.jsxs("div",{className:"canvas-operation-titlebar",onPointerDown:F,onPointerMove:W,onPointerUp:I,onPointerCancel:I,"data-canvas-blocker":!0,children:[E?u.jsx("button",{type:"button",className:"canvas-operation-beacon-button",onPointerDown:q,onClick:G=>U(G.currentTarget.getBoundingClientRect()),"aria-label":`Set accent for operation ${M}`,"aria-haspopup":"menu",title:"Set accent",children:u.jsx("span",{className:aS(f),"aria-hidden":"true"})}):u.jsx("span",{className:aS(f),"aria-hidden":"true"}),A.renaming?u.jsx("input",{ref:A.inputRef,className:"canvas-operation-rename-input",value:A.draftTitle,"aria-label":`${M} 이름 변경`,onPointerDown:G=>G.stopPropagation(),onChange:G=>A.setDraftTitle(G.target.value),onKeyDown:A.handleKeyDown,onBlur:A.handleBlur}):u.jsx("span",{className:"canvas-operation-title",onPointerDown:V,onDoubleClick:A.begin,title:"Double-click to rename",children:M}),o?u.jsx("span",{className:"canvas-operation-cli",children:o}):null,u.jsx("button",{type:"button",className:"canvas-operation-icon-button",onPointerDown:q,onClick:D,"aria-label":`Minimize operation ${M}`,title:"Minimize operation",children:u.jsx(D7,{})}),C?u.jsx("button",{type:"button",className:`canvas-operation-icon-button ${c?"is-active":""}`,onPointerDown:q,onClick:C,"aria-label":c?`Restore operation ${M}`:`Maximize operation ${M}`,"aria-pressed":c,title:c?"Restore operation":"Maximize operation",children:c?u.jsx(I7,{}):u.jsx(j7,{})}):null,u.jsx("button",{type:"button",className:"canvas-operation-icon-button",onPointerDown:q,onClick:p,"aria-label":`Close operation ${M}`,title:"Close operation",children:u.jsx(B7,{})})]}),u.jsx("div",{className:"canvas-operation-terminal",onPointerDown:j,onWheel:P,"data-canvas-blocker":!0,children:d}),!c&&L7.map(G=>u.jsx("div",{className:`canvas-operation-resize canvas-operation-resize--${G}`,onPointerDown:Y=>Z(G,Y),onPointerMove:X,onPointerUp:z,onPointerCancel:z,"data-canvas-blocker":!0,"aria-hidden":"true"},G)),L&&E?u.jsx(R7,{anchor:L,accentKey:h,onSelect:E,onClose:()=>R(null)}):null]})}function N7(e,n,i,s){let{x:o,y:f,width:_,height:c}=e;return n.includes("e")&&(_+=i),n.includes("s")&&(c+=s),n.includes("w")&&(o+=i,_-=i),n.includes("n")&&(f+=s,c-=s),_<Rp&&(n.includes("w")&&(o-=Rp-_),_=Rp),c<Lp&&(n.includes("n")&&(f-=Lp-c),c=Lp),{...e,x:o,y:f,width:_,height:c}}function O7(e){return e==="running"?"is-running is-running--turn":e==="awaiting"?"is-running is-running--awaiting":""}function aS(e){return e==="running"?"tenant-beacon is-turn-running":e==="awaiting"?"tenant-beacon is-awaiting":e==="dormant"?"tenant-beacon is-dormant":"tenant-beacon is-idle"}function D7(){return u.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:u.jsx("path",{d:"M3.5 11.5h9",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})})}function j7(){return u.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:u.jsx("path",{d:"M3.5 6V3.5H6M10 3.5h2.5V6M12.5 10v2.5H10M6 12.5H3.5V10",fill:"none",stroke:"currentColor",strokeWidth:"1.35",strokeLinecap:"round",strokeLinejoin:"round"})})}function I7(){return u.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:u.jsx("path",{d:"M6.2 3.5v2.7H3.5M9.8 3.5v2.7h2.7M12.5 9.8H9.8v2.7M3.5 9.8h2.7v2.7",fill:"none",stroke:"currentColor",strokeWidth:"1.35",strokeLinecap:"round",strokeLinejoin:"round"})})}function B7(){return u.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:u.jsx("path",{d:"M4.6 4.6 11.4 11.4M11.4 4.6 4.6 11.4",fill:"none",stroke:"currentColor",strokeWidth:"1.35",strokeLinecap:"round"})})}function P7({rect:e,viewport:n}){const i=l7(e,n);return u.jsx("div",{className:"canvas-rubber-band",style:{left:i.x,top:i.y,width:i.width,height:i.height},"aria-hidden":"true"})}const z7=.25,H7=2,$7=200,U7=150,oS=5,F7=.0018;function W7({viewport:e,disabled:n=!1,consumePointerDown:i=!1,onViewportChange:s,onZoom:o,onCreate:f,onConsumePointerDown:_,onClick:c}){const h=N.useRef(null),d=N.useRef(e),[y,p]=N.useState(null),[w,C]=N.useState(!1),[T,E]=N.useState(!1);N.useEffect(()=>{d.current=e},[e]),N.useEffect(()=>{const R=A=>{A.key==="Shift"&&E(!0),!G7(A.target)&&A.code==="Space"&&(A.preventDefault(),C(!0))},M=A=>{A.key==="Shift"&&E(!1),A.code==="Space"&&C(!1)};return window.addEventListener("keydown",R),window.addEventListener("keyup",M),()=>{window.removeEventListener("keydown",R),window.removeEventListener("keyup",M)}},[]);const g=R=>{if(n||lS(R.target)||R.button!==0&&R.button!==1)return;if(R.preventDefault(),i){_?.();return}const M=Np(R),A=R.shiftKey&&R.button===0&&!w?"create":"pan";h.current={pointerId:R.pointerId,mode:A,startScreen:M,currentScreen:M,startViewport:d.current},R.currentTarget.setPointerCapture(R.pointerId),A==="create"&&p(Mp(M,M,d.current))},v=R=>{const M=h.current;if(!M||M.pointerId!==R.pointerId)return;R.preventDefault();const A=Np(R);if(h.current={...M,currentScreen:A},M.mode==="pan"){s({...M.startViewport,x:M.startViewport.x+A.x-M.startScreen.x,y:M.startViewport.y+A.y-M.startScreen.y});return}p(Mp(M.startScreen,A,d.current))},m=R=>{L(R,!0)},S=R=>{L(R,!1)},k=R=>{if(n||lS(R.target))return;R.preventDefault();const M=Np(R),A=d.current,B=q7(A.zoom*Math.exp(-R.deltaY*F7),z7,H7),K=Jl(M,A);o({x:M.x-K.x*B,y:M.y-K.y*B,zoom:B})},L=(R,M)=>{const A=h.current;if(!A||A.pointerId!==R.pointerId||(h.current=null,R.currentTarget.releasePointerCapture(R.pointerId),p(null),!M))return;const B=Math.abs(A.currentScreen.x-A.startScreen.x),K=Math.abs(A.currentScreen.y-A.startScreen.y);if(B<oS&&K<oS){c?.();return}if(A.mode!=="create")return;const F=Mp(A.startScreen,A.currentScreen,d.current),W={x:F.x,y:F.y,width:Math.max(F.width,$7),height:Math.max(F.height,U7)};f(W,A.currentScreen)};return{rubberBand:y,spaceActive:w,shiftActive:T,onPointerDown:g,onPointerMove:v,onPointerUp:m,onPointerCancel:S,onWheel:k}}function Mp(e,n,i){const s=Jl(e,i),o=Jl(n,i),f=Math.min(s.x,o.x),_=Math.min(s.y,o.y);return{x:f,y:_,width:Math.abs(s.x-o.x),height:Math.abs(s.y-o.y)}}function Np(e){const n=e.currentTarget.getBoundingClientRect();return{x:e.clientX-n.left,y:e.clientY-n.top}}function lS(e){return e instanceof Element&&!!e.closest("[data-canvas-blocker], [data-canvas-operation]")}function G7(e){return e instanceof HTMLElement&&!!e.closest("input, textarea, select, [contenteditable='true']")}function q7(e,n,i){return Math.min(i,Math.max(n,e))}const K7="Shift-drag to create a Shell. Right-click for actions. Drag to pan; scroll to zoom.",V7=560,Y7=360;function X7({state:e,catalog:n,canLaunch:i,mapFullscreen:s,radarEnabled:o,perimeterEnabled:f,renderKindIcon:_,onLaunchKind:c,onLaunchAtGeometry:h,onResetView:d,onMaximizeMap:y,onToggleRadar:p,onTogglePerimeter:w,onClose:C,onFocus:T,onSetAccent:E}){const g=N.useRef(null),v=ew(),m=nw(),S=iw(),k=e.activeOperationId,[L,R]=N.useState(null),M=ac(),[A,B]=N.useState({width:0,height:0}),K=!e.activeTheaterId||e.addingTheater;N.useEffect(()=>{const Y=g.current;if(!Y||typeof ResizeObserver>"u")return;const ie=()=>B({width:Y.clientWidth,height:Y.clientHeight});ie();const se=new ResizeObserver(ie);return se.observe(Y),()=>se.disconnect()},[]);const F=W7({viewport:v.viewport,disabled:K,onViewportChange:Zp,onZoom:rw,onCreate:Y=>{if(R(null),e.activeTheaterId&&i){const ie=nI(n);if(!ie)return;const se={...Q7(Y),zIndex:sa()};h(ie.pluginId,ie.kind,se)}},consumePointerDown:L!==null,onConsumePointerDown:()=>{R(null)},onClick:J7}),W=(Y,ie)=>{const se=L?.canvasPoint;R(null),se&&c(Y,ie,se)},I=()=>{R(null),d()},Z=Y=>{if(Y.target instanceof Element&&Y.target.closest("[data-canvas-blocker], [data-canvas-operation]"))return;Y.preventDefault();const ie=g.current?.getBoundingClientRect();if(!ie)return;const se={x:Y.clientX-ie.left,y:Y.clientY-ie.top};R({anchor:se,canvasPoint:Jl(se,v.viewport)})},X=new Set(S);N.useEffect(()=>{e.activeOperationId&&X.has(e.activeOperationId)&&or(null)},[S,e.activeOperationId]);const z=Object.fromEntries(Object.entries(v.operations).filter(([Y])=>!X.has(Y))),q=(e.operations??[]).filter(Y=>Y.theaterId===e.activeTheaterId),V=q,j=q.length>0,P=M.operationKinds,U=m!==null&&q.some(Y=>Y.id===m&&!X.has(Y.id))?m:null,G=tI(v.operations)+1;return u.jsxs("main",{className:`operations-canvas ${F.spaceActive?"is-panning":""} ${F.shiftActive?"is-creating":""} ${U?"is-panel-maximized":""} ${f?"":"is-perimeter-anim-off"}`,onPointerDown:F.onPointerDown,onPointerMove:F.onPointerMove,onPointerUp:F.onPointerUp,onPointerCancel:F.onPointerCancel,onWheel:F.onWheel,onContextMenu:Z,ref:g,children:[u.jsx(T7,{viewport:v.viewport,backgroundAnimationEnabled:o}),u.jsx("div",{className:"operations-canvas-world",style:{transform:`translate(${v.viewport.x}px, ${v.viewport.y}px) scale(${v.viewport.zoom})`},children:V.map(Y=>{const ie=v.operations[Y.id]??Y.geometry??Op(Y),se=U===Y.id,J=se?eI(v.viewport,A,G):ie;return rI(Y,{active:k===Y.id,geometry:J,operationKindRegistry:P,status:e.operationStatus[Y.id],theme:e.activeTheme,viewportZoom:v.viewport.zoom,minimized:X.has(Y.id),maximized:se,accentKey:v.operationAccent[Y.id]??iI(Y),onActivate:()=>{or(Y.id),se||Jp(Y.id,v.operations[Y.id]??Y.geometry??Op(Y))},onClose:()=>{e.activeOperationId===Y.id&&or(null),U===Y.id&&po(),C(Y.id)},onMinimize:()=>{e.activeOperationId===Y.id&&or(null),YT(Y.id)},onMaximize:()=>{se?po():(or(Y.id),zl(Y.id))},onRename:H=>{oI(Y.id,H)},onSetAccent:H=>{E(Y.id,H)},onGeometryChange:H=>{se||Jp(Y.id,H)},onGeometryCommit:H=>{se||aI(Y.id,fo().operations[Y.id]??H)}})})}),j?null:u.jsxs("div",{className:"operations-canvas-empty","data-canvas-blocker":!0,children:[u.jsx("span",{className:"operations-canvas-empty-mark","aria-hidden":"true"}),u.jsx("p",{children:e.activeTheaterId?K7:"Add a Theater from the top bar to start operations."})]}),F.rubberBand?u.jsx(P7,{rect:F.rubberBand,viewport:v.viewport}):null,L?u.jsx(Vu,{anchor:L.anchor,viewportBounds:Z7(g.current),placement:"cursor",catalog:n,canLaunch:i,mapFullscreen:s,radarEnabled:o,perimeterEnabled:f,renderKindIcon:_,onLaunchKind:W,onResetView:I,onMaximizeMap:y,onToggleRadar:p,onTogglePerimeter:w,onClose:()=>R(null)},`${L.anchor.x}:${L.anchor.y}`):null,u.jsx(S7,{operations:z,pluginOperations:Object.fromEntries(q.filter(Y=>!X.has(Y.id)).map(Y=>[Y.id,{theaterId:Y.theaterId,geometry:v.operations[Y.id]??Y.geometry??Op(Y)}])),viewport:v.viewport,canvasSize:A,onJump:Y=>Zp({x:A.width/2-Y.x*v.viewport.zoom,y:A.height/2-Y.y*v.viewport.zoom,zoom:v.viewport.zoom})})]})}function Z7(e){if(!e)return;const n=e.getBoundingClientRect();return{width:n.width,height:n.height}}function J7(){if(typeof document<"u"){const e=document.activeElement;e instanceof HTMLElement&&e.blur()}or(null)}function Q7(e){return{x:e.x,y:e.y,width:e.width,height:e.height,zIndex:0}}function Op(e){return e.geometry??{x:0,y:0,width:V7,height:Y7,zIndex:0}}function eI(e,n,i){return{x:-e.x/e.zoom,y:-e.y/e.zoom,width:Math.max(320,n.width)/e.zoom,height:Math.max(240,n.height)/e.zoom,zIndex:i}}function tI(e){return Object.values(e).reduce((n,i)=>Math.max(n,i.zIndex),0)}function nI(e){const n=e.flatMap(i=>i.kinds.filter(s=>s.disabled!==!0).map(s=>({pluginId:i.id,kind:s})));return n.find(({kind:i})=>i.type==="shell")??n[0]??null}function iI(e){return typeof e.accent=="string"?e.accent:null}function rI(e,n){const i=n.operationKindRegistry.find(f=>f.pluginId===e.pluginId&&f.type===e.type),s=n.geometry;if(!i?.render)return null;const o=Eh(()=>{zi(null).then(Hi).catch(()=>{})});return u.jsx(M7,{operation:e,active:n.active,geometry:s,zoom:n.viewportZoom,subtitle:i.subtitle?.(e),status:n.status,minimized:n.minimized,maximized:n.maximized,accentKey:n.accentKey,onActivate:n.onActivate,onClose:n.onClose,onMinimize:n.onMinimize,onMaximize:n.onMaximize,onRename:n.onRename,onSetAccent:n.onSetAccent,onGeometryChange:n.onGeometryChange,onGeometryCommit:n.onGeometryCommit,children:u.jsx(Xg,{fallback:u.jsx("div",{className:"fc-plugin-error",children:"Plugin operation failed to render."}),children:u.jsx(sI,{active:n.active,capabilities:o,descriptor:i,geometry:s,operation:e,theme:n.theme,viewportZoom:n.viewportZoom,onActivate:n.onActivate,onClose:n.onClose,onGeometryChange:n.onGeometryChange})})},e.id)}function sI({active:e,capabilities:n,descriptor:i,geometry:s,operation:o,theme:f,viewportZoom:_,onActivate:c,onClose:h,onGeometryChange:d}){return i.render?i.render({operationId:o.id,theaterId:o.theaterId,pluginId:o.pluginId,type:o.type,operation:o,geometry:s,active:e,zoom:_,theme:f,api:n.api,lifecycle:n.lifecycle,terminal:n.terminal,notifications:n.notifications,operations:n.operations,preferences:n.preferences,settings:n.settings,status:n.status,onActivate:c,onClose:h,onGeometryChange:d}):null}async function aI(e,n){await fetch(`/api/v1/operations/${encodeURIComponent(e)}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({geometry:n})})}async function oI(e,n){await mw(e,n),await zi(null).then(Hi)}const zg="fleet-console.rail.activePanelId";function lI(){try{return localStorage.getItem(zg)}catch{return null}}function YC(e){try{e===null?localStorage.removeItem(zg):localStorage.setItem(zg,e)}catch{}}const Hg=new Set;let ec={activeRailPanelId:lI()};function XC(){for(const e of Hg)e()}function cI(e){return Hg.add(e),()=>{Hg.delete(e)}}function uI(){return ec}function hI(e){const n=ec.activeRailPanelId===e?null:e;ec={activeRailPanelId:n},YC(n),XC()}function dI(){ec.activeRailPanelId!==null&&(ec={activeRailPanelId:null},YC(null),XC())}function ZC(){return N.useSyncExternalStore(cI,uI).activeRailPanelId}function JC(e){if(!e.operationsViewActive||!e.activeOperationId)return new Set;const n=e.operations.find(i=>i.id===e.activeOperationId);return!n||n.theaterId!==e.activeTheaterId?new Set:new Set([n.id])}function QC(e,n){const i=new Set(n.map(s=>s.id));return e.filter(s=>i.has(s.operationId))}function e2(e,n){const i=[],s=[];for(const o of e)n.has(o.operationId)?s.push(o):i.push(o);return{hidden:i,visible:s}}function $g(e){const n=new Map;for(const i of[...e].sort((s,o)=>o.lastRaisedSeq-s.lastRaisedSeq)){const s=i.theaterId??"__unknown__",o=n.get(s)??{theaterId:i.theaterId,theaterLabel:i.theaterLabel,notifications:[],totalCount:0};o.notifications.push(i),o.totalCount+=i.count,n.set(s,o)}return[...n.values()].sort((i,s)=>{const o=i.notifications[0]?.lastRaisedSeq??0;return(s.notifications[0]?.lastRaisedSeq??0)-o})}function t2(e,n){return n.globalMute||n.dnd?[]:e.filter(i=>!i.theaterId||n.mutedTheaterIds[i.theaterId]!==!0)}const fI={ended:"Stood down","input-waiting":"Awaiting orders"},pI={id:"alerts",title:"Alerts",icon:()=>u.jsx(mI,{}),render:()=>u.jsx(gI,{})};function gI(){const e=Ur(),n=Sh(),[i,s]=N.useState(!1),o=N.useMemo(()=>QC(Object.values(e.operationNotifications),e.operations),[e.operationNotifications,e.operations]),f=JC(e),_=e2(o,f).hidden,c=t2(_,e.notificationPreferences),h=$g(c),d=$g(_),y=Ug(h,"input-waiting"),p=Ug(h,"ended"),w=h.length===0,C=N.useCallback(T=>{xh(T.operationId),n("/operations")},[n]);return u.jsxs("div",{className:"alerts-panel-body","aria-live":"polite","aria-label":"Operation alerts",children:[u.jsxs("div",{className:"alerts-panel-toolbar",children:[u.jsxs("div",{className:"alerts-panel-tallies","aria-hidden":"true",children:[y>0?u.jsx("span",{className:"notification-tally is-input-waiting",children:y}):null,p>0?u.jsx("span",{className:"notification-tally is-ended",children:p}):null,w?u.jsx("span",{className:"alerts-panel-tally-empty",children:"—"}):null]}),u.jsx("button",{type:"button",className:`alerts-panel-settings-btn${i?" is-active":""}`,onClick:()=>s(T=>!T),"aria-expanded":i,"aria-label":"Notification settings",title:"Notification settings",children:u.jsx(yI,{})})]}),i?u.jsx(_I,{groups:d}):null,w?u.jsx("p",{className:"notification-dock-empty",children:"No active alerts"}):u.jsx("div",{className:"notification-dock-deck",children:h.map(T=>u.jsxs("section",{className:"notification-cluster-group",children:[u.jsxs("header",{className:"notification-cluster-group-head",children:[u.jsx("span",{className:"notification-cluster-theater",children:T.theaterLabel}),u.jsx("span",{className:"notification-cluster-group-count",children:T.totalCount})]}),u.jsx("ul",{className:"notification-cluster-roster",children:T.notifications.map(E=>u.jsxs("li",{className:`notification-row is-${E.kind}`,children:[u.jsx("span",{className:"notification-row-beacon","aria-hidden":"true"}),u.jsxs("span",{className:"notification-row-body",children:[u.jsx("span",{className:"notification-row-op",children:E.operationLabel}),u.jsx("span",{className:"notification-row-state",children:fI[E.kind]})]}),E.count>1?u.jsx("span",{className:"notification-row-count",children:E.count}):null,u.jsx("button",{type:"button",className:"notification-row-move",onClick:()=>C(E),"aria-label":`Open ${T.theaterLabel} ${E.operationLabel}`,children:"Open"})]},E.operationId))})]},T.theaterId??"__unknown__"))})]})}function mI(){const e=Ur(),i=ZC()==="alerts",s=N.useMemo(()=>QC(Object.values(e.operationNotifications),e.operations),[e.operationNotifications,e.operations]),o=JC(e),f=e2(s,o).hidden,_=t2(f,e.notificationPreferences),c=$g(_),h=c.reduce((E,g)=>E+g.totalCount,0),d=Ug(c,"input-waiting"),y=N.useMemo(()=>_.reduce((E,g)=>Math.max(E,g.lastRaisedSeq),0),[_]),p=N.useRef(y),[w,C]=N.useState(0);N.useEffect(()=>{y>p.current&&!i&&C(E=>E+1),p.current=y},[y,i]);const T=h===0?"muted":d>0?"awaiting":"ended";return u.jsxs("span",{className:`alerts-icon is-${T}`,"aria-hidden":"true",children:[u.jsx(bI,{}),h>0?u.jsx("span",{className:"alerts-icon-badge",children:h}):null,w>0?u.jsx("span",{className:"alerts-icon-pulse","aria-hidden":"true"},w):null]})}function _I({groups:e}){const n=Ur(),i=vI(e,n.notificationPreferences.mutedTheaterIds,n.theaters);return u.jsxs("div",{className:"notification-cluster-settings",role:"dialog","aria-label":"Notification settings",children:[u.jsx("p",{className:"notification-cluster-settings-eyebrow",children:"Display"}),u.jsxs("label",{className:"notification-cluster-setting",children:[u.jsx("input",{type:"checkbox",checked:n.notificationPreferences.globalMute,onChange:s=>_R(s.currentTarget.checked)}),u.jsx("span",{children:"Mute all"})]}),u.jsxs("label",{className:"notification-cluster-setting",children:[u.jsx("input",{type:"checkbox",checked:n.notificationPreferences.dnd,onChange:s=>vR(s.currentTarget.checked)}),u.jsx("span",{children:"Do not disturb"})]}),i.length>0?u.jsx("p",{className:"notification-cluster-settings-eyebrow",children:"By Theater"}):null,i.map(s=>u.jsxs("label",{className:"notification-cluster-setting",children:[u.jsx("input",{type:"checkbox",checked:s.theaterId?n.notificationPreferences.mutedTheaterIds[s.theaterId]===!0:!1,onChange:()=>{s.theaterId&&bR(s.theaterId)}}),u.jsx("span",{children:s.theaterLabel})]},s.theaterId))]})}function vI(e,n,i){const s=new Map;for(const o of e)o.theaterId&&s.set(o.theaterId,o);for(const o of Object.keys(n))s.has(o)||s.set(o,{theaterId:o,theaterLabel:i.find(f=>f.id===o)?.label??o,notifications:[],totalCount:0});return[...s.values()]}function Ug(e,n){let i=0;for(const s of e)for(const o of s.notifications)o.kind===n&&(i+=o.count);return i}function bI(){return u.jsxs("svg",{viewBox:"0 0 16 16","aria-hidden":"true",width:"16",height:"16",children:[u.jsx("path",{d:"M8 2a4.5 4.5 0 0 0-4.5 4.5v2.25L2 10.5v.75h12v-.75l-1.5-1.75V6.5A4.5 4.5 0 0 0 8 2Z",fill:"none",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round"}),u.jsx("path",{d:"M6.5 12a1.5 1.5 0 0 0 3 0",fill:"none",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round"})]})}function yI(){return u.jsxs("svg",{viewBox:"0 0 16 16","aria-hidden":"true",width:"15",height:"15",children:[u.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"}),u.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"})]})}async function SI(e,n){const s=new URLSearchParams().toString();return wo(ca(e,`/search${s?`?${s}`:""}`))}async function wI(e,n,i){return wo(ca(e,`/entry/${encodeURIComponent(n)}`))}async function n2(e,n="pending"){return wo(ca(e,`/drydock?status=${encodeURIComponent(n)}`))}async function xI(e,n){return wo(ca(e,`/drydock/${encodeURIComponent(n)}`))}async function CI(e,n,i,s){const o={action:i};return s!==void 0&&(o.reason=s),TI(ca(e,`/drydock/${encodeURIComponent(n)}/decision`),o)}async function EI(e){return wo(ca(e,"/conflicts"))}async function kI(e,n){return wo(ca(e,`/conflicts/${encodeURIComponent(n)}`))}function ca(e,n){const i=n.startsWith("/")?n:`/${n}`;return e?`/console/codex/w/${encodeURIComponent(e)}/api${i}`:`/console/codex/api${i}`}async function wo(e){const n=await fetch(e,{headers:{accept:"application/json"}});if(!n.ok)throw new Error(await i2(e,n));return n.json()}async function TI(e,n){const i=await fetch(e,{method:"POST",headers:{"content-type":"application/json",accept:"application/json"},body:JSON.stringify(n)});if(!i.ok)throw new Error(await i2(e,i));return i.json()}async function i2(e,n){return(await n.json().catch(()=>null))?.error??`${e} request failed: ${n.status}`}const Fg=new Set,mh={index:[],conflicts:[],pendingPatchCount:0,currentWorkspaceId:null,loading:!1,error:null};function ro(){return mh}function r2(e){return Fg.add(e),()=>Fg.delete(e)}function cS(e){Yu({currentWorkspaceId:e})}async function _h(){Yu({loading:!0,error:null});try{const e=mh.currentWorkspaceId,[n,i]=await Promise.all([SI(e),n2(e,"pending").catch(()=>null)]);Yu({index:n.entries,pendingPatchCount:i?.pendingCount??0,loading:!1})}catch(e){Yu({loading:!1,error:AI(e)})}}function Yu(e){Object.assign(mh,e);for(const n of Fg)n(mh)}function AI(e){return e instanceof Error?e.message:String(e)}const RI=120;function Yi(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""")}function LI(e,n){if(!n)return Yi(e);const i=e.toLowerCase().indexOf(n.toLowerCase());return i===-1?Yi(e):Yi(e.slice(0,i))+`<mark>${Yi(e.slice(i,i+n.length))}</mark>`+Yi(e.slice(i+n.length))}function MI(e){return`<span class="codex-nav-tag">${Yi(e)}</span>`}function NI(e,n,i){const s=n?e.tags.some(c=>c.toLowerCase().includes(n.toLowerCase())):!1,o=e.tags.slice(0,3).map(MI).join(""),f=Yi(e.status??"current"),_=Yi(e.updated??"");return`<button
|
|
213
|
-
class="codex-nav-entry${i?" is-current":""}"
|
|
214
|
-
data-entry-id="${Yi(e.id)}"
|
|
215
|
-
type="button"
|
|
216
|
-
${i?'aria-current="page"':""}
|
|
217
|
-
title="${Yi(e.title)}"
|
|
218
|
-
>
|
|
219
|
-
<span class="t">${LI(e.title,s?"":n)}</span>
|
|
220
|
-
${o?`<span class="tg">${o}</span>`:""}
|
|
221
|
-
<span class="meta">${f} · ${_}</span>
|
|
222
|
-
</button>`}function OI(e,n){if(!n)return e;const i=n.toLowerCase();return e.filter(s=>s.title.toLowerCase().includes(i)||s.tags.some(o=>o.toLowerCase().includes(i)))}function DI(e,n){let i="",s=null,o=null;e.innerHTML=`
|
|
223
|
-
<div class="codex-navigator">
|
|
224
|
-
<div class="codex-nav-search">
|
|
225
|
-
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><circle cx="11" cy="11" r="7"/><path d="M21 21l-4.35-4.35"/></svg>
|
|
226
|
-
<input
|
|
227
|
-
class="codex-nav-search-input"
|
|
228
|
-
type="search"
|
|
229
|
-
placeholder="Search entries"
|
|
230
|
-
autocomplete="off"
|
|
231
|
-
spellcheck="false"
|
|
232
|
-
aria-label="Search Codex entries"
|
|
233
|
-
/>
|
|
234
|
-
</div>
|
|
235
|
-
<div class="codex-nav-quick-row">
|
|
236
|
-
<button class="codex-nav-quick" data-action="drydock" type="button">
|
|
237
|
-
⚓ Drydock <span class="badge" id="codex-nav-drydock-badge">0</span>
|
|
238
|
-
</button>
|
|
239
|
-
<button class="codex-nav-quick" data-action="conflicts" type="button">Conflicts</button>
|
|
240
|
-
</div>
|
|
241
|
-
<div class="codex-nav-list-eyebrow" id="codex-nav-eyebrow">Entries · 0</div>
|
|
242
|
-
<div class="codex-navigator-scroll">
|
|
243
|
-
<div class="codex-nav-list" id="codex-nav-list"></div>
|
|
244
|
-
</div>
|
|
245
|
-
</div>
|
|
246
|
-
`;const f=e.querySelector(".codex-nav-search-input"),_=e.querySelector("#codex-nav-list"),c=e.querySelector("#codex-nav-eyebrow"),h=e.querySelector("#codex-nav-drydock-badge");function d(C){const T=OI(C.index,i);if(c.textContent=`Entries · ${T.length}`,h.textContent=String(C.pendingPatchCount),h.hidden=C.pendingPatchCount===0,C.loading&&C.index.length===0){_.innerHTML='<div class="codex-nav-loading" aria-live="polite">Loading…</div>';return}if(C.error){_.innerHTML=`<div class="codex-nav-error" role="alert">${Yi(C.error)}</div>`;return}if(T.length===0){_.innerHTML=`<div class="codex-nav-empty">${i?"No entries match.":"No entries."}</div>`;return}_.innerHTML=T.map(E=>NI(E,i,E.id===s)).join("")}function y(C){const T=C.target;if(!(T instanceof Element))return;const E=T.closest("[data-entry-id]");if(E?.dataset.entryId){s=E.dataset.entryId,d(ro()),n.onRequest({kind:"entry",id:s});return}const g=T.closest("[data-action]");if(g?.dataset.action==="drydock"){n.onRequest({kind:"drydock"});return}if(g?.dataset.action==="conflicts"){n.onRequest({kind:"conflicts"});return}}function p(){o!==null&&clearTimeout(o),o=setTimeout(()=>{i=f.value,d(ro())},RI)}e.addEventListener("click",y),f.addEventListener("input",p);const w=r2(C=>d(C));return d(ro()),{destroy(){w(),e.removeEventListener("click",y),f.removeEventListener("input",p),o!==null&&clearTimeout(o),e.innerHTML=""},setTheater(C){i="",s=null,f&&(f.value=""),d(ro())}}}function jI(e,n){n.initialTheaterId&&cS(n.initialTheaterId);const i=DI(e,{initialTheaterId:n.initialTheaterId,onRequest:n.onRequest}),s=r2(()=>{});_h();const o=i.destroy.bind(i);return{destroy(){s(),o()},setTheater(f){cS(f),_h(),i.setTheater(f)}}}function xt(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">")}function _o(e){return xt(e).replace(/"/g,""")}const II="contextual-knowledge-not-instructions";function BI(e,n){const i=e.frontmatter.whyThisMatched,s=o2(e,n);return`
|
|
247
|
-
<div class="context-actions-grid">
|
|
248
|
-
<button class="context-action-btn" type="button" data-action="copy-compact-context">
|
|
249
|
-
<span class="context-action-label">Compact context</span>
|
|
250
|
-
<span class="context-action-meta">${Xu(s2(e))} tok</span>
|
|
251
|
-
</button>
|
|
252
|
-
<button class="context-action-btn" type="button" data-action="copy-provenance-context">
|
|
253
|
-
<span class="context-action-label">Provenance</span>
|
|
254
|
-
<span class="context-action-meta">${Xu(a2(e))} tok</span>
|
|
255
|
-
</button>
|
|
256
|
-
<button class="context-action-btn" type="button" data-action="copy-related-context">
|
|
257
|
-
<span class="context-action-label">Context pack</span>
|
|
258
|
-
<span class="context-action-meta">${Xu(s)} tok</span>
|
|
259
|
-
</button>
|
|
260
|
-
${i?`
|
|
261
|
-
<button class="context-action-btn context-action-btn--secondary" type="button" data-action="toggle-why-matched">
|
|
262
|
-
<span class="context-action-label">Why this matched</span>
|
|
263
|
-
</button>
|
|
264
|
-
<div class="context-why-matched" hidden>${xt(i)}</div>
|
|
265
|
-
`:""}
|
|
266
|
-
</div>
|
|
267
|
-
`}function s2(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:Fm(e.body)};return JSON.stringify({...n,token_estimate:Xu(JSON.stringify(n))},null,2)}function a2(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",Fm(e.body)].join(`
|
|
268
|
-
`)}function o2(e,n){const i=new Set([...e.frontmatter.related??[]]),s=n.filter(o=>i.has(o.id)).sort((o,f)=>o.title.localeCompare(f.title));return[`<fleet-wiki-context boundary="${II}">`,"# 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",Fm(e.body),"","### Related Entries",...s.length>0?s.map(o=>`- [[wiki:${o.id}]] — ${o.title}`):["- (none)"],"","</fleet-wiki-context>"].join(`
|
|
269
|
-
`)}function Xu(e){return Math.max(1,Math.ceil(e.length/4))}function Fm(e){return e.replace(/\s+/g," ").trim().slice(0,240)||"(empty)"}function PI(e){const n=e.tags.map(s=>`<span class="chip chip-tag">${xt(s)}</span>`).join(""),i=HI(e);return`
|
|
270
|
-
<div class="meta-chips">
|
|
271
|
-
${n}
|
|
272
|
-
${i}
|
|
273
|
-
<span class="chip">Updated ${xt(zI(e.updated))}</span>
|
|
274
|
-
</div>
|
|
275
|
-
`}function l2(e){return e.map(n=>`<span class="chip chip-muted">${xt(n)}</span>`).join("")}function zI(e){const n=new Date(e);return Number.isNaN(n.getTime())?e:n.toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"})}function HI(e){const n=$I(e);return n?`<span class="chip ${n.tone==="deprecated"?"chip-coral":n.tone==="stale"?"chip-stale":""}" title="${_o(n.title)}">${xt(n.label)}</span>`:""}function $I(e,n=new Date){const i=e.status,s=typeof e.revalidateAfter=="string"&&!Number.isNaN(Date.parse(e.revalidateAfter))&&Date.parse(e.revalidateAfter)<n.getTime();return i==="deprecated"||i==="superseded"?{label:i,tone:"deprecated",title:s?`${i} · stale`:i}:s?{label:"stale",tone:"stale",title:e.revalidateAfter??"stale"}:i==="current"||i==="draft"?{label:i,tone:"neutral",title:i}:null}const UI="active";function uS(e){return e.length===0?'<p class="toc-empty">No sections</p>':e.map(n=>`<a class="ti toc-level-${n.level}" href="#${_o(n.id)}" data-toc-id="${_o(n.id)}">${xt(n.text)}</a>`).join("")}function hS(e,n,i){if(n.length===0||typeof IntersectionObserver>"u")return()=>{};const s=[...i.querySelectorAll("[data-toc-id]")],o=new Set(n.map(d=>d.id)),f=[...e.querySelectorAll("h2[id], h3[id]")].filter(d=>o.has(d.id));if(s.length===0||f.length===0)return()=>{};const _=e.closest(".codex-reading-sheet-read"),c=new Set,h=new IntersectionObserver(d=>{for(const p of d){const w=p.target instanceof HTMLElement?p.target.id:"";w&&(p.isIntersecting?c.add(w):c.delete(w))}const y=FI(f,c)??WI(f,_)??f[0]?.id??null;dS(s,y)},{root:_,rootMargin:"-20% 0px -65% 0px",threshold:[0,.2,.6,1]});for(const d of f)h.observe(d);return dS(s,f[0]?.id??null),()=>h.disconnect()}function FI(e,n){for(const i of e)if(n.has(i.id))return i.id;return null}function WI(e,n){const i=n?n.getBoundingClientRect().top:0;let s=null;for(const o of e)if(o.getBoundingClientRect().top-i<=80)s=o.id;else break;return s}function dS(e,n){for(const i of e){const s=!!(n&&i.dataset.tocId===n);i.classList.toggle(UI,s),s?i.setAttribute("aria-current","location"):i.removeAttribute("aria-current")}}function fS(e){return`/entry/${encodeURIComponent(e)}`}const c2={create_wiki:"+",update_wiki:"↻"},u2={create_wiki:"Create",update_wiki:"Update"};function GI(e,n){let i=!1,s=null,o=n,f="idle",_=null,c=null,h=null;mC(e);function d(v){const m=v.target;if(!(m instanceof Element))return;const S=m.closest("[data-patch-id]");if(S){v.preventDefault();const B=S.dataset.patchId||void 0;o.onPatchOpen?.(B);return}const k=m.closest("[data-entry-id]");if(k?.dataset.entryId){v.preventDefault(),o.onRelatedClick(k.dataset.entryId);return}const L=m.closest("[data-drydock-action]");if(L){v.preventDefault(),y(L.dataset.drydockAction);return}const R=m.closest("[data-action]");if(!R)return;const M=R.dataset.action,A=e._currentEntry;if(A){if(M==="copy-compact-context")navigator.clipboard.writeText(s2(A));else if(M==="copy-provenance-context")navigator.clipboard.writeText(a2(A));else if(M==="copy-related-context")navigator.clipboard.writeText(o2(A,ro().index));else if(M==="toggle-why-matched"){const B=R.nextElementSibling;B?.classList.contains("context-why-matched")&&(B.hidden=!B.hidden)}}}function y(v){if(v){if(v==="back"){o.onPatchOpen?.(void 0);return}if(v==="approve"){f="approving",_=null,w();return}if(v==="approve-confirm"){p("approve",void 0);return}if(v==="reject"){f="rejecting",_=null,w();return}if(v==="reject-submit"){const m=e.querySelector("#queue-reject-reason")?.value.trim();if(!m){_="Rejection reason is required.",w();return}p("reject",m);return}if(v==="cancel"){f="idle",_=null,w();return}}}async function p(v,m){if(h){f="submitting",_=null,w();try{await CI(o.theaterId,h,v,m),o.onDecided?.()}catch(S){f=v==="approve"?"approving":"rejecting",_=S instanceof Error?S.message:String(S),w()}}}function w(){const v=e.querySelector("[data-decision-bar-wrap]");v&&(v.innerHTML=h2(f,_))}e.addEventListener("click",d);function C(){s?.(),s=null}async function T(v){if(!i){Dp(e,n.tocContainer),C();try{const m=await wI(o.theaterId,v);if(i)return;const{index:S}=ro(),{html:k,toc:L}=ph(m.body,{omitDuplicateTitle:m.frontmatter.title,resolveWikiLink:M=>fS(M)});e._currentEntry=m,e.innerHTML=`
|
|
276
|
-
<article class="document">
|
|
277
|
-
<header class="document-header">
|
|
278
|
-
${qI(m.frontmatter.title)}
|
|
279
|
-
<h1>${xt(m.frontmatter.title)}</h1>
|
|
280
|
-
${PI(m.frontmatter)}
|
|
281
|
-
</header>
|
|
282
|
-
<div class="markdown-body" id="codex-reader-body">
|
|
283
|
-
${k}
|
|
284
|
-
</div>
|
|
285
|
-
${KI(m.frontmatter.id,m.frontmatter.tags,S)}
|
|
286
|
-
${BI(m,S)}
|
|
287
|
-
</article>
|
|
288
|
-
`,n.tocContainer.innerHTML=uS(L);const R=e.querySelector("article");R&&L.length>0&&(s=hS(R,L,n.tocContainer))}catch(m){i||jp(e,n.tocContainer,m)}}}async function E(v){if(!i){Dp(e,n.tocContainer),C(),c=null,h=null,f="idle",_=null;try{if(v){const m=await xI(o.theaterId,v);if(i)return;c=m.meta,h=v;const{html:S,toc:k}=ph(m.wikiEntry.body,{omitDuplicateTitle:m.wikiEntry.title,resolveWikiLink:R=>fS(R)});e.innerHTML=XI(m,S),n.tocContainer.innerHTML=uS(k);const L=e.querySelector("article");L&&k.length>0&&(s=hS(L,k,n.tocContainer))}else{const m=await n2(o.theaterId,"pending");if(i)return;n.tocContainer.innerHTML="",e.innerHTML=VI(m.items,"Drydock — Pending Patches")}}catch(m){i||jp(e,n.tocContainer,m)}}}async function g(v){if(!i){Dp(e,n.tocContainer),C();try{if(v){const m=await kI(o.theaterId,v);if(i)return;n.tocContainer.innerHTML="",e.innerHTML=QI(m)}else{const m=await EI(o.theaterId);if(i)return;n.tocContainer.innerHTML="",e.innerHTML=eB(m)}}catch(m){i||jp(e,n.tocContainer,m)}}}return n.kind==="entry"&&n.initialEntryId?T(n.initialEntryId):n.kind==="drydock"?E(n.subId):n.kind==="conflicts"&&g(n.subId),{destroy(){i=!0,e.removeEventListener("click",d),C()},async setEntry(v){await T(v)},async navigateSub(v){n.kind==="drydock"?await E(v):n.kind==="conflicts"&&await g(v)},refreshCallbacks(v){o={...o,...v}}}}function Dp(e,n){e.innerHTML='<div class="codex-reader-loading" aria-live="polite" aria-busy="true">Loading…</div>',n.innerHTML=""}function jp(e,n,i){const s=i instanceof Error?i.message:String(i);e.innerHTML=`<div class="codex-reader-error" role="alert">${xt(s)}</div>`,n.innerHTML=""}function qI(e){return`
|
|
289
|
-
<nav class="breadcrumb" aria-label="Entry location">
|
|
290
|
-
<ol>
|
|
291
|
-
<li><span>Codex</span></li>
|
|
292
|
-
<li><span aria-current="page">${xt(e)}</span></li>
|
|
293
|
-
</ol>
|
|
294
|
-
</nav>
|
|
295
|
-
`}function KI(e,n,i){const s=new Set(n),o=i.filter(f=>f.id!==e).map(f=>({entry:f,matchingTags:f.tags.filter(_=>s.has(_))})).filter(f=>f.matchingTags.length>0).sort((f,_)=>_.matchingTags.length-f.matchingTags.length||f.entry.title.localeCompare(_.entry.title,"en-US",{sensitivity:"base",numeric:!0})).slice(0,5);return o.length===0?"":`
|
|
296
|
-
<section class="related-list">
|
|
297
|
-
<h2>Related entries</h2>
|
|
298
|
-
<div class="related-items">
|
|
299
|
-
${o.map(f=>`<button class="related-card" type="button" data-entry-id="${_o(f.entry.id)}">
|
|
300
|
-
<strong>${xt(f.entry.title)}</strong>
|
|
301
|
-
<span>${l2(f.matchingTags)}</span>
|
|
302
|
-
</button>`).join("")}
|
|
303
|
-
</div>
|
|
304
|
-
</section>
|
|
305
|
-
`}function VI(e,n){return e.length===0?'<div class="codex-reader-empty"><p class="queue-empty">No pending patches.</p></div>':`
|
|
306
|
-
<article class="document">
|
|
307
|
-
<header class="document-header">
|
|
308
|
-
<nav class="breadcrumb" aria-label="Entry location">
|
|
309
|
-
<ol>
|
|
310
|
-
<li><span>Codex</span></li>
|
|
311
|
-
<li><span aria-current="page">Drydock</span></li>
|
|
312
|
-
</ol>
|
|
313
|
-
</nav>
|
|
314
|
-
<h1>${xt(n)}</h1>
|
|
315
|
-
</header>
|
|
316
|
-
<div class="queue-row-list">
|
|
317
|
-
${e.map(YI).join("")}
|
|
318
|
-
</div>
|
|
319
|
-
</article>
|
|
320
|
-
`}function YI(e){const n=e.op??"create_wiki",i=c2[n]??"?",s=u2[n]??"Patch",o=e.target??e.id,_=[tB(e.meta.createdAt)].filter(Boolean);return`
|
|
321
|
-
<button class="queue-row" type="button" data-patch-id="${_o(e.id)}" aria-label="${_o(s+": "+o)}">
|
|
322
|
-
<span class="queue-row-badge" aria-hidden="true">
|
|
323
|
-
<span class="op-badge">${i}</span>
|
|
324
|
-
</span>
|
|
325
|
-
<span class="queue-row-body">
|
|
326
|
-
<span class="queue-row-target">${xt(o)}</span>
|
|
327
|
-
${e.summary?`<span class="queue-row-summary">${xt(e.summary)}</span>`:""}
|
|
328
|
-
${_.length>0?`<span class="queue-row-meta">${_.map(xt).join(" · ")}</span>`:""}
|
|
329
|
-
</span>
|
|
330
|
-
</button>
|
|
331
|
-
`}function XI(e,n){const{patch:i,meta:s,wikiEntry:o,targetExists:f}=e,_=i.frontmatter.op,c=c2[_]??"?",h=u2[_]??"Patch",d=f?"기존 문서 대체":"신규 문서 생성",y=s.status==="pending";return`
|
|
332
|
-
<article class="document">
|
|
333
|
-
<header class="document-header">
|
|
334
|
-
<nav class="breadcrumb" aria-label="Entry location">
|
|
335
|
-
<ol>
|
|
336
|
-
<li><span>Codex</span></li>
|
|
337
|
-
<li><span>Drydock</span></li>
|
|
338
|
-
<li><span aria-current="page">${xt(h)}</span></li>
|
|
339
|
-
</ol>
|
|
340
|
-
</nav>
|
|
341
|
-
<button type="button" class="queue-back-btn" data-drydock-action="back">‹ Queue</button>
|
|
342
|
-
<h1><span class="op-badge">${c}</span> ${xt(o.title)}</h1>
|
|
343
|
-
<p class="eyebrow">${xt(i.frontmatter.target)} · v${o.version} · ${xt(d)}</p>
|
|
344
|
-
${ZI(i.frontmatter.proposer,o.tags)}
|
|
345
|
-
</header>
|
|
346
|
-
<div class="markdown-body" id="codex-reader-body">
|
|
347
|
-
${n}
|
|
348
|
-
</div>
|
|
349
|
-
<div class="queue-decision-section" data-decision-bar-wrap>
|
|
350
|
-
${y?h2("idle",null):JI(s)}
|
|
351
|
-
</div>
|
|
352
|
-
</article>
|
|
353
|
-
`}function ZI(e,n){const i=[];return e&&i.push(`<span class="meta-chip">${xt(e)}</span>`),n.length>0&&i.push(l2(n)),i.length===0?"":`<div class="meta-chips">${i.join("")}</div>`}function h2(e,n){return e==="submitting"?'<span class="queue-action-spinner" role="status" aria-label="Processing…"></span>':e==="approving"?`
|
|
354
|
-
<p class="queue-decision-confirm">Apply this patch to the wiki?</p>
|
|
355
|
-
<div class="queue-action-buttons">
|
|
356
|
-
<button type="button" class="queue-action-btn queue-action-btn--approve" data-drydock-action="approve-confirm">✓ Yes, Approve</button>
|
|
357
|
-
<button type="button" class="queue-action-btn queue-action-btn--cancel" data-drydock-action="cancel">Cancel</button>
|
|
358
|
-
</div>
|
|
359
|
-
${n?`<p class="queue-action-error">${xt(n)}</p>`:""}
|
|
360
|
-
`:e==="rejecting"?`
|
|
361
|
-
<div class="queue-reject-form">
|
|
362
|
-
<textarea class="queue-reject-textarea" id="queue-reject-reason" placeholder="Rejection reason (required)…" rows="3"></textarea>
|
|
363
|
-
<div class="queue-action-buttons">
|
|
364
|
-
<button type="button" class="queue-action-btn queue-action-btn--reject-submit" data-drydock-action="reject-submit">Submit Rejection</button>
|
|
365
|
-
<button type="button" class="queue-action-btn queue-action-btn--cancel" data-drydock-action="cancel">Cancel</button>
|
|
366
|
-
</div>
|
|
367
|
-
${n?`<p class="queue-action-error">${xt(n)}</p>`:""}
|
|
368
|
-
</div>
|
|
369
|
-
`:`
|
|
370
|
-
<div class="queue-action-buttons">
|
|
371
|
-
<button type="button" class="queue-action-btn queue-action-btn--approve" data-drydock-action="approve">✓ Approve</button>
|
|
372
|
-
<button type="button" class="queue-action-btn queue-action-btn--reject" data-drydock-action="reject">✕ Reject</button>
|
|
373
|
-
</div>
|
|
374
|
-
`}function JI(e){const n=e.status==="accepted",i=n?"✓ Approved":"✕ Rejected",s=n?"queue-decision-decided--approve":"queue-decision-decided--reject",o=e.reason?` · ${xt(e.reason)}`:"";return`<p class="queue-decision-decided ${s}">${i}${o}</p>`}function QI(e){return`
|
|
375
|
-
<article class="document">
|
|
376
|
-
<header class="document-header">
|
|
377
|
-
<nav class="breadcrumb" aria-label="Entry location">
|
|
378
|
-
<ol><li><span>Codex</span></li><li><span>Conflicts</span></li></ol>
|
|
379
|
-
</nav>
|
|
380
|
-
<h1>${xt(e.id)}</h1>
|
|
381
|
-
<p class="eyebrow">Conflict · ${xt(e.meta?.status??"open")}</p>
|
|
382
|
-
</header>
|
|
383
|
-
<div class="markdown-body">
|
|
384
|
-
${e.current?`<h2>Current</h2><pre><code>${xt(e.current)}</code></pre>`:""}
|
|
385
|
-
${e.proposed?`<h2>Proposed</h2><pre><code>${xt(e.proposed)}</code></pre>`:""}
|
|
386
|
-
</div>
|
|
387
|
-
</article>
|
|
388
|
-
`}function eB(e){return e.length===0?'<div class="codex-reader-empty"><p>No conflicts found.</p></div>':`
|
|
389
|
-
<article class="document">
|
|
390
|
-
<header class="document-header">
|
|
391
|
-
<h1>Conflicts</h1>
|
|
392
|
-
</header>
|
|
393
|
-
<div class="markdown-body">
|
|
394
|
-
<ul class="queue-list">
|
|
395
|
-
${e.map(n=>`<li class="queue-item">
|
|
396
|
-
<strong>${xt(n.title||n.id)}</strong>
|
|
397
|
-
<span class="eyebrow">${xt(n.status)}</span>
|
|
398
|
-
</li>`).join("")}
|
|
399
|
-
</ul>
|
|
400
|
-
</div>
|
|
401
|
-
</article>
|
|
402
|
-
`}function tB(e){try{const i=(Date.now()-new Date(e).getTime())/(1e3*60*60);if(i<1)return"< 1h ago";if(i<24)return`${Math.floor(i)}h ago`;const s=i/24;return s<7?`${Math.floor(s)}d ago`:s<30?`${Math.floor(s/7)}w ago`:`${Math.floor(s/30)}mo ago`}catch{return""}}let Js=null,tc=null,d2=null,Cs=null,Qs=null,ws=null,Zu=null,Ip=null,Ju,Wg=0;function pS(e){d2=e}function nB(e,n){const i=sB();i.parentElement!==e&&e.appendChild(i),tc||(tc=jI(i,{initialTheaterId:n,onRequest:s=>d2?.(s)}))}function iB(e){tc?.setTheater(e)}function f2(e,n,i){const s=aB(),o=oB(),f=s.parentElement,_=i.kind==="entry"&&Zu==="entry"&&i.initialEntryId===Ip;f&&f!==e&&(Wg=f.scrollTop),s.parentElement!==e&&e.appendChild(s),o.parentElement!==n&&n.appendChild(o),!ws||Zu!==i.kind?(ws?.destroy(),ws=GI(s,{...i,tocContainer:o}),Zu=i.kind,Ju=i.subId):i.kind==="entry"&&i.initialEntryId&&i.initialEntryId!==Ip?ws.setEntry(i.initialEntryId):(i.kind==="drydock"||i.kind==="conflicts")&&i.subId!==Ju&&(Ju=i.subId,ws.navigateSub(i.subId)),Ip=i.kind==="entry"?i.initialEntryId??null:null,ws.refreshCallbacks({onPatchOpen:i.onPatchOpen,onDecided:i.onDecided,onRelatedClick:i.onRelatedClick,onClose:i.onClose,theaterId:i.theaterId});const c=_?Wg:0;requestAnimationFrame(()=>{e.scrollTop=c})}function rB(){const e=Cs?.parentElement;e&&(Wg=e.scrollTop)}function p2(){ws?.destroy(),ws=null,Zu=null,Ju=void 0,Cs?.parentElement&&Cs.parentElement.removeChild(Cs),Qs?.parentElement&&Qs.parentElement.removeChild(Qs)}function gS(){p2(),tc?.destroy(),tc=null,Js?.parentElement&&Js.parentElement.removeChild(Js)}function sB(){return Js||(Js=document.createElement("div"),Js.className="codex-host"),Js}function aB(){return Cs||(Cs=document.createElement("div"),Cs.className="codex-reader-host"),Cs}function oB(){return Qs||(Qs=document.createElement("div"),Qs.className="codex-toc-host"),Qs}const lB={id:"codex",title:"Codex",icon:()=>u.jsx(hB,{}),render:()=>u.jsx(cB,{})};function cB(){const e=Ur(),n=N.useRef(null),i=N.useRef(null),s=N.useRef(null),o=e.codexReader,f=o!==null,_=e.codexReaderExpanded,c=e.theaters.find(w=>w.id===e.activeTheaterId)??null,h=c?.id??null,d=!!c?.hasWiki,y=e.theaters.length>0,p=o?`${o.kind}:${o.kind==="entry"?o.entryId:o.kind==="drydock"?o.patchId??"":o.id??""}`:null;return N.useEffect(()=>{if(!d){gS();return}return()=>{gS()}},[d]),N.useEffect(()=>{if(!d||!h)return;const w=n.current;if(w)return nB(w,h),pS(C=>{C.kind==="entry"?Br({kind:"entry",entryId:C.id}):C.kind==="drydock"?Br({kind:"drydock",patchId:C.patchId}):C.kind==="conflicts"&&Br({kind:"conflicts",id:C.id})}),()=>{pS(null)}},[d,h,f]),N.useEffect(()=>{d&&h&&iB(h)},[h,d]),N.useEffect(()=>{if(!d||!h||!f||_||!i.current||!s.current||!o)return;const w=o.kind,C=w==="drydock"?o.patchId:w==="conflicts"?o.id:void 0;f2(i.current,s.current,{initialEntryId:w==="entry"?o.entryId:"",kind:w,subId:C,theaterId:h,onRelatedClick:T=>Br({kind:"entry",entryId:T}),onClose:()=>Qb(),onPatchOpen:T=>Br({kind:"drydock",patchId:T}),onDecided:()=>{_h(),Br({kind:"drydock",patchId:void 0})}})},[d,h,f,_,p]),N.useEffect(()=>{f||p2()},[f]),d?f?u.jsxs("div",{className:"codex-rail-host is-split",children:[u.jsxs("div",{className:"codex-doc-pane",children:[u.jsxs("div",{className:"codex-doc-pane-head",children:[u.jsx("button",{className:"codex-doc-expand",type:"button","aria-label":"Expand reading sheet","data-codex-expand":"true",onClick:$u,children:"⤢ Expand"}),u.jsx("button",{className:"codex-reading-sheet-close",type:"button","aria-label":"Close document pane",onClick:Qb,children:"✕"})]}),u.jsx("div",{ref:i,className:"codex-doc-scroll"}),u.jsx("div",{ref:s,className:"codex-doc-toc-inline"})]}),u.jsx("div",{ref:n,className:"codex-nav-pane"})]}):u.jsx("div",{ref:n,className:"codex-rail-host"}):u.jsx(uB,{activeTheater:c,hasTheaters:y})}function uB({activeTheater:e,hasTheaters:n}){return n?u.jsxs("section",{className:"codex-empty-state",children:[u.jsx("p",{className:"codex-empty-eyebrow",children:"Codex unavailable"}),u.jsx("h1",{children:e?.label??"This Theater"}),u.jsx("p",{children:"This Theater does not have Fleet Wiki data mounted."})]}):u.jsxs("section",{className:"codex-empty-state",children:[u.jsx("p",{className:"codex-empty-eyebrow",children:"Codex"}),u.jsx("h1",{children:"Add a Theater"}),u.jsx("p",{children:"Use the top bar Theater control to choose a project root before opening Codex."})]})}function hB(){return u.jsxs("svg",{viewBox:"0 0 24 24",width:"16",height:"16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[u.jsx("circle",{cx:"12",cy:"12",r:"9"}),u.jsx("circle",{cx:"12",cy:"12",r:"3.2",fill:"currentColor",stroke:"none",opacity:"0.16"}),u.jsx("path",{d:"M12 3v3.6M12 17.4V21M3 12h3.6M17.4 12H21"}),u.jsx("path",{d:"M12 8.6 14.2 12 12 15.4 9.8 12Z",fill:"currentColor",stroke:"none"})]})}const dB=[pI,lB];function fB(e="right"){const{railPanels:n}=ac();return e==="right"?n.filter(i=>(i.side??"right")==="right"):n}const pB=360;function gB(e){const{codexReader:n}=Ur();return e==="codex"&&n!==null?pB:0}const g2=240,mB=312,m2="fleet-console.rail.panelWidth";function _B(){try{const e=localStorage.getItem(m2);if(e!==null){const n=parseInt(e,10);if(!isNaN(n)&&n>=g2)return n}}catch{}return mB}function vB({theaterId:e,api:n}){const i=ZC(),s=fB(),o=dB,_=[...o,...s].find(v=>v.id===i)??null,c=_!==null,h=gB(i)+(_?.preferredExtraWidth??0),d=N.useRef(h);d.current=h;const[y,p]=N.useState(_B),w=N.useRef(y),[C,T]=N.useState(!1),E=N.useCallback(v=>{v.preventDefault();const m=v.clientX,S=w.current;T(!0);const k=R=>{const M=m-R.clientX,A=window.innerWidth-148-d.current,B=Math.max(g2,Math.min(A,S+M));w.current=B,p(B)},L=()=>{document.removeEventListener("pointermove",k),document.removeEventListener("pointerup",L),T(!1);try{localStorage.setItem(m2,String(w.current))}catch{}};document.addEventListener("pointermove",k),document.addEventListener("pointerup",L)},[]),g=N.useMemo(()=>({theaterId:e,api:n}),[e,n]);return u.jsxs("div",{className:`right-rail${c?" is-open":""}${C?" is-dragging":""}`,role:"complementary","aria-label":"Activity Rail",children:[u.jsxs("div",{className:"right-rail-panel-slot",style:c?{width:y+h}:void 0,children:[c&&u.jsx("div",{className:"right-rail-resize-handle",onPointerDown:E,"aria-hidden":"true"}),_&&u.jsx(bB,{activePanel:_,activeId:i,ctx:g})]}),u.jsxs("nav",{className:"right-rail-icons",role:"tablist","aria-label":"Activity tools",children:[o.map(v=>u.jsx(mS,{panel:v,isActive:i===v.id},v.id)),o.length>0&&s.length>0?u.jsx("div",{className:"right-rail-divider",role:"separator","aria-hidden":"true"}):null,s.map(v=>u.jsx(mS,{panel:v,isActive:i===v.id},v.id))]})]})}const bB=N.memo(function({activePanel:n,activeId:i,ctx:s}){return u.jsxs(u.Fragment,{children:[u.jsxs("div",{className:"right-rail-panel-head",children:[u.jsx("span",{className:"right-rail-panel-title",children:n.title}),u.jsx("button",{className:"right-rail-close-btn",type:"button","aria-label":`Close ${n.title}`,onClick:dI,children:"✕"})]}),u.jsx("div",{className:"right-rail-panel-body",role:"tabpanel","aria-labelledby":`rail-tab-${i}`,children:n.render(s)})]})});function mS({panel:e,isActive:n}){const i=N.useCallback(()=>hI(e.id),[e.id]),s=typeof e.icon=="function"?e.icon():e.icon;return u.jsx("button",{id:`rail-tab-${e.id}`,className:`right-rail-ico${n?" is-active":""}`,type:"button",role:"tab","aria-selected":n,"aria-label":e.title,title:e.title,onClick:i,children:s})}const _S=8,yB=260;function vS(e){const{anchor:n,onClose:i}=e,[s,o]=N.useState(void 0);return N.useLayoutEffect(()=>{const f=Math.max(8,Math.min(n.left,window.innerWidth-208)),_=n.bottom+_S,c=_+yB>window.innerHeight;o(c?{position:"fixed",left:f,top:"auto",bottom:Math.round(window.innerHeight-n.top+_S)}:{position:"fixed",left:f,top:Math.round(_)})},[n]),N.useEffect(()=>{const f=_=>{_.key==="Escape"&&(_.preventDefault(),i())};return window.addEventListener("keydown",f),window.addEventListener("resize",i),window.addEventListener("scroll",i,!0),()=>{window.removeEventListener("keydown",f),window.removeEventListener("resize",i),window.removeEventListener("scroll",i,!0)}},[i]),Es.createPortal(u.jsx("div",{className:"group-context-menu-overlay",role:"presentation",onPointerDown:i,children:s?u.jsx("div",{className:"group-context-menu-card",role:"menu","aria-label":e.kind==="chip"?"Operation options":`${e.group.name} options`,style:s,onPointerDown:f=>f.stopPropagation(),children:e.kind==="chip"?u.jsx(SB,{...e}):u.jsx(wB,{...e})}):null}),document.body)}function SB({operation:e,groups:n,accentKey:i,actions:s,onClose:o}){const[f,_]=N.useState(!1),[c,h]=N.useState(`Group ${n.length+1}`),d=N.useRef(!1),y=N.useRef(null);N.useEffect(()=>{f&&y.current?.select()},[f]);const p=()=>{const w=c.trim();w&&(s.onCreateGroup(w),o())};return u.jsxs(u.Fragment,{children:[u.jsx("div",{className:"group-context-menu-section-label",children:"Group"}),n.map(w=>{const C=Ql(w.color),T=e.groupId===w.id;return u.jsxs("button",{type:"button",className:`group-context-menu-item${T?" is-selected":""}`,role:"menuitemradio","aria-checked":T,onClick:()=>{s.onSetGroupId(T?null:w.id),o()},children:[u.jsx("span",{className:"group-context-menu-item__dot",style:C?{background:C}:void 0,"aria-hidden":"true"}),u.jsx("span",{className:"group-context-menu-item__name",children:w.name}),T?u.jsx(xB,{}):null]},w.id)}),f?u.jsx("input",{ref:y,className:"group-context-menu-new-input",type:"text",value:c,onChange:w=>h(w.target.value),onCompositionStart:()=>{d.current=!0},onCompositionEnd:()=>{d.current=!1},onKeyDown:w=>{w.key==="Enter"&&!d.current&&(w.preventDefault(),p()),w.key==="Escape"&&(w.preventDefault(),_(!1))},onBlur:()=>_(!1),"aria-label":"New group name",placeholder:"Group name"}):u.jsx("button",{type:"button",className:"group-context-menu-item group-context-menu-item--new",role:"menuitem",onClick:()=>_(!0),children:u.jsx("span",{className:"group-context-menu-item__new-label",children:"+ New group"})}),u.jsx("div",{className:"group-context-menu-divider","aria-hidden":"true"}),u.jsx("div",{className:"group-context-menu-section-label",children:"Accent"}),u.jsxs("button",{type:"button",className:"accent-popover-swatch accent-popover-swatch--clear",role:"menuitem","aria-label":"No accent","aria-pressed":i===null,onClick:()=>{s.onSetAccent(null),o()},children:[u.jsx("span",{}),"None"]}),u.jsx("div",{className:"group-context-menu-swatches",children:Oh.map(w=>u.jsx("button",{type:"button",className:"accent-popover-swatch",role:"menuitem","aria-label":w.label,"aria-pressed":i===w.key,onClick:()=>{s.onSetAccent(w.key),o()},children:u.jsx("span",{style:{background:w.color}})},w.key))})]})}function wB({group:e,actions:n,onClose:i}){const[s,o]=N.useState(e.name),[f,_]=N.useState(!1),c=N.useRef(!1),h=()=>{const d=s.trim();if(!d||d===e.name){i();return}n.onRename(d),i()};return u.jsxs(u.Fragment,{children:[u.jsx("div",{className:"group-context-menu-section-label",children:"Color"}),u.jsx("div",{className:"group-context-menu-swatches",children:Oh.map(d=>u.jsx("button",{type:"button",className:"accent-popover-swatch",role:"menuitem","aria-label":d.label,"aria-pressed":e.color===d.key,onClick:()=>{n.onSetColor(d.key),i()},children:u.jsx("span",{style:{background:d.color}})},d.key))}),u.jsx("div",{className:"group-context-menu-divider","aria-hidden":"true"}),u.jsx("div",{className:"group-context-menu-section-label",children:"Rename"}),u.jsx("input",{className:"group-context-menu-new-input",type:"text",value:s,onChange:d=>o(d.target.value),onCompositionStart:()=>{c.current=!0},onCompositionEnd:()=>{c.current=!1},onKeyDown:d=>{d.key==="Enter"&&!c.current&&(d.preventDefault(),h()),d.key==="Escape"&&(d.preventDefault(),i())},onBlur:h,"aria-label":"Group name"}),u.jsx("div",{className:"group-context-menu-divider","aria-hidden":"true"}),u.jsx("button",{type:"button",className:`group-context-menu-item group-context-menu-item--danger${f?" is-armed":""}`,role:"menuitem",onClick:()=>{if(!f){_(!0);return}n.onUngroupAll(),i()},"aria-label":f?"Confirm: remove all members and delete group":"Ungroup all members and delete group",children:f?"Confirm ungroup all?":"Ungroup all"})]})}function xB(){return u.jsx("svg",{viewBox:"0 0 12 12",className:"group-context-menu-item__check","aria-hidden":"true",children:u.jsx("path",{d:"M2 6l3 3 5-5",fill:"none",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round"})})}function CB(e,n,i,s){if(!i)return{groupId:null,index:0};for(const f of n){const _=f.groupId??"__ungrouped__",c=i.querySelector(`[data-drop-zone-group-id="${_}"]`);if(!c)continue;const h=c.getBoundingClientRect();if(e<h.top||e>h.bottom)continue;const d=c.querySelector(`[data-group-section-id="${_}"]`);if(!d||e<d.getBoundingClientRect().top)return{groupId:f.groupId,index:0};const y=Array.from(d.querySelectorAll("[data-side-bar-chip-id]"));for(const p of y){const w=p.dataset.sideBarChipId;if(!w||w===s)continue;const C=p.getBoundingClientRect();if(e<=C.top+C.height/2)return{groupId:f.groupId,index:Math.max(0,f.entryIds.indexOf(w))}}return{groupId:f.groupId,index:f.entryIds.length}}const o=n[n.length-1];return{groupId:o?.groupId??null,index:o?.entryIds.length??0}}function EB(e,n,i,s){const o=e.filter(y=>y!==n),f=new Set(s),_=o.filter(y=>f.has(y)),c=Math.max(0,Math.min(i,_.length));if(_.length===0)return[...o,n];if(c<_.length){const y=o.indexOf(_[c]),p=[...o];return p.splice(y,0,n),p}const h=o.indexOf(_[_.length-1]),d=[...o];return d.splice(h+1,0,n),d}function kB(e,n,i,s){const o=new Set(s),f=e.filter(p=>o.has(p)),_=f.indexOf(n),c=f.filter(p=>p!==n),h=i>_?i-1:i,d=Math.max(0,Math.min(h,c.length));c.splice(d,0,n);let y=0;return e.map(p=>o.has(p)?c[y++]??p:p)}function TB(e,n,i){if(i.length!==n.length)return[...e];const s=new Set(n);let o=0;return e.map(f=>s.has(f)?i[o++]??f:f)}function AB(e,n,i){if(e.indexOf(n)===-1)return[...e];const o=e.filter(_=>_!==n),f=Math.max(0,Math.min(i,o.length));return o.splice(f,0,n),o}function RB({entry:e,index:n,isCloseArmed:i,accentValue:s,dragging:o,dragOffsetY:f,dropTarget:_,onArmClose:c,onDisarmClose:h,onClose:d,onFocus:y,onKeyboardMove:p,onPointerDragStart:w,onOpenAccent:C,onRename:T}){const E=N.useRef(!1),{operation:g,active:v,minimized:m,notificationCount:S}=e,k=LB(g),L=VC({currentTitle:k,onCommit:I=>T(g.id,I),onBegin:h}),R=["side-bar-chip",v?"side-bar-chip--active":"",m?"side-bar-chip--minimized":"",o?"side-bar-chip--dragging":"",_?"side-bar-chip--drop-target":""].filter(Boolean).join(" "),M=["side-bar-chip-close",i?"is-armed":""].filter(Boolean).join(" "),A={"--i":n,...s?{"--chip-accent":s}:{},...o?{"--drag-dy":`${Math.round(f)}px`}:{}},B=()=>{if(h(),E.current){E.current=!1;return}y(g.id)},K=I=>{I.stopPropagation()},F=I=>{if(I.stopPropagation(),!i){c(g.id);return}h(),d(g.id)},W=I=>{I.preventDefault(),h(),C(g.id,I.currentTarget.getBoundingClientRect())};return u.jsxs("li",{"data-side-bar-chip-id":g.id,className:R,role:"button",tabIndex:0,"aria-label":v?`${k} (focused)`:`Focus operation ${k}`,"aria-current":v?"true":void 0,title:v?"Focused · double-click to rename · right-click to set accent":"Click to focus · double-click to rename · right-click to set accent",style:A,onClick:B,onContextMenu:W,onFocus:()=>{i||h()},onPointerDown:I=>w(I,g.id),onPointerUp:()=>{o&&(E.current=!0)},onKeyDown:I=>{if(I.target===I.currentTarget){if(I.altKey&&I.shiftKey&&(I.key==="ArrowUp"||I.key==="ArrowDown")){I.preventDefault(),p(g.id,I.key==="ArrowUp"?-1:1);return}(I.key==="Enter"||I.key===" ")&&(I.preventDefault(),B())}},children:[u.jsx("span",{className:"side-bar-chip-beacon-button","aria-hidden":"true",children:u.jsx("span",{className:"side-bar-chip-op-icon",children:e.icon??u.jsx(NB,{})})}),L.renaming?u.jsx("input",{className:"side-bar-chip-rename-input",ref:L.inputRef,value:L.draftTitle,"aria-label":`Rename operation ${k}`,onChange:I=>L.setDraftTitle(I.target.value),onKeyDown:L.handleKeyDown,onBlur:L.handleBlur,onPointerDown:I=>I.stopPropagation(),onClick:I=>I.stopPropagation()}):u.jsx("span",{className:"side-bar-chip-name",onDoubleClick:L.begin,children:k}),S>0?u.jsx("span",{className:"side-bar-chip-count",children:S}):null,u.jsx("button",{type:"button",className:M,onPointerDown:K,onClick:F,"aria-label":i?`Confirm close operation ${k}`:`Close operation ${k}`,title:i?"Confirm close":"Close operation",children:i?"Close?":u.jsx(MB,{})})]})}function LB(e){return e.title}function MB(){return u.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:u.jsx("path",{d:"M4.6 4.6 11.4 11.4M11.4 4.6 4.6 11.4",fill:"none",stroke:"currentColor",strokeWidth:"1.35",strokeLinecap:"round"})})}function NB(){return u.jsx("svg",{viewBox:"0 0 14 14","aria-hidden":"true",children:u.jsx("rect",{x:"2",y:"2",width:"10",height:"10",rx:"2.5",fill:"none",stroke:"currentColor",strokeWidth:"1.3"})})}function OB({group:e,count:n,collapsed:i,tier:s,onToggle:o,onContextMenu:f}){const _=Ql(e.color),c=_?{"--grp-color":_}:void 0,h=d=>{d.preventDefault(),f(e.id,d.currentTarget.getBoundingClientRect())};return s==="rail"?u.jsx("div",{className:"side-bar-group-header side-bar-group-header--rail","data-tier":"rail",style:c,onClick:()=>o(e.id),onContextMenu:h,role:"button",tabIndex:0,"aria-label":`Group ${e.name}`,onKeyDown:d=>{(d.key==="Enter"||d.key===" ")&&(d.preventDefault(),o(e.id))},children:u.jsx("span",{className:"side-bar-group-header__dot","aria-hidden":"true"})}):u.jsxs("div",{className:"side-bar-group-header",style:c,onContextMenu:h,role:"group","aria-label":e.name,children:[u.jsx("button",{type:"button",className:"side-bar-group-header__toggle",onClick:()=>o(e.id),"aria-expanded":!i,"aria-label":i?`Expand group ${e.name}`:`Collapse group ${e.name}`,title:i?"Expand":"Collapse",children:u.jsx(DB,{collapsed:i})}),u.jsx("span",{className:"side-bar-group-header__name",children:e.name}),u.jsx("span",{className:"side-bar-group-header__count","aria-label":`${n} operations`,children:n})]})}function DB({collapsed:e}){return u.jsx("svg",{viewBox:"0 0 12 12","aria-hidden":"true",className:`side-bar-group-header__arrow${e?" is-collapsed":""}`,children:u.jsx("path",{d:"M3 5l3 3 3-3",fill:"none",stroke:"currentColor",strokeWidth:"1.3",strokeLinecap:"round",strokeLinejoin:"round"})})}const _2="fleet-console.operations.side-width",v2="fleet-console.operations.side-collapsed",vh=56,jB=180,bS=jB;function IB(){return typeof window<"u"?window.innerWidth-480:800}function BB(){try{if(typeof window>"u")return bS;const e=localStorage.getItem(_2);if(e!==null){const n=parseInt(e,10);if(!isNaN(n)&&n>=vh)return n}}catch{}return bS}function PB(){try{return typeof window>"u"?!1:localStorage.getItem(v2)==="1"}catch{}return!1}let nc={width:BB(),collapsed:PB()};const Gg=new Set;function b2(){for(const e of Gg)e()}function yS(){return nc}function zB(e){return Gg.add(e),()=>{Gg.delete(e)}}function HB(){return N.useSyncExternalStore(zB,yS,yS)}function SS(e){const n=Math.max(vh,Math.min(IB(),e));nc={...nc,width:n};try{typeof window<"u"&&localStorage.setItem(_2,String(n))}catch{}b2()}function $B(e){nc={...nc,collapsed:e};try{typeof window<"u"&&localStorage.setItem(v2,e?"1":"0")}catch{}b2()}function UB(e){return e<120?"rail":e<240?"list":"detail"}const FB=1500,WB=6,wS=34,xS=18;function GB({operations:e,groups:n,minimized:i,activeOperationId:s,operationNotifications:o,catalog:f,canLaunch:_,mapFullscreen:c,radarEnabled:h,perimeterEnabled:d,renderKindIcon:y,onLaunchKind:p,onResetView:w,onMaximizeMap:C,onToggleRadar:T,onTogglePerimeter:E,onClose:g,onFocus:v,onSetAccent:m,onRename:S,onSetGroupId:k,onCreateGroup:L,onSetGroupColor:R,onRenameGroup:M,onUngroupAll:A}){const B=N.useRef(null),K=HB(),{width:F,collapsed:W}=K,I=W?"rail":UB(F),Z=ew(),X=N.useRef(null),[z,q]=N.useState(null),[V,j]=N.useState(null),P=N.useRef(null),D=N.useRef([]),U=N.useRef([]),G=N.useRef([]),Y=N.useRef(k),[ie,se]=N.useState(null),[J,H]=N.useState(null),[ae,de]=N.useState(null),we=VT(),ye=new Set(i),Le=new Set(we),Oe=Mw(e,Z.operationOrder).map(ve=>{const $e=f.find(at=>at.id===ve.pluginId)?.kinds.find(at=>at.type===ve.type)??null,Ze=$e?y(ve.pluginId,$e):null;return{operation:ve,active:s===ve.id,minimized:ye.has(ve.id),notificationCount:o[ve.id]?.count??0,icon:Ze}}),Fe=qB(Oe,n,Z.operationOrder),ut=Fe.flatMap(ve=>Le.has(ve.groupId??"")?[]:ve.entries),Me=Oe.map(ve=>ve.operation.id),Rt=N.useCallback(()=>{X.current!==null&&(window.clearTimeout(X.current),X.current=null)},[]),Xt=N.useCallback(()=>{Rt(),q(null)},[Rt]),vn=N.useCallback(ve=>{Rt(),q(ve),X.current=window.setTimeout(()=>{X.current=null,q(null)},FB)},[Rt]);N.useEffect(()=>Rt,[Rt]),N.useEffect(()=>{z!==null&&(Oe.some(ve=>ve.operation.id===z)||Xt())},[z,Oe,Xt]);const an=ie?.kind==="chip"?Oe.find(ve=>ve.operation.id===ie.operationId)?.operation??null:null,kn=ie?.kind==="group"?n.find(ve=>ve.id===ie.groupId)??null:null,Zt=(ve,$e)=>{const Ze=ut.findIndex(Dt=>Dt.operation.id===ve);if(Ze===-1)return;const at=Math.max(0,Math.min(ut.length-1,Ze+$e));if(at===Ze)return;const Ve=ut.map(Dt=>Dt.operation.id),on=AB(Ve,ve,at);Kf(TB(Me,Ve,on))},ht=Fe.map(ve=>({groupId:ve.groupId,entryIds:ve.entries.map($e=>$e.operation.id)}));N.useEffect(()=>{D.current=Oe,U.current=Me,G.current=ht,Y.current=k});const Lt=ve=>{P.current=ve,j(ve)},Ct=V?.pointerId??null;N.useEffect(()=>{if(Ct===null)return;const ve=at=>{if(at.pointerId!==Ct)return;const Ve=P.current;if(!Ve)return;if(at.buttons===0){Lt(null);return}const on=Math.hypot(at.clientX-Ve.startX,at.clientY-Ve.startY);if(!Ve.dragging&&on<WB)return;Ve.dragging&&at.preventDefault();const Dt=CB(at.clientY,G.current,B.current,Ve.sourceId);KB(at.clientY,B.current),Lt({...Ve,currentY:at.clientY,dragging:!0,dropIndex:Dt.index,dropGroupId:Dt.groupId})},$e=at=>{if(at.pointerId!==Ct)return;const Ve=P.current;if(Lt(null),!Ve?.dragging)return;const{sourceId:on,sourceGroupId:Dt,dropIndex:An,dropGroupId:Un}=Ve,jt=G.current,ee=U.current;if(Un!==Dt){const ke=jt.find(Ce=>Ce.groupId===Un)?.entryIds??[];Kf(EB(ee,on,An,ke)),Y.current(on,Un);return}const Se=jt.find(dt=>dt.groupId===Dt)?.entryIds??[],je=Se.indexOf(on);if(je===-1||An===je)return;const bt=kB(ee,on,An,Se);Kf(bt)},Ze=at=>{at.pointerId===Ct&&Lt(null)};return window.addEventListener("pointermove",ve),window.addEventListener("pointerup",$e),window.addEventListener("pointercancel",Ze),()=>{window.removeEventListener("pointermove",ve),window.removeEventListener("pointerup",$e),window.removeEventListener("pointercancel",Ze)}},[Ct]);const Ft=(ve,$e)=>{if(ve.button!==0||ve.target instanceof Element&&ve.target.closest("button"))return;se(null),Xt();const at=Oe.find(Ve=>Ve.operation.id===$e)?.operation.groupId??null;Lt({sourceId:$e,sourceGroupId:at,pointerId:ve.pointerId,startX:ve.clientX,startY:ve.clientY,currentY:ve.clientY,dragging:!1,dropIndex:Me.indexOf($e),dropGroupId:at})},Kt=N.useCallback(ve=>{ve.preventDefault();const $e=ve.clientX,Ze=K.width,at=on=>{const Dt=on.clientX-$e;SS(Ze+Dt)},Ve=()=>{document.removeEventListener("pointermove",at),document.removeEventListener("pointerup",Ve)};document.addEventListener("pointermove",at),document.addEventListener("pointerup",Ve)},[K.width]),Jn=()=>{$B(!W),W||SS(vh)},bn=ve=>{if(J){H(null);return}de(null);const $e=ve.currentTarget.getBoundingClientRect();H({anchor:{x:$e.right+8,y:$e.top},viewportBounds:{width:window.innerWidth,height:window.innerHeight}})},Pn=ve=>{ve.defaultPrevented||(ve.preventDefault(),de(null),se(null),H({anchor:{x:ve.clientX,y:ve.clientY},viewportBounds:{width:window.innerWidth,height:window.innerHeight}}))},ft=ve=>{if(ae){de(null);return}H(null);const $e=ve.currentTarget.getBoundingClientRect();de({anchor:{x:$e.right+8,y:$e.top},viewportBounds:{width:window.innerWidth,height:window.innerHeight}})},Tn=W?vh:F;return Oe.length===0&&I==="rail"?u.jsxs("aside",{className:"operations-side-bar","data-tier":I,"data-canvas-blocker":!0,style:{"--side-bar-width":`${Tn}px`},onContextMenu:Pn,children:[u.jsx("header",{className:"operations-side-bar-header",children:u.jsx("button",{type:"button",className:"side-bar-new-btn",onClick:bn,"aria-label":"New Operation",title:"New Operation",children:u.jsx(CS,{})})}),u.jsx("div",{className:"operations-side-bar-resize-handle",onPointerDown:Kt,onDoubleClick:Jn,"aria-hidden":"true"}),J?Es.createPortal(u.jsx(Vu,{anchor:J.anchor,viewportBounds:J.viewportBounds,placement:"cursor",mode:"launch",catalog:f,canLaunch:_,renderKindIcon:y,onLaunchKind:(ve,$e)=>{H(null),p(ve,$e)},onResetView:w,onClose:()=>H(null)},`${J.anchor.x}:${J.anchor.y}`),document.body):null]}):u.jsxs("aside",{className:"operations-side-bar","data-tier":I,"data-canvas-blocker":!0,style:{"--side-bar-width":`${Tn}px`},onContextMenu:Pn,children:[u.jsxs("header",{className:"operations-side-bar-header",children:[u.jsxs("button",{type:"button",className:"side-bar-new-btn",onClick:bn,"aria-label":"New Operation","aria-expanded":J!==null,title:"New Operation",children:[u.jsx(CS,{}),I!=="rail"?u.jsx("span",{children:"Operation"}):null]}),I!=="rail"?u.jsx("button",{type:"button",className:"side-bar-settings-btn",onClick:ft,"aria-expanded":ae!==null,"aria-label":"Map and display controls",title:"Map and display controls",children:u.jsx(VB,{})}):null]}),u.jsx("ol",{className:"operations-side-bar-chips",ref:B,"aria-label":"Operations",children:Fe.map(ve=>{const $e=ve.groupId!==null&&Le.has(ve.groupId),Ze=ve.group?Ql(ve.group.color):null,at=Ze?{"--grp-color":Ze}:void 0;return u.jsxs("li",{"data-drop-zone-group-id":ve.groupId??"__ungrouped__",className:ve.groupId?"side-bar-group-section":"side-bar-ungrouped-section",style:at,children:[ve.group?u.jsx(OB,{group:ve.group,count:ve.entries.length,collapsed:$e,tier:I,onToggle:KT,onContextMenu:(Ve,on)=>se({kind:"group",groupId:Ve,anchor:on})}):ve.entries.length>0?u.jsx("div",{className:"side-bar-ungrouped-label","aria-label":"Ungrouped operations",children:I!=="rail"?u.jsx("span",{children:"Ungrouped"}):null}):null,$e?null:u.jsx("ol",{className:["side-bar-group-chips",V?.dragging&&V.dropGroupId===ve.groupId&&V.dropGroupId!==V.sourceGroupId?"side-bar-section--drop-target":""].filter(Boolean).join(" "),"data-group-section-id":ve.groupId??"__ungrouped__","aria-label":ve.group?ve.group.name:"Ungrouped",children:ve.entries.map(Ve=>{const on=Oe.indexOf(Ve),Dt=ve.entries.indexOf(Ve),An=Z.operationAccent[Ve.operation.id]??rS(Ve.operation),Un=An?Ql(An):null;return u.jsx(RB,{entry:Ve,index:on,isCloseArmed:z===Ve.operation.id,accentValue:Un,dragging:V?.sourceId===Ve.operation.id&&V.dragging,dragOffsetY:V?.sourceId===Ve.operation.id&&V.dragging?V.currentY-V.startY:0,dropTarget:V?.dragging===!0&&V.dropGroupId===ve.groupId&&V.dropGroupId===V.sourceGroupId&&V.dropIndex===Dt&&V.sourceId!==Ve.operation.id,onArmClose:vn,onDisarmClose:Xt,onClose:g,onFocus:v,onKeyboardMove:Zt,onPointerDragStart:Ft,onOpenAccent:(jt,ee)=>se({kind:"chip",operationId:jt,anchor:ee}),onRename:S},Ve.operation.id)})})]},ve.groupId??"__ungrouped__")})}),u.jsx("div",{className:"operations-side-bar-resize-handle",onPointerDown:Kt,onDoubleClick:Jn,"aria-hidden":"true"}),J?Es.createPortal(u.jsx(Vu,{anchor:J.anchor,viewportBounds:J.viewportBounds,placement:"cursor",mode:"launch",catalog:f,canLaunch:_,renderKindIcon:y,onLaunchKind:(ve,$e)=>{H(null),p(ve,$e)},onResetView:w,onClose:()=>H(null)},`${J.anchor.x}:${J.anchor.y}`),document.body):null,ae?Es.createPortal(u.jsx(Vu,{anchor:ae.anchor,viewportBounds:ae.viewportBounds,placement:"cursor",mode:"controls",catalog:f,canLaunch:_,mapFullscreen:c,radarEnabled:h,perimeterEnabled:d,renderKindIcon:y,onLaunchKind:p,onResetView:()=>{de(null),w()},onMaximizeMap:C,onToggleRadar:T,onTogglePerimeter:E,onClose:()=>de(null)},`settings:${ae.anchor.x}:${ae.anchor.y}`),document.body):null,ie?.kind==="chip"&&an?u.jsx(vS,{kind:"chip",operation:an,groups:n,accentKey:Z.operationAccent[an.id]??rS(an),anchor:ie.anchor,actions:{onSetAccent:ve=>m(an.id,ve),onSetGroupId:ve=>k(an.id,ve),onCreateGroup:ve=>L(an.theaterId,ve,an.id)},onClose:()=>se(null)}):ie?.kind==="group"&&kn?u.jsx(vS,{kind:"group-header",group:kn,anchor:ie.anchor,actions:{onSetColor:ve=>R(kn.id,ve),onRename:ve=>M(kn.id,ve),onUngroupAll:()=>A(kn.id)},onClose:()=>se(null)}):null]})}function qB(e,n,i){const s=[...n].sort((c,h)=>c.order-h.order||c.createdAt-h.createdAt),o=s.map(c=>({groupId:c.id,group:c,entries:[]})),f={groupId:null,group:null,entries:[]},_=new Map(s.map(c=>[c.id,c]));for(const c of e){const h=c.operation.groupId??null;h!==null&&_.has(h)?o.find(y=>y.groupId===h)?.entries.push(c):f.entries.push(c)}return[...o,f]}function KB(e,n){if(!n)return;const i=n.getBoundingClientRect();e<i.top+wS?n.scrollTop-=xS:e>i.bottom-wS&&(n.scrollTop+=xS)}function CS(){return u.jsxs("svg",{viewBox:"0 0 24 24","aria-hidden":"true",children:[u.jsx("circle",{cx:"12",cy:"12",r:"7",fill:"none",stroke:"currentColor",strokeWidth:"1.4"}),u.jsx("path",{d:"M12 2.4v3.4M12 18.2v3.4M2.4 12h3.4M18.2 12h3.4",fill:"none",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round"}),u.jsx("path",{d:"M12 9.2v5.6M9.2 12h5.6",fill:"none",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round"})]})}function VB(){return u.jsxs("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:[u.jsx("circle",{cx:"8",cy:"8",r:"2.2",fill:"none",stroke:"currentColor",strokeWidth:"1.25"}),u.jsx("path",{d:"M8 1.4v1.4M8 13.2v1.4M1.4 8h1.4M13.2 8h1.4M3.3 3.3l1 1M11.7 11.7l1 1M11.7 3.3l-1 1M3.3 11.7l-1 1",fill:"none",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round"})]})}const YB='a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])';function XB(){const{codexReader:e,codexReaderExpanded:n,activeTheaterId:i}=Ur(),s=N.useRef(null),o=N.useRef(null),f=N.useRef(null),_=e?`${e.kind}:${e.kind==="entry"?e.entryId:e.kind==="drydock"?e.patchId??"":e.id??""}`:null,c=e!==null&&n,h=N.useCallback(()=>{rB(),gR()},[]);return N.useEffect(()=>{if(!c)return;const d=e;document.body.setAttribute("data-codex-reading","true");const y=document.querySelector(".operations-canvas"),p=document.querySelector(".operations-side-bar");y?.setAttribute("inert",""),p?.setAttribute("inert","");const w=C=>{if(C.key==="Escape"){C.preventDefault(),C.stopPropagation(),h();return}C.key==="Tab"&&ZB(s.current,C)};return window.addEventListener("keydown",w,!0),()=>{window.removeEventListener("keydown",w,!0),document.body.removeAttribute("data-codex-reading"),y?.removeAttribute("inert"),p?.removeAttribute("inert");const C=d?.kind==="entry"?d.entryId:null;(document.querySelector('[data-codex-expand="true"]')??(C?document.querySelector(`.codex-nav-entry.is-current[data-entry-id="${C}"]`):null)??document.querySelector(".codex-navigator .codex-nav-search-input"))?.focus()}},[c]),N.useEffect(()=>{if(!c||!o.current||!f.current||!e)return;const d=e.kind,y=d==="drydock"?e.patchId:d==="conflicts"?e.id:void 0;f2(o.current,f.current,{initialEntryId:d==="entry"?e.entryId:"",kind:d,subId:y,theaterId:i,onRelatedClick:p=>{Br({kind:"entry",entryId:p}),$u()},onClose:h,onPatchOpen:p=>{Br({kind:"drydock",patchId:p}),$u()},onDecided:()=>{_h(),Br({kind:"drydock",patchId:void 0}),$u()}}),requestAnimationFrame(()=>{s.current?.querySelector("[data-sheet-initial-focus]")?.focus()})},[c,_]),c?Es.createPortal(u.jsxs(u.Fragment,{children:[u.jsx("div",{className:"codex-reading-scrim",onClick:h,"aria-hidden":"true"}),u.jsxs("div",{ref:s,className:"codex-reading-sheet",role:"dialog","aria-modal":"true","aria-label":"Codex reading",children:[u.jsxs("div",{className:"codex-reading-sheet-head",children:[u.jsx("span",{className:"codex-reading-sheet-eyebrow",children:"Codex · Reading"}),u.jsx("button",{"data-sheet-initial-focus":!0,className:"codex-reading-sheet-close",type:"button","aria-label":"Close reading",onClick:h,children:"✕"})]}),u.jsxs("div",{className:"codex-reading-sheet-body",children:[u.jsx("div",{ref:o,className:"codex-reading-sheet-read"}),u.jsx("aside",{ref:f,className:"codex-reading-sheet-toc","aria-label":"On this page"})]})]})]}),document.body):null}function ZB(e,n){if(!e)return;const i=[...e.querySelectorAll(YB)].filter(f=>!f.closest("[inert]"));if(i.length===0)return;const s=i[0],o=i[i.length-1];n.shiftKey?document.activeElement===s&&(n.preventDefault(),o.focus()):document.activeElement===o&&(n.preventDefault(),s.focus())}const JB=Eh().api,qg=560,Kg=360,Bp=new Set;function QB({state:e}){const n=N.useRef(null),i=nw(),s=iw(),o=GT(),f=qT(),_=tw(),c=ac(),[h,d]=N.useState([]),y=N.useMemo(()=>e9(e).map(z=>z.id),[e.operations,e.activeTheaterId]),p=N.useRef(e);p.current=e,N.useEffect(()=>{QT(e.activeTheaterId)},[e.activeTheaterId]),N.useEffect(()=>{if(!e.activeTheaterId){d([]);return}RS().then(d).catch(()=>{})},[e.activeTheaterId]),N.useEffect(()=>{const z={current:i},q=V=>{if(!V.altKey||V.metaKey||V.ctrlKey||V.shiftKey||V.key!=="ArrowLeft"&&V.key!=="ArrowRight")return;const j=document.activeElement;if(j instanceof HTMLElement&&j.matches("input, textarea, [contenteditable='true']")&&!j.closest(".xterm"))return;const P=p.current,D=fo(),U=dR(P.operations.filter(ie=>ie.theaterId===P.activeTheaterId),P.groups.filter(ie=>ie.theaterId===P.activeTheaterId),D.operationOrder,D.collapsedGroups).map(ie=>ie.id);if(U.length===0)return;V.preventDefault(),V.stopImmediatePropagation();const G=z.current??p.current.activeOperationId,Y=hR(U,G,V.key==="ArrowRight"?1:-1);if(Y){if(z.current){or(Y),zl(Y);return}xh(Y)}};return window.addEventListener("keydown",q,!0),()=>window.removeEventListener("keydown",q,!0)},[i]),N.useEffect(()=>{for(const z of y)ZT(z);e.operationsHydrated&&JT(y)},[y,e.operationsHydrated]),N.useEffect(()=>{const z=e.pendingOperationFocus;if(z===null)return;if(Xp()!==null){zl(z),Zb();return}po();const q=ES(n.current);q&&Ub(z,q),Zb()},[e.pendingOperationFocus]);const w=!!e.activeTheaterId&&!e.addingTheater,C=(e.operations??[]).filter(z=>z.theaterId===e.activeTheaterId),T=(e.groups??[]).filter(z=>z.theaterId===e.activeTheaterId),E=N.useCallback((z,q)=>c.plugins.find(j=>j.id===z)?.renderLaunchIcon?.(q)??null,[c.plugins]),g=N.useCallback((z,q,V)=>{if(!p.current.activeTheaterId)return;const j={...kS(V),zIndex:sa()};Pp(z,q,j,p.current.activeTheaterId,c.plugins)},[c.plugins]),v=N.useCallback((z,q)=>{if(!p.current.activeTheaterId)return;const V=n9(n.current),j={...kS(V),zIndex:sa()};Pp(z,q,j,p.current.activeTheaterId,c.plugins)},[c.plugins]),m=N.useCallback((z,q,V)=>{p.current.activeTheaterId&&Pp(z,q,V,p.current.activeTheaterId,c.plugins)},[c.plugins]),S=N.useCallback(()=>{rw({x:0,y:0,zoom:1})},[]),k=N.useCallback(()=>{iA()},[]),L=N.useCallback(()=>{eA()},[]),R=N.useCallback(()=>{tA()},[]),M=N.useCallback(z=>{const q=p.current.operations.find(U=>U.id===z);if(!q)return;const V=Xp();if(V!==null&&V!==z){or(z),zl(z);return}const j=fo(),P=j.operations[z]??q.geometry??t9(q);j.operations[z]||Jp(z,P),XT(z),or(z);const D=ES(n.current);D&&Ub(z,D)},[]),A=N.useCallback((z,q)=>{Hu(z,{accent:q}).then(()=>zi(null)).then(Hi).catch(()=>{})},[]),B=N.useCallback((z,q)=>{mw(z,q).then(()=>zi(null)).then(Hi).catch(()=>{})},[]),K=N.useCallback((z,q)=>{Hu(z,{groupId:q}).then(()=>zi(null)).then(Hi).catch(()=>{})},[]),F=N.useCallback((z,q,V)=>{PA({theaterId:z,name:q,color:"blue"}).then(j=>Hu(V,{groupId:j.id})).then(()=>Promise.all([zi(null).then(Hi),Ml().then(Nl)])).catch(()=>{})},[]),W=N.useCallback((z,q)=>{q&&Yb(z,{color:q}).then(()=>Ml()).then(Nl).catch(()=>{})},[]),I=N.useCallback((z,q)=>{Yb(z,{name:q}).then(()=>Ml()).then(Nl).catch(()=>{})},[]),Z=N.useCallback(z=>{zA(z).then(()=>Promise.all([zi(null).then(Hi),Ml().then(Nl)])).catch(()=>{})},[]),X=N.useCallback(z=>{if(Bp.has(z))return;Bp.add(z);const q=p.current.operations.find(j=>j.id===z)?.pluginId,V=(q?c.plugins.find(j=>j.id===q):null)??null;i9(z,V).finally(()=>Bp.delete(z))},[c.plugins]);return u.jsxs("div",{className:"console-body is-canvas",ref:n,children:[u.jsx(GB,{operations:C,groups:T,minimized:s,activeOperationId:e.activeOperationId,operationNotifications:e.operationNotifications,catalog:h,canLaunch:w,mapFullscreen:_,radarEnabled:o,perimeterEnabled:f,renderKindIcon:E,onLaunchKind:v,onResetView:S,onMaximizeMap:k,onToggleRadar:L,onTogglePerimeter:R,onClose:X,onFocus:M,onSetAccent:A,onRename:B,onSetGroupId:K,onCreateGroup:F,onSetGroupColor:W,onRenameGroup:I,onUngroupAll:Z}),u.jsx(X7,{state:e,catalog:h,canLaunch:w,mapFullscreen:_,radarEnabled:o,perimeterEnabled:f,renderKindIcon:E,onLaunchKind:g,onLaunchAtGeometry:m,onResetView:S,onMaximizeMap:k,onToggleRadar:L,onTogglePerimeter:R,onClose:X,onFocus:M,onSetAccent:A}),u.jsx(vB,{theaterId:e.activeTheaterId,api:JB}),u.jsx(XB,{})]})}function e9(e){return e.operations.filter(n=>n.theaterId===e.activeTheaterId).sort(sg)}function ES(e){if(!e)return null;const n=e.getBoundingClientRect();return{width:n.width,height:n.height}}function t9(e){return e.geometry??{x:0,y:0,width:qg,height:Kg,zIndex:0}}function n9(e){const n=fo(),i=e?.clientWidth??800,s=e?.clientHeight??600;return Jl({x:i/2,y:s/2},n.viewport)}function kS(e){return{x:e.x-qg/2,y:e.y-Kg/2,width:qg,height:Kg}}async function Pp(e,n,i,s,o){const f=o.find(p=>p.id===e),c=Eh(()=>{zi(null).then(Hi).catch(()=>{})});let h=null;if(f?.launch?h=(await f.launch({theaterId:s,kind:n,geometry:i,operations:c.operations})).id:h=(await c.operations.create({theaterId:s,type:n.type,pluginId:e,title:n.title,geometry:i})).id,await zi(null).then(Hi).catch(()=>{}),!h)return;const d=WT()===s,y=ig().operations.some(p=>p.id===h);d&&y&&Xp()!==null?(or(h),zl(h)):xh(h)}async function i9(e,n){try{n?.closeOperation&&await n.closeOperation(e)}catch{}await fetch(`/api/v1/operations/${encodeURIComponent(e)}`,{method:"DELETE"}).catch(()=>{}),await zi(null).then(Hi).catch(()=>{})}const r9=6e3;function s9(){const e=Ur(),n=Ui(),i=ac(),s=n.pathname,f=tw()&&s.startsWith("/operations"),_=s.startsWith("/operations");return N.useEffect(()=>{const c=Eh(()=>{zi().then(Hi).catch(()=>{})}),h=i.plugins.map(d=>d.install?.(c)).filter(d=>typeof d=="function");return()=>{for(const d of h)d()}},[i.plugins]),N.useEffect(()=>{nR(_)},[_]),N.useEffect(()=>{const c=document.querySelector(".topbar");if(!c)return;const h=()=>{document.documentElement.style.setProperty("--console-topbar-offset",`${Math.round(c.getBoundingClientRect().bottom)}px`)};h();const d=new ResizeObserver(h);return d.observe(c),window.addEventListener("resize",h),()=>{d.disconnect(),window.removeEventListener("resize",h)}},[]),N.useEffect(()=>{const c=new AbortController;OA(c.signal).then(y=>{aR(y),e1()}).catch(y=>{c.signal.aborted||(tt({theaterError:y instanceof Error?y.message:String(y)}),e1())}),zi(null,c.signal).then(Hi).catch(()=>{}),Ml(null,c.signal).then(Nl).catch(()=>{}),Ew(),fw({signal:c.signal}).then(kw).catch(y=>{c.signal.aborted||Tw(y instanceof Error?y.message:String(y))});const h=()=>{DA(e.activeTheaterId,c.signal).then(iR).catch(()=>{})};h();const d=window.setTimeout(h,r9);return()=>{window.clearTimeout(d),c.abort()}},[]),N.useEffect(()=>{const c=h=>{(h.metaKey||h.ctrlKey)&&h.key.toLowerCase()==="k"&&(h.preventDefault(),h.stopImmediatePropagation(),fR())};return window.addEventListener("keydown",c,!0),()=>window.removeEventListener("keydown",c,!0)},[]),u.jsxs("div",{className:`console-shell ${f?"is-map-fullscreen":""}`,children:[u.jsx(n3,{state:e}),u.jsxs(aT,{children:[u.jsx(Ya,{path:"/",element:u.jsx(Bb,{to:"/operations",replace:!0})}),u.jsx(Ya,{path:"/operations",element:u.jsx(QB,{state:e})}),u.jsx(Ya,{path:"/carrier-settings",element:u.jsx(vj,{})}),u.jsx(Ya,{path:"/settings",element:u.jsx(Jj,{})}),u.jsx(Ya,{path:"*",element:u.jsx(Bb,{to:"/operations",replace:!0})})]}),u.jsx(FR,{state:e}),u.jsx(C3,{state:e}),u.jsx(HR,{state:e}),u.jsx(YR,{open:e.connectionError!==null,tone:"error",title:"Console link interrupted",message:e.connectionError??void 0})]})}globalThis.__fleetConsoleRuntime__={react:Qu,"react/jsx-runtime":E5,"@fleet-console/sdk/plugin/browser":G5,"@fleet-console/sdk/settings/browser":J5,"@fleet-console/sdk/operations/browser":O5,"@fleet-console/sdk/notifications/browser":ek,"@fleet-console/sdk/react/browser":nk};try{const e=await FC();Cw(e.theme)}catch{}const a9=await G8(),TS=document.querySelector("#app");TS&&lk.createRoot(TS).render(u.jsx(N.StrictMode,{children:u.jsx(LT,{basename:"/console",children:u.jsx(W8,{value:a9,children:u.jsx(s9,{})})})}));export{UO as _,o9 as a,Vg as g,At as k,Ul as p};
|