vibora 9.4.0 → 9.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -147,10 +147,10 @@ Configure your default agent globally in settings, override per-repository, or s
147
147
  The Vibora plugin for Claude Code enables seamless integration:
148
148
 
149
149
  - **Automatic Status Sync** — Task moves to "In Review" when Claude stops, "In Progress" when you respond
150
- - **Vibora Skill** — CLI documentation for task management (see `plugins/vibora/skills/`)
151
- - **Slash Commands** — `/review`, `/pr`, `/notify`, `/linear`, `/task-info`
152
150
  - **Session Continuity** — Claude sessions are tied to task IDs
153
151
  - **MCP Server** — Task management tools available directly to Claude
152
+ - **Vibora Skill** — CLI documentation for task management (see `plugins/vibora/skills/`)
153
+ - **Slash Commands** — `/review`, `/pr`, `/notify`, `/linear`, `/task-info`
154
154
 
155
155
  The plugin is automatically installed when Vibora starts. To install manually:
156
156
 
@@ -159,23 +159,22 @@ claude plugin marketplace add knowsuchagency/vibora
159
159
  claude plugin install vibora@vibora --scope user
160
160
  ```
161
161
 
162
- ## OpenCode Plugin
162
+ ## OpenCode Integration
163
163
 
164
164
  The Vibora plugin for OpenCode enables seamless integration:
165
165
 
166
166
  - **Automatic Status Sync** — Task moves to "In Review" when OpenCode stops, "In Progress" when you respond
167
167
  - **Session Continuity** — OpenCode sessions are tied to task IDs
168
- - **Smart Context** — Automatically detects if you are in a Vibora task
169
-
170
- To install manually:
168
+ - **MCP Server** — Task management tools available directly to OpenCode
171
169
 
172
170
  ```bash
173
- vibora opencode install
171
+ vibora opencode install # Install plugin + MCP server
172
+ vibora opencode uninstall # Remove both
174
173
  ```
175
174
 
176
- ### MCP Tools
175
+ ## MCP Tools
177
176
 
178
- The plugin includes an MCP server that exposes task management and remote execution tools:
177
+ Both Claude Code and OpenCode plugins include an MCP server that exposes task management and remote execution tools:
179
178
 
180
179
  **Task Management:**
181
180
  - `list_tasks` — List all tasks with optional status/repo filter
package/bin/vibora.js CHANGED
@@ -45126,7 +45126,7 @@ function installUv() {
45126
45126
  var package_default = {
45127
45127
  name: "vibora",
45128
45128
  private: true,
45129
- version: "9.4.0",
45129
+ version: "9.5.0",
45130
45130
  description: "Harness Attention. Orchestrate Agents. Ship.",
45131
45131
  license: "PolyForm-Perimeter-1.0.0",
45132
45132
  type: "module",
@@ -45644,7 +45644,15 @@ async function handleConfigCommand(action, positional, flags) {
45644
45644
 
45645
45645
  // cli/src/commands/opencode.ts
45646
45646
  init_errors();
45647
- import { mkdirSync as mkdirSync3, writeFileSync as writeFileSync3 } from "fs";
45647
+ import {
45648
+ mkdirSync as mkdirSync3,
45649
+ writeFileSync as writeFileSync3,
45650
+ existsSync as existsSync4,
45651
+ readFileSync as readFileSync3,
45652
+ unlinkSync as unlinkSync2,
45653
+ copyFileSync,
45654
+ renameSync
45655
+ } from "fs";
45648
45656
  import { homedir as homedir2 } from "os";
45649
45657
  import { join as join4 } from "path";
45650
45658
 
@@ -45652,10 +45660,12 @@ import { join as join4 } from "path";
45652
45660
  var vibora_opencode_default = `import type { Plugin } from "@opencode-ai/plugin"
45653
45661
  import { appendFileSync } from "node:fs"
45654
45662
  import { execFile } from "node:child_process"
45663
+ import { tmpdir } from "node:os"
45664
+ import { join } from "node:path"
45655
45665
 
45656
45666
  declare const process: { env: Record<string, string | undefined> }
45657
45667
 
