@burdenoff/microfe-subscriberbot 2026.629.1 → 2026.706.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/subscriberbot/components/Modal.js +51 -0
- package/dist/subscriberbot/components/Modal.js.map +1 -0
- package/dist/subscriberbot/hooks/useSubscriberBotApi.js +355 -159
- package/dist/subscriberbot/hooks/useSubscriberBotApi.js.map +1 -1
- package/dist/subscriberbot/pages/InboxPage.js +339 -66
- package/dist/subscriberbot/pages/InboxPage.js.map +1 -1
- package/dist/subscriberbot/pages/InvoicesPage.js +496 -73
- package/dist/subscriberbot/pages/InvoicesPage.js.map +1 -1
- package/dist/subscriberbot/pages/WorkflowsPage.js +136 -150
- package/dist/subscriberbot/pages/WorkflowsPage.js.map +1 -1
- package/dist/subscriberbot/pages/agents/AgentDetailPage.js +197 -58
- package/dist/subscriberbot/pages/agents/AgentDetailPage.js.map +1 -1
- package/dist/subscriberbot/pages/agents/AgentsListPage.js +2 -0
- package/dist/subscriberbot/pages/agents/AgentsListPage.js.map +1 -1
- package/dist/subscriberbot/pages/providers/ProviderDetailPage.js +538 -71
- package/dist/subscriberbot/pages/providers/ProviderDetailPage.js.map +1 -1
- package/dist/subscriberbot/pages/providers/ProvidersListPage.js +2 -0
- package/dist/subscriberbot/pages/providers/ProvidersListPage.js.map +1 -1
- package/dist/subscriberbot/pages/relationships/RelationshipDetailPage.js +664 -126
- package/dist/subscriberbot/pages/relationships/RelationshipDetailPage.js.map +1 -1
- package/dist/subscriberbot/pages/relationships/RelationshipsListPage.js +18 -16
- package/dist/subscriberbot/pages/relationships/RelationshipsListPage.js.map +1 -1
- package/package.json +1 -1
|
@@ -4,164 +4,619 @@ import { formatCurrency as n, formatEnumLabel as r, formatIntervalSuffix as i }
|
|
|
4
4
|
import { StatusBadge as a } from "../../components/StatusBadge.js";
|
|
5
5
|
import { EmptyState as o } from "../../components/EmptyState.js";
|
|
6
6
|
import { ErrorView as s, LoadingView as c, Section as l } from "../../components/StateViews.js";
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
7
|
+
import { useArchiveProvider as u, useCreatePlan as d, useProvider as f, useUpdateProvider as p } from "../../hooks/useSubscriberBotApi.js";
|
|
8
|
+
import { Modal as m } from "../../components/Modal.js";
|
|
9
|
+
import { useState as h } from "react";
|
|
10
|
+
import { Archive as g, ArrowLeft as _, Building2 as v, Globe as y, Pencil as b, Plus as x, ShieldCheck as S, Tag as C, TrendingDown as w } from "lucide-react";
|
|
11
|
+
import { useParams as T } from "react-router-dom";
|
|
12
|
+
import { jsx as E, jsxs as D } from "react/jsx-runtime";
|
|
13
|
+
import { GlassCard as O } from "@burdenoff/fe-libs/ui";
|
|
12
14
|
//#region src/subscriberbot/pages/providers/ProviderDetailPage.tsx
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
15
|
+
var k = "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)]", A = "mb-1 block text-xs font-medium text-text-secondary", j = [
|
|
16
|
+
"SAAS",
|
|
17
|
+
"AI_SERVICE",
|
|
18
|
+
"STREAMING",
|
|
19
|
+
"NEWSLETTER",
|
|
20
|
+
"NEWS_DIGEST",
|
|
21
|
+
"MEMBERSHIP",
|
|
22
|
+
"COMMUNITY",
|
|
23
|
+
"EDUCATION",
|
|
24
|
+
"FINANCIAL",
|
|
25
|
+
"INSURANCE",
|
|
26
|
+
"TELECOM",
|
|
27
|
+
"UTILITY",
|
|
28
|
+
"ASSOCIATION",
|
|
29
|
+
"LICENSE",
|
|
30
|
+
"CONTRACT",
|
|
31
|
+
"OTHER"
|
|
32
|
+
], M = [
|
|
33
|
+
"UNVERIFIED",
|
|
34
|
+
"VERIFIED",
|
|
35
|
+
"CLAIMED",
|
|
36
|
+
"DEPRECATED"
|
|
37
|
+
], N = [
|
|
38
|
+
"MONTHLY",
|
|
39
|
+
"YEARLY",
|
|
40
|
+
"QUARTERLY",
|
|
41
|
+
"WEEKLY",
|
|
42
|
+
"DAILY",
|
|
43
|
+
"USAGE_BASED",
|
|
44
|
+
"LIFETIME",
|
|
45
|
+
"FREE"
|
|
46
|
+
];
|
|
47
|
+
function P({ provider: e, onClose: t }) {
|
|
48
|
+
let n = p(), [r, i] = h(e.name), [a, o] = h(e.category), [s, c] = h(e.status), [l, u] = h(e.description ?? ""), [d, f] = h(e.industry ?? ""), [g, _] = h(e.region ?? ""), [v, y] = h(e.language ?? ""), [b, x] = h(e.websiteUrl ?? ""), [S, C] = h(e.churnRiskScore == null ? "" : String(e.churnRiskScore)), [w, T] = h(e.vendorHealthScore == null ? "" : String(e.vendorHealthScore)), [O, N] = h(e.tags.join(", ")), [P, F] = h(null);
|
|
49
|
+
return /* @__PURE__ */ E(m, {
|
|
50
|
+
title: "Edit provider",
|
|
51
|
+
onClose: t,
|
|
52
|
+
maxWidthClassName: "max-w-2xl",
|
|
53
|
+
children: /* @__PURE__ */ D("form", {
|
|
54
|
+
onSubmit: (i) => {
|
|
55
|
+
if (i.preventDefault(), F(null), !r.trim()) {
|
|
56
|
+
F("A provider name is required.");
|
|
57
|
+
return;
|
|
58
|
+
}
|
|
59
|
+
let o = O.split(",").map((e) => e.trim()).filter(Boolean), c = {
|
|
60
|
+
name: r.trim(),
|
|
61
|
+
category: a,
|
|
62
|
+
status: s,
|
|
63
|
+
description: l.trim(),
|
|
64
|
+
tags: o,
|
|
65
|
+
...d.trim() ? { industry: d.trim() } : {},
|
|
66
|
+
...g.trim() ? { region: g.trim() } : {},
|
|
67
|
+
...v.trim() ? { language: v.trim() } : {},
|
|
68
|
+
...b.trim() ? { websiteUrl: b.trim() } : {},
|
|
69
|
+
...S.trim() ? { churnRiskScore: Number(S) } : {},
|
|
70
|
+
...w.trim() ? { vendorHealthScore: Number(w) } : {}
|
|
71
|
+
};
|
|
72
|
+
n.mutate({
|
|
73
|
+
id: e.id,
|
|
74
|
+
input: c
|
|
75
|
+
}, {
|
|
76
|
+
onSuccess: () => t(),
|
|
77
|
+
onError: (e) => F(e instanceof Error ? e.message : "Could not update provider.")
|
|
78
|
+
});
|
|
79
|
+
},
|
|
80
|
+
className: "space-y-4",
|
|
81
|
+
children: [
|
|
82
|
+
P && /* @__PURE__ */ E("div", {
|
|
83
|
+
className: "rounded-lg border border-status-error-text/30 bg-status-error-bg-subtle px-4 py-2 text-sm text-status-error-text",
|
|
84
|
+
children: P
|
|
85
|
+
}),
|
|
86
|
+
/* @__PURE__ */ D("div", { children: [/* @__PURE__ */ D("label", {
|
|
87
|
+
htmlFor: "prov-edit-name",
|
|
88
|
+
className: A,
|
|
89
|
+
children: ["Name ", /* @__PURE__ */ E("span", {
|
|
90
|
+
className: "text-status-error-text",
|
|
91
|
+
children: "*"
|
|
92
|
+
})]
|
|
93
|
+
}), /* @__PURE__ */ E("input", {
|
|
94
|
+
id: "prov-edit-name",
|
|
95
|
+
type: "text",
|
|
96
|
+
value: r,
|
|
97
|
+
onChange: (e) => i(e.target.value),
|
|
98
|
+
className: k,
|
|
99
|
+
required: !0
|
|
100
|
+
})] }),
|
|
101
|
+
/* @__PURE__ */ D("div", {
|
|
102
|
+
className: "grid grid-cols-1 gap-4 sm:grid-cols-2",
|
|
103
|
+
children: [/* @__PURE__ */ D("div", { children: [/* @__PURE__ */ E("label", {
|
|
104
|
+
htmlFor: "prov-edit-category",
|
|
105
|
+
className: A,
|
|
106
|
+
children: "Category"
|
|
107
|
+
}), /* @__PURE__ */ E("select", {
|
|
108
|
+
id: "prov-edit-category",
|
|
109
|
+
value: a,
|
|
110
|
+
onChange: (e) => o(e.target.value),
|
|
111
|
+
className: k,
|
|
112
|
+
children: j.map((e) => /* @__PURE__ */ E("option", {
|
|
113
|
+
value: e,
|
|
114
|
+
children: e.replace(/_/g, " ")
|
|
115
|
+
}, e))
|
|
116
|
+
})] }), /* @__PURE__ */ D("div", { children: [/* @__PURE__ */ E("label", {
|
|
117
|
+
htmlFor: "prov-edit-status",
|
|
118
|
+
className: A,
|
|
119
|
+
children: "Status"
|
|
120
|
+
}), /* @__PURE__ */ E("select", {
|
|
121
|
+
id: "prov-edit-status",
|
|
122
|
+
value: s,
|
|
123
|
+
onChange: (e) => c(e.target.value),
|
|
124
|
+
className: k,
|
|
125
|
+
children: M.map((e) => /* @__PURE__ */ E("option", {
|
|
126
|
+
value: e,
|
|
127
|
+
children: e.replace(/_/g, " ")
|
|
128
|
+
}, e))
|
|
129
|
+
})] })]
|
|
130
|
+
}),
|
|
131
|
+
/* @__PURE__ */ D("div", {
|
|
132
|
+
className: "grid grid-cols-1 gap-4 sm:grid-cols-3",
|
|
133
|
+
children: [
|
|
134
|
+
/* @__PURE__ */ D("div", { children: [/* @__PURE__ */ E("label", {
|
|
135
|
+
htmlFor: "prov-edit-industry",
|
|
136
|
+
className: A,
|
|
137
|
+
children: "Industry"
|
|
138
|
+
}), /* @__PURE__ */ E("input", {
|
|
139
|
+
id: "prov-edit-industry",
|
|
140
|
+
type: "text",
|
|
141
|
+
value: d,
|
|
142
|
+
onChange: (e) => f(e.target.value),
|
|
143
|
+
className: k
|
|
144
|
+
})] }),
|
|
145
|
+
/* @__PURE__ */ D("div", { children: [/* @__PURE__ */ E("label", {
|
|
146
|
+
htmlFor: "prov-edit-region",
|
|
147
|
+
className: A,
|
|
148
|
+
children: "Region"
|
|
149
|
+
}), /* @__PURE__ */ E("input", {
|
|
150
|
+
id: "prov-edit-region",
|
|
151
|
+
type: "text",
|
|
152
|
+
value: g,
|
|
153
|
+
onChange: (e) => _(e.target.value),
|
|
154
|
+
className: k
|
|
155
|
+
})] }),
|
|
156
|
+
/* @__PURE__ */ D("div", { children: [/* @__PURE__ */ E("label", {
|
|
157
|
+
htmlFor: "prov-edit-language",
|
|
158
|
+
className: A,
|
|
159
|
+
children: "Language"
|
|
160
|
+
}), /* @__PURE__ */ E("input", {
|
|
161
|
+
id: "prov-edit-language",
|
|
162
|
+
type: "text",
|
|
163
|
+
value: v,
|
|
164
|
+
onChange: (e) => y(e.target.value),
|
|
165
|
+
className: k
|
|
166
|
+
})] })
|
|
167
|
+
]
|
|
168
|
+
}),
|
|
169
|
+
/* @__PURE__ */ D("div", { children: [/* @__PURE__ */ E("label", {
|
|
170
|
+
htmlFor: "prov-edit-website",
|
|
171
|
+
className: A,
|
|
172
|
+
children: "Website"
|
|
173
|
+
}), /* @__PURE__ */ E("input", {
|
|
174
|
+
id: "prov-edit-website",
|
|
175
|
+
type: "url",
|
|
176
|
+
value: b,
|
|
177
|
+
onChange: (e) => x(e.target.value),
|
|
178
|
+
placeholder: "https://…",
|
|
179
|
+
className: k
|
|
180
|
+
})] }),
|
|
181
|
+
/* @__PURE__ */ D("div", { children: [/* @__PURE__ */ E("label", {
|
|
182
|
+
htmlFor: "prov-edit-desc",
|
|
183
|
+
className: A,
|
|
184
|
+
children: "Description"
|
|
185
|
+
}), /* @__PURE__ */ E("textarea", {
|
|
186
|
+
id: "prov-edit-desc",
|
|
187
|
+
value: l,
|
|
188
|
+
onChange: (e) => u(e.target.value),
|
|
189
|
+
rows: 3,
|
|
190
|
+
className: k
|
|
191
|
+
})] }),
|
|
192
|
+
/* @__PURE__ */ D("div", {
|
|
193
|
+
className: "grid grid-cols-1 gap-4 sm:grid-cols-2",
|
|
194
|
+
children: [/* @__PURE__ */ D("div", { children: [/* @__PURE__ */ E("label", {
|
|
195
|
+
htmlFor: "prov-edit-churn",
|
|
196
|
+
className: A,
|
|
197
|
+
children: "Churn risk (0–100)"
|
|
198
|
+
}), /* @__PURE__ */ E("input", {
|
|
199
|
+
id: "prov-edit-churn",
|
|
200
|
+
type: "number",
|
|
201
|
+
min: "0",
|
|
202
|
+
max: "100",
|
|
203
|
+
value: S,
|
|
204
|
+
onChange: (e) => C(e.target.value),
|
|
205
|
+
className: k
|
|
206
|
+
})] }), /* @__PURE__ */ D("div", { children: [/* @__PURE__ */ E("label", {
|
|
207
|
+
htmlFor: "prov-edit-health",
|
|
208
|
+
className: A,
|
|
209
|
+
children: "Vendor health (0–100)"
|
|
210
|
+
}), /* @__PURE__ */ E("input", {
|
|
211
|
+
id: "prov-edit-health",
|
|
212
|
+
type: "number",
|
|
213
|
+
min: "0",
|
|
214
|
+
max: "100",
|
|
215
|
+
value: w,
|
|
216
|
+
onChange: (e) => T(e.target.value),
|
|
217
|
+
className: k
|
|
218
|
+
})] })]
|
|
219
|
+
}),
|
|
220
|
+
/* @__PURE__ */ D("div", { children: [/* @__PURE__ */ D("label", {
|
|
221
|
+
htmlFor: "prov-edit-tags",
|
|
222
|
+
className: A,
|
|
223
|
+
children: ["Tags ", /* @__PURE__ */ E("span", {
|
|
224
|
+
className: "text-text-secondary",
|
|
225
|
+
children: "(comma-separated)"
|
|
226
|
+
})]
|
|
227
|
+
}), /* @__PURE__ */ E("input", {
|
|
228
|
+
id: "prov-edit-tags",
|
|
229
|
+
type: "text",
|
|
230
|
+
value: O,
|
|
231
|
+
onChange: (e) => N(e.target.value),
|
|
232
|
+
className: k
|
|
233
|
+
})] }),
|
|
234
|
+
/* @__PURE__ */ D("div", {
|
|
235
|
+
className: "flex justify-end gap-3",
|
|
236
|
+
children: [/* @__PURE__ */ E("button", {
|
|
237
|
+
type: "button",
|
|
238
|
+
onClick: t,
|
|
239
|
+
className: "rounded-lg border border-border-subtle px-4 py-2 text-sm font-medium text-text-primary hover:bg-bg-sunken",
|
|
240
|
+
children: "Cancel"
|
|
241
|
+
}), /* @__PURE__ */ E("button", {
|
|
242
|
+
type: "submit",
|
|
243
|
+
disabled: n.isPending,
|
|
244
|
+
className: "rounded-lg bg-action-primary-bg px-4 py-2 text-sm font-medium text-action-primary-text hover:opacity-90 disabled:opacity-50",
|
|
245
|
+
children: n.isPending ? "Saving…" : "Save changes"
|
|
246
|
+
})]
|
|
247
|
+
})
|
|
248
|
+
]
|
|
249
|
+
})
|
|
250
|
+
});
|
|
251
|
+
}
|
|
252
|
+
function F({ providerId: e, onClose: t }) {
|
|
253
|
+
let n = d(), [r, i] = h(""), [a, o] = h(""), [s, c] = h("USD"), [l, u] = h("MONTHLY"), [f, p] = h(""), [g, _] = h(""), [v, y] = h(!0), [b, x] = h(null);
|
|
254
|
+
return /* @__PURE__ */ E(m, {
|
|
255
|
+
title: "Add plan",
|
|
256
|
+
onClose: t,
|
|
257
|
+
maxWidthClassName: "max-w-xl",
|
|
258
|
+
children: /* @__PURE__ */ D("form", {
|
|
259
|
+
onSubmit: (i) => {
|
|
260
|
+
if (i.preventDefault(), x(null), !r.trim()) {
|
|
261
|
+
x("A plan name is required.");
|
|
262
|
+
return;
|
|
263
|
+
}
|
|
264
|
+
let o = g.split("\n").map((e) => e.trim()).filter(Boolean);
|
|
265
|
+
n.mutate({
|
|
266
|
+
providerId: e,
|
|
267
|
+
name: r.trim(),
|
|
268
|
+
interval: l,
|
|
269
|
+
currency: s.trim() || "USD",
|
|
270
|
+
...a.trim() ? { amount: Number(a) } : {},
|
|
271
|
+
...f.trim() ? { description: f.trim() } : {},
|
|
272
|
+
...o.length ? { features: o } : {}
|
|
273
|
+
}, {
|
|
274
|
+
onSuccess: () => t(),
|
|
275
|
+
onError: (e) => x(e instanceof Error ? e.message : "Could not add plan.")
|
|
276
|
+
});
|
|
277
|
+
},
|
|
278
|
+
className: "space-y-4",
|
|
279
|
+
children: [
|
|
280
|
+
b && /* @__PURE__ */ E("div", {
|
|
281
|
+
className: "rounded-lg border border-status-error-text/30 bg-status-error-bg-subtle px-4 py-2 text-sm text-status-error-text",
|
|
282
|
+
children: b
|
|
283
|
+
}),
|
|
284
|
+
/* @__PURE__ */ D("div", { children: [/* @__PURE__ */ D("label", {
|
|
285
|
+
htmlFor: "plan-name",
|
|
286
|
+
className: A,
|
|
287
|
+
children: ["Name ", /* @__PURE__ */ E("span", {
|
|
288
|
+
className: "text-status-error-text",
|
|
289
|
+
children: "*"
|
|
290
|
+
})]
|
|
291
|
+
}), /* @__PURE__ */ E("input", {
|
|
292
|
+
id: "plan-name",
|
|
293
|
+
type: "text",
|
|
294
|
+
value: r,
|
|
295
|
+
onChange: (e) => i(e.target.value),
|
|
296
|
+
placeholder: "e.g. Pro, Team, Enterprise",
|
|
297
|
+
className: k,
|
|
298
|
+
required: !0
|
|
299
|
+
})] }),
|
|
300
|
+
/* @__PURE__ */ D("div", {
|
|
301
|
+
className: "grid grid-cols-1 gap-4 sm:grid-cols-3",
|
|
302
|
+
children: [
|
|
303
|
+
/* @__PURE__ */ D("div", { children: [/* @__PURE__ */ E("label", {
|
|
304
|
+
htmlFor: "plan-amount",
|
|
305
|
+
className: A,
|
|
306
|
+
children: "Amount"
|
|
307
|
+
}), /* @__PURE__ */ E("input", {
|
|
308
|
+
id: "plan-amount",
|
|
309
|
+
type: "number",
|
|
310
|
+
min: "0",
|
|
311
|
+
step: "0.01",
|
|
312
|
+
value: a,
|
|
313
|
+
onChange: (e) => o(e.target.value),
|
|
314
|
+
placeholder: "0.00",
|
|
315
|
+
className: k
|
|
316
|
+
})] }),
|
|
317
|
+
/* @__PURE__ */ D("div", { children: [/* @__PURE__ */ E("label", {
|
|
318
|
+
htmlFor: "plan-currency",
|
|
319
|
+
className: A,
|
|
320
|
+
children: "Currency"
|
|
321
|
+
}), /* @__PURE__ */ E("input", {
|
|
322
|
+
id: "plan-currency",
|
|
323
|
+
type: "text",
|
|
324
|
+
value: s,
|
|
325
|
+
onChange: (e) => c(e.target.value.toUpperCase()),
|
|
326
|
+
maxLength: 3,
|
|
327
|
+
className: k
|
|
328
|
+
})] }),
|
|
329
|
+
/* @__PURE__ */ D("div", { children: [/* @__PURE__ */ E("label", {
|
|
330
|
+
htmlFor: "plan-interval",
|
|
331
|
+
className: A,
|
|
332
|
+
children: "Interval"
|
|
333
|
+
}), /* @__PURE__ */ E("select", {
|
|
334
|
+
id: "plan-interval",
|
|
335
|
+
value: l,
|
|
336
|
+
onChange: (e) => u(e.target.value),
|
|
337
|
+
className: k,
|
|
338
|
+
children: N.map((e) => /* @__PURE__ */ E("option", {
|
|
339
|
+
value: e,
|
|
340
|
+
children: e.replace(/_/g, " ")
|
|
341
|
+
}, e))
|
|
342
|
+
})] })
|
|
343
|
+
]
|
|
344
|
+
}),
|
|
345
|
+
/* @__PURE__ */ D("div", { children: [/* @__PURE__ */ E("label", {
|
|
346
|
+
htmlFor: "plan-desc",
|
|
347
|
+
className: A,
|
|
348
|
+
children: "Description"
|
|
349
|
+
}), /* @__PURE__ */ E("textarea", {
|
|
350
|
+
id: "plan-desc",
|
|
351
|
+
value: f,
|
|
352
|
+
onChange: (e) => p(e.target.value),
|
|
353
|
+
rows: 2,
|
|
354
|
+
className: k
|
|
355
|
+
})] }),
|
|
356
|
+
/* @__PURE__ */ D("div", { children: [/* @__PURE__ */ D("label", {
|
|
357
|
+
htmlFor: "plan-features",
|
|
358
|
+
className: A,
|
|
359
|
+
children: ["Features ", /* @__PURE__ */ E("span", {
|
|
360
|
+
className: "text-text-secondary",
|
|
361
|
+
children: "(one per line)"
|
|
362
|
+
})]
|
|
363
|
+
}), /* @__PURE__ */ E("textarea", {
|
|
364
|
+
id: "plan-features",
|
|
365
|
+
value: g,
|
|
366
|
+
onChange: (e) => _(e.target.value),
|
|
367
|
+
rows: 3,
|
|
368
|
+
placeholder: "Unlimited projects\nPriority support\nSSO",
|
|
369
|
+
className: k
|
|
370
|
+
})] }),
|
|
371
|
+
/* @__PURE__ */ D("label", {
|
|
372
|
+
className: "flex items-center gap-2 text-sm text-text-primary",
|
|
373
|
+
children: [/* @__PURE__ */ E("input", {
|
|
374
|
+
type: "checkbox",
|
|
375
|
+
checked: v,
|
|
376
|
+
onChange: (e) => y(e.target.checked),
|
|
377
|
+
className: "size-4 rounded border-border-subtle"
|
|
378
|
+
}), "Active"]
|
|
379
|
+
}),
|
|
380
|
+
/* @__PURE__ */ D("div", {
|
|
381
|
+
className: "flex justify-end gap-3",
|
|
382
|
+
children: [/* @__PURE__ */ E("button", {
|
|
383
|
+
type: "button",
|
|
384
|
+
onClick: t,
|
|
385
|
+
className: "rounded-lg border border-border-subtle px-4 py-2 text-sm font-medium text-text-primary hover:bg-bg-sunken",
|
|
386
|
+
children: "Cancel"
|
|
387
|
+
}), /* @__PURE__ */ E("button", {
|
|
388
|
+
type: "submit",
|
|
389
|
+
disabled: n.isPending,
|
|
390
|
+
className: "rounded-lg bg-action-primary-bg px-4 py-2 text-sm font-medium text-action-primary-text hover:opacity-90 disabled:opacity-50",
|
|
391
|
+
children: n.isPending ? "Adding…" : "Add plan"
|
|
392
|
+
})]
|
|
393
|
+
})
|
|
394
|
+
]
|
|
395
|
+
})
|
|
396
|
+
});
|
|
397
|
+
}
|
|
398
|
+
function I({ provider: t, onClose: n }) {
|
|
399
|
+
let { navigateTo: r } = e(), i = u(), [a, o] = h(null);
|
|
400
|
+
return /* @__PURE__ */ E(m, {
|
|
401
|
+
title: "Archive provider",
|
|
402
|
+
onClose: n,
|
|
403
|
+
children: /* @__PURE__ */ D("div", {
|
|
404
|
+
className: "space-y-4",
|
|
405
|
+
children: [
|
|
406
|
+
a && /* @__PURE__ */ E("div", {
|
|
407
|
+
className: "rounded-lg border border-status-error-text/30 bg-status-error-bg-subtle px-4 py-2 text-sm text-status-error-text",
|
|
408
|
+
children: a
|
|
409
|
+
}),
|
|
410
|
+
/* @__PURE__ */ D("p", {
|
|
411
|
+
className: "text-sm text-text-secondary",
|
|
412
|
+
children: [
|
|
413
|
+
"Archive ",
|
|
414
|
+
/* @__PURE__ */ E("span", {
|
|
415
|
+
className: "font-medium text-text-primary",
|
|
416
|
+
children: t.name
|
|
417
|
+
}),
|
|
418
|
+
"? It will be removed from the active registry. This can be reversed by an administrator."
|
|
419
|
+
]
|
|
420
|
+
}),
|
|
421
|
+
/* @__PURE__ */ D("div", {
|
|
422
|
+
className: "flex justify-end gap-3",
|
|
423
|
+
children: [/* @__PURE__ */ E("button", {
|
|
424
|
+
type: "button",
|
|
425
|
+
onClick: n,
|
|
426
|
+
className: "rounded-lg border border-border-subtle px-4 py-2 text-sm font-medium text-text-primary hover:bg-bg-sunken",
|
|
427
|
+
children: "Cancel"
|
|
428
|
+
}), /* @__PURE__ */ E("button", {
|
|
429
|
+
type: "button",
|
|
430
|
+
onClick: () => {
|
|
431
|
+
o(null), i.mutate(t.id, {
|
|
432
|
+
onSuccess: () => r("/providers"),
|
|
433
|
+
onError: (e) => o(e instanceof Error ? e.message : "Could not archive this provider.")
|
|
434
|
+
});
|
|
435
|
+
},
|
|
436
|
+
disabled: i.isPending,
|
|
437
|
+
className: "rounded-lg border border-status-error-text/30 bg-status-error-bg-subtle px-4 py-2 text-sm font-medium text-status-error-text hover:opacity-90 disabled:opacity-50",
|
|
438
|
+
children: i.isPending ? "Archiving…" : "Archive provider"
|
|
439
|
+
})]
|
|
440
|
+
})
|
|
441
|
+
]
|
|
442
|
+
})
|
|
443
|
+
});
|
|
444
|
+
}
|
|
445
|
+
function L() {
|
|
446
|
+
let { id: u } = T(), { navigateTo: d } = e(), { data: p, isLoading: m, isError: k, refetch: A } = f(u), [j, M] = h(!1), [N, L] = h(!1), [R, z] = h(!1);
|
|
447
|
+
if (m) return /* @__PURE__ */ E(t, {
|
|
16
448
|
title: "Provider",
|
|
17
|
-
children: /* @__PURE__ */
|
|
449
|
+
children: /* @__PURE__ */ E(c, { label: "Loading provider…" })
|
|
18
450
|
});
|
|
19
|
-
if (
|
|
451
|
+
if (k) return /* @__PURE__ */ E(t, {
|
|
20
452
|
title: "Provider",
|
|
21
|
-
children: /* @__PURE__ */
|
|
453
|
+
children: /* @__PURE__ */ E(s, {
|
|
22
454
|
message: "Could not load this provider.",
|
|
23
|
-
onRetry: () => void
|
|
455
|
+
onRetry: () => void A()
|
|
24
456
|
})
|
|
25
457
|
});
|
|
26
|
-
if (!
|
|
458
|
+
if (!p) return /* @__PURE__ */ E(t, {
|
|
27
459
|
title: "Provider",
|
|
28
|
-
children: /* @__PURE__ */
|
|
460
|
+
children: /* @__PURE__ */ E(o, {
|
|
29
461
|
illustration: "empty-data",
|
|
30
462
|
title: "Provider not found",
|
|
31
463
|
description: "It may have been removed, or you may not have access to it.",
|
|
32
|
-
action: /* @__PURE__ */
|
|
464
|
+
action: /* @__PURE__ */ E("button", {
|
|
33
465
|
type: "button",
|
|
34
|
-
onClick: () =>
|
|
466
|
+
onClick: () => d("/providers"),
|
|
35
467
|
className: "rounded-lg bg-action-primary-bg px-4 py-2 text-sm font-medium text-action-primary-text hover:opacity-90",
|
|
36
468
|
children: "Back to providers"
|
|
37
469
|
})
|
|
38
470
|
})
|
|
39
471
|
});
|
|
40
|
-
let
|
|
41
|
-
return /* @__PURE__ */
|
|
42
|
-
title:
|
|
43
|
-
description: r(
|
|
44
|
-
actions: /* @__PURE__ */
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
472
|
+
let B = p, V = B.websiteUrl && /^https?:\/\//i.test(B.websiteUrl) ? B.websiteUrl : null;
|
|
473
|
+
return /* @__PURE__ */ D(t, {
|
|
474
|
+
title: B.name,
|
|
475
|
+
description: r(B.category),
|
|
476
|
+
actions: /* @__PURE__ */ D("div", {
|
|
477
|
+
className: "flex items-center gap-2",
|
|
478
|
+
children: [
|
|
479
|
+
/* @__PURE__ */ D("button", {
|
|
480
|
+
type: "button",
|
|
481
|
+
onClick: () => M(!0),
|
|
482
|
+
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",
|
|
483
|
+
children: [/* @__PURE__ */ E(b, { className: "h-4 w-4" }), " Edit"]
|
|
484
|
+
}),
|
|
485
|
+
/* @__PURE__ */ D("button", {
|
|
486
|
+
type: "button",
|
|
487
|
+
onClick: () => z(!0),
|
|
488
|
+
className: "inline-flex items-center gap-2 rounded-lg border border-status-error-text/30 px-3 py-2 text-sm font-medium text-status-error-text hover:bg-status-error-bg-subtle",
|
|
489
|
+
children: [/* @__PURE__ */ E(g, { className: "h-4 w-4" }), " Archive"]
|
|
490
|
+
}),
|
|
491
|
+
/* @__PURE__ */ D("button", {
|
|
492
|
+
type: "button",
|
|
493
|
+
onClick: () => d("/providers"),
|
|
494
|
+
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",
|
|
495
|
+
children: [/* @__PURE__ */ E(_, { className: "h-4 w-4" }), " Back"]
|
|
496
|
+
})
|
|
497
|
+
]
|
|
49
498
|
}),
|
|
50
499
|
children: [
|
|
51
|
-
/* @__PURE__ */
|
|
500
|
+
/* @__PURE__ */ D("div", {
|
|
52
501
|
className: "flex flex-wrap items-center gap-3",
|
|
53
502
|
children: [
|
|
54
|
-
/* @__PURE__ */
|
|
503
|
+
/* @__PURE__ */ E("span", {
|
|
55
504
|
className: "flex size-10 items-center justify-center rounded-lg bg-[var(--color-accent-soft)] text-text-primary",
|
|
56
|
-
children: /* @__PURE__ */ v
|
|
505
|
+
children: /* @__PURE__ */ E(v, { className: "h-5 w-5" })
|
|
57
506
|
}),
|
|
58
|
-
/* @__PURE__ */
|
|
59
|
-
|
|
507
|
+
/* @__PURE__ */ E(a, { status: B.status }),
|
|
508
|
+
B.region && /* @__PURE__ */ E("span", {
|
|
60
509
|
className: "text-sm text-text-secondary",
|
|
61
|
-
children:
|
|
510
|
+
children: B.region
|
|
62
511
|
}),
|
|
63
|
-
|
|
64
|
-
href:
|
|
512
|
+
V && /* @__PURE__ */ D("a", {
|
|
513
|
+
href: V,
|
|
65
514
|
target: "_blank",
|
|
66
|
-
rel: "noreferrer",
|
|
515
|
+
rel: "noopener noreferrer",
|
|
67
516
|
className: "inline-flex items-center gap-1 text-sm text-text-link hover:underline",
|
|
68
|
-
children: [/* @__PURE__ */
|
|
517
|
+
children: [/* @__PURE__ */ E(y, { className: "h-3.5 w-3.5" }), " Website"]
|
|
69
518
|
})
|
|
70
519
|
]
|
|
71
520
|
}),
|
|
72
|
-
|
|
521
|
+
B.description && /* @__PURE__ */ E("p", {
|
|
73
522
|
className: "mt-4 max-w-3xl text-sm text-text-secondary",
|
|
74
|
-
children:
|
|
523
|
+
children: B.description
|
|
75
524
|
}),
|
|
76
|
-
/* @__PURE__ */
|
|
525
|
+
/* @__PURE__ */ D("div", {
|
|
77
526
|
className: "mt-6 grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-4",
|
|
78
527
|
children: [
|
|
79
|
-
/* @__PURE__ */
|
|
528
|
+
/* @__PURE__ */ D(O, {
|
|
80
529
|
treatment: "metric",
|
|
81
530
|
className: "p-4",
|
|
82
|
-
children: [/* @__PURE__ */
|
|
531
|
+
children: [/* @__PURE__ */ D("div", {
|
|
83
532
|
className: "flex items-center gap-2 text-xs font-medium text-text-secondary",
|
|
84
|
-
children: [/* @__PURE__ */
|
|
85
|
-
}), /* @__PURE__ */
|
|
533
|
+
children: [/* @__PURE__ */ E(S, { className: "h-3.5 w-3.5" }), " Vendor health"]
|
|
534
|
+
}), /* @__PURE__ */ E("p", {
|
|
86
535
|
className: "mt-1.5 text-lg font-semibold tabular-nums text-text-primary",
|
|
87
|
-
children:
|
|
536
|
+
children: B.vendorHealthScore == null ? "—" : `${B.vendorHealthScore}/100`
|
|
88
537
|
})]
|
|
89
538
|
}),
|
|
90
|
-
/* @__PURE__ */
|
|
539
|
+
/* @__PURE__ */ D(O, {
|
|
91
540
|
treatment: "metric",
|
|
92
541
|
className: "p-4",
|
|
93
|
-
children: [/* @__PURE__ */
|
|
542
|
+
children: [/* @__PURE__ */ D("div", {
|
|
94
543
|
className: "flex items-center gap-2 text-xs font-medium text-text-secondary",
|
|
95
|
-
children: [/* @__PURE__ */
|
|
96
|
-
}), /* @__PURE__ */
|
|
544
|
+
children: [/* @__PURE__ */ E(w, { className: "h-3.5 w-3.5" }), " Churn risk"]
|
|
545
|
+
}), /* @__PURE__ */ E("p", {
|
|
97
546
|
className: "mt-1.5 text-lg font-semibold tabular-nums text-text-primary",
|
|
98
|
-
children:
|
|
547
|
+
children: B.churnRiskScore == null ? "—" : `${B.churnRiskScore}/100`
|
|
99
548
|
})]
|
|
100
549
|
}),
|
|
101
|
-
/* @__PURE__ */
|
|
550
|
+
/* @__PURE__ */ D(O, {
|
|
102
551
|
treatment: "metric",
|
|
103
552
|
className: "p-4",
|
|
104
|
-
children: [/* @__PURE__ */
|
|
553
|
+
children: [/* @__PURE__ */ E("div", {
|
|
105
554
|
className: "flex items-center gap-2 text-xs font-medium text-text-secondary",
|
|
106
555
|
children: "Industry"
|
|
107
|
-
}), /* @__PURE__ */
|
|
556
|
+
}), /* @__PURE__ */ E("p", {
|
|
108
557
|
className: "mt-1.5 text-sm text-text-primary",
|
|
109
|
-
children:
|
|
558
|
+
children: B.industry ?? "—"
|
|
110
559
|
})]
|
|
111
560
|
}),
|
|
112
|
-
/* @__PURE__ */
|
|
561
|
+
/* @__PURE__ */ D(O, {
|
|
113
562
|
treatment: "metric",
|
|
114
563
|
className: "p-4",
|
|
115
|
-
children: [/* @__PURE__ */
|
|
564
|
+
children: [/* @__PURE__ */ E("div", {
|
|
116
565
|
className: "flex items-center gap-2 text-xs font-medium text-text-secondary",
|
|
117
566
|
children: "Language"
|
|
118
|
-
}), /* @__PURE__ */
|
|
567
|
+
}), /* @__PURE__ */ E("p", {
|
|
119
568
|
className: "mt-1.5 text-sm text-text-primary",
|
|
120
|
-
children:
|
|
569
|
+
children: B.language ?? "—"
|
|
121
570
|
})]
|
|
122
571
|
})
|
|
123
572
|
]
|
|
124
573
|
}),
|
|
125
|
-
|
|
574
|
+
B.tags.length > 0 && /* @__PURE__ */ D("div", {
|
|
126
575
|
className: "mt-5 flex flex-wrap items-center gap-2",
|
|
127
|
-
children: [/* @__PURE__ */
|
|
576
|
+
children: [/* @__PURE__ */ E(C, { className: "h-3.5 w-3.5 text-text-secondary" }), B.tags.map((e) => /* @__PURE__ */ E("span", {
|
|
128
577
|
className: "rounded-full bg-bg-sunken px-2.5 py-0.5 text-xs text-text-secondary",
|
|
129
578
|
children: e
|
|
130
579
|
}, e))]
|
|
131
580
|
}),
|
|
132
|
-
/* @__PURE__ */
|
|
581
|
+
/* @__PURE__ */ E(l, {
|
|
133
582
|
title: "Plans",
|
|
134
583
|
description: "Pricing this provider publishes",
|
|
135
|
-
|
|
584
|
+
action: /* @__PURE__ */ D("button", {
|
|
585
|
+
type: "button",
|
|
586
|
+
onClick: () => L(!0),
|
|
587
|
+
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",
|
|
588
|
+
children: [/* @__PURE__ */ E(x, { className: "h-3.5 w-3.5" }), " Add plan"]
|
|
589
|
+
}),
|
|
590
|
+
children: !B.plans || B.plans.length === 0 ? /* @__PURE__ */ E(o, {
|
|
136
591
|
illustration: "empty-data",
|
|
137
592
|
title: "No published plans",
|
|
138
593
|
description: "When this provider publishes plans, they'll appear here."
|
|
139
|
-
}) : /* @__PURE__ */
|
|
594
|
+
}) : /* @__PURE__ */ E("div", {
|
|
140
595
|
className: "grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-3",
|
|
141
|
-
children:
|
|
596
|
+
children: B.plans.map((e) => /* @__PURE__ */ D("div", {
|
|
142
597
|
className: "rounded-lg border border-border-subtle bg-bg-surface p-4",
|
|
143
598
|
children: [
|
|
144
|
-
/* @__PURE__ */
|
|
599
|
+
/* @__PURE__ */ D("div", {
|
|
145
600
|
className: "flex items-start justify-between gap-2",
|
|
146
|
-
children: [/* @__PURE__ */
|
|
601
|
+
children: [/* @__PURE__ */ E("p", {
|
|
147
602
|
className: "text-sm font-semibold text-text-primary",
|
|
148
603
|
children: e.name
|
|
149
|
-
}), /* @__PURE__ */
|
|
604
|
+
}), /* @__PURE__ */ E(a, { status: e.isActive ? "ACTIVE" : "DISABLED" })]
|
|
150
605
|
}),
|
|
151
|
-
/* @__PURE__ */
|
|
606
|
+
/* @__PURE__ */ D("p", {
|
|
152
607
|
className: "mt-2 text-lg font-bold tabular-nums text-text-primary",
|
|
153
|
-
children: [n(e.amount, e.currency), /* @__PURE__ */
|
|
608
|
+
children: [n(e.amount, e.currency), /* @__PURE__ */ E("span", {
|
|
154
609
|
className: "text-xs font-normal text-text-secondary",
|
|
155
610
|
children: i(e.interval)
|
|
156
611
|
})]
|
|
157
612
|
}),
|
|
158
|
-
e.description && /* @__PURE__ */
|
|
613
|
+
e.description && /* @__PURE__ */ E("p", {
|
|
159
614
|
className: "mt-1 text-xs text-text-secondary",
|
|
160
615
|
children: e.description
|
|
161
616
|
}),
|
|
162
|
-
e.features.length > 0 && /* @__PURE__ */
|
|
617
|
+
e.features.length > 0 && /* @__PURE__ */ E("ul", {
|
|
163
618
|
className: "mt-3 space-y-1",
|
|
164
|
-
children: e.features.slice(0, 5).map((e) => /* @__PURE__ */
|
|
619
|
+
children: e.features.slice(0, 5).map((e) => /* @__PURE__ */ D("li", {
|
|
165
620
|
className: "text-xs text-text-secondary",
|
|
166
621
|
children: ["• ", e]
|
|
167
622
|
}, e))
|
|
@@ -169,11 +624,23 @@ function x() {
|
|
|
169
624
|
]
|
|
170
625
|
}, e.id))
|
|
171
626
|
})
|
|
627
|
+
}),
|
|
628
|
+
j && /* @__PURE__ */ E(P, {
|
|
629
|
+
provider: B,
|
|
630
|
+
onClose: () => M(!1)
|
|
631
|
+
}),
|
|
632
|
+
N && /* @__PURE__ */ E(F, {
|
|
633
|
+
providerId: B.id,
|
|
634
|
+
onClose: () => L(!1)
|
|
635
|
+
}),
|
|
636
|
+
R && /* @__PURE__ */ E(I, {
|
|
637
|
+
provider: B,
|
|
638
|
+
onClose: () => z(!1)
|
|
172
639
|
})
|
|
173
640
|
]
|
|
174
641
|
});
|
|
175
642
|
}
|
|
176
643
|
//#endregion
|
|
177
|
-
export {
|
|
644
|
+
export { L as ProviderDetailPage };
|
|
178
645
|
|
|
179
646
|
//# sourceMappingURL=ProviderDetailPage.js.map
|