deckide 3.5.27 → 3.5.29

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/README.md CHANGED
@@ -1,187 +1,251 @@
1
1
  # Deck IDE
2
2
 
3
- 複数のターミナルを並列で管理できる軽量なWeb IDE。AIエージェント(Claude Code、Codex CLI等)を永続的に動かすことに最適化されています。
3
+ 複数のターミナルを並列で管理できる軽量な Web IDE。AIエージェント(Claude Code、Codex CLI 等)を永続的に動かすことに最適化されています。
4
4
 
5
5
  ## 特徴
6
6
 
7
- - **マルチターミナル** - 複数のターミナルを同時に起動・管理
8
- - **Monaco Editor** - VS Codeと同じエディタエンジンによるコード編集
9
- - **Git統合** - ステージング、コミット、プッシュ、プル、ブランチ管理
10
- - **マルチリポジトリ対応** - ワークスペース内の複数Gitリポジトリを自動検出
11
- - **ファイルエクスプローラー** - ファイル・フォルダの作成、削除、名前変更
12
- - **Diffビューア** - 変更ファイルの差分表示
13
- - **Windowsデスクトップアプリ** - Electronベースのネイティブアプリ(自動アップデート対応)
7
+ - **マルチターミナル** 複数のターミナルを同時に起動・管理。グリッドレイアウトで自動配置
8
+ - **デッキシステム** ワークスペースごとにターミナルをグループ化。最大3デッキまで分割表示
9
+ - **Monaco Editor** — VS Code と同じエディタエンジンによるコード編集
10
+ - **Git 統合** — ステージング、コミット、プッシュ、プル、ブランチ管理、Diff ビューア
11
+ - **マルチリポジトリ対応** ワークスペース内の複数 Git リポジトリを自動検出
12
+ - **ファイルエクスプローラー** ファイル・フォルダの作成、削除、コンテキストメニュー
13
+ - **ターミナルバッファ永続化** WebSocket 切断・再接続時にターミナル出力を完全復元
14
+ - **Basic 認証** — CLI またはブラウザ設定画面から認証の有効化が可能
15
+ - **CLI ツール** — `deckide` コマンドでバックグラウンド起動・停止・設定管理
16
+ - **モバイル対応** — タッチ操作、スワイプでのデッキ切替、レスポンシブレイアウト
14
17
 
15
- ## スクリーンショット
18
+ ## クイックスタート
16
19
 
17
- ```
18
- ┌─────────────────────────────────────────────────────────────┐
19
- │ [エクスプローラー] [Git] [設定] Deck IDE │
20
- ├─────────┬───────────────────────────────────────────────────┤
21
- │ ファイル │ Monaco Editor │
22
- │ ツリー │ │
23
- │ │ │
24
- │ ├───────────────────────────────────────────────────┤
25
- │ │ Terminal 1 │ Terminal 2 │
26
- │ │ $ claude │ $ codex │
27
- │ │ ... │ ... │
28
- └─────────┴───────────────────────────────────────────────────┘
29
- ```
20
+ ### npm からインストール(推奨)
30
21
 
31
- ## インストール
32
-
33
- ### Windowsデスクトップアプリ(推奨)
22
+ ```bash
23
+ npm install -g deckide
24
+ deckide
25
+ ```
34
26
 
