@openrails/billing-ui 0.268.2 → 0.269.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 (142) hide show
  1. package/dist/admin/context.d.ts +164 -62
  2. package/dist/admin/lib/api/endpoints.d.ts +3 -7
  3. package/dist/admin/lib/api/import-endpoints.d.ts +44 -0
  4. package/dist/admin/lib/api/index.d.ts +17 -7
  5. package/dist/admin/lib/api/types.d.ts +0 -29
  6. package/dist/admin/lib/import-queries.d.ts +66 -0
  7. package/dist/admin/lib/mutations.d.ts +1 -5
  8. package/dist/admin/lib/queries.d.ts +6 -20
  9. package/dist/admin/messages.d.ts +176 -6
  10. package/dist/admin/pages/catalog/index.d.ts +0 -1
  11. package/dist/admin/pages/imports/detail.d.ts +2 -0
  12. package/dist/admin/pages/imports/index.d.ts +2 -0
  13. package/dist/admin/pages/imports/mapping-csv.d.ts +10 -0
  14. package/dist/admin/pages/imports/progress.d.ts +21 -0
  15. package/dist/admin/pages/imports/records.d.ts +2 -0
  16. package/dist/admin/pages/imports/shared.d.ts +22 -0
  17. package/dist/admin/pages/parked/index.d.ts +2 -0
  18. package/dist/admin/pages/proposals/grouping.d.ts +13 -0
  19. package/dist/admin/pages/proposals/index.d.ts +2 -0
  20. package/dist/admin/pages/provider-prices/index.d.ts +2 -0
  21. package/dist/admin/pages/provider-prices/map-dialog.d.ts +11 -0
  22. package/dist/admin/routes.d.ts +1 -1
  23. package/dist/{admin-attempts-BLeeKABa.js → admin-attempts-DQTg0UzZ.js} +82 -82
  24. package/dist/{admin-attempts-BLeeKABa.js.map → admin-attempts-DQTg0UzZ.js.map} +1 -1
  25. package/dist/{admin-auth-DWVWxDup.js → admin-auth-1aZIgXiS.js} +2 -2
  26. package/dist/{admin-auth-DWVWxDup.js.map → admin-auth-1aZIgXiS.js.map} +1 -1
  27. package/dist/{admin-badge-CrEqD9Ew.js → admin-badge-pgG6D9-a.js} +2 -2
  28. package/dist/{admin-badge-CrEqD9Ew.js.map → admin-badge-pgG6D9-a.js.map} +1 -1
  29. package/dist/{admin-button-a7bDFgp0.js → admin-button-CrcYk5r0.js} +2 -2
  30. package/dist/{admin-button-a7bDFgp0.js.map → admin-button-CrcYk5r0.js.map} +1 -1
  31. package/dist/{admin-capabilities-QYUuJXvG.js → admin-capabilities-BDcZeHL_.js} +2 -2
  32. package/dist/{admin-capabilities-QYUuJXvG.js.map → admin-capabilities-BDcZeHL_.js.map} +1 -1
  33. package/dist/{admin-card-D1tz8Lbh.js → admin-card-DvTMc5Se.js} +2 -2
  34. package/dist/{admin-card-D1tz8Lbh.js.map → admin-card-DvTMc5Se.js.map} +1 -1
  35. package/dist/{admin-catalog-ggiDgWsR.js → admin-catalog-BlF5mnu4.js} +285 -382
  36. package/dist/admin-catalog-BlF5mnu4.js.map +1 -0
  37. package/dist/{admin-dom-VkcwevWr.js → admin-cursor-pager-CIb3Jw2F.js} +20 -25
  38. package/dist/admin-cursor-pager-CIb3Jw2F.js.map +1 -0
  39. package/dist/{admin-customers-BVMg-gUv.js → admin-customers-EpfoWDh-.js} +13 -13
  40. package/dist/{admin-customers-BVMg-gUv.js.map → admin-customers-EpfoWDh-.js.map} +1 -1
  41. package/dist/{admin-dashboard-Cc13i8i9.js → admin-dashboard-CJE63yz4.js} +46 -46
  42. package/dist/{admin-dashboard-Cc13i8i9.js.map → admin-dashboard-CJE63yz4.js.map} +1 -1
  43. package/dist/{admin-data-table-BL84xKKF.js → admin-data-table-hvFcJepL.js} +16 -16
  44. package/dist/{admin-data-table-BL84xKKF.js.map → admin-data-table-hvFcJepL.js.map} +1 -1
  45. package/dist/{admin-detail-CaEwBdX9.js → admin-detail-BRP6pL7t.js} +51 -51
  46. package/dist/{admin-detail-CaEwBdX9.js.map → admin-detail-BRP6pL7t.js.map} +1 -1
  47. package/dist/{admin-detail-9YAep3ts.js → admin-detail-CRzFb_pa.js} +232 -232
  48. package/dist/{admin-detail-9YAep3ts.js.map → admin-detail-CRzFb_pa.js.map} +1 -1
  49. package/dist/admin-detail-Ceod8AXy.js +299 -0
  50. package/dist/admin-detail-Ceod8AXy.js.map +1 -0
  51. package/dist/{admin-detail-C8t5jBps.js → admin-detail-QLxU8r-5.js} +62 -62
  52. package/dist/{admin-detail-C8t5jBps.js.map → admin-detail-QLxU8r-5.js.map} +1 -1
  53. package/dist/admin-detail-pPC8Q9l-.js +710 -0
  54. package/dist/{admin-detail-D2zcz_Xm.js.map → admin-detail-pPC8Q9l-.js.map} +1 -1
  55. package/dist/{admin-dialog-CiAw5vx-.js → admin-dialog-BSRf9Zre.js} +24 -24
  56. package/dist/{admin-dialog-CiAw5vx-.js.map → admin-dialog-BSRf9Zre.js.map} +1 -1
  57. package/dist/admin-dom-C7Y7A6Wa.js +8 -0
  58. package/dist/admin-dom-C7Y7A6Wa.js.map +1 -0
  59. package/dist/{admin-dropdown-menu-CYJbmqK2.js → admin-dropdown-menu-D0E5rwmn.js} +2 -2
  60. package/dist/{admin-dropdown-menu-CYJbmqK2.js.map → admin-dropdown-menu-D0E5rwmn.js.map} +1 -1
  61. package/dist/{admin-fact-card-BHTpDlaX.js → admin-fact-card-BPSVhS15.js} +2 -2
  62. package/dist/{admin-fact-card-BHTpDlaX.js.map → admin-fact-card-BPSVhS15.js.map} +1 -1
  63. package/dist/{admin-health-BUnjbvYR.js → admin-health-D0L5Kig7.js} +84 -84
  64. package/dist/{admin-health-BUnjbvYR.js.map → admin-health-D0L5Kig7.js.map} +1 -1
  65. package/dist/admin-imports-TCOljTgw.js +269 -0
  66. package/dist/admin-imports-TCOljTgw.js.map +1 -0
  67. package/dist/{admin-input-C-S_RGGo.js → admin-input-DJAK9nmk.js} +2 -2
  68. package/dist/{admin-input-C-S_RGGo.js.map → admin-input-DJAK9nmk.js.map} +1 -1
  69. package/dist/{admin-label-DPVYDdSO.js → admin-label-aviN9Gng.js} +2 -2
  70. package/dist/{admin-label-DPVYDdSO.js.map → admin-label-aviN9Gng.js.map} +1 -1
  71. package/dist/{admin-linked-table-row-D-gbTT7a.js → admin-linked-table-row-BGr7JXeM.js} +6 -6
  72. package/dist/{admin-linked-table-row-D-gbTT7a.js.map → admin-linked-table-row-BGr7JXeM.js.map} +1 -1
  73. package/dist/admin-map-dialog-DpGaIq52.js +135 -0
  74. package/dist/admin-map-dialog-DpGaIq52.js.map +1 -0
  75. package/dist/admin-mapping-csv-FtkyTBmk.js +56 -0
  76. package/dist/admin-mapping-csv-FtkyTBmk.js.map +1 -0
  77. package/dist/{admin-metering-BjbL0jjT.js → admin-metering-D-e-37Jn.js} +285 -285
  78. package/dist/{admin-metering-BjbL0jjT.js.map → admin-metering-D-e-37Jn.js.map} +1 -1
  79. package/dist/admin-ops-CQP4TzWM.js +235 -0
  80. package/dist/admin-ops-CQP4TzWM.js.map +1 -0
  81. package/dist/{admin-orders-BVW9-Fs9.js → admin-orders-BJ7W5S8P.js} +32 -32
  82. package/dist/{admin-orders-BVW9-Fs9.js.map → admin-orders-BJ7W5S8P.js.map} +1 -1
  83. package/dist/admin-parked-7HL8mOjw.js +193 -0
  84. package/dist/admin-parked-7HL8mOjw.js.map +1 -0
  85. package/dist/{admin-payments-C5MsFFmm.js → admin-payments-CzkzqYA1.js} +17 -17
  86. package/dist/{admin-payments-C5MsFFmm.js.map → admin-payments-CzkzqYA1.js.map} +1 -1
  87. package/dist/{admin-price-detail-D517JYHB.js → admin-price-detail-CSI5oKdb.js} +74 -74
  88. package/dist/{admin-price-detail-D517JYHB.js.map → admin-price-detail-CSI5oKdb.js.map} +1 -1
  89. package/dist/{admin-price-wizard-bj36o3ux.js → admin-price-wizard-CBEcNGvP.js} +38 -38
  90. package/dist/{admin-price-wizard-bj36o3ux.js.map → admin-price-wizard-CBEcNGvP.js.map} +1 -1
  91. package/dist/admin-proposals-dtgijWKz.js +375 -0
  92. package/dist/admin-proposals-dtgijWKz.js.map +1 -0
  93. package/dist/admin-provider-prices-ChuponcZ.js +246 -0
  94. package/dist/admin-provider-prices-ChuponcZ.js.map +1 -0
  95. package/dist/{admin-range-picker-D2aFF8IV.js → admin-range-picker-De36L-AP.js} +12 -12
  96. package/dist/{admin-range-picker-D2aFF8IV.js.map → admin-range-picker-De36L-AP.js.map} +1 -1
  97. package/dist/admin-records-CUHUOXAU.js +391 -0
  98. package/dist/admin-records-CUHUOXAU.js.map +1 -0
  99. package/dist/{admin-reports-D-ob04d4.js → admin-reports-BFGS_PWf.js} +45 -45
  100. package/dist/{admin-reports-D-ob04d4.js.map → admin-reports-BFGS_PWf.js.map} +1 -1
  101. package/dist/{admin-select-C8O7nx72.js → admin-select-BUcEU5Rg.js} +2 -2
  102. package/dist/{admin-select-C8O7nx72.js.map → admin-select-BUcEU5Rg.js.map} +1 -1
  103. package/dist/{admin-settings-Bs6cLcqi.js → admin-settings-DYC-c7mJ.js} +296 -296
  104. package/dist/{admin-settings-Bs6cLcqi.js.map → admin-settings-DYC-c7mJ.js.map} +1 -1
  105. package/dist/admin-shared-CzG8Pan3.js +222 -0
  106. package/dist/admin-shared-CzG8Pan3.js.map +1 -0
  107. package/dist/{admin-skeleton-wfocg2PJ.js → admin-skeleton-B0yzYY_X.js} +2 -2
  108. package/dist/{admin-skeleton-wfocg2PJ.js.map → admin-skeleton-B0yzYY_X.js.map} +1 -1
  109. package/dist/{admin-status-badge-D_gDMrht.js → admin-status-badge-0-K37EfN.js} +7 -2
  110. package/dist/admin-status-badge-0-K37EfN.js.map +1 -0
  111. package/dist/{admin-subscriptions-DYR1RGMO.js → admin-subscriptions-CvW-YFs0.js} +74 -74
  112. package/dist/{admin-subscriptions-DYR1RGMO.js.map → admin-subscriptions-CvW-YFs0.js.map} +1 -1
  113. package/dist/{admin-switch-F5D0AYjT.js → admin-switch-DDorugaw.js} +2 -2
  114. package/dist/{admin-switch-F5D0AYjT.js.map → admin-switch-DDorugaw.js.map} +1 -1
  115. package/dist/{admin-table-nUij5fLc.js → admin-table-BU6Tie69.js} +2 -2
  116. package/dist/{admin-table-nUij5fLc.js.map → admin-table-BU6Tie69.js.map} +1 -1
  117. package/dist/{admin-tabs-C3myjKdr.js → admin-tabs-D5lqdVcC.js} +2 -2
  118. package/dist/{admin-tabs-C3myjKdr.js.map → admin-tabs-D5lqdVcC.js.map} +1 -1
  119. package/dist/{admin-textarea-v-L-PXIc.js → admin-textarea-Dc6lnEub.js} +2 -2
  120. package/dist/{admin-textarea-v-L-PXIc.js.map → admin-textarea-Dc6lnEub.js.map} +1 -1
  121. package/dist/{admin-typed-confirm-dialog-BLgpuikW.js → admin-typed-confirm-dialog-Bk6XxmPb.js} +6 -6
  122. package/dist/{admin-typed-confirm-dialog-BLgpuikW.js.map → admin-typed-confirm-dialog-Bk6XxmPb.js.map} +1 -1
  123. package/dist/{admin-utils-6yE4YIVI.js → admin-utils-B9eEBNsR.js} +398 -146
  124. package/dist/admin-utils-B9eEBNsR.js.map +1 -0
  125. package/dist/{admin-widget-viz-BiEfckd4.js → admin-widget-viz-8aukE3v_.js} +34 -34
  126. package/dist/{admin-widget-viz-BiEfckd4.js.map → admin-widget-viz-8aukE3v_.js.map} +1 -1
  127. package/dist/admin.css +1 -1
  128. package/dist/admin.js +489 -264
  129. package/dist/admin.js.map +1 -1
  130. package/dist/client/generated/error-codes.d.ts +1 -1
  131. package/dist/client/generated/routes.d.ts +94 -22
  132. package/dist/client/generated/wire.d.ts +89 -14
  133. package/dist/index.js +1 -1
  134. package/dist/styles.css +1 -1
  135. package/package.json +2 -2
  136. package/dist/admin-catalog-ggiDgWsR.js.map +0 -1
  137. package/dist/admin-detail-D2zcz_Xm.js +0 -710
  138. package/dist/admin-dom-VkcwevWr.js.map +0 -1
  139. package/dist/admin-ops-DT8epiXg.js +0 -217
  140. package/dist/admin-ops-DT8epiXg.js.map +0 -1
  141. package/dist/admin-status-badge-D_gDMrht.js.map +0 -1
  142. package/dist/admin-utils-6yE4YIVI.js.map +0 -1
