@xenide-io/the-old-ui-theme 0.10.0 → 0.11.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.
Files changed (42) hide show
  1. package/dist/{Chip-DKT-82Lf.d.mts → Chip-Dw2g2t8D.d.mts} +14 -2
  2. package/dist/{Chip-DKT-82Lf.d.ts → Chip-Dw2g2t8D.d.ts} +14 -2
  3. package/dist/{chunk-LHE4ROON.mjs → chunk-RIPGN6FG.mjs} +412 -61
  4. package/dist/index.d.mts +3 -2
  5. package/dist/index.d.ts +3 -2
  6. package/dist/index.js +355 -23
  7. package/dist/index.mjs +11 -3
  8. package/dist/suite-analytics--Mf1RZbw.d.mts +29 -0
  9. package/dist/suite-analytics--Mf1RZbw.d.ts +29 -0
  10. package/dist/suite.d.mts +14 -4
  11. package/dist/suite.d.ts +14 -4
  12. package/dist/suite.js +920 -513
  13. package/dist/suite.mjs +898 -523
  14. package/dist/ui.d.mts +2 -2
  15. package/dist/ui.d.ts +2 -2
  16. package/dist/ui.js +401 -66
  17. package/dist/ui.mjs +3 -1
  18. package/package.json +1 -1
  19. package/src/app/globals.css +57 -1
  20. package/src/components/ui/BrandSpinner.tsx +256 -0
  21. package/src/components/ui/CodeBlock.tsx +11 -1
  22. package/src/components/ui/Marketing.tsx +17 -1
  23. package/src/components/ui/SettingsLayout.tsx +4 -0
  24. package/src/components/ui/Table.tsx +32 -9
  25. package/src/components/ui/brand-spinner.test.tsx +62 -0
  26. package/src/components/ui/index.ts +7 -0
  27. package/src/components/ui/table.test.tsx +31 -4
  28. package/src/styles/suite-skin.css +78 -46
  29. package/src/suite/components/ai-draft-editor.tsx +184 -0
  30. package/src/suite/components/ai-panel-workflows.test.tsx +179 -0
  31. package/src/suite/components/ai-panel.tsx +184 -14
  32. package/src/suite/components/app-switcher.tsx +13 -0
  33. package/src/suite/components/command-palette-host.tsx +20 -2
  34. package/src/suite/components/suite-notification-bell.tsx +23 -2
  35. package/src/suite/components/suite-notification-settings.tsx +11 -0
  36. package/src/suite/components/suite-settings-layout.tsx +1 -1
  37. package/src/suite/components/suite-settings-mobile-nav.tsx +5 -1
  38. package/src/suite/components/suite-sidebar.tsx +2 -2
  39. package/src/suite/components/theme-provider.tsx +2 -0
  40. package/src/suite/components/today-ui.tsx +33 -28
  41. package/src/suite/index.ts +8 -0
  42. package/src/suite/lib/suite-notifications.tsx +5 -0
