@marimo-team/frontend 0.18.5-dev178 → 0.18.5-dev181

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.
Files changed (83) hide show
  1. package/dist/assets/{CellStatus-CBYhhgmz.js → CellStatus-DqLx71xI.js} +1 -1
  2. package/dist/assets/{JsonOutput-CZTTeJuI.js → JsonOutput-3u2O9mUd.js} +1 -1
  3. package/dist/assets/{MarimoErrorOutput-C_Zgofmd.js → MarimoErrorOutput-HLzwepOd.js} +1 -1
  4. package/dist/assets/{RenderHTML-CQm5bp6v.js → RenderHTML-Dp8s4Bzr.js} +1 -1
  5. package/dist/assets/{add-cell-with-ai-CYDfp9kl.js → add-cell-with-ai-DTIq0l6h.js} +1 -1
  6. package/dist/assets/{add-database-form-CAIOqeCP.js → add-database-form-C20ZnUUx.js} +1 -1
  7. package/dist/assets/{agent-panel-DA-Q5xZe.js → agent-panel-D08HI0-X.js} +1 -1
  8. package/dist/assets/{ai-model-dropdown-DYQpnG3w.js → ai-model-dropdown-CK5sei5N.js} +1 -1
  9. package/dist/assets/{app-config-button-BgBrtReY.js → app-config-button-Ce5Tkr5O.js} +1 -1
  10. package/dist/assets/{cell-actions-Cfm2D7jK.js → cell-actions-By11JcES.js} +1 -1
  11. package/dist/assets/{cell-link-gAvJ31U3.js → cell-link-B7EjqLUL.js} +1 -1
  12. package/dist/assets/{cells-BEv4yuHU.js → cells-BLhvmrVl.js} +5 -5
  13. package/dist/assets/{chat-components-CtSjkjex.js → chat-components-DHkUyXWV.js} +1 -1
  14. package/dist/assets/{chat-display-KOmOjcf7.js → chat-display-DZMIiHZy.js} +1 -1
  15. package/dist/assets/{chat-panel-Cnzaj27Q.js → chat-panel-Bm-_lPiR.js} +1 -1
  16. package/dist/assets/{client-B4TxOzev.js → client-hHcgVFo7.js} +1 -1
  17. package/dist/assets/{column-preview-BBUgbmud.js → column-preview-B1AyyIgE.js} +1 -1
  18. package/dist/assets/{command-Ba7-DaYn.js → command-CDWT71Ts.js} +1 -1
  19. package/dist/assets/{command-palette-YDHUhPo7.js → command-palette-CmK4CaWU.js} +1 -1
  20. package/dist/assets/{common-DAfp8hHB.js → common-4ZdFNk6L.js} +1 -1
  21. package/dist/assets/{config-cCkBQ_ER.js → config-babG4OBR.js} +1 -1
  22. package/dist/assets/{datasource-hC-skADj.js → datasource-DNy_uzDr.js} +1 -1
  23. package/dist/assets/{dependency-graph-panel-StKdREPL.js → dependency-graph-panel-Xl6gHQbe.js} +1 -1
  24. package/dist/assets/{documentation-panel-CTFNwL8m.js → documentation-panel-BRHbbFlV.js} +1 -1
  25. package/dist/assets/{download-VDZsvjsd.js → download-DPiYP-j0.js} +1 -1
  26. package/dist/assets/{edit-page-BidQt2RA.js → edit-page-Bo1SeeXa.js} +3 -3
  27. package/dist/assets/{error-panel-DdOpe33s.js → error-panel-qGIXpWqc.js} +1 -1
  28. package/dist/assets/{es-BlGpQO9i.js → es-CR1H2K7u.js} +1 -1
  29. package/dist/assets/{file-explorer-panel-CKyg9zrY.js → file-explorer-panel-DdOLBo1H.js} +1 -1
  30. package/dist/assets/{floating-outline-DPboW4_E.js → floating-outline-foC3RCPc.js} +1 -1
  31. package/dist/assets/{focus-yB7yTfF-.js → focus-CgHW_IRL.js} +1 -1
  32. package/dist/assets/{form-iKFmPQ40.js → form-NWifpNWT.js} +1 -1
  33. package/dist/assets/{globals-TVCm1yPw.js → globals-CiRTn5Vt.js} +1 -1
  34. package/dist/assets/{home-page-CONVcKNl.js → home-page-WElJkZm5.js} +1 -1
  35. package/dist/assets/{index-B8BT3mFF.js → index-B7fTdTqh.js} +20 -20
  36. package/dist/assets/{kiosk-mode-DcdtDydP.js → kiosk-mode-vS4t3di8.js} +1 -1
  37. package/dist/assets/{layout-BlZ6buP7.js → layout-JiDE4oHf.js} +1 -1
  38. package/dist/assets/links-ENMiP32L.js +1 -0
  39. package/dist/assets/{logs-panel-DijLPYP3.js → logs-panel-BUqhCH8r.js} +1 -1
  40. package/dist/assets/{markdown-renderer-D0AQKFve.js → markdown-renderer-DgV_KnEf.js} +1 -1
  41. package/dist/assets/{mode-DwlGsYIa.js → mode-BeOhz3YE.js} +1 -1
  42. package/dist/assets/{name-cell-input-6Dtlhxow.js → name-cell-input-lVGcUDBb.js} +1 -1
  43. package/dist/assets/{outline-panel-P4zU6fY0.js → outline-panel-DHLUaY4X.js} +1 -1
  44. package/dist/assets/{packages-panel-v9jWz5EP.js → packages-panel-DhVyvWkj.js} +1 -1
  45. package/dist/assets/{panel-context-60G2HB3E.js → panel-context-DL3U4gXL.js} +1 -1
  46. package/dist/assets/{panels-lotEul91.js → panels-BLhXi2bR.js} +1 -1
  47. package/dist/assets/{process-output-DYPOAdn4.js → process-output-C2mignv4.js} +1 -1
  48. package/dist/assets/{readonly-python-code-DekTVJhb.js → readonly-python-code-C3URGhHv.js} +1 -1
  49. package/dist/assets/{run-page-tmxSwwZL.js → run-page-COOyMmI_.js} +1 -1
  50. package/dist/assets/{scratchpad-panel-C6eFtFsQ.js → scratchpad-panel-fnmQC0zy.js} +1 -1
  51. package/dist/assets/{session-panel-kCJhrTva.js → session-panel-6od-_OeM.js} +1 -1
  52. package/dist/assets/{snippets-panel-BNyKWUxX.js → snippets-panel-CAAC62vz.js} +1 -1
  53. package/dist/assets/{state-DTKootMj.js → state-CGIjjAWG.js} +1 -1
  54. package/dist/assets/{state-BrkNVBuj.js → state-CoslvOiH.js} +1 -1
  55. package/dist/assets/{switch-1zrEJdOH.js → switch-BLEwkiUl.js} +1 -1
  56. package/dist/assets/{terminal-CRIGvHBN.js → terminal-BvgBa6Ri.js} +1 -1
  57. package/dist/assets/{textarea-CmispJBv.js → textarea-S24k5l8r.js} +1 -1
  58. package/dist/assets/{tracing-BOiTysGY.js → tracing-Cl31yJ-W.js} +1 -1
  59. package/dist/assets/{tracing-panel-Cu4PqbRd.js → tracing-panel-Cw103_Tm.js} +2 -2
  60. package/dist/assets/{types-Qx81Y6OC.js → types-DiksLxkJ.js} +1 -1
  61. package/dist/assets/{useAddCell-DAIZvt_N.js → useAddCell-DGhb_PpU.js} +1 -1
  62. package/dist/assets/{useBoolean-BDG41CyP.js → useBoolean-5kuXz69O.js} +1 -1
  63. package/dist/assets/{useCellActionButton-CbsPOO0-.js → useCellActionButton-COxDEyF8.js} +1 -1
  64. package/dist/assets/{useDeleteCell-Dpa7vzrC.js → useDeleteCell-BVWdwuvc.js} +1 -1
  65. package/dist/assets/{useNotebookActions-CwwguV4h.js → useNotebookActions-B5GS83bw.js} +1 -1
  66. package/dist/assets/{useRunCells-dG-K1cYZ.js → useRunCells-Buew9vMX.js} +1 -1
  67. package/dist/assets/{useSplitCell-2xhwtwJD.js → useSplitCell-LsoCeBEb.js} +1 -1
  68. package/dist/assets/{utilities.esm-DcHHFDdt.js → utilities.esm-BAGxBLhu.js} +1 -1
  69. package/dist/assets/{vega-component-CLrcy81y.js → vega-component-DpAAiTdH.js} +1 -1
  70. package/dist/index.html +33 -33
  71. package/package.json +1 -1
  72. package/src/components/databases/display.tsx +1 -0
  73. package/src/components/datasources/utils.ts +3 -0
  74. package/src/core/codemirror/format.ts +4 -0
  75. package/src/core/codemirror/language/languages/sql/sql.ts +3 -0
  76. package/src/core/codemirror/language/languages/sql/utils.ts +6 -0
  77. package/src/core/runtime/runtime.ts +1 -0
  78. package/src/core/websocket/useWebSocket.tsx +2 -1
  79. package/src/mount.tsx +2 -1
  80. package/src/plugins/impl/data-frames/forms/__tests__/__snapshots__/form.test.tsx.snap +248 -21
  81. package/src/plugins/impl/data-frames/panel.tsx +2 -0
  82. package/src/plugins/impl/data-frames/schema.ts +25 -2
  83. package/dist/assets/links-Cw9RjHIY.js +0 -1