@@ -1,19 +1,19 @@
1
- import { E as e, S as t, f as n, l as r, p as i, w as a } from "./admin-utils-6yE4YIVI.js";
2
- import { t as o } from "./admin-button-a7bDFgp0.js";
3
- import { t as s } from "./admin-input-C-S_RGGo.js";
4
- import { a as c, i as l, l as u, n as d, u as f } from "./admin-capabilities-QYUuJXvG.js";
1
+ import { C as e, D as t, T as n, f as r, l as i, p as a } from "./admin-utils-B9eEBNsR.js";
2
+ import { t as o } from "./admin-button-CrcYk5r0.js";
3
+ import { t as s } from "./admin-input-DJAK9nmk.js";
4
+ import { a as c, i as l, l as u, n as d, u as f } from "./admin-capabilities-BDcZeHL_.js";
5
5
  import { n as p, o as m, s as h, t as g } from "./admin-format-DoohJ7Fg.js";
6
6
  import { n as _ } from "./admin-confirm-katGq0Qo.js";
7
7
  import { t as v } from "./admin-form-field-errors-hbUMIriS.js";
8
- import { a as y, i as b, n as x, r as S, t as C } from "./admin-select-C8O7nx72.js";
9
- import { a as w, n as ee, o as te, r as T, s as E, t as ne } from "./admin-table-nUij5fLc.js";
10
- import { t as D } from "./admin-badge-CrEqD9Ew.js";
11
- import { a as O, i as k, n as A, o as j, r as M, s as N, t as P } from "./admin-dialog-CiAw5vx-.js";
12
- import { t as F } from "./admin-label-DPVYDdSO.js";
13
- import { t as re } from "./admin-switch-F5D0AYjT.js";
8
+ import { a as y, i as b, n as x, r as S, t as C } from "./admin-select-BUcEU5Rg.js";
9
+ import { a as w, n as ee, o as te, r as T, s as E, t as ne } from "./admin-table-BU6Tie69.js";
10
+ import { t as D } from "./admin-badge-pgG6D9-a.js";
11
+ import { a as O, i as k, n as A, o as j, r as M, s as N, t as P } from "./admin-dialog-BSRf9Zre.js";
12
+ import { t as F } from "./admin-label-aviN9Gng.js";
13
+ import { t as re } from "./admin-switch-DDorugaw.js";
14
14
  import { n as I } from "./admin-dialog-width-BPrgdYlj.js";
15
- import { i as L, n as R, r as ie, t as ae } from "./admin-tabs-C3myjKdr.js";
16
- import { t as oe } from "./admin-typed-confirm-dialog-BLgpuikW.js";
15
+ import { t as ie } from "./admin-typed-confirm-dialog-Bk6XxmPb.js";
16
+ import { i as L, n as R, r as ae, t as oe } from "./admin-tabs-D5lqdVcC.js";
17
17
  import * as z from "react";
18
18
  import { useMutation as B, useQuery as V, useQueryClient as H } from "@tanstack/react-query";
19
19
  import { Fragment as U, jsx as W, jsxs as G } from "react/jsx-runtime";
@@ -21,26 +21,26 @@ import { HugeiconsIcon as se } from "@hugeicons/react";
21
21
  import { Add01Icon as ce, Delete02Icon as le } from "@hugeicons/core-free-icons";
22
22
  import { useForm as K } from "@tanstack/react-form";
23
23
  //#region src/admin/pages/settings/configuration-edit.ts
24
- function q(e) {
25
- let { toast: n, toastApiError: r, toastStaleEdit: a, adminMutations: o } = i(), [s, c] = z.useState(null), l = H(), u = B(o.updateMerchantConfiguration(l));
24
+ function q(t) {
25
+ let { toast: n, toastApiError: r, toastStaleEdit: i, adminMutations: o } = a(), [s, c] = z.useState(null), l = H(), u = B(o.updateMerchantConfiguration(l));
26
26
  return {
27
27
  editing: s !== null,
28
28
  open: () => {
29
- e && c(e.revision);
29
+ t && c(t.revision);
30
30
  },
31
31
  close: () => c(null),
32
- save: async (e, i, o) => {
32
+ save: async (t, a, o) => {
33
33
  if (s !== null) try {
34
34
  await u.mutateAsync({
35
- ...e,
35
+ ...t,
36
36
  expected_revision: s
37
- }), n.success(i), c(null);
38
- } catch (e) {
39
- if (e instanceof t && e.revisionMismatch) {
40
- a("The configuration"), c(null);
37
+ }), n.success(a), c(null);
38
+ } catch (t) {
39
+ if (t instanceof e && t.revisionMismatch) {
40
+ i("The configuration"), c(null);
41
41
  return;
42
42
  }
43
- r(e, o), e instanceof t && e.merchantConfigReadOnly && c(null);
43
+ r(t, o), t instanceof e && t.merchantConfigReadOnly && c(null);
44
44
  }
45
45
  }
46
46
  };
@@ -48,35 +48,35 @@ function q(e) {
48
48
  //#endregion
49
49
  //#region src/admin/pages/settings/setting-fields.tsx
50
50
  function J() {
51
- let { adminQueries: e } = i(), { data: t } = V(e.config());
51
+ let { adminQueries: e } = a(), { data: t } = V(e.config());
52
52
  return !t || t.capabilities.features?.merchant_config_edits ? null : /* @__PURE__ */ W("p", {
53
53
  className: "rounded-md border px-3 py-2 text-sm text-muted-foreground",
54
- children: /* @__PURE__ */ W(a, { id: "Read-only: this merchant's configuration comes from a file. Change it there." })
54
+ children: /* @__PURE__ */ W(n, { id: "Read-only: this merchant's configuration comes from a file. Change it there." })
55
55
  });
56
56
  }
57
- function Y({ edits: e, editing: t, form: n, saving: r, canSave: i = !0, onEdit: s, onCancel: c }) {
57
+ function Y({ edits: e, editing: t, form: r, saving: i, canSave: a = !0, onEdit: s, onCancel: c }) {
58
58
  return e ? t ? /* @__PURE__ */ G("div", {
59
59
  className: "flex items-center gap-2",
60
60
  children: [/* @__PURE__ */ W(o, {
61
61
  type: "button",
62
62
  variant: "outline",
63
63
  size: "sm",
64
- disabled: r,
64
+ disabled: i,
65
65
  onClick: c,
66
- children: /* @__PURE__ */ W(a, { id: "Cancel" })
66
+ children: /* @__PURE__ */ W(n, { id: "Cancel" })
67
67
  }), /* @__PURE__ */ W(o, {
68
68
  type: "submit",
69
69
  size: "sm",
70
- form: n,
71
- disabled: !i || r,
72
- children: r ? "Saving…" : "Save"
70
+ form: r,
71
+ disabled: !a || i,
72
+ children: i ? "Saving…" : "Save"
73
73
  })]
74
74
  }) : /* @__PURE__ */ W(o, {
75
75
  type: "button",
76
76
  variant: "outline",
77
77
  size: "sm",
78
78
  onClick: s,
79
- children: /* @__PURE__ */ W(a, { id: "Edit" })
79
+ children: /* @__PURE__ */ W(n, { id: "Edit" })
80
80
  }) : null;
81
81
  }
82
82
  function X({ label: e, value: t }) {
@@ -91,13 +91,13 @@ function X({ label: e, value: t }) {
91
91
  })]
92
92
  });
93
93
  }
