@openrails/billing-ui 0.257.0 → 0.257.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.
Files changed (124) hide show
  1. package/CHANGELOG.md +15 -4
  2. package/README.md +41 -17
  3. package/dist/account/change-plan.d.ts +17 -0
  4. package/dist/account/format.d.ts +2 -0
  5. package/dist/account/renewal-prompt.d.ts +13 -0
  6. package/dist/account/subscriptions-panel.d.ts +2 -1
  7. package/dist/admin/context.d.ts +6 -6
  8. package/dist/admin/lib/queries.d.ts +3 -3
  9. package/dist/{admin-attempts-C761C4Ys.js → admin-attempts-DWjIBJOm.js} +8 -8
  10. package/dist/{admin-attempts-C761C4Ys.js.map → admin-attempts-DWjIBJOm.js.map} +1 -1
  11. package/dist/{admin-auth-CMtFwKlJ.js → admin-auth-CoOuQn-h.js} +2 -2
  12. package/dist/{admin-auth-CMtFwKlJ.js.map → admin-auth-CoOuQn-h.js.map} +1 -1
  13. package/dist/{admin-badge-CKME6YUp.js → admin-badge-u30W_xsJ.js} +2 -2
  14. package/dist/{admin-badge-CKME6YUp.js.map → admin-badge-u30W_xsJ.js.map} +1 -1
  15. package/dist/{admin-button-BpaYeqIA.js → admin-button-CxwHe1kq.js} +2 -2
  16. package/dist/{admin-button-BpaYeqIA.js.map → admin-button-CxwHe1kq.js.map} +1 -1
  17. package/dist/{admin-capabilities-KRi36PEI.js → admin-capabilities-CR_kXo1O.js} +2 -2
  18. package/dist/{admin-capabilities-KRi36PEI.js.map → admin-capabilities-CR_kXo1O.js.map} +1 -1
  19. package/dist/{admin-card-DAAMT-zo.js → admin-card-2MDoKLKO.js} +2 -2
  20. package/dist/{admin-card-DAAMT-zo.js.map → admin-card-2MDoKLKO.js.map} +1 -1
  21. package/dist/{admin-catalog-DX0fQ_Li.js → admin-catalog-Jeaxiug7.js} +18 -18
  22. package/dist/{admin-catalog-DX0fQ_Li.js.map → admin-catalog-Jeaxiug7.js.map} +1 -1
  23. package/dist/{admin-customers-DHnEvj4J.js → admin-customers-Da7HpOfT.js} +6 -6
  24. package/dist/{admin-customers-DHnEvj4J.js.map → admin-customers-Da7HpOfT.js.map} +1 -1
  25. package/dist/{admin-dashboard-DahEHElc.js → admin-dashboard-BMQVUn-1.js} +14 -14
  26. package/dist/{admin-dashboard-DahEHElc.js.map → admin-dashboard-BMQVUn-1.js.map} +1 -1
  27. package/dist/{admin-data-table-JFcCM4nz.js → admin-data-table-DZt4Qa0G.js} +6 -6
  28. package/dist/{admin-data-table-JFcCM4nz.js.map → admin-data-table-DZt4Qa0G.js.map} +1 -1
  29. package/dist/{admin-detail-EFditqtQ.js → admin-detail-BEa3CslM.js} +12 -12
  30. package/dist/{admin-detail-EFditqtQ.js.map → admin-detail-BEa3CslM.js.map} +1 -1
  31. package/dist/{admin-detail-Dum-UENt.js → admin-detail-CmP7B4jy.js} +15 -15
  32. package/dist/{admin-detail-Dum-UENt.js.map → admin-detail-CmP7B4jy.js.map} +1 -1
  33. package/dist/{admin-detail-CrZd_jsD.js → admin-detail-D4emDRBW.js} +11 -11
  34. package/dist/{admin-detail-CrZd_jsD.js.map → admin-detail-D4emDRBW.js.map} +1 -1
  35. package/dist/{admin-detail-BBhbe-TN.js → admin-detail-z3ctRzrU.js} +15 -15
  36. package/dist/{admin-detail-BBhbe-TN.js.map → admin-detail-z3ctRzrU.js.map} +1 -1
  37. package/dist/{admin-dialog-C6q9m4AO.js → admin-dialog-CrUVcoIa.js} +3 -3
  38. package/dist/{admin-dialog-C6q9m4AO.js.map → admin-dialog-CrUVcoIa.js.map} +1 -1
  39. package/dist/{admin-dom-CFOQMhV5.js → admin-dom-dHFky0E4.js} +4 -4
  40. package/dist/{admin-dom-CFOQMhV5.js.map → admin-dom-dHFky0E4.js.map} +1 -1
  41. package/dist/{admin-dropdown-menu-B0BamhwM.js → admin-dropdown-menu-Dp3H1-jG.js} +2 -2
  42. package/dist/{admin-dropdown-menu-B0BamhwM.js.map → admin-dropdown-menu-Dp3H1-jG.js.map} +1 -1
  43. package/dist/{admin-fact-card-CayqfxhD.js → admin-fact-card-cUIlus24.js} +2 -2
  44. package/dist/{admin-fact-card-CayqfxhD.js.map → admin-fact-card-cUIlus24.js.map} +1 -1
  45. package/dist/{admin-health-DrYyfrQG.js → admin-health-C1_gvPn3.js} +9 -9
  46. package/dist/{admin-health-DrYyfrQG.js.map → admin-health-C1_gvPn3.js.map} +1 -1
  47. package/dist/{admin-input-D5JvWtz6.js → admin-input-efDEUMq_.js} +2 -2
  48. package/dist/{admin-input-D5JvWtz6.js.map → admin-input-efDEUMq_.js.map} +1 -1
  49. package/dist/{admin-label-DiDLN80J.js → admin-label-CCWfJBgj.js} +2 -2
  50. package/dist/{admin-label-DiDLN80J.js.map → admin-label-CCWfJBgj.js.map} +1 -1
  51. package/dist/{admin-linked-table-row-BLui28tf.js → admin-linked-table-row-B2FZB0fb.js} +4 -4
  52. package/dist/{admin-linked-table-row-BLui28tf.js.map → admin-linked-table-row-B2FZB0fb.js.map} +1 -1
  53. package/dist/{admin-metering-DlUZXwed.js → admin-metering-8H60g7za.js} +14 -14
  54. package/dist/{admin-metering-DlUZXwed.js.map → admin-metering-8H60g7za.js.map} +1 -1
  55. package/dist/{admin-ops-CotDCsxb.js → admin-ops-uv0TOEQj.js} +11 -11
  56. package/dist/{admin-ops-CotDCsxb.js.map → admin-ops-uv0TOEQj.js.map} +1 -1
  57. package/dist/{admin-orders-DfJWLFAI.js → admin-orders-BEuKlqRk.js} +8 -8
  58. package/dist/{admin-orders-DfJWLFAI.js.map → admin-orders-BEuKlqRk.js.map} +1 -1
  59. package/dist/{admin-payments-yaUgdqSl.js → admin-payments-DdNXYh5s.js} +9 -9
  60. package/dist/{admin-payments-yaUgdqSl.js.map → admin-payments-DdNXYh5s.js.map} +1 -1
  61. package/dist/{admin-price-detail-ncX-vQVz.js → admin-price-detail-CU9qmpKA.js} +9 -9
  62. package/dist/{admin-price-detail-ncX-vQVz.js.map → admin-price-detail-CU9qmpKA.js.map} +1 -1
  63. package/dist/{admin-price-wizard-BKrUH8iN.js → admin-price-wizard-BHbWs9k-.js} +7 -7
  64. package/dist/{admin-price-wizard-BKrUH8iN.js.map → admin-price-wizard-BHbWs9k-.js.map} +1 -1
  65. package/dist/{admin-range-picker-CgCtBuH8.js → admin-range-picker-DSwi7tAv.js} +5 -5
  66. package/dist/{admin-range-picker-CgCtBuH8.js.map → admin-range-picker-DSwi7tAv.js.map} +1 -1
  67. package/dist/{admin-reports-Crpx48rH.js → admin-reports-CXVuKp_6.js} +8 -8
  68. package/dist/{admin-reports-Crpx48rH.js.map → admin-reports-CXVuKp_6.js.map} +1 -1
  69. package/dist/{admin-select-C-vgRjrt.js → admin-select-DUQi6WF3.js} +2 -2
  70. package/dist/{admin-select-C-vgRjrt.js.map → admin-select-DUQi6WF3.js.map} +1 -1
  71. package/dist/{admin-settings-Ms2ghC00.js → admin-settings-DZGrBr8F.js} +13 -13
  72. package/dist/{admin-settings-Ms2ghC00.js.map → admin-settings-DZGrBr8F.js.map} +1 -1
  73. package/dist/{admin-skeleton-DwCr2rr_.js → admin-skeleton-9lJsUfWq.js} +2 -2
  74. package/dist/{admin-skeleton-DwCr2rr_.js.map → admin-skeleton-9lJsUfWq.js.map} +1 -1
  75. package/dist/{admin-status-badge-BPYozxZA.js → admin-status-badge-ClEvhHcQ.js} +2 -2
  76. package/dist/{admin-status-badge-BPYozxZA.js.map → admin-status-badge-ClEvhHcQ.js.map} +1 -1
  77. package/dist/{admin-subscriptions-CiAsfgw4.js → admin-subscriptions-D1aP6lrm.js} +9 -9
  78. package/dist/{admin-subscriptions-CiAsfgw4.js.map → admin-subscriptions-D1aP6lrm.js.map} +1 -1
  79. package/dist/{admin-switch-DCQyukkF.js → admin-switch-DdlzY8ux.js} +2 -2
  80. package/dist/{admin-switch-DCQyukkF.js.map → admin-switch-DdlzY8ux.js.map} +1 -1
  81. package/dist/{admin-table-Cvdx51W3.js → admin-table-Bf2ARo0f.js} +2 -2
  82. package/dist/{admin-table-Cvdx51W3.js.map → admin-table-Bf2ARo0f.js.map} +1 -1
  83. package/dist/{admin-tabs-opLnz2dz.js → admin-tabs-Bbi6W5Zq.js} +2 -2
  84. package/dist/{admin-tabs-opLnz2dz.js.map → admin-tabs-Bbi6W5Zq.js.map} +1 -1
  85. package/dist/{admin-textarea-YT0_5ldp.js → admin-textarea-Dp6LDB9h.js} +2 -2
  86. package/dist/{admin-textarea-YT0_5ldp.js.map → admin-textarea-Dp6LDB9h.js.map} +1 -1
  87. package/dist/{admin-typed-confirm-dialog-Dk0tz8C0.js → admin-typed-confirm-dialog-Rff1Ixsp.js} +6 -6
  88. package/dist/{admin-typed-confirm-dialog-Dk0tz8C0.js.map → admin-typed-confirm-dialog-Rff1Ixsp.js.map} +1 -1
  89. package/dist/{admin-utils-CwzkGo6Y.js → admin-utils-KQZv9NPg.js} +30 -3
  90. package/dist/{admin-utils-CwzkGo6Y.js.map → admin-utils-KQZv9NPg.js.map} +1 -1
  91. package/dist/{admin-widget-viz-D0ZYS8wJ.js → admin-widget-viz-DKfb-3bv.js} +3 -3
  92. package/dist/{admin-widget-viz-D0ZYS8wJ.js.map → admin-widget-viz-DKfb-3bv.js.map} +1 -1
  93. package/dist/admin.js +28 -28
  94. package/dist/client/client.d.ts +6 -1
  95. package/dist/client/generated/routes.d.ts +167 -0
  96. package/dist/client/generated/wire.d.ts +85 -0
  97. package/dist/client/index.d.ts +1 -1
  98. package/dist/client/types.d.ts +65 -0
  99. package/dist/{client-CDA6v1Jd.js → client-B_Ujr9ei.js} +96 -89
  100. package/dist/client-B_Ujr9ei.js.map +1 -0
  101. package/dist/client.js +1 -1
  102. package/dist/{hooks-UswS31Eu.js → hooks-CYo-sw2y.js} +16 -7
  103. package/dist/{hooks-UswS31Eu.js.map → hooks-CYo-sw2y.js.map} +1 -1
  104. package/dist/index.d.ts +1 -0
  105. package/dist/index.js +996 -786
  106. package/dist/index.js.map +1 -1
  107. package/dist/locales/de.js +29 -2
  108. package/dist/locales/de.js.map +1 -1
  109. package/dist/locales/en.d.ts +27 -0
  110. package/dist/locales/en.js +29 -2
  111. package/dist/locales/en.js.map +1 -1
  112. package/dist/locales/es.js +29 -2
  113. package/dist/locales/es.js.map +1 -1
  114. package/dist/locales/ja.js +29 -2
  115. package/dist/locales/ja.js.map +1 -1
  116. package/dist/locales/ko.js +29 -2
  117. package/dist/locales/ko.js.map +1 -1
  118. package/dist/locales/zh.js +29 -2
  119. package/dist/locales/zh.js.map +1 -1
  120. package/dist/react/hooks.d.ts +10 -1
  121. package/dist/react/index.d.ts +1 -1
  122. package/dist/react.js +2 -2
  123. package/package.json +1 -1
  124. package/dist/client-CDA6v1Jd.js.map +0 -1
package/dist/index.js CHANGED
@@ -11,27 +11,27 @@ if (typeof document !== "undefined") {
11
11
  if (__orckStyle.textContent !== __orckCss) __orckStyle.textContent = __orckCss;
12
12
  }
13
13
 
14
- import { A as e, C as t, E as n, O as r, S as i, _ as a, a as o, b as s, d as c, f as l, g as u, h as d, p as f, s as p, v as m, w as h, x as g, y as _ } from "./client-CDA6v1Jd.js";
15
- import { _ as v, a as y, b, f as x, g as S, h as C, i as w, l as T, m as E, n as D, o as O, p as k, r as A, s as ee, t as te, v as j, x as ne, y as re } from "./hooks-UswS31Eu.js";
16
- import { t as ie } from "./index-rGw83t5v-BE6naeQR.js";
17
- import { z as M } from "zod";
18
- import * as N from "react";
19
- import { Fragment as P, jsx as F, jsxs as I } from "react/jsx-runtime";
14
+ import { A as e, C as t, E as n, O as r, S as i, _ as a, a as o, b as s, d as c, f as l, g as u, h as d, p as f, s as p, v as m, w as h, x as g, y as _ } from "./client-B_Ujr9ei.js";
15
+ import { S as v, _ as y, a as b, b as x, c as S, g as C, h as w, i as T, m as E, n as D, o as O, p as k, r as ee, s as te, t as A, u as j, v as ne, x as re, y as ie } from "./hooks-CYo-sw2y.js";
16
+ import { t as M } from "./index-rGw83t5v-BE6naeQR.js";
17
+ import { z as N } from "zod";
18
+ import * as P from "react";
19
+ import { Fragment as ae, jsx as F, jsxs as I } from "react/jsx-runtime";
20
20
  import { cn as L } from "cn";
21
- import { Button as ae } from "@base-ui/react/button";
22
- import { cva as R } from "class-variance-authority";
23
- import { mergeProps as oe } from "@base-ui/react/merge-props";
24
- import { useRender as z } from "@base-ui/react/use-render";
25
- import { HugeiconsIcon as se } from "@hugeicons/react";
26
- import { Add01Icon as ce, ArrowUpRight01Icon as le, Cancel01Icon as ue, Delete02Icon as de, Loading03Icon as fe } from "@hugeicons/core-free-icons";
21
+ import { Button as R } from "@base-ui/react/button";
22
+ import { cva as oe } from "class-variance-authority";
23
+ import { mergeProps as z } from "@base-ui/react/merge-props";
24
+ import { useRender as se } from "@base-ui/react/use-render";
25
+ import { HugeiconsIcon as ce } from "@hugeicons/react";
26
+ import { Add01Icon as le, ArrowUpRight01Icon as ue, Cancel01Icon as de, Delete02Icon as fe, Loading03Icon as pe } from "@hugeicons/core-free-icons";
27
27
  import { AlertDialog as B } from "@base-ui/react/alert-dialog";
28
28
  import { Dialog as V } from "@base-ui/react/dialog";
29
- import { Input as pe } from "@base-ui/react/input";
30
- import { Radio as me } from "@base-ui/react/radio";
31
- import { RadioGroup as he } from "@base-ui/react/radio-group";
29
+ import { Input as me } from "@base-ui/react/input";
30
+ import { Radio as he } from "@base-ui/react/radio";
31
+ import { RadioGroup as ge } from "@base-ui/react/radio-group";
32
32
  //#region src/scope.tsx
