@burdenoff/microfe-subscriberbot 2026.1102.4 → 2026.1102.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (80) hide show
  1. package/dist/stories/pages/DashboardPage.stories.d.ts +4 -0
  2. package/dist/stories/pages/DashboardPage.stories.d.ts.map +1 -1
  3. package/dist/stories/pages/RelationshipsListPage.stories.d.ts +5 -0
  4. package/dist/stories/pages/RelationshipsListPage.stories.d.ts.map +1 -1
  5. package/dist/stories/pages/WorkflowBuilderPage.stories.d.ts +14 -0
  6. package/dist/stories/pages/WorkflowBuilderPage.stories.d.ts.map +1 -0
  7. package/dist/stories/pages/WorkflowsPage.stories.d.ts +1 -0
  8. package/dist/stories/pages/WorkflowsPage.stories.d.ts.map +1 -1
  9. package/dist/stories/support/fixtures.d.ts +6 -1
  10. package/dist/stories/support/fixtures.d.ts.map +1 -1
  11. package/dist/stories/support/handlers.d.ts.map +1 -1
  12. package/dist/stories/support/phoneViewport.d.ts +4 -0
  13. package/dist/stories/support/phoneViewport.d.ts.map +1 -0
  14. package/dist/subscriberbot/SubscriberBotRoutes.d.ts.map +1 -1
  15. package/dist/subscriberbot/SubscriberBotRoutes.js +27 -23
  16. package/dist/subscriberbot/SubscriberBotRoutes.js.map +1 -1
  17. package/dist/subscriberbot/components/PageLayout.d.ts.map +1 -1
  18. package/dist/subscriberbot/components/PageLayout.js +3 -3
  19. package/dist/subscriberbot/components/PageLayout.js.map +1 -1
  20. package/dist/subscriberbot/components/mobile/MobileDashboard.d.ts +18 -0
  21. package/dist/subscriberbot/components/mobile/MobileDashboard.d.ts.map +1 -0
  22. package/dist/subscriberbot/components/mobile/MobileDashboard.js +247 -0
  23. package/dist/subscriberbot/components/mobile/MobileDashboard.js.map +1 -0
  24. package/dist/subscriberbot/components/mobile/MobileRelationshipList.d.ts +10 -0
  25. package/dist/subscriberbot/components/mobile/MobileRelationshipList.d.ts.map +1 -0
  26. package/dist/subscriberbot/components/mobile/MobileRelationshipList.js +217 -0
  27. package/dist/subscriberbot/components/mobile/MobileRelationshipList.js.map +1 -0
  28. package/dist/subscriberbot/components/mobile/MobileScreen.d.ts +26 -0
  29. package/dist/subscriberbot/components/mobile/MobileScreen.d.ts.map +1 -0
  30. package/dist/subscriberbot/components/mobile/MobileScreen.js +46 -0
  31. package/dist/subscriberbot/components/mobile/MobileScreen.js.map +1 -0
  32. package/dist/subscriberbot/components/mobile/RelationshipGlyph.d.ts +10 -0
  33. package/dist/subscriberbot/components/mobile/RelationshipGlyph.d.ts.map +1 -0
  34. package/dist/subscriberbot/components/mobile/RelationshipGlyph.js +25 -0
  35. package/dist/subscriberbot/components/mobile/RelationshipGlyph.js.map +1 -0
  36. package/dist/subscriberbot/components/mobile/index.d.ts +9 -0
  37. package/dist/subscriberbot/components/mobile/index.d.ts.map +1 -0
  38. package/dist/subscriberbot/components/mobile/index.js +4 -0
  39. package/dist/subscriberbot/hooks/index.d.ts +1 -0
  40. package/dist/subscriberbot/hooks/index.d.ts.map +1 -1
  41. package/dist/subscriberbot/hooks/index.js +1 -0
  42. package/dist/subscriberbot/hooks/useCompactViewport.d.ts +13 -0
  43. package/dist/subscriberbot/hooks/useCompactViewport.d.ts.map +1 -0
  44. package/dist/subscriberbot/hooks/useCompactViewport.js +21 -0
  45. package/dist/subscriberbot/hooks/useCompactViewport.js.map +1 -0
  46. package/dist/subscriberbot/hooks/useSubscriberBotApi.d.ts +10 -1
  47. package/dist/subscriberbot/hooks/useSubscriberBotApi.d.ts.map +1 -1
  48. package/dist/subscriberbot/hooks/useSubscriberBotApi.js +113 -79
  49. package/dist/subscriberbot/hooks/useSubscriberBotApi.js.map +1 -1
  50. package/dist/subscriberbot/pages/DashboardPage.d.ts.map +1 -1
  51. package/dist/subscriberbot/pages/DashboardPage.js +166 -189
  52. package/dist/subscriberbot/pages/DashboardPage.js.map +1 -1
  53. package/dist/subscriberbot/pages/WorkflowsPage.d.ts +4 -4
  54. package/dist/subscriberbot/pages/WorkflowsPage.d.ts.map +1 -1
  55. package/dist/subscriberbot/pages/WorkflowsPage.js +201 -190
  56. package/dist/subscriberbot/pages/WorkflowsPage.js.map +1 -1
  57. package/dist/subscriberbot/pages/relationships/RelationshipDetailPage.d.ts.map +1 -1
  58. package/dist/subscriberbot/pages/relationships/RelationshipDetailPage.js +120 -119
  59. package/dist/subscriberbot/pages/relationships/RelationshipDetailPage.js.map +1 -1
  60. package/dist/subscriberbot/pages/relationships/RelationshipsListPage.d.ts.map +1 -1
  61. package/dist/subscriberbot/pages/relationships/RelationshipsListPage.js +226 -212
  62. package/dist/subscriberbot/pages/relationships/RelationshipsListPage.js.map +1 -1
  63. package/dist/subscriberbot/pages/workflows/WorkflowBuilderPage.d.ts +3 -0
  64. package/dist/subscriberbot/pages/workflows/WorkflowBuilderPage.d.ts.map +1 -0
  65. package/dist/subscriberbot/pages/workflows/WorkflowBuilderPage.js +648 -0
  66. package/dist/subscriberbot/pages/workflows/WorkflowBuilderPage.js.map +1 -0
  67. package/dist/subscriberbot/pages/workflows/workflowBuilderGraph.d.ts +60 -0
  68. package/dist/subscriberbot/pages/workflows/workflowBuilderGraph.d.ts.map +1 -0
  69. package/dist/subscriberbot/pages/workflows/workflowBuilderGraph.js +122 -0
  70. package/dist/subscriberbot/pages/workflows/workflowBuilderGraph.js.map +1 -0
  71. package/dist/subscriberbot/types/index.d.ts +65 -0
  72. package/dist/subscriberbot/types/index.d.ts.map +1 -1
  73. package/dist/subscriberbot/utils/pageContext.d.ts.map +1 -1
  74. package/dist/subscriberbot/utils/pageContext.js +21 -13
  75. package/dist/subscriberbot/utils/pageContext.js.map +1 -1
  76. package/dist/subscriberbot/utils/portfolio.d.ts +106 -0
  77. package/dist/subscriberbot/utils/portfolio.d.ts.map +1 -0
  78. package/dist/subscriberbot/utils/portfolio.js +151 -0
  79. package/dist/subscriberbot/utils/portfolio.js.map +1 -0
  80. package/package.json +3 -1