94
- function Z({ label: t, id: n, children: r }) {
95
- let { id: i } = e();
94
+ function Z({ label: e, id: n, children: r }) {
95
+ let { id: i } = t();
96
96
  return /* @__PURE__ */ G("div", {
97
97
  className: "grid gap-2 md:grid-cols-[11rem_minmax(0,1fr)] md:items-center md:gap-6",
98
98
  children: [/* @__PURE__ */ W(F, {
99
99
  htmlFor: i(n),
100
- children: t
100
+ children: e
101
101
  }), /* @__PURE__ */ W("div", {
102
102
  className: "min-w-0",
103
103
  children: r
@@ -107,28 +107,28 @@ function Z({ label: t, id: n, children: r }) {
107
107
  //#endregion
108
108
  //#region src/admin/pages/settings/notifications.tsx
109
109
  function ue() {
110
- let { adminQueries: e } = i(), t = V(e.merchantConfiguration("Load settings")), n = V(e.webhooks()), r = f(), o = n.data?.data ?? [];
110
+ let { adminQueries: e } = a(), t = V(e.merchantConfiguration("Load settings")), r = V(e.webhooks()), i = f(), o = r.data?.data ?? [];
111
111
  return /* @__PURE__ */ G("div", {
112
112
  className: "flex flex-col gap-10",
113
113
  children: [
114
114
  /* @__PURE__ */ W(J, {}),
115
115
  t.data ? /* @__PURE__ */ W(de, {
116
116
  configuration: t.data,
117
- edits: r
117
+ edits: i
118
118
  }) : /* @__PURE__ */ W("p", {
119
119
  className: "text-sm text-muted-foreground",
120
- children: /* @__PURE__ */ W(a, { id: "Loading…" })
120
+ children: /* @__PURE__ */ W(n, { id: "Loading…" })
121
121
  }),
122
122
  /* @__PURE__ */ W(pe, {
123
123
  webhooks: o,
124
- loading: n.isPending,
125
- edits: r
124
+ loading: r.isPending,
125
+ edits: i
126
126
  })
127
127
  ]
128
128
  });
129
129
  }
130
- function de({ configuration: t, edits: n }) {
131
- let { id: r, text: i } = e(), o = t.alert_email ?? "", c = q(t), l = K({
130
+ function de({ configuration: e, edits: r }) {
131
+ let { id: i, text: a } = t(), o = e.alert_email ?? "", c = q(e), l = K({
132
132
  defaultValues: { email: o },
133
133
  onSubmit: ({ value: e }) => c.save({ alert_email: e.email.trim() }, e.email.trim() ? "Alert email saved" : "Alert email cleared", "Save alert email")
134
134
  });
@@ -140,15 +140,15 @@ function de({ configuration: t, edits: n }) {
140
140
  className: "grid gap-1",
141
141
  children: [/* @__PURE__ */ W("h2", {
142
142
  className: "text-base font-semibold",
143
- children: /* @__PURE__ */ W(a, { id: "Email delivery" })
143
+ children: /* @__PURE__ */ W(n, { id: "Email delivery" })
144
144
  }), /* @__PURE__ */ W("p", {
145
145
  className: "text-sm text-muted-foreground",
146
- children: /* @__PURE__ */ W(a, { id: "Send email alerts to this address." })
146
+ children: /* @__PURE__ */ W(n, { id: "Send email alerts to this address." })
147
147
  })]
148
148
  }), /* @__PURE__ */ W(l.Subscribe, {
149
149
  selector: (e) => e.isSubmitting,
150
150
  children: (e) => /* @__PURE__ */ W(Y, {
151
- edits: n,
151
+ edits: r,
152
152
  editing: c.editing,
153
153
  form: "alert-email-form",
154
154
  saving: e,
@@ -159,19 +159,19 @@ function de({ configuration: t, edits: n }) {
159
159
  })
160
160
  })]
161
161
  }), c.editing ? /* @__PURE__ */ W("form", {
162
- id: r("alert-email-form"),
162
+ id: i("alert-email-form"),
163
163
  onSubmit: (e) => {
164
164
  e.preventDefault(), e.stopPropagation(), l.handleSubmit();
165
165
  },
166
166
  children: /* @__PURE__ */ W(l.Field, {
167
167
  name: "email",
168
168
  children: (e) => /* @__PURE__ */ W(Z, {
169
- label: i("Alert email"),
169
+ label: a("Alert email"),
170
170
  id: "alert-email",
171
171
  children: /* @__PURE__ */ W(s, {
172
- id: r("alert-email"),
172
+ id: i("alert-email"),
173
173
  type: "email",
174
- placeholder: i("alerts@example.com"),
174
+ placeholder: a("alerts@example.com"),
175
175
  value: e.state.value,
176
176
  onBlur: e.handleBlur,
177
177
  onChange: (t) => e.handleChange(t.target.value)
@@ -179,7 +179,7 @@ function de({ configuration: t, edits: n }) {
179
179
  })
180
180
  })
181
181
  }) : /* @__PURE__ */ W("dl", { children: /* @__PURE__ */ W(X, {
182
- label: i("Alert email"),
182
+ label: a("Alert email"),
183
183
  value: o
184
184
  }) })]
185
185
  });
@@ -198,7 +198,7 @@ var fe = [
198
198
  label: "Slack"
199
199
  }
200
200
  ];
201
- function pe({ webhooks: e, loading: t, edits: n }) {
201
+ function pe({ webhooks: e, loading: t, edits: r }) {
202
202
  return /* @__PURE__ */ G("section", {
203
203
  className: "grid gap-5",
204
204
  children: [/* @__PURE__ */ G("div", {
@@ -207,18 +207,18 @@ function pe({ webhooks: e, loading: t, edits: n }) {
207
207
  className: "grid max-w-2xl gap-1",
208
208
  children: [/* @__PURE__ */ W("h2", {
209
209
  className: "text-base font-semibold",
210
- children: /* @__PURE__ */ W(a, { id: "Webhooks" })
210
+ children: /* @__PURE__ */ W(n, { id: "Webhooks" })
211
211
  }), /* @__PURE__ */ W("p", {
212
212
  className: "text-sm text-pretty text-muted-foreground",
213
- children: /* @__PURE__ */ W(a, { id: "Send alerts to Discord, Slack, or your own endpoint." })
213
+ children: /* @__PURE__ */ W(n, { id: "Send alerts to Discord, Slack, or your own endpoint." })
214
214
  })]
215
- }), n && /* @__PURE__ */ W(he, {})]
215
+ }), r && /* @__PURE__ */ W(he, {})]
216
216
  }), t ? /* @__PURE__ */ W("p", {
217
217
  className: "text-sm text-muted-foreground",
218
- children: /* @__PURE__ */ W(a, { id: "Loading…" })
218
+ children: /* @__PURE__ */ W(n, { id: "Loading…" })
219
219
  }) : e.length === 0 ? /* @__PURE__ */ W("p", {
220
220
  className: "py-2 text-sm text-muted-foreground",
221
- children: /* @__PURE__ */ W(a, { id: "No webhooks configured." })
221
+ children: /* @__PURE__ */ W(n, { id: "No webhooks configured." })
222
222
  }) : /* @__PURE__ */ G(ne, {
223
223
  className: "min-w-[36rem]",
224
224
  children: [/* @__PURE__ */ W(te, { children: /* @__PURE__ */ G(E, {
@@ -226,32 +226,32 @@ function pe({ webhooks: e, loading: t, edits: n }) {
226
226
  children: [
227
227
  /* @__PURE__ */ W(w, {
228
228
  className: "text-muted-foreground",
229
- children: /* @__PURE__ */ W(a, { id: "Name" })
229
+ children: /* @__PURE__ */ W(n, { id: "Name" })
230
230
  }),
231
231
  /* @__PURE__ */ W(w, {
232
232
  className: "text-muted-foreground",
233
- children: /* @__PURE__ */ W(a, { id: "Format" })
233
+ children: /* @__PURE__ */ W(n, { id: "Format" })
234
234
  }),
235
235
  /* @__PURE__ */ W(w, {
236
236
  className: "text-muted-foreground",
237
237
  children: "URL"
238
238
  }),
239
- n && /* @__PURE__ */ W(w, {
239
+ r && /* @__PURE__ */ W(w, {
240
240
  className: "text-right text-muted-foreground",
241
- children: /* @__PURE__ */ W(a, { id: "Action" })
241
+ children: /* @__PURE__ */ W(n, { id: "Action" })
242
242
  })
243
243
  ]
244
244
  }) }), /* @__PURE__ */ W(ee, { children: e.map((e) => /* @__PURE__ */ W(me, {
245
245
  webhook: e,
246
- edits: n
246
+ edits: r
247
247
  }, e.id)) })]
248
248
  })]
249
249
  });
250
250
  }
251
- function me({ webhook: t, edits: n }) {
252
- let { toast: r, toastApiError: s, adminMutations: c } = i(), { text: l } = e(), [u, d] = z.useState(!1), f = H(), p = B(c.deleteWebhook(f)), m = t.name ?? t.destination_host;
251
+ function me({ webhook: e, edits: r }) {
252
+ let { toast: i, toastApiError: s, adminMutations: c } = a(), { text: l } = t(), [u, d] = z.useState(!1), f = H(), p = B(c.deleteWebhook(f)), m = e.name ?? e.destination_host;
253
253
  return /* @__PURE__ */ G(E, {
254
- className: t.enabled ? void 0 : "opacity-60",
254
+ className: e.enabled ? void 0 : "opacity-60",
255
255
  children: [
256
256
  /* @__PURE__ */ W(T, {
257
257
  className: "py-3 font-medium",
@@ -263,24 +263,24 @@ function me({ webhook: t, edits: n }) {
263
263
  className: "flex flex-wrap gap-1",
264
264
  children: [/* @__PURE__ */ W(D, {
265
265
  variant: "secondary",
266
- children: t.format
267
- }), !t.enabled && /* @__PURE__ */ W(D, {
266
+ children: e.format
267
+ }), !e.enabled && /* @__PURE__ */ W(D, {
268
268
  variant: "outline",
269
- children: /* @__PURE__ */ W(a, { id: "disabled" })
269
+ children: /* @__PURE__ */ W(n, { id: "disabled" })
270
270
  })]
271
271
  })
272
272
  }),
273
273
  /* @__PURE__ */ W(T, {
274
274
  className: "max-w-[22rem] truncate py-3 text-xs text-muted-foreground",
275
- title: t.destination_host,
276
- children: t.destination_host
275
+ title: e.destination_host,
276
+ children: e.destination_host
277
277
  }),
278
- n && /* @__PURE__ */ W(T, {
278
+ r && /* @__PURE__ */ W(T, {
279
279
  className: "py-3 text-right",
280
280
  children: /* @__PURE__ */ G("div", {
281
281
  className: "flex justify-end gap-1",
282
282
  children: [
283
- /* @__PURE__ */ W(he, { webhook: t }),
283
+ /* @__PURE__ */ W(he, { webhook: e }),
284
284
  /* @__PURE__ */ W(o, {
285
285
  variant: "ghost",
286
286
  size: "icon",
@@ -291,7 +291,7 @@ function me({ webhook: t, edits: n }) {
291
291
  className: "size-4 text-muted-foreground"
292
292
  })
293
293
  }),
294
- /* @__PURE__ */ W(oe, {
294
+ /* @__PURE__ */ W(ie, {
295
295
  open: u,
296
296
  onOpenChange: d,
297
297
  title: `Delete "${m}"?`,
@@ -300,7 +300,7 @@ function me({ webhook: t, edits: n }) {
300
300
  actionLabel: "Delete webhook",
301
301
  onConfirm: async () => {
302
302
  try {
303
- await p.mutateAsync(t.id), r.success("Webhook deleted");
303
+ await p.mutateAsync(e.id), i.success("Webhook deleted");
304
304
  } catch (e) {
305
305
  s(e, "Delete webhook");
306
306
  }
@@ -312,32 +312,32 @@ function me({ webhook: t, edits: n }) {
312
312
  ]
313
313
  });
314
314
  }
315
- function he({ webhook: t }) {
316
- let { toast: n, toastApiError: r, adminMutations: c } = i(), { id: l, text: u } = e(), [d, f] = z.useState(!1), p = H(), m = B(c.createWebhook(p)), h = B(c.updateWebhook(p)), g = () => ({
317
- name: t?.name ?? "",
315
+ function he({ webhook: e }) {
316
+ let { toast: r, toastApiError: i, adminMutations: c } = a(), { id: l, text: u } = t(), [d, f] = z.useState(!1), p = H(), m = B(c.createWebhook(p)), h = B(c.updateWebhook(p)), g = () => ({
317
+ name: e?.name ?? "",
318
318
  url: "",
319
- format: t?.format ?? "generic",
320
- enabled: t?.enabled ?? !0
319
+ format: e?.format ?? "generic",
320
+ enabled: e?.enabled ?? !0
321
321
  }), _ = K({
322
322
  defaultValues: g(),
323
- onSubmit: async ({ value: e }) => {
324
- let i = e.url.trim();
323
+ onSubmit: async ({ value: t }) => {
324
+ let n = t.url.trim();
325
325
  try {
326
- t ? await h.mutateAsync({
327
- id: t.id,
326
+ e ? await h.mutateAsync({
327
+ id: e.id,
328
328
  webhook: {
329
- name: e.name.trim() || null,
330
- format: e.format,
331
- enabled: e.enabled,
332
- ...i ? { url: i } : {}
329
+ name: t.name.trim() || null,
330
+ format: t.format,
331
+ enabled: t.enabled,
332
+ ...n ? { url: n } : {}
333
333
  }
334
334
  }) : await m.mutateAsync({
335
- name: e.name.trim(),
336
- url: i,
337
- format: e.format
338
- }), n.success(t ? "Webhook saved" : "Webhook added"), w(!1);
339
- } catch (e) {
340
- r(e, t ? "Save webhook" : "Add webhook");
335
+ name: t.name.trim(),
336
+ url: n,
337
+ format: t.format
338
+ }), r.success(e ? "Webhook saved" : "Webhook added"), w(!1);
339
+ } catch (t) {
340
+ i(t, e ? "Save webhook" : "Add webhook");
341
341
  }
342
342
  }
343
343
  }), w = (e) => {
@@ -350,16 +350,16 @@ function he({ webhook: t }) {
350
350
  size: "sm",
351
351
  variant: "outline",
352
352
  children: [
353
- !t && /* @__PURE__ */ W(se, {
353
+ !e && /* @__PURE__ */ W(se, {
354
354
  icon: ce,
355
355
  className: "size-4"
356
356
  }),
357
357
  " ",
358
- t ? "Edit" : "Add webhook"
358
+ e ? "Edit" : "Add webhook"
359
359
  ]
360
360
  }) }), /* @__PURE__ */ G(A, {
361
361
  className: I,
362
- children: [/* @__PURE__ */ G(O, { children: [/* @__PURE__ */ W(j, { children: t ? `Edit ${t.name ?? t.destination_host}` : "Add webhook" }), /* @__PURE__ */ W(M, { children: t ? "The current URL is never shown. Paste a new one to replace it, or leave it blank to keep it." : "Paste a webhook address from Discord, Slack, or your own alert receiver." })] }), /* @__PURE__ */ G("form", {
362
+ children: [/* @__PURE__ */ G(O, { children: [/* @__PURE__ */ W(j, { children: e ? `Edit ${e.name ?? e.destination_host}` : "Add webhook" }), /* @__PURE__ */ W(M, { children: e ? "The current URL is never shown. Paste a new one to replace it, or leave it blank to keep it." : "Paste a webhook address from Discord, Slack, or your own alert receiver." })] }), /* @__PURE__ */ G("form", {
363
363
  onSubmit: (e) => {
364
364
  e.preventDefault(), e.stopPropagation(), _.handleSubmit();
365
365
  },
@@ -369,13 +369,13 @@ function he({ webhook: t }) {
369
369
  children: [
370
370
  /* @__PURE__ */ W(_.Field, {
371
371
  name: "name",
372
- validators: { onChange: ({ value: e }) => t || e.trim() ? void 0 : "Enter a webhook name" },
372
+ validators: { onChange: ({ value: t }) => e || t.trim() ? void 0 : "Enter a webhook name" },
373
373
  children: (e) => /* @__PURE__ */ G("div", {
374
374
  className: "grid gap-1.5",
375
375
  children: [
376
376
  /* @__PURE__ */ W(F, {
377
377
  htmlFor: l("wh-name"),
378
- children: /* @__PURE__ */ W(a, { id: "Name" })
378
+ children: /* @__PURE__ */ W(n, { id: "Name" })
379
379
  }),
380
380
  /* @__PURE__ */ W(s, {
381
381
  id: l("wh-name"),
@@ -395,7 +395,7 @@ function he({ webhook: t }) {
395
395
  className: "grid gap-1.5",
396
396
  children: [/* @__PURE__ */ W(F, {
397
397
  htmlFor: l("wh-format"),
398
- children: /* @__PURE__ */ W(a, { id: "Format" })
398
+ children: /* @__PURE__ */ W(n, { id: "Format" })
399
399
  }), /* @__PURE__ */ G(C, {
400
400
  value: e.state.value,
401
401
  onValueChange: (t) => e.handleChange(t),
@@ -412,38 +412,38 @@ function he({ webhook: t }) {
412
412
  }),
413
413
  /* @__PURE__ */ W(_.Field, {
414
414
  name: "url",
415
- validators: { onChange: ({ value: e }) => {
416
- if (!e.trim()) return t ? void 0 : "Enter a webhook URL";
415
+ validators: { onChange: ({ value: t }) => {
416
+ if (!t.trim()) return e ? void 0 : "Enter a webhook URL";
417
417
  try {
418
- new URL(e);
418
+ new URL(t);
419
419
  return;
420
420
  } catch {
421
421
  return "Enter a valid webhook URL";
422
422
  }
423
423
  } },
424
- children: (e) => /* @__PURE__ */ G("div", {
424
+ children: (t) => /* @__PURE__ */ G("div", {
425
425
  className: "grid gap-1.5",
426
426
  children: [
427
427
  /* @__PURE__ */ W(F, {
428
428
  htmlFor: l("wh-url"),
429
- children: /* @__PURE__ */ W(a, { id: "Webhook URL" })
429
+ children: /* @__PURE__ */ W(n, { id: "Webhook URL" })
430
430
  }),
431
431
  /* @__PURE__ */ W(s, {
432
432
  id: l("wh-url"),
433
433
  type: "url",
434
434
  autoComplete: "off",
435
435
  className: "text-xs",
436
- placeholder: t ? "unchanged" : "https://discord.com/api/webhooks/…",
437
- value: e.state.value,
438
- onBlur: e.handleBlur,
439
- onChange: (t) => e.handleChange(t.target.value),
440
- "aria-invalid": e.state.meta.errors.length > 0
436
+ placeholder: e ? "unchanged" : "https://discord.com/api/webhooks/…",
437
+ value: t.state.value,
438
+ onBlur: t.handleBlur,
439
+ onChange: (e) => t.handleChange(e.target.value),
440
+ "aria-invalid": t.state.meta.errors.length > 0
441
441
  }),
442
- /* @__PURE__ */ W(v, { errors: e.state.meta.errors })
442
+ /* @__PURE__ */ W(v, { errors: t.state.meta.errors })
443
443
  ]
444
444
  })
445
445
  }),
446
- t && /* @__PURE__ */ W(_.Field, {
446
+ e && /* @__PURE__ */ W(_.Field, {
447
447
  name: "enabled",
448
448
  children: (e) => /* @__PURE__ */ G("div", {
449
449
  className: "flex items-center gap-2",
@@ -453,7 +453,7 @@ function he({ webhook: t }) {
453
453
  onCheckedChange: e.handleChange
454
454
  }), /* @__PURE__ */ W(F, {
455
455
  htmlFor: l("wh-enabled"),
456
- children: /* @__PURE__ */ W(a, { id: "Enabled" })
456
+ children: /* @__PURE__ */ W(n, { id: "Enabled" })
457
457
  })]
458
458
  })
459
459
  })
@@ -466,10 +466,10 @@ function he({ webhook: t }) {
466
466
  e.canSubmit,
467
467
  e.isSubmitting
468
468
  ],
469
- children: ([e, n, r, i, a]) => /* @__PURE__ */ W(o, {
469
+ children: ([t, n, r, i, a]) => /* @__PURE__ */ W(o, {
470
470
  type: "submit",
471
- disabled: (t ? !r : !e.trim() || !n.trim()) || !i || a,
472
- children: a ? "Saving…" : t ? "Save" : "Add webhook"
471
+ disabled: (e ? !r : !t.trim() || !n.trim()) || !i || a,
472
+ children: a ? "Saving…" : e ? "Save" : "Add webhook"
473
473
  })
474
474
  }) })]
475
475
  })]
@@ -479,13 +479,13 @@ function he({ webhook: t }) {
479
479
  //#endregion
480
480
  //#region src/admin/pages/settings/custody.tsx
481
481
  function ge() {
482
- let e = i(), t = H(), n = f(), r = V(e.adminQueries.merchantConfiguration()), a = V(e.adminQueries.psps()), s = [...e.queryKeys.settings(), "custodians"], c = V({
482
+ let e = a(), t = H(), n = f(), r = V(e.adminQueries.merchantConfiguration()), i = V(e.adminQueries.psps()), s = [...e.queryKeys.settings(), "custodians"], c = V({
483
483
  queryKey: s,
484
484
  queryFn: ({ signal: t }) => e.listCustodians(t)
485
485
  }), [l, u] = z.useState(null), [d] = z.useState(() => e.selectedMerchant()), p = () => t.invalidateQueries({ queryKey: e.queryKeys.settings() }), m = B({
486
486
  mutationFn: async ({ psp: t, custody: n }) => {
487
487
  if (d !== e.selectedMerchant()) throw Error("Merchant changed; reopen settings");
488
- let r = a.data?.data.find((e) => e.id === t);
488
+ let r = i.data?.data.find((e) => e.id === t);
489
489
  if (!r) throw Error("PSP is no longer available");
490
490
  return e.updatePSP(t, {
491
491
  expected_revision: r.revision,
@@ -506,8 +506,8 @@ function ge() {
506
506
  onSuccess: p,
507
507
  onError: (t) => e.toastApiError(t, "Save card routing")
508
508
  });
509
- if (!r.data || !a.data || !c.data) return null;
510
- let g = a.data.data.filter((e) => !e.archived && (e.rail === "nmi" || e.rail === "stripe"));
509
+ if (!r.data || !i.data || !c.data) return null;
510
+ let g = i.data.data.filter((e) => !e.archived && (e.rail === "nmi" || e.rail === "stripe"));
511
511
  return /* @__PURE__ */ G("section", {
512
512
  className: "grid gap-5",
513
513
  "aria-label": "Card vaults",
@@ -649,9 +649,9 @@ function ge() {
649
649
  });
650
650
  }
651
651
  function _e({ current: e, close: t, saved: n }) {
652
- let r = i(), [a] = z.useState(() => r.selectedMerchant()), c = B({
652
+ let r = a(), [i] = z.useState(() => r.selectedMerchant()), c = B({
653
653
  mutationFn: async (t) => {
654
- if (a !== r.selectedMerchant()) throw Error("Merchant changed; reopen this form");
654
+ if (i !== r.selectedMerchant()) throw Error("Merchant changed; reopen this form");
655
655
  let n = String(t.get("private_key") ?? "").trim();
656
656
  return r.putCustodian(e?.key ?? String(t.get("key") ?? "").trim(), {
657
657
  expected_revision: e?.revision ?? 0,
@@ -752,8 +752,8 @@ function _e({ current: e, close: t, saved: n }) {
752
752
  //#region src/admin/pages/settings/index.tsx
753
753
  var Q = "flex-none px-0 after:bg-primary group-data-horizontal/tabs:after:bottom-[-1px]";
754
754
  function ve() {
755
- let [e, t] = r(), i = u(), o = l(), s = n().props.settingsTabs ?? [], c = s.map((e) => e.value), f = d(null, i, o, c), p = d(e.get("tab"), i, o, c);
756
- return /* @__PURE__ */ G(ae, {
755
+ let [e, t] = i(), a = u(), o = l(), s = r().props.settingsTabs ?? [], c = s.map((e) => e.value), f = d(null, a, o, c), p = d(e.get("tab"), a, o, c);
756
+ return /* @__PURE__ */ G(oe, {
757
757
  value: p,
758
758
  onValueChange: (n) => {
759
759
  let r = new URLSearchParams(e);
@@ -763,29 +763,29 @@ function ve() {
763
763
  children: [
764
764
  /* @__PURE__ */ W("div", {
765
765
  className: "overflow-x-auto",
766
- children: /* @__PURE__ */ G(ie, {
766
+ children: /* @__PURE__ */ G(ae, {
767
767
  variant: "line",
768
768
  className: "w-max min-w-full justify-start gap-6 rounded-none p-0",
769
769
  children: [
770
- i && /* @__PURE__ */ W(L, {
770
+ a && /* @__PURE__ */ W(L, {
771
771
  value: "merchant",
772
772
  className: Q,
773
- children: /* @__PURE__ */ W(a, { id: "Merchant" })
773
+ children: /* @__PURE__ */ W(n, { id: "Merchant" })
774
774
  }),
775
- i && /* @__PURE__ */ W(L, {
775
+ a && /* @__PURE__ */ W(L, {
776
776
  value: "notifications",
777
777
  className: Q,
778
- children: /* @__PURE__ */ W(a, { id: "Notifications" })
778
+ children: /* @__PURE__ */ W(n, { id: "Notifications" })
779
779
  }),
780
- i && /* @__PURE__ */ W(L, {
780
+ a && /* @__PURE__ */ W(L, {
781
781
  value: "psps",
782
782
  className: Q,
783
- children: /* @__PURE__ */ W(a, { id: "PSPs" })
783
+ children: /* @__PURE__ */ W(n, { id: "PSPs" })
784
784
  }),
785
785
  o && /* @__PURE__ */ W(L, {
786
786
  value: "customer-controls",
787
787
  className: Q,
788
- children: /* @__PURE__ */ W(a, { id: "Customer controls" })
788
+ children: /* @__PURE__ */ W(n, { id: "Customer controls" })
789
789
  }),
790
790
  s.map((e) => /* @__PURE__ */ W(L, {
791
791
  value: e.value,
@@ -795,15 +795,15 @@ function ve() {
795
795
  ]
796
796
  })
797
797
  }),
798
- i && /* @__PURE__ */ W(R, {
798
+ a && /* @__PURE__ */ W(R, {
799
799
  value: "merchant",
800
800
  children: /* @__PURE__ */ W(ye, {})
801
801
  }),
802
- i && /* @__PURE__ */ W(R, {
802
+ a && /* @__PURE__ */ W(R, {
803
803
  value: "notifications",
804
804
  children: /* @__PURE__ */ W(ue, {})
805
805
  }),
806
- i && /* @__PURE__ */ W(R, {
806
+ a && /* @__PURE__ */ W(R, {
807
807
  value: "psps",
808
808
  children: /* @__PURE__ */ W(Se, {})
809
809
  }),
@@ -819,34 +819,34 @@ function ve() {
819
819
  });
820
820
  }
821
821
  function ye() {
822
- let { adminQueries: e } = i(), { data: t } = V(e.merchantConfiguration("Load settings")), n = f();
822
+ let { adminQueries: e } = a(), { data: t } = V(e.merchantConfiguration("Load settings")), r = f();
823
823
  return t ? /* @__PURE__ */ G("div", {
824
824
  className: "grid gap-10",
825
825
  children: [
826
826
  /* @__PURE__ */ W(J, {}),
827
827
  /* @__PURE__ */ W(be, {
828
828
  configuration: t,
829
- edits: n
829
+ edits: r
830
830
  }),
831
831
  /* @__PURE__ */ W(xe, {
832
832
  configuration: t,
833
- edits: n
833
+ edits: r
834
834
  })
835
835
  ]
836
836
  }) : /* @__PURE__ */ W("p", {
837
837
  className: "text-sm text-muted-foreground",
838
- children: /* @__PURE__ */ W(a, { id: "Loading…" })
838
+ children: /* @__PURE__ */ W(n, { id: "Loading…" })
839
839
  });
840
840
  }
841
- function be({ configuration: t, edits: n }) {
842
- let { id: r, text: i } = e(), o = t.profile, c = () => ({
843
- displayName: t.display_name,
841
+ function be({ configuration: e, edits: r }) {
842
+ let { id: i, text: a } = t(), o = e.profile, c = () => ({
843
+ displayName: e.display_name,
844
844
  fromEmail: o?.from_email ?? "",
845
845
  supportURL: o?.support_url ?? "",
846
846
  subscribeURL: o?.subscribe_url ?? "",
847
847
  billingURL: o?.billing_url ?? "",
848
848
  logoURL: o?.logo_url ?? ""
849
- }), l = q(t), u = K({
849
+ }), l = q(e), u = K({
850
850
  defaultValues: c(),
851
851
  onSubmit: ({ value: e }) => l.save({
852
852
  display_name: e.displayName.trim(),
@@ -867,15 +867,15 @@ function be({ configuration: t, edits: n }) {
867
867
  className: "grid gap-1",
868
868
  children: [/* @__PURE__ */ W("h2", {
869
869
  className: "text-base font-semibold",
870
- children: /* @__PURE__ */ W(a, { id: "Merchant profile" })
870
+ children: /* @__PURE__ */ W(n, { id: "Merchant profile" })
871
871
  }), /* @__PURE__ */ W("p", {
872
872
  className: "text-sm text-pretty text-muted-foreground",
873
- children: /* @__PURE__ */ W(a, { id: "Customer-facing merchant details used on invoices and emails." })
873
+ children: /* @__PURE__ */ W(n, { id: "Customer-facing merchant details used on invoices and emails." })
874
874
  })]
875
875
  }), /* @__PURE__ */ W(u.Subscribe, {
876
876
  selector: (e) => [e.canSubmit, e.isSubmitting],
877
877
  children: ([e, t]) => /* @__PURE__ */ W(Y, {
878
- edits: n,
878
+ edits: r,
879
879
  editing: l.editing,
880
880
  form: "merchant-profile-form",
881
881
  saving: t,
@@ -887,7 +887,7 @@ function be({ configuration: t, edits: n }) {
887
887
  })
888
888
  })]
889
889
  }), l.editing ? /* @__PURE__ */ G("form", {
890
- id: r("merchant-profile-form"),
890
+ id: i("merchant-profile-form"),
891
891
  onSubmit: (e) => {
892
892
  e.preventDefault(), e.stopPropagation(), u.handleSubmit();
893
893
  },
@@ -897,12 +897,12 @@ function be({ configuration: t, edits: n }) {
897
897
  name: "displayName",
898
898
  validators: { onChange: ({ value: e }) => e.trim() ? void 0 : "Enter the merchant's name" },
899
899
  children: (e) => /* @__PURE__ */ W(Z, {
900
- label: i("Display name"),
900
+ label: a("Display name"),
901
901
  id: "s-name",
902
902
  children: /* @__PURE__ */ G("div", {
903
903
  className: "grid gap-1.5",
904
904
  children: [/* @__PURE__ */ W(s, {
905
- id: r("s-name"),
905
+ id: i("s-name"),
906
906
  value: e.state.value,
907
907
  onBlur: e.handleBlur,
908
908
  onChange: (t) => e.handleChange(t.target.value),
@@ -915,10 +915,10 @@ function be({ configuration: t, edits: n }) {
915
915
  /* @__PURE__ */ W(u.Field, {
916
916
  name: "fromEmail",
917
917
  children: (e) => /* @__PURE__ */ W(Z, {
918
- label: i("From email"),
918
+ label: a("From email"),
919
919
  id: "s-email",
920
920
  children: /* @__PURE__ */ W(s, {
921
- id: r("s-email"),
921
+ id: i("s-email"),
922
922
  type: "email",
923
923
  value: e.state.value,
924
924
  onBlur: e.handleBlur,
@@ -930,60 +930,60 @@ function be({ configuration: t, edits: n }) {
930
930
  /* @__PURE__ */ W(u.Field, {
931
931
  name: "supportURL",
932
932
  children: (e) => /* @__PURE__ */ W(Z, {
933
- label: i("Support URL"),
933
+ label: a("Support URL"),
934
934
  id: "s-support",
935
935
  children: /* @__PURE__ */ W(s, {
936
- id: r("s-support"),
936
+ id: i("s-support"),
937
937
  type: "url",
938
938
  value: e.state.value,
939
939
  onBlur: e.handleBlur,
940
940
  onChange: (t) => e.handleChange(t.target.value),
941
- placeholder: i("https://example.com/support")
941
+ placeholder: a("https://example.com/support")
942
942
  })
943
943
  })
944
944
  }),
945
945
  /* @__PURE__ */ W(u.Field, {
946
946
  name: "subscribeURL",
947
947
  children: (e) => /* @__PURE__ */ W(Z, {
948
- label: i("Subscribe URL"),
948
+ label: a("Subscribe URL"),
949
949
  id: "s-subscribe",
950
950
  children: /* @__PURE__ */ W(s, {
951
- id: r("s-subscribe"),
951
+ id: i("s-subscribe"),
952
952
  type: "url",
953
953
  value: e.state.value,
954
954
  onBlur: e.handleBlur,
955
955
  onChange: (t) => e.handleChange(t.target.value),
956
- placeholder: i("https://example.com/subscribe")
956
+ placeholder: a("https://example.com/subscribe")
957
957
  })
958
958
  })
959
959
  }),
960
960
  /* @__PURE__ */ W(u.Field, {
961
961
  name: "billingURL",
962
962
  children: (e) => /* @__PURE__ */ W(Z, {
963
- label: i("Billing URL"),
963
+ label: a("Billing URL"),
964
964
  id: "s-billing",
965
965
  children: /* @__PURE__ */ W(s, {
966
- id: r("s-billing"),
966
+ id: i("s-billing"),
967
967
  type: "url",
968
968
  value: e.state.value,
969
969
  onBlur: e.handleBlur,
970
970
  onChange: (t) => e.handleChange(t.target.value),
971
- placeholder: i("https://example.com/account")
971
+ placeholder: a("https://example.com/account")
972
972
  })
973
973
  })
974
974
  }),
975
975
  /* @__PURE__ */ W(u.Field, {
976
976
  name: "logoURL",
977
977
  children: (e) => /* @__PURE__ */ W(Z, {
978
- label: i("Logo URL"),
978
+ label: a("Logo URL"),
979
979
  id: "s-logo",
980
980
  children: /* @__PURE__ */ W(s, {
981
- id: r("s-logo"),
981
+ id: i("s-logo"),
982
982
  type: "url",
983
983
  value: e.state.value,
984
984
  onBlur: e.handleBlur,
985
985
  onChange: (t) => e.handleChange(t.target.value),
986
- placeholder: i("https://example.com/logo.png")
986
+ placeholder: a("https://example.com/logo.png")
987
987
  })
988
988
  })
989
989
  })
@@ -992,35 +992,35 @@ function be({ configuration: t, edits: n }) {
992
992
  className: "grid gap-4",
993
993
  children: [
994
994
  /* @__PURE__ */ W(X, {
995
- label: i("Display name"),
996
- value: t.display_name
995
+ label: a("Display name"),
996
+ value: e.display_name
997
997
  }),
998
998
  /* @__PURE__ */ W(X, {
999
- label: i("From email"),
999
+ label: a("From email"),
1000
1000
  value: o?.from_email
1001
1001
  }),
1002
1002
  /* @__PURE__ */ W(X, {
1003
- label: i("Support URL"),
1003
+ label: a("Support URL"),
1004
1004
  value: o?.support_url
1005
1005
  }),
1006
1006
  /* @__PURE__ */ W(X, {
1007
- label: i("Subscribe URL"),
1007
+ label: a("Subscribe URL"),
1008
1008
  value: o?.subscribe_url
1009
1009
  }),
1010
1010
  /* @__PURE__ */ W(X, {
1011
- label: i("Billing URL"),
1011
+ label: a("Billing URL"),
1012
1012
  value: o?.billing_url
1013
1013
  }),
1014
1014
  /* @__PURE__ */ W(X, {
1015
- label: i("Logo URL"),
1015
+ label: a("Logo URL"),
1016
1016
  value: o?.logo_url
1017
1017
  })
1018
1018
  ]
1019
1019
  })]
1020
1020
  });
1021
1021
  }
1022
- function xe({ configuration: t, edits: n }) {
1023
- let { id: r, text: i } = e(), o = t.reprice_notice_window_days ?? 30, c = q(t), l = K({
1022
+ function xe({ configuration: e, edits: r }) {
1023
+ let { id: i, text: a } = t(), o = e.reprice_notice_window_days ?? 30, c = q(e), l = K({
1024
1024
  defaultValues: { days: String(o) },
1025
1025
  onSubmit: ({ value: e }) => c.save({ reprice_notice_window_days: Number(e.days) }, "Notice window saved", "Save notice window")
1026
1026
  });
@@ -1032,15 +1032,15 @@ function xe({ configuration: t, edits: n }) {
1032
1032
  className: "grid max-w-2xl gap-1",
1033
1033
  children: [/* @__PURE__ */ W("h2", {
1034
1034
  className: "text-base font-semibold",
1035
- children: /* @__PURE__ */ W(a, { id: "Pricing policies" })
1035
+ children: /* @__PURE__ */ W(n, { id: "Pricing policies" })
1036
1036
  }), /* @__PURE__ */ W("p", {
1037
1037
  className: "text-sm text-pretty text-muted-foreground",
1038
- children: /* @__PURE__ */ W(a, { id: "Set how much notice customers receive before a price increase." })
1038
+ children: /* @__PURE__ */ W(n, { id: "Set how much notice customers receive before a price increase." })
1039
1039
  })]
1040
1040
  }), /* @__PURE__ */ W(l.Subscribe, {
1041
1041
  selector: (e) => [e.canSubmit, e.isSubmitting],
1042
1042
  children: ([e, t]) => /* @__PURE__ */ W(Y, {
1043
- edits: n,
1043
+ edits: r,
1044
1044
  editing: c.editing,
1045
1045
  form: "notice-window-form",
1046
1046
  saving: t,
@@ -1052,7 +1052,7 @@ function xe({ configuration: t, edits: n }) {
1052
1052
  })
1053
1053
  })]
1054
1054
  }), c.editing ? /* @__PURE__ */ W("form", {
1055
- id: r("notice-window-form"),
1055
+ id: i("notice-window-form"),
1056
1056
  onSubmit: (e) => {
1057
1057
  e.preventDefault(), e.stopPropagation(), l.handleSubmit();
1058
1058
  },
@@ -1063,12 +1063,12 @@ function xe({ configuration: t, edits: n }) {
1063
1063
  return e.trim() && Number.isInteger(t) && t >= 0 ? void 0 : "Enter a whole number of days";
1064
1064
  } },
1065
1065
  children: (e) => /* @__PURE__ */ W(Z, {
1066
- label: i("Notice period (days)"),
1066
+ label: a("Notice period (days)"),
1067
1067
  id: "s-notice-window",
1068
1068
  children: /* @__PURE__ */ G("div", {
1069
1069
  className: "grid gap-1.5",
1070
1070
  children: [/* @__PURE__ */ W(s, {
1071
- id: r("s-notice-window"),
1071
+ id: i("s-notice-window"),
1072
1072
  type: "number",
1073
1073
  step: "1",
1074
1074
  min: "0",
@@ -1081,18 +1081,18 @@ function xe({ configuration: t, edits: n }) {
1081
1081
  })
1082
1082
  })
1083
1083
  }) : /* @__PURE__ */ W("dl", { children: /* @__PURE__ */ W(X, {
1084
- label: i("Notice period"),
1084
+ label: a("Notice period"),
1085
1085
  value: `${o} ${o === 1 ? "day" : "days"}`
1086
1086
  }) })]
1087
1087
  });
1088
1088
  }
1089
1089
  function Se() {
1090
- let { selectedMerchant: e, adminQueries: t } = i(), n = V(t.psps()), r = V(t.rails()), o = f();
1091
- if (n.isPending || r.isPending) return /* @__PURE__ */ W("p", {
1090
+ let { selectedMerchant: e, adminQueries: t } = a(), r = V(t.psps()), i = V(t.rails()), o = f();
1091
+ if (r.isPending || i.isPending) return /* @__PURE__ */ W("p", {
1092
1092
  className: "text-sm text-muted-foreground",
1093
- children: /* @__PURE__ */ W(a, { id: "Loading…" })
1093
+ children: /* @__PURE__ */ W(n, { id: "Loading…" })
1094
1094
  });
1095
- let s = r.data ?? [];
1095
+ let s = i.data ?? [];
1096
1096
  return /* @__PURE__ */ G("div", {
1097
1097
  className: "grid gap-6",
1098
1098
  children: [
@@ -1105,13 +1105,13 @@ function Se() {
1105
1105
  className: "grid gap-1",
1106
1106
  children: [/* @__PURE__ */ W("h2", {
1107
1107
  className: "text-base font-semibold",
1108
- children: /* @__PURE__ */ W(a, { id: "PSPs" })
1108
+ children: /* @__PURE__ */ W(n, { id: "PSPs" })
1109
1109
  }), /* @__PURE__ */ W("p", {
1110
1110
  className: "text-sm text-muted-foreground",
1111
- children: /* @__PURE__ */ W(a, { id: "The accounts this merchant takes payments through, one or more per rail." })
1111
+ children: /* @__PURE__ */ W(n, { id: "The accounts this merchant takes payments through, one or more per rail." })
1112
1112
  })]
1113
1113
  }), o && /* @__PURE__ */ W(Ne, { railDefinitions: s }, e() ?? "")]
1114
- }), n.data?.data?.length ? /* @__PURE__ */ G(ne, {
1114
+ }), r.data?.data?.length ? /* @__PURE__ */ G(ne, {
1115
1115
  className: "min-w-[44rem]",
1116
1116
  children: [/* @__PURE__ */ W(te, { children: /* @__PURE__ */ G(E, {
1117
1117
  className: "hover:bg-transparent",
@@ -1122,29 +1122,29 @@ function Se() {
1122
1122
  }),
1123
1123
  /* @__PURE__ */ W(w, {
1124
1124
  className: "text-muted-foreground",
1125
- children: /* @__PURE__ */ W(a, { id: "Environment" })
1125
+ children: /* @__PURE__ */ W(n, { id: "Environment" })
1126
1126
  }),
1127
1127
  /* @__PURE__ */ W(w, {
1128
1128
  className: "text-muted-foreground",
1129
- children: /* @__PURE__ */ W(a, { id: "Credentials" })
1129
+ children: /* @__PURE__ */ W(n, { id: "Credentials" })
1130
1130
  }),
1131
1131
  /* @__PURE__ */ W(w, {
1132
1132
  className: "text-muted-foreground",
1133
- children: /* @__PURE__ */ W(a, { id: "State" })
1133
+ children: /* @__PURE__ */ W(n, { id: "State" })
1134
1134
  }),
1135
1135
  o && /* @__PURE__ */ W(w, {
1136
1136
  className: "text-right text-muted-foreground",
1137
- children: /* @__PURE__ */ W(a, { id: "Action" })
1137
+ children: /* @__PURE__ */ W(n, { id: "Action" })
1138
1138
  })
1139
1139
  ]
1140
- }) }), /* @__PURE__ */ W(ee, { children: n.data.data.map((e) => /* @__PURE__ */ W(we, {
1140
+ }) }), /* @__PURE__ */ W(ee, { children: r.data.data.map((e) => /* @__PURE__ */ W(we, {
1141
1141
  psp: e,
1142
1142
  railDefinitions: s,
1143
1143
  edits: o
1144
1144
  }, e.id)) })]
1145
1145
  }) : /* @__PURE__ */ W("p", {
1146
1146
  className: "py-2 text-sm text-muted-foreground",
1147
- children: /* @__PURE__ */ W(a, { id: "No PSPs configured." })
1147
+ children: /* @__PURE__ */ W(n, { id: "No PSPs configured." })
1148
1148
  })]
1149
1149
  }),
1150
1150
  /* @__PURE__ */ W(ge, {})
@@ -1154,35 +1154,35 @@ function Se() {
1154
1154
  function Ce(e) {
1155
1155
  return e.validated_at ? `Validated ${m(e.validated_at)}` : e.configured ? "Configured" : "Not configured";
1156
1156
  }
1157
- function we({ psp: n, railDefinitions: r, edits: s }) {
1158
- let { toast: c, toastApiError: l, toastStaleEdit: u, adminMutations: d, selectedMerchant: f } = i(), { text: p } = e(), m = H(), h = B(d.updatePSP(m)), [g, v] = z.useState(!1), y = _(), b = r.find((e) => e.rail === n.rail), x = b?.display_name ?? n.rail, S = n.credentials ?? {}, C = async (e) => {
1159
- if (!(!e && !await y({
1160
- title: `Archive ${n.key}?`,
1157
+ function we({ psp: r, railDefinitions: i, edits: s }) {
1158
+ let { toast: c, toastApiError: l, toastStaleEdit: u, adminMutations: d, selectedMerchant: f } = a(), { text: p } = t(), m = H(), h = B(d.updatePSP(m)), [g, v] = z.useState(!1), y = _(), b = i.find((e) => e.rail === r.rail), x = b?.display_name ?? r.rail, S = r.credentials ?? {}, C = async (t) => {
1159
+ if (!(!t && !await y({
1160
+ title: `Archive ${r.key}?`,
1161
1161
  description: "New purchase stops routing to it. Existing subscriptions, refunds and webhooks keep using it.",
1162
1162
  confirmLabel: "Archive PSP"
1163
1163
  }))) try {
1164
1164
  await h.mutateAsync({
1165
- id: n.id,
1165
+ id: r.id,
1166
1166
  psp: {
1167
1167
  archived: !0,
1168
- expected_revision: n.revision,
1169
- ...e ? { allow_last: !0 } : {}
1168
+ expected_revision: r.revision,
1169
+ ...t ? { allow_last: !0 } : {}
1170
1170
  }
1171
1171
  }), c.success("PSP archived");
1172
- } catch (r) {
1173
- if (r instanceof t && r.code === "psp_last_active") {
1174
- e ? l(r, "Archive PSP") : v(!0);
1172
+ } catch (n) {
1173
+ if (n instanceof e && n.code === "psp_last_active") {
1174
+ t ? l(n, "Archive PSP") : v(!0);
1175
1175
  return;
1176
1176
  }
1177
- if (r instanceof t && r.revisionMismatch) {
1178
- u(`PSP ${n.key}`);
1177
+ if (n instanceof e && n.revisionMismatch) {
1178
+ u(`PSP ${r.key}`);
1179
1179
  return;
1180
1180
  }
1181
- l(r, "Archive PSP");
1181
+ l(n, "Archive PSP");
1182
1182
  }
1183
1183
  };
1184
1184
  return /* @__PURE__ */ G(E, {
1185
- className: n.archived ? "opacity-60" : void 0,
1185
+ className: r.archived ? "opacity-60" : void 0,
1186
1186
  children: [
1187
1187
  /* @__PURE__ */ W(T, {
1188
1188
  className: "py-3",
@@ -1190,20 +1190,20 @@ function we({ psp: n, railDefinitions: r, edits: s }) {
1190
1190
  className: "grid min-w-0 leading-tight",
1191
1191
  children: [/* @__PURE__ */ W("span", {
1192
1192
  className: "font-medium",
1193
- children: n.key
1193
+ children: r.key
1194
1194
  }), /* @__PURE__ */ G("span", {
1195
1195
  className: "truncate text-xs text-muted-foreground",
1196
1196
  children: [
1197
1197
  x,
1198
1198
  " · ",
1199
- De(n)
1199
+ De(r)
1200
1200
  ]
1201
1201
  })]
1202
1202
  })
1203
1203
  }),
1204
1204
  /* @__PURE__ */ W(T, {
1205
1205
  className: "py-3 capitalize",
1206
- children: n.environment
1206
+ children: r.environment
1207
1207
  }),
1208
1208
  /* @__PURE__ */ W(T, {
1209
1209
  className: "py-3",
@@ -1217,45 +1217,45 @@ function we({ psp: n, railDefinitions: r, edits: s }) {
1217
1217
  }, e))
1218
1218
  }) : /* @__PURE__ */ W("span", {
1219
1219
  className: "text-sm text-muted-foreground",
1220
- children: /* @__PURE__ */ W(a, { id: "None required" })
1220
+ children: /* @__PURE__ */ W(n, { id: "None required" })
1221
1221
  })
1222
1222
  }),
1223
1223
  /* @__PURE__ */ W(T, {
1224
1224
  className: "py-3",
1225
- children: n.archived && n.open_obligations === 0 ? /* @__PURE__ */ W(D, {
1225
+ children: r.archived && r.open_obligations === 0 ? /* @__PURE__ */ W(D, {
1226
1226
  variant: "secondary",
1227
- children: /* @__PURE__ */ W(a, { id: "archived" })
1228
- }) : n.archived ? /* @__PURE__ */ G(D, {
1227
+ children: /* @__PURE__ */ W(n, { id: "archived" })
1228
+ }) : r.archived ? /* @__PURE__ */ G(D, {
1229
1229
  variant: "secondary",
1230
1230
  className: "bg-held-surface text-held",
1231
1231
  children: [
1232
- /* @__PURE__ */ W(a, { id: "draining (" }),
1233
- n.open_obligations,
1232
+ /* @__PURE__ */ W(n, { id: "draining (" }),
1233
+ r.open_obligations,
1234
1234
  ")"
1235
1235
  ]
1236
1236
  }) : /* @__PURE__ */ W(D, {
1237
1237
  variant: "secondary",
1238
1238
  className: "bg-settled-surface text-settled",
1239
- children: /* @__PURE__ */ W(a, { id: "active" })
1239
+ children: /* @__PURE__ */ W(n, { id: "active" })
1240
1240
  })
1241
1241
  }),
1242
1242
  s && /* @__PURE__ */ W(T, {
1243
1243
  className: "py-3 text-right",
1244
- children: !n.archived && /* @__PURE__ */ G("div", {
1244
+ children: !r.archived && /* @__PURE__ */ G("div", {
1245
1245
  className: "flex justify-end gap-2",
1246
1246
  children: [
1247
1247
  /* @__PURE__ */ W(Te, {
1248
- psp: n,
1248
+ psp: r,
1249
1249
  credentialKeys: b?.credential_keys ?? Object.keys(S)
1250
- }, `${f() ?? ""}:${n.id}`),
1250
+ }, `${f() ?? ""}:${r.id}`),
1251
1251
  /* @__PURE__ */ W(o, {
1252
1252
  variant: "outline",
1253
1253
  size: "sm",
1254
1254
  disabled: h.isPending,
1255
1255
  onClick: () => C(!1),
1256
- children: /* @__PURE__ */ W(a, { id: "Archive" })
1256
+ children: /* @__PURE__ */ W(n, { id: "Archive" })
1257
1257
  }),
1258
- /* @__PURE__ */ W(oe, {
1258
+ /* @__PURE__ */ W(ie, {
1259
1259
  open: g,
1260
1260
  onOpenChange: v,
1261
1261
  title: `Archive the last active ${x} PSP?`,
@@ -1270,32 +1270,32 @@ function we({ psp: n, railDefinitions: r, edits: s }) {
1270
1270
  ]
1271
1271
  });
1272
1272
  }
1273
- function Te({ psp: n, credentialKeys: r }) {
1274
- let { toast: c, toastApiError: l, toastStaleEdit: u, adminMutations: d, selectedMerchant: f } = i(), { id: p } = e(), [h, g] = z.useState(!1), [_] = z.useState(() => f() ?? ""), v = z.useRef(n.revision), y = H(), b = B(d.updatePSP(y)), x = n.credentials ?? {}, S = K({
1273
+ function Te({ psp: r, credentialKeys: i }) {
1274
+ let { toast: c, toastApiError: l, toastStaleEdit: u, adminMutations: d, selectedMerchant: f } = a(), { id: p } = t(), [h, g] = z.useState(!1), [_] = z.useState(() => f() ?? ""), v = z.useRef(r.revision), y = H(), b = B(d.updatePSP(y)), x = r.credentials ?? {}, S = K({
1275
1275
  defaultValues: { credentials: {} },
1276
- onSubmit: async ({ value: e }) => {
1277
- let r = Object.fromEntries(Object.entries(e.credentials).filter(([, e]) => e.trim()));
1276
+ onSubmit: async ({ value: t }) => {
1277
+ let n = Object.fromEntries(Object.entries(t.credentials).filter(([, e]) => e.trim()));
1278
1278
  try {
1279
1279
  if ((f() ?? "") !== _) throw Error("Merchant changed; reopen this form");
1280
1280
  await b.mutateAsync({
1281
- id: n.id,
1281
+ id: r.id,
1282
1282
  psp: {
1283
1283
  expected_revision: v.current,
1284
- credentials: r
1284
+ credentials: n
1285
1285
  }
1286
- }), c.success(`${n.key} credentials validated and rotated`), C(!1);
1287
- } catch (e) {
1288
- if (e instanceof t && e.revisionMismatch) {
1289
- u(`PSP ${n.key}`), C(!1);
1286
+ }), c.success(`${r.key} credentials validated and rotated`), C(!1);
1287
+ } catch (t) {
1288
+ if (t instanceof e && t.revisionMismatch) {
1289
+ u(`PSP ${r.key}`), C(!1);
1290
1290
  return;
1291
1291
  }
1292
- l(e, "Rotate credentials");
1292
+ l(t, "Rotate credentials");
1293
1293
  } finally {
1294
1294
  b.reset();
1295
1295
  }
1296
1296
  }
1297
1297
  }), C = (e) => {
1298
- e || S.reset(), e && (v.current = n.revision), g(e);
1298
+ e || S.reset(), e && (v.current = r.revision), g(e);
1299
1299
  };
1300
1300
  return /* @__PURE__ */ G(P, {
1301
1301
  open: h,
@@ -1303,15 +1303,15 @@ function Te({ psp: n, credentialKeys: r }) {
1303
1303
  children: [/* @__PURE__ */ W(N, { render: /* @__PURE__ */ W(o, {
1304
1304
  variant: "outline",
1305
1305
  size: "sm",
1306
- children: /* @__PURE__ */ W(a, { id: "Rotate" })
1306
+ children: /* @__PURE__ */ W(n, { id: "Rotate" })
1307
1307
  }) }), /* @__PURE__ */ G(A, {
1308
1308
  className: I,
1309
1309
  children: [/* @__PURE__ */ G(O, { children: [/* @__PURE__ */ G(j, { children: [
1310
- /* @__PURE__ */ W(a, { id: "Rotate " }),
1311
- n.key,
1312
- /* @__PURE__ */ W(a, { id: " credentials · " }),
1313
- De(n)
1314
- ] }), /* @__PURE__ */ W(M, { children: /* @__PURE__ */ W(a, { id: "Current credentials are never shown. A new one is validated against the live provider before it is stored; if that check fails, nothing is written. Leave a field blank to keep the credential it holds now." }) })] }), /* @__PURE__ */ G("form", {
1310
+ /* @__PURE__ */ W(n, { id: "Rotate " }),
1311
+ r.key,
1312
+ /* @__PURE__ */ W(n, { id: " credentials · " }),
1313
+ De(r)
1314
+ ] }), /* @__PURE__ */ W(M, { children: /* @__PURE__ */ W(n, { id: "Current credentials are never shown. A new one is validated against the live provider before it is stored; if that check fails, nothing is written. Leave a field blank to keep the credential it holds now." }) })] }), /* @__PURE__ */ G("form", {
1315
1315
  onSubmit: (e) => {
1316
1316
  e.preventDefault(), e.stopPropagation(), S.handleSubmit();
1317
1317
  },
@@ -1320,29 +1320,29 @@ function Te({ psp: n, credentialKeys: r }) {
1320
1320
  name: "credentials",
1321
1321
  children: (e) => /* @__PURE__ */ G("div", {
1322
1322
  className: "grid gap-3",
1323
- children: [r.map((t) => {
1324
- let r = x[t];
1323
+ children: [i.map((t) => {
1324
+ let i = x[t];
1325
1325
  return /* @__PURE__ */ G($, {
1326
1326
  label: t,
1327
- id: `rot-${n.id}-${t}`,
1327
+ id: `rot-${r.id}-${t}`,
1328
1328
  children: [/* @__PURE__ */ W(s, {
1329
- id: p(`rot-${n.id}-${t}`),
1329
+ id: p(`rot-${r.id}-${t}`),
1330
1330
  type: "password",
1331
1331
  autoComplete: "new-password",
1332
- placeholder: r?.configured ? "unchanged" : "not configured",
1332
+ placeholder: i?.configured ? "unchanged" : "not configured",
1333
1333
  value: e.state.value[t] ?? "",
1334
1334
  onChange: (n) => e.handleChange({
1335
1335
  ...e.state.value,
1336
1336
  [t]: n.target.value
1337
1337
  })
1338
- }), r?.validated_at && /* @__PURE__ */ G("p", {
1338
+ }), i?.validated_at && /* @__PURE__ */ G("p", {
1339
1339
  className: "text-xs text-muted-foreground",
1340
- children: [/* @__PURE__ */ W(a, { id: "Last validated " }), m(r.validated_at)]
1340
+ children: [/* @__PURE__ */ W(n, { id: "Last validated " }), m(i.validated_at)]
1341
1341
  })]
1342
1342
  }, t);
1343
1343
  }), /* @__PURE__ */ W("p", {
1344
1344
  className: "text-xs text-muted-foreground",
1345
- children: /* @__PURE__ */ W(a, { id: "Once this succeeds, the new credential is used for the next charge and every one after it. Previous webhook signing secrets remain accepted while their required overlap is active." })
1345
+ children: /* @__PURE__ */ W(n, { id: "Once this succeeds, the new credential is used for the next charge and every one after it. Previous webhook signing secrets remain accepted while their required overlap is active." })
1346
1346
  })]
1347
1347
  })
1348
1348
  }), /* @__PURE__ */ W(k, { children: /* @__PURE__ */ W(S.Subscribe, {
@@ -1407,8 +1407,8 @@ var je = {
1407
1407
  function Me(e) {
1408
1408
  return e.split(/[_-]+/).filter(Boolean).map((e, t) => je[e.toLowerCase()] || (t > 0 ? e.toLowerCase() : e.charAt(0).toUpperCase() + e.slice(1).toLowerCase())).join(" ");
1409
1409
  }
1410
- function Ne({ railDefinitions: t }) {
1411
- let { toast: n, toastApiError: r, adminMutations: c, selectedMerchant: l } = i(), { text: u, id: d } = e(), [f, p] = z.useState(!1), [m] = z.useState(() => l() ?? ""), h = H(), g = B(c.createPSP(h)), _ = K({
1410
+ function Ne({ railDefinitions: e }) {
1411
+ let { toast: r, toastApiError: i, adminMutations: c, selectedMerchant: l } = a(), { text: u, id: d } = t(), [f, p] = z.useState(!1), [m] = z.useState(() => l() ?? ""), h = H(), g = B(c.createPSP(h)), _ = K({
1412
1412
  defaultValues: {
1413
1413
  rail: "",
1414
1414
  environment: "",
@@ -1416,20 +1416,20 @@ function Ne({ railDefinitions: t }) {
1416
1416
  account: {},
1417
1417
  credentials: {}
1418
1418
  },
1419
- onSubmit: async ({ value: e }) => {
1420
- let i = Object.fromEntries(Object.entries(e.credentials).filter(([, e]) => e !== ""));
1419
+ onSubmit: async ({ value: t }) => {
1420
+ let n = Object.fromEntries(Object.entries(t.credentials).filter(([, e]) => e !== ""));
1421
1421
  try {
1422
1422
  if ((l() ?? "") !== m) throw Error("Merchant changed; reopen this form");
1423
- let r = t.find((t) => t.rail === e.rail);
1423
+ let i = e.find((e) => e.rail === t.rail);
1424
1424
  await g.mutateAsync({
1425
- key: e.key.trim().toLowerCase(),
1426
- rail: e.rail,
1427
- environment: e.environment,
1428
- ...Object.fromEntries((r?.account_fields ?? []).map((t) => [t, (e.account[t] ?? "").trim()])),
1429
- ...Object.keys(i).length ? { credentials: i } : {}
1430
- }), _.reset(), n.success("PSP added"), p(!1);
1425
+ key: t.key.trim().toLowerCase(),
1426
+ rail: t.rail,
1427
+ environment: t.environment,
1428
+ ...Object.fromEntries((i?.account_fields ?? []).map((e) => [e, (t.account[e] ?? "").trim()])),
1429
+ ...Object.keys(n).length ? { credentials: n } : {}
1430
+ }), _.reset(), r.success("PSP added"), p(!1);
1431
1431
  } catch (e) {
1432
- r(e, "Add PSP");
1432
+ i(e, "Add PSP");
1433
1433
  } finally {
1434
1434
  g.reset();
1435
1435
  }
@@ -1442,10 +1442,10 @@ function Ne({ railDefinitions: t }) {
1442
1442
  onOpenChange: w,
1443
1443
  children: [/* @__PURE__ */ W(N, { render: /* @__PURE__ */ W(o, {
1444
1444
  size: "sm",
1445
- children: /* @__PURE__ */ W(a, { id: "Add PSP" })
1445
+ children: /* @__PURE__ */ W(n, { id: "Add PSP" })
1446
1446
  }) }), /* @__PURE__ */ G(A, {
1447
1447
  className: I,
1448
- children: [/* @__PURE__ */ G(O, { children: [/* @__PURE__ */ W(j, { children: /* @__PURE__ */ W(a, { id: "Add a PSP" }) }), /* @__PURE__ */ W(M, { children: /* @__PURE__ */ W(a, { id: "Connect the account that will take money for you. Credentials go straight into the secret store and are never shown again." }) })] }), /* @__PURE__ */ G("form", {
1448
+ children: [/* @__PURE__ */ G(O, { children: [/* @__PURE__ */ W(j, { children: /* @__PURE__ */ W(n, { id: "Add a PSP" }) }), /* @__PURE__ */ W(M, { children: /* @__PURE__ */ W(n, { id: "Connect the account that will take money for you. Credentials go straight into the secret store and are never shown again." }) })] }), /* @__PURE__ */ G("form", {
1449
1449
  onSubmit: (e) => {
1450
1450
  e.preventDefault(), e.stopPropagation(), _.handleSubmit();
1451
1451
  },
@@ -1456,38 +1456,38 @@ function Ne({ railDefinitions: t }) {
1456
1456
  /* @__PURE__ */ W(_.Field, {
1457
1457
  name: "rail",
1458
1458
  validators: { onChange: ({ value: e }) => e ? void 0 : "Choose a payment rail" },
1459
- children: (e) => /* @__PURE__ */ G($, {
1459
+ children: (t) => /* @__PURE__ */ G($, {
1460
1460
  label: u("Payment rail"),
1461
1461
  id: "pv-rail",
1462
1462
  children: [/* @__PURE__ */ G(C, {
1463
- items: t.map((e) => ({
1463
+ items: e.map((e) => ({
1464
1464
  value: e.rail,
1465
1465
  label: Ae(e.rail, e.display_name)
1466
1466
  })),
1467
- value: e.state.value || null,
1467
+ value: t.state.value || null,
1468
1468
  onValueChange: (n) => {
1469
- e.handleChange(n ?? ""), _.setFieldValue("account", {}), _.setFieldValue("credentials", {}), _.setFieldValue("environment", t.find((e) => e.rail === n)?.environments[0] ?? "");
1469
+ t.handleChange(n ?? ""), _.setFieldValue("account", {}), _.setFieldValue("credentials", {}), _.setFieldValue("environment", e.find((e) => e.rail === n)?.environments[0] ?? "");
1470
1470
  },
1471
1471
  children: [/* @__PURE__ */ W(b, {
1472
1472
  id: d("pv-rail"),
1473
1473
  className: "w-full",
1474
- "aria-invalid": e.state.meta.errors.length > 0,
1474
+ "aria-invalid": t.state.meta.errors.length > 0,
1475
1475
  children: /* @__PURE__ */ W(y, { placeholder: u("Pick a rail…") })
1476
- }), /* @__PURE__ */ W(x, { children: t.map((e) => /* @__PURE__ */ W(S, {
1476
+ }), /* @__PURE__ */ W(x, { children: e.map((e) => /* @__PURE__ */ W(S, {
1477
1477
  value: e.rail,
1478
1478
  children: Ae(e.rail, e.display_name)
1479
1479
  }, e.rail)) })]
1480
- }), /* @__PURE__ */ W(v, { errors: e.state.meta.errors })]
1480
+ }), /* @__PURE__ */ W(v, { errors: t.state.meta.errors })]
1481
1481
  })
1482
1482
  }),
1483
1483
  /* @__PURE__ */ W(_.Subscribe, {
1484
1484
  selector: (e) => e.values.rail,
1485
- children: (e) => {
1486
- let n = t.find((t) => t.rail === e)?.environments ?? [];
1485
+ children: (t) => {
1486
+ let n = e.find((e) => e.rail === t)?.environments ?? [];
1487
1487
  return /* @__PURE__ */ W(_.Field, {
1488
1488
  name: "environment",
1489
1489
  validators: { onChange: ({ value: e }) => e ? void 0 : "Choose whether it moves real money" },
1490
- children: (t) => /* @__PURE__ */ G($, {
1490
+ children: (e) => /* @__PURE__ */ G($, {
1491
1491
  label: u("Environment"),
1492
1492
  id: "pv-environment",
1493
1493
  hint: "Whether this PSP moves real money. It is checked with the provider before the PSP is used.",
@@ -1496,19 +1496,19 @@ function Ne({ railDefinitions: t }) {
1496
1496
  value: e,
1497
1497
  label: u(Oe[e] ?? e)
1498
1498
  })),
1499
- value: t.state.value || null,
1500
- onValueChange: (e) => t.handleChange(e ?? ""),
1499
+ value: e.state.value || null,
1500
+ onValueChange: (t) => e.handleChange(t ?? ""),
1501
1501
  children: [/* @__PURE__ */ W(b, {
1502
1502
  id: d("pv-environment"),
1503
1503
  className: "w-full",
1504
- disabled: !e,
1505
- "aria-invalid": t.state.meta.errors.length > 0,
1504
+ disabled: !t,
1505
+ "aria-invalid": e.state.meta.errors.length > 0,
1506
1506
  children: /* @__PURE__ */ W(y, { placeholder: u("Pick an environment…") })
1507
1507
  }), /* @__PURE__ */ W(x, { children: n.map((e) => /* @__PURE__ */ W(S, {
1508
1508
  value: e,
1509
1509
  children: u(Oe[e] ?? e)
1510
1510
  }, e)) })]
1511
- }), /* @__PURE__ */ W(v, { errors: t.state.meta.errors })]
1511
+ }), /* @__PURE__ */ W(v, { errors: e.state.meta.errors })]
1512
1512
  })
1513
1513
  });
1514
1514
  }
@@ -1531,9 +1531,9 @@ function Ne({ railDefinitions: t }) {
1531
1531
  }),
1532
1532
  /* @__PURE__ */ W(_.Subscribe, {
1533
1533
  selector: (e) => e.values.rail,
1534
- children: (e) => /* @__PURE__ */ W(_.Field, {
1534
+ children: (t) => /* @__PURE__ */ W(_.Field, {
1535
1535
  name: "account",
1536
- children: (n) => /* @__PURE__ */ W(U, { children: t.find((t) => t.rail === e)?.account_fields.map((e) => /* @__PURE__ */ W($, {
1536
+ children: (n) => /* @__PURE__ */ W(U, { children: e.find((e) => e.rail === t)?.account_fields.map((e) => /* @__PURE__ */ W($, {
1537
1537
  label: u(Ee[e]?.label ?? Me(e)),
1538
1538
  id: `pv-account-${e}`,
1539
1539
  hint: Ee[e]?.hint,
@@ -1551,8 +1551,8 @@ function Ne({ railDefinitions: t }) {
1551
1551
  }),
1552
1552
  /* @__PURE__ */ W(_.Subscribe, {
1553
1553
  selector: (e) => e.values.rail,
1554
- children: (e) => {
1555
- let n = t.find((t) => t.rail === e);
1554
+ children: (t) => {
1555
+ let n = e.find((e) => e.rail === t);
1556
1556
  return /* @__PURE__ */ W(_.Field, {
1557
1557
  name: "credentials",
1558
1558
  children: (e) => /* @__PURE__ */ W(U, { children: n?.credential_keys.map((t) => /* @__PURE__ */ W($, {
@@ -1582,14 +1582,14 @@ function Ne({ railDefinitions: t }) {
1582
1582
  e.canSubmit,
1583
1583
  e.isSubmitting
1584
1584
  ],
1585
- children: ([e, n, r, i, s, c]) => /* @__PURE__ */ G(U, { children: [/* @__PURE__ */ W(o, {
1585
+ children: ([t, r, i, a, s, c]) => /* @__PURE__ */ G(U, { children: [/* @__PURE__ */ W(o, {
1586
1586
  type: "button",
1587
1587
  variant: "outline",
1588
1588
  onClick: () => w(!1),
1589
- children: /* @__PURE__ */ W(a, { id: "Cancel" })
1589
+ children: /* @__PURE__ */ W(n, { id: "Cancel" })
1590
1590
  }), /* @__PURE__ */ W(o, {
1591
1591
  type: "submit",
1592
- disabled: !e || !n || !r.trim() || !t.find((t) => t.rail === e)?.account_fields.every((e) => (i[e] ?? "").trim()) || !s || c,
1592
+ disabled: !t || !r || !i.trim() || !e.find((e) => e.rail === t)?.account_fields.every((e) => (a[e] ?? "").trim()) || !s || c,
1593
1593
  children: c ? "Saving…" : "Add PSP"
1594
1594
  })] })
1595
1595
  }) })]
@@ -1598,11 +1598,11 @@ function Ne({ railDefinitions: t }) {
1598
1598
  });
1599
1599
  }
1600
1600
  function Pe() {
1601
- let { toast: t, toastApiError: n, adminMutations: r } = i(), { text: l, id: u } = e(), [d, f] = z.useState(), m = B(r.lookupCustomerControls()), _ = B(r.setCreditLimit()), y = c(), b = K({
1601
+ let { toast: e, toastApiError: r, adminMutations: i } = a(), { text: l, id: u } = t(), [d, f] = z.useState(), m = B(i.lookupCustomerControls()), _ = B(i.setCreditLimit()), y = c(), b = K({
1602
1602
  defaultValues: { newLimit: "" },
1603
- onSubmit: async ({ value: e }) => {
1603
+ onSubmit: async ({ value: t }) => {
1604
1604
  if (!d) return;
1605
- let r = p(d.currency), i = r === void 0 ? null : g(e.newLimit, r);
1605
+ let n = p(d.currency), i = n === void 0 ? null : g(t.newLimit, n);
1606
1606
  if (!(i === null || i.startsWith("-"))) try {
1607
1607
  await _.mutateAsync({
1608
1608
  customerId: d.customerID,
@@ -1611,9 +1611,9 @@ function Pe() {
1611
1611
  }), f((e) => e && {
1612
1612
  ...e,
1613
1613
  creditLimit: i
1614
- }), b.reset(), t.success("Credit limit updated");
1614
+ }), b.reset(), e.success("Credit limit updated");
1615
1615
  } catch (e) {
1616
- n(e, "Set credit limit");
1616
+ r(e, "Set credit limit");
1617
1617
  }
1618
1618
  }
1619
1619
  }), x = K({
@@ -1622,18 +1622,18 @@ function Pe() {
1622
1622
  currency: "usd"
1623
1623
  },
1624
1624
  onSubmit: async ({ value: e }) => {
1625
- let t = e.customerID.trim(), r = e.currency.trim().toLowerCase();
1625
+ let t = e.customerID.trim(), n = e.currency.trim().toLowerCase();
1626
1626
  try {
1627
1627
  let e = await m.mutateAsync({
1628
1628
  customerId: t,
1629
- currency: r
1629
+ currency: n
1630
1630
  });
1631
1631
  f({
1632
1632
  customerID: t,
1633
1633
  ...e
1634
1634
  }), b.reset();
1635
1635
  } catch (e) {
1636
- n(e, "Lookup customer controls"), f(void 0);
1636
+ r(e, "Lookup customer controls"), f(void 0);
1637
1637
  }
1638
1638
  }
1639
1639
  });
@@ -1645,10 +1645,10 @@ function Pe() {
1645
1645
  className: "grid gap-1",
1646
1646
  children: [/* @__PURE__ */ W("h2", {
1647
1647
  className: "text-base font-semibold",
1648
- children: /* @__PURE__ */ W(a, { id: "Customer lookup" })
1648
+ children: /* @__PURE__ */ W(n, { id: "Customer lookup" })
1649
1649
  }), /* @__PURE__ */ W("p", {
1650
1650
  className: "text-sm text-muted-foreground",
1651
- children: /* @__PURE__ */ W(a, { id: "Find a customer by ID and currency." })
1651
+ children: /* @__PURE__ */ W(n, { id: "Find a customer by ID and currency." })
1652
1652
  })]
1653
1653
  }), /* @__PURE__ */ G("form", {
1654
1654
  onSubmit: (e) => {
@@ -1711,7 +1711,7 @@ function Pe() {
1711
1711
  className: "grid gap-1",
1712
1712
  children: [/* @__PURE__ */ W("h2", {
1713
1713
  className: "text-base font-semibold",
1714
- children: /* @__PURE__ */ W(a, { id: "Credit and trust" })
1714
+ children: /* @__PURE__ */ W(n, { id: "Credit and trust" })
1715
1715
  }), /* @__PURE__ */ G("p", {
1716
1716
  className: "text-sm text-muted-foreground",
1717
1717
  children: [
@@ -1779,7 +1779,7 @@ function Pe() {
1779
1779
  /* @__PURE__ */ W(v, { errors: e.state.meta.errors }),
1780
1780
  /* @__PURE__ */ W("p", {
1781
1781
  className: "text-xs text-muted-foreground",
1782
- children: /* @__PURE__ */ W(a, { id: "Enter 0 to turn credit off." })
1782
+ children: /* @__PURE__ */ W(n, { id: "Enter 0 to turn credit off." })
1783
1783
  })
1784
1784
  ]
1785
1785
  })
@@ -1790,14 +1790,14 @@ function Pe() {
1790
1790
  })]
1791
1791
  });
1792
1792
  }
1793
- function $({ label: t, id: n, hint: r, children: i }) {
1794
- let { id: a } = e();
1793
+ function $({ label: e, id: n, hint: r, children: i }) {
1794
+ let { id: a } = t();
1795
1795
  return /* @__PURE__ */ G("div", {
1796
1796
  className: "grid gap-1.5",
1797
1797
  children: [
1798
1798
  /* @__PURE__ */ W(F, {
1799
1799
  htmlFor: a(n),
1800
- children: t
1800
+ children: e
1801
1801
  }),
1802
1802
  r ? /* @__PURE__ */ W("p", {
1803
1803
  className: "text-[13px] text-muted-foreground",
@@ -1810,4 +1810,4 @@ function $({ label: t, id: n, hint: r, children: i }) {
1810
1810
  //#endregion
1811
1811
  export { ve as SettingsPage };
1812
1812
 
1813
- //# sourceMappingURL=admin-settings-Bs6cLcqi.js.map
1813
+ //# sourceMappingURL=admin-settings-DYC-c7mJ.js.map