33
- function ge({ appearance: e, className: t, style: n, ...r }) {
34
- let i = x(e);
33
+ function _e({ appearance: e, className: t, style: n, ...r }) {
34
+ let i = k(e);
35
35
  return /* @__PURE__ */ F("div", {
36
36
  "data-orck-theme": i["data-orck-theme"],
37
37
  className: L(i.className, t),
@@ -44,7 +44,7 @@ function ge({ appearance: e, className: t, style: n, ...r }) {
44
44
  }
45
45
  //#endregion
46
46
  //#region src/components/ui/button.tsx
47
- var _e = R("group/button inline-flex shrink-0 items-center justify-center rounded-md border border-transparent bg-clip-padding text-sm font-medium whitespace-nowrap transition-all outline-none select-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 active:not-aria-[haspopup]:translate-y-px disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", {
47
+ var H = oe("group/button inline-flex shrink-0 items-center justify-center rounded-md border border-transparent bg-clip-padding text-sm font-medium whitespace-nowrap transition-all outline-none select-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 active:not-aria-[haspopup]:translate-y-px disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", {
48
48
  variants: {
49
49
  variant: {
50
50
  default: "bg-primary text-primary-foreground hover:bg-primary/80",
@@ -70,10 +70,10 @@ var _e = R("group/button inline-flex shrink-0 items-center justify-center rounde
70
70
  size: "default"
71
71
  }
72
72
  });
73
- function H({ className: e, variant: t = "default", size: n = "default", ...r }) {
74
- return /* @__PURE__ */ F(ae, {
73
+ function U({ className: e, variant: t = "default", size: n = "default", ...r }) {
74
+ return /* @__PURE__ */ F(R, {
75
75
  "data-slot": "button",
76
- className: L(_e({
76
+ className: L(H({
77
77
  variant: t,
78
78
  size: n,
79
79
  className: e
@@ -83,7 +83,7 @@ function H({ className: e, variant: t = "default", size: n = "default", ...r })
83
83
  }
84
84
  //#endregion
85
85
  //#region src/lib/period.ts
86
- function U(e) {
86
+ function ve(e) {
87
87
  return !e || !Number.isSafeInteger(e) || e <= 0 ? null : e % 168 == 0 ? {
88
88
  unit: "week",
89
89
  count: e / 168
@@ -95,17 +95,17 @@ function U(e) {
95
95
  count: e
96
96
  };
97
97
  }
98
- function ve(e, t) {
99
- let n = U(e);
98
+ function ye(e, t) {
99
+ let n = ve(e);
100
100
  return n ? t.plural(`interval.every.${n.unit}`, n.count) : null;
101
101
  }
102
- function ye(e, t) {
103
- let n = U(e);
102
+ function W(e, t) {
103
+ let n = ve(e);
104
104
  return n ? t.plural(`interval.access.${n.unit}`, n.count) : null;
105
105
  }
106
106
  //#endregion
107
107
  //#region src/account/format.ts
108
- function W(e, t) {
108
+ function G(e, t) {
109
109
  if (!e) return null;
110
110
  let n = new Date(e);
111
111
  if (Number.isNaN(n.getTime())) return null;
@@ -115,13 +115,13 @@ function W(e, t) {
115
115
  return n.toISOString().slice(0, 10);
116
116
  }
117
117
  }
118
- function G(e, t, n, r) {
118
+ function K(e, t, n, r) {
119
119
  if (!e) return null;
120
120
  let i = n[t.toUpperCase()];
121
121
  return i === void 0 ? null : d(e, t, i, r);
122
122
  }
123
123
  function be(e, t) {
124
- return e ? e.billing_interval_hours ? ve(e.billing_interval_hours, t) : ye(e.access_duration_hours, t) ?? t.t("interval.once") : null;
124
+ return e ? e.billing_interval_hours ? ye(e.billing_interval_hours, t) : W(e.access_duration_hours, t) ?? t.t("interval.once") : null;
125
125
  }
126
126
  function xe(e, { t }) {
127
127
  return e.product?.display_name?.trim() || e.price?.key?.trim() || t("subscriptions.fallbackName");
@@ -130,7 +130,7 @@ function Se(e, t, n) {
130
130
  let r = [...new Set((t?.lines ?? []).map((e) => e.description.trim()).filter(Boolean))], i = t?.lines.length === 1 ? t.lines[0] : void 0;
131
131
  return {
132
132
  name: r.join(", ") || n.t(e.subscription_id ? "history.subscription" : "history.purchase"),
133
- detail: i?.billing_interval_hours ? ve(i.billing_interval_hours, n) : null
133
+ detail: i?.billing_interval_hours ? ye(i.billing_interval_hours, n) : null
134
134
  };
135
135
  }
136
136
  function Ce(e, t) {
@@ -155,7 +155,7 @@ var Ee = /* @__PURE__ */ new Set([
155
155
  "past_due",
156
156
  "awaiting_method",
157
157
  "unverified"
158
- ]), De = (e) => !!e && new Date(e).getTime() > Date.now(), Oe = (e) => Ee.has(e.status) || e.status === "canceled" && !!e.access && (!e.access.ends_at || De(e.access.ends_at)), ke = (e) => Oe(e) && (!!e.cancel_scheduled || e.status === "canceled"), Ae = {
158
+ ]), De = (e) => !!e && new Date(e).getTime() > Date.now(), Oe = (e) => Ee.has(e.status) || e.status === "canceled" && !!e.access && (!e.access.ends_at || De(e.access.ends_at)), ke = (e) => Oe(e) && (!!e.cancel_scheduled || e.status === "canceled"), Ae = (e) => (e.status === "active" || e.status === "past_due") && !e.cancel_scheduled && !e.cancel_portal_url && !!e.product?.tier_group, je = {
159
159
  active: "success",
160
160
  succeeded: "success",
161
161
  paid: "success",
@@ -171,10 +171,10 @@ var Ee = /* @__PURE__ */ new Set([
171
171
  expired: "destructive",
172
172
  canceled: "neutral",
173
173
  refunded: "neutral"
174
- }, je = (e) => Ae[e] ?? "neutral", K = "[&_h2]:m-0 [&_p]:m-0 [&_ul]:m-0 [&_ul]:list-none [&_ul]:p-0 [&_table]:border-spacing-0";
174
+ }, Me = (e) => je[e] ?? "neutral", q = "[&_h2]:m-0 [&_p]:m-0 [&_ul]:m-0 [&_ul]:list-none [&_ul]:p-0 [&_table]:border-spacing-0";
175
175
  //#endregion
176
176
  //#region src/components/ui/card.tsx
177
- function Me({ className: e, size: t = "default", ...n }) {
177
+ function Ne({ className: e, size: t = "default", ...n }) {
178
178
  return /* @__PURE__ */ F("div", {
179
179
  "data-slot": "card",
180
180
  "data-size": t,
@@ -182,21 +182,21 @@ function Me({ className: e, size: t = "default", ...n }) {
182
182
  ...n
183
183
  });
184
184
  }
185
- function Ne({ className: e, ...t }) {
185
+ function Pe({ className: e, ...t }) {
186
186
  return /* @__PURE__ */ F("div", {
187
187
  "data-slot": "card-header",
188
188
  className: L("group/card-header @container/card-header grid auto-rows-min items-start gap-1 rounded-t-xl px-(--card-spacing) has-data-[slot=card-action]:grid-cols-[1fr_auto] has-data-[slot=card-description]:grid-rows-[auto_auto] [.border-b]:pb-(--card-spacing)", e),
189
189
  ...t
190
190
  });
191
191
  }
192
- function Pe({ className: e, ...t }) {
192
+ function Fe({ className: e, ...t }) {
193
193
  return /* @__PURE__ */ F("div", {
194
194
  "data-slot": "card-title",
195
195
  className: L("text-base leading-normal font-medium group-data-[size=sm]/card:text-sm", e),
196
196
  ...t
197
197
  });
198
198
  }
199
- function Fe({ className: e, ...t }) {
199
+ function J({ className: e, ...t }) {
200
200
  return /* @__PURE__ */ F("div", {
201
201
  "data-slot": "card-description",
202
202
  className: L("text-sm text-muted-foreground", e),
@@ -210,7 +210,7 @@ function Ie({ className: e, ...t }) {
210
210
  ...t
211
211
  });
212
212
  }
213
- function q({ className: e, ...t }) {
213
+ function Y({ className: e, ...t }) {
214
214
  return /* @__PURE__ */ F("div", {
215
215
  "data-slot": "card-content",
216
216
  className: L("flex flex-col gap-3 px-(--card-spacing)", e),
@@ -219,7 +219,7 @@ function q({ className: e, ...t }) {
219
219
  }
220
220
  //#endregion
221
221
  //#region src/components/ui/skeleton.tsx
222
- function J({ className: e, ...t }) {
222
+ function X({ className: e, ...t }) {
223
223
  return /* @__PURE__ */ F("div", {
224
224
  "data-slot": "skeleton",
225
225
  className: L("animate-pulse rounded-md bg-muted", e),
@@ -228,50 +228,50 @@ function J({ className: e, ...t }) {
228
228
  }
229
229
  //#endregion
230
230
  //#region src/account/section.tsx
231
- function Y({ title: e, description: t, action: n, appearance: r, className: i, children: a, ...o }) {
232
- let s = x(r), c = N.useId();
231
+ function Le({ title: e, description: t, action: n, appearance: r, className: i, children: a, ...o }) {
232
+ let s = k(r), c = P.useId();
233
233
  return /* @__PURE__ */ F("section", {
234
234
  "aria-labelledby": c,
235
- className: L(s.className, K, "block", i),
235
+ className: L(s.className, q, "block", i),
236
236
  "data-orck-theme": s["data-orck-theme"],
237
237
  style: s.style,
238
238
  "data-testid": o["data-testid"],
239
- children: /* @__PURE__ */ I(Me, {
239
+ children: /* @__PURE__ */ I(Ne, {
240
240
  className: "gap-4 bg-card text-card-foreground",
241
- children: [/* @__PURE__ */ I(Ne, { children: [
242
- /* @__PURE__ */ F(Pe, {
241
+ children: [/* @__PURE__ */ I(Pe, { children: [
242
+ /* @__PURE__ */ F(Fe, {
243
243
  id: c,
244
244
  role: "heading",
245
245
  "aria-level": 2,
246
246
  children: e
247
247
  }),
248
- t ? /* @__PURE__ */ F(Fe, { children: t }) : null,
248
+ t ? /* @__PURE__ */ F(J, { children: t }) : null,
249
249
  n ? /* @__PURE__ */ F(Ie, { children: n }) : null
250
- ] }), /* @__PURE__ */ F(q, {
250
+ ] }), /* @__PURE__ */ F(Y, {
251
251
  className: "gap-0",
252
252
  children: a
253
253
  })]
254
254
  })
255
255
  });
256
256
  }
257
- function Le({ rows: e = 2 }) {
257
+ function Re({ rows: e = 2 }) {
258
258
  return /* @__PURE__ */ F("div", {
259
259
  className: "grid gap-4 py-2",
260
260
  "aria-hidden": !0,
261
261
  children: Array.from({ length: e }, (e, t) => /* @__PURE__ */ I("div", {
262
262
  className: "flex items-center gap-3",
263
263
  children: [
264
- /* @__PURE__ */ F(J, { className: "h-7 w-11 rounded-md" }),
264
+ /* @__PURE__ */ F(X, { className: "h-7 w-11 rounded-md" }),
265
265
  /* @__PURE__ */ I("div", {
266
266
  className: "grid flex-1 gap-2",
267
- children: [/* @__PURE__ */ F(J, { className: "h-3.5 w-40" }), /* @__PURE__ */ F(J, { className: "h-3 w-28" })]
267
+ children: [/* @__PURE__ */ F(X, { className: "h-3.5 w-40" }), /* @__PURE__ */ F(X, { className: "h-3 w-28" })]
268
268
  }),
269
- /* @__PURE__ */ F(J, { className: "h-3.5 w-14" })
269
+ /* @__PURE__ */ F(X, { className: "h-3.5 w-14" })
270
270
  ]
271
271
  }, t))
272
272
  });
273
273
  }
274
- function Re({ title: e, description: t, action: n }) {
274
+ function ze({ title: e, description: t, action: n }) {
275
275
  return /* @__PURE__ */ I("div", {
276
276
  className: "grid justify-items-center gap-1 rounded-lg border border-dashed px-4 py-8 text-center",
277
277
  children: [
@@ -290,15 +290,15 @@ function Re({ title: e, description: t, action: n }) {
290
290
  ]
291
291
  });
292
292
  }
293
- function ze({ error: e, message: t, onRetry: n }) {
294
- let r = S();
293
+ function Be({ error: e, message: t, onRetry: n }) {
294
+ let r = y();
295
295
  return /* @__PURE__ */ I("div", {
296
296
  role: "alert",
297
297
  className: "flex flex-wrap items-center justify-between gap-3 rounded-lg bg-destructive/5 px-4 py-3",
298
298
  children: [/* @__PURE__ */ F("p", {
299
299
  className: "text-sm text-destructive",
300
300
  children: t ?? r.error(e)
301
- }), /* @__PURE__ */ F(H, {
301
+ }), /* @__PURE__ */ F(U, {
302
302
  variant: "outline",
303
303
  size: "sm",
304
304
  onClick: n,
@@ -308,7 +308,7 @@ function ze({ error: e, message: t, onRetry: n }) {
308
308
  }
309
309
  //#endregion
310
310
  //#region src/components/ui/badge.tsx
311
- var Be = R("group/badge inline-flex h-5 w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-4xl border border-transparent px-2 py-0.5 text-xs font-medium whitespace-nowrap transition-all focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none [&>svg]:size-3!", {
311
+ var Ve = oe("group/badge inline-flex h-5 w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-4xl border border-transparent px-2 py-0.5 text-xs font-medium whitespace-nowrap transition-all focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none [&>svg]:size-3!", {
312
312
  variants: { variant: {
313
313
  default: "bg-primary text-primary-foreground [a]:hover:bg-primary/80",
314
314
  secondary: "bg-secondary text-secondary-foreground [a]:hover:bg-secondary/80",
@@ -319,10 +319,10 @@ var Be = R("group/badge inline-flex h-5 w-fit shrink-0 items-center justify-cent
319
319
  } },
320
320
  defaultVariants: { variant: "default" }
321
321
  });
322
- function Ve({ className: e, variant: t = "default", render: n, ...r }) {
323
- return z({
322
+ function He({ className: e, variant: t = "default", render: n, ...r }) {
323
+ return se({
324
324
  defaultTagName: "span",
325
- props: oe({ className: L(Be({ variant: t }), e) }, r),
325
+ props: z({ className: L(Ve({ variant: t }), e) }, r),
326
326
  render: n,
327
327
  state: {
328
328
  slot: "badge",
@@ -332,33 +332,33 @@ function Ve({ className: e, variant: t = "default", render: n, ...r }) {
332
332
  }
333
333
  //#endregion
334
334
  //#region src/account/status-badge.tsx
335
- var He = {
335
+ var Ue = {
336
336
  success: "bg-[color:var(--orck-success)]/12 text-[color:var(--orck-success)]",
337
337
  warning: "bg-[color:var(--orck-warning)]/14 text-[color:var(--orck-warning)]",
338
338
  destructive: "bg-destructive/10 text-destructive",
339
339
  neutral: "bg-muted text-muted-foreground"
340
340
  };
341
- function Ue({ status: e, label: t, className: n }) {
342
- let { t: r, messages: i } = S(), a = e, o = t ?? (a in i.status ? r(`status.${a}`) : e.replace(/_/g, " "));
343
- return /* @__PURE__ */ F(Ve, {
341
+ function We({ status: e, label: t, className: n }) {
342
+ let { t: r, messages: i } = y(), a = e, o = t ?? (a in i.status ? r(`status.${a}`) : e.replace(/_/g, " "));
343
+ return /* @__PURE__ */ F(He, {
344
344
  "data-status": e,
345
- className: L(He[je(e)], "font-medium", n),
345
+ className: L(Ue[Me(e)], "font-medium", n),
346
346
  children: o
347
347
  });
348
348
  }
349
349
  //#endregion
350
350
  //#region src/account/payment-history.tsx
351
- function We(e, t) {
351
+ function Ge(e, t) {
352
352
  if (e.card?.last4) return we(e.card, t);
353
353
  let n = e.rail ?? "";
354
354
  return n in t.messages.history.rail ? t.t(`history.rail.${n}`) : n || t.t("common.notAvailable");
355
355
  }
356
- function Ge({ appearance: e, className: t, ...n }) {
357
- let r = S(), { t: i } = r, { locale: a } = k(), o = D(n), s = O(), c, l = o.payments;
358
- c = l === null && o.error ? /* @__PURE__ */ F(ze, {
356
+ function Ke({ appearance: e, className: t, ...n }) {
357
+ let r = y(), { t: i } = r, { locale: a } = E(), o = ee(n), s = te(), c, l = o.payments;
358
+ c = l === null && o.error ? /* @__PURE__ */ F(Be, {
359
359
  error: o.error,
360
360
  onRetry: o.refetch
361
- }) : l === null ? /* @__PURE__ */ F(Le, { rows: 3 }) : l.length === 0 && o.page === 0 ? /* @__PURE__ */ F(Re, {
361
+ }) : l === null ? /* @__PURE__ */ F(Re, { rows: 3 }) : l.length === 0 && o.page === 0 ? /* @__PURE__ */ F(ze, {
362
362
  title: i("history.empty"),
363
363
  description: i("history.emptyDescription")
364
364
  }) : /* @__PURE__ */ F("div", {
@@ -398,7 +398,7 @@ function Ge({ appearance: e, className: t, ...n }) {
398
398
  }) }), /* @__PURE__ */ F("tbody", {
399
399
  className: "divide-y divide-border",
400
400
  children: l.map((e) => {
401
- let t = e.kind === "refund", n = e.status || (t ? "refunded" : "unknown"), c = G(e.amount, e.currency, s, a), l = !t && e.amount_refunded && e.amount_refunded !== "0" ? G(e.amount_refunded, e.currency, s, a) : null, u = W(e.created_at, a) ?? i("common.notAvailable"), d = Se(e, e.order_id ? o.orders[e.order_id] : void 0, r);
401
+ let t = e.kind === "refund", n = e.status || (t ? "refunded" : "unknown"), c = K(e.amount, e.currency, s, a), l = !t && e.amount_refunded && e.amount_refunded !== "0" ? K(e.amount_refunded, e.currency, s, a) : null, u = G(e.created_at, a) ?? i("common.notAvailable"), d = Se(e, e.order_id ? o.orders[e.order_id] : void 0, r);
402
402
  return /* @__PURE__ */ I("tr", {
403
403
  "data-testid": "payment-row",
404
404
  "data-payment-id": e.id,
@@ -430,18 +430,18 @@ function Ge({ appearance: e, className: t, ...n }) {
430
430
  children: [
431
431
  u,
432
432
  " · ",
433
- We(e, r)
433
+ Ge(e, r)
434
434
  ]
435
435
  })
436
436
  ]
437
437
  }),
438
438
  /* @__PURE__ */ F("td", {
439
439
  className: "hidden py-3 pr-3 align-top text-muted-foreground tabular-nums @md:table-cell",
440
- children: We(e, r)
440
+ children: Ge(e, r)
441
441
  }),
442
442
  /* @__PURE__ */ F("td", {
443
443
  className: "py-3 pr-3 align-top",
444
- children: /* @__PURE__ */ F(Ue, {
444
+ children: /* @__PURE__ */ F(We, {
445
445
  status: n,
446
446
  label: t ? i("history.refund") : void 0
447
447
  })
@@ -460,7 +460,7 @@ function Ge({ appearance: e, className: t, ...n }) {
460
460
  })
461
461
  });
462
462
  let u = o.page > 0 || o.hasMore;
463
- return /* @__PURE__ */ I(Y, {
463
+ return /* @__PURE__ */ I(Le, {
464
464
  title: i("history.title"),
465
465
  description: i("history.description"),
466
466
  appearance: e,
@@ -470,7 +470,7 @@ function Ge({ appearance: e, className: t, ...n }) {
470
470
  c,
471
471
  l !== null && o.error ? /* @__PURE__ */ F("div", {
472
472
  className: "pt-3",
473
- children: /* @__PURE__ */ F(ze, {
473
+ children: /* @__PURE__ */ F(Be, {
474
474
  error: o.error,
475
475
  onRetry: o.refetch
476
476
  })
@@ -483,13 +483,13 @@ function Ge({ appearance: e, className: t, ...n }) {
483
483
  children: i("history.page", { page: o.page + 1 })
484
484
  }), /* @__PURE__ */ I("div", {
485
485
  className: "flex gap-2",
486
- children: [/* @__PURE__ */ F(H, {
486
+ children: [/* @__PURE__ */ F(U, {
487
487
  variant: "outline",
488
488
  size: "sm",
489
489
  disabled: o.page === 0 || o.loading,
490
490
  onClick: o.previous,
491
491
  children: i("common.previous")
492
- }), /* @__PURE__ */ F(H, {
492
+ }), /* @__PURE__ */ F(U, {
493
493
  variant: "outline",
494
494
  size: "sm",
495
495
  disabled: !o.hasMore || o.loading,
@@ -503,7 +503,7 @@ function Ge({ appearance: e, className: t, ...n }) {
503
503
  }
504
504
  //#endregion
505
505
  //#region src/lib/card-brands.ts
506
- var Ke = {
506
+ var qe = {
507
507
  visa: "visa",
508
508
  mastercard: "mastercard",
509
509
  mc: "mastercard",
@@ -512,13 +512,13 @@ var Ke = {
512
512
  americanexpress: "amex",
513
513
  "american express": "amex"
514
514
  };
515
- function qe(e) {
515
+ function Je(e) {
516
516
  let t = e?.trim().toLowerCase().replace(/[^a-z ]/g, "");
517
- return t ? Ke[t] : void 0;
517
+ return t ? qe[t] : void 0;
518
518
  }
519
519
  //#endregion
520
520
  //#region src/components/card-brands.tsx
521
- function Je() {
521
+ function Ye() {
522
522
  return /* @__PURE__ */ F("svg", {
523
523
  viewBox: "0 0 1000 324.68",
524
524
  className: "h-2.5 w-auto",
@@ -529,7 +529,7 @@ function Je() {
529
529
  })
530
530
  });
531
531
  }
532
- function Ye() {
532
+ function Xe() {
533
533
  return /* @__PURE__ */ F("svg", {
534
534
  viewBox: "0 0 152.4 108",
535
535
  className: "h-4 w-auto",
@@ -558,8 +558,8 @@ function Ye() {
558
558
  ] })] })
559
559
  });
560
560
  }
561
- function Xe() {
562
- let e = `orck-amex-${N.useId().replace(/[^a-zA-Z0-9-]/g, "")}`;
561
+ function Ze() {
562
+ let e = `orck-amex-${P.useId().replace(/[^a-zA-Z0-9-]/g, "")}`;
563
563
  return /* @__PURE__ */ I("svg", {
564
564
  viewBox: "0 0 300 300",
565
565
  className: "h-full w-auto",
@@ -622,34 +622,34 @@ function Xe() {
622
622
  ]
623
623
  });
624
624
  }
625
- function Ze({ brand: e, fallback: t, className: n }) {
626
- let r = qe(e);
625
+ function Qe({ brand: e, fallback: t, className: n }) {
626
+ let r = Je(e);
627
627
  return /* @__PURE__ */ F("span", {
628
628
  "aria-hidden": !0,
629
629
  className: L("grid h-7 w-11 shrink-0 place-items-center overflow-hidden rounded-md", r ? "bg-white" : "bg-muted text-[10px] font-semibold tracking-wide text-muted-foreground uppercase", n),
630
- children: r === "visa" ? /* @__PURE__ */ F(Je, {}) : r === "mastercard" ? /* @__PURE__ */ F(Ye, {}) : r === "amex" ? /* @__PURE__ */ F(Xe, {}) : t
630
+ children: r === "visa" ? /* @__PURE__ */ F(Ye, {}) : r === "mastercard" ? /* @__PURE__ */ F(Xe, {}) : r === "amex" ? /* @__PURE__ */ F(Ze, {}) : t
631
631
  });
632
632
  }
633
- var Qe = [
633
+ var $e = [
634
634
  {
635
635
  brand: "visa",
636
- Mark: Je
636
+ Mark: Ye
637
637
  },
638
638
  {
639
639
  brand: "mastercard",
640
- Mark: Ye
640
+ Mark: Xe
641
641
  },
642
642
  {
643
643
  brand: "amex",
644
- Mark: Xe
644
+ Mark: Ze
645
645
  }
646
646
  ];
647
- function $e({ active: e }) {
648
- let t = qe(e);
647
+ function et({ active: e }) {
648
+ let t = Je(e);
649
649
  return /* @__PURE__ */ F("span", {
650
650
  "aria-hidden": !0,
651
651
  className: "flex items-center gap-1",
652
- children: Qe.map(({ brand: e, Mark: n }) => /* @__PURE__ */ F("span", {
652
+ children: $e.map(({ brand: e, Mark: n }) => /* @__PURE__ */ F("span", {
653
653
  className: L("grid h-5 w-8 place-items-center rounded-[4px] bg-white ring-1 ring-[color:var(--border)] transition-opacity", t && t !== e && "opacity-30"),
654
654
  children: /* @__PURE__ */ F(n, {})
655
655
  }, e))
@@ -657,66 +657,66 @@ function $e({ active: e }) {
657
657
  }
658
658
  //#endregion
659
659
  //#region src/components/ui/alert-dialog.tsx
660
- function et({ ...e }) {
660
+ function tt({ ...e }) {
661
661
  return /* @__PURE__ */ F(B.Root, {
662
662
  "data-slot": "alert-dialog",
663
663
  ...e
664
664
  });
665
665
  }
666
- function tt({ ...e }) {
666
+ function nt({ ...e }) {
667
667
  return /* @__PURE__ */ F(B.Portal, {
668
668
  "data-slot": "alert-dialog-portal",
669
669
  ...e
670
670
  });
671
671
  }
672
- function nt({ className: e, ...t }) {
672
+ function rt({ className: e, ...t }) {
673
673
  return /* @__PURE__ */ F(B.Backdrop, {
674
674
  "data-slot": "alert-dialog-overlay",
675
675
  className: L("fixed inset-0 isolate z-50 bg-black/10 duration-100 supports-backdrop-filter:backdrop-blur-xs data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0", e),
676
676
  ...t
677
677
  });
678
678
  }
679
- function rt({ className: e, size: t = "default", ...n }) {
680
- return /* @__PURE__ */ I(tt, { children: [/* @__PURE__ */ F(nt, {}), /* @__PURE__ */ F(B.Popup, {
679
+ function it({ className: e, size: t = "default", ...n }) {
680
+ return /* @__PURE__ */ I(nt, { children: [/* @__PURE__ */ F(rt, {}), /* @__PURE__ */ F(B.Popup, {
681
681
  "data-slot": "alert-dialog-content",
682
682
  "data-size": t,
683
683
  className: L("group/alert-dialog-content fixed top-1/2 left-1/2 z-50 grid w-full -translate-x-1/2 -translate-y-1/2 gap-6 rounded-xl bg-popover p-6 text-popover-foreground ring-1 ring-foreground/10 duration-100 outline-none data-[size=default]:max-w-xs data-[size=sm]:max-w-xs data-[size=default]:sm:max-w-lg data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95", e),
684
684
  ...n
685
685
  })] });
686
686
  }
687
- function it({ className: e, ...t }) {
687
+ function at({ className: e, ...t }) {
688
688
  return /* @__PURE__ */ F("div", {
689
689
  "data-slot": "alert-dialog-header",
690
690
  className: L("grid grid-rows-[auto_1fr] place-items-center gap-1.5 text-center has-data-[slot=alert-dialog-media]:grid-rows-[auto_auto_1fr] has-data-[slot=alert-dialog-media]:gap-x-6 sm:group-data-[size=default]/alert-dialog-content:place-items-start sm:group-data-[size=default]/alert-dialog-content:text-left sm:group-data-[size=default]/alert-dialog-content:has-data-[slot=alert-dialog-media]:grid-rows-[auto_1fr]", e),
691
691
  ...t
692
692
  });
693
693
  }
694
- function at({ className: e, ...t }) {
694
+ function ot({ className: e, ...t }) {
695
695
  return /* @__PURE__ */ F("div", {
696
696
  "data-slot": "alert-dialog-footer",
697
697
  className: L("flex flex-col-reverse gap-2 group-data-[size=sm]/alert-dialog-content:grid group-data-[size=sm]/alert-dialog-content:grid-cols-2 sm:flex-row sm:justify-end", e),
698
698
  ...t
699
699
  });
700
700
  }
701
- function ot({ className: e, ...t }) {
701
+ function st({ className: e, ...t }) {
702
702
  return /* @__PURE__ */ F(B.Title, {
703
703
  "data-slot": "alert-dialog-title",
704
704
  className: L("text-lg font-medium sm:group-data-[size=default]/alert-dialog-content:group-has-data-[slot=alert-dialog-media]/alert-dialog-content:col-start-2", e),
705
705
  ...t
706
706
  });
707
707
  }
708
- function st({ className: e, ...t }) {
708
+ function ct({ className: e, ...t }) {
709
709
  return /* @__PURE__ */ F(B.Description, {
710
710
  "data-slot": "alert-dialog-description",
711
711
  className: L("text-sm text-balance text-muted-foreground md:text-pretty *:[a]:underline *:[a]:underline-offset-3 *:[a]:hover:text-foreground", e),
712
712
  ...t
713
713
  });
714
714
  }
715
- function ct({ className: e, variant: t = "outline", size: n = "default", ...r }) {
715
+ function lt({ className: e, variant: t = "outline", size: n = "default", ...r }) {
716
716
  return /* @__PURE__ */ F(B.Close, {
717
717
  "data-slot": "alert-dialog-cancel",
718
718
  className: L(e),
719
- render: /* @__PURE__ */ F(H, {
719
+ render: /* @__PURE__ */ F(U, {
720
720
  variant: t,
721
721
  size: n
722
722
  }),
@@ -725,39 +725,39 @@ function ct({ className: e, variant: t = "outline", size: n = "default", ...r })
725
725
  }
726
726
  //#endregion
727
727
  //#region src/components/ui/dialog.tsx
728
- function lt({ ...e }) {
728
+ function ut({ ...e }) {
729
729
  return /* @__PURE__ */ F(V.Root, {
730
730
  "data-slot": "dialog",
731
731
  ...e
732
732
  });
733
733
  }
734
- function ut({ ...e }) {
734
+ function dt({ ...e }) {
735
735
  return /* @__PURE__ */ F(V.Portal, {
736
736
  "data-slot": "dialog-portal",
737
737
  ...e
738
738
  });
739
739
  }
740
- function dt({ className: e, ...t }) {
740
+ function ft({ className: e, ...t }) {
741
741
  return /* @__PURE__ */ F(V.Backdrop, {
742
742
  "data-slot": "dialog-overlay",
743
743
  className: L("fixed inset-0 isolate z-50 bg-black/10 duration-100 supports-backdrop-filter:backdrop-blur-xs data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0", e),
744
744
  ...t
745
745
  });
746
746
  }
747
- function ft({ className: e, children: t, showCloseButton: n = !0, ...r }) {
748
- return /* @__PURE__ */ I(ut, { children: [/* @__PURE__ */ F(dt, {}), /* @__PURE__ */ I(V.Popup, {
747
+ function pt({ className: e, children: t, showCloseButton: n = !0, ...r }) {
748
+ return /* @__PURE__ */ I(dt, { children: [/* @__PURE__ */ F(ft, {}), /* @__PURE__ */ I(V.Popup, {
749
749
  "data-slot": "dialog-content",
750
750
  className: L("fixed top-1/2 left-1/2 z-50 grid w-full max-w-[calc(100%-2rem)] -translate-x-1/2 -translate-y-1/2 gap-6 rounded-xl bg-popover p-6 text-sm text-popover-foreground ring-1 ring-foreground/10 duration-100 outline-none sm:max-w-md data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95", e),
751
751
  ...r,
752
752
  children: [t, n && /* @__PURE__ */ I(V.Close, {
753
753
  "data-slot": "dialog-close",
754
- render: /* @__PURE__ */ F(H, {
754
+ render: /* @__PURE__ */ F(U, {
755
755
  variant: "ghost",
756
756
  className: "absolute top-4 right-4",
757
757
  size: "icon-sm"
758
758
  }),
759
- children: [/* @__PURE__ */ F(se, {
760
- icon: ue,
759
+ children: [/* @__PURE__ */ F(ce, {
760
+ icon: de,
761
761
  strokeWidth: 2
762
762
  }), /* @__PURE__ */ F("span", {
763
763
  className: "sr-only",
@@ -766,32 +766,32 @@ function ft({ className: e, children: t, showCloseButton: n = !0, ...r }) {
766
766
  })]
767
767
  })] });
768
768
  }
769
- function pt({ className: e, ...t }) {
769
+ function mt({ className: e, ...t }) {
770
770
  return /* @__PURE__ */ F("div", {
771
771
  "data-slot": "dialog-header",
772
772
  className: L("flex flex-col gap-2", e),
773
773
  ...t
774
774
  });
775
775
  }
776
- function mt({ className: e, showCloseButton: t = !1, children: n, ...r }) {
776
+ function ht({ className: e, showCloseButton: t = !1, children: n, ...r }) {
777
777
  return /* @__PURE__ */ I("div", {
778
778
  "data-slot": "dialog-footer",
779
779
  className: L("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end", e),
780
780
  ...r,
781
781
  children: [n, t && /* @__PURE__ */ F(V.Close, {
782
- render: /* @__PURE__ */ F(H, { variant: "outline" }),
782
+ render: /* @__PURE__ */ F(U, { variant: "outline" }),
783
783
  children: "Close"
784
784
  })]
785
785
  });
786
786
  }
787
- function ht({ className: e, ...t }) {
787
+ function gt({ className: e, ...t }) {
788
788
  return /* @__PURE__ */ F(V.Title, {
789
789
  "data-slot": "dialog-title",
790
790
  className: L("leading-none font-medium", e),
791
791
  ...t
792
792
  });
793
793
  }
794
- function gt({ className: e, ...t }) {
794
+ function _t({ className: e, ...t }) {
795
795
  return /* @__PURE__ */ F(V.Description, {
796
796
  "data-slot": "dialog-description",
797
797
  className: L("text-sm text-muted-foreground *:[a]:underline *:[a]:underline-offset-3 *:[a]:hover:text-foreground", e),
@@ -800,10 +800,10 @@ function gt({ className: e, ...t }) {
800
800
  }
801
801
  //#endregion
802
802
  //#region src/components/ui/spinner.tsx
803
- function X({ className: e, ...t }) {
804
- let { t: n } = S();
805
- return /* @__PURE__ */ F(se, {
806
- icon: fe,
803
+ function Z({ className: e, ...t }) {
804
+ let { t: n } = y();
805
+ return /* @__PURE__ */ F(ce, {
806
+ icon: pe,
807
807
  strokeWidth: 2,
808
808
  "data-slot": "spinner",
809
809
  role: "status",
@@ -814,8 +814,8 @@ function X({ className: e, ...t }) {
814
814
  }
815
815
  //#endregion
816
816
  //#region src/components/ui/input.tsx
817
- function _t({ className: e, type: t, ...n }) {
818
- return /* @__PURE__ */ F(pe, {
817
+ function vt({ className: e, type: t, ...n }) {
818
+ return /* @__PURE__ */ F(me, {
819
819
  type: t,
820
820
  "data-slot": "input",
821
821
  className: L("h-9 w-full min-w-0 rounded-md border border-input bg-transparent px-2.5 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40", e),
@@ -824,7 +824,7 @@ function _t({ className: e, type: t, ...n }) {
824
824
  }
825
825
  //#endregion
826
826
  //#region src/components/ui/label.tsx
827
- function Z({ className: e, ...t }) {
827
+ function Q({ className: e, ...t }) {
828
828
  return /* @__PURE__ */ F("label", {
829
829
  "data-slot": "label",
830
830
  className: L("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50", e),
@@ -833,7 +833,7 @@ function Z({ className: e, ...t }) {
833
833
  }
834
834
  //#endregion
835
835
  //#region src/lib/billing.ts
836
- var vt = "AD AE AF AG AI AL AM AO AQ AR AS AT AU AW AX AZ BA BB BD BE BF BG BH BI BJ BL BM BN BO BQ BR BS BT BV BW BY BZ CA CC CD CF CG CH CI CK CL CM CN CO CR CU CV CW CX CY CZ DE DJ DK DM DO DZ EC EE EG EH ER ES ET FI FJ FK FM FO FR GA GB GD GE GF GG GH GI GL GM GN GP GQ GR GS GT GU GW GY HK HM HN HR HT HU ID IE IL IM IN IO IQ IR IS IT JE JM JO JP KE KG KH KI KM KN KP KR KW KY KZ LA LB LC LI LK LR LS LT LU LV LY MA MC MD ME MF MG MH MK ML MM MN MO MP MQ MR MS MT MU MV MW MX MY MZ NA NC NE NF NG NI NL NO NP NR NU NZ OM PA PE PF PG PH PK PL PM PN PR PS PT PW PY QA RE RO RS RU RW SA SB SC SD SE SG SH SI SJ SK SL SM SN SO SR SS ST SV SX SY SZ TC TD TF TG TH TJ TK TL TM TN TO TR TT TV TW TZ UA UG UM US UY UZ VA VC VE VG VI VN VU WF WS YE YT ZA ZM ZW".split(" "), yt = /* @__PURE__ */ new Set(/* @__PURE__ */ "AE.AG.AO.AQ.AW.BF.BI.BJ.BO.BQ.BS.BV.BW.BZ.CF.CG.CI.CK.CM.CW.DM.ER.FJ.GA.GD.GM.GQ.JM.KM.KP.LY.ML.MR.QA.RW.SB.SC.SL.SO.SR.SS.ST.SX.SY.TD.TG.TK.TO.TV.UM.VU.YE.ZW".split(".")), bt = {
836
+ var yt = "AD AE AF AG AI AL AM AO AQ AR AS AT AU AW AX AZ BA BB BD BE BF BG BH BI BJ BL BM BN BO BQ BR BS BT BV BW BY BZ CA CC CD CF CG CH CI CK CL CM CN CO CR CU CV CW CX CY CZ DE DJ DK DM DO DZ EC EE EG EH ER ES ET FI FJ FK FM FO FR GA GB GD GE GF GG GH GI GL GM GN GP GQ GR GS GT GU GW GY HK HM HN HR HT HU ID IE IL IM IN IO IQ IR IS IT JE JM JO JP KE KG KH KI KM KN KP KR KW KY KZ LA LB LC LI LK LR LS LT LU LV LY MA MC MD ME MF MG MH MK ML MM MN MO MP MQ MR MS MT MU MV MW MX MY MZ NA NC NE NF NG NI NL NO NP NR NU NZ OM PA PE PF PG PH PK PL PM PN PR PS PT PW PY QA RE RO RS RU RW SA SB SC SD SE SG SH SI SJ SK SL SM SN SO SR SS ST SV SX SY SZ TC TD TF TG TH TJ TK TL TM TN TO TR TT TV TW TZ UA UG UM US UY UZ VA VC VE VG VI VN VU WF WS YE YT ZA ZM ZW".split(" "), bt = /* @__PURE__ */ new Set(/* @__PURE__ */ "AE.AG.AO.AQ.AW.BF.BI.BJ.BO.BQ.BS.BV.BW.BZ.CF.CG.CI.CK.CM.CW.DM.ER.FJ.GA.GD.GM.GQ.JM.KM.KP.LY.ML.MR.QA.RW.SB.SC.SL.SO.SR.SS.ST.SX.SY.TD.TG.TK.TO.TV.UM.VU.YE.ZW".split(".")), xt = {
837
837
  AR: "C1000",
838
838
  BR: "01000-000",
839
839
  CA: "A1A 1A1",
@@ -847,31 +847,31 @@ var vt = "AD AE AF AG AI AL AM AO AQ AR AS AT AU AW AX AZ BA BB BD BE BF BG BH B
847
847
  MX: "01000",
848
848
  PE: "15001",
849
849
  US: "12345"
850
- }, xt = new Intl.DisplayNames(["en"], { type: "region" }), St = vt.map((e) => ({
850
+ }, St = new Intl.DisplayNames(["en"], { type: "region" }), Ct = yt.map((e) => ({
851
851
  code: e,
852
- name: xt.of(e) ?? e
853
- })).sort((e, t) => e.name.localeCompare(t.name)), Ct = M.string().trim().min(1, "Full name is required").max(200, "Full name is too long"), wt = M.string().trim().regex(/^[A-Za-z]{2}$/, "Select a country").transform((e) => e.toUpperCase());
854
- function Tt(e) {
852
+ name: St.of(e) ?? e
853
+ })).sort((e, t) => e.name.localeCompare(t.name)), wt = N.string().trim().min(1, "Full name is required").max(200, "Full name is too long"), Tt = N.string().trim().regex(/^[A-Za-z]{2}$/, "Select a country").transform((e) => e.toUpperCase());
854
+ function Et(e) {
855
855
  let t = e.trim().toUpperCase();
856
- return t === "" || !yt.has(t);
856
+ return t === "" || !bt.has(t);
857
857
  }
858
- function Et(e, t) {
858
+ function Dt(e, t) {
859
859
  let n = e.trim().toUpperCase(), r = n === "US" ? "ZIP code" : n === "GB" || n === "AU" || n === "NZ" ? "Postcode" : "Postal code";
860
860
  return {
861
861
  label: t ? r : `${r} (optional)`,
862
- placeholder: bt[n] ?? r,
862
+ placeholder: xt[n] ?? r,
863
863
  inputMode: n === "US" ? "numeric" : "text",
864
864
  pattern: n === "US" ? "[0-9]{5}(?:-[0-9]{4})?" : void 0
865
865
  };
866
866
  }
867
- var Dt = M.object({
868
- name_on_card: Ct,
869
- country: wt,
870
- zip: M.string().trim().max(32, "Postal code is too long")
867
+ var Ot = N.object({
868
+ name_on_card: wt,
869
+ country: Tt,
870
+ zip: N.string().trim().max(32, "Postal code is too long")
871
871
  }).superRefine((e, t) => {
872
- Tt(e.country) && !e.zip && t.addIssue({
872
+ Et(e.country) && !e.zip && t.addIssue({
873
873
  code: "custom",
874
- message: `${Et(e.country, !0).label} is required`,
874
+ message: `${Dt(e.country, !0).label} is required`,
875
875
  path: ["zip"]
876
876
  }), e.country === "US" && e.zip && !/^\d{5}(?:-\d{4})?$/.test(e.zip) && t.addIssue({
877
877
  code: "custom",
@@ -879,7 +879,7 @@ var Dt = M.object({
879
879
  path: ["zip"]
880
880
  });
881
881
  });
882
- function Ot(e) {
882
+ function kt(e) {
883
883
  let t = {
884
884
  ...e.zip ? { postal_code: e.zip } : {},
885
885
  ...e.country ? { country: e.country } : {}
@@ -890,12 +890,12 @@ function Ot(e) {
890
890
  ...Object.keys(t).length > 0 ? { address: t } : {}
891
891
  };
892
892
  }
893
- var kt = {
893
+ var At = {
894
894
  name_on_card: "",
895
895
  country: "",
896
896
  zip: ""
897
897
  };
898
- function At() {
898
+ function jt() {
899
899
  try {
900
900
  if (typeof navigator > "u" || !navigator.language) return "";
901
901
  let e = new Intl.Locale(navigator.language).maximize().region;
@@ -904,31 +904,31 @@ function At() {
904
904
  return "";
905
905
  }
906
906
  }
907
- function jt(e) {
907
+ function Mt(e) {
908
908
  let t = e?.trim().toUpperCase() ?? "";
909
- if (St.some((e) => e.code === t)) return t;
910
- let n = At();
911
- return St.some((e) => e.code === n) ? n : "";
909
+ if (Ct.some((e) => e.code === t)) return t;
910
+ let n = jt();
911
+ return Ct.some((e) => e.code === n) ? n : "";
912
912
  }
913
- var Mt = /* @__PURE__ */ new Set(/* @__PURE__ */ "AT.BE.BG.CY.CZ.DE.DK.EE.ES.FI.FR.GR.HR.HU.IE.IT.LT.LU.LV.MT.NL.PL.PT.RO.SE.SI.SK.IS.LI.NO.GB".split("."));
914
- function Nt(e) {
915
- return Mt.has(e.trim().toUpperCase());
913
+ var Nt = /* @__PURE__ */ new Set(/* @__PURE__ */ "AT.BE.BG.CY.CZ.DE.DK.EE.ES.FI.FR.GR.HR.HU.IE.IT.LT.LU.LV.MT.NL.PL.PT.RO.SE.SI.SK.IS.LI.NO.GB".split("."));
914
+ function Pt(e) {
915
+ return Nt.has(e.trim().toUpperCase());
916
916
  }
917
917
  //#endregion
918
918
  //#region src/components/billing-fields.tsx
919
- var Pt = "text-[13px] font-medium text-foreground", Ft = "h-[38px] rounded-[9px] border border-input bg-card text-sm text-foreground", It = `${Ft} px-2.5`;
920
- function Lt({ id: e, name: t, label: n, value: r, onChange: i, autoComplete: a, placeholder: o, disabled: s, maxLength: c, required: l, type: u, inputMode: d, pattern: f }) {
919
+ var Ft = "text-[13px] font-medium text-foreground", It = "h-[38px] rounded-[9px] border border-input bg-card text-sm text-foreground", Lt = `${It} px-2.5`;
920
+ function Rt({ id: e, name: t, label: n, value: r, onChange: i, autoComplete: a, placeholder: o, disabled: s, maxLength: c, required: l, type: u, inputMode: d, pattern: f }) {
921
921
  return /* @__PURE__ */ I("div", {
922
922
  className: "grid gap-1.5",
923
- children: [/* @__PURE__ */ F(Z, {
923
+ children: [/* @__PURE__ */ F(Q, {
924
924
  htmlFor: e,
925
- className: Pt,
925
+ className: Ft,
926
926
  children: n
927
- }), /* @__PURE__ */ F(_t, {
927
+ }), /* @__PURE__ */ F(vt, {
928
928
  id: e,
929
929
  name: t,
930
930
  type: u,
931
- className: It,
931
+ className: Lt,
932
932
  value: r,
933
933
  autoComplete: a,
934
934
  placeholder: o,
@@ -941,17 +941,17 @@ function Lt({ id: e, name: t, label: n, value: r, onChange: i, autoComplete: a,
941
941
  })]
942
942
  });
943
943
  }
944
- function Rt({ id: e, value: t, onChange: n, disabled: r }) {
944
+ function zt({ id: e, value: t, onChange: n, disabled: r }) {
945
945
  return /* @__PURE__ */ I("div", {
946
946
  className: "grid gap-1.5",
947
- children: [/* @__PURE__ */ F(Z, {
947
+ children: [/* @__PURE__ */ F(Q, {
948
948
  htmlFor: e,
949
- className: Pt,
949
+ className: Ft,
950
950
  children: "Country or region"
951
951
  }), /* @__PURE__ */ I("select", {
952
952
  id: e,
953
953
  name: "country",
954
- className: `${Ft} w-full px-2.5`,
954
+ className: `${It} w-full px-2.5`,
955
955
  value: t,
956
956
  autoComplete: "billing country",
957
957
  disabled: r,
@@ -960,18 +960,18 @@ function Rt({ id: e, value: t, onChange: n, disabled: r }) {
960
960
  children: [/* @__PURE__ */ F("option", {
961
961
  value: "",
962
962
  children: "Select country"
963
- }), St.map((e) => /* @__PURE__ */ F("option", {
963
+ }), Ct.map((e) => /* @__PURE__ */ F("option", {
964
964
  value: e.code,
965
965
  children: e.name
966
966
  }, e.code))]
967
967
  })]
968
968
  });
969
969
  }
970
- function zt({ id: e, value: t, country: n, onChange: r, disabled: i, required: a, error: o }) {
971
- let s = Et(n, a);
970
+ function Bt({ id: e, value: t, country: n, onChange: r, disabled: i, required: a, error: o }) {
971
+ let s = Dt(n, a);
972
972
  return /* @__PURE__ */ I("div", {
973
973
  className: "grid gap-1.5",
974
- children: [/* @__PURE__ */ F(Lt, {
974
+ children: [/* @__PURE__ */ F(Rt, {
975
975
  id: e,
976
976
  name: "zip",
977
977
  label: s.label,
@@ -991,15 +991,15 @@ function zt({ id: e, value: t, country: n, onChange: r, disabled: i, required: a
991
991
  }) : null]
992
992
  });
993
993
  }
994
- function Bt({ idPrefix: e, value: t, onChange: n, disabled: r, postalError: i, children: a }) {
994
+ function Vt({ idPrefix: e, value: t, onChange: n, disabled: r, postalError: i, children: a }) {
995
995
  let o = (e) => (r) => n({
996
996
  ...t,
997
997
  [e]: r
998
- }), s = Tt(t.country);
998
+ }), s = Et(t.country);
999
999
  return /* @__PURE__ */ I("div", {
1000
1000
  className: "grid gap-3",
1001
1001
  children: [
1002
- /* @__PURE__ */ F(Lt, {
1002
+ /* @__PURE__ */ F(Rt, {
1003
1003
  id: `${e}-name-on-card`,
1004
1004
  name: "name_on_card",
1005
1005
  label: "Full name",
@@ -1013,12 +1013,12 @@ function Bt({ idPrefix: e, value: t, onChange: n, disabled: r, postalError: i, c
1013
1013
  a,
1014
1014
  /* @__PURE__ */ I("div", {
1015
1015
  className: "grid grid-cols-2 gap-3",
1016
- children: [/* @__PURE__ */ F(Rt, {
1016
+ children: [/* @__PURE__ */ F(zt, {
1017
1017
  id: `${e}-country`,
1018
1018
  value: t.country,
1019
1019
  onChange: o("country"),
1020
1020
  disabled: r
1021
- }), /* @__PURE__ */ F(zt, {
1021
+ }), /* @__PURE__ */ F(Bt, {
1022
1022
  id: `${e}-postal-code`,
1023
1023
  value: t.zip,
1024
1024
  country: t.country,
@@ -1033,7 +1033,7 @@ function Bt({ idPrefix: e, value: t, onChange: n, disabled: r, postalError: i, c
1033
1033
  }
1034
1034
  //#endregion
1035
1035
  //#region src/components/card-fields.tsx
1036
- function Vt({ id: e, message: t }) {
1036
+ function Ht({ id: e, message: t }) {
1037
1037
  return t ? /* @__PURE__ */ F("p", {
1038
1038
  id: e,
1039
1039
  className: "text-[12.5px] text-destructive",
@@ -1041,8 +1041,8 @@ function Vt({ id: e, message: t }) {
1041
1041
  children: t
1042
1042
  }) : null;
1043
1043
  }
1044
- var Ht = "orck-collect-field h-[38px] overflow-hidden rounded-[9px] border border-[color:var(--border)] bg-card px-[3px]", Ut = "flex h-[38px] items-center rounded-[9px] border border-[color:var(--border)] bg-card px-[11px] text-sm text-[color:var(--orck-faint)] tabular-nums";
1045
- function Wt({ ids: e, preview: t, error: n, fieldErrors: r = {}, hidden: i, brand: a }) {
1044
+ var Ut = "orck-collect-field h-[38px] overflow-hidden rounded-[9px] border border-[color:var(--border)] bg-card px-[3px]", Wt = "flex h-[38px] items-center rounded-[9px] border border-[color:var(--border)] bg-card px-[11px] text-sm text-[color:var(--orck-faint)] tabular-nums";
1045
+ function Gt({ ids: e, preview: t, error: n, fieldErrors: r = {}, hidden: i, brand: a }) {
1046
1046
  return /* @__PURE__ */ I("div", {
1047
1047
  className: L("grid gap-3", i && "hidden"),
1048
1048
  "aria-hidden": i || void 0,
@@ -1052,21 +1052,21 @@ function Wt({ ids: e, preview: t, error: n, fieldErrors: r = {}, hidden: i, bran
1052
1052
  children: [
1053
1053
  /* @__PURE__ */ I("div", {
1054
1054
  className: "flex items-center justify-between",
1055
- children: [/* @__PURE__ */ F(Z, {
1055
+ children: [/* @__PURE__ */ F(Q, {
1056
1056
  htmlFor: e.number,
1057
1057
  className: "text-[13px] font-medium text-foreground",
1058
1058
  children: "Card number"
1059
- }), /* @__PURE__ */ F($e, { active: a })]
1059
+ }), /* @__PURE__ */ F(et, { active: a })]
1060
1060
  }),
1061
1061
  t ? /* @__PURE__ */ F("div", {
1062
1062
  id: e.number,
1063
- className: Ut,
1063
+ className: Wt,
1064
1064
  children: "1234 1234 1234 1234"
1065
1065
  }) : /* @__PURE__ */ F("div", {
1066
1066
  id: e.number,
1067
- className: L(Ht, r.number && "border-destructive")
1067
+ className: L(Ut, r.number && "border-destructive")
1068
1068
  }),
1069
- /* @__PURE__ */ F(Vt, {
1069
+ /* @__PURE__ */ F(Ht, {
1070
1070
  id: `${e.number}-error`,
1071
1071
  message: r.number
1072
1072
  })
@@ -1077,20 +1077,20 @@ function Wt({ ids: e, preview: t, error: n, fieldErrors: r = {}, hidden: i, bran
1077
1077
  children: [/* @__PURE__ */ I("div", {
1078
1078
  className: "grid gap-1.5",
1079
1079
  children: [
1080
- /* @__PURE__ */ F(Z, {
1080
+ /* @__PURE__ */ F(Q, {
1081
1081
  htmlFor: e.expiry,
1082
1082
  className: "text-[13px] font-medium text-foreground",
1083
1083
  children: "Expiry"
1084
1084
  }),
1085
1085
  t ? /* @__PURE__ */ F("div", {
1086
1086
  id: e.expiry,
1087
- className: Ut,
1087
+ className: Wt,
1088
1088
  children: "MM / YY"
1089
1089
  }) : /* @__PURE__ */ F("div", {
1090
1090
  id: e.expiry,
1091
- className: L(Ht, r.expiry && "border-destructive")
1091
+ className: L(Ut, r.expiry && "border-destructive")
1092
1092
  }),
1093
- /* @__PURE__ */ F(Vt, {
1093
+ /* @__PURE__ */ F(Ht, {
1094
1094
  id: `${e.expiry}-error`,
1095
1095
  message: r.expiry
1096
1096
  })
@@ -1098,20 +1098,20 @@ function Wt({ ids: e, preview: t, error: n, fieldErrors: r = {}, hidden: i, bran
1098
1098
  }), /* @__PURE__ */ I("div", {
1099
1099
  className: "grid gap-1.5",
1100
1100
  children: [
1101
- /* @__PURE__ */ F(Z, {
1101
+ /* @__PURE__ */ F(Q, {
1102
1102
  htmlFor: e.cvv,
1103
1103
  className: "text-[13px] font-medium text-foreground",
1104
1104
  children: "CVC"
1105
1105
  }),
1106
1106
  t ? /* @__PURE__ */ F("div", {
1107
1107
  id: e.cvv,
1108
- className: Ut,
1108
+ className: Wt,
1109
1109
  children: "CVC"
1110
1110
  }) : /* @__PURE__ */ F("div", {
1111
1111
  id: e.cvv,
1112
- className: L(Ht, r.cvv && "border-destructive")
1112
+ className: L(Ut, r.cvv && "border-destructive")
1113
1113
  }),
1114
- /* @__PURE__ */ F(Vt, {
1114
+ /* @__PURE__ */ F(Ht, {
1115
1115
  id: `${e.cvv}-error`,
1116
1116
  message: r.cvv
1117
1117
  })
@@ -1126,15 +1126,15 @@ function Wt({ ids: e, preview: t, error: n, fieldErrors: r = {}, hidden: i, bran
1126
1126
  ]
1127
1127
  });
1128
1128
  }
1129
- var Gt = "h-[38px] w-full min-w-0 rounded-[9px] border border-[color:var(--border)] bg-card px-[11px] text-sm text-foreground tabular-nums outline-none placeholder:text-[color:var(--orck-faint)] focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:opacity-50";
1130
- function Kt({ ids: e, card: t, fieldErrors: n = {}, disabled: r, hidden: i }) {
1129
+ var Kt = "h-[38px] w-full min-w-0 rounded-[9px] border border-[color:var(--border)] bg-card px-[11px] text-sm text-foreground tabular-nums outline-none placeholder:text-[color:var(--orck-faint)] focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:opacity-50";
1130
+ function qt({ ids: e, card: t, fieldErrors: n = {}, disabled: r, hidden: i }) {
1131
1131
  let a = {
1132
1132
  ...t.fieldErrors,
1133
1133
  ...n
1134
- }, o = (e, n, i, a) => /* @__PURE__ */ I(P, { children: [/* @__PURE__ */ F("input", {
1134
+ }, o = (e, n, i, a) => /* @__PURE__ */ I(ae, { children: [/* @__PURE__ */ F("input", {
1135
1135
  id: e,
1136
1136
  name: `card-${n}`,
1137
- className: L(Gt, i && "border-destructive"),
1137
+ className: L(Kt, i && "border-destructive"),
1138
1138
  value: t.input[n],
1139
1139
  onChange: (e) => t.change(n, e.target.value),
1140
1140
  onBlur: () => t.leave(n),
@@ -1145,7 +1145,7 @@ function Kt({ ids: e, card: t, fieldErrors: n = {}, disabled: r, hidden: i }) {
1145
1145
  "aria-invalid": i ? !0 : void 0,
1146
1146
  "aria-describedby": i ? `${e}-error` : void 0,
1147
1147
  ...a
1148
- }), /* @__PURE__ */ F(Vt, {
1148
+ }), /* @__PURE__ */ F(Ht, {
1149
1149
  id: `${e}-error`,
1150
1150
  message: i
1151
1151
  })] });
@@ -1156,11 +1156,11 @@ function Kt({ ids: e, card: t, fieldErrors: n = {}, disabled: r, hidden: i }) {
1156
1156
  className: "grid gap-1.5",
1157
1157
  children: [/* @__PURE__ */ I("div", {
1158
1158
  className: "flex items-center justify-between",
1159
- children: [/* @__PURE__ */ F(Z, {
1159
+ children: [/* @__PURE__ */ F(Q, {
1160
1160
  htmlFor: e.number,
1161
1161
  className: "text-[13px] font-medium text-foreground",
1162
1162
  children: "Card number"
1163
- }), /* @__PURE__ */ F($e, {})]
1163
+ }), /* @__PURE__ */ F(et, {})]
1164
1164
  }), o(e.number, "number", a.number, {
1165
1165
  autoComplete: "cc-number",
1166
1166
  placeholder: "1234 1234 1234 1234",
@@ -1170,7 +1170,7 @@ function Kt({ ids: e, card: t, fieldErrors: n = {}, disabled: r, hidden: i }) {
1170
1170
  className: "grid grid-cols-2 gap-3",
1171
1171
  children: [/* @__PURE__ */ I("div", {
1172
1172
  className: "grid gap-1.5",
1173
- children: [/* @__PURE__ */ F(Z, {
1173
+ children: [/* @__PURE__ */ F(Q, {
1174
1174
  htmlFor: e.expiry,
1175
1175
  className: "text-[13px] font-medium text-foreground",
1176
1176
  children: "Expiry"
@@ -1181,7 +1181,7 @@ function Kt({ ids: e, card: t, fieldErrors: n = {}, disabled: r, hidden: i }) {
1181
1181
  })]
1182
1182
  }), /* @__PURE__ */ I("div", {
1183
1183
  className: "grid gap-1.5",
1184
- children: [/* @__PURE__ */ F(Z, {
1184
+ children: [/* @__PURE__ */ F(Q, {
1185
1185
  htmlFor: e.cvv,
1186
1186
  className: "text-[13px] font-medium text-foreground",
1187
1187
  children: "CVC"
@@ -1196,18 +1196,18 @@ function Kt({ ids: e, card: t, fieldErrors: n = {}, disabled: r, hidden: i }) {
1196
1196
  }
1197
1197
  //#endregion
1198
1198
  //#region src/components/pay-button.tsx
1199
- function Q({ label: e, processing: t, disabled: n }) {
1200
- return /* @__PURE__ */ F(H, {
1199
+ function $({ label: e, processing: t, disabled: n }) {
1200
+ return /* @__PURE__ */ F(U, {
1201
1201
  type: "submit",
1202
1202
  className: L("h-[42px] w-full rounded-[10px] text-sm font-semibold tabular-nums", t && "opacity-75"),
1203
1203
  disabled: n || t,
1204
- children: t ? /* @__PURE__ */ I(P, { children: [/* @__PURE__ */ F("span", {
1204
+ children: t ? /* @__PURE__ */ I(ae, { children: [/* @__PURE__ */ F("span", {
1205
1205
  "aria-hidden": !0,
1206
1206
  className: "size-3.5 animate-spin rounded-full border-2 border-[color:var(--primary-foreground)]/35 border-t-[color:var(--primary-foreground)] motion-reduce:animate-none"
1207
1207
  }), "Processing…"] }) : e
1208
1208
  });
1209
1209
  }
1210
- function qt() {
1210
+ function Jt() {
1211
1211
  return /* @__PURE__ */ I("div", {
1212
1212
  className: "-mt-1 flex items-center justify-center gap-1.5 text-xs text-[color:var(--orck-faint)]",
1213
1213
  children: [
@@ -1232,25 +1232,25 @@ function qt() {
1232
1232
  }
1233
1233
  //#endregion
1234
1234
  //#region src/components/platform-card-form.tsx
1235
- function Jt({ publicKey: e, submitLabel: t, disabled: n, onTokenized: r, purpose: i = "payment", defaultCountry: a }) {
1236
- let o = N.useId().replace(/[^a-zA-Z0-9-]/g, ""), s = N.useMemo(() => ({
1235
+ function Yt({ publicKey: e, submitLabel: t, disabled: n, onTokenized: r, purpose: i = "payment", defaultCountry: a }) {
1236
+ let o = P.useId().replace(/[^a-zA-Z0-9-]/g, ""), s = P.useMemo(() => ({
1237
1237
  number: `bt-${o}-number`,
1238
1238
  expiry: `bt-${o}-expiry`,
1239
1239
  cvv: `bt-${o}-cvv`
1240
- }), [o]), [c, l] = N.useState(() => ({
1241
- ...kt,
1242
- country: jt(a)
1243
- })), [u, d] = N.useState(!1), [f, p] = N.useState(!1), [m, h] = N.useState(!1), [g, _] = N.useState(!1), [v, y] = N.useState(), b = N.useRef(void 0), x = N.useRef(void 0), S = N.useRef(!1), C = N.useRef({
1240
+ }), [o]), [c, l] = P.useState(() => ({
1241
+ ...At,
1242
+ country: Mt(a)
1243
+ })), [u, d] = P.useState(!1), [f, p] = P.useState(!1), [m, h] = P.useState(!1), [g, _] = P.useState(!1), [v, y] = P.useState(), b = P.useRef(void 0), x = P.useRef(void 0), S = P.useRef(!1), C = P.useRef({
1244
1244
  generation: 0,
1245
1245
  disabled: n
1246
1246
  });
1247
- N.useLayoutEffect(() => {
1247
+ P.useLayoutEffect(() => {
1248
1248
  C.current = {
1249
1249
  generation: C.current.generation + 1,
1250
1250
  disabled: n
1251
1251
  };
1252
- }, [e, n]), N.useEffect(() => {
1253
- let t = !0, n = ie(e), r = n.createElement("cardNumber"), i = n.createElement("expiry"), a = n.createElement("cvv");
1252
+ }, [e, n]), P.useEffect(() => {
1253
+ let t = !0, n = M(e), r = n.createElement("cardNumber"), i = n.createElement("expiry"), a = n.createElement("cvv");
1254
1254
  return Promise.all([
1255
1255
  r.mount(`#${s.number}`),
1256
1256
  i.mount(`#${s.expiry}`),
@@ -1273,7 +1273,7 @@ function Jt({ publicKey: e, submitLabel: t, disabled: n, onTokenized: r, purpose
1273
1273
  }, [e, s]);
1274
1274
  let w = i === "setup" ? "Retry saving card" : "Retry payment", T = i === "setup" ? "The card save is not confirmed. Retry to check the same card." : "The payment result is not confirmed. Retry to check the same payment.", E = async (e) => {
1275
1275
  if (e.preventDefault(), n || S.current || m || !x.current) return;
1276
- let t = Dt.safeParse(c);
1276
+ let t = Ot.safeParse(c);
1277
1277
  if (!t.success) {
1278
1278
  y(t.error.issues[0]?.message ?? "Check the billing details");
1279
1279
  return;
@@ -1299,12 +1299,12 @@ function Jt({ publicKey: e, submitLabel: t, disabled: n, onTokenized: r, purpose
1299
1299
  className: "grid gap-4",
1300
1300
  onSubmit: (e) => void E(e),
1301
1301
  children: [
1302
- /* @__PURE__ */ F(Bt, {
1302
+ /* @__PURE__ */ F(Vt, {
1303
1303
  idPrefix: `bt-${o}`,
1304
1304
  value: c,
1305
1305
  onChange: l,
1306
1306
  disabled: n || f || g || m,
1307
- children: /* @__PURE__ */ F(Wt, {
1307
+ children: /* @__PURE__ */ F(Gt, {
1308
1308
  ids: s,
1309
1309
  preview: !1
1310
1310
  })
@@ -1314,29 +1314,29 @@ function Jt({ publicKey: e, submitLabel: t, disabled: n, onTokenized: r, purpose
1314
1314
  className: "text-sm text-destructive",
1315
1315
  children: v
1316
1316
  }) : null,
1317
- /* @__PURE__ */ F(Q, {
1317
+ /* @__PURE__ */ F($, {
1318
1318
  label: g ? w : t,
1319
1319
  processing: f,
1320
- disabled: n || m || !u || !Dt.safeParse(c).success
1320
+ disabled: n || m || !u || !Ot.safeParse(c).success
1321
1321
  }),
1322
- /* @__PURE__ */ F(qt, {})
1322
+ /* @__PURE__ */ F(Jt, {})
1323
1323
  ]
1324
1324
  });
1325
1325
  }
1326
1326
  //#endregion
1327
1327
  //#region src/lib/stripe.ts
1328
- var Yt = /* @__PURE__ */ new Map();
1329
- function Xt(e) {
1330
- let t = Yt.get(e);
1328
+ var Xt = /* @__PURE__ */ new Map();
1329
+ function Zt(e) {
1330
+ let t = Xt.get(e);
1331
1331
  return t || (t = import("@stripe/stripe-js").then(({ loadStripe: t }) => t(e)).then((e) => {
1332
1332
  if (!e) throw Error("Stripe could not be loaded.");
1333
1333
  return e;
1334
- }), t.catch(() => Yt.delete(e)), Yt.set(e, t)), t;
1334
+ }), t.catch(() => Xt.delete(e)), Xt.set(e, t)), t;
1335
1335
  }
1336
1336
  //#endregion
1337
1337
  //#region src/lib/collect.ts
1338
- var Zt = "openrails-collectjs", Qt = 3e4, $t = /* @__PURE__ */ new WeakMap();
1339
- function en(e) {
1338
+ var Qt = "openrails-collectjs", $t = 3e4, en = /* @__PURE__ */ new WeakMap();
1339
+ function tn(e) {
1340
1340
  try {
1341
1341
  let t = new URL(e);
1342
1342
  return t.protocol !== "https:" || t.username || t.password || t.hash ? void 0 : t.toString();
@@ -1344,9 +1344,9 @@ function en(e) {
1344
1344
  return;
1345
1345
  }
1346
1346
  }
1347
- function tn(e) {
1347
+ function nn(e) {
1348
1348
  if (!e) return "";
1349
- let t = nn(e);
1349
+ let t = rn(e);
1350
1350
  if (t) return t;
1351
1351
  try {
1352
1352
  let t = document.createElement("canvas").getContext("2d");
@@ -1358,7 +1358,7 @@ function tn(e) {
1358
1358
  return "";
1359
1359
  }
1360
1360
  }
1361
- function nn(e) {
1361
+ function rn(e) {
1362
1362
  let t = /^oklch\(\s*([\d.]+%?)\s+([\d.]+)\s+([\d.]+)(?:deg)?\s*(?:\/\s*([\d.]+%?)\s*)?\)$/i.exec(e.trim());
1363
1363
  if (!t) return "";
1364
1364
  let n = (e) => e.endsWith("%") ? parseFloat(e) / 100 : parseFloat(e), r = n(t[1]), i = parseFloat(t[2]), a = parseFloat(t[3]) * Math.PI / 180, o = t[4] === void 0 ? 1 : n(t[4]), s = i * Math.cos(a), c = i * Math.sin(a), l = (r + .3963377774 * s + .2158037573 * c) ** 3, u = (r - .1055613458 * s - .0638541728 * c) ** 3, d = (r - .0894841775 * s - 1.291485548 * c) ** 3, f = (e) => {
@@ -1367,23 +1367,23 @@ function nn(e) {
1367
1367
  }, p = f(4.0767416621 * l - 3.3077115913 * u + .2309699292 * d), m = f(-1.2684380046 * l + 2.6097574011 * u - .3413193965 * d), h = f(-.0041960863 * l - .7034186147 * u + 1.707614701 * d);
1368
1368
  return o >= 1 ? `rgb(${p}, ${m}, ${h})` : `rgba(${p}, ${m}, ${h}, ${o})`;
1369
1369
  }
1370
- function rn(e) {
1370
+ function an(e) {
1371
1371
  return e.startsWith("preview_");
1372
1372
  }
1373
- var an = {
1373
+ var on = {
1374
1374
  ccnumber: "number",
1375
1375
  ccexp: "expiry",
1376
1376
  cvv: "cvv"
1377
- }, on = {
1377
+ }, sn = {
1378
1378
  number: "Enter a valid card number",
1379
1379
  expiry: "Enter a valid expiry date",
1380
1380
  cvv: "Enter a valid security code"
1381
1381
  };
1382
- function sn(e) {
1383
- let t = e.enabled && rn(e.tokenizationKey), [n, r] = N.useState(!1), [i, a] = N.useState(), [o, s] = N.useState(), [c, l] = N.useState({}), u = N.useRef(void 0), d = N.useRef(void 0), { number: f, expiry: p, cvv: m } = e.selectors;
1384
- N.useEffect(() => {
1382
+ function cn(e) {
1383
+ let t = e.enabled && an(e.tokenizationKey), [n, r] = P.useState(!1), [i, a] = P.useState(), [o, s] = P.useState(), [c, l] = P.useState({}), u = P.useRef(void 0), d = P.useRef(void 0), { number: f, expiry: p, cvv: m } = e.selectors;
1384
+ P.useEffect(() => {
1385
1385
  if (!e.enabled || t || !e.tokenizationKey || !e.scriptURL || typeof document > "u") return;
1386
- let n = en(e.scriptURL);
1386
+ let n = tn(e.scriptURL);
1387
1387
  if (!n) {
1388
1388
  Promise.resolve().then(() => {
1389
1389
  r(!1), a("Card fields failed to load");
@@ -1411,7 +1411,7 @@ function sn(e) {
1411
1411
  c(() => {
1412
1412
  r(!1), a(void 0), l({});
1413
1413
  });
1414
- let t = document.querySelector(f), n = t ? window.getComputedStyle(t) : void 0, i = tn(n?.backgroundColor), d = i && i !== "transparent" && i !== "rgba(0, 0, 0, 0)" ? i : "#ffffff", h = tn(n?.color) || "#18181b", g = tn(n?.getPropertyValue("--muted-foreground").trim()) || h;
1414
+ let t = document.querySelector(f), n = t ? window.getComputedStyle(t) : void 0, i = nn(n?.backgroundColor), d = i && i !== "transparent" && i !== "rgba(0, 0, 0, 0)" ? i : "#ffffff", h = nn(n?.color) || "#18181b", g = nn(n?.getPropertyValue("--muted-foreground").trim()) || h;
1415
1415
  try {
1416
1416
  e.configure({
1417
1417
  variant: "inline",
@@ -1426,7 +1426,7 @@ function sn(e) {
1426
1426
  color: h
1427
1427
  },
1428
1428
  placeholderCss: { color: g },
1429
- invalidCss: { color: tn(n?.getPropertyValue("--destructive").trim()) || "#dc2626" },
1429
+ invalidCss: { color: nn(n?.getPropertyValue("--destructive").trim()) || "#dc2626" },
1430
1430
  focusCss: { outline: "none" },
1431
1431
  fields: {
1432
1432
  ccnumber: {
@@ -1448,16 +1448,16 @@ function sn(e) {
1448
1448
  fieldsAvailableCallback: () => c(() => r(!0)),
1449
1449
  lookUpCallback: (e) => c(() => s(e?.type || void 0)),
1450
1450
  validationCallback: (e, t, n) => {
1451
- let r = an[e];
1451
+ let r = on[e];
1452
1452
  r && c(() => l((e) => ({
1453
1453
  ...e,
1454
1454
  [r]: {
1455
1455
  valid: t,
1456
- message: t ? void 0 : n && n !== "Field is empty" ? `${on[r]}.` : on[r]
1456
+ message: t ? void 0 : n && n !== "Field is empty" ? `${sn[r]}.` : sn[r]
1457
1457
  }
1458
1458
  })));
1459
1459
  },
1460
- timeoutDuration: Qt,
1460
+ timeoutDuration: $t,
1461
1461
  timeoutCallback: () => {
1462
1462
  let e = u.current;
1463
1463
  u.current = void 0, e && (window.clearTimeout(e.timer), e.reject(/* @__PURE__ */ Error("Card entry timed out")));
@@ -1470,12 +1470,12 @@ function sn(e) {
1470
1470
  } catch {
1471
1471
  c(() => a("Card fields failed to load"));
1472
1472
  }
1473
- }, g = document.getElementById(Zt);
1474
- if (g instanceof HTMLScriptElement && (g.src !== n || $t.get(g) === "failed") && (g.remove(), g.src !== n && Reflect.deleteProperty(window, "CollectJS"), g = null), g instanceof HTMLScriptElement) {
1473
+ }, g = document.getElementById(Qt);
1474
+ if (g instanceof HTMLScriptElement && (g.src !== n || en.get(g) === "failed") && (g.remove(), g.src !== n && Reflect.deleteProperty(window, "CollectJS"), g = null), g instanceof HTMLScriptElement) {
1475
1475
  if (window.CollectJS) return h(), () => {
1476
1476
  o = !0;
1477
1477
  };
1478
- if ($t.get(g) === "loaded") return c(() => a("Card fields failed to load")), () => {
1478
+ if (en.get(g) === "loaded") return c(() => a("Card fields failed to load")), () => {
1479
1479
  o = !0;
1480
1480
  };
1481
1481
  let e = () => c(() => a("Card fields failed to load"));
@@ -1484,10 +1484,10 @@ function sn(e) {
1484
1484
  };
1485
1485
  }
1486
1486
  let _ = document.createElement("script");
1487
- return _.id = Zt, _.src = n, _.async = !0, _.dataset.tokenizationKey = e.tokenizationKey, $t.set(_, "loading"), _.onload = () => {
1488
- $t.set(_, "loaded"), h();
1487
+ return _.id = Qt, _.src = n, _.async = !0, _.dataset.tokenizationKey = e.tokenizationKey, en.set(_, "loading"), _.onload = () => {
1488
+ en.set(_, "loaded"), h();
1489
1489
  }, _.onerror = () => {
1490
- $t.set(_, "failed"), c(() => a("Card fields failed to load"));
1490
+ en.set(_, "failed"), c(() => a("Card fields failed to load"));
1491
1491
  }, document.head.appendChild(_), () => {
1492
1492
  o = !0;
1493
1493
  };
@@ -1501,7 +1501,7 @@ function sn(e) {
1501
1501
  p,
1502
1502
  m
1503
1503
  ]);
1504
- let h = N.useCallback(() => new Promise((e, r) => {
1504
+ let h = P.useCallback(() => new Promise((e, r) => {
1505
1505
  if (t) {
1506
1506
  e({
1507
1507
  token: "preview_payment_token",
@@ -1554,7 +1554,7 @@ function sn(e) {
1554
1554
  tokenize: h
1555
1555
  };
1556
1556
  }
1557
- function cn(e) {
1557
+ function ln(e) {
1558
1558
  let t = (e?.number ?? "").replace(/\D/g, ""), n = (e?.exp ?? "").replace(/\D/g, "");
1559
1559
  return {
1560
1560
  ...t.length >= 4 ? { last_four: t.slice(-4) } : {},
@@ -1564,8 +1564,8 @@ function cn(e) {
1564
1564
  }
1565
1565
  //#endregion
1566
1566
  //#region src/lib/stripe-appearance.ts
1567
- function ln(e) {
1568
- let t = window.getComputedStyle(e), n = (e) => tn(t.getPropertyValue(e).trim()) || void 0;
1567
+ function un(e) {
1568
+ let t = window.getComputedStyle(e), n = (e) => nn(t.getPropertyValue(e).trim()) || void 0;
1569
1569
  return {
1570
1570
  theme: e.closest(".dark") ? "night" : "stripe",
1571
1571
  variables: {
@@ -1600,22 +1600,22 @@ function ln(e) {
1600
1600
  }
1601
1601
  //#endregion
1602
1602
  //#region src/components/stripe-card.tsx
1603
- var un = N.forwardRef(function({ psp: e, client: t, defaultCountry: n, onCompleteChange: r, unavailableMessage: i, verificationPendingMessage: a }, o) {
1604
- let [s, c] = N.useState(), l = N.useRef(null), u = N.useRef(null), d = N.useRef(r);
1605
- N.useEffect(() => {
1603
+ var dn = P.forwardRef(function({ psp: e, client: t, defaultCountry: n, onCompleteChange: r, unavailableMessage: i, verificationPendingMessage: a }, o) {
1604
+ let [s, c] = P.useState(), l = P.useRef(null), u = P.useRef(null), d = P.useRef(r);
1605
+ P.useEffect(() => {
1606
1606
  d.current = r;
1607
1607
  });
1608
1608
  let f = e.config?.publishable_key;
1609
- return N.useEffect(() => {
1609
+ return P.useEffect(() => {
1610
1610
  if (!f || !l.current) return;
1611
1611
  let e = !1, t;
1612
- return Xt(f).then((r) => {
1612
+ return Zt(f).then((r) => {
1613
1613
  if (e || !l.current) return;
1614
1614
  let i = r.elements({
1615
1615
  mode: "setup",
1616
1616
  paymentMethodTypes: ["card"],
1617
1617
  paymentMethodCreation: "manual",
1618
- appearance: ln(l.current)
1618
+ appearance: un(l.current)
1619
1619
  }), a = i.create("payment", {
1620
1620
  wallets: {
1621
1621
  link: "never",
@@ -1639,7 +1639,7 @@ var un = N.forwardRef(function({ psp: e, client: t, defaultCountry: n, onComplet
1639
1639
  f,
1640
1640
  n,
1641
1641
  i
1642
- ]), N.useImperativeHandle(o, () => {
1642
+ ]), P.useImperativeHandle(o, () => {
1643
1643
  let n = async () => {
1644
1644
  let e = u.current;
1645
1645
  if (!e) throw Error(i);
@@ -1683,12 +1683,12 @@ var un = N.forwardRef(function({ psp: e, client: t, defaultCountry: n, onComplet
1683
1683
  children: s
1684
1684
  }) : null]
1685
1685
  });
1686
- }), dn = {
1686
+ }), fn = {
1687
1687
  number: "Enter a valid card number",
1688
1688
  expiry: "Enter a valid expiry date",
1689
1689
  cvv: "Enter a valid security code"
1690
- }, $ = (e) => e.replace(/\D/g, "");
1691
- function fn(e) {
1690
+ }, pn = (e) => e.replace(/\D/g, "");
1691
+ function mn(e) {
1692
1692
  let t = 0;
1693
1693
  for (let n = 0; n < e.length; n++) {
1694
1694
  let r = e.charCodeAt(e.length - 1 - n) - 48;
@@ -1696,24 +1696,24 @@ function fn(e) {
1696
1696
  }
1697
1697
  return t % 10 == 0;
1698
1698
  }
1699
- function pn(e) {
1700
- let t = $(e), n = (e) => t.length >= e ? Number(t.slice(0, e)) : -1;
1699
+ function hn(e) {
1700
+ let t = pn(e), n = (e) => t.length >= e ? Number(t.slice(0, e)) : -1;
1701
1701
  return n(1) === 4 ? "visa" : n(2) === 34 || n(2) === 37 ? "amex" : n(2) >= 51 && n(2) <= 55 || n(4) >= 2221 && n(4) <= 2720 ? "mastercard" : n(4) === 6011 || n(2) === 65 || n(3) >= 644 && n(3) <= 649 ? "discover" : n(2) === 35 ? "jcb" : n(2) === 36 || n(2) === 38 || n(3) >= 300 && n(3) <= 305 ? "diners" : "";
1702
1702
  }
1703
- function mn(e) {
1704
- let t = $(e).slice(0, 19);
1705
- return pn(t) === "amex" ? [
1703
+ function gn(e) {
1704
+ let t = pn(e).slice(0, 19);
1705
+ return hn(t) === "amex" ? [
1706
1706
  t.slice(0, 4),
1707
1707
  t.slice(4, 10),
1708
1708
  t.slice(10, 15)
1709
1709
  ].filter(Boolean).join(" ") : t.replace(/(\d{4})(?=\d)/g, "$1 ");
1710
1710
  }
1711
- function hn(e) {
1712
- let t = $(e).slice(0, 4);
1711
+ function _n(e) {
1712
+ let t = pn(e).slice(0, 4);
1713
1713
  return t.length > 2 ? `${t.slice(0, 2)} / ${t.slice(2)}` : t;
1714
1714
  }
1715
- function gn(e, t) {
1716
- let n = $(e);
1715
+ function vn(e, t) {
1716
+ let n = pn(e);
1717
1717
  if (n.length !== 4) return null;
1718
1718
  let r = Number(n.slice(0, 2)), i = 2e3 + Number(n.slice(2));
1719
1719
  return r < 1 || r > 12 || i < t.getFullYear() || i === t.getFullYear() && r < t.getMonth() + 1 ? null : {
@@ -1721,32 +1721,32 @@ function gn(e, t) {
1721
1721
  year: i
1722
1722
  };
1723
1723
  }
1724
- function _n(e, t = /* @__PURE__ */ new Date()) {
1725
- let n = {}, r = $(e.number);
1726
- (r.length < 12 || r.length > 19 || !fn(r)) && (n.number = dn.number), gn(e.expiry, t) || (n.expiry = dn.expiry);
1727
- let i = $(e.cvc), a = pn(r) === "amex" ? 4 : 3;
1728
- return (i !== e.cvc.trim() || i.length !== a && i.length !== 4) && (n.cvv = dn.cvv), n;
1724
+ function yn(e, t = /* @__PURE__ */ new Date()) {
1725
+ let n = {}, r = pn(e.number);
1726
+ (r.length < 12 || r.length > 19 || !mn(r)) && (n.number = fn.number), vn(e.expiry, t) || (n.expiry = fn.expiry);
1727
+ let i = pn(e.cvc), a = hn(r) === "amex" ? 4 : 3;
1728
+ return (i !== e.cvc.trim() || i.length !== a && i.length !== 4) && (n.cvv = fn.cvv), n;
1729
1729
  }
1730
- function vn(e, t = /* @__PURE__ */ new Date()) {
1731
- if (Object.keys(_n(e, t)).length > 0) return null;
1732
- let n = gn(e.expiry, t);
1730
+ function bn(e, t = /* @__PURE__ */ new Date()) {
1731
+ if (Object.keys(yn(e, t)).length > 0) return null;
1732
+ let n = vn(e.expiry, t);
1733
1733
  return {
1734
- number: $(e.number),
1734
+ number: pn(e.number),
1735
1735
  exp_month: n.month,
1736
1736
  exp_year: n.year,
1737
- cvc: $(e.cvc)
1737
+ cvc: pn(e.cvc)
1738
1738
  };
1739
1739
  }
1740
- var yn = {
1740
+ var xn = {
1741
1741
  number: "",
1742
1742
  expiry: "",
1743
1743
  cvc: ""
1744
1744
  };
1745
- function bn() {
1746
- let [e, t] = N.useState(yn), [n, r] = N.useState({}), i = _n(e), a = {};
1745
+ function Sn() {
1746
+ let [e, t] = P.useState(xn), [n, r] = P.useState({}), i = yn(e), a = {};
1747
1747
  n.number && i.number && (a.number = i.number), n.expiry && i.expiry && (a.expiry = i.expiry), n.cvc && i.cvv && (a.cvv = i.cvv);
1748
- let o = N.useCallback(() => {
1749
- t(yn), r({});
1748
+ let o = P.useCallback(() => {
1749
+ t(xn), r({});
1750
1750
  }, []);
1751
1751
  return {
1752
1752
  input: e,
@@ -1754,14 +1754,14 @@ function bn() {
1754
1754
  valid: Object.keys(i).length === 0,
1755
1755
  change: (e, n) => t((t) => ({
1756
1756
  ...t,
1757
- [e]: e === "number" ? mn(n) : e === "expiry" ? hn(n) : $(n).slice(0, 4)
1757
+ [e]: e === "number" ? gn(n) : e === "expiry" ? _n(n) : pn(n).slice(0, 4)
1758
1758
  })),
1759
1759
  leave: (e) => r((t) => ({
1760
1760
  ...t,
1761
1761
  [e]: !0
1762
1762
  })),
1763
1763
  take: () => {
1764
- let t = vn(e);
1764
+ let t = bn(e);
1765
1765
  return t ? (o(), t) : (r({
1766
1766
  number: !0,
1767
1767
  expiry: !0,
@@ -1773,21 +1773,21 @@ function bn() {
1773
1773
  }
1774
1774
  //#endregion
1775
1775
  //#region src/tokenized-card-form.tsx
1776
- function xn({ tokenizationKey: e, tokenizationURL: t, onTokenized: n, submitLabel: r = "Save card", disabled: i = !1, defaultCountry: a, saveOptInMerchant: o, terms: s, statementDescriptor: c, appearance: l, className: u }) {
1777
- let [d, f] = N.useState(!1), p = N.useId().replace(/[^a-zA-Z0-9-]/g, ""), m = N.useMemo(() => ({
1776
+ function Cn({ tokenizationKey: e, tokenizationURL: t, onTokenized: n, submitLabel: r = "Save card", disabled: i = !1, defaultCountry: a, saveOptInMerchant: o, terms: s, statementDescriptor: c, appearance: l, className: u }) {
1777
+ let [d, f] = P.useState(!1), p = P.useId().replace(/[^a-zA-Z0-9-]/g, ""), m = P.useMemo(() => ({
1778
1778
  number: `orck-save-${p}-number`,
1779
1779
  expiry: `orck-save-${p}-expiry`,
1780
1780
  cvv: `orck-save-${p}-cvv`
1781
- }), [p]), [h, g] = N.useState(() => ({
1782
- ...kt,
1783
- country: jt(a)
1784
- })), [_, v] = N.useState(!1), [y, b] = N.useState(!1), [x, S] = N.useState(), w = N.useRef({
1781
+ }), [p]), [h, g] = P.useState(() => ({
1782
+ ...At,
1783
+ country: Mt(a)
1784
+ })), [_, v] = P.useState(!1), [y, b] = P.useState(!1), [x, S] = P.useState(), T = P.useRef({
1785
1785
  generation: 0,
1786
1786
  disabled: i
1787
1787
  });
1788
- N.useLayoutEffect(() => {
1789
- w.current = {
1790
- generation: w.current.generation + 1,
1788
+ P.useLayoutEffect(() => {
1789
+ T.current = {
1790
+ generation: T.current.generation + 1,
1791
1791
  disabled: i
1792
1792
  };
1793
1793
  }, [
@@ -1795,11 +1795,11 @@ function xn({ tokenizationKey: e, tokenizationURL: t, onTokenized: n, submitLabe
1795
1795
  t,
1796
1796
  i
1797
1797
  ]);
1798
- let T = N.useRef(!0);
1799
- N.useEffect(() => (T.current = !0, () => {
1800
- T.current = !1;
1798
+ let E = P.useRef(!0);
1799
+ P.useEffect(() => (E.current = !0, () => {
1800
+ E.current = !1;
1801
1801
  }), []);
1802
- let D = sn({
1802
+ let D = cn({
1803
1803
  enabled: !0,
1804
1804
  active: !0,
1805
1805
  tokenizationKey: e,
@@ -1809,46 +1809,46 @@ function xn({ tokenizationKey: e, tokenizationURL: t, onTokenized: n, submitLabe
1809
1809
  expiry: `#${m.expiry}`,
1810
1810
  cvv: `#${m.cvv}`
1811
1811
  }
1812
- }), O = Dt.safeParse(h).success, k = o !== void 0 && Nt(h.country), A = async (e) => {
1812
+ }), O = Ot.safeParse(h).success, k = o !== void 0 && Pt(h.country), ee = async (e) => {
1813
1813
  if (e.preventDefault(), i || _ || y) return;
1814
- let t = Dt.safeParse(h);
1814
+ let t = Ot.safeParse(h);
1815
1815
  if (!t.success) {
1816
1816
  S(t.error.issues[0]?.message ?? "Check the billing details");
1817
1817
  return;
1818
1818
  }
1819
1819
  v(!0), S(void 0);
1820
- let r = w.current.generation, a = !1;
1820
+ let r = T.current.generation, a = !1;
1821
1821
  try {
1822
1822
  let e = await D.tokenize();
1823
- if (!T.current || w.current.generation !== r || w.current.disabled) return;
1823
+ if (!E.current || T.current.generation !== r || T.current.disabled) return;
1824
1824
  a = !0, b(!0), await n({
1825
1825
  payment_token: e.token,
1826
1826
  ...t.data,
1827
- ...cn(e.card),
1827
+ ...ln(e.card),
1828
1828
  ...k ? { reusable: d } : {}
1829
- }) === !1 && T.current && b(!1);
1829
+ }) === !1 && E.current && b(!1);
1830
1830
  } catch (e) {
1831
- T.current && S(a ? "The card-save result is not confirmed. Check your saved cards before starting another attempt." : e instanceof Error ? e.message : "Card entry could not be completed.");
1831
+ E.current && S(a ? "The card-save result is not confirmed. Check your saved cards before starting another attempt." : e instanceof Error ? e.message : "Card entry could not be completed.");
1832
1832
  } finally {
1833
- T.current && v(!1);
1833
+ E.current && v(!1);
1834
1834
  }
1835
1835
  };
1836
1836
  return /* @__PURE__ */ F("div", {
1837
1837
  className: L("orck", u),
1838
1838
  "data-orck-theme": C(l),
1839
- style: E(l),
1839
+ style: w(l),
1840
1840
  children: /* @__PURE__ */ I("form", {
1841
1841
  "aria-label": "Secure card setup",
1842
1842
  autoComplete: "on",
1843
1843
  className: "grid gap-4",
1844
- onSubmit: (e) => void A(e),
1844
+ onSubmit: (e) => void ee(e),
1845
1845
  children: [
1846
- /* @__PURE__ */ F(Bt, {
1846
+ /* @__PURE__ */ F(Vt, {
1847
1847
  idPrefix: `orck-save-${p}`,
1848
1848
  value: h,
1849
1849
  onChange: g,
1850
1850
  disabled: i || _ || y,
1851
- children: /* @__PURE__ */ F(Wt, {
1851
+ children: /* @__PURE__ */ F(Gt, {
1852
1852
  ids: m,
1853
1853
  preview: D.preview,
1854
1854
  brand: D.brand,
@@ -1880,7 +1880,7 @@ function xn({ tokenizationKey: e, tokenizationURL: t, onTokenized: n, submitLabe
1880
1880
  className: "text-sm text-destructive",
1881
1881
  children: x
1882
1882
  }) : null,
1883
- /* @__PURE__ */ F(Q, {
1883
+ /* @__PURE__ */ F($, {
1884
1884
  label: r,
1885
1885
  processing: _,
1886
1886
  disabled: i || y || !O || !D.ready || !D.valid || !!D.loadError
@@ -1892,37 +1892,37 @@ function xn({ tokenizationKey: e, tokenizationURL: t, onTokenized: n, submitLabe
1892
1892
  c,
1893
1893
  "” on your card statement."
1894
1894
  ]
1895
- }) : /* @__PURE__ */ F(qt, {})
1895
+ }) : /* @__PURE__ */ F(Jt, {})
1896
1896
  ]
1897
1897
  })
1898
1898
  });
1899
1899
  }
1900
1900
  //#endregion
1901
1901
  //#region src/save-payment-method.tsx
1902
- function Sn(e) {
1903
- let { t } = S(), n = s(e.psp);
1902
+ function wn(e) {
1903
+ let { t } = y(), n = s(e.psp);
1904
1904
  return n ? /* @__PURE__ */ I("div", {
1905
1905
  className: L("orck grid gap-4", e.className),
1906
1906
  "data-orck-theme": C(e.appearance),
1907
- style: E(e.appearance),
1907
+ style: w(e.appearance),
1908
1908
  children: [/* @__PURE__ */ F("p", {
1909
1909
  className: "text-sm text-muted-foreground",
1910
1910
  children: t("paymentMethods.saveNotice")
1911
- }), F(n === "platform" ? Dn : n === "collect_js" ? wn : n === "card" ? Tn : En, { ...e })]
1911
+ }), F(n === "platform" ? kn : n === "collect_js" ? En : n === "card" ? Dn : On, { ...e })]
1912
1912
  }) : /* @__PURE__ */ F("p", {
1913
1913
  role: "alert",
1914
1914
  className: "text-sm text-destructive",
1915
1915
  children: t("paymentMethods.unavailable")
1916
1916
  });
1917
1917
  }
1918
- var Cn = (e, t) => !n(t) && t instanceof Error && t.message ? t.message : e.error(t);
1919
- function wn({ psp: e, onSaved: t, submitLabel: n, appearance: r, defaultCountry: i }) {
1920
- let a = S(), { client: o, notify: s } = T(), [c, l] = N.useState(0), [u, d] = N.useState();
1921
- return /* @__PURE__ */ I(P, { children: [u ? /* @__PURE__ */ F("p", {
1918
+ var Tn = (e, t) => !n(t) && t instanceof Error && t.message ? t.message : e.error(t);
1919
+ function En({ psp: e, onSaved: t, submitLabel: n, appearance: r, defaultCountry: i }) {
1920
+ let a = y(), { client: o, notify: s } = j(), [c, l] = P.useState(0), [u, d] = P.useState();
1921
+ return /* @__PURE__ */ I(ae, { children: [u ? /* @__PURE__ */ F("p", {
1922
1922
  role: "alert",
1923
1923
  className: "text-sm text-destructive",
1924
1924
  children: u
1925
- }) : null, /* @__PURE__ */ F(xn, {
1925
+ }) : null, /* @__PURE__ */ F(Cn, {
1926
1926
  tokenizationKey: e.config.tokenization_key,
1927
1927
  tokenizationURL: e.config.tokenization_url,
1928
1928
  onTokenized: async (n) => {
@@ -1932,10 +1932,10 @@ function wn({ psp: e, onSaved: t, submitLabel: n, appearance: r, defaultCountry:
1932
1932
  r = await o.addPaymentMethod({
1933
1933
  psp_id: e.psp_id,
1934
1934
  token: n.payment_token,
1935
- billing_details: Ot(n)
1935
+ billing_details: kt(n)
1936
1936
  });
1937
1937
  } catch (e) {
1938
- d(Cn(a, e)), l((e) => e + 1);
1938
+ d(Tn(a, e)), l((e) => e + 1);
1939
1939
  return;
1940
1940
  }
1941
1941
  s({
@@ -1948,17 +1948,17 @@ function wn({ psp: e, onSaved: t, submitLabel: n, appearance: r, defaultCountry:
1948
1948
  appearance: r
1949
1949
  }, c)] });
1950
1950
  }
1951
- function Tn({ psp: e, onSaved: t, submitLabel: n, defaultCountry: r }) {
1952
- let i = S(), { client: a, notify: o } = T(), s = N.useId().replace(/[^a-zA-Z0-9-]/g, ""), c = N.useMemo(() => ({
1951
+ function Dn({ psp: e, onSaved: t, submitLabel: n, defaultCountry: r }) {
1952
+ let i = y(), { client: a, notify: o } = j(), s = P.useId().replace(/[^a-zA-Z0-9-]/g, ""), c = P.useMemo(() => ({
1953
1953
  number: `orck-save-${s}-number`,
1954
1954
  expiry: `orck-save-${s}-expiry`,
1955
1955
  cvv: `orck-save-${s}-cvv`
1956
- }), [s]), l = bn(), [u, d] = N.useState(() => ({
1957
- ...kt,
1958
- country: jt(r)
1959
- })), [f, p] = N.useState(!1), [m, h] = N.useState(), g = async (n) => {
1956
+ }), [s]), l = Sn(), [u, d] = P.useState(() => ({
1957
+ ...At,
1958
+ country: Mt(r)
1959
+ })), [f, p] = P.useState(!1), [m, h] = P.useState(), g = async (n) => {
1960
1960
  if (n.preventDefault(), f) return;
1961
- let r = Dt.safeParse(u);
1961
+ let r = Ot.safeParse(u);
1962
1962
  if (!r.success) {
1963
1963
  h(r.error.issues[0]?.message ?? "Check the billing details");
1964
1964
  return;
@@ -1970,14 +1970,14 @@ function Tn({ psp: e, onSaved: t, submitLabel: n, defaultCountry: r }) {
1970
1970
  let n = await a.addPaymentMethod({
1971
1971
  psp_id: e.psp_id,
1972
1972
  card: s,
1973
- billing_details: Ot(r.data)
1973
+ billing_details: kt(r.data)
1974
1974
  });
1975
1975
  o({
1976
1976
  type: "payment_method.added",
1977
1977
  paymentMethodId: n.id
1978
1978
  }), t(n.id);
1979
1979
  } catch (e) {
1980
- h(Cn(i, e));
1980
+ h(Tn(i, e));
1981
1981
  } finally {
1982
1982
  p(!1);
1983
1983
  }
@@ -1990,12 +1990,12 @@ function Tn({ psp: e, onSaved: t, submitLabel: n, defaultCountry: r }) {
1990
1990
  noValidate: !0,
1991
1991
  onSubmit: (e) => void g(e),
1992
1992
  children: [
1993
- /* @__PURE__ */ F(Bt, {
1993
+ /* @__PURE__ */ F(Vt, {
1994
1994
  idPrefix: `orck-save-${s}`,
1995
1995
  value: u,
1996
1996
  onChange: d,
1997
1997
  disabled: f,
1998
- children: /* @__PURE__ */ F(Kt, {
1998
+ children: /* @__PURE__ */ F(qt, {
1999
1999
  ids: c,
2000
2000
  card: l,
2001
2001
  disabled: f
@@ -2006,17 +2006,17 @@ function Tn({ psp: e, onSaved: t, submitLabel: n, defaultCountry: r }) {
2006
2006
  className: "text-sm text-destructive",
2007
2007
  children: m
2008
2008
  }) : null,
2009
- /* @__PURE__ */ F(Q, {
2009
+ /* @__PURE__ */ F($, {
2010
2010
  label: n ?? i.t("paymentMethods.save"),
2011
2011
  processing: f,
2012
- disabled: !l.valid || !Dt.safeParse(u).success
2012
+ disabled: !l.valid || !Ot.safeParse(u).success
2013
2013
  }),
2014
- /* @__PURE__ */ F(qt, {})
2014
+ /* @__PURE__ */ F(Jt, {})
2015
2015
  ]
2016
2016
  });
2017
2017
  }
2018
- function En({ psp: e, onSaved: t, submitLabel: n, defaultCountry: r }) {
2019
- let i = S(), { t: a } = i, { client: o, notify: s } = T(), c = N.useRef(null), [l, u] = N.useState(!1), [d, f] = N.useState(!1), [p, m] = N.useState(), h = N.useMemo(() => jt(r), [r]), g = async (e) => {
2018
+ function On({ psp: e, onSaved: t, submitLabel: n, defaultCountry: r }) {
2019
+ let i = y(), { t: a } = i, { client: o, notify: s } = j(), c = P.useRef(null), [l, u] = P.useState(!1), [d, f] = P.useState(!1), [p, m] = P.useState(), h = P.useMemo(() => Mt(r), [r]), g = async (e) => {
2020
2020
  if (e.preventDefault(), !(!c.current || d)) {
2021
2021
  f(!0), m(void 0);
2022
2022
  try {
@@ -2026,7 +2026,7 @@ function En({ psp: e, onSaved: t, submitLabel: n, defaultCountry: r }) {
2026
2026
  paymentMethodId: e
2027
2027
  }), t(e);
2028
2028
  } catch (e) {
2029
- m(Cn(i, e));
2029
+ m(Tn(i, e));
2030
2030
  } finally {
2031
2031
  f(!1);
2032
2032
  }
@@ -2036,7 +2036,7 @@ function En({ psp: e, onSaved: t, submitLabel: n, defaultCountry: r }) {
2036
2036
  className: "grid gap-4",
2037
2037
  onSubmit: (e) => void g(e),
2038
2038
  children: [
2039
- /* @__PURE__ */ F(un, {
2039
+ /* @__PURE__ */ F(dn, {
2040
2040
  ref: c,
2041
2041
  psp: e,
2042
2042
  client: o,
@@ -2050,22 +2050,22 @@ function En({ psp: e, onSaved: t, submitLabel: n, defaultCountry: r }) {
2050
2050
  className: "text-sm text-destructive",
2051
2051
  children: p
2052
2052
  }) : null,
2053
- /* @__PURE__ */ F(Q, {
2053
+ /* @__PURE__ */ F($, {
2054
2054
  label: n ?? a("paymentMethods.save"),
2055
2055
  processing: d,
2056
2056
  disabled: !l
2057
2057
  }),
2058
- /* @__PURE__ */ F(qt, {})
2058
+ /* @__PURE__ */ F(Jt, {})
2059
2059
  ]
2060
2060
  });
2061
2061
  }
2062
- function Dn({ psp: e, onSaved: t, submitLabel: r, defaultCountry: i }) {
2063
- let a = S(), { client: o, notify: s } = T(), [c, l] = N.useState();
2064
- return /* @__PURE__ */ I(P, { children: [c ? /* @__PURE__ */ F("p", {
2062
+ function kn({ psp: e, onSaved: t, submitLabel: r, defaultCountry: i }) {
2063
+ let a = y(), { client: o, notify: s } = j(), [c, l] = P.useState();
2064
+ return /* @__PURE__ */ I(ae, { children: [c ? /* @__PURE__ */ F("p", {
2065
2065
  role: "alert",
2066
2066
  className: "text-sm text-destructive",
2067
2067
  children: c
2068
- }) : null, /* @__PURE__ */ F(Jt, {
2068
+ }) : null, /* @__PURE__ */ F(Yt, {
2069
2069
  publicKey: e.config.public_api_key,
2070
2070
  purpose: "setup",
2071
2071
  defaultCountry: i,
@@ -2078,10 +2078,10 @@ function Dn({ psp: e, onSaved: t, submitLabel: r, defaultCountry: i }) {
2078
2078
  i = await o.addPaymentMethod({
2079
2079
  psp_id: e.psp_id,
2080
2080
  token: r.payment_token,
2081
- billing_details: Ot(r)
2081
+ billing_details: kt(r)
2082
2082
  });
2083
2083
  } catch (e) {
2084
- if (l(Cn(a, e)), n(e) && (e.status === 400 || e.status === 402)) return !1;
2084
+ if (l(Tn(a, e)), n(e) && (e.status === 400 || e.status === 402)) return !1;
2085
2085
  throw e;
2086
2086
  }
2087
2087
  return s({
@@ -2093,9 +2093,9 @@ function Dn({ psp: e, onSaved: t, submitLabel: r, defaultCountry: i }) {
2093
2093
  }
2094
2094
  //#endregion
2095
2095
  //#region src/account/notice.tsx
2096
- function On() {
2097
- let [e, t] = N.useState(null);
2098
- return N.useEffect(() => {
2096
+ function An() {
2097
+ let [e, t] = P.useState(null);
2098
+ return P.useEffect(() => {
2099
2099
  if (!e) return;
2100
2100
  let n = setTimeout(() => t(null), 6e3);
2101
2101
  return () => clearTimeout(n);
@@ -2108,29 +2108,29 @@ function On() {
2108
2108
  }
2109
2109
  //#endregion
2110
2110
  //#region src/account/payment-methods-panel.tsx
2111
- function kn(e, t) {
2111
+ function jn(e, t) {
2112
2112
  return we(e.card, t);
2113
2113
  }
2114
- function An(e, t) {
2114
+ function Mn(e, t) {
2115
2115
  return e.status === 409 && e.code === "resource_conflict" ? t.t("paymentMethods.inUse") : t.error(e);
2116
2116
  }
2117
- function jn({ defaultCurrency: e, defaultCountry: t, appearance: n, className: r }) {
2118
- let a = S(), { t: o } = a, s = x(n), c = te(), [l, u] = N.useState(null), [d, f] = N.useState(null), [p, h] = N.useState(null), [g, v] = N.useState(!1), y = ee(), b = i(y.config?.payment.psps ?? []), C = b.filter(m), w = C.length > 0 ? null : _(b), { refetch: T } = y;
2119
- N.useEffect(() => {
2117
+ function Nn({ defaultCurrency: e, defaultCountry: t, appearance: n, className: r }) {
2118
+ let a = y(), { t: o } = a, s = k(n), c = D(), [l, u] = P.useState(null), [d, f] = P.useState(null), [p, h] = P.useState(null), [g, v] = P.useState(!1), b = S(), x = i(b.config?.payment.psps ?? []), C = x.filter(m), w = C.length > 0 ? null : _(x), { refetch: T } = b;
2119
+ P.useEffect(() => {
2120
2120
  if (w === null) return;
2121
2121
  let e = setTimeout(T, w * 1e3);
2122
2122
  return () => clearTimeout(e);
2123
2123
  }, [
2124
2124
  w,
2125
2125
  T,
2126
- y.config
2126
+ b.config
2127
2127
  ]);
2128
- let [E, D] = N.useState(), O = C.find((e) => e.psp_id === E) ?? C[0], [k, A] = On(), j = e?.toUpperCase(), ne = async () => {
2128
+ let [E, O] = P.useState(), ee = C.find((e) => e.psp_id === E) ?? C[0], [te, A] = An(), j = e?.toUpperCase(), ne = async () => {
2129
2129
  if (!l) return;
2130
2130
  f(null);
2131
2131
  let e = await c.remove(l.id);
2132
2132
  if (e) {
2133
- f(An(e, a));
2133
+ f(Mn(e, a));
2134
2134
  return;
2135
2135
  }
2136
2136
  u(null), A(o("paymentMethods.removed"));
@@ -2143,22 +2143,22 @@ function jn({ defaultCurrency: e, defaultCountry: t, appearance: n, className: r
2143
2143
  message: a.error(t)
2144
2144
  }) : A(o("paymentMethods.defaultUpdated"));
2145
2145
  }, ie, M = c.methods;
2146
- ie = M === null && c.error ? /* @__PURE__ */ F(ze, {
2146
+ ie = M === null && c.error ? /* @__PURE__ */ F(Be, {
2147
2147
  error: c.error,
2148
2148
  onRetry: c.refetch
2149
- }) : M === null ? /* @__PURE__ */ F(Le, {}) : M.length === 0 ? /* @__PURE__ */ F(Re, {
2149
+ }) : M === null ? /* @__PURE__ */ F(Re, {}) : M.length === 0 ? /* @__PURE__ */ F(ze, {
2150
2150
  title: o("paymentMethods.empty"),
2151
2151
  description: o("paymentMethods.emptyDescription")
2152
2152
  }) : /* @__PURE__ */ F("ul", {
2153
2153
  className: "-my-1 divide-y divide-border",
2154
2154
  children: M.map((e) => {
2155
- let t = kn(e, a), n = (e.subscriptions ?? []).map((e) => e.display_name).filter(Boolean), r = e.health?.expiry_status, i = e.default_currencies ?? [], s = c.pending[e.id], l = [n.length > 0 && o("paymentMethods.usedBy", { names: n.join(", ") })].filter(Boolean);
2155
+ let t = jn(e, a), n = (e.subscriptions ?? []).map((e) => e.display_name).filter(Boolean), r = e.health?.expiry_status, i = e.default_currencies ?? [], s = c.pending[e.id], l = [n.length > 0 && o("paymentMethods.usedBy", { names: n.join(", ") })].filter(Boolean);
2156
2156
  return /* @__PURE__ */ I("li", {
2157
2157
  "data-testid": "payment-method-row",
2158
2158
  "data-payment-method-id": e.id,
2159
2159
  className: "flex flex-wrap items-center gap-x-3 gap-y-2 py-3.5",
2160
2160
  children: [
2161
- /* @__PURE__ */ F(Ze, {
2161
+ /* @__PURE__ */ F(Qe, {
2162
2162
  brand: e.card?.brand ?? void 0,
2163
2163
  fallback: (e.card?.brand ?? "card").slice(0, 4)
2164
2164
  }),
@@ -2172,8 +2172,8 @@ function jn({ defaultCurrency: e, defaultCountry: t, appearance: n, className: r
2172
2172
  className: "text-sm font-medium tabular-nums",
2173
2173
  children: t
2174
2174
  }),
2175
- r === "expired" || r === "expiring_soon" ? /* @__PURE__ */ F(Ue, { status: r }) : e.health?.active === !1 ? /* @__PURE__ */ F(Ue, { status: "needs_attention" }) : null,
2176
- i.length > 0 ? /* @__PURE__ */ F(Ue, {
2175
+ r === "expired" || r === "expiring_soon" ? /* @__PURE__ */ F(We, { status: r }) : e.health?.active === !1 ? /* @__PURE__ */ F(We, { status: "needs_attention" }) : null,
2176
+ i.length > 0 ? /* @__PURE__ */ F(We, {
2177
2177
  status: "default",
2178
2178
  label: o("paymentMethods.defaultFor", { currencies: i.join(", ") })
2179
2179
  }) : null
@@ -2192,14 +2192,14 @@ function jn({ defaultCurrency: e, defaultCountry: t, appearance: n, className: r
2192
2192
  }),
2193
2193
  /* @__PURE__ */ I("div", {
2194
2194
  className: "ml-auto flex items-center gap-1",
2195
- children: [j && !i.includes(j) ? /* @__PURE__ */ I(H, {
2195
+ children: [j && !i.includes(j) ? /* @__PURE__ */ I(U, {
2196
2196
  variant: "ghost",
2197
2197
  size: "sm",
2198
2198
  className: "text-muted-foreground",
2199
2199
  disabled: !!s,
2200
2200
  onClick: () => void re(e),
2201
- children: [s === "default" ? /* @__PURE__ */ F(X, {}) : null, o("paymentMethods.makeDefault")]
2202
- }) : null, /* @__PURE__ */ F(H, {
2201
+ children: [s === "default" ? /* @__PURE__ */ F(Z, {}) : null, o("paymentMethods.makeDefault")]
2202
+ }) : null, /* @__PURE__ */ F(U, {
2203
2203
  variant: "ghost",
2204
2204
  size: "icon-sm",
2205
2205
  className: "text-muted-foreground hover:text-destructive",
@@ -2209,8 +2209,8 @@ function jn({ defaultCurrency: e, defaultCountry: t, appearance: n, className: r
2209
2209
  onClick: () => {
2210
2210
  f(null), u(e);
2211
2211
  },
2212
- children: s === "remove" ? /* @__PURE__ */ F(X, {}) : /* @__PURE__ */ F(se, {
2213
- icon: de,
2212
+ children: s === "remove" ? /* @__PURE__ */ F(Z, {}) : /* @__PURE__ */ F(ce, {
2213
+ icon: fe,
2214
2214
  "aria-hidden": !0
2215
2215
  })
2216
2216
  })]
@@ -2219,19 +2219,19 @@ function jn({ defaultCurrency: e, defaultCountry: t, appearance: n, className: r
2219
2219
  }, e.id);
2220
2220
  })
2221
2221
  });
2222
- let P = l ? c.pending[l.id] === "remove" : !1, L = l ? kn(l, a) : "";
2223
- return /* @__PURE__ */ I(Y, {
2222
+ let N = l ? c.pending[l.id] === "remove" : !1, ae = l ? jn(l, a) : "";
2223
+ return /* @__PURE__ */ I(Le, {
2224
2224
  title: o("paymentMethods.title"),
2225
2225
  description: o("paymentMethods.description"),
2226
2226
  appearance: n,
2227
2227
  className: r,
2228
2228
  "data-testid": "payment-methods-panel",
2229
- action: O ? /* @__PURE__ */ I(H, {
2229
+ action: ee ? /* @__PURE__ */ I(U, {
2230
2230
  variant: "outline",
2231
2231
  size: "sm",
2232
2232
  onClick: () => v(!0),
2233
- children: [/* @__PURE__ */ F(se, {
2234
- icon: ce,
2233
+ children: [/* @__PURE__ */ F(ce, {
2234
+ icon: le,
2235
2235
  "aria-hidden": !0,
2236
2236
  "data-icon": "inline-start"
2237
2237
  }), o("paymentMethods.add")]
@@ -2240,81 +2240,81 @@ function jn({ defaultCurrency: e, defaultCountry: t, appearance: n, className: r
2240
2240
  ie,
2241
2241
  M !== null && c.error ? /* @__PURE__ */ F("div", {
2242
2242
  className: "pt-3",
2243
- children: /* @__PURE__ */ F(ze, {
2243
+ children: /* @__PURE__ */ F(Be, {
2244
2244
  error: c.error,
2245
2245
  onRetry: c.refetch
2246
2246
  })
2247
2247
  }) : null,
2248
- y.error ? /* @__PURE__ */ F("div", {
2248
+ b.error ? /* @__PURE__ */ F("div", {
2249
2249
  className: "pt-3",
2250
- children: /* @__PURE__ */ F(ze, {
2251
- error: y.error,
2250
+ children: /* @__PURE__ */ F(Be, {
2251
+ error: b.error,
2252
2252
  message: o("paymentMethods.addUnavailable"),
2253
- onRetry: y.refetch
2253
+ onRetry: b.refetch
2254
2254
  })
2255
2255
  }) : w === null ? null : /* @__PURE__ */ F("p", {
2256
2256
  role: "status",
2257
2257
  className: "pt-3 text-sm text-muted-foreground",
2258
2258
  children: o("paymentMethods.addUnavailable")
2259
2259
  }),
2260
- k,
2261
- /* @__PURE__ */ F(et, {
2260
+ te,
2261
+ /* @__PURE__ */ F(tt, {
2262
2262
  open: l !== null,
2263
2263
  onOpenChange: (e) => {
2264
- !e && !P && u(null);
2264
+ !e && !N && u(null);
2265
2265
  },
2266
- children: /* @__PURE__ */ I(rt, {
2267
- className: `${s.className} ${K} bg-popover text-popover-foreground`,
2266
+ children: /* @__PURE__ */ I(it, {
2267
+ className: `${s.className} ${q} bg-popover text-popover-foreground`,
2268
2268
  "data-orck-theme": s["data-orck-theme"],
2269
2269
  style: s.style,
2270
2270
  children: [
2271
- /* @__PURE__ */ I(it, { children: [/* @__PURE__ */ F(ot, { children: o("paymentMethods.removeTitle", { label: L }) }), /* @__PURE__ */ F(st, { children: o("paymentMethods.removeDescription") })] }),
2271
+ /* @__PURE__ */ I(at, { children: [/* @__PURE__ */ F(st, { children: o("paymentMethods.removeTitle", { label: ae }) }), /* @__PURE__ */ F(ct, { children: o("paymentMethods.removeDescription") })] }),
2272
2272
  d ? /* @__PURE__ */ F("p", {
2273
2273
  role: "alert",
2274
2274
  className: "text-sm text-destructive",
2275
2275
  children: d
2276
2276
  }) : null,
2277
- /* @__PURE__ */ I(at, { children: [/* @__PURE__ */ F(ct, {
2278
- disabled: P,
2277
+ /* @__PURE__ */ I(ot, { children: [/* @__PURE__ */ F(lt, {
2278
+ disabled: N,
2279
2279
  children: o("common.cancel")
2280
- }), /* @__PURE__ */ I(H, {
2280
+ }), /* @__PURE__ */ I(U, {
2281
2281
  variant: "destructive",
2282
- disabled: P,
2282
+ disabled: N,
2283
2283
  onClick: () => void ne(),
2284
- children: [P ? /* @__PURE__ */ F(X, {}) : null, o("paymentMethods.removeConfirm")]
2284
+ children: [N ? /* @__PURE__ */ F(Z, {}) : null, o("paymentMethods.removeConfirm")]
2285
2285
  })] })
2286
2286
  ]
2287
2287
  })
2288
2288
  }),
2289
- O ? /* @__PURE__ */ F(lt, {
2289
+ ee ? /* @__PURE__ */ F(ut, {
2290
2290
  open: g,
2291
2291
  onOpenChange: v,
2292
- children: /* @__PURE__ */ I(ft, {
2293
- className: `${s.className} ${K} max-h-[calc(100dvh-2rem)] overflow-y-auto bg-popover text-popover-foreground`,
2292
+ children: /* @__PURE__ */ I(pt, {
2293
+ className: `${s.className} ${q} max-h-[calc(100dvh-2rem)] overflow-y-auto bg-popover text-popover-foreground`,
2294
2294
  "data-orck-theme": s["data-orck-theme"],
2295
2295
  style: s.style,
2296
2296
  children: [
2297
- /* @__PURE__ */ I(pt, { children: [/* @__PURE__ */ F(ht, { children: o("paymentMethods.addTitle") }), /* @__PURE__ */ F(gt, { children: o("paymentMethods.addDescription") })] }),
2297
+ /* @__PURE__ */ I(mt, { children: [/* @__PURE__ */ F(gt, { children: o("paymentMethods.addTitle") }), /* @__PURE__ */ F(_t, { children: o("paymentMethods.addDescription") })] }),
2298
2298
  C.length > 1 ? /* @__PURE__ */ I("label", {
2299
2299
  className: "grid gap-1.5 text-sm",
2300
2300
  children: [o("paymentMethods.provider"), /* @__PURE__ */ F("select", {
2301
2301
  className: "h-9 rounded-md border border-input bg-transparent px-2",
2302
- value: O.psp_id,
2303
- onChange: (e) => D(e.target.value),
2302
+ value: ee.psp_id,
2303
+ onChange: (e) => O(e.target.value),
2304
2304
  children: C.map((e) => /* @__PURE__ */ F("option", {
2305
2305
  value: e.psp_id,
2306
2306
  children: e.display_name
2307
2307
  }, e.psp_id))
2308
2308
  })]
2309
2309
  }) : null,
2310
- /* @__PURE__ */ F(Sn, {
2311
- psp: O,
2310
+ /* @__PURE__ */ F(wn, {
2311
+ psp: ee,
2312
2312
  defaultCountry: t,
2313
2313
  appearance: n,
2314
2314
  onSaved: () => {
2315
2315
  v(!1), A(o("paymentMethods.added"));
2316
2316
  }
2317
- }, O.psp_id)
2317
+ }, ee.psp_id)
2318
2318
  ]
2319
2319
  })
2320
2320
  }) : null
@@ -2323,7 +2323,7 @@ function jn({ defaultCurrency: e, defaultCountry: t, appearance: n, className: r
2323
2323
  }
2324
2324
  //#endregion
2325
2325
  //#region src/components/ui/textarea.tsx
2326
- function Mn({ className: e, ...t }) {
2326
+ function Pn({ className: e, ...t }) {
2327
2327
  return /* @__PURE__ */ F("textarea", {
2328
2328
  "data-slot": "textarea",
2329
2329
  className: L("flex field-sizing-content min-h-16 w-full rounded-md border border-input bg-transparent px-2.5 py-2 text-base shadow-xs transition-[color,box-shadow] outline-none placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40", e),
@@ -2332,57 +2332,57 @@ function Mn({ className: e, ...t }) {
2332
2332
  }
2333
2333
  //#endregion
2334
2334
  //#region src/account/cancel-dialog.tsx
2335
- function Nn({ open: e, onOpenChange: t, name: n, onChain: r = !1, pending: i, onConfirm: a, appearance: o }) {
2336
- let s = S(), { t: c } = s, l = x(o), u = N.useId(), d = N.useId(), [f, m] = N.useState(""), [h, g] = N.useState(!1), [_, v] = N.useState(!1), [y, b] = N.useState(null), C = i !== void 0, w = f.trim().length, T = w < 4, E = async () => {
2337
- if (v(!0), T || C) return;
2338
- b(null);
2335
+ function Fn({ open: e, onOpenChange: t, name: n, onChain: r = !1, pending: i, onConfirm: a, appearance: o }) {
2336
+ let s = y(), { t: c } = s, l = k(o), u = P.useId(), d = P.useId(), [f, m] = P.useState(""), [h, g] = P.useState(!1), [_, v] = P.useState(!1), [b, x] = P.useState(null), S = i !== void 0, C = f.trim().length, w = C < 4, T = async () => {
2337
+ if (v(!0), w || S) return;
2338
+ x(null);
2339
2339
  let e = await a(f, h);
2340
- e ? p(e) || b(e) : t(!1);
2341
- }, D = c(i === "cancel" && h ? "cancel.preparing" : i === "signing" ? "cancel.signing" : i === "confirming" ? "cancel.confirming" : C ? "cancel.working" : h ? "cancel.confirmWallet" : "cancel.confirm");
2342
- return /* @__PURE__ */ F(et, {
2340
+ e ? p(e) || x(e) : t(!1);
2341
+ }, E = c(i === "cancel" && h ? "cancel.preparing" : i === "signing" ? "cancel.signing" : i === "confirming" ? "cancel.confirming" : S ? "cancel.working" : h ? "cancel.confirmWallet" : "cancel.confirm");
2342
+ return /* @__PURE__ */ F(tt, {
2343
2343
  open: e,
2344
2344
  onOpenChange: (e) => {
2345
- !e && C || t(e);
2345
+ !e && S || t(e);
2346
2346
  },
2347
- children: /* @__PURE__ */ F(rt, {
2348
- className: `${l.className} ${K} bg-popover text-popover-foreground`,
2347
+ children: /* @__PURE__ */ F(it, {
2348
+ className: `${l.className} ${q} bg-popover text-popover-foreground`,
2349
2349
  "data-orck-theme": l["data-orck-theme"],
2350
2350
  style: l.style,
2351
2351
  children: /* @__PURE__ */ I("form", {
2352
2352
  className: "grid gap-5",
2353
2353
  noValidate: !0,
2354
2354
  onSubmit: (e) => {
2355
- e.preventDefault(), E();
2355
+ e.preventDefault(), T();
2356
2356
  },
2357
2357
  children: [
2358
- /* @__PURE__ */ I(it, { children: [/* @__PURE__ */ F(ot, { children: c("cancel.title", { name: n }) }), /* @__PURE__ */ F(st, { children: c("cancel.description") })] }),
2358
+ /* @__PURE__ */ I(at, { children: [/* @__PURE__ */ F(st, { children: c("cancel.title", { name: n }) }), /* @__PURE__ */ F(ct, { children: c("cancel.description") })] }),
2359
2359
  /* @__PURE__ */ I("div", {
2360
2360
  className: "grid gap-2",
2361
2361
  children: [
2362
- /* @__PURE__ */ F(Z, {
2362
+ /* @__PURE__ */ F(Q, {
2363
2363
  htmlFor: u,
2364
2364
  children: c("cancel.reasonLabel")
2365
2365
  }),
2366
- /* @__PURE__ */ F(Mn, {
2366
+ /* @__PURE__ */ F(Pn, {
2367
2367
  id: u,
2368
2368
  value: f,
2369
2369
  maxLength: 500,
2370
2370
  placeholder: c("cancel.reasonPlaceholder"),
2371
2371
  "aria-describedby": d,
2372
- "aria-invalid": _ && T ? !0 : void 0,
2373
- disabled: C,
2372
+ "aria-invalid": _ && w ? !0 : void 0,
2373
+ disabled: S,
2374
2374
  required: !0,
2375
2375
  rows: 3,
2376
2376
  className: "[font:inherit]",
2377
2377
  onChange: (e) => m(e.target.value),
2378
- onBlur: () => w > 0 && v(!0)
2378
+ onBlur: () => C > 0 && v(!0)
2379
2379
  }),
2380
2380
  /* @__PURE__ */ I("div", {
2381
2381
  id: d,
2382
2382
  className: "flex justify-between gap-3 text-xs text-muted-foreground",
2383
2383
  children: [/* @__PURE__ */ F("span", {
2384
- className: _ && T ? "text-destructive" : "",
2385
- children: _ && T ? c("cancel.reasonTooShort", { min: 4 }) : ""
2384
+ className: _ && w ? "text-destructive" : "",
2385
+ children: _ && w ? c("cancel.reasonTooShort", { min: 4 }) : ""
2386
2386
  }), /* @__PURE__ */ F("span", {
2387
2387
  className: "tabular-nums",
2388
2388
  children: c("cancel.reasonHint", {
@@ -2398,23 +2398,23 @@ function Nn({ open: e, onOpenChange: t, name: n, onChain: r = !1, pending: i, on
2398
2398
  children: [/* @__PURE__ */ F("input", {
2399
2399
  type: "checkbox",
2400
2400
  checked: h,
2401
- disabled: C,
2401
+ disabled: S,
2402
2402
  onChange: (e) => g(e.target.checked)
2403
2403
  }), /* @__PURE__ */ F("span", { children: c("cancel.revokeOnChain") })]
2404
2404
  }) : null,
2405
- y ? /* @__PURE__ */ F("p", {
2405
+ b ? /* @__PURE__ */ F("p", {
2406
2406
  role: "alert",
2407
2407
  className: "text-sm text-destructive",
2408
- children: s.error(y)
2408
+ children: s.error(b)
2409
2409
  }) : null,
2410
- /* @__PURE__ */ I(at, { children: [/* @__PURE__ */ F(ct, {
2411
- disabled: C,
2410
+ /* @__PURE__ */ I(ot, { children: [/* @__PURE__ */ F(lt, {
2411
+ disabled: S,
2412
2412
  children: c("cancel.keep")
2413
- }), /* @__PURE__ */ I(H, {
2413
+ }), /* @__PURE__ */ I(U, {
2414
2414
  type: "submit",
2415
2415
  variant: "destructive",
2416
- disabled: C,
2417
- children: [C ? /* @__PURE__ */ F(X, {}) : null, D]
2416
+ disabled: S,
2417
+ children: [S ? /* @__PURE__ */ F(Z, {}) : null, E]
2418
2418
  })] })
2419
2419
  ]
2420
2420
  })
@@ -2423,19 +2423,19 @@ function Nn({ open: e, onOpenChange: t, name: n, onChain: r = !1, pending: i, on
2423
2423
  }
2424
2424
  //#endregion
2425
2425
  //#region src/components/ui/radio-group.tsx
2426
- function Pn({ className: e, ...t }) {
2427
- return /* @__PURE__ */ F(he, {
2426
+ function In({ className: e, ...t }) {
2427
+ return /* @__PURE__ */ F(ge, {
2428
2428
  "data-slot": "radio-group",
2429
2429
  className: L("grid w-full gap-3", e),
2430
2430
  ...t
2431
2431
  });
2432
2432
  }
2433
- function Fn({ className: e, ...t }) {
2434
- return /* @__PURE__ */ F(me.Root, {
2433
+ function Ln({ className: e, ...t }) {
2434
+ return /* @__PURE__ */ F(he.Root, {
2435
2435
  "data-slot": "radio-group-item",
2436
2436
  className: L("group/radio-group-item peer relative flex aspect-square size-4 shrink-0 rounded-full border border-input outline-none group-has-[:focus-visible]/field-label:ring-0 group-has-[:focus-visible]/field-label:not-data-checked:border-input after:absolute after:-inset-x-3 after:-inset-y-2 focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 aria-invalid:aria-checked:border-primary dark:bg-input/30 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 data-checked:border-primary data-checked:bg-primary data-checked:text-primary-foreground group-has-[:focus-visible]/field-label:data-checked:border-primary dark:data-checked:bg-primary", e),
2437
2437
  ...t,
2438
- children: /* @__PURE__ */ F(me.Indicator, {
2438
+ children: /* @__PURE__ */ F(he.Indicator, {
2439
2439
  "data-slot": "radio-group-indicator",
2440
2440
  className: "flex size-4 items-center justify-center",
2441
2441
  children: /* @__PURE__ */ F("span", { className: "absolute top-1/2 left-1/2 size-2 -translate-x-1/2 -translate-y-1/2 rounded-full bg-primary-foreground" })
@@ -2444,23 +2444,23 @@ function Fn({ className: e, ...t }) {
2444
2444
  }
2445
2445
  //#endregion
2446
2446
  //#region src/account/change-card-dialog.tsx
2447
- var In = "default";
2448
- function Ln(e, t) {
2447
+ var Rn = "default";
2448
+ function zn(e, t) {
2449
2449
  return t.filter((t) => t.health?.expiry_status !== "expired" && (!e.psp_id || !t.psp_id || t.psp_id === e.psp_id) && (!e.rail || !t.rail || t.rail === e.rail));
2450
2450
  }
2451
- function Rn({ subscription: e, name: t, onOpenChange: n, pending: r, onConfirm: i, appearance: a }) {
2452
- let o = x(a);
2453
- return /* @__PURE__ */ F(lt, {
2451
+ function Bn({ subscription: e, name: t, onOpenChange: n, pending: r, onConfirm: i, appearance: a }) {
2452
+ let o = k(a);
2453
+ return /* @__PURE__ */ F(ut, {
2454
2454
  open: e !== null,
2455
2455
  onOpenChange: (e) => {
2456
2456
  !e && r || n(e);
2457
2457
  },
2458
- children: /* @__PURE__ */ F(ft, {
2458
+ children: /* @__PURE__ */ F(pt, {
2459
2459
  showCloseButton: !1,
2460
- className: `${o.className} ${K} bg-popover text-popover-foreground`,
2460
+ className: `${o.className} ${q} bg-popover text-popover-foreground`,
2461
2461
  "data-orck-theme": o["data-orck-theme"],
2462
2462
  style: o.style,
2463
- children: e ? /* @__PURE__ */ F(zn, {
2463
+ children: e ? /* @__PURE__ */ F(Vn, {
2464
2464
  subscription: e,
2465
2465
  name: t,
2466
2466
  pending: r,
@@ -2470,23 +2470,23 @@ function Rn({ subscription: e, name: t, onOpenChange: n, pending: r, onConfirm:
2470
2470
  })
2471
2471
  });
2472
2472
  }
2473
- function zn({ subscription: e, name: t, pending: n, onCancel: r, onConfirm: i }) {
2474
- let a = S(), { t: o } = a, s = N.useId(), c = te(), l = e.payment_method_id ?? In, [u, d] = N.useState(l), [f, p] = N.useState(null), m = c.methods ? Ln(e, c.methods) : null, h = e.price?.currency?.toUpperCase(), g = h ? m?.find((e) => (e.default_currencies ?? []).includes(h)) : void 0, _ = [...g ? [{
2475
- id: In,
2473
+ function Vn({ subscription: e, name: t, pending: n, onCancel: r, onConfirm: i }) {
2474
+ let a = y(), { t: o } = a, s = P.useId(), c = D(), l = e.payment_method_id ?? Rn, [u, d] = P.useState(l), [f, p] = P.useState(null), m = c.methods ? zn(e, c.methods) : null, h = e.price?.currency?.toUpperCase(), g = h ? m?.find((e) => (e.default_currencies ?? []).includes(h)) : void 0, _ = [...g ? [{
2475
+ id: Rn,
2476
2476
  card: g
2477
2477
  }] : [], ...(m ?? []).map((e) => ({
2478
2478
  id: e.id,
2479
2479
  card: e
2480
- }))], v = _.some((e) => e.id !== l), y = async () => {
2480
+ }))], v = _.some((e) => e.id !== l), b = async () => {
2481
2481
  if (!u || u === l || n) return;
2482
2482
  p(null);
2483
- let e = await i(u === In ? null : u);
2483
+ let e = await i(u === Rn ? null : u);
2484
2484
  e && p(e);
2485
- }, b;
2486
- return b = m === null && c.error ? /* @__PURE__ */ F(ze, {
2485
+ }, x;
2486
+ return x = m === null && c.error ? /* @__PURE__ */ F(Be, {
2487
2487
  error: c.error,
2488
2488
  onRetry: c.refetch
2489
- }) : m === null ? /* @__PURE__ */ F(Le, { rows: 2 }) : /* @__PURE__ */ F(Pn, {
2489
+ }) : m === null ? /* @__PURE__ */ F(Re, { rows: 2 }) : /* @__PURE__ */ F(In, {
2490
2490
  value: u,
2491
2491
  onValueChange: (e) => {
2492
2492
  typeof e == "string" && e && d(e);
@@ -2496,22 +2496,22 @@ function zn({ subscription: e, name: t, pending: n, onCancel: r, onConfirm: i })
2496
2496
  className: "grid gap-0",
2497
2497
  children: _.map(({ id: e, card: t }) => {
2498
2498
  let r = `${s}-${e}`, i = we(t.card, a);
2499
- return /* @__PURE__ */ I(Z, {
2499
+ return /* @__PURE__ */ I(Q, {
2500
2500
  htmlFor: r,
2501
2501
  "data-testid": "change-card-option",
2502
2502
  className: L("flex cursor-pointer items-center gap-3 py-1.5 select-none", n && "cursor-default"),
2503
2503
  children: [
2504
- /* @__PURE__ */ F(Fn, {
2504
+ /* @__PURE__ */ F(Ln, {
2505
2505
  id: r,
2506
2506
  value: e
2507
2507
  }),
2508
- /* @__PURE__ */ F(Ze, {
2508
+ /* @__PURE__ */ F(Qe, {
2509
2509
  brand: t.card?.brand ?? void 0,
2510
2510
  fallback: (t.card?.brand ?? "card").slice(0, 4)
2511
2511
  }),
2512
2512
  /* @__PURE__ */ F("span", {
2513
2513
  className: "min-w-0 flex-1 truncate text-sm font-medium tabular-nums",
2514
- children: e === In ? o("changeCard.useDefault", { card: i }) : i
2514
+ children: e === Rn ? o("changeCard.useDefault", { card: i }) : i
2515
2515
  }),
2516
2516
  e === l ? /* @__PURE__ */ F("span", {
2517
2517
  className: "shrink-0 text-xs text-muted-foreground",
@@ -2524,81 +2524,263 @@ function zn({ subscription: e, name: t, pending: n, onCancel: r, onConfirm: i })
2524
2524
  className: "grid gap-5",
2525
2525
  noValidate: !0,
2526
2526
  onSubmit: (e) => {
2527
- e.preventDefault(), y();
2527
+ e.preventDefault(), b();
2528
2528
  },
2529
2529
  children: [
2530
- /* @__PURE__ */ I(pt, { children: [/* @__PURE__ */ F(ht, { children: o("changeCard.title", { name: t }) }), /* @__PURE__ */ F(gt, { children: o(m !== null && !v ? "changeCard.none" : "changeCard.description") })] }),
2531
- b,
2530
+ /* @__PURE__ */ I(mt, { children: [/* @__PURE__ */ F(gt, { children: o("changeCard.title", { name: t }) }), /* @__PURE__ */ F(_t, { children: o(m !== null && !v ? "changeCard.none" : "changeCard.description") })] }),
2531
+ x,
2532
2532
  f ? /* @__PURE__ */ F("p", {
2533
2533
  role: "alert",
2534
2534
  className: "text-sm text-destructive",
2535
2535
  children: a.error(f)
2536
2536
  }) : null,
2537
- /* @__PURE__ */ I(mt, { children: [/* @__PURE__ */ F(H, {
2537
+ /* @__PURE__ */ I(ht, { children: [/* @__PURE__ */ F(U, {
2538
2538
  type: "button",
2539
2539
  variant: "outline",
2540
2540
  disabled: n,
2541
2541
  onClick: r,
2542
2542
  children: o("common.cancel")
2543
- }), /* @__PURE__ */ I(H, {
2543
+ }), /* @__PURE__ */ I(U, {
2544
2544
  type: "submit",
2545
2545
  disabled: n || !u || u === l,
2546
- children: [n ? /* @__PURE__ */ F(X, {}) : null, o("changeCard.confirm")]
2546
+ children: [n ? /* @__PURE__ */ F(Z, {}) : null, o("changeCard.confirm")]
2547
+ })] })
2548
+ ]
2549
+ });
2550
+ }
2551
+ //#endregion
2552
+ //#region src/authenticate.ts
2553
+ async function Hn(e, t, n, r) {
2554
+ let i = n.next_action, o = i?.payload?.client_secret;
2555
+ if (n.status !== "requires_action" || i?.type !== "authenticate" || !o || !a(r)) return n;
2556
+ let s = await (await Zt(r.config.publishable_key)).handleNextAction({ clientSecret: o });
2557
+ if (s.error) throw Error(s.error.message ?? "Authentication failed.");
2558
+ return e.confirmSubscriptionChange(t);
2559
+ }
2560
+ //#endregion
2561
+ //#region src/account/change-plan.tsx
2562
+ var Un = /* @__PURE__ */ new Map(), Wn = (e, t) => JSON.stringify([e, t]);
2563
+ function Gn(e, t) {
2564
+ let n = Wn(e, t), r = Un.get(n) ?? crypto.randomUUID();
2565
+ return Un.set(n, r), r;
2566
+ }
2567
+ var Kn = (e) => e.code === "subscription_change_in_flight" || e.status === 0 || e.status >= 500;
2568
+ function qn({ subscription: e, name: t, pending: r, changeSubscription: i, sendSolanaTransaction: a, onChanged: o, appearance: s }) {
2569
+ let c = y(), { t: l } = c, { locale: u } = E(), { client: d, notify: f } = j(), { config: p } = S(), m = A(e.id), [h, g] = P.useState(!1), [_, v] = P.useState(!1);
2570
+ if (!h && !m.options?.length) return null;
2571
+ let b = async (r) => {
2572
+ let s = e.id, m = r.price.id, h = await i(s, {
2573
+ priceId: m,
2574
+ idempotencyKey: Gn(s, m)
2575
+ }, a);
2576
+ if (n(h)) return Kn(h) || Un.delete(Wn(s, m)), c.error(h);
2577
+ let _ = h.next_action;
2578
+ if (_?.type === "redirect_to_url" && _.url) return window.location.assign(_.url), null;
2579
+ if (h.status === "requires_action" && _?.type === "authenticate") {
2580
+ let e = p?.payment.psps.find((e) => e.psp_id === _.psp_id);
2581
+ if (!e) return c.t("paymentMethods.unavailable");
2582
+ try {
2583
+ h = await Hn(d, s, h, e);
2584
+ } catch (e) {
2585
+ return n(e) ? c.error(e) : e instanceof Error && e.message || c.t("errors.generic");
2586
+ }
2587
+ f({
2588
+ type: "subscription.changed",
2589
+ subscriptionId: s,
2590
+ change: h
2591
+ });
2592
+ }
2593
+ if (h.status === "requires_action") return c.t("changePlan.actionRequired");
2594
+ if (h.status !== "processing" && Un.delete(Wn(s, m)), h.status === "blocked") return h.message || c.t("errors.generic");
2595
+ g(!1);
2596
+ let v = r.product.display_name || t, y = G(h.delayed_start ?? h.next_charge_date, u);
2597
+ return o(h.status === "processing" ? l("changePlan.processing") : h.effective === "period_end" && y ? l("changePlan.scheduled", {
2598
+ name: v,
2599
+ date: y
2600
+ }) : l("changePlan.done", { name: v })), null;
2601
+ };
2602
+ return /* @__PURE__ */ I(ae, { children: [/* @__PURE__ */ F(U, {
2603
+ variant: "ghost",
2604
+ size: "sm",
2605
+ disabled: !!r,
2606
+ "aria-label": l("subscriptions.changePlanLabel", { name: t }),
2607
+ onClick: () => {
2608
+ m.refetch(), g(!0);
2609
+ },
2610
+ children: l("subscriptions.changePlan")
2611
+ }), /* @__PURE__ */ F(Jn, {
2612
+ open: h,
2613
+ onOpenChange: g,
2614
+ name: t,
2615
+ options: m,
2616
+ busy: _ || !!r,
2617
+ stage: r,
2618
+ onConfirm: async (e) => {
2619
+ v(!0);
2620
+ try {
2621
+ return await b(e);
2622
+ } finally {
2623
+ v(!1);
2624
+ }
2625
+ },
2626
+ appearance: s
2627
+ })] });
2628
+ }
2629
+ function Jn({ open: e, onOpenChange: t, appearance: n, busy: r, ...i }) {
2630
+ let a = k(n);
2631
+ return /* @__PURE__ */ F(ut, {
2632
+ open: e,
2633
+ onOpenChange: (e) => {
2634
+ !e && r || t(e);
2635
+ },
2636
+ children: /* @__PURE__ */ F(pt, {
2637
+ showCloseButton: !1,
2638
+ className: `${a.className} ${q} bg-popover text-popover-foreground`,
2639
+ "data-orck-theme": a["data-orck-theme"],
2640
+ style: a.style,
2641
+ children: e ? /* @__PURE__ */ F(Yn, {
2642
+ ...i,
2643
+ busy: r,
2644
+ onCancel: () => t(!1)
2645
+ }) : null
2646
+ })
2647
+ });
2648
+ }
2649
+ function Yn({ name: e, options: t, busy: n, stage: r, onConfirm: i, onCancel: a }) {
2650
+ let o = y(), { t: s } = o, { locale: c } = E(), l = te(), u = P.useId(), [d, f] = P.useState(""), [p, m] = P.useState(null), h = t.options, g = h?.find((e) => e.price.id === d), _;
2651
+ return _ = h === null && t.error ? /* @__PURE__ */ F(Be, {
2652
+ error: t.error,
2653
+ onRetry: t.refetch
2654
+ }) : h === null ? /* @__PURE__ */ F(Re, { rows: 2 }) : /* @__PURE__ */ F(In, {
2655
+ value: d,
2656
+ onValueChange: (e) => {
2657
+ typeof e == "string" && e && f(e);
2658
+ },
2659
+ disabled: n,
2660
+ "aria-label": s("changePlan.title", { name: e }),
2661
+ className: "grid gap-0",
2662
+ children: h.map((e) => {
2663
+ let t = `${u}-${e.price.id}`, r = K(e.price.unit_amount, e.price.currency, l, c), i = be(e.price, o);
2664
+ return /* @__PURE__ */ I(Q, {
2665
+ htmlFor: t,
2666
+ "data-testid": "change-plan-option",
2667
+ className: L("flex cursor-pointer items-start gap-3 py-2 select-none", n && "cursor-default"),
2668
+ children: [/* @__PURE__ */ F(Ln, {
2669
+ id: t,
2670
+ value: e.price.id,
2671
+ className: "mt-0.5"
2672
+ }), /* @__PURE__ */ I("span", {
2673
+ className: "grid min-w-0 flex-1 gap-0.5",
2674
+ children: [/* @__PURE__ */ I("span", {
2675
+ className: "text-sm font-medium",
2676
+ children: [e.product.display_name, r ? /* @__PURE__ */ I("span", {
2677
+ className: "font-normal text-muted-foreground tabular-nums",
2678
+ children: [
2679
+ " · ",
2680
+ r,
2681
+ i ? ` ${i}` : null
2682
+ ]
2683
+ }) : null]
2684
+ }), /* @__PURE__ */ F("span", {
2685
+ className: "text-xs font-normal text-muted-foreground tabular-nums",
2686
+ children: Xn(e, o, l, c)
2687
+ })]
2688
+ })]
2689
+ }, e.price.id);
2690
+ })
2691
+ }), /* @__PURE__ */ I("form", {
2692
+ className: "grid gap-5",
2693
+ noValidate: !0,
2694
+ onSubmit: (e) => {
2695
+ e.preventDefault(), !(!g || n) && (m(null), i(g).then(m));
2696
+ },
2697
+ children: [
2698
+ /* @__PURE__ */ I(mt, { children: [/* @__PURE__ */ F(gt, { children: s("changePlan.title", { name: e }) }), /* @__PURE__ */ F(_t, { children: h?.length === 0 ? s("changePlan.none") : s("changePlan.description") })] }),
2699
+ _,
2700
+ p ? /* @__PURE__ */ F("p", {
2701
+ role: "alert",
2702
+ className: "text-sm text-destructive",
2703
+ children: p
2704
+ }) : null,
2705
+ /* @__PURE__ */ I(ht, { children: [/* @__PURE__ */ F(U, {
2706
+ type: "button",
2707
+ variant: "outline",
2708
+ disabled: n,
2709
+ onClick: a,
2710
+ children: s("common.cancel")
2711
+ }), /* @__PURE__ */ I(U, {
2712
+ type: "submit",
2713
+ disabled: n || !g,
2714
+ children: [n ? /* @__PURE__ */ F(Z, {}) : null, s(r === "signing" ? "changePlan.signing" : r === "confirming" ? "changePlan.confirming" : "changePlan.confirm")]
2547
2715
  })] })
2548
2716
  ]
2549
2717
  });
2550
2718
  }
2719
+ function Xn(e, t, n, r) {
2720
+ let i = e.preview, a = K(i.next_charge_amount, i.currency, n, r), o = G(i.next_charge_date, r);
2721
+ if (!a || !o) return i.message ?? "";
2722
+ if (i.effective !== "now") return t.t("changePlan.atPeriodEnd", {
2723
+ next: a,
2724
+ date: o
2725
+ });
2726
+ let s = K(i.amount_due_now, i.currency, n, r);
2727
+ return s ? t.t(i.is_estimate ? "changePlan.chargeNowEstimate" : "changePlan.chargeNow", {
2728
+ amount: s,
2729
+ next: a,
2730
+ date: o
2731
+ }) : i.message ?? "";
2732
+ }
2551
2733
  //#endregion
2552
2734
  //#region src/account/resume-dialog.tsx
2553
- function Bn({ open: e, onOpenChange: t, name: n, price: r, date: i, busy: a, onConfirm: o, appearance: s }) {
2554
- let c = S().t, l = x(s);
2555
- return /* @__PURE__ */ F(et, {
2735
+ function Zn({ open: e, onOpenChange: t, name: n, price: r, date: i, busy: a, onConfirm: o, appearance: s }) {
2736
+ let c = y().t, l = k(s);
2737
+ return /* @__PURE__ */ F(tt, {
2556
2738
  open: e,
2557
2739
  onOpenChange: (e) => {
2558
2740
  !e && a || t(e);
2559
2741
  },
2560
- children: /* @__PURE__ */ I(rt, {
2561
- className: `${l.className} ${K} bg-popover text-popover-foreground`,
2742
+ children: /* @__PURE__ */ I(it, {
2743
+ className: `${l.className} ${q} bg-popover text-popover-foreground`,
2562
2744
  "data-orck-theme": l["data-orck-theme"],
2563
2745
  style: l.style,
2564
- children: [/* @__PURE__ */ I(it, { children: [/* @__PURE__ */ F(ot, { children: c("resume.title", { name: n }) }), /* @__PURE__ */ F(st, { children: r && i ? c("resume.description", {
2746
+ children: [/* @__PURE__ */ I(at, { children: [/* @__PURE__ */ F(st, { children: c("resume.title", { name: n }) }), /* @__PURE__ */ F(ct, { children: r && i ? c("resume.description", {
2565
2747
  price: r,
2566
2748
  date: i
2567
- }) : c("resume.descriptionNoDate") })] }), /* @__PURE__ */ I(at, { children: [/* @__PURE__ */ F(ct, {
2749
+ }) : c("resume.descriptionNoDate") })] }), /* @__PURE__ */ I(ot, { children: [/* @__PURE__ */ F(lt, {
2568
2750
  disabled: a,
2569
2751
  children: c("resume.keepCanceled")
2570
- }), /* @__PURE__ */ I(H, {
2752
+ }), /* @__PURE__ */ I(U, {
2571
2753
  type: "button",
2572
2754
  disabled: a,
2573
2755
  onClick: o,
2574
- children: [a ? /* @__PURE__ */ F(X, {}) : null, c("resume.confirm")]
2756
+ children: [a ? /* @__PURE__ */ F(Z, {}) : null, c("resume.confirm")]
2575
2757
  })] })]
2576
2758
  })
2577
2759
  });
2578
2760
  }
2579
2761
  //#endregion
2580
2762
  //#region src/account/subscriptions-panel.tsx
2581
- function Vn({ sendSolanaTransaction: e, plansHref: t, renderSubscriptionFooter: n, appearance: r, className: i, ...a }) {
2582
- let o = S(), { t: s } = o, { locale: c, navigate: l } = k(), u = A(a), d = O(), [f, p] = N.useState(null), [m, h] = N.useState(null), [g, _] = N.useState(null), [v, y] = N.useState(null), [b, x] = On(), C = N.useMemo(() => {
2763
+ function Qn({ sendSolanaTransaction: e, plansHref: t, renderSubscriptionFooter: n, appearance: r, className: i, ...a }) {
2764
+ let o = y(), { t: s } = o, { locale: c, navigate: l } = E(), u = T(a), d = te(), [f, p] = P.useState(null), [m, h] = P.useState(null), [g, _] = P.useState(null), [v, b] = P.useState(null), [x, S] = An(), C = P.useMemo(() => {
2583
2765
  let e = u.subscriptions ?? [];
2584
2766
  return [...e.filter(Oe), ...e.filter((e) => !Oe(e))];
2585
2767
  }, [u.subscriptions]), w = async (e) => {
2586
- y(null);
2768
+ b(null);
2587
2769
  let t = await u.resume(e.id);
2588
- h(null), t ? y({
2770
+ h(null), t ? b({
2589
2771
  id: e.id,
2590
2772
  message: o.error(t)
2591
- }) : x(s("subscriptions.resumed"));
2592
- }, T = f?.rail === "solana", E;
2593
- return E = u.subscriptions === null && u.error ? /* @__PURE__ */ F(ze, {
2773
+ }) : S(s("subscriptions.resumed"));
2774
+ }, D = f?.rail === "solana", O;
2775
+ return O = u.subscriptions === null && u.error ? /* @__PURE__ */ F(Be, {
2594
2776
  error: u.error,
2595
2777
  onRetry: u.refetch
2596
- }) : u.subscriptions === null ? /* @__PURE__ */ F(Le, {}) : C.length === 0 ? /* @__PURE__ */ F(Re, {
2778
+ }) : u.subscriptions === null ? /* @__PURE__ */ F(Re, {}) : C.length === 0 ? /* @__PURE__ */ F(ze, {
2597
2779
  title: s("subscriptions.empty"),
2598
2780
  description: s("subscriptions.emptyDescription"),
2599
2781
  action: t ? /* @__PURE__ */ F("a", {
2600
2782
  href: t,
2601
- className: _e({
2783
+ className: H({
2602
2784
  variant: "outline",
2603
2785
  size: "sm"
2604
2786
  }),
@@ -2609,14 +2791,14 @@ function Vn({ sendSolanaTransaction: e, plansHref: t, renderSubscriptionFooter:
2609
2791
  }) : null
2610
2792
  }) : /* @__PURE__ */ F("ul", {
2611
2793
  className: "-my-1 divide-y divide-border",
2612
- children: C.map((e) => {
2613
- let t = Oe(e), r = u.pending[e.id], i = xe(e, o), a = e.price ? G(e.price.unit_amount, e.price.currency, d, c) : null, l = be(e.price, o), f = W(e.current_period_ends_at, c), m = W(e.access?.ends_at, c), g = W(e.ended_at ?? e.canceled_at ?? e.current_period_ends_at, c), b = ke(e), x = t && !b && !!e.price?.billing_interval_hours, S = t ? x && f ? s("subscriptions.renews", { date: f }) : m ? s("subscriptions.endsOn", { date: m }) : s("subscriptions.noMorePayments") : e.status === "canceled" ? s("subscriptions.noMorePayments") : g && s("subscriptions.endedOn", { date: g }), C = e.rail === "solana" ? s("subscriptions.wallet") : e.card?.last4 ? s("subscriptions.paidWith", {
2614
- brand: Ce(e.card.brand, s("paymentMethods.fallbackBrand")),
2615
- last4: e.card.last4
2616
- }) : null, w = t && !b ? e.cancel_portal_url : null, T = Ee.has(e.status) && !b && !w, E = (e.status === "active" || e.status === "past_due" || e.status === "awaiting_method" || e.status === "unverified") && !b && !w && e.rail !== "solana" && (e.collection_policy === "engine" || e.collection_policy === "nmi_schedule"), D = e.cancel_scheduled ? "cancel_scheduled" : e.status, O = n?.(e);
2794
+ children: C.map((t) => {
2795
+ let i = Oe(t), a = u.pending[t.id], l = xe(t, o), m = t.price ? K(t.price.unit_amount, t.price.currency, d, c) : null, g = be(t.price, o), y = G(t.current_period_ends_at, c), x = G(t.access?.ends_at, c), C = G(t.ended_at ?? t.canceled_at ?? t.current_period_ends_at, c), w = ke(t), T = i && !w && !!t.price?.billing_interval_hours, E = i ? T && y ? s("subscriptions.renews", { date: y }) : x ? s("subscriptions.endsOn", { date: x }) : s("subscriptions.noMorePayments") : t.status === "canceled" ? s("subscriptions.noMorePayments") : C && s("subscriptions.endedOn", { date: C }), D = t.rail === "solana" ? s("subscriptions.wallet") : t.card?.last4 ? s("subscriptions.paidWith", {
2796
+ brand: Ce(t.card.brand, s("paymentMethods.fallbackBrand")),
2797
+ last4: t.card.last4
2798
+ }) : null, O = i && !w ? t.cancel_portal_url : null, k = Ee.has(t.status) && !w && !O, ee = (t.status === "active" || t.status === "past_due" || t.status === "awaiting_method" || t.status === "unverified") && !w && !O && t.rail !== "solana" && (t.collection_policy === "engine" || t.collection_policy === "nmi_schedule"), te = t.cancel_scheduled ? "cancel_scheduled" : t.status, A = n?.(t);
2617
2799
  return /* @__PURE__ */ I("li", {
2618
2800
  "data-testid": "subscription-row",
2619
- "data-subscription-id": e.id,
2801
+ "data-subscription-id": t.id,
2620
2802
  className: "grid gap-3 py-4 @md:grid-cols-[1fr_auto] @md:items-center",
2621
2803
  children: [
2622
2804
  /* @__PURE__ */ I("div", {
@@ -2625,29 +2807,29 @@ function Vn({ sendSolanaTransaction: e, plansHref: t, renderSubscriptionFooter:
2625
2807
  /* @__PURE__ */ I("div", {
2626
2808
  className: "flex flex-wrap items-center gap-x-2 gap-y-1",
2627
2809
  children: [/* @__PURE__ */ F("span", {
2628
- className: L("truncate text-sm font-semibold", !t && "text-muted-foreground"),
2629
- children: i
2630
- }), /* @__PURE__ */ F(Ue, { status: D })]
2810
+ className: L("truncate text-sm font-semibold", !i && "text-muted-foreground"),
2811
+ children: l
2812
+ }), /* @__PURE__ */ F(We, { status: te })]
2631
2813
  }),
2632
2814
  /* @__PURE__ */ F("p", {
2633
2815
  className: "text-sm text-muted-foreground tabular-nums",
2634
- children: [S, C].filter(Boolean).join(" · ") || s("common.notAvailable")
2816
+ children: [E, D].filter(Boolean).join(" · ") || s("common.notAvailable")
2635
2817
  }),
2636
- a ? /* @__PURE__ */ I("p", {
2637
- className: L("text-sm tabular-nums", !t && "text-muted-foreground"),
2818
+ m ? /* @__PURE__ */ I("p", {
2819
+ className: L("text-sm tabular-nums", !i && "text-muted-foreground"),
2638
2820
  children: [/* @__PURE__ */ F("span", {
2639
2821
  className: "font-medium",
2640
- children: a
2641
- }), l ? /* @__PURE__ */ I("span", {
2822
+ children: m
2823
+ }), g ? /* @__PURE__ */ I("span", {
2642
2824
  className: "text-muted-foreground",
2643
- children: [" ", l]
2825
+ children: [" ", g]
2644
2826
  }) : null]
2645
2827
  }) : null,
2646
- e.status === "past_due" || e.status === "awaiting_method" ? /* @__PURE__ */ F("p", {
2828
+ t.status === "past_due" || t.status === "awaiting_method" ? /* @__PURE__ */ F("p", {
2647
2829
  className: "text-sm text-destructive",
2648
2830
  children: s("subscriptions.pastDue")
2649
2831
  }) : null,
2650
- v?.id === e.id ? /* @__PURE__ */ F("p", {
2832
+ v?.id === t.id ? /* @__PURE__ */ F("p", {
2651
2833
  role: "alert",
2652
2834
  className: "text-sm text-destructive",
2653
2835
  children: v.message
@@ -2657,75 +2839,84 @@ function Vn({ sendSolanaTransaction: e, plansHref: t, renderSubscriptionFooter:
2657
2839
  /* @__PURE__ */ I("div", {
2658
2840
  className: "flex flex-wrap gap-2 @md:justify-end",
2659
2841
  children: [
2660
- e.resumable ? /* @__PURE__ */ I(H, {
2842
+ t.resumable ? /* @__PURE__ */ I(U, {
2661
2843
  variant: "outline",
2662
2844
  size: "sm",
2663
- disabled: !!r,
2845
+ disabled: !!a,
2664
2846
  onClick: () => {
2665
- y(null), h(e);
2847
+ b(null), h(t);
2666
2848
  },
2667
- children: [r === "resume" ? /* @__PURE__ */ F(X, {}) : null, s(r === "resume" ? "subscriptions.updating" : "subscriptions.resume")]
2849
+ children: [a === "resume" ? /* @__PURE__ */ F(Z, {}) : null, s(a === "resume" ? "subscriptions.updating" : "subscriptions.resume")]
2668
2850
  }) : null,
2669
- w ? /* @__PURE__ */ I("a", {
2670
- href: w,
2851
+ O ? /* @__PURE__ */ I("a", {
2852
+ href: O,
2671
2853
  target: "_blank",
2672
2854
  rel: "noopener noreferrer",
2673
- className: _e({
2855
+ className: H({
2674
2856
  variant: "outline",
2675
2857
  size: "sm"
2676
2858
  }),
2677
- children: [s("subscriptions.manageAtProvider"), /* @__PURE__ */ F(se, {
2678
- icon: le,
2859
+ children: [s("subscriptions.manageAtProvider"), /* @__PURE__ */ F(ce, {
2860
+ icon: ue,
2679
2861
  "aria-hidden": !0
2680
2862
  })]
2681
2863
  }) : null,
2682
- E ? /* @__PURE__ */ I(H, {
2864
+ Ae(t) && (t.rail !== "solana" || e) ? /* @__PURE__ */ F(qn, {
2865
+ subscription: t,
2866
+ name: l,
2867
+ pending: a,
2868
+ changeSubscription: u.changeSubscription,
2869
+ sendSolanaTransaction: e,
2870
+ onChanged: S,
2871
+ appearance: r
2872
+ }) : null,
2873
+ ee ? /* @__PURE__ */ I(U, {
2683
2874
  variant: "ghost",
2684
2875
  size: "sm",
2685
- disabled: !!r,
2686
- "aria-label": s("subscriptions.changeCardLabel", { name: i }),
2876
+ disabled: !!a,
2877
+ "aria-label": s("subscriptions.changeCardLabel", { name: l }),
2687
2878
  onClick: () => {
2688
- y(null), _(e);
2879
+ b(null), _(t);
2689
2880
  },
2690
- children: [r === "payment_method" ? /* @__PURE__ */ F(X, {}) : null, s("subscriptions.changeCard")]
2881
+ children: [a === "payment_method" ? /* @__PURE__ */ F(Z, {}) : null, s("subscriptions.changeCard")]
2691
2882
  }) : null,
2692
- T ? /* @__PURE__ */ I(H, {
2883
+ k ? /* @__PURE__ */ I(U, {
2693
2884
  size: "sm",
2694
2885
  className: "bg-red-600 text-white hover:bg-red-700",
2695
- disabled: !!r,
2696
- "aria-label": s("subscriptions.cancelLabel", { name: i }),
2886
+ disabled: !!a,
2887
+ "aria-label": s("subscriptions.cancelLabel", { name: l }),
2697
2888
  onClick: () => {
2698
- y(null), p(e);
2889
+ b(null), p(t);
2699
2890
  },
2700
- children: [r && r !== "resume" && r !== "payment_method" && r !== "change" ? /* @__PURE__ */ F(X, {}) : null, s("subscriptions.cancel")]
2891
+ children: [a === "cancel" || f?.id === t.id && a ? /* @__PURE__ */ F(Z, {}) : null, s("subscriptions.cancel")]
2701
2892
  }) : null
2702
2893
  ]
2703
2894
  }),
2704
- O ? /* @__PURE__ */ F("div", {
2895
+ A ? /* @__PURE__ */ F("div", {
2705
2896
  "data-testid": "subscription-footer",
2706
2897
  className: "border-t border-border/60 pt-3 @md:col-span-2",
2707
- children: O
2898
+ children: A
2708
2899
  }) : null
2709
2900
  ]
2710
- }, e.id);
2901
+ }, t.id);
2711
2902
  })
2712
- }), /* @__PURE__ */ I(Y, {
2903
+ }), /* @__PURE__ */ I(Le, {
2713
2904
  title: s("subscriptions.title"),
2714
2905
  description: s("subscriptions.description"),
2715
2906
  appearance: r,
2716
2907
  className: i,
2717
2908
  "data-testid": "subscriptions-panel",
2718
2909
  children: [
2719
- E,
2910
+ O,
2720
2911
  u.subscriptions !== null && u.error ? /* @__PURE__ */ F("div", {
2721
2912
  className: "pt-3",
2722
- children: /* @__PURE__ */ F(ze, {
2913
+ children: /* @__PURE__ */ F(Be, {
2723
2914
  error: u.error,
2724
2915
  onRetry: u.refetch
2725
2916
  })
2726
2917
  }) : null,
2727
- b,
2728
- /* @__PURE__ */ F(Rn, {
2918
+ x,
2919
+ /* @__PURE__ */ F(Bn, {
2729
2920
  subscription: g,
2730
2921
  name: g ? xe(g, o) : "",
2731
2922
  onOpenChange: (e) => !e && _(null),
@@ -2734,30 +2925,30 @@ function Vn({ sendSolanaTransaction: e, plansHref: t, renderSubscriptionFooter:
2734
2925
  onConfirm: async (e) => {
2735
2926
  if (!g) return null;
2736
2927
  let t = await u.setPaymentMethod(g.id, e);
2737
- return t || (_(null), x(s("changeCard.done"))), t;
2928
+ return t || (_(null), S(s("changeCard.done"))), t;
2738
2929
  }
2739
2930
  }, `card-${g?.id ?? "closed"}`),
2740
- /* @__PURE__ */ F(Bn, {
2931
+ /* @__PURE__ */ F(Zn, {
2741
2932
  open: m !== null,
2742
2933
  onOpenChange: (e) => !e && h(null),
2743
2934
  name: m ? xe(m, o) : "",
2744
- price: m?.price ? G(m.price.unit_amount, m.price.currency, d, c) : null,
2745
- date: W(m?.current_period_ends_at, c) || null,
2935
+ price: m?.price ? K(m.price.unit_amount, m.price.currency, d, c) : null,
2936
+ date: G(m?.current_period_ends_at, c) || null,
2746
2937
  busy: m ? u.pending[m.id] === "resume" : !1,
2747
2938
  onConfirm: () => m && void w(m),
2748
2939
  appearance: r
2749
2940
  }),
2750
- /* @__PURE__ */ F(Nn, {
2941
+ /* @__PURE__ */ F(Fn, {
2751
2942
  open: f !== null,
2752
2943
  onOpenChange: (e) => !e && p(null),
2753
2944
  name: f ? xe(f, o) : "",
2754
- onChain: T && !!e,
2945
+ onChain: D && !!e,
2755
2946
  appearance: r,
2756
2947
  pending: f ? u.pending[f.id] : void 0,
2757
2948
  onConfirm: async (t, n) => {
2758
2949
  if (!f) return null;
2759
2950
  let r = await u.cancel(f.id, t, e, n);
2760
- return r || x(s("cancel.done")), r;
2951
+ return r || S(s("cancel.done")), r;
2761
2952
  }
2762
2953
  }, f?.id ?? "closed")
2763
2954
  ]
@@ -2765,24 +2956,24 @@ function Vn({ sendSolanaTransaction: e, plansHref: t, renderSubscriptionFooter:
2765
2956
  }
2766
2957
  //#endregion
2767
2958
  //#region src/account/account-billing.tsx
2768
- function Hn({ defaultCurrency: e, defaultCountry: t, sendSolanaTransaction: n, plansHref: r, renderSubscriptionFooter: i, historyPageSize: a, appearance: o, className: s }) {
2769
- return /* @__PURE__ */ I(ge, {
2959
+ function $n({ defaultCurrency: e, defaultCountry: t, sendSolanaTransaction: n, plansHref: r, renderSubscriptionFooter: i, historyPageSize: a, appearance: o, className: s }) {
2960
+ return /* @__PURE__ */ I(_e, {
2770
2961
  appearance: o,
2771
2962
  className: L("grid gap-6", s),
2772
2963
  "data-testid": "account-billing",
2773
2964
  children: [
2774
- /* @__PURE__ */ F(Vn, {
2965
+ /* @__PURE__ */ F(Qn, {
2775
2966
  sendSolanaTransaction: n,
2776
2967
  plansHref: r,
2777
2968
  renderSubscriptionFooter: i,
2778
2969
  appearance: o
2779
2970
  }),
2780
- /* @__PURE__ */ F(jn, {
2971
+ /* @__PURE__ */ F(Nn, {
2781
2972
  defaultCurrency: e,
2782
2973
  defaultCountry: t,
2783
2974
  appearance: o
2784
2975
  }),
2785
- /* @__PURE__ */ F(Ge, {
2976
+ /* @__PURE__ */ F(Ke, {
2786
2977
  pageSize: a,
2787
2978
  appearance: o
2788
2979
  })
@@ -2790,16 +2981,44 @@ function Hn({ defaultCurrency: e, defaultCountry: t, sendSolanaTransaction: n, p
2790
2981
  });
2791
2982
  }
2792
2983
  //#endregion
2984
+ //#region src/account/renewal-prompt.tsx
2985
+ function er({ plansHref: e, appearance: t, className: n }) {
2986
+ let { t: r } = y(), { navigate: i } = E(), a = k(t), { subscriptions: o } = T();
2987
+ return !o?.length || o.some(Oe) ? null : /* @__PURE__ */ I("div", {
2988
+ "data-testid": "renewal-prompt",
2989
+ "data-orck-theme": a["data-orck-theme"],
2990
+ style: a.style,
2991
+ className: L(a.className, q, "flex flex-wrap items-center justify-between gap-3 rounded-xl border border-border bg-card p-4 text-card-foreground", n),
2992
+ children: [/* @__PURE__ */ I("div", {
2993
+ className: "grid min-w-0 gap-1",
2994
+ children: [/* @__PURE__ */ F("p", {
2995
+ className: "text-sm font-semibold",
2996
+ children: r("renewal.title")
2997
+ }), /* @__PURE__ */ F("p", {
2998
+ className: "text-sm text-muted-foreground",
2999
+ children: r("renewal.description")
3000
+ })]
3001
+ }), /* @__PURE__ */ F("a", {
3002
+ href: e,
3003
+ className: H({ size: "sm" }),
3004
+ onClick: (t) => {
3005
+ i && (t.preventDefault(), i(e));
3006
+ },
3007
+ children: r("renewal.action")
3008
+ })]
3009
+ });
3010
+ }
3011
+ //#endregion
2793
3012
  //#region src/components/qr.tsx
2794
- var Un = 208;
2795
- function Wn({ amountLabel: e, payload: t, statusLine: n }) {
2796
- let r = N.useRef(null), [i, a] = N.useState("loading");
2797
- return N.useEffect(() => {
3013
+ var tr = 208;
3014
+ function nr({ amountLabel: e, payload: t, statusLine: n }) {
3015
+ let r = P.useRef(null), [i, a] = P.useState("loading");
3016
+ return P.useEffect(() => {
2798
3017
  let e = r.current;
2799
3018
  if (!e || !t) return;
2800
3019
  let n = !1;
2801
3020
  return e.replaceChildren(), a("loading"), import("./dist-CslWupfi.js").then(({ createQR: r }) => {
2802
- n || (r(t, Un, "#ffffff", "#18181b").append(e), a("ready"));
3021
+ n || (r(t, tr, "#ffffff", "#18181b").append(e), a("ready"));
2803
3022
  }).catch(() => {
2804
3023
  n || a("failed");
2805
3024
  }), () => {
@@ -2815,8 +3034,8 @@ function Wn({ amountLabel: e, payload: t, statusLine: n }) {
2815
3034
  "aria-label": "Solana Pay QR code",
2816
3035
  className: "relative overflow-hidden rounded-lg",
2817
3036
  style: {
2818
- width: Un,
2819
- height: Un
3037
+ width: tr,
3038
+ height: tr
2820
3039
  },
2821
3040
  children: [
2822
3041
  /* @__PURE__ */ F("div", {
@@ -2836,8 +3055,8 @@ function Wn({ amountLabel: e, payload: t, statusLine: n }) {
2836
3055
  "aria-hidden": !0,
2837
3056
  className: "animate-pulse rounded-lg bg-zinc-100",
2838
3057
  style: {
2839
- width: Un,
2840
- height: Un
3058
+ width: tr,
3059
+ height: tr
2841
3060
  }
2842
3061
  })
2843
3062
  }),
@@ -2856,13 +3075,13 @@ function Wn({ amountLabel: e, payload: t, statusLine: n }) {
2856
3075
  }),
2857
3076
  t ? /* @__PURE__ */ F("a", {
2858
3077
  href: t,
2859
- className: L(_e({ variant: "secondary" }), "h-9 w-full max-w-56"),
3078
+ className: L(H({ variant: "secondary" }), "h-9 w-full max-w-56"),
2860
3079
  children: "Open in wallet"
2861
3080
  }) : null
2862
3081
  ]
2863
3082
  });
2864
3083
  }
2865
- var Gn = {
3084
+ var rr = {
2866
3085
  visa: "VISA",
2867
3086
  mastercard: "MC",
2868
3087
  amex: "AMEX",
@@ -2870,19 +3089,19 @@ var Gn = {
2870
3089
  jcb: "JCB",
2871
3090
  diners: "DINERS"
2872
3091
  };
2873
- function Kn(e) {
2874
- return Gn[e?.trim().toLowerCase() ?? ""] ?? "CARD";
3092
+ function ir(e) {
3093
+ return rr[e?.trim().toLowerCase() ?? ""] ?? "CARD";
2875
3094
  }
2876
- function qn(e) {
3095
+ function ar(e) {
2877
3096
  let t = e?.trim();
2878
3097
  return t ? t[0].toUpperCase() + t.slice(1) : "Card";
2879
3098
  }
2880
- function Jn(e) {
3099
+ function or(e) {
2881
3100
  let t = e.card;
2882
3101
  if (!(!t?.exp_month || !t.exp_year)) return `${String(t.exp_month).padStart(2, "0")}/${String(t.exp_year).slice(-2)}`;
2883
3102
  }
2884
- function Yn({ methods: e, value: t, onChange: n, disabled: r, idPrefix: i }) {
2885
- return /* @__PURE__ */ I(Pn, {
3103
+ function sr({ methods: e, value: t, onChange: n, disabled: r, idPrefix: i }) {
3104
+ return /* @__PURE__ */ I(In, {
2886
3105
  value: t,
2887
3106
  onValueChange: (e) => {
2888
3107
  typeof e == "string" && e && n(e);
@@ -2891,25 +3110,25 @@ function Yn({ methods: e, value: t, onChange: n, disabled: r, idPrefix: i }) {
2891
3110
  "aria-label": "Saved cards",
2892
3111
  className: "grid gap-0",
2893
3112
  children: [e.map((e) => {
2894
- let n = `${i}-${e.id}`, a = t === e.id, o = Jn(e), s = e.card?.brand, c = e.card?.last4;
2895
- return /* @__PURE__ */ I(Z, {
3113
+ let n = `${i}-${e.id}`, a = t === e.id, o = or(e), s = e.card?.brand, c = e.card?.last4;
3114
+ return /* @__PURE__ */ I(Q, {
2896
3115
  htmlFor: n,
2897
3116
  className: L("flex cursor-pointer items-center gap-3 py-1.5 select-none", r && "cursor-default"),
2898
3117
  children: [
2899
- /* @__PURE__ */ F(Fn, {
3118
+ /* @__PURE__ */ F(Ln, {
2900
3119
  id: n,
2901
3120
  value: e.id
2902
3121
  }),
2903
- /* @__PURE__ */ F(Ze, {
3122
+ /* @__PURE__ */ F(Qe, {
2904
3123
  brand: s ?? void 0,
2905
- fallback: Kn(s)
3124
+ fallback: ir(s)
2906
3125
  }),
2907
3126
  /* @__PURE__ */ I("span", {
2908
3127
  className: L("min-w-0 flex-1 truncate text-sm font-medium text-muted-foreground tabular-nums transition-colors", a && "font-semibold text-foreground"),
2909
3128
  children: [/* @__PURE__ */ I("span", {
2910
3129
  className: "sr-only",
2911
3130
  children: [
2912
- qn(s),
3131
+ ar(s),
2913
3132
  " card ending ",
2914
3133
  c,
2915
3134
  o ? `, expires ${o}` : ""
@@ -2917,7 +3136,7 @@ function Yn({ methods: e, value: t, onChange: n, disabled: r, idPrefix: i }) {
2917
3136
  }), /* @__PURE__ */ I("span", {
2918
3137
  "aria-hidden": !0,
2919
3138
  children: [
2920
- qn(s),
3139
+ ar(s),
2921
3140
  " •••• ",
2922
3141
  c ?? "····",
2923
3142
  o ? /* @__PURE__ */ I("span", {
@@ -2933,19 +3152,19 @@ function Yn({ methods: e, value: t, onChange: n, disabled: r, idPrefix: i }) {
2933
3152
  })
2934
3153
  ]
2935
3154
  }, e.id);
2936
- }), /* @__PURE__ */ I(Z, {
3155
+ }), /* @__PURE__ */ I(Q, {
2937
3156
  htmlFor: `${i}-new`,
2938
3157
  className: L("flex cursor-pointer items-center gap-3 py-1.5 text-sm font-medium text-muted-foreground select-none", t === "new" && "font-semibold text-foreground", r && "cursor-default"),
2939
3158
  children: [
2940
- /* @__PURE__ */ F(Fn, {
3159
+ /* @__PURE__ */ F(Ln, {
2941
3160
  id: `${i}-new`,
2942
3161
  value: "new"
2943
3162
  }),
2944
3163
  /* @__PURE__ */ F("span", {
2945
3164
  "aria-hidden": !0,
2946
3165
  className: L("grid h-7 w-11 shrink-0 place-items-center rounded-md border border-dashed border-border text-muted-foreground transition-colors", t === "new" && "border-solid border-transparent bg-foreground text-background"),
2947
- children: /* @__PURE__ */ F(se, {
2948
- icon: ce,
3166
+ children: /* @__PURE__ */ F(ce, {
3167
+ icon: le,
2949
3168
  className: "size-3.5"
2950
3169
  })
2951
3170
  }),
@@ -2956,34 +3175,34 @@ function Yn({ methods: e, value: t, onChange: n, disabled: r, idPrefix: i }) {
2956
3175
  }
2957
3176
  //#endregion
2958
3177
  //#region src/components/states.tsx
2959
- function Xn() {
3178
+ function cr() {
2960
3179
  return /* @__PURE__ */ I("div", {
2961
3180
  className: "grid gap-4",
2962
3181
  "aria-hidden": !0,
2963
3182
  children: [
2964
- /* @__PURE__ */ F(J, { className: "h-3 w-24" }),
2965
- /* @__PURE__ */ F(J, { className: "h-6 w-52" }),
2966
- /* @__PURE__ */ F(J, { className: "mt-1.5 h-11 w-full" }),
2967
- /* @__PURE__ */ F(J, { className: "h-28 w-full" }),
2968
- /* @__PURE__ */ F(J, { className: "h-11 w-full" }),
2969
- /* @__PURE__ */ F(J, { className: "mt-1 h-[42px] w-full" })
3183
+ /* @__PURE__ */ F(X, { className: "h-3 w-24" }),
3184
+ /* @__PURE__ */ F(X, { className: "h-6 w-52" }),
3185
+ /* @__PURE__ */ F(X, { className: "mt-1.5 h-11 w-full" }),
3186
+ /* @__PURE__ */ F(X, { className: "h-28 w-full" }),
3187
+ /* @__PURE__ */ F(X, { className: "h-11 w-full" }),
3188
+ /* @__PURE__ */ F(X, { className: "mt-1 h-[42px] w-full" })
2970
3189
  ]
2971
3190
  });
2972
3191
  }
2973
3192
  //#endregion
2974
3193
  //#region src/components/stripe-wallets.tsx
2975
- function Zn({ publishableKey: e, amount: t, currency: n, onPaymentMethod: r, onAvailable: i }) {
2976
- let a = N.useRef(null), o = N.useRef(r), s = N.useRef(i);
2977
- N.useEffect(() => {
3194
+ function lr({ publishableKey: e, amount: t, currency: n, onPaymentMethod: r, onAvailable: i }) {
3195
+ let a = P.useRef(null), o = P.useRef(r), s = P.useRef(i);
3196
+ P.useEffect(() => {
2978
3197
  o.current = r, s.current = i;
2979
3198
  });
2980
- let [c, l] = N.useState(!1);
2981
- return N.useEffect(() => {
3199
+ let [c, l] = P.useState(!1);
3200
+ return P.useEffect(() => {
2982
3201
  if (!a.current) return;
2983
3202
  let r = !1, i, c = (e) => {
2984
3203
  r || (l(e), s.current?.(e));
2985
3204
  };
2986
- return Xt(e).then((e) => {
3205
+ return Zt(e).then((e) => {
2987
3206
  if (r || !a.current) return;
2988
3207
  let s = e.elements({
2989
3208
  mode: "payment",
@@ -2991,7 +3210,7 @@ function Zn({ publishableKey: e, amount: t, currency: n, onPaymentMethod: r, onA
2991
3210
  currency: n.toLowerCase(),
2992
3211
  paymentMethodCreation: "manual",
2993
3212
  paymentMethodTypes: ["card"],
2994
- appearance: ln(a.current)
3213
+ appearance: un(a.current)
2995
3214
  }), l = s.create("expressCheckout", { paymentMethods: {
2996
3215
  applePay: "auto",
2997
3216
  googlePay: "auto",
@@ -3024,7 +3243,7 @@ function Zn({ publishableKey: e, amount: t, currency: n, onPaymentMethod: r, onA
3024
3243
  }
3025
3244
  //#endregion
3026
3245
  //#region src/fallbacks.ts
3027
- function Qn(e, t, n) {
3246
+ function ur(e, t, n) {
3028
3247
  let r = /* @__PURE__ */ new Set();
3029
3248
  if (!e) return r;
3030
3249
  let i = new Map(n.map((e) => [e.psp_id, e.key.toLowerCase()])), a = new Map(Object.entries(e).map(([e, t]) => [e.toLowerCase(), t]));
@@ -3036,25 +3255,25 @@ function Qn(e, t, n) {
3036
3255
  }
3037
3256
  return r;
3038
3257
  }
3039
- var $n = "fallbacks", er = 4096, tr = 1024, nr = 8, rr = M.string().regex(/^[a-z0-9][a-z0-9_-]{0,62}$/), ir = M.record(rr, M.strictObject({
3040
- for: M.array(rr).min(1).max(nr),
3041
- afterFailures: M.number().int().min(1).max(100)
3258
+ var dr = "fallbacks", fr = 4096, pr = 1024, mr = 8, hr = N.string().regex(/^[a-z0-9][a-z0-9_-]{0,62}$/), gr = N.record(hr, N.strictObject({
3259
+ for: N.array(hr).min(1).max(mr),
3260
+ afterFailures: N.number().int().min(1).max(100)
3042
3261
  })).refine((e) => {
3043
3262
  let t = Object.keys(e).length;
3044
- return t >= 1 && t <= nr;
3263
+ return t >= 1 && t <= mr;
3045
3264
  });
3046
- function ar(e, t) {
3265
+ function _r(e, t) {
3047
3266
  if (!t || Object.keys(t).length === 0) return e;
3048
- let n = e.indexOf("#"), r = n < 0 ? e : e.slice(0, n), i = n < 0 ? "" : e.slice(n + 1), a = `${$n}=${encodeURIComponent(JSON.stringify(t))}`;
3267
+ let n = e.indexOf("#"), r = n < 0 ? e : e.slice(0, n), i = n < 0 ? "" : e.slice(n + 1), a = `${dr}=${encodeURIComponent(JSON.stringify(t))}`;
3049
3268
  return `${r}#${i ? `${i}&` : ""}${a}`;
3050
3269
  }
3051
- function or(e) {
3270
+ function vr(e) {
3052
3271
  let [t = "", ...n] = e.replace(/^#/, "").split("&"), r = { secret: t.startsWith("pus_") ? t : null };
3053
- if (e.length > er) return r;
3054
- let i = new URLSearchParams(n.join("&")).get($n);
3055
- if (!i || i.length > tr) return r;
3272
+ if (e.length > fr) return r;
3273
+ let i = new URLSearchParams(n.join("&")).get(dr);
3274
+ if (!i || i.length > pr) return r;
3056
3275
  try {
3057
- let e = ir.safeParse(JSON.parse(i));
3276
+ let e = gr.safeParse(JSON.parse(i));
3058
3277
  return e.success ? {
3059
3278
  ...r,
3060
3279
  fallbacks: e.data
@@ -3065,82 +3284,82 @@ function or(e) {
3065
3284
  }
3066
3285
  //#endregion
3067
3286
  //#region src/order-payment.tsx
3068
- var sr = (e) => e.custodian === "platform" && e.rail === "nmi" && e.flow === "tokenize" && !e.status && !!e.config?.public_api_key, cr = (e) => e.status === "complete" || e.status === "processing", lr = 3e3;
3069
- function ur({ orderId: e, client: t, returnUrl: r, savedPaymentMethods: i = !0, serverCardEntry: a = !0, wallets: o = !1, fallbacks: c, onSettled: l, appearance: u, className: p }) {
3070
- let m = S(), h = T(), g = t ?? h.client, { config: _ } = y(), { config: v, error: b, refetch: x } = ee(), w = O(), [D, k] = N.useState(), [A, te] = N.useState([]), [j, ne] = N.useState("new"), [re, ie] = N.useState(), [M, ae] = N.useState(), [R, oe] = N.useState(!1), [z, se] = N.useState(), [ce, le] = N.useState(!1), [ue, de] = N.useState(() => crypto.randomUUID()), fe = N.useRef(null), B = N.useRef(l);
3071
- N.useEffect(() => {
3072
- B.current = l;
3073
- }), N.useEffect(() => {
3287
+ var yr = (e) => e.custodian === "platform" && e.rail === "nmi" && e.flow === "tokenize" && !e.status && !!e.config?.public_api_key, br = (e) => e.status === "complete" || e.status === "processing", xr = 3e3;
3288
+ function Sr({ orderId: e, client: t, returnUrl: r, savedPaymentMethods: i = !0, serverCardEntry: a = !0, wallets: o = !1, fallbacks: c, onSettled: l, appearance: u, className: p }) {
3289
+ let m = y(), h = j(), g = t ?? h.client, { config: _ } = O(), { config: v, error: b, refetch: x } = S(), T = te(), [E, D] = P.useState(), [k, ee] = P.useState([]), [A, ne] = P.useState("new"), [re, ie] = P.useState(), [M, N] = P.useState(), [R, oe] = P.useState(!1), [z, se] = P.useState(), [ce, le] = P.useState(!1), [ue, de] = P.useState(() => crypto.randomUUID()), fe = P.useRef(null), pe = P.useRef(l);
3290
+ P.useEffect(() => {
3291
+ pe.current = l;
3292
+ }), P.useEffect(() => {
3074
3293
  let t = new AbortController();
3075
- return g.getOrder(e, t.signal).then(k, (e) => {
3076
- t.signal.aborted || ae(m.error(e));
3294
+ return g.getOrder(e, t.signal).then(D, (e) => {
3295
+ t.signal.aborted || N(m.error(e));
3077
3296
  }), () => t.abort();
3078
3297
  }, [
3079
3298
  g,
3080
3299
  e,
3081
3300
  m
3082
- ]), N.useEffect(() => {
3083
- if (!i || D?.collection_owner !== "engine") return;
3301
+ ]), P.useEffect(() => {
3302
+ if (!i || E?.collection_owner !== "engine") return;
3084
3303
  let e = new AbortController();
3085
- return g.listPaymentMethods({ signal: e.signal }).then((e) => te(e.data), () => void 0), () => e.abort();
3304
+ return g.listPaymentMethods({ signal: e.signal }).then((e) => ee(e.data), () => void 0), () => e.abort();
3086
3305
  }, [
3087
3306
  g,
3088
3307
  i,
3089
- D?.collection_owner
3090
- ]), N.useEffect(() => {
3091
- D && cr(D) && B.current?.(D);
3092
- }, [D]);
3093
- let V = D?.collection_owner === "engine" && D?.payment.status === "requires_action" && D.payment.next_action?.type === "solana_pay";
3094
- N.useEffect(() => {
3095
- if (!V || !D) return;
3308
+ E?.collection_owner
3309
+ ]), P.useEffect(() => {
3310
+ E && br(E) && pe.current?.(E);
3311
+ }, [E]);
3312
+ let B = E?.collection_owner === "engine" && E?.payment.status === "requires_action" && E.payment.next_action?.type === "solana_pay";
3313
+ P.useEffect(() => {
3314
+ if (!B || !E) return;
3096
3315
  let e = window.setInterval(() => {
3097
- g.confirmOrder(D.id).then((e) => k(e.order), () => void 0);
3098
- }, lr);
3316
+ g.confirmOrder(E.id).then((e) => D(e.order), () => void 0);
3317
+ }, xr);
3099
3318
  return () => window.clearInterval(e);
3100
3319
  }, [
3101
- V,
3320
+ B,
3102
3321
  g,
3103
- D
3322
+ E
3104
3323
  ]);
3105
- let pe = N.useMemo(() => D?.collection_owner === "engine" ? D.payment_options : [], [D]), me = N.useMemo(() => (v?.payment.psps ?? []).filter((e) => pe.some((t) => t.psp_id === e.psp_id)), [v, pe]), he = Qn(c, pe, me), ge = pe.filter((e) => !he.has(e.psp_id)), _e = me.filter((e) => !he.has(e.psp_id)), U = _e.filter((e) => {
3324
+ let V = P.useMemo(() => E?.collection_owner === "engine" ? E.payment_options : [], [E]), me = P.useMemo(() => (v?.payment.psps ?? []).filter((e) => V.some((t) => t.psp_id === e.psp_id)), [v, V]), he = ur(c, V, me), ge = V.filter((e) => !he.has(e.psp_id)), _e = me.filter((e) => !he.has(e.psp_id)), H = _e.filter((e) => {
3106
3325
  let t = s(e);
3107
- return (t === "collect_js" || t === "stripe_elements" || sr(e)) && ge.some((t) => t.psp_id === e.psp_id && t.accepts.includes("new_card"));
3108
- }), ve = _e.filter((e) => a || s(e) !== "card"), ye = A.filter((e) => (e.status ?? "active") === "active" && e.reusable !== !1 && e.health?.active !== !1 && ve.some((t) => t.psp_id === e.psp_id || ge.some((n) => n.psp_id === t.psp_id && n.saved_payment_method_ids?.includes(e.id)))).map((e) => ({
3326
+ return (t === "collect_js" || t === "stripe_elements" || yr(e)) && ge.some((t) => t.psp_id === e.psp_id && t.accepts.includes("new_card"));
3327
+ }), ve = _e.filter((e) => a || s(e) !== "card"), ye = k.filter((e) => (e.status ?? "active") === "active" && e.reusable !== !1 && e.health?.active !== !1 && ve.some((t) => t.psp_id === e.psp_id || ge.some((n) => n.psp_id === t.psp_id && n.saved_payment_method_ids?.includes(e.id)))).map((e) => ({
3109
3328
  id: e.id,
3110
3329
  psp_id: e.psp_id ?? "",
3111
3330
  rail: e.rail ?? "",
3112
3331
  card: e.card ?? void 0
3113
- })), W = U.find((e) => e.psp_id === re) ?? U[0], G = ge.find((e) => e.accepts.includes("solana_pay")), be = _e.filter((e) => s(e) === null && ge.some((t) => t.psp_id === e.psp_id && t.accepts.includes("redirect"))), xe = (e) => !!c && Object.keys(c).some((t) => t.toLowerCase() === e.key.toLowerCase()), Se = be.filter((e) => !xe(e)), Ce = be.filter(xe), we = D?.lines.some((e) => e.billing_interval_hours !== null) ?? !1, Te = G ? (v?.payment.solana?.tokens ?? []).filter((e) => !we || e.recurring_eligible === !0) : [], Ee = o ? U.find((e) => s(e) === "stripe_elements" && !!e.config?.publishable_key) : void 0;
3114
- if (!D) return M ? /* @__PURE__ */ F("p", {
3332
+ })), W = H.find((e) => e.psp_id === re) ?? H[0], G = ge.find((e) => e.accepts.includes("solana_pay")), K = _e.filter((e) => s(e) === null && ge.some((t) => t.psp_id === e.psp_id && t.accepts.includes("redirect"))), be = (e) => !!c && Object.keys(c).some((t) => t.toLowerCase() === e.key.toLowerCase()), xe = K.filter((e) => !be(e)), Se = K.filter(be), Ce = E?.lines.some((e) => e.billing_interval_hours !== null) ?? !1, we = G ? (v?.payment.solana?.tokens ?? []).filter((e) => !Ce || e.recurring_eligible === !0) : [], Te = o ? H.find((e) => s(e) === "stripe_elements" && !!e.config?.publishable_key) : void 0;
3333
+ if (!E) return M ? /* @__PURE__ */ F("p", {
3115
3334
  role: "alert",
3116
3335
  className: "text-sm text-destructive",
3117
3336
  children: M
3118
- }) : /* @__PURE__ */ F(Xn, {});
3119
- let De = w[D.currency.toUpperCase()] ?? 2, Oe = (e) => d(e, D.currency, De), ke = _?.currencies?.find((e) => e.code.toUpperCase() === D.currency.toUpperCase()), Ae = Ee && ke?.minor_decimals != null ? f(D.total, ke.decimals, ke.minor_decimals) : null, je = async (e) => {
3120
- if (k(e.order), e.error) return ae(e.order.payment.last_payment_error?.message ?? e.error.message), de(crypto.randomUUID()), !1;
3337
+ }) : /* @__PURE__ */ F(cr, {});
3338
+ let Ee = T[E.currency.toUpperCase()] ?? 2, De = (e) => d(e, E.currency, Ee), Oe = _?.currencies?.find((e) => e.code.toUpperCase() === E.currency.toUpperCase()), ke = Te && Oe?.minor_decimals != null ? f(E.total, Oe.decimals, Oe.minor_decimals) : null, Ae = async (e) => {
3339
+ if (D(e.order), e.error) return N(e.order.payment.last_payment_error?.message ?? e.error.message), de(crypto.randomUUID()), !1;
3121
3340
  let t = e.order.payment.next_action;
3122
3341
  if (e.order.collection_owner !== "engine" || e.order.payment.status !== "requires_action" || !t) return !0;
3123
3342
  if (t.type === "redirect_to_url" && t.url) return window.location.assign(t.url), !0;
3124
3343
  let n = t.payload?.client_secret, r = (v?.payment.psps.find((e) => e.psp_id === t.psp_id))?.config?.publishable_key;
3125
- if (t.type !== "authenticate" || !n || !r) return ae(m.t("paymentMethods.unavailable")), !1;
3344
+ if (t.type !== "authenticate" || !n || !r) return N(m.t("paymentMethods.unavailable")), !1;
3126
3345
  if (fe.current && t.psp_id === W?.psp_id) await fe.current.handleNextAction(n);
3127
3346
  else {
3128
- let e = await (await Xt(r)).handleNextAction({ clientSecret: n });
3347
+ let e = await (await Zt(r)).handleNextAction({ clientSecret: n });
3129
3348
  if (e.error) throw Error(e.error.message);
3130
3349
  }
3131
- return je(await g.confirmOrder(D.id));
3132
- }, K = async (e, t = !1, r) => {
3133
- if (R || D.collection_owner !== "engine" || z && !t) return !1;
3134
- oe(!0), ae(void 0);
3350
+ return Ae(await g.confirmOrder(E.id));
3351
+ }, je = async (e, t = !1, r) => {
3352
+ if (R || E.collection_owner !== "engine" || z && !t) return !1;
3353
+ oe(!0), N(void 0);
3135
3354
  try {
3136
- return await je(await g.payOrder(D.id, {
3355
+ return await Ae(await g.payOrder(E.id, {
3137
3356
  payment: await e(),
3138
- expectedTotal: D.total,
3357
+ expectedTotal: E.total,
3139
3358
  idempotencyKey: ue,
3140
3359
  ...r === void 0 ? {} : { reusable: r }
3141
3360
  }));
3142
3361
  } catch (e) {
3143
- ae(!n(e) && e instanceof Error && e.message ? e.message : m.error(e));
3362
+ N(!n(e) && e instanceof Error && e.message ? e.message : m.error(e));
3144
3363
  let r = n(e) && e.status === 400 && e.type === "invalid_request_error";
3145
3364
  if (t && !r) throw e;
3146
3365
  return de(crypto.randomUUID()), !1;
@@ -3148,97 +3367,97 @@ function ur({ orderId: e, client: t, returnUrl: r, savedPaymentMethods: i = !0,
3148
3367
  oe(!1);
3149
3368
  }
3150
3369
  }, Me = async () => {
3151
- if (!(R || D.collection_owner !== "engine")) {
3152
- oe(!0), ae(void 0);
3370
+ if (!(R || E.collection_owner !== "engine")) {
3371
+ oe(!0), N(void 0);
3153
3372
  try {
3154
- await je({ order: D });
3373
+ await Ae({ order: E });
3155
3374
  } catch (e) {
3156
- ae(!n(e) && e instanceof Error && e.message ? e.message : m.error(e));
3375
+ N(!n(e) && e instanceof Error && e.message ? e.message : m.error(e));
3157
3376
  } finally {
3158
3377
  oe(!1);
3159
3378
  }
3160
3379
  }
3161
- }, Ne = D.collection_owner === "engine" && D.status === "open" && D.payment.status === "requires_action" && D.payment.next_action?.type === "authenticate", Pe = D.collection_owner === "engine" && D.status === "open" && D.payment.status === "requires_action" && D.payment.next_action?.type === "redirect_to_url" && !!D.payment.next_action.url, Fe = v?.payment.psps.find((e) => e.psp_id === D.payment.next_action?.psp_id), Ie = we ? "Subscribe" : "Pay", q = v?.merchant, J = q?.terms_url || q?.privacy_url ? /* @__PURE__ */ I(P, { children: [
3380
+ }, q = E.collection_owner === "engine" && E.status === "open" && E.payment.status === "requires_action" && E.payment.next_action?.type === "authenticate", Ne = E.collection_owner === "engine" && E.status === "open" && E.payment.status === "requires_action" && E.payment.next_action?.type === "redirect_to_url" && !!E.payment.next_action.url, Pe = v?.payment.psps.find((e) => e.psp_id === E.payment.next_action?.psp_id), Fe = Ce ? "Subscribe" : "Pay", J = v?.merchant, Ie = J?.terms_url || J?.privacy_url ? /* @__PURE__ */ I(ae, { children: [
3162
3381
  "By ",
3163
- we ? "subscribing" : "paying",
3382
+ Ce ? "subscribing" : "paying",
3164
3383
  ", you agree to our",
3165
3384
  " ",
3166
- q.terms_url ? /* @__PURE__ */ F("a", {
3167
- href: q.terms_url,
3385
+ J.terms_url ? /* @__PURE__ */ F("a", {
3386
+ href: J.terms_url,
3168
3387
  target: "_blank",
3169
3388
  rel: "noreferrer",
3170
3389
  className: "underline",
3171
3390
  children: "Terms of Service"
3172
3391
  }) : null,
3173
- q.terms_url && q.privacy_url ? " and " : null,
3174
- q.privacy_url ? /* @__PURE__ */ F("a", {
3175
- href: q.privacy_url,
3392
+ J.terms_url && J.privacy_url ? " and " : null,
3393
+ J.privacy_url ? /* @__PURE__ */ F("a", {
3394
+ href: J.privacy_url,
3176
3395
  target: "_blank",
3177
3396
  rel: "noreferrer",
3178
3397
  className: "underline",
3179
3398
  children: "Privacy Policy"
3180
3399
  }) : null,
3181
3400
  "."
3182
- ] }) : void 0, Y = D.collection_owner === "engine" && (D.status === "open" || D.status === "uncollectible" && !!D.usage) && D.payment.status === "requires_payment_method";
3401
+ ] }) : void 0, Y = E.collection_owner === "engine" && (E.status === "open" || E.status === "uncollectible" && !!E.usage) && E.payment.status === "requires_payment_method";
3183
3402
  return /* @__PURE__ */ I("div", {
3184
3403
  className: L("orck grid gap-5", p),
3185
3404
  "data-orck-theme": C(u),
3186
- style: E(u),
3405
+ style: w(u),
3187
3406
  children: [/* @__PURE__ */ I("div", {
3188
3407
  className: "grid",
3189
3408
  children: [
3190
- D.lines.map((e) => /* @__PURE__ */ I("div", {
3409
+ E.lines.map((e) => /* @__PURE__ */ I("div", {
3191
3410
  className: "flex items-start justify-between gap-4 py-2 text-[13.5px]",
3192
3411
  children: [/* @__PURE__ */ I("span", { children: [e.description, e.quantity && e.quantity > 1 ? ` × ${e.quantity}` : ""] }), /* @__PURE__ */ F("span", {
3193
3412
  className: "whitespace-nowrap tabular-nums",
3194
- children: Oe(e.amount)
3413
+ children: De(e.amount)
3195
3414
  })]
3196
3415
  }, e.id)),
3197
3416
  /* @__PURE__ */ I("div", {
3198
3417
  className: "flex items-start justify-between gap-4 border-t border-border pt-3 text-[13.5px] font-semibold",
3199
3418
  children: [/* @__PURE__ */ F("span", { children: "Total" }), /* @__PURE__ */ F("span", {
3200
3419
  className: "whitespace-nowrap tabular-nums",
3201
- children: Oe(D.total)
3420
+ children: De(E.total)
3202
3421
  })]
3203
3422
  }),
3204
- D.usage && D.usage.amount_paid !== "0" && /* @__PURE__ */ I("div", {
3423
+ E.usage && E.usage.amount_paid !== "0" && /* @__PURE__ */ I("div", {
3205
3424
  className: "flex items-start justify-between gap-4 pt-1 text-[13.5px]",
3206
3425
  children: [/* @__PURE__ */ F("span", { children: "Due" }), /* @__PURE__ */ F("span", {
3207
3426
  className: "whitespace-nowrap tabular-nums",
3208
- children: Oe(D.usage.amount_due)
3427
+ children: De(E.usage.amount_due)
3209
3428
  })]
3210
3429
  })
3211
3430
  ]
3212
- }), V ? /* @__PURE__ */ F(Wn, {
3213
- amountLabel: `${D.payment.next_action?.payload?.token_amount ?? ""} ${D.payment.next_action?.payload?.token_symbol ?? ""}`.trim(),
3214
- payload: D.payment.next_action?.url ?? void 0,
3431
+ }), B ? /* @__PURE__ */ F(nr, {
3432
+ amountLabel: `${E.payment.next_action?.payload?.token_amount ?? ""} ${E.payment.next_action?.payload?.token_symbol ?? ""}`.trim(),
3433
+ payload: E.payment.next_action?.url ?? void 0,
3215
3434
  statusLine: "Waiting for your wallet's payment"
3216
- }) : D.status === "complete" ? /* @__PURE__ */ F("p", {
3435
+ }) : E.status === "complete" ? /* @__PURE__ */ F("p", {
3217
3436
  role: "status",
3218
3437
  className: "text-sm font-semibold",
3219
3438
  children: "Payment complete"
3220
- }) : D.collection_owner === "engine" ? D.status === "processing" ? /* @__PURE__ */ F("p", {
3439
+ }) : E.collection_owner === "engine" ? E.status === "processing" ? /* @__PURE__ */ F("p", {
3221
3440
  role: "status",
3222
3441
  className: "text-sm text-muted-foreground",
3223
3442
  children: "Your payment is processing."
3224
- }) : D.status === "open" ? Pe ? /* @__PURE__ */ I("form", {
3443
+ }) : E.status === "open" ? Ne ? /* @__PURE__ */ I("form", {
3225
3444
  className: "grid gap-4",
3226
3445
  onSubmit: (e) => {
3227
- e.preventDefault(), window.location.assign(D.payment.next_action.url);
3446
+ e.preventDefault(), window.location.assign(E.payment.next_action.url);
3228
3447
  },
3229
3448
  children: [/* @__PURE__ */ I("p", {
3230
3449
  className: "text-sm text-muted-foreground",
3231
3450
  children: [
3232
3451
  "Your payment is waiting on",
3233
3452
  " ",
3234
- Fe?.display_name ?? "the payment page",
3453
+ Pe?.display_name ?? "the payment page",
3235
3454
  "."
3236
3455
  ]
3237
- }), /* @__PURE__ */ F(Q, {
3238
- label: `Continue to ${Fe?.display_name ?? "the payment page"}`,
3456
+ }), /* @__PURE__ */ F($, {
3457
+ label: `Continue to ${Pe?.display_name ?? "the payment page"}`,
3239
3458
  processing: !1
3240
3459
  })]
3241
- }) : Ne ? /* @__PURE__ */ I("form", {
3460
+ }) : q ? /* @__PURE__ */ I("form", {
3242
3461
  className: "grid gap-4",
3243
3462
  onSubmit: (e) => {
3244
3463
  e.preventDefault(), Me();
@@ -3248,7 +3467,7 @@ function ur({ orderId: e, client: t, returnUrl: r, savedPaymentMethods: i = !0,
3248
3467
  className: "text-sm text-muted-foreground",
3249
3468
  children: "Your bank asks you to confirm this payment."
3250
3469
  }),
3251
- /* @__PURE__ */ F(Q, {
3470
+ /* @__PURE__ */ F($, {
3252
3471
  label: "Confirm payment",
3253
3472
  processing: R
3254
3473
  }),
@@ -3261,84 +3480,84 @@ function ur({ orderId: e, client: t, returnUrl: r, savedPaymentMethods: i = !0,
3261
3480
  }) : /* @__PURE__ */ I("div", {
3262
3481
  className: "grid gap-4",
3263
3482
  children: [
3264
- !z && Ee && Ae ? /* @__PURE__ */ F(Zn, {
3265
- publishableKey: Ee.config.publishable_key,
3266
- amount: Ae,
3267
- currency: D.currency,
3483
+ !z && Te && ke ? /* @__PURE__ */ F(lr, {
3484
+ publishableKey: Te.config.publishable_key,
3485
+ amount: ke,
3486
+ currency: E.currency,
3268
3487
  onAvailable: le,
3269
- onPaymentMethod: (e) => K(async () => ({
3488
+ onPaymentMethod: (e) => je(async () => ({
3270
3489
  token: e,
3271
- psp_id: Ee.psp_id
3490
+ psp_id: Te.psp_id
3272
3491
  }))
3273
3492
  }) : null,
3274
- !z && ce && Ee && Ae ? /* @__PURE__ */ F("p", {
3493
+ !z && ce && Te && ke ? /* @__PURE__ */ F("p", {
3275
3494
  className: "text-center text-[13px] text-muted-foreground",
3276
3495
  children: "or pay another way"
3277
3496
  }) : null,
3278
- ye.length > 0 ? /* @__PURE__ */ F(Yn, {
3497
+ ye.length > 0 ? /* @__PURE__ */ F(sr, {
3279
3498
  methods: ye,
3280
- value: j,
3499
+ value: A,
3281
3500
  onChange: ne,
3282
3501
  disabled: R || !Y || !!z,
3283
- idPrefix: `orck-order-${D.id}`
3502
+ idPrefix: `orck-order-${E.id}`
3284
3503
  }) : null,
3285
- j === "new" ? W ? /* @__PURE__ */ I(P, { children: [U.length > 1 ? /* @__PURE__ */ F("select", {
3504
+ A === "new" ? W ? /* @__PURE__ */ I(ae, { children: [H.length > 1 ? /* @__PURE__ */ F("select", {
3286
3505
  "aria-label": "Pay with",
3287
3506
  className: "h-9 rounded-md border border-border bg-transparent px-2 text-sm",
3288
3507
  value: W.psp_id,
3289
3508
  onChange: (e) => ie(e.target.value),
3290
- children: U.map((e) => /* @__PURE__ */ F("option", {
3509
+ children: H.map((e) => /* @__PURE__ */ F("option", {
3291
3510
  value: e.psp_id,
3292
3511
  children: e.display_name
3293
3512
  }, e.psp_id))
3294
- }) : null, sr(W) ? /* @__PURE__ */ F(Jt, {
3513
+ }) : null, yr(W) ? /* @__PURE__ */ F(Yt, {
3295
3514
  publicKey: W.config.public_api_key,
3296
- submitLabel: Ie,
3515
+ submitLabel: Fe,
3297
3516
  disabled: R || !Y,
3298
- onTokenized: (e) => K(async () => ({
3517
+ onTokenized: (e) => je(async () => ({
3299
3518
  token: e.payment_token,
3300
3519
  psp_id: W.psp_id,
3301
- billing_details: Ot(e)
3520
+ billing_details: kt(e)
3302
3521
  }), !0)
3303
- }, W.psp_id) : s(W) === "collect_js" ? /* @__PURE__ */ F(xn, {
3522
+ }, W.psp_id) : s(W) === "collect_js" ? /* @__PURE__ */ F(Cn, {
3304
3523
  tokenizationKey: W.config.tokenization_key,
3305
3524
  tokenizationURL: W.config.tokenization_url,
3306
- submitLabel: Ie,
3525
+ submitLabel: Fe,
3307
3526
  disabled: R || !Y,
3308
3527
  appearance: u,
3309
3528
  defaultCountry: v?.client_country || void 0,
3310
- saveOptInMerchant: we ? void 0 : q?.display_name,
3311
- terms: J,
3312
- statementDescriptor: q?.statement_descriptor ?? void 0,
3313
- onTokenized: (e) => K(async () => ({
3529
+ saveOptInMerchant: Ce ? void 0 : J?.display_name,
3530
+ terms: Ie,
3531
+ statementDescriptor: J?.statement_descriptor ?? void 0,
3532
+ onTokenized: (e) => je(async () => ({
3314
3533
  token: e.payment_token,
3315
3534
  psp_id: W.psp_id,
3316
- billing_details: Ot(e)
3535
+ billing_details: kt(e)
3317
3536
  }), !1, e.reusable)
3318
3537
  }, W.psp_id) : /* @__PURE__ */ I("form", {
3319
3538
  className: "grid gap-4",
3320
3539
  onSubmit: (e) => {
3321
- e.preventDefault(), K(async () => ({
3540
+ e.preventDefault(), je(async () => ({
3322
3541
  token: await fe.current.tokenize(),
3323
3542
  psp_id: W.psp_id
3324
3543
  }));
3325
3544
  },
3326
3545
  children: [
3327
- /* @__PURE__ */ F(un, {
3546
+ /* @__PURE__ */ F(dn, {
3328
3547
  ref: fe,
3329
3548
  psp: W,
3330
3549
  client: g,
3331
3550
  unavailableMessage: m.t("paymentMethods.unavailable"),
3332
3551
  verificationPendingMessage: m.t("paymentMethods.verificationPending")
3333
3552
  }, W.psp_id),
3334
- /* @__PURE__ */ F(Q, {
3335
- label: Ie,
3553
+ /* @__PURE__ */ F($, {
3554
+ label: Fe,
3336
3555
  processing: R,
3337
3556
  disabled: !Y
3338
3557
  }),
3339
- /* @__PURE__ */ F(qt, {})
3558
+ /* @__PURE__ */ F(Jt, {})
3340
3559
  ]
3341
- })] }) : G || Se.length > 0 || Ce.length > 0 ? null : v ? /* @__PURE__ */ F("p", {
3560
+ })] }) : G || xe.length > 0 || Se.length > 0 ? null : v ? /* @__PURE__ */ F("p", {
3342
3561
  role: "alert",
3343
3562
  className: "text-sm text-destructive",
3344
3563
  children: m.t("paymentMethods.unavailable")
@@ -3348,7 +3567,7 @@ function ur({ orderId: e, client: t, returnUrl: r, savedPaymentMethods: i = !0,
3348
3567
  children: [/* @__PURE__ */ F("p", {
3349
3568
  className: "text-destructive",
3350
3569
  children: m.error(b)
3351
- }), /* @__PURE__ */ F(H, {
3570
+ }), /* @__PURE__ */ F(U, {
3352
3571
  type: "button",
3353
3572
  variant: "outline",
3354
3573
  size: "sm",
@@ -3362,51 +3581,51 @@ function ur({ orderId: e, client: t, returnUrl: r, savedPaymentMethods: i = !0,
3362
3581
  className: "grid gap-4",
3363
3582
  onSubmit: (e) => {
3364
3583
  e.preventDefault();
3365
- let t = z ?? j, n = ge.some((e) => e.saved_payment_method_ids?.includes(t));
3366
- K(async () => ({ payment_method_id: t }), n).then(() => se(void 0)).catch(() => se(t));
3584
+ let t = z ?? A, n = ge.some((e) => e.saved_payment_method_ids?.includes(t));
3585
+ je(async () => ({ payment_method_id: t }), n).then(() => se(void 0)).catch(() => se(t));
3367
3586
  },
3368
- children: /* @__PURE__ */ F(Q, {
3369
- label: z ? "Retry payment" : Ie,
3587
+ children: /* @__PURE__ */ F($, {
3588
+ label: z ? "Retry payment" : Fe,
3370
3589
  processing: R,
3371
3590
  disabled: !Y
3372
3591
  })
3373
3592
  }),
3374
- Se.map((e) => /* @__PURE__ */ F("form", {
3593
+ xe.map((e) => /* @__PURE__ */ F("form", {
3375
3594
  onSubmit: (t) => {
3376
- t.preventDefault(), K(async () => ({
3595
+ t.preventDefault(), je(async () => ({
3377
3596
  return_url: r ?? window.location.href,
3378
3597
  psp_id: e.psp_id
3379
3598
  }));
3380
3599
  },
3381
- children: /* @__PURE__ */ F(Q, {
3382
- label: `${Ie} with ${e.display_name}`,
3600
+ children: /* @__PURE__ */ F($, {
3601
+ label: `${Fe} with ${e.display_name}`,
3383
3602
  processing: R,
3384
3603
  disabled: !Y || !!z
3385
3604
  })
3386
3605
  }, e.psp_id)),
3387
- Ce.length > 0 ? /* @__PURE__ */ I("div", {
3606
+ Se.length > 0 ? /* @__PURE__ */ I("div", {
3388
3607
  className: "grid gap-2 border-t border-border pt-4",
3389
3608
  children: [/* @__PURE__ */ F("p", {
3390
3609
  className: "text-[13px] text-muted-foreground",
3391
3610
  children: "Card payment isn't working?"
3392
- }), Ce.map((e) => /* @__PURE__ */ I("button", {
3611
+ }), Se.map((e) => /* @__PURE__ */ I("button", {
3393
3612
  type: "button",
3394
3613
  className: "h-9 rounded-md border border-border text-sm",
3395
3614
  disabled: R || !Y || !!z,
3396
- onClick: () => void K(async () => ({
3615
+ onClick: () => void je(async () => ({
3397
3616
  return_url: r ?? window.location.href,
3398
3617
  psp_id: e.psp_id
3399
3618
  })),
3400
3619
  children: ["Pay with ", e.display_name]
3401
3620
  }, e.psp_id))]
3402
3621
  }) : null,
3403
- G && Te.length > 0 ? /* @__PURE__ */ F("div", {
3622
+ G && we.length > 0 ? /* @__PURE__ */ F("div", {
3404
3623
  className: "grid gap-2 border-t border-border pt-4",
3405
- children: Te.map((e) => /* @__PURE__ */ I("button", {
3624
+ children: we.map((e) => /* @__PURE__ */ I("button", {
3406
3625
  type: "button",
3407
3626
  className: "h-9 rounded-md border border-border text-sm",
3408
3627
  disabled: R || !Y || !!z,
3409
- onClick: () => void K(async () => ({
3628
+ onClick: () => void je(async () => ({
3410
3629
  token_symbol: e.symbol,
3411
3630
  psp_id: G.psp_id
3412
3631
  })),
@@ -3436,17 +3655,17 @@ function ur({ orderId: e, client: t, returnUrl: r, savedPaymentMethods: i = !0,
3436
3655
  }
3437
3656
  //#endregion
3438
3657
  //#region src/embedded-payment.tsx
3439
- var dr = "openrails.payment.complete", fr = "openrails.payment.resize", pr = 12e3;
3440
- function mr({ url: e, onComplete: t, fallbacks: n, onLoadFailure: r, title: i = "Payment", className: a }) {
3441
- let o = N.useRef(null), [s, c] = N.useState(), [l, u] = N.useState(0), [d, f] = N.useState(!1), [p, m] = N.useState(!1), h = N.useRef(!1), g = N.useRef(r);
3442
- N.useEffect(() => {
3658
+ var Cr = "openrails.payment.complete", wr = "openrails.payment.resize", Tr = 12e3;
3659
+ function Er({ url: e, onComplete: t, fallbacks: n, onLoadFailure: r, title: i = "Payment", className: a }) {
3660
+ let o = P.useRef(null), [s, c] = P.useState(), [l, u] = P.useState(0), [d, f] = P.useState(!1), [p, m] = P.useState(!1), h = P.useRef(!1), g = P.useRef(r);
3661
+ P.useEffect(() => {
3443
3662
  g.current = r;
3444
3663
  });
3445
- let _ = N.useRef(t);
3446
- N.useEffect(() => {
3664
+ let _ = P.useRef(t);
3665
+ P.useEffect(() => {
3447
3666
  _.current = t;
3448
3667
  });
3449
- let v = N.useMemo(() => {
3668
+ let v = P.useMemo(() => {
3450
3669
  try {
3451
3670
  let t = new URL(e);
3452
3671
  return t.protocol === "https:" || t.protocol === "http:" ? t.origin : null;
@@ -3454,7 +3673,7 @@ function mr({ url: e, onComplete: t, fallbacks: n, onLoadFailure: r, title: i =
3454
3673
  return null;
3455
3674
  }
3456
3675
  }, [e]);
3457
- return N.useEffect(() => {
3676
+ return P.useEffect(() => {
3458
3677
  if (!v) return;
3459
3678
  let e = !1, t = (t) => {
3460
3679
  if (t.origin !== v || !o.current || t.source !== o.current.contentWindow) return;
@@ -3475,11 +3694,11 @@ function mr({ url: e, onComplete: t, fallbacks: n, onLoadFailure: r, title: i =
3475
3694
  }) : /^https?:\/\//i.test(i) && window.location.assign(i);
3476
3695
  };
3477
3696
  return window.addEventListener("message", t), () => window.removeEventListener("message", t);
3478
- }, [v]), N.useEffect(() => {
3697
+ }, [v]), P.useEffect(() => {
3479
3698
  if (!v || d || p) return;
3480
3699
  let e = window.setTimeout(() => {
3481
3700
  m(!0), h.current || (h.current = !0, g.current?.());
3482
- }, pr);
3701
+ }, Tr);
3483
3702
  return () => window.clearTimeout(e);
3484
3703
  }, [
3485
3704
  v,
@@ -3507,12 +3726,12 @@ function mr({ url: e, onComplete: t, fallbacks: n, onLoadFailure: r, title: i =
3507
3726
  children: "Try again"
3508
3727
  })
3509
3728
  ]
3510
- }) : /* @__PURE__ */ I(P, { children: [d ? null : /* @__PURE__ */ F("p", {
3729
+ }) : /* @__PURE__ */ I(ae, { children: [d ? null : /* @__PURE__ */ F("p", {
3511
3730
  className: "p-6 text-center text-sm text-muted-foreground",
3512
3731
  children: "Loading secure payment page…"
3513
3732
  }), /* @__PURE__ */ F("iframe", {
3514
3733
  ref: o,
3515
- src: ar(e, n),
3734
+ src: _r(e, n),
3516
3735
  title: i,
3517
3736
  className: a,
3518
3737
  scrolling: "no",
@@ -3527,15 +3746,15 @@ function mr({ url: e, onComplete: t, fallbacks: n, onLoadFailure: r, title: i =
3527
3746
  }
3528
3747
  //#endregion
3529
3748
  //#region src/cart.tsx
3530
- function hr({ client: e, onOrder: t, onSettled: n, fallbacks: r, appearance: i, className: a }) {
3531
- let o = S(), s = T(), c = e ?? s.client, l = O(), [u, f] = N.useState(), [p, m] = N.useState(), [h, g] = N.useState(), [_, v] = N.useState(!1), [y, b] = N.useState(() => crypto.randomUUID());
3532
- N.useEffect(() => {
3749
+ function Dr({ client: e, onOrder: t, onSettled: n, fallbacks: r, appearance: i, className: a }) {
3750
+ let o = y(), s = j(), c = e ?? s.client, l = te(), [u, f] = P.useState(), [p, m] = P.useState(), [h, g] = P.useState(), [_, v] = P.useState(!1), [b, x] = P.useState(() => crypto.randomUUID());
3751
+ P.useEffect(() => {
3533
3752
  let e = new AbortController();
3534
3753
  return c.getCart(e.signal).then(f, (t) => {
3535
3754
  e.signal.aborted || g(o.error(t));
3536
3755
  }), () => e.abort();
3537
3756
  }, [c, o]);
3538
- let x = async (e) => {
3757
+ let S = async (e) => {
3539
3758
  if (!_) {
3540
3759
  v(!0), g(void 0);
3541
3760
  try {
@@ -3547,7 +3766,7 @@ function hr({ client: e, onOrder: t, onSettled: n, fallbacks: r, appearance: i,
3547
3766
  }
3548
3767
  }
3549
3768
  };
3550
- if (p && !t) return /* @__PURE__ */ F(ur, {
3769
+ if (p && !t) return /* @__PURE__ */ F(Sr, {
3551
3770
  orderId: p.id,
3552
3771
  client: c,
3553
3772
  onSettled: n,
@@ -3559,14 +3778,14 @@ function hr({ client: e, onOrder: t, onSettled: n, fallbacks: r, appearance: i,
3559
3778
  role: "alert",
3560
3779
  className: "text-sm text-destructive",
3561
3780
  children: h
3562
- }) : /* @__PURE__ */ F(Xn, {});
3563
- let w = l[u.currency.toUpperCase()] ?? 2, D = (e) => d(e, u.currency, w), k = u.lines.length > 0 && u.lines.every((e) => !e.refusal), A = (e) => x(async () => {
3564
- f(await c.setCartLine(e, { quantity: 0 })), b(crypto.randomUUID());
3565
- }), ee = () => x(async () => {
3781
+ }) : /* @__PURE__ */ F(cr, {});
3782
+ let T = l[u.currency.toUpperCase()] ?? 2, E = (e) => d(e, u.currency, T), D = u.lines.length > 0 && u.lines.every((e) => !e.refusal), O = (e) => S(async () => {
3783
+ f(await c.setCartLine(e, { quantity: 0 })), x(crypto.randomUUID());
3784
+ }), k = () => S(async () => {
3566
3785
  let e = await c.createOrder({
3567
3786
  cart: !0,
3568
3787
  expectedTotal: u.total,
3569
- idempotencyKey: y
3788
+ idempotencyKey: b
3570
3789
  });
3571
3790
  if (e.error) throw e.error;
3572
3791
  m(e.order), t?.(e.order);
@@ -3574,7 +3793,7 @@ function hr({ client: e, onOrder: t, onSettled: n, fallbacks: r, appearance: i,
3574
3793
  return /* @__PURE__ */ I("div", {
3575
3794
  className: L("orck grid gap-5", a),
3576
3795
  "data-orck-theme": C(i),
3577
- style: E(i),
3796
+ style: w(i),
3578
3797
  children: [
3579
3798
  u.lines.length === 0 ? /* @__PURE__ */ F("p", {
3580
3799
  role: "status",
@@ -3589,7 +3808,7 @@ function hr({ client: e, onOrder: t, onSettled: n, fallbacks: r, appearance: i,
3589
3808
  className: "flex items-start justify-between gap-4",
3590
3809
  children: [/* @__PURE__ */ F("span", { children: e.description || e.price_id }), /* @__PURE__ */ F("span", {
3591
3810
  className: "whitespace-nowrap tabular-nums",
3592
- children: D(e.amount)
3811
+ children: E(e.amount)
3593
3812
  })]
3594
3813
  }),
3595
3814
  /* @__PURE__ */ I("div", {
@@ -3601,7 +3820,7 @@ function hr({ client: e, onOrder: t, onSettled: n, fallbacks: r, appearance: i,
3601
3820
  type: "button",
3602
3821
  className: "text-[13px] text-muted-foreground underline",
3603
3822
  disabled: _,
3604
- onClick: () => void A(e.price_id),
3823
+ onClick: () => void O(e.price_id),
3605
3824
  children: "Remove"
3606
3825
  })]
3607
3826
  }),
@@ -3614,24 +3833,24 @@ function hr({ client: e, onOrder: t, onSettled: n, fallbacks: r, appearance: i,
3614
3833
  className: "flex items-start justify-between gap-4 pt-3 text-[13.5px] font-semibold",
3615
3834
  children: [/* @__PURE__ */ F("span", { children: "Total" }), /* @__PURE__ */ F("span", {
3616
3835
  className: "whitespace-nowrap tabular-nums",
3617
- children: D(u.total)
3836
+ children: E(u.total)
3618
3837
  })]
3619
3838
  })]
3620
3839
  }),
3621
3840
  u.lines.length > 0 ? /* @__PURE__ */ I("form", {
3622
3841
  className: "grid gap-2",
3623
3842
  onSubmit: (e) => {
3624
- e.preventDefault(), ee();
3843
+ e.preventDefault(), k();
3625
3844
  },
3626
- children: [/* @__PURE__ */ F(Q, {
3845
+ children: [/* @__PURE__ */ F($, {
3627
3846
  label: "Check out",
3628
3847
  processing: _,
3629
- disabled: !k
3848
+ disabled: !D
3630
3849
  }), /* @__PURE__ */ F("button", {
3631
3850
  type: "button",
3632
3851
  className: "text-[13px] text-muted-foreground underline",
3633
3852
  disabled: _,
3634
- onClick: () => void x(async () => {
3853
+ onClick: () => void S(async () => {
3635
3854
  await c.clearCart(), f(await c.getCart());
3636
3855
  }),
3637
3856
  children: "Empty cart"
@@ -3646,23 +3865,14 @@ function hr({ client: e, onOrder: t, onSettled: n, fallbacks: r, appearance: i,
3646
3865
  });
3647
3866
  }
3648
3867
  //#endregion
3649
- //#region src/authenticate.ts
3650
- async function gr(e, t, n, r) {
3651
- let i = n.next_action, o = i?.payload?.client_secret;
3652
- if (n.status !== "requires_action" || i?.type !== "authenticate" || !o || !a(r)) return n;
3653
- let s = await (await Xt(r.config.publishable_key)).handleNextAction({ clientSecret: o });
3654
- if (s.error) throw Error(s.error.message ?? "Authentication failed.");
3655
- return e.confirmSubscriptionChange(t);
3656
- }
3657
- //#endregion
3658
3868
  //#region src/lib/price-label.ts
3659
- function _r(e, t, n, r) {
3660
- let i = G(e.unit_amount, e.currency, t, r) ?? `${e.unit_amount} ${e.currency}`, a = U(e.billing_interval_hours);
3869
+ function Or(e, t, n, r) {
3870
+ let i = K(e.unit_amount, e.currency, t, r) ?? `${e.unit_amount} ${e.currency}`, a = ve(e.billing_interval_hours);
3661
3871
  if (a) return n.t("products.recurring", {
3662
3872
  amount: i,
3663
3873
  every: n.plural(`interval.every.${a.unit}`, a.count)
3664
3874
  });
3665
- let o = U(e.access_duration_hours);
3875
+ let o = ve(e.access_duration_hours);
3666
3876
  return o ? n.t("products.rent", {
3667
3877
  amount: i,
3668
3878
  period: n.plural(`interval.duration.${o.unit}`, o.count)
@@ -3670,21 +3880,21 @@ function _r(e, t, n, r) {
3670
3880
  }
3671
3881
  //#endregion
3672
3882
  //#region src/modal.tsx
3673
- function vr({ open: e, onOpenChange: t, appearance: n, children: r }) {
3674
- return /* @__PURE__ */ F(lt, {
3883
+ function kr({ open: e, onOpenChange: t, appearance: n, children: r }) {
3884
+ return /* @__PURE__ */ F(ut, {
3675
3885
  open: e,
3676
3886
  onOpenChange: t,
3677
- children: /* @__PURE__ */ I(ft, {
3887
+ children: /* @__PURE__ */ I(pt, {
3678
3888
  className: "orck max-h-[calc(100dvh-2rem)] w-[460px] max-w-[calc(100vw-2rem)] gap-0 overflow-hidden bg-background p-6 text-foreground ring-0 [&>[data-slot=dialog-close]]:top-5 [&>[data-slot=dialog-close]]:right-5 [&>[data-slot=dialog-close]]:text-foreground",
3679
3889
  "data-orck-theme": C(n),
3680
- style: E(n),
3890
+ style: w(n),
3681
3891
  showCloseButton: !0,
3682
3892
  children: [
3683
- /* @__PURE__ */ F(ht, {
3893
+ /* @__PURE__ */ F(gt, {
3684
3894
  className: "sr-only",
3685
3895
  children: "Payment"
3686
3896
  }),
3687
- /* @__PURE__ */ F(gt, {
3897
+ /* @__PURE__ */ F(_t, {
3688
3898
  className: "sr-only",
3689
3899
  children: "Complete your payment"
3690
3900
  }),
@@ -3696,38 +3906,38 @@ function vr({ open: e, onOpenChange: t, appearance: n, children: r }) {
3696
3906
  })
3697
3907
  });
3698
3908
  }
3699
- function yr({ open: e, onOpenChange: t, ...n }) {
3700
- return /* @__PURE__ */ F(vr, {
3909
+ function Ar({ open: e, onOpenChange: t, ...n }) {
3910
+ return /* @__PURE__ */ F(kr, {
3701
3911
  open: e,
3702
3912
  onOpenChange: t,
3703
3913
  appearance: n.appearance,
3704
- children: /* @__PURE__ */ F(ur, { ...n })
3914
+ children: /* @__PURE__ */ F(Sr, { ...n })
3705
3915
  });
3706
3916
  }
3707
- function br({ open: e, onOpenChange: t, appearance: n, ...r }) {
3708
- return /* @__PURE__ */ F(vr, {
3917
+ function jr({ open: e, onOpenChange: t, appearance: n, ...r }) {
3918
+ return /* @__PURE__ */ F(kr, {
3709
3919
  open: e,
3710
3920
  onOpenChange: t,
3711
3921
  appearance: n,
3712
- children: /* @__PURE__ */ F(mr, { ...r })
3922
+ children: /* @__PURE__ */ F(Er, { ...r })
3713
3923
  });
3714
3924
  }
3715
3925
  //#endregion
3716
3926
  //#region src/buy-button.tsx
3717
- function xr(e) {
3927
+ function Mr(e) {
3718
3928
  if (!n(e) || e.code !== "already_owned") return;
3719
3929
  let t = e.metadata.owned_by;
3720
3930
  return typeof t == "string" && t.startsWith("ord_") ? t : void 0;
3721
3931
  }
3722
- var Sr = (e) => typeof window < "u" && e.includes(window.location.origin);
3723
- function Cr({ price: t, label: i, amount: a, returnUrl: o, fallbacks: s, onPaid: c, onSignInRequired: l, signedIn: u, appearance: d, className: f }) {
3724
- let p = S(), { locale: m } = k(), h = O(), g = x(d), { client: _ } = T(), [v, y] = N.useState(), [b, C] = N.useState(!1), [w, E] = N.useState(), D = (e) => {
3725
- e.status === "complete" && (y(void 0), c(e));
3726
- }, A = async () => {
3932
+ var Nr = (e) => typeof window < "u" && e.includes(window.location.origin);
3933
+ function Pr({ price: t, label: i, amount: a, returnUrl: o, fallbacks: s, onPaid: c, onSignInRequired: l, signedIn: u, appearance: d, className: f }) {
3934
+ let p = y(), { locale: m } = E(), h = te(), g = k(d), { client: _ } = j(), [v, b] = P.useState(), [x, S] = P.useState(!1), [C, w] = P.useState(), T = (e) => {
3935
+ e.status === "complete" && (b(void 0), c(e));
3936
+ }, D = async () => {
3727
3937
  if (u === !1) return l();
3728
- E(void 0), C(!0);
3938
+ w(void 0), S(!0);
3729
3939
  try {
3730
- let { merchant: e } = await _.getCustomerConfig(), n = Sr(e.embed_origins), i;
3940
+ let { merchant: e } = await _.getCustomerConfig(), n = Nr(e.embed_origins), i;
3731
3941
  try {
3732
3942
  ({order: i} = await _.createOrder({
3733
3943
  lines: [{
@@ -3737,17 +3947,17 @@ function Cr({ price: t, label: i, amount: a, returnUrl: o, fallbacks: s, onPaid:
3737
3947
  ...n ? { payUrl: { embedded: !0 } } : {}
3738
3948
  }));
3739
3949
  } catch (e) {
3740
- let t = xr(e);
3950
+ let t = Mr(e);
3741
3951
  if (!t || n) throw e;
3742
- y({
3952
+ b({
3743
3953
  kind: "inline",
3744
3954
  orderId: t
3745
3955
  });
3746
3956
  return;
3747
3957
  }
3748
- if (i.status === "complete") return D(i);
3958
+ if (i.status === "complete") return T(i);
3749
3959
  if (!n) {
3750
- y({
3960
+ b({
3751
3961
  kind: "inline",
3752
3962
  orderId: i.id
3753
3963
  });
@@ -3755,17 +3965,17 @@ function Cr({ price: t, label: i, amount: a, returnUrl: o, fallbacks: s, onPaid:
3755
3965
  }
3756
3966
  let o = i.pay_url;
3757
3967
  if (!o) throw r("invalid_response", "the order answered no pay URL");
3758
- y({
3968
+ b({
3759
3969
  kind: "embedded",
3760
3970
  orderId: i.id,
3761
3971
  url: o
3762
3972
  });
3763
3973
  } catch (t) {
3764
- n(t) && t.status === 401 ? l() : E(p.error(e(t)));
3974
+ n(t) && t.status === 401 ? l() : w(p.error(e(t)));
3765
3975
  } finally {
3766
- C(!1);
3976
+ S(!1);
3767
3977
  }
3768
- }, ee = (e) => !e && y(void 0);
3978
+ }, O = (e) => !e && b(void 0);
3769
3979
  return /* @__PURE__ */ I("span", {
3770
3980
  className: L(g.className, "inline-flex flex-col gap-1", f),
3771
3981
  "data-orck-theme": g["data-orck-theme"],
@@ -3774,32 +3984,32 @@ function Cr({ price: t, label: i, amount: a, returnUrl: o, fallbacks: s, onPaid:
3774
3984
  containerType: "normal"
3775
3985
  },
3776
3986
  children: [
3777
- /* @__PURE__ */ F(H, {
3778
- disabled: b,
3779
- onClick: () => void A(),
3780
- children: i ?? _r(t, h, p, m)
3987
+ /* @__PURE__ */ F(U, {
3988
+ disabled: x,
3989
+ onClick: () => void D(),
3990
+ children: i ?? Or(t, h, p, m)
3781
3991
  }),
3782
- w ? /* @__PURE__ */ F("span", {
3992
+ C ? /* @__PURE__ */ F("span", {
3783
3993
  role: "alert",
3784
3994
  className: "text-sm text-destructive",
3785
- children: w
3995
+ children: C
3786
3996
  }) : null,
3787
- v?.kind === "inline" ? /* @__PURE__ */ F(yr, {
3997
+ v?.kind === "inline" ? /* @__PURE__ */ F(Ar, {
3788
3998
  open: !0,
3789
- onOpenChange: ee,
3999
+ onOpenChange: O,
3790
4000
  orderId: v.orderId,
3791
4001
  returnUrl: o,
3792
4002
  fallbacks: s,
3793
4003
  appearance: d,
3794
- onSettled: D
4004
+ onSettled: T
3795
4005
  }) : null,
3796
- v?.kind === "embedded" ? /* @__PURE__ */ F(br, {
4006
+ v?.kind === "embedded" ? /* @__PURE__ */ F(jr, {
3797
4007
  open: !0,
3798
- onOpenChange: ee,
4008
+ onOpenChange: O,
3799
4009
  url: v.url,
3800
4010
  fallbacks: s,
3801
4011
  appearance: d,
3802
- onComplete: () => void _.getOrder(v.orderId).then(D, () => void 0),
4012
+ onComplete: () => void _.getOrder(v.orderId).then(T, () => void 0),
3803
4013
  onLoadFailure: () => void _.reportPayURLFailure(v.orderId).catch(() => void 0)
3804
4014
  }) : null
3805
4015
  ]
@@ -3807,25 +4017,25 @@ function Cr({ price: t, label: i, amount: a, returnUrl: o, fallbacks: s, onPaid:
3807
4017
  }
3808
4018
  //#endregion
3809
4019
  //#region src/product-list.tsx
3810
- var wr = (e, t) => e.unit_amount === t.unit_amount && e.currency === t.currency && e.billing_interval_hours === t.billing_interval_hours && e.access_duration_hours === (t.provider?.access_duration_default ? t.billing_interval_hours : t.access_duration_hours) && !e.trial_unit_amount && !t.trial_unit_amount && !e.trial_duration_hours && !t.trial_duration_hours && !e.quantity && !t.quantity;
3811
- function Tr({ products: e, onPaid: t, onSignInRequired: n, signedIn: r, returnUrl: i, fallbacks: a, appearance: o, className: s }) {
3812
- let c = S(), l = x(o), u = e.filter((e) => !e.archived).map((e) => {
4020
+ var Fr = (e, t) => e.unit_amount === t.unit_amount && e.currency === t.currency && e.billing_interval_hours === t.billing_interval_hours && e.access_duration_hours === (t.provider?.access_duration_default ? t.billing_interval_hours : t.access_duration_hours) && !e.trial_unit_amount && !t.trial_unit_amount && !e.trial_duration_hours && !t.trial_duration_hours && !e.quantity && !t.quantity;
4021
+ function Ir({ products: e, onPaid: t, onSignInRequired: n, signedIn: r, returnUrl: i, fallbacks: a, appearance: o, className: s }) {
4022
+ let c = y(), l = k(o), u = e.filter((e) => !e.archived).map((e) => {
3813
4023
  let t = e.prices.filter((e) => !e.archived && !e.customer_amount && (!e.provider || e.provider.rail === "ccbill"));
3814
4024
  return {
3815
4025
  product: e,
3816
- prices: t.filter((e) => !e.provider || !t.some((t) => !t.provider && (!t.sell_via?.length || t.sell_via.includes("card")) && wr(t, e)))
4026
+ prices: t.filter((e) => !e.provider || !t.some((t) => !t.provider && (!t.sell_via?.length || t.sell_via.includes("card")) && Fr(t, e)))
3817
4027
  };
3818
4028
  }).filter((e) => e.prices.length > 0), d;
3819
- return d = u.length === 0 ? /* @__PURE__ */ F(Re, { title: c.t("products.empty") }) : u.map(({ product: e, prices: s }) => /* @__PURE__ */ I(Me, {
4029
+ return d = u.length === 0 ? /* @__PURE__ */ F(ze, { title: c.t("products.empty") }) : u.map(({ product: e, prices: s }) => /* @__PURE__ */ I(Ne, {
3820
4030
  className: "gap-4",
3821
4031
  "data-testid": "product",
3822
- children: [/* @__PURE__ */ I(Ne, { children: [/* @__PURE__ */ F(Pe, {
4032
+ children: [/* @__PURE__ */ I(Pe, { children: [/* @__PURE__ */ F(Fe, {
3823
4033
  role: "heading",
3824
4034
  "aria-level": 2,
3825
4035
  children: e.display_name
3826
- }), e.description ? /* @__PURE__ */ F(Fe, { children: e.description }) : null] }), /* @__PURE__ */ F(q, {
4036
+ }), e.description ? /* @__PURE__ */ F(J, { children: e.description }) : null] }), /* @__PURE__ */ F(Y, {
3827
4037
  className: "flex flex-wrap gap-2",
3828
- children: s.map((e) => /* @__PURE__ */ F(Cr, {
4038
+ children: s.map((e) => /* @__PURE__ */ F(Pr, {
3829
4039
  price: e,
3830
4040
  onPaid: t,
3831
4041
  onSignInRequired: n,
@@ -3836,13 +4046,13 @@ function Tr({ products: e, onPaid: t, onSignInRequired: n, signedIn: r, returnUr
3836
4046
  }, e.id))
3837
4047
  })]
3838
4048
  }, e.id)), /* @__PURE__ */ F("div", {
3839
- className: L(l.className, K, "grid gap-4", s),
4049
+ className: L(l.className, q, "grid gap-4", s),
3840
4050
  "data-orck-theme": l["data-orck-theme"],
3841
4051
  style: l.style,
3842
4052
  children: d
3843
4053
  });
3844
4054
  }
3845
4055
  //#endregion
3846
- export { Hn as AccountBilling, w as BillingProvider, Ue as BillingStatusBadge, ge as BillingUiRoot, Cr as BuyButton, Nn as CancelSubscriptionDialog, Ze as CardBrandPlate, hr as Cart, mr as EmbeddedPayment, ur as OrderPayment, dr as PAYMENT_COMPLETE_MESSAGE, fr as PAYMENT_RESIZE_MESSAGE, Ge as PaymentHistory, jn as PaymentMethodsPanel, Tr as ProductList, Sn as SavePaymentMethod, Vn as SubscriptionsPanel, xn as TokenizedCardForm, c as addAmounts, l as amountToDecimal, gr as authenticateChange, At as browserCountry, a as canAuthenticatePayment, m as canSavePaymentMethod, s as cardSetupDriver, o as createBillingClient, v as createTranslator, j as defaultMessages, re as defineMessages, d as formatAmount, jt as initialCountry, b as interpolate, u as isAmount, g as pspConfigSchema, or as readPaymentFragment, t as redeemAssertion, qe as resolveCardBrand, ne as resolveMessages, i as routedPsps, je as statusTone, h as tokenSource, S as useMessages, ar as withPaymentFallbacks };
4056
+ export { $n as AccountBilling, b as BillingProvider, We as BillingStatusBadge, _e as BillingUiRoot, Pr as BuyButton, Fn as CancelSubscriptionDialog, Qe as CardBrandPlate, Dr as Cart, Er as EmbeddedPayment, Sr as OrderPayment, Cr as PAYMENT_COMPLETE_MESSAGE, wr as PAYMENT_RESIZE_MESSAGE, Ke as PaymentHistory, Nn as PaymentMethodsPanel, Ir as ProductList, er as RenewalPrompt, wn as SavePaymentMethod, Qn as SubscriptionsPanel, Cn as TokenizedCardForm, c as addAmounts, l as amountToDecimal, Hn as authenticateChange, jt as browserCountry, a as canAuthenticatePayment, m as canSavePaymentMethod, s as cardSetupDriver, o as createBillingClient, ne as createTranslator, ie as defaultMessages, x as defineMessages, d as formatAmount, Mt as initialCountry, re as interpolate, u as isAmount, g as pspConfigSchema, vr as readPaymentFragment, t as redeemAssertion, Je as resolveCardBrand, v as resolveMessages, i as routedPsps, Me as statusTone, h as tokenSource, y as useMessages, _r as withPaymentFallbacks };
3847
4057
 
3848
4058
  //# sourceMappingURL=index.js.map