@dotobokuri/fleet-console 1.16.1 → 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/AGENTS.md +5 -2
- package/dist/cli.mjs +499 -299
- package/dist/client/assets/{_baseUniq-Bvbp_jlP.js → _baseUniq-B7sqIsqm.js} +1 -1
- package/dist/client/assets/{arc-BIE5Buf8.js → arc-CvtYLN8U.js} +1 -1
- package/dist/client/assets/{architectureDiagram-Q4EWVU46-D5XMG93D.js → architectureDiagram-Q4EWVU46-rlI7pNrR.js} +1 -1
- package/dist/client/assets/{blockDiagram-DXYQGD6D-DF6L79td.js → blockDiagram-DXYQGD6D-nwx9BNRz.js} +1 -1
- package/dist/client/assets/{c4Diagram-AHTNJAMY-DhF1h0OW.js → c4Diagram-AHTNJAMY-CRL_0Ism.js} +1 -1
- package/dist/client/assets/channel-Ct9EqqyG.js +1 -0
- package/dist/client/assets/{chunk-4BX2VUAB-HIDhmpsY.js → chunk-4BX2VUAB-DEkncDR3.js} +1 -1
- package/dist/client/assets/{chunk-4TB4RGXK-WM3UvlRe.js → chunk-4TB4RGXK-Bnot0Ti1.js} +1 -1
- package/dist/client/assets/{chunk-55IACEB6-D9kCAM0-.js → chunk-55IACEB6-EgKmMTlI.js} +1 -1
- package/dist/client/assets/{chunk-EDXVE4YY-CHGSf6YA.js → chunk-EDXVE4YY-BKiKnVQE.js} +1 -1
- package/dist/client/assets/{chunk-FMBD7UC4-saa1UCmo.js → chunk-FMBD7UC4-BRC398vL.js} +1 -1
- package/dist/client/assets/{chunk-OYMX7WX6-BrlxxClZ.js → chunk-OYMX7WX6-D82gQaXN.js} +1 -1
- package/dist/client/assets/{chunk-QZHKN3VN-CVnd5MX8.js → chunk-QZHKN3VN-BYdI5fky.js} +1 -1
- package/dist/client/assets/{chunk-YZCP3GAM-BpsFNlbM.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-AdFIrmD1.js → cose-bilkent-S5V4N54A-J8dfEdWD.js} +1 -1
- package/dist/client/assets/{dagre-KV5264BT-YPE_DPjG.js → dagre-KV5264BT-zGd_6_Kv.js} +1 -1
- package/dist/client/assets/{diagram-5BDNPKRD-sW7JSe_o.js → diagram-5BDNPKRD-BQpQGgZ3.js} +1 -1
- package/dist/client/assets/{diagram-G4DWMVQ6-CdoUA7HM.js → diagram-G4DWMVQ6-BbgPVITm.js} +1 -1
- package/dist/client/assets/{diagram-MMDJMWI5-Dr_Q44k2.js → diagram-MMDJMWI5-lJsMf0Ic.js} +1 -1
- package/dist/client/assets/{diagram-TYMM5635-CgWLDdO4.js → diagram-TYMM5635-BpEKTzOh.js} +1 -1
- package/dist/client/assets/{erDiagram-SMLLAGMA-BS5jKQII.js → erDiagram-SMLLAGMA-CHHVwJ_a.js} +1 -1
- package/dist/client/assets/{flowDiagram-DWJPFMVM-DM_ZIfsi.js → flowDiagram-DWJPFMVM-Cun8a4NF.js} +1 -1
- package/dist/client/assets/{ganttDiagram-T4ZO3ILL-D1ASi2pt.js → ganttDiagram-T4ZO3ILL-CGCwH_yf.js} +1 -1
- package/dist/client/assets/{gitGraphDiagram-UUTBAWPF-DTS8qu5f.js → gitGraphDiagram-UUTBAWPF-BkY4qdoV.js} +1 -1
- package/dist/client/assets/{graph-BSP3V12O.js → graph-HbRzXQtt.js} +1 -1
- package/dist/client/assets/{index-DNtncJ2Y.css → index-CfNSyAUJ.css} +1 -1
- package/dist/client/assets/index-CzCMC0e-.js +402 -0
- package/dist/client/assets/{infoDiagram-42DDH7IO-C6rS44Vv.js → infoDiagram-42DDH7IO-B21Xtz8v.js} +1 -1
- package/dist/client/assets/{ishikawaDiagram-UXIWVN3A-BysMV0Yj.js → ishikawaDiagram-UXIWVN3A-DiABngEH.js} +1 -1
- package/dist/client/assets/{journeyDiagram-VCZTEJTY-Cq1tDTjK.js → journeyDiagram-VCZTEJTY-BKZ-Uivu.js} +1 -1
- package/dist/client/assets/{kanban-definition-6JOO6SKY-CV7fuoIo.js → kanban-definition-6JOO6SKY-CoJzTtsH.js} +1 -1
- package/dist/client/assets/{layout-mBwNdhT9.js → layout-D5tmQpxt.js} +1 -1
- package/dist/client/assets/{linear-B8Mqzhqu.js → linear-B_riNOXk.js} +1 -1
- package/dist/client/assets/{mermaid.core-mTVIRAe-.js → mermaid.core-CyRCP3U3.js} +4 -4
- package/dist/client/assets/{min-LkS4GBrL.js → min-Cn8LZZXB.js} +1 -1
- package/dist/client/assets/{mindmap-definition-QFDTVHPH-CuK4DHsN.js → mindmap-definition-QFDTVHPH-BN_7mZUt.js} +1 -1
- package/dist/client/assets/{pieDiagram-DEJITSTG-yKtYS0aG.js → pieDiagram-DEJITSTG-DPP2-sYA.js} +1 -1
- package/dist/client/assets/{quadrantDiagram-34T5L4WZ-CQYBuUXw.js → quadrantDiagram-34T5L4WZ-CQ_oo-f9.js} +1 -1
- package/dist/client/assets/{requirementDiagram-MS252O5E-DExCsGb_.js → requirementDiagram-MS252O5E-BkGq7nxD.js} +1 -1
- package/dist/client/assets/{sankeyDiagram-XADWPNL6-kqoN-VmQ.js → sankeyDiagram-XADWPNL6-BVcoktBR.js} +1 -1
- package/dist/client/assets/{sequenceDiagram-FGHM5R23-Dsk6zp0F.js → sequenceDiagram-FGHM5R23-B5rr_VYJ.js} +1 -1
- package/dist/client/assets/{stateDiagram-FHFEXIEX-Bg-kY2ci.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-DkeszYPW.js → timeline-definition-GMOUNBTQ-CJ8TM-3t.js} +1 -1
- package/dist/client/assets/{vennDiagram-DHZGUBPP-a9aq_CaS.js → vennDiagram-DHZGUBPP-BETSq-Pu.js} +1 -1
- package/dist/client/assets/{wardley-RL74JXVD-BioIIFLl.js → wardley-RL74JXVD-CyT2qapq.js} +1 -1
- package/dist/client/assets/{wardleyDiagram-NUSXRM2D-Bpy2nx7x.js → wardleyDiagram-NUSXRM2D-CWHaiUEG.js} +1 -1
- package/dist/client/assets/{xychartDiagram-5P7HB3ND-N7vhpanC.js → xychartDiagram-5P7HB3ND-oVPlZ_Yn.js} +1 -1
- package/dist/client/index.html +2 -2
- package/dist/fleet-plugins/diff/routes.mjs +224 -57
- package/dist/fleet-plugins/file-explorer/routes.mjs +130 -0
- package/dist/fleet-plugins/skills/routes.mjs +17052 -0
- package/dist/fleet-plugins/terminal/routes.mjs +164 -67
- package/package.json +1 -1
- package/dist/client/assets/channel-BSjWiXu9.js +0 -1
- package/dist/client/assets/classDiagram-6PBFFD2Q-DIEVc5gp.js +0 -1
- package/dist/client/assets/classDiagram-v2-HSJHXN6E-DIEVc5gp.js +0 -1
- package/dist/client/assets/clone-VuQnnBA0.js +0 -1
- package/dist/client/assets/index-D3a51i1X.js +0 -402
- package/dist/client/assets/stateDiagram-v2-QKLJ7IA2-Dlqv8bJ9.js +0 -1
|
@@ -1,402 +0,0 @@
|
|
|
1
|
-
function dS(e,n){for(var r=0;r<n.length;r++){const a=n[r];if(typeof a!="string"&&!Array.isArray(a)){for(const o in a)if(o!=="default"&&!(o in e)){const g=Object.getOwnPropertyDescriptor(a,o);g&&Object.defineProperty(e,o,g.get?g:{enumerable:!0,get:()=>a[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"]'))a(o);new MutationObserver(o=>{for(const g of o)if(g.type==="childList")for(const _ of g.addedNodes)_.tagName==="LINK"&&_.rel==="modulepreload"&&a(_)}).observe(document,{childList:!0,subtree:!0});function r(o){const g={};return o.integrity&&(g.integrity=o.integrity),o.referrerPolicy&&(g.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?g.credentials="include":o.crossOrigin==="anonymous"?g.credentials="omit":g.credentials="same-origin",g}function a(o){if(o.ep)return;o.ep=!0;const g=r(o);fetch(o.href,g)}})();function Bg(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function Vj(e){if(Object.prototype.hasOwnProperty.call(e,"__esModule"))return e;var n=e.default;if(typeof n=="function"){var r=function a(){var o=!1;try{o=this instanceof a}catch{}return o?Reflect.construct(n,arguments,this.constructor):n.apply(this,arguments)};r.prototype=n.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(e).forEach(function(a){var o=Object.getOwnPropertyDescriptor(e,a);Object.defineProperty(r,a,o.get?o:{enumerable:!0,get:function(){return e[a]}})}),r}var Ef={exports:{}},ll={};var a1;function n5(){if(a1)return ll;a1=1;var e=Symbol.for("react.transitional.element"),n=Symbol.for("react.fragment");function r(a,o,g){var _=null;if(g!==void 0&&(_=""+g),o.key!==void 0&&(_=""+o.key),"key"in o){g={};for(var c in o)c!=="key"&&(g[c]=o[c])}else g=o;return o=g.ref,{$$typeof:e,type:a,key:_,ref:o!==void 0?o:null,props:g}}return ll.Fragment=n,ll.jsx=r,ll.jsxs=r,ll}var o1;function i5(){return o1||(o1=1,Ef.exports=n5()),Ef.exports}var h=i5();const r5=Bg(h),s5=dS({__proto__:null,default:r5},[h]);var kf={exports:{}},Fe={};var l1;function a5(){if(l1)return Fe;l1=1;var e=Symbol.for("react.transitional.element"),n=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),a=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),g=Symbol.for("react.consumer"),_=Symbol.for("react.context"),c=Symbol.for("react.forward_ref"),u=Symbol.for("react.suspense"),d=Symbol.for("react.memo"),y=Symbol.for("react.lazy"),m=Symbol.for("react.activity"),w=Symbol.iterator;function C(O){return O===null||typeof O!="object"?null:(O=w&&O[w]||O["@@iterator"],typeof O=="function"?O:null)}var A={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},E=Object.assign,f={};function v(O,P,W){this.props=O,this.context=P,this.refs=f,this.updater=W||A}v.prototype.isReactComponent={},v.prototype.setState=function(O,P){if(typeof O!="object"&&typeof O!="function"&&O!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,O,P,"setState")},v.prototype.forceUpdate=function(O){this.updater.enqueueForceUpdate(this,O,"forceUpdate")};function p(){}p.prototype=v.prototype;function S(O,P,W){this.props=O,this.context=P,this.refs=f,this.updater=W||A}var k=S.prototype=new p;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},T=Object.prototype.hasOwnProperty;function I(O,P,W){var Z=W.ref;return{$$typeof:e,type:O,key:P,ref:Z!==void 0?Z:null,props:W}}function K(O,P){return I(O.type,P,O.props)}function F(O){return typeof O=="object"&&O!==null&&O.$$typeof===e}function G(O){var P={"=":"=0",":":"=2"};return"$"+O.replace(/[=:]/g,function(W){return P[W]})}var B=/\/+/g;function X(O,P){return typeof O=="object"&&O!==null&&O.key!=null?G(""+O.key):P.toString(36)}function Y(O){switch(O.status){case"fulfilled":return O.value;case"rejected":throw O.reason;default:switch(typeof O.status=="string"?O.then(R,R):(O.status="pending",O.then(function(P){O.status==="pending"&&(O.status="fulfilled",O.value=P)},function(P){O.status==="pending"&&(O.status="rejected",O.reason=P)})),O.status){case"fulfilled":return O.value;case"rejected":throw O.reason}}throw O}function z(O,P,W,Z,ie){var he=typeof O;(he==="undefined"||he==="boolean")&&(O=null);var te=!1;if(O===null)te=!0;else switch(he){case"bigint":case"string":case"number":te=!0;break;case"object":switch(O.$$typeof){case e:case n:te=!0;break;case y:return te=O._init,z(te(O._payload),P,W,Z,ie)}}if(te)return ie=ie(O),te=Z===""?"."+X(O,0):Z,L(ie)?(W="",te!=null&&(W=te.replace(B,"$&/")+"/"),z(ie,P,W,"",function(ge){return ge})):ie!=null&&(F(ie)&&(ie=K(ie,W+(ie.key==null||O&&O.key===ie.key?"":(""+ie.key).replace(B,"$&/")+"/")+te)),P.push(ie)),1;te=0;var $=Z===""?".":Z+":";if(L(O))for(var le=0;le<O.length;le++)Z=O[le],he=$+X(Z,le),te+=z(Z,P,W,he,ie);else if(le=C(O),typeof le=="function")for(O=le.call(O),le=0;!(Z=O.next()).done;)Z=Z.value,he=$+X(Z,le++),te+=z(Z,P,W,he,ie);else if(he==="object"){if(typeof O.then=="function")return z(Y(O),P,W,Z,ie);throw P=String(O),Error("Objects are not valid as a React child (found: "+(P==="[object Object]"?"object with keys {"+Object.keys(O).join(", ")+"}":P)+"). If you meant to render a collection of children, use an array instead.")}return te}function q(O,P,W){if(O==null)return O;var Z=[],ie=0;return z(O,Z,"","",function(he){return P.call(W,he,ie++)}),Z}function V(O){if(O._status===-1){var P=O._result;P=P(),P.then(function(W){(O._status===0||O._status===-1)&&(O._status=1,O._result=W)},function(W){(O._status===0||O._status===-1)&&(O._status=2,O._result=W)}),O._status===-1&&(O._status=0,O._result=P)}if(O._status===1)return O._result.default;throw O._result}var D=typeof reportError=="function"?reportError:function(O){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var P=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof O=="object"&&O!==null&&typeof O.message=="string"?String(O.message):String(O),error:O});if(!window.dispatchEvent(P))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",O);return}console.error(O)},H={map:q,forEach:function(O,P,W){q(O,function(){P.apply(this,arguments)},W)},count:function(O){var P=0;return q(O,function(){P++}),P},toArray:function(O){return q(O,function(P){return P})||[]},only:function(O){if(!F(O))throw Error("React.Children.only expected to receive a single React element child.");return O}};return Fe.Activity=m,Fe.Children=H,Fe.Component=v,Fe.Fragment=r,Fe.Profiler=o,Fe.PureComponent=S,Fe.StrictMode=a,Fe.Suspense=u,Fe.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=M,Fe.__COMPILER_RUNTIME={__proto__:null,c:function(O){return M.H.useMemoCache(O)}},Fe.cache=function(O){return function(){return O.apply(null,arguments)}},Fe.cacheSignal=function(){return null},Fe.cloneElement=function(O,P,W){if(O==null)throw Error("The argument must be a React element, but you passed "+O+".");var Z=E({},O.props),ie=O.key;if(P!=null)for(he in P.key!==void 0&&(ie=""+P.key),P)!T.call(P,he)||he==="key"||he==="__self"||he==="__source"||he==="ref"&&P.ref===void 0||(Z[he]=P[he]);var he=arguments.length-2;if(he===1)Z.children=W;else if(1<he){for(var te=Array(he),$=0;$<he;$++)te[$]=arguments[$+2];Z.children=te}return I(O.type,ie,Z)},Fe.createContext=function(O){return O={$$typeof:_,_currentValue:O,_currentValue2:O,_threadCount:0,Provider:null,Consumer:null},O.Provider=O,O.Consumer={$$typeof:g,_context:O},O},Fe.createElement=function(O,P,W){var Z,ie={},he=null;if(P!=null)for(Z in P.key!==void 0&&(he=""+P.key),P)T.call(P,Z)&&Z!=="key"&&Z!=="__self"&&Z!=="__source"&&(ie[Z]=P[Z]);var te=arguments.length-2;if(te===1)ie.children=W;else if(1<te){for(var $=Array(te),le=0;le<te;le++)$[le]=arguments[le+2];ie.children=$}if(O&&O.defaultProps)for(Z in te=O.defaultProps,te)ie[Z]===void 0&&(ie[Z]=te[Z]);return I(O,he,ie)},Fe.createRef=function(){return{current:null}},Fe.forwardRef=function(O){return{$$typeof:c,render:O}},Fe.isValidElement=F,Fe.lazy=function(O){return{$$typeof:y,_payload:{_status:-1,_result:O},_init:V}},Fe.memo=function(O,P){return{$$typeof:d,type:O,compare:P===void 0?null:P}},Fe.startTransition=function(O){var P=M.T,W={};M.T=W;try{var Z=O(),ie=M.S;ie!==null&&ie(W,Z),typeof Z=="object"&&Z!==null&&typeof Z.then=="function"&&Z.then(R,D)}catch(he){D(he)}finally{P!==null&&W.types!==null&&(P.types=W.types),M.T=P}},Fe.unstable_useCacheRefresh=function(){return M.H.useCacheRefresh()},Fe.use=function(O){return M.H.use(O)},Fe.useActionState=function(O,P,W){return M.H.useActionState(O,P,W)},Fe.useCallback=function(O,P){return M.H.useCallback(O,P)},Fe.useContext=function(O){return M.H.useContext(O)},Fe.useDebugValue=function(){},Fe.useDeferredValue=function(O,P){return M.H.useDeferredValue(O,P)},Fe.useEffect=function(O,P){return M.H.useEffect(O,P)},Fe.useEffectEvent=function(O){return M.H.useEffectEvent(O)},Fe.useId=function(){return M.H.useId()},Fe.useImperativeHandle=function(O,P,W){return M.H.useImperativeHandle(O,P,W)},Fe.useInsertionEffect=function(O,P){return M.H.useInsertionEffect(O,P)},Fe.useLayoutEffect=function(O,P){return M.H.useLayoutEffect(O,P)},Fe.useMemo=function(O,P){return M.H.useMemo(O,P)},Fe.useOptimistic=function(O,P){return M.H.useOptimistic(O,P)},Fe.useReducer=function(O,P,W){return M.H.useReducer(O,P,W)},Fe.useRef=function(O){return M.H.useRef(O)},Fe.useState=function(O){return M.H.useState(O)},Fe.useSyncExternalStore=function(O,P,W){return M.H.useSyncExternalStore(O,P,W)},Fe.useTransition=function(){return M.H.useTransition()},Fe.version="19.2.7",Fe}var c1;function jg(){return c1||(c1=1,kf.exports=a5()),kf.exports}var j=jg();const o5=Bg(j),Uu=dS({__proto__:null,default:o5},[j]),l5="fc-operation-body";let Ii=class extends Error{status;constructor(n,r){super(r),this.name="ApiError",this.status=n}};async function fS(e){const n=await fetch("/api/v1/operations/catalog",{signal:e});if(!n.ok)throw new Ii(n.status,`Operation catalog request failed: ${n.status}`);const r=await n.json();return Array.isArray(r.plugins)?r.plugins.map(u5).filter(a=>a!==null):[]}function Fu(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)||pS(n))throw new Ii(500,"Invalid operation response");return n}function pS(e){return kp(e,new Set(["canonicalCwd","cwd","persona","prompt","providerSession","ticket","token","toolAllowlist","tools","transcriptPath"]))}function c5({children:e,className:n}){return h.jsx("div",{className:d5(l5,n),children:e})}function u5(e){if(!gS(e)||typeof e.id!="string"||typeof e.title!="string"||!Array.isArray(e.kinds))return null;const n=e.kinds.map(h5).filter(r=>r!==null);return n.length===0?null:{id:e.id,title:e.title,kinds:n}}function h5(e){return!gS(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 gS(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function kp(e,n){return!e||typeof e!="object"?!1:Array.isArray(e)?e.some(r=>kp(r,n)):Object.entries(e).some(([r,a])=>n.has(r)||kp(a,n))}function d5(...e){return e.filter(n=>!!n).join(" ")}const f5=Object.freeze(Object.defineProperty({__proto__:null,ApiError:Ii,OperationBody:c5,assertOperationNode:Fu,fetchOperationCatalog:fS,hasForbiddenBrowserPayloadKey:pS},Symbol.toStringTag,{value:"Module"}));function p5(e){return e}function g5(e){return e}function mS(e=()=>{}){const n=new Set;return{api:{fetch:(r,a,o)=>fetch(Af(r,a),o).then(y5),subscribe:(r,a,o)=>{const g=new EventSource(Af(r,a));g.onmessage=o;const _=()=>g.close();return n.add(_),()=>{_(),n.delete(_)}},resync:e},lifecycle:{onDispose:r=>(n.add(r),()=>n.delete(r))},terminal:{requestTicket:async(r,a,o,g)=>{const _=await fetch(Af(r,a),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({operationId:o}),signal:g});if(!_.ok)throw new Ii(_.status,`Terminal ticket request failed: ${_.status}`);const c=await _.json();if(typeof c.ticket!="string"||typeof c.ttlMs!="number")throw new Ii(_.status,"Invalid terminal ticket response");return{ticket:c.ticket,ttlMs:c.ttlMs}}},notifications:{emit:()=>{},dismiss:()=>{}},operations:{create:async r=>{const a=await fetch("/api/v1/operations",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(r)});if(!a.ok)throw new Ii(a.status,`Operation create failed: ${a.status}`);const o=await a.json();return Fu(o.operation)},rename:async(r,a)=>{const o=await fetch(`/api/v1/operations/${encodeURIComponent(r)}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({title:a})});if(!o.ok)throw new Ii(o.status,`Operation rename failed: ${o.status}`);const g=await o.json();return Fu(g.operation)},remove:async r=>{const a=await fetch(`/api/v1/operations/${encodeURIComponent(r)}`,{method:"DELETE"});if(!a.ok)throw new Ii(a.status,`Operation remove failed: ${a.status}`)}},preferences:{read:(r,a)=>S5(r,a),write:(r,a)=>w5(r,a)},status:{set:()=>{},clear:()=>{}}}}function _S(e,n){return j.useSyncExternalStore(e,n,n)}function m5(){const[e,n]=j.useState([]),r=j.useCallback(async()=>{const a=await fetch("/api/v1/operations");if(!a.ok)throw new Ii(a.status,`Operations request failed: ${a.status}`);const o=await a.json();n(Array.isArray(o.operations)?o.operations.map(Fu):[])},[]);return j.useEffect(()=>{r()},[r]),{operations:e,refresh:r}}function _5(e,n){return j.useMemo(()=>({fetch:(r,a)=>e.fetch(n,r,a),subscribe:(r,a)=>e.subscribe(n,r,a)}),[e,n])}function v5(e,n,r){const[a,o]=j.useState(()=>e.read(n,r)),g=j.useCallback(_=>{o(_),e.write(n,_)},[e,n]);return[a,g]}function b5(e,n){return j.useMemo(()=>({set:r=>e.set(n,r),clear:()=>e.clear(n)}),[e,n])}async function y5(e){if(!e.ok)throw new Ii(e.status,`Plugin request failed: ${e.status}`);return e}function Af(e,n){if(!/^[a-z0-9][a-z0-9._-]*$/i.test(e))throw new Ii(400,"Invalid plugin id");const r=n.startsWith("/")?n:`/${n}`;if(r.includes(".."))throw new Ii(400,"Invalid plugin path");return`/plugins/${e}${r}`}function S5(e,n){if(typeof window>"u")return n;try{const r=window.localStorage.getItem(`fleet-plugin.${e}`);return r===null?n:JSON.parse(r)}catch{return n}}function w5(e,n){if(!(typeof window>"u"))try{window.localStorage.setItem(`fleet-plugin.${e}`,JSON.stringify(n))}catch{}}const x5=Object.freeze(Object.defineProperty({__proto__:null,React:Uu,createClientCapabilities:mS,defineOperationKind:g5,definePlugin:p5,useOperationStatus:b5,useOperations:m5,usePluginApi:_5,usePluginStorage:v5,useStoreSnapshot:_S},Symbol.toStringTag,{value:"Module"}));function C5(e){return e}function E5({title:e,description:n,children:r}){return h.jsxs("section",{className:"fc-settings-card",children:[e?h.jsx("h3",{className:"fc-settings-card__title",children:e}):null,n?h.jsx("p",{className:"fc-settings-card__desc",children:n}):null,h.jsx("div",{className:"fc-settings-card__body",children:r})]})}function k5({label:e,hint:n,children:r}){const a=j.useId(),o=j.useId();return h.jsxs("div",{className:"fc-settings-row",role:"group","aria-labelledby":a,"aria-describedby":n?o:void 0,children:[h.jsxs("div",{className:"fc-settings-row__copy",children:[h.jsx("div",{className:"fc-settings-row__label",id:a,children:e}),n?h.jsx("div",{className:"fc-settings-row__hint",id:o,children:n}):null]}),h.jsx("div",{className:"fc-settings-row__control",children:r})]})}function A5({checked:e,onChange:n,label:r,disabled:a=!1}){const o=j.useId();return h.jsxs("label",{className:"fc-settings-toggle",htmlFor:o,children:[h.jsx("input",{id:o,className:"fc-settings-toggle__input",type:"checkbox",checked:e,disabled:a,"aria-label":r?void 0:"Toggle setting",onChange:g=>n(g.currentTarget.checked)}),h.jsx("span",{className:"fc-settings-toggle__control","aria-hidden":"true"}),r?h.jsx("span",{className:"fc-settings-toggle__label",children:r}):null]})}function T5({value:e,options:n,onChange:r,label:a,disabled:o=!1}){const g=j.useId(),_=h.jsx("select",{id:g,className:"fc-settings-select__control",value:e,disabled:o,"aria-label":a?void 0:"Select setting",onChange:c=>r(c.currentTarget.value),children:n.map(c=>h.jsx("option",{value:c.value,children:c.label},c.value))});return a?h.jsxs("label",{className:"fc-settings-select",htmlFor:g,children:[h.jsx("span",{className:"fc-settings-select__label",children:a}),_]}):h.jsx("div",{className:"fc-settings-select",children:_})}function R5({label:e,hint:n,children:r}){const a=j.useId(),o=j.useId();return h.jsxs("div",{className:"fc-settings-field",role:"group","aria-labelledby":a,"aria-describedby":n?o:void 0,children:[h.jsx("div",{className:"fc-settings-field__label",id:a,children:e}),n?h.jsx("div",{className:"fc-settings-field__hint",id:o,children:n}):null,h.jsx("div",{className:"fc-settings-field__control",children:r})]})}const L5=Object.freeze(Object.defineProperty({__proto__:null,SettingsCard:E5,SettingsField:R5,SettingsRow:k5,SettingsSelect:T5,SettingsToggle:A5,defineSettingsSection:C5},Symbol.toStringTag,{value:"Module"}));function M5(e){return e}const N5=Object.freeze(Object.defineProperty({__proto__:null,defineNotificationKind:M5},Symbol.toStringTag,{value:"Module"})),O5=h.jsx("div",{className:"fc-plugin-error",children:"Plugin failed to render."});class Ig extends j.Component{state={hasError:!1};static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(n){this.props.onError?.(n)}render(){return this.state.hasError?this.props.fallback??O5:this.props.children}}const D5=Object.freeze(Object.defineProperty({__proto__:null,PluginErrorBoundary:Ig,React:Uu,default:Uu},Symbol.toStringTag,{value:"Module"}));var Tf={exports:{}},cl={},Rf={exports:{}},Lf={};var u1;function B5(){return u1||(u1=1,(function(e){function n(z,q){var V=z.length;z.push(q);e:for(;0<V;){var D=V-1>>>1,H=z[D];if(0<o(H,q))z[D]=q,z[V]=H,V=D;else break e}}function r(z){return z.length===0?null:z[0]}function a(z){if(z.length===0)return null;var q=z[0],V=z.pop();if(V!==q){z[0]=V;e:for(var D=0,H=z.length,O=H>>>1;D<O;){var P=2*(D+1)-1,W=z[P],Z=P+1,ie=z[Z];if(0>o(W,V))Z<H&&0>o(ie,W)?(z[D]=ie,z[Z]=V,D=Z):(z[D]=W,z[P]=V,D=P);else if(Z<H&&0>o(ie,V))z[D]=ie,z[Z]=V,D=Z;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 g=performance;e.unstable_now=function(){return g.now()}}else{var _=Date,c=_.now();e.unstable_now=function(){return _.now()-c}}var u=[],d=[],y=1,m=null,w=3,C=!1,A=!1,E=!1,f=!1,v=typeof setTimeout=="function"?setTimeout:null,p=typeof clearTimeout=="function"?clearTimeout:null,S=typeof setImmediate<"u"?setImmediate:null;function k(z){for(var q=r(d);q!==null;){if(q.callback===null)a(d);else if(q.startTime<=z)a(d),q.sortIndex=q.expirationTime,n(u,q);else break;q=r(d)}}function L(z){if(E=!1,k(z),!A)if(r(u)!==null)A=!0,R||(R=!0,G());else{var q=r(d);q!==null&&Y(L,q.startTime-z)}}var R=!1,M=-1,T=5,I=-1;function K(){return f?!0:!(e.unstable_now()-I<T)}function F(){if(f=!1,R){var z=e.unstable_now();I=z;var q=!0;try{e:{A=!1,E&&(E=!1,p(M),M=-1),C=!0;var V=w;try{t:{for(k(z),m=r(u);m!==null&&!(m.expirationTime>z&&K());){var D=m.callback;if(typeof D=="function"){m.callback=null,w=m.priorityLevel;var H=D(m.expirationTime<=z);if(z=e.unstable_now(),typeof H=="function"){m.callback=H,k(z),q=!0;break t}m===r(u)&&a(u),k(z)}else a(u);m=r(u)}if(m!==null)q=!0;else{var O=r(d);O!==null&&Y(L,O.startTime-z),q=!1}}break e}finally{m=null,w=V,C=!1}q=void 0}}finally{q?G():R=!1}}}var G;if(typeof S=="function")G=function(){S(F)};else if(typeof MessageChannel<"u"){var B=new MessageChannel,X=B.port2;B.port1.onmessage=F,G=function(){X.postMessage(null)}}else G=function(){v(F,0)};function Y(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"):T=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(){f=!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 D=e.unstable_now();switch(typeof V=="object"&&V!==null?(V=V.delay,V=typeof V=="number"&&0<V?D+V:D):V=D,z){case 1:var H=-1;break;case 2:H=250;break;case 5:H=1073741823;break;case 4:H=1e4;break;default:H=5e3}return H=V+H,z={id:y++,callback:q,priorityLevel:z,startTime:V,expirationTime:H,sortIndex:-1},V>D?(z.sortIndex=V,n(d,z),r(u)===null&&z===r(d)&&(E?(p(M),M=-1):E=!0,Y(L,V-D))):(z.sortIndex=H,n(u,z),A||C||(A=!0,R||(R=!0,G()))),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}}}})(Lf)),Lf}var h1;function j5(){return h1||(h1=1,Rf.exports=B5()),Rf.exports}var Mf={exports:{}},Hn={};var d1;function I5(){if(d1)return Hn;d1=1;var e=jg();function n(u){var d="https://react.dev/errors/"+u;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 #"+u+"; visit "+d+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function r(){}var a={d:{f:r,r:function(){throw Error(n(522))},D:r,C:r,L:r,m:r,X:r,S:r,M:r},p:0,findDOMNode:null},o=Symbol.for("react.portal");function g(u,d,y){var m=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:o,key:m==null?null:""+m,children:u,containerInfo:d,implementation:y}}var _=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function c(u,d){if(u==="font")return"";if(typeof d=="string")return d==="use-credentials"?d:""}return Hn.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=a,Hn.createPortal=function(u,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 g(u,d,null,y)},Hn.flushSync=function(u){var d=_.T,y=a.p;try{if(_.T=null,a.p=2,u)return u()}finally{_.T=d,a.p=y,a.d.f()}},Hn.preconnect=function(u,d){typeof u=="string"&&(d?(d=d.crossOrigin,d=typeof d=="string"?d==="use-credentials"?d:"":void 0):d=null,a.d.C(u,d))},Hn.prefetchDNS=function(u){typeof u=="string"&&a.d.D(u)},Hn.preinit=function(u,d){if(typeof u=="string"&&d&&typeof d.as=="string"){var y=d.as,m=c(y,d.crossOrigin),w=typeof d.integrity=="string"?d.integrity:void 0,C=typeof d.fetchPriority=="string"?d.fetchPriority:void 0;y==="style"?a.d.S(u,typeof d.precedence=="string"?d.precedence:void 0,{crossOrigin:m,integrity:w,fetchPriority:C}):y==="script"&&a.d.X(u,{crossOrigin:m,integrity:w,fetchPriority:C,nonce:typeof d.nonce=="string"?d.nonce:void 0})}},Hn.preinitModule=function(u,d){if(typeof u=="string")if(typeof d=="object"&&d!==null){if(d.as==null||d.as==="script"){var y=c(d.as,d.crossOrigin);a.d.M(u,{crossOrigin:y,integrity:typeof d.integrity=="string"?d.integrity:void 0,nonce:typeof d.nonce=="string"?d.nonce:void 0})}}else d==null&&a.d.M(u)},Hn.preload=function(u,d){if(typeof u=="string"&&typeof d=="object"&&d!==null&&typeof d.as=="string"){var y=d.as,m=c(y,d.crossOrigin);a.d.L(u,y,{crossOrigin:m,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(u,d){if(typeof u=="string")if(d){var y=c(d.as,d.crossOrigin);a.d.m(u,{as:typeof d.as=="string"&&d.as!=="script"?d.as:void 0,crossOrigin:y,integrity:typeof d.integrity=="string"?d.integrity:void 0})}else a.d.m(u)},Hn.requestFormReset=function(u){a.d.r(u)},Hn.unstable_batchedUpdates=function(u,d){return u(d)},Hn.useFormState=function(u,d,y){return _.H.useFormState(u,d,y)},Hn.useFormStatus=function(){return _.H.useHostTransitionStatus()},Hn.version="19.2.7",Hn}var f1;function vS(){if(f1)return Mf.exports;f1=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(),Mf.exports=I5(),Mf.exports}var p1;function P5(){if(p1)return cl;p1=1;var e=j5(),n=jg(),r=vS();function a(t){var i="https://react.dev/errors/"+t;if(1<arguments.length){i+="?args[]="+encodeURIComponent(arguments[1]);for(var s=2;s<arguments.length;s++)i+="&args[]="+encodeURIComponent(arguments[s])}return"Minified React error #"+t+"; visit "+i+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function o(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)}function g(t){var i=t,s=t;if(t.alternate)for(;i.return;)i=i.return;else{t=i;do i=t,(i.flags&4098)!==0&&(s=i.return),t=i.return;while(t)}return i.tag===3?s:null}function _(t){if(t.tag===13){var i=t.memoizedState;if(i===null&&(t=t.alternate,t!==null&&(i=t.memoizedState)),i!==null)return i.dehydrated}return null}function c(t){if(t.tag===31){var i=t.memoizedState;if(i===null&&(t=t.alternate,t!==null&&(i=t.memoizedState)),i!==null)return i.dehydrated}return null}function u(t){if(g(t)!==t)throw Error(a(188))}function d(t){var i=t.alternate;if(!i){if(i=g(t),i===null)throw Error(a(188));return i!==t?null:t}for(var s=t,l=i;;){var b=s.return;if(b===null)break;var x=b.alternate;if(x===null){if(l=b.return,l!==null){s=l;continue}break}if(b.child===x.child){for(x=b.child;x;){if(x===s)return u(b),t;if(x===l)return u(b),i;x=x.sibling}throw Error(a(188))}if(s.return!==l.return)s=b,l=x;else{for(var N=!1,U=b.child;U;){if(U===s){N=!0,s=b,l=x;break}if(U===l){N=!0,l=b,s=x;break}U=U.sibling}if(!N){for(U=x.child;U;){if(U===s){N=!0,s=x,l=b;break}if(U===l){N=!0,l=x,s=b;break}U=U.sibling}if(!N)throw Error(a(189))}}if(s.alternate!==l)throw Error(a(190))}if(s.tag!==3)throw Error(a(188));return s.stateNode.current===s?t:i}function y(t){var i=t.tag;if(i===5||i===26||i===27||i===6)return t;for(t=t.child;t!==null;){if(i=y(t),i!==null)return i;t=t.sibling}return null}var m=Object.assign,w=Symbol.for("react.element"),C=Symbol.for("react.transitional.element"),A=Symbol.for("react.portal"),E=Symbol.for("react.fragment"),f=Symbol.for("react.strict_mode"),v=Symbol.for("react.profiler"),p=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"),T=Symbol.for("react.lazy"),I=Symbol.for("react.activity"),K=Symbol.for("react.memo_cache_sentinel"),F=Symbol.iterator;function G(t){return t===null||typeof t!="object"?null:(t=F&&t[F]||t["@@iterator"],typeof t=="function"?t:null)}var B=Symbol.for("react.client.reference");function X(t){if(t==null)return null;if(typeof t=="function")return t.$$typeof===B?null:t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case E:return"Fragment";case v:return"Profiler";case f:return"StrictMode";case L:return"Suspense";case R:return"SuspenseList";case I:return"Activity"}if(typeof t=="object")switch(t.$$typeof){case A:return"Portal";case S:return t.displayName||"Context";case p:return(t._context.displayName||"Context")+".Consumer";case k:var i=t.render;return t=t.displayName,t||(t=i.displayName||i.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case M:return i=t.displayName||null,i!==null?i:X(t.type)||"Memo";case T:i=t._payload,t=t._init;try{return X(t(i))}catch{}}return null}var Y=Array.isArray,z=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,q=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,V={pending:!1,data:null,method:null,action:null},D=[],H=-1;function O(t){return{current:t}}function P(t){0>H||(t.current=D[H],D[H]=null,H--)}function W(t,i){H++,D[H]=t.current,t.current=i}var Z=O(null),ie=O(null),he=O(null),te=O(null);function $(t,i){switch(W(he,i),W(ie,t),W(Z,null),i.nodeType){case 9:case 11:t=(t=i.documentElement)&&(t=t.namespaceURI)?R0(t):0;break;default:if(t=i.tagName,i=i.namespaceURI)i=R0(i),t=L0(i,t);else switch(t){case"svg":t=1;break;case"math":t=2;break;default:t=0}}P(Z),W(Z,t)}function le(){P(Z),P(ie),P(he)}function ge(t){t.memoizedState!==null&&W(te,t);var i=Z.current,s=L0(i,t.type);i!==s&&(W(ie,t),W(Z,s))}function we(t){ie.current===t&&(P(Z),P(ie)),te.current===t&&(P(te),rl._currentValue=V)}var Se,je;function Ie(t){if(Se===void 0)try{throw Error()}catch(s){var i=s.stack.trim().match(/\n( *(at )?)/);Se=i&&i[1]||"",je=-1<s.stack.indexOf(`
|
|
2
|
-
at`)?" (<anonymous>)":-1<s.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
3
|
-
`+Se+t+je}var Ge=!1;function vt(t,i){if(!t||Ge)return"";Ge=!0;var s=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var l={DetermineComponentFrameRoot:function(){try{if(i){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(ue){var ce=ue}Reflect.construct(t,[],me)}else{try{me.call()}catch(ue){ce=ue}t.call(me.prototype)}}else{try{throw Error()}catch(ue){ce=ue}(me=t())&&typeof me.catch=="function"&&me.catch(function(){})}}catch(ue){if(ue&&ce&&typeof ue.stack=="string")return[ue.stack,ce.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(),N=x[0],U=x[1];if(N&&U){var ee=N.split(`
|
|
4
|
-
`),oe=U.split(`
|
|
5
|
-
`);for(b=l=0;l<ee.length&&!ee[l].includes("DetermineComponentFrameRoot");)l++;for(;b<oe.length&&!oe[b].includes("DetermineComponentFrameRoot");)b++;if(l===ee.length||b===oe.length)for(l=ee.length-1,b=oe.length-1;1<=l&&0<=b&&ee[l]!==oe[b];)b--;for(;1<=l&&0<=b;l--,b--)if(ee[l]!==oe[b]){if(l!==1||b!==1)do if(l--,b--,0>b||ee[l]!==oe[b]){var de=`
|
|
6
|
-
`+ee[l].replace(" at new "," at ");return t.displayName&&de.includes("<anonymous>")&&(de=de.replace("<anonymous>",t.displayName)),de}while(1<=l&&0<=b);break}}}finally{Ge=!1,Error.prepareStackTrace=s}return(s=t?t.displayName||t.name:"")?Ie(s):""}function Le(t,i){switch(t.tag){case 26:case 27:case 5:return Ie(t.type);case 16:return Ie("Lazy");case 13:return t.child!==i&&i!==null?Ie("Suspense Fallback"):Ie("Suspense");case 19:return Ie("SuspenseList");case 0:case 15:return vt(t.type,!1);case 11:return vt(t.type.render,!1);case 1:return vt(t.type,!0);case 31:return Ie("Activity");default:return""}}function Rt(t){try{var i="",s=null;do i+=Le(t,s),s=t,t=t.return;while(t);return i}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,ut=e.unstable_now,Lt=e.unstable_getCurrentPriorityLevel,Ct=e.unstable_ImmediatePriority,Ft=e.unstable_UserBlockingPriority,Kt=e.unstable_NormalPriority,Xn=e.unstable_LowPriority,bn=e.unstable_IdlePriority,Pn=e.log,dt=e.unstable_setDisableYieldValue,An=null,ve=null;function $e(t){if(typeof Pn=="function"&&dt(t),ve&&typeof ve.setStrictMode=="function")try{ve.setStrictMode(An,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,Tn=262144,Un=4194304;function Bt(t){var i=t&42;if(i!==0)return i;switch(t&-t){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return t&261888;case 262144:case 524288:case 1048576:case 2097152:return t&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return t&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return t}}function Q(t,i,s){var l=t.pendingLanes;if(l===0)return 0;var b=0,x=t.suspendedLanes,N=t.pingedLanes;t=t.warmLanes;var U=l&134217727;return U!==0?(l=U&~x,l!==0?b=Bt(l):(N&=U,N!==0?b=Bt(N):s||(s=U&~t,s!==0&&(b=Bt(s))))):(U=l&~x,U!==0?b=Bt(U):N!==0?b=Bt(N):s||(s=l&~t,s!==0&&(b=Bt(s)))),b===0?0:i!==0&&i!==b&&(i&x)===0&&(x=b&-b,s=i&-i,x>=s||x===32&&(s&4194048)!==0)?i:b}function fe(t,i){return(t.pendingLanes&~(t.suspendedLanes&~t.pingedLanes)&i)===0}function ye(t,i){switch(t){case 1:case 2:case 4:case 8:case 64:return i+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return i+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Oe(){var t=Un;return Un<<=1,(Un&62914560)===0&&(Un=4194304),t}function bt(t){for(var i=[],s=0;31>s;s++)i.push(t);return i}function ht(t,i){t.pendingLanes|=i,i!==268435456&&(t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0)}function ke(t,i,s,l,b,x){var N=t.pendingLanes;t.pendingLanes=s,t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0,t.expiredLanes&=s,t.entangledLanes&=s,t.errorRecoveryDisabledLanes&=s,t.shellSuspendCounter=0;var U=t.entanglements,ee=t.expirationTimes,oe=t.hiddenUpdates;for(s=N&~s;0<s;){var de=31-Ze(s),me=1<<de;U[de]=0,ee[de]=-1;var ce=oe[de];if(ce!==null)for(oe[de]=null,de=0;de<ce.length;de++){var ue=ce[de];ue!==null&&(ue.lane&=-536870913)}s&=~me}l!==0&&Ce(t,l,0),x!==0&&b===0&&t.tag!==0&&(t.suspendedLanes|=x&~(N&~i))}function Ce(t,i,s){t.pendingLanes|=i,t.suspendedLanes&=~i;var l=31-Ze(i);t.entangledLanes|=i,t.entanglements[l]=t.entanglements[l]|1073741824|s&261930}function Pe(t,i){var s=t.entangledLanes|=i;for(t=t.entanglements;s;){var l=31-Ze(s),b=1<<l;b&i|t[l]&i&&(t[l]|=i),s&=~b}}function Vt(t,i){var s=i&-i;return s=(s&42)!==0?1:nt(s),(s&(t.suspendedLanes|i))!==0?0:s}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 hr(){var t=q.p;return t!==0?t:(t=window.event,t===void 0?32:Q0(t.type))}function dr(t,i){var s=q.p;try{return q.p=t,i()}finally{q.p=s}}var Zn=Math.random().toString(36).slice(2),jt="__reactFiber$"+Zn,Nt="__reactProps$"+Zn,Ui="__reactContainer$"+Zn,Fr="__reactEvents$"+Zn,oa="__reactListeners$"+Zn,fr="__reactHandles$"+Zn,As="__reactResources$"+Zn,Qi="__reactMarker$"+Zn;function Ne(t){delete t[jt],delete t[Nt],delete t[Fr],delete t[oa],delete t[fr]}function J(t){var i=t[jt];if(i)return i;for(var s=t.parentNode;s;){if(i=s[Ui]||s[jt]){if(s=i.alternate,i.child!==null||s!==null&&s.child!==null)for(t=I0(t);t!==null;){if(s=t[jt])return s;t=I0(t)}return i}t=s,s=t.parentNode}return null}function _e(t){if(t=t[jt]||t[Ui]){var i=t.tag;if(i===5||i===6||i===13||i===31||i===26||i===27||i===3)return t}return null}function Ee(t){var i=t.tag;if(i===5||i===26||i===27||i===6)return t.stateNode;throw Error(a(33))}function ot(t){var i=t[As];return i||(i=t[As]={hoistableStyles:new Map,hoistableScripts:new Map}),i}function Je(t){t[Qi]=!0}var It=new Set,Jt={};function Qt(t,i){be(t,i),be(t+"Capture",i)}function be(t,i){for(Jt[t]=i,t=0;t<i.length;t++)It.add(i[t])}var Me=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),De={},ft={};function Wt(t){return Xt.call(ft,t)?!0:Xt.call(De,t)?!1:Me.test(t)?ft[t]=!0:(De[t]=!0,!1)}function zn(t,i,s){if(Wt(i))if(s===null)t.removeAttribute(i);else{switch(typeof s){case"undefined":case"function":case"symbol":t.removeAttribute(i);return;case"boolean":var l=i.toLowerCase().slice(0,5);if(l!=="data-"&&l!=="aria-"){t.removeAttribute(i);return}}t.setAttribute(i,""+s)}}function ci(t,i,s){if(s===null)t.removeAttribute(i);else{switch(typeof s){case"undefined":case"function":case"symbol":case"boolean":t.removeAttribute(i);return}t.setAttribute(i,""+s)}}function Jn(t,i,s,l){if(l===null)t.removeAttribute(s);else{switch(typeof l){case"undefined":case"function":case"symbol":case"boolean":t.removeAttribute(s);return}t.setAttributeNS(i,s,""+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 ui(t){var i=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(i==="checkbox"||i==="radio")}function Ql(t,i,s){var l=Object.getOwnPropertyDescriptor(t.constructor.prototype,i);if(!t.hasOwnProperty(i)&&typeof l<"u"&&typeof l.get=="function"&&typeof l.set=="function"){var b=l.get,x=l.set;return Object.defineProperty(t,i,{configurable:!0,get:function(){return b.call(this)},set:function(N){s=""+N,x.call(this,N)}}),Object.defineProperty(t,i,{enumerable:l.enumerable}),{getValue:function(){return s},setValue:function(N){s=""+N},stopTracking:function(){t._valueTracker=null,delete t[i]}}}}function la(t){if(!t._valueTracker){var i=ui(t)?"checked":"value";t._valueTracker=Ql(t,i,""+t[i])}}function _o(t){if(!t)return!1;var i=t._valueTracker;if(!i)return!0;var s=i.getValue(),l="";return t&&(l=ui(t)?t.checked?"true":"false":t.value),t=l,t!==s?(i.setValue(t),!0):!1}function ca(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 xh=/[\n"\\]/g;function Qn(t){return t.replace(xh,function(i){return"\\"+i.charCodeAt(0).toString(16)+" "})}function vo(t,i,s,l,b,x,N,U){t.name="",N!=null&&typeof N!="function"&&typeof N!="symbol"&&typeof N!="boolean"?t.type=N:t.removeAttribute("type"),i!=null?N==="number"?(i===0&&t.value===""||t.value!=i)&&(t.value=""+Ot(i)):t.value!==""+Ot(i)&&(t.value=""+Ot(i)):N!=="submit"&&N!=="reset"||t.removeAttribute("value"),i!=null?ua(t,N,Ot(i)):s!=null?ua(t,N,Ot(s)):l!=null&&t.removeAttribute("value"),b==null&&x!=null&&(t.defaultChecked=!!x),b!=null&&(t.checked=b&&typeof b!="function"&&typeof b!="symbol"),U!=null&&typeof U!="function"&&typeof U!="symbol"&&typeof U!="boolean"?t.name=""+Ot(U):t.removeAttribute("name")}function Ts(t,i,s,l,b,x,N,U){if(x!=null&&typeof x!="function"&&typeof x!="symbol"&&typeof x!="boolean"&&(t.type=x),i!=null||s!=null){if(!(x!=="submit"&&x!=="reset"||i!=null)){la(t);return}s=s!=null?""+Ot(s):"",i=i!=null?""+Ot(i):s,U||i===t.value||(t.value=i),t.defaultValue=i}l=l??b,l=typeof l!="function"&&typeof l!="symbol"&&!!l,t.checked=U?t.checked:!!l,t.defaultChecked=!!l,N!=null&&typeof N!="function"&&typeof N!="symbol"&&typeof N!="boolean"&&(t.name=N),la(t)}function ua(t,i,s){i==="number"&&ca(t.ownerDocument)===t||t.defaultValue===""+s||(t.defaultValue=""+s)}function Ln(t,i,s,l){if(t=t.options,i){i={};for(var b=0;b<s.length;b++)i["$"+s[b]]=!0;for(s=0;s<t.length;s++)b=i.hasOwnProperty("$"+t[s].value),t[s].selected!==b&&(t[s].selected=b),b&&l&&(t[s].defaultSelected=!0)}else{for(s=""+Ot(s),i=null,b=0;b<t.length;b++){if(t[b].value===s){t[b].selected=!0,l&&(t[b].defaultSelected=!0);return}i!==null||t[b].disabled||(i=t[b])}i!==null&&(i.selected=!0)}}function ec(t,i,s){if(i!=null&&(i=""+Ot(i),i!==t.value&&(t.value=i),s==null)){t.defaultValue!==i&&(t.defaultValue=i);return}t.defaultValue=s!=null?""+Ot(s):""}function ha(t,i,s,l){if(i==null){if(l!=null){if(s!=null)throw Error(a(92));if(Y(l)){if(1<l.length)throw Error(a(93));l=l[0]}s=l}s==null&&(s=""),i=s}s=Ot(i),t.defaultValue=s,l=t.textContent,l===s&&l!==""&&l!==null&&(t.value=l),la(t)}function Ue(t,i){if(i){var s=t.firstChild;if(s&&s===t.lastChild&&s.nodeType===3){s.nodeValue=i;return}}t.textContent=i}var tc=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,i,s){var l=i.indexOf("--")===0;s==null||typeof s=="boolean"||s===""?l?t.setProperty(i,""):i==="float"?t.cssFloat="":t[i]="":l?t.setProperty(i,s):typeof s!="number"||s===0||tc.has(i)?i==="float"?t.cssFloat=s:t[i]=(""+s).trim():t[i]=s+"px"}function yt(t,i,s){if(i!=null&&typeof i!="object")throw Error(a(62));if(t=t.style,s!=null){for(var l in s)!s.hasOwnProperty(l)||i!=null&&i.hasOwnProperty(l)||(l.indexOf("--")===0?t.setProperty(l,""):l==="float"?t.cssFloat="":t[l]="");for(var b in i)l=i[b],i.hasOwnProperty(b)&&s[b]!==l&&hn(t,b,l)}else for(var x in i)i.hasOwnProperty(x)&&hn(t,x,i[x])}function Wr(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 pr=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"]]),bo=/^[\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 Gr(t){return bo.test(""+t)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":t}function xe(){}var Te=null;function We(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 xi(t){var i=_e(t);if(i&&(t=i.stateNode)){var s=t[Nt]||null;e:switch(t=i.stateNode,i.type){case"input":if(vo(t,s.value,s.defaultValue,s.defaultValue,s.checked,s.defaultChecked,s.type,s.name),i=s.name,s.type==="radio"&&i!=null){for(s=t;s.parentNode;)s=s.parentNode;for(s=s.querySelectorAll('input[name="'+Qn(""+i)+'"][type="radio"]'),i=0;i<s.length;i++){var l=s[i];if(l!==t&&l.form===t.form){var b=l[Nt]||null;if(!b)throw Error(a(90));vo(l,b.value,b.defaultValue,b.defaultValue,b.checked,b.defaultChecked,b.type,b.name)}}for(i=0;i<s.length;i++)l=s[i],l.form===t.form&&_o(l)}break e;case"textarea":ec(t,s.value,s.defaultValue);break e;case"select":i=s.value,i!=null&&Ln(t,!!s.multiple,i,!1)}}}var yo=!1;function nc(t,i,s){if(yo)return t(i,s);yo=!0;try{var l=t(i);return l}finally{if(yo=!1,(it!==null||Yt!==null)&&(Fc(),it&&(i=it,t=Yt,Yt=it=null,xi(i),t)))for(i=0;i<t.length;i++)xi(t[i])}}function So(t,i){var s=t.stateNode;if(s===null)return null;var l=s[Nt]||null;if(l===null)return null;s=l[i];e:switch(i){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(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(s&&typeof s!="function")throw Error(a(231,i,typeof s));return s}var gr=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Ch=!1;if(gr)try{var wo={};Object.defineProperty(wo,"passive",{get:function(){Ch=!0}}),window.addEventListener("test",wo,wo),window.removeEventListener("test",wo,wo)}catch{Ch=!1}var qr=null,Eh=null,ic=null;function Lm(){if(ic)return ic;var t,i=Eh,s=i.length,l,b="value"in qr?qr.value:qr.textContent,x=b.length;for(t=0;t<s&&i[t]===b[t];t++);var N=s-t;for(l=1;l<=N&&i[s-l]===b[x-l];l++);return ic=b.slice(t,1<l?1-l:void 0)}function rc(t){var i=t.keyCode;return"charCode"in t?(t=t.charCode,t===0&&i===13&&(t=13)):t=i,t===10&&(t=13),32<=t||t===13?t:0}function sc(){return!0}function Mm(){return!1}function ei(t){function i(s,l,b,x,N){this._reactName=s,this._targetInst=b,this.type=l,this.nativeEvent=x,this.target=N,this.currentTarget=null;for(var U in t)t.hasOwnProperty(U)&&(s=t[U],this[U]=s?s(x):x[U]);return this.isDefaultPrevented=(x.defaultPrevented!=null?x.defaultPrevented:x.returnValue===!1)?sc:Mm,this.isPropagationStopped=Mm,this}return m(i.prototype,{preventDefault:function(){this.defaultPrevented=!0;var s=this.nativeEvent;s&&(s.preventDefault?s.preventDefault():typeof s.returnValue!="unknown"&&(s.returnValue=!1),this.isDefaultPrevented=sc)},stopPropagation:function(){var s=this.nativeEvent;s&&(s.stopPropagation?s.stopPropagation():typeof s.cancelBubble!="unknown"&&(s.cancelBubble=!0),this.isPropagationStopped=sc)},persist:function(){},isPersistent:sc}),i}var Rs={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(t){return t.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},ac=ei(Rs),xo=m({},Rs,{view:0,detail:0}),e2=ei(xo),kh,Ah,Co,oc=m({},xo,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Rh,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!==Co&&(Co&&t.type==="mousemove"?(kh=t.screenX-Co.screenX,Ah=t.screenY-Co.screenY):Ah=kh=0,Co=t),kh)},movementY:function(t){return"movementY"in t?t.movementY:Ah}}),Nm=ei(oc),t2=m({},oc,{dataTransfer:0}),n2=ei(t2),i2=m({},xo,{relatedTarget:0}),Th=ei(i2),r2=m({},Rs,{animationName:0,elapsedTime:0,pseudoElement:0}),s2=ei(r2),a2=m({},Rs,{clipboardData:function(t){return"clipboardData"in t?t.clipboardData:window.clipboardData}}),o2=ei(a2),l2=m({},Rs,{data:0}),Om=ei(l2),c2={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},u2={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"},h2={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function d2(t){var i=this.nativeEvent;return i.getModifierState?i.getModifierState(t):(t=h2[t])?!!i[t]:!1}function Rh(){return d2}var f2=m({},xo,{key:function(t){if(t.key){var i=c2[t.key]||t.key;if(i!=="Unidentified")return i}return t.type==="keypress"?(t=rc(t),t===13?"Enter":String.fromCharCode(t)):t.type==="keydown"||t.type==="keyup"?u2[t.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Rh,charCode:function(t){return t.type==="keypress"?rc(t):0},keyCode:function(t){return t.type==="keydown"||t.type==="keyup"?t.keyCode:0},which:function(t){return t.type==="keypress"?rc(t):t.type==="keydown"||t.type==="keyup"?t.keyCode:0}}),p2=ei(f2),g2=m({},oc,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Dm=ei(g2),m2=m({},xo,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Rh}),_2=ei(m2),v2=m({},Rs,{propertyName:0,elapsedTime:0,pseudoElement:0}),b2=ei(v2),y2=m({},oc,{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}),S2=ei(y2),w2=m({},Rs,{newState:0,oldState:0}),x2=ei(w2),C2=[9,13,27,32],Lh=gr&&"CompositionEvent"in window,Eo=null;gr&&"documentMode"in document&&(Eo=document.documentMode);var E2=gr&&"TextEvent"in window&&!Eo,Bm=gr&&(!Lh||Eo&&8<Eo&&11>=Eo),jm=" ",Im=!1;function Pm(t,i){switch(t){case"keyup":return C2.indexOf(i.keyCode)!==-1;case"keydown":return i.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function zm(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var da=!1;function k2(t,i){switch(t){case"compositionend":return zm(i);case"keypress":return i.which!==32?null:(Im=!0,jm);case"textInput":return t=i.data,t===jm&&Im?null:t;default:return null}}function A2(t,i){if(da)return t==="compositionend"||!Lh&&Pm(t,i)?(t=Lm(),ic=Eh=qr=null,da=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(i.ctrlKey||i.altKey||i.metaKey)||i.ctrlKey&&i.altKey){if(i.char&&1<i.char.length)return i.char;if(i.which)return String.fromCharCode(i.which)}return null;case"compositionend":return Bm&&i.locale!=="ko"?null:i.data;default:return null}}var T2={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 Hm(t){var i=t&&t.nodeName&&t.nodeName.toLowerCase();return i==="input"?!!T2[t.type]:i==="textarea"}function $m(t,i,s,l){it?Yt?Yt.push(l):Yt=[l]:it=l,i=Xc(i,"onChange"),0<i.length&&(s=new ac("onChange","change",null,s,l),t.push({event:s,listeners:i}))}var ko=null,Ao=null;function R2(t){x0(t,0)}function lc(t){var i=Ee(t);if(_o(i))return t}function Um(t,i){if(t==="change")return i}var Fm=!1;if(gr){var Mh;if(gr){var Nh="oninput"in document;if(!Nh){var Wm=document.createElement("div");Wm.setAttribute("oninput","return;"),Nh=typeof Wm.oninput=="function"}Mh=Nh}else Mh=!1;Fm=Mh&&(!document.documentMode||9<document.documentMode)}function Gm(){ko&&(ko.detachEvent("onpropertychange",qm),Ao=ko=null)}function qm(t){if(t.propertyName==="value"&&lc(Ao)){var i=[];$m(i,Ao,t,We(t)),nc(R2,i)}}function L2(t,i,s){t==="focusin"?(Gm(),ko=i,Ao=s,ko.attachEvent("onpropertychange",qm)):t==="focusout"&&Gm()}function M2(t){if(t==="selectionchange"||t==="keyup"||t==="keydown")return lc(Ao)}function N2(t,i){if(t==="click")return lc(i)}function O2(t,i){if(t==="input"||t==="change")return lc(i)}function D2(t,i){return t===i&&(t!==0||1/t===1/i)||t!==t&&i!==i}var hi=typeof Object.is=="function"?Object.is:D2;function To(t,i){if(hi(t,i))return!0;if(typeof t!="object"||t===null||typeof i!="object"||i===null)return!1;var s=Object.keys(t),l=Object.keys(i);if(s.length!==l.length)return!1;for(l=0;l<s.length;l++){var b=s[l];if(!Xt.call(i,b)||!hi(t[b],i[b]))return!1}return!0}function Km(t){for(;t&&t.firstChild;)t=t.firstChild;return t}function Vm(t,i){var s=Km(t);t=0;for(var l;s;){if(s.nodeType===3){if(l=t+s.textContent.length,t<=i&&l>=i)return{node:s,offset:i-t};t=l}e:{for(;s;){if(s.nextSibling){s=s.nextSibling;break e}s=s.parentNode}s=void 0}s=Km(s)}}function Ym(t,i){return t&&i?t===i?!0:t&&t.nodeType===3?!1:i&&i.nodeType===3?Ym(t,i.parentNode):"contains"in t?t.contains(i):t.compareDocumentPosition?!!(t.compareDocumentPosition(i)&16):!1:!1}function Xm(t){t=t!=null&&t.ownerDocument!=null&&t.ownerDocument.defaultView!=null?t.ownerDocument.defaultView:window;for(var i=ca(t.document);i instanceof t.HTMLIFrameElement;){try{var s=typeof i.contentWindow.location.href=="string"}catch{s=!1}if(s)t=i.contentWindow;else break;i=ca(t.document)}return i}function Oh(t){var i=t&&t.nodeName&&t.nodeName.toLowerCase();return i&&(i==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||i==="textarea"||t.contentEditable==="true")}var B2=gr&&"documentMode"in document&&11>=document.documentMode,fa=null,Dh=null,Ro=null,Bh=!1;function Zm(t,i,s){var l=s.window===s?s.document:s.nodeType===9?s:s.ownerDocument;Bh||fa==null||fa!==ca(l)||(l=fa,"selectionStart"in l&&Oh(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}),Ro&&To(Ro,l)||(Ro=l,l=Xc(Dh,"onSelect"),0<l.length&&(i=new ac("onSelect","select",null,i,s),t.push({event:i,listeners:l}),i.target=fa)))}function Ls(t,i){var s={};return s[t.toLowerCase()]=i.toLowerCase(),s["Webkit"+t]="webkit"+i,s["Moz"+t]="moz"+i,s}var pa={animationend:Ls("Animation","AnimationEnd"),animationiteration:Ls("Animation","AnimationIteration"),animationstart:Ls("Animation","AnimationStart"),transitionrun:Ls("Transition","TransitionRun"),transitionstart:Ls("Transition","TransitionStart"),transitioncancel:Ls("Transition","TransitionCancel"),transitionend:Ls("Transition","TransitionEnd")},jh={},Jm={};gr&&(Jm=document.createElement("div").style,"AnimationEvent"in window||(delete pa.animationend.animation,delete pa.animationiteration.animation,delete pa.animationstart.animation),"TransitionEvent"in window||delete pa.transitionend.transition);function Ms(t){if(jh[t])return jh[t];if(!pa[t])return t;var i=pa[t],s;for(s in i)if(i.hasOwnProperty(s)&&s in Jm)return jh[t]=i[s];return t}var Qm=Ms("animationend"),e_=Ms("animationiteration"),t_=Ms("animationstart"),j2=Ms("transitionrun"),I2=Ms("transitionstart"),P2=Ms("transitioncancel"),n_=Ms("transitionend"),i_=new Map,Ih="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(" ");Ih.push("scrollEnd");function Fi(t,i){i_.set(t,i),Qt(i,[t])}var cc=typeof reportError=="function"?reportError:function(t){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var i=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof t=="object"&&t!==null&&typeof t.message=="string"?String(t.message):String(t),error:t});if(!window.dispatchEvent(i))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",t);return}console.error(t)},Ci=[],ga=0,Ph=0;function uc(){for(var t=ga,i=Ph=ga=0;i<t;){var s=Ci[i];Ci[i++]=null;var l=Ci[i];Ci[i++]=null;var b=Ci[i];Ci[i++]=null;var x=Ci[i];if(Ci[i++]=null,l!==null&&b!==null){var N=l.pending;N===null?b.next=b:(b.next=N.next,N.next=b),l.pending=b}x!==0&&r_(s,b,x)}}function hc(t,i,s,l){Ci[ga++]=t,Ci[ga++]=i,Ci[ga++]=s,Ci[ga++]=l,Ph|=l,t.lanes|=l,t=t.alternate,t!==null&&(t.lanes|=l)}function zh(t,i,s,l){return hc(t,i,s,l),dc(t)}function Ns(t,i){return hc(t,null,null,i),dc(t)}function r_(t,i,s){t.lanes|=s;var l=t.alternate;l!==null&&(l.lanes|=s);for(var b=!1,x=t.return;x!==null;)x.childLanes|=s,l=x.alternate,l!==null&&(l.childLanes|=s),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&&i!==null&&(b=31-Ze(s),t=x.hiddenUpdates,l=t[b],l===null?t[b]=[i]:l.push(i),i.lane=s|536870912),x):null}function dc(t){if(50<Zo)throw Zo=0,Vd=null,Error(a(185));for(var i=t.return;i!==null;)t=i,i=t.return;return t.tag===3?t.stateNode:null}var ma={};function z2(t,i,s,l){this.tag=t,this.key=s,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=i,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=l,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function di(t,i,s,l){return new z2(t,i,s,l)}function Hh(t){return t=t.prototype,!(!t||!t.isReactComponent)}function mr(t,i){var s=t.alternate;return s===null?(s=di(t.tag,i,t.key,t.mode),s.elementType=t.elementType,s.type=t.type,s.stateNode=t.stateNode,s.alternate=t,t.alternate=s):(s.pendingProps=i,s.type=t.type,s.flags=0,s.subtreeFlags=0,s.deletions=null),s.flags=t.flags&65011712,s.childLanes=t.childLanes,s.lanes=t.lanes,s.child=t.child,s.memoizedProps=t.memoizedProps,s.memoizedState=t.memoizedState,s.updateQueue=t.updateQueue,i=t.dependencies,s.dependencies=i===null?null:{lanes:i.lanes,firstContext:i.firstContext},s.sibling=t.sibling,s.index=t.index,s.ref=t.ref,s.refCleanup=t.refCleanup,s}function s_(t,i){t.flags&=65011714;var s=t.alternate;return s===null?(t.childLanes=0,t.lanes=i,t.child=null,t.subtreeFlags=0,t.memoizedProps=null,t.memoizedState=null,t.updateQueue=null,t.dependencies=null,t.stateNode=null):(t.childLanes=s.childLanes,t.lanes=s.lanes,t.child=s.child,t.subtreeFlags=0,t.deletions=null,t.memoizedProps=s.memoizedProps,t.memoizedState=s.memoizedState,t.updateQueue=s.updateQueue,t.type=s.type,i=s.dependencies,t.dependencies=i===null?null:{lanes:i.lanes,firstContext:i.firstContext}),t}function fc(t,i,s,l,b,x){var N=0;if(l=t,typeof t=="function")Hh(t)&&(N=1);else if(typeof t=="string")N=WE(t,s,Z.current)?26:t==="html"||t==="head"||t==="body"?27:5;else e:switch(t){case I:return t=di(31,s,i,b),t.elementType=I,t.lanes=x,t;case E:return Os(s.children,b,x,i);case f:N=8,b|=24;break;case v:return t=di(12,s,i,b|2),t.elementType=v,t.lanes=x,t;case L:return t=di(13,s,i,b),t.elementType=L,t.lanes=x,t;case R:return t=di(19,s,i,b),t.elementType=R,t.lanes=x,t;default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case S:N=10;break e;case p:N=9;break e;case k:N=11;break e;case M:N=14;break e;case T:N=16,l=null;break e}N=29,s=Error(a(130,t===null?"null":typeof t,"")),l=null}return i=di(N,s,i,b),i.elementType=t,i.type=l,i.lanes=x,i}function Os(t,i,s,l){return t=di(7,t,l,i),t.lanes=s,t}function $h(t,i,s){return t=di(6,t,null,i),t.lanes=s,t}function a_(t){var i=di(18,null,null,0);return i.stateNode=t,i}function Uh(t,i,s){return i=di(4,t.children!==null?t.children:[],t.key,i),i.lanes=s,i.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},i}var o_=new WeakMap;function Ei(t,i){if(typeof t=="object"&&t!==null){var s=o_.get(t);return s!==void 0?s:(i={value:t,source:i,stack:Rt(i)},o_.set(t,i),i)}return{value:t,source:i,stack:Rt(i)}}var _a=[],va=0,pc=null,Lo=0,ki=[],Ai=0,Kr=null,er=1,tr="";function _r(t,i){_a[va++]=Lo,_a[va++]=pc,pc=t,Lo=i}function l_(t,i,s){ki[Ai++]=er,ki[Ai++]=tr,ki[Ai++]=Kr,Kr=t;var l=er;t=tr;var b=32-Ze(l)-1;l&=~(1<<b),s+=1;var x=32-Ze(i)+b;if(30<x){var N=b-b%5;x=(l&(1<<N)-1).toString(32),l>>=N,b-=N,er=1<<32-Ze(i)+b|s<<b|l,tr=x+t}else er=1<<x|s<<b|l,tr=t}function Fh(t){t.return!==null&&(_r(t,1),l_(t,1,0))}function Wh(t){for(;t===pc;)pc=_a[--va],_a[va]=null,Lo=_a[--va],_a[va]=null;for(;t===Kr;)Kr=ki[--Ai],ki[Ai]=null,tr=ki[--Ai],ki[Ai]=null,er=ki[--Ai],ki[Ai]=null}function c_(t,i){ki[Ai++]=er,ki[Ai++]=tr,ki[Ai++]=Kr,er=i.id,tr=i.overflow,Kr=t}var Mn=null,Pt=null,lt=!1,Vr=null,Ti=!1,Gh=Error(a(519));function Yr(t){var i=Error(a(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Mo(Ei(i,t)),Gh}function u_(t){var i=t.stateNode,s=t.type,l=t.memoizedProps;switch(i[jt]=t,i[Nt]=l,s){case"dialog":et("cancel",i),et("close",i);break;case"iframe":case"object":case"embed":et("load",i);break;case"video":case"audio":for(s=0;s<Qo.length;s++)et(Qo[s],i);break;case"source":et("error",i);break;case"img":case"image":case"link":et("error",i),et("load",i);break;case"details":et("toggle",i);break;case"input":et("invalid",i),Ts(i,l.value,l.defaultValue,l.checked,l.defaultChecked,l.type,l.name,!0);break;case"select":et("invalid",i);break;case"textarea":et("invalid",i),ha(i,l.value,l.defaultValue,l.children)}s=l.children,typeof s!="string"&&typeof s!="number"&&typeof s!="bigint"||i.textContent===""+s||l.suppressHydrationWarning===!0||A0(i.textContent,s)?(l.popover!=null&&(et("beforetoggle",i),et("toggle",i)),l.onScroll!=null&&et("scroll",i),l.onScrollEnd!=null&&et("scrollend",i),l.onClick!=null&&(i.onclick=xe),i=!0):i=!1,i||Yr(t,!0)}function h_(t){for(Mn=t.return;Mn;)switch(Mn.tag){case 5:case 31:case 13:Ti=!1;return;case 27:case 3:Ti=!0;return;default:Mn=Mn.return}}function ba(t){if(t!==Mn)return!1;if(!lt)return h_(t),lt=!0,!1;var i=t.tag,s;if((s=i!==3&&i!==27)&&((s=i===5)&&(s=t.type,s=!(s!=="form"&&s!=="button")||uf(t.type,t.memoizedProps)),s=!s),s&&Pt&&Yr(t),h_(t),i===13){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(a(317));Pt=j0(t)}else if(i===31){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(a(317));Pt=j0(t)}else i===27?(i=Pt,cs(t.type)?(t=gf,gf=null,Pt=t):Pt=i):Pt=Mn?Li(t.stateNode.nextSibling):null;return!0}function Ds(){Pt=Mn=null,lt=!1}function qh(){var t=Vr;return t!==null&&(ri===null?ri=t:ri.push.apply(ri,t),Vr=null),t}function Mo(t){Vr===null?Vr=[t]:Vr.push(t)}var Kh=O(null),Bs=null,vr=null;function Xr(t,i,s){W(Kh,i._currentValue),i._currentValue=s}function br(t){t._currentValue=Kh.current,P(Kh)}function Vh(t,i,s){for(;t!==null;){var l=t.alternate;if((t.childLanes&i)!==i?(t.childLanes|=i,l!==null&&(l.childLanes|=i)):l!==null&&(l.childLanes&i)!==i&&(l.childLanes|=i),t===s)break;t=t.return}}function Yh(t,i,s,l){var b=t.child;for(b!==null&&(b.return=t);b!==null;){var x=b.dependencies;if(x!==null){var N=b.child;x=x.firstContext;e:for(;x!==null;){var U=x;x=b;for(var ee=0;ee<i.length;ee++)if(U.context===i[ee]){x.lanes|=s,U=x.alternate,U!==null&&(U.lanes|=s),Vh(x.return,s,t),l||(N=null);break e}x=U.next}}else if(b.tag===18){if(N=b.return,N===null)throw Error(a(341));N.lanes|=s,x=N.alternate,x!==null&&(x.lanes|=s),Vh(N,s,t),N=null}else N=b.child;if(N!==null)N.return=b;else for(N=b;N!==null;){if(N===t){N=null;break}if(b=N.sibling,b!==null){b.return=N.return,N=b;break}N=N.return}b=N}}function ya(t,i,s,l){t=null;for(var b=i,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 N=b.alternate;if(N===null)throw Error(a(387));if(N=N.memoizedProps,N!==null){var U=b.type;hi(b.pendingProps.value,N.value)||(t!==null?t.push(U):t=[U])}}else if(b===te.current){if(N=b.alternate,N===null)throw Error(a(387));N.memoizedState.memoizedState!==b.memoizedState.memoizedState&&(t!==null?t.push(rl):t=[rl])}b=b.return}t!==null&&Yh(i,t,s,l),i.flags|=262144}function gc(t){for(t=t.firstContext;t!==null;){if(!hi(t.context._currentValue,t.memoizedValue))return!0;t=t.next}return!1}function js(t){Bs=t,vr=null,t=t.dependencies,t!==null&&(t.firstContext=null)}function Nn(t){return d_(Bs,t)}function mc(t,i){return Bs===null&&js(t),d_(t,i)}function d_(t,i){var s=i._currentValue;if(i={context:i,memoizedValue:s,next:null},vr===null){if(t===null)throw Error(a(308));vr=i,t.dependencies={lanes:0,firstContext:i},t.flags|=524288}else vr=vr.next=i;return s}var H2=typeof AbortController<"u"?AbortController:function(){var t=[],i=this.signal={aborted:!1,addEventListener:function(s,l){t.push(l)}};this.abort=function(){i.aborted=!0,t.forEach(function(s){return s()})}},$2=e.unstable_scheduleCallback,U2=e.unstable_NormalPriority,dn={$$typeof:S,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Xh(){return{controller:new H2,data:new Map,refCount:0}}function No(t){t.refCount--,t.refCount===0&&$2(U2,function(){t.controller.abort()})}var Oo=null,Zh=0,Sa=0,wa=null;function F2(t,i){if(Oo===null){var s=Oo=[];Zh=0,Sa=ef(),wa={status:"pending",value:void 0,then:function(l){s.push(l)}}}return Zh++,i.then(f_,f_),i}function f_(){if(--Zh===0&&Oo!==null){wa!==null&&(wa.status="fulfilled");var t=Oo;Oo=null,Sa=0,wa=null;for(var i=0;i<t.length;i++)(0,t[i])()}}function W2(t,i){var s=[],l={status:"pending",value:null,reason:null,then:function(b){s.push(b)}};return t.then(function(){l.status="fulfilled",l.value=i;for(var b=0;b<s.length;b++)(0,s[b])(i)},function(b){for(l.status="rejected",l.reason=b,b=0;b<s.length;b++)(0,s[b])(void 0)}),l}var p_=z.S;z.S=function(t,i){Zv=ut(),typeof i=="object"&&i!==null&&typeof i.then=="function"&&F2(t,i),p_!==null&&p_(t,i)};var Is=O(null);function Jh(){var t=Is.current;return t!==null?t:Mt.pooledCache}function _c(t,i){i===null?W(Is,Is.current):W(Is,i.pool)}function g_(){var t=Jh();return t===null?null:{parent:dn._currentValue,pool:t}}var xa=Error(a(460)),Qh=Error(a(474)),vc=Error(a(542)),bc={then:function(){}};function m_(t){return t=t.status,t==="fulfilled"||t==="rejected"}function __(t,i,s){switch(s=t[s],s===void 0?t.push(i):s!==i&&(i.then(xe,xe),i=s),i.status){case"fulfilled":return i.value;case"rejected":throw t=i.reason,b_(t),t;default:if(typeof i.status=="string")i.then(xe,xe);else{if(t=Mt,t!==null&&100<t.shellSuspendCounter)throw Error(a(482));t=i,t.status="pending",t.then(function(l){if(i.status==="pending"){var b=i;b.status="fulfilled",b.value=l}},function(l){if(i.status==="pending"){var b=i;b.status="rejected",b.reason=l}})}switch(i.status){case"fulfilled":return i.value;case"rejected":throw t=i.reason,b_(t),t}throw zs=i,xa}}function Ps(t){try{var i=t._init;return i(t._payload)}catch(s){throw s!==null&&typeof s=="object"&&typeof s.then=="function"?(zs=s,xa):s}}var zs=null;function v_(){if(zs===null)throw Error(a(459));var t=zs;return zs=null,t}function b_(t){if(t===xa||t===vc)throw Error(a(483))}var Ca=null,Do=0;function yc(t){var i=Do;return Do+=1,Ca===null&&(Ca=[]),__(Ca,t,i)}function Bo(t,i){i=i.props.ref,t.ref=i!==void 0?i:null}function Sc(t,i){throw i.$$typeof===w?Error(a(525)):(t=Object.prototype.toString.call(i),Error(a(31,t==="[object Object]"?"object with keys {"+Object.keys(i).join(", ")+"}":t)))}function y_(t){function i(re,ne){if(t){var ae=re.deletions;ae===null?(re.deletions=[ne],re.flags|=16):ae.push(ne)}}function s(re,ne){if(!t)return null;for(;ne!==null;)i(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=mr(re,ne),re.index=0,re.sibling=null,re}function x(re,ne,ae){return re.index=ae,t?(ae=re.alternate,ae!==null?(ae=ae.index,ae<ne?(re.flags|=67108866,ne):ae):(re.flags|=67108866,ne)):(re.flags|=1048576,ne)}function N(re){return t&&re.alternate===null&&(re.flags|=67108866),re}function U(re,ne,ae,pe){return ne===null||ne.tag!==6?(ne=$h(ae,re.mode,pe),ne.return=re,ne):(ne=b(ne,ae),ne.return=re,ne)}function ee(re,ne,ae,pe){var Be=ae.type;return Be===E?de(re,ne,ae.props.children,pe,ae.key):ne!==null&&(ne.elementType===Be||typeof Be=="object"&&Be!==null&&Be.$$typeof===T&&Ps(Be)===ne.type)?(ne=b(ne,ae.props),Bo(ne,ae),ne.return=re,ne):(ne=fc(ae.type,ae.key,ae.props,null,re.mode,pe),Bo(ne,ae),ne.return=re,ne)}function oe(re,ne,ae,pe){return ne===null||ne.tag!==4||ne.stateNode.containerInfo!==ae.containerInfo||ne.stateNode.implementation!==ae.implementation?(ne=Uh(ae,re.mode,pe),ne.return=re,ne):(ne=b(ne,ae.children||[]),ne.return=re,ne)}function de(re,ne,ae,pe,Be){return ne===null||ne.tag!==7?(ne=Os(ae,re.mode,pe,Be),ne.return=re,ne):(ne=b(ne,ae),ne.return=re,ne)}function me(re,ne,ae){if(typeof ne=="string"&&ne!==""||typeof ne=="number"||typeof ne=="bigint")return ne=$h(""+ne,re.mode,ae),ne.return=re,ne;if(typeof ne=="object"&&ne!==null){switch(ne.$$typeof){case C:return ae=fc(ne.type,ne.key,ne.props,null,re.mode,ae),Bo(ae,ne),ae.return=re,ae;case A:return ne=Uh(ne,re.mode,ae),ne.return=re,ne;case T:return ne=Ps(ne),me(re,ne,ae)}if(Y(ne)||G(ne))return ne=Os(ne,re.mode,ae,null),ne.return=re,ne;if(typeof ne.then=="function")return me(re,yc(ne),ae);if(ne.$$typeof===S)return me(re,mc(re,ne),ae);Sc(re,ne)}return null}function ce(re,ne,ae,pe){var Be=ne!==null?ne.key:null;if(typeof ae=="string"&&ae!==""||typeof ae=="number"||typeof ae=="bigint")return Be!==null?null:U(re,ne,""+ae,pe);if(typeof ae=="object"&&ae!==null){switch(ae.$$typeof){case C:return ae.key===Be?ee(re,ne,ae,pe):null;case A:return ae.key===Be?oe(re,ne,ae,pe):null;case T:return ae=Ps(ae),ce(re,ne,ae,pe)}if(Y(ae)||G(ae))return Be!==null?null:de(re,ne,ae,pe,null);if(typeof ae.then=="function")return ce(re,ne,yc(ae),pe);if(ae.$$typeof===S)return ce(re,ne,mc(re,ae),pe);Sc(re,ae)}return null}function ue(re,ne,ae,pe,Be){if(typeof pe=="string"&&pe!==""||typeof pe=="number"||typeof pe=="bigint")return re=re.get(ae)||null,U(ne,re,""+pe,Be);if(typeof pe=="object"&&pe!==null){switch(pe.$$typeof){case C:return re=re.get(pe.key===null?ae:pe.key)||null,ee(ne,re,pe,Be);case A:return re=re.get(pe.key===null?ae:pe.key)||null,oe(ne,re,pe,Be);case T:return pe=Ps(pe),ue(re,ne,ae,pe,Be)}if(Y(pe)||G(pe))return re=re.get(ae)||null,de(ne,re,pe,Be,null);if(typeof pe.then=="function")return ue(re,ne,ae,yc(pe),Be);if(pe.$$typeof===S)return ue(re,ne,ae,mc(ne,pe),Be);Sc(ne,pe)}return null}function Ae(re,ne,ae,pe){for(var Be=null,pt=null,Re=ne,Ye=ne=0,st=null;Re!==null&&Ye<ae.length;Ye++){Re.index>Ye?(st=Re,Re=null):st=Re.sibling;var gt=ce(re,Re,ae[Ye],pe);if(gt===null){Re===null&&(Re=st);break}t&&Re&>.alternate===null&&i(re,Re),ne=x(gt,ne,Ye),pt===null?Be=gt:pt.sibling=gt,pt=gt,Re=st}if(Ye===ae.length)return s(re,Re),lt&&_r(re,Ye),Be;if(Re===null){for(;Ye<ae.length;Ye++)Re=me(re,ae[Ye],pe),Re!==null&&(ne=x(Re,ne,Ye),pt===null?Be=Re:pt.sibling=Re,pt=Re);return lt&&_r(re,Ye),Be}for(Re=l(Re);Ye<ae.length;Ye++)st=ue(Re,re,Ye,ae[Ye],pe),st!==null&&(t&&st.alternate!==null&&Re.delete(st.key===null?Ye:st.key),ne=x(st,ne,Ye),pt===null?Be=st:pt.sibling=st,pt=st);return t&&Re.forEach(function(ps){return i(re,ps)}),lt&&_r(re,Ye),Be}function ze(re,ne,ae,pe){if(ae==null)throw Error(a(151));for(var Be=null,pt=null,Re=ne,Ye=ne=0,st=null,gt=ae.next();Re!==null&&!gt.done;Ye++,gt=ae.next()){Re.index>Ye?(st=Re,Re=null):st=Re.sibling;var ps=ce(re,Re,gt.value,pe);if(ps===null){Re===null&&(Re=st);break}t&&Re&&ps.alternate===null&&i(re,Re),ne=x(ps,ne,Ye),pt===null?Be=ps:pt.sibling=ps,pt=ps,Re=st}if(gt.done)return s(re,Re),lt&&_r(re,Ye),Be;if(Re===null){for(;!gt.done;Ye++,gt=ae.next())gt=me(re,gt.value,pe),gt!==null&&(ne=x(gt,ne,Ye),pt===null?Be=gt:pt.sibling=gt,pt=gt);return lt&&_r(re,Ye),Be}for(Re=l(Re);!gt.done;Ye++,gt=ae.next())gt=ue(Re,re,Ye,gt.value,pe),gt!==null&&(t&>.alternate!==null&&Re.delete(gt.key===null?Ye:gt.key),ne=x(gt,ne,Ye),pt===null?Be=gt:pt.sibling=gt,pt=gt);return t&&Re.forEach(function(t5){return i(re,t5)}),lt&&_r(re,Ye),Be}function At(re,ne,ae,pe){if(typeof ae=="object"&&ae!==null&&ae.type===E&&ae.key===null&&(ae=ae.props.children),typeof ae=="object"&&ae!==null){switch(ae.$$typeof){case C:e:{for(var Be=ae.key;ne!==null;){if(ne.key===Be){if(Be=ae.type,Be===E){if(ne.tag===7){s(re,ne.sibling),pe=b(ne,ae.props.children),pe.return=re,re=pe;break e}}else if(ne.elementType===Be||typeof Be=="object"&&Be!==null&&Be.$$typeof===T&&Ps(Be)===ne.type){s(re,ne.sibling),pe=b(ne,ae.props),Bo(pe,ae),pe.return=re,re=pe;break e}s(re,ne);break}else i(re,ne);ne=ne.sibling}ae.type===E?(pe=Os(ae.props.children,re.mode,pe,ae.key),pe.return=re,re=pe):(pe=fc(ae.type,ae.key,ae.props,null,re.mode,pe),Bo(pe,ae),pe.return=re,re=pe)}return N(re);case A:e:{for(Be=ae.key;ne!==null;){if(ne.key===Be)if(ne.tag===4&&ne.stateNode.containerInfo===ae.containerInfo&&ne.stateNode.implementation===ae.implementation){s(re,ne.sibling),pe=b(ne,ae.children||[]),pe.return=re,re=pe;break e}else{s(re,ne);break}else i(re,ne);ne=ne.sibling}pe=Uh(ae,re.mode,pe),pe.return=re,re=pe}return N(re);case T:return ae=Ps(ae),At(re,ne,ae,pe)}if(Y(ae))return Ae(re,ne,ae,pe);if(G(ae)){if(Be=G(ae),typeof Be!="function")throw Error(a(150));return ae=Be.call(ae),ze(re,ne,ae,pe)}if(typeof ae.then=="function")return At(re,ne,yc(ae),pe);if(ae.$$typeof===S)return At(re,ne,mc(re,ae),pe);Sc(re,ae)}return typeof ae=="string"&&ae!==""||typeof ae=="number"||typeof ae=="bigint"?(ae=""+ae,ne!==null&&ne.tag===6?(s(re,ne.sibling),pe=b(ne,ae),pe.return=re,re=pe):(s(re,ne),pe=$h(ae,re.mode,pe),pe.return=re,re=pe),N(re)):s(re,ne)}return function(re,ne,ae,pe){try{Do=0;var Be=At(re,ne,ae,pe);return Ca=null,Be}catch(Re){if(Re===xa||Re===vc)throw Re;var pt=di(29,Re,null,re.mode);return pt.lanes=pe,pt.return=re,pt}}}var Hs=y_(!0),S_=y_(!1),Zr=!1;function ed(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function td(t,i){t=t.updateQueue,i.updateQueue===t&&(i.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,callbacks:null})}function Jr(t){return{lane:t,tag:0,payload:null,callback:null,next:null}}function Qr(t,i,s){var l=t.updateQueue;if(l===null)return null;if(l=l.shared,(_t&2)!==0){var b=l.pending;return b===null?i.next=i:(i.next=b.next,b.next=i),l.pending=i,i=dc(t),r_(t,null,s),i}return hc(t,l,i,s),dc(t)}function jo(t,i,s){if(i=i.updateQueue,i!==null&&(i=i.shared,(s&4194048)!==0)){var l=i.lanes;l&=t.pendingLanes,s|=l,i.lanes=s,Pe(t,s)}}function nd(t,i){var s=t.updateQueue,l=t.alternate;if(l!==null&&(l=l.updateQueue,s===l)){var b=null,x=null;if(s=s.firstBaseUpdate,s!==null){do{var N={lane:s.lane,tag:s.tag,payload:s.payload,callback:null,next:null};x===null?b=x=N:x=x.next=N,s=s.next}while(s!==null);x===null?b=x=i:x=x.next=i}else b=x=i;s={baseState:l.baseState,firstBaseUpdate:b,lastBaseUpdate:x,shared:l.shared,callbacks:l.callbacks},t.updateQueue=s;return}t=s.lastBaseUpdate,t===null?s.firstBaseUpdate=i:t.next=i,s.lastBaseUpdate=i}var id=!1;function Io(){if(id){var t=wa;if(t!==null)throw t}}function Po(t,i,s,l){id=!1;var b=t.updateQueue;Zr=!1;var x=b.firstBaseUpdate,N=b.lastBaseUpdate,U=b.shared.pending;if(U!==null){b.shared.pending=null;var ee=U,oe=ee.next;ee.next=null,N===null?x=oe:N.next=oe,N=ee;var de=t.alternate;de!==null&&(de=de.updateQueue,U=de.lastBaseUpdate,U!==N&&(U===null?de.firstBaseUpdate=oe:U.next=oe,de.lastBaseUpdate=ee))}if(x!==null){var me=b.baseState;N=0,de=oe=ee=null,U=x;do{var ce=U.lane&-536870913,ue=ce!==U.lane;if(ue?(rt&ce)===ce:(l&ce)===ce){ce!==0&&ce===Sa&&(id=!0),de!==null&&(de=de.next={lane:0,tag:U.tag,payload:U.payload,callback:null,next:null});e:{var Ae=t,ze=U;ce=i;var At=s;switch(ze.tag){case 1:if(Ae=ze.payload,typeof Ae=="function"){me=Ae.call(At,me,ce);break e}me=Ae;break e;case 3:Ae.flags=Ae.flags&-65537|128;case 0:if(Ae=ze.payload,ce=typeof Ae=="function"?Ae.call(At,me,ce):Ae,ce==null)break e;me=m({},me,ce);break e;case 2:Zr=!0}}ce=U.callback,ce!==null&&(t.flags|=64,ue&&(t.flags|=8192),ue=b.callbacks,ue===null?b.callbacks=[ce]:ue.push(ce))}else ue={lane:ce,tag:U.tag,payload:U.payload,callback:U.callback,next:null},de===null?(oe=de=ue,ee=me):de=de.next=ue,N|=ce;if(U=U.next,U===null){if(U=b.shared.pending,U===null)break;ue=U,U=ue.next,ue.next=null,b.lastBaseUpdate=ue,b.shared.pending=null}}while(!0);de===null&&(ee=me),b.baseState=ee,b.firstBaseUpdate=oe,b.lastBaseUpdate=de,x===null&&(b.shared.lanes=0),rs|=N,t.lanes=N,t.memoizedState=me}}function w_(t,i){if(typeof t!="function")throw Error(a(191,t));t.call(i)}function x_(t,i){var s=t.callbacks;if(s!==null)for(t.callbacks=null,t=0;t<s.length;t++)w_(s[t],i)}var Ea=O(null),wc=O(0);function C_(t,i){t=Tr,W(wc,t),W(Ea,i),Tr=t|i.baseLanes}function rd(){W(wc,Tr),W(Ea,Ea.current)}function sd(){Tr=wc.current,P(Ea),P(wc)}var fi=O(null),Ri=null;function es(t){var i=t.alternate;W(ln,ln.current&1),W(fi,t),Ri===null&&(i===null||Ea.current!==null||i.memoizedState!==null)&&(Ri=t)}function ad(t){W(ln,ln.current),W(fi,t),Ri===null&&(Ri=t)}function E_(t){t.tag===22?(W(ln,ln.current),W(fi,t),Ri===null&&(Ri=t)):ts()}function ts(){W(ln,ln.current),W(fi,fi.current)}function pi(t){P(fi),Ri===t&&(Ri=null),P(ln)}var ln=O(0);function xc(t){for(var i=t;i!==null;){if(i.tag===13){var s=i.memoizedState;if(s!==null&&(s=s.dehydrated,s===null||ff(s)||pf(s)))return i}else if(i.tag===19&&(i.memoizedProps.revealOrder==="forwards"||i.memoizedProps.revealOrder==="backwards"||i.memoizedProps.revealOrder==="unstable_legacy-backwards"||i.memoizedProps.revealOrder==="together")){if((i.flags&128)!==0)return i}else if(i.child!==null){i.child.return=i,i=i.child;continue}if(i===t)break;for(;i.sibling===null;){if(i.return===null||i.return===t)return null;i=i.return}i.sibling.return=i.return,i=i.sibling}return null}var yr=0,qe=null,Et=null,fn=null,Cc=!1,ka=!1,$s=!1,Ec=0,zo=0,Aa=null,G2=0;function en(){throw Error(a(321))}function od(t,i){if(i===null)return!1;for(var s=0;s<i.length&&s<t.length;s++)if(!hi(t[s],i[s]))return!1;return!0}function ld(t,i,s,l,b,x){return yr=x,qe=i,i.memoizedState=null,i.updateQueue=null,i.lanes=0,z.H=t===null||t.memoizedState===null?lv:xd,$s=!1,x=s(l,b),$s=!1,ka&&(x=A_(i,s,l,b)),k_(t),x}function k_(t){z.H=Uo;var i=Et!==null&&Et.next!==null;if(yr=0,fn=Et=qe=null,Cc=!1,zo=0,Aa=null,i)throw Error(a(300));t===null||pn||(t=t.dependencies,t!==null&&gc(t)&&(pn=!0))}function A_(t,i,s,l){qe=t;var b=0;do{if(ka&&(Aa=null),zo=0,ka=!1,25<=b)throw Error(a(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=cv,x=i(s,l)}while(ka);return x}function q2(){var t=z.H,i=t.useState()[0];return i=typeof i.then=="function"?Ho(i):i,t=t.useState()[0],(Et!==null?Et.memoizedState:null)!==t&&(qe.flags|=1024),i}function cd(){var t=Ec!==0;return Ec=0,t}function ud(t,i,s){i.updateQueue=t.updateQueue,i.flags&=-2053,t.lanes&=~s}function hd(t){if(Cc){for(t=t.memoizedState;t!==null;){var i=t.queue;i!==null&&(i.pending=null),t=t.next}Cc=!1}yr=0,fn=Et=qe=null,ka=!1,zo=Ec=0,Aa=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 i=fn===null?qe.memoizedState:fn.next;if(i!==null)fn=i,Et=t;else{if(t===null)throw qe.alternate===null?Error(a(467)):Error(a(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 kc(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Ho(t){var i=zo;return zo+=1,Aa===null&&(Aa=[]),t=__(Aa,t,i),i=qe,(fn===null?i.memoizedState:fn.next)===null&&(i=i.alternate,z.H=i===null||i.memoizedState===null?lv:xd),t}function Ac(t){if(t!==null&&typeof t=="object"){if(typeof t.then=="function")return Ho(t);if(t.$$typeof===S)return Nn(t)}throw Error(a(438,String(t)))}function dd(t){var i=null,s=qe.updateQueue;if(s!==null&&(i=s.memoCache),i==null){var l=qe.alternate;l!==null&&(l=l.updateQueue,l!==null&&(l=l.memoCache,l!=null&&(i={data:l.data.map(function(b){return b.slice()}),index:0})))}if(i==null&&(i={data:[],index:0}),s===null&&(s=kc(),qe.updateQueue=s),s.memoCache=i,s=i.data[i.index],s===void 0)for(s=i.data[i.index]=Array(t),l=0;l<t;l++)s[l]=K;return i.index++,s}function Sr(t,i){return typeof i=="function"?i(t):i}function Tc(t){var i=cn();return fd(i,Et,t)}function fd(t,i,s){var l=t.queue;if(l===null)throw Error(a(311));l.lastRenderedReducer=s;var b=t.baseQueue,x=l.pending;if(x!==null){if(b!==null){var N=b.next;b.next=x.next,x.next=N}i.baseQueue=b=x,l.pending=null}if(x=t.baseState,b===null)t.memoizedState=x;else{i=b.next;var U=N=null,ee=null,oe=i,de=!1;do{var me=oe.lane&-536870913;if(me!==oe.lane?(rt&me)===me:(yr&me)===me){var ce=oe.revertLane;if(ce===0)ee!==null&&(ee=ee.next={lane:0,revertLane:0,gesture:null,action:oe.action,hasEagerState:oe.hasEagerState,eagerState:oe.eagerState,next:null}),me===Sa&&(de=!0);else if((yr&ce)===ce){oe=oe.next,ce===Sa&&(de=!0);continue}else me={lane:0,revertLane:oe.revertLane,gesture:null,action:oe.action,hasEagerState:oe.hasEagerState,eagerState:oe.eagerState,next:null},ee===null?(U=ee=me,N=x):ee=ee.next=me,qe.lanes|=ce,rs|=ce;me=oe.action,$s&&s(x,me),x=oe.hasEagerState?oe.eagerState:s(x,me)}else ce={lane:me,revertLane:oe.revertLane,gesture:oe.gesture,action:oe.action,hasEagerState:oe.hasEagerState,eagerState:oe.eagerState,next:null},ee===null?(U=ee=ce,N=x):ee=ee.next=ce,qe.lanes|=me,rs|=me;oe=oe.next}while(oe!==null&&oe!==i);if(ee===null?N=x:ee.next=U,!hi(x,t.memoizedState)&&(pn=!0,de&&(s=wa,s!==null)))throw s;t.memoizedState=x,t.baseState=N,t.baseQueue=ee,l.lastRenderedState=x}return b===null&&(l.lanes=0),[t.memoizedState,l.dispatch]}function pd(t){var i=cn(),s=i.queue;if(s===null)throw Error(a(311));s.lastRenderedReducer=t;var l=s.dispatch,b=s.pending,x=i.memoizedState;if(b!==null){s.pending=null;var N=b=b.next;do x=t(x,N.action),N=N.next;while(N!==b);hi(x,i.memoizedState)||(pn=!0),i.memoizedState=x,i.baseQueue===null&&(i.baseState=x),s.lastRenderedState=x}return[x,l]}function T_(t,i,s){var l=qe,b=cn(),x=lt;if(x){if(s===void 0)throw Error(a(407));s=s()}else s=i();var N=!hi((Et||b).memoizedState,s);if(N&&(b.memoizedState=s,pn=!0),b=b.queue,_d(M_.bind(null,l,b,t),[t]),b.getSnapshot!==i||N||fn!==null&&fn.memoizedState.tag&1){if(l.flags|=2048,Ta(9,{destroy:void 0},L_.bind(null,l,b,s,i),null),Mt===null)throw Error(a(349));x||(yr&127)!==0||R_(l,i,s)}return s}function R_(t,i,s){t.flags|=16384,t={getSnapshot:i,value:s},i=qe.updateQueue,i===null?(i=kc(),qe.updateQueue=i,i.stores=[t]):(s=i.stores,s===null?i.stores=[t]:s.push(t))}function L_(t,i,s,l){i.value=s,i.getSnapshot=l,N_(i)&&O_(t)}function M_(t,i,s){return s(function(){N_(i)&&O_(t)})}function N_(t){var i=t.getSnapshot;t=t.value;try{var s=i();return!hi(t,s)}catch{return!0}}function O_(t){var i=Ns(t,2);i!==null&&si(i,t,2)}function gd(t){var i=Fn();if(typeof t=="function"){var s=t;if(t=s(),$s){$e(!0);try{s()}finally{$e(!1)}}}return i.memoizedState=i.baseState=t,i.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Sr,lastRenderedState:t},i}function D_(t,i,s,l){return t.baseState=s,fd(t,Et,typeof l=="function"?l:Sr)}function K2(t,i,s,l,b){if(Mc(t))throw Error(a(485));if(t=i.action,t!==null){var x={payload:b,action:t,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(N){x.listeners.push(N)}};z.T!==null?s(!0):x.isTransition=!1,l(x),s=i.pending,s===null?(x.next=i.pending=x,B_(i,x)):(x.next=s.next,i.pending=s.next=x)}}function B_(t,i){var s=i.action,l=i.payload,b=t.state;if(i.isTransition){var x=z.T,N={};z.T=N;try{var U=s(b,l),ee=z.S;ee!==null&&ee(N,U),j_(t,i,U)}catch(oe){md(t,i,oe)}finally{x!==null&&N.types!==null&&(x.types=N.types),z.T=x}}else try{x=s(b,l),j_(t,i,x)}catch(oe){md(t,i,oe)}}function j_(t,i,s){s!==null&&typeof s=="object"&&typeof s.then=="function"?s.then(function(l){I_(t,i,l)},function(l){return md(t,i,l)}):I_(t,i,s)}function I_(t,i,s){i.status="fulfilled",i.value=s,P_(i),t.state=s,i=t.pending,i!==null&&(s=i.next,s===i?t.pending=null:(s=s.next,i.next=s,B_(t,s)))}function md(t,i,s){var l=t.pending;if(t.pending=null,l!==null){l=l.next;do i.status="rejected",i.reason=s,P_(i),i=i.next;while(i!==l)}t.action=null}function P_(t){t=t.listeners;for(var i=0;i<t.length;i++)(0,t[i])()}function z_(t,i){return i}function H_(t,i){if(lt){var s=Mt.formState;if(s!==null){e:{var l=qe;if(lt){if(Pt){t:{for(var b=Pt,x=Ti;b.nodeType!==8;){if(!x){b=null;break t}if(b=Li(b.nextSibling),b===null){b=null;break t}}x=b.data,b=x==="F!"||x==="F"?b:null}if(b){Pt=Li(b.nextSibling),l=b.data==="F!";break e}}Yr(l)}l=!1}l&&(i=s[0])}}return s=Fn(),s.memoizedState=s.baseState=i,l={pending:null,lanes:0,dispatch:null,lastRenderedReducer:z_,lastRenderedState:i},s.queue=l,s=sv.bind(null,qe,l),l.dispatch=s,l=gd(!1),x=wd.bind(null,qe,!1,l.queue),l=Fn(),b={state:i,dispatch:null,action:t,pending:null},l.queue=b,s=K2.bind(null,qe,b,x,s),b.dispatch=s,l.memoizedState=t,[i,s,!1]}function $_(t){var i=cn();return U_(i,Et,t)}function U_(t,i,s){if(i=fd(t,i,z_)[0],t=Tc(Sr)[0],typeof i=="object"&&i!==null&&typeof i.then=="function")try{var l=Ho(i)}catch(N){throw N===xa?vc:N}else l=i;i=cn();var b=i.queue,x=b.dispatch;return s!==i.memoizedState&&(qe.flags|=2048,Ta(9,{destroy:void 0},V2.bind(null,b,s),null)),[l,x,t]}function V2(t,i){t.action=i}function F_(t){var i=cn(),s=Et;if(s!==null)return U_(i,s,t);cn(),i=i.memoizedState,s=cn();var l=s.queue.dispatch;return s.memoizedState=t,[i,l,!1]}function Ta(t,i,s,l){return t={tag:t,create:s,deps:l,inst:i,next:null},i=qe.updateQueue,i===null&&(i=kc(),qe.updateQueue=i),s=i.lastEffect,s===null?i.lastEffect=t.next=t:(l=s.next,s.next=t,t.next=l,i.lastEffect=t),t}function W_(){return cn().memoizedState}function Rc(t,i,s,l){var b=Fn();qe.flags|=t,b.memoizedState=Ta(1|i,{destroy:void 0},s,l===void 0?null:l)}function Lc(t,i,s,l){var b=cn();l=l===void 0?null:l;var x=b.memoizedState.inst;Et!==null&&l!==null&&od(l,Et.memoizedState.deps)?b.memoizedState=Ta(i,x,s,l):(qe.flags|=t,b.memoizedState=Ta(1|i,x,s,l))}function G_(t,i){Rc(8390656,8,t,i)}function _d(t,i){Lc(2048,8,t,i)}function Y2(t){qe.flags|=4;var i=qe.updateQueue;if(i===null)i=kc(),qe.updateQueue=i,i.events=[t];else{var s=i.events;s===null?i.events=[t]:s.push(t)}}function q_(t){var i=cn().memoizedState;return Y2({ref:i,nextImpl:t}),function(){if((_t&2)!==0)throw Error(a(440));return i.impl.apply(void 0,arguments)}}function K_(t,i){return Lc(4,2,t,i)}function V_(t,i){return Lc(4,4,t,i)}function Y_(t,i){if(typeof i=="function"){t=t();var s=i(t);return function(){typeof s=="function"?s():i(null)}}if(i!=null)return t=t(),i.current=t,function(){i.current=null}}function X_(t,i,s){s=s!=null?s.concat([t]):null,Lc(4,4,Y_.bind(null,i,t),s)}function vd(){}function Z_(t,i){var s=cn();i=i===void 0?null:i;var l=s.memoizedState;return i!==null&&od(i,l[1])?l[0]:(s.memoizedState=[t,i],t)}function J_(t,i){var s=cn();i=i===void 0?null:i;var l=s.memoizedState;if(i!==null&&od(i,l[1]))return l[0];if(l=t(),$s){$e(!0);try{t()}finally{$e(!1)}}return s.memoizedState=[l,i],l}function bd(t,i,s){return s===void 0||(yr&1073741824)!==0&&(rt&261930)===0?t.memoizedState=i:(t.memoizedState=s,t=Qv(),qe.lanes|=t,rs|=t,s)}function Q_(t,i,s,l){return hi(s,i)?s:Ea.current!==null?(t=bd(t,s,l),hi(t,i)||(pn=!0),t):(yr&42)===0||(yr&1073741824)!==0&&(rt&261930)===0?(pn=!0,t.memoizedState=s):(t=Qv(),qe.lanes|=t,rs|=t,i)}function ev(t,i,s,l,b){var x=q.p;q.p=x!==0&&8>x?x:8;var N=z.T,U={};z.T=U,wd(t,!1,i,s);try{var ee=b(),oe=z.S;if(oe!==null&&oe(U,ee),ee!==null&&typeof ee=="object"&&typeof ee.then=="function"){var de=W2(ee,l);$o(t,i,de,_i(t))}else $o(t,i,l,_i(t))}catch(me){$o(t,i,{then:function(){},status:"rejected",reason:me},_i())}finally{q.p=x,N!==null&&U.types!==null&&(N.types=U.types),z.T=N}}function X2(){}function yd(t,i,s,l){if(t.tag!==5)throw Error(a(476));var b=tv(t).queue;ev(t,b,i,V,s===null?X2:function(){return nv(t),s(l)})}function tv(t){var i=t.memoizedState;if(i!==null)return i;i={memoizedState:V,baseState:V,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Sr,lastRenderedState:V},next:null};var s={};return i.next={memoizedState:s,baseState:s,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Sr,lastRenderedState:s},next:null},t.memoizedState=i,t=t.alternate,t!==null&&(t.memoizedState=i),i}function nv(t){var i=tv(t);i.next===null&&(i=t.alternate.memoizedState),$o(t,i.next.queue,{},_i())}function Sd(){return Nn(rl)}function iv(){return cn().memoizedState}function rv(){return cn().memoizedState}function Z2(t){for(var i=t.return;i!==null;){switch(i.tag){case 24:case 3:var s=_i();t=Jr(s);var l=Qr(i,t,s);l!==null&&(si(l,i,s),jo(l,i,s)),i={cache:Xh()},t.payload=i;return}i=i.return}}function J2(t,i,s){var l=_i();s={lane:l,revertLane:0,gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null},Mc(t)?av(i,s):(s=zh(t,i,s,l),s!==null&&(si(s,t,l),ov(s,i,l)))}function sv(t,i,s){var l=_i();$o(t,i,s,l)}function $o(t,i,s,l){var b={lane:l,revertLane:0,gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null};if(Mc(t))av(i,b);else{var x=t.alternate;if(t.lanes===0&&(x===null||x.lanes===0)&&(x=i.lastRenderedReducer,x!==null))try{var N=i.lastRenderedState,U=x(N,s);if(b.hasEagerState=!0,b.eagerState=U,hi(U,N))return hc(t,i,b,0),Mt===null&&uc(),!1}catch{}if(s=zh(t,i,b,l),s!==null)return si(s,t,l),ov(s,i,l),!0}return!1}function wd(t,i,s,l){if(l={lane:2,revertLane:ef(),gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},Mc(t)){if(i)throw Error(a(479))}else i=zh(t,s,l,2),i!==null&&si(i,t,2)}function Mc(t){var i=t.alternate;return t===qe||i!==null&&i===qe}function av(t,i){ka=Cc=!0;var s=t.pending;s===null?i.next=i:(i.next=s.next,s.next=i),t.pending=i}function ov(t,i,s){if((s&4194048)!==0){var l=i.lanes;l&=t.pendingLanes,s|=l,i.lanes=s,Pe(t,s)}}var Uo={readContext:Nn,use:Ac,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};Uo.useEffectEvent=en;var lv={readContext:Nn,use:Ac,useCallback:function(t,i){return Fn().memoizedState=[t,i===void 0?null:i],t},useContext:Nn,useEffect:G_,useImperativeHandle:function(t,i,s){s=s!=null?s.concat([t]):null,Rc(4194308,4,Y_.bind(null,i,t),s)},useLayoutEffect:function(t,i){return Rc(4194308,4,t,i)},useInsertionEffect:function(t,i){Rc(4,2,t,i)},useMemo:function(t,i){var s=Fn();i=i===void 0?null:i;var l=t();if($s){$e(!0);try{t()}finally{$e(!1)}}return s.memoizedState=[l,i],l},useReducer:function(t,i,s){var l=Fn();if(s!==void 0){var b=s(i);if($s){$e(!0);try{s(i)}finally{$e(!1)}}}else b=i;return l.memoizedState=l.baseState=b,t={pending:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:b},l.queue=t,t=t.dispatch=J2.bind(null,qe,t),[l.memoizedState,t]},useRef:function(t){var i=Fn();return t={current:t},i.memoizedState=t},useState:function(t){t=gd(t);var i=t.queue,s=sv.bind(null,qe,i);return i.dispatch=s,[t.memoizedState,s]},useDebugValue:vd,useDeferredValue:function(t,i){var s=Fn();return bd(s,t,i)},useTransition:function(){var t=gd(!1);return t=ev.bind(null,qe,t.queue,!0,!1),Fn().memoizedState=t,[!1,t]},useSyncExternalStore:function(t,i,s){var l=qe,b=Fn();if(lt){if(s===void 0)throw Error(a(407));s=s()}else{if(s=i(),Mt===null)throw Error(a(349));(rt&127)!==0||R_(l,i,s)}b.memoizedState=s;var x={value:s,getSnapshot:i};return b.queue=x,G_(M_.bind(null,l,x,t),[t]),l.flags|=2048,Ta(9,{destroy:void 0},L_.bind(null,l,x,s,i),null),s},useId:function(){var t=Fn(),i=Mt.identifierPrefix;if(lt){var s=tr,l=er;s=(l&~(1<<32-Ze(l)-1)).toString(32)+s,i="_"+i+"R_"+s,s=Ec++,0<s&&(i+="H"+s.toString(32)),i+="_"}else s=G2++,i="_"+i+"r_"+s.toString(32)+"_";return t.memoizedState=i},useHostTransitionStatus:Sd,useFormState:H_,useActionState:H_,useOptimistic:function(t){var i=Fn();i.memoizedState=i.baseState=t;var s={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return i.queue=s,i=wd.bind(null,qe,!0,s),s.dispatch=i,[t,i]},useMemoCache:dd,useCacheRefresh:function(){return Fn().memoizedState=Z2.bind(null,qe)},useEffectEvent:function(t){var i=Fn(),s={impl:t};return i.memoizedState=s,function(){if((_t&2)!==0)throw Error(a(440));return s.impl.apply(void 0,arguments)}}},xd={readContext:Nn,use:Ac,useCallback:Z_,useContext:Nn,useEffect:_d,useImperativeHandle:X_,useInsertionEffect:K_,useLayoutEffect:V_,useMemo:J_,useReducer:Tc,useRef:W_,useState:function(){return Tc(Sr)},useDebugValue:vd,useDeferredValue:function(t,i){var s=cn();return Q_(s,Et.memoizedState,t,i)},useTransition:function(){var t=Tc(Sr)[0],i=cn().memoizedState;return[typeof t=="boolean"?t:Ho(t),i]},useSyncExternalStore:T_,useId:iv,useHostTransitionStatus:Sd,useFormState:$_,useActionState:$_,useOptimistic:function(t,i){var s=cn();return D_(s,Et,t,i)},useMemoCache:dd,useCacheRefresh:rv};xd.useEffectEvent=q_;var cv={readContext:Nn,use:Ac,useCallback:Z_,useContext:Nn,useEffect:_d,useImperativeHandle:X_,useInsertionEffect:K_,useLayoutEffect:V_,useMemo:J_,useReducer:pd,useRef:W_,useState:function(){return pd(Sr)},useDebugValue:vd,useDeferredValue:function(t,i){var s=cn();return Et===null?bd(s,t,i):Q_(s,Et.memoizedState,t,i)},useTransition:function(){var t=pd(Sr)[0],i=cn().memoizedState;return[typeof t=="boolean"?t:Ho(t),i]},useSyncExternalStore:T_,useId:iv,useHostTransitionStatus:Sd,useFormState:F_,useActionState:F_,useOptimistic:function(t,i){var s=cn();return Et!==null?D_(s,Et,t,i):(s.baseState=t,[t,s.queue.dispatch])},useMemoCache:dd,useCacheRefresh:rv};cv.useEffectEvent=q_;function Cd(t,i,s,l){i=t.memoizedState,s=s(l,i),s=s==null?i:m({},i,s),t.memoizedState=s,t.lanes===0&&(t.updateQueue.baseState=s)}var Ed={enqueueSetState:function(t,i,s){t=t._reactInternals;var l=_i(),b=Jr(l);b.payload=i,s!=null&&(b.callback=s),i=Qr(t,b,l),i!==null&&(si(i,t,l),jo(i,t,l))},enqueueReplaceState:function(t,i,s){t=t._reactInternals;var l=_i(),b=Jr(l);b.tag=1,b.payload=i,s!=null&&(b.callback=s),i=Qr(t,b,l),i!==null&&(si(i,t,l),jo(i,t,l))},enqueueForceUpdate:function(t,i){t=t._reactInternals;var s=_i(),l=Jr(s);l.tag=2,i!=null&&(l.callback=i),i=Qr(t,l,s),i!==null&&(si(i,t,s),jo(i,t,s))}};function uv(t,i,s,l,b,x,N){return t=t.stateNode,typeof t.shouldComponentUpdate=="function"?t.shouldComponentUpdate(l,x,N):i.prototype&&i.prototype.isPureReactComponent?!To(s,l)||!To(b,x):!0}function hv(t,i,s,l){t=i.state,typeof i.componentWillReceiveProps=="function"&&i.componentWillReceiveProps(s,l),typeof i.UNSAFE_componentWillReceiveProps=="function"&&i.UNSAFE_componentWillReceiveProps(s,l),i.state!==t&&Ed.enqueueReplaceState(i,i.state,null)}function Us(t,i){var s=i;if("ref"in i){s={};for(var l in i)l!=="ref"&&(s[l]=i[l])}if(t=t.defaultProps){s===i&&(s=m({},s));for(var b in t)s[b]===void 0&&(s[b]=t[b])}return s}function dv(t){cc(t)}function fv(t){console.error(t)}function pv(t){cc(t)}function Nc(t,i){try{var s=t.onUncaughtError;s(i.value,{componentStack:i.stack})}catch(l){setTimeout(function(){throw l})}}function gv(t,i,s){try{var l=t.onCaughtError;l(s.value,{componentStack:s.stack,errorBoundary:i.tag===1?i.stateNode:null})}catch(b){setTimeout(function(){throw b})}}function kd(t,i,s){return s=Jr(s),s.tag=3,s.payload={element:null},s.callback=function(){Nc(t,i)},s}function mv(t){return t=Jr(t),t.tag=3,t}function _v(t,i,s,l){var b=s.type.getDerivedStateFromError;if(typeof b=="function"){var x=l.value;t.payload=function(){return b(x)},t.callback=function(){gv(i,s,l)}}var N=s.stateNode;N!==null&&typeof N.componentDidCatch=="function"&&(t.callback=function(){gv(i,s,l),typeof b!="function"&&(ss===null?ss=new Set([this]):ss.add(this));var U=l.stack;this.componentDidCatch(l.value,{componentStack:U!==null?U:""})})}function Q2(t,i,s,l,b){if(s.flags|=32768,l!==null&&typeof l=="object"&&typeof l.then=="function"){if(i=s.alternate,i!==null&&ya(i,s,b,!0),s=fi.current,s!==null){switch(s.tag){case 31:case 13:return Ri===null?Wc():s.alternate===null&&tn===0&&(tn=3),s.flags&=-257,s.flags|=65536,s.lanes=b,l===bc?s.flags|=16384:(i=s.updateQueue,i===null?s.updateQueue=new Set([l]):i.add(l),Zd(t,l,b)),!1;case 22:return s.flags|=65536,l===bc?s.flags|=16384:(i=s.updateQueue,i===null?(i={transitions:null,markerInstances:null,retryQueue:new Set([l])},s.updateQueue=i):(s=i.retryQueue,s===null?i.retryQueue=new Set([l]):s.add(l)),Zd(t,l,b)),!1}throw Error(a(435,s.tag))}return Zd(t,l,b),Wc(),!1}if(lt)return i=fi.current,i!==null?((i.flags&65536)===0&&(i.flags|=256),i.flags|=65536,i.lanes=b,l!==Gh&&(t=Error(a(422),{cause:l}),Mo(Ei(t,s)))):(l!==Gh&&(i=Error(a(423),{cause:l}),Mo(Ei(i,s))),t=t.current.alternate,t.flags|=65536,b&=-b,t.lanes|=b,l=Ei(l,s),b=kd(t.stateNode,l,b),nd(t,b),tn!==4&&(tn=2)),!1;var x=Error(a(520),{cause:l});if(x=Ei(x,s),Xo===null?Xo=[x]:Xo.push(x),tn!==4&&(tn=2),i===null)return!0;l=Ei(l,s),s=i;do{switch(s.tag){case 3:return s.flags|=65536,t=b&-b,s.lanes|=t,t=kd(s.stateNode,l,t),nd(s,t),!1;case 1:if(i=s.type,x=s.stateNode,(s.flags&128)===0&&(typeof i.getDerivedStateFromError=="function"||x!==null&&typeof x.componentDidCatch=="function"&&(ss===null||!ss.has(x))))return s.flags|=65536,b&=-b,s.lanes|=b,b=mv(b),_v(b,t,s,l),nd(s,b),!1}s=s.return}while(s!==null);return!1}var Ad=Error(a(461)),pn=!1;function On(t,i,s,l){i.child=t===null?S_(i,null,s,l):Hs(i,t.child,s,l)}function vv(t,i,s,l,b){s=s.render;var x=i.ref;if("ref"in l){var N={};for(var U in l)U!=="ref"&&(N[U]=l[U])}else N=l;return js(i),l=ld(t,i,s,N,x,b),U=cd(),t!==null&&!pn?(ud(t,i,b),wr(t,i,b)):(lt&&U&&Fh(i),i.flags|=1,On(t,i,l,b),i.child)}function bv(t,i,s,l,b){if(t===null){var x=s.type;return typeof x=="function"&&!Hh(x)&&x.defaultProps===void 0&&s.compare===null?(i.tag=15,i.type=x,yv(t,i,x,l,b)):(t=fc(s.type,null,l,i,i.mode,b),t.ref=i.ref,t.return=i,i.child=t)}if(x=t.child,!Bd(t,b)){var N=x.memoizedProps;if(s=s.compare,s=s!==null?s:To,s(N,l)&&t.ref===i.ref)return wr(t,i,b)}return i.flags|=1,t=mr(x,l),t.ref=i.ref,t.return=i,i.child=t}function yv(t,i,s,l,b){if(t!==null){var x=t.memoizedProps;if(To(x,l)&&t.ref===i.ref)if(pn=!1,i.pendingProps=l=x,Bd(t,b))(t.flags&131072)!==0&&(pn=!0);else return i.lanes=t.lanes,wr(t,i,b)}return Td(t,i,s,l,b)}function Sv(t,i,s,l){var b=l.children,x=t!==null?t.memoizedState:null;if(t===null&&i.stateNode===null&&(i.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),l.mode==="hidden"){if((i.flags&128)!==0){if(x=x!==null?x.baseLanes|s:s,t!==null){for(l=i.child=t.child,b=0;l!==null;)b=b|l.lanes|l.childLanes,l=l.sibling;l=b&~x}else l=0,i.child=null;return wv(t,i,x,s,l)}if((s&536870912)!==0)i.memoizedState={baseLanes:0,cachePool:null},t!==null&&_c(i,x!==null?x.cachePool:null),x!==null?C_(i,x):rd(),E_(i);else return l=i.lanes=536870912,wv(t,i,x!==null?x.baseLanes|s:s,s,l)}else x!==null?(_c(i,x.cachePool),C_(i,x),ts(),i.memoizedState=null):(t!==null&&_c(i,null),rd(),ts());return On(t,i,b,s),i.child}function Fo(t,i){return t!==null&&t.tag===22||i.stateNode!==null||(i.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),i.sibling}function wv(t,i,s,l,b){var x=Jh();return x=x===null?null:{parent:dn._currentValue,pool:x},i.memoizedState={baseLanes:s,cachePool:x},t!==null&&_c(i,null),rd(),E_(i),t!==null&&ya(t,i,l,!0),i.childLanes=b,null}function Oc(t,i){return i=Bc({mode:i.mode,children:i.children},t.mode),i.ref=t.ref,t.child=i,i.return=t,i}function xv(t,i,s){return Hs(i,t.child,null,s),t=Oc(i,i.pendingProps),t.flags|=2,pi(i),i.memoizedState=null,t}function eE(t,i,s){var l=i.pendingProps,b=(i.flags&128)!==0;if(i.flags&=-129,t===null){if(lt){if(l.mode==="hidden")return t=Oc(i,l),i.lanes=536870912,Fo(null,t);if(ad(i),(t=Pt)?(t=B0(t,Ti),t=t!==null&&t.data==="&"?t:null,t!==null&&(i.memoizedState={dehydrated:t,treeContext:Kr!==null?{id:er,overflow:tr}:null,retryLane:536870912,hydrationErrors:null},s=a_(t),s.return=i,i.child=s,Mn=i,Pt=null)):t=null,t===null)throw Yr(i);return i.lanes=536870912,null}return Oc(i,l)}var x=t.memoizedState;if(x!==null){var N=x.dehydrated;if(ad(i),b)if(i.flags&256)i.flags&=-257,i=xv(t,i,s);else if(i.memoizedState!==null)i.child=t.child,i.flags|=128,i=null;else throw Error(a(558));else if(pn||ya(t,i,s,!1),b=(s&t.childLanes)!==0,pn||b){if(l=Mt,l!==null&&(N=Vt(l,s),N!==0&&N!==x.retryLane))throw x.retryLane=N,Ns(t,N),si(l,t,N),Ad;Wc(),i=xv(t,i,s)}else t=x.treeContext,Pt=Li(N.nextSibling),Mn=i,lt=!0,Vr=null,Ti=!1,t!==null&&c_(i,t),i=Oc(i,l),i.flags|=4096;return i}return t=mr(t.child,{mode:l.mode,children:l.children}),t.ref=i.ref,i.child=t,t.return=i,t}function Dc(t,i){var s=i.ref;if(s===null)t!==null&&t.ref!==null&&(i.flags|=4194816);else{if(typeof s!="function"&&typeof s!="object")throw Error(a(284));(t===null||t.ref!==s)&&(i.flags|=4194816)}}function Td(t,i,s,l,b){return js(i),s=ld(t,i,s,l,void 0,b),l=cd(),t!==null&&!pn?(ud(t,i,b),wr(t,i,b)):(lt&&l&&Fh(i),i.flags|=1,On(t,i,s,b),i.child)}function Cv(t,i,s,l,b,x){return js(i),i.updateQueue=null,s=A_(i,l,s,b),k_(t),l=cd(),t!==null&&!pn?(ud(t,i,x),wr(t,i,x)):(lt&&l&&Fh(i),i.flags|=1,On(t,i,s,x),i.child)}function Ev(t,i,s,l,b){if(js(i),i.stateNode===null){var x=ma,N=s.contextType;typeof N=="object"&&N!==null&&(x=Nn(N)),x=new s(l,x),i.memoizedState=x.state!==null&&x.state!==void 0?x.state:null,x.updater=Ed,i.stateNode=x,x._reactInternals=i,x=i.stateNode,x.props=l,x.state=i.memoizedState,x.refs={},ed(i),N=s.contextType,x.context=typeof N=="object"&&N!==null?Nn(N):ma,x.state=i.memoizedState,N=s.getDerivedStateFromProps,typeof N=="function"&&(Cd(i,s,N,l),x.state=i.memoizedState),typeof s.getDerivedStateFromProps=="function"||typeof x.getSnapshotBeforeUpdate=="function"||typeof x.UNSAFE_componentWillMount!="function"&&typeof x.componentWillMount!="function"||(N=x.state,typeof x.componentWillMount=="function"&&x.componentWillMount(),typeof x.UNSAFE_componentWillMount=="function"&&x.UNSAFE_componentWillMount(),N!==x.state&&Ed.enqueueReplaceState(x,x.state,null),Po(i,l,x,b),Io(),x.state=i.memoizedState),typeof x.componentDidMount=="function"&&(i.flags|=4194308),l=!0}else if(t===null){x=i.stateNode;var U=i.memoizedProps,ee=Us(s,U);x.props=ee;var oe=x.context,de=s.contextType;N=ma,typeof de=="object"&&de!==null&&(N=Nn(de));var me=s.getDerivedStateFromProps;de=typeof me=="function"||typeof x.getSnapshotBeforeUpdate=="function",U=i.pendingProps!==U,de||typeof x.UNSAFE_componentWillReceiveProps!="function"&&typeof x.componentWillReceiveProps!="function"||(U||oe!==N)&&hv(i,x,l,N),Zr=!1;var ce=i.memoizedState;x.state=ce,Po(i,l,x,b),Io(),oe=i.memoizedState,U||ce!==oe||Zr?(typeof me=="function"&&(Cd(i,s,me,l),oe=i.memoizedState),(ee=Zr||uv(i,s,ee,l,ce,oe,N))?(de||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"&&(i.flags|=4194308)):(typeof x.componentDidMount=="function"&&(i.flags|=4194308),i.memoizedProps=l,i.memoizedState=oe),x.props=l,x.state=oe,x.context=N,l=ee):(typeof x.componentDidMount=="function"&&(i.flags|=4194308),l=!1)}else{x=i.stateNode,td(t,i),N=i.memoizedProps,de=Us(s,N),x.props=de,me=i.pendingProps,ce=x.context,oe=s.contextType,ee=ma,typeof oe=="object"&&oe!==null&&(ee=Nn(oe)),U=s.getDerivedStateFromProps,(oe=typeof U=="function"||typeof x.getSnapshotBeforeUpdate=="function")||typeof x.UNSAFE_componentWillReceiveProps!="function"&&typeof x.componentWillReceiveProps!="function"||(N!==me||ce!==ee)&&hv(i,x,l,ee),Zr=!1,ce=i.memoizedState,x.state=ce,Po(i,l,x,b),Io();var ue=i.memoizedState;N!==me||ce!==ue||Zr||t!==null&&t.dependencies!==null&&gc(t.dependencies)?(typeof U=="function"&&(Cd(i,s,U,l),ue=i.memoizedState),(de=Zr||uv(i,s,de,l,ce,ue,ee)||t!==null&&t.dependencies!==null&&gc(t.dependencies))?(oe||typeof x.UNSAFE_componentWillUpdate!="function"&&typeof x.componentWillUpdate!="function"||(typeof x.componentWillUpdate=="function"&&x.componentWillUpdate(l,ue,ee),typeof x.UNSAFE_componentWillUpdate=="function"&&x.UNSAFE_componentWillUpdate(l,ue,ee)),typeof x.componentDidUpdate=="function"&&(i.flags|=4),typeof x.getSnapshotBeforeUpdate=="function"&&(i.flags|=1024)):(typeof x.componentDidUpdate!="function"||N===t.memoizedProps&&ce===t.memoizedState||(i.flags|=4),typeof x.getSnapshotBeforeUpdate!="function"||N===t.memoizedProps&&ce===t.memoizedState||(i.flags|=1024),i.memoizedProps=l,i.memoizedState=ue),x.props=l,x.state=ue,x.context=ee,l=de):(typeof x.componentDidUpdate!="function"||N===t.memoizedProps&&ce===t.memoizedState||(i.flags|=4),typeof x.getSnapshotBeforeUpdate!="function"||N===t.memoizedProps&&ce===t.memoizedState||(i.flags|=1024),l=!1)}return x=l,Dc(t,i),l=(i.flags&128)!==0,x||l?(x=i.stateNode,s=l&&typeof s.getDerivedStateFromError!="function"?null:x.render(),i.flags|=1,t!==null&&l?(i.child=Hs(i,t.child,null,b),i.child=Hs(i,null,s,b)):On(t,i,s,b),i.memoizedState=x.state,t=i.child):t=wr(t,i,b),t}function kv(t,i,s,l){return Ds(),i.flags|=256,On(t,i,s,l),i.child}var Rd={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Ld(t){return{baseLanes:t,cachePool:g_()}}function Md(t,i,s){return t=t!==null?t.childLanes&~s:0,i&&(t|=mi),t}function Av(t,i,s){var l=i.pendingProps,b=!1,x=(i.flags&128)!==0,N;if((N=x)||(N=t!==null&&t.memoizedState===null?!1:(ln.current&2)!==0),N&&(b=!0,i.flags&=-129),N=(i.flags&32)!==0,i.flags&=-33,t===null){if(lt){if(b?es(i):ts(),(t=Pt)?(t=B0(t,Ti),t=t!==null&&t.data!=="&"?t:null,t!==null&&(i.memoizedState={dehydrated:t,treeContext:Kr!==null?{id:er,overflow:tr}:null,retryLane:536870912,hydrationErrors:null},s=a_(t),s.return=i,i.child=s,Mn=i,Pt=null)):t=null,t===null)throw Yr(i);return pf(t)?i.lanes=32:i.lanes=536870912,null}var U=l.children;return l=l.fallback,b?(ts(),b=i.mode,U=Bc({mode:"hidden",children:U},b),l=Os(l,b,s,null),U.return=i,l.return=i,U.sibling=l,i.child=U,l=i.child,l.memoizedState=Ld(s),l.childLanes=Md(t,N,s),i.memoizedState=Rd,Fo(null,l)):(es(i),Nd(i,U))}var ee=t.memoizedState;if(ee!==null&&(U=ee.dehydrated,U!==null)){if(x)i.flags&256?(es(i),i.flags&=-257,i=Od(t,i,s)):i.memoizedState!==null?(ts(),i.child=t.child,i.flags|=128,i=null):(ts(),U=l.fallback,b=i.mode,l=Bc({mode:"visible",children:l.children},b),U=Os(U,b,s,null),U.flags|=2,l.return=i,U.return=i,l.sibling=U,i.child=l,Hs(i,t.child,null,s),l=i.child,l.memoizedState=Ld(s),l.childLanes=Md(t,N,s),i.memoizedState=Rd,i=Fo(null,l));else if(es(i),pf(U)){if(N=U.nextSibling&&U.nextSibling.dataset,N)var oe=N.dgst;N=oe,l=Error(a(419)),l.stack="",l.digest=N,Mo({value:l,source:null,stack:null}),i=Od(t,i,s)}else if(pn||ya(t,i,s,!1),N=(s&t.childLanes)!==0,pn||N){if(N=Mt,N!==null&&(l=Vt(N,s),l!==0&&l!==ee.retryLane))throw ee.retryLane=l,Ns(t,l),si(N,t,l),Ad;ff(U)||Wc(),i=Od(t,i,s)}else ff(U)?(i.flags|=192,i.child=t.child,i=null):(t=ee.treeContext,Pt=Li(U.nextSibling),Mn=i,lt=!0,Vr=null,Ti=!1,t!==null&&c_(i,t),i=Nd(i,l.children),i.flags|=4096);return i}return b?(ts(),U=l.fallback,b=i.mode,ee=t.child,oe=ee.sibling,l=mr(ee,{mode:"hidden",children:l.children}),l.subtreeFlags=ee.subtreeFlags&65011712,oe!==null?U=mr(oe,U):(U=Os(U,b,s,null),U.flags|=2),U.return=i,l.return=i,l.sibling=U,i.child=l,Fo(null,l),l=i.child,U=t.child.memoizedState,U===null?U=Ld(s):(b=U.cachePool,b!==null?(ee=dn._currentValue,b=b.parent!==ee?{parent:ee,pool:ee}:b):b=g_(),U={baseLanes:U.baseLanes|s,cachePool:b}),l.memoizedState=U,l.childLanes=Md(t,N,s),i.memoizedState=Rd,Fo(t.child,l)):(es(i),s=t.child,t=s.sibling,s=mr(s,{mode:"visible",children:l.children}),s.return=i,s.sibling=null,t!==null&&(N=i.deletions,N===null?(i.deletions=[t],i.flags|=16):N.push(t)),i.child=s,i.memoizedState=null,s)}function Nd(t,i){return i=Bc({mode:"visible",children:i},t.mode),i.return=t,t.child=i}function Bc(t,i){return t=di(22,t,null,i),t.lanes=0,t}function Od(t,i,s){return Hs(i,t.child,null,s),t=Nd(i,i.pendingProps.children),t.flags|=2,i.memoizedState=null,t}function Tv(t,i,s){t.lanes|=i;var l=t.alternate;l!==null&&(l.lanes|=i),Vh(t.return,i,s)}function Dd(t,i,s,l,b,x){var N=t.memoizedState;N===null?t.memoizedState={isBackwards:i,rendering:null,renderingStartTime:0,last:l,tail:s,tailMode:b,treeForkCount:x}:(N.isBackwards=i,N.rendering=null,N.renderingStartTime=0,N.last=l,N.tail=s,N.tailMode=b,N.treeForkCount=x)}function Rv(t,i,s){var l=i.pendingProps,b=l.revealOrder,x=l.tail;l=l.children;var N=ln.current,U=(N&2)!==0;if(U?(N=N&1|2,i.flags|=128):N&=1,W(ln,N),On(t,i,l,s),l=lt?Lo:0,!U&&t!==null&&(t.flags&128)!==0)e:for(t=i.child;t!==null;){if(t.tag===13)t.memoizedState!==null&&Tv(t,s,i);else if(t.tag===19)Tv(t,s,i);else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===i)break e;for(;t.sibling===null;){if(t.return===null||t.return===i)break e;t=t.return}t.sibling.return=t.return,t=t.sibling}switch(b){case"forwards":for(s=i.child,b=null;s!==null;)t=s.alternate,t!==null&&xc(t)===null&&(b=s),s=s.sibling;s=b,s===null?(b=i.child,i.child=null):(b=s.sibling,s.sibling=null),Dd(i,!1,b,s,x,l);break;case"backwards":case"unstable_legacy-backwards":for(s=null,b=i.child,i.child=null;b!==null;){if(t=b.alternate,t!==null&&xc(t)===null){i.child=b;break}t=b.sibling,b.sibling=s,s=b,b=t}Dd(i,!0,s,null,x,l);break;case"together":Dd(i,!1,null,null,void 0,l);break;default:i.memoizedState=null}return i.child}function wr(t,i,s){if(t!==null&&(i.dependencies=t.dependencies),rs|=i.lanes,(s&i.childLanes)===0)if(t!==null){if(ya(t,i,s,!1),(s&i.childLanes)===0)return null}else return null;if(t!==null&&i.child!==t.child)throw Error(a(153));if(i.child!==null){for(t=i.child,s=mr(t,t.pendingProps),i.child=s,s.return=i;t.sibling!==null;)t=t.sibling,s=s.sibling=mr(t,t.pendingProps),s.return=i;s.sibling=null}return i.child}function Bd(t,i){return(t.lanes&i)!==0?!0:(t=t.dependencies,!!(t!==null&&gc(t)))}function tE(t,i,s){switch(i.tag){case 3:$(i,i.stateNode.containerInfo),Xr(i,dn,t.memoizedState.cache),Ds();break;case 27:case 5:ge(i);break;case 4:$(i,i.stateNode.containerInfo);break;case 10:Xr(i,i.type,i.memoizedProps.value);break;case 31:if(i.memoizedState!==null)return i.flags|=128,ad(i),null;break;case 13:var l=i.memoizedState;if(l!==null)return l.dehydrated!==null?(es(i),i.flags|=128,null):(s&i.child.childLanes)!==0?Av(t,i,s):(es(i),t=wr(t,i,s),t!==null?t.sibling:null);es(i);break;case 19:var b=(t.flags&128)!==0;if(l=(s&i.childLanes)!==0,l||(ya(t,i,s,!1),l=(s&i.childLanes)!==0),b){if(l)return Rv(t,i,s);i.flags|=128}if(b=i.memoizedState,b!==null&&(b.rendering=null,b.tail=null,b.lastEffect=null),W(ln,ln.current),l)break;return null;case 22:return i.lanes=0,Sv(t,i,s,i.pendingProps);case 24:Xr(i,dn,t.memoizedState.cache)}return wr(t,i,s)}function Lv(t,i,s){if(t!==null)if(t.memoizedProps!==i.pendingProps)pn=!0;else{if(!Bd(t,s)&&(i.flags&128)===0)return pn=!1,tE(t,i,s);pn=(t.flags&131072)!==0}else pn=!1,lt&&(i.flags&1048576)!==0&&l_(i,Lo,i.index);switch(i.lanes=0,i.tag){case 16:e:{var l=i.pendingProps;if(t=Ps(i.elementType),i.type=t,typeof t=="function")Hh(t)?(l=Us(t,l),i.tag=1,i=Ev(null,i,t,l,s)):(i.tag=0,i=Td(null,i,t,l,s));else{if(t!=null){var b=t.$$typeof;if(b===k){i.tag=11,i=vv(null,i,t,l,s);break e}else if(b===M){i.tag=14,i=bv(null,i,t,l,s);break e}}throw i=X(t)||t,Error(a(306,i,""))}}return i;case 0:return Td(t,i,i.type,i.pendingProps,s);case 1:return l=i.type,b=Us(l,i.pendingProps),Ev(t,i,l,b,s);case 3:e:{if($(i,i.stateNode.containerInfo),t===null)throw Error(a(387));l=i.pendingProps;var x=i.memoizedState;b=x.element,td(t,i),Po(i,l,null,s);var N=i.memoizedState;if(l=N.cache,Xr(i,dn,l),l!==x.cache&&Yh(i,[dn],s,!0),Io(),l=N.element,x.isDehydrated)if(x={element:l,isDehydrated:!1,cache:N.cache},i.updateQueue.baseState=x,i.memoizedState=x,i.flags&256){i=kv(t,i,l,s);break e}else if(l!==b){b=Ei(Error(a(424)),i),Mo(b),i=kv(t,i,l,s);break e}else for(t=i.stateNode.containerInfo,t.nodeType===9?t=t.body:t=t.nodeName==="HTML"?t.ownerDocument.body:t,Pt=Li(t.firstChild),Mn=i,lt=!0,Vr=null,Ti=!0,s=S_(i,null,l,s),i.child=s;s;)s.flags=s.flags&-3|4096,s=s.sibling;else{if(Ds(),l===b){i=wr(t,i,s);break e}On(t,i,l,s)}i=i.child}return i;case 26:return Dc(t,i),t===null?(s=$0(i.type,null,i.pendingProps,null))?i.memoizedState=s:lt||(s=i.type,t=i.pendingProps,l=Zc(he.current).createElement(s),l[jt]=i,l[Nt]=t,Dn(l,s,t),Je(l),i.stateNode=l):i.memoizedState=$0(i.type,t.memoizedProps,i.pendingProps,t.memoizedState),null;case 27:return ge(i),t===null&<&&(l=i.stateNode=P0(i.type,i.pendingProps,he.current),Mn=i,Ti=!0,b=Pt,cs(i.type)?(gf=b,Pt=Li(l.firstChild)):Pt=b),On(t,i,i.pendingProps.children,s),Dc(t,i),t===null&&(i.flags|=4194304),i.child;case 5:return t===null&<&&((b=l=Pt)&&(l=ME(l,i.type,i.pendingProps,Ti),l!==null?(i.stateNode=l,Mn=i,Pt=Li(l.firstChild),Ti=!1,b=!0):b=!1),b||Yr(i)),ge(i),b=i.type,x=i.pendingProps,N=t!==null?t.memoizedProps:null,l=x.children,uf(b,x)?l=null:N!==null&&uf(b,N)&&(i.flags|=32),i.memoizedState!==null&&(b=ld(t,i,q2,null,null,s),rl._currentValue=b),Dc(t,i),On(t,i,l,s),i.child;case 6:return t===null&<&&((t=s=Pt)&&(s=NE(s,i.pendingProps,Ti),s!==null?(i.stateNode=s,Mn=i,Pt=null,t=!0):t=!1),t||Yr(i)),null;case 13:return Av(t,i,s);case 4:return $(i,i.stateNode.containerInfo),l=i.pendingProps,t===null?i.child=Hs(i,null,l,s):On(t,i,l,s),i.child;case 11:return vv(t,i,i.type,i.pendingProps,s);case 7:return On(t,i,i.pendingProps,s),i.child;case 8:return On(t,i,i.pendingProps.children,s),i.child;case 12:return On(t,i,i.pendingProps.children,s),i.child;case 10:return l=i.pendingProps,Xr(i,i.type,l.value),On(t,i,l.children,s),i.child;case 9:return b=i.type._context,l=i.pendingProps.children,js(i),b=Nn(b),l=l(b),i.flags|=1,On(t,i,l,s),i.child;case 14:return bv(t,i,i.type,i.pendingProps,s);case 15:return yv(t,i,i.type,i.pendingProps,s);case 19:return Rv(t,i,s);case 31:return eE(t,i,s);case 22:return Sv(t,i,s,i.pendingProps);case 24:return js(i),l=Nn(dn),t===null?(b=Jh(),b===null&&(b=Mt,x=Xh(),b.pooledCache=x,x.refCount++,x!==null&&(b.pooledCacheLanes|=s),b=x),i.memoizedState={parent:l,cache:b},ed(i),Xr(i,dn,b)):((t.lanes&s)!==0&&(td(t,i),Po(i,null,null,s),Io()),b=t.memoizedState,x=i.memoizedState,b.parent!==l?(b={parent:l,cache:l},i.memoizedState=b,i.lanes===0&&(i.memoizedState=i.updateQueue.baseState=b),Xr(i,dn,l)):(l=x.cache,Xr(i,dn,l),l!==b.cache&&Yh(i,[dn],s,!0))),On(t,i,i.pendingProps.children,s),i.child;case 29:throw i.pendingProps}throw Error(a(156,i.tag))}function xr(t){t.flags|=4}function jd(t,i,s,l,b){if((i=(t.mode&32)!==0)&&(i=!1),i){if(t.flags|=16777216,(b&335544128)===b)if(t.stateNode.complete)t.flags|=8192;else if(i0())t.flags|=8192;else throw zs=bc,Qh}else t.flags&=-16777217}function Mv(t,i){if(i.type!=="stylesheet"||(i.state.loading&4)!==0)t.flags&=-16777217;else if(t.flags|=16777216,!q0(i))if(i0())t.flags|=8192;else throw zs=bc,Qh}function jc(t,i){i!==null&&(t.flags|=4),t.flags&16384&&(i=t.tag!==22?Oe():536870912,t.lanes|=i,Na|=i)}function Wo(t,i){if(!lt)switch(t.tailMode){case"hidden":i=t.tail;for(var s=null;i!==null;)i.alternate!==null&&(s=i),i=i.sibling;s===null?t.tail=null:s.sibling=null;break;case"collapsed":s=t.tail;for(var l=null;s!==null;)s.alternate!==null&&(l=s),s=s.sibling;l===null?i||t.tail===null?t.tail=null:t.tail.sibling=null:l.sibling=null}}function zt(t){var i=t.alternate!==null&&t.alternate.child===t.child,s=0,l=0;if(i)for(var b=t.child;b!==null;)s|=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;)s|=b.lanes|b.childLanes,l|=b.subtreeFlags,l|=b.flags,b.return=t,b=b.sibling;return t.subtreeFlags|=l,t.childLanes=s,i}function nE(t,i,s){var l=i.pendingProps;switch(Wh(i),i.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return zt(i),null;case 1:return zt(i),null;case 3:return s=i.stateNode,l=null,t!==null&&(l=t.memoizedState.cache),i.memoizedState.cache!==l&&(i.flags|=2048),br(dn),le(),s.pendingContext&&(s.context=s.pendingContext,s.pendingContext=null),(t===null||t.child===null)&&(ba(i)?xr(i):t===null||t.memoizedState.isDehydrated&&(i.flags&256)===0||(i.flags|=1024,qh())),zt(i),null;case 26:var b=i.type,x=i.memoizedState;return t===null?(xr(i),x!==null?(zt(i),Mv(i,x)):(zt(i),jd(i,b,null,l,s))):x?x!==t.memoizedState?(xr(i),zt(i),Mv(i,x)):(zt(i),i.flags&=-16777217):(t=t.memoizedProps,t!==l&&xr(i),zt(i),jd(i,b,t,l,s)),null;case 27:if(we(i),s=he.current,b=i.type,t!==null&&i.stateNode!=null)t.memoizedProps!==l&&xr(i);else{if(!l){if(i.stateNode===null)throw Error(a(166));return zt(i),null}t=Z.current,ba(i)?u_(i):(t=P0(b,l,s),i.stateNode=t,xr(i))}return zt(i),null;case 5:if(we(i),b=i.type,t!==null&&i.stateNode!=null)t.memoizedProps!==l&&xr(i);else{if(!l){if(i.stateNode===null)throw Error(a(166));return zt(i),null}if(x=Z.current,ba(i))u_(i);else{var N=Zc(he.current);switch(x){case 1:x=N.createElementNS("http://www.w3.org/2000/svg",b);break;case 2:x=N.createElementNS("http://www.w3.org/1998/Math/MathML",b);break;default:switch(b){case"svg":x=N.createElementNS("http://www.w3.org/2000/svg",b);break;case"math":x=N.createElementNS("http://www.w3.org/1998/Math/MathML",b);break;case"script":x=N.createElement("div"),x.innerHTML="<script><\/script>",x=x.removeChild(x.firstChild);break;case"select":x=typeof l.is=="string"?N.createElement("select",{is:l.is}):N.createElement("select"),l.multiple?x.multiple=!0:l.size&&(x.size=l.size);break;default:x=typeof l.is=="string"?N.createElement(b,{is:l.is}):N.createElement(b)}}x[jt]=i,x[Nt]=l;e:for(N=i.child;N!==null;){if(N.tag===5||N.tag===6)x.appendChild(N.stateNode);else if(N.tag!==4&&N.tag!==27&&N.child!==null){N.child.return=N,N=N.child;continue}if(N===i)break e;for(;N.sibling===null;){if(N.return===null||N.return===i)break e;N=N.return}N.sibling.return=N.return,N=N.sibling}i.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&&xr(i)}}return zt(i),jd(i,i.type,t===null?null:t.memoizedProps,i.pendingProps,s),null;case 6:if(t&&i.stateNode!=null)t.memoizedProps!==l&&xr(i);else{if(typeof l!="string"&&i.stateNode===null)throw Error(a(166));if(t=he.current,ba(i)){if(t=i.stateNode,s=i.memoizedProps,l=null,b=Mn,b!==null)switch(b.tag){case 27:case 5:l=b.memoizedProps}t[jt]=i,t=!!(t.nodeValue===s||l!==null&&l.suppressHydrationWarning===!0||A0(t.nodeValue,s)),t||Yr(i,!0)}else t=Zc(t).createTextNode(l),t[jt]=i,i.stateNode=t}return zt(i),null;case 31:if(s=i.memoizedState,t===null||t.memoizedState!==null){if(l=ba(i),s!==null){if(t===null){if(!l)throw Error(a(318));if(t=i.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(a(557));t[jt]=i}else Ds(),(i.flags&128)===0&&(i.memoizedState=null),i.flags|=4;zt(i),t=!1}else s=qh(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=s),t=!0;if(!t)return i.flags&256?(pi(i),i):(pi(i),null);if((i.flags&128)!==0)throw Error(a(558))}return zt(i),null;case 13:if(l=i.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(b=ba(i),l!==null&&l.dehydrated!==null){if(t===null){if(!b)throw Error(a(318));if(b=i.memoizedState,b=b!==null?b.dehydrated:null,!b)throw Error(a(317));b[jt]=i}else Ds(),(i.flags&128)===0&&(i.memoizedState=null),i.flags|=4;zt(i),b=!1}else b=qh(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=b),b=!0;if(!b)return i.flags&256?(pi(i),i):(pi(i),null)}return pi(i),(i.flags&128)!==0?(i.lanes=s,i):(s=l!==null,t=t!==null&&t.memoizedState!==null,s&&(l=i.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)),s!==t&&s&&(i.child.flags|=8192),jc(i,i.updateQueue),zt(i),null);case 4:return le(),t===null&&sf(i.stateNode.containerInfo),zt(i),null;case 10:return br(i.type),zt(i),null;case 19:if(P(ln),l=i.memoizedState,l===null)return zt(i),null;if(b=(i.flags&128)!==0,x=l.rendering,x===null)if(b)Wo(l,!1);else{if(tn!==0||t!==null&&(t.flags&128)!==0)for(t=i.child;t!==null;){if(x=xc(t),x!==null){for(i.flags|=128,Wo(l,!1),t=x.updateQueue,i.updateQueue=t,jc(i,t),i.subtreeFlags=0,t=s,s=i.child;s!==null;)s_(s,t),s=s.sibling;return W(ln,ln.current&1|2),lt&&_r(i,l.treeForkCount),i.child}t=t.sibling}l.tail!==null&&ut()>$c&&(i.flags|=128,b=!0,Wo(l,!1),i.lanes=4194304)}else{if(!b)if(t=xc(x),t!==null){if(i.flags|=128,b=!0,t=t.updateQueue,i.updateQueue=t,jc(i,t),Wo(l,!0),l.tail===null&&l.tailMode==="hidden"&&!x.alternate&&!lt)return zt(i),null}else 2*ut()-l.renderingStartTime>$c&&s!==536870912&&(i.flags|=128,b=!0,Wo(l,!1),i.lanes=4194304);l.isBackwards?(x.sibling=i.child,i.child=x):(t=l.last,t!==null?t.sibling=x:i.child=x,l.last=x)}return l.tail!==null?(t=l.tail,l.rendering=t,l.tail=t.sibling,l.renderingStartTime=ut(),t.sibling=null,s=ln.current,W(ln,b?s&1|2:s&1),lt&&_r(i,l.treeForkCount),t):(zt(i),null);case 22:case 23:return pi(i),sd(),l=i.memoizedState!==null,t!==null?t.memoizedState!==null!==l&&(i.flags|=8192):l&&(i.flags|=8192),l?(s&536870912)!==0&&(i.flags&128)===0&&(zt(i),i.subtreeFlags&6&&(i.flags|=8192)):zt(i),s=i.updateQueue,s!==null&&jc(i,s.retryQueue),s=null,t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(s=t.memoizedState.cachePool.pool),l=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(l=i.memoizedState.cachePool.pool),l!==s&&(i.flags|=2048),t!==null&&P(Is),null;case 24:return s=null,t!==null&&(s=t.memoizedState.cache),i.memoizedState.cache!==s&&(i.flags|=2048),br(dn),zt(i),null;case 25:return null;case 30:return null}throw Error(a(156,i.tag))}function iE(t,i){switch(Wh(i),i.tag){case 1:return t=i.flags,t&65536?(i.flags=t&-65537|128,i):null;case 3:return br(dn),le(),t=i.flags,(t&65536)!==0&&(t&128)===0?(i.flags=t&-65537|128,i):null;case 26:case 27:case 5:return we(i),null;case 31:if(i.memoizedState!==null){if(pi(i),i.alternate===null)throw Error(a(340));Ds()}return t=i.flags,t&65536?(i.flags=t&-65537|128,i):null;case 13:if(pi(i),t=i.memoizedState,t!==null&&t.dehydrated!==null){if(i.alternate===null)throw Error(a(340));Ds()}return t=i.flags,t&65536?(i.flags=t&-65537|128,i):null;case 19:return P(ln),null;case 4:return le(),null;case 10:return br(i.type),null;case 22:case 23:return pi(i),sd(),t!==null&&P(Is),t=i.flags,t&65536?(i.flags=t&-65537|128,i):null;case 24:return br(dn),null;case 25:return null;default:return null}}function Nv(t,i){switch(Wh(i),i.tag){case 3:br(dn),le();break;case 26:case 27:case 5:we(i);break;case 4:le();break;case 31:i.memoizedState!==null&&pi(i);break;case 13:pi(i);break;case 19:P(ln);break;case 10:br(i.type);break;case 22:case 23:pi(i),sd(),t!==null&&P(Is);break;case 24:br(dn)}}function Go(t,i){try{var s=i.updateQueue,l=s!==null?s.lastEffect:null;if(l!==null){var b=l.next;s=b;do{if((s.tag&t)===t){l=void 0;var x=s.create,N=s.inst;l=x(),N.destroy=l}s=s.next}while(s!==b)}}catch(U){wt(i,i.return,U)}}function ns(t,i,s){try{var l=i.updateQueue,b=l!==null?l.lastEffect:null;if(b!==null){var x=b.next;l=x;do{if((l.tag&t)===t){var N=l.inst,U=N.destroy;if(U!==void 0){N.destroy=void 0,b=i;var ee=s,oe=U;try{oe()}catch(de){wt(b,ee,de)}}}l=l.next}while(l!==x)}}catch(de){wt(i,i.return,de)}}function Ov(t){var i=t.updateQueue;if(i!==null){var s=t.stateNode;try{x_(i,s)}catch(l){wt(t,t.return,l)}}}function Dv(t,i,s){s.props=Us(t.type,t.memoizedProps),s.state=t.memoizedState;try{s.componentWillUnmount()}catch(l){wt(t,i,l)}}function qo(t,i){try{var s=t.ref;if(s!==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 s=="function"?t.refCleanup=s(l):s.current=l}}catch(b){wt(t,i,b)}}function nr(t,i){var s=t.ref,l=t.refCleanup;if(s!==null)if(typeof l=="function")try{l()}catch(b){wt(t,i,b)}finally{t.refCleanup=null,t=t.alternate,t!=null&&(t.refCleanup=null)}else if(typeof s=="function")try{s(null)}catch(b){wt(t,i,b)}else s.current=null}function Bv(t){var i=t.type,s=t.memoizedProps,l=t.stateNode;try{e:switch(i){case"button":case"input":case"select":case"textarea":s.autoFocus&&l.focus();break e;case"img":s.src?l.src=s.src:s.srcSet&&(l.srcset=s.srcSet)}}catch(b){wt(t,t.return,b)}}function Id(t,i,s){try{var l=t.stateNode;EE(l,t.type,s,i),l[Nt]=i}catch(b){wt(t,t.return,b)}}function jv(t){return t.tag===5||t.tag===3||t.tag===26||t.tag===27&&cs(t.type)||t.tag===4}function Pd(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||jv(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&&cs(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 zd(t,i,s){var l=t.tag;if(l===5||l===6)t=t.stateNode,i?(s.nodeType===9?s.body:s.nodeName==="HTML"?s.ownerDocument.body:s).insertBefore(t,i):(i=s.nodeType===9?s.body:s.nodeName==="HTML"?s.ownerDocument.body:s,i.appendChild(t),s=s._reactRootContainer,s!=null||i.onclick!==null||(i.onclick=xe));else if(l!==4&&(l===27&&cs(t.type)&&(s=t.stateNode,i=null),t=t.child,t!==null))for(zd(t,i,s),t=t.sibling;t!==null;)zd(t,i,s),t=t.sibling}function Ic(t,i,s){var l=t.tag;if(l===5||l===6)t=t.stateNode,i?s.insertBefore(t,i):s.appendChild(t);else if(l!==4&&(l===27&&cs(t.type)&&(s=t.stateNode),t=t.child,t!==null))for(Ic(t,i,s),t=t.sibling;t!==null;)Ic(t,i,s),t=t.sibling}function Iv(t){var i=t.stateNode,s=t.memoizedProps;try{for(var l=t.type,b=i.attributes;b.length;)i.removeAttributeNode(b[0]);Dn(i,l,s),i[jt]=t,i[Nt]=s}catch(x){wt(t,t.return,x)}}var Cr=!1,gn=!1,Hd=!1,Pv=typeof WeakSet=="function"?WeakSet:Set,Sn=null;function rE(t,i){if(t=t.containerInfo,lf=ru,t=Xm(t),Oh(t)){if("selectionStart"in t)var s={start:t.selectionStart,end:t.selectionEnd};else e:{s=(s=t.ownerDocument)&&s.defaultView||window;var l=s.getSelection&&s.getSelection();if(l&&l.rangeCount!==0){s=l.anchorNode;var b=l.anchorOffset,x=l.focusNode;l=l.focusOffset;try{s.nodeType,x.nodeType}catch{s=null;break e}var N=0,U=-1,ee=-1,oe=0,de=0,me=t,ce=null;t:for(;;){for(var ue;me!==s||b!==0&&me.nodeType!==3||(U=N+b),me!==x||l!==0&&me.nodeType!==3||(ee=N+l),me.nodeType===3&&(N+=me.nodeValue.length),(ue=me.firstChild)!==null;)ce=me,me=ue;for(;;){if(me===t)break t;if(ce===s&&++oe===b&&(U=N),ce===x&&++de===l&&(ee=N),(ue=me.nextSibling)!==null)break;me=ce,ce=me.parentNode}me=ue}s=U===-1||ee===-1?null:{start:U,end:ee}}else s=null}s=s||{start:0,end:0}}else s=null;for(cf={focusedElem:t,selectionRange:s},ru=!1,Sn=i;Sn!==null;)if(i=Sn,t=i.child,(i.subtreeFlags&1028)!==0&&t!==null)t.return=i,Sn=t;else for(;Sn!==null;){switch(i=Sn,x=i.alternate,t=i.flags,i.tag){case 0:if((t&4)!==0&&(t=i.updateQueue,t=t!==null?t.events:null,t!==null))for(s=0;s<t.length;s++)b=t[s],b.ref.impl=b.nextImpl;break;case 11:case 15:break;case 1:if((t&1024)!==0&&x!==null){t=void 0,s=i,b=x.memoizedProps,x=x.memoizedState,l=s.stateNode;try{var Ae=Us(s.type,b);t=l.getSnapshotBeforeUpdate(Ae,x),l.__reactInternalSnapshotBeforeUpdate=t}catch(ze){wt(s,s.return,ze)}}break;case 3:if((t&1024)!==0){if(t=i.stateNode.containerInfo,s=t.nodeType,s===9)df(t);else if(s===1)switch(t.nodeName){case"HEAD":case"HTML":case"BODY":df(t);break;default:t.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((t&1024)!==0)throw Error(a(163))}if(t=i.sibling,t!==null){t.return=i.return,Sn=t;break}Sn=i.return}}function zv(t,i,s){var l=s.flags;switch(s.tag){case 0:case 11:case 15:kr(t,s),l&4&&Go(5,s);break;case 1:if(kr(t,s),l&4)if(t=s.stateNode,i===null)try{t.componentDidMount()}catch(N){wt(s,s.return,N)}else{var b=Us(s.type,i.memoizedProps);i=i.memoizedState;try{t.componentDidUpdate(b,i,t.__reactInternalSnapshotBeforeUpdate)}catch(N){wt(s,s.return,N)}}l&64&&Ov(s),l&512&&qo(s,s.return);break;case 3:if(kr(t,s),l&64&&(t=s.updateQueue,t!==null)){if(i=null,s.child!==null)switch(s.child.tag){case 27:case 5:i=s.child.stateNode;break;case 1:i=s.child.stateNode}try{x_(t,i)}catch(N){wt(s,s.return,N)}}break;case 27:i===null&&l&4&&Iv(s);case 26:case 5:kr(t,s),i===null&&l&4&&Bv(s),l&512&&qo(s,s.return);break;case 12:kr(t,s);break;case 31:kr(t,s),l&4&&Uv(t,s);break;case 13:kr(t,s),l&4&&Fv(t,s),l&64&&(t=s.memoizedState,t!==null&&(t=t.dehydrated,t!==null&&(s=fE.bind(null,s),OE(t,s))));break;case 22:if(l=s.memoizedState!==null||Cr,!l){i=i!==null&&i.memoizedState!==null||gn,b=Cr;var x=gn;Cr=l,(gn=i)&&!x?Ar(t,s,(s.subtreeFlags&8772)!==0):kr(t,s),Cr=b,gn=x}break;case 30:break;default:kr(t,s)}}function Hv(t){var i=t.alternate;i!==null&&(t.alternate=null,Hv(i)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(i=t.stateNode,i!==null&&Ne(i)),t.stateNode=null,t.return=null,t.dependencies=null,t.memoizedProps=null,t.memoizedState=null,t.pendingProps=null,t.stateNode=null,t.updateQueue=null}var Gt=null,ti=!1;function Er(t,i,s){for(s=s.child;s!==null;)$v(t,i,s),s=s.sibling}function $v(t,i,s){if(ve&&typeof ve.onCommitFiberUnmount=="function")try{ve.onCommitFiberUnmount(An,s)}catch{}switch(s.tag){case 26:gn||nr(s,i),Er(t,i,s),s.memoizedState?s.memoizedState.count--:s.stateNode&&(s=s.stateNode,s.parentNode.removeChild(s));break;case 27:gn||nr(s,i);var l=Gt,b=ti;cs(s.type)&&(Gt=s.stateNode,ti=!1),Er(t,i,s),tl(s.stateNode),Gt=l,ti=b;break;case 5:gn||nr(s,i);case 6:if(l=Gt,b=ti,Gt=null,Er(t,i,s),Gt=l,ti=b,Gt!==null)if(ti)try{(Gt.nodeType===9?Gt.body:Gt.nodeName==="HTML"?Gt.ownerDocument.body:Gt).removeChild(s.stateNode)}catch(x){wt(s,i,x)}else try{Gt.removeChild(s.stateNode)}catch(x){wt(s,i,x)}break;case 18:Gt!==null&&(ti?(t=Gt,O0(t.nodeType===9?t.body:t.nodeName==="HTML"?t.ownerDocument.body:t,s.stateNode),Ha(t)):O0(Gt,s.stateNode));break;case 4:l=Gt,b=ti,Gt=s.stateNode.containerInfo,ti=!0,Er(t,i,s),Gt=l,ti=b;break;case 0:case 11:case 14:case 15:ns(2,s,i),gn||ns(4,s,i),Er(t,i,s);break;case 1:gn||(nr(s,i),l=s.stateNode,typeof l.componentWillUnmount=="function"&&Dv(s,i,l)),Er(t,i,s);break;case 21:Er(t,i,s);break;case 22:gn=(l=gn)||s.memoizedState!==null,Er(t,i,s),gn=l;break;default:Er(t,i,s)}}function Uv(t,i){if(i.memoizedState===null&&(t=i.alternate,t!==null&&(t=t.memoizedState,t!==null))){t=t.dehydrated;try{Ha(t)}catch(s){wt(i,i.return,s)}}}function Fv(t,i){if(i.memoizedState===null&&(t=i.alternate,t!==null&&(t=t.memoizedState,t!==null&&(t=t.dehydrated,t!==null))))try{Ha(t)}catch(s){wt(i,i.return,s)}}function sE(t){switch(t.tag){case 31:case 13:case 19:var i=t.stateNode;return i===null&&(i=t.stateNode=new Pv),i;case 22:return t=t.stateNode,i=t._retryCache,i===null&&(i=t._retryCache=new Pv),i;default:throw Error(a(435,t.tag))}}function Pc(t,i){var s=sE(t);i.forEach(function(l){if(!s.has(l)){s.add(l);var b=pE.bind(null,t,l);l.then(b,b)}})}function ni(t,i){var s=i.deletions;if(s!==null)for(var l=0;l<s.length;l++){var b=s[l],x=t,N=i,U=N;e:for(;U!==null;){switch(U.tag){case 27:if(cs(U.type)){Gt=U.stateNode,ti=!1;break e}break;case 5:Gt=U.stateNode,ti=!1;break e;case 3:case 4:Gt=U.stateNode.containerInfo,ti=!0;break e}U=U.return}if(Gt===null)throw Error(a(160));$v(x,N,b),Gt=null,ti=!1,x=b.alternate,x!==null&&(x.return=null),b.return=null}if(i.subtreeFlags&13886)for(i=i.child;i!==null;)Wv(i,t),i=i.sibling}var Wi=null;function Wv(t,i){var s=t.alternate,l=t.flags;switch(t.tag){case 0:case 11:case 14:case 15:ni(i,t),ii(t),l&4&&(ns(3,t,t.return),Go(3,t),ns(5,t,t.return));break;case 1:ni(i,t),ii(t),l&512&&(gn||s===null||nr(s,s.return)),l&64&&Cr&&(t=t.updateQueue,t!==null&&(l=t.callbacks,l!==null&&(s=t.shared.hiddenCallbacks,t.shared.hiddenCallbacks=s===null?l:s.concat(l))));break;case 26:var b=Wi;if(ni(i,t),ii(t),l&512&&(gn||s===null||nr(s,s.return)),l&4){var x=s!==null?s.memoizedState:null;if(l=t.memoizedState,s===null)if(l===null)if(t.stateNode===null){e:{l=t.type,s=t.memoizedProps,b=b.ownerDocument||b;t:switch(l){case"title":x=b.getElementsByTagName("title")[0],(!x||x[Qi]||x[jt]||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,s),x[jt]=t,Je(x),l=x;break e;case"link":var N=W0("link","href",b).get(l+(s.href||""));if(N){for(var U=0;U<N.length;U++)if(x=N[U],x.getAttribute("href")===(s.href==null||s.href===""?null:s.href)&&x.getAttribute("rel")===(s.rel==null?null:s.rel)&&x.getAttribute("title")===(s.title==null?null:s.title)&&x.getAttribute("crossorigin")===(s.crossOrigin==null?null:s.crossOrigin)){N.splice(U,1);break t}}x=b.createElement(l),Dn(x,l,s),b.head.appendChild(x);break;case"meta":if(N=W0("meta","content",b).get(l+(s.content||""))){for(U=0;U<N.length;U++)if(x=N[U],x.getAttribute("content")===(s.content==null?null:""+s.content)&&x.getAttribute("name")===(s.name==null?null:s.name)&&x.getAttribute("property")===(s.property==null?null:s.property)&&x.getAttribute("http-equiv")===(s.httpEquiv==null?null:s.httpEquiv)&&x.getAttribute("charset")===(s.charSet==null?null:s.charSet)){N.splice(U,1);break t}}x=b.createElement(l),Dn(x,l,s),b.head.appendChild(x);break;default:throw Error(a(468,l))}x[jt]=t,Je(x),l=x}t.stateNode=l}else G0(b,t.type,t.stateNode);else t.stateNode=F0(b,l,t.memoizedProps);else x!==l?(x===null?s.stateNode!==null&&(s=s.stateNode,s.parentNode.removeChild(s)):x.count--,l===null?G0(b,t.type,t.stateNode):F0(b,l,t.memoizedProps)):l===null&&t.stateNode!==null&&Id(t,t.memoizedProps,s.memoizedProps)}break;case 27:ni(i,t),ii(t),l&512&&(gn||s===null||nr(s,s.return)),s!==null&&l&4&&Id(t,t.memoizedProps,s.memoizedProps);break;case 5:if(ni(i,t),ii(t),l&512&&(gn||s===null||nr(s,s.return)),t.flags&32){b=t.stateNode;try{Ue(b,"")}catch(Ae){wt(t,t.return,Ae)}}l&4&&t.stateNode!=null&&(b=t.memoizedProps,Id(t,b,s!==null?s.memoizedProps:b)),l&1024&&(Hd=!0);break;case 6:if(ni(i,t),ii(t),l&4){if(t.stateNode===null)throw Error(a(162));l=t.memoizedProps,s=t.stateNode;try{s.nodeValue=l}catch(Ae){wt(t,t.return,Ae)}}break;case 3:if(eu=null,b=Wi,Wi=Jc(i.containerInfo),ni(i,t),Wi=b,ii(t),l&4&&s!==null&&s.memoizedState.isDehydrated)try{Ha(i.containerInfo)}catch(Ae){wt(t,t.return,Ae)}Hd&&(Hd=!1,Gv(t));break;case 4:l=Wi,Wi=Jc(t.stateNode.containerInfo),ni(i,t),ii(t),Wi=l;break;case 12:ni(i,t),ii(t);break;case 31:ni(i,t),ii(t),l&4&&(l=t.updateQueue,l!==null&&(t.updateQueue=null,Pc(t,l)));break;case 13:ni(i,t),ii(t),t.child.flags&8192&&t.memoizedState!==null!=(s!==null&&s.memoizedState!==null)&&(Hc=ut()),l&4&&(l=t.updateQueue,l!==null&&(t.updateQueue=null,Pc(t,l)));break;case 22:b=t.memoizedState!==null;var ee=s!==null&&s.memoizedState!==null,oe=Cr,de=gn;if(Cr=oe||b,gn=de||ee,ni(i,t),gn=de,Cr=oe,ii(t),l&8192)e:for(i=t.stateNode,i._visibility=b?i._visibility&-2:i._visibility|1,b&&(s===null||ee||Cr||gn||Fs(t)),s=null,i=t;;){if(i.tag===5||i.tag===26){if(s===null){ee=s=i;try{if(x=ee.stateNode,b)N=x.style,typeof N.setProperty=="function"?N.setProperty("display","none","important"):N.display="none";else{U=ee.stateNode;var me=ee.memoizedProps.style,ce=me!=null&&me.hasOwnProperty("display")?me.display:null;U.style.display=ce==null||typeof ce=="boolean"?"":(""+ce).trim()}}catch(Ae){wt(ee,ee.return,Ae)}}}else if(i.tag===6){if(s===null){ee=i;try{ee.stateNode.nodeValue=b?"":ee.memoizedProps}catch(Ae){wt(ee,ee.return,Ae)}}}else if(i.tag===18){if(s===null){ee=i;try{var ue=ee.stateNode;b?D0(ue,!0):D0(ee.stateNode,!1)}catch(Ae){wt(ee,ee.return,Ae)}}}else if((i.tag!==22&&i.tag!==23||i.memoizedState===null||i===t)&&i.child!==null){i.child.return=i,i=i.child;continue}if(i===t)break e;for(;i.sibling===null;){if(i.return===null||i.return===t)break e;s===i&&(s=null),i=i.return}s===i&&(s=null),i.sibling.return=i.return,i=i.sibling}l&4&&(l=t.updateQueue,l!==null&&(s=l.retryQueue,s!==null&&(l.retryQueue=null,Pc(t,s))));break;case 19:ni(i,t),ii(t),l&4&&(l=t.updateQueue,l!==null&&(t.updateQueue=null,Pc(t,l)));break;case 30:break;case 21:break;default:ni(i,t),ii(t)}}function ii(t){var i=t.flags;if(i&2){try{for(var s,l=t.return;l!==null;){if(jv(l)){s=l;break}l=l.return}if(s==null)throw Error(a(160));switch(s.tag){case 27:var b=s.stateNode,x=Pd(t);Ic(t,x,b);break;case 5:var N=s.stateNode;s.flags&32&&(Ue(N,""),s.flags&=-33);var U=Pd(t);Ic(t,U,N);break;case 3:case 4:var ee=s.stateNode.containerInfo,oe=Pd(t);zd(t,oe,ee);break;default:throw Error(a(161))}}catch(de){wt(t,t.return,de)}t.flags&=-3}i&4096&&(t.flags&=-4097)}function Gv(t){if(t.subtreeFlags&1024)for(t=t.child;t!==null;){var i=t;Gv(i),i.tag===5&&i.flags&1024&&i.stateNode.reset(),t=t.sibling}}function kr(t,i){if(i.subtreeFlags&8772)for(i=i.child;i!==null;)zv(t,i.alternate,i),i=i.sibling}function Fs(t){for(t=t.child;t!==null;){var i=t;switch(i.tag){case 0:case 11:case 14:case 15:ns(4,i,i.return),Fs(i);break;case 1:nr(i,i.return);var s=i.stateNode;typeof s.componentWillUnmount=="function"&&Dv(i,i.return,s),Fs(i);break;case 27:tl(i.stateNode);case 26:case 5:nr(i,i.return),Fs(i);break;case 22:i.memoizedState===null&&Fs(i);break;case 30:Fs(i);break;default:Fs(i)}t=t.sibling}}function Ar(t,i,s){for(s=s&&(i.subtreeFlags&8772)!==0,i=i.child;i!==null;){var l=i.alternate,b=t,x=i,N=x.flags;switch(x.tag){case 0:case 11:case 15:Ar(b,x,s),Go(4,x);break;case 1:if(Ar(b,x,s),l=x,b=l.stateNode,typeof b.componentDidMount=="function")try{b.componentDidMount()}catch(oe){wt(l,l.return,oe)}if(l=x,b=l.updateQueue,b!==null){var U=l.stateNode;try{var ee=b.shared.hiddenCallbacks;if(ee!==null)for(b.shared.hiddenCallbacks=null,b=0;b<ee.length;b++)w_(ee[b],U)}catch(oe){wt(l,l.return,oe)}}s&&N&64&&Ov(x),qo(x,x.return);break;case 27:Iv(x);case 26:case 5:Ar(b,x,s),s&&l===null&&N&4&&Bv(x),qo(x,x.return);break;case 12:Ar(b,x,s);break;case 31:Ar(b,x,s),s&&N&4&&Uv(b,x);break;case 13:Ar(b,x,s),s&&N&4&&Fv(b,x);break;case 22:x.memoizedState===null&&Ar(b,x,s),qo(x,x.return);break;case 30:break;default:Ar(b,x,s)}i=i.sibling}}function $d(t,i){var s=null;t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(s=t.memoizedState.cachePool.pool),t=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(t=i.memoizedState.cachePool.pool),t!==s&&(t!=null&&t.refCount++,s!=null&&No(s))}function Ud(t,i){t=null,i.alternate!==null&&(t=i.alternate.memoizedState.cache),i=i.memoizedState.cache,i!==t&&(i.refCount++,t!=null&&No(t))}function Gi(t,i,s,l){if(i.subtreeFlags&10256)for(i=i.child;i!==null;)qv(t,i,s,l),i=i.sibling}function qv(t,i,s,l){var b=i.flags;switch(i.tag){case 0:case 11:case 15:Gi(t,i,s,l),b&2048&&Go(9,i);break;case 1:Gi(t,i,s,l);break;case 3:Gi(t,i,s,l),b&2048&&(t=null,i.alternate!==null&&(t=i.alternate.memoizedState.cache),i=i.memoizedState.cache,i!==t&&(i.refCount++,t!=null&&No(t)));break;case 12:if(b&2048){Gi(t,i,s,l),t=i.stateNode;try{var x=i.memoizedProps,N=x.id,U=x.onPostCommit;typeof U=="function"&&U(N,i.alternate===null?"mount":"update",t.passiveEffectDuration,-0)}catch(ee){wt(i,i.return,ee)}}else Gi(t,i,s,l);break;case 31:Gi(t,i,s,l);break;case 13:Gi(t,i,s,l);break;case 23:break;case 22:x=i.stateNode,N=i.alternate,i.memoizedState!==null?x._visibility&2?Gi(t,i,s,l):Ko(t,i):x._visibility&2?Gi(t,i,s,l):(x._visibility|=2,Ra(t,i,s,l,(i.subtreeFlags&10256)!==0||!1)),b&2048&&$d(N,i);break;case 24:Gi(t,i,s,l),b&2048&&Ud(i.alternate,i);break;default:Gi(t,i,s,l)}}function Ra(t,i,s,l,b){for(b=b&&((i.subtreeFlags&10256)!==0||!1),i=i.child;i!==null;){var x=t,N=i,U=s,ee=l,oe=N.flags;switch(N.tag){case 0:case 11:case 15:Ra(x,N,U,ee,b),Go(8,N);break;case 23:break;case 22:var de=N.stateNode;N.memoizedState!==null?de._visibility&2?Ra(x,N,U,ee,b):Ko(x,N):(de._visibility|=2,Ra(x,N,U,ee,b)),b&&oe&2048&&$d(N.alternate,N);break;case 24:Ra(x,N,U,ee,b),b&&oe&2048&&Ud(N.alternate,N);break;default:Ra(x,N,U,ee,b)}i=i.sibling}}function Ko(t,i){if(i.subtreeFlags&10256)for(i=i.child;i!==null;){var s=t,l=i,b=l.flags;switch(l.tag){case 22:Ko(s,l),b&2048&&$d(l.alternate,l);break;case 24:Ko(s,l),b&2048&&Ud(l.alternate,l);break;default:Ko(s,l)}i=i.sibling}}var Vo=8192;function La(t,i,s){if(t.subtreeFlags&Vo)for(t=t.child;t!==null;)Kv(t,i,s),t=t.sibling}function Kv(t,i,s){switch(t.tag){case 26:La(t,i,s),t.flags&Vo&&t.memoizedState!==null&&GE(s,Wi,t.memoizedState,t.memoizedProps);break;case 5:La(t,i,s);break;case 3:case 4:var l=Wi;Wi=Jc(t.stateNode.containerInfo),La(t,i,s),Wi=l;break;case 22:t.memoizedState===null&&(l=t.alternate,l!==null&&l.memoizedState!==null?(l=Vo,Vo=16777216,La(t,i,s),Vo=l):La(t,i,s));break;default:La(t,i,s)}}function Vv(t){var i=t.alternate;if(i!==null&&(t=i.child,t!==null)){i.child=null;do i=t.sibling,t.sibling=null,t=i;while(t!==null)}}function Yo(t){var i=t.deletions;if((t.flags&16)!==0){if(i!==null)for(var s=0;s<i.length;s++){var l=i[s];Sn=l,Xv(l,t)}Vv(t)}if(t.subtreeFlags&10256)for(t=t.child;t!==null;)Yv(t),t=t.sibling}function Yv(t){switch(t.tag){case 0:case 11:case 15:Yo(t),t.flags&2048&&ns(9,t,t.return);break;case 3:Yo(t);break;case 12:Yo(t);break;case 22:var i=t.stateNode;t.memoizedState!==null&&i._visibility&2&&(t.return===null||t.return.tag!==13)?(i._visibility&=-3,zc(t)):Yo(t);break;default:Yo(t)}}function zc(t){var i=t.deletions;if((t.flags&16)!==0){if(i!==null)for(var s=0;s<i.length;s++){var l=i[s];Sn=l,Xv(l,t)}Vv(t)}for(t=t.child;t!==null;){switch(i=t,i.tag){case 0:case 11:case 15:ns(8,i,i.return),zc(i);break;case 22:s=i.stateNode,s._visibility&2&&(s._visibility&=-3,zc(i));break;default:zc(i)}t=t.sibling}}function Xv(t,i){for(;Sn!==null;){var s=Sn;switch(s.tag){case 0:case 11:case 15:ns(8,s,i);break;case 23:case 22:if(s.memoizedState!==null&&s.memoizedState.cachePool!==null){var l=s.memoizedState.cachePool.pool;l!=null&&l.refCount++}break;case 24:No(s.memoizedState.cache)}if(l=s.child,l!==null)l.return=s,Sn=l;else e:for(s=t;Sn!==null;){l=Sn;var b=l.sibling,x=l.return;if(Hv(l),l===s){Sn=null;break e}if(b!==null){b.return=x,Sn=b;break e}Sn=x}}}var aE={getCacheForType:function(t){var i=Nn(dn),s=i.data.get(t);return s===void 0&&(s=t(),i.data.set(t,s)),s},cacheSignal:function(){return Nn(dn).controller.signal}},oE=typeof WeakMap=="function"?WeakMap:Map,_t=0,Mt=null,Qe=null,rt=0,St=0,gi=null,is=!1,Ma=!1,Fd=!1,Tr=0,tn=0,rs=0,Ws=0,Wd=0,mi=0,Na=0,Xo=null,ri=null,Gd=!1,Hc=0,Zv=0,$c=1/0,Uc=null,ss=null,yn=0,as=null,Oa=null,Rr=0,qd=0,Kd=null,Jv=null,Zo=0,Vd=null;function _i(){return(_t&2)!==0&&rt!==0?rt&-rt:z.T!==null?ef():hr()}function Qv(){if(mi===0)if((rt&536870912)===0||lt){var t=Tn;Tn<<=1,(Tn&3932160)===0&&(Tn=262144),mi=t}else mi=536870912;return t=fi.current,t!==null&&(t.flags|=32),mi}function si(t,i,s){(t===Mt&&(St===2||St===9)||t.cancelPendingCommit!==null)&&(Da(t,0),os(t,rt,mi,!1)),ht(t,s),((_t&2)===0||t!==Mt)&&(t===Mt&&((_t&2)===0&&(Ws|=s),tn===4&&os(t,rt,mi,!1)),ir(t))}function e0(t,i,s){if((_t&6)!==0)throw Error(a(327));var l=!s&&(i&127)===0&&(i&t.expiredLanes)===0||fe(t,i),b=l?uE(t,i):Xd(t,i,!0),x=l;do{if(b===0){Ma&&!l&&os(t,i,0,!1);break}else{if(s=t.current.alternate,x&&!lE(s)){b=Xd(t,i,!1),x=!1;continue}if(b===2){if(x=i,t.errorRecoveryDisabledLanes&x)var N=0;else N=t.pendingLanes&-536870913,N=N!==0?N:N&536870912?536870912:0;if(N!==0){i=N;e:{var U=t;b=Xo;var ee=U.current.memoizedState.isDehydrated;if(ee&&(Da(U,N).flags|=256),N=Xd(U,N,!1),N!==2){if(Fd&&!ee){U.errorRecoveryDisabledLanes|=x,Ws|=x,b=4;break e}x=ri,ri=b,x!==null&&(ri===null?ri=x:ri.push.apply(ri,x))}b=N}if(x=!1,b!==2)continue}}if(b===1){Da(t,0),os(t,i,0,!0);break}e:{switch(l=t,x=b,x){case 0:case 1:throw Error(a(345));case 4:if((i&4194048)!==i)break;case 6:os(l,i,mi,!is);break e;case 2:ri=null;break;case 3:case 5:break;default:throw Error(a(329))}if((i&62914560)===i&&(b=Hc+300-ut(),10<b)){if(os(l,i,mi,!is),Q(l,0,!0)!==0)break e;Rr=i,l.timeoutHandle=M0(t0.bind(null,l,s,ri,Uc,Gd,i,mi,Ws,Na,is,x,"Throttled",-0,0),b);break e}t0(l,s,ri,Uc,Gd,i,mi,Ws,Na,is,x,null,-0,0)}}break}while(!0);ir(t)}function t0(t,i,s,l,b,x,N,U,ee,oe,de,me,ce,ue){if(t.timeoutHandle=-1,me=i.subtreeFlags,me&8192||(me&16785408)===16785408){me={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:xe},Kv(i,x,me);var Ae=(x&62914560)===x?Hc-ut():(x&4194048)===x?Zv-ut():0;if(Ae=qE(me,Ae),Ae!==null){Rr=x,t.cancelPendingCommit=Ae(c0.bind(null,t,i,x,s,l,b,N,U,ee,de,me,null,ce,ue)),os(t,x,N,!oe);return}}c0(t,i,x,s,l,b,N,U,ee)}function lE(t){for(var i=t;;){var s=i.tag;if((s===0||s===11||s===15)&&i.flags&16384&&(s=i.updateQueue,s!==null&&(s=s.stores,s!==null)))for(var l=0;l<s.length;l++){var b=s[l],x=b.getSnapshot;b=b.value;try{if(!hi(x(),b))return!1}catch{return!1}}if(s=i.child,i.subtreeFlags&16384&&s!==null)s.return=i,i=s;else{if(i===t)break;for(;i.sibling===null;){if(i.return===null||i.return===t)return!0;i=i.return}i.sibling.return=i.return,i=i.sibling}}return!0}function os(t,i,s,l){i&=~Wd,i&=~Ws,t.suspendedLanes|=i,t.pingedLanes&=~i,l&&(t.warmLanes|=i),l=t.expirationTimes;for(var b=i;0<b;){var x=31-Ze(b),N=1<<x;l[x]=-1,b&=~N}s!==0&&Ce(t,s,i)}function Fc(){return(_t&6)===0?(Jo(0),!1):!0}function Yd(){if(Qe!==null){if(St===0)var t=Qe.return;else t=Qe,vr=Bs=null,hd(t),Ca=null,Do=0,t=Qe;for(;t!==null;)Nv(t.alternate,t),t=t.return;Qe=null}}function Da(t,i){var s=t.timeoutHandle;s!==-1&&(t.timeoutHandle=-1,TE(s)),s=t.cancelPendingCommit,s!==null&&(t.cancelPendingCommit=null,s()),Rr=0,Yd(),Mt=t,Qe=s=mr(t.current,null),rt=i,St=0,gi=null,is=!1,Ma=fe(t,i),Fd=!1,Na=mi=Wd=Ws=rs=tn=0,ri=Xo=null,Gd=!1,(i&8)!==0&&(i|=i&32);var l=t.entangledLanes;if(l!==0)for(t=t.entanglements,l&=i;0<l;){var b=31-Ze(l),x=1<<b;i|=t[b],l&=~x}return Tr=i,uc(),s}function n0(t,i){qe=null,z.H=Uo,i===xa||i===vc?(i=v_(),St=3):i===Qh?(i=v_(),St=4):St=i===Ad?8:i!==null&&typeof i=="object"&&typeof i.then=="function"?6:1,gi=i,Qe===null&&(tn=1,Nc(t,Ei(i,t.current)))}function i0(){var t=fi.current;return t===null?!0:(rt&4194048)===rt?Ri===null:(rt&62914560)===rt||(rt&536870912)!==0?t===Ri:!1}function r0(){var t=z.H;return z.H=Uo,t===null?Uo:t}function s0(){var t=z.A;return z.A=aE,t}function Wc(){tn=4,is||(rt&4194048)!==rt&&fi.current!==null||(Ma=!0),(rs&134217727)===0&&(Ws&134217727)===0||Mt===null||os(Mt,rt,mi,!1)}function Xd(t,i,s){var l=_t;_t|=2;var b=r0(),x=s0();(Mt!==t||rt!==i)&&(Uc=null,Da(t,i)),i=!1;var N=tn;e:do try{if(St!==0&&Qe!==null){var U=Qe,ee=gi;switch(St){case 8:Yd(),N=6;break e;case 3:case 2:case 9:case 6:fi.current===null&&(i=!0);var oe=St;if(St=0,gi=null,Ba(t,U,ee,oe),s&&Ma){N=0;break e}break;default:oe=St,St=0,gi=null,Ba(t,U,ee,oe)}}cE(),N=tn;break}catch(de){n0(t,de)}while(!0);return i&&t.shellSuspendCounter++,vr=Bs=null,_t=l,z.H=b,z.A=x,Qe===null&&(Mt=null,rt=0,uc()),N}function cE(){for(;Qe!==null;)a0(Qe)}function uE(t,i){var s=_t;_t|=2;var l=r0(),b=s0();Mt!==t||rt!==i?(Uc=null,$c=ut()+500,Da(t,i)):Ma=fe(t,i);e:do try{if(St!==0&&Qe!==null){i=Qe;var x=gi;t:switch(St){case 1:St=0,gi=null,Ba(t,i,x,1);break;case 2:case 9:if(m_(x)){St=0,gi=null,o0(i);break}i=function(){St!==2&&St!==9||Mt!==t||(St=7),ir(t)},x.then(i,i);break e;case 3:St=7;break e;case 4:St=5;break e;case 7:m_(x)?(St=0,gi=null,o0(i)):(St=0,gi=null,Ba(t,i,x,7));break;case 5:var N=null;switch(Qe.tag){case 26:N=Qe.memoizedState;case 5:case 27:var U=Qe;if(N?q0(N):U.stateNode.complete){St=0,gi=null;var ee=U.sibling;if(ee!==null)Qe=ee;else{var oe=U.return;oe!==null?(Qe=oe,Gc(oe)):Qe=null}break t}}St=0,gi=null,Ba(t,i,x,5);break;case 6:St=0,gi=null,Ba(t,i,x,6);break;case 8:Yd(),tn=6;break e;default:throw Error(a(462))}}hE();break}catch(de){n0(t,de)}while(!0);return vr=Bs=null,z.H=l,z.A=b,_t=s,Qe!==null?0:(Mt=null,rt=0,uc(),tn)}function hE(){for(;Qe!==null&&!kn();)a0(Qe)}function a0(t){var i=Lv(t.alternate,t,Tr);t.memoizedProps=t.pendingProps,i===null?Gc(t):Qe=i}function o0(t){var i=t,s=i.alternate;switch(i.tag){case 15:case 0:i=Cv(s,i,i.pendingProps,i.type,void 0,rt);break;case 11:i=Cv(s,i,i.pendingProps,i.type.render,i.ref,rt);break;case 5:hd(i);default:Nv(s,i),i=Qe=s_(i,Tr),i=Lv(s,i,Tr)}t.memoizedProps=t.pendingProps,i===null?Gc(t):Qe=i}function Ba(t,i,s,l){vr=Bs=null,hd(i),Ca=null,Do=0;var b=i.return;try{if(Q2(t,b,i,s,rt)){tn=1,Nc(t,Ei(s,t.current)),Qe=null;return}}catch(x){if(b!==null)throw Qe=b,x;tn=1,Nc(t,Ei(s,t.current)),Qe=null;return}i.flags&32768?(lt||l===1?t=!0:Ma||(rt&536870912)!==0?t=!1:(is=t=!0,(l===2||l===9||l===3||l===6)&&(l=fi.current,l!==null&&l.tag===13&&(l.flags|=16384))),l0(i,t)):Gc(i)}function Gc(t){var i=t;do{if((i.flags&32768)!==0){l0(i,is);return}t=i.return;var s=nE(i.alternate,i,Tr);if(s!==null){Qe=s;return}if(i=i.sibling,i!==null){Qe=i;return}Qe=i=t}while(i!==null);tn===0&&(tn=5)}function l0(t,i){do{var s=iE(t.alternate,t);if(s!==null){s.flags&=32767,Qe=s;return}if(s=t.return,s!==null&&(s.flags|=32768,s.subtreeFlags=0,s.deletions=null),!i&&(t=t.sibling,t!==null)){Qe=t;return}Qe=t=s}while(t!==null);tn=6,Qe=null}function c0(t,i,s,l,b,x,N,U,ee){t.cancelPendingCommit=null;do qc();while(yn!==0);if((_t&6)!==0)throw Error(a(327));if(i!==null){if(i===t.current)throw Error(a(177));if(x=i.lanes|i.childLanes,x|=Ph,ke(t,s,x,N,U,ee),t===Mt&&(Qe=Mt=null,rt=0),Oa=i,as=t,Rr=s,qd=x,Kd=b,Jv=l,(i.subtreeFlags&10256)!==0||(i.flags&10256)!==0?(t.callbackNode=null,t.callbackPriority=0,gE(Kt,function(){return p0(),null})):(t.callbackNode=null,t.callbackPriority=0),l=(i.flags&13878)!==0,(i.subtreeFlags&13878)!==0||l){l=z.T,z.T=null,b=q.p,q.p=2,N=_t,_t|=4;try{rE(t,i,s)}finally{_t=N,q.p=b,z.T=l}}yn=1,u0(),h0(),d0()}}function u0(){if(yn===1){yn=0;var t=as,i=Oa,s=(i.flags&13878)!==0;if((i.subtreeFlags&13878)!==0||s){s=z.T,z.T=null;var l=q.p;q.p=2;var b=_t;_t|=4;try{Wv(i,t);var x=cf,N=Xm(t.containerInfo),U=x.focusedElem,ee=x.selectionRange;if(N!==U&&U&&U.ownerDocument&&Ym(U.ownerDocument.documentElement,U)){if(ee!==null&&Oh(U)){var oe=ee.start,de=ee.end;if(de===void 0&&(de=oe),"selectionStart"in U)U.selectionStart=oe,U.selectionEnd=Math.min(de,U.value.length);else{var me=U.ownerDocument||document,ce=me&&me.defaultView||window;if(ce.getSelection){var ue=ce.getSelection(),Ae=U.textContent.length,ze=Math.min(ee.start,Ae),At=ee.end===void 0?ze:Math.min(ee.end,Ae);!ue.extend&&ze>At&&(N=At,At=ze,ze=N);var re=Vm(U,ze),ne=Vm(U,At);if(re&&ne&&(ue.rangeCount!==1||ue.anchorNode!==re.node||ue.anchorOffset!==re.offset||ue.focusNode!==ne.node||ue.focusOffset!==ne.offset)){var ae=me.createRange();ae.setStart(re.node,re.offset),ue.removeAllRanges(),ze>At?(ue.addRange(ae),ue.extend(ne.node,ne.offset)):(ae.setEnd(ne.node,ne.offset),ue.addRange(ae))}}}}for(me=[],ue=U;ue=ue.parentNode;)ue.nodeType===1&&me.push({element:ue,left:ue.scrollLeft,top:ue.scrollTop});for(typeof U.focus=="function"&&U.focus(),U=0;U<me.length;U++){var pe=me[U];pe.element.scrollLeft=pe.left,pe.element.scrollTop=pe.top}}ru=!!lf,cf=lf=null}finally{_t=b,q.p=l,z.T=s}}t.current=i,yn=2}}function h0(){if(yn===2){yn=0;var t=as,i=Oa,s=(i.flags&8772)!==0;if((i.subtreeFlags&8772)!==0||s){s=z.T,z.T=null;var l=q.p;q.p=2;var b=_t;_t|=4;try{zv(t,i.alternate,i)}finally{_t=b,q.p=l,z.T=s}}yn=3}}function d0(){if(yn===4||yn===3){yn=0,Zt();var t=as,i=Oa,s=Rr,l=Jv;(i.subtreeFlags&10256)!==0||(i.flags&10256)!==0?yn=5:(yn=0,Oa=as=null,f0(t,t.pendingLanes));var b=t.pendingLanes;if(b===0&&(ss=null),Rn(s),i=i.stateNode,ve&&typeof ve.onCommitFiberRoot=="function")try{ve.onCommitFiberRoot(An,i,void 0,(i.current.flags&128)===128)}catch{}if(l!==null){i=z.T,b=q.p,q.p=2,z.T=null;try{for(var x=t.onRecoverableError,N=0;N<l.length;N++){var U=l[N];x(U.value,{componentStack:U.stack})}}finally{z.T=i,q.p=b}}(Rr&3)!==0&&qc(),ir(t),b=t.pendingLanes,(s&261930)!==0&&(b&42)!==0?t===Vd?Zo++:(Zo=0,Vd=t):Zo=0,Jo(0)}}function f0(t,i){(t.pooledCacheLanes&=i)===0&&(i=t.pooledCache,i!=null&&(t.pooledCache=null,No(i)))}function qc(){return u0(),h0(),d0(),p0()}function p0(){if(yn!==5)return!1;var t=as,i=qd;qd=0;var s=Rn(Rr),l=z.T,b=q.p;try{q.p=32>s?32:s,z.T=null,s=Kd,Kd=null;var x=as,N=Rr;if(yn=0,Oa=as=null,Rr=0,(_t&6)!==0)throw Error(a(331));var U=_t;if(_t|=4,Yv(x.current),qv(x,x.current,N,s),_t=U,Jo(0,!1),ve&&typeof ve.onPostCommitFiberRoot=="function")try{ve.onPostCommitFiberRoot(An,x)}catch{}return!0}finally{q.p=b,z.T=l,f0(t,i)}}function g0(t,i,s){i=Ei(s,i),i=kd(t.stateNode,i,2),t=Qr(t,i,2),t!==null&&(ht(t,2),ir(t))}function wt(t,i,s){if(t.tag===3)g0(t,t,s);else for(;i!==null;){if(i.tag===3){g0(i,t,s);break}else if(i.tag===1){var l=i.stateNode;if(typeof i.type.getDerivedStateFromError=="function"||typeof l.componentDidCatch=="function"&&(ss===null||!ss.has(l))){t=Ei(s,t),s=mv(2),l=Qr(i,s,2),l!==null&&(_v(s,l,i,t),ht(l,2),ir(l));break}}i=i.return}}function Zd(t,i,s){var l=t.pingCache;if(l===null){l=t.pingCache=new oE;var b=new Set;l.set(i,b)}else b=l.get(i),b===void 0&&(b=new Set,l.set(i,b));b.has(s)||(Fd=!0,b.add(s),t=dE.bind(null,t,i,s),i.then(t,t))}function dE(t,i,s){var l=t.pingCache;l!==null&&l.delete(i),t.pingedLanes|=t.suspendedLanes&s,t.warmLanes&=~s,Mt===t&&(rt&s)===s&&(tn===4||tn===3&&(rt&62914560)===rt&&300>ut()-Hc?(_t&2)===0&&Da(t,0):Wd|=s,Na===rt&&(Na=0)),ir(t)}function m0(t,i){i===0&&(i=Oe()),t=Ns(t,i),t!==null&&(ht(t,i),ir(t))}function fE(t){var i=t.memoizedState,s=0;i!==null&&(s=i.retryLane),m0(t,s)}function pE(t,i){var s=0;switch(t.tag){case 31:case 13:var l=t.stateNode,b=t.memoizedState;b!==null&&(s=b.retryLane);break;case 19:l=t.stateNode;break;case 22:l=t.stateNode._retryCache;break;default:throw Error(a(314))}l!==null&&l.delete(i),m0(t,s)}function gE(t,i){return vn(t,i)}var Kc=null,ja=null,Jd=!1,Vc=!1,Qd=!1,ls=0;function ir(t){t!==ja&&t.next===null&&(ja===null?Kc=ja=t:ja=ja.next=t),Vc=!0,Jd||(Jd=!0,_E())}function Jo(t,i){if(!Qd&&Vc){Qd=!0;do for(var s=!1,l=Kc;l!==null;){if(t!==0){var b=l.pendingLanes;if(b===0)var x=0;else{var N=l.suspendedLanes,U=l.pingedLanes;x=(1<<31-Ze(42|t)+1)-1,x&=b&~(N&~U),x=x&201326741?x&201326741|1:x?x|2:0}x!==0&&(s=!0,y0(l,x))}else x=rt,x=Q(l,l===Mt?x:0,l.cancelPendingCommit!==null||l.timeoutHandle!==-1),(x&3)===0||fe(l,x)||(s=!0,y0(l,x));l=l.next}while(s);Qd=!1}}function mE(){_0()}function _0(){Vc=Jd=!1;var t=0;ls!==0&&AE()&&(t=ls);for(var i=ut(),s=null,l=Kc;l!==null;){var b=l.next,x=v0(l,i);x===0?(l.next=null,s===null?Kc=b:s.next=b,b===null&&(ja=s)):(s=l,(t!==0||(x&3)!==0)&&(Vc=!0)),l=b}yn!==0&&yn!==5||Jo(t),ls!==0&&(ls=0)}function v0(t,i){for(var s=t.suspendedLanes,l=t.pingedLanes,b=t.expirationTimes,x=t.pendingLanes&-62914561;0<x;){var N=31-Ze(x),U=1<<N,ee=b[N];ee===-1?((U&s)===0||(U&l)!==0)&&(b[N]=ye(U,i)):ee<=i&&(t.expiredLanes|=U),x&=~U}if(i=Mt,s=rt,s=Q(t,t===i?s:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),l=t.callbackNode,s===0||t===i&&(St===2||St===9)||t.cancelPendingCommit!==null)return l!==null&&l!==null&&an(l),t.callbackNode=null,t.callbackPriority=0;if((s&3)===0||fe(t,s)){if(i=s&-s,i===t.callbackPriority)return i;switch(l!==null&&an(l),Rn(s)){case 2:case 8:s=Ft;break;case 32:s=Kt;break;case 268435456:s=bn;break;default:s=Kt}return l=b0.bind(null,t),s=vn(s,l),t.callbackPriority=i,t.callbackNode=s,i}return l!==null&&l!==null&&an(l),t.callbackPriority=2,t.callbackNode=null,2}function b0(t,i){if(yn!==0&&yn!==5)return t.callbackNode=null,t.callbackPriority=0,null;var s=t.callbackNode;if(qc()&&t.callbackNode!==s)return null;var l=rt;return l=Q(t,t===Mt?l:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),l===0?null:(e0(t,l,i),v0(t,ut()),t.callbackNode!=null&&t.callbackNode===s?b0.bind(null,t):null)}function y0(t,i){if(qc())return null;e0(t,i,!0)}function _E(){RE(function(){(_t&6)!==0?vn(Ct,mE):_0()})}function ef(){if(ls===0){var t=Sa;t===0&&(t=Dt,Dt<<=1,(Dt&261888)===0&&(Dt=256)),ls=t}return ls}function S0(t){return t==null||typeof t=="symbol"||typeof t=="boolean"?null:typeof t=="function"?t:Gr(""+t)}function w0(t,i){var s=i.ownerDocument.createElement("input");return s.name=i.name,s.value=i.value,t.id&&s.setAttribute("form",t.id),i.parentNode.insertBefore(s,i),t=new FormData(t),s.parentNode.removeChild(s),t}function vE(t,i,s,l,b){if(i==="submit"&&s&&s.stateNode===b){var x=S0((b[Nt]||null).action),N=l.submitter;N&&(i=(i=N[Nt]||null)?S0(i.formAction):N.getAttribute("formAction"),i!==null&&(x=i,N=null));var U=new ac("action","action",null,l,b);t.push({event:U,listeners:[{instance:null,listener:function(){if(l.defaultPrevented){if(ls!==0){var ee=N?w0(b,N):new FormData(b);yd(s,{pending:!0,data:ee,method:b.method,action:x},null,ee)}}else typeof x=="function"&&(U.preventDefault(),ee=N?w0(b,N):new FormData(b),yd(s,{pending:!0,data:ee,method:b.method,action:x},x,ee))},currentTarget:b}]})}}for(var tf=0;tf<Ih.length;tf++){var nf=Ih[tf],bE=nf.toLowerCase(),yE=nf[0].toUpperCase()+nf.slice(1);Fi(bE,"on"+yE)}Fi(Qm,"onAnimationEnd"),Fi(e_,"onAnimationIteration"),Fi(t_,"onAnimationStart"),Fi("dblclick","onDoubleClick"),Fi("focusin","onFocus"),Fi("focusout","onBlur"),Fi(j2,"onTransitionRun"),Fi(I2,"onTransitionStart"),Fi(P2,"onTransitionCancel"),Fi(n_,"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 Qo="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(" "),SE=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Qo));function x0(t,i){i=(i&4)!==0;for(var s=0;s<t.length;s++){var l=t[s],b=l.event;l=l.listeners;e:{var x=void 0;if(i)for(var N=l.length-1;0<=N;N--){var U=l[N],ee=U.instance,oe=U.currentTarget;if(U=U.listener,ee!==x&&b.isPropagationStopped())break e;x=U,b.currentTarget=oe;try{x(b)}catch(de){cc(de)}b.currentTarget=null,x=ee}else for(N=0;N<l.length;N++){if(U=l[N],ee=U.instance,oe=U.currentTarget,U=U.listener,ee!==x&&b.isPropagationStopped())break e;x=U,b.currentTarget=oe;try{x(b)}catch(de){cc(de)}b.currentTarget=null,x=ee}}}}function et(t,i){var s=i[Fr];s===void 0&&(s=i[Fr]=new Set);var l=t+"__bubble";s.has(l)||(C0(i,t,2,!1),s.add(l))}function rf(t,i,s){var l=0;i&&(l|=4),C0(s,t,l,i)}var Yc="_reactListening"+Math.random().toString(36).slice(2);function sf(t){if(!t[Yc]){t[Yc]=!0,It.forEach(function(s){s!=="selectionchange"&&(SE.has(s)||rf(s,!1,t),rf(s,!0,t))});var i=t.nodeType===9?t:t.ownerDocument;i===null||i[Yc]||(i[Yc]=!0,rf("selectionchange",!1,i))}}function C0(t,i,s,l){switch(Q0(i)){case 2:var b=YE;break;case 8:b=XE;break;default:b=yf}s=b.bind(null,i,s,t),b=void 0,!Ch||i!=="touchstart"&&i!=="touchmove"&&i!=="wheel"||(b=!0),l?b!==void 0?t.addEventListener(i,s,{capture:!0,passive:b}):t.addEventListener(i,s,!0):b!==void 0?t.addEventListener(i,s,{passive:b}):t.addEventListener(i,s,!1)}function af(t,i,s,l,b){var x=l;if((i&1)===0&&(i&2)===0&&l!==null)e:for(;;){if(l===null)return;var N=l.tag;if(N===3||N===4){var U=l.stateNode.containerInfo;if(U===b)break;if(N===4)for(N=l.return;N!==null;){var ee=N.tag;if((ee===3||ee===4)&&N.stateNode.containerInfo===b)return;N=N.return}for(;U!==null;){if(N=J(U),N===null)return;if(ee=N.tag,ee===5||ee===6||ee===26||ee===27){l=x=N;continue e}U=U.parentNode}}l=l.return}nc(function(){var oe=x,de=We(s),me=[];e:{var ce=i_.get(t);if(ce!==void 0){var ue=ac,Ae=t;switch(t){case"keypress":if(rc(s)===0)break e;case"keydown":case"keyup":ue=p2;break;case"focusin":Ae="focus",ue=Th;break;case"focusout":Ae="blur",ue=Th;break;case"beforeblur":case"afterblur":ue=Th;break;case"click":if(s.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":ue=Nm;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ue=n2;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ue=_2;break;case Qm:case e_:case t_:ue=s2;break;case n_:ue=b2;break;case"scroll":case"scrollend":ue=e2;break;case"wheel":ue=S2;break;case"copy":case"cut":case"paste":ue=o2;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":ue=Dm;break;case"toggle":case"beforetoggle":ue=x2}var ze=(i&4)!==0,At=!ze&&(t==="scroll"||t==="scrollend"),re=ze?ce!==null?ce+"Capture":null:ce;ze=[];for(var ne=oe,ae;ne!==null;){var pe=ne;if(ae=pe.stateNode,pe=pe.tag,pe!==5&&pe!==26&&pe!==27||ae===null||re===null||(pe=So(ne,re),pe!=null&&ze.push(el(ne,pe,ae))),At)break;ne=ne.return}0<ze.length&&(ce=new ue(ce,Ae,null,s,de),me.push({event:ce,listeners:ze}))}}if((i&7)===0){e:{if(ce=t==="mouseover"||t==="pointerover",ue=t==="mouseout"||t==="pointerout",ce&&s!==Te&&(Ae=s.relatedTarget||s.fromElement)&&(J(Ae)||Ae[Ui]))break e;if((ue||ce)&&(ce=de.window===de?de:(ce=de.ownerDocument)?ce.defaultView||ce.parentWindow:window,ue?(Ae=s.relatedTarget||s.toElement,ue=oe,Ae=Ae?J(Ae):null,Ae!==null&&(At=g(Ae),ze=Ae.tag,Ae!==At||ze!==5&&ze!==27&&ze!==6)&&(Ae=null)):(ue=null,Ae=oe),ue!==Ae)){if(ze=Nm,pe="onMouseLeave",re="onMouseEnter",ne="mouse",(t==="pointerout"||t==="pointerover")&&(ze=Dm,pe="onPointerLeave",re="onPointerEnter",ne="pointer"),At=ue==null?ce:Ee(ue),ae=Ae==null?ce:Ee(Ae),ce=new ze(pe,ne+"leave",ue,s,de),ce.target=At,ce.relatedTarget=ae,pe=null,J(de)===oe&&(ze=new ze(re,ne+"enter",Ae,s,de),ze.target=ae,ze.relatedTarget=At,pe=ze),At=pe,ue&&Ae)t:{for(ze=wE,re=ue,ne=Ae,ae=0,pe=re;pe;pe=ze(pe))ae++;pe=0;for(var Be=ne;Be;Be=ze(Be))pe++;for(;0<ae-pe;)re=ze(re),ae--;for(;0<pe-ae;)ne=ze(ne),pe--;for(;ae--;){if(re===ne||ne!==null&&re===ne.alternate){ze=re;break t}re=ze(re),ne=ze(ne)}ze=null}else ze=null;ue!==null&&E0(me,ce,ue,ze,!1),Ae!==null&&At!==null&&E0(me,At,Ae,ze,!0)}}e:{if(ce=oe?Ee(oe):window,ue=ce.nodeName&&ce.nodeName.toLowerCase(),ue==="select"||ue==="input"&&ce.type==="file")var pt=Um;else if(Hm(ce))if(Fm)pt=O2;else{pt=M2;var Re=L2}else ue=ce.nodeName,!ue||ue.toLowerCase()!=="input"||ce.type!=="checkbox"&&ce.type!=="radio"?oe&&Wr(oe.elementType)&&(pt=Um):pt=N2;if(pt&&(pt=pt(t,oe))){$m(me,pt,s,de);break e}Re&&Re(t,ce,oe),t==="focusout"&&oe&&ce.type==="number"&&oe.memoizedProps.value!=null&&ua(ce,"number",ce.value)}switch(Re=oe?Ee(oe):window,t){case"focusin":(Hm(Re)||Re.contentEditable==="true")&&(fa=Re,Dh=oe,Ro=null);break;case"focusout":Ro=Dh=fa=null;break;case"mousedown":Bh=!0;break;case"contextmenu":case"mouseup":case"dragend":Bh=!1,Zm(me,s,de);break;case"selectionchange":if(B2)break;case"keydown":case"keyup":Zm(me,s,de)}var Ye;if(Lh)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 da?Pm(t,s)&&(st="onCompositionEnd"):t==="keydown"&&s.keyCode===229&&(st="onCompositionStart");st&&(Bm&&s.locale!=="ko"&&(da||st!=="onCompositionStart"?st==="onCompositionEnd"&&da&&(Ye=Lm()):(qr=de,Eh="value"in qr?qr.value:qr.textContent,da=!0)),Re=Xc(oe,st),0<Re.length&&(st=new Om(st,t,null,s,de),me.push({event:st,listeners:Re}),Ye?st.data=Ye:(Ye=zm(s),Ye!==null&&(st.data=Ye)))),(Ye=E2?k2(t,s):A2(t,s))&&(st=Xc(oe,"onBeforeInput"),0<st.length&&(Re=new Om("onBeforeInput","beforeinput",null,s,de),me.push({event:Re,listeners:st}),Re.data=Ye)),vE(me,t,oe,s,de)}x0(me,i)})}function el(t,i,s){return{instance:t,listener:i,currentTarget:s}}function Xc(t,i){for(var s=i+"Capture",l=[];t!==null;){var b=t,x=b.stateNode;if(b=b.tag,b!==5&&b!==26&&b!==27||x===null||(b=So(t,s),b!=null&&l.unshift(el(t,b,x)),b=So(t,i),b!=null&&l.push(el(t,b,x))),t.tag===3)return l;t=t.return}return[]}function wE(t){if(t===null)return null;do t=t.return;while(t&&t.tag!==5&&t.tag!==27);return t||null}function E0(t,i,s,l,b){for(var x=i._reactName,N=[];s!==null&&s!==l;){var U=s,ee=U.alternate,oe=U.stateNode;if(U=U.tag,ee!==null&&ee===l)break;U!==5&&U!==26&&U!==27||oe===null||(ee=oe,b?(oe=So(s,x),oe!=null&&N.unshift(el(s,oe,ee))):b||(oe=So(s,x),oe!=null&&N.push(el(s,oe,ee)))),s=s.return}N.length!==0&&t.push({event:i,listeners:N})}var xE=/\r\n?/g,CE=/\u0000|\uFFFD/g;function k0(t){return(typeof t=="string"?t:""+t).replace(xE,`
|
|
9
|
-
`).replace(CE,"")}function A0(t,i){return i=k0(i),k0(t)===i}function kt(t,i,s,l,b,x){switch(s){case"children":typeof l=="string"?i==="body"||i==="textarea"&&l===""||Ue(t,l):(typeof l=="number"||typeof l=="bigint")&&i!=="body"&&Ue(t,""+l);break;case"className":ci(t,"class",l);break;case"tabIndex":ci(t,"tabindex",l);break;case"dir":case"role":case"viewBox":case"width":case"height":ci(t,s,l);break;case"style":yt(t,l,x);break;case"data":if(i!=="object"){ci(t,"data",l);break}case"src":case"href":if(l===""&&(i!=="a"||s!=="href")){t.removeAttribute(s);break}if(l==null||typeof l=="function"||typeof l=="symbol"||typeof l=="boolean"){t.removeAttribute(s);break}l=Gr(""+l),t.setAttribute(s,l);break;case"action":case"formAction":if(typeof l=="function"){t.setAttribute(s,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof x=="function"&&(s==="formAction"?(i!=="input"&&kt(t,i,"name",b.name,b,null),kt(t,i,"formEncType",b.formEncType,b,null),kt(t,i,"formMethod",b.formMethod,b,null),kt(t,i,"formTarget",b.formTarget,b,null)):(kt(t,i,"encType",b.encType,b,null),kt(t,i,"method",b.method,b,null),kt(t,i,"target",b.target,b,null)));if(l==null||typeof l=="symbol"||typeof l=="boolean"){t.removeAttribute(s);break}l=Gr(""+l),t.setAttribute(s,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(a(61));if(s=l.__html,s!=null){if(b.children!=null)throw Error(a(60));t.innerHTML=s}}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}s=Gr(""+l),t.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",s);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":l!=null&&typeof l!="function"&&typeof l!="symbol"?t.setAttribute(s,""+l):t.removeAttribute(s);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":l&&typeof l!="function"&&typeof l!="symbol"?t.setAttribute(s,""):t.removeAttribute(s);break;case"capture":case"download":l===!0?t.setAttribute(s,""):l!==!1&&l!=null&&typeof l!="function"&&typeof l!="symbol"?t.setAttribute(s,l):t.removeAttribute(s);break;case"cols":case"rows":case"size":case"span":l!=null&&typeof l!="function"&&typeof l!="symbol"&&!isNaN(l)&&1<=l?t.setAttribute(s,l):t.removeAttribute(s);break;case"rowSpan":case"start":l==null||typeof l=="function"||typeof l=="symbol"||isNaN(l)?t.removeAttribute(s):t.setAttribute(s,l);break;case"popover":et("beforetoggle",t),et("toggle",t),zn(t,"popover",l);break;case"xlinkActuate":Jn(t,"http://www.w3.org/1999/xlink","xlink:actuate",l);break;case"xlinkArcrole":Jn(t,"http://www.w3.org/1999/xlink","xlink:arcrole",l);break;case"xlinkRole":Jn(t,"http://www.w3.org/1999/xlink","xlink:role",l);break;case"xlinkShow":Jn(t,"http://www.w3.org/1999/xlink","xlink:show",l);break;case"xlinkTitle":Jn(t,"http://www.w3.org/1999/xlink","xlink:title",l);break;case"xlinkType":Jn(t,"http://www.w3.org/1999/xlink","xlink:type",l);break;case"xmlBase":Jn(t,"http://www.w3.org/XML/1998/namespace","xml:base",l);break;case"xmlLang":Jn(t,"http://www.w3.org/XML/1998/namespace","xml:lang",l);break;case"xmlSpace":Jn(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<s.length)||s[0]!=="o"&&s[0]!=="O"||s[1]!=="n"&&s[1]!=="N")&&(s=pr.get(s)||s,zn(t,s,l))}}function of(t,i,s,l,b,x){switch(s){case"style":yt(t,l,x);break;case"dangerouslySetInnerHTML":if(l!=null){if(typeof l!="object"||!("__html"in l))throw Error(a(61));if(s=l.__html,s!=null){if(b.children!=null)throw Error(a(60));t.innerHTML=s}}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(s))e:{if(s[0]==="o"&&s[1]==="n"&&(b=s.endsWith("Capture"),i=s.slice(2,b?s.length-7:void 0),x=t[Nt]||null,x=x!=null?x[s]:null,typeof x=="function"&&t.removeEventListener(i,x,b),typeof l=="function")){typeof x!="function"&&x!==null&&(s in t?t[s]=null:t.hasAttribute(s)&&t.removeAttribute(s)),t.addEventListener(i,l,b);break e}s in t?t[s]=l:l===!0?t.setAttribute(s,""):zn(t,s,l)}}}function Dn(t,i,s){switch(i){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 s)if(s.hasOwnProperty(x)){var N=s[x];if(N!=null)switch(x){case"src":l=!0;break;case"srcSet":b=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(a(137,i));default:kt(t,i,x,N,s,null)}}b&&kt(t,i,"srcSet",s.srcSet,s,null),l&&kt(t,i,"src",s.src,s,null);return;case"input":et("invalid",t);var U=x=N=b=null,ee=null,oe=null;for(l in s)if(s.hasOwnProperty(l)){var de=s[l];if(de!=null)switch(l){case"name":b=de;break;case"type":N=de;break;case"checked":ee=de;break;case"defaultChecked":oe=de;break;case"value":x=de;break;case"defaultValue":U=de;break;case"children":case"dangerouslySetInnerHTML":if(de!=null)throw Error(a(137,i));break;default:kt(t,i,l,de,s,null)}}Ts(t,x,U,ee,oe,N,b,!1);return;case"select":et("invalid",t),l=N=x=null;for(b in s)if(s.hasOwnProperty(b)&&(U=s[b],U!=null))switch(b){case"value":x=U;break;case"defaultValue":N=U;break;case"multiple":l=U;default:kt(t,i,b,U,s,null)}i=x,s=N,t.multiple=!!l,i!=null?Ln(t,!!l,i,!1):s!=null&&Ln(t,!!l,s,!0);return;case"textarea":et("invalid",t),x=b=l=null;for(N in s)if(s.hasOwnProperty(N)&&(U=s[N],U!=null))switch(N){case"value":l=U;break;case"defaultValue":b=U;break;case"children":x=U;break;case"dangerouslySetInnerHTML":if(U!=null)throw Error(a(91));break;default:kt(t,i,N,U,s,null)}ha(t,l,b,x);return;case"option":for(ee in s)s.hasOwnProperty(ee)&&(l=s[ee],l!=null)&&(ee==="selected"?t.selected=l&&typeof l!="function"&&typeof l!="symbol":kt(t,i,ee,l,s,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<Qo.length;l++)et(Qo[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(oe in s)if(s.hasOwnProperty(oe)&&(l=s[oe],l!=null))switch(oe){case"children":case"dangerouslySetInnerHTML":throw Error(a(137,i));default:kt(t,i,oe,l,s,null)}return;default:if(Wr(i)){for(de in s)s.hasOwnProperty(de)&&(l=s[de],l!==void 0&&of(t,i,de,l,s,void 0));return}}for(U in s)s.hasOwnProperty(U)&&(l=s[U],l!=null&&kt(t,i,U,l,s,null))}function EE(t,i,s,l){switch(i){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var b=null,x=null,N=null,U=null,ee=null,oe=null,de=null;for(ue in s){var me=s[ue];if(s.hasOwnProperty(ue)&&me!=null)switch(ue){case"checked":break;case"value":break;case"defaultValue":ee=me;default:l.hasOwnProperty(ue)||kt(t,i,ue,null,l,me)}}for(var ce in l){var ue=l[ce];if(me=s[ce],l.hasOwnProperty(ce)&&(ue!=null||me!=null))switch(ce){case"type":x=ue;break;case"name":b=ue;break;case"checked":oe=ue;break;case"defaultChecked":de=ue;break;case"value":N=ue;break;case"defaultValue":U=ue;break;case"children":case"dangerouslySetInnerHTML":if(ue!=null)throw Error(a(137,i));break;default:ue!==me&&kt(t,i,ce,ue,l,me)}}vo(t,N,U,ee,oe,de,x,b);return;case"select":ue=N=U=ce=null;for(x in s)if(ee=s[x],s.hasOwnProperty(x)&&ee!=null)switch(x){case"value":break;case"multiple":ue=ee;default:l.hasOwnProperty(x)||kt(t,i,x,null,l,ee)}for(b in l)if(x=l[b],ee=s[b],l.hasOwnProperty(b)&&(x!=null||ee!=null))switch(b){case"value":ce=x;break;case"defaultValue":U=x;break;case"multiple":N=x;default:x!==ee&&kt(t,i,b,x,l,ee)}i=U,s=N,l=ue,ce!=null?Ln(t,!!s,ce,!1):!!l!=!!s&&(i!=null?Ln(t,!!s,i,!0):Ln(t,!!s,s?[]:"",!1));return;case"textarea":ue=ce=null;for(U in s)if(b=s[U],s.hasOwnProperty(U)&&b!=null&&!l.hasOwnProperty(U))switch(U){case"value":break;case"children":break;default:kt(t,i,U,null,l,b)}for(N in l)if(b=l[N],x=s[N],l.hasOwnProperty(N)&&(b!=null||x!=null))switch(N){case"value":ce=b;break;case"defaultValue":ue=b;break;case"children":break;case"dangerouslySetInnerHTML":if(b!=null)throw Error(a(91));break;default:b!==x&&kt(t,i,N,b,l,x)}ec(t,ce,ue);return;case"option":for(var Ae in s)ce=s[Ae],s.hasOwnProperty(Ae)&&ce!=null&&!l.hasOwnProperty(Ae)&&(Ae==="selected"?t.selected=!1:kt(t,i,Ae,null,l,ce));for(ee in l)ce=l[ee],ue=s[ee],l.hasOwnProperty(ee)&&ce!==ue&&(ce!=null||ue!=null)&&(ee==="selected"?t.selected=ce&&typeof ce!="function"&&typeof ce!="symbol":kt(t,i,ee,ce,l,ue));return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var ze in s)ce=s[ze],s.hasOwnProperty(ze)&&ce!=null&&!l.hasOwnProperty(ze)&&kt(t,i,ze,null,l,ce);for(oe in l)if(ce=l[oe],ue=s[oe],l.hasOwnProperty(oe)&&ce!==ue&&(ce!=null||ue!=null))switch(oe){case"children":case"dangerouslySetInnerHTML":if(ce!=null)throw Error(a(137,i));break;default:kt(t,i,oe,ce,l,ue)}return;default:if(Wr(i)){for(var At in s)ce=s[At],s.hasOwnProperty(At)&&ce!==void 0&&!l.hasOwnProperty(At)&&of(t,i,At,void 0,l,ce);for(de in l)ce=l[de],ue=s[de],!l.hasOwnProperty(de)||ce===ue||ce===void 0&&ue===void 0||of(t,i,de,ce,l,ue);return}}for(var re in s)ce=s[re],s.hasOwnProperty(re)&&ce!=null&&!l.hasOwnProperty(re)&&kt(t,i,re,null,l,ce);for(me in l)ce=l[me],ue=s[me],!l.hasOwnProperty(me)||ce===ue||ce==null&&ue==null||kt(t,i,me,ce,l,ue)}function T0(t){switch(t){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function kE(){if(typeof performance.getEntriesByType=="function"){for(var t=0,i=0,s=performance.getEntriesByType("resource"),l=0;l<s.length;l++){var b=s[l],x=b.transferSize,N=b.initiatorType,U=b.duration;if(x&&U&&T0(N)){for(N=0,U=b.responseEnd,l+=1;l<s.length;l++){var ee=s[l],oe=ee.startTime;if(oe>U)break;var de=ee.transferSize,me=ee.initiatorType;de&&T0(me)&&(ee=ee.responseEnd,N+=de*(ee<U?1:(U-oe)/(ee-oe)))}if(--l,i+=8*(x+N)/(b.duration/1e3),t++,10<t)break}}if(0<t)return i/t/1e6}return navigator.connection&&(t=navigator.connection.downlink,typeof t=="number")?t:5}var lf=null,cf=null;function Zc(t){return t.nodeType===9?t:t.ownerDocument}function R0(t){switch(t){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function L0(t,i){if(t===0)switch(i){case"svg":return 1;case"math":return 2;default:return 0}return t===1&&i==="foreignObject"?0:t}function uf(t,i){return t==="textarea"||t==="noscript"||typeof i.children=="string"||typeof i.children=="number"||typeof i.children=="bigint"||typeof i.dangerouslySetInnerHTML=="object"&&i.dangerouslySetInnerHTML!==null&&i.dangerouslySetInnerHTML.__html!=null}var hf=null;function AE(){var t=window.event;return t&&t.type==="popstate"?t===hf?!1:(hf=t,!0):(hf=null,!1)}var M0=typeof setTimeout=="function"?setTimeout:void 0,TE=typeof clearTimeout=="function"?clearTimeout:void 0,N0=typeof Promise=="function"?Promise:void 0,RE=typeof queueMicrotask=="function"?queueMicrotask:typeof N0<"u"?function(t){return N0.resolve(null).then(t).catch(LE)}:M0;function LE(t){setTimeout(function(){throw t})}function cs(t){return t==="head"}function O0(t,i){var s=i,l=0;do{var b=s.nextSibling;if(t.removeChild(s),b&&b.nodeType===8)if(s=b.data,s==="/$"||s==="/&"){if(l===0){t.removeChild(b),Ha(i);return}l--}else if(s==="$"||s==="$?"||s==="$~"||s==="$!"||s==="&")l++;else if(s==="html")tl(t.ownerDocument.documentElement);else if(s==="head"){s=t.ownerDocument.head,tl(s);for(var x=s.firstChild;x;){var N=x.nextSibling,U=x.nodeName;x[Qi]||U==="SCRIPT"||U==="STYLE"||U==="LINK"&&x.rel.toLowerCase()==="stylesheet"||s.removeChild(x),x=N}}else s==="body"&&tl(t.ownerDocument.body);s=b}while(s);Ha(i)}function D0(t,i){var s=t;t=0;do{var l=s.nextSibling;if(s.nodeType===1?i?(s._stashedDisplay=s.style.display,s.style.display="none"):(s.style.display=s._stashedDisplay||"",s.getAttribute("style")===""&&s.removeAttribute("style")):s.nodeType===3&&(i?(s._stashedText=s.nodeValue,s.nodeValue=""):s.nodeValue=s._stashedText||""),l&&l.nodeType===8)if(s=l.data,s==="/$"){if(t===0)break;t--}else s!=="$"&&s!=="$?"&&s!=="$~"&&s!=="$!"||t++;s=l}while(s)}function df(t){var i=t.firstChild;for(i&&i.nodeType===10&&(i=i.nextSibling);i;){var s=i;switch(i=i.nextSibling,s.nodeName){case"HTML":case"HEAD":case"BODY":df(s),Ne(s);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(s.rel.toLowerCase()==="stylesheet")continue}t.removeChild(s)}}function ME(t,i,s,l){for(;t.nodeType===1;){var b=s;if(t.nodeName.toLowerCase()!==i.toLowerCase()){if(!l&&(t.nodeName!=="INPUT"||t.type!=="hidden"))break}else if(l){if(!t[Qi])switch(i){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(i==="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=Li(t.nextSibling),t===null)break}return null}function NE(t,i,s){if(i==="")return null;for(;t.nodeType!==3;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!s||(t=Li(t.nextSibling),t===null))return null;return t}function B0(t,i){for(;t.nodeType!==8;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!i||(t=Li(t.nextSibling),t===null))return null;return t}function ff(t){return t.data==="$?"||t.data==="$~"}function pf(t){return t.data==="$!"||t.data==="$?"&&t.ownerDocument.readyState!=="loading"}function OE(t,i){var s=t.ownerDocument;if(t.data==="$~")t._reactRetry=i;else if(t.data!=="$?"||s.readyState!=="loading")i();else{var l=function(){i(),s.removeEventListener("DOMContentLoaded",l)};s.addEventListener("DOMContentLoaded",l),t._reactRetry=l}}function Li(t){for(;t!=null;t=t.nextSibling){var i=t.nodeType;if(i===1||i===3)break;if(i===8){if(i=t.data,i==="$"||i==="$!"||i==="$?"||i==="$~"||i==="&"||i==="F!"||i==="F")break;if(i==="/$"||i==="/&")return null}}return t}var gf=null;function j0(t){t=t.nextSibling;for(var i=0;t;){if(t.nodeType===8){var s=t.data;if(s==="/$"||s==="/&"){if(i===0)return Li(t.nextSibling);i--}else s!=="$"&&s!=="$!"&&s!=="$?"&&s!=="$~"&&s!=="&"||i++}t=t.nextSibling}return null}function I0(t){t=t.previousSibling;for(var i=0;t;){if(t.nodeType===8){var s=t.data;if(s==="$"||s==="$!"||s==="$?"||s==="$~"||s==="&"){if(i===0)return t;i--}else s!=="/$"&&s!=="/&"||i++}t=t.previousSibling}return null}function P0(t,i,s){switch(i=Zc(s),t){case"html":if(t=i.documentElement,!t)throw Error(a(452));return t;case"head":if(t=i.head,!t)throw Error(a(453));return t;case"body":if(t=i.body,!t)throw Error(a(454));return t;default:throw Error(a(451))}}function tl(t){for(var i=t.attributes;i.length;)t.removeAttributeNode(i[0]);Ne(t)}var Mi=new Map,z0=new Set;function Jc(t){return typeof t.getRootNode=="function"?t.getRootNode():t.nodeType===9?t:t.ownerDocument}var Lr=q.d;q.d={f:DE,r:BE,D:jE,C:IE,L:PE,m:zE,X:$E,S:HE,M:UE};function DE(){var t=Lr.f(),i=Fc();return t||i}function BE(t){var i=_e(t);i!==null&&i.tag===5&&i.type==="form"?nv(i):Lr.r(t)}var Ia=typeof document>"u"?null:document;function H0(t,i,s){var l=Ia;if(l&&typeof i=="string"&&i){var b=Qn(i);b='link[rel="'+t+'"][href="'+b+'"]',typeof s=="string"&&(b+='[crossorigin="'+s+'"]'),z0.has(b)||(z0.add(b),t={rel:t,crossOrigin:s,href:i},l.querySelector(b)===null&&(i=l.createElement("link"),Dn(i,"link",t),Je(i),l.head.appendChild(i)))}}function jE(t){Lr.D(t),H0("dns-prefetch",t,null)}function IE(t,i){Lr.C(t,i),H0("preconnect",t,i)}function PE(t,i,s){Lr.L(t,i,s);var l=Ia;if(l&&t&&i){var b='link[rel="preload"][as="'+Qn(i)+'"]';i==="image"&&s&&s.imageSrcSet?(b+='[imagesrcset="'+Qn(s.imageSrcSet)+'"]',typeof s.imageSizes=="string"&&(b+='[imagesizes="'+Qn(s.imageSizes)+'"]')):b+='[href="'+Qn(t)+'"]';var x=b;switch(i){case"style":x=Pa(t);break;case"script":x=za(t)}Mi.has(x)||(t=m({rel:"preload",href:i==="image"&&s&&s.imageSrcSet?void 0:t,as:i},s),Mi.set(x,t),l.querySelector(b)!==null||i==="style"&&l.querySelector(nl(x))||i==="script"&&l.querySelector(il(x))||(i=l.createElement("link"),Dn(i,"link",t),Je(i),l.head.appendChild(i)))}}function zE(t,i){Lr.m(t,i);var s=Ia;if(s&&t){var l=i&&typeof i.as=="string"?i.as:"script",b='link[rel="modulepreload"][as="'+Qn(l)+'"][href="'+Qn(t)+'"]',x=b;switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":x=za(t)}if(!Mi.has(x)&&(t=m({rel:"modulepreload",href:t},i),Mi.set(x,t),s.querySelector(b)===null)){switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(s.querySelector(il(x)))return}l=s.createElement("link"),Dn(l,"link",t),Je(l),s.head.appendChild(l)}}}function HE(t,i,s){Lr.S(t,i,s);var l=Ia;if(l&&t){var b=ot(l).hoistableStyles,x=Pa(t);i=i||"default";var N=b.get(x);if(!N){var U={loading:0,preload:null};if(N=l.querySelector(nl(x)))U.loading=5;else{t=m({rel:"stylesheet",href:t,"data-precedence":i},s),(s=Mi.get(x))&&mf(t,s);var ee=N=l.createElement("link");Je(ee),Dn(ee,"link",t),ee._p=new Promise(function(oe,de){ee.onload=oe,ee.onerror=de}),ee.addEventListener("load",function(){U.loading|=1}),ee.addEventListener("error",function(){U.loading|=2}),U.loading|=4,Qc(N,i,l)}N={type:"stylesheet",instance:N,count:1,state:U},b.set(x,N)}}}function $E(t,i){Lr.X(t,i);var s=Ia;if(s&&t){var l=ot(s).hoistableScripts,b=za(t),x=l.get(b);x||(x=s.querySelector(il(b)),x||(t=m({src:t,async:!0},i),(i=Mi.get(b))&&_f(t,i),x=s.createElement("script"),Je(x),Dn(x,"link",t),s.head.appendChild(x)),x={type:"script",instance:x,count:1,state:null},l.set(b,x))}}function UE(t,i){Lr.M(t,i);var s=Ia;if(s&&t){var l=ot(s).hoistableScripts,b=za(t),x=l.get(b);x||(x=s.querySelector(il(b)),x||(t=m({src:t,async:!0,type:"module"},i),(i=Mi.get(b))&&_f(t,i),x=s.createElement("script"),Je(x),Dn(x,"link",t),s.head.appendChild(x)),x={type:"script",instance:x,count:1,state:null},l.set(b,x))}}function $0(t,i,s,l){var b=(b=he.current)?Jc(b):null;if(!b)throw Error(a(446));switch(t){case"meta":case"title":return null;case"style":return typeof s.precedence=="string"&&typeof s.href=="string"?(i=Pa(s.href),s=ot(b).hoistableStyles,l=s.get(i),l||(l={type:"style",instance:null,count:0,state:null},s.set(i,l)),l):{type:"void",instance:null,count:0,state:null};case"link":if(s.rel==="stylesheet"&&typeof s.href=="string"&&typeof s.precedence=="string"){t=Pa(s.href);var x=ot(b).hoistableStyles,N=x.get(t);if(N||(b=b.ownerDocument||b,N={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},x.set(t,N),(x=b.querySelector(nl(t)))&&!x._p&&(N.instance=x,N.state.loading=5),Mi.has(t)||(s={rel:"preload",as:"style",href:s.href,crossOrigin:s.crossOrigin,integrity:s.integrity,media:s.media,hrefLang:s.hrefLang,referrerPolicy:s.referrerPolicy},Mi.set(t,s),x||FE(b,t,s,N.state))),i&&l===null)throw Error(a(528,""));return N}if(i&&l!==null)throw Error(a(529,""));return null;case"script":return i=s.async,s=s.src,typeof s=="string"&&i&&typeof i!="function"&&typeof i!="symbol"?(i=za(s),s=ot(b).hoistableScripts,l=s.get(i),l||(l={type:"script",instance:null,count:0,state:null},s.set(i,l)),l):{type:"void",instance:null,count:0,state:null};default:throw Error(a(444,t))}}function Pa(t){return'href="'+Qn(t)+'"'}function nl(t){return'link[rel="stylesheet"]['+t+"]"}function U0(t){return m({},t,{"data-precedence":t.precedence,precedence:null})}function FE(t,i,s,l){t.querySelector('link[rel="preload"][as="style"]['+i+"]")?l.loading=1:(i=t.createElement("link"),l.preload=i,i.addEventListener("load",function(){return l.loading|=1}),i.addEventListener("error",function(){return l.loading|=2}),Dn(i,"link",s),Je(i),t.head.appendChild(i))}function za(t){return'[src="'+Qn(t)+'"]'}function il(t){return"script[async]"+t}function F0(t,i,s){if(i.count++,i.instance===null)switch(i.type){case"style":var l=t.querySelector('style[data-href~="'+Qn(s.href)+'"]');if(l)return i.instance=l,Je(l),l;var b=m({},s,{"data-href":s.href,"data-precedence":s.precedence,href:null,precedence:null});return l=(t.ownerDocument||t).createElement("style"),Je(l),Dn(l,"style",b),Qc(l,s.precedence,t),i.instance=l;case"stylesheet":b=Pa(s.href);var x=t.querySelector(nl(b));if(x)return i.state.loading|=4,i.instance=x,Je(x),x;l=U0(s),(b=Mi.get(b))&&mf(l,b),x=(t.ownerDocument||t).createElement("link"),Je(x);var N=x;return N._p=new Promise(function(U,ee){N.onload=U,N.onerror=ee}),Dn(x,"link",l),i.state.loading|=4,Qc(x,s.precedence,t),i.instance=x;case"script":return x=za(s.src),(b=t.querySelector(il(x)))?(i.instance=b,Je(b),b):(l=s,(b=Mi.get(x))&&(l=m({},s),_f(l,b)),t=t.ownerDocument||t,b=t.createElement("script"),Je(b),Dn(b,"link",l),t.head.appendChild(b),i.instance=b);case"void":return null;default:throw Error(a(443,i.type))}else i.type==="stylesheet"&&(i.state.loading&4)===0&&(l=i.instance,i.state.loading|=4,Qc(l,s.precedence,t));return i.instance}function Qc(t,i,s){for(var l=s.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),b=l.length?l[l.length-1]:null,x=b,N=0;N<l.length;N++){var U=l[N];if(U.dataset.precedence===i)x=U;else if(x!==b)break}x?x.parentNode.insertBefore(t,x.nextSibling):(i=s.nodeType===9?s.head:s,i.insertBefore(t,i.firstChild))}function mf(t,i){t.crossOrigin==null&&(t.crossOrigin=i.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=i.referrerPolicy),t.title==null&&(t.title=i.title)}function _f(t,i){t.crossOrigin==null&&(t.crossOrigin=i.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=i.referrerPolicy),t.integrity==null&&(t.integrity=i.integrity)}var eu=null;function W0(t,i,s){if(eu===null){var l=new Map,b=eu=new Map;b.set(s,l)}else b=eu,l=b.get(s),l||(l=new Map,b.set(s,l));if(l.has(t))return l;for(l.set(t,null),s=s.getElementsByTagName(t),b=0;b<s.length;b++){var x=s[b];if(!(x[Qi]||x[jt]||t==="link"&&x.getAttribute("rel")==="stylesheet")&&x.namespaceURI!=="http://www.w3.org/2000/svg"){var N=x.getAttribute(i)||"";N=t+N;var U=l.get(N);U?U.push(x):l.set(N,[x])}}return l}function G0(t,i,s){t=t.ownerDocument||t,t.head.insertBefore(s,i==="title"?t.querySelector("head > title"):null)}function WE(t,i,s){if(s===1||i.itemProp!=null)return!1;switch(t){case"meta":case"title":return!0;case"style":if(typeof i.precedence!="string"||typeof i.href!="string"||i.href==="")break;return!0;case"link":if(typeof i.rel!="string"||typeof i.href!="string"||i.href===""||i.onLoad||i.onError)break;return i.rel==="stylesheet"?(t=i.disabled,typeof i.precedence=="string"&&t==null):!0;case"script":if(i.async&&typeof i.async!="function"&&typeof i.async!="symbol"&&!i.onLoad&&!i.onError&&i.src&&typeof i.src=="string")return!0}return!1}function q0(t){return!(t.type==="stylesheet"&&(t.state.loading&3)===0)}function GE(t,i,s,l){if(s.type==="stylesheet"&&(typeof l.media!="string"||matchMedia(l.media).matches!==!1)&&(s.state.loading&4)===0){if(s.instance===null){var b=Pa(l.href),x=i.querySelector(nl(b));if(x){i=x._p,i!==null&&typeof i=="object"&&typeof i.then=="function"&&(t.count++,t=tu.bind(t),i.then(t,t)),s.state.loading|=4,s.instance=x,Je(x);return}x=i.ownerDocument||i,l=U0(l),(b=Mi.get(b))&&mf(l,b),x=x.createElement("link"),Je(x);var N=x;N._p=new Promise(function(U,ee){N.onload=U,N.onerror=ee}),Dn(x,"link",l),s.instance=x}t.stylesheets===null&&(t.stylesheets=new Map),t.stylesheets.set(s,i),(i=s.state.preload)&&(s.state.loading&3)===0&&(t.count++,s=tu.bind(t),i.addEventListener("load",s),i.addEventListener("error",s))}}var vf=0;function qE(t,i){return t.stylesheets&&t.count===0&&iu(t,t.stylesheets),0<t.count||0<t.imgCount?function(s){var l=setTimeout(function(){if(t.stylesheets&&iu(t,t.stylesheets),t.unsuspend){var x=t.unsuspend;t.unsuspend=null,x()}},6e4+i);0<t.imgBytes&&vf===0&&(vf=62500*kE());var b=setTimeout(function(){if(t.waitingForImages=!1,t.count===0&&(t.stylesheets&&iu(t,t.stylesheets),t.unsuspend)){var x=t.unsuspend;t.unsuspend=null,x()}},(t.imgBytes>vf?50:800)+i);return t.unsuspend=s,function(){t.unsuspend=null,clearTimeout(l),clearTimeout(b)}}:null}function tu(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)iu(this,this.stylesheets);else if(this.unsuspend){var t=this.unsuspend;this.unsuspend=null,t()}}}var nu=null;function iu(t,i){t.stylesheets=null,t.unsuspend!==null&&(t.count++,nu=new Map,i.forEach(KE,t),nu=null,tu.call(t))}function KE(t,i){if(!(i.state.loading&4)){var s=nu.get(t);if(s)var l=s.get(null);else{s=new Map,nu.set(t,s);for(var b=t.querySelectorAll("link[data-precedence],style[data-precedence]"),x=0;x<b.length;x++){var N=b[x];(N.nodeName==="LINK"||N.getAttribute("media")!=="not all")&&(s.set(N.dataset.precedence,N),l=N)}l&&s.set(null,l)}b=i.instance,N=b.getAttribute("data-precedence"),x=s.get(N)||l,x===l&&s.set(null,b),s.set(N,b),this.count++,l=tu.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)),i.state.loading|=4}}var rl={$$typeof:S,Provider:null,Consumer:null,_currentValue:V,_currentValue2:V,_threadCount:0};function VE(t,i,s,l,b,x,N,U,ee){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=N,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=ee,this.incompleteTransitions=new Map}function K0(t,i,s,l,b,x,N,U,ee,oe,de,me){return t=new VE(t,i,s,N,ee,oe,de,me,U),i=1,x===!0&&(i|=24),x=di(3,null,null,i),t.current=x,x.stateNode=t,i=Xh(),i.refCount++,t.pooledCache=i,i.refCount++,x.memoizedState={element:l,isDehydrated:s,cache:i},ed(x),t}function V0(t){return t?(t=ma,t):ma}function Y0(t,i,s,l,b,x){b=V0(b),l.context===null?l.context=b:l.pendingContext=b,l=Jr(i),l.payload={element:s},x=x===void 0?null:x,x!==null&&(l.callback=x),s=Qr(t,l,i),s!==null&&(si(s,t,i),jo(s,t,i))}function X0(t,i){if(t=t.memoizedState,t!==null&&t.dehydrated!==null){var s=t.retryLane;t.retryLane=s!==0&&s<i?s:i}}function bf(t,i){X0(t,i),(t=t.alternate)&&X0(t,i)}function Z0(t){if(t.tag===13||t.tag===31){var i=Ns(t,67108864);i!==null&&si(i,t,67108864),bf(t,67108864)}}function J0(t){if(t.tag===13||t.tag===31){var i=_i();i=nt(i);var s=Ns(t,i);s!==null&&si(s,t,i),bf(t,i)}}var ru=!0;function YE(t,i,s,l){var b=z.T;z.T=null;var x=q.p;try{q.p=2,yf(t,i,s,l)}finally{q.p=x,z.T=b}}function XE(t,i,s,l){var b=z.T;z.T=null;var x=q.p;try{q.p=8,yf(t,i,s,l)}finally{q.p=x,z.T=b}}function yf(t,i,s,l){if(ru){var b=Sf(l);if(b===null)af(t,i,l,su,s),e1(t,l);else if(JE(b,t,i,s,l))l.stopPropagation();else if(e1(t,l),i&4&&-1<ZE.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 N=Bt(x.pendingLanes);if(N!==0){var U=x;for(U.pendingLanes|=2,U.entangledLanes|=2;N;){var ee=1<<31-Ze(N);U.entanglements[1]|=ee,N&=~ee}ir(x),(_t&6)===0&&($c=ut()+500,Jo(0))}}break;case 31:case 13:U=Ns(x,2),U!==null&&si(U,x,2),Fc(),bf(x,2)}if(x=Sf(l),x===null&&af(t,i,l,su,s),x===b)break;b=x}b!==null&&l.stopPropagation()}else af(t,i,l,null,s)}}function Sf(t){return t=We(t),wf(t)}var su=null;function wf(t){if(su=null,t=J(t),t!==null){var i=g(t);if(i===null)t=null;else{var s=i.tag;if(s===13){if(t=_(i),t!==null)return t;t=null}else if(s===31){if(t=c(i),t!==null)return t;t=null}else if(s===3){if(i.stateNode.current.memoizedState.isDehydrated)return i.tag===3?i.stateNode.containerInfo:null;t=null}else i!==t&&(t=null)}}return su=t,null}function Q0(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 Xn:return 32;case bn:return 268435456;default:return 32}default:return 32}}var xf=!1,us=null,hs=null,ds=null,sl=new Map,al=new Map,fs=[],ZE="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 e1(t,i){switch(t){case"focusin":case"focusout":us=null;break;case"dragenter":case"dragleave":hs=null;break;case"mouseover":case"mouseout":ds=null;break;case"pointerover":case"pointerout":sl.delete(i.pointerId);break;case"gotpointercapture":case"lostpointercapture":al.delete(i.pointerId)}}function ol(t,i,s,l,b,x){return t===null||t.nativeEvent!==x?(t={blockedOn:i,domEventName:s,eventSystemFlags:l,nativeEvent:x,targetContainers:[b]},i!==null&&(i=_e(i),i!==null&&Z0(i)),t):(t.eventSystemFlags|=l,i=t.targetContainers,b!==null&&i.indexOf(b)===-1&&i.push(b),t)}function JE(t,i,s,l,b){switch(i){case"focusin":return us=ol(us,t,i,s,l,b),!0;case"dragenter":return hs=ol(hs,t,i,s,l,b),!0;case"mouseover":return ds=ol(ds,t,i,s,l,b),!0;case"pointerover":var x=b.pointerId;return sl.set(x,ol(sl.get(x)||null,t,i,s,l,b)),!0;case"gotpointercapture":return x=b.pointerId,al.set(x,ol(al.get(x)||null,t,i,s,l,b)),!0}return!1}function t1(t){var i=J(t.target);if(i!==null){var s=g(i);if(s!==null){if(i=s.tag,i===13){if(i=_(s),i!==null){t.blockedOn=i,dr(t.priority,function(){J0(s)});return}}else if(i===31){if(i=c(s),i!==null){t.blockedOn=i,dr(t.priority,function(){J0(s)});return}}else if(i===3&&s.stateNode.current.memoizedState.isDehydrated){t.blockedOn=s.tag===3?s.stateNode.containerInfo:null;return}}}t.blockedOn=null}function au(t){if(t.blockedOn!==null)return!1;for(var i=t.targetContainers;0<i.length;){var s=Sf(t.nativeEvent);if(s===null){s=t.nativeEvent;var l=new s.constructor(s.type,s);Te=l,s.target.dispatchEvent(l),Te=null}else return i=_e(s),i!==null&&Z0(i),t.blockedOn=s,!1;i.shift()}return!0}function n1(t,i,s){au(t)&&s.delete(i)}function QE(){xf=!1,us!==null&&au(us)&&(us=null),hs!==null&&au(hs)&&(hs=null),ds!==null&&au(ds)&&(ds=null),sl.forEach(n1),al.forEach(n1)}function ou(t,i){t.blockedOn===i&&(t.blockedOn=null,xf||(xf=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,QE)))}var lu=null;function i1(t){lu!==t&&(lu=t,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){lu===t&&(lu=null);for(var i=0;i<t.length;i+=3){var s=t[i],l=t[i+1],b=t[i+2];if(typeof l!="function"){if(wf(l||s)===null)continue;break}var x=_e(s);x!==null&&(t.splice(i,3),i-=3,yd(x,{pending:!0,data:b,method:s.method,action:l},l,b))}}))}function Ha(t){function i(ee){return ou(ee,t)}us!==null&&ou(us,t),hs!==null&&ou(hs,t),ds!==null&&ou(ds,t),sl.forEach(i),al.forEach(i);for(var s=0;s<fs.length;s++){var l=fs[s];l.blockedOn===t&&(l.blockedOn=null)}for(;0<fs.length&&(s=fs[0],s.blockedOn===null);)t1(s),s.blockedOn===null&&fs.shift();if(s=(t.ownerDocument||t).$$reactFormReplay,s!=null)for(l=0;l<s.length;l+=3){var b=s[l],x=s[l+1],N=b[Nt]||null;if(typeof x=="function")N||i1(s);else if(N){var U=null;if(x&&x.hasAttribute("formAction")){if(b=x,N=x[Nt]||null)U=N.formAction;else if(wf(b)!==null)continue}else U=N.action;typeof U=="function"?s[l+1]=U:(s.splice(l,3),l-=3),i1(s)}}}function r1(){function t(x){x.canIntercept&&x.info==="react-transition"&&x.intercept({handler:function(){return new Promise(function(N){return b=N})},focusReset:"manual",scroll:"manual"})}function i(){b!==null&&(b(),b=null),l||setTimeout(s,20)}function s(){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",i),navigation.addEventListener("navigateerror",i),setTimeout(s,100),function(){l=!0,navigation.removeEventListener("navigate",t),navigation.removeEventListener("navigatesuccess",i),navigation.removeEventListener("navigateerror",i),b!==null&&(b(),b=null)}}}function Cf(t){this._internalRoot=t}cu.prototype.render=Cf.prototype.render=function(t){var i=this._internalRoot;if(i===null)throw Error(a(409));var s=i.current,l=_i();Y0(s,l,t,i,null,null)},cu.prototype.unmount=Cf.prototype.unmount=function(){var t=this._internalRoot;if(t!==null){this._internalRoot=null;var i=t.containerInfo;Y0(t.current,2,null,t,null,null),Fc(),i[Ui]=null}};function cu(t){this._internalRoot=t}cu.prototype.unstable_scheduleHydration=function(t){if(t){var i=hr();t={blockedOn:null,target:t,priority:i};for(var s=0;s<fs.length&&i!==0&&i<fs[s].priority;s++);fs.splice(s,0,t),s===0&&t1(t)}};var s1=n.version;if(s1!=="19.2.7")throw Error(a(527,s1,"19.2.7"));q.findDOMNode=function(t){var i=t._reactInternals;if(i===void 0)throw typeof t.render=="function"?Error(a(188)):(t=Object.keys(t).join(","),Error(a(268,t)));return t=d(i),t=t!==null?y(t):null,t=t===null?null:t.stateNode,t};var e5={bundleType:0,version:"19.2.7",rendererPackageName:"react-dom",currentDispatcherRef:z,reconcilerVersion:"19.2.7"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var uu=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!uu.isDisabled&&uu.supportsFiber)try{An=uu.inject(e5),ve=uu}catch{}}return cl.createRoot=function(t,i){if(!o(t))throw Error(a(299));var s=!1,l="",b=dv,x=fv,N=pv;return i!=null&&(i.unstable_strictMode===!0&&(s=!0),i.identifierPrefix!==void 0&&(l=i.identifierPrefix),i.onUncaughtError!==void 0&&(b=i.onUncaughtError),i.onCaughtError!==void 0&&(x=i.onCaughtError),i.onRecoverableError!==void 0&&(N=i.onRecoverableError)),i=K0(t,1,!1,null,null,s,l,null,b,x,N,r1),t[Ui]=i.current,sf(t),new Cf(i)},cl.hydrateRoot=function(t,i,s){if(!o(t))throw Error(a(299));var l=!1,b="",x=dv,N=fv,U=pv,ee=null;return s!=null&&(s.unstable_strictMode===!0&&(l=!0),s.identifierPrefix!==void 0&&(b=s.identifierPrefix),s.onUncaughtError!==void 0&&(x=s.onUncaughtError),s.onCaughtError!==void 0&&(N=s.onCaughtError),s.onRecoverableError!==void 0&&(U=s.onRecoverableError),s.formState!==void 0&&(ee=s.formState)),i=K0(t,1,!0,i,s??null,l,b,ee,x,N,U,r1),i.context=V0(null),s=i.current,l=_i(),l=nt(l),b=Jr(l),b.callback=null,Qr(s,b,l),s=l,i.current.lanes=s,ht(i,s),ir(i),t[Ui]=i.current,sf(t),new cu(i)},cl.version="19.2.7",cl}var g1;function z5(){if(g1)return Tf.exports;g1=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(),Tf.exports=P5(),Tf.exports}var H5=z5();var m1="popstate";function _1(e){return typeof e=="object"&&e!=null&&"pathname"in e&&"search"in e&&"hash"in e&&"state"in e&&"key"in e}function $5(e={}){function n(a,o){let g=o.state?.masked,{pathname:_,search:c,hash:u}=g||a.location;return Ap("",{pathname:_,search:c,hash:u},o.state&&o.state.usr||null,o.state&&o.state.key||"default",g?{pathname:a.location.pathname,search:a.location.search,hash:a.location.hash}:void 0)}function r(a,o){return typeof o=="string"?o:Il(o)}return F5(n,r,null,e)}function qt(e,n){if(e===!1||e===null||typeof e>"u")throw new Error(n)}function Xi(e,n){if(!e){typeof console<"u"&&console.warn(n);try{throw new Error(n)}catch{}}}function U5(){return Math.random().toString(36).substring(2,10)}function v1(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 Ap(e,n,r=null,a,o){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof n=="string"?ho(n):n,state:r,key:n&&n.key||a||U5(),mask:o}}function Il({pathname:e="/",search:n="",hash:r=""}){return n&&n!=="?"&&(e+=n.charAt(0)==="?"?n:"?"+n),r&&r!=="#"&&(e+=r.charAt(0)==="#"?r:"#"+r),e}function ho(e){let n={};if(e){let r=e.indexOf("#");r>=0&&(n.hash=e.substring(r),e=e.substring(0,r));let a=e.indexOf("?");a>=0&&(n.search=e.substring(a),e=e.substring(0,a)),e&&(n.pathname=e)}return n}function F5(e,n,r,a={}){let{window:o=document.defaultView,v5Compat:g=!1}=a,_=o.history,c="POP",u=null,d=y();d==null&&(d=0,_.replaceState({..._.state,idx:d},""));function y(){return(_.state||{idx:null}).idx}function m(){c="POP";let f=y(),v=f==null?null:f-d;d=f,u&&u({action:c,location:E.location,delta:v})}function w(f,v){c="PUSH";let p=_1(f)?f:Ap(E.location,f,v);d=y()+1;let S=v1(p,d),k=E.createHref(p.mask||p);try{_.pushState(S,"",k)}catch(L){if(L instanceof DOMException&&L.name==="DataCloneError")throw L;o.location.assign(k)}g&&u&&u({action:c,location:E.location,delta:1})}function C(f,v){c="REPLACE";let p=_1(f)?f:Ap(E.location,f,v);d=y();let S=v1(p,d),k=E.createHref(p.mask||p);_.replaceState(S,"",k),g&&u&&u({action:c,location:E.location,delta:0})}function A(f){return W5(o,f)}let E={get action(){return c},get location(){return e(o,_)},listen(f){if(u)throw new Error("A history only accepts one active listener");return o.addEventListener(m1,m),u=f,()=>{o.removeEventListener(m1,m),u=null}},createHref(f){return n(o,f)},createURL:A,encodeLocation(f){let v=A(f);return{pathname:v.pathname,search:v.search,hash:v.hash}},push:w,replace:C,go(f){return _.go(f)}};return E}function W5(e,n,r=!1){let a="http://localhost";e&&(a=e.location.origin!=="null"?e.location.origin:e.location.href),qt(a,"No window.location.(origin|href) available to create URL");let o=typeof n=="string"?n:Il(n);return o=o.replace(/ $/,"%20"),!r&&o.startsWith("//")&&(o=a+o),new URL(o,a)}function bS(e,n,r="/"){return G5(e,n,r,!1)}function G5(e,n,r,a,o){let g=typeof n=="string"?ho(n):n,_=Hr(g.pathname||"/",r);if(_==null)return null;let c=q5(e),u=null,d=rk(_);for(let y=0;u==null&&y<c.length;++y)u=nk(c[y],d,a);return u}function q5(e){let n=yS(e);return K5(n),n}function yS(e,n=[],r=[],a="",o=!1){let g=(_,c,u=o,d)=>{let y={relativePath:d===void 0?_.path||"":d,caseSensitive:_.caseSensitive===!0,childrenIndex:c,route:_};if(y.relativePath.startsWith("/")){if(!y.relativePath.startsWith(a)&&u)return;qt(y.relativePath.startsWith(a),`Absolute route path "${y.relativePath}" nested under path "${a}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),y.relativePath=y.relativePath.slice(a.length)}let m=Yi([a,y.relativePath]),w=r.concat(y);_.children&&_.children.length>0&&(qt(_.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${m}".`),yS(_.children,n,w,m,u)),!(_.path==null&&!_.index)&&n.push({path:m,score:ek(m,_.index),routesMeta:w})};return e.forEach((_,c)=>{if(_.path===""||!_.path?.includes("?"))g(_,c);else for(let u of SS(_.path))g(_,c,!0,u)}),n}function SS(e){let n=e.split("/");if(n.length===0)return[];let[r,...a]=n,o=r.endsWith("?"),g=r.replace(/\?$/,"");if(a.length===0)return o?[g,""]:[g];let _=SS(a.join("/")),c=[];return c.push(..._.map(u=>u===""?g:[g,u].join("/"))),o&&c.push(..._),c.map(u=>e.startsWith("/")&&u===""?"/":u)}function K5(e){e.sort((n,r)=>n.score!==r.score?r.score-n.score:tk(n.routesMeta.map(a=>a.childrenIndex),r.routesMeta.map(a=>a.childrenIndex)))}var V5=/^:[\w-]+$/,Y5=3,X5=2,Z5=1,J5=10,Q5=-2,b1=e=>e==="*";function ek(e,n){let r=e.split("/"),a=r.length;return r.some(b1)&&(a+=Q5),n&&(a+=X5),r.filter(o=>!b1(o)).reduce((o,g)=>o+(V5.test(g)?Y5:g===""?Z5:J5),a)}function tk(e,n){return e.length===n.length&&e.slice(0,-1).every((a,o)=>a===n[o])?e[e.length-1]-n[n.length-1]:0}function nk(e,n,r=!1){let{routesMeta:a}=e,o={},g="/",_=[];for(let c=0;c<a.length;++c){let u=a[c],d=c===a.length-1,y=g==="/"?n:n.slice(g.length)||"/",m=Wu({path:u.relativePath,caseSensitive:u.caseSensitive,end:d},y),w=u.route;if(!m&&d&&r&&!a[a.length-1].route.index&&(m=Wu({path:u.relativePath,caseSensitive:u.caseSensitive,end:!1},y)),!m)return null;Object.assign(o,m.params),_.push({params:o,pathname:Yi([g,m.pathname]),pathnameBase:lk(Yi([g,m.pathnameBase])),route:w}),m.pathnameBase!=="/"&&(g=Yi([g,m.pathnameBase]))}return _}function Wu(e,n){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[r,a]=ik(e.path,e.caseSensitive,e.end),o=n.match(r);if(!o)return null;let g=o[0],_=g.replace(/(.)\/+$/,"$1"),c=o.slice(1);return{params:a.reduce((d,{paramName:y,isOptional:m},w)=>{if(y==="*"){let A=c[w]||"";_=g.slice(0,g.length-A.length).replace(/(.)\/+$/,"$1")}const C=c[w];return m&&!C?d[y]=void 0:d[y]=(C||"").replace(/%2F/g,"/"),d},{}),pathname:g,pathnameBase:_,pattern:e}}function ik(e,n=!1,r=!0){Xi(e==="*"||!e.endsWith("*")||e.endsWith("/*"),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,"/*")}".`);let a=[],o="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(_,c,u,d,y)=>{if(a.push({paramName:c,isOptional:u!=null}),u){let m=y.charAt(d+_.length);return m&&m!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}return"/([^\\/]+)"}).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return e.endsWith("*")?(a.push({paramName:"*"}),o+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):r?o+="\\/*$":e!==""&&e!=="/"&&(o+="(?:(?=\\/|$))"),[new RegExp(o,n?void 0:"i"),a]}function rk(e){try{return e.split("/").map(n=>decodeURIComponent(n).replace(/\//g,"%2F")).join("/")}catch(n){return Xi(!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 Hr(e,n){if(n==="/")return e;if(!e.toLowerCase().startsWith(n.toLowerCase()))return null;let r=n.endsWith("/")?n.length-1:n.length,a=e.charAt(r);return a&&a!=="/"?null:e.slice(r)||"/"}var sk=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function ak(e,n="/"){let{pathname:r,search:a="",hash:o=""}=typeof e=="string"?ho(e):e,g;return r?(r=wS(r),r.startsWith("/")?g=y1(r.substring(1),"/"):g=y1(r,n)):g=n,{pathname:g,search:ck(a),hash:uk(o)}}function y1(e,n){let r=Gu(n).split("/");return e.split("/").forEach(o=>{o===".."?r.length>1&&r.pop():o!=="."&&r.push(o)}),r.length>1?r.join("/"):"/"}function Nf(e,n,r,a){return`Cannot include a '${e}' character in a manually specified \`to.${n}\` field [${JSON.stringify(a)}]. Please separate it out to the \`to.${r}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function ok(e){return e.filter((n,r)=>r===0||n.route.path&&n.route.path.length>0)}function Pg(e){let n=ok(e);return n.map((r,a)=>a===n.length-1?r.pathname:r.pathnameBase)}function lh(e,n,r,a=!1){let o;typeof e=="string"?o=ho(e):(o={...e},qt(!o.pathname||!o.pathname.includes("?"),Nf("?","pathname","search",o)),qt(!o.pathname||!o.pathname.includes("#"),Nf("#","pathname","hash",o)),qt(!o.search||!o.search.includes("#"),Nf("#","search","hash",o)));let g=e===""||o.pathname==="",_=g?"/":o.pathname,c;if(_==null)c=r;else{let m=n.length-1;if(!a&&_.startsWith("..")){let w=_.split("/");for(;w[0]==="..";)w.shift(),m-=1;o.pathname=w.join("/")}c=m>=0?n[m]:"/"}let u=ak(o,c),d=_&&_!=="/"&&_.endsWith("/"),y=(g||_===".")&&r.endsWith("/");return!u.pathname.endsWith("/")&&(d||y)&&(u.pathname+="/"),u}var wS=e=>e.replace(/\/\/+/g,"/"),Yi=e=>wS(e.join("/")),Gu=e=>e.replace(/\/+$/,""),lk=e=>Gu(e).replace(/^\/*/,"/"),ck=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,uk=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,hk=class{constructor(e,n,r,a=!1){this.status=e,this.statusText=n||"",this.internal=a,r instanceof Error?(this.data=r.toString(),this.error=r):this.data=r}};function dk(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}function fk(e){let n=e.map(r=>r.route.path).filter(Boolean);return Yi(n)||"/"}var xS=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function CS(e,n){let r=e;if(typeof r!="string"||!sk.test(r))return{absoluteURL:void 0,isExternal:!1,to:r};let a=r,o=!1;if(xS)try{let g=new URL(window.location.href),_=r.startsWith("//")?new URL(g.protocol+r):new URL(r),c=Hr(_.pathname,n);_.origin===g.origin&&c!=null?r=c+_.search+_.hash:o=!0}catch{Xi(!1,`<Link to="${r}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:a,isExternal:o,to:r}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var ES=["POST","PUT","PATCH","DELETE"];new Set(ES);var pk=["GET",...ES];new Set(pk);var fo=j.createContext(null);fo.displayName="DataRouter";var ch=j.createContext(null);ch.displayName="DataRouterState";var kS=j.createContext(!1);function gk(){return j.useContext(kS)}var AS=j.createContext({isTransitioning:!1});AS.displayName="ViewTransition";var mk=j.createContext(new Map);mk.displayName="Fetchers";var _k=j.createContext(null);_k.displayName="Await";var wi=j.createContext(null);wi.displayName="Navigation";var Yl=j.createContext(null);Yl.displayName="Location";var cr=j.createContext({outlet:null,matches:[],isDataRoute:!1});cr.displayName="Route";var zg=j.createContext(null);zg.displayName="RouteError";var TS="REACT_ROUTER_ERROR",vk="REDIRECT",bk="ROUTE_ERROR_RESPONSE";function yk(e){if(e.startsWith(`${TS}:${vk}:{`))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 Sk(e){if(e.startsWith(`${TS}:${bk}:{`))try{let n=JSON.parse(e.slice(40));if(typeof n=="object"&&n&&typeof n.status=="number"&&typeof n.statusText=="string")return new hk(n.status,n.statusText,n.data)}catch{}}function wk(e,{relative:n}={}){qt(po(),"useHref() may be used only in the context of a <Router> component.");let{basename:r,navigator:a}=j.useContext(wi),{hash:o,pathname:g,search:_}=Xl(e,{relative:n}),c=g;return r!=="/"&&(c=g==="/"?r:Yi([r,g])),a.createHref({pathname:c,search:_,hash:o})}function po(){return j.useContext(Yl)!=null}function $i(){return qt(po(),"useLocation() may be used only in the context of a <Router> component."),j.useContext(Yl).location}var RS="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function LS(e){j.useContext(wi).static||j.useLayoutEffect(e)}function uh(){let{isDataRoute:e}=j.useContext(cr);return e?Bk():xk()}function xk(){qt(po(),"useNavigate() may be used only in the context of a <Router> component.");let e=j.useContext(fo),{basename:n,navigator:r}=j.useContext(wi),{matches:a}=j.useContext(cr),{pathname:o}=$i(),g=JSON.stringify(Pg(a)),_=j.useRef(!1);return LS(()=>{_.current=!0}),j.useCallback((u,d={})=>{if(Xi(_.current,RS),!_.current)return;if(typeof u=="number"){r.go(u);return}let y=lh(u,JSON.parse(g),o,d.relative==="path");e==null&&n!=="/"&&(y.pathname=y.pathname==="/"?n:Yi([n,y.pathname])),(d.replace?r.replace:r.push)(y,d.state,d)},[n,r,g,o,e])}j.createContext(null);function Xl(e,{relative:n}={}){let{matches:r}=j.useContext(cr),{pathname:a}=$i(),o=JSON.stringify(Pg(r));return j.useMemo(()=>lh(e,JSON.parse(o),a,n==="path"),[e,o,a,n])}function Ck(e,n){return MS(e,n)}function MS(e,n,r){qt(po(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:a}=j.useContext(wi),{matches:o}=j.useContext(cr),g=o[o.length-1],_=g?g.params:{},c=g?g.pathname:"/",u=g?g.pathnameBase:"/",d=g&&g.route;{let f=d&&d.path||"";OS(c,!d||f.endsWith("*")||f.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${c}" (under <Route path="${f}">) 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="${f}"> to <Route path="${f==="/"?"*":`${f}/*`}">.`)}let y=$i(),m;if(n){let f=typeof n=="string"?ho(n):n;qt(u==="/"||f.pathname?.startsWith(u),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${u}" but pathname "${f.pathname}" was given in the \`location\` prop.`),m=f}else m=y;let w=m.pathname||"/",C=w;if(u!=="/"){let f=u.replace(/^\//,"").split("/");C="/"+w.replace(/^\//,"").split("/").slice(f.length).join("/")}let A=r&&r.state.matches.length?r.state.matches.map(f=>Object.assign(f,{route:r.manifest[f.route.id]||f.route})):bS(e,{pathname:C});Xi(d||A!=null,`No routes matched location "${m.pathname}${m.search}${m.hash}" `),Xi(A==null||A[A.length-1].route.element!==void 0||A[A.length-1].route.Component!==void 0||A[A.length-1].route.lazy!==void 0,`Matched leaf route at location "${m.pathname}${m.search}${m.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=Rk(A&&A.map(f=>Object.assign({},f,{params:Object.assign({},_,f.params),pathname:Yi([u,a.encodeLocation?a.encodeLocation(f.pathname.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:f.pathname]),pathnameBase:f.pathnameBase==="/"?u:Yi([u,a.encodeLocation?a.encodeLocation(f.pathnameBase.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:f.pathnameBase])})),o,r);return n&&E?j.createElement(Yl.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",mask:void 0,...m},navigationType:"POP"}},E):E}function Ek(){let e=Dk(),n=dk(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),r=e instanceof Error?e.stack:null,a="rgba(200,200,200, 0.5)",o={padding:"0.5rem",backgroundColor:a},g={padding:"2px 4px",backgroundColor:a},_=null;return console.error("Error handled by React Router default ErrorBoundary:",e),_=j.createElement(j.Fragment,null,j.createElement("p",null,"💿 Hey developer 👋"),j.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",j.createElement("code",{style:g},"ErrorBoundary")," or"," ",j.createElement("code",{style:g},"errorElement")," prop on your route.")),j.createElement(j.Fragment,null,j.createElement("h2",null,"Unexpected Application Error!"),j.createElement("h3",{style:{fontStyle:"italic"}},n),r?j.createElement("pre",{style:o},r):null,_)}var kk=j.createElement(Ek,null),NS=class extends j.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,n){return n.location!==e.location||n.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:n.error,location:n.location,revalidation:e.revalidation||n.revalidation}}componentDidCatch(e,n){this.props.onError?this.props.onError(e,n):console.error("React Router caught the following error during render",e)}render(){let e=this.state.error;if(this.context&&typeof e=="object"&&e&&"digest"in e&&typeof e.digest=="string"){const r=Sk(e.digest);r&&(e=r)}let n=e!==void 0?j.createElement(cr.Provider,{value:this.props.routeContext},j.createElement(zg.Provider,{value:e,children:this.props.component})):this.props.children;return this.context?j.createElement(Ak,{error:e},n):n}};NS.contextType=kS;var Of=new WeakMap;function Ak({children:e,error:n}){let{basename:r}=j.useContext(wi);if(typeof n=="object"&&n&&"digest"in n&&typeof n.digest=="string"){let a=yk(n.digest);if(a){let o=Of.get(n);if(o)throw o;let g=CS(a.location,r);if(xS&&!Of.get(n))if(g.isExternal||a.reloadDocument)window.location.href=g.absoluteURL||g.to;else{const _=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(g.to,{replace:a.replace}));throw Of.set(n,_),_}return j.createElement("meta",{httpEquiv:"refresh",content:`0;url=${g.absoluteURL||g.to}`})}}return e}function Tk({routeContext:e,match:n,children:r}){let a=j.useContext(fo);return a&&a.static&&a.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(a.staticContext._deepestRenderedBoundaryId=n.route.id),j.createElement(cr.Provider,{value:e},r)}function Rk(e,n=[],r){let a=r?.state;if(e==null){if(!a)return null;if(a.errors)e=a.matches;else if(n.length===0&&!a.initialized&&a.matches.length>0)e=a.matches;else return null}let o=e,g=a?.errors;if(g!=null){let y=o.findIndex(m=>m.route.id&&g?.[m.route.id]!==void 0);qt(y>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(g).join(",")}`),o=o.slice(0,Math.min(o.length,y+1))}let _=!1,c=-1;if(r&&a){_=a.renderFallback;for(let y=0;y<o.length;y++){let m=o[y];if((m.route.HydrateFallback||m.route.hydrateFallbackElement)&&(c=y),m.route.id){let{loaderData:w,errors:C}=a,A=m.route.loader&&!w.hasOwnProperty(m.route.id)&&(!C||C[m.route.id]===void 0);if(m.route.lazy||A){r.isStatic&&(_=!0),c>=0?o=o.slice(0,c+1):o=[o[0]];break}}}}let u=r?.onError,d=a&&u?(y,m)=>{u(y,{location:a.location,params:a.matches?.[0]?.params??{},pattern:fk(a.matches),errorInfo:m})}:void 0;return o.reduceRight((y,m,w)=>{let C,A=!1,E=null,f=null;a&&(C=g&&m.route.id?g[m.route.id]:void 0,E=m.route.errorElement||kk,_&&(c<0&&w===0?(OS("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),A=!0,f=null):c===w&&(A=!0,f=m.route.hydrateFallbackElement||null)));let v=n.concat(o.slice(0,w+1)),p=()=>{let S;return C?S=E:A?S=f:m.route.Component?S=j.createElement(m.route.Component,null):m.route.element?S=m.route.element:S=y,j.createElement(Tk,{match:m,routeContext:{outlet:y,matches:v,isDataRoute:a!=null},children:S})};return a&&(m.route.ErrorBoundary||m.route.errorElement||w===0)?j.createElement(NS,{location:a.location,revalidation:a.revalidation,component:E,error:C,children:p(),routeContext:{outlet:null,matches:v,isDataRoute:!0},onError:d}):p()},null)}function Hg(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Lk(e){let n=j.useContext(fo);return qt(n,Hg(e)),n}function Mk(e){let n=j.useContext(ch);return qt(n,Hg(e)),n}function Nk(e){let n=j.useContext(cr);return qt(n,Hg(e)),n}function $g(e){let n=Nk(e),r=n.matches[n.matches.length-1];return qt(r.route.id,`${e} can only be used on routes that contain a unique "id"`),r.route.id}function Ok(){return $g("useRouteId")}function Dk(){let e=j.useContext(zg),n=Mk("useRouteError"),r=$g("useRouteError");return e!==void 0?e:n.errors?.[r]}function Bk(){let{router:e}=Lk("useNavigate"),n=$g("useNavigate"),r=j.useRef(!1);return LS(()=>{r.current=!0}),j.useCallback(async(o,g={})=>{Xi(r.current,RS),r.current&&(typeof o=="number"?await e.navigate(o):await e.navigate(o,{fromRouteId:n,...g}))},[e,n])}var S1={};function OS(e,n,r){!n&&!S1[e]&&(S1[e]=!0,Xi(!1,r))}j.memo(jk);function jk({routes:e,manifest:n,future:r,state:a,isStatic:o,onError:g}){return MS(e,void 0,{manifest:n,state:a,isStatic:o,onError:g})}function w1({to:e,replace:n,state:r,relative:a}){qt(po(),"<Navigate> may be used only in the context of a <Router> component.");let{static:o}=j.useContext(wi);Xi(!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:g}=j.useContext(cr),{pathname:_}=$i(),c=uh(),u=lh(e,Pg(g),_,a==="path"),d=JSON.stringify(u);return j.useEffect(()=>{c(JSON.parse(d),{replace:n,state:r,relative:a})},[c,d,a,n,r]),null}function qa(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 Ik({basename:e="/",children:n=null,location:r,navigationType:a="POP",navigator:o,static:g=!1,useTransitions:_}){qt(!po(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let c=e.replace(/^\/*/,"/"),u=j.useMemo(()=>({basename:c,navigator:o,static:g,useTransitions:_,future:{}}),[c,o,g,_]);typeof r=="string"&&(r=ho(r));let{pathname:d="/",search:y="",hash:m="",state:w=null,key:C="default",mask:A}=r,E=j.useMemo(()=>{let f=Hr(d,c);return f==null?null:{location:{pathname:f,search:y,hash:m,state:w,key:C,mask:A},navigationType:a}},[c,d,y,m,w,C,a,A]);return Xi(E!=null,`<Router basename="${c}"> is not able to match the URL "${d}${y}${m}" because it does not start with the basename, so the <Router> won't render anything.`),E==null?null:j.createElement(wi.Provider,{value:u},j.createElement(Yl.Provider,{children:n,value:E}))}function Pk({children:e,location:n}){return Ck(Tp(e),n)}function Tp(e,n=[]){let r=[];return j.Children.forEach(e,(a,o)=>{if(!j.isValidElement(a))return;let g=[...n,o];if(a.type===j.Fragment){r.push.apply(r,Tp(a.props.children,g));return}qt(a.type===qa,`[${typeof a.type=="string"?a.type:a.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),qt(!a.props.index||!a.props.children,"An index route cannot have child routes.");let _={id:a.props.id||g.join("-"),caseSensitive:a.props.caseSensitive,element:a.props.element,Component:a.props.Component,index:a.props.index,path:a.props.path,middleware:a.props.middleware,loader:a.props.loader,action:a.props.action,hydrateFallbackElement:a.props.hydrateFallbackElement,HydrateFallback:a.props.HydrateFallback,errorElement:a.props.errorElement,ErrorBoundary:a.props.ErrorBoundary,hasErrorBoundary:a.props.hasErrorBoundary===!0||a.props.ErrorBoundary!=null||a.props.errorElement!=null,shouldRevalidate:a.props.shouldRevalidate,handle:a.props.handle,lazy:a.props.lazy};a.props.children&&(_.children=Tp(a.props.children,g)),r.push(_)}),r}var Tu="get",Ru="application/x-www-form-urlencoded";function hh(e){return typeof HTMLElement<"u"&&e instanceof HTMLElement}function zk(e){return hh(e)&&e.tagName.toLowerCase()==="button"}function Hk(e){return hh(e)&&e.tagName.toLowerCase()==="form"}function $k(e){return hh(e)&&e.tagName.toLowerCase()==="input"}function Uk(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function Fk(e,n){return e.button===0&&(!n||n==="_self")&&!Uk(e)}var hu=null;function Wk(){if(hu===null)try{new FormData(document.createElement("form"),0),hu=!1}catch{hu=!0}return hu}var Gk=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Df(e){return e!=null&&!Gk.has(e)?(Xi(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Ru}"`),null):e}function qk(e,n){let r,a,o,g,_;if(Hk(e)){let c=e.getAttribute("action");a=c?Hr(c,n):null,r=e.getAttribute("method")||Tu,o=Df(e.getAttribute("enctype"))||Ru,g=new FormData(e)}else if(zk(e)||$k(e)&&(e.type==="submit"||e.type==="image")){let c=e.form;if(c==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let u=e.getAttribute("formaction")||c.getAttribute("action");if(a=u?Hr(u,n):null,r=e.getAttribute("formmethod")||c.getAttribute("method")||Tu,o=Df(e.getAttribute("formenctype"))||Df(c.getAttribute("enctype"))||Ru,g=new FormData(c,e),!Wk()){let{name:d,type:y,value:m}=e;if(y==="image"){let w=d?`${d}.`:"";g.append(`${w}x`,"0"),g.append(`${w}y`,"0")}else d&&g.append(d,m)}}else{if(hh(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');r=Tu,a=null,o=Ru,_=e}return g&&o==="text/plain"&&(_=g,g=void 0),{action:a,method:r.toLowerCase(),encType:o,formData:g,body:_}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function Ug(e,n){if(e===!1||e===null||typeof e>"u")throw new Error(n)}function DS(e,n,r,a){let o=typeof e=="string"?new URL(e,typeof window>"u"?"server://singlefetch/":window.location.origin):e;return r?o.pathname.endsWith("/")?o.pathname=`${o.pathname}_.${a}`:o.pathname=`${o.pathname}.${a}`:o.pathname==="/"?o.pathname=`_root.${a}`:n&&Hr(o.pathname,n)==="/"?o.pathname=`${Gu(n)}/_root.${a}`:o.pathname=`${Gu(o.pathname)}.${a}`,o}async function Kk(e,n){if(e.id in n)return n[e.id];try{let r=await import(e.module);return n[e.id]=r,r}catch(r){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(r),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function Vk(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 Yk(e,n,r){let a=await Promise.all(e.map(async o=>{let g=n.routes[o.route.id];if(g){let _=await Kk(g,r);return _.links?_.links():[]}return[]}));return Qk(a.flat(1).filter(Vk).filter(o=>o.rel==="stylesheet"||o.rel==="preload").map(o=>o.rel==="stylesheet"?{...o,rel:"prefetch",as:"style"}:{...o,rel:"prefetch"}))}function x1(e,n,r,a,o,g){let _=(u,d)=>r[d]?u.route.id!==r[d].route.id:!0,c=(u,d)=>r[d].pathname!==u.pathname||r[d].route.path?.endsWith("*")&&r[d].params["*"]!==u.params["*"];return g==="assets"?n.filter((u,d)=>_(u,d)||c(u,d)):g==="data"?n.filter((u,d)=>{let y=a.routes[u.route.id];if(!y||!y.hasLoader)return!1;if(_(u,d)||c(u,d))return!0;if(u.route.shouldRevalidate){let m=u.route.shouldRevalidate({currentUrl:new URL(o.pathname+o.search+o.hash,window.origin),currentParams:r[0]?.params||{},nextUrl:new URL(e,window.origin),nextParams:u.params,defaultShouldRevalidate:!0});if(typeof m=="boolean")return m}return!0}):[]}function Xk(e,n,{includeHydrateFallback:r}={}){return Zk(e.map(a=>{let o=n.routes[a.route.id];if(!o)return[];let g=[o.module];return o.clientActionModule&&(g=g.concat(o.clientActionModule)),o.clientLoaderModule&&(g=g.concat(o.clientLoaderModule)),r&&o.hydrateFallbackModule&&(g=g.concat(o.hydrateFallbackModule)),o.imports&&(g=g.concat(o.imports)),g}).flat(1))}function Zk(e){return[...new Set(e)]}function Jk(e){let n={},r=Object.keys(e).sort();for(let a of r)n[a]=e[a];return n}function Qk(e,n){let r=new Set;return new Set(n),e.reduce((a,o)=>{let g=JSON.stringify(Jk(o));return r.has(g)||(r.add(g),a.push({key:g,link:o})),a},[])}function Fg(){let e=j.useContext(fo);return Ug(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function eA(){let e=j.useContext(ch);return Ug(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var Wg=j.createContext(void 0);Wg.displayName="FrameworkContext";function Gg(){let e=j.useContext(Wg);return Ug(e,"You must render this element inside a <HydratedRouter> element"),e}function tA(e,n){let r=j.useContext(Wg),[a,o]=j.useState(!1),[g,_]=j.useState(!1),{onFocus:c,onBlur:u,onMouseEnter:d,onMouseLeave:y,onTouchStart:m}=n,w=j.useRef(null);j.useEffect(()=>{if(e==="render"&&_(!0),e==="viewport"){let E=v=>{v.forEach(p=>{_(p.isIntersecting)})},f=new IntersectionObserver(E,{threshold:.5});return w.current&&f.observe(w.current),()=>{f.disconnect()}}},[e]),j.useEffect(()=>{if(a){let E=setTimeout(()=>{_(!0)},100);return()=>{clearTimeout(E)}}},[a]);let C=()=>{o(!0)},A=()=>{o(!1),_(!1)};return r?e!=="intent"?[g,w,{}]:[g,w,{onFocus:ul(c,C),onBlur:ul(u,A),onMouseEnter:ul(d,C),onMouseLeave:ul(y,A),onTouchStart:ul(m,C)}]:[!1,w,{}]}function ul(e,n){return r=>{e&&e(r),r.defaultPrevented||n(r)}}function nA({page:e,...n}){let r=gk(),{router:a}=Fg(),o=j.useMemo(()=>bS(a.routes,e,a.basename),[a.routes,e,a.basename]);return o?r?j.createElement(rA,{page:e,matches:o,...n}):j.createElement(sA,{page:e,matches:o,...n}):null}function iA(e){let{manifest:n,routeModules:r}=Gg(),[a,o]=j.useState([]);return j.useEffect(()=>{let g=!1;return Yk(e,n,r).then(_=>{g||o(_)}),()=>{g=!0}},[e,n,r]),a}function rA({page:e,matches:n,...r}){let a=$i(),{future:o}=Gg(),{basename:g}=Fg(),_=j.useMemo(()=>{if(e===a.pathname+a.search+a.hash)return[];let c=DS(e,g,o.v8_trailingSlashAwareDataRequests,"rsc"),u=!1,d=[];for(let y of n)typeof y.route.shouldRevalidate=="function"?u=!0:d.push(y.route.id);return u&&d.length>0&&c.searchParams.set("_routes",d.join(",")),[c.pathname+c.search]},[g,o.v8_trailingSlashAwareDataRequests,e,a,n]);return j.createElement(j.Fragment,null,_.map(c=>j.createElement("link",{key:c,rel:"prefetch",as:"fetch",href:c,...r})))}function sA({page:e,matches:n,...r}){let a=$i(),{future:o,manifest:g,routeModules:_}=Gg(),{basename:c}=Fg(),{loaderData:u,matches:d}=eA(),y=j.useMemo(()=>x1(e,n,d,g,a,"data"),[e,n,d,g,a]),m=j.useMemo(()=>x1(e,n,d,g,a,"assets"),[e,n,d,g,a]),w=j.useMemo(()=>{if(e===a.pathname+a.search+a.hash)return[];let E=new Set,f=!1;if(n.forEach(p=>{let S=g.routes[p.route.id];!S||!S.hasLoader||(!y.some(k=>k.route.id===p.route.id)&&p.route.id in u&&_[p.route.id]?.shouldRevalidate||S.hasClientLoader?f=!0:E.add(p.route.id))}),E.size===0)return[];let v=DS(e,c,o.v8_trailingSlashAwareDataRequests,"data");return f&&E.size>0&&v.searchParams.set("_routes",n.filter(p=>E.has(p.route.id)).map(p=>p.route.id).join(",")),[v.pathname+v.search]},[c,o.v8_trailingSlashAwareDataRequests,u,a,g,y,n,e,_]),C=j.useMemo(()=>Xk(m,g),[m,g]),A=iA(m);return j.createElement(j.Fragment,null,w.map(E=>j.createElement("link",{key:E,rel:"prefetch",as:"fetch",href:E,...r})),C.map(E=>j.createElement("link",{key:E,rel:"modulepreload",href:E,...r})),A.map(({key:E,link:f})=>j.createElement("link",{key:E,nonce:r.nonce,...f,crossOrigin:f.crossOrigin??r.crossOrigin})))}function aA(...e){return n=>{e.forEach(r=>{typeof r=="function"?r(n):r!=null&&(r.current=n)})}}var oA=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{oA&&(window.__reactRouterVersion="7.17.0")}catch{}function lA({basename:e,children:n,useTransitions:r,window:a}){let o=j.useRef();o.current==null&&(o.current=$5({window:a,v5Compat:!0}));let g=o.current,[_,c]=j.useState({action:g.action,location:g.location}),u=j.useCallback(d=>{r===!1?c(d):j.startTransition(()=>c(d))},[r]);return j.useLayoutEffect(()=>g.listen(u),[g,u]),j.createElement(Ik,{basename:e,children:n,location:_.location,navigationType:_.action,navigator:g,useTransitions:r})}var BS=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Pl=j.forwardRef(function({onClick:n,discover:r="render",prefetch:a="none",relative:o,reloadDocument:g,replace:_,mask:c,state:u,target:d,to:y,preventScrollReset:m,viewTransition:w,defaultShouldRevalidate:C,...A},E){let{basename:f,navigator:v,useTransitions:p}=j.useContext(wi),S=typeof y=="string"&&BS.test(y),k=CS(y,f);y=k.to;let L=wk(y,{relative:o}),R=$i(),M=null;if(c){let Y=lh(c,[],R.mask?R.mask.pathname:"/",!0);f!=="/"&&(Y.pathname=Y.pathname==="/"?f:Yi([f,Y.pathname])),M=v.createHref(Y)}let[T,I,K]=tA(a,A),F=hA(y,{replace:_,mask:c,state:u,target:d,preventScrollReset:m,relative:o,viewTransition:w,defaultShouldRevalidate:C,useTransitions:p});function G(Y){n&&n(Y),Y.defaultPrevented||F(Y)}let B=!(k.isExternal||g),X=j.createElement("a",{...A,...K,href:(B?M:void 0)||k.absoluteURL||L,onClick:B?G:n,ref:aA(E,I),target:d,"data-discover":!S&&r==="render"?"true":void 0});return T&&!S?j.createElement(j.Fragment,null,X,j.createElement(nA,{page:L})):X});Pl.displayName="Link";var Rp=j.forwardRef(function({"aria-current":n="page",caseSensitive:r=!1,className:a="",end:o=!1,style:g,to:_,viewTransition:c,children:u,...d},y){let m=Xl(_,{relative:d.relative}),w=$i(),C=j.useContext(ch),{navigator:A,basename:E}=j.useContext(wi),f=C!=null&&mA(m)&&c===!0,v=A.encodeLocation?A.encodeLocation(m).pathname:m.pathname,p=w.pathname,S=C&&C.navigation&&C.navigation.location?C.navigation.location.pathname:null;r||(p=p.toLowerCase(),S=S?S.toLowerCase():null,v=v.toLowerCase()),S&&E&&(S=Hr(S,E)||S);const k=v!=="/"&&v.endsWith("/")?v.length-1:v.length;let L=p===v||!o&&p.startsWith(v)&&p.charAt(k)==="/",R=S!=null&&(S===v||!o&&S.startsWith(v)&&S.charAt(v.length)==="/"),M={isActive:L,isPending:R,isTransitioning:f},T=L?n:void 0,I;typeof a=="function"?I=a(M):I=[a,L?"active":null,R?"pending":null,f?"transitioning":null].filter(Boolean).join(" ");let K=typeof g=="function"?g(M):g;return j.createElement(Pl,{...d,"aria-current":T,className:I,ref:y,style:K,to:_,viewTransition:c},typeof u=="function"?u(M):u)});Rp.displayName="NavLink";var cA=j.forwardRef(({discover:e="render",fetcherKey:n,navigate:r,reloadDocument:a,replace:o,state:g,method:_=Tu,action:c,onSubmit:u,relative:d,preventScrollReset:y,viewTransition:m,defaultShouldRevalidate:w,...C},A)=>{let{useTransitions:E}=j.useContext(wi),f=pA(),v=gA(c,{relative:d}),p=_.toLowerCase()==="get"?"get":"post",S=typeof c=="string"&&BS.test(c),k=L=>{if(u&&u(L),L.defaultPrevented)return;L.preventDefault();let R=L.nativeEvent.submitter,M=R?.getAttribute("formmethod")||_,T=()=>f(R||L.currentTarget,{fetcherKey:n,method:M,navigate:r,replace:o,state:g,relative:d,preventScrollReset:y,viewTransition:m,defaultShouldRevalidate:w});E&&r!==!1?j.startTransition(()=>T()):T()};return j.createElement("form",{ref:A,method:p,action:v,onSubmit:a?u:k,...C,"data-discover":!S&&e==="render"?"true":void 0})});cA.displayName="Form";function uA(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=j.useContext(fo);return qt(n,uA(e)),n}function hA(e,{target:n,replace:r,mask:a,state:o,preventScrollReset:g,relative:_,viewTransition:c,defaultShouldRevalidate:u,useTransitions:d}={}){let y=uh(),m=$i(),w=Xl(e,{relative:_});return j.useCallback(C=>{if(Fk(C,n)){C.preventDefault();let A=r!==void 0?r:Il(m)===Il(w),E=()=>y(e,{replace:A,mask:a,state:o,preventScrollReset:g,relative:_,viewTransition:c,defaultShouldRevalidate:u});d?j.startTransition(()=>E()):E()}},[m,y,w,r,a,o,n,e,g,_,c,u,d])}var dA=0,fA=()=>`__${String(++dA)}__`;function pA(){let{router:e}=jS("useSubmit"),{basename:n}=j.useContext(wi),r=Ok(),a=e.fetch,o=e.navigate;return j.useCallback(async(g,_={})=>{let{action:c,method:u,encType:d,formData:y,body:m}=qk(g,n);if(_.navigate===!1){let w=_.fetcherKey||fA();await a(w,r,_.action||c,{defaultShouldRevalidate:_.defaultShouldRevalidate,preventScrollReset:_.preventScrollReset,formData:y,body:m,formMethod:_.method||u,formEncType:_.encType||d,flushSync:_.flushSync})}else await o(_.action||c,{defaultShouldRevalidate:_.defaultShouldRevalidate,preventScrollReset:_.preventScrollReset,formData:y,body:m,formMethod:_.method||u,formEncType:_.encType||d,replace:_.replace,state:_.state,fromRouteId:r,flushSync:_.flushSync,viewTransition:_.viewTransition})},[a,o,n,r])}function gA(e,{relative:n}={}){let{basename:r}=j.useContext(wi),a=j.useContext(cr);qt(a,"useFormAction must be used inside a RouteContext");let[o]=a.matches.slice(-1),g={...Xl(e||".",{relative:n})},_=$i();if(e==null){g.search=_.search;let c=new URLSearchParams(g.search),u=c.getAll("index");if(u.some(y=>y==="")){c.delete("index"),u.filter(m=>m).forEach(m=>c.append("index",m));let y=c.toString();g.search=y?`?${y}`:""}}return(!e||e===".")&&o.route.index&&(g.search=g.search?g.search.replace(/^\?/,"?index&"):"?index"),r!=="/"&&(g.pathname=g.pathname==="/"?r:Yi([r,g.pathname])),Il(g)}function mA(e,{relative:n}={}){let r=j.useContext(AS);qt(r!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:a}=jS("useViewTransitionState"),o=Xl(e,{relative:n});if(!r.isTransitioning)return!1;let g=Hr(r.currentLocation.pathname,a)||r.currentLocation.pathname,_=Hr(r.nextLocation.pathname,a)||r.nextLocation.pathname;return Wu(o.pathname,_)!=null||Wu(o.pathname,g)!=null}var Js=vS();const _A="fleet-console.canvas.",qg="fleet-console.canvas.backgroundAnimation",Kg="fleet-console.canvas.perimeterAnimation",IS="fleet-console.canvas.maximized",vA=400,Lp=640,Mp=400,C1=40,E1=96,bA=.25,yA=1,Bf=.2,k1=.5,SA=.001,Xa={x:0,y:0,zoom:1},to={viewport:Xa,operations:{},operationOrder:[],operationAccent:{},minimized:[],collapsedGroups:[]},Np=new Set,Op=new Set,Dp=new Set,Bp=new Set,jp=new Set,zl=new Map;let yi=null,Cs=null,Ke=to,no=XA(),io=QA(),Nl=nT(),Vn=null,ws=Xa,Qs=null,qu=0;function Vg(e){return Np.add(e),()=>{Np.delete(e)}}function oo(){return Ke}function Ip(){return Vn}function wA(){return yi}function PS(){return j.useSyncExternalStore(Vg,oo,oo)}function xA(){return j.useSyncExternalStore(IA,T1,T1)}function CA(){return j.useSyncExternalStore(PA,R1,R1)}function zS(){return j.useSyncExternalStore(zA,L1,L1)}function HS(){return j.useSyncExternalStore(HA,M1,M1)}function $S(){return j.useSyncExternalStore(Vg,N1,N1)}function Si(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},qA(),FS()}function EA(e){const n=Ke.collapsedGroups.includes(e)?Ke.collapsedGroups.filter(r=>r!==e):[...Ke.collapsedGroups,e];Si({collapsedGroups:n})}function kA(){return j.useSyncExternalStore(Vg,O1,O1)}function Pp(e){Xg();const n=Zg(e);ws=n,Si({viewport:n})}function US(e){const n=Zg(e);if(typeof window>"u"||typeof window.requestAnimationFrame!="function"||GA()){Pp(n);return}ws=n,Qs===null&&(Qs=window.requestAnimationFrame(qS))}function zp(e,n){const r=ia();Si({operations:{...Ke.operations,[e]:{...Jg(n,r),zIndex:r}}})}function AA(e){Ke.minimized.includes(e)||(Vn===e&&lo(),Si({minimized:[...Ke.minimized,e]}))}function TA(e){if(!Ke.minimized.includes(e))return;Vn===e&&lo();const n=Ke.minimized.filter(o=>o!==e),r=Ke.operations[e];if(!r){Si({minimized:n});return}const a=ia();Si({minimized:n,operations:{...Ke.operations,[e]:{...r,zIndex:a}}})}function jf(e){Si({operationOrder:YS(e)})}function ia(){return qu+=1,qu}function RA(e){const n=Ke.operations[e];if(n)return n;const r=Object.keys(Ke.operations).length,a={x:r*C1,y:r*C1,width:Lp,height:Mp,zIndex:ia()};return Si({operations:{...Ke.operations,[e]:a}}),a}function LA(e){const n=new Set(e),r={};let a=!1;for(const[y,m]of Object.entries(Ke.operations))n.has(y)?r[y]=m:a=!0;const o=Ke.minimized.filter(y=>n.has(y)),g=o.length!==Ke.minimized.length,_=Ke.operationOrder.filter(y=>n.has(y)),c=_.length!==Ke.operationOrder.length,u=Object.fromEntries(Object.entries(Ke.operationAccent).filter(([y])=>n.has(y))),d=Object.keys(u).length!==Object.keys(Ke.operationAccent).length;Vn&&(!n.has(Vn)||o.includes(Vn))&&lo(),(a||g||c||d)&&Si({operations:r,minimized:o,operationOrder:_,operationAccent:u})}function MA(e){KA(),Xg(),UA(),yi=e,Ke=e?YA(e):to;const n=e?zl.get(e)??null:null,r=Vn!==n;Vn=n,ws=Ke.viewport,qu=Math.max(qu,XS(Ke.operations)),FS(),r&&Yg()}function A1(e,n){const r=Ke.operations[e];if(!r)return;const a=Math.max(bA,Math.min(yA,Math.min((n.width-E1)/r.width,(n.height-E1)/r.height))),o={x:n.width/2-(r.x+r.width/2)*a,y:n.height/2-(r.y+r.height/2)*a,zoom:a};Xg(),ws=o;const g=ia(),_=Ke.minimized.includes(e);Si({viewport:o,operations:{...Ke.operations,[e]:{...Jg(r,g),zIndex:g}},..._?{minimized:Ke.minimized.filter(c=>c!==e)}:{}})}function NA(){no=!no,JA(no),WS()}function OA(){io=!io,tT(io),GS()}function DA(e){e==="local"&&(no&&!ZA()&&(no=!1,WS()),io&&!eT()&&(io=!1,GS()))}function BA(){jA(!Nl)}function jA(e){Nl!==e&&(Nl=e,iT(Nl),$A())}function Ol(e){yi&&zl.set(yi,e);const n=FA(e),r=!WA(Ke.minimized,n),a=Vn!==e;a&&(Vn=e),r&&Si({minimized:n}),a&&Yg()}function lo(){yi&&zl.delete(yi),Vn!==null&&(Vn=null,Yg())}function IA(e){return Op.add(e),()=>{Op.delete(e)}}function T1(){return no}function PA(e){return Dp.add(e),()=>{Dp.delete(e)}}function R1(){return io}function FS(){for(const e of Np)e()}function WS(){for(const e of Op)e()}function GS(){for(const e of Dp)e()}function zA(e){return Bp.add(e),()=>{Bp.delete(e)}}function L1(){return Nl}function HA(e){return jp.add(e),()=>{jp.delete(e)}}function M1(){return Vn}function N1(){return Ke.minimized}function O1(){return Ke.collapsedGroups}function $A(){for(const e of Bp)e()}function Yg(){for(const e of jp)e()}function UA(){yi&&(Vn?zl.set(yi,Vn):zl.delete(yi))}function FA(e){return Object.keys(Ke.operations).filter(n=>n!==e)}function WA(e,n){return e.length===n.length&&e.every((r,a)=>r===n[a])}function qS(){const e=Ke.viewport,n=ws.x-e.x,r=ws.y-e.y,a=ws.zoom-e.zoom;if(Math.abs(n)<k1&&Math.abs(r)<k1&&Math.abs(a)<SA){Qs=null,Si({viewport:ws});return}Si({viewport:{x:e.x+n*Bf,y:e.y+r*Bf,zoom:e.zoom+a*Bf}}),Qs=typeof window<"u"?window.requestAnimationFrame(qS):null}function Xg(){Qs===null||typeof window>"u"||(window.cancelAnimationFrame(Qs),Qs=null)}function GA(){return typeof window>"u"||typeof window.matchMedia!="function"?!1:window.matchMedia("(prefers-reduced-motion: reduce)").matches}function qA(){!yi||typeof window>"u"||(VA(),Cs=window.setTimeout(()=>{Cs=null,KS(yi,Ke)},vA))}function KA(){!Cs||!yi||typeof window>"u"||(window.clearTimeout(Cs),Cs=null,KS(yi,Ke))}function VA(){!Cs||typeof window>"u"||(window.clearTimeout(Cs),Cs=null)}function YA(e){if(typeof window>"u")return to;try{const n=window.localStorage.getItem(VS(e));if(!n)return to;const r=JSON.parse(n);return rT(r)}catch{return to}}function KS(e,n){if(!(!e||typeof window>"u"))try{window.localStorage.setItem(VS(e),JSON.stringify(n))}catch{}}function XA(){if(typeof window>"u")return!0;try{const e=window.localStorage.getItem(qg);return e===null?!0:e==="true"}catch{return!0}}function ZA(){if(typeof window>"u")return!1;try{return window.localStorage.getItem(qg)!==null}catch{return!1}}function JA(e){if(!(typeof window>"u"))try{window.localStorage.setItem(qg,String(e))}catch{}}function QA(){if(typeof window>"u")return!0;try{const e=window.localStorage.getItem(Kg);return e===null?!0:e==="true"}catch{return!0}}function eT(){if(typeof window>"u")return!1;try{return window.localStorage.getItem(Kg)!==null}catch{return!1}}function tT(e){if(!(typeof window>"u"))try{window.localStorage.setItem(Kg,String(e))}catch{}}function nT(){if(typeof window>"u")return!1;try{return window.localStorage.getItem(IS)==="true"}catch{return!1}}function iT(e){if(!(typeof window>"u"))try{window.localStorage.setItem(IS,String(e))}catch{}}function VS(e){return`${_A}${e}`}function rT(e){if(!co(e))return to;const n=oT(e.operations);return{viewport:Zg(e.viewport),operations:n,operationOrder:YS(e.operationOrder),operationAccent:sT(e.operationAccent),minimized:aT(e.minimized,n),collapsedGroups:cT(e.collapsedGroups)}}function YS(e){if(!Array.isArray(e))return[];const n=new Set,r=[];for(const a of e)typeof a!="string"||n.has(a)||(n.add(a),r.push(a));return r}function sT(e){if(!co(e))return{};const n={};for(const[r,a]of Object.entries(e))typeof a=="string"&&(n[r]=a);return n}function aT(e,n){if(!Array.isArray(e))return[];const r=new Set,a=[];for(const o of e)typeof o!="string"||r.has(o)||!(o in n)||(r.add(o),a.push(o));return a}function Zg(e){if(!co(e))return Xa;const n=Dl(e.x,Xa.x),r=Dl(e.y,Xa.y),a=Hp(e.zoom,Xa.zoom);return{x:n,y:r,zoom:a}}function oT(e){if(!co(e))return{};const n={};for(const[r,a]of Object.entries(e))co(a)&&(n[r]=Jg(a,lT(n)));return n}function Jg(e,n){return co(e)?{x:Dl(e.x,0),y:Dl(e.y,0),width:Hp(e.width,Lp),height:Hp(e.height,Mp),zIndex:Dl(e.zIndex,n)}:{x:0,y:0,width:Lp,height:Mp,zIndex:n}}function lT(e){return XS(e)+1}function XS(e){return Math.max(0,...Object.values(e).map(n=>n.zIndex))}function Dl(e,n){return typeof e=="number"&&Number.isFinite(e)?e:n}function Hp(e,n){return typeof e=="number"&&Number.isFinite(e)&&e>0?e:n}function co(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function cT(e){if(!Array.isArray(e))return[];const n=new Set,r=[];for(const a of e)typeof a!="string"||n.has(a)||(n.add(a),r.push(a));return r}const uT=["canonicalCwd","cwd","providerSession","ticket","token","transcriptPath"];class ct extends Error{status;constructor(n,r){super(r),this.name="ApiError",this.status=n}}async function hT(e){const n=await fetch("/api/v1/theaters",{signal:e});await li(n);const r=await n.json();if(!Array.isArray(r.theaters))throw new ct(n.status,"Invalid Theater response");return{theaters:r.theaters.map(a=>nw(a,n.status))}}async function dT(e,n){const r=e?`?theaterId=${encodeURIComponent(e)}`:"",a=await fetch(`/api/v1/status${r}`,{signal:n});return await li(a),vT(await a.json(),a.status)}async function ZS(e={}){const n=e.force?"?force=true":"",r=await fetch(`/api/v1/updates/release-notes${n}`,{signal:e.signal});return await li(r),yT(await r.json(),r.status)}async function fT(e){const n=await fetch("/api/v1/updates/apply",{method:"POST",signal:e});return await li(n),bT(await n.json(),n.status)}async function JS(e,n){const r=await fetch("/api/v1/theaters",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({folderGrantId:e}),signal:n});await li(r);const a=await r.json();return nw(a,r.status)}async function pT(e,n){const r=await fetch("/api/v1/theaters/folder-listings",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:e}),signal:n});return await li(r),CT(await r.json(),r.status)}async function QS(e,n){const r=await fetch("/api/v1/theaters/folder-grants",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:e}),signal:n});await li(r);const a=await r.json();if(typeof a.folderGrantId!="string")throw new ct(r.status,"Invalid folder grant response");return a.folderGrantId}async function gT(e,n){const r=await fetch(`/api/v1/theaters/${encodeURIComponent(e)}`,{method:"DELETE",signal:n});await li(r)}async function Pi(e,n){const r=e?`?theaterId=${encodeURIComponent(e)}`:"",a=await fetch(`/api/v1/operations${r}`,{signal:n});await li(a);const o=await a.json();if(!Array.isArray(o.operations))throw new ct(a.status,"Invalid operations response");return o.operations.map(g=>tw(g,a.status))}async function El(e,n){const a=await fetch("/api/v1/operations/groups",{signal:n});await li(a);const o=await a.json();if(!Array.isArray(o.groups))throw new ct(a.status,"Invalid groups response");return o.groups.map(g=>Qg(g,a.status))}async function mT(e,n){const r=await fetch("/api/v1/operations/groups",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e),signal:n});await li(r);const a=await r.json();return Qg(a.group,r.status)}async function D1(e,n,r){const a=await fetch(`/api/v1/operations/groups/${encodeURIComponent(e)}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(n),signal:r});await li(a);const o=await a.json();return Qg(o.group,a.status)}async function _T(e,n){const r=await fetch(`/api/v1/operations/groups/${encodeURIComponent(e)}`,{method:"DELETE",signal:n});await li(r)}async function ew(e,n,r){return Lu(e,{title:n},r)}async function Lu(e,n,r){const a=await fetch(`/api/v1/operations/${encodeURIComponent(e)}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(n),signal:r});await li(a);const o=await a.json();return tw(o.operation,a.status)}function tw(e,n){const r=e;if(!r||typeof r.id!="string"||typeof r.theaterId!="string"||typeof r.type!="string"||typeof r.pluginId!="string"||typeof r.title!="string"||!r.payload||typeof r.payload!="object"||Array.isArray(r.payload)||!r.ts||typeof r.ts.createdAt!="number"||typeof r.ts.updatedAt!="number"||Hl(r)||Hl(r.payload))throw new ct(n,"Invalid operation response");return{id:r.id,theaterId:r.theaterId,type:r.type,pluginId:r.pluginId,title:r.title,payload:r.payload,geometry:r.geometry??null,accent:typeof r.accent=="string"?r.accent:null,groupId:r.groupId===null?null:typeof r.groupId=="string"?r.groupId:void 0,ts:r.ts}}function Qg(e,n){const r=e;if(!r||typeof r.id!="string"||typeof r.theaterId!="string"||typeof r.name!="string"||typeof r.color!="string"||typeof r.order!="number"||typeof r.createdAt!="number")throw new ct(n,"Invalid group response");return{id:r.id,theaterId:r.theaterId,name:r.name,color:r.color,order:r.order,createdAt:r.createdAt}}function nw(e,n){const r=e;if(!r||typeof r.id!="string"||typeof r.label!="string"||typeof r.createdAt!="string"||typeof r.lastOpenedAt!="string"||typeof r.hasWiki!="boolean"||typeof r.activeAdmiralCount!="number"||Hl(r))throw new ct(n,"Invalid Theater response");return r}function vT(e,n){const r=e;if(!r||typeof r.workspaces!="number"||typeof r.version!="string"||r.channel!=="stable"&&r.channel!=="local"&&r.channel!=="unknown"||typeof r.updateAvailable!="boolean"||typeof r.port!="number"||r.portMode!=="dynamic"&&r.portMode!=="static"||r.requestedPort!==null&&typeof r.requestedPort!="number"||typeof r.effectivePort!="number"||typeof r.portHonored!="boolean"||r.wikiServerStatus!=="available"&&r.wikiServerStatus!=="unavailable"&&r.wikiServerStatus!=="unknown")throw new ct(n,"Invalid status response");return{workspaces:r.workspaces,version:r.version,channel:r.channel,updateAvailable:r.updateAvailable,latestVersion:typeof r.latestVersion=="string"?r.latestVersion:void 0,port:r.port,portMode:r.portMode,requestedPort:r.requestedPort,effectivePort:r.effectivePort,portHonored:r.portHonored,wikiServerStatus:r.wikiServerStatus}}function bT(e,n){const r=e;if(!r||r.status!=="accepted")throw new ct(n,"Invalid update response");return{status:"accepted"}}function yT(e,n){const r=e;if(!r||!Array.isArray(r.notes)||r.sourceRef!=="main"||typeof r.fetchedAt!="number"||typeof r.stale!="boolean"||"url"in r||"token"in r||"path"in r)throw new ct(n,"Invalid release notes response");return{notes:r.notes.map(a=>ST(a,n)),sourceRef:"main",fetchedAt:r.fetchedAt,stale:r.stale}}function ST(e,n){const r=e;if(!r||typeof r.version!="string"||r.date!==null&&typeof r.date!="string"||!Array.isArray(r.sections))throw new ct(n,"Invalid release notes response");return{version:r.version,date:r.date,sections:r.sections.map(a=>wT(a,n))}}function wT(e,n){const r=e;if(!r||r.heading!=="Added"&&r.heading!=="Changed"&&r.heading!=="Fixed"&&r.heading!=="Removed"&&r.heading!=="Breaking Changes"||!Array.isArray(r.items))throw new ct(n,"Invalid release notes response");return{heading:r.heading,items:r.items.map(a=>xT(a,n))}}function xT(e,n){const r=e;if(!r||!Array.isArray(r.packageTags)||!r.packageTags.every(a=>typeof a=="string")||typeof r.text!="string")throw new ct(n,"Invalid release notes response");return{packageTags:r.packageTags,text:r.text}}function CT(e,n){const r=e;if(!r||typeof r.path!="string"||r.parentPath!==null&&typeof r.parentPath!="string"||!Array.isArray(r.roots)||!Array.isArray(r.entries)||Hl(r))throw new ct(n,"Invalid folder list response");return{path:r.path,parentPath:r.parentPath??null,roots:r.roots.filter(a=>typeof a=="string"),entries:r.entries.map(a=>ET(a,n)),truncated:r.truncated===!0?!0:void 0}}function ET(e,n){const r=e;if(!r||typeof r.name!="string"||typeof r.path!="string"||r.kind!=="dir"||typeof r.accessible!="boolean"||Hl(r))throw new ct(n,"Invalid folder entry response");return{name:r.name,path:r.path,kind:"dir",accessible:r.accessible}}function Hl(e){if(!e||typeof e!="object")return!1;const n=e;return uT.some(r=>r in n)}async function li(e){if(e.ok)return;let n=`${e.status} ${e.statusText}`;try{const r=await e.json();typeof r.error=="string"?n=r.error:typeof r.message=="string"&&(n=r.message)}catch{}throw new ct(e.status,n)}const kT="__unassigned__";function AT(e){const n=new Map(e.theaters.map(a=>[a.id,a])),r=[];for(const a of e.operations)a.theaterId&&r.push(LT(a,n.get(a.theaterId)));return r}function TT(e,n){const r=iw(n);return r.length===0?e:e.filter(a=>{const o=MT(a);return r.every(g=>o.includes(g))})}function RT(e){const n=[],r=new Map;for(const a of e){const o=a.theaterId??kT,g=r.get(o);if(g!==void 0){const _=n[g];_&&(n[g]={..._,entries:[..._.entries,a]});continue}r.set(o,n.length),n.push({theaterId:a.theaterId,theaterLabel:a.theaterLabel,entries:[a]})}return n}function iw(e){return e.trim().toLocaleLowerCase().split(/\s+/).filter(Boolean)}function LT(e,n){return{operationId:e.id,theaterId:e.theaterId,theaterLabel:n?.label??e.theaterId,operationName:e.title,pluginId:e.pluginId,status:"operation"}}function MT(e){return[e.operationName,e.theaterLabel,e.pluginId].join(" ").toLocaleLowerCase()}const $p="fleet-console.activeTheaterId",rw="fleet-console.commissioningSeen",sw="fleet-console.whatsNewSeenVersion",aw="fleet-console.notificationPreferences",ow=1,NT="maritime",du={globalMute:!1,dnd:!1,mutedTheaterIds:{}},Up=new Set;let B1=0,Fp=null,He={connection:"connecting",connectionError:null,activeTheme:NT,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:iR(),codexReader:null,codexReaderExpanded:!1};function Wp(){return He}function OT(e){return Up.add(e),()=>{Up.delete(e)}}function tt(e){He={...He,...e},QT()}function DT(e){He.operationsViewActive!==e&&tt({operationsViewActive:e})}function lw(e){jT(e),tt({activeTheme:e})}function BT(e){DA(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,...vw({...He,version:e.version})})}function cw(){tt({releaseNotesLoading:!0,releaseNotesError:null})}function uw(e){const n={...He,releaseNotes:e.notes,releaseNotesLoading:!1,releaseNotesError:null,releaseNotesSourceRef:e.sourceRef,releaseNotesFetchedAt:e.fetchedAt,releaseNotesStale:e.stale,selectedReleaseNoteKey:He.selectedReleaseNoteKey&&yw(e.notes,He.selectedReleaseNoteKey)?He.selectedReleaseNoteKey:bw(e.notes)};tt({releaseNotes:n.releaseNotes,releaseNotesLoading:n.releaseNotesLoading,releaseNotesError:n.releaseNotesError,releaseNotesSourceRef:n.releaseNotesSourceRef,releaseNotesFetchedAt:n.releaseNotesFetchedAt,releaseNotesStale:n.releaseNotesStale,...vw(n)})}function hw(e){tt({releaseNotesLoading:!1,releaseNotesError:e})}function jT(e){if(!(typeof document>"u")){if(e==="maritime"){document.documentElement.removeAttribute("data-theme");return}document.documentElement.setAttribute("data-theme",e)}}function IT(e){const n=_w(e,He.activeTheaterId);tt({theaters:e,activeTheaterId:n})}function PT(e){IT(e.theaters)}function zi(e){tt({operations:e,operationsHydrated:!0})}function kl(e){tt({groups:e})}function zT(e){fh(e),tt({activeTheaterId:e})}function ar(e){He.activeOperationId!==e&&tt({activeOperationId:e})}function HT(e,n){if(n==="idle"){dw(e);return}He.operationStatus[e]!==n&&tt({operationStatus:{...He.operationStatus,[e]:n}})}function dw(e){if(!(e in He.operationStatus))return;const n={...He.operationStatus};delete n[e],tt({operationStatus:n})}function $T(e){if(!e.operationId)return;const n=He.operations.find(u=>u.id===e.operationId);if(!n)return;const r=n.theaterId??null,a=He.theaters.find(u=>u.id===r)?.label??r??"Unknown",o=n.title,g=tR(e.kind);B1+=1;const _=He.operationNotifications[e.operationId],c=_?_.count+1:1;tt({operationNotifications:{...He.operationNotifications,[e.operationId]:{kind:g,operationId:e.operationId,theaterId:r,theaterLabel:a,operationLabel:o,count:c,lastRaisedSeq:B1}}})}function fw(){tt({addingTheater:!0,theaterError:null})}function pw(e){const n=[e,...He.theaters.filter(r=>r.id!==e.id)];fh(e.id),tt({theaters:n,activeTheaterId:e.id,addingTheater:!1,theaterError:null})}function UT(){tt({addingTheater:!1,theaterError:null})}function Gp(e){tt({addingTheater:!1,theaterError:e})}function dh(e){const n=He.operations.find(r=>r.id===e);n&&(fh(n.theaterId),tt({activeTheaterId:n.theaterId,activeOperationId:e,pendingOperationFocus:e,operationNotifications:mw(He.operationNotifications,e)}),window.dispatchEvent(new CustomEvent("fleet-console:focus-operation",{detail:{operationId:e}})))}function j1(){He.pendingOperationFocus!==null&&tt({pendingOperationFocus:null})}function FT(e,n,r){if(e.length===0)return null;const a=n?e.indexOf(n):-1,o=a===-1?r>0?0:e.length-1:(a+r+e.length)%e.length;return e[o]??null}function gw(e,n){if(n.length===0)return[...e].sort(qp);const r=new Map(n.map((a,o)=>[a,o]));return[...e].sort((a,o)=>{const g=r.get(a.id),_=r.get(o.id);return g!==void 0&&_!==void 0?g-_:g!==void 0?-1:_!==void 0?1:qp(a,o)})}function WT(e,n,r,a=[]){const o=gw(e,r),g=new Set(a),_=[...n].sort((u,d)=>u.order-d.order||u.createdAt-d.createdAt),c=new Map;for(const u of _)c.set(u.id,[]);c.set(null,[]);for(const u of o){const d=u.groupId??null;d!==null&&c.has(d)?c.get(d).push(u):c.get(null).push(u)}return[..._.filter(u=>!g.has(u.id)).flatMap(u=>c.get(u.id)??[]),...c.get(null)??[]]}function qp(e,n){return e.ts.createdAt-n.ts.createdAt||e.id.localeCompare(n.id)}function If(){tt({operationSearchOpen:!1})}function GT(){tt({operationSearchOpen:!He.operationSearchOpen})}function qT(){He.releaseNotes.length===0||He.whatsNewOpen||tt({whatsNewOpen:!0,selectedReleaseNoteKey:He.selectedReleaseNoteKey??bw(He.releaseNotes)})}function fu(){He.whatsNewOpen&&(He.automaticWhatsNewVersion&&oR(He.automaticWhatsNewVersion),tt({whatsNewOpen:!1,automaticWhatsNewVersion:null}))}function I1(e){yw(He.releaseNotes,e)&&tt({selectedReleaseNoteKey:e})}function hl(){sR(!0),He.onboardingOpen&&tt({onboardingOpen:!1})}function jr(e){tt({codexReader:e,codexReaderExpanded:!1})}function Mu(){He.codexReader!==null&&tt({codexReaderExpanded:!0})}function KT(){tt({codexReaderExpanded:!1})}function P1(){tt({codexReader:null,codexReaderExpanded:!1})}function z1(){if(He.bootstrapped)return;const e=He.theaters.length===0&&!rR();tt({bootstrapped:!0,onboardingOpen:e?!0:He.onboardingOpen})}function H1(e){const n=He.theaters.filter(_=>_.id!==e),r=_w(n,He.activeTheaterId===e?null:He.activeTheaterId),a=eR(He.operationNotifications,e),o=new Set(He.operations.filter(_=>_.theaterId===e).map(_=>_.id)),g=He.activeOperationId&&o.has(He.activeOperationId)?null:He.activeOperationId;fh(r),tt({theaters:n,activeTheaterId:r,activeOperationId:g,operationNotifications:a})}function VT(e){const n=mw(He.operationNotifications,e);n!==He.operationNotifications&&tt({operationNotifications:n})}function YT(e){const n={...He.notificationPreferences,globalMute:e};tm(n),tt({notificationPreferences:n})}function XT(e){const n={...He.notificationPreferences,dnd:e};tm(n),tt({notificationPreferences:n})}function ZT(e){const n={...He.notificationPreferences.mutedTheaterIds};n[e]?delete n[e]:n[e]=!0;const r={...He.notificationPreferences,mutedTheaterIds:n};tm(r),tt({notificationPreferences:r})}function JT(e){return AT(e)}function QT(){for(const e of Up)e()}function mw(e,n){if(!e[n])return e;const r={...e};return delete r[n],r}function eR(e,n){let r=!1;const a={};for(const[o,g]of Object.entries(e)){if(g.theaterId===n){r=!0;continue}a[o]=g}return r?a:e}function _w(e,n){const r=new Set(e.map(o=>o.id)),a=nR();return a&&r.has(a)?a:n&&r.has(n)?n:e[0]?.id??null}function tR(e){const n=e.toLowerCase();return n==="ended"||n.includes(".end")||n.includes("done")?"ended":"input-waiting"}function vw(e){const n=e.releaseNotes.findIndex(a=>a.version!=="Unreleased"),r=n>=0?e.releaseNotes[n]:void 0;return!r||!e.version||r.version!==e.version||aR()===r.version?{whatsNewOpen:e.whatsNewOpen,automaticWhatsNewVersion:e.automaticWhatsNewVersion,selectedReleaseNoteKey:e.selectedReleaseNoteKey}:{whatsNewOpen:!0,automaticWhatsNewVersion:r.version,selectedReleaseNoteKey:em(r.version,n)}}function bw(e){return e[0]?em(e[0].version,0):null}function yw(e,n){return e.some((r,a)=>em(r.version,a)===n)}function em(e,n){return`${e}:${n}`}function nR(){if(typeof window>"u")return null;try{return window.localStorage.getItem($p)}catch{return null}}function fh(e){if(!(typeof window>"u"))try{e?window.localStorage.setItem($p,e):window.localStorage.removeItem($p)}catch{}}function iR(){if(typeof window>"u")return du;try{const e=window.localStorage.getItem(aw);if(!e)return du;const n=JSON.parse(e);return lR(n)?{globalMute:n.preferences.globalMute,dnd:n.preferences.dnd,mutedTheaterIds:n.preferences.mutedTheaterIds}:du}catch{return du}}function rR(){if(typeof window>"u")return!1;try{return window.localStorage.getItem(rw)==="1"}catch{return!1}}function sR(e){if(!(typeof window>"u"))try{e&&window.localStorage.setItem(rw,"1")}catch{}}function aR(){if(Fp!==null)return Fp;if(typeof window>"u")return null;try{return window.localStorage.getItem(sw)}catch{return null}}function oR(e){if(Fp=e,!(typeof window>"u"))try{window.localStorage.setItem(sw,e)}catch{}}function tm(e){if(!(typeof window>"u"))try{window.localStorage.setItem(aw,JSON.stringify({version:ow,preferences:e}))}catch{}}function lR(e){if(!e||typeof e!="object")return!1;const n=e;if(n.version!==ow||!n.preferences||typeof n.preferences!="object")return!1;const r=n.preferences;return typeof r.globalMute=="boolean"&&typeof r.dnd=="boolean"&&!!r.mutedTheaterIds&&typeof r.mutedTheaterIds=="object"}const pu="directory-browser-sectors";function Sw({open:e,onCancel:n,onConfirm:r}){const[a,o]=j.useState(null),[g,_]=j.useState(null),[c,u]=j.useState(null),[d,y]=j.useState(""),[m,w]=j.useState(""),[C,A]=j.useState(0),E=j.useRef(null),f=j.useRef(null),v=async(Y,z)=>{_(Y),u(null),y(""),A(0);try{const q=await pT(Y,z);o(q)}catch(q){if(q instanceof DOMException&&q.name==="AbortError")return;u(q instanceof ct?q.message:String(q))}finally{_(null)}};j.useEffect(()=>{if(!e)return;const Y=new AbortController;return v(null,Y.signal),()=>Y.abort()},[e]),j.useEffect(()=>{e&&E.current?.focus()},[e,a?.path]);const p=a?.entries??[],S=j.useMemo(()=>{const Y=d.trim().toLowerCase();return Y===""?p:p.filter(z=>z.name.toLowerCase().includes(Y))},[p,d]),k=j.useMemo(()=>a?cR(a):[],[a]),L=a?$1(a.path):null,R=a?.roots??[],M=R.length>1,T=S.length===0?-1:Math.min(C,S.length-1);if(j.useEffect(()=>{if(T<0)return;f.current?.querySelector(`[data-index="${T}"]`)?.scrollIntoView({block:"nearest"})},[T,a?.path]),!e)return null;const I=Y=>{Y.accessible&&g===null&&v(Y.path)},K=()=>{a?.parentPath!=null&&g===null&&v(a.parentPath)},F=()=>{const Y=m.trim();Y!==""&&g===null&&v(Y)},G=a?.path??null,B=T>=0?`${pu}-${T}`:void 0,X=Y=>{switch(Y.key){case"Escape":d!==""?y(""):n();return;case"ArrowDown":Y.preventDefault(),A(z=>Math.min(z+1,Math.max(S.length-1,0)));return;case"ArrowUp":Y.preventDefault(),A(z=>Math.max(z-1,0));return;case"Enter":{Y.preventDefault();const z=S[T];z&&I(z);return}case"Backspace":d===""&&(Y.preventDefault(),K());return;default:return}};return Js.createPortal(h.jsxs("div",{className:"directory-browser-overlay",role:"presentation",children:[h.jsx("button",{type:"button",className:"directory-browser-scrim","aria-label":"Close",onClick:n}),h.jsxs("section",{className:"directory-browser-card",role:"dialog","aria-modal":"true","aria-label":"Establish Theater of Operations",onKeyDown:X,children:[h.jsxs("header",{className:"directory-browser-header",children:[h.jsx("span",{className:"directory-browser-sigil","aria-hidden":"true",children:h.jsx(dR,{})}),h.jsxs("div",{className:"directory-browser-heading",children:[h.jsx("span",{className:"directory-browser-kicker",children:"Theater of Operations"}),h.jsx("h2",{children:"Establish Theater"})]}),h.jsx("button",{type:"button",className:"directory-browser-close",onClick:n,"aria-label":"Close",children:"×"})]}),M?h.jsxs("div",{className:"directory-browser-roots",role:"group","aria-label":"Drives",children:[h.jsx("span",{className:"directory-browser-kicker",children:"Stations"}),h.jsx("div",{className:"directory-browser-root-chips",children:R.map(Y=>{const z=L!=null&&$1(Y)===L;return h.jsx("button",{type:"button",className:`directory-browser-root-chip ${z?"is-active":""}`,"aria-current":z?"location":void 0,disabled:g!==null,title:Y,onClick:()=>{g===null&&v(Y)},onKeyDown:q=>q.stopPropagation(),children:hR(Y)},Y)})})]}):null,h.jsx("nav",{className:"directory-browser-course","aria-label":"Path",children:k.map((Y,z)=>{const q=z===k.length-1;return h.jsxs("span",{className:"directory-browser-course-seg",children:[z>0?h.jsx("span",{className:"directory-browser-course-sep","aria-hidden":"true",children:"›"}):null,h.jsx("button",{type:"button",className:`directory-browser-crumb ${q?"is-current":""}`,"aria-current":q?"location":void 0,disabled:q||g!==null,title:Y.path,onClick:()=>{v(Y.path)},children:Y.label})]},Y.path)})}),h.jsxs("div",{className:"directory-browser-toolbar",children:[h.jsxs("div",{className:"directory-browser-filter",children:[h.jsx("span",{className:"directory-browser-filter-glyph","aria-hidden":"true",children:h.jsx(pR,{})}),h.jsx("input",{ref:E,type:"text",className:"directory-browser-filter-input",placeholder:"Filter sectors…","aria-label":"Filter folders","aria-controls":pu,value:d,spellCheck:!1,autoComplete:"off",onChange:Y=>{y(Y.target.value),A(0)}})]}),h.jsxs("button",{type:"button",className:"directory-browser-up",disabled:a?.parentPath==null||g!==null,title:"Up one sector (Backspace)",onClick:K,children:[h.jsx(gR,{}),h.jsx("span",{children:"Up"})]})]}),h.jsxs("div",{className:"directory-browser-jump",children:[h.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:m,spellCheck:!1,autoComplete:"off",onChange:Y=>w(Y.target.value),onKeyDown:Y=>{Y.stopPropagation(),Y.key==="Enter"&&(Y.preventDefault(),F())}}),h.jsx("button",{type:"button",className:"directory-browser-jump-button",disabled:m.trim()===""||g!==null,onClick:F,onKeyDown:Y=>Y.stopPropagation(),children:"Go"})]}),c?h.jsx("p",{className:"directory-browser-error",role:"alert",children:c}):null,h.jsx("div",{className:"directory-browser-list",id:pu,role:"listbox","aria-label":"Folders","aria-busy":g!==null,"aria-activedescendant":B,ref:f,children:g!==null?h.jsxs("p",{className:"directory-browser-state is-live",children:[h.jsx("span",{className:"directory-browser-scan-dot","aria-hidden":"true"}),"Scouting…"]}):S.length===0?h.jsx("p",{className:"directory-browser-state",children:d!==""?"No sectors match the filter.":"No sectors to advance into."}):S.map((Y,z)=>h.jsxs("div",{id:`${pu}-${z}`,"data-index":z,role:"option","aria-selected":z===T,"aria-disabled":!Y.accessible,className:`directory-browser-sector ${z===T?"is-active":""} ${Y.accessible?"":"is-locked"}`,title:Y.path,onClick:()=>{A(z),I(Y)},children:[h.jsx("span",{className:"directory-browser-sector-glyph","aria-hidden":"true",children:h.jsx(fR,{})}),h.jsx("span",{className:"directory-browser-sector-name",children:Y.name}),Y.accessible?h.jsx("span",{className:"directory-browser-sector-advance","aria-hidden":"true",children:"›"}):h.jsxs("span",{className:"directory-browser-sector-lock",children:[h.jsx(mR,{})," Locked"]})]},Y.path))}),a?.truncated?h.jsx("p",{className:"directory-browser-note",children:"Charting first 500 sectors only."}):null,h.jsxs("footer",{className:"directory-browser-actions",children:[h.jsxs("div",{className:"directory-browser-target",children:[h.jsx("span",{className:"directory-browser-target-label",children:"Theater Root"}),h.jsx("span",{className:"directory-browser-target-path",title:G??"",children:G??"Scouting…"})]}),h.jsxs("div",{className:"directory-browser-buttons",children:[h.jsx("button",{type:"button",className:"directory-browser-button",onClick:n,children:"Cancel"}),h.jsx("button",{type:"button",className:"directory-browser-button is-primary",disabled:G===null||g!==null,onClick:()=>G&&r(G),children:"Establish Theater"})]})]})]})]}),document.body)}function cR(e){if(uR(e)==="/"){const _=[{label:"/",path:"/"}];let c="";for(const u of e.path.split("/").filter(Boolean))c+=`/${u}`,_.push({label:u,path:c});return _}const r=/^([A-Za-z]:)\\?/.exec(e.path),a=r?`${r[1]}\\`:e.roots[0]??"C:\\",o=[{label:a,path:a}];let g=a.replace(/\\$/,"");for(const _ of e.path.slice(a.length).split("\\").filter(Boolean))g+=`\\${_}`,o.push({label:_,path:g});return o}function uR(e){return e.roots.some(n=>/^[A-Za-z]:\\$/.test(n))||/^[A-Za-z]:\\/.test(e.path)?"\\":"/"}function $1(e){return/^([A-Za-z]:)\\?/.exec(e)?.[1]?.toLowerCase()??null}function hR(e){return e.replace(/[\\/]+$/,"")||e}function dR(){return h.jsxs("svg",{viewBox:"0 0 20 20","aria-hidden":"true",children:[h.jsx("circle",{cx:"10",cy:"10",r:"6.6",fill:"none",stroke:"currentColor",strokeWidth:"1.2"}),h.jsx("circle",{cx:"10",cy:"10",r:"2.1",fill:"currentColor"}),h.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 fR(){return h.jsx("svg",{viewBox:"0 0 18 18","aria-hidden":"true",children:h.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 pR(){return h.jsxs("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:[h.jsx("circle",{cx:"7",cy:"7",r:"4.2",fill:"none",stroke:"currentColor",strokeWidth:"1.3"}),h.jsx("path",{d:"M10.2 10.2 13.5 13.5",fill:"none",stroke:"currentColor",strokeWidth:"1.3",strokeLinecap:"round"})]})}function gR(){return h.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:h.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 mR(){return h.jsxs("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:[h.jsx("rect",{x:"3.6",y:"7",width:"8.8",height:"6.2",rx:"1.4",fill:"none",stroke:"currentColor",strokeWidth:"1.2"}),h.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 _R=["a[href]","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])","[tabindex]:not([tabindex='-1'])"].join(",");function vR({state:e}){const[n,r]=j.useState(!1),a=j.useRef(null),o=j.useRef(null),g=j.useRef(null),_=e.theaters.length>0;if(j.useEffect(()=>{if(e.onboardingOpen)return a.current=document.activeElement,o.current?.focus(),()=>{const y=a.current;a.current=null,y?.focus?.()}},[e.onboardingOpen]),j.useEffect(()=>{if(!e.onboardingOpen)return;const y=m=>{n||(m.key==="Escape"?(m.preventDefault(),hl()):m.key==="Tab"&&bR(m,g.current),m.stopImmediatePropagation())};return window.addEventListener("keydown",y,!0),()=>window.removeEventListener("keydown",y,!0)},[n,e.onboardingOpen]),!e.onboardingOpen)return null;const c=()=>{r(!0)},u=()=>{r(!1)},d=async y=>{r(!1),fw();try{const m=await QS(y),w=await JS(m);pw(w)}catch(m){Gp(m instanceof Error?m.message:String(m))}};return h.jsxs("div",{className:"commissioning-overlay",role:"dialog","aria-modal":"true","aria-labelledby":"commissioning-title",children:[h.jsx("button",{type:"button",className:"commissioning-scrim",onClick:hl,"aria-label":"Close Commissioning guide"}),h.jsxs("section",{className:"commissioning-card",ref:g,children:[h.jsxs("header",{className:"commissioning-header",children:[h.jsx("span",{className:"commissioning-eyebrow",children:"COMMISSIONING · FLEET CONSOLE"}),h.jsx("h2",{id:"commissioning-title",children:"Bring your fleet online"}),h.jsx("p",{children:"Three steps to go from an empty bridge to live carrier operations."})]}),h.jsxs("ol",{className:"commissioning-steps",children:[h.jsxs("li",{className:`commissioning-step commissioning-step--primary ${_?"is-complete":"is-current"}`,children:[h.jsx("span",{className:"commissioning-step-node","aria-hidden":"true",children:_?"✓":"01"}),h.jsxs("div",{className:"commissioning-step-body",children:[h.jsx("h3",{children:"Register a Theater"}),h.jsx("p",{children:"A Theater is a project directory the fleet operates in. Choose the folder you want to work from."}),_?h.jsx(Pl,{ref:y=>{o.current=y},className:"commissioning-primary-action",to:"/operations",onClick:hl,children:"Go to Operations →"}):h.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?h.jsx("p",{className:"commissioning-error",role:"alert",children:e.theaterError}):null]})]}),h.jsxs("li",{className:"commissioning-step",children:[h.jsx("span",{className:"commissioning-step-node","aria-hidden":"true",children:"02"}),h.jsxs("div",{className:"commissioning-step-body",children:[h.jsx("h3",{children:"Open an Operation"}),h.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."}),h.jsx(Pl,{className:"commissioning-secondary-link",to:"/operations",onClick:hl,children:"Go to Operations"})]})]}),h.jsxs("li",{className:"commissioning-step",children:[h.jsx("span",{className:"commissioning-step-node","aria-hidden":"true",children:"03"}),h.jsxs("div",{className:"commissioning-step-body",children:[h.jsx("h3",{children:"Observe carriers"}),h.jsx("p",{children:"Carriers are specialist agents your Admiral dispatches. Their sorties stream here in real time as they run."})]})]})]}),h.jsxs("footer",{className:"commissioning-footer",children:[h.jsx("p",{children:"Theaters with a Fleet Wiki knowledge root also unlock Codex — your decision log and reference library."}),h.jsx("button",{type:"button",className:"commissioning-skip",onClick:hl,children:"Skip for now"})]})]}),h.jsx(Sw,{open:n,onCancel:u,onConfirm:d})]})}function bR(e,n){if(!n)return;const r=Array.from(n.querySelectorAll(_R)),a=r[0],o=r[r.length-1];!a||!o||(e.shiftKey&&document.activeElement===a?(e.preventDefault(),o.focus()):!e.shiftKey&&document.activeElement===o&&(e.preventDefault(),a.focus()))}const yR="a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex='-1'])",U1="operation-search-listbox",ww="__unassigned__";function SR({state:e}){const n=uh(),[r,a]=j.useState(""),[o,g]=j.useState(0),_=j.useRef(null),c=j.useRef(null),u=j.useRef(null),d=j.useRef(new Map),y=j.useMemo(()=>JT(e),[e]),m=j.useMemo(()=>TT(y,r),[y,r]),w=j.useMemo(()=>RT(m),[m]),C=j.useMemo(()=>iw(r),[r]),A=F1(o,m.length),E=m[A]?W1(m[A].operationId):void 0;if(j.useEffect(()=>{if(!e.operationSearchOpen)return;u.current=document.activeElement instanceof HTMLElement?document.activeElement:null;const p=document.body.style.overflow;return document.body.style.overflow="hidden",window.setTimeout(()=>_.current?.focus(),0),()=>{document.body.style.overflow=p,u.current?.focus()}},[e.operationSearchOpen]),j.useEffect(()=>{if(!e.operationSearchOpen){a(""),g(0);return}g(0)},[e.operationSearchOpen,r]),j.useEffect(()=>{if(!e.operationSearchOpen)return;const p=m[A];p&&d.current.get(p.operationId)?.scrollIntoView({block:"nearest"})},[A,m,e.operationSearchOpen]),!e.operationSearchOpen)return null;const f=p=>{dh(p),n("/operations"),If()},v=p=>{if(p.key==="Escape"){p.preventDefault(),If();return}if(p.key==="ArrowDown"||p.key==="ArrowUp"){p.preventDefault(),g(S=>F1(S+(p.key==="ArrowDown"?1:-1),m.length));return}if(p.key==="Enter"){const S=m[A];if(!S)return;p.preventDefault(),f(S.operationId);return}p.key==="Tab"&&ER(p,c.current)};return h.jsx("div",{className:"operation-search-overlay",onMouseDown:p=>{p.target===p.currentTarget&&If()},children:h.jsxs("section",{ref:c,className:"operation-search-card",role:"dialog","aria-modal":"true","aria-label":"Operation quick search",tabIndex:-1,onKeyDown:v,children:[h.jsxs("div",{className:"operation-search-field",children:[h.jsx(kR,{}),h.jsx("input",{ref:_,id:"operation-search-input",type:"search",value:r,onChange:p=>a(p.target.value),placeholder:"Search Operations across Theaters",autoComplete:"off",role:"combobox","aria-expanded":!0,"aria-controls":U1,"aria-activedescendant":E,"aria-autocomplete":"list",spellCheck:!1}),h.jsx("kbd",{children:"esc"})]}),h.jsx("div",{id:U1,className:"operation-search-results",role:"listbox","aria-label":"Operation results",children:w.length>0?w.map(p=>{const S=xR(p.theaterId);return h.jsxs("section",{className:"operation-search-section",role:"group","aria-labelledby":S,children:[h.jsx("h2",{id:S,className:"operation-search-section-heading",children:Pf(p.theaterLabel,C)}),p.entries.map(k=>{const L=m.indexOf(k),R=L===A;return h.jsxs("button",{id:W1(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:()=>g(L),onClick:()=>f(k.operationId),children:[h.jsxs("span",{className:"operation-search-result-text",children:[h.jsx("strong",{children:Pf(k.operationName,C)}),h.jsx("small",{children:wR(k)})]}),h.jsx("span",{className:"operation-search-theater",children:Pf(k.theaterLabel,C)})]},k.operationId)})]},p.theaterId??ww)}):h.jsx("p",{className:"operation-search-empty",children:"No matching Operations."})})]})})}function F1(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 xR(e){return`operation-search-heading-${xw(e??ww)}`}function W1(e){return`operation-search-option-${xw(e)}`}function xw(e){return e.replace(/[^a-zA-Z0-9_-]/g,"-")}function Pf(e,n){if(n.length===0)return e;const r=[];let a=0;for(;a<e.length;){const o=CR(e,n,a);if(!o){r.push(e.slice(a));break}o.start>a&&r.push(e.slice(a,o.start)),r.push(h.jsx("mark",{children:e.slice(o.start,o.end)},`${o.start}-${o.end}`)),a=o.end}return r}function CR(e,n,r){const a=e.toLocaleLowerCase();let o=null;for(const g of n){const _=a.indexOf(g,r);_!==-1&&(!o||_<o.start)&&(o={start:_,end:_+g.length})}return o}function ER(e,n){if(!n)return;const r=Array.from(n.querySelectorAll(yR)).filter(g=>g.offsetParent!==null);if(r.length===0)return;const a=r[0],o=r[r.length-1];if(e.shiftKey&&document.activeElement===a){e.preventDefault(),o?.focus();return}!e.shiftKey&&document.activeElement===o&&(e.preventDefault(),a?.focus())}function kR(){return h.jsx("svg",{viewBox:"0 0 20 20","aria-hidden":"true",children:h.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 AR({open:e,title:n,message:r,tone:a="info",onDismiss:o}){return e?h.jsx("div",{className:"app-toast-host",children:h.jsxs("div",{className:`app-toast app-toast--${a}`,role:"status","aria-live":"polite",children:[h.jsx("span",{className:"app-toast-dot","aria-hidden":"true"}),h.jsxs("div",{className:"app-toast-body",children:[h.jsx("p",{className:"app-toast-title",children:n}),r?h.jsx("p",{className:"app-toast-message",children:r}):null]}),o?h.jsx("button",{type:"button",className:"app-toast-close",onClick:o,"aria-label":"Dismiss notification",children:"×"}):null]})}):null}function TR({state:e}){if(e.releaseNotesLoading||e.releaseNotes.length===0||e.releaseNotesError&&!e.releaseNotesStale)return null;const n=e.releaseNotes.find(a=>a.version===e.version),r=n&&e.version?` v${n.version}`:"";return h.jsx("button",{type:"button",className:"topbar-whatsnew-button",onMouseDown:a=>a.preventDefault(),onClick:qT,"aria-label":`What's new${r}`,title:`What's new${r}`,children:h.jsx("span",{children:"What's new"})})}const RR=1400,LR="https://github.com/sbluemin/fleet-harness",MR="https://github.com/sbluemin/fleet-harness/stargazers",NR="https://api.github.com/repos/sbluemin/fleet-harness",nm="fleet-console.github-stars",OR=360*60*1e3;function DR({state:e}){const n=e.connectionError!==null,r=$i().pathname,a=r.startsWith("/carrier-settings")?h.jsx(q1,{}):r.startsWith("/settings")?h.jsx(G1,{}):r.startsWith("/operations")?h.jsx(ZR,{}):h.jsx(XR,{});return h.jsxs("header",{className:"topbar",children:[h.jsxs("div",{className:"topbar-lead",children:[h.jsxs(Pl,{className:"topbar-brand",to:"/operations","aria-label":"Operations로 이동",children:[h.jsx("span",{className:`topbar-sigil ${n?"is-alert":""}`,"aria-hidden":"true",title:e.connectionError??void 0,children:a}),h.jsxs("h1",{className:"topbar-title",children:["Fleet",h.jsx("span",{className:"topbar-title-thin",children:"Console"})]})]}),h.jsxs("span",{className:"topbar-preview-badge",children:[h.jsx("span",{className:"topbar-preview-label",children:"Research Preview"}),e.version?h.jsxs("span",{className:"topbar-preview-version",children:["v",e.version]}):null]}),h.jsx(HR,{}),h.jsx(TR,{state:e})]}),h.jsx(zR,{state:e}),h.jsxs("div",{className:"topbar-meta",children:[e.updateAvailable?h.jsx(BR,{latestVersion:e.latestVersion}):null,h.jsxs(Rp,{to:"/carrier-settings",className:({isActive:o})=>`topbar-nav-link ${o?"is-active":""}`,title:"Carrier settings",children:[h.jsx("span",{className:"topbar-nav-icon","aria-hidden":"true",children:h.jsx(q1,{})}),h.jsx("span",{children:"Carriers"})]}),h.jsxs(Rp,{to:"/settings",className:({isActive:o})=>`topbar-nav-link ${o?"is-active":""}`,title:"Settings",children:[h.jsx("span",{className:"topbar-nav-icon","aria-hidden":"true",children:h.jsx(G1,{})}),h.jsx("span",{children:"Settings"})]})]})]})}function BR({latestVersion:e}){const[n,r]=j.useState("idle"),[a,o]=j.useState(null),g=j.useRef(null),_=jR(n,a,e);j.useEffect(()=>()=>{g.current!==null&&window.clearTimeout(g.current)},[]);const c=async()=>{if(!_.disabled){g.current!==null&&(window.clearTimeout(g.current),g.current=null),r("applying"),o(null);try{if((await fT()).status!=="accepted"){r("error"),o("invalid_response");return}r("accepted"),g.current=window.setTimeout(()=>{g.current=null,r("completed")},RR)}catch(u){const d=u instanceof ct?u.message:"network_error";o(d),r(PR(d)?"blocked":"error")}}};return h.jsx("button",{type:"button",className:`topbar-update-badge topbar-update-badge--${_.tone}`,onClick:c,disabled:_.disabled,title:_.title,"aria-live":"polite",children:_.label})}function jR(e,n,r){const a=r?`최신 버전 ${r}`:"업데이트 가능";return e==="applying"?{label:"요청 중",title:"업데이트 적용 요청을 보내는 중입니다.",tone:"live",disabled:!0}:e==="accepted"?{label:"업데이트 중",title:"서버가 곧 재시작되고 새 창에서 콘솔을 엽니다.",tone:"live",disabled:!0}:e==="completed"?{label:"완료: 새 창에서 계속",title:"새 창에서 재시작된 콘솔을 계속 사용하세요.",tone:"live",disabled:!0}:e==="blocked"?IR(n):e==="error"?{label:"재시도",title:"업데이트 요청에 실패했습니다. 다시 시도할 수 있습니다.",tone:"error",disabled:!1}:{label:"Update available",title:a,tone:"warn",disabled:!1}}function IR(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 PR(e){return e==="local_channel"||e==="update_already_in_progress"||e==="update_not_available"}function zR({state:e}){const[n,r]=j.useState(!1),[a,o]=j.useState(!1),g=j.useRef(null),_=j.useRef(null),c=j.useRef(null),u=e.theaters.find(f=>f.id===e.activeTheaterId)??null,d=u?.label??(e.theaters.length===0?"No Theaters":"Theater");j.useEffect(()=>{if(!n)return;const f=p=>{g.current?.contains(p.target)||r(!1)},v=p=>{p.key==="Escape"&&(r(!1),_.current?.focus())};return document.addEventListener("mousedown",f),document.addEventListener("keydown",v),()=>{document.removeEventListener("mousedown",f),document.removeEventListener("keydown",v)}},[n]),j.useEffect(()=>{if(!n)return;const f=c.current;if(!f)return;(f.querySelector('[data-active="true"]')??f.querySelector("[role^='menuitem']"))?.focus()},[n]);const y=f=>{zT(f),r(!1),_.current?.focus()},m=async()=>{r(!1),o(!0)},w=()=>{o(!1),UT()},C=async f=>{o(!1),fw();try{const v=await QS(f),p=await JS(v);pw(p)}catch(v){Gp(v instanceof Error?v.message:String(v))}},A=async()=>{if(u){r(!1);try{await gT(u.id),H1(u.id)}catch(f){if(f instanceof ct&&f.status===404){H1(u.id);return}Gp(f instanceof Error?f.message:String(f))}}},E=f=>{if(f.key!=="ArrowDown"&&f.key!=="ArrowUp")return;f.preventDefault();const v=Array.from(c.current?.querySelectorAll("[role^='menuitem']")??[]);if(v.length===0)return;const p=v.indexOf(document.activeElement),S=f.key==="ArrowDown"?1:-1,k=(p+S+v.length)%v.length;v[k]?.focus()};return h.jsxs("div",{className:"theater-control",ref:g,children:[h.jsx("span",{className:"theater-eyebrow","aria-hidden":"true",children:"Theater"}),h.jsxs("button",{type:"button",ref:_,className:`theater-trigger ${n?"is-open":""}`,"aria-haspopup":"menu","aria-expanded":n,"aria-label":"Theater",title:u?.label??e.theaterError??void 0,onClick:()=>r(f=>!f),children:[h.jsx("span",{className:"theater-trigger-sigil","aria-hidden":"true",children:h.jsx(qR,{})}),h.jsx("span",{className:"theater-trigger-label",children:d}),h.jsx("span",{className:"theater-trigger-caret","aria-hidden":"true",children:h.jsx(KR,{})})]}),n?h.jsxs("div",{className:"theater-menu",role:"menu","aria-label":"Theater",ref:c,onKeyDown:E,children:[e.theaters.length>0?h.jsx("ul",{className:"theater-menu-list",children:e.theaters.map(f=>{const v=f.id===e.activeTheaterId;return h.jsx("li",{children:h.jsxs("button",{type:"button",role:"menuitemradio","aria-checked":v,"data-active":v?"true":void 0,className:`theater-menu-item ${v?"is-active":""}`,title:f.label,onClick:()=>y(f.id),children:[h.jsx("span",{className:"theater-menu-check","aria-hidden":"true",children:v?h.jsx(VR,{}):null}),h.jsx("span",{className:"theater-menu-label",children:f.label})]})},f.id)})}):h.jsx("p",{className:"theater-menu-empty",children:"No Theaters yet."}),h.jsx("div",{className:"theater-menu-divider",role:"separator"}),u?h.jsxs(h.Fragment,{children:[h.jsxs("button",{type:"button",role:"menuitem",className:"theater-menu-item theater-menu-forget",onClick:A,children:[h.jsx("span",{className:"theater-menu-check","aria-hidden":"true",children:h.jsx(YR,{})}),h.jsx("span",{className:"theater-menu-label",children:"Forget Theater"})]}),h.jsx("div",{className:"theater-menu-divider",role:"separator"})]}):null,h.jsxs("button",{type:"button",role:"menuitem",className:"theater-menu-item theater-menu-add",disabled:e.addingTheater,onClick:m,children:[h.jsx("span",{className:"theater-menu-check","aria-hidden":"true",children:h.jsx(JR,{})}),h.jsx("span",{className:"theater-menu-label",children:e.addingTheater?"Adding Theater…":"Add Theater…"})]}),e.theaterError?h.jsx("p",{className:"theater-menu-error",children:e.theaterError}):null]}):null,h.jsx(Sw,{open:a,onCancel:w,onConfirm:C})]})}function HR(){const e=$R(),n=e.count!==null;return h.jsxs("div",{className:"topbar-github",role:"group","aria-label":"GitHub",children:[h.jsx("a",{className:"topbar-github-link",href:LR,target:"_blank",rel:"noopener noreferrer","aria-label":"GitHub 저장소 열기",title:"GitHub 저장소",children:h.jsx(QR,{})}),h.jsxs("a",{className:"topbar-github-stars",href:MR,target:"_blank",rel:"noopener noreferrer","aria-label":n?`GitHub 스타 ${e.count.toLocaleString()}개 — 스타 누르기`:"GitHub에서 스타 누르기",title:"GitHub에서 스타 누르기",children:[h.jsx(e3,{}),n?h.jsx("span",{className:"topbar-github-stars-count",children:GR(e.count)}):null]})]})}function $R(){const[e,n]=j.useState(()=>{const r=UR();return r===null?{count:null,status:"idle"}:{count:r,status:"ready"}});return j.useEffect(()=>{if(FR())return;let r=!1;return n(a=>a.status==="ready"?a:{...a,status:"loading"}),fetch(NR,{headers:{Accept:"application/vnd.github+json"}}).then(a=>a.ok?a.json():Promise.reject(new Error(`status ${a.status}`))).then(a=>{if(r)return;const o=typeof a.stargazers_count=="number"?a.stargazers_count:null;if(o===null){n(g=>({count:g.count,status:g.count===null?"error":"ready"}));return}WR(o),n({count:o,status:"ready"})}).catch(()=>{r||n(a=>({count:a.count,status:a.count===null?"error":"ready"}))}),()=>{r=!0}},[]),e}function UR(){try{const e=window.localStorage.getItem(nm);if(!e)return null;const n=JSON.parse(e);return typeof n.count=="number"?n.count:null}catch{return null}}function FR(){try{const e=window.localStorage.getItem(nm);if(!e)return!1;const n=JSON.parse(e);return typeof n.at=="number"&&Date.now()-n.at<OR}catch{return!1}}function WR(e){try{window.localStorage.setItem(nm,JSON.stringify({count:e,at:Date.now()}))}catch{}}function GR(e){if(e<1e3)return String(e);const n=e/1e3;return n<10?`${n.toFixed(1)}k`:`${Math.round(n)}k`}function qR(){return h.jsxs("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:[h.jsx("circle",{cx:"8",cy:"3.2",r:"1.5",fill:"none",stroke:"currentColor",strokeWidth:"1.2"}),h.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 KR(){return h.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:h.jsx("path",{d:"M4.5 6.5 8 10l3.5-3.5",fill:"none",stroke:"currentColor",strokeWidth:"1.3",strokeLinecap:"round",strokeLinejoin:"round"})})}function VR(){return h.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:h.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 YR(){return h.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:h.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 XR(){return h.jsxs("svg",{viewBox:"0 0 16 16",width:"16",height:"16",children:[h.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"}),h.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 ZR(){return h.jsxs("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:[h.jsx("circle",{cx:"8",cy:"8",r:"5.4",fill:"none",stroke:"currentColor",strokeWidth:"1.2"}),h.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"}),h.jsx("circle",{cx:"8",cy:"8",r:"1.1",fill:"currentColor"})]})}function G1(){return h.jsxs("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:[h.jsx("path",{d:"M3 4.4h10M3 8h10M3 11.6h10",fill:"none",stroke:"currentColor",strokeWidth:"1.2",strokeLinecap:"round"}),h.jsx("circle",{cx:"6.2",cy:"4.4",r:"1.3",fill:"var(--surface-glass-strong)",stroke:"currentColor",strokeWidth:"1.2"}),h.jsx("circle",{cx:"10",cy:"8",r:"1.3",fill:"var(--surface-glass-strong)",stroke:"currentColor",strokeWidth:"1.2"}),h.jsx("circle",{cx:"7.4",cy:"11.6",r:"1.3",fill:"var(--surface-glass-strong)",stroke:"currentColor",strokeWidth:"1.2"})]})}function q1(){return h.jsxs("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:[h.jsx("circle",{cx:"4",cy:"4.2",r:"1.15",fill:"currentColor"}),h.jsx("circle",{cx:"4",cy:"8",r:"1.15",fill:"currentColor"}),h.jsx("circle",{cx:"4",cy:"11.8",r:"1.15",fill:"currentColor"}),h.jsx("path",{d:"M7.2 4.2h6M7.2 8h6M7.2 11.8h6",fill:"none",stroke:"currentColor",strokeWidth:"1.2",strokeLinecap:"round"})]})}function JR(){return h.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:h.jsx("path",{d:"M8 3.4v9.2M3.4 8h9.2",fill:"none",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round"})})}function QR(){return h.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:h.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 e3(){return h.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:h.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 t3=["a[href]","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])","[tabindex]:not([tabindex='-1'])"].join(","),dl=10;function n3({state:e}){const n=j.useRef(null),r=j.useRef(null),a=j.useRef(null),o=!e.bootstrapped||e.onboardingOpen||e.operationSearchOpen;if(e.whatsNewOpen&&!o&&n.current===null&&(n.current=document.activeElement),j.useEffect(()=>{if(!e.whatsNewOpen||o)return;const E=f=>{f.key==="Escape"?(f.preventDefault(),fu()):f.key==="Tab"&&s3(f,a.current),f.stopImmediatePropagation()};return r.current?.focus(),window.addEventListener("keydown",E,!0),()=>{window.removeEventListener("keydown",E,!0);const f=n.current;n.current=null,f?.focus?.()}},[e.whatsNewOpen,o]),!e.whatsNewOpen||o||e.releaseNotes.length===0)return null;const g=e.selectedReleaseNoteKey??$a(e.releaseNotes[0]?.version??"",0),_=e.releaseNotes.findIndex((E,f)=>$a(E.version,f)===g),c=e.releaseNotes[_]??e.releaseNotes[0],u=$a(c.version,_>=0?_:0),d=()=>{cw(),ZS({force:!0}).then(uw).catch(E=>hw(E instanceof Error?E.message:String(E)))},y=Math.max(1,Math.ceil(e.releaseNotes.length/dl)),m=Math.min(y-1,Math.floor((_>=0?_:0)/dl)),w=m*dl,C=e.releaseNotes.slice(w,w+dl),A=E=>{const f=m+E;if(f<0||f>=y)return;const v=f*dl,p=e.releaseNotes[v];p&&I1($a(p.version,v))};return h.jsxs("div",{className:"whatsnew-overlay",role:"dialog","aria-modal":"true","aria-labelledby":"whatsnew-title",children:[h.jsx("button",{type:"button",className:"whatsnew-scrim",onClick:fu,"aria-label":"Close What's new"}),h.jsxs("section",{className:"whatsnew-card",ref:a,children:[h.jsxs("header",{className:"whatsnew-header",children:[h.jsxs("div",{className:"whatsnew-heading-row",children:[h.jsx("h2",{id:"whatsnew-title",children:"What's new"}),h.jsxs("span",{className:"whatsnew-version-badge",children:["v",c.version]})]}),h.jsxs("div",{className:"whatsnew-meta-row",children:[c.date?h.jsxs("time",{className:"whatsnew-date",dateTime:c.date,children:["Released ",c.date]}):h.jsx("span",{className:"whatsnew-date",children:"Unreleased"}),e.releaseNotesStale?h.jsx("span",{className:"whatsnew-stale",children:"Stale"}):null]})]}),h.jsx("button",{ref:r,type:"button",className:"whatsnew-close",onClick:fu,"aria-label":"Close What's new",children:"x"}),h.jsxs("div",{className:"whatsnew-body",children:[h.jsxs("div",{className:"whatsnew-version-selector",children:[h.jsx("select",{"aria-label":"Release version",value:u,onChange:E=>I1(E.currentTarget.value),children:C.map((E,f)=>{const v=w+f;return h.jsxs("option",{value:$a(E.version,v),children:[E.version==="Unreleased"?"Unreleased":`v${E.version}`,E.date?` · ${E.date}`:""]},$a(E.version,v))})}),y>1?h.jsxs("div",{className:"whatsnew-pagination",children:[h.jsx("button",{type:"button",className:"whatsnew-page-button",onClick:()=>A(-1),disabled:m===0,"aria-label":"Newer versions",children:"‹"}),h.jsxs("span",{className:"whatsnew-page-status",children:[m+1," / ",y]}),h.jsx("button",{type:"button",className:"whatsnew-page-button",onClick:()=>A(1),disabled:m>=y-1,"aria-label":"Older versions",children:"›"})]}):null,h.jsx("button",{type:"button",className:"whatsnew-refresh",onClick:d,disabled:e.releaseNotesLoading,children:e.releaseNotesLoading?"Refreshing":"Refresh"})]}),e.releaseNotesError?h.jsx("p",{className:"whatsnew-error",children:"Release notes could not be refreshed."}):null,c.sections.map((E,f)=>h.jsx(i3,{section:E,index:f},E.heading))]}),h.jsx("footer",{className:"whatsnew-footer",children:h.jsx("button",{type:"button",className:"whatsnew-done",onClick:fu,children:"Close"})})]})]})}function i3({section:e,index:n}){const r=e.heading.toLowerCase().replaceAll(" ","-"),a={"--whatsnew-delay":`${n*55}ms`};return h.jsxs("section",{className:`whatsnew-section whatsnew-section--${r}`,style:a,children:[h.jsx("h3",{children:h.jsx("span",{className:"whatsnew-section-chip",children:e.heading})}),h.jsx("ul",{children:e.items.map((o,g)=>h.jsx("li",{children:h.jsx(r3,{item:o})},`${o.text}:${g}`))})]})}function r3({item:e}){return h.jsxs(h.Fragment,{children:[e.packageTags.map((n,r)=>h.jsx("span",{className:`whatsnew-package-chip whatsnew-package-chip--${r%2===0?"brass":"aurora"}`,children:n},`${n}:${r}`)),h.jsx("span",{children:e.text})]})}function $a(e,n){return`${e}:${n}`}function s3(e,n){if(!n)return;const r=Array.from(n.querySelectorAll(t3)),a=r[0],o=r[r.length-1];!a||!o||(e.shiftKey&&document.activeElement===a?(e.preventDefault(),o.focus()):!e.shiftKey&&document.activeElement===o&&(e.preventDefault(),a.focus()))}function $r(){return j.useSyncExternalStore(OT,Wp,Wp)}function ph(e=()=>{}){return{...mS(e),notifications:{emit:r=>$T(r),dismiss:r=>VT(r)},status:{set:(r,a)=>HT(r,a),clear:r=>dw(r)}}}const K1=250,a3=5e3,V1=1,o3=1013,l3=4e3,c3=4001;function u3(e){const n=new AbortController,r=new TextEncoder;let a=K1,o=null,g=null,_=null,c=!1;const u=()=>{g?.dispose(),g=null},d=(w,C)=>{_={cols:w,rows:C},o?.readyState===V1&&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 m(h3(w,e.location,e.wsPath),e),a=K1}catch(w){if(n.signal.aborted)return;e.onStatus?.("connecting",w instanceof Error?w.message:String(w))}await p3(a,n.signal),a=Math.min(a*2,a3)}},m=async(w,C)=>{await new Promise((A,E)=>{const f=(C.webSocketFactory??f3)(w);o=f,f.binaryType="arraybuffer",f.onopen=()=>{C.onStatus?.("live"),u(),g=C.terminal.onData(v=>{f.readyState===V1&&f.send(r.encode(v))}),_&&d(_.cols,_.rows)},f.onmessage=v=>{v.data instanceof ArrayBuffer&&C.terminal.write(new Uint8Array(v.data))},f.onerror=()=>{E(new Error("Terminal WebSocket error"))},f.onclose=v=>{u(),o===f&&(o=null);const p=v?.code;p===l3?(n.abort(),C.onStatus?.("closed","terminal_replaced")):p===c3?(n.abort(),C.onStatus?.("closed","terminal_closed"),C.onExit?.()):p===o3&&(n.abort(),C.onStatus?.("closed","terminal_unavailable")),A()}})};return{start:()=>{c||(c=!0,y())},resize:d,dispose:()=>{n.abort(),u(),e.onStatus?.("closed"),o?.close(),o=null}}}function h3(e,n=window.location,r){return`${n.protocol==="https:"?"wss":"ws"}://${n.host}${r}?ticket=${encodeURIComponent(e)}`}async function d3(e,n,r){const a=await fetch(e,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({operationId:n}),signal:r});if(!a.ok)throw new Error(`Terminal ticket request failed: ${a.status}`);const o=await a.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 f3(e){return new WebSocket(e)}async function p3(e,n){await new Promise(r=>{const a=()=>{clearTimeout(o),n.removeEventListener("abort",a),r()},o=setTimeout(a,e);n.addEventListener("abort",a)})}var zf={exports:{}},Y1;function g3(){return Y1||(Y1=1,(function(e,n){(function(r,a){e.exports=a()})(self,(()=>(()=>{var r={};return(()=>{var a=r;Object.defineProperty(a,"__esModule",{value:!0}),a.FitAddon=void 0,a.FitAddon=class{activate(o){this._terminal=o}dispose(){}fit(){const o=this.proposeDimensions();if(!o||!this._terminal||isNaN(o.cols)||isNaN(o.rows))return;const g=this._terminal._core;this._terminal.rows===o.rows&&this._terminal.cols===o.cols||(g._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,g=o._renderService.dimensions;if(g.css.cell.width===0||g.css.cell.height===0)return;const _=this._terminal.options.scrollback===0?0:o.viewport.scrollBarWidth,c=window.getComputedStyle(this._terminal.element.parentElement),u=parseInt(c.getPropertyValue("height")),d=Math.max(0,parseInt(c.getPropertyValue("width"))),y=window.getComputedStyle(this._terminal.element),m=u-(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/g.css.cell.width)),rows:Math.max(1,Math.floor(m/g.css.cell.height))}}}})(),r})()))})(zf)),zf.exports}var m3=g3(),Nu={exports:{}},_3=Nu.exports,X1;function v3(){return X1||(X1=1,(function(e,n){(function(r,a){e.exports=a()})(_3,(()=>(()=>{var r={433:(_,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.UnicodeV11=void 0;const d=u(938),y=[[768,879],[1155,1161],[1425,1469],[1471,1471],[1473,1474],[1476,1477],[1479,1479],[1536,1541],[1552,1562],[1564,1564],[1611,1631],[1648,1648],[1750,1757],[1759,1764],[1767,1768],[1770,1773],[1807,1807],[1809,1809],[1840,1866],[1958,1968],[2027,2035],[2045,2045],[2070,2073],[2075,2083],[2085,2087],[2089,2093],[2137,2139],[2259,2306],[2362,2362],[2364,2364],[2369,2376],[2381,2381],[2385,2391],[2402,2403],[2433,2433],[2492,2492],[2497,2500],[2509,2509],[2530,2531],[2558,2558],[2561,2562],[2620,2620],[2625,2626],[2631,2632],[2635,2637],[2641,2641],[2672,2673],[2677,2677],[2689,2690],[2748,2748],[2753,2757],[2759,2760],[2765,2765],[2786,2787],[2810,2815],[2817,2817],[2876,2876],[2879,2879],[2881,2884],[2893,2893],[2902,2902],[2914,2915],[2946,2946],[3008,3008],[3021,3021],[3072,3072],[3076,3076],[3134,3136],[3142,3144],[3146,3149],[3157,3158],[3170,3171],[3201,3201],[3260,3260],[3263,3263],[3270,3270],[3276,3277],[3298,3299],[3328,3329],[3387,3388],[3393,3396],[3405,3405],[3426,3427],[3530,3530],[3538,3540],[3542,3542],[3633,3633],[3636,3642],[3655,3662],[3761,3761],[3764,3772],[3784,3789],[3864,3865],[3893,3893],[3895,3895],[3897,3897],[3953,3966],[3968,3972],[3974,3975],[3981,3991],[3993,4028],[4038,4038],[4141,4144],[4146,4151],[4153,4154],[4157,4158],[4184,4185],[4190,4192],[4209,4212],[4226,4226],[4229,4230],[4237,4237],[4253,4253],[4448,4607],[4957,4959],[5906,5908],[5938,5940],[5970,5971],[6002,6003],[6068,6069],[6071,6077],[6086,6086],[6089,6099],[6109,6109],[6155,6158],[6277,6278],[6313,6313],[6432,6434],[6439,6440],[6450,6450],[6457,6459],[6679,6680],[6683,6683],[6742,6742],[6744,6750],[6752,6752],[6754,6754],[6757,6764],[6771,6780],[6783,6783],[6832,6846],[6912,6915],[6964,6964],[6966,6970],[6972,6972],[6978,6978],[7019,7027],[7040,7041],[7074,7077],[7080,7081],[7083,7085],[7142,7142],[7144,7145],[7149,7149],[7151,7153],[7212,7219],[7222,7223],[7376,7378],[7380,7392],[7394,7400],[7405,7405],[7412,7412],[7416,7417],[7616,7673],[7675,7679],[8203,8207],[8234,8238],[8288,8292],[8294,8303],[8400,8432],[11503,11505],[11647,11647],[11744,11775],[12330,12333],[12441,12442],[42607,42610],[42612,42621],[42654,42655],[42736,42737],[43010,43010],[43014,43014],[43019,43019],[43045,43046],[43204,43205],[43232,43249],[43263,43263],[43302,43309],[43335,43345],[43392,43394],[43443,43443],[43446,43449],[43452,43453],[43493,43493],[43561,43566],[43569,43570],[43573,43574],[43587,43587],[43596,43596],[43644,43644],[43696,43696],[43698,43700],[43703,43704],[43710,43711],[43713,43713],[43756,43757],[43766,43766],[44005,44005],[44008,44008],[44013,44013],[64286,64286],[65024,65039],[65056,65071],[65279,65279],[65529,65531]],m=[[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 A;function E(f,v){let p,S=0,k=v.length-1;if(f<v[0][0]||f>v[k][1])return!1;for(;k>=S;)if(p=S+k>>1,f>v[p][1])S=p+1;else{if(!(f<v[p][0]))return!0;k=p-1}return!1}c.UnicodeV11=class{constructor(){if(this.version="11",!A){A=new Uint8Array(65536),A.fill(1),A[0]=0,A.fill(0,1,32),A.fill(0,127,160);for(let f=0;f<y.length;++f)A.fill(0,y[f][0],y[f][1]+1);for(let f=0;f<w.length;++f)A.fill(2,w[f][0],w[f][1]+1)}}wcwidth(f){return f<32?0:f<127?1:f<65536?A[f]:E(f,m)?0:E(f,C)?2:1}charProperties(f,v){let p=this.wcwidth(f),S=p===0&&v!==0;if(S){const k=d.UnicodeService.extractWidth(v);k===0?S=!1:k>p&&(p=k)}return d.UnicodeService.createPropertyValue(0,p,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=u=>(this._listeners.push(u),{dispose:()=>{if(!this._disposed){for(let d=0;d<this._listeners.length;d++)if(this._listeners[d]===u)return void this._listeners.splice(d,1)}}})),this._event}fire(u,d){const y=[];for(let m=0;m<this._listeners.length;m++)y.push(this._listeners[m]);for(let m=0;m<y.length;m++)y[m].call(void 0,u,d)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},c.forwardEvent=function(u,d){return u((y=>d.fire(y)))},c.runAndSubscribe=function(u,d){return d(void 0),u((y=>d(y)))}},490:(_,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.UnicodeV6=void 0;const d=u(938),y=[[768,879],[1155,1158],[1160,1161],[1425,1469],[1471,1471],[1473,1474],[1476,1477],[1479,1479],[1536,1539],[1552,1557],[1611,1630],[1648,1648],[1750,1764],[1767,1768],[1770,1773],[1807,1807],[1809,1809],[1840,1866],[1958,1968],[2027,2035],[2305,2306],[2364,2364],[2369,2376],[2381,2381],[2385,2388],[2402,2403],[2433,2433],[2492,2492],[2497,2500],[2509,2509],[2530,2531],[2561,2562],[2620,2620],[2625,2626],[2631,2632],[2635,2637],[2672,2673],[2689,2690],[2748,2748],[2753,2757],[2759,2760],[2765,2765],[2786,2787],[2817,2817],[2876,2876],[2879,2879],[2881,2883],[2893,2893],[2902,2902],[2946,2946],[3008,3008],[3021,3021],[3134,3136],[3142,3144],[3146,3149],[3157,3158],[3260,3260],[3263,3263],[3270,3270],[3276,3277],[3298,3299],[3393,3395],[3405,3405],[3530,3530],[3538,3540],[3542,3542],[3633,3633],[3636,3642],[3655,3662],[3761,3761],[3764,3769],[3771,3772],[3784,3789],[3864,3865],[3893,3893],[3895,3895],[3897,3897],[3953,3966],[3968,3972],[3974,3975],[3984,3991],[3993,4028],[4038,4038],[4141,4144],[4146,4146],[4150,4151],[4153,4153],[4184,4185],[4448,4607],[4959,4959],[5906,5908],[5938,5940],[5970,5971],[6002,6003],[6068,6069],[6071,6077],[6086,6086],[6089,6099],[6109,6109],[6155,6157],[6313,6313],[6432,6434],[6439,6440],[6450,6450],[6457,6459],[6679,6680],[6912,6915],[6964,6964],[6966,6970],[6972,6972],[6978,6978],[7019,7027],[7616,7626],[7678,7679],[8203,8207],[8234,8238],[8288,8291],[8298,8303],[8400,8431],[12330,12335],[12441,12442],[43014,43014],[43019,43019],[43045,43046],[64286,64286],[65024,65039],[65056,65059],[65279,65279],[65529,65531]],m=[[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(A,E){let f,v=0,p=E.length-1;if(A<E[0][0]||A>E[p][1])return!1;for(;p>=v;)if(f=v+p>>1,A>E[f][1])v=f+1;else{if(!(A<E[f][0]))return!0;p=f-1}return!1})(C,m)?0:C>=131072&&C<=196605||C>=196608&&C<=262141?2:1}charProperties(C,A){let E=this.wcwidth(C),f=E===0&&A!==0;if(f){const v=d.UnicodeService.extractWidth(A);v===0?f=!1:v>E&&(E=v)}return d.UnicodeService.createPropertyValue(0,E,f)}}},938:(_,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.UnicodeService=void 0;const d=u(345),y=u(490);class m{static extractShouldJoin(C){return(1&C)!=0}static extractWidth(C){return C>>1&3}static extractCharKind(C){return C>>3}static createPropertyValue(C,A,E=!1){return(16777215&C)<<3|(3&A)<<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 A=0,E=0;const f=C.length;for(let v=0;v<f;++v){let p=C.charCodeAt(v);if(55296<=p&&p<=56319){if(++v>=f)return A+this.wcwidth(p);const L=C.charCodeAt(v);56320<=L&&L<=57343?p=1024*(p-55296)+L-56320+65536:A+=this.wcwidth(L)}const S=this.charProperties(p,E);let k=m.extractWidth(S);m.extractShouldJoin(S)&&(k-=m.extractWidth(E)),A+=k,E=S}return A}charProperties(C,A){return this._activeProvider.charProperties(C,A)}}c.UnicodeService=m}},a={};function o(_){var c=a[_];if(c!==void 0)return c.exports;var u=a[_]={exports:{}};return r[_](u,u.exports,o),u.exports}var g={};return(()=>{var _=g;Object.defineProperty(_,"__esModule",{value:!0}),_.Unicode11Addon=void 0;const c=o(433);_.Unicode11Addon=class{activate(u){u.unicode.register(new c.UnicodeV11)}dispose(){}}})(),g})()))})(Nu)),Nu.exports}var b3=v3();var y3=(e,n,r,a)=>{for(var o=n,g=e.length-1,_;g>=0;g--)(_=e[g])&&(o=_(o)||o);return o},S3=(e,n)=>(r,a)=>n(r,a,e),w3=class{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(e){setTimeout(()=>{throw e.stack?Z1.isErrorNoTelemetry(e)?new Z1(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)}},x3=new w3;function Hf(e){C3(e)||x3.onUnexpectedError(e)}var Kp="Canceled";function C3(e){return e instanceof E3?!0:e instanceof Error&&e.name===Kp&&e.message===Kp}var E3=class extends Error{constructor(){super(Kp),this.name=this.message}},Z1=class Vp extends Error{constructor(n){super(n),this.name="CodeExpectedError"}static fromError(n){if(n instanceof Vp)return n;let r=new Vp;return r.message=n.message,r.stack=n.stack,r}static isErrorNoTelemetry(n){return n.name==="CodeExpectedError"}},k3;(e=>{function n(g){return g<0}e.isLessThan=n;function r(g){return g<=0}e.isLessThanOrEqual=r;function a(g){return g>0}e.isGreaterThan=a;function o(g){return g===0}e.isNeitherLessOrGreaterThan=o,e.greaterThan=1,e.lessThan=-1,e.neitherLessOrGreaterThan=0})(k3||={});function A3(e,n){let r=this,a=!1,o;return function(){return a||(a=!0,n||(o=e.apply(r,arguments))),o}}var Cw;(e=>{function n(k){return k&&typeof k=="object"&&typeof k[Symbol.iterator]=="function"}e.is=n;let r=Object.freeze([]);function a(){return r}e.empty=a;function*o(k){yield k}e.single=o;function g(k){return n(k)?k:o(k)}e.wrap=g;function _(k){return k||r}e.from=_;function*c(k){for(let L=k.length-1;L>=0;L--)yield k[L]}e.reverse=c;function u(k){return!k||k[Symbol.iterator]().next().done===!0}e.isEmpty=u;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 m(k,L){for(let R of k)if(L(R))return R}e.find=m;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*A(k,L){let R=0;for(let M of k)yield*L(M,R++)}e.flatMap=A;function*E(...k){for(let L of k)yield*L}e.concat=E;function f(k,L,R){let M=R;for(let T of k)M=L(M,T);return M}e.reduce=f;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 p(k,L=Number.POSITIVE_INFINITY){let R=[];if(L===0)return[R,k];let M=k[Symbol.iterator]();for(let T=0;T<L;T++){let I=M.next();if(I.done)return[R,e.empty()];R.push(I.value)}return[R,{[Symbol.iterator](){return M}}]}e.consume=p;async function S(k){let L=[];for await(let R of k)L.push(R);return Promise.resolve(L)}e.asyncToArray=S})(Cw||={});function Ew(e){if(Cw.is(e)){let n=[];for(let r of e)if(r)try{r.dispose()}catch(a){n.push(a)}if(n.length===1)throw n[0];if(n.length>1)throw new AggregateError(n,"Encountered errors while disposing of store");return Array.isArray(e)?[]:e}else if(e)return e.dispose(),e}function kw(...e){return $n(()=>Ew(e))}function $n(e){return{dispose:A3(()=>{e()})}}var Aw=class Tw{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{Ew(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?Tw.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)}};Aw.DISABLE_DISPOSED_WARNING=!1;var ro=Aw,Zi=class{constructor(){this._store=new ro,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)}};Zi.None=Object.freeze({dispose(){}});var fl=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}},im=typeof process<"u"&&"title"in process,gh=im?"node":navigator.userAgent,T3=im?"node":navigator.platform,R3=gh.includes("Firefox"),L3=gh.includes("Edge"),Rw=/^((?!chrome|android).)*safari/i.test(gh);function M3(){if(!Rw)return 0;let e=gh.match(/Version\/(\d+)/);return e===null||e.length<2?0:parseInt(e[1])}T3.indexOf("Linux")>=0;var N3="",xn=0,Cn=0,En=0,sn=0,Oi={css:"#00000000",rgba:0},qn;(e=>{function n(o,g,_,c){return c!==void 0?`#${Gs(o)}${Gs(g)}${Gs(_)}${Gs(c)}`:`#${Gs(o)}${Gs(g)}${Gs(_)}`}e.toCss=n;function r(o,g,_,c=255){return(o<<24|g<<16|_<<8|c)>>>0}e.toRgba=r;function a(o,g,_,c){return{css:e.toCss(o,g,_,c),rgba:e.toRgba(o,g,_,c)}}e.toColor=a})(qn||={});var Al;(e=>{function n(u,d){if(sn=(d.rgba&255)/255,sn===1)return{css:d.css,rgba:d.rgba};let y=d.rgba>>24&255,m=d.rgba>>16&255,w=d.rgba>>8&255,C=u.rgba>>24&255,A=u.rgba>>16&255,E=u.rgba>>8&255;xn=C+Math.round((y-C)*sn),Cn=A+Math.round((m-A)*sn),En=E+Math.round((w-E)*sn);let f=qn.toCss(xn,Cn,En),v=qn.toRgba(xn,Cn,En);return{css:f,rgba:v}}e.blend=n;function r(u){return(u.rgba&255)===255}e.isOpaque=r;function a(u,d,y){let m=ea.ensureContrastRatio(u.rgba,d.rgba,y);if(m)return qn.toColor(m>>24&255,m>>16&255,m>>8&255)}e.ensureContrastRatio=a;function o(u){let d=(u.rgba|255)>>>0;return[xn,Cn,En]=ea.toChannels(d),{css:qn.toCss(xn,Cn,En),rgba:d}}e.opaque=o;function g(u,d){return sn=Math.round(d*255),[xn,Cn,En]=ea.toChannels(u.rgba),{css:qn.toCss(xn,Cn,En,sn),rgba:qn.toRgba(xn,Cn,En,sn)}}e.opacity=g;function _(u,d){return sn=u.rgba&255,g(u,sn*d/255)}e.multiplyOpacity=_;function c(u){return[u.rgba>>24&255,u.rgba>>16&255,u.rgba>>8&255]}e.toColorRGB=c})(Al||={});var O3;(e=>{let n,r;try{let o=document.createElement("canvas");o.width=1,o.height=1;let g=o.getContext("2d",{willReadFrequently:!0});g&&(n=g,n.globalCompositeOperation="copy",r=n.createLinearGradient(0,0,1,1))}catch{}function a(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),qn.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),qn.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 g=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(g)return xn=parseInt(g[1]),Cn=parseInt(g[2]),En=parseInt(g[3]),sn=Math.round((g[5]===void 0?1:parseFloat(g[5]))*255),qn.toColor(xn,Cn,En,sn);if(!n||!r)throw new Error("css.toColor: Unsupported css format");if(n.fillStyle=r,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:qn.toRgba(xn,Cn,En,sn),css:o}}e.toColor=a})(O3||={});var Wn;(e=>{function n(a){return r(a>>16&255,a>>8&255,a&255)}e.relativeLuminance=n;function r(a,o,g){let _=a/255,c=o/255,u=g/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),m=u<=.03928?u/12.92:Math.pow((u+.055)/1.055,2.4);return d*.2126+y*.7152+m*.0722}e.relativeLuminance2=r})(Wn||={});var ea;(e=>{function n(_,c){if(sn=(c&255)/255,sn===1)return c;let u=c>>24&255,d=c>>16&255,y=c>>8&255,m=_>>24&255,w=_>>16&255,C=_>>8&255;return xn=m+Math.round((u-m)*sn),Cn=w+Math.round((d-w)*sn),En=C+Math.round((y-C)*sn),qn.toRgba(xn,Cn,En)}e.blend=n;function r(_,c,u){let d=Wn.relativeLuminance(_>>8),y=Wn.relativeLuminance(c>>8);if(Mr(d,y)<u){if(y<d){let C=a(_,c,u),A=Mr(d,Wn.relativeLuminance(C>>8));if(A<u){let E=o(_,c,u),f=Mr(d,Wn.relativeLuminance(E>>8));return A>f?C:E}return C}let m=o(_,c,u),w=Mr(d,Wn.relativeLuminance(m>>8));if(w<u){let C=a(_,c,u),A=Mr(d,Wn.relativeLuminance(C>>8));return w>A?m:C}return m}}e.ensureContrastRatio=r;function a(_,c,u){let d=_>>24&255,y=_>>16&255,m=_>>8&255,w=c>>24&255,C=c>>16&255,A=c>>8&255,E=Mr(Wn.relativeLuminance2(w,C,A),Wn.relativeLuminance2(d,y,m));for(;E<u&&(w>0||C>0||A>0);)w-=Math.max(0,Math.ceil(w*.1)),C-=Math.max(0,Math.ceil(C*.1)),A-=Math.max(0,Math.ceil(A*.1)),E=Mr(Wn.relativeLuminance2(w,C,A),Wn.relativeLuminance2(d,y,m));return(w<<24|C<<16|A<<8|255)>>>0}e.reduceLuminance=a;function o(_,c,u){let d=_>>24&255,y=_>>16&255,m=_>>8&255,w=c>>24&255,C=c>>16&255,A=c>>8&255,E=Mr(Wn.relativeLuminance2(w,C,A),Wn.relativeLuminance2(d,y,m));for(;E<u&&(w<255||C<255||A<255);)w=Math.min(255,w+Math.ceil((255-w)*.1)),C=Math.min(255,C+Math.ceil((255-C)*.1)),A=Math.min(255,A+Math.ceil((255-A)*.1)),E=Mr(Wn.relativeLuminance2(w,C,A),Wn.relativeLuminance2(d,y,m));return(w<<24|C<<16|A<<8|255)>>>0}e.increaseLuminance=o;function g(_){return[_>>24&255,_>>16&255,_>>8&255,_&255]}e.toChannels=g})(ea||={});function Gs(e){let n=e.toString(16);return n.length<2?"0"+n:n}function Mr(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 rm(e){return 57508<=e&&e<=57558}function D3(e){return 57520<=e&&e<=57527}function B3(e){return 57344<=e&&e<=63743}function j3(e){return 9472<=e&&e<=9631}function I3(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 P3(e,n,r,a){return n===1&&r>Math.ceil(a*1.5)&&e!==void 0&&e>255&&!I3(e)&&!rm(e)&&!B3(e)}function Lw(e){return rm(e)||j3(e)}function z3(){return{css:{canvas:gu(),cell:gu()},device:{canvas:gu(),cell:gu(),char:{width:0,height:0,left:0,top:0}}}}function gu(){return{width:0,height:0}}function H3(e,n,r=0){return(e-(Math.round(n)*2-r))%(Math.round(n)*2)}var Bn=0,wn=0,rr=!1,Nr=!1,mu=!1,ai,$f=0,$3=class{constructor(e,n,r,a,o,g){this._terminal=e,this._optionService=n,this._selectionRenderModel=r,this._decorationService=a,this._coreBrowserService=o,this._themeService=g,this.result={fg:0,bg:0,ext:0}}resolve(e,n,r,a){if(this.result.bg=e.bg,this.result.fg=e.fg,this.result.ext=e.bg&268435456?e.extended.ext:0,wn=0,Bn=0,Nr=!1,rr=!1,mu=!1,ai=this._themeService.colors,$f=0,e.getCode()!==0&&e.extended.underlineStyle===4){let o=Math.max(1,Math.floor(this._optionService.rawOptions.fontSize*this._coreBrowserService.dpr/15));$f=n*a%(Math.round(o)*2)}if(this._decorationService.forEachDecorationAtCell(n,r,"bottom",o=>{o.backgroundColorRGB&&(wn=o.backgroundColorRGB.rgba>>8&16777215,Nr=!0),o.foregroundColorRGB&&(Bn=o.foregroundColorRGB.rgba>>8&16777215,rr=!0)}),mu=this._selectionRenderModel.isCellSelected(this._terminal,n,r),mu){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=ea.blend(wn,(this._coreBrowserService.isFocused?ai.selectionBackgroundOpaque:ai.selectionInactiveBackgroundOpaque).rgba&4294967040|128)>>8&16777215}else wn=(this._coreBrowserService.isFocused?ai.selectionBackgroundOpaque:ai.selectionInactiveBackgroundOpaque).rgba>>8&16777215;if(Nr=!0,ai.selectionForeground&&(Bn=ai.selectionForeground.rgba>>8&16777215,rr=!0),Lw(e.getCode())){if(this.result.fg&67108864&&(this.result.bg&50331648)===0)Bn=(this._coreBrowserService.isFocused?ai.selectionBackgroundOpaque:ai.selectionInactiveBackgroundOpaque).rgba>>8&16777215;else{if(this.result.fg&67108864)switch(this.result.bg&50331648){case 16777216:case 33554432:Bn=this._themeService.colors.ansi[this.result.bg&255].rgba;break;case 50331648:Bn=(this.result.bg&16777215)<<8|255;break}else switch(this.result.fg&50331648){case 16777216:case 33554432:Bn=this._themeService.colors.ansi[this.result.fg&255].rgba;break;case 50331648:Bn=(this.result.fg&16777215)<<8|255;break;default:Bn=this._themeService.colors.foreground.rgba}Bn=ea.blend(Bn,(this._coreBrowserService.isFocused?ai.selectionBackgroundOpaque:ai.selectionInactiveBackgroundOpaque).rgba&4294967040|128)>>8&16777215}rr=!0}}this._decorationService.forEachDecorationAtCell(n,r,"top",o=>{o.backgroundColorRGB&&(wn=o.backgroundColorRGB.rgba>>8&16777215,Nr=!0),o.foregroundColorRGB&&(Bn=o.foregroundColorRGB.rgba>>8&16777215,rr=!0)}),Nr&&(mu?wn=e.bg&-16777216&-134217729|wn|50331648:wn=e.bg&-16777216|wn|50331648),rr&&(Bn=e.fg&-16777216&-67108865|Bn|50331648),this.result.fg&67108864&&(Nr&&!rr&&((this.result.bg&50331648)===0?Bn=this.result.fg&-134217728|ai.background.rgba>>8&16777215&16777215|50331648:Bn=this.result.fg&-134217728|this.result.bg&67108863,rr=!0),!Nr&&rr&&((this.result.fg&50331648)===0?wn=this.result.bg&-67108864|ai.foreground.rgba>>8&16777215&16777215|50331648:wn=this.result.bg&-67108864|this.result.fg&67108863,Nr=!0)),ai=void 0,this.result.bg=Nr?wn:this.result.bg,this.result.fg=rr?Bn:this.result.fg,this.result.ext&=536870911,this.result.ext|=$f<<29&3758096384}},U3=.5,Mw=R3||L3?"bottom":"ideographic",F3={"▀":[{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}]},W3={"░":[[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]]},G3={"─":{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`}},$l={"":{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}};$l[""]=$l[""];$l[""]=$l[""];function q3(e,n,r,a,o,g,_,c){let u=F3[n];if(u)return K3(e,u,r,a,o,g),!0;let d=W3[n];if(d)return V3(e,d,r,a,o,g),!0;let y=G3[n];if(y)return Y3(e,y,r,a,o,g,c),!0;let m=$l[n];return m?(X3(e,m,r,a,o,g,_,c),!0):!1}function K3(e,n,r,a,o,g){for(let _=0;_<n.length;_++){let c=n[_],u=o/8,d=g/8;e.fillRect(r+c.x*u,a+c.y*d,c.w*u,c.h*d)}}var J1=new Map;function V3(e,n,r,a,o,g){let _=J1.get(n);_||(_=new Map,J1.set(n,_));let c=e.fillStyle;if(typeof c!="string")throw new Error(`Unexpected fillStyle type "${c}"`);let u=_.get(c);if(!u){let d=n[0].length,y=n.length,m=e.canvas.ownerDocument.createElement("canvas");m.width=d,m.height=y;let w=mn(m.getContext("2d")),C=new ImageData(d,y),A,E,f,v;if(c.startsWith("#"))A=parseInt(c.slice(1,3),16),E=parseInt(c.slice(3,5),16),f=parseInt(c.slice(5,7),16),v=c.length>7&&parseInt(c.slice(7,9),16)||1;else if(c.startsWith("rgba"))[A,E,f,v]=c.substring(5,c.length-1).split(",").map(p=>parseFloat(p));else throw new Error(`Unexpected fillStyle color format "${c}" when drawing pattern glyph`);for(let p=0;p<y;p++)for(let S=0;S<d;S++)C.data[(p*d+S)*4]=A,C.data[(p*d+S)*4+1]=E,C.data[(p*d+S)*4+2]=f,C.data[(p*d+S)*4+3]=n[p][S]*(v*255);w.putImageData(C,0,0),u=mn(e.createPattern(m,null)),_.set(c,u)}e.fillStyle=u,e.fillRect(r,a,o,g)}function Y3(e,n,r,a,o,g,_){e.strokeStyle=e.fillStyle;for(let[c,u]of Object.entries(n)){e.beginPath(),e.lineWidth=_*Number.parseInt(c);let d;if(typeof u=="function"){let y=.15/g*o;d=u(.15,y)}else d=u;for(let y of d.split(" ")){let m=y[0],w=Nw[m];if(!w){console.error(`Could not find drawing instructions for "${m}"`);continue}let C=y.substring(1).split(",");!C[0]||!C[1]||w(e,Ow(C,o,g,r,a,!0,_))}e.stroke(),e.closePath()}}function X3(e,n,r,a,o,g,_,c){let u=new Path2D;u.rect(r,a,o,g),e.clip(u),e.beginPath();let d=_/12;e.lineWidth=c*d;for(let y of n.d.split(" ")){let m=y[0],w=Nw[m];if(!w){console.error(`Could not find drawing instructions for "${m}"`);continue}let C=y.substring(1).split(",");!C[0]||!C[1]||w(e,Ow(C,o,g,r,a,!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 Q1(e,n,r=0){return Math.max(Math.min(e,n),r)}var Nw={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 Ow(e,n,r,a,o,g,_,c=0,u=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*_-u*_,g&&d[y]!==0&&(d[y]=Q1(Math.round(d[y]+.5)-.5,n,0)),d[y]+=a+c*_;for(let y=1;y<d.length;y+=2)d[y]*=r,g&&d[y]!==0&&(d[y]=Q1(Math.round(d[y]+.5)-.5,r,0)),d[y]+=o;return d}var eb=class{constructor(){this._data={}}set(e,n,r){this._data[e]||(this._data[e]={}),this._data[e][n]=r}get(e,n){return this._data[e]?this._data[e][n]:void 0}clear(){this._data={}}},tb=class{constructor(){this._data=new eb}set(e,n,r,a,o){this._data.get(e,n)||this._data.set(e,n,new eb),this._data.get(e,n).set(r,a,o)}get(e,n,r,a){return this._data.get(e,n)?.get(r,a)}clear(){this._data.clear()}},Dw=class{constructor(){this._tasks=[],this._i=0}enqueue(e){this._tasks.push(e),this._start()}flush(){for(;this._i<this._tasks.length;)this._tasks[this._i]()||this._i++;this.clear()}clear(){this._idleCallback&&(this._cancelCallback(this._idleCallback),this._idleCallback=void 0),this._i=0,this._tasks.length=0}_start(){this._idleCallback||(this._idleCallback=this._requestCallback(this._process.bind(this)))}_process(e){this._idleCallback=void 0;let n=0,r=0,a=e.timeRemaining(),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),r=Math.max(n,r),o=e.timeRemaining(),r*1.5>o){a-n<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(a-n))}ms`),this._start();return}a=o}this.clear()}},Z3=class extends Dw{_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())}}},J3=class extends Dw{_requestCallback(e){return requestIdleCallback(e)}_cancelCallback(e){cancelIdleCallback(e)}},Q3=!im&&"requestIdleCallback"in window?J3:Z3,Za=class Bw{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 Bw;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 Iw{constructor(n=0,r=0){this._ext=0,this._urlId=0,this._ext=n,this._urlId=r}get ext(){return this._urlId?this._ext&-469762049|this.underlineStyle<<26:this._ext}set ext(n){this._ext=n}get underlineStyle(){return this._urlId?5:(this._ext&469762048)>>26}set underlineStyle(n){this._ext&=-469762049,this._ext|=n<<26&469762048}get underlineColor(){return this._ext&67108863}set underlineColor(n){this._ext&=-67108864,this._ext|=n&67108863}get urlId(){return this._urlId}set urlId(n){this._urlId=n}get underlineVariantOffset(){let n=(this._ext&3758096384)>>29;return n<0?n^4294967288:n}set underlineVariantOffset(n){this._ext&=536870911,this._ext|=n<<29&3758096384}clone(){return new Iw(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}},eL=globalThis.performance&&typeof globalThis.performance.now=="function",tL=class Pw{static create(n){return new Pw(n)}constructor(n){this._now=eL&&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}},Ir;(e=>{e.None=()=>Zi.None;function n(G,B){return m(G,()=>{},0,void 0,!0,void 0,B)}e.defer=n;function r(G){return(B,X=null,Y)=>{let z=!1,q;return q=G(V=>{if(!z)return q?q.dispose():z=!0,B.call(X,V)},null,Y),z&&q.dispose(),q}}e.once=r;function a(G,B,X){return d((Y,z=null,q)=>G(V=>Y.call(z,B(V)),null,q),X)}e.map=a;function o(G,B,X){return d((Y,z=null,q)=>G(V=>{B(V),Y.call(z,V)},null,q),X)}e.forEach=o;function g(G,B,X){return d((Y,z=null,q)=>G(V=>B(V)&&Y.call(z,V),null,q),X)}e.filter=g;function _(G){return G}e.signal=_;function c(...G){return(B,X=null,Y)=>{let z=kw(...G.map(q=>q(V=>B.call(X,V))));return y(z,Y)}}e.any=c;function u(G,B,X,Y){let z=X;return a(G,q=>(z=B(z,q),z),Y)}e.reduce=u;function d(G,B){let X,Y={onWillAddFirstListener(){X=G(z.fire,z)},onDidRemoveLastListener(){X?.dispose()}},z=new $t(Y);return B?.add(z),z.event}function y(G,B){return B instanceof Array?B.push(G):B&&B.add(G),G}function m(G,B,X=100,Y=!1,z=!1,q,V){let D,H,O,P=0,W,Z={leakWarningThreshold:q,onWillAddFirstListener(){D=G(he=>{P++,H=B(H,he),Y&&!O&&(ie.fire(H),H=void 0),W=()=>{let te=H;H=void 0,O=void 0,(!Y||P>1)&&ie.fire(te),P=0},typeof X=="number"?(clearTimeout(O),O=setTimeout(W,X)):O===void 0&&(O=0,queueMicrotask(W))})},onWillRemoveListener(){z&&P>0&&W?.()},onDidRemoveLastListener(){W=void 0,D.dispose()}},ie=new $t(Z);return V?.add(ie),ie.event}e.debounce=m;function w(G,B=0,X){return e.debounce(G,(Y,z)=>Y?(Y.push(z),Y):[z],B,void 0,!0,void 0,X)}e.accumulate=w;function C(G,B=(Y,z)=>Y===z,X){let Y=!0,z;return g(G,q=>{let V=Y||!B(q,z);return Y=!1,z=q,V},X)}e.latch=C;function A(G,B,X){return[e.filter(G,B,X),e.filter(G,Y=>!B(Y),X)]}e.split=A;function E(G,B=!1,X=[],Y){let z=X.slice(),q=G(H=>{z?z.push(H):D.fire(H)});Y&&Y.add(q);let V=()=>{z?.forEach(H=>D.fire(H)),z=null},D=new $t({onWillAddFirstListener(){q||(q=G(H=>D.fire(H)),Y&&Y.add(q))},onDidAddFirstListener(){z&&(B?setTimeout(V):V())},onDidRemoveLastListener(){q&&q.dispose(),q=null}});return Y&&Y.add(D),D.event}e.buffer=E;function f(G,B){return(X,Y,z)=>{let q=B(new p);return G(function(V){let D=q.evaluate(V);D!==v&&X.call(Y,D)},void 0,z)}}e.chain=f;let v=Symbol("HaltChainable");class p{constructor(){this.steps=[]}map(B){return this.steps.push(B),this}forEach(B){return this.steps.push(X=>(B(X),X)),this}filter(B){return this.steps.push(X=>B(X)?X:v),this}reduce(B,X){let Y=X;return this.steps.push(z=>(Y=B(Y,z),Y)),this}latch(B=(X,Y)=>X===Y){let X=!0,Y;return this.steps.push(z=>{let q=X||!B(z,Y);return X=!1,Y=z,q?z:v}),this}evaluate(B){for(let X of this.steps)if(B=X(B),B===v)break;return B}}function S(G,B,X=Y=>Y){let Y=(...D)=>V.fire(X(...D)),z=()=>G.on(B,Y),q=()=>G.removeListener(B,Y),V=new $t({onWillAddFirstListener:z,onDidRemoveLastListener:q});return V.event}e.fromNodeEventEmitter=S;function k(G,B,X=Y=>Y){let Y=(...D)=>V.fire(X(...D)),z=()=>G.addEventListener(B,Y),q=()=>G.removeEventListener(B,Y),V=new $t({onWillAddFirstListener:z,onDidRemoveLastListener:q});return V.event}e.fromDOMEventEmitter=k;function L(G){return new Promise(B=>r(G)(B))}e.toPromise=L;function R(G){let B=new $t;return G.then(X=>{B.fire(X)},()=>{B.fire(void 0)}).finally(()=>{B.dispose()}),B.event}e.fromPromise=R;function M(G,B){return G(X=>B.fire(X))}e.forward=M;function T(G,B,X){return B(X),G(Y=>B(Y))}e.runAndSubscribe=T;class I{constructor(B,X){this._observable=B,this._counter=0,this._hasChanged=!1;let Y={onWillAddFirstListener:()=>{B.addObserver(this)},onDidRemoveLastListener:()=>{B.removeObserver(this)}};this.emitter=new $t(Y),X&&X.add(this.emitter)}beginUpdate(B){this._counter++}handlePossibleChange(B){}handleChange(B,X){this._hasChanged=!0}endUpdate(B){this._counter--,this._counter===0&&(this._observable.reportChanges(),this._hasChanged&&(this._hasChanged=!1,this.emitter.fire(this._observable.get())))}}function K(G,B){return new I(G,B).emitter.event}e.fromObservable=K;function F(G){return(B,X,Y)=>{let z=0,q=!1,V={beginUpdate(){z++},endUpdate(){z--,z===0&&(G.reportChanges(),q&&(q=!1,B.call(X)))},handlePossibleChange(){},handleChange(){q=!0}};G.addObserver(V),G.reportChanges();let D={dispose(){G.removeObserver(V)}};return Y instanceof ro?Y.add(D):Array.isArray(Y)&&Y.push(D),D}}e.fromObservableLight=F})(Ir||={});var Yp=class Xp{constructor(n){this.listenerCount=0,this.invocationCount=0,this.elapsedOverall=0,this.durations=[],this.name=`${n}_${Xp._idPool++}`,Xp.all.add(this)}start(n){this._stopWatch=new tL,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}}};Yp.all=new Set,Yp._idPool=0;var nL=Yp,iL=-1,zw=class Hw{constructor(n,r,a=(Hw._idPool++).toString(16).padStart(3,"0")){this._errorHandler=n,this.threshold=r,this.name=a,this._warnCountdown=0}dispose(){this._stacks?.clear()}check(n,r){let a=this.threshold;if(a<=0||r<a)return;this._stacks||(this._stacks=new Map);let o=this._stacks.get(n.value)||0;if(this._stacks.set(n.value,o+1),this._warnCountdown-=1,this._warnCountdown<=0){this._warnCountdown=a*.5;let[g,_]=this.getMostFrequentStack(),c=`[${this.name}] potential listener LEAK detected, having ${r} listeners already. MOST frequent listener (${_}):`;console.warn(c),console.warn(g);let u=new aL(c,g);this._errorHandler(u)}return()=>{let g=this._stacks.get(n.value)||0;this._stacks.set(n.value,g-1)}}getMostFrequentStack(){if(!this._stacks)return;let n,r=0;for(let[a,o]of this._stacks)(!n||r<o)&&(n=[a,o],r=o);return n}};zw._idPool=1;var rL=zw,sL=class $w{constructor(n){this.value=n}static create(){let n=new Error;return new $w(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}},oL=class extends Error{constructor(e,n){super(e),this.name="ListenerRefusalError",this.stack=n}},lL=0,Uf=class{constructor(n){this.value=n,this.id=lL++}},cL=2,uL,$t=class{constructor(n){this._size=0,this._options=n,this._leakageMon=this._options?.leakWarningThreshold?new rL(n?.onListenerError??Hf,this._options?.leakWarningThreshold??iL):void 0,this._perfMon=this._options?._profName?new nL(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,r,a)=>{if(this._leakageMon&&this._size>this._leakageMon.threshold**2){let c=`[${this._leakageMon.name}] REFUSES to accept new listeners because it exceeded its threshold by far (${this._size} vs ${this._leakageMon.threshold})`;console.warn(c);let u=this._leakageMon.getMostFrequentStack()??["UNKNOWN stack",-1],d=new oL(`${c}. HINT: Stack shows most frequent listener (${u[1]}-times)`,u[0]);return(this._options?.onListenerError||Hf)(d),Zi.None}if(this._disposed)return Zi.None;r&&(n=n.bind(r));let o=new Uf(n),g;this._leakageMon&&this._size>=Math.ceil(this._leakageMon.threshold*.2)&&(o.stack=sL.create(),g=this._leakageMon.check(o.stack,this._size+1)),this._listeners?this._listeners instanceof Uf?(this._deliveryQueue??=new hL,this._listeners=[this._listeners,o]):this._listeners.push(o):(this._options?.onWillAddFirstListener?.(this),this._listeners=o,this._options?.onDidAddFirstListener?.(this)),this._size++;let _=$n(()=>{g?.(),this._removeListener(o)});return a instanceof ro?a.add(_):Array.isArray(a)&&a.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 r=this._listeners,a=r.indexOf(n);if(a===-1)throw console.log("disposed?",this._disposed),console.log("size?",this._size),console.log("arr?",JSON.stringify(this._listeners)),new Error("Attempted to dispose unknown listener");this._size--,r[a]=void 0;let o=this._deliveryQueue.current===this;if(this._size*cL<=r.length){let g=0;for(let _=0;_<r.length;_++)r[_]?r[g++]=r[_]:o&&(this._deliveryQueue.end--,g<this._deliveryQueue.i&&this._deliveryQueue.i--);r.length=g}}_deliver(n,r){if(!n)return;let a=this._options?.onListenerError||Hf;if(!a){n.value(r);return}try{n.value(r)}catch(o){a(o)}}_deliverQueue(n){let r=n.current._listeners;for(;n.i<n.end;)this._deliver(r[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 Uf)this._deliver(this._listeners,n);else{let r=this._deliveryQueue;r.enqueue(this,n,this._listeners.length),this._deliverQueue(r)}this._perfMon?.stop()}hasListeners(){return this._size>0}},hL=class{constructor(){this.i=-1,this.end=0}enqueue(e,n,r){this.i=0,this.end=r,this.current=e,this.value=n}reset(){this.i=this.end,this.current=void 0,this.value=void 0}},nb={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}},pl=2,gl,_s=class Ka{constructor(n,r,a){this._document=n,this._config=r,this._unicodeService=a,this._didWarmUp=!1,this._cacheMap=new tb,this._cacheMapCombined=new tb,this._pages=[],this._activePages=[],this._workBoundingBox={top:0,left:0,bottom:0,right:0},this._workAttributeData=new Za,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=Uw(n,this._config.deviceCellWidth*4+pl*2,this._config.deviceCellHeight+pl*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 Q3;for(let r=33;r<126;r++)n.enqueue(()=>{if(!this._cacheMap.get(r,0,0,0)){let a=this._drawToCache(r,0,0,0,!1,void 0);this._cacheMap.set(r,0,0,0,a)}})}beginFrame(){return this._requestClearModel}clearTexture(){if(!(this._pages[0].currentRow.x===0&&this._pages[0].currentRow.y===0)){for(let n of this._pages)n.clear();this._cacheMap.clear(),this._cacheMapCombined.clear(),this._didWarmUp=!1}}_createNewPage(){if(Ka.maxAtlasPages&&this._pages.length>=Math.max(4,Ka.maxAtlasPages)){let r=this._pages.filter(d=>d.canvas.width*2<=(Ka.maxTextureSize||4096)).sort((d,y)=>y.canvas.width!==d.canvas.width?y.canvas.width-d.canvas.width:y.percentageUsed-d.percentageUsed),a=-1,o=0;for(let d=0;d<r.length;d++)if(r[d].canvas.width!==o)a=d,o=r[d].canvas.width;else if(d-a===3)break;let g=r.slice(a,a+4),_=g.map(d=>d.glyphs[0].texturePage).sort((d,y)=>d>y?1:-1),c=this.pages.length-g.length,u=this._mergePages(g,c);u.version++;for(let d=_.length-1;d>=0;d--)this._deletePage(_[d]);this.pages.push(u),this._requestClearModel=!0,this._onAddTextureAtlasCanvas.fire(u.canvas)}let n=new Ff(this._document,this._textureSize);return this._pages.push(n),this._activePages.push(n),this._onAddTextureAtlasCanvas.fire(n.canvas),n}_mergePages(n,r){let a=n[0].canvas.width*2,o=new Ff(this._document,a,n);for(let[g,_]of n.entries()){let c=g*_.canvas.width%a,u=Math.floor(g/2)*_.canvas.height;o.ctx.drawImage(_.canvas,c,u);for(let y of _.glyphs)y.texturePage=r,y.sizeClipSpace.x=y.size.x/a,y.sizeClipSpace.y=y.size.y/a,y.texturePosition.x+=c,y.texturePosition.y+=u,y.texturePositionClipSpace.x=y.texturePosition.x/a,y.texturePositionClipSpace.y=y.texturePosition.y/a;this._onRemoveTextureAtlasCanvas.fire(_.canvas);let d=this._activePages.indexOf(_);d!==-1&&this._activePages.splice(d,1)}return o}_deletePage(n){this._pages.splice(n,1);for(let r=n;r<this._pages.length;r++){let a=this._pages[r];for(let o of a.glyphs)o.texturePage--;a.version++}}getRasterizedGlyphCombinedChar(n,r,a,o,g,_){return this._getFromCacheMap(this._cacheMapCombined,n,r,a,o,g,_)}getRasterizedGlyph(n,r,a,o,g,_){return this._getFromCacheMap(this._cacheMap,n,r,a,o,g,_)}_getFromCacheMap(n,r,a,o,g,_,c){return gl=n.get(r,a,o,g),gl||(gl=this._drawToCache(r,a,o,g,_,c),n.set(r,a,o,g,gl)),gl}_getColorFromAnsiIndex(n){if(n>=this._config.colors.ansi.length)throw new Error("No color found for idx "+n);return this._config.colors.ansi[n]}_getBackgroundColor(n,r,a,o){if(this._config.allowTransparency)return Oi;let g;switch(n){case 16777216:case 33554432:g=this._getColorFromAnsiIndex(r);break;case 50331648:let _=Za.toColorRGB(r);g=qn.toColor(_[0],_[1],_[2]);break;default:a?g=Al.opaque(this._config.colors.foreground):g=this._config.colors.background;break}return this._config.allowTransparency||(g=Al.opaque(g)),g}_getForegroundColor(n,r,a,o,g,_,c,u,d,y){let m=this._getMinimumContrastColor(n,r,a,o,g,_,c,d,u,y);if(m)return m;let w;switch(g){case 16777216:case 33554432:this._config.drawBoldTextInBrightColors&&d&&_<8&&(_+=8),w=this._getColorFromAnsiIndex(_);break;case 50331648:let C=Za.toColorRGB(_);w=qn.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=Al.opaque(w)),u&&(w=Al.multiplyOpacity(w,U3)),w}_resolveBackgroundRgba(n,r,a){switch(n){case 16777216:case 33554432:return this._getColorFromAnsiIndex(r).rgba;case 50331648:return r<<8;default:return a?this._config.colors.foreground.rgba:this._config.colors.background.rgba}}_resolveForegroundRgba(n,r,a,o){switch(n){case 16777216:case 33554432:return this._config.drawBoldTextInBrightColors&&o&&r<8&&(r+=8),this._getColorFromAnsiIndex(r).rgba;case 50331648:return r<<8;default:return a?this._config.colors.background.rgba:this._config.colors.foreground.rgba}}_getMinimumContrastColor(n,r,a,o,g,_,c,u,d,y){if(this._config.minimumContrastRatio===1||y)return;let m=this._getContrastCache(d),w=m.getColor(n,o);if(w!==void 0)return w||void 0;let C=this._resolveBackgroundRgba(r,a,c),A=this._resolveForegroundRgba(g,_,c,u),E=ea.ensureContrastRatio(C,A,this._config.minimumContrastRatio/(d?2:1));if(!E){m.setColor(n,o,null);return}let f=qn.toColor(E>>24&255,E>>16&255,E>>8&255);return m.setColor(n,o,f),f}_getContrastCache(n){return n?this._config.colors.halfContrastCache:this._config.colors.contrastCache}_drawToCache(n,r,a,o,g,_){let c=typeof n=="number"?String.fromCharCode(n):n;_&&this._tmpCanvas.parentElement!==_&&(this._tmpCanvas.style.display="none",_.append(this._tmpCanvas));let u=Math.min(this._config.deviceCellWidth*Math.max(c.length,2)+pl*2,this._config.deviceMaxTextureSize);this._tmpCanvas.width<u&&(this._tmpCanvas.width=u);let d=Math.min(this._config.deviceCellHeight+pl*4,this._textureSize);if(this._tmpCanvas.height<d&&(this._tmpCanvas.height=d),this._tmpCtx.save(),this._workAttributeData.fg=a,this._workAttributeData.bg=r,this._workAttributeData.extended.ext=o,!!this._workAttributeData.isInvisible())return nb;let y=!!this._workAttributeData.isBold(),m=!!this._workAttributeData.isInverse(),w=!!this._workAttributeData.isDim(),C=!!this._workAttributeData.isItalic(),A=!!this._workAttributeData.isUnderline(),E=!!this._workAttributeData.isStrikethrough(),f=!!this._workAttributeData.isOverline(),v=this._workAttributeData.getFgColor(),p=this._workAttributeData.getFgColorMode(),S=this._workAttributeData.getBgColor(),k=this._workAttributeData.getBgColorMode();if(m){let H=v;v=S,S=H;let O=p;p=k,k=O}let L=this._getBackgroundColor(k,S,m,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=Mw;let T=c.length===1&&rm(c.charCodeAt(0)),I=c.length===1&&D3(c.charCodeAt(0)),K=this._getForegroundColor(r,k,S,a,p,v,m,w,y,Lw(c.charCodeAt(0)));this._tmpCtx.fillStyle=K.css;let F=I?0:pl*2,G=!1;this._config.customGlyphs!==!1&&(G=q3(this._tmpCtx,c,F,F,this._config.deviceCellWidth,this._config.deviceCellHeight,this._config.fontSize,this._config.devicePixelRatio));let B=!T,X;if(typeof n=="number"?X=this._unicodeService.wcwidth(n):X=this._unicodeService.getStringCellWidth(n),A){this._tmpCtx.save();let H=Math.max(1,Math.floor(this._config.fontSize*this._config.devicePixelRatio/15)),O=H%2===1?.5:0;if(this._tmpCtx.lineWidth=H,this._workAttributeData.isUnderlineColorDefault())this._tmpCtx.strokeStyle=this._tmpCtx.fillStyle;else if(this._workAttributeData.isUnderlineColorRGB())B=!1,this._tmpCtx.strokeStyle=`rgb(${Za.toColorRGB(this._workAttributeData.getUnderlineColor()).join(",")})`;else{B=!1;let te=this._workAttributeData.getUnderlineColor();this._config.drawBoldTextInBrightColors&&this._workAttributeData.isBold()&&te<8&&(te+=8),this._tmpCtx.strokeStyle=this._getColorFromAnsiIndex(te).css}this._tmpCtx.beginPath();let P=F,W=Math.ceil(F+this._config.deviceCharHeight)-O-(g?H*2:0),Z=W+H,ie=W+H*2,he=this._workAttributeData.getUnderlineVariantOffset();for(let te=0;te<X;te++){this._tmpCtx.save();let $=P+te*this._config.deviceCellWidth,le=P+(te+1)*this._config.deviceCellWidth,ge=$+this._config.deviceCellWidth/2;switch(this._workAttributeData.extended.underlineStyle){case 2:this._tmpCtx.moveTo($,W),this._tmpCtx.lineTo(le,W),this._tmpCtx.moveTo($,ie),this._tmpCtx.lineTo(le,ie);break;case 3:let we=H<=1?ie:Math.ceil(F+this._config.deviceCharHeight-H/2)-O,Se=H<=1?W:Math.ceil(F+this._config.deviceCharHeight+H/2)-O,je=new Path2D;je.rect($,W,this._config.deviceCellWidth,ie-W),this._tmpCtx.clip(je),this._tmpCtx.moveTo($-this._config.deviceCellWidth/2,Z),this._tmpCtx.bezierCurveTo($-this._config.deviceCellWidth/2,Se,$,Se,$,Z),this._tmpCtx.bezierCurveTo($,we,ge,we,ge,Z),this._tmpCtx.bezierCurveTo(ge,Se,le,Se,le,Z),this._tmpCtx.bezierCurveTo(le,we,le+this._config.deviceCellWidth/2,we,le+this._config.deviceCellWidth/2,Z);break;case 4:let Ie=he===0?0:he>=H?H*2-he:H-he;he>=H||Ie===0?(this._tmpCtx.setLineDash([Math.round(H),Math.round(H)]),this._tmpCtx.moveTo($+Ie,W),this._tmpCtx.lineTo(le,W)):(this._tmpCtx.setLineDash([Math.round(H),Math.round(H)]),this._tmpCtx.moveTo($,W),this._tmpCtx.lineTo($+Ie,W),this._tmpCtx.moveTo($+Ie+H,W),this._tmpCtx.lineTo(le,W)),he=H3(le-$,H,he);break;case 5:let Ge=.6,vt=.3,Le=le-$,Rt=Math.floor(Ge*Le),Xt=Math.floor(vt*Le),vn=Le-Rt-Xt;this._tmpCtx.setLineDash([Rt,Xt,vn]),this._tmpCtx.moveTo($,W),this._tmpCtx.lineTo(le,W);break;default:this._tmpCtx.moveTo($,W),this._tmpCtx.lineTo(le,W);break}this._tmpCtx.stroke(),this._tmpCtx.restore()}if(this._tmpCtx.restore(),!G&&this._config.fontSize>=12&&!this._config.allowTransparency&&c!==" "){this._tmpCtx.save(),this._tmpCtx.textBaseline="alphabetic";let te=this._tmpCtx.measureText(c);if(this._tmpCtx.restore(),"actualBoundingBoxDescent"in te&&te.actualBoundingBoxDescent>0){this._tmpCtx.save();let $=new Path2D;$.rect(P,W-Math.ceil(H/2),this._config.deviceCellWidth*X,ie-W+Math.ceil(H/2)),this._tmpCtx.clip($),this._tmpCtx.lineWidth=this._config.devicePixelRatio*3,this._tmpCtx.strokeStyle=L.css,this._tmpCtx.strokeText(c,F,F+this._config.deviceCharHeight),this._tmpCtx.restore()}}}if(f){let H=Math.max(1,Math.floor(this._config.fontSize*this._config.devicePixelRatio/15)),O=H%2===1?.5:0;this._tmpCtx.lineWidth=H,this._tmpCtx.strokeStyle=this._tmpCtx.fillStyle,this._tmpCtx.beginPath(),this._tmpCtx.moveTo(F,F+O),this._tmpCtx.lineTo(F+this._config.deviceCharWidth*X,F+O),this._tmpCtx.stroke()}if(G||this._tmpCtx.fillText(c,F,F+this._config.deviceCharHeight),c==="_"&&!this._config.allowTransparency){let H=Wf(this._tmpCtx.getImageData(F,F,this._config.deviceCellWidth,this._config.deviceCellHeight),L,K,B);if(H)for(let O=1;O<=5&&(this._tmpCtx.save(),this._tmpCtx.fillStyle=L.css,this._tmpCtx.fillRect(0,0,this._tmpCanvas.width,this._tmpCanvas.height),this._tmpCtx.restore(),this._tmpCtx.fillText(c,F,F+this._config.deviceCharHeight-O),H=Wf(this._tmpCtx.getImageData(F,F,this._config.deviceCellWidth,this._config.deviceCellHeight),L,K,B),!!H);O++);}if(E){let H=Math.max(1,Math.floor(this._config.fontSize*this._config.devicePixelRatio/10)),O=this._tmpCtx.lineWidth%2===1?.5:0;this._tmpCtx.lineWidth=H,this._tmpCtx.strokeStyle=this._tmpCtx.fillStyle,this._tmpCtx.beginPath(),this._tmpCtx.moveTo(F,F+Math.floor(this._config.deviceCharHeight/2)-O),this._tmpCtx.lineTo(F+this._config.deviceCharWidth*X,F+Math.floor(this._config.deviceCharHeight/2)-O),this._tmpCtx.stroke()}this._tmpCtx.restore();let Y=this._tmpCtx.getImageData(0,0,this._tmpCanvas.width,this._tmpCanvas.height),z;if(this._config.allowTransparency?z=dL(Y):z=Wf(Y,L,K,B),z)return nb;let q=this._findGlyphBoundingBox(Y,this._workBoundingBox,u,I,G,F),V,D;for(;;){if(this._activePages.length===0){let H=this._createNewPage();V=H,D=H.currentRow,D.height=q.size.y;break}V=this._activePages[this._activePages.length-1],D=V.currentRow;for(let H of this._activePages)q.size.y<=H.currentRow.height&&(V=H,D=H.currentRow);for(let H=this._activePages.length-1;H>=0;H--)for(let O of this._activePages[H].fixedRows)O.height<=D.height&&q.size.y<=O.height&&(V=this._activePages[H],D=O);if(q.size.x>this._textureSize){this._overflowSizePage||(this._overflowSizePage=new Ff(this._document,this._config.deviceMaxTextureSize),this.pages.push(this._overflowSizePage),this._requestClearModel=!0,this._onAddTextureAtlasCanvas.fire(this._overflowSizePage.canvas)),V=this._overflowSizePage,D=this._overflowSizePage.currentRow,D.x+q.size.x>=V.canvas.width&&(D.x=0,D.y+=D.height,D.height=0);break}if(D.y+q.size.y>=V.canvas.height||D.height>q.size.y+2){let H=!1;if(V.currentRow.y+V.currentRow.height+q.size.y>=V.canvas.height){let O;for(let P of this._activePages)if(P.currentRow.y+P.currentRow.height+q.size.y<P.canvas.height){O=P;break}if(O)V=O;else if(Ka.maxAtlasPages&&this._pages.length>=Ka.maxAtlasPages&&D.y+q.size.y<=V.canvas.height&&D.height>=q.size.y&&D.x+q.size.x<=V.canvas.width)H=!0;else{let P=this._createNewPage();V=P,D=P.currentRow,D.height=q.size.y,H=!0}}H||(V.currentRow.height>0&&V.fixedRows.push(V.currentRow),D={x:0,y:V.currentRow.y+V.currentRow.height,height:q.size.y},V.fixedRows.push(D),V.currentRow={x:0,y:D.y+D.height,height:0})}if(D.x+q.size.x<=V.canvas.width)break;D===V.currentRow?(D.x=0,D.y+=D.height,D.height=0):V.fixedRows.splice(V.fixedRows.indexOf(D),1)}return q.texturePage=this._pages.indexOf(V),q.texturePosition.x=D.x,q.texturePosition.y=D.y,q.texturePositionClipSpace.x=D.x/V.canvas.width,q.texturePositionClipSpace.y=D.y/V.canvas.height,q.sizeClipSpace.x/=V.canvas.width,q.sizeClipSpace.y/=V.canvas.height,D.height=Math.max(D.height,q.size.y),D.x+=q.size.x,V.ctx.putImageData(Y,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,r,a,o,g,_){r.top=0;let c=o?this._config.deviceCellHeight:this._tmpCanvas.height,u=o?this._config.deviceCellWidth:a,d=!1;for(let y=0;y<c;y++){for(let m=0;m<u;m++){let w=y*this._tmpCanvas.width*4+m*4+3;if(n.data[w]!==0){r.top=y,d=!0;break}}if(d)break}r.left=0,d=!1;for(let y=0;y<_+u;y++){for(let m=0;m<c;m++){let w=m*this._tmpCanvas.width*4+y*4+3;if(n.data[w]!==0){r.left=y,d=!0;break}}if(d)break}r.right=u,d=!1;for(let y=_+u-1;y>=_;y--){for(let m=0;m<c;m++){let w=m*this._tmpCanvas.width*4+y*4+3;if(n.data[w]!==0){r.right=y,d=!0;break}}if(d)break}r.bottom=c,d=!1;for(let y=c-1;y>=0;y--){for(let m=0;m<u;m++){let w=y*this._tmpCanvas.width*4+m*4+3;if(n.data[w]!==0){r.bottom=y,d=!0;break}}if(d)break}return{texturePage:0,texturePosition:{x:0,y:0},texturePositionClipSpace:{x:0,y:0},size:{x:r.right-r.left+1,y:r.bottom-r.top+1},sizeClipSpace:{x:r.right-r.left+1,y:r.bottom-r.top+1},offset:{x:-r.left+_+(o||g?Math.floor((this._config.deviceCellWidth-this._config.deviceCharWidth)/2):0),y:-r.top+_+(o||g?this._config.lineHeight===1?0:Math.round((this._config.deviceCellHeight-this._config.deviceCharHeight)/2):0)}}}},Ff=class{constructor(e,n,r){if(this._usedPixels=0,this._glyphs=[],this.version=0,this.currentRow={x:0,y:0,height:0},this.fixedRows=[],r)for(let a of r)this._glyphs.push(...a.glyphs),this._usedPixels+=a._usedPixels;this.canvas=Uw(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 Wf(e,n,r,a){let o=n.rgba>>>24,g=n.rgba>>>16&255,_=n.rgba>>>8&255,c=r.rgba>>>24,u=r.rgba>>>16&255,d=r.rgba>>>8&255,y=Math.floor((Math.abs(o-c)+Math.abs(g-u)+Math.abs(_-d))/12),m=!0;for(let w=0;w<e.data.length;w+=4)e.data[w]===o&&e.data[w+1]===g&&e.data[w+2]===_||a&&Math.abs(e.data[w]-o)+Math.abs(e.data[w+1]-g)+Math.abs(e.data[w+2]-_)<y?e.data[w+3]=0:m=!1;return m}function dL(e){for(let n=0;n<e.data.length;n+=4)if(e.data[n+3]>0)return!1;return!0}function Uw(e,n,r){let a=e.createElement("canvas");return a.width=n,a.height=r,a}function fL(e,n,r,a,o,g,_,c){let u={foreground:g.foreground,background:g.background,cursor:Oi,cursorAccent:Oi,selectionForeground:Oi,selectionBackgroundTransparent:Oi,selectionBackgroundOpaque:Oi,selectionInactiveBackgroundTransparent:Oi,selectionInactiveBackgroundOpaque:Oi,overviewRulerBorder:Oi,scrollbarSliderBackground:Oi,scrollbarSliderHoverBackground:Oi,scrollbarSliderActiveBackground:Oi,ansi:g.ansi.slice(),contrastCache:g.contrastCache,halfContrastCache:g.halfContrastCache};return{customGlyphs:o.customGlyphs,devicePixelRatio:_,deviceMaxTextureSize:c,letterSpacing:o.letterSpacing,lineHeight:o.lineHeight,deviceCellWidth:e,deviceCellHeight:n,deviceCharWidth:r,deviceCharHeight:a,fontFamily:o.fontFamily,fontSize:o.fontSize,fontWeight:o.fontWeight,fontWeightBold:o.fontWeightBold,allowTransparency:o.allowTransparency,drawBoldTextInBrightColors:o.drawBoldTextInBrightColors,minimumContrastRatio:o.minimumContrastRatio,colors:u}}function ib(e,n){for(let r=0;r<e.colors.ansi.length;r++)if(e.colors.ansi[r].rgba!==n.colors.ansi[r].rgba)return!1;return e.devicePixelRatio===n.devicePixelRatio&&e.customGlyphs===n.customGlyphs&&e.lineHeight===n.lineHeight&&e.letterSpacing===n.letterSpacing&&e.fontFamily===n.fontFamily&&e.fontSize===n.fontSize&&e.fontWeight===n.fontWeight&&e.fontWeightBold===n.fontWeightBold&&e.allowTransparency===n.allowTransparency&&e.deviceCharWidth===n.deviceCharWidth&&e.deviceCharHeight===n.deviceCharHeight&&e.drawBoldTextInBrightColors===n.drawBoldTextInBrightColors&&e.minimumContrastRatio===n.minimumContrastRatio&&e.colors.foreground.rgba===n.colors.foreground.rgba&&e.colors.background.rgba===n.colors.background.rgba}function pL(e){return(e&50331648)===16777216||(e&50331648)===33554432}var ji=[];function Fw(e,n,r,a,o,g,_,c,u){let d=fL(a,o,g,_,n,r,c,u);for(let w=0;w<ji.length;w++){let C=ji[w],A=C.ownedBy.indexOf(e);if(A>=0){if(ib(C.config,d))return C.atlas;C.ownedBy.length===1?(C.atlas.dispose(),ji.splice(w,1)):C.ownedBy.splice(A,1);break}}for(let w=0;w<ji.length;w++){let C=ji[w];if(ib(C.config,d))return C.ownedBy.push(e),C.atlas}let y=e._core,m={atlas:new _s(document,d,y.unicodeService),config:d,ownedBy:[e]};return ji.push(m),m.atlas}function rb(e){for(let n=0;n<ji.length;n++){let r=ji[n].ownedBy.indexOf(e);if(r!==-1){ji[n].ownedBy.length===1?(ji[n].atlas.dispose(),ji.splice(n,1)):ji[n].ownedBy.splice(r,1);break}}}var _u=600,gL=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=_u){this._blinkInterval&&(this._coreBrowserService.window.clearInterval(this._blinkInterval),this._blinkInterval=void 0),this._blinkStartTimeout=this._coreBrowserService.window.setTimeout(()=>{if(this._animationTimeRestarted){let n=_u-(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=_u-(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})},_u)},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 sb(e,n,r){let a=new n.ResizeObserver(o=>{let g=o.find(u=>u.target===e);if(!g)return;if(!("devicePixelContentBoxSize"in g)){a?.disconnect(),a=void 0;return}let _=g.devicePixelContentBoxSize[0].inlineSize,c=g.devicePixelContentBoxSize[0].blockSize;_>0&&c>0&&r(_,c)});try{a.observe(e,{box:["device-pixel-content-box"]})}catch{a.disconnect(),a=void 0}return $n(()=>a?.disconnect())}function mL(e){return e>65535?(e-=65536,String.fromCharCode((e>>10)+55296)+String.fromCharCode(e%1024+56320)):String.fromCharCode(e)}var ab=class Ww extends Za{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new jw,this.combinedData=""}static fromCharData(n){let r=new Ww;return r.setFromCharData(n),r}isCombined(){return this.content&2097152}getWidth(){return this.content>>22}getChars(){return this.content&2097152?this.combinedData:this.content&2097151?mL(this.content&2097151):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):this.content&2097151}setFromCharData(n){this.fg=n[0],this.bg=0;let r=!1;if(n[1].length>2)r=!0;else if(n[1].length===2){let a=n[1].charCodeAt(0);if(55296<=a&&a<=56319){let o=n[1].charCodeAt(1);56320<=o&&o<=57343?this.content=(a-55296)*1024+o-56320+65536|n[2]<<22:r=!0}else r=!0}else this.content=n[1].charCodeAt(0)|n[2]<<22;r&&(this.combinedData=n[1],this.content=2097152|n[2]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}},Gw=new Float32Array([2,0,0,0,0,-2,0,0,0,0,1,0,-1,1,0,1]);function qw(e,n,r){let a=mn(e.createProgram());if(e.attachShader(a,mn(ob(e,e.VERTEX_SHADER,n))),e.attachShader(a,mn(ob(e,e.FRAGMENT_SHADER,r))),e.linkProgram(a),e.getProgramParameter(a,e.LINK_STATUS))return a;console.error(e.getProgramInfoLog(a)),e.deleteProgram(a)}function ob(e,n,r){let a=mn(e.createShader(n));if(e.shaderSource(a,r),e.compileShader(a),e.getShaderParameter(a,e.COMPILE_STATUS))return a;console.error(e.getShaderInfoLog(a)),e.deleteShader(a)}function _L(e,n){let r=Math.min(e.length*2,n),a=new Float32Array(r);for(let o=0;o<e.length;o++)a[o]=e[o];return a}var vL=class{constructor(e){this.texture=e,this.version=-1}},bL=`#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 yL(e){let n="";for(let r=1;r<e;r++)n+=` else if (v_texpage == ${r}) { outColor = texture(u_texture[${r}], v_texcoord); }`;return`#version 300 es
|
|
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 vs=11,Ua=vs*Float32Array.BYTES_PER_ELEMENT,SL=2,nn=0,Ht,Gf=0,ml=0,wL=class extends Zi{constructor(e,n,r,a){super(),this._terminal=e,this._gl=n,this._dimensions=r,this._optionsService=a,this._activeBuffer=0,this._vertices={count:0,attributes:new Float32Array(0),attributesBuffers:[new Float32Array(0),new Float32Array(0)]};let o=this._gl;_s.maxAtlasPages===void 0&&(_s.maxAtlasPages=Math.min(32,mn(o.getParameter(o.MAX_TEXTURE_IMAGE_UNITS))),_s.maxTextureSize=mn(o.getParameter(o.MAX_TEXTURE_SIZE))),this._program=mn(qw(o,bL,yL(_s.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 g=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,g,o.STATIC_DRAW),o.enableVertexAttribArray(0),o.vertexAttribPointer(0,2,this._gl.FLOAT,!1,0,0);let c=new Uint8Array([0,1,2,3]),u=o.createBuffer();this._register($n(()=>o.deleteBuffer(u))),o.bindBuffer(o.ELEMENT_ARRAY_BUFFER,u),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,Ua,0),o.vertexAttribDivisor(2,1),o.enableVertexAttribArray(3),o.vertexAttribPointer(3,2,o.FLOAT,!1,Ua,2*Float32Array.BYTES_PER_ELEMENT),o.vertexAttribDivisor(3,1),o.enableVertexAttribArray(4),o.vertexAttribPointer(4,1,o.FLOAT,!1,Ua,4*Float32Array.BYTES_PER_ELEMENT),o.vertexAttribDivisor(4,1),o.enableVertexAttribArray(5),o.vertexAttribPointer(5,2,o.FLOAT,!1,Ua,5*Float32Array.BYTES_PER_ELEMENT),o.vertexAttribDivisor(5,1),o.enableVertexAttribArray(6),o.vertexAttribPointer(6,2,o.FLOAT,!1,Ua,7*Float32Array.BYTES_PER_ELEMENT),o.vertexAttribDivisor(6,1),o.enableVertexAttribArray(1),o.vertexAttribPointer(1,2,o.FLOAT,!1,Ua,9*Float32Array.BYTES_PER_ELEMENT),o.vertexAttribDivisor(1,1),o.useProgram(this._program);let d=new Int32Array(_s.maxAtlasPages);for(let y=0;y<_s.maxAtlasPages;y++)d[y]=y;o.uniform1iv(this._textureLocation,d),o.uniformMatrix4fv(this._projectionLocation,!1,Gw),this._atlasTextures=[];for(let y=0;y<_s.maxAtlasPages;y++){let m=new vL(mn(o.createTexture()));this._register($n(()=>o.deleteTexture(m.texture))),o.activeTexture(o.TEXTURE0+y),o.bindTexture(o.TEXTURE_2D,m.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]=m}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,r,a,o,g,_,c,u){this._updateCell(this._vertices.attributes,e,n,r,a,o,g,_,c,u)}_updateCell(e,n,r,a,o,g,_,c,u,d){if(nn=(r*this._terminal.cols+n)*vs,a===0||a===void 0){e.fill(0,nn,nn+vs-1-SL);return}this._atlas&&(c&&c.length>1?Ht=this._atlas.getRasterizedGlyphCombinedChar(c,o,g,_,!1,this._terminal.element):Ht=this._atlas.getRasterizedGlyph(a,o,g,_,!1,this._terminal.element),Gf=Math.floor((this._dimensions.device.cell.width-this._dimensions.device.char.width)/2),o!==d&&Ht.offset.x>Gf?(ml=Ht.offset.x-Gf,e[nn]=-(Ht.offset.x-ml)+this._dimensions.device.char.left,e[nn+1]=-Ht.offset.y+this._dimensions.device.char.top,e[nn+2]=(Ht.size.x-ml)/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+ml/this._atlas.pages[Ht.texturePage].canvas.width,e[nn+6]=Ht.texturePositionClipSpace.y,e[nn+7]=Ht.sizeClipSpace.x-ml/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&&P3(a,u,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*vs;this._vertices.count!==n?this._vertices.attributes=new Float32Array(n):this._vertices.attributes.fill(0);let r=0;for(;r<this._vertices.attributesBuffers.length;r++)this._vertices.count!==n?this._vertices.attributesBuffers[r]=new Float32Array(n):this._vertices.attributesBuffers[r].fill(0);this._vertices.count=n,r=0;for(let a=0;a<e.rows;a++)for(let o=0;o<e.cols;o++)this._vertices.attributes[r+9]=o/e.cols,this._vertices.attributes[r+10]=a/e.rows,r+=vs}handleResize(){let e=this._gl;e.useProgram(this._program),e.viewport(0,0,e.canvas.width,e.canvas.height),e.uniform2f(this._resolutionLocation,e.canvas.width,e.canvas.height),this.clear()}render(e){if(!this._atlas)return;let n=this._gl;n.useProgram(this._program),n.bindVertexArray(this._vertexArrayObject),this._activeBuffer=(this._activeBuffer+1)%2;let r=this._vertices.attributesBuffers[this._activeBuffer],a=0;for(let o=0;o<e.lineLengths.length;o++){let g=o*this._terminal.cols*vs,_=this._vertices.attributes.subarray(g,g+e.lineLengths[o]*vs);r.set(_,a),a+=_.length}n.bindBuffer(n.ARRAY_BUFFER,this._attributesBuffer),n.bufferData(n.ARRAY_BUFFER,r.subarray(0,a),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,a/vs)}setAtlas(e){this._atlas=e;for(let n of this._atlasTextures)n.version=-1}_bindAtlasPageTexture(e,n,r){e.activeTexture(e.TEXTURE0+r),e.bindTexture(e.TEXTURE_2D,this._atlasTextures[r].texture),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE),e.texImage2D(e.TEXTURE_2D,0,e.RGBA,e.RGBA,e.UNSIGNED_BYTE,n.pages[r].canvas),e.generateMipmap(e.TEXTURE_2D),this._atlasTextures[r].version=n.pages[r].version}setDimensions(e){this._dimensions=e}},xL=class{constructor(){this.clear()}clear(){this.hasSelection=!1,this.columnSelectMode=!1,this.viewportStartRow=0,this.viewportEndRow=0,this.viewportCappedStartRow=0,this.viewportCappedEndRow=0,this.startCol=0,this.endCol=0,this.selectionStart=void 0,this.selectionEnd=void 0}update(e,n,r,a=!1){if(this.selectionStart=n,this.selectionEnd=r,!n||!r||n[0]===r[0]&&n[1]===r[1]){this.clear();return}let o=e.buffers.active.ydisp,g=n[1]-o,_=r[1]-o,c=Math.max(g,0),u=Math.min(_,e.rows-1);if(c>=e.rows||u<0){this.clear();return}this.hasSelection=!0,this.columnSelectMode=a,this.viewportStartRow=g,this.viewportEndRow=_,this.viewportCappedStartRow=c,this.viewportCappedEndRow=u,this.startCol=n[0],this.endCol=r[0]}isCellSelected(e,n,r){return this.hasSelection?(r-=e.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?n>=this.startCol&&r>=this.viewportCappedStartRow&&n<this.endCol&&r<=this.viewportCappedEndRow:n<this.startCol&&r>=this.viewportCappedStartRow&&n>=this.endCol&&r<=this.viewportCappedEndRow:r>this.viewportStartRow&&r<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&r===this.viewportStartRow&&n>=this.startCol&&n<this.endCol||this.viewportStartRow<this.viewportEndRow&&r===this.viewportEndRow&&n<this.endCol||this.viewportStartRow<this.viewportEndRow&&r===this.viewportStartRow&&n>=this.startCol):!1}};function CL(){return new xL}var Ku=4,Ou=1,Du=2,qf=3,EL=2147483648,kL=class{constructor(){this.cells=new Uint32Array(0),this.lineLengths=new Uint32Array(0),this.selection=CL()}resize(e,n){let r=e*n*Ku;r!==this.cells.length&&(this.cells=new Uint32Array(r),this.lineLengths=new Uint32Array(n))}clear(){this.cells.fill(0,0),this.lineLengths.fill(0,0)}},AL=`#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
|
-
}`,TL=`#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
|
-
}`,Br=8,Kf=Br*Float32Array.BYTES_PER_ELEMENT,RL=20*Br,lb=class{constructor(){this.attributes=new Float32Array(RL),this.count=0}},Or=0,cb=0,ub=0,hb=0,db=0,fb=0,pb=0,LL=class extends Zi{constructor(e,n,r,a){super(),this._terminal=e,this._gl=n,this._dimensions=r,this._themeService=a,this._vertices=new lb,this._verticesCursor=new lb;let o=this._gl;this._program=mn(qw(o,AL,TL)),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 g=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,g,o.STATIC_DRAW),o.enableVertexAttribArray(3),o.vertexAttribPointer(3,2,this._gl.FLOAT,!1,0,0);let c=new Uint8Array([0,1,2,3]),u=o.createBuffer();this._register($n(()=>o.deleteBuffer(u))),o.bindBuffer(o.ELEMENT_ARRAY_BUFFER,u),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,Kf,0),o.vertexAttribDivisor(0,1),o.enableVertexAttribArray(1),o.vertexAttribPointer(1,2,o.FLOAT,!1,Kf,2*Float32Array.BYTES_PER_ELEMENT),o.vertexAttribDivisor(1,1),o.enableVertexAttribArray(2),o.vertexAttribPointer(2,4,o.FLOAT,!1,Kf,4*Float32Array.BYTES_PER_ELEMENT),o.vertexAttribDivisor(2,1),this._updateCachedColors(a.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,Gw),n.bindBuffer(n.ARRAY_BUFFER,this._attributesBuffer),n.bufferData(n.ARRAY_BUFFER,e.attributes,n.DYNAMIC_DRAW),n.drawElementsInstanced(this._gl.TRIANGLE_STRIP,4,n.UNSIGNED_BYTE,0,e.count)}handleResize(){this._updateViewportRectangle()}setDimensions(e){this._dimensions=e}_updateCachedColors(e){this._bgFloat=this._colorToFloat32Array(e.background),this._cursorFloat=this._colorToFloat32Array(e.cursor)}_updateViewportRectangle(){this._addRectangleFloat(this._vertices.attributes,0,0,0,this._terminal.cols*this._dimensions.device.cell.width,this._terminal.rows*this._dimensions.device.cell.height,this._bgFloat)}updateBackgrounds(e){let n=this._terminal,r=this._vertices,a=1,o,g,_,c,u,d,y,m,w,C,A;for(o=0;o<n.rows;o++){for(_=-1,c=0,u=0,d=!1,g=0;g<n.cols;g++)y=(o*n.cols+g)*Ku,m=e.cells[y+Ou],w=e.cells[y+Du],C=!!(w&67108864),(m!==c||w!==u&&(d||C))&&((c!==0||d&&u!==0)&&(A=a++*Br,this._updateRectangle(r,A,u,c,_,g,o)),_=g,c=m,u=w,d=C);(c!==0||d&&u!==0)&&(A=a++*Br,this._updateRectangle(r,A,u,c,_,n.cols,o))}r.count=a}updateCursor(e){let n=this._verticesCursor,r=e.cursor;if(!r||r.style==="block"){n.count=0;return}let a,o=0;(r.style==="bar"||r.style==="outline")&&(a=o++*Br,this._addRectangleFloat(n.attributes,a,r.x*this._dimensions.device.cell.width,r.y*this._dimensions.device.cell.height,r.style==="bar"?r.dpr*r.cursorWidth:r.dpr,this._dimensions.device.cell.height,this._cursorFloat)),(r.style==="underline"||r.style==="outline")&&(a=o++*Br,this._addRectangleFloat(n.attributes,a,r.x*this._dimensions.device.cell.width,(r.y+1)*this._dimensions.device.cell.height-r.dpr,r.width*this._dimensions.device.cell.width,r.dpr,this._cursorFloat)),r.style==="outline"&&(a=o++*Br,this._addRectangleFloat(n.attributes,a,r.x*this._dimensions.device.cell.width,r.y*this._dimensions.device.cell.height,r.width*this._dimensions.device.cell.width,r.dpr,this._cursorFloat),a=o++*Br,this._addRectangleFloat(n.attributes,a,(r.x+r.width)*this._dimensions.device.cell.width-r.dpr,r.y*this._dimensions.device.cell.height,r.dpr,this._dimensions.device.cell.height,this._cursorFloat)),n.count=o}_updateRectangle(e,n,r,a,o,g,_){if(r&67108864)switch(r&50331648){case 16777216:case 33554432:Or=this._themeService.colors.ansi[r&255].rgba;break;case 50331648:Or=(r&16777215)<<8;break;default:Or=this._themeService.colors.foreground.rgba}else switch(a&50331648){case 16777216:case 33554432:Or=this._themeService.colors.ansi[a&255].rgba;break;case 50331648:Or=(a&16777215)<<8;break;default:Or=this._themeService.colors.background.rgba}e.attributes.length<n+4&&(e.attributes=_L(e.attributes,this._terminal.rows*this._terminal.cols*Br)),cb=o*this._dimensions.device.cell.width,ub=_*this._dimensions.device.cell.height,hb=(Or>>24&255)/255,db=(Or>>16&255)/255,fb=(Or>>8&255)/255,pb=1,this._addRectangle(e.attributes,n,cb,ub,(g-o)*this._dimensions.device.cell.width,this._dimensions.device.cell.height,hb,db,fb,pb)}_addRectangle(e,n,r,a,o,g,_,c,u,d){e[n]=r/this._dimensions.device.canvas.width,e[n+1]=a/this._dimensions.device.canvas.height,e[n+2]=o/this._dimensions.device.canvas.width,e[n+3]=g/this._dimensions.device.canvas.height,e[n+4]=_,e[n+5]=c,e[n+6]=u,e[n+7]=d}_addRectangleFloat(e,n,r,a,o,g,_){e[n]=r/this._dimensions.device.canvas.width,e[n+1]=a/this._dimensions.device.canvas.height,e[n+2]=o/this._dimensions.device.canvas.width,e[n+3]=g/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])}},ML=class extends Zi{constructor(e,n,r,a,o,g,_,c){super(),this._container=n,this._alpha=o,this._coreBrowserService=g,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-${r}-layer`),this._canvas.style.zIndex=a.toString(),this._initCanvas(),this._container.appendChild(this._canvas),this._register(this._themeService.onChangeColors(u=>{this._refreshCharAtlas(e,u),this.reset(e)})),this._register($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,r){}handleSelectionChanged(e,n,r,a=!1){}_setTransparency(e,n){if(n===this._alpha)return;let r=this._canvas;this._alpha=n,this._canvas=this._canvas.cloneNode(),this._initCanvas(),this._container.replaceChild(this._canvas,r),this._refreshCharAtlas(e,this._themeService.colors),this.handleGridChanged(e,0,e.rows-1)}_refreshCharAtlas(e,n){this._deviceCharWidth<=0&&this._deviceCharHeight<=0||(this._charAtlas=Fw(e,this._optionsService.rawOptions,n,this._deviceCellWidth,this._deviceCellHeight,this._deviceCharWidth,this._deviceCharHeight,this._coreBrowserService.dpr,2048),this._charAtlas.warmUp())}resize(e,n){this._deviceCellWidth=n.device.cell.width,this._deviceCellHeight=n.device.cell.height,this._deviceCharWidth=n.device.char.width,this._deviceCharHeight=n.device.char.height,this._deviceCharLeft=n.device.char.left,this._deviceCharTop=n.device.char.top,this._canvas.width=n.device.canvas.width,this._canvas.height=n.device.canvas.height,this._canvas.style.width=`${n.css.canvas.width}px`,this._canvas.style.height=`${n.css.canvas.height}px`,this._alpha||this._clearAll(),this._refreshCharAtlas(e,this._themeService.colors)}_fillBottomLineAtCells(e,n,r=1){this._ctx.fillRect(e*this._deviceCellWidth,(n+1)*this._deviceCellHeight-this._coreBrowserService.dpr-1,r*this._deviceCellWidth,this._coreBrowserService.dpr)}_clearAll(){this._alpha?this._ctx.clearRect(0,0,this._canvas.width,this._canvas.height):(this._ctx.fillStyle=this._themeService.colors.background.css,this._ctx.fillRect(0,0,this._canvas.width,this._canvas.height))}_clearCells(e,n,r,a){this._alpha?this._ctx.clearRect(e*this._deviceCellWidth,n*this._deviceCellHeight,r*this._deviceCellWidth,a*this._deviceCellHeight):(this._ctx.fillStyle=this._themeService.colors.background.css,this._ctx.fillRect(e*this._deviceCellWidth,n*this._deviceCellHeight,r*this._deviceCellWidth,a*this._deviceCellHeight))}_fillCharTrueColor(e,n,r,a){this._ctx.font=this._getFont(e,!1,!1),this._ctx.textBaseline=Mw,this._clipCell(r,a,n.getWidth()),this._ctx.fillText(n.getChars(),r*this._deviceCellWidth+this._deviceCharLeft,a*this._deviceCellHeight+this._deviceCharTop+this._deviceCharHeight)}_clipCell(e,n,r){this._ctx.beginPath(),this._ctx.rect(e*this._deviceCellWidth,n*this._deviceCellHeight,r*this._deviceCellWidth,this._deviceCellHeight),this._ctx.clip()}_getFont(e,n,r){let a=n?e.options.fontWeightBold:e.options.fontWeight;return`${r?"italic":""} ${a} ${e.options.fontSize*this._coreBrowserService.dpr}px ${e.options.fontFamily}`}},NL=class extends ML{constructor(e,n,r,a,o,g,_){super(r,e,"link",n,!0,o,g,_),this._register(a.onShowLinkUnderline(c=>this._handleShowLinkUnderline(c))),this._register(a.onHideLinkUnderline(c=>this._handleHideLinkUnderline(c)))}resize(e,n){super.resize(e,n),this._state=void 0}reset(e){this._clearCurrentLink()}_clearCurrentLink(){if(this._state){this._clearCells(this._state.x1,this._state.y1,this._state.cols-this._state.x1,1);let e=this._state.y2-this._state.y1-1;e>0&&this._clearCells(0,this._state.y1+1,this._state.cols,e),this._clearCells(0,this._state.y2,this._state.x2,1),this._state=void 0}}_handleShowLinkUnderline(e){if(e.fg===257?this._ctx.fillStyle=this._themeService.colors.background.css:e.fg!==void 0&&pL(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()}},Ys=typeof window=="object"?window:globalThis,Zp=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,r){if(this.getZoomLevel(r)===n)return;let a=this.getWindowId(r);this.mapWindowIdToZoomLevel.set(a,n),this._onDidChangeZoomLevel.fire(a)}getZoomFactor(n){return this.mapWindowIdToZoomFactor.get(this.getWindowId(n))??1}setZoomFactor(n,r){this.mapWindowIdToZoomFactor.set(this.getWindowId(r),n)}setFullscreen(n,r){if(this.isFullscreen(r)===n)return;let a=this.getWindowId(r);this.mapWindowIdToFullScreen.set(a,n),this._onDidChangeFullscreen.fire(a)}isFullscreen(n){return!!this.mapWindowIdToFullScreen.get(this.getWindowId(n))}getWindowId(n){return n.vscodeWindowId}};Zp.INSTANCE=new Zp;var Kw=Zp;function OL(e,n,r){typeof n=="string"&&(n=e.matchMedia(n)),n.addEventListener("change",r)}Kw.INSTANCE.onDidChangeZoomLevel;Kw.INSTANCE.onDidChangeFullscreen;var go=typeof navigator=="object"?navigator.userAgent:"";go.indexOf("Firefox")>=0;go.indexOf("AppleWebKit")>=0;var DL=go.indexOf("Chrome")>=0;!DL&&go.indexOf("Safari")>=0;go.indexOf("Electron/")>=0;go.indexOf("Android")>=0;var Vf=!1;if(typeof Ys.matchMedia=="function"){let e=Ys.matchMedia("(display-mode: standalone) or (display-mode: window-controls-overlay)"),n=Ys.matchMedia("(display-mode: fullscreen)");Vf=e.matches,OL(Ys,e,({matches:r})=>{Vf&&n.matches||(Vf=r)})}var Ja="en",Yf=!1,Vw=!1,vu,Bu=Ja,gb=Ja,BL,Dr,ta=globalThis,vi;typeof ta.vscode<"u"&&typeof ta.vscode.process<"u"?vi=ta.vscode.process:typeof process<"u"&&typeof process?.versions?.node=="string"&&(vi=process);var jL=typeof vi?.versions?.electron=="string",IL=jL&&vi?.type==="renderer";if(typeof vi=="object"){vi.platform,vi.platform,Yf=vi.platform==="linux",Yf&&vi.env.SNAP&&vi.env.SNAP_REVISION,vi.env.CI||vi.env.BUILD_ARTIFACTSTAGINGDIRECTORY,vu=Ja,Bu=Ja;let e=vi.env.VSCODE_NLS_CONFIG;if(e)try{let n=JSON.parse(e);vu=n.userLocale,gb=n.osLocale,Bu=n.resolvedLanguage||Ja,BL=n.languagePack?.translationsConfigFile}catch{}Vw=!0}else typeof navigator=="object"&&!IL?(Dr=navigator.userAgent,Dr.indexOf("Windows")>=0,Dr.indexOf("Macintosh")>=0,(Dr.indexOf("Macintosh")>=0||Dr.indexOf("iPad")>=0||Dr.indexOf("iPhone")>=0)&&navigator.maxTouchPoints&&navigator.maxTouchPoints>0,Yf=Dr.indexOf("Linux")>=0,Dr?.indexOf("Mobi")>=0,Bu=globalThis._VSCODE_NLS_LANGUAGE||Ja,vu=navigator.language.toLowerCase(),gb=vu):console.error("Unable to resolve platform.");var mb=Vw,lr=Dr,gs=Bu,PL;(e=>{function n(){return gs}e.value=n;function r(){return gs.length===2?gs==="en":gs.length>=3?gs[0]==="e"&&gs[1]==="n"&&gs[2]==="-":!1}e.isDefaultVariant=r;function a(){return gs==="en"}e.isDefault=a})(PL||={});var zL=typeof ta.postMessage=="function"&&!ta.importScripts;(()=>{if(zL){let e=[];ta.addEventListener("message",r=>{if(r.data&&r.data.vscodeScheduleAsyncWork)for(let a=0,o=e.length;a<o;a++){let g=e[a];if(g.id===r.data.vscodeScheduleAsyncWork){e.splice(a,1),g.callback();return}}});let n=0;return r=>{let a=++n;e.push({id:a,callback:r}),ta.postMessage({vscodeScheduleAsyncWork:a},"*")}}return e=>setTimeout(e)})();var HL=!!(lr&&lr.indexOf("Chrome")>=0);lr&&lr.indexOf("Firefox")>=0;!HL&&lr&&lr.indexOf("Safari")>=0;lr&&lr.indexOf("Edg/")>=0;lr&&lr.indexOf("Android")>=0;var Fa=typeof navigator=="object"?navigator:{};mb||document.queryCommandSupported&&document.queryCommandSupported("copy")||Fa&&Fa.clipboard&&Fa.clipboard.writeText,mb||Fa&&Fa.clipboard&&Fa.clipboard.readText;var sm=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}},Xf=new sm,_b=new sm,vb=new sm;new Array(230);var $L;(e=>{function n(c){return Xf.keyCodeToStr(c)}e.toString=n;function r(c){return Xf.strToKeyCode(c)}e.fromString=r;function a(c){return _b.keyCodeToStr(c)}e.toUserSettingsUS=a;function o(c){return vb.keyCodeToStr(c)}e.toUserSettingsGeneral=o;function g(c){return _b.strToKeyCode(c)||vb.strToKeyCode(c)}e.fromUserSettings=g;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 Xf.keyCodeToStr(c)}e.toElectronAccelerator=_})($L||={});var Yw=Object.freeze(function(e,n){let r=setTimeout(e.bind(n),0);return{dispose(){clearTimeout(r)}}}),UL;(e=>{function n(r){return r===e.None||r===e.Cancelled||r instanceof FL?!0:!r||typeof r!="object"?!1:typeof r.isCancellationRequested=="boolean"&&typeof r.onCancellationRequested=="function"}e.isCancellationToken=n,e.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:Ir.None}),e.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:Yw})})(UL||={});var FL=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?Yw:(this._emitter||(this._emitter=new $t),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=null)}},WL;(e=>{async function n(a){let o,g=await Promise.all(a.map(_=>_.then(c=>c,c=>{o||(o=c)})));if(typeof o<"u")throw o;return g}e.settled=n;function r(a){return new Promise(async(o,g)=>{try{await a(o,g)}catch(_){g(_)}})}e.withAsyncBody=r})(WL||={});var bb=class Di{static fromArray(n){return new Di(r=>{r.emitMany(n)})}static fromPromise(n){return new Di(async r=>{r.emitMany(await n)})}static fromPromises(n){return new Di(async r=>{await Promise.all(n.map(async a=>r.emitOne(await a)))})}static merge(n){return new Di(async r=>{await Promise.all(n.map(async a=>{for await(let o of a)r.emitOne(o)}))})}constructor(n,r){this._state=0,this._results=[],this._error=null,this._onReturn=r,this._onStateChanged=new $t,queueMicrotask(async()=>{let a={emitOne:o=>this.emitOne(o),emitMany:o=>this.emitMany(o),reject:o=>this.reject(o)};try{await Promise.resolve(n(a)),this.resolve()}catch(o){this.reject(o)}finally{a.emitOne=void 0,a.emitMany=void 0,a.reject=void 0}})}[Symbol.asyncIterator](){let n=0;return{next:async()=>{do{if(this._state===2)throw this._error;if(n<this._results.length)return{done:!1,value:this._results[n++]};if(this._state===1)return{done:!0,value:void 0};await Ir.toPromise(this._onStateChanged.event)}while(!0)},return:async()=>(this._onReturn?.(),{done:!0,value:void 0})}}static map(n,r){return new Di(async a=>{for await(let o of n)a.emitOne(r(o))})}map(n){return Di.map(this,n)}static filter(n,r){return new Di(async a=>{for await(let o of n)r(o)&&a.emitOne(o)})}filter(n){return Di.filter(this,n)}static coalesce(n){return Di.filter(n,r=>!!r)}coalesce(){return Di.coalesce(this)}static async toPromise(n){let r=[];for await(let a of n)r.push(a);return r}toPromise(){return Di.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())}};bb.EMPTY=bb.fromArray([]);var{getWindow:GL}=(function(){let e=new Map,n={window:Ys,disposables:new ro};e.set(Ys.vscodeWindowId,n);let r=new $t,a=new $t,o=new $t;function g(_,c){return(typeof _=="number"?e.get(_):void 0)??(c?n:void 0)}return{onDidRegisterWindow:r.event,onWillUnregisterWindow:o.event,onDidUnregisterWindow:a.event,registerWindow(_){if(e.has(_.vscodeWindowId))return Zi.None;let c=new ro,u={window:_,disposables:c.add(new ro)};return e.set(_.vscodeWindowId,u),c.add($n(()=>{e.delete(_.vscodeWindowId),a.fire(_)})),c.add(Jp(_,KL.BEFORE_UNLOAD,()=>{o.fire(_)})),r.fire(u),c},getWindows(){return e.values()},getWindowsCount(){return e.size},getWindowId(_){return _.vscodeWindowId},hasWindow(_){return e.has(_)},getWindowById:g,getWindow(_){let c=_;if(c?.ownerDocument?.defaultView)return c.ownerDocument.defaultView.window;let u=_;return u?.view?u.view.window:Ys},getDocument(_){return GL(_).document}}})(),qL=class{constructor(e,n,r,a){this._node=e,this._type=n,this._handler=r,this._options=a||!1,this._node.addEventListener(this._type,this._handler,this._options)}dispose(){this._handler&&(this._node.removeEventListener(this._type,this._handler,this._options),this._node=null,this._handler=null)}};function Jp(e,n,r,a){return new qL(e,n,r,a)}var KL={BEFORE_UNLOAD:"beforeunload"},VL=class extends Zi{constructor(e,n,r,a,o,g,_,c,u){super(),this._terminal=e,this._characterJoinerService=n,this._charSizeService=r,this._coreBrowserService=a,this._coreService=o,this._decorationService=g,this._optionsService=_,this._themeService=c,this._cursorBlinkStateManager=new fl,this._charAtlasDisposable=this._register(new fl),this._observerDisposable=this._register(new fl),this._model=new kL,this._workCell=new ab,this._workCell2=new ab,this._rectangleRenderer=this._register(new fl),this._glyphRenderer=this._register(new fl),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:u};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 $3(this._terminal,this._optionsService,this._model.selection,this._decorationService,this._coreBrowserService,this._themeService),this._core=this._terminal._core,this._renderLayers=[new NL(this._core.screenElement,2,this._terminal,this._core.linkifier,this._coreBrowserService,_,this._themeService)],this.dimensions=z3(),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(Jp(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(Jp(this._canvas,"webglcontextrestored",y=>{console.warn("webglcontextrestored event received"),clearTimeout(this._contextRestorationTimeout),this._contextRestorationTimeout=void 0,rb(this._terminal),this._initializeWebGLState(),this._requestRedrawViewport()})),this._observerDisposable.value=sb(this._canvas,this._coreBrowserService.window,(y,m)=>this._setCanvasDevicePixelDimensions(y,m)),this._register(this._coreBrowserService.onWindowChange(y=>{this._observerDisposable.value=sb(this._canvas,y,(m,w)=>this._setCanvasDevicePixelDimensions(m,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),rb(this._terminal)}))}get textureAtlas(){return this._charAtlas?.pages[0].canvas}_handleColorChange(){this._refreshCharAtlas(),this._clearModel(!0)}handleDevicePixelRatioChange(){this._devicePixelRatio!==this._coreBrowserService.dpr&&(this._devicePixelRatio=this._coreBrowserService.dpr,this.handleResize(this._terminal.cols,this._terminal.rows))}handleResize(e,n){this._updateDimensions(),this._model.resize(this._terminal.cols,this._terminal.rows);for(let r of this._renderLayers)r.resize(this._terminal,this.dimensions);this._canvas.width=this.dimensions.device.canvas.width,this._canvas.height=this.dimensions.device.canvas.height,this._canvas.style.width=`${this.dimensions.css.canvas.width}px`,this._canvas.style.height=`${this.dimensions.css.canvas.height}px`,this._core.screenElement.style.width=`${this.dimensions.css.canvas.width}px`,this._core.screenElement.style.height=`${this.dimensions.css.canvas.height}px`,this._rectangleRenderer.value?.setDimensions(this.dimensions),this._rectangleRenderer.value?.handleResize(),this._glyphRenderer.value?.setDimensions(this.dimensions),this._glyphRenderer.value?.handleResize(),this._refreshCharAtlas(),this._clearModel(!1)}handleCharSizeChanged(){this.handleResize(this._terminal.cols,this._terminal.rows)}handleBlur(){for(let e of this._renderLayers)e.handleBlur(this._terminal);this._cursorBlinkStateManager.value?.pause(),this._requestRedrawViewport()}handleFocus(){for(let e of this._renderLayers)e.handleFocus(this._terminal);this._cursorBlinkStateManager.value?.resume(),this._requestRedrawViewport()}handleSelectionChanged(e,n,r){for(let a of this._renderLayers)a.handleSelectionChanged(this._terminal,e,n,r);this._model.selection.update(this._core,e,n,r),this._requestRedrawViewport()}handleCursorMove(){for(let e of this._renderLayers)e.handleCursorMove(this._terminal);this._cursorBlinkStateManager.value?.restartBlinkAnimation()}_handleOptionsChanged(){this._updateDimensions(),this._refreshCharAtlas(),this._updateCursorBlink()}_initializeWebGLState(){return this._rectangleRenderer.value=new LL(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=Fw(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=kw(Ir.forward(e.onAddTextureAtlasCanvas,this._onAddTextureAtlasCanvas),Ir.forward(e.onRemoveTextureAtlasCanvas,this._onRemoveTextureAtlasCanvas))),this._charAtlas=e,this._charAtlas.warmUp(),this._glyphRenderer.value?.setAtlas(this._charAtlas)}_clearModel(e){this._model.clear(),e&&this._glyphRenderer.value?.clear()}clearTextureAtlas(){this._charAtlas?.clearTexture(),this._clearModel(!0),this._requestRedrawViewport()}clear(){this._clearModel(!0);for(let e of this._renderLayers)e.reset(this._terminal);this._cursorBlinkStateManager.value?.restartBlinkAnimation(),this._updateCursorBlink()}renderRows(e,n){if(!this._isAttached)if(this._core.screenElement?.isConnected&&this._charSizeService.width&&this._charSizeService.height)this._updateDimensions(),this._refreshCharAtlas(),this._isAttached=!0;else return;for(let r of this._renderLayers)r.handleGridChanged(this._terminal,e,n);!this._glyphRenderer.value||!this._rectangleRenderer.value||(this._glyphRenderer.value.beginFrame()?(this._clearModel(!0),this._updateModel(0,this._terminal.rows-1)):this._updateModel(e,n),this._rectangleRenderer.value.renderBackgrounds(),this._glyphRenderer.value.render(this._model),(!this._cursorBlinkStateManager.value||this._cursorBlinkStateManager.value.isCursorVisible)&&this._rectangleRenderer.value.renderCursor())}_updateCursorBlink(){this._coreService.decPrivateModes.cursorBlink??this._terminal.options.cursorBlink?this._cursorBlinkStateManager.value=new gL(()=>{this._requestRedrawCursor()},this._coreBrowserService):this._cursorBlinkStateManager.clear(),this._requestRedrawCursor()}_updateModel(e,n){let r=this._core,a=this._workCell,o,g,_,c,u,d,y=0,m=!0,w,C,A,E,f,v,p,S,k;e=yb(e,r.rows-1,0),n=yb(n,r.rows-1,0);let L=this._coreService.decPrivateModes.cursorStyle??r.options.cursorStyle??"block",R=this._terminal.buffer.active.baseY+this._terminal.buffer.active.cursorY,M=R-r.buffer.ydisp,T=Math.min(this._terminal.buffer.active.cursorX,r.cols-1),I=-1,K=this._coreService.isCursorInitialized&&!this._coreService.isCursorHidden&&(!this._cursorBlinkStateManager.value||this._cursorBlinkStateManager.value.isCursorVisible);this._model.cursor=void 0;let F=!1;for(g=e;g<=n;g++)for(_=g+r.buffer.ydisp,c=r.buffer.lines.get(_),this._model.lineLengths[g]=0,A=R===_,y=0,u=this._characterJoinerService.getJoinedCharacters(_),S=0;S<r.cols;S++){if(o=this._cellColorResolver.result.bg,c.loadCell(S,a),S===0&&(o=this._cellColorResolver.result.bg),d=!1,m=S>=y,w=S,u.length>0&&S===u[0][0]&&m){C=u.shift();let G=this._model.selection.isCellSelected(this._terminal,C[0],_);for(p=C[0]+1;p<C[1];p++)m&&=G===this._model.selection.isCellSelected(this._terminal,p,_);m&&=!A||T<C[0]||T>=C[1],m?(d=!0,a=new YL(a,c.translateToString(!0,C[0],C[1]),C[1]-C[0]),w=C[1]-1):y=C[1]}if(E=a.getChars(),f=a.getCode(),p=(g*r.cols+S)*Ku,this._cellColorResolver.resolve(a,S,_,this.dimensions.device.cell.width),K&&_===R&&(S===T&&(this._model.cursor={x:T,y:M,width:a.getWidth(),style:this._coreBrowserService.isFocused?L:r.options.cursorInactiveStyle,cursorWidth:r.options.cursorWidth,dpr:this._devicePixelRatio},I=T+a.getWidth()-1),S>=T&&S<=I&&(this._coreBrowserService.isFocused&&L==="block"||this._coreBrowserService.isFocused===!1&&r.options.cursorInactiveStyle==="block")&&(this._cellColorResolver.result.fg=50331648|this._themeService.colors.cursorAccent.rgba>>8&16777215,this._cellColorResolver.result.bg=50331648|this._themeService.colors.cursor.rgba>>8&16777215)),f!==0&&(this._model.lineLengths[g]=S+1),!(this._model.cells[p]===f&&this._model.cells[p+Ou]===this._cellColorResolver.result.bg&&this._model.cells[p+Du]===this._cellColorResolver.result.fg&&this._model.cells[p+qf]===this._cellColorResolver.result.ext)&&(F=!0,E.length>1&&(f|=EL),this._model.cells[p]=f,this._model.cells[p+Ou]=this._cellColorResolver.result.bg,this._model.cells[p+Du]=this._cellColorResolver.result.fg,this._model.cells[p+qf]=this._cellColorResolver.result.ext,v=a.getWidth(),this._glyphRenderer.value.updateCell(S,g,f,this._cellColorResolver.result.bg,this._cellColorResolver.result.fg,this._cellColorResolver.result.ext,E,v,o),d)){for(a=this._workCell,S++;S<=w;S++)k=(g*r.cols+S)*Ku,this._glyphRenderer.value.updateCell(S,g,0,0,0,0,N3,0,0),this._model.cells[k]=0,this._model.cells[k+Ou]=this._cellColorResolver.result.bg,this._model.cells[k+Du]=this._cellColorResolver.result.fg,this._model.cells[k+qf]=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})}},YL=class extends Za{constructor(e,n,r){super(),this.content=0,this.combinedData="",this.fg=e.fg,this.bg=e.bg,this.combinedData=n,this._width=r}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(e){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}};function yb(e,n,r=0){return Math.max(Math.min(e,n),r)}var Sb="di$target",wb="di$dependencies",Zf=new Map;function ur(e){if(Zf.has(e))return Zf.get(e);let n=function(r,a,o){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");XL(n,r,o)};return n._id=e,Zf.set(e,n),n}function XL(e,n,r){n[Sb]===n?n[wb].push({id:e,index:r}):(n[wb]=[{id:e,index:r}],n[Sb]=n)}ur("BufferService");ur("CoreMouseService");ur("CoreService");ur("CharsetService");ur("InstantiationService");ur("LogService");var ZL=ur("OptionsService");ur("OscLinkService");ur("UnicodeService");ur("DecorationService");var JL={trace:0,debug:1,info:2,warn:3,error:4,off:5},QL="xterm.js: ",xb=class extends Zi{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=JL[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(e){for(let n=0;n<e.length;n++)typeof e[n]=="function"&&(e[n]=e[n]())}_log(e,n,r){this._evalLazyOptionalParams(r),e.call(console,(this._optionsService.options.logger?"":QL)+n,...r)}trace(e,...n){this._logLevel<=0&&this._log(this._optionsService.options.logger?.trace.bind(this._optionsService.options.logger)??console.log,e,n)}debug(e,...n){this._logLevel<=1&&this._log(this._optionsService.options.logger?.debug.bind(this._optionsService.options.logger)??console.log,e,n)}info(e,...n){this._logLevel<=2&&this._log(this._optionsService.options.logger?.info.bind(this._optionsService.options.logger)??console.info,e,n)}warn(e,...n){this._logLevel<=3&&this._log(this._optionsService.options.logger?.warn.bind(this._optionsService.options.logger)??console.warn,e,n)}error(e,...n){this._logLevel<=4&&this._log(this._optionsService.options.logger?.error.bind(this._optionsService.options.logger)??console.error,e,n)}};xb=y3([S3(0,ZL)],xb);var eM=class extends Zi{constructor(e){if(Rw&&M3()<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 r=n.coreService,a=n.optionsService,o=n,g=o._renderService,_=o._characterJoinerService,c=o._charSizeService,u=o._coreBrowserService,d=o._decorationService;o._logService;let y=o._themeService;this._renderer=this._register(new VL(e,_,c,u,r,d,a,y,this._preserveDrawingBuffer)),this._register(Ir.forward(this._renderer.onContextLoss,this._onContextLoss)),this._register(Ir.forward(this._renderer.onChangeTextureAtlas,this._onChangeTextureAtlas)),this._register(Ir.forward(this._renderer.onAddTextureAtlasCanvas,this._onAddTextureAtlasCanvas)),this._register(Ir.forward(this._renderer.onRemoveTextureAtlasCanvas,this._onRemoveTextureAtlasCanvas)),g.setRenderer(this._renderer),this._register($n(()=>{if(this._terminal._core._store._isDisposed)return;let m=this._terminal._core._renderService;m.setRenderer(this._terminal._core._createRenderer()),m.handleResize(e.cols,e.rows)}))}get textureAtlas(){return this._renderer?.textureAtlas}clearTextureAtlas(){this._renderer?.clearTextureAtlas()}},Jf={exports:{}},Cb;function tM(){return Cb||(Cb=1,(function(e,n){(function(r,a){e.exports=a()})(globalThis,(()=>(()=>{var r={4567:function(_,c,u){var d=this&&this.__decorate||function(p,S,k,L){var R,M=arguments.length,T=M<3?S:L===null?L=Object.getOwnPropertyDescriptor(S,k):L;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")T=Reflect.decorate(p,S,k,L);else for(var I=p.length-1;I>=0;I--)(R=p[I])&&(T=(M<3?R(T):M>3?R(S,k,T):R(S,k))||T);return M>3&&T&&Object.defineProperty(S,k,T),T},y=this&&this.__param||function(p,S){return function(k,L){S(k,L,p)}};Object.defineProperty(c,"__esModule",{value:!0}),c.AccessibilityManager=void 0;const m=u(9042),w=u(9924),C=u(844),A=u(4725),E=u(2585),f=u(3656);let v=c.AccessibilityManager=class extends C.Disposable{constructor(p,S,k,L){super(),this._terminal=p,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,f.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(p){for(let S=0;S<p;S++)this._handleChar(" ")}_handleChar(p){this._liveRegionLineCount<21&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==p&&(this._charsToAnnounce+=p):this._charsToAnnounce+=p,p===`
|
|
76
|
-
`&&(this._liveRegionLineCount++,this._liveRegionLineCount===21&&(this._liveRegion.textContent+=m.tooMuchOutput)))}_clearLiveRegion(){this._liveRegion.textContent="",this._liveRegionLineCount=0}_handleKey(p){this._clearLiveRegion(),new RegExp("\\p{Control}","u").test(p)||this._charsToConsume.push(p)}_refreshRows(p,S){this._liveRegionDebouncer.refresh(p,S,this._terminal.rows)}_renderRows(p,S){const k=this._terminal.buffer,L=k.lines.length.toString();for(let R=p;R<=S;R++){const M=k.lines.get(k.ydisp+R),T=[],I=M?.translateToString(!0,void 0,void 0,T)||"",K=(k.ydisp+R+1).toString(),F=this._rowElements[R];F&&(I.length===0?(F.innerText=" ",this._rowColumns.set(F,[0,1])):(F.textContent=I,this._rowColumns.set(F,T)),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(p,S){const k=p.target,L=this._rowElements[S===0?1:this._rowElements.length-2];if(k.getAttribute("aria-posinset")===(S===0?"1":`${this._terminal.buffer.lines.length}`)||p.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 T=this._createAccessibilityTreeNode();this._rowElements.unshift(T),this._rowContainer.insertAdjacentElement("afterbegin",T)}else{const T=this._createAccessibilityTreeNode();this._rowElements.push(T),this._rowContainer.appendChild(T)}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(),p.preventDefault(),p.stopImmediatePropagation()}_handleSelectionChange(){if(this._rowElements.length===0)return;const p=document.getSelection();if(!p)return;if(p.isCollapsed)return void(this._rowContainer.contains(p.anchorNode)&&this._terminal.clearSelection());if(!p.anchorNode||!p.focusNode)return void console.error("anchorNode and/or focusNode are null");let S={node:p.anchorNode,offset:p.anchorOffset},k={node:p.focusNode,offset:p.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:I,offset:K})=>{const F=I instanceof Text?I.parentNode:I;let G=parseInt(F?.getAttribute("aria-posinset"),10)-1;if(isNaN(G))return console.warn("row is invalid. Race condition?"),null;const B=this._rowColumns.get(F);if(!B)return console.warn("columns is null. Race condition?"),null;let X=K<B.length?B[K]:B.slice(-1)[0]+1;return X>=this._terminal.cols&&(++G,X=0),{row:G,column:X}},M=R(S),T=R(k);if(M&&T){if(M.row>T.row||M.row===T.row&&M.column>=T.column)throw new Error("invalid range");this._terminal.select(M.column,M.row,(T.row-M.row)*this._terminal.cols-M.column+T.column)}}_handleResize(p){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>p;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){const p=this._coreBrowserService.mainDocument.createElement("div");return p.setAttribute("role","listitem"),p.tabIndex=-1,this._refreshRowDimensions(p),p}_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 p=0;p<this._terminal.rows;p++)this._refreshRowDimensions(this._rowElements[p])}}_refreshRowDimensions(p){p.style.height=`${this._renderService.dimensions.css.cell.height}px`}};c.AccessibilityManager=v=d([y(1,E.IInstantiationService),y(2,A.ICoreBrowserService),y(3,A.IRenderService)],v)},3614:(_,c)=>{function u(w){return w.replace(/\r?\n/g,"\r")}function d(w,C){return C?"\x1B[200~"+w+"\x1B[201~":w}function y(w,C,A,E){w=d(w=u(w),A.decPrivateModes.bracketedPasteMode&&E.rawOptions.ignoreBracketedPasteMode!==!0),A.triggerDataEvent(w,!0),C.value=""}function m(w,C,A){const E=A.getBoundingClientRect(),f=w.clientX-E.left-10,v=w.clientY-E.top-10;C.style.width="20px",C.style.height="20px",C.style.left=`${f}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=u,c.bracketTextForPaste=d,c.copyHandler=function(w,C){w.clipboardData&&w.clipboardData.setData("text/plain",C.selectionText),w.preventDefault()},c.handlePasteEvent=function(w,C,A,E){w.stopPropagation(),w.clipboardData&&y(w.clipboardData.getData("text/plain"),C,A,E)},c.paste=y,c.moveTextAreaUnderMouseCursor=m,c.rightClickHandler=function(w,C,A,E,f){m(w,C,A),f&&E.rightClickSelect(w),C.value=E.selectionText,C.select()}},7239:(_,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.ColorContrastCache=void 0;const d=u(1505);c.ColorContrastCache=class{constructor(){this._color=new d.TwoKeyMap,this._css=new d.TwoKeyMap}setCss(y,m,w){this._css.set(y,m,w)}getCss(y,m){return this._css.get(y,m)}setColor(y,m,w){this._color.set(y,m,w)}getColor(y,m){return this._color.get(y,m)}clear(){this._color.clear(),this._css.clear()}}},3656:(_,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.addDisposableDomListener=void 0,c.addDisposableDomListener=function(u,d,y,m){u.addEventListener(d,y,m);let w=!1;return{dispose:()=>{w||(w=!0,u.removeEventListener(d,y,m))}}}},3551:function(_,c,u){var d=this&&this.__decorate||function(v,p,S,k){var L,R=arguments.length,M=R<3?p:k===null?k=Object.getOwnPropertyDescriptor(p,S):k;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")M=Reflect.decorate(v,p,S,k);else for(var T=v.length-1;T>=0;T--)(L=v[T])&&(M=(R<3?L(M):R>3?L(p,S,M):L(p,S))||M);return R>3&&M&&Object.defineProperty(p,S,M),M},y=this&&this.__param||function(v,p){return function(S,k){p(S,k,v)}};Object.defineProperty(c,"__esModule",{value:!0}),c.Linkifier=void 0;const m=u(3656),w=u(8460),C=u(844),A=u(2585),E=u(4725);let f=c.Linkifier=class extends C.Disposable{get currentLink(){return this._currentLink}constructor(v,p,S,k,L){super(),this._element=v,this._mouseService=p,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,m.addDisposableDomListener)(this._element,"mouseleave",(()=>{this._isMouseOut=!0,this._clearCurrentLink()}))),this.register((0,m.addDisposableDomListener)(this._element,"mousemove",this._handleMouseMove.bind(this))),this.register((0,m.addDisposableDomListener)(this._element,"mousedown",this._handleMouseDown.bind(this))),this.register((0,m.addDisposableDomListener)(this._element,"mouseup",this._handleMouseUp.bind(this)))}_handleMouseMove(v){this._lastMouseEvent=v;const p=this._positionFromMouseEvent(v,this._element,this._mouseService);if(!p)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&&p.x===this._lastBufferCell.x&&p.y===this._lastBufferCell.y||(this._handleHover(p),this._lastBufferCell=p)}_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,p){this._activeProviderReplies&&p||(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())p?this._activeProviderReplies?.get(k)&&(S=this._checkLinkProviderResult(k,v,S)):L.provideLinks(v.y,(R=>{if(this._isMouseOut)return;const M=R?.map((T=>({link:T})));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,p){const S=new Set;for(let k=0;k<p.size;k++){const L=p.get(k);if(L)for(let R=0;R<L.length;R++){const M=L[R],T=M.link.range.start.y<v?0:M.link.range.start.x,I=M.link.range.end.y>v?this._bufferService.cols:M.link.range.end.x;for(let K=T;K<=I;K++){if(S.has(K)){L.splice(R--,1);break}S.add(K)}}}}_checkLinkProviderResult(v,p,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,p)));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((T=>this._linkAtPosition(T.link,p)));if(M){S=!0,this._handleNewLink(M);break}}return S}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(v){if(!this._currentLink)return;const p=this._positionFromMouseEvent(v,this._element,this._mouseService);p&&this._mouseDownLink===this._currentLink&&this._linkAtPosition(this._currentLink.link,p)&&this._currentLink.link.activate(v,this._currentLink.link.text)}_clearCurrentLink(v,p){this._currentLink&&this._lastMouseEvent&&(!v||!p||this._currentLink.link.range.start.y>=v&&this._currentLink.link.range.end.y<=p)&&(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 p=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);p&&this._linkAtPosition(v.link,p)&&(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,p,S){this._currentLink?.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(p,!0),this._currentLink.state.decorations.pointerCursor&&v.classList.add("xterm-cursor-pointer")),p.hover&&p.hover(S,p.text)}_fireUnderlineEvent(v,p){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);(p?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(L)}_linkLeave(v,p,S){this._currentLink?.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(p,!1),this._currentLink.state.decorations.pointerCursor&&v.classList.remove("xterm-cursor-pointer")),p.leave&&p.leave(S,p.text)}_linkAtPosition(v,p){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=p.y*this._bufferService.cols+p.x;return S<=L&&L<=k}_positionFromMouseEvent(v,p,S){const k=S.getCoords(v,p,this._bufferService.cols,this._bufferService.rows);if(k)return{x:k[0],y:k[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(v,p,S,k,L){return{x1:v,y1:p,x2:S,y2:k,cols:this._bufferService.cols,fg:L}}};c.Linkifier=f=d([y(1,E.IMouseService),y(2,E.IRenderService),y(3,A.IBufferService),y(4,E.ILinkProviderService)],f)},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,u){var d=this&&this.__decorate||function(E,f,v,p){var S,k=arguments.length,L=k<3?f:p===null?p=Object.getOwnPropertyDescriptor(f,v):p;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")L=Reflect.decorate(E,f,v,p);else for(var R=E.length-1;R>=0;R--)(S=E[R])&&(L=(k<3?S(L):k>3?S(f,v,L):S(f,v))||L);return k>3&&L&&Object.defineProperty(f,v,L),L},y=this&&this.__param||function(E,f){return function(v,p){f(v,p,E)}};Object.defineProperty(c,"__esModule",{value:!0}),c.OscLinkProvider=void 0;const m=u(511),w=u(2585);let C=c.OscLinkProvider=class{constructor(E,f,v){this._bufferService=E,this._optionsService=f,this._oscLinkService=v}provideLinks(E,f){const v=this._bufferService.buffer.lines.get(E-1);if(!v)return void f(void 0);const p=[],S=this._optionsService.rawOptions.linkHandler,k=new m.CellData,L=v.getTrimmedLength();let R=-1,M=-1,T=!1;for(let I=0;I<L;I++)if(M!==-1||v.hasContent(I)){if(v.loadCell(I,k),k.hasExtendedAttrs()&&k.extended.urlId){if(M===-1){M=I,R=k.extended.urlId;continue}T=k.extended.urlId!==R}else M!==-1&&(T=!0);if(T||M!==-1&&I===L-1){const K=this._oscLinkService.getLinkData(R)?.uri;if(K){const F={start:{x:M+1,y:E},end:{x:I+(T||I!==L-1?0:1),y:E}};let G=!1;if(!S?.allowNonHttpProtocols)try{const B=new URL(K);["http:","https:"].includes(B.protocol)||(G=!0)}catch{G=!0}G||p.push({text:K,range:F,activate:(B,X)=>S?S.activate(B,X,F):A(0,X),hover:(B,X)=>S?.hover?.(B,X,F),leave:(B,X)=>S?.leave?.(B,X,F)})}T=!1,k.hasExtendedAttrs()&&k.extended.urlId?(M=I,R=k.extended.urlId):(M=-1,R=-1)}}f(p)}};function A(E,f){if(confirm(`Do you want to navigate to ${f}?
|
|
77
|
-
|
|
78
|
-
WARNING: This link could potentially be dangerous`)){const v=window.open();if(v){try{v.opener=null}catch{}v.location.href=f}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(u,d){this._renderCallback=u,this._coreBrowserService=d,this._refreshCallbacks=[]}dispose(){this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}addRefreshCallback(u){return this._refreshCallbacks.push(u),this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._innerRefresh()))),this._animationFrame}refresh(u,d,y){this._rowCount=y,u=u!==void 0?u:0,d=d!==void 0?d:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,u):u,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,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 u=Math.max(this._rowStart,0),d=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(u,d),this._runRefreshCallbacks()}_runRefreshCallbacks(){for(const u of this._refreshCallbacks)u(0);this._refreshCallbacks=[]}}},3236:(_,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.Terminal=void 0;const d=u(3614),y=u(3656),m=u(3551),w=u(9042),C=u(3730),A=u(1680),E=u(3107),f=u(5744),v=u(2950),p=u(1296),S=u(428),k=u(4269),L=u(5114),R=u(8934),M=u(3230),T=u(9312),I=u(4725),K=u(6731),F=u(8055),G=u(8969),B=u(8460),X=u(844),Y=u(6114),z=u(8437),q=u(2584),V=u(7399),D=u(5941),H=u(9074),O=u(2585),P=u(5435),W=u(4567),Z=u(779);class ie extends G.CoreTerminal{get onFocus(){return this._onFocus.event}get onBlur(){return this._onBlur.event}get onA11yChar(){return this._onA11yCharEmitter.event}get onA11yTab(){return this._onA11yTabEmitter.event}get onWillOpen(){return this._onWillOpen.event}constructor(te={}){super(te),this.browser=Y,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this.register(new X.MutableDisposable),this._onCursorMove=this.register(new B.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onKey=this.register(new B.EventEmitter),this.onKey=this._onKey.event,this._onRender=this.register(new B.EventEmitter),this.onRender=this._onRender.event,this._onSelectionChange=this.register(new B.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onTitleChange=this.register(new B.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onBell=this.register(new B.EventEmitter),this.onBell=this._onBell.event,this._onFocus=this.register(new B.EventEmitter),this._onBlur=this.register(new B.EventEmitter),this._onA11yCharEmitter=this.register(new B.EventEmitter),this._onA11yTabEmitter=this.register(new B.EventEmitter),this._onWillOpen=this.register(new B.EventEmitter),this._setup(),this._decorationService=this._instantiationService.createInstance(H.DecorationService),this._instantiationService.setService(O.IDecorationService,this._decorationService),this._linkProviderService=this._instantiationService.createInstance(Z.LinkProviderService),this._instantiationService.setService(I.ILinkProviderService,this._linkProviderService),this._linkProviderService.registerLinkProvider(this._instantiationService.createInstance(C.OscLinkProvider)),this.register(this._inputHandler.onRequestBell((()=>this._onBell.fire()))),this.register(this._inputHandler.onRequestRefreshRows((($,le)=>this.refresh($,le)))),this.register(this._inputHandler.onRequestSendFocus((()=>this._reportFocus()))),this.register(this._inputHandler.onRequestReset((()=>this.reset()))),this.register(this._inputHandler.onRequestWindowsOptionsReport(($=>this._reportWindowsOptions($)))),this.register(this._inputHandler.onColor(($=>this._handleColorEvent($)))),this.register((0,B.forwardEvent)(this._inputHandler.onCursorMove,this._onCursorMove)),this.register((0,B.forwardEvent)(this._inputHandler.onTitleChange,this._onTitleChange)),this.register((0,B.forwardEvent)(this._inputHandler.onA11yChar,this._onA11yCharEmitter)),this.register((0,B.forwardEvent)(this._inputHandler.onA11yTab,this._onA11yTabEmitter)),this.register(this._bufferService.onResize(($=>this._afterResize($.cols,$.rows)))),this.register((0,X.toDisposable)((()=>{this._customKeyEventHandler=void 0,this.element?.parentNode?.removeChild(this.element)})))}_handleColorEvent(te){if(this._themeService)for(const $ of te){let le,ge="";switch($.index){case 256:le="foreground",ge="10";break;case 257:le="background",ge="11";break;case 258:le="cursor",ge="12";break;default:le="ansi",ge="4;"+$.index}switch($.type){case 0:const we=F.color.toColorRGB(le==="ansi"?this._themeService.colors.ansi[$.index]:this._themeService.colors[le]);this.coreService.triggerDataEvent(`${q.C0.ESC}]${ge};${(0,D.toRgbString)(we)}${q.C1_ESCAPED.ST}`);break;case 1:if(le==="ansi")this._themeService.modifyColors((Se=>Se.ansi[$.index]=F.channels.toColor(...$.color)));else{const Se=le;this._themeService.modifyColors((je=>je[Se]=F.channels.toColor(...$.color)))}break;case 2:this._themeService.restoreColor($.index)}}}_setup(){super._setup(),this._customKeyEventHandler=void 0}get buffer(){return this.buffers.active}focus(){this.textarea&&this.textarea.focus({preventScroll:!0})}_handleScreenReaderModeOptionChange(te){te?!this._accessibilityManager.value&&this._renderService&&(this._accessibilityManager.value=this._instantiationService.createInstance(W.AccessibilityManager,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(te){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 te=this.buffer.ybase+this.buffer.y,$=this.buffer.lines.get(te);if(!$)return;const le=Math.min(this.buffer.x,this.cols-1),ge=this._renderService.dimensions.css.cell.height,we=$.getWidth(le),Se=this._renderService.dimensions.css.cell.width*we,je=this.buffer.y*this._renderService.dimensions.css.cell.height,Ie=le*this._renderService.dimensions.css.cell.width;this.textarea.style.left=Ie+"px",this.textarea.style.top=je+"px",this.textarea.style.width=Se+"px",this.textarea.style.height=ge+"px",this.textarea.style.lineHeight=ge+"px",this.textarea.style.zIndex="-5"}_initGlobal(){this._bindKeys(),this.register((0,y.addDisposableDomListener)(this.element,"copy",($=>{this.hasSelection()&&(0,d.copyHandler)($,this._selectionService)})));const te=$=>(0,d.handlePasteEvent)($,this.textarea,this.coreService,this.optionsService);this.register((0,y.addDisposableDomListener)(this.textarea,"paste",te)),this.register((0,y.addDisposableDomListener)(this.element,"paste",te)),Y.isFirefox?this.register((0,y.addDisposableDomListener)(this.element,"mousedown",($=>{$.button===2&&(0,d.rightClickHandler)($,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))):this.register((0,y.addDisposableDomListener)(this.element,"contextmenu",($=>{(0,d.rightClickHandler)($,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))),Y.isLinux&&this.register((0,y.addDisposableDomListener)(this.element,"auxclick",($=>{$.button===1&&(0,d.moveTextAreaUnderMouseCursor)($,this.textarea,this.screenElement)})))}_bindKeys(){this.register((0,y.addDisposableDomListener)(this.textarea,"keyup",(te=>this._keyUp(te)),!0)),this.register((0,y.addDisposableDomListener)(this.textarea,"keydown",(te=>this._keyDown(te)),!0)),this.register((0,y.addDisposableDomListener)(this.textarea,"keypress",(te=>this._keyPress(te)),!0)),this.register((0,y.addDisposableDomListener)(this.textarea,"compositionstart",(()=>this._compositionHelper.compositionstart()))),this.register((0,y.addDisposableDomListener)(this.textarea,"compositionupdate",(te=>this._compositionHelper.compositionupdate(te)))),this.register((0,y.addDisposableDomListener)(this.textarea,"compositionend",(()=>this._compositionHelper.compositionend()))),this.register((0,y.addDisposableDomListener)(this.textarea,"input",(te=>this._inputEvent(te)),!0)),this.register(this.onRender((()=>this._compositionHelper.updateCompositionElements())))}open(te){if(!te)throw new Error("Terminal requires a parent element.");if(te.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=te.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"),te.appendChild(this.element);const $=this._document.createDocumentFragment();this._viewportElement=this._document.createElement("div"),this._viewportElement.classList.add("xterm-viewport"),$.appendChild(this._viewportElement),this._viewportScrollArea=this._document.createElement("div"),this._viewportScrollArea.classList.add("xterm-scroll-area"),this._viewportElement.appendChild(this._viewportScrollArea),this.screenElement=this._document.createElement("div"),this.screenElement.classList.add("xterm-screen"),this.register((0,y.addDisposableDomListener)(this.screenElement,"mousemove",(le=>this.updateCursorStyle(le)))),this._helperContainer=this._document.createElement("div"),this._helperContainer.classList.add("xterm-helpers"),this.screenElement.appendChild(this._helperContainer),$.appendChild(this.screenElement),this.textarea=this._document.createElement("textarea"),this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",w.promptLabel),Y.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,te.ownerDocument.defaultView??window,this._document??typeof window<"u"?window.document:null)),this._instantiationService.setService(I.ICoreBrowserService,this._coreBrowserService),this.register((0,y.addDisposableDomListener)(this.textarea,"focus",(le=>this._handleTextAreaFocus(le)))),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(I.ICharSizeService,this._charSizeService),this._themeService=this._instantiationService.createInstance(K.ThemeService),this._instantiationService.setService(I.IThemeService,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(k.CharacterJoinerService),this._instantiationService.setService(I.ICharacterJoinerService,this._characterJoinerService),this._renderService=this.register(this._instantiationService.createInstance(M.RenderService,this.rows,this.screenElement)),this._instantiationService.setService(I.IRenderService,this._renderService),this.register(this._renderService.onRenderedViewportChange((le=>this._onRender.fire(le)))),this.onResize((le=>this._renderService.resize(le.cols,le.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(I.IMouseService,this._mouseService),this.linkifier=this.register(this._instantiationService.createInstance(m.Linkifier,this.screenElement)),this.element.appendChild($);try{this._onWillOpen.fire(this.element)}catch{}this._renderService.hasRenderer()||this._renderService.setRenderer(this._createRenderer()),this.viewport=this._instantiationService.createInstance(A.Viewport,this._viewportElement,this._viewportScrollArea),this.viewport.onRequestScrollLines((le=>this.scrollLines(le.amount,le.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(T.SelectionService,this.element,this.screenElement,this.linkifier)),this._instantiationService.setService(I.ISelectionService,this._selectionService),this.register(this._selectionService.onRequestScrollLines((le=>this.scrollLines(le.amount,le.suppressScrollEvent)))),this.register(this._selectionService.onSelectionChange((()=>this._onSelectionChange.fire()))),this.register(this._selectionService.onRequestRedraw((le=>this._renderService.handleSelectionChanged(le.start,le.end,le.columnSelectMode)))),this.register(this._selectionService.onLinuxMouseSelection((le=>{this.textarea.value=le,this.textarea.focus(),this.textarea.select()}))),this.register(this._onScroll.event((le=>{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",(le=>this._selectionService.handleMouseDown(le)))),this.coreMouseService.areMouseEventsActive?(this._selectionService.disable(),this.element.classList.add("enable-mouse-events")):this._selectionService.enable(),this.options.screenReaderMode&&(this._accessibilityManager.value=this._instantiationService.createInstance(W.AccessibilityManager,this)),this.register(this.optionsService.onSpecificOptionChange("screenReaderMode",(le=>this._handleScreenReaderModeOptionChange(le)))),this.options.overviewRulerWidth&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(f.OverviewRulerRenderer,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRulerWidth",(le=>{!this._overviewRulerRenderer&&le&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(f.OverviewRulerRenderer,this._viewportElement,this.screenElement)))})),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()}_createRenderer(){return this._instantiationService.createInstance(p.DomRenderer,this,this._document,this.element,this.screenElement,this._viewportElement,this._helperContainer,this.linkifier)}bindMouse(){const te=this,$=this.element;function le(Se){const je=te._mouseService.getMouseReportCoords(Se,te.screenElement);if(!je)return!1;let Ie,Ge;switch(Se.overrideType||Se.type){case"mousemove":Ge=32,Se.buttons===void 0?(Ie=3,Se.button!==void 0&&(Ie=Se.button<3?Se.button:3)):Ie=1&Se.buttons?0:4&Se.buttons?1:2&Se.buttons?2:3;break;case"mouseup":Ge=0,Ie=Se.button<3?Se.button:3;break;case"mousedown":Ge=1,Ie=Se.button<3?Se.button:3;break;case"wheel":if(te._customWheelEventHandler&&te._customWheelEventHandler(Se)===!1||te.viewport.getLinesScrolled(Se)===0)return!1;Ge=Se.deltaY<0?0:1,Ie=4;break;default:return!1}return!(Ge===void 0||Ie===void 0||Ie>4)&&te.coreMouseService.triggerMouseEvent({col:je.col,row:je.row,x:je.x,y:je.y,button:Ie,action:Ge,ctrl:Se.ctrlKey,alt:Se.altKey,shift:Se.shiftKey})}const ge={mouseup:null,wheel:null,mousedrag:null,mousemove:null},we={mouseup:Se=>(le(Se),Se.buttons||(this._document.removeEventListener("mouseup",ge.mouseup),ge.mousedrag&&this._document.removeEventListener("mousemove",ge.mousedrag)),this.cancel(Se)),wheel:Se=>(le(Se),this.cancel(Se,!0)),mousedrag:Se=>{Se.buttons&&le(Se)},mousemove:Se=>{Se.buttons||le(Se)}};this.register(this.coreMouseService.onProtocolChange((Se=>{Se?(this.optionsService.rawOptions.logLevel==="debug"&&this._logService.debug("Binding to mouse events:",this.coreMouseService.explainEvents(Se)),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&Se?ge.mousemove||($.addEventListener("mousemove",we.mousemove),ge.mousemove=we.mousemove):($.removeEventListener("mousemove",ge.mousemove),ge.mousemove=null),16&Se?ge.wheel||($.addEventListener("wheel",we.wheel,{passive:!1}),ge.wheel=we.wheel):($.removeEventListener("wheel",ge.wheel),ge.wheel=null),2&Se?ge.mouseup||(ge.mouseup=we.mouseup):(this._document.removeEventListener("mouseup",ge.mouseup),ge.mouseup=null),4&Se?ge.mousedrag||(ge.mousedrag=we.mousedrag):(this._document.removeEventListener("mousemove",ge.mousedrag),ge.mousedrag=null)}))),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this.register((0,y.addDisposableDomListener)($,"mousedown",(Se=>{if(Se.preventDefault(),this.focus(),this.coreMouseService.areMouseEventsActive&&!this._selectionService.shouldForceSelection(Se))return le(Se),ge.mouseup&&this._document.addEventListener("mouseup",ge.mouseup),ge.mousedrag&&this._document.addEventListener("mousemove",ge.mousedrag),this.cancel(Se)}))),this.register((0,y.addDisposableDomListener)($,"wheel",(Se=>{if(!ge.wheel){if(this._customWheelEventHandler&&this._customWheelEventHandler(Se)===!1)return!1;if(!this.buffer.hasScrollback){const je=this.viewport.getLinesScrolled(Se);if(je===0)return;const Ie=q.C0.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(Se.deltaY<0?"A":"B");let Ge="";for(let vt=0;vt<Math.abs(je);vt++)Ge+=Ie;return this.coreService.triggerDataEvent(Ge,!0),this.cancel(Se,!0)}return this.viewport.handleWheel(Se)?this.cancel(Se):void 0}}),{passive:!1})),this.register((0,y.addDisposableDomListener)($,"touchstart",(Se=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchStart(Se),this.cancel(Se)}),{passive:!0})),this.register((0,y.addDisposableDomListener)($,"touchmove",(Se=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchMove(Se)?void 0:this.cancel(Se)}),{passive:!1}))}refresh(te,$){this._renderService?.refreshRows(te,$)}updateCursorStyle(te){this._selectionService?.shouldColumnSelect(te)?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(te,$,le=0){le===1?(super.scrollLines(te,$,le),this.refresh(0,this.rows-1)):this.viewport?.scrollLines(te)}paste(te){(0,d.paste)(te,this.textarea,this.coreService,this.optionsService)}attachCustomKeyEventHandler(te){this._customKeyEventHandler=te}attachCustomWheelEventHandler(te){this._customWheelEventHandler=te}registerLinkProvider(te){return this._linkProviderService.registerLinkProvider(te)}registerCharacterJoiner(te){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");const $=this._characterJoinerService.register(te);return this.refresh(0,this.rows-1),$}deregisterCharacterJoiner(te){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");this._characterJoinerService.deregister(te)&&this.refresh(0,this.rows-1)}get markers(){return this.buffer.markers}registerMarker(te){return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+te)}registerDecoration(te){return this._decorationService.registerDecoration(te)}hasSelection(){return!!this._selectionService&&this._selectionService.hasSelection}select(te,$,le){this._selectionService.setSelection(te,$,le)}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(te,$){this._selectionService?.selectLines(te,$)}_keyDown(te){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&this._customKeyEventHandler(te)===!1)return!1;const $=this.browser.isMac&&this.options.macOptionIsMeta&&te.altKey;if(!$&&!this._compositionHelper.keydown(te))return this.options.scrollOnUserInput&&this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(),!1;$||te.key!=="Dead"&&te.key!=="AltGraph"||(this._unprocessedDeadKey=!0);const le=(0,V.evaluateKeyboardEvent)(te,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(te),le.type===3||le.type===2){const ge=this.rows-1;return this.scrollLines(le.type===2?-ge:ge),this.cancel(te,!0)}return le.type===1&&this.selectAll(),!!this._isThirdLevelShift(this.browser,te)||(le.cancel&&this.cancel(te,!0),!le.key||!!(te.key&&!te.ctrlKey&&!te.altKey&&!te.metaKey&&te.key.length===1&&te.key.charCodeAt(0)>=65&&te.key.charCodeAt(0)<=90)||(this._unprocessedDeadKey?(this._unprocessedDeadKey=!1,!0):(le.key!==q.C0.ETX&&le.key!==q.C0.CR||(this.textarea.value=""),this._onKey.fire({key:le.key,domEvent:te}),this._showCursor(),this.coreService.triggerDataEvent(le.key,!0),!this.optionsService.rawOptions.screenReaderMode||te.altKey||te.ctrlKey?this.cancel(te,!0):void(this._keyDownHandled=!0))))}_isThirdLevelShift(te,$){const le=te.isMac&&!this.options.macOptionIsMeta&&$.altKey&&!$.ctrlKey&&!$.metaKey||te.isWindows&&$.altKey&&$.ctrlKey&&!$.metaKey||te.isWindows&&$.getModifierState("AltGraph");return $.type==="keypress"?le:le&&(!$.keyCode||$.keyCode>47)}_keyUp(te){this._keyDownSeen=!1,this._customKeyEventHandler&&this._customKeyEventHandler(te)===!1||((function($){return $.keyCode===16||$.keyCode===17||$.keyCode===18})(te)||this.focus(),this.updateCursorStyle(te),this._keyPressHandled=!1)}_keyPress(te){let $;if(this._keyPressHandled=!1,this._keyDownHandled||this._customKeyEventHandler&&this._customKeyEventHandler(te)===!1)return!1;if(this.cancel(te),te.charCode)$=te.charCode;else if(te.which===null||te.which===void 0)$=te.keyCode;else{if(te.which===0||te.charCode===0)return!1;$=te.which}return!(!$||(te.altKey||te.ctrlKey||te.metaKey)&&!this._isThirdLevelShift(this.browser,te)||($=String.fromCharCode($),this._onKey.fire({key:$,domEvent:te}),this._showCursor(),this.coreService.triggerDataEvent($,!0),this._keyPressHandled=!0,this._unprocessedDeadKey=!1,0))}_inputEvent(te){if(te.data&&te.inputType==="insertText"&&(!te.composed||!this._keyDownSeen)&&!this.optionsService.rawOptions.screenReaderMode){if(this._keyPressHandled)return!1;this._unprocessedDeadKey=!1;const $=te.data;return this.coreService.triggerDataEvent($,!0),this.cancel(te),!0}return!1}resize(te,$){te!==this.cols||$!==this.rows?super.resize(te,$):this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure()}_afterResize(te,$){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 te=1;te<this.rows;te++)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 te=this._customKeyEventHandler;this._setup(),super.reset(),this._selectionService?.reset(),this._decorationService.reset(),this.viewport?.reset(),this._customKeyEventHandler=te,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(te){if(this._renderService)switch(te){case P.WindowsOptionsReportType.GET_WIN_SIZE_PIXELS:const $=this._renderService.dimensions.css.canvas.width.toFixed(0),le=this._renderService.dimensions.css.canvas.height.toFixed(0);this.coreService.triggerDataEvent(`${q.C0.ESC}[4;${le};${$}t`);break;case P.WindowsOptionsReportType.GET_CELL_SIZE_PIXELS:const ge=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};${ge}t`)}}cancel(te,$){if(this.options.cancelEvents||$)return te.preventDefault(),te.stopPropagation(),!1}}c.Terminal=ie},9924:(_,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.TimeBasedDebouncer=void 0,c.TimeBasedDebouncer=class{constructor(u,d=1e3){this._renderCallback=u,this._debounceThresholdMS=d,this._lastRefreshMs=0,this._additionalRefreshRequested=!1}dispose(){this._refreshTimeoutID&&clearTimeout(this._refreshTimeoutID)}refresh(u,d,y){this._rowCount=y,u=u!==void 0?u:0,d=d!==void 0?d:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,u):u,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,d):d;const m=Date.now();if(m-this._lastRefreshMs>=this._debounceThresholdMS)this._lastRefreshMs=m,this._innerRefresh();else if(!this._additionalRefreshRequested){const w=m-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 u=Math.max(this._rowStart,0),d=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(u,d)}}},1680:function(_,c,u){var d=this&&this.__decorate||function(v,p,S,k){var L,R=arguments.length,M=R<3?p:k===null?k=Object.getOwnPropertyDescriptor(p,S):k;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")M=Reflect.decorate(v,p,S,k);else for(var T=v.length-1;T>=0;T--)(L=v[T])&&(M=(R<3?L(M):R>3?L(p,S,M):L(p,S))||M);return R>3&&M&&Object.defineProperty(p,S,M),M},y=this&&this.__param||function(v,p){return function(S,k){p(S,k,v)}};Object.defineProperty(c,"__esModule",{value:!0}),c.Viewport=void 0;const m=u(3656),w=u(4725),C=u(8460),A=u(844),E=u(2585);let f=c.Viewport=class extends A.Disposable{constructor(v,p,S,k,L,R,M,T){super(),this._viewportElement=v,this._scrollArea=p,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,m.addDisposableDomListener)(this._viewportElement,"scroll",this._handleScroll.bind(this))),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate((I=>this._activeBuffer=I.activeBuffer))),this._renderDimensions=this._renderService.dimensions,this.register(this._renderService.onDimensionsChange((I=>this._renderDimensions=I))),this._handleThemeChange(T.colors),this.register(T.onChangeColors((I=>this._handleThemeChange(I)))),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 p=Math.round(this._currentRowHeight*this._lastRecordedBufferLength)+(this._lastRecordedViewportHeight-this._renderDimensions.css.canvas.height);this._lastRecordedBufferHeight!==p&&(this._lastRecordedBufferHeight=p,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 p=Math.round(this._lastScrollTop/this._currentRowHeight)-this._bufferService.buffer.ydisp;this._onRequestScrollLines.fire({amount:p,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,p){const S=this._viewportElement.scrollTop+this._lastRecordedViewportHeight;return!(p<0&&this._viewportElement.scrollTop!==0||p>0&&S<this._lastRecordedBufferHeight)||(v.cancelable&&v.preventDefault(),!1)}handleWheel(v){const p=this._getPixelsScrolled(v);return p!==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+p:this._smoothScrollState.target+=p,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()):this._viewportElement.scrollTop+=p,this._bubbleScroll(v,p))}scrollLines(v){if(v!==0)if(this._optionsService.rawOptions.smoothScrollDuration){const p=v*this._currentRowHeight;this._smoothScrollState.startTime=Date.now(),this._smoothScrollPercent()<1?(this._smoothScrollState.origin=this._viewportElement.scrollTop,this._smoothScrollState.target=this._smoothScrollState.origin+p,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 p=this._applyScrollModifier(v.deltaY,v);return v.deltaMode===WheelEvent.DOM_DELTA_LINE?p*=this._currentRowHeight:v.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(p*=this._currentRowHeight*this._bufferService.rows),p}getBufferElements(v,p){let S,k="";const L=[],R=p??this._bufferService.buffer.lines.length,M=this._bufferService.buffer.lines;for(let T=v;T<R;T++){const I=M.get(T);if(!I)continue;const K=M.get(T+1)?.isWrapped;if(k+=I.translateToString(!K),!K||T===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 p=this._applyScrollModifier(v.deltaY,v);return v.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(p/=this._currentRowHeight+0,this._wheelPartialScroll+=p,p=Math.floor(Math.abs(this._wheelPartialScroll))*(this._wheelPartialScroll>0?1:-1),this._wheelPartialScroll%=1):v.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(p*=this._bufferService.rows),p}_applyScrollModifier(v,p){const S=this._optionsService.rawOptions.fastScrollModifier;return S==="alt"&&p.altKey||S==="ctrl"&&p.ctrlKey||S==="shift"&&p.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 p=this._lastTouchY-v.touches[0].pageY;return this._lastTouchY=v.touches[0].pageY,p!==0&&(this._viewportElement.scrollTop+=p,this._bubbleScroll(v,p))}};c.Viewport=f=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)],f)},3107:function(_,c,u){var d=this&&this.__decorate||function(E,f,v,p){var S,k=arguments.length,L=k<3?f:p===null?p=Object.getOwnPropertyDescriptor(f,v):p;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")L=Reflect.decorate(E,f,v,p);else for(var R=E.length-1;R>=0;R--)(S=E[R])&&(L=(k<3?S(L):k>3?S(f,v,L):S(f,v))||L);return k>3&&L&&Object.defineProperty(f,v,L),L},y=this&&this.__param||function(E,f){return function(v,p){f(v,p,E)}};Object.defineProperty(c,"__esModule",{value:!0}),c.BufferDecorationRenderer=void 0;const m=u(4725),w=u(844),C=u(2585);let A=c.BufferDecorationRenderer=class extends w.Disposable{constructor(E,f,v,p,S){super(),this._screenElement=E,this._bufferService=f,this._coreBrowserService=v,this._decorationService=p,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 f=this._coreBrowserService.mainDocument.createElement("div");f.classList.add("xterm-decoration"),f.classList.toggle("xterm-decoration-top-layer",E?.options?.layer==="top"),f.style.width=`${Math.round((E.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,f.style.height=(E.options.height||1)*this._renderService.dimensions.css.cell.height+"px",f.style.top=(E.marker.line-this._bufferService.buffers.active.ydisp)*this._renderService.dimensions.css.cell.height+"px",f.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`;const v=E.options.x??0;return v&&v>this._bufferService.cols&&(f.style.display="none"),this._refreshXPosition(E,f),f}_refreshStyle(E){const f=E.marker.line-this._bufferService.buffers.active.ydisp;if(f<0||f>=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=f*this._renderService.dimensions.css.cell.height+"px",v.style.display=this._altBufferIsActive?"none":"block",E.onRenderEmitter.fire(v)}}_refreshXPosition(E,f=E.element){if(!f)return;const v=E.options.x??0;(E.options.anchor||"left")==="right"?f.style.right=v?v*this._renderService.dimensions.css.cell.width+"px":"":f.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=A=d([y(1,C.IBufferService),y(2,m.ICoreBrowserService),y(3,C.IDecorationService),y(4,m.IRenderService)],A)},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(u){if(u.options.overviewRulerOptions){for(const d of this._zones)if(d.color===u.options.overviewRulerOptions.color&&d.position===u.options.overviewRulerOptions.position){if(this._lineIntersectsZone(d,u.marker.line))return;if(this._lineAdjacentToZone(d,u.marker.line,u.options.overviewRulerOptions.position))return void this._addLineToZone(d,u.marker.line)}if(this._zonePoolIndex<this._zonePool.length)return this._zonePool[this._zonePoolIndex].color=u.options.overviewRulerOptions.color,this._zonePool[this._zonePoolIndex].position=u.options.overviewRulerOptions.position,this._zonePool[this._zonePoolIndex].startBufferLine=u.marker.line,this._zonePool[this._zonePoolIndex].endBufferLine=u.marker.line,void this._zones.push(this._zonePool[this._zonePoolIndex++]);this._zones.push({color:u.options.overviewRulerOptions.color,position:u.options.overviewRulerOptions.position,startBufferLine:u.marker.line,endBufferLine:u.marker.line}),this._zonePool.push(this._zones[this._zones.length-1]),this._zonePoolIndex++}}setPadding(u){this._linePadding=u}_lineIntersectsZone(u,d){return d>=u.startBufferLine&&d<=u.endBufferLine}_lineAdjacentToZone(u,d,y){return d>=u.startBufferLine-this._linePadding[y||"full"]&&d<=u.endBufferLine+this._linePadding[y||"full"]}_addLineToZone(u,d){u.startBufferLine=Math.min(u.startBufferLine,d),u.endBufferLine=Math.max(u.endBufferLine,d)}}},5744:function(_,c,u){var d=this&&this.__decorate||function(S,k,L,R){var M,T=arguments.length,I=T<3?k:R===null?R=Object.getOwnPropertyDescriptor(k,L):R;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")I=Reflect.decorate(S,k,L,R);else for(var K=S.length-1;K>=0;K--)(M=S[K])&&(I=(T<3?M(I):T>3?M(k,L,I):M(k,L))||I);return T>3&&I&&Object.defineProperty(k,L,I),I},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 m=u(5871),w=u(4725),C=u(844),A=u(2585),E={full:0,left:0,center:0,right:0},f={full:0,left:0,center:0,right:0},v={full:0,left:0,center:0,right:0};let p=c.OverviewRulerRenderer=class extends C.Disposable{get _width(){return this._optionsService.options.overviewRulerWidth||0}constructor(S,k,L,R,M,T,I){super(),this._viewportElement=S,this._screenElement=k,this._bufferService=L,this._decorationService=R,this._renderService=M,this._optionsService=T,this._coreBrowserService=I,this._colorZoneStore=new m.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);f.full=this._canvas.width,f.left=S,f.center=k,f.right=S,this._refreshDrawHeightConstants(),v.full=0,v.left=0,v.center=f.left,v.right=f.left+f.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),f[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=p=d([y(2,A.IBufferService),y(3,A.IDecorationService),y(4,w.IRenderService),y(5,A.IOptionsService),y(6,w.ICoreBrowserService)],p)},2950:function(_,c,u){var d=this&&this.__decorate||function(E,f,v,p){var S,k=arguments.length,L=k<3?f:p===null?p=Object.getOwnPropertyDescriptor(f,v):p;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")L=Reflect.decorate(E,f,v,p);else for(var R=E.length-1;R>=0;R--)(S=E[R])&&(L=(k<3?S(L):k>3?S(f,v,L):S(f,v))||L);return k>3&&L&&Object.defineProperty(f,v,L),L},y=this&&this.__param||function(E,f){return function(v,p){f(v,p,E)}};Object.defineProperty(c,"__esModule",{value:!0}),c.CompositionHelper=void 0;const m=u(4725),w=u(2585),C=u(2584);let A=c.CompositionHelper=class{get isComposing(){return this._isComposing}constructor(E,f,v,p,S,k){this._textarea=E,this._compositionView=f,this._bufferService=v,this._optionsService=p,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 f={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout((()=>{if(this._isSendingComposition){let v;this._isSendingComposition=!1,f.start+=this._dataAlreadySent.length,v=this._isComposing?this._textarea.value.substring(f.start,f.end):this._textarea.value.substring(f.start),v.length>0&&this._coreService.triggerDataEvent(v,!0)}}),0)}else{this._isSendingComposition=!1;const f=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(f,!0)}}_handleAnyTextareaChanges(){const E=this._textarea.value;setTimeout((()=>{if(!this._isComposing){const f=this._textarea.value,v=f.replace(E,"");this._dataAlreadySent=v,f.length>E.length?this._coreService.triggerDataEvent(v,!0):f.length<E.length?this._coreService.triggerDataEvent(`${C.C0.DEL}`,!0):f.length===E.length&&f!==E&&this._coreService.triggerDataEvent(f,!0)}}),0)}updateCompositionElements(E){if(this._isComposing){if(this._bufferService.buffer.isCursorInViewport){const f=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1),v=this._renderService.dimensions.css.cell.height,p=this._bufferService.buffer.y*this._renderService.dimensions.css.cell.height,S=f*this._renderService.dimensions.css.cell.width;this._compositionView.style.left=S+"px",this._compositionView.style.top=p+"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=p+"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=A=d([y(2,w.IBufferService),y(3,w.IOptionsService),y(4,w.ICoreService),y(5,m.IRenderService)],A)},9806:(_,c)=>{function u(d,y,m){const w=m.getBoundingClientRect(),C=d.getComputedStyle(m),A=parseInt(C.getPropertyValue("padding-left")),E=parseInt(C.getPropertyValue("padding-top"));return[y.clientX-w.left-A,y.clientY-w.top-E]}Object.defineProperty(c,"__esModule",{value:!0}),c.getCoords=c.getCoordsRelativeToElement=void 0,c.getCoordsRelativeToElement=u,c.getCoords=function(d,y,m,w,C,A,E,f,v){if(!A)return;const p=u(d,y,m);return p?(p[0]=Math.ceil((p[0]+(v?E/2:0))/E),p[1]=Math.ceil(p[1]/f),p[0]=Math.min(Math.max(p[0],1),w+(v?1:0)),p[1]=Math.min(Math.max(p[1],1),C),p):void 0}},9504:(_,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.moveToCellSequence=void 0;const d=u(2584);function y(f,v,p,S){const k=f-m(f,p),L=v-m(v,p),R=Math.abs(k-L)-(function(M,T,I){let K=0;const F=M-m(M,I),G=T-m(T,I);for(let B=0;B<Math.abs(F-G);B++){const X=w(M,T)==="A"?-1:1;I.buffer.lines.get(F+X*B)?.isWrapped&&K++}return K})(f,v,p);return E(R,A(w(f,v),S))}function m(f,v){let p=0,S=v.buffer.lines.get(f),k=S?.isWrapped;for(;k&&f>=0&&f<v.rows;)p++,S=v.buffer.lines.get(--f),k=S?.isWrapped;return p}function w(f,v){return f>v?"A":"B"}function C(f,v,p,S,k,L){let R=f,M=v,T="";for(;R!==p||M!==S;)R+=k?1:-1,k&&R>L.cols-1?(T+=L.buffer.translateBufferLineToString(M,!1,f,R),R=0,f=0,M++):!k&&R<0&&(T+=L.buffer.translateBufferLineToString(M,!1,0,f+1),R=L.cols-1,f=R,M--);return T+L.buffer.translateBufferLineToString(M,!1,f,R)}function A(f,v){const p=v?"O":"[";return d.C0.ESC+p+f}function E(f,v){f=Math.floor(f);let p="";for(let S=0;S<f;S++)p+=v;return p}c.moveToCellSequence=function(f,v,p,S){const k=p.buffer.x,L=p.buffer.y;if(!p.buffer.hasScrollback)return(function(T,I,K,F,G,B){return y(I,F,G,B).length===0?"":E(C(T,I,T,I-m(I,G),!1,G).length,A("D",B))})(k,L,0,v,p,S)+y(L,v,p,S)+(function(T,I,K,F,G,B){let X;X=y(I,F,G,B).length>0?F-m(F,G):I;const Y=F,z=(function(q,V,D,H,O,P){let W;return W=y(D,H,O,P).length>0?H-m(H,O):V,q<D&&W<=H||q>=D&&W<H?"C":"D"})(T,I,K,F,G,B);return E(C(T,X,K,Y,z==="C",G).length,A(z,B))})(k,L,f,v,p,S);let R;if(L===v)return R=k>f?"D":"C",E(Math.abs(k-f),A(R,S));R=L>v?"D":"C";const M=Math.abs(L-v);return E((function(T,I){return I.cols-T})(L>v?f:k,p)+(M-1)*p.cols+1+((L>v?k:f)-1),A(R,S))}},1296:function(_,c,u){var d=this&&this.__decorate||function(B,X,Y,z){var q,V=arguments.length,D=V<3?X:z===null?z=Object.getOwnPropertyDescriptor(X,Y):z;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")D=Reflect.decorate(B,X,Y,z);else for(var H=B.length-1;H>=0;H--)(q=B[H])&&(D=(V<3?q(D):V>3?q(X,Y,D):q(X,Y))||D);return V>3&&D&&Object.defineProperty(X,Y,D),D},y=this&&this.__param||function(B,X){return function(Y,z){X(Y,z,B)}};Object.defineProperty(c,"__esModule",{value:!0}),c.DomRenderer=void 0;const m=u(3787),w=u(2550),C=u(2223),A=u(6171),E=u(6052),f=u(4725),v=u(8055),p=u(8460),S=u(844),k=u(2585),L="xterm-dom-renderer-owner-",R="xterm-rows",M="xterm-fg-",T="xterm-bg-",I="xterm-focus",K="xterm-selection";let F=1,G=c.DomRenderer=class extends S.Disposable{constructor(B,X,Y,z,q,V,D,H,O,P,W,Z,ie){super(),this._terminal=B,this._document=X,this._element=Y,this._screenElement=z,this._viewportElement=q,this._helperContainer=V,this._linkifier2=D,this._charSizeService=O,this._optionsService=P,this._bufferService=W,this._coreBrowserService=Z,this._themeService=ie,this._terminalClass=F++,this._rowElements=[],this._selectionRenderModel=(0,E.createSelectionRenderModel)(),this.onRequestRedraw=this.register(new p.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,A.createRenderDimensions)(),this._updateDimensions(),this.register(this._optionsService.onOptionChange((()=>this._handleOptionsChanged()))),this.register(this._themeService.onChangeColors((he=>this._injectCss(he)))),this._injectCss(this._themeService.colors),this._rowFactory=H.createInstance(m.DomRendererRowFactory,document),this._element.classList.add(L+this._terminalClass),this._screenElement.appendChild(this._rowContainer),this._screenElement.appendChild(this._selectionContainer),this.register(this._linkifier2.onShowLinkUnderline((he=>this._handleLinkHover(he)))),this.register(this._linkifier2.onHideLinkUnderline((he=>this._handleLinkLeave(he)))),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 B=this._coreBrowserService.dpr;this.dimensions.device.char.width=this._charSizeService.width*B,this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*B),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/B),this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/B),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 Y of this._rowElements)Y.style.width=`${this.dimensions.css.canvas.width}px`,Y.style.height=`${this.dimensions.css.cell.height}px`,Y.style.lineHeight=`${this.dimensions.css.cell.height}px`,Y.style.overflow="hidden";this._dimensionsStyleElement||(this._dimensionsStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._dimensionsStyleElement));const X=`${this._terminalSelector} .${R} span { display: inline-block; height: 100%; vertical-align: top;}`;this._dimensionsStyleElement.textContent=X,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(B){this._themeStyleElement||(this._themeStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._themeStyleElement));let X=`${this._terminalSelector} .${R} { color: ${B.foreground.css}; font-family: ${this._optionsService.rawOptions.fontFamily}; font-size: ${this._optionsService.rawOptions.fontSize}px; font-kerning: none; white-space: pre}`;X+=`${this._terminalSelector} .${R} .xterm-dim { color: ${v.color.multiplyOpacity(B.foreground,.5).css};}`,X+=`${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 Y=`blink_underline_${this._terminalClass}`,z=`blink_bar_${this._terminalClass}`,q=`blink_block_${this._terminalClass}`;X+=`@keyframes ${Y} { 50% { border-bottom-style: hidden; }}`,X+=`@keyframes ${z} { 50% { box-shadow: none; }}`,X+=`@keyframes ${q} { 0% { background-color: ${B.cursor.css}; color: ${B.cursorAccent.css}; } 50% { background-color: inherit; color: ${B.cursor.css}; }}`,X+=`${this._terminalSelector} .${R}.${I} .xterm-cursor.xterm-cursor-blink.xterm-cursor-underline { animation: ${Y} 1s step-end infinite;}${this._terminalSelector} .${R}.${I} .xterm-cursor.xterm-cursor-blink.xterm-cursor-bar { animation: ${z} 1s step-end infinite;}${this._terminalSelector} .${R}.${I} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: ${q} 1s step-end infinite;}${this._terminalSelector} .${R} .xterm-cursor.xterm-cursor-block { background-color: ${B.cursor.css}; color: ${B.cursorAccent.css};}${this._terminalSelector} .${R} .xterm-cursor.xterm-cursor-block:not(.xterm-cursor-blink) { background-color: ${B.cursor.css} !important; color: ${B.cursorAccent.css} !important;}${this._terminalSelector} .${R} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${B.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${R} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${B.cursor.css} inset;}${this._terminalSelector} .${R} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${B.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,X+=`${this._terminalSelector} .${K} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${K} div { position: absolute; background-color: ${B.selectionBackgroundOpaque.css};}${this._terminalSelector} .${K} div { position: absolute; background-color: ${B.selectionInactiveBackgroundOpaque.css};}`;for(const[V,D]of B.ansi.entries())X+=`${this._terminalSelector} .${M}${V} { color: ${D.css}; }${this._terminalSelector} .${M}${V}.xterm-dim { color: ${v.color.multiplyOpacity(D,.5).css}; }${this._terminalSelector} .${T}${V} { background-color: ${D.css}; }`;X+=`${this._terminalSelector} .${M}${C.INVERTED_DEFAULT_COLOR} { color: ${v.color.opaque(B.background).css}; }${this._terminalSelector} .${M}${C.INVERTED_DEFAULT_COLOR}.xterm-dim { color: ${v.color.multiplyOpacity(v.color.opaque(B.background),.5).css}; }${this._terminalSelector} .${T}${C.INVERTED_DEFAULT_COLOR} { background-color: ${B.foreground.css}; }`,this._themeStyleElement.textContent=X}_setDefaultSpacing(){const B=this.dimensions.css.cell.width-this._widthCache.get("W",!1,!1);this._rowContainer.style.letterSpacing=`${B}px`,this._rowFactory.defaultSpacing=B}handleDevicePixelRatioChange(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}_refreshRowElements(B,X){for(let Y=this._rowElements.length;Y<=X;Y++){const z=this._document.createElement("div");this._rowContainer.appendChild(z),this._rowElements.push(z)}for(;this._rowElements.length>X;)this._rowContainer.removeChild(this._rowElements.pop())}handleResize(B,X){this._refreshRowElements(B,X),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(I),this.renderRows(0,this._bufferService.rows-1)}handleFocus(){this._rowContainer.classList.add(I),this.renderRows(this._bufferService.buffer.y,this._bufferService.buffer.y)}handleSelectionChanged(B,X,Y){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged(B,X,Y),this.renderRows(0,this._bufferService.rows-1),!B||!X)return;this._selectionRenderModel.update(this._terminal,B,X,Y);const z=this._selectionRenderModel.viewportStartRow,q=this._selectionRenderModel.viewportEndRow,V=this._selectionRenderModel.viewportCappedStartRow,D=this._selectionRenderModel.viewportCappedEndRow;if(V>=this._bufferService.rows||D<0)return;const H=this._document.createDocumentFragment();if(Y){const O=B[0]>X[0];H.appendChild(this._createSelectionElement(V,O?X[0]:B[0],O?B[0]:X[0],D-V+1))}else{const O=z===V?B[0]:0,P=V===q?X[0]:this._bufferService.cols;H.appendChild(this._createSelectionElement(V,O,P));const W=D-V-1;if(H.appendChild(this._createSelectionElement(V+1,0,this._bufferService.cols,W)),V!==D){const Z=q===D?X[0]:this._bufferService.cols;H.appendChild(this._createSelectionElement(D,0,Z))}}this._selectionContainer.appendChild(H)}_createSelectionElement(B,X,Y,z=1){const q=this._document.createElement("div"),V=X*this.dimensions.css.cell.width;let D=this.dimensions.css.cell.width*(Y-X);return V+D>this.dimensions.css.canvas.width&&(D=this.dimensions.css.canvas.width-V),q.style.height=z*this.dimensions.css.cell.height+"px",q.style.top=B*this.dimensions.css.cell.height+"px",q.style.left=`${V}px`,q.style.width=`${D}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 B of this._rowElements)B.replaceChildren()}renderRows(B,X){const Y=this._bufferService.buffer,z=Y.ybase+Y.y,q=Math.min(Y.x,this._bufferService.cols-1),V=this._optionsService.rawOptions.cursorBlink,D=this._optionsService.rawOptions.cursorStyle,H=this._optionsService.rawOptions.cursorInactiveStyle;for(let O=B;O<=X;O++){const P=O+Y.ydisp,W=this._rowElements[O],Z=Y.lines.get(P);if(!W||!Z)break;W.replaceChildren(...this._rowFactory.createRow(Z,P,P===z,D,H,q,V,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${L}${this._terminalClass}`}_handleLinkHover(B){this._setCellUnderline(B.x1,B.x2,B.y1,B.y2,B.cols,!0)}_handleLinkLeave(B){this._setCellUnderline(B.x1,B.x2,B.y1,B.y2,B.cols,!1)}_setCellUnderline(B,X,Y,z,q,V){Y<0&&(B=0),z<0&&(X=0);const D=this._bufferService.rows-1;Y=Math.max(Math.min(Y,D),0),z=Math.max(Math.min(z,D),0),q=Math.min(q,this._bufferService.cols);const H=this._bufferService.buffer,O=H.ybase+H.y,P=Math.min(H.x,q-1),W=this._optionsService.rawOptions.cursorBlink,Z=this._optionsService.rawOptions.cursorStyle,ie=this._optionsService.rawOptions.cursorInactiveStyle;for(let he=Y;he<=z;++he){const te=he+H.ydisp,$=this._rowElements[he],le=H.lines.get(te);if(!$||!le)break;$.replaceChildren(...this._rowFactory.createRow(le,te,te===O,Z,ie,P,W,this.dimensions.css.cell.width,this._widthCache,V?he===Y?B:0:-1,V?(he===z?X:q)-1:-1))}}};c.DomRenderer=G=d([y(7,k.IInstantiationService),y(8,f.ICharSizeService),y(9,k.IOptionsService),y(10,k.IBufferService),y(11,f.ICoreBrowserService),y(12,f.IThemeService)],G)},3787:function(_,c,u){var d=this&&this.__decorate||function(R,M,T,I){var K,F=arguments.length,G=F<3?M:I===null?I=Object.getOwnPropertyDescriptor(M,T):I;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")G=Reflect.decorate(R,M,T,I);else for(var B=R.length-1;B>=0;B--)(K=R[B])&&(G=(F<3?K(G):F>3?K(M,T,G):K(M,T))||G);return F>3&&G&&Object.defineProperty(M,T,G),G},y=this&&this.__param||function(R,M){return function(T,I){M(T,I,R)}};Object.defineProperty(c,"__esModule",{value:!0}),c.DomRendererRowFactory=void 0;const m=u(2223),w=u(643),C=u(511),A=u(2585),E=u(8055),f=u(4725),v=u(4269),p=u(6171),S=u(3734);let k=c.DomRendererRowFactory=class{constructor(R,M,T,I,K,F,G){this._document=R,this._characterJoinerService=M,this._optionsService=T,this._coreBrowserService=I,this._coreService=K,this._decorationService=F,this._themeService=G,this._workCell=new C.CellData,this._columnSelectMode=!1,this.defaultSpacing=0}handleSelectionChanged(R,M,T){this._selectionStart=R,this._selectionEnd=M,this._columnSelectMode=T}createRow(R,M,T,I,K,F,G,B,X,Y,z){const q=[],V=this._characterJoinerService.getJoinedCharacters(M),D=this._themeService.colors;let H,O=R.getNoBgTrimmedLength();T&&O<F+1&&(O=F+1);let P=0,W="",Z=0,ie=0,he=0,te=!1,$=0,le=!1,ge=0;const we=[],Se=Y!==-1&&z!==-1;for(let je=0;je<O;je++){R.loadCell(je,this._workCell);let Ie=this._workCell.getWidth();if(Ie===0)continue;let Ge=!1,vt=je,Le=this._workCell;if(V.length>0&&je===V[0][0]){Ge=!0;const dt=V.shift();Le=new v.JoinedCellData(this._workCell,R.translateToString(!0,dt[0],dt[1]),dt[1]-dt[0]),vt=dt[1]-1,Ie=Le.getWidth()}const Rt=this._isCellInSelection(je,M),Xt=T&&je===F,vn=Se&&je>=Y&&je<=z;let an=!1;this._decorationService.forEachDecorationAtCell(je,M,void 0,(dt=>{an=!0}));let kn=Le.getChars()||w.WHITESPACE_CELL_CHAR;if(kn===" "&&(Le.isUnderline()||Le.isOverline())&&(kn=" "),ge=Ie*B-X.get(kn,Le.isBold(),Le.isItalic()),H){if(P&&(Rt&&le||!Rt&&!le&&Le.bg===Z)&&(Rt&&le&&D.selectionForeground||Le.fg===ie)&&Le.extended.ext===he&&vn===te&&ge===$&&!Xt&&!Ge&&!an){Le.isInvisible()?W+=w.WHITESPACE_CELL_CHAR:W+=kn,P++;continue}P&&(H.textContent=W),H=this._document.createElement("span"),P=0,W=""}else H=this._document.createElement("span");if(Z=Le.bg,ie=Le.fg,he=Le.extended.ext,te=vn,$=ge,le=Rt,Ge&&F>=je&&F<=vt&&(F=je),!this._coreService.isCursorHidden&&Xt&&this._coreService.isCursorInitialized){if(we.push("xterm-cursor"),this._coreBrowserService.isFocused)G&&we.push("xterm-cursor-blink"),we.push(I==="bar"?"xterm-cursor-bar":I==="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(Le.isBold()&&we.push("xterm-bold"),Le.isItalic()&&we.push("xterm-italic"),Le.isDim()&&we.push("xterm-dim"),W=Le.isInvisible()?w.WHITESPACE_CELL_CHAR:Le.getChars()||w.WHITESPACE_CELL_CHAR,Le.isUnderline()&&(we.push(`xterm-underline-${Le.extended.underlineStyle}`),W===" "&&(W=" "),!Le.isUnderlineColorDefault()))if(Le.isUnderlineColorRGB())H.style.textDecorationColor=`rgb(${S.AttributeData.toColorRGB(Le.getUnderlineColor()).join(",")})`;else{let dt=Le.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&Le.isBold()&&dt<8&&(dt+=8),H.style.textDecorationColor=D.ansi[dt].css}Le.isOverline()&&(we.push("xterm-overline"),W===" "&&(W=" ")),Le.isStrikethrough()&&we.push("xterm-strikethrough"),vn&&(H.style.textDecoration="underline");let Zt=Le.getFgColor(),ut=Le.getFgColorMode(),Lt=Le.getBgColor(),Ct=Le.getBgColorMode();const Ft=!!Le.isInverse();if(Ft){const dt=Zt;Zt=Lt,Lt=dt;const An=ut;ut=Ct,Ct=An}let Kt,Xn,bn,Pn=!1;switch(this._decorationService.forEachDecorationAtCell(je,M,void 0,(dt=>{dt.options.layer!=="top"&&Pn||(dt.backgroundColorRGB&&(Ct=50331648,Lt=dt.backgroundColorRGB.rgba>>8&16777215,Kt=dt.backgroundColorRGB),dt.foregroundColorRGB&&(ut=50331648,Zt=dt.foregroundColorRGB.rgba>>8&16777215,Xn=dt.foregroundColorRGB),Pn=dt.options.layer==="top")})),!Pn&&Rt&&(Kt=this._coreBrowserService.isFocused?D.selectionBackgroundOpaque:D.selectionInactiveBackgroundOpaque,Lt=Kt.rgba>>8&16777215,Ct=50331648,Pn=!0,D.selectionForeground&&(ut=50331648,Zt=D.selectionForeground.rgba>>8&16777215,Xn=D.selectionForeground)),Pn&&we.push("xterm-decoration-top"),Ct){case 16777216:case 33554432:bn=D.ansi[Lt],we.push(`xterm-bg-${Lt}`);break;case 50331648:bn=E.channels.toColor(Lt>>16,Lt>>8&255,255&Lt),this._addStyle(H,`background-color:#${L((Lt>>>0).toString(16),"0",6)}`);break;default:Ft?(bn=D.foreground,we.push(`xterm-bg-${m.INVERTED_DEFAULT_COLOR}`)):bn=D.background}switch(Kt||Le.isDim()&&(Kt=E.color.multiplyOpacity(bn,.5)),ut){case 16777216:case 33554432:Le.isBold()&&Zt<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(Zt+=8),this._applyMinimumContrast(H,bn,D.ansi[Zt],Le,Kt,void 0)||we.push(`xterm-fg-${Zt}`);break;case 50331648:const dt=E.channels.toColor(Zt>>16&255,Zt>>8&255,255&Zt);this._applyMinimumContrast(H,bn,dt,Le,Kt,Xn)||this._addStyle(H,`color:#${L(Zt.toString(16),"0",6)}`);break;default:this._applyMinimumContrast(H,bn,D.foreground,Le,Kt,Xn)||Ft&&we.push(`xterm-fg-${m.INVERTED_DEFAULT_COLOR}`)}we.length&&(H.className=we.join(" "),we.length=0),Xt||Ge||an?H.textContent=W:P++,ge!==this.defaultSpacing&&(H.style.letterSpacing=`${ge}px`),q.push(H),je=vt}return H&&P&&(H.textContent=W),q}_applyMinimumContrast(R,M,T,I,K,F){if(this._optionsService.rawOptions.minimumContrastRatio===1||(0,p.treatGlyphAsBackgroundColor)(I.getCode()))return!1;const G=this._getContrastCache(I);let B;if(K||F||(B=G.getColor(M.rgba,T.rgba)),B===void 0){const X=this._optionsService.rawOptions.minimumContrastRatio/(I.isDim()?2:1);B=E.color.ensureContrastRatio(K||M,F||T,X),G.setColor((K||M).rgba,(F||T).rgba,B??null)}return!!B&&(this._addStyle(R,`color:${B.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 T=this._selectionStart,I=this._selectionEnd;return!(!T||!I)&&(this._columnSelectMode?T[0]<=I[0]?R>=T[0]&&M>=T[1]&&R<I[0]&&M<=I[1]:R<T[0]&&M>=T[1]&&R>=I[0]&&M<=I[1]:M>T[1]&&M<I[1]||T[1]===I[1]&&M===T[1]&&R>=T[0]&&R<I[0]||T[1]<I[1]&&M===I[1]&&R<I[0]||T[1]<I[1]&&M===T[1]&&R>=T[0])}};function L(R,M,T){for(;R.length<T;)R=M+R;return R}c.DomRendererRowFactory=k=d([y(1,f.ICharacterJoinerService),y(2,A.IOptionsService),y(3,f.ICoreBrowserService),y(4,A.ICoreService),y(5,A.IDecorationService),y(6,f.IThemeService)],k)},2550:(_,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.WidthCache=void 0,c.WidthCache=class{constructor(u,d){this._flat=new Float32Array(256),this._font="",this._fontSize=0,this._weight="normal",this._weightBold="bold",this._measureElements=[],this._container=u.createElement("div"),this._container.classList.add("xterm-width-cache-measure-container"),this._container.setAttribute("aria-hidden","true"),this._container.style.whiteSpace="pre",this._container.style.fontKerning="none";const y=u.createElement("span");y.classList.add("xterm-char-measure-element");const m=u.createElement("span");m.classList.add("xterm-char-measure-element"),m.style.fontWeight="bold";const w=u.createElement("span");w.classList.add("xterm-char-measure-element"),w.style.fontStyle="italic";const C=u.createElement("span");C.classList.add("xterm-char-measure-element"),C.style.fontWeight="bold",C.style.fontStyle="italic",this._measureElements=[y,m,w,C],this._container.appendChild(y),this._container.appendChild(m),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(u,d,y,m){u===this._font&&d===this._fontSize&&y===this._weight&&m===this._weightBold||(this._font=u,this._fontSize=d,this._weight=y,this._weightBold=m,this._container.style.fontFamily=this._font,this._container.style.fontSize=`${this._fontSize}px`,this._measureElements[0].style.fontWeight=`${y}`,this._measureElements[1].style.fontWeight=`${m}`,this._measureElements[2].style.fontWeight=`${y}`,this._measureElements[3].style.fontWeight=`${m}`,this.clear())}get(u,d,y){let m=0;if(!d&&!y&&u.length===1&&(m=u.charCodeAt(0))<256){if(this._flat[m]!==-9999)return this._flat[m];const A=this._measure(u,0);return A>0&&(this._flat[m]=A),A}let w=u;d&&(w+="B"),y&&(w+="I");let C=this._holey.get(w);if(C===void 0){let A=0;d&&(A|=1),y&&(A|=2),C=this._measure(u,A),C>0&&this._holey.set(w,C)}return C}_measure(u,d){const y=this._measureElements[d];return y.textContent=u.repeat(32),y.offsetWidth/32}}},2223:(_,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.TEXT_BASELINE=c.DIM_OPACITY=c.INVERTED_DEFAULT_COLOR=void 0;const d=u(6114);c.INVERTED_DEFAULT_COLOR=257,c.DIM_OPACITY=.5,c.TEXT_BASELINE=d.isFirefox||d.isLegacyEdge?"bottom":"ideographic"},6171:(_,c)=>{function u(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=u,c.isRestrictedPowerlineGlyph=function(y){return 57520<=y&&y<=57527},c.isEmoji=d,c.allowRescaling=function(y,m,w,C){return m===1&&w>Math.ceil(1.5*C)&&y!==void 0&&y>255&&!d(y)&&!u(y)&&!(function(A){return 57344<=A&&A<=63743})(y)},c.treatGlyphAsBackgroundColor=function(y){return u(y)||(function(m){return 9472<=m&&m<=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,m,w=0){return(y-(2*Math.round(m)-w))%(2*Math.round(m))}},6052:(_,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.createSelectionRenderModel=void 0;class u{constructor(){this.clear()}clear(){this.hasSelection=!1,this.columnSelectMode=!1,this.viewportStartRow=0,this.viewportEndRow=0,this.viewportCappedStartRow=0,this.viewportCappedEndRow=0,this.startCol=0,this.endCol=0,this.selectionStart=void 0,this.selectionEnd=void 0}update(y,m,w,C=!1){if(this.selectionStart=m,this.selectionEnd=w,!m||!w||m[0]===w[0]&&m[1]===w[1])return void this.clear();const A=y.buffers.active.ydisp,E=m[1]-A,f=w[1]-A,v=Math.max(E,0),p=Math.min(f,y.rows-1);v>=y.rows||p<0?this.clear():(this.hasSelection=!0,this.columnSelectMode=C,this.viewportStartRow=E,this.viewportEndRow=f,this.viewportCappedStartRow=v,this.viewportCappedEndRow=p,this.startCol=m[0],this.endCol=w[0])}isCellSelected(y,m,w){return!!this.hasSelection&&(w-=y.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?m>=this.startCol&&w>=this.viewportCappedStartRow&&m<this.endCol&&w<=this.viewportCappedEndRow:m<this.startCol&&w>=this.viewportCappedStartRow&&m>=this.endCol&&w<=this.viewportCappedEndRow:w>this.viewportStartRow&&w<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&w===this.viewportStartRow&&m>=this.startCol&&m<this.endCol||this.viewportStartRow<this.viewportEndRow&&w===this.viewportEndRow&&m<this.endCol||this.viewportStartRow<this.viewportEndRow&&w===this.viewportStartRow&&m>=this.startCol)}}c.createSelectionRenderModel=function(){return new u}},456:(_,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.SelectionModel=void 0,c.SelectionModel=class{constructor(u){this._bufferService=u,this.isSelectAllActive=!1,this.selectionStartLength=0}clearSelection(){this.selectionStart=void 0,this.selectionEnd=void 0,this.isSelectAllActive=!1,this.selectionStartLength=0}get finalSelectionStart(){return this.isSelectAllActive?[0,0]:this.selectionEnd&&this.selectionStart&&this.areSelectionValuesReversed()?this.selectionEnd:this.selectionStart}get finalSelectionEnd(){if(this.isSelectAllActive)return[this._bufferService.cols,this._bufferService.buffer.ybase+this._bufferService.rows-1];if(this.selectionStart){if(!this.selectionEnd||this.areSelectionValuesReversed()){const u=this.selectionStart[0]+this.selectionStartLength;return u>this._bufferService.cols?u%this._bufferService.cols==0?[this._bufferService.cols,this.selectionStart[1]+Math.floor(u/this._bufferService.cols)-1]:[u%this._bufferService.cols,this.selectionStart[1]+Math.floor(u/this._bufferService.cols)]:[u,this.selectionStart[1]]}if(this.selectionStartLength&&this.selectionEnd[1]===this.selectionStart[1]){const u=this.selectionStart[0]+this.selectionStartLength;return u>this._bufferService.cols?[u%this._bufferService.cols,this.selectionStart[1]+Math.floor(u/this._bufferService.cols)]:[Math.max(u,this.selectionEnd[0]),this.selectionEnd[1]]}return this.selectionEnd}}areSelectionValuesReversed(){const u=this.selectionStart,d=this.selectionEnd;return!(!u||!d)&&(u[1]>d[1]||u[1]===d[1]&&u[0]>d[0])}handleTrim(u){return this.selectionStart&&(this.selectionStart[1]-=u),this.selectionEnd&&(this.selectionEnd[1]-=u),this.selectionEnd&&this.selectionEnd[1]<0?(this.clearSelection(),!0):(this.selectionStart&&this.selectionStart[1]<0&&(this.selectionStart[1]=0),!1)}}},428:function(_,c,u){var d=this&&this.__decorate||function(p,S,k,L){var R,M=arguments.length,T=M<3?S:L===null?L=Object.getOwnPropertyDescriptor(S,k):L;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")T=Reflect.decorate(p,S,k,L);else for(var I=p.length-1;I>=0;I--)(R=p[I])&&(T=(M<3?R(T):M>3?R(S,k,T):R(S,k))||T);return M>3&&T&&Object.defineProperty(S,k,T),T},y=this&&this.__param||function(p,S){return function(k,L){S(k,L,p)}};Object.defineProperty(c,"__esModule",{value:!0}),c.CharSizeService=void 0;const m=u(2585),w=u(8460),C=u(844);let A=c.CharSizeService=class extends C.Disposable{get hasValidSize(){return this.width>0&&this.height>0}constructor(p,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 f(p,S,this._optionsService))}this.register(this._optionsService.onMultipleOptionChange(["fontFamily","fontSize"],(()=>this.measure())))}measure(){const p=this._measureStrategy.measure();p.width===this.width&&p.height===this.height||(this.width=p.width,this.height=p.height,this._onCharSizeChange.fire())}};c.CharSizeService=A=d([y(2,m.IOptionsService)],A);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 f 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,u){var d=this&&this.__decorate||function(v,p,S,k){var L,R=arguments.length,M=R<3?p:k===null?k=Object.getOwnPropertyDescriptor(p,S):k;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")M=Reflect.decorate(v,p,S,k);else for(var T=v.length-1;T>=0;T--)(L=v[T])&&(M=(R<3?L(M):R>3?L(p,S,M):L(p,S))||M);return R>3&&M&&Object.defineProperty(p,S,M),M},y=this&&this.__param||function(v,p){return function(S,k){p(S,k,v)}};Object.defineProperty(c,"__esModule",{value:!0}),c.CharacterJoinerService=c.JoinedCellData=void 0;const m=u(3734),w=u(643),C=u(511),A=u(2585);class E extends m.AttributeData{constructor(p,S,k){super(),this.content=0,this.combinedData="",this.fg=p.fg,this.bg=p.bg,this.combinedData=S,this._width=k}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(p){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}c.JoinedCellData=E;let f=c.CharacterJoinerService=class Xw{constructor(p){this._bufferService=p,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new C.CellData}register(p){const S={id:this._nextCharacterJoinerId++,handler:p};return this._characterJoiners.push(S),S.id}deregister(p){for(let S=0;S<this._characterJoiners.length;S++)if(this._characterJoiners[S].id===p)return this._characterJoiners.splice(S,1),!0;return!1}getJoinedCharacters(p){if(this._characterJoiners.length===0)return[];const S=this._bufferService.buffer.lines.get(p);if(!S||S.length===0)return[];const k=[],L=S.translateToString(!0);let R=0,M=0,T=0,I=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!==I||this._workCell.bg!==K){if(F-R>1){const G=this._getJoinedRanges(L,T,M,S,R);for(let B=0;B<G.length;B++)k.push(G[B])}R=F,T=M,I=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,T,M,S,R);for(let G=0;G<F.length;G++)k.push(F[G])}return k}_getJoinedRanges(p,S,k,L,R){const M=p.substring(S,k);let T=[];try{T=this._characterJoiners[0].handler(M)}catch(I){console.error(I)}for(let I=1;I<this._characterJoiners.length;I++)try{const K=this._characterJoiners[I].handler(M);for(let F=0;F<K.length;F++)Xw._mergeRanges(T,K[F])}catch(K){console.error(K)}return this._stringRangesToCellRanges(T,L,R),T}_stringRangesToCellRanges(p,S,k){let L=0,R=!1,M=0,T=p[L];if(T){for(let I=k;I<this._bufferService.cols;I++){const K=S.getWidth(I),F=S.getString(I).length||w.WHITESPACE_CELL_CHAR.length;if(K!==0){if(!R&&T[0]<=M&&(T[0]=I,R=!0),T[1]<=M){if(T[1]=I,T=p[++L],!T)break;T[0]<=M?(T[0]=I,R=!0):R=!1}M+=F}}T&&(T[1]=this._bufferService.cols)}}static _mergeRanges(p,S){let k=!1;for(let L=0;L<p.length;L++){const R=p[L];if(k){if(S[1]<=R[0])return p[L-1][1]=S[1],p;if(S[1]<=R[1])return p[L-1][1]=Math.max(S[1],R[1]),p.splice(L,1),p;p.splice(L,1),L--}else{if(S[1]<=R[0])return p.splice(L,0,S),p;if(S[1]<=R[1])return R[0]=Math.min(S[0],R[0]),p;S[0]<R[1]&&(R[0]=Math.min(S[0],R[0]),k=!0)}}return k?p[p.length-1][1]=S[1]:p.push(S),p}};c.CharacterJoinerService=f=d([y(0,A.IBufferService)],f)},5114:(_,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.CoreBrowserService=void 0;const d=u(844),y=u(8460),m=u(3656);class w extends d.Disposable{constructor(E,f,v){super(),this._textarea=E,this._window=f,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((p=>this._screenDprMonitor.setWindow(p)))),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,m.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,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.LinkProviderService=void 0;const d=u(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,u){var d=this&&this.__decorate||function(A,E,f,v){var p,S=arguments.length,k=S<3?E:v===null?v=Object.getOwnPropertyDescriptor(E,f):v;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")k=Reflect.decorate(A,E,f,v);else for(var L=A.length-1;L>=0;L--)(p=A[L])&&(k=(S<3?p(k):S>3?p(E,f,k):p(E,f))||k);return S>3&&k&&Object.defineProperty(E,f,k),k},y=this&&this.__param||function(A,E){return function(f,v){E(f,v,A)}};Object.defineProperty(c,"__esModule",{value:!0}),c.MouseService=void 0;const m=u(4725),w=u(9806);let C=c.MouseService=class{constructor(A,E){this._renderService=A,this._charSizeService=E}getCoords(A,E,f,v,p){return(0,w.getCoords)(window,A,E,f,v,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,p)}getMouseReportCoords(A,E){const f=(0,w.getCoordsRelativeToElement)(window,A,E);if(this._charSizeService.hasValidSize)return f[0]=Math.min(Math.max(f[0],0),this._renderService.dimensions.css.canvas.width-1),f[1]=Math.min(Math.max(f[1],0),this._renderService.dimensions.css.canvas.height-1),{col:Math.floor(f[0]/this._renderService.dimensions.css.cell.width),row:Math.floor(f[1]/this._renderService.dimensions.css.cell.height),x:Math.floor(f[0]),y:Math.floor(f[1])}}};c.MouseService=C=d([y(0,m.IRenderService),y(1,m.ICharSizeService)],C)},3230:function(_,c,u){var d=this&&this.__decorate||function(p,S,k,L){var R,M=arguments.length,T=M<3?S:L===null?L=Object.getOwnPropertyDescriptor(S,k):L;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")T=Reflect.decorate(p,S,k,L);else for(var I=p.length-1;I>=0;I--)(R=p[I])&&(T=(M<3?R(T):M>3?R(S,k,T):R(S,k))||T);return M>3&&T&&Object.defineProperty(S,k,T),T},y=this&&this.__param||function(p,S){return function(k,L){S(k,L,p)}};Object.defineProperty(c,"__esModule",{value:!0}),c.RenderService=void 0;const m=u(6193),w=u(4725),C=u(8460),A=u(844),E=u(7226),f=u(2585);let v=c.RenderService=class extends A.Disposable{get dimensions(){return this._renderer.value.dimensions}constructor(p,S,k,L,R,M,T,I){super(),this._rowCount=p,this._charSizeService=L,this._renderer=this.register(new A.MutableDisposable),this._pausedResizeTask=new E.DebouncedIdleTask,this._observerDisposable=this.register(new A.MutableDisposable),this._isPaused=!1,this._needsFullRefresh=!1,this._isNextRenderRedrawOnly=!0,this._needsSelectionRefresh=!1,this._canvasWidth=0,this._canvasHeight=0,this._selectionState={start:void 0,end:void 0,columnSelectMode:!1},this._onDimensionsChange=this.register(new 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 m.RenderDebouncer(((K,F)=>this._renderRows(K,F)),T),this.register(this._renderDebouncer),this.register(T.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(I.onChangeColors((()=>this._fullRefresh()))),this._registerIntersectionObserver(T.window,S),this.register(T.onWindowChange((K=>this._registerIntersectionObserver(K,S))))}_registerIntersectionObserver(p,S){if("IntersectionObserver"in p){const k=new p.IntersectionObserver((L=>this._handleIntersectionChange(L[L.length-1])),{threshold:0});k.observe(S),this._observerDisposable.value=(0,A.toDisposable)((()=>k.disconnect()))}}_handleIntersectionChange(p){this._isPaused=p.isIntersecting===void 0?p.intersectionRatio===0:!p.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(p,S,k=!1){this._isPaused?this._needsFullRefresh=!0:(k||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(p,S,this._rowCount))}_renderRows(p,S){this._renderer.value&&(p=Math.min(p,this._rowCount-1),S=Math.min(S,this._rowCount-1),this._renderer.value.renderRows(p,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:p,end:S}),this._onRender.fire({start:p,end:S}),this._isNextRenderRedrawOnly=!0)}resize(p,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(p){this._renderer.value=p,this._renderer.value&&(this._renderer.value.onRequestRedraw((S=>this.refreshRows(S.start,S.end,!0))),this._needsSelectionRefresh=!0,this._fullRefresh())}addRefreshCallback(p){return this._renderDebouncer.addRefreshCallback(p)}_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(p,S){this._renderer.value&&(this._isPaused?this._pausedResizeTask.set((()=>this._renderer.value?.handleResize(p,S))):this._renderer.value.handleResize(p,S),this._fullRefresh())}handleCharSizeChanged(){this._renderer.value?.handleCharSizeChanged()}handleBlur(){this._renderer.value?.handleBlur()}handleFocus(){this._renderer.value?.handleFocus()}handleSelectionChanged(p,S,k){this._selectionState.start=p,this._selectionState.end=S,this._selectionState.columnSelectMode=k,this._renderer.value?.handleSelectionChanged(p,S,k)}handleCursorMove(){this._renderer.value?.handleCursorMove()}clear(){this._renderer.value?.clear()}};c.RenderService=v=d([y(2,f.IOptionsService),y(3,w.ICharSizeService),y(4,f.IDecorationService),y(5,f.IBufferService),y(6,w.ICoreBrowserService),y(7,w.IThemeService)],v)},9312:function(_,c,u){var d=this&&this.__decorate||function(T,I,K,F){var G,B=arguments.length,X=B<3?I:F===null?F=Object.getOwnPropertyDescriptor(I,K):F;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")X=Reflect.decorate(T,I,K,F);else for(var Y=T.length-1;Y>=0;Y--)(G=T[Y])&&(X=(B<3?G(X):B>3?G(I,K,X):G(I,K))||X);return B>3&&X&&Object.defineProperty(I,K,X),X},y=this&&this.__param||function(T,I){return function(K,F){I(K,F,T)}};Object.defineProperty(c,"__esModule",{value:!0}),c.SelectionService=void 0;const m=u(9806),w=u(9504),C=u(456),A=u(4725),E=u(8460),f=u(844),v=u(6114),p=u(4841),S=u(511),k=u(2585),L=" ",R=new RegExp(L,"g");let M=c.SelectionService=class extends f.Disposable{constructor(T,I,K,F,G,B,X,Y,z){super(),this._element=T,this._screenElement=I,this._linkifier=K,this._bufferService=F,this._coreService=G,this._mouseService=B,this._optionsService=X,this._renderService=Y,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,f.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 T=this._model.finalSelectionStart,I=this._model.finalSelectionEnd;return!(!T||!I||T[0]===I[0]&&T[1]===I[1])}get selectionText(){const T=this._model.finalSelectionStart,I=this._model.finalSelectionEnd;if(!T||!I)return"";const K=this._bufferService.buffer,F=[];if(this._activeSelectionMode===3){if(T[0]===I[0])return"";const G=T[0]<I[0]?T[0]:I[0],B=T[0]<I[0]?I[0]:T[0];for(let X=T[1];X<=I[1];X++){const Y=K.translateBufferLineToString(X,!0,G,B);F.push(Y)}}else{const G=T[1]===I[1]?I[0]:void 0;F.push(K.translateBufferLineToString(T[1],!0,T[0],G));for(let B=T[1]+1;B<=I[1]-1;B++){const X=K.lines.get(B),Y=K.translateBufferLineToString(B,!0);X?.isWrapped?F[F.length-1]+=Y:F.push(Y)}if(T[1]!==I[1]){const B=K.lines.get(I[1]),X=K.translateBufferLineToString(I[1],!0,0,I[0]);B&&B.isWrapped?F[F.length-1]+=X:F.push(X)}}return F.map((G=>G.replace(R," "))).join(v.isWindows?`\r
|
|
79
|
-
`:`
|
|
80
|
-
`)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(T){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._refresh()))),v.isLinux&&T&&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(T){const I=this._getMouseBufferCoords(T),K=this._model.finalSelectionStart,F=this._model.finalSelectionEnd;return!!(K&&F&&I)&&this._areCoordsInSelection(I,K,F)}isCellInSelection(T,I){const K=this._model.finalSelectionStart,F=this._model.finalSelectionEnd;return!(!K||!F)&&this._areCoordsInSelection([T,I],K,F)}_areCoordsInSelection(T,I,K){return T[1]>I[1]&&T[1]<K[1]||I[1]===K[1]&&T[1]===I[1]&&T[0]>=I[0]&&T[0]<K[0]||I[1]<K[1]&&T[1]===K[1]&&T[0]<K[0]||I[1]<K[1]&&T[1]===I[1]&&T[0]>=I[0]}_selectWordAtCursor(T,I){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,p.getRangeLength)(K,this._bufferService.cols),this._model.selectionEnd=void 0,!0;const F=this._getMouseBufferCoords(T);return!!F&&(this._selectWordAt(F,I),this._model.selectionEnd=void 0,!0)}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(T,I){this._model.clearSelection(),T=Math.max(T,0),I=Math.min(I,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,T],this._model.selectionEnd=[this._bufferService.cols,I],this.refresh(),this._onSelectionChange.fire()}_handleTrim(T){this._model.handleTrim(T)&&this.refresh()}_getMouseBufferCoords(T){const I=this._mouseService.getCoords(T,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(I)return I[0]--,I[1]--,I[1]+=this._bufferService.buffer.ydisp,I}_getMouseEventScrollAmount(T){let I=(0,m.getCoordsRelativeToElement)(this._coreBrowserService.window,T,this._screenElement)[1];const K=this._renderService.dimensions.css.canvas.height;return I>=0&&I<=K?0:(I>K&&(I-=K),I=Math.min(Math.max(I,-50),50),I/=50,I/Math.abs(I)+Math.round(14*I))}shouldForceSelection(T){return v.isMac?T.altKey&&this._optionsService.rawOptions.macOptionClickForcesSelection:T.shiftKey}handleMouseDown(T){if(this._mouseDownTimeStamp=T.timeStamp,(T.button!==2||!this.hasSelection)&&T.button===0){if(!this._enabled){if(!this.shouldForceSelection(T))return;T.stopPropagation()}T.preventDefault(),this._dragScrollAmount=0,this._enabled&&T.shiftKey?this._handleIncrementalClick(T):T.detail===1?this._handleSingleClick(T):T.detail===2?this._handleDoubleClick(T):T.detail===3&&this._handleTripleClick(T),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(T){this._model.selectionStart&&(this._model.selectionEnd=this._getMouseBufferCoords(T))}_handleSingleClick(T){if(this._model.selectionStartLength=0,this._model.isSelectAllActive=!1,this._activeSelectionMode=this.shouldColumnSelect(T)?3:0,this._model.selectionStart=this._getMouseBufferCoords(T),!this._model.selectionStart)return;this._model.selectionEnd=void 0;const I=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);I&&I.length!==this._model.selectionStart[0]&&I.hasWidth(this._model.selectionStart[0])===0&&this._model.selectionStart[0]++}_handleDoubleClick(T){this._selectWordAtCursor(T,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(T){const I=this._getMouseBufferCoords(T);I&&(this._activeSelectionMode=2,this._selectLineAt(I[1]))}shouldColumnSelect(T){return T.altKey&&!(v.isMac&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(T){if(T.stopImmediatePropagation(),!this._model.selectionStart)return;const I=this._model.selectionEnd?[this._model.selectionEnd[0],this._model.selectionEnd[1]]:null;if(this._model.selectionEnd=this._getMouseBufferCoords(T),!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(T),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]++}I&&I[0]===this._model.selectionEnd[0]&&I[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 T=this._bufferService.buffer;this._dragScrollAmount>0?(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=this._bufferService.cols),this._model.selectionEnd[1]=Math.min(T.ydisp+this._bufferService.rows,T.lines.length-1)):(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=0),this._model.selectionEnd[1]=T.ydisp),this.refresh()}}_handleMouseUp(T){const I=T.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&I<500&&T.altKey&&this._optionsService.rawOptions.altClickMovesCursor){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){const K=this._mouseService.getCoords(T,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 T=this._model.finalSelectionStart,I=this._model.finalSelectionEnd,K=!(!T||!I||T[0]===I[0]&&T[1]===I[1]);K?T&&I&&(this._oldSelectionStart&&this._oldSelectionEnd&&T[0]===this._oldSelectionStart[0]&&T[1]===this._oldSelectionStart[1]&&I[0]===this._oldSelectionEnd[0]&&I[1]===this._oldSelectionEnd[1]||this._fireOnSelectionChange(T,I,K)):this._oldHasSelection&&this._fireOnSelectionChange(T,I,K)}_fireOnSelectionChange(T,I,K){this._oldSelectionStart=T,this._oldSelectionEnd=I,this._oldHasSelection=K,this._onSelectionChange.fire()}_handleBufferActivate(T){this.clearSelection(),this._trimListener.dispose(),this._trimListener=T.activeBuffer.lines.onTrim((I=>this._handleTrim(I)))}_convertViewportColToCharacterIndex(T,I){let K=I;for(let F=0;I>=F;F++){const G=T.loadCell(F,this._workCell).getChars().length;this._workCell.getWidth()===0?K--:G>1&&I!==F&&(K+=G-1)}return K}setSelection(T,I,K){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[T,I],this._model.selectionStartLength=K,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(T){this._isClickInSelection(T)||(this._selectWordAtCursor(T,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(T,I,K=!0,F=!0){if(T[0]>=this._bufferService.cols)return;const G=this._bufferService.buffer,B=G.lines.get(T[1]);if(!B)return;const X=G.translateBufferLineToString(T[1],!1);let Y=this._convertViewportColToCharacterIndex(B,T[0]),z=Y;const q=T[0]-Y;let V=0,D=0,H=0,O=0;if(X.charAt(Y)===" "){for(;Y>0&&X.charAt(Y-1)===" ";)Y--;for(;z<X.length&&X.charAt(z+1)===" ";)z++}else{let Z=T[0],ie=T[0];B.getWidth(Z)===0&&(V++,Z--),B.getWidth(ie)===2&&(D++,ie++);const he=B.getString(ie).length;for(he>1&&(O+=he-1,z+=he-1);Z>0&&Y>0&&!this._isCharWordSeparator(B.loadCell(Z-1,this._workCell));){B.loadCell(Z-1,this._workCell);const te=this._workCell.getChars().length;this._workCell.getWidth()===0?(V++,Z--):te>1&&(H+=te-1,Y-=te-1),Y--,Z--}for(;ie<B.length&&z+1<X.length&&!this._isCharWordSeparator(B.loadCell(ie+1,this._workCell));){B.loadCell(ie+1,this._workCell);const te=this._workCell.getChars().length;this._workCell.getWidth()===2?(D++,ie++):te>1&&(O+=te-1,z+=te-1),z++,ie++}}z++;let P=Y+q-V+H,W=Math.min(this._bufferService.cols,z-Y+V+D-H-O);if(I||X.slice(Y,z).trim()!==""){if(K&&P===0&&B.getCodePoint(0)!==32){const Z=G.lines.get(T[1]-1);if(Z&&B.isWrapped&&Z.getCodePoint(this._bufferService.cols-1)!==32){const ie=this._getWordAt([this._bufferService.cols-1,T[1]-1],!1,!0,!1);if(ie){const he=this._bufferService.cols-ie.start;P-=he,W+=he}}}if(F&&P+W===this._bufferService.cols&&B.getCodePoint(this._bufferService.cols-1)!==32){const Z=G.lines.get(T[1]+1);if(Z?.isWrapped&&Z.getCodePoint(0)!==32){const ie=this._getWordAt([0,T[1]+1],!1,!1,!0);ie&&(W+=ie.length)}}return{start:P,length:W}}}_selectWordAt(T,I){const K=this._getWordAt(T,I);if(K){for(;K.start<0;)K.start+=this._bufferService.cols,T[1]--;this._model.selectionStart=[K.start,T[1]],this._model.selectionStartLength=K.length}}_selectToWordAt(T){const I=this._getWordAt(T,!0);if(I){let K=T[1];for(;I.start<0;)I.start+=this._bufferService.cols,K--;if(!this._model.areSelectionValuesReversed())for(;I.start+I.length>this._bufferService.cols;)I.length-=this._bufferService.cols,K++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?I.start:I.start+I.length,K]}}_isCharWordSeparator(T){return T.getWidth()!==0&&this._optionsService.rawOptions.wordSeparator.indexOf(T.getChars())>=0}_selectLineAt(T){const I=this._bufferService.buffer.getWrappedRangeForLine(T),K={start:{x:0,y:I.first},end:{x:this._bufferService.cols-1,y:I.last}};this._model.selectionStart=[0,I.first],this._model.selectionEnd=void 0,this._model.selectionStartLength=(0,p.getRangeLength)(K,this._bufferService.cols)}};c.SelectionService=M=d([y(3,k.IBufferService),y(4,k.ICoreService),y(5,A.IMouseService),y(6,k.IOptionsService),y(7,A.IRenderService),y(8,A.ICoreBrowserService)],M)},4725:(_,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.ILinkProviderService=c.IThemeService=c.ICharacterJoinerService=c.ISelectionService=c.IRenderService=c.IMouseService=c.ICoreBrowserService=c.ICharSizeService=void 0;const d=u(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,u){var d=this&&this.__decorate||function(M,T,I,K){var F,G=arguments.length,B=G<3?T:K===null?K=Object.getOwnPropertyDescriptor(T,I):K;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")B=Reflect.decorate(M,T,I,K);else for(var X=M.length-1;X>=0;X--)(F=M[X])&&(B=(G<3?F(B):G>3?F(T,I,B):F(T,I))||B);return G>3&&B&&Object.defineProperty(T,I,B),B},y=this&&this.__param||function(M,T){return function(I,K){T(I,K,M)}};Object.defineProperty(c,"__esModule",{value:!0}),c.ThemeService=c.DEFAULT_ANSI_COLORS=void 0;const m=u(7239),w=u(8055),C=u(8460),A=u(844),E=u(2585),f=w.css.toColor("#ffffff"),v=w.css.toColor("#000000"),p=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")],T=[0,95,135,175,215,255];for(let I=0;I<216;I++){const K=T[I/36%6|0],F=T[I/6%6|0],G=T[I%6];M.push({css:w.channels.toCss(K,F,G),rgba:w.channels.toRgba(K,F,G)})}for(let I=0;I<24;I++){const K=8+10*I;M.push({css:w.channels.toCss(K,K,K),rgba:w.channels.toRgba(K,K,K)})}return M})());let L=c.ThemeService=class extends A.Disposable{get colors(){return this._colors}constructor(M){super(),this._optionsService=M,this._contrastCache=new m.ColorContrastCache,this._halfContrastCache=new m.ColorContrastCache,this._onChangeColors=this.register(new C.EventEmitter),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:f,background:v,cursor:p,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 T=this._colors;if(T.foreground=R(M.foreground,f),T.background=R(M.background,v),T.cursor=R(M.cursor,p),T.cursorAccent=R(M.cursorAccent,S),T.selectionBackgroundTransparent=R(M.selectionBackground,k),T.selectionBackgroundOpaque=w.color.blend(T.background,T.selectionBackgroundTransparent),T.selectionInactiveBackgroundTransparent=R(M.selectionInactiveBackground,T.selectionBackgroundTransparent),T.selectionInactiveBackgroundOpaque=w.color.blend(T.background,T.selectionInactiveBackgroundTransparent),T.selectionForeground=M.selectionForeground?R(M.selectionForeground,w.NULL_COLOR):void 0,T.selectionForeground===w.NULL_COLOR&&(T.selectionForeground=void 0),w.color.isOpaque(T.selectionBackgroundTransparent)&&(T.selectionBackgroundTransparent=w.color.opacity(T.selectionBackgroundTransparent,.3)),w.color.isOpaque(T.selectionInactiveBackgroundTransparent)&&(T.selectionInactiveBackgroundTransparent=w.color.opacity(T.selectionInactiveBackgroundTransparent,.3)),T.ansi=c.DEFAULT_ANSI_COLORS.slice(),T.ansi[0]=R(M.black,c.DEFAULT_ANSI_COLORS[0]),T.ansi[1]=R(M.red,c.DEFAULT_ANSI_COLORS[1]),T.ansi[2]=R(M.green,c.DEFAULT_ANSI_COLORS[2]),T.ansi[3]=R(M.yellow,c.DEFAULT_ANSI_COLORS[3]),T.ansi[4]=R(M.blue,c.DEFAULT_ANSI_COLORS[4]),T.ansi[5]=R(M.magenta,c.DEFAULT_ANSI_COLORS[5]),T.ansi[6]=R(M.cyan,c.DEFAULT_ANSI_COLORS[6]),T.ansi[7]=R(M.white,c.DEFAULT_ANSI_COLORS[7]),T.ansi[8]=R(M.brightBlack,c.DEFAULT_ANSI_COLORS[8]),T.ansi[9]=R(M.brightRed,c.DEFAULT_ANSI_COLORS[9]),T.ansi[10]=R(M.brightGreen,c.DEFAULT_ANSI_COLORS[10]),T.ansi[11]=R(M.brightYellow,c.DEFAULT_ANSI_COLORS[11]),T.ansi[12]=R(M.brightBlue,c.DEFAULT_ANSI_COLORS[12]),T.ansi[13]=R(M.brightMagenta,c.DEFAULT_ANSI_COLORS[13]),T.ansi[14]=R(M.brightCyan,c.DEFAULT_ANSI_COLORS[14]),T.ansi[15]=R(M.brightWhite,c.DEFAULT_ANSI_COLORS[15]),M.extendedAnsi){const I=Math.min(T.ansi.length-16,M.extendedAnsi.length);for(let K=0;K<I;K++)T.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 T=0;T<this._restoreColors.ansi.length;++T)this._colors.ansi[T]=this._restoreColors.ansi[T]}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,T){if(M!==void 0)try{return w.css.toColor(M)}catch{}return T}c.ThemeService=L=d([y(0,E.IOptionsService)],L)},6349:(_,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.CircularList=void 0;const d=u(8460),y=u(844);class m 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 A=new Array(C);for(let E=0;E<Math.min(C,this.length);E++)A[E]=this._array[this._getCyclicIndex(E)];this._array=A,this._maxLength=C,this._startIndex=0}get length(){return this._length}set length(C){if(C>this._length)for(let A=this._length;A<C;A++)this._array[A]=void 0;this._length=C}get(C){return this._array[this._getCyclicIndex(C)]}set(C,A){this._array[this._getCyclicIndex(C)]=A}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,A,...E){if(A){for(let f=C;f<this._length-A;f++)this._array[this._getCyclicIndex(f)]=this._array[this._getCyclicIndex(f+A)];this._length-=A,this.onDeleteEmitter.fire({index:C,amount:A})}for(let f=this._length-1;f>=C;f--)this._array[this._getCyclicIndex(f+E.length)]=this._array[this._getCyclicIndex(f)];for(let f=0;f<E.length;f++)this._array[this._getCyclicIndex(C+f)]=E[f];if(E.length&&this.onInsertEmitter.fire({index:C,amount:E.length}),this._length+E.length>this._maxLength){const f=this._length+E.length-this._maxLength;this._startIndex+=f,this._length=this._maxLength,this.onTrimEmitter.fire(f)}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,A,E){if(!(A<=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=A-1;v>=0;v--)this.set(C+v+E,this.get(C+v));const f=C+A+E-this._length;if(f>0)for(this._length+=f;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(let f=0;f<A;f++)this.set(C+f+E,this.get(C+f))}}_getCyclicIndex(C){return(this._startIndex+C)%this._maxLength}}c.CircularList=m},1439:(_,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.clone=void 0,c.clone=function u(d,y=5){if(typeof d!="object")return d;const m=Array.isArray(d)?[]:{};for(const w in d)m[w]=y<=1?d[w]:d[w]&&u(d[w],y-1);return m}},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 u=0,d=0,y=0,m=0;var w,C,A,E,f;function v(S){const k=S.toString(16);return k.length<2?"0"+k:k}function p(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 m=Math.round(255*R),[u,d,y]=f.toChannels(L.rgba),{css:w.toCss(u,d,y,m),rgba:w.toRgba(u,d,y,m)}}S.blend=function(L,R){if(m=(255&R.rgba)/255,m===1)return{css:R.css,rgba:R.rgba};const M=R.rgba>>24&255,T=R.rgba>>16&255,I=R.rgba>>8&255,K=L.rgba>>24&255,F=L.rgba>>16&255,G=L.rgba>>8&255;return u=K+Math.round((M-K)*m),d=F+Math.round((T-F)*m),y=G+Math.round((I-G)*m),{css:w.toCss(u,d,y),rgba:w.toRgba(u,d,y)}},S.isOpaque=function(L){return(255&L.rgba)==255},S.ensureContrastRatio=function(L,R,M){const T=f.ensureContrastRatio(L.rgba,R.rgba,M);if(T)return w.toColor(T>>24&255,T>>16&255,T>>8&255)},S.opaque=function(L){const R=(255|L.rgba)>>>0;return[u,d,y]=f.toChannels(R),{css:w.toCss(u,d,y),rgba:R}},S.opacity=k,S.multiplyOpacity=function(L,R){return m=255&L.rgba,k(L,m*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 u=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(u,d,y);case 5:return u=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),m=parseInt(R.slice(4,5).repeat(2),16),w.toColor(u,d,y,m);case 7:return{css:R,rgba:(parseInt(R.slice(1),16)<<8|255)>>>0};case 9:return{css:R,rgba:parseInt(R.slice(1),16)>>>0}}const M=R.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(M)return u=parseInt(M[1]),d=parseInt(M[2]),y=parseInt(M[3]),m=Math.round(255*(M[5]===void 0?1:parseFloat(M[5]))),w.toColor(u,d,y,m);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),[u,d,y,m]=k.getImageData(0,0,1,1).data,m!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:w.toRgba(u,d,y,m),css:R}}})(A||(c.css=A={})),(function(S){function k(L,R,M){const T=L/255,I=R/255,K=M/255;return .2126*(T<=.03928?T/12.92:Math.pow((T+.055)/1.055,2.4))+.7152*(I<=.03928?I/12.92:Math.pow((I+.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,T){const I=R>>24&255,K=R>>16&255,F=R>>8&255;let G=M>>24&255,B=M>>16&255,X=M>>8&255,Y=p(E.relativeLuminance2(G,B,X),E.relativeLuminance2(I,K,F));for(;Y<T&&(G>0||B>0||X>0);)G-=Math.max(0,Math.ceil(.1*G)),B-=Math.max(0,Math.ceil(.1*B)),X-=Math.max(0,Math.ceil(.1*X)),Y=p(E.relativeLuminance2(G,B,X),E.relativeLuminance2(I,K,F));return(G<<24|B<<16|X<<8|255)>>>0}function L(R,M,T){const I=R>>24&255,K=R>>16&255,F=R>>8&255;let G=M>>24&255,B=M>>16&255,X=M>>8&255,Y=p(E.relativeLuminance2(G,B,X),E.relativeLuminance2(I,K,F));for(;Y<T&&(G<255||B<255||X<255);)G=Math.min(255,G+Math.ceil(.1*(255-G))),B=Math.min(255,B+Math.ceil(.1*(255-B))),X=Math.min(255,X+Math.ceil(.1*(255-X))),Y=p(E.relativeLuminance2(G,B,X),E.relativeLuminance2(I,K,F));return(G<<24|B<<16|X<<8|255)>>>0}S.blend=function(R,M){if(m=(255&M)/255,m===1)return M;const T=M>>24&255,I=M>>16&255,K=M>>8&255,F=R>>24&255,G=R>>16&255,B=R>>8&255;return u=F+Math.round((T-F)*m),d=G+Math.round((I-G)*m),y=B+Math.round((K-B)*m),w.toRgba(u,d,y)},S.ensureContrastRatio=function(R,M,T){const I=E.relativeLuminance(R>>8),K=E.relativeLuminance(M>>8);if(p(I,K)<T){if(K<I){const B=k(R,M,T),X=p(I,E.relativeLuminance(B>>8));if(X<T){const Y=L(R,M,T);return X>p(I,E.relativeLuminance(Y>>8))?B:Y}return B}const F=L(R,M,T),G=p(I,E.relativeLuminance(F>>8));if(G<T){const B=k(R,M,T);return G>p(I,E.relativeLuminance(B>>8))?F:B}return F}},S.reduceLuminance=k,S.increaseLuminance=L,S.toChannels=function(R){return[R>>24&255,R>>16&255,R>>8&255,255&R]}})(f||(c.rgba=f={})),c.toPaddedHex=v,c.contrastRatio=p},8969:(_,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.CoreTerminal=void 0;const d=u(844),y=u(2585),m=u(4348),w=u(7866),C=u(744),A=u(7302),E=u(6975),f=u(8460),v=u(1753),p=u(1480),S=u(7994),k=u(9282),L=u(5435),R=u(5981),M=u(2660);let T=!1;class I extends d.Disposable{get onScroll(){return this._onScrollApi||(this._onScrollApi=this.register(new f.EventEmitter),this._onScroll.event((F=>{this._onScrollApi?.fire(F.position)}))),this._onScrollApi.event}get cols(){return this._bufferService.cols}get rows(){return this._bufferService.rows}get buffers(){return this._bufferService.buffers}get options(){return this.optionsService.options}set options(F){for(const G in F)this.optionsService.options[G]=F[G]}constructor(F){super(),this._windowsWrappingHeuristics=this.register(new d.MutableDisposable),this._onBinary=this.register(new f.EventEmitter),this.onBinary=this._onBinary.event,this._onData=this.register(new f.EventEmitter),this.onData=this._onData.event,this._onLineFeed=this.register(new f.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onResize=this.register(new f.EventEmitter),this.onResize=this._onResize.event,this._onWriteParsed=this.register(new f.EventEmitter),this.onWriteParsed=this._onWriteParsed.event,this._onScroll=this.register(new f.EventEmitter),this._instantiationService=new m.InstantiationService,this.optionsService=this.register(new A.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(p.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,f.forwardEvent)(this._inputHandler.onLineFeed,this._onLineFeed)),this.register(this._inputHandler),this.register((0,f.forwardEvent)(this._bufferService.onResize,this._onResize)),this.register((0,f.forwardEvent)(this.coreService.onData,this._onData)),this.register((0,f.forwardEvent)(this.coreService.onBinary,this._onBinary)),this.register(this.coreService.onRequestScrollToBottom((()=>this.scrollToBottom()))),this.register(this.coreService.onUserInput((()=>this._writeBuffer.handleUserInput()))),this.register(this.optionsService.onMultipleOptionChange(["windowsMode","windowsPty"],(()=>this._handleWindowsPtyOptionChange()))),this.register(this._bufferService.onScroll((G=>{this._onScroll.fire({position:this._bufferService.buffer.ydisp,source:0}),this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)}))),this.register(this._inputHandler.onScroll((G=>{this._onScroll.fire({position:this._bufferService.buffer.ydisp,source:0}),this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)}))),this._writeBuffer=this.register(new R.WriteBuffer(((G,B)=>this._inputHandler.parse(G,B)))),this.register((0,f.forwardEvent)(this._writeBuffer.onWriteParsed,this._onWriteParsed))}write(F,G){this._writeBuffer.write(F,G)}writeSync(F,G){this._logService.logLevel<=y.LogLevelEnum.WARN&&!T&&(this._logService.warn("writeSync is unreliable and will be removed soon."),T=!0),this._writeBuffer.writeSync(F,G)}input(F,G=!0){this.coreService.triggerDataEvent(F,G)}resize(F,G){isNaN(F)||isNaN(G)||(F=Math.max(F,C.MINIMUM_COLS),G=Math.max(G,C.MINIMUM_ROWS),this._bufferService.resize(F,G))}scroll(F,G=!1){this._bufferService.scroll(F,G)}scrollLines(F,G,B){this._bufferService.scrollLines(F,G,B)}scrollPages(F){this.scrollLines(F*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(){this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(F){const G=F-this._bufferService.buffer.ydisp;G!==0&&this.scrollLines(G)}registerEscHandler(F,G){return this._inputHandler.registerEscHandler(F,G)}registerDcsHandler(F,G){return this._inputHandler.registerDcsHandler(F,G)}registerCsiHandler(F,G){return this._inputHandler.registerCsiHandler(F,G)}registerOscHandler(F,G){return this._inputHandler.registerOscHandler(F,G)}_setup(){this._handleWindowsPtyOptionChange()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_handleWindowsPtyOptionChange(){let F=!1;const G=this.optionsService.rawOptions.windowsPty;G&&G.buildNumber!==void 0&&G.buildNumber!==void 0?F=G.backend==="conpty"&&G.buildNumber<21376:this.optionsService.rawOptions.windowsMode&&(F=!0),F?this._enableWindowsWrappingHeuristics():this._windowsWrappingHeuristics.clear()}_enableWindowsWrappingHeuristics(){if(!this._windowsWrappingHeuristics.value){const F=[];F.push(this.onLineFeed(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 G of F)G.dispose()}))}}}c.CoreTerminal=I},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=u=>(this._listeners.push(u),{dispose:()=>{if(!this._disposed){for(let d=0;d<this._listeners.length;d++)if(this._listeners[d]===u)return void this._listeners.splice(d,1)}}})),this._event}fire(u,d){const y=[];for(let m=0;m<this._listeners.length;m++)y.push(this._listeners[m]);for(let m=0;m<y.length;m++)y[m].call(void 0,u,d)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},c.forwardEvent=function(u,d){return u((y=>d.fire(y)))},c.runAndSubscribe=function(u,d){return d(void 0),u((y=>d(y)))}},5435:function(_,c,u){var d=this&&this.__decorate||function(V,D,H,O){var P,W=arguments.length,Z=W<3?D:O===null?O=Object.getOwnPropertyDescriptor(D,H):O;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")Z=Reflect.decorate(V,D,H,O);else for(var ie=V.length-1;ie>=0;ie--)(P=V[ie])&&(Z=(W<3?P(Z):W>3?P(D,H,Z):P(D,H))||Z);return W>3&&Z&&Object.defineProperty(D,H,Z),Z},y=this&&this.__param||function(V,D){return function(H,O){D(H,O,V)}};Object.defineProperty(c,"__esModule",{value:!0}),c.InputHandler=c.WindowsOptionsReportType=void 0;const m=u(2584),w=u(7116),C=u(2015),A=u(844),E=u(482),f=u(8437),v=u(8460),p=u(643),S=u(511),k=u(3734),L=u(2585),R=u(1480),M=u(6242),T=u(6351),I=u(5941),K={"(":0,")":1,"*":2,"+":3,"-":1,".":2},F=131072;function G(V,D){if(V>24)return D.setWinLines||!1;switch(V){case 1:return!!D.restoreWin;case 2:return!!D.minimizeWin;case 3:return!!D.setWinPosition;case 4:return!!D.setWinSizePixels;case 5:return!!D.raiseWin;case 6:return!!D.lowerWin;case 7:return!!D.refreshWin;case 8:return!!D.setWinSizeChars;case 9:return!!D.maximizeWin;case 10:return!!D.fullscreenWin;case 11:return!!D.getWinState;case 13:return!!D.getWinPosition;case 14:return!!D.getWinSizePixels;case 15:return!!D.getScreenSizePixels;case 16:return!!D.getCellSizePixels;case 18:return!!D.getWinSizeChars;case 19:return!!D.getScreenSizeChars;case 20:return!!D.getIconTitle;case 21:return!!D.getWinTitle;case 22:return!!D.pushTitle;case 23:return!!D.popTitle;case 24:return!!D.setWinLines}return!1}var B;(function(V){V[V.GET_WIN_SIZE_PIXELS=0]="GET_WIN_SIZE_PIXELS",V[V.GET_CELL_SIZE_PIXELS=1]="GET_CELL_SIZE_PIXELS"})(B||(c.WindowsOptionsReportType=B={}));let X=0;class Y extends A.Disposable{getAttrData(){return this._curAttrData}constructor(D,H,O,P,W,Z,ie,he,te=new C.EscapeSequenceParser){super(),this._bufferService=D,this._charsetService=H,this._coreService=O,this._logService=P,this._optionsService=W,this._oscLinkService=Z,this._coreMouseService=ie,this._unicodeService=he,this._parser=te,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=f.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=f.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(($=>this._activeBuffer=$.activeBuffer))),this._parser.setCsiHandlerFallback((($,le)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString($),params:le.toArray()})})),this._parser.setEscHandlerFallback(($=>{this._logService.debug("Unknown ESC code: ",{identifier:this._parser.identToString($)})})),this._parser.setExecuteHandlerFallback(($=>{this._logService.debug("Unknown EXECUTE code: ",{code:$})})),this._parser.setOscHandlerFallback((($,le,ge)=>{this._logService.debug("Unknown OSC code: ",{identifier:$,action:le,data:ge})})),this._parser.setDcsHandlerFallback((($,le,ge)=>{le==="HOOK"&&(ge=ge.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString($),action:le,payload:ge})})),this._parser.setPrintHandler((($,le,ge)=>this.print($,le,ge))),this._parser.registerCsiHandler({final:"@"},($=>this.insertChars($))),this._parser.registerCsiHandler({intermediates:" ",final:"@"},($=>this.scrollLeft($))),this._parser.registerCsiHandler({final:"A"},($=>this.cursorUp($))),this._parser.registerCsiHandler({intermediates:" ",final:"A"},($=>this.scrollRight($))),this._parser.registerCsiHandler({final:"B"},($=>this.cursorDown($))),this._parser.registerCsiHandler({final:"C"},($=>this.cursorForward($))),this._parser.registerCsiHandler({final:"D"},($=>this.cursorBackward($))),this._parser.registerCsiHandler({final:"E"},($=>this.cursorNextLine($))),this._parser.registerCsiHandler({final:"F"},($=>this.cursorPrecedingLine($))),this._parser.registerCsiHandler({final:"G"},($=>this.cursorCharAbsolute($))),this._parser.registerCsiHandler({final:"H"},($=>this.cursorPosition($))),this._parser.registerCsiHandler({final:"I"},($=>this.cursorForwardTab($))),this._parser.registerCsiHandler({final:"J"},($=>this.eraseInDisplay($,!1))),this._parser.registerCsiHandler({prefix:"?",final:"J"},($=>this.eraseInDisplay($,!0))),this._parser.registerCsiHandler({final:"K"},($=>this.eraseInLine($,!1))),this._parser.registerCsiHandler({prefix:"?",final:"K"},($=>this.eraseInLine($,!0))),this._parser.registerCsiHandler({final:"L"},($=>this.insertLines($))),this._parser.registerCsiHandler({final:"M"},($=>this.deleteLines($))),this._parser.registerCsiHandler({final:"P"},($=>this.deleteChars($))),this._parser.registerCsiHandler({final:"S"},($=>this.scrollUp($))),this._parser.registerCsiHandler({final:"T"},($=>this.scrollDown($))),this._parser.registerCsiHandler({final:"X"},($=>this.eraseChars($))),this._parser.registerCsiHandler({final:"Z"},($=>this.cursorBackwardTab($))),this._parser.registerCsiHandler({final:"`"},($=>this.charPosAbsolute($))),this._parser.registerCsiHandler({final:"a"},($=>this.hPositionRelative($))),this._parser.registerCsiHandler({final:"b"},($=>this.repeatPrecedingCharacter($))),this._parser.registerCsiHandler({final:"c"},($=>this.sendDeviceAttributesPrimary($))),this._parser.registerCsiHandler({prefix:">",final:"c"},($=>this.sendDeviceAttributesSecondary($))),this._parser.registerCsiHandler({final:"d"},($=>this.linePosAbsolute($))),this._parser.registerCsiHandler({final:"e"},($=>this.vPositionRelative($))),this._parser.registerCsiHandler({final:"f"},($=>this.hVPosition($))),this._parser.registerCsiHandler({final:"g"},($=>this.tabClear($))),this._parser.registerCsiHandler({final:"h"},($=>this.setMode($))),this._parser.registerCsiHandler({prefix:"?",final:"h"},($=>this.setModePrivate($))),this._parser.registerCsiHandler({final:"l"},($=>this.resetMode($))),this._parser.registerCsiHandler({prefix:"?",final:"l"},($=>this.resetModePrivate($))),this._parser.registerCsiHandler({final:"m"},($=>this.charAttributes($))),this._parser.registerCsiHandler({final:"n"},($=>this.deviceStatus($))),this._parser.registerCsiHandler({prefix:"?",final:"n"},($=>this.deviceStatusPrivate($))),this._parser.registerCsiHandler({intermediates:"!",final:"p"},($=>this.softReset($))),this._parser.registerCsiHandler({intermediates:" ",final:"q"},($=>this.setCursorStyle($))),this._parser.registerCsiHandler({final:"r"},($=>this.setScrollRegion($))),this._parser.registerCsiHandler({final:"s"},($=>this.saveCursor($))),this._parser.registerCsiHandler({final:"t"},($=>this.windowOptions($))),this._parser.registerCsiHandler({final:"u"},($=>this.restoreCursor($))),this._parser.registerCsiHandler({intermediates:"'",final:"}"},($=>this.insertColumns($))),this._parser.registerCsiHandler({intermediates:"'",final:"~"},($=>this.deleteColumns($))),this._parser.registerCsiHandler({intermediates:'"',final:"q"},($=>this.selectProtected($))),this._parser.registerCsiHandler({intermediates:"$",final:"p"},($=>this.requestMode($,!0))),this._parser.registerCsiHandler({prefix:"?",intermediates:"$",final:"p"},($=>this.requestMode($,!1))),this._parser.setExecuteHandler(m.C0.BEL,(()=>this.bell())),this._parser.setExecuteHandler(m.C0.LF,(()=>this.lineFeed())),this._parser.setExecuteHandler(m.C0.VT,(()=>this.lineFeed())),this._parser.setExecuteHandler(m.C0.FF,(()=>this.lineFeed())),this._parser.setExecuteHandler(m.C0.CR,(()=>this.carriageReturn())),this._parser.setExecuteHandler(m.C0.BS,(()=>this.backspace())),this._parser.setExecuteHandler(m.C0.HT,(()=>this.tab())),this._parser.setExecuteHandler(m.C0.SO,(()=>this.shiftOut())),this._parser.setExecuteHandler(m.C0.SI,(()=>this.shiftIn())),this._parser.setExecuteHandler(m.C1.IND,(()=>this.index())),this._parser.setExecuteHandler(m.C1.NEL,(()=>this.nextLine())),this._parser.setExecuteHandler(m.C1.HTS,(()=>this.tabSet())),this._parser.registerOscHandler(0,new M.OscHandler(($=>(this.setTitle($),this.setIconName($),!0)))),this._parser.registerOscHandler(1,new M.OscHandler(($=>this.setIconName($)))),this._parser.registerOscHandler(2,new M.OscHandler(($=>this.setTitle($)))),this._parser.registerOscHandler(4,new M.OscHandler(($=>this.setOrReportIndexedColor($)))),this._parser.registerOscHandler(8,new M.OscHandler(($=>this.setHyperlink($)))),this._parser.registerOscHandler(10,new M.OscHandler(($=>this.setOrReportFgColor($)))),this._parser.registerOscHandler(11,new M.OscHandler(($=>this.setOrReportBgColor($)))),this._parser.registerOscHandler(12,new M.OscHandler(($=>this.setOrReportCursorColor($)))),this._parser.registerOscHandler(104,new M.OscHandler(($=>this.restoreIndexedColor($)))),this._parser.registerOscHandler(110,new M.OscHandler(($=>this.restoreFgColor($)))),this._parser.registerOscHandler(111,new M.OscHandler(($=>this.restoreBgColor($)))),this._parser.registerOscHandler(112,new M.OscHandler(($=>this.restoreCursorColor($)))),this._parser.registerEscHandler({final:"7"},(()=>this.saveCursor())),this._parser.registerEscHandler({final:"8"},(()=>this.restoreCursor())),this._parser.registerEscHandler({final:"D"},(()=>this.index())),this._parser.registerEscHandler({final:"E"},(()=>this.nextLine())),this._parser.registerEscHandler({final:"H"},(()=>this.tabSet())),this._parser.registerEscHandler({final:"M"},(()=>this.reverseIndex())),this._parser.registerEscHandler({final:"="},(()=>this.keypadApplicationMode())),this._parser.registerEscHandler({final:">"},(()=>this.keypadNumericMode())),this._parser.registerEscHandler({final:"c"},(()=>this.fullReset())),this._parser.registerEscHandler({final:"n"},(()=>this.setgLevel(2))),this._parser.registerEscHandler({final:"o"},(()=>this.setgLevel(3))),this._parser.registerEscHandler({final:"|"},(()=>this.setgLevel(3))),this._parser.registerEscHandler({final:"}"},(()=>this.setgLevel(2))),this._parser.registerEscHandler({final:"~"},(()=>this.setgLevel(1))),this._parser.registerEscHandler({intermediates:"%",final:"@"},(()=>this.selectDefaultCharset())),this._parser.registerEscHandler({intermediates:"%",final:"G"},(()=>this.selectDefaultCharset()));for(const $ in w.CHARSETS)this._parser.registerEscHandler({intermediates:"(",final:$},(()=>this.selectCharset("("+$))),this._parser.registerEscHandler({intermediates:")",final:$},(()=>this.selectCharset(")"+$))),this._parser.registerEscHandler({intermediates:"*",final:$},(()=>this.selectCharset("*"+$))),this._parser.registerEscHandler({intermediates:"+",final:$},(()=>this.selectCharset("+"+$))),this._parser.registerEscHandler({intermediates:"-",final:$},(()=>this.selectCharset("-"+$))),this._parser.registerEscHandler({intermediates:".",final:$},(()=>this.selectCharset("."+$))),this._parser.registerEscHandler({intermediates:"/",final:$},(()=>this.selectCharset("/"+$)));this._parser.registerEscHandler({intermediates:"#",final:"8"},(()=>this.screenAlignmentPattern())),this._parser.setErrorHandler(($=>(this._logService.error("Parsing error: ",$),$))),this._parser.registerDcsHandler({intermediates:"$",final:"q"},new T.DcsHandler((($,le)=>this.requestStatusString($,le))))}_preserveStack(D,H,O,P){this._parseStack.paused=!0,this._parseStack.cursorStartX=D,this._parseStack.cursorStartY=H,this._parseStack.decodedLength=O,this._parseStack.position=P}_logSlowResolvingAsync(D){this._logService.logLevel<=L.LogLevelEnum.WARN&&Promise.race([D,new Promise(((H,O)=>setTimeout((()=>O("#SLOW_TIMEOUT")),5e3)))]).catch((H=>{if(H!=="#SLOW_TIMEOUT")throw H;console.warn("async parser handler taking longer than 5000 ms")}))}_getCurrentLinkId(){return this._curAttrData.extended.urlId}parse(D,H){let O,P=this._activeBuffer.x,W=this._activeBuffer.y,Z=0;const ie=this._parseStack.paused;if(ie){if(O=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,H))return this._logSlowResolvingAsync(O),O;P=this._parseStack.cursorStartX,W=this._parseStack.cursorStartY,this._parseStack.paused=!1,D.length>F&&(Z=this._parseStack.position+F)}if(this._logService.logLevel<=L.LogLevelEnum.DEBUG&&this._logService.debug("parsing data"+(typeof D=="string"?` "${D}"`:` "${Array.prototype.map.call(D,($=>String.fromCharCode($))).join("")}"`),typeof D=="string"?D.split("").map(($=>$.charCodeAt(0))):D),this._parseBuffer.length<D.length&&this._parseBuffer.length<F&&(this._parseBuffer=new Uint32Array(Math.min(D.length,F))),ie||this._dirtyRowTracker.clearRange(),D.length>F)for(let $=Z;$<D.length;$+=F){const le=$+F<D.length?$+F:D.length,ge=typeof D=="string"?this._stringDecoder.decode(D.substring($,le),this._parseBuffer):this._utf8Decoder.decode(D.subarray($,le),this._parseBuffer);if(O=this._parser.parse(this._parseBuffer,ge))return this._preserveStack(P,W,ge,$),this._logSlowResolvingAsync(O),O}else if(!ie){const $=typeof D=="string"?this._stringDecoder.decode(D,this._parseBuffer):this._utf8Decoder.decode(D,this._parseBuffer);if(O=this._parser.parse(this._parseBuffer,$))return this._preserveStack(P,W,$,0),this._logSlowResolvingAsync(O),O}this._activeBuffer.x===P&&this._activeBuffer.y===W||this._onCursorMove.fire();const he=this._dirtyRowTracker.end+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp),te=this._dirtyRowTracker.start+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp);te<this._bufferService.rows&&this._onRequestRefreshRows.fire(Math.min(te,this._bufferService.rows-1),Math.min(he,this._bufferService.rows-1))}print(D,H,O){let P,W;const Z=this._charsetService.charset,ie=this._optionsService.rawOptions.screenReaderMode,he=this._bufferService.cols,te=this._coreService.decPrivateModes.wraparound,$=this._coreService.modes.insertMode,le=this._curAttrData;let ge=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._activeBuffer.x&&O-H>0&&ge.getWidth(this._activeBuffer.x-1)===2&&ge.setCellFromCodepoint(this._activeBuffer.x-1,0,1,le);let we=this._parser.precedingJoinState;for(let Se=H;Se<O;++Se){if(P=D[Se],P<127&&Z){const vt=Z[String.fromCharCode(P)];vt&&(P=vt.charCodeAt(0))}const je=this._unicodeService.charProperties(P,we);W=R.UnicodeService.extractWidth(je);const Ie=R.UnicodeService.extractShouldJoin(je),Ge=Ie?R.UnicodeService.extractWidth(we):0;if(we=je,ie&&this._onA11yChar.fire((0,E.stringFromCodePoint)(P)),this._getCurrentLinkId()&&this._oscLinkService.addLineToLink(this._getCurrentLinkId(),this._activeBuffer.ybase+this._activeBuffer.y),this._activeBuffer.x+W-Ge>he){if(te){const vt=ge;let Le=this._activeBuffer.x-Ge;for(this._activeBuffer.x=Ge,this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData(),!0)):(this._activeBuffer.y>=this._bufferService.rows&&(this._activeBuffer.y=this._bufferService.rows-1),this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!0),ge=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y),Ge>0&&ge instanceof f.BufferLine&&ge.copyCellsFrom(vt,Le,0,Ge,!1);Le<he;)vt.setCellFromCodepoint(Le++,0,1,le)}else if(this._activeBuffer.x=he-1,W===2)continue}if(Ie&&this._activeBuffer.x){const vt=ge.getWidth(this._activeBuffer.x-1)?1:2;ge.addCodepointToCell(this._activeBuffer.x-vt,P,W);for(let Le=W-Ge;--Le>=0;)ge.setCellFromCodepoint(this._activeBuffer.x++,0,0,le)}else if($&&(ge.insertCells(this._activeBuffer.x,W-Ge,this._activeBuffer.getNullCell(le)),ge.getWidth(he-1)===2&&ge.setCellFromCodepoint(he-1,p.NULL_CELL_CODE,p.NULL_CELL_WIDTH,le)),ge.setCellFromCodepoint(this._activeBuffer.x++,P,W,le),W>0)for(;--W;)ge.setCellFromCodepoint(this._activeBuffer.x++,0,0,le)}this._parser.precedingJoinState=we,this._activeBuffer.x<he&&O-H>0&&ge.getWidth(this._activeBuffer.x)===0&&!ge.hasContent(this._activeBuffer.x)&&ge.setCellFromCodepoint(this._activeBuffer.x,0,1,le),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler(D,H){return D.final!=="t"||D.prefix||D.intermediates?this._parser.registerCsiHandler(D,H):this._parser.registerCsiHandler(D,(O=>!G(O.params[0],this._optionsService.rawOptions.windowOptions)||H(O)))}registerDcsHandler(D,H){return this._parser.registerDcsHandler(D,new T.DcsHandler(H))}registerEscHandler(D,H){return this._parser.registerEscHandler(D,H)}registerOscHandler(D,H){return this._parser.registerOscHandler(D,new M.OscHandler(H))}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 D=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);D.hasWidth(this._activeBuffer.x)&&!D.hasContent(this._activeBuffer.x)&&this._activeBuffer.x--}return this._restrictCursor(),!0}tab(){if(this._activeBuffer.x>=this._bufferService.cols)return!0;const D=this._activeBuffer.x;return this._activeBuffer.x=this._activeBuffer.nextStop(),this._optionsService.rawOptions.screenReaderMode&&this._onA11yTab.fire(this._activeBuffer.x-D),!0}shiftOut(){return this._charsetService.setgLevel(1),!0}shiftIn(){return this._charsetService.setgLevel(0),!0}_restrictCursor(D=this._bufferService.cols-1){this._activeBuffer.x=Math.min(D,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(D,H){this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=D,this._activeBuffer.y=this._activeBuffer.scrollTop+H):(this._activeBuffer.x=D,this._activeBuffer.y=H),this._restrictCursor(),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_moveCursor(D,H){this._restrictCursor(),this._setCursor(this._activeBuffer.x+D,this._activeBuffer.y+H)}cursorUp(D){const H=this._activeBuffer.y-this._activeBuffer.scrollTop;return H>=0?this._moveCursor(0,-Math.min(H,D.params[0]||1)):this._moveCursor(0,-(D.params[0]||1)),!0}cursorDown(D){const H=this._activeBuffer.scrollBottom-this._activeBuffer.y;return H>=0?this._moveCursor(0,Math.min(H,D.params[0]||1)):this._moveCursor(0,D.params[0]||1),!0}cursorForward(D){return this._moveCursor(D.params[0]||1,0),!0}cursorBackward(D){return this._moveCursor(-(D.params[0]||1),0),!0}cursorNextLine(D){return this.cursorDown(D),this._activeBuffer.x=0,!0}cursorPrecedingLine(D){return this.cursorUp(D),this._activeBuffer.x=0,!0}cursorCharAbsolute(D){return this._setCursor((D.params[0]||1)-1,this._activeBuffer.y),!0}cursorPosition(D){return this._setCursor(D.length>=2?(D.params[1]||1)-1:0,(D.params[0]||1)-1),!0}charPosAbsolute(D){return this._setCursor((D.params[0]||1)-1,this._activeBuffer.y),!0}hPositionRelative(D){return this._moveCursor(D.params[0]||1,0),!0}linePosAbsolute(D){return this._setCursor(this._activeBuffer.x,(D.params[0]||1)-1),!0}vPositionRelative(D){return this._moveCursor(0,D.params[0]||1),!0}hVPosition(D){return this.cursorPosition(D),!0}tabClear(D){const H=D.params[0];return H===0?delete this._activeBuffer.tabs[this._activeBuffer.x]:H===3&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(D){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let H=D.params[0]||1;for(;H--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0}cursorBackwardTab(D){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let H=D.params[0]||1;for(;H--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0}selectProtected(D){const H=D.params[0];return H===1&&(this._curAttrData.bg|=536870912),H!==2&&H!==0||(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine(D,H,O,P=!1,W=!1){const Z=this._activeBuffer.lines.get(this._activeBuffer.ybase+D);Z.replaceCells(H,O,this._activeBuffer.getNullCell(this._eraseAttrData()),W),P&&(Z.isWrapped=!1)}_resetBufferLine(D,H=!1){const O=this._activeBuffer.lines.get(this._activeBuffer.ybase+D);O&&(O.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),H),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+D),O.isWrapped=!1)}eraseInDisplay(D,H=!1){let O;switch(this._restrictCursor(this._bufferService.cols),D.params[0]){case 0:for(O=this._activeBuffer.y,this._dirtyRowTracker.markDirty(O),this._eraseInBufferLine(O++,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,H);O<this._bufferService.rows;O++)this._resetBufferLine(O,H);this._dirtyRowTracker.markDirty(O);break;case 1:for(O=this._activeBuffer.y,this._dirtyRowTracker.markDirty(O),this._eraseInBufferLine(O,0,this._activeBuffer.x+1,!0,H),this._activeBuffer.x+1>=this._bufferService.cols&&(this._activeBuffer.lines.get(O+1).isWrapped=!1);O--;)this._resetBufferLine(O,H);this._dirtyRowTracker.markDirty(0);break;case 2:for(O=this._bufferService.rows,this._dirtyRowTracker.markDirty(O-1);O--;)this._resetBufferLine(O,H);this._dirtyRowTracker.markDirty(0);break;case 3:const P=this._activeBuffer.lines.length-this._bufferService.rows;P>0&&(this._activeBuffer.lines.trimStart(P),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-P,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-P,0),this._onScroll.fire(0))}return!0}eraseInLine(D,H=!1){switch(this._restrictCursor(this._bufferService.cols),D.params[0]){case 0:this._eraseInBufferLine(this._activeBuffer.y,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,H);break;case 1:this._eraseInBufferLine(this._activeBuffer.y,0,this._activeBuffer.x+1,!1,H);break;case 2:this._eraseInBufferLine(this._activeBuffer.y,0,this._bufferService.cols,!0,H)}return this._dirtyRowTracker.markDirty(this._activeBuffer.y),!0}insertLines(D){this._restrictCursor();let H=D.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const O=this._activeBuffer.ybase+this._activeBuffer.y,P=this._bufferService.rows-1-this._activeBuffer.scrollBottom,W=this._bufferService.rows-1+this._activeBuffer.ybase-P+1;for(;H--;)this._activeBuffer.lines.splice(W-1,1),this._activeBuffer.lines.splice(O,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}deleteLines(D){this._restrictCursor();let H=D.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const O=this._activeBuffer.ybase+this._activeBuffer.y;let P;for(P=this._bufferService.rows-1-this._activeBuffer.scrollBottom,P=this._bufferService.rows-1+this._activeBuffer.ybase-P;H--;)this._activeBuffer.lines.splice(O,1),this._activeBuffer.lines.splice(P,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}insertChars(D){this._restrictCursor();const H=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return H&&(H.insertCells(this._activeBuffer.x,D.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}deleteChars(D){this._restrictCursor();const H=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return H&&(H.deleteCells(this._activeBuffer.x,D.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}scrollUp(D){let H=D.params[0]||1;for(;H--;)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(D){let H=D.params[0]||1;for(;H--;)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(f.DEFAULT_ATTR_DATA));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollLeft(D){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const H=D.params[0]||1;for(let O=this._activeBuffer.scrollTop;O<=this._activeBuffer.scrollBottom;++O){const P=this._activeBuffer.lines.get(this._activeBuffer.ybase+O);P.deleteCells(0,H,this._activeBuffer.getNullCell(this._eraseAttrData())),P.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollRight(D){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const H=D.params[0]||1;for(let O=this._activeBuffer.scrollTop;O<=this._activeBuffer.scrollBottom;++O){const P=this._activeBuffer.lines.get(this._activeBuffer.ybase+O);P.insertCells(0,H,this._activeBuffer.getNullCell(this._eraseAttrData())),P.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}insertColumns(D){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const H=D.params[0]||1;for(let O=this._activeBuffer.scrollTop;O<=this._activeBuffer.scrollBottom;++O){const P=this._activeBuffer.lines.get(this._activeBuffer.ybase+O);P.insertCells(this._activeBuffer.x,H,this._activeBuffer.getNullCell(this._eraseAttrData())),P.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}deleteColumns(D){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const H=D.params[0]||1;for(let O=this._activeBuffer.scrollTop;O<=this._activeBuffer.scrollBottom;++O){const P=this._activeBuffer.lines.get(this._activeBuffer.ybase+O);P.deleteCells(this._activeBuffer.x,H,this._activeBuffer.getNullCell(this._eraseAttrData())),P.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}eraseChars(D){this._restrictCursor();const H=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return H&&(H.replaceCells(this._activeBuffer.x,this._activeBuffer.x+(D.params[0]||1),this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}repeatPrecedingCharacter(D){const H=this._parser.precedingJoinState;if(!H)return!0;const O=D.params[0]||1,P=R.UnicodeService.extractWidth(H),W=this._activeBuffer.x-P,Z=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).getString(W),ie=new Uint32Array(Z.length*O);let he=0;for(let $=0;$<Z.length;){const le=Z.codePointAt($)||0;ie[he++]=le,$+=le>65535?2:1}let te=he;for(let $=1;$<O;++$)ie.copyWithin(te,0,he),te+=he;return this.print(ie,0,te),!0}sendDeviceAttributesPrimary(D){return D.params[0]>0||(this._is("xterm")||this._is("rxvt-unicode")||this._is("screen")?this._coreService.triggerDataEvent(m.C0.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(m.C0.ESC+"[?6c")),!0}sendDeviceAttributesSecondary(D){return D.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(m.C0.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(m.C0.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(D.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(m.C0.ESC+"[>83;40003;0c")),!0}_is(D){return(this._optionsService.rawOptions.termName+"").indexOf(D)===0}setMode(D){for(let H=0;H<D.length;H++)switch(D.params[H]){case 4:this._coreService.modes.insertMode=!0;break;case 20:this._optionsService.options.convertEol=!0}return!0}setModePrivate(D){for(let H=0;H<D.length;H++)switch(D.params[H]){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(D){for(let H=0;H<D.length;H++)switch(D.params[H]){case 4:this._coreService.modes.insertMode=!1;break;case 20:this._optionsService.options.convertEol=!1}return!0}resetModePrivate(D){for(let H=0;H<D.length;H++)switch(D.params[H]){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(),D.params[H]===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(D,H){const O=this._coreService.decPrivateModes,{activeProtocol:P,activeEncoding:W}=this._coreMouseService,Z=this._coreService,{buffers:ie,cols:he}=this._bufferService,{active:te,alt:$}=ie,le=this._optionsService.rawOptions,ge=Ie=>Ie?1:2,we=D.params[0];return Se=we,je=H?we===2?4:we===4?ge(Z.modes.insertMode):we===12?3:we===20?ge(le.convertEol):0:we===1?ge(O.applicationCursorKeys):we===3?le.windowOptions.setWinLines?he===80?2:he===132?1:0:0:we===6?ge(O.origin):we===7?ge(O.wraparound):we===8?3:we===9?ge(P==="X10"):we===12?ge(le.cursorBlink):we===25?ge(!Z.isCursorHidden):we===45?ge(O.reverseWraparound):we===66?ge(O.applicationKeypad):we===67?4:we===1e3?ge(P==="VT200"):we===1002?ge(P==="DRAG"):we===1003?ge(P==="ANY"):we===1004?ge(O.sendFocus):we===1005?4:we===1006?ge(W==="SGR"):we===1015?4:we===1016?ge(W==="SGR_PIXELS"):we===1048?1:we===47||we===1047||we===1049?ge(te===$):we===2004?ge(O.bracketedPasteMode):0,Z.triggerDataEvent(`${m.C0.ESC}[${H?"":"?"}${Se};${je}$y`),!0;var Se,je}_updateAttrColor(D,H,O,P,W){return H===2?(D|=50331648,D&=-16777216,D|=k.AttributeData.fromColorRGB([O,P,W])):H===5&&(D&=-50331904,D|=33554432|255&O),D}_extractColor(D,H,O){const P=[0,0,-1,0,0,0];let W=0,Z=0;do{if(P[Z+W]=D.params[H+Z],D.hasSubParams(H+Z)){const ie=D.getSubParams(H+Z);let he=0;do P[1]===5&&(W=1),P[Z+he+1+W]=ie[he];while(++he<ie.length&&he+Z+1+W<P.length);break}if(P[1]===5&&Z+W>=2||P[1]===2&&Z+W>=5)break;P[1]&&(W=1)}while(++Z+H<D.length&&Z+W<P.length);for(let ie=2;ie<P.length;++ie)P[ie]===-1&&(P[ie]=0);switch(P[0]){case 38:O.fg=this._updateAttrColor(O.fg,P[1],P[3],P[4],P[5]);break;case 48:O.bg=this._updateAttrColor(O.bg,P[1],P[3],P[4],P[5]);break;case 58:O.extended=O.extended.clone(),O.extended.underlineColor=this._updateAttrColor(O.extended.underlineColor,P[1],P[3],P[4],P[5])}return Z}_processUnderline(D,H){H.extended=H.extended.clone(),(!~D||D>5)&&(D=1),H.extended.underlineStyle=D,H.fg|=268435456,D===0&&(H.fg&=-268435457),H.updateExtended()}_processSGR0(D){D.fg=f.DEFAULT_ATTR_DATA.fg,D.bg=f.DEFAULT_ATTR_DATA.bg,D.extended=D.extended.clone(),D.extended.underlineStyle=0,D.extended.underlineColor&=-67108864,D.updateExtended()}charAttributes(D){if(D.length===1&&D.params[0]===0)return this._processSGR0(this._curAttrData),!0;const H=D.length;let O;const P=this._curAttrData;for(let W=0;W<H;W++)O=D.params[W],O>=30&&O<=37?(P.fg&=-50331904,P.fg|=16777216|O-30):O>=40&&O<=47?(P.bg&=-50331904,P.bg|=16777216|O-40):O>=90&&O<=97?(P.fg&=-50331904,P.fg|=16777224|O-90):O>=100&&O<=107?(P.bg&=-50331904,P.bg|=16777224|O-100):O===0?this._processSGR0(P):O===1?P.fg|=134217728:O===3?P.bg|=67108864:O===4?(P.fg|=268435456,this._processUnderline(D.hasSubParams(W)?D.getSubParams(W)[0]:1,P)):O===5?P.fg|=536870912:O===7?P.fg|=67108864:O===8?P.fg|=1073741824:O===9?P.fg|=2147483648:O===2?P.bg|=134217728:O===21?this._processUnderline(2,P):O===22?(P.fg&=-134217729,P.bg&=-134217729):O===23?P.bg&=-67108865:O===24?(P.fg&=-268435457,this._processUnderline(0,P)):O===25?P.fg&=-536870913:O===27?P.fg&=-67108865:O===28?P.fg&=-1073741825:O===29?P.fg&=2147483647:O===39?(P.fg&=-67108864,P.fg|=16777215&f.DEFAULT_ATTR_DATA.fg):O===49?(P.bg&=-67108864,P.bg|=16777215&f.DEFAULT_ATTR_DATA.bg):O===38||O===48||O===58?W+=this._extractColor(D,W,P):O===53?P.bg|=1073741824:O===55?P.bg&=-1073741825:O===59?(P.extended=P.extended.clone(),P.extended.underlineColor=-1,P.updateExtended()):O===100?(P.fg&=-67108864,P.fg|=16777215&f.DEFAULT_ATTR_DATA.fg,P.bg&=-67108864,P.bg|=16777215&f.DEFAULT_ATTR_DATA.bg):this._logService.debug("Unknown SGR attribute: %d.",O);return!0}deviceStatus(D){switch(D.params[0]){case 5:this._coreService.triggerDataEvent(`${m.C0.ESC}[0n`);break;case 6:const H=this._activeBuffer.y+1,O=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${m.C0.ESC}[${H};${O}R`)}return!0}deviceStatusPrivate(D){if(D.params[0]===6){const H=this._activeBuffer.y+1,O=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${m.C0.ESC}[?${H};${O}R`)}return!0}softReset(D){return this._coreService.isCursorHidden=!1,this._onRequestSyncScrollBar.fire(),this._activeBuffer.scrollTop=0,this._activeBuffer.scrollBottom=this._bufferService.rows-1,this._curAttrData=f.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(D){const H=D.params[0]||1;switch(H){case 1:case 2:this._optionsService.options.cursorStyle="block";break;case 3:case 4:this._optionsService.options.cursorStyle="underline";break;case 5:case 6:this._optionsService.options.cursorStyle="bar"}const O=H%2==1;return this._optionsService.options.cursorBlink=O,!0}setScrollRegion(D){const H=D.params[0]||1;let O;return(D.length<2||(O=D.params[1])>this._bufferService.rows||O===0)&&(O=this._bufferService.rows),O>H&&(this._activeBuffer.scrollTop=H-1,this._activeBuffer.scrollBottom=O-1,this._setCursor(0,0)),!0}windowOptions(D){if(!G(D.params[0],this._optionsService.rawOptions.windowOptions))return!0;const H=D.length>1?D.params[1]:0;switch(D.params[0]){case 14:H!==2&&this._onRequestWindowsOptionsReport.fire(B.GET_WIN_SIZE_PIXELS);break;case 16:this._onRequestWindowsOptionsReport.fire(B.GET_CELL_SIZE_PIXELS);break;case 18:this._bufferService&&this._coreService.triggerDataEvent(`${m.C0.ESC}[8;${this._bufferService.rows};${this._bufferService.cols}t`);break;case 22:H!==0&&H!==2||(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>10&&this._windowTitleStack.shift()),H!==0&&H!==1||(this._iconNameStack.push(this._iconName),this._iconNameStack.length>10&&this._iconNameStack.shift());break;case 23:H!==0&&H!==2||this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),H!==0&&H!==1||this._iconNameStack.length&&this.setIconName(this._iconNameStack.pop())}return!0}saveCursor(D){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(D){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(D){return this._windowTitle=D,this._onTitleChange.fire(D),!0}setIconName(D){return this._iconName=D,!0}setOrReportIndexedColor(D){const H=[],O=D.split(";");for(;O.length>1;){const P=O.shift(),W=O.shift();if(/^\d+$/.exec(P)){const Z=parseInt(P);if(q(Z))if(W==="?")H.push({type:0,index:Z});else{const ie=(0,I.parseColor)(W);ie&&H.push({type:1,index:Z,color:ie})}}}return H.length&&this._onColor.fire(H),!0}setHyperlink(D){const H=D.split(";");return!(H.length<2)&&(H[1]?this._createHyperlink(H[0],H[1]):!H[0]&&this._finishHyperlink())}_createHyperlink(D,H){this._getCurrentLinkId()&&this._finishHyperlink();const O=D.split(":");let P;const W=O.findIndex((Z=>Z.startsWith("id=")));return W!==-1&&(P=O[W].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:P,uri:H}),this._curAttrData.updateExtended(),!0}_finishHyperlink(){return this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=0,this._curAttrData.updateExtended(),!0}_setOrReportSpecialColor(D,H){const O=D.split(";");for(let P=0;P<O.length&&!(H>=this._specialColors.length);++P,++H)if(O[P]==="?")this._onColor.fire([{type:0,index:this._specialColors[H]}]);else{const W=(0,I.parseColor)(O[P]);W&&this._onColor.fire([{type:1,index:this._specialColors[H],color:W}])}return!0}setOrReportFgColor(D){return this._setOrReportSpecialColor(D,0)}setOrReportBgColor(D){return this._setOrReportSpecialColor(D,1)}setOrReportCursorColor(D){return this._setOrReportSpecialColor(D,2)}restoreIndexedColor(D){if(!D)return this._onColor.fire([{type:2}]),!0;const H=[],O=D.split(";");for(let P=0;P<O.length;++P)if(/^\d+$/.exec(O[P])){const W=parseInt(O[P]);q(W)&&H.push({type:2,index:W})}return H.length&&this._onColor.fire(H),!0}restoreFgColor(D){return this._onColor.fire([{type:2,index:256}]),!0}restoreBgColor(D){return this._onColor.fire([{type:2,index:257}]),!0}restoreCursorColor(D){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(D){return D.length!==2?(this.selectDefaultCharset(),!0):(D[0]==="/"||this._charsetService.setgCharset(K[D[0]],w.CHARSETS[D[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 D=this._activeBuffer.scrollBottom-this._activeBuffer.scrollTop;this._activeBuffer.lines.shiftElements(this._activeBuffer.ybase+this._activeBuffer.y,D,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=f.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=f.DEFAULT_ATTR_DATA.clone()}_eraseAttrData(){return this._eraseAttrDataInternal.bg&=-67108864,this._eraseAttrDataInternal.bg|=67108863&this._curAttrData.bg,this._eraseAttrDataInternal}setgLevel(D){return this._charsetService.setgLevel(D),!0}screenAlignmentPattern(){const D=new S.CellData;D.content=4194373,D.fg=this._curAttrData.fg,D.bg=this._curAttrData.bg,this._setCursor(0,0);for(let H=0;H<this._bufferService.rows;++H){const O=this._activeBuffer.ybase+this._activeBuffer.y+H,P=this._activeBuffer.lines.get(O);P&&(P.fill(D),P.isWrapped=!1)}return this._dirtyRowTracker.markAllDirty(),this._setCursor(0,0),!0}requestStatusString(D,H){const O=this._bufferService.buffer,P=this._optionsService.rawOptions;return(W=>(this._coreService.triggerDataEvent(`${m.C0.ESC}${W}${m.C0.ESC}\\`),!0))(D==='"q'?`P1$r${this._curAttrData.isProtected()?1:0}"q`:D==='"p'?'P1$r61;1"p':D==="r"?`P1$r${O.scrollTop+1};${O.scrollBottom+1}r`:D==="m"?"P1$r0m":D===" q"?`P1$r${{block:2,underline:4,bar:6}[P.cursorStyle]-(P.cursorBlink?1:0)} q`:"P0$r")}markRangeDirty(D,H){this._dirtyRowTracker.markRangeDirty(D,H)}}c.InputHandler=Y;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,D){V>D&&(X=V,V=D,D=X),V<this.start&&(this.start=V),D>this.end&&(this.end=D)}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 u(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=u,c.getDisposeArrayDisposable=function(d){return{dispose:()=>u(d)}}},1505:(_,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.FourKeyMap=c.TwoKeyMap=void 0;class u{constructor(){this._data={}}set(y,m,w){this._data[y]||(this._data[y]={}),this._data[y][m]=w}get(y,m){return this._data[y]?this._data[y][m]:void 0}clear(){this._data={}}}c.TwoKeyMap=u,c.FourKeyMap=class{constructor(){this._data=new u}set(d,y,m,w,C){this._data.get(d,y)||this._data.set(d,y,new u),this._data.get(d,y).set(m,w,C)}get(d,y,m,w){return this._data.get(d,y)?.get(m,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 u=c.isNode?"node":navigator.userAgent,d=c.isNode?"node":navigator.platform;c.isFirefox=u.includes("Firefox"),c.isLegacyEdge=u.includes("Edge"),c.isSafari=/^((?!chrome|android).)*safari/i.test(u),c.getSafariVersion=function(){if(!c.isSafari)return 0;const y=u.match(/Version\/(\d+)/);return y===null||y.length<2?0:parseInt(y[1])},c.isMac=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(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(u)},6106:(_,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.SortedList=void 0;let u=0;c.SortedList=class{constructor(d){this._getKey=d,this._array=[]}clear(){this._array.length=0}insert(d){this._array.length!==0?(u=this._search(this._getKey(d)),this._array.splice(u,0,d)):this._array.push(d)}delete(d){if(this._array.length===0)return!1;const y=this._getKey(d);if(y===void 0||(u=this._search(y),u===-1)||this._getKey(this._array[u])!==y)return!1;do if(this._array[u]===d)return this._array.splice(u,1),!0;while(++u<this._array.length&&this._getKey(this._array[u])===y);return!1}*getKeyIterator(d){if(this._array.length!==0&&(u=this._search(d),!(u<0||u>=this._array.length)&&this._getKey(this._array[u])===d))do yield this._array[u];while(++u<this._array.length&&this._getKey(this._array[u])===d)}forEachByKey(d,y){if(this._array.length!==0&&(u=this._search(d),!(u<0||u>=this._array.length)&&this._getKey(this._array[u])===d))do y(this._array[u]);while(++u<this._array.length&&this._getKey(this._array[u])===d)}values(){return[...this._array].values()}_search(d){let y=0,m=this._array.length-1;for(;m>=y;){let w=y+m>>1;const C=this._getKey(this._array[w]);if(C>d)m=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,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.DebouncedIdleTask=c.IdleTaskQueue=c.PriorityTaskQueue=void 0;const d=u(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 A=0,E=0,f=C.timeRemaining(),v=0;for(;this._i<this._tasks.length;){if(A=Date.now(),this._tasks[this._i]()||this._i++,A=Math.max(1,Date.now()-A),E=Math.max(A,E),v=C.timeRemaining(),1.5*E>v)return f-A<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(f-A))}ms`),void this._start();f=v}this.clear()}}class m extends y{_requestCallback(C){return setTimeout((()=>C(this._createDeadline(16))))}_cancelCallback(C){clearTimeout(C)}_createDeadline(C){const A=Date.now()+C;return{timeRemaining:()=>Math.max(0,A-Date.now())}}}c.PriorityTaskQueue=m,c.IdleTaskQueue=!d.isNode&&"requestIdleCallback"in window?class extends y{_requestCallback(w){return requestIdleCallback(w)}_cancelCallback(w){cancelIdleCallback(w)}}:m,c.DebouncedIdleTask=class{constructor(){this._queue=new c.IdleTaskQueue}set(w){this._queue.clear(),this._queue.enqueue(w)}flush(){this._queue.flush()}}},9282:(_,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.updateWindowsModeWrappedState=void 0;const d=u(643);c.updateWindowsModeWrappedState=function(y){const m=y.buffer.lines.get(y.buffer.ybase+y.buffer.y-1),w=m?.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 u{constructor(){this.fg=0,this.bg=0,this.extended=new d}static toColorRGB(m){return[m>>>16&255,m>>>8&255,255&m]}static fromColorRGB(m){return(255&m[0])<<16|(255&m[1])<<8|255&m[2]}clone(){const m=new u;return m.fg=this.fg,m.bg=this.bg,m.extended=this.extended.clone(),m}isInverse(){return 67108864&this.fg}isBold(){return 134217728&this.fg}isUnderline(){return this.hasExtendedAttrs()&&this.extended.underlineStyle!==0?1:268435456&this.fg}isBlink(){return 536870912&this.fg}isInvisible(){return 1073741824&this.fg}isItalic(){return 67108864&this.bg}isDim(){return 134217728&this.bg}isStrikethrough(){return 2147483648&this.fg}isProtected(){return 536870912&this.bg}isOverline(){return 1073741824&this.bg}getFgColorMode(){return 50331648&this.fg}getBgColorMode(){return 50331648&this.bg}isFgRGB(){return(50331648&this.fg)==50331648}isBgRGB(){return(50331648&this.bg)==50331648}isFgPalette(){return(50331648&this.fg)==16777216||(50331648&this.fg)==33554432}isBgPalette(){return(50331648&this.bg)==16777216||(50331648&this.bg)==33554432}isFgDefault(){return(50331648&this.fg)==0}isBgDefault(){return(50331648&this.bg)==0}isAttributeDefault(){return this.fg===0&&this.bg===0}getFgColor(){switch(50331648&this.fg){case 16777216:case 33554432:return 255&this.fg;case 50331648:return 16777215&this.fg;default:return-1}}getBgColor(){switch(50331648&this.bg){case 16777216:case 33554432:return 255&this.bg;case 50331648:return 16777215&this.bg;default:return-1}}hasExtendedAttrs(){return 268435456&this.bg}updateExtended(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456}getUnderlineColor(){if(268435456&this.bg&&~this.extended.underlineColor)switch(50331648&this.extended.underlineColor){case 16777216:case 33554432:return 255&this.extended.underlineColor;case 50331648:return 16777215&this.extended.underlineColor;default:return this.getFgColor()}return this.getFgColor()}getUnderlineColorMode(){return 268435456&this.bg&&~this.extended.underlineColor?50331648&this.extended.underlineColor:this.getFgColorMode()}isUnderlineColorRGB(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==50331648:this.isFgRGB()}isUnderlineColorPalette(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==16777216||(50331648&this.extended.underlineColor)==33554432:this.isFgPalette()}isUnderlineColorDefault(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==0:this.isFgDefault()}getUnderlineStyle(){return 268435456&this.fg?268435456&this.bg?this.extended.underlineStyle:1:0}getUnderlineVariantOffset(){return this.extended.underlineVariantOffset}}c.AttributeData=u;class d{get ext(){return this._urlId?-469762049&this._ext|this.underlineStyle<<26:this._ext}set ext(m){this._ext=m}get underlineStyle(){return this._urlId?5:(469762048&this._ext)>>26}set underlineStyle(m){this._ext&=-469762049,this._ext|=m<<26&469762048}get underlineColor(){return 67108863&this._ext}set underlineColor(m){this._ext&=-67108864,this._ext|=67108863&m}get urlId(){return this._urlId}set urlId(m){this._urlId=m}get underlineVariantOffset(){const m=(3758096384&this._ext)>>29;return m<0?4294967288^m:m}set underlineVariantOffset(m){this._ext&=536870911,this._ext|=m<<29&3758096384}constructor(m=0,w=0){this._ext=0,this._urlId=0,this._ext=m,this._urlId=w}clone(){return new d(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}}c.ExtendedAttrs=d},9092:(_,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.Buffer=c.MAX_BUFFER_SIZE=void 0;const d=u(6349),y=u(7226),m=u(3734),w=u(8437),C=u(4634),A=u(511),E=u(643),f=u(4863),v=u(7116);c.MAX_BUFFER_SIZE=4294967295,c.Buffer=class{constructor(p,S,k){this._hasScrollback=p,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=A.CellData.fromCharData([0,E.NULL_CELL_CHAR,E.NULL_CELL_WIDTH,E.NULL_CELL_CODE]),this._whitespaceCell=A.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(p){return p?(this._nullCell.fg=p.fg,this._nullCell.bg=p.bg,this._nullCell.extended=p.extended):(this._nullCell.fg=0,this._nullCell.bg=0,this._nullCell.extended=new m.ExtendedAttrs),this._nullCell}getWhitespaceCell(p){return p?(this._whitespaceCell.fg=p.fg,this._whitespaceCell.bg=p.bg,this._whitespaceCell.extended=p.extended):(this._whitespaceCell.fg=0,this._whitespaceCell.bg=0,this._whitespaceCell.extended=new m.ExtendedAttrs),this._whitespaceCell}getBlankLine(p,S){return new w.BufferLine(this._bufferService.cols,this.getNullCell(p),S)}get hasScrollback(){return this._hasScrollback&&this.lines.maxLength>this._rows}get isCursorInViewport(){const p=this.ybase+this.y-this.ydisp;return p>=0&&p<this._rows}_getCorrectBufferLength(p){if(!this._hasScrollback)return p;const S=p+this._optionsService.rawOptions.scrollback;return S>c.MAX_BUFFER_SIZE?c.MAX_BUFFER_SIZE:S}fillViewportRows(p){if(this.lines.length===0){p===void 0&&(p=w.DEFAULT_ATTR_DATA);let S=this._rows;for(;S--;)this.lines.push(this.getBlankLine(p))}}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(p,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<p)for(let T=0;T<this.lines.length;T++)L+=+this.lines.get(T).resize(p,k);let M=0;if(this._rows<S)for(let T=this._rows;T<S;T++)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(p,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(p,k)));else for(let T=this._rows;T>S;T--)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 T=this.lines.length-R;T>0&&(this.lines.trimStart(T),this.ybase=Math.max(this.ybase-T,0),this.ydisp=Math.max(this.ydisp-T,0),this.savedY=Math.max(this.savedY-T,0)),this.lines.maxLength=R}this.x=Math.min(this.x,p-1),this.y=Math.min(this.y,S-1),M&&(this.y+=M),this.savedX=Math.min(this.savedX,p-1),this.scrollTop=0}if(this.scrollBottom=S-1,this._isReflowEnabled&&(this._reflow(p,S),this._cols>p))for(let M=0;M<this.lines.length;M++)L+=+this.lines.get(M).resize(p,k);this._cols=p,this._rows=S,this._memoryCleanupQueue.clear(),L>.1*this.lines.length&&(this._memoryCleanupPosition=0,this._memoryCleanupQueue.enqueue((()=>this._batchedMemoryCleanup())))}_batchedMemoryCleanup(){let p=!0;this._memoryCleanupPosition>=this.lines.length&&(this._memoryCleanupPosition=0,p=!1);let S=0;for(;this._memoryCleanupPosition<this.lines.length;)if(S+=this.lines.get(this._memoryCleanupPosition++).cleanupMemory(),S>100)return!0;return p}get _isReflowEnabled(){const p=this._optionsService.rawOptions.windowsPty;return p&&p.buildNumber?this._hasScrollback&&p.backend==="conpty"&&p.buildNumber>=21376:this._hasScrollback&&!this._optionsService.rawOptions.windowsMode}_reflow(p,S){this._cols!==p&&(p>this._cols?this._reflowLarger(p,S):this._reflowSmaller(p,S))}_reflowLarger(p,S){const k=(0,C.reflowLargerGetLinesToRemove)(this.lines,this._cols,p,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(p,S,L.countRemoved)}}_reflowLargerAdjustViewport(p,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(p,L))):(this.ydisp===this.ybase&&this.ydisp--,this.ybase--);this.savedY=Math.max(this.savedY-k,0)}_reflowSmaller(p,S){const k=this.getNullCell(w.DEFAULT_ATTR_DATA),L=[];let R=0;for(let M=this.lines.length-1;M>=0;M--){let T=this.lines.get(M);if(!T||!T.isWrapped&&T.getTrimmedLength()<=p)continue;const I=[T];for(;T.isWrapped&&M>0;)T=this.lines.get(--M),I.unshift(T);const K=this.ybase+this.y;if(K>=M&&K<M+I.length)continue;const F=I[I.length-1].getTrimmedLength(),G=(0,C.reflowSmallerGetNewLineLengths)(I,this._cols,p),B=G.length-I.length;let X;X=this.ybase===0&&this.y!==this.lines.length-1?Math.max(0,this.y-this.lines.maxLength+B):Math.max(0,this.lines.length-this.lines.maxLength+B);const Y=[];for(let O=0;O<B;O++){const P=this.getBlankLine(w.DEFAULT_ATTR_DATA,!0);Y.push(P)}Y.length>0&&(L.push({start:M+I.length+R,newLines:Y}),R+=Y.length),I.push(...Y);let z=G.length-1,q=G[z];q===0&&(z--,q=G[z]);let V=I.length-B-1,D=F;for(;V>=0;){const O=Math.min(D,q);if(I[z]===void 0)break;if(I[z].copyCellsFrom(I[V],D-O,q-O,O,!0),q-=O,q===0&&(z--,q=G[z]),D-=O,D===0){V--;const P=Math.max(V,0);D=(0,C.getWrappedLineTrimmedLength)(I,P,this._cols)}}for(let O=0;O<I.length;O++)G[O]<p&&I[O].setCell(G[O],k);let H=B-X;for(;H-- >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+B,this.ybase+S-1)}if(L.length>0){const M=[],T=[];for(let z=0;z<this.lines.length;z++)T.push(this.lines.get(z));const I=this.lines.length;let K=I-1,F=0,G=L[F];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+R);let B=0;for(let z=Math.min(this.lines.maxLength-1,I+R-1);z>=0;z--)if(G&&G.start>K+B){for(let q=G.newLines.length-1;q>=0;q--)this.lines.set(z--,G.newLines[q]);z++,M.push({index:K+1,amount:G.newLines.length}),B+=G.newLines.length,G=L[++F]}else this.lines.set(z,T[K--]);let X=0;for(let z=M.length-1;z>=0;z--)M[z].index+=X,this.lines.onInsertEmitter.fire(M[z]),X+=M[z].amount;const Y=Math.max(0,I+R-this.lines.maxLength);Y>0&&this.lines.onTrimEmitter.fire(Y)}}translateBufferLineToString(p,S,k=0,L){const R=this.lines.get(p);return R?R.translateToString(S,k,L):""}getWrappedRangeForLine(p){let S=p,k=p;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(p){for(p!=null?this.tabs[p]||(p=this.prevStop(p)):(this.tabs={},p=0);p<this._cols;p+=this._optionsService.rawOptions.tabStopWidth)this.tabs[p]=!0}prevStop(p){for(p==null&&(p=this.x);!this.tabs[--p]&&p>0;);return p>=this._cols?this._cols-1:p<0?0:p}nextStop(p){for(p==null&&(p=this.x);!this.tabs[++p]&&p<this._cols;);return p>=this._cols?this._cols-1:p<0?0:p}clearMarkers(p){this._isClearing=!0;for(let S=0;S<this.markers.length;S++)this.markers[S].line===p&&(this.markers[S].dispose(),this.markers.splice(S--,1));this._isClearing=!1}clearAllMarkers(){this._isClearing=!0;for(let p=0;p<this.markers.length;p++)this.markers[p].dispose(),this.markers.splice(p--,1);this._isClearing=!1}addMarker(p){const S=new f.Marker(p);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(p){this._isClearing||this.markers.splice(this.markers.indexOf(p),1)}}},8437:(_,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.BufferLine=c.DEFAULT_ATTR_DATA=void 0;const d=u(3734),y=u(511),m=u(643),w=u(482);c.DEFAULT_ATTR_DATA=Object.freeze(new d.AttributeData);let C=0;class A{constructor(f,v,p=!1){this.isWrapped=p,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(3*f);const S=v||y.CellData.fromCharData([0,m.NULL_CELL_CHAR,m.NULL_CELL_WIDTH,m.NULL_CELL_CODE]);for(let k=0;k<f;++k)this.setCell(k,S);this.length=f}get(f){const v=this._data[3*f+0],p=2097151&v;return[this._data[3*f+1],2097152&v?this._combined[f]:p?(0,w.stringFromCodePoint)(p):"",v>>22,2097152&v?this._combined[f].charCodeAt(this._combined[f].length-1):p]}set(f,v){this._data[3*f+1]=v[m.CHAR_DATA_ATTR_INDEX],v[m.CHAR_DATA_CHAR_INDEX].length>1?(this._combined[f]=v[1],this._data[3*f+0]=2097152|f|v[m.CHAR_DATA_WIDTH_INDEX]<<22):this._data[3*f+0]=v[m.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|v[m.CHAR_DATA_WIDTH_INDEX]<<22}getWidth(f){return this._data[3*f+0]>>22}hasWidth(f){return 12582912&this._data[3*f+0]}getFg(f){return this._data[3*f+1]}getBg(f){return this._data[3*f+2]}hasContent(f){return 4194303&this._data[3*f+0]}getCodePoint(f){const v=this._data[3*f+0];return 2097152&v?this._combined[f].charCodeAt(this._combined[f].length-1):2097151&v}isCombined(f){return 2097152&this._data[3*f+0]}getString(f){const v=this._data[3*f+0];return 2097152&v?this._combined[f]:2097151&v?(0,w.stringFromCodePoint)(2097151&v):""}isProtected(f){return 536870912&this._data[3*f+2]}loadCell(f,v){return C=3*f,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[f]),268435456&v.bg&&(v.extended=this._extendedAttrs[f]),v}setCell(f,v){2097152&v.content&&(this._combined[f]=v.combinedData),268435456&v.bg&&(this._extendedAttrs[f]=v.extended),this._data[3*f+0]=v.content,this._data[3*f+1]=v.fg,this._data[3*f+2]=v.bg}setCellFromCodepoint(f,v,p,S){268435456&S.bg&&(this._extendedAttrs[f]=S.extended),this._data[3*f+0]=v|p<<22,this._data[3*f+1]=S.fg,this._data[3*f+2]=S.bg}addCodepointToCell(f,v,p){let S=this._data[3*f+0];2097152&S?this._combined[f]+=(0,w.stringFromCodePoint)(v):2097151&S?(this._combined[f]=(0,w.stringFromCodePoint)(2097151&S)+(0,w.stringFromCodePoint)(v),S&=-2097152,S|=2097152):S=v|4194304,p&&(S&=-12582913,S|=p<<22),this._data[3*f+0]=S}insertCells(f,v,p){if((f%=this.length)&&this.getWidth(f-1)===2&&this.setCellFromCodepoint(f-1,0,1,p),v<this.length-f){const S=new y.CellData;for(let k=this.length-f-v-1;k>=0;--k)this.setCell(f+v+k,this.loadCell(f+k,S));for(let k=0;k<v;++k)this.setCell(f+k,p)}else for(let S=f;S<this.length;++S)this.setCell(S,p);this.getWidth(this.length-1)===2&&this.setCellFromCodepoint(this.length-1,0,1,p)}deleteCells(f,v,p){if(f%=this.length,v<this.length-f){const S=new y.CellData;for(let k=0;k<this.length-f-v;++k)this.setCell(f+k,this.loadCell(f+v+k,S));for(let k=this.length-v;k<this.length;++k)this.setCell(k,p)}else for(let S=f;S<this.length;++S)this.setCell(S,p);f&&this.getWidth(f-1)===2&&this.setCellFromCodepoint(f-1,0,1,p),this.getWidth(f)!==0||this.hasContent(f)||this.setCellFromCodepoint(f,0,1,p)}replaceCells(f,v,p,S=!1){if(S)for(f&&this.getWidth(f-1)===2&&!this.isProtected(f-1)&&this.setCellFromCodepoint(f-1,0,1,p),v<this.length&&this.getWidth(v-1)===2&&!this.isProtected(v)&&this.setCellFromCodepoint(v,0,1,p);f<v&&f<this.length;)this.isProtected(f)||this.setCell(f,p),f++;else for(f&&this.getWidth(f-1)===2&&this.setCellFromCodepoint(f-1,0,1,p),v<this.length&&this.getWidth(v-1)===2&&this.setCellFromCodepoint(v,0,1,p);f<v&&f<this.length;)this.setCell(f++,p)}resize(f,v){if(f===this.length)return 4*this._data.length*2<this._data.buffer.byteLength;const p=3*f;if(f>this.length){if(this._data.buffer.byteLength>=4*p)this._data=new Uint32Array(this._data.buffer,0,p);else{const S=new Uint32Array(p);S.set(this._data),this._data=S}for(let S=this.length;S<f;++S)this.setCell(S,v)}else{this._data=this._data.subarray(0,p);const S=Object.keys(this._combined);for(let L=0;L<S.length;L++){const R=parseInt(S[L],10);R>=f&&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>=f&&delete this._extendedAttrs[R]}}return this.length=f,4*p*2<this._data.buffer.byteLength}cleanupMemory(){if(4*this._data.length*2<this._data.buffer.byteLength){const f=new Uint32Array(this._data.length);return f.set(this._data),this._data=f,1}return 0}fill(f,v=!1){if(v)for(let p=0;p<this.length;++p)this.isProtected(p)||this.setCell(p,f);else{this._combined={},this._extendedAttrs={};for(let p=0;p<this.length;++p)this.setCell(p,f)}}copyFrom(f){this.length!==f.length?this._data=new Uint32Array(f._data):this._data.set(f._data),this.length=f.length,this._combined={};for(const v in f._combined)this._combined[v]=f._combined[v];this._extendedAttrs={};for(const v in f._extendedAttrs)this._extendedAttrs[v]=f._extendedAttrs[v];this.isWrapped=f.isWrapped}clone(){const f=new A(0);f._data=new Uint32Array(this._data),f.length=this.length;for(const v in this._combined)f._combined[v]=this._combined[v];for(const v in this._extendedAttrs)f._extendedAttrs[v]=this._extendedAttrs[v];return f.isWrapped=this.isWrapped,f}getTrimmedLength(){for(let f=this.length-1;f>=0;--f)if(4194303&this._data[3*f+0])return f+(this._data[3*f+0]>>22);return 0}getNoBgTrimmedLength(){for(let f=this.length-1;f>=0;--f)if(4194303&this._data[3*f+0]||50331648&this._data[3*f+2])return f+(this._data[3*f+0]>>22);return 0}copyCellsFrom(f,v,p,S,k){const L=f._data;if(k)for(let M=S-1;M>=0;M--){for(let T=0;T<3;T++)this._data[3*(p+M)+T]=L[3*(v+M)+T];268435456&L[3*(v+M)+2]&&(this._extendedAttrs[p+M]=f._extendedAttrs[v+M])}else for(let M=0;M<S;M++){for(let T=0;T<3;T++)this._data[3*(p+M)+T]=L[3*(v+M)+T];268435456&L[3*(v+M)+2]&&(this._extendedAttrs[p+M]=f._extendedAttrs[v+M])}const R=Object.keys(f._combined);for(let M=0;M<R.length;M++){const T=parseInt(R[M],10);T>=v&&(this._combined[T-v+p]=f._combined[T])}}translateToString(f,v,p,S){v=v??0,p=p??this.length,f&&(p=Math.min(p,this.getTrimmedLength())),S&&(S.length=0);let k="";for(;v<p;){const L=this._data[3*v+0],R=2097151&L,M=2097152&L?this._combined[v]:R?(0,w.stringFromCodePoint)(R):m.WHITESPACE_CELL_CHAR;if(k+=M,S)for(let T=0;T<M.length;++T)S.push(v);v+=L>>22||1}return S&&S.push(v),k}}c.BufferLine=A},4841:(_,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.getRangeLength=void 0,c.getRangeLength=function(u,d){if(u.start.y>u.end.y)throw new Error(`Buffer range end (${u.end.x}, ${u.end.y}) cannot be before start (${u.start.x}, ${u.start.y})`);return d*(u.end.y-u.start.y)+(u.end.x-u.start.x+1)}},4634:(_,c)=>{function u(d,y,m){if(y===d.length-1)return d[y].getTrimmedLength();const w=!d[y].hasContent(m-1)&&d[y].getWidth(m-1)===1,C=d[y+1].getWidth(0)===2;return w&&C?m-1:m}Object.defineProperty(c,"__esModule",{value:!0}),c.getWrappedLineTrimmedLength=c.reflowSmallerGetNewLineLengths=c.reflowLargerApplyNewLayout=c.reflowLargerCreateNewLayout=c.reflowLargerGetLinesToRemove=void 0,c.reflowLargerGetLinesToRemove=function(d,y,m,w,C){const A=[];for(let E=0;E<d.length-1;E++){let f=E,v=d.get(++f);if(!v.isWrapped)continue;const p=[d.get(E)];for(;f<d.length&&v.isWrapped;)p.push(v),v=d.get(++f);if(w>=E&&w<f){E+=p.length-1;continue}let S=0,k=u(p,S,y),L=1,R=0;for(;L<p.length;){const T=u(p,L,y),I=T-R,K=m-k,F=Math.min(I,K);p[S].copyCellsFrom(p[L],R,k,F,!1),k+=F,k===m&&(S++,k=0),R+=F,R===T&&(L++,R=0),k===0&&S!==0&&p[S-1].getWidth(m-1)===2&&(p[S].copyCellsFrom(p[S-1],m-1,k++,1,!1),p[S-1].setCell(m-1,C))}p[S].replaceCells(k,m,C);let M=0;for(let T=p.length-1;T>0&&(T>S||p[T].getTrimmedLength()===0);T--)M++;M>0&&(A.push(E+p.length-M),A.push(M)),E+=p.length-1}return A},c.reflowLargerCreateNewLayout=function(d,y){const m=[];let w=0,C=y[w],A=0;for(let E=0;E<d.length;E++)if(C===E){const f=y[++w];d.onDeleteEmitter.fire({index:E-A,amount:f}),E+=f-1,A+=f,C=y[++w]}else m.push(E);return{layout:m,countRemoved:A}},c.reflowLargerApplyNewLayout=function(d,y){const m=[];for(let w=0;w<y.length;w++)m.push(d.get(y[w]));for(let w=0;w<m.length;w++)d.set(w,m[w]);d.length=y.length},c.reflowSmallerGetNewLineLengths=function(d,y,m){const w=[],C=d.map(((v,p)=>u(d,p,y))).reduce(((v,p)=>v+p));let A=0,E=0,f=0;for(;f<C;){if(C-f<m){w.push(C-f);break}A+=m;const v=u(d,E,y);A>v&&(A-=v,E++);const p=d[E].getWidth(A-1)===2;p&&A--;const S=p?m-1:m;w.push(S),f+=S}return w},c.getWrappedLineTrimmedLength=u},5295:(_,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.BufferSet=void 0;const d=u(8460),y=u(844),m=u(9092);class w extends y.Disposable{constructor(A,E){super(),this._optionsService=A,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 m.Buffer(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new m.Buffer(!1,this._optionsService,this._bufferService),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}),this.setupTabStops()}get alt(){return this._alt}get active(){return this._activeBuffer}get normal(){return this._normal}activateNormalBuffer(){this._activeBuffer!==this._normal&&(this._normal.x=this._alt.x,this._normal.y=this._alt.y,this._alt.clearAllMarkers(),this._alt.clear(),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}))}activateAltBuffer(A){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(A),this._alt.x=this._normal.x,this._alt.y=this._normal.y,this._activeBuffer=this._alt,this._onBufferActivate.fire({activeBuffer:this._alt,inactiveBuffer:this._normal}))}resize(A,E){this._normal.resize(A,E),this._alt.resize(A,E),this.setupTabStops(A)}setupTabStops(A){this._normal.setupTabStops(A),this._alt.setupTabStops(A)}}c.BufferSet=w},511:(_,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.CellData=void 0;const d=u(482),y=u(643),m=u(3734);class w extends m.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new m.ExtendedAttrs,this.combinedData=""}static fromCharData(A){const E=new w;return E.setFromCharData(A),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(A){this.fg=A[y.CHAR_DATA_ATTR_INDEX],this.bg=0;let E=!1;if(A[y.CHAR_DATA_CHAR_INDEX].length>2)E=!0;else if(A[y.CHAR_DATA_CHAR_INDEX].length===2){const f=A[y.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=f&&f<=56319){const v=A[y.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=v&&v<=57343?this.content=1024*(f-55296)+v-56320+65536|A[y.CHAR_DATA_WIDTH_INDEX]<<22:E=!0}else E=!0}else this.content=A[y.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|A[y.CHAR_DATA_WIDTH_INDEX]<<22;E&&(this.combinedData=A[y.CHAR_DATA_CHAR_INDEX],this.content=2097152|A[y.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}c.CellData=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,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.Marker=void 0;const d=u(8460),y=u(844);class m{get id(){return this._id}constructor(C){this.line=C,this.isDisposed=!1,this._disposables=[],this._id=m._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=m,m._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 u,d,y;Object.defineProperty(c,"__esModule",{value:!0}),c.C1_ESCAPED=c.C1=c.C0=void 0,(function(m){m.NUL="\0",m.SOH="",m.STX="",m.ETX="",m.EOT="",m.ENQ="",m.ACK="",m.BEL="\x07",m.BS="\b",m.HT=" ",m.LF=`
|
|
81
|
-
`,m.VT="\v",m.FF="\f",m.CR="\r",m.SO="",m.SI="",m.DLE="",m.DC1="",m.DC2="",m.DC3="",m.DC4="",m.NAK="",m.SYN="",m.ETB="",m.CAN="",m.EM="",m.SUB="",m.ESC="\x1B",m.FS="",m.GS="",m.RS="",m.US="",m.SP=" ",m.DEL=""})(u||(c.C0=u={})),(function(m){m.PAD="",m.HOP="",m.BPH="",m.NBH="",m.IND="",m.NEL="
",m.SSA="",m.ESA="",m.HTS="",m.HTJ="",m.VTS="",m.PLD="",m.PLU="",m.RI="",m.SS2="",m.SS3="",m.DCS="",m.PU1="",m.PU2="",m.STS="",m.CCH="",m.MW="",m.SPA="",m.EPA="",m.SOS="",m.SGCI="",m.SCI="",m.CSI="",m.ST="",m.OSC="",m.PM="",m.APC=""})(d||(c.C1=d={})),(function(m){m.ST=`${u.ESC}\\`})(y||(c.C1_ESCAPED=y={}))},7399:(_,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.evaluateKeyboardEvent=void 0;const d=u(2584),y={48:["0",")"],49:["1","!"],50:["2","@"],51:["3","#"],52:["4","$"],53:["5","%"],54:["6","^"],55:["7","&"],56:["8","*"],57:["9","("],186:[";",":"],187:["=","+"],188:[",","<"],189:["-","_"],190:[".",">"],191:["/","?"],192:["`","~"],219:["[","{"],220:["\\","|"],221:["]","}"],222:["'",'"']};c.evaluateKeyboardEvent=function(m,w,C,A){const E={type:0,cancel:!1,key:void 0},f=(m.shiftKey?1:0)|(m.altKey?2:0)|(m.ctrlKey?4:0)|(m.metaKey?8:0);switch(m.keyCode){case 0:m.key==="UIKeyInputUpArrow"?E.key=w?d.C0.ESC+"OA":d.C0.ESC+"[A":m.key==="UIKeyInputLeftArrow"?E.key=w?d.C0.ESC+"OD":d.C0.ESC+"[D":m.key==="UIKeyInputRightArrow"?E.key=w?d.C0.ESC+"OC":d.C0.ESC+"[C":m.key==="UIKeyInputDownArrow"&&(E.key=w?d.C0.ESC+"OB":d.C0.ESC+"[B");break;case 8:E.key=m.ctrlKey?"\b":d.C0.DEL,m.altKey&&(E.key=d.C0.ESC+E.key);break;case 9:if(m.shiftKey){E.key=d.C0.ESC+"[Z";break}E.key=d.C0.HT,E.cancel=!0;break;case 13:E.key=m.altKey?d.C0.ESC+d.C0.CR:d.C0.CR,E.cancel=!0;break;case 27:E.key=d.C0.ESC,m.altKey&&(E.key=d.C0.ESC+d.C0.ESC),E.cancel=!0;break;case 37:if(m.metaKey)break;f?(E.key=d.C0.ESC+"[1;"+(f+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(m.metaKey)break;f?(E.key=d.C0.ESC+"[1;"+(f+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(m.metaKey)break;f?(E.key=d.C0.ESC+"[1;"+(f+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(m.metaKey)break;f?(E.key=d.C0.ESC+"[1;"+(f+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:m.shiftKey||m.ctrlKey||(E.key=d.C0.ESC+"[2~");break;case 46:E.key=f?d.C0.ESC+"[3;"+(f+1)+"~":d.C0.ESC+"[3~";break;case 36:E.key=f?d.C0.ESC+"[1;"+(f+1)+"H":w?d.C0.ESC+"OH":d.C0.ESC+"[H";break;case 35:E.key=f?d.C0.ESC+"[1;"+(f+1)+"F":w?d.C0.ESC+"OF":d.C0.ESC+"[F";break;case 33:m.shiftKey?E.type=2:m.ctrlKey?E.key=d.C0.ESC+"[5;"+(f+1)+"~":E.key=d.C0.ESC+"[5~";break;case 34:m.shiftKey?E.type=3:m.ctrlKey?E.key=d.C0.ESC+"[6;"+(f+1)+"~":E.key=d.C0.ESC+"[6~";break;case 112:E.key=f?d.C0.ESC+"[1;"+(f+1)+"P":d.C0.ESC+"OP";break;case 113:E.key=f?d.C0.ESC+"[1;"+(f+1)+"Q":d.C0.ESC+"OQ";break;case 114:E.key=f?d.C0.ESC+"[1;"+(f+1)+"R":d.C0.ESC+"OR";break;case 115:E.key=f?d.C0.ESC+"[1;"+(f+1)+"S":d.C0.ESC+"OS";break;case 116:E.key=f?d.C0.ESC+"[15;"+(f+1)+"~":d.C0.ESC+"[15~";break;case 117:E.key=f?d.C0.ESC+"[17;"+(f+1)+"~":d.C0.ESC+"[17~";break;case 118:E.key=f?d.C0.ESC+"[18;"+(f+1)+"~":d.C0.ESC+"[18~";break;case 119:E.key=f?d.C0.ESC+"[19;"+(f+1)+"~":d.C0.ESC+"[19~";break;case 120:E.key=f?d.C0.ESC+"[20;"+(f+1)+"~":d.C0.ESC+"[20~";break;case 121:E.key=f?d.C0.ESC+"[21;"+(f+1)+"~":d.C0.ESC+"[21~";break;case 122:E.key=f?d.C0.ESC+"[23;"+(f+1)+"~":d.C0.ESC+"[23~";break;case 123:E.key=f?d.C0.ESC+"[24;"+(f+1)+"~":d.C0.ESC+"[24~";break;default:if(!m.ctrlKey||m.shiftKey||m.altKey||m.metaKey)if(C&&!A||!m.altKey||m.metaKey)!C||m.altKey||m.ctrlKey||m.shiftKey||!m.metaKey?m.key&&!m.ctrlKey&&!m.altKey&&!m.metaKey&&m.keyCode>=48&&m.key.length===1?E.key=m.key:m.key&&m.ctrlKey&&(m.key==="_"&&(E.key=d.C0.US),m.key==="@"&&(E.key=d.C0.NUL)):m.keyCode===65&&(E.type=1);else{const v=y[m.keyCode],p=v?.[m.shiftKey?1:0];if(p)E.key=d.C0.ESC+p;else if(m.keyCode>=65&&m.keyCode<=90){const S=m.ctrlKey?m.keyCode-64:m.keyCode+32;let k=String.fromCharCode(S);m.shiftKey&&(k=k.toUpperCase()),E.key=d.C0.ESC+k}else if(m.keyCode===32)E.key=d.C0.ESC+(m.ctrlKey?d.C0.NUL:" ");else if(m.key==="Dead"&&m.code.startsWith("Key")){let S=m.code.slice(3,4);m.shiftKey||(S=S.toLowerCase()),E.key=d.C0.ESC+S,E.cancel=!0}}else m.keyCode>=65&&m.keyCode<=90?E.key=String.fromCharCode(m.keyCode-64):m.keyCode===32?E.key=d.C0.NUL:m.keyCode>=51&&m.keyCode<=55?E.key=String.fromCharCode(m.keyCode-51+27):m.keyCode===56?E.key=d.C0.DEL:m.keyCode===219?E.key=d.C0.ESC:m.keyCode===220?E.key=d.C0.FS:m.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(u){return u>65535?(u-=65536,String.fromCharCode(55296+(u>>10))+String.fromCharCode(u%1024+56320)):String.fromCharCode(u)},c.utf32ToString=function(u,d=0,y=u.length){let m="";for(let w=d;w<y;++w){let C=u[w];C>65535?(C-=65536,m+=String.fromCharCode(55296+(C>>10))+String.fromCharCode(C%1024+56320)):m+=String.fromCharCode(C)}return m},c.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(u,d){const y=u.length;if(!y)return 0;let m=0,w=0;if(this._interim){const C=u.charCodeAt(w++);56320<=C&&C<=57343?d[m++]=1024*(this._interim-55296)+C-56320+65536:(d[m++]=this._interim,d[m++]=C),this._interim=0}for(let C=w;C<y;++C){const A=u.charCodeAt(C);if(55296<=A&&A<=56319){if(++C>=y)return this._interim=A,m;const E=u.charCodeAt(C);56320<=E&&E<=57343?d[m++]=1024*(A-55296)+E-56320+65536:(d[m++]=A,d[m++]=E)}else A!==65279&&(d[m++]=A)}return m}},c.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(u,d){const y=u.length;if(!y)return 0;let m,w,C,A,E=0,f=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 T=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,I=T-M;for(;v<I;){if(v>=y)return 0;if(R=u[v++],(192&R)!=128){v--,k=!0;break}this.interim[M++]=R,L<<=6,L|=63&R}k||(T===2?L<128?v--:d[E++]=L:T===3?L<2048||L>=55296&&L<=57343||L===65279||(d[E++]=L):L<65536||L>1114111||(d[E++]=L)),this.interim.fill(0)}const p=y-4;let S=v;for(;S<y;){for(;!(!(S<p)||128&(m=u[S])||128&(w=u[S+1])||128&(C=u[S+2])||128&(A=u[S+3]));)d[E++]=m,d[E++]=w,d[E++]=C,d[E++]=A,S+=4;if(m=u[S++],m<128)d[E++]=m;else if((224&m)==192){if(S>=y)return this.interim[0]=m,E;if(w=u[S++],(192&w)!=128){S--;continue}if(f=(31&m)<<6|63&w,f<128){S--;continue}d[E++]=f}else if((240&m)==224){if(S>=y)return this.interim[0]=m,E;if(w=u[S++],(192&w)!=128){S--;continue}if(S>=y)return this.interim[0]=m,this.interim[1]=w,E;if(C=u[S++],(192&C)!=128){S--;continue}if(f=(15&m)<<12|(63&w)<<6|63&C,f<2048||f>=55296&&f<=57343||f===65279)continue;d[E++]=f}else if((248&m)==240){if(S>=y)return this.interim[0]=m,E;if(w=u[S++],(192&w)!=128){S--;continue}if(S>=y)return this.interim[0]=m,this.interim[1]=w,E;if(C=u[S++],(192&C)!=128){S--;continue}if(S>=y)return this.interim[0]=m,this.interim[1]=w,this.interim[2]=C,E;if(A=u[S++],(192&A)!=128){S--;continue}if(f=(7&m)<<18|(63&w)<<12|(63&C)<<6|63&A,f<65536||f>1114111)continue;d[E++]=f}}return E}}},225:(_,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.UnicodeV6=void 0;const d=u(1480),y=[[768,879],[1155,1158],[1160,1161],[1425,1469],[1471,1471],[1473,1474],[1476,1477],[1479,1479],[1536,1539],[1552,1557],[1611,1630],[1648,1648],[1750,1764],[1767,1768],[1770,1773],[1807,1807],[1809,1809],[1840,1866],[1958,1968],[2027,2035],[2305,2306],[2364,2364],[2369,2376],[2381,2381],[2385,2388],[2402,2403],[2433,2433],[2492,2492],[2497,2500],[2509,2509],[2530,2531],[2561,2562],[2620,2620],[2625,2626],[2631,2632],[2635,2637],[2672,2673],[2689,2690],[2748,2748],[2753,2757],[2759,2760],[2765,2765],[2786,2787],[2817,2817],[2876,2876],[2879,2879],[2881,2883],[2893,2893],[2902,2902],[2946,2946],[3008,3008],[3021,3021],[3134,3136],[3142,3144],[3146,3149],[3157,3158],[3260,3260],[3263,3263],[3270,3270],[3276,3277],[3298,3299],[3393,3395],[3405,3405],[3530,3530],[3538,3540],[3542,3542],[3633,3633],[3636,3642],[3655,3662],[3761,3761],[3764,3769],[3771,3772],[3784,3789],[3864,3865],[3893,3893],[3895,3895],[3897,3897],[3953,3966],[3968,3972],[3974,3975],[3984,3991],[3993,4028],[4038,4038],[4141,4144],[4146,4146],[4150,4151],[4153,4153],[4184,4185],[4448,4607],[4959,4959],[5906,5908],[5938,5940],[5970,5971],[6002,6003],[6068,6069],[6071,6077],[6086,6086],[6089,6099],[6109,6109],[6155,6157],[6313,6313],[6432,6434],[6439,6440],[6450,6450],[6457,6459],[6679,6680],[6912,6915],[6964,6964],[6966,6970],[6972,6972],[6978,6978],[7019,7027],[7616,7626],[7678,7679],[8203,8207],[8234,8238],[8288,8291],[8298,8303],[8400,8431],[12330,12335],[12441,12442],[43014,43014],[43019,43019],[43045,43046],[64286,64286],[65024,65039],[65056,65059],[65279,65279],[65529,65531]],m=[[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(A,E){let f,v=0,p=E.length-1;if(A<E[0][0]||A>E[p][1])return!1;for(;p>=v;)if(f=v+p>>1,A>E[f][1])v=f+1;else{if(!(A<E[f][0]))return!0;p=f-1}return!1})(C,m)?0:C>=131072&&C<=196605||C>=196608&&C<=262141?2:1}charProperties(C,A){let E=this.wcwidth(C),f=E===0&&A!==0;if(f){const v=d.UnicodeService.extractWidth(A);v===0?f=!1:v>E&&(E=v)}return d.UnicodeService.createPropertyValue(0,E,f)}}},5981:(_,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.WriteBuffer=void 0;const d=u(8460),y=u(844);class m 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,A){if(A!==void 0&&this._syncCalls>A)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 f=this._callbacks.shift();f&&f()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(C,A){if(this._pendingData>5e7)throw new Error("write data discarded, use flow control to avoid losing data");if(!this._writeBuffer.length){if(this._bufferOffset=0,this._didUserInput)return this._didUserInput=!1,this._pendingData+=C.length,this._writeBuffer.push(C),this._callbacks.push(A),void this._innerWrite();setTimeout((()=>this._innerWrite()))}this._pendingData+=C.length,this._writeBuffer.push(C),this._callbacks.push(A)}_innerWrite(C=0,A=!0){const E=C||Date.now();for(;this._writeBuffer.length>this._bufferOffset;){const f=this._writeBuffer[this._bufferOffset],v=this._action(f,A);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 p=this._callbacks[this._bufferOffset];if(p&&p(),this._bufferOffset++,this._pendingData-=f.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=m},5941:(_,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.toRgbString=c.parseColor=void 0;const u=/^([\da-f])\/([\da-f])\/([\da-f])$|^([\da-f]{2})\/([\da-f]{2})\/([\da-f]{2})$|^([\da-f]{3})\/([\da-f]{3})\/([\da-f]{3})$|^([\da-f]{4})\/([\da-f]{4})\/([\da-f]{4})$/,d=/^[\da-f]+$/;function y(m,w){const C=m.toString(16),A=C.length<2?"0"+C:C;switch(w){case 4:return C[0];case 8:return A;case 12:return(A+A).slice(0,3);default:return A+A}}c.parseColor=function(m){if(!m)return;let w=m.toLowerCase();if(w.indexOf("rgb:")===0){w=w.slice(4);const C=u.exec(w);if(C){const A=C[1]?15:C[4]?255:C[7]?4095:65535;return[Math.round(parseInt(C[1]||C[4]||C[7]||C[10],16)/A*255),Math.round(parseInt(C[2]||C[5]||C[8]||C[11],16)/A*255),Math.round(parseInt(C[3]||C[6]||C[9]||C[12],16)/A*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,A=[0,0,0];for(let E=0;E<3;++E){const f=parseInt(w.slice(C*E,C*E+C),16);A[E]=C===1?f<<4:C===2?f:C===3?f>>4:f>>8}return A}},c.toRgbString=function(m,w=16){const[C,A,E]=m;return`rgb:${y(C,w)}/${y(A,w)}/${y(E,w)}`}},5770:(_,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.PAYLOAD_LIMIT=void 0,c.PAYLOAD_LIMIT=1e7},6351:(_,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.DcsHandler=c.DcsParser=void 0;const d=u(482),y=u(8742),m=u(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(A,E){this._handlers[A]===void 0&&(this._handlers[A]=[]);const f=this._handlers[A];return f.push(E),{dispose:()=>{const v=f.indexOf(E);v!==-1&&f.splice(v,1)}}}clearHandler(A){this._handlers[A]&&delete this._handlers[A]}setHandlerFallback(A){this._handlerFb=A}reset(){if(this._active.length)for(let A=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;A>=0;--A)this._active[A].unhook(!1);this._stack.paused=!1,this._active=w,this._ident=0}hook(A,E){if(this.reset(),this._ident=A,this._active=this._handlers[A]||w,this._active.length)for(let f=this._active.length-1;f>=0;f--)this._active[f].hook(E);else this._handlerFb(this._ident,"HOOK",E)}put(A,E,f){if(this._active.length)for(let v=this._active.length-1;v>=0;v--)this._active[v].put(A,E,f);else this._handlerFb(this._ident,"PUT",(0,d.utf32ToString)(A,E,f))}unhook(A,E=!0){if(this._active.length){let f=!1,v=this._active.length-1,p=!1;if(this._stack.paused&&(v=this._stack.loopPosition-1,f=E,p=this._stack.fallThrough,this._stack.paused=!1),!p&&f===!1){for(;v>=0&&(f=this._active[v].unhook(A),f!==!0);v--)if(f instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=v,this._stack.fallThrough=!1,f;v--}for(;v>=0;v--)if(f=this._active[v].unhook(!1),f instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=v,this._stack.fallThrough=!0,f}else this._handlerFb(this._ident,"UNHOOK",A);this._active=w,this._ident=0}};const C=new y.Params;C.addParam(0),c.DcsHandler=class{constructor(A){this._handler=A,this._data="",this._params=C,this._hitLimit=!1}hook(A){this._params=A.length>1||A.params[0]?A.clone():C,this._data="",this._hitLimit=!1}put(A,E,f){this._hitLimit||(this._data+=(0,d.utf32ToString)(A,E,f),this._data.length>m.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}unhook(A){let E=!1;if(this._hitLimit)E=!1;else if(A&&(E=this._handler(this._data,this._params),E instanceof Promise))return E.then((f=>(this._params=C,this._data="",this._hitLimit=!1,f)));return this._params=C,this._data="",this._hitLimit=!1,E}}},2015:(_,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.EscapeSequenceParser=c.VT500_TRANSITION_TABLE=c.TransitionTable=void 0;const d=u(844),y=u(8742),m=u(6242),w=u(6351);class C{constructor(v){this.table=new Uint8Array(v)}setDefault(v,p){this.table.fill(v<<4|p)}add(v,p,S,k){this.table[p<<8|v]=S<<4|k}addMany(v,p,S,k){for(let L=0;L<v.length;L++)this.table[p<<8|v[L]]=S<<4|k}}c.TransitionTable=C;const A=160;c.VT500_TRANSITION_TABLE=(function(){const f=new C(4095),v=Array.apply(null,Array(256)).map(((M,T)=>T)),p=(M,T)=>v.slice(M,T),S=p(32,127),k=p(0,24);k.push(25),k.push.apply(k,p(28,32));const L=p(0,14);let R;for(R in f.setDefault(1,0),f.addMany(S,0,2,0),L)f.addMany([24,26,153,154],R,3,0),f.addMany(p(128,144),R,3,0),f.addMany(p(144,152),R,3,0),f.add(156,R,0,0),f.add(27,R,11,1),f.add(157,R,4,8),f.addMany([152,158,159],R,0,7),f.add(155,R,11,3),f.add(144,R,11,9);return f.addMany(k,0,3,0),f.addMany(k,1,3,1),f.add(127,1,0,1),f.addMany(k,8,0,8),f.addMany(k,3,3,3),f.add(127,3,0,3),f.addMany(k,4,3,4),f.add(127,4,0,4),f.addMany(k,6,3,6),f.addMany(k,5,3,5),f.add(127,5,0,5),f.addMany(k,2,3,2),f.add(127,2,0,2),f.add(93,1,4,8),f.addMany(S,8,5,8),f.add(127,8,5,8),f.addMany([156,27,24,26,7],8,6,0),f.addMany(p(28,32),8,0,8),f.addMany([88,94,95],1,0,7),f.addMany(S,7,0,7),f.addMany(k,7,0,7),f.add(156,7,0,0),f.add(127,7,0,7),f.add(91,1,11,3),f.addMany(p(64,127),3,7,0),f.addMany(p(48,60),3,8,4),f.addMany([60,61,62,63],3,9,4),f.addMany(p(48,60),4,8,4),f.addMany(p(64,127),4,7,0),f.addMany([60,61,62,63],4,0,6),f.addMany(p(32,64),6,0,6),f.add(127,6,0,6),f.addMany(p(64,127),6,0,0),f.addMany(p(32,48),3,9,5),f.addMany(p(32,48),5,9,5),f.addMany(p(48,64),5,0,6),f.addMany(p(64,127),5,7,0),f.addMany(p(32,48),4,9,5),f.addMany(p(32,48),1,9,2),f.addMany(p(32,48),2,9,2),f.addMany(p(48,127),2,10,0),f.addMany(p(48,80),1,10,0),f.addMany(p(81,88),1,10,0),f.addMany([89,90,92],1,10,0),f.addMany(p(96,127),1,10,0),f.add(80,1,11,9),f.addMany(k,9,0,9),f.add(127,9,0,9),f.addMany(p(28,32),9,0,9),f.addMany(p(32,48),9,9,12),f.addMany(p(48,60),9,8,10),f.addMany([60,61,62,63],9,9,10),f.addMany(k,11,0,11),f.addMany(p(32,128),11,0,11),f.addMany(p(28,32),11,0,11),f.addMany(k,10,0,10),f.add(127,10,0,10),f.addMany(p(28,32),10,0,10),f.addMany(p(48,60),10,8,10),f.addMany([60,61,62,63],10,0,11),f.addMany(p(32,48),10,9,12),f.addMany(k,12,0,12),f.add(127,12,0,12),f.addMany(p(28,32),12,0,12),f.addMany(p(32,48),12,9,12),f.addMany(p(48,64),12,0,11),f.addMany(p(64,127),12,12,13),f.addMany(p(64,127),10,12,13),f.addMany(p(64,127),9,12,13),f.addMany(k,13,13,13),f.addMany(S,13,13,13),f.add(127,13,0,13),f.addMany([27,156,24,26],13,14,0),f.add(A,0,2,0),f.add(A,8,5,8),f.add(A,6,0,6),f.add(A,11,0,11),f.add(A,13,13,13),f})();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=(p,S,k)=>{},this._executeHandlerFb=p=>{},this._csiHandlerFb=(p,S)=>{},this._escHandlerFb=p=>{},this._errorHandlerFb=p=>p,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 m.OscParser),this._dcsParser=this.register(new w.DcsParser),this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:"\\"},(()=>!0))}_identifier(v,p=[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(p[0]>k||k>p[1])throw new Error(`final must be in range ${p[0]} .. ${p[1]}`);return S<<=8,S|=k,S}identToString(v){const p=[];for(;v;)p.push(String.fromCharCode(255&v)),v>>=8;return p.reverse().join("")}setPrintHandler(v){this._printHandler=v}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(v,p){const S=this._identifier(v,[48,126]);this._escHandlers[S]===void 0&&(this._escHandlers[S]=[]);const k=this._escHandlers[S];return k.push(p),{dispose:()=>{const L=k.indexOf(p);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,p){this._executeHandlers[v.charCodeAt(0)]=p}clearExecuteHandler(v){this._executeHandlers[v.charCodeAt(0)]&&delete this._executeHandlers[v.charCodeAt(0)]}setExecuteHandlerFallback(v){this._executeHandlerFb=v}registerCsiHandler(v,p){const S=this._identifier(v);this._csiHandlers[S]===void 0&&(this._csiHandlers[S]=[]);const k=this._csiHandlers[S];return k.push(p),{dispose:()=>{const L=k.indexOf(p);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,p){return this._dcsParser.registerHandler(this._identifier(v),p)}clearDcsHandler(v){this._dcsParser.clearHandler(this._identifier(v))}setDcsHandlerFallback(v){this._dcsParser.setHandlerFallback(v)}registerOscHandler(v,p){return this._oscParser.registerHandler(v,p)}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,p,S,k,L){this._parseStack.state=v,this._parseStack.handlers=p,this._parseStack.handlerPos=S,this._parseStack.transition=k,this._parseStack.chunkPos=L}parse(v,p,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 T=this._parseStack.handlers;let I=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(S===!1&&I>-1){for(;I>=0&&(k=T[I](this._params),k!==!0);I--)if(k instanceof Promise)return this._parseStack.handlerPos=I,k}this._parseStack.handlers=[];break;case 4:if(S===!1&&I>-1){for(;I>=0&&(k=T[I](),k!==!0);I--)if(k instanceof Promise)return this._parseStack.handlerPos=I,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 T=M;T<p;++T){switch(L=v[T],R=this._transitions.table[this.currentState<<8|(L<160?L:A)],R>>4){case 2:for(let B=T+1;;++B){if(B>=p||(L=v[B])<32||L>126&&L<A){this._printHandler(v,T,B),T=B-1;break}if(++B>=p||(L=v[B])<32||L>126&&L<A){this._printHandler(v,T,B),T=B-1;break}if(++B>=p||(L=v[B])<32||L>126&&L<A){this._printHandler(v,T,B),T=B-1;break}if(++B>=p||(L=v[B])<32||L>126&&L<A){this._printHandler(v,T,B),T=B-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:T,code:L,currentState:this.currentState,collect:this._collect,params:this._params,abort:!1}).abort)return;break;case 7:const I=this._csiHandlers[this._collect<<8|L];let K=I?I.length-1:-1;for(;K>=0&&(k=I[K](this._params),k!==!0);K--)if(k instanceof Promise)return this._preserveStack(3,I,K,R,T),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(++T<p&&(L=v[T])>47&&L<60);T--;break;case 9:this._collect<<=8,this._collect|=L;break;case 10:const F=this._escHandlers[this._collect<<8|L];let G=F?F.length-1:-1;for(;G>=0&&(k=F[G](),k!==!0);G--)if(k instanceof Promise)return this._preserveStack(4,F,G,R,T),k;G<0&&this._escHandlerFb(this._collect<<8|L),this.precedingJoinState=0;break;case 11:this._params.reset(),this._params.addParam(0),this._collect=0;break;case 12:this._dcsParser.hook(this._collect<<8|L,this._params);break;case 13:for(let B=T+1;;++B)if(B>=p||(L=v[B])===24||L===26||L===27||L>127&&L<A){this._dcsParser.put(v,T,B),T=B-1;break}break;case 14:if(k=this._dcsParser.unhook(L!==24&&L!==26),k)return this._preserveStack(6,[],0,R,T),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 B=T+1;;B++)if(B>=p||(L=v[B])<32||L>127&&L<A){this._oscParser.put(v,T,B),T=B-1;break}break;case 6:if(k=this._oscParser.end(L!==24&&L!==26),k)return this._preserveStack(5,[],0,R,T),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,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.OscHandler=c.OscParser=void 0;const d=u(5770),y=u(482),m=[];c.OscParser=class{constructor(){this._state=0,this._active=m,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 A=this._handlers[w];return A.push(C),{dispose:()=>{const E=A.indexOf(C);E!==-1&&A.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=m}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=m,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||m,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,A){if(this._active.length)for(let E=this._active.length-1;E>=0;E--)this._active[E].put(w,C,A);else this._handlerFb(this._id,"PUT",(0,y.utf32ToString)(w,C,A))}start(){this.reset(),this._state=1}put(w,C,A){if(this._state!==3){if(this._state===1)for(;C<A;){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&&A-C>0&&this._put(w,C,A)}}end(w,C=!0){if(this._state!==0){if(this._state!==3)if(this._state===1&&this._start(),this._active.length){let A=!1,E=this._active.length-1,f=!1;if(this._stack.paused&&(E=this._stack.loopPosition-1,A=C,f=this._stack.fallThrough,this._stack.paused=!1),!f&&A===!1){for(;E>=0&&(A=this._active[E].end(w),A!==!0);E--)if(A instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=E,this._stack.fallThrough=!1,A;E--}for(;E>=0;E--)if(A=this._active[E].end(!1),A instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=E,this._stack.fallThrough=!0,A}else this._handlerFb(this._id,"END",w);this._active=m,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,A){this._hitLimit||(this._data+=(0,y.utf32ToString)(w,C,A),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((A=>(this._data="",this._hitLimit=!1,A)));return this._data="",this._hitLimit=!1,C}}},8742:(_,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.Params=void 0;const u=2147483647;class d{static fromArray(m){const w=new d;if(!m.length)return w;for(let C=Array.isArray(m[0])?1:0;C<m.length;++C){const A=m[C];if(Array.isArray(A))for(let E=0;E<A.length;++E)w.addSubParam(A[E]);else w.addParam(A)}return w}constructor(m=32,w=32){if(this.maxLength=m,this.maxSubParamsLength=w,w>256)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(m),this.length=0,this._subParams=new Int32Array(w),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(m),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}clone(){const m=new d(this.maxLength,this.maxSubParamsLength);return m.params.set(this.params),m.length=this.length,m._subParams.set(this._subParams),m._subParamsLength=this._subParamsLength,m._subParamsIdx.set(this._subParamsIdx),m._rejectDigits=this._rejectDigits,m._rejectSubDigits=this._rejectSubDigits,m._digitIsSub=this._digitIsSub,m}toArray(){const m=[];for(let w=0;w<this.length;++w){m.push(this.params[w]);const C=this._subParamsIdx[w]>>8,A=255&this._subParamsIdx[w];A-C>0&&m.push(Array.prototype.slice.call(this._subParams,C,A))}return m}reset(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}addParam(m){if(this._digitIsSub=!1,this.length>=this.maxLength)this._rejectDigits=!0;else{if(m<-1)throw new Error("values lesser than -1 are not allowed");this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=m>u?u:m}}addSubParam(m){if(this._digitIsSub=!0,this.length)if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength)this._rejectSubDigits=!0;else{if(m<-1)throw new Error("values lesser than -1 are not allowed");this._subParams[this._subParamsLength++]=m>u?u:m,this._subParamsIdx[this.length-1]++}}hasSubParams(m){return(255&this._subParamsIdx[m])-(this._subParamsIdx[m]>>8)>0}getSubParams(m){const w=this._subParamsIdx[m]>>8,C=255&this._subParamsIdx[m];return C-w>0?this._subParams.subarray(w,C):null}getSubParamsAll(){const m={};for(let w=0;w<this.length;++w){const C=this._subParamsIdx[w]>>8,A=255&this._subParamsIdx[w];A-C>0&&(m[w]=this._subParams.slice(C,A))}return m}addDigit(m){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,A=C[w-1];C[w-1]=~A?Math.min(10*A+m,u):m}}c.Params=d},5741:(_,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.AddonManager=void 0,c.AddonManager=class{constructor(){this._addons=[]}dispose(){for(let u=this._addons.length-1;u>=0;u--)this._addons[u].instance.dispose()}loadAddon(u,d){const y={instance:d,dispose:d.dispose,isDisposed:!1};this._addons.push(y),d.dispose=()=>this._wrappedAddonDispose(y),d.activate(u)}_wrappedAddonDispose(u){if(u.isDisposed)return;let d=-1;for(let y=0;y<this._addons.length;y++)if(this._addons[y]===u){d=y;break}if(d===-1)throw new Error("Could not dispose an addon that has not been loaded");u.isDisposed=!0,u.dispose.apply(u.instance),this._addons.splice(d,1)}}},8771:(_,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.BufferApiView=void 0;const d=u(3785),y=u(511);c.BufferApiView=class{constructor(m,w){this._buffer=m,this.type=w}init(m){return this._buffer=m,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(m){const w=this._buffer.lines.get(m);if(w)return new d.BufferLineApiView(w)}getNullCell(){return new y.CellData}}},3785:(_,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.BufferLineApiView=void 0;const d=u(511);c.BufferLineApiView=class{constructor(y){this._line=y}get isWrapped(){return this._line.isWrapped}get length(){return this._line.length}getCell(y,m){if(!(y<0||y>=this._line.length))return m?(this._line.loadCell(y,m),m):this._line.loadCell(y,new d.CellData)}translateToString(y,m,w){return this._line.translateToString(y,m,w)}}},8285:(_,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.BufferNamespaceApi=void 0;const d=u(8771),y=u(8460),m=u(844);class w extends m.Disposable{constructor(A){super(),this._core=A,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(u){this._core=u}registerCsiHandler(u,d){return this._core.registerCsiHandler(u,(y=>d(y.toArray())))}addCsiHandler(u,d){return this.registerCsiHandler(u,d)}registerDcsHandler(u,d){return this._core.registerDcsHandler(u,((y,m)=>d(y,m.toArray())))}addDcsHandler(u,d){return this.registerDcsHandler(u,d)}registerEscHandler(u,d){return this._core.registerEscHandler(u,d)}addEscHandler(u,d){return this.registerEscHandler(u,d)}registerOscHandler(u,d){return this._core.registerOscHandler(u,d)}addOscHandler(u,d){return this.registerOscHandler(u,d)}}},7090:(_,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.UnicodeApi=void 0,c.UnicodeApi=class{constructor(u){this._core=u}register(u){this._core.unicodeService.register(u)}get versions(){return this._core.unicodeService.versions}get activeVersion(){return this._core.unicodeService.activeVersion}set activeVersion(u){this._core.unicodeService.activeVersion=u}}},744:function(_,c,u){var d=this&&this.__decorate||function(f,v,p,S){var k,L=arguments.length,R=L<3?v:S===null?S=Object.getOwnPropertyDescriptor(v,p):S;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")R=Reflect.decorate(f,v,p,S);else for(var M=f.length-1;M>=0;M--)(k=f[M])&&(R=(L<3?k(R):L>3?k(v,p,R):k(v,p))||R);return L>3&&R&&Object.defineProperty(v,p,R),R},y=this&&this.__param||function(f,v){return function(p,S){v(p,S,f)}};Object.defineProperty(c,"__esModule",{value:!0}),c.BufferService=c.MINIMUM_ROWS=c.MINIMUM_COLS=void 0;const m=u(8460),w=u(844),C=u(5295),A=u(2585);c.MINIMUM_COLS=2,c.MINIMUM_ROWS=1;let E=c.BufferService=class extends w.Disposable{get buffer(){return this.buffers.active}constructor(f){super(),this.isUserScrolling=!1,this._onResize=this.register(new m.EventEmitter),this.onResize=this._onResize.event,this._onScroll=this.register(new m.EventEmitter),this.onScroll=this._onScroll.event,this.cols=Math.max(f.rawOptions.cols||0,c.MINIMUM_COLS),this.rows=Math.max(f.rawOptions.rows||0,c.MINIMUM_ROWS),this.buffers=this.register(new C.BufferSet(f,this))}resize(f,v){this.cols=f,this.rows=v,this.buffers.resize(f,v),this._onResize.fire({cols:f,rows:v})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(f,v=!1){const p=this.buffer;let S;S=this._cachedBlankLine,S&&S.length===this.cols&&S.getFg(0)===f.fg&&S.getBg(0)===f.bg||(S=p.getBlankLine(f,v),this._cachedBlankLine=S),S.isWrapped=v;const k=p.ybase+p.scrollTop,L=p.ybase+p.scrollBottom;if(p.scrollTop===0){const R=p.lines.isFull;L===p.lines.length-1?R?p.lines.recycle().copyFrom(S):p.lines.push(S.clone()):p.lines.splice(L+1,0,S.clone()),R?this.isUserScrolling&&(p.ydisp=Math.max(p.ydisp-1,0)):(p.ybase++,this.isUserScrolling||p.ydisp++)}else{const R=L-k+1;p.lines.shiftElements(k+1,R-1,-1),p.lines.set(L,S.clone())}this.isUserScrolling||(p.ydisp=p.ybase),this._onScroll.fire(p.ydisp)}scrollLines(f,v,p){const S=this.buffer;if(f<0){if(S.ydisp===0)return;this.isUserScrolling=!0}else f+S.ydisp>=S.ybase&&(this.isUserScrolling=!1);const k=S.ydisp;S.ydisp=Math.max(Math.min(S.ydisp+f,S.ybase),0),k!==S.ydisp&&(v||this._onScroll.fire(S.ydisp))}};c.BufferService=E=d([y(0,A.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(u){this.glevel=u,this.charset=this._charsets[u]}setgCharset(u,d){this._charsets[u]=d,this.glevel===u&&(this.charset=d)}}},1753:function(_,c,u){var d=this&&this.__decorate||function(S,k,L,R){var M,T=arguments.length,I=T<3?k:R===null?R=Object.getOwnPropertyDescriptor(k,L):R;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")I=Reflect.decorate(S,k,L,R);else for(var K=S.length-1;K>=0;K--)(M=S[K])&&(I=(T<3?M(I):T>3?M(k,L,I):M(k,L))||I);return T>3&&I&&Object.defineProperty(k,L,I),I},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 m=u(2585),w=u(8460),C=u(844),A={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 f=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${f(k[0])}${f(k[1])}${f(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 p=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(A))this.addProtocol(L,A[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=p=d([y(0,m.IBufferService),y(1,m.ICoreService)],p)},6975:function(_,c,u){var d=this&&this.__decorate||function(p,S,k,L){var R,M=arguments.length,T=M<3?S:L===null?L=Object.getOwnPropertyDescriptor(S,k):L;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")T=Reflect.decorate(p,S,k,L);else for(var I=p.length-1;I>=0;I--)(R=p[I])&&(T=(M<3?R(T):M>3?R(S,k,T):R(S,k))||T);return M>3&&T&&Object.defineProperty(S,k,T),T},y=this&&this.__param||function(p,S){return function(k,L){S(k,L,p)}};Object.defineProperty(c,"__esModule",{value:!0}),c.CoreService=void 0;const m=u(1439),w=u(8460),C=u(844),A=u(2585),E=Object.freeze({insertMode:!1}),f=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(p,S,k){super(),this._bufferService=p,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,m.clone)(E),this.decPrivateModes=(0,m.clone)(f)}reset(){this.modes=(0,m.clone)(E),this.decPrivateModes=(0,m.clone)(f)}triggerDataEvent(p,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 "${p}"`,(()=>p.split("").map((L=>L.charCodeAt(0))))),this._onData.fire(p)}triggerBinaryEvent(p){this._optionsService.rawOptions.disableStdin||(this._logService.debug(`sending binary "${p}"`,(()=>p.split("").map((S=>S.charCodeAt(0))))),this._onBinary.fire(p))}};c.CoreService=v=d([y(0,A.IBufferService),y(1,A.ILogService),y(2,A.IOptionsService)],v)},9074:(_,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.DecorationService=void 0;const d=u(8055),y=u(8460),m=u(844),w=u(6106);let C=0,A=0;class E extends m.Disposable{get decorations(){return this._decorations.values()}constructor(){super(),this._decorations=new w.SortedList((p=>p?.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,m.toDisposable)((()=>this.reset())))}registerDecoration(p){if(p.marker.isDisposed)return;const S=new f(p);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 p of this._decorations.values())p.dispose();this._decorations.clear()}*getDecorationsAtCell(p,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),p>=L&&p<R&&(!k||(M.options.layer??"bottom")===k)&&(yield M)}forEachDecorationAtCell(p,S,k,L){this._decorations.forEachByKey(S,(R=>{C=R.options.x??0,A=C+(R.options.width??1),p>=C&&p<A&&(!k||(R.options.layer??"bottom")===k)&&L(R)}))}}c.DecorationService=E;class f extends m.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(p){super(),this.options=p,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=p.marker,this.options.overviewRulerOptions&&!this.options.overviewRulerOptions.position&&(this.options.overviewRulerOptions.position="full")}dispose(){this._onDispose.fire(),super.dispose()}}},4348:(_,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.InstantiationService=c.ServiceCollection=void 0;const d=u(2585),y=u(8343);class m{constructor(...C){this._entries=new Map;for(const[A,E]of C)this.set(A,E)}set(C,A){const E=this._entries.get(C);return this._entries.set(C,A),E}forEach(C){for(const[A,E]of this._entries.entries())C(A,E)}has(C){return this._entries.has(C)}get(C){return this._entries.get(C)}}c.ServiceCollection=m,c.InstantiationService=class{constructor(){this._services=new m,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 A=(0,y.getServiceDependencies)(w).sort(((v,p)=>v.index-p.index)),E=[];for(const v of A){const p=this._services.get(v.id);if(!p)throw new Error(`[createInstance] ${w.name} depends on UNKNOWN service ${v.id}.`);E.push(p)}const f=A.length>0?A[0].index:C.length;if(C.length!==f)throw new Error(`[createInstance] First service dependency of ${w.name} at position ${f+1} conflicts with ${C.length} static arguments`);return new w(...C,...E)}}},7866:function(_,c,u){var d=this&&this.__decorate||function(f,v,p,S){var k,L=arguments.length,R=L<3?v:S===null?S=Object.getOwnPropertyDescriptor(v,p):S;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")R=Reflect.decorate(f,v,p,S);else for(var M=f.length-1;M>=0;M--)(k=f[M])&&(R=(L<3?k(R):L>3?k(v,p,R):k(v,p))||R);return L>3&&R&&Object.defineProperty(v,p,R),R},y=this&&this.__param||function(f,v){return function(p,S){v(p,S,f)}};Object.defineProperty(c,"__esModule",{value:!0}),c.traceCall=c.setTraceLogger=c.LogService=void 0;const m=u(844),w=u(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 A,E=c.LogService=class extends m.Disposable{get logLevel(){return this._logLevel}constructor(f){super(),this._optionsService=f,this._logLevel=w.LogLevelEnum.OFF,this._updateLogLevel(),this.register(this._optionsService.onSpecificOptionChange("logLevel",(()=>this._updateLogLevel()))),A=this}_updateLogLevel(){this._logLevel=C[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(f){for(let v=0;v<f.length;v++)typeof f[v]=="function"&&(f[v]=f[v]())}_log(f,v,p){this._evalLazyOptionalParams(p),f.call(console,(this._optionsService.options.logger?"":"xterm.js: ")+v,...p)}trace(f,...v){this._logLevel<=w.LogLevelEnum.TRACE&&this._log(this._optionsService.options.logger?.trace.bind(this._optionsService.options.logger)??console.log,f,v)}debug(f,...v){this._logLevel<=w.LogLevelEnum.DEBUG&&this._log(this._optionsService.options.logger?.debug.bind(this._optionsService.options.logger)??console.log,f,v)}info(f,...v){this._logLevel<=w.LogLevelEnum.INFO&&this._log(this._optionsService.options.logger?.info.bind(this._optionsService.options.logger)??console.info,f,v)}warn(f,...v){this._logLevel<=w.LogLevelEnum.WARN&&this._log(this._optionsService.options.logger?.warn.bind(this._optionsService.options.logger)??console.warn,f,v)}error(f,...v){this._logLevel<=w.LogLevelEnum.ERROR&&this._log(this._optionsService.options.logger?.error.bind(this._optionsService.options.logger)??console.error,f,v)}};c.LogService=E=d([y(0,w.IOptionsService)],E),c.setTraceLogger=function(f){A=f},c.traceCall=function(f,v,p){if(typeof p.value!="function")throw new Error("not supported");const S=p.value;p.value=function(...k){if(A.logLevel!==w.LogLevelEnum.TRACE)return S.apply(this,k);A.trace(`GlyphRenderer#${S.name}(${k.map((R=>JSON.stringify(R))).join(", ")})`);const L=S.apply(this,k);return A.trace(`GlyphRenderer#${S.name} return`,L),L}}},7302:(_,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.OptionsService=c.DEFAULT_OPTIONS=void 0;const d=u(8460),y=u(844),m=u(6114);c.DEFAULT_OPTIONS={cols:80,rows:24,cursorBlink:!1,cursorStyle:"block",cursorWidth:1,cursorInactiveStyle:"outline",customGlyphs:!0,drawBoldTextInBrightColors:!0,documentOverride:null,fastScrollModifier:"alt",fastScrollSensitivity:5,fontFamily:"courier-new, courier, monospace",fontSize:15,fontWeight:"normal",fontWeightBold:"bold",ignoreBracketedPasteMode:!1,lineHeight:1,letterSpacing:0,linkHandler:null,logLevel:"info",logger:null,scrollback:1e3,scrollOnUserInput:!0,scrollSensitivity:1,screenReaderMode:!1,smoothScrollDuration:0,macOptionIsMeta:!1,macOptionClickForcesSelection:!1,minimumContrastRatio:1,disableStdin:!1,allowProposedApi:!1,allowTransparency:!1,tabStopWidth:8,theme:{},rescaleOverlappingGlyphs:!1,rightClickSelectsWord:m.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 f={...c.DEFAULT_OPTIONS};for(const v in E)if(v in f)try{const p=E[v];f[v]=this._sanitizeAndValidateOption(v,p)}catch(p){console.error(p)}this.rawOptions=f,this.options={...f},this._setupOptions(),this.register((0,y.toDisposable)((()=>{this.rawOptions.linkHandler=null,this.rawOptions.documentOverride=null})))}onSpecificOptionChange(E,f){return this.onOptionChange((v=>{v===E&&f(this.rawOptions[E])}))}onMultipleOptionChange(E,f){return this.onOptionChange((v=>{E.indexOf(v)!==-1&&f()}))}_setupOptions(){const E=v=>{if(!(v in c.DEFAULT_OPTIONS))throw new Error(`No option with key "${v}"`);return this.rawOptions[v]},f=(v,p)=>{if(!(v in c.DEFAULT_OPTIONS))throw new Error(`No option with key "${v}"`);p=this._sanitizeAndValidateOption(v,p),this.rawOptions[v]!==p&&(this.rawOptions[v]=p,this._onOptionChange.fire(v))};for(const v in this.rawOptions){const p={get:E.bind(this,v),set:f.bind(this,v)};Object.defineProperty(this.options,v,p)}}_sanitizeAndValidateOption(E,f){switch(E){case"cursorStyle":if(f||(f=c.DEFAULT_OPTIONS[E]),!(function(v){return v==="block"||v==="underline"||v==="bar"})(f))throw new Error(`"${f}" is not a valid value for ${E}`);break;case"wordSeparator":f||(f=c.DEFAULT_OPTIONS[E]);break;case"fontWeight":case"fontWeightBold":if(typeof f=="number"&&1<=f&&f<=1e3)break;f=w.includes(f)?f:c.DEFAULT_OPTIONS[E];break;case"cursorWidth":f=Math.floor(f);case"lineHeight":case"tabStopWidth":if(f<1)throw new Error(`${E} cannot be less than 1, value: ${f}`);break;case"minimumContrastRatio":f=Math.max(1,Math.min(21,Math.round(10*f)/10));break;case"scrollback":if((f=Math.min(f,4294967295))<0)throw new Error(`${E} cannot be less than 0, value: ${f}`);break;case"fastScrollSensitivity":case"scrollSensitivity":if(f<=0)throw new Error(`${E} cannot be less than or equal to 0, value: ${f}`);break;case"rows":case"cols":if(!f&&f!==0)throw new Error(`${E} must be numeric, value: ${f}`);break;case"windowsPty":f=f??{}}return f}}c.OptionsService=C},2660:function(_,c,u){var d=this&&this.__decorate||function(C,A,E,f){var v,p=arguments.length,S=p<3?A:f===null?f=Object.getOwnPropertyDescriptor(A,E):f;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")S=Reflect.decorate(C,A,E,f);else for(var k=C.length-1;k>=0;k--)(v=C[k])&&(S=(p<3?v(S):p>3?v(A,E,S):v(A,E))||S);return p>3&&S&&Object.defineProperty(A,E,S),S},y=this&&this.__param||function(C,A){return function(E,f){A(E,f,C)}};Object.defineProperty(c,"__esModule",{value:!0}),c.OscLinkService=void 0;const m=u(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 A=this._bufferService.buffer;if(C.id===void 0){const k=A.addMarker(A.ybase+A.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,f=this._getEntryIdKey(E),v=this._entriesWithId.get(f);if(v)return this.addLineToLink(v.id,A.ybase+A.y),v.id;const p=A.addMarker(A.ybase+A.y),S={id:this._nextId++,key:this._getEntryIdKey(E),data:E,lines:[p]};return p.onDispose((()=>this._removeMarkerFromLink(S,p))),this._entriesWithId.set(S.key,S),this._dataByLinkId.set(S.id,S),S.id}addLineToLink(C,A){const E=this._dataByLinkId.get(C);if(E&&E.lines.every((f=>f.line!==A))){const f=this._bufferService.buffer.addMarker(A);E.lines.push(f),f.onDispose((()=>this._removeMarkerFromLink(E,f)))}}getLinkData(C){return this._dataByLinkId.get(C)?.data}_getEntryIdKey(C){return`${C.id};;${C.uri}`}_removeMarkerFromLink(C,A){const E=C.lines.indexOf(A);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,m.IBufferService)],w)},8343:(_,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.createDecorator=c.getServiceDependencies=c.serviceRegistry=void 0;const u="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 m=function(w,C,A){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");(function(E,f,v){f[u]===f?f[d].push({id:E,index:v}):(f[d]=[{id:E,index:v}],f[u]=f)})(m,w,A)};return m.toString=()=>y,c.serviceRegistry.set(y,m),m}},2585:(_,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.IDecorationService=c.IUnicodeService=c.IOscLinkService=c.IOptionsService=c.ILogService=c.LogLevelEnum=c.IInstantiationService=c.ICharsetService=c.ICoreService=c.ICoreMouseService=c.IBufferService=void 0;const d=u(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(m){m[m.TRACE=0]="TRACE",m[m.DEBUG=1]="DEBUG",m[m.INFO=2]="INFO",m[m.WARN=3]="WARN",m[m.ERROR=4]="ERROR",m[m.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,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.UnicodeService=void 0;const d=u(8460),y=u(225);class m{static extractShouldJoin(C){return(1&C)!=0}static extractWidth(C){return C>>1&3}static extractCharKind(C){return C>>3}static createPropertyValue(C,A,E=!1){return(16777215&C)<<3|(3&A)<<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 A=0,E=0;const f=C.length;for(let v=0;v<f;++v){let p=C.charCodeAt(v);if(55296<=p&&p<=56319){if(++v>=f)return A+this.wcwidth(p);const L=C.charCodeAt(v);56320<=L&&L<=57343?p=1024*(p-55296)+L-56320+65536:A+=this.wcwidth(L)}const S=this.charProperties(p,E);let k=m.extractWidth(S);m.extractShouldJoin(S)&&(k-=m.extractWidth(E)),A+=k,E=S}return A}charProperties(C,A){return this._activeProvider.charProperties(C,A)}}c.UnicodeService=m}},a={};function o(_){var c=a[_];if(c!==void 0)return c.exports;var u=a[_]={exports:{}};return r[_].call(u.exports,u,u.exports,o),u.exports}var g={};return(()=>{var _=g;Object.defineProperty(_,"__esModule",{value:!0}),_.Terminal=void 0;const c=o(9042),u=o(3236),d=o(844),y=o(5741),m=o(8285),w=o(7975),C=o(7090),A=["cols","rows"];class E extends d.Disposable{constructor(v){super(),this._core=this.register(new u.Terminal(v)),this._addonManager=this.register(new y.AddonManager),this._publicOptions={...this._core.options};const p=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:p.bind(this,k),set:S.bind(this,k)};Object.defineProperty(this._publicOptions,k,L)}}_checkReadonlyOptions(v){if(A.includes(v))throw new Error(`Option "${v}" can only be set in the constructor`)}_checkProposedApi(){if(!this._core.optionsService.rawOptions.allowProposedApi)throw new Error("You must set the allowProposedApi option to true to use proposed API")}get onBell(){return this._core.onBell}get onBinary(){return this._core.onBinary}get onCursorMove(){return this._core.onCursorMove}get onData(){return this._core.onData}get onKey(){return this._core.onKey}get onLineFeed(){return this._core.onLineFeed}get onRender(){return this._core.onRender}get onResize(){return this._core.onResize}get onScroll(){return this._core.onScroll}get onSelectionChange(){return this._core.onSelectionChange}get onTitleChange(){return this._core.onTitleChange}get onWriteParsed(){return this._core.onWriteParsed}get element(){return this._core.element}get parser(){return this._parser||(this._parser=new 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 m.BufferNamespaceApi(this._core))),this._buffer}get markers(){return this._checkProposedApi(),this._core.markers}get modes(){const v=this._core.coreService.decPrivateModes;let p="none";switch(this._core.coreMouseService.activeProtocol){case"X10":p="x10";break;case"VT200":p="vt200";break;case"DRAG":p="drag";break;case"ANY":p="any"}return{applicationCursorKeysMode:v.applicationCursorKeys,applicationKeypadMode:v.applicationKeypad,bracketedPasteMode:v.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:p,originMode:v.origin,reverseWraparoundMode:v.reverseWraparound,sendFocusMode:v.sendFocus,wraparoundMode:v.wraparound}}get options(){return this._publicOptions}set options(v){for(const p in v)this._publicOptions[p]=v[p]}blur(){this._core.blur()}focus(){this._core.focus()}input(v,p=!0){this._core.input(v,p)}resize(v,p){this._verifyIntegers(v,p),this._core.resize(v,p)}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,p,S){this._verifyIntegers(v,p,S),this._core.select(v,p,S)}getSelection(){return this._core.getSelection()}getSelectionPosition(){return this._core.getSelectionPosition()}clearSelection(){this._core.clearSelection()}selectAll(){this._core.selectAll()}selectLines(v,p){this._verifyIntegers(v,p),this._core.selectLines(v,p)}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,p){this._core.write(v,p)}writeln(v,p){this._core.write(v),this._core.write(`\r
|
|
82
|
-
`,p)}paste(v){this._core.paste(v)}refresh(v,p){this._verifyIntegers(v,p),this._core.refresh(v,p)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(v){this._addonManager.loadAddon(this,v)}static get strings(){return c}_verifyIntegers(...v){for(const p of v)if(p===1/0||isNaN(p)||p%1!=0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...v){for(const p of v)if(p&&(p===1/0||isNaN(p)||p%1!=0||p<0))throw new Error("This API only accepts positive integers")}}_.Terminal=E})(),g})()))})(Jf)),Jf.exports}var nM=tM();function iM(e){let n=!1,r=!1,a=!1,o=!1,g=null,_=null;const c=()=>{g!==null&&(clearTimeout(g),g=null),a=!1},u=()=>{_!==null&&(clearTimeout(_),_=null),r=!1},d=()=>{u(),r=!0,_=setTimeout(()=>{_=null,r=!1},0)},y=()=>{a=!1,g!==null&&clearTimeout(g),_!==null&&(clearTimeout(_),_=null),g=setTimeout(()=>{g=null,r=!1,e()},0)},m=()=>{n=!1,g===null&&(u(),a=!1)},w=()=>{n=!1,o=!1,u(),c()},C=A=>{if(g===null){if(n||r||sM(A)){a=!0,r&&!n?y():n=!0;return}e()}};return{onCompositionStart(){n=!0},onCompositionEnd(){n=!1,d(),a&&y()},onCompositionCancel:m,handleKeyEvent(A){return rM(A)&&A.shiftKey?(A.preventDefault?.(),A.type==="keydown"?(o=!0,C(A)):A.type==="keypress"?(o||C(A),o=!1):A.type==="keyup"&&(o=!1),!1):!0},dispose:w}}function rM(e){return e.key==="Enter"||e.code==="Enter"||e.keyCode===13||e.which===13}function sM(e){return e.isComposing===!0||e.keyCode===229||e.which===229}const am=14,Zw=10,Jw=22,aM=128,oM=.5,lM="mmmmmmmmmmwwwwiIl1 0O-_|┌ABCxyz",cM=/[\x00-\x1F\x7F]/g,Eb={min:Zw,max:Jw},uM="cascadia",mh=[{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"}],na=mh[0];function Vu(e){return mh.find(n=>n.id===e)??na}function Ul(){return{source:"curated",id:uM,customName:"",family:na.family,size:am}}function om(e,n){const r=Vu(e);return{source:"curated",id:r.id,customName:"",family:r.family,size:cm(n)}}function lm(e,n){const r=fM(e);return{source:"custom",id:null,customName:r,family:r?`"${nx(r)}", ${na.family}`:na.family,size:cm(n)}}function Qw(e){if(!e)return Ul();try{const n=JSON.parse(e),r=cm(typeof n.size=="number"?n.size:am);if(n.source==="custom"&&typeof n.customName=="string")return lm(n.customName,r);if(typeof n.id=="string"&&dM(n.id))return om(n.id,r)}catch{}return Ul()}function ex(e){return JSON.stringify({source:e.source,id:e.id,customName:e.customName,size:e.size})}function cm(e){return Number.isFinite(e)?Math.min(Jw,Math.max(Zw,Math.round(e))):am}function tx(e){return e.source==="curated"?{status:"self-hosted",fallbackName:na.name}:e.customName?{status:hM(e.customName)?"resolved":"fallback",fallbackName:na.name}:{status:"fallback",fallbackName:na.name}}function hM(e){if(typeof document>"u")return!1;const n=document.createElement("canvas").getContext("2d");if(!n)return!1;for(const r of["monospace","serif","sans-serif"]){const a=kb(n,`"${nx(e)}", ${r}`),o=kb(n,r);if(Math.abs(a-o)>oM)return!0}return!1}function kb(e,n){return e.font=`28px ${n}`,e.measureText(lM).width}function dM(e){return mh.some(n=>n.id===e)}function fM(e){return e.replace(cM,"").trim().slice(0,aM)}function nx(e){return e.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}const Yu="fleet-plugin.terminal.renderer",Xu="fleet-plugin.terminal.font",Ab="fleet-console.terminalRenderer",Tb="fleet-console.terminalFont",Qp=new Set;let Es=pM();function pM(){return typeof window>"u"?{renderer:"webgl",font:Ul()}:(gM(),{renderer:mM(),font:_M()})}function gM(){if(!(typeof window>"u"))try{if(window.localStorage.getItem(Yu)!==null||window.localStorage.getItem(Xu)!==null)return;const e=window.localStorage.getItem(Ab),n=window.localStorage.getItem(Tb),r=e==="webgl"||e==="dom"?e:"webgl",a=Qw(n);window.localStorage.setItem(Yu,r),window.localStorage.setItem(Xu,ex(a)),window.localStorage.removeItem(Ab),window.localStorage.removeItem(Tb)}catch{}}function mM(){if(typeof window>"u")return"webgl";try{const e=window.localStorage.getItem(Yu);return e==="webgl"||e==="dom"?e:"webgl"}catch{return"webgl"}}function _M(){if(typeof window>"u")return Ul();try{return Qw(window.localStorage.getItem(Xu))}catch{return Ul()}}function vM(e){if(!(typeof window>"u"))try{window.localStorage.setItem(Yu,e)}catch{}}function um(e){if(!(typeof window>"u"))try{window.localStorage.setItem(Xu,ex(e))}catch{}}function bM(){for(const e of Qp)e()}function _h(e){Es={...Es,...e},bM()}function yM(e){return Qp.add(e),()=>{Qp.delete(e)}}function Rb(){return Es}function ix(){return j.useSyncExternalStore(yM,Rb,Rb)}function SM(e){vM(e),_h({renderer:e})}function wM(e){const n=om(e,Es.font.size);um(n),_h({font:n})}function Lb(e){const n=lm(e,Es.font.size);um(n),_h({font:n})}function Mb(e){const n=Es.font.source==="custom"?lm(Es.font.customName,e):om(Es.font.id,e);um(n),_h({font:n})}const xM={allowProposedApi:!0,convertEol:!0,cursorBlink:!0,cursorStyle:"block",lineHeight:1.2},CM=80,EM=16,kM=250,AM=1024*1024,TM=120,RM={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)"},LM={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 rx({operationId:e,ticketPath:n,wsPath:r,theme:a="maritime",onExit:o,active:g,zoom:_=1}){const c=a,{renderer:u,font:d}=ix(),y=j.useRef(null),m=j.useRef(null),w=j.useRef(null),C=j.useRef(null),A=j.useRef(null),E=j.useRef(null),[f,v]=j.useState(_),p=j.useRef(o);p.current=o;const S=j.useRef(g);S.current=g;const[k,L]=j.useState("connecting");j.useEffect(()=>{const T=y.current;if(!T)return;let I=!1;const K=new nM.Terminal({...xM,fontFamily:d.family,fontSize:d.size*f,theme:Nb(c)});m.current=K;const F=new m3.FitAddon;E.current=F,K.loadAddon(F),K.open(T),K.loadAddon(new b3.Unicode11Addon),K.unicode.activeVersion="11";const G=iM(()=>K.input(`
|
|
83
|
-
`)),B=T.querySelector("textarea.xterm-helper-textarea, textarea")??T;B.addEventListener("compositionstart",G.onCompositionStart),B.addEventListener("compositionend",G.onCompositionEnd),B.addEventListener("focusout",G.onCompositionCancel),K.attachCustomKeyEventHandler(G.handleKeyEvent);const X=NM(K,S.current!==!1);A.current=X;const Y=u3({operationId:e,ticketPath:n,wsPath:r,terminal:{onData:P=>K.onData(P),write:X.write},onExit:()=>p.current?.(),onStatus:(P,W)=>{L(W?`${P}: ${W}`:P)}});w.current=Y;let z=null;const q=()=>{F.fit(),Y.resize(K.cols,K.rows)},V=()=>{q(),K.refresh(0,K.rows-1)},D=()=>{z&&clearTimeout(z),z=setTimeout(()=>{z=null,I||V()},CM)},H=async()=>{await document.fonts?.ready,!I&&(q(),Y.start(),S.current!==!1&&K.focus())},O=new ResizeObserver(D);return O.observe(T),H(),()=>{I=!0,O.disconnect(),z&&clearTimeout(z),B.removeEventListener("compositionstart",G.onCompositionStart),B.removeEventListener("compositionend",G.onCompositionEnd),B.removeEventListener("focusout",G.onCompositionCancel),G.dispose(),Y.dispose(),X.dispose(),m.current=null,w.current=null,A.current=null,E.current=null;try{K.dispose()}catch{}}},[e,n,r]),j.useEffect(()=>{if(A.current?.setActive(g!==!1),!g)return;MM(m.current);const T=window.requestAnimationFrame(()=>{S.current===!0&&sx(m.current)});return()=>window.cancelAnimationFrame(T)},[g]),j.useEffect(()=>{const T=m.current;if(!T)return;let I=!1;if(u==="webgl")try{const K=new eM;C.current=K,K.onContextLoss(()=>{if(!I){try{K.dispose()}catch{}C.current===K&&(C.current=null)}}),T.loadAddon(K)}catch{try{C.current?.dispose()}catch{}C.current=null}return()=>{I=!0;const K=C.current;if(K){C.current=null;try{K.dispose()}catch{}}}},[u,e]),j.useEffect(()=>{const T=m.current;T&&(T.options.theme=Nb(c))},[c]),j.useEffect(()=>{const T=m.current;T&&(T.options.fontFamily=d.family,Ob(T,E.current,w.current))},[d.family]),j.useEffect(()=>{if(_===f)return;const T=setTimeout(()=>v(_),TM);return()=>clearTimeout(T)},[_,f]),j.useEffect(()=>{const T=m.current;T&&(T.options.fontSize=d.size*f,Ob(T,E.current,w.current))},[f,d.size]);const R=k.startsWith("live"),M=f===1?void 0:{width:`${f*100}%`,height:`${f*100}%`,transform:`scale(${1/f})`,transformOrigin:"0 0"};return h.jsx("section",{className:"terminal-stage","aria-label":"Terminal",children:h.jsxs("div",{className:"terminal-shell",children:[R?null:h.jsxs("div",{className:"terminal-status","aria-live":"polite",children:[h.jsx("span",{className:"terminal-status-dot","aria-hidden":"true"}),k]}),h.jsx("div",{className:"terminal-viewport",children:h.jsx("div",{className:"terminal-canvas",ref:y,style:M})})]})})}function Nb(e){return e==="carbon"?LM:RM}function MM(e){e&&(e.focus(),sx(e))}function sx(e){e&&(e.scrollToBottom(),e.rows>0&&e.refresh(0,e.rows-1))}function NM(e,n){let r=n,a=!1,o=null,g=0,_=[];const c=()=>{o&&(clearTimeout(o),o=null)},u=()=>{if(c(),a||g===0)return;const y=OM(_,g);_=[],g=0,e.write(y)},d=()=>{a||o||g===0||(o=setTimeout(u,r?EM:kM))};return{write:y=>{if(!(a||y.byteLength===0)){if(_.push(y),g+=y.byteLength,g>=AM){u();return}d()}},setActive:y=>{if(r!==y){if(r=y,c(),r){u();return}d()}},dispose:()=>{u(),a=!0,_=[],g=0,c()}}}function OM(e,n){if(e.length===1)return e[0]??new Uint8Array;const r=new Uint8Array(n);let a=0;for(const o of e)r.set(o,a),a+=o.byteLength;return r}function Ob(e,n,r){n?.fit(),r?.resize(e.cols,e.rows),e.refresh(0,e.rows-1)}const DM=["canonicalCwd","cwd","providerSession","ticket","token","transcriptPath","prompt","persona","toolAllowlist"];class Ji extends Error{status;constructor(n,r){super(r),this.name="AgentApiError",this.status=n}}async function ax(e){const n=await fetch("/plugins/terminal/agent/state",{signal:e});await Ur(n);const r=await n.json();if(!Array.isArray(r.agentClis))throw new Ji(n.status,"Invalid agent state response");return r.agentClis.map(a=>FM(a,n.status))}async function BM(e){const n=await fetch("/plugins/terminal/agent/agent-cli/state",{signal:e});await Ur(n);const r=await n.json();if(!Array.isArray(r.clis))throw new Ji(n.status,"Invalid Agent CLI state response");return r}async function jM(e){const n=await fetch("/plugins/terminal/agent/tenants",{signal:e});await Ur(n);const r=await n.json();if(!Array.isArray(r.tenants))throw new Ji(n.status,"Invalid tenants response");return r.tenants.map(a=>WM(a,n.status))}async function IM(e){const n=await fetch("/plugins/terminal/agent/jobs",{signal:e});await Ur(n);const r=await n.json();if(!Array.isArray(r.tenants))throw new Ji(n.status,"Invalid jobs response");return r.tenants}async function PM(e){const n=await fetch("/plugins/terminal/agent/sessions",{signal:e});await Ur(n);const r=await n.json();if(!Array.isArray(r.sessions))throw new Ji(n.status,"Invalid agent sessions response");return r.sessions.map(a=>vh(a,n.status))}async function zM(e){const n=await fetch("/api/v1/operations",{signal:e});await Ur(n);const r=await n.json();if(!Array.isArray(r.operations))throw new Ji(n.status,"Invalid operations response");return{operations:r.operations.map(a=>GM(a,n.status))}}async function HM(e,n,r){const a=await fetch("/plugins/terminal/agent/sessions",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({theaterId:e,cliId:n}),signal:r});return await Ur(a),vh(await a.json(),a.status)}async function $M(e,n){const r=await fetch(`/plugins/terminal/agent/sessions/${encodeURIComponent(e)}/resume`,{method:"POST",signal:n});return await Ur(r),vh(await r.json(),r.status)}async function UM(e,n){const r=await fetch(`/plugins/terminal/agent/sessions/${encodeURIComponent(e)}`,{method:"DELETE",signal:n});await Ur(r)}function vh(e,n){const r=e;if(!r||typeof r.sessionId!="string"||typeof r.cwdLabel!="string"||typeof r.status!="string"||typeof r.createdAt!="number"||eg(r))throw new Ji(n,"Invalid agent session response");return{sessionId:r.sessionId,terminalSessionId:typeof r.terminalSessionId=="string"?r.terminalSessionId:r.sessionId,cwdLabel:r.cwdLabel,label:typeof r.label=="string"?r.label:void 0,cliId:typeof r.cliId=="string"?r.cliId:void 0,cliLabel:typeof r.cliLabel=="string"?r.cliLabel:void 0,status:r.status,turnState:r.turnState==="running"||r.turnState==="ended"?r.turnState:"none",createdAt:r.createdAt,theaterId:typeof r.theaterId=="string"?r.theaterId:void 0,tenantId:typeof r.tenantId=="string"?r.tenantId:void 0,registrationId:typeof r.registrationId=="string"?r.registrationId:void 0,resumeAvailable:r.resumeAvailable===!0}}async function Ur(e){if(!e.ok)throw new Ji(e.status,`Agent plugin request failed: ${e.status}`)}function FM(e,n){const r=e;if(!r||typeof r.id!="string"||typeof r.label!="string")throw new Ji(n,"Invalid Agent CLI metadata response");return{id:r.id,label:r.label,available:r.available===!0,signedIn:r.signedIn!==!1}}function WM(e,n){const r=e;if(!r||typeof r.tenantId!="string"||typeof r.tenantLabel!="string"||typeof r.createdAt!="number"||typeof r.sessions!="number")throw new Ji(n,"Invalid tenant response");return r}function GM(e,n){const r=e;if(!r||typeof r.id!="string"||typeof r.theaterId!="string"||typeof r.type!="string"||typeof r.pluginId!="string"||typeof r.title!="string"||!r.payload||typeof r.payload!="object"||Array.isArray(r.payload)||!r.ts||typeof r.ts.createdAt!="number"||typeof r.ts.updatedAt!="number"||eg(r)||eg(r.payload))throw new Ji(n,"Invalid operation response");return{id:r.id,theaterId:r.theaterId,type:r.type,pluginId:r.pluginId,title:r.title,payload:r.payload,geometry:r.geometry??null,ts:r.ts}}function eg(e){return tg(e,new Set(DM))}function tg(e,n){return!e||typeof e!="object"?!1:Array.isArray(e)?e.some(r=>tg(r,n)):Object.entries(e).some(([r,a])=>n.has(r)||tg(a,n))}const qM="active",ng=new Set(["done","error","aborted"]);function KM(e,n){let r=ig(e,n.jobId,n.updatedAt);for(const a of n.events)r=ox(r,a);return ng.has(n.status)&&!ng.has(r.status)&&(r={...r,status:n.status}),r}function ox(e,n){if(n.id<=e.lastEventId)return e;const r=n.event,a={...e,updatedAt:n.at,lastEventId:n.id,recentEvents:XM(e.recentEvents,n)};switch(n.type){case"job:registered":return VM(a,r);case"job:finalized":return{...a,status:un(r.status)??"done",finishedAt:bs(r.finishedAt)??n.at,summary:un(r.summary),error:un(r.error)};case"track:begin":return Wa(a,r,o=>({...o,startedAt:bs(r.startedAt)??n.at,requestPreview:un(r.requestPreview)}));case"track:status":return Wa(a,r,o=>({...o,status:un(r.status)??o.status}));case"track:text":return Wa(a,r,o=>({...o,status:"stream",text:o.text+(un(r.text)??""),sentTextLength:o.sentTextLength+(bs(r.textLength)??un(r.text)?.length??0)}));case"track:thought":return Wa(a,r,o=>({...o,thought:o.thought+(un(r.text)??""),sentThoughtLength:o.sentThoughtLength+(bs(r.textLength)??un(r.text)?.length??0)}));case"track:tool":return Wa(a,r,o=>({...o,status:"stream",tools:YM(o.tools,r)}));case"track:finalized":return Wa(a,r,o=>{const g=Db(o.text,o.sentTextLength,un(r.fallbackText),bs(r.fallbackTextLength)),_=Db(o.thought,o.sentThoughtLength,un(r.fallbackThought),bs(r.fallbackThoughtLength));return{...o,status:un(r.status)??"done",finishedAt:bs(r.finishedAt)??n.at,error:un(r.error),text:g.text,sentTextLength:g.sentLength,thought:_.text,sentThoughtLength:_.sentLength}});default:return a}}function ig(e,n,r){return{jobId:n,tenantId:e,status:qM,updatedAt:r,trackOrder:[],tracks:{},lastEventId:0,recentEvents:[]}}function lx(e){return ng.has(e)}function VM(e,n){const r=Array.isArray(n.tracks)?n.tracks:[];let a=e.trackOrder,o=e.tracks;for(const g of r){if(!g.trackId)continue;const _=o[g.trackId],c={..._??cx(g.trackId),displayName:g.displayName??_?.displayName??g.trackId,displayCli:g.displayCli??_?.displayCli,model:g.model??_?.model,effort:g.effort??_?.effort,subtitle:g.subtitle??_?.subtitle,kind:g.kind??_?.kind,startedAt:g.startedAt??_?.startedAt};_||(a=[...a,g.trackId]),o={...o,[g.trackId]:c}}return{...e,label:un(n.label)??e.label,ownerCarrierId:un(n.ownerCarrierId)??e.ownerCarrierId,kind:un(n.kind)??e.kind,startedAt:bs(n.startedAt)??e.startedAt,trackOrder:a,tracks:o}}function Wa(e,n,r){const a=un(n.trackId);if(!a)return e;const o=e.tracks[a],g=r(o??cx(a));return{...e,trackOrder:o?e.trackOrder:[...e.trackOrder,a],tracks:{...e.tracks,[a]:g}}}function cx(e){return{trackId:e,displayName:e,status:"active",text:"",thought:"",sentTextLength:0,sentThoughtLength:0,tools:[]}}function YM(e,n){const r=un(n.toolId)??un(n.id);if(!r)return e;const a={id:r,name:un(n.name),input:n.input,output:n.output,status:un(n.status)},o=e.findIndex(g=>g.id===r);return o>=0?[...e.slice(0,o),{...e[o],...a},...e.slice(o+1)]:[...e,a]}function Db(e,n,r,a){return r?n>=(a??r.length)?{text:e,sentLength:n}:{text:r,sentLength:a??r.length}:{text:e,sentLength:n}}function XM(e,n){return[...e,n].slice(-120)}function un(e){return typeof e=="string"?e:void 0}function bs(e){return typeof e=="number"&&Number.isFinite(e)?e:void 0}const ZM=new Set(["idle_prompt","permission_prompt","auth_success","elicitation_dialog","elicitation_complete","elicitation_response"]);function JM(){let e="";return n=>{e+=n;const r=[];let a=e.indexOf(`
|
|
84
|
-
|
|
85
|
-
`);for(;a>=0;){const o=e.slice(0,a);e=e.slice(a+2);const g=e6(o);g&&r.push(g),a=e.indexOf(`
|
|
86
|
-
|
|
87
|
-
`)}return r}}function QM(e){if(!e.data)return null;let n;try{n=JSON.parse(e.data)}catch{return null}if(e.event==="observer:truncated"){const a=n.tenant?.tenantId;return!a||!n.truncation?null:{kind:"truncation",tenantId:a,tenantLabel:n.tenant?.tenantLabel,truncation:n.truncation}}if(e.event==="session:updated"){const a=jb(n.session);return a?{kind:"session",tenantId:a.tenantId??a.sessionId,session:a}:null}if(e.event==="session:attention"){const a=jb(n.session);return a?{kind:"attention",tenantId:a.tenantId??a.sessionId,session:a,reason:t6(n.reason)}:null}const r=Bb(n.event)??Bb(n);return r?{kind:"event",tenantId:r.tenantId,tenantLabel:n.tenant?.tenantLabel,event:r}:null}function e6(e){const n=e.split(`
|
|
88
|
-
`),r=n.find(o=>o.startsWith("event:"))?.slice(6).trim()??"message",a=n.filter(o=>o.startsWith("data:")).map(o=>o.slice(5).trim()).join(`
|
|
89
|
-
`);return!a&&r==="message"?null:{event:r,data:a}}function Bb(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 jb(e){try{return vh(e,200)}catch{return null}}function t6(e){return typeof e=="string"&&ZM.has(e)?e:void 0}const hm={droppedCount:0},rg=new Set;let Ut={connection:"connecting",connectionError:null,agentClis:[],sessions:{},sessionOrder:[],tenants:[],tenantJobs:{},tenantOrder:[],activeTerminalSessionId:null,turnState:{}};function n6(){return _S(i6,ux)}function ux(){return Ut}function i6(e){return rg.add(e),()=>{rg.delete(e)}}function bi(e){Ut={...Ut,...e},c6()}function hx(e){bi({agentClis:e})}function r6(e){const n={};for(const r of e)n[r.sessionId]=r;bi({sessions:n,sessionOrder:[...e].sort((r,a)=>a.createdAt-r.createdAt).map(r=>r.sessionId)})}function Zu(e){const n=!!Ut.sessions[e.sessionId];bi({sessions:{...Ut.sessions,[e.sessionId]:e},sessionOrder:n?Ut.sessionOrder:[e.sessionId,...Ut.sessionOrder],turnState:{...Ut.turnState,[e.sessionId]:e.turnState}})}function dx(e){const{[e]:n,...r}=Ut.sessions,{[e]:a,...o}=Ut.turnState;bi({sessions:r,sessionOrder:Ut.sessionOrder.filter(g=>g!==e),activeTerminalSessionId:Ut.activeTerminalSessionId===e?null:Ut.activeTerminalSessionId,turnState:o})}function fx(e){bi({activeTerminalSessionId:e})}function s6(e){bi({tenants:e,tenantOrder:[...e.map(n=>n.tenantId),...Ut.tenantOrder.filter(n=>!e.some(r=>r.tenantId===n)&&Ut.tenantJobs[n])]})}function a6(e){const n={};for(const r of e){const a={};for(const o of r.jobs)a[o.jobId]=KM(r.tenantId,o);n[r.tenantId]={tenantId:r.tenantId,tenantLabel:r.tenantLabel,jobOrder:r.jobs.map(o=>o.jobId),jobs:a,truncation:r.truncation??hm}}bi({tenantJobs:n,tenantOrder:[...e.map(r=>r.tenantId),...Ut.tenantOrder.filter(r=>n[r])]})}function o6(e,n){const r=e.tenantId,a=e.jobId??u6(e),o=Ut.tenantJobs[r]??{tenantId:r,tenantLabel:n,jobOrder:[],jobs:{},truncation:hm},g=a?o.jobs[a]??ig(r,a,e.at):ig(r,"__unknown__",e.at),_=ox(g,e),c=a&&o.jobOrder.includes(a)?o.jobOrder:a?[a,...o.jobOrder]:o.jobOrder,u={...o,tenantLabel:n??o.tenantLabel,jobOrder:c,jobs:a?{...o.jobs,[a]:_}:o.jobs};return bi({tenantJobs:{...Ut.tenantJobs,[r]:u},tenantOrder:Ut.tenantOrder.includes(r)?Ut.tenantOrder:[r,...Ut.tenantOrder]}),{job:_,unknownTenant:!Ut.tenantJobs[r]}}function l6(e,n,r){const a=Ut.tenantJobs[e]??{tenantId:e,tenantLabel:n,jobOrder:[],jobs:{},truncation:hm};bi({tenantJobs:{...Ut.tenantJobs,[e]:{...a,tenantLabel:n??a.tenantLabel,truncation:r}}})}function px(e){const n=e.tenantId;if(!n)return[];const r=Ut.tenantJobs[n];return r?r.jobOrder.map(a=>r.jobs[a]).filter(a=>!!a):[]}function c6(){for(const e of rg)e()}function u6(e){const n=e.event;return typeof n.jobId=="string"?n.jobId:null}const Ib=250,h6=5e3,sg=new Map;function d6(e){const n=new AbortController;return f6(n.signal,e),()=>n.abort()}async function f6(e,n){let r=Ib;for(;!e.aborted;){bi({connection:"connecting"});try{await _6(e,n);const a=await fetch("/plugins/terminal/agent/events",{signal:e});if(!a.ok||!a.body)throw new Error(`Agent stream failed: ${a.status}`);bi({connection:"live",connectionError:null}),r=Ib,await p6(a.body.getReader(),e,n),e.aborted||bi({connection:"connecting",connectionError:null})}catch(a){if(e.aborted)return;bi({connection:"connecting",connectionError:a instanceof Error?a.message:String(a)})}if(e.aborted)return;await b6(r,e),r=Math.min(r*2,h6)}}async function p6(e,n,r){const a=new TextDecoder,o=JM();for(;!n.aborted;){const g=await e.read();if(g.done)return;for(const _ of o(a.decode(g.value,{stream:!0}))){const c=QM(_);if(c){if(c.kind==="truncation"&&c.truncation){l6(c.tenantId,c.tenantLabel,c.truncation);continue}if(c.kind==="session"&&c.session){Zu(c.session),Ju(r,c.session.sessionId,dm(c.session));continue}if(c.kind==="attention"&&c.session){Zu(c.session),c.reason!=="idle_prompt"&&Ju(r,c.session.sessionId,"awaiting");continue}c.event&&(o6(c.event,c.tenantLabel),m6(r,c.event.tenantId))}}}}function dm(e){return e.status==="dormant"?"dormant":e.turnState==="running"||e.turnState==="ended"&&g6(e)?"running":"idle"}function g6(e){return px(e).some(n=>!lx(n.status))}function Ju(e,n,r){const a=sg.get(n);e.status.set(n,r),sg.set(n,r),a!==r&&(r==="awaiting"?e.notifications.emit({kind:"agent.attention",operationId:n,message:"Agent is waiting for input"}):r==="idle"&&(a==="running"||a==="awaiting")&&e.notifications.emit({kind:"agent.ended",operationId:n,message:"Agent turn ended"}))}function m6(e,n){const{sessions:r}=ux();for(const a of Object.values(r))a.tenantId===n&&sg.get(a.sessionId)!=="awaiting"&&Ju(e,a.sessionId,dm(a))}async function _6(e,n){const[r,a,o,g,_]=await Promise.all([ax(e),PM(e),jM(e),IM(e),zM(e)]);hx(r),r6(a),s6(o),a6(g);for(const c of a)Ju(n,c.sessionId,dm(c));v6(_.operations,n)}function v6(e,n){for(const r of e)r.pluginId==="terminal"&&r.type==="agent.streaming"&&n.operations.remove(r.id).catch(()=>{})}async function b6(e,n){await new Promise(r=>{const a=()=>{clearTimeout(o),n.removeEventListener("abort",a),r()},o=setTimeout(a,e);n.addEventListener("abort",a)})}class bh extends Error{status;constructor(n,r){super(r),this.name="TerminalModelAuthApiError",this.status=n}}async function y6(e){const n=await fetch("/plugins/terminal/model-auth/state",{signal:e});return await fm(n),mx(await n.json(),n.status)}async function S6(e,n,r){const a=await fetch(`/plugins/terminal/model-auth/providers/${encodeURIComponent(e)}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({apiKey:n}),signal:r});return await fm(a),gx(await a.json(),a.status)}async function w6(e,n){const r=await fetch(`/plugins/terminal/model-auth/providers/${encodeURIComponent(e)}`,{method:"DELETE",signal:n});return await fm(r),gx(await r.json(),r.status)}async function fm(e){if(e.ok)return;let n=e.statusText||`HTTP ${e.status}`;try{const r=await e.json();typeof r.error=="string"&&(n=r.error)}catch{}throw new bh(e.status,n)}function gx(e,n){const r=e;if(!r||typeof r!="object"||!("state"in r))throw new bh(n,"Invalid model auth mutation response");return{state:mx(r.state,n)}}function mx(e,n){const r=e;if(!r||typeof r!="object"||!Array.isArray(r.providers))throw new bh(n,"Invalid model auth state response");return{providers:r.providers.map(a=>x6(a,n))}}function x6(e,n){const r=e;if(typeof r.cli!="string"||typeof r.displayName!="string"||typeof r.signedIn!="boolean")throw new bh(n,"Invalid model auth provider response");return{cli:r.cli,displayName:r.displayName,signedIn:r.signedIn}}const ag=new Set;let og={loading:!1,state:null,busyCli:null,error:null},Pr=0;function C6(){return j.useSyncExternalStore(E6,Pb,Pb)}function Pb(){return og}function E6(e){return ag.add(e),()=>{ag.delete(e)}}async function k6(e){const n=++Pr;zr({loading:!0,error:null});try{const r=await y6(e);if(n!==Pr)return;zr({loading:!1,state:r,error:null})}catch(r){if(e?.aborted||n!==Pr)return;zr({loading:!1,error:pm(r)})}}async function A6(e,n){const r=++Pr;zr({busyCli:e,error:null});try{const a=await S6(e,n);return r!==Pr||(zr({state:a.state,busyCli:null,error:null}),await _x()),!0}catch(a){return r!==Pr||zr({busyCli:null,error:pm(a)}),!1}}async function T6(e){const n=++Pr;zr({busyCli:e,error:null});try{const r=await w6(e);return n!==Pr||(zr({state:r.state,busyCli:null,error:null}),await _x()),!0}catch(r){return n!==Pr||zr({busyCli:null,error:pm(r)}),!1}}async function _x(){try{hx(await ax())}catch{}}function zr(e){og={...og,...e};for(const n of ag)n()}function pm(e){return e instanceof Error?e.message:String(e)}class vx extends Error{status;constructor(n,r){super(r),this.name="TerminalSettingsApiError",this.status=n}}async function R6(e){const n=await fetch("/plugins/terminal/settings",{signal:e});return await bx(n),yx(await n.json(),n.status)}async function L6(e,n){const r=await fetch("/plugins/terminal/settings",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e),signal:n});return await bx(r),yx(await r.json(),r.status)}async function bx(e){if(e.ok)return;let n=e.statusText||`HTTP ${e.status}`;try{const r=await e.json();typeof r.error=="string"&&(n=r.error)}catch{}throw new vx(e.status,n)}function yx(e,n){const r=e;if(!r||typeof r.replaceSystemPrompt!="boolean"||typeof r.enableMetaphor!="boolean")throw new vx(n,"Invalid Terminal settings response");return{replaceSystemPrompt:r.replaceSystemPrompt,enableMetaphor:r.enableMetaphor}}const lg=new Set;let Qu={loading:!1,state:null,savingField:null,error:null},ju=0;function M6(){return j.useSyncExternalStore(N6,zb,zb)}function zb(){return Qu}function N6(e){return lg.add(e),()=>{lg.delete(e)}}async function O6(e){const n=++ju;so({loading:!0,error:null});try{const r=await R6(e);if(n!==ju)return;so({loading:!1,state:r,error:null})}catch(r){if(e?.aborted||n!==ju)return;so({loading:!1,error:Sx(r)})}}async function Hb(e,n){const r=Qu.state;if(!r)return!1;ju+=1;const a={...r,[e]:n};so({state:a,savingField:e,error:null});try{const o=await L6(a);return so({state:o,savingField:null,error:null}),!0}catch(o){return so({state:r,savingField:null,error:Sx(o)}),!1}}function so(e){Qu={...Qu,...e};for(const n of lg)n()}function Sx(e){return e instanceof Error?e.message:String(e)}const D6=[{id:"webgl",label:"WebGL"},{id:"dom",label:"DOM"}],B6="/plugins/terminal/agent/ticket",j6="/plugins/terminal/ws",wx={pluginId:"terminal",type:"agent",title:"Agent",subtitle:e=>Tl(e.payload,"cliLabel")??void 0,render:e=>h.jsx(z6,{context:e})},xx={id:"agent-cli",title:"Agent CLI",render:()=>h.jsx(H6,{})},Cx={id:"agent.attention",title:"Agent input waiting"},I6={id:"agent.ended",title:"Agent turn ended"},bu={id:"terminal",operationKinds:[wx],settingsSections:[xx],notificationKinds:[Cx,I6],install:e=>P6(e),closeOperation:async e=>{try{await UM(e)}finally{dx(e)}},launch:async({theaterId:e,kind:n})=>{const r=await HM(e,n.id);return Zu(r),fx(r.sessionId),{id:r.sessionId}},renderLaunchIcon:()=>h.jsx(t4,{})};function P6(e){return d6({operations:e.operations,notifications:e.notifications,status:e.status,refreshOperations:e.api.resync})}function z6({context:e}){const r=n6().sessions[e.operationId]??V6(e),[a,o]=j.useState(!1),g=j.useRef(null),_=j.useRef(null),c=j.useRef(null),d=px(r).filter(C=>!lx(C.status)),y=d[0]??null,m=d.reduce((C,A)=>C+A.trackOrder.length,0),w=j.useCallback(()=>{o(!1),g.current?.focus()},[]);return j.useLayoutEffect(()=>{a&&_.current?.focus()},[a]),j.useEffect(()=>{if(!a)return;const C=A=>{if(A.key==="Escape"){A.stopPropagation(),w();return}if(A.key==="Tab"){const E=c.current;if(!E)return;const f=Array.from(E.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])')).filter(S=>!S.hasAttribute("disabled")),v=f[0],p=f[f.length-1];A.shiftKey&&document.activeElement===v?(A.preventDefault(),p?.focus()):!A.shiftKey&&document.activeElement===p&&(A.preventDefault(),v?.focus())}};return document.addEventListener("keydown",C,!0),()=>document.removeEventListener("keydown",C,!0)},[a,w]),r.status==="dormant"?h.jsxs("button",{type:"button",className:"canvas-operation-dormant",onClick:()=>{K6(r.sessionId)},children:[h.jsx("span",{className:"canvas-operation-dormant-status",children:"Dormant"}),h.jsx("span",{className:"canvas-operation-dormant-action",children:"Resume"})]}):h.jsxs("div",{className:"agent-stream-host",children:[y?h.jsxs("button",{ref:g,type:"button",className:"job-summary job-summary--banner job-summary--live","aria-label":d.length>1?`${d.length} carriers streaming${m>0?`, ${m} tracks`:""} — click to expand`:`${y.label??y.jobId}${m>0?`, ${m} tracks`:""} — click to expand`,onClick:()=>o(!0),children:[h.jsxs("span",{className:"job-summary-row",children:[h.jsx("span",{className:"job-summary-dot","aria-hidden":"true"}),h.jsx("span",{className:"job-summary-eyebrow",children:d.length>1?`${d.length} carriers`:y.ownerCarrierId??"Carrier"}),m>0?h.jsx("span",{className:"job-summary-count","aria-hidden":"true",children:m}):null,h.jsx("span",{className:"job-summary-chev","aria-hidden":"true",children:"›"})]}),h.jsx("p",{className:"job-summary-text",children:y.label??y.jobId})]}):null,h.jsx(rx,{operationId:r.sessionId,ticketPath:B6,wsPath:j6,active:e.active,zoom:e.zoom,theme:e.theme,onExit:()=>dx(r.sessionId)}),a?h.jsxs("div",{ref:c,className:"job-overlay",role:"dialog","aria-modal":"true","aria-label":"Carrier stream details",children:[h.jsx("button",{type:"button",className:"job-overlay-scrim","aria-label":"Close",tabIndex:-1,onClick:w}),h.jsxs("div",{className:"job-overlay-card",children:[h.jsx("button",{ref:_,type:"button",className:"job-overlay-close","aria-label":"Close",onClick:w,children:"×"}),h.jsx("div",{className:"job-overlay-body",children:d.length===0?h.jsx("p",{className:"job-overlay-empty",children:"No active streams."}):d.map(C=>h.jsx(G6,{job:C},C.jobId))})]})]}):null]})}function H6(){const[e,n]=j.useState([]),[r,a]=j.useState(null),{renderer:o,font:g}=ix();return j.useEffect(()=>{const _=new AbortController;return BM(_.signal).then(c=>n(c.clis)).catch(c=>{_.signal.aborted||a(c instanceof Error?c.message:String(c))}),()=>_.abort()},[]),h.jsxs(h.Fragment,{children:[h.jsx($6,{}),h.jsx(U6,{}),h.jsxs("section",{className:"global-settings-card","aria-label":"Agent CLI Available",children:[h.jsx("div",{className:"agent-cli-head",children:h.jsx("p",{className:"global-settings-resp-title",children:"Agent CLI Available"})}),h.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."}),r?h.jsx("p",{className:"settings-error",children:r}):null,h.jsx("div",{className:"agent-cli-list",children:e.map(_=>h.jsx(W6,{cli:_},_.id))}),h.jsx("p",{className:"global-settings-foot",children:"Install or update a CLI, then reopen this page to re-check availability."})]}),h.jsx(Y6,{terminalFont:g}),h.jsx(X6,{terminalRenderer:o})]})}function $6(){const e=M6(),n=e.state,r=e.savingField!==null;return j.useEffect(()=>{const a=new AbortController;return O6(a.signal),()=>a.abort()},[]),h.jsxs("section",{className:"global-settings-card","aria-label":"System Prompt",children:[e.error?h.jsx("p",{className:"global-settings-error",role:"alert",children:e.error}):null,n?h.jsxs(h.Fragment,{children:[h.jsx($b,{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:r,onToggle:()=>{Hb("replaceSystemPrompt",!n.replaceSystemPrompt)}}),h.jsx($b,{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:r,onToggle:()=>{Hb("enableMetaphor",!n.enableMetaphor)}})]}):h.jsx("p",{className:"global-settings-help",children:e.loading?"Loading settings.":"Settings unavailable."}),h.jsx("p",{className:"global-settings-foot",children:"Changes apply to newly launched sessions. Running sessions keep their current configuration until relaunched."})]})}function $b({title:e,help:n,onLabel:r,offLabel:a,value:o,disabled:g,onToggle:_}){return h.jsxs("div",{className:"global-settings-row",children:[h.jsxs("div",{className:"global-settings-row-text",children:[h.jsx("p",{className:"global-settings-resp-title",children:e}),h.jsx("p",{className:"global-settings-help",children:n})]}),h.jsx("button",{type:"button",className:`global-settings-toggle ${o?"is-on":""}`,disabled:g,"aria-pressed":o,onClick:_,children:h.jsx("span",{children:o?r:a})})]})}function U6(){const e=C6();return j.useEffect(()=>{const n=new AbortController;return k6(n.signal),()=>n.abort()},[]),h.jsxs("section",{className:"global-settings-card","aria-label":"Model sign-in",children:[h.jsxs("div",{className:"model-auth-head",children:[h.jsx("p",{className:"global-settings-resp-title",children:"Model Sign-in"}),h.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?h.jsx("p",{className:"global-settings-error",role:"alert",children:e.error}):null,e.loading&&!e.state?h.jsx("p",{className:"global-settings-help",children:"Loading sign-in state."}):null,e.state?.providers.map(n=>h.jsx(F6,{provider:n,busy:e.busyCli===n.cli},n.cli)),h.jsx("p",{className:"global-settings-foot",children:"Sign-in changes apply to newly launched sessions. Running sessions keep their current credentials until relaunched."})]})}function F6({provider:e,busy:n}){const[r,a]=j.useState(""),o=async()=>{await A6(e.cli,r)&&a("")},g=async()=>{await T6(e.cli)};return h.jsxs("div",{className:"model-auth-row",children:[h.jsxs("div",{className:"model-auth-row-head",children:[h.jsx("span",{className:"model-auth-name",children:e.displayName}),h.jsx("span",{className:`model-auth-status ${e.signedIn?"is-on":""}`,children:e.signedIn?"Signed in":"Not signed in"})]}),e.signedIn?h.jsx("div",{className:"model-auth-actions",children:h.jsx("button",{type:"button",className:"model-auth-button",disabled:n,onClick:()=>{g()},children:n?"Working…":"Sign out"})}):h.jsxs("form",{className:"model-auth-form",onSubmit:_=>{_.preventDefault(),o()},children:[h.jsx("input",{type:"password",className:"model-auth-input",placeholder:"API key",value:r,autoComplete:"off",spellCheck:!1,disabled:n,"aria-label":`${e.displayName} API key`,onChange:_=>a(_.target.value)}),h.jsx("button",{type:"submit",className:"model-auth-button is-primary",disabled:n||r.trim().length===0,children:n?"Verifying…":"Sign in"})]})]})}function W6({cli:e}){return h.jsxs("div",{className:"agent-cli-row",children:[h.jsx("span",{className:"agent-cli-name",children:e.displayName}),h.jsxs("span",{className:"agent-cli-meta",children:[e.available&&e.version?h.jsx("span",{className:"agent-cli-version",children:e.version}):null,h.jsx("span",{className:`agent-cli-status ${e.available?"is-on":""}`,children:e.available?"Available":"Missing"})]})]})}function G6({job:e}){return h.jsxs(h.Fragment,{children:[h.jsxs("div",{className:"job-overlay-head",children:[h.jsx("span",{className:"job-overlay-kicker",children:e.status}),h.jsx("strong",{children:e.label??e.jobId})]}),h.jsx("div",{className:"job-overlay-tracks",children:e.trackOrder.map(n=>{const r=e.tracks[n];return r?h.jsx(q6,{track:r},r.trackId):null})})]})}function q6({track:e}){const n=e4(e.status),r=n==="track-card--live";return h.jsxs("article",{className:n?`track-card ${n}`:"track-card",children:[h.jsxs("header",{className:"track-card-head",children:[h.jsx("span",{className:"track-card-title",children:e.displayName}),h.jsx("span",{className:"track-card-status",children:e.status})]}),e.thought?h.jsxs("div",{className:"track-card-thought",role:"group","aria-label":"Thinking",children:[h.jsx("span",{className:"track-card-section-label","aria-hidden":"true",children:"thinking"}),h.jsx("pre",{children:e.thought})]}):null,e.text?h.jsxs("div",{className:"track-card-text",role:"group","aria-label":"Output",children:[h.jsx("span",{className:"track-card-section-label track-card-section-label--output","aria-hidden":"true",children:"output"}),h.jsxs("pre",{children:[e.text,r?h.jsx("span",{className:"track-card-caret","aria-hidden":"true"}):null]})]}):null,e.error?h.jsx("div",{className:"track-card-error",role:"group","aria-label":"Error",children:e.error}):null,e.tools.length>0?h.jsx("ul",{className:"track-card-tools",children:e.tools.map(a=>h.jsx("li",{children:a.name??a.id},a.id))}):null]})}async function K6(e){Zu(await $M(e)),fx(e)}function V6(e){return{sessionId:e.operation.id,terminalSessionId:e.operation.id,cwdLabel:e.operation.title||"Workspace",label:e.operation.title,cliId:Tl(e.operation.payload,"cliId")??void 0,cliLabel:Tl(e.operation.payload,"cliLabel")??void 0,status:"dormant",turnState:"none",createdAt:e.operation.ts.createdAt,theaterId:e.theaterId,tenantId:Tl(e.operation.payload,"tenantId")??void 0,registrationId:Tl(e.operation.payload,"registrationId")??void 0,resumeAvailable:!0}}function Tl(e,n){const r=e[n];return typeof r=="string"?r:null}function Y6({terminalFont:e}){const n=tx(e),r=J6(e);return h.jsxs("section",{className:"global-settings-card","aria-label":"Terminal Font",children:[h.jsxs("div",{className:"global-settings-row is-stack",children:[h.jsxs("div",{className:"global-settings-row-text",children:[h.jsxs("p",{className:"global-settings-resp-title",children:["Terminal Font ",h.jsx("span",{className:"new-badge",children:"New"})]}),h.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."})]}),h.jsxs("div",{className:"font-control","aria-describedby":"terminal-font-help",children:[h.jsxs("div",{className:"current-readout","aria-live":"polite",children:[h.jsx("span",{className:"cr-label",children:"Currently"}),h.jsx("span",{className:"cr-value",children:r}),h.jsx("span",{className:"cr-sep",children:"·"}),h.jsxs("span",{className:"cr-value",children:[e.size,"px"]}),h.jsx("span",{className:"cr-sep",children:"·"}),h.jsx("span",{className:`cr-value ${n.status==="fallback"?"is-fallback":"is-ok"}`,children:n.status})]}),h.jsxs("div",{className:"font-cards",role:"group","aria-label":"Terminal font family",children:[mh.map(a=>h.jsx(Z6,{font:a,active:e.source==="curated"&&e.id===a.id,onSelect:()=>wM(a.id)},a.id)),h.jsxs("button",{type:"button","aria-pressed":e.source==="custom",className:`font-card ${e.source==="custom"?"is-active":""}`,onClick:()=>{e.source!=="custom"&&Lb("")},children:[h.jsxs("span",{className:"fc-name",children:["Custom…",h.jsx("span",{className:"fc-check","aria-hidden":"true",children:"✓"})]}),h.jsx("span",{className:"fc-sample is-custom","aria-hidden":"true",children:"type a font"}),h.jsx("span",{className:"fc-meta",children:"your installed face"}),h.jsx("span",{className:"fc-bundled fc-addon",children:"local OS font"})]})]}),h.jsx("div",{className:`custom-reveal ${e.source==="custom"?"is-open":""}`,children:h.jsxs("div",{className:"font-field-wrap",children:[h.jsxs("label",{className:"font-field",children:[h.jsx("span",{className:"field-icon","aria-hidden":"true",children:"Aa"}),h.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:a=>Lb(a.currentTarget.value)})]}),h.jsxs("div",{className:`resolve-chip ${n.status==="fallback"?"is-fallback":"is-ok"}`,"aria-live":"polite",children:[h.jsx("span",{className:"rc-dot","aria-hidden":"true"}),h.jsx("span",{children:Q6(e)})]})]})}),h.jsxs("div",{className:"size-row",children:[h.jsxs("div",{className:"size-stepper",role:"group","aria-label":"Font size",children:[h.jsx("button",{type:"button","aria-label":"Decrease terminal font size",disabled:e.size<=Eb.min,onClick:()=>Mb(e.size-1),children:"−"}),h.jsxs("span",{className:"size-val",children:[e.size,h.jsx("span",{children:" px"})]}),h.jsx("button",{type:"button","aria-label":"Increase terminal font size",disabled:e.size>=Eb.max,onClick:()=>Mb(e.size+1),children:"+"})]}),h.jsx("span",{className:"size-label",children:"Cell size — rescales every panel; zoom stays relative"})]})]})]}),h.jsx("p",{className:"global-settings-foot",children:"Appearance preferences apply immediately and are stored per browser, separate from session settings."})]})}function X6({terminalRenderer:e}){return h.jsx("section",{className:"global-settings-card","aria-label":"Terminal Renderer",children:h.jsxs("div",{className:"global-settings-row",children:[h.jsxs("div",{className:"global-settings-row-text",children:[h.jsx("p",{className:"global-settings-resp-title",children:"Terminal Renderer"}),h.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."})]}),h.jsx("div",{className:"segmented",role:"group","aria-label":"Terminal renderer",children:D6.map(n=>{const r=n.id===e;return h.jsx("button",{type:"button","aria-pressed":r,className:`segmented-option ${r?"is-active":""}`,onClick:()=>SM(n.id),children:n.label},n.id)})})]})})}function Z6({active:e,font:n,onSelect:r}){return h.jsxs("button",{type:"button","aria-pressed":e,className:`font-card ${e?"is-active":""}`,onClick:r,children:[h.jsxs("span",{className:"fc-name",children:[n.name,h.jsx("span",{className:"fc-check","aria-hidden":"true",children:"✓"})]}),h.jsx("span",{className:"fc-sample",style:{fontFamily:n.family},"aria-hidden":"true",children:"Ag 0O ─┼ =>"}),h.jsx("span",{className:"fc-meta",children:n.meta}),h.jsx("span",{className:"fc-bundled",children:"self-hosted"})]})}function J6(e){return e.source==="custom"?e.customName||`${Vu(null).name} (default)`:Vu(e.id).name}function Q6(e){if(!e.customName)return`Empty — using default ${Vu(null).name}`;const n=tx(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 t4(){return h.jsxs("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:[h.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"}),h.jsx("path",{d:"M6.2 7.9h3.6M8 6.1v3.6",fill:"none",stroke:"currentColor",strokeWidth:"1.15",strokeLinecap:"round"})]})}const n4="/plugins/terminal/shell/ticket",i4="/plugins/terminal/ws",Ex={pluginId:"terminal",type:"shell",title:"Shell",subtitle:()=>"shell",render:e=>j.createElement(r4,{context:e})},Qf={id:"terminal",operationKinds:[Ex],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:()=>h.jsx(s4,{})};function r4({context:e}){return h.jsx(rx,{operationId:e.operationId,active:e.active,zoom:e.zoom,ticketPath:n4,wsPath:i4,theme:e.theme,onExit:e.onClose})}function s4(){return h.jsxs("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:[h.jsx("rect",{x:"2.8",y:"3.4",width:"10.4",height:"9.2",rx:"1.4",fill:"none",stroke:"currentColor",strokeWidth:"1.15"}),h.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 a4=new Set(["agent"]),o4={id:"terminal",operationKinds:[Ex,wx],settingsSections:[xx],notificationKinds:[Cx],install:e=>bu.install?.(e),closeOperation:async e=>{const n=await c4(e);if(n?.type==="shell"){await Qf.closeOperation?.(e);return}n&&a4.has(n.type)&&await bu.closeOperation?.(e)},launch:async e=>e.kind.type==="shell"?Qf.launch?.(e)??{id:""}:bu.launch?.(e)??{id:""},renderLaunchIcon:e=>e.type==="shell"?Qf.renderLaunchIcon?.(e):bu.renderLaunchIcon?.(e)},l4=[o4];async function c4(e){const n=await fetch(`/api/v1/operations/${encodeURIComponent(e)}`);if(!n.ok)return null;const r=await n.json();return typeof r.operation?.type=="string"?{type:r.operation.type}:null}const se={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"},u4={src:se.ts,lib:se.ts,app:se.ts,test:se.shell,tests:se.shell,__tests__:se.shell,spec:se.shell,specs:se.shell,node_modules:se.binary,vendor:se.binary,dist:se.config,build:se.config,out:se.config,target:se.config,docs:se.md,doc:se.md,public:se.data,assets:se.data,static:se.data,components:se.image,scripts:se.js,styles:se.css,".git":se.html,".github":se.config,".vscode":se.css},Ub={ts:{shape:"angle",tone:se.ts},tsx:{shape:"angle",tone:se.ts},mts:{shape:"angle",tone:se.ts},cts:{shape:"angle",tone:se.ts},"d.ts":{shape:"angle",tone:se.ts},js:{shape:"angle",tone:se.js},jsx:{shape:"angle",tone:se.js},mjs:{shape:"angle",tone:se.js},cjs:{shape:"angle",tone:se.js},json:{shape:"braces",tone:se.json},jsonc:{shape:"braces",tone:se.json},json5:{shape:"braces",tone:se.json},jsonl:{shape:"braces",tone:se.json},graphql:{shape:"braces",tone:se.image},gql:{shape:"braces",tone:se.image},proto:{shape:"braces",tone:se.go},css:{shape:"hash",tone:se.css},scss:{shape:"hash",tone:se.css},sass:{shape:"hash",tone:se.css},less:{shape:"hash",tone:se.css},styl:{shape:"hash",tone:se.css},html:{shape:"markup",tone:se.html},htm:{shape:"markup",tone:se.html},xml:{shape:"markup",tone:se.html},xhtml:{shape:"markup",tone:se.html},vue:{shape:"markup",tone:se.shell},svelte:{shape:"markup",tone:se.rust},astro:{shape:"markup",tone:se.image},md:{shape:"doc",tone:se.md},mdx:{shape:"doc",tone:se.md},markdown:{shape:"doc",tone:se.md},rst:{shape:"doc",tone:se.md},txt:{shape:"doc",tone:se.default},text:{shape:"doc",tone:se.default},log:{shape:"doc",tone:se.default},adoc:{shape:"doc",tone:se.md},pdf:{shape:"doc",tone:se.ruby},py:{shape:"angle",tone:se.py},pyi:{shape:"angle",tone:se.py},pyw:{shape:"angle",tone:se.py},go:{shape:"angle",tone:se.go},rs:{shape:"angle",tone:se.rust},rb:{shape:"angle",tone:se.ruby},rake:{shape:"angle",tone:se.ruby},gemspec:{shape:"angle",tone:se.ruby},java:{shape:"angle",tone:se.html},kt:{shape:"angle",tone:se.config},kts:{shape:"angle",tone:se.config},scala:{shape:"angle",tone:se.ruby},c:{shape:"angle",tone:se.ts},h:{shape:"angle",tone:se.ts},cpp:{shape:"angle",tone:se.css},cc:{shape:"angle",tone:se.css},cxx:{shape:"angle",tone:se.css},hpp:{shape:"angle",tone:se.css},cs:{shape:"angle",tone:se.config},php:{shape:"angle",tone:se.config},swift:{shape:"angle",tone:se.html},lua:{shape:"angle",tone:se.ts},dart:{shape:"angle",tone:se.go},sh:{shape:"terminal",tone:se.shell},bash:{shape:"terminal",tone:se.shell},zsh:{shape:"terminal",tone:se.shell},fish:{shape:"terminal",tone:se.shell},ps1:{shape:"terminal",tone:se.css},bat:{shape:"terminal",tone:se.shell},cmd:{shape:"terminal",tone:se.shell},yaml:{shape:"gear",tone:se.config},yml:{shape:"gear",tone:se.config},toml:{shape:"gear",tone:se.config},ini:{shape:"gear",tone:se.config},conf:{shape:"gear",tone:se.config},cfg:{shape:"gear",tone:se.config},properties:{shape:"gear",tone:se.config},env:{shape:"gear",tone:se.config},editorconfig:{shape:"gear",tone:se.config},png:{shape:"image",tone:se.image},jpg:{shape:"image",tone:se.image},jpeg:{shape:"image",tone:se.image},gif:{shape:"image",tone:se.image},webp:{shape:"image",tone:se.image},svg:{shape:"image",tone:se.image},ico:{shape:"image",tone:se.image},bmp:{shape:"image",tone:se.image},avif:{shape:"image",tone:se.image},tiff:{shape:"image",tone:se.image},heic:{shape:"image",tone:se.image},mp4:{shape:"image",tone:se.data},mov:{shape:"image",tone:se.data},webm:{shape:"image",tone:se.data},mkv:{shape:"image",tone:se.data},mp3:{shape:"chip",tone:se.shell},wav:{shape:"chip",tone:se.shell},flac:{shape:"chip",tone:se.shell},ogg:{shape:"chip",tone:se.shell},sql:{shape:"database",tone:se.data},csv:{shape:"database",tone:se.data},tsv:{shape:"database",tone:se.data},db:{shape:"database",tone:se.data},sqlite:{shape:"database",tone:se.data},sqlite3:{shape:"database",tone:se.data},parquet:{shape:"database",tone:se.data},zip:{shape:"archive",tone:se.archive},tar:{shape:"archive",tone:se.archive},gz:{shape:"archive",tone:se.archive},tgz:{shape:"archive",tone:se.archive},bz2:{shape:"archive",tone:se.archive},xz:{shape:"archive",tone:se.archive},rar:{shape:"archive",tone:se.archive},"7z":{shape:"archive",tone:se.archive},zst:{shape:"archive",tone:se.archive},bin:{shape:"chip",tone:se.binary},exe:{shape:"chip",tone:se.binary},dll:{shape:"chip",tone:se.binary},so:{shape:"chip",tone:se.binary},dylib:{shape:"chip",tone:se.binary},wasm:{shape:"chip",tone:se.config},class:{shape:"chip",tone:se.binary},lock:{shape:"chip",tone:se.binary},woff:{shape:"chip",tone:se.config},woff2:{shape:"chip",tone:se.config},ttf:{shape:"chip",tone:se.config},otf:{shape:"chip",tone:se.config}},h4={dockerfile:{shape:"chip",tone:se.css},"docker-compose.yml":{shape:"gear",tone:se.css},"docker-compose.yaml":{shape:"gear",tone:se.css},makefile:{shape:"gear",tone:se.html},"cmakelists.txt":{shape:"gear",tone:se.html},".gitignore":{shape:"gear",tone:se.html},".gitattributes":{shape:"gear",tone:se.html},".dockerignore":{shape:"gear",tone:se.html},".npmignore":{shape:"gear",tone:se.html},".npmrc":{shape:"gear",tone:se.ruby},"package.json":{shape:"braces",tone:se.shell},"tsconfig.json":{shape:"braces",tone:se.ts},license:{shape:"doc",tone:se.json},"license.md":{shape:"doc",tone:se.json},licence:{shape:"doc",tone:se.json}},d4={shape:"default",tone:se.default},cg={angle:h.jsxs(h.Fragment,{children:[h.jsx("path",{d:"M5.6 4.5 2.4 8l3.2 3.5",fill:"none",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round"}),h.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"}),h.jsx("path",{d:"M9.1 3.4 6.9 12.6",fill:"none",stroke:"currentColor",strokeWidth:"1.3",strokeLinecap:"round",opacity:"0.55"})]}),braces:h.jsxs(h.Fragment,{children:[h.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"}),h.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"}),h.jsx("circle",{cx:"8",cy:"8",r:"0.85",fill:"currentColor",opacity:"0.6"})]}),hash:h.jsxs(h.Fragment,{children:[h.jsx("path",{d:"M6.6 3 5.2 13M10.8 3 9.4 13",fill:"none",stroke:"currentColor",strokeWidth:"1.35",strokeLinecap:"round"}),h.jsx("path",{d:"M3.6 6.4h9M3.4 9.6h9",fill:"none",stroke:"currentColor",strokeWidth:"1.35",strokeLinecap:"round"})]}),doc:h.jsxs(h.Fragment,{children:[h.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"}),h.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"}),h.jsx("path",{d:"M9 2.7V5.5h2.8",fill:"none",stroke:"currentColor",strokeWidth:"1.1",strokeLinejoin:"round"}),h.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:h.jsxs(h.Fragment,{children:[h.jsx("rect",{x:"2.5",y:"3.6",width:"11",height:"8.8",rx:"1.4",fill:"currentColor",opacity:"0.16"}),h.jsx("rect",{x:"2.5",y:"3.6",width:"11",height:"8.8",rx:"1.4",fill:"none",stroke:"currentColor",strokeWidth:"1.1"}),h.jsx("circle",{cx:"5.9",cy:"6.6",r:"1.1",fill:"currentColor"}),h.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:h.jsxs(h.Fragment,{children:[h.jsx("rect",{x:"2.3",y:"3.3",width:"11.4",height:"9.4",rx:"1.5",fill:"currentColor",opacity:"0.16"}),h.jsx("rect",{x:"2.3",y:"3.3",width:"11.4",height:"9.4",rx:"1.5",fill:"none",stroke:"currentColor",strokeWidth:"1.1"}),h.jsx("path",{d:"M5 6.4 7.3 8 5 9.6",fill:"none",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round"}),h.jsx("path",{d:"M8.4 9.8h3",fill:"none",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round"})]}),gear:h.jsxs(h.Fragment,{children:[h.jsx("circle",{cx:"8",cy:"8",r:"2",fill:"none",stroke:"currentColor",strokeWidth:"1.25"}),h.jsx("circle",{cx:"8",cy:"8",r:"2",fill:"currentColor",opacity:"0.18"}),h.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:h.jsxs(h.Fragment,{children:[h.jsx("path",{d:"M5.6 4.2 2.4 8l3.2 3.8",fill:"none",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round"}),h.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"}),h.jsx("circle",{cx:"8",cy:"8",r:"1.15",fill:"currentColor"})]}),database:h.jsxs(h.Fragment,{children:[h.jsx("ellipse",{cx:"8",cy:"4.6",rx:"4.4",ry:"1.8",fill:"currentColor",opacity:"0.18"}),h.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"}),h.jsx("ellipse",{cx:"8",cy:"4.6",rx:"4.4",ry:"1.8",fill:"none",stroke:"currentColor",strokeWidth:"1.1"}),h.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:h.jsxs(h.Fragment,{children:[h.jsx("path",{d:"M3 5.2 8 3.1l5 2.1v5.6L8 12.9 3 10.8V5.2Z",fill:"currentColor",opacity:"0.16"}),h.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"}),h.jsx("path",{d:"M3 5.2 8 7.3l5-2.1M8 7.3v5.6",fill:"none",stroke:"currentColor",strokeWidth:"1.1",strokeLinejoin:"round"}),h.jsx("path",{d:"M5.5 4.15 10.5 6.25",fill:"none",stroke:"currentColor",strokeWidth:"1",strokeLinecap:"round",opacity:"0.6"})]}),chip:h.jsxs(h.Fragment,{children:[h.jsx("rect",{x:"4.2",y:"4.2",width:"7.6",height:"7.6",rx:"1.1",fill:"currentColor",opacity:"0.16"}),h.jsx("rect",{x:"4.2",y:"4.2",width:"7.6",height:"7.6",rx:"1.1",fill:"none",stroke:"currentColor",strokeWidth:"1.1"}),h.jsx("rect",{x:"6.6",y:"6.6",width:"2.8",height:"2.8",rx:"0.5",fill:"currentColor",opacity:"0.5"}),h.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:h.jsxs(h.Fragment,{children:[h.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"}),h.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"}),h.jsx("path",{d:"M9 2.7V5.5h2.8",fill:"none",stroke:"currentColor",strokeWidth:"1.1",strokeLinejoin:"round"})]}),folderClosed:h.jsxs(h.Fragment,{children:[h.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"}),h.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:h.jsxs(h.Fragment,{children:[h.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"}),h.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"}),h.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"}),h.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 f4({name:e}){const n=g4(e);return h.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:cg[n.shape]})}function p4({name:e,open:n}){const r=u4[e.toLowerCase()]??se.folder;return h.jsx("svg",{className:"fexp-file-svg",width:"15",height:"15",viewBox:"0 0 16 16","aria-hidden":"true",style:{color:`var(--fexp-ic-${r})`},children:n?cg.folderOpen:cg.folderClosed})}function g4(e){const n=e.toLowerCase(),r=h4[n];if(r)return r;if(n.startsWith(".env"))return{shape:"gear",tone:se.config};if(n.startsWith("readme"))return{shape:"doc",tone:se.md};if(n.endsWith(".d.ts"))return Ub["d.ts"];const a=n.lastIndexOf(".");if(a>0&&a<n.length-1){const o=n.slice(a+1),g=Ub[o];if(g)return g}return d4}const m4=200,yu=30,Fb=5,kx="fleet-console.fileExplorer.showHidden";function Ax(e,n,r,a){for(const o of e)if(!(!a&&o.name.startsWith("."))){if(o.name.toLowerCase().includes(r))return!0;if(o.kind==="dir"){const g=n.get(o.relativePath)?.entries;if(g&&Ax(g,n,r,a))return!0}}return!1}function Tx(e,n,r,a,o,g,_,c){const u=[];for(const d of e)if(!(!c&&d.name.startsWith("."))){if(_){const y=d.name.toLowerCase().includes(_),m=d.kind==="dir"&&Ax(g.get(d.relativePath)?.entries??[],g,_,c);if(!y&&!m)continue}if(u.push({entry:d,depth:n,isSelected:r===d.relativePath,isExpanded:a.has(d.relativePath),isLoading:o.has(d.relativePath)}),d.kind==="dir"&&a.has(d.relativePath)){const y=g.get(d.relativePath)?.entries;y&&u.push(...Tx(y,n+1,r,a,o,g,_,c))}}return u}function _4({files:e,theaterId:n,selectedPath:r,onSelect:a}){const[o,g]=j.useState(null),[_,c]=j.useState(null),[u,d]=j.useState(""),[y,m]=j.useState(new Set),[w,C]=j.useState(new Set),[A,E]=j.useState(new Map),[f,v]=j.useState(""),[p,S]=j.useState(0),[k,L]=j.useState(600),[R,M]=j.useState(()=>v4()),T=j.useRef(null);j.useEffect(()=>{n&&(g(null),c(null),d(""),m(new Set),E(new Map),v(""))},[n]),j.useEffect(()=>{n&&e.listFolder(u||void 0).then(g).catch(P=>{c(P instanceof Error?P.message:"Unable to load folder")})},[n,u,e]),j.useEffect(()=>{const P=T.current;if(!P)return;const W=new ResizeObserver(()=>L(P.clientHeight));return W.observe(P),L(P.clientHeight),()=>W.disconnect()},[]);const I=j.useCallback(P=>{const W=P.relativePath;m(Z=>{const ie=new Set(Z);return ie.has(W)?(ie.delete(W),ie):(ie.add(W),ie)}),A.has(W)||(C(Z=>new Set(Z).add(W)),e.listFolder(W).then(Z=>{E(ie=>new Map(ie).set(W,Z)),C(ie=>{const he=new Set(ie);return he.delete(W),he})}).catch(()=>{C(Z=>{const ie=new Set(Z);return ie.delete(W),ie})}))},[e,A]),K=j.useCallback(P=>{P.kind==="dir"?I(P):a(P)},[I,a]),F=j.useCallback(P=>{S(P.currentTarget.scrollTop)},[]),G=j.useCallback(()=>{M(P=>{const W=!P;try{localStorage.setItem(kx,W?"1":"0")}catch{}return W})},[]),B=f.toLowerCase(),X=j.useMemo(()=>o?Tx(o.entries,0,r,y,w,A,B,R):[],[o,r,y,w,A,B,R]),Y=!R&&o!==null&&o.entries.length>0&&X.length===0&&!f,z=X.length>m4,q=z?Math.max(0,Math.floor(p/yu)-Fb):0,V=z?Math.min(X.length,Math.ceil((p+k)/yu)+Fb):X.length,D=X.slice(q,V),H=X.length*yu,O=q*yu;return n?_?h.jsx("div",{className:"fexp-tree-error",children:_}):o?h.jsxs("div",{className:"fexp-tree-container",children:[h.jsxs("div",{className:"fexp-filter",children:[h.jsx("input",{type:"text",className:"fexp-filter-input",placeholder:"Filter…",value:f,onChange:P=>v(P.target.value),"aria-label":"Filter files"}),f&&h.jsx("button",{type:"button",className:"fexp-filter-clear",onClick:()=>v(""),"aria-label":"Clear filter",children:"✕"}),h.jsx("button",{type:"button",className:`fexp-hidden-toggle${R?" is-active":""}`,onClick:G,"aria-pressed":R,"aria-label":R?"Hide hidden files":"Show hidden files",title:R?"Hide hidden files":"Show hidden files",children:R?h.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:[h.jsx("ellipse",{cx:"8",cy:"8",rx:"5.5",ry:"3.5",stroke:"currentColor",strokeWidth:"1.4"}),h.jsx("circle",{cx:"8",cy:"8",r:"1.8",fill:"currentColor"})]}):h.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:[h.jsx("ellipse",{cx:"8",cy:"8",rx:"5.5",ry:"3.5",stroke:"currentColor",strokeWidth:"1.4"}),h.jsx("circle",{cx:"8",cy:"8",r:"1.8",fill:"currentColor"}),h.jsx("line",{x1:"3",y1:"13",x2:"13",y2:"3",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round"})]})})]}),h.jsxs("div",{ref:T,className:"fexp-tree",role:"tree","aria-label":"File tree",onScroll:z?F:void 0,children:[o.parentRelativePath!==null&&!f&&h.jsx("button",{className:"fexp-tree-up",type:"button",onClick:()=>d(o.parentRelativePath??""),"aria-label":"Parent folder",children:"↑ .."}),z?h.jsx("div",{style:{height:H,position:"relative"},children:h.jsx("div",{style:{transform:`translateY(${O}px)`},children:D.map(P=>h.jsx(Wb,{row:P,onEntryClick:K},P.entry.relativePath))})}):D.map(P=>h.jsx(Wb,{row:P,onEntryClick:K},P.entry.relativePath)),X.length===0&&f&&h.jsx("div",{className:"fexp-tree-empty",children:"No matching items"}),X.length===0&&!f&&o.entries.length===0&&h.jsx("div",{className:"fexp-tree-empty",children:"This folder is empty"}),Y&&h.jsx("div",{className:"fexp-tree-empty",children:"Only hidden items — use the eye icon to show them"})]})]}):h.jsx("div",{className:"fexp-tree-loading",children:"Loading…"}):h.jsx("div",{className:"fexp-tree-empty",children:"Select a Theater"})}function Wb({row:e,onEntryClick:n}){const{entry:r,depth:a,isSelected:o,isExpanded:g,isLoading:_}=e,c=r.kind==="dir",u=a*16,d=j.useCallback(()=>n(r),[r,n]);return h.jsxs("button",{className:`fexp-tree-row${o?" is-cur":""}${c?" is-dir":" is-file"}`,style:{paddingLeft:`${u+12}px`},type:"button",role:"treeitem","aria-selected":o,"aria-expanded":c?g:void 0,onClick:d,children:[h.jsx("span",{className:"fexp-tree-icon","aria-hidden":"true",children:c?h.jsx(p4,{name:r.name,open:g}):h.jsx(f4,{name:r.name})}),h.jsx("span",{className:"fexp-tree-name",children:r.name}),_&&h.jsx("span",{className:"fexp-tree-spin","aria-hidden":"true",children:"⋯"})]})}function v4(){try{return localStorage.getItem(kx)==="1"}catch{return!1}}function b4({name:e,sizeHint:n}){return h.jsxs("div",{className:"fexp-bin-wrap v-bin",children:[h.jsx("span",{className:"fexp-bin-glyph","aria-hidden":"true",children:"⊘"}),h.jsx("p",{className:"fexp-bin-name",children:e}),n&&h.jsx("p",{className:"fexp-bin-meta",children:n}),h.jsx("p",{className:"fexp-bin-hint",children:"Binary files can't be previewed"})]})}function y4(e,n){switch(n){case"typescript":case"javascript":return w4(e);case"json":return x4(e);case"python":return E4(e);case"css":case"scss":case"sass":case"less":return k4(e);case"html":case"xml":return A4(e);case"bash":case"shell":return T4(e);case"yaml":return R4(e);default:return[{kind:"text",value:e}]}}const S4=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 w4(e){const n=[];let r=0;for(;r<e.length;){if(e.startsWith("/*",r)){const a=e.indexOf("*/",r+2),o=a===-1?e.slice(r):e.slice(r,a+2);n.push({kind:"com",value:o}),r+=o.length;continue}if(e.startsWith("//",r)){const a=e.indexOf(`
|
|
90
|
-
`,r),o=a===-1?e.slice(r):e.slice(r,a);n.push({kind:"com",value:o}),r+=o.length;continue}if(e[r]==="`"){const{slice:a,length:o}=ks(e,r,"`","`");n.push({kind:"str",value:a}),r+=o;continue}if(e[r]==='"'||e[r]==="'"){const{slice:a,length:o}=ks(e,r,e[r],e[r]);n.push({kind:"str",value:a}),r+=o;continue}if(/[0-9]/.test(e[r])||e[r]==="."&&/[0-9]/.test(e[r+1]??"")){const a=e.slice(r).match(/^(0x[\da-fA-F]+|0o[0-7]+|0b[01]+|[\d]*\.?[\d]+(?:[eE][+-]?\d+)?[nN]?)/);if(a){n.push({kind:"num",value:a[0]}),r+=a[0].length;continue}}if(/[a-zA-Z_$]/.test(e[r])){const a=e.slice(r).match(/^[a-zA-Z_$][\w$]*/);if(a){const o=a[0],g=e.slice(r+o.length).match(/^\s*\(/);S4.has(o)?n.push({kind:"key",value:o}):g?n.push({kind:"fn",value:o}):n.push({kind:"text",value:o}),r+=o.length;continue}}if(/[{}()[\];,.<>!?:|&^~%*+\-=/\\@#]/.test(e[r])){n.push({kind:"punct",value:e[r]}),r++;continue}n.push({kind:"text",value:e[r]}),r++}return n}function x4(e){const n=[];let r=0;for(;r<e.length;){if(e[r]==='"'){const{slice:a,length:o}=ks(e,r,'"','"'),_=e.slice(r+o).trimStart().startsWith(":");n.push({kind:_?"attr":"str",value:a}),r+=o;continue}if(/[0-9\-]/.test(e[r])){const a=e.slice(r).match(/^-?[\d]*\.?[\d]+(?:[eE][+-]?\d+)?/);if(a){n.push({kind:"num",value:a[0]}),r+=a[0].length;continue}}if(e.startsWith("true",r)||e.startsWith("false",r)||e.startsWith("null",r)){const a=e.slice(r).match(/^(true|false|null)/);if(a){n.push({kind:"key",value:a[0]}),r+=a[0].length;continue}}if(/[{}[\]:,]/.test(e[r])){n.push({kind:"punct",value:e[r]}),r++;continue}n.push({kind:"text",value:e[r]}),r++}return n}const C4=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 E4(e){const n=[];let r=0;for(;r<e.length;){if(e[r]==="#"){const a=e.indexOf(`
|
|
91
|
-
`,r),o=a===-1?e.slice(r):e.slice(r,a);n.push({kind:"com",value:o}),r+=o.length;continue}if(e.startsWith('"""',r)||e.startsWith("'''",r)){const a=e.slice(r,r+3),o=e.indexOf(a,r+3),g=o===-1?e.slice(r):e.slice(r,o+3);n.push({kind:"str",value:g}),r+=g.length;continue}if(e[r]==='"'||e[r]==="'"){const{slice:a,length:o}=ks(e,r,e[r],e[r]);n.push({kind:"str",value:a}),r+=o;continue}if(/[0-9]/.test(e[r])){const a=e.slice(r).match(/^(0x[\da-fA-F]+|0o[0-7]+|0b[01]+|[\d]*\.?[\d]+(?:[eE][+-]?\d+)?)/);if(a){n.push({kind:"num",value:a[0]}),r+=a[0].length;continue}}if(/[a-zA-Z_]/.test(e[r])){const a=e.slice(r).match(/^[a-zA-Z_]\w*/);if(a){const o=a[0],g=e.slice(r+o.length).match(/^\s*\(/);C4.has(o)?n.push({kind:"key",value:o}):g?n.push({kind:"fn",value:o}):n.push({kind:"text",value:o}),r+=o.length;continue}}n.push({kind:"text",value:e[r]}),r++}return n}function k4(e){const n=[];let r=0;for(;r<e.length;){if(e.startsWith("/*",r)){const a=e.indexOf("*/",r+2),o=a===-1?e.slice(r):e.slice(r,a+2);n.push({kind:"com",value:o}),r+=o.length;continue}if(e.startsWith("//",r)){const a=e.indexOf(`
|
|
92
|
-
`,r),o=a===-1?e.slice(r):e.slice(r,a);n.push({kind:"com",value:o}),r+=o.length;continue}if(e[r]==='"'||e[r]==="'"){const{slice:a,length:o}=ks(e,r,e[r],e[r]);n.push({kind:"str",value:a}),r+=o;continue}if(e[r]==="."||e[r]==="#"||e[r]===":"){const a=e.slice(r).match(/^[.#:][:a-zA-Z_-][\w-]*/);if(a){n.push({kind:"tag",value:a[0]}),r+=a[0].length;continue}}if(/[a-zA-Z-]/.test(e[r])){const a=e.slice(r).match(/^[a-zA-Z-][\w-]*/);if(a){const o=a[0];e.slice(r+o.length).trimStart().startsWith(":")?n.push({kind:"attr",value:o}):n.push({kind:"text",value:o}),r+=o.length;continue}}if(/[0-9]/.test(e[r])){const a=e.slice(r).match(/^[\d]*\.?[\d]+(?:[a-zA-Z%]*)/);if(a){n.push({kind:"num",value:a[0]}),r+=a[0].length;continue}}n.push({kind:"text",value:e[r]}),r++}return n}function A4(e){const n=[];let r=0;for(;r<e.length;){if(e.startsWith("<!--",r)){const a=e.indexOf("-->",r+4),o=a===-1?e.slice(r):e.slice(r,a+3);n.push({kind:"com",value:o}),r+=o.length;continue}if(e[r]==="<"){n.push({kind:"punct",value:"<"}),r++,e[r]==="/"&&(n.push({kind:"punct",value:"/"}),r++);const a=e.slice(r).match(/^[a-zA-Z][\w:-]*/);a&&(n.push({kind:"tag",value:a[0]}),r+=a[0].length);continue}if(e[r]==='"'||e[r]==="'"){const{slice:a,length:o}=ks(e,r,e[r],e[r]);n.push({kind:"str",value:a}),r+=o;continue}if(/[a-zA-Z]/.test(e[r])){const a=e.slice(r).match(/^[a-zA-Z][\w:-]*/);if(a){const o=e.slice(r+a[0].length).trimStart();n.push({kind:o.startsWith("=")?"attr":"text",value:a[0]}),r+=a[0].length;continue}}n.push({kind:"text",value:e[r]}),r++}return n}function T4(e){const n=[];let r=0;const a=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(;r<e.length;){if(e[r]==="#"){const o=e.indexOf(`
|
|
93
|
-
`,r),g=o===-1?e.slice(r):e.slice(r,o);n.push({kind:"com",value:g}),r+=g.length;continue}if(e[r]==='"'||e[r]==="'"){const{slice:o,length:g}=ks(e,r,e[r],e[r]);n.push({kind:"str",value:o}),r+=g;continue}if(/[a-zA-Z_]/.test(e[r])){const o=e.slice(r).match(/^[a-zA-Z_][\w]*/);if(o){n.push({kind:a.has(o[0])?"key":"text",value:o[0]}),r+=o[0].length;continue}}n.push({kind:"text",value:e[r]}),r++}return n}function R4(e){const n=[];let r=0;for(;r<e.length;){if(e[r]==="#"){const a=e.indexOf(`
|
|
94
|
-
`,r),o=a===-1?e.slice(r):e.slice(r,a);n.push({kind:"com",value:o}),r+=o.length;continue}if(e[r]==='"'||e[r]==="'"){const{slice:a,length:o}=ks(e,r,e[r],e[r]);n.push({kind:"str",value:a}),r+=o;continue}if(/[a-zA-Z_]/.test(e[r])){const a=e.slice(r).match(/^[a-zA-Z_][\w-]*/);if(a){e.slice(r+a[0].length).trimStart().startsWith(":")?n.push({kind:"attr",value:a[0]}):["true","false","null","yes","no","on","off"].includes(a[0])?n.push({kind:"key",value:a[0]}):n.push({kind:"text",value:a[0]}),r+=a[0].length;continue}}if(/[0-9\-]/.test(e[r])){const a=e.slice(r).match(/^-?[\d]*\.?[\d]+/);if(a){n.push({kind:"num",value:a[0]}),r+=a[0].length;continue}}n.push({kind:"text",value:e[r]}),r++}return n}function ks(e,n,r,a){let o=n+r.length;for(;o<e.length;){if(e[o]==="\\"){o+=2;continue}if(e.startsWith(a,o)){o+=a.length;break}if(a!=="`"&&e[o]===`
|
|
95
|
-
`)break;o++}return{slice:e.slice(n,o),length:o-n}}function L4({content:e,lang:n,truncated:r}){const a=j.useMemo(()=>M4(e,n),[e,n]);return h.jsxs("div",{className:"fexp-code-wrap",children:[r&&h.jsx("div",{className:"fexp-truncated-badge",children:"File is too large — showing a partial preview"}),h.jsx("div",{className:"fexp-code-scroll",children:h.jsx("table",{className:"fexp-code-table","aria-label":"File contents",children:h.jsx("tbody",{children:a.map((o,g)=>h.jsxs("tr",{className:"fexp-code-row",children:[h.jsx("td",{className:"fexp-line-num","aria-hidden":"true",children:g+1}),h.jsx("td",{className:"fexp-line-code",dangerouslySetInnerHTML:{__html:o}})]},g))})})})]})}function M4(e,n){return e.split(`
|
|
96
|
-
`).map(a=>N4(a,n))}function N4(e,n){return n==="plaintext"||n==="markdown"?Gb(e)||" ":y4(e,n).map(a=>{const o=Gb(a.value);return a.kind==="text"?o:`<span class="syn-${a.kind}">${o}</span>`}).join("")||" "}function Gb(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""")}function O4({src:e,name:n}){return h.jsxs("div",{className:"fexp-img-wrap",children:[h.jsx("div",{className:"fexp-img-stage",children:h.jsx("img",{src:e,alt:n,className:"fexp-img",draggable:!1})}),h.jsx("figcaption",{className:"fexp-img-caption",children:n})]})}function gm(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var sa=gm();function Rx(e){sa=e}var Bl={exec:()=>null};function mt(e,n=""){let r=typeof e=="string"?e:e.source,a={replace:(o,g)=>{let _=typeof g=="string"?g:g.source;return _=_.replace(Kn.caret,"$1"),r=r.replace(o,_),a},getRegex:()=>new RegExp(r,n)};return a}var D4=(()=>{try{return!!new RegExp("(?<=1)(?<!1)")}catch{return!1}})(),Kn={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")},B4=/^(?:[ \t]*(?:\n|$))+/,j4=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,I4=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,Zl=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,P4=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,mm=/(?:[*+-]|\d{1,9}[.)])/,Lx=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,Mx=mt(Lx).replace(/bull/g,mm).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(),z4=mt(Lx).replace(/bull/g,mm).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(),_m=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,H4=/^[^\n]+/,vm=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,$4=mt(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",vm).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),U4=mt(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,mm).getRegex(),yh="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",bm=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,F4=mt("^ {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",bm).replace("tag",yh).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Nx=mt(_m).replace("hr",Zl).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",yh).getRegex(),W4=mt(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",Nx).getRegex(),ym={blockquote:W4,code:j4,def:$4,fences:I4,heading:P4,hr:Zl,html:F4,lheading:Mx,list:U4,newline:B4,paragraph:Nx,table:Bl,text:H4},qb=mt("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",Zl).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",yh).getRegex(),G4={...ym,lheading:z4,table:qb,paragraph:mt(_m).replace("hr",Zl).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",qb).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",yh).getRegex()},q4={...ym,html:mt(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",bm).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:Bl,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:mt(_m).replace("hr",Zl).replace("heading",` *#{1,6} *[^
|
|
97
|
-
]`).replace("lheading",Mx).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},K4=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,V4=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,Ox=/^( {2,}|\\)\n(?!\s*$)/,Y4=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,Sh=/[\p{P}\p{S}]/u,Sm=/[\s\p{P}\p{S}]/u,Dx=/[^\s\p{P}\p{S}]/u,X4=mt(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,Sm).getRegex(),Bx=/(?!~)[\p{P}\p{S}]/u,Z4=/(?!~)[\s\p{P}\p{S}]/u,J4=/(?:[^\s\p{P}\p{S}]|~)/u,Q4=mt(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",D4?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),jx=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,eN=mt(jx,"u").replace(/punct/g,Sh).getRegex(),tN=mt(jx,"u").replace(/punct/g,Bx).getRegex(),Ix="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",nN=mt(Ix,"gu").replace(/notPunctSpace/g,Dx).replace(/punctSpace/g,Sm).replace(/punct/g,Sh).getRegex(),iN=mt(Ix,"gu").replace(/notPunctSpace/g,J4).replace(/punctSpace/g,Z4).replace(/punct/g,Bx).getRegex(),rN=mt("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,Dx).replace(/punctSpace/g,Sm).replace(/punct/g,Sh).getRegex(),sN=mt(/\\(punct)/,"gu").replace(/punct/g,Sh).getRegex(),aN=mt(/^<(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(),oN=mt(bm).replace("(?:-->|$)","-->").getRegex(),lN=mt("^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",oN).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),eh=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+[^`]*?`+(?!`)|[^\[\]\\`])*?/,cN=mt(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",eh).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),Px=mt(/^!?\[(label)\]\[(ref)\]/).replace("label",eh).replace("ref",vm).getRegex(),zx=mt(/^!?\[(ref)\](?:\[\])?/).replace("ref",vm).getRegex(),uN=mt("reflink|nolink(?!\\()","g").replace("reflink",Px).replace("nolink",zx).getRegex(),Kb=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,wm={_backpedal:Bl,anyPunctuation:sN,autolink:aN,blockSkip:Q4,br:Ox,code:V4,del:Bl,emStrongLDelim:eN,emStrongRDelimAst:nN,emStrongRDelimUnd:rN,escape:K4,link:cN,nolink:zx,punctuation:X4,reflink:Px,reflinkSearch:uN,tag:lN,text:Y4,url:Bl},hN={...wm,link:mt(/^!?\[(label)\]\((.*?)\)/).replace("label",eh).getRegex(),reflink:mt(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",eh).getRegex()},ug={...wm,emStrongRDelimAst:iN,emStrongLDelim:tN,url:mt(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",Kb).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:mt(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",Kb).getRegex()},dN={...ug,br:mt(Ox).replace("{2,}","*").getRegex(),text:mt(ug.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},Su={normal:ym,gfm:G4,pedantic:q4},_l={normal:wm,gfm:ug,breaks:dN,pedantic:hN},fN={"&":"&","<":"<",">":">",'"':""","'":"'"},Vb=e=>fN[e];function sr(e,n){if(n){if(Kn.escapeTest.test(e))return e.replace(Kn.escapeReplace,Vb)}else if(Kn.escapeTestNoEncode.test(e))return e.replace(Kn.escapeReplaceNoEncode,Vb);return e}function Yb(e){try{e=encodeURI(e).replace(Kn.percentDecode,"%")}catch{return null}return e}function Xb(e,n){let r=e.replace(Kn.findPipe,(g,_,c)=>{let u=!1,d=_;for(;--d>=0&&c[d]==="\\";)u=!u;return u?"|":" |"}),a=r.split(Kn.splitPipe),o=0;if(a[0].trim()||a.shift(),a.length>0&&!a.at(-1)?.trim()&&a.pop(),n)if(a.length>n)a.splice(n);else for(;a.length<n;)a.push("");for(;o<a.length;o++)a[o]=a[o].trim().replace(Kn.slashPipe,"|");return a}function vl(e,n,r){let a=e.length;if(a===0)return"";let o=0;for(;o<a&&e.charAt(a-o-1)===n;)o++;return e.slice(0,a-o)}function pN(e,n){if(e.indexOf(n[1])===-1)return-1;let r=0;for(let a=0;a<e.length;a++)if(e[a]==="\\")a++;else if(e[a]===n[0])r++;else if(e[a]===n[1]&&(r--,r<0))return a;return r>0?-2:-1}function Zb(e,n,r,a,o){let g=n.href,_=n.title||null,c=e[1].replace(o.other.outputLinkReplace,"$1");a.state.inLink=!0;let u={type:e[0].charAt(0)==="!"?"image":"link",raw:r,href:g,title:_,text:c,tokens:a.inlineTokens(c)};return a.state.inLink=!1,u}function gN(e,n,r){let a=e.match(r.other.indentCodeCompensation);if(a===null)return n;let o=a[1];return n.split(`
|
|
98
|
-
`).map(g=>{let _=g.match(r.other.beginningSpace);if(_===null)return g;let[c]=_;return c.length>=o.length?g.slice(o.length):g}).join(`
|
|
99
|
-
`)}var th=class{options;rules;lexer;constructor(e){this.options=e||sa}space(e){let n=this.rules.block.newline.exec(e);if(n&&n[0].length>0)return{type:"space",raw:n[0]}}code(e){let n=this.rules.block.code.exec(e);if(n){let r=n[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:n[0],codeBlockStyle:"indented",text:this.options.pedantic?r:vl(r,`
|
|
100
|
-
`)}}}fences(e){let n=this.rules.block.fences.exec(e);if(n){let r=n[0],a=gN(r,n[3]||"",this.rules);return{type:"code",raw:r,lang:n[2]?n[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):n[2],text:a}}}heading(e){let n=this.rules.block.heading.exec(e);if(n){let r=n[2].trim();if(this.rules.other.endingHash.test(r)){let a=vl(r,"#");(this.options.pedantic||!a||this.rules.other.endingSpaceChar.test(a))&&(r=a.trim())}return{type:"heading",raw:n[0],depth:n[1].length,text:r,tokens:this.lexer.inline(r)}}}hr(e){let n=this.rules.block.hr.exec(e);if(n)return{type:"hr",raw:vl(n[0],`
|
|
101
|
-
`)}}blockquote(e){let n=this.rules.block.blockquote.exec(e);if(n){let r=vl(n[0],`
|
|
102
|
-
`).split(`
|
|
103
|
-
`),a="",o="",g=[];for(;r.length>0;){let _=!1,c=[],u;for(u=0;u<r.length;u++)if(this.rules.other.blockquoteStart.test(r[u]))c.push(r[u]),_=!0;else if(!_)c.push(r[u]);else break;r=r.slice(u);let d=c.join(`
|
|
104
|
-
`),y=d.replace(this.rules.other.blockquoteSetextReplace,`
|
|
105
|
-
$1`).replace(this.rules.other.blockquoteSetextReplace2,"");a=a?`${a}
|
|
106
|
-
${d}`:d,o=o?`${o}
|
|
107
|
-
${y}`:y;let m=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(y,g,!0),this.lexer.state.top=m,r.length===0)break;let w=g.at(-1);if(w?.type==="code")break;if(w?.type==="blockquote"){let C=w,A=C.raw+`
|
|
108
|
-
`+r.join(`
|
|
109
|
-
`),E=this.blockquote(A);g[g.length-1]=E,a=a.substring(0,a.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,A=C.raw+`
|
|
110
|
-
`+r.join(`
|
|
111
|
-
`),E=this.list(A);g[g.length-1]=E,a=a.substring(0,a.length-w.raw.length)+E.raw,o=o.substring(0,o.length-C.raw.length)+E.raw,r=A.substring(g.at(-1).raw.length).split(`
|
|
112
|
-
`);continue}}return{type:"blockquote",raw:a,tokens:g,text:o}}}list(e){let n=this.rules.block.list.exec(e);if(n){let r=n[1].trim(),a=r.length>1,o={type:"list",raw:"",ordered:a,start:a?+r.slice(0,-1):"",loose:!1,items:[]};r=a?`\\d{1,9}\\${r.slice(-1)}`:`\\${r}`,this.options.pedantic&&(r=a?r:"[*+-]");let g=this.rules.other.listItemRegex(r),_=!1;for(;e;){let u=!1,d="",y="";if(!(n=g.exec(e))||this.rules.block.hr.test(e))break;d=n[0],e=e.substring(d.length);let m=n[2].split(`
|
|
113
|
-
`,1)[0].replace(this.rules.other.listReplaceTabs,v=>" ".repeat(3*v.length)),w=e.split(`
|
|
114
|
-
`,1)[0],C=!m.trim(),A=0;if(this.options.pedantic?(A=2,y=m.trimStart()):C?A=n[1].length+1:(A=n[2].search(this.rules.other.nonSpaceChar),A=A>4?1:A,y=m.slice(A),A+=n[1].length),C&&this.rules.other.blankLine.test(w)&&(d+=w+`
|
|
115
|
-
`,e=e.substring(w.length+1),u=!0),!u){let v=this.rules.other.nextBulletRegex(A),p=this.rules.other.hrRegex(A),S=this.rules.other.fencesBeginRegex(A),k=this.rules.other.headingBeginRegex(A),L=this.rules.other.htmlBeginRegex(A);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)||p.test(w))break;if(M.search(this.rules.other.nonSpaceChar)>=A||!w.trim())y+=`
|
|
117
|
-
`+M.slice(A);else{if(C||m.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||S.test(m)||k.test(m)||p.test(m))break;y+=`
|
|
118
|
-
`+w}!C&&!w.trim()&&(C=!0),d+=R+`
|
|
119
|
-
`,e=e.substring(R.length+1),m=M.slice(A)}}o.loose||(_?o.loose=!0:this.rules.other.doubleBlankLine.test(d)&&(_=!0));let E=null,f;this.options.gfm&&(E=this.rules.other.listIsTask.exec(y),E&&(f=E[0]!=="[ ] ",y=y.replace(this.rules.other.listReplaceTask,""))),o.items.push({type:"list_item",raw:d,task:!!E,checked:f,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 u=0;u<o.items.length;u++)if(this.lexer.state.top=!1,o.items[u].tokens=this.lexer.blockTokens(o.items[u].text,[]),!o.loose){let d=o.items[u].tokens.filter(m=>m.type==="space"),y=d.length>0&&d.some(m=>this.rules.other.anyLine.test(m.raw));o.loose=y}if(o.loose)for(let u=0;u<o.items.length;u++)o.items[u].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 r=n[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),a=n[2]?n[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",o=n[3]?n[3].substring(1,n[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):n[3];return{type:"def",tag:r,raw:n[0],href:a,title:o}}}table(e){let n=this.rules.block.table.exec(e);if(!n||!this.rules.other.tableDelimiter.test(n[2]))return;let r=Xb(n[1]),a=n[2].replace(this.rules.other.tableAlignChars,"").split("|"),o=n[3]?.trim()?n[3].replace(this.rules.other.tableRowBlankLine,"").split(`
|
|
120
|
-
`):[],g={type:"table",raw:n[0],header:[],align:[],rows:[]};if(r.length===a.length){for(let _ of a)this.rules.other.tableAlignRight.test(_)?g.align.push("right"):this.rules.other.tableAlignCenter.test(_)?g.align.push("center"):this.rules.other.tableAlignLeft.test(_)?g.align.push("left"):g.align.push(null);for(let _=0;_<r.length;_++)g.header.push({text:r[_],tokens:this.lexer.inline(r[_]),header:!0,align:g.align[_]});for(let _ of o)g.rows.push(Xb(_,g.header.length).map((c,u)=>({text:c,tokens:this.lexer.inline(c),header:!1,align:g.align[u]})));return g}}lheading(e){let n=this.rules.block.lheading.exec(e);if(n)return{type:"heading",raw:n[0],depth:n[2].charAt(0)==="="?1:2,text:n[1],tokens:this.lexer.inline(n[1])}}paragraph(e){let n=this.rules.block.paragraph.exec(e);if(n){let r=n[1].charAt(n[1].length-1)===`
|
|
121
|
-
`?n[1].slice(0,-1):n[1];return{type:"paragraph",raw:n[0],text:r,tokens:this.lexer.inline(r)}}}text(e){let n=this.rules.block.text.exec(e);if(n)return{type:"text",raw:n[0],text:n[0],tokens:this.lexer.inline(n[0])}}escape(e){let n=this.rules.inline.escape.exec(e);if(n)return{type:"escape",raw:n[0],text:n[1]}}tag(e){let n=this.rules.inline.tag.exec(e);if(n)return!this.lexer.state.inLink&&this.rules.other.startATag.test(n[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(n[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(n[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(n[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:n[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:n[0]}}link(e){let n=this.rules.inline.link.exec(e);if(n){let r=n[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(r)){if(!this.rules.other.endAngleBracket.test(r))return;let g=vl(r.slice(0,-1),"\\");if((r.length-g.length)%2===0)return}else{let g=pN(n[2],"()");if(g===-2)return;if(g>-1){let _=(n[0].indexOf("!")===0?5:4)+n[1].length+g;n[2]=n[2].substring(0,g),n[0]=n[0].substring(0,_).trim(),n[3]=""}}let a=n[2],o="";if(this.options.pedantic){let g=this.rules.other.pedanticHrefTitle.exec(a);g&&(a=g[1],o=g[3])}else o=n[3]?n[3].slice(1,-1):"";return a=a.trim(),this.rules.other.startAngleBracket.test(a)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(r)?a=a.slice(1):a=a.slice(1,-1)),Zb(n,{href:a&&a.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 r;if((r=this.rules.inline.reflink.exec(e))||(r=this.rules.inline.nolink.exec(e))){let a=(r[2]||r[1]).replace(this.rules.other.multipleSpaceGlobal," "),o=n[a.toLowerCase()];if(!o){let g=r[0].charAt(0);return{type:"text",raw:g,text:g}}return Zb(r,o,r[0],this.lexer,this.rules)}}emStrong(e,n,r=""){let a=this.rules.inline.emStrongLDelim.exec(e);if(!(!a||a[3]&&r.match(this.rules.other.unicodeAlphaNumeric))&&(!(a[1]||a[2])||!r||this.rules.inline.punctuation.exec(r))){let o=[...a[0]].length-1,g,_,c=o,u=0,d=a[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(d.lastIndex=0,n=n.slice(-1*e.length+o);(a=d.exec(n))!=null;){if(g=a[1]||a[2]||a[3]||a[4]||a[5]||a[6],!g)continue;if(_=[...g].length,a[3]||a[4]){c+=_;continue}else if((a[5]||a[6])&&o%3&&!((o+_)%3)){u+=_;continue}if(c-=_,c>0)continue;_=Math.min(_,_+c+u);let y=[...a[0]][0].length,m=e.slice(0,o+a.index+y+_);if(Math.min(o,_)%2){let C=m.slice(1,-1);return{type:"em",raw:m,text:C,tokens:this.lexer.inlineTokens(C)}}let w=m.slice(2,-2);return{type:"strong",raw:m,text:w,tokens:this.lexer.inlineTokens(w)}}}}codespan(e){let n=this.rules.inline.code.exec(e);if(n){let r=n[2].replace(this.rules.other.newLineCharGlobal," "),a=this.rules.other.nonSpaceChar.test(r),o=this.rules.other.startingSpaceChar.test(r)&&this.rules.other.endingSpaceChar.test(r);return a&&o&&(r=r.substring(1,r.length-1)),{type:"codespan",raw:n[0],text:r}}}br(e){let n=this.rules.inline.br.exec(e);if(n)return{type:"br",raw:n[0]}}del(e){let n=this.rules.inline.del.exec(e);if(n)return{type:"del",raw:n[0],text:n[2],tokens:this.lexer.inlineTokens(n[2])}}autolink(e){let n=this.rules.inline.autolink.exec(e);if(n){let r,a;return n[2]==="@"?(r=n[1],a="mailto:"+r):(r=n[1],a=r),{type:"link",raw:n[0],text:r,href:a,tokens:[{type:"text",raw:r,text:r}]}}}url(e){let n;if(n=this.rules.inline.url.exec(e)){let r,a;if(n[2]==="@")r=n[0],a="mailto:"+r;else{let o;do o=n[0],n[0]=this.rules.inline._backpedal.exec(n[0])?.[0]??"";while(o!==n[0]);r=n[0],n[1]==="www."?a="http://"+n[0]:a=n[0]}return{type:"link",raw:n[0],text:r,href:a,tokens:[{type:"text",raw:r,text:r}]}}}inlineText(e){let n=this.rules.inline.text.exec(e);if(n){let r=this.lexer.state.inRawBlock;return{type:"text",raw:n[0],text:n[0],escaped:r}}}},qi=class hg{tokens;options;state;tokenizer;inlineQueue;constructor(n){this.tokens=[],this.tokens.links=Object.create(null),this.options=n||sa,this.options.tokenizer=this.options.tokenizer||new th,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let r={other:Kn,block:Su.normal,inline:_l.normal};this.options.pedantic?(r.block=Su.pedantic,r.inline=_l.pedantic):this.options.gfm&&(r.block=Su.gfm,this.options.breaks?r.inline=_l.breaks:r.inline=_l.gfm),this.tokenizer.rules=r}static get rules(){return{block:Su,inline:_l}}static lex(n,r){return new hg(r).lex(n)}static lexInline(n,r){return new hg(r).inlineTokens(n)}lex(n){n=n.replace(Kn.carriageReturn,`
|
|
122
|
-
`),this.blockTokens(n,this.tokens);for(let r=0;r<this.inlineQueue.length;r++){let a=this.inlineQueue[r];this.inlineTokens(a.src,a.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(n,r=[],a=!1){for(this.options.pedantic&&(n=n.replace(Kn.tabCharGlobal," ").replace(Kn.spaceLine,""));n;){let o;if(this.options.extensions?.block?.some(_=>(o=_.call({lexer:this},n,r))?(n=n.substring(o.raw.length),r.push(o),!0):!1))continue;if(o=this.tokenizer.space(n)){n=n.substring(o.raw.length);let _=r.at(-1);o.raw.length===1&&_!==void 0?_.raw+=`
|
|
123
|
-
`:r.push(o);continue}if(o=this.tokenizer.code(n)){n=n.substring(o.raw.length);let _=r.at(-1);_?.type==="paragraph"||_?.type==="text"?(_.raw+=(_.raw.endsWith(`
|
|
124
|
-
`)?"":`
|
|
125
|
-
`)+o.raw,_.text+=`
|
|
126
|
-
`+o.text,this.inlineQueue.at(-1).src=_.text):r.push(o);continue}if(o=this.tokenizer.fences(n)){n=n.substring(o.raw.length),r.push(o);continue}if(o=this.tokenizer.heading(n)){n=n.substring(o.raw.length),r.push(o);continue}if(o=this.tokenizer.hr(n)){n=n.substring(o.raw.length),r.push(o);continue}if(o=this.tokenizer.blockquote(n)){n=n.substring(o.raw.length),r.push(o);continue}if(o=this.tokenizer.list(n)){n=n.substring(o.raw.length),r.push(o);continue}if(o=this.tokenizer.html(n)){n=n.substring(o.raw.length),r.push(o);continue}if(o=this.tokenizer.def(n)){n=n.substring(o.raw.length);let _=r.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},r.push(o));continue}if(o=this.tokenizer.table(n)){n=n.substring(o.raw.length),r.push(o);continue}if(o=this.tokenizer.lheading(n)){n=n.substring(o.raw.length),r.push(o);continue}let g=n;if(this.options.extensions?.startBlock){let _=1/0,c=n.slice(1),u;this.options.extensions.startBlock.forEach(d=>{u=d.call({lexer:this},c),typeof u=="number"&&u>=0&&(_=Math.min(_,u))}),_<1/0&&_>=0&&(g=n.substring(0,_+1))}if(this.state.top&&(o=this.tokenizer.paragraph(g))){let _=r.at(-1);a&&_?.type==="paragraph"?(_.raw+=(_.raw.endsWith(`
|
|
130
|
-
`)?"":`
|
|
131
|
-
`)+o.raw,_.text+=`
|
|
132
|
-
`+o.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=_.text):r.push(o),a=g.length!==n.length,n=n.substring(o.raw.length);continue}if(o=this.tokenizer.text(n)){n=n.substring(o.raw.length);let _=r.at(-1);_?.type==="text"?(_.raw+=(_.raw.endsWith(`
|
|
133
|
-
`)?"":`
|
|
134
|
-
`)+o.raw,_.text+=`
|
|
135
|
-
`+o.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=_.text):r.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,r}inline(n,r=[]){return this.inlineQueue.push({src:n,tokens:r}),r}inlineTokens(n,r=[]){let a=n,o=null;if(this.tokens.links){let u=Object.keys(this.tokens.links);if(u.length>0)for(;(o=this.tokenizer.rules.inline.reflinkSearch.exec(a))!=null;)u.includes(o[0].slice(o[0].lastIndexOf("[")+1,-1))&&(a=a.slice(0,o.index)+"["+"a".repeat(o[0].length-2)+"]"+a.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(o=this.tokenizer.rules.inline.anyPunctuation.exec(a))!=null;)a=a.slice(0,o.index)+"++"+a.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);let g;for(;(o=this.tokenizer.rules.inline.blockSkip.exec(a))!=null;)g=o[2]?o[2].length:0,a=a.slice(0,o.index+g)+"["+"a".repeat(o[0].length-g-2)+"]"+a.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);a=this.options.hooks?.emStrongMask?.call({lexer:this},a)??a;let _=!1,c="";for(;n;){_||(c=""),_=!1;let u;if(this.options.extensions?.inline?.some(y=>(u=y.call({lexer:this},n,r))?(n=n.substring(u.raw.length),r.push(u),!0):!1))continue;if(u=this.tokenizer.escape(n)){n=n.substring(u.raw.length),r.push(u);continue}if(u=this.tokenizer.tag(n)){n=n.substring(u.raw.length),r.push(u);continue}if(u=this.tokenizer.link(n)){n=n.substring(u.raw.length),r.push(u);continue}if(u=this.tokenizer.reflink(n,this.tokens.links)){n=n.substring(u.raw.length);let y=r.at(-1);u.type==="text"&&y?.type==="text"?(y.raw+=u.raw,y.text+=u.text):r.push(u);continue}if(u=this.tokenizer.emStrong(n,a,c)){n=n.substring(u.raw.length),r.push(u);continue}if(u=this.tokenizer.codespan(n)){n=n.substring(u.raw.length),r.push(u);continue}if(u=this.tokenizer.br(n)){n=n.substring(u.raw.length),r.push(u);continue}if(u=this.tokenizer.del(n)){n=n.substring(u.raw.length),r.push(u);continue}if(u=this.tokenizer.autolink(n)){n=n.substring(u.raw.length),r.push(u);continue}if(!this.state.inLink&&(u=this.tokenizer.url(n))){n=n.substring(u.raw.length),r.push(u);continue}let d=n;if(this.options.extensions?.startInline){let y=1/0,m=n.slice(1),w;this.options.extensions.startInline.forEach(C=>{w=C.call({lexer:this},m),typeof w=="number"&&w>=0&&(y=Math.min(y,w))}),y<1/0&&y>=0&&(d=n.substring(0,y+1))}if(u=this.tokenizer.inlineText(d)){n=n.substring(u.raw.length),u.raw.slice(-1)!=="_"&&(c=u.raw.slice(-1)),_=!0;let y=r.at(-1);y?.type==="text"?(y.raw+=u.raw,y.text+=u.text):r.push(u);continue}if(n){let y="Infinite loop on byte: "+n.charCodeAt(0);if(this.options.silent){console.error(y);break}else throw new Error(y)}}return r}},nh=class{options;parser;constructor(e){this.options=e||sa}space(e){return""}code({text:e,lang:n,escaped:r}){let a=(n||"").match(Kn.notSpaceStart)?.[0],o=e.replace(Kn.endingNewline,"")+`
|
|
136
|
-
`;return a?'<pre><code class="language-'+sr(a)+'">'+(r?o:sr(o,!0))+`</code></pre>
|
|
137
|
-
`:"<pre><code>"+(r?o:sr(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,r=e.start,a="";for(let _=0;_<e.items.length;_++){let c=e.items[_];a+=this.listitem(c)}let o=n?"ol":"ul",g=n&&r!==1?' start="'+r+'"':"";return"<"+o+g+`>
|
|
143
|
-
`+a+"</"+o+`>
|
|
144
|
-
`}listitem(e){let n="";if(e.task){let r=this.checkbox({checked:!!e.checked});e.loose?e.tokens[0]?.type==="paragraph"?(e.tokens[0].text=r+" "+e.tokens[0].text,e.tokens[0].tokens&&e.tokens[0].tokens.length>0&&e.tokens[0].tokens[0].type==="text"&&(e.tokens[0].tokens[0].text=r+" "+sr(e.tokens[0].tokens[0].text),e.tokens[0].tokens[0].escaped=!0)):e.tokens.unshift({type:"text",raw:r+" ",text:r+" ",escaped:!0}):n+=r+" "}return n+=this.parser.parse(e.tokens,!!e.loose),`<li>${n}</li>
|
|
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="",r="";for(let o=0;o<e.header.length;o++)r+=this.tablecell(e.header[o]);n+=this.tablerow({text:r});let a="";for(let o=0;o<e.rows.length;o++){let g=e.rows[o];r="";for(let _=0;_<g.length;_++)r+=this.tablecell(g[_]);a+=this.tablerow({text:r})}return a&&(a=`<tbody>${a}</tbody>`),`<table>
|
|
147
|
-
<thead>
|
|
148
|
-
`+n+`</thead>
|
|
149
|
-
`+a+`</table>
|
|
150
|
-
`}tablerow({text:e}){return`<tr>
|
|
151
|
-
${e}</tr>
|
|
152
|
-
`}tablecell(e){let n=this.parser.parseInline(e.tokens),r=e.header?"th":"td";return(e.align?`<${r} align="${e.align}">`:`<${r}>`)+n+`</${r}>
|
|
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>${sr(e,!0)}</code>`}br(e){return"<br>"}del({tokens:e}){return`<del>${this.parser.parseInline(e)}</del>`}link({href:e,title:n,tokens:r}){let a=this.parser.parseInline(r),o=Yb(e);if(o===null)return a;e=o;let g='<a href="'+e+'"';return n&&(g+=' title="'+sr(n)+'"'),g+=">"+a+"</a>",g}image({href:e,title:n,text:r,tokens:a}){a&&(r=this.parser.parseInline(a,this.parser.textRenderer));let o=Yb(e);if(o===null)return sr(r);e=o;let g=`<img src="${e}" alt="${r}"`;return n&&(g+=` title="${sr(n)}"`),g+=">",g}text(e){return"tokens"in e&&e.tokens?this.parser.parseInline(e.tokens):"escaped"in e&&e.escaped?e.text:sr(e.text)}},xm=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""}},Ki=class dg{options;renderer;textRenderer;constructor(n){this.options=n||sa,this.options.renderer=this.options.renderer||new nh,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new xm}static parse(n,r){return new dg(r).parse(n)}static parseInline(n,r){return new dg(r).parseInline(n)}parse(n,r=!0){let a="";for(let o=0;o<n.length;o++){let g=n[o];if(this.options.extensions?.renderers?.[g.type]){let c=g,u=this.options.extensions.renderers[c.type].call({parser:this},c);if(u!==!1||!["space","hr","heading","code","table","blockquote","list","html","def","paragraph","text"].includes(c.type)){a+=u||"";continue}}let _=g;switch(_.type){case"space":{a+=this.renderer.space(_);continue}case"hr":{a+=this.renderer.hr(_);continue}case"heading":{a+=this.renderer.heading(_);continue}case"code":{a+=this.renderer.code(_);continue}case"table":{a+=this.renderer.table(_);continue}case"blockquote":{a+=this.renderer.blockquote(_);continue}case"list":{a+=this.renderer.list(_);continue}case"html":{a+=this.renderer.html(_);continue}case"def":{a+=this.renderer.def(_);continue}case"paragraph":{a+=this.renderer.paragraph(_);continue}case"text":{let c=_,u=this.renderer.text(c);for(;o+1<n.length&&n[o+1].type==="text";)c=n[++o],u+=`
|
|
154
|
-
`+this.renderer.text(c);r?a+=this.renderer.paragraph({type:"paragraph",raw:u,text:u,tokens:[{type:"text",raw:u,text:u,escaped:!0}]}):a+=u;continue}default:{let c='Token with "'+_.type+'" type was not found.';if(this.options.silent)return console.error(c),"";throw new Error(c)}}}return a}parseInline(n,r=this.renderer){let a="";for(let o=0;o<n.length;o++){let g=n[o];if(this.options.extensions?.renderers?.[g.type]){let c=this.options.extensions.renderers[g.type].call({parser:this},g);if(c!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(g.type)){a+=c||"";continue}}let _=g;switch(_.type){case"escape":{a+=r.text(_);break}case"html":{a+=r.html(_);break}case"link":{a+=r.link(_);break}case"image":{a+=r.image(_);break}case"strong":{a+=r.strong(_);break}case"em":{a+=r.em(_);break}case"codespan":{a+=r.codespan(_);break}case"br":{a+=r.br(_);break}case"del":{a+=r.del(_);break}case"text":{a+=r.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 a}},Rl=class{options;block;constructor(e){this.options=e||sa}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?qi.lex:qi.lexInline}provideParser(){return this.block?Ki.parse:Ki.parseInline}},Hx=class{defaults=gm();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=Ki;Renderer=nh;TextRenderer=xm;Lexer=qi;Tokenizer=th;Hooks=Rl;constructor(...e){this.use(...e)}walkTokens(e,n){let r=[];for(let a of e)switch(r=r.concat(n.call(this,a)),a.type){case"table":{let o=a;for(let g of o.header)r=r.concat(this.walkTokens(g.tokens,n));for(let g of o.rows)for(let _ of g)r=r.concat(this.walkTokens(_.tokens,n));break}case"list":{let o=a;r=r.concat(this.walkTokens(o.items,n));break}default:{let o=a;this.defaults.extensions?.childTokens?.[o.type]?this.defaults.extensions.childTokens[o.type].forEach(g=>{let _=o[g].flat(1/0);r=r.concat(this.walkTokens(_,n))}):o.tokens&&(r=r.concat(this.walkTokens(o.tokens,n)))}}return r}use(...e){let n=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(r=>{let a={...r};if(a.async=this.defaults.async||a.async||!1,r.extensions&&(r.extensions.forEach(o=>{if(!o.name)throw new Error("extension name required");if("renderer"in o){let g=n.renderers[o.name];g?n.renderers[o.name]=function(..._){let c=o.renderer.apply(this,_);return c===!1&&(c=g.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 g=n[o.level];g?g.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)}),a.extensions=n),r.renderer){let o=this.defaults.renderer||new nh(this.defaults);for(let g in r.renderer){if(!(g in o))throw new Error(`renderer '${g}' does not exist`);if(["options","parser"].includes(g))continue;let _=g,c=r.renderer[_],u=o[_];o[_]=(...d)=>{let y=c.apply(o,d);return y===!1&&(y=u.apply(o,d)),y||""}}a.renderer=o}if(r.tokenizer){let o=this.defaults.tokenizer||new th(this.defaults);for(let g in r.tokenizer){if(!(g in o))throw new Error(`tokenizer '${g}' does not exist`);if(["options","rules","lexer"].includes(g))continue;let _=g,c=r.tokenizer[_],u=o[_];o[_]=(...d)=>{let y=c.apply(o,d);return y===!1&&(y=u.apply(o,d)),y}}a.tokenizer=o}if(r.hooks){let o=this.defaults.hooks||new Rl;for(let g in r.hooks){if(!(g in o))throw new Error(`hook '${g}' does not exist`);if(["options","block"].includes(g))continue;let _=g,c=r.hooks[_],u=o[_];Rl.passThroughHooks.has(g)?o[_]=d=>{if(this.defaults.async&&Rl.passThroughHooksRespectAsync.has(g))return(async()=>{let m=await c.call(o,d);return u.call(o,m)})();let y=c.call(o,d);return u.call(o,y)}:o[_]=(...d)=>{if(this.defaults.async)return(async()=>{let m=await c.apply(o,d);return m===!1&&(m=await u.apply(o,d)),m})();let y=c.apply(o,d);return y===!1&&(y=u.apply(o,d)),y}}a.hooks=o}if(r.walkTokens){let o=this.defaults.walkTokens,g=r.walkTokens;a.walkTokens=function(_){let c=[];return c.push(g.call(this,_)),o&&(c=c.concat(o.call(this,_))),c}}this.defaults={...this.defaults,...a}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,n){return qi.lex(e,n??this.defaults)}parser(e,n){return Ki.parse(e,n??this.defaults)}parseMarkdown(e){return(n,r)=>{let a={...r},o={...this.defaults,...a},g=this.onError(!!o.silent,!!o.async);if(this.defaults.async===!0&&a.async===!1)return g(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 g(new Error("marked(): input parameter is undefined or null"));if(typeof n!="string")return g(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?qi.lex:qi.lexInline)(_,o),u=o.hooks?await o.hooks.processAllTokens(c):c;o.walkTokens&&await Promise.all(this.walkTokens(u,o.walkTokens));let d=await(o.hooks?await o.hooks.provideParser():e?Ki.parse:Ki.parseInline)(u,o);return o.hooks?await o.hooks.postprocess(d):d})().catch(g);try{o.hooks&&(n=o.hooks.preprocess(n));let _=(o.hooks?o.hooks.provideLexer():e?qi.lex:qi.lexInline)(n,o);o.hooks&&(_=o.hooks.processAllTokens(_)),o.walkTokens&&this.walkTokens(_,o.walkTokens);let c=(o.hooks?o.hooks.provideParser():e?Ki.parse:Ki.parseInline)(_,o);return o.hooks&&(c=o.hooks.postprocess(c)),c}catch(_){return g(_)}}}onError(e,n){return r=>{if(r.message+=`
|
|
155
|
-
Please report this to https://github.com/markedjs/marked.`,e){let a="<p>An error occurred:</p><pre>"+sr(r.message+"",!0)+"</pre>";return n?Promise.resolve(a):a}if(n)return Promise.reject(r);throw r}}},ra=new Hx;function Tt(e,n){return ra.parse(e,n)}Tt.options=Tt.setOptions=function(e){return ra.setOptions(e),Tt.defaults=ra.defaults,Rx(Tt.defaults),Tt};Tt.getDefaults=gm;Tt.defaults=sa;Tt.use=function(...e){return ra.use(...e),Tt.defaults=ra.defaults,Rx(Tt.defaults),Tt};Tt.walkTokens=function(e,n){return ra.walkTokens(e,n)};Tt.parseInline=ra.parseInline;Tt.Parser=Ki;Tt.parser=Ki.parse;Tt.Renderer=nh;Tt.TextRenderer=xm;Tt.Lexer=qi;Tt.lexer=qi.lex;Tt.Tokenizer=th;Tt.Hooks=Rl;Tt.parse=Tt;Tt.options;Tt.setOptions;Tt.use;Tt.walkTokens;Tt.parseInline;Ki.parse;qi.lex;const{entries:$x,setPrototypeOf:Jb,isFrozen:mN,getPrototypeOf:_N,getOwnPropertyDescriptor:vN}=Object;let{freeze:Yn,seal:Hi,create:Va}=Object,{apply:fg,construct:pg}=typeof Reflect<"u"&&Reflect;Yn||(Yn=function(n){return n});Hi||(Hi=function(n){return n});fg||(fg=function(n,r){for(var a=arguments.length,o=new Array(a>2?a-2:0),g=2;g<a;g++)o[g-2]=arguments[g];return n.apply(r,o)});pg||(pg=function(n){for(var r=arguments.length,a=new Array(r>1?r-1:0),o=1;o<r;o++)a[o-1]=arguments[o];return new n(...a)});const bl=_n(Array.prototype.forEach),bN=_n(Array.prototype.lastIndexOf),Qb=_n(Array.prototype.pop),yl=_n(Array.prototype.push),yN=_n(Array.prototype.splice),Gn=Array.isArray,Ll=_n(String.prototype.toLowerCase),ep=_n(String.prototype.toString),ey=_n(String.prototype.match),Ga=_n(String.prototype.replace),ty=_n(String.prototype.indexOf),SN=_n(String.prototype.trim),wN=_n(Number.prototype.toString),xN=_n(Boolean.prototype.toString),ny=typeof BigInt>"u"?null:_n(BigInt.prototype.toString),iy=typeof Symbol>"u"?null:_n(Symbol.prototype.toString),rn=_n(Object.prototype.hasOwnProperty),Sl=_n(Object.prototype.toString),jn=_n(RegExp.prototype.test),wu=CN(TypeError);function _n(e){return function(n){n instanceof RegExp&&(n.lastIndex=0);for(var r=arguments.length,a=new Array(r>1?r-1:0),o=1;o<r;o++)a[o-1]=arguments[o];return fg(e,n,a)}}function CN(e){return function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return pg(e,r)}}function Xe(e,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Ll;if(Jb&&Jb(e,null),!Gn(n))return e;let a=n.length;for(;a--;){let o=n[a];if(typeof o=="string"){const g=r(o);g!==o&&(mN(n)||(n[a]=g),o=g)}e[o]=!0}return e}function EN(e){for(let n=0;n<e.length;n++)rn(e,n)||(e[n]=null);return e}function oi(e){const n=Va(null);for(const[r,a]of $x(e))rn(e,r)&&(Gn(a)?n[r]=EN(a):a&&typeof a=="object"&&a.constructor===Object?n[r]=oi(a):n[r]=a);return n}function kN(e){switch(typeof e){case"string":return e;case"number":return wN(e);case"boolean":return xN(e);case"bigint":return ny?ny(e):"0";case"symbol":return iy?iy(e):"Symbol()";case"undefined":return Sl(e);case"function":case"object":{if(e===null)return Sl(e);const n=e,r=Ya(n,"toString");if(typeof r=="function"){const a=r(n);return typeof a=="string"?a:Sl(a)}return Sl(e)}default:return Sl(e)}}function Ya(e,n){for(;e!==null;){const a=vN(e,n);if(a){if(a.get)return _n(a.get);if(typeof a.value=="function")return _n(a.value)}e=_N(e)}function r(){return null}return r}function AN(e){try{return jn(e,""),!0}catch{return!1}}const ry=Yn(["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"]),tp=Yn(["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"]),np=Yn(["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"]),TN=Yn(["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"]),ip=Yn(["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"]),RN=Yn(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),sy=Yn(["#text"]),ay=Yn(["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"]),rp=Yn(["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"]),oy=Yn(["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"]),xu=Yn(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),LN=Hi(/\{\{[\w\W]*|[\w\W]*\}\}/gm),MN=Hi(/<%[\w\W]*|[\w\W]*%>/gm),NN=Hi(/\$\{[\w\W]*/gm),ON=Hi(/^data-[\-\w.\u00B7-\uFFFF]+$/),DN=Hi(/^aria-[\-\w]+$/),Ux=Hi(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),BN=Hi(/^(?:\w+script|data):/i),jN=Hi(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Fx=Hi(/^html$/i),IN=Hi(/^[a-z][.\w]*(-[.\w]+)+$/i);var ly=Object.freeze({__proto__:null,ARIA_ATTR:DN,ATTR_WHITESPACE:jN,CUSTOM_ELEMENT:IN,DATA_ATTR:ON,DOCTYPE_NAME:Fx,ERB_EXPR:MN,IS_ALLOWED_URI:Ux,IS_SCRIPT_OR_DATA:BN,MUSTACHE_EXPR:LN,TMPLIT_EXPR:NN});const wl={element:1,text:3,progressingInstruction:7,comment:8,document:9},PN=function(){return typeof window>"u"?null:window},zN=function(n,r){if(typeof n!="object"||typeof n.createPolicy!="function")return null;let a=null;const o="data-tt-policy-suffix";r&&r.hasAttribute(o)&&(a=r.getAttribute(o));const g="dompurify"+(a?"#"+a:"");try{return n.createPolicy(g,{createHTML(_){return _},createScriptURL(_){return _}})}catch{return console.warn("TrustedTypes policy "+g+" could not be created."),null}},cy=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function Wx(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:PN();const n=Ne=>Wx(Ne);if(n.version="3.4.2",n.removed=[],!e||!e.document||e.document.nodeType!==wl.document||!e.Element)return n.isSupported=!1,n;let{document:r}=e;const a=r,o=a.currentScript,{DocumentFragment:g,HTMLTemplateElement:_,Node:c,Element:u,NodeFilter:d,NamedNodeMap:y=e.NamedNodeMap||e.MozNamedAttrMap,HTMLFormElement:m,DOMParser:w,trustedTypes:C}=e,A=u.prototype,E=Ya(A,"cloneNode"),f=Ya(A,"remove"),v=Ya(A,"nextSibling"),p=Ya(A,"childNodes"),S=Ya(A,"parentNode");if(typeof _=="function"){const Ne=r.createElement("template");Ne.content&&Ne.content.ownerDocument&&(r=Ne.content.ownerDocument)}let k,L="";const{implementation:R,createNodeIterator:M,createDocumentFragment:T,getElementsByTagName:I}=r,{importNode:K}=a;let F=cy();n.isSupported=typeof $x=="function"&&typeof S=="function"&&R&&R.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:G,ERB_EXPR:B,TMPLIT_EXPR:X,DATA_ATTR:Y,ARIA_ATTR:z,IS_SCRIPT_OR_DATA:q,ATTR_WHITESPACE:V,CUSTOM_ELEMENT:D}=ly;let{IS_ALLOWED_URI:H}=ly,O=null;const P=Xe({},[...ry,...tp,...np,...ip,...sy]);let W=null;const Z=Xe({},[...ay,...rp,...oy,...xu]);let ie=Object.seal(Va(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}})),he=null,te=null;const $=Object.seal(Va(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let le=!0,ge=!0,we=!1,Se=!0,je=!1,Ie=!0,Ge=!1,vt=!1,Le=!1,Rt=!1,Xt=!1,vn=!1,an=!0,kn=!1;const Zt="user-content-";let ut=!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 Xn=null;const bn=Xe({},["audio","video","img","source","image","track"]);let Pn=null;const dt=Xe({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),An="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({},[An,ve,$e],ep);let Dt=Xe({},["mi","mo","mn","ms","mtext"]),Tn=Xe({},["annotation-xml"]);const Un=Xe({},["title","style","font","a","script"]);let Bt=null;const Q=["application/xhtml+xml","text/html"],fe="text/html";let ye=null,Oe=null;const bt=r.createElement("form"),ht=function(J){return J instanceof RegExp||J instanceof Function},ke=function(){let J=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(Oe&&Oe===J)return;(!J||typeof J!="object")&&(J={}),J=oi(J),Bt=Q.indexOf(J.PARSER_MEDIA_TYPE)===-1?fe:J.PARSER_MEDIA_TYPE,ye=Bt==="application/xhtml+xml"?ep:Ll,O=rn(J,"ALLOWED_TAGS")&&Gn(J.ALLOWED_TAGS)?Xe({},J.ALLOWED_TAGS,ye):P,W=rn(J,"ALLOWED_ATTR")&&Gn(J.ALLOWED_ATTR)?Xe({},J.ALLOWED_ATTR,ye):Z,Ve=rn(J,"ALLOWED_NAMESPACES")&&Gn(J.ALLOWED_NAMESPACES)?Xe({},J.ALLOWED_NAMESPACES,ep):on,Pn=rn(J,"ADD_URI_SAFE_ATTR")&&Gn(J.ADD_URI_SAFE_ATTR)?Xe(oi(dt),J.ADD_URI_SAFE_ATTR,ye):dt,Xn=rn(J,"ADD_DATA_URI_TAGS")&&Gn(J.ADD_DATA_URI_TAGS)?Xe(oi(bn),J.ADD_DATA_URI_TAGS,ye):bn,Ft=rn(J,"FORBID_CONTENTS")&&Gn(J.FORBID_CONTENTS)?Xe({},J.FORBID_CONTENTS,ye):Kt,he=rn(J,"FORBID_TAGS")&&Gn(J.FORBID_TAGS)?Xe({},J.FORBID_TAGS,ye):oi({}),te=rn(J,"FORBID_ATTR")&&Gn(J.FORBID_ATTR)?Xe({},J.FORBID_ATTR,ye):oi({}),Ct=rn(J,"USE_PROFILES")?J.USE_PROFILES&&typeof J.USE_PROFILES=="object"?oi(J.USE_PROFILES):J.USE_PROFILES:!1,le=J.ALLOW_ARIA_ATTR!==!1,ge=J.ALLOW_DATA_ATTR!==!1,we=J.ALLOW_UNKNOWN_PROTOCOLS||!1,Se=J.ALLOW_SELF_CLOSE_IN_ATTR!==!1,je=J.SAFE_FOR_TEMPLATES||!1,Ie=J.SAFE_FOR_XML!==!1,Ge=J.WHOLE_DOCUMENT||!1,Rt=J.RETURN_DOM||!1,Xt=J.RETURN_DOM_FRAGMENT||!1,vn=J.RETURN_TRUSTED_TYPE||!1,Le=J.FORCE_BODY||!1,an=J.SANITIZE_DOM!==!1,kn=J.SANITIZE_NAMED_PROPS||!1,ut=J.KEEP_CONTENT!==!1,Lt=J.IN_PLACE||!1,H=AN(J.ALLOWED_URI_REGEXP)?J.ALLOWED_URI_REGEXP:Ux,Ze=typeof J.NAMESPACE=="string"?J.NAMESPACE:$e,Dt=rn(J,"MATHML_TEXT_INTEGRATION_POINTS")&&J.MATHML_TEXT_INTEGRATION_POINTS&&typeof J.MATHML_TEXT_INTEGRATION_POINTS=="object"?oi(J.MATHML_TEXT_INTEGRATION_POINTS):Xe({},["mi","mo","mn","ms","mtext"]),Tn=rn(J,"HTML_INTEGRATION_POINTS")&&J.HTML_INTEGRATION_POINTS&&typeof J.HTML_INTEGRATION_POINTS=="object"?oi(J.HTML_INTEGRATION_POINTS):Xe({},["annotation-xml"]);const _e=rn(J,"CUSTOM_ELEMENT_HANDLING")&&J.CUSTOM_ELEMENT_HANDLING&&typeof J.CUSTOM_ELEMENT_HANDLING=="object"?oi(J.CUSTOM_ELEMENT_HANDLING):Va(null);if(ie=Va(null),rn(_e,"tagNameCheck")&&ht(_e.tagNameCheck)&&(ie.tagNameCheck=_e.tagNameCheck),rn(_e,"attributeNameCheck")&&ht(_e.attributeNameCheck)&&(ie.attributeNameCheck=_e.attributeNameCheck),rn(_e,"allowCustomizedBuiltInElements")&&typeof _e.allowCustomizedBuiltInElements=="boolean"&&(ie.allowCustomizedBuiltInElements=_e.allowCustomizedBuiltInElements),je&&(ge=!1),Xt&&(Rt=!0),Ct&&(O=Xe({},sy),W=Va(null),Ct.html===!0&&(Xe(O,ry),Xe(W,ay)),Ct.svg===!0&&(Xe(O,tp),Xe(W,rp),Xe(W,xu)),Ct.svgFilters===!0&&(Xe(O,np),Xe(W,rp),Xe(W,xu)),Ct.mathMl===!0&&(Xe(O,ip),Xe(W,oy),Xe(W,xu))),$.tagCheck=null,$.attributeCheck=null,rn(J,"ADD_TAGS")&&(typeof J.ADD_TAGS=="function"?$.tagCheck=J.ADD_TAGS:Gn(J.ADD_TAGS)&&(O===P&&(O=oi(O)),Xe(O,J.ADD_TAGS,ye))),rn(J,"ADD_ATTR")&&(typeof J.ADD_ATTR=="function"?$.attributeCheck=J.ADD_ATTR:Gn(J.ADD_ATTR)&&(W===Z&&(W=oi(W)),Xe(W,J.ADD_ATTR,ye))),rn(J,"ADD_URI_SAFE_ATTR")&&Gn(J.ADD_URI_SAFE_ATTR)&&Xe(Pn,J.ADD_URI_SAFE_ATTR,ye),rn(J,"FORBID_CONTENTS")&&Gn(J.FORBID_CONTENTS)&&(Ft===Kt&&(Ft=oi(Ft)),Xe(Ft,J.FORBID_CONTENTS,ye)),rn(J,"ADD_FORBID_CONTENTS")&&Gn(J.ADD_FORBID_CONTENTS)&&(Ft===Kt&&(Ft=oi(Ft)),Xe(Ft,J.ADD_FORBID_CONTENTS,ye)),ut&&(O["#text"]=!0),Ge&&Xe(O,["html","head","body"]),O.table&&(Xe(O,["tbody"]),delete he.tbody),J.TRUSTED_TYPES_POLICY){if(typeof J.TRUSTED_TYPES_POLICY.createHTML!="function")throw wu('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof J.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw wu('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');k=J.TRUSTED_TYPES_POLICY,L=k.createHTML("")}else k===void 0&&(k=zN(C,o)),k!==null&&typeof L=="string"&&(L=k.createHTML(""));Yn&&Yn(J),Oe=J},Ce=Xe({},[...tp,...np,...TN]),Pe=Xe({},[...ip,...RN]),Vt=function(J){let _e=S(J);(!_e||!_e.tagName)&&(_e={namespaceURI:Ze,tagName:"template"});const Ee=Ll(J.tagName),ot=Ll(_e.tagName);return Ve[J.namespaceURI]?J.namespaceURI===ve?_e.namespaceURI===$e?Ee==="svg":_e.namespaceURI===An?Ee==="svg"&&(ot==="annotation-xml"||Dt[ot]):!!Ce[Ee]:J.namespaceURI===An?_e.namespaceURI===$e?Ee==="math":_e.namespaceURI===ve?Ee==="math"&&Tn[ot]:!!Pe[Ee]:J.namespaceURI===$e?_e.namespaceURI===ve&&!Tn[ot]||_e.namespaceURI===An&&!Dt[ot]?!1:!Pe[Ee]&&(Un[Ee]||!Ce[Ee]):!!(Bt==="application/xhtml+xml"&&Ve[J.namespaceURI]):!1},nt=function(J){yl(n.removed,{element:J});try{S(J).removeChild(J)}catch{f(J)}},Rn=function(J,_e){try{yl(n.removed,{attribute:_e.getAttributeNode(J),from:_e})}catch{yl(n.removed,{attribute:null,from:_e})}if(_e.removeAttribute(J),J==="is")if(Rt||Xt)try{nt(_e)}catch{}else try{_e.setAttribute(J,"")}catch{}},hr=function(J){let _e=null,Ee=null;if(Le)J="<remove></remove>"+J;else{const It=ey(J,/^[\r\n\t ]+/);Ee=It&&It[0]}Bt==="application/xhtml+xml"&&Ze===$e&&(J='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+J+"</body></html>");const ot=k?k.createHTML(J):J;if(Ze===$e)try{_e=new w().parseFromString(ot,Bt)}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 J&&Ee&&Je.insertBefore(r.createTextNode(Ee),Je.childNodes[0]||null),Ze===$e?I.call(_e,Ge?"html":"body")[0]:Ge?_e.documentElement:Je},dr=function(J){return M.call(J.ownerDocument||J,J,d.SHOW_ELEMENT|d.SHOW_COMMENT|d.SHOW_TEXT|d.SHOW_PROCESSING_INSTRUCTION|d.SHOW_CDATA_SECTION,null)},Zn=function(J){return J instanceof m&&(typeof J.nodeName!="string"||typeof J.textContent!="string"||typeof J.removeChild!="function"||!(J.attributes instanceof y)||typeof J.removeAttribute!="function"||typeof J.setAttribute!="function"||typeof J.namespaceURI!="string"||typeof J.insertBefore!="function"||typeof J.hasChildNodes!="function")},jt=function(J){return typeof c=="function"&&J instanceof c};function Nt(Ne,J,_e){bl(Ne,Ee=>{Ee.call(n,J,_e,Oe)})}const Ui=function(J){let _e=null;if(Nt(F.beforeSanitizeElements,J,null),Zn(J))return nt(J),!0;const Ee=ye(J.nodeName);if(Nt(F.uponSanitizeElement,J,{tagName:Ee,allowedTags:O}),Ie&&J.hasChildNodes()&&!jt(J.firstElementChild)&&jn(/<[/\w!]/g,J.innerHTML)&&jn(/<[/\w!]/g,J.textContent)||Ie&&J.namespaceURI===$e&&Ee==="style"&&jt(J.firstElementChild)||J.nodeType===wl.progressingInstruction||Ie&&J.nodeType===wl.comment&&jn(/<[/\w]/g,J.data))return nt(J),!0;if(he[Ee]||!($.tagCheck instanceof Function&&$.tagCheck(Ee))&&!O[Ee]){if(!he[Ee]&&fr(Ee)&&(ie.tagNameCheck instanceof RegExp&&jn(ie.tagNameCheck,Ee)||ie.tagNameCheck instanceof Function&&ie.tagNameCheck(Ee)))return!1;if(ut&&!Ft[Ee]){const ot=S(J)||J.parentNode,Je=p(J)||J.childNodes;if(Je&&ot){const It=Je.length;for(let Jt=It-1;Jt>=0;--Jt){const Qt=E(Je[Jt],!0);ot.insertBefore(Qt,v(J))}}}return nt(J),!0}return J instanceof u&&!Vt(J)||(Ee==="noscript"||Ee==="noembed"||Ee==="noframes")&&jn(/<\/no(script|embed|frames)/i,J.innerHTML)?(nt(J),!0):(je&&J.nodeType===wl.text&&(_e=J.textContent,bl([G,B,X],ot=>{_e=Ga(_e,ot," ")}),J.textContent!==_e&&(yl(n.removed,{element:J.cloneNode()}),J.textContent=_e)),Nt(F.afterSanitizeElements,J,null),!1)},Fr=function(J,_e,Ee){if(te[_e]||an&&(_e==="id"||_e==="name")&&(Ee in r||Ee in bt))return!1;const ot=W[_e]||$.attributeCheck instanceof Function&&$.attributeCheck(_e,J);if(!(ge&&!te[_e]&&jn(Y,_e))){if(!(le&&jn(z,_e))){if(!ot||te[_e]){if(!(fr(J)&&(ie.tagNameCheck instanceof RegExp&&jn(ie.tagNameCheck,J)||ie.tagNameCheck instanceof Function&&ie.tagNameCheck(J))&&(ie.attributeNameCheck instanceof RegExp&&jn(ie.attributeNameCheck,_e)||ie.attributeNameCheck instanceof Function&&ie.attributeNameCheck(_e,J))||_e==="is"&&ie.allowCustomizedBuiltInElements&&(ie.tagNameCheck instanceof RegExp&&jn(ie.tagNameCheck,Ee)||ie.tagNameCheck instanceof Function&&ie.tagNameCheck(Ee))))return!1}else if(!Pn[_e]){if(!jn(H,Ga(Ee,V,""))){if(!((_e==="src"||_e==="xlink:href"||_e==="href")&&J!=="script"&&ty(Ee,"data:")===0&&Xn[J])){if(!(we&&!jn(q,Ga(Ee,V,"")))){if(Ee)return!1}}}}}}return!0},oa=Xe({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),fr=function(J){return!oa[Ll(J)]&&jn(D,J)},As=function(J){Nt(F.beforeSanitizeAttributes,J,null);const{attributes:_e}=J;if(!_e||Zn(J))return;const Ee={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:W,forceKeepAttr:void 0};let ot=_e.length;for(;ot--;){const Je=_e[ot],{name:It,namespaceURI:Jt,value:Qt}=Je,be=ye(It),Me=Qt;let De=It==="value"?Me:SN(Me);if(Ee.attrName=be,Ee.attrValue=De,Ee.keepAttr=!0,Ee.forceKeepAttr=void 0,Nt(F.uponSanitizeAttribute,J,Ee),De=Ee.attrValue,kn&&(be==="id"||be==="name")&&ty(De,Zt)!==0&&(Rn(It,J),De=Zt+De),Ie&&jn(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,De)){Rn(It,J);continue}if(be==="attributename"&&ey(De,"href")){Rn(It,J);continue}if(Ee.forceKeepAttr)continue;if(!Ee.keepAttr){Rn(It,J);continue}if(!Se&&jn(/\/>/i,De)){Rn(It,J);continue}je&&bl([G,B,X],Wt=>{De=Ga(De,Wt," ")});const ft=ye(J.nodeName);if(!Fr(ft,be,De)){Rn(It,J);continue}if(k&&typeof C=="object"&&typeof C.getAttributeType=="function"&&!Jt)switch(C.getAttributeType(ft,be)){case"TrustedHTML":{De=k.createHTML(De);break}case"TrustedScriptURL":{De=k.createScriptURL(De);break}}if(De!==Me)try{Jt?J.setAttributeNS(Jt,It,De):J.setAttribute(It,De),Zn(J)?nt(J):Qb(n.removed)}catch{Rn(It,J)}}Nt(F.afterSanitizeAttributes,J,null)},Qi=function(J){let _e=null;const Ee=dr(J);for(Nt(F.beforeSanitizeShadowDOM,J,null);_e=Ee.nextNode();)Nt(F.uponSanitizeShadowNode,_e,null),Ui(_e),As(_e),_e.content instanceof g&&Qi(_e.content);Nt(F.afterSanitizeShadowDOM,J,null)};return n.sanitize=function(Ne){let J=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},_e=null,Ee=null,ot=null,Je=null;if(at=!Ne,at&&(Ne="<!-->"),typeof Ne!="string"&&!jt(Ne)&&(Ne=kN(Ne),typeof Ne!="string"))throw wu("dirty is not a string, aborting");if(!n.isSupported)return Ne;if(vt||ke(J),n.removed=[],typeof Ne=="string"&&(Lt=!1),Lt){const Qt=Ne.nodeName;if(typeof Qt=="string"){const be=ye(Qt);if(!O[be]||he[be])throw wu("root node is forbidden and cannot be sanitized in-place")}}else if(Ne instanceof c)_e=hr("<!---->"),Ee=_e.ownerDocument.importNode(Ne,!0),Ee.nodeType===wl.element&&Ee.nodeName==="BODY"||Ee.nodeName==="HTML"?_e=Ee:_e.appendChild(Ee);else{if(!Rt&&!je&&!Ge&&Ne.indexOf("<")===-1)return k&&vn?k.createHTML(Ne):Ne;if(_e=hr(Ne),!_e)return Rt?null:vn?L:""}_e&&Le&&nt(_e.firstChild);const It=dr(Lt?Ne:_e);for(;ot=It.nextNode();)Ui(ot),As(ot),ot.content instanceof g&&Qi(ot.content);if(Lt)return Ne;if(Rt){if(je){_e.normalize();let Qt=_e.innerHTML;bl([G,B,X],be=>{Qt=Ga(Qt,be," ")}),_e.innerHTML=Qt}if(Xt)for(Je=T.call(_e.ownerDocument);_e.firstChild;)Je.appendChild(_e.firstChild);else Je=_e;return(W.shadowroot||W.shadowrootmode)&&(Je=K.call(a,Je,!0)),Je}let Jt=Ge?_e.outerHTML:_e.innerHTML;return Ge&&O["!doctype"]&&_e.ownerDocument&&_e.ownerDocument.doctype&&_e.ownerDocument.doctype.name&&jn(Fx,_e.ownerDocument.doctype.name)&&(Jt="<!DOCTYPE "+_e.ownerDocument.doctype.name+`>
|
|
156
|
-
`+Jt),je&&bl([G,B,X],Qt=>{Jt=Ga(Jt,Qt," ")}),k&&vn?k.createHTML(Jt):Jt},n.setConfig=function(){let Ne=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};ke(Ne),vt=!0},n.clearConfig=function(){Oe=null,vt=!1},n.isValidAttribute=function(Ne,J,_e){Oe||ke({});const Ee=ye(Ne),ot=ye(J);return Fr(Ee,ot,_e)},n.addHook=function(Ne,J){typeof J=="function"&&yl(F[Ne],J)},n.removeHook=function(Ne,J){if(J!==void 0){const _e=bN(F[Ne],J);return _e===-1?void 0:yN(F[Ne],_e,1)[0]}return Qb(F[Ne])},n.removeHooks=function(Ne){F[Ne]=[]},n.removeAllHooks=function(){F=cy()},n}var jl=Wx(),sp,uy;function HN(){if(uy)return sp;uy=1;function e(Q){return Q instanceof Map?Q.clear=Q.delete=Q.set=function(){throw new Error("map is read-only")}:Q instanceof Set&&(Q.add=Q.clear=Q.delete=function(){throw new Error("set is read-only")}),Object.freeze(Q),Object.getOwnPropertyNames(Q).forEach(fe=>{const ye=Q[fe],Oe=typeof ye;(Oe==="object"||Oe==="function")&&!Object.isFrozen(ye)&&e(ye)}),Q}class n{constructor(fe){fe.data===void 0&&(fe.data={}),this.data=fe.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function r(Q){return Q.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function a(Q,...fe){const ye=Object.create(null);for(const Oe in Q)ye[Oe]=Q[Oe];return fe.forEach(function(Oe){for(const bt in Oe)ye[bt]=Oe[bt]}),ye}const o="</span>",g=Q=>!!Q.scope,_=(Q,{prefix:fe})=>{if(Q.startsWith("language:"))return Q.replace("language:","language-");if(Q.includes(".")){const ye=Q.split(".");return[`${fe}${ye.shift()}`,...ye.map((Oe,bt)=>`${Oe}${"_".repeat(bt+1)}`)].join(" ")}return`${fe}${Q}`};class c{constructor(fe,ye){this.buffer="",this.classPrefix=ye.classPrefix,fe.walk(this)}addText(fe){this.buffer+=r(fe)}openNode(fe){if(!g(fe))return;const ye=_(fe.scope,{prefix:this.classPrefix});this.span(ye)}closeNode(fe){g(fe)&&(this.buffer+=o)}value(){return this.buffer}span(fe){this.buffer+=`<span class="${fe}">`}}const u=(Q={})=>{const fe={children:[]};return Object.assign(fe,Q),fe};class d{constructor(){this.rootNode=u(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(fe){this.top.children.push(fe)}openNode(fe){const ye=u({scope:fe});this.add(ye),this.stack.push(ye)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(fe){return this.constructor._walk(fe,this.rootNode)}static _walk(fe,ye){return typeof ye=="string"?fe.addText(ye):ye.children&&(fe.openNode(ye),ye.children.forEach(Oe=>this._walk(fe,Oe)),fe.closeNode(ye)),fe}static _collapse(fe){typeof fe!="string"&&fe.children&&(fe.children.every(ye=>typeof ye=="string")?fe.children=[fe.children.join("")]:fe.children.forEach(ye=>{d._collapse(ye)}))}}class y extends d{constructor(fe){super(),this.options=fe}addText(fe){fe!==""&&this.add(fe)}startScope(fe){this.openNode(fe)}endScope(){this.closeNode()}__addSublanguage(fe,ye){const Oe=fe.root;ye&&(Oe.scope=`language:${ye}`),this.add(Oe)}toHTML(){return new c(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}}function m(Q){return Q?typeof Q=="string"?Q:Q.source:null}function w(Q){return E("(?=",Q,")")}function C(Q){return E("(?:",Q,")*")}function A(Q){return E("(?:",Q,")?")}function E(...Q){return Q.map(ye=>m(ye)).join("")}function f(Q){const fe=Q[Q.length-1];return typeof fe=="object"&&fe.constructor===Object?(Q.splice(Q.length-1,1),fe):{}}function v(...Q){return"("+(f(Q).capture?"":"?:")+Q.map(Oe=>m(Oe)).join("|")+")"}function p(Q){return new RegExp(Q.toString()+"|").exec("").length-1}function S(Q,fe){const ye=Q&&Q.exec(fe);return ye&&ye.index===0}const k=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function L(Q,{joinWith:fe}){let ye=0;return Q.map(Oe=>{ye+=1;const bt=ye;let ht=m(Oe),ke="";for(;ht.length>0;){const Ce=k.exec(ht);if(!Ce){ke+=ht;break}ke+=ht.substring(0,Ce.index),ht=ht.substring(Ce.index+Ce[0].length),Ce[0][0]==="\\"&&Ce[1]?ke+="\\"+String(Number(Ce[1])+bt):(ke+=Ce[0],Ce[0]==="("&&ye++)}return ke}).map(Oe=>`(${Oe})`).join(fe)}const R=/\b\B/,M="[a-zA-Z]\\w*",T="[a-zA-Z_]\\w*",I="\\b\\d+(\\.\\d+)?",K="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",F="\\b(0b[01]+)",G="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",B=(Q={})=>{const fe=/^#![ ]*\//;return Q.binary&&(Q.begin=E(fe,/.*\b/,Q.binary,/\b.*/)),a({scope:"meta",begin:fe,end:/$/,relevance:0,"on:begin":(ye,Oe)=>{ye.index!==0&&Oe.ignoreMatch()}},Q)},X={begin:"\\\\[\\s\\S]",relevance:0},Y={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[X]},z={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[X]},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(Q,fe,ye={}){const Oe=a({scope:"comment",begin:Q,end:fe,contains:[]},ye);Oe.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 Oe.contains.push({begin:E(/[ ]+/,"(",bt,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),Oe},D=V("//","$"),H=V("/\\*","\\*/"),O=V("#","$"),P={scope:"number",begin:I,relevance:0},W={scope:"number",begin:K,relevance:0},Z={scope:"number",begin:F,relevance:0},ie={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[X,{begin:/\[/,end:/\]/,relevance:0,contains:[X]}]},he={scope:"title",begin:M,relevance:0},te={scope:"title",begin:T,relevance:0},$={begin:"\\.\\s*"+T,relevance:0};var ge=Object.freeze({__proto__:null,APOS_STRING_MODE:Y,BACKSLASH_ESCAPE:X,BINARY_NUMBER_MODE:Z,BINARY_NUMBER_RE:F,COMMENT:V,C_BLOCK_COMMENT_MODE:H,C_LINE_COMMENT_MODE:D,C_NUMBER_MODE:W,C_NUMBER_RE:K,END_SAME_AS_BEGIN:function(Q){return Object.assign(Q,{"on:begin":(fe,ye)=>{ye.data._beginMatch=fe[1]},"on:end":(fe,ye)=>{ye.data._beginMatch!==fe[1]&&ye.ignoreMatch()}})},HASH_COMMENT_MODE:O,IDENT_RE:M,MATCH_NOTHING_RE:R,METHOD_GUARD:$,NUMBER_MODE:P,NUMBER_RE:I,PHRASAL_WORDS_MODE:q,QUOTE_STRING_MODE:z,REGEXP_MODE:ie,RE_STARTERS_RE:G,SHEBANG:B,TITLE_MODE:he,UNDERSCORE_IDENT_RE:T,UNDERSCORE_TITLE_MODE:te});function we(Q,fe){Q.input[Q.index-1]==="."&&fe.ignoreMatch()}function Se(Q,fe){Q.className!==void 0&&(Q.scope=Q.className,delete Q.className)}function je(Q,fe){fe&&Q.beginKeywords&&(Q.begin="\\b("+Q.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",Q.__beforeBegin=we,Q.keywords=Q.keywords||Q.beginKeywords,delete Q.beginKeywords,Q.relevance===void 0&&(Q.relevance=0))}function Ie(Q,fe){Array.isArray(Q.illegal)&&(Q.illegal=v(...Q.illegal))}function Ge(Q,fe){if(Q.match){if(Q.begin||Q.end)throw new Error("begin & end are not supported with match");Q.begin=Q.match,delete Q.match}}function vt(Q,fe){Q.relevance===void 0&&(Q.relevance=1)}const Le=(Q,fe)=>{if(!Q.beforeMatch)return;if(Q.starts)throw new Error("beforeMatch cannot be used with starts");const ye=Object.assign({},Q);Object.keys(Q).forEach(Oe=>{delete Q[Oe]}),Q.keywords=ye.keywords,Q.begin=E(ye.beforeMatch,w(ye.begin)),Q.starts={relevance:0,contains:[Object.assign(ye,{endsParent:!0})]},Q.relevance=0,delete ye.beforeMatch},Rt=["of","and","for","in","not","or","if","then","parent","list","value"],Xt="keyword";function vn(Q,fe,ye=Xt){const Oe=Object.create(null);return typeof Q=="string"?bt(ye,Q.split(" ")):Array.isArray(Q)?bt(ye,Q):Object.keys(Q).forEach(function(ht){Object.assign(Oe,vn(Q[ht],fe,ht))}),Oe;function bt(ht,ke){fe&&(ke=ke.map(Ce=>Ce.toLowerCase())),ke.forEach(function(Ce){const Pe=Ce.split("|");Oe[Pe[0]]=[ht,an(Pe[0],Pe[1])]})}}function an(Q,fe){return fe?Number(fe):kn(Q)?0:1}function kn(Q){return Rt.includes(Q.toLowerCase())}const Zt={},ut=Q=>{console.error(Q)},Lt=(Q,...fe)=>{console.log(`WARN: ${Q}`,...fe)},Ct=(Q,fe)=>{Zt[`${Q}/${fe}`]||(console.log(`Deprecated as of ${Q}. ${fe}`),Zt[`${Q}/${fe}`]=!0)},Ft=new Error;function Kt(Q,fe,{key:ye}){let Oe=0;const bt=Q[ye],ht={},ke={};for(let Ce=1;Ce<=fe.length;Ce++)ke[Ce+Oe]=bt[Ce],ht[Ce+Oe]=!0,Oe+=p(fe[Ce-1]);Q[ye]=ke,Q[ye]._emit=ht,Q[ye]._multi=!0}function Xn(Q){if(Array.isArray(Q.begin)){if(Q.skip||Q.excludeBegin||Q.returnBegin)throw ut("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),Ft;if(typeof Q.beginScope!="object"||Q.beginScope===null)throw ut("beginScope must be object"),Ft;Kt(Q,Q.begin,{key:"beginScope"}),Q.begin=L(Q.begin,{joinWith:""})}}function bn(Q){if(Array.isArray(Q.end)){if(Q.skip||Q.excludeEnd||Q.returnEnd)throw ut("skip, excludeEnd, returnEnd not compatible with endScope: {}"),Ft;if(typeof Q.endScope!="object"||Q.endScope===null)throw ut("endScope must be object"),Ft;Kt(Q,Q.end,{key:"endScope"}),Q.end=L(Q.end,{joinWith:""})}}function Pn(Q){Q.scope&&typeof Q.scope=="object"&&Q.scope!==null&&(Q.beginScope=Q.scope,delete Q.scope)}function dt(Q){Pn(Q),typeof Q.beginScope=="string"&&(Q.beginScope={_wrap:Q.beginScope}),typeof Q.endScope=="string"&&(Q.endScope={_wrap:Q.endScope}),Xn(Q),bn(Q)}function An(Q){function fe(ke,Ce){return new RegExp(m(ke),"m"+(Q.case_insensitive?"i":"")+(Q.unicodeRegex?"u":"")+(Ce?"g":""))}class ye{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+=p(Ce)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);const Ce=this.regexes.map(Pe=>Pe[1]);this.matcherRe=fe(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,hr)=>hr>0&&Rn!==void 0),nt=this.matchIndexes[Vt];return Pe.splice(0,Vt),Object.assign(Pe,nt)}}class Oe{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 ye;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 Oe;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 ht(ke,Ce){const Pe=ke;if(ke.isCompiled)return Pe;[Se,Ge,dt,Le].forEach(nt=>nt(ke,Ce)),Q.compilerExtensions.forEach(nt=>nt(ke,Ce)),ke.__beforeBegin=null,[je,Ie,vt].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,Q.case_insensitive)),Pe.keywordPatternRe=fe(Vt,!0),Ce&&(ke.begin||(ke.begin=/\B|\b/),Pe.beginRe=fe(Pe.begin),!ke.end&&!ke.endsWithParent&&(ke.end=/\B|\b/),ke.end&&(Pe.endRe=fe(Pe.end)),Pe.terminatorEnd=m(Pe.end)||"",ke.endsWithParent&&Ce.terminatorEnd&&(Pe.terminatorEnd+=(ke.end?"|":"")+Ce.terminatorEnd)),ke.illegal&&(Pe.illegalRe=fe(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){ht(nt,Pe)}),ke.starts&&ht(ke.starts,Ce),Pe.matcher=bt(Pe),Pe}if(Q.compilerExtensions||(Q.compilerExtensions=[]),Q.contains&&Q.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return Q.classNameAliases=a(Q.classNameAliases||{}),ht(Q)}function ve(Q){return Q?Q.endsWithParent||ve(Q.starts):!1}function $e(Q){return Q.variants&&!Q.cachedVariants&&(Q.cachedVariants=Q.variants.map(function(fe){return a(Q,{variants:null},fe)})),Q.cachedVariants?Q.cachedVariants:ve(Q)?a(Q,{starts:Q.starts?a(Q.starts):null}):Object.isFrozen(Q)?a(Q):Q}var Ze="11.11.1";class at extends Error{constructor(fe,ye){super(fe),this.name="HTMLInjectionError",this.html=ye}}const Ve=r,on=a,Dt=Symbol("nomatch"),Tn=7,Un=function(Q){const fe=Object.create(null),ye=Object.create(null),Oe=[];let bt=!0;const ht="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 Me=be.className+" ";Me+=be.parentNode?be.parentNode.className:"";const De=Ce.languageDetectRe.exec(Me);if(De){const ft=J(De[1]);return ft||(Lt(ht.replace("{}",De[1])),Lt("Falling back to no-highlight mode for this block.",be)),ft?De[1]:"no-highlight"}return Me.split(/\s+/).find(ft=>Pe(ft)||J(ft))}function nt(be,Me,De){let ft="",Wt="";typeof Me=="object"?(ft=be,De=Me.ignoreIllegals,Wt=Me.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,ft=Me),De===void 0&&(De=!0);const zn={code:ft,language:Wt};Jt("before:highlight",zn);const ci=zn.result?zn.result:Rn(zn.language,zn.code,De);return ci.code=zn.code,Jt("after:highlight",ci),ci}function Rn(be,Me,De,ft){const Wt=Object.create(null);function zn(xe,Te){return xe.keywords[Te]}function ci(){if(!Ue.keywords){hn.addText(yt);return}let xe=0;Ue.keywordPatternRe.lastIndex=0;let Te=Ue.keywordPatternRe.exec(yt),We="";for(;Te;){We+=yt.substring(xe,Te.index);const it=Ln.case_insensitive?Te[0].toLowerCase():Te[0],Yt=zn(Ue,it);if(Yt){const[xi,yo]=Yt;if(hn.addText(We),We="",Wt[it]=(Wt[it]||0)+1,Wt[it]<=Tn&&(Wr+=yo),xi.startsWith("_"))We+=Te[0];else{const nc=Ln.classNameAliases[xi]||xi;ui(Te[0],nc)}}else We+=Te[0];xe=Ue.keywordPatternRe.lastIndex,Te=Ue.keywordPatternRe.exec(yt)}We+=yt.substring(xe),hn.addText(We)}function Jn(){if(yt==="")return;let xe=null;if(typeof Ue.subLanguage=="string"){if(!fe[Ue.subLanguage]){hn.addText(yt);return}xe=Rn(Ue.subLanguage,yt,!0,tc[Ue.subLanguage]),tc[Ue.subLanguage]=xe._top}else xe=dr(yt,Ue.subLanguage.length?Ue.subLanguage:null);Ue.relevance>0&&(Wr+=xe.relevance),hn.__addSublanguage(xe._emitter,xe.language)}function Ot(){Ue.subLanguage!=null?Jn():ci(),yt=""}function ui(xe,Te){xe!==""&&(hn.startScope(Te),hn.addText(xe),hn.endScope())}function Ql(xe,Te){let We=1;const it=Te.length-1;for(;We<=it;){if(!xe._emit[We]){We++;continue}const Yt=Ln.classNameAliases[xe[We]]||xe[We],xi=Te[We];Yt?ui(xi,Yt):(yt=xi,ci(),yt=""),We++}}function la(xe,Te){return xe.scope&&typeof xe.scope=="string"&&hn.openNode(Ln.classNameAliases[xe.scope]||xe.scope),xe.beginScope&&(xe.beginScope._wrap?(ui(yt,Ln.classNameAliases[xe.beginScope._wrap]||xe.beginScope._wrap),yt=""):xe.beginScope._multi&&(Ql(xe.beginScope,Te),yt="")),Ue=Object.create(xe,{parent:{value:Ue}}),Ue}function _o(xe,Te,We){let it=S(xe.endRe,We);if(it){if(xe["on:end"]){const Yt=new n(xe);xe["on:end"](Te,Yt),Yt.isMatchIgnored&&(it=!1)}if(it){for(;xe.endsParent&&xe.parent;)xe=xe.parent;return xe}}if(xe.endsWithParent)return _o(xe.parent,Te,We)}function ca(xe){return Ue.matcher.regexIndex===0?(yt+=xe[0],1):(Gr=!0,0)}function xh(xe){const Te=xe[0],We=xe.rule,it=new n(We),Yt=[We.__beforeBegin,We["on:begin"]];for(const xi of Yt)if(xi&&(xi(xe,it),it.isMatchIgnored))return ca(Te);return We.skip?yt+=Te:(We.excludeBegin&&(yt+=Te),Ot(),!We.returnBegin&&!We.excludeBegin&&(yt=Te)),la(We,xe),We.returnBegin?0:Te.length}function Qn(xe){const Te=xe[0],We=Me.substring(xe.index),it=_o(Ue,xe,We);if(!it)return Dt;const Yt=Ue;Ue.endScope&&Ue.endScope._wrap?(Ot(),ui(Te,Ue.endScope._wrap)):Ue.endScope&&Ue.endScope._multi?(Ot(),Ql(Ue.endScope,xe)):Yt.skip?yt+=Te:(Yt.returnEnd||Yt.excludeEnd||(yt+=Te),Ot(),Yt.excludeEnd&&(yt=Te));do Ue.scope&&hn.closeNode(),!Ue.skip&&!Ue.subLanguage&&(Wr+=Ue.relevance),Ue=Ue.parent;while(Ue!==it.parent);return it.starts&&la(it.starts,xe),Yt.returnEnd?0:Te.length}function vo(){const xe=[];for(let Te=Ue;Te!==Ln;Te=Te.parent)Te.scope&&xe.unshift(Te.scope);xe.forEach(Te=>hn.openNode(Te))}let Ts={};function ua(xe,Te){const We=Te&&Te[0];if(yt+=xe,We==null)return Ot(),0;if(Ts.type==="begin"&&Te.type==="end"&&Ts.index===Te.index&&We===""){if(yt+=Me.slice(Te.index,Te.index+1),!bt){const it=new Error(`0 width match regex (${be})`);throw it.languageName=be,it.badRule=Ts.rule,it}return 1}if(Ts=Te,Te.type==="begin")return xh(Te);if(Te.type==="illegal"&&!De){const it=new Error('Illegal lexeme "'+We+'" for mode "'+(Ue.scope||"<unnamed>")+'"');throw it.mode=Ue,it}else if(Te.type==="end"){const it=Qn(Te);if(it!==Dt)return it}if(Te.type==="illegal"&&We==="")return yt+=`
|
|
158
|
-
`,1;if(bo>1e5&&bo>Te.index*3)throw new Error("potential infinite loop, way more iterations than matches");return yt+=We,We.length}const Ln=J(be);if(!Ln)throw ut(ht.replace("{}",be)),new Error('Unknown language: "'+be+'"');const ec=An(Ln);let ha="",Ue=ft||ec;const tc={},hn=new Ce.__emitter(Ce);vo();let yt="",Wr=0,pr=0,bo=0,Gr=!1;try{if(Ln.__emitTokens)Ln.__emitTokens(Me,hn);else{for(Ue.matcher.considerAll();;){bo++,Gr?Gr=!1:Ue.matcher.considerAll(),Ue.matcher.lastIndex=pr;const xe=Ue.matcher.exec(Me);if(!xe)break;const Te=Me.substring(pr,xe.index),We=ua(Te,xe);pr=xe.index+We}ua(Me.substring(pr))}return hn.finalize(),ha=hn.toHTML(),{language:be,value:ha,relevance:Wr,illegal:!1,_emitter:hn,_top:Ue}}catch(xe){if(xe.message&&xe.message.includes("Illegal"))return{language:be,value:Ve(Me),illegal:!0,relevance:0,_illegalBy:{message:xe.message,index:pr,context:Me.slice(pr-100,pr+100),mode:xe.mode,resultSoFar:ha},_emitter:hn};if(bt)return{language:be,value:Ve(Me),illegal:!1,relevance:0,errorRaised:xe,_emitter:hn,_top:Ue};throw xe}}function hr(be){const Me={value:Ve(be),illegal:!1,relevance:0,_top:ke,_emitter:new Ce.__emitter(Ce)};return Me._emitter.addText(be),Me}function dr(be,Me){Me=Me||Ce.languages||Object.keys(fe);const De=hr(be),ft=Me.filter(J).filter(Ee).map(Ot=>Rn(Ot,be,!1));ft.unshift(De);const Wt=ft.sort((Ot,ui)=>{if(Ot.relevance!==ui.relevance)return ui.relevance-Ot.relevance;if(Ot.language&&ui.language){if(J(Ot.language).supersetOf===ui.language)return 1;if(J(ui.language).supersetOf===Ot.language)return-1}return 0}),[zn,ci]=Wt,Jn=zn;return Jn.secondBest=ci,Jn}function Zn(be,Me,De){const ft=Me&&ye[Me]||De;be.classList.add("hljs"),be.classList.add(`language-${ft}`)}function jt(be){let Me=null;const De=Vt(be);if(Pe(De))return;if(Jt("before:highlightElement",{el:be,language:De}),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);Me=be;const ft=Me.textContent,Wt=De?nt(ft,{language:De,ignoreIllegals:!0}):dr(ft);be.innerHTML=Wt.value,be.dataset.highlighted="yes",Zn(be,De,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:ft})}function Nt(be){Ce=on(Ce,be)}const Ui=()=>{fr(),Ct("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function Fr(){fr(),Ct("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let oa=!1;function fr(){function be(){fr()}if(document.readyState==="loading"){oa||window.addEventListener("DOMContentLoaded",be,!1),oa=!0;return}document.querySelectorAll(Ce.cssSelector).forEach(jt)}function As(be,Me){let De=null;try{De=Me(Q)}catch(ft){if(ut("Language definition for '{}' could not be registered.".replace("{}",be)),bt)ut(ft);else throw ft;De=ke}De.name||(De.name=be),fe[be]=De,De.rawDefinition=Me.bind(null,Q),De.aliases&&_e(De.aliases,{languageName:be})}function Qi(be){delete fe[be];for(const Me of Object.keys(ye))ye[Me]===be&&delete ye[Me]}function Ne(){return Object.keys(fe)}function J(be){return be=(be||"").toLowerCase(),fe[be]||fe[ye[be]]}function _e(be,{languageName:Me}){typeof be=="string"&&(be=[be]),be.forEach(De=>{ye[De.toLowerCase()]=Me})}function Ee(be){const Me=J(be);return Me&&!Me.disableAutodetect}function ot(be){be["before:highlightBlock"]&&!be["before:highlightElement"]&&(be["before:highlightElement"]=Me=>{be["before:highlightBlock"](Object.assign({block:Me.el},Me))}),be["after:highlightBlock"]&&!be["after:highlightElement"]&&(be["after:highlightElement"]=Me=>{be["after:highlightBlock"](Object.assign({block:Me.el},Me))})}function Je(be){ot(be),Oe.push(be)}function It(be){const Me=Oe.indexOf(be);Me!==-1&&Oe.splice(Me,1)}function Jt(be,Me){const De=be;Oe.forEach(function(ft){ft[De]&&ft[De](Me)})}function Qt(be){return Ct("10.7.0","highlightBlock will be removed entirely in v12.0"),Ct("10.7.0","Please use highlightElement now."),jt(be)}Object.assign(Q,{highlight:nt,highlightAuto:dr,highlightAll:fr,highlightElement:jt,highlightBlock:Qt,configure:Nt,initHighlighting:Ui,initHighlightingOnLoad:Fr,registerLanguage:As,unregisterLanguage:Qi,listLanguages:Ne,getLanguage:J,registerAliases:_e,autoDetection:Ee,inherit:on,addPlugin:Je,removePlugin:It}),Q.debugMode=function(){bt=!1},Q.safeMode=function(){bt=!0},Q.versionString=Ze,Q.regex={concat:E,lookahead:w,either:v,optional:A,anyNumberOfTimes:C};for(const be in ge)typeof ge[be]=="object"&&e(ge[be]);return Object.assign(Q,ge),Q},Bt=Un({});return Bt.newInstance=()=>Un({}),sp=Bt,Bt.HighlightJS=Bt,Bt.default=Bt,sp}var $N=HN();const Ni=Bg($N);function hy(e){const n=e.regex,r={},a={begin:/\$\{/,end:/\}/,contains:["self",{begin:/:-/,contains:[r]}]};Object.assign(r,{className:"variable",variants:[{begin:n.concat(/\$[\w\d#@][\w\d_]*/,"(?![\\w\\d])(?![$])")},a]});const o={className:"subst",begin:/\$\(/,end:/\)/,contains:[e.BACKSLASH_ESCAPE]},g=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,r,o]};o.contains.push(c);const u={match:/\\"/},d={className:"string",begin:/'/,end:/'/},y={match:/\\'/},m={begin:/\$?\(\(/,end:/\)\)/,contains:[{begin:/\d+#[0-9a-f]+/,className:"number"},e.NUMBER_MODE,r]},w=["fish","bash","zsh","sh","csh","ksh","tcsh","dash","scsh"],C=e.SHEBANG({binary:`(${w.join("|")})`,relevance:10}),A={className:"function",begin:/\w[\w\d_]*\s*\(\s*\)\s*\{/,returnBegin:!0,contains:[e.inherit(e.TITLE_MODE,{begin:/\w[\w\d_]*/})],relevance:0},E=["if","then","else","elif","fi","time","for","while","until","in","do","done","case","esac","coproc","function","select"],f=["true","false"],v={match:/(\/[a-z._-]+)+/},p=["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:f,built_in:[...p,...S,"set","shopt",...k,...L]},contains:[C,e.SHEBANG(),A,m,g,_,v,c,u,d,y,r]}}const dy="[A-Za-z$_][0-9A-Za-z$_]*",UN=["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"],FN=["true","false","null","undefined","NaN","Infinity"],Gx=["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"],qx=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],Kx=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],WN=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],GN=[].concat(Kx,Gx,qx);function fy(e){const n=e.regex,r=(V,{after:D})=>{const H="</"+V[0].slice(1);return V.input.indexOf(H,D)!==-1},a=dy,o={begin:"<>",end:"</>"},g=/<[A-Za-z0-9\\._:-]+\s*\/>/,_={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(V,D)=>{const H=V[0].length+V.index,O=V.input[H];if(O==="<"||O===","){D.ignoreMatch();return}O===">"&&(r(V,{after:H})||D.ignoreMatch());let P;const W=V.input.substring(H);if(P=W.match(/^\s*=/)){D.ignoreMatch();return}if((P=W.match(/^\s+extends\s+/))&&P.index===0){D.ignoreMatch();return}}},c={$pattern:dy,keyword:UN,literal:FN,built_in:GN,"variable.language":WN},u="[0-9](_?[0-9])*",d=`\\.(${u})`,y="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",m={className:"number",variants:[{begin:`(\\b(${y})((${d})|\\.)?|(${d}))[eE][+-]?(${u})\\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"}},A={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"}},f={className:"string",begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,w]},p={className:"comment",variants:[e.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:a+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]},S=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,C,A,E,f,{match:/\$\d+/},m];w.contains=S.concat({begin:/\{/,end:/\}/,keywords:c,contains:["self"].concat(S)});const k=[].concat(p,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+/,a,/\s+/,/extends/,/\s+/,n.concat(a,"(",n.concat(/\./,a),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,a],scope:{1:"keyword",3:"title.class"}}]},T={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:{_:[...Gx,...qx]}},I={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},K={variants:[{match:[/function/,/\s+/,a,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[R],illegal:/%/},F={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function G(V){return n.concat("(?!",V.join("|"),")")}const B={match:n.concat(/\b/,G([...Kx,"super","import"].map(V=>`${V}\\s*\\(`)),a,n.lookahead(/\s*\(/)),className:"title.function",relevance:0},X={begin:n.concat(/\./,n.lookahead(n.concat(a,/(?![0-9A-Za-z$_(])/))),end:a,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},Y={match:[/get|set/,/\s+/,a,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},R]},z="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",q={match:[/const|var|let/,/\s+/,a,/\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:T},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),I,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,C,A,E,f,p,{match:/\$\d+/},m,T,{scope:"attr",match:a+n.lookahead(":"),relevance:0},q,{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[p,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:g},{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:a,className:"title.function"})]},{match:/\.\.\./,relevance:0},X,{match:"\\$"+a,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[R]},B,F,M,Y,{match:/\$[(.]/}]}}function qN(e){const n={className:"attr",begin:/"(\\.|[^\\"\r\n])*"(?=\s*:)/,relevance:1.01},r={match:/[{}[\],:]/,className:"punctuation",relevance:0},a=["true","false","null"],o={scope:"literal",beginKeywords:a.join(" ")};return{name:"JSON",aliases:["jsonc"],keywords:{literal:a},contains:[n,r,e.QUOTE_STRING_MODE,o,e.C_NUMBER_MODE,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE],illegal:"\\S"}}function py(e){const n=e.regex,r={begin:/<\/?[A-Za-z_]/,end:">",subLanguage:"xml",relevance:0},a={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}]},g={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+.-]*/,u={variants:[{begin:/\[.+?\]\[.*?\]/,relevance:0},{begin:/\[.+?\]\(((data|javascript|mailto):|(?:http|ftp)s?:\/\/).*?\)/,relevance:2},{begin:n.concat(/\[.+?\]\(/,c,/:\/\/.*?\)/),relevance:2},{begin:/\[.+?\]\([./?&#].*?\)/,relevance:1},{begin:/\[.*?\]\(.*?\)/,relevance:0}],returnBegin:!0,contains:[{match:/\[(?=\])/},{className:"string",relevance:0,begin:"\\[",end:"\\]",excludeBegin:!0,returnEnd:!0},{className:"link",relevance:0,begin:"\\]\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0},{className:"symbol",relevance:0,begin:"\\]\\[",end:"\\]",excludeBegin:!0,excludeEnd:!0}]},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}]},m=e.inherit(d,{contains:[]}),w=e.inherit(y,{contains:[]});d.contains.push(w),y.contains.push(m);let C=[r,u];return[d,y,m,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}]}]},r,g,d,y,{className:"quote",begin:"^>\\s+",contains:C,end:"$"},o,a,u,_,{scope:"literal",match:/&([a-zA-Z0-9]+|#[0-9]{1,7}|#[Xx][0-9a-fA-F]{1,6});/}]}}function gy(e){const n=e.regex,r=new RegExp("[\\p{XID_Start}_]\\p{XID_Continue}*","u"),a=["and","as","assert","async","await","break","case","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","in","is","lambda","match","nonlocal|10","not","or","pass","raise","return","try","while","with","yield"],c={$pattern:/[A-Za-z]\w+|__\w+__/,keyword:a,built_in:["__import__","abs","all","any","ascii","bin","bool","breakpoint","bytearray","bytes","callable","chr","classmethod","compile","complex","delattr","dict","dir","divmod","enumerate","eval","exec","filter","float","format","frozenset","getattr","globals","hasattr","hash","help","hex","id","input","int","isinstance","issubclass","iter","len","list","locals","map","max","memoryview","min","next","object","oct","open","ord","pow","print","property","range","repr","reversed","round","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","vars","zip"],literal:["__debug__","Ellipsis","False","None","NotImplemented","True"],type:["Any","Callable","Coroutine","Dict","List","Literal","Generic","Optional","Sequence","Set","Tuple","Type","Union"]},u={className:"meta",begin:/^(>>>|\.\.\.) /},d={className:"subst",begin:/\{/,end:/\}/,keywords:c,illegal:/#/},y={begin:/\{\{/,relevance:0},m={className:"string",contains:[e.BACKSLASH_ESCAPE],variants:[{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,u],relevance:10},{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,u],relevance:10},{begin:/([fF][rR]|[rR][fF]|[fF])'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,u,y,d]},{begin:/([fF][rR]|[rR][fF]|[fF])"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,u,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})\\.`,A=`\\b|${a.join("|")}`,E={className:"number",relevance:0,variants:[{begin:`(\\b(${w})|(${C}))[eE][+-]?(${w})[jJ]?(?=${A})`},{begin:`(${C})[jJ]?`},{begin:`\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${A})`},{begin:`\\b0[bB](_?[01])+[lL]?(?=${A})`},{begin:`\\b0[oO](_?[0-7])+[lL]?(?=${A})`},{begin:`\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${A})`},{begin:`\\b(${w})[jJ](?=${A})`}]},f={className:"comment",begin:n.lookahead(/# type:/),end:/$/,keywords:c,contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},v={className:"params",variants:[{className:"",begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:c,contains:["self",u,E,m,e.HASH_COMMENT_MODE]}]};return d.contains=[m,E,u],{name:"Python",aliases:["py","gyp","ipython"],unicodeRegex:!0,keywords:c,illegal:/(<\/|\?)|=>/,contains:[u,E,{scope:"variable.language",match:/\bself\b/},{beginKeywords:"if",relevance:0},{match:/\bor\b/,scope:"keyword"},m,f,e.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,r],scope:{1:"keyword",3:"title.function"},contains:[v]},{variants:[{match:[/\bclass/,/\s+/,r,/\s*/,/\(\s*/,r,/\s*\)/]},{match:[/\bclass/,/\s+/,r]}],scope:{1:"keyword",3:"title.class",6:"title.class.inherited"}},{className:"meta",begin:/^[\t ]*@/,end:/(?=#)|$/,contains:[E,v,m]}]}}const ih="[A-Za-z$_][0-9A-Za-z$_]*",Vx=["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"],Yx=["true","false","null","undefined","NaN","Infinity"],Xx=["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"],Zx=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],Jx=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],Qx=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],eC=[].concat(Jx,Xx,Zx);function KN(e){const n=e.regex,r=(V,{after:D})=>{const H="</"+V[0].slice(1);return V.input.indexOf(H,D)!==-1},a=ih,o={begin:"<>",end:"</>"},g=/<[A-Za-z0-9\\._:-]+\s*\/>/,_={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(V,D)=>{const H=V[0].length+V.index,O=V.input[H];if(O==="<"||O===","){D.ignoreMatch();return}O===">"&&(r(V,{after:H})||D.ignoreMatch());let P;const W=V.input.substring(H);if(P=W.match(/^\s*=/)){D.ignoreMatch();return}if((P=W.match(/^\s+extends\s+/))&&P.index===0){D.ignoreMatch();return}}},c={$pattern:ih,keyword:Vx,literal:Yx,built_in:eC,"variable.language":Qx},u="[0-9](_?[0-9])*",d=`\\.(${u})`,y="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",m={className:"number",variants:[{begin:`(\\b(${y})((${d})|\\.)?|(${d}))[eE][+-]?(${u})\\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"}},A={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"}},f={className:"string",begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,w]},p={className:"comment",variants:[e.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:a+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]},S=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,C,A,E,f,{match:/\$\d+/},m];w.contains=S.concat({begin:/\{/,end:/\}/,keywords:c,contains:["self"].concat(S)});const k=[].concat(p,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+/,a,/\s+/,/extends/,/\s+/,n.concat(a,"(",n.concat(/\./,a),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,a],scope:{1:"keyword",3:"title.class"}}]},T={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:{_:[...Xx,...Zx]}},I={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},K={variants:[{match:[/function/,/\s+/,a,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[R],illegal:/%/},F={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function G(V){return n.concat("(?!",V.join("|"),")")}const B={match:n.concat(/\b/,G([...Jx,"super","import"].map(V=>`${V}\\s*\\(`)),a,n.lookahead(/\s*\(/)),className:"title.function",relevance:0},X={begin:n.concat(/\./,n.lookahead(n.concat(a,/(?![0-9A-Za-z$_(])/))),end:a,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},Y={match:[/get|set/,/\s+/,a,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},R]},z="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",q={match:[/const|var|let/,/\s+/,a,/\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:T},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),I,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,C,A,E,f,p,{match:/\$\d+/},m,T,{scope:"attr",match:a+n.lookahead(":"),relevance:0},q,{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[p,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:g},{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:a,className:"title.function"})]},{match:/\.\.\./,relevance:0},X,{match:"\\$"+a,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[R]},B,F,M,Y,{match:/\$[(.]/}]}}function my(e){const n=e.regex,r=KN(e),a=ih,o=["any","void","number","boolean","string","object","never","symbol","bigint","unknown"],g={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:[r.exports.CLASS_REFERENCE]},c={className:"meta",relevance:10,begin:/^\s*['"]use strict['"]/},u=["type","interface","public","private","protected","implements","declare","abstract","readonly","enum","override","satisfies"],d={$pattern:ih,keyword:Vx.concat(u),literal:Yx,built_in:eC.concat(o),"variable.language":Qx},y={className:"meta",begin:"@"+a},m=(E,f,v)=>{const p=E.contains.findIndex(S=>S.label===f);if(p===-1)throw new Error("can not find mode to replace");E.contains.splice(p,1,v)};Object.assign(r.keywords,d),r.exports.PARAMS_CONTAINS.push(y);const w=r.contains.find(E=>E.scope==="attr"),C=Object.assign({},w,{match:n.concat(a,n.lookahead(/\s*\?:/))});r.exports.PARAMS_CONTAINS.push([r.exports.CLASS_REFERENCE,w,C]),r.contains=r.contains.concat([y,g,_,C]),m(r,"shebang",e.SHEBANG()),m(r,"use_strict",c);const A=r.contains.find(E=>E.label==="func.def");return A.relevance=0,Object.assign(r,{name:"TypeScript",aliases:["ts","tsx","mts","cts"]}),r}const VN=/\[\[wiki:([^\]]+)\]\]/g,YN=new Hx({gfm:!0,breaks:!1}),_y={ALLOWED_URI_REGEXP:/^(?:(?:https?|mailto):|[#/]|\.{0,2}\/|[^:]+$)/i,ADD_ATTR:["target","rel","data-entry-id"]},ap=aO();function gg(e,n={}){const r=JN(e,n.resolveWikiLink),a=YN.parse(r,{async:!1}),o=jl.sanitize(a,_y),g=new DOMParser().parseFromString(o,"text/html");return eO(g,n.omitDuplicateTitle),QN(g),tO(g),iO(g),{html:jl.sanitize(g.body.innerHTML,_y),toc:rO(g)}}function XN(e){const n=new TextEncoder().encode(e);let r="";for(const a of n)r+=String.fromCharCode(a);return btoa(r)}function ZN(e){const n=atob(e),r=new Uint8Array(n.length);for(let a=0;a<n.length;a++)r[a]=n.charCodeAt(a);return new TextDecoder().decode(r)}function JN(e,n){return e.replace(VN,(r,a)=>{const o=a.trim();if(!o)return"";if(!n)return op(`[[wiki:${o}]]`);const g=n(o);if(g===null)return op(`[[wiki:${o}]]`);const _=op(o),c=encodeURIComponent(o);return`<a href="${g}" data-entry-id="${c}">${_}</a>`})}function QN(e){const n=new Map;for(const r of e.querySelectorAll("h2, h3")){const a=r.textContent?.trim()??"",o=cO(a||"section"),g=n.get(o)??0;n.set(o,g+1),r.id=g===0?o:`${o}-${g+1}`}}function eO(e,n){if(!n)return;const r=e.body.querySelector("h1, h2, h3, h4, h5, h6");!r||r.tagName.toLowerCase()!=="h1"||vy(r.textContent??"")===vy(n)&&r.remove()}function tO(e){for(const n of e.querySelectorAll("pre > code")){const r=oO(n.className),a=n.textContent??"",o=n.parentElement;if(!o)continue;if(r==="mermaid"){const _=e.createElement("div");_.className="diagram-block",_.setAttribute("data-mermaid-source",XN(a)),_.setAttribute("data-diagram-state","pending"),o.replaceWith(_);continue}const g=sO(a,r);n.innerHTML=g,n.classList.add("hljs"),o.classList.add("code-block"),o.dataset.code=a,o.insertBefore(nO(e,r||"text"),o.firstChild)}}function nO(e,n){const r=e.createElement("div");r.className="code-block-toolbar";const a=e.createElement("span");a.className="code-block-dots",a.setAttribute("aria-hidden","true");for(let _=0;_<3;_++)a.append(e.createElement("span"));const o=e.createElement("span");o.className="code-block-language",o.textContent=n;const g=e.createElement("button");return g.className="copy-code",g.type="button",g.dataset.action="copy-code",g.setAttribute("aria-label",`Copy ${n} code`),g.textContent="Copy",r.append(a,o,g),r}function iO(e){for(const n of e.querySelectorAll("a")){const r=n.getAttribute("href")??"";lO(r)&&(n.setAttribute("target","_blank"),n.setAttribute("rel","noopener noreferrer"))}}function rO(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 sO(e,n){return n&&ap.getLanguage(n)?ap.highlight(e,{language:n}).value:ap.highlightAuto(e).value}function aO(){return Ni.registerLanguage("bash",hy),Ni.registerLanguage("sh",hy),Ni.registerLanguage("javascript",fy),Ni.registerLanguage("js",fy),Ni.registerLanguage("json",qN),Ni.registerLanguage("markdown",py),Ni.registerLanguage("md",py),Ni.registerLanguage("python",gy),Ni.registerLanguage("py",gy),Ni.registerLanguage("typescript",my),Ni.registerLanguage("ts",my),Ni}function oO(e){return e.match(/language-([a-z0-9_-]+)/i)?.[1]?.toLowerCase()??null}function lO(e){return/^[a-z][a-z0-9+.-]*:/i.test(e)&&!e.startsWith(window.location.origin)}function cO(e){return e.trim().toLowerCase().replace(/[^\p{Letter}\p{Number}]+/gu,"-").replace(/^-+|-+$/g,"")||"section"}function vy(e){return e.trim().replace(/\s+/g," ").toLocaleLowerCase("en-US")}function op(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">")}const uO="modulepreload",hO=function(e){return"/console/"+e},by={},dO=function(n,r,a){let o=Promise.resolve();if(r&&r.length>0){let u=function(d){return Promise.all(d.map(y=>Promise.resolve(y).then(m=>({status:"fulfilled",value:m}),m=>({status:"rejected",reason:m}))))};document.getElementsByTagName("link");const _=document.querySelector("meta[property=csp-nonce]"),c=_?.nonce||_?.getAttribute("nonce");o=u(r.map(d=>{if(d=hO(d),d in by)return;by[d]=!0;const y=d.endsWith(".css"),m=y?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${d}"]${m}`))return;const w=document.createElement("link");if(w.rel=y?"stylesheet":uO,y||(w.as="script"),w.crossOrigin="",w.href=d,c&&w.setAttribute("nonce",c),document.head.appendChild(w),y)return new Promise((C,A)=>{w.addEventListener("load",C),w.addEventListener("error",()=>A(new Error(`Unable to preload CSS for ${d}`)))})}))}function g(_){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"&&g(c.reason);return n().catch(g)})},fO=".diagram-block[data-mermaid-source]:not([data-diagram-state='rendered']):not([data-diagram-state='error'])",pO=["a[href]","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])","[tabindex]:not([tabindex='-1'])"].join(","),gO=/^on/i,mO={USE_PROFILES:{svg:!0,svgFilters:!1},FORBID_TAGS:["foreignObject","script"],FORBID_ATTR:["href","xlink:href"]},yy="diagramInteractionBound",_O=/^oklch\s*\(\s*([^)]+)\s*\)$/i,vO=/^(-?\d+(?:\.\d+)?)(deg)?$/i,Bi=[25,50,75,100,125,150,200],bO=["pie1","pie2","pie3","pie4","pie5","pie6","pie7","pie8","pie9","pie10","pie11","pie12"];let lp=null;const Sy=new WeakSet;let yO=0,SO=0,Fl=null;function ys(e){const n=e.trim();if(!n)return n;const r=FO(n);return r?WO(r):n}function tC(e){if(Sy.has(e))return;Sy.add(e),wy(e);const n=e instanceof Node?e:document.body;new MutationObserver(a=>{let o=!1;for(const g of a)if(g.type==="childList"){Fl&&!Fl.trigger.isConnected&&Ml(!1);for(const _ of g.addedNodes)if(_ instanceof Element&&(_.matches?.(".diagram-block[data-mermaid-source]")||_.querySelector?.(".diagram-block[data-mermaid-source]"))){o=!0;break}if(o)break}o&&wy(e)}).observe(n,{childList:!0,subtree:!0})}function wy(e){const n=e.querySelectorAll(fO);for(const r of n)r.dataset.diagramHydrating!=="true"&&(r.dataset.diagramHydrating="true",r.dataset.diagramState="pending",wO(r))}async function wO(e){const n=e.getAttribute("data-mermaid-source")??"";let r="";try{r=ZN(n)}catch{cp(e,"Invalid diagram source");return}if(!r.trim()){cp(e,"Empty diagram source");return}try{const a=await CO(),o=`mermaid-diagram-${++yO}`,{svg:g}=await a.render(o,r);e.innerHTML=xO(g),AO(e,g),TO(e),RO(e),e.dataset.diagramState="rendered"}catch(a){const o=a instanceof Error?a.message:String(a);cp(e,o)}}function cp(e,n){e.dataset.diagramState="error",e.textContent=`Diagram render failed: ${n}`}function xO(e){const n=(r,a)=>{gO.test(a.attrName)&&(a.keepAttr=!1)};jl.addHook("uponSanitizeAttribute",n);try{return jl.sanitize(e,mO)}finally{jl.removeHook("uponSanitizeAttribute",n)}}async function CO(){return lp||(lp=(async()=>{const e=await dO(()=>import("./mermaid.core-mTVIRAe-.js").then(r=>r.bC),[]),n=e.default??e;return n.initialize({securityLevel:"strict",htmlLabels:!1,suppressErrorRendering:!0,startOnLoad:!1,theme:"base",look:"handDrawn",themeVariables:EO(),themeCSS:kO(),flowchart:{htmlLabels:!1,useMaxWidth:!1}}),n})()),lp}function EO(){const e=getComputedStyle(document.documentElement),n=(E,f)=>{const v=e.getPropertyValue(E).trim();return ys(v||f)},r=(E,f)=>e.getPropertyValue(E).trim()||f,a=n("--brass","#c69a4a"),o=n("--brass-bright","#e6b86a"),g=n("--brass-deep","#a0782a"),_=n("--aurora","#8bd7e6"),c=n("--aurora-deep","#1f8aa8"),u=n("--coral","#ef7c63"),d=n("--ink-deep","#1d2734"),y=n("--ink-fog","#a6afbb"),m=n("--ink-pearl","#e6e9ef"),w=n("--ink-spectral","#bcc4d0"),C=[o,a,_,u,ys("oklch(70% 0.11 68)"),c,ys("oklch(76% 0.09 205)"),g,ys("oklch(68% 0.14 30)"),y,ys("oklch(62% 0.08 228)"),ys("oklch(52% 0.05 248)")],A=Object.fromEntries(bO.map((E,f)=>[E,C[f]??d]));return{background:"transparent",primaryColor:"transparent",primaryTextColor:m,primaryBorderColor:a,secondaryColor:"transparent",secondaryTextColor:m,secondaryBorderColor:o,tertiaryColor:"transparent",tertiaryTextColor:w,tertiaryBorderColor:a,lineColor:c,edgeLabelBackground:"transparent",titleColor:o,fontFamily:"JetBrains Mono Variable, ui-monospace, monospace",mainBkg:"transparent",nodeBorder:a,clusterBkg:"transparent",clusterBorder:a,pieTitleTextColor:o,pieTitleTextSize:r("--font-size-title-lg","19px"),pieSectionTextColor:m,pieSectionTextSize:r("--font-size-md","13px"),pieLegendTextColor:m,pieLegendTextSize:r("--font-size-lg","14px"),pieStrokeColor:g,pieStrokeWidth:"1.35px",pieOuterStrokeColor:o,pieOuterStrokeWidth:"2.5px",pieOpacity:"0.96",...A}}function kO(){const e=getComputedStyle(document.documentElement),n=(d,y)=>{const m=e.getPropertyValue(d).trim();return ys(m||y)},r=n("--brass-deep","#a0782a"),a=n("--brass-bright","#e6b86a"),o=n("--aurora-deep","#1f8aa8"),g=n("--ink-abyss","#131920"),_=ys("oklch(15% 0.04 250 / 34%)"),c=n("--surface-glass","#1d2734"),u=n("--ink-pearl","#e6e9ef");return`
|
|
159
|
-
.node rect, .node polygon, .node circle, .node ellipse, .actor, .classGroup rect {
|
|
160
|
-
stroke: ${r};
|
|
161
|
-
fill: ${c};
|
|
162
|
-
}
|
|
163
|
-
.edgePath path, .messageLine0, .messageLine1, .relation {
|
|
164
|
-
stroke: ${o};
|
|
165
|
-
}
|
|
166
|
-
.nodeLabel, .edgeLabel, .actor text, .messageText {
|
|
167
|
-
fill: ${u};
|
|
168
|
-
font-family: "Manrope Variable", "Manrope", ui-sans-serif, sans-serif;
|
|
169
|
-
}
|
|
170
|
-
.pieCircle {
|
|
171
|
-
stroke: ${r};
|
|
172
|
-
stroke-width: 1.35px;
|
|
173
|
-
opacity: 0.96;
|
|
174
|
-
filter: drop-shadow(0 0 1.5px ${_});
|
|
175
|
-
}
|
|
176
|
-
.pieOuterCircle {
|
|
177
|
-
stroke: ${a};
|
|
178
|
-
opacity: 0.7;
|
|
179
|
-
}
|
|
180
|
-
.slice, .legend text, .pieTitleText {
|
|
181
|
-
fill: ${u};
|
|
182
|
-
paint-order: stroke;
|
|
183
|
-
stroke: ${g};
|
|
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: ${g};
|
|
207
|
-
stroke-width: 1.5px;
|
|
208
|
-
paint-order: stroke;
|
|
209
|
-
filter: saturate(0.78) brightness(0.92) drop-shadow(0 0 0.55px ${a});
|
|
210
|
-
}
|
|
211
|
-
`}function AO(e,n){const r=new DOMParser().parseFromString(n,"image/svg+xml"),a=Array.from(r.querySelectorAll("a")),o=Array.from(e.querySelectorAll("a")),g=Math.min(a.length,o.length);for(let _=0;_<g;_++){const c=a[_],u=o[_];if(!c||!u)continue;const d=c.getAttribute("href")??c.getAttribute("xlink:href")??"",y=iC(d);y&&u.setAttribute("href",y)}}function TO(e){const n=e.querySelector("svg");if(!n)return;let r;try{r=n.getBBox()}catch{return}const{x:a,y:o,width:g,height:_}=r;!Number.isFinite(a)||!Number.isFinite(o)||!Number.isFinite(g)||!Number.isFinite(_)||a<0||o<0||g<=0||_<=0||n.setAttribute("viewBox",`${Qa(a)} ${Qa(o)} ${Qa(g)} ${Qa(_)}`)}function RO(e){e.tabIndex=0,e.setAttribute("aria-label","Open diagram in expanded view"),HO(e),e.dataset[yy]!=="true"&&(e.dataset[yy]="true",e.addEventListener("click",LO),e.addEventListener("keydown",MO))}function LO(e){if(e.metaKey||e.ctrlKey||e.shiftKey||e.altKey||e.button!==0||rh(e.target))return;const n=e.currentTarget;n instanceof HTMLElement&&(e.preventDefault(),nC(n))}function MO(e){if(e.key!=="Enter"&&e.key!==" "||rh(e.target))return;const n=e.currentTarget;n instanceof HTMLElement&&(e.preventDefault(),nC(n))}function nC(e){const n=e.querySelector("svg");if(!n)return;Ml(!1);const r=typeof HTMLDialogElement<"u"&&typeof HTMLDialogElement.prototype.showModal=="function",a=document.createElement(r?"dialog":"div"),o=++SO,g=`diagram-lightbox-title-${o}`;a.className="diagram-lightbox",a.setAttribute("aria-labelledby",g),r||(a.setAttribute("role","dialog"),a.setAttribute("aria-modal","true"),a.tabIndex=-1);const _=document.createElement("div");_.className="diagram-lightbox__frame";const c=document.createElement("div");c.className="diagram-lightbox__header";const u=document.createElement("h2");u.id=g,u.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 m=Cu("−","Zoom out","out"),w=document.createElement("span");w.className="diagram-lightbox__zoom-readout",w.setAttribute("aria-live","polite");const C=Cu("+","Zoom in","in"),A=Cu("Fit","Fit diagram to viewport","fit"),E=Cu("Reset","Reset diagram zoom","reset");y.append(m,w,C,A,E);const f=document.createElement("div");f.className="diagram-lightbox__viewport";const v=DO(n),p=n.cloneNode(!0);p.removeAttribute("style"),jO(p,`diagram-lightbox-svg-${o}`),f.append(p),c.append(u,y,d),_.append(c,f),a.append(_),document.body.append(a);const S=new NO(f,p,w,v);m.addEventListener("click",()=>S.zoomOut()),C.addEventListener("click",()=>S.zoomIn()),A.addEventListener("click",()=>S.fit()),E.addEventListener("click",()=>S.reset());const k=IO(a),L=T=>{(T.target===a||T.target===d)&&Ml(!0)},R=T=>{if(T.key==="Escape"){T.preventDefault(),Ml(!0);return}S.handleKeyboard(T)||T.key==="Tab"&&zO(T,a)},M={dialog:a,trigger:e,inertStates:k,onClick:L,onKeyDown:R,cleanupPanZoom:()=>S.destroy()};r&&(M.onCancel=T=>{T.preventDefault(),Ml(!0)},a.addEventListener("cancel",M.onCancel),a.showModal()),a.addEventListener("click",L),document.addEventListener("keydown",R,!0),Fl=M,S.fit(),d.focus()}function Cu(e,n,r){const a=document.createElement("button");return a.className="diagram-lightbox__zoom-button",a.type="button",a.dataset.zoomAction=r,a.setAttribute("aria-label",n),a.textContent=e,a}class NO{constructor(n,r,a,o){this.viewport=n,this.svg=r,this.readout=a,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,r=this.viewport.clientHeight||this.viewport.getBoundingClientRect().height||this.baseSize.height,a=Math.min(n/this.baseSize.width,r/this.baseSize.height),o=Math.floor(a*100),g=Bi.findIndex(c=>c>o),_=g===-1?Bi.length-1:Math.max(0,g-1);this.applyZoom(_),this.viewport.scrollLeft=Math.max(0,(this.svgWidth-n)/2),this.viewport.scrollTop=Math.max(0,(this.svgHeight-r)/2)}handleKeyboard(n){return n.key==="+"||n.key==="="?(n.preventDefault(),this.zoomIn(),!0):n.key==="-"||n.key==="_"?(n.preventDefault(),this.zoomOut(),!0):n.key==="0"?(n.preventDefault(),this.reset(),!0):n.key.toLowerCase()==="f"?(n.preventDefault(),this.fit(),!0):!1}get svgWidth(){return this.baseSize.width*(Eu(this.zoomIndex)/100)}get svgHeight(){return this.baseSize.height*(Eu(this.zoomIndex)/100)}applyZoom(n){this.zoomIndex=n;const r=Eu(this.zoomIndex),a=r/100;this.svg.setAttribute("width",Qa(this.baseSize.width*a)),this.svg.setAttribute("height",Qa(this.baseSize.height*a)),this.readout.textContent=`${r}%`}zoomAroundViewportCenter(n){const r=this.viewport.getBoundingClientRect();this.zoomAroundPoint(n,r.left+r.width/2,r.top+r.height/2)}zoomAroundPoint(n,r,a){if(n===this.zoomIndex)return;const o=this.svgWidth,g=this.svgHeight,_=this.viewport.getBoundingClientRect(),c=this.viewport.scrollLeft+r-_.left,u=this.viewport.scrollTop+a-_.top;this.applyZoom(n),this.viewport.scrollLeft=c/o*this.svgWidth-(r-_.left),this.viewport.scrollTop=u/g*this.svgHeight-(a-_.top)}onPointerDown=n=>{if(n.button!==0||rh(n.target))return;const r=n.pointerId??1;if(this.pointers.set(r,n),this.pointers.size===2){this.pinchStart={distance:this.pointerDistance(),zoomIndex:this.zoomIndex};return}this.dragStart={x:n.clientX,y:n.clientY,scrollLeft:this.viewport.scrollLeft,scrollTop:this.viewport.scrollTop,pointerId:r},this.viewport.setPointerCapture?.(r)};onPointerMove=n=>{const r=n.pointerId??1;if(this.pointers.has(r)&&this.pointers.set(r,n),this.pinchStart&&this.pointers.size>=2){const a=this.pointerDistance()/this.pinchStart.distance,o=Eu(this.pinchStart.zoomIndex)*a;this.applyZoom(BO(o));return}!this.dragStart||this.dragStart.pointerId!==r||(n.preventDefault(),this.viewport.scrollLeft=this.dragStart.scrollLeft-(n.clientX-this.dragStart.x),this.viewport.scrollTop=this.dragStart.scrollTop-(n.clientY-this.dragStart.y))};onPointerEnd=n=>{const r=n.pointerId??1;this.pointers.delete(r),this.viewport.releasePointerCapture?.(r),this.dragStart?.pointerId===r&&(this.dragStart=null),this.pointers.size<2&&(this.pinchStart=null)};onWheel=n=>{if(!n.ctrlKey&&!n.metaKey)return;n.preventDefault();const r=n.deltaY<0?Math.min(this.zoomIndex+1,Bi.length-1):Math.max(this.zoomIndex-1,0);this.zoomAroundPoint(r,n.clientX,n.clientY)};onDoubleClick=n=>{rh(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,r]=Array.from(this.pointers.values());return!n||!r?1:Math.hypot(r.clientX-n.clientX,r.clientY-n.clientY)}}function OO(e){const n=xy(e.getAttribute("width")),r=xy(e.getAttribute("height"));if(n&&r)return{width:n,height:r};const a=e.getAttribute("viewBox")?.trim().split(/[\s,]+/).map(Number)??[],o=a[2],g=a[3],_=o!==void 0&&Number.isFinite(o)&&o>0?o:null,c=g!==void 0&&Number.isFinite(g)&&g>0?g:null;return{width:n??_??800,height:r??c??600}}function DO(e){const n=e.getBoundingClientRect();return n.width>0&&n.height>0?{width:n.width,height:n.height}:OO(e)}function xy(e){if(!e)return null;const n=/^(\d+(?:\.\d+)?)/.exec(e.trim());if(!n)return null;const r=Number(n[1]);return Number.isFinite(r)&&r>0?r:null}function Qa(e){return Number.isInteger(e)?String(e):e.toFixed(2).replace(/\.?0+$/,"")}function BO(e){let n=0,r=Number.POSITIVE_INFINITY;return Bi.forEach((a,o)=>{const g=Math.abs(a-e);g<r&&(r=g,n=o)}),n}function Eu(e){return Bi[e]??Bi[0]}function jO(e,n){const r=e.getAttribute("id")??"";e.setAttribute("id",n);const a=e.querySelector("style");!r||!a?.textContent||(a.textContent=a.textContent.split(`#${r}`).join(`#${n}`))}function Ml(e){const n=Fl;n&&(n.dialog.removeEventListener("click",n.onClick),document.removeEventListener("keydown",n.onKeyDown,!0),n.onCancel&&n.dialog.removeEventListener("cancel",n.onCancel),n.cleanupPanZoom(),PO(n.inertStates),n.dialog instanceof HTMLDialogElement&&n.dialog.open&&typeof n.dialog.close=="function"&&n.dialog.close(),n.dialog.remove(),Fl=null,e&&n.trigger.isConnected&&n.trigger.focus())}function IO(e){const n=[];for(const r of Array.from(document.body.children))!(r instanceof HTMLElement)||r===e||(n.push({element:r,ariaHidden:r.getAttribute("aria-hidden"),inert:r.inert}),r.inert=!0,r.setAttribute("aria-hidden","true"));return n}function PO(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 zO(e,n){const r=Array.from(n.querySelectorAll(pO)).filter(UO);if(r.length===0){e.preventDefault(),n.focus();return}const a=r[0],o=r[r.length-1];!a||!o||(e.shiftKey&&document.activeElement===a?(e.preventDefault(),o.focus()):!e.shiftKey&&document.activeElement===o&&(e.preventDefault(),a.focus()))}function HO(e){e.querySelector("a[href]")?e.removeAttribute("role"):e.setAttribute("role","button")}function rh(e){if(!(e instanceof Element))return!1;const n=e.closest("a[href]");return!n||!(n.getAttribute("href")?.trim()??"")?!1:!$O(n)}function $O(e){return Array.from(e.children).some(n=>n.tagName.toLowerCase()==="svg")}function UO(e){return!(e.inert||e.hidden||e.getAttribute("aria-hidden")==="true"||"disabled"in e&&e.disabled)}function iC(e){const n=e.trim();if(!n||n.includes(".."))return null;if(/^[a-z][a-z0-9+.-]*:/i.test(n)){if(/^javascript:/i.test(n)||/^data:/i.test(n))return null;let a;try{a=new URL(n)}catch{return null}return a.origin!==window.location.origin?null:iC(a.pathname)}if(/^\/entry\/[^/?#]+$/.exec(n)){const a=n.slice(7);let o;try{o=decodeURIComponent(a)}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 FO(e){const n=_O.exec(e);if(!n)return null;const r=n[1]?.trim();if(!r)return null;const a=r.indexOf("/"),o=a>=0?r.slice(0,a):r,g=a>=0?r.slice(a+1).trim():"",_=o.trim().split(/[\s,]+/).filter(Boolean);if(_.length!==3)return null;const[c,u,d]=_;if(!c||!u||!d)return null;const y=up(c,1),m=up(u,.4),w=GO(d);if(y===null||m===null||w===null)return null;let C=1;if(a>=0){const A=up(g,1);if(A===null)return null;C=A}return{L:y,C:m,h:w,alpha:C}}function WO(e){const n=e.h*Math.PI/180,r=e.C*Math.cos(n),a=e.C*Math.sin(n),o=e.L,g=o+.3963377774*r+.2158037573*a,_=o-.1055613458*r-.0638541728*a,c=o-.0894841775*r-1.291485548*a,u=g**3,d=_**3,y=c**3,m=4.0767416621*u-3.3077115913*d+.2309699292*y,w=-1.2684380046*u+2.6097574011*d-.3413193965*y,C=-.0041960863*u-.7034186147*d+1.707614701*y,A=ku(hp(m)),E=ku(hp(w)),f=ku(hp(C));if(e.alpha<1){const v=ku(e.alpha);return`#${qs(A)}${qs(E)}${qs(f)}${qs(v)}`}return`#${qs(A)}${qs(E)}${qs(f)}`}function up(e,n){if(!e)return null;if(e.endsWith("%")){const a=Number(e.slice(0,-1));return Number.isFinite(a)?a/100*n:null}const r=Number(e);return Number.isFinite(r)?r:null}function GO(e){const n=vO.exec(e);if(!n)return null;const r=Number(n[1]);return Number.isFinite(r)?r:null}function hp(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 ku(e){return Math.round(Math.max(0,Math.min(1,e))*255)}function qs(e){return e.toString(16).padStart(2,"0")}function qO({content:e,truncated:n}){const r=j.useMemo(()=>{const g=gg(e).html,_=new DOMParser().parseFromString(g,"text/html");return dp(_.body),_.body.innerHTML},[e]),a=j.useRef(null);j.useEffect(()=>{const g=a.current;if(!g)return;tC(g),dp(g);const _=new MutationObserver(()=>dp(g));return _.observe(g,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["href","src","srcset"]}),()=>_.disconnect()},[r]);const o=j.useCallback(g=>{const _=g.target.closest('[data-action="copy-code"]');if(!_)return;const c=_.closest("pre")?.getAttribute("data-code");if(!c)return;navigator.clipboard?.writeText(c);const u=_.textContent;_.textContent="Copied",window.setTimeout(()=>{_.textContent=u},1200)},[]);return h.jsxs("div",{className:"fexp-md-wrap",children:[n&&h.jsx("div",{className:"fexp-truncated-badge",children:"File is too large — showing a partial preview"}),h.jsx("div",{ref:a,className:"markdown-body",onClick:o,dangerouslySetInnerHTML:{__html:r}})]})}function dp(e){for(const n of e.querySelectorAll("a[href]")){const r=n.getAttribute("href")??"";r&&!/^(https?:|mailto:|#)/i.test(r)&&(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 KO=.55,mg={selectedPath:null,viewState:{kind:"none"},splitRatio:KO},rC=new Map,_g=new Set;function VO(){for(const e of _g)e()}function sC(e){return rC.get(e)??mg}function Cm(e,n){rC.set(e,{...sC(e),...n}),VO()}function YO(e){return _g.add(e),()=>{_g.delete(e)}}function XO(e){return j.useSyncExternalStore(YO,()=>e!=null?sC(e):mg,()=>mg)}function Cy(e,n){e&&Cm(e,{selectedPath:n})}function Ks(e,n){e&&Cm(e,{viewState:n})}function ZO(e,n){e&&Cm(e,{splitRatio:n})}const JO=new Set([".png",".jpg",".jpeg",".webp",".gif"]),Ey=200,ky=160,QO=360;function eD(e){return{listFolder:async n=>{if(!e)throw new Error("no_theater");const r=await fetch("/plugins/file-explorer/files/list",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({theaterId:e,relativePath:n??""})});if(!r.ok){const a=await r.json();throw new Error(a.error??"list_failed")}return r.json()}}}function tD({theaterId:e}){const{selectedPath:n,viewState:r,splitRatio:a}=XO(e),o=j.useRef(a);o.current=a;const g=j.useRef(null),[_,c]=j.useState(!1),u=j.useMemo(()=>eD(e),[e]),d=j.useCallback(async C=>{if(C.kind!=="file")return;Cy(e,C.relativePath);const A=C.name,E=A.slice(A.lastIndexOf(".")).toLowerCase();if(JO.has(E)){const f=e?`/plugins/file-explorer/files/image?theaterId=${encodeURIComponent(e)}&path=${encodeURIComponent(C.relativePath)}`:"";Ks(e,{kind:"image",relativePath:C.relativePath,name:A,src:f});return}Ks(e,{kind:"loading"});try{const f=await fetch("/plugins/file-explorer/files/read",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({theaterId:e,relativePath:C.relativePath})});if(!f.ok){const p=await f.json();throw new Error(p.error??"read_failed")}const v=await f.json();if(v.binary){Ks(e,{kind:"binary",name:A});return}Ks(e,{kind:"code",relativePath:v.relativePath,content:v.content,lang:v.lang,truncated:v.truncated})}catch(f){const v=f instanceof Error?f.message:"Unable to load file";v==="binary_file"?Ks(e,{kind:"binary",name:A}):Ks(e,{kind:"error",message:v})}},[e]),y=j.useCallback(()=>{Ks(e,{kind:"none"}),Cy(e,null)},[e]),m=j.useCallback(C=>{C.preventDefault();const A=g.current;if(!A)return;const E=A.getBoundingClientRect().width,f=C.clientX,v=o.current;c(!0);const p=k=>{const L=k.clientX-f,R=Math.max(Ey/E,Math.min(1-ky/E,v+L/E));o.current=R,ZO(e,R)},S=()=>{document.removeEventListener("pointermove",p),document.removeEventListener("pointerup",S),c(!1)};document.addEventListener("pointermove",p),document.addEventListener("pointerup",S)},[e]),w=r.kind!=="none";return h.jsxs("div",{ref:g,className:`fexp-root${_?" is-dragging":""}`,style:{gridTemplateColumns:`minmax(${Ey}px, ${a}fr) 4px minmax(${ky}px, ${1-a}fr)`},children:[h.jsxs("div",{className:"fexp-viewer-pane",children:[h.jsxs("div",{className:"fexp-viewer-head",children:[h.jsx("span",{className:"fexp-viewer-filename",children:w&&r.kind!=="loading"&&r.kind!=="error"?"relativePath"in r?r.relativePath:r.name:""}),w&&h.jsx("button",{className:"fexp-viewer-close",type:"button",onClick:y,"aria-label":"Close viewer",children:"✕"})]}),h.jsxs("div",{className:"fexp-viewer-body",children:[r.kind==="none"&&h.jsx("div",{className:"fexp-viewer-empty",children:"Select an item in the file tree to preview its contents here."}),r.kind==="loading"&&h.jsx("div",{className:"fexp-viewer-loading",children:"Loading…"}),r.kind==="error"&&h.jsx("div",{className:"fexp-viewer-error",children:r.message}),r.kind==="code"&&r.lang==="markdown"&&h.jsx(qO,{content:r.content,truncated:r.truncated}),r.kind==="code"&&r.lang!=="markdown"&&h.jsx(L4,{content:r.content,lang:r.lang,truncated:r.truncated}),r.kind==="image"&&h.jsx(O4,{src:r.src,name:r.name}),r.kind==="binary"&&h.jsx(b4,{name:r.name})]})]}),h.jsx("div",{className:"fexp-divider",onPointerDown:m,"aria-hidden":"true"}),h.jsx("div",{className:"fexp-tree-pane",children:h.jsx(_4,{files:u,theaterId:e,selectedPath:n,onSelect:d})})]})}function nD(){return h.jsx("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none","aria-hidden":"true",children:h.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 iD={id:"file-explorer",title:"Files",icon:nD,render:e=>h.jsx(tD,{...e}),preferredExtraWidth:QO},rD={id:"file-explorer",railPanels:[iD]},sD=[rD],aD={M:"M",A:"A",D:"D",R:"R",U:"U"};function oD(e){const n={dirs:{},files:[]};for(const r of e){const a=r.path.split("/");a.pop();let o=n;for(const g of a)o.dirs[g]||(o.dirs[g]={dirs:{},files:[]}),o=o.dirs[g];o.files.push(r)}return n}function lD({files:e,section:n,selectedPath:r,selectedSection:a,onSelect:o}){const g=oD(e);return h.jsx(aC,{node:g,depth:0,section:n,selectedPath:r,selectedSection:a,onSelect:o})}function aC({node:e,depth:n,section:r,selectedPath:a,selectedSection:o,onSelect:g}){return h.jsxs(h.Fragment,{children:[Object.entries(e.dirs).map(([_,c])=>h.jsx(cD,{dirKey:_,node:c,depth:n,section:r,selectedPath:a,selectedSection:o,onSelect:g},_)),e.files.map(_=>h.jsx(uD,{entry:_,depth:n,section:r,selectedPath:a,selectedSection:o,onSelect:g},_.path))]})}function cD({dirKey:e,node:n,depth:r,section:a,selectedPath:o,selectedSection:g,onSelect:_}){const[c,u]=j.useState(!1),d=j.useCallback(()=>u(C=>!C),[]);let y=e,m=n;for(;Object.keys(m.dirs).length===1&&m.files.length===0;){const C=Object.keys(m.dirs)[0];y+="/"+C,m=m.dirs[C]}const w=r*16+12;return h.jsxs("div",{className:`diff-folder${c?" is-collapsed":""}`,children:[h.jsxs("button",{type:"button",className:"diff-folder-row",style:{paddingLeft:`${w}px`},onClick:d,"aria-expanded":!c,children:[h.jsx("svg",{className:"diff-folder-chevron",viewBox:"0 0 12 12",fill:"none","aria-hidden":"true",children:h.jsx("path",{d:"M3 4.5L6 7.5L9 4.5",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round"})}),h.jsx("svg",{className:"diff-folder-icon",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:h.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"})}),h.jsx("span",{className:"diff-folder-name",children:y})]}),!c&&h.jsx(aC,{node:m,depth:r+1,section:a,selectedPath:o,selectedSection:g,onSelect:_})]})}function uD({entry:e,depth:n,section:r,selectedPath:a,selectedSection:o,onSelect:g}){const _=e.path===a&&r===o,c=j.useCallback(()=>g(e,r),[e,r,g]),u=n*16+12,d=e.path.split("/").pop()??e.path;return h.jsxs("button",{type:"button",className:`diff-file-row${_?" is-cur":""}`,style:{paddingLeft:`${u}px`},title:e.path,onClick:c,children:[h.jsx("span",{className:`diff-status-glyph diff-status-${e.status.toLowerCase()}`,"aria-label":e.status,children:aD[e.status]??e.status}),h.jsx("span",{className:"diff-file-name",children:d}),h.jsxs("span",{className:"diff-nums",children:[e.additions>0&&h.jsxs("span",{className:"diff-additions",children:["+",e.additions]}),e.deletions>0&&h.jsxs("span",{className:"diff-deletions",children:["−",e.deletions]})]})]})}const Ay="fleet-console.diff.stagedCollapsed",Ty="fleet-console.diff.changesCollapsed",hD={M:"modified",A:"added",D:"deleted",R:"renamed",U:"untracked"};function Ry(e){try{return localStorage.getItem(e)==="1"}catch{return!1}}function dD({ctx:e,viewMode:n,selectedPath:r,selectedSection:a,onSelect:o}){const[g,_]=j.useState({kind:"loading"}),[c,u]=j.useState(0),[d,y]=j.useState(()=>Ry(Ay)),[m,w]=j.useState(()=>Ry(Ty));j.useEffect(()=>{if(!e.theaterId){_({kind:"error",message:"no_theater"});return}let f=!1;_({kind:"loading"});const v=async p=>{const S=await fetch("/plugins/diff/changed",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({theaterId:e.theaterId,mode:p})});if(!S.ok){const k=await S.json();throw new Error(k.error??"git_failed")}return S.json()};return Promise.allSettled([v("workdir"),v("staged")]).then(([p,S])=>{if(f)return;if(p.status==="fulfilled"&&S.status==="fulfilled"){_({kind:"ok",staged:S.value.files,changes:p.value.files});return}const k=[p,S].map(R=>R.status==="rejected"?R.reason instanceof Error?R.reason.message:"unknown":null),L=k.find(R=>R==="no_git_repo"||R==="git_unavailable");if(L==="no_git_repo"||L==="git_unavailable"){_({kind:"notice",reason:L});return}_({kind:"error",message:k.find(R=>R!==null)??"unknown"})}),()=>{f=!0}},[e.theaterId,c]);const C=j.useCallback(()=>u(f=>f+1),[]),A=j.useCallback(()=>{y(f=>{const v=!f;try{localStorage.setItem(Ay,v?"1":"0")}catch{}return v})},[]),E=j.useCallback(()=>{w(f=>{const v=!f;try{localStorage.setItem(Ty,v?"1":"0")}catch{}return v})},[]);if(g.kind==="loading")return h.jsx("div",{className:"diff-sections-loading",children:"Loading…"});if(g.kind==="notice"){const f=g.reason==="no_git_repo"?"Not a Git repository":"Git isn't available",v=g.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 h.jsxs("div",{className:"diff-sections-notice",children:[h.jsx("strong",{className:"diff-notice-title",children:f}),h.jsx("span",{className:"diff-notice-body",children:v}),h.jsx("button",{type:"button",className:"diff-refresh-btn",onClick:C,children:"Retry"})]})}return g.kind==="error"?h.jsxs("div",{className:"diff-sections-error",children:[h.jsx("span",{children:g.message}),h.jsx("button",{type:"button",className:"diff-refresh-btn",onClick:C,children:"Retry"})]}):h.jsxs("div",{className:"diff-sections",children:[h.jsx(Ly,{name:"Staged Changes",files:g.staged,isCollapsed:d,onToggle:A,viewMode:n,section:"staged",selectedPath:r,selectedSection:a,onSelect:o}),h.jsx(Ly,{name:"Changes",files:g.changes,isCollapsed:m,onToggle:E,viewMode:n,section:"workdir",selectedPath:r,selectedSection:a,onSelect:o})]})}function Ly({name:e,files:n,isCollapsed:r,onToggle:a,viewMode:o,section:g,selectedPath:_,selectedSection:c,onSelect:u}){return h.jsxs("div",{className:`diff-section${r?" is-collapsed":""}`,children:[h.jsxs("button",{type:"button",className:"diff-section-head",onClick:a,children:[h.jsx("svg",{className:"diff-section-chevron",viewBox:"0 0 12 12",fill:"none","aria-hidden":"true",children:h.jsx("path",{d:"M3 4.5L6 7.5L9 4.5",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round"})}),h.jsx("span",{className:"diff-section-name",children:e}),h.jsx("span",{className:"diff-count-badge",children:n.length})]}),!r&&h.jsx("div",{className:"diff-section-rows",children:n.length===0?h.jsx("div",{className:"diff-empty-row",children:"No changes"}):o==="tree"?h.jsx(lD,{files:n,section:g,selectedPath:_,selectedSection:c,onSelect:u}):n.map(d=>h.jsx(fD,{entry:d,section:g,isSelected:d.path===_&&g===c,onSelect:u},d.path))})]})}function fD({entry:e,section:n,isSelected:r,onSelect:a}){const o=j.useCallback(()=>a(e,n),[e,n,a]),g=e.path.lastIndexOf("/"),_=g>=0?e.path.slice(0,g+1):"",c=g>=0?e.path.slice(g+1):e.path;return h.jsxs("button",{type:"button",className:`diff-file-row${r?" is-cur":""}`,title:e.path,onClick:o,children:[h.jsx("span",{className:`diff-status-glyph diff-status-${e.status.toLowerCase()}`,"aria-label":hD[e.status]??e.status,children:e.status}),h.jsxs("span",{className:"diff-file-name",children:[_&&h.jsx("span",{className:"diff-file-dir",children:_}),c]}),h.jsxs("span",{className:"diff-nums",children:[e.additions>0&&h.jsxs("span",{className:"diff-additions",children:["+",e.additions]}),e.deletions>0&&h.jsxs("span",{className:"diff-deletions",children:["−",e.deletions]})]})]})}const vg=new Set;let Em={file:null};function oC(){for(const e of vg)e()}function pD(e){return vg.add(e),()=>{vg.delete(e)}}function My(){return Em}function gD(e){const n=j.useSyncExternalStore(pD,My,My);return!n.file||n.file.theaterId!==e?null:n.file}function mD(e,n,r){Em={file:{entry:e,section:n,theaterId:r}},oC()}function _D(){Em={file:null},oC()}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 bD(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">")}function yD({ctx:e,file:n,mode:r,ref:a}){const[o,g]=j.useState({kind:"loading"});if(j.useEffect(()=>{if(!e.theaterId){g({kind:"error",message:"no_theater"});return}let u=!1;return g({kind:"loading"}),e.api.fetch("diff","file",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({theaterId:e.theaterId,filePath:n.path,mode:r,ref:a})}).then(async d=>{const y=await d.json();u||g({kind:"ok",result:y})}).catch(d=>{u||g({kind:"error",message:d instanceof Error?d.message:"unknown"})}),()=>{u=!0}},[e.api,n.path,r,a,e.theaterId]),o.kind==="loading")return h.jsx("div",{className:"diff-hunk-loading",children:"Loading…"});if(o.kind==="error")return h.jsx("div",{className:"diff-hunk-error",children:o.message});const{result:_}=o,c=vD(_.content);return h.jsxs("div",{className:"diff-hunk-wrap",children:[_.truncated&&h.jsx("div",{className:"diff-truncated-badge",children:"Diff truncated"}),h.jsx("div",{className:"diff-hunk-scroll",children:h.jsx("table",{className:"diff-hunk-table",cellSpacing:0,cellPadding:0,children:h.jsx("tbody",{children:c.map((u,d)=>h.jsx("tr",{className:`diff-line diff-line-${u.kind}`,children:h.jsx("td",{className:"diff-line-code",dangerouslySetInnerHTML:{__html:bD(u.text)}})},d))})})})]})}const lC="fleet-console.diff.viewMode",cC="fleet-console.diff.splitRatio",Ny=130,Oy=100,SD=.55;function wD(){try{const e=localStorage.getItem(lC);if(e==="list"||e==="tree")return e}catch{}return"list"}function xD(){try{const e=localStorage.getItem(cC);if(e!==null){const n=parseFloat(e);if(!isNaN(n)&&n>0&&n<1)return n}}catch{}return SD}function CD(e){return e.section==="staged"?"staged":e.entry.status==="U"?"untracked":"workdir"}function ED({ctx:e}){const[n,r]=j.useState(wD),a=gD(e.theaterId??null),[o,g]=j.useState(xD),_=j.useRef(o),c=j.useRef(null),[u,d]=j.useState(!1),y=j.useCallback((E,f)=>{e.theaterId&&mD(E,f,e.theaterId)},[e.theaterId]),m=j.useCallback(()=>{_D()},[]),w=j.useCallback(E=>{r(E);try{localStorage.setItem(lC,E)}catch{}},[]),C=j.useCallback(E=>{E.preventDefault();const f=c.current;if(!f)return;const v=f.getBoundingClientRect().width,p=E.clientX,S=_.current;d(!0);const k=R=>{const M=R.clientX-p,T=Ny/v,I=1-Oy/v,K=S+M/v,F=T<=I?Math.max(T,Math.min(I,K)):S;_.current=F,g(F)},L=()=>{document.removeEventListener("pointermove",k),document.removeEventListener("pointerup",L),d(!1);try{localStorage.setItem(cC,String(_.current))}catch{}};document.addEventListener("pointermove",k),document.addEventListener("pointerup",L)},[]),A=a?CD(a):"workdir";return h.jsxs("div",{ref:c,className:`diff-root${a?" has-hunk":""}${u?" is-dragging":""}`,style:a?{gridTemplateColumns:`minmax(${Ny}px, ${o}fr) 4px minmax(${Oy}px, ${1-o}fr)`}:void 0,children:[a&&h.jsxs("div",{className:"diff-hunk-pane",children:[h.jsxs("div",{className:"diff-hunk-head",children:[h.jsx("span",{className:"diff-hunk-filename",children:a.entry.path}),h.jsx("button",{type:"button",className:"diff-hunk-close","aria-label":"Close diff",onClick:m,children:"✕"})]}),h.jsx("div",{className:"diff-hunk-body",children:h.jsx(yD,{ctx:e,file:a.entry,mode:A})})]}),a&&h.jsx("div",{className:"diff-divider",onPointerDown:C,"aria-hidden":"true"}),h.jsxs("div",{className:"diff-tree-pane",children:[h.jsxs("div",{className:"diff-plugin-toolbar",children:[h.jsx("span",{className:"diff-toolbar-label",children:"Working tree"}),h.jsxs("div",{className:"diff-view-toggle",children:[h.jsx("button",{type:"button",className:`diff-toggle-btn${n==="list"?" is-active":""}`,title:"List view","aria-pressed":n==="list",onClick:()=>w("list"),children:h.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none","aria-hidden":"true",children:[h.jsx("line",{x1:"2",y1:"3.5",x2:"12",y2:"3.5",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round"}),h.jsx("line",{x1:"2",y1:"7",x2:"12",y2:"7",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round"}),h.jsx("line",{x1:"2",y1:"10.5",x2:"12",y2:"10.5",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round"})]})}),h.jsx("button",{type:"button",className:`diff-toggle-btn${n==="tree"?" is-active":""}`,title:"Tree view","aria-pressed":n==="tree",onClick:()=>w("tree"),children:h.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none","aria-hidden":"true",children:[h.jsx("rect",{x:"1",y:"1",width:"4",height:"4",rx:"1",stroke:"currentColor",strokeWidth:"1.3"}),h.jsx("rect",{x:"9",y:"1",width:"4",height:"4",rx:"1",stroke:"currentColor",strokeWidth:"1.3"}),h.jsx("rect",{x:"1",y:"9",width:"4",height:"4",rx:"1",stroke:"currentColor",strokeWidth:"1.3"}),h.jsx("rect",{x:"9",y:"9",width:"4",height:"4",rx:"1",stroke:"currentColor",strokeWidth:"1.3"})]})})]})]}),h.jsx(dD,{ctx:e,viewMode:n,selectedPath:a?.entry.path??null,selectedSection:a?.section??null,onSelect:y})]})]})}function kD(){return h.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 18 18",fill:"none","aria-hidden":"true",children:[h.jsx("rect",{x:"2",y:"4",width:"6",height:"1.5",rx:"0.5",fill:"currentColor",opacity:"0.5"}),h.jsx("rect",{x:"2",y:"7",width:"10",height:"1.5",rx:"0.5",fill:"currentColor"}),h.jsx("rect",{x:"2",y:"10",width:"8",height:"1.5",rx:"0.5",fill:"currentColor",opacity:"0.5"}),h.jsx("rect",{x:"2",y:"13",width:"12",height:"1.5",rx:"0.5",fill:"currentColor"}),h.jsx("line",{x1:"14",y1:"2",x2:"14",y2:"16",stroke:"currentColor",strokeWidth:"1.2"}),h.jsx("polyline",{points:"12,4 14,2 16,4",stroke:"currentColor",strokeWidth:"1.2",fill:"none"}),h.jsx("polyline",{points:"12,14 14,16 16,14",stroke:"currentColor",strokeWidth:"1.2",fill:"none"})]})}const AD={id:"diff",title:"Diff",icon:()=>h.jsx(kD,{}),render:e=>h.jsx(ED,{ctx:e})},TD={id:"diff",railPanels:[AD]},RD=[TD],uC=[...l4,...sD,...RD],LD=dC(uC),hC=j.createContext(LD),MD=hC.Provider;async function ND(){const e=[...uC],n=new Set(e.map(a=>a.id)),r=await OD();for(const a of r){if(n.has(a.id)){console.warn(`Skipping external plugin with duplicate id: ${a.id}`);continue}const o=await DD(a);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 dC(e)}function Jl(){return j.useContext(hC)}async function OD(){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(jD):[]}catch(e){return console.warn("Plugin runtime manifest failed to load.",e),[]}}async function DD(e){try{const n=await import(e.clientUrl),r=n.default??n.plugin;return BD(r)?r:(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 dC(e){const n=new Set,r=[];for(const a of e)for(const o of a.railPanels??[]){if(n.has(o.id)){console.warn(`Skipping rail panel with duplicate id: ${o.id}`);continue}n.add(o.id),r.push(o)}return{plugins:e,operationKinds:e.flatMap(a=>a.operationKinds??[]),settingsSections:e.flatMap(a=>a.settingsSections??[]),notificationKinds:e.flatMap(a=>a.notificationKinds??[]),railPanels:r}}function BD(e){return typeof e=="object"&&e!==null&&typeof e.id=="string"}function jD(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 ID=new Set(["token","credential","cwd","path","persona","prompt","toolAllowlist","allowedExecutorTools"]);async function fC(e){const n=await fetch("/api/v1/settings/carriers",{signal:e});return await Am(n),pC(await n.json(),n.status)}async function PD(e){const n=await fetch("/api/v1/settings/carriers/options",{signal:e});return await Am(n),$D(await n.json(),n.status)}async function xl(e,n,r){return km(`/api/v1/settings/carriers/${encodeURIComponent(e)}`,"PATCH",n,r)}async function zD(e,n,r,a){return km(`/api/v1/settings/carriers/${encodeURIComponent(e)}/taskforce/${encodeURIComponent(n)}`,"PUT",r,a)}async function HD(e,n,r){return km(`/api/v1/settings/carriers/${encodeURIComponent(e)}/taskforce/${encodeURIComponent(n)}`,"DELETE",{},r)}async function km(e,n,r,a){const o=await fetch(e,{method:n,headers:{"Content-Type":"application/json"},body:JSON.stringify(r),signal:a});await Am(o);const g=await o.json();if(!g||typeof g!="object"||!("state"in g))throw new ct(o.status,"Invalid carrier settings mutation response");return{state:pC(g.state,o.status)}}async function Am(e){if(e.ok)return;let n=e.statusText||`HTTP ${e.status}`;try{const r=await e.json();typeof r.error=="string"&&(n=r.error)}catch{}throw new ct(e.status,n)}function pC(e,n){gC(e,n);const r=e;if(!r||typeof r.generation!="number"||!Array.isArray(r.carriers))throw new ct(n,"Invalid carrier settings state response");return{generation:r.generation,carriers:r.carriers.map(a=>UD(a,n))}}function $D(e,n){gC(e,n);const r=e;if(!r||!Array.isArray(r.cliTypes)||!r.taskForceConstraints||typeof r.taskForceConstraints.minBackends!="number")throw new ct(n,"Invalid carrier settings options response");return{cliTypes:r.cliTypes.map(a=>FD(a,n)),taskForceConstraints:{minBackends:r.taskForceConstraints.minBackends}}}function UD(e,n){const r=e;if(!r||typeof r.carrierId!="string"||typeof r.displayName!="string"||typeof r.sourceDisplayName!="string"||typeof r.role!="string"||typeof r.roleDescription!="string"||typeof r.slot!="number"||typeof r.cliType!="string"||typeof r.defaultCliType!="string"||typeof r.model!="string"||r.effort!==void 0&&typeof r.effort!="string"||r.agentMode!=="cli"&&r.agentMode!=="subagent"||typeof r.subagentMode!="boolean"||typeof r.taskForceBackendCount!="number"||!r.taskforce||!Array.isArray(r.taskforce.backends))throw new ct(n,"Invalid carrier settings carrier response");return{carrierId:r.carrierId,displayName:r.displayName,sourceDisplayName:r.sourceDisplayName,role:r.role,roleDescription:r.roleDescription,...r.category?{category:r.category}:{},slot:r.slot,cliType:r.cliType,defaultCliType:r.defaultCliType,model:r.model,...r.effort?{effort:r.effort}:{},agentMode:r.agentMode,subagentMode:r.subagentMode,taskForceBackendCount:r.taskForceBackendCount,taskforce:{backends:r.taskforce.backends.map(a=>GD(a,n))}}}function FD(e,n){const r=e;if(!r||typeof r.id!="string"||typeof r.displayName!="string"||typeof r.supportsSubagent!="boolean"||!Array.isArray(r.models)||typeof r.defaultModel!="string")throw new ct(n,"Invalid carrier settings CLI option");return{id:r.id,displayName:r.displayName,supportsSubagent:r.supportsSubagent,models:r.models.map(a=>WD(a,n)),defaultModel:r.defaultModel}}function WD(e,n){const r=e;if(!r||typeof r.modelId!="string"||typeof r.name!="string")throw new ct(n,"Invalid carrier settings model option");if(r.effort!==void 0&&(!Array.isArray(r.effort.levels)||typeof r.effort.default!="string"))throw new ct(n,"Invalid carrier settings effort option");return{modelId:r.modelId,name:r.name,...r.effort?{effort:{levels:r.effort.levels.filter(a=>typeof a=="string"),default:r.effort.default}}:{}}}function GD(e,n){const r=e;if(!r||typeof r.cliType!="string"||typeof r.model!="string"||r.effort!==void 0&&typeof r.effort!="string")throw new ct(n,"Invalid carrier settings Task Force backend");return{cliType:r.cliType,model:r.model,...r.effort?{effort:r.effort}:{}}}function gC(e,n){const r=[e];for(;r.length>0;){const a=r.pop();if(!(!a||typeof a!="object"))for(const[o,g]of Object.entries(a)){if(ID.has(o))throw new ct(n,"Carrier settings response leaked a restricted field");g&&typeof g=="object"&&r.push(g)}}}const qD={cliType:"",model:"",effort:"",displayName:"",agentMode:"cli",taskforce:{}},bg=new Set;let In={loading:!1,state:null,options:null,activeCarrierId:null,draft:qD,savingActionId:null,error:null};function mC(){return j.useSyncExternalStore(KD,Dy,Dy)}function Dy(){return In}function KD(e){return bg.add(e),()=>{bg.delete(e)}}async function By(e){or({loading:!0,error:null});try{const[n,r]=await Promise.all([fC(e),PD(e)]);_C(n,r)}catch(n){if(e?.aborted)return;or({loading:!1,error:bC(n)})}}function VD(e){const n=In.state?.carriers.find(r=>r.carrierId===e);or({activeCarrierId:e,draft:n?Tm(n,In.options):In.draft,error:null})}function Vs(e){or({draft:{...In.draft,...e},error:null})}function yg(e,n){const r=In.draft.taskforce[e]??{model:"",effort:""};or({draft:{...In.draft,taskforce:{...In.draft.taskforce,[e]:{...r,...n}}},error:null})}function YD(){const e=vC();e&&or({draft:Tm(e,In.options),error:null})}async function XD(e){const n=vC();return n?ZD("save-all",async()=>{const r=In.draft;let a=null;r.displayName!==n.displayName&&(a=(await xl(n.carrierId,{displayName:r.displayName})).state);const o=r.cliType!==n.cliType;return o&&(a=(await xl(n.carrierId,{cli:r.cliType})).state),(o||r.model!==n.model||(r.effort||"")!==(n.effort||""))&&(a=(await xl(n.carrierId,{model:QD(r)})).state),r.agentMode==="subagent"?(n.agentMode!=="subagent"||n.taskForceBackendCount>0)&&(a=(await xl(n.carrierId,{agentMode:"subagent"})).state):(n.agentMode!=="cli"&&(a=(await xl(n.carrierId,{agentMode:"cli"})).state),a=await e8(n,e,a)),{state:a??await fC()}}):!1}function _C(e,n){const r=t8(e,In.activeCarrierId),a=e.carriers.find(o=>o.carrierId===r)??null;or({loading:!1,state:e,options:n,activeCarrierId:r,draft:a?Tm(a,n):In.draft,error:null})}async function ZD(e,n){or({savingActionId:e,error:null});try{const r=await n();return _C(r.state,In.options??{cliTypes:[],taskForceConstraints:{minBackends:2}}),or({savingActionId:null}),!0}catch(r){return or({savingActionId:null,error:bC(r)}),!1}}function Tm(e,n){const r=Object.fromEntries((n?.cliTypes??[]).map(a=>{const o=e.taskforce.backends.find(g=>g.cliType===a.id);return[a.id,{model:o?.model??a.defaultModel,effort:o?.effort??JD(a.id,o?.model??a.defaultModel,n)??""}]}));return{cliType:e.cliType,model:e.model,effort:e.effort??"",displayName:e.displayName,agentMode:e.agentMode,taskforce:r}}function JD(e,n,r){return r?.cliTypes.find(g=>g.id===e)?.models.find(g=>g.modelId===n)?.effort?.default??null}function QD(e){return{model:e.model,...e.effort?{effort:e.effort}:{}}}function vC(){return In.state?.carriers.find(e=>e.carrierId===In.activeCarrierId)??null}async function e8(e,n,r){const a=new Set(n.map(o=>o.cliType));for(const o of e.taskforce.backends)a.has(o.cliType)||(r=(await HD(e.carrierId,o.cliType)).state);for(const o of n){const g=e.taskforce.backends.find(_=>_.cliType===o.cliType);g&&g.model===o.model&&(g.effort||"")===(o.effort||"")||(r=(await zD(e.carrierId,o.cliType,{model:o.model,...o.effort?{effort:o.effort}:{}})).state)}return r}function t8(e,n){return n&&e.carriers.some(r=>r.carrierId===n)?n:e.carriers[0]?.carrierId??null}function or(e){In={...In,...e};for(const n of bg)n()}function bC(e){return e instanceof Error?e.message:String(e)}const n8=50,i8=2400,r8={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 s8(){const e=mC(),n=e.state?.carriers.find(p=>p.carrierId===e.activeCarrierId)??null,r=e.options?.cliTypes.find(p=>p.id===e.draft.cliType)??null,a=r?.models.find(p=>p.modelId===e.draft.model)??null,[o,g]=j.useState(!1),[_,c]=j.useState([]),[u,d]=j.useState("idle"),y=_.length>0,m=e.draft.agentMode==="subagent",w=e.draft.agentMode==="subagent",C=e.savingActionId==="save-all",A=n?h8(n,e.draft,_):!1,E=n?.taskforce.backends.map(p=>`${p.cliType}:${p.model}:${p.effort??""}`).join("|")??"";j.useEffect(()=>{const p=new AbortController;return By(p.signal),()=>p.abort()},[]),j.useEffect(()=>{g(!1),c(n?.taskforce.backends.map(p=>p.cliType)??[]),d("idle")},[n?.carrierId,E]),j.useEffect(()=>{if(u!=="saved")return;const p=window.setTimeout(()=>d("idle"),i8);return()=>window.clearTimeout(p)},[u]);function f(){n&&(YD(),c(n.taskforce.backends.map(p=>p.cliType)),g(!1),d("idle"))}async function v(){if(!n)return;if(d("saving"),!await XD(f8(_,e.draft.taskforce))){d("idle");return}g(!1),d("saved")}return h.jsxs("main",{className:"carrier-settings-page",children:[h.jsxs("section",{className:"carrier-settings-hero","aria-labelledby":"carrier-settings-title",children:[h.jsxs("div",{children:[h.jsx("p",{className:"bridge-kicker",children:"Carrier Control Surface"}),h.jsx("h2",{id:"carrier-settings-title",children:"Carrier Settings"})]}),h.jsxs("div",{className:"carrier-settings-hero-actions",children:[h.jsx("div",{className:`carrier-settings-save-status ${u==="saved"?"is-positive":""}`,role:"status","aria-live":"polite",children:u==="saving"||C?"Saving…":u==="saved"?"Saved ✓":""}),n?h.jsxs("div",{className:"carrier-settings-save-actions",children:[h.jsx("button",{type:"button",className:`carrier-settings-action-button ${A?"is-dirty":""}`,disabled:!A||C,onClick:()=>{v()},children:"Save"}),h.jsx("button",{type:"button",className:`carrier-settings-action-button ${A?"is-dirty":""}`,disabled:!A||C,onClick:f,children:"Discard"})]}):null,h.jsx("button",{type:"button",className:"carrier-settings-action-button carrier-settings-hero-refresh",disabled:e.loading,onClick:()=>{By()},children:"Refresh"})]})]}),e.error?h.jsx("p",{className:"carrier-settings-error",role:"alert",children:e.error}):null,h.jsxs("section",{className:"carrier-settings-grid",children:[h.jsxs("div",{className:"carrier-settings-list","aria-label":"Carrier list",children:[e.loading&&!e.state?h.jsx("p",{className:"carrier-settings-empty",children:"Loading carrier settings."}):null,e.state&&e.state.carriers.length===0?h.jsx("p",{className:"carrier-settings-empty",children:"No carriers registered."}):null,e.state?.carriers.map(p=>h.jsx(a8,{carrier:p,active:p.carrierId===e.activeCarrierId,minBackends:e.options?.taskForceConstraints.minBackends??2,onSelect:()=>VD(p.carrierId)},p.carrierId))]}),n&&e.options&&r?h.jsxs("div",{className:"carrier-settings-detail",style:wC(n.carrierId),children:[h.jsxs("div",{className:"carrier-settings-detail-head",children:[h.jsxs("div",{className:"carrier-settings-detail-title-block",children:[h.jsxs("div",{className:"carrier-settings-captain-id",children:[h.jsx("span",{children:"Captain"})," · ",n.carrierId.toUpperCase()]}),h.jsx("div",{className:`carrier-settings-name-line ${o?"is-editing":""}`,children:o?h.jsxs(h.Fragment,{children:[h.jsx("input",{id:"carrier-display-name",className:"carrier-settings-input carrier-settings-name-input",value:e.draft.displayName,maxLength:n8,onChange:p=>Vs({displayName:p.target.value})}),h.jsx("button",{type:"button",className:"carrier-settings-icon-button","aria-label":"Save display name",disabled:C,onClick:()=>{g(!1)},children:h.jsx(g8,{})}),h.jsx("button",{type:"button",className:"carrier-settings-icon-button","aria-label":"Cancel display name edit",onClick:()=>{Vs({displayName:n.displayName}),g(!1)},children:h.jsx(m8,{})})]}):h.jsxs(h.Fragment,{children:[h.jsx("h3",{className:"carrier-settings-captain-name",children:n.displayName}),h.jsx("button",{type:"button",className:"carrier-settings-icon-button","aria-label":"Edit display name",onClick:()=>{Vs({displayName:n.displayName}),g(!0)},children:h.jsx(p8,{})})]})}),h.jsx("div",{className:"carrier-settings-captain-role",children:n.role})]}),h.jsxs("div",{className:"carrier-settings-cli-badge",children:[h.jsx("span",{className:"ind","aria-hidden":"true"}),n.cliType]})]}),h.jsxs("div",{className:"carrier-settings-body",children:[h.jsxs("div",{className:"carrier-settings-control-group",children:[h.jsx("div",{className:"carrier-settings-resp-title",children:"Identity"}),h.jsxs("div",{className:"carrier-settings-mission",children:['"',n.roleDescription,'"']})]}),h.jsxs("div",{className:"carrier-settings-control-group",children:[h.jsx("div",{className:"carrier-settings-resp-title",children:"Runtime"}),h.jsxs("div",{className:"carrier-settings-runtime",children:[h.jsx("div",{className:"carrier-settings-runtime-row carrier-settings-runtime-row--cli",children:h.jsxs("div",{className:"carrier-settings-field carrier-settings-field--wide",children:[h.jsx("label",{className:"carrier-settings-label",htmlFor:"carrier-cli",children:"CLI"}),h.jsx("select",{id:"carrier-cli",className:"carrier-settings-select",value:e.draft.cliType,onChange:p=>l8(p.target.value,e.options?.cliTypes??[]),children:e.options.cliTypes.map(p=>h.jsx("option",{value:p.id,children:p.displayName},p.id))})]})}),h.jsxs("div",{className:"carrier-settings-runtime-row carrier-settings-runtime-row--model",children:[h.jsx(yC,{id:"carrier-model",label:"Model",models:r.models,value:e.draft.model,onChange:p=>c8(r,p)}),h.jsx(SC,{id:"carrier-effort",model:a,value:e.draft.effort,onChange:p=>Vs({effort:p})})]})]})]}),h.jsx("div",{className:"carrier-settings-control-group",children:h.jsxs("div",{className:"carrier-settings-toggle-row",children:[h.jsxs("div",{children:[h.jsx("p",{className:"carrier-settings-resp-title",children:"SubAgent"}),h.jsx("p",{className:"carrier-settings-help",children:y?"Task Force draft is present. Remove every backend to enable SubAgent.":r.supportsSubagent?"Enabling SubAgent clears Task Force backends when saved.":"This CLI does not support SubAgent mode."})]}),h.jsx("button",{type:"button",className:`carrier-settings-toggle ${m?"is-on":""}`,disabled:C||!m&&(!r.supportsSubagent||y),"aria-pressed":m,onClick:()=>Vs({agentMode:m?"cli":"subagent"}),children:h.jsx("span",{children:m?"On":"Off"})})]})}),h.jsx(o8,{carrier:n,cliOptions:e.options.cliTypes,minBackends:e.options.taskForceConstraints.minBackends,savingActionId:e.savingActionId,rows:_,disabled:w,onRowsChange:c})]})]},n.carrierId):h.jsx("div",{className:"carrier-settings-detail",children:h.jsx("p",{className:"carrier-settings-empty",children:"Select a carrier."})})]})]})}function a8({carrier:e,active:n,minBackends:r,onSelect:a}){const o=e.taskForceBackendCount>=r;return h.jsxs("button",{type:"button",className:`carrier-settings-row ${n?"is-active":""}`,style:wC(e.carrierId),onClick:a,children:[h.jsx("span",{className:"carrier-settings-captain-dot","aria-hidden":"true"}),h.jsxs("span",{className:"carrier-settings-row-text",children:[h.jsx("span",{className:"carrier-settings-row-name",children:e.displayName}),h.jsx("span",{className:"carrier-settings-row-role",children:e.role})]}),h.jsxs("span",{className:"carrier-settings-row-live","aria-hidden":"true",children:[h.jsx("span",{className:`carrier-settings-live-dot ${e.subagentMode?"is-live":""}`}),h.jsx("span",{className:`carrier-settings-live-dot ${o?"is-live":""}`})]})]})}function yC({id:e,label:n,models:r,value:a,disabled:o=!1,onChange:g}){return h.jsxs("div",{className:"carrier-settings-field",children:[h.jsx("label",{className:"carrier-settings-label",htmlFor:e,children:n}),h.jsx("select",{id:e,className:"carrier-settings-select",value:a,disabled:o,onChange:_=>g(_.target.value),children:r.map(_=>h.jsx("option",{value:_.modelId,children:_.name},_.modelId))})]})}function SC({id:e,model:n,value:r,disabled:a=!1,onChange:o}){return n?.effort?h.jsxs("div",{className:"carrier-settings-field",children:[h.jsx("label",{className:"carrier-settings-label",htmlFor:e,children:"Effort"}),h.jsx("select",{id:e,className:"carrier-settings-select",value:r||n.effort.default,disabled:a,onChange:g=>o(g.target.value),children:n.effort.levels.map(g=>h.jsx("option",{value:g,children:g},g))})]}):h.jsxs("div",{className:"carrier-settings-field",children:[h.jsx("span",{className:"carrier-settings-label",children:"Effort"}),h.jsx("p",{className:"carrier-settings-help",children:"Not supported for this model."})]})}function o8({carrier:e,cliOptions:n,minBackends:r,savingActionId:a,rows:o,disabled:g,onRowsChange:_}){const c=mC(),u=e.taskforce.backends.length,[d,y]=j.useState(u>0),[m,w]=j.useState(!1),[C,A]=j.useState(""),E=e.taskForceBackendCount>=r,f=n.filter(p=>!o.includes(p.id)),v=C||f[0]?.id||"";return h.jsxs("div",{className:`carrier-settings-control-group carrier-settings-control-group--taskforce ${d?"is-expanded":""} ${g?"is-disabled":""}`,children:[h.jsxs("div",{className:"carrier-settings-section-head",children:[h.jsxs("div",{children:[h.jsx("p",{className:"carrier-settings-resp-title",children:"Task Force"}),h.jsx("p",{className:"carrier-settings-help",children:g?"Disabled while SubAgent is on. Turn SubAgent off before composing Task Force backends.":u>0?`${u} backend${u===1?"":"s"} configured${E?" · active":` · needs ${r}+ to activate`}.`:`Run this carrier across multiple CLI backends. Needs at least ${r} to activate.`})]}),h.jsx("div",{className:"carrier-settings-tf-head-actions",children:h.jsx("button",{type:"button",className:"carrier-settings-tf-toggle","aria-expanded":d,onClick:()=>y(p=>!p),children:d?"Hide":"Configure"})})]}),d?h.jsxs("div",{className:"carrier-settings-tf-list",children:[o.length===0?h.jsx("p",{className:"carrier-settings-tf-empty",children:"No Task Force backend drafted."}):null,o.map(p=>{const S=n.find(M=>M.id===p);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 h.jsxs("div",{className:`carrier-settings-tf-item ${R?"is-active":""}`,children:[h.jsxs("div",{className:"carrier-settings-tf-title",children:[h.jsx("span",{className:`carrier-settings-live-dot ${R?"is-live":""}`,"aria-hidden":"true"}),h.jsx("strong",{children:S.displayName})]}),h.jsx(yC,{id:`tf-${S.id}-model`,label:"Model",models:S.models,value:k.model,disabled:g,onChange:M=>u8(S,M)}),h.jsx(SC,{id:`tf-${S.id}-effort`,model:L,value:k.effort,disabled:g,onChange:M=>yg(S.id,{effort:M})}),h.jsx("div",{className:"carrier-settings-tf-actions",children:h.jsx("button",{type:"button",className:"carrier-settings-ghost-button",disabled:g||a==="save-all",onClick:()=>_(o.filter(M=>M!==S.id)),children:"Remove"})})]},S.id)}),h.jsxs("div",{className:"carrier-settings-tf-add-row",children:[m&&f.length>0?h.jsx("select",{className:"carrier-settings-select carrier-settings-tf-add-select",value:v,onChange:p=>A(p.target.value),"aria-label":"Task Force CLI to add",children:f.map(p=>h.jsx("option",{value:p.id,children:p.displayName},p.id))}):null,h.jsx("button",{type:"button",className:"carrier-settings-ghost-button",disabled:g||f.length===0||a==="save-all",onClick:()=>{if(!m){w(!0);return}const p=v,S=n.find(L=>L.id===p),k=S?.models.find(L=>L.modelId===S.defaultModel)??S?.models[0]??null;!S||!k||(yg(S.id,{model:k.modelId,effort:k.effort?.default??""}),_(o.includes(S.id)?o:[...o,S.id]),A(""),w(!1))},children:"Add"})]})]}):null]})}function l8(e,n){const r=n.find(g=>g.id===e),a=r?.models.find(g=>g.modelId===r.defaultModel)??r?.models[0]??null,o={cliType:e,model:a?.modelId??"",effort:a?.effort?.default??""};r?.supportsSubagent||(o.agentMode="cli"),Vs(o)}function c8(e,n){const r=e.models.find(a=>a.modelId===n);Vs({model:n,effort:r?.effort?.default??""})}function u8(e,n){const r=e.models.find(a=>a.modelId===n);yg(e.id,{model:n,effort:r?.effort?.default??""})}function h8(e,n,r){return n.displayName!==e.displayName||n.cliType!==e.cliType||n.model!==e.model||(n.effort||"")!==(e.effort||"")||n.agentMode!==e.agentMode?!0:n.agentMode==="subagent"?e.taskForceBackendCount>0:d8(e,r,n.taskforce)}function d8(e,n,r){if(n.length!==e.taskforce.backends.length)return!0;const a=new Set(n);for(const o of e.taskforce.backends){if(!a.has(o.cliType))return!0;const g=r[o.cliType];if(!g||g.model!==o.model||(g.effort||"")!==(o.effort||""))return!0}return!1}function f8(e,n){return e.map(r=>{const a=n[r];return a?{cliType:r,model:a.model,...a.effort?{effort:a.effort}:{}}:null}).filter(r=>r!==null)}function wC(e){return{"--cap-color":r8[e]??"var(--brass)"}}function p8(){return h.jsxs("svg",{viewBox:"0 0 16 16","aria-hidden":"true",focusable:"false",children:[h.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"}),h.jsx("path",{d:"M9.7 3.4 12.6 6.3"})]})}function g8(){return h.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",focusable:"false",children:h.jsx("path",{d:"M3 8.3 6.4 11.7 13.2 4.5"})})}function m8(){return h.jsxs("svg",{viewBox:"0 0 16 16","aria-hidden":"true",focusable:"false",children:[h.jsx("path",{d:"M4.2 4.2 11.8 11.8"}),h.jsx("path",{d:"M11.8 4.2 4.2 11.8"})]})}async function _8(e){const n=await fetch("/api/v1/settings/api-catalog",{signal:e});return await v8(n),b8(await n.json(),n.status).routes}async function v8(e){if(e.ok)return;let n=e.statusText||`HTTP ${e.status}`;try{const r=await e.json();typeof r.error=="string"&&(n=r.error)}catch{}throw new ct(e.status,n)}function b8(e,n){const r=e;if(!r||typeof r!="object"||!("version"in r)||!Array.isArray(r.routes))throw new ct(n,"Invalid backend API catalog response");return{routes:r.routes.map(a=>y8(a,n))}}function y8(e,n){const r=e;if(!r||typeof r!="object"||typeof r.method!="string"||typeof r.path!="string"||typeof r.summary!="string"||typeof r.category!="string"||typeof r.gate!="string")throw new ct(n,"Invalid backend API catalog entry");return{method:r.method,path:r.path,summary:r.summary,category:r.category,gate:r.gate}}const Sg=new Set;let wg={loading:!1,state:null,error:null};function S8(){return j.useSyncExternalStore(w8,jy,jy)}function jy(){return wg}function w8(e){return Sg.add(e),()=>{Sg.delete(e)}}async function x8(e){fp({loading:!0,error:null});try{const n=await _8(e);fp({loading:!1,state:n,error:null})}catch(n){if(e?.aborted)return;fp({loading:!1,error:C8(n)})}}function fp(e){wg={...wg,...e};for(const n of Sg)n()}function C8(e){return e instanceof Error?e.message:String(e)}function E8(){const e=S8(),[n,r]=j.useState(!0),a=j.useMemo(()=>T8(e.state??[]),[e.state]),o=e.state?.length??0,g=a.length;return j.useEffect(()=>{const _=new AbortController;return x8(_.signal),()=>_.abort()},[]),h.jsxs("section",{className:"global-settings-card backend-api-section","aria-label":"Backend API catalog",children:[h.jsx("div",{className:`backend-api-control carrier-settings-control-group--taskforce ${n?"is-expanded":""}`,children:h.jsxs("div",{className:"carrier-settings-section-head",children:[h.jsxs("div",{className:"backend-api-head",children:[h.jsx("p",{className:"global-settings-resp-title",children:"Backend API"}),h.jsx("p",{className:"global-settings-help",children:o>0?`${o} loopback route${o===1?"":"s"} across ${g} categor${g===1?"y":"ies"} reported by backend introspection.`:"Backend introspection route list for this console."})]}),h.jsx("div",{className:"carrier-settings-tf-head-actions",children:h.jsx("button",{type:"button",className:"carrier-settings-tf-toggle","aria-expanded":n,onClick:()=>r(_=>!_),children:n?"Hide":"Show"})})]})}),e.error?h.jsx("p",{className:"global-settings-error",role:"alert",children:e.error}):null,e.loading&&!e.state?h.jsx("p",{className:"global-settings-help",children:"Loading backend API catalog."}):null,n?h.jsxs("div",{className:"backend-api-groups",children:[a.length>0?a.map(_=>h.jsx(k8,{group:_},_.category)):null,e.state&&a.length===0?h.jsx("p",{className:"global-settings-help",children:"No backend API routes reported."}):null]}):null,h.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 k8({group:e}){return h.jsxs("div",{className:"backend-api-group",children:[h.jsxs("div",{className:"backend-api-group-head",children:[h.jsx("span",{children:e.category}),h.jsx("span",{children:e.entries.length})]}),h.jsx("div",{className:"backend-api-list",children:e.entries.map(n=>h.jsx(A8,{entry:n},`${n.method}:${n.path}`))})]})}function A8({entry:e}){return h.jsxs("div",{className:"backend-api-row",children:[h.jsx("span",{className:"backend-api-method",children:e.method.toUpperCase()}),h.jsx("code",{className:"backend-api-path",children:e.path}),h.jsx("span",{className:"backend-api-summary",children:e.summary}),h.jsx("span",{className:"backend-api-gate",children:e.gate})]})}function T8(e){const n=new Map;for(const r of e){const a=r.category.trim()||"Uncategorized",o=n.get(a);o?o.push(r):n.set(a,[r])}return Array.from(n.entries()).map(([r,a])=>({category:r,entries:a}))}async function xC(e){const n=await fetch("/api/v1/settings/global",{signal:e});return await CC(n),EC(await n.json(),n.status)}async function R8(e,n){const r=await fetch("/api/v1/settings/global",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e),signal:n});await CC(r);const a=await r.json();if(!a||typeof a!="object"||!("state"in a))throw new ct(r.status,"Invalid global settings mutation response");return{state:EC(a.state,r.status)}}async function CC(e){if(e.ok)return;let n=e.statusText||`HTTP ${e.status}`;try{const r=await e.json();typeof r.error=="string"&&(n=r.error)}catch{}throw new ct(e.status,n)}function EC(e,n){const r=e;if(!r||r.consolePortMode!=="dynamic"&&r.consolePortMode!=="static"||r.consoleStaticPort!==null&&!L8(r.consoleStaticPort)||r.theme!=="maritime"&&r.theme!=="carbon")throw new ct(n,"Invalid global settings state response");return{consolePortMode:r.consolePortMode,consoleStaticPort:r.consoleStaticPort,theme:r.theme}}function L8(e){return typeof e=="number"&&Number.isInteger(e)&&e>=1024&&e<=65535}const xg=new Set;let Cg={loading:!1,state:null,savingField:null,error:null};function M8(){return j.useSyncExternalStore(N8,Iy,Iy)}function Iy(){return Cg}function N8(e){return xg.add(e),()=>{xg.delete(e)}}async function O8(e){ao({loading:!0,error:null});try{const n=await xC(e);ao({loading:!1,state:n,error:null})}catch(n){if(e?.aborted)return;ao({loading:!1,error:kC(n)})}}async function Eg(e,n){ao({savingField:e,error:null});try{const r=await R8({[e]:n});return ao({state:r.state,savingField:null,error:null}),!0}catch(r){return ao({savingField:null,error:kC(r)}),!1}}function ao(e){Cg={...Cg,...e};for(const n of xg)n()}function kC(e){return e instanceof Error?e.message:String(e)}const D8=[{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)"]}],B8=[{id:"dynamic",label:"Dynamic"},{id:"static",label:"Static"}],j8=1024,I8=65535,P8=[{id:"general",label:"General",eyebrow:"Theme · Port"},{id:"backend-api",label:"Backend API",eyebrow:"Loopback routes"}];function z8(){const e=M8(),n=e.state,r=e.savingField!==null,[a,o]=j.useState("general"),g=Jl(),_=$8(g.plugins),c=U8(_);return j.useEffect(()=>{const u=new AbortController;return O8(u.signal),()=>u.abort()},[]),h.jsxs("main",{className:"global-settings-page",children:[h.jsxs("section",{className:"global-settings-hero","aria-labelledby":"global-settings-title",children:[h.jsxs("div",{children:[h.jsx("p",{className:"bridge-kicker",children:"Fleet Control Surface"}),h.jsx("h2",{id:"global-settings-title",children:"Settings"})]}),h.jsx("div",{className:"global-settings-status",role:"status","aria-live":"polite",children:r?"Saving…":""})]}),e.error?h.jsx("p",{className:"global-settings-error",role:"alert",children:e.error}):null,h.jsxs("section",{className:"global-settings-grid",children:[h.jsxs("div",{className:"global-settings-list","aria-label":"Settings sections",children:[h.jsx("p",{className:"global-settings-nav-group",children:"Console"}),P8.map(u=>h.jsxs("button",{type:"button",className:`global-settings-nav-item ${u.id===a?"is-active":""}`,"aria-pressed":u.id===a,onClick:()=>o(u.id),children:[h.jsx("span",{className:"global-settings-nav-label",children:u.label}),h.jsx("span",{className:"global-settings-nav-eyebrow",children:u.eyebrow})]},u.id)),_.length>0?h.jsxs(h.Fragment,{children:[h.jsx("p",{className:"global-settings-nav-group",children:"Plugins"}),c.map(u=>h.jsxs("div",{className:"global-settings-plugin-group",children:[h.jsx("p",{className:"global-settings-plugin-heading",children:u.pluginLabel}),u.sections.map(d=>h.jsxs("button",{type:"button",className:`global-settings-nav-item ${d.id===a?"is-active":""}`,"aria-pressed":d.id===a,onClick:()=>o(d.id),children:[h.jsx("span",{className:"global-settings-nav-label",children:d.sectionTitle}),h.jsx("span",{className:"global-settings-nav-eyebrow",children:d.pluginLabel})]},d.id))]},u.pluginId))]}):null]}),h.jsx("div",{className:"global-settings-detail",children:H8(a,n,r,_)},a)]})]})}function H8(e,n,r,a){if(e.includes(":")){const o=a.find(g=>g.id===e);return o?.render?h.jsx(Ig,{fallback:h.jsx("div",{className:"fc-plugin-error",children:"Plugin settings failed to render."}),children:o.render()}):h.jsx("p",{className:"global-settings-help",children:"Plugin settings unavailable."})}switch(e){case"general":return h.jsxs(h.Fragment,{children:[h.jsx(W8,{}),h.jsx(G8,{state:n,saving:r})]});case"backend-api":return h.jsx(E8,{})}}function $8(e){return e.flatMap(n=>(n.settingsSections??[]).map(r=>({id:`${n.id}:${r.id}`,pluginId:n.id,pluginLabel:F8(n.id),sectionTitle:r.title,render:r.render})))}function U8(e){const n=[];for(const r of e){const a=n.at(-1);if(a?.pluginId===r.pluginId){n[n.length-1]={...a,sections:[...a.sections,r]};continue}n.push({pluginId:r.pluginId,pluginLabel:r.pluginLabel,sections:[r]})}return n}function F8(e){return e==="terminal"?"Terminal":e.split(/[-_]/g).filter(Boolean).map(n=>n.charAt(0).toUpperCase()+n.slice(1)).join(" ")||e}function W8(){const{activeTheme:e}=$r();return h.jsxs("section",{className:"global-settings-card","aria-label":"Theme",children:[h.jsxs("div",{className:"global-settings-row",children:[h.jsxs("div",{className:"global-settings-row-text",children:[h.jsx("p",{className:"global-settings-resp-title",children:"Theme"}),h.jsx("p",{className:"global-settings-help",children:"Console color scheme. Applies immediately and is saved server-side."})]}),h.jsx("div",{className:"theme-picker",role:"group","aria-label":"Theme",children:D8.map(n=>{const r=n.id===e;return h.jsxs("button",{type:"button","aria-pressed":r,className:`theme-card ${r?"is-active":""}`,onClick:()=>{lw(n.id),Eg("theme",n.id)},children:[h.jsx("span",{className:"theme-card-swatch","aria-hidden":"true",children:n.swatch.map(a=>h.jsx("i",{style:{background:a}},a))}),h.jsx("span",{className:"theme-card-label",children:n.label}),h.jsx("span",{className:"theme-card-check","aria-hidden":"true",children:r?h.jsx(K8,{}):null})]},n.id)})})]}),h.jsx("p",{className:"global-settings-foot",children:"Theme applies immediately and is stored server-side."})]})}function G8({state:e,saving:n}){const r=$r();return h.jsxs("section",{className:"global-settings-card","aria-label":"General",children:[e?h.jsx(h.Fragment,{children:h.jsx(q8,{state:e,saving:n,consoleState:r})}):h.jsx("p",{className:"global-settings-help",children:"Loading settings."}),h.jsx("p",{className:"global-settings-foot",children:"Changes apply to newly launched sessions. Running sessions keep their current configuration until relaunched."})]})}function q8({state:e,saving:n,consoleState:r}){const[a,o]=j.useState(e.consoleStaticPort?.toString()??""),g=r.effectivePort,_=r.portMode==="static"&&!r.portHonored,c=r.requestedPort,u=e.consolePortMode==="static"&&e.consoleStaticPort!==null,d=a.trim(),y=Number(d),m=d.length>0,w=m&&Py(y),C=e.consolePortMode==="static"&&m&&!w;return j.useEffect(()=>{o(e.consoleStaticPort?.toString()??"")},[e.consoleStaticPort]),h.jsxs("div",{className:"global-settings-row is-stack console-port-row",children:[h.jsxs("div",{className:"global-settings-row-text",children:[h.jsxs("p",{className:"global-settings-resp-title",children:["Console Port ",h.jsx("span",{className:"new-badge",children:"New"})]}),h.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."})]}),h.jsxs("div",{className:"console-port-control",children:[h.jsx("div",{className:"segmented",role:"group","aria-label":"Console port mode",children:B8.map(A=>{const E=e.consolePortMode===A.id;return h.jsx("button",{type:"button","aria-pressed":E,className:`segmented-option ${E?"is-active":""}`,disabled:n,onClick:()=>{Eg("consolePortMode",A.id)},children:A.label},A.id)})}),h.jsx("div",{className:`console-port-reveal ${e.consolePortMode==="static"?"is-open":""}`,children:h.jsxs("div",{className:"console-port-reveal-inner",children:[h.jsx("label",{className:"console-port-input-label",htmlFor:"console-static-port-input",children:"Static port"}),h.jsx("input",{id:"console-static-port-input",className:`console-port-input ${C?"is-invalid":""}`,inputMode:"numeric",placeholder:"8080",value:a,disabled:n,"aria-invalid":C,"aria-describedby":"console-static-port-hint",onChange:A=>{const E=A.target.value;o(E);const f=Number(E.trim());Py(f)&&Eg("consoleStaticPort",f)}}),h.jsx("span",{id:"console-static-port-hint",className:`console-port-hint ${C?"is-invalid":""}`,children:"1024–65535"})]})}),h.jsxs("div",{className:`console-port-effective ${_?"is-fallback":""}`,"aria-live":"polite",children:[h.jsx("span",{className:"console-port-effective-dot","aria-hidden":"true"}),h.jsxs("div",{children:[h.jsx("p",{className:"console-port-effective-label",children:"Currently reachable on"}),h.jsxs("p",{className:"console-port-effective-value",children:["127.0.0.1:",h.jsx("span",{children:g||"..."}),_?" · Dynamic":""]})]})]}),_&&c?h.jsxs("div",{className:"console-port-warning",role:"status",children:["Port ",h.jsx("strong",{children:c})," was unavailable — the console fell back to a ",h.jsx("strong",{children:"Dynamic"})," port and is running on ",h.jsxs("strong",{children:["127.0.0.1:",g||"..."]}),"."," ",u?h.jsxs(h.Fragment,{children:["Next restart will try ",h.jsx("strong",{children:e.consoleStaticPort}),"."]}):h.jsx(h.Fragment,{children:"Next restart will use a dynamic port."})]}):null,h.jsx("p",{className:"console-port-note",children:"Applies when the console restarts. Console-wide — shared across every browser."})]})]})}function Py(e){return Number.isInteger(e)&&e>=j8&&e<=I8}function K8(){return h.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:h.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 V8(e,n){return{x:e.x*n.zoom+n.x,y:e.y*n.zoom+n.y}}function Wl(e,n){return{x:(e.x-n.x)/n.zoom,y:(e.y-n.y)/n.zoom}}function Y8(e,n){return{...V8(e,n),width:e.width*n.zoom,height:e.height*n.zoom}}const X8=[{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"}]}],Z8=288,J8=520,Cl=12,ms=[{id:"operations",label:"Operations"},{id:"map",label:"Map"},{id:"help",label:"Help"}],Q8=/mac|iphone|ipad|ipod/i;function Iu({anchor:e,viewportBounds:n,placement:r="cursor",mode:a="full",catalog:o,canLaunch:g,mapFullscreen:_,radarEnabled:c,perimeterEnabled:u,renderKindIcon:d,onLaunchKind:y,onResetView:m,onMaximizeMap:w,onToggleRadar:C,onTogglePerimeter:A,onClose:E}){const f=j.useRef(null),v=j.useRef(null),p=j.useRef({operations:null,map:null,help:null}),[S,k]=j.useState(a==="controls"?"map":"operations"),L=n7(),R=a==="full",M=a==="full"||a==="launch",T=a==="full"||a==="controls";j.useEffect(()=>{const F=B=>{f.current?.contains(B.target)||E()},G=B=>{B.key==="Escape"&&E()};return document.addEventListener("mousedown",F),document.addEventListener("keydown",G),()=>{document.removeEventListener("mousedown",F),document.removeEventListener("keydown",G)}},[E]),j.useEffect(()=>{v.current?.focus()},[]);const I=(F,G=!1)=>{k(F),G&&window.requestAnimationFrame(()=>p.current[F]?.focus())},K=F=>{const G=ms.findIndex(X=>X.id===S),B=ms.length-1;if(F.key==="ArrowRight"||F.key==="ArrowLeft"){F.preventDefault();const X=F.key==="ArrowRight"?1:-1,Y=ms[(G+X+ms.length)%ms.length];I(Y.id,!0)}else F.key==="Home"?(F.preventDefault(),I(ms[0].id,!0)):F.key==="End"&&(F.preventDefault(),I(ms[B].id,!0))};return h.jsx("div",{className:`operation-launch-control operation-launch-control--canvas ${r==="above"?"operation-launch-control--up":""}`,ref:f,style:t7(e,n,r),"data-canvas-blocker":!0,children:h.jsxs("div",{className:"operation-launch-menu theater-menu canvas-context-menu",role:"dialog","aria-label":"Operations Control",tabIndex:-1,ref:v,children:[h.jsxs("div",{className:"canvas-context-menu-head",children:[h.jsx("span",{className:"canvas-context-menu-reticle","aria-hidden":"true",children:h.jsx(e7,{})}),h.jsx("span",{className:"canvas-context-menu-head-text",children:h.jsx("strong",{children:"Operations Control"})})]}),R?h.jsx("div",{className:"canvas-context-menu-tabs",role:"tablist","aria-label":"Operations Control sections",children:ms.map(F=>h.jsx("button",{ref:G=>{p.current[F.id]=G},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:()=>I(F.id),onKeyDown:K,children:F.label},F.id))}):null,M?h.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:[h.jsx("p",{className:"canvas-context-menu-section",children:"Launch"}),o.length>0?o.map((F,G)=>h.jsxs("div",{children:[G>0?h.jsx("div",{className:"theater-menu-divider",role:"separator"}):null,h.jsx("p",{className:"canvas-context-menu-plugin",children:F.title}),F.kinds.map(B=>{const X=B.disabled===!0||!g;return h.jsxs("button",{type:"button",role:"menuitem",className:"theater-menu-item canvas-context-menu-item operation-launch-menu-item",disabled:X,title:B.disabledReason,onClick:()=>y(F.id,B),children:[h.jsx("span",{className:"theater-menu-check","aria-hidden":"true",children:d(F.id,B)??h.jsx(o7,{})}),h.jsx("span",{className:"theater-menu-label",children:B.title}),B.disabledReason?h.jsx("span",{className:"operation-launch-menu-reason",children:B.disabledReason}):null]},`${F.id}:${B.id}`)})]},F.id)):h.jsx("p",{className:"theater-menu-empty",children:"No operations available."})]}):null,T?h.jsxs(h.Fragment,{children:[h.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:[h.jsx("p",{className:"canvas-context-menu-section",children:"View"}),h.jsxs("button",{type:"button",role:"menuitem",className:"theater-menu-item canvas-context-menu-item",onClick:m,children:[h.jsx("span",{className:"theater-menu-check","aria-hidden":"true",children:h.jsx(i7,{})}),h.jsx("span",{className:"theater-menu-label",children:"Reset view"})]}),h.jsx("div",{className:"theater-menu-divider",role:"separator"}),h.jsx("p",{className:"canvas-context-menu-section",children:"Settings"}),w?h.jsx(pp,{checked:!!_,label:"Maximized map",onClick:w,children:h.jsx(r7,{})}):null,C?h.jsx(pp,{checked:!!c,label:"Radar sweep",onClick:C,children:h.jsx(s7,{})}):null,A?h.jsx(pp,{checked:!!u,label:"Panel pulse",onClick:A,children:h.jsx(a7,{})}):null]}),h.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:a==="controls"?h.jsxs("details",{className:"canvas-context-menu-help-details",children:[h.jsx("summary",{className:"canvas-context-menu-section canvas-context-menu-help-summary",children:"Shortcuts"}),h.jsx(zy,{modLabel:L})]}):h.jsx(zy,{modLabel:L})})]}):null]})})}function e7(){return h.jsxs("svg",{viewBox:"0 0 24 24","aria-hidden":"true",children:[h.jsx("circle",{cx:"12",cy:"12",r:"7",fill:"none",stroke:"currentColor",strokeWidth:"1.4"}),h.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"}),h.jsx("path",{d:"M12 9.2v5.6M9.2 12h5.6",fill:"none",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round"})]})}function t7(e,n,r){const a=n?Math.max(Cl,Math.min(e.x,n.width-Z8-Cl)):e.x;if(r==="above")return{left:a,bottom:Math.max(Cl,e.y)};const o=n?Math.max(Cl,Math.min(e.y,n.height-J8-Cl)):e.y;return{left:a,top:o}}function zy({modLabel:e}){return h.jsx(h.Fragment,{children:X8.map(n=>h.jsxs("section",{className:"canvas-shortcuts-group","aria-labelledby":`canvas-shortcuts-${n.title.toLowerCase()}`,children:[h.jsx("h3",{id:`canvas-shortcuts-${n.title.toLowerCase()}`,children:n.title}),h.jsx("dl",{className:"canvas-shortcuts-list",children:n.entries.map(r=>h.jsxs("div",{className:"canvas-shortcuts-entry",children:[h.jsx("dt",{className:"canvas-shortcuts-combos",children:r.combos.map((a,o)=>h.jsxs("span",{className:"canvas-shortcuts-combo",children:[o>0?h.jsx("span",{className:"canvas-shortcuts-or",children:"or"}):null,h.jsx("span",{className:"canvas-shortcuts-keyset",children:a.map(g=>h.jsx("kbd",{children:g==="Mod"?e:g},g))})]},`${r.description}:${a.join("+")}`))}),h.jsx("dd",{children:r.description})]},`${n.title}:${r.description}`))})]},n.title))})}function pp({checked:e,label:n,onClick:r,children:a}){return h.jsxs("button",{type:"button",role:"switch",className:`canvas-context-menu-switch ${e?"is-on":""}`,"aria-checked":e,onClick:r,children:[h.jsx("span",{className:"canvas-context-menu-switch-icon","aria-hidden":"true",children:a}),h.jsx("span",{className:"canvas-context-menu-switch-label",children:n}),h.jsx("span",{className:"canvas-context-menu-switch-track","aria-hidden":"true"})]})}function n7(){const n=navigator.userAgentData?.platform??navigator.platform;return Q8.test(n)?"⌘":"Ctrl"}function i7(){return h.jsxs("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:[h.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"}),h.jsx("path",{d:"M2.4 4.6v2.8h2.8",fill:"none",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round"})]})}function r7(){return h.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:h.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 s7(){return h.jsxs("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:[h.jsx("circle",{cx:"8",cy:"8",r:"5.2",fill:"none",stroke:"currentColor",strokeWidth:"1.2"}),h.jsx("path",{d:"M8 8 12 5.6",fill:"none",stroke:"currentColor",strokeWidth:"1.2",strokeLinecap:"round"}),h.jsx("circle",{cx:"8",cy:"8",r:"1.1",fill:"currentColor"})]})}function a7(){return h.jsxs("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:[h.jsx("rect",{x:"3",y:"3.2",width:"10",height:"9.6",rx:"2",fill:"none",stroke:"currentColor",strokeWidth:"1.2"}),h.jsx("path",{d:"M10.9 3.2H13v2.1M5.1 12.8H3v-2.1",fill:"none",stroke:"currentColor",strokeWidth:"1.2",strokeLinecap:"round",strokeLinejoin:"round"}),h.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"}),h.jsx("circle",{cx:"11.7",cy:"4.2",r:"0.9",fill:"currentColor"})]})}function o7(){return h.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:h.jsx("circle",{cx:"8",cy:"8",r:"3.2",fill:"currentColor",opacity:"0.86"})})}const Hy=256,$y=176,gp=12,Au=220,AC="fleet-console.map.radarCollapsed";function l7({operations:e,pluginOperations:n,viewport:r,canvasSize:a,onJump:o}){const g=j.useRef(null),_=j.useRef(!1),[c,u]=j.useState(c7);if(a.width<=0||a.height<=0||r.zoom<=0)return null;const d=[...Object.entries(e).map(([B,X])=>({id:B,kind:"op",x:X.x,y:X.y,width:X.width,height:X.height})),...Object.entries(n).map(([B,X])=>({id:B,kind:"plugin",x:X.geometry.x,y:X.geometry.y,width:X.geometry.width,height:X.geometry.height}))];if(d.length===0)return null;const y=()=>{u(B=>{const X=!B;return u7(X),X})};if(c)return h.jsx("button",{type:"button",className:"canvas-minimap-fab","data-canvas-blocker":!0,onClick:y,"aria-label":"Radar 펼치기",title:"Show radar",children:h.jsx(d7,{})});const m=Hy-gp*2,w=$y-gp*2,C={x:-r.x/r.zoom,y:-r.y/r.zoom,width:a.width/r.zoom,height:a.height/r.zoom};let A=Math.min(C.x,...d.map(B=>B.x)),E=Math.min(C.y,...d.map(B=>B.y)),f=Math.max(C.x+C.width,...d.map(B=>B.x+B.width)),v=Math.max(C.y+C.height,...d.map(B=>B.y+B.height));A-=Au,E-=Au,f+=Au,v+=Au;const p=f-A,S=v-E,k=Math.min(m/p,w/S),L=(m-p*k)/2,R=(w-S*k)/2,M=B=>L+(B-A)*k,T=B=>R+(B-E)*k,I=B=>{const X=g.current?.getBoundingClientRect();if(!X)return;const Y=B.clientX-X.left,z=B.clientY-X.top;o({x:A+(Y-L)/k,y:E+(z-R)/k})},K=B=>{B.stopPropagation(),_.current=!0,B.currentTarget.setPointerCapture(B.pointerId),I(B)},F=B=>{_.current&&(B.stopPropagation(),I(B))},G=B=>{_.current=!1;try{B.currentTarget.releasePointerCapture(B.pointerId)}catch{}};return h.jsxs("div",{className:"canvas-minimap","data-canvas-blocker":!0,style:{width:Hy,height:$y},children:[h.jsx("span",{className:"canvas-minimap-label","aria-hidden":"true",children:"Radar"}),h.jsx("button",{type:"button",className:"canvas-minimap-toggle",onClick:y,"aria-label":"Radar 접기",title:"Collapse radar",children:h.jsx(h7,{})}),h.jsxs("div",{ref:g,className:"canvas-minimap-inner",style:{inset:gp},onPointerDown:K,onPointerMove:F,onPointerUp:G,onPointerCancel:G,role:"presentation","aria-label":"Canvas minimap — drag to navigate",children:[d.map(B=>h.jsx("div",{className:`canvas-minimap-operation ${B.kind==="plugin"?"is-plugin":""}`,style:{left:M(B.x),top:T(B.y),width:Math.max(2,B.width*k),height:Math.max(2,B.height*k)}},B.id)),h.jsx("div",{className:"canvas-minimap-view",style:{left:M(C.x),top:T(C.y),width:C.width*k,height:C.height*k}})]})]})}function c7(){if(typeof window>"u")return!1;try{return window.localStorage.getItem(AC)==="true"}catch{return!1}}function u7(e){if(!(typeof window>"u"))try{window.localStorage.setItem(AC,String(e))}catch{}}function h7(){return h.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:h.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 d7(){return h.jsxs("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:[h.jsx("rect",{x:"2",y:"3",width:"12",height:"10",rx:"2",fill:"none",stroke:"currentColor",strokeWidth:"1.2"}),h.jsx("rect",{x:"4.2",y:"5",width:"4.2",height:"3.1",rx:"0.6",fill:"none",stroke:"currentColor",strokeWidth:"1"}),h.jsx("circle",{cx:"11",cy:"10.2",r:"0.95",fill:"currentColor"})]})}const f7="is-animation-paused";function p7({viewport:e,backgroundAnimationEnabled:n}){const[r,a]=j.useState(()=>document.hidden);return j.useEffect(()=>{function o(){a(document.hidden)}return document.addEventListener("visibilitychange",o),()=>{document.removeEventListener("visibilitychange",o)}},[]),h.jsxs("div",{className:"operations-canvas-background","aria-hidden":"true",children:[h.jsx("div",{className:"operations-canvas-sea"}),h.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?h.jsxs("div",{className:`operations-radar${r?` ${f7}`:""}`,children:[h.jsx("span",{className:"operations-radar-ring operations-radar-ring--outer"}),h.jsx("span",{className:"operations-radar-ring operations-radar-ring--middle"}),h.jsx("span",{className:"operations-radar-ring operations-radar-ring--inner"}),h.jsx("span",{className:"operations-radar-sweep"})]}):null]})}const wh=[{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 Gl(e){return wh.find(n=>n.key===e)?.color??null}function Uy(e){return typeof e.accent=="string"?e.accent:null}const Fy=8,g7=120;function m7({anchor:e,accentKey:n,onSelect:r,onClose:a}){const[o,g]=j.useState(void 0);j.useLayoutEffect(()=>{const c=Math.max(8,Math.min(e.left,window.innerWidth-8)),u=e.bottom+Fy,d=u+g7>window.innerHeight;g(d?{position:"fixed",left:c,top:"auto",bottom:Math.round(window.innerHeight-e.top+Fy)}:{position:"fixed",left:c,top:Math.round(u)})},[e]),j.useEffect(()=>{const c=u=>{u.key==="Escape"&&(u.preventDefault(),a())};return window.addEventListener("keydown",c),window.addEventListener("resize",a),window.addEventListener("scroll",a,!0),()=>{window.removeEventListener("keydown",c),window.removeEventListener("resize",a),window.removeEventListener("scroll",a,!0)}},[a]);const _=c=>{r(c),a()};return Js.createPortal(h.jsx("div",{className:"accent-popover-overlay",role:"presentation",onPointerDown:a,children:o?h.jsxs("div",{className:"accent-popover-card",role:"menu","aria-label":"Accent",style:o,onPointerDown:c=>c.stopPropagation(),children:[h.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:[h.jsx("span",{}),"None"]}),wh.map(c=>h.jsx("button",{type:"button",className:"accent-popover-swatch",role:"menuitem","aria-label":c.label,"aria-pressed":n===c.key,onClick:()=>_(c.key),children:h.jsx("span",{style:{background:c.color}})},c.key))]}):null}),document.body)}function TC(e){const{currentTitle:n,onCommit:r,onBegin:a}=e,o=j.useRef(null),g=j.useRef(!1),_=j.useRef(!1),[c,u]=j.useState(!1),[d,y]=j.useState("");j.useEffect(()=>{c&&(o.current?.focus(),o.current?.select())},[c]);const m=()=>{a?.(),_.current=!1,y(n),u(!0)},w=()=>{_.current=!0,u(!1),y("")},C=()=>{if(!g.current){g.current=!0;try{r(d)}finally{g.current=!1,_.current=!0,u(!1)}}};return{renaming:c,draftTitle:d,inputRef:o,begin:m,cancel:w,commit:C,setDraftTitle:y,handleKeyDown:f=>{if(f.key==="Enter"){f.preventDefault(),C();return}f.key==="Escape"&&(f.preventDefault(),w())},handleBlur:()=>{if(_.current){_.current=!1;return}C()}}}const _7=["n","ne","e","se","s","sw","w","nw"],mp=320,_p=200;function v7({operation:e,active:n,geometry:r,zoom:a,subtitle:o,status:g,minimized:_=!1,maximized:c=!1,accentKey:u=null,children:d,onActivate:y,onClose:m,onMinimize:w,onMaximize:C,onRename:A,onSetAccent:E,onGeometryChange:f,onGeometryCommit:v}){const p=j.useRef(null),S=j.useRef(null),k=j.useRef(null),[L,R]=j.useState(null),M=e.title,T=TC({currentTitle:M,onCommit:A,onBegin:y}),I=u?Gl(u):null,K=["canvas-operation",n?"is-active":"",_?"is-minimized":"",c?"is-maximized":"",y7(g)].filter(Boolean).join(" "),F=W=>{c||W.button===0&&(W.preventDefault(),W.stopPropagation(),y(),S.current={pointerId:W.pointerId,startX:W.clientX,startY:W.clientY,geometry:r,latest:r},W.currentTarget.setPointerCapture(W.pointerId))},G=W=>{if(c)return;const Z=S.current;if(!Z||Z.pointerId!==W.pointerId)return;W.preventDefault(),W.stopPropagation();const ie={...Z.geometry,x:Z.geometry.x+(W.clientX-Z.startX)/a,y:Z.geometry.y+(W.clientY-Z.startY)/a};Z.latest=ie,f(ie)},B=W=>{if(c){S.current=null;return}const Z=S.current;!Z||Z.pointerId!==W.pointerId||(W.preventDefault(),W.stopPropagation(),S.current=null,W.currentTarget.releasePointerCapture(W.pointerId),v(Z.latest))},X=(W,Z)=>{c||(Z.preventDefault(),Z.stopPropagation(),y(),k.current={direction:W,pointerId:Z.pointerId,startX:Z.clientX,startY:Z.clientY,geometry:r,latest:r},Z.currentTarget.setPointerCapture(Z.pointerId))},Y=W=>{if(c)return;const Z=k.current;if(!Z||Z.pointerId!==W.pointerId)return;W.preventDefault(),W.stopPropagation();const ie=b7(Z.geometry,Z.direction,(W.clientX-Z.startX)/a,(W.clientY-Z.startY)/a);Z.latest=ie,f(ie)},z=W=>{if(c){k.current=null;return}const Z=k.current;!Z||Z.pointerId!==W.pointerId||(W.preventDefault(),W.stopPropagation(),k.current=null,W.currentTarget.releasePointerCapture(W.pointerId),v(Z.latest))},q=W=>{W.stopPropagation()},V=W=>{W.stopPropagation(),y()},D=W=>{W.stopPropagation(),y()},H=W=>{W.stopPropagation()},O=()=>{const W=typeof document<"u"?document.activeElement:null;W instanceof HTMLElement&&p.current?.contains(W)&&W.blur(),w()},P=W=>{y(),R(W)};return h.jsxs("article",{ref:p,className:K,style:{left:r.x,top:r.y,width:r.width,height:r.height,zIndex:r.zIndex,...I?{"--op-accent":I}:{}},onPointerDown:y,"data-canvas-operation":!0,"aria-label":`Operation ${M}`,inert:_?!0:void 0,children:[h.jsxs("div",{className:"canvas-operation-titlebar",onPointerDown:F,onPointerMove:G,onPointerUp:B,onPointerCancel:B,"data-canvas-blocker":!0,children:[E?h.jsx("button",{type:"button",className:"canvas-operation-beacon-button",onPointerDown:q,onClick:W=>P(W.currentTarget.getBoundingClientRect()),"aria-label":`Set accent for operation ${M}`,"aria-haspopup":"menu",title:"Set accent",children:h.jsx("span",{className:Wy(g),"aria-hidden":"true"})}):h.jsx("span",{className:Wy(g),"aria-hidden":"true"}),T.renaming?h.jsx("input",{ref:T.inputRef,className:"canvas-operation-rename-input",value:T.draftTitle,"aria-label":`${M} 이름 변경`,onPointerDown:W=>W.stopPropagation(),onChange:W=>T.setDraftTitle(W.target.value),onKeyDown:T.handleKeyDown,onBlur:T.handleBlur}):h.jsx("span",{className:"canvas-operation-title",onPointerDown:V,onDoubleClick:T.begin,title:"Double-click to rename",children:M}),o?h.jsx("span",{className:"canvas-operation-cli",children:o}):null,h.jsx("button",{type:"button",className:"canvas-operation-icon-button",onPointerDown:q,onClick:O,"aria-label":`Minimize operation ${M}`,title:"Minimize operation",children:h.jsx(S7,{})}),C?h.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?h.jsx(x7,{}):h.jsx(w7,{})}):null,h.jsx("button",{type:"button",className:"canvas-operation-icon-button",onPointerDown:q,onClick:m,"aria-label":`Close operation ${M}`,title:"Close operation",children:h.jsx(C7,{})})]}),h.jsx("div",{className:"canvas-operation-terminal",onPointerDown:D,onWheel:H,"data-canvas-blocker":!0,children:d}),!c&&_7.map(W=>h.jsx("div",{className:`canvas-operation-resize canvas-operation-resize--${W}`,onPointerDown:Z=>X(W,Z),onPointerMove:Y,onPointerUp:z,onPointerCancel:z,"data-canvas-blocker":!0,"aria-hidden":"true"},W)),L&&E?h.jsx(m7,{anchor:L,accentKey:u,onSelect:E,onClose:()=>R(null)}):null]})}function b7(e,n,r,a){let{x:o,y:g,width:_,height:c}=e;return n.includes("e")&&(_+=r),n.includes("s")&&(c+=a),n.includes("w")&&(o+=r,_-=r),n.includes("n")&&(g+=a,c-=a),_<mp&&(n.includes("w")&&(o-=mp-_),_=mp),c<_p&&(n.includes("n")&&(g-=_p-c),c=_p),{...e,x:o,y:g,width:_,height:c}}function y7(e){return e==="running"?"is-running is-running--turn":e==="awaiting"?"is-running is-running--awaiting":""}function Wy(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 S7(){return h.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:h.jsx("path",{d:"M3.5 11.5h9",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})})}function w7(){return h.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:h.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 x7(){return h.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:h.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 C7(){return h.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:h.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 E7({rect:e,viewport:n}){const r=Y8(e,n);return h.jsx("div",{className:"canvas-rubber-band",style:{left:r.x,top:r.y,width:r.width,height:r.height},"aria-hidden":"true"})}const k7=.25,A7=2,T7=200,R7=150,Gy=5,L7=.0018;function M7({viewport:e,disabled:n=!1,consumePointerDown:r=!1,onViewportChange:a,onZoom:o,onCreate:g,onConsumePointerDown:_,onClick:c}){const u=j.useRef(null),d=j.useRef(e),[y,m]=j.useState(null),[w,C]=j.useState(!1),[A,E]=j.useState(!1);j.useEffect(()=>{d.current=e},[e]),j.useEffect(()=>{const R=T=>{T.key==="Shift"&&E(!0),!N7(T.target)&&T.code==="Space"&&(T.preventDefault(),C(!0))},M=T=>{T.key==="Shift"&&E(!1),T.code==="Space"&&C(!1)};return window.addEventListener("keydown",R),window.addEventListener("keyup",M),()=>{window.removeEventListener("keydown",R),window.removeEventListener("keyup",M)}},[]);const f=R=>{if(n||qy(R.target)||R.button!==0&&R.button!==1)return;if(R.preventDefault(),r){_?.();return}const M=bp(R),T=R.shiftKey&&R.button===0&&!w?"create":"pan";u.current={pointerId:R.pointerId,mode:T,startScreen:M,currentScreen:M,startViewport:d.current},R.currentTarget.setPointerCapture(R.pointerId),T==="create"&&m(vp(M,M,d.current))},v=R=>{const M=u.current;if(!M||M.pointerId!==R.pointerId)return;R.preventDefault();const T=bp(R);if(u.current={...M,currentScreen:T},M.mode==="pan"){a({...M.startViewport,x:M.startViewport.x+T.x-M.startScreen.x,y:M.startViewport.y+T.y-M.startScreen.y});return}m(vp(M.startScreen,T,d.current))},p=R=>{L(R,!0)},S=R=>{L(R,!1)},k=R=>{if(n||qy(R.target))return;R.preventDefault();const M=bp(R),T=d.current,I=O7(T.zoom*Math.exp(-R.deltaY*L7),k7,A7),K=Wl(M,T);o({x:M.x-K.x*I,y:M.y-K.y*I,zoom:I})},L=(R,M)=>{const T=u.current;if(!T||T.pointerId!==R.pointerId||(u.current=null,R.currentTarget.releasePointerCapture(R.pointerId),m(null),!M))return;const I=Math.abs(T.currentScreen.x-T.startScreen.x),K=Math.abs(T.currentScreen.y-T.startScreen.y);if(I<Gy&&K<Gy){c?.();return}if(T.mode!=="create")return;const F=vp(T.startScreen,T.currentScreen,d.current),G={x:F.x,y:F.y,width:Math.max(F.width,T7),height:Math.max(F.height,R7)};g(G,T.currentScreen)};return{rubberBand:y,spaceActive:w,shiftActive:A,onPointerDown:f,onPointerMove:v,onPointerUp:p,onPointerCancel:S,onWheel:k}}function vp(e,n,r){const a=Wl(e,r),o=Wl(n,r),g=Math.min(a.x,o.x),_=Math.min(a.y,o.y);return{x:g,y:_,width:Math.abs(a.x-o.x),height:Math.abs(a.y-o.y)}}function bp(e){const n=e.currentTarget.getBoundingClientRect();return{x:e.clientX-n.left,y:e.clientY-n.top}}function qy(e){return e instanceof Element&&!!e.closest("[data-canvas-blocker], [data-canvas-operation]")}function N7(e){return e instanceof HTMLElement&&!!e.closest("input, textarea, select, [contenteditable='true']")}function O7(e,n,r){return Math.min(r,Math.max(n,e))}const D7="Shift-drag to create a Shell. Right-click for actions. Drag to pan; scroll to zoom.",B7=560,j7=360;function I7({state:e,catalog:n,canLaunch:r,mapFullscreen:a,radarEnabled:o,perimeterEnabled:g,renderKindIcon:_,onLaunchKind:c,onLaunchAtGeometry:u,onResetView:d,onMaximizeMap:y,onToggleRadar:m,onTogglePerimeter:w,onClose:C,onFocus:A,onSetAccent:E}){const f=j.useRef(null),v=PS(),p=HS(),S=$S(),k=e.activeOperationId,[L,R]=j.useState(null),M=Jl(),[T,I]=j.useState({width:0,height:0}),K=!e.activeTheaterId||e.addingTheater;j.useEffect(()=>{const Z=f.current;if(!Z||typeof ResizeObserver>"u")return;const ie=()=>I({width:Z.clientWidth,height:Z.clientHeight});ie();const he=new ResizeObserver(ie);return he.observe(Z),()=>he.disconnect()},[]);const F=M7({viewport:v.viewport,disabled:K,onViewportChange:Pp,onZoom:US,onCreate:Z=>{if(R(null),e.activeTheaterId&&r){const ie=F7(n);if(!ie)return;const he={...H7(Z),zIndex:ia()};u(ie.pluginId,ie.kind,he)}},consumePointerDown:L!==null,onConsumePointerDown:()=>{R(null)},onClick:z7}),G=(Z,ie)=>{const he=L?.canvasPoint;R(null),he&&c(Z,ie,he)},B=()=>{R(null),d()},X=Z=>{if(Z.target instanceof Element&&Z.target.closest("[data-canvas-blocker], [data-canvas-operation]"))return;Z.preventDefault();const ie=f.current?.getBoundingClientRect();if(!ie)return;const he={x:Z.clientX-ie.left,y:Z.clientY-ie.top};R({anchor:he,canvasPoint:Wl(he,v.viewport)})},Y=new Set(S);j.useEffect(()=>{e.activeOperationId&&Y.has(e.activeOperationId)&&ar(null)},[S,e.activeOperationId]);const z=Object.fromEntries(Object.entries(v.operations).filter(([Z])=>!Y.has(Z))),q=(e.operations??[]).filter(Z=>Z.theaterId===e.activeTheaterId),V=q,D=q.length>0,H=M.operationKinds,P=p!==null&&q.some(Z=>Z.id===p&&!Y.has(Z.id))?p:null,W=U7(v.operations)+1;return h.jsxs("main",{className:`operations-canvas ${F.spaceActive?"is-panning":""} ${F.shiftActive?"is-creating":""} ${P?"is-panel-maximized":""} ${g?"":"is-perimeter-anim-off"}`,onPointerDown:F.onPointerDown,onPointerMove:F.onPointerMove,onPointerUp:F.onPointerUp,onPointerCancel:F.onPointerCancel,onWheel:F.onWheel,onContextMenu:X,ref:f,children:[h.jsx(p7,{viewport:v.viewport,backgroundAnimationEnabled:o}),h.jsx("div",{className:"operations-canvas-world",style:{transform:`translate(${v.viewport.x}px, ${v.viewport.y}px) scale(${v.viewport.zoom})`},children:V.map(Z=>{const ie=v.operations[Z.id]??Z.geometry??yp(Z),he=P===Z.id,te=he?$7(v.viewport,T,W):ie;return G7(Z,{active:k===Z.id,geometry:te,operationKindRegistry:H,status:e.operationStatus[Z.id],theme:e.activeTheme,viewportZoom:v.viewport.zoom,minimized:Y.has(Z.id),maximized:he,accentKey:v.operationAccent[Z.id]??W7(Z),onActivate:()=>{ar(Z.id),he||zp(Z.id,v.operations[Z.id]??Z.geometry??yp(Z))},onClose:()=>{e.activeOperationId===Z.id&&ar(null),P===Z.id&&lo(),C(Z.id)},onMinimize:()=>{e.activeOperationId===Z.id&&ar(null),AA(Z.id)},onMaximize:()=>{he?lo():(ar(Z.id),Ol(Z.id))},onRename:$=>{V7(Z.id,$)},onSetAccent:$=>{E(Z.id,$)},onGeometryChange:$=>{he||zp(Z.id,$)},onGeometryCommit:$=>{he||K7(Z.id,oo().operations[Z.id]??$)}})})}),D?null:h.jsxs("div",{className:"operations-canvas-empty","data-canvas-blocker":!0,children:[h.jsx("span",{className:"operations-canvas-empty-mark","aria-hidden":"true"}),h.jsx("p",{children:e.activeTheaterId?D7:"Add a Theater from the top bar to start operations."})]}),F.rubberBand?h.jsx(E7,{rect:F.rubberBand,viewport:v.viewport}):null,L?h.jsx(Iu,{anchor:L.anchor,viewportBounds:P7(f.current),placement:"cursor",catalog:n,canLaunch:r,mapFullscreen:a,radarEnabled:o,perimeterEnabled:g,renderKindIcon:_,onLaunchKind:G,onResetView:B,onMaximizeMap:y,onToggleRadar:m,onTogglePerimeter:w,onClose:()=>R(null)},`${L.anchor.x}:${L.anchor.y}`):null,h.jsx(l7,{operations:z,pluginOperations:Object.fromEntries(q.filter(Z=>!Y.has(Z.id)).map(Z=>[Z.id,{theaterId:Z.theaterId,geometry:v.operations[Z.id]??Z.geometry??yp(Z)}])),viewport:v.viewport,canvasSize:T,onJump:Z=>Pp({x:T.width/2-Z.x*v.viewport.zoom,y:T.height/2-Z.y*v.viewport.zoom,zoom:v.viewport.zoom})})]})}function P7(e){if(!e)return;const n=e.getBoundingClientRect();return{width:n.width,height:n.height}}function z7(){if(typeof document<"u"){const e=document.activeElement;e instanceof HTMLElement&&e.blur()}ar(null)}function H7(e){return{x:e.x,y:e.y,width:e.width,height:e.height,zIndex:0}}function yp(e){return e.geometry??{x:0,y:0,width:B7,height:j7,zIndex:0}}function $7(e,n,r){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:r}}function U7(e){return Object.values(e).reduce((n,r)=>Math.max(n,r.zIndex),0)}function F7(e){const n=e.flatMap(r=>r.kinds.filter(a=>a.disabled!==!0).map(a=>({pluginId:r.id,kind:a})));return n.find(({kind:r})=>r.type==="shell")??n[0]??null}function W7(e){return typeof e.accent=="string"?e.accent:null}function G7(e,n){const r=n.operationKindRegistry.find(g=>g.pluginId===e.pluginId&&g.type===e.type),a=n.geometry;if(!r?.render)return null;const o=ph(()=>{Pi(null).then(zi).catch(()=>{})});return h.jsx(v7,{operation:e,active:n.active,geometry:a,zoom:n.viewportZoom,subtitle:r.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:h.jsx(Ig,{fallback:h.jsx("div",{className:"fc-plugin-error",children:"Plugin operation failed to render."}),children:h.jsx(q7,{active:n.active,capabilities:o,descriptor:r,geometry:a,operation:e,theme:n.theme,viewportZoom:n.viewportZoom,onActivate:n.onActivate,onClose:n.onClose,onGeometryChange:n.onGeometryChange})})},e.id)}function q7({active:e,capabilities:n,descriptor:r,geometry:a,operation:o,theme:g,viewportZoom:_,onActivate:c,onClose:u,onGeometryChange:d}){return r.render?r.render({operationId:o.id,theaterId:o.theaterId,pluginId:o.pluginId,type:o.type,operation:o,geometry:a,active:e,zoom:_,theme:g,api:n.api,lifecycle:n.lifecycle,terminal:n.terminal,notifications:n.notifications,operations:n.operations,preferences:n.preferences,status:n.status,onActivate:c,onClose:u,onGeometryChange:d}):null}async function K7(e,n){await fetch(`/api/v1/operations/${encodeURIComponent(e)}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({geometry:n})})}async function V7(e,n){await ew(e,n),await Pi(null).then(zi)}const kg="fleet-console.rail.activePanelId";function Y7(){try{return localStorage.getItem(kg)}catch{return null}}function RC(e){try{e===null?localStorage.removeItem(kg):localStorage.setItem(kg,e)}catch{}}const Ag=new Set;let ql={activeRailPanelId:Y7()};function LC(){for(const e of Ag)e()}function X7(e){return Ag.add(e),()=>{Ag.delete(e)}}function Z7(){return ql}function J7(e){const n=ql.activeRailPanelId===e?null:e;ql={activeRailPanelId:n},RC(n),LC()}function Q7(){ql.activeRailPanelId!==null&&(ql={activeRailPanelId:null},RC(null),LC())}function MC(){return j.useSyncExternalStore(X7,Z7).activeRailPanelId}function NC(e){if(!e.operationsViewActive||!e.activeOperationId)return new Set;const n=e.operations.find(r=>r.id===e.activeOperationId);return!n||n.theaterId!==e.activeTheaterId?new Set:new Set([n.id])}function OC(e,n){const r=new Set(n.map(a=>a.id));return e.filter(a=>r.has(a.operationId))}function DC(e,n){const r=[],a=[];for(const o of e)n.has(o.operationId)?a.push(o):r.push(o);return{hidden:r,visible:a}}function Tg(e){const n=new Map;for(const r of[...e].sort((a,o)=>o.lastRaisedSeq-a.lastRaisedSeq)){const a=r.theaterId??"__unknown__",o=n.get(a)??{theaterId:r.theaterId,theaterLabel:r.theaterLabel,notifications:[],totalCount:0};o.notifications.push(r),o.totalCount+=r.count,n.set(a,o)}return[...n.values()].sort((r,a)=>{const o=r.notifications[0]?.lastRaisedSeq??0;return(a.notifications[0]?.lastRaisedSeq??0)-o})}function BC(e,n){return n.globalMute||n.dnd?[]:e.filter(r=>!r.theaterId||n.mutedTheaterIds[r.theaterId]!==!0)}const eB={ended:"Stood down","input-waiting":"Awaiting orders"},tB={id:"alerts",title:"Alerts",icon:()=>h.jsx(iB,{}),render:()=>h.jsx(nB,{})};function nB(){const e=$r(),n=uh(),[r,a]=j.useState(!1),o=j.useMemo(()=>OC(Object.values(e.operationNotifications),e.operations),[e.operationNotifications,e.operations]),g=NC(e),_=DC(o,g).hidden,c=BC(_,e.notificationPreferences),u=Tg(c),d=Tg(_),y=Rg(u,"input-waiting"),m=Rg(u,"ended"),w=u.length===0,C=j.useCallback(A=>{dh(A.operationId),n("/operations")},[n]);return h.jsxs("div",{className:"alerts-panel-body","aria-live":"polite","aria-label":"Operation alerts",children:[h.jsxs("div",{className:"alerts-panel-toolbar",children:[h.jsxs("div",{className:"alerts-panel-tallies","aria-hidden":"true",children:[y>0?h.jsx("span",{className:"notification-tally is-input-waiting",children:y}):null,m>0?h.jsx("span",{className:"notification-tally is-ended",children:m}):null,w?h.jsx("span",{className:"alerts-panel-tally-empty",children:"—"}):null]}),h.jsx("button",{type:"button",className:`alerts-panel-settings-btn${r?" is-active":""}`,onClick:()=>a(A=>!A),"aria-expanded":r,"aria-label":"Notification settings",title:"Notification settings",children:h.jsx(oB,{})})]}),r?h.jsx(rB,{groups:d}):null,w?h.jsx("p",{className:"notification-dock-empty",children:"No active alerts"}):h.jsx("div",{className:"notification-dock-deck",children:u.map(A=>h.jsxs("section",{className:"notification-cluster-group",children:[h.jsxs("header",{className:"notification-cluster-group-head",children:[h.jsx("span",{className:"notification-cluster-theater",children:A.theaterLabel}),h.jsx("span",{className:"notification-cluster-group-count",children:A.totalCount})]}),h.jsx("ul",{className:"notification-cluster-roster",children:A.notifications.map(E=>h.jsxs("li",{className:`notification-row is-${E.kind}`,children:[h.jsx("span",{className:"notification-row-beacon","aria-hidden":"true"}),h.jsxs("span",{className:"notification-row-body",children:[h.jsx("span",{className:"notification-row-op",children:E.operationLabel}),h.jsx("span",{className:"notification-row-state",children:eB[E.kind]})]}),E.count>1?h.jsx("span",{className:"notification-row-count",children:E.count}):null,h.jsx("button",{type:"button",className:"notification-row-move",onClick:()=>C(E),"aria-label":`Open ${A.theaterLabel} ${E.operationLabel}`,children:"Open"})]},E.operationId))})]},A.theaterId??"__unknown__"))})]})}function iB(){const e=$r(),r=MC()==="alerts",a=j.useMemo(()=>OC(Object.values(e.operationNotifications),e.operations),[e.operationNotifications,e.operations]),o=NC(e),g=DC(a,o).hidden,_=BC(g,e.notificationPreferences),c=Tg(_),u=c.reduce((E,f)=>E+f.totalCount,0),d=Rg(c,"input-waiting"),y=j.useMemo(()=>_.reduce((E,f)=>Math.max(E,f.lastRaisedSeq),0),[_]),m=j.useRef(y),[w,C]=j.useState(0);j.useEffect(()=>{y>m.current&&!r&&C(E=>E+1),m.current=y},[y,r]);const A=u===0?"muted":d>0?"awaiting":"ended";return h.jsxs("span",{className:`alerts-icon is-${A}`,"aria-hidden":"true",children:[h.jsx(aB,{}),u>0?h.jsx("span",{className:"alerts-icon-badge",children:u}):null,w>0?h.jsx("span",{className:"alerts-icon-pulse","aria-hidden":"true"},w):null]})}function rB({groups:e}){const n=$r(),r=sB(e,n.notificationPreferences.mutedTheaterIds,n.theaters);return h.jsxs("div",{className:"notification-cluster-settings",role:"dialog","aria-label":"Notification settings",children:[h.jsx("p",{className:"notification-cluster-settings-eyebrow",children:"Display"}),h.jsxs("label",{className:"notification-cluster-setting",children:[h.jsx("input",{type:"checkbox",checked:n.notificationPreferences.globalMute,onChange:a=>YT(a.currentTarget.checked)}),h.jsx("span",{children:"Mute all"})]}),h.jsxs("label",{className:"notification-cluster-setting",children:[h.jsx("input",{type:"checkbox",checked:n.notificationPreferences.dnd,onChange:a=>XT(a.currentTarget.checked)}),h.jsx("span",{children:"Do not disturb"})]}),r.length>0?h.jsx("p",{className:"notification-cluster-settings-eyebrow",children:"By Theater"}):null,r.map(a=>h.jsxs("label",{className:"notification-cluster-setting",children:[h.jsx("input",{type:"checkbox",checked:a.theaterId?n.notificationPreferences.mutedTheaterIds[a.theaterId]===!0:!1,onChange:()=>{a.theaterId&&ZT(a.theaterId)}}),h.jsx("span",{children:a.theaterLabel})]},a.theaterId))]})}function sB(e,n,r){const a=new Map;for(const o of e)o.theaterId&&a.set(o.theaterId,o);for(const o of Object.keys(n))a.has(o)||a.set(o,{theaterId:o,theaterLabel:r.find(g=>g.id===o)?.label??o,notifications:[],totalCount:0});return[...a.values()]}function Rg(e,n){let r=0;for(const a of e)for(const o of a.notifications)o.kind===n&&(r+=o.count);return r}function aB(){return h.jsxs("svg",{viewBox:"0 0 16 16","aria-hidden":"true",width:"16",height:"16",children:[h.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"}),h.jsx("path",{d:"M6.5 12a1.5 1.5 0 0 0 3 0",fill:"none",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round"})]})}function oB(){return h.jsxs("svg",{viewBox:"0 0 16 16","aria-hidden":"true",width:"15",height:"15",children:[h.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"}),h.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 lB(e,n){const a=new URLSearchParams().toString();return mo(aa(e,`/search${a?`?${a}`:""}`))}async function cB(e,n,r){return mo(aa(e,`/entry/${encodeURIComponent(n)}`))}async function jC(e,n="pending"){return mo(aa(e,`/drydock?status=${encodeURIComponent(n)}`))}async function uB(e,n){return mo(aa(e,`/drydock/${encodeURIComponent(n)}`))}async function hB(e,n,r,a){const o={action:r};return a!==void 0&&(o.reason=a),pB(aa(e,`/drydock/${encodeURIComponent(n)}/decision`),o)}async function dB(e){return mo(aa(e,"/conflicts"))}async function fB(e,n){return mo(aa(e,`/conflicts/${encodeURIComponent(n)}`))}function aa(e,n){const r=n.startsWith("/")?n:`/${n}`;return e?`/console/codex/w/${encodeURIComponent(e)}/api${r}`:`/console/codex/api${r}`}async function mo(e){const n=await fetch(e,{headers:{accept:"application/json"}});if(!n.ok)throw new Error(await IC(e,n));return n.json()}async function pB(e,n){const r=await fetch(e,{method:"POST",headers:{"content-type":"application/json",accept:"application/json"},body:JSON.stringify(n)});if(!r.ok)throw new Error(await IC(e,r));return r.json()}async function IC(e,n){return(await n.json().catch(()=>null))?.error??`${e} request failed: ${n.status}`}const Lg=new Set,sh={index:[],conflicts:[],pendingPatchCount:0,currentWorkspaceId:null,loading:!1,error:null};function eo(){return sh}function PC(e){return Lg.add(e),()=>Lg.delete(e)}function Ky(e){Pu({currentWorkspaceId:e})}async function ah(){Pu({loading:!0,error:null});try{const e=sh.currentWorkspaceId,[n,r]=await Promise.all([lB(e),jC(e,"pending").catch(()=>null)]);Pu({index:n.entries,pendingPatchCount:r?.pendingCount??0,loading:!1})}catch(e){Pu({loading:!1,error:gB(e)})}}function Pu(e){Object.assign(sh,e);for(const n of Lg)n(sh)}function gB(e){return e instanceof Error?e.message:String(e)}const mB=120;function Vi(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""")}function _B(e,n){if(!n)return Vi(e);const r=e.toLowerCase().indexOf(n.toLowerCase());return r===-1?Vi(e):Vi(e.slice(0,r))+`<mark>${Vi(e.slice(r,r+n.length))}</mark>`+Vi(e.slice(r+n.length))}function vB(e){return`<span class="codex-nav-tag">${Vi(e)}</span>`}function bB(e,n,r){const a=n?e.tags.some(c=>c.toLowerCase().includes(n.toLowerCase())):!1,o=e.tags.slice(0,3).map(vB).join(""),g=Vi(e.status??"current"),_=Vi(e.updated??"");return`<button
|
|
213
|
-
class="codex-nav-entry${r?" is-current":""}"
|
|
214
|
-
data-entry-id="${Vi(e.id)}"
|
|
215
|
-
type="button"
|
|
216
|
-
${r?'aria-current="page"':""}
|
|
217
|
-
title="${Vi(e.title)}"
|
|
218
|
-
>
|
|
219
|
-
<span class="t">${_B(e.title,a?"":n)}</span>
|
|
220
|
-
${o?`<span class="tg">${o}</span>`:""}
|
|
221
|
-
<span class="meta">${g} · ${_}</span>
|
|
222
|
-
</button>`}function yB(e,n){if(!n)return e;const r=n.toLowerCase();return e.filter(a=>a.title.toLowerCase().includes(r)||a.tags.some(o=>o.toLowerCase().includes(r)))}function SB(e,n){let r="",a=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 g=e.querySelector(".codex-nav-search-input"),_=e.querySelector("#codex-nav-list"),c=e.querySelector("#codex-nav-eyebrow"),u=e.querySelector("#codex-nav-drydock-badge");function d(C){const A=yB(C.index,r);if(c.textContent=`Entries · ${A.length}`,u.textContent=String(C.pendingPatchCount),u.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">${Vi(C.error)}</div>`;return}if(A.length===0){_.innerHTML=`<div class="codex-nav-empty">${r?"No entries match.":"No entries."}</div>`;return}_.innerHTML=A.map(E=>bB(E,r,E.id===a)).join("")}function y(C){const A=C.target;if(!(A instanceof Element))return;const E=A.closest("[data-entry-id]");if(E?.dataset.entryId){a=E.dataset.entryId,d(eo()),n.onRequest({kind:"entry",id:a});return}const f=A.closest("[data-action]");if(f?.dataset.action==="drydock"){n.onRequest({kind:"drydock"});return}if(f?.dataset.action==="conflicts"){n.onRequest({kind:"conflicts"});return}}function m(){o!==null&&clearTimeout(o),o=setTimeout(()=>{r=g.value,d(eo())},mB)}e.addEventListener("click",y),g.addEventListener("input",m);const w=PC(C=>d(C));return d(eo()),{destroy(){w(),e.removeEventListener("click",y),g.removeEventListener("input",m),o!==null&&clearTimeout(o),e.innerHTML=""},setTheater(C){r="",a=null,g&&(g.value=""),d(eo())}}}function wB(e,n){n.initialTheaterId&&Ky(n.initialTheaterId);const r=SB(e,{initialTheaterId:n.initialTheaterId,onRequest:n.onRequest}),a=PC(()=>{});ah();const o=r.destroy.bind(r);return{destroy(){a(),o()},setTheater(g){Ky(g),ah(),r.setTheater(g)}}}function xt(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">")}function uo(e){return xt(e).replace(/"/g,""")}const xB="contextual-knowledge-not-instructions";function CB(e,n){const r=e.frontmatter.whyThisMatched,a=$C(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">${zu(zC(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">${zu(HC(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">${zu(a)} tok</span>
|
|
259
|
-
</button>
|
|
260
|
-
${r?`
|
|
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(r)}</div>
|
|
265
|
-
`:""}
|
|
266
|
-
</div>
|
|
267
|
-
`}function zC(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:Rm(e.body)};return JSON.stringify({...n,token_estimate:zu(JSON.stringify(n))},null,2)}function HC(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",Rm(e.body)].join(`
|
|
268
|
-
`)}function $C(e,n){const r=new Set([...e.frontmatter.related??[]]),a=n.filter(o=>r.has(o.id)).sort((o,g)=>o.title.localeCompare(g.title));return[`<fleet-wiki-context boundary="${xB}">`,"# 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",Rm(e.body),"","### Related Entries",...a.length>0?a.map(o=>`- [[wiki:${o.id}]] — ${o.title}`):["- (none)"],"","</fleet-wiki-context>"].join(`
|
|
269
|
-
`)}function zu(e){return Math.max(1,Math.ceil(e.length/4))}function Rm(e){return e.replace(/\s+/g," ").trim().slice(0,240)||"(empty)"}function EB(e){const n=e.tags.map(a=>`<span class="chip chip-tag">${xt(a)}</span>`).join(""),r=AB(e);return`
|
|
270
|
-
<div class="meta-chips">
|
|
271
|
-
${n}
|
|
272
|
-
${r}
|
|
273
|
-
<span class="chip">Updated ${xt(kB(e.updated))}</span>
|
|
274
|
-
</div>
|
|
275
|
-
`}function UC(e){return e.map(n=>`<span class="chip chip-muted">${xt(n)}</span>`).join("")}function kB(e){const n=new Date(e);return Number.isNaN(n.getTime())?e:n.toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"})}function AB(e){const n=TB(e);return n?`<span class="chip ${n.tone==="deprecated"?"chip-coral":n.tone==="stale"?"chip-stale":""}" title="${uo(n.title)}">${xt(n.label)}</span>`:""}function TB(e,n=new Date){const r=e.status,a=typeof e.revalidateAfter=="string"&&!Number.isNaN(Date.parse(e.revalidateAfter))&&Date.parse(e.revalidateAfter)<n.getTime();return r==="deprecated"||r==="superseded"?{label:r,tone:"deprecated",title:a?`${r} · stale`:r}:a?{label:"stale",tone:"stale",title:e.revalidateAfter??"stale"}:r==="current"||r==="draft"?{label:r,tone:"neutral",title:r}:null}const RB="active";function Vy(e){return e.length===0?'<p class="toc-empty">No sections</p>':e.map(n=>`<a class="ti toc-level-${n.level}" href="#${uo(n.id)}" data-toc-id="${uo(n.id)}">${xt(n.text)}</a>`).join("")}function Yy(e,n,r){if(n.length===0||typeof IntersectionObserver>"u")return()=>{};const a=[...r.querySelectorAll("[data-toc-id]")],o=new Set(n.map(d=>d.id)),g=[...e.querySelectorAll("h2[id], h3[id]")].filter(d=>o.has(d.id));if(a.length===0||g.length===0)return()=>{};const _=e.closest(".codex-reading-sheet-read"),c=new Set,u=new IntersectionObserver(d=>{for(const m of d){const w=m.target instanceof HTMLElement?m.target.id:"";w&&(m.isIntersecting?c.add(w):c.delete(w))}const y=LB(g,c)??MB(g,_)??g[0]?.id??null;Xy(a,y)},{root:_,rootMargin:"-20% 0px -65% 0px",threshold:[0,.2,.6,1]});for(const d of g)u.observe(d);return Xy(a,g[0]?.id??null),()=>u.disconnect()}function LB(e,n){for(const r of e)if(n.has(r.id))return r.id;return null}function MB(e,n){const r=n?n.getBoundingClientRect().top:0;let a=null;for(const o of e)if(o.getBoundingClientRect().top-r<=80)a=o.id;else break;return a}function Xy(e,n){for(const r of e){const a=!!(n&&r.dataset.tocId===n);r.classList.toggle(RB,a),a?r.setAttribute("aria-current","location"):r.removeAttribute("aria-current")}}function Zy(e){return`/entry/${encodeURIComponent(e)}`}const FC={create_wiki:"+",update_wiki:"↻"},WC={create_wiki:"Create",update_wiki:"Update"};function NB(e,n){let r=!1,a=null,o=n,g="idle",_=null,c=null,u=null;tC(e);function d(v){const p=v.target;if(!(p instanceof Element))return;const S=p.closest("[data-patch-id]");if(S){v.preventDefault();const I=S.dataset.patchId||void 0;o.onPatchOpen?.(I);return}const k=p.closest("[data-entry-id]");if(k?.dataset.entryId){v.preventDefault(),o.onRelatedClick(k.dataset.entryId);return}const L=p.closest("[data-drydock-action]");if(L){v.preventDefault(),y(L.dataset.drydockAction);return}const R=p.closest("[data-action]");if(!R)return;const M=R.dataset.action,T=e._currentEntry;if(T){if(M==="copy-compact-context")navigator.clipboard.writeText(zC(T));else if(M==="copy-provenance-context")navigator.clipboard.writeText(HC(T));else if(M==="copy-related-context")navigator.clipboard.writeText($C(T,eo().index));else if(M==="toggle-why-matched"){const I=R.nextElementSibling;I?.classList.contains("context-why-matched")&&(I.hidden=!I.hidden)}}}function y(v){if(v){if(v==="back"){o.onPatchOpen?.(void 0);return}if(v==="approve"){g="approving",_=null,w();return}if(v==="approve-confirm"){m("approve",void 0);return}if(v==="reject"){g="rejecting",_=null,w();return}if(v==="reject-submit"){const p=e.querySelector("#queue-reject-reason")?.value.trim();if(!p){_="Rejection reason is required.",w();return}m("reject",p);return}if(v==="cancel"){g="idle",_=null,w();return}}}async function m(v,p){if(u){g="submitting",_=null,w();try{await hB(o.theaterId,u,v,p),o.onDecided?.()}catch(S){g=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=GC(g,_))}e.addEventListener("click",d);function C(){a?.(),a=null}async function A(v){if(!r){Sp(e,n.tocContainer),C();try{const p=await cB(o.theaterId,v);if(r)return;const{index:S}=eo(),{html:k,toc:L}=gg(p.body,{omitDuplicateTitle:p.frontmatter.title,resolveWikiLink:M=>Zy(M)});e._currentEntry=p,e.innerHTML=`
|
|
276
|
-
<article class="document">
|
|
277
|
-
<header class="document-header">
|
|
278
|
-
${OB(p.frontmatter.title)}
|
|
279
|
-
<h1>${xt(p.frontmatter.title)}</h1>
|
|
280
|
-
${EB(p.frontmatter)}
|
|
281
|
-
</header>
|
|
282
|
-
<div class="markdown-body" id="codex-reader-body">
|
|
283
|
-
${k}
|
|
284
|
-
</div>
|
|
285
|
-
${DB(p.frontmatter.id,p.frontmatter.tags,S)}
|
|
286
|
-
${CB(p,S)}
|
|
287
|
-
</article>
|
|
288
|
-
`,n.tocContainer.innerHTML=Vy(L);const R=e.querySelector("article");R&&L.length>0&&(a=Yy(R,L,n.tocContainer))}catch(p){r||wp(e,n.tocContainer,p)}}}async function E(v){if(!r){Sp(e,n.tocContainer),C(),c=null,u=null,g="idle",_=null;try{if(v){const p=await uB(o.theaterId,v);if(r)return;c=p.meta,u=v;const{html:S,toc:k}=gg(p.wikiEntry.body,{omitDuplicateTitle:p.wikiEntry.title,resolveWikiLink:R=>Zy(R)});e.innerHTML=IB(p,S),n.tocContainer.innerHTML=Vy(k);const L=e.querySelector("article");L&&k.length>0&&(a=Yy(L,k,n.tocContainer))}else{const p=await jC(o.theaterId,"pending");if(r)return;n.tocContainer.innerHTML="",e.innerHTML=BB(p.items,"Drydock — Pending Patches")}}catch(p){r||wp(e,n.tocContainer,p)}}}async function f(v){if(!r){Sp(e,n.tocContainer),C();try{if(v){const p=await fB(o.theaterId,v);if(r)return;n.tocContainer.innerHTML="",e.innerHTML=HB(p)}else{const p=await dB(o.theaterId);if(r)return;n.tocContainer.innerHTML="",e.innerHTML=$B(p)}}catch(p){r||wp(e,n.tocContainer,p)}}}return n.kind==="entry"&&n.initialEntryId?A(n.initialEntryId):n.kind==="drydock"?E(n.subId):n.kind==="conflicts"&&f(n.subId),{destroy(){r=!0,e.removeEventListener("click",d),C()},async setEntry(v){await A(v)},async navigateSub(v){n.kind==="drydock"?await E(v):n.kind==="conflicts"&&await f(v)},refreshCallbacks(v){o={...o,...v}}}}function Sp(e,n){e.innerHTML='<div class="codex-reader-loading" aria-live="polite" aria-busy="true">Loading…</div>',n.innerHTML=""}function wp(e,n,r){const a=r instanceof Error?r.message:String(r);e.innerHTML=`<div class="codex-reader-error" role="alert">${xt(a)}</div>`,n.innerHTML=""}function OB(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 DB(e,n,r){const a=new Set(n),o=r.filter(g=>g.id!==e).map(g=>({entry:g,matchingTags:g.tags.filter(_=>a.has(_))})).filter(g=>g.matchingTags.length>0).sort((g,_)=>_.matchingTags.length-g.matchingTags.length||g.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(g=>`<button class="related-card" type="button" data-entry-id="${uo(g.entry.id)}">
|
|
300
|
-
<strong>${xt(g.entry.title)}</strong>
|
|
301
|
-
<span>${UC(g.matchingTags)}</span>
|
|
302
|
-
</button>`).join("")}
|
|
303
|
-
</div>
|
|
304
|
-
</section>
|
|
305
|
-
`}function BB(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(jB).join("")}
|
|
318
|
-
</div>
|
|
319
|
-
</article>
|
|
320
|
-
`}function jB(e){const n=e.op??"create_wiki",r=FC[n]??"?",a=WC[n]??"Patch",o=e.target??e.id,_=[UB(e.meta.createdAt)].filter(Boolean);return`
|
|
321
|
-
<button class="queue-row" type="button" data-patch-id="${uo(e.id)}" aria-label="${uo(a+": "+o)}">
|
|
322
|
-
<span class="queue-row-badge" aria-hidden="true">
|
|
323
|
-
<span class="op-badge">${r}</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 IB(e,n){const{patch:r,meta:a,wikiEntry:o,targetExists:g}=e,_=r.frontmatter.op,c=FC[_]??"?",u=WC[_]??"Patch",d=g?"기존 문서 대체":"신규 문서 생성",y=a.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(u)}</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(r.frontmatter.target)} · v${o.version} · ${xt(d)}</p>
|
|
344
|
-
${PB(r.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?GC("idle",null):zB(a)}
|
|
351
|
-
</div>
|
|
352
|
-
</article>
|
|
353
|
-
`}function PB(e,n){const r=[];return e&&r.push(`<span class="meta-chip">${xt(e)}</span>`),n.length>0&&r.push(UC(n)),r.length===0?"":`<div class="meta-chips">${r.join("")}</div>`}function GC(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 zB(e){const n=e.status==="accepted",r=n?"✓ Approved":"✕ Rejected",a=n?"queue-decision-decided--approve":"queue-decision-decided--reject",o=e.reason?` · ${xt(e.reason)}`:"";return`<p class="queue-decision-decided ${a}">${r}${o}</p>`}function HB(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 $B(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 UB(e){try{const r=(Date.now()-new Date(e).getTime())/(1e3*60*60);if(r<1)return"< 1h ago";if(r<24)return`${Math.floor(r)}h ago`;const a=r/24;return a<7?`${Math.floor(a)}d ago`:a<30?`${Math.floor(a/7)}w ago`:`${Math.floor(a/30)}mo ago`}catch{return""}}let Xs=null,Kl=null,qC=null,xs=null,Zs=null,Ss=null,Hu=null,xp=null,$u,Mg=0;function Jy(e){qC=e}function FB(e,n){const r=qB();r.parentElement!==e&&e.appendChild(r),Kl||(Kl=wB(r,{initialTheaterId:n,onRequest:a=>qC?.(a)}))}function WB(e){Kl?.setTheater(e)}function KC(e,n,r){const a=KB(),o=VB(),g=a.parentElement,_=r.kind==="entry"&&Hu==="entry"&&r.initialEntryId===xp;g&&g!==e&&(Mg=g.scrollTop),a.parentElement!==e&&e.appendChild(a),o.parentElement!==n&&n.appendChild(o),!Ss||Hu!==r.kind?(Ss?.destroy(),Ss=NB(a,{...r,tocContainer:o}),Hu=r.kind,$u=r.subId):r.kind==="entry"&&r.initialEntryId&&r.initialEntryId!==xp?Ss.setEntry(r.initialEntryId):(r.kind==="drydock"||r.kind==="conflicts")&&r.subId!==$u&&($u=r.subId,Ss.navigateSub(r.subId)),xp=r.kind==="entry"?r.initialEntryId??null:null,Ss.refreshCallbacks({onPatchOpen:r.onPatchOpen,onDecided:r.onDecided,onRelatedClick:r.onRelatedClick,onClose:r.onClose,theaterId:r.theaterId});const c=_?Mg:0;requestAnimationFrame(()=>{e.scrollTop=c})}function GB(){const e=xs?.parentElement;e&&(Mg=e.scrollTop)}function VC(){Ss?.destroy(),Ss=null,Hu=null,$u=void 0,xs?.parentElement&&xs.parentElement.removeChild(xs),Zs?.parentElement&&Zs.parentElement.removeChild(Zs)}function Qy(){VC(),Kl?.destroy(),Kl=null,Xs?.parentElement&&Xs.parentElement.removeChild(Xs)}function qB(){return Xs||(Xs=document.createElement("div"),Xs.className="codex-host"),Xs}function KB(){return xs||(xs=document.createElement("div"),xs.className="codex-reader-host"),xs}function VB(){return Zs||(Zs=document.createElement("div"),Zs.className="codex-toc-host"),Zs}const YB={id:"codex",title:"Codex",icon:()=>h.jsx(JB,{}),render:()=>h.jsx(XB,{})};function XB(){const e=$r(),n=j.useRef(null),r=j.useRef(null),a=j.useRef(null),o=e.codexReader,g=o!==null,_=e.codexReaderExpanded,c=e.theaters.find(w=>w.id===e.activeTheaterId)??null,u=c?.id??null,d=!!c?.hasWiki,y=e.theaters.length>0,m=o?`${o.kind}:${o.kind==="entry"?o.entryId:o.kind==="drydock"?o.patchId??"":o.id??""}`:null;return j.useEffect(()=>{if(!d){Qy();return}return()=>{Qy()}},[d]),j.useEffect(()=>{if(!d||!u)return;const w=n.current;if(w)return FB(w,u),Jy(C=>{C.kind==="entry"?jr({kind:"entry",entryId:C.id}):C.kind==="drydock"?jr({kind:"drydock",patchId:C.patchId}):C.kind==="conflicts"&&jr({kind:"conflicts",id:C.id})}),()=>{Jy(null)}},[d,u,g]),j.useEffect(()=>{d&&u&&WB(u)},[u,d]),j.useEffect(()=>{if(!d||!u||!g||_||!r.current||!a.current||!o)return;const w=o.kind,C=w==="drydock"?o.patchId:w==="conflicts"?o.id:void 0;KC(r.current,a.current,{initialEntryId:w==="entry"?o.entryId:"",kind:w,subId:C,theaterId:u,onRelatedClick:A=>jr({kind:"entry",entryId:A}),onClose:()=>P1(),onPatchOpen:A=>jr({kind:"drydock",patchId:A}),onDecided:()=>{ah(),jr({kind:"drydock",patchId:void 0})}})},[d,u,g,_,m]),j.useEffect(()=>{g||VC()},[g]),d?g?h.jsxs("div",{className:"codex-rail-host is-split",children:[h.jsxs("div",{className:"codex-doc-pane",children:[h.jsxs("div",{className:"codex-doc-pane-head",children:[h.jsx("button",{className:"codex-doc-expand",type:"button","aria-label":"Expand reading sheet","data-codex-expand":"true",onClick:Mu,children:"⤢ Expand"}),h.jsx("button",{className:"codex-reading-sheet-close",type:"button","aria-label":"Close document pane",onClick:P1,children:"✕"})]}),h.jsx("div",{ref:r,className:"codex-doc-scroll"}),h.jsx("div",{ref:a,className:"codex-doc-toc-inline"})]}),h.jsx("div",{ref:n,className:"codex-nav-pane"})]}):h.jsx("div",{ref:n,className:"codex-rail-host"}):h.jsx(ZB,{activeTheater:c,hasTheaters:y})}function ZB({activeTheater:e,hasTheaters:n}){return n?h.jsxs("section",{className:"codex-empty-state",children:[h.jsx("p",{className:"codex-empty-eyebrow",children:"Codex unavailable"}),h.jsx("h1",{children:e?.label??"This Theater"}),h.jsx("p",{children:"This Theater does not have Fleet Wiki data mounted."})]}):h.jsxs("section",{className:"codex-empty-state",children:[h.jsx("p",{className:"codex-empty-eyebrow",children:"Codex"}),h.jsx("h1",{children:"Add a Theater"}),h.jsx("p",{children:"Use the top bar Theater control to choose a project root before opening Codex."})]})}function JB(){return h.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:[h.jsx("circle",{cx:"12",cy:"12",r:"9"}),h.jsx("circle",{cx:"12",cy:"12",r:"3.2",fill:"currentColor",stroke:"none",opacity:"0.16"}),h.jsx("path",{d:"M12 3v3.6M12 17.4V21M3 12h3.6M17.4 12H21"}),h.jsx("path",{d:"M12 8.6 14.2 12 12 15.4 9.8 12Z",fill:"currentColor",stroke:"none"})]})}const QB=[tB,YB];function ej(e="right"){const{railPanels:n}=Jl();return e==="right"?n.filter(r=>(r.side??"right")==="right"):n}const tj=360;function nj(e){const{codexReader:n}=$r();return e==="codex"&&n!==null?tj:0}const YC=240,ij=312,XC="fleet-console.rail.panelWidth";function rj(){try{const e=localStorage.getItem(XC);if(e!==null){const n=parseInt(e,10);if(!isNaN(n)&&n>=YC)return n}}catch{}return ij}function sj({theaterId:e,api:n}){const r=MC(),a=ej(),o=QB,_=[...o,...a].find(v=>v.id===r)??null,c=_!==null,u=nj(r)+(_?.preferredExtraWidth??0),d=j.useRef(u);d.current=u;const[y,m]=j.useState(rj),w=j.useRef(y),[C,A]=j.useState(!1),E=j.useCallback(v=>{v.preventDefault();const p=v.clientX,S=w.current;A(!0);const k=R=>{const M=p-R.clientX,T=window.innerWidth-148-d.current,I=Math.max(YC,Math.min(T,S+M));w.current=I,m(I)},L=()=>{document.removeEventListener("pointermove",k),document.removeEventListener("pointerup",L),A(!1);try{localStorage.setItem(XC,String(w.current))}catch{}};document.addEventListener("pointermove",k),document.addEventListener("pointerup",L)},[]),f=j.useMemo(()=>({theaterId:e,api:n}),[e,n]);return h.jsxs("div",{className:`right-rail${c?" is-open":""}${C?" is-dragging":""}`,role:"complementary","aria-label":"Activity Rail",children:[h.jsxs("div",{className:"right-rail-panel-slot",style:c?{width:y+u}:void 0,children:[c&&h.jsx("div",{className:"right-rail-resize-handle",onPointerDown:E,"aria-hidden":"true"}),_&&h.jsx(aj,{activePanel:_,activeId:r,ctx:f})]}),h.jsxs("nav",{className:"right-rail-icons",role:"tablist","aria-label":"Activity tools",children:[o.map(v=>h.jsx(eS,{panel:v,isActive:r===v.id},v.id)),o.length>0&&a.length>0?h.jsx("div",{className:"right-rail-divider",role:"separator","aria-hidden":"true"}):null,a.map(v=>h.jsx(eS,{panel:v,isActive:r===v.id},v.id))]})]})}const aj=j.memo(function({activePanel:n,activeId:r,ctx:a}){return h.jsxs(h.Fragment,{children:[h.jsxs("div",{className:"right-rail-panel-head",children:[h.jsx("span",{className:"right-rail-panel-title",children:n.title}),h.jsx("button",{className:"right-rail-close-btn",type:"button","aria-label":`Close ${n.title}`,onClick:Q7,children:"✕"})]}),h.jsx("div",{className:"right-rail-panel-body",role:"tabpanel","aria-labelledby":`rail-tab-${r}`,children:n.render(a)})]})});function eS({panel:e,isActive:n}){const r=j.useCallback(()=>J7(e.id),[e.id]),a=typeof e.icon=="function"?e.icon():e.icon;return h.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:r,children:a})}const tS=8,oj=260;function nS(e){const{anchor:n,onClose:r}=e,[a,o]=j.useState(void 0);return j.useLayoutEffect(()=>{const g=Math.max(8,Math.min(n.left,window.innerWidth-208)),_=n.bottom+tS,c=_+oj>window.innerHeight;o(c?{position:"fixed",left:g,top:"auto",bottom:Math.round(window.innerHeight-n.top+tS)}:{position:"fixed",left:g,top:Math.round(_)})},[n]),j.useEffect(()=>{const g=_=>{_.key==="Escape"&&(_.preventDefault(),r())};return window.addEventListener("keydown",g),window.addEventListener("resize",r),window.addEventListener("scroll",r,!0),()=>{window.removeEventListener("keydown",g),window.removeEventListener("resize",r),window.removeEventListener("scroll",r,!0)}},[r]),Js.createPortal(h.jsx("div",{className:"group-context-menu-overlay",role:"presentation",onPointerDown:r,children:a?h.jsx("div",{className:"group-context-menu-card",role:"menu","aria-label":e.kind==="chip"?"Operation options":`${e.group.name} options`,style:a,onPointerDown:g=>g.stopPropagation(),children:e.kind==="chip"?h.jsx(lj,{...e}):h.jsx(cj,{...e})}):null}),document.body)}function lj({operation:e,groups:n,accentKey:r,actions:a,onClose:o}){const[g,_]=j.useState(!1),[c,u]=j.useState(`Group ${n.length+1}`),d=j.useRef(!1),y=j.useRef(null);j.useEffect(()=>{g&&y.current?.select()},[g]);const m=()=>{const w=c.trim();w&&(a.onCreateGroup(w),o())};return h.jsxs(h.Fragment,{children:[h.jsx("div",{className:"group-context-menu-section-label",children:"Group"}),n.map(w=>{const C=Gl(w.color),A=e.groupId===w.id;return h.jsxs("button",{type:"button",className:`group-context-menu-item${A?" is-selected":""}`,role:"menuitemradio","aria-checked":A,onClick:()=>{a.onSetGroupId(A?null:w.id),o()},children:[h.jsx("span",{className:"group-context-menu-item__dot",style:C?{background:C}:void 0,"aria-hidden":"true"}),h.jsx("span",{className:"group-context-menu-item__name",children:w.name}),A?h.jsx(uj,{}):null]},w.id)}),g?h.jsx("input",{ref:y,className:"group-context-menu-new-input",type:"text",value:c,onChange:w=>u(w.target.value),onCompositionStart:()=>{d.current=!0},onCompositionEnd:()=>{d.current=!1},onKeyDown:w=>{w.key==="Enter"&&!d.current&&(w.preventDefault(),m()),w.key==="Escape"&&(w.preventDefault(),_(!1))},onBlur:()=>_(!1),"aria-label":"New group name",placeholder:"Group name"}):h.jsx("button",{type:"button",className:"group-context-menu-item group-context-menu-item--new",role:"menuitem",onClick:()=>_(!0),children:h.jsx("span",{className:"group-context-menu-item__new-label",children:"+ New group"})}),h.jsx("div",{className:"group-context-menu-divider","aria-hidden":"true"}),h.jsx("div",{className:"group-context-menu-section-label",children:"Accent"}),h.jsxs("button",{type:"button",className:"accent-popover-swatch accent-popover-swatch--clear",role:"menuitem","aria-label":"No accent","aria-pressed":r===null,onClick:()=>{a.onSetAccent(null),o()},children:[h.jsx("span",{}),"None"]}),h.jsx("div",{className:"group-context-menu-swatches",children:wh.map(w=>h.jsx("button",{type:"button",className:"accent-popover-swatch",role:"menuitem","aria-label":w.label,"aria-pressed":r===w.key,onClick:()=>{a.onSetAccent(w.key),o()},children:h.jsx("span",{style:{background:w.color}})},w.key))})]})}function cj({group:e,actions:n,onClose:r}){const[a,o]=j.useState(e.name),[g,_]=j.useState(!1),c=j.useRef(!1),u=()=>{const d=a.trim();if(!d||d===e.name){r();return}n.onRename(d),r()};return h.jsxs(h.Fragment,{children:[h.jsx("div",{className:"group-context-menu-section-label",children:"Color"}),h.jsx("div",{className:"group-context-menu-swatches",children:wh.map(d=>h.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),r()},children:h.jsx("span",{style:{background:d.color}})},d.key))}),h.jsx("div",{className:"group-context-menu-divider","aria-hidden":"true"}),h.jsx("div",{className:"group-context-menu-section-label",children:"Rename"}),h.jsx("input",{className:"group-context-menu-new-input",type:"text",value:a,onChange:d=>o(d.target.value),onCompositionStart:()=>{c.current=!0},onCompositionEnd:()=>{c.current=!1},onKeyDown:d=>{d.key==="Enter"&&!c.current&&(d.preventDefault(),u()),d.key==="Escape"&&(d.preventDefault(),r())},onBlur:u,"aria-label":"Group name"}),h.jsx("div",{className:"group-context-menu-divider","aria-hidden":"true"}),h.jsx("button",{type:"button",className:`group-context-menu-item group-context-menu-item--danger${g?" is-armed":""}`,role:"menuitem",onClick:()=>{if(!g){_(!0);return}n.onUngroupAll(),r()},"aria-label":g?"Confirm: remove all members and delete group":"Ungroup all members and delete group",children:g?"Confirm ungroup all?":"Ungroup all"})]})}function uj(){return h.jsx("svg",{viewBox:"0 0 12 12",className:"group-context-menu-item__check","aria-hidden":"true",children:h.jsx("path",{d:"M2 6l3 3 5-5",fill:"none",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round"})})}function hj(e,n,r,a){if(!r)return{groupId:null,index:0};for(const g of n){const _=g.groupId??"__ungrouped__",c=r.querySelector(`[data-drop-zone-group-id="${_}"]`);if(!c)continue;const u=c.getBoundingClientRect();if(e<u.top||e>u.bottom)continue;const d=c.querySelector(`[data-group-section-id="${_}"]`);if(!d||e<d.getBoundingClientRect().top)return{groupId:g.groupId,index:0};const y=Array.from(d.querySelectorAll("[data-side-bar-chip-id]"));for(const m of y){const w=m.dataset.sideBarChipId;if(!w||w===a)continue;const C=m.getBoundingClientRect();if(e<=C.top+C.height/2)return{groupId:g.groupId,index:Math.max(0,g.entryIds.indexOf(w))}}return{groupId:g.groupId,index:g.entryIds.length}}const o=n[n.length-1];return{groupId:o?.groupId??null,index:o?.entryIds.length??0}}function dj(e,n,r,a){const o=e.filter(y=>y!==n),g=new Set(a),_=o.filter(y=>g.has(y)),c=Math.max(0,Math.min(r,_.length));if(_.length===0)return[...o,n];if(c<_.length){const y=o.indexOf(_[c]),m=[...o];return m.splice(y,0,n),m}const u=o.indexOf(_[_.length-1]),d=[...o];return d.splice(u+1,0,n),d}function fj(e,n,r,a){const o=new Set(a),g=e.filter(m=>o.has(m)),_=g.indexOf(n),c=g.filter(m=>m!==n),u=r>_?r-1:r,d=Math.max(0,Math.min(u,c.length));c.splice(d,0,n);let y=0;return e.map(m=>o.has(m)?c[y++]??m:m)}function pj(e,n,r){if(r.length!==n.length)return[...e];const a=new Set(n);let o=0;return e.map(g=>a.has(g)?r[o++]??g:g)}function gj(e,n,r){if(e.indexOf(n)===-1)return[...e];const o=e.filter(_=>_!==n),g=Math.max(0,Math.min(r,o.length));return o.splice(g,0,n),o}function mj({entry:e,index:n,isCloseArmed:r,accentValue:a,dragging:o,dragOffsetY:g,dropTarget:_,onArmClose:c,onDisarmClose:u,onClose:d,onFocus:y,onKeyboardMove:m,onPointerDragStart:w,onOpenAccent:C,onRename:A}){const E=j.useRef(!1),{operation:f,active:v,minimized:p,notificationCount:S}=e,k=_j(f),L=TC({currentTitle:k,onCommit:B=>A(f.id,B),onBegin:u}),R=["side-bar-chip",v?"side-bar-chip--active":"",p?"side-bar-chip--minimized":"",o?"side-bar-chip--dragging":"",_?"side-bar-chip--drop-target":""].filter(Boolean).join(" "),M=["side-bar-chip-close",r?"is-armed":""].filter(Boolean).join(" "),T={"--i":n,...a?{"--chip-accent":a}:{},...o?{"--drag-dy":`${Math.round(g)}px`}:{}},I=()=>{if(u(),E.current){E.current=!1;return}y(f.id)},K=B=>{B.stopPropagation()},F=B=>{if(B.stopPropagation(),!r){c(f.id);return}u(),d(f.id)},G=B=>{B.preventDefault(),u(),C(f.id,B.currentTarget.getBoundingClientRect())};return h.jsxs("li",{"data-side-bar-chip-id":f.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:T,onClick:I,onContextMenu:G,onFocus:()=>{r||u()},onPointerDown:B=>w(B,f.id),onPointerUp:()=>{o&&(E.current=!0)},onKeyDown:B=>{if(B.target===B.currentTarget){if(B.altKey&&B.shiftKey&&(B.key==="ArrowUp"||B.key==="ArrowDown")){B.preventDefault(),m(f.id,B.key==="ArrowUp"?-1:1);return}(B.key==="Enter"||B.key===" ")&&(B.preventDefault(),I())}},children:[h.jsx("span",{className:"side-bar-chip-beacon-button","aria-hidden":"true",children:h.jsx("span",{className:"side-bar-chip-op-icon",children:e.icon??h.jsx(bj,{})})}),L.renaming?h.jsx("input",{className:"side-bar-chip-rename-input",ref:L.inputRef,value:L.draftTitle,"aria-label":`Rename operation ${k}`,onChange:B=>L.setDraftTitle(B.target.value),onKeyDown:L.handleKeyDown,onBlur:L.handleBlur,onPointerDown:B=>B.stopPropagation(),onClick:B=>B.stopPropagation()}):h.jsx("span",{className:"side-bar-chip-name",onDoubleClick:L.begin,children:k}),S>0?h.jsx("span",{className:"side-bar-chip-count",children:S}):null,h.jsx("button",{type:"button",className:M,onPointerDown:K,onClick:F,"aria-label":r?`Confirm close operation ${k}`:`Close operation ${k}`,title:r?"Confirm close":"Close operation",children:r?"Close?":h.jsx(vj,{})})]})}function _j(e){return e.title}function vj(){return h.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:h.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 bj(){return h.jsx("svg",{viewBox:"0 0 14 14","aria-hidden":"true",children:h.jsx("rect",{x:"2",y:"2",width:"10",height:"10",rx:"2.5",fill:"none",stroke:"currentColor",strokeWidth:"1.3"})})}function yj({group:e,count:n,collapsed:r,tier:a,onToggle:o,onContextMenu:g}){const _=Gl(e.color),c=_?{"--grp-color":_}:void 0,u=d=>{d.preventDefault(),g(e.id,d.currentTarget.getBoundingClientRect())};return a==="rail"?h.jsx("div",{className:"side-bar-group-header side-bar-group-header--rail","data-tier":"rail",style:c,onClick:()=>o(e.id),onContextMenu:u,role:"button",tabIndex:0,"aria-label":`Group ${e.name}`,onKeyDown:d=>{(d.key==="Enter"||d.key===" ")&&(d.preventDefault(),o(e.id))},children:h.jsx("span",{className:"side-bar-group-header__dot","aria-hidden":"true"})}):h.jsxs("div",{className:"side-bar-group-header",style:c,onContextMenu:u,role:"group","aria-label":e.name,children:[h.jsx("button",{type:"button",className:"side-bar-group-header__toggle",onClick:()=>o(e.id),"aria-expanded":!r,"aria-label":r?`Expand group ${e.name}`:`Collapse group ${e.name}`,title:r?"Expand":"Collapse",children:h.jsx(Sj,{collapsed:r})}),h.jsx("span",{className:"side-bar-group-header__name",children:e.name}),h.jsx("span",{className:"side-bar-group-header__count","aria-label":`${n} operations`,children:n})]})}function Sj({collapsed:e}){return h.jsx("svg",{viewBox:"0 0 12 12","aria-hidden":"true",className:`side-bar-group-header__arrow${e?" is-collapsed":""}`,children:h.jsx("path",{d:"M3 5l3 3 3-3",fill:"none",stroke:"currentColor",strokeWidth:"1.3",strokeLinecap:"round",strokeLinejoin:"round"})})}const ZC="fleet-console.operations.side-width",JC="fleet-console.operations.side-collapsed",oh=56,wj=180,iS=wj;function xj(){return typeof window<"u"?window.innerWidth-480:800}function Cj(){try{if(typeof window>"u")return iS;const e=localStorage.getItem(ZC);if(e!==null){const n=parseInt(e,10);if(!isNaN(n)&&n>=oh)return n}}catch{}return iS}function Ej(){try{return typeof window>"u"?!1:localStorage.getItem(JC)==="1"}catch{}return!1}let Vl={width:Cj(),collapsed:Ej()};const Ng=new Set;function QC(){for(const e of Ng)e()}function rS(){return Vl}function kj(e){return Ng.add(e),()=>{Ng.delete(e)}}function Aj(){return j.useSyncExternalStore(kj,rS,rS)}function sS(e){const n=Math.max(oh,Math.min(xj(),e));Vl={...Vl,width:n};try{typeof window<"u"&&localStorage.setItem(ZC,String(n))}catch{}QC()}function Tj(e){Vl={...Vl,collapsed:e};try{typeof window<"u"&&localStorage.setItem(JC,e?"1":"0")}catch{}QC()}function Rj(e){return e<120?"rail":e<240?"list":"detail"}const Lj=1500,Mj=6,aS=34,oS=18;function Nj({operations:e,groups:n,minimized:r,activeOperationId:a,operationNotifications:o,catalog:g,canLaunch:_,mapFullscreen:c,radarEnabled:u,perimeterEnabled:d,renderKindIcon:y,onLaunchKind:m,onResetView:w,onMaximizeMap:C,onToggleRadar:A,onTogglePerimeter:E,onClose:f,onFocus:v,onSetAccent:p,onRename:S,onSetGroupId:k,onCreateGroup:L,onSetGroupColor:R,onRenameGroup:M,onUngroupAll:T}){const I=j.useRef(null),K=Aj(),{width:F,collapsed:G}=K,B=G?"rail":Rj(F),X=PS(),Y=j.useRef(null),[z,q]=j.useState(null),[V,D]=j.useState(null),H=j.useRef(null),O=j.useRef([]),P=j.useRef([]),W=j.useRef([]),Z=j.useRef(k),[ie,he]=j.useState(null),[te,$]=j.useState(null),[le,ge]=j.useState(null),we=kA(),Se=new Set(r),je=new Set(we),Ie=gw(e,X.operationOrder).map(ve=>{const $e=g.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:a===ve.id,minimized:Se.has(ve.id),notificationCount:o[ve.id]?.count??0,icon:Ze}}),Ge=Oj(Ie,n,X.operationOrder),vt=Ge.flatMap(ve=>je.has(ve.groupId??"")?[]:ve.entries),Le=Ie.map(ve=>ve.operation.id),Rt=j.useCallback(()=>{Y.current!==null&&(window.clearTimeout(Y.current),Y.current=null)},[]),Xt=j.useCallback(()=>{Rt(),q(null)},[Rt]),vn=j.useCallback(ve=>{Rt(),q(ve),Y.current=window.setTimeout(()=>{Y.current=null,q(null)},Lj)},[Rt]);j.useEffect(()=>Rt,[Rt]),j.useEffect(()=>{z!==null&&(Ie.some(ve=>ve.operation.id===z)||Xt())},[z,Ie,Xt]);const an=ie?.kind==="chip"?Ie.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=vt.findIndex(Dt=>Dt.operation.id===ve);if(Ze===-1)return;const at=Math.max(0,Math.min(vt.length-1,Ze+$e));if(at===Ze)return;const Ve=vt.map(Dt=>Dt.operation.id),on=gj(Ve,ve,at);jf(pj(Le,Ve,on))},ut=Ge.map(ve=>({groupId:ve.groupId,entryIds:ve.entries.map($e=>$e.operation.id)}));j.useEffect(()=>{O.current=Ie,P.current=Le,W.current=ut,Z.current=k});const Lt=ve=>{H.current=ve,D(ve)},Ct=V?.pointerId??null;j.useEffect(()=>{if(Ct===null)return;const ve=at=>{if(at.pointerId!==Ct)return;const Ve=H.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<Mj)return;Ve.dragging&&at.preventDefault();const Dt=hj(at.clientY,W.current,I.current,Ve.sourceId);Dj(at.clientY,I.current),Lt({...Ve,currentY:at.clientY,dragging:!0,dropIndex:Dt.index,dropGroupId:Dt.groupId})},$e=at=>{if(at.pointerId!==Ct)return;const Ve=H.current;if(Lt(null),!Ve?.dragging)return;const{sourceId:on,sourceGroupId:Dt,dropIndex:Tn,dropGroupId:Un}=Ve,Bt=W.current,Q=P.current;if(Un!==Dt){const ke=Bt.find(Ce=>Ce.groupId===Un)?.entryIds??[];jf(dj(Q,on,Tn,ke)),Z.current(on,Un);return}const ye=Bt.find(ht=>ht.groupId===Dt)?.entryIds??[],Oe=ye.indexOf(on);if(Oe===-1||Tn===Oe)return;const bt=fj(Q,on,Tn,ye);jf(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;he(null),Xt();const at=Ie.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:Le.indexOf($e),dropGroupId:at})},Kt=j.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]),Xn=()=>{Tj(!G),G||sS(oh)},bn=ve=>{if(te){$(null);return}ge(null);const $e=ve.currentTarget.getBoundingClientRect();$({anchor:{x:$e.right+8,y:$e.top},viewportBounds:{width:window.innerWidth,height:window.innerHeight}})},Pn=ve=>{ve.defaultPrevented||(ve.preventDefault(),ge(null),he(null),$({anchor:{x:ve.clientX,y:ve.clientY},viewportBounds:{width:window.innerWidth,height:window.innerHeight}}))},dt=ve=>{if(le){ge(null);return}$(null);const $e=ve.currentTarget.getBoundingClientRect();ge({anchor:{x:$e.right+8,y:$e.top},viewportBounds:{width:window.innerWidth,height:window.innerHeight}})},An=G?oh:F;return Ie.length===0&&B==="rail"?h.jsxs("aside",{className:"operations-side-bar","data-tier":B,"data-canvas-blocker":!0,style:{"--side-bar-width":`${An}px`},onContextMenu:Pn,children:[h.jsx("header",{className:"operations-side-bar-header",children:h.jsx("button",{type:"button",className:"side-bar-new-btn",onClick:bn,"aria-label":"New Operation",title:"New Operation",children:h.jsx(lS,{})})}),h.jsx("div",{className:"operations-side-bar-resize-handle",onPointerDown:Kt,onDoubleClick:Xn,"aria-hidden":"true"}),te?Js.createPortal(h.jsx(Iu,{anchor:te.anchor,viewportBounds:te.viewportBounds,placement:"cursor",mode:"launch",catalog:g,canLaunch:_,renderKindIcon:y,onLaunchKind:(ve,$e)=>{$(null),m(ve,$e)},onResetView:w,onClose:()=>$(null)},`${te.anchor.x}:${te.anchor.y}`),document.body):null]}):h.jsxs("aside",{className:"operations-side-bar","data-tier":B,"data-canvas-blocker":!0,style:{"--side-bar-width":`${An}px`},onContextMenu:Pn,children:[h.jsxs("header",{className:"operations-side-bar-header",children:[h.jsxs("button",{type:"button",className:"side-bar-new-btn",onClick:bn,"aria-label":"New Operation","aria-expanded":te!==null,title:"New Operation",children:[h.jsx(lS,{}),B!=="rail"?h.jsx("span",{children:"Operation"}):null]}),B!=="rail"?h.jsx("button",{type:"button",className:"side-bar-settings-btn",onClick:dt,"aria-expanded":le!==null,"aria-label":"Map and display controls",title:"Map and display controls",children:h.jsx(Bj,{})}):null]}),h.jsx("ol",{className:"operations-side-bar-chips",ref:I,"aria-label":"Operations",children:Ge.map(ve=>{const $e=ve.groupId!==null&&je.has(ve.groupId),Ze=ve.group?Gl(ve.group.color):null,at=Ze?{"--grp-color":Ze}:void 0;return h.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?h.jsx(yj,{group:ve.group,count:ve.entries.length,collapsed:$e,tier:B,onToggle:EA,onContextMenu:(Ve,on)=>he({kind:"group",groupId:Ve,anchor:on})}):ve.entries.length>0?h.jsx("div",{className:"side-bar-ungrouped-label","aria-label":"Ungrouped operations",children:B!=="rail"?h.jsx("span",{children:"Ungrouped"}):null}):null,$e?null:h.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=Ie.indexOf(Ve),Dt=ve.entries.indexOf(Ve),Tn=X.operationAccent[Ve.operation.id]??Uy(Ve.operation),Un=Tn?Gl(Tn):null;return h.jsx(mj,{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:f,onFocus:v,onKeyboardMove:Zt,onPointerDragStart:Ft,onOpenAccent:(Bt,Q)=>he({kind:"chip",operationId:Bt,anchor:Q}),onRename:S},Ve.operation.id)})})]},ve.groupId??"__ungrouped__")})}),h.jsx("div",{className:"operations-side-bar-resize-handle",onPointerDown:Kt,onDoubleClick:Xn,"aria-hidden":"true"}),te?Js.createPortal(h.jsx(Iu,{anchor:te.anchor,viewportBounds:te.viewportBounds,placement:"cursor",mode:"launch",catalog:g,canLaunch:_,renderKindIcon:y,onLaunchKind:(ve,$e)=>{$(null),m(ve,$e)},onResetView:w,onClose:()=>$(null)},`${te.anchor.x}:${te.anchor.y}`),document.body):null,le?Js.createPortal(h.jsx(Iu,{anchor:le.anchor,viewportBounds:le.viewportBounds,placement:"cursor",mode:"controls",catalog:g,canLaunch:_,mapFullscreen:c,radarEnabled:u,perimeterEnabled:d,renderKindIcon:y,onLaunchKind:m,onResetView:()=>{ge(null),w()},onMaximizeMap:C,onToggleRadar:A,onTogglePerimeter:E,onClose:()=>ge(null)},`settings:${le.anchor.x}:${le.anchor.y}`),document.body):null,ie?.kind==="chip"&&an?h.jsx(nS,{kind:"chip",operation:an,groups:n,accentKey:X.operationAccent[an.id]??Uy(an),anchor:ie.anchor,actions:{onSetAccent:ve=>p(an.id,ve),onSetGroupId:ve=>k(an.id,ve),onCreateGroup:ve=>L(an.theaterId,ve,an.id)},onClose:()=>he(null)}):ie?.kind==="group"&&kn?h.jsx(nS,{kind:"group-header",group:kn,anchor:ie.anchor,actions:{onSetColor:ve=>R(kn.id,ve),onRename:ve=>M(kn.id,ve),onUngroupAll:()=>T(kn.id)},onClose:()=>he(null)}):null]})}function Oj(e,n,r){const a=[...n].sort((c,u)=>c.order-u.order||c.createdAt-u.createdAt),o=a.map(c=>({groupId:c.id,group:c,entries:[]})),g={groupId:null,group:null,entries:[]},_=new Map(a.map(c=>[c.id,c]));for(const c of e){const u=c.operation.groupId??null;u!==null&&_.has(u)?o.find(y=>y.groupId===u)?.entries.push(c):g.entries.push(c)}return[...o,g]}function Dj(e,n){if(!n)return;const r=n.getBoundingClientRect();e<r.top+aS?n.scrollTop-=oS:e>r.bottom-aS&&(n.scrollTop+=oS)}function lS(){return h.jsxs("svg",{viewBox:"0 0 24 24","aria-hidden":"true",children:[h.jsx("circle",{cx:"12",cy:"12",r:"7",fill:"none",stroke:"currentColor",strokeWidth:"1.4"}),h.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"}),h.jsx("path",{d:"M12 9.2v5.6M9.2 12h5.6",fill:"none",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round"})]})}function Bj(){return h.jsxs("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:[h.jsx("circle",{cx:"8",cy:"8",r:"2.2",fill:"none",stroke:"currentColor",strokeWidth:"1.25"}),h.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 jj='a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])';function Ij(){const{codexReader:e,codexReaderExpanded:n,activeTheaterId:r}=$r(),a=j.useRef(null),o=j.useRef(null),g=j.useRef(null),_=e?`${e.kind}:${e.kind==="entry"?e.entryId:e.kind==="drydock"?e.patchId??"":e.id??""}`:null,c=e!==null&&n,u=j.useCallback(()=>{GB(),KT()},[]);return j.useEffect(()=>{if(!c)return;const d=e;document.body.setAttribute("data-codex-reading","true");const y=document.querySelector(".operations-canvas"),m=document.querySelector(".operations-side-bar");y?.setAttribute("inert",""),m?.setAttribute("inert","");const w=C=>{if(C.key==="Escape"){C.preventDefault(),C.stopPropagation(),u();return}C.key==="Tab"&&Pj(a.current,C)};return window.addEventListener("keydown",w,!0),()=>{window.removeEventListener("keydown",w,!0),document.body.removeAttribute("data-codex-reading"),y?.removeAttribute("inert"),m?.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]),j.useEffect(()=>{if(!c||!o.current||!g.current||!e)return;const d=e.kind,y=d==="drydock"?e.patchId:d==="conflicts"?e.id:void 0;KC(o.current,g.current,{initialEntryId:d==="entry"?e.entryId:"",kind:d,subId:y,theaterId:r,onRelatedClick:m=>{jr({kind:"entry",entryId:m}),Mu()},onClose:u,onPatchOpen:m=>{jr({kind:"drydock",patchId:m}),Mu()},onDecided:()=>{ah(),jr({kind:"drydock",patchId:void 0}),Mu()}}),requestAnimationFrame(()=>{a.current?.querySelector("[data-sheet-initial-focus]")?.focus()})},[c,_]),c?Js.createPortal(h.jsxs(h.Fragment,{children:[h.jsx("div",{className:"codex-reading-scrim",onClick:u,"aria-hidden":"true"}),h.jsxs("div",{ref:a,className:"codex-reading-sheet",role:"dialog","aria-modal":"true","aria-label":"Codex reading",children:[h.jsxs("div",{className:"codex-reading-sheet-head",children:[h.jsx("span",{className:"codex-reading-sheet-eyebrow",children:"Codex · Reading"}),h.jsx("button",{"data-sheet-initial-focus":!0,className:"codex-reading-sheet-close",type:"button","aria-label":"Close reading",onClick:u,children:"✕"})]}),h.jsxs("div",{className:"codex-reading-sheet-body",children:[h.jsx("div",{ref:o,className:"codex-reading-sheet-read"}),h.jsx("aside",{ref:g,className:"codex-reading-sheet-toc","aria-label":"On this page"})]})]})]}),document.body):null}function Pj(e,n){if(!e)return;const r=[...e.querySelectorAll(jj)].filter(g=>!g.closest("[inert]"));if(r.length===0)return;const a=r[0],o=r[r.length-1];n.shiftKey?document.activeElement===a&&(n.preventDefault(),o.focus()):document.activeElement===o&&(n.preventDefault(),a.focus())}const zj=ph().api,Og=560,Dg=360,Cp=new Set;function Hj({state:e}){const n=j.useRef(null),r=HS(),a=$S(),o=xA(),g=CA(),_=zS(),c=Jl(),[u,d]=j.useState([]),y=j.useMemo(()=>$j(e).map(z=>z.id),[e.operations,e.activeTheaterId]),m=j.useRef(e);m.current=e,j.useEffect(()=>{MA(e.activeTheaterId)},[e.activeTheaterId]),j.useEffect(()=>{if(!e.activeTheaterId){d([]);return}fS().then(d).catch(()=>{})},[e.activeTheaterId]),j.useEffect(()=>{const z={current:r},q=V=>{if(!V.altKey||V.metaKey||V.ctrlKey||V.shiftKey||V.key!=="ArrowLeft"&&V.key!=="ArrowRight")return;const D=document.activeElement;if(D instanceof HTMLElement&&D.matches("input, textarea, [contenteditable='true']")&&!D.closest(".xterm"))return;const H=m.current,O=oo(),P=WT(H.operations.filter(ie=>ie.theaterId===H.activeTheaterId),H.groups.filter(ie=>ie.theaterId===H.activeTheaterId),O.operationOrder,O.collapsedGroups).map(ie=>ie.id);if(P.length===0)return;V.preventDefault(),V.stopImmediatePropagation();const W=z.current??m.current.activeOperationId,Z=FT(P,W,V.key==="ArrowRight"?1:-1);if(Z){if(z.current){ar(Z),Ol(Z);return}dh(Z)}};return window.addEventListener("keydown",q,!0),()=>window.removeEventListener("keydown",q,!0)},[r]),j.useEffect(()=>{for(const z of y)RA(z);e.operationsHydrated&&LA(y)},[y,e.operationsHydrated]),j.useEffect(()=>{const z=e.pendingOperationFocus;if(z===null)return;if(Ip()!==null){Ol(z),j1();return}lo();const q=cS(n.current);q&&A1(z,q),j1()},[e.pendingOperationFocus]);const w=!!e.activeTheaterId&&!e.addingTheater,C=(e.operations??[]).filter(z=>z.theaterId===e.activeTheaterId),A=(e.groups??[]).filter(z=>z.theaterId===e.activeTheaterId),E=j.useCallback((z,q)=>c.plugins.find(D=>D.id===z)?.renderLaunchIcon?.(q)??null,[c.plugins]),f=j.useCallback((z,q,V)=>{if(!m.current.activeTheaterId)return;const D={...uS(V),zIndex:ia()};Ep(z,q,D,m.current.activeTheaterId,c.plugins)},[c.plugins]),v=j.useCallback((z,q)=>{if(!m.current.activeTheaterId)return;const V=Fj(n.current),D={...uS(V),zIndex:ia()};Ep(z,q,D,m.current.activeTheaterId,c.plugins)},[c.plugins]),p=j.useCallback((z,q,V)=>{m.current.activeTheaterId&&Ep(z,q,V,m.current.activeTheaterId,c.plugins)},[c.plugins]),S=j.useCallback(()=>{US({x:0,y:0,zoom:1})},[]),k=j.useCallback(()=>{BA()},[]),L=j.useCallback(()=>{NA()},[]),R=j.useCallback(()=>{OA()},[]),M=j.useCallback(z=>{const q=m.current.operations.find(P=>P.id===z);if(!q)return;const V=Ip();if(V!==null&&V!==z){ar(z),Ol(z);return}const D=oo(),H=D.operations[z]??q.geometry??Uj(q);D.operations[z]||zp(z,H),TA(z),ar(z);const O=cS(n.current);O&&A1(z,O)},[]),T=j.useCallback((z,q)=>{Lu(z,{accent:q}).then(()=>Pi(null)).then(zi).catch(()=>{})},[]),I=j.useCallback((z,q)=>{ew(z,q).then(()=>Pi(null)).then(zi).catch(()=>{})},[]),K=j.useCallback((z,q)=>{Lu(z,{groupId:q}).then(()=>Pi(null)).then(zi).catch(()=>{})},[]),F=j.useCallback((z,q,V)=>{mT({theaterId:z,name:q,color:"blue"}).then(D=>Lu(V,{groupId:D.id})).then(()=>Promise.all([Pi(null).then(zi),El().then(kl)])).catch(()=>{})},[]),G=j.useCallback((z,q)=>{q&&D1(z,{color:q}).then(()=>El()).then(kl).catch(()=>{})},[]),B=j.useCallback((z,q)=>{D1(z,{name:q}).then(()=>El()).then(kl).catch(()=>{})},[]),X=j.useCallback(z=>{_T(z).then(()=>Promise.all([Pi(null).then(zi),El().then(kl)])).catch(()=>{})},[]),Y=j.useCallback(z=>{if(Cp.has(z))return;Cp.add(z);const q=m.current.operations.find(D=>D.id===z)?.pluginId,V=(q?c.plugins.find(D=>D.id===q):null)??null;Wj(z,V).finally(()=>Cp.delete(z))},[c.plugins]);return h.jsxs("div",{className:"console-body is-canvas",ref:n,children:[h.jsx(Nj,{operations:C,groups:A,minimized:a,activeOperationId:e.activeOperationId,operationNotifications:e.operationNotifications,catalog:u,canLaunch:w,mapFullscreen:_,radarEnabled:o,perimeterEnabled:g,renderKindIcon:E,onLaunchKind:v,onResetView:S,onMaximizeMap:k,onToggleRadar:L,onTogglePerimeter:R,onClose:Y,onFocus:M,onSetAccent:T,onRename:I,onSetGroupId:K,onCreateGroup:F,onSetGroupColor:G,onRenameGroup:B,onUngroupAll:X}),h.jsx(I7,{state:e,catalog:u,canLaunch:w,mapFullscreen:_,radarEnabled:o,perimeterEnabled:g,renderKindIcon:E,onLaunchKind:f,onLaunchAtGeometry:p,onResetView:S,onMaximizeMap:k,onToggleRadar:L,onTogglePerimeter:R,onClose:Y,onFocus:M,onSetAccent:T}),h.jsx(sj,{theaterId:e.activeTheaterId,api:zj}),h.jsx(Ij,{})]})}function $j(e){return e.operations.filter(n=>n.theaterId===e.activeTheaterId).sort(qp)}function cS(e){if(!e)return null;const n=e.getBoundingClientRect();return{width:n.width,height:n.height}}function Uj(e){return e.geometry??{x:0,y:0,width:Og,height:Dg,zIndex:0}}function Fj(e){const n=oo(),r=e?.clientWidth??800,a=e?.clientHeight??600;return Wl({x:r/2,y:a/2},n.viewport)}function uS(e){return{x:e.x-Og/2,y:e.y-Dg/2,width:Og,height:Dg}}async function Ep(e,n,r,a,o){const g=o.find(m=>m.id===e),c=ph(()=>{Pi(null).then(zi).catch(()=>{})});let u=null;if(g?.launch?u=(await g.launch({theaterId:a,kind:n,geometry:r,operations:c.operations})).id:u=(await c.operations.create({theaterId:a,type:n.type,pluginId:e,title:n.title,geometry:r})).id,await Pi(null).then(zi).catch(()=>{}),!u)return;const d=wA()===a,y=Wp().operations.some(m=>m.id===u);d&&y&&Ip()!==null?(ar(u),Ol(u)):dh(u)}async function Wj(e,n){try{n?.closeOperation&&await n.closeOperation(e)}catch{}await fetch(`/api/v1/operations/${encodeURIComponent(e)}`,{method:"DELETE"}).catch(()=>{}),await Pi(null).then(zi).catch(()=>{})}const Gj=6e3;function qj(){const e=$r(),n=$i(),r=Jl(),a=n.pathname,g=zS()&&a.startsWith("/operations"),_=a.startsWith("/operations");return j.useEffect(()=>{const c=ph(()=>{Pi().then(zi).catch(()=>{})}),u=r.plugins.map(d=>d.install?.(c)).filter(d=>typeof d=="function");return()=>{for(const d of u)d()}},[r.plugins]),j.useEffect(()=>{DT(_)},[_]),j.useEffect(()=>{const c=document.querySelector(".topbar");if(!c)return;const u=()=>{document.documentElement.style.setProperty("--console-topbar-offset",`${Math.round(c.getBoundingClientRect().bottom)}px`)};u();const d=new ResizeObserver(u);return d.observe(c),window.addEventListener("resize",u),()=>{d.disconnect(),window.removeEventListener("resize",u)}},[]),j.useEffect(()=>{const c=new AbortController;hT(c.signal).then(y=>{PT(y),z1()}).catch(y=>{c.signal.aborted||(tt({theaterError:y instanceof Error?y.message:String(y)}),z1())}),Pi(null,c.signal).then(zi).catch(()=>{}),El(null,c.signal).then(kl).catch(()=>{}),cw(),ZS({signal:c.signal}).then(uw).catch(y=>{c.signal.aborted||hw(y instanceof Error?y.message:String(y))});const u=()=>{dT(e.activeTheaterId,c.signal).then(BT).catch(()=>{})};u();const d=window.setTimeout(u,Gj);return()=>{window.clearTimeout(d),c.abort()}},[]),j.useEffect(()=>{const c=u=>{(u.metaKey||u.ctrlKey)&&u.key.toLowerCase()==="k"&&(u.preventDefault(),u.stopImmediatePropagation(),GT())};return window.addEventListener("keydown",c,!0),()=>window.removeEventListener("keydown",c,!0)},[]),h.jsxs("div",{className:`console-shell ${g?"is-map-fullscreen":""}`,children:[h.jsx(DR,{state:e}),h.jsxs(Pk,{children:[h.jsx(qa,{path:"/",element:h.jsx(w1,{to:"/operations",replace:!0})}),h.jsx(qa,{path:"/operations",element:h.jsx(Hj,{state:e})}),h.jsx(qa,{path:"/carrier-settings",element:h.jsx(s8,{})}),h.jsx(qa,{path:"/settings",element:h.jsx(z8,{})}),h.jsx(qa,{path:"*",element:h.jsx(w1,{to:"/operations",replace:!0})})]}),h.jsx(SR,{state:e}),h.jsx(n3,{state:e}),h.jsx(vR,{state:e}),h.jsx(AR,{open:e.connectionError!==null,tone:"error",title:"Console link interrupted",message:e.connectionError??void 0})]})}globalThis.__fleetConsoleRuntime__={react:Uu,"react/jsx-runtime":s5,"@fleet-console/sdk/plugin/browser":x5,"@fleet-console/sdk/settings/browser":L5,"@fleet-console/sdk/operations/browser":f5,"@fleet-console/sdk/notifications/browser":N5,"@fleet-console/sdk/react/browser":D5};try{const e=await xC();lw(e.theme)}catch{}const Kj=await ND(),hS=document.querySelector("#app");hS&&H5.createRoot(hS).render(h.jsx(j.StrictMode,{children:h.jsx(lA,{basename:"/console",children:h.jsx(MD,{value:Kj,children:h.jsx(qj,{})})})}));export{dO as _,Vj as a,Bg as g,Tt as k,jl as p};
|