35
- [Releases](https://github.com/tako0614/ide/releases)から最新の`Deck-IDE-Setup-x.x.x.exe`をダウンロードしてインストール。
27
+ ブラウザが自動で `http://localhost:8787` を開きます。
36
28
 
37
29
  ### ソースから実行
38
30
 
39
31
  ```bash
40
- # リポジトリをクローン
41
32
  git clone https://github.com/tako0614/ide.git
42
33
  cd ide
43
-
44
- # 依存関係をインストール
45
34
  npm install
46
35
 
47
- # 開発モードで起動(Web + Server)
48
- npm run dev:server # ターミナル1
49
- npm run dev:web # ターミナル2
36
+ # 開発モード(ホットリロード付き)
37
+ npm run dev:server # ターミナル1: サーバー (port 8787)
38
+ npm run dev:web # ターミナル2: Web (port 5173)
50
39
 
51
- # またはビルドして起動
40
+ # または本番ビルド
41
+ npm run build
52
42
  npm run serve
53
43
  ```
54
44
 
55
- ブラウザで http://localhost:3210 を開く。
56
-
57
- ## プロジェクト構成
45
+ ## CLI リファレンス
58
46
 
59
47
  ```
60
- ide/
61
- ├── apps/
62
- │ ├── web/ # フロントエンド (React + Vite)
63
- │ ├── server/ # バックエンド (Hono + node-pty)
64
- │ └── desktop/ # Electronアプリ
65
- ├── packages/
66
- │ └── shared/ # 共有型定義
67
- └── docs/ # ドキュメント
48
+ deckide [start] サーバー起動(バックグラウンド)
49
+ deckide start --fg サーバー起動(フォアグラウンド)
50
+ deckide stop サーバー停止
51
+ deckide restart サーバー再起動
52
+ deckide status サーバー状態表示
53
+ deckide logs [-f] サーバーログ表示
54
+
55
+ deckide port 現在のポート表示
56
+ deckide port <number> ポート変更(自動再起動)
57
+
58
+ deckide auth on [user] [pass] Basic 認証を有効化
59
+ deckide auth off Basic 認証を無効化
60
+ deckide auth status 認証状態表示
61
+
62
+ deckide config 全設定表示
63
+ deckide config set <key> <val> 設定値変更
64
+ deckide config get <key> 設定値取得
65
+ deckide config reset 設定リセット
68
66
  ```
69
67
 
70
- ## 技術スタック
68
+ ### 起動オプション
71
69
 
72
- ### フロントエンド
73
- - React 19
74
- - Vite
75
- - Monaco Editor
76
- - xterm.js (WebGL対応)
77
- - TypeScript
78
-
79
- ### バックエンド
80
- - Hono (高速HTTPフレームワーク)
81
- - node-pty (疑似ターミナル)
82
- - simple-git (Git操作)
83
- - WebSocket (ターミナル通信)
84
- - SQLite (データ永続化)
85
-
86
- ### デスクトップ
87
- - Electron 40
88
- - electron-builder
89
- - electron-updater (自動アップデート)
70
+ | オプション | 説明 |
71
+ |-----------|------|
72
+ | `-p, --port <port>` | ポート番号(デフォルト: 8787) |
73
+ | `--host <host>` | バインドアドレス(デフォルト: 0.0.0.0) |
74
+ | `--no-open` | ブラウザを自動で開かない |
75
+ | `--fg` | フォアグラウンドで起動 |
90
76
 
91
77
  ## 使い方
92
78
 
93
- ### ワークスペースの追加
94
-
95
- 1. 左サイドバーの「+」ボタンをクリック
96
- 2. ディレクトリパスを入力(例: `C:\Projects\myapp`)
97
- 3. ワークスペースが追加される
98
-
99
- ### デッキの作成
100
-
101
- 1. ワークスペースを選択
102
- 2. 「デッキ作成」ボタンをクリック
103
- 3. デッキ名を入力
79
+ ### ワークスペース
104
80
 
105
- ### ターミナルの使用
81
+ 1. サイドバーのフォルダアイコンをクリック
82
+ 2. 「ワークスペース追加」でディレクトリパスを指定
83
+ 3. ワークスペースを選択するとエディタ・ファイルツリー・Git 操作が利用可能
106
84
 
107
- - 「ターミナル追加」: 新しいターミナルを開く
108
- - 「Claude」: `claude` コマンドを実行するターミナルを開く
109
- - 「Codex」: `codex` コマンドを実行するターミナルを開く
85
+ ### デッキとターミナル
110
86
 
111
- ### Git操作
87
+ 1. ターミナルビューで「+」からデッキを作成
88
+ 2. デッキ内で「+」「C」「X」ボタンからターミナルを追加
89
+ - **+** — 通常のシェル
90
+ - **C** — `claude` コマンド(Claude Code)
91
+ - **X** — `codex` コマンド(Codex CLI)
92
+ 3. 複数デッキをタブで切り替え。ドラッグ&ドロップで並び替え・分割表示
112
93
 
113
- 1. サイドナビでGitアイコンをクリック
114
- 2. 変更ファイルを確認
115
- 3. 「+」でステージング、「−」でアンステージ
116
- 4. コミットメッセージを入力してコミット
117
- 5. プッシュ/プル/フェッチボタンで同期
94
+ ### Git 操作
118
95
 
119
- ## 開発
96
+ 1. ワークスペースエディタ内のソース管理パネルを開く
97
+ 2. 変更ファイルを確認し「+」でステージング
98
+ 3. コミットメッセージを入力してコミット
99
+ 4. プッシュ / プル / フェッチで同期
120
100
 
121
- ```bash
122
- # 依存関係のインストール
123
- npm install
101
+ ## プロジェクト構成
124
102
 
125
- # 開発サーバー起動
126
- npm run dev:server # サーバー (port 3210)
127
- npm run dev:web # Web (port 5173)
103
+ ```
104
+ ide/
105
+ ├── bin/
106
+ │ └── deckide.js # CLI エントリーポイント
107
+ ├── src/ # バックエンド (Node.js)
108
+ │ ├── index.ts # サーバー起動
109
+ │ ├── server.ts # Hono アプリ構築・ミドルウェア
110
+ │ ├── config.ts # 環境変数・設定
111
+ │ ├── websocket.ts # WebSocket サーバー・ターミナル接続
112
+ │ ├── types.ts # 型定義
113
+ │ ├── routes/ # API ルート
114
+ │ │ ├── workspaces.ts
115
+ │ │ ├── decks.ts
116
+ │ │ ├── files.ts
117
+ │ │ ├── terminals.ts
118
+ │ │ ├── git.ts
119
+ │ │ └── settings.ts
120
+ │ ├── middleware/ # 認証・CORS・セキュリティ
121
+ │ ├── utils/ # DB・パス・UTF-8・シェル
122
+ │ └── shared/ # フロント/バック共有型・ユーティリティ
123
+ ├── web/ # フロントエンド (React)
124
+ │ └── src/
125
+ │ ├── App.tsx
126
+ │ ├── components/ # UI コンポーネント
127
+ │ ├── hooks/ # カスタムフック
128
+ │ ├── utils/ # ユーティリティ
129
+ │ └── styles.css # Tailwind CSS + カスタムスタイル
130
+ ├── data/ # SQLite データベース
131
+ └── docs/ # ドキュメント
132
+ ```
128
133
 
129
- # ビルド
130
- npm run build:web # Webのみ
131
- npm run build:server # サーバーのみ
132
- npm run build:desktop # デスクトップアプリ
134
+ ## 技術スタック
133
135
 
134
- # デスクトップアプリの開発
135
- npm run dev:desktop
136
- ```
136
+ | レイヤー | 技術 |
137
+ |---------|------|
138
+ | フロントエンド | React 18, Vite, Tailwind CSS 4, Monaco Editor, xterm.js 5 |
139
+ | バックエンド | Hono, node-pty, simple-git, WebSocket (ws), Zod |
140
+ | データベース | Node.js 組み込み SQLite (`node:sqlite`) |
141
+ | 言語 | TypeScript |
142
+ | ランタイム | Node.js >= 22.5.0 |
137
143
 
138
144
  ## 環境変数
139
145
 
140
- サーバーは以下の環境変数をサポートします:
141
-
142
146
  | 変数名 | 説明 | デフォルト |
143
147
  |--------|------|-----------|
144
- | `PORT` | サーバーポート | 3210 |
145
- | `HOST` | バインドアドレス | localhost |
146
- | `BASIC_AUTH_USER` | Basic認証ユーザー名 | (なし) |
147
- | `BASIC_AUTH_PASSWORD` | Basic認証パスワード | (なし) |
148
- | `CORS_ORIGIN` | CORS許可オリジン | * (開発時) |
149
- | `DEFAULT_ROOT` | デフォルトルートパス | (なし) |
148
+ | `PORT` | サーバーポート | 8787 |
149
+ | `HOST` | バインドアドレス | 0.0.0.0 |
150
+ | `DEFAULT_ROOT` | デフォルトルートパス | ホームディレクトリ |
151
+ | `BASIC_AUTH_USER` | Basic 認証ユーザー名 | |
152
+ | `BASIC_AUTH_PASSWORD` | Basic 認証パスワード(本番は12文字以上) | |
153
+ | `CORS_ORIGIN` | CORS 許可オリジン(本番は必須) | |
154
+ | `NODE_ENV` | 実行環境 | development |
155
+ | `MAX_FILE_SIZE` | 最大ファイルサイズ (bytes) | 10485760 (10MB) |
156
+ | `TERMINAL_BUFFER_LIMIT` | ターミナルバッファ上限 (bytes) | 500000 |
157
+ | `TRUST_PROXY` | プロキシヘッダーを信頼 | false |
158
+ | `DECKIDE_DATA_DIR` | データディレクトリ | ~/.deckide |
150
159
 
151
160
  ## API
152
161
 
153
162
  ### ワークスペース
154
- - `GET /api/workspaces` - ワークスペース一覧
155
- - `POST /api/workspaces` - ワークスペース作成
163
+
164
+ | メソッド | パス | 説明 |
165
+ |---------|------|------|
166
+ | GET | `/api/workspaces` | 一覧 |
167
+ | POST | `/api/workspaces` | 作成 |
168
+ | DELETE | `/api/workspaces/:id` | 削除 |
169
+ | GET | `/api/config` | デフォルト設定取得 |
156
170
 
157
171
  ### デッキ
158
- - `GET /api/decks` - デッキ一覧
159
- - `POST /api/decks` - デッキ作成
172
+
173
+ | メソッド | パス | 説明 |
174
+ |---------|------|------|
175
+ | GET | `/api/decks` | 一覧 |
176
+ | POST | `/api/decks` | 作成 |
177
+ | PUT | `/api/decks/order` | 並び替え |
178
+ | DELETE | `/api/decks/:id` | 削除 |
160
179
 
161
180
  ### ファイル
162
- - `GET /api/files` - ファイル一覧
163
- - `GET /api/file` - ファイル読み込み
164
- - `PUT /api/file` - ファイル保存
165
- - `POST /api/file` - ファイル作成
166
- - `DELETE /api/file` - ファイル削除
181
+
182
+ | メソッド | パス | 説明 |
183
+ |---------|------|------|
184
+ | GET | `/api/files` | ディレクトリ一覧 |
185
+ | GET | `/api/preview` | ディレクトリプレビュー |
186
+ | GET | `/api/file` | ファイル読み込み |
187
+ | PUT | `/api/file` | ファイル保存 |
188
+ | POST | `/api/file` | ファイル作成 |
189
+ | DELETE | `/api/file` | ファイル削除 |
190
+ | POST | `/api/dir` | ディレクトリ作成 |
191
+ | DELETE | `/api/dir` | ディレクトリ削除 |
167
192
 
168
193
  ### ターミナル
169
- - `GET /api/terminals` - ターミナル一覧
170
- - `POST /api/terminals` - ターミナル作成
171
- - `DELETE /api/terminals/:id` - ターミナル削除
172
- - `WS /api/terminals/:id` - ターミナル接続
194
+
195
+ | メソッド | パス | 説明 |
196
+ |---------|------|------|
197
+ | GET | `/api/terminals` | 一覧 |
198
+ | POST | `/api/terminals` | 作成 |
199
+ | DELETE | `/api/terminals/:id` | 削除 |
200
+ | WS | `/api/terminals/:id` | WebSocket 接続 |
173
201
 
174
202
  ### Git
175
- - `GET /api/git/status` - Gitステータス
176
- - `GET /api/git/repos` - リポジトリ一覧
177
- - `POST /api/git/stage` - ステージング
178
- - `POST /api/git/unstage` - アンステージ
179
- - `POST /api/git/commit` - コミット
180
- - `POST /api/git/push` - プッシュ
181
- - `POST /api/git/pull` - プル
182
- - `GET /api/git/diff` - 差分取得
183
- - `GET /api/git/branches` - ブランチ一覧
184
- - `POST /api/git/checkout` - ブランチ切り替え
203
+
204
+ | メソッド | パス | 説明 |
205
+ |---------|------|------|
206
+ | GET | `/api/git/status` | ステータス |
207
+ | GET | `/api/git/repos` | リポジトリ一覧 |
208
+ | GET | `/api/git/multi-status` | 複数リポジトリの集約ステータス |
209
+ | POST | `/api/git/stage` | ステージング |
210
+ | POST | `/api/git/unstage` | アンステージ |
211
+ | POST | `/api/git/commit` | コミット |
212
+ | POST | `/api/git/discard` | 変更を破棄 |
213
+ | GET | `/api/git/diff` | 差分取得 |
214
+ | POST | `/api/git/push` | プッシュ |
215
+ | POST | `/api/git/pull` | プル |
216
+ | POST | `/api/git/fetch` | フェッチ |
217
+ | GET | `/api/git/remotes` | リモート一覧 |
218
+ | GET | `/api/git/branch-status` | ブランチ状態(ahead/behind) |
219
+ | GET | `/api/git/branches` | ブランチ一覧 |
220
+ | POST | `/api/git/checkout` | ブランチ切り替え |
221
+ | POST | `/api/git/create-branch` | ブランチ作成 |
222
+ | GET | `/api/git/log` | コミット履歴 |
223
+
224
+ ### その他
225
+
226
+ | メソッド | パス | 説明 |
227
+ |---------|------|------|
228
+ | GET | `/health` | ヘルスチェック |
229
+ | GET | `/api/settings` | 設定取得 |
230
+ | POST | `/api/settings` | 設定更新 |
231
+ | GET | `/api/ws-token` | WebSocket 認証トークン |
232
+ | POST | `/api/shutdown` | サーバー停止 |
233
+
234
+ ## WebSocket プロトコル
235
+
236
+ ターミナル接続は `/api/terminals/:id` WebSocket エンドポイントを使用します。
237
+
238
+ **クライアント → サーバー:**
239
+ - `{ type: "claim" }` — リサイズ権限を取得
240
+ - `{ type: "resize", cols, rows }` — PTY サイズ変更
241
+ - バイナリフレーム — キーボード入力
242
+
243
+ **サーバー → クライアント:**
244
+ - `{ type: "sync", offsetBase, reset }` — バッファ同期開始
245
+ - `{ type: "ready" }` — 同期完了、入力受付可能
246
+ - バイナリフレーム — ターミナル出力
247
+
248
+ 再接続時はバッファオフセットを指定して差分のみ取得可能(`?bufferOffset=N&reconnect=1`)。
185
249
 
186
250
  ## ライセンス
187
251
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "deckide",
3
- "version": "3.5.27",
3
+ "version": "3.5.29",
4
4
  "description": "Deck IDE - Browser-based IDE with terminal, file explorer, and git integration",
5
5
  "type": "module",
6
6
  "bin": {
@@ -45,9 +45,9 @@ WARNING: This link could potentially be dangerous`)){const o=window.open();if(o)
45
45
  `:`
46
46
  `)}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 k=this._getMouseBufferCoords(y),R=this._model.finalSelectionStart,O=this._model.finalSelectionEnd;return!!(R&&O&&k)&&this._areCoordsInSelection(k,R,O)}isCellInSelection(y,k){const R=this._model.finalSelectionStart,O=this._model.finalSelectionEnd;return!(!R||!O)&&this._areCoordsInSelection([y,k],R,O)}_areCoordsInSelection(y,k,R){return y[1]>k[1]&&y[1]<R[1]||k[1]===R[1]&&y[1]===k[1]&&y[0]>=k[0]&&y[0]<R[0]||k[1]<R[1]&&y[1]===R[1]&&y[0]<R[0]||k[1]<R[1]&&y[1]===k[1]&&y[0]>=k[0]}_selectWordAtCursor(y,k){var R,O;const T=(O=(R=this._linkifier.currentLink)===null||R===void 0?void 0:R.link)===null||O===void 0?void 0:O.range;if(T)return this._model.selectionStart=[T.start.x-1,T.start.y-1],this._model.selectionStartLength=(0,s.getRangeLength)(T,this._bufferService.cols),this._model.selectionEnd=void 0,!0;const B=this._getMouseBufferCoords(y);return!!B&&(this._selectWordAt(B,k),this._model.selectionEnd=void 0,!0)}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(y,k){this._model.clearSelection(),y=Math.max(y,0),k=Math.min(k,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,y],this._model.selectionEnd=[this._bufferService.cols,k],this.refresh(),this._onSelectionChange.fire()}_handleTrim(y){this._model.handleTrim(y)&&this.refresh()}_getMouseBufferCoords(y){const k=this._mouseService.getCoords(y,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(k)return k[0]--,k[1]--,k[1]+=this._bufferService.buffer.ydisp,k}_getMouseEventScrollAmount(y){let k=(0,d.getCoordsRelativeToElement)(this._coreBrowserService.window,y,this._screenElement)[1];const R=this._renderService.dimensions.css.canvas.height;return k>=0&&k<=R?0:(k>R&&(k-=R),k=Math.min(Math.max(k,-50),50),k/=50,k/Math.abs(k)+Math.round(14*k))}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 k=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);k&&k.length!==this._model.selectionStart[0]&&k.hasWidth(this._model.selectionStart[0])===0&&this._model.selectionStart[0]++}_handleDoubleClick(y){this._selectWordAtCursor(y,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(y){const k=this._getMouseBufferCoords(y);k&&(this._activeSelectionMode=2,this._selectLineAt(k[1]))}shouldColumnSelect(y){return y.altKey&&!(o.isMac&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(y){if(y.stopImmediatePropagation(),!this._model.selectionStart)return;const k=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 O=R.lines.get(this._model.selectionEnd[1]);O&&O.hasWidth(this._model.selectionEnd[0])===0&&this._model.selectionEnd[0]++}k&&k[0]===this._model.selectionEnd[0]&&k[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 k=y.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&k<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 O=(0,m.moveToCellSequence)(R[0]-1,R[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(O,!0)}}}else this._fireEventIfSelectionChanged()}_fireEventIfSelectionChanged(){const y=this._model.finalSelectionStart,k=this._model.finalSelectionEnd,R=!(!y||!k||y[0]===k[0]&&y[1]===k[1]);R?y&&k&&(this._oldSelectionStart&&this._oldSelectionEnd&&y[0]===this._oldSelectionStart[0]&&y[1]===this._oldSelectionStart[1]&&k[0]===this._oldSelectionEnd[0]&&k[1]===this._oldSelectionEnd[1]||this._fireOnSelectionChange(y,k,R)):this._oldHasSelection&&this._fireOnSelectionChange(y,k,R)}_fireOnSelectionChange(y,k,R){this._oldSelectionStart=y,this._oldSelectionEnd=k,this._oldHasSelection=R,this._onSelectionChange.fire()}_handleBufferActivate(y){this.clearSelection(),this._trimListener.dispose(),this._trimListener=y.activeBuffer.lines.onTrim(k=>this._handleTrim(k))}_convertViewportColToCharacterIndex(y,k){let R=k;for(let O=0;k>=O;O++){const T=y.loadCell(O,this._workCell).getChars().length;this._workCell.getWidth()===0?R--:T>1&&k!==O&&(R+=T-1)}return R}setSelection(y,k,R){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[y,k],this._model.selectionStartLength=R,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(y){this._isClickInSelection(y)||(this._selectWordAtCursor(y,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(y,k,R=!0,O=!0){if(y[0]>=this._bufferService.cols)return;const T=this._bufferService.buffer,B=T.lines.get(y[1]);if(!B)return;const z=T.translateBufferLineToString(y[1],!1);let I=this._convertViewportColToCharacterIndex(B,y[0]),j=I;const $=y[0]-I;let E=0,A=0,P=0,M=0;if(z.charAt(I)===" "){for(;I>0&&z.charAt(I-1)===" ";)I--;for(;j<z.length&&z.charAt(j+1)===" ";)j++}else{let X=y[0],q=y[0];B.getWidth(X)===0&&(E++,X--),B.getWidth(q)===2&&(A++,q++);const se=B.getString(q).length;for(se>1&&(M+=se-1,j+=se-1);X>0&&I>0&&!this._isCharWordSeparator(B.loadCell(X-1,this._workCell));){B.loadCell(X-1,this._workCell);const D=this._workCell.getChars().length;this._workCell.getWidth()===0?(E++,X--):D>1&&(P+=D-1,I-=D-1),I--,X--}for(;q<B.length&&j+1<z.length&&!this._isCharWordSeparator(B.loadCell(q+1,this._workCell));){B.loadCell(q+1,this._workCell);const D=this._workCell.getChars().length;this._workCell.getWidth()===2?(A++,q++):D>1&&(M+=D-1,j+=D-1),j++,q++}}j++;let H=I+$-E+P,K=Math.min(this._bufferService.cols,j-I+E+A-P-M);if(k||z.slice(I,j).trim()!==""){if(R&&H===0&&B.getCodePoint(0)!==32){const X=T.lines.get(y[1]-1);if(X&&B.isWrapped&&X.getCodePoint(this._bufferService.cols-1)!==32){const q=this._getWordAt([this._bufferService.cols-1,y[1]-1],!1,!0,!1);if(q){const se=this._bufferService.cols-q.start;H-=se,K+=se}}}if(O&&H+K===this._bufferService.cols&&B.getCodePoint(this._bufferService.cols-1)!==32){const X=T.lines.get(y[1]+1);if(X!=null&&X.isWrapped&&X.getCodePoint(0)!==32){const q=this._getWordAt([0,y[1]+1],!1,!1,!0);q&&(K+=q.length)}}return{start:H,length:K}}}_selectWordAt(y,k){const R=this._getWordAt(y,k);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 k=this._getWordAt(y,!0);if(k){let R=y[1];for(;k.start<0;)k.start+=this._bufferService.cols,R--;if(!this._model.areSelectionValuesReversed())for(;k.start+k.length>this._bufferService.cols;)k.length-=this._bufferService.cols,R++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?k.start:k.start+k.length,R]}}_isCharWordSeparator(y){return y.getWidth()!==0&&this._optionsService.rawOptions.wordSeparator.indexOf(y.getChars())>=0}_selectLineAt(y){const k=this._bufferService.buffer.getWrappedRangeForLine(y),R={start:{x:0,y:k.first},end:{x:this._bufferService.cols-1,y:k.last}};this._model.selectionStart=[0,k.first],this._model.selectionEnd=void 0,this._model.selectionStartLength=(0,s.getRangeLength)(R,this._bufferService.cols)}};l.SelectionService=b=f([S(3,p.IBufferService),S(4,p.ICoreService),S(5,w.IMouseService),S(6,p.IOptionsService),S(7,w.IRenderService),S(8,w.ICoreBrowserService)],b)},4725:(_,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.IThemeService=l.ICharacterJoinerService=l.ISelectionService=l.IRenderService=l.IMouseService=l.ICoreBrowserService=l.ICharSizeService=void 0;const f=u(8343);l.ICharSizeService=(0,f.createDecorator)("CharSizeService"),l.ICoreBrowserService=(0,f.createDecorator)("CoreBrowserService"),l.IMouseService=(0,f.createDecorator)("MouseService"),l.IRenderService=(0,f.createDecorator)("RenderService"),l.ISelectionService=(0,f.createDecorator)("SelectionService"),l.ICharacterJoinerService=(0,f.createDecorator)("CharacterJoinerService"),l.IThemeService=(0,f.createDecorator)("ThemeService")},6731:function(_,l,u){var f=this&&this.__decorate||function(b,y,k,R){var O,T=arguments.length,B=T<3?y:R===null?R=Object.getOwnPropertyDescriptor(y,k):R;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")B=Reflect.decorate(b,y,k,R);else for(var z=b.length-1;z>=0;z--)(O=b[z])&&(B=(T<3?O(B):T>3?O(y,k,B):O(y,k))||B);return T>3&&B&&Object.defineProperty(y,k,B),B},S=this&&this.__param||function(b,y){return function(k,R){y(k,R,b)}};Object.defineProperty(l,"__esModule",{value:!0}),l.ThemeService=l.DEFAULT_ANSI_COLORS=void 0;const d=u(7239),m=u(8055),C=u(8460),w=u(844),g=u(2585),a=m.css.toColor("#ffffff"),o=m.css.toColor("#000000"),s=m.css.toColor("#ffffff"),c=m.css.toColor("#000000"),p={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117};l.DEFAULT_ANSI_COLORS=Object.freeze((()=>{const b=[m.css.toColor("#2e3436"),m.css.toColor("#cc0000"),m.css.toColor("#4e9a06"),m.css.toColor("#c4a000"),m.css.toColor("#3465a4"),m.css.toColor("#75507b"),m.css.toColor("#06989a"),m.css.toColor("#d3d7cf"),m.css.toColor("#555753"),m.css.toColor("#ef2929"),m.css.toColor("#8ae234"),m.css.toColor("#fce94f"),m.css.toColor("#729fcf"),m.css.toColor("#ad7fa8"),m.css.toColor("#34e2e2"),m.css.toColor("#eeeeec")],y=[0,95,135,175,215,255];for(let k=0;k<216;k++){const R=y[k/36%6|0],O=y[k/6%6|0],T=y[k%6];b.push({css:m.channels.toCss(R,O,T),rgba:m.channels.toRgba(R,O,T)})}for(let k=0;k<24;k++){const R=8+10*k;b.push({css:m.channels.toCss(R,R,R),rgba:m.channels.toRgba(R,R,R)})}return b})());let v=l.ThemeService=class extends w.Disposable{get colors(){return this._colors}constructor(b){super(),this._optionsService=b,this._contrastCache=new d.ColorContrastCache,this._halfContrastCache=new d.ColorContrastCache,this._onChangeColors=this.register(new C.EventEmitter),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:a,background:o,cursor:s,cursorAccent:c,selectionForeground:void 0,selectionBackgroundTransparent:p,selectionBackgroundOpaque:m.color.blend(o,p),selectionInactiveBackgroundTransparent:p,selectionInactiveBackgroundOpaque:m.color.blend(o,p),ansi:l.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(b={}){const y=this._colors;if(y.foreground=x(b.foreground,a),y.background=x(b.background,o),y.cursor=x(b.cursor,s),y.cursorAccent=x(b.cursorAccent,c),y.selectionBackgroundTransparent=x(b.selectionBackground,p),y.selectionBackgroundOpaque=m.color.blend(y.background,y.selectionBackgroundTransparent),y.selectionInactiveBackgroundTransparent=x(b.selectionInactiveBackground,y.selectionBackgroundTransparent),y.selectionInactiveBackgroundOpaque=m.color.blend(y.background,y.selectionInactiveBackgroundTransparent),y.selectionForeground=b.selectionForeground?x(b.selectionForeground,m.NULL_COLOR):void 0,y.selectionForeground===m.NULL_COLOR&&(y.selectionForeground=void 0),m.color.isOpaque(y.selectionBackgroundTransparent)&&(y.selectionBackgroundTransparent=m.color.opacity(y.selectionBackgroundTransparent,.3)),m.color.isOpaque(y.selectionInactiveBackgroundTransparent)&&(y.selectionInactiveBackgroundTransparent=m.color.opacity(y.selectionInactiveBackgroundTransparent,.3)),y.ansi=l.DEFAULT_ANSI_COLORS.slice(),y.ansi[0]=x(b.black,l.DEFAULT_ANSI_COLORS[0]),y.ansi[1]=x(b.red,l.DEFAULT_ANSI_COLORS[1]),y.ansi[2]=x(b.green,l.DEFAULT_ANSI_COLORS[2]),y.ansi[3]=x(b.yellow,l.DEFAULT_ANSI_COLORS[3]),y.ansi[4]=x(b.blue,l.DEFAULT_ANSI_COLORS[4]),y.ansi[5]=x(b.magenta,l.DEFAULT_ANSI_COLORS[5]),y.ansi[6]=x(b.cyan,l.DEFAULT_ANSI_COLORS[6]),y.ansi[7]=x(b.white,l.DEFAULT_ANSI_COLORS[7]),y.ansi[8]=x(b.brightBlack,l.DEFAULT_ANSI_COLORS[8]),y.ansi[9]=x(b.brightRed,l.DEFAULT_ANSI_COLORS[9]),y.ansi[10]=x(b.brightGreen,l.DEFAULT_ANSI_COLORS[10]),y.ansi[11]=x(b.brightYellow,l.DEFAULT_ANSI_COLORS[11]),y.ansi[12]=x(b.brightBlue,l.DEFAULT_ANSI_COLORS[12]),y.ansi[13]=x(b.brightMagenta,l.DEFAULT_ANSI_COLORS[13]),y.ansi[14]=x(b.brightCyan,l.DEFAULT_ANSI_COLORS[14]),y.ansi[15]=x(b.brightWhite,l.DEFAULT_ANSI_COLORS[15]),b.extendedAnsi){const k=Math.min(y.ansi.length-16,b.extendedAnsi.length);for(let R=0;R<k;R++)y.ansi[R+16]=x(b.extendedAnsi[R],l.DEFAULT_ANSI_COLORS[R+16])}this._contrastCache.clear(),this._halfContrastCache.clear(),this._updateRestoreColors(),this._onChangeColors.fire(this.colors)}restoreColor(b){this._restoreColor(b),this._onChangeColors.fire(this.colors)}_restoreColor(b){if(b!==void 0)switch(b){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[b]=this._restoreColors.ansi[b]}else for(let y=0;y<this._restoreColors.ansi.length;++y)this._colors.ansi[y]=this._restoreColors.ansi[y]}modifyColors(b){b(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(b,y){if(b!==void 0)try{return m.css.toColor(b)}catch{}return y}l.ThemeService=v=f([S(0,g.IOptionsService)],v)},6349:(_,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.CircularList=void 0;const f=u(8460),S=u(844);class d extends S.Disposable{constructor(C){super(),this._maxLength=C,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(C){if(this._maxLength===C)return;const w=new Array(C);for(let g=0;g<Math.min(C,this.length);g++)w[g]=this._array[this._getCyclicIndex(g)];this._array=w,this._maxLength=C,this._startIndex=0}get length(){return this._length}set length(C){if(C>this._length)for(let w=this._length;w<C;w++)this._array[w]=void 0;this._length=C}get(C){return this._array[this._getCyclicIndex(C)]}set(C,w){this._array[this._getCyclicIndex(C)]=w}push(C){this._array[this._getCyclicIndex(this._length)]=C,this._length===this._maxLength?(this._startIndex=++this._startIndex%this._maxLength,this.onTrimEmitter.fire(1)):this._length++}recycle(){if(this._length!==this._maxLength)throw new Error("Can only recycle when the buffer is full");return this._startIndex=++this._startIndex%this._maxLength,this.onTrimEmitter.fire(1),this._array[this._getCyclicIndex(this._length-1)]}get isFull(){return this._length===this._maxLength}pop(){return this._array[this._getCyclicIndex(this._length---1)]}splice(C,w,...g){if(w){for(let a=C;a<this._length-w;a++)this._array[this._getCyclicIndex(a)]=this._array[this._getCyclicIndex(a+w)];this._length-=w,this.onDeleteEmitter.fire({index:C,amount:w})}for(let a=this._length-1;a>=C;a--)this._array[this._getCyclicIndex(a+g.length)]=this._array[this._getCyclicIndex(a)];for(let a=0;a<g.length;a++)this._array[this._getCyclicIndex(C+a)]=g[a];if(g.length&&this.onInsertEmitter.fire({index:C,amount:g.length}),this._length+g.length>this._maxLength){const a=this._length+g.length-this._maxLength;this._startIndex+=a,this._length=this._maxLength,this.onTrimEmitter.fire(a)}else this._length+=g.length}trimStart(C){C>this._length&&(C=this._length),this._startIndex+=C,this._length-=C,this.onTrimEmitter.fire(C)}shiftElements(C,w,g){if(!(w<=0)){if(C<0||C>=this._length)throw new Error("start argument out of range");if(C+g<0)throw new Error("Cannot shift elements in list beyond index 0");if(g>0){for(let o=w-1;o>=0;o--)this.set(C+o+g,this.get(C+o));const a=C+w+g-this._length;if(a>0)for(this._length+=a;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(let a=0;a<w;a++)this.set(C+a+g,this.get(C+a))}}_getCyclicIndex(C){return(this._startIndex+C)%this._maxLength}}l.CircularList=d},1439:(_,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.clone=void 0,l.clone=function u(f,S=5){if(typeof f!="object")return f;const d=Array.isArray(f)?[]:{};for(const m in f)d[m]=S<=1?f[m]:f[m]&&u(f[m],S-1);return d}},8055:(_,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.contrastRatio=l.toPaddedHex=l.rgba=l.rgb=l.css=l.color=l.channels=l.NULL_COLOR=void 0;const f=u(6114);let S=0,d=0,m=0,C=0;var w,g,a,o,s;function c(v){const x=v.toString(16);return x.length<2?"0"+x:x}function p(v,x){return v<x?(x+.05)/(v+.05):(v+.05)/(x+.05)}l.NULL_COLOR={css:"#00000000",rgba:0},function(v){v.toCss=function(x,b,y,k){return k!==void 0?`#${c(x)}${c(b)}${c(y)}${c(k)}`:`#${c(x)}${c(b)}${c(y)}`},v.toRgba=function(x,b,y,k=255){return(x<<24|b<<16|y<<8|k)>>>0}}(w||(l.channels=w={})),function(v){function x(b,y){return C=Math.round(255*y),[S,d,m]=s.toChannels(b.rgba),{css:w.toCss(S,d,m,C),rgba:w.toRgba(S,d,m,C)}}v.blend=function(b,y){if(C=(255&y.rgba)/255,C===1)return{css:y.css,rgba:y.rgba};const k=y.rgba>>24&255,R=y.rgba>>16&255,O=y.rgba>>8&255,T=b.rgba>>24&255,B=b.rgba>>16&255,z=b.rgba>>8&255;return S=T+Math.round((k-T)*C),d=B+Math.round((R-B)*C),m=z+Math.round((O-z)*C),{css:w.toCss(S,d,m),rgba:w.toRgba(S,d,m)}},v.isOpaque=function(b){return(255&b.rgba)==255},v.ensureContrastRatio=function(b,y,k){const R=s.ensureContrastRatio(b.rgba,y.rgba,k);if(R)return s.toColor(R>>24&255,R>>16&255,R>>8&255)},v.opaque=function(b){const y=(255|b.rgba)>>>0;return[S,d,m]=s.toChannels(y),{css:w.toCss(S,d,m),rgba:y}},v.opacity=x,v.multiplyOpacity=function(b,y){return C=255&b.rgba,x(b,C*y/255)},v.toColorRGB=function(b){return[b.rgba>>24&255,b.rgba>>16&255,b.rgba>>8&255]}}(g||(l.color=g={})),function(v){let x,b;if(!f.isNode){const y=document.createElement("canvas");y.width=1,y.height=1;const k=y.getContext("2d",{willReadFrequently:!0});k&&(x=k,x.globalCompositeOperation="copy",b=x.createLinearGradient(0,0,1,1))}v.toColor=function(y){if(y.match(/#[\da-f]{3,8}/i))switch(y.length){case 4:return S=parseInt(y.slice(1,2).repeat(2),16),d=parseInt(y.slice(2,3).repeat(2),16),m=parseInt(y.slice(3,4).repeat(2),16),s.toColor(S,d,m);case 5:return S=parseInt(y.slice(1,2).repeat(2),16),d=parseInt(y.slice(2,3).repeat(2),16),m=parseInt(y.slice(3,4).repeat(2),16),C=parseInt(y.slice(4,5).repeat(2),16),s.toColor(S,d,m,C);case 7:return{css:y,rgba:(parseInt(y.slice(1),16)<<8|255)>>>0};case 9:return{css:y,rgba:parseInt(y.slice(1),16)>>>0}}const k=y.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 S=parseInt(k[1]),d=parseInt(k[2]),m=parseInt(k[3]),C=Math.round(255*(k[5]===void 0?1:parseFloat(k[5]))),s.toColor(S,d,m,C);if(!x||!b)throw new Error("css.toColor: Unsupported css format");if(x.fillStyle=b,x.fillStyle=y,typeof x.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(x.fillRect(0,0,1,1),[S,d,m,C]=x.getImageData(0,0,1,1).data,C!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:w.toRgba(S,d,m,C),css:y}}}(a||(l.css=a={})),function(v){function x(b,y,k){const R=b/255,O=y/255,T=k/255;return .2126*(R<=.03928?R/12.92:Math.pow((R+.055)/1.055,2.4))+.7152*(O<=.03928?O/12.92:Math.pow((O+.055)/1.055,2.4))+.0722*(T<=.03928?T/12.92:Math.pow((T+.055)/1.055,2.4))}v.relativeLuminance=function(b){return x(b>>16&255,b>>8&255,255&b)},v.relativeLuminance2=x}(o||(l.rgb=o={})),function(v){function x(y,k,R){const O=y>>24&255,T=y>>16&255,B=y>>8&255;let z=k>>24&255,I=k>>16&255,j=k>>8&255,$=p(o.relativeLuminance2(z,I,j),o.relativeLuminance2(O,T,B));for(;$<R&&(z>0||I>0||j>0);)z-=Math.max(0,Math.ceil(.1*z)),I-=Math.max(0,Math.ceil(.1*I)),j-=Math.max(0,Math.ceil(.1*j)),$=p(o.relativeLuminance2(z,I,j),o.relativeLuminance2(O,T,B));return(z<<24|I<<16|j<<8|255)>>>0}function b(y,k,R){const O=y>>24&255,T=y>>16&255,B=y>>8&255;let z=k>>24&255,I=k>>16&255,j=k>>8&255,$=p(o.relativeLuminance2(z,I,j),o.relativeLuminance2(O,T,B));for(;$<R&&(z<255||I<255||j<255);)z=Math.min(255,z+Math.ceil(.1*(255-z))),I=Math.min(255,I+Math.ceil(.1*(255-I))),j=Math.min(255,j+Math.ceil(.1*(255-j))),$=p(o.relativeLuminance2(z,I,j),o.relativeLuminance2(O,T,B));return(z<<24|I<<16|j<<8|255)>>>0}v.ensureContrastRatio=function(y,k,R){const O=o.relativeLuminance(y>>8),T=o.relativeLuminance(k>>8);if(p(O,T)<R){if(T<O){const I=x(y,k,R),j=p(O,o.relativeLuminance(I>>8));if(j<R){const $=b(y,k,R);return j>p(O,o.relativeLuminance($>>8))?I:$}return I}const B=b(y,k,R),z=p(O,o.relativeLuminance(B>>8));if(z<R){const I=x(y,k,R);return z>p(O,o.relativeLuminance(I>>8))?B:I}return B}},v.reduceLuminance=x,v.increaseLuminance=b,v.toChannels=function(y){return[y>>24&255,y>>16&255,y>>8&255,255&y]},v.toColor=function(y,k,R,O){return{css:w.toCss(y,k,R,O),rgba:w.toRgba(y,k,R,O)}}}(s||(l.rgba=s={})),l.toPaddedHex=c,l.contrastRatio=p},8969:(_,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.CoreTerminal=void 0;const f=u(844),S=u(2585),d=u(4348),m=u(7866),C=u(744),w=u(7302),g=u(6975),a=u(8460),o=u(1753),s=u(1480),c=u(7994),p=u(9282),v=u(5435),x=u(5981),b=u(2660);let y=!1;class k extends f.Disposable{get onScroll(){return this._onScrollApi||(this._onScrollApi=this.register(new a.EventEmitter),this._onScroll.event(O=>{var T;(T=this._onScrollApi)===null||T===void 0||T.fire(O.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(O){for(const T in O)this.optionsService.options[T]=O[T]}constructor(O){super(),this._windowsWrappingHeuristics=this.register(new f.MutableDisposable),this._onBinary=this.register(new a.EventEmitter),this.onBinary=this._onBinary.event,this._onData=this.register(new a.EventEmitter),this.onData=this._onData.event,this._onLineFeed=this.register(new a.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onResize=this.register(new a.EventEmitter),this.onResize=this._onResize.event,this._onWriteParsed=this.register(new a.EventEmitter),this.onWriteParsed=this._onWriteParsed.event,this._onScroll=this.register(new a.EventEmitter),this._instantiationService=new d.InstantiationService,this.optionsService=this.register(new w.OptionsService(O)),this._instantiationService.setService(S.IOptionsService,this.optionsService),this._bufferService=this.register(this._instantiationService.createInstance(C.BufferService)),this._instantiationService.setService(S.IBufferService,this._bufferService),this._logService=this.register(this._instantiationService.createInstance(m.LogService)),this._instantiationService.setService(S.ILogService,this._logService),this.coreService=this.register(this._instantiationService.createInstance(g.CoreService)),this._instantiationService.setService(S.ICoreService,this.coreService),this.coreMouseService=this.register(this._instantiationService.createInstance(o.CoreMouseService)),this._instantiationService.setService(S.ICoreMouseService,this.coreMouseService),this.unicodeService=this.register(this._instantiationService.createInstance(s.UnicodeService)),this._instantiationService.setService(S.IUnicodeService,this.unicodeService),this._charsetService=this._instantiationService.createInstance(c.CharsetService),this._instantiationService.setService(S.ICharsetService,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(b.OscLinkService),this._instantiationService.setService(S.IOscLinkService,this._oscLinkService),this._inputHandler=this.register(new v.InputHandler(this._bufferService,this._charsetService,this.coreService,this._logService,this.optionsService,this._oscLinkService,this.coreMouseService,this.unicodeService)),this.register((0,a.forwardEvent)(this._inputHandler.onLineFeed,this._onLineFeed)),this.register(this._inputHandler),this.register((0,a.forwardEvent)(this._bufferService.onResize,this._onResize)),this.register((0,a.forwardEvent)(this.coreService.onData,this._onData)),this.register((0,a.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(T=>{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(T=>{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((T,B)=>this._inputHandler.parse(T,B))),this.register((0,a.forwardEvent)(this._writeBuffer.onWriteParsed,this._onWriteParsed))}write(O,T){this._writeBuffer.write(O,T)}writeSync(O,T){this._logService.logLevel<=S.LogLevelEnum.WARN&&!y&&(this._logService.warn("writeSync is unreliable and will be removed soon."),y=!0),this._writeBuffer.writeSync(O,T)}resize(O,T){isNaN(O)||isNaN(T)||(O=Math.max(O,C.MINIMUM_COLS),T=Math.max(T,C.MINIMUM_ROWS),this._bufferService.resize(O,T))}scroll(O,T=!1){this._bufferService.scroll(O,T)}scrollLines(O,T,B){this._bufferService.scrollLines(O,T,B)}scrollPages(O){this.scrollLines(O*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(){this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(O){const T=O-this._bufferService.buffer.ydisp;T!==0&&this.scrollLines(T)}registerEscHandler(O,T){return this._inputHandler.registerEscHandler(O,T)}registerDcsHandler(O,T){return this._inputHandler.registerDcsHandler(O,T)}registerCsiHandler(O,T){return this._inputHandler.registerCsiHandler(O,T)}registerOscHandler(O,T){return this._inputHandler.registerOscHandler(O,T)}_setup(){this._handleWindowsPtyOptionChange()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_handleWindowsPtyOptionChange(){let O=!1;const T=this.optionsService.rawOptions.windowsPty;T&&T.buildNumber!==void 0&&T.buildNumber!==void 0?O=T.backend==="conpty"&&T.buildNumber<21376:this.optionsService.rawOptions.windowsMode&&(O=!0),O?this._enableWindowsWrappingHeuristics():this._windowsWrappingHeuristics.clear()}_enableWindowsWrappingHeuristics(){if(!this._windowsWrappingHeuristics.value){const O=[];O.push(this.onLineFeed(p.updateWindowsModeWrappedState.bind(null,this._bufferService))),O.push(this.registerCsiHandler({final:"H"},()=>((0,p.updateWindowsModeWrappedState)(this._bufferService),!1))),this._windowsWrappingHeuristics.value=(0,f.toDisposable)(()=>{for(const T of O)T.dispose()})}}}l.CoreTerminal=k},8460:(_,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.forwardEvent=l.EventEmitter=void 0,l.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 S=[];for(let d=0;d<this._listeners.length;d++)S.push(this._listeners[d]);for(let d=0;d<S.length;d++)S[d].call(void 0,u,f)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},l.forwardEvent=function(u,f){return u(S=>f.fire(S))}},5435:function(_,l,u){var f=this&&this.__decorate||function($,E,A,P){var M,H=arguments.length,K=H<3?E:P===null?P=Object.getOwnPropertyDescriptor(E,A):P;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")K=Reflect.decorate($,E,A,P);else for(var X=$.length-1;X>=0;X--)(M=$[X])&&(K=(H<3?M(K):H>3?M(E,A,K):M(E,A))||K);return H>3&&K&&Object.defineProperty(E,A,K),K},S=this&&this.__param||function($,E){return function(A,P){E(A,P,$)}};Object.defineProperty(l,"__esModule",{value:!0}),l.InputHandler=l.WindowsOptionsReportType=void 0;const d=u(2584),m=u(7116),C=u(2015),w=u(844),g=u(482),a=u(8437),o=u(8460),s=u(643),c=u(511),p=u(3734),v=u(2585),x=u(6242),b=u(6351),y=u(5941),k={"(":0,")":1,"*":2,"+":3,"-":1,".":2},R=131072;function O($,E){if($>24)return E.setWinLines||!1;switch($){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($){$[$.GET_WIN_SIZE_PIXELS=0]="GET_WIN_SIZE_PIXELS",$[$.GET_CELL_SIZE_PIXELS=1]="GET_CELL_SIZE_PIXELS"})(T||(l.WindowsOptionsReportType=T={}));let B=0;class z extends w.Disposable{getAttrData(){return this._curAttrData}constructor(E,A,P,M,H,K,X,q,se=new C.EscapeSequenceParser){super(),this._bufferService=E,this._charsetService=A,this._coreService=P,this._logService=M,this._optionsService=H,this._oscLinkService=K,this._coreMouseService=X,this._unicodeService=q,this._parser=se,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new g.StringToUtf32,this._utf8Decoder=new g.Utf8ToUtf32,this._workCell=new c.CellData,this._windowTitle="",this._iconName="",this._windowTitleStack=[],this._iconNameStack=[],this._curAttrData=a.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=a.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 I(this._bufferService),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate(D=>this._activeBuffer=D.activeBuffer)),this._parser.setCsiHandlerFallback((D,F)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString(D),params:F.toArray()})}),this._parser.setEscHandlerFallback(D=>{this._logService.debug("Unknown ESC code: ",{identifier:this._parser.identToString(D)})}),this._parser.setExecuteHandlerFallback(D=>{this._logService.debug("Unknown EXECUTE code: ",{code:D})}),this._parser.setOscHandlerFallback((D,F,W)=>{this._logService.debug("Unknown OSC code: ",{identifier:D,action:F,data:W})}),this._parser.setDcsHandlerFallback((D,F,W)=>{F==="HOOK"&&(W=W.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(D),action:F,payload:W})}),this._parser.setPrintHandler((D,F,W)=>this.print(D,F,W)),this._parser.registerCsiHandler({final:"@"},D=>this.insertChars(D)),this._parser.registerCsiHandler({intermediates:" ",final:"@"},D=>this.scrollLeft(D)),this._parser.registerCsiHandler({final:"A"},D=>this.cursorUp(D)),this._parser.registerCsiHandler({intermediates:" ",final:"A"},D=>this.scrollRight(D)),this._parser.registerCsiHandler({final:"B"},D=>this.cursorDown(D)),this._parser.registerCsiHandler({final:"C"},D=>this.cursorForward(D)),this._parser.registerCsiHandler({final:"D"},D=>this.cursorBackward(D)),this._parser.registerCsiHandler({final:"E"},D=>this.cursorNextLine(D)),this._parser.registerCsiHandler({final:"F"},D=>this.cursorPrecedingLine(D)),this._parser.registerCsiHandler({final:"G"},D=>this.cursorCharAbsolute(D)),this._parser.registerCsiHandler({final:"H"},D=>this.cursorPosition(D)),this._parser.registerCsiHandler({final:"I"},D=>this.cursorForwardTab(D)),this._parser.registerCsiHandler({final:"J"},D=>this.eraseInDisplay(D,!1)),this._parser.registerCsiHandler({prefix:"?",final:"J"},D=>this.eraseInDisplay(D,!0)),this._parser.registerCsiHandler({final:"K"},D=>this.eraseInLine(D,!1)),this._parser.registerCsiHandler({prefix:"?",final:"K"},D=>this.eraseInLine(D,!0)),this._parser.registerCsiHandler({final:"L"},D=>this.insertLines(D)),this._parser.registerCsiHandler({final:"M"},D=>this.deleteLines(D)),this._parser.registerCsiHandler({final:"P"},D=>this.deleteChars(D)),this._parser.registerCsiHandler({final:"S"},D=>this.scrollUp(D)),this._parser.registerCsiHandler({final:"T"},D=>this.scrollDown(D)),this._parser.registerCsiHandler({final:"X"},D=>this.eraseChars(D)),this._parser.registerCsiHandler({final:"Z"},D=>this.cursorBackwardTab(D)),this._parser.registerCsiHandler({final:"`"},D=>this.charPosAbsolute(D)),this._parser.registerCsiHandler({final:"a"},D=>this.hPositionRelative(D)),this._parser.registerCsiHandler({final:"b"},D=>this.repeatPrecedingCharacter(D)),this._parser.registerCsiHandler({final:"c"},D=>this.sendDeviceAttributesPrimary(D)),this._parser.registerCsiHandler({prefix:">",final:"c"},D=>this.sendDeviceAttributesSecondary(D)),this._parser.registerCsiHandler({final:"d"},D=>this.linePosAbsolute(D)),this._parser.registerCsiHandler({final:"e"},D=>this.vPositionRelative(D)),this._parser.registerCsiHandler({final:"f"},D=>this.hVPosition(D)),this._parser.registerCsiHandler({final:"g"},D=>this.tabClear(D)),this._parser.registerCsiHandler({final:"h"},D=>this.setMode(D)),this._parser.registerCsiHandler({prefix:"?",final:"h"},D=>this.setModePrivate(D)),this._parser.registerCsiHandler({final:"l"},D=>this.resetMode(D)),this._parser.registerCsiHandler({prefix:"?",final:"l"},D=>this.resetModePrivate(D)),this._parser.registerCsiHandler({final:"m"},D=>this.charAttributes(D)),this._parser.registerCsiHandler({final:"n"},D=>this.deviceStatus(D)),this._parser.registerCsiHandler({prefix:"?",final:"n"},D=>this.deviceStatusPrivate(D)),this._parser.registerCsiHandler({intermediates:"!",final:"p"},D=>this.softReset(D)),this._parser.registerCsiHandler({intermediates:" ",final:"q"},D=>this.setCursorStyle(D)),this._parser.registerCsiHandler({final:"r"},D=>this.setScrollRegion(D)),this._parser.registerCsiHandler({final:"s"},D=>this.saveCursor(D)),this._parser.registerCsiHandler({final:"t"},D=>this.windowOptions(D)),this._parser.registerCsiHandler({final:"u"},D=>this.restoreCursor(D)),this._parser.registerCsiHandler({intermediates:"'",final:"}"},D=>this.insertColumns(D)),this._parser.registerCsiHandler({intermediates:"'",final:"~"},D=>this.deleteColumns(D)),this._parser.registerCsiHandler({intermediates:'"',final:"q"},D=>this.selectProtected(D)),this._parser.registerCsiHandler({intermediates:"$",final:"p"},D=>this.requestMode(D,!0)),this._parser.registerCsiHandler({prefix:"?",intermediates:"$",final:"p"},D=>this.requestMode(D,!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 x.OscHandler(D=>(this.setTitle(D),this.setIconName(D),!0))),this._parser.registerOscHandler(1,new x.OscHandler(D=>this.setIconName(D))),this._parser.registerOscHandler(2,new x.OscHandler(D=>this.setTitle(D))),this._parser.registerOscHandler(4,new x.OscHandler(D=>this.setOrReportIndexedColor(D))),this._parser.registerOscHandler(8,new x.OscHandler(D=>this.setHyperlink(D))),this._parser.registerOscHandler(10,new x.OscHandler(D=>this.setOrReportFgColor(D))),this._parser.registerOscHandler(11,new x.OscHandler(D=>this.setOrReportBgColor(D))),this._parser.registerOscHandler(12,new x.OscHandler(D=>this.setOrReportCursorColor(D))),this._parser.registerOscHandler(104,new x.OscHandler(D=>this.restoreIndexedColor(D))),this._parser.registerOscHandler(110,new x.OscHandler(D=>this.restoreFgColor(D))),this._parser.registerOscHandler(111,new x.OscHandler(D=>this.restoreBgColor(D))),this._parser.registerOscHandler(112,new x.OscHandler(D=>this.restoreCursorColor(D))),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 D in m.CHARSETS)this._parser.registerEscHandler({intermediates:"(",final:D},()=>this.selectCharset("("+D)),this._parser.registerEscHandler({intermediates:")",final:D},()=>this.selectCharset(")"+D)),this._parser.registerEscHandler({intermediates:"*",final:D},()=>this.selectCharset("*"+D)),this._parser.registerEscHandler({intermediates:"+",final:D},()=>this.selectCharset("+"+D)),this._parser.registerEscHandler({intermediates:"-",final:D},()=>this.selectCharset("-"+D)),this._parser.registerEscHandler({intermediates:".",final:D},()=>this.selectCharset("."+D)),this._parser.registerEscHandler({intermediates:"/",final:D},()=>this.selectCharset("/"+D));this._parser.registerEscHandler({intermediates:"#",final:"8"},()=>this.screenAlignmentPattern()),this._parser.setErrorHandler(D=>(this._logService.error("Parsing error: ",D),D)),this._parser.registerDcsHandler({intermediates:"$",final:"q"},new b.DcsHandler((D,F)=>this.requestStatusString(D,F)))}_preserveStack(E,A,P,M){this._parseStack.paused=!0,this._parseStack.cursorStartX=E,this._parseStack.cursorStartY=A,this._parseStack.decodedLength=P,this._parseStack.position=M}_logSlowResolvingAsync(E){this._logService.logLevel<=v.LogLevelEnum.WARN&&Promise.race([E,new Promise((A,P)=>setTimeout(()=>P("#SLOW_TIMEOUT"),5e3))]).catch(A=>{if(A!=="#SLOW_TIMEOUT")throw A;console.warn("async parser handler taking longer than 5000 ms")})}_getCurrentLinkId(){return this._curAttrData.extended.urlId}parse(E,A){let P,M=this._activeBuffer.x,H=this._activeBuffer.y,K=0;const X=this._parseStack.paused;if(X){if(P=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,A))return this._logSlowResolvingAsync(P),P;M=this._parseStack.cursorStartX,H=this._parseStack.cursorStartY,this._parseStack.paused=!1,E.length>R&&(K=this._parseStack.position+R)}if(this._logService.logLevel<=v.LogLevelEnum.DEBUG&&this._logService.debug("parsing data"+(typeof E=="string"?` "${E}"`:` "${Array.prototype.map.call(E,q=>String.fromCharCode(q)).join("")}"`),typeof E=="string"?E.split("").map(q=>q.charCodeAt(0)):E),this._parseBuffer.length<E.length&&this._parseBuffer.length<R&&(this._parseBuffer=new Uint32Array(Math.min(E.length,R))),X||this._dirtyRowTracker.clearRange(),E.length>R)for(let q=K;q<E.length;q+=R){const se=q+R<E.length?q+R:E.length,D=typeof E=="string"?this._stringDecoder.decode(E.substring(q,se),this._parseBuffer):this._utf8Decoder.decode(E.subarray(q,se),this._parseBuffer);if(P=this._parser.parse(this._parseBuffer,D))return this._preserveStack(M,H,D,q),this._logSlowResolvingAsync(P),P}else if(!X){const q=typeof E=="string"?this._stringDecoder.decode(E,this._parseBuffer):this._utf8Decoder.decode(E,this._parseBuffer);if(P=this._parser.parse(this._parseBuffer,q))return this._preserveStack(M,H,q,0),this._logSlowResolvingAsync(P),P}this._activeBuffer.x===M&&this._activeBuffer.y===H||this._onCursorMove.fire(),this._onRequestRefreshRows.fire(this._dirtyRowTracker.start,this._dirtyRowTracker.end)}print(E,A,P){let M,H;const K=this._charsetService.charset,X=this._optionsService.rawOptions.screenReaderMode,q=this._bufferService.cols,se=this._coreService.decPrivateModes.wraparound,D=this._coreService.modes.insertMode,F=this._curAttrData;let W=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._activeBuffer.x&&P-A>0&&W.getWidth(this._activeBuffer.x-1)===2&&W.setCellFromCodePoint(this._activeBuffer.x-1,0,1,F.fg,F.bg,F.extended);for(let U=A;U<P;++U){if(M=E[U],H=this._unicodeService.wcwidth(M),M<127&&K){const re=K[String.fromCharCode(M)];re&&(M=re.charCodeAt(0))}if(X&&this._onA11yChar.fire((0,g.stringFromCodePoint)(M)),this._getCurrentLinkId()&&this._oscLinkService.addLineToLink(this._getCurrentLinkId(),this._activeBuffer.ybase+this._activeBuffer.y),H||!this._activeBuffer.x){if(this._activeBuffer.x+H-1>=q){if(se){for(;this._activeBuffer.x<q;)W.setCellFromCodePoint(this._activeBuffer.x++,0,1,F.fg,F.bg,F.extended);this._activeBuffer.x=0,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),W=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y)}else if(this._activeBuffer.x=q-1,H===2)continue}if(D&&(W.insertCells(this._activeBuffer.x,H,this._activeBuffer.getNullCell(F),F),W.getWidth(q-1)===2&&W.setCellFromCodePoint(q-1,s.NULL_CELL_CODE,s.NULL_CELL_WIDTH,F.fg,F.bg,F.extended)),W.setCellFromCodePoint(this._activeBuffer.x++,M,H,F.fg,F.bg,F.extended),H>0)for(;--H;)W.setCellFromCodePoint(this._activeBuffer.x++,0,0,F.fg,F.bg,F.extended)}else W.getWidth(this._activeBuffer.x-1)?W.addCodepointToCell(this._activeBuffer.x-1,M):W.addCodepointToCell(this._activeBuffer.x-2,M)}P-A>0&&(W.loadCell(this._activeBuffer.x-1,this._workCell),this._workCell.getWidth()===2||this._workCell.getCode()>65535?this._parser.precedingCodepoint=0:this._workCell.isCombined()?this._parser.precedingCodepoint=this._workCell.getChars().charCodeAt(0):this._parser.precedingCodepoint=this._workCell.content),this._activeBuffer.x<q&&P-A>0&&W.getWidth(this._activeBuffer.x)===0&&!W.hasContent(this._activeBuffer.x)&&W.setCellFromCodePoint(this._activeBuffer.x,0,1,F.fg,F.bg,F.extended),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler(E,A){return E.final!=="t"||E.prefix||E.intermediates?this._parser.registerCsiHandler(E,A):this._parser.registerCsiHandler(E,P=>!O(P.params[0],this._optionsService.rawOptions.windowOptions)||A(P))}registerDcsHandler(E,A){return this._parser.registerDcsHandler(E,new b.DcsHandler(A))}registerEscHandler(E,A){return this._parser.registerEscHandler(E,A)}registerOscHandler(E,A){return this._parser.registerOscHandler(E,new x.OscHandler(A))}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===void 0)&&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 A=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);A.hasWidth(this._activeBuffer.x)&&!A.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,A){this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=E,this._activeBuffer.y=this._activeBuffer.scrollTop+A):(this._activeBuffer.x=E,this._activeBuffer.y=A),this._restrictCursor(),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_moveCursor(E,A){this._restrictCursor(),this._setCursor(this._activeBuffer.x+E,this._activeBuffer.y+A)}cursorUp(E){const A=this._activeBuffer.y-this._activeBuffer.scrollTop;return A>=0?this._moveCursor(0,-Math.min(A,E.params[0]||1)):this._moveCursor(0,-(E.params[0]||1)),!0}cursorDown(E){const A=this._activeBuffer.scrollBottom-this._activeBuffer.y;return A>=0?this._moveCursor(0,Math.min(A,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 A=E.params[0];return A===0?delete this._activeBuffer.tabs[this._activeBuffer.x]:A===3&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(E){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let A=E.params[0]||1;for(;A--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0}cursorBackwardTab(E){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let A=E.params[0]||1;for(;A--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0}selectProtected(E){const A=E.params[0];return A===1&&(this._curAttrData.bg|=536870912),A!==2&&A!==0||(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine(E,A,P,M=!1,H=!1){const K=this._activeBuffer.lines.get(this._activeBuffer.ybase+E);K.replaceCells(A,P,this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData(),H),M&&(K.isWrapped=!1)}_resetBufferLine(E,A=!1){const P=this._activeBuffer.lines.get(this._activeBuffer.ybase+E);P&&(P.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),A),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+E),P.isWrapped=!1)}eraseInDisplay(E,A=!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,A);P<this._bufferService.rows;P++)this._resetBufferLine(P,A);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,A),this._activeBuffer.x+1>=this._bufferService.cols&&(this._activeBuffer.lines.get(P+1).isWrapped=!1);P--;)this._resetBufferLine(P,A);this._dirtyRowTracker.markDirty(0);break;case 2:for(P=this._bufferService.rows,this._dirtyRowTracker.markDirty(P-1);P--;)this._resetBufferLine(P,A);this._dirtyRowTracker.markDirty(0);break;case 3:const M=this._activeBuffer.lines.length-this._bufferService.rows;M>0&&(this._activeBuffer.lines.trimStart(M),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-M,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-M,0),this._onScroll.fire(0))}return!0}eraseInLine(E,A=!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,A);break;case 1:this._eraseInBufferLine(this._activeBuffer.y,0,this._activeBuffer.x+1,!1,A);break;case 2:this._eraseInBufferLine(this._activeBuffer.y,0,this._bufferService.cols,!0,A)}return this._dirtyRowTracker.markDirty(this._activeBuffer.y),!0}insertLines(E){this._restrictCursor();let A=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,M=this._bufferService.rows-1-this._activeBuffer.scrollBottom,H=this._bufferService.rows-1+this._activeBuffer.ybase-M+1;for(;A--;)this._activeBuffer.lines.splice(H-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 A=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 M;for(M=this._bufferService.rows-1-this._activeBuffer.scrollBottom,M=this._bufferService.rows-1+this._activeBuffer.ybase-M;A--;)this._activeBuffer.lines.splice(P,1),this._activeBuffer.lines.splice(M,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 A=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return A&&(A.insertCells(this._activeBuffer.x,E.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}deleteChars(E){this._restrictCursor();const A=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return A&&(A.deleteCells(this._activeBuffer.x,E.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}scrollUp(E){let A=E.params[0]||1;for(;A--;)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 A=E.params[0]||1;for(;A--;)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(a.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 A=E.params[0]||1;for(let P=this._activeBuffer.scrollTop;P<=this._activeBuffer.scrollBottom;++P){const M=this._activeBuffer.lines.get(this._activeBuffer.ybase+P);M.deleteCells(0,A,this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),M.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 A=E.params[0]||1;for(let P=this._activeBuffer.scrollTop;P<=this._activeBuffer.scrollBottom;++P){const M=this._activeBuffer.lines.get(this._activeBuffer.ybase+P);M.insertCells(0,A,this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),M.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 A=E.params[0]||1;for(let P=this._activeBuffer.scrollTop;P<=this._activeBuffer.scrollBottom;++P){const M=this._activeBuffer.lines.get(this._activeBuffer.ybase+P);M.insertCells(this._activeBuffer.x,A,this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),M.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 A=E.params[0]||1;for(let P=this._activeBuffer.scrollTop;P<=this._activeBuffer.scrollBottom;++P){const M=this._activeBuffer.lines.get(this._activeBuffer.ybase+P);M.deleteCells(this._activeBuffer.x,A,this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),M.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}eraseChars(E){this._restrictCursor();const A=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return A&&(A.replaceCells(this._activeBuffer.x,this._activeBuffer.x+(E.params[0]||1),this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}repeatPrecedingCharacter(E){if(!this._parser.precedingCodepoint)return!0;const A=E.params[0]||1,P=new Uint32Array(A);for(let M=0;M<A;++M)P[M]=this._parser.precedingCodepoint;return this.print(P,0,P.length),!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 A=0;A<E.length;A++)switch(E.params[A]){case 4:this._coreService.modes.insertMode=!0;break;case 20:this._optionsService.options.convertEol=!0}return!0}setModePrivate(E){for(let A=0;A<E.length;A++)switch(E.params[A]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!0;break;case 2:this._charsetService.setgCharset(0,m.DEFAULT_CHARSET),this._charsetService.setgCharset(1,m.DEFAULT_CHARSET),this._charsetService.setgCharset(2,m.DEFAULT_CHARSET),this._charsetService.setgCharset(3,m.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 A=0;A<E.length;A++)switch(E.params[A]){case 4:this._coreService.modes.insertMode=!1;break;case 20:this._optionsService.options.convertEol=!1}return!0}resetModePrivate(E){for(let A=0;A<E.length;A++)switch(E.params[A]){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[A]===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,A){const P=this._coreService.decPrivateModes,{activeProtocol:M,activeEncoding:H}=this._coreMouseService,K=this._coreService,{buffers:X,cols:q}=this._bufferService,{active:se,alt:D}=X,F=this._optionsService.rawOptions,W=ae=>ae?1:2,U=E.params[0];return re=U,J=A?U===2?4:U===4?W(K.modes.insertMode):U===12?3:U===20?W(F.convertEol):0:U===1?W(P.applicationCursorKeys):U===3?F.windowOptions.setWinLines?q===80?2:q===132?1:0:0:U===6?W(P.origin):U===7?W(P.wraparound):U===8?3:U===9?W(M==="X10"):U===12?W(F.cursorBlink):U===25?W(!K.isCursorHidden):U===45?W(P.reverseWraparound):U===66?W(P.applicationKeypad):U===67?4:U===1e3?W(M==="VT200"):U===1002?W(M==="DRAG"):U===1003?W(M==="ANY"):U===1004?W(P.sendFocus):U===1005?4:U===1006?W(H==="SGR"):U===1015?4:U===1016?W(H==="SGR_PIXELS"):U===1048?1:U===47||U===1047||U===1049?W(se===D):U===2004?W(P.bracketedPasteMode):0,K.triggerDataEvent(`${d.C0.ESC}[${A?"":"?"}${re};${J}$y`),!0;var re,J}_updateAttrColor(E,A,P,M,H){return A===2?(E|=50331648,E&=-16777216,E|=p.AttributeData.fromColorRGB([P,M,H])):A===5&&(E&=-50331904,E|=33554432|255&P),E}_extractColor(E,A,P){const M=[0,0,-1,0,0,0];let H=0,K=0;do{if(M[K+H]=E.params[A+K],E.hasSubParams(A+K)){const X=E.getSubParams(A+K);let q=0;do M[1]===5&&(H=1),M[K+q+1+H]=X[q];while(++q<X.length&&q+K+1+H<M.length);break}if(M[1]===5&&K+H>=2||M[1]===2&&K+H>=5)break;M[1]&&(H=1)}while(++K+A<E.length&&K+H<M.length);for(let X=2;X<M.length;++X)M[X]===-1&&(M[X]=0);switch(M[0]){case 38:P.fg=this._updateAttrColor(P.fg,M[1],M[3],M[4],M[5]);break;case 48:P.bg=this._updateAttrColor(P.bg,M[1],M[3],M[4],M[5]);break;case 58:P.extended=P.extended.clone(),P.extended.underlineColor=this._updateAttrColor(P.extended.underlineColor,M[1],M[3],M[4],M[5])}return K}_processUnderline(E,A){A.extended=A.extended.clone(),(!~E||E>5)&&(E=1),A.extended.underlineStyle=E,A.fg|=268435456,E===0&&(A.fg&=-268435457),A.updateExtended()}_processSGR0(E){E.fg=a.DEFAULT_ATTR_DATA.fg,E.bg=a.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 A=E.length;let P;const M=this._curAttrData;for(let H=0;H<A;H++)P=E.params[H],P>=30&&P<=37?(M.fg&=-50331904,M.fg|=16777216|P-30):P>=40&&P<=47?(M.bg&=-50331904,M.bg|=16777216|P-40):P>=90&&P<=97?(M.fg&=-50331904,M.fg|=16777224|P-90):P>=100&&P<=107?(M.bg&=-50331904,M.bg|=16777224|P-100):P===0?this._processSGR0(M):P===1?M.fg|=134217728:P===3?M.bg|=67108864:P===4?(M.fg|=268435456,this._processUnderline(E.hasSubParams(H)?E.getSubParams(H)[0]:1,M)):P===5?M.fg|=536870912:P===7?M.fg|=67108864:P===8?M.fg|=1073741824:P===9?M.fg|=2147483648:P===2?M.bg|=134217728:P===21?this._processUnderline(2,M):P===22?(M.fg&=-134217729,M.bg&=-134217729):P===23?M.bg&=-67108865:P===24?(M.fg&=-268435457,this._processUnderline(0,M)):P===25?M.fg&=-536870913:P===27?M.fg&=-67108865:P===28?M.fg&=-1073741825:P===29?M.fg&=2147483647:P===39?(M.fg&=-67108864,M.fg|=16777215&a.DEFAULT_ATTR_DATA.fg):P===49?(M.bg&=-67108864,M.bg|=16777215&a.DEFAULT_ATTR_DATA.bg):P===38||P===48||P===58?H+=this._extractColor(E,H,M):P===53?M.bg|=1073741824:P===55?M.bg&=-1073741825:P===59?(M.extended=M.extended.clone(),M.extended.underlineColor=-1,M.updateExtended()):P===100?(M.fg&=-67108864,M.fg|=16777215&a.DEFAULT_ATTR_DATA.fg,M.bg&=-67108864,M.bg|=16777215&a.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 A=this._activeBuffer.y+1,P=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${d.C0.ESC}[${A};${P}R`)}return!0}deviceStatusPrivate(E){if(E.params[0]===6){const A=this._activeBuffer.y+1,P=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${d.C0.ESC}[?${A};${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=a.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 A=E.params[0]||1;switch(A){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=A%2==1;return this._optionsService.options.cursorBlink=P,!0}setScrollRegion(E){const A=E.params[0]||1;let P;return(E.length<2||(P=E.params[1])>this._bufferService.rows||P===0)&&(P=this._bufferService.rows),P>A&&(this._activeBuffer.scrollTop=A-1,this._activeBuffer.scrollBottom=P-1,this._setCursor(0,0)),!0}windowOptions(E){if(!O(E.params[0],this._optionsService.rawOptions.windowOptions))return!0;const A=E.length>1?E.params[1]:0;switch(E.params[0]){case 14:A!==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:A!==0&&A!==2||(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>10&&this._windowTitleStack.shift()),A!==0&&A!==1||(this._iconNameStack.push(this._iconName),this._iconNameStack.length>10&&this._iconNameStack.shift());break;case 23:A!==0&&A!==2||this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),A!==0&&A!==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 A=[],P=E.split(";");for(;P.length>1;){const M=P.shift(),H=P.shift();if(/^\d+$/.exec(M)){const K=parseInt(M);if(j(K))if(H==="?")A.push({type:0,index:K});else{const X=(0,y.parseColor)(H);X&&A.push({type:1,index:K,color:X})}}}return A.length&&this._onColor.fire(A),!0}setHyperlink(E){const A=E.split(";");return!(A.length<2)&&(A[1]?this._createHyperlink(A[0],A[1]):!A[0]&&this._finishHyperlink())}_createHyperlink(E,A){this._getCurrentLinkId()&&this._finishHyperlink();const P=E.split(":");let M;const H=P.findIndex(K=>K.startsWith("id="));return H!==-1&&(M=P[H].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:M,uri:A}),this._curAttrData.updateExtended(),!0}_finishHyperlink(){return this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=0,this._curAttrData.updateExtended(),!0}_setOrReportSpecialColor(E,A){const P=E.split(";");for(let M=0;M<P.length&&!(A>=this._specialColors.length);++M,++A)if(P[M]==="?")this._onColor.fire([{type:0,index:this._specialColors[A]}]);else{const H=(0,y.parseColor)(P[M]);H&&this._onColor.fire([{type:1,index:this._specialColors[A],color:H}])}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 A=[],P=E.split(";");for(let M=0;M<P.length;++M)if(/^\d+$/.exec(P[M])){const H=parseInt(P[M]);j(H)&&A.push({type:2,index:H})}return A.length&&this._onColor.fire(A),!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,m.DEFAULT_CHARSET),!0}selectCharset(E){return E.length!==2?(this.selectDefaultCharset(),!0):(E[0]==="/"||this._charsetService.setgCharset(k[E[0]],m.CHARSETS[E[1]]||m.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=a.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=a.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 c.CellData;E.content=4194373,E.fg=this._curAttrData.fg,E.bg=this._curAttrData.bg,this._setCursor(0,0);for(let A=0;A<this._bufferService.rows;++A){const P=this._activeBuffer.ybase+this._activeBuffer.y+A,M=this._activeBuffer.lines.get(P);M&&(M.fill(E),M.isWrapped=!1)}return this._dirtyRowTracker.markAllDirty(),this._setCursor(0,0),!0}requestStatusString(E,A){const P=this._bufferService.buffer,M=this._optionsService.rawOptions;return(H=>(this._coreService.triggerDataEvent(`${d.C0.ESC}${H}${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}[M.cursorStyle]-(M.cursorBlink?1:0)} q`:"P0$r")}markRangeDirty(E,A){this._dirtyRowTracker.markRangeDirty(E,A)}}l.InputHandler=z;let I=class{constructor($){this._bufferService=$,this.clearRange()}clearRange(){this.start=this._bufferService.buffer.y,this.end=this._bufferService.buffer.y}markDirty($){$<this.start?this.start=$:$>this.end&&(this.end=$)}markRangeDirty($,E){$>E&&(B=$,$=E,E=B),$<this.start&&(this.start=$),E>this.end&&(this.end=E)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};function j($){return 0<=$&&$<256}I=f([S(0,v.IBufferService)],I)},844:(_,l)=>{function u(f){for(const S of f)S.dispose();f.length=0}Object.defineProperty(l,"__esModule",{value:!0}),l.getDisposeArrayDisposable=l.disposeArray=l.toDisposable=l.MutableDisposable=l.Disposable=void 0,l.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 S=this._disposables.indexOf(f);S!==-1&&this._disposables.splice(S,1)}},l.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(f){var S;this._isDisposed||f===this._value||((S=this._value)===null||S===void 0||S.dispose(),this._value=f)}clear(){this.value=void 0}dispose(){var f;this._isDisposed=!0,(f=this._value)===null||f===void 0||f.dispose(),this._value=void 0}},l.toDisposable=function(f){return{dispose:f}},l.disposeArray=u,l.getDisposeArrayDisposable=function(f){return{dispose:()=>u(f)}}},1505:(_,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.FourKeyMap=l.TwoKeyMap=void 0;class u{constructor(){this._data={}}set(S,d,m){this._data[S]||(this._data[S]={}),this._data[S][d]=m}get(S,d){return this._data[S]?this._data[S][d]:void 0}clear(){this._data={}}}l.TwoKeyMap=u,l.FourKeyMap=class{constructor(){this._data=new u}set(f,S,d,m,C){this._data.get(f,S)||this._data.set(f,S,new u),this._data.get(f,S).set(d,m,C)}get(f,S,d,m){var C;return(C=this._data.get(f,S))===null||C===void 0?void 0:C.get(d,m)}clear(){this._data.clear()}}},6114:(_,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.isChromeOS=l.isLinux=l.isWindows=l.isIphone=l.isIpad=l.isMac=l.getSafariVersion=l.isSafari=l.isLegacyEdge=l.isFirefox=l.isNode=void 0,l.isNode=typeof navigator>"u";const u=l.isNode?"node":navigator.userAgent,f=l.isNode?"node":navigator.platform;l.isFirefox=u.includes("Firefox"),l.isLegacyEdge=u.includes("Edge"),l.isSafari=/^((?!chrome|android).)*safari/i.test(u),l.getSafariVersion=function(){if(!l.isSafari)return 0;const S=u.match(/Version\/(\d+)/);return S===null||S.length<2?0:parseInt(S[1])},l.isMac=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(f),l.isIpad=f==="iPad",l.isIphone=f==="iPhone",l.isWindows=["Windows","Win16","Win32","WinCE"].includes(f),l.isLinux=f.indexOf("Linux")>=0,l.isChromeOS=/\bCrOS\b/.test(u)},6106:(_,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.SortedList=void 0;let u=0;l.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 S=this._getKey(f);if(S===void 0||(u=this._search(S),u===-1)||this._getKey(this._array[u])!==S)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])===S);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,S){if(this._array.length!==0&&(u=this._search(f),!(u<0||u>=this._array.length)&&this._getKey(this._array[u])===f))do S(this._array[u]);while(++u<this._array.length&&this._getKey(this._array[u])===f)}values(){return[...this._array].values()}_search(f){let S=0,d=this._array.length-1;for(;d>=S;){let m=S+d>>1;const C=this._getKey(this._array[m]);if(C>f)d=m-1;else{if(!(C<f)){for(;m>0&&this._getKey(this._array[m-1])===f;)m--;return m}S=m+1}}return S}}},7226:(_,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.DebouncedIdleTask=l.IdleTaskQueue=l.PriorityTaskQueue=void 0;const f=u(6114);class S{constructor(){this._tasks=[],this._i=0}enqueue(C){this._tasks.push(C),this._start()}flush(){for(;this._i<this._tasks.length;)this._tasks[this._i]()||this._i++;this.clear()}clear(){this._idleCallback&&(this._cancelCallback(this._idleCallback),this._idleCallback=void 0),this._i=0,this._tasks.length=0}_start(){this._idleCallback||(this._idleCallback=this._requestCallback(this._process.bind(this)))}_process(C){this._idleCallback=void 0;let w=0,g=0,a=C.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),g=Math.max(w,g),o=C.timeRemaining(),1.5*g>o)return a-w<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(a-w))}ms`),void this._start();a=o}this.clear()}}class d extends S{_requestCallback(C){return setTimeout(()=>C(this._createDeadline(16)))}_cancelCallback(C){clearTimeout(C)}_createDeadline(C){const w=Date.now()+C;return{timeRemaining:()=>Math.max(0,w-Date.now())}}}l.PriorityTaskQueue=d,l.IdleTaskQueue=!f.isNode&&"requestIdleCallback"in window?class extends S{_requestCallback(m){return requestIdleCallback(m)}_cancelCallback(m){cancelIdleCallback(m)}}:d,l.DebouncedIdleTask=class{constructor(){this._queue=new l.IdleTaskQueue}set(m){this._queue.clear(),this._queue.enqueue(m)}flush(){this._queue.flush()}}},9282:(_,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.updateWindowsModeWrappedState=void 0;const f=u(643);l.updateWindowsModeWrappedState=function(S){const d=S.buffer.lines.get(S.buffer.ybase+S.buffer.y-1),m=d==null?void 0:d.get(S.cols-1),C=S.buffer.lines.get(S.buffer.ybase+S.buffer.y);C&&m&&(C.isWrapped=m[f.CHAR_DATA_CODE_INDEX]!==f.NULL_CELL_CODE&&m[f.CHAR_DATA_CODE_INDEX]!==f.WHITESPACE_CELL_CODE)}},3734:(_,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.ExtendedAttrs=l.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}}l.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}constructor(d=0,m=0){this._ext=0,this._urlId=0,this._ext=d,this._urlId=m}clone(){return new f(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}}l.ExtendedAttrs=f},9092:(_,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.Buffer=l.MAX_BUFFER_SIZE=void 0;const f=u(6349),S=u(7226),d=u(3734),m=u(8437),C=u(4634),w=u(511),g=u(643),a=u(4863),o=u(7116);l.MAX_BUFFER_SIZE=4294967295,l.Buffer=class{constructor(s,c,p){this._hasScrollback=s,this._optionsService=c,this._bufferService=p,this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.tabs={},this.savedY=0,this.savedX=0,this.savedCurAttrData=m.DEFAULT_ATTR_DATA.clone(),this.savedCharset=o.DEFAULT_CHARSET,this.markers=[],this._nullCell=w.CellData.fromCharData([0,g.NULL_CELL_CHAR,g.NULL_CELL_WIDTH,g.NULL_CELL_CODE]),this._whitespaceCell=w.CellData.fromCharData([0,g.WHITESPACE_CELL_CHAR,g.WHITESPACE_CELL_WIDTH,g.WHITESPACE_CELL_CODE]),this._isClearing=!1,this._memoryCleanupQueue=new S.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,c){return new m.BufferLine(this._bufferService.cols,this.getNullCell(s),c)}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 c=s+this._optionsService.rawOptions.scrollback;return c>l.MAX_BUFFER_SIZE?l.MAX_BUFFER_SIZE:c}fillViewportRows(s){if(this.lines.length===0){s===void 0&&(s=m.DEFAULT_ATTR_DATA);let c=this._rows;for(;c--;)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,c){const p=this.getNullCell(m.DEFAULT_ATTR_DATA);let v=0;const x=this._getCorrectBufferLength(c);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++)v+=+this.lines.get(y).resize(s,p);let b=0;if(this._rows<c)for(let y=this._rows;y<c;y++)this.lines.length<c+this.ybase&&(this._optionsService.rawOptions.windowsMode||this._optionsService.rawOptions.windowsPty.backend!==void 0||this._optionsService.rawOptions.windowsPty.buildNumber!==void 0?this.lines.push(new m.BufferLine(s,p)):this.ybase>0&&this.lines.length<=this.ybase+this.y+b+1?(this.ybase--,b++,this.ydisp>0&&this.ydisp--):this.lines.push(new m.BufferLine(s,p)));else for(let y=this._rows;y>c;y--)this.lines.length>c+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,c-1),b&&(this.y+=b),this.savedX=Math.min(this.savedX,s-1),this.scrollTop=0}if(this.scrollBottom=c-1,this._isReflowEnabled&&(this._reflow(s,c),this._cols>s))for(let b=0;b<this.lines.length;b++)v+=+this.lines.get(b).resize(s,p);this._cols=s,this._rows=c,this._memoryCleanupQueue.clear(),v>.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 c=0;for(;this._memoryCleanupPosition<this.lines.length;)if(c+=this.lines.get(this._memoryCleanupPosition++).cleanupMemory(),c>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,c){this._cols!==s&&(s>this._cols?this._reflowLarger(s,c):this._reflowSmaller(s,c))}_reflowLarger(s,c){const p=(0,C.reflowLargerGetLinesToRemove)(this.lines,this._cols,s,this.ybase+this.y,this.getNullCell(m.DEFAULT_ATTR_DATA));if(p.length>0){const v=(0,C.reflowLargerCreateNewLayout)(this.lines,p);(0,C.reflowLargerApplyNewLayout)(this.lines,v.layout),this._reflowLargerAdjustViewport(s,c,v.countRemoved)}}_reflowLargerAdjustViewport(s,c,p){const v=this.getNullCell(m.DEFAULT_ATTR_DATA);let x=p;for(;x-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length<c&&this.lines.push(new m.BufferLine(s,v))):(this.ydisp===this.ybase&&this.ydisp--,this.ybase--);this.savedY=Math.max(this.savedY-p,0)}_reflowSmaller(s,c){const p=this.getNullCell(m.DEFAULT_ATTR_DATA),v=[];let x=0;for(let b=this.lines.length-1;b>=0;b--){let y=this.lines.get(b);if(!y||!y.isWrapped&&y.getTrimmedLength()<=s)continue;const k=[y];for(;y.isWrapped&&b>0;)y=this.lines.get(--b),k.unshift(y);const R=this.ybase+this.y;if(R>=b&&R<b+k.length)continue;const O=k[k.length-1].getTrimmedLength(),T=(0,C.reflowSmallerGetNewLineLengths)(k,this._cols,s),B=T.length-k.length;let z;z=this.ybase===0&&this.y!==this.lines.length-1?Math.max(0,this.y-this.lines.maxLength+B):Math.max(0,this.lines.length-this.lines.maxLength+B);const I=[];for(let M=0;M<B;M++){const H=this.getBlankLine(m.DEFAULT_ATTR_DATA,!0);I.push(H)}I.length>0&&(v.push({start:b+k.length+x,newLines:I}),x+=I.length),k.push(...I);let j=T.length-1,$=T[j];$===0&&(j--,$=T[j]);let E=k.length-B-1,A=O;for(;E>=0;){const M=Math.min(A,$);if(k[j]===void 0)break;if(k[j].copyCellsFrom(k[E],A-M,$-M,M,!0),$-=M,$===0&&(j--,$=T[j]),A-=M,A===0){E--;const H=Math.max(E,0);A=(0,C.getWrappedLineTrimmedLength)(k,H,this._cols)}}for(let M=0;M<k.length;M++)T[M]<s&&k[M].setCell(T[M],p);let P=B-z;for(;P-- >0;)this.ybase===0?this.y<c-1?(this.y++,this.lines.pop()):(this.ybase++,this.ydisp++):this.ybase<Math.min(this.lines.maxLength,this.lines.length+x)-c&&(this.ybase===this.ydisp&&this.ydisp++,this.ybase++);this.savedY=Math.min(this.savedY+B,this.ybase+c-1)}if(v.length>0){const b=[],y=[];for(let j=0;j<this.lines.length;j++)y.push(this.lines.get(j));const k=this.lines.length;let R=k-1,O=0,T=v[O];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+x);let B=0;for(let j=Math.min(this.lines.maxLength-1,k+x-1);j>=0;j--)if(T&&T.start>R+B){for(let $=T.newLines.length-1;$>=0;$--)this.lines.set(j--,T.newLines[$]);j++,b.push({index:R+1,amount:T.newLines.length}),B+=T.newLines.length,T=v[++O]}else this.lines.set(j,y[R--]);let z=0;for(let j=b.length-1;j>=0;j--)b[j].index+=z,this.lines.onInsertEmitter.fire(b[j]),z+=b[j].amount;const I=Math.max(0,k+x-this.lines.maxLength);I>0&&this.lines.onTrimEmitter.fire(I)}}translateBufferLineToString(s,c,p=0,v){const x=this.lines.get(s);return x?x.translateToString(c,p,v):""}getWrappedRangeForLine(s){let c=s,p=s;for(;c>0&&this.lines.get(c).isWrapped;)c--;for(;p+1<this.lines.length&&this.lines.get(p+1).isWrapped;)p++;return{first:c,last:p}}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 c=0;c<this.markers.length;c++)this.markers[c].line===s&&(this.markers[c].dispose(),this.markers.splice(c--,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 c=new a.Marker(s);return this.markers.push(c),c.register(this.lines.onTrim(p=>{c.line-=p,c.line<0&&c.dispose()})),c.register(this.lines.onInsert(p=>{c.line>=p.index&&(c.line+=p.amount)})),c.register(this.lines.onDelete(p=>{c.line>=p.index&&c.line<p.index+p.amount&&c.dispose(),c.line>p.index&&(c.line-=p.amount)})),c.register(c.onDispose(()=>this._removeMarker(c))),c}_removeMarker(s){this._isClearing||this.markers.splice(this.markers.indexOf(s),1)}}},8437:(_,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.BufferLine=l.DEFAULT_ATTR_DATA=void 0;const f=u(3734),S=u(511),d=u(643),m=u(482);l.DEFAULT_ATTR_DATA=Object.freeze(new f.AttributeData);let C=0;class w{constructor(a,o,s=!1){this.isWrapped=s,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(3*a);const c=o||S.CellData.fromCharData([0,d.NULL_CELL_CHAR,d.NULL_CELL_WIDTH,d.NULL_CELL_CODE]);for(let p=0;p<a;++p)this.setCell(p,c);this.length=a}get(a){const o=this._data[3*a+0],s=2097151&o;return[this._data[3*a+1],2097152&o?this._combined[a]:s?(0,m.stringFromCodePoint)(s):"",o>>22,2097152&o?this._combined[a].charCodeAt(this._combined[a].length-1):s]}set(a,o){this._data[3*a+1]=o[d.CHAR_DATA_ATTR_INDEX],o[d.CHAR_DATA_CHAR_INDEX].length>1?(this._combined[a]=o[1],this._data[3*a+0]=2097152|a|o[d.CHAR_DATA_WIDTH_INDEX]<<22):this._data[3*a+0]=o[d.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|o[d.CHAR_DATA_WIDTH_INDEX]<<22}getWidth(a){return this._data[3*a+0]>>22}hasWidth(a){return 12582912&this._data[3*a+0]}getFg(a){return this._data[3*a+1]}getBg(a){return this._data[3*a+2]}hasContent(a){return 4194303&this._data[3*a+0]}getCodePoint(a){const o=this._data[3*a+0];return 2097152&o?this._combined[a].charCodeAt(this._combined[a].length-1):2097151&o}isCombined(a){return 2097152&this._data[3*a+0]}getString(a){const o=this._data[3*a+0];return 2097152&o?this._combined[a]:2097151&o?(0,m.stringFromCodePoint)(2097151&o):""}isProtected(a){return 536870912&this._data[3*a+2]}loadCell(a,o){return C=3*a,o.content=this._data[C+0],o.fg=this._data[C+1],o.bg=this._data[C+2],2097152&o.content&&(o.combinedData=this._combined[a]),268435456&o.bg&&(o.extended=this._extendedAttrs[a]),o}setCell(a,o){2097152&o.content&&(this._combined[a]=o.combinedData),268435456&o.bg&&(this._extendedAttrs[a]=o.extended),this._data[3*a+0]=o.content,this._data[3*a+1]=o.fg,this._data[3*a+2]=o.bg}setCellFromCodePoint(a,o,s,c,p,v){268435456&p&&(this._extendedAttrs[a]=v),this._data[3*a+0]=o|s<<22,this._data[3*a+1]=c,this._data[3*a+2]=p}addCodepointToCell(a,o){let s=this._data[3*a+0];2097152&s?this._combined[a]+=(0,m.stringFromCodePoint)(o):(2097151&s?(this._combined[a]=(0,m.stringFromCodePoint)(2097151&s)+(0,m.stringFromCodePoint)(o),s&=-2097152,s|=2097152):s=o|4194304,this._data[3*a+0]=s)}insertCells(a,o,s,c){if((a%=this.length)&&this.getWidth(a-1)===2&&this.setCellFromCodePoint(a-1,0,1,(c==null?void 0:c.fg)||0,(c==null?void 0:c.bg)||0,(c==null?void 0:c.extended)||new f.ExtendedAttrs),o<this.length-a){const p=new S.CellData;for(let v=this.length-a-o-1;v>=0;--v)this.setCell(a+o+v,this.loadCell(a+v,p));for(let v=0;v<o;++v)this.setCell(a+v,s)}else for(let p=a;p<this.length;++p)this.setCell(p,s);this.getWidth(this.length-1)===2&&this.setCellFromCodePoint(this.length-1,0,1,(c==null?void 0:c.fg)||0,(c==null?void 0:c.bg)||0,(c==null?void 0:c.extended)||new f.ExtendedAttrs)}deleteCells(a,o,s,c){if(a%=this.length,o<this.length-a){const p=new S.CellData;for(let v=0;v<this.length-a-o;++v)this.setCell(a+v,this.loadCell(a+o+v,p));for(let v=this.length-o;v<this.length;++v)this.setCell(v,s)}else for(let p=a;p<this.length;++p)this.setCell(p,s);a&&this.getWidth(a-1)===2&&this.setCellFromCodePoint(a-1,0,1,(c==null?void 0:c.fg)||0,(c==null?void 0:c.bg)||0,(c==null?void 0:c.extended)||new f.ExtendedAttrs),this.getWidth(a)!==0||this.hasContent(a)||this.setCellFromCodePoint(a,0,1,(c==null?void 0:c.fg)||0,(c==null?void 0:c.bg)||0,(c==null?void 0:c.extended)||new f.ExtendedAttrs)}replaceCells(a,o,s,c,p=!1){if(p)for(a&&this.getWidth(a-1)===2&&!this.isProtected(a-1)&&this.setCellFromCodePoint(a-1,0,1,(c==null?void 0:c.fg)||0,(c==null?void 0:c.bg)||0,(c==null?void 0:c.extended)||new f.ExtendedAttrs),o<this.length&&this.getWidth(o-1)===2&&!this.isProtected(o)&&this.setCellFromCodePoint(o,0,1,(c==null?void 0:c.fg)||0,(c==null?void 0:c.bg)||0,(c==null?void 0:c.extended)||new f.ExtendedAttrs);a<o&&a<this.length;)this.isProtected(a)||this.setCell(a,s),a++;else for(a&&this.getWidth(a-1)===2&&this.setCellFromCodePoint(a-1,0,1,(c==null?void 0:c.fg)||0,(c==null?void 0:c.bg)||0,(c==null?void 0:c.extended)||new f.ExtendedAttrs),o<this.length&&this.getWidth(o-1)===2&&this.setCellFromCodePoint(o,0,1,(c==null?void 0:c.fg)||0,(c==null?void 0:c.bg)||0,(c==null?void 0:c.extended)||new f.ExtendedAttrs);a<o&&a<this.length;)this.setCell(a++,s)}resize(a,o){if(a===this.length)return 4*this._data.length*2<this._data.buffer.byteLength;const s=3*a;if(a>this.length){if(this._data.buffer.byteLength>=4*s)this._data=new Uint32Array(this._data.buffer,0,s);else{const c=new Uint32Array(s);c.set(this._data),this._data=c}for(let c=this.length;c<a;++c)this.setCell(c,o)}else{this._data=this._data.subarray(0,s);const c=Object.keys(this._combined);for(let v=0;v<c.length;v++){const x=parseInt(c[v],10);x>=a&&delete this._combined[x]}const p=Object.keys(this._extendedAttrs);for(let v=0;v<p.length;v++){const x=parseInt(p[v],10);x>=a&&delete this._extendedAttrs[x]}}return this.length=a,4*s*2<this._data.buffer.byteLength}cleanupMemory(){if(4*this._data.length*2<this._data.buffer.byteLength){const a=new Uint32Array(this._data.length);return a.set(this._data),this._data=a,1}return 0}fill(a,o=!1){if(o)for(let s=0;s<this.length;++s)this.isProtected(s)||this.setCell(s,a);else{this._combined={},this._extendedAttrs={};for(let s=0;s<this.length;++s)this.setCell(s,a)}}copyFrom(a){this.length!==a.length?this._data=new Uint32Array(a._data):this._data.set(a._data),this.length=a.length,this._combined={};for(const o in a._combined)this._combined[o]=a._combined[o];this._extendedAttrs={};for(const o in a._extendedAttrs)this._extendedAttrs[o]=a._extendedAttrs[o];this.isWrapped=a.isWrapped}clone(){const a=new w(0);a._data=new Uint32Array(this._data),a.length=this.length;for(const o in this._combined)a._combined[o]=this._combined[o];for(const o in this._extendedAttrs)a._extendedAttrs[o]=this._extendedAttrs[o];return a.isWrapped=this.isWrapped,a}getTrimmedLength(){for(let a=this.length-1;a>=0;--a)if(4194303&this._data[3*a+0])return a+(this._data[3*a+0]>>22);return 0}getNoBgTrimmedLength(){for(let a=this.length-1;a>=0;--a)if(4194303&this._data[3*a+0]||50331648&this._data[3*a+2])return a+(this._data[3*a+0]>>22);return 0}copyCellsFrom(a,o,s,c,p){const v=a._data;if(p)for(let b=c-1;b>=0;b--){for(let y=0;y<3;y++)this._data[3*(s+b)+y]=v[3*(o+b)+y];268435456&v[3*(o+b)+2]&&(this._extendedAttrs[s+b]=a._extendedAttrs[o+b])}else for(let b=0;b<c;b++){for(let y=0;y<3;y++)this._data[3*(s+b)+y]=v[3*(o+b)+y];268435456&v[3*(o+b)+2]&&(this._extendedAttrs[s+b]=a._extendedAttrs[o+b])}const x=Object.keys(a._combined);for(let b=0;b<x.length;b++){const y=parseInt(x[b],10);y>=o&&(this._combined[y-o+s]=a._combined[y])}}translateToString(a=!1,o=0,s=this.length){a&&(s=Math.min(s,this.getTrimmedLength()));let c="";for(;o<s;){const p=this._data[3*o+0],v=2097151&p;c+=2097152&p?this._combined[o]:v?(0,m.stringFromCodePoint)(v):d.WHITESPACE_CELL_CHAR,o+=p>>22||1}return c}}l.BufferLine=w},4841:(_,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.getRangeLength=void 0,l.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:(_,l)=>{function u(f,S,d){if(S===f.length-1)return f[S].getTrimmedLength();const m=!f[S].hasContent(d-1)&&f[S].getWidth(d-1)===1,C=f[S+1].getWidth(0)===2;return m&&C?d-1:d}Object.defineProperty(l,"__esModule",{value:!0}),l.getWrappedLineTrimmedLength=l.reflowSmallerGetNewLineLengths=l.reflowLargerApplyNewLayout=l.reflowLargerCreateNewLayout=l.reflowLargerGetLinesToRemove=void 0,l.reflowLargerGetLinesToRemove=function(f,S,d,m,C){const w=[];for(let g=0;g<f.length-1;g++){let a=g,o=f.get(++a);if(!o.isWrapped)continue;const s=[f.get(g)];for(;a<f.length&&o.isWrapped;)s.push(o),o=f.get(++a);if(m>=g&&m<a){g+=s.length-1;continue}let c=0,p=u(s,c,S),v=1,x=0;for(;v<s.length;){const y=u(s,v,S),k=y-x,R=d-p,O=Math.min(k,R);s[c].copyCellsFrom(s[v],x,p,O,!1),p+=O,p===d&&(c++,p=0),x+=O,x===y&&(v++,x=0),p===0&&c!==0&&s[c-1].getWidth(d-1)===2&&(s[c].copyCellsFrom(s[c-1],d-1,p++,1,!1),s[c-1].setCell(d-1,C))}s[c].replaceCells(p,d,C);let b=0;for(let y=s.length-1;y>0&&(y>c||s[y].getTrimmedLength()===0);y--)b++;b>0&&(w.push(g+s.length-b),w.push(b)),g+=s.length-1}return w},l.reflowLargerCreateNewLayout=function(f,S){const d=[];let m=0,C=S[m],w=0;for(let g=0;g<f.length;g++)if(C===g){const a=S[++m];f.onDeleteEmitter.fire({index:g-w,amount:a}),g+=a-1,w+=a,C=S[++m]}else d.push(g);return{layout:d,countRemoved:w}},l.reflowLargerApplyNewLayout=function(f,S){const d=[];for(let m=0;m<S.length;m++)d.push(f.get(S[m]));for(let m=0;m<d.length;m++)f.set(m,d[m]);f.length=S.length},l.reflowSmallerGetNewLineLengths=function(f,S,d){const m=[],C=f.map((o,s)=>u(f,s,S)).reduce((o,s)=>o+s);let w=0,g=0,a=0;for(;a<C;){if(C-a<d){m.push(C-a);break}w+=d;const o=u(f,g,S);w>o&&(w-=o,g++);const s=f[g].getWidth(w-1)===2;s&&w--;const c=s?d-1:d;m.push(c),a+=c}return m},l.getWrappedLineTrimmedLength=u},5295:(_,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.BufferSet=void 0;const f=u(8460),S=u(844),d=u(9092);class m extends S.Disposable{constructor(w,g){super(),this._optionsService=w,this._bufferService=g,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,g){this._normal.resize(w,g),this._alt.resize(w,g),this.setupTabStops(w)}setupTabStops(w){this._normal.setupTabStops(w),this._alt.setupTabStops(w)}}l.BufferSet=m},511:(_,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.CellData=void 0;const f=u(482),S=u(643),d=u(3734);class m 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 g=new m;return g.setFromCharData(w),g}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[S.CHAR_DATA_ATTR_INDEX],this.bg=0;let g=!1;if(w[S.CHAR_DATA_CHAR_INDEX].length>2)g=!0;else if(w[S.CHAR_DATA_CHAR_INDEX].length===2){const a=w[S.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=a&&a<=56319){const o=w[S.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=o&&o<=57343?this.content=1024*(a-55296)+o-56320+65536|w[S.CHAR_DATA_WIDTH_INDEX]<<22:g=!0}else g=!0}else this.content=w[S.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|w[S.CHAR_DATA_WIDTH_INDEX]<<22;g&&(this.combinedData=w[S.CHAR_DATA_CHAR_INDEX],this.content=2097152|w[S.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}l.CellData=m},643:(_,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.WHITESPACE_CELL_CODE=l.WHITESPACE_CELL_WIDTH=l.WHITESPACE_CELL_CHAR=l.NULL_CELL_CODE=l.NULL_CELL_WIDTH=l.NULL_CELL_CHAR=l.CHAR_DATA_CODE_INDEX=l.CHAR_DATA_WIDTH_INDEX=l.CHAR_DATA_CHAR_INDEX=l.CHAR_DATA_ATTR_INDEX=l.DEFAULT_EXT=l.DEFAULT_ATTR=l.DEFAULT_COLOR=void 0,l.DEFAULT_COLOR=0,l.DEFAULT_ATTR=256|l.DEFAULT_COLOR<<9,l.DEFAULT_EXT=0,l.CHAR_DATA_ATTR_INDEX=0,l.CHAR_DATA_CHAR_INDEX=1,l.CHAR_DATA_WIDTH_INDEX=2,l.CHAR_DATA_CODE_INDEX=3,l.NULL_CELL_CHAR="",l.NULL_CELL_WIDTH=1,l.NULL_CELL_CODE=0,l.WHITESPACE_CELL_CHAR=" ",l.WHITESPACE_CELL_WIDTH=1,l.WHITESPACE_CELL_CODE=32},4863:(_,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.Marker=void 0;const f=u(8460),S=u(844);class d{get id(){return this._id}constructor(C){this.line=C,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,S.disposeArray)(this._disposables),this._disposables.length=0)}register(C){return this._disposables.push(C),C}}l.Marker=d,d._nextId=1},7116:(_,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.DEFAULT_CHARSET=l.CHARSETS=void 0,l.CHARSETS={},l.DEFAULT_CHARSET=l.CHARSETS.B,l.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:"≥","{":"π","|":"≠","}":"£","~":"·"},l.CHARSETS.A={"#":"£"},l.CHARSETS.B=void 0,l.CHARSETS[4]={"#":"£","@":"¾","[":"ij","\\":"½","]":"|","{":"¨","|":"f","}":"¼","~":"´"},l.CHARSETS.C=l.CHARSETS[5]={"[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},l.CHARSETS.R={"#":"£","@":"à","[":"°","\\":"ç","]":"§","{":"é","|":"ù","}":"è","~":"¨"},l.CHARSETS.Q={"@":"à","[":"â","\\":"ç","]":"ê","^":"î","`":"ô","{":"é","|":"ù","}":"è","~":"û"},l.CHARSETS.K={"@":"§","[":"Ä","\\":"Ö","]":"Ü","{":"ä","|":"ö","}":"ü","~":"ß"},l.CHARSETS.Y={"#":"£","@":"§","[":"°","\\":"ç","]":"é","`":"ù","{":"à","|":"ò","}":"è","~":"ì"},l.CHARSETS.E=l.CHARSETS[6]={"@":"Ä","[":"Æ","\\":"Ø","]":"Å","^":"Ü","`":"ä","{":"æ","|":"ø","}":"å","~":"ü"},l.CHARSETS.Z={"#":"£","@":"§","[":"¡","\\":"Ñ","]":"¿","{":"°","|":"ñ","}":"ç"},l.CHARSETS.H=l.CHARSETS[7]={"@":"É","[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},l.CHARSETS["="]={"#":"ù","@":"à","[":"é","\\":"ç","]":"ê","^":"î",_:"è","`":"ô","{":"ä","|":"ö","}":"ü","~":"û"}},2584:(_,l)=>{var u,f,S;Object.defineProperty(l,"__esModule",{value:!0}),l.C1_ESCAPED=l.C1=l.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=`
47
47
  `,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||(l.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||(l.C1=f={})),function(d){d.ST=`${u.ESC}\\`}(S||(l.C1_ESCAPED=S={}))},7399:(_,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.evaluateKeyboardEvent=void 0;const f=u(2584),S={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:["'",'"']};l.evaluateKeyboardEvent=function(d,m,C,w){const g={type:0,cancel:!1,key:void 0},a=(d.shiftKey?1:0)|(d.altKey?2:0)|(d.ctrlKey?4:0)|(d.metaKey?8:0);switch(d.keyCode){case 0:d.key==="UIKeyInputUpArrow"?g.key=m?f.C0.ESC+"OA":f.C0.ESC+"[A":d.key==="UIKeyInputLeftArrow"?g.key=m?f.C0.ESC+"OD":f.C0.ESC+"[D":d.key==="UIKeyInputRightArrow"?g.key=m?f.C0.ESC+"OC":f.C0.ESC+"[C":d.key==="UIKeyInputDownArrow"&&(g.key=m?f.C0.ESC+"OB":f.C0.ESC+"[B");break;case 8:if(d.altKey){g.key=f.C0.ESC+f.C0.DEL;break}g.key=f.C0.DEL;break;case 9:if(d.shiftKey){g.key=f.C0.ESC+"[Z";break}g.key=f.C0.HT,g.cancel=!0;break;case 13:g.key=d.altKey?f.C0.ESC+f.C0.CR:f.C0.CR,g.cancel=!0;break;case 27:g.key=f.C0.ESC,d.altKey&&(g.key=f.C0.ESC+f.C0.ESC),g.cancel=!0;break;case 37:if(d.metaKey)break;a?(g.key=f.C0.ESC+"[1;"+(a+1)+"D",g.key===f.C0.ESC+"[1;3D"&&(g.key=f.C0.ESC+(C?"b":"[1;5D"))):g.key=m?f.C0.ESC+"OD":f.C0.ESC+"[D";break;case 39:if(d.metaKey)break;a?(g.key=f.C0.ESC+"[1;"+(a+1)+"C",g.key===f.C0.ESC+"[1;3C"&&(g.key=f.C0.ESC+(C?"f":"[1;5C"))):g.key=m?f.C0.ESC+"OC":f.C0.ESC+"[C";break;case 38:if(d.metaKey)break;a?(g.key=f.C0.ESC+"[1;"+(a+1)+"A",C||g.key!==f.C0.ESC+"[1;3A"||(g.key=f.C0.ESC+"[1;5A")):g.key=m?f.C0.ESC+"OA":f.C0.ESC+"[A";break;case 40:if(d.metaKey)break;a?(g.key=f.C0.ESC+"[1;"+(a+1)+"B",C||g.key!==f.C0.ESC+"[1;3B"||(g.key=f.C0.ESC+"[1;5B")):g.key=m?f.C0.ESC+"OB":f.C0.ESC+"[B";break;case 45:d.shiftKey||d.ctrlKey||(g.key=f.C0.ESC+"[2~");break;case 46:g.key=a?f.C0.ESC+"[3;"+(a+1)+"~":f.C0.ESC+"[3~";break;case 36:g.key=a?f.C0.ESC+"[1;"+(a+1)+"H":m?f.C0.ESC+"OH":f.C0.ESC+"[H";break;case 35:g.key=a?f.C0.ESC+"[1;"+(a+1)+"F":m?f.C0.ESC+"OF":f.C0.ESC+"[F";break;case 33:d.shiftKey?g.type=2:d.ctrlKey?g.key=f.C0.ESC+"[5;"+(a+1)+"~":g.key=f.C0.ESC+"[5~";break;case 34:d.shiftKey?g.type=3:d.ctrlKey?g.key=f.C0.ESC+"[6;"+(a+1)+"~":g.key=f.C0.ESC+"[6~";break;case 112:g.key=a?f.C0.ESC+"[1;"+(a+1)+"P":f.C0.ESC+"OP";break;case 113:g.key=a?f.C0.ESC+"[1;"+(a+1)+"Q":f.C0.ESC+"OQ";break;case 114:g.key=a?f.C0.ESC+"[1;"+(a+1)+"R":f.C0.ESC+"OR";break;case 115:g.key=a?f.C0.ESC+"[1;"+(a+1)+"S":f.C0.ESC+"OS";break;case 116:g.key=a?f.C0.ESC+"[15;"+(a+1)+"~":f.C0.ESC+"[15~";break;case 117:g.key=a?f.C0.ESC+"[17;"+(a+1)+"~":f.C0.ESC+"[17~";break;case 118:g.key=a?f.C0.ESC+"[18;"+(a+1)+"~":f.C0.ESC+"[18~";break;case 119:g.key=a?f.C0.ESC+"[19;"+(a+1)+"~":f.C0.ESC+"[19~";break;case 120:g.key=a?f.C0.ESC+"[20;"+(a+1)+"~":f.C0.ESC+"[20~";break;case 121:g.key=a?f.C0.ESC+"[21;"+(a+1)+"~":f.C0.ESC+"[21~";break;case 122:g.key=a?f.C0.ESC+"[23;"+(a+1)+"~":f.C0.ESC+"[23~";break;case 123:g.key=a?f.C0.ESC+"[24;"+(a+1)+"~":f.C0.ESC+"[24~";break;default:if(!d.ctrlKey||d.shiftKey||d.altKey||d.metaKey)if(C&&!w||!d.altKey||d.metaKey)!C||d.altKey||d.ctrlKey||d.shiftKey||!d.metaKey?d.key&&!d.ctrlKey&&!d.altKey&&!d.metaKey&&d.keyCode>=48&&d.key.length===1?g.key=d.key:d.key&&d.ctrlKey&&(d.key==="_"&&(g.key=f.C0.US),d.key==="@"&&(g.key=f.C0.NUL)):d.keyCode===65&&(g.type=1);else{const o=S[d.keyCode],s=o==null?void 0:o[d.shiftKey?1:0];if(s)g.key=f.C0.ESC+s;else if(d.keyCode>=65&&d.keyCode<=90){const c=d.ctrlKey?d.keyCode-64:d.keyCode+32;let p=String.fromCharCode(c);d.shiftKey&&(p=p.toUpperCase()),g.key=f.C0.ESC+p}else if(d.keyCode===32)g.key=f.C0.ESC+(d.ctrlKey?f.C0.NUL:" ");else if(d.key==="Dead"&&d.code.startsWith("Key")){let c=d.code.slice(3,4);d.shiftKey||(c=c.toLowerCase()),g.key=f.C0.ESC+c,g.cancel=!0}}else d.keyCode>=65&&d.keyCode<=90?g.key=String.fromCharCode(d.keyCode-64):d.keyCode===32?g.key=f.C0.NUL:d.keyCode>=51&&d.keyCode<=55?g.key=String.fromCharCode(d.keyCode-51+27):d.keyCode===56?g.key=f.C0.DEL:d.keyCode===219?g.key=f.C0.ESC:d.keyCode===220?g.key=f.C0.FS:d.keyCode===221&&(g.key=f.C0.GS)}return g}},482:(_,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.Utf8ToUtf32=l.StringToUtf32=l.utf32ToString=l.stringFromCodePoint=void 0,l.stringFromCodePoint=function(u){return u>65535?(u-=65536,String.fromCharCode(55296+(u>>10))+String.fromCharCode(u%1024+56320)):String.fromCharCode(u)},l.utf32ToString=function(u,f=0,S=u.length){let d="";for(let m=f;m<S;++m){let C=u[m];C>65535?(C-=65536,d+=String.fromCharCode(55296+(C>>10))+String.fromCharCode(C%1024+56320)):d+=String.fromCharCode(C)}return d},l.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(u,f){const S=u.length;if(!S)return 0;let d=0,m=0;if(this._interim){const C=u.charCodeAt(m++);56320<=C&&C<=57343?f[d++]=1024*(this._interim-55296)+C-56320+65536:(f[d++]=this._interim,f[d++]=C),this._interim=0}for(let C=m;C<S;++C){const w=u.charCodeAt(C);if(55296<=w&&w<=56319){if(++C>=S)return this._interim=w,d;const g=u.charCodeAt(C);56320<=g&&g<=57343?f[d++]=1024*(w-55296)+g-56320+65536:(f[d++]=w,f[d++]=g)}else w!==65279&&(f[d++]=w)}return d}},l.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(u,f){const S=u.length;if(!S)return 0;let d,m,C,w,g=0,a=0,o=0;if(this.interim[0]){let p=!1,v=this.interim[0];v&=(224&v)==192?31:(240&v)==224?15:7;let x,b=0;for(;(x=63&this.interim[++b])&&b<4;)v<<=6,v|=x;const y=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,k=y-b;for(;o<k;){if(o>=S)return 0;if(x=u[o++],(192&x)!=128){o--,p=!0;break}this.interim[b++]=x,v<<=6,v|=63&x}p||(y===2?v<128?o--:f[g++]=v:y===3?v<2048||v>=55296&&v<=57343||v===65279||(f[g++]=v):v<65536||v>1114111||(f[g++]=v)),this.interim.fill(0)}const s=S-4;let c=o;for(;c<S;){for(;!(!(c<s)||128&(d=u[c])||128&(m=u[c+1])||128&(C=u[c+2])||128&(w=u[c+3]));)f[g++]=d,f[g++]=m,f[g++]=C,f[g++]=w,c+=4;if(d=u[c++],d<128)f[g++]=d;else if((224&d)==192){if(c>=S)return this.interim[0]=d,g;if(m=u[c++],(192&m)!=128){c--;continue}if(a=(31&d)<<6|63&m,a<128){c--;continue}f[g++]=a}else if((240&d)==224){if(c>=S)return this.interim[0]=d,g;if(m=u[c++],(192&m)!=128){c--;continue}if(c>=S)return this.interim[0]=d,this.interim[1]=m,g;if(C=u[c++],(192&C)!=128){c--;continue}if(a=(15&d)<<12|(63&m)<<6|63&C,a<2048||a>=55296&&a<=57343||a===65279)continue;f[g++]=a}else if((248&d)==240){if(c>=S)return this.interim[0]=d,g;if(m=u[c++],(192&m)!=128){c--;continue}if(c>=S)return this.interim[0]=d,this.interim[1]=m,g;if(C=u[c++],(192&C)!=128){c--;continue}if(c>=S)return this.interim[0]=d,this.interim[1]=m,this.interim[2]=C,g;if(w=u[c++],(192&w)!=128){c--;continue}if(a=(7&d)<<18|(63&m)<<12|(63&C)<<6|63&w,a<65536||a>1114111)continue;f[g++]=a}}return g}}},225:(_,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.UnicodeV6=void 0;const u=[[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]],f=[[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 S;l.UnicodeV6=class{constructor(){if(this.version="6",!S){S=new Uint8Array(65536),S.fill(1),S[0]=0,S.fill(0,1,32),S.fill(0,127,160),S.fill(2,4352,4448),S[9001]=2,S[9002]=2,S.fill(2,11904,42192),S[12351]=1,S.fill(2,44032,55204),S.fill(2,63744,64256),S.fill(2,65040,65050),S.fill(2,65072,65136),S.fill(2,65280,65377),S.fill(2,65504,65511);for(let d=0;d<u.length;++d)S.fill(0,u[d][0],u[d][1]+1)}}wcwidth(d){return d<32?0:d<127?1:d<65536?S[d]:function(m,C){let w,g=0,a=C.length-1;if(m<C[0][0]||m>C[a][1])return!1;for(;a>=g;)if(w=g+a>>1,m>C[w][1])g=w+1;else{if(!(m<C[w][0]))return!0;a=w-1}return!1}(d,f)?0:d>=131072&&d<=196605||d>=196608&&d<=262141?2:1}}},5981:(_,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.WriteBuffer=void 0;const f=u(8460),S=u(844);class d extends S.Disposable{constructor(C){super(),this._action=C,this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=0,this._isSyncWriting=!1,this._syncCalls=0,this._didUserInput=!1,this._onWriteParsed=this.register(new f.EventEmitter),this.onWriteParsed=this._onWriteParsed.event}handleUserInput(){this._didUserInput=!0}writeSync(C,w){if(w!==void 0&&this._syncCalls>w)return void(this._syncCalls=0);if(this._pendingData+=C.length,this._writeBuffer.push(C),this._callbacks.push(void 0),this._syncCalls++,this._isSyncWriting)return;let g;for(this._isSyncWriting=!0;g=this._writeBuffer.shift();){this._action(g);const a=this._callbacks.shift();a&&a()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(C,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+=C.length,this._writeBuffer.push(C),this._callbacks.push(w),void this._innerWrite();setTimeout(()=>this._innerWrite())}this._pendingData+=C.length,this._writeBuffer.push(C),this._callbacks.push(w)}_innerWrite(C=0,w=!0){const g=C||Date.now();for(;this._writeBuffer.length>this._bufferOffset;){const a=this._writeBuffer[this._bufferOffset],o=this._action(a,w);if(o){const c=p=>Date.now()-g>=12?setTimeout(()=>this._innerWrite(0,p)):this._innerWrite(g,p);return void o.catch(p=>(queueMicrotask(()=>{throw p}),Promise.resolve(!1))).then(c)}const s=this._callbacks[this._bufferOffset];if(s&&s(),this._bufferOffset++,this._pendingData-=a.length,Date.now()-g>=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()}}l.WriteBuffer=d},5941:(_,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.toRgbString=l.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 S(d,m){const C=d.toString(16),w=C.length<2?"0"+C:C;switch(m){case 4:return C[0];case 8:return w;case 12:return(w+w).slice(0,3);default:return w+w}}l.parseColor=function(d){if(!d)return;let m=d.toLowerCase();if(m.indexOf("rgb:")===0){m=m.slice(4);const C=u.exec(m);if(C){const w=C[1]?15:C[4]?255:C[7]?4095:65535;return[Math.round(parseInt(C[1]||C[4]||C[7]||C[10],16)/w*255),Math.round(parseInt(C[2]||C[5]||C[8]||C[11],16)/w*255),Math.round(parseInt(C[3]||C[6]||C[9]||C[12],16)/w*255)]}}else if(m.indexOf("#")===0&&(m=m.slice(1),f.exec(m)&&[3,6,9,12].includes(m.length))){const C=m.length/3,w=[0,0,0];for(let g=0;g<3;++g){const a=parseInt(m.slice(C*g,C*g+C),16);w[g]=C===1?a<<4:C===2?a:C===3?a>>4:a>>8}return w}},l.toRgbString=function(d,m=16){const[C,w,g]=d;return`rgb:${S(C,m)}/${S(w,m)}/${S(g,m)}`}},5770:(_,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.PAYLOAD_LIMIT=void 0,l.PAYLOAD_LIMIT=1e7},6351:(_,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.DcsHandler=l.DcsParser=void 0;const f=u(482),S=u(8742),d=u(5770),m=[];l.DcsParser=class{constructor(){this._handlers=Object.create(null),this._active=m,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=m}registerHandler(w,g){this._handlers[w]===void 0&&(this._handlers[w]=[]);const a=this._handlers[w];return a.push(g),{dispose:()=>{const o=a.indexOf(g);o!==-1&&a.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=m,this._ident=0}hook(w,g){if(this.reset(),this._ident=w,this._active=this._handlers[w]||m,this._active.length)for(let a=this._active.length-1;a>=0;a--)this._active[a].hook(g);else this._handlerFb(this._ident,"HOOK",g)}put(w,g,a){if(this._active.length)for(let o=this._active.length-1;o>=0;o--)this._active[o].put(w,g,a);else this._handlerFb(this._ident,"PUT",(0,f.utf32ToString)(w,g,a))}unhook(w,g=!0){if(this._active.length){let a=!1,o=this._active.length-1,s=!1;if(this._stack.paused&&(o=this._stack.loopPosition-1,a=g,s=this._stack.fallThrough,this._stack.paused=!1),!s&&a===!1){for(;o>=0&&(a=this._active[o].unhook(w),a!==!0);o--)if(a instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=o,this._stack.fallThrough=!1,a;o--}for(;o>=0;o--)if(a=this._active[o].unhook(!1),a instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=o,this._stack.fallThrough=!0,a}else this._handlerFb(this._ident,"UNHOOK",w);this._active=m,this._ident=0}};const C=new S.Params;C.addParam(0),l.DcsHandler=class{constructor(w){this._handler=w,this._data="",this._params=C,this._hitLimit=!1}hook(w){this._params=w.length>1||w.params[0]?w.clone():C,this._data="",this._hitLimit=!1}put(w,g,a){this._hitLimit||(this._data+=(0,f.utf32ToString)(w,g,a),this._data.length>d.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}unhook(w){let g=!1;if(this._hitLimit)g=!1;else if(w&&(g=this._handler(this._data,this._params),g instanceof Promise))return g.then(a=>(this._params=C,this._data="",this._hitLimit=!1,a));return this._params=C,this._data="",this._hitLimit=!1,g}}},2015:(_,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.EscapeSequenceParser=l.VT500_TRANSITION_TABLE=l.TransitionTable=void 0;const f=u(844),S=u(8742),d=u(6242),m=u(6351);class C{constructor(o){this.table=new Uint8Array(o)}setDefault(o,s){this.table.fill(o<<4|s)}add(o,s,c,p){this.table[s<<8|o]=c<<4|p}addMany(o,s,c,p){for(let v=0;v<o.length;v++)this.table[s<<8|o[v]]=c<<4|p}}l.TransitionTable=C;const w=160;l.VT500_TRANSITION_TABLE=function(){const a=new C(4095),o=Array.apply(null,Array(256)).map((b,y)=>y),s=(b,y)=>o.slice(b,y),c=s(32,127),p=s(0,24);p.push(25),p.push.apply(p,s(28,32));const v=s(0,14);let x;for(x in a.setDefault(1,0),a.addMany(c,0,2,0),v)a.addMany([24,26,153,154],x,3,0),a.addMany(s(128,144),x,3,0),a.addMany(s(144,152),x,3,0),a.add(156,x,0,0),a.add(27,x,11,1),a.add(157,x,4,8),a.addMany([152,158,159],x,0,7),a.add(155,x,11,3),a.add(144,x,11,9);return a.addMany(p,0,3,0),a.addMany(p,1,3,1),a.add(127,1,0,1),a.addMany(p,8,0,8),a.addMany(p,3,3,3),a.add(127,3,0,3),a.addMany(p,4,3,4),a.add(127,4,0,4),a.addMany(p,6,3,6),a.addMany(p,5,3,5),a.add(127,5,0,5),a.addMany(p,2,3,2),a.add(127,2,0,2),a.add(93,1,4,8),a.addMany(c,8,5,8),a.add(127,8,5,8),a.addMany([156,27,24,26,7],8,6,0),a.addMany(s(28,32),8,0,8),a.addMany([88,94,95],1,0,7),a.addMany(c,7,0,7),a.addMany(p,7,0,7),a.add(156,7,0,0),a.add(127,7,0,7),a.add(91,1,11,3),a.addMany(s(64,127),3,7,0),a.addMany(s(48,60),3,8,4),a.addMany([60,61,62,63],3,9,4),a.addMany(s(48,60),4,8,4),a.addMany(s(64,127),4,7,0),a.addMany([60,61,62,63],4,0,6),a.addMany(s(32,64),6,0,6),a.add(127,6,0,6),a.addMany(s(64,127),6,0,0),a.addMany(s(32,48),3,9,5),a.addMany(s(32,48),5,9,5),a.addMany(s(48,64),5,0,6),a.addMany(s(64,127),5,7,0),a.addMany(s(32,48),4,9,5),a.addMany(s(32,48),1,9,2),a.addMany(s(32,48),2,9,2),a.addMany(s(48,127),2,10,0),a.addMany(s(48,80),1,10,0),a.addMany(s(81,88),1,10,0),a.addMany([89,90,92],1,10,0),a.addMany(s(96,127),1,10,0),a.add(80,1,11,9),a.addMany(p,9,0,9),a.add(127,9,0,9),a.addMany(s(28,32),9,0,9),a.addMany(s(32,48),9,9,12),a.addMany(s(48,60),9,8,10),a.addMany([60,61,62,63],9,9,10),a.addMany(p,11,0,11),a.addMany(s(32,128),11,0,11),a.addMany(s(28,32),11,0,11),a.addMany(p,10,0,10),a.add(127,10,0,10),a.addMany(s(28,32),10,0,10),a.addMany(s(48,60),10,8,10),a.addMany([60,61,62,63],10,0,11),a.addMany(s(32,48),10,9,12),a.addMany(p,12,0,12),a.add(127,12,0,12),a.addMany(s(28,32),12,0,12),a.addMany(s(32,48),12,9,12),a.addMany(s(48,64),12,0,11),a.addMany(s(64,127),12,12,13),a.addMany(s(64,127),10,12,13),a.addMany(s(64,127),9,12,13),a.addMany(p,13,13,13),a.addMany(c,13,13,13),a.add(127,13,0,13),a.addMany([27,156,24,26],13,14,0),a.add(w,0,2,0),a.add(w,8,5,8),a.add(w,6,0,6),a.add(w,11,0,11),a.add(w,13,13,13),a}();class g extends f.Disposable{constructor(o=l.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 S.Params,this._params.addParam(0),this._collect=0,this.precedingCodepoint=0,this._printHandlerFb=(s,c,p)=>{},this._executeHandlerFb=s=>{},this._csiHandlerFb=(s,c)=>{},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 m.DcsParser),this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:"\\"},()=>!0)}_identifier(o,s=[64,126]){let c=0;if(o.prefix){if(o.prefix.length>1)throw new Error("only one byte as prefix supported");if(c=o.prefix.charCodeAt(0),c&&60>c||c>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 v=0;v<o.intermediates.length;++v){const x=o.intermediates.charCodeAt(v);if(32>x||x>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");c<<=8,c|=x}}if(o.final.length!==1)throw new Error("final must be a single byte");const p=o.final.charCodeAt(0);if(s[0]>p||p>s[1])throw new Error(`final must be in range ${s[0]} .. ${s[1]}`);return c<<=8,c|=p,c}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 c=this._identifier(o,[48,126]);this._escHandlers[c]===void 0&&(this._escHandlers[c]=[]);const p=this._escHandlers[c];return p.push(s),{dispose:()=>{const v=p.indexOf(s);v!==-1&&p.splice(v,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 c=this._identifier(o);this._csiHandlers[c]===void 0&&(this._csiHandlers[c]=[]);const p=this._csiHandlers[c];return p.push(s),{dispose:()=>{const v=p.indexOf(s);v!==-1&&p.splice(v,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.precedingCodepoint=0,this._parseStack.state!==0&&(this._parseStack.state=2,this._parseStack.handlers=[])}_preserveStack(o,s,c,p,v){this._parseStack.state=o,this._parseStack.handlers=s,this._parseStack.handlerPos=c,this._parseStack.transition=p,this._parseStack.chunkPos=v}parse(o,s,c){let p,v=0,x=0,b=0;if(this._parseStack.state)if(this._parseStack.state===2)this._parseStack.state=0,b=this._parseStack.chunkPos+1;else{if(c===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 k=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(c===!1&&k>-1){for(;k>=0&&(p=y[k](this._params),p!==!0);k--)if(p instanceof Promise)return this._parseStack.handlerPos=k,p}this._parseStack.handlers=[];break;case 4:if(c===!1&&k>-1){for(;k>=0&&(p=y[k](),p!==!0);k--)if(p instanceof Promise)return this._parseStack.handlerPos=k,p}this._parseStack.handlers=[];break;case 6:if(v=o[this._parseStack.chunkPos],p=this._dcsParser.unhook(v!==24&&v!==26,c),p)return p;v===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(v=o[this._parseStack.chunkPos],p=this._oscParser.end(v!==24&&v!==26,c),p)return p;v===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0}this._parseStack.state=0,b=this._parseStack.chunkPos+1,this.precedingCodepoint=0,this.currentState=15&this._parseStack.transition}for(let y=b;y<s;++y){switch(v=o[y],x=this._transitions.table[this.currentState<<8|(v<160?v:w)],x>>4){case 2:for(let B=y+1;;++B){if(B>=s||(v=o[B])<32||v>126&&v<w){this._printHandler(o,y,B),y=B-1;break}if(++B>=s||(v=o[B])<32||v>126&&v<w){this._printHandler(o,y,B),y=B-1;break}if(++B>=s||(v=o[B])<32||v>126&&v<w){this._printHandler(o,y,B),y=B-1;break}if(++B>=s||(v=o[B])<32||v>126&&v<w){this._printHandler(o,y,B),y=B-1;break}}break;case 3:this._executeHandlers[v]?this._executeHandlers[v]():this._executeHandlerFb(v),this.precedingCodepoint=0;break;case 0:break;case 1:if(this._errorHandler({position:y,code:v,currentState:this.currentState,collect:this._collect,params:this._params,abort:!1}).abort)return;break;case 7:const k=this._csiHandlers[this._collect<<8|v];let R=k?k.length-1:-1;for(;R>=0&&(p=k[R](this._params),p!==!0);R--)if(p instanceof Promise)return this._preserveStack(3,k,R,x,y),p;R<0&&this._csiHandlerFb(this._collect<<8|v,this._params),this.precedingCodepoint=0;break;case 8:do switch(v){case 59:this._params.addParam(0);break;case 58:this._params.addSubParam(-1);break;default:this._params.addDigit(v-48)}while(++y<s&&(v=o[y])>47&&v<60);y--;break;case 9:this._collect<<=8,this._collect|=v;break;case 10:const O=this._escHandlers[this._collect<<8|v];let T=O?O.length-1:-1;for(;T>=0&&(p=O[T](),p!==!0);T--)if(p instanceof Promise)return this._preserveStack(4,O,T,x,y),p;T<0&&this._escHandlerFb(this._collect<<8|v),this.precedingCodepoint=0;break;case 11:this._params.reset(),this._params.addParam(0),this._collect=0;break;case 12:this._dcsParser.hook(this._collect<<8|v,this._params);break;case 13:for(let B=y+1;;++B)if(B>=s||(v=o[B])===24||v===26||v===27||v>127&&v<w){this._dcsParser.put(o,y,B),y=B-1;break}break;case 14:if(p=this._dcsParser.unhook(v!==24&&v!==26),p)return this._preserveStack(6,[],0,x,y),p;v===27&&(x|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingCodepoint=0;break;case 4:this._oscParser.start();break;case 5:for(let B=y+1;;B++)if(B>=s||(v=o[B])<32||v>127&&v<w){this._oscParser.put(o,y,B),y=B-1;break}break;case 6:if(p=this._oscParser.end(v!==24&&v!==26),p)return this._preserveStack(5,[],0,x,y),p;v===27&&(x|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingCodepoint=0}this.currentState=15&x}}}l.EscapeSequenceParser=g},6242:(_,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.OscHandler=l.OscParser=void 0;const f=u(5770),S=u(482),d=[];l.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(m,C){this._handlers[m]===void 0&&(this._handlers[m]=[]);const w=this._handlers[m];return w.push(C),{dispose:()=>{const g=w.indexOf(C);g!==-1&&w.splice(g,1)}}}clearHandler(m){this._handlers[m]&&delete this._handlers[m]}setHandlerFallback(m){this._handlerFb=m}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=d}reset(){if(this._state===2)for(let m=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;m>=0;--m)this._active[m].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 m=this._active.length-1;m>=0;m--)this._active[m].start();else this._handlerFb(this._id,"START")}_put(m,C,w){if(this._active.length)for(let g=this._active.length-1;g>=0;g--)this._active[g].put(m,C,w);else this._handlerFb(this._id,"PUT",(0,S.utf32ToString)(m,C,w))}start(){this.reset(),this._state=1}put(m,C,w){if(this._state!==3){if(this._state===1)for(;C<w;){const g=m[C++];if(g===59){this._state=2,this._start();break}if(g<48||57<g)return void(this._state=3);this._id===-1&&(this._id=0),this._id=10*this._id+g-48}this._state===2&&w-C>0&&this._put(m,C,w)}}end(m,C=!0){if(this._state!==0){if(this._state!==3)if(this._state===1&&this._start(),this._active.length){let w=!1,g=this._active.length-1,a=!1;if(this._stack.paused&&(g=this._stack.loopPosition-1,w=C,a=this._stack.fallThrough,this._stack.paused=!1),!a&&w===!1){for(;g>=0&&(w=this._active[g].end(m),w!==!0);g--)if(w instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=g,this._stack.fallThrough=!1,w;g--}for(;g>=0;g--)if(w=this._active[g].end(!1),w instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=g,this._stack.fallThrough=!0,w}else this._handlerFb(this._id,"END",m);this._active=d,this._id=-1,this._state=0}}},l.OscHandler=class{constructor(m){this._handler=m,this._data="",this._hitLimit=!1}start(){this._data="",this._hitLimit=!1}put(m,C,w){this._hitLimit||(this._data+=(0,S.utf32ToString)(m,C,w),this._data.length>f.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}end(m){let C=!1;if(this._hitLimit)C=!1;else if(m&&(C=this._handler(this._data),C instanceof Promise))return C.then(w=>(this._data="",this._hitLimit=!1,w));return this._data="",this._hitLimit=!1,C}}},8742:(_,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.Params=void 0;const u=2147483647;class f{static fromArray(d){const m=new f;if(!d.length)return m;for(let C=Array.isArray(d[0])?1:0;C<d.length;++C){const w=d[C];if(Array.isArray(w))for(let g=0;g<w.length;++g)m.addSubParam(w[g]);else m.addParam(w)}return m}constructor(d=32,m=32){if(this.maxLength=d,this.maxSubParamsLength=m,m>256)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(d),this.length=0,this._subParams=new Int32Array(m),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 m=0;m<this.length;++m){d.push(this.params[m]);const C=this._subParamsIdx[m]>>8,w=255&this._subParamsIdx[m];w-C>0&&d.push(Array.prototype.slice.call(this._subParams,C,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 m=this._subParamsIdx[d]>>8,C=255&this._subParamsIdx[d];return C-m>0?this._subParams.subarray(m,C):null}getSubParamsAll(){const d={};for(let m=0;m<this.length;++m){const C=this._subParamsIdx[m]>>8,w=255&this._subParamsIdx[m];w-C>0&&(d[m]=this._subParams.slice(C,w))}return d}addDigit(d){let m;if(this._rejectDigits||!(m=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;const C=this._digitIsSub?this._subParams:this.params,w=C[m-1];C[m-1]=~w?Math.min(10*w+d,u):d}}l.Params=f},5741:(_,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.AddonManager=void 0,l.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 S={instance:f,dispose:f.dispose,isDisposed:!1};this._addons.push(S),f.dispose=()=>this._wrappedAddonDispose(S),f.activate(u)}_wrappedAddonDispose(u){if(u.isDisposed)return;let f=-1;for(let S=0;S<this._addons.length;S++)if(this._addons[S]===u){f=S;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:(_,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.BufferApiView=void 0;const f=u(3785),S=u(511);l.BufferApiView=class{constructor(d,m){this._buffer=d,this.type=m}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 m=this._buffer.lines.get(d);if(m)return new f.BufferLineApiView(m)}getNullCell(){return new S.CellData}}},3785:(_,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.BufferLineApiView=void 0;const f=u(511);l.BufferLineApiView=class{constructor(S){this._line=S}get isWrapped(){return this._line.isWrapped}get length(){return this._line.length}getCell(S,d){if(!(S<0||S>=this._line.length))return d?(this._line.loadCell(S,d),d):this._line.loadCell(S,new f.CellData)}translateToString(S,d,m){return this._line.translateToString(S,d,m)}}},8285:(_,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.BufferNamespaceApi=void 0;const f=u(8771),S=u(8460),d=u(844);class m extends d.Disposable{constructor(w){super(),this._core=w,this._onBufferChange=this.register(new S.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)}}l.BufferNamespaceApi=m},7975:(_,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.ParserApi=void 0,l.ParserApi=class{constructor(u){this._core=u}registerCsiHandler(u,f){return this._core.registerCsiHandler(u,S=>f(S.toArray()))}addCsiHandler(u,f){return this.registerCsiHandler(u,f)}registerDcsHandler(u,f){return this._core.registerDcsHandler(u,(S,d)=>f(S,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:(_,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.UnicodeApi=void 0,l.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(_,l,u){var f=this&&this.__decorate||function(a,o,s,c){var p,v=arguments.length,x=v<3?o:c===null?c=Object.getOwnPropertyDescriptor(o,s):c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")x=Reflect.decorate(a,o,s,c);else for(var b=a.length-1;b>=0;b--)(p=a[b])&&(x=(v<3?p(x):v>3?p(o,s,x):p(o,s))||x);return v>3&&x&&Object.defineProperty(o,s,x),x},S=this&&this.__param||function(a,o){return function(s,c){o(s,c,a)}};Object.defineProperty(l,"__esModule",{value:!0}),l.BufferService=l.MINIMUM_ROWS=l.MINIMUM_COLS=void 0;const d=u(8460),m=u(844),C=u(5295),w=u(2585);l.MINIMUM_COLS=2,l.MINIMUM_ROWS=1;let g=l.BufferService=class extends m.Disposable{get buffer(){return this.buffers.active}constructor(a){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(a.rawOptions.cols||0,l.MINIMUM_COLS),this.rows=Math.max(a.rawOptions.rows||0,l.MINIMUM_ROWS),this.buffers=this.register(new C.BufferSet(a,this))}resize(a,o){this.cols=a,this.rows=o,this.buffers.resize(a,o),this._onResize.fire({cols:a,rows:o})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(a,o=!1){const s=this.buffer;let c;c=this._cachedBlankLine,c&&c.length===this.cols&&c.getFg(0)===a.fg&&c.getBg(0)===a.bg||(c=s.getBlankLine(a,o),this._cachedBlankLine=c),c.isWrapped=o;const p=s.ybase+s.scrollTop,v=s.ybase+s.scrollBottom;if(s.scrollTop===0){const x=s.lines.isFull;v===s.lines.length-1?x?s.lines.recycle().copyFrom(c):s.lines.push(c.clone()):s.lines.splice(v+1,0,c.clone()),x?this.isUserScrolling&&(s.ydisp=Math.max(s.ydisp-1,0)):(s.ybase++,this.isUserScrolling||s.ydisp++)}else{const x=v-p+1;s.lines.shiftElements(p+1,x-1,-1),s.lines.set(v,c.clone())}this.isUserScrolling||(s.ydisp=s.ybase),this._onScroll.fire(s.ydisp)}scrollLines(a,o,s){const c=this.buffer;if(a<0){if(c.ydisp===0)return;this.isUserScrolling=!0}else a+c.ydisp>=c.ybase&&(this.isUserScrolling=!1);const p=c.ydisp;c.ydisp=Math.max(Math.min(c.ydisp+a,c.ybase),0),p!==c.ydisp&&(o||this._onScroll.fire(c.ydisp))}};l.BufferService=g=f([S(0,w.IOptionsService)],g)},7994:(_,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.CharsetService=void 0,l.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(_,l,u){var f=this&&this.__decorate||function(c,p,v,x){var b,y=arguments.length,k=y<3?p:x===null?x=Object.getOwnPropertyDescriptor(p,v):x;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")k=Reflect.decorate(c,p,v,x);else for(var R=c.length-1;R>=0;R--)(b=c[R])&&(k=(y<3?b(k):y>3?b(p,v,k):b(p,v))||k);return y>3&&k&&Object.defineProperty(p,v,k),k},S=this&&this.__param||function(c,p){return function(v,x){p(v,x,c)}};Object.defineProperty(l,"__esModule",{value:!0}),l.CoreMouseService=void 0;const d=u(2585),m=u(8460),C=u(844),w={NONE:{events:0,restrict:()=>!1},X10:{events:1,restrict:c=>c.button!==4&&c.action===1&&(c.ctrl=!1,c.alt=!1,c.shift=!1,!0)},VT200:{events:19,restrict:c=>c.action!==32},DRAG:{events:23,restrict:c=>c.action!==32||c.button!==3},ANY:{events:31,restrict:c=>!0}};function g(c,p){let v=(c.ctrl?16:0)|(c.shift?4:0)|(c.alt?8:0);return c.button===4?(v|=64,v|=c.action):(v|=3&c.button,4&c.button&&(v|=64),8&c.button&&(v|=128),c.action===32?v|=32:c.action!==0||p||(v|=3)),v}const a=String.fromCharCode,o={DEFAULT:c=>{const p=[g(c,!1)+32,c.col+32,c.row+32];return p[0]>255||p[1]>255||p[2]>255?"":`\x1B[M${a(p[0])}${a(p[1])}${a(p[2])}`},SGR:c=>{const p=c.action===0&&c.button!==4?"m":"M";return`\x1B[<${g(c,!0)};${c.col};${c.row}${p}`},SGR_PIXELS:c=>{const p=c.action===0&&c.button!==4?"m":"M";return`\x1B[<${g(c,!0)};${c.x};${c.y}${p}`}};let s=l.CoreMouseService=class extends C.Disposable{constructor(c,p){super(),this._bufferService=c,this._coreService=p,this._protocols={},this._encodings={},this._activeProtocol="",this._activeEncoding="",this._lastEvent=null,this._onProtocolChange=this.register(new m.EventEmitter),this.onProtocolChange=this._onProtocolChange.event;for(const v of Object.keys(w))this.addProtocol(v,w[v]);for(const v of Object.keys(o))this.addEncoding(v,o[v]);this.reset()}addProtocol(c,p){this._protocols[c]=p}addEncoding(c,p){this._encodings[c]=p}get activeProtocol(){return this._activeProtocol}get areMouseEventsActive(){return this._protocols[this._activeProtocol].events!==0}set activeProtocol(c){if(!this._protocols[c])throw new Error(`unknown protocol "${c}"`);this._activeProtocol=c,this._onProtocolChange.fire(this._protocols[c].events)}get activeEncoding(){return this._activeEncoding}set activeEncoding(c){if(!this._encodings[c])throw new Error(`unknown encoding "${c}"`);this._activeEncoding=c}reset(){this.activeProtocol="NONE",this.activeEncoding="DEFAULT",this._lastEvent=null}triggerMouseEvent(c){if(c.col<0||c.col>=this._bufferService.cols||c.row<0||c.row>=this._bufferService.rows||c.button===4&&c.action===32||c.button===3&&c.action!==32||c.button!==4&&(c.action===2||c.action===3)||(c.col++,c.row++,c.action===32&&this._lastEvent&&this._equalEvents(this._lastEvent,c,this._activeEncoding==="SGR_PIXELS"))||!this._protocols[this._activeProtocol].restrict(c))return!1;const p=this._encodings[this._activeEncoding](c);return p&&(this._activeEncoding==="DEFAULT"?this._coreService.triggerBinaryEvent(p):this._coreService.triggerDataEvent(p,!0)),this._lastEvent=c,!0}explainEvents(c){return{down:!!(1&c),up:!!(2&c),drag:!!(4&c),move:!!(8&c),wheel:!!(16&c)}}_equalEvents(c,p,v){if(v){if(c.x!==p.x||c.y!==p.y)return!1}else if(c.col!==p.col||c.row!==p.row)return!1;return c.button===p.button&&c.action===p.action&&c.ctrl===p.ctrl&&c.alt===p.alt&&c.shift===p.shift}};l.CoreMouseService=s=f([S(0,d.IBufferService),S(1,d.ICoreService)],s)},6975:function(_,l,u){var f=this&&this.__decorate||function(s,c,p,v){var x,b=arguments.length,y=b<3?c:v===null?v=Object.getOwnPropertyDescriptor(c,p):v;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")y=Reflect.decorate(s,c,p,v);else for(var k=s.length-1;k>=0;k--)(x=s[k])&&(y=(b<3?x(y):b>3?x(c,p,y):x(c,p))||y);return b>3&&y&&Object.defineProperty(c,p,y),y},S=this&&this.__param||function(s,c){return function(p,v){c(p,v,s)}};Object.defineProperty(l,"__esModule",{value:!0}),l.CoreService=void 0;const d=u(1439),m=u(8460),C=u(844),w=u(2585),g=Object.freeze({insertMode:!1}),a=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,origin:!1,reverseWraparound:!1,sendFocus:!1,wraparound:!0});let o=l.CoreService=class extends C.Disposable{constructor(s,c,p){super(),this._bufferService=s,this._logService=c,this._optionsService=p,this.isCursorInitialized=!1,this.isCursorHidden=!1,this._onData=this.register(new m.EventEmitter),this.onData=this._onData.event,this._onUserInput=this.register(new m.EventEmitter),this.onUserInput=this._onUserInput.event,this._onBinary=this.register(new m.EventEmitter),this.onBinary=this._onBinary.event,this._onRequestScrollToBottom=this.register(new m.EventEmitter),this.onRequestScrollToBottom=this._onRequestScrollToBottom.event,this.modes=(0,d.clone)(g),this.decPrivateModes=(0,d.clone)(a)}reset(){this.modes=(0,d.clone)(g),this.decPrivateModes=(0,d.clone)(a)}triggerDataEvent(s,c=!1){if(this._optionsService.rawOptions.disableStdin)return;const p=this._bufferService.buffer;c&&this._optionsService.rawOptions.scrollOnUserInput&&p.ybase!==p.ydisp&&this._onRequestScrollToBottom.fire(),c&&this._onUserInput.fire(),this._logService.debug(`sending data "${s}"`,()=>s.split("").map(v=>v.charCodeAt(0))),this._onData.fire(s)}triggerBinaryEvent(s){this._optionsService.rawOptions.disableStdin||(this._logService.debug(`sending binary "${s}"`,()=>s.split("").map(c=>c.charCodeAt(0))),this._onBinary.fire(s))}};l.CoreService=o=f([S(0,w.IBufferService),S(1,w.ILogService),S(2,w.IOptionsService)],o)},9074:(_,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.DecorationService=void 0;const f=u(8055),S=u(8460),d=u(844),m=u(6106);let C=0,w=0;class g extends d.Disposable{get decorations(){return this._decorations.values()}constructor(){super(),this._decorations=new m.SortedList(s=>s==null?void 0:s.marker.line),this._onDecorationRegistered=this.register(new S.EventEmitter),this.onDecorationRegistered=this._onDecorationRegistered.event,this._onDecorationRemoved=this.register(new S.EventEmitter),this.onDecorationRemoved=this._onDecorationRemoved.event,this.register((0,d.toDisposable)(()=>this.reset()))}registerDecoration(s){if(s.marker.isDisposed)return;const c=new a(s);if(c){const p=c.marker.onDispose(()=>c.dispose());c.onDispose(()=>{c&&(this._decorations.delete(c)&&this._onDecorationRemoved.fire(c),p.dispose())}),this._decorations.insert(c),this._onDecorationRegistered.fire(c)}return c}reset(){for(const s of this._decorations.values())s.dispose();this._decorations.clear()}*getDecorationsAtCell(s,c,p){var v,x,b;let y=0,k=0;for(const R of this._decorations.getKeyIterator(c))y=(v=R.options.x)!==null&&v!==void 0?v:0,k=y+((x=R.options.width)!==null&&x!==void 0?x:1),s>=y&&s<k&&(!p||((b=R.options.layer)!==null&&b!==void 0?b:"bottom")===p)&&(yield R)}forEachDecorationAtCell(s,c,p,v){this._decorations.forEachByKey(c,x=>{var b,y,k;C=(b=x.options.x)!==null&&b!==void 0?b:0,w=C+((y=x.options.width)!==null&&y!==void 0?y:1),s>=C&&s<w&&(!p||((k=x.options.layer)!==null&&k!==void 0?k:"bottom")===p)&&v(x)})}}l.DecorationService=g;class a 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 S.EventEmitter),this.onRender=this.onRenderEmitter.event,this._onDispose=this.register(new S.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:(_,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.InstantiationService=l.ServiceCollection=void 0;const f=u(2585),S=u(8343);class d{constructor(...C){this._entries=new Map;for(const[w,g]of C)this.set(w,g)}set(C,w){const g=this._entries.get(C);return this._entries.set(C,w),g}forEach(C){for(const[w,g]of this._entries.entries())C(w,g)}has(C){return this._entries.has(C)}get(C){return this._entries.get(C)}}l.ServiceCollection=d,l.InstantiationService=class{constructor(){this._services=new d,this._services.set(f.IInstantiationService,this)}setService(m,C){this._services.set(m,C)}getService(m){return this._services.get(m)}createInstance(m,...C){const w=(0,S.getServiceDependencies)(m).sort((o,s)=>o.index-s.index),g=[];for(const o of w){const s=this._services.get(o.id);if(!s)throw new Error(`[createInstance] ${m.name} depends on UNKNOWN service ${o.id}.`);g.push(s)}const a=w.length>0?w[0].index:C.length;if(C.length!==a)throw new Error(`[createInstance] First service dependency of ${m.name} at position ${a+1} conflicts with ${C.length} static arguments`);return new m(...C,...g)}}},7866:function(_,l,u){var f=this&&this.__decorate||function(a,o,s,c){var p,v=arguments.length,x=v<3?o:c===null?c=Object.getOwnPropertyDescriptor(o,s):c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")x=Reflect.decorate(a,o,s,c);else for(var b=a.length-1;b>=0;b--)(p=a[b])&&(x=(v<3?p(x):v>3?p(o,s,x):p(o,s))||x);return v>3&&x&&Object.defineProperty(o,s,x),x},S=this&&this.__param||function(a,o){return function(s,c){o(s,c,a)}};Object.defineProperty(l,"__esModule",{value:!0}),l.traceCall=l.setTraceLogger=l.LogService=void 0;const d=u(844),m=u(2585),C={trace:m.LogLevelEnum.TRACE,debug:m.LogLevelEnum.DEBUG,info:m.LogLevelEnum.INFO,warn:m.LogLevelEnum.WARN,error:m.LogLevelEnum.ERROR,off:m.LogLevelEnum.OFF};let w,g=l.LogService=class extends d.Disposable{get logLevel(){return this._logLevel}constructor(a){super(),this._optionsService=a,this._logLevel=m.LogLevelEnum.OFF,this._updateLogLevel(),this.register(this._optionsService.onSpecificOptionChange("logLevel",()=>this._updateLogLevel())),w=this}_updateLogLevel(){this._logLevel=C[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(a){for(let o=0;o<a.length;o++)typeof a[o]=="function"&&(a[o]=a[o]())}_log(a,o,s){this._evalLazyOptionalParams(s),a.call(console,(this._optionsService.options.logger?"":"xterm.js: ")+o,...s)}trace(a,...o){var s,c;this._logLevel<=m.LogLevelEnum.TRACE&&this._log((c=(s=this._optionsService.options.logger)===null||s===void 0?void 0:s.trace.bind(this._optionsService.options.logger))!==null&&c!==void 0?c:console.log,a,o)}debug(a,...o){var s,c;this._logLevel<=m.LogLevelEnum.DEBUG&&this._log((c=(s=this._optionsService.options.logger)===null||s===void 0?void 0:s.debug.bind(this._optionsService.options.logger))!==null&&c!==void 0?c:console.log,a,o)}info(a,...o){var s,c;this._logLevel<=m.LogLevelEnum.INFO&&this._log((c=(s=this._optionsService.options.logger)===null||s===void 0?void 0:s.info.bind(this._optionsService.options.logger))!==null&&c!==void 0?c:console.info,a,o)}warn(a,...o){var s,c;this._logLevel<=m.LogLevelEnum.WARN&&this._log((c=(s=this._optionsService.options.logger)===null||s===void 0?void 0:s.warn.bind(this._optionsService.options.logger))!==null&&c!==void 0?c:console.warn,a,o)}error(a,...o){var s,c;this._logLevel<=m.LogLevelEnum.ERROR&&this._log((c=(s=this._optionsService.options.logger)===null||s===void 0?void 0:s.error.bind(this._optionsService.options.logger))!==null&&c!==void 0?c:console.error,a,o)}};l.LogService=g=f([S(0,m.IOptionsService)],g),l.setTraceLogger=function(a){w=a},l.traceCall=function(a,o,s){if(typeof s.value!="function")throw new Error("not supported");const c=s.value;s.value=function(...p){if(w.logLevel!==m.LogLevelEnum.TRACE)return c.apply(this,p);w.trace(`GlyphRenderer#${c.name}(${p.map(x=>JSON.stringify(x)).join(", ")})`);const v=c.apply(this,p);return w.trace(`GlyphRenderer#${c.name} return`,v),v}}},7302:(_,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.OptionsService=l.DEFAULT_OPTIONS=void 0;const f=u(8460),S=u(844),d=u(6114);l.DEFAULT_OPTIONS={cols:80,rows:24,cursorBlink:!1,cursorStyle:"block",cursorWidth:1,cursorInactiveStyle:"outline",customGlyphs:!0,drawBoldTextInBrightColors:!0,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:{},rightClickSelectsWord:d.isMac,windowOptions:{},windowsMode:!1,windowsPty:{},wordSeparator:" ()[]{}',\"`",altClickMovesCursor:!0,convertEol:!1,termName:"xterm",cancelEvents:!1,overviewRulerWidth:0};const m=["normal","bold","100","200","300","400","500","600","700","800","900"];class C extends S.Disposable{constructor(g){super(),this._onOptionChange=this.register(new f.EventEmitter),this.onOptionChange=this._onOptionChange.event;const a=Object.assign({},l.DEFAULT_OPTIONS);for(const o in g)if(o in a)try{const s=g[o];a[o]=this._sanitizeAndValidateOption(o,s)}catch(s){console.error(s)}this.rawOptions=a,this.options=Object.assign({},a),this._setupOptions()}onSpecificOptionChange(g,a){return this.onOptionChange(o=>{o===g&&a(this.rawOptions[g])})}onMultipleOptionChange(g,a){return this.onOptionChange(o=>{g.indexOf(o)!==-1&&a()})}_setupOptions(){const g=o=>{if(!(o in l.DEFAULT_OPTIONS))throw new Error(`No option with key "${o}"`);return this.rawOptions[o]},a=(o,s)=>{if(!(o in l.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:g.bind(this,o),set:a.bind(this,o)};Object.defineProperty(this.options,o,s)}}_sanitizeAndValidateOption(g,a){switch(g){case"cursorStyle":if(a||(a=l.DEFAULT_OPTIONS[g]),!function(o){return o==="block"||o==="underline"||o==="bar"}(a))throw new Error(`"${a}" is not a valid value for ${g}`);break;case"wordSeparator":a||(a=l.DEFAULT_OPTIONS[g]);break;case"fontWeight":case"fontWeightBold":if(typeof a=="number"&&1<=a&&a<=1e3)break;a=m.includes(a)?a:l.DEFAULT_OPTIONS[g];break;case"cursorWidth":a=Math.floor(a);case"lineHeight":case"tabStopWidth":if(a<1)throw new Error(`${g} cannot be less than 1, value: ${a}`);break;case"minimumContrastRatio":a=Math.max(1,Math.min(21,Math.round(10*a)/10));break;case"scrollback":if((a=Math.min(a,4294967295))<0)throw new Error(`${g} cannot be less than 0, value: ${a}`);break;case"fastScrollSensitivity":case"scrollSensitivity":if(a<=0)throw new Error(`${g} cannot be less than or equal to 0, value: ${a}`);break;case"rows":case"cols":if(!a&&a!==0)throw new Error(`${g} must be numeric, value: ${a}`);break;case"windowsPty":a=a??{}}return a}}l.OptionsService=C},2660:function(_,l,u){var f=this&&this.__decorate||function(C,w,g,a){var o,s=arguments.length,c=s<3?w:a===null?a=Object.getOwnPropertyDescriptor(w,g):a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")c=Reflect.decorate(C,w,g,a);else for(var p=C.length-1;p>=0;p--)(o=C[p])&&(c=(s<3?o(c):s>3?o(w,g,c):o(w,g))||c);return s>3&&c&&Object.defineProperty(w,g,c),c},S=this&&this.__param||function(C,w){return function(g,a){w(g,a,C)}};Object.defineProperty(l,"__esModule",{value:!0}),l.OscLinkService=void 0;const d=u(2585);let m=l.OscLinkService=class{constructor(C){this._bufferService=C,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(C){const w=this._bufferService.buffer;if(C.id===void 0){const p=w.addMarker(w.ybase+w.y),v={data:C,id:this._nextId++,lines:[p]};return p.onDispose(()=>this._removeMarkerFromLink(v,p)),this._dataByLinkId.set(v.id,v),v.id}const g=C,a=this._getEntryIdKey(g),o=this._entriesWithId.get(a);if(o)return this.addLineToLink(o.id,w.ybase+w.y),o.id;const s=w.addMarker(w.ybase+w.y),c={id:this._nextId++,key:this._getEntryIdKey(g),data:g,lines:[s]};return s.onDispose(()=>this._removeMarkerFromLink(c,s)),this._entriesWithId.set(c.key,c),this._dataByLinkId.set(c.id,c),c.id}addLineToLink(C,w){const g=this._dataByLinkId.get(C);if(g&&g.lines.every(a=>a.line!==w)){const a=this._bufferService.buffer.addMarker(w);g.lines.push(a),a.onDispose(()=>this._removeMarkerFromLink(g,a))}}getLinkData(C){var w;return(w=this._dataByLinkId.get(C))===null||w===void 0?void 0:w.data}_getEntryIdKey(C){return`${C.id};;${C.uri}`}_removeMarkerFromLink(C,w){const g=C.lines.indexOf(w);g!==-1&&(C.lines.splice(g,1),C.lines.length===0&&(C.data.id!==void 0&&this._entriesWithId.delete(C.key),this._dataByLinkId.delete(C.id)))}};l.OscLinkService=m=f([S(0,d.IBufferService)],m)},8343:(_,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.createDecorator=l.getServiceDependencies=l.serviceRegistry=void 0;const u="di$target",f="di$dependencies";l.serviceRegistry=new Map,l.getServiceDependencies=function(S){return S[f]||[]},l.createDecorator=function(S){if(l.serviceRegistry.has(S))return l.serviceRegistry.get(S);const d=function(m,C,w){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");(function(g,a,o){a[u]===a?a[f].push({id:g,index:o}):(a[f]=[{id:g,index:o}],a[u]=a)})(d,m,w)};return d.toString=()=>S,l.serviceRegistry.set(S,d),d}},2585:(_,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.IDecorationService=l.IUnicodeService=l.IOscLinkService=l.IOptionsService=l.ILogService=l.LogLevelEnum=l.IInstantiationService=l.ICharsetService=l.ICoreService=l.ICoreMouseService=l.IBufferService=void 0;const f=u(8343);var S;l.IBufferService=(0,f.createDecorator)("BufferService"),l.ICoreMouseService=(0,f.createDecorator)("CoreMouseService"),l.ICoreService=(0,f.createDecorator)("CoreService"),l.ICharsetService=(0,f.createDecorator)("CharsetService"),l.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"}(S||(l.LogLevelEnum=S={})),l.ILogService=(0,f.createDecorator)("LogService"),l.IOptionsService=(0,f.createDecorator)("OptionsService"),l.IOscLinkService=(0,f.createDecorator)("OscLinkService"),l.IUnicodeService=(0,f.createDecorator)("UnicodeService"),l.IDecorationService=(0,f.createDecorator)("DecorationService")},1480:(_,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.UnicodeService=void 0;const f=u(8460),S=u(225);l.UnicodeService=class{constructor(){this._providers=Object.create(null),this._active="",this._onChange=new f.EventEmitter,this.onChange=this._onChange.event;const d=new S.UnicodeV6;this.register(d),this._active=d.version,this._activeProvider=d}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(d){if(!this._providers[d])throw new Error(`unknown Unicode version "${d}"`);this._active=d,this._activeProvider=this._providers[d],this._onChange.fire(d)}register(d){this._providers[d.version]=d}wcwidth(d){return this._activeProvider.wcwidth(d)}getStringCellWidth(d){let m=0;const C=d.length;for(let w=0;w<C;++w){let g=d.charCodeAt(w);if(55296<=g&&g<=56319){if(++w>=C)return m+this.wcwidth(g);const a=d.charCodeAt(w);56320<=a&&a<=57343?g=1024*(g-55296)+a-56320+65536:m+=this.wcwidth(a)}m+=this.wcwidth(g)}return m}}}},i={};function n(_){var l=i[_];if(l!==void 0)return l.exports;var u=i[_]={exports:{}};return r[_].call(u.exports,u,u.exports,n),u.exports}var h={};return(()=>{var _=h;Object.defineProperty(_,"__esModule",{value:!0}),_.Terminal=void 0;const l=n(9042),u=n(3236),f=n(844),S=n(5741),d=n(8285),m=n(7975),C=n(7090),w=["cols","rows"];class g extends f.Disposable{constructor(o){super(),this._core=this.register(new u.Terminal(o)),this._addonManager=this.register(new S.AddonManager),this._publicOptions=Object.assign({},this._core.options);const s=p=>this._core.options[p],c=(p,v)=>{this._checkReadonlyOptions(p),this._core.options[p]=v};for(const p in this._core.options){const v={get:s.bind(this,p),set:c.bind(this,p)};Object.defineProperty(this._publicOptions,p,v)}}_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 m.ParserApi(this._core)),this._parser}get unicode(){return this._checkProposedApi(),new C.UnicodeApi(this._core)}get textarea(){return this._core.textarea}get rows(){return this._core.rows}get cols(){return this._core.cols}get buffer(){return this._buffer||(this._buffer=this.register(new 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()}resize(o,s){this._verifyIntegers(o,s),this._core.resize(o,s)}open(o){this._core.open(o)}attachCustomKeyEventHandler(o){this._core.attachCustomKeyEventHandler(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){var s,c,p;return this._checkProposedApi(),this._verifyPositiveIntegers((s=o.x)!==null&&s!==void 0?s:0,(c=o.width)!==null&&c!==void 0?c:0,(p=o.height)!==null&&p!==void 0?p:0),this._core.registerDecoration(o)}hasSelection(){return this._core.hasSelection()}select(o,s,c){this._verifyIntegers(o,s,c),this._core.select(o,s,c)}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
48
- `,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 l}_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")}}_.Terminal=g})(),h})())})(qh);var $_=qh.exports,Xh={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 _=this._terminal.options.scrollback===0?0:n.viewport.scrollBarWidth,l=window.getComputedStyle(this._terminal.element.parentElement),u=parseInt(l.getPropertyValue("height")),f=Math.max(0,parseInt(l.getPropertyValue("width"))),S=window.getComputedStyle(this._terminal.element),d=u-(parseInt(S.getPropertyValue("padding-top"))+parseInt(S.getPropertyValue("padding-bottom"))),m=f-(parseInt(S.getPropertyValue("padding-right"))+parseInt(S.getPropertyValue("padding-left")))-_;return{cols:Math.max(2,Math.floor(m/h.css.cell.width)),rows:Math.max(1,Math.floor(d/h.css.cell.height))}}}})(),r})())})(Xh);var U_=Xh.exports,Yh={exports:{}};(function(e,t){(function(r,i){e.exports=i()})(hf,()=>(()=>{var r={433:(_,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.UnicodeV11=void 0;const u=[[768,879],[1155,1161],[1425,1469],[1471,1471],[1473,1474],[1476,1477],[1479,1479],[1536,1541],[1552,1562],[1564,1564],[1611,1631],[1648,1648],[1750,1757],[1759,1764],[1767,1768],[1770,1773],[1807,1807],[1809,1809],[1840,1866],[1958,1968],[2027,2035],[2045,2045],[2070,2073],[2075,2083],[2085,2087],[2089,2093],[2137,2139],[2259,2306],[2362,2362],[2364,2364],[2369,2376],[2381,2381],[2385,2391],[2402,2403],[2433,2433],[2492,2492],[2497,2500],[2509,2509],[2530,2531],[2558,2558],[2561,2562],[2620,2620],[2625,2626],[2631,2632],[2635,2637],[2641,2641],[2672,2673],[2677,2677],[2689,2690],[2748,2748],[2753,2757],[2759,2760],[2765,2765],[2786,2787],[2810,2815],[2817,2817],[2876,2876],[2879,2879],[2881,2884],[2893,2893],[2902,2902],[2914,2915],[2946,2946],[3008,3008],[3021,3021],[3072,3072],[3076,3076],[3134,3136],[3142,3144],[3146,3149],[3157,3158],[3170,3171],[3201,3201],[3260,3260],[3263,3263],[3270,3270],[3276,3277],[3298,3299],[3328,3329],[3387,3388],[3393,3396],[3405,3405],[3426,3427],[3530,3530],[3538,3540],[3542,3542],[3633,3633],[3636,3642],[3655,3662],[3761,3761],[3764,3772],[3784,3789],[3864,3865],[3893,3893],[3895,3895],[3897,3897],[3953,3966],[3968,3972],[3974,3975],[3981,3991],[3993,4028],[4038,4038],[4141,4144],[4146,4151],[4153,4154],[4157,4158],[4184,4185],[4190,4192],[4209,4212],[4226,4226],[4229,4230],[4237,4237],[4253,4253],[4448,4607],[4957,4959],[5906,5908],[5938,5940],[5970,5971],[6002,6003],[6068,6069],[6071,6077],[6086,6086],[6089,6099],[6109,6109],[6155,6158],[6277,6278],[6313,6313],[6432,6434],[6439,6440],[6450,6450],[6457,6459],[6679,6680],[6683,6683],[6742,6742],[6744,6750],[6752,6752],[6754,6754],[6757,6764],[6771,6780],[6783,6783],[6832,6846],[6912,6915],[6964,6964],[6966,6970],[6972,6972],[6978,6978],[7019,7027],[7040,7041],[7074,7077],[7080,7081],[7083,7085],[7142,7142],[7144,7145],[7149,7149],[7151,7153],[7212,7219],[7222,7223],[7376,7378],[7380,7392],[7394,7400],[7405,7405],[7412,7412],[7416,7417],[7616,7673],[7675,7679],[8203,8207],[8234,8238],[8288,8292],[8294,8303],[8400,8432],[11503,11505],[11647,11647],[11744,11775],[12330,12333],[12441,12442],[42607,42610],[42612,42621],[42654,42655],[42736,42737],[43010,43010],[43014,43014],[43019,43019],[43045,43046],[43204,43205],[43232,43249],[43263,43263],[43302,43309],[43335,43345],[43392,43394],[43443,43443],[43446,43449],[43452,43453],[43493,43493],[43561,43566],[43569,43570],[43573,43574],[43587,43587],[43596,43596],[43644,43644],[43696,43696],[43698,43700],[43703,43704],[43710,43711],[43713,43713],[43756,43757],[43766,43766],[44005,44005],[44008,44008],[44013,44013],[64286,64286],[65024,65039],[65056,65071],[65279,65279],[65529,65531]],f=[[66045,66045],[66272,66272],[66422,66426],[68097,68099],[68101,68102],[68108,68111],[68152,68154],[68159,68159],[68325,68326],[68900,68903],[69446,69456],[69633,69633],[69688,69702],[69759,69761],[69811,69814],[69817,69818],[69821,69821],[69837,69837],[69888,69890],[69927,69931],[69933,69940],[70003,70003],[70016,70017],[70070,70078],[70089,70092],[70191,70193],[70196,70196],[70198,70199],[70206,70206],[70367,70367],[70371,70378],[70400,70401],[70459,70460],[70464,70464],[70502,70508],[70512,70516],[70712,70719],[70722,70724],[70726,70726],[70750,70750],[70835,70840],[70842,70842],[70847,70848],[70850,70851],[71090,71093],[71100,71101],[71103,71104],[71132,71133],[71219,71226],[71229,71229],[71231,71232],[71339,71339],[71341,71341],[71344,71349],[71351,71351],[71453,71455],[71458,71461],[71463,71467],[71727,71735],[71737,71738],[72148,72151],[72154,72155],[72160,72160],[72193,72202],[72243,72248],[72251,72254],[72263,72263],[72273,72278],[72281,72283],[72330,72342],[72344,72345],[72752,72758],[72760,72765],[72767,72767],[72850,72871],[72874,72880],[72882,72883],[72885,72886],[73009,73014],[73018,73018],[73020,73021],[73023,73029],[73031,73031],[73104,73105],[73109,73109],[73111,73111],[73459,73460],[78896,78904],[92912,92916],[92976,92982],[94031,94031],[94095,94098],[113821,113822],[113824,113827],[119143,119145],[119155,119170],[119173,119179],[119210,119213],[119362,119364],[121344,121398],[121403,121452],[121461,121461],[121476,121476],[121499,121503],[121505,121519],[122880,122886],[122888,122904],[122907,122913],[122915,122916],[122918,122922],[123184,123190],[123628,123631],[125136,125142],[125252,125258],[917505,917505],[917536,917631],[917760,917999]],S=[[4352,4447],[8986,8987],[9001,9002],[9193,9196],[9200,9200],[9203,9203],[9725,9726],[9748,9749],[9800,9811],[9855,9855],[9875,9875],[9889,9889],[9898,9899],[9917,9918],[9924,9925],[9934,9934],[9940,9940],[9962,9962],[9970,9971],[9973,9973],[9978,9978],[9981,9981],[9989,9989],[9994,9995],[10024,10024],[10060,10060],[10062,10062],[10067,10069],[10071,10071],[10133,10135],[10160,10160],[10175,10175],[11035,11036],[11088,11088],[11093,11093],[11904,11929],[11931,12019],[12032,12245],[12272,12283],[12288,12329],[12334,12350],[12353,12438],[12443,12543],[12549,12591],[12593,12686],[12688,12730],[12736,12771],[12784,12830],[12832,12871],[12880,19903],[19968,42124],[42128,42182],[43360,43388],[44032,55203],[63744,64255],[65040,65049],[65072,65106],[65108,65126],[65128,65131],[65281,65376],[65504,65510]],d=[[94176,94179],[94208,100343],[100352,101106],[110592,110878],[110928,110930],[110948,110951],[110960,111355],[126980,126980],[127183,127183],[127374,127374],[127377,127386],[127488,127490],[127504,127547],[127552,127560],[127568,127569],[127584,127589],[127744,127776],[127789,127797],[127799,127868],[127870,127891],[127904,127946],[127951,127955],[127968,127984],[127988,127988],[127992,128062],[128064,128064],[128066,128252],[128255,128317],[128331,128334],[128336,128359],[128378,128378],[128405,128406],[128420,128420],[128507,128591],[128640,128709],[128716,128716],[128720,128722],[128725,128725],[128747,128748],[128756,128762],[128992,129003],[129293,129393],[129395,129398],[129402,129442],[129445,129450],[129454,129482],[129485,129535],[129648,129651],[129656,129658],[129664,129666],[129680,129685],[131072,196605],[196608,262141]];let m;function C(w,g){let a,o=0,s=g.length-1;if(w<g[0][0]||w>g[s][1])return!1;for(;s>=o;)if(a=o+s>>1,w>g[a][1])o=a+1;else{if(!(w<g[a][0]))return!0;s=a-1}return!1}l.UnicodeV11=class{constructor(){if(this.version="11",!m){m=new Uint8Array(65536),m.fill(1),m[0]=0,m.fill(0,1,32),m.fill(0,127,160);for(let w=0;w<u.length;++w)m.fill(0,u[w][0],u[w][1]+1);for(let w=0;w<S.length;++w)m.fill(2,S[w][0],S[w][1]+1)}}wcwidth(w){return w<32?0:w<127?1:w<65536?m[w]:C(w,f)?0:C(w,d)?2:1}}}},i={};function n(_){var l=i[_];if(l!==void 0)return l.exports;var u=i[_]={exports:{}};return r[_](u,u.exports,n),u.exports}var h={};return(()=>{var _=h;Object.defineProperty(_,"__esModule",{value:!0}),_.Unicode11Addon=void 0;const l=n(433);_.Unicode11Addon=class{activate(u){u.unicode.register(new l.UnicodeV11)}dispose(){}}})(),h})())})(Yh);var W_=Yh.exports,Qh={exports:{}};(function(e,t){(function(r,i){e.exports=i()})(self,()=>(()=>{var r={6:(_,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.LinkComputer=l.WebLinkProvider=void 0,l.WebLinkProvider=class{constructor(f,S,d,m={}){this._terminal=f,this._regex=S,this._handler=d,this._options=m}provideLinks(f,S){const d=u.computeLink(f,this._regex,this._terminal,this._handler);S(this._addCallbacks(d))}_addCallbacks(f){return f.map(S=>(S.leave=this._options.leave,S.hover=(d,m)=>{if(this._options.hover){const{range:C}=S;this._options.hover(d,m,C)}},S))}};class u{static computeLink(S,d,m,C){const w=new RegExp(d.source,(d.flags||"")+"g"),[g,a]=u._getWindowedLineStrings(S-1,m),o=g.join("");let s;const c=[];for(;s=w.exec(o);){const p=s[0];try{const R=new URL(p),O=decodeURI(R.toString());if(p!==O&&p+"/"!==O)continue}catch{continue}const[v,x]=u._mapStrIdx(m,a,0,s.index),[b,y]=u._mapStrIdx(m,v,x,p.length);if(v===-1||x===-1||b===-1||y===-1)continue;const k={start:{x:x+1,y:v+1},end:{x:y,y:b+1}};c.push({range:k,text:p,activate:C})}return c}static _getWindowedLineStrings(S,d){let m,C=S,w=S,g=0,a="";const o=[];if(m=d.buffer.active.getLine(S)){const s=m.translateToString(!0);if(m.isWrapped&&s[0]!==" "){for(g=0;(m=d.buffer.active.getLine(--C))&&g<2048&&(a=m.translateToString(!0),g+=a.length,o.push(a),m.isWrapped&&a.indexOf(" ")===-1););o.reverse()}for(o.push(s),g=0;(m=d.buffer.active.getLine(++w))&&m.isWrapped&&g<2048&&(a=m.translateToString(!0),g+=a.length,o.push(a),a.indexOf(" ")===-1););}return[o,C]}static _mapStrIdx(S,d,m,C){const w=S.buffer.active,g=w.getNullCell();let a=m;for(;C;){const o=w.getLine(d);if(!o)return[-1,-1];for(let s=a;s<o.length;++s){o.getCell(s,g);const c=g.getChars();if(g.getWidth()&&(C-=c.length||1,s===o.length-1&&c==="")){const p=w.getLine(d+1);p&&p.isWrapped&&(p.getCell(0,g),g.getWidth()===2&&(C+=1))}if(C<0)return[d,s]}d++,a=0}return[d,a]}}l.LinkComputer=u}},i={};function n(_){var l=i[_];if(l!==void 0)return l.exports;var u=i[_]={exports:{}};return r[_](u,u.exports,n),u.exports}var h={};return(()=>{var _=h;Object.defineProperty(_,"__esModule",{value:!0}),_.WebLinksAddon=void 0;const l=n(6),u=/https?:[/]{2}[^\s"'!*(){}|\\\^<>`]*[^\s"':,.!?{}|\\\^~\[\]`()<>]/;function f(S,d){const m=window.open();if(m){try{m.opener=null}catch{}m.location.href=d}else console.warn("Opening link blocked as opener could not be cleared")}_.WebLinksAddon=class{constructor(S=f,d={}){this._handler=S,this._options=d}activate(S){this._terminal=S;const d=this._options,m=d.urlRegex||u;this._linkProvider=this._terminal.registerLinkProvider(new l.WebLinkProvider(this._terminal,m,this._handler,d))}dispose(){var S;(S=this._linkProvider)===null||S===void 0||S.dispose()}}})(),h})())})(Qh);var V_=Qh.exports;const K_="",q_="",Jh="保存しました。",G_="デッキを作成する前にワークスペースを追加してください。",X_="ワークスペースを選択してください。",Y_=2e3,Zh='"JetBrains Mono", monospace',ed=14,Q_='"Cascadia Code", "JetBrains Mono", "Consolas", "Menlo", monospace',J_=13,cc="#000000",uc="#ffffff",td="deck-theme",Z_=204;async function ue(e,t={}){const r=await fetch(`${K_}${e}`,{...t,credentials:"include"});if(!r.ok){const i=await r.text();throw new Error(i||`Request failed (${r.status})`)}return r.status===Z_?null:r.json()}const Ue="application/json",rt="POST",rd="PUT",Zi="DELETE";function ev(){return window.location.origin.replace(/^http/,"ws")}function tv(){return ue("/api/ws-token")}function rv(){return ue("/api/workspaces")}function iv(){return ue("/api/config")}function nv(e){return ue("/api/workspaces",{method:rt,headers:{"Content-Type":Ue},body:JSON.stringify({path:e})})}function sv(e){return ue(`/api/workspaces/${e}`,{method:Zi})}function ov(){return ue("/api/decks")}function lv(e,t){return ue("/api/decks",{method:rt,headers:{"Content-Type":Ue},body:JSON.stringify({name:e,workspaceId:t})})}function av(e){return ue(`/api/decks/${e}`,{method:Zi})}function cv(e){return ue("/api/decks/order",{method:rd,headers:{"Content-Type":Ue},body:JSON.stringify({deckIds:e})})}function hc(e,t=""){const r=new URLSearchParams({workspaceId:e,path:t});return ue(`/api/files?${r.toString()}`)}function dc(e,t=""){const r=new URLSearchParams({path:e,subpath:t});return ue(`/api/preview?${r.toString()}`)}function uv(e,t){const r=new URLSearchParams({workspaceId:e,path:t});return ue(`/api/file?${r.toString()}`)}function hv(e,t,r){return ue("/api/file",{method:rd,headers:{"Content-Type":Ue},body:JSON.stringify({workspaceId:e,path:t,contents:r})})}function dv(e,t,r=""){return ue("/api/file",{method:rt,headers:{"Content-Type":Ue},body:JSON.stringify({workspaceId:e,path:t,contents:r})})}function fv(e,t){const r=new URLSearchParams({workspaceId:e,path:t});return ue(`/api/file?${r.toString()}`,{method:Zi})}function pv(e,t){return ue("/api/dir",{method:rt,headers:{"Content-Type":Ue},body:JSON.stringify({workspaceId:e,path:t})})}function _v(e,t){const r=new URLSearchParams({workspaceId:e,path:t});return ue(`/api/dir?${r.toString()}`,{method:Zi})}function vv(e,t,r){return ue("/api/terminals",{method:rt,headers:{"Content-Type":Ue},body:JSON.stringify({deckId:e,title:t,command:r})})}function mv(e){const t=new URLSearchParams({deckId:e});return ue(`/api/terminals?${t.toString()}`)}function gv(e){return ue(`/api/terminals/${e}`,{method:Zi})}function id(e,t){const r={workspaceId:e};t!==void 0&&(r.repoPath=t);const i=new URLSearchParams(r);return ue(`/api/git/status?${i.toString()}`)}function yv(e){const t=new URLSearchParams({workspaceId:e});return ue(`/api/git/repos?${t.toString()}`)}function nd(e,t,r){return ue("/api/git/stage",{method:rt,headers:{"Content-Type":Ue},body:JSON.stringify({workspaceId:e,paths:t,repoPath:r})})}function sd(e,t,r){return ue("/api/git/unstage",{method:rt,headers:{"Content-Type":Ue},body:JSON.stringify({workspaceId:e,paths:t,repoPath:r})})}function Sv(e,t,r){return ue("/api/git/commit",{method:rt,headers:{"Content-Type":Ue},body:JSON.stringify({workspaceId:e,message:t,repoPath:r})})}function Cv(e,t,r){return ue("/api/git/discard",{method:rt,headers:{"Content-Type":Ue},body:JSON.stringify({workspaceId:e,paths:t,repoPath:r})})}function wv(e,t,r,i){const n={workspaceId:e,path:t,staged:r.toString()};i!==void 0&&(n.repoPath=i);const h=new URLSearchParams(n);return ue(`/api/git/diff?${h.toString()}`)}function xv(e,t){return ue("/api/git/push",{method:rt,headers:{"Content-Type":Ue},body:JSON.stringify({workspaceId:e,repoPath:t})})}function bv(e,t){return ue("/api/git/pull",{method:rt,headers:{"Content-Type":Ue},body:JSON.stringify({workspaceId:e,repoPath:t})})}function Ev(e,t){return ue("/api/git/fetch",{method:rt,headers:{"Content-Type":Ue},body:JSON.stringify({workspaceId:e,repoPath:t})})}function od(e,t){const r={workspaceId:e};t!==void 0&&(r.repoPath=t);const i=new URLSearchParams(r);return ue(`/api/git/branch-status?${i.toString()}`)}function ld(e,t){const r={workspaceId:e};t!==void 0&&(r.repoPath=t);const i=new URLSearchParams(r);return ue(`/api/git/remotes?${i.toString()}`)}function kv(e,t){const r={workspaceId:e};t!==void 0&&(r.repoPath=t);const i=new URLSearchParams(r);return ue(`/api/git/branches?${i.toString()}`)}function Lv(e,t,r){return ue("/api/git/checkout",{method:rt,headers:{"Content-Type":Ue},body:JSON.stringify({workspaceId:e,branchName:t,repoPath:r})})}function Dv(e,t,r=!0,i){return ue("/api/git/create-branch",{method:rt,headers:{"Content-Type":Ue},body:JSON.stringify({workspaceId:e,branchName:t,checkout:r,repoPath:i})})}function Rv(e,t=50,r){const i={workspaceId:e,limit:String(t)};r!==void 0&&(i.repoPath=r);const n=new URLSearchParams(i);return ue(`/api/git/log?${n.toString()}`)}const Tv="接続が終了しました。",fc=5,pc=1e3,Av=new Set(["Deck deleted","Terminal deleted","Terminal exited","Terminal not found"]),_c=new TextEncoder;function Pv(e){const t=new Uint8Array(e.length);for(let r=0;r<e.length;r++)t[r]=e.charCodeAt(r)&255;return t}function Mv({session:e,wsUrl:t,onDelete:r,onExit:i}){const n=N.useRef(null),h=N.useRef(null),_=N.useRef(null),l=N.useRef(0),u=N.useRef(i);return N.useEffect(()=>{u.current=i},[i]),N.useEffect(()=>{var Xe,Ut;if(!n.current)return;l.current=0,n.current.innerHTML="";const f=new $_.Terminal({cursorBlink:!0,fontFamily:Q_,fontSize:J_,allowProposedApi:!0,scrollback:3e3,convertEol:!1,windowsMode:!1,rightClickSelectsWord:!0,theme:{background:cc,foreground:uc},windowOptions:{getWinSizePixels:!0,getCellSizePixels:!0,getWinSizeChars:!0}}),S=new U_.FitAddon,d=new W_.Unicode11Addon,m=new V_.WebLinksAddon;f.loadAddon(S),f.loadAddon(d),f.loadAddon(m),f.unicode.activeVersion="11",h.current=S,f.open(n.current);let C=!0,w=!1,g=0,a=!1;const o=()=>{C=!1,a&&(a=!1,E(!0))},s=Q=>{const Y=_.current;Y&&Y.readyState===WebSocket.OPEN&&Y.send(JSON.stringify(Q))},c=Q=>{if(C)return;const Y=_.current;Y&&Y.readyState===WebSocket.OPEN&&Y.send(_c.encode(Q))};f.parser.registerCsiHandler({final:"n"},Q=>{const Y=Q.length>0?Q[0]:0;if(Y===6){const te=f.buffer.active,ie=te.cursorY+te.baseY+1,oe=te.cursorX+1;return c(`\x1B[${ie};${oe}R`),!0}else if(Y===5)return c("\x1B[0n"),!0;return!1}),f.parser.registerCsiHandler({final:"c"},Q=>(c("\x1B[?62;1;6;22c"),!0)),f.parser.registerCsiHandler({prefix:">",final:"c"},Q=>(c("\x1B[>1;500;0c"),!0)),f.parser.registerCsiHandler({prefix:"?",final:"p",intermediates:"$"},Q=>{const Y=Q[0]||0,te=f.modes;let ie=0;return Y===1?ie=te.applicationCursorKeysMode?1:2:Y===25?ie=1:Y===1e3?ie=te.mouseTrackingMode==="x10"?1:2:Y===1002?ie=te.mouseTrackingMode==="drag"?1:2:Y===1003?ie=te.mouseTrackingMode==="any"?1:2:Y===1004?ie=te.sendFocusMode?1:2:Y===1006?ie=te.mouseTrackingMode!=="none"?1:2:Y===1049?ie=f.buffer.active.type==="alternate"?1:2:Y===2004?ie=te.bracketedPasteMode?1:2:Y===2026&&(ie=2),c(`\x1B[?${Y};${ie}$y`),!0});const p=Q=>(Q*257).toString(16).padStart(4,"0");f.parser.registerOscHandler(10,Q=>{if(Q==="?"){const Y=uc,te=parseInt(Y.slice(1,3),16),ie=parseInt(Y.slice(3,5),16),oe=parseInt(Y.slice(5,7),16);return c(`\x1B]10;rgb:${p(te)}/${p(ie)}/${p(oe)}\x07`),!0}return!1}),f.parser.registerOscHandler(11,Q=>{if(Q==="?"){const Y=cc,te=parseInt(Y.slice(1,3),16),ie=parseInt(Y.slice(3,5),16),oe=parseInt(Y.slice(5,7),16);return c(`\x1B]11;rgb:${p(te)}/${p(ie)}/${p(oe)}\x07`),!0}return!1}),f.parser.registerOscHandler(12,Q=>Q==="?"?(c("\x1B]12;rgb:ffff/ffff/ffff\x07"),!0):!1),f.parser.registerOscHandler(4,Q=>{const Y=Q.match(/^(\d+);?\?$/);if(Y){const te=parseInt(Y[1]),ie=["0000/0000/0000","cdcb/0000/0000","0000/cdcb/0000","cdcb/cdcb/0000","1e1e/9090/ffff","cdcb/0000/cdcb","0000/cdcb/cdcb","e5e5/e5e5/e5e5"],oe=te<8?ie[te]:"0000/0000/0000";return c(`\x1B]4;${te};rgb:${oe}\x07`),!0}return!1}),f.parser.registerOscHandler(52,Q=>!!Q.includes("?")),f.parser.registerCsiHandler({prefix:">",final:"q"},Q=>(c("\x1BP>|xterm.js(5.0.0)\x1B\\"),!0)),f.parser.registerCsiHandler({prefix:"?",final:"u"},Q=>!0),f.parser.registerCsiHandler({prefix:"?",final:"m"},Q=>Q[0]===4?(c("\x1B[>4;0m"),!0):!1),f.parser.registerCsiHandler({final:"t"},Q=>{const Y=Q[0];return Y===19?(c(`\x1B[9;${f.rows};${f.cols}t`),!0):Y===20?(c("\x1B]LTerminal\x1B\\"),!0):Y===21?(c("\x1B]lTerminal\x1B\\"),!0):!1}),f.parser.registerCsiHandler({prefix:"?",final:"S"},Q=>!0),f.parser.registerDcsHandler({intermediates:"$",final:"q"},(Q,Y)=>Q==="m"?(c("\x1BP1$rm\x1B\\"),!0):Q==='"p'?(c('\x1BP1$r62;1"p\x1B\\'),!0):Q==="r"?(c(`\x1BP1$r1;${f.rows}r\x1B\\`),!0):(c("\x1BP0$r\x1B\\"),!0)),f.parser.registerDcsHandler({intermediates:"+",final:"q"},(Q,Y)=>{try{const ie=(Q.match(/.{2}/g)||[]).map(ce=>String.fromCharCode(parseInt(ce,16))).join(""),oe={TN:"xterm-256color",Co:"256",RGB:"",Tc:"",colors:"256",setrgbf:"\x1B[38;2;%p1%d;%p2%d;%p3%dm",setrgbb:"\x1B[48;2;%p1%d;%p2%d;%p3%dm"};if(ie in oe){const Be=oe[ie].split("").map(me=>me.charCodeAt(0).toString(16).padStart(2,"0")).join("");return c(`\x1BP1+r${Be}\x1B\\`),!0}}catch(te){console.error("[XTGETTCAP] Failed to decode:",te)}return c("\x1BP0+r\x1B\\"),!0}),f.parser.registerCsiHandler({final:"b"},Q=>{const Y=Q[0]||1;return Y>65535?(console.warn(`[REP] Large repeat count ${Y} clamped to 65535 for security`),!0):!1});let v=0,x=0,b=null,y=f.cols,k=f.rows,R=0,O=0,T=((Xe=window.visualViewport)==null?void 0:Xe.scale)??1;const B=(Q,Y)=>{f.cols>0&&(R=Q/f.cols),f.rows>0&&(O=Y/f.rows)},z=n.current.querySelector(".xterm-helper-textarea");z instanceof HTMLTextAreaElement&&(z.setAttribute("spellcheck","false"),z.setAttribute("autocapitalize","off"),z.setAttribute("autocomplete","off"),z.setAttribute("autocorrect","off"));const I=()=>{const Q=f.cols,Y=f.rows;!Q||!Y||Q===y&&Y===k||(y=Q,k=Y,s({type:"resize",cols:Q,rows:Y}))},j=()=>{s({type:"claim"})},$=(Q=!1)=>{var ce;if(a)return;const Y=n.current;if(!Y)return;const te=Y.clientWidth,ie=Y.clientHeight;if(!te||!ie||!Q&&te===v&&ie===x)return;const oe=((ce=window.visualViewport)==null?void 0:ce.scale)??1;if(!Q&&R>0&&O>0){const Be=Math.max(2,Math.floor(te/R)),me=Math.max(1,Math.floor(ie/O)),Tt=Math.abs(te-v),We=Math.abs(ie-x),At=Math.max(R*.75,2),pe=Math.max(O*.75,2),ni=Math.abs(oe-T)>.001;if(Be===y&&me===k){v=te,x=ie,T=oe;return}if(ni&&Tt<At&&We<pe){v=te,x=ie,T=oe;return}}v=te,x=ie,S.fit(),B(te,ie),T=oe,I()},E=(Q=!1)=>{if(b!==null){if(!Q)return;cancelAnimationFrame(b)}b=window.requestAnimationFrame(()=>{b=null,$(Q)})},A=new ResizeObserver(()=>{E()});A.observe(n.current),E();const P=typeof document<"u"?document.fonts:null,M=()=>{D||E(!0)};P==null||P.ready.then(M).catch(()=>{}),(Ut=P==null?void 0:P.addEventListener)==null||Ut.call(P,"loadingdone",M);let H=null,K=null,X=null,q=null,se=null,D=!1,F=0,W=null,U=!1,re=!1;const J=n.current.closest(".terminal-pane"),ae=Q=>{J instanceof HTMLElement&&(Q?J.dataset.terminalFocus="true":delete J.dataset.terminalFocus)},we=()=>{var Y;const Q=(Y=n.current)==null?void 0:Y.querySelector(".xterm-helper-textarea");if(Q instanceof HTMLTextAreaElement)try{Q.focus({preventScroll:!0})}catch{Q.focus()}},fe=()=>{D||we()},ut=()=>{D||(ae(!0),we())},ne=()=>{window.setTimeout(()=>{if(D)return;const Q=n.current;Q&&(Q.contains(document.activeElement)||ae(!1))},0)};n.current.addEventListener("pointerdown",fe,{passive:!0,capture:!0}),n.current.addEventListener("mousedown",fe,{passive:!0,capture:!0}),n.current.addEventListener("touchstart",fe,{passive:!0,capture:!0}),n.current.addEventListener("focusin",ut,!0),n.current.addEventListener("focusout",ne,!0),se=()=>{var Q,Y,te,ie,oe;(Q=n.current)==null||Q.removeEventListener("pointerdown",fe,!0),(Y=n.current)==null||Y.removeEventListener("mousedown",fe,!0),(te=n.current)==null||te.removeEventListener("touchstart",fe,!0),(ie=n.current)==null||ie.removeEventListener("focusin",ut,!0),(oe=n.current)==null||oe.removeEventListener("focusout",ne,!0)};const ht=async(Q=!1)=>{if(!D){C=!0,w=!1,g=0;try{const{token:Y,authEnabled:te}=await tv();if(D)return;const ie=te?`${t}?token=${Y}`:t;let oe=ie;if(Q&&l.current>0){const ce=ie.includes("?")?"&":"?";oe=`${ie}${ce}bufferOffset=${l.current}`}if(Q){const ce=oe.includes("?")?"&":"?";oe=`${oe}${ce}reconnect=1`}if(H=new WebSocket(oe),H.binaryType="arraybuffer",_.current=H,H.addEventListener("open",()=>{var ce;F=0,re=!0,v=0,x=0,R=0,O=0,y=-1,k=-1,T=((ce=window.visualViewport)==null?void 0:ce.scale)??1,E()}),H.addEventListener("message",ce=>{if(typeof ce.data=="string"){let me=null;try{me=JSON.parse(ce.data)}catch{return}if((me==null?void 0:me.type)==="sync"){C=!0,w=!1,g=0,a=!1,l.current=me.offsetBase,me.reset&&(f.reset(),$(!0),a=!0);return}if((me==null?void 0:me.type)==="ready"){w=!0,g===0&&o();return}return}if(ce.data instanceof Blob){ce.data.arrayBuffer().then(Tt=>{if(D)return;const We=new Uint8Array(Tt);g++,f.write(We,()=>{l.current+=We.byteLength,g=Math.max(0,g-1),w&&g===0&&o()})});return}const Be=new Uint8Array(ce.data);g++,f.write(Be,()=>{l.current+=Be.byteLength,g=Math.max(0,g-1),w&&g===0&&(C=!1)})}),H.addEventListener("close",ce=>{if(!(D||U)){if(ce.code===1e3&&Av.has(ce.reason)){u.current();return}if(F<fc){F++;const Be=pc*Math.pow(2,F-1);W=setTimeout(()=>ht(!0),Be)}else f.write(`\r
48
+ `,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 l}_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")}}_.Terminal=g})(),h})())})(qh);var $_=qh.exports,Xh={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 _=this._terminal.options.scrollback===0?0:n.viewport.scrollBarWidth,l=window.getComputedStyle(this._terminal.element.parentElement),u=parseInt(l.getPropertyValue("height")),f=Math.max(0,parseInt(l.getPropertyValue("width"))),S=window.getComputedStyle(this._terminal.element),d=u-(parseInt(S.getPropertyValue("padding-top"))+parseInt(S.getPropertyValue("padding-bottom"))),m=f-(parseInt(S.getPropertyValue("padding-right"))+parseInt(S.getPropertyValue("padding-left")))-_;return{cols:Math.max(2,Math.floor(m/h.css.cell.width)),rows:Math.max(1,Math.floor(d/h.css.cell.height))}}}})(),r})())})(Xh);var U_=Xh.exports,Yh={exports:{}};(function(e,t){(function(r,i){e.exports=i()})(hf,()=>(()=>{var r={433:(_,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.UnicodeV11=void 0;const u=[[768,879],[1155,1161],[1425,1469],[1471,1471],[1473,1474],[1476,1477],[1479,1479],[1536,1541],[1552,1562],[1564,1564],[1611,1631],[1648,1648],[1750,1757],[1759,1764],[1767,1768],[1770,1773],[1807,1807],[1809,1809],[1840,1866],[1958,1968],[2027,2035],[2045,2045],[2070,2073],[2075,2083],[2085,2087],[2089,2093],[2137,2139],[2259,2306],[2362,2362],[2364,2364],[2369,2376],[2381,2381],[2385,2391],[2402,2403],[2433,2433],[2492,2492],[2497,2500],[2509,2509],[2530,2531],[2558,2558],[2561,2562],[2620,2620],[2625,2626],[2631,2632],[2635,2637],[2641,2641],[2672,2673],[2677,2677],[2689,2690],[2748,2748],[2753,2757],[2759,2760],[2765,2765],[2786,2787],[2810,2815],[2817,2817],[2876,2876],[2879,2879],[2881,2884],[2893,2893],[2902,2902],[2914,2915],[2946,2946],[3008,3008],[3021,3021],[3072,3072],[3076,3076],[3134,3136],[3142,3144],[3146,3149],[3157,3158],[3170,3171],[3201,3201],[3260,3260],[3263,3263],[3270,3270],[3276,3277],[3298,3299],[3328,3329],[3387,3388],[3393,3396],[3405,3405],[3426,3427],[3530,3530],[3538,3540],[3542,3542],[3633,3633],[3636,3642],[3655,3662],[3761,3761],[3764,3772],[3784,3789],[3864,3865],[3893,3893],[3895,3895],[3897,3897],[3953,3966],[3968,3972],[3974,3975],[3981,3991],[3993,4028],[4038,4038],[4141,4144],[4146,4151],[4153,4154],[4157,4158],[4184,4185],[4190,4192],[4209,4212],[4226,4226],[4229,4230],[4237,4237],[4253,4253],[4448,4607],[4957,4959],[5906,5908],[5938,5940],[5970,5971],[6002,6003],[6068,6069],[6071,6077],[6086,6086],[6089,6099],[6109,6109],[6155,6158],[6277,6278],[6313,6313],[6432,6434],[6439,6440],[6450,6450],[6457,6459],[6679,6680],[6683,6683],[6742,6742],[6744,6750],[6752,6752],[6754,6754],[6757,6764],[6771,6780],[6783,6783],[6832,6846],[6912,6915],[6964,6964],[6966,6970],[6972,6972],[6978,6978],[7019,7027],[7040,7041],[7074,7077],[7080,7081],[7083,7085],[7142,7142],[7144,7145],[7149,7149],[7151,7153],[7212,7219],[7222,7223],[7376,7378],[7380,7392],[7394,7400],[7405,7405],[7412,7412],[7416,7417],[7616,7673],[7675,7679],[8203,8207],[8234,8238],[8288,8292],[8294,8303],[8400,8432],[11503,11505],[11647,11647],[11744,11775],[12330,12333],[12441,12442],[42607,42610],[42612,42621],[42654,42655],[42736,42737],[43010,43010],[43014,43014],[43019,43019],[43045,43046],[43204,43205],[43232,43249],[43263,43263],[43302,43309],[43335,43345],[43392,43394],[43443,43443],[43446,43449],[43452,43453],[43493,43493],[43561,43566],[43569,43570],[43573,43574],[43587,43587],[43596,43596],[43644,43644],[43696,43696],[43698,43700],[43703,43704],[43710,43711],[43713,43713],[43756,43757],[43766,43766],[44005,44005],[44008,44008],[44013,44013],[64286,64286],[65024,65039],[65056,65071],[65279,65279],[65529,65531]],f=[[66045,66045],[66272,66272],[66422,66426],[68097,68099],[68101,68102],[68108,68111],[68152,68154],[68159,68159],[68325,68326],[68900,68903],[69446,69456],[69633,69633],[69688,69702],[69759,69761],[69811,69814],[69817,69818],[69821,69821],[69837,69837],[69888,69890],[69927,69931],[69933,69940],[70003,70003],[70016,70017],[70070,70078],[70089,70092],[70191,70193],[70196,70196],[70198,70199],[70206,70206],[70367,70367],[70371,70378],[70400,70401],[70459,70460],[70464,70464],[70502,70508],[70512,70516],[70712,70719],[70722,70724],[70726,70726],[70750,70750],[70835,70840],[70842,70842],[70847,70848],[70850,70851],[71090,71093],[71100,71101],[71103,71104],[71132,71133],[71219,71226],[71229,71229],[71231,71232],[71339,71339],[71341,71341],[71344,71349],[71351,71351],[71453,71455],[71458,71461],[71463,71467],[71727,71735],[71737,71738],[72148,72151],[72154,72155],[72160,72160],[72193,72202],[72243,72248],[72251,72254],[72263,72263],[72273,72278],[72281,72283],[72330,72342],[72344,72345],[72752,72758],[72760,72765],[72767,72767],[72850,72871],[72874,72880],[72882,72883],[72885,72886],[73009,73014],[73018,73018],[73020,73021],[73023,73029],[73031,73031],[73104,73105],[73109,73109],[73111,73111],[73459,73460],[78896,78904],[92912,92916],[92976,92982],[94031,94031],[94095,94098],[113821,113822],[113824,113827],[119143,119145],[119155,119170],[119173,119179],[119210,119213],[119362,119364],[121344,121398],[121403,121452],[121461,121461],[121476,121476],[121499,121503],[121505,121519],[122880,122886],[122888,122904],[122907,122913],[122915,122916],[122918,122922],[123184,123190],[123628,123631],[125136,125142],[125252,125258],[917505,917505],[917536,917631],[917760,917999]],S=[[4352,4447],[8986,8987],[9001,9002],[9193,9196],[9200,9200],[9203,9203],[9725,9726],[9748,9749],[9800,9811],[9855,9855],[9875,9875],[9889,9889],[9898,9899],[9917,9918],[9924,9925],[9934,9934],[9940,9940],[9962,9962],[9970,9971],[9973,9973],[9978,9978],[9981,9981],[9989,9989],[9994,9995],[10024,10024],[10060,10060],[10062,10062],[10067,10069],[10071,10071],[10133,10135],[10160,10160],[10175,10175],[11035,11036],[11088,11088],[11093,11093],[11904,11929],[11931,12019],[12032,12245],[12272,12283],[12288,12329],[12334,12350],[12353,12438],[12443,12543],[12549,12591],[12593,12686],[12688,12730],[12736,12771],[12784,12830],[12832,12871],[12880,19903],[19968,42124],[42128,42182],[43360,43388],[44032,55203],[63744,64255],[65040,65049],[65072,65106],[65108,65126],[65128,65131],[65281,65376],[65504,65510]],d=[[94176,94179],[94208,100343],[100352,101106],[110592,110878],[110928,110930],[110948,110951],[110960,111355],[126980,126980],[127183,127183],[127374,127374],[127377,127386],[127488,127490],[127504,127547],[127552,127560],[127568,127569],[127584,127589],[127744,127776],[127789,127797],[127799,127868],[127870,127891],[127904,127946],[127951,127955],[127968,127984],[127988,127988],[127992,128062],[128064,128064],[128066,128252],[128255,128317],[128331,128334],[128336,128359],[128378,128378],[128405,128406],[128420,128420],[128507,128591],[128640,128709],[128716,128716],[128720,128722],[128725,128725],[128747,128748],[128756,128762],[128992,129003],[129293,129393],[129395,129398],[129402,129442],[129445,129450],[129454,129482],[129485,129535],[129648,129651],[129656,129658],[129664,129666],[129680,129685],[131072,196605],[196608,262141]];let m;function C(w,g){let a,o=0,s=g.length-1;if(w<g[0][0]||w>g[s][1])return!1;for(;s>=o;)if(a=o+s>>1,w>g[a][1])o=a+1;else{if(!(w<g[a][0]))return!0;s=a-1}return!1}l.UnicodeV11=class{constructor(){if(this.version="11",!m){m=new Uint8Array(65536),m.fill(1),m[0]=0,m.fill(0,1,32),m.fill(0,127,160);for(let w=0;w<u.length;++w)m.fill(0,u[w][0],u[w][1]+1);for(let w=0;w<S.length;++w)m.fill(2,S[w][0],S[w][1]+1)}}wcwidth(w){return w<32?0:w<127?1:w<65536?m[w]:C(w,f)?0:C(w,d)?2:1}}}},i={};function n(_){var l=i[_];if(l!==void 0)return l.exports;var u=i[_]={exports:{}};return r[_](u,u.exports,n),u.exports}var h={};return(()=>{var _=h;Object.defineProperty(_,"__esModule",{value:!0}),_.Unicode11Addon=void 0;const l=n(433);_.Unicode11Addon=class{activate(u){u.unicode.register(new l.UnicodeV11)}dispose(){}}})(),h})())})(Yh);var W_=Yh.exports,Qh={exports:{}};(function(e,t){(function(r,i){e.exports=i()})(self,()=>(()=>{var r={6:(_,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.LinkComputer=l.WebLinkProvider=void 0,l.WebLinkProvider=class{constructor(f,S,d,m={}){this._terminal=f,this._regex=S,this._handler=d,this._options=m}provideLinks(f,S){const d=u.computeLink(f,this._regex,this._terminal,this._handler);S(this._addCallbacks(d))}_addCallbacks(f){return f.map(S=>(S.leave=this._options.leave,S.hover=(d,m)=>{if(this._options.hover){const{range:C}=S;this._options.hover(d,m,C)}},S))}};class u{static computeLink(S,d,m,C){const w=new RegExp(d.source,(d.flags||"")+"g"),[g,a]=u._getWindowedLineStrings(S-1,m),o=g.join("");let s;const c=[];for(;s=w.exec(o);){const p=s[0];try{const R=new URL(p),O=decodeURI(R.toString());if(p!==O&&p+"/"!==O)continue}catch{continue}const[v,x]=u._mapStrIdx(m,a,0,s.index),[b,y]=u._mapStrIdx(m,v,x,p.length);if(v===-1||x===-1||b===-1||y===-1)continue;const k={start:{x:x+1,y:v+1},end:{x:y,y:b+1}};c.push({range:k,text:p,activate:C})}return c}static _getWindowedLineStrings(S,d){let m,C=S,w=S,g=0,a="";const o=[];if(m=d.buffer.active.getLine(S)){const s=m.translateToString(!0);if(m.isWrapped&&s[0]!==" "){for(g=0;(m=d.buffer.active.getLine(--C))&&g<2048&&(a=m.translateToString(!0),g+=a.length,o.push(a),m.isWrapped&&a.indexOf(" ")===-1););o.reverse()}for(o.push(s),g=0;(m=d.buffer.active.getLine(++w))&&m.isWrapped&&g<2048&&(a=m.translateToString(!0),g+=a.length,o.push(a),a.indexOf(" ")===-1););}return[o,C]}static _mapStrIdx(S,d,m,C){const w=S.buffer.active,g=w.getNullCell();let a=m;for(;C;){const o=w.getLine(d);if(!o)return[-1,-1];for(let s=a;s<o.length;++s){o.getCell(s,g);const c=g.getChars();if(g.getWidth()&&(C-=c.length||1,s===o.length-1&&c==="")){const p=w.getLine(d+1);p&&p.isWrapped&&(p.getCell(0,g),g.getWidth()===2&&(C+=1))}if(C<0)return[d,s]}d++,a=0}return[d,a]}}l.LinkComputer=u}},i={};function n(_){var l=i[_];if(l!==void 0)return l.exports;var u=i[_]={exports:{}};return r[_](u,u.exports,n),u.exports}var h={};return(()=>{var _=h;Object.defineProperty(_,"__esModule",{value:!0}),_.WebLinksAddon=void 0;const l=n(6),u=/https?:[/]{2}[^\s"'!*(){}|\\\^<>`]*[^\s"':,.!?{}|\\\^~\[\]`()<>]/;function f(S,d){const m=window.open();if(m){try{m.opener=null}catch{}m.location.href=d}else console.warn("Opening link blocked as opener could not be cleared")}_.WebLinksAddon=class{constructor(S=f,d={}){this._handler=S,this._options=d}activate(S){this._terminal=S;const d=this._options,m=d.urlRegex||u;this._linkProvider=this._terminal.registerLinkProvider(new l.WebLinkProvider(this._terminal,m,this._handler,d))}dispose(){var S;(S=this._linkProvider)===null||S===void 0||S.dispose()}}})(),h})())})(Qh);var V_=Qh.exports;const K_="",q_="",Jh="保存しました。",G_="デッキを作成する前にワークスペースを追加してください。",X_="ワークスペースを選択してください。",Y_=2e3,Zh='"JetBrains Mono", monospace',ed=14,Q_='"Cascadia Code", "JetBrains Mono", "Consolas", "Menlo", monospace',J_=13,cc="#000000",uc="#ffffff",td="deck-theme",Z_=204;async function ue(e,t={}){const r=await fetch(`${K_}${e}`,{...t,credentials:"include"});if(!r.ok){const i=await r.text();throw new Error(i||`Request failed (${r.status})`)}return r.status===Z_?null:r.json()}const Ue="application/json",rt="POST",rd="PUT",Zi="DELETE";function ev(){return window.location.origin.replace(/^http/,"ws")}function tv(){return ue("/api/ws-token")}function rv(){return ue("/api/workspaces")}function iv(){return ue("/api/config")}function nv(e){return ue("/api/workspaces",{method:rt,headers:{"Content-Type":Ue},body:JSON.stringify({path:e})})}function sv(e){return ue(`/api/workspaces/${e}`,{method:Zi})}function ov(){return ue("/api/decks")}function lv(e,t){return ue("/api/decks",{method:rt,headers:{"Content-Type":Ue},body:JSON.stringify({name:e,workspaceId:t})})}function av(e){return ue(`/api/decks/${e}`,{method:Zi})}function cv(e){return ue("/api/decks/order",{method:rd,headers:{"Content-Type":Ue},body:JSON.stringify({deckIds:e})})}function hc(e,t=""){const r=new URLSearchParams({workspaceId:e,path:t});return ue(`/api/files?${r.toString()}`)}function dc(e,t=""){const r=new URLSearchParams({path:e,subpath:t});return ue(`/api/preview?${r.toString()}`)}function uv(e,t){const r=new URLSearchParams({workspaceId:e,path:t});return ue(`/api/file?${r.toString()}`)}function hv(e,t,r){return ue("/api/file",{method:rd,headers:{"Content-Type":Ue},body:JSON.stringify({workspaceId:e,path:t,contents:r})})}function dv(e,t,r=""){return ue("/api/file",{method:rt,headers:{"Content-Type":Ue},body:JSON.stringify({workspaceId:e,path:t,contents:r})})}function fv(e,t){const r=new URLSearchParams({workspaceId:e,path:t});return ue(`/api/file?${r.toString()}`,{method:Zi})}function pv(e,t){return ue("/api/dir",{method:rt,headers:{"Content-Type":Ue},body:JSON.stringify({workspaceId:e,path:t})})}function _v(e,t){const r=new URLSearchParams({workspaceId:e,path:t});return ue(`/api/dir?${r.toString()}`,{method:Zi})}function vv(e,t,r){return ue("/api/terminals",{method:rt,headers:{"Content-Type":Ue},body:JSON.stringify({deckId:e,title:t,command:r})})}function mv(e){const t=new URLSearchParams({deckId:e});return ue(`/api/terminals?${t.toString()}`)}function gv(e){return ue(`/api/terminals/${e}`,{method:Zi})}function id(e,t){const r={workspaceId:e};t!==void 0&&(r.repoPath=t);const i=new URLSearchParams(r);return ue(`/api/git/status?${i.toString()}`)}function yv(e){const t=new URLSearchParams({workspaceId:e});return ue(`/api/git/repos?${t.toString()}`)}function nd(e,t,r){return ue("/api/git/stage",{method:rt,headers:{"Content-Type":Ue},body:JSON.stringify({workspaceId:e,paths:t,repoPath:r})})}function sd(e,t,r){return ue("/api/git/unstage",{method:rt,headers:{"Content-Type":Ue},body:JSON.stringify({workspaceId:e,paths:t,repoPath:r})})}function Sv(e,t,r){return ue("/api/git/commit",{method:rt,headers:{"Content-Type":Ue},body:JSON.stringify({workspaceId:e,message:t,repoPath:r})})}function Cv(e,t,r){return ue("/api/git/discard",{method:rt,headers:{"Content-Type":Ue},body:JSON.stringify({workspaceId:e,paths:t,repoPath:r})})}function wv(e,t,r,i){const n={workspaceId:e,path:t,staged:r.toString()};i!==void 0&&(n.repoPath=i);const h=new URLSearchParams(n);return ue(`/api/git/diff?${h.toString()}`)}function xv(e,t){return ue("/api/git/push",{method:rt,headers:{"Content-Type":Ue},body:JSON.stringify({workspaceId:e,repoPath:t})})}function bv(e,t){return ue("/api/git/pull",{method:rt,headers:{"Content-Type":Ue},body:JSON.stringify({workspaceId:e,repoPath:t})})}function Ev(e,t){return ue("/api/git/fetch",{method:rt,headers:{"Content-Type":Ue},body:JSON.stringify({workspaceId:e,repoPath:t})})}function od(e,t){const r={workspaceId:e};t!==void 0&&(r.repoPath=t);const i=new URLSearchParams(r);return ue(`/api/git/branch-status?${i.toString()}`)}function ld(e,t){const r={workspaceId:e};t!==void 0&&(r.repoPath=t);const i=new URLSearchParams(r);return ue(`/api/git/remotes?${i.toString()}`)}function kv(e,t){const r={workspaceId:e};t!==void 0&&(r.repoPath=t);const i=new URLSearchParams(r);return ue(`/api/git/branches?${i.toString()}`)}function Lv(e,t,r){return ue("/api/git/checkout",{method:rt,headers:{"Content-Type":Ue},body:JSON.stringify({workspaceId:e,branchName:t,repoPath:r})})}function Dv(e,t,r=!0,i){return ue("/api/git/create-branch",{method:rt,headers:{"Content-Type":Ue},body:JSON.stringify({workspaceId:e,branchName:t,checkout:r,repoPath:i})})}function Rv(e,t=50,r){const i={workspaceId:e,limit:String(t)};r!==void 0&&(i.repoPath=r);const n=new URLSearchParams(i);return ue(`/api/git/log?${n.toString()}`)}const Tv="接続が終了しました。",fc=5,pc=1e3,Av=new Set(["Deck deleted","Terminal deleted","Terminal exited","Terminal not found"]),_c=new TextEncoder;function Pv(e){const t=new Uint8Array(e.length);for(let r=0;r<e.length;r++)t[r]=e.charCodeAt(r)&255;return t}function Mv({session:e,wsUrl:t,onDelete:r,onExit:i}){const n=N.useRef(null),h=N.useRef(null),_=N.useRef(null),l=N.useRef(0),u=N.useRef(i);return N.useEffect(()=>{u.current=i},[i]),N.useEffect(()=>{var Xe,Ut;if(!n.current)return;l.current=0,n.current.innerHTML="";const f=new $_.Terminal({cursorBlink:!0,fontFamily:Q_,fontSize:J_,allowProposedApi:!0,scrollback:3e3,convertEol:!1,windowsMode:!1,rightClickSelectsWord:!0,theme:{background:cc,foreground:uc},windowOptions:{getWinSizePixels:!0,getCellSizePixels:!0,getWinSizeChars:!0}}),S=new U_.FitAddon,d=new W_.Unicode11Addon,m=new V_.WebLinksAddon;f.loadAddon(S),f.loadAddon(d),f.loadAddon(m),f.unicode.activeVersion="11",h.current=S,f.open(n.current);let C=!0,w=!1,g=0,a=!1;const o=()=>{C=!1,a&&(a=!1,E(!0)),window.requestAnimationFrame(()=>{f.scrollToBottom()})},s=Q=>{const Y=_.current;Y&&Y.readyState===WebSocket.OPEN&&Y.send(JSON.stringify(Q))},c=Q=>{if(C)return;const Y=_.current;Y&&Y.readyState===WebSocket.OPEN&&Y.send(_c.encode(Q))};f.parser.registerCsiHandler({final:"n"},Q=>{const Y=Q.length>0?Q[0]:0;if(Y===6){const te=f.buffer.active,ie=te.cursorY+te.baseY+1,oe=te.cursorX+1;return c(`\x1B[${ie};${oe}R`),!0}else if(Y===5)return c("\x1B[0n"),!0;return!1}),f.parser.registerCsiHandler({final:"c"},Q=>(c("\x1B[?62;1;6;22c"),!0)),f.parser.registerCsiHandler({prefix:">",final:"c"},Q=>(c("\x1B[>1;500;0c"),!0)),f.parser.registerCsiHandler({prefix:"?",final:"p",intermediates:"$"},Q=>{const Y=Q[0]||0,te=f.modes;let ie=0;return Y===1?ie=te.applicationCursorKeysMode?1:2:Y===25?ie=1:Y===1e3?ie=te.mouseTrackingMode==="x10"?1:2:Y===1002?ie=te.mouseTrackingMode==="drag"?1:2:Y===1003?ie=te.mouseTrackingMode==="any"?1:2:Y===1004?ie=te.sendFocusMode?1:2:Y===1006?ie=te.mouseTrackingMode!=="none"?1:2:Y===1049?ie=f.buffer.active.type==="alternate"?1:2:Y===2004?ie=te.bracketedPasteMode?1:2:Y===2026&&(ie=2),c(`\x1B[?${Y};${ie}$y`),!0});const p=Q=>(Q*257).toString(16).padStart(4,"0");f.parser.registerOscHandler(10,Q=>{if(Q==="?"){const Y=uc,te=parseInt(Y.slice(1,3),16),ie=parseInt(Y.slice(3,5),16),oe=parseInt(Y.slice(5,7),16);return c(`\x1B]10;rgb:${p(te)}/${p(ie)}/${p(oe)}\x07`),!0}return!1}),f.parser.registerOscHandler(11,Q=>{if(Q==="?"){const Y=cc,te=parseInt(Y.slice(1,3),16),ie=parseInt(Y.slice(3,5),16),oe=parseInt(Y.slice(5,7),16);return c(`\x1B]11;rgb:${p(te)}/${p(ie)}/${p(oe)}\x07`),!0}return!1}),f.parser.registerOscHandler(12,Q=>Q==="?"?(c("\x1B]12;rgb:ffff/ffff/ffff\x07"),!0):!1),f.parser.registerOscHandler(4,Q=>{const Y=Q.match(/^(\d+);?\?$/);if(Y){const te=parseInt(Y[1]),ie=["0000/0000/0000","cdcb/0000/0000","0000/cdcb/0000","cdcb/cdcb/0000","1e1e/9090/ffff","cdcb/0000/cdcb","0000/cdcb/cdcb","e5e5/e5e5/e5e5"],oe=te<8?ie[te]:"0000/0000/0000";return c(`\x1B]4;${te};rgb:${oe}\x07`),!0}return!1}),f.parser.registerOscHandler(52,Q=>!!Q.includes("?")),f.parser.registerCsiHandler({prefix:">",final:"q"},Q=>(c("\x1BP>|xterm.js(5.0.0)\x1B\\"),!0)),f.parser.registerCsiHandler({prefix:"?",final:"u"},Q=>!0),f.parser.registerCsiHandler({prefix:"?",final:"m"},Q=>Q[0]===4?(c("\x1B[>4;0m"),!0):!1),f.parser.registerCsiHandler({final:"t"},Q=>{const Y=Q[0];return Y===19?(c(`\x1B[9;${f.rows};${f.cols}t`),!0):Y===20?(c("\x1B]LTerminal\x1B\\"),!0):Y===21?(c("\x1B]lTerminal\x1B\\"),!0):!1}),f.parser.registerCsiHandler({prefix:"?",final:"S"},Q=>!0),f.parser.registerDcsHandler({intermediates:"$",final:"q"},(Q,Y)=>Q==="m"?(c("\x1BP1$rm\x1B\\"),!0):Q==='"p'?(c('\x1BP1$r62;1"p\x1B\\'),!0):Q==="r"?(c(`\x1BP1$r1;${f.rows}r\x1B\\`),!0):(c("\x1BP0$r\x1B\\"),!0)),f.parser.registerDcsHandler({intermediates:"+",final:"q"},(Q,Y)=>{try{const ie=(Q.match(/.{2}/g)||[]).map(ce=>String.fromCharCode(parseInt(ce,16))).join(""),oe={TN:"xterm-256color",Co:"256",RGB:"",Tc:"",colors:"256",setrgbf:"\x1B[38;2;%p1%d;%p2%d;%p3%dm",setrgbb:"\x1B[48;2;%p1%d;%p2%d;%p3%dm"};if(ie in oe){const Be=oe[ie].split("").map(me=>me.charCodeAt(0).toString(16).padStart(2,"0")).join("");return c(`\x1BP1+r${Be}\x1B\\`),!0}}catch(te){console.error("[XTGETTCAP] Failed to decode:",te)}return c("\x1BP0+r\x1B\\"),!0}),f.parser.registerCsiHandler({final:"b"},Q=>{const Y=Q[0]||1;return Y>65535?(console.warn(`[REP] Large repeat count ${Y} clamped to 65535 for security`),!0):!1});let v=0,x=0,b=null,y=f.cols,k=f.rows,R=0,O=0,T=((Xe=window.visualViewport)==null?void 0:Xe.scale)??1;const B=(Q,Y)=>{f.cols>0&&(R=Q/f.cols),f.rows>0&&(O=Y/f.rows)},z=n.current.querySelector(".xterm-helper-textarea");z instanceof HTMLTextAreaElement&&(z.setAttribute("spellcheck","false"),z.setAttribute("autocapitalize","off"),z.setAttribute("autocomplete","off"),z.setAttribute("autocorrect","off"));const I=()=>{const Q=f.cols,Y=f.rows;!Q||!Y||Q===y&&Y===k||(y=Q,k=Y,s({type:"resize",cols:Q,rows:Y}))},j=()=>{s({type:"claim"})},$=(Q=!1)=>{var ce;if(a)return;const Y=n.current;if(!Y)return;const te=Y.clientWidth,ie=Y.clientHeight;if(!te||!ie||!Q&&te===v&&ie===x)return;const oe=((ce=window.visualViewport)==null?void 0:ce.scale)??1;if(!Q&&R>0&&O>0){const Be=Math.max(2,Math.floor(te/R)),me=Math.max(1,Math.floor(ie/O)),Tt=Math.abs(te-v),We=Math.abs(ie-x),At=Math.max(R*.75,2),pe=Math.max(O*.75,2),ni=Math.abs(oe-T)>.001;if(Be===y&&me===k){v=te,x=ie,T=oe;return}if(ni&&Tt<At&&We<pe){v=te,x=ie,T=oe;return}}v=te,x=ie,S.fit(),B(te,ie),T=oe,I()},E=(Q=!1)=>{if(b!==null){if(!Q)return;cancelAnimationFrame(b)}b=window.requestAnimationFrame(()=>{b=null,$(Q)})},A=new ResizeObserver(()=>{E()});A.observe(n.current),E();const P=typeof document<"u"?document.fonts:null,M=()=>{D||E(!0)};P==null||P.ready.then(M).catch(()=>{}),(Ut=P==null?void 0:P.addEventListener)==null||Ut.call(P,"loadingdone",M);let H=null,K=null,X=null,q=null,se=null,D=!1,F=0,W=null,U=!1,re=!1;const J=n.current.closest(".terminal-pane"),ae=Q=>{J instanceof HTMLElement&&(Q?J.dataset.terminalFocus="true":delete J.dataset.terminalFocus)},we=()=>{var Y;const Q=(Y=n.current)==null?void 0:Y.querySelector(".xterm-helper-textarea");if(Q instanceof HTMLTextAreaElement)try{Q.focus({preventScroll:!0})}catch{Q.focus()}},fe=()=>{D||we()},ut=()=>{D||(ae(!0),we())},ne=()=>{window.setTimeout(()=>{if(D)return;const Q=n.current;Q&&(Q.contains(document.activeElement)||ae(!1))},0)};n.current.addEventListener("pointerdown",fe,{passive:!0,capture:!0}),n.current.addEventListener("mousedown",fe,{passive:!0,capture:!0}),n.current.addEventListener("touchstart",fe,{passive:!0,capture:!0}),n.current.addEventListener("focusin",ut,!0),n.current.addEventListener("focusout",ne,!0),se=()=>{var Q,Y,te,ie,oe;(Q=n.current)==null||Q.removeEventListener("pointerdown",fe,!0),(Y=n.current)==null||Y.removeEventListener("mousedown",fe,!0),(te=n.current)==null||te.removeEventListener("touchstart",fe,!0),(ie=n.current)==null||ie.removeEventListener("focusin",ut,!0),(oe=n.current)==null||oe.removeEventListener("focusout",ne,!0)};const ht=async(Q=!1)=>{if(!D){C=!0,w=!1,g=0;try{const{token:Y,authEnabled:te}=await tv();if(D)return;const ie=te?`${t}?token=${Y}`:t;let oe=ie;if(Q&&l.current>0){const ce=ie.includes("?")?"&":"?";oe=`${ie}${ce}bufferOffset=${l.current}`}if(Q){const ce=oe.includes("?")?"&":"?";oe=`${oe}${ce}reconnect=1`}if(H=new WebSocket(oe),H.binaryType="arraybuffer",_.current=H,H.addEventListener("open",()=>{var ce;F=0,re=!0,v=0,x=0,R=0,O=0,y=-1,k=-1,T=((ce=window.visualViewport)==null?void 0:ce.scale)??1,E()}),H.addEventListener("message",ce=>{if(typeof ce.data=="string"){let me=null;try{me=JSON.parse(ce.data)}catch{return}if((me==null?void 0:me.type)==="sync"){C=!0,w=!1,g=0,a=!1,l.current=me.offsetBase,me.reset&&(f.reset(),$(!0),a=!0);return}if((me==null?void 0:me.type)==="ready"){w=!0,g===0&&o();return}return}if(ce.data instanceof Blob){ce.data.arrayBuffer().then(Tt=>{if(D)return;const We=new Uint8Array(Tt);g++,f.write(We,()=>{l.current+=We.byteLength,g=Math.max(0,g-1),w&&g===0&&o()})});return}const Be=new Uint8Array(ce.data);g++,f.write(Be,()=>{l.current+=Be.byteLength,g=Math.max(0,g-1),w&&g===0&&o()})}),H.addEventListener("close",ce=>{if(!(D||U)){if(ce.code===1e3&&Av.has(ce.reason)){u.current();return}if(F<fc){F++;const Be=pc*Math.pow(2,F-1);W=setTimeout(()=>ht(!0),Be)}else f.write(`\r
49
49
  \x1B[31m${Tv}\x1B[0m\r
50
- `)}}),H.addEventListener("error",()=>{}),K&&K.dispose(),K=f.onData(ce=>{H&&H.readyState===WebSocket.OPEN&&(j(),H.send(_c.encode(ce)))}),X&&X.dispose(),X=f.onBinary(ce=>{H&&H.readyState===WebSocket.OPEN&&(j(),H.send(Pv(ce)))}),!q&&f.textarea){const ce=()=>{j()};f.textarea.addEventListener("focus",ce),q=()=>{var Be;(Be=f.textarea)==null||Be.removeEventListener("focus",ce)}}}catch(Y){if(console.error("[Terminal] Failed to connect:",Y),F<fc&&re){F++;const te=pc*Math.pow(2,F-1);W=setTimeout(()=>ht(!0),te)}else f.write(`\r
50
+ `)}}),H.addEventListener("error",()=>{}),K&&K.dispose(),K=f.onData(ce=>{C||H&&H.readyState===WebSocket.OPEN&&(j(),H.send(_c.encode(ce)))}),X&&X.dispose(),X=f.onBinary(ce=>{C||H&&H.readyState===WebSocket.OPEN&&(j(),H.send(Pv(ce)))}),!q&&f.textarea){const ce=()=>{j()};f.textarea.addEventListener("focus",ce),q=()=>{var Be;(Be=f.textarea)==null||Be.removeEventListener("focus",ce)}}}catch(Y){if(console.error("[Terminal] Failed to connect:",Y),F<fc&&re){F++;const te=pc*Math.pow(2,F-1);W=setTimeout(()=>ht(!0),te)}else f.write(`\r
51
51
  \x1B[31m接続エラー: ${Y instanceof Error?Y.message:"Unknown error"}\x1B[0m\r
52
52
  `)}}};return ht(),()=>{var Q;D=!0,U=!0,W&&clearTimeout(W),b!==null&&cancelAnimationFrame(b),A.disconnect(),(Q=P==null?void 0:P.removeEventListener)==null||Q.call(P,"loadingdone",M),K&&K.dispose(),X&&X.dispose(),q&&q(),se&&se(),ae(!1),H&&H.close(),_.current=null,h.current=null,f.dispose()}},[e.id,t]),L.jsxs("div",{className:"terminal-tile",children:[L.jsxs("div",{className:"terminal-tile-header",children:[L.jsx("span",{children:e.title}),L.jsx("button",{type:"button",className:"terminal-close-btn",onClick:()=>{window.confirm("このターミナルを閉じますか?")&&r()},"aria-label":"ターミナルを閉じる",children:"×"})]}),L.jsx("div",{className:"terminal-tile-body",ref:n})]})}function Bv(e){if(e<=1)return{cols:1,rows:1};const t=Math.ceil(Math.sqrt(e)),r=Math.ceil(e/t);return{cols:t,rows:r}}function Ov({terminals:e,wsBase:t,onDeleteTerminal:r,onExitTerminal:i}){const{cols:n,rows:h}=Bv(e.length);return L.jsx("section",{className:"terminal-pane",children:e.length===0?L.jsx("div",{className:"terminal-empty",children:L.jsx("span",{className:"terminal-empty-text",children:"ターミナルを追加"})}):L.jsx("div",{className:"terminal-grid",style:{gridTemplateColumns:`repeat(${n}, minmax(0, 1fr))`,gridTemplateRows:`repeat(${h}, minmax(0, 1fr))`},children:e.map(_=>L.jsx(Mv,{session:_,wsUrl:`${t}/api/terminals/${_.id}`,onDelete:()=>r(_.id),onExit:()=>i(_.id)},_.id))})})}const Nv="ワークスペースがありません。";function jv({workspaces:e,selectedWorkspaceId:t,onSelect:r,onDelete:i}){return L.jsx("div",{className:"w-full grid gap-2",children:e.length===0?L.jsx("div",{className:"flex items-center justify-center text-muted text-[13px] p-8",children:Nv}):e.map(n=>L.jsxs("div",{className:tt("flex items-center gap-2 p-4 border border-border rounded bg-panel transition-colors hover:bg-list-hover",n.id===t&&"bg-list-active border-accent"),children:[L.jsxs("button",{type:"button",className:"flex-1 min-w-0 text-left bg-transparent border-0 p-0 cursor-pointer",onClick:()=>r(n.id),children:[L.jsx("div",{className:"font-semibold text-[15px] mb-1",children:n.name}),L.jsx("div",{className:"text-[12px] text-muted font-mono truncate",children:n.path})]}),L.jsx("button",{type:"button",className:"flex-shrink-0 w-7 h-7 flex items-center justify-center rounded bg-transparent border-0 text-muted cursor-pointer hover:bg-[rgba(0,0,0,0.08)] hover:text-ink transition-colors dark:hover:bg-[rgba(255,255,255,0.08)]",title:"\\u524a\\u9664",onClick:h=>{h.stopPropagation(),confirm(`「${n.name}」を削除しますか?`)&&i(n.id)},children:L.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[L.jsx("polyline",{points:"3 6 5 6 21 6"}),L.jsx("path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"})]})})]},n.id))})}function Iv({contextMenu:e,onNewFile:t,onNewFolder:r,onDelete:i}){var n;return L.jsxs("div",{className:"fixed z-[1000] min-w-[160px] py-1 bg-panel border border-border rounded-[6px] shadow-[0_4px_12px_rgba(0,0,0,0.15)]",style:{left:e.x,top:e.y},onClick:h=>h.stopPropagation(),children:[(e.isRoot||((n=e.node)==null?void 0:n.type)==="dir")&&L.jsxs(L.Fragment,{children:[L.jsx("button",{type:"button",className:"block w-full px-3 py-1.5 text-[13px] text-left bg-transparent border-0 text-ink cursor-pointer hover:bg-list-hover",onClick:()=>{var h;return t(((h=e.node)==null?void 0:h.path)||"",e.node?1:0)},children:"新規ファイル"}),L.jsx("button",{type:"button",className:"block w-full px-3 py-1.5 text-[13px] text-left bg-transparent border-0 text-ink cursor-pointer hover:bg-list-hover",onClick:()=>{var h;return r(((h=e.node)==null?void 0:h.path)||"",e.node?1:0)},children:"新規フォルダ"})]}),e.node&&!e.isRoot&&L.jsxs(L.Fragment,{children:[e.node.type==="dir"&&L.jsx("div",{className:"h-px my-1 bg-border"}),L.jsx("button",{type:"button",className:"block w-full px-3 py-1.5 text-[13px] text-left bg-transparent border-0 text-[#f14c4c] cursor-pointer hover:bg-[rgba(241,76,76,0.1)]",onClick:()=>i(e.node),children:"削除"})]})]})}const vc="読み込み中...",Fv="ファイル",Hv="更新",zv="ファイルが見つかりません。",$v="戻る";function Uv(e,t){if(!t)return"";const r=t.find(i=>i.path===e||e.endsWith(i.path));return r?`git-tree-${r.status}`:""}const Wv=()=>L.jsx("svg",{viewBox:"0 0 24 24","aria-hidden":"true",className:"tree-chevron-icon",children:L.jsx("path",{d:"M9 6l6 6-6 6",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round"})}),mc=()=>L.jsx("svg",{viewBox:"0 0 24 24","aria-hidden":"true",className:"tree-svg",children:L.jsx("path",{d:"M3.5 7.5h6l2 2h9a1 1 0 0 1 1 1V18a2 2 0 0 1-2 2H5.5a2 2 0 0 1-2-2V7.5z",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinejoin:"round"})}),gc=()=>L.jsxs("svg",{viewBox:"0 0 24 24","aria-hidden":"true",className:"tree-svg",children:[L.jsx("path",{d:"M6 3.5h8l4 4V20a1.5 1.5 0 0 1-1.5 1.5H6A1.5 1.5 0 0 1 4.5 20V5A1.5 1.5 0 0 1 6 3.5z",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinejoin:"round"}),L.jsx("path",{d:"M14 3.5V8h4",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinejoin:"round"})]});function ad({root:e,entries:t=[],loading:r,error:i,mode:n="tree",canBack:h,onBack:_,onToggleDir:l,onOpenFile:u,onRefresh:f,onCreateFile:S,onCreateDirectory:d,onDeleteFile:m,onDeleteDirectory:C,gitFiles:w}){const[g,a]=N.useState(null),[o,s]=N.useState(null),[c,p]=N.useState(""),v=N.useRef(null),x=N.useRef(null),b=t??[];N.useEffect(()=>{const j=()=>a(null);if(g)return document.addEventListener("click",j),()=>document.removeEventListener("click",j)},[g]),N.useEffect(()=>{o&&v.current&&v.current.focus()},[o]);const y=N.useCallback((j,$,E=!1)=>{j.preventDefault(),j.stopPropagation();const A=180,P=150,M=Math.min(j.clientX,window.innerWidth-A-4),H=Math.min(j.clientY,window.innerHeight-P-4);a({x:M,y:H,node:$,isRoot:E})},[]),k=N.useCallback((j,$)=>{a(null),s({parentPath:j,type:"file",depth:$}),p("")},[]),R=N.useCallback((j,$)=>{a(null),s({parentPath:j,type:"dir",depth:$}),p("")},[]),O=N.useCallback(j=>{a(null),j.type==="dir"?window.confirm(`フォルダ "${j.name}" を削除しますか?
53
53
  中のファイルも全て削除されます。`)&&(C==null||C(j.path)):window.confirm(`ファイル "${j.name}" を削除しますか?`)&&(m==null||m(j.path))},[m,C]),T=N.useCallback(()=>{if(!o||!c.trim()){s(null);return}const j=c.trim();o.type==="file"?S==null||S(o.parentPath,j):d==null||d(o.parentPath,j),s(null),p("")},[o,c,S,d]),B=N.useCallback(j=>{j.key==="Enter"?T():j.key==="Escape"&&s(null)},[T]),z=j=>!o||o.depth!==j?null:L.jsxs("div",{className:"tree-row tree-input-row",style:{paddingLeft:12+j*16},children:[L.jsx("span",{className:"tree-icon","aria-hidden":"true",children:o.type==="dir"?L.jsx(mc,{}):L.jsx(gc,{})}),L.jsx("input",{ref:v,type:"text",className:"tree-input",value:c,onChange:$=>p($.target.value),onKeyDown:B,onBlur:T,placeholder:o.type==="dir"?"フォルダ名":"ファイル名"})]}),I=(j,$)=>j.map(E=>{const A=E.type==="file"?Uv(E.path,w):"";return L.jsxs("div",{children:[L.jsxs("button",{type:"button",className:tt("tree-row",E.type==="dir"&&"is-dir",n==="tree"&&E.expanded&&"is-open",A),style:{paddingLeft:12+$*16},onClick:()=>E.type==="dir"?l(E):u(E),onContextMenu:P=>y(P,E),"aria-expanded":E.type==="dir"&&n==="tree"?E.expanded:void 0,title:E.path,children:[L.jsx("span",{className:"tree-chevron","aria-hidden":"true",children:E.type==="dir"?L.jsx(Wv,{}):null}),L.jsx("span",{className:`tree-icon ${E.type}`,"aria-hidden":"true",children:E.type==="dir"?L.jsx(mc,{}):L.jsx(gc,{})}),L.jsx("span",{className:"tree-label",children:E.name}),E.loading?L.jsx("span",{className:"tree-meta",children:vc}):null]}),n==="tree"&&E.expanded&&E.type==="dir"&&L.jsxs(L.Fragment,{children:[(o==null?void 0:o.parentPath)===E.path&&z($+1),E.children&&E.children.length>0&&I(E.children,$+1)]})]},E.path)});return L.jsxs("section",{className:"panel file-tree",ref:x,children:[L.jsxs("div",{className:"panel-header",children:[L.jsxs("div",{children:[L.jsx("div",{className:"panel-title",children:Fv}),L.jsx("div",{className:"panel-subtitle",children:e})]}),L.jsxs("div",{className:"tree-actions",children:[_?L.jsx("button",{type:"button",className:"border border-border bg-transparent text-ink px-2.5 py-1 text-xs rounded-[2px] cursor-pointer hover:bg-list-hover disabled:opacity-50 disabled:cursor-not-allowed",onClick:_,disabled:h===!1,children:$v}):null,L.jsx("button",{type:"button",className:"border border-border bg-transparent text-ink px-2.5 py-1 text-xs rounded-[2px] cursor-pointer hover:bg-list-hover disabled:opacity-50 disabled:cursor-not-allowed",onClick:f,children:Hv})]})]}),L.jsxs("div",{className:"panel-body tree-body",onContextMenu:j=>y(j,null,!0),children:[r?L.jsx("div",{className:"tree-state",children:vc}):null,i?L.jsx("div",{className:"tree-state text-[#f14c4c]",children:i}):null,b.length===0&&!r?L.jsx("div",{className:"tree-state",children:zv}):null,(o==null?void 0:o.parentPath)===""&&z(0),I(b,0)]}),g&&L.jsx(Iv,{contextMenu:g,onNewFile:k,onNewFolder:R,onDelete:O})]})}function ss(){return{files:[],activeFileId:null,tree:[],treeLoading:!1,treeError:null}}function os(){return{terminals:[]}}function Vv(e){const t=e.lastIndexOf(".");return t===-1||t===0?"":e.slice(t+1).toLowerCase()}function Kv(e){const t=Vv(e);return{js:"javascript",jsx:"javascript",ts:"typescript",tsx:"typescript",json:"json",html:"html",css:"css",scss:"scss",sass:"sass",less:"less",md:"markdown",py:"python",rb:"ruby",go:"go",rs:"rust",java:"java",c:"c",cpp:"cpp",cc:"cpp",cxx:"cpp",h:"c",hpp:"cpp",sh:"shell",bash:"shell",zsh:"shell",fish:"shell",xml:"xml",yaml:"yaml",yml:"yaml",toml:"toml",sql:"sql",graphql:"graphql",vue:"vue",svelte:"svelte",php:"php",r:"r",swift:"swift",kt:"kotlin",dart:"dart",lua:"lua",dockerfile:"dockerfile"}[t]||"plaintext"}function Pe(e){return e instanceof Error?e.message:String(e)}function ls(e){return e.map(t=>({...t,expanded:!1,loading:!1,children:t.type==="dir"?[]:void 0}))}function cd(e){return Kv(e)}function tl(e,t,r){return t?e.map(i=>{if(i.path===t&&i.type==="dir"){const h=[...i.children||[],r].sort((_,l)=>_.type!==l.type?_.type==="dir"?-1:1:_.name.localeCompare(l.name));return{...i,children:h,expanded:!0}}return i.children?{...i,children:tl(i.children,t,r)}:i}):[...e,r].sort((n,h)=>n.type!==h.type?n.type==="dir"?-1:1:n.name.localeCompare(h.name))}function rl(e,t){return e.filter(r=>r.path===t?!1:(r.children&&(r.children=rl(r.children,t)),!0))}function Dr(e,t,r){return e.map(i=>i.path===t?r(i):i.children?{...i,children:Dr(i.children,t,r)}:i)}function yc(e){return e.trim().replace(/[\\/]+$/,"").replace(/\\/g,"/").toLowerCase()}function qv(e){return e.includes("\\")?"\\":"/"}function Gv(e,t){const r=qv(e),i=e.replace(/[\\/]+$/,"");return i?`${i}${r}${t}`:t}function Sc(e){const t=e.replace(/[\\/]+$/,"");if(!t)return e;if(/^[A-Za-z]:$/.test(t))return`${t}\\`;if(t==="/")return"/";const r=Math.max(t.lastIndexOf("/"),t.lastIndexOf("\\"));if(t.startsWith("/")&&r===0)return"/";if(r<=0)return t;const i=t.slice(0,r);return/^[A-Za-z]:$/.test(i)?`${i}\\`:i}function ud(){if(typeof window>"u")return{view:"terminal",workspaceId:null,deckIds:[],workspaceMode:"list"};const e=new URLSearchParams(window.location.search),t=e.get("view"),r=e.get("mode"),i=e.get("decks")||e.get("deck"),n=i?i.split(",").filter(Boolean):[];return{view:t==="workspace"?"workspace":"terminal",workspaceId:e.get("workspace"),deckIds:n,workspaceMode:r==="editor"?"editor":"list"}}function Xv(){if(typeof window>"u")return"light";const e=window.localStorage.getItem(td);return e==="light"||e==="dark"?e:window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}function Ne(e,t=1e4){return Promise.race([e,new Promise((r,i)=>setTimeout(()=>i(new Error("Request timeout")),t))])}const Yv=({isOpen:e,defaultRoot:t,onSubmit:r,onClose:i})=>{const[n,h]=N.useState(""),[_,l]=N.useState([]),[u,f]=N.useState(!1),[S,d]=N.useState(null),[m,C]=N.useState(!1),w=Kh(e,i),g=n.trim()||t,a=N.useMemo(()=>g?Sc(g)!==g:!1,[g]);N.useEffect(()=>{if(!e){l([]),f(!1),d(null);return}let v=!0;return f(!0),d(null),dc(g,"").then(x=>{v&&(l(ls(x)),f(!1))}).catch(x=>{v&&(d(Pe(x)),f(!1))}),()=>{v=!1}},[e,g]),N.useEffect(()=>{e&&(n.trim()||t&&h(t))},[t,e,n]);const o=()=>{e&&(f(!0),d(null),dc(g,"").then(v=>{l(ls(v)),f(!1)}).catch(v=>{d(Pe(v)),f(!1)}))},s=v=>{if(v.type!=="dir")return;const x=Gv(g,v.name);h(x)},c=()=>{if(!g)return;const v=Sc(g);v&&v!==g&&h(v)},p=async v=>{if(v.preventDefault(),!m){C(!0);try{await r(n),h("")}finally{C(!1)}}};return e?L.jsx("div",{className:"fixed inset-0 bg-black/50 grid place-items-center z-[500]",role:"dialog","aria-modal":"true","aria-labelledby":"workspace-modal-title",children:L.jsxs("form",{className:"modal flex flex-col !overflow-hidden",ref:w,onSubmit:p,children:[L.jsx("div",{className:"text-[14px] font-semibold mb-3 shrink-0",id:"workspace-modal-title",children:"ワークスペース追加"}),L.jsxs("label",{className:"grid gap-1 text-xs shrink-0",children:[L.jsx("span",{children:"パス"}),L.jsx("input",{type:"text",className:"bg-panel border border-border rounded-[2px] px-2 py-1.5 text-[13px] font-mono text-ink focus:outline-none focus:border-focus",value:n,placeholder:t||"",required:!0,maxLength:500,onChange:v=>h(v.target.value)})]}),L.jsx("div",{className:"flex-1 min-h-0 mt-3",children:L.jsx(ad,{root:g,entries:_,loading:u,error:S,mode:"navigator",canBack:a,onBack:c,onToggleDir:s,onOpenFile:()=>{},onRefresh:o})}),L.jsxs("div",{className:"flex justify-end gap-2 mt-4 shrink-0",children:[L.jsx("button",{type:"button",className:"bg-transparent text-ink border-0 px-2 py-1 text-xs rounded-[2px] cursor-pointer hover:bg-list-hover",onClick:i,disabled:m,children:"キャンセル"}),L.jsx("button",{type:"submit",className:"bg-accent text-white border-0 px-3.5 py-1.5 text-[13px] font-medium rounded-[2px] cursor-pointer hover:opacity-90 disabled:opacity-50 disabled:cursor-not-allowed",disabled:m,children:m?"追加中...":"追加"})]})]})}):null},Qv="ステージ",Jv="アンステージ",Zv="変更を破棄",em="差分を表示",tm={modified:"M",staged:"A",untracked:"U",deleted:"D",renamed:"R",conflicted:"C"};function Cc({file:e,onStage:t,onUnstage:r,onDiscard:i,onShowDiff:n}){const h=`git-${e.status}`,_=tm[e.status];return L.jsxs("div",{className:"git-file-row",children:[L.jsxs("button",{type:"button",className:"git-file-main",onClick:()=>n(e),title:em,children:[L.jsx("span",{className:`git-status-badge ${h}`,children:_}),L.jsx("span",{className:"git-file-path",children:e.path})]}),L.jsx("div",{className:"git-file-actions",children:e.staged?L.jsx("button",{type:"button",className:"git-action-btn",onClick:()=>r(e.path),title:Jv,children:L.jsx("svg",{viewBox:"0 0 24 24","aria-hidden":"true",children:L.jsx("path",{d:"M19 13H5v-2h14v2z"})})}):L.jsxs(L.Fragment,{children:[L.jsx("button",{type:"button",className:"git-action-btn",onClick:()=>i(e.path),title:Zv,children:L.jsx("svg",{viewBox:"0 0 24 24","aria-hidden":"true",children:L.jsx("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"})})}),L.jsx("button",{type:"button",className:"git-action-btn",onClick:()=>t(e.path),title:Qv,children:L.jsx("svg",{viewBox:"0 0 24 24","aria-hidden":"true",children:L.jsx("path",{d:"M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"})})})]})})]})}const rm="ステージ済みの変更",im="変更",nm="コミット",sm="コミットメッセージを入力...",om="変更はありません",lm="すべてステージ",am="すべてアンステージ",wc="Push",xc="Pull",cm="Pushing...",um="Pulling...";function hm({status:e,branchStatus:t,hasRemote:r,pushing:i,pulling:n,commitMessage:h,onCommitMessageChange:_,onCommit:l,onStageFile:u,onUnstageFile:f,onStageAll:S,onUnstageAll:d,onDiscardFile:m,onShowDiff:C,onPush:w,onPull:g}){const a=e.files.filter(v=>v.staged),o=e.files.filter(v=>!v.staged),s=e.files.length>0,c=a.length>0,p=N.useCallback(v=>{v.key==="Enter"&&(v.ctrlKey||v.metaKey)&&(v.preventDefault(),l())},[l]);return L.jsxs(L.Fragment,{children:[L.jsxs("div",{className:"flex flex-col gap-2 px-3",children:[L.jsx("textarea",{className:"border border-border rounded-[2px] p-2 text-[13px] font-[inherit] bg-panel text-ink resize-y min-h-[50px] focus:outline-none focus:border-focus",placeholder:sm,value:h,onChange:v=>_(v.target.value),onKeyDown:p,rows:3}),L.jsx("button",{type:"button",className:"bg-accent text-white border-0 px-3.5 py-1.5 text-[13px] font-medium rounded-[2px] cursor-pointer hover:opacity-90 disabled:opacity-50 disabled:cursor-not-allowed",onClick:l,disabled:!c||!h.trim(),children:nm})]}),r&&L.jsxs("div",{className:"flex gap-2 px-3 py-2 border-b border-border",children:[L.jsxs("button",{type:"button",className:"flex-1 flex items-center justify-center gap-1.5 px-2.5 py-1.5 bg-transparent border border-border rounded-[2px] text-ink text-xs cursor-pointer hover:bg-list-hover disabled:opacity-50 disabled:cursor-not-allowed",onClick:g,disabled:n||i,title:t!=null&&t.behind?`${t.behind} commits behind`:xc,children:[L.jsx("svg",{className:"w-3.5 h-3.5",viewBox:"0 0 24 24","aria-hidden":"true",children:L.jsx("path",{d:"M12 4v12m0 0l-4-4m4 4l4-4M4 20h16",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})}),n?um:xc,t!=null&&t.behind?` (${t.behind})`:""]}),L.jsxs("button",{type:"button",className:"flex-1 flex items-center justify-center gap-1.5 px-2.5 py-1.5 bg-transparent border border-border rounded-[2px] text-ink text-xs cursor-pointer hover:bg-list-hover disabled:opacity-50 disabled:cursor-not-allowed",onClick:w,disabled:i||n,title:t!=null&&t.ahead?`${t.ahead} commits ahead`:wc,children:[L.jsx("svg",{className:"w-3.5 h-3.5",viewBox:"0 0 24 24","aria-hidden":"true",children:L.jsx("path",{d:"M12 20V8m0 0l4 4m-4-4l-4 4M4 4h16",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})}),i?cm:wc,t!=null&&t.ahead?` (${t.ahead})`:""]})]}),s?L.jsxs(L.Fragment,{children:[a.length>0&&L.jsxs("div",{className:"flex flex-col",children:[L.jsxs("div",{className:"flex items-center justify-between px-3 py-1",children:[L.jsxs("span",{className:"text-[11px] font-semibold uppercase tracking-[0.5px] text-ink-muted",children:[rm," (",a.length,")"]}),L.jsx("button",{type:"button",className:"w-[22px] h-[22px] p-0 border-0 rounded-[3px] bg-transparent text-ink-muted cursor-pointer flex items-center justify-center hover:bg-list-hover hover:text-ink",onClick:d,title:am,children:L.jsx("svg",{className:"w-3.5 h-3.5 fill-current",viewBox:"0 0 24 24","aria-hidden":"true",children:L.jsx("path",{d:"M19 13H5v-2h14v2z"})})})]}),L.jsx("div",{className:"flex flex-col",children:a.map(v=>L.jsx(Cc,{file:v,onStage:u,onUnstage:f,onDiscard:m,onShowDiff:C},v.path))})]}),o.length>0&&L.jsxs("div",{className:"flex flex-col",children:[L.jsxs("div",{className:"flex items-center justify-between px-3 py-1",children:[L.jsxs("span",{className:"text-[11px] font-semibold uppercase tracking-[0.5px] text-ink-muted",children:[im," (",o.length,")"]}),L.jsx("button",{type:"button",className:"w-[22px] h-[22px] p-0 border-0 rounded-[3px] bg-transparent text-ink-muted cursor-pointer flex items-center justify-center hover:bg-list-hover hover:text-ink",onClick:S,title:lm,children:L.jsx("svg",{className:"w-3.5 h-3.5 fill-current",viewBox:"0 0 24 24","aria-hidden":"true",children:L.jsx("path",{d:"M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"})})})]}),L.jsx("div",{className:"flex flex-col",children:o.map(v=>L.jsx(Cc,{file:v,onStage:u,onUnstage:f,onDiscard:m,onShowDiff:C},v.path))})]})]}):L.jsx("div",{className:"flex items-center justify-center h-full text-muted text-[13px] p-5",children:om})]})}const dm="読み込み中...",fm="新規ブランチ",pm="作成",_m="キャンセル";function vm({branches:e,branchesLoading:t,onCheckoutBranch:r,onCreateBranch:i}){const[n,h]=N.useState(!1),[_,l]=N.useState(""),u=N.useCallback(()=>{_.trim()&&(i(_.trim()),l(""),h(!1))},[_,i]),f=N.useCallback(S=>{S.key==="Enter"?(S.preventDefault(),u()):S.key==="Escape"&&(h(!1),l(""))},[u]);return L.jsxs("div",{className:"flex flex-col gap-2",children:[L.jsx("div",{className:"px-3 py-2 border-b border-border",children:n?L.jsxs("div",{className:"flex gap-1.5 items-center",children:[L.jsx("input",{type:"text",className:"flex-1 px-2 py-1 text-xs border border-border rounded-[2px] bg-panel text-ink font-mono focus:outline-none focus:border-focus",placeholder:"ブランチ名...",value:_,onChange:S=>l(S.target.value),onKeyDown:f,autoFocus:!0}),L.jsx("button",{type:"button",className:"border border-border bg-transparent text-ink px-2.5 py-1 text-xs rounded-[2px] cursor-pointer hover:bg-list-hover disabled:opacity-50 disabled:cursor-not-allowed",onClick:u,disabled:!_.trim(),children:pm}),L.jsx("button",{type:"button",className:"border border-border bg-transparent text-ink px-2.5 py-1 text-xs rounded-[2px] cursor-pointer hover:bg-list-hover disabled:opacity-50 disabled:cursor-not-allowed",onClick:()=>{h(!1),l("")},children:_m})]}):L.jsx("button",{type:"button",className:"border border-border bg-transparent text-ink px-2.5 py-1 text-xs rounded-[2px] cursor-pointer hover:bg-list-hover disabled:opacity-50 disabled:cursor-not-allowed",onClick:()=>h(!0),children:fm})}),t?L.jsx("div",{className:"flex items-center justify-center h-full text-muted text-[13px] p-5",children:dm}):L.jsx("div",{className:"flex flex-col",children:e.map(S=>L.jsxs("button",{type:"button",className:tt("flex items-center gap-2 px-3 py-1.5 bg-transparent border-0 text-ink text-[13px] cursor-pointer text-left transition-colors hover:bg-list-hover disabled:cursor-default",S.current&&"bg-list-active cursor-default"),onClick:()=>!S.current&&r(S.name),disabled:S.current,children:[L.jsxs("svg",{className:"w-4 h-4 flex-shrink-0 text-ink-muted",viewBox:"0 0 24 24","aria-hidden":"true",children:[L.jsx("path",{d:"M6 3v12M18 9a3 3 0 1 1 0 6 3 3 0 0 1 0-6zM6 21a3 3 0 1 1 0-6 3 3 0 0 1 0 6z",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"}),L.jsx("path",{d:"M18 12c0 3-3 4-6 4s-6-1-6-4",fill:"none",stroke:"currentColor",strokeWidth:"2"})]}),L.jsx("span",{className:"flex-1 overflow-hidden text-ellipsis whitespace-nowrap font-mono",children:S.name}),S.current&&L.jsx("span",{className:"text-[10px] font-semibold px-1.5 py-0.5 bg-accent text-white rounded-[3px]",children:"現在"})]},S.name))})]})}const mm="読み込み中...";function gm({logs:e,logsLoading:t}){return L.jsx("div",{className:"flex flex-col",children:t?L.jsx("div",{className:"flex items-center justify-center h-full text-muted text-[13px] p-5",children:mm}):e.length===0?L.jsx("div",{className:"flex items-center justify-center h-full text-muted text-[13px] p-5",children:"コミット履歴がありません"}):L.jsx("div",{className:"flex flex-col",children:e.map(r=>L.jsxs("div",{className:"flex flex-col gap-0.5 px-3 py-2 border-b border-border hover:bg-list-hover transition-colors",children:[L.jsxs("div",{className:"flex items-center gap-2",children:[L.jsx("span",{className:"font-mono text-xs text-accent font-semibold",children:r.hashShort}),L.jsx("span",{className:"text-xs text-ink-muted",children:r.author})]}),L.jsx("div",{className:"text-[13px] text-ink overflow-hidden text-ellipsis whitespace-nowrap",children:r.message}),L.jsx("div",{className:"text-[11px] text-muted",children:new Date(r.date).toLocaleString()})]},r.hash))})})}const fi="ソースコントロール",ym="Gitリポジトリではありません",Sm="ワークスペースを選択してください",Cm="読み込み中...",to="更新",wm="変更",xm="ブランチ",bm="履歴",ro="border border-border bg-transparent text-ink px-2.5 py-1 text-xs rounded-[2px] cursor-pointer hover:bg-list-hover disabled:opacity-50 disabled:cursor-not-allowed",io="flex items-center justify-center h-full text-muted text-[13px] p-5";function Em({status:e,loading:t,error:r,workspaceId:i,branchStatus:n,hasRemote:h,pushing:_,pulling:l,branches:u,branchesLoading:f,logs:S,logsLoading:d,repos:m,selectedRepoPath:C,onSelectRepo:w,onRefresh:g,onStageFile:a,onUnstageFile:o,onStageAll:s,onUnstageAll:c,onCommit:p,onDiscardFile:v,onShowDiff:x,onPush:b,onPull:y,onLoadBranches:k,onCheckoutBranch:R,onCreateBranch:O,onLoadLogs:T}){const[B,z]=N.useState(""),[I,j]=N.useState("changes"),$=N.useCallback(()=>{B.trim()&&(p(B.trim()),z(""))},[B,p]),E=N.useCallback(M=>{j(M),M==="branches"?k():M==="history"&&T()},[k,T]);if(!i)return L.jsxs("section",{className:"panel",children:[L.jsx("div",{className:"panel-header",children:L.jsx("div",{className:"panel-title",children:fi})}),L.jsx("div",{className:"panel-body",children:L.jsx("div",{className:io,children:Sm})})]});if(t)return L.jsxs("section",{className:"panel",children:[L.jsx("div",{className:"panel-header",children:L.jsx("div",{className:"panel-title",children:fi})}),L.jsx("div",{className:"panel-body",children:L.jsx("div",{className:io,children:Cm})})]});if(r)return L.jsxs("section",{className:"panel",children:[L.jsxs("div",{className:"panel-header",children:[L.jsx("div",{className:"panel-title",children:fi}),L.jsx("button",{type:"button",className:ro,onClick:g,children:to})]}),L.jsx("div",{className:"panel-body",children:L.jsx("div",{className:"flex items-center justify-center h-full text-[#f14c4c] text-[13px] p-5",children:r})})]});if(!(e!=null&&e.isGitRepo))return L.jsxs("section",{className:"panel",children:[L.jsxs("div",{className:"panel-header",children:[L.jsx("div",{className:"panel-title",children:fi}),L.jsx("button",{type:"button",className:ro,onClick:g,children:to})]}),L.jsx("div",{className:"panel-body",children:L.jsx("div",{className:io,children:ym})})]});const A=e.files.length>0,P=m.length>1;return L.jsxs("section",{className:"panel",children:[L.jsxs("div",{className:"panel-header",children:[L.jsxs("div",{children:[L.jsx("div",{className:"panel-title",children:fi}),L.jsxs("div",{className:"panel-subtitle flex items-center gap-1.5",children:[L.jsxs("svg",{viewBox:"0 0 24 24",className:"w-3.5 h-3.5 flex-shrink-0","aria-hidden":"true",children:[L.jsx("path",{d:"M6 3v12M18 9a3 3 0 1 1 0 6 3 3 0 0 1 0-6zM6 21a3 3 0 1 1 0-6 3 3 0 0 1 0 6z",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"}),L.jsx("path",{d:"M18 12c0 3-3 4-6 4s-6-1-6-4",fill:"none",stroke:"currentColor",strokeWidth:"2"})]}),e.branch]})]}),L.jsx("button",{type:"button",className:ro,onClick:g,children:to})]}),P&&L.jsxs("div",{className:"flex items-center gap-2 px-3 py-2 border-b border-border bg-sidebar text-xs",children:[L.jsx("svg",{className:"w-3.5 h-3.5 text-muted flex-shrink-0",viewBox:"0 0 24 24","aria-hidden":"true",children:L.jsx("path",{d:"M3 7v10a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V9a2 2 0 0 0-2-2h-6l-2-2H5a2 2 0 0 0-2 2z",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})}),L.jsx("select",{className:"flex-1 min-w-0 bg-panel border border-border rounded-[2px] px-2 py-1 text-[12px] font-mono text-ink focus:outline-none focus:border-focus",value:C||"",onChange:M=>w(M.target.value),children:m.map(M=>L.jsxs("option",{value:M.path,children:[M.name," (",M.branch,") ",M.fileCount>0?`• ${M.fileCount}`:""]},M.path))}),L.jsxs("span",{className:"text-[11px] text-muted font-mono flex-shrink-0",children:[m.length," repos"]})]}),L.jsxs("div",{className:"git-tabs",children:[L.jsxs("button",{type:"button",className:tt("git-tab",I==="changes"&&"active"),onClick:()=>E("changes"),children:[wm,A&&L.jsx("span",{className:"text-[10px] font-semibold bg-accent/20 text-accent rounded-full px-1.5 py-0.5 leading-none",children:e.files.length})]}),L.jsx("button",{type:"button",className:tt("git-tab",I==="branches"&&"active"),onClick:()=>E("branches"),children:xm}),L.jsx("button",{type:"button",className:tt("git-tab",I==="history"&&"active"),onClick:()=>E("history"),children:bm})]}),L.jsxs("div",{className:"panel-body",children:[I==="changes"&&L.jsx(hm,{status:e,branchStatus:n,hasRemote:h,pushing:_,pulling:l,commitMessage:B,onCommitMessageChange:z,onCommit:$,onStageFile:a,onUnstageFile:o,onStageAll:s,onUnstageAll:c,onDiscardFile:v,onShowDiff:x,onPush:b,onPull:y}),I==="branches"&&L.jsx(vm,{branches:u,branchesLoading:f,onCheckoutBranch:R,onCreateBranch:O}),I==="history"&&L.jsx(gm,{logs:S,logsLoading:d})]})]})}function bc(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,i=Array(t);r<t;r++)i[r]=e[r];return i}function km(e){if(Array.isArray(e))return e}function Lm(e,t,r){return(t=Bm(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Dm(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var i,n,h,_,l=[],u=!0,f=!1;try{if(h=(r=r.call(e)).next,t!==0)for(;!(u=(i=h.call(r)).done)&&(l.push(i.value),l.length!==t);u=!0);}catch(S){f=!0,n=S}finally{try{if(!u&&r.return!=null&&(_=r.return(),Object(_)!==_))return}finally{if(f)throw n}}return l}}function Rm(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
@@ -4,7 +4,7 @@
4
4
  <meta charset="UTF-8" />
5
5
  <meta name="viewport" content="width=device-width, initial-scale=1.0, viewport-fit=cover" />
6
6
  <title>Deck IDE</title>
7
- <script type="module" crossorigin src="/assets/index-CZCEdQsS.js"></script>
7
+ <script type="module" crossorigin src="/assets/index-Ca48Jwk-.js"></script>
8
8
  <link rel="stylesheet" crossorigin href="/assets/index-XzHuzeuq.css">
9
9
  </head>
10
10
  <body>