@tangle-network/sandbox-cli 0.21.63 → 0.21.65

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 (136) hide show
  1. package/README.md +31 -3
  2. package/SKILL.md +29 -1
  3. package/dist/graph-native-CS_TmaCK.mjs +1 -0
  4. package/dist/graph-viewer/Analytics-bWsqhurt.js +1001 -0
  5. package/dist/graph-viewer/{AnswerStrip-DhwqOyxI.js → AnswerStrip-COxV7gLW.js} +2 -2
  6. package/dist/graph-viewer/Checks-CQGmKcQ0.js +164 -0
  7. package/dist/graph-viewer/Conversations-DgCshBAf.js +627 -0
  8. package/dist/graph-viewer/{Files-DtZhf0ii.js → Files-CvIOGrAs.js} +81 -90
  9. package/dist/graph-viewer/LiveRun-DHmsr6F7.js +311 -0
  10. package/dist/graph-viewer/{Outputs-QET3nPPp.js → Outputs-rwBg_x36.js} +4 -4
  11. package/dist/graph-viewer/Overview-C150tkVa.js +194 -0
  12. package/dist/graph-viewer/{RunOverview-DJQDAMIx.js → RunOverview-CSqsunqf.js} +2 -2
  13. package/dist/graph-viewer/RunPage-F_prVwiV.js +286 -0
  14. package/dist/graph-viewer/Timeline-BFDywlmz.js +335 -0
  15. package/dist/graph-viewer/Today-BdDuqZGF.js +623 -0
  16. package/dist/graph-viewer/Topology-SAfGtd5u.js +238 -0
  17. package/dist/graph-viewer/Traces-BYqXaS_s.js +254 -0
  18. package/dist/graph-viewer/{WallPages-4d9QUZDq.js → WallPages-MM70VZrC.js} +48 -30
  19. package/dist/graph-viewer/agent-runtime.js +55 -55
  20. package/dist/graph-viewer/{data-BJmP7F1M.js → data-DTGmre1W.js} +31 -27
  21. package/dist/graph-viewer/harness-sessions.js +1 -1
  22. package/dist/graph-viewer/index.js +1357 -1392
  23. package/dist/graph-viewer/{lazy-pages-DM0cZM10.js → lazy-pages-BYuq_L_n.js} +9 -5
  24. package/dist/graph-viewer/{outputs-model-CGdvjkQh.js → outputs-model-CHTx8rMz.js} +2 -2
  25. package/dist/graph-viewer/{viewer/plain-words-CgvxtEOa.js → plain-words-BrMHl0On.js} +9 -4
  26. package/dist/graph-viewer/receipt.js +2 -2
  27. package/dist/graph-viewer/record-CsP_3NJS.js +612 -0
  28. package/dist/graph-viewer/record-part-CuT9Xw37.js +334 -0
  29. package/dist/graph-viewer/record.js +2 -336
  30. package/dist/graph-viewer/report-viewer.js +65 -65
  31. package/dist/graph-viewer/report.js +1 -1
  32. package/dist/graph-viewer/research-publication.js +1 -1
  33. package/dist/graph-viewer/{run-files-C1NgzM0l.js → run-files-BckQDdTD.js} +1 -1
  34. package/dist/graph-viewer/{run-receipt-Bvi4-KVM.js → run-receipt-Bt2iXJUy.js} +1 -0
  35. package/dist/graph-viewer/schemas/agent-workspace.play.v1.json +3 -0
  36. package/dist/graph-viewer/schemas/agent-workspace.plays.v1.json +2 -0
  37. package/dist/graph-viewer/schemas/agent-workspace.run.v1.json +1 -0
  38. package/dist/graph-viewer/styles.css +4559 -2385
  39. package/dist/graph-viewer/trace-spans.js +1 -1
  40. package/dist/graph-viewer/ui-xa5w5bEN.js +889 -0
  41. package/dist/graph-viewer/viewer/{AgentGraphCanvas-CMdOlSlh-4EervjeC.js → AgentGraphCanvas-B74GN1o6-BZEumF7-.js} +2610 -2707
  42. package/dist/graph-viewer/viewer/Analytics-E3XS570U.js +1002 -0
  43. package/dist/graph-viewer/viewer/{AnswerStrip-CGUyXuYH.js → AnswerStrip-B7xMU57A.js} +2 -2
  44. package/dist/graph-viewer/viewer/Checks-CJ5XSHbv.js +165 -0
  45. package/dist/graph-viewer/viewer/Conversations-AX8G7Qyl.js +904 -0
  46. package/dist/graph-viewer/viewer/Files-DxL1576V.js +630 -0
  47. package/dist/graph-viewer/viewer/LiveRun-B-BckyEj.js +820 -0
  48. package/dist/graph-viewer/viewer/{Outputs-CumGyjQo.js → Outputs-BoIpgfMv.js} +24 -23
  49. package/dist/graph-viewer/viewer/Overview-Dzg5XJgy.js +436 -0
  50. package/dist/graph-viewer/viewer/RunPage-NtevWXBs.js +285 -0
  51. package/dist/graph-viewer/viewer/{Scores-ZS16yk0n.js → Scores-Dgv4WePL.js} +3 -3
  52. package/dist/graph-viewer/viewer/Timeline-CzY3LVDu.js +335 -0
  53. package/dist/graph-viewer/viewer/Today-Bi9IIwuh.js +623 -0
  54. package/dist/graph-viewer/viewer/Topology-CzjqSFXH.js +239 -0
  55. package/dist/graph-viewer/viewer/Traces-CMX0H1VU.js +254 -0
  56. package/dist/graph-viewer/viewer/{WallPages-CzWpyIfp.js → WallPages-Clj4bORg.js} +50 -32
  57. package/dist/graph-viewer/viewer/addon-webgl-BSCscllv.js +4027 -0
  58. package/dist/graph-viewer/viewer/agent-record-BrP-ENHg.css +2 -0
  59. package/dist/graph-viewer/viewer/{bot-D6Nrej7Z.js → bot-BaQU59LG.js} +1 -1
  60. package/dist/graph-viewer/viewer/{chevron-right-D_5IKLxu.js → chevron-right-Xn05jYLT.js} +1 -1
  61. package/dist/graph-viewer/viewer/{createLucideIcon-yH0cxLMy.js → createLucideIcon-BSphcoOJ.js} +1 -1
  62. package/dist/graph-viewer/viewer/dashboard-D3JhmRhe-DSl0zhkw.js +371 -0
  63. package/dist/graph-viewer/viewer/{data-CkWfWr7i.js → data-CVHeKhrh.js} +144 -139
  64. package/dist/graph-viewer/viewer/dist-4_KJz8ZM.js +349 -0
  65. package/dist/graph-viewer/viewer/dist-Dy-wrdTt.js +1615 -0
  66. package/dist/graph-viewer/viewer/es2015-utW4DTOJ.js +3506 -0
  67. package/dist/graph-viewer/viewer/{final-output-kwY11u9X.js → final-output-BYT-g-9j.js} +1 -1
  68. package/dist/graph-viewer/viewer/flow-waterfall-model-DvrgPLGS-BdThSFH-.js +2696 -0
  69. package/dist/graph-viewer/viewer/git-branch-BzTbIcYL.js +28 -0
  70. package/dist/graph-viewer/viewer/{highlights-Btsi5OXl.js → highlights-DWeSCtiR.js} +4 -4
  71. package/dist/graph-viewer/viewer/jsx-runtime-DPT6sCLq.js +319 -0
  72. package/dist/graph-viewer/viewer/lazy-pages-ChiMJ8r_.js +803 -0
  73. package/dist/graph-viewer/viewer/{markdown-CX_sVrXB.js → markdown-lADwhD7y.js} +2324 -2608
  74. package/dist/graph-viewer/viewer/model-brand-bTcMjQtB-RSb7EbGB.js +476 -0
  75. package/dist/graph-viewer/viewer/{page-header-Brq611fd.js → page-header-QbUg8F8i.js} +12 -11
  76. package/dist/graph-viewer/{plain-words-CgvxtEOa.js → viewer/plain-words-BrMHl0On.js} +9 -4
  77. package/dist/graph-viewer/viewer/primitives-znfPK9NP-B6UO7uDr.js +346 -0
  78. package/dist/graph-viewer/viewer/react-DQ7E2Epi.js +4254 -0
  79. package/dist/graph-viewer/viewer/{react-dom-t1L4_-il.js → react-dom-BEusmvQH.js} +1 -1
  80. package/dist/graph-viewer/viewer/record-DZnT6SWN-H-ul3U3a.js +3523 -0
  81. package/dist/graph-viewer/viewer/record-W39D5MO-.js +1 -0
  82. package/dist/graph-viewer/viewer/record-part-CbweyYoV.js +335 -0
  83. package/dist/graph-viewer/viewer/{segmented-control-BaJmvTNd.js → segmented-control-Di1mbQlP.js} +27 -26
  84. package/dist/graph-viewer/viewer/{shiki-Qnby7Sh6.js → shiki-BfNNlmfZ.js} +15 -15
  85. package/dist/graph-viewer/viewer/status-meta-S0kV_RDp.js +273 -0
  86. package/dist/graph-viewer/viewer/{stream-tokenizer-CWtnjmRd.js → stream-tokenizer-B5wWaM3U.js} +12 -12
  87. package/dist/graph-viewer/viewer/{themes-1i1fzpRk.js → themes-DuRxHiga.js} +1 -1
  88. package/dist/graph-viewer/viewer/ui-Co03nZUX.js +889 -0
  89. package/dist/graph-viewer/viewer/utils-BuObIC0n.js +1815 -0
  90. package/dist/graph-viewer/viewer/workbench-E6_5q_oL.js +28351 -0
  91. package/dist/graph-viewer/viewer/workflows--mZpHYqo.js +3298 -0
  92. package/dist/graph-viewer/viewer/workspace-cKs9sGEO.js +2468 -0
  93. package/dist/graph-viewer/{workspace-model-Ewf17pTW.js → workspace-model-BkPl_J8E.js} +1 -1
  94. package/dist/graph-viewer/workspace-viewer.js +7452 -7489
  95. package/dist/graph-viewer/workspace.js +1 -1
  96. package/dist/index.mjs +27 -22
  97. package/package.json +10 -9
  98. package/dist/graph-viewer/Analytics-DFWW8Phh.js +0 -938
  99. package/dist/graph-viewer/Checks-qgqV4xgV.js +0 -155
  100. package/dist/graph-viewer/Conversations-CGB45kpj.js +0 -545
  101. package/dist/graph-viewer/LiveRun-C21wUKAY.js +0 -210
  102. package/dist/graph-viewer/Overview-BjeLsA2I.js +0 -506
  103. package/dist/graph-viewer/RunPage-CkkcBEUe.js +0 -258
  104. package/dist/graph-viewer/Timeline-C2Xolk0t.js +0 -293
  105. package/dist/graph-viewer/Today-BVVDtSVN.js +0 -660
  106. package/dist/graph-viewer/Topology-DO5XX8e4.js +0 -545
  107. package/dist/graph-viewer/Traces-BhMxjNgw.js +0 -259
  108. package/dist/graph-viewer/part-events-BrLrg_EV.js +0 -276
  109. package/dist/graph-viewer/record-part-CZal_IMH.js +0 -1408
  110. package/dist/graph-viewer/ui-D8QZRsC3.js +0 -938
  111. package/dist/graph-viewer/viewer/Analytics-DD__nbLm.js +0 -939
  112. package/dist/graph-viewer/viewer/Checks-Ds5M7eAW.js +0 -156
  113. package/dist/graph-viewer/viewer/Conversations-C1n0EBBd.js +0 -819
  114. package/dist/graph-viewer/viewer/Files-Cjr7NMU_.js +0 -448
  115. package/dist/graph-viewer/viewer/LiveRun-uPTkPSjo.js +0 -6772
  116. package/dist/graph-viewer/viewer/Overview-4Umk14_2.js +0 -507
  117. package/dist/graph-viewer/viewer/RunPage-DZlBW7Va.js +0 -257
  118. package/dist/graph-viewer/viewer/Timeline-BnK6-yBR.js +0 -294
  119. package/dist/graph-viewer/viewer/Today-a_-oNigi.js +0 -660
  120. package/dist/graph-viewer/viewer/Topology-CQPCLQT6.js +0 -546
  121. package/dist/graph-viewer/viewer/Traces-C0IGk0L4.js +0 -259
  122. package/dist/graph-viewer/viewer/WorkflowGraph-DZ3xejKE-jRXKeSrg.js +0 -1559
  123. package/dist/graph-viewer/viewer/agent-record-Dw772ROs.css +0 -2
  124. package/dist/graph-viewer/viewer/agent-timeline-Cs9Qbpvo.js +0 -1798
  125. package/dist/graph-viewer/viewer/dist-C1-7EfoW.js +0 -488
  126. package/dist/graph-viewer/viewer/file-text-m7a3piQF.js +0 -47
  127. package/dist/graph-viewer/viewer/jsx-runtime-DQWyJOhv.js +0 -2136
  128. package/dist/graph-viewer/viewer/lazy-pages-BowaGsg-.js +0 -20
  129. package/dist/graph-viewer/viewer/model-brand-bTcMjQtB-fagiBQam.js +0 -723
  130. package/dist/graph-viewer/viewer/popover-CvOAjlnk.js +0 -5329
  131. package/dist/graph-viewer/viewer/react-CY3IbSNO.js +0 -4262
  132. package/dist/graph-viewer/viewer/record-part-D3_Anfpe.js +0 -1329
  133. package/dist/graph-viewer/viewer/terminal-83J_I4Ne.js +0 -52
  134. package/dist/graph-viewer/viewer/ui-C9b1rIUH.js +0 -938
  135. package/dist/graph-viewer/viewer/workspace-CekmOBs3.js +0 -25100
  136. package/dist/graph-viewer/viewer/x-DOc2URqZ.js +0 -56