@@ -8,14 +8,15 @@ import { useTr as l } from "../../hooks/useTr.js";
8
8
  import { ErrorView as u, LoadingView as d, Section as f } from "../../components/StateViews.js";
9
9
  import { Gauge as p, MiniProgress as m, Timeline as h } from "../../components/viz.js";
10
10
  import "../../components/index.js";
11
- import { useCancelRelationship as g, useCreateAsset as _, useCreateEntitlement as v, useDecisions as y, useFileDownloadUrl as b, useInvoices as x, usePlans as S, useProviders as C, useRelationship as ee, useTransitionRelationship as w, useUpdateRelationship as T, useUploadFile as E } from "../../hooks/useSubscriberBotApi.js";
12
- import { DecisionCard as D } from "../../components/decisions/DecisionCard.js";
13
- import { AiDisclaimer as O } from "../../components/decisions/DecisionBanners.js";
11
+ import { useCancelRelationship as g, useCreateAsset as _, useCreateEntitlement as v, useDecisions as y, useFileDownloadUrl as b, useInvoices as x, usePlans as S, useProviders as C, useRelationship as w, useTransitionRelationship as T, useUpdateRelationship as E, useUploadFile as D } from "../../hooks/useSubscriberBotApi.js";
12
+ import { canTransition as O } from "../../utils/portfolio.js";
13
+ import { DecisionCard as k } from "../../components/decisions/DecisionCard.js";
14
+ import { AiDisclaimer as A } from "../../components/decisions/DecisionBanners.js";
14
15
  import "../../components/decisions/index.js";
15
- import { useState as k } from "react";
16
- import { Activity as A, ArrowLeft as j, Ban as M, Briefcase as N, CalendarClock as P, CreditCard as F, Download as I, Handshake as te, Paperclip as L, Pause as R, Pencil as ne, Play as z, Plus as B, ShieldCheck as re, Tag as ie, Wallet as ae } from "lucide-react";
17
- import { useParams as oe } from "react-router";
18
- import { Fragment as se, jsx as V, jsxs as H } from "react/jsx-runtime";
16
+ import { useState as j } from "react";
17
+ import { Activity as M, ArrowLeft as ee, Ban as N, Briefcase as P, CalendarClock as F, CreditCard as I, Download as L, Handshake as te, Paperclip as R, Pause as z, Pencil as ne, Play as B, Plus as re, ShieldCheck as ie, Tag as ae, Wallet as oe } from "lucide-react";
18
+ import { useParams as se } from "react-router";
19
+ import { Fragment as ce, jsx as V, jsxs as H } from "react/jsx-runtime";
19
20
  import { GlassCard as U } from "@burdenoff/fe-libs/ui";
20
21
  //#region src/subscriberbot/pages/relationships/RelationshipDetailPage.tsx
21
22
  var W = "w-full rounded-lg border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary placeholder:text-text-secondary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]", G = "mb-1 block text-xs font-medium text-text-secondary", K = [
@@ -52,24 +53,24 @@ var W = "w-full rounded-lg border border-border-subtle bg-bg-surface px-3 py-2 t
52
53
  RECURRING_PAYMENT: "relationships.kinds.recurringPayment",
53
54
  ENROLLMENT: "relationships.kinds.enrollment",
54
55
  TRIAL: "relationships.kinds.trial"
55
- }, ce = [
56
+ }, le = [
56
57
  {
57
58
  status: "ACTIVE",
58
59
  labelKey: "relationships.detail.actions.activate",
59
60
  defaultLabel: "Activate",
60
- icon: z
61
+ icon: B
61
62
  },
62
63
  {
63
64
  status: "PAUSED",
64
65
  labelKey: "relationships.detail.actions.pause",
65
66
  defaultLabel: "Pause",
66
- icon: R
67
+ icon: z
67
68
  },
68
69
  {
69
70
  status: "EXPIRED",
70
71
  labelKey: "relationships.detail.actions.markExpired",
71
72
  defaultLabel: "Mark expired",
72
- icon: M
73
+ icon: N
73
74
  }
74
75
  ];
75
76
  function X({ label: e, value: t }) {
@@ -84,30 +85,30 @@ function X({ label: e, value: t }) {
84
85
  })]
85
86
  });
86
87
  }
