@burdenoff/microfe-billing 2026.601.6 → 2026.604.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.
@@ -26,24 +26,28 @@ import { SubscriptionSelector as xe } from "../components/SubscriptionSelector.j
26
26
  import { SimpleAutoPayToggle as Se } from "../components/SimpleAutoPayToggle.js";
27
27
  import { UnifiedPaymentMethodSelector as Ce } from "../components/UnifiedPaymentMethodSelector.js";
28
28
  import { CompleteBillingAccountModal as we, isBillingAccountComplete as Te } from "../components/CompleteBillingAccountModal.js";
29
+ import { WorkspaceQuotaAssignmentModal as Ee, isWorkspaceScopedQuota as De } from "../components/WorkspaceQuotaAssignmentModal.js";
29
30
  import "../components/index.js";
30
- import { buildStoreOrderCheckoutItems as Ee, normalizeStoreOrderCurrency as De } from "../utils/storeOrder.js";
31
- import { useCallback as s, useEffect as c, useMemo as l, useRef as Oe, useState as u } from "react";
32
- import { ArrowLeft as ke, ArrowRight as Ae, Blocks as je, CheckCircle as Me, Coins as Ne, CreditCard as Pe, Loader2 as d, Package as Fe, Receipt as Ie, RefreshCw as Le, ShoppingCart as Re, Wallet as ze, XCircle as Be } from "lucide-react";
33
- import { useLocation as Ve, useParams as He } from "react-router-dom";
34
- import { useAppShell as Ue } from "@burdenoff/fe-libs/shared/providers/shell";
35
- import { Fragment as f, jsx as p, jsxs as m } from "react/jsx-runtime";
36
- import { useI18n as We } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
37
- import { getProfileScopedKey as Ge } from "@burdenoff/fe-libs/shared/utils";
31
+ import { buildStoreOrderCheckoutItems as Oe, normalizeStoreOrderCurrency as ke } from "../utils/storeOrder.js";
32
+ import { useCallback as s, useEffect as c, useMemo as l, useRef as Ae, useState as u } from "react";
33
+ import { ArrowLeft as je, ArrowRight as Me, Blocks as Ne, CheckCircle as Pe, Coins as Fe, CreditCard as Ie, Loader2 as Le, Package as Re, Receipt as ze, RefreshCw as Be, ShoppingCart as Ve, Wallet as He, XCircle as Ue } from "lucide-react";
34
+ import { useLocation as We, useParams as Ge } from "react-router-dom";
35
+ import { useAppShell as Ke } from "@burdenoff/fe-libs/shared/providers/shell";
36
+ import { Fragment as d, jsx as f, jsxs as p } from "react/jsx-runtime";
37
+ import { useI18n as qe } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
38
+ import { getProfileScopedKey as Je } from "@burdenoff/fe-libs/shared/utils";
38
39
  //#region src/billing/modules/checkout/pages/CheckoutPage.tsx
