paneful 0.6.6 → 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/server/index.js
CHANGED
|
@@ -1,16 +1,9 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { program } from 'commander';
|
|
3
|
-
import http from 'node:http';
|
|
4
3
|
import fs from 'node:fs';
|
|
5
4
|
import path from 'node:path';
|
|
6
5
|
import os from 'node:os';
|
|
7
|
-
import
|
|
8
|
-
import { execFile } from 'node:child_process';
|
|
9
|
-
import { v4 as uuidv4 } from 'uuid';
|
|
10
|
-
import { PtyManager } from './pty-manager.js';
|
|
11
|
-
import { ProjectStore } from './project-store.js';
|
|
12
|
-
import { WsHandler } from './ws-handler.js';
|
|
13
|
-
import { startIpcListener, sendIpcCommand } from './ipc.js';
|
|
6
|
+
import { sendIpcCommand } from './ipc-client.js';
|
|
14
7
|
import { openBrowser, focusBrowser } from './browser.js';
|
|
15
8
|
// ── Version check ──
|
|
16
9
|
const PKG_NAME = 'paneful';
|
|
@@ -175,7 +168,19 @@ async function handleKill(name) {
|
|
|
175
168
|
}
|
|
176
169
|
}
|
|
177
170
|
// ── Server ──
|
|
178
|
-
function startServer(devMode, port) {
|
|
171
|
+
async function startServer(devMode, port) {
|
|
172
|
+
// Lazy-load heavy dependencies (express, node-pty, ws, etc.)
|
|
173
|
+
// so CLI commands that don't need the server start instantly
|
|
174
|
+
const [{ default: http }, { default: express }, { execFile }, { v4: uuidv4 }, { PtyManager }, { ProjectStore }, { WsHandler }, { startIpcListener },] = await Promise.all([
|
|
175
|
+
import('node:http'),
|
|
176
|
+
import('express'),
|
|
177
|
+
import('node:child_process'),
|
|
178
|
+
import('uuid'),
|
|
179
|
+
import('./pty-manager.js'),
|
|
180
|
+
import('./project-store.js'),
|
|
181
|
+
import('./ws-handler.js'),
|
|
182
|
+
import('./ipc.js'),
|
|
183
|
+
]);
|
|
179
184
|
const app = express();
|
|
180
185
|
app.use(express.json());
|
|
181
186
|
const ptyManager = new PtyManager();
|
|
@@ -379,9 +384,7 @@ function startServer(devMode, port) {
|
|
|
379
384
|
writeLockfile(process.pid, actualPort);
|
|
380
385
|
console.log(`Paneful running on http://localhost:${actualPort}`);
|
|
381
386
|
if (!devMode) {
|
|
382
|
-
|
|
383
|
-
openBrowser(actualPort);
|
|
384
|
-
}
|
|
387
|
+
openBrowser(actualPort);
|
|
385
388
|
}
|
|
386
389
|
});
|
|
387
390
|
// Graceful shutdown
|
|
@@ -403,9 +406,15 @@ program
|
|
|
403
406
|
.option('--spawn', 'Spawn a new project in the current directory')
|
|
404
407
|
.option('--list', 'List all projects')
|
|
405
408
|
.option('--kill <name>', 'Kill a project by name')
|
|
409
|
+
.option('--install-app', 'Create Paneful.app in /Applications (macOS only)')
|
|
406
410
|
.option('--dev', 'Run in development mode (proxy to Vite dev server)')
|
|
407
411
|
.option('--port <number>', 'Port to listen on (default: random available)', parseInt)
|
|
408
412
|
.action(async (opts) => {
|
|
413
|
+
if (opts.installApp) {
|
|
414
|
+
const { installApp } = await import('./install-app.js');
|
|
415
|
+
await installApp();
|
|
416
|
+
return;
|
|
417
|
+
}
|
|
409
418
|
if (opts.list) {
|
|
410
419
|
await handleList();
|
|
411
420
|
return;
|
|
@@ -430,6 +439,6 @@ program
|
|
|
430
439
|
if (lock) {
|
|
431
440
|
removeLockfile();
|
|
432
441
|
}
|
|
433
|
-
startServer(opts.dev || false, opts.port || 56170);
|
|
442
|
+
await startServer(opts.dev || false, opts.port || 56170);
|
|
434
443
|
});
|
|
435
444
|
program.parse();
|
|
@@ -0,0 +1,238 @@
|
|
|
1
|
+
import fs from 'node:fs';
|
|
2
|
+
import path from 'node:path';
|
|
3
|
+
import os from 'node:os';
|
|
4
|
+
import { execFileSync } from 'node:child_process';
|
|
5
|
+
const APP_PATH = '/Applications/Paneful.app';
|
|
6
|
+
const BUNDLE_ID = 'com.paneful.app';
|
|
7
|
+
function findIconSource() {
|
|
8
|
+
// From compiled dist/server/ → ../web/icon-512.png
|
|
9
|
+
const distIcon = path.resolve(import.meta.dirname, '..', 'web', 'icon-512.png');
|
|
10
|
+
if (fs.existsSync(distIcon))
|
|
11
|
+
return distIcon;
|
|
12
|
+
// From dev server/ → web/public/icon-512.png
|
|
13
|
+
const devIcon = path.resolve(import.meta.dirname, '..', 'web', 'public', 'icon-512.png');
|
|
14
|
+
if (fs.existsSync(devIcon))
|
|
15
|
+
return devIcon;
|
|
16
|
+
return null;
|
|
17
|
+
}
|
|
18
|
+
function buildIcns(pngPath, contentsDir) {
|
|
19
|
+
const iconsetDir = path.join(os.tmpdir(), 'Paneful.iconset');
|
|
20
|
+
const icnsPath = path.join(contentsDir, 'Resources', 'Paneful.icns');
|
|
21
|
+
try {
|
|
22
|
+
fs.mkdirSync(iconsetDir, { recursive: true });
|
|
23
|
+
// sips to create required icon sizes
|
|
24
|
+
const sizes = [16, 32, 64, 128, 256, 512];
|
|
25
|
+
for (const size of sizes) {
|
|
26
|
+
const outFile = path.join(iconsetDir, `icon_${size}x${size}.png`);
|
|
27
|
+
execFileSync('sips', ['-z', String(size), String(size), pngPath, '--out', outFile], { stdio: 'pipe' });
|
|
28
|
+
// @2x variant (retina) for half-size key
|
|
29
|
+
if (size >= 32) {
|
|
30
|
+
const halfKey = size / 2;
|
|
31
|
+
const retinaFile = path.join(iconsetDir, `icon_${halfKey}x${halfKey}@2x.png`);
|
|
32
|
+
if (!fs.existsSync(retinaFile)) {
|
|
33
|
+
fs.copyFileSync(outFile, retinaFile);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
fs.mkdirSync(path.dirname(icnsPath), { recursive: true });
|
|
38
|
+
execFileSync('iconutil', ['-c', 'icns', iconsetDir, '-o', icnsPath], { stdio: 'pipe' });
|
|
39
|
+
// Cleanup
|
|
40
|
+
fs.rmSync(iconsetDir, { recursive: true, force: true });
|
|
41
|
+
return icnsPath;
|
|
42
|
+
}
|
|
43
|
+
catch {
|
|
44
|
+
// Cleanup on failure
|
|
45
|
+
try {
|
|
46
|
+
fs.rmSync(iconsetDir, { recursive: true, force: true });
|
|
47
|
+
}
|
|
48
|
+
catch { /* ok */ }
|
|
49
|
+
return null;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
function getInfoPlist(hasIcon) {
|
|
53
|
+
return `<?xml version="1.0" encoding="UTF-8"?>
|
|
54
|
+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
|
55
|
+
<plist version="1.0">
|
|
56
|
+
<dict>
|
|
57
|
+
<key>CFBundleName</key>
|
|
58
|
+
<string>Paneful</string>
|
|
59
|
+
<key>CFBundleDisplayName</key>
|
|
60
|
+
<string>Paneful</string>
|
|
61
|
+
<key>CFBundleIdentifier</key>
|
|
62
|
+
<string>${BUNDLE_ID}</string>
|
|
63
|
+
<key>CFBundleVersion</key>
|
|
64
|
+
<string>1.0</string>
|
|
65
|
+
<key>CFBundlePackageType</key>
|
|
66
|
+
<string>APPL</string>
|
|
67
|
+
<key>CFBundleExecutable</key>
|
|
68
|
+
<string>Paneful</string>
|
|
69
|
+
${hasIcon ? ` <key>CFBundleIconFile</key>
|
|
70
|
+
<string>Paneful</string>
|
|
71
|
+
` : ''}</dict>
|
|
72
|
+
</plist>
|
|
73
|
+
`;
|
|
74
|
+
}
|
|
75
|
+
function getLauncherScript() {
|
|
76
|
+
// Bake in current paths at install time
|
|
77
|
+
const bakedNode = process.execPath;
|
|
78
|
+
const bakedPaneful = fs.realpathSync(process.argv[1]);
|
|
79
|
+
return `#!/bin/bash
|
|
80
|
+
# Paneful.app launcher — generated by paneful --install-app
|
|
81
|
+
# Baked paths (fast path), with runtime fallbacks
|
|
82
|
+
|
|
83
|
+
LOG="$HOME/.paneful/app.log"
|
|
84
|
+
mkdir -p "$HOME/.paneful"
|
|
85
|
+
exec >> "$LOG" 2>&1
|
|
86
|
+
echo "--- $(date) ---"
|
|
87
|
+
|
|
88
|
+
BAKED_NODE="${bakedNode}"
|
|
89
|
+
BAKED_PANEFUL="${bakedPaneful}"
|
|
90
|
+
|
|
91
|
+
find_node() {
|
|
92
|
+
# 1. Baked path
|
|
93
|
+
if [[ -x "$BAKED_NODE" ]]; then echo "$BAKED_NODE"; return; fi
|
|
94
|
+
|
|
95
|
+
# 2. Common locations
|
|
96
|
+
for p in /usr/local/bin/node /opt/homebrew/bin/node; do
|
|
97
|
+
if [[ -x "$p" ]]; then echo "$p"; return; fi
|
|
98
|
+
done
|
|
99
|
+
|
|
100
|
+
# 3. nvm
|
|
101
|
+
if [[ -d "$HOME/.nvm/versions/node" ]]; then
|
|
102
|
+
local latest
|
|
103
|
+
latest=$(ls -1d "$HOME/.nvm/versions/node"/v* 2>/dev/null | sort -V | tail -1)
|
|
104
|
+
if [[ -x "$latest/bin/node" ]]; then echo "$latest/bin/node"; return; fi
|
|
105
|
+
fi
|
|
106
|
+
|
|
107
|
+
# 4. fnm
|
|
108
|
+
if [[ -d "$HOME/.fnm" ]]; then
|
|
109
|
+
local latest
|
|
110
|
+
latest=$(ls -1d "$HOME/.fnm/node-versions"/v* 2>/dev/null | sort -V | tail -1)
|
|
111
|
+
if [[ -x "$latest/installation/bin/node" ]]; then echo "$latest/installation/bin/node"; return; fi
|
|
112
|
+
fi
|
|
113
|
+
|
|
114
|
+
# 5. volta
|
|
115
|
+
if [[ -x "$HOME/.volta/bin/node" ]]; then echo "$HOME/.volta/bin/node"; return; fi
|
|
116
|
+
|
|
117
|
+
# 6. Parse shell config PATH exports
|
|
118
|
+
for rc in "$HOME/.zshrc" "$HOME/.bash_profile" "$HOME/.bashrc" "$HOME/.zprofile"; do
|
|
119
|
+
if [[ -f "$rc" ]]; then
|
|
120
|
+
while IFS= read -r line; do
|
|
121
|
+
if [[ "$line" =~ ^export\\ +PATH=.*|^PATH= ]]; then
|
|
122
|
+
local extracted
|
|
123
|
+
extracted=$(echo "$line" | sed 's/.*PATH=["]*//;s/["]*$//' | tr ':' '\\n' | sed "s|\\$HOME|$HOME|g;s|~|$HOME|g")
|
|
124
|
+
while IFS= read -r dir; do
|
|
125
|
+
dir=$(eval echo "$dir" 2>/dev/null)
|
|
126
|
+
if [[ -x "$dir/node" ]]; then echo "$dir/node"; return; fi
|
|
127
|
+
done <<< "$extracted"
|
|
128
|
+
fi
|
|
129
|
+
done < "$rc"
|
|
130
|
+
fi
|
|
131
|
+
done
|
|
132
|
+
|
|
133
|
+
return 1
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
find_paneful() {
|
|
137
|
+
# 1. Baked path
|
|
138
|
+
if [[ -f "$BAKED_PANEFUL" ]]; then echo "$BAKED_PANEFUL"; return; fi
|
|
139
|
+
|
|
140
|
+
# 2. Common global bin locations
|
|
141
|
+
for p in /usr/local/bin/paneful /opt/homebrew/bin/paneful; do
|
|
142
|
+
if [[ -x "$p" ]]; then
|
|
143
|
+
# Resolve symlink to get the actual .js file
|
|
144
|
+
local resolved
|
|
145
|
+
resolved=$(readlink -f "$p" 2>/dev/null || readlink "$p" 2>/dev/null || echo "$p")
|
|
146
|
+
echo "$resolved"; return
|
|
147
|
+
fi
|
|
148
|
+
done
|
|
149
|
+
|
|
150
|
+
# 3. npm global prefix
|
|
151
|
+
local node_bin
|
|
152
|
+
node_bin=$(dirname "$1")
|
|
153
|
+
if [[ -x "$node_bin/paneful" ]]; then
|
|
154
|
+
local resolved
|
|
155
|
+
resolved=$(readlink -f "$node_bin/paneful" 2>/dev/null || readlink "$node_bin/paneful" 2>/dev/null || echo "$node_bin/paneful")
|
|
156
|
+
echo "$resolved"; return
|
|
157
|
+
fi
|
|
158
|
+
|
|
159
|
+
return 1
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
show_error() {
|
|
163
|
+
osascript -e "display dialog \\"$1\\" with title \\"Paneful\\" buttons {\\"OK\\"} default button \\"OK\\" with icon stop" 2>/dev/null
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
NODE=$(find_node)
|
|
167
|
+
if [[ -z "$NODE" ]]; then
|
|
168
|
+
echo "ERROR: node not found"
|
|
169
|
+
show_error "Could not find Node.js.\\n\\nInstall Node.js and run: paneful --install-app"
|
|
170
|
+
exit 1
|
|
171
|
+
fi
|
|
172
|
+
echo "Using node: $NODE"
|
|
173
|
+
|
|
174
|
+
PANEFUL=$(find_paneful "$NODE")
|
|
175
|
+
if [[ -z "$PANEFUL" ]]; then
|
|
176
|
+
echo "ERROR: paneful not found"
|
|
177
|
+
show_error "Could not find paneful.\\n\\nRun: npm install -g paneful && paneful --install-app"
|
|
178
|
+
exit 1
|
|
179
|
+
fi
|
|
180
|
+
echo "Using paneful: $PANEFUL"
|
|
181
|
+
|
|
182
|
+
exec "$NODE" "$PANEFUL"
|
|
183
|
+
`;
|
|
184
|
+
}
|
|
185
|
+
export async function installApp() {
|
|
186
|
+
if (process.platform !== 'darwin') {
|
|
187
|
+
console.error('paneful --install-app is only supported on macOS.');
|
|
188
|
+
process.exit(1);
|
|
189
|
+
}
|
|
190
|
+
console.log('Creating Paneful.app in /Applications...');
|
|
191
|
+
const contentsDir = path.join(APP_PATH, 'Contents');
|
|
192
|
+
const macosDir = path.join(contentsDir, 'MacOS');
|
|
193
|
+
const resourcesDir = path.join(contentsDir, 'Resources');
|
|
194
|
+
try {
|
|
195
|
+
// Create directory structure
|
|
196
|
+
fs.mkdirSync(macosDir, { recursive: true });
|
|
197
|
+
fs.mkdirSync(resourcesDir, { recursive: true });
|
|
198
|
+
// Icon
|
|
199
|
+
const iconSource = findIconSource();
|
|
200
|
+
let hasIcon = false;
|
|
201
|
+
if (iconSource) {
|
|
202
|
+
const icnsPath = buildIcns(iconSource, contentsDir);
|
|
203
|
+
hasIcon = icnsPath !== null;
|
|
204
|
+
if (hasIcon) {
|
|
205
|
+
console.log(' Icon: converted to .icns');
|
|
206
|
+
}
|
|
207
|
+
else {
|
|
208
|
+
console.log(' Icon: conversion failed, using generic icon');
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
else {
|
|
212
|
+
console.log(' Icon: source not found, using generic icon');
|
|
213
|
+
}
|
|
214
|
+
// Info.plist
|
|
215
|
+
fs.writeFileSync(path.join(contentsDir, 'Info.plist'), getInfoPlist(hasIcon));
|
|
216
|
+
console.log(' Info.plist: written');
|
|
217
|
+
// Launcher script
|
|
218
|
+
const launcherPath = path.join(macosDir, 'Paneful');
|
|
219
|
+
fs.writeFileSync(launcherPath, getLauncherScript());
|
|
220
|
+
fs.chmodSync(launcherPath, 0o755);
|
|
221
|
+
console.log(' Launcher: written');
|
|
222
|
+
// Touch the app so Finder picks up changes
|
|
223
|
+
try {
|
|
224
|
+
execFileSync('touch', [APP_PATH], { stdio: 'pipe' });
|
|
225
|
+
}
|
|
226
|
+
catch { /* ok */ }
|
|
227
|
+
console.log('\nPaneful.app installed successfully!');
|
|
228
|
+
console.log('You can now launch Paneful from your Applications folder or Dock.');
|
|
229
|
+
}
|
|
230
|
+
catch (err) {
|
|
231
|
+
if (err.code === 'EACCES') {
|
|
232
|
+
console.error('\nPermission denied. Try:');
|
|
233
|
+
console.error(' sudo paneful --install-app');
|
|
234
|
+
process.exit(1);
|
|
235
|
+
}
|
|
236
|
+
throw err;
|
|
237
|
+
}
|
|
238
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import net from 'node:net';
|
|
2
|
+
export async function sendIpcCommand(socketPath, request) {
|
|
3
|
+
return new Promise((resolve, reject) => {
|
|
4
|
+
const client = net.createConnection(socketPath, () => {
|
|
5
|
+
client.write(JSON.stringify(request) + '\n');
|
|
6
|
+
});
|
|
7
|
+
let buffer = '';
|
|
8
|
+
client.on('data', (chunk) => {
|
|
9
|
+
buffer += chunk.toString();
|
|
10
|
+
const newlineIdx = buffer.indexOf('\n');
|
|
11
|
+
if (newlineIdx !== -1) {
|
|
12
|
+
const line = buffer.slice(0, newlineIdx).trim();
|
|
13
|
+
try {
|
|
14
|
+
resolve(JSON.parse(line));
|
|
15
|
+
}
|
|
16
|
+
catch {
|
|
17
|
+
reject(new Error('Invalid IPC response'));
|
|
18
|
+
}
|
|
19
|
+
client.end();
|
|
20
|
+
}
|
|
21
|
+
});
|
|
22
|
+
client.on('error', (err) => {
|
|
23
|
+
reject(new Error(`Failed to connect to paneful: ${err.message}`));
|
|
24
|
+
});
|
|
25
|
+
});
|
|
26
|
+
}
|
package/dist/server/ipc.js
CHANGED
|
@@ -69,28 +69,3 @@ function handleIpcRequest(request, ptyManager, projectStore, wsHandler) {
|
|
|
69
69
|
}
|
|
70
70
|
}
|
|
71
71
|
}
|
|
72
|
-
export async function sendIpcCommand(socketPath, request) {
|
|
73
|
-
return new Promise((resolve, reject) => {
|
|
74
|
-
const client = net.createConnection(socketPath, () => {
|
|
75
|
-
client.write(JSON.stringify(request) + '\n');
|
|
76
|
-
});
|
|
77
|
-
let buffer = '';
|
|
78
|
-
client.on('data', (chunk) => {
|
|
79
|
-
buffer += chunk.toString();
|
|
80
|
-
const newlineIdx = buffer.indexOf('\n');
|
|
81
|
-
if (newlineIdx !== -1) {
|
|
82
|
-
const line = buffer.slice(0, newlineIdx).trim();
|
|
83
|
-
try {
|
|
84
|
-
resolve(JSON.parse(line));
|
|
85
|
-
}
|
|
86
|
-
catch {
|
|
87
|
-
reject(new Error('Invalid IPC response'));
|
|
88
|
-
}
|
|
89
|
-
client.end();
|
|
90
|
-
}
|
|
91
|
-
});
|
|
92
|
-
client.on('error', (err) => {
|
|
93
|
-
reject(new Error(`Failed to connect to paneful: ${err.message}`));
|
|
94
|
-
});
|
|
95
|
-
});
|
|
96
|
-
}
|
|
@@ -61,8 +61,8 @@ WARNING: This link could potentially be dangerous`)){const o=window.open();if(o)
|
|
|
61
61
|
`:`
|
|
62
62
|
`)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(y){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._refresh())),o.isLinux&&y&&this.selectionText.length&&this._onLinuxMouseSelection.fire(this.selectionText)}_refresh(){this._refreshAnimationFrame=void 0,this._onRedrawRequest.fire({start:this._model.finalSelectionStart,end:this._model.finalSelectionEnd,columnSelectMode:this._activeSelectionMode===3})}_isClickInSelection(y){const b=this._getMouseBufferCoords(y),R=this._model.finalSelectionStart,M=this._model.finalSelectionEnd;return!!(R&&M&&b)&&this._areCoordsInSelection(b,R,M)}isCellInSelection(y,b){const R=this._model.finalSelectionStart,M=this._model.finalSelectionEnd;return!(!R||!M)&&this._areCoordsInSelection([y,b],R,M)}_areCoordsInSelection(y,b,R){return y[1]>b[1]&&y[1]<R[1]||b[1]===R[1]&&y[1]===b[1]&&y[0]>=b[0]&&y[0]<R[0]||b[1]<R[1]&&y[1]===R[1]&&y[0]<R[0]||b[1]<R[1]&&y[1]===b[1]&&y[0]>=b[0]}_selectWordAtCursor(y,b){var B,T;const R=(T=(B=this._linkifier.currentLink)==null?void 0:B.link)==null?void 0:T.range;if(R)return this._model.selectionStart=[R.start.x-1,R.start.y-1],this._model.selectionStartLength=(0,s.getRangeLength)(R,this._bufferService.cols),this._model.selectionEnd=void 0,!0;const M=this._getMouseBufferCoords(y);return!!M&&(this._selectWordAt(M,b),this._model.selectionEnd=void 0,!0)}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(y,b){this._model.clearSelection(),y=Math.max(y,0),b=Math.min(b,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,y],this._model.selectionEnd=[this._bufferService.cols,b],this.refresh(),this._onSelectionChange.fire()}_handleTrim(y){this._model.handleTrim(y)&&this.refresh()}_getMouseBufferCoords(y){const b=this._mouseService.getCoords(y,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(b)return b[0]--,b[1]--,b[1]+=this._bufferService.buffer.ydisp,b}_getMouseEventScrollAmount(y){let b=(0,d.getCoordsRelativeToElement)(this._coreBrowserService.window,y,this._screenElement)[1];const R=this._renderService.dimensions.css.canvas.height;return b>=0&&b<=R?0:(b>R&&(b-=R),b=Math.min(Math.max(b,-50),50),b/=50,b/Math.abs(b)+Math.round(14*b))}shouldForceSelection(y){return o.isMac?y.altKey&&this._optionsService.rawOptions.macOptionClickForcesSelection:y.shiftKey}handleMouseDown(y){if(this._mouseDownTimeStamp=y.timeStamp,(y.button!==2||!this.hasSelection)&&y.button===0){if(!this._enabled){if(!this.shouldForceSelection(y))return;y.stopPropagation()}y.preventDefault(),this._dragScrollAmount=0,this._enabled&&y.shiftKey?this._handleIncrementalClick(y):y.detail===1?this._handleSingleClick(y):y.detail===2?this._handleDoubleClick(y):y.detail===3&&this._handleTripleClick(y),this._addMouseDownListeners(),this.refresh(!0)}}_addMouseDownListeners(){this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.addEventListener("mousemove",this._mouseMoveListener),this._screenElement.ownerDocument.addEventListener("mouseup",this._mouseUpListener)),this._dragScrollIntervalTimer=this._coreBrowserService.window.setInterval(()=>this._dragScroll(),50)}_removeMouseDownListeners(){this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.removeEventListener("mousemove",this._mouseMoveListener),this._screenElement.ownerDocument.removeEventListener("mouseup",this._mouseUpListener)),this._coreBrowserService.window.clearInterval(this._dragScrollIntervalTimer),this._dragScrollIntervalTimer=void 0}_handleIncrementalClick(y){this._model.selectionStart&&(this._model.selectionEnd=this._getMouseBufferCoords(y))}_handleSingleClick(y){if(this._model.selectionStartLength=0,this._model.isSelectAllActive=!1,this._activeSelectionMode=this.shouldColumnSelect(y)?3:0,this._model.selectionStart=this._getMouseBufferCoords(y),!this._model.selectionStart)return;this._model.selectionEnd=void 0;const b=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);b&&b.length!==this._model.selectionStart[0]&&b.hasWidth(this._model.selectionStart[0])===0&&this._model.selectionStart[0]++}_handleDoubleClick(y){this._selectWordAtCursor(y,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(y){const b=this._getMouseBufferCoords(y);b&&(this._activeSelectionMode=2,this._selectLineAt(b[1]))}shouldColumnSelect(y){return y.altKey&&!(o.isMac&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(y){if(y.stopImmediatePropagation(),!this._model.selectionStart)return;const b=this._model.selectionEnd?[this._model.selectionEnd[0],this._model.selectionEnd[1]]:null;if(this._model.selectionEnd=this._getMouseBufferCoords(y),!this._model.selectionEnd)return void this.refresh(!0);this._activeSelectionMode===2?this._model.selectionEnd[1]<this._model.selectionStart[1]?this._model.selectionEnd[0]=0:this._model.selectionEnd[0]=this._bufferService.cols:this._activeSelectionMode===1&&this._selectToWordAt(this._model.selectionEnd),this._dragScrollAmount=this._getMouseEventScrollAmount(y),this._activeSelectionMode!==3&&(this._dragScrollAmount>0?this._model.selectionEnd[0]=this._bufferService.cols:this._dragScrollAmount<0&&(this._model.selectionEnd[0]=0));const R=this._bufferService.buffer;if(this._model.selectionEnd[1]<R.lines.length){const M=R.lines.get(this._model.selectionEnd[1]);M&&M.hasWidth(this._model.selectionEnd[0])===0&&this._model.selectionEnd[0]<this._bufferService.cols&&this._model.selectionEnd[0]++}b&&b[0]===this._model.selectionEnd[0]&&b[1]===this._model.selectionEnd[1]||this.refresh(!0)}_dragScroll(){if(this._model.selectionEnd&&this._model.selectionStart&&this._dragScrollAmount){this._onRequestScrollLines.fire({amount:this._dragScrollAmount,suppressScrollEvent:!1});const y=this._bufferService.buffer;this._dragScrollAmount>0?(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=this._bufferService.cols),this._model.selectionEnd[1]=Math.min(y.ydisp+this._bufferService.rows,y.lines.length-1)):(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=0),this._model.selectionEnd[1]=y.ydisp),this.refresh()}}_handleMouseUp(y){const b=y.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&b<500&&y.altKey&&this._optionsService.rawOptions.altClickMovesCursor){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){const R=this._mouseService.getCoords(y,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(R&&R[0]!==void 0&&R[1]!==void 0){const M=(0,p.moveToCellSequence)(R[0]-1,R[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(M,!0)}}}else this._fireEventIfSelectionChanged()}_fireEventIfSelectionChanged(){const y=this._model.finalSelectionStart,b=this._model.finalSelectionEnd,R=!(!y||!b||y[0]===b[0]&&y[1]===b[1]);R?y&&b&&(this._oldSelectionStart&&this._oldSelectionEnd&&y[0]===this._oldSelectionStart[0]&&y[1]===this._oldSelectionStart[1]&&b[0]===this._oldSelectionEnd[0]&&b[1]===this._oldSelectionEnd[1]||this._fireOnSelectionChange(y,b,R)):this._oldHasSelection&&this._fireOnSelectionChange(y,b,R)}_fireOnSelectionChange(y,b,R){this._oldSelectionStart=y,this._oldSelectionEnd=b,this._oldHasSelection=R,this._onSelectionChange.fire()}_handleBufferActivate(y){this.clearSelection(),this._trimListener.dispose(),this._trimListener=y.activeBuffer.lines.onTrim(b=>this._handleTrim(b))}_convertViewportColToCharacterIndex(y,b){let R=b;for(let M=0;b>=M;M++){const B=y.loadCell(M,this._workCell).getChars().length;this._workCell.getWidth()===0?R--:B>1&&b!==M&&(R+=B-1)}return R}setSelection(y,b,R){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[y,b],this._model.selectionStartLength=R,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(y){this._isClickInSelection(y)||(this._selectWordAtCursor(y,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(y,b,R=!0,M=!0){if(y[0]>=this._bufferService.cols)return;const B=this._bufferService.buffer,T=B.lines.get(y[1]);if(!T)return;const N=B.translateBufferLineToString(y[1],!1);let F=this._convertViewportColToCharacterIndex(T,y[0]),K=F;const q=y[0]-F;let j=0,E=0,D=0,P=0;if(N.charAt(F)===" "){for(;F>0&&N.charAt(F-1)===" ";)F--;for(;K<N.length&&N.charAt(K+1)===" ";)K++}else{let V=y[0],J=y[0];T.getWidth(V)===0&&(j++,V--),T.getWidth(J)===2&&(E++,J++);const Z=T.getString(J).length;for(Z>1&&(P+=Z-1,K+=Z-1);V>0&&F>0&&!this._isCharWordSeparator(T.loadCell(V-1,this._workCell));){T.loadCell(V-1,this._workCell);const I=this._workCell.getChars().length;this._workCell.getWidth()===0?(j++,V--):I>1&&(D+=I-1,F-=I-1),F--,V--}for(;J<T.length&&K+1<N.length&&!this._isCharWordSeparator(T.loadCell(J+1,this._workCell));){T.loadCell(J+1,this._workCell);const I=this._workCell.getChars().length;this._workCell.getWidth()===2?(E++,J++):I>1&&(P+=I-1,K+=I-1),K++,J++}}K++;let O=F+q-j+D,W=Math.min(this._bufferService.cols,K-F+j+E-D-P);if(b||N.slice(F,K).trim()!==""){if(R&&O===0&&T.getCodePoint(0)!==32){const V=B.lines.get(y[1]-1);if(V&&T.isWrapped&&V.getCodePoint(this._bufferService.cols-1)!==32){const J=this._getWordAt([this._bufferService.cols-1,y[1]-1],!1,!0,!1);if(J){const Z=this._bufferService.cols-J.start;O-=Z,W+=Z}}}if(M&&O+W===this._bufferService.cols&&T.getCodePoint(this._bufferService.cols-1)!==32){const V=B.lines.get(y[1]+1);if(V!=null&&V.isWrapped&&V.getCodePoint(0)!==32){const J=this._getWordAt([0,y[1]+1],!1,!1,!0);J&&(W+=J.length)}}return{start:O,length:W}}}_selectWordAt(y,b){const R=this._getWordAt(y,b);if(R){for(;R.start<0;)R.start+=this._bufferService.cols,y[1]--;this._model.selectionStart=[R.start,y[1]],this._model.selectionStartLength=R.length}}_selectToWordAt(y){const b=this._getWordAt(y,!0);if(b){let R=y[1];for(;b.start<0;)b.start+=this._bufferService.cols,R--;if(!this._model.areSelectionValuesReversed())for(;b.start+b.length>this._bufferService.cols;)b.length-=this._bufferService.cols,R++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?b.start:b.start+b.length,R]}}_isCharWordSeparator(y){return y.getWidth()!==0&&this._optionsService.rawOptions.wordSeparator.indexOf(y.getChars())>=0}_selectLineAt(y){const b=this._bufferService.buffer.getWrappedRangeForLine(y),R={start:{x:0,y:b.first},end:{x:this._bufferService.cols-1,y:b.last}};this._model.selectionStart=[0,b.first],this._model.selectionEnd=void 0,this._model.selectionStartLength=(0,s.getRangeLength)(R,this._bufferService.cols)}};a.SelectionService=k=f([g(3,v.IBufferService),g(4,v.ICoreService),g(5,w.IMouseService),g(6,v.IOptionsService),g(7,w.IRenderService),g(8,w.ICoreBrowserService)],k)},4725:(m,a,u)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.ILinkProviderService=a.IThemeService=a.ICharacterJoinerService=a.ISelectionService=a.IRenderService=a.IMouseService=a.ICoreBrowserService=a.ICharSizeService=void 0;const f=u(8343);a.ICharSizeService=(0,f.createDecorator)("CharSizeService"),a.ICoreBrowserService=(0,f.createDecorator)("CoreBrowserService"),a.IMouseService=(0,f.createDecorator)("MouseService"),a.IRenderService=(0,f.createDecorator)("RenderService"),a.ISelectionService=(0,f.createDecorator)("SelectionService"),a.ICharacterJoinerService=(0,f.createDecorator)("CharacterJoinerService"),a.IThemeService=(0,f.createDecorator)("ThemeService"),a.ILinkProviderService=(0,f.createDecorator)("LinkProviderService")},6731:function(m,a,u){var f=this&&this.__decorate||function(k,y,b,R){var M,B=arguments.length,T=B<3?y:R===null?R=Object.getOwnPropertyDescriptor(y,b):R;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")T=Reflect.decorate(k,y,b,R);else for(var N=k.length-1;N>=0;N--)(M=k[N])&&(T=(B<3?M(T):B>3?M(y,b,T):M(y,b))||T);return B>3&&T&&Object.defineProperty(y,b,T),T},g=this&&this.__param||function(k,y){return function(b,R){y(b,R,k)}};Object.defineProperty(a,"__esModule",{value:!0}),a.ThemeService=a.DEFAULT_ANSI_COLORS=void 0;const d=u(7239),p=u(8055),S=u(8460),w=u(844),_=u(2585),c=p.css.toColor("#ffffff"),o=p.css.toColor("#000000"),s=p.css.toColor("#ffffff"),l=p.css.toColor("#000000"),v={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117};a.DEFAULT_ANSI_COLORS=Object.freeze((()=>{const k=[p.css.toColor("#2e3436"),p.css.toColor("#cc0000"),p.css.toColor("#4e9a06"),p.css.toColor("#c4a000"),p.css.toColor("#3465a4"),p.css.toColor("#75507b"),p.css.toColor("#06989a"),p.css.toColor("#d3d7cf"),p.css.toColor("#555753"),p.css.toColor("#ef2929"),p.css.toColor("#8ae234"),p.css.toColor("#fce94f"),p.css.toColor("#729fcf"),p.css.toColor("#ad7fa8"),p.css.toColor("#34e2e2"),p.css.toColor("#eeeeec")],y=[0,95,135,175,215,255];for(let b=0;b<216;b++){const R=y[b/36%6|0],M=y[b/6%6|0],B=y[b%6];k.push({css:p.channels.toCss(R,M,B),rgba:p.channels.toRgba(R,M,B)})}for(let b=0;b<24;b++){const R=8+10*b;k.push({css:p.channels.toCss(R,R,R),rgba:p.channels.toRgba(R,R,R)})}return k})());let C=a.ThemeService=class extends w.Disposable{get colors(){return this._colors}constructor(k){super(),this._optionsService=k,this._contrastCache=new d.ColorContrastCache,this._halfContrastCache=new d.ColorContrastCache,this._onChangeColors=this.register(new S.EventEmitter),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:c,background:o,cursor:s,cursorAccent:l,selectionForeground:void 0,selectionBackgroundTransparent:v,selectionBackgroundOpaque:p.color.blend(o,v),selectionInactiveBackgroundTransparent:v,selectionInactiveBackgroundOpaque:p.color.blend(o,v),ansi:a.DEFAULT_ANSI_COLORS.slice(),contrastCache:this._contrastCache,halfContrastCache:this._halfContrastCache},this._updateRestoreColors(),this._setTheme(this._optionsService.rawOptions.theme),this.register(this._optionsService.onSpecificOptionChange("minimumContrastRatio",()=>this._contrastCache.clear())),this.register(this._optionsService.onSpecificOptionChange("theme",()=>this._setTheme(this._optionsService.rawOptions.theme)))}_setTheme(k={}){const y=this._colors;if(y.foreground=x(k.foreground,c),y.background=x(k.background,o),y.cursor=x(k.cursor,s),y.cursorAccent=x(k.cursorAccent,l),y.selectionBackgroundTransparent=x(k.selectionBackground,v),y.selectionBackgroundOpaque=p.color.blend(y.background,y.selectionBackgroundTransparent),y.selectionInactiveBackgroundTransparent=x(k.selectionInactiveBackground,y.selectionBackgroundTransparent),y.selectionInactiveBackgroundOpaque=p.color.blend(y.background,y.selectionInactiveBackgroundTransparent),y.selectionForeground=k.selectionForeground?x(k.selectionForeground,p.NULL_COLOR):void 0,y.selectionForeground===p.NULL_COLOR&&(y.selectionForeground=void 0),p.color.isOpaque(y.selectionBackgroundTransparent)&&(y.selectionBackgroundTransparent=p.color.opacity(y.selectionBackgroundTransparent,.3)),p.color.isOpaque(y.selectionInactiveBackgroundTransparent)&&(y.selectionInactiveBackgroundTransparent=p.color.opacity(y.selectionInactiveBackgroundTransparent,.3)),y.ansi=a.DEFAULT_ANSI_COLORS.slice(),y.ansi[0]=x(k.black,a.DEFAULT_ANSI_COLORS[0]),y.ansi[1]=x(k.red,a.DEFAULT_ANSI_COLORS[1]),y.ansi[2]=x(k.green,a.DEFAULT_ANSI_COLORS[2]),y.ansi[3]=x(k.yellow,a.DEFAULT_ANSI_COLORS[3]),y.ansi[4]=x(k.blue,a.DEFAULT_ANSI_COLORS[4]),y.ansi[5]=x(k.magenta,a.DEFAULT_ANSI_COLORS[5]),y.ansi[6]=x(k.cyan,a.DEFAULT_ANSI_COLORS[6]),y.ansi[7]=x(k.white,a.DEFAULT_ANSI_COLORS[7]),y.ansi[8]=x(k.brightBlack,a.DEFAULT_ANSI_COLORS[8]),y.ansi[9]=x(k.brightRed,a.DEFAULT_ANSI_COLORS[9]),y.ansi[10]=x(k.brightGreen,a.DEFAULT_ANSI_COLORS[10]),y.ansi[11]=x(k.brightYellow,a.DEFAULT_ANSI_COLORS[11]),y.ansi[12]=x(k.brightBlue,a.DEFAULT_ANSI_COLORS[12]),y.ansi[13]=x(k.brightMagenta,a.DEFAULT_ANSI_COLORS[13]),y.ansi[14]=x(k.brightCyan,a.DEFAULT_ANSI_COLORS[14]),y.ansi[15]=x(k.brightWhite,a.DEFAULT_ANSI_COLORS[15]),k.extendedAnsi){const b=Math.min(y.ansi.length-16,k.extendedAnsi.length);for(let R=0;R<b;R++)y.ansi[R+16]=x(k.extendedAnsi[R],a.DEFAULT_ANSI_COLORS[R+16])}this._contrastCache.clear(),this._halfContrastCache.clear(),this._updateRestoreColors(),this._onChangeColors.fire(this.colors)}restoreColor(k){this._restoreColor(k),this._onChangeColors.fire(this.colors)}_restoreColor(k){if(k!==void 0)switch(k){case 256:this._colors.foreground=this._restoreColors.foreground;break;case 257:this._colors.background=this._restoreColors.background;break;case 258:this._colors.cursor=this._restoreColors.cursor;break;default:this._colors.ansi[k]=this._restoreColors.ansi[k]}else for(let y=0;y<this._restoreColors.ansi.length;++y)this._colors.ansi[y]=this._restoreColors.ansi[y]}modifyColors(k){k(this._colors),this._onChangeColors.fire(this.colors)}_updateRestoreColors(){this._restoreColors={foreground:this._colors.foreground,background:this._colors.background,cursor:this._colors.cursor,ansi:this._colors.ansi.slice()}}};function x(k,y){if(k!==void 0)try{return p.css.toColor(k)}catch{}return y}a.ThemeService=C=f([g(0,_.IOptionsService)],C)},6349:(m,a,u)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.CircularList=void 0;const f=u(8460),g=u(844);class d extends g.Disposable{constructor(S){super(),this._maxLength=S,this.onDeleteEmitter=this.register(new f.EventEmitter),this.onDelete=this.onDeleteEmitter.event,this.onInsertEmitter=this.register(new f.EventEmitter),this.onInsert=this.onInsertEmitter.event,this.onTrimEmitter=this.register(new f.EventEmitter),this.onTrim=this.onTrimEmitter.event,this._array=new Array(this._maxLength),this._startIndex=0,this._length=0}get maxLength(){return this._maxLength}set maxLength(S){if(this._maxLength===S)return;const w=new Array(S);for(let _=0;_<Math.min(S,this.length);_++)w[_]=this._array[this._getCyclicIndex(_)];this._array=w,this._maxLength=S,this._startIndex=0}get length(){return this._length}set length(S){if(S>this._length)for(let w=this._length;w<S;w++)this._array[w]=void 0;this._length=S}get(S){return this._array[this._getCyclicIndex(S)]}set(S,w){this._array[this._getCyclicIndex(S)]=w}push(S){this._array[this._getCyclicIndex(this._length)]=S,this._length===this._maxLength?(this._startIndex=++this._startIndex%this._maxLength,this.onTrimEmitter.fire(1)):this._length++}recycle(){if(this._length!==this._maxLength)throw new Error("Can only recycle when the buffer is full");return this._startIndex=++this._startIndex%this._maxLength,this.onTrimEmitter.fire(1),this._array[this._getCyclicIndex(this._length-1)]}get isFull(){return this._length===this._maxLength}pop(){return this._array[this._getCyclicIndex(this._length---1)]}splice(S,w,..._){if(w){for(let c=S;c<this._length-w;c++)this._array[this._getCyclicIndex(c)]=this._array[this._getCyclicIndex(c+w)];this._length-=w,this.onDeleteEmitter.fire({index:S,amount:w})}for(let c=this._length-1;c>=S;c--)this._array[this._getCyclicIndex(c+_.length)]=this._array[this._getCyclicIndex(c)];for(let c=0;c<_.length;c++)this._array[this._getCyclicIndex(S+c)]=_[c];if(_.length&&this.onInsertEmitter.fire({index:S,amount:_.length}),this._length+_.length>this._maxLength){const c=this._length+_.length-this._maxLength;this._startIndex+=c,this._length=this._maxLength,this.onTrimEmitter.fire(c)}else this._length+=_.length}trimStart(S){S>this._length&&(S=this._length),this._startIndex+=S,this._length-=S,this.onTrimEmitter.fire(S)}shiftElements(S,w,_){if(!(w<=0)){if(S<0||S>=this._length)throw new Error("start argument out of range");if(S+_<0)throw new Error("Cannot shift elements in list beyond index 0");if(_>0){for(let o=w-1;o>=0;o--)this.set(S+o+_,this.get(S+o));const c=S+w+_-this._length;if(c>0)for(this._length+=c;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(let c=0;c<w;c++)this.set(S+c+_,this.get(S+c))}}_getCyclicIndex(S){return(this._startIndex+S)%this._maxLength}}a.CircularList=d},1439:(m,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.clone=void 0,a.clone=function u(f,g=5){if(typeof f!="object")return f;const d=Array.isArray(f)?[]:{};for(const p in f)d[p]=g<=1?f[p]:f[p]&&u(f[p],g-1);return d}},8055:(m,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.contrastRatio=a.toPaddedHex=a.rgba=a.rgb=a.css=a.color=a.channels=a.NULL_COLOR=void 0;let u=0,f=0,g=0,d=0;var p,S,w,_,c;function o(l){const v=l.toString(16);return v.length<2?"0"+v:v}function s(l,v){return l<v?(v+.05)/(l+.05):(l+.05)/(v+.05)}a.NULL_COLOR={css:"#00000000",rgba:0},function(l){l.toCss=function(v,C,x,k){return k!==void 0?`#${o(v)}${o(C)}${o(x)}${o(k)}`:`#${o(v)}${o(C)}${o(x)}`},l.toRgba=function(v,C,x,k=255){return(v<<24|C<<16|x<<8|k)>>>0},l.toColor=function(v,C,x,k){return{css:l.toCss(v,C,x,k),rgba:l.toRgba(v,C,x,k)}}}(p||(a.channels=p={})),function(l){function v(C,x){return d=Math.round(255*x),[u,f,g]=c.toChannels(C.rgba),{css:p.toCss(u,f,g,d),rgba:p.toRgba(u,f,g,d)}}l.blend=function(C,x){if(d=(255&x.rgba)/255,d===1)return{css:x.css,rgba:x.rgba};const k=x.rgba>>24&255,y=x.rgba>>16&255,b=x.rgba>>8&255,R=C.rgba>>24&255,M=C.rgba>>16&255,B=C.rgba>>8&255;return u=R+Math.round((k-R)*d),f=M+Math.round((y-M)*d),g=B+Math.round((b-B)*d),{css:p.toCss(u,f,g),rgba:p.toRgba(u,f,g)}},l.isOpaque=function(C){return(255&C.rgba)==255},l.ensureContrastRatio=function(C,x,k){const y=c.ensureContrastRatio(C.rgba,x.rgba,k);if(y)return p.toColor(y>>24&255,y>>16&255,y>>8&255)},l.opaque=function(C){const x=(255|C.rgba)>>>0;return[u,f,g]=c.toChannels(x),{css:p.toCss(u,f,g),rgba:x}},l.opacity=v,l.multiplyOpacity=function(C,x){return d=255&C.rgba,v(C,d*x/255)},l.toColorRGB=function(C){return[C.rgba>>24&255,C.rgba>>16&255,C.rgba>>8&255]}}(S||(a.color=S={})),function(l){let v,C;try{const x=document.createElement("canvas");x.width=1,x.height=1;const k=x.getContext("2d",{willReadFrequently:!0});k&&(v=k,v.globalCompositeOperation="copy",C=v.createLinearGradient(0,0,1,1))}catch{}l.toColor=function(x){if(x.match(/#[\da-f]{3,8}/i))switch(x.length){case 4:return u=parseInt(x.slice(1,2).repeat(2),16),f=parseInt(x.slice(2,3).repeat(2),16),g=parseInt(x.slice(3,4).repeat(2),16),p.toColor(u,f,g);case 5:return u=parseInt(x.slice(1,2).repeat(2),16),f=parseInt(x.slice(2,3).repeat(2),16),g=parseInt(x.slice(3,4).repeat(2),16),d=parseInt(x.slice(4,5).repeat(2),16),p.toColor(u,f,g,d);case 7:return{css:x,rgba:(parseInt(x.slice(1),16)<<8|255)>>>0};case 9:return{css:x,rgba:parseInt(x.slice(1),16)>>>0}}const k=x.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(k)return u=parseInt(k[1]),f=parseInt(k[2]),g=parseInt(k[3]),d=Math.round(255*(k[5]===void 0?1:parseFloat(k[5]))),p.toColor(u,f,g,d);if(!v||!C)throw new Error("css.toColor: Unsupported css format");if(v.fillStyle=C,v.fillStyle=x,typeof v.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(v.fillRect(0,0,1,1),[u,f,g,d]=v.getImageData(0,0,1,1).data,d!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:p.toRgba(u,f,g,d),css:x}}}(w||(a.css=w={})),function(l){function v(C,x,k){const y=C/255,b=x/255,R=k/255;return .2126*(y<=.03928?y/12.92:Math.pow((y+.055)/1.055,2.4))+.7152*(b<=.03928?b/12.92:Math.pow((b+.055)/1.055,2.4))+.0722*(R<=.03928?R/12.92:Math.pow((R+.055)/1.055,2.4))}l.relativeLuminance=function(C){return v(C>>16&255,C>>8&255,255&C)},l.relativeLuminance2=v}(_||(a.rgb=_={})),function(l){function v(x,k,y){const b=x>>24&255,R=x>>16&255,M=x>>8&255;let B=k>>24&255,T=k>>16&255,N=k>>8&255,F=s(_.relativeLuminance2(B,T,N),_.relativeLuminance2(b,R,M));for(;F<y&&(B>0||T>0||N>0);)B-=Math.max(0,Math.ceil(.1*B)),T-=Math.max(0,Math.ceil(.1*T)),N-=Math.max(0,Math.ceil(.1*N)),F=s(_.relativeLuminance2(B,T,N),_.relativeLuminance2(b,R,M));return(B<<24|T<<16|N<<8|255)>>>0}function C(x,k,y){const b=x>>24&255,R=x>>16&255,M=x>>8&255;let B=k>>24&255,T=k>>16&255,N=k>>8&255,F=s(_.relativeLuminance2(B,T,N),_.relativeLuminance2(b,R,M));for(;F<y&&(B<255||T<255||N<255);)B=Math.min(255,B+Math.ceil(.1*(255-B))),T=Math.min(255,T+Math.ceil(.1*(255-T))),N=Math.min(255,N+Math.ceil(.1*(255-N))),F=s(_.relativeLuminance2(B,T,N),_.relativeLuminance2(b,R,M));return(B<<24|T<<16|N<<8|255)>>>0}l.blend=function(x,k){if(d=(255&k)/255,d===1)return k;const y=k>>24&255,b=k>>16&255,R=k>>8&255,M=x>>24&255,B=x>>16&255,T=x>>8&255;return u=M+Math.round((y-M)*d),f=B+Math.round((b-B)*d),g=T+Math.round((R-T)*d),p.toRgba(u,f,g)},l.ensureContrastRatio=function(x,k,y){const b=_.relativeLuminance(x>>8),R=_.relativeLuminance(k>>8);if(s(b,R)<y){if(R<b){const T=v(x,k,y),N=s(b,_.relativeLuminance(T>>8));if(N<y){const F=C(x,k,y);return N>s(b,_.relativeLuminance(F>>8))?T:F}return T}const M=C(x,k,y),B=s(b,_.relativeLuminance(M>>8));if(B<y){const T=v(x,k,y);return B>s(b,_.relativeLuminance(T>>8))?M:T}return M}},l.reduceLuminance=v,l.increaseLuminance=C,l.toChannels=function(x){return[x>>24&255,x>>16&255,x>>8&255,255&x]}}(c||(a.rgba=c={})),a.toPaddedHex=o,a.contrastRatio=s},8969:(m,a,u)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.CoreTerminal=void 0;const f=u(844),g=u(2585),d=u(4348),p=u(7866),S=u(744),w=u(7302),_=u(6975),c=u(8460),o=u(1753),s=u(1480),l=u(7994),v=u(9282),C=u(5435),x=u(5981),k=u(2660);let y=!1;class b extends f.Disposable{get onScroll(){return this._onScrollApi||(this._onScrollApi=this.register(new c.EventEmitter),this._onScroll.event(M=>{var B;(B=this._onScrollApi)==null||B.fire(M.position)})),this._onScrollApi.event}get cols(){return this._bufferService.cols}get rows(){return this._bufferService.rows}get buffers(){return this._bufferService.buffers}get options(){return this.optionsService.options}set options(M){for(const B in M)this.optionsService.options[B]=M[B]}constructor(M){super(),this._windowsWrappingHeuristics=this.register(new f.MutableDisposable),this._onBinary=this.register(new c.EventEmitter),this.onBinary=this._onBinary.event,this._onData=this.register(new c.EventEmitter),this.onData=this._onData.event,this._onLineFeed=this.register(new c.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onResize=this.register(new c.EventEmitter),this.onResize=this._onResize.event,this._onWriteParsed=this.register(new c.EventEmitter),this.onWriteParsed=this._onWriteParsed.event,this._onScroll=this.register(new c.EventEmitter),this._instantiationService=new d.InstantiationService,this.optionsService=this.register(new w.OptionsService(M)),this._instantiationService.setService(g.IOptionsService,this.optionsService),this._bufferService=this.register(this._instantiationService.createInstance(S.BufferService)),this._instantiationService.setService(g.IBufferService,this._bufferService),this._logService=this.register(this._instantiationService.createInstance(p.LogService)),this._instantiationService.setService(g.ILogService,this._logService),this.coreService=this.register(this._instantiationService.createInstance(_.CoreService)),this._instantiationService.setService(g.ICoreService,this.coreService),this.coreMouseService=this.register(this._instantiationService.createInstance(o.CoreMouseService)),this._instantiationService.setService(g.ICoreMouseService,this.coreMouseService),this.unicodeService=this.register(this._instantiationService.createInstance(s.UnicodeService)),this._instantiationService.setService(g.IUnicodeService,this.unicodeService),this._charsetService=this._instantiationService.createInstance(l.CharsetService),this._instantiationService.setService(g.ICharsetService,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(k.OscLinkService),this._instantiationService.setService(g.IOscLinkService,this._oscLinkService),this._inputHandler=this.register(new C.InputHandler(this._bufferService,this._charsetService,this.coreService,this._logService,this.optionsService,this._oscLinkService,this.coreMouseService,this.unicodeService)),this.register((0,c.forwardEvent)(this._inputHandler.onLineFeed,this._onLineFeed)),this.register(this._inputHandler),this.register((0,c.forwardEvent)(this._bufferService.onResize,this._onResize)),this.register((0,c.forwardEvent)(this.coreService.onData,this._onData)),this.register((0,c.forwardEvent)(this.coreService.onBinary,this._onBinary)),this.register(this.coreService.onRequestScrollToBottom(()=>this.scrollToBottom())),this.register(this.coreService.onUserInput(()=>this._writeBuffer.handleUserInput())),this.register(this.optionsService.onMultipleOptionChange(["windowsMode","windowsPty"],()=>this._handleWindowsPtyOptionChange())),this.register(this._bufferService.onScroll(B=>{this._onScroll.fire({position:this._bufferService.buffer.ydisp,source:0}),this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)})),this.register(this._inputHandler.onScroll(B=>{this._onScroll.fire({position:this._bufferService.buffer.ydisp,source:0}),this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)})),this._writeBuffer=this.register(new x.WriteBuffer((B,T)=>this._inputHandler.parse(B,T))),this.register((0,c.forwardEvent)(this._writeBuffer.onWriteParsed,this._onWriteParsed))}write(M,B){this._writeBuffer.write(M,B)}writeSync(M,B){this._logService.logLevel<=g.LogLevelEnum.WARN&&!y&&(this._logService.warn("writeSync is unreliable and will be removed soon."),y=!0),this._writeBuffer.writeSync(M,B)}input(M,B=!0){this.coreService.triggerDataEvent(M,B)}resize(M,B){isNaN(M)||isNaN(B)||(M=Math.max(M,S.MINIMUM_COLS),B=Math.max(B,S.MINIMUM_ROWS),this._bufferService.resize(M,B))}scroll(M,B=!1){this._bufferService.scroll(M,B)}scrollLines(M,B,T){this._bufferService.scrollLines(M,B,T)}scrollPages(M){this.scrollLines(M*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(){this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(M){const B=M-this._bufferService.buffer.ydisp;B!==0&&this.scrollLines(B)}registerEscHandler(M,B){return this._inputHandler.registerEscHandler(M,B)}registerDcsHandler(M,B){return this._inputHandler.registerDcsHandler(M,B)}registerCsiHandler(M,B){return this._inputHandler.registerCsiHandler(M,B)}registerOscHandler(M,B){return this._inputHandler.registerOscHandler(M,B)}_setup(){this._handleWindowsPtyOptionChange()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_handleWindowsPtyOptionChange(){let M=!1;const B=this.optionsService.rawOptions.windowsPty;B&&B.buildNumber!==void 0&&B.buildNumber!==void 0?M=B.backend==="conpty"&&B.buildNumber<21376:this.optionsService.rawOptions.windowsMode&&(M=!0),M?this._enableWindowsWrappingHeuristics():this._windowsWrappingHeuristics.clear()}_enableWindowsWrappingHeuristics(){if(!this._windowsWrappingHeuristics.value){const M=[];M.push(this.onLineFeed(v.updateWindowsModeWrappedState.bind(null,this._bufferService))),M.push(this.registerCsiHandler({final:"H"},()=>((0,v.updateWindowsModeWrappedState)(this._bufferService),!1))),this._windowsWrappingHeuristics.value=(0,f.toDisposable)(()=>{for(const B of M)B.dispose()})}}}a.CoreTerminal=b},8460:(m,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.runAndSubscribe=a.forwardEvent=a.EventEmitter=void 0,a.EventEmitter=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||(this._event=u=>(this._listeners.push(u),{dispose:()=>{if(!this._disposed){for(let f=0;f<this._listeners.length;f++)if(this._listeners[f]===u)return void this._listeners.splice(f,1)}}})),this._event}fire(u,f){const g=[];for(let d=0;d<this._listeners.length;d++)g.push(this._listeners[d]);for(let d=0;d<g.length;d++)g[d].call(void 0,u,f)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},a.forwardEvent=function(u,f){return u(g=>f.fire(g))},a.runAndSubscribe=function(u,f){return f(void 0),u(g=>f(g))}},5435:function(m,a,u){var f=this&&this.__decorate||function(j,E,D,P){var O,W=arguments.length,V=W<3?E:P===null?P=Object.getOwnPropertyDescriptor(E,D):P;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")V=Reflect.decorate(j,E,D,P);else for(var J=j.length-1;J>=0;J--)(O=j[J])&&(V=(W<3?O(V):W>3?O(E,D,V):O(E,D))||V);return W>3&&V&&Object.defineProperty(E,D,V),V},g=this&&this.__param||function(j,E){return function(D,P){E(D,P,j)}};Object.defineProperty(a,"__esModule",{value:!0}),a.InputHandler=a.WindowsOptionsReportType=void 0;const d=u(2584),p=u(7116),S=u(2015),w=u(844),_=u(482),c=u(8437),o=u(8460),s=u(643),l=u(511),v=u(3734),C=u(2585),x=u(1480),k=u(6242),y=u(6351),b=u(5941),R={"(":0,")":1,"*":2,"+":3,"-":1,".":2},M=131072;function B(j,E){if(j>24)return E.setWinLines||!1;switch(j){case 1:return!!E.restoreWin;case 2:return!!E.minimizeWin;case 3:return!!E.setWinPosition;case 4:return!!E.setWinSizePixels;case 5:return!!E.raiseWin;case 6:return!!E.lowerWin;case 7:return!!E.refreshWin;case 8:return!!E.setWinSizeChars;case 9:return!!E.maximizeWin;case 10:return!!E.fullscreenWin;case 11:return!!E.getWinState;case 13:return!!E.getWinPosition;case 14:return!!E.getWinSizePixels;case 15:return!!E.getScreenSizePixels;case 16:return!!E.getCellSizePixels;case 18:return!!E.getWinSizeChars;case 19:return!!E.getScreenSizeChars;case 20:return!!E.getIconTitle;case 21:return!!E.getWinTitle;case 22:return!!E.pushTitle;case 23:return!!E.popTitle;case 24:return!!E.setWinLines}return!1}var T;(function(j){j[j.GET_WIN_SIZE_PIXELS=0]="GET_WIN_SIZE_PIXELS",j[j.GET_CELL_SIZE_PIXELS=1]="GET_CELL_SIZE_PIXELS"})(T||(a.WindowsOptionsReportType=T={}));let N=0;class F extends w.Disposable{getAttrData(){return this._curAttrData}constructor(E,D,P,O,W,V,J,Z,I=new S.EscapeSequenceParser){super(),this._bufferService=E,this._charsetService=D,this._coreService=P,this._logService=O,this._optionsService=W,this._oscLinkService=V,this._coreMouseService=J,this._unicodeService=Z,this._parser=I,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new _.StringToUtf32,this._utf8Decoder=new _.Utf8ToUtf32,this._workCell=new l.CellData,this._windowTitle="",this._iconName="",this._windowTitleStack=[],this._iconNameStack=[],this._curAttrData=c.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=c.DEFAULT_ATTR_DATA.clone(),this._onRequestBell=this.register(new o.EventEmitter),this.onRequestBell=this._onRequestBell.event,this._onRequestRefreshRows=this.register(new o.EventEmitter),this.onRequestRefreshRows=this._onRequestRefreshRows.event,this._onRequestReset=this.register(new o.EventEmitter),this.onRequestReset=this._onRequestReset.event,this._onRequestSendFocus=this.register(new o.EventEmitter),this.onRequestSendFocus=this._onRequestSendFocus.event,this._onRequestSyncScrollBar=this.register(new o.EventEmitter),this.onRequestSyncScrollBar=this._onRequestSyncScrollBar.event,this._onRequestWindowsOptionsReport=this.register(new o.EventEmitter),this.onRequestWindowsOptionsReport=this._onRequestWindowsOptionsReport.event,this._onA11yChar=this.register(new o.EventEmitter),this.onA11yChar=this._onA11yChar.event,this._onA11yTab=this.register(new o.EventEmitter),this.onA11yTab=this._onA11yTab.event,this._onCursorMove=this.register(new o.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onLineFeed=this.register(new o.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onScroll=this.register(new o.EventEmitter),this.onScroll=this._onScroll.event,this._onTitleChange=this.register(new o.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onColor=this.register(new o.EventEmitter),this.onColor=this._onColor.event,this._parseStack={paused:!1,cursorStartX:0,cursorStartY:0,decodedLength:0,position:0},this._specialColors=[256,257,258],this.register(this._parser),this._dirtyRowTracker=new K(this._bufferService),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate(L=>this._activeBuffer=L.activeBuffer)),this._parser.setCsiHandlerFallback((L,U)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString(L),params:U.toArray()})}),this._parser.setEscHandlerFallback(L=>{this._logService.debug("Unknown ESC code: ",{identifier:this._parser.identToString(L)})}),this._parser.setExecuteHandlerFallback(L=>{this._logService.debug("Unknown EXECUTE code: ",{code:L})}),this._parser.setOscHandlerFallback((L,U,H)=>{this._logService.debug("Unknown OSC code: ",{identifier:L,action:U,data:H})}),this._parser.setDcsHandlerFallback((L,U,H)=>{U==="HOOK"&&(H=H.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(L),action:U,payload:H})}),this._parser.setPrintHandler((L,U,H)=>this.print(L,U,H)),this._parser.registerCsiHandler({final:"@"},L=>this.insertChars(L)),this._parser.registerCsiHandler({intermediates:" ",final:"@"},L=>this.scrollLeft(L)),this._parser.registerCsiHandler({final:"A"},L=>this.cursorUp(L)),this._parser.registerCsiHandler({intermediates:" ",final:"A"},L=>this.scrollRight(L)),this._parser.registerCsiHandler({final:"B"},L=>this.cursorDown(L)),this._parser.registerCsiHandler({final:"C"},L=>this.cursorForward(L)),this._parser.registerCsiHandler({final:"D"},L=>this.cursorBackward(L)),this._parser.registerCsiHandler({final:"E"},L=>this.cursorNextLine(L)),this._parser.registerCsiHandler({final:"F"},L=>this.cursorPrecedingLine(L)),this._parser.registerCsiHandler({final:"G"},L=>this.cursorCharAbsolute(L)),this._parser.registerCsiHandler({final:"H"},L=>this.cursorPosition(L)),this._parser.registerCsiHandler({final:"I"},L=>this.cursorForwardTab(L)),this._parser.registerCsiHandler({final:"J"},L=>this.eraseInDisplay(L,!1)),this._parser.registerCsiHandler({prefix:"?",final:"J"},L=>this.eraseInDisplay(L,!0)),this._parser.registerCsiHandler({final:"K"},L=>this.eraseInLine(L,!1)),this._parser.registerCsiHandler({prefix:"?",final:"K"},L=>this.eraseInLine(L,!0)),this._parser.registerCsiHandler({final:"L"},L=>this.insertLines(L)),this._parser.registerCsiHandler({final:"M"},L=>this.deleteLines(L)),this._parser.registerCsiHandler({final:"P"},L=>this.deleteChars(L)),this._parser.registerCsiHandler({final:"S"},L=>this.scrollUp(L)),this._parser.registerCsiHandler({final:"T"},L=>this.scrollDown(L)),this._parser.registerCsiHandler({final:"X"},L=>this.eraseChars(L)),this._parser.registerCsiHandler({final:"Z"},L=>this.cursorBackwardTab(L)),this._parser.registerCsiHandler({final:"`"},L=>this.charPosAbsolute(L)),this._parser.registerCsiHandler({final:"a"},L=>this.hPositionRelative(L)),this._parser.registerCsiHandler({final:"b"},L=>this.repeatPrecedingCharacter(L)),this._parser.registerCsiHandler({final:"c"},L=>this.sendDeviceAttributesPrimary(L)),this._parser.registerCsiHandler({prefix:">",final:"c"},L=>this.sendDeviceAttributesSecondary(L)),this._parser.registerCsiHandler({final:"d"},L=>this.linePosAbsolute(L)),this._parser.registerCsiHandler({final:"e"},L=>this.vPositionRelative(L)),this._parser.registerCsiHandler({final:"f"},L=>this.hVPosition(L)),this._parser.registerCsiHandler({final:"g"},L=>this.tabClear(L)),this._parser.registerCsiHandler({final:"h"},L=>this.setMode(L)),this._parser.registerCsiHandler({prefix:"?",final:"h"},L=>this.setModePrivate(L)),this._parser.registerCsiHandler({final:"l"},L=>this.resetMode(L)),this._parser.registerCsiHandler({prefix:"?",final:"l"},L=>this.resetModePrivate(L)),this._parser.registerCsiHandler({final:"m"},L=>this.charAttributes(L)),this._parser.registerCsiHandler({final:"n"},L=>this.deviceStatus(L)),this._parser.registerCsiHandler({prefix:"?",final:"n"},L=>this.deviceStatusPrivate(L)),this._parser.registerCsiHandler({intermediates:"!",final:"p"},L=>this.softReset(L)),this._parser.registerCsiHandler({intermediates:" ",final:"q"},L=>this.setCursorStyle(L)),this._parser.registerCsiHandler({final:"r"},L=>this.setScrollRegion(L)),this._parser.registerCsiHandler({final:"s"},L=>this.saveCursor(L)),this._parser.registerCsiHandler({final:"t"},L=>this.windowOptions(L)),this._parser.registerCsiHandler({final:"u"},L=>this.restoreCursor(L)),this._parser.registerCsiHandler({intermediates:"'",final:"}"},L=>this.insertColumns(L)),this._parser.registerCsiHandler({intermediates:"'",final:"~"},L=>this.deleteColumns(L)),this._parser.registerCsiHandler({intermediates:'"',final:"q"},L=>this.selectProtected(L)),this._parser.registerCsiHandler({intermediates:"$",final:"p"},L=>this.requestMode(L,!0)),this._parser.registerCsiHandler({prefix:"?",intermediates:"$",final:"p"},L=>this.requestMode(L,!1)),this._parser.setExecuteHandler(d.C0.BEL,()=>this.bell()),this._parser.setExecuteHandler(d.C0.LF,()=>this.lineFeed()),this._parser.setExecuteHandler(d.C0.VT,()=>this.lineFeed()),this._parser.setExecuteHandler(d.C0.FF,()=>this.lineFeed()),this._parser.setExecuteHandler(d.C0.CR,()=>this.carriageReturn()),this._parser.setExecuteHandler(d.C0.BS,()=>this.backspace()),this._parser.setExecuteHandler(d.C0.HT,()=>this.tab()),this._parser.setExecuteHandler(d.C0.SO,()=>this.shiftOut()),this._parser.setExecuteHandler(d.C0.SI,()=>this.shiftIn()),this._parser.setExecuteHandler(d.C1.IND,()=>this.index()),this._parser.setExecuteHandler(d.C1.NEL,()=>this.nextLine()),this._parser.setExecuteHandler(d.C1.HTS,()=>this.tabSet()),this._parser.registerOscHandler(0,new k.OscHandler(L=>(this.setTitle(L),this.setIconName(L),!0))),this._parser.registerOscHandler(1,new k.OscHandler(L=>this.setIconName(L))),this._parser.registerOscHandler(2,new k.OscHandler(L=>this.setTitle(L))),this._parser.registerOscHandler(4,new k.OscHandler(L=>this.setOrReportIndexedColor(L))),this._parser.registerOscHandler(8,new k.OscHandler(L=>this.setHyperlink(L))),this._parser.registerOscHandler(10,new k.OscHandler(L=>this.setOrReportFgColor(L))),this._parser.registerOscHandler(11,new k.OscHandler(L=>this.setOrReportBgColor(L))),this._parser.registerOscHandler(12,new k.OscHandler(L=>this.setOrReportCursorColor(L))),this._parser.registerOscHandler(104,new k.OscHandler(L=>this.restoreIndexedColor(L))),this._parser.registerOscHandler(110,new k.OscHandler(L=>this.restoreFgColor(L))),this._parser.registerOscHandler(111,new k.OscHandler(L=>this.restoreBgColor(L))),this._parser.registerOscHandler(112,new k.OscHandler(L=>this.restoreCursorColor(L))),this._parser.registerEscHandler({final:"7"},()=>this.saveCursor()),this._parser.registerEscHandler({final:"8"},()=>this.restoreCursor()),this._parser.registerEscHandler({final:"D"},()=>this.index()),this._parser.registerEscHandler({final:"E"},()=>this.nextLine()),this._parser.registerEscHandler({final:"H"},()=>this.tabSet()),this._parser.registerEscHandler({final:"M"},()=>this.reverseIndex()),this._parser.registerEscHandler({final:"="},()=>this.keypadApplicationMode()),this._parser.registerEscHandler({final:">"},()=>this.keypadNumericMode()),this._parser.registerEscHandler({final:"c"},()=>this.fullReset()),this._parser.registerEscHandler({final:"n"},()=>this.setgLevel(2)),this._parser.registerEscHandler({final:"o"},()=>this.setgLevel(3)),this._parser.registerEscHandler({final:"|"},()=>this.setgLevel(3)),this._parser.registerEscHandler({final:"}"},()=>this.setgLevel(2)),this._parser.registerEscHandler({final:"~"},()=>this.setgLevel(1)),this._parser.registerEscHandler({intermediates:"%",final:"@"},()=>this.selectDefaultCharset()),this._parser.registerEscHandler({intermediates:"%",final:"G"},()=>this.selectDefaultCharset());for(const L in p.CHARSETS)this._parser.registerEscHandler({intermediates:"(",final:L},()=>this.selectCharset("("+L)),this._parser.registerEscHandler({intermediates:")",final:L},()=>this.selectCharset(")"+L)),this._parser.registerEscHandler({intermediates:"*",final:L},()=>this.selectCharset("*"+L)),this._parser.registerEscHandler({intermediates:"+",final:L},()=>this.selectCharset("+"+L)),this._parser.registerEscHandler({intermediates:"-",final:L},()=>this.selectCharset("-"+L)),this._parser.registerEscHandler({intermediates:".",final:L},()=>this.selectCharset("."+L)),this._parser.registerEscHandler({intermediates:"/",final:L},()=>this.selectCharset("/"+L));this._parser.registerEscHandler({intermediates:"#",final:"8"},()=>this.screenAlignmentPattern()),this._parser.setErrorHandler(L=>(this._logService.error("Parsing error: ",L),L)),this._parser.registerDcsHandler({intermediates:"$",final:"q"},new y.DcsHandler((L,U)=>this.requestStatusString(L,U)))}_preserveStack(E,D,P,O){this._parseStack.paused=!0,this._parseStack.cursorStartX=E,this._parseStack.cursorStartY=D,this._parseStack.decodedLength=P,this._parseStack.position=O}_logSlowResolvingAsync(E){this._logService.logLevel<=C.LogLevelEnum.WARN&&Promise.race([E,new Promise((D,P)=>setTimeout(()=>P("#SLOW_TIMEOUT"),5e3))]).catch(D=>{if(D!=="#SLOW_TIMEOUT")throw D;console.warn("async parser handler taking longer than 5000 ms")})}_getCurrentLinkId(){return this._curAttrData.extended.urlId}parse(E,D){let P,O=this._activeBuffer.x,W=this._activeBuffer.y,V=0;const J=this._parseStack.paused;if(J){if(P=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,D))return this._logSlowResolvingAsync(P),P;O=this._parseStack.cursorStartX,W=this._parseStack.cursorStartY,this._parseStack.paused=!1,E.length>M&&(V=this._parseStack.position+M)}if(this._logService.logLevel<=C.LogLevelEnum.DEBUG&&this._logService.debug("parsing data"+(typeof E=="string"?` "${E}"`:` "${Array.prototype.map.call(E,L=>String.fromCharCode(L)).join("")}"`),typeof E=="string"?E.split("").map(L=>L.charCodeAt(0)):E),this._parseBuffer.length<E.length&&this._parseBuffer.length<M&&(this._parseBuffer=new Uint32Array(Math.min(E.length,M))),J||this._dirtyRowTracker.clearRange(),E.length>M)for(let L=V;L<E.length;L+=M){const U=L+M<E.length?L+M:E.length,H=typeof E=="string"?this._stringDecoder.decode(E.substring(L,U),this._parseBuffer):this._utf8Decoder.decode(E.subarray(L,U),this._parseBuffer);if(P=this._parser.parse(this._parseBuffer,H))return this._preserveStack(O,W,H,L),this._logSlowResolvingAsync(P),P}else if(!J){const L=typeof E=="string"?this._stringDecoder.decode(E,this._parseBuffer):this._utf8Decoder.decode(E,this._parseBuffer);if(P=this._parser.parse(this._parseBuffer,L))return this._preserveStack(O,W,L,0),this._logSlowResolvingAsync(P),P}this._activeBuffer.x===O&&this._activeBuffer.y===W||this._onCursorMove.fire();const Z=this._dirtyRowTracker.end+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp),I=this._dirtyRowTracker.start+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp);I<this._bufferService.rows&&this._onRequestRefreshRows.fire(Math.min(I,this._bufferService.rows-1),Math.min(Z,this._bufferService.rows-1))}print(E,D,P){let O,W;const V=this._charsetService.charset,J=this._optionsService.rawOptions.screenReaderMode,Z=this._bufferService.cols,I=this._coreService.decPrivateModes.wraparound,L=this._coreService.modes.insertMode,U=this._curAttrData;let H=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._activeBuffer.x&&P-D>0&&H.getWidth(this._activeBuffer.x-1)===2&&H.setCellFromCodepoint(this._activeBuffer.x-1,0,1,U);let X=this._parser.precedingJoinState;for(let G=D;G<P;++G){if(O=E[G],O<127&&V){const ne=V[String.fromCharCode(O)];ne&&(O=ne.charCodeAt(0))}const se=this._unicodeService.charProperties(O,X);W=x.UnicodeService.extractWidth(se);const z=x.UnicodeService.extractShouldJoin(se),te=z?x.UnicodeService.extractWidth(X):0;if(X=se,J&&this._onA11yChar.fire((0,_.stringFromCodePoint)(O)),this._getCurrentLinkId()&&this._oscLinkService.addLineToLink(this._getCurrentLinkId(),this._activeBuffer.ybase+this._activeBuffer.y),this._activeBuffer.x+W-te>Z){if(I){const ne=H;let ee=this._activeBuffer.x-te;for(this._activeBuffer.x=te,this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData(),!0)):(this._activeBuffer.y>=this._bufferService.rows&&(this._activeBuffer.y=this._bufferService.rows-1),this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!0),H=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y),te>0&&H instanceof c.BufferLine&&H.copyCellsFrom(ne,ee,0,te,!1);ee<Z;)ne.setCellFromCodepoint(ee++,0,1,U)}else if(this._activeBuffer.x=Z-1,W===2)continue}if(z&&this._activeBuffer.x){const ne=H.getWidth(this._activeBuffer.x-1)?1:2;H.addCodepointToCell(this._activeBuffer.x-ne,O,W);for(let ee=W-te;--ee>=0;)H.setCellFromCodepoint(this._activeBuffer.x++,0,0,U)}else if(L&&(H.insertCells(this._activeBuffer.x,W-te,this._activeBuffer.getNullCell(U)),H.getWidth(Z-1)===2&&H.setCellFromCodepoint(Z-1,s.NULL_CELL_CODE,s.NULL_CELL_WIDTH,U)),H.setCellFromCodepoint(this._activeBuffer.x++,O,W,U),W>0)for(;--W;)H.setCellFromCodepoint(this._activeBuffer.x++,0,0,U)}this._parser.precedingJoinState=X,this._activeBuffer.x<Z&&P-D>0&&H.getWidth(this._activeBuffer.x)===0&&!H.hasContent(this._activeBuffer.x)&&H.setCellFromCodepoint(this._activeBuffer.x,0,1,U),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler(E,D){return E.final!=="t"||E.prefix||E.intermediates?this._parser.registerCsiHandler(E,D):this._parser.registerCsiHandler(E,P=>!B(P.params[0],this._optionsService.rawOptions.windowOptions)||D(P))}registerDcsHandler(E,D){return this._parser.registerDcsHandler(E,new y.DcsHandler(D))}registerEscHandler(E,D){return this._parser.registerEscHandler(E,D)}registerOscHandler(E,D){return this._parser.registerOscHandler(E,new k.OscHandler(D))}bell(){return this._onRequestBell.fire(),!0}lineFeed(){return this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._optionsService.rawOptions.convertEol&&(this._activeBuffer.x=0),this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData())):this._activeBuffer.y>=this._bufferService.rows?this._activeBuffer.y=this._bufferService.rows-1:this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.x>=this._bufferService.cols&&this._activeBuffer.x--,this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._onLineFeed.fire(),!0}carriageReturn(){return this._activeBuffer.x=0,!0}backspace(){var E;if(!this._coreService.decPrivateModes.reverseWraparound)return this._restrictCursor(),this._activeBuffer.x>0&&this._activeBuffer.x--,!0;if(this._restrictCursor(this._bufferService.cols),this._activeBuffer.x>0)this._activeBuffer.x--;else if(this._activeBuffer.x===0&&this._activeBuffer.y>this._activeBuffer.scrollTop&&this._activeBuffer.y<=this._activeBuffer.scrollBottom&&((E=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y))!=null&&E.isWrapped)){this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.y--,this._activeBuffer.x=this._bufferService.cols-1;const D=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);D.hasWidth(this._activeBuffer.x)&&!D.hasContent(this._activeBuffer.x)&&this._activeBuffer.x--}return this._restrictCursor(),!0}tab(){if(this._activeBuffer.x>=this._bufferService.cols)return!0;const E=this._activeBuffer.x;return this._activeBuffer.x=this._activeBuffer.nextStop(),this._optionsService.rawOptions.screenReaderMode&&this._onA11yTab.fire(this._activeBuffer.x-E),!0}shiftOut(){return this._charsetService.setgLevel(1),!0}shiftIn(){return this._charsetService.setgLevel(0),!0}_restrictCursor(E=this._bufferService.cols-1){this._activeBuffer.x=Math.min(E,Math.max(0,this._activeBuffer.x)),this._activeBuffer.y=this._coreService.decPrivateModes.origin?Math.min(this._activeBuffer.scrollBottom,Math.max(this._activeBuffer.scrollTop,this._activeBuffer.y)):Math.min(this._bufferService.rows-1,Math.max(0,this._activeBuffer.y)),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_setCursor(E,D){this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=E,this._activeBuffer.y=this._activeBuffer.scrollTop+D):(this._activeBuffer.x=E,this._activeBuffer.y=D),this._restrictCursor(),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_moveCursor(E,D){this._restrictCursor(),this._setCursor(this._activeBuffer.x+E,this._activeBuffer.y+D)}cursorUp(E){const D=this._activeBuffer.y-this._activeBuffer.scrollTop;return D>=0?this._moveCursor(0,-Math.min(D,E.params[0]||1)):this._moveCursor(0,-(E.params[0]||1)),!0}cursorDown(E){const D=this._activeBuffer.scrollBottom-this._activeBuffer.y;return D>=0?this._moveCursor(0,Math.min(D,E.params[0]||1)):this._moveCursor(0,E.params[0]||1),!0}cursorForward(E){return this._moveCursor(E.params[0]||1,0),!0}cursorBackward(E){return this._moveCursor(-(E.params[0]||1),0),!0}cursorNextLine(E){return this.cursorDown(E),this._activeBuffer.x=0,!0}cursorPrecedingLine(E){return this.cursorUp(E),this._activeBuffer.x=0,!0}cursorCharAbsolute(E){return this._setCursor((E.params[0]||1)-1,this._activeBuffer.y),!0}cursorPosition(E){return this._setCursor(E.length>=2?(E.params[1]||1)-1:0,(E.params[0]||1)-1),!0}charPosAbsolute(E){return this._setCursor((E.params[0]||1)-1,this._activeBuffer.y),!0}hPositionRelative(E){return this._moveCursor(E.params[0]||1,0),!0}linePosAbsolute(E){return this._setCursor(this._activeBuffer.x,(E.params[0]||1)-1),!0}vPositionRelative(E){return this._moveCursor(0,E.params[0]||1),!0}hVPosition(E){return this.cursorPosition(E),!0}tabClear(E){const D=E.params[0];return D===0?delete this._activeBuffer.tabs[this._activeBuffer.x]:D===3&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(E){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let D=E.params[0]||1;for(;D--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0}cursorBackwardTab(E){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let D=E.params[0]||1;for(;D--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0}selectProtected(E){const D=E.params[0];return D===1&&(this._curAttrData.bg|=536870912),D!==2&&D!==0||(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine(E,D,P,O=!1,W=!1){const V=this._activeBuffer.lines.get(this._activeBuffer.ybase+E);V.replaceCells(D,P,this._activeBuffer.getNullCell(this._eraseAttrData()),W),O&&(V.isWrapped=!1)}_resetBufferLine(E,D=!1){const P=this._activeBuffer.lines.get(this._activeBuffer.ybase+E);P&&(P.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),D),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+E),P.isWrapped=!1)}eraseInDisplay(E,D=!1){let P;switch(this._restrictCursor(this._bufferService.cols),E.params[0]){case 0:for(P=this._activeBuffer.y,this._dirtyRowTracker.markDirty(P),this._eraseInBufferLine(P++,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,D);P<this._bufferService.rows;P++)this._resetBufferLine(P,D);this._dirtyRowTracker.markDirty(P);break;case 1:for(P=this._activeBuffer.y,this._dirtyRowTracker.markDirty(P),this._eraseInBufferLine(P,0,this._activeBuffer.x+1,!0,D),this._activeBuffer.x+1>=this._bufferService.cols&&(this._activeBuffer.lines.get(P+1).isWrapped=!1);P--;)this._resetBufferLine(P,D);this._dirtyRowTracker.markDirty(0);break;case 2:for(P=this._bufferService.rows,this._dirtyRowTracker.markDirty(P-1);P--;)this._resetBufferLine(P,D);this._dirtyRowTracker.markDirty(0);break;case 3:const O=this._activeBuffer.lines.length-this._bufferService.rows;O>0&&(this._activeBuffer.lines.trimStart(O),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-O,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-O,0),this._onScroll.fire(0))}return!0}eraseInLine(E,D=!1){switch(this._restrictCursor(this._bufferService.cols),E.params[0]){case 0:this._eraseInBufferLine(this._activeBuffer.y,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,D);break;case 1:this._eraseInBufferLine(this._activeBuffer.y,0,this._activeBuffer.x+1,!1,D);break;case 2:this._eraseInBufferLine(this._activeBuffer.y,0,this._bufferService.cols,!0,D)}return this._dirtyRowTracker.markDirty(this._activeBuffer.y),!0}insertLines(E){this._restrictCursor();let D=E.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const P=this._activeBuffer.ybase+this._activeBuffer.y,O=this._bufferService.rows-1-this._activeBuffer.scrollBottom,W=this._bufferService.rows-1+this._activeBuffer.ybase-O+1;for(;D--;)this._activeBuffer.lines.splice(W-1,1),this._activeBuffer.lines.splice(P,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}deleteLines(E){this._restrictCursor();let D=E.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const P=this._activeBuffer.ybase+this._activeBuffer.y;let O;for(O=this._bufferService.rows-1-this._activeBuffer.scrollBottom,O=this._bufferService.rows-1+this._activeBuffer.ybase-O;D--;)this._activeBuffer.lines.splice(P,1),this._activeBuffer.lines.splice(O,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}insertChars(E){this._restrictCursor();const D=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return D&&(D.insertCells(this._activeBuffer.x,E.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}deleteChars(E){this._restrictCursor();const D=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return D&&(D.deleteCells(this._activeBuffer.x,E.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}scrollUp(E){let D=E.params[0]||1;for(;D--;)this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollTop,1),this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollBottom,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollDown(E){let D=E.params[0]||1;for(;D--;)this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollBottom,1),this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollTop,0,this._activeBuffer.getBlankLine(c.DEFAULT_ATTR_DATA));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollLeft(E){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const D=E.params[0]||1;for(let P=this._activeBuffer.scrollTop;P<=this._activeBuffer.scrollBottom;++P){const O=this._activeBuffer.lines.get(this._activeBuffer.ybase+P);O.deleteCells(0,D,this._activeBuffer.getNullCell(this._eraseAttrData())),O.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollRight(E){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const D=E.params[0]||1;for(let P=this._activeBuffer.scrollTop;P<=this._activeBuffer.scrollBottom;++P){const O=this._activeBuffer.lines.get(this._activeBuffer.ybase+P);O.insertCells(0,D,this._activeBuffer.getNullCell(this._eraseAttrData())),O.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}insertColumns(E){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const D=E.params[0]||1;for(let P=this._activeBuffer.scrollTop;P<=this._activeBuffer.scrollBottom;++P){const O=this._activeBuffer.lines.get(this._activeBuffer.ybase+P);O.insertCells(this._activeBuffer.x,D,this._activeBuffer.getNullCell(this._eraseAttrData())),O.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}deleteColumns(E){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const D=E.params[0]||1;for(let P=this._activeBuffer.scrollTop;P<=this._activeBuffer.scrollBottom;++P){const O=this._activeBuffer.lines.get(this._activeBuffer.ybase+P);O.deleteCells(this._activeBuffer.x,D,this._activeBuffer.getNullCell(this._eraseAttrData())),O.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}eraseChars(E){this._restrictCursor();const D=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return D&&(D.replaceCells(this._activeBuffer.x,this._activeBuffer.x+(E.params[0]||1),this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}repeatPrecedingCharacter(E){const D=this._parser.precedingJoinState;if(!D)return!0;const P=E.params[0]||1,O=x.UnicodeService.extractWidth(D),W=this._activeBuffer.x-O,V=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).getString(W),J=new Uint32Array(V.length*P);let Z=0;for(let L=0;L<V.length;){const U=V.codePointAt(L)||0;J[Z++]=U,L+=U>65535?2:1}let I=Z;for(let L=1;L<P;++L)J.copyWithin(I,0,Z),I+=Z;return this.print(J,0,I),!0}sendDeviceAttributesPrimary(E){return E.params[0]>0||(this._is("xterm")||this._is("rxvt-unicode")||this._is("screen")?this._coreService.triggerDataEvent(d.C0.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(d.C0.ESC+"[?6c")),!0}sendDeviceAttributesSecondary(E){return E.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(d.C0.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(d.C0.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(E.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(d.C0.ESC+"[>83;40003;0c")),!0}_is(E){return(this._optionsService.rawOptions.termName+"").indexOf(E)===0}setMode(E){for(let D=0;D<E.length;D++)switch(E.params[D]){case 4:this._coreService.modes.insertMode=!0;break;case 20:this._optionsService.options.convertEol=!0}return!0}setModePrivate(E){for(let D=0;D<E.length;D++)switch(E.params[D]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!0;break;case 2:this._charsetService.setgCharset(0,p.DEFAULT_CHARSET),this._charsetService.setgCharset(1,p.DEFAULT_CHARSET),this._charsetService.setgCharset(2,p.DEFAULT_CHARSET),this._charsetService.setgCharset(3,p.DEFAULT_CHARSET);break;case 3:this._optionsService.rawOptions.windowOptions.setWinLines&&(this._bufferService.resize(132,this._bufferService.rows),this._onRequestReset.fire());break;case 6:this._coreService.decPrivateModes.origin=!0,this._setCursor(0,0);break;case 7:this._coreService.decPrivateModes.wraparound=!0;break;case 12:this._optionsService.options.cursorBlink=!0;break;case 45:this._coreService.decPrivateModes.reverseWraparound=!0;break;case 66:this._logService.debug("Serial port requested application keypad."),this._coreService.decPrivateModes.applicationKeypad=!0,this._onRequestSyncScrollBar.fire();break;case 9:this._coreMouseService.activeProtocol="X10";break;case 1e3:this._coreMouseService.activeProtocol="VT200";break;case 1002:this._coreMouseService.activeProtocol="DRAG";break;case 1003:this._coreMouseService.activeProtocol="ANY";break;case 1004:this._coreService.decPrivateModes.sendFocus=!0,this._onRequestSendFocus.fire();break;case 1005:this._logService.debug("DECSET 1005 not supported (see #2507)");break;case 1006:this._coreMouseService.activeEncoding="SGR";break;case 1015:this._logService.debug("DECSET 1015 not supported (see #2507)");break;case 1016:this._coreMouseService.activeEncoding="SGR_PIXELS";break;case 25:this._coreService.isCursorHidden=!1;break;case 1048:this.saveCursor();break;case 1049:this.saveCursor();case 47:case 1047:this._bufferService.buffers.activateAltBuffer(this._eraseAttrData()),this._coreService.isCursorInitialized=!0,this._onRequestRefreshRows.fire(0,this._bufferService.rows-1),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!0}return!0}resetMode(E){for(let D=0;D<E.length;D++)switch(E.params[D]){case 4:this._coreService.modes.insertMode=!1;break;case 20:this._optionsService.options.convertEol=!1}return!0}resetModePrivate(E){for(let D=0;D<E.length;D++)switch(E.params[D]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!1;break;case 3:this._optionsService.rawOptions.windowOptions.setWinLines&&(this._bufferService.resize(80,this._bufferService.rows),this._onRequestReset.fire());break;case 6:this._coreService.decPrivateModes.origin=!1,this._setCursor(0,0);break;case 7:this._coreService.decPrivateModes.wraparound=!1;break;case 12:this._optionsService.options.cursorBlink=!1;break;case 45:this._coreService.decPrivateModes.reverseWraparound=!1;break;case 66:this._logService.debug("Switching back to normal keypad."),this._coreService.decPrivateModes.applicationKeypad=!1,this._onRequestSyncScrollBar.fire();break;case 9:case 1e3:case 1002:case 1003:this._coreMouseService.activeProtocol="NONE";break;case 1004:this._coreService.decPrivateModes.sendFocus=!1;break;case 1005:this._logService.debug("DECRST 1005 not supported (see #2507)");break;case 1006:case 1016:this._coreMouseService.activeEncoding="DEFAULT";break;case 1015:this._logService.debug("DECRST 1015 not supported (see #2507)");break;case 25:this._coreService.isCursorHidden=!0;break;case 1048:this.restoreCursor();break;case 1049:case 47:case 1047:this._bufferService.buffers.activateNormalBuffer(),E.params[D]===1049&&this.restoreCursor(),this._coreService.isCursorInitialized=!0,this._onRequestRefreshRows.fire(0,this._bufferService.rows-1),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!1}return!0}requestMode(E,D){const P=this._coreService.decPrivateModes,{activeProtocol:O,activeEncoding:W}=this._coreMouseService,V=this._coreService,{buffers:J,cols:Z}=this._bufferService,{active:I,alt:L}=J,U=this._optionsService.rawOptions,H=z=>z?1:2,X=E.params[0];return G=X,se=D?X===2?4:X===4?H(V.modes.insertMode):X===12?3:X===20?H(U.convertEol):0:X===1?H(P.applicationCursorKeys):X===3?U.windowOptions.setWinLines?Z===80?2:Z===132?1:0:0:X===6?H(P.origin):X===7?H(P.wraparound):X===8?3:X===9?H(O==="X10"):X===12?H(U.cursorBlink):X===25?H(!V.isCursorHidden):X===45?H(P.reverseWraparound):X===66?H(P.applicationKeypad):X===67?4:X===1e3?H(O==="VT200"):X===1002?H(O==="DRAG"):X===1003?H(O==="ANY"):X===1004?H(P.sendFocus):X===1005?4:X===1006?H(W==="SGR"):X===1015?4:X===1016?H(W==="SGR_PIXELS"):X===1048?1:X===47||X===1047||X===1049?H(I===L):X===2004?H(P.bracketedPasteMode):0,V.triggerDataEvent(`${d.C0.ESC}[${D?"":"?"}${G};${se}$y`),!0;var G,se}_updateAttrColor(E,D,P,O,W){return D===2?(E|=50331648,E&=-16777216,E|=v.AttributeData.fromColorRGB([P,O,W])):D===5&&(E&=-50331904,E|=33554432|255&P),E}_extractColor(E,D,P){const O=[0,0,-1,0,0,0];let W=0,V=0;do{if(O[V+W]=E.params[D+V],E.hasSubParams(D+V)){const J=E.getSubParams(D+V);let Z=0;do O[1]===5&&(W=1),O[V+Z+1+W]=J[Z];while(++Z<J.length&&Z+V+1+W<O.length);break}if(O[1]===5&&V+W>=2||O[1]===2&&V+W>=5)break;O[1]&&(W=1)}while(++V+D<E.length&&V+W<O.length);for(let J=2;J<O.length;++J)O[J]===-1&&(O[J]=0);switch(O[0]){case 38:P.fg=this._updateAttrColor(P.fg,O[1],O[3],O[4],O[5]);break;case 48:P.bg=this._updateAttrColor(P.bg,O[1],O[3],O[4],O[5]);break;case 58:P.extended=P.extended.clone(),P.extended.underlineColor=this._updateAttrColor(P.extended.underlineColor,O[1],O[3],O[4],O[5])}return V}_processUnderline(E,D){D.extended=D.extended.clone(),(!~E||E>5)&&(E=1),D.extended.underlineStyle=E,D.fg|=268435456,E===0&&(D.fg&=-268435457),D.updateExtended()}_processSGR0(E){E.fg=c.DEFAULT_ATTR_DATA.fg,E.bg=c.DEFAULT_ATTR_DATA.bg,E.extended=E.extended.clone(),E.extended.underlineStyle=0,E.extended.underlineColor&=-67108864,E.updateExtended()}charAttributes(E){if(E.length===1&&E.params[0]===0)return this._processSGR0(this._curAttrData),!0;const D=E.length;let P;const O=this._curAttrData;for(let W=0;W<D;W++)P=E.params[W],P>=30&&P<=37?(O.fg&=-50331904,O.fg|=16777216|P-30):P>=40&&P<=47?(O.bg&=-50331904,O.bg|=16777216|P-40):P>=90&&P<=97?(O.fg&=-50331904,O.fg|=16777224|P-90):P>=100&&P<=107?(O.bg&=-50331904,O.bg|=16777224|P-100):P===0?this._processSGR0(O):P===1?O.fg|=134217728:P===3?O.bg|=67108864:P===4?(O.fg|=268435456,this._processUnderline(E.hasSubParams(W)?E.getSubParams(W)[0]:1,O)):P===5?O.fg|=536870912:P===7?O.fg|=67108864:P===8?O.fg|=1073741824:P===9?O.fg|=2147483648:P===2?O.bg|=134217728:P===21?this._processUnderline(2,O):P===22?(O.fg&=-134217729,O.bg&=-134217729):P===23?O.bg&=-67108865:P===24?(O.fg&=-268435457,this._processUnderline(0,O)):P===25?O.fg&=-536870913:P===27?O.fg&=-67108865:P===28?O.fg&=-1073741825:P===29?O.fg&=2147483647:P===39?(O.fg&=-67108864,O.fg|=16777215&c.DEFAULT_ATTR_DATA.fg):P===49?(O.bg&=-67108864,O.bg|=16777215&c.DEFAULT_ATTR_DATA.bg):P===38||P===48||P===58?W+=this._extractColor(E,W,O):P===53?O.bg|=1073741824:P===55?O.bg&=-1073741825:P===59?(O.extended=O.extended.clone(),O.extended.underlineColor=-1,O.updateExtended()):P===100?(O.fg&=-67108864,O.fg|=16777215&c.DEFAULT_ATTR_DATA.fg,O.bg&=-67108864,O.bg|=16777215&c.DEFAULT_ATTR_DATA.bg):this._logService.debug("Unknown SGR attribute: %d.",P);return!0}deviceStatus(E){switch(E.params[0]){case 5:this._coreService.triggerDataEvent(`${d.C0.ESC}[0n`);break;case 6:const D=this._activeBuffer.y+1,P=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${d.C0.ESC}[${D};${P}R`)}return!0}deviceStatusPrivate(E){if(E.params[0]===6){const D=this._activeBuffer.y+1,P=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${d.C0.ESC}[?${D};${P}R`)}return!0}softReset(E){return this._coreService.isCursorHidden=!1,this._onRequestSyncScrollBar.fire(),this._activeBuffer.scrollTop=0,this._activeBuffer.scrollBottom=this._bufferService.rows-1,this._curAttrData=c.DEFAULT_ATTR_DATA.clone(),this._coreService.reset(),this._charsetService.reset(),this._activeBuffer.savedX=0,this._activeBuffer.savedY=this._activeBuffer.ybase,this._activeBuffer.savedCurAttrData.fg=this._curAttrData.fg,this._activeBuffer.savedCurAttrData.bg=this._curAttrData.bg,this._activeBuffer.savedCharset=this._charsetService.charset,this._coreService.decPrivateModes.origin=!1,!0}setCursorStyle(E){const D=E.params[0]||1;switch(D){case 1:case 2:this._optionsService.options.cursorStyle="block";break;case 3:case 4:this._optionsService.options.cursorStyle="underline";break;case 5:case 6:this._optionsService.options.cursorStyle="bar"}const P=D%2==1;return this._optionsService.options.cursorBlink=P,!0}setScrollRegion(E){const D=E.params[0]||1;let P;return(E.length<2||(P=E.params[1])>this._bufferService.rows||P===0)&&(P=this._bufferService.rows),P>D&&(this._activeBuffer.scrollTop=D-1,this._activeBuffer.scrollBottom=P-1,this._setCursor(0,0)),!0}windowOptions(E){if(!B(E.params[0],this._optionsService.rawOptions.windowOptions))return!0;const D=E.length>1?E.params[1]:0;switch(E.params[0]){case 14:D!==2&&this._onRequestWindowsOptionsReport.fire(T.GET_WIN_SIZE_PIXELS);break;case 16:this._onRequestWindowsOptionsReport.fire(T.GET_CELL_SIZE_PIXELS);break;case 18:this._bufferService&&this._coreService.triggerDataEvent(`${d.C0.ESC}[8;${this._bufferService.rows};${this._bufferService.cols}t`);break;case 22:D!==0&&D!==2||(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>10&&this._windowTitleStack.shift()),D!==0&&D!==1||(this._iconNameStack.push(this._iconName),this._iconNameStack.length>10&&this._iconNameStack.shift());break;case 23:D!==0&&D!==2||this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),D!==0&&D!==1||this._iconNameStack.length&&this.setIconName(this._iconNameStack.pop())}return!0}saveCursor(E){return this._activeBuffer.savedX=this._activeBuffer.x,this._activeBuffer.savedY=this._activeBuffer.ybase+this._activeBuffer.y,this._activeBuffer.savedCurAttrData.fg=this._curAttrData.fg,this._activeBuffer.savedCurAttrData.bg=this._curAttrData.bg,this._activeBuffer.savedCharset=this._charsetService.charset,!0}restoreCursor(E){return this._activeBuffer.x=this._activeBuffer.savedX||0,this._activeBuffer.y=Math.max(this._activeBuffer.savedY-this._activeBuffer.ybase,0),this._curAttrData.fg=this._activeBuffer.savedCurAttrData.fg,this._curAttrData.bg=this._activeBuffer.savedCurAttrData.bg,this._charsetService.charset=this._savedCharset,this._activeBuffer.savedCharset&&(this._charsetService.charset=this._activeBuffer.savedCharset),this._restrictCursor(),!0}setTitle(E){return this._windowTitle=E,this._onTitleChange.fire(E),!0}setIconName(E){return this._iconName=E,!0}setOrReportIndexedColor(E){const D=[],P=E.split(";");for(;P.length>1;){const O=P.shift(),W=P.shift();if(/^\d+$/.exec(O)){const V=parseInt(O);if(q(V))if(W==="?")D.push({type:0,index:V});else{const J=(0,b.parseColor)(W);J&&D.push({type:1,index:V,color:J})}}}return D.length&&this._onColor.fire(D),!0}setHyperlink(E){const D=E.split(";");return!(D.length<2)&&(D[1]?this._createHyperlink(D[0],D[1]):!D[0]&&this._finishHyperlink())}_createHyperlink(E,D){this._getCurrentLinkId()&&this._finishHyperlink();const P=E.split(":");let O;const W=P.findIndex(V=>V.startsWith("id="));return W!==-1&&(O=P[W].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:O,uri:D}),this._curAttrData.updateExtended(),!0}_finishHyperlink(){return this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=0,this._curAttrData.updateExtended(),!0}_setOrReportSpecialColor(E,D){const P=E.split(";");for(let O=0;O<P.length&&!(D>=this._specialColors.length);++O,++D)if(P[O]==="?")this._onColor.fire([{type:0,index:this._specialColors[D]}]);else{const W=(0,b.parseColor)(P[O]);W&&this._onColor.fire([{type:1,index:this._specialColors[D],color:W}])}return!0}setOrReportFgColor(E){return this._setOrReportSpecialColor(E,0)}setOrReportBgColor(E){return this._setOrReportSpecialColor(E,1)}setOrReportCursorColor(E){return this._setOrReportSpecialColor(E,2)}restoreIndexedColor(E){if(!E)return this._onColor.fire([{type:2}]),!0;const D=[],P=E.split(";");for(let O=0;O<P.length;++O)if(/^\d+$/.exec(P[O])){const W=parseInt(P[O]);q(W)&&D.push({type:2,index:W})}return D.length&&this._onColor.fire(D),!0}restoreFgColor(E){return this._onColor.fire([{type:2,index:256}]),!0}restoreBgColor(E){return this._onColor.fire([{type:2,index:257}]),!0}restoreCursorColor(E){return this._onColor.fire([{type:2,index:258}]),!0}nextLine(){return this._activeBuffer.x=0,this.index(),!0}keypadApplicationMode(){return this._logService.debug("Serial port requested application keypad."),this._coreService.decPrivateModes.applicationKeypad=!0,this._onRequestSyncScrollBar.fire(),!0}keypadNumericMode(){return this._logService.debug("Switching back to normal keypad."),this._coreService.decPrivateModes.applicationKeypad=!1,this._onRequestSyncScrollBar.fire(),!0}selectDefaultCharset(){return this._charsetService.setgLevel(0),this._charsetService.setgCharset(0,p.DEFAULT_CHARSET),!0}selectCharset(E){return E.length!==2?(this.selectDefaultCharset(),!0):(E[0]==="/"||this._charsetService.setgCharset(R[E[0]],p.CHARSETS[E[1]]||p.DEFAULT_CHARSET),!0)}index(){return this._restrictCursor(),this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData())):this._activeBuffer.y>=this._bufferService.rows&&(this._activeBuffer.y=this._bufferService.rows-1),this._restrictCursor(),!0}tabSet(){return this._activeBuffer.tabs[this._activeBuffer.x]=!0,!0}reverseIndex(){if(this._restrictCursor(),this._activeBuffer.y===this._activeBuffer.scrollTop){const E=this._activeBuffer.scrollBottom-this._activeBuffer.scrollTop;this._activeBuffer.lines.shiftElements(this._activeBuffer.ybase+this._activeBuffer.y,E,1),this._activeBuffer.lines.set(this._activeBuffer.ybase+this._activeBuffer.y,this._activeBuffer.getBlankLine(this._eraseAttrData())),this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom)}else this._activeBuffer.y--,this._restrictCursor();return!0}fullReset(){return this._parser.reset(),this._onRequestReset.fire(),!0}reset(){this._curAttrData=c.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=c.DEFAULT_ATTR_DATA.clone()}_eraseAttrData(){return this._eraseAttrDataInternal.bg&=-67108864,this._eraseAttrDataInternal.bg|=67108863&this._curAttrData.bg,this._eraseAttrDataInternal}setgLevel(E){return this._charsetService.setgLevel(E),!0}screenAlignmentPattern(){const E=new l.CellData;E.content=4194373,E.fg=this._curAttrData.fg,E.bg=this._curAttrData.bg,this._setCursor(0,0);for(let D=0;D<this._bufferService.rows;++D){const P=this._activeBuffer.ybase+this._activeBuffer.y+D,O=this._activeBuffer.lines.get(P);O&&(O.fill(E),O.isWrapped=!1)}return this._dirtyRowTracker.markAllDirty(),this._setCursor(0,0),!0}requestStatusString(E,D){const P=this._bufferService.buffer,O=this._optionsService.rawOptions;return(W=>(this._coreService.triggerDataEvent(`${d.C0.ESC}${W}${d.C0.ESC}\\`),!0))(E==='"q'?`P1$r${this._curAttrData.isProtected()?1:0}"q`:E==='"p'?'P1$r61;1"p':E==="r"?`P1$r${P.scrollTop+1};${P.scrollBottom+1}r`:E==="m"?"P1$r0m":E===" q"?`P1$r${{block:2,underline:4,bar:6}[O.cursorStyle]-(O.cursorBlink?1:0)} q`:"P0$r")}markRangeDirty(E,D){this._dirtyRowTracker.markRangeDirty(E,D)}}a.InputHandler=F;let K=class{constructor(j){this._bufferService=j,this.clearRange()}clearRange(){this.start=this._bufferService.buffer.y,this.end=this._bufferService.buffer.y}markDirty(j){j<this.start?this.start=j:j>this.end&&(this.end=j)}markRangeDirty(j,E){j>E&&(N=j,j=E,E=N),j<this.start&&(this.start=j),E>this.end&&(this.end=E)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};function q(j){return 0<=j&&j<256}K=f([g(0,C.IBufferService)],K)},844:(m,a)=>{function u(f){for(const g of f)g.dispose();f.length=0}Object.defineProperty(a,"__esModule",{value:!0}),a.getDisposeArrayDisposable=a.disposeArray=a.toDisposable=a.MutableDisposable=a.Disposable=void 0,a.Disposable=class{constructor(){this._disposables=[],this._isDisposed=!1}dispose(){this._isDisposed=!0;for(const f of this._disposables)f.dispose();this._disposables.length=0}register(f){return this._disposables.push(f),f}unregister(f){const g=this._disposables.indexOf(f);g!==-1&&this._disposables.splice(g,1)}},a.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(f){var g;this._isDisposed||f===this._value||((g=this._value)==null||g.dispose(),this._value=f)}clear(){this.value=void 0}dispose(){var f;this._isDisposed=!0,(f=this._value)==null||f.dispose(),this._value=void 0}},a.toDisposable=function(f){return{dispose:f}},a.disposeArray=u,a.getDisposeArrayDisposable=function(f){return{dispose:()=>u(f)}}},1505:(m,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.FourKeyMap=a.TwoKeyMap=void 0;class u{constructor(){this._data={}}set(g,d,p){this._data[g]||(this._data[g]={}),this._data[g][d]=p}get(g,d){return this._data[g]?this._data[g][d]:void 0}clear(){this._data={}}}a.TwoKeyMap=u,a.FourKeyMap=class{constructor(){this._data=new u}set(f,g,d,p,S){this._data.get(f,g)||this._data.set(f,g,new u),this._data.get(f,g).set(d,p,S)}get(f,g,d,p){var S;return(S=this._data.get(f,g))==null?void 0:S.get(d,p)}clear(){this._data.clear()}}},6114:(m,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.isChromeOS=a.isLinux=a.isWindows=a.isIphone=a.isIpad=a.isMac=a.getSafariVersion=a.isSafari=a.isLegacyEdge=a.isFirefox=a.isNode=void 0,a.isNode=typeof process<"u"&&"title"in process;const u=a.isNode?"node":navigator.userAgent,f=a.isNode?"node":navigator.platform;a.isFirefox=u.includes("Firefox"),a.isLegacyEdge=u.includes("Edge"),a.isSafari=/^((?!chrome|android).)*safari/i.test(u),a.getSafariVersion=function(){if(!a.isSafari)return 0;const g=u.match(/Version\/(\d+)/);return g===null||g.length<2?0:parseInt(g[1])},a.isMac=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(f),a.isIpad=f==="iPad",a.isIphone=f==="iPhone",a.isWindows=["Windows","Win16","Win32","WinCE"].includes(f),a.isLinux=f.indexOf("Linux")>=0,a.isChromeOS=/\bCrOS\b/.test(u)},6106:(m,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.SortedList=void 0;let u=0;a.SortedList=class{constructor(f){this._getKey=f,this._array=[]}clear(){this._array.length=0}insert(f){this._array.length!==0?(u=this._search(this._getKey(f)),this._array.splice(u,0,f)):this._array.push(f)}delete(f){if(this._array.length===0)return!1;const g=this._getKey(f);if(g===void 0||(u=this._search(g),u===-1)||this._getKey(this._array[u])!==g)return!1;do if(this._array[u]===f)return this._array.splice(u,1),!0;while(++u<this._array.length&&this._getKey(this._array[u])===g);return!1}*getKeyIterator(f){if(this._array.length!==0&&(u=this._search(f),!(u<0||u>=this._array.length)&&this._getKey(this._array[u])===f))do yield this._array[u];while(++u<this._array.length&&this._getKey(this._array[u])===f)}forEachByKey(f,g){if(this._array.length!==0&&(u=this._search(f),!(u<0||u>=this._array.length)&&this._getKey(this._array[u])===f))do g(this._array[u]);while(++u<this._array.length&&this._getKey(this._array[u])===f)}values(){return[...this._array].values()}_search(f){let g=0,d=this._array.length-1;for(;d>=g;){let p=g+d>>1;const S=this._getKey(this._array[p]);if(S>f)d=p-1;else{if(!(S<f)){for(;p>0&&this._getKey(this._array[p-1])===f;)p--;return p}g=p+1}}return g}}},7226:(m,a,u)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.DebouncedIdleTask=a.IdleTaskQueue=a.PriorityTaskQueue=void 0;const f=u(6114);class g{constructor(){this._tasks=[],this._i=0}enqueue(S){this._tasks.push(S),this._start()}flush(){for(;this._i<this._tasks.length;)this._tasks[this._i]()||this._i++;this.clear()}clear(){this._idleCallback&&(this._cancelCallback(this._idleCallback),this._idleCallback=void 0),this._i=0,this._tasks.length=0}_start(){this._idleCallback||(this._idleCallback=this._requestCallback(this._process.bind(this)))}_process(S){this._idleCallback=void 0;let w=0,_=0,c=S.timeRemaining(),o=0;for(;this._i<this._tasks.length;){if(w=Date.now(),this._tasks[this._i]()||this._i++,w=Math.max(1,Date.now()-w),_=Math.max(w,_),o=S.timeRemaining(),1.5*_>o)return c-w<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(c-w))}ms`),void this._start();c=o}this.clear()}}class d extends g{_requestCallback(S){return setTimeout(()=>S(this._createDeadline(16)))}_cancelCallback(S){clearTimeout(S)}_createDeadline(S){const w=Date.now()+S;return{timeRemaining:()=>Math.max(0,w-Date.now())}}}a.PriorityTaskQueue=d,a.IdleTaskQueue=!f.isNode&&"requestIdleCallback"in window?class extends g{_requestCallback(p){return requestIdleCallback(p)}_cancelCallback(p){cancelIdleCallback(p)}}:d,a.DebouncedIdleTask=class{constructor(){this._queue=new a.IdleTaskQueue}set(p){this._queue.clear(),this._queue.enqueue(p)}flush(){this._queue.flush()}}},9282:(m,a,u)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.updateWindowsModeWrappedState=void 0;const f=u(643);a.updateWindowsModeWrappedState=function(g){const d=g.buffer.lines.get(g.buffer.ybase+g.buffer.y-1),p=d==null?void 0:d.get(g.cols-1),S=g.buffer.lines.get(g.buffer.ybase+g.buffer.y);S&&p&&(S.isWrapped=p[f.CHAR_DATA_CODE_INDEX]!==f.NULL_CELL_CODE&&p[f.CHAR_DATA_CODE_INDEX]!==f.WHITESPACE_CELL_CODE)}},3734:(m,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.ExtendedAttrs=a.AttributeData=void 0;class u{constructor(){this.fg=0,this.bg=0,this.extended=new f}static toColorRGB(d){return[d>>>16&255,d>>>8&255,255&d]}static fromColorRGB(d){return(255&d[0])<<16|(255&d[1])<<8|255&d[2]}clone(){const d=new u;return d.fg=this.fg,d.bg=this.bg,d.extended=this.extended.clone(),d}isInverse(){return 67108864&this.fg}isBold(){return 134217728&this.fg}isUnderline(){return this.hasExtendedAttrs()&&this.extended.underlineStyle!==0?1:268435456&this.fg}isBlink(){return 536870912&this.fg}isInvisible(){return 1073741824&this.fg}isItalic(){return 67108864&this.bg}isDim(){return 134217728&this.bg}isStrikethrough(){return 2147483648&this.fg}isProtected(){return 536870912&this.bg}isOverline(){return 1073741824&this.bg}getFgColorMode(){return 50331648&this.fg}getBgColorMode(){return 50331648&this.bg}isFgRGB(){return(50331648&this.fg)==50331648}isBgRGB(){return(50331648&this.bg)==50331648}isFgPalette(){return(50331648&this.fg)==16777216||(50331648&this.fg)==33554432}isBgPalette(){return(50331648&this.bg)==16777216||(50331648&this.bg)==33554432}isFgDefault(){return(50331648&this.fg)==0}isBgDefault(){return(50331648&this.bg)==0}isAttributeDefault(){return this.fg===0&&this.bg===0}getFgColor(){switch(50331648&this.fg){case 16777216:case 33554432:return 255&this.fg;case 50331648:return 16777215&this.fg;default:return-1}}getBgColor(){switch(50331648&this.bg){case 16777216:case 33554432:return 255&this.bg;case 50331648:return 16777215&this.bg;default:return-1}}hasExtendedAttrs(){return 268435456&this.bg}updateExtended(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456}getUnderlineColor(){if(268435456&this.bg&&~this.extended.underlineColor)switch(50331648&this.extended.underlineColor){case 16777216:case 33554432:return 255&this.extended.underlineColor;case 50331648:return 16777215&this.extended.underlineColor;default:return this.getFgColor()}return this.getFgColor()}getUnderlineColorMode(){return 268435456&this.bg&&~this.extended.underlineColor?50331648&this.extended.underlineColor:this.getFgColorMode()}isUnderlineColorRGB(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==50331648:this.isFgRGB()}isUnderlineColorPalette(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==16777216||(50331648&this.extended.underlineColor)==33554432:this.isFgPalette()}isUnderlineColorDefault(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==0:this.isFgDefault()}getUnderlineStyle(){return 268435456&this.fg?268435456&this.bg?this.extended.underlineStyle:1:0}getUnderlineVariantOffset(){return this.extended.underlineVariantOffset}}a.AttributeData=u;class f{get ext(){return this._urlId?-469762049&this._ext|this.underlineStyle<<26:this._ext}set ext(d){this._ext=d}get underlineStyle(){return this._urlId?5:(469762048&this._ext)>>26}set underlineStyle(d){this._ext&=-469762049,this._ext|=d<<26&469762048}get underlineColor(){return 67108863&this._ext}set underlineColor(d){this._ext&=-67108864,this._ext|=67108863&d}get urlId(){return this._urlId}set urlId(d){this._urlId=d}get underlineVariantOffset(){const d=(3758096384&this._ext)>>29;return d<0?4294967288^d:d}set underlineVariantOffset(d){this._ext&=536870911,this._ext|=d<<29&3758096384}constructor(d=0,p=0){this._ext=0,this._urlId=0,this._ext=d,this._urlId=p}clone(){return new f(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}}a.ExtendedAttrs=f},9092:(m,a,u)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.Buffer=a.MAX_BUFFER_SIZE=void 0;const f=u(6349),g=u(7226),d=u(3734),p=u(8437),S=u(4634),w=u(511),_=u(643),c=u(4863),o=u(7116);a.MAX_BUFFER_SIZE=4294967295,a.Buffer=class{constructor(s,l,v){this._hasScrollback=s,this._optionsService=l,this._bufferService=v,this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.tabs={},this.savedY=0,this.savedX=0,this.savedCurAttrData=p.DEFAULT_ATTR_DATA.clone(),this.savedCharset=o.DEFAULT_CHARSET,this.markers=[],this._nullCell=w.CellData.fromCharData([0,_.NULL_CELL_CHAR,_.NULL_CELL_WIDTH,_.NULL_CELL_CODE]),this._whitespaceCell=w.CellData.fromCharData([0,_.WHITESPACE_CELL_CHAR,_.WHITESPACE_CELL_WIDTH,_.WHITESPACE_CELL_CODE]),this._isClearing=!1,this._memoryCleanupQueue=new g.IdleTaskQueue,this._memoryCleanupPosition=0,this._cols=this._bufferService.cols,this._rows=this._bufferService.rows,this.lines=new f.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}getNullCell(s){return s?(this._nullCell.fg=s.fg,this._nullCell.bg=s.bg,this._nullCell.extended=s.extended):(this._nullCell.fg=0,this._nullCell.bg=0,this._nullCell.extended=new d.ExtendedAttrs),this._nullCell}getWhitespaceCell(s){return s?(this._whitespaceCell.fg=s.fg,this._whitespaceCell.bg=s.bg,this._whitespaceCell.extended=s.extended):(this._whitespaceCell.fg=0,this._whitespaceCell.bg=0,this._whitespaceCell.extended=new d.ExtendedAttrs),this._whitespaceCell}getBlankLine(s,l){return new p.BufferLine(this._bufferService.cols,this.getNullCell(s),l)}get hasScrollback(){return this._hasScrollback&&this.lines.maxLength>this._rows}get isCursorInViewport(){const s=this.ybase+this.y-this.ydisp;return s>=0&&s<this._rows}_getCorrectBufferLength(s){if(!this._hasScrollback)return s;const l=s+this._optionsService.rawOptions.scrollback;return l>a.MAX_BUFFER_SIZE?a.MAX_BUFFER_SIZE:l}fillViewportRows(s){if(this.lines.length===0){s===void 0&&(s=p.DEFAULT_ATTR_DATA);let l=this._rows;for(;l--;)this.lines.push(this.getBlankLine(s))}}clear(){this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.lines=new f.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}resize(s,l){const v=this.getNullCell(p.DEFAULT_ATTR_DATA);let C=0;const x=this._getCorrectBufferLength(l);if(x>this.lines.maxLength&&(this.lines.maxLength=x),this.lines.length>0){if(this._cols<s)for(let y=0;y<this.lines.length;y++)C+=+this.lines.get(y).resize(s,v);let k=0;if(this._rows<l)for(let y=this._rows;y<l;y++)this.lines.length<l+this.ybase&&(this._optionsService.rawOptions.windowsMode||this._optionsService.rawOptions.windowsPty.backend!==void 0||this._optionsService.rawOptions.windowsPty.buildNumber!==void 0?this.lines.push(new p.BufferLine(s,v)):this.ybase>0&&this.lines.length<=this.ybase+this.y+k+1?(this.ybase--,k++,this.ydisp>0&&this.ydisp--):this.lines.push(new p.BufferLine(s,v)));else for(let y=this._rows;y>l;y--)this.lines.length>l+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(x<this.lines.maxLength){const y=this.lines.length-x;y>0&&(this.lines.trimStart(y),this.ybase=Math.max(this.ybase-y,0),this.ydisp=Math.max(this.ydisp-y,0),this.savedY=Math.max(this.savedY-y,0)),this.lines.maxLength=x}this.x=Math.min(this.x,s-1),this.y=Math.min(this.y,l-1),k&&(this.y+=k),this.savedX=Math.min(this.savedX,s-1),this.scrollTop=0}if(this.scrollBottom=l-1,this._isReflowEnabled&&(this._reflow(s,l),this._cols>s))for(let k=0;k<this.lines.length;k++)C+=+this.lines.get(k).resize(s,v);this._cols=s,this._rows=l,this._memoryCleanupQueue.clear(),C>.1*this.lines.length&&(this._memoryCleanupPosition=0,this._memoryCleanupQueue.enqueue(()=>this._batchedMemoryCleanup()))}_batchedMemoryCleanup(){let s=!0;this._memoryCleanupPosition>=this.lines.length&&(this._memoryCleanupPosition=0,s=!1);let l=0;for(;this._memoryCleanupPosition<this.lines.length;)if(l+=this.lines.get(this._memoryCleanupPosition++).cleanupMemory(),l>100)return!0;return s}get _isReflowEnabled(){const s=this._optionsService.rawOptions.windowsPty;return s&&s.buildNumber?this._hasScrollback&&s.backend==="conpty"&&s.buildNumber>=21376:this._hasScrollback&&!this._optionsService.rawOptions.windowsMode}_reflow(s,l){this._cols!==s&&(s>this._cols?this._reflowLarger(s,l):this._reflowSmaller(s,l))}_reflowLarger(s,l){const v=(0,S.reflowLargerGetLinesToRemove)(this.lines,this._cols,s,this.ybase+this.y,this.getNullCell(p.DEFAULT_ATTR_DATA));if(v.length>0){const C=(0,S.reflowLargerCreateNewLayout)(this.lines,v);(0,S.reflowLargerApplyNewLayout)(this.lines,C.layout),this._reflowLargerAdjustViewport(s,l,C.countRemoved)}}_reflowLargerAdjustViewport(s,l,v){const C=this.getNullCell(p.DEFAULT_ATTR_DATA);let x=v;for(;x-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length<l&&this.lines.push(new p.BufferLine(s,C))):(this.ydisp===this.ybase&&this.ydisp--,this.ybase--);this.savedY=Math.max(this.savedY-v,0)}_reflowSmaller(s,l){const v=this.getNullCell(p.DEFAULT_ATTR_DATA),C=[];let x=0;for(let k=this.lines.length-1;k>=0;k--){let y=this.lines.get(k);if(!y||!y.isWrapped&&y.getTrimmedLength()<=s)continue;const b=[y];for(;y.isWrapped&&k>0;)y=this.lines.get(--k),b.unshift(y);const R=this.ybase+this.y;if(R>=k&&R<k+b.length)continue;const M=b[b.length-1].getTrimmedLength(),B=(0,S.reflowSmallerGetNewLineLengths)(b,this._cols,s),T=B.length-b.length;let N;N=this.ybase===0&&this.y!==this.lines.length-1?Math.max(0,this.y-this.lines.maxLength+T):Math.max(0,this.lines.length-this.lines.maxLength+T);const F=[];for(let P=0;P<T;P++){const O=this.getBlankLine(p.DEFAULT_ATTR_DATA,!0);F.push(O)}F.length>0&&(C.push({start:k+b.length+x,newLines:F}),x+=F.length),b.push(...F);let K=B.length-1,q=B[K];q===0&&(K--,q=B[K]);let j=b.length-T-1,E=M;for(;j>=0;){const P=Math.min(E,q);if(b[K]===void 0)break;if(b[K].copyCellsFrom(b[j],E-P,q-P,P,!0),q-=P,q===0&&(K--,q=B[K]),E-=P,E===0){j--;const O=Math.max(j,0);E=(0,S.getWrappedLineTrimmedLength)(b,O,this._cols)}}for(let P=0;P<b.length;P++)B[P]<s&&b[P].setCell(B[P],v);let D=T-N;for(;D-- >0;)this.ybase===0?this.y<l-1?(this.y++,this.lines.pop()):(this.ybase++,this.ydisp++):this.ybase<Math.min(this.lines.maxLength,this.lines.length+x)-l&&(this.ybase===this.ydisp&&this.ydisp++,this.ybase++);this.savedY=Math.min(this.savedY+T,this.ybase+l-1)}if(C.length>0){const k=[],y=[];for(let K=0;K<this.lines.length;K++)y.push(this.lines.get(K));const b=this.lines.length;let R=b-1,M=0,B=C[M];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+x);let T=0;for(let K=Math.min(this.lines.maxLength-1,b+x-1);K>=0;K--)if(B&&B.start>R+T){for(let q=B.newLines.length-1;q>=0;q--)this.lines.set(K--,B.newLines[q]);K++,k.push({index:R+1,amount:B.newLines.length}),T+=B.newLines.length,B=C[++M]}else this.lines.set(K,y[R--]);let N=0;for(let K=k.length-1;K>=0;K--)k[K].index+=N,this.lines.onInsertEmitter.fire(k[K]),N+=k[K].amount;const F=Math.max(0,b+x-this.lines.maxLength);F>0&&this.lines.onTrimEmitter.fire(F)}}translateBufferLineToString(s,l,v=0,C){const x=this.lines.get(s);return x?x.translateToString(l,v,C):""}getWrappedRangeForLine(s){let l=s,v=s;for(;l>0&&this.lines.get(l).isWrapped;)l--;for(;v+1<this.lines.length&&this.lines.get(v+1).isWrapped;)v++;return{first:l,last:v}}setupTabStops(s){for(s!=null?this.tabs[s]||(s=this.prevStop(s)):(this.tabs={},s=0);s<this._cols;s+=this._optionsService.rawOptions.tabStopWidth)this.tabs[s]=!0}prevStop(s){for(s==null&&(s=this.x);!this.tabs[--s]&&s>0;);return s>=this._cols?this._cols-1:s<0?0:s}nextStop(s){for(s==null&&(s=this.x);!this.tabs[++s]&&s<this._cols;);return s>=this._cols?this._cols-1:s<0?0:s}clearMarkers(s){this._isClearing=!0;for(let l=0;l<this.markers.length;l++)this.markers[l].line===s&&(this.markers[l].dispose(),this.markers.splice(l--,1));this._isClearing=!1}clearAllMarkers(){this._isClearing=!0;for(let s=0;s<this.markers.length;s++)this.markers[s].dispose(),this.markers.splice(s--,1);this._isClearing=!1}addMarker(s){const l=new c.Marker(s);return this.markers.push(l),l.register(this.lines.onTrim(v=>{l.line-=v,l.line<0&&l.dispose()})),l.register(this.lines.onInsert(v=>{l.line>=v.index&&(l.line+=v.amount)})),l.register(this.lines.onDelete(v=>{l.line>=v.index&&l.line<v.index+v.amount&&l.dispose(),l.line>v.index&&(l.line-=v.amount)})),l.register(l.onDispose(()=>this._removeMarker(l))),l}_removeMarker(s){this._isClearing||this.markers.splice(this.markers.indexOf(s),1)}}},8437:(m,a,u)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.BufferLine=a.DEFAULT_ATTR_DATA=void 0;const f=u(3734),g=u(511),d=u(643),p=u(482);a.DEFAULT_ATTR_DATA=Object.freeze(new f.AttributeData);let S=0;class w{constructor(c,o,s=!1){this.isWrapped=s,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(3*c);const l=o||g.CellData.fromCharData([0,d.NULL_CELL_CHAR,d.NULL_CELL_WIDTH,d.NULL_CELL_CODE]);for(let v=0;v<c;++v)this.setCell(v,l);this.length=c}get(c){const o=this._data[3*c+0],s=2097151&o;return[this._data[3*c+1],2097152&o?this._combined[c]:s?(0,p.stringFromCodePoint)(s):"",o>>22,2097152&o?this._combined[c].charCodeAt(this._combined[c].length-1):s]}set(c,o){this._data[3*c+1]=o[d.CHAR_DATA_ATTR_INDEX],o[d.CHAR_DATA_CHAR_INDEX].length>1?(this._combined[c]=o[1],this._data[3*c+0]=2097152|c|o[d.CHAR_DATA_WIDTH_INDEX]<<22):this._data[3*c+0]=o[d.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|o[d.CHAR_DATA_WIDTH_INDEX]<<22}getWidth(c){return this._data[3*c+0]>>22}hasWidth(c){return 12582912&this._data[3*c+0]}getFg(c){return this._data[3*c+1]}getBg(c){return this._data[3*c+2]}hasContent(c){return 4194303&this._data[3*c+0]}getCodePoint(c){const o=this._data[3*c+0];return 2097152&o?this._combined[c].charCodeAt(this._combined[c].length-1):2097151&o}isCombined(c){return 2097152&this._data[3*c+0]}getString(c){const o=this._data[3*c+0];return 2097152&o?this._combined[c]:2097151&o?(0,p.stringFromCodePoint)(2097151&o):""}isProtected(c){return 536870912&this._data[3*c+2]}loadCell(c,o){return S=3*c,o.content=this._data[S+0],o.fg=this._data[S+1],o.bg=this._data[S+2],2097152&o.content&&(o.combinedData=this._combined[c]),268435456&o.bg&&(o.extended=this._extendedAttrs[c]),o}setCell(c,o){2097152&o.content&&(this._combined[c]=o.combinedData),268435456&o.bg&&(this._extendedAttrs[c]=o.extended),this._data[3*c+0]=o.content,this._data[3*c+1]=o.fg,this._data[3*c+2]=o.bg}setCellFromCodepoint(c,o,s,l){268435456&l.bg&&(this._extendedAttrs[c]=l.extended),this._data[3*c+0]=o|s<<22,this._data[3*c+1]=l.fg,this._data[3*c+2]=l.bg}addCodepointToCell(c,o,s){let l=this._data[3*c+0];2097152&l?this._combined[c]+=(0,p.stringFromCodePoint)(o):2097151&l?(this._combined[c]=(0,p.stringFromCodePoint)(2097151&l)+(0,p.stringFromCodePoint)(o),l&=-2097152,l|=2097152):l=o|4194304,s&&(l&=-12582913,l|=s<<22),this._data[3*c+0]=l}insertCells(c,o,s){if((c%=this.length)&&this.getWidth(c-1)===2&&this.setCellFromCodepoint(c-1,0,1,s),o<this.length-c){const l=new g.CellData;for(let v=this.length-c-o-1;v>=0;--v)this.setCell(c+o+v,this.loadCell(c+v,l));for(let v=0;v<o;++v)this.setCell(c+v,s)}else for(let l=c;l<this.length;++l)this.setCell(l,s);this.getWidth(this.length-1)===2&&this.setCellFromCodepoint(this.length-1,0,1,s)}deleteCells(c,o,s){if(c%=this.length,o<this.length-c){const l=new g.CellData;for(let v=0;v<this.length-c-o;++v)this.setCell(c+v,this.loadCell(c+o+v,l));for(let v=this.length-o;v<this.length;++v)this.setCell(v,s)}else for(let l=c;l<this.length;++l)this.setCell(l,s);c&&this.getWidth(c-1)===2&&this.setCellFromCodepoint(c-1,0,1,s),this.getWidth(c)!==0||this.hasContent(c)||this.setCellFromCodepoint(c,0,1,s)}replaceCells(c,o,s,l=!1){if(l)for(c&&this.getWidth(c-1)===2&&!this.isProtected(c-1)&&this.setCellFromCodepoint(c-1,0,1,s),o<this.length&&this.getWidth(o-1)===2&&!this.isProtected(o)&&this.setCellFromCodepoint(o,0,1,s);c<o&&c<this.length;)this.isProtected(c)||this.setCell(c,s),c++;else for(c&&this.getWidth(c-1)===2&&this.setCellFromCodepoint(c-1,0,1,s),o<this.length&&this.getWidth(o-1)===2&&this.setCellFromCodepoint(o,0,1,s);c<o&&c<this.length;)this.setCell(c++,s)}resize(c,o){if(c===this.length)return 4*this._data.length*2<this._data.buffer.byteLength;const s=3*c;if(c>this.length){if(this._data.buffer.byteLength>=4*s)this._data=new Uint32Array(this._data.buffer,0,s);else{const l=new Uint32Array(s);l.set(this._data),this._data=l}for(let l=this.length;l<c;++l)this.setCell(l,o)}else{this._data=this._data.subarray(0,s);const l=Object.keys(this._combined);for(let C=0;C<l.length;C++){const x=parseInt(l[C],10);x>=c&&delete this._combined[x]}const v=Object.keys(this._extendedAttrs);for(let C=0;C<v.length;C++){const x=parseInt(v[C],10);x>=c&&delete this._extendedAttrs[x]}}return this.length=c,4*s*2<this._data.buffer.byteLength}cleanupMemory(){if(4*this._data.length*2<this._data.buffer.byteLength){const c=new Uint32Array(this._data.length);return c.set(this._data),this._data=c,1}return 0}fill(c,o=!1){if(o)for(let s=0;s<this.length;++s)this.isProtected(s)||this.setCell(s,c);else{this._combined={},this._extendedAttrs={};for(let s=0;s<this.length;++s)this.setCell(s,c)}}copyFrom(c){this.length!==c.length?this._data=new Uint32Array(c._data):this._data.set(c._data),this.length=c.length,this._combined={};for(const o in c._combined)this._combined[o]=c._combined[o];this._extendedAttrs={};for(const o in c._extendedAttrs)this._extendedAttrs[o]=c._extendedAttrs[o];this.isWrapped=c.isWrapped}clone(){const c=new w(0);c._data=new Uint32Array(this._data),c.length=this.length;for(const o in this._combined)c._combined[o]=this._combined[o];for(const o in this._extendedAttrs)c._extendedAttrs[o]=this._extendedAttrs[o];return c.isWrapped=this.isWrapped,c}getTrimmedLength(){for(let c=this.length-1;c>=0;--c)if(4194303&this._data[3*c+0])return c+(this._data[3*c+0]>>22);return 0}getNoBgTrimmedLength(){for(let c=this.length-1;c>=0;--c)if(4194303&this._data[3*c+0]||50331648&this._data[3*c+2])return c+(this._data[3*c+0]>>22);return 0}copyCellsFrom(c,o,s,l,v){const C=c._data;if(v)for(let k=l-1;k>=0;k--){for(let y=0;y<3;y++)this._data[3*(s+k)+y]=C[3*(o+k)+y];268435456&C[3*(o+k)+2]&&(this._extendedAttrs[s+k]=c._extendedAttrs[o+k])}else for(let k=0;k<l;k++){for(let y=0;y<3;y++)this._data[3*(s+k)+y]=C[3*(o+k)+y];268435456&C[3*(o+k)+2]&&(this._extendedAttrs[s+k]=c._extendedAttrs[o+k])}const x=Object.keys(c._combined);for(let k=0;k<x.length;k++){const y=parseInt(x[k],10);y>=o&&(this._combined[y-o+s]=c._combined[y])}}translateToString(c,o,s,l){o=o??0,s=s??this.length,c&&(s=Math.min(s,this.getTrimmedLength())),l&&(l.length=0);let v="";for(;o<s;){const C=this._data[3*o+0],x=2097151&C,k=2097152&C?this._combined[o]:x?(0,p.stringFromCodePoint)(x):d.WHITESPACE_CELL_CHAR;if(v+=k,l)for(let y=0;y<k.length;++y)l.push(o);o+=C>>22||1}return l&&l.push(o),v}}a.BufferLine=w},4841:(m,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.getRangeLength=void 0,a.getRangeLength=function(u,f){if(u.start.y>u.end.y)throw new Error(`Buffer range end (${u.end.x}, ${u.end.y}) cannot be before start (${u.start.x}, ${u.start.y})`);return f*(u.end.y-u.start.y)+(u.end.x-u.start.x+1)}},4634:(m,a)=>{function u(f,g,d){if(g===f.length-1)return f[g].getTrimmedLength();const p=!f[g].hasContent(d-1)&&f[g].getWidth(d-1)===1,S=f[g+1].getWidth(0)===2;return p&&S?d-1:d}Object.defineProperty(a,"__esModule",{value:!0}),a.getWrappedLineTrimmedLength=a.reflowSmallerGetNewLineLengths=a.reflowLargerApplyNewLayout=a.reflowLargerCreateNewLayout=a.reflowLargerGetLinesToRemove=void 0,a.reflowLargerGetLinesToRemove=function(f,g,d,p,S){const w=[];for(let _=0;_<f.length-1;_++){let c=_,o=f.get(++c);if(!o.isWrapped)continue;const s=[f.get(_)];for(;c<f.length&&o.isWrapped;)s.push(o),o=f.get(++c);if(p>=_&&p<c){_+=s.length-1;continue}let l=0,v=u(s,l,g),C=1,x=0;for(;C<s.length;){const y=u(s,C,g),b=y-x,R=d-v,M=Math.min(b,R);s[l].copyCellsFrom(s[C],x,v,M,!1),v+=M,v===d&&(l++,v=0),x+=M,x===y&&(C++,x=0),v===0&&l!==0&&s[l-1].getWidth(d-1)===2&&(s[l].copyCellsFrom(s[l-1],d-1,v++,1,!1),s[l-1].setCell(d-1,S))}s[l].replaceCells(v,d,S);let k=0;for(let y=s.length-1;y>0&&(y>l||s[y].getTrimmedLength()===0);y--)k++;k>0&&(w.push(_+s.length-k),w.push(k)),_+=s.length-1}return w},a.reflowLargerCreateNewLayout=function(f,g){const d=[];let p=0,S=g[p],w=0;for(let _=0;_<f.length;_++)if(S===_){const c=g[++p];f.onDeleteEmitter.fire({index:_-w,amount:c}),_+=c-1,w+=c,S=g[++p]}else d.push(_);return{layout:d,countRemoved:w}},a.reflowLargerApplyNewLayout=function(f,g){const d=[];for(let p=0;p<g.length;p++)d.push(f.get(g[p]));for(let p=0;p<d.length;p++)f.set(p,d[p]);f.length=g.length},a.reflowSmallerGetNewLineLengths=function(f,g,d){const p=[],S=f.map((o,s)=>u(f,s,g)).reduce((o,s)=>o+s);let w=0,_=0,c=0;for(;c<S;){if(S-c<d){p.push(S-c);break}w+=d;const o=u(f,_,g);w>o&&(w-=o,_++);const s=f[_].getWidth(w-1)===2;s&&w--;const l=s?d-1:d;p.push(l),c+=l}return p},a.getWrappedLineTrimmedLength=u},5295:(m,a,u)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.BufferSet=void 0;const f=u(8460),g=u(844),d=u(9092);class p extends g.Disposable{constructor(w,_){super(),this._optionsService=w,this._bufferService=_,this._onBufferActivate=this.register(new f.EventEmitter),this.onBufferActivate=this._onBufferActivate.event,this.reset(),this.register(this._optionsService.onSpecificOptionChange("scrollback",()=>this.resize(this._bufferService.cols,this._bufferService.rows))),this.register(this._optionsService.onSpecificOptionChange("tabStopWidth",()=>this.setupTabStops()))}reset(){this._normal=new d.Buffer(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new d.Buffer(!1,this._optionsService,this._bufferService),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}),this.setupTabStops()}get alt(){return this._alt}get active(){return this._activeBuffer}get normal(){return this._normal}activateNormalBuffer(){this._activeBuffer!==this._normal&&(this._normal.x=this._alt.x,this._normal.y=this._alt.y,this._alt.clearAllMarkers(),this._alt.clear(),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}))}activateAltBuffer(w){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(w),this._alt.x=this._normal.x,this._alt.y=this._normal.y,this._activeBuffer=this._alt,this._onBufferActivate.fire({activeBuffer:this._alt,inactiveBuffer:this._normal}))}resize(w,_){this._normal.resize(w,_),this._alt.resize(w,_),this.setupTabStops(w)}setupTabStops(w){this._normal.setupTabStops(w),this._alt.setupTabStops(w)}}a.BufferSet=p},511:(m,a,u)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.CellData=void 0;const f=u(482),g=u(643),d=u(3734);class p extends d.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new d.ExtendedAttrs,this.combinedData=""}static fromCharData(w){const _=new p;return _.setFromCharData(w),_}isCombined(){return 2097152&this.content}getWidth(){return this.content>>22}getChars(){return 2097152&this.content?this.combinedData:2097151&this.content?(0,f.stringFromCodePoint)(2097151&this.content):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content}setFromCharData(w){this.fg=w[g.CHAR_DATA_ATTR_INDEX],this.bg=0;let _=!1;if(w[g.CHAR_DATA_CHAR_INDEX].length>2)_=!0;else if(w[g.CHAR_DATA_CHAR_INDEX].length===2){const c=w[g.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=c&&c<=56319){const o=w[g.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=o&&o<=57343?this.content=1024*(c-55296)+o-56320+65536|w[g.CHAR_DATA_WIDTH_INDEX]<<22:_=!0}else _=!0}else this.content=w[g.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|w[g.CHAR_DATA_WIDTH_INDEX]<<22;_&&(this.combinedData=w[g.CHAR_DATA_CHAR_INDEX],this.content=2097152|w[g.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}a.CellData=p},643:(m,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.WHITESPACE_CELL_CODE=a.WHITESPACE_CELL_WIDTH=a.WHITESPACE_CELL_CHAR=a.NULL_CELL_CODE=a.NULL_CELL_WIDTH=a.NULL_CELL_CHAR=a.CHAR_DATA_CODE_INDEX=a.CHAR_DATA_WIDTH_INDEX=a.CHAR_DATA_CHAR_INDEX=a.CHAR_DATA_ATTR_INDEX=a.DEFAULT_EXT=a.DEFAULT_ATTR=a.DEFAULT_COLOR=void 0,a.DEFAULT_COLOR=0,a.DEFAULT_ATTR=256|a.DEFAULT_COLOR<<9,a.DEFAULT_EXT=0,a.CHAR_DATA_ATTR_INDEX=0,a.CHAR_DATA_CHAR_INDEX=1,a.CHAR_DATA_WIDTH_INDEX=2,a.CHAR_DATA_CODE_INDEX=3,a.NULL_CELL_CHAR="",a.NULL_CELL_WIDTH=1,a.NULL_CELL_CODE=0,a.WHITESPACE_CELL_CHAR=" ",a.WHITESPACE_CELL_WIDTH=1,a.WHITESPACE_CELL_CODE=32},4863:(m,a,u)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.Marker=void 0;const f=u(8460),g=u(844);class d{get id(){return this._id}constructor(S){this.line=S,this.isDisposed=!1,this._disposables=[],this._id=d._nextId++,this._onDispose=this.register(new f.EventEmitter),this.onDispose=this._onDispose.event}dispose(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire(),(0,g.disposeArray)(this._disposables),this._disposables.length=0)}register(S){return this._disposables.push(S),S}}a.Marker=d,d._nextId=1},7116:(m,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.DEFAULT_CHARSET=a.CHARSETS=void 0,a.CHARSETS={},a.DEFAULT_CHARSET=a.CHARSETS.B,a.CHARSETS[0]={"`":"◆",a:"▒",b:"␉",c:"␌",d:"␍",e:"␊",f:"°",g:"±",h:"",i:"␋",j:"┘",k:"┐",l:"┌",m:"└",n:"┼",o:"⎺",p:"⎻",q:"─",r:"⎼",s:"⎽",t:"├",u:"┤",v:"┴",w:"┬",x:"│",y:"≤",z:"≥","{":"π","|":"≠","}":"£","~":"·"},a.CHARSETS.A={"#":"£"},a.CHARSETS.B=void 0,a.CHARSETS[4]={"#":"£","@":"¾","[":"ij","\\":"½","]":"|","{":"¨","|":"f","}":"¼","~":"´"},a.CHARSETS.C=a.CHARSETS[5]={"[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},a.CHARSETS.R={"#":"£","@":"à","[":"°","\\":"ç","]":"§","{":"é","|":"ù","}":"è","~":"¨"},a.CHARSETS.Q={"@":"à","[":"â","\\":"ç","]":"ê","^":"î","`":"ô","{":"é","|":"ù","}":"è","~":"û"},a.CHARSETS.K={"@":"§","[":"Ä","\\":"Ö","]":"Ü","{":"ä","|":"ö","}":"ü","~":"ß"},a.CHARSETS.Y={"#":"£","@":"§","[":"°","\\":"ç","]":"é","`":"ù","{":"à","|":"ò","}":"è","~":"ì"},a.CHARSETS.E=a.CHARSETS[6]={"@":"Ä","[":"Æ","\\":"Ø","]":"Å","^":"Ü","`":"ä","{":"æ","|":"ø","}":"å","~":"ü"},a.CHARSETS.Z={"#":"£","@":"§","[":"¡","\\":"Ñ","]":"¿","{":"°","|":"ñ","}":"ç"},a.CHARSETS.H=a.CHARSETS[7]={"@":"É","[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},a.CHARSETS["="]={"#":"ù","@":"à","[":"é","\\":"ç","]":"ê","^":"î",_:"è","`":"ô","{":"ä","|":"ö","}":"ü","~":"û"}},2584:(m,a)=>{var u,f,g;Object.defineProperty(a,"__esModule",{value:!0}),a.C1_ESCAPED=a.C1=a.C0=void 0,function(d){d.NUL="\0",d.SOH="",d.STX="",d.ETX="",d.EOT="",d.ENQ="",d.ACK="",d.BEL="\x07",d.BS="\b",d.HT=" ",d.LF=`
|
|
63
63
|
`,d.VT="\v",d.FF="\f",d.CR="\r",d.SO="",d.SI="",d.DLE="",d.DC1="",d.DC2="",d.DC3="",d.DC4="",d.NAK="",d.SYN="",d.ETB="",d.CAN="",d.EM="",d.SUB="",d.ESC="\x1B",d.FS="",d.GS="",d.RS="",d.US="",d.SP=" ",d.DEL=""}(u||(a.C0=u={})),function(d){d.PAD="",d.HOP="",d.BPH="",d.NBH="",d.IND="",d.NEL="
",d.SSA="",d.ESA="",d.HTS="",d.HTJ="",d.VTS="",d.PLD="",d.PLU="",d.RI="",d.SS2="",d.SS3="",d.DCS="",d.PU1="",d.PU2="",d.STS="",d.CCH="",d.MW="",d.SPA="",d.EPA="",d.SOS="",d.SGCI="",d.SCI="",d.CSI="",d.ST="",d.OSC="",d.PM="",d.APC=""}(f||(a.C1=f={})),function(d){d.ST=`${u.ESC}\\`}(g||(a.C1_ESCAPED=g={}))},7399:(m,a,u)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.evaluateKeyboardEvent=void 0;const f=u(2584),g={48:["0",")"],49:["1","!"],50:["2","@"],51:["3","#"],52:["4","$"],53:["5","%"],54:["6","^"],55:["7","&"],56:["8","*"],57:["9","("],186:[";",":"],187:["=","+"],188:[",","<"],189:["-","_"],190:[".",">"],191:["/","?"],192:["`","~"],219:["[","{"],220:["\\","|"],221:["]","}"],222:["'",'"']};a.evaluateKeyboardEvent=function(d,p,S,w){const _={type:0,cancel:!1,key:void 0},c=(d.shiftKey?1:0)|(d.altKey?2:0)|(d.ctrlKey?4:0)|(d.metaKey?8:0);switch(d.keyCode){case 0:d.key==="UIKeyInputUpArrow"?_.key=p?f.C0.ESC+"OA":f.C0.ESC+"[A":d.key==="UIKeyInputLeftArrow"?_.key=p?f.C0.ESC+"OD":f.C0.ESC+"[D":d.key==="UIKeyInputRightArrow"?_.key=p?f.C0.ESC+"OC":f.C0.ESC+"[C":d.key==="UIKeyInputDownArrow"&&(_.key=p?f.C0.ESC+"OB":f.C0.ESC+"[B");break;case 8:_.key=d.ctrlKey?"\b":f.C0.DEL,d.altKey&&(_.key=f.C0.ESC+_.key);break;case 9:if(d.shiftKey){_.key=f.C0.ESC+"[Z";break}_.key=f.C0.HT,_.cancel=!0;break;case 13:_.key=d.altKey?f.C0.ESC+f.C0.CR:f.C0.CR,_.cancel=!0;break;case 27:_.key=f.C0.ESC,d.altKey&&(_.key=f.C0.ESC+f.C0.ESC),_.cancel=!0;break;case 37:if(d.metaKey)break;c?(_.key=f.C0.ESC+"[1;"+(c+1)+"D",_.key===f.C0.ESC+"[1;3D"&&(_.key=f.C0.ESC+(S?"b":"[1;5D"))):_.key=p?f.C0.ESC+"OD":f.C0.ESC+"[D";break;case 39:if(d.metaKey)break;c?(_.key=f.C0.ESC+"[1;"+(c+1)+"C",_.key===f.C0.ESC+"[1;3C"&&(_.key=f.C0.ESC+(S?"f":"[1;5C"))):_.key=p?f.C0.ESC+"OC":f.C0.ESC+"[C";break;case 38:if(d.metaKey)break;c?(_.key=f.C0.ESC+"[1;"+(c+1)+"A",S||_.key!==f.C0.ESC+"[1;3A"||(_.key=f.C0.ESC+"[1;5A")):_.key=p?f.C0.ESC+"OA":f.C0.ESC+"[A";break;case 40:if(d.metaKey)break;c?(_.key=f.C0.ESC+"[1;"+(c+1)+"B",S||_.key!==f.C0.ESC+"[1;3B"||(_.key=f.C0.ESC+"[1;5B")):_.key=p?f.C0.ESC+"OB":f.C0.ESC+"[B";break;case 45:d.shiftKey||d.ctrlKey||(_.key=f.C0.ESC+"[2~");break;case 46:_.key=c?f.C0.ESC+"[3;"+(c+1)+"~":f.C0.ESC+"[3~";break;case 36:_.key=c?f.C0.ESC+"[1;"+(c+1)+"H":p?f.C0.ESC+"OH":f.C0.ESC+"[H";break;case 35:_.key=c?f.C0.ESC+"[1;"+(c+1)+"F":p?f.C0.ESC+"OF":f.C0.ESC+"[F";break;case 33:d.shiftKey?_.type=2:d.ctrlKey?_.key=f.C0.ESC+"[5;"+(c+1)+"~":_.key=f.C0.ESC+"[5~";break;case 34:d.shiftKey?_.type=3:d.ctrlKey?_.key=f.C0.ESC+"[6;"+(c+1)+"~":_.key=f.C0.ESC+"[6~";break;case 112:_.key=c?f.C0.ESC+"[1;"+(c+1)+"P":f.C0.ESC+"OP";break;case 113:_.key=c?f.C0.ESC+"[1;"+(c+1)+"Q":f.C0.ESC+"OQ";break;case 114:_.key=c?f.C0.ESC+"[1;"+(c+1)+"R":f.C0.ESC+"OR";break;case 115:_.key=c?f.C0.ESC+"[1;"+(c+1)+"S":f.C0.ESC+"OS";break;case 116:_.key=c?f.C0.ESC+"[15;"+(c+1)+"~":f.C0.ESC+"[15~";break;case 117:_.key=c?f.C0.ESC+"[17;"+(c+1)+"~":f.C0.ESC+"[17~";break;case 118:_.key=c?f.C0.ESC+"[18;"+(c+1)+"~":f.C0.ESC+"[18~";break;case 119:_.key=c?f.C0.ESC+"[19;"+(c+1)+"~":f.C0.ESC+"[19~";break;case 120:_.key=c?f.C0.ESC+"[20;"+(c+1)+"~":f.C0.ESC+"[20~";break;case 121:_.key=c?f.C0.ESC+"[21;"+(c+1)+"~":f.C0.ESC+"[21~";break;case 122:_.key=c?f.C0.ESC+"[23;"+(c+1)+"~":f.C0.ESC+"[23~";break;case 123:_.key=c?f.C0.ESC+"[24;"+(c+1)+"~":f.C0.ESC+"[24~";break;default:if(!d.ctrlKey||d.shiftKey||d.altKey||d.metaKey)if(S&&!w||!d.altKey||d.metaKey)!S||d.altKey||d.ctrlKey||d.shiftKey||!d.metaKey?d.key&&!d.ctrlKey&&!d.altKey&&!d.metaKey&&d.keyCode>=48&&d.key.length===1?_.key=d.key:d.key&&d.ctrlKey&&(d.key==="_"&&(_.key=f.C0.US),d.key==="@"&&(_.key=f.C0.NUL)):d.keyCode===65&&(_.type=1);else{const o=g[d.keyCode],s=o==null?void 0:o[d.shiftKey?1:0];if(s)_.key=f.C0.ESC+s;else if(d.keyCode>=65&&d.keyCode<=90){const l=d.ctrlKey?d.keyCode-64:d.keyCode+32;let v=String.fromCharCode(l);d.shiftKey&&(v=v.toUpperCase()),_.key=f.C0.ESC+v}else if(d.keyCode===32)_.key=f.C0.ESC+(d.ctrlKey?f.C0.NUL:" ");else if(d.key==="Dead"&&d.code.startsWith("Key")){let l=d.code.slice(3,4);d.shiftKey||(l=l.toLowerCase()),_.key=f.C0.ESC+l,_.cancel=!0}}else d.keyCode>=65&&d.keyCode<=90?_.key=String.fromCharCode(d.keyCode-64):d.keyCode===32?_.key=f.C0.NUL:d.keyCode>=51&&d.keyCode<=55?_.key=String.fromCharCode(d.keyCode-51+27):d.keyCode===56?_.key=f.C0.DEL:d.keyCode===219?_.key=f.C0.ESC:d.keyCode===220?_.key=f.C0.FS:d.keyCode===221&&(_.key=f.C0.GS)}return _}},482:(m,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.Utf8ToUtf32=a.StringToUtf32=a.utf32ToString=a.stringFromCodePoint=void 0,a.stringFromCodePoint=function(u){return u>65535?(u-=65536,String.fromCharCode(55296+(u>>10))+String.fromCharCode(u%1024+56320)):String.fromCharCode(u)},a.utf32ToString=function(u,f=0,g=u.length){let d="";for(let p=f;p<g;++p){let S=u[p];S>65535?(S-=65536,d+=String.fromCharCode(55296+(S>>10))+String.fromCharCode(S%1024+56320)):d+=String.fromCharCode(S)}return d},a.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(u,f){const g=u.length;if(!g)return 0;let d=0,p=0;if(this._interim){const S=u.charCodeAt(p++);56320<=S&&S<=57343?f[d++]=1024*(this._interim-55296)+S-56320+65536:(f[d++]=this._interim,f[d++]=S),this._interim=0}for(let S=p;S<g;++S){const w=u.charCodeAt(S);if(55296<=w&&w<=56319){if(++S>=g)return this._interim=w,d;const _=u.charCodeAt(S);56320<=_&&_<=57343?f[d++]=1024*(w-55296)+_-56320+65536:(f[d++]=w,f[d++]=_)}else w!==65279&&(f[d++]=w)}return d}},a.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(u,f){const g=u.length;if(!g)return 0;let d,p,S,w,_=0,c=0,o=0;if(this.interim[0]){let v=!1,C=this.interim[0];C&=(224&C)==192?31:(240&C)==224?15:7;let x,k=0;for(;(x=63&this.interim[++k])&&k<4;)C<<=6,C|=x;const y=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,b=y-k;for(;o<b;){if(o>=g)return 0;if(x=u[o++],(192&x)!=128){o--,v=!0;break}this.interim[k++]=x,C<<=6,C|=63&x}v||(y===2?C<128?o--:f[_++]=C:y===3?C<2048||C>=55296&&C<=57343||C===65279||(f[_++]=C):C<65536||C>1114111||(f[_++]=C)),this.interim.fill(0)}const s=g-4;let l=o;for(;l<g;){for(;!(!(l<s)||128&(d=u[l])||128&(p=u[l+1])||128&(S=u[l+2])||128&(w=u[l+3]));)f[_++]=d,f[_++]=p,f[_++]=S,f[_++]=w,l+=4;if(d=u[l++],d<128)f[_++]=d;else if((224&d)==192){if(l>=g)return this.interim[0]=d,_;if(p=u[l++],(192&p)!=128){l--;continue}if(c=(31&d)<<6|63&p,c<128){l--;continue}f[_++]=c}else if((240&d)==224){if(l>=g)return this.interim[0]=d,_;if(p=u[l++],(192&p)!=128){l--;continue}if(l>=g)return this.interim[0]=d,this.interim[1]=p,_;if(S=u[l++],(192&S)!=128){l--;continue}if(c=(15&d)<<12|(63&p)<<6|63&S,c<2048||c>=55296&&c<=57343||c===65279)continue;f[_++]=c}else if((248&d)==240){if(l>=g)return this.interim[0]=d,_;if(p=u[l++],(192&p)!=128){l--;continue}if(l>=g)return this.interim[0]=d,this.interim[1]=p,_;if(S=u[l++],(192&S)!=128){l--;continue}if(l>=g)return this.interim[0]=d,this.interim[1]=p,this.interim[2]=S,_;if(w=u[l++],(192&w)!=128){l--;continue}if(c=(7&d)<<18|(63&p)<<12|(63&S)<<6|63&w,c<65536||c>1114111)continue;f[_++]=c}}return _}}},225:(m,a,u)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.UnicodeV6=void 0;const f=u(1480),g=[[768,879],[1155,1158],[1160,1161],[1425,1469],[1471,1471],[1473,1474],[1476,1477],[1479,1479],[1536,1539],[1552,1557],[1611,1630],[1648,1648],[1750,1764],[1767,1768],[1770,1773],[1807,1807],[1809,1809],[1840,1866],[1958,1968],[2027,2035],[2305,2306],[2364,2364],[2369,2376],[2381,2381],[2385,2388],[2402,2403],[2433,2433],[2492,2492],[2497,2500],[2509,2509],[2530,2531],[2561,2562],[2620,2620],[2625,2626],[2631,2632],[2635,2637],[2672,2673],[2689,2690],[2748,2748],[2753,2757],[2759,2760],[2765,2765],[2786,2787],[2817,2817],[2876,2876],[2879,2879],[2881,2883],[2893,2893],[2902,2902],[2946,2946],[3008,3008],[3021,3021],[3134,3136],[3142,3144],[3146,3149],[3157,3158],[3260,3260],[3263,3263],[3270,3270],[3276,3277],[3298,3299],[3393,3395],[3405,3405],[3530,3530],[3538,3540],[3542,3542],[3633,3633],[3636,3642],[3655,3662],[3761,3761],[3764,3769],[3771,3772],[3784,3789],[3864,3865],[3893,3893],[3895,3895],[3897,3897],[3953,3966],[3968,3972],[3974,3975],[3984,3991],[3993,4028],[4038,4038],[4141,4144],[4146,4146],[4150,4151],[4153,4153],[4184,4185],[4448,4607],[4959,4959],[5906,5908],[5938,5940],[5970,5971],[6002,6003],[6068,6069],[6071,6077],[6086,6086],[6089,6099],[6109,6109],[6155,6157],[6313,6313],[6432,6434],[6439,6440],[6450,6450],[6457,6459],[6679,6680],[6912,6915],[6964,6964],[6966,6970],[6972,6972],[6978,6978],[7019,7027],[7616,7626],[7678,7679],[8203,8207],[8234,8238],[8288,8291],[8298,8303],[8400,8431],[12330,12335],[12441,12442],[43014,43014],[43019,43019],[43045,43046],[64286,64286],[65024,65039],[65056,65059],[65279,65279],[65529,65531]],d=[[68097,68099],[68101,68102],[68108,68111],[68152,68154],[68159,68159],[119143,119145],[119155,119170],[119173,119179],[119210,119213],[119362,119364],[917505,917505],[917536,917631],[917760,917999]];let p;a.UnicodeV6=class{constructor(){if(this.version="6",!p){p=new Uint8Array(65536),p.fill(1),p[0]=0,p.fill(0,1,32),p.fill(0,127,160),p.fill(2,4352,4448),p[9001]=2,p[9002]=2,p.fill(2,11904,42192),p[12351]=1,p.fill(2,44032,55204),p.fill(2,63744,64256),p.fill(2,65040,65050),p.fill(2,65072,65136),p.fill(2,65280,65377),p.fill(2,65504,65511);for(let S=0;S<g.length;++S)p.fill(0,g[S][0],g[S][1]+1)}}wcwidth(S){return S<32?0:S<127?1:S<65536?p[S]:function(w,_){let c,o=0,s=_.length-1;if(w<_[0][0]||w>_[s][1])return!1;for(;s>=o;)if(c=o+s>>1,w>_[c][1])o=c+1;else{if(!(w<_[c][0]))return!0;s=c-1}return!1}(S,d)?0:S>=131072&&S<=196605||S>=196608&&S<=262141?2:1}charProperties(S,w){let _=this.wcwidth(S),c=_===0&&w!==0;if(c){const o=f.UnicodeService.extractWidth(w);o===0?c=!1:o>_&&(_=o)}return f.UnicodeService.createPropertyValue(0,_,c)}}},5981:(m,a,u)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.WriteBuffer=void 0;const f=u(8460),g=u(844);class d extends g.Disposable{constructor(S){super(),this._action=S,this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=0,this._isSyncWriting=!1,this._syncCalls=0,this._didUserInput=!1,this._onWriteParsed=this.register(new f.EventEmitter),this.onWriteParsed=this._onWriteParsed.event}handleUserInput(){this._didUserInput=!0}writeSync(S,w){if(w!==void 0&&this._syncCalls>w)return void(this._syncCalls=0);if(this._pendingData+=S.length,this._writeBuffer.push(S),this._callbacks.push(void 0),this._syncCalls++,this._isSyncWriting)return;let _;for(this._isSyncWriting=!0;_=this._writeBuffer.shift();){this._action(_);const c=this._callbacks.shift();c&&c()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(S,w){if(this._pendingData>5e7)throw new Error("write data discarded, use flow control to avoid losing data");if(!this._writeBuffer.length){if(this._bufferOffset=0,this._didUserInput)return this._didUserInput=!1,this._pendingData+=S.length,this._writeBuffer.push(S),this._callbacks.push(w),void this._innerWrite();setTimeout(()=>this._innerWrite())}this._pendingData+=S.length,this._writeBuffer.push(S),this._callbacks.push(w)}_innerWrite(S=0,w=!0){const _=S||Date.now();for(;this._writeBuffer.length>this._bufferOffset;){const c=this._writeBuffer[this._bufferOffset],o=this._action(c,w);if(o){const l=v=>Date.now()-_>=12?setTimeout(()=>this._innerWrite(0,v)):this._innerWrite(_,v);return void o.catch(v=>(queueMicrotask(()=>{throw v}),Promise.resolve(!1))).then(l)}const s=this._callbacks[this._bufferOffset];if(s&&s(),this._bufferOffset++,this._pendingData-=c.length,Date.now()-_>=12)break}this._writeBuffer.length>this._bufferOffset?(this._bufferOffset>50&&(this._writeBuffer=this._writeBuffer.slice(this._bufferOffset),this._callbacks=this._callbacks.slice(this._bufferOffset),this._bufferOffset=0),setTimeout(()=>this._innerWrite())):(this._writeBuffer.length=0,this._callbacks.length=0,this._pendingData=0,this._bufferOffset=0),this._onWriteParsed.fire()}}a.WriteBuffer=d},5941:(m,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.toRgbString=a.parseColor=void 0;const u=/^([\da-f])\/([\da-f])\/([\da-f])$|^([\da-f]{2})\/([\da-f]{2})\/([\da-f]{2})$|^([\da-f]{3})\/([\da-f]{3})\/([\da-f]{3})$|^([\da-f]{4})\/([\da-f]{4})\/([\da-f]{4})$/,f=/^[\da-f]+$/;function g(d,p){const S=d.toString(16),w=S.length<2?"0"+S:S;switch(p){case 4:return S[0];case 8:return w;case 12:return(w+w).slice(0,3);default:return w+w}}a.parseColor=function(d){if(!d)return;let p=d.toLowerCase();if(p.indexOf("rgb:")===0){p=p.slice(4);const S=u.exec(p);if(S){const w=S[1]?15:S[4]?255:S[7]?4095:65535;return[Math.round(parseInt(S[1]||S[4]||S[7]||S[10],16)/w*255),Math.round(parseInt(S[2]||S[5]||S[8]||S[11],16)/w*255),Math.round(parseInt(S[3]||S[6]||S[9]||S[12],16)/w*255)]}}else if(p.indexOf("#")===0&&(p=p.slice(1),f.exec(p)&&[3,6,9,12].includes(p.length))){const S=p.length/3,w=[0,0,0];for(let _=0;_<3;++_){const c=parseInt(p.slice(S*_,S*_+S),16);w[_]=S===1?c<<4:S===2?c:S===3?c>>4:c>>8}return w}},a.toRgbString=function(d,p=16){const[S,w,_]=d;return`rgb:${g(S,p)}/${g(w,p)}/${g(_,p)}`}},5770:(m,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.PAYLOAD_LIMIT=void 0,a.PAYLOAD_LIMIT=1e7},6351:(m,a,u)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.DcsHandler=a.DcsParser=void 0;const f=u(482),g=u(8742),d=u(5770),p=[];a.DcsParser=class{constructor(){this._handlers=Object.create(null),this._active=p,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=p}registerHandler(w,_){this._handlers[w]===void 0&&(this._handlers[w]=[]);const c=this._handlers[w];return c.push(_),{dispose:()=>{const o=c.indexOf(_);o!==-1&&c.splice(o,1)}}}clearHandler(w){this._handlers[w]&&delete this._handlers[w]}setHandlerFallback(w){this._handlerFb=w}reset(){if(this._active.length)for(let w=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;w>=0;--w)this._active[w].unhook(!1);this._stack.paused=!1,this._active=p,this._ident=0}hook(w,_){if(this.reset(),this._ident=w,this._active=this._handlers[w]||p,this._active.length)for(let c=this._active.length-1;c>=0;c--)this._active[c].hook(_);else this._handlerFb(this._ident,"HOOK",_)}put(w,_,c){if(this._active.length)for(let o=this._active.length-1;o>=0;o--)this._active[o].put(w,_,c);else this._handlerFb(this._ident,"PUT",(0,f.utf32ToString)(w,_,c))}unhook(w,_=!0){if(this._active.length){let c=!1,o=this._active.length-1,s=!1;if(this._stack.paused&&(o=this._stack.loopPosition-1,c=_,s=this._stack.fallThrough,this._stack.paused=!1),!s&&c===!1){for(;o>=0&&(c=this._active[o].unhook(w),c!==!0);o--)if(c instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=o,this._stack.fallThrough=!1,c;o--}for(;o>=0;o--)if(c=this._active[o].unhook(!1),c instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=o,this._stack.fallThrough=!0,c}else this._handlerFb(this._ident,"UNHOOK",w);this._active=p,this._ident=0}};const S=new g.Params;S.addParam(0),a.DcsHandler=class{constructor(w){this._handler=w,this._data="",this._params=S,this._hitLimit=!1}hook(w){this._params=w.length>1||w.params[0]?w.clone():S,this._data="",this._hitLimit=!1}put(w,_,c){this._hitLimit||(this._data+=(0,f.utf32ToString)(w,_,c),this._data.length>d.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}unhook(w){let _=!1;if(this._hitLimit)_=!1;else if(w&&(_=this._handler(this._data,this._params),_ instanceof Promise))return _.then(c=>(this._params=S,this._data="",this._hitLimit=!1,c));return this._params=S,this._data="",this._hitLimit=!1,_}}},2015:(m,a,u)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.EscapeSequenceParser=a.VT500_TRANSITION_TABLE=a.TransitionTable=void 0;const f=u(844),g=u(8742),d=u(6242),p=u(6351);class S{constructor(o){this.table=new Uint8Array(o)}setDefault(o,s){this.table.fill(o<<4|s)}add(o,s,l,v){this.table[s<<8|o]=l<<4|v}addMany(o,s,l,v){for(let C=0;C<o.length;C++)this.table[s<<8|o[C]]=l<<4|v}}a.TransitionTable=S;const w=160;a.VT500_TRANSITION_TABLE=function(){const c=new S(4095),o=Array.apply(null,Array(256)).map((k,y)=>y),s=(k,y)=>o.slice(k,y),l=s(32,127),v=s(0,24);v.push(25),v.push.apply(v,s(28,32));const C=s(0,14);let x;for(x in c.setDefault(1,0),c.addMany(l,0,2,0),C)c.addMany([24,26,153,154],x,3,0),c.addMany(s(128,144),x,3,0),c.addMany(s(144,152),x,3,0),c.add(156,x,0,0),c.add(27,x,11,1),c.add(157,x,4,8),c.addMany([152,158,159],x,0,7),c.add(155,x,11,3),c.add(144,x,11,9);return c.addMany(v,0,3,0),c.addMany(v,1,3,1),c.add(127,1,0,1),c.addMany(v,8,0,8),c.addMany(v,3,3,3),c.add(127,3,0,3),c.addMany(v,4,3,4),c.add(127,4,0,4),c.addMany(v,6,3,6),c.addMany(v,5,3,5),c.add(127,5,0,5),c.addMany(v,2,3,2),c.add(127,2,0,2),c.add(93,1,4,8),c.addMany(l,8,5,8),c.add(127,8,5,8),c.addMany([156,27,24,26,7],8,6,0),c.addMany(s(28,32),8,0,8),c.addMany([88,94,95],1,0,7),c.addMany(l,7,0,7),c.addMany(v,7,0,7),c.add(156,7,0,0),c.add(127,7,0,7),c.add(91,1,11,3),c.addMany(s(64,127),3,7,0),c.addMany(s(48,60),3,8,4),c.addMany([60,61,62,63],3,9,4),c.addMany(s(48,60),4,8,4),c.addMany(s(64,127),4,7,0),c.addMany([60,61,62,63],4,0,6),c.addMany(s(32,64),6,0,6),c.add(127,6,0,6),c.addMany(s(64,127),6,0,0),c.addMany(s(32,48),3,9,5),c.addMany(s(32,48),5,9,5),c.addMany(s(48,64),5,0,6),c.addMany(s(64,127),5,7,0),c.addMany(s(32,48),4,9,5),c.addMany(s(32,48),1,9,2),c.addMany(s(32,48),2,9,2),c.addMany(s(48,127),2,10,0),c.addMany(s(48,80),1,10,0),c.addMany(s(81,88),1,10,0),c.addMany([89,90,92],1,10,0),c.addMany(s(96,127),1,10,0),c.add(80,1,11,9),c.addMany(v,9,0,9),c.add(127,9,0,9),c.addMany(s(28,32),9,0,9),c.addMany(s(32,48),9,9,12),c.addMany(s(48,60),9,8,10),c.addMany([60,61,62,63],9,9,10),c.addMany(v,11,0,11),c.addMany(s(32,128),11,0,11),c.addMany(s(28,32),11,0,11),c.addMany(v,10,0,10),c.add(127,10,0,10),c.addMany(s(28,32),10,0,10),c.addMany(s(48,60),10,8,10),c.addMany([60,61,62,63],10,0,11),c.addMany(s(32,48),10,9,12),c.addMany(v,12,0,12),c.add(127,12,0,12),c.addMany(s(28,32),12,0,12),c.addMany(s(32,48),12,9,12),c.addMany(s(48,64),12,0,11),c.addMany(s(64,127),12,12,13),c.addMany(s(64,127),10,12,13),c.addMany(s(64,127),9,12,13),c.addMany(v,13,13,13),c.addMany(l,13,13,13),c.add(127,13,0,13),c.addMany([27,156,24,26],13,14,0),c.add(w,0,2,0),c.add(w,8,5,8),c.add(w,6,0,6),c.add(w,11,0,11),c.add(w,13,13,13),c}();class _ extends f.Disposable{constructor(o=a.VT500_TRANSITION_TABLE){super(),this._transitions=o,this._parseStack={state:0,handlers:[],handlerPos:0,transition:0,chunkPos:0},this.initialState=0,this.currentState=this.initialState,this._params=new g.Params,this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._printHandlerFb=(s,l,v)=>{},this._executeHandlerFb=s=>{},this._csiHandlerFb=(s,l)=>{},this._escHandlerFb=s=>{},this._errorHandlerFb=s=>s,this._printHandler=this._printHandlerFb,this._executeHandlers=Object.create(null),this._csiHandlers=Object.create(null),this._escHandlers=Object.create(null),this.register((0,f.toDisposable)(()=>{this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null)})),this._oscParser=this.register(new d.OscParser),this._dcsParser=this.register(new p.DcsParser),this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:"\\"},()=>!0)}_identifier(o,s=[64,126]){let l=0;if(o.prefix){if(o.prefix.length>1)throw new Error("only one byte as prefix supported");if(l=o.prefix.charCodeAt(0),l&&60>l||l>63)throw new Error("prefix must be in range 0x3c .. 0x3f")}if(o.intermediates){if(o.intermediates.length>2)throw new Error("only two bytes as intermediates are supported");for(let C=0;C<o.intermediates.length;++C){const x=o.intermediates.charCodeAt(C);if(32>x||x>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");l<<=8,l|=x}}if(o.final.length!==1)throw new Error("final must be a single byte");const v=o.final.charCodeAt(0);if(s[0]>v||v>s[1])throw new Error(`final must be in range ${s[0]} .. ${s[1]}`);return l<<=8,l|=v,l}identToString(o){const s=[];for(;o;)s.push(String.fromCharCode(255&o)),o>>=8;return s.reverse().join("")}setPrintHandler(o){this._printHandler=o}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(o,s){const l=this._identifier(o,[48,126]);this._escHandlers[l]===void 0&&(this._escHandlers[l]=[]);const v=this._escHandlers[l];return v.push(s),{dispose:()=>{const C=v.indexOf(s);C!==-1&&v.splice(C,1)}}}clearEscHandler(o){this._escHandlers[this._identifier(o,[48,126])]&&delete this._escHandlers[this._identifier(o,[48,126])]}setEscHandlerFallback(o){this._escHandlerFb=o}setExecuteHandler(o,s){this._executeHandlers[o.charCodeAt(0)]=s}clearExecuteHandler(o){this._executeHandlers[o.charCodeAt(0)]&&delete this._executeHandlers[o.charCodeAt(0)]}setExecuteHandlerFallback(o){this._executeHandlerFb=o}registerCsiHandler(o,s){const l=this._identifier(o);this._csiHandlers[l]===void 0&&(this._csiHandlers[l]=[]);const v=this._csiHandlers[l];return v.push(s),{dispose:()=>{const C=v.indexOf(s);C!==-1&&v.splice(C,1)}}}clearCsiHandler(o){this._csiHandlers[this._identifier(o)]&&delete this._csiHandlers[this._identifier(o)]}setCsiHandlerFallback(o){this._csiHandlerFb=o}registerDcsHandler(o,s){return this._dcsParser.registerHandler(this._identifier(o),s)}clearDcsHandler(o){this._dcsParser.clearHandler(this._identifier(o))}setDcsHandlerFallback(o){this._dcsParser.setHandlerFallback(o)}registerOscHandler(o,s){return this._oscParser.registerHandler(o,s)}clearOscHandler(o){this._oscParser.clearHandler(o)}setOscHandlerFallback(o){this._oscParser.setHandlerFallback(o)}setErrorHandler(o){this._errorHandler=o}clearErrorHandler(){this._errorHandler=this._errorHandlerFb}reset(){this.currentState=this.initialState,this._oscParser.reset(),this._dcsParser.reset(),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._parseStack.state!==0&&(this._parseStack.state=2,this._parseStack.handlers=[])}_preserveStack(o,s,l,v,C){this._parseStack.state=o,this._parseStack.handlers=s,this._parseStack.handlerPos=l,this._parseStack.transition=v,this._parseStack.chunkPos=C}parse(o,s,l){let v,C=0,x=0,k=0;if(this._parseStack.state)if(this._parseStack.state===2)this._parseStack.state=0,k=this._parseStack.chunkPos+1;else{if(l===void 0||this._parseStack.state===1)throw this._parseStack.state=1,new Error("improper continuation due to previous async handler, giving up parsing");const y=this._parseStack.handlers;let b=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(l===!1&&b>-1){for(;b>=0&&(v=y[b](this._params),v!==!0);b--)if(v instanceof Promise)return this._parseStack.handlerPos=b,v}this._parseStack.handlers=[];break;case 4:if(l===!1&&b>-1){for(;b>=0&&(v=y[b](),v!==!0);b--)if(v instanceof Promise)return this._parseStack.handlerPos=b,v}this._parseStack.handlers=[];break;case 6:if(C=o[this._parseStack.chunkPos],v=this._dcsParser.unhook(C!==24&&C!==26,l),v)return v;C===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(C=o[this._parseStack.chunkPos],v=this._oscParser.end(C!==24&&C!==26,l),v)return v;C===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0}this._parseStack.state=0,k=this._parseStack.chunkPos+1,this.precedingJoinState=0,this.currentState=15&this._parseStack.transition}for(let y=k;y<s;++y){switch(C=o[y],x=this._transitions.table[this.currentState<<8|(C<160?C:w)],x>>4){case 2:for(let T=y+1;;++T){if(T>=s||(C=o[T])<32||C>126&&C<w){this._printHandler(o,y,T),y=T-1;break}if(++T>=s||(C=o[T])<32||C>126&&C<w){this._printHandler(o,y,T),y=T-1;break}if(++T>=s||(C=o[T])<32||C>126&&C<w){this._printHandler(o,y,T),y=T-1;break}if(++T>=s||(C=o[T])<32||C>126&&C<w){this._printHandler(o,y,T),y=T-1;break}}break;case 3:this._executeHandlers[C]?this._executeHandlers[C]():this._executeHandlerFb(C),this.precedingJoinState=0;break;case 0:break;case 1:if(this._errorHandler({position:y,code:C,currentState:this.currentState,collect:this._collect,params:this._params,abort:!1}).abort)return;break;case 7:const b=this._csiHandlers[this._collect<<8|C];let R=b?b.length-1:-1;for(;R>=0&&(v=b[R](this._params),v!==!0);R--)if(v instanceof Promise)return this._preserveStack(3,b,R,x,y),v;R<0&&this._csiHandlerFb(this._collect<<8|C,this._params),this.precedingJoinState=0;break;case 8:do switch(C){case 59:this._params.addParam(0);break;case 58:this._params.addSubParam(-1);break;default:this._params.addDigit(C-48)}while(++y<s&&(C=o[y])>47&&C<60);y--;break;case 9:this._collect<<=8,this._collect|=C;break;case 10:const M=this._escHandlers[this._collect<<8|C];let B=M?M.length-1:-1;for(;B>=0&&(v=M[B](),v!==!0);B--)if(v instanceof Promise)return this._preserveStack(4,M,B,x,y),v;B<0&&this._escHandlerFb(this._collect<<8|C),this.precedingJoinState=0;break;case 11:this._params.reset(),this._params.addParam(0),this._collect=0;break;case 12:this._dcsParser.hook(this._collect<<8|C,this._params);break;case 13:for(let T=y+1;;++T)if(T>=s||(C=o[T])===24||C===26||C===27||C>127&&C<w){this._dcsParser.put(o,y,T),y=T-1;break}break;case 14:if(v=this._dcsParser.unhook(C!==24&&C!==26),v)return this._preserveStack(6,[],0,x,y),v;C===27&&(x|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0;break;case 4:this._oscParser.start();break;case 5:for(let T=y+1;;T++)if(T>=s||(C=o[T])<32||C>127&&C<w){this._oscParser.put(o,y,T),y=T-1;break}break;case 6:if(v=this._oscParser.end(C!==24&&C!==26),v)return this._preserveStack(5,[],0,x,y),v;C===27&&(x|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0}this.currentState=15&x}}}a.EscapeSequenceParser=_},6242:(m,a,u)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.OscHandler=a.OscParser=void 0;const f=u(5770),g=u(482),d=[];a.OscParser=class{constructor(){this._state=0,this._active=d,this._id=-1,this._handlers=Object.create(null),this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}registerHandler(p,S){this._handlers[p]===void 0&&(this._handlers[p]=[]);const w=this._handlers[p];return w.push(S),{dispose:()=>{const _=w.indexOf(S);_!==-1&&w.splice(_,1)}}}clearHandler(p){this._handlers[p]&&delete this._handlers[p]}setHandlerFallback(p){this._handlerFb=p}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=d}reset(){if(this._state===2)for(let p=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;p>=0;--p)this._active[p].end(!1);this._stack.paused=!1,this._active=d,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||d,this._active.length)for(let p=this._active.length-1;p>=0;p--)this._active[p].start();else this._handlerFb(this._id,"START")}_put(p,S,w){if(this._active.length)for(let _=this._active.length-1;_>=0;_--)this._active[_].put(p,S,w);else this._handlerFb(this._id,"PUT",(0,g.utf32ToString)(p,S,w))}start(){this.reset(),this._state=1}put(p,S,w){if(this._state!==3){if(this._state===1)for(;S<w;){const _=p[S++];if(_===59){this._state=2,this._start();break}if(_<48||57<_)return void(this._state=3);this._id===-1&&(this._id=0),this._id=10*this._id+_-48}this._state===2&&w-S>0&&this._put(p,S,w)}}end(p,S=!0){if(this._state!==0){if(this._state!==3)if(this._state===1&&this._start(),this._active.length){let w=!1,_=this._active.length-1,c=!1;if(this._stack.paused&&(_=this._stack.loopPosition-1,w=S,c=this._stack.fallThrough,this._stack.paused=!1),!c&&w===!1){for(;_>=0&&(w=this._active[_].end(p),w!==!0);_--)if(w instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=_,this._stack.fallThrough=!1,w;_--}for(;_>=0;_--)if(w=this._active[_].end(!1),w instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=_,this._stack.fallThrough=!0,w}else this._handlerFb(this._id,"END",p);this._active=d,this._id=-1,this._state=0}}},a.OscHandler=class{constructor(p){this._handler=p,this._data="",this._hitLimit=!1}start(){this._data="",this._hitLimit=!1}put(p,S,w){this._hitLimit||(this._data+=(0,g.utf32ToString)(p,S,w),this._data.length>f.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}end(p){let S=!1;if(this._hitLimit)S=!1;else if(p&&(S=this._handler(this._data),S instanceof Promise))return S.then(w=>(this._data="",this._hitLimit=!1,w));return this._data="",this._hitLimit=!1,S}}},8742:(m,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.Params=void 0;const u=2147483647;class f{static fromArray(d){const p=new f;if(!d.length)return p;for(let S=Array.isArray(d[0])?1:0;S<d.length;++S){const w=d[S];if(Array.isArray(w))for(let _=0;_<w.length;++_)p.addSubParam(w[_]);else p.addParam(w)}return p}constructor(d=32,p=32){if(this.maxLength=d,this.maxSubParamsLength=p,p>256)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(d),this.length=0,this._subParams=new Int32Array(p),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(d),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}clone(){const d=new f(this.maxLength,this.maxSubParamsLength);return d.params.set(this.params),d.length=this.length,d._subParams.set(this._subParams),d._subParamsLength=this._subParamsLength,d._subParamsIdx.set(this._subParamsIdx),d._rejectDigits=this._rejectDigits,d._rejectSubDigits=this._rejectSubDigits,d._digitIsSub=this._digitIsSub,d}toArray(){const d=[];for(let p=0;p<this.length;++p){d.push(this.params[p]);const S=this._subParamsIdx[p]>>8,w=255&this._subParamsIdx[p];w-S>0&&d.push(Array.prototype.slice.call(this._subParams,S,w))}return d}reset(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}addParam(d){if(this._digitIsSub=!1,this.length>=this.maxLength)this._rejectDigits=!0;else{if(d<-1)throw new Error("values lesser than -1 are not allowed");this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=d>u?u:d}}addSubParam(d){if(this._digitIsSub=!0,this.length)if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength)this._rejectSubDigits=!0;else{if(d<-1)throw new Error("values lesser than -1 are not allowed");this._subParams[this._subParamsLength++]=d>u?u:d,this._subParamsIdx[this.length-1]++}}hasSubParams(d){return(255&this._subParamsIdx[d])-(this._subParamsIdx[d]>>8)>0}getSubParams(d){const p=this._subParamsIdx[d]>>8,S=255&this._subParamsIdx[d];return S-p>0?this._subParams.subarray(p,S):null}getSubParamsAll(){const d={};for(let p=0;p<this.length;++p){const S=this._subParamsIdx[p]>>8,w=255&this._subParamsIdx[p];w-S>0&&(d[p]=this._subParams.slice(S,w))}return d}addDigit(d){let p;if(this._rejectDigits||!(p=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;const S=this._digitIsSub?this._subParams:this.params,w=S[p-1];S[p-1]=~w?Math.min(10*w+d,u):d}}a.Params=f},5741:(m,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.AddonManager=void 0,a.AddonManager=class{constructor(){this._addons=[]}dispose(){for(let u=this._addons.length-1;u>=0;u--)this._addons[u].instance.dispose()}loadAddon(u,f){const g={instance:f,dispose:f.dispose,isDisposed:!1};this._addons.push(g),f.dispose=()=>this._wrappedAddonDispose(g),f.activate(u)}_wrappedAddonDispose(u){if(u.isDisposed)return;let f=-1;for(let g=0;g<this._addons.length;g++)if(this._addons[g]===u){f=g;break}if(f===-1)throw new Error("Could not dispose an addon that has not been loaded");u.isDisposed=!0,u.dispose.apply(u.instance),this._addons.splice(f,1)}}},8771:(m,a,u)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.BufferApiView=void 0;const f=u(3785),g=u(511);a.BufferApiView=class{constructor(d,p){this._buffer=d,this.type=p}init(d){return this._buffer=d,this}get cursorY(){return this._buffer.y}get cursorX(){return this._buffer.x}get viewportY(){return this._buffer.ydisp}get baseY(){return this._buffer.ybase}get length(){return this._buffer.lines.length}getLine(d){const p=this._buffer.lines.get(d);if(p)return new f.BufferLineApiView(p)}getNullCell(){return new g.CellData}}},3785:(m,a,u)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.BufferLineApiView=void 0;const f=u(511);a.BufferLineApiView=class{constructor(g){this._line=g}get isWrapped(){return this._line.isWrapped}get length(){return this._line.length}getCell(g,d){if(!(g<0||g>=this._line.length))return d?(this._line.loadCell(g,d),d):this._line.loadCell(g,new f.CellData)}translateToString(g,d,p){return this._line.translateToString(g,d,p)}}},8285:(m,a,u)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.BufferNamespaceApi=void 0;const f=u(8771),g=u(8460),d=u(844);class p extends d.Disposable{constructor(w){super(),this._core=w,this._onBufferChange=this.register(new g.EventEmitter),this.onBufferChange=this._onBufferChange.event,this._normal=new f.BufferApiView(this._core.buffers.normal,"normal"),this._alternate=new f.BufferApiView(this._core.buffers.alt,"alternate"),this._core.buffers.onBufferActivate(()=>this._onBufferChange.fire(this.active))}get active(){if(this._core.buffers.active===this._core.buffers.normal)return this.normal;if(this._core.buffers.active===this._core.buffers.alt)return this.alternate;throw new Error("Active buffer is neither normal nor alternate")}get normal(){return this._normal.init(this._core.buffers.normal)}get alternate(){return this._alternate.init(this._core.buffers.alt)}}a.BufferNamespaceApi=p},7975:(m,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.ParserApi=void 0,a.ParserApi=class{constructor(u){this._core=u}registerCsiHandler(u,f){return this._core.registerCsiHandler(u,g=>f(g.toArray()))}addCsiHandler(u,f){return this.registerCsiHandler(u,f)}registerDcsHandler(u,f){return this._core.registerDcsHandler(u,(g,d)=>f(g,d.toArray()))}addDcsHandler(u,f){return this.registerDcsHandler(u,f)}registerEscHandler(u,f){return this._core.registerEscHandler(u,f)}addEscHandler(u,f){return this.registerEscHandler(u,f)}registerOscHandler(u,f){return this._core.registerOscHandler(u,f)}addOscHandler(u,f){return this.registerOscHandler(u,f)}}},7090:(m,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.UnicodeApi=void 0,a.UnicodeApi=class{constructor(u){this._core=u}register(u){this._core.unicodeService.register(u)}get versions(){return this._core.unicodeService.versions}get activeVersion(){return this._core.unicodeService.activeVersion}set activeVersion(u){this._core.unicodeService.activeVersion=u}}},744:function(m,a,u){var f=this&&this.__decorate||function(c,o,s,l){var v,C=arguments.length,x=C<3?o:l===null?l=Object.getOwnPropertyDescriptor(o,s):l;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")x=Reflect.decorate(c,o,s,l);else for(var k=c.length-1;k>=0;k--)(v=c[k])&&(x=(C<3?v(x):C>3?v(o,s,x):v(o,s))||x);return C>3&&x&&Object.defineProperty(o,s,x),x},g=this&&this.__param||function(c,o){return function(s,l){o(s,l,c)}};Object.defineProperty(a,"__esModule",{value:!0}),a.BufferService=a.MINIMUM_ROWS=a.MINIMUM_COLS=void 0;const d=u(8460),p=u(844),S=u(5295),w=u(2585);a.MINIMUM_COLS=2,a.MINIMUM_ROWS=1;let _=a.BufferService=class extends p.Disposable{get buffer(){return this.buffers.active}constructor(c){super(),this.isUserScrolling=!1,this._onResize=this.register(new d.EventEmitter),this.onResize=this._onResize.event,this._onScroll=this.register(new d.EventEmitter),this.onScroll=this._onScroll.event,this.cols=Math.max(c.rawOptions.cols||0,a.MINIMUM_COLS),this.rows=Math.max(c.rawOptions.rows||0,a.MINIMUM_ROWS),this.buffers=this.register(new S.BufferSet(c,this))}resize(c,o){this.cols=c,this.rows=o,this.buffers.resize(c,o),this._onResize.fire({cols:c,rows:o})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(c,o=!1){const s=this.buffer;let l;l=this._cachedBlankLine,l&&l.length===this.cols&&l.getFg(0)===c.fg&&l.getBg(0)===c.bg||(l=s.getBlankLine(c,o),this._cachedBlankLine=l),l.isWrapped=o;const v=s.ybase+s.scrollTop,C=s.ybase+s.scrollBottom;if(s.scrollTop===0){const x=s.lines.isFull;C===s.lines.length-1?x?s.lines.recycle().copyFrom(l):s.lines.push(l.clone()):s.lines.splice(C+1,0,l.clone()),x?this.isUserScrolling&&(s.ydisp=Math.max(s.ydisp-1,0)):(s.ybase++,this.isUserScrolling||s.ydisp++)}else{const x=C-v+1;s.lines.shiftElements(v+1,x-1,-1),s.lines.set(C,l.clone())}this.isUserScrolling||(s.ydisp=s.ybase),this._onScroll.fire(s.ydisp)}scrollLines(c,o,s){const l=this.buffer;if(c<0){if(l.ydisp===0)return;this.isUserScrolling=!0}else c+l.ydisp>=l.ybase&&(this.isUserScrolling=!1);const v=l.ydisp;l.ydisp=Math.max(Math.min(l.ydisp+c,l.ybase),0),v!==l.ydisp&&(o||this._onScroll.fire(l.ydisp))}};a.BufferService=_=f([g(0,w.IOptionsService)],_)},7994:(m,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.CharsetService=void 0,a.CharsetService=class{constructor(){this.glevel=0,this._charsets=[]}reset(){this.charset=void 0,this._charsets=[],this.glevel=0}setgLevel(u){this.glevel=u,this.charset=this._charsets[u]}setgCharset(u,f){this._charsets[u]=f,this.glevel===u&&(this.charset=f)}}},1753:function(m,a,u){var f=this&&this.__decorate||function(l,v,C,x){var k,y=arguments.length,b=y<3?v:x===null?x=Object.getOwnPropertyDescriptor(v,C):x;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")b=Reflect.decorate(l,v,C,x);else for(var R=l.length-1;R>=0;R--)(k=l[R])&&(b=(y<3?k(b):y>3?k(v,C,b):k(v,C))||b);return y>3&&b&&Object.defineProperty(v,C,b),b},g=this&&this.__param||function(l,v){return function(C,x){v(C,x,l)}};Object.defineProperty(a,"__esModule",{value:!0}),a.CoreMouseService=void 0;const d=u(2585),p=u(8460),S=u(844),w={NONE:{events:0,restrict:()=>!1},X10:{events:1,restrict:l=>l.button!==4&&l.action===1&&(l.ctrl=!1,l.alt=!1,l.shift=!1,!0)},VT200:{events:19,restrict:l=>l.action!==32},DRAG:{events:23,restrict:l=>l.action!==32||l.button!==3},ANY:{events:31,restrict:l=>!0}};function _(l,v){let C=(l.ctrl?16:0)|(l.shift?4:0)|(l.alt?8:0);return l.button===4?(C|=64,C|=l.action):(C|=3&l.button,4&l.button&&(C|=64),8&l.button&&(C|=128),l.action===32?C|=32:l.action!==0||v||(C|=3)),C}const c=String.fromCharCode,o={DEFAULT:l=>{const v=[_(l,!1)+32,l.col+32,l.row+32];return v[0]>255||v[1]>255||v[2]>255?"":`\x1B[M${c(v[0])}${c(v[1])}${c(v[2])}`},SGR:l=>{const v=l.action===0&&l.button!==4?"m":"M";return`\x1B[<${_(l,!0)};${l.col};${l.row}${v}`},SGR_PIXELS:l=>{const v=l.action===0&&l.button!==4?"m":"M";return`\x1B[<${_(l,!0)};${l.x};${l.y}${v}`}};let s=a.CoreMouseService=class extends S.Disposable{constructor(l,v){super(),this._bufferService=l,this._coreService=v,this._protocols={},this._encodings={},this._activeProtocol="",this._activeEncoding="",this._lastEvent=null,this._onProtocolChange=this.register(new p.EventEmitter),this.onProtocolChange=this._onProtocolChange.event;for(const C of Object.keys(w))this.addProtocol(C,w[C]);for(const C of Object.keys(o))this.addEncoding(C,o[C]);this.reset()}addProtocol(l,v){this._protocols[l]=v}addEncoding(l,v){this._encodings[l]=v}get activeProtocol(){return this._activeProtocol}get areMouseEventsActive(){return this._protocols[this._activeProtocol].events!==0}set activeProtocol(l){if(!this._protocols[l])throw new Error(`unknown protocol "${l}"`);this._activeProtocol=l,this._onProtocolChange.fire(this._protocols[l].events)}get activeEncoding(){return this._activeEncoding}set activeEncoding(l){if(!this._encodings[l])throw new Error(`unknown encoding "${l}"`);this._activeEncoding=l}reset(){this.activeProtocol="NONE",this.activeEncoding="DEFAULT",this._lastEvent=null}triggerMouseEvent(l){if(l.col<0||l.col>=this._bufferService.cols||l.row<0||l.row>=this._bufferService.rows||l.button===4&&l.action===32||l.button===3&&l.action!==32||l.button!==4&&(l.action===2||l.action===3)||(l.col++,l.row++,l.action===32&&this._lastEvent&&this._equalEvents(this._lastEvent,l,this._activeEncoding==="SGR_PIXELS"))||!this._protocols[this._activeProtocol].restrict(l))return!1;const v=this._encodings[this._activeEncoding](l);return v&&(this._activeEncoding==="DEFAULT"?this._coreService.triggerBinaryEvent(v):this._coreService.triggerDataEvent(v,!0)),this._lastEvent=l,!0}explainEvents(l){return{down:!!(1&l),up:!!(2&l),drag:!!(4&l),move:!!(8&l),wheel:!!(16&l)}}_equalEvents(l,v,C){if(C){if(l.x!==v.x||l.y!==v.y)return!1}else if(l.col!==v.col||l.row!==v.row)return!1;return l.button===v.button&&l.action===v.action&&l.ctrl===v.ctrl&&l.alt===v.alt&&l.shift===v.shift}};a.CoreMouseService=s=f([g(0,d.IBufferService),g(1,d.ICoreService)],s)},6975:function(m,a,u){var f=this&&this.__decorate||function(s,l,v,C){var x,k=arguments.length,y=k<3?l:C===null?C=Object.getOwnPropertyDescriptor(l,v):C;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")y=Reflect.decorate(s,l,v,C);else for(var b=s.length-1;b>=0;b--)(x=s[b])&&(y=(k<3?x(y):k>3?x(l,v,y):x(l,v))||y);return k>3&&y&&Object.defineProperty(l,v,y),y},g=this&&this.__param||function(s,l){return function(v,C){l(v,C,s)}};Object.defineProperty(a,"__esModule",{value:!0}),a.CoreService=void 0;const d=u(1439),p=u(8460),S=u(844),w=u(2585),_=Object.freeze({insertMode:!1}),c=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,origin:!1,reverseWraparound:!1,sendFocus:!1,wraparound:!0});let o=a.CoreService=class extends S.Disposable{constructor(s,l,v){super(),this._bufferService=s,this._logService=l,this._optionsService=v,this.isCursorInitialized=!1,this.isCursorHidden=!1,this._onData=this.register(new p.EventEmitter),this.onData=this._onData.event,this._onUserInput=this.register(new p.EventEmitter),this.onUserInput=this._onUserInput.event,this._onBinary=this.register(new p.EventEmitter),this.onBinary=this._onBinary.event,this._onRequestScrollToBottom=this.register(new p.EventEmitter),this.onRequestScrollToBottom=this._onRequestScrollToBottom.event,this.modes=(0,d.clone)(_),this.decPrivateModes=(0,d.clone)(c)}reset(){this.modes=(0,d.clone)(_),this.decPrivateModes=(0,d.clone)(c)}triggerDataEvent(s,l=!1){if(this._optionsService.rawOptions.disableStdin)return;const v=this._bufferService.buffer;l&&this._optionsService.rawOptions.scrollOnUserInput&&v.ybase!==v.ydisp&&this._onRequestScrollToBottom.fire(),l&&this._onUserInput.fire(),this._logService.debug(`sending data "${s}"`,()=>s.split("").map(C=>C.charCodeAt(0))),this._onData.fire(s)}triggerBinaryEvent(s){this._optionsService.rawOptions.disableStdin||(this._logService.debug(`sending binary "${s}"`,()=>s.split("").map(l=>l.charCodeAt(0))),this._onBinary.fire(s))}};a.CoreService=o=f([g(0,w.IBufferService),g(1,w.ILogService),g(2,w.IOptionsService)],o)},9074:(m,a,u)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.DecorationService=void 0;const f=u(8055),g=u(8460),d=u(844),p=u(6106);let S=0,w=0;class _ extends d.Disposable{get decorations(){return this._decorations.values()}constructor(){super(),this._decorations=new p.SortedList(s=>s==null?void 0:s.marker.line),this._onDecorationRegistered=this.register(new g.EventEmitter),this.onDecorationRegistered=this._onDecorationRegistered.event,this._onDecorationRemoved=this.register(new g.EventEmitter),this.onDecorationRemoved=this._onDecorationRemoved.event,this.register((0,d.toDisposable)(()=>this.reset()))}registerDecoration(s){if(s.marker.isDisposed)return;const l=new c(s);if(l){const v=l.marker.onDispose(()=>l.dispose());l.onDispose(()=>{l&&(this._decorations.delete(l)&&this._onDecorationRemoved.fire(l),v.dispose())}),this._decorations.insert(l),this._onDecorationRegistered.fire(l)}return l}reset(){for(const s of this._decorations.values())s.dispose();this._decorations.clear()}*getDecorationsAtCell(s,l,v){let C=0,x=0;for(const k of this._decorations.getKeyIterator(l))C=k.options.x??0,x=C+(k.options.width??1),s>=C&&s<x&&(!v||(k.options.layer??"bottom")===v)&&(yield k)}forEachDecorationAtCell(s,l,v,C){this._decorations.forEachByKey(l,x=>{S=x.options.x??0,w=S+(x.options.width??1),s>=S&&s<w&&(!v||(x.options.layer??"bottom")===v)&&C(x)})}}a.DecorationService=_;class c extends d.Disposable{get isDisposed(){return this._isDisposed}get backgroundColorRGB(){return this._cachedBg===null&&(this.options.backgroundColor?this._cachedBg=f.css.toColor(this.options.backgroundColor):this._cachedBg=void 0),this._cachedBg}get foregroundColorRGB(){return this._cachedFg===null&&(this.options.foregroundColor?this._cachedFg=f.css.toColor(this.options.foregroundColor):this._cachedFg=void 0),this._cachedFg}constructor(s){super(),this.options=s,this.onRenderEmitter=this.register(new g.EventEmitter),this.onRender=this.onRenderEmitter.event,this._onDispose=this.register(new g.EventEmitter),this.onDispose=this._onDispose.event,this._cachedBg=null,this._cachedFg=null,this.marker=s.marker,this.options.overviewRulerOptions&&!this.options.overviewRulerOptions.position&&(this.options.overviewRulerOptions.position="full")}dispose(){this._onDispose.fire(),super.dispose()}}},4348:(m,a,u)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.InstantiationService=a.ServiceCollection=void 0;const f=u(2585),g=u(8343);class d{constructor(...S){this._entries=new Map;for(const[w,_]of S)this.set(w,_)}set(S,w){const _=this._entries.get(S);return this._entries.set(S,w),_}forEach(S){for(const[w,_]of this._entries.entries())S(w,_)}has(S){return this._entries.has(S)}get(S){return this._entries.get(S)}}a.ServiceCollection=d,a.InstantiationService=class{constructor(){this._services=new d,this._services.set(f.IInstantiationService,this)}setService(p,S){this._services.set(p,S)}getService(p){return this._services.get(p)}createInstance(p,...S){const w=(0,g.getServiceDependencies)(p).sort((o,s)=>o.index-s.index),_=[];for(const o of w){const s=this._services.get(o.id);if(!s)throw new Error(`[createInstance] ${p.name} depends on UNKNOWN service ${o.id}.`);_.push(s)}const c=w.length>0?w[0].index:S.length;if(S.length!==c)throw new Error(`[createInstance] First service dependency of ${p.name} at position ${c+1} conflicts with ${S.length} static arguments`);return new p(...S,..._)}}},7866:function(m,a,u){var f=this&&this.__decorate||function(c,o,s,l){var v,C=arguments.length,x=C<3?o:l===null?l=Object.getOwnPropertyDescriptor(o,s):l;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")x=Reflect.decorate(c,o,s,l);else for(var k=c.length-1;k>=0;k--)(v=c[k])&&(x=(C<3?v(x):C>3?v(o,s,x):v(o,s))||x);return C>3&&x&&Object.defineProperty(o,s,x),x},g=this&&this.__param||function(c,o){return function(s,l){o(s,l,c)}};Object.defineProperty(a,"__esModule",{value:!0}),a.traceCall=a.setTraceLogger=a.LogService=void 0;const d=u(844),p=u(2585),S={trace:p.LogLevelEnum.TRACE,debug:p.LogLevelEnum.DEBUG,info:p.LogLevelEnum.INFO,warn:p.LogLevelEnum.WARN,error:p.LogLevelEnum.ERROR,off:p.LogLevelEnum.OFF};let w,_=a.LogService=class extends d.Disposable{get logLevel(){return this._logLevel}constructor(c){super(),this._optionsService=c,this._logLevel=p.LogLevelEnum.OFF,this._updateLogLevel(),this.register(this._optionsService.onSpecificOptionChange("logLevel",()=>this._updateLogLevel())),w=this}_updateLogLevel(){this._logLevel=S[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(c){for(let o=0;o<c.length;o++)typeof c[o]=="function"&&(c[o]=c[o]())}_log(c,o,s){this._evalLazyOptionalParams(s),c.call(console,(this._optionsService.options.logger?"":"xterm.js: ")+o,...s)}trace(c,...o){var s;this._logLevel<=p.LogLevelEnum.TRACE&&this._log(((s=this._optionsService.options.logger)==null?void 0:s.trace.bind(this._optionsService.options.logger))??console.log,c,o)}debug(c,...o){var s;this._logLevel<=p.LogLevelEnum.DEBUG&&this._log(((s=this._optionsService.options.logger)==null?void 0:s.debug.bind(this._optionsService.options.logger))??console.log,c,o)}info(c,...o){var s;this._logLevel<=p.LogLevelEnum.INFO&&this._log(((s=this._optionsService.options.logger)==null?void 0:s.info.bind(this._optionsService.options.logger))??console.info,c,o)}warn(c,...o){var s;this._logLevel<=p.LogLevelEnum.WARN&&this._log(((s=this._optionsService.options.logger)==null?void 0:s.warn.bind(this._optionsService.options.logger))??console.warn,c,o)}error(c,...o){var s;this._logLevel<=p.LogLevelEnum.ERROR&&this._log(((s=this._optionsService.options.logger)==null?void 0:s.error.bind(this._optionsService.options.logger))??console.error,c,o)}};a.LogService=_=f([g(0,p.IOptionsService)],_),a.setTraceLogger=function(c){w=c},a.traceCall=function(c,o,s){if(typeof s.value!="function")throw new Error("not supported");const l=s.value;s.value=function(...v){if(w.logLevel!==p.LogLevelEnum.TRACE)return l.apply(this,v);w.trace(`GlyphRenderer#${l.name}(${v.map(x=>JSON.stringify(x)).join(", ")})`);const C=l.apply(this,v);return w.trace(`GlyphRenderer#${l.name} return`,C),C}}},7302:(m,a,u)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.OptionsService=a.DEFAULT_OPTIONS=void 0;const f=u(8460),g=u(844),d=u(6114);a.DEFAULT_OPTIONS={cols:80,rows:24,cursorBlink:!1,cursorStyle:"block",cursorWidth:1,cursorInactiveStyle:"outline",customGlyphs:!0,drawBoldTextInBrightColors:!0,documentOverride:null,fastScrollModifier:"alt",fastScrollSensitivity:5,fontFamily:"courier-new, courier, monospace",fontSize:15,fontWeight:"normal",fontWeightBold:"bold",ignoreBracketedPasteMode:!1,lineHeight:1,letterSpacing:0,linkHandler:null,logLevel:"info",logger:null,scrollback:1e3,scrollOnUserInput:!0,scrollSensitivity:1,screenReaderMode:!1,smoothScrollDuration:0,macOptionIsMeta:!1,macOptionClickForcesSelection:!1,minimumContrastRatio:1,disableStdin:!1,allowProposedApi:!1,allowTransparency:!1,tabStopWidth:8,theme:{},rescaleOverlappingGlyphs:!1,rightClickSelectsWord:d.isMac,windowOptions:{},windowsMode:!1,windowsPty:{},wordSeparator:" ()[]{}',\"`",altClickMovesCursor:!0,convertEol:!1,termName:"xterm",cancelEvents:!1,overviewRulerWidth:0};const p=["normal","bold","100","200","300","400","500","600","700","800","900"];class S extends g.Disposable{constructor(_){super(),this._onOptionChange=this.register(new f.EventEmitter),this.onOptionChange=this._onOptionChange.event;const c={...a.DEFAULT_OPTIONS};for(const o in _)if(o in c)try{const s=_[o];c[o]=this._sanitizeAndValidateOption(o,s)}catch(s){console.error(s)}this.rawOptions=c,this.options={...c},this._setupOptions(),this.register((0,g.toDisposable)(()=>{this.rawOptions.linkHandler=null,this.rawOptions.documentOverride=null}))}onSpecificOptionChange(_,c){return this.onOptionChange(o=>{o===_&&c(this.rawOptions[_])})}onMultipleOptionChange(_,c){return this.onOptionChange(o=>{_.indexOf(o)!==-1&&c()})}_setupOptions(){const _=o=>{if(!(o in a.DEFAULT_OPTIONS))throw new Error(`No option with key "${o}"`);return this.rawOptions[o]},c=(o,s)=>{if(!(o in a.DEFAULT_OPTIONS))throw new Error(`No option with key "${o}"`);s=this._sanitizeAndValidateOption(o,s),this.rawOptions[o]!==s&&(this.rawOptions[o]=s,this._onOptionChange.fire(o))};for(const o in this.rawOptions){const s={get:_.bind(this,o),set:c.bind(this,o)};Object.defineProperty(this.options,o,s)}}_sanitizeAndValidateOption(_,c){switch(_){case"cursorStyle":if(c||(c=a.DEFAULT_OPTIONS[_]),!function(o){return o==="block"||o==="underline"||o==="bar"}(c))throw new Error(`"${c}" is not a valid value for ${_}`);break;case"wordSeparator":c||(c=a.DEFAULT_OPTIONS[_]);break;case"fontWeight":case"fontWeightBold":if(typeof c=="number"&&1<=c&&c<=1e3)break;c=p.includes(c)?c:a.DEFAULT_OPTIONS[_];break;case"cursorWidth":c=Math.floor(c);case"lineHeight":case"tabStopWidth":if(c<1)throw new Error(`${_} cannot be less than 1, value: ${c}`);break;case"minimumContrastRatio":c=Math.max(1,Math.min(21,Math.round(10*c)/10));break;case"scrollback":if((c=Math.min(c,4294967295))<0)throw new Error(`${_} cannot be less than 0, value: ${c}`);break;case"fastScrollSensitivity":case"scrollSensitivity":if(c<=0)throw new Error(`${_} cannot be less than or equal to 0, value: ${c}`);break;case"rows":case"cols":if(!c&&c!==0)throw new Error(`${_} must be numeric, value: ${c}`);break;case"windowsPty":c=c??{}}return c}}a.OptionsService=S},2660:function(m,a,u){var f=this&&this.__decorate||function(S,w,_,c){var o,s=arguments.length,l=s<3?w:c===null?c=Object.getOwnPropertyDescriptor(w,_):c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")l=Reflect.decorate(S,w,_,c);else for(var v=S.length-1;v>=0;v--)(o=S[v])&&(l=(s<3?o(l):s>3?o(w,_,l):o(w,_))||l);return s>3&&l&&Object.defineProperty(w,_,l),l},g=this&&this.__param||function(S,w){return function(_,c){w(_,c,S)}};Object.defineProperty(a,"__esModule",{value:!0}),a.OscLinkService=void 0;const d=u(2585);let p=a.OscLinkService=class{constructor(S){this._bufferService=S,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(S){const w=this._bufferService.buffer;if(S.id===void 0){const v=w.addMarker(w.ybase+w.y),C={data:S,id:this._nextId++,lines:[v]};return v.onDispose(()=>this._removeMarkerFromLink(C,v)),this._dataByLinkId.set(C.id,C),C.id}const _=S,c=this._getEntryIdKey(_),o=this._entriesWithId.get(c);if(o)return this.addLineToLink(o.id,w.ybase+w.y),o.id;const s=w.addMarker(w.ybase+w.y),l={id:this._nextId++,key:this._getEntryIdKey(_),data:_,lines:[s]};return s.onDispose(()=>this._removeMarkerFromLink(l,s)),this._entriesWithId.set(l.key,l),this._dataByLinkId.set(l.id,l),l.id}addLineToLink(S,w){const _=this._dataByLinkId.get(S);if(_&&_.lines.every(c=>c.line!==w)){const c=this._bufferService.buffer.addMarker(w);_.lines.push(c),c.onDispose(()=>this._removeMarkerFromLink(_,c))}}getLinkData(S){var w;return(w=this._dataByLinkId.get(S))==null?void 0:w.data}_getEntryIdKey(S){return`${S.id};;${S.uri}`}_removeMarkerFromLink(S,w){const _=S.lines.indexOf(w);_!==-1&&(S.lines.splice(_,1),S.lines.length===0&&(S.data.id!==void 0&&this._entriesWithId.delete(S.key),this._dataByLinkId.delete(S.id)))}};a.OscLinkService=p=f([g(0,d.IBufferService)],p)},8343:(m,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.createDecorator=a.getServiceDependencies=a.serviceRegistry=void 0;const u="di$target",f="di$dependencies";a.serviceRegistry=new Map,a.getServiceDependencies=function(g){return g[f]||[]},a.createDecorator=function(g){if(a.serviceRegistry.has(g))return a.serviceRegistry.get(g);const d=function(p,S,w){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");(function(_,c,o){c[u]===c?c[f].push({id:_,index:o}):(c[f]=[{id:_,index:o}],c[u]=c)})(d,p,w)};return d.toString=()=>g,a.serviceRegistry.set(g,d),d}},2585:(m,a,u)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.IDecorationService=a.IUnicodeService=a.IOscLinkService=a.IOptionsService=a.ILogService=a.LogLevelEnum=a.IInstantiationService=a.ICharsetService=a.ICoreService=a.ICoreMouseService=a.IBufferService=void 0;const f=u(8343);var g;a.IBufferService=(0,f.createDecorator)("BufferService"),a.ICoreMouseService=(0,f.createDecorator)("CoreMouseService"),a.ICoreService=(0,f.createDecorator)("CoreService"),a.ICharsetService=(0,f.createDecorator)("CharsetService"),a.IInstantiationService=(0,f.createDecorator)("InstantiationService"),function(d){d[d.TRACE=0]="TRACE",d[d.DEBUG=1]="DEBUG",d[d.INFO=2]="INFO",d[d.WARN=3]="WARN",d[d.ERROR=4]="ERROR",d[d.OFF=5]="OFF"}(g||(a.LogLevelEnum=g={})),a.ILogService=(0,f.createDecorator)("LogService"),a.IOptionsService=(0,f.createDecorator)("OptionsService"),a.IOscLinkService=(0,f.createDecorator)("OscLinkService"),a.IUnicodeService=(0,f.createDecorator)("UnicodeService"),a.IDecorationService=(0,f.createDecorator)("DecorationService")},1480:(m,a,u)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.UnicodeService=void 0;const f=u(8460),g=u(225);class d{static extractShouldJoin(S){return(1&S)!=0}static extractWidth(S){return S>>1&3}static extractCharKind(S){return S>>3}static createPropertyValue(S,w,_=!1){return(16777215&S)<<3|(3&w)<<1|(_?1:0)}constructor(){this._providers=Object.create(null),this._active="",this._onChange=new f.EventEmitter,this.onChange=this._onChange.event;const S=new g.UnicodeV6;this.register(S),this._active=S.version,this._activeProvider=S}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(S){if(!this._providers[S])throw new Error(`unknown Unicode version "${S}"`);this._active=S,this._activeProvider=this._providers[S],this._onChange.fire(S)}register(S){this._providers[S.version]=S}wcwidth(S){return this._activeProvider.wcwidth(S)}getStringCellWidth(S){let w=0,_=0;const c=S.length;for(let o=0;o<c;++o){let s=S.charCodeAt(o);if(55296<=s&&s<=56319){if(++o>=c)return w+this.wcwidth(s);const C=S.charCodeAt(o);56320<=C&&C<=57343?s=1024*(s-55296)+C-56320+65536:w+=this.wcwidth(C)}const l=this.charProperties(s,_);let v=d.extractWidth(l);d.extractShouldJoin(l)&&(v-=d.extractWidth(_)),w+=v,_=l}return w}charProperties(S,w){return this._activeProvider.charProperties(S,w)}}a.UnicodeService=d}},i={};function n(m){var a=i[m];if(a!==void 0)return a.exports;var u=i[m]={exports:{}};return r[m].call(u.exports,u,u.exports,n),u.exports}var h={};return(()=>{var m=h;Object.defineProperty(m,"__esModule",{value:!0}),m.Terminal=void 0;const a=n(9042),u=n(3236),f=n(844),g=n(5741),d=n(8285),p=n(7975),S=n(7090),w=["cols","rows"];class _ extends f.Disposable{constructor(o){super(),this._core=this.register(new u.Terminal(o)),this._addonManager=this.register(new g.AddonManager),this._publicOptions={...this._core.options};const s=v=>this._core.options[v],l=(v,C)=>{this._checkReadonlyOptions(v),this._core.options[v]=C};for(const v in this._core.options){const C={get:s.bind(this,v),set:l.bind(this,v)};Object.defineProperty(this._publicOptions,v,C)}}_checkReadonlyOptions(o){if(w.includes(o))throw new Error(`Option "${o}" can only be set in the constructor`)}_checkProposedApi(){if(!this._core.optionsService.rawOptions.allowProposedApi)throw new Error("You must set the allowProposedApi option to true to use proposed API")}get onBell(){return this._core.onBell}get onBinary(){return this._core.onBinary}get onCursorMove(){return this._core.onCursorMove}get onData(){return this._core.onData}get onKey(){return this._core.onKey}get onLineFeed(){return this._core.onLineFeed}get onRender(){return this._core.onRender}get onResize(){return this._core.onResize}get onScroll(){return this._core.onScroll}get onSelectionChange(){return this._core.onSelectionChange}get onTitleChange(){return this._core.onTitleChange}get onWriteParsed(){return this._core.onWriteParsed}get element(){return this._core.element}get parser(){return this._parser||(this._parser=new p.ParserApi(this._core)),this._parser}get unicode(){return this._checkProposedApi(),new S.UnicodeApi(this._core)}get textarea(){return this._core.textarea}get rows(){return this._core.rows}get cols(){return this._core.cols}get buffer(){return this._buffer||(this._buffer=this.register(new d.BufferNamespaceApi(this._core))),this._buffer}get markers(){return this._checkProposedApi(),this._core.markers}get modes(){const o=this._core.coreService.decPrivateModes;let s="none";switch(this._core.coreMouseService.activeProtocol){case"X10":s="x10";break;case"VT200":s="vt200";break;case"DRAG":s="drag";break;case"ANY":s="any"}return{applicationCursorKeysMode:o.applicationCursorKeys,applicationKeypadMode:o.applicationKeypad,bracketedPasteMode:o.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:s,originMode:o.origin,reverseWraparoundMode:o.reverseWraparound,sendFocusMode:o.sendFocus,wraparoundMode:o.wraparound}}get options(){return this._publicOptions}set options(o){for(const s in o)this._publicOptions[s]=o[s]}blur(){this._core.blur()}focus(){this._core.focus()}input(o,s=!0){this._core.input(o,s)}resize(o,s){this._verifyIntegers(o,s),this._core.resize(o,s)}open(o){this._core.open(o)}attachCustomKeyEventHandler(o){this._core.attachCustomKeyEventHandler(o)}attachCustomWheelEventHandler(o){this._core.attachCustomWheelEventHandler(o)}registerLinkProvider(o){return this._core.registerLinkProvider(o)}registerCharacterJoiner(o){return this._checkProposedApi(),this._core.registerCharacterJoiner(o)}deregisterCharacterJoiner(o){this._checkProposedApi(),this._core.deregisterCharacterJoiner(o)}registerMarker(o=0){return this._verifyIntegers(o),this._core.registerMarker(o)}registerDecoration(o){return this._checkProposedApi(),this._verifyPositiveIntegers(o.x??0,o.width??0,o.height??0),this._core.registerDecoration(o)}hasSelection(){return this._core.hasSelection()}select(o,s,l){this._verifyIntegers(o,s,l),this._core.select(o,s,l)}getSelection(){return this._core.getSelection()}getSelectionPosition(){return this._core.getSelectionPosition()}clearSelection(){this._core.clearSelection()}selectAll(){this._core.selectAll()}selectLines(o,s){this._verifyIntegers(o,s),this._core.selectLines(o,s)}dispose(){super.dispose()}scrollLines(o){this._verifyIntegers(o),this._core.scrollLines(o)}scrollPages(o){this._verifyIntegers(o),this._core.scrollPages(o)}scrollToTop(){this._core.scrollToTop()}scrollToBottom(){this._core.scrollToBottom()}scrollToLine(o){this._verifyIntegers(o),this._core.scrollToLine(o)}clear(){this._core.clear()}write(o,s){this._core.write(o,s)}writeln(o,s){this._core.write(o),this._core.write(`\r
|
|
64
|
-
`,s)}paste(o){this._core.paste(o)}refresh(o,s){this._verifyIntegers(o,s),this._core.refresh(o,s)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(o){this._addonManager.loadAddon(this,o)}static get strings(){return a}_verifyIntegers(...o){for(const s of o)if(s===1/0||isNaN(s)||s%1!=0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...o){for(const s of o)if(s&&(s===1/0||isNaN(s)||s%1!=0||s<0))throw new Error("This API only accepts positive integers")}}m.Terminal=_})(),h})())})(bh);var Qp=bh.exports,Dh={exports:{}};(function(e,t){(function(r,i){e.exports=i()})(self,()=>(()=>{var r={};return(()=>{var i=r;Object.defineProperty(i,"__esModule",{value:!0}),i.FitAddon=void 0,i.FitAddon=class{activate(n){this._terminal=n}dispose(){}fit(){const n=this.proposeDimensions();if(!n||!this._terminal||isNaN(n.cols)||isNaN(n.rows))return;const h=this._terminal._core;this._terminal.rows===n.rows&&this._terminal.cols===n.cols||(h._renderService.clear(),this._terminal.resize(n.cols,n.rows))}proposeDimensions(){if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;const n=this._terminal._core,h=n._renderService.dimensions;if(h.css.cell.width===0||h.css.cell.height===0)return;const m=this._terminal.options.scrollback===0?0:n.viewport.scrollBarWidth,a=window.getComputedStyle(this._terminal.element.parentElement),u=parseInt(a.getPropertyValue("height")),f=Math.max(0,parseInt(a.getPropertyValue("width"))),g=window.getComputedStyle(this._terminal.element),d=u-(parseInt(g.getPropertyValue("padding-top"))+parseInt(g.getPropertyValue("padding-bottom"))),p=f-(parseInt(g.getPropertyValue("padding-right"))+parseInt(g.getPropertyValue("padding-left")))-m;return{cols:Math.max(2,Math.floor(p/h.css.cell.width)),rows:Math.max(1,Math.floor(d/h.css.cell.height))}}}})(),r})())})(Dh);var tc=Dh.exports,Rh={exports:{}};(function(e,t){(function(r,i){e.exports=i()})(self,()=>(()=>{var r={6:(m,a)=>{function u(g){try{const d=new URL(g),p=d.password&&d.username?`${d.protocol}//${d.username}:${d.password}@${d.host}`:d.username?`${d.protocol}//${d.username}@${d.host}`:`${d.protocol}//${d.host}`;return g.toLocaleLowerCase().startsWith(p.toLocaleLowerCase())}catch{return!1}}Object.defineProperty(a,"__esModule",{value:!0}),a.LinkComputer=a.WebLinkProvider=void 0,a.WebLinkProvider=class{constructor(g,d,p,S={}){this._terminal=g,this._regex=d,this._handler=p,this._options=S}provideLinks(g,d){const p=f.computeLink(g,this._regex,this._terminal,this._handler);d(this._addCallbacks(p))}_addCallbacks(g){return g.map(d=>(d.leave=this._options.leave,d.hover=(p,S)=>{if(this._options.hover){const{range:w}=d;this._options.hover(p,S,w)}},d))}};class f{static computeLink(d,p,S,w){const _=new RegExp(p.source,(p.flags||"")+"g"),[c,o]=f._getWindowedLineStrings(d-1,S),s=c.join("");let l;const v=[];for(;l=_.exec(s);){const C=l[0];if(!u(C))continue;const[x,k]=f._mapStrIdx(S,o,0,l.index),[y,b]=f._mapStrIdx(S,x,k,C.length);if(x===-1||k===-1||y===-1||b===-1)continue;const R={start:{x:k+1,y:x+1},end:{x:b,y:y+1}};v.push({range:R,text:C,activate:w})}return v}static _getWindowedLineStrings(d,p){let S,w=d,_=d,c=0,o="";const s=[];if(S=p.buffer.active.getLine(d)){const l=S.translateToString(!0);if(S.isWrapped&&l[0]!==" "){for(c=0;(S=p.buffer.active.getLine(--w))&&c<2048&&(o=S.translateToString(!0),c+=o.length,s.push(o),S.isWrapped&&o.indexOf(" ")===-1););s.reverse()}for(s.push(l),c=0;(S=p.buffer.active.getLine(++_))&&S.isWrapped&&c<2048&&(o=S.translateToString(!0),c+=o.length,s.push(o),o.indexOf(" ")===-1););}return[s,w]}static _mapStrIdx(d,p,S,w){const _=d.buffer.active,c=_.getNullCell();let o=S;for(;w;){const s=_.getLine(p);if(!s)return[-1,-1];for(let l=o;l<s.length;++l){s.getCell(l,c);const v=c.getChars();if(c.getWidth()&&(w-=v.length||1,l===s.length-1&&v==="")){const C=_.getLine(p+1);C&&C.isWrapped&&(C.getCell(0,c),c.getWidth()===2&&(w+=1))}if(w<0)return[p,l]}p++,o=0}return[p,o]}}a.LinkComputer=f}},i={};function n(m){var a=i[m];if(a!==void 0)return a.exports;var u=i[m]={exports:{}};return r[m](u,u.exports,n),u.exports}var h={};return(()=>{var m=h;Object.defineProperty(m,"__esModule",{value:!0}),m.WebLinksAddon=void 0;const a=n(6),u=/(https?|HTTPS?):[/]{2}[^\s"'!*(){}|\\\^<>`]*[^\s"':,.!?{}|\\\^~\[\]`()<>]/;function f(g,d){const p=window.open();if(p){try{p.opener=null}catch{}p.location.href=d}else console.warn("Opening link blocked as opener could not be cleared")}m.WebLinksAddon=class{constructor(g=f,d={}){this._handler=g,this._options=d}activate(g){this._terminal=g;const d=this._options,p=d.urlRegex||u;this._linkProvider=this._terminal.registerLinkProvider(new a.WebLinkProvider(this._terminal,p,this._handler,d))}dispose(){var g;(g=this._linkProvider)==null||g.dispose()}}})(),h})())})(Rh);var Yp=Rh.exports;function rc(){const e=re.getState().theme;return Xp(e)==="light"?Kp:$p}const Ho=new Set,Fo=new Map,zo=new Map;function Jp(e,t){zo.set(e,t)}function Zp(e){const t=zo.get(e);return t!==void 0?(zo.delete(e),t):null}function e_({terminalId:e,projectId:t,cwd:r}){const i=Q.useRef(null),n=Q.useRef(null),h=Q.useRef(null),m=Q.useRef(null),a=De(p=>p.setTerminalInstance),u=De(p=>p.createSession),f=re(p=>p.setFocusedTerminal);Q.useEffect(()=>{const p=i.current;if(!p)return;p.innerHTML="";const S=De.getState().sessions[e],w=Fo.get(e);if(S!=null&&S.terminal&&w){const s=S.terminal;n.current=s,p.appendChild(w);const l=new tc.FitAddon;return s.loadAddon(l),h.current=l,requestAnimationFrame(()=>{try{l.fit();const{cols:v,rows:C}=s;m.current={cols:v,rows:C},ze({type:"pty:resize",terminalId:e,cols:v,rows:C})}catch{}}),()=>{}}const _=new Qp.Terminal({theme:rc(),fontFamily:"'JetBrains Mono', 'Fira Code', 'SF Mono', 'Menlo', monospace",fontSize:13,lineHeight:1.2,cursorBlink:!0,cursorStyle:"block",allowProposedApi:!0,scrollback:1e4}),c=new tc.FitAddon,o=new Yp.WebLinksAddon;return _.loadAddon(c),_.loadAddon(o),_.open(p),n.current=_,h.current=c,_.element&&Fo.set(e,_.element),u(e,t),a(e,_),_.attachCustomKeyEventHandler(s=>s.key==="Enter"&&s.shiftKey?(s.type==="keydown"&&ze({type:"pty:input",terminalId:e,data:`
|
|
65
|
-
`}),!1):!0),_.onData(s=>{ze({type:"pty:input",terminalId:e,data:s})}),_.onTitleChange(s=>{De.getState().setTitle(e,s)}),Ho.has(e)||(Ho.add(e),requestAnimationFrame(()=>{try{c.fit()}catch{}ze({type:"pty:spawn",terminalId:e,projectId:t,cwd:r}),ze({type:"pty:resize",terminalId:e,cols:_.cols,rows:_.rows}),m.current={cols:_.cols,rows:_.rows},_.focus(),f(e)})),()=>{}},[e,t,r,u,a]),Q.useEffect(()=>{const p=()=>{const o=n.current;o&&(o.options.theme=rc())};let S=re.getState().theme;const w=re.subscribe(o=>{o.theme!==S&&(S=o.theme,p())}),_=window.matchMedia("(prefers-color-scheme: light)"),c=()=>{re.getState().theme==="system"&&p()};return _.addEventListener("change",c),()=>{w(),_.removeEventListener("change",c)}},[]);const g=Q.useCallback(()=>{const p=h.current,S=n.current;if(!(!p||!S))try{p.fit();const{cols:w,rows:_}=S,c=m.current;(!c||c.cols!==w||c.rows!==_)&&(m.current={cols:w,rows:_},ze({type:"pty:resize",terminalId:e,cols:w,rows:_}))}catch{}},[e]),d=Q.useCallback(()=>{var p;(p=n.current)==null||p.focus(),f(e)},[e,f]);return{containerRef:i,fit:g,focus:d,terminalRef:n}}function an(e){Ho.delete(e),Fo.delete(e)}let Ze=null;function t_(){return`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}/ws`}function ze(e){(Ze==null?void 0:Ze.readyState)===WebSocket.OPEN&&Ze.send(JSON.stringify(e))}function r_(){const e=re(h=>h.setConnectionStatus),t=ve(h=>h.addProject),r=ve(h=>h.setActiveProject),i=Q.useRef(),n=Q.useCallback(()=>{if((Ze==null?void 0:Ze.readyState)===WebSocket.OPEN||(Ze==null?void 0:Ze.readyState)===WebSocket.CONNECTING)return;e("connecting");const h=new WebSocket(t_());Ze=h,h.onopen=()=>{e("connected")},h.onmessage=m=>{var a,u,f;try{const g=JSON.parse(m.data);if(g.type==="pty:output"){const d=De.getState().sessions[g.terminalId];(a=d==null?void 0:d.terminal)==null||a.write(g.data);const p=Zp(g.terminalId);p&&ze({type:"pty:input",terminalId:g.terminalId,data:p});return}if(g.type==="pty:exit"){const d=g.terminalId,p=De.getState().sessions[d],S=p==null?void 0:p.projectId;if((u=p==null?void 0:p.terminal)==null||u.dispose(),De.getState().removeSession(d),an(d),S){oe.getState().removePaneFromProject(S,d),ve.getState().removeTerminalFromProject(S,d);const w=ye(oe.getState().getLayout(S)),_=re.getState().focusedTerminalId;if(_===d&&w.length>0){const c=w[0];re.getState().setFocusedTerminal(c);const o=De.getState().sessions[c];(f=o==null?void 0:o.terminal)==null||f.focus()}else _===d&&re.getState().setFocusedTerminal(null)}return}if(g.type==="project:spawned"){const d=Object.values(ve.getState().projects).find(p=>p.cwd===g.cwd);d?r(d.id):(t({id:g.projectId,name:g.name,cwd:g.cwd,terminalIds:[]}),r(g.projectId));return}if(g.type==="editor:active"){if(!re.getState().editorSyncEnabled)return;const{projects:d,activeProjectId:p}=ve.getState(),S=Object.values(d).find(w=>{const _=w.cwd.replace(/\/$/,"").split("/").pop();return w.name===g.projectName||_===g.projectName});S&&S.id!==p&&r(S.id)}}catch{}},h.onclose=()=>{e("disconnected"),Ze=null,i.current=setTimeout(n,2e3)},h.onerror=()=>{h.close()}},[e,t,r]);Q.useEffect(()=>(n(),()=>{clearTimeout(i.current)}),[n])}const i_=new Set(["n","w","t","d","r"]);function s_(){const e=re(r=>r.toggleSidebar),t=re(r=>r.setFocusedTerminal);Q.useEffect(()=>{const r=i=>{var p,S,w;const n=i.key.toLowerCase();if(i.altKey&&!i.metaKey&&!i.ctrlKey&&["arrowleft","arrowright","arrowup","arrowdown"].includes(n)){i.preventDefault(),i.stopPropagation();const _=ve.getState().activeProjectId;if(!_)return;const c=oe.getState().getLayout(_),o=re.getState().focusedTerminalId;if(!o||!c)return;const l=Nn(c,o,n==="arrowleft"?"left":n==="arrowright"?"right":n==="arrowup"?"up":"down");l&&oe.getState().swapPanesInProject(_,o,l);return}if(!(navigator.platform.startsWith("Mac")?i.metaKey:i.ctrlKey))return;(i_.has(n)||n>="1"&&n<="9"||["arrowleft","arrowright","arrowup","arrowdown"].includes(n))&&(i.preventDefault(),i.stopPropagation());const a=ve.getState().activeProjectId;if(!a)return;const u=oe.getState().getLayout(a),f=re.getState().focusedTerminalId,g=ve.getState().projects[a];if(n==="d"&&!i.shiftKey){e();return}if(n==="n"){if(!g)return;const _=crypto.randomUUID(),c=ye(u);if(c.length>0){const o=f??c[c.length-1],s=i.shiftKey?"horizontal":"vertical";oe.getState().addPaneToProject(a,o,_,s)}else oe.getState().setLayout(a,{type:"leaf",terminalId:_});ve.getState().addTerminalToProject(a,_),t(_);return}if(n==="w"&&!i.shiftKey){if(!f||!u)return;ze({type:"pty:kill",terminalId:f}),oe.getState().removePaneFromProject(a,f),ve.getState().removeTerminalFromProject(a,f);const _=De.getState().sessions[f];(p=_==null?void 0:_.terminal)==null||p.dispose(),De.getState().removeSession(f),an(f);const c=ye(oe.getState().getLayout(a));t(c[0]??null);return}if(n==="t"&&!i.shiftKey){if(!g)return;const _=ye(u);_.length>0&&oe.getState().cyclePreset(a,_);return}if(n==="r"&&!i.shiftKey){const _=ye(u);if(_.length===0)return;let c;_.length<=2?c="even-vertical":_.length===3?c="main-left":c="grid";const o=Ai(_,c);o&&oe.getState().setLayout(a,o);return}if(["arrowleft","arrowright","arrowup","arrowdown"].includes(n)&&!i.shiftKey){if(!f||!u)return;const c=Nn(u,f,n==="arrowleft"?"left":n==="arrowright"?"right":n==="arrowup"?"up":"down");if(c){t(c);const o=De.getState().sessions[c];(S=o==null?void 0:o.terminal)==null||S.focus()}return}if(["arrowleft","arrowright","arrowup","arrowdown"].includes(n)&&i.shiftKey){if(!f||!u)return;const c=Nn(u,f,n==="arrowleft"?"left":n==="arrowright"?"right":n==="arrowup"?"up":"down");c&&oe.getState().swapPanesInProject(a,f,c);return}const d=parseInt(n);if(d>=1&&d<=9){const c=ye(u)[d-1];if(c){t(c);const o=De.getState().sessions[c];(w=o==null?void 0:o.terminal)==null||w.focus()}return}};return window.addEventListener("keydown",r,{capture:!0}),()=>window.removeEventListener("keydown",r,{capture:!0})},[e,t])}/**
|
|
64
|
+
`,s)}paste(o){this._core.paste(o)}refresh(o,s){this._verifyIntegers(o,s),this._core.refresh(o,s)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(o){this._addonManager.loadAddon(this,o)}static get strings(){return a}_verifyIntegers(...o){for(const s of o)if(s===1/0||isNaN(s)||s%1!=0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...o){for(const s of o)if(s&&(s===1/0||isNaN(s)||s%1!=0||s<0))throw new Error("This API only accepts positive integers")}}m.Terminal=_})(),h})())})(bh);var Qp=bh.exports,Dh={exports:{}};(function(e,t){(function(r,i){e.exports=i()})(self,()=>(()=>{var r={};return(()=>{var i=r;Object.defineProperty(i,"__esModule",{value:!0}),i.FitAddon=void 0,i.FitAddon=class{activate(n){this._terminal=n}dispose(){}fit(){const n=this.proposeDimensions();if(!n||!this._terminal||isNaN(n.cols)||isNaN(n.rows))return;const h=this._terminal._core;this._terminal.rows===n.rows&&this._terminal.cols===n.cols||(h._renderService.clear(),this._terminal.resize(n.cols,n.rows))}proposeDimensions(){if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;const n=this._terminal._core,h=n._renderService.dimensions;if(h.css.cell.width===0||h.css.cell.height===0)return;const m=this._terminal.options.scrollback===0?0:n.viewport.scrollBarWidth,a=window.getComputedStyle(this._terminal.element.parentElement),u=parseInt(a.getPropertyValue("height")),f=Math.max(0,parseInt(a.getPropertyValue("width"))),g=window.getComputedStyle(this._terminal.element),d=u-(parseInt(g.getPropertyValue("padding-top"))+parseInt(g.getPropertyValue("padding-bottom"))),p=f-(parseInt(g.getPropertyValue("padding-right"))+parseInt(g.getPropertyValue("padding-left")))-m;return{cols:Math.max(2,Math.floor(p/h.css.cell.width)),rows:Math.max(1,Math.floor(d/h.css.cell.height))}}}})(),r})())})(Dh);var tc=Dh.exports,Rh={exports:{}};(function(e,t){(function(r,i){e.exports=i()})(self,()=>(()=>{var r={6:(m,a)=>{function u(g){try{const d=new URL(g),p=d.password&&d.username?`${d.protocol}//${d.username}:${d.password}@${d.host}`:d.username?`${d.protocol}//${d.username}@${d.host}`:`${d.protocol}//${d.host}`;return g.toLocaleLowerCase().startsWith(p.toLocaleLowerCase())}catch{return!1}}Object.defineProperty(a,"__esModule",{value:!0}),a.LinkComputer=a.WebLinkProvider=void 0,a.WebLinkProvider=class{constructor(g,d,p,S={}){this._terminal=g,this._regex=d,this._handler=p,this._options=S}provideLinks(g,d){const p=f.computeLink(g,this._regex,this._terminal,this._handler);d(this._addCallbacks(p))}_addCallbacks(g){return g.map(d=>(d.leave=this._options.leave,d.hover=(p,S)=>{if(this._options.hover){const{range:w}=d;this._options.hover(p,S,w)}},d))}};class f{static computeLink(d,p,S,w){const _=new RegExp(p.source,(p.flags||"")+"g"),[c,o]=f._getWindowedLineStrings(d-1,S),s=c.join("");let l;const v=[];for(;l=_.exec(s);){const C=l[0];if(!u(C))continue;const[x,k]=f._mapStrIdx(S,o,0,l.index),[y,b]=f._mapStrIdx(S,x,k,C.length);if(x===-1||k===-1||y===-1||b===-1)continue;const R={start:{x:k+1,y:x+1},end:{x:b,y:y+1}};v.push({range:R,text:C,activate:w})}return v}static _getWindowedLineStrings(d,p){let S,w=d,_=d,c=0,o="";const s=[];if(S=p.buffer.active.getLine(d)){const l=S.translateToString(!0);if(S.isWrapped&&l[0]!==" "){for(c=0;(S=p.buffer.active.getLine(--w))&&c<2048&&(o=S.translateToString(!0),c+=o.length,s.push(o),S.isWrapped&&o.indexOf(" ")===-1););s.reverse()}for(s.push(l),c=0;(S=p.buffer.active.getLine(++_))&&S.isWrapped&&c<2048&&(o=S.translateToString(!0),c+=o.length,s.push(o),o.indexOf(" ")===-1););}return[s,w]}static _mapStrIdx(d,p,S,w){const _=d.buffer.active,c=_.getNullCell();let o=S;for(;w;){const s=_.getLine(p);if(!s)return[-1,-1];for(let l=o;l<s.length;++l){s.getCell(l,c);const v=c.getChars();if(c.getWidth()&&(w-=v.length||1,l===s.length-1&&v==="")){const C=_.getLine(p+1);C&&C.isWrapped&&(C.getCell(0,c),c.getWidth()===2&&(w+=1))}if(w<0)return[p,l]}p++,o=0}return[p,o]}}a.LinkComputer=f}},i={};function n(m){var a=i[m];if(a!==void 0)return a.exports;var u=i[m]={exports:{}};return r[m](u,u.exports,n),u.exports}var h={};return(()=>{var m=h;Object.defineProperty(m,"__esModule",{value:!0}),m.WebLinksAddon=void 0;const a=n(6),u=/(https?|HTTPS?):[/]{2}[^\s"'!*(){}|\\\^<>`]*[^\s"':,.!?{}|\\\^~\[\]`()<>]/;function f(g,d){const p=window.open();if(p){try{p.opener=null}catch{}p.location.href=d}else console.warn("Opening link blocked as opener could not be cleared")}m.WebLinksAddon=class{constructor(g=f,d={}){this._handler=g,this._options=d}activate(g){this._terminal=g;const d=this._options,p=d.urlRegex||u;this._linkProvider=this._terminal.registerLinkProvider(new a.WebLinkProvider(this._terminal,p,this._handler,d))}dispose(){var g;(g=this._linkProvider)==null||g.dispose()}}})(),h})())})(Rh);var Yp=Rh.exports;function rc(){const e=re.getState().theme;return Xp(e)==="light"?Kp:$p}const Ho=new Set,Fo=new Map,zo=new Map;function Jp(e,t){zo.set(e,t)}function Zp(e){const t=zo.get(e);return t!==void 0?(zo.delete(e),t):null}function e_({terminalId:e,projectId:t,cwd:r}){const i=Q.useRef(null),n=Q.useRef(null),h=Q.useRef(null),m=Q.useRef(null),a=De(p=>p.setTerminalInstance),u=De(p=>p.createSession),f=re(p=>p.setFocusedTerminal);Q.useEffect(()=>{const p=i.current;if(!p)return;p.innerHTML="";const S=De.getState().sessions[e],w=Fo.get(e);if(S!=null&&S.terminal&&w){const s=S.terminal;n.current=s,p.appendChild(w);const l=new tc.FitAddon;return s.loadAddon(l),h.current=l,requestAnimationFrame(()=>{try{l.fit(),s.scrollToBottom();const{cols:v,rows:C}=s;m.current={cols:v,rows:C},ze({type:"pty:resize",terminalId:e,cols:v,rows:C})}catch{}}),()=>{}}const _=new Qp.Terminal({theme:rc(),fontFamily:"'JetBrains Mono', 'Fira Code', 'SF Mono', 'Menlo', monospace",fontSize:13,lineHeight:1.2,cursorBlink:!0,cursorStyle:"block",allowProposedApi:!0,scrollback:1e4}),c=new tc.FitAddon,o=new Yp.WebLinksAddon;return _.loadAddon(c),_.loadAddon(o),_.open(p),n.current=_,h.current=c,_.element&&Fo.set(e,_.element),u(e,t),a(e,_),_.attachCustomKeyEventHandler(s=>s.key==="Enter"&&s.shiftKey?(s.type==="keydown"&&ze({type:"pty:input",terminalId:e,data:`
|
|
65
|
+
`}),!1):!0),_.onData(s=>{ze({type:"pty:input",terminalId:e,data:s})}),_.onTitleChange(s=>{De.getState().setTitle(e,s)}),Ho.has(e)||(Ho.add(e),requestAnimationFrame(()=>{try{c.fit()}catch{}ze({type:"pty:spawn",terminalId:e,projectId:t,cwd:r}),ze({type:"pty:resize",terminalId:e,cols:_.cols,rows:_.rows}),m.current={cols:_.cols,rows:_.rows},_.focus(),f(e)})),()=>{}},[e,t,r,u,a]),Q.useEffect(()=>{const p=()=>{const o=n.current;o&&(o.options.theme=rc())};let S=re.getState().theme;const w=re.subscribe(o=>{o.theme!==S&&(S=o.theme,p())}),_=window.matchMedia("(prefers-color-scheme: light)"),c=()=>{re.getState().theme==="system"&&p()};return _.addEventListener("change",c),()=>{w(),_.removeEventListener("change",c)}},[]);const g=Q.useCallback(()=>{const p=h.current,S=n.current;if(!(!p||!S))try{p.fit(),S.scrollToBottom();const{cols:w,rows:_}=S,c=m.current;(!c||c.cols!==w||c.rows!==_)&&(m.current={cols:w,rows:_},ze({type:"pty:resize",terminalId:e,cols:w,rows:_}))}catch{}},[e]),d=Q.useCallback(()=>{var p;(p=n.current)==null||p.focus(),f(e)},[e,f]);return{containerRef:i,fit:g,focus:d,terminalRef:n}}function an(e){Ho.delete(e),Fo.delete(e)}let Ze=null;function t_(){return`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}/ws`}function ze(e){(Ze==null?void 0:Ze.readyState)===WebSocket.OPEN&&Ze.send(JSON.stringify(e))}function r_(){const e=re(h=>h.setConnectionStatus),t=ve(h=>h.addProject),r=ve(h=>h.setActiveProject),i=Q.useRef(),n=Q.useCallback(()=>{if((Ze==null?void 0:Ze.readyState)===WebSocket.OPEN||(Ze==null?void 0:Ze.readyState)===WebSocket.CONNECTING)return;e("connecting");const h=new WebSocket(t_());Ze=h,h.onopen=()=>{e("connected")},h.onmessage=m=>{var a,u,f;try{const g=JSON.parse(m.data);if(g.type==="pty:output"){const d=De.getState().sessions[g.terminalId];(a=d==null?void 0:d.terminal)==null||a.write(g.data);const p=Zp(g.terminalId);p&&ze({type:"pty:input",terminalId:g.terminalId,data:p});return}if(g.type==="pty:exit"){const d=g.terminalId,p=De.getState().sessions[d],S=p==null?void 0:p.projectId;if((u=p==null?void 0:p.terminal)==null||u.dispose(),De.getState().removeSession(d),an(d),S){oe.getState().removePaneFromProject(S,d),ve.getState().removeTerminalFromProject(S,d);const w=ye(oe.getState().getLayout(S)),_=re.getState().focusedTerminalId;if(_===d&&w.length>0){const c=w[0];re.getState().setFocusedTerminal(c);const o=De.getState().sessions[c];(f=o==null?void 0:o.terminal)==null||f.focus()}else _===d&&re.getState().setFocusedTerminal(null)}return}if(g.type==="project:spawned"){const d=Object.values(ve.getState().projects).find(p=>p.cwd===g.cwd);d?r(d.id):(t({id:g.projectId,name:g.name,cwd:g.cwd,terminalIds:[]}),r(g.projectId));return}if(g.type==="editor:active"){if(!re.getState().editorSyncEnabled)return;const{projects:d,activeProjectId:p}=ve.getState(),S=Object.values(d).find(w=>{const _=w.cwd.replace(/\/$/,"").split("/").pop();return w.name===g.projectName||_===g.projectName});S&&S.id!==p&&r(S.id)}}catch{}},h.onclose=()=>{e("disconnected"),Ze=null,i.current=setTimeout(n,2e3)},h.onerror=()=>{h.close()}},[e,t,r]);Q.useEffect(()=>(n(),()=>{clearTimeout(i.current)}),[n])}const i_=new Set(["n","w","t","d","r"]);function s_(){const e=re(r=>r.toggleSidebar),t=re(r=>r.setFocusedTerminal);Q.useEffect(()=>{const r=i=>{var p,S,w;const n=i.key.toLowerCase();if(i.altKey&&!i.metaKey&&!i.ctrlKey&&["arrowleft","arrowright","arrowup","arrowdown"].includes(n)){i.preventDefault(),i.stopPropagation();const _=ve.getState().activeProjectId;if(!_)return;const c=oe.getState().getLayout(_),o=re.getState().focusedTerminalId;if(!o||!c)return;const l=Nn(c,o,n==="arrowleft"?"left":n==="arrowright"?"right":n==="arrowup"?"up":"down");l&&oe.getState().swapPanesInProject(_,o,l);return}if(!(navigator.platform.startsWith("Mac")?i.metaKey:i.ctrlKey))return;(i_.has(n)||n>="1"&&n<="9"||["arrowleft","arrowright","arrowup","arrowdown"].includes(n))&&(i.preventDefault(),i.stopPropagation());const a=ve.getState().activeProjectId;if(!a)return;const u=oe.getState().getLayout(a),f=re.getState().focusedTerminalId,g=ve.getState().projects[a];if(n==="d"&&!i.shiftKey){e();return}if(n==="n"){if(!g)return;const _=crypto.randomUUID(),c=ye(u);if(c.length>0){const o=f??c[c.length-1],s=i.shiftKey?"horizontal":"vertical";oe.getState().addPaneToProject(a,o,_,s)}else oe.getState().setLayout(a,{type:"leaf",terminalId:_});ve.getState().addTerminalToProject(a,_),t(_);return}if(n==="w"&&!i.shiftKey){if(!f||!u)return;ze({type:"pty:kill",terminalId:f}),oe.getState().removePaneFromProject(a,f),ve.getState().removeTerminalFromProject(a,f);const _=De.getState().sessions[f];(p=_==null?void 0:_.terminal)==null||p.dispose(),De.getState().removeSession(f),an(f);const c=ye(oe.getState().getLayout(a));t(c[0]??null);return}if(n==="t"&&!i.shiftKey){if(!g)return;const _=ye(u);_.length>0&&oe.getState().cyclePreset(a,_);return}if(n==="r"&&!i.shiftKey){const _=ye(u);if(_.length===0)return;let c;_.length<=2?c="even-vertical":_.length===3?c="main-left":c="grid";const o=Ai(_,c);o&&oe.getState().setLayout(a,o);return}if(["arrowleft","arrowright","arrowup","arrowdown"].includes(n)&&!i.shiftKey){if(!f||!u)return;const c=Nn(u,f,n==="arrowleft"?"left":n==="arrowright"?"right":n==="arrowup"?"up":"down");if(c){t(c);const o=De.getState().sessions[c];(S=o==null?void 0:o.terminal)==null||S.focus()}return}if(["arrowleft","arrowright","arrowup","arrowdown"].includes(n)&&i.shiftKey){if(!f||!u)return;const c=Nn(u,f,n==="arrowleft"?"left":n==="arrowright"?"right":n==="arrowup"?"up":"down");c&&oe.getState().swapPanesInProject(a,f,c);return}const d=parseInt(n);if(d>=1&&d<=9){const c=ye(u)[d-1];if(c){t(c);const o=De.getState().sessions[c];(w=o==null?void 0:o.terminal)==null||w.focus()}return}};return window.addEventListener("keydown",r,{capture:!0}),()=>window.removeEventListener("keydown",r,{capture:!0})},[e,t])}/**
|
|
66
66
|
* @license lucide-react v0.400.0 - ISC
|
|
67
67
|
*
|
|
68
68
|
* This source code is licensed under the ISC license.
|
package/dist/web/index.html
CHANGED
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
document.documentElement.setAttribute('data-theme', t);
|
|
15
15
|
})();
|
|
16
16
|
</script>
|
|
17
|
-
<script type="module" crossorigin src="/assets/index-
|
|
17
|
+
<script type="module" crossorigin src="/assets/index-Cg_s9WdK.js"></script>
|
|
18
18
|
<link rel="stylesheet" crossorigin href="/assets/index-Dbp11YgF.css">
|
|
19
19
|
</head>
|
|
20
20
|
<body>
|