87
- function le(e) {
88
+ function ue(e) {
88
89
  return e == null ? "accent" : e >= 66 ? "positive" : e >= 33 ? "warning" : "negative";
89
90
  }
90
- function Z(e) {
91
+ function de(e) {
91
92
  if (!e) return "";
92
93
  let t = new Date(e);
93
94
  return Number.isNaN(t.getTime()) ? "" : t.toISOString().slice(0, 10);
94
95
  }
95
- function ue({ relationship: e, onClose: t }) {
96
- let n = l(), r = T(), i = C({ pagination: {
96
+ function fe({ relationship: e, onClose: t }) {
97
+ let n = l(), r = E(), i = C({ pagination: {
97
98
  limit: 100,
98
99
  offset: 0
99
- } }), [a, o] = k(e.label), [s, u] = k(e.providerId ?? ""), [d, f] = k(e.planId ?? ""), [p, m] = k(String(e.amount ?? "")), [h, g] = k(e.currency), [_, v] = k(e.interval), [y, b] = k(Z(e.renewsAt)), [x, ee] = k(e.autoRenew), [w, E] = k(e.notes ?? ""), [D, O] = k(e.department ?? ""), [A, j] = k(null), M = S(s || void 0), N = (() => {
100
+ } }), [a, o] = j(e.label), [s, u] = j(e.providerId ?? ""), [d, f] = j(e.planId ?? ""), [p, m] = j(String(e.amount ?? "")), [h, g] = j(e.currency), [_, v] = j(e.interval), [y, b] = j(de(e.renewsAt)), [x, w] = j(e.autoRenew), [T, D] = j(e.notes ?? ""), [O, k] = j(e.department ?? ""), [A, M] = j(null), ee = S(s || void 0), N = (() => {
100
101
  let t = i.data?.items ?? [];
101
102
  return e.provider && !t.some((t) => t.id === e.provider?.id) ? [e.provider, ...t] : t;
102
- })(), P = M.data ?? [];
103
+ })(), P = ee.data ?? [];
103
104
  return /* @__PURE__ */ V(c, {
104
105
  title: n("relationships.detail.editModal.title", "Edit relationship"),
105
106
  onClose: t,
106
107
  maxWidthClassName: "max-w-2xl",
107
108
  children: /* @__PURE__ */ H("form", {
108
109
  onSubmit: (i) => {
109
- if (i.preventDefault(), j(null), !a.trim()) {
110
- j(n("relationships.detail.editModal.labelRequired", "A label is required."));
110
+ if (i.preventDefault(), M(null), !a.trim()) {
111
+ M(n("relationships.detail.editModal.labelRequired", "A label is required."));
111
112
  return;
112
113
  }
113
114
  let o = {
@@ -115,8 +116,8 @@ function ue({ relationship: e, onClose: t }) {
115
116
  interval: _,
116
117
  autoRenew: x,
117
118
  currency: h.trim() || "USD",
118
- notes: w.trim(),
119
- department: D.trim(),
119
+ notes: T.trim(),
120
+ department: O.trim(),
120
121
  ...s ? { providerId: s } : {},
121
122
  ...d ? { planId: d } : {},
122
123
  ...p.trim() ? { amount: Number(p) } : {},
@@ -127,7 +128,7 @@ function ue({ relationship: e, onClose: t }) {
127
128
  input: o
128
129
  }, {
129
130
  onSuccess: () => t(),
130
- onError: (e) => j(e instanceof Error ? e.message : n("relationships.detail.editModal.error", "Could not update relationship."))
131
+ onError: (e) => M(e instanceof Error ? e.message : n("relationships.detail.editModal.error", "Could not update relationship."))
131
132
  });
132
133
  },
133
134
  className: "space-y-4",
@@ -163,8 +164,8 @@ function ue({ relationship: e, onClose: t }) {
163
164
  id: "edit-department",
164
165
  type: "text",
165
166
  maxLength: 120,
166
- value: D,
167
- onChange: (e) => O(e.target.value),
167
+ value: O,
168
+ onChange: (e) => k(e.target.value),
168
169
  placeholder: n("relationships.detail.editModal.departmentPlaceholder", "e.g. Engineering, Marketing"),
169
170
  className: W
170
171
  })] }),
@@ -270,7 +271,7 @@ function ue({ relationship: e, onClose: t }) {
270
271
  children: [/* @__PURE__ */ V("input", {
271
272
  type: "checkbox",
272
273
  checked: x,
273
- onChange: (e) => ee(e.target.checked),
274
+ onChange: (e) => w(e.target.checked),
274
275
  className: "size-4 rounded border-border-subtle"
275
276
  }), n("relationships.detail.editModal.autoRenews", "Auto-renews")]
276
277
  })
@@ -282,8 +283,8 @@ function ue({ relationship: e, onClose: t }) {
282
283
  children: n("relationships.detail.editModal.notesLabel", "Notes")
283
284
  }), /* @__PURE__ */ V("textarea", {
284
285
  id: "edit-notes",
285
- value: w,
286
- onChange: (e) => E(e.target.value),
286
+ value: T,
287
+ onChange: (e) => D(e.target.value),
287
288
  rows: 3,
288
289
  className: W
289
290
  })] }),
@@ -305,8 +306,8 @@ function ue({ relationship: e, onClose: t }) {
305
306
  })
306
307
  });
307
308
  }
308
- function de({ relationshipId: e, onClose: t }) {
309
- let n = l(), r = v(), [i, a] = k(""), [o, s] = k("FEATURE_ACCESS"), [u, d] = k(""), [f, p] = k(""), [m, h] = k(""), [g, _] = k(null);
309
+ function pe({ relationshipId: e, onClose: t }) {
310
+ let n = l(), r = v(), [i, a] = j(""), [o, s] = j("FEATURE_ACCESS"), [u, d] = j(""), [f, p] = j(""), [m, h] = j(""), [g, _] = j(null);
310
311
  return /* @__PURE__ */ V(c, {
311
312
  title: n("relationships.detail.addEntitlementModal.title", "Add entitlement"),
312
313
  onClose: t,
@@ -427,8 +428,8 @@ function de({ relationshipId: e, onClose: t }) {
427
428
  })
428
429
  });
429
430
  }
430
- function fe({ relationshipId: e, onClose: t }) {
431
- let n = l(), r = _(), { uploadFile: i, progress: a, isUploading: o } = E(), [s, u] = k(""), [d, f] = k("RECEIPT"), [p, m] = k(null), [h, g] = k(""), [v, y] = k(null), b = o || r.isPending;
431
+ function me({ relationshipId: e, onClose: t }) {
432
+ let n = l(), r = _(), { uploadFile: i, progress: a, isUploading: o } = D(), [s, u] = j(""), [d, f] = j("RECEIPT"), [p, m] = j(null), [h, g] = j(""), [v, y] = j(null), b = o || r.isPending;
432
433
  return /* @__PURE__ */ V(c, {
433
434
  title: n("relationships.detail.attachAssetModal.title", "Attach asset"),
434
435
  onClose: t,
@@ -545,13 +546,13 @@ function fe({ relationshipId: e, onClose: t }) {
545
546
  })
546
547
  });
547
548
  }