39
- var Ke = () => {
40
- let { t: Ke } = We(), h = (e, t) => {
41
- let n = Ke(e);
40
+ var Ye = () => {
41
+ let { t: Ye } = qe(), m = (e, t) => {
42
+ let n = Ye(e);
42
43
  return n === e ? t : n;
43
- }, { planId: qe, addonId: g, storeOrderId: _ } = He(), v = se(), y = Ve(), b = y.state, Je = a(), { emit: x } = r(), { orgId: S, stripePublishableKey: Ye, razorpayKey: Xe, apiGatewayUrl: Ze, authToken: Qe, currentUser: $e } = e(), { productSlug: et } = Ue(), C = Oe(null), { items: w, clearCart: tt, _hasHydrated: T } = oe(), E = y.pathname.includes("/checkout/addons") && !g, D = y.pathname.includes("/checkout/store") && !!_, O = E ? "ADDON" : D ? "ORDER" : b?.purchaseType ?? (qe ? "PLAN" : g ? "ADDON" : "CREDITS"), k = b?.itemId ?? qe ?? g ?? _, [nt, A] = u(!1), j = Oe(!1), [M, N] = u("select"), [P, F] = u(null), [rt, I] = u(null), [L, it] = u(null), [at, ot] = u("card");
44
+ }, { planId: Xe, addonId: Ze, storeOrderId: h } = Ge(), g = se(), _ = We(), v = _.state, Qe = a(), { emit: y } = r(), { orgId: b, stripePublishableKey: $e, razorpayKey: et, apiGatewayUrl: tt, authToken: nt, currentUser: rt, workspaceId: x } = e(), { productSlug: it } = Ke(), at = Ae(null), ot = x ? [{
45
+ id: x,
46
+ name: "Current workspace"
47
+ }] : [], { items: S, clearCart: st, _hasHydrated: C } = oe(), w = _.pathname.includes("/checkout/addons") && !Ze, T = _.pathname.includes("/checkout/store") && !!h, E = w ? "ADDON" : T ? "ORDER" : v?.purchaseType ?? (Xe ? "PLAN" : Ze ? "ADDON" : "CREDITS"), D = v?.itemId ?? Xe ?? Ze ?? h, [ct, lt] = u(!1), O = Ae(!1), [ut, k] = u(!1), [dt, ft] = u([]), [pt, mt] = u(null), [A, j] = u("select"), [M, N] = u(null), [ht, P] = u(null), [F, I] = u(null), [gt, _t] = u("card");
44
48
  c(() => {
45
- if (M !== "success" || !L) return;
46
- let e = typeof window < "u" ? window.localStorage.getItem(Ge("boff-referral-attribution")) : null;
49
+ if (A !== "success" || !F) return;
50
+ let e = typeof window < "u" ? window.localStorage.getItem(Je("boff-referral-attribution")) : null;
47
51
  if (!e) return;
48
52
  let t;
49
53
  try {
@@ -52,168 +56,184 @@ var Ke = () => {
52
56
  return;
53
57
  }
54
58
  if (!t.journeyId && !t.codeId) return;
55
- let n = L.transactionId || P?.paymentId || P?.orderId || _ || k || O, r = `${t.journeyId ?? "journey"}:${n}`;
56
- C.current !== r && (C.current = r, ce({
59
+ let n = F.transactionId || M?.paymentId || M?.orderId || h || D || E, r = `${t.journeyId ?? "journey"}:${n}`;
60
+ at.current !== r && (at.current = r, ce({
57
61
  journeyId: t.journeyId,
58
62
  codeId: t.codeId,
59
- eventType: O === "ORDER" ? "STORE_PURCHASE" : "PAID_CONVERSION",
60
- productSlug: et,
61
- actorUserId: $e?.id,
62
- orderId: L.transactionId || P?.paymentId || P?.orderId,
63
- billingAccountId: L.billingAccountId,
64
- storeOrderId: O === "ORDER" ? _ : void 0,
65
- valueAmount: L.total,
66
- currency: L.currency,
63
+ eventType: E === "ORDER" ? "STORE_PURCHASE" : "PAID_CONVERSION",
64
+ productSlug: it,
65
+ actorUserId: rt?.id,
66
+ orderId: F.transactionId || M?.paymentId || M?.orderId,
67
+ billingAccountId: F.billingAccountId,
68
+ storeOrderId: E === "ORDER" ? h : void 0,
69
+ valueAmount: F.total,
70
+ currency: F.currency,
67
71
  mode: "billing-checkout",
68
72
  metadata: {
69
- purchaseType: O,
70
- billingAccountName: L.billingAccountName
73
+ purchaseType: E,
74
+ billingAccountName: F.billingAccountName
71
75
  }
72
76
  }, {
73
- apiGatewayUrl: Ze,
74
- authToken: Qe,
75
- orgId: S
77
+ apiGatewayUrl: tt,
78
+ authToken: nt,
79
+ orgId: b
76
80
  }).catch(() => {
77
- C.current = null;
81
+ at.current = null;
78
82
  }));
79
83
  }, [
80
- Ze,
81
- Qe,
82
- $e?.id,
83
- k,
84
- M,
85
- S,
86
- P?.orderId,
87
- P?.paymentId,
88
- et,
89
- L,
90
- O,
91
- _
84
+ tt,
85
+ nt,
86
+ rt?.id,
87
+ D,
88
+ A,
89
+ b,
90
+ M?.orderId,
91
+ M?.paymentId,
92
+ it,
93
+ F,
94
+ E,
95
+ h
92
96
  ]);
93
- let [R, z] = u(1), B = le({
97
+ let [L, R] = u(1), z = le({
94
98
  defaultCurrency: "USD",
95
- upgradeFromSubscriptionId: b?.upgradeFromSubscriptionId,
96
- downgradeFromSubscriptionId: b?.downgradeFromSubscriptionId
97
- }), { config: st, stripeEnabled: ct, razorpayEnabled: lt } = fe(), { elapsedTime: ut, error: dt } = pe({
98
- paymentId: M === "processing" ? P?.paymentId ?? null : null,
99
- billingAccountId: B.billingAccount?.id ?? L?.billingAccountId ?? null,
100
- paymentType: at,
99
+ upgradeFromSubscriptionId: v?.upgradeFromSubscriptionId,
100
+ downgradeFromSubscriptionId: v?.downgradeFromSubscriptionId
101
+ }), { config: vt, stripeEnabled: yt, razorpayEnabled: B } = fe(), { elapsedTime: V, error: bt } = pe({
102
+ paymentId: A === "processing" ? M?.paymentId ?? null : null,
103
+ billingAccountId: z.billingAccount?.id ?? F?.billingAccountId ?? null,
104
+ paymentType: gt,
101
105
  pollingInterval: 5e3,
102
106
  maxPollingTime: 3e5,
103
107
  onSuccess: (e) => {
104
- e.transactionId && it((t) => t && {
108
+ if (e.transactionId && I((t) => t && {
105
109
  ...t,
106
110
  transactionId: e.transactionId
107
- }), N("success"), E && tt();
111
+ }), j("success"), w && st(), (E === "PLAN" || E === "ADDON") && x) {
112
+ let e = (H?.getPlan?.features ?? []).filter((e) => e != null).filter((e) => e.quota?.name && De(e.quota.name)).map((e) => {
113
+ let t = e.quota?.limits, n = t && "value" in t ? Number(t.value) : null, r = t && "type" in t ? String(t.type) : "number";
114
+ return {
115
+ quotaName: e.quota.name,
116
+ productId: H?.getPlan?.context?.productId ?? "platform",
117
+ limit: r === "number" ? n : null,
118
+ noLimit: r !== "number",
119
+ resetPeriod: "NEVER",
120
+ quotaMode: "dedicated"
121
+ };
122
+ });
123
+ e.length > 0 && (ft(e), At().then((e) => {
124
+ let t = e.data?.getActiveSubscriptions?.find((e) => e.planId === D);
125
+ t && mt(t.id);
126
+ }), (ot.length === 1 || ot.length > 1) && k(!0));
127
+ }
108
128
  },
109
129
  onFailure: (e) => {
110
- I(e.failureReason || "Payment failed"), N("error");
130
+ P(e.failureReason || "Payment failed"), j("error");
111
131
  },
112
132
  onTimeout: () => {
113
- I("Payment verification timed out. Please check your billing history for the payment status."), N("error");
133
+ P("Payment verification timed out. Please check your billing history for the payment status."), j("error");
114
134
  }
115
- }), { data: ft, loading: pt, refetch: mt } = ee({}), { data: V, loading: ht } = re({
116
- variables: { id: k },
117
- skip: O !== "PLAN" || !k
118
- }), { data: H, loading: gt } = ie({
119
- variables: { addonIDs: k ? [k] : [] },
120
- skip: O !== "ADDON" || !k || D
121
- }), { data: U } = ae({
122
- variables: { id: _ },
123
- skip: !D || !_
124
- }), { data: _t, loading: vt } = ne({
125
- variables: { billingAccountId: B.billingAccount?.id },
126
- skip: !B.billingAccount?.id
127
- }), { data: yt, loading: bt } = o({
128
- variables: { billingAccountId: B.billingAccount?.id },
129
- skip: !B.billingAccount?.id || O !== "ADDON" || D
130
- }), W = l(() => yt?.getActiveSubscriptions ?? [], [yt]), G = l(() => !B.selectedSubscriptionId || W.length === 0 ? null : W.find((e) => e.id === B.selectedSubscriptionId) ?? null, [B.selectedSubscriptionId, W]), K = B.items[0]?.type === "CREDITS" ? B.items[0].quantity : 100, { data: q, loading: xt } = te({
135
+ }), { data: xt, loading: St, refetch: Ct } = ee({}), { data: H, loading: wt } = re({
136
+ variables: { id: D },
137
+ skip: E !== "PLAN" || !D
138
+ }), { data: U, loading: Tt } = ie({
139
+ variables: { addonIDs: D ? [D] : [] },
140
+ skip: E !== "ADDON" || !D || T
141
+ }), { data: W } = ae({
142
+ variables: { id: h },
143
+ skip: !T || !h
144
+ }), { data: Et, loading: Dt } = ne({
145
+ variables: { billingAccountId: z.billingAccount?.id },
146
+ skip: !z.billingAccount?.id
147
+ }), { data: Ot, loading: kt, refetch: At } = o({
148
+ variables: { billingAccountId: z.billingAccount?.id },
149
+ skip: !z.billingAccount?.id || E !== "ADDON" && E !== "PLAN" || T
150
+ }), G = l(() => Ot?.getActiveSubscriptions ?? [], [Ot]), K = l(() => !z.selectedSubscriptionId || G.length === 0 ? null : G.find((e) => e.id === z.selectedSubscriptionId) ?? null, [z.selectedSubscriptionId, G]), q = z.items[0]?.type === "CREDITS" ? z.items[0].quantity : 100, { data: jt, loading: Mt } = te({
131
151
  variables: {
132
- creditAmount: K,
133
- currency: B.selectedCurrency || "USD"
152
+ creditAmount: q,
153
+ currency: z.selectedCurrency || "USD"
134
154
  },
135
- skip: O !== "CREDITS"
136
- }), J = l(() => q?.getCostOfCredits?.amount && K > 0 ? q.getCostOfCredits.amount / K : .01, [q, K]), Y = l(() => _t?.getPaymentMethods ?? [], [_t]), X = l(() => ft?.getBillingAccountsByOrg ?? [], [ft]), Z = l(() => {
137
- if (!B.billingAccount) return;
138
- let e = X.find((e) => e.id === B.billingAccount?.id)?.billingAddresses;
155
+ skip: E !== "CREDITS"
156
+ }), J = l(() => jt?.getCostOfCredits?.amount && q > 0 ? jt.getCostOfCredits.amount / q : .01, [jt, q]), Y = l(() => Et?.getPaymentMethods ?? [], [Et]), X = l(() => xt?.getBillingAccountsByOrg ?? [], [xt]), Z = l(() => {
157
+ if (!z.billingAccount) return;
158
+ let e = X.find((e) => e.id === z.billingAccount?.id)?.billingAddresses;
139
159
  if (e && e.length > 0) return e[0]?.country || void 0;
140
- }, [B.billingAccount, X]), [St, Ct] = u(null);
160
+ }, [z.billingAccount, X]), [Nt, Pt] = u(null);
141
161
  c(() => {
142
- if (Z) if (Z === "IN") B.selectedCurrency !== "INR" && B.setCurrency("INR"), lt && St !== Z && B.selectedProvider !== "CREDITS" && (B.setPaymentProvider("RAZORPAY"), Ct(Z));
162
+ if (Z) if (Z === "IN") z.selectedCurrency !== "INR" && z.setCurrency("INR"), B && Nt !== Z && z.selectedProvider !== "CREDITS" && (z.setPaymentProvider("RAZORPAY"), Pt(Z));
143
163
  else {
144
- if (B.selectedCurrency === "INR") {
145
- let e = B.billingAccount?.currency, t = e && e !== "INR" ? e : "USD";
146
- B.setCurrency(t);
164
+ if (z.selectedCurrency === "INR") {
165
+ let e = z.billingAccount?.currency, t = e && e !== "INR" ? e : "USD";
166
+ z.setCurrency(t);
147
167
  }
148
- B.selectedProvider === "RAZORPAY" && (B.setPaymentProvider("STRIPE"), Ct(Z));
168
+ z.selectedProvider === "RAZORPAY" && (z.setPaymentProvider("STRIPE"), Pt(Z));
149
169
  }
150
170
  }, [
151
171
  Z,
152
- B.selectedCurrency,
153
- B.selectedProvider,
154
- B.setCurrency,
155
- B.setPaymentProvider,
156
- B.billingAccount?.currency,
157
- lt,
158
- St
172
+ z.selectedCurrency,
173
+ z.selectedProvider,
174
+ z.setCurrency,
175
+ z.setPaymentProvider,
176
+ z.billingAccount?.currency,
177
+ B,
178
+ Nt
159
179
  ]), c(() => {
160
- if (!B.billingAccount?.currency || Z === "IN") return;
161
- let e = B.billingAccount.currency;
162
- e !== "INR" && B.selectedCurrency !== e && B.setCurrency(e);
180
+ if (!z.billingAccount?.currency || Z === "IN") return;
181
+ let e = z.billingAccount.currency;
182
+ e !== "INR" && z.selectedCurrency !== e && z.setCurrency(e);
163
183
  }, [
164
- B.billingAccount?.id,
165
- B.billingAccount?.currency,
184
+ z.billingAccount?.id,
185
+ z.billingAccount?.currency,
166
186
  Z,
167
- B.selectedCurrency,
168
- B.setCurrency
187
+ z.selectedCurrency,
188
+ z.setCurrency
169
189
  ]), c(() => {
170
- if (B.selectedProvider !== "AUTO" && B.selectedProvider !== null) return;
171
- let e = B.availableCredits >= B.total;
172
- if (B.canPayWithCredits && e) {
173
- B.setPaymentProvider("CREDITS"), B.setSelectedPaymentMethodId(null);
190
+ if (z.selectedProvider !== "AUTO" && z.selectedProvider !== null) return;
191
+ let e = z.availableCredits >= z.total;
192
+ if (z.canPayWithCredits && e) {
193
+ z.setPaymentProvider("CREDITS"), z.setSelectedPaymentMethodId(null);
174
194
  return;
175
195
  }
176
- if (Y.length > 0 && !B.selectedPaymentMethodId) {
196
+ if (Y.length > 0 && !z.selectedPaymentMethodId) {
177
197
  let e = Y.find((e) => e.isDefault && e.isVerified), t = Y.find((e) => e.isVerified), n = e || t;
178
198
  if (n) {
179
- B.setSelectedPaymentMethodId(n.id), n.razorpayPaymentMethodId ? B.setPaymentProvider("RAZORPAY") : n.stripePaymentMethodId && B.setPaymentProvider("STRIPE");
199
+ z.setSelectedPaymentMethodId(n.id), n.razorpayPaymentMethodId ? z.setPaymentProvider("RAZORPAY") : n.stripePaymentMethodId && z.setPaymentProvider("STRIPE");
180
200
  return;
181
201
  }
182
202
  }
183
203
  }, [
184
204
  Y.length,
185
- B.canPayWithCredits,
186
- B.availableCredits,
187
- B.total
205
+ z.canPayWithCredits,
206
+ z.availableCredits,
207
+ z.total
188
208
  ]);
189
209
  let [Q, $] = u(!1);
190
210
  c(() => {
191
- if (!D || Q || !U?.getStoreOrder) return;
192
- let e = De(U.getStoreOrder.currency);
193
- B.selectedCurrency !== e && B.setCurrency(e);
211
+ if (!T || Q || !W?.getStoreOrder) return;
212
+ let e = ke(W.getStoreOrder.currency);
213
+ z.selectedCurrency !== e && z.setCurrency(e);
194
214
  }, [
195
- D,
215
+ T,
196
216
  Q,
197
- U,
198
- B.selectedCurrency,
199
- B.setCurrency
217
+ W,
218
+ z.selectedCurrency,
219
+ z.setCurrency
200
220
  ]), c(() => {
201
- if (O === "PLAN" && V?.getPlan?.pricingModel === "PER_SEAT") {
202
- let e = V.getPlan.minSeats ?? 1;
203
- z((t) => t < e ? e : t);
221
+ if (E === "PLAN" && H?.getPlan?.pricingModel === "PER_SEAT") {
222
+ let e = H.getPlan.minSeats ?? 1;
223
+ R((t) => t < e ? e : t);
204
224
  }
205
- }, [V, O]), c(() => {
206
- O === "PLAN" && V?.getPlan?.pricingModel === "PER_SEAT" && Q && $(!1);
207
- }, [R]), c(() => {
225
+ }, [H, E]), c(() => {
226
+ E === "PLAN" && H?.getPlan?.pricingModel === "PER_SEAT" && Q && $(!1);
227
+ }, [L]), c(() => {
208
228
  if (!Q) {
209
- if (E && T && w.length > 0) {
210
- B.clearItems();
211
- for (let e of w) {
229
+ if (w && C && S.length > 0) {
230
+ z.clearItems();
231
+ for (let e of S) {
212
232
  let t = e.addon, n = t.features?.map((e) => ({
213
233
  id: e.quota?.id || e.id,
214
234
  name: e.quota?.name || "Feature",
215
235
  limits: e.quota?.limits
216
- })) || [], r = B.selectedCurrency || "USD", i = t.currencyPrices?.[r] ?? t.price, a = {
236
+ })) || [], r = z.selectedCurrency || "USD", i = t.currencyPrices?.[r] ?? t.price, a = {
217
237
  id: t.id,
218
238
  type: "ADDON",
219
239
  name: t.name,
@@ -225,25 +245,25 @@ var Ke = () => {
225
245
  features: n,
226
246
  metadata: { addonId: t.id }
227
247
  };
228
- B.addItem(a);
248
+ z.addItem(a);
229
249
  }
230
250
  $(!0);
231
251
  return;
232
252
  }
233
- if (O === "PLAN" && V?.getPlan) {
234
- let e = V.getPlan, t = e.features?.map((e) => ({
253
+ if (E === "PLAN" && H?.getPlan) {
254
+ let e = H.getPlan, t = e.features?.map((e) => ({
235
255
  id: e.quota?.id || e.id,
236
256
  name: e.quota?.name || "Feature",
237
257
  limits: e.quota?.limits
238
- })) || [], n = B.selectedCurrency || "USD", r = e.currencyPrices, i = e.pricingModel === "PER_SEAT", a;
258
+ })) || [], n = z.selectedCurrency || "USD", r = e.currencyPrices, i = e.pricingModel === "PER_SEAT", a;
239
259
  if (i && e.pricePerSeat) {
240
260
  let t = r?.[n];
241
- a = (typeof t == "object" && t?.perSeat ? t.perSeat : e.pricePerSeat) * R;
261
+ a = (typeof t == "object" && t?.perSeat ? t.perSeat : e.pricePerSeat) * L;
242
262
  } else {
243
263
  let t = r?.[n];
244
264
  a = typeof t == "number" ? t : e.price;
245
265
  }
246
- let o = i ? R : 1, ee = {
266
+ let o = i ? L : 1, ee = {
247
267
  id: e.id,
248
268
  type: "PLAN",
249
269
  name: e.name,
@@ -259,13 +279,13 @@ var Ke = () => {
259
279
  seatCount: i ? o : void 0
260
280
  }
261
281
  };
262
- B.addItem(ee), $(!0);
263
- } else if (O === "ADDON" && !E && H?.getSelectedAddons?.[0]) {
264
- let e = H.getSelectedAddons[0], t = e.features?.map((e) => ({
282
+ z.addItem(ee), $(!0);
283
+ } else if (E === "ADDON" && !w && U?.getSelectedAddons?.[0]) {
284
+ let e = U.getSelectedAddons[0], t = e.features?.map((e) => ({
265
285
  id: e.quota?.id || e.id,
266
286
  name: e.quota?.name || "Feature",
267
287
  limits: e.quota?.limits
268
- })) || [], n = B.selectedCurrency || "USD", r = e.currencyPrices?.[n] ?? e.price, i = {
288
+ })) || [], n = z.selectedCurrency || "USD", r = e.currencyPrices?.[n] ?? e.price, i = {
269
289
  id: e.id,
270
290
  type: "ADDON",
271
291
  name: e.name,
@@ -273,184 +293,184 @@ var Ke = () => {
273
293
  price: r,
274
294
  priceUSD: e.price,
275
295
  currency: n,
276
- quantity: b?.quantity ?? 1,
296
+ quantity: v?.quantity ?? 1,
277
297
  features: t,
278
298
  metadata: { addonId: e.id }
279
299
  };
280
- B.addItem(i), $(!0);
281
- } else if (D && U?.getStoreOrder) {
282
- let e = U.getStoreOrder, t = Ee(e);
283
- for (let e of t) B.addItem(e);
300
+ z.addItem(i), $(!0);
301
+ } else if (T && W?.getStoreOrder) {
302
+ let e = W.getStoreOrder, t = Oe(e);
303
+ for (let e of t) z.addItem(e);
284
304
  $(!0);
285
- } else if (O === "CREDITS") {
305
+ } else if (E === "CREDITS") {
286
306
  let e = {
287
307
  id: "credits-purchase",
288
308
  type: "CREDITS",
289
309
  name: "Credits",
290
310
  description: "Purchase credits for your account",
291
311
  price: J,
292
- currency: B.selectedCurrency || "USD",
312
+ currency: z.selectedCurrency || "USD",
293
313
  quantity: 100
294
314
  };
295
- B.addItem(e), $(!0);
315
+ z.addItem(e), $(!0);
296
316
  }
297
317
  }
298
318
  }, [
299
- O,
300
- V,
319
+ E,
301
320
  H,
302
321
  U,
303
- B.addItem,
304
- B.clearItems,
305
- b?.quantity,
322
+ W,
323
+ z.addItem,
324
+ z.clearItems,
325
+ v?.quantity,
306
326
  Q,
307
- E,
308
- D,
309
327
  w,
310
328
  T,
329
+ S,
330
+ C,
311
331
  J,
312
- B.selectedCurrency
332
+ z.selectedCurrency
313
333
  ]), c(() => {
314
- if (!(!D || !Q || B.conversionRate <= 1)) {
315
- for (let e of B.items) if (e.type === "ORDER" && e.currency !== B.selectedCurrency) {
316
- let t = e.price * B.conversionRate;
317
- B.updateItemPrice(e.id, t, B.selectedCurrency);
334
+ if (!(!T || !Q || z.conversionRate <= 1)) {
335
+ for (let e of z.items) if (e.type === "ORDER" && e.currency !== z.selectedCurrency) {
336
+ let t = e.price * z.conversionRate;
337
+ z.updateItemPrice(e.id, t, z.selectedCurrency);
318
338
  }
319
339
  }
320
340
  }, [
321
- D,
341
+ T,
322
342
  Q,
323
- B.conversionRate,
324
- B.selectedCurrency,
325
- B.updateItemPrice
343
+ z.conversionRate,
344
+ z.selectedCurrency,
345
+ z.updateItemPrice
326
346
  ]), c(() => {
327
- if (O === "CREDITS" && Q && J > 0) {
328
- let e = B.items.find((e) => e.id === "credits-purchase");
329
- e && e.price !== J && B.updateItemPrice("credits-purchase", J);
347
+ if (E === "CREDITS" && Q && J > 0) {
348
+ let e = z.items.find((e) => e.id === "credits-purchase");
349
+ e && e.price !== J && z.updateItemPrice("credits-purchase", J);
330
350
  }
331
351
  }, [
332
- O,
352
+ E,
333
353
  Q,
334
354
  J,
335
- B.items,
336
- B.updateItemPrice
355
+ z.items,
356
+ z.updateItemPrice
337
357
  ]), c(() => {
338
- if (!Q || B.items.length === 0) return;
339
- let e = B.selectedCurrency || "USD";
340
- for (let t of B.items) if (t.type === "PLAN" && V?.getPlan) {
341
- let n = V.getPlan.currencyPrices?.[e] ?? V.getPlan.price;
342
- (t.price !== n || t.currency !== e) && B.updateItemPrice(t.id, n, e);
358
+ if (!Q || z.items.length === 0) return;
359
+ let e = z.selectedCurrency || "USD";
360
+ for (let t of z.items) if (t.type === "PLAN" && H?.getPlan) {
361
+ let n = H.getPlan.currencyPrices?.[e] ?? H.getPlan.price;
362
+ (t.price !== n || t.currency !== e) && z.updateItemPrice(t.id, n, e);
343
363
  } else if (t.type === "ADDON") {
344
- if (!E && H?.getSelectedAddons?.[0]) {
345
- let n = H.getSelectedAddons[0], r = n.currencyPrices?.[e] ?? n.price;
346
- (t.price !== r || t.currency !== e) && B.updateItemPrice(t.id, r, e);
364
+ if (!w && U?.getSelectedAddons?.[0]) {
365
+ let n = U.getSelectedAddons[0], r = n.currencyPrices?.[e] ?? n.price;
366
+ (t.price !== r || t.currency !== e) && z.updateItemPrice(t.id, r, e);
347
367
  }
348
- if (E) {
349
- let n = w.find((e) => e.addon.id === t.id);
368
+ if (w) {
369
+ let n = S.find((e) => e.addon.id === t.id);
350
370
  if (n) {
351
371
  let r = n.addon.currencyPrices?.[e] ?? n.addon.price;
352
- (t.price !== r || t.currency !== e) && B.updateItemPrice(t.id, r, e);
372
+ (t.price !== r || t.currency !== e) && z.updateItemPrice(t.id, r, e);
353
373
  }
354
374
  }
355
375
  }
356
376
  }, [
357
- B.selectedCurrency,
377
+ z.selectedCurrency,
358
378
  Q,
359
- B.items,
360
- B.updateItemPrice,
361
- V,
379
+ z.items,
380
+ z.updateItemPrice,
362
381
  H,
363
- w,
364
- E
382
+ U,
383
+ S,
384
+ w
365
385
  ]), c(() => {
366
- if (X.length > 0 && !B.billingAccount) {
367
- if (b?.billingAccountId) {
368
- let e = X.find((e) => e.id === b.billingAccountId);
386
+ if (X.length > 0 && !z.billingAccount) {
387
+ if (v?.billingAccountId) {
388
+ let e = X.find((e) => e.id === v.billingAccountId);
369
389
  if (e) {
370
- B.setBillingAccount(e);
390
+ z.setBillingAccount(e);
371
391
  return;
372
392
  }
373
393
  }
374
- if (S) {
375
- let e = i(S);
394
+ if (b) {
395
+ let e = i(b);
376
396
  if (e) {
377
397
  let t = X.find((t) => t.id === e);
378
398
  if (t) {
379
- B.setBillingAccount(t);
399
+ z.setBillingAccount(t);
380
400
  return;
381
401
  }
382
402
  }
383
403
  }
384
- B.setBillingAccount(X[0]);
404
+ z.setBillingAccount(X[0]);
385
405
  }
386
406
  }, [
387
407
  X,
388
- B.billingAccount,
389
- B.setBillingAccount,
390
- b?.billingAccountId,
391
- S
408
+ z.billingAccount,
409
+ z.setBillingAccount,
410
+ v?.billingAccountId,
411
+ b
392
412
  ]);
393
- let wt = !!(b?.upgradeFromSubscriptionId || b?.downgradeFromSubscriptionId);
413
+ let Ft = !!(v?.upgradeFromSubscriptionId || v?.downgradeFromSubscriptionId);
394
414
  c(() => {
395
- E && T && w.length === 0 && !Q && v("/addons", { replace: !0 });
415
+ w && C && S.length === 0 && !Q && g("/addons", { replace: !0 });
396
416
  }, [
397
- T,
398
- w.length,
399
- E,
417
+ C,
418
+ S.length,
419
+ w,
400
420
  Q,
401
- v
421
+ g
402
422
  ]);
403
- let Tt = de({
404
- billingAccountId: B.billingAccount?.id,
405
- purchaseType: O,
406
- productId: k
407
- }), Et = s(async () => {
408
- if (!B.billingAccount) return;
409
- let e = j.current;
410
- if (j.current = !1, !e && !Te(B.billingAccount)) {
411
- A(!0);
423
+ let It = de({
424
+ billingAccountId: z.billingAccount?.id,
425
+ purchaseType: E,
426
+ productId: D
427
+ }), Lt = s(async () => {
428
+ if (!z.billingAccount) return;
429
+ let e = O.current;
430
+ if (O.current = !1, !e && !Te(z.billingAccount)) {
431
+ lt(!0);
412
432
  return;
413
433
  }
414
- I(null);
415
- let t = B.billingAccount.creditAmount ?? 0, n = [...B.items], r = B.total, i = await B.initiatePayment();
434
+ P(null);
435
+ let t = z.billingAccount.creditAmount ?? 0, n = [...z.items], r = z.total, i = await z.initiatePayment();
416
436
  if (i.success) {
417
- if (x("billing.checkout.initiated", {
437
+ if (y("billing.checkout.initiated", {
418
438
  route: "/billing/checkout",
419
439
  entityId: i.paymentId ?? i.orderId,
420
440
  source: "checkout",
421
441
  amount: i.total || r,
422
- currency: i.currency || B.selectedCurrency
423
- }), B.selectedProvider === "CREDITS") {
424
- x("billing.credits.spent", {
442
+ currency: i.currency || z.selectedCurrency
443
+ }), z.selectedProvider === "CREDITS") {
444
+ y("billing.credits.spent", {
425
445
  route: "/billing/checkout",
426
446
  entityId: i.orderId,
427
447
  source: "checkout",
428
448
  amount: r,
429
449
  currency: "CREDITS"
430
- }), it({
450
+ }), I({
431
451
  items: n,
432
452
  total: r,
433
- billingAccountName: B.billingAccount.name,
434
- billingAccountId: B.billingAccount.id,
453
+ billingAccountName: z.billingAccount.name,
454
+ billingAccountId: z.billingAccount.id,
435
455
  previousBalance: t,
436
456
  newBalance: t - r,
437
457
  paymentMethod: "credits",
438
458
  currency: "Credits",
439
459
  transactionId: i.orderId
440
- }), ot("credits"), F({ paymentId: i.orderId }), N("processing");
460
+ }), _t("credits"), N({ paymentId: i.orderId }), j("processing");
441
461
  return;
442
462
  }
443
- it({
463
+ I({
444
464
  items: n,
445
465
  total: i.total || r,
446
- billingAccountName: B.billingAccount.name,
447
- billingAccountId: B.billingAccount.id,
466
+ billingAccountName: z.billingAccount.name,
467
+ billingAccountId: z.billingAccount.id,
448
468
  previousBalance: t,
449
469
  newBalance: t,
450
470
  paymentMethod: "card",
451
- currency: i.currency || B.selectedCurrency,
471
+ currency: i.currency || z.selectedCurrency,
452
472
  transactionId: i.paymentId
453
- }), ot("card"), F({
473
+ }), _t("card"), N({
454
474
  clientSecret: i.clientSecret,
455
475
  orderId: i.orderId,
456
476
  razorpayKeyId: i.razorpayKeyId,
@@ -462,79 +482,79 @@ var Ke = () => {
462
482
  prefillContact: i.prefillContact,
463
483
  total: i.total,
464
484
  currency: i.currency
465
- }), i.paymentComplete ? N("processing") : N("payment");
466
- } else x("billing.checkout.failed", {
485
+ }), i.paymentComplete ? j("processing") : j("payment");
486
+ } else y("billing.checkout.failed", {
467
487
  route: "/billing/checkout",
468
488
  source: "checkout",
469
489
  reason: i.error || "Payment initiation failed"
470
- }), I(i.error || "Payment initiation failed"), N("error");
471
- }, [B, x]), Dt = s((e) => {
472
- x("billing.payment.succeeded", {
490
+ }), P(i.error || "Payment initiation failed"), j("error");
491
+ }, [z, y]), Rt = s((e) => {
492
+ y("billing.payment.succeeded", {
473
493
  route: "/billing/checkout",
474
- entityId: P?.paymentId ?? P?.orderId,
494
+ entityId: M?.paymentId ?? M?.orderId,
475
495
  source: "checkout"
476
- }), F((e) => e), N("processing");
496
+ }), N((e) => e), j("processing");
477
497
  }, [
478
- x,
479
- P?.orderId,
480
- P?.paymentId
481
- ]), Ot = s((e) => {
482
- x("billing.payment.failed", {
498
+ y,
499
+ M?.orderId,
500
+ M?.paymentId
501
+ ]), zt = s((e) => {
502
+ y("billing.payment.failed", {
483
503
  route: "/billing/checkout",
484
- entityId: P?.paymentId ?? P?.orderId,
504
+ entityId: M?.paymentId ?? M?.orderId,
485
505
  source: "checkout",
486
506
  reason: e
487
- }), I(e), N("error");
507
+ }), P(e), j("error");
488
508
  }, [
489
- x,
490
- P?.orderId,
491
- P?.paymentId
492
- ]), kt = s((e) => {
493
- B.updateItemQuantity("credits-purchase", e);
494
- }, [B]);
495
- if (!Je.canProcessPayment) return /* @__PURE__ */ p(t, { message: "You don't have permission to make purchases." });
496
- if (ue()) return /* @__PURE__ */ p(me, {
497
- purchaseType: O,
498
- productId: k,
499
- billingAccountId: B.billingAccount?.id,
500
- nativeCheckout: Tt,
501
- onBack: () => v("dashboard")
509
+ y,
510
+ M?.orderId,
511
+ M?.paymentId
512
+ ]), Bt = s((e) => {
513
+ z.updateItemQuantity("credits-purchase", e);
514
+ }, [z]);
515
+ if (!Qe.canProcessPayment) return /* @__PURE__ */ f(t, { message: "You don't have permission to make purchases." });
516
+ if (ue()) return /* @__PURE__ */ f(me, {
517
+ purchaseType: E,
518
+ productId: D,
519
+ billingAccountId: z.billingAccount?.id,
520
+ nativeCheckout: It,
521
+ onBack: () => g("dashboard")
502
522
  });
503
- let At = pt || ht && O === "PLAN" || gt && O === "ADDON" && !E || E && !T;
504
- if (E && T && w.length === 0 && !Q) return null;
505
- let jt = () => {
506
- if (E) {
507
- let e = B.items.length;
523
+ let Vt = St || wt && E === "PLAN" || Tt && E === "ADDON" && !w || w && !C;
524
+ if (w && C && S.length === 0 && !Q) return null;
525
+ let Ht = () => {
526
+ if (w) {
527
+ let e = z.items.length;
508
528
  return `Purchase ${e} Add-on${e === 1 ? "" : "s"}`;
509
529
  }
510
- switch (O) {
530
+ switch (E) {
511
531
  case "CREDITS": return "Buy Credits";
512
532
  case "PLAN": return "Subscribe to Plan";
513
533
  case "ADDON": return "Purchase Add-on";
514
534
  default: return "Checkout";
515
535
  }
516
- }, Mt = () => {
517
- switch (O) {
518
- case "CREDITS": return /* @__PURE__ */ p(Ne, { className: "size-6" });
519
- case "PLAN": return /* @__PURE__ */ p(Fe, { className: "size-6" });
520
- case "ADDON": return /* @__PURE__ */ p(je, { className: "size-6" });
521
- default: return /* @__PURE__ */ p(Re, { className: "size-6" });
536
+ }, Ut = () => {
537
+ switch (E) {
538
+ case "CREDITS": return /* @__PURE__ */ f(Fe, { className: "size-6" });
539
+ case "PLAN": return /* @__PURE__ */ f(Re, { className: "size-6" });
540
+ case "ADDON": return /* @__PURE__ */ f(Ne, { className: "size-6" });
541
+ default: return /* @__PURE__ */ f(Ve, { className: "size-6" });
522
542
  }
523
543
  };
524
- if (At) return /* @__PURE__ */ p("div", {
544
+ if (Vt) return /* @__PURE__ */ f("div", {
525
545
  className: "flex items-center justify-center min-h-[400px]",
526
- children: /* @__PURE__ */ m("div", {
546
+ children: /* @__PURE__ */ p("div", {
527
547
  className: "text-center space-y-4",
528
- children: [/* @__PURE__ */ p(d, { className: "size-8 animate-spin mx-auto text-primary" }), /* @__PURE__ */ p("p", {
548
+ children: [/* @__PURE__ */ f(Le, { className: "size-8 animate-spin mx-auto text-primary" }), /* @__PURE__ */ f("p", {
529
549
  className: "text-muted-foreground",
530
- children: h("billing.checkout.loadingCheckout", "Loading checkout...")
550
+ children: m("billing.checkout.loadingCheckout", "Loading checkout...")
531
551
  })]
532
552
  })
533
553
  });
534
- if (M === "success") {
554
+ if (A === "success") {
535
555
  let e = (e) => {
536
- if (!L) return `${e.toFixed(2)}`;
537
- let t = L.currency;
556
+ if (!F) return `${e.toFixed(2)}`;
557
+ let t = F.currency;
538
558
  return t === "Credits" ? `${e.toFixed(2)} Credits` : `${{
539
559
  INR: "₹",
540
560
  USD: "$",
@@ -542,352 +562,360 @@ var Ke = () => {
542
562
  GBP: "£"
543
563
  }[t] || t + " "}${e.toFixed(2)}`;
544
564
  }, t = (e) => `${e.toFixed(2)} Credits`;
545
- return /* @__PURE__ */ m("div", {
565
+ return /* @__PURE__ */ p(d, { children: [/* @__PURE__ */ p("div", {
546
566
  className: "max-w-2xl mx-auto p-6 space-y-6",
547
567
  children: [
548
- /* @__PURE__ */ m("div", {
568
+ /* @__PURE__ */ p("div", {
549
569
  className: "text-center space-y-4",
550
- children: [/* @__PURE__ */ p("div", {
570
+ children: [/* @__PURE__ */ f("div", {
551
571
  className: "inline-flex p-4 rounded-full bg-status-success-bg-subtle text-status-success-text",
552
- children: /* @__PURE__ */ p(Me, { className: "size-12" })
553
- }), /* @__PURE__ */ m("div", { children: [/* @__PURE__ */ p("h1", {
572
+ children: /* @__PURE__ */ f(Pe, { className: "size-12" })
573
+ }), /* @__PURE__ */ p("div", { children: [/* @__PURE__ */ f("h1", {
554
574
  className: "text-2xl font-bold text-foreground",
555
- children: h("billing.checkout.paymentSuccessful", "Payment Successful!")
556
- }), /* @__PURE__ */ p("p", {
575
+ children: m("billing.checkout.paymentSuccessful", "Payment Successful!")
576
+ }), /* @__PURE__ */ f("p", {
557
577
  className: "text-muted-foreground mt-2",
558
- children: h("billing.checkout.purchaseCompleted", "Your purchase has been completed successfully.")
578
+ children: m("billing.checkout.purchaseCompleted", "Your purchase has been completed successfully.")
559
579
  })] })]
560
580
  }),
561
- L && /* @__PURE__ */ m("div", {
581
+ F && /* @__PURE__ */ p("div", {
562
582
  className: "bg-card border border-border rounded-lg overflow-hidden",
563
583
  children: [
564
- /* @__PURE__ */ m("div", {
584
+ /* @__PURE__ */ p("div", {
565
585
  className: "p-4 border-b border-border",
566
- children: [/* @__PURE__ */ m("h3", {
586
+ children: [/* @__PURE__ */ p("h3", {
567
587
  className: "font-semibold text-foreground mb-3 flex items-center gap-2",
568
- children: [/* @__PURE__ */ p(Ie, { className: "size-4" }), h("billing.checkout.itemsPurchased", "Items Purchased")]
569
- }), /* @__PURE__ */ p("div", {
588
+ children: [/* @__PURE__ */ f(ze, { className: "size-4" }), m("billing.checkout.itemsPurchased", "Items Purchased")]
589
+ }), /* @__PURE__ */ f("div", {
570
590
  className: "space-y-2",
571
- children: L.items.map((t) => /* @__PURE__ */ m("div", {
591
+ children: F.items.map((t) => /* @__PURE__ */ p("div", {
572
592
  className: "flex items-center justify-between",
573
- children: [/* @__PURE__ */ m("div", {
593
+ children: [/* @__PURE__ */ p("div", {
574
594
  className: "flex items-center gap-2",
575
595
  children: [
576
- t.type === "PLAN" && /* @__PURE__ */ p(Fe, { className: "size-4 text-accent-blue" }),
577
- t.type === "ADDON" && /* @__PURE__ */ p(je, { className: "size-4 text-accent-purple" }),
578
- t.type === "CREDITS" && /* @__PURE__ */ p(Ne, { className: "size-4 text-status-warning-text" }),
579
- t.type === "ORDER" && /* @__PURE__ */ p(Re, { className: "size-4 text-status-success-text" }),
580
- /* @__PURE__ */ p("span", {
596
+ t.type === "PLAN" && /* @__PURE__ */ f(Re, { className: "size-4 text-accent-blue" }),
597
+ t.type === "ADDON" && /* @__PURE__ */ f(Ne, { className: "size-4 text-accent-purple" }),
598
+ t.type === "CREDITS" && /* @__PURE__ */ f(Fe, { className: "size-4 text-status-warning-text" }),
599
+ t.type === "ORDER" && /* @__PURE__ */ f(Ve, { className: "size-4 text-status-success-text" }),
600
+ /* @__PURE__ */ f("span", {
581
601
  className: "text-foreground",
582
602
  children: t.name
583
603
  }),
584
- t.quantity > 1 && /* @__PURE__ */ m("span", {
604
+ t.quantity > 1 && /* @__PURE__ */ p("span", {
585
605
  className: "text-xs text-muted-foreground",
586
606
  children: ["x", t.quantity]
587
607
  })
588
608
  ]
589
- }), /* @__PURE__ */ p("span", {
609
+ }), /* @__PURE__ */ f("span", {
590
610
  className: "text-muted-foreground",
591
611
  children: e(t.price * t.quantity)
592
612
  })]
593
613
  }, t.id))
594
614
  })]
595
615
  }),
596
- /* @__PURE__ */ p("div", {
616
+ /* @__PURE__ */ f("div", {
597
617
  className: "p-4 border-b border-border bg-muted/30",
598
- children: /* @__PURE__ */ m("div", {
618
+ children: /* @__PURE__ */ p("div", {
599
619
  className: "grid grid-cols-2 gap-4",
600
- children: [/* @__PURE__ */ m("div", { children: [/* @__PURE__ */ p("p", {
620
+ children: [/* @__PURE__ */ p("div", { children: [/* @__PURE__ */ f("p", {
601
621
  className: "text-xs text-muted-foreground mb-1",
602
- children: h("billing.checkout.paymentMethod", "Payment Method")
603
- }), /* @__PURE__ */ p("div", {
622
+ children: m("billing.checkout.paymentMethod", "Payment Method")
623
+ }), /* @__PURE__ */ f("div", {
604
624
  className: "flex items-center gap-2",
605
- children: L.paymentMethod === "credits" ? /* @__PURE__ */ m(f, { children: [/* @__PURE__ */ p(ze, { className: "size-4 text-status-warning-text" }), /* @__PURE__ */ p("span", {
625
+ children: F.paymentMethod === "credits" ? /* @__PURE__ */ p(d, { children: [/* @__PURE__ */ f(He, { className: "size-4 text-status-warning-text" }), /* @__PURE__ */ f("span", {
606
626
  className: "font-medium text-foreground",
607
- children: h("billing.checkout.credits", "Credits")
608
- })] }) : /* @__PURE__ */ m(f, { children: [/* @__PURE__ */ p(Pe, { className: "size-4 text-accent-blue" }), /* @__PURE__ */ p("span", {
627
+ children: m("billing.checkout.credits", "Credits")
628
+ })] }) : /* @__PURE__ */ p(d, { children: [/* @__PURE__ */ f(Ie, { className: "size-4 text-accent-blue" }), /* @__PURE__ */ f("span", {
609
629
  className: "font-medium text-foreground",
610
- children: h("billing.checkout.card", "Card")
630
+ children: m("billing.checkout.card", "Card")
611
631
  })] })
612
- })] }), /* @__PURE__ */ m("div", {
632
+ })] }), /* @__PURE__ */ p("div", {
613
633
  className: "text-right",
614
- children: [/* @__PURE__ */ p("p", {
634
+ children: [/* @__PURE__ */ f("p", {
615
635
  className: "text-xs text-muted-foreground mb-1",
616
- children: h("billing.checkout.totalPaid", "Total Paid")
617
- }), /* @__PURE__ */ p("p", {
636
+ children: m("billing.checkout.totalPaid", "Total Paid")
637
+ }), /* @__PURE__ */ f("p", {
618
638
  className: "font-bold text-lg text-foreground",
619
- children: e(L.total)
639
+ children: e(F.total)
620
640
  })]
621
641
  })]
622
642
  })
623
643
  }),
624
- L.paymentMethod === "credits" && /* @__PURE__ */ m("div", {
644
+ F.paymentMethod === "credits" && /* @__PURE__ */ p("div", {
625
645
  className: "p-4 border-b border-border",
626
- children: [/* @__PURE__ */ m("h3", {
646
+ children: [/* @__PURE__ */ p("h3", {
627
647
  className: "font-semibold text-foreground mb-3 flex items-center gap-2",
628
- children: [/* @__PURE__ */ p(ze, { className: "size-4" }), h("billing.checkout.creditBalance", "Credit Balance")]
629
- }), /* @__PURE__ */ m("div", {
648
+ children: [/* @__PURE__ */ f(He, { className: "size-4" }), m("billing.checkout.creditBalance", "Credit Balance")]
649
+ }), /* @__PURE__ */ p("div", {
630
650
  className: "flex items-center gap-4",
631
651
  children: [
632
- /* @__PURE__ */ m("div", {
652
+ /* @__PURE__ */ p("div", {
633
653
  className: "flex-1 text-center p-3 rounded-lg bg-muted/50",
634
- children: [/* @__PURE__ */ p("p", {
654
+ children: [/* @__PURE__ */ f("p", {
635
655
  className: "text-xs text-muted-foreground mb-1",
636
- children: h("billing.checkout.previousBalance", "Previous Balance")
637
- }), /* @__PURE__ */ p("p", {
656
+ children: m("billing.checkout.previousBalance", "Previous Balance")
657
+ }), /* @__PURE__ */ f("p", {
638
658
  className: "font-semibold text-foreground",
639
- children: t(L.previousBalance)
659
+ children: t(F.previousBalance)
640
660
  })]
641
661
  }),
642
- /* @__PURE__ */ p(Ae, { className: "size-5 text-muted-foreground shrink-0" }),
643
- /* @__PURE__ */ m("div", {
662
+ /* @__PURE__ */ f(Me, { className: "size-5 text-muted-foreground shrink-0" }),
663
+ /* @__PURE__ */ p("div", {
644
664
  className: "flex-1 text-center p-3 rounded-lg bg-status-success-bg-subtle",
645
- children: [/* @__PURE__ */ p("p", {
665
+ children: [/* @__PURE__ */ f("p", {
646
666
  className: "text-xs text-muted-foreground mb-1",
647
- children: h("billing.checkout.newBalance", "New Balance")
648
- }), /* @__PURE__ */ p("p", {
667
+ children: m("billing.checkout.newBalance", "New Balance")
668
+ }), /* @__PURE__ */ f("p", {
649
669
  className: "font-semibold text-status-success-text",
650
- children: t(L.newBalance)
670
+ children: t(F.newBalance)
651
671
  })]
652
672
  })
653
673
  ]
654
674
  })]
655
675
  }),
656
- /* @__PURE__ */ p("div", {
676
+ /* @__PURE__ */ f("div", {
657
677
  className: "p-4 bg-muted/20",
658
- children: /* @__PURE__ */ m("div", {
678
+ children: /* @__PURE__ */ p("div", {
659
679
  className: "flex items-center justify-between",
660
- children: [/* @__PURE__ */ m("div", { children: [/* @__PURE__ */ p("p", {
680
+ children: [/* @__PURE__ */ p("div", { children: [/* @__PURE__ */ f("p", {
661
681
  className: "text-xs text-muted-foreground mb-1",
662
- children: h("billing.checkout.billingAccount", "Billing Account")
663
- }), /* @__PURE__ */ p("p", {
682
+ children: m("billing.checkout.billingAccount", "Billing Account")
683
+ }), /* @__PURE__ */ f("p", {
664
684
  className: "font-medium text-foreground",
665
- children: L.billingAccountName
666
- })] }), L.transactionId && /* @__PURE__ */ m("div", {
685
+ children: F.billingAccountName
686
+ })] }), F.transactionId && /* @__PURE__ */ p("div", {
667
687
  className: "text-right",
668
- children: [/* @__PURE__ */ p("p", {
688
+ children: [/* @__PURE__ */ f("p", {
669
689
  className: "text-xs text-muted-foreground mb-1",
670
- children: h("billing.checkout.transactionId", "Transaction ID")
671
- }), /* @__PURE__ */ m("p", {
690
+ children: m("billing.checkout.transactionId", "Transaction ID")
691
+ }), /* @__PURE__ */ p("p", {
672
692
  className: "font-mono text-xs text-muted-foreground",
673
- children: [L.transactionId.slice(0, 8), "..."]
693
+ children: [F.transactionId.slice(0, 8), "..."]
674
694
  })]
675
695
  })]
676
696
  })
677
697
  })
678
698
  ]
679
699
  }),
680
- /* @__PURE__ */ m("div", {
700
+ /* @__PURE__ */ p("div", {
681
701
  className: "flex flex-col sm:flex-row gap-3 justify-center pt-2",
682
- children: [/* @__PURE__ */ p("button", {
702
+ children: [/* @__PURE__ */ f("button", {
683
703
  type: "button",
684
- onClick: () => v("/overview"),
704
+ onClick: () => g("/overview"),
685
705
  className: "px-6 py-3 text-sm font-medium bg-primary text-primary-foreground rounded-lg hover:bg-primary/90 transition-colors",
686
- children: h("billing.checkout.backToOverview", "Back to Overview")
687
- }), /* @__PURE__ */ p("button", {
706
+ children: m("billing.checkout.backToOverview", "Back to Overview")
707
+ }), /* @__PURE__ */ f("button", {
688
708
  type: "button",
689
- onClick: () => v("/subscriptions"),
709
+ onClick: () => g("/subscriptions"),
690
710
  className: "px-6 py-3 text-sm font-medium border border-border text-foreground rounded-lg hover:bg-muted transition-colors",
691
- children: h("billing.checkout.viewSubscriptions", "View Subscriptions")
711
+ children: m("billing.checkout.viewSubscriptions", "View Subscriptions")
692
712
  })]
693
713
  })
694
714
  ]
695
- });
715
+ }), ut && dt.length > 0 && x && pt && /* @__PURE__ */ f(Ee, {
716
+ billingAccountId: F?.billingAccountId ?? "",
717
+ subscriptionId: pt,
718
+ quotas: dt,
719
+ workspaces: ot,
720
+ currentWorkspaceId: x,
721
+ onAssigned: () => k(!1),
722
+ onSkip: () => k(!1)
723
+ })] });
696
724
  }
697
- if (M === "error") return /* @__PURE__ */ p("div", {
725
+ if (A === "error") return /* @__PURE__ */ f("div", {
698
726
  className: "max-w-lg mx-auto p-6",
699
- children: /* @__PURE__ */ m("div", {
727
+ children: /* @__PURE__ */ p("div", {
700
728
  className: "text-center space-y-6",
701
729
  children: [
702
- /* @__PURE__ */ p("div", {
730
+ /* @__PURE__ */ f("div", {
703
731
  className: "inline-flex p-4 rounded-full bg-destructive/10 text-destructive",
704
- children: /* @__PURE__ */ p(Be, { className: "size-12" })
732
+ children: /* @__PURE__ */ f(Ue, { className: "size-12" })
705
733
  }),
706
- /* @__PURE__ */ m("div", { children: [/* @__PURE__ */ p("h1", {
734
+ /* @__PURE__ */ p("div", { children: [/* @__PURE__ */ f("h1", {
707
735
  className: "text-2xl font-bold text-foreground",
708
- children: h("billing.checkout.paymentFailed", "Payment Failed")
709
- }), /* @__PURE__ */ p("p", {
736
+ children: m("billing.checkout.paymentFailed", "Payment Failed")
737
+ }), /* @__PURE__ */ f("p", {
710
738
  className: "text-muted-foreground mt-2",
711
- children: rt || dt || B.error || h("billing.checkout.genericError", "Something went wrong. Please try again.")
739
+ children: ht || bt || z.error || m("billing.checkout.genericError", "Something went wrong. Please try again.")
712
740
  })] }),
713
- /* @__PURE__ */ m("div", {
741
+ /* @__PURE__ */ p("div", {
714
742
  className: "flex gap-3 justify-center",
715
- children: [/* @__PURE__ */ p("button", {
743
+ children: [/* @__PURE__ */ f("button", {
716
744
  type: "button",
717
- onClick: () => v(-1),
745
+ onClick: () => g(-1),
718
746
  className: "px-4 py-2 rounded-lg border border-border hover:bg-muted",
719
- children: h("billing.checkout.goBack", "Go Back")
720
- }), /* @__PURE__ */ p("button", {
747
+ children: m("billing.checkout.goBack", "Go Back")
748
+ }), /* @__PURE__ */ f("button", {
721
749
  type: "button",
722
750
  onClick: () => {
723
- N("select"), I(null), B.reset();
751
+ j("select"), P(null), z.reset();
724
752
  },
725
753
  className: "px-4 py-2 rounded-lg bg-primary text-primary-foreground hover:bg-primary/90",
726
- children: h("billing.checkout.tryAgain", "Try Again")
754
+ children: m("billing.checkout.tryAgain", "Try Again")
727
755
  })]
728
756
  })
729
757
  ]
730
758
  })
731
759
  });
732
- if (M === "processing") return /* @__PURE__ */ p("div", {
760
+ if (A === "processing") return /* @__PURE__ */ f("div", {
733
761
  className: "max-w-lg mx-auto p-6",
734
- children: /* @__PURE__ */ m("div", {
762
+ children: /* @__PURE__ */ p("div", {
735
763
  className: "text-center space-y-6",
736
764
  children: [
737
- /* @__PURE__ */ p("div", {
765
+ /* @__PURE__ */ f("div", {
738
766
  className: "inline-flex p-4 rounded-full bg-primary/10 text-primary",
739
- children: /* @__PURE__ */ p(d, { className: "size-12 animate-spin" })
767
+ children: /* @__PURE__ */ f(Le, { className: "size-12 animate-spin" })
740
768
  }),
741
- /* @__PURE__ */ m("div", { children: [/* @__PURE__ */ p("h1", {
769
+ /* @__PURE__ */ p("div", { children: [/* @__PURE__ */ f("h1", {
742
770
  className: "text-2xl font-bold text-foreground",
743
- children: h("billing.checkout.verifyingPayment", "Verifying Payment")
744
- }), /* @__PURE__ */ p("p", {
771
+ children: m("billing.checkout.verifyingPayment", "Verifying Payment")
772
+ }), /* @__PURE__ */ f("p", {
745
773
  className: "text-muted-foreground mt-2",
746
- children: h("billing.checkout.verifyingPaymentDescription", "Please wait while we confirm your payment...")
774
+ children: m("billing.checkout.verifyingPaymentDescription", "Please wait while we confirm your payment...")
747
775
  })] }),
748
- /* @__PURE__ */ m("div", {
776
+ /* @__PURE__ */ p("div", {
749
777
  className: "bg-muted/50 rounded-lg p-4",
750
- children: [/* @__PURE__ */ m("p", {
778
+ children: [/* @__PURE__ */ p("p", {
751
779
  className: "text-sm text-muted-foreground",
752
780
  children: [
753
- h("billing.checkout.timeElapsed", "Time elapsed:"),
781
+ m("billing.checkout.timeElapsed", "Time elapsed:"),
754
782
  " ",
755
- /* @__PURE__ */ p("span", {
783
+ /* @__PURE__ */ f("span", {
756
784
  className: "font-mono font-medium text-foreground",
757
785
  children: ((e) => {
758
786
  let t = Math.floor(e / 1e3);
759
787
  return `${Math.floor(t / 60)}:${(t % 60).toString().padStart(2, "0")}`;
760
- })(ut)
788
+ })(V)
761
789
  })
762
790
  ]
763
- }), /* @__PURE__ */ p("p", {
791
+ }), /* @__PURE__ */ f("p", {
764
792
  className: "text-xs text-muted-foreground mt-1",
765
- children: h("billing.checkout.keepPageOpen", "This may take a few moments. Please don't close this page.")
793
+ children: m("billing.checkout.keepPageOpen", "This may take a few moments. Please don't close this page.")
766
794
  })]
767
795
  }),
768
- /* @__PURE__ */ p("div", {
796
+ /* @__PURE__ */ f("div", {
769
797
  className: "w-full bg-muted rounded-full h-2 overflow-hidden",
770
- children: /* @__PURE__ */ p("div", {
798
+ children: /* @__PURE__ */ f("div", {
771
799
  className: "bg-primary h-2 rounded-full transition-all duration-1000",
772
- style: { width: `${Math.min(ut / 3e5 * 100, 100)}%` }
800
+ style: { width: `${Math.min(V / 3e5 * 100, 100)}%` }
773
801
  })
774
802
  }),
775
- ut > 3e4 && /* @__PURE__ */ p("button", {
803
+ V > 3e4 && /* @__PURE__ */ f("button", {
776
804
  type: "button",
777
805
  onClick: () => {
778
- N("error"), I("Payment verification was cancelled. Please check your billing history.");
806
+ j("error"), P("Payment verification was cancelled. Please check your billing history.");
779
807
  },
780
808
  className: "text-sm text-muted-foreground hover:text-foreground underline",
781
- children: h("billing.checkout.cancelAndCheckHistory", "Cancel and check billing history")
809
+ children: m("billing.checkout.cancelAndCheckHistory", "Cancel and check billing history")
782
810
  })
783
811
  ]
784
812
  })
785
813
  });
786
- if (M === "payment" && P) {
814
+ if (A === "payment" && M) {
787
815
  let e = (e, t) => `${{
788
816
  INR: "₹",
789
817
  USD: "$",
790
818
  EUR: "€",
791
819
  GBP: "£"
792
- }[t] || t + " "}${e.toFixed(2)}`, t = P.currency || B.selectedCurrency, r = P.total ?? B.total;
793
- return /* @__PURE__ */ m("div", {
820
+ }[t] || t + " "}${e.toFixed(2)}`, t = M.currency || z.selectedCurrency, r = M.total ?? z.total;
821
+ return /* @__PURE__ */ p("div", {
794
822
  className: "max-w-2xl mx-auto p-4 sm:p-6 space-y-6",
795
823
  children: [
796
- /* @__PURE__ */ m("button", {
824
+ /* @__PURE__ */ p("button", {
797
825
  type: "button",
798
- onClick: () => N("select"),
826
+ onClick: () => j("select"),
799
827
  className: "flex items-center gap-2 text-sm text-muted-foreground hover:text-foreground",
800
- children: [/* @__PURE__ */ p(ke, { className: "size-4" }), h("billing.checkout.backToCheckout", "Back to checkout")]
828
+ children: [/* @__PURE__ */ f(je, { className: "size-4" }), m("billing.checkout.backToCheckout", "Back to checkout")]
801
829
  }),
802
- /* @__PURE__ */ p(n, {
803
- title: h("billing.checkout.completePayment", "Complete Payment"),
804
- description: h("billing.checkout.completePaymentDescription", "Enter your payment details to complete the purchase")
830
+ /* @__PURE__ */ f(n, {
831
+ title: m("billing.checkout.completePayment", "Complete Payment"),
832
+ description: m("billing.checkout.completePaymentDescription", "Enter your payment details to complete the purchase")
805
833
  }),
806
- /* @__PURE__ */ m("div", {
834
+ /* @__PURE__ */ p("div", {
807
835
  className: "rounded-lg border border-border bg-card p-4 space-y-4",
808
836
  children: [
809
- /* @__PURE__ */ m("h3", {
837
+ /* @__PURE__ */ p("h3", {
810
838
  className: "font-semibold text-foreground flex items-center gap-2",
811
- children: [/* @__PURE__ */ p(Ie, { className: "size-4" }), h("billing.checkout.paymentSummary", "Payment Summary")]
839
+ children: [/* @__PURE__ */ f(ze, { className: "size-4" }), m("billing.checkout.paymentSummary", "Payment Summary")]
812
840
  }),
813
- B.billingAccount && /* @__PURE__ */ m("div", {
841
+ z.billingAccount && /* @__PURE__ */ p("div", {
814
842
  className: "p-3 bg-muted/30 rounded-lg space-y-1",
815
843
  children: [
816
- /* @__PURE__ */ p("div", {
844
+ /* @__PURE__ */ f("div", {
817
845
  className: "text-xs text-muted-foreground uppercase tracking-wide",
818
- children: h("billing.checkout.billingAccount", "Billing Account")
846
+ children: m("billing.checkout.billingAccount", "Billing Account")
819
847
  }),
820
- /* @__PURE__ */ p("div", {
848
+ /* @__PURE__ */ f("div", {
821
849
  className: "font-medium text-foreground",
822
- children: B.billingAccount.name
850
+ children: z.billingAccount.name
823
851
  }),
824
- /* @__PURE__ */ p("div", {
852
+ /* @__PURE__ */ f("div", {
825
853
  className: "text-sm text-muted-foreground",
826
- children: B.billingAccount.email
854
+ children: z.billingAccount.email
827
855
  })
828
856
  ]
829
857
  }),
830
- O === "ADDON" && B.selectedSubscriptionId && G && /* @__PURE__ */ m("div", {
858
+ E === "ADDON" && z.selectedSubscriptionId && K && /* @__PURE__ */ p("div", {
831
859
  className: "p-3 bg-muted/30 rounded-lg space-y-1",
832
860
  children: [
833
- /* @__PURE__ */ p("div", {
861
+ /* @__PURE__ */ f("div", {
834
862
  className: "text-xs text-muted-foreground uppercase tracking-wide",
835
- children: h("billing.checkout.addingToSubscription", "Adding to Subscription")
863
+ children: m("billing.checkout.addingToSubscription", "Adding to Subscription")
836
864
  }),
837
- /* @__PURE__ */ p("div", {
865
+ /* @__PURE__ */ f("div", {
838
866
  className: "font-medium text-foreground",
839
- children: G.plan?.name || h("billing.checkout.subscription", "Subscription")
867
+ children: K.plan?.name || m("billing.checkout.subscription", "Subscription")
840
868
  }),
841
- G.plan?.product?.name && /* @__PURE__ */ p("div", {
869
+ K.plan?.product?.name && /* @__PURE__ */ f("div", {
842
870
  className: "text-sm text-muted-foreground",
843
- children: G.plan.product.name
871
+ children: K.plan.product.name
844
872
  })
845
873
  ]
846
874
  }),
847
- /* @__PURE__ */ m("div", {
875
+ /* @__PURE__ */ p("div", {
848
876
  className: "space-y-2 text-sm",
849
877
  children: [
850
878
  (() => {
851
- let n = B.taxRate, i = n > 0 ? r / (1 + n) : r, a = n > 0 ? r - i : 0;
852
- return /* @__PURE__ */ m(f, { children: [
853
- /* @__PURE__ */ m("div", {
879
+ let n = z.taxRate, i = n > 0 ? r / (1 + n) : r, a = n > 0 ? r - i : 0;
880
+ return /* @__PURE__ */ p(d, { children: [
881
+ /* @__PURE__ */ p("div", {
854
882
  className: "flex justify-between",
855
- children: [/* @__PURE__ */ p("span", {
883
+ children: [/* @__PURE__ */ f("span", {
856
884
  className: "text-muted-foreground",
857
- children: h("billing.checkout.subtotal", "Subtotal")
858
- }), /* @__PURE__ */ p("span", {
885
+ children: m("billing.checkout.subtotal", "Subtotal")
886
+ }), /* @__PURE__ */ f("span", {
859
887
  className: "text-foreground",
860
888
  children: e(i, t)
861
889
  })]
862
890
  }),
863
- B.discountAmount > 0 && /* @__PURE__ */ m("div", {
891
+ z.discountAmount > 0 && /* @__PURE__ */ p("div", {
864
892
  className: "flex justify-between text-status-success-text",
865
- children: [/* @__PURE__ */ p("span", { children: h("billing.checkout.discount", "Discount") }), /* @__PURE__ */ m("span", { children: ["-", e(B.discountAmount, t)] })]
893
+ children: [/* @__PURE__ */ f("span", { children: m("billing.checkout.discount", "Discount") }), /* @__PURE__ */ p("span", { children: ["-", e(z.discountAmount, t)] })]
866
894
  }),
867
- a > 0 && /* @__PURE__ */ m("div", {
895
+ a > 0 && /* @__PURE__ */ p("div", {
868
896
  className: "flex justify-between",
869
- children: [/* @__PURE__ */ m("span", {
897
+ children: [/* @__PURE__ */ p("span", {
870
898
  className: "text-muted-foreground",
871
899
  children: [
872
- B.taxType || h("billing.checkout.tax", "Tax"),
900
+ z.taxType || m("billing.checkout.tax", "Tax"),
873
901
  " (",
874
902
  (n * 100).toFixed(0),
875
903
  "%)"
876
904
  ]
877
- }), /* @__PURE__ */ p("span", {
905
+ }), /* @__PURE__ */ f("span", {
878
906
  className: "text-foreground",
879
907
  children: e(a, t)
880
908
  })]
881
909
  })
882
910
  ] });
883
911
  })(),
884
- /* @__PURE__ */ p("div", { className: "border-t border-border my-2" }),
885
- /* @__PURE__ */ m("div", {
912
+ /* @__PURE__ */ f("div", { className: "border-t border-border my-2" }),
913
+ /* @__PURE__ */ p("div", {
886
914
  className: "flex justify-between font-semibold",
887
- children: [/* @__PURE__ */ p("span", {
915
+ children: [/* @__PURE__ */ f("span", {
888
916
  className: "text-foreground",
889
- children: h("billing.checkout.total", "Total")
890
- }), /* @__PURE__ */ p("span", {
917
+ children: m("billing.checkout.total", "Total")
918
+ }), /* @__PURE__ */ f("span", {
891
919
  className: "text-lg text-foreground",
892
920
  children: e(r, t)
893
921
  })]
@@ -896,278 +924,278 @@ var Ke = () => {
896
924
  })
897
925
  ]
898
926
  }),
899
- B.selectedProvider === "STRIPE" && P.clientSecret && /* @__PURE__ */ p("div", {
927
+ z.selectedProvider === "STRIPE" && M.clientSecret && /* @__PURE__ */ f("div", {
900
928
  className: "rounded-lg border border-border bg-card overflow-hidden",
901
- children: /* @__PURE__ */ p("div", {
929
+ children: /* @__PURE__ */ f("div", {
902
930
  className: "p-4 space-y-4",
903
- children: /* @__PURE__ */ p(ye, {
904
- clientSecret: P.clientSecret,
905
- publishableKey: Ye || st?.stripePublishableKey || "",
906
- amount: Math.round((P.total ?? B.total) * 100),
907
- currency: P.currency || B.selectedCurrency,
908
- onSuccess: Dt,
909
- onError: Ot,
910
- onCancel: () => N("select"),
911
- isCompletingExistingPayment: !!B.selectedPaymentMethodId
931
+ children: /* @__PURE__ */ f(ye, {
932
+ clientSecret: M.clientSecret,
933
+ publishableKey: $e || vt?.stripePublishableKey || "",
934
+ amount: Math.round((M.total ?? z.total) * 100),
935
+ currency: M.currency || z.selectedCurrency,
936
+ onSuccess: Rt,
937
+ onError: zt,
938
+ onCancel: () => j("select"),
939
+ isCompletingExistingPayment: !!z.selectedPaymentMethodId
912
940
  })
913
941
  })
914
942
  }),
915
- B.selectedProvider === "RAZORPAY" && P.orderId && /* @__PURE__ */ p("div", {
943
+ z.selectedProvider === "RAZORPAY" && M.orderId && /* @__PURE__ */ f("div", {
916
944
  className: "rounded-lg border border-border bg-card overflow-hidden",
917
- children: /* @__PURE__ */ m("div", {
945
+ children: /* @__PURE__ */ p("div", {
918
946
  className: "p-4 space-y-4",
919
- children: [/* @__PURE__ */ m("label", {
947
+ children: [/* @__PURE__ */ p("label", {
920
948
  className: "flex items-center gap-2 cursor-pointer",
921
- children: [/* @__PURE__ */ p("input", {
949
+ children: [/* @__PURE__ */ f("input", {
922
950
  type: "checkbox",
923
- checked: B.saveCard,
924
- onChange: (e) => B.setSaveCard(e.target.checked),
951
+ checked: z.saveCard,
952
+ onChange: (e) => z.setSaveCard(e.target.checked),
925
953
  className: "size-4 rounded border-border text-primary focus:ring-primary"
926
- }), /* @__PURE__ */ p("span", {
954
+ }), /* @__PURE__ */ f("span", {
927
955
  className: "text-sm text-muted-foreground",
928
956
  children: "Save card for future purchases"
929
957
  })]
930
- }), /* @__PURE__ */ p(be, {
931
- orderId: P.orderId,
932
- keyId: P.razorpayKeyId || Xe || "",
933
- amount: Math.round((P.total ?? B.total) * 100),
934
- currency: P.currency || "INR",
935
- customerId: P.razorpayCustomerId,
958
+ }), /* @__PURE__ */ f(be, {
959
+ orderId: M.orderId,
960
+ keyId: M.razorpayKeyId || et || "",
961
+ amount: Math.round((M.total ?? z.total) * 100),
962
+ currency: M.currency || "INR",
963
+ customerId: M.razorpayCustomerId,
936
964
  prefill: {
937
- name: P.prefillName,
938
- email: P.prefillEmail,
939
- contact: P.prefillContact
965
+ name: M.prefillName,
966
+ email: M.prefillEmail,
967
+ contact: M.prefillContact
940
968
  },
941
- onSuccess: (e) => Dt(e.razorpay_payment_id),
942
- onError: Ot,
943
- onCancel: () => N("select")
969
+ onSuccess: (e) => Rt(e.razorpay_payment_id),
970
+ onError: zt,
971
+ onCancel: () => j("select")
944
972
  })]
945
973
  })
946
974
  })
947
975
  ]
948
976
  });
949
977
  }
950
- return /* @__PURE__ */ m("div", {
978
+ return /* @__PURE__ */ p("div", {
951
979
  className: "max-w-6xl mx-auto p-4 sm:p-6",
952
980
  children: [
953
- /* @__PURE__ */ m("button", {
981
+ /* @__PURE__ */ p("button", {
954
982
  type: "button",
955
- onClick: () => v(-1),
983
+ onClick: () => g(-1),
956
984
  className: "flex items-center gap-2 text-sm text-muted-foreground hover:text-foreground mb-4",
957
- children: [/* @__PURE__ */ p(ke, { className: "size-4" }), "Back"]
985
+ children: [/* @__PURE__ */ f(je, { className: "size-4" }), "Back"]
958
986
  }),
959
- /* @__PURE__ */ m("div", {
987
+ /* @__PURE__ */ p("div", {
960
988
  className: "flex items-center gap-3 mb-6",
961
- children: [/* @__PURE__ */ p("div", {
989
+ children: [/* @__PURE__ */ f("div", {
962
990
  className: "p-2 rounded-lg bg-primary/10 text-primary",
963
- children: Mt()
964
- }), /* @__PURE__ */ m("div", { children: [/* @__PURE__ */ p("h1", {
991
+ children: Ut()
992
+ }), /* @__PURE__ */ p("div", { children: [/* @__PURE__ */ f("h1", {
965
993
  className: "text-2xl font-bold text-foreground",
966
- children: jt()
967
- }), /* @__PURE__ */ p("p", {
994
+ children: Ht()
995
+ }), /* @__PURE__ */ f("p", {
968
996
  className: "text-sm text-muted-foreground",
969
997
  children: "Complete your purchase securely"
970
998
  })] })]
971
999
  }),
972
- b?.upgradeFromSubscriptionId && b?.currentPlanName && /* @__PURE__ */ p("div", {
1000
+ v?.upgradeFromSubscriptionId && v?.currentPlanName && /* @__PURE__ */ f("div", {
973
1001
  className: "mb-6 p-4 rounded-lg border border-border-subtle bg-status-info-bg-subtle",
974
- children: /* @__PURE__ */ m("div", {
1002
+ children: /* @__PURE__ */ p("div", {
975
1003
  className: "flex items-center gap-3",
976
- children: [/* @__PURE__ */ p("div", {
1004
+ children: [/* @__PURE__ */ f("div", {
977
1005
  className: "p-2 rounded-full bg-status-info-bg-subtle",
978
- children: /* @__PURE__ */ p(Le, { className: "size-4 text-accent-blue" })
979
- }), /* @__PURE__ */ m("div", {
1006
+ children: /* @__PURE__ */ f(Be, { className: "size-4 text-accent-blue" })
1007
+ }), /* @__PURE__ */ p("div", {
980
1008
  className: "flex-1",
981
- children: [/* @__PURE__ */ m("p", {
1009
+ children: [/* @__PURE__ */ p("p", {
982
1010
  className: "text-sm font-medium text-status-info-text",
983
1011
  children: [
984
1012
  "Upgrading from:",
985
1013
  " ",
986
- /* @__PURE__ */ p("span", {
1014
+ /* @__PURE__ */ f("span", {
987
1015
  className: "font-semibold",
988
- children: b.currentPlanName
1016
+ children: v.currentPlanName
989
1017
  })
990
1018
  ]
991
- }), /* @__PURE__ */ p("p", {
1019
+ }), /* @__PURE__ */ f("p", {
992
1020
  className: "text-xs text-status-info-text mt-0.5",
993
1021
  children: "Your current subscription will be marked as upgraded and quotas will transfer to the new plan."
994
1022
  })]
995
1023
  })]
996
1024
  })
997
1025
  }),
998
- b?.downgradeFromSubscriptionId && b?.currentPlanName && /* @__PURE__ */ p("div", {
1026
+ v?.downgradeFromSubscriptionId && v?.currentPlanName && /* @__PURE__ */ f("div", {
999
1027
  className: "mb-6 p-4 rounded-lg border border-status-warning-border bg-status-warning-bg-subtle",
1000
- children: /* @__PURE__ */ m("div", {
1028
+ children: /* @__PURE__ */ p("div", {
1001
1029
  className: "flex items-center gap-3",
1002
- children: [/* @__PURE__ */ p("div", {
1030
+ children: [/* @__PURE__ */ f("div", {
1003
1031
  className: "p-2 rounded-full bg-status-warning-bg-subtle",
1004
- children: /* @__PURE__ */ p(Le, { className: "size-4 text-status-warning-text" })
1005
- }), /* @__PURE__ */ m("div", {
1032
+ children: /* @__PURE__ */ f(Be, { className: "size-4 text-status-warning-text" })
1033
+ }), /* @__PURE__ */ p("div", {
1006
1034
  className: "flex-1",
1007
- children: [/* @__PURE__ */ m("p", {
1035
+ children: [/* @__PURE__ */ p("p", {
1008
1036
  className: "text-sm font-medium text-status-warning-text",
1009
1037
  children: [
1010
1038
  "Downgrading from:",
1011
1039
  " ",
1012
- /* @__PURE__ */ p("span", {
1040
+ /* @__PURE__ */ f("span", {
1013
1041
  className: "font-semibold",
1014
- children: b.currentPlanName
1042
+ children: v.currentPlanName
1015
1043
  })
1016
1044
  ]
1017
- }), /* @__PURE__ */ p("p", {
1045
+ }), /* @__PURE__ */ f("p", {
1018
1046
  className: "text-xs text-status-warning-text mt-0.5",
1019
1047
  children: "Your current plan stays active until it expires, you keep all its features until then. After expiry, only the new plan applies."
1020
1048
  })]
1021
1049
  })]
1022
1050
  })
1023
1051
  }),
1024
- /* @__PURE__ */ m("div", {
1052
+ /* @__PURE__ */ p("div", {
1025
1053
  className: "grid gap-6 lg:grid-cols-5",
1026
- children: [/* @__PURE__ */ m("div", {
1054
+ children: [/* @__PURE__ */ p("div", {
1027
1055
  className: "lg:col-span-3 space-y-6 order-2 lg:order-1",
1028
1056
  children: [
1029
- O === "CREDITS" && B.items[0] && /* @__PURE__ */ p("div", {
1057
+ E === "CREDITS" && z.items[0] && /* @__PURE__ */ f("div", {
1030
1058
  className: "rounded-lg border border-border bg-card p-4 sm:p-6",
1031
- children: /* @__PURE__ */ p(ve, {
1032
- value: B.items[0].quantity,
1033
- onChange: kt,
1059
+ children: /* @__PURE__ */ f(ve, {
1060
+ value: z.items[0].quantity,
1061
+ onChange: Bt,
1034
1062
  costPerCredit: J,
1035
- currency: B.selectedCurrency,
1036
- disabled: xt
1063
+ currency: z.selectedCurrency,
1064
+ disabled: Mt
1037
1065
  })
1038
1066
  }),
1039
- /* @__PURE__ */ m("div", {
1067
+ /* @__PURE__ */ p("div", {
1040
1068
  className: "rounded-lg border border-border bg-card p-4 sm:p-6 space-y-4",
1041
- children: [/* @__PURE__ */ p(he, {
1069
+ children: [/* @__PURE__ */ f(he, {
1042
1070
  accounts: X,
1043
- selectedAccountId: B.billingAccount?.id ?? null,
1044
- onSelect: B.setBillingAccount,
1045
- isLoading: pt,
1046
- disabled: wt,
1047
- disabledMessage: wt ? "Billing account is locked for plan changes" : void 0
1048
- }), O === "ADDON" && !D && B.billingAccount && /* @__PURE__ */ p(xe, {
1049
- subscriptions: W,
1050
- selectedSubscriptionId: B.selectedSubscriptionId,
1051
- onSelect: B.setSelectedSubscriptionId,
1052
- isLoading: bt
1071
+ selectedAccountId: z.billingAccount?.id ?? null,
1072
+ onSelect: z.setBillingAccount,
1073
+ isLoading: St,
1074
+ disabled: Ft,
1075
+ disabledMessage: Ft ? "Billing account is locked for plan changes" : void 0
1076
+ }), E === "ADDON" && !T && z.billingAccount && /* @__PURE__ */ f(xe, {
1077
+ subscriptions: G,
1078
+ selectedSubscriptionId: z.selectedSubscriptionId,
1079
+ onSelect: z.setSelectedSubscriptionId,
1080
+ isLoading: kt
1053
1081
  })]
1054
1082
  }),
1055
- /* @__PURE__ */ m("div", {
1083
+ /* @__PURE__ */ p("div", {
1056
1084
  className: "rounded-lg border border-border bg-card p-4 sm:p-6 space-y-4",
1057
1085
  children: [
1058
- /* @__PURE__ */ p(Ce, {
1086
+ /* @__PURE__ */ f(Ce, {
1059
1087
  savedPaymentMethods: Y,
1060
- selectedPaymentMethodId: B.selectedPaymentMethodId,
1061
- onSelectSavedCard: B.setSelectedPaymentMethodId,
1062
- selectedProvider: B.selectedProvider,
1063
- onSelectProvider: B.setPaymentProvider,
1064
- stripeEnabled: ct,
1065
- razorpayEnabled: lt,
1066
- canPayWithCredits: B.canPayWithCredits && B.hasEnoughCredits,
1067
- availableCredits: B.availableCredits,
1068
- totalAmount: B.subtotalUSD,
1088
+ selectedPaymentMethodId: z.selectedPaymentMethodId,
1089
+ onSelectSavedCard: z.setSelectedPaymentMethodId,
1090
+ selectedProvider: z.selectedProvider,
1091
+ onSelectProvider: z.setPaymentProvider,
1092
+ stripeEnabled: yt,
1093
+ razorpayEnabled: B,
1094
+ canPayWithCredits: z.canPayWithCredits && z.hasEnoughCredits,
1095
+ availableCredits: z.availableCredits,
1096
+ totalAmount: z.subtotalUSD,
1069
1097
  billingCountry: Z,
1070
- saveCard: B.saveCard,
1071
- onSaveCardChange: B.setSaveCard,
1072
- autoRenewEnabled: O === "PLAN" && B.autoRenew,
1073
- isLoading: vt
1098
+ saveCard: z.saveCard,
1099
+ onSaveCardChange: z.setSaveCard,
1100
+ autoRenewEnabled: E === "PLAN" && z.autoRenew,
1101
+ isLoading: Dt
1074
1102
  }),
1075
- B.selectedProvider !== "CREDITS" && B.selectedProvider !== "AUTO" && /* @__PURE__ */ m(f, { children: [/* @__PURE__ */ p("div", { className: "border-t border-border" }), /* @__PURE__ */ p("div", {
1103
+ z.selectedProvider !== "CREDITS" && z.selectedProvider !== "AUTO" && /* @__PURE__ */ p(d, { children: [/* @__PURE__ */ f("div", { className: "border-t border-border" }), /* @__PURE__ */ f("div", {
1076
1104
  className: "bg-muted/50 p-4 rounded-md",
1077
- children: /* @__PURE__ */ m("div", {
1105
+ children: /* @__PURE__ */ p("div", {
1078
1106
  className: "flex items-start gap-3",
1079
- children: [/* @__PURE__ */ p("svg", {
1107
+ children: [/* @__PURE__ */ f("svg", {
1080
1108
  className: "size-5 text-muted-foreground mt-0.5",
1081
1109
  fill: "none",
1082
1110
  stroke: "currentColor",
1083
1111
  viewBox: "0 0 24 24",
1084
- children: /* @__PURE__ */ p("path", {
1112
+ children: /* @__PURE__ */ f("path", {
1085
1113
  strokeLinecap: "round",
1086
1114
  strokeLinejoin: "round",
1087
1115
  strokeWidth: 2,
1088
1116
  d: "M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"
1089
1117
  })
1090
- }), /* @__PURE__ */ m("div", {
1118
+ }), /* @__PURE__ */ p("div", {
1091
1119
  className: "flex-1 text-sm",
1092
- children: [/* @__PURE__ */ m("p", {
1120
+ children: [/* @__PURE__ */ p("p", {
1093
1121
  className: "font-medium text-foreground mb-1",
1094
- children: ["Currency: ", B.selectedCurrency]
1095
- }), /* @__PURE__ */ m("p", {
1122
+ children: ["Currency: ", z.selectedCurrency]
1123
+ }), /* @__PURE__ */ p("p", {
1096
1124
  className: "text-muted-foreground text-xs",
1097
1125
  children: [
1098
1126
  "All prices are shown in",
1099
1127
  " ",
1100
- /* @__PURE__ */ p("strong", {
1128
+ /* @__PURE__ */ f("strong", {
1101
1129
  className: "text-foreground",
1102
- children: B.selectedCurrency
1130
+ children: z.selectedCurrency
1103
1131
  }),
1104
1132
  " ",
1105
1133
  "based on your billing account settings.",
1106
- B.selectedCurrency === "INR" && " GST will be applied at checkout."
1134
+ z.selectedCurrency === "INR" && " GST will be applied at checkout."
1107
1135
  ]
1108
1136
  })]
1109
1137
  })]
1110
1138
  })
1111
1139
  })] }),
1112
- O === "PLAN" && V?.getPlan?.pricingModel === "PER_SEAT" && /* @__PURE__ */ p("div", {
1140
+ E === "PLAN" && H?.getPlan?.pricingModel === "PER_SEAT" && /* @__PURE__ */ f("div", {
1113
1141
  className: "border-t border-border pt-4",
1114
- children: /* @__PURE__ */ m("div", {
1142
+ children: /* @__PURE__ */ p("div", {
1115
1143
  className: "space-y-3",
1116
- children: [/* @__PURE__ */ m("div", { children: [/* @__PURE__ */ p("label", {
1144
+ children: [/* @__PURE__ */ p("div", { children: [/* @__PURE__ */ f("label", {
1117
1145
  className: "text-sm font-medium text-foreground",
1118
1146
  children: "Number of seats"
1119
- }), V.getPlan.minSeats && /* @__PURE__ */ m("p", {
1147
+ }), H.getPlan.minSeats && /* @__PURE__ */ p("p", {
1120
1148
  className: "text-xs text-muted-foreground mt-0.5",
1121
1149
  children: [
1122
1150
  "Minimum ",
1123
- V.getPlan.minSeats,
1151
+ H.getPlan.minSeats,
1124
1152
  " seat",
1125
- V.getPlan.minSeats === 1 ? "" : "s",
1153
+ H.getPlan.minSeats === 1 ? "" : "s",
1126
1154
  " required"
1127
1155
  ]
1128
- })] }), /* @__PURE__ */ m("div", {
1156
+ })] }), /* @__PURE__ */ p("div", {
1129
1157
  className: "flex items-center gap-3",
1130
1158
  children: [
1131
- /* @__PURE__ */ p("button", {
1159
+ /* @__PURE__ */ f("button", {
1132
1160
  type: "button",
1133
- onClick: () => z((e) => Math.max(V.getPlan?.minSeats ?? 1, e - 1)),
1134
- disabled: R <= (V.getPlan.minSeats ?? 1),
1161
+ onClick: () => R((e) => Math.max(H.getPlan?.minSeats ?? 1, e - 1)),
1162
+ disabled: L <= (H.getPlan.minSeats ?? 1),
1135
1163
  className: "size-9 rounded-md border border-border flex items-center justify-center hover:bg-accent disabled:opacity-40 disabled:cursor-not-allowed transition-colors text-foreground",
1136
1164
  children: "−"
1137
1165
  }),
1138
- /* @__PURE__ */ p("input", {
1166
+ /* @__PURE__ */ f("input", {
1139
1167
  type: "number",
1140
- value: R,
1141
- min: V.getPlan.minSeats ?? 1,
1142
- max: V.getPlan.maxSeats ?? 999,
1168
+ value: L,
1169
+ min: H.getPlan.minSeats ?? 1,
1170
+ max: H.getPlan.maxSeats ?? 999,
1143
1171
  onChange: (e) => {
1144
1172
  let t = parseInt(e.target.value, 10);
1145
- isNaN(t) || z(Math.max(V.getPlan?.minSeats ?? 1, t));
1173
+ isNaN(t) || R(Math.max(H.getPlan?.minSeats ?? 1, t));
1146
1174
  },
1147
1175
  className: "w-20 h-9 text-center border border-border rounded-md bg-background text-foreground text-sm focus:outline-none focus:ring-2 focus:ring-primary"
1148
1176
  }),
1149
- /* @__PURE__ */ p("button", {
1177
+ /* @__PURE__ */ f("button", {
1150
1178
  type: "button",
1151
- onClick: () => z((e) => Math.min(V.getPlan?.maxSeats ?? 999, e + 1)),
1152
- disabled: R >= (V.getPlan.maxSeats ?? 999),
1179
+ onClick: () => R((e) => Math.min(H.getPlan?.maxSeats ?? 999, e + 1)),
1180
+ disabled: L >= (H.getPlan.maxSeats ?? 999),
1153
1181
  className: "size-9 rounded-md border border-border flex items-center justify-center hover:bg-accent disabled:opacity-40 disabled:cursor-not-allowed transition-colors text-foreground",
1154
1182
  children: "+"
1155
1183
  }),
1156
- V.getPlan.pricePerSeat && /* @__PURE__ */ m("span", {
1184
+ H.getPlan.pricePerSeat && /* @__PURE__ */ p("span", {
1157
1185
  className: "text-sm text-muted-foreground",
1158
1186
  children: [
1159
1187
  "×",
1160
1188
  " ",
1161
- V.getPlan.pricePerSeat.toLocaleString("en", {
1189
+ H.getPlan.pricePerSeat.toLocaleString("en", {
1162
1190
  style: "currency",
1163
- currency: V.getPlan.currency ?? "USD"
1191
+ currency: H.getPlan.currency ?? "USD"
1164
1192
  }),
1165
1193
  " ",
1166
1194
  "=",
1167
1195
  " ",
1168
- (V.getPlan.pricePerSeat * R).toLocaleString("en", {
1196
+ (H.getPlan.pricePerSeat * L).toLocaleString("en", {
1169
1197
  style: "currency",
1170
- currency: V.getPlan.currency ?? "USD"
1198
+ currency: H.getPlan.currency ?? "USD"
1171
1199
  }),
1172
1200
  "/mo"
1173
1201
  ]
@@ -1179,57 +1207,57 @@ var Ke = () => {
1179
1207
  ]
1180
1208
  })
1181
1209
  ]
1182
- }), /* @__PURE__ */ p("div", {
1210
+ }), /* @__PURE__ */ f("div", {
1183
1211
  className: "lg:col-span-2 order-1 lg:order-2",
1184
- children: /* @__PURE__ */ m("div", {
1212
+ children: /* @__PURE__ */ p("div", {
1185
1213
  className: "lg:sticky lg:top-6 space-y-4",
1186
1214
  children: [
1187
- /* @__PURE__ */ m("div", {
1215
+ /* @__PURE__ */ p("div", {
1188
1216
  className: "rounded-lg border border-border bg-card",
1189
1217
  children: [
1190
- /* @__PURE__ */ p("div", {
1218
+ /* @__PURE__ */ f("div", {
1191
1219
  className: "p-4",
1192
- children: /* @__PURE__ */ p(ge, {
1193
- items: B.items,
1194
- subtotal: B.subtotal,
1195
- discountAmount: B.discountAmount,
1196
- taxAmount: B.taxAmount,
1197
- taxRate: B.taxRate,
1198
- taxType: B.taxType,
1199
- total: B.total,
1200
- currency: B.selectedCurrency,
1201
- isCalculatingTax: B.isCalculatingTax,
1202
- showInCredits: B.selectedProvider === "CREDITS",
1203
- onUpdateQuantity: O === "PLAN" ? void 0 : B.updateItemQuantity,
1204
- onRemoveItem: B.removeItem,
1205
- isEditable: O !== "PLAN"
1220
+ children: /* @__PURE__ */ f(ge, {
1221
+ items: z.items,
1222
+ subtotal: z.subtotal,
1223
+ discountAmount: z.discountAmount,
1224
+ taxAmount: z.taxAmount,
1225
+ taxRate: z.taxRate,
1226
+ taxType: z.taxType,
1227
+ total: z.total,
1228
+ currency: z.selectedCurrency,
1229
+ isCalculatingTax: z.isCalculatingTax,
1230
+ showInCredits: z.selectedProvider === "CREDITS",
1231
+ onUpdateQuantity: E === "PLAN" ? void 0 : z.updateItemQuantity,
1232
+ onRemoveItem: z.removeItem,
1233
+ isEditable: E !== "PLAN"
1206
1234
  })
1207
1235
  }),
1208
- /* @__PURE__ */ p("div", {
1236
+ /* @__PURE__ */ f("div", {
1209
1237
  className: "px-4 pb-4 border-t border-border pt-4",
1210
- children: /* @__PURE__ */ p(_e, {
1211
- value: B.promoCode,
1212
- onChange: B.setPromoCode,
1213
- onValidate: async () => await B.validatePromoCode(),
1214
- onClear: B.clearPromoCode,
1215
- isApplied: B.promoDiscount > 0,
1216
- discountValue: B.promoDiscount,
1217
- discountType: B.promoDiscountType,
1218
- isValidating: B.isProcessing
1238
+ children: /* @__PURE__ */ f(_e, {
1239
+ value: z.promoCode,
1240
+ onChange: z.setPromoCode,
1241
+ onValidate: async () => await z.validatePromoCode(),
1242
+ onClear: z.clearPromoCode,
1243
+ isApplied: z.promoDiscount > 0,
1244
+ discountValue: z.promoDiscount,
1245
+ discountType: z.promoDiscountType,
1246
+ isValidating: z.isProcessing
1219
1247
  })
1220
1248
  }),
1221
- O === "PLAN" && B.selectedProvider !== "CREDITS" && B.selectedProvider !== "AUTO" && (() => {
1249
+ E === "PLAN" && z.selectedProvider !== "CREDITS" && z.selectedProvider !== "AUTO" && (() => {
1222
1250
  let e = "", t = !1, n = !1;
1223
- if (B.selectedPaymentMethodId) {
1224
- let r = Y.find((e) => e.id === B.selectedPaymentMethodId);
1251
+ if (z.selectedPaymentMethodId) {
1252
+ let r = Y.find((e) => e.id === z.selectedPaymentMethodId);
1225
1253
  r && (e = `${r.type === "CREDIT_CARD" || r.type === "DEBIT_CARD" ? "Card" : r.type}${r.last4 ? ` •••• ${r.last4}` : ""}`, t = !0, n = !1);
1226
- } else (B.selectedProvider === "RAZORPAY" || B.selectedProvider === "STRIPE") && (e = B.selectedProvider === "RAZORPAY" ? "new card (Razorpay)" : "new card (Stripe)", t = !0, n = !0);
1227
- return /* @__PURE__ */ p("div", {
1254
+ } else (z.selectedProvider === "RAZORPAY" || z.selectedProvider === "STRIPE") && (e = z.selectedProvider === "RAZORPAY" ? "new card (Razorpay)" : "new card (Stripe)", t = !0, n = !0);
1255
+ return /* @__PURE__ */ f("div", {
1228
1256
  className: "px-4 pb-4",
1229
- children: /* @__PURE__ */ p(Se, {
1230
- enabled: B.autoRenew,
1257
+ children: /* @__PURE__ */ f(Se, {
1258
+ enabled: z.autoRenew,
1231
1259
  onToggle: (e) => {
1232
- B.setAutoRenew(e), e && B.selectedPaymentMethodId && B.setAutoRenewPaymentMethodId(B.selectedPaymentMethodId);
1260
+ z.setAutoRenew(e), e && z.selectedPaymentMethodId && z.setAutoRenewPaymentMethodId(z.selectedPaymentMethodId);
1233
1261
  },
1234
1262
  hasPaymentMethodSelected: t,
1235
1263
  selectedPaymentMethodDisplay: e,
@@ -1239,14 +1267,14 @@ var Ke = () => {
1239
1267
  })()
1240
1268
  ]
1241
1269
  }),
1242
- /* @__PURE__ */ p("button", {
1270
+ /* @__PURE__ */ f("button", {
1243
1271
  type: "button",
1244
- onClick: Et,
1245
- disabled: B.isProcessing || !B.billingAccount || B.items.length === 0 || O === "ADDON" && !D && bt || O === "ADDON" && !D && W.length === 0 || O === "ADDON" && !D && !B.selectedSubscriptionId,
1272
+ onClick: Lt,
1273
+ disabled: z.isProcessing || !z.billingAccount || z.items.length === 0 || E === "ADDON" && !T && kt || E === "ADDON" && !T && G.length === 0 || E === "ADDON" && !T && !z.selectedSubscriptionId,
1246
1274
  className: "w-full px-6 py-4 rounded-lg bg-primary text-primary-foreground font-semibold\n hover:bg-primary/90 disabled:opacity-50 disabled:cursor-not-allowed\n transition-colors flex items-center justify-center gap-2",
1247
- children: B.isProcessing ? /* @__PURE__ */ m(f, { children: [/* @__PURE__ */ p(d, { className: "size-5 animate-spin" }), "Processing…"] }) : B.selectedProvider === "CREDITS" ? "Pay with Credits" : "Proceed to Payment"
1275
+ children: z.isProcessing ? /* @__PURE__ */ p(d, { children: [/* @__PURE__ */ f(Le, { className: "size-5 animate-spin" }), "Processing…"] }) : z.selectedProvider === "CREDITS" ? "Pay with Credits" : "Proceed to Payment"
1248
1276
  }),
1249
- /* @__PURE__ */ p("p", {
1277
+ /* @__PURE__ */ f("p", {
1250
1278
  className: "text-center text-xs text-muted-foreground",
1251
1279
  children: "🔒 Secure checkout with 256-bit SSL encryption"
1252
1280
  })
@@ -1254,22 +1282,22 @@ var Ke = () => {
1254
1282
  })
1255
1283
  })]
1256
1284
  }),
1257
- nt && B.billingAccount && /* @__PURE__ */ p(we, {
1258
- billingAccountId: B.billingAccount.id,
1259
- hasPhone: !!B.billingAccount.contactNumber?.trim(),
1260
- hasAddress: !!(B.billingAccount.billingAddresses?.[0]?.line1?.trim() && B.billingAccount.billingAddresses?.[0]?.postalCode?.trim()),
1285
+ ct && z.billingAccount && /* @__PURE__ */ f(we, {
1286
+ billingAccountId: z.billingAccount.id,
1287
+ hasPhone: !!z.billingAccount.contactNumber?.trim(),
1288
+ hasAddress: !!(z.billingAccount.billingAddresses?.[0]?.line1?.trim() && z.billingAccount.billingAddresses?.[0]?.postalCode?.trim()),
1261
1289
  onCompleted: () => {
1262
- j.current = !0, A(!1), Et(), mt().then((e) => {
1263
- let t = (e.data?.getBillingAccountsByOrg ?? []).find((e) => e.id === B.billingAccount?.id);
1264
- t && B.setBillingAccount(t);
1290
+ O.current = !0, lt(!1), Lt(), Ct().then((e) => {
1291
+ let t = (e.data?.getBillingAccountsByOrg ?? []).find((e) => e.id === z.billingAccount?.id);
1292
+ t && z.setBillingAccount(t);
1265
1293
  });
1266
1294
  },
1267
- onCancel: () => A(!1)
1295
+ onCancel: () => lt(!1)
1268
1296
  })
1269
1297
  ]
1270
1298
  });
1271
1299
  };
1272
1300
  //#endregion
1273
- export { Ke as CheckoutPage };
1301
+ export { Ye as CheckoutPage };
1274
1302
 
1275
1303
  //# sourceMappingURL=CheckoutPage.js.map