@@ -1 +1 @@
1
- import{p as i}from"./useEvent-DlWF5OMa.js";import{Kr as l,dn as o,fn as h}from"./cells-BEv4yuHU.js";import{d}from"./once-CTiSlR1m.js";import{t as m}from"./createLucideIcon-CW2xpJ57.js";var p=m("sparkles",[["path",{d:"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z",key:"1s2grr"}],["path",{d:"M20 2v4",key:"1rf3ol"}],["path",{d:"M22 4h-4",key:"gwowj6"}],["circle",{cx:"4",cy:"20",r:"2",key:"6kqj1y"}]]),f="marimo:ai:chatState:v5";const v=i(null),u=l("marimo:ai:includeOtherCells",!0,h);function C(a){let t=new Map;for(let[s,e]of a.entries()){if(e.messages.length===0)continue;let c=d(e.messages,n=>n.id);t.set(s,{...e,messages:c})}return t}const r=l(f,{chats:new Map,activeChatId:null},o({toSerializable:a=>({chats:[...C(a.chats).entries()],activeChatId:a.activeChatId}),fromSerializable:a=>({chats:new Map(a.chats),activeChatId:a.activeChatId})})),I=i(a=>{let t=a(r);return t.activeChatId?t.chats.get(t.activeChatId):null},(a,t,s)=>{t(r,e=>({...e,activeChatId:s}))});export{p as a,u as i,v as n,r,I as t};
1
+ import{p as i}from"./useEvent-DlWF5OMa.js";import{Kr as l,dn as o,fn as h}from"./cells-BLhvmrVl.js";import{d}from"./once-CTiSlR1m.js";import{t as m}from"./createLucideIcon-CW2xpJ57.js";var p=m("sparkles",[["path",{d:"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z",key:"1s2grr"}],["path",{d:"M20 2v4",key:"1rf3ol"}],["path",{d:"M22 4h-4",key:"gwowj6"}],["circle",{cx:"4",cy:"20",r:"2",key:"6kqj1y"}]]),f="marimo:ai:chatState:v5";const v=i(null),u=l("marimo:ai:includeOtherCells",!0,h);function C(a){let t=new Map;for(let[s,e]of a.entries()){if(e.messages.length===0)continue;let c=d(e.messages,n=>n.id);t.set(s,{...e,messages:c})}return t}const r=l(f,{chats:new Map,activeChatId:null},o({toSerializable:a=>({chats:[...C(a.chats).entries()],activeChatId:a.activeChatId}),fromSerializable:a=>({chats:new Map(a.chats),activeChatId:a.activeChatId})})),I=i(a=>{let t=a(r);return t.activeChatId?t.chats.get(t.activeChatId):null},(a,t,s)=>{t(r,e=>({...e,activeChatId:s}))});export{p as a,u as i,v as n,r,I as t};
@@ -1 +1 @@
1
- import{s as z}from"./chunk-LvLJmgfZ.js";import{d as ne,n as T,p as $,u as U}from"./useEvent-DlWF5OMa.js";import{t as ie}from"./react-BGmjiNul.js";import{W as _}from"./cells-BEv4yuHU.js";import{t as D}from"./compiler-runtime-DeeZ7FnK.js";import{a as le,d as E,f as ce,l as I}from"./hotkeys-uKX61F1_.js";import{f as ue}from"./utils-CJJIceVn.js";import{r as H}from"./config-cCkBQ_ER.js";import{r as W,t as M}from"./useEventListener-COkmyg1v.js";import{t as de}from"./jsx-runtime-DN_bIXfG.js";import{n as L,t as G}from"./cn-C1rgT0yh.js";import{m as fe}from"./select-D0g5GnIs.js";import{E as pe,S as he,_ as F,w as me}from"./Combination-D1TsGrBC.js";import{l as ye}from"./dist-CBrDuocE.js";function be(){try{return window.__MARIMO_MOUNT_CONFIG__.version}catch{return E.warn("Failed to get version from mount config"),null}}const we=$(be()||"latest"),ge=$(!0),je=$(null);var ve={"Content-Type":"application/json"},xe=/\{[^{}]+\}/g,Re=class extends Request{constructor(s,r){for(let e in super(s,r),r)e in this||(this[e]=r[e])}};function ke(s){let{baseUrl:r="",fetch:e=globalThis.fetch,querySerializer:a,bodySerializer:t,headers:o,...n}={...s};r.endsWith("/")&&(r=r.substring(0,r.length-1)),o=X(ve,o);let i=[];async function u(l,c){let{fetch:f=e,headers:h,params:d={},parseAs:j="json",querySerializer:b,bodySerializer:k=t??Te,...R}=c||{},S=typeof a=="function"?a:B(a);b&&(S=typeof b=="function"?b:B({...typeof a=="object"?a:{},...b}));let m={redirect:"follow",...n,...R,headers:X(o,h,d.header)};m.body&&(m.body=k(m.body)),m.body instanceof FormData&&m.headers.delete("Content-Type");let v=new Re($e(l,{baseUrl:r,params:d,querySerializer:S}),m),N={baseUrl:r,fetch:f,parseAs:j,querySerializer:S,bodySerializer:k};for(let w of i)if(w&&typeof w=="object"&&typeof w.onRequest=="function"){v.schemaPath=l,v.params=d;let g=await w.onRequest(v,N);if(g){if(!(g instanceof Request))throw Error("Middleware must return new Request() when modifying the request");v=g}}let p=await f(v);for(let w=i.length-1;w>=0;w--){let g=i[w];if(g&&typeof g=="object"&&typeof g.onResponse=="function"){let q=await g.onResponse(p,N);if(q){if(!(q instanceof Response))throw Error("Middleware must return new Response() when modifying the response");p=q}}}if(p.status===204||p.headers.get("Content-Length")==="0")return p.ok?{data:{},response:p}:{error:{},response:p};if(p.ok)return j==="stream"?{data:p.body,response:p}:{data:await p[j](),response:p};let C=await p.text();try{C=JSON.parse(C)}catch{}return{error:C,response:p}}return{async GET(l,c){return u(l,{...c,method:"GET"})},async PUT(l,c){return u(l,{...c,method:"PUT"})},async POST(l,c){return u(l,{...c,method:"POST"})},async DELETE(l,c){return u(l,{...c,method:"DELETE"})},async OPTIONS(l,c){return u(l,{...c,method:"OPTIONS"})},async HEAD(l,c){return u(l,{...c,method:"HEAD"})},async PATCH(l,c){return u(l,{...c,method:"PATCH"})},async TRACE(l,c){return u(l,{...c,method:"TRACE"})},use(...l){for(let c of l)if(c){if(typeof c!="object"||!("onRequest"in c||"onResponse"in c))throw Error("Middleware must be an object with one of `onRequest()` or `onResponse()`");i.push(c)}},eject(...l){for(let c of l){let f=i.indexOf(c);f!==-1&&i.splice(f,1)}}}}function P(s,r,e){if(r==null)return"";if(typeof r=="object")throw Error("Deeply-nested arrays/objects aren\u2019t supported. Provide your own `querySerializer()` to handle these.");return`${s}=${(e==null?void 0:e.allowReserved)===!0?r:encodeURIComponent(r)}`}function J(s,r,e){if(!r||typeof r!="object")return"";let a=[],t={simple:",",label:".",matrix:";"}[e.style]||"&";if(e.style!=="deepObject"&&e.explode===!1){for(let i in r)a.push(i,e.allowReserved===!0?r[i]:encodeURIComponent(r[i]));let n=a.join(",");switch(e.style){case"form":return`${s}=${n}`;case"label":return`.${n}`;case"matrix":return`;${s}=${n}`;default:return n}}for(let n in r){let i=e.style==="deepObject"?`${s}[${n}]`:n;a.push(P(i,r[n],e))}let o=a.join(t);return e.style==="label"||e.style==="matrix"?`${t}${o}`:o}function V(s,r,e){if(!Array.isArray(r))return"";if(e.explode===!1){let o={form:",",spaceDelimited:"%20",pipeDelimited:"|"}[e.style]||",",n=(e.allowReserved===!0?r:r.map(i=>encodeURIComponent(i))).join(o);switch(e.style){case"simple":return n;case"label":return`.${n}`;case"matrix":return`;${s}=${n}`;default:return`${s}=${n}`}}let a={simple:",",label:".",matrix:";"}[e.style]||"&",t=[];for(let o of r)e.style==="simple"||e.style==="label"?t.push(e.allowReserved===!0?o:encodeURIComponent(o)):t.push(P(s,o,e));return e.style==="label"||e.style==="matrix"?`${a}${t.join(a)}`:t.join(a)}function B(s){return function(r){let e=[];if(r&&typeof r=="object")for(let a in r){let t=r[a];if(t!=null){if(Array.isArray(t)){e.push(V(a,t,{style:"form",explode:!0,...s==null?void 0:s.array,allowReserved:(s==null?void 0:s.allowReserved)||!1}));continue}if(typeof t=="object"){e.push(J(a,t,{style:"deepObject",explode:!0,...s==null?void 0:s.object,allowReserved:(s==null?void 0:s.allowReserved)||!1}));continue}e.push(P(a,t,s))}}return e.join("&")}}function Se(s,r){let e=s;for(let a of s.match(xe)??[]){let t=a.substring(1,a.length-1),o=!1,n="simple";if(t.endsWith("*")&&(o=!0,t=t.substring(0,t.length-1)),t.startsWith(".")?(n="label",t=t.substring(1)):t.startsWith(";")&&(n="matrix",t=t.substring(1)),!r||r[t]===void 0||r[t]===null)continue;let i=r[t];if(Array.isArray(i)){e=e.replace(a,V(t,i,{style:n,explode:o}));continue}if(typeof i=="object"){e=e.replace(a,J(t,i,{style:n,explode:o}));continue}if(n==="matrix"){e=e.replace(a,`;${P(t,i)}`);continue}e=e.replace(a,n==="label"?`.${i}`:i)}return e}function Te(s){return JSON.stringify(s)}function $e(s,r){var t;let e=`${r.baseUrl}${s}`;(t=r.params)!=null&&t.path&&(e=Se(e,r.params.path));let a=r.querySerializer(r.params.query??{});return a.startsWith("?")&&(a=a.substring(1)),a&&(e+=`?${a}`),e}function X(...s){let r=new Headers;for(let e of s){if(!e||typeof e!="object")continue;let a=e instanceof Headers?e.entries():Object.entries(e);for(let[t,o]of a)if(o===null)r.delete(t);else if(Array.isArray(o))for(let n of o)r.append(t,n);else o!==void 0&&r.set(t,o)}return r}function Ee(s){return ke(s)}function K(){let s=H().httpURL;return s.search="",s.hash="",s.toString()}const A={post(s,r,e={}){let a=`${_.withTrailingSlash(e.baseUrl??K())}api${s}`;return fetch(a,{method:"POST",headers:{"Content-Type":"application/json",...A.headers(),...e.headers},body:JSON.stringify(r),signal:e.signal}).then(async t=>{var n;let o=(n=t.headers.get("Content-Type"))==null?void 0:n.startsWith("application/json");if(!t.ok){let i=o?await t.json():await t.text();throw Error(t.statusText,{cause:i})}return o?t.json():t.text()}).catch(t=>{throw E.error(`Error requesting ${a}`,t),t})},get(s,r={}){let e=`${_.withTrailingSlash(r.baseUrl??K())}api${s}`;return fetch(e,{method:"GET",headers:{...A.headers(),...r.headers}}).then(a=>{var t;if(!a.ok)throw Error(a.statusText);return(t=a.headers.get("Content-Type"))!=null&&t.startsWith("application/json")?a.json():null}).catch(a=>{throw E.error(`Error requesting ${e}`,a),a})},headers(){return H().headers()},handleResponse:s=>s.error?Promise.reject(s.error):Promise.resolve(s.data),handleResponseReturnNull:s=>s.error?Promise.reject(s.error):Promise.resolve(null)};function Pe(s){let r=Ee({baseUrl:s.httpURL.toString()});return r.use({onRequest:e=>{let a=s.headers();for(let[t,o]of Object.entries(a))e.headers.set(t,o);return e}}),r}var Q=$({});function Oe(){return U(Q)}function Ce(){let s=ne(Q);return{registerAction:T((r,e)=>{s(a=>({...a,[r]:e}))}),unregisterAction:T(r=>{s(e=>{let{[r]:a,...t}=e;return t})})}}var Y=D(),y=z(ie(),1);function qe(s,r){let e=(0,Y.c)(13),{registerAction:a,unregisterAction:t}=Ce(),o=U(ue),n=r===ce.NOOP,i;e[0]===r?i=e[1]:(i=d=>r(d),e[0]=r,e[1]=i);let u=T(i),l;e[2]!==r||e[3]!==o||e[4]!==s?(l=d=>{if(d.defaultPrevented)return;let j=o.getHotkey(s).key;I(j)(d)&&r(d)!==!1&&(d.preventDefault(),d.stopPropagation())},e[2]=r,e[3]=o,e[4]=s,e[5]=l):l=e[5];let c=T(l);M(document,"keydown",c);let f,h;e[6]!==n||e[7]!==u||e[8]!==a||e[9]!==s||e[10]!==t?(f=()=>{if(!n)return a(s,u),()=>t(s)},h=[u,s,n,a,t],e[6]=n,e[7]=u,e[8]=a,e[9]=s,e[10]=t,e[11]=f,e[12]=h):(f=e[11],h=e[12]),(0,y.useEffect)(f,h)}function Ae(s,r){let e=(0,Y.c)(2),a;e[0]===r?a=e[1]:(a=t=>{if(!t.defaultPrevented)for(let[o,n]of le.entries(r))I(o)(t)&&(E.debug("Satisfied",o,t),n(t)!==!1&&(t.preventDefault(),t.stopPropagation()))},e[0]=r,e[1]=a),M(s,"keydown",a)}var x=z(de(),1),O="Switch",[Ne,rt]=pe(O),[ze,Ue]=Ne(O),Z=y.forwardRef((s,r)=>{let{__scopeSwitch:e,name:a,checked:t,defaultChecked:o,required:n,disabled:i,value:u="on",onCheckedChange:l,form:c,...f}=s,[h,d]=y.useState(null),j=W(r,m=>d(m)),b=y.useRef(!1),k=h?c||!!h.closest("form"):!0,[R,S]=he({prop:t,defaultProp:o??!1,onChange:l,caller:O});return(0,x.jsxs)(ze,{scope:e,checked:R,disabled:i,children:[(0,x.jsx)(F.button,{type:"button",role:"switch","aria-checked":R,"aria-required":n,"data-state":se(R),"data-disabled":i?"":void 0,disabled:i,value:u,...f,ref:j,onClick:me(s.onClick,m=>{S(v=>!v),k&&(b.current=m.isPropagationStopped(),b.current||m.stopPropagation())})}),k&&(0,x.jsx)(re,{control:h,bubbles:!b.current,name:a,value:u,checked:R,required:n,disabled:i,form:c,style:{transform:"translateX(-100%)"}})]})});Z.displayName=O;var ee="SwitchThumb",te=y.forwardRef((s,r)=>{let{__scopeSwitch:e,...a}=s,t=Ue(ee,e);return(0,x.jsx)(F.span,{"data-state":se(t.checked),"data-disabled":t.disabled?"":void 0,...a,ref:r})});te.displayName=ee;var _e="SwitchBubbleInput",re=y.forwardRef(({__scopeSwitch:s,control:r,checked:e,bubbles:a=!0,...t},o)=>{let n=y.useRef(null),i=W(n,o),u=fe(e),l=ye(r);return y.useEffect(()=>{let c=n.current;if(!c)return;let f=window.HTMLInputElement.prototype,h=Object.getOwnPropertyDescriptor(f,"checked").set;if(u!==e&&h){let d=new Event("click",{bubbles:a});h.call(c,e),c.dispatchEvent(d)}},[u,e,a]),(0,x.jsx)("input",{type:"checkbox","aria-hidden":!0,defaultChecked:e,...t,tabIndex:-1,ref:i,style:{...t.style,...l,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});re.displayName=_e;function se(s){return s?"checked":"unchecked"}var ae=Z,De=te,Ie=D(),He=L("peer inline-flex shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-hidden focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input",{variants:{size:{default:"h-6 w-11 mb-1",sm:"h-4.5 w-8.5",xs:"h-4 w-7"}},defaultVariants:{size:"default"}}),We=L("pointer-events-none block rounded-full bg-background shadow-xs ring-0 transition-transform",{variants:{size:{default:"h-5 w-5 data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0",sm:"h-3.5 w-3.5 data-[state=checked]:translate-x-4 data-[state=unchecked]:translate-x-0",xs:"h-3 w-3 data-[state=checked]:translate-x-3 data-[state=unchecked]:translate-x-0"}},defaultVariants:{size:"default"}}),oe=y.forwardRef((s,r)=>{let e=(0,Ie.c)(16),a,t,o;e[0]===s?(a=e[1],t=e[2],o=e[3]):({className:a,size:o,...t}=s,e[0]=s,e[1]=a,e[2]=t,e[3]=o);let n;e[4]!==a||e[5]!==o?(n=G(He({size:o}),a),e[4]=a,e[5]=o,e[6]=n):n=e[6];let i;e[7]===o?i=e[8]:(i=G(We({size:o})),e[7]=o,e[8]=i);let u;e[9]===i?u=e[10]:(u=(0,x.jsx)(De,{className:i}),e[9]=i,e[10]=u);let l;return e[11]!==t||e[12]!==r||e[13]!==n||e[14]!==u?(l=(0,x.jsx)(ae,{className:n,...t,ref:r,children:u}),e[11]=t,e[12]=r,e[13]=n,e[14]=u,e[15]=l):l=e[15],l});oe.displayName=ae.displayName;export{A as a,je as c,Oe as i,ge as l,qe as n,Pe as o,Ae as r,we as s,oe as t};
1
+ import{s as z}from"./chunk-LvLJmgfZ.js";import{d as ne,n as T,p as $,u as U}from"./useEvent-DlWF5OMa.js";import{t as ie}from"./react-BGmjiNul.js";import{W as _}from"./cells-BLhvmrVl.js";import{t as D}from"./compiler-runtime-DeeZ7FnK.js";import{a as le,d as E,f as ce,l as I}from"./hotkeys-uKX61F1_.js";import{f as ue}from"./utils-CJJIceVn.js";import{r as H}from"./config-babG4OBR.js";import{r as W,t as M}from"./useEventListener-COkmyg1v.js";import{t as de}from"./jsx-runtime-DN_bIXfG.js";import{n as L,t as G}from"./cn-C1rgT0yh.js";import{m as fe}from"./select-D0g5GnIs.js";import{E as pe,S as he,_ as F,w as me}from"./Combination-D1TsGrBC.js";import{l as ye}from"./dist-CBrDuocE.js";function be(){try{return window.__MARIMO_MOUNT_CONFIG__.version}catch{return E.warn("Failed to get version from mount config"),null}}const we=$(be()||"latest"),ge=$(!0),je=$(null);var ve={"Content-Type":"application/json"},xe=/\{[^{}]+\}/g,Re=class extends Request{constructor(s,r){for(let e in super(s,r),r)e in this||(this[e]=r[e])}};function ke(s){let{baseUrl:r="",fetch:e=globalThis.fetch,querySerializer:a,bodySerializer:t,headers:o,...n}={...s};r.endsWith("/")&&(r=r.substring(0,r.length-1)),o=X(ve,o);let i=[];async function u(l,c){let{fetch:f=e,headers:h,params:d={},parseAs:j="json",querySerializer:b,bodySerializer:k=t??Te,...R}=c||{},S=typeof a=="function"?a:B(a);b&&(S=typeof b=="function"?b:B({...typeof a=="object"?a:{},...b}));let m={redirect:"follow",...n,...R,headers:X(o,h,d.header)};m.body&&(m.body=k(m.body)),m.body instanceof FormData&&m.headers.delete("Content-Type");let v=new Re($e(l,{baseUrl:r,params:d,querySerializer:S}),m),N={baseUrl:r,fetch:f,parseAs:j,querySerializer:S,bodySerializer:k};for(let w of i)if(w&&typeof w=="object"&&typeof w.onRequest=="function"){v.schemaPath=l,v.params=d;let g=await w.onRequest(v,N);if(g){if(!(g instanceof Request))throw Error("Middleware must return new Request() when modifying the request");v=g}}let p=await f(v);for(let w=i.length-1;w>=0;w--){let g=i[w];if(g&&typeof g=="object"&&typeof g.onResponse=="function"){let q=await g.onResponse(p,N);if(q){if(!(q instanceof Response))throw Error("Middleware must return new Response() when modifying the response");p=q}}}if(p.status===204||p.headers.get("Content-Length")==="0")return p.ok?{data:{},response:p}:{error:{},response:p};if(p.ok)return j==="stream"?{data:p.body,response:p}:{data:await p[j](),response:p};let C=await p.text();try{C=JSON.parse(C)}catch{}return{error:C,response:p}}return{async GET(l,c){return u(l,{...c,method:"GET"})},async PUT(l,c){return u(l,{...c,method:"PUT"})},async POST(l,c){return u(l,{...c,method:"POST"})},async DELETE(l,c){return u(l,{...c,method:"DELETE"})},async OPTIONS(l,c){return u(l,{...c,method:"OPTIONS"})},async HEAD(l,c){return u(l,{...c,method:"HEAD"})},async PATCH(l,c){return u(l,{...c,method:"PATCH"})},async TRACE(l,c){return u(l,{...c,method:"TRACE"})},use(...l){for(let c of l)if(c){if(typeof c!="object"||!("onRequest"in c||"onResponse"in c))throw Error("Middleware must be an object with one of `onRequest()` or `onResponse()`");i.push(c)}},eject(...l){for(let c of l){let f=i.indexOf(c);f!==-1&&i.splice(f,1)}}}}function P(s,r,e){if(r==null)return"";if(typeof r=="object")throw Error("Deeply-nested arrays/objects aren\u2019t supported. Provide your own `querySerializer()` to handle these.");return`${s}=${(e==null?void 0:e.allowReserved)===!0?r:encodeURIComponent(r)}`}function J(s,r,e){if(!r||typeof r!="object")return"";let a=[],t={simple:",",label:".",matrix:";"}[e.style]||"&";if(e.style!=="deepObject"&&e.explode===!1){for(let i in r)a.push(i,e.allowReserved===!0?r[i]:encodeURIComponent(r[i]));let n=a.join(",");switch(e.style){case"form":return`${s}=${n}`;case"label":return`.${n}`;case"matrix":return`;${s}=${n}`;default:return n}}for(let n in r){let i=e.style==="deepObject"?`${s}[${n}]`:n;a.push(P(i,r[n],e))}let o=a.join(t);return e.style==="label"||e.style==="matrix"?`${t}${o}`:o}function V(s,r,e){if(!Array.isArray(r))return"";if(e.explode===!1){let o={form:",",spaceDelimited:"%20",pipeDelimited:"|"}[e.style]||",",n=(e.allowReserved===!0?r:r.map(i=>encodeURIComponent(i))).join(o);switch(e.style){case"simple":return n;case"label":return`.${n}`;case"matrix":return`;${s}=${n}`;default:return`${s}=${n}`}}let a={simple:",",label:".",matrix:";"}[e.style]||"&",t=[];for(let o of r)e.style==="simple"||e.style==="label"?t.push(e.allowReserved===!0?o:encodeURIComponent(o)):t.push(P(s,o,e));return e.style==="label"||e.style==="matrix"?`${a}${t.join(a)}`:t.join(a)}function B(s){return function(r){let e=[];if(r&&typeof r=="object")for(let a in r){let t=r[a];if(t!=null){if(Array.isArray(t)){e.push(V(a,t,{style:"form",explode:!0,...s==null?void 0:s.array,allowReserved:(s==null?void 0:s.allowReserved)||!1}));continue}if(typeof t=="object"){e.push(J(a,t,{style:"deepObject",explode:!0,...s==null?void 0:s.object,allowReserved:(s==null?void 0:s.allowReserved)||!1}));continue}e.push(P(a,t,s))}}return e.join("&")}}function Se(s,r){let e=s;for(let a of s.match(xe)??[]){let t=a.substring(1,a.length-1),o=!1,n="simple";if(t.endsWith("*")&&(o=!0,t=t.substring(0,t.length-1)),t.startsWith(".")?(n="label",t=t.substring(1)):t.startsWith(";")&&(n="matrix",t=t.substring(1)),!r||r[t]===void 0||r[t]===null)continue;let i=r[t];if(Array.isArray(i)){e=e.replace(a,V(t,i,{style:n,explode:o}));continue}if(typeof i=="object"){e=e.replace(a,J(t,i,{style:n,explode:o}));continue}if(n==="matrix"){e=e.replace(a,`;${P(t,i)}`);continue}e=e.replace(a,n==="label"?`.${i}`:i)}return e}function Te(s){return JSON.stringify(s)}function $e(s,r){var t;let e=`${r.baseUrl}${s}`;(t=r.params)!=null&&t.path&&(e=Se(e,r.params.path));let a=r.querySerializer(r.params.query??{});return a.startsWith("?")&&(a=a.substring(1)),a&&(e+=`?${a}`),e}function X(...s){let r=new Headers;for(let e of s){if(!e||typeof e!="object")continue;let a=e instanceof Headers?e.entries():Object.entries(e);for(let[t,o]of a)if(o===null)r.delete(t);else if(Array.isArray(o))for(let n of o)r.append(t,n);else o!==void 0&&r.set(t,o)}return r}function Ee(s){return ke(s)}function K(){let s=H().httpURL;return s.search="",s.hash="",s.toString()}const A={post(s,r,e={}){let a=`${_.withTrailingSlash(e.baseUrl??K())}api${s}`;return fetch(a,{method:"POST",headers:{"Content-Type":"application/json",...A.headers(),...e.headers},body:JSON.stringify(r),signal:e.signal}).then(async t=>{var n;let o=(n=t.headers.get("Content-Type"))==null?void 0:n.startsWith("application/json");if(!t.ok){let i=o?await t.json():await t.text();throw Error(t.statusText,{cause:i})}return o?t.json():t.text()}).catch(t=>{throw E.error(`Error requesting ${a}`,t),t})},get(s,r={}){let e=`${_.withTrailingSlash(r.baseUrl??K())}api${s}`;return fetch(e,{method:"GET",headers:{...A.headers(),...r.headers}}).then(a=>{var t;if(!a.ok)throw Error(a.statusText);return(t=a.headers.get("Content-Type"))!=null&&t.startsWith("application/json")?a.json():null}).catch(a=>{throw E.error(`Error requesting ${e}`,a),a})},headers(){return H().headers()},handleResponse:s=>s.error?Promise.reject(s.error):Promise.resolve(s.data),handleResponseReturnNull:s=>s.error?Promise.reject(s.error):Promise.resolve(null)};function Pe(s){let r=Ee({baseUrl:s.httpURL.toString()});return r.use({onRequest:e=>{let a=s.headers();for(let[t,o]of Object.entries(a))e.headers.set(t,o);return e}}),r}var Q=$({});function Oe(){return U(Q)}function Ce(){let s=ne(Q);return{registerAction:T((r,e)=>{s(a=>({...a,[r]:e}))}),unregisterAction:T(r=>{s(e=>{let{[r]:a,...t}=e;return t})})}}var Y=D(),y=z(ie(),1);function qe(s,r){let e=(0,Y.c)(13),{registerAction:a,unregisterAction:t}=Ce(),o=U(ue),n=r===ce.NOOP,i;e[0]===r?i=e[1]:(i=d=>r(d),e[0]=r,e[1]=i);let u=T(i),l;e[2]!==r||e[3]!==o||e[4]!==s?(l=d=>{if(d.defaultPrevented)return;let j=o.getHotkey(s).key;I(j)(d)&&r(d)!==!1&&(d.preventDefault(),d.stopPropagation())},e[2]=r,e[3]=o,e[4]=s,e[5]=l):l=e[5];let c=T(l);M(document,"keydown",c);let f,h;e[6]!==n||e[7]!==u||e[8]!==a||e[9]!==s||e[10]!==t?(f=()=>{if(!n)return a(s,u),()=>t(s)},h=[u,s,n,a,t],e[6]=n,e[7]=u,e[8]=a,e[9]=s,e[10]=t,e[11]=f,e[12]=h):(f=e[11],h=e[12]),(0,y.useEffect)(f,h)}function Ae(s,r){let e=(0,Y.c)(2),a;e[0]===r?a=e[1]:(a=t=>{if(!t.defaultPrevented)for(let[o,n]of le.entries(r))I(o)(t)&&(E.debug("Satisfied",o,t),n(t)!==!1&&(t.preventDefault(),t.stopPropagation()))},e[0]=r,e[1]=a),M(s,"keydown",a)}var x=z(de(),1),O="Switch",[Ne,rt]=pe(O),[ze,Ue]=Ne(O),Z=y.forwardRef((s,r)=>{let{__scopeSwitch:e,name:a,checked:t,defaultChecked:o,required:n,disabled:i,value:u="on",onCheckedChange:l,form:c,...f}=s,[h,d]=y.useState(null),j=W(r,m=>d(m)),b=y.useRef(!1),k=h?c||!!h.closest("form"):!0,[R,S]=he({prop:t,defaultProp:o??!1,onChange:l,caller:O});return(0,x.jsxs)(ze,{scope:e,checked:R,disabled:i,children:[(0,x.jsx)(F.button,{type:"button",role:"switch","aria-checked":R,"aria-required":n,"data-state":se(R),"data-disabled":i?"":void 0,disabled:i,value:u,...f,ref:j,onClick:me(s.onClick,m=>{S(v=>!v),k&&(b.current=m.isPropagationStopped(),b.current||m.stopPropagation())})}),k&&(0,x.jsx)(re,{control:h,bubbles:!b.current,name:a,value:u,checked:R,required:n,disabled:i,form:c,style:{transform:"translateX(-100%)"}})]})});Z.displayName=O;var ee="SwitchThumb",te=y.forwardRef((s,r)=>{let{__scopeSwitch:e,...a}=s,t=Ue(ee,e);return(0,x.jsx)(F.span,{"data-state":se(t.checked),"data-disabled":t.disabled?"":void 0,...a,ref:r})});te.displayName=ee;var _e="SwitchBubbleInput",re=y.forwardRef(({__scopeSwitch:s,control:r,checked:e,bubbles:a=!0,...t},o)=>{let n=y.useRef(null),i=W(n,o),u=fe(e),l=ye(r);return y.useEffect(()=>{let c=n.current;if(!c)return;let f=window.HTMLInputElement.prototype,h=Object.getOwnPropertyDescriptor(f,"checked").set;if(u!==e&&h){let d=new Event("click",{bubbles:a});h.call(c,e),c.dispatchEvent(d)}},[u,e,a]),(0,x.jsx)("input",{type:"checkbox","aria-hidden":!0,defaultChecked:e,...t,tabIndex:-1,ref:i,style:{...t.style,...l,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});re.displayName=_e;function se(s){return s?"checked":"unchecked"}var ae=Z,De=te,Ie=D(),He=L("peer inline-flex shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-hidden focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input",{variants:{size:{default:"h-6 w-11 mb-1",sm:"h-4.5 w-8.5",xs:"h-4 w-7"}},defaultVariants:{size:"default"}}),We=L("pointer-events-none block rounded-full bg-background shadow-xs ring-0 transition-transform",{variants:{size:{default:"h-5 w-5 data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0",sm:"h-3.5 w-3.5 data-[state=checked]:translate-x-4 data-[state=unchecked]:translate-x-0",xs:"h-3 w-3 data-[state=checked]:translate-x-3 data-[state=unchecked]:translate-x-0"}},defaultVariants:{size:"default"}}),oe=y.forwardRef((s,r)=>{let e=(0,Ie.c)(16),a,t,o;e[0]===s?(a=e[1],t=e[2],o=e[3]):({className:a,size:o,...t}=s,e[0]=s,e[1]=a,e[2]=t,e[3]=o);let n;e[4]!==a||e[5]!==o?(n=G(He({size:o}),a),e[4]=a,e[5]=o,e[6]=n):n=e[6];let i;e[7]===o?i=e[8]:(i=G(We({size:o})),e[7]=o,e[8]=i);let u;e[9]===i?u=e[10]:(u=(0,x.jsx)(De,{className:i}),e[9]=i,e[10]=u);let l;return e[11]!==t||e[12]!==r||e[13]!==n||e[14]!==u?(l=(0,x.jsx)(ae,{className:n,...t,ref:r,children:u}),e[11]=t,e[12]=r,e[13]=n,e[14]=u,e[15]=l):l=e[15],l});oe.displayName=ae.displayName;export{A as a,je as c,Oe as i,ge as l,qe as n,Pe as o,Ae as r,we as s,oe as t};
@@ -1,4 +1,4 @@
1
- var oi,ai,hi;import{s as Mt,t as At}from"./chunk-LvLJmgfZ.js";import{n as $e}from"./useEvent-DlWF5OMa.js";import{t as Li}from"./react-BGmjiNul.js";import"./react-dom-C9fstfnp.js";import{t as xi}from"./compiler-runtime-DeeZ7FnK.js";import{d as Ze}from"./hotkeys-uKX61F1_.js";import{k as Ei,o as ki}from"./config-cCkBQ_ER.js";import{t as Di}from"./jsx-runtime-DN_bIXfG.js";import{t as Tt}from"./cn-C1rgT0yh.js";import{t as Ri}from"./createLucideIcon-CW2xpJ57.js";import{t as Mi}from"./clipboard-paste-CusmeEPf.js";import{t as Ai}from"./copy-gBVL4NN-.js";import{t as Ti}from"./trash-2-C-lF7BNB.js";import"./Combination-D1TsGrBC.js";import{n as Bi}from"./useDebounce-em3gna-v.js";import{t as Oi}from"./copy-DRhpWiOq.js";import{n as Pi}from"./renderShortcut-D0Pei-OA.js";import{n as Ii,t as Hi}from"./state-CIznbe1J.js";var Fi=Ri("text-select",[["path",{d:"M14 21h1",key:"v9vybs"}],["path",{d:"M14 3h1",key:"1ec4yj"}],["path",{d:"M19 3a2 2 0 0 1 2 2",key:"18rm91"}],["path",{d:"M21 14v1",key:"169vum"}],["path",{d:"M21 19a2 2 0 0 1-2 2",key:"1j7049"}],["path",{d:"M21 9v1",key:"mxsmne"}],["path",{d:"M3 14v1",key:"vnatye"}],["path",{d:"M3 9v1",key:"1r0deq"}],["path",{d:"M5 21a2 2 0 0 1-2-2",key:"sbafld"}],["path",{d:"M5 3a2 2 0 0 0-2 2",key:"y57alp"}],["path",{d:"M7 12h10",key:"b7w52i"}],["path",{d:"M7 16h6",key:"1vyc9m"}],["path",{d:"M7 8h8",key:"1jbsf9"}],["path",{d:"M9 21h1",key:"15o7lz"}],["path",{d:"M9 3h1",key:"1yesri"}]]),Wi=xi(),$i=class{constructor(g,_){this._disposables=[],this._socket=g,this._socket.binaryType="arraybuffer",this._bidirectional=!(_&&_.bidirectional===!1)}activate(g){this._disposables.push(et(this._socket,"message",_=>{let b=_.data;g.write(typeof b=="string"?b:new Uint8Array(b))})),this._bidirectional&&(this._disposables.push(g.onData(_=>this._sendData(_))),this._disposables.push(g.onBinary(_=>this._sendBinary(_)))),this._disposables.push(et(this._socket,"close",()=>this.dispose())),this._disposables.push(et(this._socket,"error",()=>this.dispose()))}dispose(){for(let g of this._disposables)g.dispose()}_sendData(g){this._checkOpenSocket()&&this._socket.send(g)}_sendBinary(g){if(!this._checkOpenSocket())return;let _=new Uint8Array(g.length);for(let b=0;b<g.length;++b)_[b]=g.charCodeAt(b)&255;this._socket.send(_)}_checkOpenSocket(){switch(this._socket.readyState){case WebSocket.OPEN:return!0;case WebSocket.CONNECTING:throw Error("Attach addon was loaded before socket was open");case WebSocket.CLOSING:return console.warn("Attach addon socket is closing"),!1;case WebSocket.CLOSED:throw Error("Attach addon socket is closed");default:throw Error("Unexpected socket state")}}};function et(g,_,b){return g.addEventListener(_,b),{dispose:()=>{b&&g.removeEventListener(_,b)}}}var Ni=At(((g,_)=>{(function(b,E){typeof g=="object"&&typeof _=="object"?_.exports=E():typeof define=="function"&&define.amd?define([],E):typeof g=="object"?g.CanvasAddon=E():b.CanvasAddon=E()})(self,(()=>(()=>{var b={903:(A,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.BaseRenderLayer=void 0;let l=a(274),u=a(627),n=a(237),f=a(860),p=a(374),S=a(296),r=a(345),e=a(859),o=a(399),s=a(855);class i extends e.Disposable{get canvas(){return this._canvas}get cacheCanvas(){var d;return(d=this._charAtlas)==null?void 0:d.pages[0].canvas}constructor(d,c,v,C,k,D,x,y,L,M){super(),this._terminal=d,this._container=c,this._alpha=k,this._themeService=D,this._bufferService=x,this._optionsService=y,this._decorationService=L,this._coreBrowserService=M,this._deviceCharWidth=0,this._deviceCharHeight=0,this._deviceCellWidth=0,this._deviceCellHeight=0,this._deviceCharLeft=0,this._deviceCharTop=0,this._selectionModel=(0,S.createSelectionRenderModel)(),this._bitmapGenerator=[],this._charAtlasDisposable=this.register(new e.MutableDisposable),this._onAddTextureAtlasCanvas=this.register(new r.EventEmitter),this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event,this._cellColorResolver=new l.CellColorResolver(this._terminal,this._optionsService,this._selectionModel,this._decorationService,this._coreBrowserService,this._themeService),this._canvas=this._coreBrowserService.mainDocument.createElement("canvas"),this._canvas.classList.add(`xterm-${v}-layer`),this._canvas.style.zIndex=C.toString(),this._initCanvas(),this._container.appendChild(this._canvas),this._refreshCharAtlas(this._themeService.colors),this.register(this._themeService.onChangeColors((B=>{this._refreshCharAtlas(B),this.reset(),this.handleSelectionChanged(this._selectionModel.selectionStart,this._selectionModel.selectionEnd,this._selectionModel.columnSelectMode)}))),this.register((0,e.toDisposable)((()=>{this._canvas.remove()})))}_initCanvas(){this._ctx=(0,p.throwIfFalsy)(this._canvas.getContext("2d",{alpha:this._alpha})),this._alpha||this._clearAll()}handleBlur(){}handleFocus(){}handleCursorMove(){}handleGridChanged(d,c){}handleSelectionChanged(d,c,v=!1){this._selectionModel.update(this._terminal._core,d,c,v)}_setTransparency(d){if(d===this._alpha)return;let c=this._canvas;this._alpha=d,this._canvas=this._canvas.cloneNode(),this._initCanvas(),this._container.replaceChild(this._canvas,c),this._refreshCharAtlas(this._themeService.colors),this.handleGridChanged(0,this._bufferService.rows-1)}_refreshCharAtlas(d){if(!(this._deviceCharWidth<=0&&this._deviceCharHeight<=0)){this._charAtlas=(0,u.acquireTextureAtlas)(this._terminal,this._optionsService.rawOptions,d,this._deviceCellWidth,this._deviceCellHeight,this._deviceCharWidth,this._deviceCharHeight,this._coreBrowserService.dpr),this._charAtlasDisposable.value=(0,r.forwardEvent)(this._charAtlas.onAddTextureAtlasCanvas,this._onAddTextureAtlasCanvas),this._charAtlas.warmUp();for(let c=0;c<this._charAtlas.pages.length;c++)this._bitmapGenerator[c]=new h(this._charAtlas.pages[c].canvas)}}resize(d){this._deviceCellWidth=d.device.cell.width,this._deviceCellHeight=d.device.cell.height,this._deviceCharWidth=d.device.char.width,this._deviceCharHeight=d.device.char.height,this._deviceCharLeft=d.device.char.left,this._deviceCharTop=d.device.char.top,this._canvas.width=d.device.canvas.width,this._canvas.height=d.device.canvas.height,this._canvas.style.width=`${d.css.canvas.width}px`,this._canvas.style.height=`${d.css.canvas.height}px`,this._alpha||this._clearAll(),this._refreshCharAtlas(this._themeService.colors)}clearTextureAtlas(){var d;(d=this._charAtlas)==null||d.clearTexture()}_fillCells(d,c,v,C){this._ctx.fillRect(d*this._deviceCellWidth,c*this._deviceCellHeight,v*this._deviceCellWidth,C*this._deviceCellHeight)}_fillMiddleLineAtCells(d,c,v=1){let C=Math.ceil(.5*this._deviceCellHeight);this._ctx.fillRect(d*this._deviceCellWidth,(c+1)*this._deviceCellHeight-C-this._coreBrowserService.dpr,v*this._deviceCellWidth,this._coreBrowserService.dpr)}_fillBottomLineAtCells(d,c,v=1,C=0){this._ctx.fillRect(d*this._deviceCellWidth,(c+1)*this._deviceCellHeight+C-this._coreBrowserService.dpr-1,v*this._deviceCellWidth,this._coreBrowserService.dpr)}_curlyUnderlineAtCell(d,c,v=1){this._ctx.save(),this._ctx.beginPath(),this._ctx.strokeStyle=this._ctx.fillStyle;let C=this._coreBrowserService.dpr;this._ctx.lineWidth=C;for(let k=0;k<v;k++){let D=(d+k)*this._deviceCellWidth,x=(d+k+.5)*this._deviceCellWidth,y=(d+k+1)*this._deviceCellWidth,L=(c+1)*this._deviceCellHeight-C-1,M=L-C,B=L+C;this._ctx.moveTo(D,L),this._ctx.bezierCurveTo(D,M,x,M,x,L),this._ctx.bezierCurveTo(x,B,y,B,y,L)}this._ctx.stroke(),this._ctx.restore()}_dottedUnderlineAtCell(d,c,v=1){this._ctx.save(),this._ctx.beginPath(),this._ctx.strokeStyle=this._ctx.fillStyle;let C=this._coreBrowserService.dpr;this._ctx.lineWidth=C,this._ctx.setLineDash([2*C,C]);let k=d*this._deviceCellWidth,D=(c+1)*this._deviceCellHeight-C-1;this._ctx.moveTo(k,D);for(let x=0;x<v;x++){let y=(d+v+x)*this._deviceCellWidth;this._ctx.lineTo(y,D)}this._ctx.stroke(),this._ctx.closePath(),this._ctx.restore()}_dashedUnderlineAtCell(d,c,v=1){this._ctx.save(),this._ctx.beginPath(),this._ctx.strokeStyle=this._ctx.fillStyle;let C=this._coreBrowserService.dpr;this._ctx.lineWidth=C,this._ctx.setLineDash([4*C,3*C]);let k=d*this._deviceCellWidth,D=(d+v)*this._deviceCellWidth,x=(c+1)*this._deviceCellHeight-C-1;this._ctx.moveTo(k,x),this._ctx.lineTo(D,x),this._ctx.stroke(),this._ctx.closePath(),this._ctx.restore()}_fillLeftLineAtCell(d,c,v){this._ctx.fillRect(d*this._deviceCellWidth,c*this._deviceCellHeight,this._coreBrowserService.dpr*v,this._deviceCellHeight)}_strokeRectAtCell(d,c,v,C){let k=this._coreBrowserService.dpr;this._ctx.lineWidth=k,this._ctx.strokeRect(d*this._deviceCellWidth+k/2,c*this._deviceCellHeight+k/2,v*this._deviceCellWidth-k,C*this._deviceCellHeight-k)}_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(d,c,v,C){this._alpha?this._ctx.clearRect(d*this._deviceCellWidth,c*this._deviceCellHeight,v*this._deviceCellWidth,C*this._deviceCellHeight):(this._ctx.fillStyle=this._themeService.colors.background.css,this._ctx.fillRect(d*this._deviceCellWidth,c*this._deviceCellHeight,v*this._deviceCellWidth,C*this._deviceCellHeight))}_fillCharTrueColor(d,c,v){this._ctx.font=this._getFont(!1,!1),this._ctx.textBaseline=n.TEXT_BASELINE,this._clipRow(v);let C=!1;this._optionsService.rawOptions.customGlyphs!==!1&&(C=(0,f.tryDrawCustomChar)(this._ctx,d.getChars(),c*this._deviceCellWidth,v*this._deviceCellHeight,this._deviceCellWidth,this._deviceCellHeight,this._optionsService.rawOptions.fontSize,this._coreBrowserService.dpr)),C||this._ctx.fillText(d.getChars(),c*this._deviceCellWidth+this._deviceCharLeft,v*this._deviceCellHeight+this._deviceCharTop+this._deviceCharHeight)}_drawChars(d,c,v){var L,M,B,P;let C=d.getChars(),k=d.getCode(),D=d.getWidth();if(this._cellColorResolver.resolve(d,c,this._bufferService.buffer.ydisp+v,this._deviceCellWidth),!this._charAtlas)return;let x;if(x=C&&C.length>1?this._charAtlas.getRasterizedGlyphCombinedChar(C,this._cellColorResolver.result.bg,this._cellColorResolver.result.fg,this._cellColorResolver.result.ext,!0):this._charAtlas.getRasterizedGlyph(d.getCode()||s.WHITESPACE_CELL_CODE,this._cellColorResolver.result.bg,this._cellColorResolver.result.fg,this._cellColorResolver.result.ext,!0),!x.size.x||!x.size.y)return;this._ctx.save(),this._clipRow(v),this._bitmapGenerator[x.texturePage]&&this._charAtlas.pages[x.texturePage].canvas!==this._bitmapGenerator[x.texturePage].canvas&&((M=(L=this._bitmapGenerator[x.texturePage])==null?void 0:L.bitmap)==null||M.close(),delete this._bitmapGenerator[x.texturePage]),this._charAtlas.pages[x.texturePage].version!==((B=this._bitmapGenerator[x.texturePage])==null?void 0:B.version)&&(this._bitmapGenerator[x.texturePage]||(this._bitmapGenerator[x.texturePage]=new h(this._charAtlas.pages[x.texturePage].canvas)),this._bitmapGenerator[x.texturePage].refresh(),this._bitmapGenerator[x.texturePage].version=this._charAtlas.pages[x.texturePage].version);let y=x.size.x;this._optionsService.rawOptions.rescaleOverlappingGlyphs&&(0,p.allowRescaling)(k,D,x.size.x,this._deviceCellWidth)&&(y=this._deviceCellWidth-1),this._ctx.drawImage(((P=this._bitmapGenerator[x.texturePage])==null?void 0:P.bitmap)||this._charAtlas.pages[x.texturePage].canvas,x.texturePosition.x,x.texturePosition.y,x.size.x,x.size.y,c*this._deviceCellWidth+this._deviceCharLeft-x.offset.x,v*this._deviceCellHeight+this._deviceCharTop-x.offset.y,y,x.size.y),this._ctx.restore()}_clipRow(d){this._ctx.beginPath(),this._ctx.rect(0,d*this._deviceCellHeight,this._bufferService.cols*this._deviceCellWidth,this._deviceCellHeight),this._ctx.clip()}_getFont(d,c){return`${c?"italic":""} ${d?this._optionsService.rawOptions.fontWeightBold:this._optionsService.rawOptions.fontWeight} ${this._optionsService.rawOptions.fontSize*this._coreBrowserService.dpr}px ${this._optionsService.rawOptions.fontFamily}`}}t.BaseRenderLayer=i;class h{get bitmap(){return this._bitmap}constructor(d){this.canvas=d,this._state=0,this._commitTimeout=void 0,this._bitmap=void 0,this.version=-1}refresh(){var d;(d=this._bitmap)==null||d.close(),this._bitmap=void 0,o.isSafari||(this._commitTimeout===void 0&&(this._commitTimeout=window.setTimeout((()=>this._generate()),100)),this._state===1&&(this._state=2))}_generate(){var d;this._state===0&&((d=this._bitmap)==null||d.close(),this._bitmap=void 0,this._state=1,window.createImageBitmap(this.canvas).then((c=>{this._state===2?this.refresh():this._bitmap=c,this._state=0})),this._commitTimeout&&(this._commitTimeout=void 0))}}},949:(A,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CanvasRenderer=void 0;let l=a(627),u=a(56),n=a(374),f=a(345),p=a(859),S=a(873),r=a(43),e=a(630),o=a(744);class s extends p.Disposable{constructor(h,m,d,c,v,C,k,D,x,y,L){super(),this._terminal=h,this._screenElement=m,this._bufferService=c,this._charSizeService=v,this._optionsService=C,this._coreBrowserService=x,this._themeService=L,this._observerDisposable=this.register(new p.MutableDisposable),this._onRequestRedraw=this.register(new f.EventEmitter),this.onRequestRedraw=this._onRequestRedraw.event,this._onChangeTextureAtlas=this.register(new f.EventEmitter),this.onChangeTextureAtlas=this._onChangeTextureAtlas.event,this._onAddTextureAtlasCanvas=this.register(new f.EventEmitter),this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event;let M=this._optionsService.rawOptions.allowTransparency;this._renderLayers=[new o.TextRenderLayer(this._terminal,this._screenElement,0,M,this._bufferService,this._optionsService,k,y,this._coreBrowserService,L),new e.SelectionRenderLayer(this._terminal,this._screenElement,1,this._bufferService,this._coreBrowserService,y,this._optionsService,L),new r.LinkRenderLayer(this._terminal,this._screenElement,2,d,this._bufferService,this._optionsService,y,this._coreBrowserService,L),new S.CursorRenderLayer(this._terminal,this._screenElement,3,this._onRequestRedraw,this._bufferService,this._optionsService,D,this._coreBrowserService,y,L)];for(let B of this._renderLayers)(0,f.forwardEvent)(B.onAddTextureAtlasCanvas,this._onAddTextureAtlasCanvas);this.dimensions=(0,n.createRenderDimensions)(),this._devicePixelRatio=this._coreBrowserService.dpr,this._updateDimensions(),this._observerDisposable.value=(0,u.observeDevicePixelDimensions)(this._renderLayers[0].canvas,this._coreBrowserService.window,((B,P)=>this._setCanvasDevicePixelDimensions(B,P))),this.register(this._coreBrowserService.onWindowChange((B=>{this._observerDisposable.value=(0,u.observeDevicePixelDimensions)(this._renderLayers[0].canvas,B,((P,H)=>this._setCanvasDevicePixelDimensions(P,H)))}))),this.register((0,p.toDisposable)((()=>{for(let B of this._renderLayers)B.dispose();(0,l.removeTerminalFromCache)(this._terminal)})))}get textureAtlas(){return this._renderLayers[0].cacheCanvas}handleDevicePixelRatioChange(){this._devicePixelRatio!==this._coreBrowserService.dpr&&(this._devicePixelRatio=this._coreBrowserService.dpr,this.handleResize(this._bufferService.cols,this._bufferService.rows))}handleResize(h,m){this._updateDimensions();for(let d of this._renderLayers)d.resize(this.dimensions);this._screenElement.style.width=`${this.dimensions.css.canvas.width}px`,this._screenElement.style.height=`${this.dimensions.css.canvas.height}px`}handleCharSizeChanged(){this.handleResize(this._bufferService.cols,this._bufferService.rows)}handleBlur(){this._runOperation((h=>h.handleBlur()))}handleFocus(){this._runOperation((h=>h.handleFocus()))}handleSelectionChanged(h,m,d=!1){this._runOperation((c=>c.handleSelectionChanged(h,m,d))),this._themeService.colors.selectionForeground&&this._onRequestRedraw.fire({start:0,end:this._bufferService.rows-1})}handleCursorMove(){this._runOperation((h=>h.handleCursorMove()))}clear(){this._runOperation((h=>h.reset()))}_runOperation(h){for(let m of this._renderLayers)h(m)}renderRows(h,m){for(let d of this._renderLayers)d.handleGridChanged(h,m)}clearTextureAtlas(){for(let h of this._renderLayers)h.clearTextureAtlas()}_updateDimensions(){if(!this._charSizeService.hasValidSize)return;let h=this._coreBrowserService.dpr;this.dimensions.device.char.width=Math.floor(this._charSizeService.width*h),this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*h),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._bufferService.rows*this.dimensions.device.cell.height,this.dimensions.device.canvas.width=this._bufferService.cols*this.dimensions.device.cell.width,this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/h),this.dimensions.css.canvas.width=Math.round(this.dimensions.device.canvas.width/h),this.dimensions.css.cell.height=this.dimensions.css.canvas.height/this._bufferService.rows,this.dimensions.css.cell.width=this.dimensions.css.canvas.width/this._bufferService.cols}_setCanvasDevicePixelDimensions(h,m){this.dimensions.device.canvas.height=m,this.dimensions.device.canvas.width=h;for(let d of this._renderLayers)d.resize(this.dimensions);this._requestRedrawViewport()}_requestRedrawViewport(){this._onRequestRedraw.fire({start:0,end:this._bufferService.rows-1})}}t.CanvasRenderer=s},873:(A,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CursorRenderLayer=void 0;let l=a(457),u=a(859),n=a(399),f=a(782),p=a(903);class S extends p.BaseRenderLayer{constructor(e,o,s,i,h,m,d,c,v,C){super(e,o,"cursor",s,!0,C,h,m,v,c),this._onRequestRedraw=i,this._coreService=d,this._cursorBlinkStateManager=this.register(new u.MutableDisposable),this._cell=new f.CellData,this._state={x:0,y:0,isFocused:!1,style:"",width:0},this._cursorRenderers={bar:this._renderBarCursor.bind(this),block:this._renderBlockCursor.bind(this),underline:this._renderUnderlineCursor.bind(this),outline:this._renderOutlineCursor.bind(this)},this.register(m.onOptionChange((()=>this._handleOptionsChanged()))),this._handleOptionsChanged()}resize(e){super.resize(e),this._state={x:0,y:0,isFocused:!1,style:"",width:0}}reset(){var e;this._clearCursor(),(e=this._cursorBlinkStateManager.value)==null||e.restartBlinkAnimation(),this._handleOptionsChanged()}handleBlur(){var e;(e=this._cursorBlinkStateManager.value)==null||e.pause(),this._onRequestRedraw.fire({start:this._bufferService.buffer.y,end:this._bufferService.buffer.y})}handleFocus(){var e;(e=this._cursorBlinkStateManager.value)==null||e.resume(),this._onRequestRedraw.fire({start:this._bufferService.buffer.y,end:this._bufferService.buffer.y})}_handleOptionsChanged(){this._optionsService.rawOptions.cursorBlink?this._cursorBlinkStateManager.value||(this._cursorBlinkStateManager.value=new l.CursorBlinkStateManager((()=>this._render(!0)),this._coreBrowserService)):this._cursorBlinkStateManager.clear(),this._onRequestRedraw.fire({start:this._bufferService.buffer.y,end:this._bufferService.buffer.y})}handleCursorMove(){var e;(e=this._cursorBlinkStateManager.value)==null||e.restartBlinkAnimation()}handleGridChanged(e,o){!this._cursorBlinkStateManager.value||this._cursorBlinkStateManager.value.isPaused?this._render(!1):this._cursorBlinkStateManager.value.restartBlinkAnimation()}_render(e){if(!this._coreService.isCursorInitialized||this._coreService.isCursorHidden)return void this._clearCursor();let o=this._bufferService.buffer.ybase+this._bufferService.buffer.y,s=o-this._bufferService.buffer.ydisp;if(s<0||s>=this._bufferService.rows)return void this._clearCursor();let i=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1);if(this._bufferService.buffer.lines.get(o).loadCell(i,this._cell),this._cell.content!==void 0){if(!this._coreBrowserService.isFocused){this._clearCursor(),this._ctx.save(),this._ctx.fillStyle=this._themeService.colors.cursor.css;let h=this._optionsService.rawOptions.cursorStyle,m=this._optionsService.rawOptions.cursorInactiveStyle;m&&m!=="none"&&this._cursorRenderers[m](i,s,this._cell),this._ctx.restore(),this._state.x=i,this._state.y=s,this._state.isFocused=!1,this._state.style=h,this._state.width=this._cell.getWidth();return}if(!this._cursorBlinkStateManager.value||this._cursorBlinkStateManager.value.isCursorVisible){if(this._state){if(this._state.x===i&&this._state.y===s&&this._state.isFocused===this._coreBrowserService.isFocused&&this._state.style===this._optionsService.rawOptions.cursorStyle&&this._state.width===this._cell.getWidth())return;this._clearCursor()}this._ctx.save(),this._cursorRenderers[this._optionsService.rawOptions.cursorStyle||"block"](i,s,this._cell),this._ctx.restore(),this._state.x=i,this._state.y=s,this._state.isFocused=!1,this._state.style=this._optionsService.rawOptions.cursorStyle,this._state.width=this._cell.getWidth()}else this._clearCursor()}}_clearCursor(){this._state&&(this._state=(n.isFirefox||this._coreBrowserService.dpr<1?this._clearAll():this._clearCells(this._state.x,this._state.y,this._state.width,1),{x:0,y:0,isFocused:!1,style:"",width:0}))}_renderBarCursor(e,o,s){this._ctx.save(),this._ctx.fillStyle=this._themeService.colors.cursor.css,this._fillLeftLineAtCell(e,o,this._optionsService.rawOptions.cursorWidth),this._ctx.restore()}_renderBlockCursor(e,o,s){this._ctx.save(),this._ctx.fillStyle=this._themeService.colors.cursor.css,this._fillCells(e,o,s.getWidth(),1),this._ctx.fillStyle=this._themeService.colors.cursorAccent.css,this._fillCharTrueColor(s,e,o),this._ctx.restore()}_renderUnderlineCursor(e,o,s){this._ctx.save(),this._ctx.fillStyle=this._themeService.colors.cursor.css,this._fillBottomLineAtCells(e,o),this._ctx.restore()}_renderOutlineCursor(e,o,s){this._ctx.save(),this._ctx.strokeStyle=this._themeService.colors.cursor.css,this._strokeRectAtCell(e,o,s.getWidth(),1),this._ctx.restore()}}t.CursorRenderLayer=S},574:(A,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.GridCache=void 0,t.GridCache=class{constructor(){this.cache=[]}resize(a,l){for(let u=0;u<a;u++){this.cache.length<=u&&this.cache.push([]);for(let n=this.cache[u].length;n<l;n++)this.cache[u].push(void 0);this.cache[u].length=l}this.cache.length=a}clear(){for(let a=0;a<this.cache.length;a++)for(let l=0;l<this.cache[a].length;l++)this.cache[a][l]=void 0}}},43:(A,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.LinkRenderLayer=void 0;let l=a(197),u=a(237),n=a(903);class f extends n.BaseRenderLayer{constructor(S,r,e,o,s,i,h,m,d){super(S,r,"link",e,!0,d,s,i,h,m),this.register(o.onShowLinkUnderline((c=>this._handleShowLinkUnderline(c)))),this.register(o.onHideLinkUnderline((c=>this._handleHideLinkUnderline(c))))}resize(S){super.resize(S),this._state=void 0}reset(){this._clearCurrentLink()}_clearCurrentLink(){if(this._state){this._clearCells(this._state.x1,this._state.y1,this._state.cols-this._state.x1,1);let S=this._state.y2-this._state.y1-1;S>0&&this._clearCells(0,this._state.y1+1,this._state.cols,S),this._clearCells(0,this._state.y2,this._state.x2,1),this._state=void 0}}_handleShowLinkUnderline(S){if(S.fg===u.INVERTED_DEFAULT_COLOR?this._ctx.fillStyle=this._themeService.colors.background.css:S.fg&&(0,l.is256Color)(S.fg)?this._ctx.fillStyle=this._themeService.colors.ansi[S.fg].css:this._ctx.fillStyle=this._themeService.colors.foreground.css,S.y1===S.y2)this._fillBottomLineAtCells(S.x1,S.y1,S.x2-S.x1);else{this._fillBottomLineAtCells(S.x1,S.y1,S.cols-S.x1);for(let r=S.y1+1;r<S.y2;r++)this._fillBottomLineAtCells(0,r,S.cols);this._fillBottomLineAtCells(0,S.y2,S.x2)}this._state=S}_handleHideLinkUnderline(S){this._clearCurrentLink()}}t.LinkRenderLayer=f},630:(A,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.SelectionRenderLayer=void 0;let l=a(903);class u extends l.BaseRenderLayer{constructor(f,p,S,r,e,o,s,i){super(f,p,"selection",S,!0,i,r,s,o,e),this._clearState()}_clearState(){this._state={start:void 0,end:void 0,columnSelectMode:void 0,ydisp:void 0}}resize(f){super.resize(f),this._selectionModel.selectionStart&&this._selectionModel.selectionEnd&&(this._clearState(),this._redrawSelection(this._selectionModel.selectionStart,this._selectionModel.selectionEnd,this._selectionModel.columnSelectMode))}reset(){this._state.start&&this._state.end&&(this._clearState(),this._clearAll())}handleBlur(){this.reset(),this._redrawSelection(this._selectionModel.selectionStart,this._selectionModel.selectionEnd,this._selectionModel.columnSelectMode)}handleFocus(){this.reset(),this._redrawSelection(this._selectionModel.selectionStart,this._selectionModel.selectionEnd,this._selectionModel.columnSelectMode)}handleSelectionChanged(f,p,S){super.handleSelectionChanged(f,p,S),this._redrawSelection(f,p,S)}_redrawSelection(f,p,S){if(!this._didStateChange(f,p,S,this._bufferService.buffer.ydisp))return;if(this._clearAll(),!f||!p)return void this._clearState();let r=f[1]-this._bufferService.buffer.ydisp,e=p[1]-this._bufferService.buffer.ydisp,o=Math.max(r,0),s=Math.min(e,this._bufferService.rows-1);if(o>=this._bufferService.rows||s<0)this._state.ydisp=this._bufferService.buffer.ydisp;else{if(this._ctx.fillStyle=(this._coreBrowserService.isFocused?this._themeService.colors.selectionBackgroundTransparent:this._themeService.colors.selectionInactiveBackgroundTransparent).css,S){let i=f[0],h=p[0]-i,m=s-o+1;this._fillCells(i,o,h,m)}else{let i=r===o?f[0]:0,h=o===e?p[0]:this._bufferService.cols;this._fillCells(i,o,h-i,1);let m=Math.max(s-o-1,0);if(this._fillCells(0,o+1,this._bufferService.cols,m),o!==s){let d=e===s?p[0]:this._bufferService.cols;this._fillCells(0,s,d,1)}}this._state.start=[f[0],f[1]],this._state.end=[p[0],p[1]],this._state.columnSelectMode=S,this._state.ydisp=this._bufferService.buffer.ydisp}}_didStateChange(f,p,S,r){return!this._areCoordinatesEqual(f,this._state.start)||!this._areCoordinatesEqual(p,this._state.end)||S!==this._state.columnSelectMode||r!==this._state.ydisp}_areCoordinatesEqual(f,p){return!(!f||!p)&&f[0]===p[0]&&f[1]===p[1]}}t.SelectionRenderLayer=u},744:(A,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.TextRenderLayer=void 0;let l=a(577),u=a(147),n=a(782),f=a(855),p=a(903),S=a(574);class r extends p.BaseRenderLayer{constructor(o,s,i,h,m,d,c,v,C,k){super(o,s,"text",i,h,k,m,d,v,C),this._characterJoinerService=c,this._characterWidth=0,this._characterFont="",this._characterOverlapCache={},this._workCell=new n.CellData,this._state=new S.GridCache,this.register(d.onSpecificOptionChange("allowTransparency",(D=>this._setTransparency(D))))}resize(o){super.resize(o);let s=this._getFont(!1,!1);this._characterWidth===o.device.char.width&&this._characterFont===s||(this._characterWidth=o.device.char.width,this._characterFont=s,this._characterOverlapCache={}),this._state.clear(),this._state.resize(this._bufferService.cols,this._bufferService.rows)}reset(){this._state.clear(),this._clearAll()}_forEachCell(o,s,i){for(let h=o;h<=s;h++){let m=h+this._bufferService.buffer.ydisp,d=this._bufferService.buffer.lines.get(m),c=this._characterJoinerService.getJoinedCharacters(m);for(let v=0;v<this._bufferService.cols;v++){d.loadCell(v,this._workCell);let C=this._workCell,k=!1,D=v;if(C.getWidth()!==0){if(c.length>0&&v===c[0][0]){k=!0;let x=c.shift();C=new l.JoinedCellData(this._workCell,d.translateToString(!0,x[0],x[1]),x[1]-x[0]),D=x[1]-1}!k&&this._isOverlapping(C)&&D<d.length-1&&d.getCodePoint(D+1)===f.NULL_CELL_CODE&&(C.content&=-12582913,C.content|=8388608),i(C,v,h),v=D}}}}_drawBackground(o,s){let i=this._ctx,h=this._bufferService.cols,m=0,d=0,c=null;i.save(),this._forEachCell(o,s,((v,C,k)=>{let D=null;v.isInverse()?D=v.isFgDefault()?this._themeService.colors.foreground.css:v.isFgRGB()?`rgb(${u.AttributeData.toColorRGB(v.getFgColor()).join(",")})`:this._themeService.colors.ansi[v.getFgColor()].css:v.isBgRGB()?D=`rgb(${u.AttributeData.toColorRGB(v.getBgColor()).join(",")})`:v.isBgPalette()&&(D=this._themeService.colors.ansi[v.getBgColor()].css);let x=!1;this._decorationService.forEachDecorationAtCell(C,this._bufferService.buffer.ydisp+k,void 0,(y=>{y.options.layer!=="top"&&x||(y.backgroundColorRGB&&(D=y.backgroundColorRGB.css),x=y.options.layer==="top")})),c===null&&(m=C,d=k),k===d?c!==D&&(i.fillStyle=c||"",this._fillCells(m,d,C-m,1),m=C,d=k):(i.fillStyle=c||"",this._fillCells(m,d,h-m,1),m=C,d=k),c=D})),c!==null&&(i.fillStyle=c,this._fillCells(m,d,h-m,1)),i.restore()}_drawForeground(o,s){this._forEachCell(o,s,((i,h,m)=>this._drawChars(i,h,m)))}handleGridChanged(o,s){this._state.cache.length!==0&&(this._charAtlas&&this._charAtlas.beginFrame(),this._clearCells(0,o,this._bufferService.cols,s-o+1),this._drawBackground(o,s),this._drawForeground(o,s))}_isOverlapping(o){if(o.getWidth()!==1||o.getCode()<256)return!1;let s=o.getChars();if(this._characterOverlapCache.hasOwnProperty(s))return this._characterOverlapCache[s];this._ctx.save(),this._ctx.font=this._characterFont;let i=Math.floor(this._ctx.measureText(s).width)>this._characterWidth;return this._ctx.restore(),this._characterOverlapCache[s]=i,i}}t.TextRenderLayer=r},274:(A,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CellColorResolver=void 0;let l=a(855),u=a(160),n=a(374),f,p=0,S=0,r=!1,e=!1,o=!1,s=0;t.CellColorResolver=class{constructor(i,h,m,d,c,v){this._terminal=i,this._optionService=h,this._selectionRenderModel=m,this._decorationService=d,this._coreBrowserService=c,this._themeService=v,this.result={fg:0,bg:0,ext:0}}resolve(i,h,m,d){if(this.result.bg=i.bg,this.result.fg=i.fg,this.result.ext=268435456&i.bg?i.extended.ext:0,S=0,p=0,e=!1,r=!1,o=!1,f=this._themeService.colors,s=0,i.getCode()!==l.NULL_CELL_CODE&&i.extended.underlineStyle===4){let c=Math.max(1,Math.floor(this._optionService.rawOptions.fontSize*this._coreBrowserService.dpr/15));s=h*d%(2*Math.round(c))}if(this._decorationService.forEachDecorationAtCell(h,m,"bottom",(c=>{c.backgroundColorRGB&&(S=c.backgroundColorRGB.rgba>>8&16777215,e=!0),c.foregroundColorRGB&&(p=c.foregroundColorRGB.rgba>>8&16777215,r=!0)})),o=this._selectionRenderModel.isCellSelected(this._terminal,h,m),o){if(67108864&this.result.fg||50331648&this.result.bg){if(67108864&this.result.fg)switch(50331648&this.result.fg){case 16777216:case 33554432:S=this._themeService.colors.ansi[255&this.result.fg].rgba;break;case 50331648:S=(16777215&this.result.fg)<<8|255;break;default:S=this._themeService.colors.foreground.rgba}else switch(50331648&this.result.bg){case 16777216:case 33554432:S=this._themeService.colors.ansi[255&this.result.bg].rgba;break;case 50331648:S=(16777215&this.result.bg)<<8|255}S=u.rgba.blend(S,4294967040&(this._coreBrowserService.isFocused?f.selectionBackgroundOpaque:f.selectionInactiveBackgroundOpaque).rgba|128)>>8&16777215}else S=(this._coreBrowserService.isFocused?f.selectionBackgroundOpaque:f.selectionInactiveBackgroundOpaque).rgba>>8&16777215;if(e=!0,f.selectionForeground&&(p=f.selectionForeground.rgba>>8&16777215,r=!0),(0,n.treatGlyphAsBackgroundColor)(i.getCode())){if(67108864&this.result.fg&&!(50331648&this.result.bg))p=(this._coreBrowserService.isFocused?f.selectionBackgroundOpaque:f.selectionInactiveBackgroundOpaque).rgba>>8&16777215;else{if(67108864&this.result.fg)switch(50331648&this.result.bg){case 16777216:case 33554432:p=this._themeService.colors.ansi[255&this.result.bg].rgba;break;case 50331648:p=(16777215&this.result.bg)<<8|255}else switch(50331648&this.result.fg){case 16777216:case 33554432:p=this._themeService.colors.ansi[255&this.result.fg].rgba;break;case 50331648:p=(16777215&this.result.fg)<<8|255;break;default:p=this._themeService.colors.foreground.rgba}p=u.rgba.blend(p,4294967040&(this._coreBrowserService.isFocused?f.selectionBackgroundOpaque:f.selectionInactiveBackgroundOpaque).rgba|128)>>8&16777215}r=!0}}this._decorationService.forEachDecorationAtCell(h,m,"top",(c=>{c.backgroundColorRGB&&(S=c.backgroundColorRGB.rgba>>8&16777215,e=!0),c.foregroundColorRGB&&(p=c.foregroundColorRGB.rgba>>8&16777215,r=!0)})),e&&(S=o?i.bg&-150994944|S|50331648:-16777216&i.bg|S|50331648),r&&(p=i.fg&-83886080|p|50331648),67108864&this.result.fg&&(e&&!r&&(p=50331648&this.result.bg?-134217728&this.result.fg|67108863&this.result.bg:-134217728&this.result.fg|16777215&f.background.rgba>>8|50331648,r=!0),!e&&r&&(S=50331648&this.result.fg?-67108864&this.result.bg|67108863&this.result.fg:-67108864&this.result.bg|16777215&f.foreground.rgba>>8|50331648,e=!0)),f=void 0,this.result.bg=e?S:this.result.bg,this.result.fg=r?p:this.result.fg,this.result.ext&=536870911,this.result.ext|=s<<29&3758096384}}},627:(A,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.removeTerminalFromCache=t.acquireTextureAtlas=void 0;let l=a(509),u=a(197),n=[];t.acquireTextureAtlas=function(f,p,S,r,e,o,s,i){let h=(0,u.generateConfig)(r,e,o,s,p,S,i);for(let c=0;c<n.length;c++){let v=n[c],C=v.ownedBy.indexOf(f);if(C>=0){if((0,u.configEquals)(v.config,h))return v.atlas;v.ownedBy.length===1?(v.atlas.dispose(),n.splice(c,1)):v.ownedBy.splice(C,1);break}}for(let c=0;c<n.length;c++){let v=n[c];if((0,u.configEquals)(v.config,h))return v.ownedBy.push(f),v.atlas}let m=f._core,d={atlas:new l.TextureAtlas(document,h,m.unicodeService),config:h,ownedBy:[f]};return n.push(d),d.atlas},t.removeTerminalFromCache=function(f){for(let p=0;p<n.length;p++){let S=n[p].ownedBy.indexOf(f);if(S!==-1){n[p].ownedBy.length===1?(n[p].atlas.dispose(),n.splice(p,1)):n[p].ownedBy.splice(S,1);break}}}},197:(A,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.is256Color=t.configEquals=t.generateConfig=void 0;let l=a(160);t.generateConfig=function(u,n,f,p,S,r,e){let o={foreground:r.foreground,background:r.background,cursor:l.NULL_COLOR,cursorAccent:l.NULL_COLOR,selectionForeground:l.NULL_COLOR,selectionBackgroundTransparent:l.NULL_COLOR,selectionBackgroundOpaque:l.NULL_COLOR,selectionInactiveBackgroundTransparent:l.NULL_COLOR,selectionInactiveBackgroundOpaque:l.NULL_COLOR,ansi:r.ansi.slice(),contrastCache:r.contrastCache,halfContrastCache:r.halfContrastCache};return{customGlyphs:S.customGlyphs,devicePixelRatio:e,letterSpacing:S.letterSpacing,lineHeight:S.lineHeight,deviceCellWidth:u,deviceCellHeight:n,deviceCharWidth:f,deviceCharHeight:p,fontFamily:S.fontFamily,fontSize:S.fontSize,fontWeight:S.fontWeight,fontWeightBold:S.fontWeightBold,allowTransparency:S.allowTransparency,drawBoldTextInBrightColors:S.drawBoldTextInBrightColors,minimumContrastRatio:S.minimumContrastRatio,colors:o}},t.configEquals=function(u,n){for(let f=0;f<u.colors.ansi.length;f++)if(u.colors.ansi[f].rgba!==n.colors.ansi[f].rgba)return!1;return u.devicePixelRatio===n.devicePixelRatio&&u.customGlyphs===n.customGlyphs&&u.lineHeight===n.lineHeight&&u.letterSpacing===n.letterSpacing&&u.fontFamily===n.fontFamily&&u.fontSize===n.fontSize&&u.fontWeight===n.fontWeight&&u.fontWeightBold===n.fontWeightBold&&u.allowTransparency===n.allowTransparency&&u.deviceCharWidth===n.deviceCharWidth&&u.deviceCharHeight===n.deviceCharHeight&&u.drawBoldTextInBrightColors===n.drawBoldTextInBrightColors&&u.minimumContrastRatio===n.minimumContrastRatio&&u.colors.foreground.rgba===n.colors.foreground.rgba&&u.colors.background.rgba===n.colors.background.rgba},t.is256Color=function(u){return(50331648&u)==16777216||(50331648&u)==33554432}},237:(A,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.TEXT_BASELINE=t.DIM_OPACITY=t.INVERTED_DEFAULT_COLOR=void 0;let l=a(399);t.INVERTED_DEFAULT_COLOR=257,t.DIM_OPACITY=.5,t.TEXT_BASELINE=l.isFirefox||l.isLegacyEdge?"bottom":"ideographic"},457:(A,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CursorBlinkStateManager=void 0,t.CursorBlinkStateManager=class{constructor(a,l){this._renderCallback=a,this._coreBrowserService=l,this.isCursorVisible=!0,this._coreBrowserService.isFocused&&this._restartInterval()}get isPaused(){return!(this._blinkStartTimeout||this._blinkInterval)}dispose(){this._blinkInterval&&(this._blinkInterval=(this._coreBrowserService.window.clearInterval(this._blinkInterval),void 0)),this._blinkStartTimeout&&(this._blinkStartTimeout=(this._coreBrowserService.window.clearTimeout(this._blinkStartTimeout),void 0)),this._animationFrame&&(this._animationFrame=(this._coreBrowserService.window.cancelAnimationFrame(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(a=600){this._blinkInterval&&(this._blinkInterval=(this._coreBrowserService.window.clearInterval(this._blinkInterval),void 0)),this._blinkStartTimeout=this._coreBrowserService.window.setTimeout((()=>{if(this._animationTimeRestarted){let l=600-(Date.now()-this._animationTimeRestarted);if(this._animationTimeRestarted=void 0,l>0)return void this._restartInterval(l)}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 l=600-(Date.now()-this._animationTimeRestarted);this._animationTimeRestarted=void 0,this._restartInterval(l);return}this.isCursorVisible=!this.isCursorVisible,this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>{this._renderCallback(),this._animationFrame=void 0}))}),600)}),a)}pause(){this.isCursorVisible=!0,this._blinkInterval&&(this._blinkInterval=(this._coreBrowserService.window.clearInterval(this._blinkInterval),void 0)),this._blinkStartTimeout&&(this._blinkStartTimeout=(this._coreBrowserService.window.clearTimeout(this._blinkStartTimeout),void 0)),this._animationFrame&&(this._animationFrame=(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),void 0))}resume(){this.pause(),this._animationTimeRestarted=void 0,this._restartInterval(),this.restartBlinkAnimation()}}},860:(A,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.tryDrawCustomChar=t.powerlineDefinitions=t.boxDrawingDefinitions=t.blockElementDefinitions=void 0;let l=a(374);t.blockElementDefinitions={"\u2580":[{x:0,y:0,w:8,h:4}],"\u2581":[{x:0,y:7,w:8,h:1}],"\u2582":[{x:0,y:6,w:8,h:2}],"\u2583":[{x:0,y:5,w:8,h:3}],"\u2584":[{x:0,y:4,w:8,h:4}],"\u2585":[{x:0,y:3,w:8,h:5}],"\u2586":[{x:0,y:2,w:8,h:6}],"\u2587":[{x:0,y:1,w:8,h:7}],"\u2588":[{x:0,y:0,w:8,h:8}],"\u2589":[{x:0,y:0,w:7,h:8}],"\u258A":[{x:0,y:0,w:6,h:8}],"\u258B":[{x:0,y:0,w:5,h:8}],"\u258C":[{x:0,y:0,w:4,h:8}],"\u258D":[{x:0,y:0,w:3,h:8}],"\u258E":[{x:0,y:0,w:2,h:8}],"\u258F":[{x:0,y:0,w:1,h:8}],"\u2590":[{x:4,y:0,w:4,h:8}],"\u2594":[{x:0,y:0,w:8,h:1}],"\u2595":[{x:7,y:0,w:1,h:8}],"\u2596":[{x:0,y:4,w:4,h:4}],"\u2597":[{x:4,y:4,w:4,h:4}],"\u2598":[{x:0,y:0,w:4,h:4}],"\u2599":[{x:0,y:0,w:4,h:8},{x:0,y:4,w:8,h:4}],"\u259A":[{x:0,y:0,w:4,h:4},{x:4,y:4,w:4,h:4}],"\u259B":[{x:0,y:0,w:4,h:8},{x:4,y:0,w:4,h:4}],"\u259C":[{x:0,y:0,w:8,h:4},{x:4,y:0,w:4,h:8}],"\u259D":[{x:4,y:0,w:4,h:4}],"\u259E":[{x:4,y:0,w:4,h:4},{x:0,y:4,w:4,h:4}],"\u259F":[{x:4,y:0,w:4,h:8},{x:0,y:4,w:8,h:4}],"\u{1FB70}":[{x:1,y:0,w:1,h:8}],"\u{1FB71}":[{x:2,y:0,w:1,h:8}],"\u{1FB72}":[{x:3,y:0,w:1,h:8}],"\u{1FB73}":[{x:4,y:0,w:1,h:8}],"\u{1FB74}":[{x:5,y:0,w:1,h:8}],"\u{1FB75}":[{x:6,y:0,w:1,h:8}],"\u{1FB76}":[{x:0,y:1,w:8,h:1}],"\u{1FB77}":[{x:0,y:2,w:8,h:1}],"\u{1FB78}":[{x:0,y:3,w:8,h:1}],"\u{1FB79}":[{x:0,y:4,w:8,h:1}],"\u{1FB7A}":[{x:0,y:5,w:8,h:1}],"\u{1FB7B}":[{x:0,y:6,w:8,h:1}],"\u{1FB7C}":[{x:0,y:0,w:1,h:8},{x:0,y:7,w:8,h:1}],"\u{1FB7D}":[{x:0,y:0,w:1,h:8},{x:0,y:0,w:8,h:1}],"\u{1FB7E}":[{x:7,y:0,w:1,h:8},{x:0,y:0,w:8,h:1}],"\u{1FB7F}":[{x:7,y:0,w:1,h:8},{x:0,y:7,w:8,h:1}],"\u{1FB80}":[{x:0,y:0,w:8,h:1},{x:0,y:7,w:8,h:1}],"\u{1FB81}":[{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}],"\u{1FB82}":[{x:0,y:0,w:8,h:2}],"\u{1FB83}":[{x:0,y:0,w:8,h:3}],"\u{1FB84}":[{x:0,y:0,w:8,h:5}],"\u{1FB85}":[{x:0,y:0,w:8,h:6}],"\u{1FB86}":[{x:0,y:0,w:8,h:7}],"\u{1FB87}":[{x:6,y:0,w:2,h:8}],"\u{1FB88}":[{x:5,y:0,w:3,h:8}],"\u{1FB89}":[{x:3,y:0,w:5,h:8}],"\u{1FB8A}":[{x:2,y:0,w:6,h:8}],"\u{1FB8B}":[{x:1,y:0,w:7,h:8}],"\u{1FB95}":[{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}],"\u{1FB96}":[{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}],"\u{1FB97}":[{x:0,y:2,w:8,h:2},{x:0,y:6,w:8,h:2}]};let u={"\u2591":[[1,0,0,0],[0,0,0,0],[0,0,1,0],[0,0,0,0]],"\u2592":[[1,0],[0,0],[0,1],[0,0]],"\u2593":[[0,1],[1,1],[1,0],[1,1]]};t.boxDrawingDefinitions={"\u2500":{1:"M0,.5 L1,.5"},"\u2501":{3:"M0,.5 L1,.5"},"\u2502":{1:"M.5,0 L.5,1"},"\u2503":{3:"M.5,0 L.5,1"},"\u250C":{1:"M0.5,1 L.5,.5 L1,.5"},"\u250F":{3:"M0.5,1 L.5,.5 L1,.5"},"\u2510":{1:"M0,.5 L.5,.5 L.5,1"},"\u2513":{3:"M0,.5 L.5,.5 L.5,1"},"\u2514":{1:"M.5,0 L.5,.5 L1,.5"},"\u2517":{3:"M.5,0 L.5,.5 L1,.5"},"\u2518":{1:"M.5,0 L.5,.5 L0,.5"},"\u251B":{3:"M.5,0 L.5,.5 L0,.5"},"\u251C":{1:"M.5,0 L.5,1 M.5,.5 L1,.5"},"\u2523":{3:"M.5,0 L.5,1 M.5,.5 L1,.5"},"\u2524":{1:"M.5,0 L.5,1 M.5,.5 L0,.5"},"\u252B":{3:"M.5,0 L.5,1 M.5,.5 L0,.5"},"\u252C":{1:"M0,.5 L1,.5 M.5,.5 L.5,1"},"\u2533":{3:"M0,.5 L1,.5 M.5,.5 L.5,1"},"\u2534":{1:"M0,.5 L1,.5 M.5,.5 L.5,0"},"\u253B":{3:"M0,.5 L1,.5 M.5,.5 L.5,0"},"\u253C":{1:"M0,.5 L1,.5 M.5,0 L.5,1"},"\u254B":{3:"M0,.5 L1,.5 M.5,0 L.5,1"},"\u2574":{1:"M.5,.5 L0,.5"},"\u2578":{3:"M.5,.5 L0,.5"},"\u2575":{1:"M.5,.5 L.5,0"},"\u2579":{3:"M.5,.5 L.5,0"},"\u2576":{1:"M.5,.5 L1,.5"},"\u257A":{3:"M.5,.5 L1,.5"},"\u2577":{1:"M.5,.5 L.5,1"},"\u257B":{3:"M.5,.5 L.5,1"},"\u2550":{1:(r,e)=>`M0,${.5-e} L1,${.5-e} M0,${.5+e} L1,${.5+e}`},"\u2551":{1:(r,e)=>`M${.5-r},0 L${.5-r},1 M${.5+r},0 L${.5+r},1`},"\u2552":{1:(r,e)=>`M.5,1 L.5,${.5-e} L1,${.5-e} M.5,${.5+e} L1,${.5+e}`},"\u2553":{1:(r,e)=>`M${.5-r},1 L${.5-r},.5 L1,.5 M${.5+r},.5 L${.5+r},1`},"\u2554":{1:(r,e)=>`M1,${.5-e} L${.5-r},${.5-e} L${.5-r},1 M1,${.5+e} L${.5+r},${.5+e} L${.5+r},1`},"\u2555":{1:(r,e)=>`M0,${.5-e} L.5,${.5-e} L.5,1 M0,${.5+e} L.5,${.5+e}`},"\u2556":{1:(r,e)=>`M${.5+r},1 L${.5+r},.5 L0,.5 M${.5-r},.5 L${.5-r},1`},"\u2557":{1:(r,e)=>`M0,${.5+e} L${.5-r},${.5+e} L${.5-r},1 M0,${.5-e} L${.5+r},${.5-e} L${.5+r},1`},"\u2558":{1:(r,e)=>`M.5,0 L.5,${.5+e} L1,${.5+e} M.5,${.5-e} L1,${.5-e}`},"\u2559":{1:(r,e)=>`M1,.5 L${.5-r},.5 L${.5-r},0 M${.5+r},.5 L${.5+r},0`},"\u255A":{1:(r,e)=>`M1,${.5-e} L${.5+r},${.5-e} L${.5+r},0 M1,${.5+e} L${.5-r},${.5+e} L${.5-r},0`},"\u255B":{1:(r,e)=>`M0,${.5+e} L.5,${.5+e} L.5,0 M0,${.5-e} L.5,${.5-e}`},"\u255C":{1:(r,e)=>`M0,.5 L${.5+r},.5 L${.5+r},0 M${.5-r},.5 L${.5-r},0`},"\u255D":{1:(r,e)=>`M0,${.5-e} L${.5-r},${.5-e} L${.5-r},0 M0,${.5+e} L${.5+r},${.5+e} L${.5+r},0`},"\u255E":{1:(r,e)=>`M.5,0 L.5,1 M.5,${.5-e} L1,${.5-e} M.5,${.5+e} L1,${.5+e}`},"\u255F":{1:(r,e)=>`M${.5-r},0 L${.5-r},1 M${.5+r},0 L${.5+r},1 M${.5+r},.5 L1,.5`},"\u2560":{1:(r,e)=>`M${.5-r},0 L${.5-r},1 M1,${.5+e} L${.5+r},${.5+e} L${.5+r},1 M1,${.5-e} L${.5+r},${.5-e} L${.5+r},0`},"\u2561":{1:(r,e)=>`M.5,0 L.5,1 M0,${.5-e} L.5,${.5-e} M0,${.5+e} L.5,${.5+e}`},"\u2562":{1:(r,e)=>`M0,.5 L${.5-r},.5 M${.5-r},0 L${.5-r},1 M${.5+r},0 L${.5+r},1`},"\u2563":{1:(r,e)=>`M${.5+r},0 L${.5+r},1 M0,${.5+e} L${.5-r},${.5+e} L${.5-r},1 M0,${.5-e} L${.5-r},${.5-e} L${.5-r},0`},"\u2564":{1:(r,e)=>`M0,${.5-e} L1,${.5-e} M0,${.5+e} L1,${.5+e} M.5,${.5+e} L.5,1`},"\u2565":{1:(r,e)=>`M0,.5 L1,.5 M${.5-r},.5 L${.5-r},1 M${.5+r},.5 L${.5+r},1`},"\u2566":{1:(r,e)=>`M0,${.5-e} L1,${.5-e} M0,${.5+e} L${.5-r},${.5+e} L${.5-r},1 M1,${.5+e} L${.5+r},${.5+e} L${.5+r},1`},"\u2567":{1:(r,e)=>`M.5,0 L.5,${.5-e} M0,${.5-e} L1,${.5-e} M0,${.5+e} L1,${.5+e}`},"\u2568":{1:(r,e)=>`M0,.5 L1,.5 M${.5-r},.5 L${.5-r},0 M${.5+r},.5 L${.5+r},0`},"\u2569":{1:(r,e)=>`M0,${.5+e} L1,${.5+e} M0,${.5-e} L${.5-r},${.5-e} L${.5-r},0 M1,${.5-e} L${.5+r},${.5-e} L${.5+r},0`},"\u256A":{1:(r,e)=>`M.5,0 L.5,1 M0,${.5-e} L1,${.5-e} M0,${.5+e} L1,${.5+e}`},"\u256B":{1:(r,e)=>`M0,.5 L1,.5 M${.5-r},0 L${.5-r},1 M${.5+r},0 L${.5+r},1`},"\u256C":{1:(r,e)=>`M0,${.5+e} L${.5-r},${.5+e} L${.5-r},1 M1,${.5+e} L${.5+r},${.5+e} L${.5+r},1 M0,${.5-e} L${.5-r},${.5-e} L${.5-r},0 M1,${.5-e} L${.5+r},${.5-e} L${.5+r},0`},"\u2571":{1:"M1,0 L0,1"},"\u2572":{1:"M0,0 L1,1"},"\u2573":{1:"M1,0 L0,1 M0,0 L1,1"},"\u257C":{1:"M.5,.5 L0,.5",3:"M.5,.5 L1,.5"},"\u257D":{1:"M.5,.5 L.5,0",3:"M.5,.5 L.5,1"},"\u257E":{1:"M.5,.5 L1,.5",3:"M.5,.5 L0,.5"},"\u257F":{1:"M.5,.5 L.5,1",3:"M.5,.5 L.5,0"},"\u250D":{1:"M.5,.5 L.5,1",3:"M.5,.5 L1,.5"},"\u250E":{1:"M.5,.5 L1,.5",3:"M.5,.5 L.5,1"},"\u2511":{1:"M.5,.5 L.5,1",3:"M.5,.5 L0,.5"},"\u2512":{1:"M.5,.5 L0,.5",3:"M.5,.5 L.5,1"},"\u2515":{1:"M.5,.5 L.5,0",3:"M.5,.5 L1,.5"},"\u2516":{1:"M.5,.5 L1,.5",3:"M.5,.5 L.5,0"},"\u2519":{1:"M.5,.5 L.5,0",3:"M.5,.5 L0,.5"},"\u251A":{1:"M.5,.5 L0,.5",3:"M.5,.5 L.5,0"},"\u251D":{1:"M.5,0 L.5,1",3:"M.5,.5 L1,.5"},"\u251E":{1:"M0.5,1 L.5,.5 L1,.5",3:"M.5,.5 L.5,0"},"\u251F":{1:"M.5,0 L.5,.5 L1,.5",3:"M.5,.5 L.5,1"},"\u2520":{1:"M.5,.5 L1,.5",3:"M.5,0 L.5,1"},"\u2521":{1:"M.5,.5 L.5,1",3:"M.5,0 L.5,.5 L1,.5"},"\u2522":{1:"M.5,.5 L.5,0",3:"M0.5,1 L.5,.5 L1,.5"},"\u2525":{1:"M.5,0 L.5,1",3:"M.5,.5 L0,.5"},"\u2526":{1:"M0,.5 L.5,.5 L.5,1",3:"M.5,.5 L.5,0"},"\u2527":{1:"M.5,0 L.5,.5 L0,.5",3:"M.5,.5 L.5,1"},"\u2528":{1:"M.5,.5 L0,.5",3:"M.5,0 L.5,1"},"\u2529":{1:"M.5,.5 L.5,1",3:"M.5,0 L.5,.5 L0,.5"},"\u252A":{1:"M.5,.5 L.5,0",3:"M0,.5 L.5,.5 L.5,1"},"\u252D":{1:"M0.5,1 L.5,.5 L1,.5",3:"M.5,.5 L0,.5"},"\u252E":{1:"M0,.5 L.5,.5 L.5,1",3:"M.5,.5 L1,.5"},"\u252F":{1:"M.5,.5 L.5,1",3:"M0,.5 L1,.5"},"\u2530":{1:"M0,.5 L1,.5",3:"M.5,.5 L.5,1"},"\u2531":{1:"M.5,.5 L1,.5",3:"M0,.5 L.5,.5 L.5,1"},"\u2532":{1:"M.5,.5 L0,.5",3:"M0.5,1 L.5,.5 L1,.5"},"\u2535":{1:"M.5,0 L.5,.5 L1,.5",3:"M.5,.5 L0,.5"},"\u2536":{1:"M.5,0 L.5,.5 L0,.5",3:"M.5,.5 L1,.5"},"\u2537":{1:"M.5,.5 L.5,0",3:"M0,.5 L1,.5"},"\u2538":{1:"M0,.5 L1,.5",3:"M.5,.5 L.5,0"},"\u2539":{1:"M.5,.5 L1,.5",3:"M.5,0 L.5,.5 L0,.5"},"\u253A":{1:"M.5,.5 L0,.5",3:"M.5,0 L.5,.5 L1,.5"},"\u253D":{1:"M.5,0 L.5,1 M.5,.5 L1,.5",3:"M.5,.5 L0,.5"},"\u253E":{1:"M.5,0 L.5,1 M.5,.5 L0,.5",3:"M.5,.5 L1,.5"},"\u253F":{1:"M.5,0 L.5,1",3:"M0,.5 L1,.5"},"\u2540":{1:"M0,.5 L1,.5 M.5,.5 L.5,1",3:"M.5,.5 L.5,0"},"\u2541":{1:"M.5,.5 L.5,0 M0,.5 L1,.5",3:"M.5,.5 L.5,1"},"\u2542":{1:"M0,.5 L1,.5",3:"M.5,0 L.5,1"},"\u2543":{1:"M0.5,1 L.5,.5 L1,.5",3:"M.5,0 L.5,.5 L0,.5"},"\u2544":{1:"M0,.5 L.5,.5 L.5,1",3:"M.5,0 L.5,.5 L1,.5"},"\u2545":{1:"M.5,0 L.5,.5 L1,.5",3:"M0,.5 L.5,.5 L.5,1"},"\u2546":{1:"M.5,0 L.5,.5 L0,.5",3:"M0.5,1 L.5,.5 L1,.5"},"\u2547":{1:"M.5,.5 L.5,1",3:"M.5,.5 L.5,0 M0,.5 L1,.5"},"\u2548":{1:"M.5,.5 L.5,0",3:"M0,.5 L1,.5 M.5,.5 L.5,1"},"\u2549":{1:"M.5,.5 L1,.5",3:"M.5,0 L.5,1 M.5,.5 L0,.5"},"\u254A":{1:"M.5,.5 L0,.5",3:"M.5,0 L.5,1 M.5,.5 L1,.5"},"\u254C":{1:"M.1,.5 L.4,.5 M.6,.5 L.9,.5"},"\u254D":{3:"M.1,.5 L.4,.5 M.6,.5 L.9,.5"},"\u2504":{1:"M.0667,.5 L.2667,.5 M.4,.5 L.6,.5 M.7333,.5 L.9333,.5"},"\u2505":{3:"M.0667,.5 L.2667,.5 M.4,.5 L.6,.5 M.7333,.5 L.9333,.5"},"\u2508":{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"},"\u2509":{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"},"\u254E":{1:"M.5,.1 L.5,.4 M.5,.6 L.5,.9"},"\u254F":{3:"M.5,.1 L.5,.4 M.5,.6 L.5,.9"},"\u2506":{1:"M.5,.0667 L.5,.2667 M.5,.4 L.5,.6 M.5,.7333 L.5,.9333"},"\u2507":{3:"M.5,.0667 L.5,.2667 M.5,.4 L.5,.6 M.5,.7333 L.5,.9333"},"\u250A":{1:"M.5,.05 L.5,.2 M.5,.3 L.5,.45 L.5,.55 M.5,.7 L.5,.95"},"\u250B":{3:"M.5,.05 L.5,.2 M.5,.3 L.5,.45 L.5,.55 M.5,.7 L.5,.95"},"\u256D":{1:(r,e)=>`M.5,1 L.5,${.5+e/.15*.5} C.5,${.5+e/.15*.5},.5,.5,1,.5`},"\u256E":{1:(r,e)=>`M.5,1 L.5,${.5+e/.15*.5} C.5,${.5+e/.15*.5},.5,.5,0,.5`},"\u256F":{1:(r,e)=>`M.5,0 L.5,${.5-e/.15*.5} C.5,${.5-e/.15*.5},.5,.5,0,.5`},"\u2570":{1:(r,e)=>`M.5,0 L.5,${.5-e/.15*.5} C.5,${.5-e/.15*.5},.5,.5,1,.5`}},t.powerlineDefinitions={"\uE0B0":{d:"M0,0 L1,.5 L0,1",type:0,rightPadding:2},"\uE0B1":{d:"M-1,-.5 L1,.5 L-1,1.5",type:1,leftPadding:1,rightPadding:1},"\uE0B2":{d:"M1,0 L0,.5 L1,1",type:0,leftPadding:2},"\uE0B3":{d:"M2,-.5 L0,.5 L2,1.5",type:1,leftPadding:1,rightPadding:1},"\uE0B4":{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},"\uE0B5":{d:"M.2,1 C.422,1,.8,.826,.78,.5 C.8,.174,0.422,0,.2,0",type:1,rightPadding:1},"\uE0B6":{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},"\uE0B7":{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},"\uE0B8":{d:"M-.5,-.5 L1.5,1.5 L-.5,1.5",type:0},"\uE0B9":{d:"M-.5,-.5 L1.5,1.5",type:1,leftPadding:1,rightPadding:1},"\uE0BA":{d:"M1.5,-.5 L-.5,1.5 L1.5,1.5",type:0},"\uE0BC":{d:"M1.5,-.5 L-.5,1.5 L-.5,-.5",type:0},"\uE0BD":{d:"M1.5,-.5 L-.5,1.5",type:1,leftPadding:1,rightPadding:1},"\uE0BE":{d:"M-.5,-.5 L1.5,1.5 L1.5,-.5",type:0}},t.powerlineDefinitions["\uE0BB"]=t.powerlineDefinitions["\uE0BD"],t.powerlineDefinitions["\uE0BF"]=t.powerlineDefinitions["\uE0B9"],t.tryDrawCustomChar=function(r,e,o,s,i,h,m,d){let c=t.blockElementDefinitions[e];if(c)return(function(D,x,y,L,M,B){for(let P=0;P<x.length;P++){let H=x[P],w=M/8,R=B/8;D.fillRect(y+H.x*w,L+H.y*R,H.w*w,H.h*R)}})(r,c,o,s,i,h),!0;let v=u[e];if(v)return(function(D,x,y,L,M,B){let P=n.get(x);P||(P=new Map,n.set(x,P));let H=D.fillStyle;if(typeof H!="string")throw Error(`Unexpected fillStyle type "${H}"`);let w=P.get(H);if(!w){let R=x[0].length,O=x.length,F=D.canvas.ownerDocument.createElement("canvas");F.width=R,F.height=O;let z=(0,l.throwIfFalsy)(F.getContext("2d")),j=new ImageData(R,O),X,K,W,$;if(H.startsWith("#"))X=parseInt(H.slice(1,3),16),K=parseInt(H.slice(3,5),16),W=parseInt(H.slice(5,7),16),$=H.length>7&&parseInt(H.slice(7,9),16)||1;else{if(!H.startsWith("rgba"))throw Error(`Unexpected fillStyle color format "${H}" when drawing pattern glyph`);[X,K,W,$]=H.substring(5,H.length-1).split(",").map((I=>parseFloat(I)))}for(let I=0;I<O;I++)for(let U=0;U<R;U++)j.data[4*(I*R+U)]=X,j.data[4*(I*R+U)+1]=K,j.data[4*(I*R+U)+2]=W,j.data[4*(I*R+U)+3]=x[I][U]*(255*$);z.putImageData(j,0,0),w=(0,l.throwIfFalsy)(D.createPattern(F,null)),P.set(H,w)}D.fillStyle=w,D.fillRect(y,L,M,B)})(r,v,o,s,i,h),!0;let C=t.boxDrawingDefinitions[e];if(C)return(function(D,x,y,L,M,B,P){D.strokeStyle=D.fillStyle;for(let[H,w]of Object.entries(x)){let R;D.beginPath(),D.lineWidth=P*Number.parseInt(H),R=typeof w=="function"?w(.15,.15/B*M):w;for(let O of R.split(" ")){let F=O[0],z=p[F];if(!z){console.error(`Could not find drawing instructions for "${F}"`);continue}let j=O.substring(1).split(",");j[0]&&j[1]&&z(D,S(j,M,B,y,L,!0,P))}D.stroke(),D.closePath()}})(r,C,o,s,i,h,d),!0;let k=t.powerlineDefinitions[e];return!!k&&((function(D,x,y,L,M,B,P,H){let w=new Path2D;w.rect(y,L,M,B),D.clip(w),D.beginPath();let R=P/12;D.lineWidth=H*R;for(let O of x.d.split(" ")){let F=O[0],z=p[F];if(!z){console.error(`Could not find drawing instructions for "${F}"`);continue}let j=O.substring(1).split(",");j[0]&&j[1]&&z(D,S(j,M,B,y,L,!1,H,(x.leftPadding??0)*(R/2),(x.rightPadding??0)*(R/2)))}x.type===1?(D.strokeStyle=D.fillStyle,D.stroke()):D.fill(),D.closePath()})(r,k,o,s,i,h,m,d),!0)};let n=new Map;function f(r,e,o=0){return Math.max(Math.min(r,e),o)}let p={C:(r,e)=>r.bezierCurveTo(e[0],e[1],e[2],e[3],e[4],e[5]),L:(r,e)=>r.lineTo(e[0],e[1]),M:(r,e)=>r.moveTo(e[0],e[1])};function S(r,e,o,s,i,h,m,d=0,c=0){let v=r.map((C=>parseFloat(C)||parseInt(C)));if(v.length<2)throw Error("Too few arguments for instruction");for(let C=0;C<v.length;C+=2)v[C]*=e-d*m-c*m,h&&v[C]!==0&&(v[C]=f(Math.round(v[C]+.5)-.5,e,0)),v[C]+=s+d*m;for(let C=1;C<v.length;C+=2)v[C]*=o,h&&v[C]!==0&&(v[C]=f(Math.round(v[C]+.5)-.5,o,0)),v[C]+=i;return v}},56:(A,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.observeDevicePixelDimensions=void 0;let l=a(859);t.observeDevicePixelDimensions=function(u,n,f){let p=new n.ResizeObserver((S=>{let r=S.find((s=>s.target===u));if(!r)return;if(!("devicePixelContentBoxSize"in r))return p==null||p.disconnect(),void(p=void 0);let e=r.devicePixelContentBoxSize[0].inlineSize,o=r.devicePixelContentBoxSize[0].blockSize;e>0&&o>0&&f(e,o)}));try{p.observe(u,{box:["device-pixel-content-box"]})}catch{p.disconnect(),p=void 0}return(0,l.toDisposable)((()=>p==null?void 0:p.disconnect()))}},374:(A,t)=>{function a(u){return 57508<=u&&u<=57558}function l(u){return u>=128512&&u<=128591||u>=127744&&u<=128511||u>=128640&&u<=128767||u>=9728&&u<=9983||u>=9984&&u<=10175||u>=65024&&u<=65039||u>=129280&&u<=129535||u>=127462&&u<=127487}Object.defineProperty(t,"__esModule",{value:!0}),t.computeNextVariantOffset=t.createRenderDimensions=t.treatGlyphAsBackgroundColor=t.allowRescaling=t.isEmoji=t.isRestrictedPowerlineGlyph=t.isPowerlineGlyph=t.throwIfFalsy=void 0,t.throwIfFalsy=function(u){if(!u)throw Error("value must not be falsy");return u},t.isPowerlineGlyph=a,t.isRestrictedPowerlineGlyph=function(u){return 57520<=u&&u<=57527},t.isEmoji=l,t.allowRescaling=function(u,n,f,p){return n===1&&f>Math.ceil(1.5*p)&&u!==void 0&&u>255&&!l(u)&&!a(u)&&!(function(S){return 57344<=S&&S<=63743})(u)},t.treatGlyphAsBackgroundColor=function(u){return a(u)||(function(n){return 9472<=n&&n<=9631})(u)},t.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}}}},t.computeNextVariantOffset=function(u,n,f=0){return(u-(2*Math.round(n)-f))%(2*Math.round(n))}},296:(A,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.createSelectionRenderModel=void 0;class a{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(u,n,f,p=!1){if(this.selectionStart=n,this.selectionEnd=f,!n||!f||n[0]===f[0]&&n[1]===f[1])return void this.clear();let S=u.buffers.active.ydisp,r=n[1]-S,e=f[1]-S,o=Math.max(r,0),s=Math.min(e,u.rows-1);o>=u.rows||s<0?this.clear():(this.hasSelection=!0,this.columnSelectMode=p,this.viewportStartRow=r,this.viewportEndRow=e,this.viewportCappedStartRow=o,this.viewportCappedEndRow=s,this.startCol=n[0],this.endCol=f[0])}isCellSelected(u,n,f){return!!this.hasSelection&&(f-=u.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?n>=this.startCol&&f>=this.viewportCappedStartRow&&n<this.endCol&&f<=this.viewportCappedEndRow:n<this.startCol&&f>=this.viewportCappedStartRow&&n>=this.endCol&&f<=this.viewportCappedEndRow:f>this.viewportStartRow&&f<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&f===this.viewportStartRow&&n>=this.startCol&&n<this.endCol||this.viewportStartRow<this.viewportEndRow&&f===this.viewportEndRow&&n<this.endCol||this.viewportStartRow<this.viewportEndRow&&f===this.viewportStartRow&&n>=this.startCol)}}t.createSelectionRenderModel=function(){return new a}},509:(A,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.TextureAtlas=void 0;let l=a(237),u=a(860),n=a(374),f=a(160),p=a(345),S=a(485),r=a(385),e=a(147),o=a(855),s={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}},i;class h{get pages(){return this._pages}constructor(C,k,D){this._document=C,this._config=k,this._unicodeService=D,this._didWarmUp=!1,this._cacheMap=new S.FourKeyMap,this._cacheMapCombined=new S.FourKeyMap,this._pages=[],this._activePages=[],this._workBoundingBox={top:0,left:0,bottom:0,right:0},this._workAttributeData=new e.AttributeData,this._textureSize=512,this._onAddTextureAtlasCanvas=new p.EventEmitter,this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event,this._onRemoveTextureAtlasCanvas=new p.EventEmitter,this.onRemoveTextureAtlasCanvas=this._onRemoveTextureAtlasCanvas.event,this._requestClearModel=!1,this._createNewPage(),this._tmpCanvas=c(C,4*this._config.deviceCellWidth+4,this._config.deviceCellHeight+4),this._tmpCtx=(0,n.throwIfFalsy)(this._tmpCanvas.getContext("2d",{alpha:this._config.allowTransparency,willReadFrequently:!0}))}dispose(){for(let C of this.pages)C.canvas.remove();this._onAddTextureAtlasCanvas.dispose()}warmUp(){this._didWarmUp||(this._didWarmUp=(this._doWarmUp(),!0))}_doWarmUp(){let C=new r.IdleTaskQueue;for(let k=33;k<126;k++)C.enqueue((()=>{if(!this._cacheMap.get(k,o.DEFAULT_COLOR,o.DEFAULT_COLOR,o.DEFAULT_EXT)){let D=this._drawToCache(k,o.DEFAULT_COLOR,o.DEFAULT_COLOR,o.DEFAULT_EXT);this._cacheMap.set(k,o.DEFAULT_COLOR,o.DEFAULT_COLOR,o.DEFAULT_EXT,D)}}))}beginFrame(){return this._requestClearModel}clearTexture(){if(this._pages[0].currentRow.x!==0||this._pages[0].currentRow.y!==0){for(let C of this._pages)C.clear();this._cacheMap.clear(),this._cacheMapCombined.clear(),this._didWarmUp=!1}}_createNewPage(){if(h.maxAtlasPages&&this._pages.length>=Math.max(4,h.maxAtlasPages)){let k=this._pages.filter((P=>2*P.canvas.width<=(h.maxTextureSize||4096))).sort(((P,H)=>H.canvas.width===P.canvas.width?H.percentageUsed-P.percentageUsed:H.canvas.width-P.canvas.width)),D=-1,x=0;for(let P=0;P<k.length;P++)if(k[P].canvas.width!==x)D=P,x=k[P].canvas.width;else if(P-D==3)break;let y=k.slice(D,D+4),L=y.map((P=>P.glyphs[0].texturePage)).sort(((P,H)=>P>H?1:-1)),M=this.pages.length-y.length,B=this._mergePages(y,M);B.version++;for(let P=L.length-1;P>=0;P--)this._deletePage(L[P]);this.pages.push(B),this._requestClearModel=!0,this._onAddTextureAtlasCanvas.fire(B.canvas)}let C=new m(this._document,this._textureSize);return this._pages.push(C),this._activePages.push(C),this._onAddTextureAtlasCanvas.fire(C.canvas),C}_mergePages(C,k){let D=2*C[0].canvas.width,x=new m(this._document,D,C);for(let[y,L]of C.entries()){let M=y*L.canvas.width%D,B=Math.floor(y/2)*L.canvas.height;x.ctx.drawImage(L.canvas,M,B);for(let H of L.glyphs)H.texturePage=k,H.sizeClipSpace.x=H.size.x/D,H.sizeClipSpace.y=H.size.y/D,H.texturePosition.x+=M,H.texturePosition.y+=B,H.texturePositionClipSpace.x=H.texturePosition.x/D,H.texturePositionClipSpace.y=H.texturePosition.y/D;this._onRemoveTextureAtlasCanvas.fire(L.canvas);let P=this._activePages.indexOf(L);P!==-1&&this._activePages.splice(P,1)}return x}_deletePage(C){this._pages.splice(C,1);for(let k=C;k<this._pages.length;k++){let D=this._pages[k];for(let x of D.glyphs)x.texturePage--;D.version++}}getRasterizedGlyphCombinedChar(C,k,D,x,y){return this._getFromCacheMap(this._cacheMapCombined,C,k,D,x,y)}getRasterizedGlyph(C,k,D,x,y){return this._getFromCacheMap(this._cacheMap,C,k,D,x,y)}_getFromCacheMap(C,k,D,x,y,L=!1){return i=C.get(k,D,x,y),i||(i=this._drawToCache(k,D,x,y,L),C.set(k,D,x,y,i)),i}_getColorFromAnsiIndex(C){if(C>=this._config.colors.ansi.length)throw Error("No color found for idx "+C);return this._config.colors.ansi[C]}_getBackgroundColor(C,k,D,x){if(this._config.allowTransparency)return f.NULL_COLOR;let y;switch(C){case 16777216:case 33554432:y=this._getColorFromAnsiIndex(k);break;case 50331648:let L=e.AttributeData.toColorRGB(k);y=f.channels.toColor(L[0],L[1],L[2]);break;default:y=D?f.color.opaque(this._config.colors.foreground):this._config.colors.background}return y}_getForegroundColor(C,k,D,x,y,L,M,B,P,H){let w=this._getMinimumContrastColor(C,k,D,x,y,L,M,P,B,H);if(w)return w;let R;switch(y){case 16777216:case 33554432:this._config.drawBoldTextInBrightColors&&P&&L<8&&(L+=8),R=this._getColorFromAnsiIndex(L);break;case 50331648:let O=e.AttributeData.toColorRGB(L);R=f.channels.toColor(O[0],O[1],O[2]);break;default:R=M?this._config.colors.background:this._config.colors.foreground}return this._config.allowTransparency&&(R=f.color.opaque(R)),B&&(R=f.color.multiplyOpacity(R,l.DIM_OPACITY)),R}_resolveBackgroundRgba(C,k,D){switch(C){case 16777216:case 33554432:return this._getColorFromAnsiIndex(k).rgba;case 50331648:return k<<8;default:return D?this._config.colors.foreground.rgba:this._config.colors.background.rgba}}_resolveForegroundRgba(C,k,D,x){switch(C){case 16777216:case 33554432:return this._config.drawBoldTextInBrightColors&&x&&k<8&&(k+=8),this._getColorFromAnsiIndex(k).rgba;case 50331648:return k<<8;default:return D?this._config.colors.background.rgba:this._config.colors.foreground.rgba}}_getMinimumContrastColor(C,k,D,x,y,L,M,B,P,H){if(this._config.minimumContrastRatio===1||H)return;let w=this._getContrastCache(P),R=w.getColor(C,x);if(R!==void 0)return R||void 0;let O=this._resolveBackgroundRgba(k,D,M),F=this._resolveForegroundRgba(y,L,M,B),z=f.rgba.ensureContrastRatio(O,F,this._config.minimumContrastRatio/(P?2:1));if(!z)return void w.setColor(C,x,null);let j=f.channels.toColor(z>>24&255,z>>16&255,z>>8&255);return w.setColor(C,x,j),j}_getContrastCache(C){return C?this._config.colors.halfContrastCache:this._config.colors.contrastCache}_drawToCache(C,k,D,x,y=!1){let L=typeof C=="number"?String.fromCharCode(C):C,M=Math.min(this._config.deviceCellWidth*Math.max(L.length,2)+4,this._textureSize);this._tmpCanvas.width<M&&(this._tmpCanvas.width=M);let B=Math.min(this._config.deviceCellHeight+8,this._textureSize);if(this._tmpCanvas.height<B&&(this._tmpCanvas.height=B),this._tmpCtx.save(),this._workAttributeData.fg=D,this._workAttributeData.bg=k,this._workAttributeData.extended.ext=x,this._workAttributeData.isInvisible())return s;let P=!!this._workAttributeData.isBold(),H=!!this._workAttributeData.isInverse(),w=!!this._workAttributeData.isDim(),R=!!this._workAttributeData.isItalic(),O=!!this._workAttributeData.isUnderline(),F=!!this._workAttributeData.isStrikethrough(),z=!!this._workAttributeData.isOverline(),j=this._workAttributeData.getFgColor(),X=this._workAttributeData.getFgColorMode(),K=this._workAttributeData.getBgColor(),W=this._workAttributeData.getBgColorMode();if(H){let V=j;j=K,K=V;let ie=X;X=W,W=ie}let $=this._getBackgroundColor(W,K,H,w);this._tmpCtx.globalCompositeOperation="copy",this._tmpCtx.fillStyle=$.css,this._tmpCtx.fillRect(0,0,this._tmpCanvas.width,this._tmpCanvas.height),this._tmpCtx.globalCompositeOperation="source-over";let I=P?this._config.fontWeightBold:this._config.fontWeight,U=R?"italic":"";this._tmpCtx.font=`${U} ${I} ${this._config.fontSize*this._config.devicePixelRatio}px ${this._config.fontFamily}`,this._tmpCtx.textBaseline=l.TEXT_BASELINE;let q=L.length===1&&(0,n.isPowerlineGlyph)(L.charCodeAt(0)),G=L.length===1&&(0,n.isRestrictedPowerlineGlyph)(L.charCodeAt(0)),Q=this._getForegroundColor(k,W,K,D,X,j,H,w,P,(0,n.treatGlyphAsBackgroundColor)(L.charCodeAt(0)));this._tmpCtx.fillStyle=Q.css;let Y=G?0:4,re=!1;this._config.customGlyphs!==!1&&(re=(0,u.tryDrawCustomChar)(this._tmpCtx,L,Y,Y,this._config.deviceCellWidth,this._config.deviceCellHeight,this._config.fontSize,this._config.devicePixelRatio));let he,J=!q;if(he=typeof C=="number"?this._unicodeService.wcwidth(C):this._unicodeService.getStringCellWidth(C),O){this._tmpCtx.save();let V=Math.max(1,Math.floor(this._config.fontSize*this._config.devicePixelRatio/15)),ie=V%2==1?.5:0;if(this._tmpCtx.lineWidth=V,this._workAttributeData.isUnderlineColorDefault())this._tmpCtx.strokeStyle=this._tmpCtx.fillStyle;else if(this._workAttributeData.isUnderlineColorRGB())J=!1,this._tmpCtx.strokeStyle=`rgb(${e.AttributeData.toColorRGB(this._workAttributeData.getUnderlineColor()).join(",")})`;else{J=!1;let le=this._workAttributeData.getUnderlineColor();this._config.drawBoldTextInBrightColors&&this._workAttributeData.isBold()&&le<8&&(le+=8),this._tmpCtx.strokeStyle=this._getColorFromAnsiIndex(le).css}this._tmpCtx.beginPath();let ae=Y,oe=Math.ceil(Y+this._config.deviceCharHeight)-ie-(y?2*V:0),Le=oe+V,ue=oe+2*V,_e=this._workAttributeData.getUnderlineVariantOffset();for(let le=0;le<he;le++){this._tmpCtx.save();let ne=ae+le*this._config.deviceCellWidth,Z=ae+(le+1)*this._config.deviceCellWidth,Oe=ne+this._config.deviceCellWidth/2;switch(this._workAttributeData.extended.underlineStyle){case 2:this._tmpCtx.moveTo(ne,oe),this._tmpCtx.lineTo(Z,oe),this._tmpCtx.moveTo(ne,ue),this._tmpCtx.lineTo(Z,ue);break;case 3:let He=V<=1?ue:Math.ceil(Y+this._config.deviceCharHeight-V/2)-ie,Fe=V<=1?oe:Math.ceil(Y+this._config.deviceCharHeight+V/2)-ie,kt=new Path2D;kt.rect(ne,oe,this._config.deviceCellWidth,ue-oe),this._tmpCtx.clip(kt),this._tmpCtx.moveTo(ne-this._config.deviceCellWidth/2,Le),this._tmpCtx.bezierCurveTo(ne-this._config.deviceCellWidth/2,Fe,ne,Fe,ne,Le),this._tmpCtx.bezierCurveTo(ne,He,Oe,He,Oe,Le),this._tmpCtx.bezierCurveTo(Oe,Fe,Z,Fe,Z,Le),this._tmpCtx.bezierCurveTo(Z,He,Z+this._config.deviceCellWidth/2,He,Z+this._config.deviceCellWidth/2,Le);break;case 4:let We=_e===0?0:_e>=V?2*V-_e:V-_e;!(_e>=V)==0||We===0?(this._tmpCtx.setLineDash([Math.round(V),Math.round(V)]),this._tmpCtx.moveTo(ne+We,oe),this._tmpCtx.lineTo(Z,oe)):(this._tmpCtx.setLineDash([Math.round(V),Math.round(V)]),this._tmpCtx.moveTo(ne,oe),this._tmpCtx.lineTo(ne+We,oe),this._tmpCtx.moveTo(ne+We+V,oe),this._tmpCtx.lineTo(Z,oe)),_e=(0,n.computeNextVariantOffset)(Z-ne,V,_e);break;case 5:let Qe=Z-ne,Dt=Math.floor(.6*Qe),Rt=Math.floor(.3*Qe),yi=Qe-Dt-Rt;this._tmpCtx.setLineDash([Dt,Rt,yi]),this._tmpCtx.moveTo(ne,oe),this._tmpCtx.lineTo(Z,oe);break;default:this._tmpCtx.moveTo(ne,oe),this._tmpCtx.lineTo(Z,oe)}this._tmpCtx.stroke(),this._tmpCtx.restore()}if(this._tmpCtx.restore(),!re&&this._config.fontSize>=12&&!this._config.allowTransparency&&L!==" "){this._tmpCtx.save(),this._tmpCtx.textBaseline="alphabetic";let le=this._tmpCtx.measureText(L);if(this._tmpCtx.restore(),"actualBoundingBoxDescent"in le&&le.actualBoundingBoxDescent>0){this._tmpCtx.save();let ne=new Path2D;ne.rect(ae,oe-Math.ceil(V/2),this._config.deviceCellWidth*he,ue-oe+Math.ceil(V/2)),this._tmpCtx.clip(ne),this._tmpCtx.lineWidth=3*this._config.devicePixelRatio,this._tmpCtx.strokeStyle=$.css,this._tmpCtx.strokeText(L,Y,Y+this._config.deviceCharHeight),this._tmpCtx.restore()}}}if(z){let V=Math.max(1,Math.floor(this._config.fontSize*this._config.devicePixelRatio/15)),ie=V%2==1?.5:0;this._tmpCtx.lineWidth=V,this._tmpCtx.strokeStyle=this._tmpCtx.fillStyle,this._tmpCtx.beginPath(),this._tmpCtx.moveTo(Y,Y+ie),this._tmpCtx.lineTo(Y+this._config.deviceCharWidth*he,Y+ie),this._tmpCtx.stroke()}if(re||this._tmpCtx.fillText(L,Y,Y+this._config.deviceCharHeight),L==="_"&&!this._config.allowTransparency){let V=d(this._tmpCtx.getImageData(Y,Y,this._config.deviceCellWidth,this._config.deviceCellHeight),$,Q,J);if(V)for(let ie=1;ie<=5&&(this._tmpCtx.save(),this._tmpCtx.fillStyle=$.css,this._tmpCtx.fillRect(0,0,this._tmpCanvas.width,this._tmpCanvas.height),this._tmpCtx.restore(),this._tmpCtx.fillText(L,Y,Y+this._config.deviceCharHeight-ie),V=d(this._tmpCtx.getImageData(Y,Y,this._config.deviceCellWidth,this._config.deviceCellHeight),$,Q,J),V);ie++);}if(F){let V=Math.max(1,Math.floor(this._config.fontSize*this._config.devicePixelRatio/10)),ie=this._tmpCtx.lineWidth%2==1?.5:0;this._tmpCtx.lineWidth=V,this._tmpCtx.strokeStyle=this._tmpCtx.fillStyle,this._tmpCtx.beginPath(),this._tmpCtx.moveTo(Y,Y+Math.floor(this._config.deviceCharHeight/2)-ie),this._tmpCtx.lineTo(Y+this._config.deviceCharWidth*he,Y+Math.floor(this._config.deviceCharHeight/2)-ie),this._tmpCtx.stroke()}this._tmpCtx.restore();let Ce=this._tmpCtx.getImageData(0,0,this._tmpCanvas.width,this._tmpCanvas.height),Re;if(Re=this._config.allowTransparency?(function(V){for(let ie=0;ie<V.data.length;ie+=4)if(V.data[ie+3]>0)return!1;return!0})(Ce):d(Ce,$,Q,J),Re)return s;let se=this._findGlyphBoundingBox(Ce,this._workBoundingBox,M,G,re,Y),ee,te;for(;;){if(this._activePages.length===0){let V=this._createNewPage();ee=V,te=V.currentRow,te.height=se.size.y;break}ee=this._activePages[this._activePages.length-1],te=ee.currentRow;for(let V of this._activePages)se.size.y<=V.currentRow.height&&(ee=V,te=V.currentRow);for(let V=this._activePages.length-1;V>=0;V--)for(let ie of this._activePages[V].fixedRows)ie.height<=te.height&&se.size.y<=ie.height&&(ee=this._activePages[V],te=ie);if(te.y+se.size.y>=ee.canvas.height||te.height>se.size.y+2){let V=!1;if(ee.currentRow.y+ee.currentRow.height+se.size.y>=ee.canvas.height){let ie;for(let ae of this._activePages)if(ae.currentRow.y+ae.currentRow.height+se.size.y<ae.canvas.height){ie=ae;break}if(ie)ee=ie;else if(h.maxAtlasPages&&this._pages.length>=h.maxAtlasPages&&te.y+se.size.y<=ee.canvas.height&&te.height>=se.size.y&&te.x+se.size.x<=ee.canvas.width)V=!0;else{let ae=this._createNewPage();ee=ae,te=ae.currentRow,te.height=se.size.y,V=!0}}V||(ee.currentRow.height>0&&ee.fixedRows.push(ee.currentRow),te={x:0,y:ee.currentRow.y+ee.currentRow.height,height:se.size.y},ee.fixedRows.push(te),ee.currentRow={x:0,y:te.y+te.height,height:0})}if(te.x+se.size.x<=ee.canvas.width)break;te===ee.currentRow?(te.x=0,te.y+=te.height,te.height=0):ee.fixedRows.splice(ee.fixedRows.indexOf(te),1)}return se.texturePage=this._pages.indexOf(ee),se.texturePosition.x=te.x,se.texturePosition.y=te.y,se.texturePositionClipSpace.x=te.x/ee.canvas.width,se.texturePositionClipSpace.y=te.y/ee.canvas.height,se.sizeClipSpace.x/=ee.canvas.width,se.sizeClipSpace.y/=ee.canvas.height,te.height=Math.max(te.height,se.size.y),te.x+=se.size.x,ee.ctx.putImageData(Ce,se.texturePosition.x-this._workBoundingBox.left,se.texturePosition.y-this._workBoundingBox.top,this._workBoundingBox.left,this._workBoundingBox.top,se.size.x,se.size.y),ee.addGlyph(se),ee.version++,se}_findGlyphBoundingBox(C,k,D,x,y,L){k.top=0;let M=x?this._config.deviceCellHeight:this._tmpCanvas.height,B=x?this._config.deviceCellWidth:D,P=!1;for(let H=0;H<M;H++){for(let w=0;w<B;w++){let R=H*this._tmpCanvas.width*4+4*w+3;if(C.data[R]!==0){k.top=H,P=!0;break}}if(P)break}k.left=0,P=!1;for(let H=0;H<L+B;H++){for(let w=0;w<M;w++){let R=w*this._tmpCanvas.width*4+4*H+3;if(C.data[R]!==0){k.left=H,P=!0;break}}if(P)break}k.right=B,P=!1;for(let H=L+B-1;H>=L;H--){for(let w=0;w<M;w++){let R=w*this._tmpCanvas.width*4+4*H+3;if(C.data[R]!==0){k.right=H,P=!0;break}}if(P)break}k.bottom=M,P=!1;for(let H=M-1;H>=0;H--){for(let w=0;w<B;w++){let R=H*this._tmpCanvas.width*4+4*w+3;if(C.data[R]!==0){k.bottom=H,P=!0;break}}if(P)break}return{texturePage:0,texturePosition:{x:0,y:0},texturePositionClipSpace:{x:0,y:0},size:{x:k.right-k.left+1,y:k.bottom-k.top+1},sizeClipSpace:{x:k.right-k.left+1,y:k.bottom-k.top+1},offset:{x:-k.left+L+(x||y?Math.floor((this._config.deviceCellWidth-this._config.deviceCharWidth)/2):0),y:-k.top+L+(x||y?this._config.lineHeight===1?0:Math.round((this._config.deviceCellHeight-this._config.deviceCharHeight)/2):0)}}}}t.TextureAtlas=h;class m{get percentageUsed(){return this._usedPixels/(this.canvas.width*this.canvas.height)}get glyphs(){return this._glyphs}addGlyph(C){this._glyphs.push(C),this._usedPixels+=C.size.x*C.size.y}constructor(C,k,D){if(this._usedPixels=0,this._glyphs=[],this.version=0,this.currentRow={x:0,y:0,height:0},this.fixedRows=[],D)for(let x of D)this._glyphs.push(...x.glyphs),this._usedPixels+=x._usedPixels;this.canvas=c(C,k,k),this.ctx=(0,n.throwIfFalsy)(this.canvas.getContext("2d",{alpha:!0}))}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 d(v,C,k,D){let x=C.rgba>>>24,y=C.rgba>>>16&255,L=C.rgba>>>8&255,M=k.rgba>>>24,B=k.rgba>>>16&255,P=k.rgba>>>8&255,H=Math.floor((Math.abs(x-M)+Math.abs(y-B)+Math.abs(L-P))/12),w=!0;for(let R=0;R<v.data.length;R+=4)v.data[R]===x&&v.data[R+1]===y&&v.data[R+2]===L||D&&Math.abs(v.data[R]-x)+Math.abs(v.data[R+1]-y)+Math.abs(v.data[R+2]-L)<H?v.data[R+3]=0:w=!1;return w}function c(v,C,k){let D=v.createElement("canvas");return D.width=C,D.height=k,D}},577:function(A,t,a){var l=this&&this.__decorate||function(o,s,i,h){var m,d=arguments.length,c=d<3?s:h===null?h=Object.getOwnPropertyDescriptor(s,i):h;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")c=Reflect.decorate(o,s,i,h);else for(var v=o.length-1;v>=0;v--)(m=o[v])&&(c=(d<3?m(c):d>3?m(s,i,c):m(s,i))||c);return d>3&&c&&Object.defineProperty(s,i,c),c},u=this&&this.__param||function(o,s){return function(i,h){s(i,h,o)}};Object.defineProperty(t,"__esModule",{value:!0}),t.CharacterJoinerService=t.JoinedCellData=void 0;let n=a(147),f=a(855),p=a(782),S=a(97);class r extends n.AttributeData{constructor(s,i,h){super(),this.content=0,this.combinedData="",this.fg=s.fg,this.bg=s.bg,this.combinedData=i,this._width=h}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(s){throw Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}t.JoinedCellData=r;let e=t.CharacterJoinerService=class li{constructor(s){this._bufferService=s,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new p.CellData}register(s){let i={id:this._nextCharacterJoinerId++,handler:s};return this._characterJoiners.push(i),i.id}deregister(s){for(let i=0;i<this._characterJoiners.length;i++)if(this._characterJoiners[i].id===s)return this._characterJoiners.splice(i,1),!0;return!1}getJoinedCharacters(s){if(this._characterJoiners.length===0)return[];let i=this._bufferService.buffer.lines.get(s);if(!i||i.length===0)return[];let h=[],m=i.translateToString(!0),d=0,c=0,v=0,C=i.getFg(0),k=i.getBg(0);for(let D=0;D<i.getTrimmedLength();D++)if(i.loadCell(D,this._workCell),this._workCell.getWidth()!==0){if(this._workCell.fg!==C||this._workCell.bg!==k){if(D-d>1){let x=this._getJoinedRanges(m,v,c,i,d);for(let y=0;y<x.length;y++)h.push(x[y])}d=D,v=c,C=this._workCell.fg,k=this._workCell.bg}c+=this._workCell.getChars().length||f.WHITESPACE_CELL_CHAR.length}if(this._bufferService.cols-d>1){let D=this._getJoinedRanges(m,v,c,i,d);for(let x=0;x<D.length;x++)h.push(D[x])}return h}_getJoinedRanges(s,i,h,m,d){let c=s.substring(i,h),v=[];try{v=this._characterJoiners[0].handler(c)}catch(C){console.error(C)}for(let C=1;C<this._characterJoiners.length;C++)try{let k=this._characterJoiners[C].handler(c);for(let D=0;D<k.length;D++)li._mergeRanges(v,k[D])}catch(k){console.error(k)}return this._stringRangesToCellRanges(v,m,d),v}_stringRangesToCellRanges(s,i,h){let m=0,d=!1,c=0,v=s[m];if(v){for(let C=h;C<this._bufferService.cols;C++){let k=i.getWidth(C),D=i.getString(C).length||f.WHITESPACE_CELL_CHAR.length;if(k!==0){if(!d&&v[0]<=c&&(v[0]=C,d=!0),v[1]<=c){if(v[1]=C,v=s[++m],!v)break;v[0]<=c?(v[0]=C,d=!0):d=!1}c+=D}}v&&(v[1]=this._bufferService.cols)}}static _mergeRanges(s,i){let h=!1;for(let m=0;m<s.length;m++){let d=s[m];if(h){if(i[1]<=d[0])return s[m-1][1]=i[1],s;if(i[1]<=d[1])return s[m-1][1]=Math.max(i[1],d[1]),s.splice(m,1),s;s.splice(m,1),m--}else{if(i[1]<=d[0])return s.splice(m,0,i),s;if(i[1]<=d[1])return d[0]=Math.min(i[0],d[0]),s;i[0]<d[1]&&(d[0]=Math.min(i[0],d[0]),h=!0)}}return h?s[s.length-1][1]=i[1]:s.push(i),s}};t.CharacterJoinerService=e=l([u(0,S.IBufferService)],e)},160:(A,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.contrastRatio=t.toPaddedHex=t.rgba=t.rgb=t.css=t.color=t.channels=t.NULL_COLOR=void 0;let a=0,l=0,u=0,n=0;var f,p,S,r,e;function o(i){let h=i.toString(16);return h.length<2?"0"+h:h}function s(i,h){return i<h?(h+.05)/(i+.05):(i+.05)/(h+.05)}t.NULL_COLOR={css:"#00000000",rgba:0},(function(i){i.toCss=function(h,m,d,c){return c===void 0?`#${o(h)}${o(m)}${o(d)}`:`#${o(h)}${o(m)}${o(d)}${o(c)}`},i.toRgba=function(h,m,d,c=255){return(h<<24|m<<16|d<<8|c)>>>0},i.toColor=function(h,m,d,c){return{css:i.toCss(h,m,d,c),rgba:i.toRgba(h,m,d,c)}}})(f||(t.channels=f={})),(function(i){function h(m,d){return n=Math.round(255*d),[a,l,u]=e.toChannels(m.rgba),{css:f.toCss(a,l,u,n),rgba:f.toRgba(a,l,u,n)}}i.blend=function(m,d){if(n=(255&d.rgba)/255,n===1)return{css:d.css,rgba:d.rgba};let c=d.rgba>>24&255,v=d.rgba>>16&255,C=d.rgba>>8&255,k=m.rgba>>24&255,D=m.rgba>>16&255,x=m.rgba>>8&255;return a=k+Math.round((c-k)*n),l=D+Math.round((v-D)*n),u=x+Math.round((C-x)*n),{css:f.toCss(a,l,u),rgba:f.toRgba(a,l,u)}},i.isOpaque=function(m){return(255&m.rgba)==255},i.ensureContrastRatio=function(m,d,c){let v=e.ensureContrastRatio(m.rgba,d.rgba,c);if(v)return f.toColor(v>>24&255,v>>16&255,v>>8&255)},i.opaque=function(m){let d=(255|m.rgba)>>>0;return[a,l,u]=e.toChannels(d),{css:f.toCss(a,l,u),rgba:d}},i.opacity=h,i.multiplyOpacity=function(m,d){return n=255&m.rgba,h(m,n*d/255)},i.toColorRGB=function(m){return[m.rgba>>24&255,m.rgba>>16&255,m.rgba>>8&255]}})(p||(t.color=p={})),(function(i){let h,m;try{let d=document.createElement("canvas");d.width=1,d.height=1;let c=d.getContext("2d",{willReadFrequently:!0});c&&(h=c,h.globalCompositeOperation="copy",m=h.createLinearGradient(0,0,1,1))}catch{}i.toColor=function(d){if(d.match(/#[\da-f]{3,8}/i))switch(d.length){case 4:return a=parseInt(d.slice(1,2).repeat(2),16),l=parseInt(d.slice(2,3).repeat(2),16),u=parseInt(d.slice(3,4).repeat(2),16),f.toColor(a,l,u);case 5:return a=parseInt(d.slice(1,2).repeat(2),16),l=parseInt(d.slice(2,3).repeat(2),16),u=parseInt(d.slice(3,4).repeat(2),16),n=parseInt(d.slice(4,5).repeat(2),16),f.toColor(a,l,u,n);case 7:return{css:d,rgba:(parseInt(d.slice(1),16)<<8|255)>>>0};case 9:return{css:d,rgba:parseInt(d.slice(1),16)>>>0}}let c=d.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(c)return a=parseInt(c[1]),l=parseInt(c[2]),u=parseInt(c[3]),n=Math.round(255*(c[5]===void 0?1:parseFloat(c[5]))),f.toColor(a,l,u,n);if(!h||!m||(h.fillStyle=m,h.fillStyle=d,typeof h.fillStyle!="string")||(h.fillRect(0,0,1,1),[a,l,u,n]=h.getImageData(0,0,1,1).data,n!==255))throw Error("css.toColor: Unsupported css format");return{rgba:f.toRgba(a,l,u,n),css:d}}})(S||(t.css=S={})),(function(i){function h(m,d,c){let v=m/255,C=d/255,k=c/255;return .2126*(v<=.03928?v/12.92:((v+.055)/1.055)**2.4)+.7152*(C<=.03928?C/12.92:((C+.055)/1.055)**2.4)+.0722*(k<=.03928?k/12.92:((k+.055)/1.055)**2.4)}i.relativeLuminance=function(m){return h(m>>16&255,m>>8&255,255&m)},i.relativeLuminance2=h})(r||(t.rgb=r={})),(function(i){function h(d,c,v){let C=d>>24&255,k=d>>16&255,D=d>>8&255,x=c>>24&255,y=c>>16&255,L=c>>8&255,M=s(r.relativeLuminance2(x,y,L),r.relativeLuminance2(C,k,D));for(;M<v&&(x>0||y>0||L>0);)x-=Math.max(0,Math.ceil(.1*x)),y-=Math.max(0,Math.ceil(.1*y)),L-=Math.max(0,Math.ceil(.1*L)),M=s(r.relativeLuminance2(x,y,L),r.relativeLuminance2(C,k,D));return(x<<24|y<<16|L<<8|255)>>>0}function m(d,c,v){let C=d>>24&255,k=d>>16&255,D=d>>8&255,x=c>>24&255,y=c>>16&255,L=c>>8&255,M=s(r.relativeLuminance2(x,y,L),r.relativeLuminance2(C,k,D));for(;M<v&&(x<255||y<255||L<255);)x=Math.min(255,x+Math.ceil(.1*(255-x))),y=Math.min(255,y+Math.ceil(.1*(255-y))),L=Math.min(255,L+Math.ceil(.1*(255-L))),M=s(r.relativeLuminance2(x,y,L),r.relativeLuminance2(C,k,D));return(x<<24|y<<16|L<<8|255)>>>0}i.blend=function(d,c){if(n=(255&c)/255,n===1)return c;let v=c>>24&255,C=c>>16&255,k=c>>8&255,D=d>>24&255,x=d>>16&255,y=d>>8&255;return a=D+Math.round((v-D)*n),l=x+Math.round((C-x)*n),u=y+Math.round((k-y)*n),f.toRgba(a,l,u)},i.ensureContrastRatio=function(d,c,v){let C=r.relativeLuminance(d>>8),k=r.relativeLuminance(c>>8);if(s(C,k)<v){if(k<C){let y=h(d,c,v),L=s(C,r.relativeLuminance(y>>8));if(L<v){let M=m(d,c,v);return L>s(C,r.relativeLuminance(M>>8))?y:M}return y}let D=m(d,c,v),x=s(C,r.relativeLuminance(D>>8));if(x<v){let y=h(d,c,v);return x>s(C,r.relativeLuminance(y>>8))?D:y}return D}},i.reduceLuminance=h,i.increaseLuminance=m,i.toChannels=function(d){return[d>>24&255,d>>16&255,d>>8&255,255&d]}})(e||(t.rgba=e={})),t.toPaddedHex=o,t.contrastRatio=s},345:(A,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.runAndSubscribe=t.forwardEvent=t.EventEmitter=void 0,t.EventEmitter=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||(this._event=a=>(this._listeners.push(a),{dispose:()=>{if(!this._disposed){for(let l=0;l<this._listeners.length;l++)if(this._listeners[l]===a)return void this._listeners.splice(l,1)}}})),this._event}fire(a,l){let u=[];for(let n=0;n<this._listeners.length;n++)u.push(this._listeners[n]);for(let n=0;n<u.length;n++)u[n].call(void 0,a,l)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},t.forwardEvent=function(a,l){return a((u=>l.fire(u)))},t.runAndSubscribe=function(a,l){return l(void 0),a((u=>l(u)))}},859:(A,t)=>{function a(l){for(let u of l)u.dispose();l.length=0}Object.defineProperty(t,"__esModule",{value:!0}),t.getDisposeArrayDisposable=t.disposeArray=t.toDisposable=t.MutableDisposable=t.Disposable=void 0,t.Disposable=class{constructor(){this._disposables=[],this._isDisposed=!1}dispose(){this._isDisposed=!0;for(let l of this._disposables)l.dispose();this._disposables.length=0}register(l){return this._disposables.push(l),l}unregister(l){let u=this._disposables.indexOf(l);u!==-1&&this._disposables.splice(u,1)}},t.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(l){var u;this._isDisposed||l===this._value||((u=this._value)==null||u.dispose(),this._value=l)}clear(){this.value=void 0}dispose(){var l;this._isDisposed=!0,(l=this._value)==null||l.dispose(),this._value=void 0}},t.toDisposable=function(l){return{dispose:l}},t.disposeArray=a,t.getDisposeArrayDisposable=function(l){return{dispose:()=>a(l)}}},485:(A,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.FourKeyMap=t.TwoKeyMap=void 0;class a{constructor(){this._data={}}set(u,n,f){this._data[u]||(this._data[u]={}),this._data[u][n]=f}get(u,n){return this._data[u]?this._data[u][n]:void 0}clear(){this._data={}}}t.TwoKeyMap=a,t.FourKeyMap=class{constructor(){this._data=new a}set(l,u,n,f,p){this._data.get(l,u)||this._data.set(l,u,new a),this._data.get(l,u).set(n,f,p)}get(l,u,n,f){var p;return(p=this._data.get(l,u))==null?void 0:p.get(n,f)}clear(){this._data.clear()}}},399:(A,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.isChromeOS=t.isLinux=t.isWindows=t.isIphone=t.isIpad=t.isMac=t.getSafariVersion=t.isSafari=t.isLegacyEdge=t.isFirefox=t.isNode=void 0,t.isNode=typeof process<"u"&&"title"in process;let a=t.isNode?"node":navigator.userAgent,l=t.isNode?"node":navigator.platform;t.isFirefox=a.includes("Firefox"),t.isLegacyEdge=a.includes("Edge"),t.isSafari=/^((?!chrome|android).)*safari/i.test(a),t.getSafariVersion=function(){if(!t.isSafari)return 0;let u=a.match(/Version\/(\d+)/);return u===null||u.length<2?0:parseInt(u[1])},t.isMac=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(l),t.isIpad=l==="iPad",t.isIphone=l==="iPhone",t.isWindows=["Windows","Win16","Win32","WinCE"].includes(l),t.isLinux=l.indexOf("Linux")>=0,t.isChromeOS=/\bCrOS\b/.test(a)},385:(A,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.DebouncedIdleTask=t.IdleTaskQueue=t.PriorityTaskQueue=void 0;let l=a(399);class u{constructor(){this._tasks=[],this._i=0}enqueue(p){this._tasks.push(p),this._start()}flush(){for(;this._i<this._tasks.length;)this._tasks[this._i]()||this._i++;this.clear()}clear(){this._idleCallback&&(this._idleCallback=(this._cancelCallback(this._idleCallback),void 0)),this._i=0,this._tasks.length=0}_start(){this._idleCallback||(this._idleCallback=this._requestCallback(this._process.bind(this)))}_process(p){this._idleCallback=void 0;let S=0,r=0,e=p.timeRemaining(),o=0;for(;this._i<this._tasks.length;){if(S=Date.now(),this._tasks[this._i]()||this._i++,S=Math.max(1,Date.now()-S),r=Math.max(S,r),o=p.timeRemaining(),1.5*r>o)return e-S<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(e-S))}ms`),void this._start();e=o}this.clear()}}class n extends u{_requestCallback(p){return setTimeout((()=>p(this._createDeadline(16))))}_cancelCallback(p){clearTimeout(p)}_createDeadline(p){let S=Date.now()+p;return{timeRemaining:()=>Math.max(0,S-Date.now())}}}t.PriorityTaskQueue=n,t.IdleTaskQueue=!l.isNode&&"requestIdleCallback"in window?class extends u{_requestCallback(f){return requestIdleCallback(f)}_cancelCallback(f){cancelIdleCallback(f)}}:n,t.DebouncedIdleTask=class{constructor(){this._queue=new t.IdleTaskQueue}set(f){this._queue.clear(),this._queue.enqueue(f)}flush(){this._queue.flush()}}},147:(A,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ExtendedAttrs=t.AttributeData=void 0;class a{constructor(){this.fg=0,this.bg=0,this.extended=new l}static toColorRGB(n){return[n>>>16&255,n>>>8&255,255&n]}static fromColorRGB(n){return(255&n[0])<<16|(255&n[1])<<8|255&n[2]}clone(){let n=new a;return n.fg=this.fg,n.bg=this.bg,n.extended=this.extended.clone(),n}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}}t.AttributeData=a;class l{get ext(){return this._urlId?-469762049&this._ext|this.underlineStyle<<26:this._ext}set ext(n){this._ext=n}get underlineStyle(){return this._urlId?5:(469762048&this._ext)>>26}set underlineStyle(n){this._ext&=-469762049,this._ext|=n<<26&469762048}get underlineColor(){return 67108863&this._ext}set underlineColor(n){this._ext&=-67108864,this._ext|=67108863&n}get urlId(){return this._urlId}set urlId(n){this._urlId=n}get underlineVariantOffset(){let n=(3758096384&this._ext)>>29;return n<0?4294967288^n:n}set underlineVariantOffset(n){this._ext&=536870911,this._ext|=n<<29&3758096384}constructor(n=0,f=0){this._ext=0,this._urlId=0,this._ext=n,this._urlId=f}clone(){return new l(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}}t.ExtendedAttrs=l},782:(A,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CellData=void 0;let l=a(133),u=a(855),n=a(147);class f extends n.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new n.ExtendedAttrs,this.combinedData=""}static fromCharData(S){let r=new f;return r.setFromCharData(S),r}isCombined(){return 2097152&this.content}getWidth(){return this.content>>22}getChars(){return 2097152&this.content?this.combinedData:2097151&this.content?(0,l.stringFromCodePoint)(2097151&this.content):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content}setFromCharData(S){this.fg=S[u.CHAR_DATA_ATTR_INDEX],this.bg=0;let r=!1;if(S[u.CHAR_DATA_CHAR_INDEX].length>2)r=!0;else if(S[u.CHAR_DATA_CHAR_INDEX].length===2){let e=S[u.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=e&&e<=56319){let o=S[u.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=o&&o<=57343?this.content=1024*(e-55296)+o-56320+65536|S[u.CHAR_DATA_WIDTH_INDEX]<<22:r=!0}else r=!0}else this.content=S[u.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|S[u.CHAR_DATA_WIDTH_INDEX]<<22;r&&(this.combinedData=S[u.CHAR_DATA_CHAR_INDEX],this.content=2097152|S[u.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}t.CellData=f},855:(A,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.WHITESPACE_CELL_CODE=t.WHITESPACE_CELL_WIDTH=t.WHITESPACE_CELL_CHAR=t.NULL_CELL_CODE=t.NULL_CELL_WIDTH=t.NULL_CELL_CHAR=t.CHAR_DATA_CODE_INDEX=t.CHAR_DATA_WIDTH_INDEX=t.CHAR_DATA_CHAR_INDEX=t.CHAR_DATA_ATTR_INDEX=t.DEFAULT_EXT=t.DEFAULT_ATTR=t.DEFAULT_COLOR=void 0,t.DEFAULT_COLOR=0,t.DEFAULT_ATTR=256|t.DEFAULT_COLOR<<9,t.DEFAULT_EXT=0,t.CHAR_DATA_ATTR_INDEX=0,t.CHAR_DATA_CHAR_INDEX=1,t.CHAR_DATA_WIDTH_INDEX=2,t.CHAR_DATA_CODE_INDEX=3,t.NULL_CELL_CHAR="",t.NULL_CELL_WIDTH=1,t.NULL_CELL_CODE=0,t.WHITESPACE_CELL_CHAR=" ",t.WHITESPACE_CELL_WIDTH=1,t.WHITESPACE_CELL_CODE=32},133:(A,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Utf8ToUtf32=t.StringToUtf32=t.utf32ToString=t.stringFromCodePoint=void 0,t.stringFromCodePoint=function(a){return a>65535?(a-=65536,String.fromCharCode(55296+(a>>10))+String.fromCharCode(a%1024+56320)):String.fromCharCode(a)},t.utf32ToString=function(a,l=0,u=a.length){let n="";for(let f=l;f<u;++f){let p=a[f];p>65535?(p-=65536,n+=String.fromCharCode(55296+(p>>10))+String.fromCharCode(p%1024+56320)):n+=String.fromCharCode(p)}return n},t.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(a,l){let u=a.length;if(!u)return 0;let n=0,f=0;if(this._interim){let p=a.charCodeAt(f++);56320<=p&&p<=57343?l[n++]=1024*(this._interim-55296)+p-56320+65536:(l[n++]=this._interim,l[n++]=p),this._interim=0}for(let p=f;p<u;++p){let S=a.charCodeAt(p);if(55296<=S&&S<=56319){if(++p>=u)return this._interim=S,n;let r=a.charCodeAt(p);56320<=r&&r<=57343?l[n++]=1024*(S-55296)+r-56320+65536:(l[n++]=S,l[n++]=r)}else S!==65279&&(l[n++]=S)}return n}},t.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(a,l){let u=a.length;if(!u)return 0;let n,f,p,S,r=0,e=0,o=0;if(this.interim[0]){let h=!1,m=this.interim[0];m&=(224&m)==192?31:(240&m)==224?15:7;let d,c=0;for(;(d=63&this.interim[++c])&&c<4;)m<<=6,m|=d;let v=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,C=v-c;for(;o<C;){if(o>=u)return 0;if(d=a[o++],(192&d)!=128){o--,h=!0;break}this.interim[c++]=d,m<<=6,m|=63&d}h||(v===2?m<128?o--:l[r++]=m:v===3?m<2048||m>=55296&&m<=57343||m===65279||(l[r++]=m):m<65536||m>1114111||(l[r++]=m)),this.interim.fill(0)}let s=u-4,i=o;for(;i<u;){for(;!(!(i<s)||128&(n=a[i])||128&(f=a[i+1])||128&(p=a[i+2])||128&(S=a[i+3]));)l[r++]=n,l[r++]=f,l[r++]=p,l[r++]=S,i+=4;if(n=a[i++],n<128)l[r++]=n;else if((224&n)==192){if(i>=u)return this.interim[0]=n,r;if(f=a[i++],(192&f)!=128){i--;continue}if(e=(31&n)<<6|63&f,e<128){i--;continue}l[r++]=e}else if((240&n)==224){if(i>=u)return this.interim[0]=n,r;if(f=a[i++],(192&f)!=128){i--;continue}if(i>=u)return this.interim[0]=n,this.interim[1]=f,r;if(p=a[i++],(192&p)!=128){i--;continue}if(e=(15&n)<<12|(63&f)<<6|63&p,e<2048||e>=55296&&e<=57343||e===65279)continue;l[r++]=e}else if((248&n)==240){if(i>=u)return this.interim[0]=n,r;if(f=a[i++],(192&f)!=128){i--;continue}if(i>=u)return this.interim[0]=n,this.interim[1]=f,r;if(p=a[i++],(192&p)!=128){i--;continue}if(i>=u)return this.interim[0]=n,this.interim[1]=f,this.interim[2]=p,r;if(S=a[i++],(192&S)!=128){i--;continue}if(e=(7&n)<<18|(63&f)<<12|(63&p)<<6|63&S,e<65536||e>1114111)continue;l[r++]=e}}return r}}},776:function(A,t,a){var l=this&&this.__decorate||function(e,o,s,i){var h,m=arguments.length,d=m<3?o:i===null?i=Object.getOwnPropertyDescriptor(o,s):i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")d=Reflect.decorate(e,o,s,i);else for(var c=e.length-1;c>=0;c--)(h=e[c])&&(d=(m<3?h(d):m>3?h(o,s,d):h(o,s))||d);return m>3&&d&&Object.defineProperty(o,s,d),d},u=this&&this.__param||function(e,o){return function(s,i){o(s,i,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.traceCall=t.setTraceLogger=t.LogService=void 0;let n=a(859),f=a(97),p={trace:f.LogLevelEnum.TRACE,debug:f.LogLevelEnum.DEBUG,info:f.LogLevelEnum.INFO,warn:f.LogLevelEnum.WARN,error:f.LogLevelEnum.ERROR,off:f.LogLevelEnum.OFF},S,r=t.LogService=class extends n.Disposable{get logLevel(){return this._logLevel}constructor(e){super(),this._optionsService=e,this._logLevel=f.LogLevelEnum.OFF,this._updateLogLevel(),this.register(this._optionsService.onSpecificOptionChange("logLevel",(()=>this._updateLogLevel()))),S=this}_updateLogLevel(){this._logLevel=p[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(e){for(let o=0;o<e.length;o++)typeof e[o]=="function"&&(e[o]=e[o]())}_log(e,o,s){this._evalLazyOptionalParams(s),e.call(console,(this._optionsService.options.logger?"":"xterm.js: ")+o,...s)}trace(e,...o){var s;this._logLevel<=f.LogLevelEnum.TRACE&&this._log(((s=this._optionsService.options.logger)==null?void 0:s.trace.bind(this._optionsService.options.logger))??console.log,e,o)}debug(e,...o){var s;this._logLevel<=f.LogLevelEnum.DEBUG&&this._log(((s=this._optionsService.options.logger)==null?void 0:s.debug.bind(this._optionsService.options.logger))??console.log,e,o)}info(e,...o){var s;this._logLevel<=f.LogLevelEnum.INFO&&this._log(((s=this._optionsService.options.logger)==null?void 0:s.info.bind(this._optionsService.options.logger))??console.info,e,o)}warn(e,...o){var s;this._logLevel<=f.LogLevelEnum.WARN&&this._log(((s=this._optionsService.options.logger)==null?void 0:s.warn.bind(this._optionsService.options.logger))??console.warn,e,o)}error(e,...o){var s;this._logLevel<=f.LogLevelEnum.ERROR&&this._log(((s=this._optionsService.options.logger)==null?void 0:s.error.bind(this._optionsService.options.logger))??console.error,e,o)}};t.LogService=r=l([u(0,f.IOptionsService)],r),t.setTraceLogger=function(e){S=e},t.traceCall=function(e,o,s){if(typeof s.value!="function")throw Error("not supported");let i=s.value;s.value=function(...h){if(S.logLevel!==f.LogLevelEnum.TRACE)return i.apply(this,h);S.trace(`GlyphRenderer#${i.name}(${h.map((d=>JSON.stringify(d))).join(", ")})`);let m=i.apply(this,h);return S.trace(`GlyphRenderer#${i.name} return`,m),m}}},726:(A,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.createDecorator=t.getServiceDependencies=t.serviceRegistry=void 0;let a="di$target",l="di$dependencies";t.serviceRegistry=new Map,t.getServiceDependencies=function(u){return u[l]||[]},t.createDecorator=function(u){if(t.serviceRegistry.has(u))return t.serviceRegistry.get(u);let n=function(f,p,S){if(arguments.length!==3)throw Error("@IServiceName-decorator can only be used to decorate a parameter");(function(r,e,o){e[a]===e?e[l].push({id:r,index:o}):(e[l]=[{id:r,index:o}],e[a]=e)})(n,f,S)};return n.toString=()=>u,t.serviceRegistry.set(u,n),n}},97:(A,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.IDecorationService=t.IUnicodeService=t.IOscLinkService=t.IOptionsService=t.ILogService=t.LogLevelEnum=t.IInstantiationService=t.ICharsetService=t.ICoreService=t.ICoreMouseService=t.IBufferService=void 0;let l=a(726);var u;t.IBufferService=(0,l.createDecorator)("BufferService"),t.ICoreMouseService=(0,l.createDecorator)("CoreMouseService"),t.ICoreService=(0,l.createDecorator)("CoreService"),t.ICharsetService=(0,l.createDecorator)("CharsetService"),t.IInstantiationService=(0,l.createDecorator)("InstantiationService"),(function(n){n[n.TRACE=0]="TRACE",n[n.DEBUG=1]="DEBUG",n[n.INFO=2]="INFO",n[n.WARN=3]="WARN",n[n.ERROR=4]="ERROR",n[n.OFF=5]="OFF"})(u||(t.LogLevelEnum=u={})),t.ILogService=(0,l.createDecorator)("LogService"),t.IOptionsService=(0,l.createDecorator)("OptionsService"),t.IOscLinkService=(0,l.createDecorator)("OscLinkService"),t.IUnicodeService=(0,l.createDecorator)("UnicodeService"),t.IDecorationService=(0,l.createDecorator)("DecorationService")}},E={};function T(A){var t=E[A];if(t!==void 0)return t.exports;var a=E[A]={exports:{}};return b[A].call(a.exports,a,a.exports,T),a.exports}var N={};return(()=>{var A=N;Object.defineProperty(A,"__esModule",{value:!0}),A.CanvasAddon=void 0;let t=T(345),a=T(859),l=T(776),u=T(949);class n extends a.Disposable{constructor(){super(...arguments),this._onChangeTextureAtlas=this.register(new t.EventEmitter),this.onChangeTextureAtlas=this._onChangeTextureAtlas.event,this._onAddTextureAtlasCanvas=this.register(new t.EventEmitter),this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event}get textureAtlas(){var p;return(p=this._renderer)==null?void 0:p.textureAtlas}activate(p){let S=p._core;if(!p.element)return void this.register(S.onWillOpen((()=>this.activate(p))));this._terminal=p;let r=S.coreService,e=S.optionsService,o=S.screenElement,s=S.linkifier,i=S,h=i._bufferService,m=i._renderService,d=i._characterJoinerService,c=i._charSizeService,v=i._coreBrowserService,C=i._decorationService,k=i._logService,D=i._themeService;(0,l.setTraceLogger)(k),this._renderer=new u.CanvasRenderer(p,o,s,h,c,e,d,r,v,C,D),this.register((0,t.forwardEvent)(this._renderer.onChangeTextureAtlas,this._onChangeTextureAtlas)),this.register((0,t.forwardEvent)(this._renderer.onAddTextureAtlasCanvas,this._onAddTextureAtlasCanvas)),m.setRenderer(this._renderer),m.handleResize(h.cols,h.rows),this.register((0,a.toDisposable)((()=>{var x;m.setRenderer(this._terminal._core._createRenderer()),m.handleResize(p.cols,p.rows),(x=this._renderer)==null||x.dispose(),this._renderer=void 0})))}clearTextureAtlas(){var p;(p=this._renderer)==null||p.clearTextureAtlas()}}A.CanvasAddon=n})(),N})()))}))(),Ui=2,zi=1,ji=class{activate(g){this._terminal=g}dispose(){}fit(){let g=this.proposeDimensions();if(!g||!this._terminal||isNaN(g.cols)||isNaN(g.rows))return;let _=this._terminal._core;(this._terminal.rows!==g.rows||this._terminal.cols!==g.cols)&&(_._renderService.clear(),this._terminal.resize(g.cols,g.rows))}proposeDimensions(){var n;if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;let g=this._terminal._core._renderService.dimensions;if(g.css.cell.width===0||g.css.cell.height===0)return;let _=this._terminal.options.scrollback===0?0:((n=this._terminal.options.overviewRuler)==null?void 0:n.width)||14,b=window.getComputedStyle(this._terminal.element.parentElement),E=parseInt(b.getPropertyValue("height")),T=Math.max(0,parseInt(b.getPropertyValue("width"))),N=window.getComputedStyle(this._terminal.element),A={top:parseInt(N.getPropertyValue("padding-top")),bottom:parseInt(N.getPropertyValue("padding-bottom")),right:parseInt(N.getPropertyValue("padding-right")),left:parseInt(N.getPropertyValue("padding-left"))},t=A.top+A.bottom,a=A.right+A.left,l=E-t,u=T-a-_;return{cols:Math.max(Ui,Math.floor(u/g.css.cell.width)),rows:Math.max(zi,Math.floor(l/g.css.cell.height))}}},qi=new class{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(g){setTimeout(()=>{throw g.stack?Bt.isErrorNoTelemetry(g)?new Bt(g.message+`
1
+ var oi,ai,hi;import{s as Mt,t as At}from"./chunk-LvLJmgfZ.js";import{n as $e}from"./useEvent-DlWF5OMa.js";import{t as Li}from"./react-BGmjiNul.js";import"./react-dom-C9fstfnp.js";import{t as xi}from"./compiler-runtime-DeeZ7FnK.js";import{d as Ze}from"./hotkeys-uKX61F1_.js";import{k as Ei,o as ki}from"./config-babG4OBR.js";import{t as Di}from"./jsx-runtime-DN_bIXfG.js";import{t as Tt}from"./cn-C1rgT0yh.js";import{t as Ri}from"./createLucideIcon-CW2xpJ57.js";import{t as Mi}from"./clipboard-paste-CusmeEPf.js";import{t as Ai}from"./copy-gBVL4NN-.js";import{t as Ti}from"./trash-2-C-lF7BNB.js";import"./Combination-D1TsGrBC.js";import{n as Bi}from"./useDebounce-em3gna-v.js";import{t as Oi}from"./copy-DRhpWiOq.js";import{n as Pi}from"./renderShortcut-D0Pei-OA.js";import{n as Ii,t as Hi}from"./state-CIznbe1J.js";var Fi=Ri("text-select",[["path",{d:"M14 21h1",key:"v9vybs"}],["path",{d:"M14 3h1",key:"1ec4yj"}],["path",{d:"M19 3a2 2 0 0 1 2 2",key:"18rm91"}],["path",{d:"M21 14v1",key:"169vum"}],["path",{d:"M21 19a2 2 0 0 1-2 2",key:"1j7049"}],["path",{d:"M21 9v1",key:"mxsmne"}],["path",{d:"M3 14v1",key:"vnatye"}],["path",{d:"M3 9v1",key:"1r0deq"}],["path",{d:"M5 21a2 2 0 0 1-2-2",key:"sbafld"}],["path",{d:"M5 3a2 2 0 0 0-2 2",key:"y57alp"}],["path",{d:"M7 12h10",key:"b7w52i"}],["path",{d:"M7 16h6",key:"1vyc9m"}],["path",{d:"M7 8h8",key:"1jbsf9"}],["path",{d:"M9 21h1",key:"15o7lz"}],["path",{d:"M9 3h1",key:"1yesri"}]]),Wi=xi(),$i=class{constructor(g,_){this._disposables=[],this._socket=g,this._socket.binaryType="arraybuffer",this._bidirectional=!(_&&_.bidirectional===!1)}activate(g){this._disposables.push(et(this._socket,"message",_=>{let b=_.data;g.write(typeof b=="string"?b:new Uint8Array(b))})),this._bidirectional&&(this._disposables.push(g.onData(_=>this._sendData(_))),this._disposables.push(g.onBinary(_=>this._sendBinary(_)))),this._disposables.push(et(this._socket,"close",()=>this.dispose())),this._disposables.push(et(this._socket,"error",()=>this.dispose()))}dispose(){for(let g of this._disposables)g.dispose()}_sendData(g){this._checkOpenSocket()&&this._socket.send(g)}_sendBinary(g){if(!this._checkOpenSocket())return;let _=new Uint8Array(g.length);for(let b=0;b<g.length;++b)_[b]=g.charCodeAt(b)&255;this._socket.send(_)}_checkOpenSocket(){switch(this._socket.readyState){case WebSocket.OPEN:return!0;case WebSocket.CONNECTING:throw Error("Attach addon was loaded before socket was open");case WebSocket.CLOSING:return console.warn("Attach addon socket is closing"),!1;case WebSocket.CLOSED:throw Error("Attach addon socket is closed");default:throw Error("Unexpected socket state")}}};function et(g,_,b){return g.addEventListener(_,b),{dispose:()=>{b&&g.removeEventListener(_,b)}}}var Ni=At(((g,_)=>{(function(b,E){typeof g=="object"&&typeof _=="object"?_.exports=E():typeof define=="function"&&define.amd?define([],E):typeof g=="object"?g.CanvasAddon=E():b.CanvasAddon=E()})(self,(()=>(()=>{var b={903:(A,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.BaseRenderLayer=void 0;let l=a(274),u=a(627),n=a(237),f=a(860),p=a(374),S=a(296),r=a(345),e=a(859),o=a(399),s=a(855);class i extends e.Disposable{get canvas(){return this._canvas}get cacheCanvas(){var d;return(d=this._charAtlas)==null?void 0:d.pages[0].canvas}constructor(d,c,v,C,k,D,x,y,L,M){super(),this._terminal=d,this._container=c,this._alpha=k,this._themeService=D,this._bufferService=x,this._optionsService=y,this._decorationService=L,this._coreBrowserService=M,this._deviceCharWidth=0,this._deviceCharHeight=0,this._deviceCellWidth=0,this._deviceCellHeight=0,this._deviceCharLeft=0,this._deviceCharTop=0,this._selectionModel=(0,S.createSelectionRenderModel)(),this._bitmapGenerator=[],this._charAtlasDisposable=this.register(new e.MutableDisposable),this._onAddTextureAtlasCanvas=this.register(new r.EventEmitter),this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event,this._cellColorResolver=new l.CellColorResolver(this._terminal,this._optionsService,this._selectionModel,this._decorationService,this._coreBrowserService,this._themeService),this._canvas=this._coreBrowserService.mainDocument.createElement("canvas"),this._canvas.classList.add(`xterm-${v}-layer`),this._canvas.style.zIndex=C.toString(),this._initCanvas(),this._container.appendChild(this._canvas),this._refreshCharAtlas(this._themeService.colors),this.register(this._themeService.onChangeColors((B=>{this._refreshCharAtlas(B),this.reset(),this.handleSelectionChanged(this._selectionModel.selectionStart,this._selectionModel.selectionEnd,this._selectionModel.columnSelectMode)}))),this.register((0,e.toDisposable)((()=>{this._canvas.remove()})))}_initCanvas(){this._ctx=(0,p.throwIfFalsy)(this._canvas.getContext("2d",{alpha:this._alpha})),this._alpha||this._clearAll()}handleBlur(){}handleFocus(){}handleCursorMove(){}handleGridChanged(d,c){}handleSelectionChanged(d,c,v=!1){this._selectionModel.update(this._terminal._core,d,c,v)}_setTransparency(d){if(d===this._alpha)return;let c=this._canvas;this._alpha=d,this._canvas=this._canvas.cloneNode(),this._initCanvas(),this._container.replaceChild(this._canvas,c),this._refreshCharAtlas(this._themeService.colors),this.handleGridChanged(0,this._bufferService.rows-1)}_refreshCharAtlas(d){if(!(this._deviceCharWidth<=0&&this._deviceCharHeight<=0)){this._charAtlas=(0,u.acquireTextureAtlas)(this._terminal,this._optionsService.rawOptions,d,this._deviceCellWidth,this._deviceCellHeight,this._deviceCharWidth,this._deviceCharHeight,this._coreBrowserService.dpr),this._charAtlasDisposable.value=(0,r.forwardEvent)(this._charAtlas.onAddTextureAtlasCanvas,this._onAddTextureAtlasCanvas),this._charAtlas.warmUp();for(let c=0;c<this._charAtlas.pages.length;c++)this._bitmapGenerator[c]=new h(this._charAtlas.pages[c].canvas)}}resize(d){this._deviceCellWidth=d.device.cell.width,this._deviceCellHeight=d.device.cell.height,this._deviceCharWidth=d.device.char.width,this._deviceCharHeight=d.device.char.height,this._deviceCharLeft=d.device.char.left,this._deviceCharTop=d.device.char.top,this._canvas.width=d.device.canvas.width,this._canvas.height=d.device.canvas.height,this._canvas.style.width=`${d.css.canvas.width}px`,this._canvas.style.height=`${d.css.canvas.height}px`,this._alpha||this._clearAll(),this._refreshCharAtlas(this._themeService.colors)}clearTextureAtlas(){var d;(d=this._charAtlas)==null||d.clearTexture()}_fillCells(d,c,v,C){this._ctx.fillRect(d*this._deviceCellWidth,c*this._deviceCellHeight,v*this._deviceCellWidth,C*this._deviceCellHeight)}_fillMiddleLineAtCells(d,c,v=1){let C=Math.ceil(.5*this._deviceCellHeight);this._ctx.fillRect(d*this._deviceCellWidth,(c+1)*this._deviceCellHeight-C-this._coreBrowserService.dpr,v*this._deviceCellWidth,this._coreBrowserService.dpr)}_fillBottomLineAtCells(d,c,v=1,C=0){this._ctx.fillRect(d*this._deviceCellWidth,(c+1)*this._deviceCellHeight+C-this._coreBrowserService.dpr-1,v*this._deviceCellWidth,this._coreBrowserService.dpr)}_curlyUnderlineAtCell(d,c,v=1){this._ctx.save(),this._ctx.beginPath(),this._ctx.strokeStyle=this._ctx.fillStyle;let C=this._coreBrowserService.dpr;this._ctx.lineWidth=C;for(let k=0;k<v;k++){let D=(d+k)*this._deviceCellWidth,x=(d+k+.5)*this._deviceCellWidth,y=(d+k+1)*this._deviceCellWidth,L=(c+1)*this._deviceCellHeight-C-1,M=L-C,B=L+C;this._ctx.moveTo(D,L),this._ctx.bezierCurveTo(D,M,x,M,x,L),this._ctx.bezierCurveTo(x,B,y,B,y,L)}this._ctx.stroke(),this._ctx.restore()}_dottedUnderlineAtCell(d,c,v=1){this._ctx.save(),this._ctx.beginPath(),this._ctx.strokeStyle=this._ctx.fillStyle;let C=this._coreBrowserService.dpr;this._ctx.lineWidth=C,this._ctx.setLineDash([2*C,C]);let k=d*this._deviceCellWidth,D=(c+1)*this._deviceCellHeight-C-1;this._ctx.moveTo(k,D);for(let x=0;x<v;x++){let y=(d+v+x)*this._deviceCellWidth;this._ctx.lineTo(y,D)}this._ctx.stroke(),this._ctx.closePath(),this._ctx.restore()}_dashedUnderlineAtCell(d,c,v=1){this._ctx.save(),this._ctx.beginPath(),this._ctx.strokeStyle=this._ctx.fillStyle;let C=this._coreBrowserService.dpr;this._ctx.lineWidth=C,this._ctx.setLineDash([4*C,3*C]);let k=d*this._deviceCellWidth,D=(d+v)*this._deviceCellWidth,x=(c+1)*this._deviceCellHeight-C-1;this._ctx.moveTo(k,x),this._ctx.lineTo(D,x),this._ctx.stroke(),this._ctx.closePath(),this._ctx.restore()}_fillLeftLineAtCell(d,c,v){this._ctx.fillRect(d*this._deviceCellWidth,c*this._deviceCellHeight,this._coreBrowserService.dpr*v,this._deviceCellHeight)}_strokeRectAtCell(d,c,v,C){let k=this._coreBrowserService.dpr;this._ctx.lineWidth=k,this._ctx.strokeRect(d*this._deviceCellWidth+k/2,c*this._deviceCellHeight+k/2,v*this._deviceCellWidth-k,C*this._deviceCellHeight-k)}_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(d,c,v,C){this._alpha?this._ctx.clearRect(d*this._deviceCellWidth,c*this._deviceCellHeight,v*this._deviceCellWidth,C*this._deviceCellHeight):(this._ctx.fillStyle=this._themeService.colors.background.css,this._ctx.fillRect(d*this._deviceCellWidth,c*this._deviceCellHeight,v*this._deviceCellWidth,C*this._deviceCellHeight))}_fillCharTrueColor(d,c,v){this._ctx.font=this._getFont(!1,!1),this._ctx.textBaseline=n.TEXT_BASELINE,this._clipRow(v);let C=!1;this._optionsService.rawOptions.customGlyphs!==!1&&(C=(0,f.tryDrawCustomChar)(this._ctx,d.getChars(),c*this._deviceCellWidth,v*this._deviceCellHeight,this._deviceCellWidth,this._deviceCellHeight,this._optionsService.rawOptions.fontSize,this._coreBrowserService.dpr)),C||this._ctx.fillText(d.getChars(),c*this._deviceCellWidth+this._deviceCharLeft,v*this._deviceCellHeight+this._deviceCharTop+this._deviceCharHeight)}_drawChars(d,c,v){var L,M,B,P;let C=d.getChars(),k=d.getCode(),D=d.getWidth();if(this._cellColorResolver.resolve(d,c,this._bufferService.buffer.ydisp+v,this._deviceCellWidth),!this._charAtlas)return;let x;if(x=C&&C.length>1?this._charAtlas.getRasterizedGlyphCombinedChar(C,this._cellColorResolver.result.bg,this._cellColorResolver.result.fg,this._cellColorResolver.result.ext,!0):this._charAtlas.getRasterizedGlyph(d.getCode()||s.WHITESPACE_CELL_CODE,this._cellColorResolver.result.bg,this._cellColorResolver.result.fg,this._cellColorResolver.result.ext,!0),!x.size.x||!x.size.y)return;this._ctx.save(),this._clipRow(v),this._bitmapGenerator[x.texturePage]&&this._charAtlas.pages[x.texturePage].canvas!==this._bitmapGenerator[x.texturePage].canvas&&((M=(L=this._bitmapGenerator[x.texturePage])==null?void 0:L.bitmap)==null||M.close(),delete this._bitmapGenerator[x.texturePage]),this._charAtlas.pages[x.texturePage].version!==((B=this._bitmapGenerator[x.texturePage])==null?void 0:B.version)&&(this._bitmapGenerator[x.texturePage]||(this._bitmapGenerator[x.texturePage]=new h(this._charAtlas.pages[x.texturePage].canvas)),this._bitmapGenerator[x.texturePage].refresh(),this._bitmapGenerator[x.texturePage].version=this._charAtlas.pages[x.texturePage].version);let y=x.size.x;this._optionsService.rawOptions.rescaleOverlappingGlyphs&&(0,p.allowRescaling)(k,D,x.size.x,this._deviceCellWidth)&&(y=this._deviceCellWidth-1),this._ctx.drawImage(((P=this._bitmapGenerator[x.texturePage])==null?void 0:P.bitmap)||this._charAtlas.pages[x.texturePage].canvas,x.texturePosition.x,x.texturePosition.y,x.size.x,x.size.y,c*this._deviceCellWidth+this._deviceCharLeft-x.offset.x,v*this._deviceCellHeight+this._deviceCharTop-x.offset.y,y,x.size.y),this._ctx.restore()}_clipRow(d){this._ctx.beginPath(),this._ctx.rect(0,d*this._deviceCellHeight,this._bufferService.cols*this._deviceCellWidth,this._deviceCellHeight),this._ctx.clip()}_getFont(d,c){return`${c?"italic":""} ${d?this._optionsService.rawOptions.fontWeightBold:this._optionsService.rawOptions.fontWeight} ${this._optionsService.rawOptions.fontSize*this._coreBrowserService.dpr}px ${this._optionsService.rawOptions.fontFamily}`}}t.BaseRenderLayer=i;class h{get bitmap(){return this._bitmap}constructor(d){this.canvas=d,this._state=0,this._commitTimeout=void 0,this._bitmap=void 0,this.version=-1}refresh(){var d;(d=this._bitmap)==null||d.close(),this._bitmap=void 0,o.isSafari||(this._commitTimeout===void 0&&(this._commitTimeout=window.setTimeout((()=>this._generate()),100)),this._state===1&&(this._state=2))}_generate(){var d;this._state===0&&((d=this._bitmap)==null||d.close(),this._bitmap=void 0,this._state=1,window.createImageBitmap(this.canvas).then((c=>{this._state===2?this.refresh():this._bitmap=c,this._state=0})),this._commitTimeout&&(this._commitTimeout=void 0))}}},949:(A,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CanvasRenderer=void 0;let l=a(627),u=a(56),n=a(374),f=a(345),p=a(859),S=a(873),r=a(43),e=a(630),o=a(744);class s extends p.Disposable{constructor(h,m,d,c,v,C,k,D,x,y,L){super(),this._terminal=h,this._screenElement=m,this._bufferService=c,this._charSizeService=v,this._optionsService=C,this._coreBrowserService=x,this._themeService=L,this._observerDisposable=this.register(new p.MutableDisposable),this._onRequestRedraw=this.register(new f.EventEmitter),this.onRequestRedraw=this._onRequestRedraw.event,this._onChangeTextureAtlas=this.register(new f.EventEmitter),this.onChangeTextureAtlas=this._onChangeTextureAtlas.event,this._onAddTextureAtlasCanvas=this.register(new f.EventEmitter),this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event;let M=this._optionsService.rawOptions.allowTransparency;this._renderLayers=[new o.TextRenderLayer(this._terminal,this._screenElement,0,M,this._bufferService,this._optionsService,k,y,this._coreBrowserService,L),new e.SelectionRenderLayer(this._terminal,this._screenElement,1,this._bufferService,this._coreBrowserService,y,this._optionsService,L),new r.LinkRenderLayer(this._terminal,this._screenElement,2,d,this._bufferService,this._optionsService,y,this._coreBrowserService,L),new S.CursorRenderLayer(this._terminal,this._screenElement,3,this._onRequestRedraw,this._bufferService,this._optionsService,D,this._coreBrowserService,y,L)];for(let B of this._renderLayers)(0,f.forwardEvent)(B.onAddTextureAtlasCanvas,this._onAddTextureAtlasCanvas);this.dimensions=(0,n.createRenderDimensions)(),this._devicePixelRatio=this._coreBrowserService.dpr,this._updateDimensions(),this._observerDisposable.value=(0,u.observeDevicePixelDimensions)(this._renderLayers[0].canvas,this._coreBrowserService.window,((B,P)=>this._setCanvasDevicePixelDimensions(B,P))),this.register(this._coreBrowserService.onWindowChange((B=>{this._observerDisposable.value=(0,u.observeDevicePixelDimensions)(this._renderLayers[0].canvas,B,((P,H)=>this._setCanvasDevicePixelDimensions(P,H)))}))),this.register((0,p.toDisposable)((()=>{for(let B of this._renderLayers)B.dispose();(0,l.removeTerminalFromCache)(this._terminal)})))}get textureAtlas(){return this._renderLayers[0].cacheCanvas}handleDevicePixelRatioChange(){this._devicePixelRatio!==this._coreBrowserService.dpr&&(this._devicePixelRatio=this._coreBrowserService.dpr,this.handleResize(this._bufferService.cols,this._bufferService.rows))}handleResize(h,m){this._updateDimensions();for(let d of this._renderLayers)d.resize(this.dimensions);this._screenElement.style.width=`${this.dimensions.css.canvas.width}px`,this._screenElement.style.height=`${this.dimensions.css.canvas.height}px`}handleCharSizeChanged(){this.handleResize(this._bufferService.cols,this._bufferService.rows)}handleBlur(){this._runOperation((h=>h.handleBlur()))}handleFocus(){this._runOperation((h=>h.handleFocus()))}handleSelectionChanged(h,m,d=!1){this._runOperation((c=>c.handleSelectionChanged(h,m,d))),this._themeService.colors.selectionForeground&&this._onRequestRedraw.fire({start:0,end:this._bufferService.rows-1})}handleCursorMove(){this._runOperation((h=>h.handleCursorMove()))}clear(){this._runOperation((h=>h.reset()))}_runOperation(h){for(let m of this._renderLayers)h(m)}renderRows(h,m){for(let d of this._renderLayers)d.handleGridChanged(h,m)}clearTextureAtlas(){for(let h of this._renderLayers)h.clearTextureAtlas()}_updateDimensions(){if(!this._charSizeService.hasValidSize)return;let h=this._coreBrowserService.dpr;this.dimensions.device.char.width=Math.floor(this._charSizeService.width*h),this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*h),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._bufferService.rows*this.dimensions.device.cell.height,this.dimensions.device.canvas.width=this._bufferService.cols*this.dimensions.device.cell.width,this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/h),this.dimensions.css.canvas.width=Math.round(this.dimensions.device.canvas.width/h),this.dimensions.css.cell.height=this.dimensions.css.canvas.height/this._bufferService.rows,this.dimensions.css.cell.width=this.dimensions.css.canvas.width/this._bufferService.cols}_setCanvasDevicePixelDimensions(h,m){this.dimensions.device.canvas.height=m,this.dimensions.device.canvas.width=h;for(let d of this._renderLayers)d.resize(this.dimensions);this._requestRedrawViewport()}_requestRedrawViewport(){this._onRequestRedraw.fire({start:0,end:this._bufferService.rows-1})}}t.CanvasRenderer=s},873:(A,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CursorRenderLayer=void 0;let l=a(457),u=a(859),n=a(399),f=a(782),p=a(903);class S extends p.BaseRenderLayer{constructor(e,o,s,i,h,m,d,c,v,C){super(e,o,"cursor",s,!0,C,h,m,v,c),this._onRequestRedraw=i,this._coreService=d,this._cursorBlinkStateManager=this.register(new u.MutableDisposable),this._cell=new f.CellData,this._state={x:0,y:0,isFocused:!1,style:"",width:0},this._cursorRenderers={bar:this._renderBarCursor.bind(this),block:this._renderBlockCursor.bind(this),underline:this._renderUnderlineCursor.bind(this),outline:this._renderOutlineCursor.bind(this)},this.register(m.onOptionChange((()=>this._handleOptionsChanged()))),this._handleOptionsChanged()}resize(e){super.resize(e),this._state={x:0,y:0,isFocused:!1,style:"",width:0}}reset(){var e;this._clearCursor(),(e=this._cursorBlinkStateManager.value)==null||e.restartBlinkAnimation(),this._handleOptionsChanged()}handleBlur(){var e;(e=this._cursorBlinkStateManager.value)==null||e.pause(),this._onRequestRedraw.fire({start:this._bufferService.buffer.y,end:this._bufferService.buffer.y})}handleFocus(){var e;(e=this._cursorBlinkStateManager.value)==null||e.resume(),this._onRequestRedraw.fire({start:this._bufferService.buffer.y,end:this._bufferService.buffer.y})}_handleOptionsChanged(){this._optionsService.rawOptions.cursorBlink?this._cursorBlinkStateManager.value||(this._cursorBlinkStateManager.value=new l.CursorBlinkStateManager((()=>this._render(!0)),this._coreBrowserService)):this._cursorBlinkStateManager.clear(),this._onRequestRedraw.fire({start:this._bufferService.buffer.y,end:this._bufferService.buffer.y})}handleCursorMove(){var e;(e=this._cursorBlinkStateManager.value)==null||e.restartBlinkAnimation()}handleGridChanged(e,o){!this._cursorBlinkStateManager.value||this._cursorBlinkStateManager.value.isPaused?this._render(!1):this._cursorBlinkStateManager.value.restartBlinkAnimation()}_render(e){if(!this._coreService.isCursorInitialized||this._coreService.isCursorHidden)return void this._clearCursor();let o=this._bufferService.buffer.ybase+this._bufferService.buffer.y,s=o-this._bufferService.buffer.ydisp;if(s<0||s>=this._bufferService.rows)return void this._clearCursor();let i=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1);if(this._bufferService.buffer.lines.get(o).loadCell(i,this._cell),this._cell.content!==void 0){if(!this._coreBrowserService.isFocused){this._clearCursor(),this._ctx.save(),this._ctx.fillStyle=this._themeService.colors.cursor.css;let h=this._optionsService.rawOptions.cursorStyle,m=this._optionsService.rawOptions.cursorInactiveStyle;m&&m!=="none"&&this._cursorRenderers[m](i,s,this._cell),this._ctx.restore(),this._state.x=i,this._state.y=s,this._state.isFocused=!1,this._state.style=h,this._state.width=this._cell.getWidth();return}if(!this._cursorBlinkStateManager.value||this._cursorBlinkStateManager.value.isCursorVisible){if(this._state){if(this._state.x===i&&this._state.y===s&&this._state.isFocused===this._coreBrowserService.isFocused&&this._state.style===this._optionsService.rawOptions.cursorStyle&&this._state.width===this._cell.getWidth())return;this._clearCursor()}this._ctx.save(),this._cursorRenderers[this._optionsService.rawOptions.cursorStyle||"block"](i,s,this._cell),this._ctx.restore(),this._state.x=i,this._state.y=s,this._state.isFocused=!1,this._state.style=this._optionsService.rawOptions.cursorStyle,this._state.width=this._cell.getWidth()}else this._clearCursor()}}_clearCursor(){this._state&&(this._state=(n.isFirefox||this._coreBrowserService.dpr<1?this._clearAll():this._clearCells(this._state.x,this._state.y,this._state.width,1),{x:0,y:0,isFocused:!1,style:"",width:0}))}_renderBarCursor(e,o,s){this._ctx.save(),this._ctx.fillStyle=this._themeService.colors.cursor.css,this._fillLeftLineAtCell(e,o,this._optionsService.rawOptions.cursorWidth),this._ctx.restore()}_renderBlockCursor(e,o,s){this._ctx.save(),this._ctx.fillStyle=this._themeService.colors.cursor.css,this._fillCells(e,o,s.getWidth(),1),this._ctx.fillStyle=this._themeService.colors.cursorAccent.css,this._fillCharTrueColor(s,e,o),this._ctx.restore()}_renderUnderlineCursor(e,o,s){this._ctx.save(),this._ctx.fillStyle=this._themeService.colors.cursor.css,this._fillBottomLineAtCells(e,o),this._ctx.restore()}_renderOutlineCursor(e,o,s){this._ctx.save(),this._ctx.strokeStyle=this._themeService.colors.cursor.css,this._strokeRectAtCell(e,o,s.getWidth(),1),this._ctx.restore()}}t.CursorRenderLayer=S},574:(A,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.GridCache=void 0,t.GridCache=class{constructor(){this.cache=[]}resize(a,l){for(let u=0;u<a;u++){this.cache.length<=u&&this.cache.push([]);for(let n=this.cache[u].length;n<l;n++)this.cache[u].push(void 0);this.cache[u].length=l}this.cache.length=a}clear(){for(let a=0;a<this.cache.length;a++)for(let l=0;l<this.cache[a].length;l++)this.cache[a][l]=void 0}}},43:(A,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.LinkRenderLayer=void 0;let l=a(197),u=a(237),n=a(903);class f extends n.BaseRenderLayer{constructor(S,r,e,o,s,i,h,m,d){super(S,r,"link",e,!0,d,s,i,h,m),this.register(o.onShowLinkUnderline((c=>this._handleShowLinkUnderline(c)))),this.register(o.onHideLinkUnderline((c=>this._handleHideLinkUnderline(c))))}resize(S){super.resize(S),this._state=void 0}reset(){this._clearCurrentLink()}_clearCurrentLink(){if(this._state){this._clearCells(this._state.x1,this._state.y1,this._state.cols-this._state.x1,1);let S=this._state.y2-this._state.y1-1;S>0&&this._clearCells(0,this._state.y1+1,this._state.cols,S),this._clearCells(0,this._state.y2,this._state.x2,1),this._state=void 0}}_handleShowLinkUnderline(S){if(S.fg===u.INVERTED_DEFAULT_COLOR?this._ctx.fillStyle=this._themeService.colors.background.css:S.fg&&(0,l.is256Color)(S.fg)?this._ctx.fillStyle=this._themeService.colors.ansi[S.fg].css:this._ctx.fillStyle=this._themeService.colors.foreground.css,S.y1===S.y2)this._fillBottomLineAtCells(S.x1,S.y1,S.x2-S.x1);else{this._fillBottomLineAtCells(S.x1,S.y1,S.cols-S.x1);for(let r=S.y1+1;r<S.y2;r++)this._fillBottomLineAtCells(0,r,S.cols);this._fillBottomLineAtCells(0,S.y2,S.x2)}this._state=S}_handleHideLinkUnderline(S){this._clearCurrentLink()}}t.LinkRenderLayer=f},630:(A,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.SelectionRenderLayer=void 0;let l=a(903);class u extends l.BaseRenderLayer{constructor(f,p,S,r,e,o,s,i){super(f,p,"selection",S,!0,i,r,s,o,e),this._clearState()}_clearState(){this._state={start:void 0,end:void 0,columnSelectMode:void 0,ydisp:void 0}}resize(f){super.resize(f),this._selectionModel.selectionStart&&this._selectionModel.selectionEnd&&(this._clearState(),this._redrawSelection(this._selectionModel.selectionStart,this._selectionModel.selectionEnd,this._selectionModel.columnSelectMode))}reset(){this._state.start&&this._state.end&&(this._clearState(),this._clearAll())}handleBlur(){this.reset(),this._redrawSelection(this._selectionModel.selectionStart,this._selectionModel.selectionEnd,this._selectionModel.columnSelectMode)}handleFocus(){this.reset(),this._redrawSelection(this._selectionModel.selectionStart,this._selectionModel.selectionEnd,this._selectionModel.columnSelectMode)}handleSelectionChanged(f,p,S){super.handleSelectionChanged(f,p,S),this._redrawSelection(f,p,S)}_redrawSelection(f,p,S){if(!this._didStateChange(f,p,S,this._bufferService.buffer.ydisp))return;if(this._clearAll(),!f||!p)return void this._clearState();let r=f[1]-this._bufferService.buffer.ydisp,e=p[1]-this._bufferService.buffer.ydisp,o=Math.max(r,0),s=Math.min(e,this._bufferService.rows-1);if(o>=this._bufferService.rows||s<0)this._state.ydisp=this._bufferService.buffer.ydisp;else{if(this._ctx.fillStyle=(this._coreBrowserService.isFocused?this._themeService.colors.selectionBackgroundTransparent:this._themeService.colors.selectionInactiveBackgroundTransparent).css,S){let i=f[0],h=p[0]-i,m=s-o+1;this._fillCells(i,o,h,m)}else{let i=r===o?f[0]:0,h=o===e?p[0]:this._bufferService.cols;this._fillCells(i,o,h-i,1);let m=Math.max(s-o-1,0);if(this._fillCells(0,o+1,this._bufferService.cols,m),o!==s){let d=e===s?p[0]:this._bufferService.cols;this._fillCells(0,s,d,1)}}this._state.start=[f[0],f[1]],this._state.end=[p[0],p[1]],this._state.columnSelectMode=S,this._state.ydisp=this._bufferService.buffer.ydisp}}_didStateChange(f,p,S,r){return!this._areCoordinatesEqual(f,this._state.start)||!this._areCoordinatesEqual(p,this._state.end)||S!==this._state.columnSelectMode||r!==this._state.ydisp}_areCoordinatesEqual(f,p){return!(!f||!p)&&f[0]===p[0]&&f[1]===p[1]}}t.SelectionRenderLayer=u},744:(A,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.TextRenderLayer=void 0;let l=a(577),u=a(147),n=a(782),f=a(855),p=a(903),S=a(574);class r extends p.BaseRenderLayer{constructor(o,s,i,h,m,d,c,v,C,k){super(o,s,"text",i,h,k,m,d,v,C),this._characterJoinerService=c,this._characterWidth=0,this._characterFont="",this._characterOverlapCache={},this._workCell=new n.CellData,this._state=new S.GridCache,this.register(d.onSpecificOptionChange("allowTransparency",(D=>this._setTransparency(D))))}resize(o){super.resize(o);let s=this._getFont(!1,!1);this._characterWidth===o.device.char.width&&this._characterFont===s||(this._characterWidth=o.device.char.width,this._characterFont=s,this._characterOverlapCache={}),this._state.clear(),this._state.resize(this._bufferService.cols,this._bufferService.rows)}reset(){this._state.clear(),this._clearAll()}_forEachCell(o,s,i){for(let h=o;h<=s;h++){let m=h+this._bufferService.buffer.ydisp,d=this._bufferService.buffer.lines.get(m),c=this._characterJoinerService.getJoinedCharacters(m);for(let v=0;v<this._bufferService.cols;v++){d.loadCell(v,this._workCell);let C=this._workCell,k=!1,D=v;if(C.getWidth()!==0){if(c.length>0&&v===c[0][0]){k=!0;let x=c.shift();C=new l.JoinedCellData(this._workCell,d.translateToString(!0,x[0],x[1]),x[1]-x[0]),D=x[1]-1}!k&&this._isOverlapping(C)&&D<d.length-1&&d.getCodePoint(D+1)===f.NULL_CELL_CODE&&(C.content&=-12582913,C.content|=8388608),i(C,v,h),v=D}}}}_drawBackground(o,s){let i=this._ctx,h=this._bufferService.cols,m=0,d=0,c=null;i.save(),this._forEachCell(o,s,((v,C,k)=>{let D=null;v.isInverse()?D=v.isFgDefault()?this._themeService.colors.foreground.css:v.isFgRGB()?`rgb(${u.AttributeData.toColorRGB(v.getFgColor()).join(",")})`:this._themeService.colors.ansi[v.getFgColor()].css:v.isBgRGB()?D=`rgb(${u.AttributeData.toColorRGB(v.getBgColor()).join(",")})`:v.isBgPalette()&&(D=this._themeService.colors.ansi[v.getBgColor()].css);let x=!1;this._decorationService.forEachDecorationAtCell(C,this._bufferService.buffer.ydisp+k,void 0,(y=>{y.options.layer!=="top"&&x||(y.backgroundColorRGB&&(D=y.backgroundColorRGB.css),x=y.options.layer==="top")})),c===null&&(m=C,d=k),k===d?c!==D&&(i.fillStyle=c||"",this._fillCells(m,d,C-m,1),m=C,d=k):(i.fillStyle=c||"",this._fillCells(m,d,h-m,1),m=C,d=k),c=D})),c!==null&&(i.fillStyle=c,this._fillCells(m,d,h-m,1)),i.restore()}_drawForeground(o,s){this._forEachCell(o,s,((i,h,m)=>this._drawChars(i,h,m)))}handleGridChanged(o,s){this._state.cache.length!==0&&(this._charAtlas&&this._charAtlas.beginFrame(),this._clearCells(0,o,this._bufferService.cols,s-o+1),this._drawBackground(o,s),this._drawForeground(o,s))}_isOverlapping(o){if(o.getWidth()!==1||o.getCode()<256)return!1;let s=o.getChars();if(this._characterOverlapCache.hasOwnProperty(s))return this._characterOverlapCache[s];this._ctx.save(),this._ctx.font=this._characterFont;let i=Math.floor(this._ctx.measureText(s).width)>this._characterWidth;return this._ctx.restore(),this._characterOverlapCache[s]=i,i}}t.TextRenderLayer=r},274:(A,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CellColorResolver=void 0;let l=a(855),u=a(160),n=a(374),f,p=0,S=0,r=!1,e=!1,o=!1,s=0;t.CellColorResolver=class{constructor(i,h,m,d,c,v){this._terminal=i,this._optionService=h,this._selectionRenderModel=m,this._decorationService=d,this._coreBrowserService=c,this._themeService=v,this.result={fg:0,bg:0,ext:0}}resolve(i,h,m,d){if(this.result.bg=i.bg,this.result.fg=i.fg,this.result.ext=268435456&i.bg?i.extended.ext:0,S=0,p=0,e=!1,r=!1,o=!1,f=this._themeService.colors,s=0,i.getCode()!==l.NULL_CELL_CODE&&i.extended.underlineStyle===4){let c=Math.max(1,Math.floor(this._optionService.rawOptions.fontSize*this._coreBrowserService.dpr/15));s=h*d%(2*Math.round(c))}if(this._decorationService.forEachDecorationAtCell(h,m,"bottom",(c=>{c.backgroundColorRGB&&(S=c.backgroundColorRGB.rgba>>8&16777215,e=!0),c.foregroundColorRGB&&(p=c.foregroundColorRGB.rgba>>8&16777215,r=!0)})),o=this._selectionRenderModel.isCellSelected(this._terminal,h,m),o){if(67108864&this.result.fg||50331648&this.result.bg){if(67108864&this.result.fg)switch(50331648&this.result.fg){case 16777216:case 33554432:S=this._themeService.colors.ansi[255&this.result.fg].rgba;break;case 50331648:S=(16777215&this.result.fg)<<8|255;break;default:S=this._themeService.colors.foreground.rgba}else switch(50331648&this.result.bg){case 16777216:case 33554432:S=this._themeService.colors.ansi[255&this.result.bg].rgba;break;case 50331648:S=(16777215&this.result.bg)<<8|255}S=u.rgba.blend(S,4294967040&(this._coreBrowserService.isFocused?f.selectionBackgroundOpaque:f.selectionInactiveBackgroundOpaque).rgba|128)>>8&16777215}else S=(this._coreBrowserService.isFocused?f.selectionBackgroundOpaque:f.selectionInactiveBackgroundOpaque).rgba>>8&16777215;if(e=!0,f.selectionForeground&&(p=f.selectionForeground.rgba>>8&16777215,r=!0),(0,n.treatGlyphAsBackgroundColor)(i.getCode())){if(67108864&this.result.fg&&!(50331648&this.result.bg))p=(this._coreBrowserService.isFocused?f.selectionBackgroundOpaque:f.selectionInactiveBackgroundOpaque).rgba>>8&16777215;else{if(67108864&this.result.fg)switch(50331648&this.result.bg){case 16777216:case 33554432:p=this._themeService.colors.ansi[255&this.result.bg].rgba;break;case 50331648:p=(16777215&this.result.bg)<<8|255}else switch(50331648&this.result.fg){case 16777216:case 33554432:p=this._themeService.colors.ansi[255&this.result.fg].rgba;break;case 50331648:p=(16777215&this.result.fg)<<8|255;break;default:p=this._themeService.colors.foreground.rgba}p=u.rgba.blend(p,4294967040&(this._coreBrowserService.isFocused?f.selectionBackgroundOpaque:f.selectionInactiveBackgroundOpaque).rgba|128)>>8&16777215}r=!0}}this._decorationService.forEachDecorationAtCell(h,m,"top",(c=>{c.backgroundColorRGB&&(S=c.backgroundColorRGB.rgba>>8&16777215,e=!0),c.foregroundColorRGB&&(p=c.foregroundColorRGB.rgba>>8&16777215,r=!0)})),e&&(S=o?i.bg&-150994944|S|50331648:-16777216&i.bg|S|50331648),r&&(p=i.fg&-83886080|p|50331648),67108864&this.result.fg&&(e&&!r&&(p=50331648&this.result.bg?-134217728&this.result.fg|67108863&this.result.bg:-134217728&this.result.fg|16777215&f.background.rgba>>8|50331648,r=!0),!e&&r&&(S=50331648&this.result.fg?-67108864&this.result.bg|67108863&this.result.fg:-67108864&this.result.bg|16777215&f.foreground.rgba>>8|50331648,e=!0)),f=void 0,this.result.bg=e?S:this.result.bg,this.result.fg=r?p:this.result.fg,this.result.ext&=536870911,this.result.ext|=s<<29&3758096384}}},627:(A,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.removeTerminalFromCache=t.acquireTextureAtlas=void 0;let l=a(509),u=a(197),n=[];t.acquireTextureAtlas=function(f,p,S,r,e,o,s,i){let h=(0,u.generateConfig)(r,e,o,s,p,S,i);for(let c=0;c<n.length;c++){let v=n[c],C=v.ownedBy.indexOf(f);if(C>=0){if((0,u.configEquals)(v.config,h))return v.atlas;v.ownedBy.length===1?(v.atlas.dispose(),n.splice(c,1)):v.ownedBy.splice(C,1);break}}for(let c=0;c<n.length;c++){let v=n[c];if((0,u.configEquals)(v.config,h))return v.ownedBy.push(f),v.atlas}let m=f._core,d={atlas:new l.TextureAtlas(document,h,m.unicodeService),config:h,ownedBy:[f]};return n.push(d),d.atlas},t.removeTerminalFromCache=function(f){for(let p=0;p<n.length;p++){let S=n[p].ownedBy.indexOf(f);if(S!==-1){n[p].ownedBy.length===1?(n[p].atlas.dispose(),n.splice(p,1)):n[p].ownedBy.splice(S,1);break}}}},197:(A,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.is256Color=t.configEquals=t.generateConfig=void 0;let l=a(160);t.generateConfig=function(u,n,f,p,S,r,e){let o={foreground:r.foreground,background:r.background,cursor:l.NULL_COLOR,cursorAccent:l.NULL_COLOR,selectionForeground:l.NULL_COLOR,selectionBackgroundTransparent:l.NULL_COLOR,selectionBackgroundOpaque:l.NULL_COLOR,selectionInactiveBackgroundTransparent:l.NULL_COLOR,selectionInactiveBackgroundOpaque:l.NULL_COLOR,ansi:r.ansi.slice(),contrastCache:r.contrastCache,halfContrastCache:r.halfContrastCache};return{customGlyphs:S.customGlyphs,devicePixelRatio:e,letterSpacing:S.letterSpacing,lineHeight:S.lineHeight,deviceCellWidth:u,deviceCellHeight:n,deviceCharWidth:f,deviceCharHeight:p,fontFamily:S.fontFamily,fontSize:S.fontSize,fontWeight:S.fontWeight,fontWeightBold:S.fontWeightBold,allowTransparency:S.allowTransparency,drawBoldTextInBrightColors:S.drawBoldTextInBrightColors,minimumContrastRatio:S.minimumContrastRatio,colors:o}},t.configEquals=function(u,n){for(let f=0;f<u.colors.ansi.length;f++)if(u.colors.ansi[f].rgba!==n.colors.ansi[f].rgba)return!1;return u.devicePixelRatio===n.devicePixelRatio&&u.customGlyphs===n.customGlyphs&&u.lineHeight===n.lineHeight&&u.letterSpacing===n.letterSpacing&&u.fontFamily===n.fontFamily&&u.fontSize===n.fontSize&&u.fontWeight===n.fontWeight&&u.fontWeightBold===n.fontWeightBold&&u.allowTransparency===n.allowTransparency&&u.deviceCharWidth===n.deviceCharWidth&&u.deviceCharHeight===n.deviceCharHeight&&u.drawBoldTextInBrightColors===n.drawBoldTextInBrightColors&&u.minimumContrastRatio===n.minimumContrastRatio&&u.colors.foreground.rgba===n.colors.foreground.rgba&&u.colors.background.rgba===n.colors.background.rgba},t.is256Color=function(u){return(50331648&u)==16777216||(50331648&u)==33554432}},237:(A,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.TEXT_BASELINE=t.DIM_OPACITY=t.INVERTED_DEFAULT_COLOR=void 0;let l=a(399);t.INVERTED_DEFAULT_COLOR=257,t.DIM_OPACITY=.5,t.TEXT_BASELINE=l.isFirefox||l.isLegacyEdge?"bottom":"ideographic"},457:(A,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CursorBlinkStateManager=void 0,t.CursorBlinkStateManager=class{constructor(a,l){this._renderCallback=a,this._coreBrowserService=l,this.isCursorVisible=!0,this._coreBrowserService.isFocused&&this._restartInterval()}get isPaused(){return!(this._blinkStartTimeout||this._blinkInterval)}dispose(){this._blinkInterval&&(this._blinkInterval=(this._coreBrowserService.window.clearInterval(this._blinkInterval),void 0)),this._blinkStartTimeout&&(this._blinkStartTimeout=(this._coreBrowserService.window.clearTimeout(this._blinkStartTimeout),void 0)),this._animationFrame&&(this._animationFrame=(this._coreBrowserService.window.cancelAnimationFrame(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(a=600){this._blinkInterval&&(this._blinkInterval=(this._coreBrowserService.window.clearInterval(this._blinkInterval),void 0)),this._blinkStartTimeout=this._coreBrowserService.window.setTimeout((()=>{if(this._animationTimeRestarted){let l=600-(Date.now()-this._animationTimeRestarted);if(this._animationTimeRestarted=void 0,l>0)return void this._restartInterval(l)}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 l=600-(Date.now()-this._animationTimeRestarted);this._animationTimeRestarted=void 0,this._restartInterval(l);return}this.isCursorVisible=!this.isCursorVisible,this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>{this._renderCallback(),this._animationFrame=void 0}))}),600)}),a)}pause(){this.isCursorVisible=!0,this._blinkInterval&&(this._blinkInterval=(this._coreBrowserService.window.clearInterval(this._blinkInterval),void 0)),this._blinkStartTimeout&&(this._blinkStartTimeout=(this._coreBrowserService.window.clearTimeout(this._blinkStartTimeout),void 0)),this._animationFrame&&(this._animationFrame=(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),void 0))}resume(){this.pause(),this._animationTimeRestarted=void 0,this._restartInterval(),this.restartBlinkAnimation()}}},860:(A,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.tryDrawCustomChar=t.powerlineDefinitions=t.boxDrawingDefinitions=t.blockElementDefinitions=void 0;let l=a(374);t.blockElementDefinitions={"\u2580":[{x:0,y:0,w:8,h:4}],"\u2581":[{x:0,y:7,w:8,h:1}],"\u2582":[{x:0,y:6,w:8,h:2}],"\u2583":[{x:0,y:5,w:8,h:3}],"\u2584":[{x:0,y:4,w:8,h:4}],"\u2585":[{x:0,y:3,w:8,h:5}],"\u2586":[{x:0,y:2,w:8,h:6}],"\u2587":[{x:0,y:1,w:8,h:7}],"\u2588":[{x:0,y:0,w:8,h:8}],"\u2589":[{x:0,y:0,w:7,h:8}],"\u258A":[{x:0,y:0,w:6,h:8}],"\u258B":[{x:0,y:0,w:5,h:8}],"\u258C":[{x:0,y:0,w:4,h:8}],"\u258D":[{x:0,y:0,w:3,h:8}],"\u258E":[{x:0,y:0,w:2,h:8}],"\u258F":[{x:0,y:0,w:1,h:8}],"\u2590":[{x:4,y:0,w:4,h:8}],"\u2594":[{x:0,y:0,w:8,h:1}],"\u2595":[{x:7,y:0,w:1,h:8}],"\u2596":[{x:0,y:4,w:4,h:4}],"\u2597":[{x:4,y:4,w:4,h:4}],"\u2598":[{x:0,y:0,w:4,h:4}],"\u2599":[{x:0,y:0,w:4,h:8},{x:0,y:4,w:8,h:4}],"\u259A":[{x:0,y:0,w:4,h:4},{x:4,y:4,w:4,h:4}],"\u259B":[{x:0,y:0,w:4,h:8},{x:4,y:0,w:4,h:4}],"\u259C":[{x:0,y:0,w:8,h:4},{x:4,y:0,w:4,h:8}],"\u259D":[{x:4,y:0,w:4,h:4}],"\u259E":[{x:4,y:0,w:4,h:4},{x:0,y:4,w:4,h:4}],"\u259F":[{x:4,y:0,w:4,h:8},{x:0,y:4,w:8,h:4}],"\u{1FB70}":[{x:1,y:0,w:1,h:8}],"\u{1FB71}":[{x:2,y:0,w:1,h:8}],"\u{1FB72}":[{x:3,y:0,w:1,h:8}],"\u{1FB73}":[{x:4,y:0,w:1,h:8}],"\u{1FB74}":[{x:5,y:0,w:1,h:8}],"\u{1FB75}":[{x:6,y:0,w:1,h:8}],"\u{1FB76}":[{x:0,y:1,w:8,h:1}],"\u{1FB77}":[{x:0,y:2,w:8,h:1}],"\u{1FB78}":[{x:0,y:3,w:8,h:1}],"\u{1FB79}":[{x:0,y:4,w:8,h:1}],"\u{1FB7A}":[{x:0,y:5,w:8,h:1}],"\u{1FB7B}":[{x:0,y:6,w:8,h:1}],"\u{1FB7C}":[{x:0,y:0,w:1,h:8},{x:0,y:7,w:8,h:1}],"\u{1FB7D}":[{x:0,y:0,w:1,h:8},{x:0,y:0,w:8,h:1}],"\u{1FB7E}":[{x:7,y:0,w:1,h:8},{x:0,y:0,w:8,h:1}],"\u{1FB7F}":[{x:7,y:0,w:1,h:8},{x:0,y:7,w:8,h:1}],"\u{1FB80}":[{x:0,y:0,w:8,h:1},{x:0,y:7,w:8,h:1}],"\u{1FB81}":[{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}],"\u{1FB82}":[{x:0,y:0,w:8,h:2}],"\u{1FB83}":[{x:0,y:0,w:8,h:3}],"\u{1FB84}":[{x:0,y:0,w:8,h:5}],"\u{1FB85}":[{x:0,y:0,w:8,h:6}],"\u{1FB86}":[{x:0,y:0,w:8,h:7}],"\u{1FB87}":[{x:6,y:0,w:2,h:8}],"\u{1FB88}":[{x:5,y:0,w:3,h:8}],"\u{1FB89}":[{x:3,y:0,w:5,h:8}],"\u{1FB8A}":[{x:2,y:0,w:6,h:8}],"\u{1FB8B}":[{x:1,y:0,w:7,h:8}],"\u{1FB95}":[{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}],"\u{1FB96}":[{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}],"\u{1FB97}":[{x:0,y:2,w:8,h:2},{x:0,y:6,w:8,h:2}]};let u={"\u2591":[[1,0,0,0],[0,0,0,0],[0,0,1,0],[0,0,0,0]],"\u2592":[[1,0],[0,0],[0,1],[0,0]],"\u2593":[[0,1],[1,1],[1,0],[1,1]]};t.boxDrawingDefinitions={"\u2500":{1:"M0,.5 L1,.5"},"\u2501":{3:"M0,.5 L1,.5"},"\u2502":{1:"M.5,0 L.5,1"},"\u2503":{3:"M.5,0 L.5,1"},"\u250C":{1:"M0.5,1 L.5,.5 L1,.5"},"\u250F":{3:"M0.5,1 L.5,.5 L1,.5"},"\u2510":{1:"M0,.5 L.5,.5 L.5,1"},"\u2513":{3:"M0,.5 L.5,.5 L.5,1"},"\u2514":{1:"M.5,0 L.5,.5 L1,.5"},"\u2517":{3:"M.5,0 L.5,.5 L1,.5"},"\u2518":{1:"M.5,0 L.5,.5 L0,.5"},"\u251B":{3:"M.5,0 L.5,.5 L0,.5"},"\u251C":{1:"M.5,0 L.5,1 M.5,.5 L1,.5"},"\u2523":{3:"M.5,0 L.5,1 M.5,.5 L1,.5"},"\u2524":{1:"M.5,0 L.5,1 M.5,.5 L0,.5"},"\u252B":{3:"M.5,0 L.5,1 M.5,.5 L0,.5"},"\u252C":{1:"M0,.5 L1,.5 M.5,.5 L.5,1"},"\u2533":{3:"M0,.5 L1,.5 M.5,.5 L.5,1"},"\u2534":{1:"M0,.5 L1,.5 M.5,.5 L.5,0"},"\u253B":{3:"M0,.5 L1,.5 M.5,.5 L.5,0"},"\u253C":{1:"M0,.5 L1,.5 M.5,0 L.5,1"},"\u254B":{3:"M0,.5 L1,.5 M.5,0 L.5,1"},"\u2574":{1:"M.5,.5 L0,.5"},"\u2578":{3:"M.5,.5 L0,.5"},"\u2575":{1:"M.5,.5 L.5,0"},"\u2579":{3:"M.5,.5 L.5,0"},"\u2576":{1:"M.5,.5 L1,.5"},"\u257A":{3:"M.5,.5 L1,.5"},"\u2577":{1:"M.5,.5 L.5,1"},"\u257B":{3:"M.5,.5 L.5,1"},"\u2550":{1:(r,e)=>`M0,${.5-e} L1,${.5-e} M0,${.5+e} L1,${.5+e}`},"\u2551":{1:(r,e)=>`M${.5-r},0 L${.5-r},1 M${.5+r},0 L${.5+r},1`},"\u2552":{1:(r,e)=>`M.5,1 L.5,${.5-e} L1,${.5-e} M.5,${.5+e} L1,${.5+e}`},"\u2553":{1:(r,e)=>`M${.5-r},1 L${.5-r},.5 L1,.5 M${.5+r},.5 L${.5+r},1`},"\u2554":{1:(r,e)=>`M1,${.5-e} L${.5-r},${.5-e} L${.5-r},1 M1,${.5+e} L${.5+r},${.5+e} L${.5+r},1`},"\u2555":{1:(r,e)=>`M0,${.5-e} L.5,${.5-e} L.5,1 M0,${.5+e} L.5,${.5+e}`},"\u2556":{1:(r,e)=>`M${.5+r},1 L${.5+r},.5 L0,.5 M${.5-r},.5 L${.5-r},1`},"\u2557":{1:(r,e)=>`M0,${.5+e} L${.5-r},${.5+e} L${.5-r},1 M0,${.5-e} L${.5+r},${.5-e} L${.5+r},1`},"\u2558":{1:(r,e)=>`M.5,0 L.5,${.5+e} L1,${.5+e} M.5,${.5-e} L1,${.5-e}`},"\u2559":{1:(r,e)=>`M1,.5 L${.5-r},.5 L${.5-r},0 M${.5+r},.5 L${.5+r},0`},"\u255A":{1:(r,e)=>`M1,${.5-e} L${.5+r},${.5-e} L${.5+r},0 M1,${.5+e} L${.5-r},${.5+e} L${.5-r},0`},"\u255B":{1:(r,e)=>`M0,${.5+e} L.5,${.5+e} L.5,0 M0,${.5-e} L.5,${.5-e}`},"\u255C":{1:(r,e)=>`M0,.5 L${.5+r},.5 L${.5+r},0 M${.5-r},.5 L${.5-r},0`},"\u255D":{1:(r,e)=>`M0,${.5-e} L${.5-r},${.5-e} L${.5-r},0 M0,${.5+e} L${.5+r},${.5+e} L${.5+r},0`},"\u255E":{1:(r,e)=>`M.5,0 L.5,1 M.5,${.5-e} L1,${.5-e} M.5,${.5+e} L1,${.5+e}`},"\u255F":{1:(r,e)=>`M${.5-r},0 L${.5-r},1 M${.5+r},0 L${.5+r},1 M${.5+r},.5 L1,.5`},"\u2560":{1:(r,e)=>`M${.5-r},0 L${.5-r},1 M1,${.5+e} L${.5+r},${.5+e} L${.5+r},1 M1,${.5-e} L${.5+r},${.5-e} L${.5+r},0`},"\u2561":{1:(r,e)=>`M.5,0 L.5,1 M0,${.5-e} L.5,${.5-e} M0,${.5+e} L.5,${.5+e}`},"\u2562":{1:(r,e)=>`M0,.5 L${.5-r},.5 M${.5-r},0 L${.5-r},1 M${.5+r},0 L${.5+r},1`},"\u2563":{1:(r,e)=>`M${.5+r},0 L${.5+r},1 M0,${.5+e} L${.5-r},${.5+e} L${.5-r},1 M0,${.5-e} L${.5-r},${.5-e} L${.5-r},0`},"\u2564":{1:(r,e)=>`M0,${.5-e} L1,${.5-e} M0,${.5+e} L1,${.5+e} M.5,${.5+e} L.5,1`},"\u2565":{1:(r,e)=>`M0,.5 L1,.5 M${.5-r},.5 L${.5-r},1 M${.5+r},.5 L${.5+r},1`},"\u2566":{1:(r,e)=>`M0,${.5-e} L1,${.5-e} M0,${.5+e} L${.5-r},${.5+e} L${.5-r},1 M1,${.5+e} L${.5+r},${.5+e} L${.5+r},1`},"\u2567":{1:(r,e)=>`M.5,0 L.5,${.5-e} M0,${.5-e} L1,${.5-e} M0,${.5+e} L1,${.5+e}`},"\u2568":{1:(r,e)=>`M0,.5 L1,.5 M${.5-r},.5 L${.5-r},0 M${.5+r},.5 L${.5+r},0`},"\u2569":{1:(r,e)=>`M0,${.5+e} L1,${.5+e} M0,${.5-e} L${.5-r},${.5-e} L${.5-r},0 M1,${.5-e} L${.5+r},${.5-e} L${.5+r},0`},"\u256A":{1:(r,e)=>`M.5,0 L.5,1 M0,${.5-e} L1,${.5-e} M0,${.5+e} L1,${.5+e}`},"\u256B":{1:(r,e)=>`M0,.5 L1,.5 M${.5-r},0 L${.5-r},1 M${.5+r},0 L${.5+r},1`},"\u256C":{1:(r,e)=>`M0,${.5+e} L${.5-r},${.5+e} L${.5-r},1 M1,${.5+e} L${.5+r},${.5+e} L${.5+r},1 M0,${.5-e} L${.5-r},${.5-e} L${.5-r},0 M1,${.5-e} L${.5+r},${.5-e} L${.5+r},0`},"\u2571":{1:"M1,0 L0,1"},"\u2572":{1:"M0,0 L1,1"},"\u2573":{1:"M1,0 L0,1 M0,0 L1,1"},"\u257C":{1:"M.5,.5 L0,.5",3:"M.5,.5 L1,.5"},"\u257D":{1:"M.5,.5 L.5,0",3:"M.5,.5 L.5,1"},"\u257E":{1:"M.5,.5 L1,.5",3:"M.5,.5 L0,.5"},"\u257F":{1:"M.5,.5 L.5,1",3:"M.5,.5 L.5,0"},"\u250D":{1:"M.5,.5 L.5,1",3:"M.5,.5 L1,.5"},"\u250E":{1:"M.5,.5 L1,.5",3:"M.5,.5 L.5,1"},"\u2511":{1:"M.5,.5 L.5,1",3:"M.5,.5 L0,.5"},"\u2512":{1:"M.5,.5 L0,.5",3:"M.5,.5 L.5,1"},"\u2515":{1:"M.5,.5 L.5,0",3:"M.5,.5 L1,.5"},"\u2516":{1:"M.5,.5 L1,.5",3:"M.5,.5 L.5,0"},"\u2519":{1:"M.5,.5 L.5,0",3:"M.5,.5 L0,.5"},"\u251A":{1:"M.5,.5 L0,.5",3:"M.5,.5 L.5,0"},"\u251D":{1:"M.5,0 L.5,1",3:"M.5,.5 L1,.5"},"\u251E":{1:"M0.5,1 L.5,.5 L1,.5",3:"M.5,.5 L.5,0"},"\u251F":{1:"M.5,0 L.5,.5 L1,.5",3:"M.5,.5 L.5,1"},"\u2520":{1:"M.5,.5 L1,.5",3:"M.5,0 L.5,1"},"\u2521":{1:"M.5,.5 L.5,1",3:"M.5,0 L.5,.5 L1,.5"},"\u2522":{1:"M.5,.5 L.5,0",3:"M0.5,1 L.5,.5 L1,.5"},"\u2525":{1:"M.5,0 L.5,1",3:"M.5,.5 L0,.5"},"\u2526":{1:"M0,.5 L.5,.5 L.5,1",3:"M.5,.5 L.5,0"},"\u2527":{1:"M.5,0 L.5,.5 L0,.5",3:"M.5,.5 L.5,1"},"\u2528":{1:"M.5,.5 L0,.5",3:"M.5,0 L.5,1"},"\u2529":{1:"M.5,.5 L.5,1",3:"M.5,0 L.5,.5 L0,.5"},"\u252A":{1:"M.5,.5 L.5,0",3:"M0,.5 L.5,.5 L.5,1"},"\u252D":{1:"M0.5,1 L.5,.5 L1,.5",3:"M.5,.5 L0,.5"},"\u252E":{1:"M0,.5 L.5,.5 L.5,1",3:"M.5,.5 L1,.5"},"\u252F":{1:"M.5,.5 L.5,1",3:"M0,.5 L1,.5"},"\u2530":{1:"M0,.5 L1,.5",3:"M.5,.5 L.5,1"},"\u2531":{1:"M.5,.5 L1,.5",3:"M0,.5 L.5,.5 L.5,1"},"\u2532":{1:"M.5,.5 L0,.5",3:"M0.5,1 L.5,.5 L1,.5"},"\u2535":{1:"M.5,0 L.5,.5 L1,.5",3:"M.5,.5 L0,.5"},"\u2536":{1:"M.5,0 L.5,.5 L0,.5",3:"M.5,.5 L1,.5"},"\u2537":{1:"M.5,.5 L.5,0",3:"M0,.5 L1,.5"},"\u2538":{1:"M0,.5 L1,.5",3:"M.5,.5 L.5,0"},"\u2539":{1:"M.5,.5 L1,.5",3:"M.5,0 L.5,.5 L0,.5"},"\u253A":{1:"M.5,.5 L0,.5",3:"M.5,0 L.5,.5 L1,.5"},"\u253D":{1:"M.5,0 L.5,1 M.5,.5 L1,.5",3:"M.5,.5 L0,.5"},"\u253E":{1:"M.5,0 L.5,1 M.5,.5 L0,.5",3:"M.5,.5 L1,.5"},"\u253F":{1:"M.5,0 L.5,1",3:"M0,.5 L1,.5"},"\u2540":{1:"M0,.5 L1,.5 M.5,.5 L.5,1",3:"M.5,.5 L.5,0"},"\u2541":{1:"M.5,.5 L.5,0 M0,.5 L1,.5",3:"M.5,.5 L.5,1"},"\u2542":{1:"M0,.5 L1,.5",3:"M.5,0 L.5,1"},"\u2543":{1:"M0.5,1 L.5,.5 L1,.5",3:"M.5,0 L.5,.5 L0,.5"},"\u2544":{1:"M0,.5 L.5,.5 L.5,1",3:"M.5,0 L.5,.5 L1,.5"},"\u2545":{1:"M.5,0 L.5,.5 L1,.5",3:"M0,.5 L.5,.5 L.5,1"},"\u2546":{1:"M.5,0 L.5,.5 L0,.5",3:"M0.5,1 L.5,.5 L1,.5"},"\u2547":{1:"M.5,.5 L.5,1",3:"M.5,.5 L.5,0 M0,.5 L1,.5"},"\u2548":{1:"M.5,.5 L.5,0",3:"M0,.5 L1,.5 M.5,.5 L.5,1"},"\u2549":{1:"M.5,.5 L1,.5",3:"M.5,0 L.5,1 M.5,.5 L0,.5"},"\u254A":{1:"M.5,.5 L0,.5",3:"M.5,0 L.5,1 M.5,.5 L1,.5"},"\u254C":{1:"M.1,.5 L.4,.5 M.6,.5 L.9,.5"},"\u254D":{3:"M.1,.5 L.4,.5 M.6,.5 L.9,.5"},"\u2504":{1:"M.0667,.5 L.2667,.5 M.4,.5 L.6,.5 M.7333,.5 L.9333,.5"},"\u2505":{3:"M.0667,.5 L.2667,.5 M.4,.5 L.6,.5 M.7333,.5 L.9333,.5"},"\u2508":{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"},"\u2509":{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"},"\u254E":{1:"M.5,.1 L.5,.4 M.5,.6 L.5,.9"},"\u254F":{3:"M.5,.1 L.5,.4 M.5,.6 L.5,.9"},"\u2506":{1:"M.5,.0667 L.5,.2667 M.5,.4 L.5,.6 M.5,.7333 L.5,.9333"},"\u2507":{3:"M.5,.0667 L.5,.2667 M.5,.4 L.5,.6 M.5,.7333 L.5,.9333"},"\u250A":{1:"M.5,.05 L.5,.2 M.5,.3 L.5,.45 L.5,.55 M.5,.7 L.5,.95"},"\u250B":{3:"M.5,.05 L.5,.2 M.5,.3 L.5,.45 L.5,.55 M.5,.7 L.5,.95"},"\u256D":{1:(r,e)=>`M.5,1 L.5,${.5+e/.15*.5} C.5,${.5+e/.15*.5},.5,.5,1,.5`},"\u256E":{1:(r,e)=>`M.5,1 L.5,${.5+e/.15*.5} C.5,${.5+e/.15*.5},.5,.5,0,.5`},"\u256F":{1:(r,e)=>`M.5,0 L.5,${.5-e/.15*.5} C.5,${.5-e/.15*.5},.5,.5,0,.5`},"\u2570":{1:(r,e)=>`M.5,0 L.5,${.5-e/.15*.5} C.5,${.5-e/.15*.5},.5,.5,1,.5`}},t.powerlineDefinitions={"\uE0B0":{d:"M0,0 L1,.5 L0,1",type:0,rightPadding:2},"\uE0B1":{d:"M-1,-.5 L1,.5 L-1,1.5",type:1,leftPadding:1,rightPadding:1},"\uE0B2":{d:"M1,0 L0,.5 L1,1",type:0,leftPadding:2},"\uE0B3":{d:"M2,-.5 L0,.5 L2,1.5",type:1,leftPadding:1,rightPadding:1},"\uE0B4":{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},"\uE0B5":{d:"M.2,1 C.422,1,.8,.826,.78,.5 C.8,.174,0.422,0,.2,0",type:1,rightPadding:1},"\uE0B6":{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},"\uE0B7":{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},"\uE0B8":{d:"M-.5,-.5 L1.5,1.5 L-.5,1.5",type:0},"\uE0B9":{d:"M-.5,-.5 L1.5,1.5",type:1,leftPadding:1,rightPadding:1},"\uE0BA":{d:"M1.5,-.5 L-.5,1.5 L1.5,1.5",type:0},"\uE0BC":{d:"M1.5,-.5 L-.5,1.5 L-.5,-.5",type:0},"\uE0BD":{d:"M1.5,-.5 L-.5,1.5",type:1,leftPadding:1,rightPadding:1},"\uE0BE":{d:"M-.5,-.5 L1.5,1.5 L1.5,-.5",type:0}},t.powerlineDefinitions["\uE0BB"]=t.powerlineDefinitions["\uE0BD"],t.powerlineDefinitions["\uE0BF"]=t.powerlineDefinitions["\uE0B9"],t.tryDrawCustomChar=function(r,e,o,s,i,h,m,d){let c=t.blockElementDefinitions[e];if(c)return(function(D,x,y,L,M,B){for(let P=0;P<x.length;P++){let H=x[P],w=M/8,R=B/8;D.fillRect(y+H.x*w,L+H.y*R,H.w*w,H.h*R)}})(r,c,o,s,i,h),!0;let v=u[e];if(v)return(function(D,x,y,L,M,B){let P=n.get(x);P||(P=new Map,n.set(x,P));let H=D.fillStyle;if(typeof H!="string")throw Error(`Unexpected fillStyle type "${H}"`);let w=P.get(H);if(!w){let R=x[0].length,O=x.length,F=D.canvas.ownerDocument.createElement("canvas");F.width=R,F.height=O;let z=(0,l.throwIfFalsy)(F.getContext("2d")),j=new ImageData(R,O),X,K,W,$;if(H.startsWith("#"))X=parseInt(H.slice(1,3),16),K=parseInt(H.slice(3,5),16),W=parseInt(H.slice(5,7),16),$=H.length>7&&parseInt(H.slice(7,9),16)||1;else{if(!H.startsWith("rgba"))throw Error(`Unexpected fillStyle color format "${H}" when drawing pattern glyph`);[X,K,W,$]=H.substring(5,H.length-1).split(",").map((I=>parseFloat(I)))}for(let I=0;I<O;I++)for(let U=0;U<R;U++)j.data[4*(I*R+U)]=X,j.data[4*(I*R+U)+1]=K,j.data[4*(I*R+U)+2]=W,j.data[4*(I*R+U)+3]=x[I][U]*(255*$);z.putImageData(j,0,0),w=(0,l.throwIfFalsy)(D.createPattern(F,null)),P.set(H,w)}D.fillStyle=w,D.fillRect(y,L,M,B)})(r,v,o,s,i,h),!0;let C=t.boxDrawingDefinitions[e];if(C)return(function(D,x,y,L,M,B,P){D.strokeStyle=D.fillStyle;for(let[H,w]of Object.entries(x)){let R;D.beginPath(),D.lineWidth=P*Number.parseInt(H),R=typeof w=="function"?w(.15,.15/B*M):w;for(let O of R.split(" ")){let F=O[0],z=p[F];if(!z){console.error(`Could not find drawing instructions for "${F}"`);continue}let j=O.substring(1).split(",");j[0]&&j[1]&&z(D,S(j,M,B,y,L,!0,P))}D.stroke(),D.closePath()}})(r,C,o,s,i,h,d),!0;let k=t.powerlineDefinitions[e];return!!k&&((function(D,x,y,L,M,B,P,H){let w=new Path2D;w.rect(y,L,M,B),D.clip(w),D.beginPath();let R=P/12;D.lineWidth=H*R;for(let O of x.d.split(" ")){let F=O[0],z=p[F];if(!z){console.error(`Could not find drawing instructions for "${F}"`);continue}let j=O.substring(1).split(",");j[0]&&j[1]&&z(D,S(j,M,B,y,L,!1,H,(x.leftPadding??0)*(R/2),(x.rightPadding??0)*(R/2)))}x.type===1?(D.strokeStyle=D.fillStyle,D.stroke()):D.fill(),D.closePath()})(r,k,o,s,i,h,m,d),!0)};let n=new Map;function f(r,e,o=0){return Math.max(Math.min(r,e),o)}let p={C:(r,e)=>r.bezierCurveTo(e[0],e[1],e[2],e[3],e[4],e[5]),L:(r,e)=>r.lineTo(e[0],e[1]),M:(r,e)=>r.moveTo(e[0],e[1])};function S(r,e,o,s,i,h,m,d=0,c=0){let v=r.map((C=>parseFloat(C)||parseInt(C)));if(v.length<2)throw Error("Too few arguments for instruction");for(let C=0;C<v.length;C+=2)v[C]*=e-d*m-c*m,h&&v[C]!==0&&(v[C]=f(Math.round(v[C]+.5)-.5,e,0)),v[C]+=s+d*m;for(let C=1;C<v.length;C+=2)v[C]*=o,h&&v[C]!==0&&(v[C]=f(Math.round(v[C]+.5)-.5,o,0)),v[C]+=i;return v}},56:(A,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.observeDevicePixelDimensions=void 0;let l=a(859);t.observeDevicePixelDimensions=function(u,n,f){let p=new n.ResizeObserver((S=>{let r=S.find((s=>s.target===u));if(!r)return;if(!("devicePixelContentBoxSize"in r))return p==null||p.disconnect(),void(p=void 0);let e=r.devicePixelContentBoxSize[0].inlineSize,o=r.devicePixelContentBoxSize[0].blockSize;e>0&&o>0&&f(e,o)}));try{p.observe(u,{box:["device-pixel-content-box"]})}catch{p.disconnect(),p=void 0}return(0,l.toDisposable)((()=>p==null?void 0:p.disconnect()))}},374:(A,t)=>{function a(u){return 57508<=u&&u<=57558}function l(u){return u>=128512&&u<=128591||u>=127744&&u<=128511||u>=128640&&u<=128767||u>=9728&&u<=9983||u>=9984&&u<=10175||u>=65024&&u<=65039||u>=129280&&u<=129535||u>=127462&&u<=127487}Object.defineProperty(t,"__esModule",{value:!0}),t.computeNextVariantOffset=t.createRenderDimensions=t.treatGlyphAsBackgroundColor=t.allowRescaling=t.isEmoji=t.isRestrictedPowerlineGlyph=t.isPowerlineGlyph=t.throwIfFalsy=void 0,t.throwIfFalsy=function(u){if(!u)throw Error("value must not be falsy");return u},t.isPowerlineGlyph=a,t.isRestrictedPowerlineGlyph=function(u){return 57520<=u&&u<=57527},t.isEmoji=l,t.allowRescaling=function(u,n,f,p){return n===1&&f>Math.ceil(1.5*p)&&u!==void 0&&u>255&&!l(u)&&!a(u)&&!(function(S){return 57344<=S&&S<=63743})(u)},t.treatGlyphAsBackgroundColor=function(u){return a(u)||(function(n){return 9472<=n&&n<=9631})(u)},t.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}}}},t.computeNextVariantOffset=function(u,n,f=0){return(u-(2*Math.round(n)-f))%(2*Math.round(n))}},296:(A,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.createSelectionRenderModel=void 0;class a{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(u,n,f,p=!1){if(this.selectionStart=n,this.selectionEnd=f,!n||!f||n[0]===f[0]&&n[1]===f[1])return void this.clear();let S=u.buffers.active.ydisp,r=n[1]-S,e=f[1]-S,o=Math.max(r,0),s=Math.min(e,u.rows-1);o>=u.rows||s<0?this.clear():(this.hasSelection=!0,this.columnSelectMode=p,this.viewportStartRow=r,this.viewportEndRow=e,this.viewportCappedStartRow=o,this.viewportCappedEndRow=s,this.startCol=n[0],this.endCol=f[0])}isCellSelected(u,n,f){return!!this.hasSelection&&(f-=u.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?n>=this.startCol&&f>=this.viewportCappedStartRow&&n<this.endCol&&f<=this.viewportCappedEndRow:n<this.startCol&&f>=this.viewportCappedStartRow&&n>=this.endCol&&f<=this.viewportCappedEndRow:f>this.viewportStartRow&&f<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&f===this.viewportStartRow&&n>=this.startCol&&n<this.endCol||this.viewportStartRow<this.viewportEndRow&&f===this.viewportEndRow&&n<this.endCol||this.viewportStartRow<this.viewportEndRow&&f===this.viewportStartRow&&n>=this.startCol)}}t.createSelectionRenderModel=function(){return new a}},509:(A,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.TextureAtlas=void 0;let l=a(237),u=a(860),n=a(374),f=a(160),p=a(345),S=a(485),r=a(385),e=a(147),o=a(855),s={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}},i;class h{get pages(){return this._pages}constructor(C,k,D){this._document=C,this._config=k,this._unicodeService=D,this._didWarmUp=!1,this._cacheMap=new S.FourKeyMap,this._cacheMapCombined=new S.FourKeyMap,this._pages=[],this._activePages=[],this._workBoundingBox={top:0,left:0,bottom:0,right:0},this._workAttributeData=new e.AttributeData,this._textureSize=512,this._onAddTextureAtlasCanvas=new p.EventEmitter,this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event,this._onRemoveTextureAtlasCanvas=new p.EventEmitter,this.onRemoveTextureAtlasCanvas=this._onRemoveTextureAtlasCanvas.event,this._requestClearModel=!1,this._createNewPage(),this._tmpCanvas=c(C,4*this._config.deviceCellWidth+4,this._config.deviceCellHeight+4),this._tmpCtx=(0,n.throwIfFalsy)(this._tmpCanvas.getContext("2d",{alpha:this._config.allowTransparency,willReadFrequently:!0}))}dispose(){for(let C of this.pages)C.canvas.remove();this._onAddTextureAtlasCanvas.dispose()}warmUp(){this._didWarmUp||(this._didWarmUp=(this._doWarmUp(),!0))}_doWarmUp(){let C=new r.IdleTaskQueue;for(let k=33;k<126;k++)C.enqueue((()=>{if(!this._cacheMap.get(k,o.DEFAULT_COLOR,o.DEFAULT_COLOR,o.DEFAULT_EXT)){let D=this._drawToCache(k,o.DEFAULT_COLOR,o.DEFAULT_COLOR,o.DEFAULT_EXT);this._cacheMap.set(k,o.DEFAULT_COLOR,o.DEFAULT_COLOR,o.DEFAULT_EXT,D)}}))}beginFrame(){return this._requestClearModel}clearTexture(){if(this._pages[0].currentRow.x!==0||this._pages[0].currentRow.y!==0){for(let C of this._pages)C.clear();this._cacheMap.clear(),this._cacheMapCombined.clear(),this._didWarmUp=!1}}_createNewPage(){if(h.maxAtlasPages&&this._pages.length>=Math.max(4,h.maxAtlasPages)){let k=this._pages.filter((P=>2*P.canvas.width<=(h.maxTextureSize||4096))).sort(((P,H)=>H.canvas.width===P.canvas.width?H.percentageUsed-P.percentageUsed:H.canvas.width-P.canvas.width)),D=-1,x=0;for(let P=0;P<k.length;P++)if(k[P].canvas.width!==x)D=P,x=k[P].canvas.width;else if(P-D==3)break;let y=k.slice(D,D+4),L=y.map((P=>P.glyphs[0].texturePage)).sort(((P,H)=>P>H?1:-1)),M=this.pages.length-y.length,B=this._mergePages(y,M);B.version++;for(let P=L.length-1;P>=0;P--)this._deletePage(L[P]);this.pages.push(B),this._requestClearModel=!0,this._onAddTextureAtlasCanvas.fire(B.canvas)}let C=new m(this._document,this._textureSize);return this._pages.push(C),this._activePages.push(C),this._onAddTextureAtlasCanvas.fire(C.canvas),C}_mergePages(C,k){let D=2*C[0].canvas.width,x=new m(this._document,D,C);for(let[y,L]of C.entries()){let M=y*L.canvas.width%D,B=Math.floor(y/2)*L.canvas.height;x.ctx.drawImage(L.canvas,M,B);for(let H of L.glyphs)H.texturePage=k,H.sizeClipSpace.x=H.size.x/D,H.sizeClipSpace.y=H.size.y/D,H.texturePosition.x+=M,H.texturePosition.y+=B,H.texturePositionClipSpace.x=H.texturePosition.x/D,H.texturePositionClipSpace.y=H.texturePosition.y/D;this._onRemoveTextureAtlasCanvas.fire(L.canvas);let P=this._activePages.indexOf(L);P!==-1&&this._activePages.splice(P,1)}return x}_deletePage(C){this._pages.splice(C,1);for(let k=C;k<this._pages.length;k++){let D=this._pages[k];for(let x of D.glyphs)x.texturePage--;D.version++}}getRasterizedGlyphCombinedChar(C,k,D,x,y){return this._getFromCacheMap(this._cacheMapCombined,C,k,D,x,y)}getRasterizedGlyph(C,k,D,x,y){return this._getFromCacheMap(this._cacheMap,C,k,D,x,y)}_getFromCacheMap(C,k,D,x,y,L=!1){return i=C.get(k,D,x,y),i||(i=this._drawToCache(k,D,x,y,L),C.set(k,D,x,y,i)),i}_getColorFromAnsiIndex(C){if(C>=this._config.colors.ansi.length)throw Error("No color found for idx "+C);return this._config.colors.ansi[C]}_getBackgroundColor(C,k,D,x){if(this._config.allowTransparency)return f.NULL_COLOR;let y;switch(C){case 16777216:case 33554432:y=this._getColorFromAnsiIndex(k);break;case 50331648:let L=e.AttributeData.toColorRGB(k);y=f.channels.toColor(L[0],L[1],L[2]);break;default:y=D?f.color.opaque(this._config.colors.foreground):this._config.colors.background}return y}_getForegroundColor(C,k,D,x,y,L,M,B,P,H){let w=this._getMinimumContrastColor(C,k,D,x,y,L,M,P,B,H);if(w)return w;let R;switch(y){case 16777216:case 33554432:this._config.drawBoldTextInBrightColors&&P&&L<8&&(L+=8),R=this._getColorFromAnsiIndex(L);break;case 50331648:let O=e.AttributeData.toColorRGB(L);R=f.channels.toColor(O[0],O[1],O[2]);break;default:R=M?this._config.colors.background:this._config.colors.foreground}return this._config.allowTransparency&&(R=f.color.opaque(R)),B&&(R=f.color.multiplyOpacity(R,l.DIM_OPACITY)),R}_resolveBackgroundRgba(C,k,D){switch(C){case 16777216:case 33554432:return this._getColorFromAnsiIndex(k).rgba;case 50331648:return k<<8;default:return D?this._config.colors.foreground.rgba:this._config.colors.background.rgba}}_resolveForegroundRgba(C,k,D,x){switch(C){case 16777216:case 33554432:return this._config.drawBoldTextInBrightColors&&x&&k<8&&(k+=8),this._getColorFromAnsiIndex(k).rgba;case 50331648:return k<<8;default:return D?this._config.colors.background.rgba:this._config.colors.foreground.rgba}}_getMinimumContrastColor(C,k,D,x,y,L,M,B,P,H){if(this._config.minimumContrastRatio===1||H)return;let w=this._getContrastCache(P),R=w.getColor(C,x);if(R!==void 0)return R||void 0;let O=this._resolveBackgroundRgba(k,D,M),F=this._resolveForegroundRgba(y,L,M,B),z=f.rgba.ensureContrastRatio(O,F,this._config.minimumContrastRatio/(P?2:1));if(!z)return void w.setColor(C,x,null);let j=f.channels.toColor(z>>24&255,z>>16&255,z>>8&255);return w.setColor(C,x,j),j}_getContrastCache(C){return C?this._config.colors.halfContrastCache:this._config.colors.contrastCache}_drawToCache(C,k,D,x,y=!1){let L=typeof C=="number"?String.fromCharCode(C):C,M=Math.min(this._config.deviceCellWidth*Math.max(L.length,2)+4,this._textureSize);this._tmpCanvas.width<M&&(this._tmpCanvas.width=M);let B=Math.min(this._config.deviceCellHeight+8,this._textureSize);if(this._tmpCanvas.height<B&&(this._tmpCanvas.height=B),this._tmpCtx.save(),this._workAttributeData.fg=D,this._workAttributeData.bg=k,this._workAttributeData.extended.ext=x,this._workAttributeData.isInvisible())return s;let P=!!this._workAttributeData.isBold(),H=!!this._workAttributeData.isInverse(),w=!!this._workAttributeData.isDim(),R=!!this._workAttributeData.isItalic(),O=!!this._workAttributeData.isUnderline(),F=!!this._workAttributeData.isStrikethrough(),z=!!this._workAttributeData.isOverline(),j=this._workAttributeData.getFgColor(),X=this._workAttributeData.getFgColorMode(),K=this._workAttributeData.getBgColor(),W=this._workAttributeData.getBgColorMode();if(H){let V=j;j=K,K=V;let ie=X;X=W,W=ie}let $=this._getBackgroundColor(W,K,H,w);this._tmpCtx.globalCompositeOperation="copy",this._tmpCtx.fillStyle=$.css,this._tmpCtx.fillRect(0,0,this._tmpCanvas.width,this._tmpCanvas.height),this._tmpCtx.globalCompositeOperation="source-over";let I=P?this._config.fontWeightBold:this._config.fontWeight,U=R?"italic":"";this._tmpCtx.font=`${U} ${I} ${this._config.fontSize*this._config.devicePixelRatio}px ${this._config.fontFamily}`,this._tmpCtx.textBaseline=l.TEXT_BASELINE;let q=L.length===1&&(0,n.isPowerlineGlyph)(L.charCodeAt(0)),G=L.length===1&&(0,n.isRestrictedPowerlineGlyph)(L.charCodeAt(0)),Q=this._getForegroundColor(k,W,K,D,X,j,H,w,P,(0,n.treatGlyphAsBackgroundColor)(L.charCodeAt(0)));this._tmpCtx.fillStyle=Q.css;let Y=G?0:4,re=!1;this._config.customGlyphs!==!1&&(re=(0,u.tryDrawCustomChar)(this._tmpCtx,L,Y,Y,this._config.deviceCellWidth,this._config.deviceCellHeight,this._config.fontSize,this._config.devicePixelRatio));let he,J=!q;if(he=typeof C=="number"?this._unicodeService.wcwidth(C):this._unicodeService.getStringCellWidth(C),O){this._tmpCtx.save();let V=Math.max(1,Math.floor(this._config.fontSize*this._config.devicePixelRatio/15)),ie=V%2==1?.5:0;if(this._tmpCtx.lineWidth=V,this._workAttributeData.isUnderlineColorDefault())this._tmpCtx.strokeStyle=this._tmpCtx.fillStyle;else if(this._workAttributeData.isUnderlineColorRGB())J=!1,this._tmpCtx.strokeStyle=`rgb(${e.AttributeData.toColorRGB(this._workAttributeData.getUnderlineColor()).join(",")})`;else{J=!1;let le=this._workAttributeData.getUnderlineColor();this._config.drawBoldTextInBrightColors&&this._workAttributeData.isBold()&&le<8&&(le+=8),this._tmpCtx.strokeStyle=this._getColorFromAnsiIndex(le).css}this._tmpCtx.beginPath();let ae=Y,oe=Math.ceil(Y+this._config.deviceCharHeight)-ie-(y?2*V:0),Le=oe+V,ue=oe+2*V,_e=this._workAttributeData.getUnderlineVariantOffset();for(let le=0;le<he;le++){this._tmpCtx.save();let ne=ae+le*this._config.deviceCellWidth,Z=ae+(le+1)*this._config.deviceCellWidth,Oe=ne+this._config.deviceCellWidth/2;switch(this._workAttributeData.extended.underlineStyle){case 2:this._tmpCtx.moveTo(ne,oe),this._tmpCtx.lineTo(Z,oe),this._tmpCtx.moveTo(ne,ue),this._tmpCtx.lineTo(Z,ue);break;case 3:let He=V<=1?ue:Math.ceil(Y+this._config.deviceCharHeight-V/2)-ie,Fe=V<=1?oe:Math.ceil(Y+this._config.deviceCharHeight+V/2)-ie,kt=new Path2D;kt.rect(ne,oe,this._config.deviceCellWidth,ue-oe),this._tmpCtx.clip(kt),this._tmpCtx.moveTo(ne-this._config.deviceCellWidth/2,Le),this._tmpCtx.bezierCurveTo(ne-this._config.deviceCellWidth/2,Fe,ne,Fe,ne,Le),this._tmpCtx.bezierCurveTo(ne,He,Oe,He,Oe,Le),this._tmpCtx.bezierCurveTo(Oe,Fe,Z,Fe,Z,Le),this._tmpCtx.bezierCurveTo(Z,He,Z+this._config.deviceCellWidth/2,He,Z+this._config.deviceCellWidth/2,Le);break;case 4:let We=_e===0?0:_e>=V?2*V-_e:V-_e;!(_e>=V)==0||We===0?(this._tmpCtx.setLineDash([Math.round(V),Math.round(V)]),this._tmpCtx.moveTo(ne+We,oe),this._tmpCtx.lineTo(Z,oe)):(this._tmpCtx.setLineDash([Math.round(V),Math.round(V)]),this._tmpCtx.moveTo(ne,oe),this._tmpCtx.lineTo(ne+We,oe),this._tmpCtx.moveTo(ne+We+V,oe),this._tmpCtx.lineTo(Z,oe)),_e=(0,n.computeNextVariantOffset)(Z-ne,V,_e);break;case 5:let Qe=Z-ne,Dt=Math.floor(.6*Qe),Rt=Math.floor(.3*Qe),yi=Qe-Dt-Rt;this._tmpCtx.setLineDash([Dt,Rt,yi]),this._tmpCtx.moveTo(ne,oe),this._tmpCtx.lineTo(Z,oe);break;default:this._tmpCtx.moveTo(ne,oe),this._tmpCtx.lineTo(Z,oe)}this._tmpCtx.stroke(),this._tmpCtx.restore()}if(this._tmpCtx.restore(),!re&&this._config.fontSize>=12&&!this._config.allowTransparency&&L!==" "){this._tmpCtx.save(),this._tmpCtx.textBaseline="alphabetic";let le=this._tmpCtx.measureText(L);if(this._tmpCtx.restore(),"actualBoundingBoxDescent"in le&&le.actualBoundingBoxDescent>0){this._tmpCtx.save();let ne=new Path2D;ne.rect(ae,oe-Math.ceil(V/2),this._config.deviceCellWidth*he,ue-oe+Math.ceil(V/2)),this._tmpCtx.clip(ne),this._tmpCtx.lineWidth=3*this._config.devicePixelRatio,this._tmpCtx.strokeStyle=$.css,this._tmpCtx.strokeText(L,Y,Y+this._config.deviceCharHeight),this._tmpCtx.restore()}}}if(z){let V=Math.max(1,Math.floor(this._config.fontSize*this._config.devicePixelRatio/15)),ie=V%2==1?.5:0;this._tmpCtx.lineWidth=V,this._tmpCtx.strokeStyle=this._tmpCtx.fillStyle,this._tmpCtx.beginPath(),this._tmpCtx.moveTo(Y,Y+ie),this._tmpCtx.lineTo(Y+this._config.deviceCharWidth*he,Y+ie),this._tmpCtx.stroke()}if(re||this._tmpCtx.fillText(L,Y,Y+this._config.deviceCharHeight),L==="_"&&!this._config.allowTransparency){let V=d(this._tmpCtx.getImageData(Y,Y,this._config.deviceCellWidth,this._config.deviceCellHeight),$,Q,J);if(V)for(let ie=1;ie<=5&&(this._tmpCtx.save(),this._tmpCtx.fillStyle=$.css,this._tmpCtx.fillRect(0,0,this._tmpCanvas.width,this._tmpCanvas.height),this._tmpCtx.restore(),this._tmpCtx.fillText(L,Y,Y+this._config.deviceCharHeight-ie),V=d(this._tmpCtx.getImageData(Y,Y,this._config.deviceCellWidth,this._config.deviceCellHeight),$,Q,J),V);ie++);}if(F){let V=Math.max(1,Math.floor(this._config.fontSize*this._config.devicePixelRatio/10)),ie=this._tmpCtx.lineWidth%2==1?.5:0;this._tmpCtx.lineWidth=V,this._tmpCtx.strokeStyle=this._tmpCtx.fillStyle,this._tmpCtx.beginPath(),this._tmpCtx.moveTo(Y,Y+Math.floor(this._config.deviceCharHeight/2)-ie),this._tmpCtx.lineTo(Y+this._config.deviceCharWidth*he,Y+Math.floor(this._config.deviceCharHeight/2)-ie),this._tmpCtx.stroke()}this._tmpCtx.restore();let Ce=this._tmpCtx.getImageData(0,0,this._tmpCanvas.width,this._tmpCanvas.height),Re;if(Re=this._config.allowTransparency?(function(V){for(let ie=0;ie<V.data.length;ie+=4)if(V.data[ie+3]>0)return!1;return!0})(Ce):d(Ce,$,Q,J),Re)return s;let se=this._findGlyphBoundingBox(Ce,this._workBoundingBox,M,G,re,Y),ee,te;for(;;){if(this._activePages.length===0){let V=this._createNewPage();ee=V,te=V.currentRow,te.height=se.size.y;break}ee=this._activePages[this._activePages.length-1],te=ee.currentRow;for(let V of this._activePages)se.size.y<=V.currentRow.height&&(ee=V,te=V.currentRow);for(let V=this._activePages.length-1;V>=0;V--)for(let ie of this._activePages[V].fixedRows)ie.height<=te.height&&se.size.y<=ie.height&&(ee=this._activePages[V],te=ie);if(te.y+se.size.y>=ee.canvas.height||te.height>se.size.y+2){let V=!1;if(ee.currentRow.y+ee.currentRow.height+se.size.y>=ee.canvas.height){let ie;for(let ae of this._activePages)if(ae.currentRow.y+ae.currentRow.height+se.size.y<ae.canvas.height){ie=ae;break}if(ie)ee=ie;else if(h.maxAtlasPages&&this._pages.length>=h.maxAtlasPages&&te.y+se.size.y<=ee.canvas.height&&te.height>=se.size.y&&te.x+se.size.x<=ee.canvas.width)V=!0;else{let ae=this._createNewPage();ee=ae,te=ae.currentRow,te.height=se.size.y,V=!0}}V||(ee.currentRow.height>0&&ee.fixedRows.push(ee.currentRow),te={x:0,y:ee.currentRow.y+ee.currentRow.height,height:se.size.y},ee.fixedRows.push(te),ee.currentRow={x:0,y:te.y+te.height,height:0})}if(te.x+se.size.x<=ee.canvas.width)break;te===ee.currentRow?(te.x=0,te.y+=te.height,te.height=0):ee.fixedRows.splice(ee.fixedRows.indexOf(te),1)}return se.texturePage=this._pages.indexOf(ee),se.texturePosition.x=te.x,se.texturePosition.y=te.y,se.texturePositionClipSpace.x=te.x/ee.canvas.width,se.texturePositionClipSpace.y=te.y/ee.canvas.height,se.sizeClipSpace.x/=ee.canvas.width,se.sizeClipSpace.y/=ee.canvas.height,te.height=Math.max(te.height,se.size.y),te.x+=se.size.x,ee.ctx.putImageData(Ce,se.texturePosition.x-this._workBoundingBox.left,se.texturePosition.y-this._workBoundingBox.top,this._workBoundingBox.left,this._workBoundingBox.top,se.size.x,se.size.y),ee.addGlyph(se),ee.version++,se}_findGlyphBoundingBox(C,k,D,x,y,L){k.top=0;let M=x?this._config.deviceCellHeight:this._tmpCanvas.height,B=x?this._config.deviceCellWidth:D,P=!1;for(let H=0;H<M;H++){for(let w=0;w<B;w++){let R=H*this._tmpCanvas.width*4+4*w+3;if(C.data[R]!==0){k.top=H,P=!0;break}}if(P)break}k.left=0,P=!1;for(let H=0;H<L+B;H++){for(let w=0;w<M;w++){let R=w*this._tmpCanvas.width*4+4*H+3;if(C.data[R]!==0){k.left=H,P=!0;break}}if(P)break}k.right=B,P=!1;for(let H=L+B-1;H>=L;H--){for(let w=0;w<M;w++){let R=w*this._tmpCanvas.width*4+4*H+3;if(C.data[R]!==0){k.right=H,P=!0;break}}if(P)break}k.bottom=M,P=!1;for(let H=M-1;H>=0;H--){for(let w=0;w<B;w++){let R=H*this._tmpCanvas.width*4+4*w+3;if(C.data[R]!==0){k.bottom=H,P=!0;break}}if(P)break}return{texturePage:0,texturePosition:{x:0,y:0},texturePositionClipSpace:{x:0,y:0},size:{x:k.right-k.left+1,y:k.bottom-k.top+1},sizeClipSpace:{x:k.right-k.left+1,y:k.bottom-k.top+1},offset:{x:-k.left+L+(x||y?Math.floor((this._config.deviceCellWidth-this._config.deviceCharWidth)/2):0),y:-k.top+L+(x||y?this._config.lineHeight===1?0:Math.round((this._config.deviceCellHeight-this._config.deviceCharHeight)/2):0)}}}}t.TextureAtlas=h;class m{get percentageUsed(){return this._usedPixels/(this.canvas.width*this.canvas.height)}get glyphs(){return this._glyphs}addGlyph(C){this._glyphs.push(C),this._usedPixels+=C.size.x*C.size.y}constructor(C,k,D){if(this._usedPixels=0,this._glyphs=[],this.version=0,this.currentRow={x:0,y:0,height:0},this.fixedRows=[],D)for(let x of D)this._glyphs.push(...x.glyphs),this._usedPixels+=x._usedPixels;this.canvas=c(C,k,k),this.ctx=(0,n.throwIfFalsy)(this.canvas.getContext("2d",{alpha:!0}))}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 d(v,C,k,D){let x=C.rgba>>>24,y=C.rgba>>>16&255,L=C.rgba>>>8&255,M=k.rgba>>>24,B=k.rgba>>>16&255,P=k.rgba>>>8&255,H=Math.floor((Math.abs(x-M)+Math.abs(y-B)+Math.abs(L-P))/12),w=!0;for(let R=0;R<v.data.length;R+=4)v.data[R]===x&&v.data[R+1]===y&&v.data[R+2]===L||D&&Math.abs(v.data[R]-x)+Math.abs(v.data[R+1]-y)+Math.abs(v.data[R+2]-L)<H?v.data[R+3]=0:w=!1;return w}function c(v,C,k){let D=v.createElement("canvas");return D.width=C,D.height=k,D}},577:function(A,t,a){var l=this&&this.__decorate||function(o,s,i,h){var m,d=arguments.length,c=d<3?s:h===null?h=Object.getOwnPropertyDescriptor(s,i):h;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")c=Reflect.decorate(o,s,i,h);else for(var v=o.length-1;v>=0;v--)(m=o[v])&&(c=(d<3?m(c):d>3?m(s,i,c):m(s,i))||c);return d>3&&c&&Object.defineProperty(s,i,c),c},u=this&&this.__param||function(o,s){return function(i,h){s(i,h,o)}};Object.defineProperty(t,"__esModule",{value:!0}),t.CharacterJoinerService=t.JoinedCellData=void 0;let n=a(147),f=a(855),p=a(782),S=a(97);class r extends n.AttributeData{constructor(s,i,h){super(),this.content=0,this.combinedData="",this.fg=s.fg,this.bg=s.bg,this.combinedData=i,this._width=h}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(s){throw Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}t.JoinedCellData=r;let e=t.CharacterJoinerService=class li{constructor(s){this._bufferService=s,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new p.CellData}register(s){let i={id:this._nextCharacterJoinerId++,handler:s};return this._characterJoiners.push(i),i.id}deregister(s){for(let i=0;i<this._characterJoiners.length;i++)if(this._characterJoiners[i].id===s)return this._characterJoiners.splice(i,1),!0;return!1}getJoinedCharacters(s){if(this._characterJoiners.length===0)return[];let i=this._bufferService.buffer.lines.get(s);if(!i||i.length===0)return[];let h=[],m=i.translateToString(!0),d=0,c=0,v=0,C=i.getFg(0),k=i.getBg(0);for(let D=0;D<i.getTrimmedLength();D++)if(i.loadCell(D,this._workCell),this._workCell.getWidth()!==0){if(this._workCell.fg!==C||this._workCell.bg!==k){if(D-d>1){let x=this._getJoinedRanges(m,v,c,i,d);for(let y=0;y<x.length;y++)h.push(x[y])}d=D,v=c,C=this._workCell.fg,k=this._workCell.bg}c+=this._workCell.getChars().length||f.WHITESPACE_CELL_CHAR.length}if(this._bufferService.cols-d>1){let D=this._getJoinedRanges(m,v,c,i,d);for(let x=0;x<D.length;x++)h.push(D[x])}return h}_getJoinedRanges(s,i,h,m,d){let c=s.substring(i,h),v=[];try{v=this._characterJoiners[0].handler(c)}catch(C){console.error(C)}for(let C=1;C<this._characterJoiners.length;C++)try{let k=this._characterJoiners[C].handler(c);for(let D=0;D<k.length;D++)li._mergeRanges(v,k[D])}catch(k){console.error(k)}return this._stringRangesToCellRanges(v,m,d),v}_stringRangesToCellRanges(s,i,h){let m=0,d=!1,c=0,v=s[m];if(v){for(let C=h;C<this._bufferService.cols;C++){let k=i.getWidth(C),D=i.getString(C).length||f.WHITESPACE_CELL_CHAR.length;if(k!==0){if(!d&&v[0]<=c&&(v[0]=C,d=!0),v[1]<=c){if(v[1]=C,v=s[++m],!v)break;v[0]<=c?(v[0]=C,d=!0):d=!1}c+=D}}v&&(v[1]=this._bufferService.cols)}}static _mergeRanges(s,i){let h=!1;for(let m=0;m<s.length;m++){let d=s[m];if(h){if(i[1]<=d[0])return s[m-1][1]=i[1],s;if(i[1]<=d[1])return s[m-1][1]=Math.max(i[1],d[1]),s.splice(m,1),s;s.splice(m,1),m--}else{if(i[1]<=d[0])return s.splice(m,0,i),s;if(i[1]<=d[1])return d[0]=Math.min(i[0],d[0]),s;i[0]<d[1]&&(d[0]=Math.min(i[0],d[0]),h=!0)}}return h?s[s.length-1][1]=i[1]:s.push(i),s}};t.CharacterJoinerService=e=l([u(0,S.IBufferService)],e)},160:(A,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.contrastRatio=t.toPaddedHex=t.rgba=t.rgb=t.css=t.color=t.channels=t.NULL_COLOR=void 0;let a=0,l=0,u=0,n=0;var f,p,S,r,e;function o(i){let h=i.toString(16);return h.length<2?"0"+h:h}function s(i,h){return i<h?(h+.05)/(i+.05):(i+.05)/(h+.05)}t.NULL_COLOR={css:"#00000000",rgba:0},(function(i){i.toCss=function(h,m,d,c){return c===void 0?`#${o(h)}${o(m)}${o(d)}`:`#${o(h)}${o(m)}${o(d)}${o(c)}`},i.toRgba=function(h,m,d,c=255){return(h<<24|m<<16|d<<8|c)>>>0},i.toColor=function(h,m,d,c){return{css:i.toCss(h,m,d,c),rgba:i.toRgba(h,m,d,c)}}})(f||(t.channels=f={})),(function(i){function h(m,d){return n=Math.round(255*d),[a,l,u]=e.toChannels(m.rgba),{css:f.toCss(a,l,u,n),rgba:f.toRgba(a,l,u,n)}}i.blend=function(m,d){if(n=(255&d.rgba)/255,n===1)return{css:d.css,rgba:d.rgba};let c=d.rgba>>24&255,v=d.rgba>>16&255,C=d.rgba>>8&255,k=m.rgba>>24&255,D=m.rgba>>16&255,x=m.rgba>>8&255;return a=k+Math.round((c-k)*n),l=D+Math.round((v-D)*n),u=x+Math.round((C-x)*n),{css:f.toCss(a,l,u),rgba:f.toRgba(a,l,u)}},i.isOpaque=function(m){return(255&m.rgba)==255},i.ensureContrastRatio=function(m,d,c){let v=e.ensureContrastRatio(m.rgba,d.rgba,c);if(v)return f.toColor(v>>24&255,v>>16&255,v>>8&255)},i.opaque=function(m){let d=(255|m.rgba)>>>0;return[a,l,u]=e.toChannels(d),{css:f.toCss(a,l,u),rgba:d}},i.opacity=h,i.multiplyOpacity=function(m,d){return n=255&m.rgba,h(m,n*d/255)},i.toColorRGB=function(m){return[m.rgba>>24&255,m.rgba>>16&255,m.rgba>>8&255]}})(p||(t.color=p={})),(function(i){let h,m;try{let d=document.createElement("canvas");d.width=1,d.height=1;let c=d.getContext("2d",{willReadFrequently:!0});c&&(h=c,h.globalCompositeOperation="copy",m=h.createLinearGradient(0,0,1,1))}catch{}i.toColor=function(d){if(d.match(/#[\da-f]{3,8}/i))switch(d.length){case 4:return a=parseInt(d.slice(1,2).repeat(2),16),l=parseInt(d.slice(2,3).repeat(2),16),u=parseInt(d.slice(3,4).repeat(2),16),f.toColor(a,l,u);case 5:return a=parseInt(d.slice(1,2).repeat(2),16),l=parseInt(d.slice(2,3).repeat(2),16),u=parseInt(d.slice(3,4).repeat(2),16),n=parseInt(d.slice(4,5).repeat(2),16),f.toColor(a,l,u,n);case 7:return{css:d,rgba:(parseInt(d.slice(1),16)<<8|255)>>>0};case 9:return{css:d,rgba:parseInt(d.slice(1),16)>>>0}}let c=d.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(c)return a=parseInt(c[1]),l=parseInt(c[2]),u=parseInt(c[3]),n=Math.round(255*(c[5]===void 0?1:parseFloat(c[5]))),f.toColor(a,l,u,n);if(!h||!m||(h.fillStyle=m,h.fillStyle=d,typeof h.fillStyle!="string")||(h.fillRect(0,0,1,1),[a,l,u,n]=h.getImageData(0,0,1,1).data,n!==255))throw Error("css.toColor: Unsupported css format");return{rgba:f.toRgba(a,l,u,n),css:d}}})(S||(t.css=S={})),(function(i){function h(m,d,c){let v=m/255,C=d/255,k=c/255;return .2126*(v<=.03928?v/12.92:((v+.055)/1.055)**2.4)+.7152*(C<=.03928?C/12.92:((C+.055)/1.055)**2.4)+.0722*(k<=.03928?k/12.92:((k+.055)/1.055)**2.4)}i.relativeLuminance=function(m){return h(m>>16&255,m>>8&255,255&m)},i.relativeLuminance2=h})(r||(t.rgb=r={})),(function(i){function h(d,c,v){let C=d>>24&255,k=d>>16&255,D=d>>8&255,x=c>>24&255,y=c>>16&255,L=c>>8&255,M=s(r.relativeLuminance2(x,y,L),r.relativeLuminance2(C,k,D));for(;M<v&&(x>0||y>0||L>0);)x-=Math.max(0,Math.ceil(.1*x)),y-=Math.max(0,Math.ceil(.1*y)),L-=Math.max(0,Math.ceil(.1*L)),M=s(r.relativeLuminance2(x,y,L),r.relativeLuminance2(C,k,D));return(x<<24|y<<16|L<<8|255)>>>0}function m(d,c,v){let C=d>>24&255,k=d>>16&255,D=d>>8&255,x=c>>24&255,y=c>>16&255,L=c>>8&255,M=s(r.relativeLuminance2(x,y,L),r.relativeLuminance2(C,k,D));for(;M<v&&(x<255||y<255||L<255);)x=Math.min(255,x+Math.ceil(.1*(255-x))),y=Math.min(255,y+Math.ceil(.1*(255-y))),L=Math.min(255,L+Math.ceil(.1*(255-L))),M=s(r.relativeLuminance2(x,y,L),r.relativeLuminance2(C,k,D));return(x<<24|y<<16|L<<8|255)>>>0}i.blend=function(d,c){if(n=(255&c)/255,n===1)return c;let v=c>>24&255,C=c>>16&255,k=c>>8&255,D=d>>24&255,x=d>>16&255,y=d>>8&255;return a=D+Math.round((v-D)*n),l=x+Math.round((C-x)*n),u=y+Math.round((k-y)*n),f.toRgba(a,l,u)},i.ensureContrastRatio=function(d,c,v){let C=r.relativeLuminance(d>>8),k=r.relativeLuminance(c>>8);if(s(C,k)<v){if(k<C){let y=h(d,c,v),L=s(C,r.relativeLuminance(y>>8));if(L<v){let M=m(d,c,v);return L>s(C,r.relativeLuminance(M>>8))?y:M}return y}let D=m(d,c,v),x=s(C,r.relativeLuminance(D>>8));if(x<v){let y=h(d,c,v);return x>s(C,r.relativeLuminance(y>>8))?D:y}return D}},i.reduceLuminance=h,i.increaseLuminance=m,i.toChannels=function(d){return[d>>24&255,d>>16&255,d>>8&255,255&d]}})(e||(t.rgba=e={})),t.toPaddedHex=o,t.contrastRatio=s},345:(A,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.runAndSubscribe=t.forwardEvent=t.EventEmitter=void 0,t.EventEmitter=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||(this._event=a=>(this._listeners.push(a),{dispose:()=>{if(!this._disposed){for(let l=0;l<this._listeners.length;l++)if(this._listeners[l]===a)return void this._listeners.splice(l,1)}}})),this._event}fire(a,l){let u=[];for(let n=0;n<this._listeners.length;n++)u.push(this._listeners[n]);for(let n=0;n<u.length;n++)u[n].call(void 0,a,l)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},t.forwardEvent=function(a,l){return a((u=>l.fire(u)))},t.runAndSubscribe=function(a,l){return l(void 0),a((u=>l(u)))}},859:(A,t)=>{function a(l){for(let u of l)u.dispose();l.length=0}Object.defineProperty(t,"__esModule",{value:!0}),t.getDisposeArrayDisposable=t.disposeArray=t.toDisposable=t.MutableDisposable=t.Disposable=void 0,t.Disposable=class{constructor(){this._disposables=[],this._isDisposed=!1}dispose(){this._isDisposed=!0;for(let l of this._disposables)l.dispose();this._disposables.length=0}register(l){return this._disposables.push(l),l}unregister(l){let u=this._disposables.indexOf(l);u!==-1&&this._disposables.splice(u,1)}},t.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(l){var u;this._isDisposed||l===this._value||((u=this._value)==null||u.dispose(),this._value=l)}clear(){this.value=void 0}dispose(){var l;this._isDisposed=!0,(l=this._value)==null||l.dispose(),this._value=void 0}},t.toDisposable=function(l){return{dispose:l}},t.disposeArray=a,t.getDisposeArrayDisposable=function(l){return{dispose:()=>a(l)}}},485:(A,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.FourKeyMap=t.TwoKeyMap=void 0;class a{constructor(){this._data={}}set(u,n,f){this._data[u]||(this._data[u]={}),this._data[u][n]=f}get(u,n){return this._data[u]?this._data[u][n]:void 0}clear(){this._data={}}}t.TwoKeyMap=a,t.FourKeyMap=class{constructor(){this._data=new a}set(l,u,n,f,p){this._data.get(l,u)||this._data.set(l,u,new a),this._data.get(l,u).set(n,f,p)}get(l,u,n,f){var p;return(p=this._data.get(l,u))==null?void 0:p.get(n,f)}clear(){this._data.clear()}}},399:(A,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.isChromeOS=t.isLinux=t.isWindows=t.isIphone=t.isIpad=t.isMac=t.getSafariVersion=t.isSafari=t.isLegacyEdge=t.isFirefox=t.isNode=void 0,t.isNode=typeof process<"u"&&"title"in process;let a=t.isNode?"node":navigator.userAgent,l=t.isNode?"node":navigator.platform;t.isFirefox=a.includes("Firefox"),t.isLegacyEdge=a.includes("Edge"),t.isSafari=/^((?!chrome|android).)*safari/i.test(a),t.getSafariVersion=function(){if(!t.isSafari)return 0;let u=a.match(/Version\/(\d+)/);return u===null||u.length<2?0:parseInt(u[1])},t.isMac=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(l),t.isIpad=l==="iPad",t.isIphone=l==="iPhone",t.isWindows=["Windows","Win16","Win32","WinCE"].includes(l),t.isLinux=l.indexOf("Linux")>=0,t.isChromeOS=/\bCrOS\b/.test(a)},385:(A,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.DebouncedIdleTask=t.IdleTaskQueue=t.PriorityTaskQueue=void 0;let l=a(399);class u{constructor(){this._tasks=[],this._i=0}enqueue(p){this._tasks.push(p),this._start()}flush(){for(;this._i<this._tasks.length;)this._tasks[this._i]()||this._i++;this.clear()}clear(){this._idleCallback&&(this._idleCallback=(this._cancelCallback(this._idleCallback),void 0)),this._i=0,this._tasks.length=0}_start(){this._idleCallback||(this._idleCallback=this._requestCallback(this._process.bind(this)))}_process(p){this._idleCallback=void 0;let S=0,r=0,e=p.timeRemaining(),o=0;for(;this._i<this._tasks.length;){if(S=Date.now(),this._tasks[this._i]()||this._i++,S=Math.max(1,Date.now()-S),r=Math.max(S,r),o=p.timeRemaining(),1.5*r>o)return e-S<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(e-S))}ms`),void this._start();e=o}this.clear()}}class n extends u{_requestCallback(p){return setTimeout((()=>p(this._createDeadline(16))))}_cancelCallback(p){clearTimeout(p)}_createDeadline(p){let S=Date.now()+p;return{timeRemaining:()=>Math.max(0,S-Date.now())}}}t.PriorityTaskQueue=n,t.IdleTaskQueue=!l.isNode&&"requestIdleCallback"in window?class extends u{_requestCallback(f){return requestIdleCallback(f)}_cancelCallback(f){cancelIdleCallback(f)}}:n,t.DebouncedIdleTask=class{constructor(){this._queue=new t.IdleTaskQueue}set(f){this._queue.clear(),this._queue.enqueue(f)}flush(){this._queue.flush()}}},147:(A,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ExtendedAttrs=t.AttributeData=void 0;class a{constructor(){this.fg=0,this.bg=0,this.extended=new l}static toColorRGB(n){return[n>>>16&255,n>>>8&255,255&n]}static fromColorRGB(n){return(255&n[0])<<16|(255&n[1])<<8|255&n[2]}clone(){let n=new a;return n.fg=this.fg,n.bg=this.bg,n.extended=this.extended.clone(),n}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}}t.AttributeData=a;class l{get ext(){return this._urlId?-469762049&this._ext|this.underlineStyle<<26:this._ext}set ext(n){this._ext=n}get underlineStyle(){return this._urlId?5:(469762048&this._ext)>>26}set underlineStyle(n){this._ext&=-469762049,this._ext|=n<<26&469762048}get underlineColor(){return 67108863&this._ext}set underlineColor(n){this._ext&=-67108864,this._ext|=67108863&n}get urlId(){return this._urlId}set urlId(n){this._urlId=n}get underlineVariantOffset(){let n=(3758096384&this._ext)>>29;return n<0?4294967288^n:n}set underlineVariantOffset(n){this._ext&=536870911,this._ext|=n<<29&3758096384}constructor(n=0,f=0){this._ext=0,this._urlId=0,this._ext=n,this._urlId=f}clone(){return new l(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}}t.ExtendedAttrs=l},782:(A,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CellData=void 0;let l=a(133),u=a(855),n=a(147);class f extends n.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new n.ExtendedAttrs,this.combinedData=""}static fromCharData(S){let r=new f;return r.setFromCharData(S),r}isCombined(){return 2097152&this.content}getWidth(){return this.content>>22}getChars(){return 2097152&this.content?this.combinedData:2097151&this.content?(0,l.stringFromCodePoint)(2097151&this.content):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content}setFromCharData(S){this.fg=S[u.CHAR_DATA_ATTR_INDEX],this.bg=0;let r=!1;if(S[u.CHAR_DATA_CHAR_INDEX].length>2)r=!0;else if(S[u.CHAR_DATA_CHAR_INDEX].length===2){let e=S[u.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=e&&e<=56319){let o=S[u.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=o&&o<=57343?this.content=1024*(e-55296)+o-56320+65536|S[u.CHAR_DATA_WIDTH_INDEX]<<22:r=!0}else r=!0}else this.content=S[u.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|S[u.CHAR_DATA_WIDTH_INDEX]<<22;r&&(this.combinedData=S[u.CHAR_DATA_CHAR_INDEX],this.content=2097152|S[u.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}t.CellData=f},855:(A,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.WHITESPACE_CELL_CODE=t.WHITESPACE_CELL_WIDTH=t.WHITESPACE_CELL_CHAR=t.NULL_CELL_CODE=t.NULL_CELL_WIDTH=t.NULL_CELL_CHAR=t.CHAR_DATA_CODE_INDEX=t.CHAR_DATA_WIDTH_INDEX=t.CHAR_DATA_CHAR_INDEX=t.CHAR_DATA_ATTR_INDEX=t.DEFAULT_EXT=t.DEFAULT_ATTR=t.DEFAULT_COLOR=void 0,t.DEFAULT_COLOR=0,t.DEFAULT_ATTR=256|t.DEFAULT_COLOR<<9,t.DEFAULT_EXT=0,t.CHAR_DATA_ATTR_INDEX=0,t.CHAR_DATA_CHAR_INDEX=1,t.CHAR_DATA_WIDTH_INDEX=2,t.CHAR_DATA_CODE_INDEX=3,t.NULL_CELL_CHAR="",t.NULL_CELL_WIDTH=1,t.NULL_CELL_CODE=0,t.WHITESPACE_CELL_CHAR=" ",t.WHITESPACE_CELL_WIDTH=1,t.WHITESPACE_CELL_CODE=32},133:(A,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Utf8ToUtf32=t.StringToUtf32=t.utf32ToString=t.stringFromCodePoint=void 0,t.stringFromCodePoint=function(a){return a>65535?(a-=65536,String.fromCharCode(55296+(a>>10))+String.fromCharCode(a%1024+56320)):String.fromCharCode(a)},t.utf32ToString=function(a,l=0,u=a.length){let n="";for(let f=l;f<u;++f){let p=a[f];p>65535?(p-=65536,n+=String.fromCharCode(55296+(p>>10))+String.fromCharCode(p%1024+56320)):n+=String.fromCharCode(p)}return n},t.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(a,l){let u=a.length;if(!u)return 0;let n=0,f=0;if(this._interim){let p=a.charCodeAt(f++);56320<=p&&p<=57343?l[n++]=1024*(this._interim-55296)+p-56320+65536:(l[n++]=this._interim,l[n++]=p),this._interim=0}for(let p=f;p<u;++p){let S=a.charCodeAt(p);if(55296<=S&&S<=56319){if(++p>=u)return this._interim=S,n;let r=a.charCodeAt(p);56320<=r&&r<=57343?l[n++]=1024*(S-55296)+r-56320+65536:(l[n++]=S,l[n++]=r)}else S!==65279&&(l[n++]=S)}return n}},t.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(a,l){let u=a.length;if(!u)return 0;let n,f,p,S,r=0,e=0,o=0;if(this.interim[0]){let h=!1,m=this.interim[0];m&=(224&m)==192?31:(240&m)==224?15:7;let d,c=0;for(;(d=63&this.interim[++c])&&c<4;)m<<=6,m|=d;let v=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,C=v-c;for(;o<C;){if(o>=u)return 0;if(d=a[o++],(192&d)!=128){o--,h=!0;break}this.interim[c++]=d,m<<=6,m|=63&d}h||(v===2?m<128?o--:l[r++]=m:v===3?m<2048||m>=55296&&m<=57343||m===65279||(l[r++]=m):m<65536||m>1114111||(l[r++]=m)),this.interim.fill(0)}let s=u-4,i=o;for(;i<u;){for(;!(!(i<s)||128&(n=a[i])||128&(f=a[i+1])||128&(p=a[i+2])||128&(S=a[i+3]));)l[r++]=n,l[r++]=f,l[r++]=p,l[r++]=S,i+=4;if(n=a[i++],n<128)l[r++]=n;else if((224&n)==192){if(i>=u)return this.interim[0]=n,r;if(f=a[i++],(192&f)!=128){i--;continue}if(e=(31&n)<<6|63&f,e<128){i--;continue}l[r++]=e}else if((240&n)==224){if(i>=u)return this.interim[0]=n,r;if(f=a[i++],(192&f)!=128){i--;continue}if(i>=u)return this.interim[0]=n,this.interim[1]=f,r;if(p=a[i++],(192&p)!=128){i--;continue}if(e=(15&n)<<12|(63&f)<<6|63&p,e<2048||e>=55296&&e<=57343||e===65279)continue;l[r++]=e}else if((248&n)==240){if(i>=u)return this.interim[0]=n,r;if(f=a[i++],(192&f)!=128){i--;continue}if(i>=u)return this.interim[0]=n,this.interim[1]=f,r;if(p=a[i++],(192&p)!=128){i--;continue}if(i>=u)return this.interim[0]=n,this.interim[1]=f,this.interim[2]=p,r;if(S=a[i++],(192&S)!=128){i--;continue}if(e=(7&n)<<18|(63&f)<<12|(63&p)<<6|63&S,e<65536||e>1114111)continue;l[r++]=e}}return r}}},776:function(A,t,a){var l=this&&this.__decorate||function(e,o,s,i){var h,m=arguments.length,d=m<3?o:i===null?i=Object.getOwnPropertyDescriptor(o,s):i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")d=Reflect.decorate(e,o,s,i);else for(var c=e.length-1;c>=0;c--)(h=e[c])&&(d=(m<3?h(d):m>3?h(o,s,d):h(o,s))||d);return m>3&&d&&Object.defineProperty(o,s,d),d},u=this&&this.__param||function(e,o){return function(s,i){o(s,i,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.traceCall=t.setTraceLogger=t.LogService=void 0;let n=a(859),f=a(97),p={trace:f.LogLevelEnum.TRACE,debug:f.LogLevelEnum.DEBUG,info:f.LogLevelEnum.INFO,warn:f.LogLevelEnum.WARN,error:f.LogLevelEnum.ERROR,off:f.LogLevelEnum.OFF},S,r=t.LogService=class extends n.Disposable{get logLevel(){return this._logLevel}constructor(e){super(),this._optionsService=e,this._logLevel=f.LogLevelEnum.OFF,this._updateLogLevel(),this.register(this._optionsService.onSpecificOptionChange("logLevel",(()=>this._updateLogLevel()))),S=this}_updateLogLevel(){this._logLevel=p[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(e){for(let o=0;o<e.length;o++)typeof e[o]=="function"&&(e[o]=e[o]())}_log(e,o,s){this._evalLazyOptionalParams(s),e.call(console,(this._optionsService.options.logger?"":"xterm.js: ")+o,...s)}trace(e,...o){var s;this._logLevel<=f.LogLevelEnum.TRACE&&this._log(((s=this._optionsService.options.logger)==null?void 0:s.trace.bind(this._optionsService.options.logger))??console.log,e,o)}debug(e,...o){var s;this._logLevel<=f.LogLevelEnum.DEBUG&&this._log(((s=this._optionsService.options.logger)==null?void 0:s.debug.bind(this._optionsService.options.logger))??console.log,e,o)}info(e,...o){var s;this._logLevel<=f.LogLevelEnum.INFO&&this._log(((s=this._optionsService.options.logger)==null?void 0:s.info.bind(this._optionsService.options.logger))??console.info,e,o)}warn(e,...o){var s;this._logLevel<=f.LogLevelEnum.WARN&&this._log(((s=this._optionsService.options.logger)==null?void 0:s.warn.bind(this._optionsService.options.logger))??console.warn,e,o)}error(e,...o){var s;this._logLevel<=f.LogLevelEnum.ERROR&&this._log(((s=this._optionsService.options.logger)==null?void 0:s.error.bind(this._optionsService.options.logger))??console.error,e,o)}};t.LogService=r=l([u(0,f.IOptionsService)],r),t.setTraceLogger=function(e){S=e},t.traceCall=function(e,o,s){if(typeof s.value!="function")throw Error("not supported");let i=s.value;s.value=function(...h){if(S.logLevel!==f.LogLevelEnum.TRACE)return i.apply(this,h);S.trace(`GlyphRenderer#${i.name}(${h.map((d=>JSON.stringify(d))).join(", ")})`);let m=i.apply(this,h);return S.trace(`GlyphRenderer#${i.name} return`,m),m}}},726:(A,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.createDecorator=t.getServiceDependencies=t.serviceRegistry=void 0;let a="di$target",l="di$dependencies";t.serviceRegistry=new Map,t.getServiceDependencies=function(u){return u[l]||[]},t.createDecorator=function(u){if(t.serviceRegistry.has(u))return t.serviceRegistry.get(u);let n=function(f,p,S){if(arguments.length!==3)throw Error("@IServiceName-decorator can only be used to decorate a parameter");(function(r,e,o){e[a]===e?e[l].push({id:r,index:o}):(e[l]=[{id:r,index:o}],e[a]=e)})(n,f,S)};return n.toString=()=>u,t.serviceRegistry.set(u,n),n}},97:(A,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.IDecorationService=t.IUnicodeService=t.IOscLinkService=t.IOptionsService=t.ILogService=t.LogLevelEnum=t.IInstantiationService=t.ICharsetService=t.ICoreService=t.ICoreMouseService=t.IBufferService=void 0;let l=a(726);var u;t.IBufferService=(0,l.createDecorator)("BufferService"),t.ICoreMouseService=(0,l.createDecorator)("CoreMouseService"),t.ICoreService=(0,l.createDecorator)("CoreService"),t.ICharsetService=(0,l.createDecorator)("CharsetService"),t.IInstantiationService=(0,l.createDecorator)("InstantiationService"),(function(n){n[n.TRACE=0]="TRACE",n[n.DEBUG=1]="DEBUG",n[n.INFO=2]="INFO",n[n.WARN=3]="WARN",n[n.ERROR=4]="ERROR",n[n.OFF=5]="OFF"})(u||(t.LogLevelEnum=u={})),t.ILogService=(0,l.createDecorator)("LogService"),t.IOptionsService=(0,l.createDecorator)("OptionsService"),t.IOscLinkService=(0,l.createDecorator)("OscLinkService"),t.IUnicodeService=(0,l.createDecorator)("UnicodeService"),t.IDecorationService=(0,l.createDecorator)("DecorationService")}},E={};function T(A){var t=E[A];if(t!==void 0)return t.exports;var a=E[A]={exports:{}};return b[A].call(a.exports,a,a.exports,T),a.exports}var N={};return(()=>{var A=N;Object.defineProperty(A,"__esModule",{value:!0}),A.CanvasAddon=void 0;let t=T(345),a=T(859),l=T(776),u=T(949);class n extends a.Disposable{constructor(){super(...arguments),this._onChangeTextureAtlas=this.register(new t.EventEmitter),this.onChangeTextureAtlas=this._onChangeTextureAtlas.event,this._onAddTextureAtlasCanvas=this.register(new t.EventEmitter),this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event}get textureAtlas(){var p;return(p=this._renderer)==null?void 0:p.textureAtlas}activate(p){let S=p._core;if(!p.element)return void this.register(S.onWillOpen((()=>this.activate(p))));this._terminal=p;let r=S.coreService,e=S.optionsService,o=S.screenElement,s=S.linkifier,i=S,h=i._bufferService,m=i._renderService,d=i._characterJoinerService,c=i._charSizeService,v=i._coreBrowserService,C=i._decorationService,k=i._logService,D=i._themeService;(0,l.setTraceLogger)(k),this._renderer=new u.CanvasRenderer(p,o,s,h,c,e,d,r,v,C,D),this.register((0,t.forwardEvent)(this._renderer.onChangeTextureAtlas,this._onChangeTextureAtlas)),this.register((0,t.forwardEvent)(this._renderer.onAddTextureAtlasCanvas,this._onAddTextureAtlasCanvas)),m.setRenderer(this._renderer),m.handleResize(h.cols,h.rows),this.register((0,a.toDisposable)((()=>{var x;m.setRenderer(this._terminal._core._createRenderer()),m.handleResize(p.cols,p.rows),(x=this._renderer)==null||x.dispose(),this._renderer=void 0})))}clearTextureAtlas(){var p;(p=this._renderer)==null||p.clearTextureAtlas()}}A.CanvasAddon=n})(),N})()))}))(),Ui=2,zi=1,ji=class{activate(g){this._terminal=g}dispose(){}fit(){let g=this.proposeDimensions();if(!g||!this._terminal||isNaN(g.cols)||isNaN(g.rows))return;let _=this._terminal._core;(this._terminal.rows!==g.rows||this._terminal.cols!==g.cols)&&(_._renderService.clear(),this._terminal.resize(g.cols,g.rows))}proposeDimensions(){var n;if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;let g=this._terminal._core._renderService.dimensions;if(g.css.cell.width===0||g.css.cell.height===0)return;let _=this._terminal.options.scrollback===0?0:((n=this._terminal.options.overviewRuler)==null?void 0:n.width)||14,b=window.getComputedStyle(this._terminal.element.parentElement),E=parseInt(b.getPropertyValue("height")),T=Math.max(0,parseInt(b.getPropertyValue("width"))),N=window.getComputedStyle(this._terminal.element),A={top:parseInt(N.getPropertyValue("padding-top")),bottom:parseInt(N.getPropertyValue("padding-bottom")),right:parseInt(N.getPropertyValue("padding-right")),left:parseInt(N.getPropertyValue("padding-left"))},t=A.top+A.bottom,a=A.right+A.left,l=E-t,u=T-a-_;return{cols:Math.max(Ui,Math.floor(u/g.css.cell.width)),rows:Math.max(zi,Math.floor(l/g.css.cell.height))}}},qi=new class{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(g){setTimeout(()=>{throw g.stack?Bt.isErrorNoTelemetry(g)?new Bt(g.message+`
2
2
 
3
3
  `+g.stack):Error(g.message+`
4
4