548
- function pe({ asset: e }) {
549
- let t = l(), n = b(), [a, o] = k(!1);
549
+ function he({ asset: e }) {
550
+ let t = l(), n = b(), [a, o] = j(!1);
550
551
  return /* @__PURE__ */ H("div", {
551
552
  className: "flex items-center justify-between gap-3 p-3",
552
553
  children: [/* @__PURE__ */ H("div", {
553
554
  className: "flex min-w-0 items-center gap-2",
554
- children: [/* @__PURE__ */ V(L, { className: "h-4 w-4 shrink-0 text-text-secondary" }), /* @__PURE__ */ H("div", {
555
+ children: [/* @__PURE__ */ V(R, { className: "h-4 w-4 shrink-0 text-text-secondary" }), /* @__PURE__ */ H("div", {
555
556
  className: "min-w-0",
556
557
  children: [/* @__PURE__ */ V("p", {
557
558
  className: "truncate text-sm font-medium text-text-primary",
@@ -582,7 +583,7 @@ function pe({ asset: e }) {
582
583
  disabled: a,
583
584
  className: "inline-flex items-center gap-1 rounded-lg border border-border-subtle px-2.5 py-1 text-xs font-medium text-text-primary hover:bg-bg-sunken disabled:opacity-50",
584
585
  children: [
585
- /* @__PURE__ */ V(I, { className: "h-3.5 w-3.5" }),
586
+ /* @__PURE__ */ V(L, { className: "h-3.5 w-3.5" }),
586
587
  " ",
587
588
  a ? t("relationships.detail.assetRow.opening", "Opening…") : t("relationships.detail.assetRow.download", "Download")
588
589
  ]
@@ -590,13 +591,13 @@ function pe({ asset: e }) {
590
591
  })]
591
592
  });
592
593
  }
593
- function me({ invoice: e }) {
594
+ function ge({ invoice: e }) {
594
595
  let t = l(), a = e.number ?? t("relationships.detail.invoiceRow.unnumbered", "Unnumbered invoice");
595
596
  return /* @__PURE__ */ H("div", {
596
597
  className: "flex items-center justify-between gap-3 p-3",
597
598
  children: [/* @__PURE__ */ H("div", {
598
599
  className: "flex min-w-0 items-center gap-2",
599
- children: [/* @__PURE__ */ V(F, { className: "h-4 w-4 shrink-0 text-text-secondary" }), /* @__PURE__ */ H("div", {
600
+ children: [/* @__PURE__ */ V(I, { className: "h-4 w-4 shrink-0 text-text-secondary" }), /* @__PURE__ */ H("div", {
600
601
  className: "min-w-0",
601
602
  children: [/* @__PURE__ */ V("p", {
602
603
  className: "truncate text-sm font-medium text-text-primary",
@@ -612,14 +613,14 @@ function me({ invoice: e }) {
612
613
  })]
613
614
  });
614
615
  }
615
- function Q() {
616
- let c = l(), { id: _ } = oe(), { navigateTo: v } = e(), { data: b, isLoading: S, isError: C, refetch: T } = ee(_), E = w(), I = g(), [L, R] = k(null), [z, W] = k(!1), [G, K] = k(!1), [q, J] = k(!1), Z = x({
616
+ function Z() {
617
+ let c = l(), { id: _ } = se(), { navigateTo: v } = e(), { data: b, isLoading: S, isError: C, refetch: E } = w(_), D = T(), L = g(), [R, z] = j(null), [B, W] = j(!1), [G, K] = j(!1), [q, J] = j(!1), de = x({
617
618
  relationshipId: _,
618
619
  pagination: {
619
620
  limit: 50,
620
621
  offset: 0
621
622
  }
622
- }, { enabled: !!_ }), Q = y({
623
+ }, { enabled: !!_ }), Z = y({
623
624
  relationshipId: _,
624
625
  status: "PROPOSED"
625
626
  }, { enabled: !!_ });
@@ -631,7 +632,7 @@ function Q() {
631
632
  title: c("relationships.title", "Relationship"),
632
633
  children: /* @__PURE__ */ V(u, {
633
634
  message: c("relationships.detail.error", "Could not load this relationship."),
634
- onRetry: () => void T()
635
+ onRetry: () => void E()
635
636
  })
636
637
  });
637
638
  if (!b) return /* @__PURE__ */ V(t, {
@@ -648,31 +649,31 @@ function Q() {
648
649
  })
649
650
  })
650
651
  });
651
- let $ = b, he = E.isPending || I.isPending, ge = (e) => {
652
- R(null), E.mutate({
653
- id: $.id,
652
+ let Q = b, _e = D.isPending || L.isPending, ve = (e) => {
653
+ z(null), D.mutate({
654
+ id: Q.id,
654
655
  status: e
655
- }, { onError: (e) => R(e instanceof Error ? e.message : c("relationships.detail.transitionError", "Transition failed")) });
656
- }, _e = () => {
657
- R(null), I.mutate($.id, { onError: (e) => R(e instanceof Error ? e.message : c("relationships.detail.cancelError", "Cancel failed")) });
658
- }, ve = [...$.renewalEvents ?? []].sort((e, t) => new Date(e.occursAt).getTime() - new Date(t.occursAt).getTime()).map((e) => {
656
+ }, { onError: (e) => z(e instanceof Error ? e.message : c("relationships.detail.transitionError", "Transition failed")) });
657
+ }, ye = () => {
658
+ z(null), L.mutate(Q.id, { onError: (e) => z(e instanceof Error ? e.message : c("relationships.detail.cancelError", "Cancel failed")) });
659
+ }, be = [...Q.renewalEvents ?? []].sort((e, t) => new Date(e.occursAt).getTime() - new Date(t.occursAt).getTime()).map((e) => {
659
660
  let t = new Date(e.occursAt).getTime(), a = !Number.isNaN(t) && t > Date.now();
660
661
  return {
661
662
  title: i(e.eventType),
662
663
  sub: `${r(e.occursAt)}${e.detail ? ` · ${e.detail}` : ""}`,
663
- meta: e.amount == null ? void 0 : n(e.amount, e.currency ?? $.currency),
664
+ meta: e.amount == null ? void 0 : n(e.amount, e.currency ?? Q.currency),
664
665
  tone: a ? "warning" : "muted"
665
666
  };
666
- }), ye = $.autoRenew ? /* @__PURE__ */ V("span", {
667
+ }), xe = Q.autoRenew ? /* @__PURE__ */ V("span", {
667
668
  className: "inline-flex items-center rounded-full bg-status-success-bg-subtle px-2 py-0.5 text-xs font-medium text-status-success-text",
668
669
  children: c("relationships.detail.autoRenewOn", "On")
669
670
  }) : /* @__PURE__ */ V("span", {
670
671
  className: "inline-flex items-center rounded-full bg-bg-sunken px-2 py-0.5 text-xs font-medium text-text-secondary",
671
672
  children: c("relationships.detail.autoRenewOff", "Off")
672
- }), be = ce.filter((e) => e.status !== $.status), xe = $.plan?.features ?? [];
673
+ }), Se = le.filter((e) => O(Q.status, e.status)), $ = Q.plan?.features ?? [];
673
674
  return /* @__PURE__ */ H(t, {
674
- title: $.label,
675
- description: $.provider?.name ?? c(Y[$.kind], i($.kind)),
675
+ title: Q.label,
676
+ description: Q.provider?.name ?? c(Y[Q.kind], i(Q.kind)),
676
677
  actions: /* @__PURE__ */ H("div", {
677
678
  className: "flex items-center gap-2",
678
679
  children: [
@@ -689,7 +690,7 @@ function Q() {
689
690
  /* @__PURE__ */ H("button", {
690
691
  type: "button",
691
692
  "data-testid": "negotiate-bill",
692
- onClick: () => v(`/negotiations/new?relationshipId=${encodeURIComponent($.id)}`),
693
+ onClick: () => v(`/negotiations/new?relationshipId=${encodeURIComponent(Q.id)}`),
693
694
  className: "inline-flex items-center gap-2 rounded-lg border border-border-subtle px-3 py-2 text-sm font-medium text-text-primary hover:bg-bg-sunken",
694
695
  children: [
695
696
  /* @__PURE__ */ V(te, { className: "h-4 w-4" }),
@@ -700,10 +701,10 @@ function Q() {
700
701
  /* @__PURE__ */ H("button", {
701
702
  type: "button",
702
703
  "data-testid": "request-procurement",
703
- onClick: () => v(`/procurement/new?relationshipId=${encodeURIComponent($.id)}`),
704
+ onClick: () => v(`/procurement/new?relationshipId=${encodeURIComponent(Q.id)}`),
704
705
  className: "inline-flex items-center gap-2 rounded-lg border border-border-subtle px-3 py-2 text-sm font-medium text-text-primary hover:bg-bg-sunken",
705
706
  children: [
706
- /* @__PURE__ */ V(N, { className: "h-4 w-4" }),
707
+ /* @__PURE__ */ V(P, { className: "h-4 w-4" }),
707
708
  " ",
708
709
  c("relationships.detail.procurement", "Ask an expert to negotiate")
709
710
  ]
@@ -713,7 +714,7 @@ function Q() {
713
714
  onClick: () => v("/relationships"),
714
715
  className: "inline-flex items-center gap-2 rounded-lg border border-border-subtle px-3 py-2 text-sm font-medium text-text-primary hover:bg-bg-sunken",
715
716
  children: [
716
- /* @__PURE__ */ V(j, { className: "h-4 w-4" }),
717
+ /* @__PURE__ */ V(ee, { className: "h-4 w-4" }),
717
718
  " ",
718
719
  c("relationships.detail.back", "Back")
719
720
  ]
@@ -732,69 +733,69 @@ function Q() {
732
733
  children: [
733
734
  /* @__PURE__ */ V("p", {
734
735
  className: "text-xs font-medium uppercase tracking-wide text-text-secondary",
735
- children: c(Y[$.kind], i($.kind))
736
+ children: c(Y[Q.kind], i(Q.kind))
736
737
  }),
737
738
  /* @__PURE__ */ H("div", {
738
739
  className: "mt-2 flex flex-wrap items-center gap-3",
739
740
  children: [/* @__PURE__ */ H("span", {
740
741
  className: "text-3xl font-bold tabular-nums text-text-primary",
741
- children: [n($.amount, $.currency), /* @__PURE__ */ V("span", {
742
+ children: [n(Q.amount, Q.currency), /* @__PURE__ */ V("span", {
742
743
  className: "text-base font-normal text-text-secondary",
743
- children: a($.interval)
744
+ children: a(Q.interval)
744
745
  })]
745
- }), /* @__PURE__ */ V(o, { status: $.status })]
746
+ }), /* @__PURE__ */ V(o, { status: Q.status })]
746
747
  }),
747
748
  /* @__PURE__ */ H("div", {
748
749
  className: "mt-2 flex flex-wrap items-center gap-x-4 gap-y-1 text-sm text-text-secondary",
749
750
  children: [
750
751
  /* @__PURE__ */ H("span", {
751
752
  className: "inline-flex items-center gap-1.5",
752
- children: [/* @__PURE__ */ V(P, { className: "h-3.5 w-3.5" }), $.renewsAt ? c("relationships.detail.renews", "Renews {{date}}", { date: r($.renewsAt) }) : c("relationships.detail.noRenewalScheduled", "No renewal scheduled")]
753
+ children: [/* @__PURE__ */ V(F, { className: "h-3.5 w-3.5" }), Q.renewsAt ? c("relationships.detail.renews", "Renews {{date}}", { date: r(Q.renewsAt) }) : c("relationships.detail.noRenewalScheduled", "No renewal scheduled")]
753
754
  }),
754
755
  /* @__PURE__ */ H("span", {
755
756
  className: "inline-flex items-center gap-1.5",
756
- children: [/* @__PURE__ */ V(re, { className: "h-3.5 w-3.5" }), i($.discoverySource)]
757
+ children: [/* @__PURE__ */ V(ie, { className: "h-3.5 w-3.5" }), i(Q.discoverySource)]
757
758
  }),
758
759
  /* @__PURE__ */ H("span", {
759
760
  className: "inline-flex items-center gap-1.5",
760
761
  children: [
761
762
  c("relationships.detail.autoRenew", "Auto-renew"),
762
763
  " ",
763
- ye
764
+ xe
764
765
  ]
765
766
  })
766
767
  ]
767
768
  }),
768
- $.tags.length > 0 && /* @__PURE__ */ H("div", {
769
+ Q.tags.length > 0 && /* @__PURE__ */ H("div", {
769
770
  className: "mt-3 flex flex-wrap items-center gap-2",
770
- children: [/* @__PURE__ */ V(ie, { className: "h-3.5 w-3.5 text-text-secondary" }), $.tags.map((e) => /* @__PURE__ */ V("span", {
771
+ children: [/* @__PURE__ */ V(ae, { className: "h-3.5 w-3.5 text-text-secondary" }), Q.tags.map((e) => /* @__PURE__ */ V("span", {
771
772
  className: "rounded-full bg-bg-sunken px-2.5 py-0.5 text-xs text-text-secondary",
772
773
  children: e
773
774
  }, e))]
774
775
  })
775
776
  ]
776
777
  }), /* @__PURE__ */ H("div", {
777
- className: "flex shrink-0 flex-wrap gap-2 lg:flex-col lg:items-stretch",
778
- children: [be.map((e) => {
778
+ className: "grid shrink-0 grid-cols-2 gap-2 sm:flex sm:flex-wrap lg:flex-col lg:items-stretch",
779
+ children: [Se.map((e) => {
779
780
  let t = e.icon;
780
781
  return /* @__PURE__ */ H("button", {
781
782
  type: "button",
782
- disabled: he,
783
- onClick: () => ge(e.status),
784
- className: "inline-flex items-center justify-center gap-1.5 rounded-lg border border-border-subtle bg-bg-surface px-3 py-1.5 text-xs font-medium text-text-primary hover:bg-bg-sunken disabled:opacity-50",
783
+ disabled: _e,
784
+ onClick: () => ve(e.status),
785
+ className: "inline-flex min-h-11 items-center justify-center gap-1.5 rounded-lg border border-border-subtle bg-bg-surface px-3 py-1.5 text-sm sm:min-h-0 sm:text-xs font-medium text-text-primary hover:bg-bg-sunken disabled:opacity-50",
785
786
  children: [
786
787
  /* @__PURE__ */ V(t, { className: "h-3.5 w-3.5" }),
787
788
  " ",
788
789
  c(e.labelKey, e.defaultLabel)
789
790
  ]
790
791
  }, e.status);
791
- }), $.status !== "CANCELLED" && /* @__PURE__ */ H("button", {
792
+ }), O(Q.status, "CANCELLED") && /* @__PURE__ */ H("button", {
792
793
  type: "button",
793
- disabled: he,
794
- onClick: _e,
795
- className: "inline-flex items-center justify-center gap-1.5 rounded-lg border border-status-error-text/30 bg-status-error-bg-subtle px-3 py-1.5 text-xs font-medium text-status-error-text hover:opacity-90 disabled:opacity-50",
794
+ disabled: _e,
795
+ onClick: ye,
796
+ className: "inline-flex min-h-11 items-center justify-center gap-1.5 rounded-lg border border-status-error-text/30 bg-status-error-bg-subtle px-3 py-1.5 text-sm sm:min-h-0 sm:text-xs font-medium text-status-error-text hover:opacity-90 disabled:opacity-50",
796
797
  children: [
797
- /* @__PURE__ */ V(M, { className: "h-3.5 w-3.5" }),
798
+ /* @__PURE__ */ V(N, { className: "h-3.5 w-3.5" }),
798
799
  " ",
799
800
  c("relationships.detail.actions.cancel", "Cancel")
800
801
  ]
@@ -802,9 +803,9 @@ function Q() {
802
803
  })]
803
804
  })
804
805
  }),
805
- L && /* @__PURE__ */ V("div", {
806
+ R && /* @__PURE__ */ V("div", {
806
807
  className: "mt-4 rounded-lg border border-status-error-text/30 bg-status-error-bg-subtle px-4 py-2 text-sm text-status-error-text",
807
- children: L
808
+ children: R
808
809
  }),
809
810
  /* @__PURE__ */ H("div", {
810
811
  className: "mt-6 grid grid-cols-1 gap-4 lg:grid-cols-3",
@@ -820,7 +821,7 @@ function Q() {
820
821
  /* @__PURE__ */ H("div", {
821
822
  className: "flex items-center gap-2 text-sm font-semibold text-text-primary",
822
823
  children: [
823
- /* @__PURE__ */ V(F, { className: "h-4 w-4 text-text-secondary" }),
824
+ /* @__PURE__ */ V(I, { className: "h-4 w-4 text-text-secondary" }),
824
825
  " ",
825
826
  c("relationships.detail.sections.planPricing", "Plan & pricing")
826
827
  ]
@@ -830,28 +831,28 @@ function Q() {
830
831
  children: [
831
832
  /* @__PURE__ */ V(X, {
832
833
  label: c("relationships.detail.info.plan", "Plan"),
833
- value: $.plan?.name ?? "—"
834
+ value: Q.plan?.name ?? "—"
834
835
  }),
835
836
  /* @__PURE__ */ V(X, {
836
837
  label: c("relationships.detail.info.price", "Price"),
837
- value: /* @__PURE__ */ H(se, { children: [n($.amount, $.currency), /* @__PURE__ */ V("span", {
838
+ value: /* @__PURE__ */ H(ce, { children: [n(Q.amount, Q.currency), /* @__PURE__ */ V("span", {
838
839
  className: "font-normal text-text-secondary",
839
- children: a($.interval)
840
+ children: a(Q.interval)
840
841
  })] })
841
842
  }),
842
843
  /* @__PURE__ */ V(X, {
843
844
  label: c("relationships.detail.info.billingInterval", "Billing interval"),
844
- value: i($.interval)
845
+ value: i(Q.interval)
845
846
  }),
846
847
  /* @__PURE__ */ V(X, {
847
848
  label: c("relationships.detail.info.provider", "Provider"),
848
- value: $.provider?.name ?? "—"
849
+ value: Q.provider?.name ?? "—"
849
850
  })
850
851
  ]
851
852
  }),
852
- xe.length > 0 && /* @__PURE__ */ V("div", {
853
+ $.length > 0 && /* @__PURE__ */ V("div", {
853
854
  className: "mt-3 flex flex-wrap gap-1.5",
854
- children: xe.map((e) => /* @__PURE__ */ V("span", {
855
+ children: $.map((e) => /* @__PURE__ */ V("span", {
855
856
  className: "rounded-full bg-bg-sunken px-2.5 py-0.5 text-xs text-text-secondary",
856
857
  children: e
857
858
  }, e))
@@ -863,7 +864,7 @@ function Q() {
863
864
  children: [/* @__PURE__ */ H("div", {
864
865
  className: "flex items-center gap-2 text-sm font-semibold text-text-primary",
865
866
  children: [
866
- /* @__PURE__ */ V(ae, { className: "h-4 w-4 text-text-secondary" }),
867
+ /* @__PURE__ */ V(oe, { className: "h-4 w-4 text-text-secondary" }),
867
868
  " ",
868
869
  c("relationships.detail.sections.paymentBilling", "Payment & billing")
869
870
  ]
@@ -872,36 +873,36 @@ function Q() {
872
873
  children: [
873
874
  /* @__PURE__ */ V(X, {
874
875
  label: c("relationships.detail.info.currency", "Currency"),
875
- value: $.currency
876
+ value: Q.currency
876
877
  }),
877
878
  /* @__PURE__ */ V(X, {
878
879
  label: c("relationships.detail.info.autoRenew", "Auto-renew"),
879
- value: ye
880
+ value: xe
880
881
  }),
881
882
  /* @__PURE__ */ V(X, {
882
883
  label: c("relationships.detail.info.nextRenewal", "Next renewal"),
883
- value: $.renewsAt ? r($.renewsAt) : "—"
884
+ value: Q.renewsAt ? r(Q.renewsAt) : "—"
884
885
  }),
885
886
  /* @__PURE__ */ V(X, {
886
887
  label: c("relationships.detail.info.started", "Started"),
887
- value: $.startedAt ? r($.startedAt) : "—"
888
+ value: Q.startedAt ? r(Q.startedAt) : "—"
888
889
  }),
889
- $.trialEndsAt && /* @__PURE__ */ V(X, {
890
+ Q.trialEndsAt && /* @__PURE__ */ V(X, {
890
891
  label: c("relationships.detail.info.trialEnds", "Trial ends"),
891
- value: r($.trialEndsAt)
892
+ value: r(Q.trialEndsAt)
892
893
  })
893
894
  ]
894
895
  })]
895
896
  })]
896
897
  }),
897
- (Q.data?.items.length ?? 0) > 0 && /* @__PURE__ */ H(f, {
898
+ (Z.data?.items.length ?? 0) > 0 && /* @__PURE__ */ H(f, {
898
899
  className: "mt-0",
899
900
  title: c("relationships.detail.sections.aiRecommendations", "AI recommendations"),
900
901
  description: c("relationships.detail.sections.aiRecommendationsDescription", "Open recommendations about this subscription. You can also make any of these changes by hand above."),
901
- children: [/* @__PURE__ */ V(O, { className: "mb-3" }), /* @__PURE__ */ V("div", {
902
+ children: [/* @__PURE__ */ V(A, { className: "mb-3" }), /* @__PURE__ */ V("div", {
902
903
  className: "grid grid-cols-1 gap-3",
903
904
  "data-testid": "relationship-decisions",
904
- children: Q.data?.items.map((e) => /* @__PURE__ */ V(D, { decision: e }, e.id))
905
+ children: Z.data?.items.map((e) => /* @__PURE__ */ V(k, { decision: e }, e.id))
905
906
  })]
906
907
  }),
907
908
  /* @__PURE__ */ V(f, {
@@ -913,18 +914,18 @@ function Q() {
913
914
  onClick: () => K(!0),
914
915
  className: "inline-flex items-center gap-1.5 rounded-lg border border-border-subtle px-3 py-1.5 text-xs font-medium text-text-primary hover:bg-bg-sunken",
915
916
  children: [
916
- /* @__PURE__ */ V(B, { className: "h-3.5 w-3.5" }),
917
+ /* @__PURE__ */ V(re, { className: "h-3.5 w-3.5" }),
917
918
  " ",
918
919
  c("relationships.detail.sections.addEntitlement", "Add entitlement")
919
920
  ]
920
921
  }),
921
- children: !$.entitlements || $.entitlements.length === 0 ? /* @__PURE__ */ V(s, {
922
+ children: !Q.entitlements || Q.entitlements.length === 0 ? /* @__PURE__ */ V(s, {
922
923
  illustration: "empty-data",
923
924
  title: c("relationships.detail.empty.noEntitlementsTitle", "No entitlements"),
924
925
  description: c("relationships.detail.empty.noEntitlementsDescription", "Entitlements (seats, quotas, feature access) will appear here.")
925
926
  }) : /* @__PURE__ */ V("div", {
926
927
  className: "grid grid-cols-1 gap-3 sm:grid-cols-2",
927
- children: $.entitlements.map((e) => {
928
+ children: Q.entitlements.map((e) => {
928
929
  let t = e.quota != null && e.quota > 0;
929
930
  return /* @__PURE__ */ H(U, {
930
931
  treatment: "plain",
@@ -975,13 +976,13 @@ function Q() {
975
976
  onClick: () => J(!0),
976
977
  className: "inline-flex items-center gap-1.5 rounded-lg border border-border-subtle px-3 py-1.5 text-xs font-medium text-text-primary hover:bg-bg-sunken",
977
978
  children: [
978
- /* @__PURE__ */ V(B, { className: "h-3.5 w-3.5" }),
979
+ /* @__PURE__ */ V(re, { className: "h-3.5 w-3.5" }),
979
980
  " ",
980
981
  c("relationships.detail.sections.attachAsset", "Attach asset")
981
982
  ]
982
983
  }),
983
984
  children: (() => {
984
- let e = $.assets ?? [], t = Z.data?.items ?? [];
985
+ let e = Q.assets ?? [], t = de.data?.items ?? [];
985
986
  return e.length > 0 || t.length > 0 ? /* @__PURE__ */ V(U, {
986
987
  treatment: "plain",
987
988
  className: "divide-y divide-border-subtle p-0",
@@ -993,7 +994,7 @@ function Q() {
993
994
  kind: "invoice",
994
995
  sort: new Date(e.createdAt).getTime() || 0,
995
996
  invoice: e
996
- }))].sort((e, t) => t.sort - e.sort).map((e) => e.kind === "asset" ? /* @__PURE__ */ V(pe, { asset: e.asset }, `a-${e.asset.id}`) : /* @__PURE__ */ V(me, { invoice: e.invoice }, `i-${e.invoice.id}`))
997
+ }))].sort((e, t) => t.sort - e.sort).map((e) => e.kind === "asset" ? /* @__PURE__ */ V(he, { asset: e.asset }, `a-${e.asset.id}`) : /* @__PURE__ */ V(ge, { invoice: e.invoice }, `i-${e.invoice.id}`))
997
998
  }) : /* @__PURE__ */ V(s, {
998
999
  illustration: "empty-data",
999
1000
  title: c("relationships.detail.empty.noAssetsTitle", "No assets attached"),
@@ -1001,7 +1002,7 @@ function Q() {
1001
1002
  });
1002
1003
  })()
1003
1004
  }),
1004
- $.notes && /* @__PURE__ */ H(U, {
1005
+ Q.notes && /* @__PURE__ */ H(U, {
1005
1006
  treatment: "plain",
1006
1007
  className: "p-4",
1007
1008
  children: [/* @__PURE__ */ V("p", {
@@ -1009,7 +1010,7 @@ function Q() {
1009
1010
  children: c("relationships.detail.sections.notes", "Notes")
1010
1011
  }), /* @__PURE__ */ V("p", {
1011
1012
  className: "mt-1 whitespace-pre-wrap text-sm text-text-primary",
1012
- children: $.notes
1013
+ children: Q.notes
1013
1014
  })]
1014
1015
  })
1015
1016
  ]
@@ -1021,18 +1022,18 @@ function Q() {
1021
1022
  children: [/* @__PURE__ */ H("div", {
1022
1023
  className: "flex items-center gap-2 text-sm font-semibold text-text-primary",
1023
1024
  children: [
1024
- /* @__PURE__ */ V(A, { className: "h-4 w-4 text-text-secondary" }),
1025
+ /* @__PURE__ */ V(M, { className: "h-4 w-4 text-text-secondary" }),
1025
1026
  " ",
1026
1027
  c("relationships.detail.sections.healthScore", "Health score")
1027
1028
  ]
1028
- }), $.healthScore == null ? /* @__PURE__ */ V("p", {
1029
+ }), Q.healthScore == null ? /* @__PURE__ */ V("p", {
1029
1030
  className: "mt-4 text-sm text-text-secondary",
1030
1031
  children: c("relationships.detail.empty.noHealthScore", "Not scored yet. A health score appears once Subscriber Bot has enough signal.")
1031
1032
  }) : /* @__PURE__ */ H("div", {
1032
1033
  className: "mt-4 flex flex-col items-center",
1033
1034
  children: [
1034
1035
  /* @__PURE__ */ V(p, {
1035
- value: $.healthScore,
1036
+ value: Q.healthScore,
1036
1037
  max: 100,
1037
1038
  size: 160,
1038
1039
  label: c("relationships.detail.outOf100", "of 100")
@@ -1040,9 +1041,9 @@ function Q() {
1040
1041
  /* @__PURE__ */ V("div", {
1041
1042
  className: "mt-2 w-full",
1042
1043
  children: /* @__PURE__ */ V(m, {
1043
- value: $.healthScore,
1044
+ value: Q.healthScore,
1044
1045
  max: 100,
1045
- tone: le($.healthScore)
1046
+ tone: ue(Q.healthScore)
1046
1047
  })
1047
1048
  }),
1048
1049
  /* @__PURE__ */ V("p", {
@@ -1059,7 +1060,7 @@ function Q() {
1059
1060
  /* @__PURE__ */ H("div", {
1060
1061
  className: "flex items-center gap-2 text-sm font-semibold text-text-primary",
1061
1062
  children: [
1062
- /* @__PURE__ */ V(P, { className: "h-4 w-4 text-text-secondary" }),
1063
+ /* @__PURE__ */ V(F, { className: "h-4 w-4 text-text-secondary" }),
1063
1064
  " ",
1064
1065
  c("relationships.detail.sections.renewalTimeline", "Renewal timeline")
1065
1066
  ]
@@ -1068,7 +1069,7 @@ function Q() {
1068
1069
  className: "mt-0.5 text-xs text-text-secondary",
1069
1070
  children: c("relationships.detail.sections.renewalTimelineDescription", "Detected renewals and price changes")
1070
1071
  }),
1071
- ve.length === 0 ? /* @__PURE__ */ V("div", {
1072
+ be.length === 0 ? /* @__PURE__ */ V("div", {
1072
1073
  className: "mt-4",
1073
1074
  children: /* @__PURE__ */ V(s, {
1074
1075
  illustration: "empty-calendar",
@@ -1076,29 +1077,29 @@ function Q() {
1076
1077
  description: c("relationships.detail.empty.noRenewalEventsDescription", "Renewals and price changes will appear here as they're detected.")
1077
1078
  })
1078
1079
  }) : /* @__PURE__ */ V(h, {
1079
- items: ve,
1080
+ items: be,
1080
1081
  className: "mt-4"
1081
1082
  })
1082
1083
  ]
1083
1084
  })]
1084
1085
  })]
1085
1086
  }),
1086
- z && /* @__PURE__ */ V(ue, {
1087
- relationship: $,
1087
+ B && /* @__PURE__ */ V(fe, {
1088
+ relationship: Q,
1088
1089
  onClose: () => W(!1)
1089
1090
  }),
1090
- G && /* @__PURE__ */ V(de, {
1091
- relationshipId: $.id,
1091
+ G && /* @__PURE__ */ V(pe, {
1092
+ relationshipId: Q.id,
1092
1093
  onClose: () => K(!1)
1093
1094
  }),
1094
- q && /* @__PURE__ */ V(fe, {
1095
- relationshipId: $.id,
1095
+ q && /* @__PURE__ */ V(me, {
1096
+ relationshipId: Q.id,
1096
1097
  onClose: () => J(!1)
1097
1098
  })
1098
1099
  ]
1099
1100
  });
1100
1101
  }
1101
1102
  //#endregion
1102
- export { Q as RelationshipDetailPage };
1103
+ export { Z as RelationshipDetailPage };
1103
1104
 
1104
1105
  //# sourceMappingURL=RelationshipDetailPage.js.map