@@ -0,0 +1,4027 @@
1
+ //#region node_modules/.pnpm/@xterm+addon-webgl@0.19.0/node_modules/@xterm/addon-webgl/lib/addon-webgl.mjs
2
+ var e = Object.defineProperty, t = Object.getOwnPropertyDescriptor, n = (n, r, i, a) => {
3
+ for (var o = a > 1 ? void 0 : a ? t(r, i) : r, s = n.length - 1, c; s >= 0; s--) (c = n[s]) && (o = (a ? c(r, i, o) : c(o)) || o);
4
+ return a && o && e(r, i, o), o;
5
+ }, r = (e, t) => (n, r) => t(n, r, e), i = new class {
6
+ constructor() {
7
+ this.listeners = [], this.unexpectedErrorHandler = function(e) {
8
+ setTimeout(() => {
9
+ throw e.stack ? l.isErrorNoTelemetry(e) ? new l(e.message + "\n\n" + e.stack) : /* @__PURE__ */ Error(e.message + "\n\n" + e.stack) : e;
10
+ }, 0);
11
+ };
12
+ }
13
+ addListener(e) {
14
+ return this.listeners.push(e), () => {
15
+ this._removeListener(e);
16
+ };
17
+ }
18
+ emit(e) {
19
+ this.listeners.forEach((t) => {
20
+ t(e);
21
+ });
22
+ }
23
+ _removeListener(e) {
24
+ this.listeners.splice(this.listeners.indexOf(e), 1);
25
+ }
26
+ setUnexpectedErrorHandler(e) {
27
+ this.unexpectedErrorHandler = e;
28
+ }
29
+ getUnexpectedErrorHandler() {
30
+ return this.unexpectedErrorHandler;
31
+ }
32
+ onUnexpectedError(e) {
33
+ this.unexpectedErrorHandler(e), this.emit(e);
34
+ }
35
+ onUnexpectedExternalError(e) {
36
+ this.unexpectedErrorHandler(e);
37
+ }
38
+ }();
39
+ function a(e) {
40
+ s(e) || i.onUnexpectedError(e);
41
+ }
42
+ var o = "Canceled";
43
+ function s(e) {
44
+ return e instanceof c || e instanceof Error && e.name === o && e.message === o;
45
+ }
46
+ var c = class extends Error {
47
+ constructor() {
48
+ super(o), this.name = this.message;
49
+ }
50
+ }, l = class e extends Error {
51
+ constructor(e) {
52
+ super(e), this.name = "CodeExpectedError";
53
+ }
54
+ static fromError(t) {
55
+ if (t instanceof e) return t;
56
+ let n = new e();
57
+ return n.message = t.message, n.stack = t.stack, n;
58
+ }
59
+ static isErrorNoTelemetry(e) {
60
+ return e.name === "CodeExpectedError";
61
+ }
62
+ }, u;
63
+ ((e) => {
64
+ function t(e) {
65
+ return e < 0;
66
+ }
67
+ e.isLessThan = t;
68
+ function n(e) {
69
+ return e <= 0;
70
+ }
71
+ e.isLessThanOrEqual = n;
72
+ function r(e) {
73
+ return e > 0;
74
+ }
75
+ e.isGreaterThan = r;
76
+ function i(e) {
77
+ return e === 0;
78
+ }
79
+ e.isNeitherLessOrGreaterThan = i, e.greaterThan = 1, e.lessThan = -1, e.neitherLessOrGreaterThan = 0;
80
+ })(u ||= {});
81
+ var d = class e {
82
+ constructor(e) {
83
+ this.iterate = e;
84
+ }
85
+ forEach(e) {
86
+ this.iterate((t) => (e(t), !0));
87
+ }
88
+ toArray() {
89
+ let e = [];
90
+ return this.iterate((t) => (e.push(t), !0)), e;
91
+ }
92
+ filter(t) {
93
+ return new e((e) => this.iterate((n) => !t(n) || e(n)));
94
+ }
95
+ map(t) {
96
+ return new e((e) => this.iterate((n) => e(t(n))));
97
+ }
98
+ some(e) {
99
+ let t = !1;
100
+ return this.iterate((n) => (t = e(n), !t)), t;
101
+ }
102
+ findFirst(e) {
103
+ let t;
104
+ return this.iterate((n) => !e(n) || (t = n, !1)), t;
105
+ }
106
+ findLast(e) {
107
+ let t;
108
+ return this.iterate((n) => (e(n) && (t = n), !0)), t;
109
+ }
110
+ findLastMaxBy(e) {
111
+ let t, n = !0;
112
+ return this.iterate((r) => ((n || u.isGreaterThan(e(r, t))) && (n = !1, t = r), !0)), t;
113
+ }
114
+ };
115
+ d.empty = new d((e) => {});
116
+ function f(e, t) {
117
+ let n = this, r = !1, i;
118
+ return function() {
119
+ if (r) return i;
120
+ if (r = !0, t) try {
121
+ i = e.apply(n, arguments);
122
+ } finally {
123
+ t();
124
+ }
125
+ else i = e.apply(n, arguments);
126
+ return i;
127
+ };
128
+ }
129
+ var p;
130
+ ((e) => {
131
+ function t(e) {
132
+ return e && typeof e == "object" && typeof e[Symbol.iterator] == "function";
133
+ }
134
+ e.is = t;
135
+ let n = Object.freeze([]);
136
+ function r() {
137
+ return n;
138
+ }
139
+ e.empty = r;
140
+ function* i(e) {
141
+ yield e;
142
+ }
143
+ e.single = i;
144
+ function a(e) {
145
+ return t(e) ? e : i(e);
146
+ }
147
+ e.wrap = a;
148
+ function o(e) {
149
+ return e || n;
150
+ }
151
+ e.from = o;
152
+ function* s(e) {
153
+ for (let t = e.length - 1; t >= 0; t--) yield e[t];
154
+ }
155
+ e.reverse = s;
156
+ function c(e) {
157
+ return !e || e[Symbol.iterator]().next().done === !0;
158
+ }
159
+ e.isEmpty = c;
160
+ function l(e) {
161
+ return e[Symbol.iterator]().next().value;
162
+ }
163
+ e.first = l;
164
+ function u(e, t) {
165
+ let n = 0;
166
+ for (let r of e) if (t(r, n++)) return !0;
167
+ return !1;
168
+ }
169
+ e.some = u;
170
+ function d(e, t) {
171
+ for (let n of e) if (t(n)) return n;
172
+ }
173
+ e.find = d;
174
+ function* f(e, t) {
175
+ for (let n of e) t(n) && (yield n);
176
+ }
177
+ e.filter = f;
178
+ function* p(e, t) {
179
+ let n = 0;
180
+ for (let r of e) yield t(r, n++);
181
+ }
182
+ e.map = p;
183
+ function* m(e, t) {
184
+ let n = 0;
185
+ for (let r of e) yield* t(r, n++);
186
+ }
187
+ e.flatMap = m;
188
+ function* h(...e) {
189
+ for (let t of e) yield* t;
190
+ }
191
+ e.concat = h;
192
+ function g(e, t, n) {
193
+ let r = n;
194
+ for (let n of e) r = t(r, n);
195
+ return r;
196
+ }
197
+ e.reduce = g;
198
+ function* _(e, t, n = e.length) {
199
+ for (t < 0 && (t += e.length), n < 0 ? n += e.length : n > e.length && (n = e.length); t < n; t++) yield e[t];
200
+ }
201
+ e.slice = _;
202
+ function v(t, n = Infinity) {
203
+ let r = [];
204
+ if (n === 0) return [r, t];
205
+ let i = t[Symbol.iterator]();
206
+ for (let t = 0; t < n; t++) {
207
+ let t = i.next();
208
+ if (t.done) return [r, e.empty()];
209
+ r.push(t.value);
210
+ }
211
+ return [r, { [Symbol.iterator]() {
212
+ return i;
213
+ } }];
214
+ }
215
+ e.consume = v;
216
+ async function y(e) {
217
+ let t = [];
218
+ for await (let n of e) t.push(n);
219
+ return Promise.resolve(t);
220
+ }
221
+ e.asyncToArray = y;
222
+ })(p ||= {});
223
+ var m = null;
224
+ function h(e) {
225
+ return m?.trackDisposable(e), e;
226
+ }
227
+ function g(e) {
228
+ m?.markAsDisposed(e);
229
+ }
230
+ function _(e, t) {
231
+ m?.setParent(e, t);
232
+ }
233
+ function v(e) {
234
+ if (p.is(e)) {
235
+ let t = [];
236
+ for (let n of e) if (n) try {
237
+ n.dispose();
238
+ } catch (e) {
239
+ t.push(e);
240
+ }
241
+ if (t.length === 1) throw t[0];
242
+ if (t.length > 1) throw AggregateError(t, "Encountered errors while disposing of store");
243
+ return Array.isArray(e) ? [] : e;
244
+ }
245
+ if (e) return e.dispose(), e;
246
+ }
247
+ function y(...e) {
248
+ return b(() => v(e));
249
+ }
250
+ function b(e) {
251
+ let t = h({ dispose: f(() => {
252
+ g(t), e();
253
+ }) });
254
+ return t;
255
+ }
256
+ var x = class e {
257
+ constructor() {
258
+ this._toDispose = /* @__PURE__ */ new Set(), this._isDisposed = !1, h(this);
259
+ }
260
+ dispose() {
261
+ this._isDisposed || (g(this), this._isDisposed = !0, this.clear());
262
+ }
263
+ get isDisposed() {
264
+ return this._isDisposed;
265
+ }
266
+ clear() {
267
+ if (this._toDispose.size !== 0) try {
268
+ v(this._toDispose);
269
+ } finally {
270
+ this._toDispose.clear();
271
+ }
272
+ }
273
+ add(t) {
274
+ if (!t) return t;
275
+ if (t === this) throw Error("Cannot register a disposable on itself!");
276
+ return _(t, this), this._isDisposed ? e.DISABLE_DISPOSED_WARNING || console.warn((/* @__PURE__ */ Error("Trying to add a disposable to a DisposableStore that has already been disposed of. The added object will be leaked!")).stack) : this._toDispose.add(t), t;
277
+ }
278
+ delete(e) {
279
+ if (e) {
280
+ if (e === this) throw Error("Cannot dispose a disposable on itself!");
281
+ this._toDispose.delete(e), e.dispose();
282
+ }
283
+ }
284
+ deleteAndLeak(e) {
285
+ e && this._toDispose.has(e) && (this._toDispose.delete(e), _(e, null));
286
+ }
287
+ };
288
+ x.DISABLE_DISPOSED_WARNING = !1;
289
+ var S = x, C = class {
290
+ constructor() {
291
+ this._store = new S(), h(this), _(this._store, this);
292
+ }
293
+ dispose() {
294
+ g(this), this._store.dispose();
295
+ }
296
+ _register(e) {
297
+ if (e === this) throw Error("Cannot register a disposable on itself!");
298
+ return this._store.add(e);
299
+ }
300
+ };
301
+ C.None = Object.freeze({ dispose() {} });
302
+ var w = class {
303
+ constructor() {
304
+ this._isDisposed = !1, h(this);
305
+ }
306
+ get value() {
307
+ return this._isDisposed ? void 0 : this._value;
308
+ }
309
+ set value(e) {
310
+ this._isDisposed || e === this._value || (this._value?.dispose(), e && _(e, this), this._value = e);
311
+ }
312
+ clear() {
313
+ this.value = void 0;
314
+ }
315
+ dispose() {
316
+ this._isDisposed = !0, g(this), this._value?.dispose(), this._value = void 0;
317
+ }
318
+ clearAndLeak() {
319
+ let e = this._value;
320
+ return this._value = void 0, e && _(e, null), e;
321
+ }
322
+ }, ee = typeof process < "u" && "title" in process, T = ee ? "node" : navigator.userAgent, E = ee ? "node" : navigator.platform, te = T.includes("Firefox"), ne = T.includes("Edge"), re = /^((?!chrome|android).)*safari/i.test(T);
323
+ function ie() {
324
+ if (!re) return 0;
325
+ let e = T.match(/Version\/(\d+)/);
326
+ return e === null || e.length < 2 ? 0 : parseInt(e[1]);
327
+ }
328
+ [
329
+ "Macintosh",
330
+ "MacIntel",
331
+ "MacPPC",
332
+ "Mac68K"
333
+ ].includes(E), [
334
+ "Windows",
335
+ "Win16",
336
+ "Win32",
337
+ "WinCE"
338
+ ].includes(E), E.indexOf("Linux"), /\bCrOS\b/.test(T);
339
+ var ae = "", D = 0, O = 0, k = 0, A = 0, j = {
340
+ css: "#00000000",
341
+ rgba: 0
342
+ }, M;
343
+ ((e) => {
344
+ function t(e, t, n, r) {
345
+ return r === void 0 ? `#${le(e)}${le(t)}${le(n)}` : `#${le(e)}${le(t)}${le(n)}${le(r)}`;
346
+ }
347
+ e.toCss = t;
348
+ function n(e, t, n, r = 255) {
349
+ return (e << 24 | t << 16 | n << 8 | r) >>> 0;
350
+ }
351
+ e.toRgba = n;
352
+ function r(t, n, r, i) {
353
+ return {
354
+ css: e.toCss(t, n, r, i),
355
+ rgba: e.toRgba(t, n, r, i)
356
+ };
357
+ }
358
+ e.toColor = r;
359
+ })(M ||= {});
360
+ var oe;
361
+ ((e) => {
362
+ function t(e, t) {
363
+ if (A = (t.rgba & 255) / 255, A === 1) return {
364
+ css: t.css,
365
+ rgba: t.rgba
366
+ };
367
+ let n = t.rgba >> 24 & 255, r = t.rgba >> 16 & 255, i = t.rgba >> 8 & 255, a = e.rgba >> 24 & 255, o = e.rgba >> 16 & 255, s = e.rgba >> 8 & 255;
368
+ return D = a + Math.round((n - a) * A), O = o + Math.round((r - o) * A), k = s + Math.round((i - s) * A), {
369
+ css: M.toCss(D, O, k),
370
+ rgba: M.toRgba(D, O, k)
371
+ };
372
+ }
373
+ e.blend = t;
374
+ function n(e) {
375
+ return (e.rgba & 255) == 255;
376
+ }
377
+ e.isOpaque = n;
378
+ function r(e, t, n) {
379
+ let r = ce.ensureContrastRatio(e.rgba, t.rgba, n);
380
+ if (r) return M.toColor(r >> 24 & 255, r >> 16 & 255, r >> 8 & 255);
381
+ }
382
+ e.ensureContrastRatio = r;
383
+ function i(e) {
384
+ let t = (e.rgba | 255) >>> 0;
385
+ return [D, O, k] = ce.toChannels(t), {
386
+ css: M.toCss(D, O, k),
387
+ rgba: t
388
+ };
389
+ }
390
+ e.opaque = i;
391
+ function a(e, t) {
392
+ return A = Math.round(t * 255), [D, O, k] = ce.toChannels(e.rgba), {
393
+ css: M.toCss(D, O, k, A),
394
+ rgba: M.toRgba(D, O, k, A)
395
+ };
396
+ }
397
+ e.opacity = a;
398
+ function o(e, t) {
399
+ return A = e.rgba & 255, a(e, A * t / 255);
400
+ }
401
+ e.multiplyOpacity = o;
402
+ function s(e) {
403
+ return [
404
+ e.rgba >> 24 & 255,
405
+ e.rgba >> 16 & 255,
406
+ e.rgba >> 8 & 255
407
+ ];
408
+ }
409
+ e.toColorRGB = s;
410
+ })(oe ||= {});
411
+ var se;
412
+ ((e) => {
413
+ let t, n;
414
+ try {
415
+ let e = document.createElement("canvas");
416
+ e.width = 1, e.height = 1;
417
+ let r = e.getContext("2d", { willReadFrequently: !0 });
418
+ r && (t = r, t.globalCompositeOperation = "copy", n = t.createLinearGradient(0, 0, 1, 1));
419
+ } catch {}
420
+ function r(e) {
421
+ if (e.match(/#[\da-f]{3,8}/i)) switch (e.length) {
422
+ case 4: return D = parseInt(e.slice(1, 2).repeat(2), 16), O = parseInt(e.slice(2, 3).repeat(2), 16), k = parseInt(e.slice(3, 4).repeat(2), 16), M.toColor(D, O, k);
423
+ case 5: return D = parseInt(e.slice(1, 2).repeat(2), 16), O = parseInt(e.slice(2, 3).repeat(2), 16), k = parseInt(e.slice(3, 4).repeat(2), 16), A = parseInt(e.slice(4, 5).repeat(2), 16), M.toColor(D, O, k, A);
424
+ case 7: return {
425
+ css: e,
426
+ rgba: (parseInt(e.slice(1), 16) << 8 | 255) >>> 0
427
+ };
428
+ case 9: return {
429
+ css: e,
430
+ rgba: parseInt(e.slice(1), 16) >>> 0
431
+ };
432
+ }
433
+ let r = e.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);
434
+ if (r) return D = parseInt(r[1]), O = parseInt(r[2]), k = parseInt(r[3]), A = Math.round((r[5] === void 0 ? 1 : parseFloat(r[5])) * 255), M.toColor(D, O, k, A);
435
+ if (!t || !n || (t.fillStyle = n, t.fillStyle = e, typeof t.fillStyle != "string") || (t.fillRect(0, 0, 1, 1), [D, O, k, A] = t.getImageData(0, 0, 1, 1).data, A !== 255)) throw Error("css.toColor: Unsupported css format");
436
+ return {
437
+ rgba: M.toRgba(D, O, k, A),
438
+ css: e
439
+ };
440
+ }
441
+ e.toColor = r;
442
+ })(se ||= {});
443
+ var N;
444
+ ((e) => {
445
+ function t(e) {
446
+ return n(e >> 16 & 255, e >> 8 & 255, e & 255);
447
+ }
448
+ e.relativeLuminance = t;
449
+ function n(e, t, n) {
450
+ let r = e / 255, i = t / 255, a = n / 255, o = r <= .03928 ? r / 12.92 : ((r + .055) / 1.055) ** 2.4, s = i <= .03928 ? i / 12.92 : ((i + .055) / 1.055) ** 2.4, c = a <= .03928 ? a / 12.92 : ((a + .055) / 1.055) ** 2.4;
451
+ return o * .2126 + s * .7152 + c * .0722;
452
+ }
453
+ e.relativeLuminance2 = n;
454
+ })(N ||= {});
455
+ var ce;
456
+ ((e) => {
457
+ function t(e, t) {
458
+ if (A = (t & 255) / 255, A === 1) return t;
459
+ let n = t >> 24 & 255, r = t >> 16 & 255, i = t >> 8 & 255, a = e >> 24 & 255, o = e >> 16 & 255, s = e >> 8 & 255;
460
+ return D = a + Math.round((n - a) * A), O = o + Math.round((r - o) * A), k = s + Math.round((i - s) * A), M.toRgba(D, O, k);
461
+ }
462
+ e.blend = t;
463
+ function n(e, t, n) {
464
+ let a = N.relativeLuminance(e >> 8), o = N.relativeLuminance(t >> 8);
465
+ if (P(a, o) < n) {
466
+ if (o < a) {
467
+ let o = r(e, t, n), s = P(a, N.relativeLuminance(o >> 8));
468
+ if (s < n) {
469
+ let r = i(e, t, n);
470
+ return s > P(a, N.relativeLuminance(r >> 8)) ? o : r;
471
+ }
472
+ return o;
473
+ }
474
+ let s = i(e, t, n), c = P(a, N.relativeLuminance(s >> 8));
475
+ if (c < n) {
476
+ let i = r(e, t, n);
477
+ return c > P(a, N.relativeLuminance(i >> 8)) ? s : i;
478
+ }
479
+ return s;
480
+ }
481
+ }
482
+ e.ensureContrastRatio = n;
483
+ function r(e, t, n) {
484
+ let r = e >> 24 & 255, i = e >> 16 & 255, a = e >> 8 & 255, o = t >> 24 & 255, s = t >> 16 & 255, c = t >> 8 & 255, l = P(N.relativeLuminance2(o, s, c), N.relativeLuminance2(r, i, a));
485
+ for (; l < n && (o > 0 || s > 0 || c > 0);) o -= Math.max(0, Math.ceil(o * .1)), s -= Math.max(0, Math.ceil(s * .1)), c -= Math.max(0, Math.ceil(c * .1)), l = P(N.relativeLuminance2(o, s, c), N.relativeLuminance2(r, i, a));
486
+ return (o << 24 | s << 16 | c << 8 | 255) >>> 0;
487
+ }
488
+ e.reduceLuminance = r;
489
+ function i(e, t, n) {
490
+ let r = e >> 24 & 255, i = e >> 16 & 255, a = e >> 8 & 255, o = t >> 24 & 255, s = t >> 16 & 255, c = t >> 8 & 255, l = P(N.relativeLuminance2(o, s, c), N.relativeLuminance2(r, i, a));
491
+ for (; l < n && (o < 255 || s < 255 || c < 255);) o = Math.min(255, o + Math.ceil((255 - o) * .1)), s = Math.min(255, s + Math.ceil((255 - s) * .1)), c = Math.min(255, c + Math.ceil((255 - c) * .1)), l = P(N.relativeLuminance2(o, s, c), N.relativeLuminance2(r, i, a));
492
+ return (o << 24 | s << 16 | c << 8 | 255) >>> 0;
493
+ }
494
+ e.increaseLuminance = i;
495
+ function a(e) {
496
+ return [
497
+ e >> 24 & 255,
498
+ e >> 16 & 255,
499
+ e >> 8 & 255,
500
+ e & 255
501
+ ];
502
+ }
503
+ e.toChannels = a;
504
+ })(ce ||= {});
505
+ function le(e) {
506
+ let t = e.toString(16);
507
+ return t.length < 2 ? "0" + t : t;
508
+ }
509
+ function P(e, t) {
510
+ return e < t ? (t + .05) / (e + .05) : (e + .05) / (t + .05);
511
+ }
512
+ function F(e) {
513
+ if (!e) throw Error("value must not be falsy");
514
+ return e;
515
+ }
516
+ function ue(e) {
517
+ return 57508 <= e && e <= 57558;
518
+ }
519
+ function de(e) {
520
+ return 57520 <= e && e <= 57527;
521
+ }
522
+ function fe(e) {
523
+ return 57344 <= e && e <= 63743;
524
+ }
525
+ function pe(e) {
526
+ return 9472 <= e && e <= 9631;
527
+ }
528
+ function me(e) {
529
+ return e >= 128512 && e <= 128591 || e >= 127744 && e <= 128511 || e >= 128640 && e <= 128767 || e >= 9728 && e <= 9983 || e >= 9984 && e <= 10175 || e >= 65024 && e <= 65039 || e >= 129280 && e <= 129535 || e >= 127462 && e <= 127487;
530
+ }
531
+ function he(e, t, n, r) {
532
+ return t === 1 && n > Math.ceil(r * 1.5) && e !== void 0 && e > 255 && !me(e) && !ue(e) && !fe(e);
533
+ }
534
+ function ge(e) {
535
+ return ue(e) || pe(e);
536
+ }
537
+ function _e() {
538
+ return {
539
+ css: {
540
+ canvas: ve(),
541
+ cell: ve()
542
+ },
543
+ device: {
544
+ canvas: ve(),
545
+ cell: ve(),
546
+ char: {
547
+ width: 0,
548
+ height: 0,
549
+ left: 0,
550
+ top: 0
551
+ }
552
+ }
553
+ };
554
+ }
555
+ function ve() {
556
+ return {
557
+ width: 0,
558
+ height: 0
559
+ };
560
+ }
561
+ function ye(e, t, n = 0) {
562
+ return (e - (Math.round(t) * 2 - n)) % (Math.round(t) * 2);
563
+ }
564
+ var I = 0, L = 0, R = !1, be = !1, xe = !1, z, Se = 0, Ce = class {
565
+ constructor(e, t, n, r, i, a) {
566
+ this._terminal = e, this._optionService = t, this._selectionRenderModel = n, this._decorationService = r, this._coreBrowserService = i, this._themeService = a, this.result = {
567
+ fg: 0,
568
+ bg: 0,
569
+ ext: 0
570
+ };
571
+ }
572
+ resolve(e, t, n, r) {
573
+ if (this.result.bg = e.bg, this.result.fg = e.fg, this.result.ext = e.bg & 268435456 ? e.extended.ext : 0, L = 0, I = 0, be = !1, R = !1, xe = !1, z = this._themeService.colors, Se = 0, e.getCode() !== 0 && e.extended.underlineStyle === 4) {
574
+ let e = Math.max(1, Math.floor(this._optionService.rawOptions.fontSize * this._coreBrowserService.dpr / 15));
575
+ Se = t * r % (Math.round(e) * 2);
576
+ }
577
+ if (this._decorationService.forEachDecorationAtCell(t, n, "bottom", (e) => {
578
+ e.backgroundColorRGB && (L = e.backgroundColorRGB.rgba >> 8 & 16777215, be = !0), e.foregroundColorRGB && (I = e.foregroundColorRGB.rgba >> 8 & 16777215, R = !0);
579
+ }), xe = this._selectionRenderModel.isCellSelected(this._terminal, t, n), xe) {
580
+ if (this.result.fg & 67108864 || this.result.bg & 50331648) {
581
+ if (this.result.fg & 67108864) switch (this.result.fg & 50331648) {
582
+ case 16777216:
583
+ case 33554432:
584
+ L = this._themeService.colors.ansi[this.result.fg & 255].rgba;
585
+ break;
586
+ case 50331648:
587
+ L = (this.result.fg & 16777215) << 8 | 255;
588
+ break;
589
+ default: L = this._themeService.colors.foreground.rgba;
590
+ }
591
+ else switch (this.result.bg & 50331648) {
592
+ case 16777216:
593
+ case 33554432:
594
+ L = this._themeService.colors.ansi[this.result.bg & 255].rgba;
595
+ break;
596
+ case 50331648: L = (this.result.bg & 16777215) << 8 | 255;
597
+ }
598
+ L = ce.blend(L, (this._coreBrowserService.isFocused ? z.selectionBackgroundOpaque : z.selectionInactiveBackgroundOpaque).rgba & 4294967040 | 128) >> 8 & 16777215;
599
+ } else L = (this._coreBrowserService.isFocused ? z.selectionBackgroundOpaque : z.selectionInactiveBackgroundOpaque).rgba >> 8 & 16777215;
600
+ if (be = !0, z.selectionForeground && (I = z.selectionForeground.rgba >> 8 & 16777215, R = !0), ge(e.getCode())) {
601
+ if (this.result.fg & 67108864 && !(this.result.bg & 50331648)) I = (this._coreBrowserService.isFocused ? z.selectionBackgroundOpaque : z.selectionInactiveBackgroundOpaque).rgba >> 8 & 16777215;
602
+ else {
603
+ if (this.result.fg & 67108864) switch (this.result.bg & 50331648) {
604
+ case 16777216:
605
+ case 33554432:
606
+ I = this._themeService.colors.ansi[this.result.bg & 255].rgba;
607
+ break;
608
+ case 50331648: I = (this.result.bg & 16777215) << 8 | 255;
609
+ }
610
+ else switch (this.result.fg & 50331648) {
611
+ case 16777216:
612
+ case 33554432:
613
+ I = this._themeService.colors.ansi[this.result.fg & 255].rgba;
614
+ break;
615
+ case 50331648:
616
+ I = (this.result.fg & 16777215) << 8 | 255;
617
+ break;
618
+ default: I = this._themeService.colors.foreground.rgba;
619
+ }
620
+ I = ce.blend(I, (this._coreBrowserService.isFocused ? z.selectionBackgroundOpaque : z.selectionInactiveBackgroundOpaque).rgba & 4294967040 | 128) >> 8 & 16777215;
621
+ }
622
+ R = !0;
623
+ }
624
+ }
625
+ this._decorationService.forEachDecorationAtCell(t, n, "top", (e) => {
626
+ e.backgroundColorRGB && (L = e.backgroundColorRGB.rgba >> 8 & 16777215, be = !0), e.foregroundColorRGB && (I = e.foregroundColorRGB.rgba >> 8 & 16777215, R = !0);
627
+ }), be && (L = xe ? e.bg & -150994944 | L | 50331648 : e.bg & -16777216 | L | 50331648), R && (I = e.fg & -83886080 | I | 50331648), this.result.fg & 67108864 && (be && !R && (I = this.result.bg & 50331648 ? this.result.fg & -134217728 | this.result.bg & 67108863 : this.result.fg & -134217728 | z.background.rgba >> 8 & 16777215 | 50331648, R = !0), !be && R && (L = this.result.fg & 50331648 ? this.result.bg & -67108864 | this.result.fg & 67108863 : this.result.bg & -67108864 | z.foreground.rgba >> 8 & 16777215 | 50331648, be = !0)), z = void 0, this.result.bg = be ? L : this.result.bg, this.result.fg = R ? I : this.result.fg, this.result.ext &= 536870911, this.result.ext |= Se << 29 & 3758096384;
628
+ }
629
+ }, we = .5, Te = te || ne ? "bottom" : "ideographic", Ee = {
630
+ "▀": [{
631
+ x: 0,
632
+ y: 0,
633
+ w: 8,
634
+ h: 4
635
+ }],
636
+ "▁": [{
637
+ x: 0,
638
+ y: 7,
639
+ w: 8,
640
+ h: 1
641
+ }],
642
+ "▂": [{
643
+ x: 0,
644
+ y: 6,
645
+ w: 8,
646
+ h: 2
647
+ }],
648
+ "▃": [{
649
+ x: 0,
650
+ y: 5,
651
+ w: 8,
652
+ h: 3
653
+ }],
654
+ "▄": [{
655
+ x: 0,
656
+ y: 4,
657
+ w: 8,
658
+ h: 4
659
+ }],
660
+ "▅": [{
661
+ x: 0,
662
+ y: 3,
663
+ w: 8,
664
+ h: 5
665
+ }],
666
+ "▆": [{
667
+ x: 0,
668
+ y: 2,
669
+ w: 8,
670
+ h: 6
671
+ }],
672
+ "▇": [{
673
+ x: 0,
674
+ y: 1,
675
+ w: 8,
676
+ h: 7
677
+ }],
678
+ "█": [{
679
+ x: 0,
680
+ y: 0,
681
+ w: 8,
682
+ h: 8
683
+ }],
684
+ "▉": [{
685
+ x: 0,
686
+ y: 0,
687
+ w: 7,
688
+ h: 8
689
+ }],
690
+ "▊": [{
691
+ x: 0,
692
+ y: 0,
693
+ w: 6,
694
+ h: 8
695
+ }],
696
+ "▋": [{
697
+ x: 0,
698
+ y: 0,
699
+ w: 5,
700
+ h: 8
701
+ }],
702
+ "▌": [{
703
+ x: 0,
704
+ y: 0,
705
+ w: 4,
706
+ h: 8
707
+ }],
708
+ "▍": [{
709
+ x: 0,
710
+ y: 0,
711
+ w: 3,
712
+ h: 8
713
+ }],
714
+ "▎": [{
715
+ x: 0,
716
+ y: 0,
717
+ w: 2,
718
+ h: 8
719
+ }],
720
+ "▏": [{
721
+ x: 0,
722
+ y: 0,
723
+ w: 1,
724
+ h: 8
725
+ }],
726
+ "▐": [{
727
+ x: 4,
728
+ y: 0,
729
+ w: 4,
730
+ h: 8
731
+ }],
732
+ "▔": [{
733
+ x: 0,
734
+ y: 0,
735
+ w: 8,
736
+ h: 1
737
+ }],
738
+ "▕": [{
739
+ x: 7,
740
+ y: 0,
741
+ w: 1,
742
+ h: 8
743
+ }],
744
+ "▖": [{
745
+ x: 0,
746
+ y: 4,
747
+ w: 4,
748
+ h: 4
749
+ }],
750
+ "▗": [{
751
+ x: 4,
752
+ y: 4,
753
+ w: 4,
754
+ h: 4
755
+ }],
756
+ "▘": [{
757
+ x: 0,
758
+ y: 0,
759
+ w: 4,
760
+ h: 4
761
+ }],
762
+ "▙": [{
763
+ x: 0,
764
+ y: 0,
765
+ w: 4,
766
+ h: 8
767
+ }, {
768
+ x: 0,
769
+ y: 4,
770
+ w: 8,
771
+ h: 4
772
+ }],
773
+ "▚": [{
774
+ x: 0,
775
+ y: 0,
776
+ w: 4,
777
+ h: 4
778
+ }, {
779
+ x: 4,
780
+ y: 4,
781
+ w: 4,
782
+ h: 4
783
+ }],
784
+ "▛": [{
785
+ x: 0,
786
+ y: 0,
787
+ w: 4,
788
+ h: 8
789
+ }, {
790
+ x: 4,
791
+ y: 0,
792
+ w: 4,
793
+ h: 4
794
+ }],
795
+ "▜": [{
796
+ x: 0,
797
+ y: 0,
798
+ w: 8,
799
+ h: 4
800
+ }, {
801
+ x: 4,
802
+ y: 0,
803
+ w: 4,
804
+ h: 8
805
+ }],
806
+ "▝": [{
807
+ x: 4,
808
+ y: 0,
809
+ w: 4,
810
+ h: 4
811
+ }],
812
+ "▞": [{
813
+ x: 4,
814
+ y: 0,
815
+ w: 4,
816
+ h: 4
817
+ }, {
818
+ x: 0,
819
+ y: 4,
820
+ w: 4,
821
+ h: 4
822
+ }],
823
+ "▟": [{
824
+ x: 4,
825
+ y: 0,
826
+ w: 4,
827
+ h: 8
828
+ }, {
829
+ x: 0,
830
+ y: 4,
831
+ w: 8,
832
+ h: 4
833
+ }],
834
+ "🭰": [{
835
+ x: 1,
836
+ y: 0,
837
+ w: 1,
838
+ h: 8
839
+ }],
840
+ "🭱": [{
841
+ x: 2,
842
+ y: 0,
843
+ w: 1,
844
+ h: 8
845
+ }],
846
+ "🭲": [{
847
+ x: 3,
848
+ y: 0,
849
+ w: 1,
850
+ h: 8
851
+ }],
852
+ "🭳": [{
853
+ x: 4,
854
+ y: 0,
855
+ w: 1,
856
+ h: 8
857
+ }],
858
+ "🭴": [{
859
+ x: 5,
860
+ y: 0,
861
+ w: 1,
862
+ h: 8
863
+ }],
864
+ "🭵": [{
865
+ x: 6,
866
+ y: 0,
867
+ w: 1,
868
+ h: 8
869
+ }],
870
+ "🭶": [{
871
+ x: 0,
872
+ y: 1,
873
+ w: 8,
874
+ h: 1
875
+ }],
876
+ "🭷": [{
877
+ x: 0,
878
+ y: 2,
879
+ w: 8,
880
+ h: 1
881
+ }],
882
+ "🭸": [{
883
+ x: 0,
884
+ y: 3,
885
+ w: 8,
886
+ h: 1
887
+ }],
888
+ "🭹": [{
889
+ x: 0,
890
+ y: 4,
891
+ w: 8,
892
+ h: 1
893
+ }],
894
+ "🭺": [{
895
+ x: 0,
896
+ y: 5,
897
+ w: 8,
898
+ h: 1
899
+ }],
900
+ "🭻": [{
901
+ x: 0,
902
+ y: 6,
903
+ w: 8,
904
+ h: 1
905
+ }],
906
+ "🭼": [{
907
+ x: 0,
908
+ y: 0,
909
+ w: 1,
910
+ h: 8
911
+ }, {
912
+ x: 0,
913
+ y: 7,
914
+ w: 8,
915
+ h: 1
916
+ }],
917
+ "🭽": [{
918
+ x: 0,
919
+ y: 0,
920
+ w: 1,
921
+ h: 8
922
+ }, {
923
+ x: 0,
924
+ y: 0,
925
+ w: 8,
926
+ h: 1
927
+ }],
928
+ "🭾": [{
929
+ x: 7,
930
+ y: 0,
931
+ w: 1,
932
+ h: 8
933
+ }, {
934
+ x: 0,
935
+ y: 0,
936
+ w: 8,
937
+ h: 1
938
+ }],
939
+ "🭿": [{
940
+ x: 7,
941
+ y: 0,
942
+ w: 1,
943
+ h: 8
944
+ }, {
945
+ x: 0,
946
+ y: 7,
947
+ w: 8,
948
+ h: 1
949
+ }],
950
+ "🮀": [{
951
+ x: 0,
952
+ y: 0,
953
+ w: 8,
954
+ h: 1
955
+ }, {
956
+ x: 0,
957
+ y: 7,
958
+ w: 8,
959
+ h: 1
960
+ }],
961
+ "🮁": [
962
+ {
963
+ x: 0,
964
+ y: 0,
965
+ w: 8,
966
+ h: 1
967
+ },
968
+ {
969
+ x: 0,
970
+ y: 2,
971
+ w: 8,
972
+ h: 1
973
+ },
974
+ {
975
+ x: 0,
976
+ y: 4,
977
+ w: 8,
978
+ h: 1
979
+ },
980
+ {
981
+ x: 0,
982
+ y: 7,
983
+ w: 8,
984
+ h: 1
985
+ }
986
+ ],
987
+ "🮂": [{
988
+ x: 0,
989
+ y: 0,
990
+ w: 8,
991
+ h: 2
992
+ }],
993
+ "🮃": [{
994
+ x: 0,
995
+ y: 0,
996
+ w: 8,
997
+ h: 3
998
+ }],
999
+ "🮄": [{
1000
+ x: 0,
1001
+ y: 0,
1002
+ w: 8,
1003
+ h: 5
1004
+ }],
1005
+ "🮅": [{
1006
+ x: 0,
1007
+ y: 0,
1008
+ w: 8,
1009
+ h: 6
1010
+ }],
1011
+ "🮆": [{
1012
+ x: 0,
1013
+ y: 0,
1014
+ w: 8,
1015
+ h: 7
1016
+ }],
1017
+ "🮇": [{
1018
+ x: 6,
1019
+ y: 0,
1020
+ w: 2,
1021
+ h: 8
1022
+ }],
1023
+ "🮈": [{
1024
+ x: 5,
1025
+ y: 0,
1026
+ w: 3,
1027
+ h: 8
1028
+ }],
1029
+ "🮉": [{
1030
+ x: 3,
1031
+ y: 0,
1032
+ w: 5,
1033
+ h: 8
1034
+ }],
1035
+ "🮊": [{
1036
+ x: 2,
1037
+ y: 0,
1038
+ w: 6,
1039
+ h: 8
1040
+ }],
1041
+ "🮋": [{
1042
+ x: 1,
1043
+ y: 0,
1044
+ w: 7,
1045
+ h: 8
1046
+ }],
1047
+ "🮕": [
1048
+ {
1049
+ x: 0,
1050
+ y: 0,
1051
+ w: 2,
1052
+ h: 2
1053
+ },
1054
+ {
1055
+ x: 4,
1056
+ y: 0,
1057
+ w: 2,
1058
+ h: 2
1059
+ },
1060
+ {
1061
+ x: 2,
1062
+ y: 2,
1063
+ w: 2,
1064
+ h: 2
1065
+ },
1066
+ {
1067
+ x: 6,
1068
+ y: 2,
1069
+ w: 2,
1070
+ h: 2
1071
+ },
1072
+ {
1073
+ x: 0,
1074
+ y: 4,
1075
+ w: 2,
1076
+ h: 2
1077
+ },
1078
+ {
1079
+ x: 4,
1080
+ y: 4,
1081
+ w: 2,
1082
+ h: 2
1083
+ },
1084
+ {
1085
+ x: 2,
1086
+ y: 6,
1087
+ w: 2,
1088
+ h: 2
1089
+ },
1090
+ {
1091
+ x: 6,
1092
+ y: 6,
1093
+ w: 2,
1094
+ h: 2
1095
+ }
1096
+ ],
1097
+ "🮖": [
1098
+ {
1099
+ x: 2,
1100
+ y: 0,
1101
+ w: 2,
1102
+ h: 2
1103
+ },
1104
+ {
1105
+ x: 6,
1106
+ y: 0,
1107
+ w: 2,
1108
+ h: 2
1109
+ },
1110
+ {
1111
+ x: 0,
1112
+ y: 2,
1113
+ w: 2,
1114
+ h: 2
1115
+ },
1116
+ {
1117
+ x: 4,
1118
+ y: 2,
1119
+ w: 2,
1120
+ h: 2
1121
+ },
1122
+ {
1123
+ x: 2,
1124
+ y: 4,
1125
+ w: 2,
1126
+ h: 2
1127
+ },
1128
+ {
1129
+ x: 6,
1130
+ y: 4,
1131
+ w: 2,
1132
+ h: 2
1133
+ },
1134
+ {
1135
+ x: 0,
1136
+ y: 6,
1137
+ w: 2,
1138
+ h: 2
1139
+ },
1140
+ {
1141
+ x: 4,
1142
+ y: 6,
1143
+ w: 2,
1144
+ h: 2
1145
+ }
1146
+ ],
1147
+ "🮗": [{
1148
+ x: 0,
1149
+ y: 2,
1150
+ w: 8,
1151
+ h: 2
1152
+ }, {
1153
+ x: 0,
1154
+ y: 6,
1155
+ w: 8,
1156
+ h: 2
1157
+ }]
1158
+ }, De = {
1159
+ "░": [
1160
+ [
1161
+ 1,
1162
+ 0,
1163
+ 0,
1164
+ 0
1165
+ ],
1166
+ [
1167
+ 0,
1168
+ 0,
1169
+ 0,
1170
+ 0
1171
+ ],
1172
+ [
1173
+ 0,
1174
+ 0,
1175
+ 1,
1176
+ 0
1177
+ ],
1178
+ [
1179
+ 0,
1180
+ 0,
1181
+ 0,
1182
+ 0
1183
+ ]
1184
+ ],
1185
+ "▒": [
1186
+ [1, 0],
1187
+ [0, 0],
1188
+ [0, 1],
1189
+ [0, 0]
1190
+ ],
1191
+ "▓": [
1192
+ [0, 1],
1193
+ [1, 1],
1194
+ [1, 0],
1195
+ [1, 1]
1196
+ ]
1197
+ }, Oe = {
1198
+ "─": { 1: "M0,.5 L1,.5" },
1199
+ "━": { 3: "M0,.5 L1,.5" },
1200
+ "│": { 1: "M.5,0 L.5,1" },
1201
+ "┃": { 3: "M.5,0 L.5,1" },
1202
+ "┌": { 1: "M0.5,1 L.5,.5 L1,.5" },
1203
+ "┏": { 3: "M0.5,1 L.5,.5 L1,.5" },
1204
+ "┐": { 1: "M0,.5 L.5,.5 L.5,1" },
1205
+ "┓": { 3: "M0,.5 L.5,.5 L.5,1" },
1206
+ "└": { 1: "M.5,0 L.5,.5 L1,.5" },
1207
+ "┗": { 3: "M.5,0 L.5,.5 L1,.5" },
1208
+ "┘": { 1: "M.5,0 L.5,.5 L0,.5" },
1209
+ "┛": { 3: "M.5,0 L.5,.5 L0,.5" },
1210
+ "├": { 1: "M.5,0 L.5,1 M.5,.5 L1,.5" },
1211
+ "┣": { 3: "M.5,0 L.5,1 M.5,.5 L1,.5" },
1212
+ "┤": { 1: "M.5,0 L.5,1 M.5,.5 L0,.5" },
1213
+ "┫": { 3: "M.5,0 L.5,1 M.5,.5 L0,.5" },
1214
+ "┬": { 1: "M0,.5 L1,.5 M.5,.5 L.5,1" },
1215
+ "┳": { 3: "M0,.5 L1,.5 M.5,.5 L.5,1" },
1216
+ "┴": { 1: "M0,.5 L1,.5 M.5,.5 L.5,0" },
1217
+ "┻": { 3: "M0,.5 L1,.5 M.5,.5 L.5,0" },
1218
+ "┼": { 1: "M0,.5 L1,.5 M.5,0 L.5,1" },
1219
+ "╋": { 3: "M0,.5 L1,.5 M.5,0 L.5,1" },
1220
+ "╴": { 1: "M.5,.5 L0,.5" },
1221
+ "╸": { 3: "M.5,.5 L0,.5" },
1222
+ "╵": { 1: "M.5,.5 L.5,0" },
1223
+ "╹": { 3: "M.5,.5 L.5,0" },
1224
+ "╶": { 1: "M.5,.5 L1,.5" },
1225
+ "╺": { 3: "M.5,.5 L1,.5" },
1226
+ "╷": { 1: "M.5,.5 L.5,1" },
1227
+ "╻": { 3: "M.5,.5 L.5,1" },
1228
+ "═": { 1: (e, t) => `M0,${.5 - t} L1,${.5 - t} M0,${.5 + t} L1,${.5 + t}` },
1229
+ "║": { 1: (e, t) => `M${.5 - e},0 L${.5 - e},1 M${.5 + e},0 L${.5 + e},1` },
1230
+ "╒": { 1: (e, t) => `M.5,1 L.5,${.5 - t} L1,${.5 - t} M.5,${.5 + t} L1,${.5 + t}` },
1231
+ "╓": { 1: (e, t) => `M${.5 - e},1 L${.5 - e},.5 L1,.5 M${.5 + e},.5 L${.5 + e},1` },
1232
+ "╔": { 1: (e, t) => `M1,${.5 - t} L${.5 - e},${.5 - t} L${.5 - e},1 M1,${.5 + t} L${.5 + e},${.5 + t} L${.5 + e},1` },
1233
+ "╕": { 1: (e, t) => `M0,${.5 - t} L.5,${.5 - t} L.5,1 M0,${.5 + t} L.5,${.5 + t}` },
1234
+ "╖": { 1: (e, t) => `M${.5 + e},1 L${.5 + e},.5 L0,.5 M${.5 - e},.5 L${.5 - e},1` },
1235
+ "╗": { 1: (e, t) => `M0,${.5 + t} L${.5 - e},${.5 + t} L${.5 - e},1 M0,${.5 - t} L${.5 + e},${.5 - t} L${.5 + e},1` },
1236
+ "╘": { 1: (e, t) => `M.5,0 L.5,${.5 + t} L1,${.5 + t} M.5,${.5 - t} L1,${.5 - t}` },
1237
+ "╙": { 1: (e, t) => `M1,.5 L${.5 - e},.5 L${.5 - e},0 M${.5 + e},.5 L${.5 + e},0` },
1238
+ "╚": { 1: (e, t) => `M1,${.5 - t} L${.5 + e},${.5 - t} L${.5 + e},0 M1,${.5 + t} L${.5 - e},${.5 + t} L${.5 - e},0` },
1239
+ "╛": { 1: (e, t) => `M0,${.5 + t} L.5,${.5 + t} L.5,0 M0,${.5 - t} L.5,${.5 - t}` },
1240
+ "╜": { 1: (e, t) => `M0,.5 L${.5 + e},.5 L${.5 + e},0 M${.5 - e},.5 L${.5 - e},0` },
1241
+ "╝": { 1: (e, t) => `M0,${.5 - t} L${.5 - e},${.5 - t} L${.5 - e},0 M0,${.5 + t} L${.5 + e},${.5 + t} L${.5 + e},0` },
1242
+ "╞": { 1: (e, t) => `M.5,0 L.5,1 M.5,${.5 - t} L1,${.5 - t} M.5,${.5 + t} L1,${.5 + t}` },
1243
+ "╟": { 1: (e, t) => `M${.5 - e},0 L${.5 - e},1 M${.5 + e},0 L${.5 + e},1 M${.5 + e},.5 L1,.5` },
1244
+ "╠": { 1: (e, t) => `M${.5 - e},0 L${.5 - e},1 M1,${.5 + t} L${.5 + e},${.5 + t} L${.5 + e},1 M1,${.5 - t} L${.5 + e},${.5 - t} L${.5 + e},0` },
1245
+ "╡": { 1: (e, t) => `M.5,0 L.5,1 M0,${.5 - t} L.5,${.5 - t} M0,${.5 + t} L.5,${.5 + t}` },
1246
+ "╢": { 1: (e, t) => `M0,.5 L${.5 - e},.5 M${.5 - e},0 L${.5 - e},1 M${.5 + e},0 L${.5 + e},1` },
1247
+ "╣": { 1: (e, t) => `M${.5 + e},0 L${.5 + e},1 M0,${.5 + t} L${.5 - e},${.5 + t} L${.5 - e},1 M0,${.5 - t} L${.5 - e},${.5 - t} L${.5 - e},0` },
1248
+ "╤": { 1: (e, t) => `M0,${.5 - t} L1,${.5 - t} M0,${.5 + t} L1,${.5 + t} M.5,${.5 + t} L.5,1` },
1249
+ "╥": { 1: (e, t) => `M0,.5 L1,.5 M${.5 - e},.5 L${.5 - e},1 M${.5 + e},.5 L${.5 + e},1` },
1250
+ "╦": { 1: (e, t) => `M0,${.5 - t} L1,${.5 - t} M0,${.5 + t} L${.5 - e},${.5 + t} L${.5 - e},1 M1,${.5 + t} L${.5 + e},${.5 + t} L${.5 + e},1` },
1251
+ "╧": { 1: (e, t) => `M.5,0 L.5,${.5 - t} M0,${.5 - t} L1,${.5 - t} M0,${.5 + t} L1,${.5 + t}` },
1252
+ "╨": { 1: (e, t) => `M0,.5 L1,.5 M${.5 - e},.5 L${.5 - e},0 M${.5 + e},.5 L${.5 + e},0` },
1253
+ "╩": { 1: (e, t) => `M0,${.5 + t} L1,${.5 + t} M0,${.5 - t} L${.5 - e},${.5 - t} L${.5 - e},0 M1,${.5 - t} L${.5 + e},${.5 - t} L${.5 + e},0` },
1254
+ "╪": { 1: (e, t) => `M.5,0 L.5,1 M0,${.5 - t} L1,${.5 - t} M0,${.5 + t} L1,${.5 + t}` },
1255
+ "╫": { 1: (e, t) => `M0,.5 L1,.5 M${.5 - e},0 L${.5 - e},1 M${.5 + e},0 L${.5 + e},1` },
1256
+ "╬": { 1: (e, t) => `M0,${.5 + t} L${.5 - e},${.5 + t} L${.5 - e},1 M1,${.5 + t} L${.5 + e},${.5 + t} L${.5 + e},1 M0,${.5 - t} L${.5 - e},${.5 - t} L${.5 - e},0 M1,${.5 - t} L${.5 + e},${.5 - t} L${.5 + e},0` },
1257
+ "╱": { 1: "M1,0 L0,1" },
1258
+ "╲": { 1: "M0,0 L1,1" },
1259
+ "╳": { 1: "M1,0 L0,1 M0,0 L1,1" },
1260
+ "╼": {
1261
+ 1: "M.5,.5 L0,.5",
1262
+ 3: "M.5,.5 L1,.5"
1263
+ },
1264
+ "╽": {
1265
+ 1: "M.5,.5 L.5,0",
1266
+ 3: "M.5,.5 L.5,1"
1267
+ },
1268
+ "╾": {
1269
+ 1: "M.5,.5 L1,.5",
1270
+ 3: "M.5,.5 L0,.5"
1271
+ },
1272
+ "╿": {
1273
+ 1: "M.5,.5 L.5,1",
1274
+ 3: "M.5,.5 L.5,0"
1275
+ },
1276
+ "┍": {
1277
+ 1: "M.5,.5 L.5,1",
1278
+ 3: "M.5,.5 L1,.5"
1279
+ },
1280
+ "┎": {
1281
+ 1: "M.5,.5 L1,.5",
1282
+ 3: "M.5,.5 L.5,1"
1283
+ },
1284
+ "┑": {
1285
+ 1: "M.5,.5 L.5,1",
1286
+ 3: "M.5,.5 L0,.5"
1287
+ },
1288
+ "┒": {
1289
+ 1: "M.5,.5 L0,.5",
1290
+ 3: "M.5,.5 L.5,1"
1291
+ },
1292
+ "┕": {
1293
+ 1: "M.5,.5 L.5,0",
1294
+ 3: "M.5,.5 L1,.5"
1295
+ },
1296
+ "┖": {
1297
+ 1: "M.5,.5 L1,.5",
1298
+ 3: "M.5,.5 L.5,0"
1299
+ },
1300
+ "┙": {
1301
+ 1: "M.5,.5 L.5,0",
1302
+ 3: "M.5,.5 L0,.5"
1303
+ },
1304
+ "┚": {
1305
+ 1: "M.5,.5 L0,.5",
1306
+ 3: "M.5,.5 L.5,0"
1307
+ },
1308
+ "┝": {
1309
+ 1: "M.5,0 L.5,1",
1310
+ 3: "M.5,.5 L1,.5"
1311
+ },
1312
+ "┞": {
1313
+ 1: "M0.5,1 L.5,.5 L1,.5",
1314
+ 3: "M.5,.5 L.5,0"
1315
+ },
1316
+ "┟": {
1317
+ 1: "M.5,0 L.5,.5 L1,.5",
1318
+ 3: "M.5,.5 L.5,1"
1319
+ },
1320
+ "┠": {
1321
+ 1: "M.5,.5 L1,.5",
1322
+ 3: "M.5,0 L.5,1"
1323
+ },
1324
+ "┡": {
1325
+ 1: "M.5,.5 L.5,1",
1326
+ 3: "M.5,0 L.5,.5 L1,.5"
1327
+ },
1328
+ "┢": {
1329
+ 1: "M.5,.5 L.5,0",
1330
+ 3: "M0.5,1 L.5,.5 L1,.5"
1331
+ },
1332
+ "┥": {
1333
+ 1: "M.5,0 L.5,1",
1334
+ 3: "M.5,.5 L0,.5"
1335
+ },
1336
+ "┦": {
1337
+ 1: "M0,.5 L.5,.5 L.5,1",
1338
+ 3: "M.5,.5 L.5,0"
1339
+ },
1340
+ "┧": {
1341
+ 1: "M.5,0 L.5,.5 L0,.5",
1342
+ 3: "M.5,.5 L.5,1"
1343
+ },
1344
+ "┨": {
1345
+ 1: "M.5,.5 L0,.5",
1346
+ 3: "M.5,0 L.5,1"
1347
+ },
1348
+ "┩": {
1349
+ 1: "M.5,.5 L.5,1",
1350
+ 3: "M.5,0 L.5,.5 L0,.5"
1351
+ },
1352
+ "┪": {
1353
+ 1: "M.5,.5 L.5,0",
1354
+ 3: "M0,.5 L.5,.5 L.5,1"
1355
+ },
1356
+ "┭": {
1357
+ 1: "M0.5,1 L.5,.5 L1,.5",
1358
+ 3: "M.5,.5 L0,.5"
1359
+ },
1360
+ "┮": {
1361
+ 1: "M0,.5 L.5,.5 L.5,1",
1362
+ 3: "M.5,.5 L1,.5"
1363
+ },
1364
+ "┯": {
1365
+ 1: "M.5,.5 L.5,1",
1366
+ 3: "M0,.5 L1,.5"
1367
+ },
1368
+ "┰": {
1369
+ 1: "M0,.5 L1,.5",
1370
+ 3: "M.5,.5 L.5,1"
1371
+ },
1372
+ "┱": {
1373
+ 1: "M.5,.5 L1,.5",
1374
+ 3: "M0,.5 L.5,.5 L.5,1"
1375
+ },
1376
+ "┲": {
1377
+ 1: "M.5,.5 L0,.5",
1378
+ 3: "M0.5,1 L.5,.5 L1,.5"
1379
+ },
1380
+ "┵": {
1381
+ 1: "M.5,0 L.5,.5 L1,.5",
1382
+ 3: "M.5,.5 L0,.5"
1383
+ },
1384
+ "┶": {
1385
+ 1: "M.5,0 L.5,.5 L0,.5",
1386
+ 3: "M.5,.5 L1,.5"
1387
+ },
1388
+ "┷": {
1389
+ 1: "M.5,.5 L.5,0",
1390
+ 3: "M0,.5 L1,.5"
1391
+ },
1392
+ "┸": {
1393
+ 1: "M0,.5 L1,.5",
1394
+ 3: "M.5,.5 L.5,0"
1395
+ },
1396
+ "┹": {
1397
+ 1: "M.5,.5 L1,.5",
1398
+ 3: "M.5,0 L.5,.5 L0,.5"
1399
+ },
1400
+ "┺": {
1401
+ 1: "M.5,.5 L0,.5",
1402
+ 3: "M.5,0 L.5,.5 L1,.5"
1403
+ },
1404
+ "┽": {
1405
+ 1: "M.5,0 L.5,1 M.5,.5 L1,.5",
1406
+ 3: "M.5,.5 L0,.5"
1407
+ },
1408
+ "┾": {
1409
+ 1: "M.5,0 L.5,1 M.5,.5 L0,.5",
1410
+ 3: "M.5,.5 L1,.5"
1411
+ },
1412
+ "┿": {
1413
+ 1: "M.5,0 L.5,1",
1414
+ 3: "M0,.5 L1,.5"
1415
+ },
1416
+ "╀": {
1417
+ 1: "M0,.5 L1,.5 M.5,.5 L.5,1",
1418
+ 3: "M.5,.5 L.5,0"
1419
+ },
1420
+ "╁": {
1421
+ 1: "M.5,.5 L.5,0 M0,.5 L1,.5",
1422
+ 3: "M.5,.5 L.5,1"
1423
+ },
1424
+ "╂": {
1425
+ 1: "M0,.5 L1,.5",
1426
+ 3: "M.5,0 L.5,1"
1427
+ },
1428
+ "╃": {
1429
+ 1: "M0.5,1 L.5,.5 L1,.5",
1430
+ 3: "M.5,0 L.5,.5 L0,.5"
1431
+ },
1432
+ "╄": {
1433
+ 1: "M0,.5 L.5,.5 L.5,1",
1434
+ 3: "M.5,0 L.5,.5 L1,.5"
1435
+ },
1436
+ "╅": {
1437
+ 1: "M.5,0 L.5,.5 L1,.5",
1438
+ 3: "M0,.5 L.5,.5 L.5,1"
1439
+ },
1440
+ "╆": {
1441
+ 1: "M.5,0 L.5,.5 L0,.5",
1442
+ 3: "M0.5,1 L.5,.5 L1,.5"
1443
+ },
1444
+ "╇": {
1445
+ 1: "M.5,.5 L.5,1",
1446
+ 3: "M.5,.5 L.5,0 M0,.5 L1,.5"
1447
+ },
1448
+ "╈": {
1449
+ 1: "M.5,.5 L.5,0",
1450
+ 3: "M0,.5 L1,.5 M.5,.5 L.5,1"
1451
+ },
1452
+ "╉": {
1453
+ 1: "M.5,.5 L1,.5",
1454
+ 3: "M.5,0 L.5,1 M.5,.5 L0,.5"
1455
+ },
1456
+ "╊": {
1457
+ 1: "M.5,.5 L0,.5",
1458
+ 3: "M.5,0 L.5,1 M.5,.5 L1,.5"
1459
+ },
1460
+ "╌": { 1: "M.1,.5 L.4,.5 M.6,.5 L.9,.5" },
1461
+ "╍": { 3: "M.1,.5 L.4,.5 M.6,.5 L.9,.5" },
1462
+ "┄": { 1: "M.0667,.5 L.2667,.5 M.4,.5 L.6,.5 M.7333,.5 L.9333,.5" },
1463
+ "┅": { 3: "M.0667,.5 L.2667,.5 M.4,.5 L.6,.5 M.7333,.5 L.9333,.5" },
1464
+ "┈": { 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" },
1465
+ "┉": { 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" },
1466
+ "╎": { 1: "M.5,.1 L.5,.4 M.5,.6 L.5,.9" },
1467
+ "╏": { 3: "M.5,.1 L.5,.4 M.5,.6 L.5,.9" },
1468
+ "┆": { 1: "M.5,.0667 L.5,.2667 M.5,.4 L.5,.6 M.5,.7333 L.5,.9333" },
1469
+ "┇": { 3: "M.5,.0667 L.5,.2667 M.5,.4 L.5,.6 M.5,.7333 L.5,.9333" },
1470
+ "┊": { 1: "M.5,.05 L.5,.2 M.5,.3 L.5,.45 L.5,.55 M.5,.7 L.5,.95" },
1471
+ "┋": { 3: "M.5,.05 L.5,.2 M.5,.3 L.5,.45 L.5,.55 M.5,.7 L.5,.95" },
1472
+ "╭": { 1: (e, t) => `M.5,1 L.5,${.5 + t / .15 * .5} C.5,${.5 + t / .15 * .5},.5,.5,1,.5` },
1473
+ "╮": { 1: (e, t) => `M.5,1 L.5,${.5 + t / .15 * .5} C.5,${.5 + t / .15 * .5},.5,.5,0,.5` },
1474
+ "╯": { 1: (e, t) => `M.5,0 L.5,${.5 - t / .15 * .5} C.5,${.5 - t / .15 * .5},.5,.5,0,.5` },
1475
+ "╰": { 1: (e, t) => `M.5,0 L.5,${.5 - t / .15 * .5} C.5,${.5 - t / .15 * .5},.5,.5,1,.5` }
1476
+ }, ke = {
1477
+ "": {
1478
+ d: "M.3,1 L.03,1 L.03,.88 C.03,.82,.06,.78,.11,.73 C.15,.7,.2,.68,.28,.65 L.43,.6 C.49,.58,.53,.56,.56,.53 C.59,.5,.6,.47,.6,.43 L.6,.27 L.4,.27 L.69,.1 L.98,.27 L.78,.27 L.78,.46 C.78,.52,.76,.56,.72,.61 C.68,.66,.63,.67,.56,.7 L.48,.72 C.42,.74,.38,.76,.35,.78 C.32,.8,.31,.84,.31,.88 L.31,1 M.3,.5 L.03,.59 L.03,.09 L.3,.09 L.3,.655",
1479
+ type: 0
1480
+ },
1481
+ "": {
1482
+ d: "M.7,.4 L.7,.47 L.2,.47 L.2,.03 L.355,.03 L.355,.4 L.705,.4 M.7,.5 L.86,.5 L.86,.95 L.69,.95 L.44,.66 L.46,.86 L.46,.95 L.3,.95 L.3,.49 L.46,.49 L.71,.78 L.69,.565 L.69,.5",
1483
+ type: 0
1484
+ },
1485
+ "": {
1486
+ d: "M.25,.94 C.16,.94,.11,.92,.11,.87 L.11,.53 C.11,.48,.15,.455,.23,.45 L.23,.3 C.23,.25,.26,.22,.31,.19 C.36,.16,.43,.15,.51,.15 C.59,.15,.66,.16,.71,.19 C.77,.22,.79,.26,.79,.3 L.79,.45 C.87,.45,.91,.48,.91,.53 L.91,.87 C.91,.92,.86,.94,.77,.94 L.24,.94 M.53,.2 C.49,.2,.45,.21,.42,.23 C.39,.25,.38,.27,.38,.3 L.38,.45 L.68,.45 L.68,.3 C.68,.27,.67,.25,.64,.23 C.61,.21,.58,.2,.53,.2 M.58,.82 L.58,.66 C.63,.65,.65,.63,.65,.6 C.65,.58,.64,.57,.61,.56 C.58,.55,.56,.54,.52,.54 C.48,.54,.46,.55,.43,.56 C.4,.57,.39,.59,.39,.6 C.39,.63,.41,.64,.46,.66 L.46,.82 L.57,.82",
1487
+ type: 0
1488
+ },
1489
+ "": {
1490
+ d: "M0,0 L1,.5 L0,1",
1491
+ type: 0,
1492
+ rightPadding: 2
1493
+ },
1494
+ "": {
1495
+ d: "M-1,-.5 L1,.5 L-1,1.5",
1496
+ type: 1,
1497
+ leftPadding: 1,
1498
+ rightPadding: 1
1499
+ },
1500
+ "": {
1501
+ d: "M1,0 L0,.5 L1,1",
1502
+ type: 0,
1503
+ leftPadding: 2
1504
+ },
1505
+ "": {
1506
+ d: "M2,-.5 L0,.5 L2,1.5",
1507
+ type: 1,
1508
+ leftPadding: 1,
1509
+ rightPadding: 1
1510
+ },
1511
+ "": {
1512
+ d: "M0,0 L0,1 C0.552,1,1,0.776,1,.5 C1,0.224,0.552,0,0,0",
1513
+ type: 0,
1514
+ rightPadding: 1
1515
+ },
1516
+ "": {
1517
+ d: "M.2,1 C.422,1,.8,.826,.78,.5 C.8,.174,0.422,0,.2,0",
1518
+ type: 1,
1519
+ rightPadding: 1
1520
+ },
1521
+ "": {
1522
+ d: "M1,0 L1,1 C0.448,1,0,0.776,0,.5 C0,0.224,0.448,0,1,0",
1523
+ type: 0,
1524
+ leftPadding: 1
1525
+ },
1526
+ "": {
1527
+ d: "M.8,1 C0.578,1,0.2,.826,.22,.5 C0.2,0.174,0.578,0,0.8,0",
1528
+ type: 1,
1529
+ leftPadding: 1
1530
+ },
1531
+ "": {
1532
+ d: "M-.5,-.5 L1.5,1.5 L-.5,1.5",
1533
+ type: 0
1534
+ },
1535
+ "": {
1536
+ d: "M-.5,-.5 L1.5,1.5",
1537
+ type: 1,
1538
+ leftPadding: 1,
1539
+ rightPadding: 1
1540
+ },
1541
+ "": {
1542
+ d: "M1.5,-.5 L-.5,1.5 L1.5,1.5",
1543
+ type: 0
1544
+ },
1545
+ "": {
1546
+ d: "M1.5,-.5 L-.5,1.5 L-.5,-.5",
1547
+ type: 0
1548
+ },
1549
+ "": {
1550
+ d: "M1.5,-.5 L-.5,1.5",
1551
+ type: 1,
1552
+ leftPadding: 1,
1553
+ rightPadding: 1
1554
+ },
1555
+ "": {
1556
+ d: "M-.5,-.5 L1.5,1.5 L1.5,-.5",
1557
+ type: 0
1558
+ }
1559
+ };
1560
+ ke[""] = ke[""], ke[""] = ke[""];
1561
+ function Ae(e, t, n, r, i, a, o, s) {
1562
+ let c = Ee[t];
1563
+ if (c) return je(e, c, n, r, i, a), !0;
1564
+ let l = De[t];
1565
+ if (l) return Ne(e, l, n, r, i, a), !0;
1566
+ let u = Oe[t];
1567
+ if (u) return Pe(e, u, n, r, i, a, s), !0;
1568
+ let d = ke[t];
1569
+ return d ? (Fe(e, d, n, r, i, a, o, s), !0) : !1;
1570
+ }
1571
+ function je(e, t, n, r, i, a) {
1572
+ for (let o = 0; o < t.length; o++) {
1573
+ let s = t[o], c = i / 8, l = a / 8;
1574
+ e.fillRect(n + s.x * c, r + s.y * l, s.w * c, s.h * l);
1575
+ }
1576
+ }
1577
+ var Me = /* @__PURE__ */ new Map();
1578
+ function Ne(e, t, n, r, i, a) {
1579
+ let o = Me.get(t);
1580
+ o || (o = /* @__PURE__ */ new Map(), Me.set(t, o));
1581
+ let s = e.fillStyle;
1582
+ if (typeof s != "string") throw Error(`Unexpected fillStyle type "${s}"`);
1583
+ let c = o.get(s);
1584
+ if (!c) {
1585
+ let n = t[0].length, r = t.length, i = e.canvas.ownerDocument.createElement("canvas");
1586
+ i.width = n, i.height = r;
1587
+ let a = F(i.getContext("2d")), l = new ImageData(n, r), u, d, f, p;
1588
+ if (s.startsWith("#")) u = parseInt(s.slice(1, 3), 16), d = parseInt(s.slice(3, 5), 16), f = parseInt(s.slice(5, 7), 16), p = s.length > 7 && parseInt(s.slice(7, 9), 16) || 1;
1589
+ else if (s.startsWith("rgba")) [u, d, f, p] = s.substring(5, s.length - 1).split(",").map((e) => parseFloat(e));
1590
+ else throw Error(`Unexpected fillStyle color format "${s}" when drawing pattern glyph`);
1591
+ for (let e = 0; e < r; e++) for (let r = 0; r < n; r++) l.data[(e * n + r) * 4] = u, l.data[(e * n + r) * 4 + 1] = d, l.data[(e * n + r) * 4 + 2] = f, l.data[(e * n + r) * 4 + 3] = t[e][r] * (p * 255);
1592
+ a.putImageData(l, 0, 0), c = F(e.createPattern(i, null)), o.set(s, c);
1593
+ }
1594
+ e.fillStyle = c, e.fillRect(n, r, i, a);
1595
+ }
1596
+ function Pe(e, t, n, r, i, a, o) {
1597
+ e.strokeStyle = e.fillStyle;
1598
+ for (let [s, c] of Object.entries(t)) {
1599
+ e.beginPath(), e.lineWidth = o * Number.parseInt(s);
1600
+ let t;
1601
+ t = typeof c == "function" ? c(.15, .15 / a * i) : c;
1602
+ for (let s of t.split(" ")) {
1603
+ let t = s[0], c = Le[t];
1604
+ if (!c) {
1605
+ console.error(`Could not find drawing instructions for "${t}"`);
1606
+ continue;
1607
+ }
1608
+ let l = s.substring(1).split(",");
1609
+ !l[0] || !l[1] || c(e, Re(l, i, a, n, r, !0, o));
1610
+ }
1611
+ e.stroke(), e.closePath();
1612
+ }
1613
+ }
1614
+ function Fe(e, t, n, r, i, a, o, s) {
1615
+ let c = new Path2D();
1616
+ c.rect(n, r, i, a), e.clip(c), e.beginPath();
1617
+ let l = o / 12;
1618
+ e.lineWidth = s * l;
1619
+ for (let o of t.d.split(" ")) {
1620
+ let c = o[0], u = Le[c];
1621
+ if (!u) {
1622
+ console.error(`Could not find drawing instructions for "${c}"`);
1623
+ continue;
1624
+ }
1625
+ let d = o.substring(1).split(",");
1626
+ !d[0] || !d[1] || u(e, Re(d, i, a, n, r, !1, s, (t.leftPadding ?? 0) * (l / 2), (t.rightPadding ?? 0) * (l / 2)));
1627
+ }
1628
+ t.type === 1 ? (e.strokeStyle = e.fillStyle, e.stroke()) : e.fill(), e.closePath();
1629
+ }
1630
+ function Ie(e, t, n = 0) {
1631
+ return Math.max(Math.min(e, t), n);
1632
+ }
1633
+ var Le = {
1634
+ C: (e, t) => e.bezierCurveTo(t[0], t[1], t[2], t[3], t[4], t[5]),
1635
+ L: (e, t) => e.lineTo(t[0], t[1]),
1636
+ M: (e, t) => e.moveTo(t[0], t[1])
1637
+ };
1638
+ function Re(e, t, n, r, i, a, o, s = 0, c = 0) {
1639
+ let l = e.map((e) => parseFloat(e) || parseInt(e));
1640
+ if (l.length < 2) throw Error("Too few arguments for instruction");
1641
+ for (let e = 0; e < l.length; e += 2) l[e] *= t - s * o - c * o, a && l[e] !== 0 && (l[e] = Ie(Math.round(l[e] + .5) - .5, t, 0)), l[e] += r + s * o;
1642
+ for (let e = 1; e < l.length; e += 2) l[e] *= n, a && l[e] !== 0 && (l[e] = Ie(Math.round(l[e] + .5) - .5, n, 0)), l[e] += i;
1643
+ return l;
1644
+ }
1645
+ var ze = class {
1646
+ constructor() {
1647
+ this._data = {};
1648
+ }
1649
+ set(e, t, n) {
1650
+ this._data[e] || (this._data[e] = {}), this._data[e][t] = n;
1651
+ }
1652
+ get(e, t) {
1653
+ return this._data[e] ? this._data[e][t] : void 0;
1654
+ }
1655
+ clear() {
1656
+ this._data = {};
1657
+ }
1658
+ }, Be = class {
1659
+ constructor() {
1660
+ this._data = new ze();
1661
+ }
1662
+ set(e, t, n, r, i) {
1663
+ this._data.get(e, t) || this._data.set(e, t, new ze()), this._data.get(e, t).set(n, r, i);
1664
+ }
1665
+ get(e, t, n, r) {
1666
+ return this._data.get(e, t)?.get(n, r);
1667
+ }
1668
+ clear() {
1669
+ this._data.clear();
1670
+ }
1671
+ }, Ve = class {
1672
+ constructor() {
1673
+ this._tasks = [], this._i = 0;
1674
+ }
1675
+ enqueue(e) {
1676
+ this._tasks.push(e), this._start();
1677
+ }
1678
+ flush() {
1679
+ for (; this._i < this._tasks.length;) this._tasks[this._i]() || this._i++;
1680
+ this.clear();
1681
+ }
1682
+ clear() {
1683
+ this._idleCallback &&= (this._cancelCallback(this._idleCallback), void 0), this._i = 0, this._tasks.length = 0;
1684
+ }
1685
+ _start() {
1686
+ this._idleCallback ||= this._requestCallback(this._process.bind(this));
1687
+ }
1688
+ _process(e) {
1689
+ this._idleCallback = void 0;
1690
+ let t = 0, n = 0, r = e.timeRemaining(), i = 0;
1691
+ for (; this._i < this._tasks.length;) {
1692
+ if (t = performance.now(), this._tasks[this._i]() || this._i++, t = Math.max(1, performance.now() - t), n = Math.max(t, n), i = e.timeRemaining(), n * 1.5 > i) {
1693
+ r - t < -20 && console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(r - t))}ms`), this._start();
1694
+ return;
1695
+ }
1696
+ r = i;
1697
+ }
1698
+ this.clear();
1699
+ }
1700
+ }, He = class extends Ve {
1701
+ _requestCallback(e) {
1702
+ return setTimeout(() => e(this._createDeadline(16)));
1703
+ }
1704
+ _cancelCallback(e) {
1705
+ clearTimeout(e);
1706
+ }
1707
+ _createDeadline(e) {
1708
+ let t = performance.now() + e;
1709
+ return { timeRemaining: () => Math.max(0, t - performance.now()) };
1710
+ }
1711
+ }, Ue = class extends Ve {
1712
+ _requestCallback(e) {
1713
+ return requestIdleCallback(e);
1714
+ }
1715
+ _cancelCallback(e) {
1716
+ cancelIdleCallback(e);
1717
+ }
1718
+ }, We = !ee && "requestIdleCallback" in window ? Ue : He, Ge = class e {
1719
+ constructor() {
1720
+ this.fg = 0, this.bg = 0, this.extended = new Ke();
1721
+ }
1722
+ static toColorRGB(e) {
1723
+ return [
1724
+ e >>> 16 & 255,
1725
+ e >>> 8 & 255,
1726
+ e & 255
1727
+ ];
1728
+ }
1729
+ static fromColorRGB(e) {
1730
+ return (e[0] & 255) << 16 | (e[1] & 255) << 8 | e[2] & 255;
1731
+ }
1732
+ clone() {
1733
+ let t = new e();
1734
+ return t.fg = this.fg, t.bg = this.bg, t.extended = this.extended.clone(), t;
1735
+ }
1736
+ isInverse() {
1737
+ return this.fg & 67108864;
1738
+ }
1739
+ isBold() {
1740
+ return this.fg & 134217728;
1741
+ }
1742
+ isUnderline() {
1743
+ return this.hasExtendedAttrs() && this.extended.underlineStyle !== 0 ? 1 : this.fg & 268435456;
1744
+ }
1745
+ isBlink() {
1746
+ return this.fg & 536870912;
1747
+ }
1748
+ isInvisible() {
1749
+ return this.fg & 1073741824;
1750
+ }
1751
+ isItalic() {
1752
+ return this.bg & 67108864;
1753
+ }
1754
+ isDim() {
1755
+ return this.bg & 134217728;
1756
+ }
1757
+ isStrikethrough() {
1758
+ return this.fg & 2147483648;
1759
+ }
1760
+ isProtected() {
1761
+ return this.bg & 536870912;
1762
+ }
1763
+ isOverline() {
1764
+ return this.bg & 1073741824;
1765
+ }
1766
+ getFgColorMode() {
1767
+ return this.fg & 50331648;
1768
+ }
1769
+ getBgColorMode() {
1770
+ return this.bg & 50331648;
1771
+ }
1772
+ isFgRGB() {
1773
+ return (this.fg & 50331648) == 50331648;
1774
+ }
1775
+ isBgRGB() {
1776
+ return (this.bg & 50331648) == 50331648;
1777
+ }
1778
+ isFgPalette() {
1779
+ return (this.fg & 50331648) == 16777216 || (this.fg & 50331648) == 33554432;
1780
+ }
1781
+ isBgPalette() {
1782
+ return (this.bg & 50331648) == 16777216 || (this.bg & 50331648) == 33554432;
1783
+ }
1784
+ isFgDefault() {
1785
+ return !(this.fg & 50331648);
1786
+ }
1787
+ isBgDefault() {
1788
+ return !(this.bg & 50331648);
1789
+ }
1790
+ isAttributeDefault() {
1791
+ return this.fg === 0 && this.bg === 0;
1792
+ }
1793
+ getFgColor() {
1794
+ switch (this.fg & 50331648) {
1795
+ case 16777216:
1796
+ case 33554432: return this.fg & 255;
1797
+ case 50331648: return this.fg & 16777215;
1798
+ default: return -1;
1799
+ }
1800
+ }
1801
+ getBgColor() {
1802
+ switch (this.bg & 50331648) {
1803
+ case 16777216:
1804
+ case 33554432: return this.bg & 255;
1805
+ case 50331648: return this.bg & 16777215;
1806
+ default: return -1;
1807
+ }
1808
+ }
1809
+ hasExtendedAttrs() {
1810
+ return this.bg & 268435456;
1811
+ }
1812
+ updateExtended() {
1813
+ this.extended.isEmpty() ? this.bg &= -268435457 : this.bg |= 268435456;
1814
+ }
1815
+ getUnderlineColor() {
1816
+ if (this.bg & 268435456 && ~this.extended.underlineColor) switch (this.extended.underlineColor & 50331648) {
1817
+ case 16777216:
1818
+ case 33554432: return this.extended.underlineColor & 255;
1819
+ case 50331648: return this.extended.underlineColor & 16777215;
1820
+ default: return this.getFgColor();
1821
+ }
1822
+ return this.getFgColor();
1823
+ }
1824
+ getUnderlineColorMode() {
1825
+ return this.bg & 268435456 && ~this.extended.underlineColor ? this.extended.underlineColor & 50331648 : this.getFgColorMode();
1826
+ }
1827
+ isUnderlineColorRGB() {
1828
+ return this.bg & 268435456 && ~this.extended.underlineColor ? (this.extended.underlineColor & 50331648) == 50331648 : this.isFgRGB();
1829
+ }
1830
+ isUnderlineColorPalette() {
1831
+ return this.bg & 268435456 && ~this.extended.underlineColor ? (this.extended.underlineColor & 50331648) == 16777216 || (this.extended.underlineColor & 50331648) == 33554432 : this.isFgPalette();
1832
+ }
1833
+ isUnderlineColorDefault() {
1834
+ return this.bg & 268435456 && ~this.extended.underlineColor ? !(this.extended.underlineColor & 50331648) : this.isFgDefault();
1835
+ }
1836
+ getUnderlineStyle() {
1837
+ return this.fg & 268435456 ? this.bg & 268435456 ? this.extended.underlineStyle : 1 : 0;
1838
+ }
1839
+ getUnderlineVariantOffset() {
1840
+ return this.extended.underlineVariantOffset;
1841
+ }
1842
+ }, Ke = class e {
1843
+ constructor(e = 0, t = 0) {
1844
+ this._ext = 0, this._urlId = 0, this._ext = e, this._urlId = t;
1845
+ }
1846
+ get ext() {
1847
+ return this._urlId ? this._ext & -469762049 | this.underlineStyle << 26 : this._ext;
1848
+ }
1849
+ set ext(e) {
1850
+ this._ext = e;
1851
+ }
1852
+ get underlineStyle() {
1853
+ return this._urlId ? 5 : (this._ext & 469762048) >> 26;
1854
+ }
1855
+ set underlineStyle(e) {
1856
+ this._ext &= -469762049, this._ext |= e << 26 & 469762048;
1857
+ }
1858
+ get underlineColor() {
1859
+ return this._ext & 67108863;
1860
+ }
1861
+ set underlineColor(e) {
1862
+ this._ext &= -67108864, this._ext |= e & 67108863;
1863
+ }
1864
+ get urlId() {
1865
+ return this._urlId;
1866
+ }
1867
+ set urlId(e) {
1868
+ this._urlId = e;
1869
+ }
1870
+ get underlineVariantOffset() {
1871
+ let e = (this._ext & 3758096384) >> 29;
1872
+ return e < 0 ? e ^ 4294967288 : e;
1873
+ }
1874
+ set underlineVariantOffset(e) {
1875
+ this._ext &= 536870911, this._ext |= e << 29 & 3758096384;
1876
+ }
1877
+ clone() {
1878
+ return new e(this._ext, this._urlId);
1879
+ }
1880
+ isEmpty() {
1881
+ return this.underlineStyle === 0 && this._urlId === 0;
1882
+ }
1883
+ }, qe = class e {
1884
+ constructor(t) {
1885
+ this.element = t, this.next = e.Undefined, this.prev = e.Undefined;
1886
+ }
1887
+ };
1888
+ qe.Undefined = new qe(void 0);
1889
+ var Je = globalThis.performance && typeof globalThis.performance.now == "function", Ye = class e {
1890
+ static create(t) {
1891
+ return new e(t);
1892
+ }
1893
+ constructor(e) {
1894
+ this._now = Je && e === !1 ? Date.now : globalThis.performance.now.bind(globalThis.performance), this._startTime = this._now(), this._stopTime = -1;
1895
+ }
1896
+ stop() {
1897
+ this._stopTime = this._now();
1898
+ }
1899
+ reset() {
1900
+ this._startTime = this._now(), this._stopTime = -1;
1901
+ }
1902
+ elapsed() {
1903
+ return this._stopTime === -1 ? this._now() - this._startTime : this._stopTime - this._startTime;
1904
+ }
1905
+ }, B;
1906
+ ((e) => {
1907
+ e.None = () => C.None;
1908
+ function t(e, t) {
1909
+ return d(e, () => {}, 0, void 0, !0, void 0, t);
1910
+ }
1911
+ e.defer = t;
1912
+ function n(e) {
1913
+ return (t, n = null, r) => {
1914
+ let i = !1, a;
1915
+ return a = e((e) => {
1916
+ if (!i) return a ? a.dispose() : i = !0, t.call(n, e);
1917
+ }, null, r), i && a.dispose(), a;
1918
+ };
1919
+ }
1920
+ e.once = n;
1921
+ function r(e, t, n) {
1922
+ return l((n, r = null, i) => e((e) => n.call(r, t(e)), null, i), n);
1923
+ }
1924
+ e.map = r;
1925
+ function i(e, t, n) {
1926
+ return l((n, r = null, i) => e((e) => {
1927
+ t(e), n.call(r, e);
1928
+ }, null, i), n);
1929
+ }
1930
+ e.forEach = i;
1931
+ function a(e, t, n) {
1932
+ return l((n, r = null, i) => e((e) => t(e) && n.call(r, e), null, i), n);
1933
+ }
1934
+ e.filter = a;
1935
+ function o(e) {
1936
+ return e;
1937
+ }
1938
+ e.signal = o;
1939
+ function s(...e) {
1940
+ return (t, n = null, r) => u(y(...e.map((e) => e((e) => t.call(n, e)))), r);
1941
+ }
1942
+ e.any = s;
1943
+ function c(e, t, n, i) {
1944
+ let a = n;
1945
+ return r(e, (e) => (a = t(a, e), a), i);
1946
+ }
1947
+ e.reduce = c;
1948
+ function l(e, t) {
1949
+ let n, r = new V({
1950
+ onWillAddFirstListener() {
1951
+ n = e(r.fire, r);
1952
+ },
1953
+ onDidRemoveLastListener() {
1954
+ n?.dispose();
1955
+ }
1956
+ });
1957
+ return t?.add(r), r.event;
1958
+ }
1959
+ function u(e, t) {
1960
+ return t instanceof Array ? t.push(e) : t && t.add(e), e;
1961
+ }
1962
+ function d(e, t, n = 100, r = !1, i = !1, a, o) {
1963
+ let s, c, l, u = 0, d, f = new V({
1964
+ leakWarningThreshold: a,
1965
+ onWillAddFirstListener() {
1966
+ s = e((e) => {
1967
+ u++, c = t(c, e), r && !l && (f.fire(c), c = void 0), d = () => {
1968
+ let e = c;
1969
+ c = void 0, l = void 0, (!r || u > 1) && f.fire(e), u = 0;
1970
+ }, typeof n == "number" ? (clearTimeout(l), l = setTimeout(d, n)) : l === void 0 && (l = 0, queueMicrotask(d));
1971
+ });
1972
+ },
1973
+ onWillRemoveListener() {
1974
+ i && u > 0 && d?.();
1975
+ },
1976
+ onDidRemoveLastListener() {
1977
+ d = void 0, s.dispose();
1978
+ }
1979
+ });
1980
+ return o?.add(f), f.event;
1981
+ }
1982
+ e.debounce = d;
1983
+ function f(t, n = 0, r) {
1984
+ return e.debounce(t, (e, t) => e ? (e.push(t), e) : [t], n, void 0, !0, void 0, r);
1985
+ }
1986
+ e.accumulate = f;
1987
+ function p(e, t = (e, t) => e === t, n) {
1988
+ let r = !0, i;
1989
+ return a(e, (e) => {
1990
+ let n = r || !t(e, i);
1991
+ return r = !1, i = e, n;
1992
+ }, n);
1993
+ }
1994
+ e.latch = p;
1995
+ function m(t, n, r) {
1996
+ return [e.filter(t, n, r), e.filter(t, (e) => !n(e), r)];
1997
+ }
1998
+ e.split = m;
1999
+ function h(e, t = !1, n = [], r) {
2000
+ let i = n.slice(), a = e((e) => {
2001
+ i ? i.push(e) : s.fire(e);
2002
+ });
2003
+ r && r.add(a);
2004
+ let o = () => {
2005
+ i?.forEach((e) => s.fire(e)), i = null;
2006
+ }, s = new V({
2007
+ onWillAddFirstListener() {
2008
+ a || (a = e((e) => s.fire(e)), r && r.add(a));
2009
+ },
2010
+ onDidAddFirstListener() {
2011
+ i && (t ? setTimeout(o) : o());
2012
+ },
2013
+ onDidRemoveLastListener() {
2014
+ a && a.dispose(), a = null;
2015
+ }
2016
+ });
2017
+ return r && r.add(s), s.event;
2018
+ }
2019
+ e.buffer = h;
2020
+ function g(e, t) {
2021
+ return (n, r, i) => {
2022
+ let a = t(new v());
2023
+ return e(function(e) {
2024
+ let t = a.evaluate(e);
2025
+ t !== _ && n.call(r, t);
2026
+ }, void 0, i);
2027
+ };
2028
+ }
2029
+ e.chain = g;
2030
+ let _ = Symbol("HaltChainable");
2031
+ class v {
2032
+ constructor() {
2033
+ this.steps = [];
2034
+ }
2035
+ map(e) {
2036
+ return this.steps.push(e), this;
2037
+ }
2038
+ forEach(e) {
2039
+ return this.steps.push((t) => (e(t), t)), this;
2040
+ }
2041
+ filter(e) {
2042
+ return this.steps.push((t) => e(t) ? t : _), this;
2043
+ }
2044
+ reduce(e, t) {
2045
+ let n = t;
2046
+ return this.steps.push((t) => (n = e(n, t), n)), this;
2047
+ }
2048
+ latch(e = (e, t) => e === t) {
2049
+ let t = !0, n;
2050
+ return this.steps.push((r) => {
2051
+ let i = t || !e(r, n);
2052
+ return t = !1, n = r, i ? r : _;
2053
+ }), this;
2054
+ }
2055
+ evaluate(e) {
2056
+ for (let t of this.steps) if (e = t(e), e === _) break;
2057
+ return e;
2058
+ }
2059
+ }
2060
+ function b(e, t, n = (e) => e) {
2061
+ let r = (...e) => i.fire(n(...e)), i = new V({
2062
+ onWillAddFirstListener: () => e.on(t, r),
2063
+ onDidRemoveLastListener: () => e.removeListener(t, r)
2064
+ });
2065
+ return i.event;
2066
+ }
2067
+ e.fromNodeEventEmitter = b;
2068
+ function x(e, t, n = (e) => e) {
2069
+ let r = (...e) => i.fire(n(...e)), i = new V({
2070
+ onWillAddFirstListener: () => e.addEventListener(t, r),
2071
+ onDidRemoveLastListener: () => e.removeEventListener(t, r)
2072
+ });
2073
+ return i.event;
2074
+ }
2075
+ e.fromDOMEventEmitter = x;
2076
+ function w(e) {
2077
+ return new Promise((t) => n(e)(t));
2078
+ }
2079
+ e.toPromise = w;
2080
+ function ee(e) {
2081
+ let t = new V();
2082
+ return e.then((e) => {
2083
+ t.fire(e);
2084
+ }, () => {
2085
+ t.fire(void 0);
2086
+ }).finally(() => {
2087
+ t.dispose();
2088
+ }), t.event;
2089
+ }
2090
+ e.fromPromise = ee;
2091
+ function T(e, t) {
2092
+ return e((e) => t.fire(e));
2093
+ }
2094
+ e.forward = T;
2095
+ function E(e, t, n) {
2096
+ return t(n), e((e) => t(e));
2097
+ }
2098
+ e.runAndSubscribe = E;
2099
+ class te {
2100
+ constructor(e, t) {
2101
+ this._observable = e, this._counter = 0, this._hasChanged = !1;
2102
+ let n = {
2103
+ onWillAddFirstListener: () => {
2104
+ e.addObserver(this);
2105
+ },
2106
+ onDidRemoveLastListener: () => {
2107
+ e.removeObserver(this);
2108
+ }
2109
+ };
2110
+ this.emitter = new V(n), t && t.add(this.emitter);
2111
+ }
2112
+ beginUpdate(e) {
2113
+ this._counter++;
2114
+ }
2115
+ handlePossibleChange(e) {}
2116
+ handleChange(e, t) {
2117
+ this._hasChanged = !0;
2118
+ }
2119
+ endUpdate(e) {
2120
+ this._counter--, this._counter === 0 && (this._observable.reportChanges(), this._hasChanged && (this._hasChanged = !1, this.emitter.fire(this._observable.get())));
2121
+ }
2122
+ }
2123
+ function ne(e, t) {
2124
+ return new te(e, t).emitter.event;
2125
+ }
2126
+ e.fromObservable = ne;
2127
+ function re(e) {
2128
+ return (t, n, r) => {
2129
+ let i = 0, a = !1, o = {
2130
+ beginUpdate() {
2131
+ i++;
2132
+ },
2133
+ endUpdate() {
2134
+ i--, i === 0 && (e.reportChanges(), a && (a = !1, t.call(n)));
2135
+ },
2136
+ handlePossibleChange() {},
2137
+ handleChange() {
2138
+ a = !0;
2139
+ }
2140
+ };
2141
+ e.addObserver(o), e.reportChanges();
2142
+ let s = { dispose() {
2143
+ e.removeObserver(o);
2144
+ } };
2145
+ return r instanceof S ? r.add(s) : Array.isArray(r) && r.push(s), s;
2146
+ };
2147
+ }
2148
+ e.fromObservableLight = re;
2149
+ })(B ||= {});
2150
+ var Xe = class e {
2151
+ constructor(t) {
2152
+ this.listenerCount = 0, this.invocationCount = 0, this.elapsedOverall = 0, this.durations = [], this.name = `${t}_${e._idPool++}`, e.all.add(this);
2153
+ }
2154
+ start(e) {
2155
+ this._stopWatch = new Ye(), this.listenerCount = e;
2156
+ }
2157
+ stop() {
2158
+ if (this._stopWatch) {
2159
+ let e = this._stopWatch.elapsed();
2160
+ this.durations.push(e), this.elapsedOverall += e, this.invocationCount += 1, this._stopWatch = void 0;
2161
+ }
2162
+ }
2163
+ };
2164
+ Xe.all = /* @__PURE__ */ new Set(), Xe._idPool = 0;
2165
+ var Ze = Xe, Qe = -1, $e = class e {
2166
+ constructor(t, n, r = (e._idPool++).toString(16).padStart(3, "0")) {
2167
+ this._errorHandler = t, this.threshold = n, this.name = r, this._warnCountdown = 0;
2168
+ }
2169
+ dispose() {
2170
+ this._stacks?.clear();
2171
+ }
2172
+ check(e, t) {
2173
+ let n = this.threshold;
2174
+ if (n <= 0 || t < n) return;
2175
+ this._stacks ||= /* @__PURE__ */ new Map();
2176
+ let r = this._stacks.get(e.value) || 0;
2177
+ if (this._stacks.set(e.value, r + 1), --this._warnCountdown, this._warnCountdown <= 0) {
2178
+ this._warnCountdown = n * .5;
2179
+ let [e, r] = this.getMostFrequentStack(), i = `[${this.name}] potential listener LEAK detected, having ${t} listeners already. MOST frequent listener (${r}):`;
2180
+ console.warn(i), console.warn(e);
2181
+ let a = new nt(i, e);
2182
+ this._errorHandler(a);
2183
+ }
2184
+ return () => {
2185
+ let t = this._stacks.get(e.value) || 0;
2186
+ this._stacks.set(e.value, t - 1);
2187
+ };
2188
+ }
2189
+ getMostFrequentStack() {
2190
+ if (!this._stacks) return;
2191
+ let e, t = 0;
2192
+ for (let [n, r] of this._stacks) (!e || t < r) && (e = [n, r], t = r);
2193
+ return e;
2194
+ }
2195
+ };
2196
+ $e._idPool = 1;
2197
+ var et = $e, tt = class e {
2198
+ constructor(e) {
2199
+ this.value = e;
2200
+ }
2201
+ static create() {
2202
+ return new e((/* @__PURE__ */ Error()).stack ?? "");
2203
+ }
2204
+ print() {
2205
+ console.warn(this.value.split("\n").slice(2).join("\n"));
2206
+ }
2207
+ }, nt = class extends Error {
2208
+ constructor(e, t) {
2209
+ super(e), this.name = "ListenerLeakError", this.stack = t;
2210
+ }
2211
+ }, rt = class extends Error {
2212
+ constructor(e, t) {
2213
+ super(e), this.name = "ListenerRefusalError", this.stack = t;
2214
+ }
2215
+ }, it = 0, at = class {
2216
+ constructor(e) {
2217
+ this.value = e, this.id = it++;
2218
+ }
2219
+ }, ot = 2, V = class {
2220
+ constructor(e) {
2221
+ this._size = 0, this._options = e, this._leakageMon = Qe > 0 || this._options?.leakWarningThreshold ? new et(e?.onListenerError ?? a, this._options?.leakWarningThreshold ?? Qe) : void 0, this._perfMon = this._options?._profName ? new Ze(this._options._profName) : void 0, this._deliveryQueue = this._options?.deliveryQueue;
2222
+ }
2223
+ dispose() {
2224
+ this._disposed || (this._disposed = !0, this._deliveryQueue?.current === this && this._deliveryQueue.reset(), this._listeners && (this._listeners = void 0, this._size = 0), this._options?.onDidRemoveLastListener?.(), this._leakageMon?.dispose());
2225
+ }
2226
+ get event() {
2227
+ return this._event ??= (e, t, n) => {
2228
+ if (this._leakageMon && this._size > this._leakageMon.threshold ** 2) {
2229
+ let e = `[${this._leakageMon.name}] REFUSES to accept new listeners because it exceeded its threshold by far (${this._size} vs ${this._leakageMon.threshold})`;
2230
+ console.warn(e);
2231
+ let t = this._leakageMon.getMostFrequentStack() ?? ["UNKNOWN stack", -1], n = new rt(`${e}. HINT: Stack shows most frequent listener (${t[1]}-times)`, t[0]);
2232
+ return (this._options?.onListenerError || a)(n), C.None;
2233
+ }
2234
+ if (this._disposed) return C.None;
2235
+ t && (e = e.bind(t));
2236
+ let r = new at(e), i;
2237
+ this._leakageMon && this._size >= Math.ceil(this._leakageMon.threshold * .2) && (r.stack = tt.create(), i = this._leakageMon.check(r.stack, this._size + 1)), this._listeners ? this._listeners instanceof at ? (this._deliveryQueue ??= new st(), this._listeners = [this._listeners, r]) : this._listeners.push(r) : (this._options?.onWillAddFirstListener?.(this), this._listeners = r, this._options?.onDidAddFirstListener?.(this)), this._size++;
2238
+ let o = b(() => {
2239
+ i?.(), this._removeListener(r);
2240
+ });
2241
+ return n instanceof S ? n.add(o) : Array.isArray(n) && n.push(o), o;
2242
+ }, this._event;
2243
+ }
2244
+ _removeListener(e) {
2245
+ if (this._options?.onWillRemoveListener?.(this), !this._listeners) return;
2246
+ if (this._size === 1) {
2247
+ this._listeners = void 0, this._options?.onDidRemoveLastListener?.(this), this._size = 0;
2248
+ return;
2249
+ }
2250
+ let t = this._listeners, n = t.indexOf(e);
2251
+ if (n === -1) throw console.log("disposed?", this._disposed), console.log("size?", this._size), console.log("arr?", JSON.stringify(this._listeners)), /* @__PURE__ */ Error("Attempted to dispose unknown listener");
2252
+ this._size--, t[n] = void 0;
2253
+ let r = this._deliveryQueue.current === this;
2254
+ if (this._size * ot <= t.length) {
2255
+ let e = 0;
2256
+ for (let n = 0; n < t.length; n++) t[n] ? t[e++] = t[n] : r && (this._deliveryQueue.end--, e < this._deliveryQueue.i && this._deliveryQueue.i--);
2257
+ t.length = e;
2258
+ }
2259
+ }
2260
+ _deliver(e, t) {
2261
+ if (!e) return;
2262
+ let n = this._options?.onListenerError || a;
2263
+ if (!n) {
2264
+ e.value(t);
2265
+ return;
2266
+ }
2267
+ try {
2268
+ e.value(t);
2269
+ } catch (e) {
2270
+ n(e);
2271
+ }
2272
+ }
2273
+ _deliverQueue(e) {
2274
+ let t = e.current._listeners;
2275
+ for (; e.i < e.end;) this._deliver(t[e.i++], e.value);
2276
+ e.reset();
2277
+ }
2278
+ fire(e) {
2279
+ if (this._deliveryQueue?.current && (this._deliverQueue(this._deliveryQueue), this._perfMon?.stop()), this._perfMon?.start(this._size), this._listeners) {
2280
+ if (this._listeners instanceof at) this._deliver(this._listeners, e);
2281
+ else {
2282
+ let t = this._deliveryQueue;
2283
+ t.enqueue(this, e, this._listeners.length), this._deliverQueue(t);
2284
+ }
2285
+ }
2286
+ this._perfMon?.stop();
2287
+ }
2288
+ hasListeners() {
2289
+ return this._size > 0;
2290
+ }
2291
+ }, st = class {
2292
+ constructor() {
2293
+ this.i = -1, this.end = 0;
2294
+ }
2295
+ enqueue(e, t, n) {
2296
+ this.i = 0, this.end = n, this.current = e, this.value = t;
2297
+ }
2298
+ reset() {
2299
+ this.i = this.end, this.current = void 0, this.value = void 0;
2300
+ }
2301
+ }, ct = {
2302
+ texturePage: 0,
2303
+ texturePosition: {
2304
+ x: 0,
2305
+ y: 0
2306
+ },
2307
+ texturePositionClipSpace: {
2308
+ x: 0,
2309
+ y: 0
2310
+ },
2311
+ offset: {
2312
+ x: 0,
2313
+ y: 0
2314
+ },
2315
+ size: {
2316
+ x: 0,
2317
+ y: 0
2318
+ },
2319
+ sizeClipSpace: {
2320
+ x: 0,
2321
+ y: 0
2322
+ }
2323
+ }, lt = 2, ut, dt = class e {
2324
+ constructor(e, t, n) {
2325
+ this._document = e, this._config = t, this._unicodeService = n, this._didWarmUp = !1, this._cacheMap = new Be(), this._cacheMapCombined = new Be(), this._pages = [], this._activePages = [], this._workBoundingBox = {
2326
+ top: 0,
2327
+ left: 0,
2328
+ bottom: 0,
2329
+ right: 0
2330
+ }, this._workAttributeData = new Ge(), this._textureSize = 512, this._onAddTextureAtlasCanvas = new V(), this.onAddTextureAtlasCanvas = this._onAddTextureAtlasCanvas.event, this._onRemoveTextureAtlasCanvas = new V(), this.onRemoveTextureAtlasCanvas = this._onRemoveTextureAtlasCanvas.event, this._requestClearModel = !1, this._createNewPage(), this._tmpCanvas = ht(e, this._config.deviceCellWidth * 4 + lt * 2, this._config.deviceCellHeight + lt * 2), this._tmpCtx = F(this._tmpCanvas.getContext("2d", {
2331
+ alpha: this._config.allowTransparency,
2332
+ willReadFrequently: !0
2333
+ }));
2334
+ }
2335
+ get pages() {
2336
+ return this._pages;
2337
+ }
2338
+ dispose() {
2339
+ this._tmpCanvas.remove();
2340
+ for (let e of this.pages) e.canvas.remove();
2341
+ this._onAddTextureAtlasCanvas.dispose();
2342
+ }
2343
+ warmUp() {
2344
+ this._didWarmUp ||= (this._doWarmUp(), !0);
2345
+ }
2346
+ _doWarmUp() {
2347
+ let e = new We();
2348
+ for (let t = 33; t < 126; t++) e.enqueue(() => {
2349
+ if (!this._cacheMap.get(t, 0, 0, 0)) {
2350
+ let e = this._drawToCache(t, 0, 0, 0, !1, void 0);
2351
+ this._cacheMap.set(t, 0, 0, 0, e);
2352
+ }
2353
+ });
2354
+ }
2355
+ beginFrame() {
2356
+ return this._requestClearModel;
2357
+ }
2358
+ clearTexture() {
2359
+ if (this._pages[0].currentRow.x !== 0 || this._pages[0].currentRow.y !== 0) {
2360
+ for (let e of this._pages) e.clear();
2361
+ this._cacheMap.clear(), this._cacheMapCombined.clear(), this._didWarmUp = !1;
2362
+ }
2363
+ }
2364
+ _createNewPage() {
2365
+ if (e.maxAtlasPages && this._pages.length >= Math.max(4, e.maxAtlasPages)) {
2366
+ let t = this._pages.filter((t) => t.canvas.width * 2 <= (e.maxTextureSize || 4096)).sort((e, t) => t.canvas.width === e.canvas.width ? t.percentageUsed - e.percentageUsed : t.canvas.width - e.canvas.width), n = -1, r = 0;
2367
+ for (let e = 0; e < t.length; e++) if (t[e].canvas.width !== r) n = e, r = t[e].canvas.width;
2368
+ else if (e - n === 3) break;
2369
+ let i = t.slice(n, n + 4), a = i.map((e) => e.glyphs[0].texturePage).sort((e, t) => e > t ? 1 : -1), o = this.pages.length - i.length, s = this._mergePages(i, o);
2370
+ s.version++;
2371
+ for (let e = a.length - 1; e >= 0; e--) this._deletePage(a[e]);
2372
+ this.pages.push(s), this._requestClearModel = !0, this._onAddTextureAtlasCanvas.fire(s.canvas);
2373
+ }
2374
+ let t = new ft(this._document, this._textureSize);
2375
+ return this._pages.push(t), this._activePages.push(t), this._onAddTextureAtlasCanvas.fire(t.canvas), t;
2376
+ }
2377
+ _mergePages(e, t) {
2378
+ let n = e[0].canvas.width * 2, r = new ft(this._document, n, e);
2379
+ for (let [i, a] of e.entries()) {
2380
+ let e = i * a.canvas.width % n, o = Math.floor(i / 2) * a.canvas.height;
2381
+ r.ctx.drawImage(a.canvas, e, o);
2382
+ for (let r of a.glyphs) r.texturePage = t, r.sizeClipSpace.x = r.size.x / n, r.sizeClipSpace.y = r.size.y / n, r.texturePosition.x += e, r.texturePosition.y += o, r.texturePositionClipSpace.x = r.texturePosition.x / n, r.texturePositionClipSpace.y = r.texturePosition.y / n;
2383
+ this._onRemoveTextureAtlasCanvas.fire(a.canvas);
2384
+ let s = this._activePages.indexOf(a);
2385
+ s !== -1 && this._activePages.splice(s, 1);
2386
+ }
2387
+ return r;
2388
+ }
2389
+ _deletePage(e) {
2390
+ this._pages.splice(e, 1);
2391
+ for (let t = e; t < this._pages.length; t++) {
2392
+ let e = this._pages[t];
2393
+ for (let t of e.glyphs) t.texturePage--;
2394
+ e.version++;
2395
+ }
2396
+ }
2397
+ getRasterizedGlyphCombinedChar(e, t, n, r, i, a) {
2398
+ return this._getFromCacheMap(this._cacheMapCombined, e, t, n, r, i, a);
2399
+ }
2400
+ getRasterizedGlyph(e, t, n, r, i, a) {
2401
+ return this._getFromCacheMap(this._cacheMap, e, t, n, r, i, a);
2402
+ }
2403
+ _getFromCacheMap(e, t, n, r, i, a, o) {
2404
+ return ut = e.get(t, n, r, i), ut || (ut = this._drawToCache(t, n, r, i, a, o), e.set(t, n, r, i, ut)), ut;
2405
+ }
2406
+ _getColorFromAnsiIndex(e) {
2407
+ if (e >= this._config.colors.ansi.length) throw Error("No color found for idx " + e);
2408
+ return this._config.colors.ansi[e];
2409
+ }
2410
+ _getBackgroundColor(e, t, n, r) {
2411
+ if (this._config.allowTransparency) return j;
2412
+ let i;
2413
+ switch (e) {
2414
+ case 16777216:
2415
+ case 33554432:
2416
+ i = this._getColorFromAnsiIndex(t);
2417
+ break;
2418
+ case 50331648:
2419
+ let e = Ge.toColorRGB(t);
2420
+ i = M.toColor(e[0], e[1], e[2]);
2421
+ break;
2422
+ default: i = n ? oe.opaque(this._config.colors.foreground) : this._config.colors.background;
2423
+ }
2424
+ return this._config.allowTransparency || (i = oe.opaque(i)), i;
2425
+ }
2426
+ _getForegroundColor(e, t, n, r, i, a, o, s, c, l) {
2427
+ let u = this._getMinimumContrastColor(e, t, n, r, i, a, o, c, s, l);
2428
+ if (u) return u;
2429
+ let d;
2430
+ switch (i) {
2431
+ case 16777216:
2432
+ case 33554432:
2433
+ this._config.drawBoldTextInBrightColors && c && a < 8 && (a += 8), d = this._getColorFromAnsiIndex(a);
2434
+ break;
2435
+ case 50331648:
2436
+ let e = Ge.toColorRGB(a);
2437
+ d = M.toColor(e[0], e[1], e[2]);
2438
+ break;
2439
+ default: d = o ? this._config.colors.background : this._config.colors.foreground;
2440
+ }
2441
+ return this._config.allowTransparency && (d = oe.opaque(d)), s && (d = oe.multiplyOpacity(d, we)), d;
2442
+ }
2443
+ _resolveBackgroundRgba(e, t, n) {
2444
+ switch (e) {
2445
+ case 16777216:
2446
+ case 33554432: return this._getColorFromAnsiIndex(t).rgba;
2447
+ case 50331648: return t << 8;
2448
+ default: return n ? this._config.colors.foreground.rgba : this._config.colors.background.rgba;
2449
+ }
2450
+ }
2451
+ _resolveForegroundRgba(e, t, n, r) {
2452
+ switch (e) {
2453
+ case 16777216:
2454
+ case 33554432: return this._config.drawBoldTextInBrightColors && r && t < 8 && (t += 8), this._getColorFromAnsiIndex(t).rgba;
2455
+ case 50331648: return t << 8;
2456
+ default: return n ? this._config.colors.background.rgba : this._config.colors.foreground.rgba;
2457
+ }
2458
+ }
2459
+ _getMinimumContrastColor(e, t, n, r, i, a, o, s, c, l) {
2460
+ if (this._config.minimumContrastRatio === 1 || l) return;
2461
+ let u = this._getContrastCache(c), d = u.getColor(e, r);
2462
+ if (d !== void 0) return d || void 0;
2463
+ let f = this._resolveBackgroundRgba(t, n, o), p = this._resolveForegroundRgba(i, a, o, s), m = ce.ensureContrastRatio(f, p, this._config.minimumContrastRatio / (c ? 2 : 1));
2464
+ if (!m) {
2465
+ u.setColor(e, r, null);
2466
+ return;
2467
+ }
2468
+ let h = M.toColor(m >> 24 & 255, m >> 16 & 255, m >> 8 & 255);
2469
+ return u.setColor(e, r, h), h;
2470
+ }
2471
+ _getContrastCache(e) {
2472
+ return e ? this._config.colors.halfContrastCache : this._config.colors.contrastCache;
2473
+ }
2474
+ _drawToCache(t, n, r, i, a, o) {
2475
+ let s = typeof t == "number" ? String.fromCharCode(t) : t;
2476
+ o && this._tmpCanvas.parentElement !== o && (this._tmpCanvas.style.display = "none", o.append(this._tmpCanvas));
2477
+ let c = Math.min(this._config.deviceCellWidth * Math.max(s.length, 2) + lt * 2, this._config.deviceMaxTextureSize);
2478
+ this._tmpCanvas.width < c && (this._tmpCanvas.width = c);
2479
+ let l = Math.min(this._config.deviceCellHeight + lt * 4, this._textureSize);
2480
+ if (this._tmpCanvas.height < l && (this._tmpCanvas.height = l), this._tmpCtx.save(), this._workAttributeData.fg = r, this._workAttributeData.bg = n, this._workAttributeData.extended.ext = i, this._workAttributeData.isInvisible()) return ct;
2481
+ let u = !!this._workAttributeData.isBold(), d = !!this._workAttributeData.isInverse(), f = !!this._workAttributeData.isDim(), p = !!this._workAttributeData.isItalic(), m = !!this._workAttributeData.isUnderline(), h = !!this._workAttributeData.isStrikethrough(), g = !!this._workAttributeData.isOverline(), _ = this._workAttributeData.getFgColor(), v = this._workAttributeData.getFgColorMode(), y = this._workAttributeData.getBgColor(), b = this._workAttributeData.getBgColorMode();
2482
+ if (d) {
2483
+ let e = _;
2484
+ _ = y, y = e;
2485
+ let t = v;
2486
+ v = b, b = t;
2487
+ }
2488
+ let x = this._getBackgroundColor(b, y, d, f);
2489
+ this._tmpCtx.globalCompositeOperation = "copy", this._tmpCtx.fillStyle = x.css, this._tmpCtx.fillRect(0, 0, this._tmpCanvas.width, this._tmpCanvas.height), this._tmpCtx.globalCompositeOperation = "source-over";
2490
+ let S = u ? this._config.fontWeightBold : this._config.fontWeight, C = p ? "italic" : "";
2491
+ this._tmpCtx.font = `${C} ${S} ${this._config.fontSize * this._config.devicePixelRatio}px ${this._config.fontFamily}`, this._tmpCtx.textBaseline = Te;
2492
+ let w = s.length === 1 && ue(s.charCodeAt(0)), ee = s.length === 1 && de(s.charCodeAt(0)), T = this._getForegroundColor(n, b, y, r, v, _, d, f, u, ge(s.charCodeAt(0)));
2493
+ this._tmpCtx.fillStyle = T.css;
2494
+ let E = ee ? 0 : lt * 2, te = !1;
2495
+ this._config.customGlyphs !== !1 && (te = Ae(this._tmpCtx, s, E, E, this._config.deviceCellWidth, this._config.deviceCellHeight, this._config.fontSize, this._config.devicePixelRatio));
2496
+ let ne = !w, re;
2497
+ if (re = typeof t == "number" ? this._unicodeService.wcwidth(t) : this._unicodeService.getStringCellWidth(t), m) {
2498
+ this._tmpCtx.save();
2499
+ let e = Math.max(1, Math.floor(this._config.fontSize * this._config.devicePixelRatio / 15)), t = e % 2 == 1 ? .5 : 0;
2500
+ if (this._tmpCtx.lineWidth = e, this._workAttributeData.isUnderlineColorDefault()) this._tmpCtx.strokeStyle = this._tmpCtx.fillStyle;
2501
+ else if (this._workAttributeData.isUnderlineColorRGB()) ne = !1, this._tmpCtx.strokeStyle = `rgb(${Ge.toColorRGB(this._workAttributeData.getUnderlineColor()).join(",")})`;
2502
+ else {
2503
+ ne = !1;
2504
+ let e = this._workAttributeData.getUnderlineColor();
2505
+ this._config.drawBoldTextInBrightColors && this._workAttributeData.isBold() && e < 8 && (e += 8), this._tmpCtx.strokeStyle = this._getColorFromAnsiIndex(e).css;
2506
+ }
2507
+ this._tmpCtx.beginPath();
2508
+ let n = E, r = Math.ceil(E + this._config.deviceCharHeight) - t - (a ? e * 2 : 0), i = r + e, o = r + e * 2, c = this._workAttributeData.getUnderlineVariantOffset();
2509
+ for (let a = 0; a < re; a++) {
2510
+ this._tmpCtx.save();
2511
+ let s = n + a * this._config.deviceCellWidth, l = n + (a + 1) * this._config.deviceCellWidth, u = s + this._config.deviceCellWidth / 2;
2512
+ switch (this._workAttributeData.extended.underlineStyle) {
2513
+ case 2:
2514
+ this._tmpCtx.moveTo(s, r), this._tmpCtx.lineTo(l, r), this._tmpCtx.moveTo(s, o), this._tmpCtx.lineTo(l, o);
2515
+ break;
2516
+ case 3:
2517
+ let n = e <= 1 ? o : Math.ceil(E + this._config.deviceCharHeight - e / 2) - t, a = e <= 1 ? r : Math.ceil(E + this._config.deviceCharHeight + e / 2) - t, d = new Path2D();
2518
+ d.rect(s, r, this._config.deviceCellWidth, o - r), this._tmpCtx.clip(d), this._tmpCtx.moveTo(s - this._config.deviceCellWidth / 2, i), this._tmpCtx.bezierCurveTo(s - this._config.deviceCellWidth / 2, a, s, a, s, i), this._tmpCtx.bezierCurveTo(s, n, u, n, u, i), this._tmpCtx.bezierCurveTo(u, a, l, a, l, i), this._tmpCtx.bezierCurveTo(l, n, l + this._config.deviceCellWidth / 2, n, l + this._config.deviceCellWidth / 2, i);
2519
+ break;
2520
+ case 4:
2521
+ let f = c === 0 ? 0 : c >= e ? e * 2 - c : e - c;
2522
+ c >= e || f === 0 ? (this._tmpCtx.setLineDash([Math.round(e), Math.round(e)]), this._tmpCtx.moveTo(s + f, r), this._tmpCtx.lineTo(l, r)) : (this._tmpCtx.setLineDash([Math.round(e), Math.round(e)]), this._tmpCtx.moveTo(s, r), this._tmpCtx.lineTo(s + f, r), this._tmpCtx.moveTo(s + f + e, r), this._tmpCtx.lineTo(l, r)), c = ye(l - s, e, c);
2523
+ break;
2524
+ case 5:
2525
+ let p = l - s, m = Math.floor(.6 * p), h = Math.floor(.3 * p), g = p - m - h;
2526
+ this._tmpCtx.setLineDash([
2527
+ m,
2528
+ h,
2529
+ g
2530
+ ]), this._tmpCtx.moveTo(s, r), this._tmpCtx.lineTo(l, r);
2531
+ break;
2532
+ default: this._tmpCtx.moveTo(s, r), this._tmpCtx.lineTo(l, r);
2533
+ }
2534
+ this._tmpCtx.stroke(), this._tmpCtx.restore();
2535
+ }
2536
+ if (this._tmpCtx.restore(), !te && this._config.fontSize >= 12 && !this._config.allowTransparency && s !== " ") {
2537
+ this._tmpCtx.save(), this._tmpCtx.textBaseline = "alphabetic";
2538
+ let t = this._tmpCtx.measureText(s);
2539
+ if (this._tmpCtx.restore(), "actualBoundingBoxDescent" in t && t.actualBoundingBoxDescent > 0) {
2540
+ this._tmpCtx.save();
2541
+ let t = new Path2D();
2542
+ t.rect(n, r - Math.ceil(e / 2), this._config.deviceCellWidth * re, o - r + Math.ceil(e / 2)), this._tmpCtx.clip(t), this._tmpCtx.lineWidth = this._config.devicePixelRatio * 3, this._tmpCtx.strokeStyle = x.css, this._tmpCtx.strokeText(s, E, E + this._config.deviceCharHeight), this._tmpCtx.restore();
2543
+ }
2544
+ }
2545
+ }
2546
+ if (g) {
2547
+ let e = Math.max(1, Math.floor(this._config.fontSize * this._config.devicePixelRatio / 15)), t = e % 2 == 1 ? .5 : 0;
2548
+ this._tmpCtx.lineWidth = e, this._tmpCtx.strokeStyle = this._tmpCtx.fillStyle, this._tmpCtx.beginPath(), this._tmpCtx.moveTo(E, E + t), this._tmpCtx.lineTo(E + this._config.deviceCharWidth * re, E + t), this._tmpCtx.stroke();
2549
+ }
2550
+ if (te || this._tmpCtx.fillText(s, E, E + this._config.deviceCharHeight), s === "_" && !this._config.allowTransparency) {
2551
+ let e = pt(this._tmpCtx.getImageData(E, E, this._config.deviceCellWidth, this._config.deviceCellHeight), x, T, ne);
2552
+ if (e) for (let t = 1; t <= 5 && (this._tmpCtx.save(), this._tmpCtx.fillStyle = x.css, this._tmpCtx.fillRect(0, 0, this._tmpCanvas.width, this._tmpCanvas.height), this._tmpCtx.restore(), this._tmpCtx.fillText(s, E, E + this._config.deviceCharHeight - t), e = pt(this._tmpCtx.getImageData(E, E, this._config.deviceCellWidth, this._config.deviceCellHeight), x, T, ne), e); t++);
2553
+ }
2554
+ if (h) {
2555
+ let e = Math.max(1, Math.floor(this._config.fontSize * this._config.devicePixelRatio / 10)), t = this._tmpCtx.lineWidth % 2 == 1 ? .5 : 0;
2556
+ this._tmpCtx.lineWidth = e, this._tmpCtx.strokeStyle = this._tmpCtx.fillStyle, this._tmpCtx.beginPath(), this._tmpCtx.moveTo(E, E + Math.floor(this._config.deviceCharHeight / 2) - t), this._tmpCtx.lineTo(E + this._config.deviceCharWidth * re, E + Math.floor(this._config.deviceCharHeight / 2) - t), this._tmpCtx.stroke();
2557
+ }
2558
+ this._tmpCtx.restore();
2559
+ let ie = this._tmpCtx.getImageData(0, 0, this._tmpCanvas.width, this._tmpCanvas.height), ae;
2560
+ if (ae = this._config.allowTransparency ? mt(ie) : pt(ie, x, T, ne), ae) return ct;
2561
+ let D = this._findGlyphBoundingBox(ie, this._workBoundingBox, c, ee, te, E), O, k;
2562
+ for (;;) {
2563
+ if (this._activePages.length === 0) {
2564
+ let e = this._createNewPage();
2565
+ O = e, k = e.currentRow, k.height = D.size.y;
2566
+ break;
2567
+ }
2568
+ O = this._activePages[this._activePages.length - 1], k = O.currentRow;
2569
+ for (let e of this._activePages) D.size.y <= e.currentRow.height && (O = e, k = e.currentRow);
2570
+ for (let e = this._activePages.length - 1; e >= 0; e--) for (let t of this._activePages[e].fixedRows) t.height <= k.height && D.size.y <= t.height && (O = this._activePages[e], k = t);
2571
+ if (D.size.x > this._textureSize) {
2572
+ this._overflowSizePage || (this._overflowSizePage = new ft(this._document, this._config.deviceMaxTextureSize), this.pages.push(this._overflowSizePage), this._requestClearModel = !0, this._onAddTextureAtlasCanvas.fire(this._overflowSizePage.canvas)), O = this._overflowSizePage, k = this._overflowSizePage.currentRow, k.x + D.size.x >= O.canvas.width && (k.x = 0, k.y += k.height, k.height = 0);
2573
+ break;
2574
+ }
2575
+ if (k.y + D.size.y >= O.canvas.height || k.height > D.size.y + 2) {
2576
+ let t = !1;
2577
+ if (O.currentRow.y + O.currentRow.height + D.size.y >= O.canvas.height) {
2578
+ let n;
2579
+ for (let e of this._activePages) if (e.currentRow.y + e.currentRow.height + D.size.y < e.canvas.height) {
2580
+ n = e;
2581
+ break;
2582
+ }
2583
+ if (n) O = n;
2584
+ else if (e.maxAtlasPages && this._pages.length >= e.maxAtlasPages && k.y + D.size.y <= O.canvas.height && k.height >= D.size.y && k.x + D.size.x <= O.canvas.width) t = !0;
2585
+ else {
2586
+ let e = this._createNewPage();
2587
+ O = e, k = e.currentRow, k.height = D.size.y, t = !0;
2588
+ }
2589
+ }
2590
+ t || (O.currentRow.height > 0 && O.fixedRows.push(O.currentRow), k = {
2591
+ x: 0,
2592
+ y: O.currentRow.y + O.currentRow.height,
2593
+ height: D.size.y
2594
+ }, O.fixedRows.push(k), O.currentRow = {
2595
+ x: 0,
2596
+ y: k.y + k.height,
2597
+ height: 0
2598
+ });
2599
+ }
2600
+ if (k.x + D.size.x <= O.canvas.width) break;
2601
+ k === O.currentRow ? (k.x = 0, k.y += k.height, k.height = 0) : O.fixedRows.splice(O.fixedRows.indexOf(k), 1);
2602
+ }
2603
+ return D.texturePage = this._pages.indexOf(O), D.texturePosition.x = k.x, D.texturePosition.y = k.y, D.texturePositionClipSpace.x = k.x / O.canvas.width, D.texturePositionClipSpace.y = k.y / O.canvas.height, D.sizeClipSpace.x /= O.canvas.width, D.sizeClipSpace.y /= O.canvas.height, k.height = Math.max(k.height, D.size.y), k.x += D.size.x, O.ctx.putImageData(ie, D.texturePosition.x - this._workBoundingBox.left, D.texturePosition.y - this._workBoundingBox.top, this._workBoundingBox.left, this._workBoundingBox.top, D.size.x, D.size.y), O.addGlyph(D), O.version++, D;
2604
+ }
2605
+ _findGlyphBoundingBox(e, t, n, r, i, a) {
2606
+ t.top = 0;
2607
+ let o = r ? this._config.deviceCellHeight : this._tmpCanvas.height, s = r ? this._config.deviceCellWidth : n, c = !1;
2608
+ for (let n = 0; n < o; n++) {
2609
+ for (let r = 0; r < s; r++) {
2610
+ let i = n * this._tmpCanvas.width * 4 + r * 4 + 3;
2611
+ if (e.data[i] !== 0) {
2612
+ t.top = n, c = !0;
2613
+ break;
2614
+ }
2615
+ }
2616
+ if (c) break;
2617
+ }
2618
+ t.left = 0, c = !1;
2619
+ for (let n = 0; n < a + s; n++) {
2620
+ for (let r = 0; r < o; r++) {
2621
+ let i = r * this._tmpCanvas.width * 4 + n * 4 + 3;
2622
+ if (e.data[i] !== 0) {
2623
+ t.left = n, c = !0;
2624
+ break;
2625
+ }
2626
+ }
2627
+ if (c) break;
2628
+ }
2629
+ t.right = s, c = !1;
2630
+ for (let n = a + s - 1; n >= a; n--) {
2631
+ for (let r = 0; r < o; r++) {
2632
+ let i = r * this._tmpCanvas.width * 4 + n * 4 + 3;
2633
+ if (e.data[i] !== 0) {
2634
+ t.right = n, c = !0;
2635
+ break;
2636
+ }
2637
+ }
2638
+ if (c) break;
2639
+ }
2640
+ t.bottom = o, c = !1;
2641
+ for (let n = o - 1; n >= 0; n--) {
2642
+ for (let r = 0; r < s; r++) {
2643
+ let i = n * this._tmpCanvas.width * 4 + r * 4 + 3;
2644
+ if (e.data[i] !== 0) {
2645
+ t.bottom = n, c = !0;
2646
+ break;
2647
+ }
2648
+ }
2649
+ if (c) break;
2650
+ }
2651
+ return {
2652
+ texturePage: 0,
2653
+ texturePosition: {
2654
+ x: 0,
2655
+ y: 0
2656
+ },
2657
+ texturePositionClipSpace: {
2658
+ x: 0,
2659
+ y: 0
2660
+ },
2661
+ size: {
2662
+ x: t.right - t.left + 1,
2663
+ y: t.bottom - t.top + 1
2664
+ },
2665
+ sizeClipSpace: {
2666
+ x: t.right - t.left + 1,
2667
+ y: t.bottom - t.top + 1
2668
+ },
2669
+ offset: {
2670
+ x: -t.left + a + (r || i ? Math.floor((this._config.deviceCellWidth - this._config.deviceCharWidth) / 2) : 0),
2671
+ y: -t.top + a + (r || i ? this._config.lineHeight === 1 ? 0 : Math.round((this._config.deviceCellHeight - this._config.deviceCharHeight) / 2) : 0)
2672
+ }
2673
+ };
2674
+ }
2675
+ }, ft = class {
2676
+ constructor(e, t, n) {
2677
+ if (this._usedPixels = 0, this._glyphs = [], this.version = 0, this.currentRow = {
2678
+ x: 0,
2679
+ y: 0,
2680
+ height: 0
2681
+ }, this.fixedRows = [], n) for (let e of n) this._glyphs.push(...e.glyphs), this._usedPixels += e._usedPixels;
2682
+ this.canvas = ht(e, t, t), this.ctx = F(this.canvas.getContext("2d", { alpha: !0 }));
2683
+ }
2684
+ get percentageUsed() {
2685
+ return this._usedPixels / (this.canvas.width * this.canvas.height);
2686
+ }
2687
+ get glyphs() {
2688
+ return this._glyphs;
2689
+ }
2690
+ addGlyph(e) {
2691
+ this._glyphs.push(e), this._usedPixels += e.size.x * e.size.y;
2692
+ }
2693
+ clear() {
2694
+ 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++;
2695
+ }
2696
+ };
2697
+ function pt(e, t, n, r) {
2698
+ let i = t.rgba >>> 24, a = t.rgba >>> 16 & 255, o = t.rgba >>> 8 & 255, s = n.rgba >>> 24, c = n.rgba >>> 16 & 255, l = n.rgba >>> 8 & 255, u = Math.floor((Math.abs(i - s) + Math.abs(a - c) + Math.abs(o - l)) / 12), d = !0;
2699
+ for (let t = 0; t < e.data.length; t += 4) e.data[t] === i && e.data[t + 1] === a && e.data[t + 2] === o || r && Math.abs(e.data[t] - i) + Math.abs(e.data[t + 1] - a) + Math.abs(e.data[t + 2] - o) < u ? e.data[t + 3] = 0 : d = !1;
2700
+ return d;
2701
+ }
2702
+ function mt(e) {
2703
+ for (let t = 0; t < e.data.length; t += 4) if (e.data[t + 3] > 0) return !1;
2704
+ return !0;
2705
+ }
2706
+ function ht(e, t, n) {
2707
+ let r = e.createElement("canvas");
2708
+ return r.width = t, r.height = n, r;
2709
+ }
2710
+ function gt(e, t, n, r, i, a, o, s) {
2711
+ let c = {
2712
+ foreground: a.foreground,
2713
+ background: a.background,
2714
+ cursor: j,
2715
+ cursorAccent: j,
2716
+ selectionForeground: j,
2717
+ selectionBackgroundTransparent: j,
2718
+ selectionBackgroundOpaque: j,
2719
+ selectionInactiveBackgroundTransparent: j,
2720
+ selectionInactiveBackgroundOpaque: j,
2721
+ overviewRulerBorder: j,
2722
+ scrollbarSliderBackground: j,
2723
+ scrollbarSliderHoverBackground: j,
2724
+ scrollbarSliderActiveBackground: j,
2725
+ ansi: a.ansi.slice(),
2726
+ contrastCache: a.contrastCache,
2727
+ halfContrastCache: a.halfContrastCache
2728
+ };
2729
+ return {
2730
+ customGlyphs: i.customGlyphs,
2731
+ devicePixelRatio: o,
2732
+ deviceMaxTextureSize: s,
2733
+ letterSpacing: i.letterSpacing,
2734
+ lineHeight: i.lineHeight,
2735
+ deviceCellWidth: e,
2736
+ deviceCellHeight: t,
2737
+ deviceCharWidth: n,
2738
+ deviceCharHeight: r,
2739
+ fontFamily: i.fontFamily,
2740
+ fontSize: i.fontSize,
2741
+ fontWeight: i.fontWeight,
2742
+ fontWeightBold: i.fontWeightBold,
2743
+ allowTransparency: i.allowTransparency,
2744
+ drawBoldTextInBrightColors: i.drawBoldTextInBrightColors,
2745
+ minimumContrastRatio: i.minimumContrastRatio,
2746
+ colors: c
2747
+ };
2748
+ }
2749
+ function _t(e, t) {
2750
+ for (let n = 0; n < e.colors.ansi.length; n++) if (e.colors.ansi[n].rgba !== t.colors.ansi[n].rgba) return !1;
2751
+ return e.devicePixelRatio === t.devicePixelRatio && e.customGlyphs === t.customGlyphs && e.lineHeight === t.lineHeight && e.letterSpacing === t.letterSpacing && e.fontFamily === t.fontFamily && e.fontSize === t.fontSize && e.fontWeight === t.fontWeight && e.fontWeightBold === t.fontWeightBold && e.allowTransparency === t.allowTransparency && e.deviceCharWidth === t.deviceCharWidth && e.deviceCharHeight === t.deviceCharHeight && e.drawBoldTextInBrightColors === t.drawBoldTextInBrightColors && e.minimumContrastRatio === t.minimumContrastRatio && e.colors.foreground.rgba === t.colors.foreground.rgba && e.colors.background.rgba === t.colors.background.rgba;
2752
+ }
2753
+ function vt(e) {
2754
+ return (e & 50331648) == 16777216 || (e & 50331648) == 33554432;
2755
+ }
2756
+ var H = [];
2757
+ function yt(e, t, n, r, i, a, o, s, c) {
2758
+ let l = gt(r, i, a, o, t, n, s, c);
2759
+ for (let t = 0; t < H.length; t++) {
2760
+ let n = H[t], r = n.ownedBy.indexOf(e);
2761
+ if (r >= 0) {
2762
+ if (_t(n.config, l)) return n.atlas;
2763
+ n.ownedBy.length === 1 ? (n.atlas.dispose(), H.splice(t, 1)) : n.ownedBy.splice(r, 1);
2764
+ break;
2765
+ }
2766
+ }
2767
+ for (let t = 0; t < H.length; t++) {
2768
+ let n = H[t];
2769
+ if (_t(n.config, l)) return n.ownedBy.push(e), n.atlas;
2770
+ }
2771
+ let u = e._core, d = {
2772
+ atlas: new dt(document, l, u.unicodeService),
2773
+ config: l,
2774
+ ownedBy: [e]
2775
+ };
2776
+ return H.push(d), d.atlas;
2777
+ }
2778
+ function bt(e) {
2779
+ for (let t = 0; t < H.length; t++) {
2780
+ let n = H[t].ownedBy.indexOf(e);
2781
+ if (n !== -1) {
2782
+ H[t].ownedBy.length === 1 ? (H[t].atlas.dispose(), H.splice(t, 1)) : H[t].ownedBy.splice(n, 1);
2783
+ break;
2784
+ }
2785
+ }
2786
+ }
2787
+ var xt = 600, St = class {
2788
+ constructor(e, t) {
2789
+ this._renderCallback = e, this._coreBrowserService = t, this.isCursorVisible = !0, this._coreBrowserService.isFocused && this._restartInterval();
2790
+ }
2791
+ get isPaused() {
2792
+ return !(this._blinkStartTimeout || this._blinkInterval);
2793
+ }
2794
+ dispose() {
2795
+ this._blinkInterval &&= (this._coreBrowserService.window.clearInterval(this._blinkInterval), void 0), this._blinkStartTimeout &&= (this._coreBrowserService.window.clearTimeout(this._blinkStartTimeout), void 0), this._animationFrame &&= (this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame), void 0);
2796
+ }
2797
+ restartBlinkAnimation() {
2798
+ this.isPaused || (this._animationTimeRestarted = Date.now(), this.isCursorVisible = !0, this._animationFrame ||= this._coreBrowserService.window.requestAnimationFrame(() => {
2799
+ this._renderCallback(), this._animationFrame = void 0;
2800
+ }));
2801
+ }
2802
+ _restartInterval(e = xt) {
2803
+ this._blinkInterval &&= (this._coreBrowserService.window.clearInterval(this._blinkInterval), void 0), this._blinkStartTimeout = this._coreBrowserService.window.setTimeout(() => {
2804
+ if (this._animationTimeRestarted) {
2805
+ let e = xt - (Date.now() - this._animationTimeRestarted);
2806
+ if (this._animationTimeRestarted = void 0, e > 0) {
2807
+ this._restartInterval(e);
2808
+ return;
2809
+ }
2810
+ }
2811
+ this.isCursorVisible = !1, this._animationFrame = this._coreBrowserService.window.requestAnimationFrame(() => {
2812
+ this._renderCallback(), this._animationFrame = void 0;
2813
+ }), this._blinkInterval = this._coreBrowserService.window.setInterval(() => {
2814
+ if (this._animationTimeRestarted) {
2815
+ let e = xt - (Date.now() - this._animationTimeRestarted);
2816
+ this._animationTimeRestarted = void 0, this._restartInterval(e);
2817
+ return;
2818
+ }
2819
+ this.isCursorVisible = !this.isCursorVisible, this._animationFrame = this._coreBrowserService.window.requestAnimationFrame(() => {
2820
+ this._renderCallback(), this._animationFrame = void 0;
2821
+ });
2822
+ }, xt);
2823
+ }, e);
2824
+ }
2825
+ pause() {
2826
+ this.isCursorVisible = !0, this._blinkInterval &&= (this._coreBrowserService.window.clearInterval(this._blinkInterval), void 0), this._blinkStartTimeout &&= (this._coreBrowserService.window.clearTimeout(this._blinkStartTimeout), void 0), this._animationFrame &&= (this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame), void 0);
2827
+ }
2828
+ resume() {
2829
+ this.pause(), this._animationTimeRestarted = void 0, this._restartInterval(), this.restartBlinkAnimation();
2830
+ }
2831
+ };
2832
+ function Ct(e, t, n) {
2833
+ let r = new t.ResizeObserver((t) => {
2834
+ let i = t.find((t) => t.target === e);
2835
+ if (!i) return;
2836
+ if (!("devicePixelContentBoxSize" in i)) {
2837
+ r?.disconnect(), r = void 0;
2838
+ return;
2839
+ }
2840
+ let a = i.devicePixelContentBoxSize[0].inlineSize, o = i.devicePixelContentBoxSize[0].blockSize;
2841
+ a > 0 && o > 0 && n(a, o);
2842
+ });
2843
+ try {
2844
+ r.observe(e, { box: ["device-pixel-content-box"] });
2845
+ } catch {
2846
+ r.disconnect(), r = void 0;
2847
+ }
2848
+ return b(() => r?.disconnect());
2849
+ }
2850
+ function wt(e) {
2851
+ return e > 65535 ? (e -= 65536, String.fromCharCode((e >> 10) + 55296) + String.fromCharCode(e % 1024 + 56320)) : String.fromCharCode(e);
2852
+ }
2853
+ var Tt = class e extends Ge {
2854
+ constructor() {
2855
+ super(...arguments), this.content = 0, this.fg = 0, this.bg = 0, this.extended = new Ke(), this.combinedData = "";
2856
+ }
2857
+ static fromCharData(t) {
2858
+ let n = new e();
2859
+ return n.setFromCharData(t), n;
2860
+ }
2861
+ isCombined() {
2862
+ return this.content & 2097152;
2863
+ }
2864
+ getWidth() {
2865
+ return this.content >> 22;
2866
+ }
2867
+ getChars() {
2868
+ return this.content & 2097152 ? this.combinedData : this.content & 2097151 ? wt(this.content & 2097151) : "";
2869
+ }
2870
+ getCode() {
2871
+ return this.isCombined() ? this.combinedData.charCodeAt(this.combinedData.length - 1) : this.content & 2097151;
2872
+ }
2873
+ setFromCharData(e) {
2874
+ this.fg = e[0], this.bg = 0;
2875
+ let t = !1;
2876
+ if (e[1].length > 2) t = !0;
2877
+ else if (e[1].length === 2) {
2878
+ let n = e[1].charCodeAt(0);
2879
+ if (55296 <= n && n <= 56319) {
2880
+ let r = e[1].charCodeAt(1);
2881
+ 56320 <= r && r <= 57343 ? this.content = (n - 55296) * 1024 + r - 56320 + 65536 | e[2] << 22 : t = !0;
2882
+ } else t = !0;
2883
+ } else this.content = e[1].charCodeAt(0) | e[2] << 22;
2884
+ t && (this.combinedData = e[1], this.content = 2097152 | e[2] << 22);
2885
+ }
2886
+ getAsCharData() {
2887
+ return [
2888
+ this.fg,
2889
+ this.getChars(),
2890
+ this.getWidth(),
2891
+ this.getCode()
2892
+ ];
2893
+ }
2894
+ }, Et = new Float32Array([
2895
+ 2,
2896
+ 0,
2897
+ 0,
2898
+ 0,
2899
+ 0,
2900
+ -2,
2901
+ 0,
2902
+ 0,
2903
+ 0,
2904
+ 0,
2905
+ 1,
2906
+ 0,
2907
+ -1,
2908
+ 1,
2909
+ 0,
2910
+ 1
2911
+ ]);
2912
+ function Dt(e, t, n) {
2913
+ let r = F(e.createProgram());
2914
+ if (e.attachShader(r, F(Ot(e, e.VERTEX_SHADER, t))), e.attachShader(r, F(Ot(e, e.FRAGMENT_SHADER, n))), e.linkProgram(r), e.getProgramParameter(r, e.LINK_STATUS)) return r;
2915
+ console.error(e.getProgramInfoLog(r)), e.deleteProgram(r);
2916
+ }
2917
+ function Ot(e, t, n) {
2918
+ let r = F(e.createShader(t));
2919
+ if (e.shaderSource(r, n), e.compileShader(r), e.getShaderParameter(r, e.COMPILE_STATUS)) return r;
2920
+ console.error(e.getShaderInfoLog(r)), e.deleteShader(r);
2921
+ }
2922
+ function kt(e, t) {
2923
+ let n = Math.min(e.length * 2, t), r = new Float32Array(n);
2924
+ for (let t = 0; t < e.length; t++) r[t] = e[t];
2925
+ return r;
2926
+ }
2927
+ var At = class {
2928
+ constructor(e) {
2929
+ this.texture = e, this.version = -1;
2930
+ }
2931
+ }, jt = "#version 300 es\nlayout (location = 0) in vec2 a_unitquad;\nlayout (location = 1) in vec2 a_cellpos;\nlayout (location = 2) in vec2 a_offset;\nlayout (location = 3) in vec2 a_size;\nlayout (location = 4) in float a_texpage;\nlayout (location = 5) in vec2 a_texcoord;\nlayout (location = 6) in vec2 a_texsize;\n\nuniform mat4 u_projection;\nuniform vec2 u_resolution;\n\nout vec2 v_texcoord;\nflat out int v_texpage;\n\nvoid main() {\n vec2 zeroToOne = (a_offset / u_resolution) + a_cellpos + (a_unitquad * a_size);\n gl_Position = u_projection * vec4(zeroToOne, 0.0, 1.0);\n v_texpage = int(a_texpage);\n v_texcoord = a_texcoord + a_unitquad * a_texsize;\n}";
2932
+ function Mt(e) {
2933
+ let t = "";
2934
+ for (let n = 1; n < e; n++) t += ` else if (v_texpage == ${n}) { outColor = texture(u_texture[${n}], v_texcoord); }`;
2935
+ return `#version 300 es
2936
+ precision lowp float;
2937
+
2938
+ in vec2 v_texcoord;
2939
+ flat in int v_texpage;
2940
+
2941
+ uniform sampler2D u_texture[${e}];
2942
+
2943
+ out vec4 outColor;
2944
+
2945
+ void main() {
2946
+ if (v_texpage == 0) {
2947
+ outColor = texture(u_texture[0], v_texcoord);
2948
+ } ${t}
2949
+ }`;
2950
+ }
2951
+ var Nt = 11, Pt = Nt * Float32Array.BYTES_PER_ELEMENT, Ft = 2, U = 0, W, It = 0, Lt = 0, Rt = class extends C {
2952
+ constructor(e, t, n, r) {
2953
+ super(), this._terminal = e, this._gl = t, this._dimensions = n, this._optionsService = r, this._activeBuffer = 0, this._vertices = {
2954
+ count: 0,
2955
+ attributes: /* @__PURE__ */ new Float32Array(),
2956
+ attributesBuffers: [/* @__PURE__ */ new Float32Array(), /* @__PURE__ */ new Float32Array()]
2957
+ };
2958
+ let i = this._gl;
2959
+ dt.maxAtlasPages === void 0 && (dt.maxAtlasPages = Math.min(32, F(i.getParameter(i.MAX_TEXTURE_IMAGE_UNITS))), dt.maxTextureSize = F(i.getParameter(i.MAX_TEXTURE_SIZE))), this._program = F(Dt(i, jt, Mt(dt.maxAtlasPages))), this._register(b(() => i.deleteProgram(this._program))), this._projectionLocation = F(i.getUniformLocation(this._program, "u_projection")), this._resolutionLocation = F(i.getUniformLocation(this._program, "u_resolution")), this._textureLocation = F(i.getUniformLocation(this._program, "u_texture")), this._vertexArrayObject = i.createVertexArray(), i.bindVertexArray(this._vertexArrayObject);
2960
+ let a = new Float32Array([
2961
+ 0,
2962
+ 0,
2963
+ 1,
2964
+ 0,
2965
+ 0,
2966
+ 1,
2967
+ 1,
2968
+ 1
2969
+ ]), o = i.createBuffer();
2970
+ this._register(b(() => i.deleteBuffer(o))), i.bindBuffer(i.ARRAY_BUFFER, o), i.bufferData(i.ARRAY_BUFFER, a, i.STATIC_DRAW), i.enableVertexAttribArray(0), i.vertexAttribPointer(0, 2, this._gl.FLOAT, !1, 0, 0);
2971
+ let s = new Uint8Array([
2972
+ 0,
2973
+ 1,
2974
+ 2,
2975
+ 3
2976
+ ]), c = i.createBuffer();
2977
+ this._register(b(() => i.deleteBuffer(c))), i.bindBuffer(i.ELEMENT_ARRAY_BUFFER, c), i.bufferData(i.ELEMENT_ARRAY_BUFFER, s, i.STATIC_DRAW), this._attributesBuffer = F(i.createBuffer()), this._register(b(() => i.deleteBuffer(this._attributesBuffer))), i.bindBuffer(i.ARRAY_BUFFER, this._attributesBuffer), i.enableVertexAttribArray(2), i.vertexAttribPointer(2, 2, i.FLOAT, !1, Pt, 0), i.vertexAttribDivisor(2, 1), i.enableVertexAttribArray(3), i.vertexAttribPointer(3, 2, i.FLOAT, !1, Pt, 2 * Float32Array.BYTES_PER_ELEMENT), i.vertexAttribDivisor(3, 1), i.enableVertexAttribArray(4), i.vertexAttribPointer(4, 1, i.FLOAT, !1, Pt, 4 * Float32Array.BYTES_PER_ELEMENT), i.vertexAttribDivisor(4, 1), i.enableVertexAttribArray(5), i.vertexAttribPointer(5, 2, i.FLOAT, !1, Pt, 5 * Float32Array.BYTES_PER_ELEMENT), i.vertexAttribDivisor(5, 1), i.enableVertexAttribArray(6), i.vertexAttribPointer(6, 2, i.FLOAT, !1, Pt, 7 * Float32Array.BYTES_PER_ELEMENT), i.vertexAttribDivisor(6, 1), i.enableVertexAttribArray(1), i.vertexAttribPointer(1, 2, i.FLOAT, !1, Pt, 9 * Float32Array.BYTES_PER_ELEMENT), i.vertexAttribDivisor(1, 1), i.useProgram(this._program);
2978
+ let l = new Int32Array(dt.maxAtlasPages);
2979
+ for (let e = 0; e < dt.maxAtlasPages; e++) l[e] = e;
2980
+ i.uniform1iv(this._textureLocation, l), i.uniformMatrix4fv(this._projectionLocation, !1, Et), this._atlasTextures = [];
2981
+ for (let e = 0; e < dt.maxAtlasPages; e++) {
2982
+ let t = new At(F(i.createTexture()));
2983
+ this._register(b(() => i.deleteTexture(t.texture))), i.activeTexture(i.TEXTURE0 + e), i.bindTexture(i.TEXTURE_2D, t.texture), i.texParameteri(i.TEXTURE_2D, i.TEXTURE_WRAP_S, i.CLAMP_TO_EDGE), i.texParameteri(i.TEXTURE_2D, i.TEXTURE_WRAP_T, i.CLAMP_TO_EDGE), i.texImage2D(i.TEXTURE_2D, 0, i.RGBA, 1, 1, 0, i.RGBA, i.UNSIGNED_BYTE, new Uint8Array([
2984
+ 255,
2985
+ 0,
2986
+ 0,
2987
+ 255
2988
+ ])), this._atlasTextures[e] = t;
2989
+ }
2990
+ i.enable(i.BLEND), i.blendFunc(i.SRC_ALPHA, i.ONE_MINUS_SRC_ALPHA), this.handleResize();
2991
+ }
2992
+ beginFrame() {
2993
+ return !this._atlas || this._atlas.beginFrame();
2994
+ }
2995
+ updateCell(e, t, n, r, i, a, o, s, c) {
2996
+ this._updateCell(this._vertices.attributes, e, t, n, r, i, a, o, s, c);
2997
+ }
2998
+ _updateCell(e, t, n, r, i, a, o, s, c, l) {
2999
+ if (U = (n * this._terminal.cols + t) * Nt, r === 0 || r === void 0) {
3000
+ e.fill(0, U, U + Nt - 1 - Ft);
3001
+ return;
3002
+ }
3003
+ this._atlas && (W = s && s.length > 1 ? this._atlas.getRasterizedGlyphCombinedChar(s, i, a, o, !1, this._terminal.element) : this._atlas.getRasterizedGlyph(r, i, a, o, !1, this._terminal.element), It = Math.floor((this._dimensions.device.cell.width - this._dimensions.device.char.width) / 2), i !== l && W.offset.x > It ? (Lt = W.offset.x - It, e[U] = -(W.offset.x - Lt) + this._dimensions.device.char.left, e[U + 1] = -W.offset.y + this._dimensions.device.char.top, e[U + 2] = (W.size.x - Lt) / this._dimensions.device.canvas.width, e[U + 3] = W.size.y / this._dimensions.device.canvas.height, e[U + 4] = W.texturePage, e[U + 5] = W.texturePositionClipSpace.x + Lt / this._atlas.pages[W.texturePage].canvas.width, e[U + 6] = W.texturePositionClipSpace.y, e[U + 7] = W.sizeClipSpace.x - Lt / this._atlas.pages[W.texturePage].canvas.width, e[U + 8] = W.sizeClipSpace.y) : (e[U] = -W.offset.x + this._dimensions.device.char.left, e[U + 1] = -W.offset.y + this._dimensions.device.char.top, e[U + 2] = W.size.x / this._dimensions.device.canvas.width, e[U + 3] = W.size.y / this._dimensions.device.canvas.height, e[U + 4] = W.texturePage, e[U + 5] = W.texturePositionClipSpace.x, e[U + 6] = W.texturePositionClipSpace.y, e[U + 7] = W.sizeClipSpace.x, e[U + 8] = W.sizeClipSpace.y), this._optionsService.rawOptions.rescaleOverlappingGlyphs && he(r, c, W.size.x, this._dimensions.device.cell.width) && (e[U + 2] = (this._dimensions.device.cell.width - 1) / this._dimensions.device.canvas.width));
3004
+ }
3005
+ clear() {
3006
+ let e = this._terminal, t = e.cols * e.rows * Nt;
3007
+ this._vertices.count === t ? this._vertices.attributes.fill(0) : this._vertices.attributes = new Float32Array(t);
3008
+ let n = 0;
3009
+ for (; n < this._vertices.attributesBuffers.length; n++) this._vertices.count === t ? this._vertices.attributesBuffers[n].fill(0) : this._vertices.attributesBuffers[n] = new Float32Array(t);
3010
+ this._vertices.count = t, n = 0;
3011
+ for (let t = 0; t < e.rows; t++) for (let r = 0; r < e.cols; r++) this._vertices.attributes[n + 9] = r / e.cols, this._vertices.attributes[n + 10] = t / e.rows, n += Nt;
3012
+ }
3013
+ handleResize() {
3014
+ let e = this._gl;
3015
+ e.useProgram(this._program), e.viewport(0, 0, e.canvas.width, e.canvas.height), e.uniform2f(this._resolutionLocation, e.canvas.width, e.canvas.height), this.clear();
3016
+ }
3017
+ render(e) {
3018
+ if (!this._atlas) return;
3019
+ let t = this._gl;
3020
+ t.useProgram(this._program), t.bindVertexArray(this._vertexArrayObject), this._activeBuffer = (this._activeBuffer + 1) % 2;
3021
+ let n = this._vertices.attributesBuffers[this._activeBuffer], r = 0;
3022
+ for (let t = 0; t < e.lineLengths.length; t++) {
3023
+ let i = t * this._terminal.cols * Nt, a = this._vertices.attributes.subarray(i, i + e.lineLengths[t] * Nt);
3024
+ n.set(a, r), r += a.length;
3025
+ }
3026
+ t.bindBuffer(t.ARRAY_BUFFER, this._attributesBuffer), t.bufferData(t.ARRAY_BUFFER, n.subarray(0, r), t.STREAM_DRAW);
3027
+ for (let e = 0; e < this._atlas.pages.length; e++) this._atlas.pages[e].version !== this._atlasTextures[e].version && this._bindAtlasPageTexture(t, this._atlas, e);
3028
+ t.drawElementsInstanced(t.TRIANGLE_STRIP, 4, t.UNSIGNED_BYTE, 0, r / Nt);
3029
+ }
3030
+ setAtlas(e) {
3031
+ this._atlas = e;
3032
+ for (let e of this._atlasTextures) e.version = -1;
3033
+ }
3034
+ _bindAtlasPageTexture(e, t, n) {
3035
+ e.activeTexture(e.TEXTURE0 + n), e.bindTexture(e.TEXTURE_2D, this._atlasTextures[n].texture), e.texParameteri(e.TEXTURE_2D, e.TEXTURE_WRAP_S, e.CLAMP_TO_EDGE), e.texParameteri(e.TEXTURE_2D, e.TEXTURE_WRAP_T, e.CLAMP_TO_EDGE), e.texImage2D(e.TEXTURE_2D, 0, e.RGBA, e.RGBA, e.UNSIGNED_BYTE, t.pages[n].canvas), e.generateMipmap(e.TEXTURE_2D), this._atlasTextures[n].version = t.pages[n].version;
3036
+ }
3037
+ setDimensions(e) {
3038
+ this._dimensions = e;
3039
+ }
3040
+ }, zt = class {
3041
+ constructor() {
3042
+ this.clear();
3043
+ }
3044
+ clear() {
3045
+ 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;
3046
+ }
3047
+ update(e, t, n, r = !1) {
3048
+ if (this.selectionStart = t, this.selectionEnd = n, !t || !n || t[0] === n[0] && t[1] === n[1]) {
3049
+ this.clear();
3050
+ return;
3051
+ }
3052
+ let i = e.buffers.active.ydisp, a = t[1] - i, o = n[1] - i, s = Math.max(a, 0), c = Math.min(o, e.rows - 1);
3053
+ if (s >= e.rows || c < 0) {
3054
+ this.clear();
3055
+ return;
3056
+ }
3057
+ this.hasSelection = !0, this.columnSelectMode = r, this.viewportStartRow = a, this.viewportEndRow = o, this.viewportCappedStartRow = s, this.viewportCappedEndRow = c, this.startCol = t[0], this.endCol = n[0];
3058
+ }
3059
+ isCellSelected(e, t, n) {
3060
+ return this.hasSelection ? (n -= e.buffer.active.viewportY, this.columnSelectMode ? this.startCol <= this.endCol ? t >= this.startCol && n >= this.viewportCappedStartRow && t < this.endCol && n <= this.viewportCappedEndRow : t < this.startCol && n >= this.viewportCappedStartRow && t >= this.endCol && n <= this.viewportCappedEndRow : n > this.viewportStartRow && n < this.viewportEndRow || this.viewportStartRow === this.viewportEndRow && n === this.viewportStartRow && t >= this.startCol && t < this.endCol || this.viewportStartRow < this.viewportEndRow && n === this.viewportEndRow && t < this.endCol || this.viewportStartRow < this.viewportEndRow && n === this.viewportStartRow && t >= this.startCol) : !1;
3061
+ }
3062
+ };
3063
+ function Bt() {
3064
+ return new zt();
3065
+ }
3066
+ var Vt = 4, Ht = 1, Ut = 2, Wt = 3, Gt = 2147483648, Kt = class {
3067
+ constructor() {
3068
+ this.cells = /* @__PURE__ */ new Uint32Array(), this.lineLengths = /* @__PURE__ */ new Uint32Array(), this.selection = Bt();
3069
+ }
3070
+ resize(e, t) {
3071
+ let n = e * t * Vt;
3072
+ n !== this.cells.length && (this.cells = new Uint32Array(n), this.lineLengths = new Uint32Array(t));
3073
+ }
3074
+ clear() {
3075
+ this.cells.fill(0, 0), this.lineLengths.fill(0, 0);
3076
+ }
3077
+ }, qt = "#version 300 es\nlayout (location = 0) in vec2 a_position;\nlayout (location = 1) in vec2 a_size;\nlayout (location = 2) in vec4 a_color;\nlayout (location = 3) in vec2 a_unitquad;\n\nuniform mat4 u_projection;\n\nout vec4 v_color;\n\nvoid main() {\n vec2 zeroToOne = a_position + (a_unitquad * a_size);\n gl_Position = u_projection * vec4(zeroToOne, 0.0, 1.0);\n v_color = a_color;\n}", Jt = "#version 300 es\nprecision lowp float;\n\nin vec4 v_color;\n\nout vec4 outColor;\n\nvoid main() {\n outColor = v_color;\n}", G = 8, Yt = G * Float32Array.BYTES_PER_ELEMENT, Xt = 20 * G, Zt = class {
3078
+ constructor() {
3079
+ this.attributes = new Float32Array(Xt), this.count = 0;
3080
+ }
3081
+ }, K = 0, Qt = 0, $t = 0, en = 0, tn = 0, nn = 0, rn = 0, an = class extends C {
3082
+ constructor(e, t, n, r) {
3083
+ super(), this._terminal = e, this._gl = t, this._dimensions = n, this._themeService = r, this._vertices = new Zt(), this._verticesCursor = new Zt();
3084
+ let i = this._gl;
3085
+ this._program = F(Dt(i, qt, Jt)), this._register(b(() => i.deleteProgram(this._program))), this._projectionLocation = F(i.getUniformLocation(this._program, "u_projection")), this._vertexArrayObject = i.createVertexArray(), i.bindVertexArray(this._vertexArrayObject);
3086
+ let a = new Float32Array([
3087
+ 0,
3088
+ 0,
3089
+ 1,
3090
+ 0,
3091
+ 0,
3092
+ 1,
3093
+ 1,
3094
+ 1
3095
+ ]), o = i.createBuffer();
3096
+ this._register(b(() => i.deleteBuffer(o))), i.bindBuffer(i.ARRAY_BUFFER, o), i.bufferData(i.ARRAY_BUFFER, a, i.STATIC_DRAW), i.enableVertexAttribArray(3), i.vertexAttribPointer(3, 2, this._gl.FLOAT, !1, 0, 0);
3097
+ let s = new Uint8Array([
3098
+ 0,
3099
+ 1,
3100
+ 2,
3101
+ 3
3102
+ ]), c = i.createBuffer();
3103
+ this._register(b(() => i.deleteBuffer(c))), i.bindBuffer(i.ELEMENT_ARRAY_BUFFER, c), i.bufferData(i.ELEMENT_ARRAY_BUFFER, s, i.STATIC_DRAW), this._attributesBuffer = F(i.createBuffer()), this._register(b(() => i.deleteBuffer(this._attributesBuffer))), i.bindBuffer(i.ARRAY_BUFFER, this._attributesBuffer), i.enableVertexAttribArray(0), i.vertexAttribPointer(0, 2, i.FLOAT, !1, Yt, 0), i.vertexAttribDivisor(0, 1), i.enableVertexAttribArray(1), i.vertexAttribPointer(1, 2, i.FLOAT, !1, Yt, 2 * Float32Array.BYTES_PER_ELEMENT), i.vertexAttribDivisor(1, 1), i.enableVertexAttribArray(2), i.vertexAttribPointer(2, 4, i.FLOAT, !1, Yt, 4 * Float32Array.BYTES_PER_ELEMENT), i.vertexAttribDivisor(2, 1), this._updateCachedColors(r.colors), this._register(this._themeService.onChangeColors((e) => {
3104
+ this._updateCachedColors(e), this._updateViewportRectangle();
3105
+ }));
3106
+ }
3107
+ renderBackgrounds() {
3108
+ this._renderVertices(this._vertices);
3109
+ }
3110
+ renderCursor() {
3111
+ this._renderVertices(this._verticesCursor);
3112
+ }
3113
+ _renderVertices(e) {
3114
+ let t = this._gl;
3115
+ t.useProgram(this._program), t.bindVertexArray(this._vertexArrayObject), t.uniformMatrix4fv(this._projectionLocation, !1, Et), t.bindBuffer(t.ARRAY_BUFFER, this._attributesBuffer), t.bufferData(t.ARRAY_BUFFER, e.attributes, t.DYNAMIC_DRAW), t.drawElementsInstanced(this._gl.TRIANGLE_STRIP, 4, t.UNSIGNED_BYTE, 0, e.count);
3116
+ }
3117
+ handleResize() {
3118
+ this._updateViewportRectangle();
3119
+ }
3120
+ setDimensions(e) {
3121
+ this._dimensions = e;
3122
+ }
3123
+ _updateCachedColors(e) {
3124
+ this._bgFloat = this._colorToFloat32Array(e.background), this._cursorFloat = this._colorToFloat32Array(e.cursor);
3125
+ }
3126
+ _updateViewportRectangle() {
3127
+ this._addRectangleFloat(this._vertices.attributes, 0, 0, 0, this._terminal.cols * this._dimensions.device.cell.width, this._terminal.rows * this._dimensions.device.cell.height, this._bgFloat);
3128
+ }
3129
+ updateBackgrounds(e) {
3130
+ let t = this._terminal, n = this._vertices, r = 1, i, a, o, s, c, l, u, d, f, p, m;
3131
+ for (i = 0; i < t.rows; i++) {
3132
+ for (o = -1, s = 0, c = 0, l = !1, a = 0; a < t.cols; a++) u = (i * t.cols + a) * Vt, d = e.cells[u + Ht], f = e.cells[u + Ut], p = !!(f & 67108864), (d !== s || f !== c && (l || p)) && ((s !== 0 || l && c !== 0) && (m = r++ * G, this._updateRectangle(n, m, c, s, o, a, i)), o = a, s = d, c = f, l = p);
3133
+ (s !== 0 || l && c !== 0) && (m = r++ * G, this._updateRectangle(n, m, c, s, o, t.cols, i));
3134
+ }
3135
+ n.count = r;
3136
+ }
3137
+ updateCursor(e) {
3138
+ let t = this._verticesCursor, n = e.cursor;
3139
+ if (!n || n.style === "block") {
3140
+ t.count = 0;
3141
+ return;
3142
+ }
3143
+ let r, i = 0;
3144
+ (n.style === "bar" || n.style === "outline") && (r = i++ * G, this._addRectangleFloat(t.attributes, r, n.x * this._dimensions.device.cell.width, n.y * this._dimensions.device.cell.height, n.style === "bar" ? n.dpr * n.cursorWidth : n.dpr, this._dimensions.device.cell.height, this._cursorFloat)), (n.style === "underline" || n.style === "outline") && (r = i++ * G, this._addRectangleFloat(t.attributes, r, n.x * this._dimensions.device.cell.width, (n.y + 1) * this._dimensions.device.cell.height - n.dpr, n.width * this._dimensions.device.cell.width, n.dpr, this._cursorFloat)), n.style === "outline" && (r = i++ * G, this._addRectangleFloat(t.attributes, r, n.x * this._dimensions.device.cell.width, n.y * this._dimensions.device.cell.height, n.width * this._dimensions.device.cell.width, n.dpr, this._cursorFloat), r = i++ * G, this._addRectangleFloat(t.attributes, r, (n.x + n.width) * this._dimensions.device.cell.width - n.dpr, n.y * this._dimensions.device.cell.height, n.dpr, this._dimensions.device.cell.height, this._cursorFloat)), t.count = i;
3145
+ }
3146
+ _updateRectangle(e, t, n, r, i, a, o) {
3147
+ if (n & 67108864) switch (n & 50331648) {
3148
+ case 16777216:
3149
+ case 33554432:
3150
+ K = this._themeService.colors.ansi[n & 255].rgba;
3151
+ break;
3152
+ case 50331648:
3153
+ K = (n & 16777215) << 8;
3154
+ break;
3155
+ default: K = this._themeService.colors.foreground.rgba;
3156
+ }
3157
+ else switch (r & 50331648) {
3158
+ case 16777216:
3159
+ case 33554432:
3160
+ K = this._themeService.colors.ansi[r & 255].rgba;
3161
+ break;
3162
+ case 50331648:
3163
+ K = (r & 16777215) << 8;
3164
+ break;
3165
+ default: K = this._themeService.colors.background.rgba;
3166
+ }
3167
+ e.attributes.length < t + 4 && (e.attributes = kt(e.attributes, this._terminal.rows * this._terminal.cols * G)), Qt = i * this._dimensions.device.cell.width, $t = o * this._dimensions.device.cell.height, en = (K >> 24 & 255) / 255, tn = (K >> 16 & 255) / 255, nn = (K >> 8 & 255) / 255, rn = 1, this._addRectangle(e.attributes, t, Qt, $t, (a - i) * this._dimensions.device.cell.width, this._dimensions.device.cell.height, en, tn, nn, rn);
3168
+ }
3169
+ _addRectangle(e, t, n, r, i, a, o, s, c, l) {
3170
+ e[t] = n / this._dimensions.device.canvas.width, e[t + 1] = r / this._dimensions.device.canvas.height, e[t + 2] = i / this._dimensions.device.canvas.width, e[t + 3] = a / this._dimensions.device.canvas.height, e[t + 4] = o, e[t + 5] = s, e[t + 6] = c, e[t + 7] = l;
3171
+ }
3172
+ _addRectangleFloat(e, t, n, r, i, a, o) {
3173
+ e[t] = n / this._dimensions.device.canvas.width, e[t + 1] = r / this._dimensions.device.canvas.height, e[t + 2] = i / this._dimensions.device.canvas.width, e[t + 3] = a / this._dimensions.device.canvas.height, e[t + 4] = o[0], e[t + 5] = o[1], e[t + 6] = o[2], e[t + 7] = o[3];
3174
+ }
3175
+ _colorToFloat32Array(e) {
3176
+ return new Float32Array([
3177
+ (e.rgba >> 24 & 255) / 255,
3178
+ (e.rgba >> 16 & 255) / 255,
3179
+ (e.rgba >> 8 & 255) / 255,
3180
+ (e.rgba & 255) / 255
3181
+ ]);
3182
+ }
3183
+ }, on = class extends C {
3184
+ constructor(e, t, n, r, i, a, o, s) {
3185
+ super(), this._container = t, this._alpha = i, this._coreBrowserService = a, this._optionsService = o, this._themeService = s, this._deviceCharWidth = 0, this._deviceCharHeight = 0, this._deviceCellWidth = 0, this._deviceCellHeight = 0, this._deviceCharLeft = 0, this._deviceCharTop = 0, this._canvas = this._coreBrowserService.mainDocument.createElement("canvas"), this._canvas.classList.add(`xterm-${n}-layer`), this._canvas.style.zIndex = r.toString(), this._initCanvas(), this._container.appendChild(this._canvas), this._register(this._themeService.onChangeColors((t) => {
3186
+ this._refreshCharAtlas(e, t), this.reset(e);
3187
+ })), this._register(b(() => {
3188
+ this._canvas.remove();
3189
+ }));
3190
+ }
3191
+ _initCanvas() {
3192
+ this._ctx = F(this._canvas.getContext("2d", { alpha: this._alpha })), this._alpha || this._clearAll();
3193
+ }
3194
+ handleBlur(e) {}
3195
+ handleFocus(e) {}
3196
+ handleCursorMove(e) {}
3197
+ handleGridChanged(e, t, n) {}
3198
+ handleSelectionChanged(e, t, n, r = !1) {}
3199
+ _setTransparency(e, t) {
3200
+ if (t === this._alpha) return;
3201
+ let n = this._canvas;
3202
+ this._alpha = t, this._canvas = this._canvas.cloneNode(), this._initCanvas(), this._container.replaceChild(this._canvas, n), this._refreshCharAtlas(e, this._themeService.colors), this.handleGridChanged(e, 0, e.rows - 1);
3203
+ }
3204
+ _refreshCharAtlas(e, t) {
3205
+ this._deviceCharWidth <= 0 && this._deviceCharHeight <= 0 || (this._charAtlas = yt(e, this._optionsService.rawOptions, t, this._deviceCellWidth, this._deviceCellHeight, this._deviceCharWidth, this._deviceCharHeight, this._coreBrowserService.dpr, 2048), this._charAtlas.warmUp());
3206
+ }
3207
+ resize(e, t) {
3208
+ this._deviceCellWidth = t.device.cell.width, this._deviceCellHeight = t.device.cell.height, this._deviceCharWidth = t.device.char.width, this._deviceCharHeight = t.device.char.height, this._deviceCharLeft = t.device.char.left, this._deviceCharTop = t.device.char.top, this._canvas.width = t.device.canvas.width, this._canvas.height = t.device.canvas.height, this._canvas.style.width = `${t.css.canvas.width}px`, this._canvas.style.height = `${t.css.canvas.height}px`, this._alpha || this._clearAll(), this._refreshCharAtlas(e, this._themeService.colors);
3209
+ }
3210
+ _fillBottomLineAtCells(e, t, n = 1) {
3211
+ this._ctx.fillRect(e * this._deviceCellWidth, (t + 1) * this._deviceCellHeight - this._coreBrowserService.dpr - 1, n * this._deviceCellWidth, this._coreBrowserService.dpr);
3212
+ }
3213
+ _clearAll() {
3214
+ 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));
3215
+ }
3216
+ _clearCells(e, t, n, r) {
3217
+ this._alpha ? this._ctx.clearRect(e * this._deviceCellWidth, t * this._deviceCellHeight, n * this._deviceCellWidth, r * this._deviceCellHeight) : (this._ctx.fillStyle = this._themeService.colors.background.css, this._ctx.fillRect(e * this._deviceCellWidth, t * this._deviceCellHeight, n * this._deviceCellWidth, r * this._deviceCellHeight));
3218
+ }
3219
+ _fillCharTrueColor(e, t, n, r) {
3220
+ this._ctx.font = this._getFont(e, !1, !1), this._ctx.textBaseline = Te, this._clipCell(n, r, t.getWidth()), this._ctx.fillText(t.getChars(), n * this._deviceCellWidth + this._deviceCharLeft, r * this._deviceCellHeight + this._deviceCharTop + this._deviceCharHeight);
3221
+ }
3222
+ _clipCell(e, t, n) {
3223
+ this._ctx.beginPath(), this._ctx.rect(e * this._deviceCellWidth, t * this._deviceCellHeight, n * this._deviceCellWidth, this._deviceCellHeight), this._ctx.clip();
3224
+ }
3225
+ _getFont(e, t, n) {
3226
+ let r = t ? e.options.fontWeightBold : e.options.fontWeight;
3227
+ return `${n ? "italic" : ""} ${r} ${e.options.fontSize * this._coreBrowserService.dpr}px ${e.options.fontFamily}`;
3228
+ }
3229
+ }, sn = class extends on {
3230
+ constructor(e, t, n, r, i, a, o) {
3231
+ super(n, e, "link", t, !0, i, a, o), this._register(r.onShowLinkUnderline((e) => this._handleShowLinkUnderline(e))), this._register(r.onHideLinkUnderline((e) => this._handleHideLinkUnderline(e)));
3232
+ }
3233
+ resize(e, t) {
3234
+ super.resize(e, t), this._state = void 0;
3235
+ }
3236
+ reset(e) {
3237
+ this._clearCurrentLink();
3238
+ }
3239
+ _clearCurrentLink() {
3240
+ if (this._state) {
3241
+ this._clearCells(this._state.x1, this._state.y1, this._state.cols - this._state.x1, 1);
3242
+ let e = this._state.y2 - this._state.y1 - 1;
3243
+ e > 0 && this._clearCells(0, this._state.y1 + 1, this._state.cols, e), this._clearCells(0, this._state.y2, this._state.x2, 1), this._state = void 0;
3244
+ }
3245
+ }
3246
+ _handleShowLinkUnderline(e) {
3247
+ if (e.fg === 257 ? this._ctx.fillStyle = this._themeService.colors.background.css : e.fg !== void 0 && vt(e.fg) ? this._ctx.fillStyle = this._themeService.colors.ansi[e.fg].css : this._ctx.fillStyle = this._themeService.colors.foreground.css, e.y1 === e.y2) this._fillBottomLineAtCells(e.x1, e.y1, e.x2 - e.x1);
3248
+ else {
3249
+ this._fillBottomLineAtCells(e.x1, e.y1, e.cols - e.x1);
3250
+ for (let t = e.y1 + 1; t < e.y2; t++) this._fillBottomLineAtCells(0, t, e.cols);
3251
+ this._fillBottomLineAtCells(0, e.y2, e.x2);
3252
+ }
3253
+ this._state = e;
3254
+ }
3255
+ _handleHideLinkUnderline(e) {
3256
+ this._clearCurrentLink();
3257
+ }
3258
+ }, q = typeof window == "object" ? window : globalThis, cn = class {
3259
+ constructor() {
3260
+ this.mapWindowIdToZoomLevel = /* @__PURE__ */ new Map(), this._onDidChangeZoomLevel = new V(), this.onDidChangeZoomLevel = this._onDidChangeZoomLevel.event, this.mapWindowIdToZoomFactor = /* @__PURE__ */ new Map(), this._onDidChangeFullscreen = new V(), this.onDidChangeFullscreen = this._onDidChangeFullscreen.event, this.mapWindowIdToFullScreen = /* @__PURE__ */ new Map();
3261
+ }
3262
+ getZoomLevel(e) {
3263
+ return this.mapWindowIdToZoomLevel.get(this.getWindowId(e)) ?? 0;
3264
+ }
3265
+ setZoomLevel(e, t) {
3266
+ if (this.getZoomLevel(t) === e) return;
3267
+ let n = this.getWindowId(t);
3268
+ this.mapWindowIdToZoomLevel.set(n, e), this._onDidChangeZoomLevel.fire(n);
3269
+ }
3270
+ getZoomFactor(e) {
3271
+ return this.mapWindowIdToZoomFactor.get(this.getWindowId(e)) ?? 1;
3272
+ }
3273
+ setZoomFactor(e, t) {
3274
+ this.mapWindowIdToZoomFactor.set(this.getWindowId(t), e);
3275
+ }
3276
+ setFullscreen(e, t) {
3277
+ if (this.isFullscreen(t) === e) return;
3278
+ let n = this.getWindowId(t);
3279
+ this.mapWindowIdToFullScreen.set(n, e), this._onDidChangeFullscreen.fire(n);
3280
+ }
3281
+ isFullscreen(e) {
3282
+ return !!this.mapWindowIdToFullScreen.get(this.getWindowId(e));
3283
+ }
3284
+ getWindowId(e) {
3285
+ return e.vscodeWindowId;
3286
+ }
3287
+ };
3288
+ cn.INSTANCE = new cn();
3289
+ var ln = cn;
3290
+ function un(e, t, n) {
3291
+ typeof t == "string" && (t = e.matchMedia(t)), t.addEventListener("change", n);
3292
+ }
3293
+ ln.INSTANCE.onDidChangeZoomLevel, ln.INSTANCE.onDidChangeFullscreen;
3294
+ var dn = typeof navigator == "object" ? navigator.userAgent : "";
3295
+ dn.indexOf("Firefox");
3296
+ var fn = dn.indexOf("AppleWebKit") >= 0;
3297
+ !(dn.indexOf("Chrome") >= 0) && dn.indexOf("Safari"), dn.indexOf("Electron/"), dn.indexOf("Android");
3298
+ var pn = !1;
3299
+ if (typeof q.matchMedia == "function") {
3300
+ let e = q.matchMedia("(display-mode: standalone) or (display-mode: window-controls-overlay)"), t = q.matchMedia("(display-mode: fullscreen)");
3301
+ pn = e.matches, un(q, e, ({ matches: e }) => {
3302
+ pn && t.matches || (pn = e);
3303
+ });
3304
+ }
3305
+ function mn() {
3306
+ return pn;
3307
+ }
3308
+ var hn = "en", gn = !1, _n = !1, vn = !1, yn = hn, J, Y = globalThis, X;
3309
+ typeof Y.vscode < "u" && typeof Y.vscode.process < "u" ? X = Y.vscode.process : typeof process < "u" && typeof process?.versions?.node == "string" && (X = process);
3310
+ var bn = typeof X?.versions?.electron == "string" && X?.type === "renderer";
3311
+ if (typeof X == "object") {
3312
+ X.platform, X.platform, gn = X.platform === "linux", gn && X.env.SNAP && X.env.SNAP_REVISION, X.env.CI || X.env.BUILD_ARTIFACTSTAGINGDIRECTORY, yn = hn;
3313
+ let e = X.env.VSCODE_NLS_CONFIG;
3314
+ if (e) try {
3315
+ let t = JSON.parse(e);
3316
+ t.userLocale, t.osLocale, yn = t.resolvedLanguage || hn, t.languagePack?.translationsConfigFile;
3317
+ } catch {}
3318
+ _n = !0;
3319
+ } else typeof navigator == "object" && !bn ? (J = navigator.userAgent, J.indexOf("Windows"), J.indexOf("Macintosh"), (J.indexOf("Macintosh") >= 0 || J.indexOf("iPad") >= 0 || J.indexOf("iPhone") >= 0) && navigator.maxTouchPoints && navigator.maxTouchPoints, gn = J.indexOf("Linux") >= 0, J?.indexOf("Mobi"), vn = !0, yn = globalThis._VSCODE_NLS_LANGUAGE || hn, navigator.language.toLowerCase()) : console.error("Unable to resolve platform.");
3320
+ var xn = _n;
3321
+ vn && typeof Y.importScripts == "function" && Y.origin;
3322
+ var Z = J, Sn = yn, Cn;
3323
+ ((e) => {
3324
+ function t() {
3325
+ return Sn;
3326
+ }
3327
+ e.value = t;
3328
+ function n() {
3329
+ return Sn.length === 2 ? Sn === "en" : Sn.length >= 3 && Sn[0] === "e" && Sn[1] === "n" && Sn[2] === "-";
3330
+ }
3331
+ e.isDefaultVariant = n;
3332
+ function r() {
3333
+ return Sn === "en";
3334
+ }
3335
+ e.isDefault = r;
3336
+ })(Cn ||= {});
3337
+ var wn = typeof Y.postMessage == "function" && !Y.importScripts;
3338
+ (() => {
3339
+ if (wn) {
3340
+ let e = [];
3341
+ Y.addEventListener("message", (t) => {
3342
+ if (t.data && t.data.vscodeScheduleAsyncWork) for (let n = 0, r = e.length; n < r; n++) {
3343
+ let r = e[n];
3344
+ if (r.id === t.data.vscodeScheduleAsyncWork) {
3345
+ e.splice(n, 1), r.callback();
3346
+ return;
3347
+ }
3348
+ }
3349
+ });
3350
+ let t = 0;
3351
+ return (n) => {
3352
+ let r = ++t;
3353
+ e.push({
3354
+ id: r,
3355
+ callback: n
3356
+ }), Y.postMessage({ vscodeScheduleAsyncWork: r }, "*");
3357
+ };
3358
+ }
3359
+ return (e) => setTimeout(e);
3360
+ })();
3361
+ var Tn = !!(Z && Z.indexOf("Chrome") >= 0);
3362
+ Z && Z.indexOf("Firefox"), !Tn && Z && Z.indexOf("Safari"), Z && Z.indexOf("Edg/"), Z && Z.indexOf("Android");
3363
+ var En = typeof navigator == "object" ? navigator : {};
3364
+ xn || document.queryCommandSupported && document.queryCommandSupported("copy") || En && En.clipboard && En.clipboard.writeText, xn || En && En.clipboard && En.clipboard.readText, xn || mn() || En.keyboard, "ontouchstart" in q || En.maxTouchPoints, q.PointerEvent && ("ontouchstart" in q || navigator.maxTouchPoints);
3365
+ var Dn = class {
3366
+ constructor() {
3367
+ this._keyCodeToStr = [], this._strToKeyCode = Object.create(null);
3368
+ }
3369
+ define(e, t) {
3370
+ this._keyCodeToStr[e] = t, this._strToKeyCode[t.toLowerCase()] = e;
3371
+ }
3372
+ keyCodeToStr(e) {
3373
+ return this._keyCodeToStr[e];
3374
+ }
3375
+ strToKeyCode(e) {
3376
+ return this._strToKeyCode[e.toLowerCase()] || 0;
3377
+ }
3378
+ }, On = new Dn(), kn = new Dn(), An = new Dn();
3379
+ Array(230);
3380
+ var jn;
3381
+ ((e) => {
3382
+ function t(e) {
3383
+ return On.keyCodeToStr(e);
3384
+ }
3385
+ e.toString = t;
3386
+ function n(e) {
3387
+ return On.strToKeyCode(e);
3388
+ }
3389
+ e.fromString = n;
3390
+ function r(e) {
3391
+ return kn.keyCodeToStr(e);
3392
+ }
3393
+ e.toUserSettingsUS = r;
3394
+ function i(e) {
3395
+ return An.keyCodeToStr(e);
3396
+ }
3397
+ e.toUserSettingsGeneral = i;
3398
+ function a(e) {
3399
+ return kn.strToKeyCode(e) || An.strToKeyCode(e);
3400
+ }
3401
+ e.fromUserSettings = a;
3402
+ function o(e) {
3403
+ if (e >= 98 && e <= 113) return null;
3404
+ switch (e) {
3405
+ case 16: return "Up";
3406
+ case 18: return "Down";
3407
+ case 15: return "Left";
3408
+ case 17: return "Right";
3409
+ }
3410
+ return On.keyCodeToStr(e);
3411
+ }
3412
+ e.toElectronAccelerator = o;
3413
+ })(jn ||= {});
3414
+ var Mn = Object.freeze(function(e, t) {
3415
+ let n = setTimeout(e.bind(t), 0);
3416
+ return { dispose() {
3417
+ clearTimeout(n);
3418
+ } };
3419
+ }), Nn;
3420
+ ((e) => {
3421
+ function t(t) {
3422
+ return t === e.None || t === e.Cancelled || t instanceof Pn ? !0 : !t || typeof t != "object" ? !1 : typeof t.isCancellationRequested == "boolean" && typeof t.onCancellationRequested == "function";
3423
+ }
3424
+ e.isCancellationToken = t, e.None = Object.freeze({
3425
+ isCancellationRequested: !1,
3426
+ onCancellationRequested: B.None
3427
+ }), e.Cancelled = Object.freeze({
3428
+ isCancellationRequested: !0,
3429
+ onCancellationRequested: Mn
3430
+ });
3431
+ })(Nn ||= {});
3432
+ var Pn = class {
3433
+ constructor() {
3434
+ this._isCancelled = !1, this._emitter = null;
3435
+ }
3436
+ cancel() {
3437
+ this._isCancelled || (this._isCancelled = !0, this._emitter && (this._emitter.fire(void 0), this.dispose()));
3438
+ }
3439
+ get isCancellationRequested() {
3440
+ return this._isCancelled;
3441
+ }
3442
+ get onCancellationRequested() {
3443
+ return this._isCancelled ? Mn : (this._emitter ||= new V(), this._emitter.event);
3444
+ }
3445
+ dispose() {
3446
+ this._emitter &&= (this._emitter.dispose(), null);
3447
+ }
3448
+ };
3449
+ (function() {
3450
+ typeof globalThis.requestIdleCallback != "function" || globalThis.cancelIdleCallback;
3451
+ })();
3452
+ var Fn;
3453
+ ((e) => {
3454
+ async function t(e) {
3455
+ let t, n = await Promise.all(e.map((e) => e.then((e) => e, (e) => {
3456
+ t ||= e;
3457
+ })));
3458
+ if (typeof t < "u") throw t;
3459
+ return n;
3460
+ }
3461
+ e.settled = t;
3462
+ function n(e) {
3463
+ return new Promise(async (t, n) => {
3464
+ try {
3465
+ await e(t, n);
3466
+ } catch (e) {
3467
+ n(e);
3468
+ }
3469
+ });
3470
+ }
3471
+ e.withAsyncBody = n;
3472
+ })(Fn ||= {});
3473
+ var In = class e {
3474
+ static fromArray(t) {
3475
+ return new e((e) => {
3476
+ e.emitMany(t);
3477
+ });
3478
+ }
3479
+ static fromPromise(t) {
3480
+ return new e(async (e) => {
3481
+ e.emitMany(await t);
3482
+ });
3483
+ }
3484
+ static fromPromises(t) {
3485
+ return new e(async (e) => {
3486
+ await Promise.all(t.map(async (t) => e.emitOne(await t)));
3487
+ });
3488
+ }
3489
+ static merge(t) {
3490
+ return new e(async (e) => {
3491
+ await Promise.all(t.map(async (t) => {
3492
+ for await (let n of t) e.emitOne(n);
3493
+ }));
3494
+ });
3495
+ }
3496
+ constructor(e, t) {
3497
+ this._state = 0, this._results = [], this._error = null, this._onReturn = t, this._onStateChanged = new V(), queueMicrotask(async () => {
3498
+ let t = {
3499
+ emitOne: (e) => this.emitOne(e),
3500
+ emitMany: (e) => this.emitMany(e),
3501
+ reject: (e) => this.reject(e)
3502
+ };
3503
+ try {
3504
+ await Promise.resolve(e(t)), this.resolve();
3505
+ } catch (e) {
3506
+ this.reject(e);
3507
+ } finally {
3508
+ t.emitOne = void 0, t.emitMany = void 0, t.reject = void 0;
3509
+ }
3510
+ });
3511
+ }
3512
+ [Symbol.asyncIterator]() {
3513
+ let e = 0;
3514
+ return {
3515
+ next: async () => {
3516
+ do {
3517
+ if (this._state === 2) throw this._error;
3518
+ if (e < this._results.length) return {
3519
+ done: !1,
3520
+ value: this._results[e++]
3521
+ };
3522
+ if (this._state === 1) return {
3523
+ done: !0,
3524
+ value: void 0
3525
+ };
3526
+ await B.toPromise(this._onStateChanged.event);
3527
+ } while (1);
3528
+ },
3529
+ return: async () => (this._onReturn?.(), {
3530
+ done: !0,
3531
+ value: void 0
3532
+ })
3533
+ };
3534
+ }
3535
+ static map(t, n) {
3536
+ return new e(async (e) => {
3537
+ for await (let r of t) e.emitOne(n(r));
3538
+ });
3539
+ }
3540
+ map(t) {
3541
+ return e.map(this, t);
3542
+ }
3543
+ static filter(t, n) {
3544
+ return new e(async (e) => {
3545
+ for await (let r of t) n(r) && e.emitOne(r);
3546
+ });
3547
+ }
3548
+ filter(t) {
3549
+ return e.filter(this, t);
3550
+ }
3551
+ static coalesce(t) {
3552
+ return e.filter(t, (e) => !!e);
3553
+ }
3554
+ coalesce() {
3555
+ return e.coalesce(this);
3556
+ }
3557
+ static async toPromise(e) {
3558
+ let t = [];
3559
+ for await (let n of e) t.push(n);
3560
+ return t;
3561
+ }
3562
+ toPromise() {
3563
+ return e.toPromise(this);
3564
+ }
3565
+ emitOne(e) {
3566
+ this._state === 0 && (this._results.push(e), this._onStateChanged.fire());
3567
+ }
3568
+ emitMany(e) {
3569
+ this._state === 0 && (this._results = this._results.concat(e), this._onStateChanged.fire());
3570
+ }
3571
+ resolve() {
3572
+ this._state === 0 && (this._state = 1, this._onStateChanged.fire());
3573
+ }
3574
+ reject(e) {
3575
+ this._state === 0 && (this._state = 2, this._error = e, this._onStateChanged.fire());
3576
+ }
3577
+ };
3578
+ In.EMPTY = In.fromArray([]);
3579
+ function Ln(e) {
3580
+ return Rn(e, 0);
3581
+ }
3582
+ function Rn(e, t) {
3583
+ switch (typeof e) {
3584
+ case "object": return e === null ? Q(349, t) : Array.isArray(e) ? Vn(e, t) : Hn(e, t);
3585
+ case "string": return Bn(e, t);
3586
+ case "boolean": return zn(e, t);
3587
+ case "number": return Q(e, t);
3588
+ case "undefined": return Q(937, t);
3589
+ default: return Q(617, t);
3590
+ }
3591
+ }
3592
+ function Q(e, t) {
3593
+ return (t << 5) - t + e | 0;
3594
+ }
3595
+ function zn(e, t) {
3596
+ return Q(e ? 433 : 863, t);
3597
+ }
3598
+ function Bn(e, t) {
3599
+ t = Q(149417, t);
3600
+ for (let n = 0, r = e.length; n < r; n++) t = Q(e.charCodeAt(n), t);
3601
+ return t;
3602
+ }
3603
+ function Vn(e, t) {
3604
+ return t = Q(104579, t), e.reduce((e, t) => Rn(t, e), t);
3605
+ }
3606
+ function Hn(e, t) {
3607
+ return t = Q(181387, t), Object.keys(e).sort().reduce((t, n) => (t = Bn(n, t), Rn(e[n], t)), t);
3608
+ }
3609
+ var { registerWindow: Un, getWindow: Wn, getDocument: Gn, getWindows: Kn, getWindowsCount: qn, getWindowId: Jn, getWindowById: Yn, hasWindow: Xn, onDidRegisterWindow: Zn, onWillUnregisterWindow: Qn, onDidUnregisterWindow: $n } = function() {
3610
+ let e = /* @__PURE__ */ new Map(), t = {
3611
+ window: q,
3612
+ disposables: new S()
3613
+ };
3614
+ e.set(q.vscodeWindowId, t);
3615
+ let n = new V(), r = new V(), i = new V();
3616
+ function a(n, r) {
3617
+ return (typeof n == "number" ? e.get(n) : void 0) ?? (r ? t : void 0);
3618
+ }
3619
+ return {
3620
+ onDidRegisterWindow: n.event,
3621
+ onWillUnregisterWindow: i.event,
3622
+ onDidUnregisterWindow: r.event,
3623
+ registerWindow(t) {
3624
+ if (e.has(t.vscodeWindowId)) return C.None;
3625
+ let a = new S(), o = {
3626
+ window: t,
3627
+ disposables: a.add(new S())
3628
+ };
3629
+ return e.set(t.vscodeWindowId, o), a.add(b(() => {
3630
+ e.delete(t.vscodeWindowId), r.fire(t);
3631
+ })), a.add(tr(t, rr.BEFORE_UNLOAD, () => {
3632
+ i.fire(t);
3633
+ })), n.fire(o), a;
3634
+ },
3635
+ getWindows() {
3636
+ return e.values();
3637
+ },
3638
+ getWindowsCount() {
3639
+ return e.size;
3640
+ },
3641
+ getWindowId(e) {
3642
+ return e.vscodeWindowId;
3643
+ },
3644
+ hasWindow(t) {
3645
+ return e.has(t);
3646
+ },
3647
+ getWindowById: a,
3648
+ getWindow(e) {
3649
+ let t = e;
3650
+ if (t?.ownerDocument?.defaultView) return t.ownerDocument.defaultView.window;
3651
+ let n = e;
3652
+ return n?.view ? n.view.window : q;
3653
+ },
3654
+ getDocument(e) {
3655
+ return Wn(e).document;
3656
+ }
3657
+ };
3658
+ }(), er = class {
3659
+ constructor(e, t, n, r) {
3660
+ this._node = e, this._type = t, this._handler = n, this._options = r || !1, this._node.addEventListener(this._type, this._handler, this._options);
3661
+ }
3662
+ dispose() {
3663
+ this._handler &&= (this._node.removeEventListener(this._type, this._handler, this._options), this._node = null, null);
3664
+ }
3665
+ };
3666
+ function tr(e, t, n, r) {
3667
+ return new er(e, t, n, r);
3668
+ }
3669
+ var nr = class e {
3670
+ constructor(e, t) {
3671
+ this.width = e, this.height = t;
3672
+ }
3673
+ with(t = this.width, n = this.height) {
3674
+ return t !== this.width || n !== this.height ? new e(t, n) : this;
3675
+ }
3676
+ static is(e) {
3677
+ return typeof e == "object" && typeof e.height == "number" && typeof e.width == "number";
3678
+ }
3679
+ static lift(t) {
3680
+ return t instanceof e ? t : new e(t.width, t.height);
3681
+ }
3682
+ static equals(e, t) {
3683
+ return e === t ? !0 : !e || !t ? !1 : e.width === t.width && e.height === t.height;
3684
+ }
3685
+ };
3686
+ nr.None = new nr(0, 0), new class {
3687
+ constructor() {
3688
+ this.mutationObservers = /* @__PURE__ */ new Map();
3689
+ }
3690
+ observe(e, t, n) {
3691
+ let r = this.mutationObservers.get(e);
3692
+ r || (r = /* @__PURE__ */ new Map(), this.mutationObservers.set(e, r));
3693
+ let i = Ln(n), a = r.get(i);
3694
+ if (a) a.users += 1;
3695
+ else {
3696
+ let o = new V(), s = new MutationObserver((e) => o.fire(e));
3697
+ s.observe(e, n);
3698
+ let c = a = {
3699
+ users: 1,
3700
+ observer: s,
3701
+ onDidMutate: o.event
3702
+ };
3703
+ t.add(b(() => {
3704
+ --c.users, c.users === 0 && (o.dispose(), s.disconnect(), r?.delete(i), r?.size === 0 && this.mutationObservers.delete(e));
3705
+ })), r.set(i, a);
3706
+ }
3707
+ return a.onDidMutate;
3708
+ }
3709
+ }();
3710
+ var rr = {
3711
+ CLICK: "click",
3712
+ AUXCLICK: "auxclick",
3713
+ DBLCLICK: "dblclick",
3714
+ MOUSE_UP: "mouseup",
3715
+ MOUSE_DOWN: "mousedown",
3716
+ MOUSE_OVER: "mouseover",
3717
+ MOUSE_MOVE: "mousemove",
3718
+ MOUSE_OUT: "mouseout",
3719
+ MOUSE_ENTER: "mouseenter",
3720
+ MOUSE_LEAVE: "mouseleave",
3721
+ MOUSE_WHEEL: "wheel",
3722
+ POINTER_UP: "pointerup",
3723
+ POINTER_DOWN: "pointerdown",
3724
+ POINTER_MOVE: "pointermove",
3725
+ POINTER_LEAVE: "pointerleave",
3726
+ CONTEXT_MENU: "contextmenu",
3727
+ WHEEL: "wheel",
3728
+ KEY_DOWN: "keydown",
3729
+ KEY_PRESS: "keypress",
3730
+ KEY_UP: "keyup",
3731
+ LOAD: "load",
3732
+ BEFORE_UNLOAD: "beforeunload",
3733
+ UNLOAD: "unload",
3734
+ PAGE_SHOW: "pageshow",
3735
+ PAGE_HIDE: "pagehide",
3736
+ PASTE: "paste",
3737
+ ABORT: "abort",
3738
+ ERROR: "error",
3739
+ RESIZE: "resize",
3740
+ SCROLL: "scroll",
3741
+ FULLSCREEN_CHANGE: "fullscreenchange",
3742
+ WK_FULLSCREEN_CHANGE: "webkitfullscreenchange",
3743
+ SELECT: "select",
3744
+ CHANGE: "change",
3745
+ SUBMIT: "submit",
3746
+ RESET: "reset",
3747
+ FOCUS: "focus",
3748
+ FOCUS_IN: "focusin",
3749
+ FOCUS_OUT: "focusout",
3750
+ BLUR: "blur",
3751
+ INPUT: "input",
3752
+ STORAGE: "storage",
3753
+ DRAG_START: "dragstart",
3754
+ DRAG: "drag",
3755
+ DRAG_ENTER: "dragenter",
3756
+ DRAG_LEAVE: "dragleave",
3757
+ DRAG_OVER: "dragover",
3758
+ DROP: "drop",
3759
+ DRAG_END: "dragend",
3760
+ ANIMATION_START: fn ? "webkitAnimationStart" : "animationstart",
3761
+ ANIMATION_END: fn ? "webkitAnimationEnd" : "animationend",
3762
+ ANIMATION_ITERATION: fn ? "webkitAnimationIteration" : "animationiteration"
3763
+ }, ir = class extends C {
3764
+ constructor(e, t, n, r, i, a, o, s, c) {
3765
+ super(), this._terminal = e, this._characterJoinerService = t, this._charSizeService = n, this._coreBrowserService = r, this._coreService = i, this._decorationService = a, this._optionsService = o, this._themeService = s, this._cursorBlinkStateManager = new w(), this._charAtlasDisposable = this._register(new w()), this._observerDisposable = this._register(new w()), this._model = new Kt(), this._workCell = new Tt(), this._workCell2 = new Tt(), this._rectangleRenderer = this._register(new w()), this._glyphRenderer = this._register(new w()), this._onChangeTextureAtlas = this._register(new V()), this.onChangeTextureAtlas = this._onChangeTextureAtlas.event, this._onAddTextureAtlasCanvas = this._register(new V()), this.onAddTextureAtlasCanvas = this._onAddTextureAtlasCanvas.event, this._onRemoveTextureAtlasCanvas = this._register(new V()), this.onRemoveTextureAtlasCanvas = this._onRemoveTextureAtlasCanvas.event, this._onRequestRedraw = this._register(new V()), this.onRequestRedraw = this._onRequestRedraw.event, this._onContextLoss = this._register(new V()), this.onContextLoss = this._onContextLoss.event, this._canvas = this._coreBrowserService.mainDocument.createElement("canvas");
3766
+ let l = {
3767
+ antialias: !1,
3768
+ depth: !1,
3769
+ preserveDrawingBuffer: c
3770
+ };
3771
+ if (this._gl = this._canvas.getContext("webgl2", l), !this._gl) throw Error("WebGL2 not supported " + this._gl);
3772
+ this._register(this._themeService.onChangeColors(() => this._handleColorChange())), this._cellColorResolver = new Ce(this._terminal, this._optionsService, this._model.selection, this._decorationService, this._coreBrowserService, this._themeService), this._core = this._terminal._core, this._renderLayers = [new sn(this._core.screenElement, 2, this._terminal, this._core.linkifier, this._coreBrowserService, o, this._themeService)], this.dimensions = _e(), this._devicePixelRatio = this._coreBrowserService.dpr, this._updateDimensions(), this._updateCursorBlink(), this._register(o.onOptionChange(() => this._handleOptionsChanged())), this._deviceMaxTextureSize = this._gl.getParameter(this._gl.MAX_TEXTURE_SIZE), this._register(tr(this._canvas, "webglcontextlost", (e) => {
3773
+ console.log("webglcontextlost event received"), e.preventDefault(), this._contextRestorationTimeout = setTimeout(() => {
3774
+ this._contextRestorationTimeout = void 0, console.warn("webgl context not restored; firing onContextLoss"), this._onContextLoss.fire(e);
3775
+ }, 3e3);
3776
+ })), this._register(tr(this._canvas, "webglcontextrestored", (e) => {
3777
+ console.warn("webglcontextrestored event received"), clearTimeout(this._contextRestorationTimeout), this._contextRestorationTimeout = void 0, bt(this._terminal), this._initializeWebGLState(), this._requestRedrawViewport();
3778
+ })), this._observerDisposable.value = Ct(this._canvas, this._coreBrowserService.window, (e, t) => this._setCanvasDevicePixelDimensions(e, t)), this._register(this._coreBrowserService.onWindowChange((e) => {
3779
+ this._observerDisposable.value = Ct(this._canvas, e, (e, t) => this._setCanvasDevicePixelDimensions(e, t));
3780
+ })), this._core.screenElement.appendChild(this._canvas), [this._rectangleRenderer.value, this._glyphRenderer.value] = this._initializeWebGLState(), this._isAttached = this._core.screenElement.isConnected, this._register(b(() => {
3781
+ for (let e of this._renderLayers) e.dispose();
3782
+ this._canvas.parentElement?.removeChild(this._canvas), bt(this._terminal);
3783
+ }));
3784
+ }
3785
+ get textureAtlas() {
3786
+ return this._charAtlas?.pages[0].canvas;
3787
+ }
3788
+ _handleColorChange() {
3789
+ this._refreshCharAtlas(), this._clearModel(!0);
3790
+ }
3791
+ handleDevicePixelRatioChange() {
3792
+ this._devicePixelRatio !== this._coreBrowserService.dpr && (this._devicePixelRatio = this._coreBrowserService.dpr, this.handleResize(this._terminal.cols, this._terminal.rows));
3793
+ }
3794
+ handleResize(e, t) {
3795
+ this._updateDimensions(), this._model.resize(this._terminal.cols, this._terminal.rows);
3796
+ for (let e of this._renderLayers) e.resize(this._terminal, this.dimensions);
3797
+ this._canvas.width = this.dimensions.device.canvas.width, this._canvas.height = this.dimensions.device.canvas.height, this._canvas.style.width = `${this.dimensions.css.canvas.width}px`, this._canvas.style.height = `${this.dimensions.css.canvas.height}px`, this._core.screenElement.style.width = `${this.dimensions.css.canvas.width}px`, this._core.screenElement.style.height = `${this.dimensions.css.canvas.height}px`, this._rectangleRenderer.value?.setDimensions(this.dimensions), this._rectangleRenderer.value?.handleResize(), this._glyphRenderer.value?.setDimensions(this.dimensions), this._glyphRenderer.value?.handleResize(), this._refreshCharAtlas(), this._clearModel(!1);
3798
+ }
3799
+ handleCharSizeChanged() {
3800
+ this.handleResize(this._terminal.cols, this._terminal.rows);
3801
+ }
3802
+ handleBlur() {
3803
+ for (let e of this._renderLayers) e.handleBlur(this._terminal);
3804
+ this._cursorBlinkStateManager.value?.pause(), this._requestRedrawViewport();
3805
+ }
3806
+ handleFocus() {
3807
+ for (let e of this._renderLayers) e.handleFocus(this._terminal);
3808
+ this._cursorBlinkStateManager.value?.resume(), this._requestRedrawViewport();
3809
+ }
3810
+ handleSelectionChanged(e, t, n) {
3811
+ for (let r of this._renderLayers) r.handleSelectionChanged(this._terminal, e, t, n);
3812
+ this._model.selection.update(this._core, e, t, n), this._requestRedrawViewport();
3813
+ }
3814
+ handleCursorMove() {
3815
+ for (let e of this._renderLayers) e.handleCursorMove(this._terminal);
3816
+ this._cursorBlinkStateManager.value?.restartBlinkAnimation();
3817
+ }
3818
+ _handleOptionsChanged() {
3819
+ this._updateDimensions(), this._refreshCharAtlas(), this._updateCursorBlink();
3820
+ }
3821
+ _initializeWebGLState() {
3822
+ return this._rectangleRenderer.value = new an(this._terminal, this._gl, this.dimensions, this._themeService), this._glyphRenderer.value = new Rt(this._terminal, this._gl, this.dimensions, this._optionsService), this.handleCharSizeChanged(), [this._rectangleRenderer.value, this._glyphRenderer.value];
3823
+ }
3824
+ _refreshCharAtlas() {
3825
+ if (this.dimensions.device.char.width <= 0 && this.dimensions.device.char.height <= 0) {
3826
+ this._isAttached = !1;
3827
+ return;
3828
+ }
3829
+ let e = yt(this._terminal, this._optionsService.rawOptions, this._themeService.colors, this.dimensions.device.cell.width, this.dimensions.device.cell.height, this.dimensions.device.char.width, this.dimensions.device.char.height, this._coreBrowserService.dpr, this._deviceMaxTextureSize);
3830
+ this._charAtlas !== e && (this._onChangeTextureAtlas.fire(e.pages[0].canvas), this._charAtlasDisposable.value = y(B.forward(e.onAddTextureAtlasCanvas, this._onAddTextureAtlasCanvas), B.forward(e.onRemoveTextureAtlasCanvas, this._onRemoveTextureAtlasCanvas))), this._charAtlas = e, this._charAtlas.warmUp(), this._glyphRenderer.value?.setAtlas(this._charAtlas);
3831
+ }
3832
+ _clearModel(e) {
3833
+ this._model.clear(), e && this._glyphRenderer.value?.clear();
3834
+ }
3835
+ clearTextureAtlas() {
3836
+ this._charAtlas?.clearTexture(), this._clearModel(!0), this._requestRedrawViewport();
3837
+ }
3838
+ clear() {
3839
+ this._clearModel(!0);
3840
+ for (let e of this._renderLayers) e.reset(this._terminal);
3841
+ this._cursorBlinkStateManager.value?.restartBlinkAnimation(), this._updateCursorBlink();
3842
+ }
3843
+ renderRows(e, t) {
3844
+ if (!this._isAttached) {
3845
+ if (this._core.screenElement?.isConnected && this._charSizeService.width && this._charSizeService.height) this._updateDimensions(), this._refreshCharAtlas(), this._isAttached = !0;
3846
+ else return;
3847
+ }
3848
+ for (let n of this._renderLayers) n.handleGridChanged(this._terminal, e, t);
3849
+ !this._glyphRenderer.value || !this._rectangleRenderer.value || (this._glyphRenderer.value.beginFrame() ? (this._clearModel(!0), this._updateModel(0, this._terminal.rows - 1)) : this._updateModel(e, t), this._rectangleRenderer.value.renderBackgrounds(), this._glyphRenderer.value.render(this._model), (!this._cursorBlinkStateManager.value || this._cursorBlinkStateManager.value.isCursorVisible) && this._rectangleRenderer.value.renderCursor());
3850
+ }
3851
+ _updateCursorBlink() {
3852
+ this._coreService.decPrivateModes.cursorBlink ?? this._terminal.options.cursorBlink ? this._cursorBlinkStateManager.value = new St(() => {
3853
+ this._requestRedrawCursor();
3854
+ }, this._coreBrowserService) : this._cursorBlinkStateManager.clear(), this._requestRedrawCursor();
3855
+ }
3856
+ _updateModel(e, t) {
3857
+ let n = this._core, r = this._workCell, i, a, o, s, c, l, u = 0, d = !0, f, p, m, h, g, _, v, y, b;
3858
+ e = or(e, n.rows - 1, 0), t = or(t, n.rows - 1, 0);
3859
+ let x = this._coreService.decPrivateModes.cursorStyle ?? n.options.cursorStyle ?? "block", S = this._terminal.buffer.active.baseY + this._terminal.buffer.active.cursorY, C = S - n.buffer.ydisp, w = Math.min(this._terminal.buffer.active.cursorX, n.cols - 1), ee = -1, T = this._coreService.isCursorInitialized && !this._coreService.isCursorHidden && (!this._cursorBlinkStateManager.value || this._cursorBlinkStateManager.value.isCursorVisible);
3860
+ this._model.cursor = void 0;
3861
+ let E = !1;
3862
+ for (a = e; a <= t; a++) for (o = a + n.buffer.ydisp, s = n.buffer.lines.get(o), this._model.lineLengths[a] = 0, m = S === o, u = 0, c = this._characterJoinerService.getJoinedCharacters(o), y = 0; y < n.cols; y++) {
3863
+ if (i = this._cellColorResolver.result.bg, s.loadCell(y, r), y === 0 && (i = this._cellColorResolver.result.bg), l = !1, d = y >= u, f = y, c.length > 0 && y === c[0][0] && d) {
3864
+ p = c.shift();
3865
+ let e = this._model.selection.isCellSelected(this._terminal, p[0], o);
3866
+ for (v = p[0] + 1; v < p[1]; v++) d &&= e === this._model.selection.isCellSelected(this._terminal, v, o);
3867
+ d &&= !m || w < p[0] || w >= p[1], d ? (l = !0, r = new ar(r, s.translateToString(!0, p[0], p[1]), p[1] - p[0]), f = p[1] - 1) : u = p[1];
3868
+ }
3869
+ if (h = r.getChars(), g = r.getCode(), v = (a * n.cols + y) * Vt, this._cellColorResolver.resolve(r, y, o, this.dimensions.device.cell.width), T && o === S && (y === w && (this._model.cursor = {
3870
+ x: w,
3871
+ y: C,
3872
+ width: r.getWidth(),
3873
+ style: this._coreBrowserService.isFocused ? x : n.options.cursorInactiveStyle,
3874
+ cursorWidth: n.options.cursorWidth,
3875
+ dpr: this._devicePixelRatio
3876
+ }, ee = w + r.getWidth() - 1), y >= w && y <= ee && (this._coreBrowserService.isFocused && x === "block" || this._coreBrowserService.isFocused === !1 && n.options.cursorInactiveStyle === "block") && (this._cellColorResolver.result.fg = 50331648 | this._themeService.colors.cursorAccent.rgba >> 8 & 16777215, this._cellColorResolver.result.bg = 50331648 | this._themeService.colors.cursor.rgba >> 8 & 16777215)), g !== 0 && (this._model.lineLengths[a] = y + 1), (this._model.cells[v] !== g || this._model.cells[v + Ht] !== this._cellColorResolver.result.bg || this._model.cells[v + Ut] !== this._cellColorResolver.result.fg || this._model.cells[v + Wt] !== this._cellColorResolver.result.ext) && (E = !0, h.length > 1 && (g |= Gt), this._model.cells[v] = g, this._model.cells[v + Ht] = this._cellColorResolver.result.bg, this._model.cells[v + Ut] = this._cellColorResolver.result.fg, this._model.cells[v + Wt] = this._cellColorResolver.result.ext, _ = r.getWidth(), this._glyphRenderer.value.updateCell(y, a, g, this._cellColorResolver.result.bg, this._cellColorResolver.result.fg, this._cellColorResolver.result.ext, h, _, i), l)) {
3877
+ for (r = this._workCell, y++; y <= f; y++) b = (a * n.cols + y) * Vt, this._glyphRenderer.value.updateCell(y, a, 0, 0, 0, 0, ae, 0, 0), this._model.cells[b] = 0, this._model.cells[b + Ht] = this._cellColorResolver.result.bg, this._model.cells[b + Ut] = this._cellColorResolver.result.fg, this._model.cells[b + Wt] = this._cellColorResolver.result.ext;
3878
+ y--;
3879
+ }
3880
+ }
3881
+ E && this._rectangleRenderer.value.updateBackgrounds(this._model), this._rectangleRenderer.value.updateCursor(this._model);
3882
+ }
3883
+ _updateDimensions() {
3884
+ !this._charSizeService.width || !this._charSizeService.height || (this.dimensions.device.char.width = Math.floor(this._charSizeService.width * this._devicePixelRatio), this.dimensions.device.char.height = Math.ceil(this._charSizeService.height * this._devicePixelRatio), this.dimensions.device.cell.height = Math.floor(this.dimensions.device.char.height * this._optionsService.rawOptions.lineHeight), this.dimensions.device.char.top = this._optionsService.rawOptions.lineHeight === 1 ? 0 : Math.round((this.dimensions.device.cell.height - this.dimensions.device.char.height) / 2), this.dimensions.device.cell.width = this.dimensions.device.char.width + Math.round(this._optionsService.rawOptions.letterSpacing), this.dimensions.device.char.left = Math.floor(this._optionsService.rawOptions.letterSpacing / 2), this.dimensions.device.canvas.height = this._terminal.rows * this.dimensions.device.cell.height, this.dimensions.device.canvas.width = this._terminal.cols * this.dimensions.device.cell.width, this.dimensions.css.canvas.height = Math.round(this.dimensions.device.canvas.height / this._devicePixelRatio), this.dimensions.css.canvas.width = Math.round(this.dimensions.device.canvas.width / this._devicePixelRatio), this.dimensions.css.cell.height = this.dimensions.device.cell.height / this._devicePixelRatio, this.dimensions.css.cell.width = this.dimensions.device.cell.width / this._devicePixelRatio);
3885
+ }
3886
+ _setCanvasDevicePixelDimensions(e, t) {
3887
+ this._canvas.width === e && this._canvas.height === t || (this._canvas.width = e, this._canvas.height = t, this._requestRedrawViewport());
3888
+ }
3889
+ _requestRedrawViewport() {
3890
+ this._onRequestRedraw.fire({
3891
+ start: 0,
3892
+ end: this._terminal.rows - 1
3893
+ });
3894
+ }
3895
+ _requestRedrawCursor() {
3896
+ let e = this._terminal.buffer.active.cursorY;
3897
+ this._onRequestRedraw.fire({
3898
+ start: e,
3899
+ end: e
3900
+ });
3901
+ }
3902
+ }, ar = class extends Ge {
3903
+ constructor(e, t, n) {
3904
+ super(), this.content = 0, this.combinedData = "", this.fg = e.fg, this.bg = e.bg, this.combinedData = t, this._width = n;
3905
+ }
3906
+ isCombined() {
3907
+ return 2097152;
3908
+ }
3909
+ getWidth() {
3910
+ return this._width;
3911
+ }
3912
+ getChars() {
3913
+ return this.combinedData;
3914
+ }
3915
+ getCode() {
3916
+ return 2097151;
3917
+ }
3918
+ setFromCharData(e) {
3919
+ throw Error("not implemented");
3920
+ }
3921
+ getAsCharData() {
3922
+ return [
3923
+ this.fg,
3924
+ this.getChars(),
3925
+ this.getWidth(),
3926
+ this.getCode()
3927
+ ];
3928
+ }
3929
+ };
3930
+ function or(e, t, n = 0) {
3931
+ return Math.max(Math.min(e, t), n);
3932
+ }
3933
+ var sr = "di$target", cr = "di$dependencies", lr = /* @__PURE__ */ new Map();
3934
+ function $(e) {
3935
+ if (lr.has(e)) return lr.get(e);
3936
+ let t = function(e, n, r) {
3937
+ if (arguments.length !== 3) throw Error("@IServiceName-decorator can only be used to decorate a parameter");
3938
+ ur(t, e, r);
3939
+ };
3940
+ return t._id = e, lr.set(e, t), t;
3941
+ }
3942
+ function ur(e, t, n) {
3943
+ t[sr] === t ? t[cr].push({
3944
+ id: e,
3945
+ index: n
3946
+ }) : (t[cr] = [{
3947
+ id: e,
3948
+ index: n
3949
+ }], t[sr] = t);
3950
+ }
3951
+ $("BufferService"), $("CoreMouseService"), $("CoreService"), $("CharsetService"), $("InstantiationService"), $("LogService");
3952
+ var dr = $("OptionsService");
3953
+ $("OscLinkService"), $("UnicodeService"), $("DecorationService");
3954
+ var fr = {
3955
+ trace: 0,
3956
+ debug: 1,
3957
+ info: 2,
3958
+ warn: 3,
3959
+ error: 4,
3960
+ off: 5
3961
+ }, pr = "xterm.js: ", mr = class extends C {
3962
+ constructor(e) {
3963
+ super(), this._optionsService = e, this._logLevel = 5, this._updateLogLevel(), this._register(this._optionsService.onSpecificOptionChange("logLevel", () => this._updateLogLevel())), hr = this;
3964
+ }
3965
+ get logLevel() {
3966
+ return this._logLevel;
3967
+ }
3968
+ _updateLogLevel() {
3969
+ this._logLevel = fr[this._optionsService.rawOptions.logLevel];
3970
+ }
3971
+ _evalLazyOptionalParams(e) {
3972
+ for (let t = 0; t < e.length; t++) typeof e[t] == "function" && (e[t] = e[t]());
3973
+ }
3974
+ _log(e, t, n) {
3975
+ this._evalLazyOptionalParams(n), e.call(console, (this._optionsService.options.logger ? "" : pr) + t, ...n);
3976
+ }
3977
+ trace(e, ...t) {
3978
+ this._logLevel <= 0 && this._log(this._optionsService.options.logger?.trace.bind(this._optionsService.options.logger) ?? console.log, e, t);
3979
+ }
3980
+ debug(e, ...t) {
3981
+ this._logLevel <= 1 && this._log(this._optionsService.options.logger?.debug.bind(this._optionsService.options.logger) ?? console.log, e, t);
3982
+ }
3983
+ info(e, ...t) {
3984
+ this._logLevel <= 2 && this._log(this._optionsService.options.logger?.info.bind(this._optionsService.options.logger) ?? console.info, e, t);
3985
+ }
3986
+ warn(e, ...t) {
3987
+ this._logLevel <= 3 && this._log(this._optionsService.options.logger?.warn.bind(this._optionsService.options.logger) ?? console.warn, e, t);
3988
+ }
3989
+ error(e, ...t) {
3990
+ this._logLevel <= 4 && this._log(this._optionsService.options.logger?.error.bind(this._optionsService.options.logger) ?? console.error, e, t);
3991
+ }
3992
+ };
3993
+ mr = n([r(0, dr)], mr);
3994
+ var hr, gr = class extends C {
3995
+ constructor(e) {
3996
+ if (re && ie() < 16 && !document.createElement("canvas").getContext("webgl2", {
3997
+ antialias: !1,
3998
+ depth: !1,
3999
+ preserveDrawingBuffer: !0
4000
+ })) throw Error("Webgl2 is only supported on Safari 16 and above");
4001
+ super(), this._preserveDrawingBuffer = e, this._onChangeTextureAtlas = this._register(new V()), this.onChangeTextureAtlas = this._onChangeTextureAtlas.event, this._onAddTextureAtlasCanvas = this._register(new V()), this.onAddTextureAtlasCanvas = this._onAddTextureAtlasCanvas.event, this._onRemoveTextureAtlasCanvas = this._register(new V()), this.onRemoveTextureAtlasCanvas = this._onRemoveTextureAtlasCanvas.event, this._onContextLoss = this._register(new V()), this.onContextLoss = this._onContextLoss.event;
4002
+ }
4003
+ activate(e) {
4004
+ let t = e._core;
4005
+ if (!e.element) {
4006
+ this._register(t.onWillOpen(() => this.activate(e)));
4007
+ return;
4008
+ }
4009
+ this._terminal = e;
4010
+ let n = t.coreService, r = t.optionsService, i = t, a = i._renderService, o = i._characterJoinerService, s = i._charSizeService, c = i._coreBrowserService, l = i._decorationService;
4011
+ i._logService;
4012
+ let u = i._themeService;
4013
+ this._renderer = this._register(new ir(e, o, s, c, n, l, r, u, this._preserveDrawingBuffer)), this._register(B.forward(this._renderer.onContextLoss, this._onContextLoss)), this._register(B.forward(this._renderer.onChangeTextureAtlas, this._onChangeTextureAtlas)), this._register(B.forward(this._renderer.onAddTextureAtlasCanvas, this._onAddTextureAtlasCanvas)), this._register(B.forward(this._renderer.onRemoveTextureAtlasCanvas, this._onRemoveTextureAtlasCanvas)), a.setRenderer(this._renderer), this._register(b(() => {
4014
+ if (this._terminal._core._store._isDisposed) return;
4015
+ let t = this._terminal._core._renderService;
4016
+ t.setRenderer(this._terminal._core._createRenderer()), t.handleResize(e.cols, e.rows);
4017
+ }));
4018
+ }
4019
+ get textureAtlas() {
4020
+ return this._renderer?.textureAtlas;
4021
+ }
4022
+ clearTextureAtlas() {
4023
+ this._renderer?.clearTextureAtlas();
4024
+ }
4025
+ };
4026
+ //#endregion
4027
+ export { gr as WebglAddon };