package/dist/suite.mjs CHANGED
@@ -8,11 +8,14 @@ import {
8
8
  FileUpload,
9
9
  Input,
10
10
  Modal,
11
+ SUITE_ANALYTICS_EVENT,
11
12
  Select,
12
13
  Toggle,
13
14
  Tooltip,
14
- cn
15
- } from "./chunk-LHE4ROON.mjs";
15
+ cn,
16
+ subscribeSuiteAnalytics,
17
+ trackSuiteEvent
18
+ } from "./chunk-RIPGN6FG.mjs";
16
19
  import {
17
20
  SUITE_THEME_CHANNEL,
18
21
  SUITE_THEME_COOKIE,
@@ -619,21 +622,25 @@ function getTodayGreeting(user, stats) {
619
622
  function TodayHero({
620
623
  message = "Take a nice, deep breath.",
621
624
  brief,
622
- briefMeta
625
+ briefMeta,
626
+ action
623
627
  }) {
624
- return /* @__PURE__ */ jsxs4("div", { className: "mt-4 sm:mt-6", children: [
625
- /* @__PURE__ */ jsx4(
626
- "p",
627
- {
628
- className: "today-hero max-w-2xl font-display text-lg font-semibold tracking-tight text-ph-ink sm:text-xl sm:leading-snug",
629
- children: message
630
- },
631
- typeof message === "string" ? message : "hero"
632
- ),
633
- brief ? /* @__PURE__ */ jsxs4("div", { className: "mt-4 max-w-2xl", "data-test": "today-focus-brief", children: [
634
- /* @__PURE__ */ jsx4("p", { className: "text-[15px] leading-[1.65] text-ph-ink", children: brief }),
635
- briefMeta ? /* @__PURE__ */ jsx4("p", { className: "mt-1.5 text-xs text-ph-mutedtext", children: briefMeta }) : null
636
- ] }) : null
628
+ return /* @__PURE__ */ jsxs4("div", { className: "flex min-w-0 flex-col gap-5 border-b border-ph-border-subtle pb-6 sm:flex-row sm:items-center sm:justify-between", children: [
629
+ /* @__PURE__ */ jsxs4("div", { className: "min-w-0 flex-1", children: [
630
+ /* @__PURE__ */ jsx4(
631
+ "p",
632
+ {
633
+ className: "today-hero max-w-2xl font-display text-lg font-semibold tracking-tight text-ph-ink sm:text-xl",
634
+ children: message
635
+ },
636
+ typeof message === "string" ? message : "hero"
637
+ ),
638
+ brief ? /* @__PURE__ */ jsxs4("div", { className: "mt-2 max-w-xl", "data-test": "today-focus-brief", children: [
639
+ /* @__PURE__ */ jsx4("p", { className: "text-sm leading-relaxed text-ph-subtle", children: brief }),
640
+ briefMeta ? /* @__PURE__ */ jsx4("p", { className: "mt-1.5 text-xs text-ph-mutedtext", children: briefMeta }) : null
641
+ ] }) : null
642
+ ] }),
643
+ action ? /* @__PURE__ */ jsx4("div", { className: "w-full shrink-0 sm:w-72", children: action }) : null
637
644
  ] });
638
645
  }
639
646
  function TodayPrimaryAction({
@@ -706,16 +713,16 @@ function TodayEmptyAction({
706
713
  return /* @__PURE__ */ jsxs4(
707
714
  "div",
708
715
  {
709
- className: "rounded-[var(--ph-radius-surface)] border border-dashed border-ph-border/80 bg-[var(--ph-surface-inset)] px-4 py-4 text-center",
716
+ className: "rounded-[var(--ph-radius-surface)] border border-ph-border-subtle bg-ph-surface px-5 py-6 text-left",
710
717
  "data-test": dataTest,
711
718
  children: [
712
719
  /* @__PURE__ */ jsx4("p", { className: "text-sm font-semibold text-ph-ink", children: title }),
713
- description ? /* @__PURE__ */ jsx4("p", { className: "mx-auto mt-1 max-w-sm text-xs leading-relaxed text-ph-subtle sm:text-sm", children: description }) : null,
720
+ description ? /* @__PURE__ */ jsx4("p", { className: "mt-1.5 max-w-md text-sm leading-relaxed text-ph-subtle", children: description }) : null,
714
721
  actionLabel2 && (href || onClick) ? href ? /* @__PURE__ */ jsx4(
715
722
  "a",
716
723
  {
717
724
  href,
718
- className: "mt-2.5 inline-flex text-sm font-semibold text-ph-brand hover:underline",
725
+ className: "ph-btn ph-btn-link mt-3 text-sm",
719
726
  children: actionLabel2
720
727
  }
721
728
  ) : /* @__PURE__ */ jsx4(
@@ -723,7 +730,7 @@ function TodayEmptyAction({
723
730
  {
724
731
  type: "button",
725
732
  onClick,
726
- className: "mt-2.5 inline-flex text-sm font-semibold text-ph-brand hover:underline",
733
+ className: "ph-btn ph-btn-link mt-3 text-sm",
727
734
  children: actionLabel2
728
735
  }
729
736
  ) : null
@@ -744,9 +751,9 @@ function TodayLayout({
744
751
  "data-test": "today-layout",
745
752
  children: [
746
753
  primary ? /* @__PURE__ */ jsx4("div", { className: "max-w-md", children: primary }) : null,
747
- /* @__PURE__ */ jsxs4("div", { className: "grid gap-6 lg:grid-cols-[minmax(0,1fr)_minmax(16rem,20rem)] lg:items-start lg:gap-8", children: [
754
+ /* @__PURE__ */ jsxs4("div", { className: cn2("grid gap-8 lg:items-start", aside && "lg:grid-cols-[minmax(0,1fr)_minmax(15rem,19rem)]"), children: [
748
755
  /* @__PURE__ */ jsx4("div", { className: "min-w-0 space-y-8", children: main }),
749
- aside ? /* @__PURE__ */ jsx4("aside", { className: "space-y-3 lg:sticky lg:top-6 lg:self-start", children: aside }) : null
756
+ aside ? /* @__PURE__ */ jsx4("aside", { className: "min-w-0 space-y-5", children: aside }) : null
750
757
  ] })
751
758
  ]
752
759
  }
@@ -808,21 +815,21 @@ function TodaySection({
808
815
  testId,
809
816
  children
810
817
  }) {
811
- return /* @__PURE__ */ jsxs4("section", { "data-test": testId, className: "space-y-5", children: [
818
+ return /* @__PURE__ */ jsxs4("section", { "data-test": testId, className: "space-y-4", children: [
812
819
  /* @__PURE__ */ jsxs4("div", { className: "flex items-start justify-between gap-4", children: [
813
- /* @__PURE__ */ jsxs4("div", { className: "flex min-w-0 items-start gap-3.5", children: [
820
+ /* @__PURE__ */ jsxs4("div", { className: "flex min-w-0 items-start gap-3", children: [
814
821
  /* @__PURE__ */ jsx4(
815
822
  "span",
816
823
  {
817
824
  className: cn2(
818
- "inline-flex h-10 w-10 sm:h-11 sm:w-11 shrink-0 items-center justify-center rounded-[var(--ph-radius-surface)] border border-ph-border/70 shadow-[var(--ph-shadow-control)]",
825
+ "inline-flex h-8 w-8 shrink-0 items-center justify-center rounded-[var(--ph-radius-control)]",
819
826
  iconClassName != null ? iconClassName : "bg-ph-muted text-ph-ink"
820
827
  ),
821
- children: /* @__PURE__ */ jsx4(Icon, { className: "h-5 w-5", "aria-hidden": true })
828
+ children: /* @__PURE__ */ jsx4(Icon, { className: "h-4 w-4", "aria-hidden": true })
822
829
  }
823
830
  ),
824
831
  /* @__PURE__ */ jsxs4("div", { className: "min-w-0 pt-0.5", children: [
825
- /* @__PURE__ */ jsx4("h2", { className: "font-display text-lg font-bold tracking-tight text-ph-ink", children: title }),
832
+ /* @__PURE__ */ jsx4("h2", { className: "font-display text-lg font-semibold tracking-tight text-ph-ink", children: title }),
826
833
  description ? /* @__PURE__ */ jsx4("p", { className: "mt-1 max-w-xl text-sm leading-relaxed text-ph-subtle", children: description }) : null
827
834
  ] })
828
835
  ] }),
@@ -839,7 +846,7 @@ function TodayPanel({
839
846
  "div",
840
847
  {
841
848
  className: cn2(
842
- "rounded-[var(--ph-radius-surface)] border border-ph-border/70 bg-ph-surface p-5 sm:p-5",
849
+ "today-panel rounded-[var(--ph-radius-surface)] border border-ph-border-subtle bg-ph-surface p-5",
843
850
  className
844
851
  ),
845
852
  children
@@ -984,6 +991,12 @@ function AppSwitcher({
984
991
  onMouseDown: (e) => e.preventDefault(),
985
992
  onClick: () => {
986
993
  setOpen(false);
994
+ trackSuiteEvent("App Launched", {
995
+ target_app: app.slug,
996
+ from_app: currentApp,
997
+ new_tab: false,
998
+ origin: "app_switcher"
999
+ });
987
1000
  onSelect(app);
988
1001
  },
989
1002
  className: cn2(appSwitcherMenuItemClass(), "pr-11"),
@@ -1014,6 +1027,12 @@ function AppSwitcher({
1014
1027
  onMouseDown: (e) => e.preventDefault(),
1015
1028
  onClick: () => {
1016
1029
  setOpen(false);
1030
+ trackSuiteEvent("App Launched", {
1031
+ target_app: app.slug,
1032
+ from_app: currentApp,
1033
+ new_tab: true,
1034
+ origin: "app_switcher"
1035
+ });
1017
1036
  onSelect(app, { newTab: true });
1018
1037
  },
1019
1038
  className: "absolute right-1.5 top-1/2 z-[1] flex h-8 -translate-y-1/2 justify-center p-0 text-ph-mutedtext",
@@ -1268,6 +1287,10 @@ function SuiteNotificationsProvider({
1268
1287
  suiteAppBaseUrl("shellstack")
1269
1288
  );
1270
1289
  launchUrl.searchParams.set("next", path);
1290
+ trackSuiteEvent("Cross-App Switch", {
1291
+ target_app: sourceApp,
1292
+ success: true
1293
+ });
1271
1294
  window.location.assign(launchUrl.toString());
1272
1295
  return;
1273
1296
  }
@@ -1340,7 +1363,14 @@ function SuiteNotificationBell({
1340
1363
  const [open, setOpen] = useState3(false);
1341
1364
  const onOpenChange = (next) => {
1342
1365
  setOpen(next);
1343
- if (next) refresh();
1366
+ if (next) {
1367
+ trackSuiteEvent("UI Opened", {
1368
+ view: "notification_bell",
1369
+ kind: "notifications",
1370
+ unread_count: unread
1371
+ });
1372
+ refresh();
1373
+ }
1344
1374
  };
1345
1375
  return /* @__PURE__ */ jsxs6(
1346
1376
  DropdownMenu2,
@@ -1365,7 +1395,13 @@ function SuiteNotificationBell({
1365
1395
  type: "button",
1366
1396
  id: `${dataTest}-mark-all`,
1367
1397
  "data-test": `${dataTest}-mark-all`,
1368
- onClick: markAllRead,
1398
+ onClick: () => {
1399
+ trackSuiteEvent("Notification Read", {
1400
+ operation: "all",
1401
+ count: unread
1402
+ });
1403
+ markAllRead();
1404
+ },
1369
1405
  className: "ph-btn ph-btn-link ph-btn-xs text-xs",
1370
1406
  children: "Mark all read"
1371
1407
  }
@@ -1378,6 +1414,13 @@ function SuiteNotificationBell({
1378
1414
  "data-test": `${dataTest}-item-${n.id}`,
1379
1415
  onClick: () => {
1380
1416
  setOpen(false);
1417
+ trackSuiteEvent("Notification Read", {
1418
+ operation: "read",
1419
+ notification_id: n.id,
1420
+ kind: n.kind,
1421
+ source_app: n.source_app,
1422
+ unread: !n.read_at
1423
+ });
1381
1424
  select(n);
1382
1425
  },
1383
1426
  className: "ph-dropdown-item flex w-full flex-col items-stretch gap-0.5 px-3 py-2 text-left",
@@ -1446,6 +1489,10 @@ function SuiteNotificationSettings({
1446
1489
  try {
1447
1490
  await controller.enable();
1448
1491
  await refresh();
1492
+ trackSuiteEvent("Push Notifications Configured", {
1493
+ enabled: true,
1494
+ permission: typeof Notification !== "undefined" ? Notification.permission : "unknown"
1495
+ });
1449
1496
  } catch (err) {
1450
1497
  setError(
1451
1498
  err instanceof Error ? err.message : "Could not enable notifications."
@@ -1461,6 +1508,10 @@ function SuiteNotificationSettings({
1461
1508
  try {
1462
1509
  await controller.disable();
1463
1510
  await refresh();
1511
+ trackSuiteEvent("Push Notifications Configured", {
1512
+ enabled: false,
1513
+ permission: typeof Notification !== "undefined" ? Notification.permission : "unknown"
1514
+ });
1464
1515
  } catch (err) {
1465
1516
  setError(
1466
1517
  err instanceof Error ? err.message : "Could not disable notifications."
@@ -1535,7 +1586,7 @@ function SuiteNotificationSettings({
1535
1586
  }
1536
1587
 
1537
1588
  // src/suite/components/command-palette-host.tsx
1538
- import { useEffect as useEffect3, useState as useState5 } from "react";
1589
+ import { useEffect as useEffect3, useMemo as useMemo2, useState as useState5 } from "react";
1539
1590
  import { jsx as jsx9 } from "react/jsx-runtime";
1540
1591
  function isEditableTarget() {
1541
1592
  if (typeof document === "undefined") return false;
@@ -1557,6 +1608,18 @@ function CommandPaletteHost({
1557
1608
  commandPalette: CommandPalette
1558
1609
  }) {
1559
1610
  const [open, setOpen] = useState5(false);
1611
+ const trackedItems = useMemo2(
1612
+ () => items.map((item) => __spreadProps(__spreadValues({}, item), {
1613
+ onSelect: () => {
1614
+ trackSuiteEvent("Command Palette Action", {
1615
+ action_kind: "command",
1616
+ target: item.id
1617
+ });
1618
+ item.onSelect();
1619
+ }
1620
+ })),
1621
+ [items]
1622
+ );
1560
1623
  useEffect3(() => {
1561
1624
  const onKey = (e) => {
1562
1625
  if (!((e.metaKey || e.ctrlKey) && e.key.toLowerCase() === "k")) return;
@@ -1571,7 +1634,7 @@ function CommandPaletteHost({
1571
1634
  return /* @__PURE__ */ jsx9(
1572
1635
  CommandPalette,
1573
1636
  {
1574
- items,
1637
+ items: trackedItems,
1575
1638
  isOpen: open,
1576
1639
  onClose: () => setOpen(false),
1577
1640
  placeholder,
@@ -2043,7 +2106,7 @@ function SuiteSettingsLayout({
2043
2106
  "aside",
2044
2107
  {
2045
2108
  "aria-label": "Settings",
2046
- className: "suite-settings-sidebar hidden w-56 shrink-0 lg:block lg:self-stretch lg:overflow-y-auto lg:overscroll-contain",
2109
+ className: "suite-settings-sidebar hidden w-56 shrink-0 lg:block lg:self-start lg:max-h-full lg:overflow-y-auto lg:overscroll-contain",
2047
2110
  children: sidebar
2048
2111
  }
2049
2112
  ),
@@ -2345,7 +2408,7 @@ import {
2345
2408
  useCallback as useCallback3,
2346
2409
  useContext as useContext2,
2347
2410
  useEffect as useEffect7,
2348
- useMemo as useMemo2,
2411
+ useMemo as useMemo3,
2349
2412
  useRef as useRef2,
2350
2413
  useState as useState9
2351
2414
  } from "react";
@@ -2555,6 +2618,7 @@ function SuiteThemeProvider({
2555
2618
  }
2556
2619
  writeSharedTheme(next);
2557
2620
  broadcastTheme(next);
2621
+ trackSuiteEvent("Theme Updated", { theme: next, scope: "suite" });
2558
2622
  },
2559
2623
  [config]
2560
2624
  );
@@ -2562,7 +2626,7 @@ function SuiteThemeProvider({
2562
2626
  const next = resolveTheme(themeRef.current, config.fallbackTheme) === "dark" ? "light" : "dark";
2563
2627
  setTheme(next);
2564
2628
  }, [config, setTheme]);
2565
- const value = useMemo2(
2629
+ const value = useMemo3(
2566
2630
  () => ({ theme: state.theme, resolvedTheme: state.resolvedTheme, setTheme, toggleTheme }),
2567
2631
  [state.theme, state.resolvedTheme, setTheme, toggleTheme]
2568
2632
  );
@@ -2596,7 +2660,182 @@ import {
2596
2660
  Square,
2597
2661
  WarningTriangle
2598
2662
  } from "iconoir-react";
2599
- import { Fragment as Fragment5, jsx as jsx19, jsxs as jsxs15 } from "react/jsx-runtime";
2663
+
2664
+ // src/suite/components/ai-draft-editor.tsx
2665
+ import { jsx as jsx19, jsxs as jsxs15 } from "react/jsx-runtime";
2666
+ var EDITABLE_FIELDS = {
2667
+ propose_project_handover: ["title", "body"],
2668
+ propose_requirement_update: ["description"],
2669
+ propose_source_tasks: ["tasks"],
2670
+ propose_source_task_update: ["description"],
2671
+ propose_knowledge_pack: ["title", "body", "tasks"],
2672
+ propose_document_update: ["body"]
2673
+ };
2674
+ function suiteAiDraftFields(kind, payload) {
2675
+ const fields = EDITABLE_FIELDS[kind];
2676
+ return fields && payload ? Object.fromEntries(
2677
+ fields.map((key) => {
2678
+ var _a2;
2679
+ return [key, (_a2 = payload[key]) != null ? _a2 : key === "tasks" ? [] : ""];
2680
+ })
2681
+ ) : null;
2682
+ }
2683
+ function SuiteAiDraftEditor({
2684
+ kind,
2685
+ draft,
2686
+ canAddTasks,
2687
+ onChange
2688
+ }) {
2689
+ const change = (key, value) => onChange(__spreadProps(__spreadValues({}, draft), { [key]: value }));
2690
+ const tasks = Array.isArray(draft.tasks) ? draft.tasks : [];
2691
+ const editTask = (index, key, value) => change(
2692
+ "tasks",
2693
+ tasks.map((task, i) => i === index ? __spreadProps(__spreadValues({}, task), { [key]: value }) : task)
2694
+ );
2695
+ return /* @__PURE__ */ jsxs15(
2696
+ "div",
2697
+ {
2698
+ className: "mt-3 space-y-3 rounded-lg border border-ph-border bg-ph-canvas p-3",
2699
+ "data-test": "ai-draft-editor",
2700
+ children: [
2701
+ /* @__PURE__ */ jsx19("p", { className: "text-xs text-ph-mutedtext", children: "Edit draft content. Source evidence, versions and destination remain protected." }),
2702
+ Object.entries(draft).filter(([key]) => key !== "tasks").map(([key, value]) => /* @__PURE__ */ jsxs15("label", { className: "block space-y-1 text-sm", children: [
2703
+ /* @__PURE__ */ jsx19("span", { className: "font-medium", children: key === "title" ? "Title" : "Proposed content" }),
2704
+ key === "title" ? /* @__PURE__ */ jsx19(
2705
+ "input",
2706
+ {
2707
+ className: "ph-input min-h-11 w-full",
2708
+ value: String(value),
2709
+ maxLength: 255,
2710
+ onChange: (event) => change(key, event.target.value)
2711
+ }
2712
+ ) : /* @__PURE__ */ jsx19(
2713
+ "textarea",
2714
+ {
2715
+ className: "ph-input min-h-40 w-full",
2716
+ value: String(value),
2717
+ maxLength: kind === "propose_project_handover" ? 16e3 : 12e3,
2718
+ onChange: (event) => change(key, event.target.value)
2719
+ }
2720
+ )
2721
+ ] }, key)),
2722
+ "tasks" in draft ? /* @__PURE__ */ jsxs15("div", { className: "space-y-3", children: [
2723
+ /* @__PURE__ */ jsx19("p", { className: "text-sm font-medium", children: "Task drafts" }),
2724
+ tasks.map((task, index) => {
2725
+ var _a2, _b, _c, _d;
2726
+ return /* @__PURE__ */ jsxs15(
2727
+ "fieldset",
2728
+ {
2729
+ className: "space-y-2 rounded border border-ph-border p-2",
2730
+ children: [
2731
+ /* @__PURE__ */ jsxs15("legend", { className: "px-1 text-xs", children: [
2732
+ "Task ",
2733
+ index + 1
2734
+ ] }),
2735
+ /* @__PURE__ */ jsxs15("label", { className: "block text-sm", children: [
2736
+ "Title",
2737
+ /* @__PURE__ */ jsx19(
2738
+ "input",
2739
+ {
2740
+ className: "ph-input min-h-11 w-full",
2741
+ value: String((_a2 = task.title) != null ? _a2 : ""),
2742
+ maxLength: 255,
2743
+ onChange: (event) => editTask(index, "title", event.target.value)
2744
+ }
2745
+ )
2746
+ ] }),
2747
+ /* @__PURE__ */ jsxs15("label", { className: "block text-sm", children: [
2748
+ "Description",
2749
+ /* @__PURE__ */ jsx19(
2750
+ "textarea",
2751
+ {
2752
+ className: "ph-input min-h-24 w-full",
2753
+ value: String((_b = task.description) != null ? _b : ""),
2754
+ maxLength: 1e4,
2755
+ onChange: (event) => editTask(index, "description", event.target.value)
2756
+ }
2757
+ )
2758
+ ] }),
2759
+ /* @__PURE__ */ jsxs15("div", { className: "flex flex-wrap gap-2", children: [
2760
+ /* @__PURE__ */ jsxs15("label", { className: "text-sm", children: [
2761
+ "Due date",
2762
+ /* @__PURE__ */ jsx19(
2763
+ "input",
2764
+ {
2765
+ type: "date",
2766
+ className: "ph-input min-h-11 block",
2767
+ value: String((_c = task.due_date) != null ? _c : ""),
2768
+ onChange: (event) => editTask(index, "due_date", event.target.value || null)
2769
+ }
2770
+ )
2771
+ ] }),
2772
+ /* @__PURE__ */ jsxs15("label", { className: "text-sm", children: [
2773
+ "Priority",
2774
+ /* @__PURE__ */ jsx19(
2775
+ "select",
2776
+ {
2777
+ className: "ph-input min-h-11 block",
2778
+ value: String((_d = task.priority) != null ? _d : "low"),
2779
+ onChange: (event) => editTask(index, "priority", event.target.value),
2780
+ children: ["low", "medium", "high", "urgent"].map((value) => /* @__PURE__ */ jsx19("option", { children: value }, value))
2781
+ }
2782
+ )
2783
+ ] })
2784
+ ] }),
2785
+ /* @__PURE__ */ jsxs15("label", { className: "flex min-h-11 items-center gap-2 text-sm", children: [
2786
+ /* @__PURE__ */ jsx19(
2787
+ "input",
2788
+ {
2789
+ type: "checkbox",
2790
+ checked: Boolean(task.assign_me),
2791
+ onChange: (event) => editTask(index, "assign_me", event.target.checked)
2792
+ }
2793
+ ),
2794
+ "Assign to me"
2795
+ ] }),
2796
+ /* @__PURE__ */ jsx19(
2797
+ "button",
2798
+ {
2799
+ type: "button",
2800
+ className: "ph-btn ph-btn-secondary ph-btn-xs",
2801
+ disabled: kind === "propose_source_tasks" && tasks.length === 1,
2802
+ onClick: () => change(
2803
+ "tasks",
2804
+ tasks.filter((_, i) => i !== index)
2805
+ ),
2806
+ children: "Remove draft"
2807
+ }
2808
+ )
2809
+ ]
2810
+ },
2811
+ index
2812
+ );
2813
+ }),
2814
+ canAddTasks && tasks.length < 5 ? /* @__PURE__ */ jsx19(
2815
+ "button",
2816
+ {
2817
+ type: "button",
2818
+ className: "ph-btn ph-btn-secondary ph-btn-sm",
2819
+ onClick: () => change("tasks", [
2820
+ ...tasks,
2821
+ {
2822
+ title: "",
2823
+ description: "",
2824
+ priority: "low",
2825
+ assign_me: false
2826
+ }
2827
+ ]),
2828
+ children: "Add task draft"
2829
+ }
2830
+ ) : null
2831
+ ] }) : null
2832
+ ]
2833
+ }
2834
+ );
2835
+ }
2836
+
2837
+ // src/suite/components/ai-panel.tsx
2838
+ import { Fragment as Fragment5, jsx as jsx20, jsxs as jsxs16 } from "react/jsx-runtime";
2600
2839
  var SuiteAiMarkdownMessage = lazy(() => import("./ai-message-markdown-AUEMCO7K.mjs"));
2601
2840
  var SUITE_OPEN_ASK_AI_EVENT = "shellstack:open-ask-ai";
2602
2841
  var SUITE_ASK_AI_OPEN_KEY = "shellstack:shelly-open";
@@ -2687,6 +2926,7 @@ function SuiteAiPanel({
2687
2926
  const inputId = useId();
2688
2927
  const [uncontrolledOpen, setUncontrolledOpen] = useState10(false);
2689
2928
  const [resolvingId, setResolvingId] = useState10("");
2929
+ const [actionDrafts, setActionDrafts] = useState10({});
2690
2930
  const open = openProp != null ? openProp : uncontrolledOpen;
2691
2931
  const setOpen = useCallback4(
2692
2932
  (next) => {
@@ -2724,6 +2964,11 @@ function SuiteAiPanel({
2724
2964
  window.addEventListener(SUITE_OPEN_ASK_AI_EVENT, onOpen);
2725
2965
  return () => window.removeEventListener(SUITE_OPEN_ASK_AI_EVENT, onOpen);
2726
2966
  }, [setOpen]);
2967
+ useEffect8(() => {
2968
+ if (!open) return;
2969
+ trackSuiteEvent("AI Chat Opened", { origin: "suite_panel" });
2970
+ trackSuiteEvent("UI Opened", { view: "ai_panel" });
2971
+ }, [open]);
2727
2972
  const scrollToBottom = useCallback4((behavior = "auto") => {
2728
2973
  const el = scrollerRef.current;
2729
2974
  if (!el) return;
@@ -2799,6 +3044,13 @@ function SuiteAiPanel({
2799
3044
  setPrompt("");
2800
3045
  setAtBottom(true);
2801
3046
  setMessages((prev) => [...prev, { role: "user", content: trimmed }]);
3047
+ trackSuiteEvent("AI Message Sent", {
3048
+ prompt_length: trimmed.length,
3049
+ page_path: typeof window !== "undefined" ? window.location.pathname : void 0,
3050
+ is_preset: presets.some((preset) => preset.prompt === trimmed),
3051
+ is_edit: false,
3052
+ has_attachment: false
3053
+ });
2802
3054
  try {
2803
3055
  const result = await sendMessage({
2804
3056
  prompt: trimmed,
@@ -2832,6 +3084,7 @@ function SuiteAiPanel({
2832
3084
  }
2833
3085
  function stop() {
2834
3086
  var _a2;
3087
+ trackSuiteEvent("AI Message Cancelled");
2835
3088
  (_a2 = abortRef.current) == null ? void 0 : _a2.abort();
2836
3089
  abortRef.current = null;
2837
3090
  setLoading(false);
@@ -2857,6 +3110,13 @@ function SuiteAiPanel({
2857
3110
  setError("");
2858
3111
  setAtBottom(true);
2859
3112
  setMessages((prev) => prev.slice(0, index));
3113
+ trackSuiteEvent("AI Message Sent", {
3114
+ prompt_length: trimmed.length,
3115
+ page_path: typeof window !== "undefined" ? window.location.pathname : void 0,
3116
+ is_preset: false,
3117
+ is_edit: true,
3118
+ has_attachment: false
3119
+ });
2860
3120
  const controller = new AbortController();
2861
3121
  abortRef.current = controller;
2862
3122
  setLoading(true);
@@ -2903,21 +3163,31 @@ function SuiteAiPanel({
2903
3163
  await clearChat();
2904
3164
  setMessages([]);
2905
3165
  setError("");
3166
+ trackSuiteEvent("AI Chat Cleared", {
3167
+ page_path: typeof window !== "undefined" ? window.location.pathname : void 0
3168
+ });
2906
3169
  } catch (err) {
2907
3170
  setError(
2908
3171
  err instanceof Error ? err.message : "Could not clear this chat."
2909
3172
  );
2910
3173
  }
2911
3174
  }
2912
- async function handleResolve(actionId, decision) {
2913
- var _a2;
3175
+ async function handleResolve(action, decision) {
3176
+ var _a2, _b;
2914
3177
  if (!resolveAction || resolvingId) return;
3178
+ const actionId = action.id;
2915
3179
  setResolvingId(actionId);
2916
3180
  setError("");
2917
3181
  try {
2918
- const result = await resolveAction(actionId, decision);
3182
+ const edits = decision === "confirm" ? actionDrafts[actionId] : void 0;
3183
+ const result = edits ? await resolveAction(actionId, decision, edits) : await resolveAction(actionId, decision);
2919
3184
  const nextMessages = (_a2 = result.messages) != null ? _a2 : [];
2920
3185
  setMessages(nextMessages);
3186
+ trackSuiteEvent("AI Action Resolved", {
3187
+ decision,
3188
+ action_kind: action.kind,
3189
+ destructive: Boolean((_b = action.payload) == null ? void 0 : _b.destructive)
3190
+ });
2921
3191
  notifySuiteMutated(
2922
3192
  nextMessages.flatMap((message) => {
2923
3193
  var _a3;
@@ -2965,16 +3235,35 @@ function SuiteAiPanel({
2965
3235
  -1
2966
3236
  );
2967
3237
  const Icon = BrandIcon != null ? BrandIcon : Sparks;
2968
- return /* @__PURE__ */ jsxs15(
3238
+ return /* @__PURE__ */ jsxs16(
2969
3239
  "aside",
2970
3240
  {
2971
3241
  className: "flex h-full min-h-0 flex-col bg-ph-canvas",
2972
3242
  "data-test": "suite-ask-ai-panel",
2973
3243
  "aria-label": title,
2974
3244
  children: [
2975
- /* @__PURE__ */ jsxs15("header", { className: "flex items-center gap-2 px-2 pb-2", children: [
2976
- /* @__PURE__ */ jsx19("h2", { className: "sr-only", children: title }),
2977
- messages.length > 0 ? /* @__PURE__ */ jsxs15(
3245
+ /* @__PURE__ */ jsxs16("header", { className: "flex items-center gap-2 px-2 pb-2", children: [
3246
+ /* @__PURE__ */ jsx20("h2", { className: "sr-only", children: title }),
3247
+ presets.length > 0 ? /* @__PURE__ */ jsxs16("details", { className: "relative", "data-test": "ask-ai-workflows", children: [
3248
+ /* @__PURE__ */ jsx20("summary", { className: "ph-btn ph-btn-secondary ph-btn-sm min-h-10 cursor-pointer list-none", children: "Workflows" }),
3249
+ /* @__PURE__ */ jsx20("div", { className: "absolute left-0 top-full z-30 mt-1 max-h-80 w-64 overflow-auto rounded-lg border border-ph-border bg-ph-surface p-1 shadow-lg", children: presets.map((preset) => /* @__PURE__ */ jsx20(
3250
+ "button",
3251
+ {
3252
+ type: "button",
3253
+ disabled: waiting || hydrating,
3254
+ className: "flex min-h-10 w-full items-center rounded px-3 py-2 text-left text-sm hover:bg-ph-muted focus-visible:outline focus-visible:outline-2 disabled:opacity-50",
3255
+ onClick: (event) => {
3256
+ var _a2, _b;
3257
+ setPrompt(preset.prompt);
3258
+ (_a2 = event.currentTarget.closest("details")) == null ? void 0 : _a2.removeAttribute("open");
3259
+ (_b = textareaRef.current) == null ? void 0 : _b.focus();
3260
+ },
3261
+ children: preset.label
3262
+ },
3263
+ preset.label
3264
+ )) })
3265
+ ] }) : null,
3266
+ messages.length > 0 ? /* @__PURE__ */ jsxs16(
2978
3267
  "button",
2979
3268
  {
2980
3269
  type: "button",
@@ -2983,14 +3272,14 @@ function SuiteAiPanel({
2983
3272
  className: "ph-btn ph-btn-ghost ph-btn-sm ml-auto h-9 text-xs text-ph-subtle",
2984
3273
  "data-test": "ask-ai-clear",
2985
3274
  children: [
2986
- /* @__PURE__ */ jsx19(Erase, { className: "h-3.5 w-3.5" }),
3275
+ /* @__PURE__ */ jsx20(Erase, { className: "h-3.5 w-3.5" }),
2987
3276
  "Clear"
2988
3277
  ]
2989
3278
  }
2990
3279
  ) : null
2991
3280
  ] }),
2992
- /* @__PURE__ */ jsxs15("div", { className: "relative min-h-0 flex-1", children: [
2993
- /* @__PURE__ */ jsxs15(
3281
+ /* @__PURE__ */ jsxs16("div", { className: "relative min-h-0 flex-1", children: [
3282
+ /* @__PURE__ */ jsxs16(
2994
3283
  "div",
2995
3284
  {
2996
3285
  ref: scrollerRef,
@@ -3001,15 +3290,15 @@ function SuiteAiPanel({
3001
3290
  "aria-label": "Conversation",
3002
3291
  className: "suite-scroll-lock h-full space-y-5 overflow-y-auto px-2 py-3",
3003
3292
  children: [
3004
- hydrating && messages.length === 0 ? /* @__PURE__ */ jsxs15("div", { className: "flex items-center gap-2 text-sm text-ph-subtle", children: [
3005
- /* @__PURE__ */ jsx19(Spinner, { className: "h-4 w-4 animate-spin" }),
3293
+ hydrating && messages.length === 0 ? /* @__PURE__ */ jsxs16("div", { className: "flex items-center gap-2 text-sm text-ph-subtle", children: [
3294
+ /* @__PURE__ */ jsx20(Spinner, { className: "h-4 w-4 animate-spin" }),
3006
3295
  "Loading your chat\u2026"
3007
3296
  ] }) : null,
3008
- !hydrating && messages.length === 0 && !error ? /* @__PURE__ */ jsxs15("div", { className: "mx-auto mt-4 flex max-w-sm flex-col items-center px-1 text-center", children: [
3009
- /* @__PURE__ */ jsx19("span", { className: "flex h-10 w-10 items-center justify-center rounded-[var(--ph-radius-surface)] bg-ph-brand/10 text-ph-brand", children: /* @__PURE__ */ jsx19(Icon, { className: "h-5 w-5" }) }),
3010
- /* @__PURE__ */ jsx19("p", { className: "mt-3 font-display text-base font-semibold text-ph-ink", children: "How can I help?" }),
3011
- /* @__PURE__ */ jsx19("p", { className: "mt-1 text-sm leading-relaxed text-ph-subtle", children: emptyState }),
3012
- presets.length > 0 ? /* @__PURE__ */ jsx19("div", { className: "mt-4 flex w-full flex-col gap-2", children: presets.map((preset) => /* @__PURE__ */ jsxs15(
3297
+ !hydrating && messages.length === 0 && !error ? /* @__PURE__ */ jsxs16("div", { className: "mx-auto mt-4 flex max-w-sm flex-col items-center px-1 text-center", children: [
3298
+ /* @__PURE__ */ jsx20("span", { className: "flex h-10 w-10 items-center justify-center rounded-[var(--ph-radius-surface)] bg-ph-brand/10 text-ph-brand", children: /* @__PURE__ */ jsx20(Icon, { className: "h-5 w-5" }) }),
3299
+ /* @__PURE__ */ jsx20("p", { className: "mt-3 font-display text-base font-semibold text-ph-ink", children: "How can I help?" }),
3300
+ /* @__PURE__ */ jsx20("p", { className: "mt-1 text-sm leading-relaxed text-ph-subtle", children: emptyState }),
3301
+ presets.length > 0 ? /* @__PURE__ */ jsx20("div", { className: "mt-4 flex w-full flex-col gap-2", children: presets.map((preset) => /* @__PURE__ */ jsxs16(
3013
3302
  "button",
3014
3303
  {
3015
3304
  type: "button",
@@ -3017,9 +3306,9 @@ function SuiteAiPanel({
3017
3306
  disabled: waiting || hydrating,
3018
3307
  className: "group flex w-full items-center gap-2 rounded-[var(--ph-radius-surface)] border border-ph-border bg-ph-surface px-3 py-2 text-left text-sm text-ph-ink transition-[background-color,border-color,box-shadow] hover:border-[var(--ph-selected-border)] hover:bg-[var(--ph-surface-hover)] focus-visible:outline-none focus-visible:shadow-[var(--ph-focus-halo)] disabled:opacity-40",
3019
3308
  children: [
3020
- /* @__PURE__ */ jsx19(Sparks, { className: "h-4 w-4 shrink-0 text-ph-brand" }),
3021
- /* @__PURE__ */ jsx19("span", { className: "min-w-0 flex-1 truncate", children: preset.label }),
3022
- /* @__PURE__ */ jsx19(ArrowUp, { className: "h-3.5 w-3.5 shrink-0 rotate-45 text-ph-mutedtext transition-transform group-hover:translate-x-0.5" })
3309
+ /* @__PURE__ */ jsx20(Sparks, { className: "h-4 w-4 shrink-0 text-ph-brand" }),
3310
+ /* @__PURE__ */ jsx20("span", { className: "min-w-0 flex-1 truncate", children: preset.label }),
3311
+ /* @__PURE__ */ jsx20(ArrowUp, { className: "h-3.5 w-3.5 shrink-0 rotate-45 text-ph-mutedtext transition-transform group-hover:translate-x-0.5" })
3023
3312
  ]
3024
3313
  },
3025
3314
  preset.label
@@ -3030,13 +3319,13 @@ function SuiteAiPanel({
3030
3319
  const isUser = message.role === "user";
3031
3320
  if (isUser) {
3032
3321
  if (editingIndex === index) {
3033
- return /* @__PURE__ */ jsx19(
3322
+ return /* @__PURE__ */ jsx20(
3034
3323
  "div",
3035
3324
  {
3036
3325
  className: "suite-msg-in suite-msg-in--user flex justify-end",
3037
3326
  "data-test": "ask-ai-user",
3038
- children: /* @__PURE__ */ jsxs15("div", { className: "w-full max-w-[85%] space-y-2", children: [
3039
- /* @__PURE__ */ jsx19(
3327
+ children: /* @__PURE__ */ jsxs16("div", { className: "w-full max-w-[85%] space-y-2", children: [
3328
+ /* @__PURE__ */ jsx20(
3040
3329
  "textarea",
3041
3330
  {
3042
3331
  autoFocus: true,
@@ -3057,8 +3346,8 @@ function SuiteAiPanel({
3057
3346
  className: "w-full resize-none rounded-2xl rounded-br-md border border-ph-border bg-ph-surface px-3 py-2 text-sm leading-relaxed text-ph-ink outline-none focus-visible:border-[var(--ph-selected-border)] focus-visible:shadow-[var(--ph-focus-halo)]"
3058
3347
  }
3059
3348
  ),
3060
- /* @__PURE__ */ jsxs15("div", { className: "flex justify-end gap-2", children: [
3061
- /* @__PURE__ */ jsx19(
3349
+ /* @__PURE__ */ jsxs16("div", { className: "flex justify-end gap-2", children: [
3350
+ /* @__PURE__ */ jsx20(
3062
3351
  "button",
3063
3352
  {
3064
3353
  type: "button",
@@ -3070,7 +3359,7 @@ function SuiteAiPanel({
3070
3359
  children: "Cancel"
3071
3360
  }
3072
3361
  ),
3073
- /* @__PURE__ */ jsx19(
3362
+ /* @__PURE__ */ jsx20(
3074
3363
  "button",
3075
3364
  {
3076
3365
  type: "button",
@@ -3087,14 +3376,14 @@ function SuiteAiPanel({
3087
3376
  `user-${index}`
3088
3377
  );
3089
3378
  }
3090
- return /* @__PURE__ */ jsx19(
3379
+ return /* @__PURE__ */ jsx20(
3091
3380
  "div",
3092
3381
  {
3093
3382
  className: "suite-msg-in suite-msg-in--user flex justify-end",
3094
3383
  "data-test": "ask-ai-user",
3095
- children: /* @__PURE__ */ jsxs15("div", { className: "group flex items-end gap-1.5", children: [
3096
- !waiting ? /* @__PURE__ */ jsxs15("div", { className: "mb-0.5 flex items-center gap-0.5 opacity-100 transition-opacity [@media(hover:hover)]:opacity-0 [@media(hover:hover)]:group-focus-within:opacity-100 [@media(hover:hover)]:group-hover:opacity-100", children: [
3097
- /* @__PURE__ */ jsx19(
3384
+ children: /* @__PURE__ */ jsxs16("div", { className: "group flex items-end gap-1.5", children: [
3385
+ !waiting ? /* @__PURE__ */ jsxs16("div", { className: "mb-0.5 flex items-center gap-0.5 opacity-100 transition-opacity [@media(hover:hover)]:opacity-0 [@media(hover:hover)]:group-focus-within:opacity-100 [@media(hover:hover)]:group-hover:opacity-100", children: [
3386
+ /* @__PURE__ */ jsx20(
3098
3387
  "button",
3099
3388
  {
3100
3389
  type: "button",
@@ -3102,10 +3391,10 @@ function SuiteAiPanel({
3102
3391
  "aria-label": copiedIndex === index ? "Copied" : "Copy message",
3103
3392
  "data-test": "ask-ai-copy",
3104
3393
  className: "ph-btn ph-btn-ghost ph-btn-square ph-btn-xs h-7 w-7 text-ph-mutedtext",
3105
- children: copiedIndex === index ? /* @__PURE__ */ jsx19(Check, { className: "h-3.5 w-3.5" }) : /* @__PURE__ */ jsx19(Copy, { className: "h-3.5 w-3.5" })
3394
+ children: copiedIndex === index ? /* @__PURE__ */ jsx20(Check, { className: "h-3.5 w-3.5" }) : /* @__PURE__ */ jsx20(Copy, { className: "h-3.5 w-3.5" })
3106
3395
  }
3107
3396
  ),
3108
- /* @__PURE__ */ jsx19(
3397
+ /* @__PURE__ */ jsx20(
3109
3398
  "button",
3110
3399
  {
3111
3400
  type: "button",
@@ -3116,41 +3405,41 @@ function SuiteAiPanel({
3116
3405
  "aria-label": "Edit message",
3117
3406
  "data-test": "ask-ai-edit",
3118
3407
  className: "ph-btn ph-btn-ghost ph-btn-square ph-btn-xs h-7 w-7 text-ph-mutedtext",
3119
- children: /* @__PURE__ */ jsx19(EditPencil, { className: "h-3.5 w-3.5" })
3408
+ children: /* @__PURE__ */ jsx20(EditPencil, { className: "h-3.5 w-3.5" })
3120
3409
  }
3121
3410
  )
3122
3411
  ] }) : null,
3123
- /* @__PURE__ */ jsx19("div", { className: "w-fit max-w-[85%] whitespace-pre-wrap break-words rounded-2xl rounded-br-md bg-ph-brand px-3 py-2 text-sm leading-relaxed text-[var(--ph-on-accent)] [overflow-wrap:anywhere]", children: message.content })
3412
+ /* @__PURE__ */ jsx20("div", { className: "w-fit max-w-[85%] whitespace-pre-wrap break-words rounded-2xl rounded-br-md bg-ph-brand px-3 py-2 text-sm leading-relaxed text-[var(--ph-on-accent)] [overflow-wrap:anywhere]", children: message.content })
3124
3413
  ] })
3125
3414
  },
3126
3415
  `user-${index}`
3127
3416
  );
3128
3417
  }
3129
- return /* @__PURE__ */ jsxs15(
3418
+ return /* @__PURE__ */ jsxs16(
3130
3419
  "div",
3131
3420
  {
3132
3421
  className: "flex items-end gap-2",
3133
3422
  "data-test": "ask-ai-assistant",
3134
3423
  children: [
3135
- /* @__PURE__ */ jsx19(
3424
+ /* @__PURE__ */ jsx20(
3136
3425
  "span",
3137
3426
  {
3138
3427
  className: "suite-msg-avatar mb-0.5 flex h-6 w-6 shrink-0 items-center justify-center rounded-full bg-ph-brand/10 text-ph-brand",
3139
3428
  "aria-hidden": true,
3140
- children: /* @__PURE__ */ jsx19(Icon, { className: "h-3.5 w-3.5" })
3429
+ children: /* @__PURE__ */ jsx20(Icon, { className: "h-3.5 w-3.5" })
3141
3430
  }
3142
3431
  ),
3143
- /* @__PURE__ */ jsxs15("div", { className: "suite-msg-bubble min-w-0 max-w-[85%] space-y-2", children: [
3144
- /* @__PURE__ */ jsx19("div", { className: "rounded-2xl rounded-bl-md bg-ph-muted px-3 py-2 text-sm leading-relaxed text-ph-ink", children: /* @__PURE__ */ jsx19(
3432
+ /* @__PURE__ */ jsxs16("div", { className: "suite-msg-bubble min-w-0 max-w-[85%] space-y-2", children: [
3433
+ /* @__PURE__ */ jsx20("div", { className: "rounded-2xl rounded-bl-md bg-ph-muted px-3 py-2 text-sm leading-relaxed text-ph-ink", children: /* @__PURE__ */ jsx20(
3145
3434
  Suspense,
3146
3435
  {
3147
3436
  fallback: (
3148
3437
  // The chunk is pre-warmed above, so this only shows on a
3149
3438
  // cold cache. Keep it invisible — a skeleton here reads
3150
3439
  // as if it were part of the answer.
3151
- /* @__PURE__ */ jsx19("span", { className: "sr-only", role: "status", children: "Rendering response\u2026" })
3440
+ /* @__PURE__ */ jsx20("span", { className: "sr-only", role: "status", children: "Rendering response\u2026" })
3152
3441
  ),
3153
- children: /* @__PURE__ */ jsx19(
3442
+ children: /* @__PURE__ */ jsx20(
3154
3443
  SuiteAiMarkdownMessage,
3155
3444
  {
3156
3445
  markdown: message.content,
@@ -3159,84 +3448,161 @@ function SuiteAiPanel({
3159
3448
  )
3160
3449
  }
3161
3450
  ) }),
3162
- ((_a2 = message.actions) != null ? _a2 : []).map((action) => /* @__PURE__ */ jsxs15(
3163
- "div",
3164
- {
3165
- "data-test": "ask-ai-action",
3166
- "data-status": action.status,
3167
- className: "rounded-[var(--ph-radius-surface)] border border-ph-border bg-ph-surface px-3 py-2 text-sm text-ph-ink",
3168
- children: [
3169
- /* @__PURE__ */ jsx19("p", { className: "font-medium", children: action.summary }),
3170
- action.status === "proposed" ? /* @__PURE__ */ jsxs15("div", { className: "mt-2 flex flex-wrap gap-2", children: [
3171
- /* @__PURE__ */ jsx19(
3172
- "button",
3173
- {
3174
- type: "button",
3175
- "data-test": "ask-ai-action-confirm",
3176
- disabled: Boolean(resolvingId) || !resolveAction,
3177
- onClick: () => void handleResolve(action.id, "confirm"),
3178
- className: "ph-btn ph-btn-primary ph-btn-xs",
3179
- children: resolvingId === action.id ? "Working\u2026" : "Confirm"
3180
- }
3181
- ),
3182
- /* @__PURE__ */ jsx19(
3183
- "button",
3451
+ ((_a2 = message.actions) != null ? _a2 : []).map((action) => {
3452
+ var _a3, _b, _c, _d;
3453
+ return /* @__PURE__ */ jsxs16(
3454
+ "div",
3455
+ {
3456
+ "data-test": "ask-ai-action",
3457
+ "data-status": action.status,
3458
+ className: "rounded-[var(--ph-radius-surface)] border border-ph-border bg-ph-surface px-3 py-2 text-sm text-ph-ink",
3459
+ children: [
3460
+ /* @__PURE__ */ jsx20("p", { className: "font-medium", children: action.summary }),
3461
+ action.payload && action.kind.startsWith("propose_") ? /* @__PURE__ */ jsxs16(
3462
+ "details",
3184
3463
  {
3185
- type: "button",
3186
- "data-test": "ask-ai-action-cancel",
3187
- disabled: Boolean(resolvingId) || !resolveAction,
3188
- onClick: () => void handleResolve(action.id, "cancel"),
3189
- className: "ph-btn ph-btn-secondary ph-btn-xs",
3190
- children: "Cancel"
3464
+ className: "mt-2",
3465
+ "data-test": "ask-ai-workflow-preview",
3466
+ children: [
3467
+ /* @__PURE__ */ jsx20("summary", { className: "cursor-pointer rounded text-xs text-ph-brand focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2", children: "Review proposed content and evidence" }),
3468
+ typeof action.payload.before === "string" ? /* @__PURE__ */ jsxs16("div", { className: "mt-2", children: [
3469
+ /* @__PURE__ */ jsx20("p", { className: "text-xs font-medium text-ph-subtle", children: "Current description" }),
3470
+ /* @__PURE__ */ jsx20("pre", { className: "mt-1 max-h-48 overflow-auto whitespace-pre-wrap break-words text-xs", children: action.payload.before })
3471
+ ] }) : null,
3472
+ /* @__PURE__ */ jsxs16("div", { className: "mt-2", children: [
3473
+ /* @__PURE__ */ jsx20("p", { className: "text-xs font-medium text-ph-subtle", children: "Proposed draft" }),
3474
+ /* @__PURE__ */ jsx20("pre", { className: "mt-1 max-h-80 overflow-auto whitespace-pre-wrap break-words text-xs", children: String(
3475
+ (_c = (_a3 = action.payload.body) != null ? _a3 : action.payload.description) != null ? _c : JSON.stringify(
3476
+ (_b = action.payload.tasks) != null ? _b : action.payload,
3477
+ null,
3478
+ 2
3479
+ )
3480
+ ) })
3481
+ ] }),
3482
+ /* @__PURE__ */ jsx20("pre", { className: "mt-2 max-h-40 overflow-auto whitespace-pre-wrap break-words text-xs text-ph-subtle", children: JSON.stringify(
3483
+ action.kind === "propose_project_handover" ? {
3484
+ project_id: action.payload.project_id,
3485
+ sources: action.payload.sources,
3486
+ task_versions: action.payload.task_versions
3487
+ } : action.kind === "propose_requirement_update" ? {
3488
+ source_url: action.payload.source_url,
3489
+ document_revision: action.payload.document_revision,
3490
+ task_updated_at: action.payload.task_updated_at
3491
+ } : Object.fromEntries(
3492
+ Object.entries(action.payload).filter(
3493
+ ([key]) => ![
3494
+ "body",
3495
+ "description",
3496
+ "before",
3497
+ "tasks"
3498
+ ].includes(key)
3499
+ )
3500
+ ),
3501
+ null,
3502
+ 2
3503
+ ) })
3504
+ ]
3191
3505
  }
3192
- )
3193
- ] }) : null,
3194
- action.status === "applied" ? /* @__PURE__ */ jsxs15("p", { className: "mt-1 text-xs text-ph-subtle", children: [
3195
- "Done",
3196
- action.href ? /* @__PURE__ */ jsxs15(Fragment5, { children: [
3197
- " \xB7 ",
3198
- /* @__PURE__ */ jsx19(
3199
- "a",
3506
+ ) : null,
3507
+ action.status === "proposed" ? /* @__PURE__ */ jsxs16("div", { className: "mt-2 flex flex-wrap gap-2", children: [
3508
+ suiteAiDraftFields(action.kind, action.payload) ? /* @__PURE__ */ jsx20(
3509
+ "button",
3200
3510
  {
3201
- href: action.href,
3202
- className: "text-ph-brand underline-offset-2 hover:underline",
3203
- children: "Open"
3511
+ type: "button",
3512
+ className: "ph-btn ph-btn-secondary ph-btn-xs",
3513
+ onClick: () => setActionDrafts((drafts) => {
3514
+ var _a4;
3515
+ return __spreadProps(__spreadValues({}, drafts), {
3516
+ [action.id]: (_a4 = drafts[action.id]) != null ? _a4 : suiteAiDraftFields(
3517
+ action.kind,
3518
+ action.payload
3519
+ )
3520
+ });
3521
+ }),
3522
+ children: "Edit draft"
3523
+ }
3524
+ ) : null,
3525
+ /* @__PURE__ */ jsx20(
3526
+ "button",
3527
+ {
3528
+ type: "button",
3529
+ "data-test": "ask-ai-action-confirm",
3530
+ disabled: Boolean(resolvingId) || !resolveAction,
3531
+ onClick: () => void handleResolve(action, "confirm"),
3532
+ className: "ph-btn ph-btn-primary ph-btn-xs",
3533
+ children: resolvingId === action.id ? "Working\u2026" : "Confirm"
3534
+ }
3535
+ ),
3536
+ /* @__PURE__ */ jsx20(
3537
+ "button",
3538
+ {
3539
+ type: "button",
3540
+ "data-test": "ask-ai-action-cancel",
3541
+ disabled: Boolean(resolvingId) || !resolveAction,
3542
+ onClick: () => void handleResolve(action, "cancel"),
3543
+ className: "ph-btn ph-btn-secondary ph-btn-xs",
3544
+ children: "Cancel"
3204
3545
  }
3205
3546
  )
3206
- ] }) : null
3207
- ] }) : null,
3208
- action.status === "cancelled" ? /* @__PURE__ */ jsx19("p", { className: "mt-1 text-xs text-ph-subtle", children: "Cancelled" }) : null,
3209
- action.status === "failed" ? /* @__PURE__ */ jsx19("p", { className: "mt-1 text-xs text-ph-danger", children: action.error || "Could not apply that." }) : null
3210
- ]
3211
- },
3212
- action.id
3213
- ))
3547
+ ] }) : null,
3548
+ action.status === "proposed" && actionDrafts[action.id] ? /* @__PURE__ */ jsx20(
3549
+ SuiteAiDraftEditor,
3550
+ {
3551
+ kind: action.kind,
3552
+ draft: actionDrafts[action.id],
3553
+ canAddTasks: Boolean((_d = action.payload) == null ? void 0 : _d.project_id),
3554
+ onChange: (draft) => setActionDrafts((drafts) => __spreadProps(__spreadValues({}, drafts), {
3555
+ [action.id]: draft
3556
+ }))
3557
+ }
3558
+ ) : null,
3559
+ action.status === "applied" ? /* @__PURE__ */ jsxs16("p", { className: "mt-1 text-xs text-ph-subtle", children: [
3560
+ "Done",
3561
+ action.href ? /* @__PURE__ */ jsxs16(Fragment5, { children: [
3562
+ " \xB7 ",
3563
+ /* @__PURE__ */ jsx20(
3564
+ "a",
3565
+ {
3566
+ href: action.href,
3567
+ className: "text-ph-brand underline-offset-2 hover:underline",
3568
+ children: "Open"
3569
+ }
3570
+ )
3571
+ ] }) : null
3572
+ ] }) : null,
3573
+ action.status === "cancelled" ? /* @__PURE__ */ jsx20("p", { className: "mt-1 text-xs text-ph-subtle", children: "Cancelled" }) : null,
3574
+ action.status === "failed" ? /* @__PURE__ */ jsx20("p", { className: "mt-1 text-xs text-ph-danger", children: action.error || "Could not apply that." }) : null
3575
+ ]
3576
+ },
3577
+ action.id
3578
+ );
3579
+ })
3214
3580
  ] })
3215
3581
  ]
3216
3582
  },
3217
3583
  `assistant-${index}`
3218
3584
  );
3219
3585
  }),
3220
- waiting ? /* @__PURE__ */ jsxs15("div", { className: "flex items-end gap-2", "aria-hidden": true, children: [
3221
- /* @__PURE__ */ jsx19("span", { className: "mb-0.5 flex h-6 w-6 shrink-0 items-center justify-center rounded-full bg-ph-brand/10 text-ph-brand", children: /* @__PURE__ */ jsx19(Icon, { className: "h-3.5 w-3.5" }) }),
3222
- /* @__PURE__ */ jsxs15("div", { className: "flex items-center gap-1.5 rounded-2xl rounded-bl-md bg-ph-muted px-3 py-2.5", children: [
3223
- /* @__PURE__ */ jsx19("span", { className: "suite-think-dot h-1.5 w-1.5 rounded-full bg-ph-mutedtext" }),
3224
- /* @__PURE__ */ jsx19("span", { className: "suite-think-dot suite-think-dot--2 h-1.5 w-1.5 rounded-full bg-ph-mutedtext" }),
3225
- /* @__PURE__ */ jsx19("span", { className: "suite-think-dot suite-think-dot--3 h-1.5 w-1.5 rounded-full bg-ph-mutedtext" })
3586
+ waiting ? /* @__PURE__ */ jsxs16("div", { className: "flex items-end gap-2", "aria-hidden": true, children: [
3587
+ /* @__PURE__ */ jsx20("span", { className: "mb-0.5 flex h-6 w-6 shrink-0 items-center justify-center rounded-full bg-ph-brand/10 text-ph-brand", children: /* @__PURE__ */ jsx20(Icon, { className: "h-3.5 w-3.5" }) }),
3588
+ /* @__PURE__ */ jsxs16("div", { className: "flex items-center gap-1.5 rounded-2xl rounded-bl-md bg-ph-muted px-3 py-2.5", children: [
3589
+ /* @__PURE__ */ jsx20("span", { className: "suite-think-dot h-1.5 w-1.5 rounded-full bg-ph-mutedtext" }),
3590
+ /* @__PURE__ */ jsx20("span", { className: "suite-think-dot suite-think-dot--2 h-1.5 w-1.5 rounded-full bg-ph-mutedtext" }),
3591
+ /* @__PURE__ */ jsx20("span", { className: "suite-think-dot suite-think-dot--3 h-1.5 w-1.5 rounded-full bg-ph-mutedtext" })
3226
3592
  ] })
3227
3593
  ] }) : null,
3228
- waiting ? /* @__PURE__ */ jsx19("span", { className: "sr-only", "aria-live": "polite", children: "Assistant is responding\u2026" }) : null,
3229
- error ? /* @__PURE__ */ jsxs15(
3594
+ waiting ? /* @__PURE__ */ jsx20("span", { className: "sr-only", "aria-live": "polite", children: "Assistant is responding\u2026" }) : null,
3595
+ error ? /* @__PURE__ */ jsxs16(
3230
3596
  "div",
3231
3597
  {
3232
3598
  role: "alert",
3233
3599
  className: "flex items-start gap-2 rounded-[var(--ph-radius-surface)] border border-ph-danger/30 bg-ph-danger/10 px-3 py-2.5 text-sm text-ph-ink",
3234
3600
  children: [
3235
- /* @__PURE__ */ jsx19(WarningTriangle, { className: "mt-0.5 h-4 w-4 shrink-0 text-ph-danger" }),
3236
- /* @__PURE__ */ jsxs15("div", { className: "min-w-0 flex-1", children: [
3237
- /* @__PURE__ */ jsx19("p", { className: "font-medium text-ph-danger", children: "Something went wrong" }),
3238
- /* @__PURE__ */ jsx19("p", { className: "mt-0.5 text-ph-subtle", children: error }),
3239
- /* @__PURE__ */ jsx19(
3601
+ /* @__PURE__ */ jsx20(WarningTriangle, { className: "mt-0.5 h-4 w-4 shrink-0 text-ph-danger" }),
3602
+ /* @__PURE__ */ jsxs16("div", { className: "min-w-0 flex-1", children: [
3603
+ /* @__PURE__ */ jsx20("p", { className: "font-medium text-ph-danger", children: "Something went wrong" }),
3604
+ /* @__PURE__ */ jsx20("p", { className: "mt-0.5 text-ph-subtle", children: error }),
3605
+ /* @__PURE__ */ jsx20(
3240
3606
  "button",
3241
3607
  {
3242
3608
  type: "button",
@@ -3253,20 +3619,20 @@ function SuiteAiPanel({
3253
3619
  ]
3254
3620
  }
3255
3621
  ),
3256
- !atBottom ? /* @__PURE__ */ jsx19("div", { className: "absolute bottom-3 left-1/2 -translate-x-1/2", children: /* @__PURE__ */ jsx19(Tooltip, { content: "Scroll to latest", children: /* @__PURE__ */ jsx19(
3622
+ !atBottom ? /* @__PURE__ */ jsx20("div", { className: "absolute bottom-3 left-1/2 -translate-x-1/2", children: /* @__PURE__ */ jsx20(Tooltip, { content: "Scroll to latest", children: /* @__PURE__ */ jsx20(
3257
3623
  "button",
3258
3624
  {
3259
3625
  type: "button",
3260
3626
  onClick: () => scrollToBottom("smooth"),
3261
3627
  className: "ph-btn ph-btn-ghost ph-btn-circle h-9 w-9 border border-ph-border bg-ph-surface text-ph-subtle shadow-[var(--ph-shadow-floating)]",
3262
3628
  "aria-label": "Scroll to latest",
3263
- children: /* @__PURE__ */ jsx19(ArrowDown, { className: "h-4 w-4" })
3629
+ children: /* @__PURE__ */ jsx20(ArrowDown, { className: "h-4 w-4" })
3264
3630
  }
3265
3631
  ) }) }) : null
3266
3632
  ] }),
3267
- /* @__PURE__ */ jsx19("div", { className: "px-2 pt-2 pb-[max(2rem,calc(env(safe-area-inset-bottom)+1rem))]", children: /* @__PURE__ */ jsxs15("div", { className: "suite-ai-composer flex items-end gap-1.5 border bg-ph-surface px-1.5 py-1", children: [
3268
- /* @__PURE__ */ jsx19("label", { htmlFor: inputId, className: "sr-only", children: "Ask a question" }),
3269
- /* @__PURE__ */ jsx19(
3633
+ /* @__PURE__ */ jsx20("div", { className: "px-2 pt-2 pb-[max(2rem,calc(env(safe-area-inset-bottom)+1rem))]", children: /* @__PURE__ */ jsxs16("div", { className: "suite-ai-composer flex items-end gap-1.5 border bg-ph-surface px-1.5 py-1", children: [
3634
+ /* @__PURE__ */ jsx20("label", { htmlFor: inputId, className: "sr-only", children: "Ask a question" }),
3635
+ /* @__PURE__ */ jsx20(
3270
3636
  "textarea",
3271
3637
  {
3272
3638
  id: inputId,
@@ -3285,7 +3651,7 @@ function SuiteAiPanel({
3285
3651
  className: "max-h-36 min-h-10 flex-1 resize-none bg-transparent px-1.5 py-2 text-sm leading-relaxed text-ph-ink outline-none placeholder:text-ph-mutedtext"
3286
3652
  }
3287
3653
  ),
3288
- waiting ? /* @__PURE__ */ jsx19(Tooltip, { content: "Stop generating", children: /* @__PURE__ */ jsx19(
3654
+ waiting ? /* @__PURE__ */ jsx20(Tooltip, { content: "Stop generating", children: /* @__PURE__ */ jsx20(
3289
3655
  "button",
3290
3656
  {
3291
3657
  type: "button",
@@ -3293,9 +3659,9 @@ function SuiteAiPanel({
3293
3659
  "data-test": "ask-ai-stop",
3294
3660
  className: "ph-btn ph-btn-ghost ph-btn-circle h-9 w-9 shrink-0 bg-ph-muted text-ph-ink",
3295
3661
  "aria-label": "Stop generating",
3296
- children: /* @__PURE__ */ jsx19(Square, { className: "h-3.5 w-3.5 fill-current" })
3662
+ children: /* @__PURE__ */ jsx20(Square, { className: "h-3.5 w-3.5 fill-current" })
3297
3663
  }
3298
- ) }) : /* @__PURE__ */ jsx19(Tooltip, { content: "Send message", children: /* @__PURE__ */ jsx19(
3664
+ ) }) : /* @__PURE__ */ jsx20(Tooltip, { content: "Send message", children: /* @__PURE__ */ jsx20(
3299
3665
  "button",
3300
3666
  {
3301
3667
  type: "button",
@@ -3304,7 +3670,7 @@ function SuiteAiPanel({
3304
3670
  "data-test": "ask-ai-send",
3305
3671
  className: "ph-btn ph-btn-primary ph-btn-circle h-9 w-9 shrink-0",
3306
3672
  "aria-label": "Send message",
3307
- children: /* @__PURE__ */ jsx19(ArrowUp, { className: "h-4 w-4" })
3673
+ children: /* @__PURE__ */ jsx20(ArrowUp, { className: "h-4 w-4" })
3308
3674
  }
3309
3675
  ) })
3310
3676
  ] }) })
@@ -3316,7 +3682,7 @@ function SuiteAiPanel({
3316
3682
  // src/suite/components/workspace-switcher.tsx
3317
3683
  import { useState as useState11 } from "react";
3318
3684
  import { Building, Check as Check2, NavArrowDown } from "iconoir-react";
3319
- import { Fragment as Fragment6, jsx as jsx20, jsxs as jsxs16 } from "react/jsx-runtime";
3685
+ import { Fragment as Fragment6, jsx as jsx21, jsxs as jsxs17 } from "react/jsx-runtime";
3320
3686
  function SuiteWorkspaceSwitcher({
3321
3687
  workspaces = [],
3322
3688
  groups,
@@ -3334,7 +3700,7 @@ function SuiteWorkspaceSwitcher({
3334
3700
  var _a2;
3335
3701
  const [open, setOpen] = useState11(false);
3336
3702
  const sections = (_a2 = groups == null ? void 0 : groups.filter((group) => group.workspaces.length > 0)) != null ? _a2 : workspaces.length > 0 ? [{ id: "workspaces", label: "Switch workspace", workspaces }] : [];
3337
- return /* @__PURE__ */ jsx20(
3703
+ return /* @__PURE__ */ jsx21(
3338
3704
  DropdownMenu2,
3339
3705
  {
3340
3706
  "aria-label": "Switch workspace",
@@ -3345,7 +3711,7 @@ function SuiteWorkspaceSwitcher({
3345
3711
  align: "start",
3346
3712
  open,
3347
3713
  onOpenChange: setOpen,
3348
- trigger: /* @__PURE__ */ jsxs16(
3714
+ trigger: /* @__PURE__ */ jsxs17(
3349
3715
  "span",
3350
3716
  {
3351
3717
  className: cn2(
@@ -3355,10 +3721,10 @@ function SuiteWorkspaceSwitcher({
3355
3721
  ),
3356
3722
  "data-test": "workspace-switcher-trigger",
3357
3723
  children: [
3358
- /* @__PURE__ */ jsx20(Building, { className: "h-4 w-4 shrink-0 text-ph-ink", "aria-hidden": true }),
3359
- !collapsed ? /* @__PURE__ */ jsxs16(Fragment6, { children: [
3360
- /* @__PURE__ */ jsx20("span", { className: "min-w-0 flex-1 truncate text-sm font-semibold text-ph-ink", children: name }),
3361
- /* @__PURE__ */ jsx20(
3724
+ /* @__PURE__ */ jsx21(Building, { className: "h-4 w-4 shrink-0 text-ph-ink", "aria-hidden": true }),
3725
+ !collapsed ? /* @__PURE__ */ jsxs17(Fragment6, { children: [
3726
+ /* @__PURE__ */ jsx21("span", { className: "min-w-0 flex-1 truncate text-sm font-semibold text-ph-ink", children: name }),
3727
+ /* @__PURE__ */ jsx21(
3362
3728
  NavArrowDown,
3363
3729
  {
3364
3730
  className: cn2(
@@ -3372,16 +3738,16 @@ function SuiteWorkspaceSwitcher({
3372
3738
  ]
3373
3739
  }
3374
3740
  ),
3375
- children: /* @__PURE__ */ jsxs16(
3741
+ children: /* @__PURE__ */ jsxs17(
3376
3742
  "div",
3377
3743
  {
3378
3744
  id: "workspace-switcher-menu",
3379
3745
  className: "p-1",
3380
3746
  "data-test": "workspace-switcher-menu",
3381
3747
  children: [
3382
- sections.length === 0 ? /* @__PURE__ */ jsx20("p", { className: "px-3 py-2 text-sm text-ph-mutedtext", children: emptyLabel }) : sections.map((section) => /* @__PURE__ */ jsxs16("div", { children: [
3383
- /* @__PURE__ */ jsx20("p", { className: "px-3 py-2 text-[length:var(--ph-type-overline)] font-semibold uppercase tracking-[0.08em] text-ph-mutedtext", children: section.label }),
3384
- section.workspaces.map((workspace) => /* @__PURE__ */ jsx20(
3748
+ sections.length === 0 ? /* @__PURE__ */ jsx21("p", { className: "px-3 py-2 text-sm text-ph-mutedtext", children: emptyLabel }) : sections.map((section) => /* @__PURE__ */ jsxs17("div", { children: [
3749
+ /* @__PURE__ */ jsx21("p", { className: "px-3 py-2 text-[length:var(--ph-type-overline)] font-semibold uppercase tracking-[0.08em] text-ph-mutedtext", children: section.label }),
3750
+ section.workspaces.map((workspace) => /* @__PURE__ */ jsx21(
3385
3751
  DropdownItem2,
3386
3752
  {
3387
3753
  id: `workspace-option-${workspace.id}`,
@@ -3394,12 +3760,12 @@ function SuiteWorkspaceSwitcher({
3394
3760
  onSelect(workspace);
3395
3761
  },
3396
3762
  className: appSwitcherMenuItemClass(),
3397
- children: /* @__PURE__ */ jsxs16("span", { className: "flex min-w-0 w-full items-center gap-3", children: [
3398
- /* @__PURE__ */ jsxs16("span", { className: "min-w-0 flex-1", children: [
3399
- /* @__PURE__ */ jsx20("span", { className: "block truncate text-sm font-medium text-ph-ink", children: workspace.name }),
3400
- workspace.description ? /* @__PURE__ */ jsx20("span", { className: "block truncate text-xs text-ph-mutedtext", children: workspace.description }) : null
3763
+ children: /* @__PURE__ */ jsxs17("span", { className: "flex min-w-0 w-full items-center gap-3", children: [
3764
+ /* @__PURE__ */ jsxs17("span", { className: "min-w-0 flex-1", children: [
3765
+ /* @__PURE__ */ jsx21("span", { className: "block truncate text-sm font-medium text-ph-ink", children: workspace.name }),
3766
+ workspace.description ? /* @__PURE__ */ jsx21("span", { className: "block truncate text-xs text-ph-mutedtext", children: workspace.description }) : null
3401
3767
  ] }),
3402
- workspace.id === currentId ? /* @__PURE__ */ jsx20(
3768
+ workspace.id === currentId ? /* @__PURE__ */ jsx21(
3403
3769
  Check2,
3404
3770
  {
3405
3771
  className: "h-4 w-4 shrink-0 text-ph-brand",
@@ -3411,7 +3777,7 @@ function SuiteWorkspaceSwitcher({
3411
3777
  workspace.id
3412
3778
  ))
3413
3779
  ] }, section.id)),
3414
- footer ? /* @__PURE__ */ jsx20("div", { className: "mt-1 border-t border-ph-border pt-1", children: footer }) : null
3780
+ footer ? /* @__PURE__ */ jsx21("div", { className: "mt-1 border-t border-ph-border pt-1", children: footer }) : null
3415
3781
  ]
3416
3782
  }
3417
3783
  )
@@ -3420,7 +3786,7 @@ function SuiteWorkspaceSwitcher({
3420
3786
  }
3421
3787
 
3422
3788
  // src/suite/icons/suite-icon.tsx
3423
- import { jsx as jsx21, jsxs as jsxs17 } from "react/jsx-runtime";
3789
+ import { jsx as jsx22, jsxs as jsxs18 } from "react/jsx-runtime";
3424
3790
  var TODAY_SUN_STYLE = `
3425
3791
  @media (prefers-reduced-motion: no-preference) {
3426
3792
  .suite-icon-today-sun-rays {
@@ -3446,7 +3812,7 @@ function SuiteIcon({
3446
3812
  const glyph = SUITE_GLYPHS[name];
3447
3813
  const accentHex = accent ? APP_ACCENTS[accent].accent : void 0;
3448
3814
  const mergedStyle = accentHex ? __spreadProps(__spreadValues({}, style), { "--suite-icon-accent": accentHex }) : style;
3449
- return /* @__PURE__ */ jsxs17(
3815
+ return /* @__PURE__ */ jsxs18(
3450
3816
  "svg",
3451
3817
  {
3452
3818
  width: size,
@@ -3463,8 +3829,8 @@ function SuiteIcon({
3463
3829
  "aria-label": label,
3464
3830
  "aria-hidden": label ? void 0 : true,
3465
3831
  children: [
3466
- glyph.animatedAccent && animated ? /* @__PURE__ */ jsx21("style", { children: TODAY_SUN_STYLE }) : null,
3467
- /* @__PURE__ */ jsx21(
3832
+ glyph.animatedAccent && animated ? /* @__PURE__ */ jsx22("style", { children: TODAY_SUN_STYLE }) : null,
3833
+ /* @__PURE__ */ jsx22(
3468
3834
  GlyphParts,
3469
3835
  {
3470
3836
  elements: glyph.elements,
@@ -3649,9 +4015,9 @@ function useSidebarWidth(storageKey = SUITE_SIDEBAR_WIDTH_KEY, defaultWidth = SI
3649
4015
 
3650
4016
  // src/suite/lib/motion.tsx
3651
4017
  import { LazyMotion, domAnimation, m } from "motion/react";
3652
- import { jsx as jsx22 } from "react/jsx-runtime";
4018
+ import { jsx as jsx23 } from "react/jsx-runtime";
3653
4019
  function SuiteMotionProvider({ children }) {
3654
- return /* @__PURE__ */ jsx22(LazyMotion, { features: domAnimation, strict: true, children });
4020
+ return /* @__PURE__ */ jsx23(LazyMotion, { features: domAnimation, strict: true, children });
3655
4021
  }
3656
4022
  var SUITE_SPRINGS = {
3657
4023
  /** Snappy panel/sheet entrances — small overshoot. */
@@ -3663,24 +4029,24 @@ var SUITE_SPRINGS = {
3663
4029
  };
3664
4030
 
3665
4031
  // src/suite/components/suite-skeleton.tsx
3666
- import { jsx as jsx23, jsxs as jsxs18 } from "react/jsx-runtime";
4032
+ import { jsx as jsx24, jsxs as jsxs19 } from "react/jsx-runtime";
3667
4033
  function SuiteSkeleton({
3668
4034
  className,
3669
4035
  lines = 1,
3670
4036
  circle,
3671
4037
  width
3672
4038
  }) {
3673
- return /* @__PURE__ */ jsx23(
4039
+ return /* @__PURE__ */ jsx24(
3674
4040
  "div",
3675
4041
  {
3676
4042
  className: cn2("space-y-2", circle ? "flex flex-col items-center" : ""),
3677
4043
  "aria-hidden": true,
3678
- children: Array.from({ length: lines }).map((_, index) => /* @__PURE__ */ jsx23(
4044
+ children: Array.from({ length: lines }).map((_, index) => /* @__PURE__ */ jsx24(
3679
4045
  "div",
3680
4046
  {
3681
4047
  className: "animate-[skeleton-stagger_0.6s_ease-out_both]",
3682
4048
  style: { animationDelay: `${index * 80}ms` },
3683
- children: /* @__PURE__ */ jsx23(
4049
+ children: /* @__PURE__ */ jsx24(
3684
4050
  "div",
3685
4051
  {
3686
4052
  className: cn2(
@@ -3704,7 +4070,7 @@ function SuiteSkeletonCard({
3704
4070
  rows = 3,
3705
4071
  header = true
3706
4072
  }) {
3707
- return /* @__PURE__ */ jsxs18(
4073
+ return /* @__PURE__ */ jsxs19(
3708
4074
  "div",
3709
4075
  {
3710
4076
  className: cn2(
@@ -3713,26 +4079,26 @@ function SuiteSkeletonCard({
3713
4079
  ),
3714
4080
  "aria-hidden": true,
3715
4081
  children: [
3716
- header ? /* @__PURE__ */ jsxs18(
4082
+ header ? /* @__PURE__ */ jsxs19(
3717
4083
  "div",
3718
4084
  {
3719
4085
  className: "mb-5 flex items-center gap-3 animate-[skeleton-stagger_0.5s_ease-out_both]",
3720
4086
  style: { animationDelay: "100ms" },
3721
4087
  children: [
3722
- /* @__PURE__ */ jsx23("div", { className: "ph-skeleton h-10 w-10 rounded-[var(--ph-radius-control)]" }),
3723
- /* @__PURE__ */ jsxs18("div", { className: "flex-1 space-y-2", children: [
3724
- /* @__PURE__ */ jsx23("div", { className: "ph-skeleton h-4 w-1/3" }),
3725
- /* @__PURE__ */ jsx23("div", { className: "ph-skeleton h-3 w-1/2" })
4088
+ /* @__PURE__ */ jsx24("div", { className: "ph-skeleton h-10 w-10 rounded-[var(--ph-radius-control)]" }),
4089
+ /* @__PURE__ */ jsxs19("div", { className: "flex-1 space-y-2", children: [
4090
+ /* @__PURE__ */ jsx24("div", { className: "ph-skeleton h-4 w-1/3" }),
4091
+ /* @__PURE__ */ jsx24("div", { className: "ph-skeleton h-3 w-1/2" })
3726
4092
  ] })
3727
4093
  ]
3728
4094
  }
3729
4095
  ) : null,
3730
- /* @__PURE__ */ jsx23("div", { className: "space-y-3", children: Array.from({ length: rows }).map((_, index) => /* @__PURE__ */ jsx23(
4096
+ /* @__PURE__ */ jsx24("div", { className: "space-y-3", children: Array.from({ length: rows }).map((_, index) => /* @__PURE__ */ jsx24(
3731
4097
  "div",
3732
4098
  {
3733
4099
  className: "animate-[skeleton-stagger_0.5s_ease-out_both]",
3734
4100
  style: { animationDelay: `${200 + index * 80}ms` },
3735
- children: /* @__PURE__ */ jsx23(
4101
+ children: /* @__PURE__ */ jsx24(
3736
4102
  "div",
3737
4103
  {
3738
4104
  className: "ph-skeleton h-3",
@@ -3750,16 +4116,16 @@ function SuiteSkeletonList({
3750
4116
  className,
3751
4117
  items = 4
3752
4118
  }) {
3753
- return /* @__PURE__ */ jsx23("div", { className: cn2("space-y-3", className), "aria-hidden": true, children: Array.from({ length: items }).map((_, index) => /* @__PURE__ */ jsx23(
4119
+ return /* @__PURE__ */ jsx24("div", { className: cn2("space-y-3", className), "aria-hidden": true, children: Array.from({ length: items }).map((_, index) => /* @__PURE__ */ jsx24(
3754
4120
  "div",
3755
4121
  {
3756
4122
  className: "animate-[skeleton-stagger_0.6s_ease-out_both]",
3757
4123
  style: { animationDelay: `${index * 100}ms` },
3758
- children: /* @__PURE__ */ jsxs18("div", { className: "flex items-center gap-3 rounded-[var(--ph-radius-surface)] border border-ph-border bg-ph-surface p-4", children: [
3759
- /* @__PURE__ */ jsx23("div", { className: "ph-skeleton h-10 w-10 rounded-[var(--ph-radius-control)]" }),
3760
- /* @__PURE__ */ jsxs18("div", { className: "min-w-0 flex-1 space-y-2", children: [
3761
- /* @__PURE__ */ jsx23("div", { className: "ph-skeleton h-3.5 w-3/4" }),
3762
- /* @__PURE__ */ jsx23("div", { className: "ph-skeleton h-3 w-1/2" })
4124
+ children: /* @__PURE__ */ jsxs19("div", { className: "flex items-center gap-3 rounded-[var(--ph-radius-surface)] border border-ph-border bg-ph-surface p-4", children: [
4125
+ /* @__PURE__ */ jsx24("div", { className: "ph-skeleton h-10 w-10 rounded-[var(--ph-radius-control)]" }),
4126
+ /* @__PURE__ */ jsxs19("div", { className: "min-w-0 flex-1 space-y-2", children: [
4127
+ /* @__PURE__ */ jsx24("div", { className: "ph-skeleton h-3.5 w-3/4" }),
4128
+ /* @__PURE__ */ jsx24("div", { className: "ph-skeleton h-3 w-1/2" })
3763
4129
  ] })
3764
4130
  ] })
3765
4131
  },
@@ -3774,7 +4140,7 @@ function SuiteEmptyState({
3774
4140
  className,
3775
4141
  size = "md"
3776
4142
  }) {
3777
- return /* @__PURE__ */ jsxs18(
4143
+ return /* @__PURE__ */ jsxs19(
3778
4144
  "div",
3779
4145
  {
3780
4146
  className: cn2(
@@ -3783,13 +4149,13 @@ function SuiteEmptyState({
3783
4149
  className
3784
4150
  ),
3785
4151
  children: [
3786
- /* @__PURE__ */ jsxs18("div", { className: "pointer-events-none absolute inset-0 overflow-hidden opacity-60", "aria-hidden": true, children: [
3787
- /* @__PURE__ */ jsx23("div", { className: "absolute -left-10 -top-10 h-40 w-40 rounded-full bg-ph-brand/10 blur-3xl" }),
3788
- /* @__PURE__ */ jsx23("div", { className: "absolute -bottom-10 -right-10 h-40 w-40 rounded-full bg-ph-accent/10 blur-3xl" })
4152
+ /* @__PURE__ */ jsxs19("div", { className: "pointer-events-none absolute inset-0 overflow-hidden opacity-60", "aria-hidden": true, children: [
4153
+ /* @__PURE__ */ jsx24("div", { className: "absolute -left-10 -top-10 h-40 w-40 rounded-full bg-ph-brand/10 blur-3xl" }),
4154
+ /* @__PURE__ */ jsx24("div", { className: "absolute -bottom-10 -right-10 h-40 w-40 rounded-full bg-ph-accent/10 blur-3xl" })
3789
4155
  ] }),
3790
- /* @__PURE__ */ jsxs18("div", { className: "relative", children: [
3791
- icon ? /* @__PURE__ */ jsx23("div", { className: "mx-auto mb-4 inline-flex items-center justify-center rounded-[var(--ph-radius-surface)] border border-ph-border bg-ph-muted p-3 shadow-[var(--ph-shadow-control)]", children: icon }) : null,
3792
- /* @__PURE__ */ jsx23(
4156
+ /* @__PURE__ */ jsxs19("div", { className: "relative", children: [
4157
+ icon ? /* @__PURE__ */ jsx24("div", { className: "mx-auto mb-4 inline-flex items-center justify-center rounded-[var(--ph-radius-surface)] border border-ph-border bg-ph-muted p-3 shadow-[var(--ph-shadow-control)]", children: icon }) : null,
4158
+ /* @__PURE__ */ jsx24(
3793
4159
  "h2",
3794
4160
  {
3795
4161
  className: cn2(
@@ -3799,8 +4165,8 @@ function SuiteEmptyState({
3799
4165
  children: title
3800
4166
  }
3801
4167
  ),
3802
- description ? /* @__PURE__ */ jsx23("p", { className: "mx-auto mt-2 max-w-sm text-sm leading-relaxed text-ph-subtle", children: description }) : null,
3803
- action ? /* @__PURE__ */ jsx23("div", { className: "mt-5 flex flex-wrap items-center justify-center gap-2", children: action }) : null
4168
+ description ? /* @__PURE__ */ jsx24("p", { className: "mx-auto mt-2 max-w-sm text-sm leading-relaxed text-ph-subtle", children: description }) : null,
4169
+ action ? /* @__PURE__ */ jsx24("div", { className: "mt-5 flex flex-wrap items-center justify-center gap-2", children: action }) : null
3804
4170
  ] })
3805
4171
  ]
3806
4172
  }
@@ -3809,7 +4175,7 @@ function SuiteEmptyState({
3809
4175
 
3810
4176
  // src/suite/components/suite-settings-mobile-nav.tsx
3811
4177
  import { isValidElement } from "react";
3812
- import { jsx as jsx24, jsxs as jsxs19 } from "react/jsx-runtime";
4178
+ import { jsx as jsx25, jsxs as jsxs20 } from "react/jsx-runtime";
3813
4179
  function SuiteSettingsMobileNav({
3814
4180
  items,
3815
4181
  activeHref,
@@ -3818,16 +4184,16 @@ function SuiteSettingsMobileNav({
3818
4184
  ariaLabel = "Settings sections",
3819
4185
  className
3820
4186
  }) {
3821
- return /* @__PURE__ */ jsx24(
4187
+ return /* @__PURE__ */ jsx25(
3822
4188
  "nav",
3823
4189
  {
3824
4190
  "data-test": dataTest,
3825
4191
  "aria-label": ariaLabel,
3826
4192
  className: cn2("suite-settings-mobile-nav lg:hidden", className),
3827
- children: /* @__PURE__ */ jsx24("div", { className: "flex snap-x gap-2 overflow-x-auto pb-3 pt-1 scrollbar-hide [-ms-overflow-style:none] [scrollbar-width:none] [&::-webkit-scrollbar]:hidden", children: items.map((item) => {
4193
+ children: /* @__PURE__ */ jsx25("div", { className: "flex snap-x gap-2 overflow-x-auto pb-3 pt-1 scrollbar-hide [-ms-overflow-style:none] [scrollbar-width:none] [&::-webkit-scrollbar]:hidden", children: items.map((item) => {
3828
4194
  const Icon = item.icon;
3829
4195
  const active = activeHref === item.href || activeHref.startsWith(`${item.href}/`);
3830
- const iconNode = isValidElement(item.icon) ? item.icon : /* @__PURE__ */ jsx24(
4196
+ const iconNode = isValidElement(item.icon) ? item.icon : /* @__PURE__ */ jsx25(
3831
4197
  Icon,
3832
4198
  {
3833
4199
  className: cn2(
@@ -3837,13 +4203,17 @@ function SuiteSettingsMobileNav({
3837
4203
  "aria-hidden": true
3838
4204
  }
3839
4205
  );
3840
- return /* @__PURE__ */ jsxs19(
4206
+ return /* @__PURE__ */ jsxs20(
3841
4207
  "button",
3842
4208
  {
3843
4209
  type: "button",
3844
4210
  id: item.id,
3845
4211
  "data-test": item.testId,
3846
- onClick: () => onSelect(item.href),
4212
+ onClick: () => {
4213
+ var _a2;
4214
+ trackSuiteEvent("Tab Viewed", { tab: (_a2 = item.id) != null ? _a2 : item.href });
4215
+ onSelect(item.href);
4216
+ },
3847
4217
  "aria-current": active ? "page" : void 0,
3848
4218
  className: cn2(
3849
4219
  "group relative flex min-h-[44px] shrink-0 snap-start items-center gap-2 rounded-[var(--ph-radius-control)] border px-3.5 py-2.5 text-sm font-medium transition-colors focus-visible:outline-none focus-visible:shadow-[var(--ph-focus-halo)]",
@@ -3851,7 +4221,7 @@ function SuiteSettingsMobileNav({
3851
4221
  ),
3852
4222
  children: [
3853
4223
  iconNode,
3854
- /* @__PURE__ */ jsx24("span", { className: "whitespace-nowrap", children: item.label })
4224
+ /* @__PURE__ */ jsx25("span", { className: "whitespace-nowrap", children: item.label })
3855
4225
  ]
3856
4226
  },
3857
4227
  item.href
@@ -3865,7 +4235,7 @@ function SuiteSettingsMobileNav({
3865
4235
  import Link2 from "next/link";
3866
4236
  import { useCallback as useCallback6, useEffect as useEffect9, useRef as useRef4 } from "react";
3867
4237
  import { NavArrowLeft, Sparks as Sparks2 } from "iconoir-react";
3868
- import { Fragment as Fragment7, jsx as jsx25, jsxs as jsxs20 } from "react/jsx-runtime";
4238
+ import { Fragment as Fragment7, jsx as jsx26, jsxs as jsxs21 } from "react/jsx-runtime";
3869
4239
  function renderNode(node, collapsed) {
3870
4240
  if (typeof node === "function") return node(collapsed);
3871
4241
  return node;
@@ -3942,7 +4312,7 @@ function SuiteSidebar({
3942
4312
  if (collapsed) onRequestExpand == null ? void 0 : onRequestExpand();
3943
4313
  setAskAi(true);
3944
4314
  }
3945
- const askAiButton = /* @__PURE__ */ jsx25(
4315
+ const askAiButton = /* @__PURE__ */ jsx26(
3946
4316
  "button",
3947
4317
  {
3948
4318
  ref: askAiButtonRef,
@@ -3955,11 +4325,11 @@ function SuiteSidebar({
3955
4325
  "ph-btn ph-btn-ghost ph-btn-square h-10 w-10 shrink-0",
3956
4326
  askAiOpen ? "bg-ph-brand/10 text-ph-brand" : "text-ph-mutedtext hover:bg-ph-muted hover:text-ph-ink"
3957
4327
  ),
3958
- children: /* @__PURE__ */ jsx25(Sparks2, { className: "h-4 w-4", "aria-hidden": true })
4328
+ children: /* @__PURE__ */ jsx26(Sparks2, { className: "h-4 w-4", "aria-hidden": true })
3959
4329
  }
3960
4330
  );
3961
4331
  if (chatOpen) {
3962
- return /* @__PURE__ */ jsxs20(
4332
+ return /* @__PURE__ */ jsxs21(
3963
4333
  "div",
3964
4334
  {
3965
4335
  "data-suite-chat-open": "",
@@ -3969,7 +4339,7 @@ function SuiteSidebar({
3969
4339
  className
3970
4340
  ),
3971
4341
  children: [
3972
- /* @__PURE__ */ jsxs20(
4342
+ /* @__PURE__ */ jsxs21(
3973
4343
  "div",
3974
4344
  {
3975
4345
  className: cn2(
@@ -3977,7 +4347,7 @@ function SuiteSidebar({
3977
4347
  surface ? "bg-ph-surface" : "bg-ph-canvas"
3978
4348
  ),
3979
4349
  children: [
3980
- /* @__PURE__ */ jsx25(
4350
+ /* @__PURE__ */ jsx26(
3981
4351
  "button",
3982
4352
  {
3983
4353
  ref: askAiBackRef,
@@ -3986,19 +4356,19 @@ function SuiteSidebar({
3986
4356
  "aria-label": "Back to navigation",
3987
4357
  onClick: closeAskAi,
3988
4358
  className: "ph-btn ph-btn-ghost ph-btn-square h-10 w-10 shrink-0 text-ph-subtle",
3989
- children: /* @__PURE__ */ jsx25(NavArrowLeft, { className: "h-4 w-4", "aria-hidden": true })
4359
+ children: /* @__PURE__ */ jsx26(NavArrowLeft, { className: "h-4 w-4", "aria-hidden": true })
3990
4360
  }
3991
4361
  ),
3992
- /* @__PURE__ */ jsx25("span", { className: "min-w-0 flex-1 truncate text-sm font-semibold text-ph-ink", children: "Shelly AI" })
4362
+ /* @__PURE__ */ jsx26("span", { className: "min-w-0 flex-1 truncate text-sm font-semibold text-ph-ink", children: "Shelly AI" })
3993
4363
  ]
3994
4364
  }
3995
4365
  ),
3996
- /* @__PURE__ */ jsx25("div", { className: "min-h-0 flex-1", children: askAi })
4366
+ /* @__PURE__ */ jsx26("div", { className: "min-h-0 flex-1", children: askAi })
3997
4367
  ]
3998
4368
  }
3999
4369
  );
4000
4370
  }
4001
- return /* @__PURE__ */ jsxs20(
4371
+ return /* @__PURE__ */ jsxs21(
4002
4372
  "div",
4003
4373
  {
4004
4374
  "data-surface": surface ? "true" : "false",
@@ -4007,7 +4377,7 @@ function SuiteSidebar({
4007
4377
  className
4008
4378
  ),
4009
4379
  children: [
4010
- appSwitcher || notificationBell ? /* @__PURE__ */ jsxs20(
4380
+ appSwitcher || notificationBell ? /* @__PURE__ */ jsxs21(
4011
4381
  "div",
4012
4382
  {
4013
4383
  className: cn2(
@@ -4015,12 +4385,12 @@ function SuiteSidebar({
4015
4385
  collapsed ? "flex-col items-center gap-1 px-1 py-2" : "h-14 items-center justify-between gap-2 px-3"
4016
4386
  ),
4017
4387
  children: [
4018
- /* @__PURE__ */ jsx25("div", { className: cn2("min-w-0", collapsed ? "shrink-0" : "flex-1"), children: renderNode(appSwitcher, collapsed) }),
4019
- collapsed ? null : /* @__PURE__ */ jsx25("div", { className: "shrink-0", children: renderNode(notificationBell, collapsed) })
4388
+ /* @__PURE__ */ jsx26("div", { className: cn2("min-w-0", collapsed ? "shrink-0" : "flex-1"), children: renderNode(appSwitcher, collapsed) }),
4389
+ collapsed ? null : /* @__PURE__ */ jsx26("div", { className: "shrink-0", children: renderNode(notificationBell, collapsed) })
4020
4390
  ]
4021
4391
  }
4022
4392
  ) : null,
4023
- /* @__PURE__ */ jsxs20(
4393
+ /* @__PURE__ */ jsxs21(
4024
4394
  "div",
4025
4395
  {
4026
4396
  className: cn2(
@@ -4029,7 +4399,7 @@ function SuiteSidebar({
4029
4399
  collapsed ? "px-1.5 py-2" : "p-3"
4030
4400
  ),
4031
4401
  children: [
4032
- contextSwitcher ? /* @__PURE__ */ jsx25(
4402
+ contextSwitcher ? /* @__PURE__ */ jsx26(
4033
4403
  "div",
4034
4404
  {
4035
4405
  className: cn2(
@@ -4039,9 +4409,9 @@ function SuiteSidebar({
4039
4409
  children: renderNode(contextSwitcher, collapsed)
4040
4410
  }
4041
4411
  ) : null,
4042
- chatOpen ? /* @__PURE__ */ jsxs20("div", { className: "flex min-h-0 flex-1 flex-col", children: [
4043
- /* @__PURE__ */ jsxs20("div", { className: "mb-2 flex shrink-0 items-center gap-1", children: [
4044
- /* @__PURE__ */ jsxs20(
4412
+ chatOpen ? /* @__PURE__ */ jsxs21("div", { className: "flex min-h-0 flex-1 flex-col", children: [
4413
+ /* @__PURE__ */ jsxs21("div", { className: "mb-2 flex shrink-0 items-center gap-1", children: [
4414
+ /* @__PURE__ */ jsxs21(
4045
4415
  "button",
4046
4416
  {
4047
4417
  type: "button",
@@ -4049,20 +4419,20 @@ function SuiteSidebar({
4049
4419
  onClick: closeAskAi,
4050
4420
  className: "ph-btn ph-btn-ghost ph-btn-sm h-9 text-ph-subtle",
4051
4421
  children: [
4052
- /* @__PURE__ */ jsx25(NavArrowLeft, { className: "h-4 w-4", "aria-hidden": true }),
4422
+ /* @__PURE__ */ jsx26(NavArrowLeft, { className: "h-4 w-4", "aria-hidden": true }),
4053
4423
  "Nav"
4054
4424
  ]
4055
4425
  }
4056
4426
  ),
4057
- /* @__PURE__ */ jsx25("span", { className: "truncate text-sm font-semibold text-ph-ink", children: "Shelly AI" })
4427
+ /* @__PURE__ */ jsx26("span", { className: "truncate text-sm font-semibold text-ph-ink", children: "Shelly AI" })
4058
4428
  ] }),
4059
- /* @__PURE__ */ jsx25("div", { className: "min-h-0 flex-1", children: askAi })
4060
- ] }) : /* @__PURE__ */ jsxs20(Fragment7, { children: [
4061
- /* @__PURE__ */ jsx25("nav", { "aria-label": "Pages", className: "shrink-0 space-y-1", children: /* @__PURE__ */ jsx25("div", { className: "space-y-1", children: navItems.map((item) => {
4429
+ /* @__PURE__ */ jsx26("div", { className: "min-h-0 flex-1", children: askAi })
4430
+ ] }) : /* @__PURE__ */ jsxs21(Fragment7, { children: [
4431
+ /* @__PURE__ */ jsx26("nav", { "aria-label": "Pages", className: "shrink-0 space-y-1", children: /* @__PURE__ */ jsx26("div", { className: "space-y-1", children: navItems.map((item) => {
4062
4432
  var _a2;
4063
4433
  const Icon = item.icon;
4064
4434
  const active = Boolean(item.active);
4065
- const link = /* @__PURE__ */ jsxs20(
4435
+ const link = /* @__PURE__ */ jsxs21(
4066
4436
  Link2,
4067
4437
  {
4068
4438
  href: item.href,
@@ -4071,12 +4441,12 @@ function SuiteSidebar({
4071
4441
  "aria-current": active ? "page" : void 0,
4072
4442
  onClick: item.onClick,
4073
4443
  className: cn2(
4074
- "group relative flex min-h-11 touch-manipulation items-center gap-2.5 rounded-[var(--ph-radius-control)] text-sm font-medium transition-colors focus-visible:outline-none focus-visible:shadow-[var(--ph-focus-halo)]",
4075
- active ? "bg-[var(--ph-selected-bg)] text-[var(--ph-selected-text)] shadow-[inset_0_0_0_1px_var(--ph-selected-border)]" : "text-ph-subtle hover:bg-[var(--ph-surface-hover)] hover:text-ph-ink",
4444
+ "suite-sidebar-link group relative flex min-h-11 touch-manipulation items-center gap-2.5 rounded-[var(--ph-radius-control)] text-sm font-medium transition-colors",
4445
+ active ? "bg-[var(--ph-selected-bg)] text-[var(--ph-selected-text)]" : "text-ph-subtle hover:bg-[var(--ph-surface-hover)] hover:text-ph-ink",
4076
4446
  collapsed ? "mx-auto size-11 shrink-0 justify-center gap-0 px-0 py-0" : "w-full px-2.5 py-2"
4077
4447
  ),
4078
4448
  children: [
4079
- /* @__PURE__ */ jsx25(
4449
+ /* @__PURE__ */ jsx26(
4080
4450
  "span",
4081
4451
  {
4082
4452
  className: cn2(
@@ -4084,7 +4454,7 @@ function SuiteSidebar({
4084
4454
  item.iconClassName
4085
4455
  ),
4086
4456
  "aria-hidden": true,
4087
- children: /* @__PURE__ */ jsx25(
4457
+ children: /* @__PURE__ */ jsx26(
4088
4458
  Icon,
4089
4459
  {
4090
4460
  className: "h-full w-full",
@@ -4093,7 +4463,7 @@ function SuiteSidebar({
4093
4463
  )
4094
4464
  }
4095
4465
  ),
4096
- /* @__PURE__ */ jsx25(
4466
+ /* @__PURE__ */ jsx26(
4097
4467
  "span",
4098
4468
  {
4099
4469
  className: cn2(
@@ -4104,14 +4474,14 @@ function SuiteSidebar({
4104
4474
  children: item.label
4105
4475
  }
4106
4476
  ),
4107
- !collapsed && item.badge ? /* @__PURE__ */ jsx25("span", { className: "relative ml-auto shrink-0", children: item.badge }) : null
4477
+ !collapsed && item.badge ? /* @__PURE__ */ jsx26("span", { className: "relative ml-auto shrink-0", children: item.badge }) : null
4108
4478
  ]
4109
4479
  },
4110
4480
  item.label
4111
4481
  );
4112
- return collapsed ? /* @__PURE__ */ jsx25(Tooltip, { content: item.label, side: "right", children: link }, item.label) : link;
4482
+ return collapsed ? /* @__PURE__ */ jsx26(Tooltip, { content: item.label, side: "right", children: link }, item.label) : link;
4113
4483
  }) }) }),
4114
- secondaryNav ? /* @__PURE__ */ jsx25(
4484
+ secondaryNav ? /* @__PURE__ */ jsx26(
4115
4485
  "div",
4116
4486
  {
4117
4487
  className: "min-h-0 flex-1",
@@ -4123,14 +4493,14 @@ function SuiteSidebar({
4123
4493
  ]
4124
4494
  }
4125
4495
  ),
4126
- /* @__PURE__ */ jsx25(
4496
+ /* @__PURE__ */ jsx26(
4127
4497
  "div",
4128
4498
  {
4129
4499
  className: cn2(
4130
4500
  "shrink-0 border-t border-ph-border",
4131
4501
  collapsed ? "p-1.5" : "p-3"
4132
4502
  ),
4133
- children: /* @__PURE__ */ jsxs20(
4503
+ children: /* @__PURE__ */ jsxs21(
4134
4504
  "div",
4135
4505
  {
4136
4506
  className: cn2(
@@ -4139,8 +4509,8 @@ function SuiteSidebar({
4139
4509
  ),
4140
4510
  children: [
4141
4511
  renderNode(userMenu, collapsed),
4142
- showAskAi ? /* @__PURE__ */ jsx25("div", { className: cn2("shrink-0", collapsed ? "mt-2" : "ml-auto"), children: /* @__PURE__ */ jsx25(Tooltip, { content: "Shelly AI", side: collapsed ? "right" : "top", children: askAiButton }) }) : footerExtras ? /* @__PURE__ */ jsx25("div", { className: cn2("shrink-0", collapsed ? "mt-2" : "ml-auto"), children: renderNode(footerExtras, collapsed) }) : null,
4143
- showAskAi && footerExtras ? /* @__PURE__ */ jsx25("div", { className: cn2("shrink-0", collapsed && "mt-2"), children: renderNode(footerExtras, collapsed) }) : null
4512
+ showAskAi ? /* @__PURE__ */ jsx26("div", { className: cn2("shrink-0", collapsed ? "mt-2" : "ml-auto"), children: /* @__PURE__ */ jsx26(Tooltip, { content: "Shelly AI", side: collapsed ? "right" : "top", children: askAiButton }) }) : footerExtras ? /* @__PURE__ */ jsx26("div", { className: cn2("shrink-0", collapsed ? "mt-2" : "ml-auto"), children: renderNode(footerExtras, collapsed) }) : null,
4513
+ showAskAi && footerExtras ? /* @__PURE__ */ jsx26("div", { className: cn2("shrink-0", collapsed && "mt-2"), children: renderNode(footerExtras, collapsed) }) : null
4144
4514
  ]
4145
4515
  }
4146
4516
  )
@@ -4152,7 +4522,7 @@ function SuiteSidebar({
4152
4522
  }
4153
4523
 
4154
4524
  // src/suite/components/suite-app-layout.tsx
4155
- import { jsx as jsx26, jsxs as jsxs21 } from "react/jsx-runtime";
4525
+ import { jsx as jsx27, jsxs as jsxs22 } from "react/jsx-runtime";
4156
4526
  function SuiteAppLayout({
4157
4527
  sidebar,
4158
4528
  children,
@@ -4166,7 +4536,7 @@ function SuiteAppLayout({
4166
4536
  onResetWidth,
4167
4537
  className
4168
4538
  }) {
4169
- return /* @__PURE__ */ jsxs21(
4539
+ return /* @__PURE__ */ jsxs22(
4170
4540
  "div",
4171
4541
  {
4172
4542
  "data-test": "app-shell",
@@ -4175,7 +4545,7 @@ function SuiteAppLayout({
4175
4545
  className
4176
4546
  ),
4177
4547
  children: [
4178
- /* @__PURE__ */ jsxs21(
4548
+ /* @__PURE__ */ jsxs22(
4179
4549
  "aside",
4180
4550
  {
4181
4551
  "aria-label": "Sidebar",
@@ -4183,8 +4553,8 @@ function SuiteAppLayout({
4183
4553
  style: { width: `${sidebarWidth}px` },
4184
4554
  "data-collapsed": collapsed ? "true" : "false",
4185
4555
  children: [
4186
- /* @__PURE__ */ jsx26("div", { className: "relative z-0 h-full min-h-0 isolate", children: sidebar }),
4187
- onStartResize ? /* @__PURE__ */ jsx26(
4556
+ /* @__PURE__ */ jsx27("div", { className: "relative z-0 h-full min-h-0 isolate", children: sidebar }),
4557
+ onStartResize ? /* @__PURE__ */ jsx27(
4188
4558
  "div",
4189
4559
  {
4190
4560
  role: "separator",
@@ -4219,9 +4589,9 @@ function SuiteAppLayout({
4219
4589
  ]
4220
4590
  }
4221
4591
  ),
4222
- /* @__PURE__ */ jsxs21("div", { className: "flex min-h-0 min-w-0 flex-1 flex-col", children: [
4223
- mobileHeader ? /* @__PURE__ */ jsx26("div", { className: "shrink-0 lg:hidden", children: mobileHeader }) : null,
4224
- /* @__PURE__ */ jsx26(
4592
+ /* @__PURE__ */ jsxs22("div", { className: "flex min-h-0 min-w-0 flex-1 flex-col", children: [
4593
+ mobileHeader ? /* @__PURE__ */ jsx27("div", { className: "shrink-0 lg:hidden", children: mobileHeader }) : null,
4594
+ /* @__PURE__ */ jsx27(
4225
4595
  "main",
4226
4596
  {
4227
4597
  id: "main-content",
@@ -4235,7 +4605,7 @@ function SuiteAppLayout({
4235
4605
  children
4236
4606
  }
4237
4607
  ),
4238
- bottomNav ? /* @__PURE__ */ jsx26("div", { className: "shrink-0 lg:hidden", children: bottomNav }) : null
4608
+ bottomNav ? /* @__PURE__ */ jsx27("div", { className: "shrink-0 lg:hidden", children: bottomNav }) : null
4239
4609
  ] })
4240
4610
  ]
4241
4611
  }
@@ -4245,7 +4615,7 @@ function SuiteAppLayout({
4245
4615
  // src/suite/components/suite-integration-picker.tsx
4246
4616
  import {
4247
4617
  useEffect as useEffect10,
4248
- useMemo as useMemo3,
4618
+ useMemo as useMemo4,
4249
4619
  useRef as useRef5,
4250
4620
  useState as useState13
4251
4621
  } from "react";
@@ -4258,24 +4628,24 @@ import {
4258
4628
  Search,
4259
4629
  Xmark
4260
4630
  } from "iconoir-react";
4261
- import { Fragment as Fragment8, jsx as jsx27, jsxs as jsxs22 } from "react/jsx-runtime";
4631
+ import { Fragment as Fragment8, jsx as jsx28, jsxs as jsxs23 } from "react/jsx-runtime";
4262
4632
  var DESCRIPTION_LIMIT = 90;
4263
4633
  function IntegrationSkeletonCard() {
4264
- return /* @__PURE__ */ jsxs22(
4634
+ return /* @__PURE__ */ jsxs23(
4265
4635
  "div",
4266
4636
  {
4267
4637
  className: "flex min-h-36 min-w-0 animate-pulse flex-col justify-between rounded-[var(--ph-radius-surface)] border border-ph-border bg-ph-surface p-4",
4268
4638
  "aria-hidden": "true",
4269
4639
  children: [
4270
- /* @__PURE__ */ jsxs22("div", { className: "flex items-start gap-3", children: [
4271
- /* @__PURE__ */ jsx27("div", { className: "h-8 w-8 shrink-0 rounded-md bg-ph-muted" }),
4272
- /* @__PURE__ */ jsxs22("div", { className: "min-w-0 flex-1 space-y-2 pt-1", children: [
4273
- /* @__PURE__ */ jsx27("div", { className: "h-4 w-3/5 rounded bg-ph-muted" }),
4274
- /* @__PURE__ */ jsx27("div", { className: "h-3 w-full rounded bg-ph-muted" }),
4275
- /* @__PURE__ */ jsx27("div", { className: "h-3 w-4/5 rounded bg-ph-muted" })
4640
+ /* @__PURE__ */ jsxs23("div", { className: "flex items-start gap-3", children: [
4641
+ /* @__PURE__ */ jsx28("div", { className: "h-8 w-8 shrink-0 rounded-md bg-ph-muted" }),
4642
+ /* @__PURE__ */ jsxs23("div", { className: "min-w-0 flex-1 space-y-2 pt-1", children: [
4643
+ /* @__PURE__ */ jsx28("div", { className: "h-4 w-3/5 rounded bg-ph-muted" }),
4644
+ /* @__PURE__ */ jsx28("div", { className: "h-3 w-full rounded bg-ph-muted" }),
4645
+ /* @__PURE__ */ jsx28("div", { className: "h-3 w-4/5 rounded bg-ph-muted" })
4276
4646
  ] })
4277
4647
  ] }),
4278
- /* @__PURE__ */ jsx27("div", { className: "mt-3 h-9 w-20 rounded bg-ph-muted" })
4648
+ /* @__PURE__ */ jsx28("div", { className: "mt-3 h-9 w-20 rounded bg-ph-muted" })
4279
4649
  ]
4280
4650
  }
4281
4651
  );
@@ -4365,7 +4735,7 @@ function SuiteIntegrationPicker({
4365
4735
  const [itemToDisconnect, setItemToDisconnect] = useState13(null);
4366
4736
  const [disconnecting, setDisconnecting] = useState13(false);
4367
4737
  const [disconnectError, setDisconnectError] = useState13(null);
4368
- const itemCategories = useMemo3(
4738
+ const itemCategories = useMemo4(
4369
4739
  () => Array.from(
4370
4740
  new Set(items.flatMap((item) => {
4371
4741
  var _a2;
@@ -4611,8 +4981,8 @@ function SuiteIntegrationPicker({
4611
4981
  observer.observe(sentinel);
4612
4982
  return () => observer.disconnect();
4613
4983
  }, [catalogLoading, hasMore, loading, loadingMore, onEndReached, open]);
4614
- return /* @__PURE__ */ jsxs22(Fragment8, { children: [
4615
- /* @__PURE__ */ jsx27(
4984
+ return /* @__PURE__ */ jsxs23(Fragment8, { children: [
4985
+ /* @__PURE__ */ jsx28(
4616
4986
  Modal,
4617
4987
  {
4618
4988
  open,
@@ -4622,15 +4992,15 @@ function SuiteIntegrationPicker({
4622
4992
  size: "xl",
4623
4993
  dataTest,
4624
4994
  bodyClassName: "!overflow-hidden",
4625
- children: /* @__PURE__ */ jsxs22("div", { className: "space-y-4", children: [
4626
- connectionError ? /* @__PURE__ */ jsx27("p", { className: "text-sm text-ph-danger", role: "alert", children: connectionError }) : null,
4627
- /* @__PURE__ */ jsxs22(
4995
+ children: /* @__PURE__ */ jsxs23("div", { className: "space-y-4", children: [
4996
+ connectionError ? /* @__PURE__ */ jsx28("p", { className: "text-sm text-ph-danger", role: "alert", children: connectionError }) : null,
4997
+ /* @__PURE__ */ jsxs23(
4628
4998
  "label",
4629
4999
  {
4630
5000
  className: "inline-flex w-fit cursor-pointer items-center gap-2 text-sm text-ph-ink",
4631
5001
  "data-test": `${dataTest}-bridge-only`,
4632
5002
  children: [
4633
- /* @__PURE__ */ jsx27(
5003
+ /* @__PURE__ */ jsx28(
4634
5004
  "input",
4635
5005
  {
4636
5006
  type: "checkbox",
@@ -4641,27 +5011,27 @@ function SuiteIntegrationPicker({
4641
5011
  "aria-label": "Shelly Bridge only"
4642
5012
  }
4643
5013
  ),
4644
- /* @__PURE__ */ jsx27(
5014
+ /* @__PURE__ */ jsx28(
4645
5015
  Bridge3d,
4646
5016
  {
4647
5017
  className: "h-4 w-4 shrink-0 text-ph-subtle",
4648
5018
  "aria-hidden": true
4649
5019
  }
4650
5020
  ),
4651
- /* @__PURE__ */ jsx27("span", { children: "Shelly Bridge only" })
5021
+ /* @__PURE__ */ jsx28("span", { children: "Shelly Bridge only" })
4652
5022
  ]
4653
5023
  }
4654
5024
  ),
4655
- /* @__PURE__ */ jsxs22("div", { className: "grid gap-4 md:grid-cols-2", children: [
4656
- /* @__PURE__ */ jsxs22("div", { className: "relative", children: [
4657
- /* @__PURE__ */ jsx27(
5025
+ /* @__PURE__ */ jsxs23("div", { className: "grid gap-4 md:grid-cols-2", children: [
5026
+ /* @__PURE__ */ jsxs23("div", { className: "relative", children: [
5027
+ /* @__PURE__ */ jsx28(
4658
5028
  Search,
4659
5029
  {
4660
5030
  className: "pointer-events-none absolute left-3 top-1/2 z-10 h-4 w-4 -translate-y-1/2 text-ph-subtle",
4661
5031
  "aria-hidden": true
4662
5032
  }
4663
5033
  ),
4664
- /* @__PURE__ */ jsx27(
5034
+ /* @__PURE__ */ jsx28(
4665
5035
  Input,
4666
5036
  {
4667
5037
  value: activeSearch,
@@ -4675,8 +5045,8 @@ function SuiteIntegrationPicker({
4675
5045
  }
4676
5046
  )
4677
5047
  ] }),
4678
- /* @__PURE__ */ jsxs22("div", { ref: categoryMenuRef, className: "relative", children: [
4679
- /* @__PURE__ */ jsxs22(
5048
+ /* @__PURE__ */ jsxs23("div", { ref: categoryMenuRef, className: "relative", children: [
5049
+ /* @__PURE__ */ jsxs23(
4680
5050
  "button",
4681
5051
  {
4682
5052
  ref: categoryTriggerRef,
@@ -4693,17 +5063,17 @@ function SuiteIntegrationPicker({
4693
5063
  },
4694
5064
  onKeyDown: handleCategoryTriggerKeyDown,
4695
5065
  children: [
4696
- /* @__PURE__ */ jsxs22("span", { className: "flex items-center gap-2", children: [
4697
- /* @__PURE__ */ jsx27(
5066
+ /* @__PURE__ */ jsxs23("span", { className: "flex items-center gap-2", children: [
5067
+ /* @__PURE__ */ jsx28(
4698
5068
  Filter,
4699
5069
  {
4700
5070
  className: "h-4 w-4 shrink-0 text-ph-subtle",
4701
5071
  "aria-hidden": true
4702
5072
  }
4703
5073
  ),
4704
- /* @__PURE__ */ jsx27("span", { children: activeCategory === "all" ? "All apps" : categoryLabel(activeCategory) })
5074
+ /* @__PURE__ */ jsx28("span", { children: activeCategory === "all" ? "All apps" : categoryLabel(activeCategory) })
4705
5075
  ] }),
4706
- /* @__PURE__ */ jsx27(
5076
+ /* @__PURE__ */ jsx28(
4707
5077
  NavArrowDown2,
4708
5078
  {
4709
5079
  className: `h-4 w-4 transition-transform ${categoryMenuOpen ? "rotate-180" : ""}`,
@@ -4713,12 +5083,12 @@ function SuiteIntegrationPicker({
4713
5083
  ]
4714
5084
  }
4715
5085
  ),
4716
- categoryMenuOpen ? /* @__PURE__ */ jsxs22(
5086
+ categoryMenuOpen ? /* @__PURE__ */ jsxs23(
4717
5087
  "div",
4718
5088
  {
4719
5089
  className: "absolute z-20 mt-2 max-h-[min(22rem,calc(100dvh-12rem))] w-full max-w-full overflow-hidden rounded-[var(--ph-radius-overlay)] border border-[var(--ph-border-control)] bg-[var(--ph-surface-overlay)] p-2 shadow-[var(--ph-shadow-floating)]",
4720
5090
  children: [
4721
- /* @__PURE__ */ jsx27(
5091
+ /* @__PURE__ */ jsx28(
4722
5092
  Input,
4723
5093
  {
4724
5094
  ref: categorySearchRef,
@@ -4738,7 +5108,7 @@ function SuiteIntegrationPicker({
4738
5108
  }
4739
5109
  }
4740
5110
  ),
4741
- /* @__PURE__ */ jsx27(
5111
+ /* @__PURE__ */ jsx28(
4742
5112
  "div",
4743
5113
  {
4744
5114
  id: `${dataTest}-category-options`,
@@ -4746,7 +5116,7 @@ function SuiteIntegrationPicker({
4746
5116
  "aria-label": "Integration categories",
4747
5117
  className: "mt-2 max-h-52 overflow-y-auto",
4748
5118
  "data-test": "integration-category-options",
4749
- children: categoryValues.map((value) => /* @__PURE__ */ jsx27(
5119
+ children: categoryValues.map((value) => /* @__PURE__ */ jsx28(
4750
5120
  "button",
4751
5121
  {
4752
5122
  type: "button",
@@ -4778,20 +5148,20 @@ function SuiteIntegrationPicker({
4778
5148
  ) : null
4779
5149
  ] })
4780
5150
  ] }),
4781
- /* @__PURE__ */ jsxs22(
5151
+ /* @__PURE__ */ jsxs23(
4782
5152
  "div",
4783
5153
  {
4784
5154
  ref: scrollViewportRef,
4785
5155
  className: "min-h-0 max-h-[min(60vh,32rem)] w-full overflow-y-auto pr-1",
4786
5156
  children: [
4787
- loading || catalogLoading ? /* @__PURE__ */ jsx27(
5157
+ loading || catalogLoading ? /* @__PURE__ */ jsx28(
4788
5158
  "div",
4789
5159
  {
4790
5160
  className: "grid gap-3 sm:grid-cols-2 lg:grid-cols-3",
4791
5161
  "aria-label": "Loading apps",
4792
- children: Array.from({ length: SKELETON_COUNT }, (_, index) => /* @__PURE__ */ jsx27(IntegrationSkeletonCard, {}, index))
5162
+ children: Array.from({ length: SKELETON_COUNT }, (_, index) => /* @__PURE__ */ jsx28(IntegrationSkeletonCard, {}, index))
4793
5163
  }
4794
- ) : /* @__PURE__ */ jsxs22("div", { className: "grid gap-3 sm:grid-cols-2 lg:grid-cols-3", children: [
5164
+ ) : /* @__PURE__ */ jsxs23("div", { className: "grid gap-3 sm:grid-cols-2 lg:grid-cols-3", children: [
4795
5165
  filtered.map((item) => {
4796
5166
  var _a2, _b;
4797
5167
  const isExpanded = expanded === item.id;
@@ -4799,33 +5169,33 @@ function SuiteIntegrationPicker({
4799
5169
  const bridgeApps = suiteAppsForIntegration(item);
4800
5170
  const schemes = authSchemesFor(item);
4801
5171
  const text = isExpanded || !longDescription ? item.description : `${item.description.slice(0, DESCRIPTION_LIMIT).trimEnd()}...`;
4802
- return /* @__PURE__ */ jsxs22(
5172
+ return /* @__PURE__ */ jsxs23(
4803
5173
  "div",
4804
5174
  {
4805
5175
  className: "flex min-h-36 min-w-0 flex-col justify-between rounded-[var(--ph-radius-surface)] border border-ph-border bg-ph-surface p-4",
4806
5176
  children: [
4807
- /* @__PURE__ */ jsx27(
5177
+ /* @__PURE__ */ jsx28(
4808
5178
  "button",
4809
5179
  {
4810
5180
  type: "button",
4811
5181
  className: "min-w-0 text-left",
4812
5182
  onClick: () => longDescription && setExpanded(isExpanded ? null : item.id),
4813
5183
  "aria-expanded": longDescription ? isExpanded : void 0,
4814
- children: /* @__PURE__ */ jsxs22("span", { className: "flex items-start gap-3", children: [
4815
- /* @__PURE__ */ jsx27("span", { className: "flex h-8 w-8 shrink-0 items-center justify-center rounded-md bg-ph-muted text-ph-ink", children: (_a2 = item.icon) != null ? _a2 : /* @__PURE__ */ jsx27(Plug, { className: "h-4 w-4", "aria-hidden": true }) }),
4816
- /* @__PURE__ */ jsxs22("span", { className: "min-w-0", children: [
4817
- /* @__PURE__ */ jsx27("span", { className: "block truncate font-medium text-ph-ink", children: item.label }),
4818
- /* @__PURE__ */ jsx27("span", { className: "mt-1 block text-xs text-ph-subtle", children: text }),
4819
- longDescription ? /* @__PURE__ */ jsxs22("span", { className: "mt-1 block text-xs font-medium text-ph-brand", children: [
5184
+ children: /* @__PURE__ */ jsxs23("span", { className: "flex items-start gap-3", children: [
5185
+ /* @__PURE__ */ jsx28("span", { className: "flex h-8 w-8 shrink-0 items-center justify-center rounded-md bg-ph-muted text-ph-ink", children: (_a2 = item.icon) != null ? _a2 : /* @__PURE__ */ jsx28(Plug, { className: "h-4 w-4", "aria-hidden": true }) }),
5186
+ /* @__PURE__ */ jsxs23("span", { className: "min-w-0", children: [
5187
+ /* @__PURE__ */ jsx28("span", { className: "block truncate font-medium text-ph-ink", children: item.label }),
5188
+ /* @__PURE__ */ jsx28("span", { className: "mt-1 block text-xs text-ph-subtle", children: text }),
5189
+ longDescription ? /* @__PURE__ */ jsxs23("span", { className: "mt-1 block text-xs font-medium text-ph-brand", children: [
4820
5190
  isExpanded ? "See less" : "See more",
4821
5191
  " ",
4822
- isExpanded ? /* @__PURE__ */ jsx27(NavArrowUp, { className: "inline h-3 w-3" }) : /* @__PURE__ */ jsx27(NavArrowDown2, { className: "inline h-3 w-3" })
5192
+ isExpanded ? /* @__PURE__ */ jsx28(NavArrowUp, { className: "inline h-3 w-3" }) : /* @__PURE__ */ jsx28(NavArrowDown2, { className: "inline h-3 w-3" })
4823
5193
  ] }) : null
4824
5194
  ] })
4825
5195
  ] })
4826
5196
  }
4827
5197
  ),
4828
- bridgeApps.length > 0 ? /* @__PURE__ */ jsx27(
5198
+ bridgeApps.length > 0 ? /* @__PURE__ */ jsx28(
4829
5199
  "div",
4830
5200
  {
4831
5201
  className: "mt-3 flex flex-wrap items-center gap-1.5",
@@ -4833,7 +5203,7 @@ function SuiteIntegrationPicker({
4833
5203
  children: bridgeApps.map((app) => {
4834
5204
  const mark = BRIDGE_MARK[app];
4835
5205
  if (!mark) return null;
4836
- return /* @__PURE__ */ jsx27(
5206
+ return /* @__PURE__ */ jsx28(
4837
5207
  "img",
4838
5208
  {
4839
5209
  src: mark.src,
@@ -4847,12 +5217,12 @@ function SuiteIntegrationPicker({
4847
5217
  })
4848
5218
  }
4849
5219
  ) : null,
4850
- schemes.length > 0 ? /* @__PURE__ */ jsx27(
5220
+ schemes.length > 0 ? /* @__PURE__ */ jsx28(
4851
5221
  "div",
4852
5222
  {
4853
5223
  className: "mt-3 flex flex-wrap gap-1.5",
4854
5224
  "aria-label": "Connection methods",
4855
- children: schemes.map((scheme) => /* @__PURE__ */ jsx27(
5225
+ children: schemes.map((scheme) => /* @__PURE__ */ jsx28(
4856
5226
  "span",
4857
5227
  {
4858
5228
  className: "rounded-full border border-ph-border bg-ph-muted px-2 py-1 text-[0.6875rem] font-medium text-ph-subtle",
@@ -4863,7 +5233,7 @@ function SuiteIntegrationPicker({
4863
5233
  ))
4864
5234
  }
4865
5235
  ) : null,
4866
- /* @__PURE__ */ jsx27(
5236
+ /* @__PURE__ */ jsx28(
4867
5237
  Button,
4868
5238
  {
4869
5239
  type: "button",
@@ -4871,8 +5241,8 @@ function SuiteIntegrationPicker({
4871
5241
  className: "mt-3 self-start",
4872
5242
  disabled: Boolean(item.unavailableReason) || item.connecting,
4873
5243
  onClick: () => connectItem(item),
4874
- children: /* @__PURE__ */ jsxs22("span", { className: "flex items-center gap-1.5", children: [
4875
- /* @__PURE__ */ jsx27(Plug, { className: "h-3.5 w-3.5", "aria-hidden": true }),
5244
+ children: /* @__PURE__ */ jsxs23("span", { className: "flex items-center gap-1.5", children: [
5245
+ /* @__PURE__ */ jsx28(Plug, { className: "h-3.5 w-3.5", "aria-hidden": true }),
4876
5246
  item.connecting ? "Connecting..." : (_b = item.unavailableReason) != null ? _b : "Connect"
4877
5247
  ] })
4878
5248
  }
@@ -4882,31 +5252,31 @@ function SuiteIntegrationPicker({
4882
5252
  item.id
4883
5253
  );
4884
5254
  }),
4885
- loadingMore ? Array.from({ length: 3 }, (_, index) => /* @__PURE__ */ jsx27(IntegrationSkeletonCard, {}, `loading-${index}`)) : null
5255
+ loadingMore ? Array.from({ length: 3 }, (_, index) => /* @__PURE__ */ jsx28(IntegrationSkeletonCard, {}, `loading-${index}`)) : null
4886
5256
  ] }),
4887
- /* @__PURE__ */ jsx27("div", { ref: loadMoreSentinelRef, className: "h-1", "aria-hidden": "true" })
5257
+ /* @__PURE__ */ jsx28("div", { ref: loadMoreSentinelRef, className: "h-1", "aria-hidden": "true" })
4888
5258
  ]
4889
5259
  }
4890
5260
  ),
4891
- connectedItems.length > 0 && onDisconnect ? /* @__PURE__ */ jsxs22("div", { className: "space-y-2 border-t border-ph-border pt-4", children: [
4892
- /* @__PURE__ */ jsx27("h3", { className: "font-medium text-ph-ink", children: "Connected apps" }),
4893
- connectedItems.map((item) => /* @__PURE__ */ jsxs22(
5261
+ connectedItems.length > 0 && onDisconnect ? /* @__PURE__ */ jsxs23("div", { className: "space-y-2 border-t border-ph-border pt-4", children: [
5262
+ /* @__PURE__ */ jsx28("h3", { className: "font-medium text-ph-ink", children: "Connected apps" }),
5263
+ connectedItems.map((item) => /* @__PURE__ */ jsxs23(
4894
5264
  "div",
4895
5265
  {
4896
5266
  className: "flex items-center justify-between gap-3 rounded-[var(--ph-radius-surface)] border border-ph-border bg-[var(--ph-surface-inset)] p-3",
4897
5267
  children: [
4898
- /* @__PURE__ */ jsxs22("span", { className: "flex min-w-0 items-center gap-2 text-sm text-ph-ink", children: [
5268
+ /* @__PURE__ */ jsxs23("span", { className: "flex min-w-0 items-center gap-2 text-sm text-ph-ink", children: [
4899
5269
  item.icon,
4900
- /* @__PURE__ */ jsx27("span", { className: "truncate", children: item.label })
5270
+ /* @__PURE__ */ jsx28("span", { className: "truncate", children: item.label })
4901
5271
  ] }),
4902
- /* @__PURE__ */ jsx27(
5272
+ /* @__PURE__ */ jsx28(
4903
5273
  Button,
4904
5274
  {
4905
5275
  type: "button",
4906
5276
  variant: "danger",
4907
5277
  onClick: () => requestDisconnect(item),
4908
- children: /* @__PURE__ */ jsxs22("span", { className: "flex items-center gap-1.5", children: [
4909
- /* @__PURE__ */ jsx27(Xmark, { className: "h-4 w-4", "aria-hidden": true }),
5278
+ children: /* @__PURE__ */ jsxs23("span", { className: "flex items-center gap-1.5", children: [
5279
+ /* @__PURE__ */ jsx28(Xmark, { className: "h-4 w-4", "aria-hidden": true }),
4910
5280
  "Disconnect"
4911
5281
  ] })
4912
5282
  }
@@ -4919,7 +5289,7 @@ function SuiteIntegrationPicker({
4919
5289
  ] })
4920
5290
  }
4921
5291
  ),
4922
- /* @__PURE__ */ jsxs22(
5292
+ /* @__PURE__ */ jsxs23(
4923
5293
  Modal,
4924
5294
  {
4925
5295
  open: itemToDisconnect !== null,
@@ -4931,8 +5301,8 @@ function SuiteIntegrationPicker({
4931
5301
  size: "sm",
4932
5302
  zIndex: 220,
4933
5303
  dataTest: `${dataTest}-disconnect-confirmation`,
4934
- footer: /* @__PURE__ */ jsxs22("div", { className: "flex justify-end gap-2", children: [
4935
- /* @__PURE__ */ jsx27(
5304
+ footer: /* @__PURE__ */ jsxs23("div", { className: "flex justify-end gap-2", children: [
5305
+ /* @__PURE__ */ jsx28(
4936
5306
  Button,
4937
5307
  {
4938
5308
  type: "button",
@@ -4942,7 +5312,7 @@ function SuiteIntegrationPicker({
4942
5312
  children: "Cancel"
4943
5313
  }
4944
5314
  ),
4945
- /* @__PURE__ */ jsx27(
5315
+ /* @__PURE__ */ jsx28(
4946
5316
  Button,
4947
5317
  {
4948
5318
  type: "button",
@@ -4955,8 +5325,8 @@ function SuiteIntegrationPicker({
4955
5325
  )
4956
5326
  ] }),
4957
5327
  children: [
4958
- disconnectError ? /* @__PURE__ */ jsx27("p", { className: "text-sm text-ph-danger", role: "alert", children: disconnectError }) : null,
4959
- /* @__PURE__ */ jsxs22("p", { className: "text-sm text-ph-ink", children: [
5328
+ disconnectError ? /* @__PURE__ */ jsx28("p", { className: "text-sm text-ph-danger", role: "alert", children: disconnectError }) : null,
5329
+ /* @__PURE__ */ jsxs23("p", { className: "text-sm text-ph-ink", children: [
4960
5330
  "Disconnect ",
4961
5331
  itemToDisconnect == null ? void 0 : itemToDisconnect.label,
4962
5332
  "? You can reconnect it later."
@@ -4964,7 +5334,7 @@ function SuiteIntegrationPicker({
4964
5334
  ]
4965
5335
  }
4966
5336
  ),
4967
- /* @__PURE__ */ jsx27(
5337
+ /* @__PURE__ */ jsx28(
4968
5338
  Modal,
4969
5339
  {
4970
5340
  open: Boolean(methodItem),
@@ -4974,7 +5344,7 @@ function SuiteIntegrationPicker({
4974
5344
  size: "sm",
4975
5345
  zIndex: 200,
4976
5346
  dataTest: `${dataTest}-auth-method`,
4977
- children: methodItem ? /* @__PURE__ */ jsx27("div", { className: "space-y-2", children: authSchemesFor(methodItem).map((scheme) => /* @__PURE__ */ jsxs22(
5347
+ children: methodItem ? /* @__PURE__ */ jsx28("div", { className: "space-y-2", children: authSchemesFor(methodItem).map((scheme) => /* @__PURE__ */ jsxs23(
4978
5348
  "button",
4979
5349
  {
4980
5350
  type: "button",
@@ -4982,15 +5352,15 @@ function SuiteIntegrationPicker({
4982
5352
  onClick: () => void prepareConnection(methodItem, scheme),
4983
5353
  "data-test": `${dataTest}-choose-${scheme.toLowerCase()}`,
4984
5354
  children: [
4985
- /* @__PURE__ */ jsx27("span", { className: "font-medium", children: authSchemeLabel(scheme) }),
4986
- /* @__PURE__ */ jsx27("span", { className: "text-xs text-ph-subtle", children: "Select" })
5355
+ /* @__PURE__ */ jsx28("span", { className: "font-medium", children: authSchemeLabel(scheme) }),
5356
+ /* @__PURE__ */ jsx28("span", { className: "text-xs text-ph-subtle", children: "Select" })
4987
5357
  ]
4988
5358
  },
4989
5359
  scheme
4990
5360
  )) }) : null
4991
5361
  }
4992
5362
  ),
4993
- /* @__PURE__ */ jsx27(
5363
+ /* @__PURE__ */ jsx28(
4994
5364
  Modal,
4995
5365
  {
4996
5366
  open: Boolean(authItem),
@@ -5000,14 +5370,14 @@ function SuiteIntegrationPicker({
5000
5370
  size: "md",
5001
5371
  zIndex: 210,
5002
5372
  dataTest: `${dataTest}-auth-form`,
5003
- children: authLoading ? /* @__PURE__ */ jsx27("p", { className: "text-sm text-ph-subtle", children: "Loading authentication fields..." }) : authItem ? /* @__PURE__ */ jsxs22(
5373
+ children: authLoading ? /* @__PURE__ */ jsx28("p", { className: "text-sm text-ph-subtle", children: "Loading authentication fields..." }) : authItem ? /* @__PURE__ */ jsxs23(
5004
5374
  "form",
5005
5375
  {
5006
5376
  className: "space-y-4",
5007
5377
  onSubmit: (event) => void submitAuthForm(event),
5008
5378
  children: [
5009
- authError ? /* @__PURE__ */ jsx27("p", { className: "text-sm text-ph-danger", role: "alert", children: authError }) : null,
5010
- authItem.fields.length === 0 && authError ? /* @__PURE__ */ jsx27(
5379
+ authError ? /* @__PURE__ */ jsx28("p", { className: "text-sm text-ph-danger", role: "alert", children: authError }) : null,
5380
+ authItem.fields.length === 0 && authError ? /* @__PURE__ */ jsx28(
5011
5381
  Button,
5012
5382
  {
5013
5383
  type: "button",
@@ -5018,7 +5388,7 @@ function SuiteIntegrationPicker({
5018
5388
  ) : null,
5019
5389
  authItem.fields.map((field) => {
5020
5390
  var _a2, _b;
5021
- return /* @__PURE__ */ jsx27(
5391
+ return /* @__PURE__ */ jsx28(
5022
5392
  Input,
5023
5393
  {
5024
5394
  label: field.label,
@@ -5034,8 +5404,8 @@ function SuiteIntegrationPicker({
5034
5404
  field.name
5035
5405
  );
5036
5406
  }),
5037
- /* @__PURE__ */ jsxs22("div", { className: "flex justify-end gap-2 border-t border-ph-border pt-4", children: [
5038
- /* @__PURE__ */ jsx27(
5407
+ /* @__PURE__ */ jsxs23("div", { className: "flex justify-end gap-2 border-t border-ph-border pt-4", children: [
5408
+ /* @__PURE__ */ jsx28(
5039
5409
  Button,
5040
5410
  {
5041
5411
  type: "button",
@@ -5045,7 +5415,7 @@ function SuiteIntegrationPicker({
5045
5415
  children: "Cancel"
5046
5416
  }
5047
5417
  ),
5048
- /* @__PURE__ */ jsx27(Button, { type: "submit", variant: "primary", disabled: authSubmitting, children: authSubmitting ? "Connecting..." : "Connect" })
5418
+ /* @__PURE__ */ jsx28(Button, { type: "submit", variant: "primary", disabled: authSubmitting, children: authSubmitting ? "Connecting..." : "Connect" })
5049
5419
  ] })
5050
5420
  ]
5051
5421
  }
@@ -5058,7 +5428,7 @@ function SuiteIntegrationPicker({
5058
5428
  // src/suite/components/suite-integration-rules.tsx
5059
5429
  import { useState as useState14 } from "react";
5060
5430
  import { Plus, Xmark as Xmark2 } from "iconoir-react";
5061
- import { jsx as jsx28, jsxs as jsxs23 } from "react/jsx-runtime";
5431
+ import { jsx as jsx29, jsxs as jsxs24 } from "react/jsx-runtime";
5062
5432
  var ACTION_LABELS = {
5063
5433
  create_tides_task: "Create a Tides task",
5064
5434
  draft_time_entry: "Draft a time entry",
@@ -5164,20 +5534,20 @@ function SuiteIntegrationRules({
5164
5534
  setBusyId(null);
5165
5535
  }
5166
5536
  }
5167
- return /* @__PURE__ */ jsxs23("section", { className: "space-y-4", "data-test": dataTest, children: [
5168
- /* @__PURE__ */ jsxs23(
5537
+ return /* @__PURE__ */ jsxs24("section", { className: "space-y-4", "data-test": dataTest, children: [
5538
+ /* @__PURE__ */ jsxs24(
5169
5539
  Card,
5170
5540
  {
5171
5541
  variant: "outlined",
5172
5542
  bodyClassName: "p-5",
5173
5543
  "data-test": `${dataTest}-card`,
5174
5544
  children: [
5175
- /* @__PURE__ */ jsxs23("div", { className: "flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between", children: [
5176
- /* @__PURE__ */ jsxs23("div", { children: [
5177
- /* @__PURE__ */ jsx28("h3", { className: "font-medium text-ph-ink", children: "Automation rules" }),
5178
- /* @__PURE__ */ jsx28("p", { className: "mt-1 text-sm text-ph-subtle", children: "Turn incoming integration events into tasks, time entries, or notifications for this workspace." })
5545
+ /* @__PURE__ */ jsxs24("div", { className: "flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between", children: [
5546
+ /* @__PURE__ */ jsxs24("div", { children: [
5547
+ /* @__PURE__ */ jsx29("h3", { className: "font-medium text-ph-ink", children: "Automation rules" }),
5548
+ /* @__PURE__ */ jsx29("p", { className: "mt-1 text-sm text-ph-subtle", children: "Turn incoming integration events into tasks, time entries, or notifications for this workspace." })
5179
5549
  ] }),
5180
- canManage && onCreate ? /* @__PURE__ */ jsx28(
5550
+ canManage && onCreate ? /* @__PURE__ */ jsx29(
5181
5551
  Button,
5182
5552
  {
5183
5553
  type: "button",
@@ -5185,14 +5555,14 @@ function SuiteIntegrationRules({
5185
5555
  size: "sm",
5186
5556
  onClick: () => setFormOpen((open) => !open),
5187
5557
  "data-test": `${dataTest}-new`,
5188
- children: /* @__PURE__ */ jsxs23("span", { className: "flex items-center gap-1.5", children: [
5189
- /* @__PURE__ */ jsx28(Plus, { className: "h-4 w-4", "aria-hidden": true }),
5558
+ children: /* @__PURE__ */ jsxs24("span", { className: "flex items-center gap-1.5", children: [
5559
+ /* @__PURE__ */ jsx29(Plus, { className: "h-4 w-4", "aria-hidden": true }),
5190
5560
  "New rule"
5191
5561
  ] })
5192
5562
  }
5193
5563
  ) : null
5194
5564
  ] }),
5195
- error ? /* @__PURE__ */ jsx28(
5565
+ error ? /* @__PURE__ */ jsx29(
5196
5566
  Alert,
5197
5567
  {
5198
5568
  status: "danger",
@@ -5200,36 +5570,36 @@ function SuiteIntegrationRules({
5200
5570
  description: error
5201
5571
  }
5202
5572
  ) : null,
5203
- loading ? /* @__PURE__ */ jsx28("p", { className: "mt-4 text-sm text-ph-subtle", children: "Loading rules..." }) : rules.length === 0 ? /* @__PURE__ */ jsx28(
5573
+ loading ? /* @__PURE__ */ jsx29("p", { className: "mt-4 text-sm text-ph-subtle", children: "Loading rules..." }) : rules.length === 0 ? /* @__PURE__ */ jsx29(
5204
5574
  "div",
5205
5575
  {
5206
5576
  className: "mt-4 rounded-[var(--ph-radius-surface)] border border-dashed border-ph-border bg-[var(--ph-surface-inset)] px-4 py-6 text-center",
5207
5577
  "data-test": `${dataTest}-empty`,
5208
- children: /* @__PURE__ */ jsxs23("p", { className: "text-sm text-ph-subtle", children: [
5578
+ children: /* @__PURE__ */ jsxs24("p", { className: "text-sm text-ph-subtle", children: [
5209
5579
  "No automation rules yet.",
5210
5580
  canManage ? " Create one to get started." : ""
5211
5581
  ] })
5212
5582
  }
5213
- ) : /* @__PURE__ */ jsx28("ul", { className: "mt-4 space-y-2", "data-test": `${dataTest}-list`, children: rules.map((rule) => /* @__PURE__ */ jsxs23(
5583
+ ) : /* @__PURE__ */ jsx29("ul", { className: "mt-4 space-y-2", "data-test": `${dataTest}-list`, children: rules.map((rule) => /* @__PURE__ */ jsxs24(
5214
5584
  "li",
5215
5585
  {
5216
5586
  className: "flex items-center justify-between gap-3 rounded-[var(--ph-radius-surface)] border border-ph-border bg-[var(--ph-surface-inset)] px-3 py-3",
5217
5587
  "data-test": `${dataTest}-rule-${rule.id}`,
5218
5588
  children: [
5219
- /* @__PURE__ */ jsxs23("div", { className: "min-w-0", children: [
5220
- /* @__PURE__ */ jsx28("p", { className: "truncate text-sm font-medium text-ph-ink", children: rule.name }),
5221
- /* @__PURE__ */ jsxs23("p", { className: "mt-0.5 truncate text-xs text-ph-subtle", children: [
5589
+ /* @__PURE__ */ jsxs24("div", { className: "min-w-0", children: [
5590
+ /* @__PURE__ */ jsx29("p", { className: "truncate text-sm font-medium text-ph-ink", children: rule.name }),
5591
+ /* @__PURE__ */ jsxs24("p", { className: "mt-0.5 truncate text-xs text-ph-subtle", children: [
5222
5592
  rule.trigger_event_type,
5223
5593
  " \u2192 ",
5224
5594
  actionLabel(rule.action_type)
5225
5595
  ] }),
5226
- /* @__PURE__ */ jsxs23("p", { className: "mt-0.5 truncate text-xs text-ph-subtle", children: [
5596
+ /* @__PURE__ */ jsxs24("p", { className: "mt-0.5 truncate text-xs text-ph-subtle", children: [
5227
5597
  "Last fired: ",
5228
5598
  formatDateTime(rule.last_fired_at)
5229
5599
  ] })
5230
5600
  ] }),
5231
- canManage ? /* @__PURE__ */ jsxs23("div", { className: "flex shrink-0 items-center gap-2", children: [
5232
- /* @__PURE__ */ jsx28(
5601
+ canManage ? /* @__PURE__ */ jsxs24("div", { className: "flex shrink-0 items-center gap-2", children: [
5602
+ /* @__PURE__ */ jsx29(
5233
5603
  Toggle,
5234
5604
  {
5235
5605
  checked: rule.enabled,
@@ -5238,7 +5608,7 @@ function SuiteIntegrationRules({
5238
5608
  "aria-label": `Enable ${rule.name}`
5239
5609
  }
5240
5610
  ),
5241
- /* @__PURE__ */ jsx28(
5611
+ /* @__PURE__ */ jsx29(
5242
5612
  Button,
5243
5613
  {
5244
5614
  type: "button",
@@ -5247,10 +5617,10 @@ function SuiteIntegrationRules({
5247
5617
  disabled: busyId === rule.id,
5248
5618
  onClick: () => requestDelete(rule),
5249
5619
  "aria-label": `Delete ${rule.name}`,
5250
- children: /* @__PURE__ */ jsx28(Xmark2, { className: "h-4 w-4", "aria-hidden": true })
5620
+ children: /* @__PURE__ */ jsx29(Xmark2, { className: "h-4 w-4", "aria-hidden": true })
5251
5621
  }
5252
5622
  )
5253
- ] }) : /* @__PURE__ */ jsx28(
5623
+ ] }) : /* @__PURE__ */ jsx29(
5254
5624
  Badge,
5255
5625
  {
5256
5626
  variant: rule.enabled ? "success" : "neutral",
@@ -5262,15 +5632,15 @@ function SuiteIntegrationRules({
5262
5632
  },
5263
5633
  rule.id
5264
5634
  )) }),
5265
- canManage && formOpen && onCreate ? /* @__PURE__ */ jsxs23(
5635
+ canManage && formOpen && onCreate ? /* @__PURE__ */ jsxs24(
5266
5636
  "form",
5267
5637
  {
5268
5638
  className: "mt-4 space-y-3 rounded-[var(--ph-radius-surface)] border border-ph-border bg-ph-surface p-4",
5269
5639
  onSubmit: (event) => void submitForm(event),
5270
5640
  "data-test": `${dataTest}-form`,
5271
5641
  children: [
5272
- formError ? /* @__PURE__ */ jsx28("p", { className: "text-sm text-ph-danger", role: "alert", children: formError }) : null,
5273
- /* @__PURE__ */ jsx28(
5642
+ formError ? /* @__PURE__ */ jsx29("p", { className: "text-sm text-ph-danger", role: "alert", children: formError }) : null,
5643
+ /* @__PURE__ */ jsx29(
5274
5644
  Input,
5275
5645
  {
5276
5646
  label: "Rule name",
@@ -5281,7 +5651,7 @@ function SuiteIntegrationRules({
5281
5651
  "data-test": `${dataTest}-name`
5282
5652
  }
5283
5653
  ),
5284
- /* @__PURE__ */ jsx28(
5654
+ /* @__PURE__ */ jsx29(
5285
5655
  Input,
5286
5656
  {
5287
5657
  label: "Trigger event type",
@@ -5293,7 +5663,7 @@ function SuiteIntegrationRules({
5293
5663
  "data-test": `${dataTest}-trigger`
5294
5664
  }
5295
5665
  ),
5296
- /* @__PURE__ */ jsx28(
5666
+ /* @__PURE__ */ jsx29(
5297
5667
  Select,
5298
5668
  {
5299
5669
  label: "Action",
@@ -5302,10 +5672,10 @@ function SuiteIntegrationRules({
5302
5672
  event.target.value
5303
5673
  ),
5304
5674
  "data-test": `${dataTest}-action`,
5305
- children: Object.entries(ACTION_LABELS).map(([value, label]) => /* @__PURE__ */ jsx28("option", { value, children: label }, value))
5675
+ children: Object.entries(ACTION_LABELS).map(([value, label]) => /* @__PURE__ */ jsx29("option", { value, children: label }, value))
5306
5676
  }
5307
5677
  ),
5308
- needsProject ? /* @__PURE__ */ jsxs23(
5678
+ needsProject ? /* @__PURE__ */ jsxs24(
5309
5679
  Select,
5310
5680
  {
5311
5681
  label: "Project",
@@ -5313,12 +5683,12 @@ function SuiteIntegrationRules({
5313
5683
  onChange: (event) => setProjectId(event.target.value),
5314
5684
  "data-test": `${dataTest}-project`,
5315
5685
  children: [
5316
- /* @__PURE__ */ jsx28("option", { value: "", children: "Choose a project..." }),
5317
- projects.map((project) => /* @__PURE__ */ jsx28("option", { value: project.id, children: project.name }, project.id))
5686
+ /* @__PURE__ */ jsx29("option", { value: "", children: "Choose a project..." }),
5687
+ projects.map((project) => /* @__PURE__ */ jsx29("option", { value: project.id, children: project.name }, project.id))
5318
5688
  ]
5319
5689
  }
5320
5690
  ) : null,
5321
- actionType === "draft_time_entry" ? /* @__PURE__ */ jsx28(
5691
+ actionType === "draft_time_entry" ? /* @__PURE__ */ jsx29(
5322
5692
  Input,
5323
5693
  {
5324
5694
  label: "Minutes (optional)",
@@ -5329,7 +5699,7 @@ function SuiteIntegrationRules({
5329
5699
  "data-test": `${dataTest}-minutes`
5330
5700
  }
5331
5701
  ) : null,
5332
- actionType === "create_tides_task" ? /* @__PURE__ */ jsxs23(
5702
+ actionType === "create_tides_task" ? /* @__PURE__ */ jsxs24(
5333
5703
  Select,
5334
5704
  {
5335
5705
  label: "Priority",
@@ -5337,15 +5707,15 @@ function SuiteIntegrationRules({
5337
5707
  onChange: (event) => setPriority(event.target.value),
5338
5708
  "data-test": `${dataTest}-priority`,
5339
5709
  children: [
5340
- /* @__PURE__ */ jsx28("option", { value: "low", children: "Low" }),
5341
- /* @__PURE__ */ jsx28("option", { value: "medium", children: "Medium" }),
5342
- /* @__PURE__ */ jsx28("option", { value: "high", children: "High" }),
5343
- /* @__PURE__ */ jsx28("option", { value: "urgent", children: "Urgent" })
5710
+ /* @__PURE__ */ jsx29("option", { value: "low", children: "Low" }),
5711
+ /* @__PURE__ */ jsx29("option", { value: "medium", children: "Medium" }),
5712
+ /* @__PURE__ */ jsx29("option", { value: "high", children: "High" }),
5713
+ /* @__PURE__ */ jsx29("option", { value: "urgent", children: "Urgent" })
5344
5714
  ]
5345
5715
  }
5346
5716
  ) : null,
5347
- /* @__PURE__ */ jsxs23("div", { className: "flex justify-end gap-2 border-t border-ph-border pt-3", children: [
5348
- /* @__PURE__ */ jsx28(
5717
+ /* @__PURE__ */ jsxs24("div", { className: "flex justify-end gap-2 border-t border-ph-border pt-3", children: [
5718
+ /* @__PURE__ */ jsx29(
5349
5719
  Button,
5350
5720
  {
5351
5721
  type: "button",
@@ -5355,7 +5725,7 @@ function SuiteIntegrationRules({
5355
5725
  children: "Cancel"
5356
5726
  }
5357
5727
  ),
5358
- /* @__PURE__ */ jsx28(Button, { type: "submit", variant: "primary", disabled: submitting, children: submitting ? "Creating..." : "Create rule" })
5728
+ /* @__PURE__ */ jsx29(Button, { type: "submit", variant: "primary", disabled: submitting, children: submitting ? "Creating..." : "Create rule" })
5359
5729
  ] })
5360
5730
  ]
5361
5731
  }
@@ -5363,7 +5733,7 @@ function SuiteIntegrationRules({
5363
5733
  ]
5364
5734
  }
5365
5735
  ),
5366
- /* @__PURE__ */ jsxs23(
5736
+ /* @__PURE__ */ jsxs24(
5367
5737
  Modal,
5368
5738
  {
5369
5739
  open: ruleToDelete !== null,
@@ -5373,8 +5743,8 @@ function SuiteIntegrationRules({
5373
5743
  title: "Delete automation rule",
5374
5744
  description: "This action cannot be undone.",
5375
5745
  dataTest: `${dataTest}-delete-confirmation`,
5376
- footer: /* @__PURE__ */ jsxs23("div", { className: "flex justify-end gap-2", children: [
5377
- /* @__PURE__ */ jsx28(
5746
+ footer: /* @__PURE__ */ jsxs24("div", { className: "flex justify-end gap-2", children: [
5747
+ /* @__PURE__ */ jsx29(
5378
5748
  Button,
5379
5749
  {
5380
5750
  type: "button",
@@ -5384,7 +5754,7 @@ function SuiteIntegrationRules({
5384
5754
  children: "Cancel"
5385
5755
  }
5386
5756
  ),
5387
- /* @__PURE__ */ jsx28(
5757
+ /* @__PURE__ */ jsx29(
5388
5758
  Button,
5389
5759
  {
5390
5760
  type: "button",
@@ -5397,8 +5767,8 @@ function SuiteIntegrationRules({
5397
5767
  )
5398
5768
  ] }),
5399
5769
  children: [
5400
- deleteError ? /* @__PURE__ */ jsx28("p", { className: "text-sm text-ph-danger", role: "alert", children: deleteError }) : null,
5401
- /* @__PURE__ */ jsxs23("p", { className: "text-sm text-ph-ink", children: [
5770
+ deleteError ? /* @__PURE__ */ jsx29("p", { className: "text-sm text-ph-danger", role: "alert", children: deleteError }) : null,
5771
+ /* @__PURE__ */ jsxs24("p", { className: "text-sm text-ph-ink", children: [
5402
5772
  "Delete ",
5403
5773
  ruleToDelete == null ? void 0 : ruleToDelete.name,
5404
5774
  "? This cannot be undone."
@@ -5406,36 +5776,36 @@ function SuiteIntegrationRules({
5406
5776
  ]
5407
5777
  }
5408
5778
  ),
5409
- /* @__PURE__ */ jsxs23(
5779
+ /* @__PURE__ */ jsxs24(
5410
5780
  Card,
5411
5781
  {
5412
5782
  variant: "outlined",
5413
5783
  bodyClassName: "p-5",
5414
5784
  "data-test": `${dataTest}-events-card`,
5415
5785
  children: [
5416
- /* @__PURE__ */ jsx28("h3", { className: "font-medium text-ph-ink", children: "Recent events" }),
5417
- /* @__PURE__ */ jsx28("p", { className: "mt-1 text-sm text-ph-subtle", children: "The latest events received from your connected apps." }),
5418
- events.length === 0 ? /* @__PURE__ */ jsx28(
5786
+ /* @__PURE__ */ jsx29("h3", { className: "font-medium text-ph-ink", children: "Recent events" }),
5787
+ /* @__PURE__ */ jsx29("p", { className: "mt-1 text-sm text-ph-subtle", children: "The latest events received from your connected apps." }),
5788
+ events.length === 0 ? /* @__PURE__ */ jsx29(
5419
5789
  "p",
5420
5790
  {
5421
5791
  className: "mt-4 rounded-[var(--ph-radius-surface)] border border-dashed border-ph-border bg-[var(--ph-surface-inset)] px-4 py-6 text-center text-sm text-ph-subtle",
5422
5792
  "data-test": `${dataTest}-events-empty`,
5423
5793
  children: "No integration events yet."
5424
5794
  }
5425
- ) : /* @__PURE__ */ jsx28("ul", { className: "mt-4 space-y-2", "data-test": `${dataTest}-events-list`, children: events.map((event) => /* @__PURE__ */ jsxs23(
5795
+ ) : /* @__PURE__ */ jsx29("ul", { className: "mt-4 space-y-2", "data-test": `${dataTest}-events-list`, children: events.map((event) => /* @__PURE__ */ jsxs24(
5426
5796
  "li",
5427
5797
  {
5428
5798
  className: "flex items-center justify-between gap-3 rounded-[var(--ph-radius-surface)] border border-ph-border bg-[var(--ph-surface-inset)] px-3 py-2",
5429
5799
  children: [
5430
- /* @__PURE__ */ jsxs23("div", { className: "min-w-0", children: [
5431
- /* @__PURE__ */ jsxs23("p", { className: "truncate text-sm text-ph-ink", children: [
5800
+ /* @__PURE__ */ jsxs24("div", { className: "min-w-0", children: [
5801
+ /* @__PURE__ */ jsxs24("p", { className: "truncate text-sm text-ph-ink", children: [
5432
5802
  event.provider,
5433
5803
  " \xB7 ",
5434
5804
  event.event_type
5435
5805
  ] }),
5436
- /* @__PURE__ */ jsx28("p", { className: "mt-0.5 text-xs text-ph-subtle", children: formatDateTime(event.created_at) })
5806
+ /* @__PURE__ */ jsx29("p", { className: "mt-0.5 text-xs text-ph-subtle", children: formatDateTime(event.created_at) })
5437
5807
  ] }),
5438
- /* @__PURE__ */ jsx28(
5808
+ /* @__PURE__ */ jsx29(
5439
5809
  Badge,
5440
5810
  {
5441
5811
  variant: event.processed_at ? "success" : "warning",
@@ -5456,7 +5826,7 @@ function SuiteIntegrationRules({
5456
5826
  // src/suite/components/suite-clients-projects-directory.tsx
5457
5827
  import {
5458
5828
  useEffect as useEffect12,
5459
- useMemo as useMemo5,
5829
+ useMemo as useMemo6,
5460
5830
  useRef as useRef7,
5461
5831
  useState as useState16
5462
5832
  } from "react";
@@ -5525,7 +5895,7 @@ function paletteIconSrc(imageUrl, color) {
5525
5895
  }
5526
5896
 
5527
5897
  // src/suite/components/suite-entity-icon.tsx
5528
- import { jsx as jsx29 } from "react/jsx-runtime";
5898
+ import { jsx as jsx30 } from "react/jsx-runtime";
5529
5899
  function SuiteEntityIcon({
5530
5900
  imageUrl,
5531
5901
  label,
@@ -5540,7 +5910,7 @@ function SuiteEntityIcon({
5540
5910
  const neutralBackground = "var(--ph-muted, rgba(127,127,127,0.08))";
5541
5911
  if (imageUrl) {
5542
5912
  const src = tinted && tint ? paletteIconSrc(imageUrl, tint) : imageUrl;
5543
- return /* @__PURE__ */ jsx29(
5913
+ return /* @__PURE__ */ jsx30(
5544
5914
  "span",
5545
5915
  {
5546
5916
  className: cn(
@@ -5551,11 +5921,11 @@ function SuiteEntityIcon({
5551
5921
  style: __spreadValues({
5552
5922
  backgroundColor: tint ? `${tint}18` : neutralBackground
5553
5923
  }, style),
5554
- children: /* @__PURE__ */ jsx29("img", { src: src != null ? src : void 0, alt: "", className: "h-full w-full object-contain" })
5924
+ children: /* @__PURE__ */ jsx30("img", { src: src != null ? src : void 0, alt: "", className: "h-full w-full object-contain" })
5555
5925
  }
5556
5926
  );
5557
5927
  }
5558
- return /* @__PURE__ */ jsx29(
5928
+ return /* @__PURE__ */ jsx30(
5559
5929
  "span",
5560
5930
  {
5561
5931
  className: cn(
@@ -5569,7 +5939,7 @@ function SuiteEntityIcon({
5569
5939
  }, style),
5570
5940
  "aria-hidden": "true",
5571
5941
  title: label != null ? label : void 0,
5572
- children: /* @__PURE__ */ jsx29(
5942
+ children: /* @__PURE__ */ jsx30(
5573
5943
  Folder,
5574
5944
  {
5575
5945
  className: "h-[88%] w-[88%]",
@@ -5586,12 +5956,12 @@ import {
5586
5956
  useCallback as useCallback7,
5587
5957
  useEffect as useEffect11,
5588
5958
  useId as useId2,
5589
- useMemo as useMemo4,
5959
+ useMemo as useMemo5,
5590
5960
  useRef as useRef6,
5591
5961
  useState as useState15
5592
5962
  } from "react";
5593
5963
  import { Filter as Filter2, FilterList, NavArrowDown as NavArrowDown3, Search as Search2 } from "iconoir-react";
5594
- import { Fragment as Fragment9, jsx as jsx30, jsxs as jsxs24 } from "react/jsx-runtime";
5964
+ import { Fragment as Fragment9, jsx as jsx31, jsxs as jsxs25 } from "react/jsx-runtime";
5595
5965
  var PAGE_SIZE = 60;
5596
5966
  var DISCOVER_LIMIT = 120;
5597
5967
  var ICON_TYPES = [
@@ -5609,15 +5979,15 @@ function FilterSelect({
5609
5979
  onChange,
5610
5980
  children
5611
5981
  }) {
5612
- return /* @__PURE__ */ jsxs24("div", { className: "relative", children: [
5613
- /* @__PURE__ */ jsx30(
5982
+ return /* @__PURE__ */ jsxs25("div", { className: "relative", children: [
5983
+ /* @__PURE__ */ jsx31(
5614
5984
  Icon,
5615
5985
  {
5616
5986
  className: "pointer-events-none absolute left-2.5 top-1/2 h-4 w-4 -translate-y-1/2 text-ph-mutedtext",
5617
5987
  "aria-hidden": true
5618
5988
  }
5619
5989
  ),
5620
- /* @__PURE__ */ jsx30(
5990
+ /* @__PURE__ */ jsx31(
5621
5991
  "select",
5622
5992
  {
5623
5993
  "aria-label": label,
@@ -5627,7 +5997,7 @@ function FilterSelect({
5627
5997
  children
5628
5998
  }
5629
5999
  ),
5630
- /* @__PURE__ */ jsx30(
6000
+ /* @__PURE__ */ jsx31(
5631
6001
  NavArrowDown3,
5632
6002
  {
5633
6003
  className: "pointer-events-none absolute right-2 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-ph-mutedtext",
@@ -5656,7 +6026,7 @@ function SuitePaletteLibrary({
5656
6026
  const [loadingMore, setLoadingMore] = useState15(false);
5657
6027
  const [error, setError] = useState15(null);
5658
6028
  const requestId = useRef6(0);
5659
- const libraryOptions = useMemo4(() => {
6029
+ const libraryOptions = useMemo5(() => {
5660
6030
  const list = collections.filter(
5661
6031
  (item) => typeFilter === "all" || item.style === typeFilter
5662
6032
  );
@@ -5664,7 +6034,7 @@ function SuitePaletteLibrary({
5664
6034
  (a, b) => Number(b.featured) - Number(a.featured) || a.name.localeCompare(b.name)
5665
6035
  );
5666
6036
  }, [collections, typeFilter]);
5667
- const discoverIcons = useMemo4(() => {
6037
+ const discoverIcons = useMemo5(() => {
5668
6038
  const seen = /* @__PURE__ */ new Set();
5669
6039
  const out = [];
5670
6040
  for (const collection of libraryOptions) {
@@ -5777,7 +6147,7 @@ function SuitePaletteLibrary({
5777
6147
  }, [query, collectionFilter, typeFilter]);
5778
6148
  const searching = Boolean(query.trim());
5779
6149
  const activeLibrary = (_a2 = collections.find((c) => c.slug === collectionFilter)) != null ? _a2 : null;
5780
- const filteredLibraries = useMemo4(() => {
6150
+ const filteredLibraries = useMemo5(() => {
5781
6151
  const term = libraryQuery.trim().toLowerCase();
5782
6152
  if (!term) return libraryOptions;
5783
6153
  return libraryOptions.filter((c) => c.name.toLowerCase().includes(term));
@@ -5828,18 +6198,18 @@ function SuitePaletteLibrary({
5828
6198
  event.preventDefault();
5829
6199
  (_c = options[nextIndex]) == null ? void 0 : _c.focus();
5830
6200
  };
5831
- return /* @__PURE__ */ jsxs24("div", { className: "space-y-3", "data-test": "palette-icon-library", children: [
5832
- /* @__PURE__ */ jsxs24("div", { ref: libraryRef, className: "space-y-2", children: [
5833
- /* @__PURE__ */ jsxs24("div", { className: "flex flex-col gap-2 sm:flex-row", children: [
5834
- /* @__PURE__ */ jsxs24("div", { className: "relative flex-1", children: [
5835
- /* @__PURE__ */ jsx30(
6201
+ return /* @__PURE__ */ jsxs25("div", { className: "space-y-3", "data-test": "palette-icon-library", children: [
6202
+ /* @__PURE__ */ jsxs25("div", { ref: libraryRef, className: "space-y-2", children: [
6203
+ /* @__PURE__ */ jsxs25("div", { className: "flex flex-col gap-2 sm:flex-row", children: [
6204
+ /* @__PURE__ */ jsxs25("div", { className: "relative flex-1", children: [
6205
+ /* @__PURE__ */ jsx31(
5836
6206
  Search2,
5837
6207
  {
5838
6208
  className: "pointer-events-none absolute left-2.5 top-1/2 h-4 w-4 -translate-y-1/2 text-ph-mutedtext",
5839
6209
  "aria-hidden": true
5840
6210
  }
5841
6211
  ),
5842
- /* @__PURE__ */ jsx30(
6212
+ /* @__PURE__ */ jsx31(
5843
6213
  "input",
5844
6214
  {
5845
6215
  type: "search",
@@ -5851,7 +6221,7 @@ function SuitePaletteLibrary({
5851
6221
  }
5852
6222
  )
5853
6223
  ] }),
5854
- /* @__PURE__ */ jsxs24(
6224
+ /* @__PURE__ */ jsxs25(
5855
6225
  "button",
5856
6226
  {
5857
6227
  ref: libraryTriggerRef,
@@ -5868,9 +6238,9 @@ function SuitePaletteLibrary({
5868
6238
  },
5869
6239
  className: "ph-input flex items-center gap-2 px-2.5 py-2 text-sm text-ph-ink",
5870
6240
  children: [
5871
- /* @__PURE__ */ jsx30(FilterList, { className: "h-4 w-4 shrink-0 text-ph-mutedtext", "aria-hidden": true }),
5872
- /* @__PURE__ */ jsx30("span", { className: "max-w-[10rem] truncate", children: (_b = activeLibrary == null ? void 0 : activeLibrary.name) != null ? _b : "All libraries" }),
5873
- /* @__PURE__ */ jsx30(
6241
+ /* @__PURE__ */ jsx31(FilterList, { className: "h-4 w-4 shrink-0 text-ph-mutedtext", "aria-hidden": true }),
6242
+ /* @__PURE__ */ jsx31("span", { className: "max-w-[10rem] truncate", children: (_b = activeLibrary == null ? void 0 : activeLibrary.name) != null ? _b : "All libraries" }),
6243
+ /* @__PURE__ */ jsx31(
5874
6244
  NavArrowDown3,
5875
6245
  {
5876
6246
  className: cn(
@@ -5883,27 +6253,27 @@ function SuitePaletteLibrary({
5883
6253
  ]
5884
6254
  }
5885
6255
  ),
5886
- /* @__PURE__ */ jsx30(
6256
+ /* @__PURE__ */ jsx31(
5887
6257
  FilterSelect,
5888
6258
  {
5889
6259
  icon: Filter2,
5890
6260
  label: "Filter by icon type",
5891
6261
  value: typeFilter,
5892
6262
  onChange: setTypeFilter,
5893
- children: ICON_TYPES.map((type) => /* @__PURE__ */ jsx30("option", { value: type.value, children: type.label }, type.value))
6263
+ children: ICON_TYPES.map((type) => /* @__PURE__ */ jsx31("option", { value: type.value, children: type.label }, type.value))
5894
6264
  }
5895
6265
  )
5896
6266
  ] }),
5897
- libraryOpen ? /* @__PURE__ */ jsxs24("div", { className: "rounded-[var(--ph-radius-overlay)] border border-[var(--ph-border-control)] bg-[var(--ph-surface-overlay)] p-2 shadow-[var(--ph-shadow-floating)]", children: [
5898
- /* @__PURE__ */ jsxs24("div", { className: "relative mb-2", children: [
5899
- /* @__PURE__ */ jsx30(
6267
+ libraryOpen ? /* @__PURE__ */ jsxs25("div", { className: "rounded-[var(--ph-radius-overlay)] border border-[var(--ph-border-control)] bg-[var(--ph-surface-overlay)] p-2 shadow-[var(--ph-shadow-floating)]", children: [
6268
+ /* @__PURE__ */ jsxs25("div", { className: "relative mb-2", children: [
6269
+ /* @__PURE__ */ jsx31(
5900
6270
  Search2,
5901
6271
  {
5902
6272
  className: "pointer-events-none absolute left-2.5 top-1/2 h-4 w-4 -translate-y-1/2 text-ph-mutedtext",
5903
6273
  "aria-hidden": true
5904
6274
  }
5905
6275
  ),
5906
- /* @__PURE__ */ jsx30(
6276
+ /* @__PURE__ */ jsx31(
5907
6277
  "input",
5908
6278
  {
5909
6279
  type: "search",
@@ -5926,7 +6296,7 @@ function SuitePaletteLibrary({
5926
6296
  }
5927
6297
  )
5928
6298
  ] }),
5929
- /* @__PURE__ */ jsxs24(
6299
+ /* @__PURE__ */ jsxs25(
5930
6300
  "ul",
5931
6301
  {
5932
6302
  role: "listbox",
@@ -5934,7 +6304,7 @@ function SuitePaletteLibrary({
5934
6304
  "aria-label": "Libraries",
5935
6305
  className: "max-h-56 overflow-y-auto",
5936
6306
  children: [
5937
- /* @__PURE__ */ jsx30("li", { children: /* @__PURE__ */ jsx30(
6307
+ /* @__PURE__ */ jsx31("li", { children: /* @__PURE__ */ jsx31(
5938
6308
  "button",
5939
6309
  {
5940
6310
  type: "button",
@@ -5953,7 +6323,7 @@ function SuitePaletteLibrary({
5953
6323
  children: "All libraries"
5954
6324
  }
5955
6325
  ) }),
5956
- filteredLibraries.map((collection) => /* @__PURE__ */ jsx30("li", { children: /* @__PURE__ */ jsxs24(
6326
+ filteredLibraries.map((collection) => /* @__PURE__ */ jsx31("li", { children: /* @__PURE__ */ jsxs25(
5957
6327
  "button",
5958
6328
  {
5959
6329
  type: "button",
@@ -5970,19 +6340,19 @@ function SuitePaletteLibrary({
5970
6340
  collectionFilter === collection.slug ? "bg-[var(--ph-selected-bg)] text-[var(--ph-selected-text)]" : "text-ph-ink hover:bg-[var(--ph-surface-hover)]"
5971
6341
  ),
5972
6342
  children: [
5973
- /* @__PURE__ */ jsx30("span", { className: "truncate", children: collection.name }),
5974
- /* @__PURE__ */ jsx30("span", { className: "shrink-0 text-xs text-ph-mutedtext", children: collection.count })
6343
+ /* @__PURE__ */ jsx31("span", { className: "truncate", children: collection.name }),
6344
+ /* @__PURE__ */ jsx31("span", { className: "shrink-0 text-xs text-ph-mutedtext", children: collection.count })
5975
6345
  ]
5976
6346
  }
5977
6347
  ) }, collection.slug)),
5978
- filteredLibraries.length === 0 ? /* @__PURE__ */ jsx30("li", { className: "px-2 py-4 text-center text-sm text-ph-mutedtext", children: "No libraries match." }) : null
6348
+ filteredLibraries.length === 0 ? /* @__PURE__ */ jsx31("li", { className: "px-2 py-4 text-center text-sm text-ph-mutedtext", children: "No libraries match." }) : null
5979
6349
  ]
5980
6350
  }
5981
6351
  )
5982
6352
  ] }) : null
5983
6353
  ] }),
5984
- error ? /* @__PURE__ */ jsx30("p", { className: "text-sm text-ph-danger", children: error }) : loading ? /* @__PURE__ */ jsx30("p", { className: "py-8 text-center text-sm text-ph-mutedtext", children: "Loading icons\u2026" }) : icons.length === 0 ? /* @__PURE__ */ jsx30("p", { className: "py-8 text-center text-sm text-ph-mutedtext", children: "No icons matched. Try another word or filter." }) : /* @__PURE__ */ jsxs24(Fragment9, { children: [
5985
- /* @__PURE__ */ jsx30("div", { className: "max-h-[320px] overflow-y-auto rounded-[var(--ph-radius-surface)] border border-ph-border p-2 focus-within:border-[var(--ph-selected-border)]", children: /* @__PURE__ */ jsx30("div", { className: "grid grid-cols-6 gap-1.5 sm:grid-cols-8", children: icons.map((icon) => /* @__PURE__ */ jsx30(
6354
+ error ? /* @__PURE__ */ jsx31("p", { className: "text-sm text-ph-danger", children: error }) : loading ? /* @__PURE__ */ jsx31("p", { className: "py-8 text-center text-sm text-ph-mutedtext", children: "Loading icons\u2026" }) : icons.length === 0 ? /* @__PURE__ */ jsx31("p", { className: "py-8 text-center text-sm text-ph-mutedtext", children: "No icons matched. Try another word or filter." }) : /* @__PURE__ */ jsxs25(Fragment9, { children: [
6355
+ /* @__PURE__ */ jsx31("div", { className: "max-h-[320px] overflow-y-auto rounded-[var(--ph-radius-surface)] border border-ph-border p-2 focus-within:border-[var(--ph-selected-border)]", children: /* @__PURE__ */ jsx31("div", { className: "grid grid-cols-6 gap-1.5 sm:grid-cols-8", children: icons.map((icon) => /* @__PURE__ */ jsx31(
5986
6356
  "button",
5987
6357
  {
5988
6358
  type: "button",
@@ -5990,7 +6360,7 @@ function SuitePaletteLibrary({
5990
6360
  title: icon.name,
5991
6361
  "aria-label": `Use ${icon.name}`,
5992
6362
  className: "flex h-10 items-center justify-center rounded-[var(--ph-radius-control)] border border-transparent p-1.5 hover:border-[var(--ph-selected-border)] hover:bg-[var(--ph-surface-hover)] focus-visible:outline-none focus-visible:shadow-[var(--ph-focus-halo)]",
5993
- children: /* @__PURE__ */ jsx30(
6363
+ children: /* @__PURE__ */ jsx31(
5994
6364
  "img",
5995
6365
  {
5996
6366
  src: icon.url,
@@ -6003,14 +6373,14 @@ function SuitePaletteLibrary({
6003
6373
  },
6004
6374
  icon.id
6005
6375
  )) }) }),
6006
- /* @__PURE__ */ jsxs24("div", { className: "flex items-center justify-between text-xs text-ph-mutedtext", children: [
6007
- /* @__PURE__ */ jsxs24("span", { children: [
6376
+ /* @__PURE__ */ jsxs25("div", { className: "flex items-center justify-between text-xs text-ph-mutedtext", children: [
6377
+ /* @__PURE__ */ jsxs25("span", { children: [
6008
6378
  icons.length,
6009
6379
  " of ",
6010
6380
  total,
6011
6381
  searching ? " matching" : activeLibrary ? ` in ${activeLibrary.name}` : " across all libraries"
6012
6382
  ] }),
6013
- !searching && activeLibrary && icons.length < total ? /* @__PURE__ */ jsx30(
6383
+ !searching && activeLibrary && icons.length < total ? /* @__PURE__ */ jsx31(
6014
6384
  "button",
6015
6385
  {
6016
6386
  type: "button",
@@ -6029,7 +6399,7 @@ function SuitePaletteLibrary({
6029
6399
  }
6030
6400
 
6031
6401
  // src/suite/components/suite-clients-projects-directory.tsx
6032
- import { Fragment as Fragment10, jsx as jsx31, jsxs as jsxs25 } from "react/jsx-runtime";
6402
+ import { Fragment as Fragment10, jsx as jsx32, jsxs as jsxs26 } from "react/jsx-runtime";
6033
6403
  var DEFAULT_ICON = "";
6034
6404
  var DEFAULT_COLOR = "";
6035
6405
  function DirectoryIconPicker({
@@ -6040,11 +6410,11 @@ function DirectoryIconPicker({
6040
6410
  onClear,
6041
6411
  onBrowse
6042
6412
  }) {
6043
- return /* @__PURE__ */ jsxs25("div", { className: "space-y-2", children: [
6044
- /* @__PURE__ */ jsx31("span", { className: "mb-1.5 block text-sm font-medium text-ph-ink", children: "Icon" }),
6045
- /* @__PURE__ */ jsxs25("div", { className: "rounded-[var(--ph-radius-surface)] border border-ph-border bg-[var(--ph-surface-inset)] p-3", children: [
6046
- /* @__PURE__ */ jsxs25("div", { className: "flex items-center gap-3", children: [
6047
- /* @__PURE__ */ jsx31(
6413
+ return /* @__PURE__ */ jsxs26("div", { className: "space-y-2", children: [
6414
+ /* @__PURE__ */ jsx32("span", { className: "mb-1.5 block text-sm font-medium text-ph-ink", children: "Icon" }),
6415
+ /* @__PURE__ */ jsxs26("div", { className: "rounded-[var(--ph-radius-surface)] border border-ph-border bg-[var(--ph-surface-inset)] p-3", children: [
6416
+ /* @__PURE__ */ jsxs26("div", { className: "flex items-center gap-3", children: [
6417
+ /* @__PURE__ */ jsx32(
6048
6418
  SuiteEntityIcon,
6049
6419
  {
6050
6420
  imageUrl: preview,
@@ -6054,11 +6424,11 @@ function DirectoryIconPicker({
6054
6424
  className: "h-9 w-9 text-base"
6055
6425
  }
6056
6426
  ),
6057
- /* @__PURE__ */ jsxs25("div", { className: "min-w-0 flex-1", children: [
6058
- /* @__PURE__ */ jsx31("p", { className: "text-sm font-medium text-ph-ink", children: preview ? "Custom image" : "No icon yet" }),
6059
- /* @__PURE__ */ jsx31("p", { className: "text-xs text-ph-mutedtext", children: preview ? "Shown on cards and lists." : "Browse the library or upload your own." })
6427
+ /* @__PURE__ */ jsxs26("div", { className: "min-w-0 flex-1", children: [
6428
+ /* @__PURE__ */ jsx32("p", { className: "text-sm font-medium text-ph-ink", children: preview ? "Custom image" : "No icon yet" }),
6429
+ /* @__PURE__ */ jsx32("p", { className: "text-xs text-ph-mutedtext", children: preview ? "Shown on cards and lists." : "Browse the library or upload your own." })
6060
6430
  ] }),
6061
- onBrowse ? /* @__PURE__ */ jsx31(
6431
+ onBrowse ? /* @__PURE__ */ jsx32(
6062
6432
  "button",
6063
6433
  {
6064
6434
  type: "button",
@@ -6068,7 +6438,7 @@ function DirectoryIconPicker({
6068
6438
  }
6069
6439
  ) : null
6070
6440
  ] }),
6071
- /* @__PURE__ */ jsx31("div", { className: "mt-3", children: /* @__PURE__ */ jsx31(
6441
+ /* @__PURE__ */ jsx32("div", { className: "mt-3", children: /* @__PURE__ */ jsx32(
6072
6442
  FileUpload,
6073
6443
  {
6074
6444
  accept: "image/png,image/jpeg,image/gif,image/webp,image/svg+xml,.svg",
@@ -6078,14 +6448,14 @@ function DirectoryIconPicker({
6078
6448
  }
6079
6449
  }
6080
6450
  ) }),
6081
- preview ? /* @__PURE__ */ jsxs25(
6451
+ preview ? /* @__PURE__ */ jsxs26(
6082
6452
  "button",
6083
6453
  {
6084
6454
  type: "button",
6085
6455
  className: "mt-2 inline-flex items-center gap-1.5 rounded-md px-2 py-1 text-xs text-ph-mutedtext hover:bg-ph-surface hover:text-ph-ink",
6086
6456
  onClick: onClear,
6087
6457
  children: [
6088
- /* @__PURE__ */ jsx31(Trash, { className: "h-3.5 w-3.5", "aria-hidden": true }),
6458
+ /* @__PURE__ */ jsx32(Trash, { className: "h-3.5 w-3.5", "aria-hidden": true }),
6089
6459
  " Remove image"
6090
6460
  ]
6091
6461
  }
@@ -6096,7 +6466,7 @@ function DirectoryIconPicker({
6096
6466
  function DirectoryIcon({
6097
6467
  item
6098
6468
  }) {
6099
- return /* @__PURE__ */ jsx31(
6469
+ return /* @__PURE__ */ jsx32(
6100
6470
  SuiteEntityIcon,
6101
6471
  {
6102
6472
  imageUrl: item.icon_image,
@@ -6158,7 +6528,7 @@ function SuiteClientsProjectsDirectory({
6158
6528
  else if (selectedClientId)
6159
6529
  (_b = clientButtonRefs.current[selectedClientId]) == null ? void 0 : _b.focus();
6160
6530
  }, [mobileDetail, selectedClientId]);
6161
- const filteredClients = useMemo5(() => {
6531
+ const filteredClients = useMemo6(() => {
6162
6532
  const value = query.trim().toLowerCase();
6163
6533
  return [...clients].sort((a, b) => a.name.localeCompare(b.name)).filter((client) => !value || client.name.toLowerCase().includes(value));
6164
6534
  }, [clients, query]);
@@ -6326,10 +6696,10 @@ function SuiteClientsProjectsDirectory({
6326
6696
  );
6327
6697
  }
6328
6698
  }
6329
- return /* @__PURE__ */ jsxs25("div", { "data-test": dataTest, className: "space-y-3", children: [
6330
- error || mutationError ? /* @__PURE__ */ jsx31(Alert, { status: "danger", live: "assertive", children: error || mutationError }) : null,
6331
- loading ? /* @__PURE__ */ jsx31("p", { className: "text-sm text-ph-mutedtext", children: "Loading directory..." }) : /* @__PURE__ */ jsxs25("div", { className: "overflow-hidden rounded-[var(--ph-radius-surface)] border border-ph-border bg-ph-surface lg:grid lg:min-h-[22rem] lg:grid-cols-[minmax(14rem,18rem)_1fr]", children: [
6332
- /* @__PURE__ */ jsxs25(
6699
+ return /* @__PURE__ */ jsxs26("div", { "data-test": dataTest, className: "space-y-3", children: [
6700
+ error || mutationError ? /* @__PURE__ */ jsx32(Alert, { status: "danger", live: "assertive", children: error || mutationError }) : null,
6701
+ loading ? /* @__PURE__ */ jsx32("p", { className: "text-sm text-ph-mutedtext", children: "Loading directory..." }) : /* @__PURE__ */ jsxs26("div", { className: "overflow-hidden rounded-[var(--ph-radius-surface)] border border-ph-border bg-ph-surface lg:grid lg:min-h-[22rem] lg:grid-cols-[minmax(14rem,18rem)_1fr]", children: [
6702
+ /* @__PURE__ */ jsxs26(
6333
6703
  "section",
6334
6704
  {
6335
6705
  className: cn(
@@ -6337,16 +6707,16 @@ function SuiteClientsProjectsDirectory({
6337
6707
  mobileDetail ? "hidden lg:block" : "block"
6338
6708
  ),
6339
6709
  children: [
6340
- /* @__PURE__ */ jsxs25("div", { className: "flex h-14 items-center gap-2 border-b border-ph-border px-3", children: [
6341
- /* @__PURE__ */ jsxs25("div", { className: "relative min-w-0 flex-1", children: [
6342
- /* @__PURE__ */ jsx31(
6710
+ /* @__PURE__ */ jsxs26("div", { className: "flex h-14 items-center gap-2 border-b border-ph-border px-3", children: [
6711
+ /* @__PURE__ */ jsxs26("div", { className: "relative min-w-0 flex-1", children: [
6712
+ /* @__PURE__ */ jsx32(
6343
6713
  Search3,
6344
6714
  {
6345
6715
  className: "pointer-events-none absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-ph-mutedtext",
6346
6716
  "aria-hidden": true
6347
6717
  }
6348
6718
  ),
6349
- /* @__PURE__ */ jsx31(
6719
+ /* @__PURE__ */ jsx32(
6350
6720
  Input,
6351
6721
  {
6352
6722
  hideLabel: true,
@@ -6358,18 +6728,18 @@ function SuiteClientsProjectsDirectory({
6358
6728
  }
6359
6729
  )
6360
6730
  ] }),
6361
- canEdit && onCreateClient ? /* @__PURE__ */ jsx31(
6731
+ canEdit && onCreateClient ? /* @__PURE__ */ jsx32(
6362
6732
  Button,
6363
6733
  {
6364
6734
  size: "sm",
6365
6735
  variant: "primary",
6366
- icon: /* @__PURE__ */ jsx31(Plus2, { className: "h-4 w-4" }),
6736
+ icon: /* @__PURE__ */ jsx32(Plus2, { className: "h-4 w-4" }),
6367
6737
  onClick: () => openNew("client"),
6368
6738
  children: "New client"
6369
6739
  }
6370
6740
  ) : null
6371
6741
  ] }),
6372
- /* @__PURE__ */ jsx31(
6742
+ /* @__PURE__ */ jsx32(
6373
6743
  "ul",
6374
6744
  {
6375
6745
  role: "listbox",
@@ -6380,7 +6750,7 @@ function SuiteClientsProjectsDirectory({
6380
6750
  const count = projects.filter(
6381
6751
  (project) => project.clientId === client.id
6382
6752
  ).length;
6383
- return /* @__PURE__ */ jsx31("li", { role: "none", children: /* @__PURE__ */ jsxs25(
6753
+ return /* @__PURE__ */ jsx32("li", { role: "none", children: /* @__PURE__ */ jsxs26(
6384
6754
  "button",
6385
6755
  {
6386
6756
  type: "button",
@@ -6397,10 +6767,10 @@ function SuiteClientsProjectsDirectory({
6397
6767
  selected ? "bg-ph-muted" : "hover:bg-ph-canvas"
6398
6768
  ),
6399
6769
  children: [
6400
- /* @__PURE__ */ jsx31(DirectoryIcon, { item: client }),
6401
- /* @__PURE__ */ jsxs25("span", { className: "min-w-0 flex-1", children: [
6402
- /* @__PURE__ */ jsx31("span", { className: "block truncate text-sm font-medium text-ph-ink", children: client.name }),
6403
- /* @__PURE__ */ jsxs25("span", { className: "text-xs text-ph-mutedtext", children: [
6770
+ /* @__PURE__ */ jsx32(DirectoryIcon, { item: client }),
6771
+ /* @__PURE__ */ jsxs26("span", { className: "min-w-0 flex-1", children: [
6772
+ /* @__PURE__ */ jsx32("span", { className: "block truncate text-sm font-medium text-ph-ink", children: client.name }),
6773
+ /* @__PURE__ */ jsxs26("span", { className: "text-xs text-ph-mutedtext", children: [
6404
6774
  count,
6405
6775
  " project",
6406
6776
  count === 1 ? "" : "s"
@@ -6409,13 +6779,13 @@ function SuiteClientsProjectsDirectory({
6409
6779
  ]
6410
6780
  }
6411
6781
  ) }, client.id);
6412
- }) : /* @__PURE__ */ jsx31("li", { className: "px-3 py-8 text-center text-sm text-ph-mutedtext", children: clients.length ? "No matches." : "Add a client to get started." })
6782
+ }) : /* @__PURE__ */ jsx32("li", { className: "px-3 py-8 text-center text-sm text-ph-mutedtext", children: clients.length ? "No matches." : "Add a client to get started." })
6413
6783
  }
6414
6784
  )
6415
6785
  ]
6416
6786
  }
6417
6787
  ),
6418
- /* @__PURE__ */ jsxs25(
6788
+ /* @__PURE__ */ jsxs26(
6419
6789
  "section",
6420
6790
  {
6421
6791
  className: cn(
@@ -6423,8 +6793,8 @@ function SuiteClientsProjectsDirectory({
6423
6793
  mobileDetail ? "flex" : "hidden lg:flex"
6424
6794
  ),
6425
6795
  children: [
6426
- /* @__PURE__ */ jsx31("div", { className: "flex min-h-14 items-center gap-2 border-b border-ph-border px-3 py-2", children: selectedClient ? /* @__PURE__ */ jsxs25(Fragment10, { children: [
6427
- /* @__PURE__ */ jsx31(
6796
+ /* @__PURE__ */ jsx32("div", { className: "flex min-h-14 items-center gap-2 border-b border-ph-border px-3 py-2", children: selectedClient ? /* @__PURE__ */ jsxs26(Fragment10, { children: [
6797
+ /* @__PURE__ */ jsx32(
6428
6798
  "button",
6429
6799
  {
6430
6800
  type: "button",
@@ -6435,36 +6805,36 @@ function SuiteClientsProjectsDirectory({
6435
6805
  setMobileDetail(false);
6436
6806
  },
6437
6807
  "aria-label": "Back to clients",
6438
- children: /* @__PURE__ */ jsx31(ArrowLeft, { className: "h-4 w-4" })
6808
+ children: /* @__PURE__ */ jsx32(ArrowLeft, { className: "h-4 w-4" })
6439
6809
  }
6440
6810
  ),
6441
- /* @__PURE__ */ jsx31(DirectoryIcon, { item: selectedClient }),
6442
- /* @__PURE__ */ jsxs25("div", { className: "min-w-0 flex-1", children: [
6443
- /* @__PURE__ */ jsx31("h3", { className: "truncate text-sm font-semibold text-ph-ink", children: selectedClient.name }),
6444
- /* @__PURE__ */ jsxs25("p", { className: "text-xs text-ph-mutedtext", children: [
6811
+ /* @__PURE__ */ jsx32(DirectoryIcon, { item: selectedClient }),
6812
+ /* @__PURE__ */ jsxs26("div", { className: "min-w-0 flex-1", children: [
6813
+ /* @__PURE__ */ jsx32("h3", { className: "truncate text-sm font-semibold text-ph-ink", children: selectedClient.name }),
6814
+ /* @__PURE__ */ jsxs26("p", { className: "text-xs text-ph-mutedtext", children: [
6445
6815
  selectedProjects.length,
6446
6816
  " project",
6447
6817
  selectedProjects.length === 1 ? "" : "s"
6448
6818
  ] })
6449
6819
  ] }),
6450
- canEdit && (onUpdateClient || onDeleteClient) ? /* @__PURE__ */ jsx31("div", { onClick: (event) => event.stopPropagation(), children: /* @__PURE__ */ jsx31(
6820
+ canEdit && (onUpdateClient || onDeleteClient) ? /* @__PURE__ */ jsx32("div", { onClick: (event) => event.stopPropagation(), children: /* @__PURE__ */ jsx32(
6451
6821
  DropdownMenu,
6452
6822
  {
6453
6823
  "aria-label": `Actions for ${selectedClient.name}`,
6454
6824
  align: "end",
6455
- trigger: /* @__PURE__ */ jsxs25("span", { className: "inline-flex h-8 w-8 items-center justify-center rounded-md text-ph-mutedtext hover:bg-ph-muted hover:text-ph-ink", children: [
6456
- /* @__PURE__ */ jsx31(MoreHorizontal, { className: "h-4 w-4", "aria-hidden": true }),
6457
- /* @__PURE__ */ jsx31("span", { className: "sr-only", children: "Client actions" })
6825
+ trigger: /* @__PURE__ */ jsxs26("span", { className: "inline-flex h-8 w-8 items-center justify-center rounded-md text-ph-mutedtext hover:bg-ph-muted hover:text-ph-ink", children: [
6826
+ /* @__PURE__ */ jsx32(MoreHorizontal, { className: "h-4 w-4", "aria-hidden": true }),
6827
+ /* @__PURE__ */ jsx32("span", { className: "sr-only", children: "Client actions" })
6458
6828
  ] }),
6459
- children: /* @__PURE__ */ jsxs25("div", { className: "p-1", children: [
6460
- onUpdateClient ? /* @__PURE__ */ jsx31(
6829
+ children: /* @__PURE__ */ jsxs26("div", { className: "p-1", children: [
6830
+ onUpdateClient ? /* @__PURE__ */ jsx32(
6461
6831
  DropdownItem,
6462
6832
  {
6463
6833
  onClick: () => openEdit(selectedClient, "client"),
6464
6834
  children: "Edit client"
6465
6835
  }
6466
6836
  ) : null,
6467
- onDeleteClient ? /* @__PURE__ */ jsx31(
6837
+ onDeleteClient ? /* @__PURE__ */ jsx32(
6468
6838
  DropdownItem,
6469
6839
  {
6470
6840
  className: "text-red-600",
@@ -6475,32 +6845,32 @@ function SuiteClientsProjectsDirectory({
6475
6845
  ] })
6476
6846
  }
6477
6847
  ) }) : null
6478
- ] }) : /* @__PURE__ */ jsx31("p", { className: "text-sm text-ph-mutedtext", children: "Select a client" }) }),
6479
- canEdit && onCreateProject ? /* @__PURE__ */ jsx31("div", { className: "border-b border-ph-border p-3", children: /* @__PURE__ */ jsx31(
6848
+ ] }) : /* @__PURE__ */ jsx32("p", { className: "text-sm text-ph-mutedtext", children: "Select a client" }) }),
6849
+ canEdit && onCreateProject ? /* @__PURE__ */ jsx32("div", { className: "border-b border-ph-border p-3", children: /* @__PURE__ */ jsx32(
6480
6850
  Button,
6481
6851
  {
6482
6852
  variant: "primary",
6483
- icon: /* @__PURE__ */ jsx31(Plus2, { className: "h-4 w-4" }),
6853
+ icon: /* @__PURE__ */ jsx32(Plus2, { className: "h-4 w-4" }),
6484
6854
  onClick: () => openNew("project"),
6485
6855
  children: "Add project"
6486
6856
  }
6487
6857
  ) }) : null,
6488
- /* @__PURE__ */ jsx31("ul", { className: "flex-1 p-2", children: selectedClient && selectedProjects.length ? selectedProjects.map((project) => /* @__PURE__ */ jsx31("li", { children: /* @__PURE__ */ jsxs25(
6858
+ /* @__PURE__ */ jsx32("ul", { className: "flex-1 p-2", children: selectedClient && selectedProjects.length ? selectedProjects.map((project) => /* @__PURE__ */ jsx32("li", { children: /* @__PURE__ */ jsxs26(
6489
6859
  "div",
6490
6860
  {
6491
6861
  className: "flex items-center gap-3 rounded-[var(--ph-radius-control)] px-2 py-1 hover:bg-ph-canvas",
6492
6862
  onClick: () => openEdit(project, "project"),
6493
6863
  children: [
6494
- /* @__PURE__ */ jsxs25(
6864
+ /* @__PURE__ */ jsxs26(
6495
6865
  "button",
6496
6866
  {
6497
6867
  type: "button",
6498
6868
  className: "flex min-w-0 flex-1 items-center gap-3 rounded-[var(--ph-radius-control)] py-1 text-left focus-visible:outline-none focus-visible:shadow-[var(--ph-focus-halo)]",
6499
6869
  onClick: () => openEdit(project, "project"),
6500
6870
  children: [
6501
- /* @__PURE__ */ jsx31(DirectoryIcon, { item: project }),
6502
- /* @__PURE__ */ jsxs25("span", { className: "min-w-0 flex-1", children: [
6503
- /* @__PURE__ */ jsx31(
6871
+ /* @__PURE__ */ jsx32(DirectoryIcon, { item: project }),
6872
+ /* @__PURE__ */ jsxs26("span", { className: "min-w-0 flex-1", children: [
6873
+ /* @__PURE__ */ jsx32(
6504
6874
  "span",
6505
6875
  {
6506
6876
  className: cn(
@@ -6510,36 +6880,36 @@ function SuiteClientsProjectsDirectory({
6510
6880
  children: project.name
6511
6881
  }
6512
6882
  ),
6513
- /* @__PURE__ */ jsx31("span", { className: "text-xs text-ph-mutedtext", children: project.isArchived ? "Archived" : "Active" })
6883
+ /* @__PURE__ */ jsx32("span", { className: "text-xs text-ph-mutedtext", children: project.isArchived ? "Archived" : "Active" })
6514
6884
  ] })
6515
6885
  ]
6516
6886
  }
6517
6887
  ),
6518
- canEdit && (onUpdateProject || onDeleteProject) ? /* @__PURE__ */ jsx31("div", { onClick: (event) => event.stopPropagation(), children: /* @__PURE__ */ jsx31(
6888
+ canEdit && (onUpdateProject || onDeleteProject) ? /* @__PURE__ */ jsx32("div", { onClick: (event) => event.stopPropagation(), children: /* @__PURE__ */ jsx32(
6519
6889
  DropdownMenu,
6520
6890
  {
6521
6891
  "aria-label": `Actions for ${project.name}`,
6522
6892
  align: "end",
6523
- trigger: /* @__PURE__ */ jsxs25("span", { className: "inline-flex h-8 w-8 shrink-0 items-center justify-center rounded-md text-ph-mutedtext hover:bg-ph-muted hover:text-ph-ink", children: [
6524
- /* @__PURE__ */ jsx31(
6893
+ trigger: /* @__PURE__ */ jsxs26("span", { className: "inline-flex h-8 w-8 shrink-0 items-center justify-center rounded-md text-ph-mutedtext hover:bg-ph-muted hover:text-ph-ink", children: [
6894
+ /* @__PURE__ */ jsx32(
6525
6895
  MoreHorizontal,
6526
6896
  {
6527
6897
  className: "h-4 w-4",
6528
6898
  "aria-hidden": true
6529
6899
  }
6530
6900
  ),
6531
- /* @__PURE__ */ jsx31("span", { className: "sr-only", children: "Project actions" })
6901
+ /* @__PURE__ */ jsx32("span", { className: "sr-only", children: "Project actions" })
6532
6902
  ] }),
6533
- children: /* @__PURE__ */ jsxs25("div", { className: "p-1", children: [
6534
- onUpdateProject ? /* @__PURE__ */ jsxs25(Fragment10, { children: [
6535
- /* @__PURE__ */ jsx31(
6903
+ children: /* @__PURE__ */ jsxs26("div", { className: "p-1", children: [
6904
+ onUpdateProject ? /* @__PURE__ */ jsxs26(Fragment10, { children: [
6905
+ /* @__PURE__ */ jsx32(
6536
6906
  DropdownItem,
6537
6907
  {
6538
6908
  onClick: () => openEdit(project, "project"),
6539
6909
  children: "Edit project"
6540
6910
  }
6541
6911
  ),
6542
- /* @__PURE__ */ jsx31(
6912
+ /* @__PURE__ */ jsx32(
6543
6913
  DropdownItem,
6544
6914
  {
6545
6915
  onClick: () => void toggleArchive(project),
@@ -6547,7 +6917,7 @@ function SuiteClientsProjectsDirectory({
6547
6917
  }
6548
6918
  )
6549
6919
  ] }) : null,
6550
- onDeleteProject ? /* @__PURE__ */ jsx31(
6920
+ onDeleteProject ? /* @__PURE__ */ jsx32(
6551
6921
  DropdownItem,
6552
6922
  {
6553
6923
  className: "text-red-600",
@@ -6560,20 +6930,20 @@ function SuiteClientsProjectsDirectory({
6560
6930
  ) }) : null
6561
6931
  ]
6562
6932
  }
6563
- ) }, project.id)) : /* @__PURE__ */ jsx31("li", { className: "px-3 py-8 text-center text-sm text-ph-mutedtext", children: selectedClient ? "No projects yet." : "Select a client to see its projects." }) })
6933
+ ) }, project.id)) : /* @__PURE__ */ jsx32("li", { className: "px-3 py-8 text-center text-sm text-ph-mutedtext", children: selectedClient ? "No projects yet." : "Select a client to see its projects." }) })
6564
6934
  ]
6565
6935
  }
6566
6936
  )
6567
6937
  ] }),
6568
- /* @__PURE__ */ jsx31(
6938
+ /* @__PURE__ */ jsx32(
6569
6939
  Modal,
6570
6940
  {
6571
6941
  open: editing !== null,
6572
6942
  onClose: closeEditor,
6573
6943
  title: (editing == null ? void 0 : editing.kind.includes("project")) ? editing.kind === "new-project" ? "New project" : "Edit project" : (editing == null ? void 0 : editing.kind) === "new-client" ? "New client" : "Edit client",
6574
- footer: /* @__PURE__ */ jsxs25("div", { className: "flex justify-end gap-2", children: [
6575
- /* @__PURE__ */ jsx31(Button, { variant: "tertiary", onClick: closeEditor, disabled: saving, children: "Cancel" }),
6576
- /* @__PURE__ */ jsx31(
6944
+ footer: /* @__PURE__ */ jsxs26("div", { className: "flex justify-end gap-2", children: [
6945
+ /* @__PURE__ */ jsx32(Button, { variant: "tertiary", onClick: closeEditor, disabled: saving, children: "Cancel" }),
6946
+ /* @__PURE__ */ jsx32(
6577
6947
  Button,
6578
6948
  {
6579
6949
  variant: "primary",
@@ -6583,8 +6953,8 @@ function SuiteClientsProjectsDirectory({
6583
6953
  }
6584
6954
  )
6585
6955
  ] }),
6586
- children: /* @__PURE__ */ jsxs25("div", { className: "space-y-3", children: [
6587
- /* @__PURE__ */ jsx31(
6956
+ children: /* @__PURE__ */ jsxs26("div", { className: "space-y-3", children: [
6957
+ /* @__PURE__ */ jsx32(
6588
6958
  Input,
6589
6959
  {
6590
6960
  label: "Name",
@@ -6593,7 +6963,7 @@ function SuiteClientsProjectsDirectory({
6593
6963
  onChange: (event) => setDraft(__spreadProps(__spreadValues({}, draft), { name: event.target.value }))
6594
6964
  }
6595
6965
  ),
6596
- /* @__PURE__ */ jsx31(
6966
+ /* @__PURE__ */ jsx32(
6597
6967
  DirectoryIconPicker,
6598
6968
  {
6599
6969
  preview,
@@ -6604,10 +6974,10 @@ function SuiteClientsProjectsDirectory({
6604
6974
  onBrowse: () => setLibraryOpen(true)
6605
6975
  }
6606
6976
  ),
6607
- /* @__PURE__ */ jsxs25("div", { children: [
6608
- /* @__PURE__ */ jsx31("span", { className: "mb-1.5 block text-sm font-medium text-ph-ink", children: "Colour" }),
6609
- /* @__PURE__ */ jsxs25("div", { className: "flex flex-wrap items-center gap-2", children: [
6610
- /* @__PURE__ */ jsx31(
6977
+ /* @__PURE__ */ jsxs26("div", { children: [
6978
+ /* @__PURE__ */ jsx32("span", { className: "mb-1.5 block text-sm font-medium text-ph-ink", children: "Colour" }),
6979
+ /* @__PURE__ */ jsxs26("div", { className: "flex flex-wrap items-center gap-2", children: [
6980
+ /* @__PURE__ */ jsx32(
6611
6981
  "button",
6612
6982
  {
6613
6983
  type: "button",
@@ -6619,7 +6989,7 @@ function SuiteClientsProjectsDirectory({
6619
6989
  "flex h-8 w-8 items-center justify-center rounded-full border border-ph-border bg-ph-surface text-ph-mutedtext ring-offset-2",
6620
6990
  !draft.color && "ring-2 ring-ph-brand"
6621
6991
  ),
6622
- children: /* @__PURE__ */ jsx31(Prohibition, { className: "h-4 w-4", "aria-hidden": true })
6992
+ children: /* @__PURE__ */ jsx32(Prohibition, { className: "h-4 w-4", "aria-hidden": true })
6623
6993
  }
6624
6994
  ),
6625
6995
  [
@@ -6630,7 +7000,7 @@ function SuiteClientsProjectsDirectory({
6630
7000
  "#ef4444",
6631
7001
  "#a855f7",
6632
7002
  "#64748b"
6633
- ].map((color) => /* @__PURE__ */ jsx31(
7003
+ ].map((color) => /* @__PURE__ */ jsx32(
6634
7004
  "button",
6635
7005
  {
6636
7006
  type: "button",
@@ -6645,7 +7015,7 @@ function SuiteClientsProjectsDirectory({
6645
7015
  },
6646
7016
  color
6647
7017
  )),
6648
- /* @__PURE__ */ jsxs25(
7018
+ /* @__PURE__ */ jsxs26(
6649
7019
  "label",
6650
7020
  {
6651
7021
  className: cn(
@@ -6665,7 +7035,7 @@ function SuiteClientsProjectsDirectory({
6665
7035
  },
6666
7036
  title: "Custom colour",
6667
7037
  children: [
6668
- /* @__PURE__ */ jsx31("span", { className: "flex h-4 w-4 items-center justify-center rounded-full bg-ph-surface", children: [
7038
+ /* @__PURE__ */ jsx32("span", { className: "flex h-4 w-4 items-center justify-center rounded-full bg-ph-surface", children: [
6669
7039
  "#6366f1",
6670
7040
  "#0ea5e9",
6671
7041
  "#10b981",
@@ -6673,14 +7043,14 @@ function SuiteClientsProjectsDirectory({
6673
7043
  "#ef4444",
6674
7044
  "#a855f7",
6675
7045
  "#64748b"
6676
- ].includes(draft.color) ? /* @__PURE__ */ jsx31(Plus2, { className: "h-3 w-3 text-ph-ink", "aria-hidden": true }) : /* @__PURE__ */ jsx31(
7046
+ ].includes(draft.color) ? /* @__PURE__ */ jsx32(Plus2, { className: "h-3 w-3 text-ph-ink", "aria-hidden": true }) : /* @__PURE__ */ jsx32(
6677
7047
  "span",
6678
7048
  {
6679
7049
  className: "h-2.5 w-2.5 rounded-full",
6680
7050
  style: { backgroundColor: draft.color }
6681
7051
  }
6682
7052
  ) }),
6683
- /* @__PURE__ */ jsx31(
7053
+ /* @__PURE__ */ jsx32(
6684
7054
  "input",
6685
7055
  {
6686
7056
  type: "color",
@@ -6695,20 +7065,20 @@ function SuiteClientsProjectsDirectory({
6695
7065
  )
6696
7066
  ] })
6697
7067
  ] }),
6698
- (editing == null ? void 0 : editing.kind.includes("project")) ? /* @__PURE__ */ jsxs25(
7068
+ (editing == null ? void 0 : editing.kind.includes("project")) ? /* @__PURE__ */ jsxs26(
6699
7069
  Select,
6700
7070
  {
6701
7071
  label: "Client",
6702
7072
  value: draftClientId != null ? draftClientId : "",
6703
7073
  onChange: (event) => setDraftClientId(event.target.value || null),
6704
7074
  children: [
6705
- /* @__PURE__ */ jsx31("option", { value: "", children: "No client" }),
6706
- clients.map((client) => /* @__PURE__ */ jsx31("option", { value: client.id, children: client.name }, client.id))
7075
+ /* @__PURE__ */ jsx32("option", { value: "", children: "No client" }),
7076
+ clients.map((client) => /* @__PURE__ */ jsx32("option", { value: client.id, children: client.name }, client.id))
6707
7077
  ]
6708
7078
  }
6709
7079
  ) : null,
6710
- (editing == null ? void 0 : editing.kind.includes("project")) ? /* @__PURE__ */ jsxs25("label", { className: "flex items-center gap-2 text-sm text-ph-ink", children: [
6711
- /* @__PURE__ */ jsx31(
7080
+ (editing == null ? void 0 : editing.kind.includes("project")) ? /* @__PURE__ */ jsxs26("label", { className: "flex items-center gap-2 text-sm text-ph-ink", children: [
7081
+ /* @__PURE__ */ jsx32(
6712
7082
  "input",
6713
7083
  {
6714
7084
  type: "checkbox",
@@ -6721,26 +7091,26 @@ function SuiteClientsProjectsDirectory({
6721
7091
  ] })
6722
7092
  }
6723
7093
  ),
6724
- libraryOpen ? /* @__PURE__ */ jsx31(
7094
+ libraryOpen ? /* @__PURE__ */ jsx32(
6725
7095
  Modal,
6726
7096
  {
6727
7097
  open: true,
6728
7098
  onClose: () => setLibraryOpen(false),
6729
7099
  title: "Icon library",
6730
- children: renderIconLibrary ? renderIconLibrary({ onPick: pickFromLibrary }) : /* @__PURE__ */ jsx31(SuitePaletteLibrary, { onPick: pickFromLibrary })
7100
+ children: renderIconLibrary ? renderIconLibrary({ onPick: pickFromLibrary }) : /* @__PURE__ */ jsx32(SuitePaletteLibrary, { onPick: pickFromLibrary })
6731
7101
  }
6732
7102
  ) : null,
6733
- /* @__PURE__ */ jsx31(
7103
+ /* @__PURE__ */ jsx32(
6734
7104
  Modal,
6735
7105
  {
6736
7106
  open: confirming !== null,
6737
7107
  onClose: () => setConfirming(null),
6738
7108
  title: "Confirm deletion",
6739
- footer: /* @__PURE__ */ jsxs25("div", { className: "flex justify-end gap-2", children: [
6740
- /* @__PURE__ */ jsx31(Button, { variant: "tertiary", onClick: () => setConfirming(null), children: "Cancel" }),
6741
- /* @__PURE__ */ jsx31(Button, { variant: "primary", onClick: () => void confirmRemove(), children: "Delete" })
7109
+ footer: /* @__PURE__ */ jsxs26("div", { className: "flex justify-end gap-2", children: [
7110
+ /* @__PURE__ */ jsx32(Button, { variant: "tertiary", onClick: () => setConfirming(null), children: "Cancel" }),
7111
+ /* @__PURE__ */ jsx32(Button, { variant: "primary", onClick: () => void confirmRemove(), children: "Delete" })
6742
7112
  ] }),
6743
- children: /* @__PURE__ */ jsxs25("p", { className: "text-sm text-ph-ink", children: [
7113
+ children: /* @__PURE__ */ jsxs26("p", { className: "text-sm text-ph-ink", children: [
6744
7114
  "Delete ",
6745
7115
  confirming == null ? void 0 : confirming.item.name,
6746
7116
  "? This cannot be undone."
@@ -6764,6 +7134,7 @@ export {
6764
7134
  SIDEBAR_MAX_WIDTH,
6765
7135
  SIDEBAR_MIN_EXPANDED_WIDTH,
6766
7136
  SIDEBAR_RAIL_WIDTH,
7137
+ SUITE_ANALYTICS_EVENT,
6767
7138
  SUITE_APPS2 as SUITE_APPS,
6768
7139
  SUITE_APP_MAP,
6769
7140
  SUITE_ASK_AI_OPEN_KEY,
@@ -6778,6 +7149,7 @@ export {
6778
7149
  SUITE_SPRINGS,
6779
7150
  SUITE_THEME_COOKIE,
6780
7151
  SourceAppGlyph,
7152
+ SuiteAiDraftEditor,
6781
7153
  SuiteAiPanel,
6782
7154
  SuiteAppIcon,
6783
7155
  SuiteAppLayout,
@@ -6846,9 +7218,12 @@ export {
6846
7218
  resolveSuiteNotificationHref,
6847
7219
  sidebarColumnWidth,
6848
7220
  sourceToSuiteApp,
7221
+ subscribeSuiteAnalytics,
7222
+ suiteAiDraftFields,
6849
7223
  suiteAppBaseUrl,
6850
7224
  suiteAppLabel,
6851
7225
  suiteThemeBootScript,
7226
+ trackSuiteEvent,
6852
7227
  useIdleMount,
6853
7228
  useSidebarWidth,
6854
7229
  useSuiteNotifications,