@industry-theme/xterm-terminal-panel 0.9.4 → 0.9.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,10 +1,5 @@
1
1
  import "./styles.css";
2
2
  // src/components/ThemedTerminal.tsx
3
- import {
4
- DATA_TYPES as DATA_TYPES2,
5
- sanitizePath,
6
- useDropZone
7
- } from "@principal-ade/panel-framework-core";
8
3
  import { FitAddon } from "@xterm/addon-fit";
9
4
  import { SearchAddon } from "@xterm/addon-search";
10
5
  import { WebLinksAddon } from "@xterm/addon-web-links";
@@ -20,7 +15,7 @@ import {
20
15
  } from "lucide-react";
21
16
  import {
22
17
  forwardRef,
23
- useCallback,
18
+ useCallback as useCallback2,
24
19
  useEffect,
25
20
  useImperativeHandle,
26
21
  useRef,
@@ -28,6 +23,132 @@ import {
28
23
  } from "react";
29
24
  import "@xterm/xterm/css/xterm.css";
30
25
 
26
+ // src/hooks/useTerminalDropZone.tsx
27
+ import {
28
+ DATA_TYPES,
29
+ sanitizePath,
30
+ useDropZone
31
+ } from "@principal-ade/panel-framework-core";
32
+ import { useCallback } from "react";
33
+ import { jsx } from "react/jsx-runtime";
34
+ var FocusDelayMs = 10;
35
+ function getDroppedImageFiles(e) {
36
+ const list = e.dataTransfer?.files;
37
+ if (!list || list.length === 0) return [];
38
+ return Array.from(list).filter((f) => f.type.startsWith("image/"));
39
+ }
40
+ function useTerminalDropZone({
41
+ insertText,
42
+ focus,
43
+ onFilesDropped
44
+ }) {
45
+ const handleDroppedContent = useCallback(
46
+ (content) => {
47
+ insertText(content);
48
+ if (focus) {
49
+ setTimeout(focus, FocusDelayMs);
50
+ }
51
+ },
52
+ [insertText, focus]
53
+ );
54
+ const handleDroppedImageFiles = useCallback(
55
+ async (files) => {
56
+ if (!onFilesDropped || files.length === 0) return;
57
+ try {
58
+ const payload = await Promise.all(
59
+ files.map(async (file) => ({
60
+ name: file.name || "pasted-image.png",
61
+ mimeType: file.type || "image/png",
62
+ data: new Uint8Array(await file.arrayBuffer())
63
+ }))
64
+ );
65
+ const paths = await onFilesDropped(payload);
66
+ if (paths && paths.length > 0) {
67
+ handleDroppedContent(`${paths.map(sanitizePath).join(" ")} `);
68
+ }
69
+ } catch (err) {
70
+ console.error("[useTerminalDropZone] Failed to handle dropped files:", err);
71
+ }
72
+ },
73
+ [onFilesDropped, handleDroppedContent]
74
+ );
75
+ const {
76
+ isDragOver,
77
+ onDrop: handlePanelDrop,
78
+ ...dropZoneProps
79
+ } = useDropZone({
80
+ handlers: [
81
+ {
82
+ dataType: [DATA_TYPES.FILE_PATH, DATA_TYPES.DIRECTORY_PATH],
83
+ onDrop: (data) => {
84
+ const safePath = sanitizePath(data.primaryData);
85
+ handleDroppedContent(safePath);
86
+ }
87
+ },
88
+ {
89
+ dataType: DATA_TYPES.TEXT_SELECTION,
90
+ onDrop: (data) => {
91
+ handleDroppedContent(data.primaryData);
92
+ }
93
+ }
94
+ ],
95
+ onPlainTextDrop: (text, e) => {
96
+ if (getDroppedImageFiles(e).length > 0) return;
97
+ handleDroppedContent(text);
98
+ },
99
+ showVisualFeedback: true
100
+ });
101
+ const handleDrop = useCallback(
102
+ (e) => {
103
+ const imageFiles = getDroppedImageFiles(e);
104
+ handlePanelDrop(e);
105
+ if (imageFiles.length > 0) {
106
+ void handleDroppedImageFiles(imageFiles);
107
+ }
108
+ },
109
+ [handlePanelDrop, handleDroppedImageFiles]
110
+ );
111
+ return {
112
+ isDragOver,
113
+ dropZoneProps,
114
+ handleDrop,
115
+ dropIndicator: isDragOver ? /* @__PURE__ */ jsx(TerminalDropIndicator, {}) : null
116
+ };
117
+ }
118
+ function TerminalDropIndicator() {
119
+ return /* @__PURE__ */ jsx(
120
+ "div",
121
+ {
122
+ style: {
123
+ position: "absolute",
124
+ inset: 0,
125
+ background: "rgba(59, 130, 246, 0.1)",
126
+ border: "2px dashed #3b82f6",
127
+ borderRadius: "4px",
128
+ display: "flex",
129
+ alignItems: "center",
130
+ justifyContent: "center",
131
+ pointerEvents: "none",
132
+ zIndex: 1e3
133
+ },
134
+ children: /* @__PURE__ */ jsx(
135
+ "div",
136
+ {
137
+ style: {
138
+ padding: "8px 16px",
139
+ background: "#3b82f6",
140
+ color: "white",
141
+ borderRadius: "4px",
142
+ fontSize: "13px",
143
+ fontWeight: 500
144
+ },
145
+ children: "Drop to insert"
146
+ }
147
+ )
148
+ }
149
+ );
150
+ }
151
+
31
152
  // src/telemetry.ts
32
153
  import {
33
154
  trace,
@@ -38,7 +159,7 @@ import {
38
159
  // package.json
39
160
  var package_default = {
40
161
  name: "@industry-theme/xterm-terminal-panel",
41
- version: "0.9.3",
162
+ version: "0.9.6",
42
163
  description: "Industry-themed xterm.js terminal components with panel framework integration",
43
164
  type: "module",
44
165
  sideEffects: [
@@ -100,7 +221,6 @@ var package_default = {
100
221
  },
101
222
  dependencies: {
102
223
  clsx: "^2.1.1",
103
- "ghostty-web": "https://github.com/anomalyco/ghostty-web/archive/6e24d040458ddd7aae81572fe2901deec32f9fe7.tar.gz",
104
224
  "react-resizable-panels": "^4.7.3"
105
225
  },
106
226
  peerDependencies: {
@@ -115,6 +235,7 @@ var package_default = {
115
235
  "@xterm/addon-web-links": ">=0.11.0",
116
236
  "@xterm/addon-webgl": ">=0.18.0",
117
237
  "@xterm/xterm": ">=5.5.0",
238
+ "ghostty-web": ">=0.3.0",
118
239
  "lucide-react": ">=0.263.0",
119
240
  react: ">=19.0.0",
120
241
  "react-dom": ">=19.0.0"
@@ -164,6 +285,7 @@ var package_default = {
164
285
  "eslint-plugin-react": "^7.37.2",
165
286
  "eslint-plugin-react-hooks": "^5.0.0",
166
287
  "eslint-plugin-storybook": "10.1.2",
288
+ "ghostty-web": "https://github.com/anomalyco/ghostty-web/archive/6e24d040458ddd7aae81572fe2901deec32f9fe7.tar.gz",
167
289
  "lucide-react": "^0.552.0",
168
290
  prettier: "^3.6.2",
169
291
  react: "^19.1.1",
@@ -248,13 +370,13 @@ function getTerminalCSSVariables(theme) {
248
370
  // src/components/SelectionDragChip.tsx
249
371
  import {
250
372
  createDragPreview,
251
- DATA_TYPES,
373
+ DATA_TYPES as DATA_TYPES2,
252
374
  DRAG_ACTIONS,
253
375
  PANEL_TYPES,
254
376
  useDraggable
255
377
  } from "@principal-ade/panel-framework-core";
256
378
  import { GripVertical } from "lucide-react";
257
- import { jsx, jsxs } from "react/jsx-runtime";
379
+ import { jsx as jsx2, jsxs } from "react/jsx-runtime";
258
380
  function SelectionDragChip({
259
381
  text,
260
382
  x,
@@ -268,7 +390,7 @@ function SelectionDragChip({
268
390
  }) {
269
391
  const snippet = text.length > 80 ? `${text.slice(0, 77)}\u2026` : text;
270
392
  const { isDragging, ...dragProps } = useDraggable({
271
- dataType: DATA_TYPES.TEXT_SELECTION,
393
+ dataType: DATA_TYPES2.TEXT_SELECTION,
272
394
  primaryData: text,
273
395
  sourcePanel,
274
396
  suggestedActions: [DRAG_ACTIONS.INSERT_CONTENT, DRAG_ACTIONS.REFERENCE],
@@ -318,7 +440,7 @@ function SelectionDragChip({
318
440
  title: `Drag selection \u2014 ${label}`,
319
441
  "aria-label": `Drag selected terminal text \u2014 ${label}`,
320
442
  children: [
321
- /* @__PURE__ */ jsx(GripVertical, { size: 13, color: theme.colors.textSecondary }),
443
+ /* @__PURE__ */ jsx2(GripVertical, { size: 13, color: theme.colors.textSecondary }),
322
444
  label
323
445
  ]
324
446
  }
@@ -326,7 +448,7 @@ function SelectionDragChip({
326
448
  }
327
449
 
328
450
  // src/components/WorkingOverlay.tsx
329
- import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
451
+ import { jsx as jsx3, jsxs as jsxs2 } from "react/jsx-runtime";
330
452
  var WorkingOverlay = ({
331
453
  theme,
332
454
  message = "Agent working...",
@@ -369,7 +491,7 @@ var WorkingOverlay = ({
369
491
  marginBottom: "8px"
370
492
  },
371
493
  children: [
372
- /* @__PURE__ */ jsx2(
494
+ /* @__PURE__ */ jsx3(
373
495
  "div",
374
496
  {
375
497
  className: "working-dot",
@@ -382,7 +504,7 @@ var WorkingOverlay = ({
382
504
  }
383
505
  }
384
506
  ),
385
- /* @__PURE__ */ jsx2(
507
+ /* @__PURE__ */ jsx3(
386
508
  "div",
387
509
  {
388
510
  className: "working-dot",
@@ -395,7 +517,7 @@ var WorkingOverlay = ({
395
517
  }
396
518
  }
397
519
  ),
398
- /* @__PURE__ */ jsx2(
520
+ /* @__PURE__ */ jsx3(
399
521
  "div",
400
522
  {
401
523
  className: "working-dot",
@@ -411,7 +533,7 @@ var WorkingOverlay = ({
411
533
  ]
412
534
  }
413
535
  ),
414
- /* @__PURE__ */ jsx2(
536
+ /* @__PURE__ */ jsx3(
415
537
  "div",
416
538
  {
417
539
  style: {
@@ -423,7 +545,7 @@ var WorkingOverlay = ({
423
545
  children: message
424
546
  }
425
547
  ),
426
- subtitle && /* @__PURE__ */ jsx2(
548
+ subtitle && /* @__PURE__ */ jsx3(
427
549
  "div",
428
550
  {
429
551
  style: {
@@ -440,7 +562,7 @@ var WorkingOverlay = ({
440
562
  };
441
563
 
442
564
  // src/components/ThemedTerminal.tsx
443
- import { Fragment, jsx as jsx3, jsxs as jsxs3 } from "react/jsx-runtime";
565
+ import { Fragment, jsx as jsx4, jsxs as jsxs3 } from "react/jsx-runtime";
444
566
  var DEBUG_RESIZE = true;
445
567
  var ThemedTerminal = forwardRef(
446
568
  ({
@@ -529,7 +651,7 @@ var ThemedTerminal = forwardRef(
529
651
  setIsClosingOverlay(true);
530
652
  }
531
653
  }, [isWorking]);
532
- const handleOverlayCloseComplete = useCallback(() => {
654
+ const handleOverlayCloseComplete = useCallback2(() => {
533
655
  setShowWorkingOverlay(false);
534
656
  setIsClosingOverlay(false);
535
657
  const tracer = getTracer();
@@ -542,7 +664,7 @@ var ThemedTerminal = forwardRef(
542
664
  span.setStatus({ code: SpanStatusCode.OK });
543
665
  span.end();
544
666
  }, []);
545
- const trackActivity = useCallback(() => {
667
+ const trackActivity = useCallback2(() => {
546
668
  if (!activityDetection) return;
547
669
  if (activityTimeoutRef.current) {
548
670
  clearTimeout(activityTimeoutRef.current);
@@ -598,78 +720,20 @@ var ThemedTerminal = forwardRef(
598
720
  }
599
721
  };
600
722
  }, []);
601
- const handleDroppedContent = useCallback(
723
+ const insertDroppedText = useCallback2(
602
724
  (content) => {
603
- if (terminal) {
604
- terminal.paste(content);
605
- setTimeout(() => {
606
- terminal.focus();
607
- }, 10);
608
- }
725
+ terminal?.paste(content);
609
726
  },
610
727
  [terminal]
611
728
  );
612
- const getDroppedImageFiles = useCallback(
613
- (e) => {
614
- const list = e.dataTransfer?.files;
615
- if (!list || list.length === 0) return [];
616
- return Array.from(list).filter((f) => f.type.startsWith("image/"));
617
- },
618
- []
619
- );
620
- const handleDroppedImageFiles = useCallback(
621
- async (files) => {
622
- if (!onFilesDropped || files.length === 0) return;
623
- try {
624
- const payload = await Promise.all(
625
- files.map(async (file) => ({
626
- name: file.name || "pasted-image.png",
627
- mimeType: file.type || "image/png",
628
- data: new Uint8Array(await file.arrayBuffer())
629
- }))
630
- );
631
- const paths = await onFilesDropped(payload);
632
- if (paths && paths.length > 0) {
633
- handleDroppedContent(`${paths.map(sanitizePath).join(" ")} `);
634
- }
635
- } catch (err) {
636
- console.error("[ThemedTerminal] Failed to handle dropped files:", err);
637
- }
638
- },
639
- [onFilesDropped, handleDroppedContent]
640
- );
641
- const { isDragOver, onDrop: handlePanelDrop, ...dropZoneProps } = useDropZone({
642
- handlers: [
643
- {
644
- dataType: [DATA_TYPES2.FILE_PATH, DATA_TYPES2.DIRECTORY_PATH],
645
- onDrop: (data) => {
646
- const safePath = sanitizePath(data.primaryData);
647
- handleDroppedContent(safePath);
648
- }
649
- },
650
- {
651
- dataType: DATA_TYPES2.TEXT_SELECTION,
652
- onDrop: (data) => {
653
- handleDroppedContent(data.primaryData);
654
- }
655
- }
656
- ],
657
- onPlainTextDrop: (text, e) => {
658
- if (getDroppedImageFiles(e).length > 0) return;
659
- handleDroppedContent(text);
660
- },
661
- showVisualFeedback: true
729
+ const focusTerminal = useCallback2(() => {
730
+ terminal?.focus();
731
+ }, [terminal]);
732
+ const { dropZoneProps, handleDrop, dropIndicator } = useTerminalDropZone({
733
+ insertText: insertDroppedText,
734
+ focus: focusTerminal,
735
+ onFilesDropped
662
736
  });
663
- const handleDrop = useCallback(
664
- (e) => {
665
- const imageFiles = getDroppedImageFiles(e);
666
- handlePanelDrop(e);
667
- if (imageFiles.length > 0) {
668
- void handleDroppedImageFiles(imageFiles);
669
- }
670
- },
671
- [handlePanelDrop, getDroppedImageFiles, handleDroppedImageFiles]
672
- );
673
737
  useEffect(() => {
674
738
  isVisibleRef.current = isVisible;
675
739
  }, [isVisible]);
@@ -1191,8 +1255,8 @@ var ThemedTerminal = forwardRef(
1191
1255
  },
1192
1256
  children: [
1193
1257
  /* @__PURE__ */ jsxs3("div", { style: { display: "flex", alignItems: "center", gap: "8px" }, children: [
1194
- /* @__PURE__ */ jsx3(TerminalIcon, { size: 16, color: theme.colors.text }),
1195
- /* @__PURE__ */ jsx3(
1258
+ /* @__PURE__ */ jsx4(TerminalIcon, { size: 16, color: theme.colors.text }),
1259
+ /* @__PURE__ */ jsx4(
1196
1260
  "span",
1197
1261
  {
1198
1262
  style: {
@@ -1203,7 +1267,7 @@ var ThemedTerminal = forwardRef(
1203
1267
  children: headerTitle
1204
1268
  }
1205
1269
  ),
1206
- headerSubtitle && /* @__PURE__ */ jsx3(
1270
+ headerSubtitle && /* @__PURE__ */ jsx4(
1207
1271
  "span",
1208
1272
  {
1209
1273
  style: {
@@ -1214,7 +1278,7 @@ var ThemedTerminal = forwardRef(
1214
1278
  }
1215
1279
  ),
1216
1280
  headerBadge && /* @__PURE__ */ jsxs3(Fragment, { children: [
1217
- /* @__PURE__ */ jsx3(
1281
+ /* @__PURE__ */ jsx4(
1218
1282
  "span",
1219
1283
  {
1220
1284
  style: {
@@ -1224,7 +1288,7 @@ var ThemedTerminal = forwardRef(
1224
1288
  children: "\u2022"
1225
1289
  }
1226
1290
  ),
1227
- /* @__PURE__ */ jsx3(
1291
+ /* @__PURE__ */ jsx4(
1228
1292
  "span",
1229
1293
  {
1230
1294
  style: {
@@ -1237,7 +1301,7 @@ var ThemedTerminal = forwardRef(
1237
1301
  ] })
1238
1302
  ] }),
1239
1303
  /* @__PURE__ */ jsxs3("div", { style: { display: "flex", gap: "8px" }, children: [
1240
- onPopOut && /* @__PURE__ */ jsx3(
1304
+ onPopOut && /* @__PURE__ */ jsx4(
1241
1305
  "button",
1242
1306
  {
1243
1307
  type: "button",
@@ -1264,10 +1328,10 @@ var ThemedTerminal = forwardRef(
1264
1328
  e.currentTarget.style.color = theme.colors.textSecondary;
1265
1329
  },
1266
1330
  title: "Open terminal in new window",
1267
- children: /* @__PURE__ */ jsx3(ExternalLink, { size: 16 })
1331
+ children: /* @__PURE__ */ jsx4(ExternalLink, { size: 16 })
1268
1332
  }
1269
1333
  ),
1270
- onClose && /* @__PURE__ */ jsx3(
1334
+ onClose && /* @__PURE__ */ jsx4(
1271
1335
  "button",
1272
1336
  {
1273
1337
  type: "button",
@@ -1294,10 +1358,10 @@ var ThemedTerminal = forwardRef(
1294
1358
  e.currentTarget.style.color = theme.colors.textSecondary;
1295
1359
  },
1296
1360
  title: "Hide terminal (keeps session running)",
1297
- children: /* @__PURE__ */ jsx3(ChevronDown, { size: 16 })
1361
+ children: /* @__PURE__ */ jsx4(ChevronDown, { size: 16 })
1298
1362
  }
1299
1363
  ),
1300
- onDestroy && /* @__PURE__ */ jsx3(
1364
+ onDestroy && /* @__PURE__ */ jsx4(
1301
1365
  "button",
1302
1366
  {
1303
1367
  type: "button",
@@ -1324,7 +1388,7 @@ var ThemedTerminal = forwardRef(
1324
1388
  e.currentTarget.style.color = theme.colors.textSecondary;
1325
1389
  },
1326
1390
  title: "Close terminal session (terminate process)",
1327
- children: /* @__PURE__ */ jsx3(X, { size: 16 })
1391
+ children: /* @__PURE__ */ jsx4(X, { size: 16 })
1328
1392
  }
1329
1393
  )
1330
1394
  ] })
@@ -1347,38 +1411,8 @@ var ThemedTerminal = forwardRef(
1347
1411
  minHeight: 0
1348
1412
  },
1349
1413
  children: [
1350
- isDragOver && /* @__PURE__ */ jsx3(
1351
- "div",
1352
- {
1353
- style: {
1354
- position: "absolute",
1355
- inset: 0,
1356
- background: "rgba(59, 130, 246, 0.1)",
1357
- border: "2px dashed #3b82f6",
1358
- borderRadius: "4px",
1359
- display: "flex",
1360
- alignItems: "center",
1361
- justifyContent: "center",
1362
- pointerEvents: "none",
1363
- zIndex: 1e3
1364
- },
1365
- children: /* @__PURE__ */ jsx3(
1366
- "div",
1367
- {
1368
- style: {
1369
- padding: "8px 16px",
1370
- background: "#3b82f6",
1371
- color: "white",
1372
- borderRadius: "4px",
1373
- fontSize: "13px",
1374
- fontWeight: 500
1375
- },
1376
- children: "Drop to insert"
1377
- }
1378
- )
1379
- }
1380
- ),
1381
- enableSelectionDrag && selectionDrag && /* @__PURE__ */ jsx3(
1414
+ dropIndicator,
1415
+ enableSelectionDrag && selectionDrag && /* @__PURE__ */ jsx4(
1382
1416
  SelectionDragChip,
1383
1417
  {
1384
1418
  text: selectionDrag.text,
@@ -1415,7 +1449,7 @@ var ThemedTerminal = forwardRef(
1415
1449
  animation: "copy-feedback-in 0.15s ease-out"
1416
1450
  },
1417
1451
  children: [
1418
- /* @__PURE__ */ jsx3(Check, { size: 14, strokeWidth: 3 }),
1452
+ /* @__PURE__ */ jsx4(Check, { size: 14, strokeWidth: 3 }),
1419
1453
  "Copied!"
1420
1454
  ]
1421
1455
  }
@@ -1440,8 +1474,8 @@ var ThemedTerminal = forwardRef(
1440
1474
  zIndex: 10
1441
1475
  },
1442
1476
  children: [
1443
- /* @__PURE__ */ jsx3(Monitor, { size: 48, color: theme.colors.textSecondary }),
1444
- /* @__PURE__ */ jsx3(
1477
+ /* @__PURE__ */ jsx4(Monitor, { size: 48, color: theme.colors.textSecondary }),
1478
+ /* @__PURE__ */ jsx4(
1445
1479
  "div",
1446
1480
  {
1447
1481
  style: {
@@ -1453,7 +1487,7 @@ var ThemedTerminal = forwardRef(
1453
1487
  children: overlayState.message
1454
1488
  }
1455
1489
  ),
1456
- overlayState.subtitle && /* @__PURE__ */ jsx3(
1490
+ overlayState.subtitle && /* @__PURE__ */ jsx4(
1457
1491
  "div",
1458
1492
  {
1459
1493
  style: {
@@ -1465,7 +1499,7 @@ var ThemedTerminal = forwardRef(
1465
1499
  children: overlayState.subtitle
1466
1500
  }
1467
1501
  ),
1468
- overlayState.actions && overlayState.actions.length > 0 && /* @__PURE__ */ jsx3(
1502
+ overlayState.actions && overlayState.actions.length > 0 && /* @__PURE__ */ jsx4(
1469
1503
  "div",
1470
1504
  {
1471
1505
  style: {
@@ -1518,7 +1552,7 @@ var ThemedTerminal = forwardRef(
1518
1552
  ]
1519
1553
  }
1520
1554
  ),
1521
- showWorkingOverlay && !overlayState && /* @__PURE__ */ jsx3(
1555
+ showWorkingOverlay && !overlayState && /* @__PURE__ */ jsx4(
1522
1556
  WorkingOverlay,
1523
1557
  {
1524
1558
  theme,
@@ -1541,16 +1575,16 @@ ThemedTerminal.displayName = "ThemedTerminal";
1541
1575
  // src/components/ThemedTerminalWithProvider.tsx
1542
1576
  import { useTheme } from "@principal-ade/industry-theme";
1543
1577
  import { forwardRef as forwardRef2 } from "react";
1544
- import { jsx as jsx4 } from "react/jsx-runtime";
1578
+ import { jsx as jsx5 } from "react/jsx-runtime";
1545
1579
  var ThemedTerminalWithProvider = forwardRef2((props, ref) => {
1546
1580
  const { theme } = useTheme();
1547
- return /* @__PURE__ */ jsx4(ThemedTerminal, { ref, theme, ...props });
1581
+ return /* @__PURE__ */ jsx5(ThemedTerminal, { ref, theme, ...props });
1548
1582
  });
1549
1583
  ThemedTerminalWithProvider.displayName = "ThemedTerminalWithProvider";
1550
1584
 
1551
1585
  // src/components/ProgramStatusBadge.tsx
1552
1586
  import { useTheme as useTheme2 } from "@principal-ade/industry-theme";
1553
- import { jsx as jsx5 } from "react/jsx-runtime";
1587
+ import { jsx as jsx6 } from "react/jsx-runtime";
1554
1588
  var blockedColor = (kind, colors) => {
1555
1589
  switch (kind) {
1556
1590
  case "auth":
@@ -1571,7 +1605,7 @@ var formatProgramStatusRecord = (record) => {
1571
1605
  if (record.title) parts.push(`title=${record.title}`);
1572
1606
  return parts.join("; ");
1573
1607
  };
1574
- var WaveBars = ({ color, animate }) => /* @__PURE__ */ jsx5("div", { style: { display: "flex", gap: 1, alignItems: "center", height: 12 }, children: [0, 1, 2, 3, 4].map((i) => /* @__PURE__ */ jsx5(
1608
+ var WaveBars = ({ color, animate }) => /* @__PURE__ */ jsx6("div", { style: { display: "flex", gap: 1, alignItems: "center", height: 12 }, children: [0, 1, 2, 3, 4].map((i) => /* @__PURE__ */ jsx6(
1575
1609
  "div",
1576
1610
  {
1577
1611
  style: {
@@ -1593,17 +1627,17 @@ var ProgramStatusBadge = ({
1593
1627
  const { theme } = useTheme2();
1594
1628
  switch (record.state) {
1595
1629
  case "working":
1596
- return /* @__PURE__ */ jsx5(
1630
+ return /* @__PURE__ */ jsx6(
1597
1631
  "span",
1598
1632
  {
1599
1633
  title: formatProgramStatusRecord(record),
1600
1634
  style: { display: "flex", alignItems: "center" },
1601
- children: /* @__PURE__ */ jsx5(WaveBars, { color: theme.colors.primary, animate })
1635
+ children: /* @__PURE__ */ jsx6(WaveBars, { color: theme.colors.primary, animate })
1602
1636
  }
1603
1637
  );
1604
1638
  case "blocked": {
1605
1639
  const color = blockedColor(record.kind, theme.colors);
1606
- return /* @__PURE__ */ jsx5(
1640
+ return /* @__PURE__ */ jsx6(
1607
1641
  "span",
1608
1642
  {
1609
1643
  title: formatProgramStatusRecord(record),
@@ -1627,7 +1661,7 @@ var ProgramStatusBadge = ({
1627
1661
  );
1628
1662
  }
1629
1663
  case "done":
1630
- return /* @__PURE__ */ jsx5(
1664
+ return /* @__PURE__ */ jsx6(
1631
1665
  "span",
1632
1666
  {
1633
1667
  title: formatProgramStatusRecord(record),
@@ -1641,7 +1675,7 @@ var ProgramStatusBadge = ({
1641
1675
  }
1642
1676
  );
1643
1677
  case "error":
1644
- return /* @__PURE__ */ jsx5(
1678
+ return /* @__PURE__ */ jsx6(
1645
1679
  "span",
1646
1680
  {
1647
1681
  title: formatProgramStatusRecord(record),
@@ -1663,7 +1697,7 @@ ProgramStatusBadge.displayName = "ProgramStatusBadge";
1663
1697
 
1664
1698
  // src/renderer/XtermRenderer.tsx
1665
1699
  import { forwardRef as forwardRef3, useImperativeHandle as useImperativeHandle2, useRef as useRef2 } from "react";
1666
- import { jsx as jsx6 } from "react/jsx-runtime";
1700
+ import { jsx as jsx7 } from "react/jsx-runtime";
1667
1701
  var XtermRenderer = forwardRef3(
1668
1702
  (props, ref) => {
1669
1703
  const {
@@ -1702,7 +1736,7 @@ var XtermRenderer = forwardRef3(
1702
1736
  }),
1703
1737
  []
1704
1738
  );
1705
- return /* @__PURE__ */ jsx6(
1739
+ return /* @__PURE__ */ jsx7(
1706
1740
  ThemedTerminalWithProvider,
1707
1741
  {
1708
1742
  ref: innerRef,
@@ -1723,7 +1757,7 @@ XtermRenderer.displayName = "XtermRenderer";
1723
1757
  // src/renderer/GhosttyRenderer.tsx
1724
1758
  import { useTheme as useTheme3 } from "@principal-ade/industry-theme";
1725
1759
  import { FitAddon as FitAddon2, Terminal as Terminal2 } from "ghostty-web";
1726
- import { forwardRef as forwardRef4, useCallback as useCallback2, useEffect as useEffect2, useImperativeHandle as useImperativeHandle3, useRef as useRef3 } from "react";
1760
+ import { forwardRef as forwardRef4, useCallback as useCallback3, useEffect as useEffect2, useImperativeHandle as useImperativeHandle3, useRef as useRef3 } from "react";
1727
1761
 
1728
1762
  // src/renderer/ghosttyInit.ts
1729
1763
  import { init } from "ghostty-web";
@@ -1736,7 +1770,7 @@ function ensureGhostty() {
1736
1770
  }
1737
1771
 
1738
1772
  // src/renderer/GhosttyRenderer.tsx
1739
- import { jsx as jsx7 } from "react/jsx-runtime";
1773
+ import { jsx as jsx8, jsxs as jsxs4 } from "react/jsx-runtime";
1740
1774
  var DEFAULT_FONT_STACK = "JetBrains Mono, Menlo, Monaco, monospace";
1741
1775
  var GhosttyRenderer = forwardRef4(
1742
1776
  (props, ref) => {
@@ -1754,9 +1788,10 @@ var GhosttyRenderer = forwardRef4(
1754
1788
  cursorBlink = true,
1755
1789
  cursorStyle,
1756
1790
  fontFamily,
1757
- fontSize = 14
1791
+ fontSize = 14,
1792
+ onFilesDropped
1758
1793
  // Accepted but intentionally not implemented yet:
1759
- // onLinkClick, onFilesDropped
1794
+ // onLinkClick
1760
1795
  } = props;
1761
1796
  const { theme } = useTheme3();
1762
1797
  const containerRef = useRef3(null);
@@ -1768,7 +1803,7 @@ var GhosttyRenderer = forwardRef4(
1768
1803
  autoFocusRef.current = autoFocus;
1769
1804
  const callbacks = useRef3({ onData, onResize, onReady, onScrollPositionChange, onShortcut });
1770
1805
  callbacks.current = { onData, onResize, onReady, onScrollPositionChange, onShortcut };
1771
- const readScrollPosition = useCallback2(() => {
1806
+ const readScrollPosition = useCallback3(() => {
1772
1807
  const term = termRef.current;
1773
1808
  if (!term) return { isAtTop: false, isAtBottom: true };
1774
1809
  const viewportY = typeof term.viewportY === "number" ? term.viewportY : 0;
@@ -1778,7 +1813,7 @@ var GhosttyRenderer = forwardRef4(
1778
1813
  isAtTop: scrollbackLength <= 0 || viewportY >= scrollbackLength - 0.5
1779
1814
  };
1780
1815
  }, []);
1781
- const fit = useCallback2(() => {
1816
+ const fit = useCallback3(() => {
1782
1817
  const term = termRef.current;
1783
1818
  const addon = fitRef.current;
1784
1819
  if (!term || !addon) return;
@@ -1793,7 +1828,7 @@ var GhosttyRenderer = forwardRef4(
1793
1828
  }
1794
1829
  }
1795
1830
  }, []);
1796
- const write = useCallback2((data) => {
1831
+ const write = useCallback3((data) => {
1797
1832
  const term = termRef.current;
1798
1833
  if (term) {
1799
1834
  term.write(data);
@@ -1848,6 +1883,16 @@ var GhosttyRenderer = forwardRef4(
1848
1883
  }
1849
1884
  return false;
1850
1885
  });
1886
+ term.attachCustomWheelEventHandler((event) => {
1887
+ if (term.hasMouseTracking() && !event.shiftKey) return false;
1888
+ if (term.buffer.active.type !== "alternate") return false;
1889
+ const appCursor = term.getMode(1, false);
1890
+ const scrollingUp = event.deltaY < 0;
1891
+ const lines = Math.min(Math.abs(Math.round(event.deltaY / 33)), 5);
1892
+ const sequence = appCursor ? scrollingUp ? "\x1BOA" : "\x1BOB" : scrollingUp ? "\x1B[A" : "\x1B[B";
1893
+ for (let i = 0; i < lines; i += 1) callbacks.current.onData?.(sequence);
1894
+ return true;
1895
+ });
1851
1896
  fit();
1852
1897
  if (pendingWritesRef.current.length > 0) {
1853
1898
  const pending = pendingWritesRef.current;
@@ -1892,6 +1937,17 @@ var GhosttyRenderer = forwardRef4(
1892
1937
  useEffect2(() => {
1893
1938
  if (isVisible && autoFocus) termRef.current?.focus();
1894
1939
  }, [isVisible, autoFocus]);
1940
+ const insertDroppedText = useCallback3((content) => {
1941
+ termRef.current?.paste(content);
1942
+ }, []);
1943
+ const focusTerminal = useCallback3(() => {
1944
+ termRef.current?.focus();
1945
+ }, []);
1946
+ const { dropZoneProps, handleDrop, dropIndicator } = useTerminalDropZone({
1947
+ insertText: insertDroppedText,
1948
+ focus: focusTerminal,
1949
+ onFilesDropped
1950
+ });
1895
1951
  useImperativeHandle3(
1896
1952
  ref,
1897
1953
  () => ({
@@ -1912,20 +1968,30 @@ var GhosttyRenderer = forwardRef4(
1912
1968
  }),
1913
1969
  [fit, readScrollPosition, write]
1914
1970
  );
1915
- return /* @__PURE__ */ jsx7(
1916
- "div",
1917
- {
1918
- ref: containerRef,
1919
- style: {
1920
- width: "100%",
1921
- height: "100%",
1922
- backgroundColor: transparent ? "transparent" : theme.colors.background,
1923
- // ghostty-web's open() sets contenteditable on this container, so the
1924
- // browser would draw its own text caret on top of the canvas cursor.
1925
- // Hide it — the terminal renders its own cursor.
1926
- caretColor: "transparent"
1927
- }
1928
- }
1971
+ return (
1972
+ // ghostty-web owns its container's children (open() appends the canvas and
1973
+ // a hidden textarea), so the drop indicator lives on a wrapper instead of
1974
+ // inside it — no imperative/React child conflicts.
1975
+ /* @__PURE__ */ jsxs4("div", { style: { position: "relative", width: "100%", height: "100%" }, children: [
1976
+ /* @__PURE__ */ jsx8(
1977
+ "div",
1978
+ {
1979
+ ref: containerRef,
1980
+ ...dropZoneProps,
1981
+ onDrop: handleDrop,
1982
+ style: {
1983
+ width: "100%",
1984
+ height: "100%",
1985
+ backgroundColor: transparent ? "transparent" : theme.colors.background,
1986
+ // ghostty-web's open() sets contenteditable on this container, so the
1987
+ // browser would draw its own text caret on top of the canvas cursor.
1988
+ // Hide it — the terminal renders its own cursor.
1989
+ caretColor: "transparent"
1990
+ }
1991
+ }
1992
+ ),
1993
+ dropIndicator
1994
+ ] })
1929
1995
  );
1930
1996
  }
1931
1997
  );
@@ -1943,7 +2009,7 @@ function resolveRenderer(choice) {
1943
2009
  import { useTheme as useTheme4 } from "@principal-ade/industry-theme";
1944
2010
  import {
1945
2011
  forwardRef as forwardRef5,
1946
- useCallback as useCallback3,
2012
+ useCallback as useCallback4,
1947
2013
  useEffect as useEffect3,
1948
2014
  useImperativeHandle as useImperativeHandle4,
1949
2015
  useRef as useRef4,
@@ -1952,8 +2018,8 @@ import {
1952
2018
 
1953
2019
  // src/components/TerminalOverlay.tsx
1954
2020
  import { Monitor as Monitor2 } from "lucide-react";
1955
- import { jsx as jsx8, jsxs as jsxs4 } from "react/jsx-runtime";
1956
- var TerminalOverlay = ({ state, theme }) => /* @__PURE__ */ jsxs4(
2021
+ import { jsx as jsx9, jsxs as jsxs5 } from "react/jsx-runtime";
2022
+ var TerminalOverlay = ({ state, theme }) => /* @__PURE__ */ jsxs5(
1957
2023
  "div",
1958
2024
  {
1959
2025
  style: {
@@ -1973,8 +2039,8 @@ var TerminalOverlay = ({ state, theme }) => /* @__PURE__ */ jsxs4(
1973
2039
  zIndex: 10
1974
2040
  },
1975
2041
  children: [
1976
- /* @__PURE__ */ jsx8(Monitor2, { size: 48, color: theme.colors.textSecondary }),
1977
- /* @__PURE__ */ jsx8(
2042
+ /* @__PURE__ */ jsx9(Monitor2, { size: 48, color: theme.colors.textSecondary }),
2043
+ /* @__PURE__ */ jsx9(
1978
2044
  "div",
1979
2045
  {
1980
2046
  style: {
@@ -1986,7 +2052,7 @@ var TerminalOverlay = ({ state, theme }) => /* @__PURE__ */ jsxs4(
1986
2052
  children: state.message
1987
2053
  }
1988
2054
  ),
1989
- state.subtitle && /* @__PURE__ */ jsx8(
2055
+ state.subtitle && /* @__PURE__ */ jsx9(
1990
2056
  "div",
1991
2057
  {
1992
2058
  style: {
@@ -1998,7 +2064,7 @@ var TerminalOverlay = ({ state, theme }) => /* @__PURE__ */ jsxs4(
1998
2064
  children: state.subtitle
1999
2065
  }
2000
2066
  ),
2001
- state.actions && state.actions.length > 0 && /* @__PURE__ */ jsx8(
2067
+ state.actions && state.actions.length > 0 && /* @__PURE__ */ jsx9(
2002
2068
  "div",
2003
2069
  {
2004
2070
  style: {
@@ -2006,7 +2072,7 @@ var TerminalOverlay = ({ state, theme }) => /* @__PURE__ */ jsxs4(
2006
2072
  gap: "12px",
2007
2073
  marginTop: "8px"
2008
2074
  },
2009
- children: state.actions.map((action) => /* @__PURE__ */ jsxs4(
2075
+ children: state.actions.map((action) => /* @__PURE__ */ jsxs5(
2010
2076
  "button",
2011
2077
  {
2012
2078
  type: "button",
@@ -2053,7 +2119,7 @@ var TerminalOverlay = ({ state, theme }) => /* @__PURE__ */ jsxs4(
2053
2119
  );
2054
2120
 
2055
2121
  // src/components/TerminalSession.tsx
2056
- import { jsx as jsx9, jsxs as jsxs5 } from "react/jsx-runtime";
2122
+ import { jsx as jsx10, jsxs as jsxs6 } from "react/jsx-runtime";
2057
2123
  var TerminalSession = forwardRef5(
2058
2124
  (props, ref) => {
2059
2125
  const {
@@ -2097,7 +2163,7 @@ var TerminalSession = forwardRef5(
2097
2163
  const isActiveRef = useRef4(false);
2098
2164
  const activityStartedAtRef = useRef4(0);
2099
2165
  const activityTimerRef = useRef4(null);
2100
- const claimAndConnect = useCallback3(
2166
+ const claimAndConnect = useCallback4(
2101
2167
  async (targetSessionId, force = false) => {
2102
2168
  if (!enableOwnership) return;
2103
2169
  try {
@@ -2222,7 +2288,7 @@ var TerminalSession = forwardRef5(
2222
2288
  }
2223
2289
  };
2224
2290
  }, []);
2225
- const observeActivity = useCallback3(() => {
2291
+ const observeActivity = useCallback4(() => {
2226
2292
  if (!activityDetection) return;
2227
2293
  const now = Date.now();
2228
2294
  const emitBus = (isWorking2) => {
@@ -2272,7 +2338,7 @@ var TerminalSession = forwardRef5(
2272
2338
  if (activityTimerRef.current) clearTimeout(activityTimerRef.current);
2273
2339
  };
2274
2340
  }, []);
2275
- const handleData = useCallback3(
2341
+ const handleData = useCallback4(
2276
2342
  (data) => {
2277
2343
  if (localSessionId && actions.writeToTerminal) {
2278
2344
  actions.writeToTerminal(localSessionId, data);
@@ -2280,14 +2346,14 @@ var TerminalSession = forwardRef5(
2280
2346
  },
2281
2347
  [localSessionId, actions]
2282
2348
  );
2283
- const handleFilesDropped = useCallback3(
2349
+ const handleFilesDropped = useCallback4(
2284
2350
  async (files) => {
2285
2351
  if (!localSessionId || !actions.saveDroppedFiles) return [];
2286
2352
  return actions.saveDroppedFiles(files, localSessionId);
2287
2353
  },
2288
2354
  [localSessionId, actions]
2289
2355
  );
2290
- const handleResize = useCallback3(
2356
+ const handleResize = useCallback4(
2291
2357
  (cols, rows) => {
2292
2358
  if (localSessionId && actions.resizeTerminal) {
2293
2359
  actions.resizeTerminal(localSessionId, cols, rows);
@@ -2295,7 +2361,7 @@ var TerminalSession = forwardRef5(
2295
2361
  },
2296
2362
  [localSessionId, actions]
2297
2363
  );
2298
- const handleReady = useCallback3(
2364
+ const handleReady = useCallback4(
2299
2365
  (cols, rows) => {
2300
2366
  if (!localSessionId || !actions.resizeTerminal) return;
2301
2367
  const shouldForce = needsRefreshOnResizeRef.current;
@@ -2323,7 +2389,7 @@ var TerminalSession = forwardRef5(
2323
2389
  },
2324
2390
  [localSessionId, actions]
2325
2391
  );
2326
- const handleLinkClickInternal = useCallback3(
2392
+ const handleLinkClickInternal = useCallback4(
2327
2393
  (url, modifiers) => {
2328
2394
  onLinkClick?.(url, modifiers);
2329
2395
  if (localSessionId && events) {
@@ -2344,7 +2410,7 @@ var TerminalSession = forwardRef5(
2344
2410
  },
2345
2411
  [localSessionId, events, onLinkClick]
2346
2412
  );
2347
- const handleShortcutInternal = useCallback3(
2413
+ const handleShortcutInternal = useCallback4(
2348
2414
  (evt) => {
2349
2415
  onShortcut?.(evt);
2350
2416
  if (localSessionId && events) {
@@ -2361,7 +2427,7 @@ var TerminalSession = forwardRef5(
2361
2427
  },
2362
2428
  [localSessionId, events, onShortcut]
2363
2429
  );
2364
- const handleScrollPositionChangeInternal = useCallback3(
2430
+ const handleScrollPositionChangeInternal = useCallback4(
2365
2431
  (p) => {
2366
2432
  onScrollPositionChange?.(p);
2367
2433
  },
@@ -2380,7 +2446,7 @@ var TerminalSession = forwardRef5(
2380
2446
  unsubscribe();
2381
2447
  };
2382
2448
  }, [enableOwnership, localSessionId, actions]);
2383
- const handleTakeControl = useCallback3(async () => {
2449
+ const handleTakeControl = useCallback4(async () => {
2384
2450
  if (!localSessionId) return;
2385
2451
  await claimAndConnect(localSessionId, true);
2386
2452
  }, [localSessionId, claimAndConnect]);
@@ -2395,7 +2461,7 @@ var TerminalSession = forwardRef5(
2395
2461
  [localSessionId]
2396
2462
  );
2397
2463
  if (!isInitialized) {
2398
- return /* @__PURE__ */ jsxs5(
2464
+ return /* @__PURE__ */ jsxs6(
2399
2465
  "div",
2400
2466
  {
2401
2467
  style: {
@@ -2406,7 +2472,7 @@ var TerminalSession = forwardRef5(
2406
2472
  padding: "10px 0 0 10px"
2407
2473
  },
2408
2474
  children: [
2409
- /* @__PURE__ */ jsx9(
2475
+ /* @__PURE__ */ jsx10(
2410
2476
  "div",
2411
2477
  {
2412
2478
  style: {
@@ -2417,7 +2483,7 @@ var TerminalSession = forwardRef5(
2417
2483
  }
2418
2484
  }
2419
2485
  ),
2420
- /* @__PURE__ */ jsx9("style", { children: `@keyframes terminal-session-cursor-blink {
2486
+ /* @__PURE__ */ jsx10("style", { children: `@keyframes terminal-session-cursor-blink {
2421
2487
  0%, 100% { opacity: 1; }
2422
2488
  50% { opacity: 0; }
2423
2489
  }` })
@@ -2438,8 +2504,8 @@ var TerminalSession = forwardRef5(
2438
2504
  opacity: 1
2439
2505
  } : void 0;
2440
2506
  const effectiveOverlay = ownershipLostOverlay ?? overlayState;
2441
- return /* @__PURE__ */ jsxs5("div", { style: { position: "relative", height: "100%", width: "100%" }, children: [
2442
- /* @__PURE__ */ jsx9(
2507
+ return /* @__PURE__ */ jsxs6("div", { style: { position: "relative", height: "100%", width: "100%" }, children: [
2508
+ /* @__PURE__ */ jsx10(
2443
2509
  Renderer,
2444
2510
  {
2445
2511
  ref: rendererRef,
@@ -2458,8 +2524,8 @@ var TerminalSession = forwardRef5(
2458
2524
  },
2459
2525
  shouldRenderTerminal ? "active" : "overlay"
2460
2526
  ),
2461
- effectiveOverlay && /* @__PURE__ */ jsx9(TerminalOverlay, { state: effectiveOverlay, theme }),
2462
- isWorking && !effectiveOverlay && /* @__PURE__ */ jsx9(
2527
+ effectiveOverlay && /* @__PURE__ */ jsx10(TerminalOverlay, { state: effectiveOverlay, theme }),
2528
+ isWorking && !effectiveOverlay && /* @__PURE__ */ jsx10(
2463
2529
  WorkingOverlay,
2464
2530
  {
2465
2531
  theme,
@@ -2515,12 +2581,12 @@ function useThemedTerminal() {
2515
2581
  // src/components/TabBar/TabBar.tsx
2516
2582
  import { useTheme as useTheme7 } from "@principal-ade/industry-theme";
2517
2583
  import { Plus } from "lucide-react";
2518
- import { useState as useState3, useCallback as useCallback5 } from "react";
2584
+ import { useState as useState3, useCallback as useCallback6 } from "react";
2519
2585
 
2520
2586
  // src/components/TabBar/TabButton.tsx
2521
2587
  import { useTheme as useTheme6 } from "@principal-ade/industry-theme";
2522
- import { useCallback as useCallback4 } from "react";
2523
- import { jsx as jsx10, jsxs as jsxs6 } from "react/jsx-runtime";
2588
+ import { useCallback as useCallback5 } from "react";
2589
+ import { jsx as jsx11, jsxs as jsxs7 } from "react/jsx-runtime";
2524
2590
  var TabButton = ({
2525
2591
  tab,
2526
2592
  isActive,
@@ -2547,7 +2613,7 @@ var TabButton = ({
2547
2613
  const { theme } = useTheme6();
2548
2614
  const showCloseButton = isHovered || isActive;
2549
2615
  const closable = tab.closable !== false;
2550
- const handleDragStart = useCallback4(
2616
+ const handleDragStart = useCallback5(
2551
2617
  (e) => {
2552
2618
  const target = e.currentTarget;
2553
2619
  e.dataTransfer.setData("application/x-tab-association", tab.id);
@@ -2575,10 +2641,10 @@ var TabButton = ({
2575
2641
  },
2576
2642
  [tab.id, onDragStart]
2577
2643
  );
2578
- const handleDragEnd = useCallback4(() => {
2644
+ const handleDragEnd = useCallback5(() => {
2579
2645
  onDragEnd?.();
2580
2646
  }, [onDragEnd]);
2581
- const handleDragOver = useCallback4(
2647
+ const handleDragOver = useCallback5(
2582
2648
  (e) => {
2583
2649
  if (canAcceptDrop) {
2584
2650
  e.preventDefault();
@@ -2587,7 +2653,7 @@ var TabButton = ({
2587
2653
  },
2588
2654
  [canAcceptDrop]
2589
2655
  );
2590
- const handleDrop = useCallback4(
2656
+ const handleDrop = useCallback5(
2591
2657
  (e) => {
2592
2658
  e.preventDefault();
2593
2659
  const draggedTabId = e.dataTransfer.getData("application/x-tab-association");
@@ -2597,14 +2663,14 @@ var TabButton = ({
2597
2663
  },
2598
2664
  [tab.id, onDrop]
2599
2665
  );
2600
- const handleDragEnter = useCallback4(
2666
+ const handleDragEnter = useCallback5(
2601
2667
  (e) => {
2602
2668
  e.preventDefault();
2603
2669
  onDragEnter?.();
2604
2670
  },
2605
2671
  [onDragEnter]
2606
2672
  );
2607
- const handleDragLeave = useCallback4(
2673
+ const handleDragLeave = useCallback5(
2608
2674
  (e) => {
2609
2675
  e.preventDefault();
2610
2676
  onDragLeave?.();
@@ -2621,7 +2687,7 @@ var TabButton = ({
2621
2687
  }
2622
2688
  return {};
2623
2689
  };
2624
- return /* @__PURE__ */ jsxs6(
2690
+ return /* @__PURE__ */ jsxs7(
2625
2691
  "div",
2626
2692
  {
2627
2693
  "data-tab-id": tab.id,
@@ -2663,7 +2729,7 @@ var TabButton = ({
2663
2729
  ...getDragOverStyles()
2664
2730
  },
2665
2731
  children: [
2666
- closable && showCloseButton && /* @__PURE__ */ jsx10(
2732
+ closable && showCloseButton && /* @__PURE__ */ jsx11(
2667
2733
  "button",
2668
2734
  {
2669
2735
  onClick: (e) => {
@@ -2698,12 +2764,12 @@ var TabButton = ({
2698
2764
  (() => {
2699
2765
  const icon = renderIcon ? renderIcon(tab) : void 0;
2700
2766
  const displayIcon = icon !== void 0 ? icon : tab.icon;
2701
- return displayIcon ? /* @__PURE__ */ jsx10("div", { style: { flexShrink: 0, display: "flex", alignItems: "center", pointerEvents: "none" }, children: displayIcon }) : null;
2767
+ return displayIcon ? /* @__PURE__ */ jsx11("div", { style: { flexShrink: 0, display: "flex", alignItems: "center", pointerEvents: "none" }, children: displayIcon }) : null;
2702
2768
  })(),
2703
2769
  (() => {
2704
2770
  const label = renderLabel ? renderLabel(tab) : void 0;
2705
2771
  const displayLabel = label !== void 0 ? label : tab.label;
2706
- return /* @__PURE__ */ jsx10(
2772
+ return /* @__PURE__ */ jsx11(
2707
2773
  "span",
2708
2774
  {
2709
2775
  style: {
@@ -2717,7 +2783,7 @@ var TabButton = ({
2717
2783
  }
2718
2784
  );
2719
2785
  })(),
2720
- renderAccessory ? renderAccessory(tab) : keyboardHint && /* @__PURE__ */ jsx10(
2786
+ renderAccessory ? renderAccessory(tab) : keyboardHint && /* @__PURE__ */ jsx11(
2721
2787
  "span",
2722
2788
  {
2723
2789
  style: {
@@ -2736,7 +2802,7 @@ var TabButton = ({
2736
2802
  TabButton.displayName = "TabButton";
2737
2803
 
2738
2804
  // src/components/TabBar/TabBar.tsx
2739
- import { jsx as jsx11, jsxs as jsxs7 } from "react/jsx-runtime";
2805
+ import { jsx as jsx12, jsxs as jsxs8 } from "react/jsx-runtime";
2740
2806
  var TabBar = ({
2741
2807
  tabs,
2742
2808
  activeTabId,
@@ -2759,14 +2825,14 @@ var TabBar = ({
2759
2825
  const [hoveredTabId, setHoveredTabId] = useState3(null);
2760
2826
  const [draggedTabId, setDraggedTabId] = useState3(null);
2761
2827
  const [dragOverTabId, setDragOverTabId] = useState3(null);
2762
- const handleDragStart = useCallback5((tabId) => {
2828
+ const handleDragStart = useCallback6((tabId) => {
2763
2829
  setDraggedTabId(tabId);
2764
2830
  }, []);
2765
- const handleDragEnd = useCallback5(() => {
2831
+ const handleDragEnd = useCallback6(() => {
2766
2832
  setDraggedTabId(null);
2767
2833
  setDragOverTabId(null);
2768
2834
  }, []);
2769
- const handleDrop = useCallback5(
2835
+ const handleDrop = useCallback6(
2770
2836
  (targetTabId, draggedId) => {
2771
2837
  if (draggedId !== targetTabId) {
2772
2838
  onTabDrop?.(draggedId, targetTabId);
@@ -2776,13 +2842,13 @@ var TabBar = ({
2776
2842
  },
2777
2843
  [onTabDrop]
2778
2844
  );
2779
- const handleDragEnter = useCallback5((tabId) => {
2845
+ const handleDragEnter = useCallback6((tabId) => {
2780
2846
  setDragOverTabId(tabId);
2781
2847
  }, []);
2782
- const handleDragLeave = useCallback5(() => {
2848
+ const handleDragLeave = useCallback6(() => {
2783
2849
  setDragOverTabId(null);
2784
2850
  }, []);
2785
- return /* @__PURE__ */ jsxs7(
2851
+ return /* @__PURE__ */ jsxs8(
2786
2852
  "div",
2787
2853
  {
2788
2854
  className,
@@ -2794,7 +2860,7 @@ var TabBar = ({
2794
2860
  boxSizing: "border-box"
2795
2861
  },
2796
2862
  children: [
2797
- leftSection && /* @__PURE__ */ jsx11(
2863
+ leftSection && /* @__PURE__ */ jsx12(
2798
2864
  "div",
2799
2865
  {
2800
2866
  style: {
@@ -2810,7 +2876,7 @@ var TabBar = ({
2810
2876
  children: leftSection
2811
2877
  }
2812
2878
  ),
2813
- /* @__PURE__ */ jsx11(
2879
+ /* @__PURE__ */ jsx12(
2814
2880
  "div",
2815
2881
  {
2816
2882
  style: {
@@ -2823,7 +2889,7 @@ var TabBar = ({
2823
2889
  },
2824
2890
  children: tabs.map((tab, index) => {
2825
2891
  const canDrop = enableDragAndDrop && draggedTabId !== null && draggedTabId !== tab.id ? canDropOnTab ? canDropOnTab(draggedTabId, tab.id) : true : false;
2826
- return /* @__PURE__ */ jsx11(
2892
+ return /* @__PURE__ */ jsx12(
2827
2893
  TabButton,
2828
2894
  {
2829
2895
  tab,
@@ -2852,7 +2918,7 @@ var TabBar = ({
2852
2918
  })
2853
2919
  }
2854
2920
  ),
2855
- rightSection !== void 0 ? rightSection && /* @__PURE__ */ jsx11(
2921
+ rightSection !== void 0 ? rightSection && /* @__PURE__ */ jsx12(
2856
2922
  "div",
2857
2923
  {
2858
2924
  style: {
@@ -2867,7 +2933,7 @@ var TabBar = ({
2867
2933
  },
2868
2934
  children: rightSection
2869
2935
  }
2870
- ) : onNewTab && /* @__PURE__ */ jsx11(
2936
+ ) : onNewTab && /* @__PURE__ */ jsx12(
2871
2937
  "div",
2872
2938
  {
2873
2939
  style: {
@@ -2880,7 +2946,7 @@ var TabBar = ({
2880
2946
  borderBottom: `1px solid ${theme.colors.border}`,
2881
2947
  boxSizing: "border-box"
2882
2948
  },
2883
- children: /* @__PURE__ */ jsx11(
2949
+ children: /* @__PURE__ */ jsx12(
2884
2950
  "button",
2885
2951
  {
2886
2952
  onClick: onNewTab,
@@ -2903,7 +2969,7 @@ var TabBar = ({
2903
2969
  e.currentTarget.style.backgroundColor = "transparent";
2904
2970
  },
2905
2971
  title: "New Tab (\u2318T)",
2906
- children: /* @__PURE__ */ jsx11(Plus, { size: 14 })
2972
+ children: /* @__PURE__ */ jsx12(Plus, { size: 14 })
2907
2973
  }
2908
2974
  )
2909
2975
  }
@@ -2962,7 +3028,7 @@ import { CollapsibleSplitPane } from "@principal-ade/panels";
2962
3028
  import { Terminal as TerminalIcon2, Box, Boxes, Paperclip } from "lucide-react";
2963
3029
  import React4, {
2964
3030
  useState as useState4,
2965
- useCallback as useCallback6,
3031
+ useCallback as useCallback7,
2966
3032
  useEffect as useEffect5,
2967
3033
  useRef as useRef5
2968
3034
  } from "react";
@@ -2971,7 +3037,7 @@ import React4, {
2971
3037
  import { useTheme as useTheme8 } from "@principal-ade/industry-theme";
2972
3038
  import { Folder, GitBranch } from "lucide-react";
2973
3039
  import React3 from "react";
2974
- import { jsx as jsx12, jsxs as jsxs8 } from "react/jsx-runtime";
3040
+ import { jsx as jsx13, jsxs as jsxs9 } from "react/jsx-runtime";
2975
3041
  var AVATAR_SIZE = 14;
2976
3042
  var TerminalStatusBar = ({
2977
3043
  directory,
@@ -3001,13 +3067,13 @@ var TerminalStatusBar = ({
3001
3067
  if (repo) {
3002
3068
  const avatarUrl = repo.avatarUrl ?? `https://github.com/${repo.owner}.png?size=48`;
3003
3069
  const showAvatar = Boolean(repo.owner) && !avatarFailed;
3004
- return /* @__PURE__ */ jsxs8(
3070
+ return /* @__PURE__ */ jsxs9(
3005
3071
  "div",
3006
3072
  {
3007
3073
  style: containerStyle,
3008
3074
  title: `${repo.owner}/${repo.repo}${repo.branch ? ` \u2014 ${repo.branch}` : ""}`,
3009
3075
  children: [
3010
- showAvatar ? /* @__PURE__ */ jsx12(
3076
+ showAvatar ? /* @__PURE__ */ jsx13(
3011
3077
  "img",
3012
3078
  {
3013
3079
  src: avatarUrl,
@@ -3022,8 +3088,8 @@ var TerminalStatusBar = ({
3022
3088
  borderRadius: "50%"
3023
3089
  }
3024
3090
  }
3025
- ) : /* @__PURE__ */ jsx12(Folder, { size: 12, style: { flex: "0 0 auto", opacity: 0.7 } }),
3026
- /* @__PURE__ */ jsxs8(
3091
+ ) : /* @__PURE__ */ jsx13(Folder, { size: 12, style: { flex: "0 0 auto", opacity: 0.7 } }),
3092
+ /* @__PURE__ */ jsxs9(
3027
3093
  "span",
3028
3094
  {
3029
3095
  style: {
@@ -3033,15 +3099,15 @@ var TerminalStatusBar = ({
3033
3099
  minWidth: 0
3034
3100
  },
3035
3101
  children: [
3036
- /* @__PURE__ */ jsxs8("span", { style: { opacity: 0.7 }, children: [
3102
+ /* @__PURE__ */ jsxs9("span", { style: { opacity: 0.7 }, children: [
3037
3103
  repo.owner,
3038
3104
  "/"
3039
3105
  ] }),
3040
- /* @__PURE__ */ jsx12("span", { style: { color: theme.colors.text }, children: repo.repo })
3106
+ /* @__PURE__ */ jsx13("span", { style: { color: theme.colors.text }, children: repo.repo })
3041
3107
  ]
3042
3108
  }
3043
3109
  ),
3044
- repo.branch && /* @__PURE__ */ jsxs8(
3110
+ repo.branch && /* @__PURE__ */ jsxs9(
3045
3111
  "span",
3046
3112
  {
3047
3113
  style: {
@@ -3052,9 +3118,9 @@ var TerminalStatusBar = ({
3052
3118
  opacity: 0.85
3053
3119
  },
3054
3120
  children: [
3055
- /* @__PURE__ */ jsx12(GitBranch, { size: 12, style: { flex: "0 0 auto", opacity: 0.7 } }),
3056
- /* @__PURE__ */ jsx12("span", { children: repo.branch }),
3057
- repo.isDirty && /* @__PURE__ */ jsx12(
3121
+ /* @__PURE__ */ jsx13(GitBranch, { size: 12, style: { flex: "0 0 auto", opacity: 0.7 } }),
3122
+ /* @__PURE__ */ jsx13("span", { children: repo.branch }),
3123
+ repo.isDirty && /* @__PURE__ */ jsx13(
3058
3124
  "span",
3059
3125
  {
3060
3126
  title: "Uncommitted changes",
@@ -3070,7 +3136,7 @@ var TerminalStatusBar = ({
3070
3136
  ]
3071
3137
  }
3072
3138
  ),
3073
- (repo.ahead || repo.behind) && /* @__PURE__ */ jsxs8("span", { style: { flex: "0 0 auto", opacity: 0.7 }, children: [
3139
+ (repo.ahead || repo.behind) && /* @__PURE__ */ jsxs9("span", { style: { flex: "0 0 auto", opacity: 0.7 }, children: [
3074
3140
  repo.ahead ? `\u2191${repo.ahead}` : "",
3075
3141
  repo.behind ? `\u2193${repo.behind}` : ""
3076
3142
  ] })
@@ -3081,9 +3147,9 @@ var TerminalStatusBar = ({
3081
3147
  if (!directory) {
3082
3148
  return null;
3083
3149
  }
3084
- return /* @__PURE__ */ jsxs8("div", { style: containerStyle, title: directory, children: [
3085
- /* @__PURE__ */ jsx12(Folder, { size: 12, style: { flex: "0 0 auto", opacity: 0.7 } }),
3086
- /* @__PURE__ */ jsx12(
3150
+ return /* @__PURE__ */ jsxs9("div", { style: containerStyle, title: directory, children: [
3151
+ /* @__PURE__ */ jsx13(Folder, { size: 12, style: { flex: "0 0 auto", opacity: 0.7 } }),
3152
+ /* @__PURE__ */ jsx13(
3087
3153
  "span",
3088
3154
  {
3089
3155
  style: {
@@ -3094,7 +3160,7 @@ var TerminalStatusBar = ({
3094
3160
  textOverflow: "ellipsis",
3095
3161
  minWidth: 0
3096
3162
  },
3097
- children: /* @__PURE__ */ jsx12("bdi", { children: directory })
3163
+ children: /* @__PURE__ */ jsx13("bdi", { children: directory })
3098
3164
  }
3099
3165
  )
3100
3166
  ] });
@@ -3102,9 +3168,9 @@ var TerminalStatusBar = ({
3102
3168
  TerminalStatusBar.displayName = "TerminalStatusBar";
3103
3169
 
3104
3170
  // src/panels/TabbedTerminalPanel.tsx
3105
- import { Fragment as Fragment2, jsx as jsx13, jsxs as jsxs9 } from "react/jsx-runtime";
3106
- var ActivityIndicator = ({ color, isAnimating }) => /* @__PURE__ */ jsxs9("div", { style: { display: "flex", gap: 1, alignItems: "center", height: 12 }, children: [
3107
- [0, 1, 2, 3, 4].map((i) => /* @__PURE__ */ jsx13(
3171
+ import { Fragment as Fragment2, jsx as jsx14, jsxs as jsxs10 } from "react/jsx-runtime";
3172
+ var ActivityIndicator = ({ color, isAnimating }) => /* @__PURE__ */ jsxs10("div", { style: { display: "flex", gap: 1, alignItems: "center", height: 12 }, children: [
3173
+ [0, 1, 2, 3, 4].map((i) => /* @__PURE__ */ jsx14(
3108
3174
  "div",
3109
3175
  {
3110
3176
  style: {
@@ -3119,7 +3185,7 @@ var ActivityIndicator = ({ color, isAnimating }) => /* @__PURE__ */ jsxs9("div",
3119
3185
  },
3120
3186
  i
3121
3187
  )),
3122
- /* @__PURE__ */ jsx13("style", { children: `
3188
+ /* @__PURE__ */ jsx14("style", { children: `
3123
3189
  @keyframes waveSine {
3124
3190
  0%, 100% { transform: scaleY(0.4); }
3125
3191
  50% { transform: scaleY(1); }
@@ -3146,17 +3212,17 @@ function TerminalTabContentInner(props, ref) {
3146
3212
  } = props;
3147
3213
  const [isWorkingFromActivity, setIsWorkingFromActivity] = useState4(false);
3148
3214
  const sessionRef = useRef5(null);
3149
- const handleSessionCreated = useCallback6(
3215
+ const handleSessionCreated = useCallback7(
3150
3216
  (sid) => onSessionCreated(tab.id, sid),
3151
3217
  [onSessionCreated, tab.id]
3152
3218
  );
3153
- const handleScrollPositionChange = useCallback6(
3219
+ const handleScrollPositionChange = useCallback7(
3154
3220
  (position) => {
3155
3221
  onScrollPositionChange?.(tab.id, position);
3156
3222
  },
3157
3223
  [onScrollPositionChange, tab.id]
3158
3224
  );
3159
- const handleActivityChange = useCallback6(
3225
+ const handleActivityChange = useCallback7(
3160
3226
  (state) => {
3161
3227
  const sid = sessionRef.current?.getSessionId();
3162
3228
  if (sid) {
@@ -3175,7 +3241,7 @@ function TerminalTabContentInner(props, ref) {
3175
3241
  }),
3176
3242
  []
3177
3243
  );
3178
- return /* @__PURE__ */ jsx13(
3244
+ return /* @__PURE__ */ jsx14(
3179
3245
  "div",
3180
3246
  {
3181
3247
  style: {
@@ -3189,7 +3255,7 @@ function TerminalTabContentInner(props, ref) {
3189
3255
  height: "100%",
3190
3256
  width: "100%"
3191
3257
  },
3192
- children: /* @__PURE__ */ jsx13(
3258
+ children: /* @__PURE__ */ jsx14(
3193
3259
  TerminalSession,
3194
3260
  {
3195
3261
  ref: sessionRef,
@@ -3348,7 +3414,7 @@ var TabbedTerminalPanelInner = ({
3348
3414
  onFocusTabHandled?.();
3349
3415
  }
3350
3416
  }, [requestFocusTabId, ownedTabs, foreignTabs, setActiveTabId, onFocusTabHandled, activeTabId]);
3351
- const getOwnedTabLabel = useCallback6((index, _directory) => {
3417
+ const getOwnedTabLabel = useCallback7((index, _directory) => {
3352
3418
  if (tabLabelPrefix) {
3353
3419
  return `${tabLabelPrefix} ${index + 1}`;
3354
3420
  }
@@ -3380,7 +3446,7 @@ var TabbedTerminalPanelInner = ({
3380
3446
  }, [tabs]);
3381
3447
  const tabRefsMap = useRef5(/* @__PURE__ */ new Map());
3382
3448
  const refCallbacksMap = useRef5(/* @__PURE__ */ new Map());
3383
- const getRefCallback = useCallback6((tabId) => {
3449
+ const getRefCallback = useCallback7((tabId) => {
3384
3450
  let callback = refCallbacksMap.current.get(tabId);
3385
3451
  if (!callback) {
3386
3452
  callback = (ref) => {
@@ -3397,7 +3463,7 @@ var TabbedTerminalPanelInner = ({
3397
3463
  const hasInitializedRef = useRef5(false);
3398
3464
  const isCreatingTabRef = useRef5(false);
3399
3465
  const headerRef = useRef5(null);
3400
- const restoreOwnedSessions = useCallback6(async () => {
3466
+ const restoreOwnedSessions = useCallback7(async () => {
3401
3467
  try {
3402
3468
  let sessions = [];
3403
3469
  if (actions.listTerminalSessions) {
@@ -3446,7 +3512,7 @@ var TabbedTerminalPanelInner = ({
3446
3512
  console.error("[TabbedTerminalPanel] Failed to restore owned sessions:", err);
3447
3513
  }
3448
3514
  }, [terminalContext, sessionIds, activeTabId, onTabsChange, actions, directory, setActiveTabId]);
3449
- const fetchForeignSessions = useCallback6(async () => {
3515
+ const fetchForeignSessions = useCallback7(async () => {
3450
3516
  try {
3451
3517
  if (!actions.listTerminalSessions) {
3452
3518
  return;
@@ -3480,7 +3546,7 @@ var TabbedTerminalPanelInner = ({
3480
3546
  console.error("[TabbedTerminalPanel] Failed to fetch foreign sessions:", err);
3481
3547
  }
3482
3548
  }, [terminalContext, actions]);
3483
- const clearForeignTabs = useCallback6(() => {
3549
+ const clearForeignTabs = useCallback7(() => {
3484
3550
  setForeignTabs((prevForeign) => {
3485
3551
  const foreignTabIds = new Set(prevForeign.map((t) => t.id));
3486
3552
  setSessionIds((prev) => {
@@ -3517,10 +3583,10 @@ var TabbedTerminalPanelInner = ({
3517
3583
  clearForeignTabs();
3518
3584
  }
3519
3585
  }, [showAllTerminals, fetchForeignSessions, clearForeignTabs]);
3520
- const switchTab = useCallback6((tabId) => {
3586
+ const switchTab = useCallback7((tabId) => {
3521
3587
  setActiveTabId(tabId);
3522
3588
  }, [setActiveTabId]);
3523
- const addNewTab = useCallback6(
3589
+ const addNewTab = useCallback7(
3524
3590
  (label, command, targetDirectory) => {
3525
3591
  const targetDir = targetDirectory || directory;
3526
3592
  const directoryName = targetDir.split("/").pop() || targetDir;
@@ -3541,10 +3607,10 @@ var TabbedTerminalPanelInner = ({
3541
3607
  },
3542
3608
  [directory, onTabsChange]
3543
3609
  );
3544
- const isForeignTab = useCallback6((tabId) => {
3610
+ const isForeignTab = useCallback7((tabId) => {
3545
3611
  return tabId.startsWith("tab-foreign-");
3546
3612
  }, []);
3547
- const closeTab = useCallback6(
3613
+ const closeTab = useCallback7(
3548
3614
  async (tabId) => {
3549
3615
  const sessionId = sessionIds.get(tabId);
3550
3616
  const isForeign = isForeignTab(tabId);
@@ -3627,10 +3693,10 @@ var TabbedTerminalPanelInner = ({
3627
3693
  if (!requestCloseTabId) return;
3628
3694
  closeTab(requestCloseTabId);
3629
3695
  }, [requestCloseTabId]);
3630
- const handleSessionCreated = useCallback6((tabId, sessionId) => {
3696
+ const handleSessionCreated = useCallback7((tabId, sessionId) => {
3631
3697
  setSessionIds((prev) => new Map(prev).set(tabId, sessionId));
3632
3698
  }, []);
3633
- const handleActivityStateChange = useCallback6((sessionId, isActive) => {
3699
+ const handleActivityStateChange = useCallback7((sessionId, isActive) => {
3634
3700
  setActivityStates((prev) => {
3635
3701
  const next = new Map(prev);
3636
3702
  if (isActive) {
@@ -3662,12 +3728,12 @@ var TabbedTerminalPanelInner = ({
3662
3728
  }
3663
3729
  }
3664
3730
  });
3665
- const renderTabAccessory = useCallback6((tab) => {
3731
+ const renderTabAccessory = useCallback7((tab) => {
3666
3732
  const tabSessionId = sessionIds.get(tab.id);
3667
3733
  const isActive = tab.id === activeTabId;
3668
3734
  const record = tabSessionId ? programStatus?.[tabSessionId] : void 0;
3669
3735
  if (record && record.state !== "idle" && record.state !== "clear") {
3670
- return /* @__PURE__ */ jsx13(
3736
+ return /* @__PURE__ */ jsx14(
3671
3737
  "div",
3672
3738
  {
3673
3739
  style: {
@@ -3679,7 +3745,7 @@ var TabbedTerminalPanelInner = ({
3679
3745
  width: "16px",
3680
3746
  height: "16px"
3681
3747
  },
3682
- children: /* @__PURE__ */ jsx13(ProgramStatusBadge, { record })
3748
+ children: /* @__PURE__ */ jsx14(ProgramStatusBadge, { record })
3683
3749
  }
3684
3750
  );
3685
3751
  }
@@ -3687,7 +3753,7 @@ var TabbedTerminalPanelInner = ({
3687
3753
  const hasInternalActivity = tabSessionId ? activityStates.get(tabSessionId) : false;
3688
3754
  const isWorking = hasExternalWorkingState || hasInternalActivity;
3689
3755
  if (!isActive) return null;
3690
- return /* @__PURE__ */ jsx13(Fragment2, { children: /* @__PURE__ */ jsx13(
3756
+ return /* @__PURE__ */ jsx14(Fragment2, { children: /* @__PURE__ */ jsx14(
3691
3757
  "div",
3692
3758
  {
3693
3759
  style: {
@@ -3700,12 +3766,12 @@ var TabbedTerminalPanelInner = ({
3700
3766
  height: "16px"
3701
3767
  },
3702
3768
  title: isWorking ? "Terminal active" : "Terminal idle",
3703
- children: /* @__PURE__ */ jsx13(ActivityIndicator, { color: theme.colors.primary, isAnimating: isWorking ?? false })
3769
+ children: /* @__PURE__ */ jsx14(ActivityIndicator, { color: theme.colors.primary, isAnimating: isWorking ?? false })
3704
3770
  }
3705
3771
  ) });
3706
3772
  }, [activeTabId, theme, sessionIds, workingStates, activityStates, programStatus]);
3707
- const renderTerminalWithAssociation = useCallback6((tab, isActive, sessionId, association) => {
3708
- const terminalContent = /* @__PURE__ */ jsx13(
3773
+ const renderTerminalWithAssociation = useCallback7((tab, isActive, sessionId, association) => {
3774
+ const terminalContent = /* @__PURE__ */ jsx14(
3709
3775
  TerminalTabContent,
3710
3776
  {
3711
3777
  ref: getRefCallback(tab.id),
@@ -3727,7 +3793,7 @@ var TabbedTerminalPanelInner = ({
3727
3793
  `terminal-${tab.id}`
3728
3794
  );
3729
3795
  const hasAssociation = !!association;
3730
- const secondaryContent = hasAssociation && renderAssociatedContent ? renderAssociatedContent(association.associatedTabId, isActive) : /* @__PURE__ */ jsx13("div", { style: {
3796
+ const secondaryContent = hasAssociation && renderAssociatedContent ? renderAssociatedContent(association.associatedTabId, isActive) : /* @__PURE__ */ jsx14("div", { style: {
3731
3797
  height: "100%",
3732
3798
  display: "flex",
3733
3799
  alignItems: "center",
@@ -3736,10 +3802,10 @@ var TabbedTerminalPanelInner = ({
3736
3802
  fontSize: "13px",
3737
3803
  backgroundColor: theme.colors.backgroundSecondary
3738
3804
  }, children: "Drag a tab here to associate it with this terminal" });
3739
- const headerConfig = hasAssociation && getAssociatedHeader ? getAssociatedHeader(association.associatedTabId) : { title: "Drop zone", icon: /* @__PURE__ */ jsx13(Paperclip, { size: 14 }) };
3805
+ const headerConfig = hasAssociation && getAssociatedHeader ? getAssociatedHeader(association.associatedTabId) : { title: "Drop zone", icon: /* @__PURE__ */ jsx14(Paperclip, { size: 14 }) };
3740
3806
  const isCollapsed = hasAssociation ? association.collapsed : true;
3741
3807
  const handleCollapsedChange = hasAssociation ? (collapsed) => onAssociationCollapsedChange?.(tab.id, collapsed) : void 0;
3742
- return /* @__PURE__ */ jsx13(
3808
+ return /* @__PURE__ */ jsx14(
3743
3809
  CollapsibleSplitPane,
3744
3810
  {
3745
3811
  style: { height: "100%" },
@@ -3771,7 +3837,7 @@ var TabbedTerminalPanelInner = ({
3771
3837
  onAssociationRatioChange,
3772
3838
  theme
3773
3839
  ]);
3774
- const handleTabDrop = useCallback6(
3840
+ const handleTabDrop = useCallback7(
3775
3841
  (draggedTabId, targetTabId) => {
3776
3842
  const draggedTab = tabs.find((t) => t.id === draggedTabId);
3777
3843
  const targetTab = tabs.find((t) => t.id === targetTabId);
@@ -3782,7 +3848,7 @@ var TabbedTerminalPanelInner = ({
3782
3848
  },
3783
3849
  [tabs, onTabAssociate, setActiveTabId]
3784
3850
  );
3785
- const canDropOnTab = useCallback6(
3851
+ const canDropOnTab = useCallback7(
3786
3852
  (draggedTabId, targetTabId) => {
3787
3853
  const draggedTab = tabs.find((t) => t.id === draggedTabId);
3788
3854
  const targetTab = tabs.find((t) => t.id === targetTabId);
@@ -3791,7 +3857,7 @@ var TabbedTerminalPanelInner = ({
3791
3857
  [tabs]
3792
3858
  );
3793
3859
  const [isDragOverContent, setIsDragOverContent] = useState4(false);
3794
- const handleContentDragEnter = useCallback6((e) => {
3860
+ const handleContentDragEnter = useCallback7((e) => {
3795
3861
  e.preventDefault();
3796
3862
  if (activeTabId) {
3797
3863
  const activeTab = tabs.find((t) => t.id === activeTabId);
@@ -3800,13 +3866,13 @@ var TabbedTerminalPanelInner = ({
3800
3866
  }
3801
3867
  }
3802
3868
  }, [activeTabId, tabs]);
3803
- const handleContentDragLeave = useCallback6((e) => {
3869
+ const handleContentDragLeave = useCallback7((e) => {
3804
3870
  const relatedTarget = e.relatedTarget;
3805
3871
  if (!e.currentTarget.contains(relatedTarget)) {
3806
3872
  setIsDragOverContent(false);
3807
3873
  }
3808
3874
  }, []);
3809
- const handleContentDrop = useCallback6((e) => {
3875
+ const handleContentDrop = useCallback7((e) => {
3810
3876
  e.preventDefault();
3811
3877
  e.stopPropagation();
3812
3878
  setIsDragOverContent(false);
@@ -3821,7 +3887,7 @@ var TabbedTerminalPanelInner = ({
3821
3887
  setActiveTabId(activeTabId);
3822
3888
  }
3823
3889
  }, [activeTabId, tabs, onTabAssociate, setActiveTabId]);
3824
- return /* @__PURE__ */ jsxs9(
3890
+ return /* @__PURE__ */ jsxs10(
3825
3891
  "div",
3826
3892
  {
3827
3893
  style: {
@@ -3831,7 +3897,7 @@ var TabbedTerminalPanelInner = ({
3831
3897
  backgroundColor: theme.colors.background
3832
3898
  },
3833
3899
  children: [
3834
- !hideHeader && /* @__PURE__ */ jsx13("div", { ref: headerRef, children: /* @__PURE__ */ jsx13(
3900
+ !hideHeader && /* @__PURE__ */ jsx14("div", { ref: headerRef, children: /* @__PURE__ */ jsx14(
3835
3901
  TabBar,
3836
3902
  {
3837
3903
  tabs: genericTabs,
@@ -3839,7 +3905,7 @@ var TabbedTerminalPanelInner = ({
3839
3905
  onTabClick: switchTab,
3840
3906
  onTabClose: closeTab,
3841
3907
  onNewTab: addNewTab,
3842
- leftSection: hideShowAllTerminalsButton ? void 0 : /* @__PURE__ */ jsx13(
3908
+ leftSection: hideShowAllTerminalsButton ? void 0 : /* @__PURE__ */ jsx14(
3843
3909
  "button",
3844
3910
  {
3845
3911
  onClick: () => onShowAllTerminalsChange?.(!showAllTerminals),
@@ -3866,7 +3932,7 @@ var TabbedTerminalPanelInner = ({
3866
3932
  }
3867
3933
  },
3868
3934
  title: showAllTerminals ? "Showing all terminals (click to filter by context)" : "Show all terminals",
3869
- children: showAllTerminals ? /* @__PURE__ */ jsx13(Boxes, { size: 14 }) : /* @__PURE__ */ jsx13(Box, { size: 14 })
3935
+ children: showAllTerminals ? /* @__PURE__ */ jsx14(Boxes, { size: 14 }) : /* @__PURE__ */ jsx14(Box, { size: 14 })
3870
3936
  }
3871
3937
  ),
3872
3938
  renderTabAccessory,
@@ -3878,7 +3944,7 @@ var TabbedTerminalPanelInner = ({
3878
3944
  canDropOnTab
3879
3945
  }
3880
3946
  ) }),
3881
- /* @__PURE__ */ jsxs9(
3947
+ /* @__PURE__ */ jsxs10(
3882
3948
  "div",
3883
3949
  {
3884
3950
  style: {
@@ -3927,7 +3993,7 @@ var TabbedTerminalPanelInner = ({
3927
3993
  const customContent = renderTabContent(tab, isActive, sessionId, width);
3928
3994
  if (customContent === null && tab.contentType === "terminal") {
3929
3995
  const association = associations?.[tab.id];
3930
- return /* @__PURE__ */ jsx13(
3996
+ return /* @__PURE__ */ jsx14(
3931
3997
  "div",
3932
3998
  {
3933
3999
  inert: !isActive,
@@ -3955,7 +4021,7 @@ var TabbedTerminalPanelInner = ({
3955
4021
  );
3956
4022
  }
3957
4023
  const hasBeenActivated = activatedTabs.has(tab.id);
3958
- return /* @__PURE__ */ jsx13(
4024
+ return /* @__PURE__ */ jsx14(
3959
4025
  "div",
3960
4026
  {
3961
4027
  inert: !isActive,
@@ -3975,7 +4041,7 @@ var TabbedTerminalPanelInner = ({
3975
4041
  }
3976
4042
  if (tab.contentType === "terminal") {
3977
4043
  const association = associations?.[tab.id];
3978
- return /* @__PURE__ */ jsx13(
4044
+ return /* @__PURE__ */ jsx14(
3979
4045
  "div",
3980
4046
  {
3981
4047
  inert: !isActive,
@@ -3993,7 +4059,7 @@ var TabbedTerminalPanelInner = ({
3993
4059
  tab.id
3994
4060
  );
3995
4061
  }
3996
- return /* @__PURE__ */ jsxs9(
4062
+ return /* @__PURE__ */ jsxs10(
3997
4063
  "div",
3998
4064
  {
3999
4065
  inert: !isActive,
@@ -4009,17 +4075,17 @@ var TabbedTerminalPanelInner = ({
4009
4075
  color: theme.colors.textSecondary
4010
4076
  },
4011
4077
  children: [
4012
- /* @__PURE__ */ jsxs9("p", { children: [
4078
+ /* @__PURE__ */ jsxs10("p", { children: [
4013
4079
  "Unknown content type: ",
4014
4080
  tab.contentType
4015
4081
  ] }),
4016
- /* @__PURE__ */ jsx13("p", { style: { fontSize: theme.fontSizes[0], marginTop: "8px" }, children: "Provide a renderTabContent prop to render custom tab types" })
4082
+ /* @__PURE__ */ jsx14("p", { style: { fontSize: theme.fontSizes[0], marginTop: "8px" }, children: "Provide a renderTabContent prop to render custom tab types" })
4017
4083
  ]
4018
4084
  },
4019
4085
  tab.id
4020
4086
  );
4021
4087
  }),
4022
- tabs.length === 0 && /* @__PURE__ */ jsxs9(
4088
+ tabs.length === 0 && /* @__PURE__ */ jsxs10(
4023
4089
  "div",
4024
4090
  {
4025
4091
  style: {
@@ -4031,14 +4097,14 @@ var TabbedTerminalPanelInner = ({
4031
4097
  color: theme.colors.textSecondary
4032
4098
  },
4033
4099
  children: [
4034
- /* @__PURE__ */ jsx13(
4100
+ /* @__PURE__ */ jsx14(
4035
4101
  TerminalIcon2,
4036
4102
  {
4037
4103
  size: 32,
4038
4104
  style: { opacity: 0.5, marginBottom: "16px" }
4039
4105
  }
4040
4106
  ),
4041
- /* @__PURE__ */ jsx13(
4107
+ /* @__PURE__ */ jsx14(
4042
4108
  "button",
4043
4109
  {
4044
4110
  onClick: () => addNewTab(),
@@ -4065,15 +4131,15 @@ var TabbedTerminalPanelInner = ({
4065
4131
  (() => {
4066
4132
  const activeTab = tabs.find((t) => t.id === activeTabId);
4067
4133
  const activeDir = activeTab?.directory;
4068
- return /* @__PURE__ */ jsxs9("div", { style: { display: "flex", alignItems: "center", flex: "0 0 auto" }, children: [
4069
- /* @__PURE__ */ jsx13(
4134
+ return /* @__PURE__ */ jsxs10("div", { style: { display: "flex", alignItems: "center", flex: "0 0 auto" }, children: [
4135
+ /* @__PURE__ */ jsx14(
4070
4136
  TerminalStatusBar,
4071
4137
  {
4072
4138
  directory: activeDir,
4073
4139
  repo: activeDir ? getRepoInfo?.(activeDir) : void 0
4074
4140
  }
4075
4141
  ),
4076
- bottomBarContent && /* @__PURE__ */ jsx13("div", { style: { marginLeft: "auto", display: "flex", alignItems: "center", height: 22 }, children: bottomBarContent })
4142
+ bottomBarContent && /* @__PURE__ */ jsx14("div", { style: { marginLeft: "auto", display: "flex", alignItems: "center", height: 22 }, children: bottomBarContent })
4077
4143
  ] });
4078
4144
  })()
4079
4145
  ]