45658
- const LOG_FILE = "/tmp/vibora-opencode.log"
45668
+ const LOG_FILE = join(tmpdir(), "vibora-opencode.log")
45659
45669
  const NOISY_EVENTS = new Set([
45660
45670
  "message.part.updated",
45661
45671
  "file.watcher.updated",
@@ -45864,22 +45874,154 @@ export const ViboraPlugin: Plugin = async ({ $, directory }) => {
45864
45874
  `;
45865
45875
 
45866
45876
  // cli/src/commands/opencode.ts
45877
+ var OPENCODE_DIR = join4(homedir2(), ".opencode");
45878
+ var OPENCODE_CONFIG_PATH = join4(OPENCODE_DIR, "opencode.json");
45879
+ var PLUGIN_DIR = join4(homedir2(), ".config", "opencode", "plugin");
45880
+ var PLUGIN_PATH = join4(PLUGIN_DIR, "vibora.ts");
45881
+ var VIBORA_MCP_CONFIG = {
45882
+ type: "local",
45883
+ command: ["vibora", "mcp"],
45884
+ enabled: true
45885
+ };
45867
45886
  async function handleOpenCodeCommand(action) {
45868
45887
  if (action === "install") {
45888
+ await installOpenCodeIntegration();
45889
+ return;
45890
+ }
45891
+ if (action === "uninstall") {
45892
+ await uninstallOpenCodeIntegration();
45893
+ return;
45894
+ }
45895
+ throw new CliError("INVALID_ACTION", "Unknown action. Usage: vibora opencode install | vibora opencode uninstall", ExitCodes.INVALID_ARGS);
45896
+ }
45897
+ async function installOpenCodeIntegration() {
45898
+ try {
45899
+ console.log("Installing OpenCode plugin...");
45900
+ mkdirSync3(PLUGIN_DIR, { recursive: true });
45901
+ writeFileSync3(PLUGIN_PATH, vibora_opencode_default, "utf-8");
45902
+ console.log("\u2713 Installed plugin at " + PLUGIN_PATH);
45903
+ console.log("Configuring MCP server...");
45904
+ const mcpConfigured = addMcpServer();
45905
+ console.log("");
45906
+ if (mcpConfigured) {
45907
+ console.log("Installation complete! Restart OpenCode to apply changes.");
45908
+ } else {
45909
+ console.log("Plugin installed, but MCP configuration was skipped.");
45910
+ console.log("Please add the MCP server manually (see above).");
45911
+ }
45912
+ } catch (err) {
45913
+ throw new CliError("INSTALL_FAILED", `Failed to install OpenCode integration: ${err instanceof Error ? err.message : String(err)}`, ExitCodes.ERROR);
45914
+ }
45915
+ }
45916
+ async function uninstallOpenCodeIntegration() {
45917
+ try {
45918
+ let removedPlugin = false;
45919
+ let removedMcp = false;
45920
+ if (existsSync4(PLUGIN_PATH)) {
45921
+ unlinkSync2(PLUGIN_PATH);
45922
+ console.log("\u2713 Removed plugin from " + PLUGIN_PATH);
45923
+ removedPlugin = true;
45924
+ } else {
45925
+ console.log("\u2022 Plugin not found (already removed)");
45926
+ }
45927
+ removedMcp = removeMcpServer();
45928
+ if (!removedPlugin && !removedMcp) {
45929
+ console.log("Nothing to uninstall.");
45930
+ } else {
45931
+ console.log("");
45932
+ console.log("Uninstall complete! Restart OpenCode to apply changes.");
45933
+ }
45934
+ } catch (err) {
45935
+ throw new CliError("UNINSTALL_FAILED", `Failed to uninstall OpenCode integration: ${err instanceof Error ? err.message : String(err)}`, ExitCodes.ERROR);
45936
+ }
45937
+ }
45938
+ function getMcpObject(config3) {
45939
+ const mcp = config3.mcp;
45940
+ if (mcp && typeof mcp === "object" && !Array.isArray(mcp)) {
45941
+ return mcp;
45942
+ }
45943
+ return {};
45944
+ }
45945
+ function addMcpServer() {
45946
+ mkdirSync3(OPENCODE_DIR, { recursive: true });
45947
+ let config3 = {};
45948
+ if (existsSync4(OPENCODE_CONFIG_PATH)) {
45869
45949
  try {
45870
- const pluginDir = join4(homedir2(), ".config", "opencode", "plugin");
45871
- const pluginPath = join4(pluginDir, "vibora.ts");
45872
- console.log("Installing OpenCode plugin...");
45873
- mkdirSync3(pluginDir, { recursive: true });
45874
- writeFileSync3(pluginPath, vibora_opencode_default, "utf-8");
45875
- console.log("\u2713 Installed OpenCode plugin at " + pluginPath);
45876
- console.log(" The plugin will be loaded automatically when you restart OpenCode.");
45877
- } catch (err) {
45878
- throw new CliError("INSTALL_FAILED", `Failed to install OpenCode plugin: ${err instanceof Error ? err.message : String(err)}`, ExitCodes.ERROR);
45950
+ const content = readFileSync3(OPENCODE_CONFIG_PATH, "utf-8");
45951
+ config3 = JSON.parse(content);
45952
+ } catch {
45953
+ console.log("\u26A0 Could not parse existing opencode.json, skipping MCP configuration");
45954
+ console.log(" Add manually to ~/.opencode/opencode.json:");
45955
+ console.log(' "mcp": { "vibora": { "type": "local", "command": ["vibora", "mcp"], "enabled": true } }');
45956
+ return false;
45879
45957
  }
45880
- return;
45881
45958
  }
45882
- throw new CliError("INVALID_ACTION", "Unknown action. usage: vibora opencode install", ExitCodes.INVALID_ARGS);
45959
+ const mcp = getMcpObject(config3);
45960
+ if (mcp.vibora) {
45961
+ console.log("\u2022 MCP server already configured, preserving existing configuration");
45962
+ return true;
45963
+ }
45964
+ if (existsSync4(OPENCODE_CONFIG_PATH)) {
45965
+ copyFileSync(OPENCODE_CONFIG_PATH, OPENCODE_CONFIG_PATH + ".backup");
45966
+ }
45967
+ config3.mcp = {
45968
+ ...mcp,
45969
+ vibora: VIBORA_MCP_CONFIG
45970
+ };
45971
+ const tempPath = OPENCODE_CONFIG_PATH + ".tmp";
45972
+ try {
45973
+ writeFileSync3(tempPath, JSON.stringify(config3, null, 2), "utf-8");
45974
+ renameSync(tempPath, OPENCODE_CONFIG_PATH);
45975
+ } catch (error46) {
45976
+ try {
45977
+ if (existsSync4(tempPath)) {
45978
+ unlinkSync2(tempPath);
45979
+ }
45980
+ } catch {}
45981
+ throw error46;
45982
+ }
45983
+ console.log("\u2713 Added MCP server to " + OPENCODE_CONFIG_PATH);
45984
+ return true;
45985
+ }
45986
+ function removeMcpServer() {
45987
+ if (!existsSync4(OPENCODE_CONFIG_PATH)) {
45988
+ console.log("\u2022 MCP config not found (already removed)");
45989
+ return false;
45990
+ }
45991
+ let config3;
45992
+ try {
45993
+ const content = readFileSync3(OPENCODE_CONFIG_PATH, "utf-8");
45994
+ config3 = JSON.parse(content);
45995
+ } catch {
45996
+ console.log("\u26A0 Could not parse opencode.json, skipping MCP removal");
45997
+ return false;
45998
+ }
45999
+ const mcp = getMcpObject(config3);
46000
+ if (!mcp.vibora) {
46001
+ console.log("\u2022 MCP server not configured (already removed)");
46002
+ return false;
46003
+ }
46004
+ copyFileSync(OPENCODE_CONFIG_PATH, OPENCODE_CONFIG_PATH + ".backup");
46005
+ delete mcp.vibora;
46006
+ if (Object.keys(mcp).length === 0) {
46007
+ delete config3.mcp;
46008
+ } else {
46009
+ config3.mcp = mcp;
46010
+ }
46011
+ const tempPath = OPENCODE_CONFIG_PATH + ".tmp";
46012
+ try {
46013
+ writeFileSync3(tempPath, JSON.stringify(config3, null, 2), "utf-8");
46014
+ renameSync(tempPath, OPENCODE_CONFIG_PATH);
46015
+ } catch (error46) {
46016
+ try {
46017
+ if (existsSync4(tempPath)) {
46018
+ unlinkSync2(tempPath);
46019
+ }
46020
+ } catch {}
46021
+ throw error46;
46022
+ }
46023
+ console.log("\u2713 Removed MCP server from " + OPENCODE_CONFIG_PATH);
46024
+ return true;
45883
46025
  }
45884
46026
 
45885
46027
  // cli/src/commands/notifications.ts
@@ -46580,13 +46722,26 @@ var opencodeInstallCommand = defineCommand({
46580
46722
  await handleOpenCodeCommand("install");
46581
46723
  }
46582
46724
  });
46725
+ var opencodeUninstallCommand = defineCommand({
46726
+ meta: {
46727
+ name: "uninstall",
46728
+ description: "Uninstall the OpenCode plugin"
46729
+ },
46730
+ args: globalArgs,
46731
+ async run({ args }) {
46732
+ if (args.json)
46733
+ setJsonOutput(true);
46734
+ await handleOpenCodeCommand("uninstall");
46735
+ }
46736
+ });
46583
46737
  var opencodeCommand = defineCommand({
46584
46738
  meta: {
46585
46739
  name: "opencode",
46586
46740
  description: "Manage OpenCode integration"
46587
46741
  },
46588
46742
  subCommands: {
46589
- install: opencodeInstallCommand
46743
+ install: opencodeInstallCommand,
46744
+ uninstall: opencodeUninstallCommand
46590
46745
  }
46591
46746
  });
46592
46747
  var notificationsStatusCommand = defineCommand({
@@ -43,7 +43,7 @@ WARNING: This link could potentially be dangerous`)){const v=window.open();if(v)
43
43
  `,c.VT="\v",c.FF="\f",c.CR="\r",c.SO="",c.SI="",c.DLE="",c.DC1="",c.DC2="",c.DC3="",c.DC4="",c.NAK="",c.SYN="",c.ETB="",c.CAN="",c.EM="",c.SUB="",c.ESC="\x1B",c.FS="",c.GS="",c.RS="",c.US="",c.SP=" ",c.DEL=""})(l||(o.C0=l={})),(function(c){c.PAD="€",c.HOP="",c.BPH="‚",c.NBH="ƒ",c.IND="„",c.NEL="…",c.SSA="†",c.ESA="‡",c.HTS="ˆ",c.HTJ="‰",c.VTS="Š",c.PLD="‹",c.PLU="Œ",c.RI="",c.SS2="Ž",c.SS3="",c.DCS="",c.PU1="‘",c.PU2="’",c.STS="“",c.CCH="”",c.MW="•",c.SPA="–",c.EPA="—",c.SOS="˜",c.SGCI="™",c.SCI="š",c.CSI="›",c.ST="œ",c.OSC="",c.PM="ž",c.APC="Ÿ"})(u||(o.C1=u={})),(function(c){c.ST=`${l.ESC}\\`})(d||(o.C1_ESCAPED=d={}))},7399:(s,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.evaluateKeyboardEvent=void 0;const u=l(2584),d={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:["'",'"']};o.evaluateKeyboardEvent=function(c,m,g,_){const x={type:0,cancel:!1,key:void 0},b=(c.shiftKey?1:0)|(c.altKey?2:0)|(c.ctrlKey?4:0)|(c.metaKey?8:0);switch(c.keyCode){case 0:c.key==="UIKeyInputUpArrow"?x.key=m?u.C0.ESC+"OA":u.C0.ESC+"[A":c.key==="UIKeyInputLeftArrow"?x.key=m?u.C0.ESC+"OD":u.C0.ESC+"[D":c.key==="UIKeyInputRightArrow"?x.key=m?u.C0.ESC+"OC":u.C0.ESC+"[C":c.key==="UIKeyInputDownArrow"&&(x.key=m?u.C0.ESC+"OB":u.C0.ESC+"[B");break;case 8:x.key=c.ctrlKey?"\b":u.C0.DEL,c.altKey&&(x.key=u.C0.ESC+x.key);break;case 9:if(c.shiftKey){x.key=u.C0.ESC+"[Z";break}x.key=u.C0.HT,x.cancel=!0;break;case 13:x.key=c.altKey?u.C0.ESC+u.C0.CR:u.C0.CR,x.cancel=!0;break;case 27:x.key=u.C0.ESC,c.altKey&&(x.key=u.C0.ESC+u.C0.ESC),x.cancel=!0;break;case 37:if(c.metaKey)break;b?(x.key=u.C0.ESC+"[1;"+(b+1)+"D",x.key===u.C0.ESC+"[1;3D"&&(x.key=u.C0.ESC+(g?"b":"[1;5D"))):x.key=m?u.C0.ESC+"OD":u.C0.ESC+"[D";break;case 39:if(c.metaKey)break;b?(x.key=u.C0.ESC+"[1;"+(b+1)+"C",x.key===u.C0.ESC+"[1;3C"&&(x.key=u.C0.ESC+(g?"f":"[1;5C"))):x.key=m?u.C0.ESC+"OC":u.C0.ESC+"[C";break;case 38:if(c.metaKey)break;b?(x.key=u.C0.ESC+"[1;"+(b+1)+"A",g||x.key!==u.C0.ESC+"[1;3A"||(x.key=u.C0.ESC+"[1;5A")):x.key=m?u.C0.ESC+"OA":u.C0.ESC+"[A";break;case 40:if(c.metaKey)break;b?(x.key=u.C0.ESC+"[1;"+(b+1)+"B",g||x.key!==u.C0.ESC+"[1;3B"||(x.key=u.C0.ESC+"[1;5B")):x.key=m?u.C0.ESC+"OB":u.C0.ESC+"[B";break;case 45:c.shiftKey||c.ctrlKey||(x.key=u.C0.ESC+"[2~");break;case 46:x.key=b?u.C0.ESC+"[3;"+(b+1)+"~":u.C0.ESC+"[3~";break;case 36:x.key=b?u.C0.ESC+"[1;"+(b+1)+"H":m?u.C0.ESC+"OH":u.C0.ESC+"[H";break;case 35:x.key=b?u.C0.ESC+"[1;"+(b+1)+"F":m?u.C0.ESC+"OF":u.C0.ESC+"[F";break;case 33:c.shiftKey?x.type=2:c.ctrlKey?x.key=u.C0.ESC+"[5;"+(b+1)+"~":x.key=u.C0.ESC+"[5~";break;case 34:c.shiftKey?x.type=3:c.ctrlKey?x.key=u.C0.ESC+"[6;"+(b+1)+"~":x.key=u.C0.ESC+"[6~";break;case 112:x.key=b?u.C0.ESC+"[1;"+(b+1)+"P":u.C0.ESC+"OP";break;case 113:x.key=b?u.C0.ESC+"[1;"+(b+1)+"Q":u.C0.ESC+"OQ";break;case 114:x.key=b?u.C0.ESC+"[1;"+(b+1)+"R":u.C0.ESC+"OR";break;case 115:x.key=b?u.C0.ESC+"[1;"+(b+1)+"S":u.C0.ESC+"OS";break;case 116:x.key=b?u.C0.ESC+"[15;"+(b+1)+"~":u.C0.ESC+"[15~";break;case 117:x.key=b?u.C0.ESC+"[17;"+(b+1)+"~":u.C0.ESC+"[17~";break;case 118:x.key=b?u.C0.ESC+"[18;"+(b+1)+"~":u.C0.ESC+"[18~";break;case 119:x.key=b?u.C0.ESC+"[19;"+(b+1)+"~":u.C0.ESC+"[19~";break;case 120:x.key=b?u.C0.ESC+"[20;"+(b+1)+"~":u.C0.ESC+"[20~";break;case 121:x.key=b?u.C0.ESC+"[21;"+(b+1)+"~":u.C0.ESC+"[21~";break;case 122:x.key=b?u.C0.ESC+"[23;"+(b+1)+"~":u.C0.ESC+"[23~";break;case 123:x.key=b?u.C0.ESC+"[24;"+(b+1)+"~":u.C0.ESC+"[24~";break;default:if(!c.ctrlKey||c.shiftKey||c.altKey||c.metaKey)if(g&&!_||!c.altKey||c.metaKey)!g||c.altKey||c.ctrlKey||c.shiftKey||!c.metaKey?c.key&&!c.ctrlKey&&!c.altKey&&!c.metaKey&&c.keyCode>=48&&c.key.length===1?x.key=c.key:c.key&&c.ctrlKey&&(c.key==="_"&&(x.key=u.C0.US),c.key==="@"&&(x.key=u.C0.NUL)):c.keyCode===65&&(x.type=1);else{const v=d[c.keyCode],y=v?.[c.shiftKey?1:0];if(y)x.key=u.C0.ESC+y;else if(c.keyCode>=65&&c.keyCode<=90){const E=c.ctrlKey?c.keyCode-64:c.keyCode+32;let C=String.fromCharCode(E);c.shiftKey&&(C=C.toUpperCase()),x.key=u.C0.ESC+C}else if(c.keyCode===32)x.key=u.C0.ESC+(c.ctrlKey?u.C0.NUL:" ");else if(c.key==="Dead"&&c.code.startsWith("Key")){let E=c.code.slice(3,4);c.shiftKey||(E=E.toLowerCase()),x.key=u.C0.ESC+E,x.cancel=!0}}else c.keyCode>=65&&c.keyCode<=90?x.key=String.fromCharCode(c.keyCode-64):c.keyCode===32?x.key=u.C0.NUL:c.keyCode>=51&&c.keyCode<=55?x.key=String.fromCharCode(c.keyCode-51+27):c.keyCode===56?x.key=u.C0.DEL:c.keyCode===219?x.key=u.C0.ESC:c.keyCode===220?x.key=u.C0.FS:c.keyCode===221&&(x.key=u.C0.GS)}return x}},482:(s,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.Utf8ToUtf32=o.StringToUtf32=o.utf32ToString=o.stringFromCodePoint=void 0,o.stringFromCodePoint=function(l){return l>65535?(l-=65536,String.fromCharCode(55296+(l>>10))+String.fromCharCode(l%1024+56320)):String.fromCharCode(l)},o.utf32ToString=function(l,u=0,d=l.length){let c="";for(let m=u;m<d;++m){let g=l[m];g>65535?(g-=65536,c+=String.fromCharCode(55296+(g>>10))+String.fromCharCode(g%1024+56320)):c+=String.fromCharCode(g)}return c},o.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(l,u){const d=l.length;if(!d)return 0;let c=0,m=0;if(this._interim){const g=l.charCodeAt(m++);56320<=g&&g<=57343?u[c++]=1024*(this._interim-55296)+g-56320+65536:(u[c++]=this._interim,u[c++]=g),this._interim=0}for(let g=m;g<d;++g){const _=l.charCodeAt(g);if(55296<=_&&_<=56319){if(++g>=d)return this._interim=_,c;const x=l.charCodeAt(g);56320<=x&&x<=57343?u[c++]=1024*(_-55296)+x-56320+65536:(u[c++]=_,u[c++]=x)}else _!==65279&&(u[c++]=_)}return c}},o.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(l,u){const d=l.length;if(!d)return 0;let c,m,g,_,x=0,b=0,v=0;if(this.interim[0]){let C=!1,w=this.interim[0];w&=(224&w)==192?31:(240&w)==224?15:7;let A,O=0;for(;(A=63&this.interim[++O])&&O<4;)w<<=6,w|=A;const R=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,N=R-O;for(;v<N;){if(v>=d)return 0;if(A=l[v++],(192&A)!=128){v--,C=!0;break}this.interim[O++]=A,w<<=6,w|=63&A}C||(R===2?w<128?v--:u[x++]=w:R===3?w<2048||w>=55296&&w<=57343||w===65279||(u[x++]=w):w<65536||w>1114111||(u[x++]=w)),this.interim.fill(0)}const y=d-4;let E=v;for(;E<d;){for(;!(!(E<y)||128&(c=l[E])||128&(m=l[E+1])||128&(g=l[E+2])||128&(_=l[E+3]));)u[x++]=c,u[x++]=m,u[x++]=g,u[x++]=_,E+=4;if(c=l[E++],c<128)u[x++]=c;else if((224&c)==192){if(E>=d)return this.interim[0]=c,x;if(m=l[E++],(192&m)!=128){E--;continue}if(b=(31&c)<<6|63&m,b<128){E--;continue}u[x++]=b}else if((240&c)==224){if(E>=d)return this.interim[0]=c,x;if(m=l[E++],(192&m)!=128){E--;continue}if(E>=d)return this.interim[0]=c,this.interim[1]=m,x;if(g=l[E++],(192&g)!=128){E--;continue}if(b=(15&c)<<12|(63&m)<<6|63&g,b<2048||b>=55296&&b<=57343||b===65279)continue;u[x++]=b}else if((248&c)==240){if(E>=d)return this.interim[0]=c,x;if(m=l[E++],(192&m)!=128){E--;continue}if(E>=d)return this.interim[0]=c,this.interim[1]=m,x;if(g=l[E++],(192&g)!=128){E--;continue}if(E>=d)return this.interim[0]=c,this.interim[1]=m,this.interim[2]=g,x;if(_=l[E++],(192&_)!=128){E--;continue}if(b=(7&c)<<18|(63&m)<<12|(63&g)<<6|63&_,b<65536||b>1114111)continue;u[x++]=b}}return x}}},225:(s,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.UnicodeV6=void 0;const u=l(1480),d=[[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]],c=[[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 m;o.UnicodeV6=class{constructor(){if(this.version="6",!m){m=new Uint8Array(65536),m.fill(1),m[0]=0,m.fill(0,1,32),m.fill(0,127,160),m.fill(2,4352,4448),m[9001]=2,m[9002]=2,m.fill(2,11904,42192),m[12351]=1,m.fill(2,44032,55204),m.fill(2,63744,64256),m.fill(2,65040,65050),m.fill(2,65072,65136),m.fill(2,65280,65377),m.fill(2,65504,65511);for(let g=0;g<d.length;++g)m.fill(0,d[g][0],d[g][1]+1)}}wcwidth(g){return g<32?0:g<127?1:g<65536?m[g]:(function(_,x){let b,v=0,y=x.length-1;if(_<x[0][0]||_>x[y][1])return!1;for(;y>=v;)if(b=v+y>>1,_>x[b][1])v=b+1;else{if(!(_<x[b][0]))return!0;y=b-1}return!1})(g,c)?0:g>=131072&&g<=196605||g>=196608&&g<=262141?2:1}charProperties(g,_){let x=this.wcwidth(g),b=x===0&&_!==0;if(b){const v=u.UnicodeService.extractWidth(_);v===0?b=!1:v>x&&(x=v)}return u.UnicodeService.createPropertyValue(0,x,b)}}},5981:(s,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.WriteBuffer=void 0;const u=l(8460),d=l(844);class c extends d.Disposable{constructor(g){super(),this._action=g,this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=0,this._isSyncWriting=!1,this._syncCalls=0,this._didUserInput=!1,this._onWriteParsed=this.register(new u.EventEmitter),this.onWriteParsed=this._onWriteParsed.event}handleUserInput(){this._didUserInput=!0}writeSync(g,_){if(_!==void 0&&this._syncCalls>_)return void(this._syncCalls=0);if(this._pendingData+=g.length,this._writeBuffer.push(g),this._callbacks.push(void 0),this._syncCalls++,this._isSyncWriting)return;let x;for(this._isSyncWriting=!0;x=this._writeBuffer.shift();){this._action(x);const b=this._callbacks.shift();b&&b()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(g,_){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+=g.length,this._writeBuffer.push(g),this._callbacks.push(_),void this._innerWrite();setTimeout((()=>this._innerWrite()))}this._pendingData+=g.length,this._writeBuffer.push(g),this._callbacks.push(_)}_innerWrite(g=0,_=!0){const x=g||Date.now();for(;this._writeBuffer.length>this._bufferOffset;){const b=this._writeBuffer[this._bufferOffset],v=this._action(b,_);if(v){const E=C=>Date.now()-x>=12?setTimeout((()=>this._innerWrite(0,C))):this._innerWrite(x,C);return void v.catch((C=>(queueMicrotask((()=>{throw C})),Promise.resolve(!1)))).then(E)}const y=this._callbacks[this._bufferOffset];if(y&&y(),this._bufferOffset++,this._pendingData-=b.length,Date.now()-x>=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()}}o.WriteBuffer=c},5941:(s,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.toRgbString=o.parseColor=void 0;const l=/^([\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})$/,u=/^[\da-f]+$/;function d(c,m){const g=c.toString(16),_=g.length<2?"0"+g:g;switch(m){case 4:return g[0];case 8:return _;case 12:return(_+_).slice(0,3);default:return _+_}}o.parseColor=function(c){if(!c)return;let m=c.toLowerCase();if(m.indexOf("rgb:")===0){m=m.slice(4);const g=l.exec(m);if(g){const _=g[1]?15:g[4]?255:g[7]?4095:65535;return[Math.round(parseInt(g[1]||g[4]||g[7]||g[10],16)/_*255),Math.round(parseInt(g[2]||g[5]||g[8]||g[11],16)/_*255),Math.round(parseInt(g[3]||g[6]||g[9]||g[12],16)/_*255)]}}else if(m.indexOf("#")===0&&(m=m.slice(1),u.exec(m)&&[3,6,9,12].includes(m.length))){const g=m.length/3,_=[0,0,0];for(let x=0;x<3;++x){const b=parseInt(m.slice(g*x,g*x+g),16);_[x]=g===1?b<<4:g===2?b:g===3?b>>4:b>>8}return _}},o.toRgbString=function(c,m=16){const[g,_,x]=c;return`rgb:${d(g,m)}/${d(_,m)}/${d(x,m)}`}},5770:(s,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.PAYLOAD_LIMIT=void 0,o.PAYLOAD_LIMIT=1e7},6351:(s,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.DcsHandler=o.DcsParser=void 0;const u=l(482),d=l(8742),c=l(5770),m=[];o.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(_,x){this._handlers[_]===void 0&&(this._handlers[_]=[]);const b=this._handlers[_];return b.push(x),{dispose:()=>{const v=b.indexOf(x);v!==-1&&b.splice(v,1)}}}clearHandler(_){this._handlers[_]&&delete this._handlers[_]}setHandlerFallback(_){this._handlerFb=_}reset(){if(this._active.length)for(let _=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;_>=0;--_)this._active[_].unhook(!1);this._stack.paused=!1,this._active=m,this._ident=0}hook(_,x){if(this.reset(),this._ident=_,this._active=this._handlers[_]||m,this._active.length)for(let b=this._active.length-1;b>=0;b--)this._active[b].hook(x);else this._handlerFb(this._ident,"HOOK",x)}put(_,x,b){if(this._active.length)for(let v=this._active.length-1;v>=0;v--)this._active[v].put(_,x,b);else this._handlerFb(this._ident,"PUT",(0,u.utf32ToString)(_,x,b))}unhook(_,x=!0){if(this._active.length){let b=!1,v=this._active.length-1,y=!1;if(this._stack.paused&&(v=this._stack.loopPosition-1,b=x,y=this._stack.fallThrough,this._stack.paused=!1),!y&&b===!1){for(;v>=0&&(b=this._active[v].unhook(_),b!==!0);v--)if(b instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=v,this._stack.fallThrough=!1,b;v--}for(;v>=0;v--)if(b=this._active[v].unhook(!1),b instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=v,this._stack.fallThrough=!0,b}else this._handlerFb(this._ident,"UNHOOK",_);this._active=m,this._ident=0}};const g=new d.Params;g.addParam(0),o.DcsHandler=class{constructor(_){this._handler=_,this._data="",this._params=g,this._hitLimit=!1}hook(_){this._params=_.length>1||_.params[0]?_.clone():g,this._data="",this._hitLimit=!1}put(_,x,b){this._hitLimit||(this._data+=(0,u.utf32ToString)(_,x,b),this._data.length>c.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}unhook(_){let x=!1;if(this._hitLimit)x=!1;else if(_&&(x=this._handler(this._data,this._params),x instanceof Promise))return x.then((b=>(this._params=g,this._data="",this._hitLimit=!1,b)));return this._params=g,this._data="",this._hitLimit=!1,x}}},2015:(s,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.EscapeSequenceParser=o.VT500_TRANSITION_TABLE=o.TransitionTable=void 0;const u=l(844),d=l(8742),c=l(6242),m=l(6351);class g{constructor(v){this.table=new Uint8Array(v)}setDefault(v,y){this.table.fill(v<<4|y)}add(v,y,E,C){this.table[y<<8|v]=E<<4|C}addMany(v,y,E,C){for(let w=0;w<v.length;w++)this.table[y<<8|v[w]]=E<<4|C}}o.TransitionTable=g;const _=160;o.VT500_TRANSITION_TABLE=(function(){const b=new g(4095),v=Array.apply(null,Array(256)).map(((O,R)=>R)),y=(O,R)=>v.slice(O,R),E=y(32,127),C=y(0,24);C.push(25),C.push.apply(C,y(28,32));const w=y(0,14);let A;for(A in b.setDefault(1,0),b.addMany(E,0,2,0),w)b.addMany([24,26,153,154],A,3,0),b.addMany(y(128,144),A,3,0),b.addMany(y(144,152),A,3,0),b.add(156,A,0,0),b.add(27,A,11,1),b.add(157,A,4,8),b.addMany([152,158,159],A,0,7),b.add(155,A,11,3),b.add(144,A,11,9);return b.addMany(C,0,3,0),b.addMany(C,1,3,1),b.add(127,1,0,1),b.addMany(C,8,0,8),b.addMany(C,3,3,3),b.add(127,3,0,3),b.addMany(C,4,3,4),b.add(127,4,0,4),b.addMany(C,6,3,6),b.addMany(C,5,3,5),b.add(127,5,0,5),b.addMany(C,2,3,2),b.add(127,2,0,2),b.add(93,1,4,8),b.addMany(E,8,5,8),b.add(127,8,5,8),b.addMany([156,27,24,26,7],8,6,0),b.addMany(y(28,32),8,0,8),b.addMany([88,94,95],1,0,7),b.addMany(E,7,0,7),b.addMany(C,7,0,7),b.add(156,7,0,0),b.add(127,7,0,7),b.add(91,1,11,3),b.addMany(y(64,127),3,7,0),b.addMany(y(48,60),3,8,4),b.addMany([60,61,62,63],3,9,4),b.addMany(y(48,60),4,8,4),b.addMany(y(64,127),4,7,0),b.addMany([60,61,62,63],4,0,6),b.addMany(y(32,64),6,0,6),b.add(127,6,0,6),b.addMany(y(64,127),6,0,0),b.addMany(y(32,48),3,9,5),b.addMany(y(32,48),5,9,5),b.addMany(y(48,64),5,0,6),b.addMany(y(64,127),5,7,0),b.addMany(y(32,48),4,9,5),b.addMany(y(32,48),1,9,2),b.addMany(y(32,48),2,9,2),b.addMany(y(48,127),2,10,0),b.addMany(y(48,80),1,10,0),b.addMany(y(81,88),1,10,0),b.addMany([89,90,92],1,10,0),b.addMany(y(96,127),1,10,0),b.add(80,1,11,9),b.addMany(C,9,0,9),b.add(127,9,0,9),b.addMany(y(28,32),9,0,9),b.addMany(y(32,48),9,9,12),b.addMany(y(48,60),9,8,10),b.addMany([60,61,62,63],9,9,10),b.addMany(C,11,0,11),b.addMany(y(32,128),11,0,11),b.addMany(y(28,32),11,0,11),b.addMany(C,10,0,10),b.add(127,10,0,10),b.addMany(y(28,32),10,0,10),b.addMany(y(48,60),10,8,10),b.addMany([60,61,62,63],10,0,11),b.addMany(y(32,48),10,9,12),b.addMany(C,12,0,12),b.add(127,12,0,12),b.addMany(y(28,32),12,0,12),b.addMany(y(32,48),12,9,12),b.addMany(y(48,64),12,0,11),b.addMany(y(64,127),12,12,13),b.addMany(y(64,127),10,12,13),b.addMany(y(64,127),9,12,13),b.addMany(C,13,13,13),b.addMany(E,13,13,13),b.add(127,13,0,13),b.addMany([27,156,24,26],13,14,0),b.add(_,0,2,0),b.add(_,8,5,8),b.add(_,6,0,6),b.add(_,11,0,11),b.add(_,13,13,13),b})();class x extends u.Disposable{constructor(v=o.VT500_TRANSITION_TABLE){super(),this._transitions=v,this._parseStack={state:0,handlers:[],handlerPos:0,transition:0,chunkPos:0},this.initialState=0,this.currentState=this.initialState,this._params=new d.Params,this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._printHandlerFb=(y,E,C)=>{},this._executeHandlerFb=y=>{},this._csiHandlerFb=(y,E)=>{},this._escHandlerFb=y=>{},this._errorHandlerFb=y=>y,this._printHandler=this._printHandlerFb,this._executeHandlers=Object.create(null),this._csiHandlers=Object.create(null),this._escHandlers=Object.create(null),this.register((0,u.toDisposable)((()=>{this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null)}))),this._oscParser=this.register(new c.OscParser),this._dcsParser=this.register(new m.DcsParser),this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:"\\"},(()=>!0))}_identifier(v,y=[64,126]){let E=0;if(v.prefix){if(v.prefix.length>1)throw new Error("only one byte as prefix supported");if(E=v.prefix.charCodeAt(0),E&&60>E||E>63)throw new Error("prefix must be in range 0x3c .. 0x3f")}if(v.intermediates){if(v.intermediates.length>2)throw new Error("only two bytes as intermediates are supported");for(let w=0;w<v.intermediates.length;++w){const A=v.intermediates.charCodeAt(w);if(32>A||A>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");E<<=8,E|=A}}if(v.final.length!==1)throw new Error("final must be a single byte");const C=v.final.charCodeAt(0);if(y[0]>C||C>y[1])throw new Error(`final must be in range ${y[0]} .. ${y[1]}`);return E<<=8,E|=C,E}identToString(v){const y=[];for(;v;)y.push(String.fromCharCode(255&v)),v>>=8;return y.reverse().join("")}setPrintHandler(v){this._printHandler=v}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(v,y){const E=this._identifier(v,[48,126]);this._escHandlers[E]===void 0&&(this._escHandlers[E]=[]);const C=this._escHandlers[E];return C.push(y),{dispose:()=>{const w=C.indexOf(y);w!==-1&&C.splice(w,1)}}}clearEscHandler(v){this._escHandlers[this._identifier(v,[48,126])]&&delete this._escHandlers[this._identifier(v,[48,126])]}setEscHandlerFallback(v){this._escHandlerFb=v}setExecuteHandler(v,y){this._executeHandlers[v.charCodeAt(0)]=y}clearExecuteHandler(v){this._executeHandlers[v.charCodeAt(0)]&&delete this._executeHandlers[v.charCodeAt(0)]}setExecuteHandlerFallback(v){this._executeHandlerFb=v}registerCsiHandler(v,y){const E=this._identifier(v);this._csiHandlers[E]===void 0&&(this._csiHandlers[E]=[]);const C=this._csiHandlers[E];return C.push(y),{dispose:()=>{const w=C.indexOf(y);w!==-1&&C.splice(w,1)}}}clearCsiHandler(v){this._csiHandlers[this._identifier(v)]&&delete this._csiHandlers[this._identifier(v)]}setCsiHandlerFallback(v){this._csiHandlerFb=v}registerDcsHandler(v,y){return this._dcsParser.registerHandler(this._identifier(v),y)}clearDcsHandler(v){this._dcsParser.clearHandler(this._identifier(v))}setDcsHandlerFallback(v){this._dcsParser.setHandlerFallback(v)}registerOscHandler(v,y){return this._oscParser.registerHandler(v,y)}clearOscHandler(v){this._oscParser.clearHandler(v)}setOscHandlerFallback(v){this._oscParser.setHandlerFallback(v)}setErrorHandler(v){this._errorHandler=v}clearErrorHandler(){this._errorHandler=this._errorHandlerFb}reset(){this.currentState=this.initialState,this._oscParser.reset(),this._dcsParser.reset(),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._parseStack.state!==0&&(this._parseStack.state=2,this._parseStack.handlers=[])}_preserveStack(v,y,E,C,w){this._parseStack.state=v,this._parseStack.handlers=y,this._parseStack.handlerPos=E,this._parseStack.transition=C,this._parseStack.chunkPos=w}parse(v,y,E){let C,w=0,A=0,O=0;if(this._parseStack.state)if(this._parseStack.state===2)this._parseStack.state=0,O=this._parseStack.chunkPos+1;else{if(E===void 0||this._parseStack.state===1)throw this._parseStack.state=1,new Error("improper continuation due to previous async handler, giving up parsing");const R=this._parseStack.handlers;let N=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(E===!1&&N>-1){for(;N>=0&&(C=R[N](this._params),C!==!0);N--)if(C instanceof Promise)return this._parseStack.handlerPos=N,C}this._parseStack.handlers=[];break;case 4:if(E===!1&&N>-1){for(;N>=0&&(C=R[N](),C!==!0);N--)if(C instanceof Promise)return this._parseStack.handlerPos=N,C}this._parseStack.handlers=[];break;case 6:if(w=v[this._parseStack.chunkPos],C=this._dcsParser.unhook(w!==24&&w!==26,E),C)return C;w===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(w=v[this._parseStack.chunkPos],C=this._oscParser.end(w!==24&&w!==26,E),C)return C;w===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0}this._parseStack.state=0,O=this._parseStack.chunkPos+1,this.precedingJoinState=0,this.currentState=15&this._parseStack.transition}for(let R=O;R<y;++R){switch(w=v[R],A=this._transitions.table[this.currentState<<8|(w<160?w:_)],A>>4){case 2:for(let M=R+1;;++M){if(M>=y||(w=v[M])<32||w>126&&w<_){this._printHandler(v,R,M),R=M-1;break}if(++M>=y||(w=v[M])<32||w>126&&w<_){this._printHandler(v,R,M),R=M-1;break}if(++M>=y||(w=v[M])<32||w>126&&w<_){this._printHandler(v,R,M),R=M-1;break}if(++M>=y||(w=v[M])<32||w>126&&w<_){this._printHandler(v,R,M),R=M-1;break}}break;case 3:this._executeHandlers[w]?this._executeHandlers[w]():this._executeHandlerFb(w),this.precedingJoinState=0;break;case 0:break;case 1:if(this._errorHandler({position:R,code:w,currentState:this.currentState,collect:this._collect,params:this._params,abort:!1}).abort)return;break;case 7:const N=this._csiHandlers[this._collect<<8|w];let D=N?N.length-1:-1;for(;D>=0&&(C=N[D](this._params),C!==!0);D--)if(C instanceof Promise)return this._preserveStack(3,N,D,A,R),C;D<0&&this._csiHandlerFb(this._collect<<8|w,this._params),this.precedingJoinState=0;break;case 8:do switch(w){case 59:this._params.addParam(0);break;case 58:this._params.addSubParam(-1);break;default:this._params.addDigit(w-48)}while(++R<y&&(w=v[R])>47&&w<60);R--;break;case 9:this._collect<<=8,this._collect|=w;break;case 10:const L=this._escHandlers[this._collect<<8|w];let U=L?L.length-1:-1;for(;U>=0&&(C=L[U](),C!==!0);U--)if(C instanceof Promise)return this._preserveStack(4,L,U,A,R),C;U<0&&this._escHandlerFb(this._collect<<8|w),this.precedingJoinState=0;break;case 11:this._params.reset(),this._params.addParam(0),this._collect=0;break;case 12:this._dcsParser.hook(this._collect<<8|w,this._params);break;case 13:for(let M=R+1;;++M)if(M>=y||(w=v[M])===24||w===26||w===27||w>127&&w<_){this._dcsParser.put(v,R,M),R=M-1;break}break;case 14:if(C=this._dcsParser.unhook(w!==24&&w!==26),C)return this._preserveStack(6,[],0,A,R),C;w===27&&(A|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0;break;case 4:this._oscParser.start();break;case 5:for(let M=R+1;;M++)if(M>=y||(w=v[M])<32||w>127&&w<_){this._oscParser.put(v,R,M),R=M-1;break}break;case 6:if(C=this._oscParser.end(w!==24&&w!==26),C)return this._preserveStack(5,[],0,A,R),C;w===27&&(A|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0}this.currentState=15&A}}}o.EscapeSequenceParser=x},6242:(s,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.OscHandler=o.OscParser=void 0;const u=l(5770),d=l(482),c=[];o.OscParser=class{constructor(){this._state=0,this._active=c,this._id=-1,this._handlers=Object.create(null),this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}registerHandler(m,g){this._handlers[m]===void 0&&(this._handlers[m]=[]);const _=this._handlers[m];return _.push(g),{dispose:()=>{const x=_.indexOf(g);x!==-1&&_.splice(x,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=c}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=c,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||c,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,g,_){if(this._active.length)for(let x=this._active.length-1;x>=0;x--)this._active[x].put(m,g,_);else this._handlerFb(this._id,"PUT",(0,d.utf32ToString)(m,g,_))}start(){this.reset(),this._state=1}put(m,g,_){if(this._state!==3){if(this._state===1)for(;g<_;){const x=m[g++];if(x===59){this._state=2,this._start();break}if(x<48||57<x)return void(this._state=3);this._id===-1&&(this._id=0),this._id=10*this._id+x-48}this._state===2&&_-g>0&&this._put(m,g,_)}}end(m,g=!0){if(this._state!==0){if(this._state!==3)if(this._state===1&&this._start(),this._active.length){let _=!1,x=this._active.length-1,b=!1;if(this._stack.paused&&(x=this._stack.loopPosition-1,_=g,b=this._stack.fallThrough,this._stack.paused=!1),!b&&_===!1){for(;x>=0&&(_=this._active[x].end(m),_!==!0);x--)if(_ instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=x,this._stack.fallThrough=!1,_;x--}for(;x>=0;x--)if(_=this._active[x].end(!1),_ instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=x,this._stack.fallThrough=!0,_}else this._handlerFb(this._id,"END",m);this._active=c,this._id=-1,this._state=0}}},o.OscHandler=class{constructor(m){this._handler=m,this._data="",this._hitLimit=!1}start(){this._data="",this._hitLimit=!1}put(m,g,_){this._hitLimit||(this._data+=(0,d.utf32ToString)(m,g,_),this._data.length>u.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}end(m){let g=!1;if(this._hitLimit)g=!1;else if(m&&(g=this._handler(this._data),g instanceof Promise))return g.then((_=>(this._data="",this._hitLimit=!1,_)));return this._data="",this._hitLimit=!1,g}}},8742:(s,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.Params=void 0;const l=2147483647;class u{static fromArray(c){const m=new u;if(!c.length)return m;for(let g=Array.isArray(c[0])?1:0;g<c.length;++g){const _=c[g];if(Array.isArray(_))for(let x=0;x<_.length;++x)m.addSubParam(_[x]);else m.addParam(_)}return m}constructor(c=32,m=32){if(this.maxLength=c,this.maxSubParamsLength=m,m>256)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(c),this.length=0,this._subParams=new Int32Array(m),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(c),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}clone(){const c=new u(this.maxLength,this.maxSubParamsLength);return c.params.set(this.params),c.length=this.length,c._subParams.set(this._subParams),c._subParamsLength=this._subParamsLength,c._subParamsIdx.set(this._subParamsIdx),c._rejectDigits=this._rejectDigits,c._rejectSubDigits=this._rejectSubDigits,c._digitIsSub=this._digitIsSub,c}toArray(){const c=[];for(let m=0;m<this.length;++m){c.push(this.params[m]);const g=this._subParamsIdx[m]>>8,_=255&this._subParamsIdx[m];_-g>0&&c.push(Array.prototype.slice.call(this._subParams,g,_))}return c}reset(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}addParam(c){if(this._digitIsSub=!1,this.length>=this.maxLength)this._rejectDigits=!0;else{if(c<-1)throw new Error("values lesser than -1 are not allowed");this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=c>l?l:c}}addSubParam(c){if(this._digitIsSub=!0,this.length)if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength)this._rejectSubDigits=!0;else{if(c<-1)throw new Error("values lesser than -1 are not allowed");this._subParams[this._subParamsLength++]=c>l?l:c,this._subParamsIdx[this.length-1]++}}hasSubParams(c){return(255&this._subParamsIdx[c])-(this._subParamsIdx[c]>>8)>0}getSubParams(c){const m=this._subParamsIdx[c]>>8,g=255&this._subParamsIdx[c];return g-m>0?this._subParams.subarray(m,g):null}getSubParamsAll(){const c={};for(let m=0;m<this.length;++m){const g=this._subParamsIdx[m]>>8,_=255&this._subParamsIdx[m];_-g>0&&(c[m]=this._subParams.slice(g,_))}return c}addDigit(c){let m;if(this._rejectDigits||!(m=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;const g=this._digitIsSub?this._subParams:this.params,_=g[m-1];g[m-1]=~_?Math.min(10*_+c,l):c}}o.Params=u},5741:(s,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.AddonManager=void 0,o.AddonManager=class{constructor(){this._addons=[]}dispose(){for(let l=this._addons.length-1;l>=0;l--)this._addons[l].instance.dispose()}loadAddon(l,u){const d={instance:u,dispose:u.dispose,isDisposed:!1};this._addons.push(d),u.dispose=()=>this._wrappedAddonDispose(d),u.activate(l)}_wrappedAddonDispose(l){if(l.isDisposed)return;let u=-1;for(let d=0;d<this._addons.length;d++)if(this._addons[d]===l){u=d;break}if(u===-1)throw new Error("Could not dispose an addon that has not been loaded");l.isDisposed=!0,l.dispose.apply(l.instance),this._addons.splice(u,1)}}},8771:(s,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.BufferApiView=void 0;const u=l(3785),d=l(511);o.BufferApiView=class{constructor(c,m){this._buffer=c,this.type=m}init(c){return this._buffer=c,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(c){const m=this._buffer.lines.get(c);if(m)return new u.BufferLineApiView(m)}getNullCell(){return new d.CellData}}},3785:(s,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.BufferLineApiView=void 0;const u=l(511);o.BufferLineApiView=class{constructor(d){this._line=d}get isWrapped(){return this._line.isWrapped}get length(){return this._line.length}getCell(d,c){if(!(d<0||d>=this._line.length))return c?(this._line.loadCell(d,c),c):this._line.loadCell(d,new u.CellData)}translateToString(d,c,m){return this._line.translateToString(d,c,m)}}},8285:(s,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.BufferNamespaceApi=void 0;const u=l(8771),d=l(8460),c=l(844);class m extends c.Disposable{constructor(_){super(),this._core=_,this._onBufferChange=this.register(new d.EventEmitter),this.onBufferChange=this._onBufferChange.event,this._normal=new u.BufferApiView(this._core.buffers.normal,"normal"),this._alternate=new u.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)}}o.BufferNamespaceApi=m},7975:(s,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.ParserApi=void 0,o.ParserApi=class{constructor(l){this._core=l}registerCsiHandler(l,u){return this._core.registerCsiHandler(l,(d=>u(d.toArray())))}addCsiHandler(l,u){return this.registerCsiHandler(l,u)}registerDcsHandler(l,u){return this._core.registerDcsHandler(l,((d,c)=>u(d,c.toArray())))}addDcsHandler(l,u){return this.registerDcsHandler(l,u)}registerEscHandler(l,u){return this._core.registerEscHandler(l,u)}addEscHandler(l,u){return this.registerEscHandler(l,u)}registerOscHandler(l,u){return this._core.registerOscHandler(l,u)}addOscHandler(l,u){return this.registerOscHandler(l,u)}}},7090:(s,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.UnicodeApi=void 0,o.UnicodeApi=class{constructor(l){this._core=l}register(l){this._core.unicodeService.register(l)}get versions(){return this._core.unicodeService.versions}get activeVersion(){return this._core.unicodeService.activeVersion}set activeVersion(l){this._core.unicodeService.activeVersion=l}}},744:function(s,o,l){var u=this&&this.__decorate||function(b,v,y,E){var C,w=arguments.length,A=w<3?v:E===null?E=Object.getOwnPropertyDescriptor(v,y):E;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")A=Reflect.decorate(b,v,y,E);else for(var O=b.length-1;O>=0;O--)(C=b[O])&&(A=(w<3?C(A):w>3?C(v,y,A):C(v,y))||A);return w>3&&A&&Object.defineProperty(v,y,A),A},d=this&&this.__param||function(b,v){return function(y,E){v(y,E,b)}};Object.defineProperty(o,"__esModule",{value:!0}),o.BufferService=o.MINIMUM_ROWS=o.MINIMUM_COLS=void 0;const c=l(8460),m=l(844),g=l(5295),_=l(2585);o.MINIMUM_COLS=2,o.MINIMUM_ROWS=1;let x=o.BufferService=class extends m.Disposable{get buffer(){return this.buffers.active}constructor(b){super(),this.isUserScrolling=!1,this._onResize=this.register(new c.EventEmitter),this.onResize=this._onResize.event,this._onScroll=this.register(new c.EventEmitter),this.onScroll=this._onScroll.event,this.cols=Math.max(b.rawOptions.cols||0,o.MINIMUM_COLS),this.rows=Math.max(b.rawOptions.rows||0,o.MINIMUM_ROWS),this.buffers=this.register(new g.BufferSet(b,this))}resize(b,v){this.cols=b,this.rows=v,this.buffers.resize(b,v),this._onResize.fire({cols:b,rows:v})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(b,v=!1){const y=this.buffer;let E;E=this._cachedBlankLine,E&&E.length===this.cols&&E.getFg(0)===b.fg&&E.getBg(0)===b.bg||(E=y.getBlankLine(b,v),this._cachedBlankLine=E),E.isWrapped=v;const C=y.ybase+y.scrollTop,w=y.ybase+y.scrollBottom;if(y.scrollTop===0){const A=y.lines.isFull;w===y.lines.length-1?A?y.lines.recycle().copyFrom(E):y.lines.push(E.clone()):y.lines.splice(w+1,0,E.clone()),A?this.isUserScrolling&&(y.ydisp=Math.max(y.ydisp-1,0)):(y.ybase++,this.isUserScrolling||y.ydisp++)}else{const A=w-C+1;y.lines.shiftElements(C+1,A-1,-1),y.lines.set(w,E.clone())}this.isUserScrolling||(y.ydisp=y.ybase),this._onScroll.fire(y.ydisp)}scrollLines(b,v,y){const E=this.buffer;if(b<0){if(E.ydisp===0)return;this.isUserScrolling=!0}else b+E.ydisp>=E.ybase&&(this.isUserScrolling=!1);const C=E.ydisp;E.ydisp=Math.max(Math.min(E.ydisp+b,E.ybase),0),C!==E.ydisp&&(v||this._onScroll.fire(E.ydisp))}};o.BufferService=x=u([d(0,_.IOptionsService)],x)},7994:(s,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.CharsetService=void 0,o.CharsetService=class{constructor(){this.glevel=0,this._charsets=[]}reset(){this.charset=void 0,this._charsets=[],this.glevel=0}setgLevel(l){this.glevel=l,this.charset=this._charsets[l]}setgCharset(l,u){this._charsets[l]=u,this.glevel===l&&(this.charset=u)}}},1753:function(s,o,l){var u=this&&this.__decorate||function(E,C,w,A){var O,R=arguments.length,N=R<3?C:A===null?A=Object.getOwnPropertyDescriptor(C,w):A;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")N=Reflect.decorate(E,C,w,A);else for(var D=E.length-1;D>=0;D--)(O=E[D])&&(N=(R<3?O(N):R>3?O(C,w,N):O(C,w))||N);return R>3&&N&&Object.defineProperty(C,w,N),N},d=this&&this.__param||function(E,C){return function(w,A){C(w,A,E)}};Object.defineProperty(o,"__esModule",{value:!0}),o.CoreMouseService=void 0;const c=l(2585),m=l(8460),g=l(844),_={NONE:{events:0,restrict:()=>!1},X10:{events:1,restrict:E=>E.button!==4&&E.action===1&&(E.ctrl=!1,E.alt=!1,E.shift=!1,!0)},VT200:{events:19,restrict:E=>E.action!==32},DRAG:{events:23,restrict:E=>E.action!==32||E.button!==3},ANY:{events:31,restrict:E=>!0}};function x(E,C){let w=(E.ctrl?16:0)|(E.shift?4:0)|(E.alt?8:0);return E.button===4?(w|=64,w|=E.action):(w|=3&E.button,4&E.button&&(w|=64),8&E.button&&(w|=128),E.action===32?w|=32:E.action!==0||C||(w|=3)),w}const b=String.fromCharCode,v={DEFAULT:E=>{const C=[x(E,!1)+32,E.col+32,E.row+32];return C[0]>255||C[1]>255||C[2]>255?"":`\x1B[M${b(C[0])}${b(C[1])}${b(C[2])}`},SGR:E=>{const C=E.action===0&&E.button!==4?"m":"M";return`\x1B[<${x(E,!0)};${E.col};${E.row}${C}`},SGR_PIXELS:E=>{const C=E.action===0&&E.button!==4?"m":"M";return`\x1B[<${x(E,!0)};${E.x};${E.y}${C}`}};let y=o.CoreMouseService=class extends g.Disposable{constructor(E,C){super(),this._bufferService=E,this._coreService=C,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 w of Object.keys(_))this.addProtocol(w,_[w]);for(const w of Object.keys(v))this.addEncoding(w,v[w]);this.reset()}addProtocol(E,C){this._protocols[E]=C}addEncoding(E,C){this._encodings[E]=C}get activeProtocol(){return this._activeProtocol}get areMouseEventsActive(){return this._protocols[this._activeProtocol].events!==0}set activeProtocol(E){if(!this._protocols[E])throw new Error(`unknown protocol "${E}"`);this._activeProtocol=E,this._onProtocolChange.fire(this._protocols[E].events)}get activeEncoding(){return this._activeEncoding}set activeEncoding(E){if(!this._encodings[E])throw new Error(`unknown encoding "${E}"`);this._activeEncoding=E}reset(){this.activeProtocol="NONE",this.activeEncoding="DEFAULT",this._lastEvent=null}triggerMouseEvent(E){if(E.col<0||E.col>=this._bufferService.cols||E.row<0||E.row>=this._bufferService.rows||E.button===4&&E.action===32||E.button===3&&E.action!==32||E.button!==4&&(E.action===2||E.action===3)||(E.col++,E.row++,E.action===32&&this._lastEvent&&this._equalEvents(this._lastEvent,E,this._activeEncoding==="SGR_PIXELS"))||!this._protocols[this._activeProtocol].restrict(E))return!1;const C=this._encodings[this._activeEncoding](E);return C&&(this._activeEncoding==="DEFAULT"?this._coreService.triggerBinaryEvent(C):this._coreService.triggerDataEvent(C,!0)),this._lastEvent=E,!0}explainEvents(E){return{down:!!(1&E),up:!!(2&E),drag:!!(4&E),move:!!(8&E),wheel:!!(16&E)}}_equalEvents(E,C,w){if(w){if(E.x!==C.x||E.y!==C.y)return!1}else if(E.col!==C.col||E.row!==C.row)return!1;return E.button===C.button&&E.action===C.action&&E.ctrl===C.ctrl&&E.alt===C.alt&&E.shift===C.shift}};o.CoreMouseService=y=u([d(0,c.IBufferService),d(1,c.ICoreService)],y)},6975:function(s,o,l){var u=this&&this.__decorate||function(y,E,C,w){var A,O=arguments.length,R=O<3?E:w===null?w=Object.getOwnPropertyDescriptor(E,C):w;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")R=Reflect.decorate(y,E,C,w);else for(var N=y.length-1;N>=0;N--)(A=y[N])&&(R=(O<3?A(R):O>3?A(E,C,R):A(E,C))||R);return O>3&&R&&Object.defineProperty(E,C,R),R},d=this&&this.__param||function(y,E){return function(C,w){E(C,w,y)}};Object.defineProperty(o,"__esModule",{value:!0}),o.CoreService=void 0;const c=l(1439),m=l(8460),g=l(844),_=l(2585),x=Object.freeze({insertMode:!1}),b=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,origin:!1,reverseWraparound:!1,sendFocus:!1,wraparound:!0});let v=o.CoreService=class extends g.Disposable{constructor(y,E,C){super(),this._bufferService=y,this._logService=E,this._optionsService=C,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,c.clone)(x),this.decPrivateModes=(0,c.clone)(b)}reset(){this.modes=(0,c.clone)(x),this.decPrivateModes=(0,c.clone)(b)}triggerDataEvent(y,E=!1){if(this._optionsService.rawOptions.disableStdin)return;const C=this._bufferService.buffer;E&&this._optionsService.rawOptions.scrollOnUserInput&&C.ybase!==C.ydisp&&this._onRequestScrollToBottom.fire(),E&&this._onUserInput.fire(),this._logService.debug(`sending data "${y}"`,(()=>y.split("").map((w=>w.charCodeAt(0))))),this._onData.fire(y)}triggerBinaryEvent(y){this._optionsService.rawOptions.disableStdin||(this._logService.debug(`sending binary "${y}"`,(()=>y.split("").map((E=>E.charCodeAt(0))))),this._onBinary.fire(y))}};o.CoreService=v=u([d(0,_.IBufferService),d(1,_.ILogService),d(2,_.IOptionsService)],v)},9074:(s,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.DecorationService=void 0;const u=l(8055),d=l(8460),c=l(844),m=l(6106);let g=0,_=0;class x extends c.Disposable{get decorations(){return this._decorations.values()}constructor(){super(),this._decorations=new m.SortedList((y=>y?.marker.line)),this._onDecorationRegistered=this.register(new d.EventEmitter),this.onDecorationRegistered=this._onDecorationRegistered.event,this._onDecorationRemoved=this.register(new d.EventEmitter),this.onDecorationRemoved=this._onDecorationRemoved.event,this.register((0,c.toDisposable)((()=>this.reset())))}registerDecoration(y){if(y.marker.isDisposed)return;const E=new b(y);if(E){const C=E.marker.onDispose((()=>E.dispose()));E.onDispose((()=>{E&&(this._decorations.delete(E)&&this._onDecorationRemoved.fire(E),C.dispose())})),this._decorations.insert(E),this._onDecorationRegistered.fire(E)}return E}reset(){for(const y of this._decorations.values())y.dispose();this._decorations.clear()}*getDecorationsAtCell(y,E,C){let w=0,A=0;for(const O of this._decorations.getKeyIterator(E))w=O.options.x??0,A=w+(O.options.width??1),y>=w&&y<A&&(!C||(O.options.layer??"bottom")===C)&&(yield O)}forEachDecorationAtCell(y,E,C,w){this._decorations.forEachByKey(E,(A=>{g=A.options.x??0,_=g+(A.options.width??1),y>=g&&y<_&&(!C||(A.options.layer??"bottom")===C)&&w(A)}))}}o.DecorationService=x;class b extends c.Disposable{get isDisposed(){return this._isDisposed}get backgroundColorRGB(){return this._cachedBg===null&&(this.options.backgroundColor?this._cachedBg=u.css.toColor(this.options.backgroundColor):this._cachedBg=void 0),this._cachedBg}get foregroundColorRGB(){return this._cachedFg===null&&(this.options.foregroundColor?this._cachedFg=u.css.toColor(this.options.foregroundColor):this._cachedFg=void 0),this._cachedFg}constructor(y){super(),this.options=y,this.onRenderEmitter=this.register(new d.EventEmitter),this.onRender=this.onRenderEmitter.event,this._onDispose=this.register(new d.EventEmitter),this.onDispose=this._onDispose.event,this._cachedBg=null,this._cachedFg=null,this.marker=y.marker,this.options.overviewRulerOptions&&!this.options.overviewRulerOptions.position&&(this.options.overviewRulerOptions.position="full")}dispose(){this._onDispose.fire(),super.dispose()}}},4348:(s,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.InstantiationService=o.ServiceCollection=void 0;const u=l(2585),d=l(8343);class c{constructor(...g){this._entries=new Map;for(const[_,x]of g)this.set(_,x)}set(g,_){const x=this._entries.get(g);return this._entries.set(g,_),x}forEach(g){for(const[_,x]of this._entries.entries())g(_,x)}has(g){return this._entries.has(g)}get(g){return this._entries.get(g)}}o.ServiceCollection=c,o.InstantiationService=class{constructor(){this._services=new c,this._services.set(u.IInstantiationService,this)}setService(m,g){this._services.set(m,g)}getService(m){return this._services.get(m)}createInstance(m,...g){const _=(0,d.getServiceDependencies)(m).sort(((v,y)=>v.index-y.index)),x=[];for(const v of _){const y=this._services.get(v.id);if(!y)throw new Error(`[createInstance] ${m.name} depends on UNKNOWN service ${v.id}.`);x.push(y)}const b=_.length>0?_[0].index:g.length;if(g.length!==b)throw new Error(`[createInstance] First service dependency of ${m.name} at position ${b+1} conflicts with ${g.length} static arguments`);return new m(...g,...x)}}},7866:function(s,o,l){var u=this&&this.__decorate||function(b,v,y,E){var C,w=arguments.length,A=w<3?v:E===null?E=Object.getOwnPropertyDescriptor(v,y):E;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")A=Reflect.decorate(b,v,y,E);else for(var O=b.length-1;O>=0;O--)(C=b[O])&&(A=(w<3?C(A):w>3?C(v,y,A):C(v,y))||A);return w>3&&A&&Object.defineProperty(v,y,A),A},d=this&&this.__param||function(b,v){return function(y,E){v(y,E,b)}};Object.defineProperty(o,"__esModule",{value:!0}),o.traceCall=o.setTraceLogger=o.LogService=void 0;const c=l(844),m=l(2585),g={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 _,x=o.LogService=class extends c.Disposable{get logLevel(){return this._logLevel}constructor(b){super(),this._optionsService=b,this._logLevel=m.LogLevelEnum.OFF,this._updateLogLevel(),this.register(this._optionsService.onSpecificOptionChange("logLevel",(()=>this._updateLogLevel()))),_=this}_updateLogLevel(){this._logLevel=g[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(b){for(let v=0;v<b.length;v++)typeof b[v]=="function"&&(b[v]=b[v]())}_log(b,v,y){this._evalLazyOptionalParams(y),b.call(console,(this._optionsService.options.logger?"":"xterm.js: ")+v,...y)}trace(b,...v){this._logLevel<=m.LogLevelEnum.TRACE&&this._log(this._optionsService.options.logger?.trace.bind(this._optionsService.options.logger)??console.log,b,v)}debug(b,...v){this._logLevel<=m.LogLevelEnum.DEBUG&&this._log(this._optionsService.options.logger?.debug.bind(this._optionsService.options.logger)??console.log,b,v)}info(b,...v){this._logLevel<=m.LogLevelEnum.INFO&&this._log(this._optionsService.options.logger?.info.bind(this._optionsService.options.logger)??console.info,b,v)}warn(b,...v){this._logLevel<=m.LogLevelEnum.WARN&&this._log(this._optionsService.options.logger?.warn.bind(this._optionsService.options.logger)??console.warn,b,v)}error(b,...v){this._logLevel<=m.LogLevelEnum.ERROR&&this._log(this._optionsService.options.logger?.error.bind(this._optionsService.options.logger)??console.error,b,v)}};o.LogService=x=u([d(0,m.IOptionsService)],x),o.setTraceLogger=function(b){_=b},o.traceCall=function(b,v,y){if(typeof y.value!="function")throw new Error("not supported");const E=y.value;y.value=function(...C){if(_.logLevel!==m.LogLevelEnum.TRACE)return E.apply(this,C);_.trace(`GlyphRenderer#${E.name}(${C.map((A=>JSON.stringify(A))).join(", ")})`);const w=E.apply(this,C);return _.trace(`GlyphRenderer#${E.name} return`,w),w}}},7302:(s,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.OptionsService=o.DEFAULT_OPTIONS=void 0;const u=l(8460),d=l(844),c=l(6114);o.DEFAULT_OPTIONS={cols:80,rows:24,cursorBlink:!1,cursorStyle:"block",cursorWidth:1,cursorInactiveStyle:"outline",customGlyphs:!0,drawBoldTextInBrightColors:!0,documentOverride:null,fastScrollModifier:"alt",fastScrollSensitivity:5,fontFamily:"courier-new, courier, monospace",fontSize:15,fontWeight:"normal",fontWeightBold:"bold",ignoreBracketedPasteMode:!1,lineHeight:1,letterSpacing:0,linkHandler:null,logLevel:"info",logger:null,scrollback:1e3,scrollOnUserInput:!0,scrollSensitivity:1,screenReaderMode:!1,smoothScrollDuration:0,macOptionIsMeta:!1,macOptionClickForcesSelection:!1,minimumContrastRatio:1,disableStdin:!1,allowProposedApi:!1,allowTransparency:!1,tabStopWidth:8,theme:{},rescaleOverlappingGlyphs:!1,rightClickSelectsWord:c.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 g extends d.Disposable{constructor(x){super(),this._onOptionChange=this.register(new u.EventEmitter),this.onOptionChange=this._onOptionChange.event;const b={...o.DEFAULT_OPTIONS};for(const v in x)if(v in b)try{const y=x[v];b[v]=this._sanitizeAndValidateOption(v,y)}catch(y){console.error(y)}this.rawOptions=b,this.options={...b},this._setupOptions(),this.register((0,d.toDisposable)((()=>{this.rawOptions.linkHandler=null,this.rawOptions.documentOverride=null})))}onSpecificOptionChange(x,b){return this.onOptionChange((v=>{v===x&&b(this.rawOptions[x])}))}onMultipleOptionChange(x,b){return this.onOptionChange((v=>{x.indexOf(v)!==-1&&b()}))}_setupOptions(){const x=v=>{if(!(v in o.DEFAULT_OPTIONS))throw new Error(`No option with key "${v}"`);return this.rawOptions[v]},b=(v,y)=>{if(!(v in o.DEFAULT_OPTIONS))throw new Error(`No option with key "${v}"`);y=this._sanitizeAndValidateOption(v,y),this.rawOptions[v]!==y&&(this.rawOptions[v]=y,this._onOptionChange.fire(v))};for(const v in this.rawOptions){const y={get:x.bind(this,v),set:b.bind(this,v)};Object.defineProperty(this.options,v,y)}}_sanitizeAndValidateOption(x,b){switch(x){case"cursorStyle":if(b||(b=o.DEFAULT_OPTIONS[x]),!(function(v){return v==="block"||v==="underline"||v==="bar"})(b))throw new Error(`"${b}" is not a valid value for ${x}`);break;case"wordSeparator":b||(b=o.DEFAULT_OPTIONS[x]);break;case"fontWeight":case"fontWeightBold":if(typeof b=="number"&&1<=b&&b<=1e3)break;b=m.includes(b)?b:o.DEFAULT_OPTIONS[x];break;case"cursorWidth":b=Math.floor(b);case"lineHeight":case"tabStopWidth":if(b<1)throw new Error(`${x} cannot be less than 1, value: ${b}`);break;case"minimumContrastRatio":b=Math.max(1,Math.min(21,Math.round(10*b)/10));break;case"scrollback":if((b=Math.min(b,4294967295))<0)throw new Error(`${x} cannot be less than 0, value: ${b}`);break;case"fastScrollSensitivity":case"scrollSensitivity":if(b<=0)throw new Error(`${x} cannot be less than or equal to 0, value: ${b}`);break;case"rows":case"cols":if(!b&&b!==0)throw new Error(`${x} must be numeric, value: ${b}`);break;case"windowsPty":b=b??{}}return b}}o.OptionsService=g},2660:function(s,o,l){var u=this&&this.__decorate||function(g,_,x,b){var v,y=arguments.length,E=y<3?_:b===null?b=Object.getOwnPropertyDescriptor(_,x):b;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")E=Reflect.decorate(g,_,x,b);else for(var C=g.length-1;C>=0;C--)(v=g[C])&&(E=(y<3?v(E):y>3?v(_,x,E):v(_,x))||E);return y>3&&E&&Object.defineProperty(_,x,E),E},d=this&&this.__param||function(g,_){return function(x,b){_(x,b,g)}};Object.defineProperty(o,"__esModule",{value:!0}),o.OscLinkService=void 0;const c=l(2585);let m=o.OscLinkService=class{constructor(g){this._bufferService=g,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(g){const _=this._bufferService.buffer;if(g.id===void 0){const C=_.addMarker(_.ybase+_.y),w={data:g,id:this._nextId++,lines:[C]};return C.onDispose((()=>this._removeMarkerFromLink(w,C))),this._dataByLinkId.set(w.id,w),w.id}const x=g,b=this._getEntryIdKey(x),v=this._entriesWithId.get(b);if(v)return this.addLineToLink(v.id,_.ybase+_.y),v.id;const y=_.addMarker(_.ybase+_.y),E={id:this._nextId++,key:this._getEntryIdKey(x),data:x,lines:[y]};return y.onDispose((()=>this._removeMarkerFromLink(E,y))),this._entriesWithId.set(E.key,E),this._dataByLinkId.set(E.id,E),E.id}addLineToLink(g,_){const x=this._dataByLinkId.get(g);if(x&&x.lines.every((b=>b.line!==_))){const b=this._bufferService.buffer.addMarker(_);x.lines.push(b),b.onDispose((()=>this._removeMarkerFromLink(x,b)))}}getLinkData(g){return this._dataByLinkId.get(g)?.data}_getEntryIdKey(g){return`${g.id};;${g.uri}`}_removeMarkerFromLink(g,_){const x=g.lines.indexOf(_);x!==-1&&(g.lines.splice(x,1),g.lines.length===0&&(g.data.id!==void 0&&this._entriesWithId.delete(g.key),this._dataByLinkId.delete(g.id)))}};o.OscLinkService=m=u([d(0,c.IBufferService)],m)},8343:(s,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.createDecorator=o.getServiceDependencies=o.serviceRegistry=void 0;const l="di$target",u="di$dependencies";o.serviceRegistry=new Map,o.getServiceDependencies=function(d){return d[u]||[]},o.createDecorator=function(d){if(o.serviceRegistry.has(d))return o.serviceRegistry.get(d);const c=function(m,g,_){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");(function(x,b,v){b[l]===b?b[u].push({id:x,index:v}):(b[u]=[{id:x,index:v}],b[l]=b)})(c,m,_)};return c.toString=()=>d,o.serviceRegistry.set(d,c),c}},2585:(s,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.IDecorationService=o.IUnicodeService=o.IOscLinkService=o.IOptionsService=o.ILogService=o.LogLevelEnum=o.IInstantiationService=o.ICharsetService=o.ICoreService=o.ICoreMouseService=o.IBufferService=void 0;const u=l(8343);var d;o.IBufferService=(0,u.createDecorator)("BufferService"),o.ICoreMouseService=(0,u.createDecorator)("CoreMouseService"),o.ICoreService=(0,u.createDecorator)("CoreService"),o.ICharsetService=(0,u.createDecorator)("CharsetService"),o.IInstantiationService=(0,u.createDecorator)("InstantiationService"),(function(c){c[c.TRACE=0]="TRACE",c[c.DEBUG=1]="DEBUG",c[c.INFO=2]="INFO",c[c.WARN=3]="WARN",c[c.ERROR=4]="ERROR",c[c.OFF=5]="OFF"})(d||(o.LogLevelEnum=d={})),o.ILogService=(0,u.createDecorator)("LogService"),o.IOptionsService=(0,u.createDecorator)("OptionsService"),o.IOscLinkService=(0,u.createDecorator)("OscLinkService"),o.IUnicodeService=(0,u.createDecorator)("UnicodeService"),o.IDecorationService=(0,u.createDecorator)("DecorationService")},1480:(s,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.UnicodeService=void 0;const u=l(8460),d=l(225);class c{static extractShouldJoin(g){return(1&g)!=0}static extractWidth(g){return g>>1&3}static extractCharKind(g){return g>>3}static createPropertyValue(g,_,x=!1){return(16777215&g)<<3|(3&_)<<1|(x?1:0)}constructor(){this._providers=Object.create(null),this._active="",this._onChange=new u.EventEmitter,this.onChange=this._onChange.event;const g=new d.UnicodeV6;this.register(g),this._active=g.version,this._activeProvider=g}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(g){if(!this._providers[g])throw new Error(`unknown Unicode version "${g}"`);this._active=g,this._activeProvider=this._providers[g],this._onChange.fire(g)}register(g){this._providers[g.version]=g}wcwidth(g){return this._activeProvider.wcwidth(g)}getStringCellWidth(g){let _=0,x=0;const b=g.length;for(let v=0;v<b;++v){let y=g.charCodeAt(v);if(55296<=y&&y<=56319){if(++v>=b)return _+this.wcwidth(y);const w=g.charCodeAt(v);56320<=w&&w<=57343?y=1024*(y-55296)+w-56320+65536:_+=this.wcwidth(w)}const E=this.charProperties(y,x);let C=c.extractWidth(E);c.extractShouldJoin(E)&&(C-=c.extractWidth(x)),_+=C,x=E}return _}charProperties(g,_){return this._activeProvider.charProperties(g,_)}}o.UnicodeService=c}},r={};function i(s){var o=r[s];if(o!==void 0)return o.exports;var l=r[s]={exports:{}};return n[s].call(l.exports,l,l.exports,i),l.exports}var a={};return(()=>{var s=a;Object.defineProperty(s,"__esModule",{value:!0}),s.Terminal=void 0;const o=i(9042),l=i(3236),u=i(844),d=i(5741),c=i(8285),m=i(7975),g=i(7090),_=["cols","rows"];class x extends u.Disposable{constructor(v){super(),this._core=this.register(new l.Terminal(v)),this._addonManager=this.register(new d.AddonManager),this._publicOptions={...this._core.options};const y=C=>this._core.options[C],E=(C,w)=>{this._checkReadonlyOptions(C),this._core.options[C]=w};for(const C in this._core.options){const w={get:y.bind(this,C),set:E.bind(this,C)};Object.defineProperty(this._publicOptions,C,w)}}_checkReadonlyOptions(v){if(_.includes(v))throw new Error(`Option "${v}" can only be set in the constructor`)}_checkProposedApi(){if(!this._core.optionsService.rawOptions.allowProposedApi)throw new Error("You must set the allowProposedApi option to true to use proposed API")}get onBell(){return this._core.onBell}get onBinary(){return this._core.onBinary}get onCursorMove(){return this._core.onCursorMove}get onData(){return this._core.onData}get onKey(){return this._core.onKey}get onLineFeed(){return this._core.onLineFeed}get onRender(){return this._core.onRender}get onResize(){return this._core.onResize}get onScroll(){return this._core.onScroll}get onSelectionChange(){return this._core.onSelectionChange}get onTitleChange(){return this._core.onTitleChange}get onWriteParsed(){return this._core.onWriteParsed}get element(){return this._core.element}get parser(){return this._parser||(this._parser=new m.ParserApi(this._core)),this._parser}get unicode(){return this._checkProposedApi(),new g.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 c.BufferNamespaceApi(this._core))),this._buffer}get markers(){return this._checkProposedApi(),this._core.markers}get modes(){const v=this._core.coreService.decPrivateModes;let y="none";switch(this._core.coreMouseService.activeProtocol){case"X10":y="x10";break;case"VT200":y="vt200";break;case"DRAG":y="drag";break;case"ANY":y="any"}return{applicationCursorKeysMode:v.applicationCursorKeys,applicationKeypadMode:v.applicationKeypad,bracketedPasteMode:v.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:y,originMode:v.origin,reverseWraparoundMode:v.reverseWraparound,sendFocusMode:v.sendFocus,wraparoundMode:v.wraparound}}get options(){return this._publicOptions}set options(v){for(const y in v)this._publicOptions[y]=v[y]}blur(){this._core.blur()}focus(){this._core.focus()}input(v,y=!0){this._core.input(v,y)}resize(v,y){this._verifyIntegers(v,y),this._core.resize(v,y)}open(v){this._core.open(v)}attachCustomKeyEventHandler(v){this._core.attachCustomKeyEventHandler(v)}attachCustomWheelEventHandler(v){this._core.attachCustomWheelEventHandler(v)}registerLinkProvider(v){return this._core.registerLinkProvider(v)}registerCharacterJoiner(v){return this._checkProposedApi(),this._core.registerCharacterJoiner(v)}deregisterCharacterJoiner(v){this._checkProposedApi(),this._core.deregisterCharacterJoiner(v)}registerMarker(v=0){return this._verifyIntegers(v),this._core.registerMarker(v)}registerDecoration(v){return this._checkProposedApi(),this._verifyPositiveIntegers(v.x??0,v.width??0,v.height??0),this._core.registerDecoration(v)}hasSelection(){return this._core.hasSelection()}select(v,y,E){this._verifyIntegers(v,y,E),this._core.select(v,y,E)}getSelection(){return this._core.getSelection()}getSelectionPosition(){return this._core.getSelectionPosition()}clearSelection(){this._core.clearSelection()}selectAll(){this._core.selectAll()}selectLines(v,y){this._verifyIntegers(v,y),this._core.selectLines(v,y)}dispose(){super.dispose()}scrollLines(v){this._verifyIntegers(v),this._core.scrollLines(v)}scrollPages(v){this._verifyIntegers(v),this._core.scrollPages(v)}scrollToTop(){this._core.scrollToTop()}scrollToBottom(){this._core.scrollToBottom()}scrollToLine(v){this._verifyIntegers(v),this._core.scrollToLine(v)}clear(){this._core.clear()}write(v,y){this._core.write(v,y)}writeln(v,y){this._core.write(v),this._core.write(`\r
44
44
  `,y)}paste(v){this._core.paste(v)}refresh(v,y){this._verifyIntegers(v,y),this._core.refresh(v,y)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(v){this._addonManager.loadAddon(this,v)}static get strings(){return o}_verifyIntegers(...v){for(const y of v)if(y===1/0||isNaN(y)||y%1!=0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...v){for(const y of v)if(y&&(y===1/0||isNaN(y)||y%1!=0||y<0))throw new Error("This API only accepts positive integers")}}s.Terminal=x})(),a})()))})(EO)),EO.exports}var dle=m3e(),SO={exports:{}},JW;function g3e(){return JW||(JW=1,(function(e,t){(function(n,r){e.exports=r()})(self,(()=>(()=>{var n={};return(()=>{var r=n;Object.defineProperty(r,"__esModule",{value:!0}),r.FitAddon=void 0,r.FitAddon=class{activate(i){this._terminal=i}dispose(){}fit(){const i=this.proposeDimensions();if(!i||!this._terminal||isNaN(i.cols)||isNaN(i.rows))return;const a=this._terminal._core;this._terminal.rows===i.rows&&this._terminal.cols===i.cols||(a._renderService.clear(),this._terminal.resize(i.cols,i.rows))}proposeDimensions(){if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;const i=this._terminal._core,a=i._renderService.dimensions;if(a.css.cell.width===0||a.css.cell.height===0)return;const s=this._terminal.options.scrollback===0?0:i.viewport.scrollBarWidth,o=window.getComputedStyle(this._terminal.element.parentElement),l=parseInt(o.getPropertyValue("height")),u=Math.max(0,parseInt(o.getPropertyValue("width"))),d=window.getComputedStyle(this._terminal.element),c=l-(parseInt(d.getPropertyValue("padding-top"))+parseInt(d.getPropertyValue("padding-bottom"))),m=u-(parseInt(d.getPropertyValue("padding-right"))+parseInt(d.getPropertyValue("padding-left")))-s;return{cols:Math.max(2,Math.floor(m/a.css.cell.width)),rows:Math.max(1,Math.floor(c/a.css.cell.height))}}}})(),n})()))})(SO)),SO.exports}var fle=g3e(),wO={exports:{}},eG;function b3e(){return eG||(eG=1,(function(e,t){(function(n,r){e.exports=r()})(self,(()=>(()=>{var n={6:(s,o)=>{function l(d){try{const c=new URL(d),m=c.password&&c.username?`${c.protocol}//${c.username}:${c.password}@${c.host}`:c.username?`${c.protocol}//${c.username}@${c.host}`:`${c.protocol}//${c.host}`;return d.toLocaleLowerCase().startsWith(m.toLocaleLowerCase())}catch{return!1}}Object.defineProperty(o,"__esModule",{value:!0}),o.LinkComputer=o.WebLinkProvider=void 0,o.WebLinkProvider=class{constructor(d,c,m,g={}){this._terminal=d,this._regex=c,this._handler=m,this._options=g}provideLinks(d,c){const m=u.computeLink(d,this._regex,this._terminal,this._handler);c(this._addCallbacks(m))}_addCallbacks(d){return d.map((c=>(c.leave=this._options.leave,c.hover=(m,g)=>{if(this._options.hover){const{range:_}=c;this._options.hover(m,g,_)}},c)))}};class u{static computeLink(c,m,g,_){const x=new RegExp(m.source,(m.flags||"")+"g"),[b,v]=u._getWindowedLineStrings(c-1,g),y=b.join("");let E;const C=[];for(;E=x.exec(y);){const w=E[0];if(!l(w))continue;const[A,O]=u._mapStrIdx(g,v,0,E.index),[R,N]=u._mapStrIdx(g,A,O,w.length);if(A===-1||O===-1||R===-1||N===-1)continue;const D={start:{x:O+1,y:A+1},end:{x:N,y:R+1}};C.push({range:D,text:w,activate:_})}return C}static _getWindowedLineStrings(c,m){let g,_=c,x=c,b=0,v="";const y=[];if(g=m.buffer.active.getLine(c)){const E=g.translateToString(!0);if(g.isWrapped&&E[0]!==" "){for(b=0;(g=m.buffer.active.getLine(--_))&&b<2048&&(v=g.translateToString(!0),b+=v.length,y.push(v),g.isWrapped&&v.indexOf(" ")===-1););y.reverse()}for(y.push(E),b=0;(g=m.buffer.active.getLine(++x))&&g.isWrapped&&b<2048&&(v=g.translateToString(!0),b+=v.length,y.push(v),v.indexOf(" ")===-1););}return[y,_]}static _mapStrIdx(c,m,g,_){const x=c.buffer.active,b=x.getNullCell();let v=g;for(;_;){const y=x.getLine(m);if(!y)return[-1,-1];for(let E=v;E<y.length;++E){y.getCell(E,b);const C=b.getChars();if(b.getWidth()&&(_-=C.length||1,E===y.length-1&&C==="")){const w=x.getLine(m+1);w&&w.isWrapped&&(w.getCell(0,b),b.getWidth()===2&&(_+=1))}if(_<0)return[m,E]}m++,v=0}return[m,v]}}o.LinkComputer=u}},r={};function i(s){var o=r[s];if(o!==void 0)return o.exports;var l=r[s]={exports:{}};return n[s](l,l.exports,i),l.exports}var a={};return(()=>{var s=a;Object.defineProperty(s,"__esModule",{value:!0}),s.WebLinksAddon=void 0;const o=i(6),l=/(https?|HTTPS?):[/]{2}[^\s"'!*(){}|\\\^<>`]*[^\s"':,.!?{}|\\\^~\[\]`()<>]/;function u(d,c){const m=window.open();if(m){try{m.opener=null}catch{}m.location.href=c}else console.warn("Opening link blocked as opener could not be cleared")}s.WebLinksAddon=class{constructor(d=u,c={}){this._handler=d,this._options=c}activate(d){this._terminal=d;const c=this._options,m=c.urlRegex||l;this._linkProvider=this._terminal.registerLinkProvider(new o.WebLinkProvider(this._terminal,m,this._handler,c))}dispose(){this._linkProvider?.dispose()}}})(),a})()))})(wO)),wO.exports}var ple=b3e();var hle="3.7.8",v3e=hle,Kg=typeof Buffer=="function",tG=typeof TextDecoder=="function"?new TextDecoder:void 0,nG=typeof TextEncoder=="function"?new TextEncoder:void 0,y3e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",$v=Array.prototype.slice.call(y3e),Ux=(e=>{let t={};return e.forEach((n,r)=>t[n]=r),t})($v),_3e=/^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/,Xi=String.fromCharCode.bind(String),rG=typeof Uint8Array.from=="function"?Uint8Array.from.bind(Uint8Array):e=>new Uint8Array(Array.prototype.slice.call(e,0)),mle=e=>e.replace(/=/g,"").replace(/[+\/]/g,t=>t=="+"?"-":"_"),gle=e=>e.replace(/[^A-Za-z0-9\+\/]/g,""),ble=e=>{let t,n,r,i,a="",s=e.length%3;for(let o=0;o<e.length;){if((n=e.charCodeAt(o++))>255||(r=e.charCodeAt(o++))>255||(i=e.charCodeAt(o++))>255)throw new TypeError("invalid character found");t=n<<16|r<<8|i,a+=$v[t>>18&63]+$v[t>>12&63]+$v[t>>6&63]+$v[t&63]}return s?a.slice(0,s-3)+"===".substring(s):a},w5=typeof btoa=="function"?e=>btoa(e):Kg?e=>Buffer.from(e,"binary").toString("base64"):ble,EP=Kg?e=>Buffer.from(e).toString("base64"):e=>{let t=[];for(let n=0,r=e.length;n<r;n+=4096)t.push(Xi.apply(null,e.subarray(n,n+4096)));return w5(t.join(""))},LE=(e,t=!1)=>t?mle(EP(e)):EP(e),x3e=e=>{if(e.length<2){var t=e.charCodeAt(0);return t<128?e:t<2048?Xi(192|t>>>6)+Xi(128|t&63):Xi(224|t>>>12&15)+Xi(128|t>>>6&63)+Xi(128|t&63)}else{var t=65536+(e.charCodeAt(0)-55296)*1024+(e.charCodeAt(1)-56320);return Xi(240|t>>>18&7)+Xi(128|t>>>12&63)+Xi(128|t>>>6&63)+Xi(128|t&63)}},E3e=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,vle=e=>e.replace(E3e,x3e),iG=Kg?e=>Buffer.from(e,"utf8").toString("base64"):nG?e=>EP(nG.encode(e)):e=>w5(vle(e)),xm=(e,t=!1)=>t?mle(iG(e)):iG(e),aG=e=>xm(e,!0),S3e=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,w3e=e=>{switch(e.length){case 4:var t=(7&e.charCodeAt(0))<<18|(63&e.charCodeAt(1))<<12|(63&e.charCodeAt(2))<<6|63&e.charCodeAt(3),n=t-65536;return Xi((n>>>10)+55296)+Xi((n&1023)+56320);case 3:return Xi((15&e.charCodeAt(0))<<12|(63&e.charCodeAt(1))<<6|63&e.charCodeAt(2));default:return Xi((31&e.charCodeAt(0))<<6|63&e.charCodeAt(1))}},yle=e=>e.replace(S3e,w3e),_le=e=>{if(e=e.replace(/\s+/g,""),!_3e.test(e))throw new TypeError("malformed base64.");e+="==".slice(2-(e.length&3));let t,n,r,i=[];for(let a=0;a<e.length;)t=Ux[e.charAt(a++)]<<18|Ux[e.charAt(a++)]<<12|(n=Ux[e.charAt(a++)])<<6|(r=Ux[e.charAt(a++)]),n===64?i.push(Xi(t>>16&255)):r===64?i.push(Xi(t>>16&255,t>>8&255)):i.push(Xi(t>>16&255,t>>8&255,t&255));return i.join("")},C5=typeof atob=="function"?e=>atob(gle(e)):Kg?e=>Buffer.from(e,"base64").toString("binary"):_le,xle=Kg?e=>rG(Buffer.from(e,"base64")):e=>rG(C5(e).split("").map(t=>t.charCodeAt(0))),Ele=e=>xle(Sle(e)),C3e=Kg?e=>Buffer.from(e,"base64").toString("utf8"):tG?e=>tG.decode(xle(e)):e=>yle(C5(e)),Sle=e=>gle(e.replace(/[-_]/g,t=>t=="-"?"+":"/")),SP=e=>C3e(Sle(e)),T3e=e=>{if(typeof e!="string")return!1;let t=e.replace(/\s+/g,"").replace(/={0,2}$/,"");return!/[^\s0-9a-zA-Z\+/]/.test(t)||!/[^\s0-9a-zA-Z\-_]/.test(t)},wle=e=>({value:e,enumerable:!1,writable:!0,configurable:!0}),Cle=function(){let e=(t,n)=>Object.defineProperty(String.prototype,t,wle(n));e("fromBase64",function(){return SP(this)}),e("toBase64",function(t){return xm(this,t)}),e("toBase64URI",function(){return xm(this,!0)}),e("toBase64URL",function(){return xm(this,!0)}),e("toUint8Array",function(){return Ele(this)})},Tle=function(){let e=(t,n)=>Object.defineProperty(Uint8Array.prototype,t,wle(n));e("toBase64",function(t){return LE(this,t)}),e("toBase64URI",function(){return LE(this,!0)}),e("toBase64URL",function(){return LE(this,!0)})},A3e=()=>{Cle(),Tle()},$x={version:hle,VERSION:v3e,atob:C5,atobPolyfill:_le,btoa:w5,btoaPolyfill:ble,fromBase64:SP,toBase64:xm,encode:xm,encodeURI:aG,encodeURL:aG,utob:vle,btou:yle,decode:SP,isValid:T3e,fromUint8Array:LE,toUint8Array:Ele,extendString:Cle,extendUint8Array:Tle,extendBuiltins:A3e},Ale=class{constructor(t=new O3e,n=new k3e){this._base64=t,this._provider=n}activate(t){this._terminal=t,this._disposable=t.parser.registerOscHandler(52,n=>this._setOrReportClipboard(n))}dispose(){return this._disposable?.dispose()}_readText(t,n){let r=this._base64.encodeText(n);this._terminal?.input(`\x1B]52;${t};${r}\x07`,!1)}_setOrReportClipboard(t){let n=t.split(";");if(n.length<2)return!0;let r=n[0],i=n[1];if(i==="?"){let o=this._provider.readText(r);return o instanceof Promise?o.then(l=>(this._readText(r,l),!0)):(this._readText(r,o),!0)}let a="";try{a=this._base64.decodeText(i)}catch{}let s=this._provider.writeText(r,a);return s instanceof Promise?s.then(()=>!0):!0}},k3e=class{async readText(t){return t!=="c"?Promise.resolve(""):navigator.clipboard.readText()}async writeText(t,n){return t!=="c"?Promise.resolve():navigator.clipboard.writeText(n)}},O3e=class{encodeText(e){return $x.encode(e)}decodeText(e){let t=$x.decode(e);return!$x.isValid(e)||$x.encode(t)!==e?"":t}};function iT(){const[e,t]=T.useState(!1);return T.useEffect(()=>{const n=window.matchMedia("(max-width: 639px)");t(n.matches);const r=i=>t(i.matches);return n.addEventListener("change",r),()=>n.removeEventListener("change",r)},[]),e}const R3e=[{label:"Esc",icon:qr,data:"\x1B"},{label:"Up",icon:Ij,data:"\x1B[A"},{label:"Down",icon:jg,data:"\x1B[B"},{label:"Tab",icon:null,data:" "},{label:"Enter",icon:null,data:"\r"}];function IS({onSend:e}){return iT()?p.jsx("div",{className:"flex shrink-0 items-center justify-center gap-2 border-t border-border bg-card px-3 py-2",children:R3e.map(n=>p.jsxs(Be,{variant:"outline",className:"h-11 min-w-11 touch-manipulation",onClick:()=>e(n.data),children:[n.icon?p.jsx(ne,{icon:n.icon,size:20,strokeWidth:2}):p.jsx("span",{className:"text-xs font-medium",children:n.label}),p.jsx("span",{className:"sr-only",children:n.label})]},n.label))}):null}const kle={background:"#faf9f5",foreground:"#2a2a27",cursor:"#2a2a27",cursorAccent:"#faf9f5",selectionBackground:"#d1d5db",black:"#2a2a27",red:"#dd403a",green:"#0d5c63",yellow:"#dd403a",blue:"#0d5c63",magenta:"#5c5c59",cyan:"#0d5c63",white:"#5c5c59",brightBlack:"#5c5c59",brightRed:"#dd403a",brightGreen:"#0d5c63",brightYellow:"#dd403a",brightBlue:"#0d5c63",brightMagenta:"#5c5c59",brightCyan:"#0d5c63",brightWhite:"#5c5c59"},Ole={background:"#0a0a0a",foreground:"#e4e4e7",cursor:"#e4e4e7",cursorAccent:"#0a0a0a",selectionBackground:"#3f3f46",black:"#18181b",red:"#ef4444",green:"#22c55e",yellow:"#eab308",blue:"#3b82f6",magenta:"#a855f7",cyan:"#06b6d4",white:"#e4e4e7",brightBlack:"#52525b",brightRed:"#f87171",brightGreen:"#4ade80",brightYellow:"#facc15",brightBlue:"#60a5fa",brightMagenta:"#c084fc",brightCyan:"#22d3ee",brightWhite:"#fafafa"};function wP({className:e,onReady:t,onResize:n,onContainerReady:r,terminalId:i,setupImagePaste:a,onSend:s,onFocus:o}){const l=T.useRef(null),u=T.useRef(null),d=T.useRef(null),c=T.useRef(null),m=T.useRef(n),g=T.useRef(o),_=T.useRef(t),x=T.useRef(r),{setTerminalFocused:b}=Bj(),{resolvedTheme:v}=Fd(),y=v==="dark",E=y?Ole:kle;T.useEffect(()=>{m.current=n},[n]),T.useEffect(()=>{g.current=o},[o]),T.useEffect(()=>{_.current=t},[t]),T.useEffect(()=>{x.current=r},[r]);const C=T.useCallback(()=>{if(!d.current||!u.current)return;d.current.fit();const{cols:A,rows:O}=u.current;m.current?.(A,O)},[]);T.useEffect(()=>{if(!l.current||u.current)return;const A=new dle.Terminal({cursorBlink:!0,fontSize:14,fontFamily:"monospace",theme:E,scrollback:1e4,rightClickSelectsWord:!0}),O=new fle.FitAddon,R=new ple.WebLinksAddon,N=new Ale;A.loadAddon(O),A.loadAddon(R),A.loadAddon(N),A.open(l.current),u.current=A,d.current=O,c.current=N,requestAnimationFrame(()=>{C(),_.current?.(A),l.current&&x.current?.(l.current)});const D=()=>{b(!0),g.current?.()},L=()=>b(!1);A.textarea&&(A.textarea.addEventListener("focus",D),A.textarea.addEventListener("blur",L));const U=setTimeout(()=>{C(),A.refresh(0,A.rows-1)},100),M=()=>{requestAnimationFrame(C)};window.addEventListener("resize",M);const G=()=>{document.visibilityState==="visible"&&requestAnimationFrame(()=>{C(),A.refresh(0,A.rows-1)})};document.addEventListener("visibilitychange",G);const z=new ResizeObserver(M);z.observe(l.current);const H=new IntersectionObserver(q=>{q[0]?.isIntersecting&&requestAnimationFrame(()=>{C(),A.refresh(0,A.rows-1)})},{threshold:.1});return H.observe(l.current),()=>{clearTimeout(U),window.removeEventListener("resize",M),document.removeEventListener("visibilitychange",G),z.disconnect(),H.disconnect(),A.textarea&&(A.textarea.removeEventListener("focus",D),A.textarea.removeEventListener("blur",L)),b(!1),c.current?.dispose(),c.current=null,A.dispose(),u.current=null,d.current=null}},[C,b]),T.useEffect(()=>!l.current||!i||!a?void 0:a(l.current,i),[i,a]),T.useEffect(()=>{u.current&&(u.current.options.theme=E,u.current.refresh(0,u.current.rows-1))},[E]);const w=T.useCallback(()=>{u.current?.scrollToBottom()},[]);return p.jsxs("div",{className:"flex h-full w-full max-w-full flex-col",children:[p.jsxs("div",{className:"relative min-h-0 flex-1",children:[p.jsx("div",{ref:l,className:$e("h-full w-full max-w-full overflow-hidden p-2 bg-terminal-background",e)}),p.jsx("button",{onClick:w,className:$e("absolute top-2 right-5 p-1 transition-colors",y?"text-white/50 hover:text-white/80":"text-black/50 hover:text-black/80"),children:p.jsx(ne,{icon:_ie,size:20,strokeWidth:2})})]}),p.jsx("div",{className:"h-2 shrink-0 bg-terminal-background"}),s&&p.jsx(IS,{onSend:s})]})}function N3e({name:e,status:t,exitCode:n,className:r,onRename:i}){const[a,s]=T.useState(!1),[o,l]=T.useState(e),u=T.useRef(null);T.useEffect(()=>{a&&u.current&&(u.current.focus(),u.current.select())},[a]);const d=()=>{i&&(l(e),s(!0))},c=()=>{const g=o.trim();g&&g!==e&&i&&i(g),s(!1)},m=g=>{g.key==="Enter"?c():g.key==="Escape"&&s(!1)};return p.jsxs("div",{className:$e("flex h-6 items-center gap-2 border-b border-border bg-card px-2 text-xs",r),children:[p.jsx("span",{className:$e("h-2 w-2 shrink-0 rounded-full",{"bg-accent":t==="running","bg-muted-foreground":t==="exited"&&n===0,"bg-destructive":t==="exited"&&n!==0||t==="error"})}),a?p.jsx("input",{ref:u,type:"text",value:o,onChange:g=>l(g.target.value),onBlur:c,onKeyDown:m,className:"h-4 w-24 rounded border border-border bg-background px-1 text-xs font-medium text-foreground outline-none focus:border-primary"}):p.jsx("span",{className:$e("font-medium text-foreground",i&&"cursor-pointer hover:text-primary"),onDoubleClick:d,title:i?"Double-click to rename":void 0,children:e}),t==="exited"&&n!==void 0&&p.jsxs(p.Fragment,{children:[p.jsx("span",{className:"ml-auto text-muted-foreground",children:"·"}),p.jsxs("span",{className:$e({"text-muted-foreground":n===0,"text-destructive":n!==0}),children:["exit ",n]})]})]})}function up({...e}){return p.jsx(SAe,{"data-slot":"dropdown-menu",...e})}function cp({...e}){return p.jsx(CAe,{"data-slot":"dropdown-menu-trigger",...e})}function dp({align:e="start",alignOffset:t=0,side:n="bottom",sideOffset:r=4,className:i,...a}){return p.jsx(dAe,{children:p.jsx(fAe,{className:"isolate z-50 outline-none",align:e,alignOffset:t,side:n,sideOffset:r,children:p.jsx(uAe,{"data-slot":"dropdown-menu-content",className:$e("data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 data-closed:zoom-out-95 data-open:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 ring-foreground/10 bg-popover text-popover-foreground min-w-32 rounded-lg p-1 shadow-md ring-1 duration-100 z-50 max-h-(--available-height) w-(--anchor-width) origin-(--transform-origin) overflow-x-hidden overflow-y-auto outline-none data-closed:overflow-hidden",i),...a})})})}function dr({className:e,inset:t,variant:n="default",...r}){return p.jsx(oAe,{"data-slot":"dropdown-menu-item","data-inset":t,"data-variant":n,className:$e("focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:text-destructive not-data-[variant=destructive]:focus:**:text-accent-foreground min-h-7 gap-2 rounded-md px-2 py-1 text-xs/relaxed [&_svg:not([class*='size-'])]:size-3.5 group/dropdown-menu-item relative flex cursor-default items-center outline-hidden select-none data-disabled:pointer-events-none data-disabled:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0",e),...r})}function sG({...e}){return p.jsx(hAe,{"data-slot":"dropdown-menu-radio-group",...e})}function oG({className:e,children:t,...n}){return p.jsxs(gAe,{"data-slot":"dropdown-menu-radio-item",className:$e("focus:bg-accent focus:text-accent-foreground focus:**:text-accent-foreground min-h-7 gap-2 rounded-md py-1.5 pr-8 pl-2 text-xs [&_svg:not([class*='size-'])]:size-3.5 relative flex cursor-default items-center outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0",e),...n,children:[p.jsx("span",{className:"pointer-events-none absolute right-2 flex items-center justify-center pointer-events-none","data-slot":"dropdown-menu-radio-item-indicator",children:p.jsx(bAe,{children:p.jsx(ne,{icon:fi,strokeWidth:2})})}),t]})}function lG({className:e,...t}){return p.jsx($j,{"data-slot":"dropdown-menu-separator",className:$e("bg-border/50 -mx-1 my-1 h-px",e),...t})}const I3e="";function T5(){return nn({mutationFn:async e=>{const t=await fetch(`${I3e}/api/git/sync`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(!t.ok){const n=await t.json();throw new Error(n.error||"Sync failed")}return t.json()}})}const D3e="";function A5(){return nn({mutationFn:async e=>{const t=await fetch(`${D3e}/api/git/merge-to-main`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(!t.ok){const n=await t.json();throw new Error(n.error||"Merge failed")}return t.json()}})}const L3e="";function k5(){return nn({mutationFn:async e=>{const t=await fetch(`${L3e}/api/git/push`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(!t.ok){const n=await t.json();throw new Error(n.error||"Push failed")}return t.json()}})}const P3e="";function O5(){return nn({mutationFn:async e=>{const t=await fetch(`${P3e}/api/git/sync-parent`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(!t.ok){const n=await t.json();throw new Error(n.error||"Sync parent failed")}return t.json()}})}const M3e="";function R5(){return nn({mutationFn:async e=>{const t=await fetch(`${M3e}/api/git/create-pr`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(!t.ok){const n=await t.json();if(n.prAlreadyExists&&n.existingPrUrl){const r=new Error(n.error||"PR already exists");throw r.existingPrUrl=n.existingPrUrl,r}throw new Error(n.error||"Failed to create PR")}return t.json()}})}const j3e="";function N5(){return nn({mutationFn:async e=>{const t=await fetch(`${j3e}/api/tasks/${e}/kill-claude`,{method:"POST"});if(!t.ok){const n=await t.json();throw new Error(n.error||"Failed to kill Claude")}return t.json()}})}function F3e({repoPath:e,worktreePath:t,baseBranch:n,taskId:r,title:i,prUrl:a,isMobile:s,terminalId:o,sendInputToTerminal:l}){const{t:u}=At("common"),d=T5(),c=A5(),m=k5(),g=O5(),_=R5(),x=zC(),b=N5(),v=N=>{o&&l?(l(o,N),St.info(u("git.sentToClaude"))):St.error(u("git.noTerminal"))},y=async()=>{try{await d.mutateAsync({repoPath:e,worktreePath:t,baseBranch:n}),St.success(u("git.syncedFromMain"))}catch(N){const D=N instanceof Error?N.message:"Sync failed",L=n||"main";St.error(D,{action:o&&l?{label:"Resolve with Claude",onClick:()=>v(`Rebase this worktree onto the parent repo's ${L} branch. Error: "${D}". Steps: 1) Check for uncommitted changes - stash or commit them first, 2) git fetch origin (in parent repo at ${e}) to ensure ${L} is current, 3) git rebase ${L} (in worktree), 4) Resolve any conflicts carefully - do not lose functionality or introduce regressions, 5) If stashed, git stash pop. Worktree: ${t}, Parent repo: ${e}.`)}:void 0})}},E=async()=>{try{await c.mutateAsync({repoPath:e,worktreePath:t,baseBranch:n}),St.success(u("git.mergedToMain")),b.mutate(r),x.mutate({taskId:r,updates:{status:"DONE"}})}catch(N){const D=N instanceof Error?N.message:"Merge failed",L=n||"main";St.error(D,{action:o&&l?{label:"Resolve with Claude",onClick:()=>v(`Merge this worktree's branch into the parent repo's ${L}. Error: "${D}". Steps: 1) Ensure all changes in worktree are committed, 2) In parent repo at ${e}, checkout ${L} and pull latest from origin, 3) Squash merge the worktree branch into ${L} (use git merge --squash, then commit), 4) Resolve any conflicts carefully - do not lose functionality or introduce regressions, 5) Push ${L} to origin. Worktree: ${t}, Parent repo: ${e}.`)}:void 0})}},C=async()=>{try{await m.mutateAsync({worktreePath:t}),St.success(u("git.pushedToOrigin"))}catch(N){const D=N instanceof Error?N.message:"Push failed";St.error(D,{action:o&&l?{label:"Resolve with Claude",onClick:()=>v(`Push this worktree's branch to origin. Error: "${D}". Steps: 1) Check for uncommitted changes and commit them, 2) If push is rejected, pull the latest changes first and resolve any conflicts, 3) Push to origin again. Worktree: ${t}.`)}:void 0})}},w=async()=>{try{await g.mutateAsync({repoPath:e,baseBranch:n}),St.success(u("git.parentSynced"))}catch(N){const D=N instanceof Error?N.message:"Sync parent failed",L=n||"main";St.error(D,{action:o&&l?{label:"Resolve with Claude",onClick:()=>v(`Sync the parent repo's ${L} branch with origin. Error: "${D}". Steps: 1) git fetch origin, 2) git pull origin ${L} --ff-only, 3) If that fails, rebase with git rebase origin/${L}, 4) Resolve any conflicts carefully - do not lose functionality or introduce regressions, 5) Once in sync, git push origin ${L}. Work in the parent repo at ${e}, not the worktree.`)}:void 0})}},A=()=>{o&&l&&l(o,"commit")},O=async()=>{try{const N=await _.mutateAsync({worktreePath:t,title:i,baseBranch:n});x.mutate({taskId:r,updates:{prUrl:N.prUrl}}),St.success(u("git.prCreated"),{action:{label:"View PR",onClick:()=>Hl(N.prUrl)}})}catch(N){const D=N instanceof Error?N.message:"Failed to create PR",L=N&&typeof N=="object"&&"existingPrUrl"in N?N.existingPrUrl:void 0;if(L){x.mutate({taskId:r,updates:{prUrl:L}}),St.info(u("git.prExists"),{action:{label:"View PR",onClick:()=>Hl(L)}});return}const U=D.split(`
45
45
  `).filter(Boolean).pop()||D;St.error(U,{action:{label:"Resolve with Claude",onClick:()=>v(`Create a PR for this task. Error: "${D}". After creating, link it using: vibora current-task pr <url>. Worktree: ${t}.`)}})}},R=d.isPending||c.isPending||m.isPending||g.isPending||_.isPending;return s?p.jsxs(up,{children:[p.jsx(cp,{className:"flex h-5 w-5 items-center justify-center rounded text-muted-foreground hover:text-foreground",children:p.jsx(ne,{icon:Lj,size:12,strokeWidth:2,className:R?"animate-pulse":""})}),p.jsxs(dp,{align:"end",children:[p.jsxs(dr,{onClick:y,disabled:d.isPending,children:[p.jsx(ne,{icon:Py,size:12,strokeWidth:2,className:d.isPending?"animate-spin":""}),"Pull from main"]}),p.jsxs(dr,{onClick:E,disabled:c.isPending,children:[p.jsx(ne,{icon:Ly,size:12,strokeWidth:2,className:c.isPending?"animate-pulse":""}),"Merge to main"]}),p.jsxs(dr,{onClick:C,disabled:m.isPending,children:[p.jsx(ne,{icon:My,size:12,strokeWidth:2,className:m.isPending?"animate-pulse":""}),"Push to origin"]}),p.jsxs(dr,{onClick:w,disabled:g.isPending,children:[p.jsx(ne,{icon:Fy,size:12,strokeWidth:2,className:g.isPending?"animate-spin":""}),"Sync parent with origin"]}),o&&l&&p.jsxs(dr,{onClick:A,children:[p.jsx(ne,{icon:jy,size:12,strokeWidth:2}),"Commit"]}),!a&&p.jsxs(dr,{onClick:O,disabled:_.isPending,children:[p.jsx(ne,{icon:Ku,size:12,strokeWidth:2,className:_.isPending?"animate-pulse":""}),"Create PR"]})]})]}):p.jsxs(p.Fragment,{children:[p.jsx(Be,{variant:"ghost",size:"icon-xs",onClick:y,disabled:d.isPending,className:"h-5 w-5 text-muted-foreground hover:text-foreground",title:"Pull from main",children:p.jsx(ne,{icon:Py,size:12,strokeWidth:2,className:d.isPending?"animate-spin":""})}),p.jsx(Be,{variant:"ghost",size:"icon-xs",onClick:E,disabled:c.isPending,className:"h-5 w-5 text-muted-foreground hover:text-foreground",title:"Merge to main",children:p.jsx(ne,{icon:Ly,size:12,strokeWidth:2,className:c.isPending?"animate-pulse":""})}),p.jsx(Be,{variant:"ghost",size:"icon-xs",onClick:C,disabled:m.isPending,className:"h-5 w-5 text-muted-foreground hover:text-foreground",title:"Push to origin",children:p.jsx(ne,{icon:My,size:12,strokeWidth:2,className:m.isPending?"animate-pulse":""})}),p.jsx(Be,{variant:"ghost",size:"icon-xs",onClick:w,disabled:g.isPending,className:"h-5 w-5 text-muted-foreground hover:text-foreground",title:"Sync parent with origin",children:p.jsx(ne,{icon:Fy,size:12,strokeWidth:2,className:g.isPending?"animate-spin":""})}),o&&l&&p.jsx(Be,{variant:"ghost",size:"icon-xs",onClick:A,className:"h-5 w-5 text-muted-foreground hover:text-foreground",title:"Commit",children:p.jsx(ne,{icon:jy,size:12,strokeWidth:2})}),!a&&p.jsx(Be,{variant:"ghost",size:"icon-xs",onClick:O,disabled:_.isPending,className:"h-5 w-5 text-muted-foreground hover:text-foreground",title:"Create Pull Request",children:p.jsx(ne,{icon:Ku,size:12,strokeWidth:2,className:_.isPending?"animate-pulse":""})})]})}function lc({...e}){return p.jsx(STe,{"data-slot":"alert-dialog",...e})}function Rle({...e}){return p.jsx(Kie,{"data-slot":"alert-dialog-trigger",...e})}function B3e({...e}){return p.jsx(Vie,{"data-slot":"alert-dialog-portal",...e})}function U3e({className:e,...t}){return p.jsx(Uie,{"data-slot":"alert-dialog-overlay",className:$e("data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 bg-black/80 duration-100 supports-backdrop-filter:backdrop-blur-xs fixed inset-0 isolate z-50",e),...t})}function uc({className:e,size:t="default",...n}){return p.jsxs(B3e,{children:[p.jsx(U3e,{}),p.jsx(Hie,{"data-slot":"alert-dialog-content","data-size":t,className:$e("data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 data-closed:zoom-out-95 data-open:zoom-in-95 bg-background ring-foreground/10 gap-3 rounded-xl p-4 ring-1 duration-100 data-[size=default]:max-w-xs data-[size=sm]:max-w-64 data-[size=default]:sm:max-w-sm group/alert-dialog-content fixed top-1/2 left-1/2 z-50 grid w-full -translate-x-1/2 -translate-y-1/2 outline-none",e),...n})]})}function cc({className:e,...t}){return p.jsx("div",{"data-slot":"alert-dialog-header",className:$e("grid grid-rows-[auto_1fr] place-items-center gap-1 text-center has-data-[slot=alert-dialog-media]:grid-rows-[auto_auto_1fr] has-data-[slot=alert-dialog-media]:gap-x-4 sm:group-data-[size=default]/alert-dialog-content:place-items-start sm:group-data-[size=default]/alert-dialog-content:text-left sm:group-data-[size=default]/alert-dialog-content:has-data-[slot=alert-dialog-media]:grid-rows-[auto_1fr]",e),...t})}function dc({className:e,...t}){return p.jsx("div",{"data-slot":"alert-dialog-footer",className:$e("flex flex-col-reverse gap-2 group-data-[size=sm]/alert-dialog-content:grid group-data-[size=sm]/alert-dialog-content:grid-cols-2 sm:flex-row sm:justify-end",e),...t})}function fc({className:e,...t}){return p.jsx(qie,{"data-slot":"alert-dialog-title",className:$e("text-sm font-medium sm:group-data-[size=default]/alert-dialog-content:group-has-data-[slot=alert-dialog-media]/alert-dialog-content:col-start-2",e),...t})}function pc({className:e,...t}){return p.jsx($ie,{"data-slot":"alert-dialog-description",className:$e("text-muted-foreground *:[a]:hover:text-foreground text-xs/relaxed text-balance md:text-pretty *:[a]:underline *:[a]:underline-offset-3",e),...t})}function Yg({className:e,...t}){return p.jsx(Be,{"data-slot":"alert-dialog-action",className:$e(e),...t})}function hc({className:e,variant:t="outline",size:n="default",...r}){return p.jsx(IC,{"data-slot":"alert-dialog-cancel",className:$e(e),render:p.jsx(Be,{variant:t,size:n}),...r})}const Or=T.forwardRef(({className:e,...t},n)=>p.jsx(tAe,{ref:n,className:$e("peer size-4 shrink-0 rounded border border-input ring-offset-background","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2","disabled:cursor-not-allowed disabled:opacity-50","data-checked:bg-primary data-checked:border-primary data-checked:text-primary-foreground","flex items-center justify-center transition-colors",e),...t,children:p.jsx(nAe,{className:"flex items-center justify-center",children:p.jsx(ne,{icon:fi,size:12,strokeWidth:3})})}));Or.displayName="Checkbox";function aT({task:e,open:t,onOpenChange:n,onDeleted:r}){const i=Cke(),[a,s]=T.useState(!0);T.useEffect(()=>{t&&s(!0)},[t]);const o=()=>{const u=e.pinned?!1:a;i.mutate({taskId:e.id,deleteLinkedWorktree:u},{onSuccess:()=>{n?.(!1),r?.()}})},l=e.worktreePath&&!e.pinned;return p.jsx(lc,{open:t,onOpenChange:n,children:p.jsxs(uc,{children:[p.jsxs(cc,{children:[p.jsx(fc,{children:"Delete Task"}),p.jsxs(pc,{children:['This will permanently delete "',e.title,'" and close its terminal.',a&&e.worktreePath&&!e.pinned&&" The linked worktree will also be removed."," ","This action cannot be undone."]}),e.pinned&&p.jsxs("p",{className:"flex items-center gap-1.5 text-sm text-primary",children:[p.jsx(ne,{icon:gS,size:14,strokeWidth:2}),"This worktree is pinned and will be preserved."]})]}),l&&p.jsxs("label",{className:"flex items-center gap-2 py-2 text-sm text-foreground cursor-pointer",children:[p.jsx(Or,{checked:a,onCheckedChange:u=>s(u===!0),disabled:i.isPending}),"Also delete linked worktree"]}),p.jsxs(dc,{children:[p.jsx(hc,{disabled:i.isPending,children:"Cancel"}),p.jsx(Yg,{onClick:o,variant:"destructive",disabled:i.isPending,children:i.isPending?"Deleting...":"Delete"})]})]})})}function $3e({repoPath:e,worktreePath:t,baseBranch:n,taskId:r,title:i,prUrl:a,repoName:s,terminalId:o,sendInputToTerminal:l,pinned:u}){const{t:d}=At("common"),c=aa(),m=T5(),g=A5(),_=k5(),x=O5(),b=R5(),v=zC(),y=N5(),[E,C]=T.useState(!1),w={id:r,title:i,worktreePath:t,pinned:u??!1,description:null,status:"IN_PROGRESS",position:0,repoPath:e,repoName:s,baseBranch:n,branch:null,viewState:null,prUrl:a??null,linearTicketId:null,linearTicketUrl:null,startupScript:null,agent:"claude",aiMode:null,agentOptions:null,opencodeModel:null,createdAt:"",updatedAt:""},A=z=>{o&&l?(l(o,z),St.info(d("git.sentToClaude"))):St.error(d("git.noTerminal"))},O=async()=>{try{await m.mutateAsync({repoPath:e,worktreePath:t,baseBranch:n}),St.success(d("git.syncedFromMain"))}catch(z){const H=z instanceof Error?z.message:"Sync failed",q=n||"main";St.error(H,{action:o&&l?{label:"Resolve with Claude",onClick:()=>A(`Rebase this worktree onto the parent repo's ${q} branch. Error: "${H}". Steps: 1) Check for uncommitted changes - stash or commit them first, 2) git fetch origin (in parent repo at ${e}) to ensure ${q} is current, 3) git rebase ${q} (in worktree), 4) Resolve any conflicts carefully - do not lose functionality or introduce regressions, 5) If stashed, git stash pop. Worktree: ${t}, Parent repo: ${e}.`)}:void 0})}},R=async()=>{try{await g.mutateAsync({repoPath:e,worktreePath:t,baseBranch:n}),St.success(d("git.mergedToMain")),y.mutate(r),v.mutate({taskId:r,updates:{status:"DONE"}})}catch(z){const H=z instanceof Error?z.message:"Merge failed",q=n||"main";St.error(H,{action:o&&l?{label:"Resolve with Claude",onClick:()=>A(`Merge this worktree's branch into the parent repo's ${q}. Error: "${H}". Steps: 1) Ensure all changes in worktree are committed, 2) In parent repo at ${e}, checkout ${q} and pull latest from origin, 3) Squash merge the worktree branch into ${q} (use git merge --squash, then commit), 4) Resolve any conflicts carefully - do not lose functionality or introduce regressions, 5) Push ${q} to origin. Worktree: ${t}, Parent repo: ${e}.`)}:void 0})}},N=async()=>{try{await _.mutateAsync({worktreePath:t}),St.success(d("git.pushedToOrigin"))}catch(z){const H=z instanceof Error?z.message:"Push failed";St.error(H,{action:o&&l?{label:"Resolve with Claude",onClick:()=>A(`Push this worktree's branch to origin. Error: "${H}". Steps: 1) Check for uncommitted changes and commit them, 2) If push is rejected, pull the latest changes first and resolve any conflicts, 3) Push to origin again. Worktree: ${t}.`)}:void 0})}},D=async()=>{try{await x.mutateAsync({repoPath:e,baseBranch:n}),St.success(d("git.parentSynced"))}catch(z){const H=z instanceof Error?z.message:"Sync parent failed",q=n||"main";St.error(H,{action:o&&l?{label:"Resolve with Claude",onClick:()=>A(`Sync the parent repo's ${q} branch with origin. Error: "${H}". Steps: 1) git fetch origin, 2) git pull origin ${q} --ff-only, 3) If that fails, rebase with git rebase origin/${q}, 4) Resolve any conflicts carefully - do not lose functionality or introduce regressions, 5) Once in sync, git push origin ${q}. Work in the parent repo at ${e}, not the worktree.`)}:void 0})}},L=()=>{o&&l&&l(o,"commit")},U=()=>{c({to:"/projects"})},M=async()=>{try{const z=await b.mutateAsync({worktreePath:t,title:i,baseBranch:n});v.mutate({taskId:r,updates:{prUrl:z.prUrl}}),St.success(d("git.prCreated"),{action:{label:"View PR",onClick:()=>Hl(z.prUrl)}})}catch(z){const H=z instanceof Error?z.message:"Failed to create PR",q=z&&typeof z=="object"&&"existingPrUrl"in z?z.existingPrUrl:void 0;if(q){v.mutate({taskId:r,updates:{prUrl:q}}),St.info(d("git.prExists"),{action:{label:"View PR",onClick:()=>Hl(q)}});return}const K=H.split(`
46
- `).filter(Boolean).pop()||H;St.error(K,{action:{label:"Resolve with Claude",onClick:()=>A(`Create a PR for this task. Error: "${H}". After creating, link it using: vibora current-task pr <url>. Worktree: ${t}.`)}})}},G=m.isPending||g.isPending||_.isPending||x.isPending||b.isPending;return p.jsxs(p.Fragment,{children:[p.jsxs(up,{children:[p.jsx(cp,{className:"flex h-5 w-5 items-center justify-center rounded text-muted-foreground hover:text-foreground",children:p.jsx(ne,{icon:Lj,size:12,strokeWidth:2,className:G?"animate-pulse":""})}),p.jsxs(dp,{align:"end",children:[p.jsxs(dr,{onClick:O,disabled:m.isPending,children:[p.jsx(ne,{icon:Py,size:12,strokeWidth:2,className:m.isPending?"animate-spin":""}),"Pull from main"]}),p.jsxs(dr,{onClick:R,disabled:g.isPending,children:[p.jsx(ne,{icon:Ly,size:12,strokeWidth:2,className:g.isPending?"animate-pulse":""}),"Merge to main"]}),p.jsxs(dr,{onClick:N,disabled:_.isPending,children:[p.jsx(ne,{icon:My,size:12,strokeWidth:2,className:_.isPending?"animate-pulse":""}),"Push to origin"]}),p.jsxs(dr,{onClick:D,disabled:x.isPending,children:[p.jsx(ne,{icon:Fy,size:12,strokeWidth:2,className:x.isPending?"animate-spin":""}),"Sync parent with origin"]}),o&&l&&p.jsxs(dr,{onClick:L,children:[p.jsx(ne,{icon:jy,size:12,strokeWidth:2}),"Commit"]}),!a&&p.jsxs(dr,{onClick:M,disabled:b.isPending,children:[p.jsx(ne,{icon:Ku,size:12,strokeWidth:2,className:b.isPending?"animate-pulse":""}),"Create PR"]}),p.jsx(lG,{}),p.jsxs(dr,{onClick:U,children:[p.jsx(ne,{icon:Ms,size:12,strokeWidth:2}),s]}),p.jsx(lG,{}),p.jsxs(dr,{onClick:()=>C(!0),className:"text-destructive focus:text-destructive",children:[p.jsx(ne,{icon:nl,size:12,strokeWidth:2}),"Delete task"]})]})]}),p.jsx(aT,{task:w,open:E,onOpenChange:C})]})}const z3e=Ud("h-5 gap-1 rounded-full border border-transparent px-2 py-0.5 text-[0.625rem] font-medium transition-all has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&>svg]:size-2.5! inline-flex items-center justify-center w-fit whitespace-nowrap shrink-0 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transition-colors overflow-hidden group/badge",{variants:{variant:{default:"bg-primary text-primary-foreground [a]:hover:bg-primary/80",secondary:"bg-secondary text-secondary-foreground [a]:hover:bg-secondary/80",destructive:"bg-destructive/10 [a]:hover:bg-destructive/20 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 text-destructive dark:bg-destructive/20",outline:"border-border text-foreground [a]:hover:bg-muted [a]:hover:text-muted-foreground bg-input/20 dark:bg-input/30",ghost:"hover:bg-muted hover:text-muted-foreground dark:hover:bg-muted/50",link:"text-primary underline-offset-4 hover:underline"}},defaultVariants:{variant:"default"}});function ea({className:e,variant:t="default",render:n,...r}){return dke({defaultTagName:"span",props:Zl({className:$e(z3e({className:e,variant:t}))},r),render:n,state:{slot:"badge",variant:t}})}function iy({worktreePath:e}){const{data:t,isLoading:n}=Nke(e);if(!e||n||!t)return null;if(t.clean)return p.jsxs(ea,{className:"bg-accent/20 text-accent border-transparent",children:[p.jsx(ne,{icon:fi,size:12,strokeWidth:2}),"Clean"]});const r=t.files.length;return p.jsxs(ea,{className:"bg-amber-500/20 text-amber-600 dark:text-amber-400 border-transparent",children:[p.jsx(ne,{icon:ii,size:12,strokeWidth:2}),r," ",r===1?"change":"changes"]})}const wc="";function sT(){return cn({queryKey:["projects"],queryFn:()=>pt(`${wc}/api/projects`)})}function H3e(e){return cn({queryKey:["projects",e],queryFn:()=>pt(`${wc}/api/projects/${e}`),enabled:!!e})}function V3e(){const e=hn();return nn({mutationFn:t=>pt(`${wc}/api/projects`,{method:"POST",body:JSON.stringify(t)}),onSuccess:()=>{e.invalidateQueries({queryKey:["projects"]}),e.invalidateQueries({queryKey:["repositories"]})}})}function W3e(){const e=hn();return nn({mutationFn:({id:t,updates:n})=>pt(`${wc}/api/projects/${t}`,{method:"PATCH",body:JSON.stringify(n)}),onSuccess:(t,{id:n})=>{e.invalidateQueries({queryKey:["projects"]}),e.invalidateQueries({queryKey:["projects",n]})}})}function Nle(){const e=hn();return nn({mutationFn:({id:t,deleteDirectory:n=!1,deleteApp:r=!1})=>{const i=new URLSearchParams;n&&i.set("deleteDirectory","true"),r&&i.set("deleteApp","true");const a=`${wc}/api/projects/${t}${i.toString()?`?${i}`:""}`;return pt(a,{method:"DELETE"})},onSuccess:()=>{e.invalidateQueries({queryKey:["projects"]}),e.invalidateQueries({queryKey:["repositories"]}),e.invalidateQueries({queryKey:["apps"]})}})}function G3e(){const e=hn();return nn({mutationFn:({projectId:t,name:n,branch:r,composeFile:i,autoDeployEnabled:a,services:s})=>pt(`${wc}/api/projects/${t}/create-app`,{method:"POST",body:JSON.stringify({name:n,branch:r,composeFile:i,autoDeployEnabled:a,services:s})}),onSuccess:(t,{projectId:n})=>{e.invalidateQueries({queryKey:["projects"]}),e.invalidateQueries({queryKey:["projects",n]}),e.invalidateQueries({queryKey:["apps"]})}})}function q3e(){const e=hn();return nn({mutationFn:t=>pt(`${wc}/api/projects/${t}/access`,{method:"POST"}),onSuccess:()=>{e.invalidateQueries({queryKey:["projects"]})}})}function K3e(){return nn({mutationFn:e=>pt(`${wc}/api/projects/scan`,{method:"POST",body:JSON.stringify(e?{directory:e}:{})})})}function Y3e(){const e=hn();return nn({mutationFn:t=>pt(`${wc}/api/projects/bulk`,{method:"POST",body:JSON.stringify({repositories:t})}),onSuccess:()=>{e.invalidateQueries({queryKey:["projects"]}),e.invalidateQueries({queryKey:["repositories"]})}})}const X3e=600,Z3e=450,Q3e=250;function J3e({taskInfo:e,terminalId:t,terminalCwd:n,isMobile:r,sendInputToTerminal:i}){const a=T.useRef(null),[s,o]=T.useState(1/0),[l,u]=T.useState(!1),{data:d=[]}=sT(),c=d.find(b=>b.repository?.path===e.repoPath);T.useEffect(()=>{const b=a.current;if(!b)return;const v=new ResizeObserver(y=>{for(const E of y)o(E.contentRect.width)});return v.observe(b),()=>v.disconnect()},[]);const m=s>=X3e,g=s>=Z3e&&!r,_=s>=Q3e,x={id:e.taskId,title:e.title,worktreePath:e.worktreePath,pinned:e.pinned??!1,description:null,status:"IN_PROGRESS",position:0,repoPath:e.repoPath,repoName:e.repoName,baseBranch:e.baseBranch,branch:e.branch,viewState:null,prUrl:e.prUrl??null,linearTicketId:null,linearTicketUrl:null,startupScript:null,agent:"claude",aiMode:null,agentOptions:null,opencodeModel:null,createdAt:"",updatedAt:""};return p.jsx("div",{ref:a,className:"flex shrink-0 items-center justify-between border-b border-border bg-card",children:p.jsxs("div",{className:"flex min-w-0 flex-1 items-center gap-2 px-2 py-1",children:[p.jsxs(ir,{to:"/tasks/$taskId",params:{taskId:e.taskId},className:"flex shrink-0 items-center gap-1.5 rounded px-2 py-0.5 text-xs font-medium text-primary hover:bg-primary/10 max-w-[50%]",children:[p.jsx(ne,{icon:jj,size:12,strokeWidth:2,className:"shrink-0"}),p.jsx("span",{className:"truncate",children:e.title})]}),m&&p.jsxs(p.Fragment,{children:[c?p.jsxs(ir,{to:"/projects/$projectId",params:{projectId:c.id},className:"flex min-w-0 items-center gap-1 text-xs font-medium text-foreground hover:text-primary",children:[p.jsx(ne,{icon:Ms,size:12,strokeWidth:2,className:"shrink-0"}),p.jsx("span",{className:"truncate hover:underline",children:e.repoName})]}):p.jsxs("span",{className:"flex min-w-0 items-center gap-1 text-xs font-medium text-foreground",children:[p.jsx(ne,{icon:Ms,size:12,strokeWidth:2,className:"shrink-0"}),p.jsx("span",{className:"truncate",children:e.repoName})]}),n&&p.jsxs("span",{className:"flex min-w-0 items-center gap-1 text-xs text-muted-foreground",children:[p.jsx(ne,{icon:NC,size:12,strokeWidth:2,className:"shrink-0"}),p.jsx("span",{className:"truncate",children:n.split("/").pop()})]})]}),p.jsxs("div",{className:"ml-auto flex items-center gap-1",children:[_&&p.jsx(iy,{worktreePath:e.worktreePath}),g?p.jsxs(p.Fragment,{children:[p.jsx(F3e,{repoPath:e.repoPath,worktreePath:e.worktreePath,baseBranch:e.baseBranch,taskId:e.taskId,title:e.title,prUrl:e.prUrl,isMobile:r,terminalId:t,sendInputToTerminal:i}),p.jsx(Be,{variant:"ghost",size:"icon-xs",className:"h-5 w-5 text-muted-foreground hover:text-destructive",title:"Delete task",onClick:()=>u(!0),children:p.jsx(ne,{icon:nl,size:12,strokeWidth:2})}),p.jsx(aT,{task:x,open:l,onOpenChange:u})]}):p.jsx($3e,{repoPath:e.repoPath,worktreePath:e.worktreePath,baseBranch:e.baseBranch,taskId:e.taskId,title:e.title,prUrl:e.prUrl,repoName:e.repoName,terminalId:t,sendInputToTerminal:i,pinned:e.pinned})]})]})})}function eje(e){switch(e){case"running":return"bg-green-500";case"building":return"bg-yellow-500";case"failed":return"bg-red-500";default:return"bg-muted-foreground/30"}}function tje({projectInfo:e}){return p.jsx("div",{className:"flex shrink-0 items-center justify-between border-b border-border bg-card",children:p.jsxs("div",{className:"flex min-w-0 flex-1 items-center gap-2 px-2 py-1",children:[p.jsxs(ir,{to:"/projects/$projectId",params:{projectId:e.projectId},className:"flex shrink-0 items-center gap-1.5 rounded px-2 py-0.5 text-xs font-medium text-primary hover:bg-primary/10 max-w-[50%]",children:[p.jsx(ne,{icon:Ms,size:12,strokeWidth:2,className:"shrink-0"}),p.jsx("span",{className:"truncate",children:e.projectName})]}),p.jsx("span",{className:"flex min-w-0 items-center gap-1 text-xs text-muted-foreground truncate",children:e.repoPath}),e.appStatus&&p.jsxs("div",{className:"ml-auto flex items-center gap-1.5",children:[p.jsx("span",{className:$e("h-2 w-2 rounded-full",eje(e.appStatus))}),p.jsx("span",{className:"text-xs text-muted-foreground capitalize",children:e.appStatus})]})]})})}function nje({terminals:e,activeIndex:t,onSelect:n,taskInfoByCwd:r}){const i=T.useRef(null),a=T.useRef(null);T.useEffect(()=>{a.current&&i.current&&a.current.scrollIntoView({behavior:"smooth",block:"nearest",inline:"center"})},[t]);const s=(o,l)=>{if(o.cwd&&r){const u=r.get(o.cwd);if(u)return u.title}return o.name||`Terminal ${l+1}`};return p.jsx("div",{ref:i,className:"flex shrink-0 gap-1 overflow-x-auto border-b border-border bg-card px-2 py-1.5",style:{WebkitOverflowScrolling:"touch"},children:e.map((o,l)=>{const u=l===t,d=s(o,l);return p.jsx("button",{ref:u?a:null,onClick:()=>n(l),className:$e("shrink-0 rounded-md px-3 py-1.5 text-xs font-medium transition-colors touch-manipulation","max-w-[150px] truncate",u?"bg-primary text-primary-foreground":"bg-muted text-muted-foreground hover:bg-muted/80"),children:d},o.id)})})}const rje=Gg(function({terminal:t,taskInfo:n,projectInfo:r,isMobile:i,onClose:a,onReady:s,onResize:o,onRename:l,onContainerReady:u,setupImagePaste:d,onFocus:c,sendInputToTerminal:m,isMaximized:g,onMaximize:_,onMinimize:x,canMaximize:b}){const v=Wg(),{resolvedTheme:y}=Fd(),E=y==="dark",C=n?v.terminals.get(t.id):null,w=C?.isStartingUp??!1;T.useEffect(()=>{n&&Lt.terminal.info("TerminalPane isStartingUp check",{terminalId:t.id,hasTaskInfo:!!n,hasTerminalModel:!!C,isStartingUp:C?.isStartingUp,isStartingClaude:w})},[t.id,n,C,w,C?.isStartingUp]);const A=()=>n?p.jsx(J3e,{taskInfo:n,terminalId:t.id,terminalCwd:t.cwd,isMobile:i,sendInputToTerminal:m}):r?p.jsx(tje,{projectInfo:r}):p.jsxs("div",{className:"flex shrink-0 items-center justify-between border-b border-border bg-card",children:[p.jsx(N3e,{name:t.name,status:t.status,exitCode:t.exitCode,className:"flex-1 border-b-0",onRename:l}),p.jsxs("div",{className:"flex items-center gap-1 mr-1",children:[b&&p.jsx(Be,{variant:"ghost",size:"icon-xs",onClick:g?x:_,className:"h-5 w-5 text-muted-foreground hover:text-foreground",title:g?"Restore":"Maximize",children:p.jsx(ne,{icon:g?swe:xwe,size:12,strokeWidth:2})}),a&&p.jsx(Be,{variant:"ghost",size:"icon-xs",onClick:a,className:"h-5 w-5 text-muted-foreground hover:text-foreground",children:p.jsx(ne,{icon:qr,size:12,strokeWidth:2})})]})]});return p.jsxs("div",{className:"flex h-full min-w-0 flex-col overflow-hidden",children:[A(),p.jsxs("div",{className:"relative min-h-0 min-w-0 flex-1",children:[p.jsx(wP,{onReady:s,onResize:o,onContainerReady:u,terminalId:t.id,setupImagePaste:d,onFocus:c}),w&&p.jsx("div",{className:"pointer-events-none absolute inset-0 z-10 flex items-center justify-center bg-terminal-background/90",children:p.jsxs("div",{className:"flex flex-col items-center gap-3",children:[p.jsx(ne,{icon:jt,size:24,strokeWidth:2,className:$e("animate-spin",E?"text-white/60":"text-black/60")}),p.jsx("span",{className:$e("font-mono text-sm",E?"text-white/60":"text-black/60"),children:"Starting Claude Code..."})]})})]})]})});function ije({onAdd:e,message:t}){return p.jsx("div",{className:"flex h-full items-center justify-center bg-terminal-background",children:e?p.jsxs(Be,{variant:"outline",size:"sm",onClick:e,className:"gap-2",children:[p.jsx(ne,{icon:Fm,size:14,strokeWidth:2}),"New Terminal"]}):p.jsx("p",{className:"text-xs text-muted-foreground",children:t||"No terminals"})})}function aje(e){return e<=1?{rows:1,cols:1}:e<=2?{rows:1,cols:2}:e<=4?{rows:2,cols:2}:e<=6?{rows:2,cols:3}:e<=9?{rows:3,cols:3}:{rows:3,cols:4}}function sje({terminals:e,onTerminalClose:t,onTerminalAdd:n,onTerminalReady:r,onTerminalResize:i,onTerminalRename:a,onTerminalContainerReady:s,setupImagePaste:o,writeToTerminal:l,sendInputToTerminal:u,taskInfoByCwd:d,projectInfoByCwd:c,emptyMessage:m}){const g=iT(),[_,x]=T.useState(e.length>0?e[0].id:null),[b,v]=T.useState(0),[y,E]=T.useState(null);if(T.useEffect(()=>{b>=e.length&&e.length>0&&v(e.length-1)},[e.length,b]),T.useEffect(()=>{y&&!e.find(D=>D.id===y)&&E(null)},[e,y]),e.length===0)return p.jsx(ije,{onAdd:n,message:m});const{rows:C,cols:w}=aje(e.length),A=[];for(let D=0;D<C;D++){const L=D*w,U=Math.min(L+w,e.length);L<e.length&&A.push(e.slice(L,U))}const O=D=>{const L=g&&e.length>1?e[b]?.id:_;L&&l&&l(L,D)},R=D=>{const L=D.cwd?d?.get(D.cwd):void 0,U=D.cwd?c?.get(D.cwd):void 0,M=!L&&!U&&e.length>1;return p.jsx(rje,{terminal:D,taskInfo:L,projectInfo:U,isMobile:g,onClose:t?()=>t(D.id):void 0,onReady:r?G=>r(D.id,G):void 0,onResize:i?(G,z)=>i(D.id,G,z):void 0,onRename:a?G=>a(D.id,G):void 0,onContainerReady:s?G=>s(D.id,G):void 0,setupImagePaste:o,onFocus:()=>x(D.id),sendInputToTerminal:u,isMaximized:y===D.id,onMaximize:()=>E(D.id),onMinimize:()=>E(null),canMaximize:M})},N=D=>p.jsxs("div",{className:"flex h-full w-full flex-col",children:[p.jsx("div",{className:"min-h-0 flex-1",children:D}),g&&l&&p.jsx(IS,{onSend:O})]});if(g&&e.length>1){const D=e[b]??e[0];return p.jsxs("div",{className:"flex h-full w-full flex-col",children:[p.jsx(nje,{terminals:e,activeIndex:b,onSelect:v,taskInfoByCwd:d}),p.jsx("div",{className:"min-h-0 flex-1",children:R(D)},D.id),l&&p.jsx(IS,{onSend:O})]})}if(e.length===1)return N(p.jsx("div",{className:"h-full w-full max-w-full min-w-0 overflow-hidden",children:R(e[0])},e[0].id));if(y){const D=e.find(L=>L.id===y);if(D)return N(p.jsx("div",{className:"h-full w-full max-w-full min-w-0 overflow-hidden",children:R(D)},D.id))}return e.length===2?N(p.jsxs(Mf,{direction:g?"vertical":"horizontal",className:"h-full max-w-full",children:[p.jsx(lo,{defaultSize:50,minSize:15,children:R(e[0])},e[0].id),p.jsx(jf,{}),p.jsx(lo,{defaultSize:50,minSize:15,children:R(e[1])},e[1].id)]})):e.length===3?N(p.jsxs(Mf,{direction:"horizontal",className:"h-full max-w-full",children:[p.jsx(lo,{defaultSize:50,minSize:15,children:R(e[0])},e[0].id),p.jsx(jf,{}),p.jsx(lo,{defaultSize:50,minSize:15,children:p.jsxs(Mf,{direction:"vertical",className:"h-full max-w-full",children:[p.jsx(lo,{defaultSize:50,minSize:15,children:R(e[1])},e[1].id),p.jsx(jf,{}),p.jsx(lo,{defaultSize:50,minSize:15,children:R(e[2])},e[2].id)]})})]})):N(p.jsx(Mf,{direction:"vertical",className:"h-full max-w-full",children:A.map((D,L)=>p.jsxs(T.Fragment,{children:[L>0&&p.jsx(jf,{}),p.jsx(lo,{defaultSize:100/A.length,minSize:15,children:D.length===1?R(D[0]):p.jsx(Mf,{direction:"horizontal",className:"h-full max-w-full",children:D.map((U,M)=>p.jsxs(T.Fragment,{children:[M>0&&p.jsx(jf,{}),p.jsx(lo,{defaultSize:100/w,minSize:15,children:R(U)})]},U.id))})})]},`row-${L}`))}))}function oje(e){if(Array.isArray(e))return e}function lje(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,a,s,o=[],l=!0,u=!1;try{if(a=(n=n.call(e)).next,t!==0)for(;!(l=(r=a.call(n)).done)&&(o.push(r.value),o.length!==t);l=!0);}catch(d){u=!0,i=d}finally{try{if(!l&&n.return!=null&&(s=n.return(),Object(s)!==s))return}finally{if(u)throw i}}return o}}function CP(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function Ile(e,t){if(e){if(typeof e=="string")return CP(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?CP(e,t):void 0}}function uje(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
46
+ `).filter(Boolean).pop()||H;St.error(K,{action:{label:"Resolve with Claude",onClick:()=>A(`Create a PR for this task. Error: "${H}". After creating, link it using: vibora current-task pr <url>. Worktree: ${t}.`)}})}},G=m.isPending||g.isPending||_.isPending||x.isPending||b.isPending;return p.jsxs(p.Fragment,{children:[p.jsxs(up,{children:[p.jsx(cp,{className:"flex h-5 w-5 items-center justify-center rounded text-muted-foreground hover:text-foreground",children:p.jsx(ne,{icon:Lj,size:12,strokeWidth:2,className:G?"animate-pulse":""})}),p.jsxs(dp,{align:"end",children:[p.jsxs(dr,{onClick:O,disabled:m.isPending,children:[p.jsx(ne,{icon:Py,size:12,strokeWidth:2,className:m.isPending?"animate-spin":""}),"Pull from main"]}),p.jsxs(dr,{onClick:R,disabled:g.isPending,children:[p.jsx(ne,{icon:Ly,size:12,strokeWidth:2,className:g.isPending?"animate-pulse":""}),"Merge to main"]}),p.jsxs(dr,{onClick:N,disabled:_.isPending,children:[p.jsx(ne,{icon:My,size:12,strokeWidth:2,className:_.isPending?"animate-pulse":""}),"Push to origin"]}),p.jsxs(dr,{onClick:D,disabled:x.isPending,children:[p.jsx(ne,{icon:Fy,size:12,strokeWidth:2,className:x.isPending?"animate-spin":""}),"Sync parent with origin"]}),o&&l&&p.jsxs(dr,{onClick:L,children:[p.jsx(ne,{icon:jy,size:12,strokeWidth:2}),"Commit"]}),!a&&p.jsxs(dr,{onClick:M,disabled:b.isPending,children:[p.jsx(ne,{icon:Ku,size:12,strokeWidth:2,className:b.isPending?"animate-pulse":""}),"Create PR"]}),p.jsx(lG,{}),p.jsxs(dr,{onClick:U,children:[p.jsx(ne,{icon:Ms,size:12,strokeWidth:2}),s]}),p.jsx(lG,{}),p.jsxs(dr,{onClick:()=>C(!0),className:"text-destructive focus:text-destructive",children:[p.jsx(ne,{icon:nl,size:12,strokeWidth:2}),"Delete task"]})]})]}),p.jsx(aT,{task:w,open:E,onOpenChange:C})]})}const z3e=Ud("h-5 gap-1 rounded-full border border-transparent px-2 py-0.5 text-[0.625rem] font-medium transition-all has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&>svg]:size-2.5! inline-flex items-center justify-center w-fit whitespace-nowrap shrink-0 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transition-colors overflow-hidden group/badge",{variants:{variant:{default:"bg-primary text-primary-foreground [a]:hover:bg-primary/80",secondary:"bg-secondary text-secondary-foreground [a]:hover:bg-secondary/80",destructive:"bg-destructive/10 [a]:hover:bg-destructive/20 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 text-destructive dark:bg-destructive/20",outline:"border-border text-foreground [a]:hover:bg-muted [a]:hover:text-muted-foreground bg-input/20 dark:bg-input/30",ghost:"hover:bg-muted hover:text-muted-foreground dark:hover:bg-muted/50",link:"text-primary underline-offset-4 hover:underline"}},defaultVariants:{variant:"default"}});function ea({className:e,variant:t="default",render:n,...r}){return dke({defaultTagName:"span",props:Zl({className:$e(z3e({className:e,variant:t}))},r),render:n,state:{slot:"badge",variant:t}})}function iy({worktreePath:e}){const{data:t,isLoading:n}=Nke(e);if(!e||n||!t)return null;if(t.clean)return p.jsxs(ea,{className:"bg-accent/20 text-accent border-transparent",children:[p.jsx(ne,{icon:fi,size:12,strokeWidth:2}),"Clean"]});const r=t.files.length;return p.jsxs(ea,{className:"bg-amber-500/20 text-amber-600 dark:text-amber-400 border-transparent",children:[p.jsx(ne,{icon:ii,size:12,strokeWidth:2}),r," ",r===1?"change":"changes"]})}const wc="";function sT(){return cn({queryKey:["projects"],queryFn:()=>pt(`${wc}/api/projects`)})}function H3e(e){return cn({queryKey:["projects",e],queryFn:()=>pt(`${wc}/api/projects/${e}`),enabled:!!e})}function V3e(){const e=hn();return nn({mutationFn:t=>pt(`${wc}/api/projects`,{method:"POST",body:JSON.stringify(t)}),onSuccess:()=>{e.invalidateQueries({queryKey:["projects"]}),e.invalidateQueries({queryKey:["repositories"]})}})}function W3e(){const e=hn();return nn({mutationFn:({id:t,updates:n})=>pt(`${wc}/api/projects/${t}`,{method:"PATCH",body:JSON.stringify(n)}),onSuccess:(t,{id:n})=>{e.invalidateQueries({queryKey:["projects"]}),e.invalidateQueries({queryKey:["projects",n]})}})}function Nle(){const e=hn();return nn({mutationFn:({id:t,deleteDirectory:n=!1,deleteApp:r=!1})=>{const i=new URLSearchParams;n&&i.set("deleteDirectory","true"),r&&i.set("deleteApp","true");const a=`${wc}/api/projects/${t}${i.toString()?`?${i}`:""}`;return pt(a,{method:"DELETE"})},onSuccess:()=>{e.invalidateQueries({queryKey:["projects"]}),e.invalidateQueries({queryKey:["repositories"]}),e.invalidateQueries({queryKey:["apps"]})}})}function G3e(){const e=hn();return nn({mutationFn:({projectId:t,name:n,branch:r,composeFile:i,autoDeployEnabled:a,services:s})=>pt(`${wc}/api/projects/${t}/create-app`,{method:"POST",body:JSON.stringify({name:n,branch:r,composeFile:i,autoDeployEnabled:a,services:s})}),onSuccess:(t,{projectId:n})=>{e.invalidateQueries({queryKey:["projects"]}),e.invalidateQueries({queryKey:["projects",n]}),e.invalidateQueries({queryKey:["apps"]})}})}function q3e(){const e=hn();return nn({mutationFn:t=>pt(`${wc}/api/projects/${t}/access`,{method:"POST"}),onSuccess:()=>{e.invalidateQueries({queryKey:["projects"]})}})}function K3e(){return nn({mutationFn:e=>pt(`${wc}/api/projects/scan`,{method:"POST",body:JSON.stringify(e?{directory:e}:{})})})}function Y3e(){const e=hn();return nn({mutationFn:t=>pt(`${wc}/api/projects/bulk`,{method:"POST",body:JSON.stringify({repositories:t})}),onSuccess:()=>{e.invalidateQueries({queryKey:["projects"]}),e.invalidateQueries({queryKey:["repositories"]})}})}const X3e=600,Z3e=450,Q3e=250;function J3e({taskInfo:e,terminalId:t,terminalCwd:n,isMobile:r,sendInputToTerminal:i}){const a=T.useRef(null),[s,o]=T.useState(1/0),[l,u]=T.useState(!1),{data:d=[]}=sT(),c=d.find(b=>b.repository?.path===e.repoPath);T.useEffect(()=>{const b=a.current;if(!b)return;const v=new ResizeObserver(y=>{for(const E of y)o(E.contentRect.width)});return v.observe(b),()=>v.disconnect()},[]);const m=s>=X3e,g=s>=Z3e&&!r,_=s>=Q3e,x={id:e.taskId,title:e.title,worktreePath:e.worktreePath,pinned:e.pinned??!1,description:null,status:"IN_PROGRESS",position:0,repoPath:e.repoPath,repoName:e.repoName,baseBranch:e.baseBranch,branch:e.branch,viewState:null,prUrl:e.prUrl??null,linearTicketId:null,linearTicketUrl:null,startupScript:null,agent:"claude",aiMode:null,agentOptions:null,opencodeModel:null,createdAt:"",updatedAt:""};return p.jsx("div",{ref:a,className:"flex shrink-0 items-center justify-between border-b border-border bg-card",children:p.jsxs("div",{className:"flex min-w-0 flex-1 items-center gap-2 px-2 py-1",children:[p.jsxs(ir,{to:"/tasks/$taskId",params:{taskId:e.taskId},className:"flex shrink-0 items-center gap-1.5 rounded px-2 py-0.5 text-xs font-medium text-primary hover:bg-primary/10 max-w-[50%]",children:[p.jsx(ne,{icon:jj,size:12,strokeWidth:2,className:"shrink-0"}),p.jsx("span",{className:"truncate",children:e.title})]}),m&&p.jsxs(p.Fragment,{children:[c?p.jsxs(ir,{to:"/projects/$projectId",params:{projectId:c.id},className:"flex min-w-0 items-center gap-1 text-xs font-medium text-foreground hover:text-primary",children:[p.jsx(ne,{icon:Ms,size:12,strokeWidth:2,className:"shrink-0"}),p.jsx("span",{className:"truncate hover:underline",children:e.repoName})]}):p.jsxs("span",{className:"flex min-w-0 items-center gap-1 text-xs font-medium text-foreground",children:[p.jsx(ne,{icon:Ms,size:12,strokeWidth:2,className:"shrink-0"}),p.jsx("span",{className:"truncate",children:e.repoName})]}),n&&p.jsxs("span",{className:"flex min-w-0 items-center gap-1 text-xs text-muted-foreground",children:[p.jsx(ne,{icon:NC,size:12,strokeWidth:2,className:"shrink-0"}),p.jsx("span",{className:"truncate",children:n.split("/").pop()})]})]}),p.jsxs("div",{className:"ml-auto flex items-center gap-1",children:[_&&p.jsx(iy,{worktreePath:e.worktreePath}),g?p.jsxs(p.Fragment,{children:[p.jsx(F3e,{repoPath:e.repoPath,worktreePath:e.worktreePath,baseBranch:e.baseBranch,taskId:e.taskId,title:e.title,prUrl:e.prUrl,isMobile:r,terminalId:t,sendInputToTerminal:i}),p.jsx(Be,{variant:"ghost",size:"icon-xs",className:"h-5 w-5 text-muted-foreground hover:text-destructive",title:"Delete task",onClick:()=>u(!0),children:p.jsx(ne,{icon:nl,size:12,strokeWidth:2})}),p.jsx(aT,{task:x,open:l,onOpenChange:u})]}):p.jsx($3e,{repoPath:e.repoPath,worktreePath:e.worktreePath,baseBranch:e.baseBranch,taskId:e.taskId,title:e.title,prUrl:e.prUrl,repoName:e.repoName,terminalId:t,sendInputToTerminal:i,pinned:e.pinned})]})]})})}function eje(e){switch(e){case"running":return"bg-green-500";case"building":return"bg-yellow-500";case"failed":return"bg-red-500";default:return"bg-muted-foreground/30"}}function tje({projectInfo:e}){return p.jsx("div",{className:"flex shrink-0 items-center justify-between border-b border-border bg-card",children:p.jsxs("div",{className:"flex min-w-0 flex-1 items-center gap-2 px-2 py-1",children:[p.jsxs(ir,{to:"/projects/$projectId",params:{projectId:e.projectId},search:{tab:"workspace"},className:"flex shrink-0 items-center gap-1.5 rounded px-2 py-0.5 text-xs font-medium text-primary hover:bg-primary/10 max-w-[50%]",children:[p.jsx(ne,{icon:Ms,size:12,strokeWidth:2,className:"shrink-0"}),p.jsx("span",{className:"truncate",children:e.projectName})]}),p.jsx("span",{className:"flex min-w-0 items-center gap-1 text-xs text-muted-foreground truncate",children:e.repoPath}),e.appStatus&&p.jsxs("div",{className:"ml-auto flex items-center gap-1.5",children:[p.jsx("span",{className:$e("h-2 w-2 rounded-full",eje(e.appStatus))}),p.jsx("span",{className:"text-xs text-muted-foreground capitalize",children:e.appStatus})]})]})})}function nje({terminals:e,activeIndex:t,onSelect:n,taskInfoByCwd:r}){const i=T.useRef(null),a=T.useRef(null);T.useEffect(()=>{a.current&&i.current&&a.current.scrollIntoView({behavior:"smooth",block:"nearest",inline:"center"})},[t]);const s=(o,l)=>{if(o.cwd&&r){const u=r.get(o.cwd);if(u)return u.title}return o.name||`Terminal ${l+1}`};return p.jsx("div",{ref:i,className:"flex shrink-0 gap-1 overflow-x-auto border-b border-border bg-card px-2 py-1.5",style:{WebkitOverflowScrolling:"touch"},children:e.map((o,l)=>{const u=l===t,d=s(o,l);return p.jsx("button",{ref:u?a:null,onClick:()=>n(l),className:$e("shrink-0 rounded-md px-3 py-1.5 text-xs font-medium transition-colors touch-manipulation","max-w-[150px] truncate",u?"bg-primary text-primary-foreground":"bg-muted text-muted-foreground hover:bg-muted/80"),children:d},o.id)})})}const rje=Gg(function({terminal:t,taskInfo:n,projectInfo:r,isMobile:i,onClose:a,onReady:s,onResize:o,onRename:l,onContainerReady:u,setupImagePaste:d,onFocus:c,sendInputToTerminal:m,isMaximized:g,onMaximize:_,onMinimize:x,canMaximize:b}){const v=Wg(),{resolvedTheme:y}=Fd(),E=y==="dark",C=n?v.terminals.get(t.id):null,w=C?.isStartingUp??!1;T.useEffect(()=>{n&&Lt.terminal.info("TerminalPane isStartingUp check",{terminalId:t.id,hasTaskInfo:!!n,hasTerminalModel:!!C,isStartingUp:C?.isStartingUp,isStartingClaude:w})},[t.id,n,C,w,C?.isStartingUp]);const A=()=>n?p.jsx(J3e,{taskInfo:n,terminalId:t.id,terminalCwd:t.cwd,isMobile:i,sendInputToTerminal:m}):r?p.jsx(tje,{projectInfo:r}):p.jsxs("div",{className:"flex shrink-0 items-center justify-between border-b border-border bg-card",children:[p.jsx(N3e,{name:t.name,status:t.status,exitCode:t.exitCode,className:"flex-1 border-b-0",onRename:l}),p.jsxs("div",{className:"flex items-center gap-1 mr-1",children:[b&&p.jsx(Be,{variant:"ghost",size:"icon-xs",onClick:g?x:_,className:"h-5 w-5 text-muted-foreground hover:text-foreground",title:g?"Restore":"Maximize",children:p.jsx(ne,{icon:g?swe:xwe,size:12,strokeWidth:2})}),a&&p.jsx(Be,{variant:"ghost",size:"icon-xs",onClick:a,className:"h-5 w-5 text-muted-foreground hover:text-foreground",children:p.jsx(ne,{icon:qr,size:12,strokeWidth:2})})]})]});return p.jsxs("div",{className:"flex h-full min-w-0 flex-col overflow-hidden",children:[A(),p.jsxs("div",{className:"relative min-h-0 min-w-0 flex-1",children:[p.jsx(wP,{onReady:s,onResize:o,onContainerReady:u,terminalId:t.id,setupImagePaste:d,onFocus:c}),w&&p.jsx("div",{className:"pointer-events-none absolute inset-0 z-10 flex items-center justify-center bg-terminal-background/90",children:p.jsxs("div",{className:"flex flex-col items-center gap-3",children:[p.jsx(ne,{icon:jt,size:24,strokeWidth:2,className:$e("animate-spin",E?"text-white/60":"text-black/60")}),p.jsx("span",{className:$e("font-mono text-sm",E?"text-white/60":"text-black/60"),children:"Starting Claude Code..."})]})})]})]})});function ije({onAdd:e,message:t}){return p.jsx("div",{className:"flex h-full items-center justify-center bg-terminal-background",children:e?p.jsxs(Be,{variant:"outline",size:"sm",onClick:e,className:"gap-2",children:[p.jsx(ne,{icon:Fm,size:14,strokeWidth:2}),"New Terminal"]}):p.jsx("p",{className:"text-xs text-muted-foreground",children:t||"No terminals"})})}function aje(e){return e<=1?{rows:1,cols:1}:e<=2?{rows:1,cols:2}:e<=4?{rows:2,cols:2}:e<=6?{rows:2,cols:3}:e<=9?{rows:3,cols:3}:{rows:3,cols:4}}function sje({terminals:e,onTerminalClose:t,onTerminalAdd:n,onTerminalReady:r,onTerminalResize:i,onTerminalRename:a,onTerminalContainerReady:s,setupImagePaste:o,writeToTerminal:l,sendInputToTerminal:u,taskInfoByCwd:d,projectInfoByCwd:c,emptyMessage:m}){const g=iT(),[_,x]=T.useState(e.length>0?e[0].id:null),[b,v]=T.useState(0),[y,E]=T.useState(null);if(T.useEffect(()=>{b>=e.length&&e.length>0&&v(e.length-1)},[e.length,b]),T.useEffect(()=>{y&&!e.find(D=>D.id===y)&&E(null)},[e,y]),e.length===0)return p.jsx(ije,{onAdd:n,message:m});const{rows:C,cols:w}=aje(e.length),A=[];for(let D=0;D<C;D++){const L=D*w,U=Math.min(L+w,e.length);L<e.length&&A.push(e.slice(L,U))}const O=D=>{const L=g&&e.length>1?e[b]?.id:_;L&&l&&l(L,D)},R=D=>{const L=D.cwd?d?.get(D.cwd):void 0,U=D.cwd?c?.get(D.cwd):void 0,M=!L&&!U&&e.length>1;return p.jsx(rje,{terminal:D,taskInfo:L,projectInfo:U,isMobile:g,onClose:t?()=>t(D.id):void 0,onReady:r?G=>r(D.id,G):void 0,onResize:i?(G,z)=>i(D.id,G,z):void 0,onRename:a?G=>a(D.id,G):void 0,onContainerReady:s?G=>s(D.id,G):void 0,setupImagePaste:o,onFocus:()=>x(D.id),sendInputToTerminal:u,isMaximized:y===D.id,onMaximize:()=>E(D.id),onMinimize:()=>E(null),canMaximize:M})},N=D=>p.jsxs("div",{className:"flex h-full w-full flex-col",children:[p.jsx("div",{className:"min-h-0 flex-1",children:D}),g&&l&&p.jsx(IS,{onSend:O})]});if(g&&e.length>1){const D=e[b]??e[0];return p.jsxs("div",{className:"flex h-full w-full flex-col",children:[p.jsx(nje,{terminals:e,activeIndex:b,onSelect:v,taskInfoByCwd:d}),p.jsx("div",{className:"min-h-0 flex-1",children:R(D)},D.id),l&&p.jsx(IS,{onSend:O})]})}if(e.length===1)return N(p.jsx("div",{className:"h-full w-full max-w-full min-w-0 overflow-hidden",children:R(e[0])},e[0].id));if(y){const D=e.find(L=>L.id===y);if(D)return N(p.jsx("div",{className:"h-full w-full max-w-full min-w-0 overflow-hidden",children:R(D)},D.id))}return e.length===2?N(p.jsxs(Mf,{direction:g?"vertical":"horizontal",className:"h-full max-w-full",children:[p.jsx(lo,{defaultSize:50,minSize:15,children:R(e[0])},e[0].id),p.jsx(jf,{}),p.jsx(lo,{defaultSize:50,minSize:15,children:R(e[1])},e[1].id)]})):e.length===3?N(p.jsxs(Mf,{direction:"horizontal",className:"h-full max-w-full",children:[p.jsx(lo,{defaultSize:50,minSize:15,children:R(e[0])},e[0].id),p.jsx(jf,{}),p.jsx(lo,{defaultSize:50,minSize:15,children:p.jsxs(Mf,{direction:"vertical",className:"h-full max-w-full",children:[p.jsx(lo,{defaultSize:50,minSize:15,children:R(e[1])},e[1].id),p.jsx(jf,{}),p.jsx(lo,{defaultSize:50,minSize:15,children:R(e[2])},e[2].id)]})})]})):N(p.jsx(Mf,{direction:"vertical",className:"h-full max-w-full",children:A.map((D,L)=>p.jsxs(T.Fragment,{children:[L>0&&p.jsx(jf,{}),p.jsx(lo,{defaultSize:100/A.length,minSize:15,children:D.length===1?R(D[0]):p.jsx(Mf,{direction:"horizontal",className:"h-full max-w-full",children:D.map((U,M)=>p.jsxs(T.Fragment,{children:[M>0&&p.jsx(jf,{}),p.jsx(lo,{defaultSize:100/w,minSize:15,children:R(U)})]},U.id))})})]},`row-${L}`))}))}function oje(e){if(Array.isArray(e))return e}function lje(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,a,s,o=[],l=!0,u=!1;try{if(a=(n=n.call(e)).next,t!==0)for(;!(l=(r=a.call(n)).done)&&(o.push(r.value),o.length!==t);l=!0);}catch(d){u=!0,i=d}finally{try{if(!l&&n.return!=null&&(s=n.return(),Object(s)!==s))return}finally{if(u)throw i}}return o}}function CP(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function Ile(e,t){if(e){if(typeof e=="string")return CP(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?CP(e,t):void 0}}function uje(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
47
47
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Dle(e,t){return oje(e)||lje(e,t)||Ile(e,t)||uje()}var CO={},gv={},uG;function Lle(){if(uG)return gv;uG=1,Object.defineProperty(gv,"__esModule",{value:!0}),gv.bind=void 0;function e(t,n){var r=n.type,i=n.listener,a=n.options;return t.addEventListener(r,i,a),function(){t.removeEventListener(r,i,a)}}return gv.bind=e,gv}var Tf={},cG;function cje(){if(cG)return Tf;cG=1;var e=Tf&&Tf.__assign||function(){return e=Object.assign||function(a){for(var s,o=1,l=arguments.length;o<l;o++){s=arguments[o];for(var u in s)Object.prototype.hasOwnProperty.call(s,u)&&(a[u]=s[u])}return a},e.apply(this,arguments)};Object.defineProperty(Tf,"__esModule",{value:!0}),Tf.bindAll=void 0;var t=Lle();function n(a){if(!(typeof a>"u"))return typeof a=="boolean"?{capture:a}:a}function r(a,s){if(s==null)return a;var o=e(e({},a),{options:e(e({},n(s)),n(a.options))});return o}function i(a,s,o){var l=s.map(function(u){var d=r(u,o);return(0,t.bind)(a,d)});return function(){l.forEach(function(d){return d()})}}return Tf.bindAll=i,Tf}var dG;function dje(){return dG||(dG=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.bindAll=e.bind=void 0;var t=Lle();Object.defineProperty(e,"bind",{enumerable:!0,get:function(){return t.bind}});var n=cje();Object.defineProperty(e,"bindAll",{enumerable:!0,get:function(){return n.bindAll}})})(CO)),CO}var Xm=dje(),Ple="data-pdnd-honey-pot";function Mle(e){return e instanceof Element&&e.hasAttribute(Ple)}function jle(e){var t=document.elementsFromPoint(e.x,e.y),n=Dle(t,2),r=n[0],i=n[1];return r?Mle(r)?i??null:r:null}function Xy(e){"@babel/helpers - typeof";return Xy=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Xy(e)}function fje(e,t){if(Xy(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Xy(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function pje(e){var t=fje(e,"string");return Xy(t)=="symbol"?t:t+""}function x1(e,t,n){return(t=pje(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Fle=2147483647;function fG(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function pG(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?fG(Object(n),!0).forEach(function(r){x1(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):fG(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}var Zy=2,hG=Zy/2;function hje(e){return{x:Math.floor(e.x),y:Math.floor(e.y)}}function mje(e){return{x:e.x-hG,y:e.y-hG}}function gje(e){return{x:Math.max(e.x,0),y:Math.max(e.y,0)}}function bje(e){return{x:Math.min(e.x,window.innerWidth-Zy),y:Math.min(e.y,window.innerHeight-Zy)}}function mG(e){var t=e.client,n=bje(gje(mje(hje(t))));return DOMRect.fromRect({x:n.x,y:n.y,width:Zy,height:Zy})}function gG(e){var t=e.clientRect;return{left:"".concat(t.left,"px"),top:"".concat(t.top,"px"),width:"".concat(t.width,"px"),height:"".concat(t.height,"px")}}function vje(e){var t=e.client,n=e.clientRect;return t.x>=n.x&&t.x<=n.x+n.width&&t.y>=n.y&&t.y<=n.y+n.height}function yje(e){var t=e.initial,n=document.createElement("div");n.setAttribute(Ple,"true");var r=mG({client:t});Object.assign(n.style,pG(pG({backgroundColor:"transparent",position:"fixed",padding:0,margin:0,boxSizing:"border-box"},gG({clientRect:r})),{},{pointerEvents:"auto",zIndex:Fle})),document.body.appendChild(n);var i=Xm.bind(window,{type:"pointermove",listener:function(s){var o={x:s.clientX,y:s.clientY};r=mG({client:o}),Object.assign(n.style,gG({clientRect:r}))},options:{capture:!0}});return function(s){var o=s.current;if(i(),vje({client:o,clientRect:r})){n.remove();return}function l(){u(),n.remove()}var u=Xm.bindAll(window,[{type:"pointerdown",listener:l},{type:"pointermove",listener:l},{type:"focusin",listener:l},{type:"focusout",listener:l},{type:"dragstart",listener:l},{type:"dragenter",listener:l},{type:"dragover",listener:l}],{capture:!0})}}function _je(){var e=null;function t(){return e=null,Xm.bind(window,{type:"pointermove",listener:function(i){e={x:i.clientX,y:i.clientY}},options:{capture:!0}})}function n(){var r=null;return function(a){var s=a.eventName,o=a.payload;if(s==="onDragStart"){var l=o.location.initial.input,u=e??{x:l.clientX,y:l.clientY};r=yje({initial:u})}if(s==="onDrop"){var d,c=o.location.current.input;(d=r)===null||d===void 0||d({current:{x:c.clientX,y:c.clientY}}),r=null,e=null}}}return{bindEvents:t,getOnPostDispatch:n}}function xje(e){if(Array.isArray(e))return CP(e)}function Eje(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Sje(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
48
48
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Ble(e){return xje(e)||Eje(e)||Ile(e)||Sje()}function Gp(e){var t=null;return function(){if(!t){for(var r=arguments.length,i=new Array(r),a=0;a<r;a++)i[a]=arguments[a];var s=e.apply(this,i);t={result:s}}return t.result}}var wje=Gp(function(){return navigator.userAgent.includes("Firefox")}),E1=Gp(function(){var t=navigator,n=t.userAgent;return n.includes("AppleWebKit")&&!n.includes("Chrome")}),TP={isLeavingWindow:Symbol("leaving"),isEnteringWindow:Symbol("entering")};function Cje(e){var t=e.dragLeave;return E1()?t.hasOwnProperty(TP.isLeavingWindow):!1}(function(){if(typeof window>"u"||!E1())return;function t(){return{enterCount:0,isOverWindow:!1}}var n=t();function r(){n=t()}Xm.bindAll(window,[{type:"dragstart",listener:function(){n.enterCount=0,n.isOverWindow=!0}},{type:"drop",listener:r},{type:"dragend",listener:r},{type:"dragenter",listener:function(a){!n.isOverWindow&&n.enterCount===0&&(a[TP.isEnteringWindow]=!0),n.isOverWindow=!0,n.enterCount++}},{type:"dragleave",listener:function(a){n.enterCount--,n.isOverWindow&&n.enterCount===0&&(a[TP.isLeavingWindow]=!0,n.isOverWindow=!1)}}],{capture:!0})})();function Tje(e){return"nodeName"in e}function Aje(e){return Tje(e)&&e.ownerDocument!==document}function kje(e){var t=e.dragLeave,n=t.type,r=t.relatedTarget;return n!=="dragleave"?!1:E1()?Cje({dragLeave:t}):r==null?!0:wje()?Aje(r):r instanceof HTMLIFrameElement}function Oje(e){var t=e.onDragEnd;return[{type:"pointermove",listener:(function(){var n=0;return function(){if(n<20){n++;return}t()}})()},{type:"pointerdown",listener:t}]}function ay(e){return{altKey:e.altKey,button:e.button,buttons:e.buttons,ctrlKey:e.ctrlKey,metaKey:e.metaKey,shiftKey:e.shiftKey,clientX:e.clientX,clientY:e.clientY,pageX:e.pageX,pageY:e.pageY}}var Rje=function(t){var n=[],r=null,i=function(){for(var s=arguments.length,o=new Array(s),l=0;l<s;l++)o[l]=arguments[l];n=o,!r&&(r=requestAnimationFrame(function(){r=null,t.apply(void 0,n)}))};return i.cancel=function(){r&&(cancelAnimationFrame(r),r=null)},i},TO=Rje(function(e){return e()}),zx=(function(){var e=null;function t(r){var i=requestAnimationFrame(function(){e=null,r()});e={frameId:i,fn:r}}function n(){e&&(cancelAnimationFrame(e.frameId),e.fn(),e=null)}return{schedule:t,flush:n}})();function Nje(e){var t=e.source,n=e.initial,r=e.dispatchEvent,i={dropTargets:[]};function a(o){r(o),i={dropTargets:o.payload.location.current.dropTargets}}var s={start:function(l){var u=l.nativeSetDragImage,d={current:n,previous:i,initial:n};a({eventName:"onGenerateDragPreview",payload:{source:t,location:d,nativeSetDragImage:u}}),zx.schedule(function(){a({eventName:"onDragStart",payload:{source:t,location:d}})})},dragUpdate:function(l){var u=l.current;zx.flush(),TO.cancel(),a({eventName:"onDropTargetChange",payload:{source:t,location:{initial:n,previous:i,current:u}}})},drag:function(l){var u=l.current;TO(function(){zx.flush();var d={initial:n,previous:i,current:u};a({eventName:"onDrag",payload:{source:t,location:d}})})},drop:function(l){var u=l.current,d=l.updatedSourcePayload;zx.flush(),TO.cancel(),a({eventName:"onDrop",payload:{source:d??t,location:{current:u,previous:i,initial:n}}})}};return s}var AP={isActive:!1};function Ule(){return!AP.isActive}function Ije(e){return e.dataTransfer?e.dataTransfer.setDragImage.bind(e.dataTransfer):null}function Dje(e){var t=e.current,n=e.next;if(t.length!==n.length)return!0;for(var r=0;r<t.length;r++)if(t[r].element!==n[r].element)return!0;return!1}function Lje(e){var t=e.event,n=e.dragType,r=e.getDropTargetsOver,i=e.dispatchEvent;if(!Ule())return;var a=Pje({event:t,dragType:n,getDropTargetsOver:r});AP.isActive=!0;var s={current:a};AO({event:t,current:a.dropTargets});var o=Nje({source:n.payload,dispatchEvent:i,initial:a});function l(g){var _=Dje({current:s.current.dropTargets,next:g.dropTargets});s.current=g,_&&o.dragUpdate({current:s.current})}function u(g){var _=ay(g),x=Mle(g.target)?jle({x:_.clientX,y:_.clientY}):g.target,b=r({target:x,input:_,source:n.payload,current:s.current.dropTargets});b.length&&(g.preventDefault(),AO({event:g,current:b})),l({dropTargets:b,input:_})}function d(){s.current.dropTargets.length&&l({dropTargets:[],input:s.current.input}),o.drop({current:s.current,updatedSourcePayload:null}),c()}function c(){AP.isActive=!1,m()}var m=Xm.bindAll(window,[{type:"dragover",listener:function(_){u(_),o.drag({current:s.current})}},{type:"dragenter",listener:u},{type:"dragleave",listener:function(_){kje({dragLeave:_})&&(l({input:s.current.input,dropTargets:[]}),n.startedFrom==="external"&&d())}},{type:"drop",listener:function(_){if(s.current={dropTargets:s.current.dropTargets,input:ay(_)},!s.current.dropTargets.length){d();return}_.preventDefault(),AO({event:_,current:s.current.dropTargets}),o.drop({current:s.current,updatedSourcePayload:n.type==="external"?n.getDropPayload(_):null}),c()}},{type:"dragend",listener:function(_){s.current={dropTargets:s.current.dropTargets,input:ay(_)},d()}}].concat(Ble(Oje({onDragEnd:d}))),{capture:!0});o.start({nativeSetDragImage:Ije(t)})}function AO(e){var t,n=e.event,r=e.current,i=(t=r[0])===null||t===void 0?void 0:t.dropEffect;i!=null&&n.dataTransfer&&(n.dataTransfer.dropEffect=i)}function Pje(e){var t=e.event,n=e.dragType,r=e.getDropTargetsOver,i=ay(t);if(n.startedFrom==="external")return{input:i,dropTargets:[]};var a=r({input:i,source:n.payload,target:t.target,current:[]});return{input:i,dropTargets:a}}var bG={canStart:Ule,start:Lje},kP=new Map;function Mje(e){var t=e.typeKey,n=e.mount,r=kP.get(t);if(r)return r.usageCount++,r;var i={typeKey:t,unmount:n(),usageCount:1};return kP.set(t,i),i}function jje(e){var t=Mje(e);return function(){t.usageCount--,!(t.usageCount>0)&&(t.unmount(),kP.delete(e.typeKey))}}function S1(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(){t.forEach(function(i){return i()})}}function $le(e,t){var n=t.attribute,r=t.value;return e.setAttribute(n,r),function(){return e.removeAttribute(n)}}function vG(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function rd(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?vG(Object(n),!0).forEach(function(r){x1(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):vG(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function kO(e,t){var n=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=Fje(e))||t){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(u){throw u},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
49
49
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a,s=!0,o=!1;return{s:function(){n=n.call(e)},n:function(){var u=n.next();return s=u.done,u},e:function(u){o=!0,a=u},f:function(){try{s||n.return==null||n.return()}finally{if(o)throw a}}}}function Fje(e,t){if(e){if(typeof e=="string")return yG(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?yG(e,t):void 0}}function yG(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function OO(e){return e.slice(0).reverse()}function Bje(e){var t=e.typeKey,n=e.defaultDropEffect,r=new WeakMap,i="data-drop-target-for-".concat(t),a="[".concat(i,"]");function s(g){return r.set(g.element,g),function(){return r.delete(g.element)}}function o(g){var _=S1($le(g.element,{attribute:i,value:"true"}),s(g));return Gp(_)}function l(g){var _,x,b,v,y=g.source,E=g.target,C=g.input,w=g.result,A=w===void 0?[]:w;if(E==null)return A;if(!(E instanceof Element))return E instanceof Node?l({source:y,target:E.parentElement,input:C,result:A}):A;var O=E.closest(a);if(O==null)return A;var R=r.get(O);if(R==null)return A;var N={input:C,source:y,element:R.element};if(R.canDrop&&!R.canDrop(N))return l({source:y,target:R.element.parentElement,input:C,result:A});var D=(_=(x=R.getData)===null||x===void 0?void 0:x.call(R,N))!==null&&_!==void 0?_:{},L=(b=(v=R.getDropEffect)===null||v===void 0?void 0:v.call(R,N))!==null&&b!==void 0?b:n,U={data:D,element:R.element,dropEffect:L,isActiveDueToStickiness:!1};return l({source:y,target:R.element.parentElement,input:C,result:[].concat(Ble(A),[U])})}function u(g){var _=g.eventName,x=g.payload,b=kO(x.location.current.dropTargets),v;try{for(b.s();!(v=b.n()).done;){var y,E=v.value,C=r.get(E.element),w=rd(rd({},x),{},{self:E});C==null||(y=C[_])===null||y===void 0||y.call(C,w)}}catch(A){b.e(A)}finally{b.f()}}var d={onGenerateDragPreview:u,onDrag:u,onDragStart:u,onDrop:u,onDropTargetChange:function(_){var x=_.payload,b=new Set(x.location.current.dropTargets.map(function(q){return q.element})),v=new Set,y=kO(x.location.previous.dropTargets),E;try{for(y.s();!(E=y.n()).done;){var C,w=E.value;v.add(w.element);var A=r.get(w.element),O=b.has(w.element),R=rd(rd({},x),{},{self:w});if(A==null||(C=A.onDropTargetChange)===null||C===void 0||C.call(A,R),!O){var N;A==null||(N=A.onDragLeave)===null||N===void 0||N.call(A,R)}}}catch(q){y.e(q)}finally{y.f()}var D=kO(x.location.current.dropTargets),L;try{for(D.s();!(L=D.n()).done;){var U,M,G=L.value;if(!v.has(G.element)){var z=rd(rd({},x),{},{self:G}),H=r.get(G.element);H==null||(U=H.onDropTargetChange)===null||U===void 0||U.call(H,z),H==null||(M=H.onDragEnter)===null||M===void 0||M.call(H,z)}}}catch(q){D.e(q)}finally{D.f()}}};function c(g){d[g.eventName](g)}function m(g){var _=g.source,x=g.target,b=g.input,v=g.current,y=l({source:_,target:x,input:b});if(y.length>=v.length)return y;for(var E=OO(v),C=OO(y),w=[],A=0;A<E.length;A++){var O,R=E[A],N=C[A];if(N!=null){w.push(N);continue}var D=w[A-1],L=E[A-1];if(D?.element!==L?.element)break;var U=r.get(R.element);if(!U)break;var M={input:b,source:_,element:U.element};if(U.canDrop&&!U.canDrop(M)||!((O=U.getIsSticky)!==null&&O!==void 0&&O.call(U,M)))break;w.push(rd(rd({},R),{},{isActiveDueToStickiness:!0}))}return OO(w)}return{dropTargetForConsumers:o,getIsOver:m,dispatchEvent:c}}function Uje(e,t){var n=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=$je(e))||t){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(u){throw u},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
package/dist/index.html CHANGED
@@ -5,7 +5,7 @@
5
5
  <link rel="icon" type="image/png" href="/logo.png" />
6
6
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
7
7
  <title>Vibora - Harness Attention. Ship.</title>
8
- <script type="module" crossorigin src="/assets/index-VmQIGond.js"></script>
8
+ <script type="module" crossorigin src="/assets/index-MHJurbm4.js"></script>
9
9
  <link rel="stylesheet" crossorigin href="/assets/index-CYo_ATvM.css">
10
10
  </head>
11
11
  <body>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vibora",
3
- "version": "9.4.0",
3
+ "version": "9.5.0",
4
4
  "description": "Harness Attention. Orchestrate Agents. Ship.",
5
5
  "license": "PolyForm-Perimeter-1.0.0",
6
6
  "repository": {