mantur-components 0.1.8 → 0.1.10

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.
@@ -1,53 +1,67 @@
1
- import { useCallback as e, useEffect as t, useMemo as n, useRef as r, useState as i } from "react";
2
- import { Avatar as a, Button as o, Card as s, DatePicker as c, Divider as l, Dropdown as u, Form as d, Grid as f, Input as p, Menu as m, Message as h, Modal as g, Pagination as _, Select as v, Table as y, Tabs as b, Tag as x, Typography as S, Upload as C } from "@arco-design/web-react";
3
- import { IconCheckCircleFill as w, IconDown as T, IconEdit as E, IconFile as D, IconLanguage as O, IconMoonFill as ee, IconPlus as k, IconPoweroff as A, IconSunFill as j, IconUpload as M } from "@arco-design/web-react/icon";
4
- import { useTranslation as N } from "react-i18next";
5
- import { jsx as P, jsxs as F } from "react/jsx-runtime";
6
- import { useTheme as I } from "next-themes";
1
+ import e, { useCallback as t, useEffect as n, useMemo as r, useRef as i, useState as a } from "react";
2
+ import { Alert as o, Avatar as s, Button as c, Card as l, DatePicker as u, Divider as d, Dropdown as f, Form as p, Grid as m, Input as h, Menu as g, Message as _, Modal as v, Pagination as y, Select as b, Spin as x, Table as S, Tabs as C, Tag as w, Typography as T, Upload as E } from "@arco-design/web-react";
3
+ import { IconCheckCircleFill as D, IconDown as O, IconEdit as k, IconFile as A, IconLanguage as j, IconMoonFill as M, IconPlus as N, IconPoweroff as P, IconSunFill as F, IconUpload as I } from "@arco-design/web-react/icon";
4
+ import { useTranslation as ee } from "react-i18next";
5
+ import { jsx as L, jsxs as R } from "react/jsx-runtime";
6
+ import { useTheme as te } from "next-themes";
7
7
  //#region \0rolldown/runtime.js
8
- var L = Object.create, R = Object.defineProperty, z = Object.getOwnPropertyDescriptor, B = Object.getOwnPropertyNames, V = Object.getPrototypeOf, H = Object.prototype.hasOwnProperty, te = (e, t) => () => (t || (e((t = { exports: {} }).exports, t), e = null), t.exports), ne = (e, t, n, r) => {
9
- if (t && typeof t == "object" || typeof t == "function") for (var i = B(t), a = 0, o = i.length, s; a < o; a++) s = i[a], !H.call(e, s) && s !== n && R(e, s, {
8
+ var z = Object.create, B = Object.defineProperty, ne = Object.getOwnPropertyDescriptor, V = Object.getOwnPropertyNames, re = Object.getPrototypeOf, H = Object.prototype.hasOwnProperty, U = (e, t) => () => (t || (e((t = { exports: {} }).exports, t), e = null), t.exports), W = (e, t, n, r) => {
9
+ if (t && typeof t == "object" || typeof t == "function") for (var i = V(t), a = 0, o = i.length, s; a < o; a++) s = i[a], !H.call(e, s) && s !== n && B(e, s, {
10
10
  get: ((e) => t[e]).bind(null, s),
11
- enumerable: !(r = z(t, s)) || r.enumerable
11
+ enumerable: !(r = ne(t, s)) || r.enumerable
12
12
  });
13
13
  return e;
14
- }, re = (e, t, n) => (n = e == null ? {} : L(V(e)), ne(t || !e || !e.__esModule ? R(n, "default", {
14
+ }, ie = (e, t, n) => (n = e == null ? {} : z(re(e)), W(t || !e || !e.__esModule ? B(n, "default", {
15
15
  value: e,
16
16
  enumerable: !0
17
- }) : n, e)), ie = "/api", ae = "/users/me/points", U = "mantur-points-refresh", oe = "mantur-tenant-context-change";
18
- function se() {
19
- return typeof window < "u" && window.__MANTUR_COMPONENTS_API_BASE__ ? window.__MANTUR_COMPONENTS_API_BASE__ : ie;
17
+ }) : n, e)), G = "/api", ae = "/billing/accounts/me", oe = "mantur-points-refresh", se = "mantur-recharge-order-created", ce = "mantur-tenant-context-change";
18
+ function le() {
19
+ return typeof window < "u" && window.__MANTUR_COMPONENTS_API_BASE__ ? window.__MANTUR_COMPONENTS_API_BASE__ : G;
20
20
  }
21
- function ce() {
21
+ function ue() {
22
22
  return typeof window < "u" && window.__MANTUR_COMPONENTS_POINTS_ENDPOINT__ ? window.__MANTUR_COMPONENTS_POINTS_ENDPOINT__ : ae;
23
23
  }
24
- function W(e) {
24
+ function de(e) {
25
+ let t = new URLSearchParams();
26
+ Object.entries(e).forEach(([e, n]) => {
27
+ if (n !== void 0) {
28
+ if (Array.isArray(n)) {
29
+ n.length > 0 && t.set(e, n.join(","));
30
+ return;
31
+ }
32
+ t.set(e, String(n));
33
+ }
34
+ });
35
+ let n = t.toString();
36
+ return n ? `?${n}` : "";
37
+ }
38
+ function fe(e) {
25
39
  if (typeof document > "u") return;
26
40
  let t = `${encodeURIComponent(e)}=`;
27
41
  return document.cookie.split("; ").find((e) => e.startsWith(t))?.slice(t.length);
28
42
  }
29
- function G(e) {
43
+ function pe(e) {
30
44
  if (typeof document > "u") return;
31
45
  let t = encodeURIComponent(e), n = window.location.hostname, r = [void 0, n], i = n.split(".");
32
46
  i.length >= 2 && r.push(`.${i.slice(-2).join(".")}`), r.forEach((e) => {
33
47
  document.cookie = `${t}=; path=/; max-age=0${e ? `; domain=${e}` : ""}`;
34
48
  });
35
49
  }
36
- function le(e) {
50
+ function me(e) {
37
51
  let t = JSON.parse(e || "null");
38
52
  if (!t) throw Error("Request failed");
39
53
  if (t.code !== 0) throw Error(t.message || "Request failed");
40
54
  return t;
41
55
  }
42
56
  async function K(e, t = {}) {
43
- let n = W("front-token"), r = W("Accept-Language"), i = t.headers || {};
57
+ let n = fe("front-token"), r = fe("Accept-Language"), i = t.headers || {};
44
58
  return n && (i.Authorization = decodeURIComponent(n)), r && (i["Accept-Language"] = decodeURIComponent(r)), new Promise((n, r) => {
45
59
  let a = new XMLHttpRequest();
46
- a.open(t.method || "GET", `${se()}${e}`, !0), a.timeout = t.timeout || 1e4, Object.entries(i).forEach(([e, t]) => {
60
+ a.open(t.method || "GET", `${le()}${e}`, !0), a.timeout = t.timeout || 1e4, Object.entries(i).forEach(([e, t]) => {
47
61
  a.setRequestHeader(e, t);
48
62
  }), a.onload = () => {
49
63
  try {
50
- let e = le(a.responseText);
64
+ let e = me(a.responseText);
51
65
  if (a.status < 200 || a.status >= 300) {
52
66
  r(Error(e.message || a.statusText));
53
67
  return;
@@ -59,16 +73,16 @@ async function K(e, t = {}) {
59
73
  }, a.onerror = () => r(/* @__PURE__ */ Error("Network request failed")), a.ontimeout = () => r(/* @__PURE__ */ Error("Network request timed out")), a.send(t.body ?? null);
60
74
  });
61
75
  }
62
- async function ue() {
76
+ async function he() {
63
77
  try {
64
78
  await K("/auth/front-logout", { method: "DELETE" });
65
79
  } catch (e) {
66
80
  console.warn("Logout request failed, continuing local logout.", e);
67
81
  } finally {
68
- G("front-token"), G("refreshToken"), typeof window < "u" && window.location.reload();
82
+ pe("front-token"), pe("refreshToken"), typeof window < "u" && window.location.reload();
69
83
  }
70
84
  }
71
- async function de(e) {
85
+ async function ge(e) {
72
86
  let t;
73
87
  if (e.avatarFile) {
74
88
  let n = new FormData();
@@ -83,25 +97,57 @@ async function de(e) {
83
97
  body: JSON.stringify({ nickname: e.nickname })
84
98
  })).data || t;
85
99
  }
86
- function fe(e) {
100
+ function _e(e) {
87
101
  let t = (...t) => {
88
102
  let n = t.map((t) => e?.[t]).find((e) => e !== void 0);
89
103
  return typeof n == "number" ? n : Number(n || 0);
90
104
  };
91
105
  return {
92
- total: t("total", "totalPoints", "balance", "points"),
93
- recharge: t("recharge", "rechargePoints", "paidPoints"),
94
- gifted: t("gifted", "giftedPoints", "bonusPoints")
106
+ total: t("total", "totalPoints", "totalBalance", "balance", "points"),
107
+ recharge: t("recharge", "rechargePoints", "rechargeBalance", "paidPoints"),
108
+ gifted: t("gifted", "giftedPoints", "giftBalance", "bonusPoints")
95
109
  };
96
110
  }
97
- async function pe() {
98
- return fe((await K(ce())).data);
111
+ async function ve() {
112
+ return _e((await K(ue())).data);
99
113
  }
100
- async function q() {
101
- let e = await pe();
102
- return typeof window < "u" && window.dispatchEvent(new CustomEvent(U, { detail: e })), e;
114
+ async function ye() {
115
+ let e = await ve();
116
+ return typeof window < "u" && window.dispatchEvent(new CustomEvent(oe, { detail: e })), e;
103
117
  }
104
- function me(e, t) {
118
+ async function be() {
119
+ return (await K("/billing/packages")).data || [];
120
+ }
121
+ async function xe(e) {
122
+ return (await K("/billing/recharge/orders", {
123
+ method: "POST",
124
+ headers: { "Content-Type": "application/json;charset=utf-8" },
125
+ body: JSON.stringify(e)
126
+ })).data;
127
+ }
128
+ async function Se(e) {
129
+ return (await K(`/billing/recharge/orders/${encodeURIComponent(e)}`)).data;
130
+ }
131
+ async function Ce() {
132
+ return (await K("/billing/pricing/charge-points")).data || [];
133
+ }
134
+ async function we(e) {
135
+ return (await K(`/billing/pricing/charge-points/${encodeURIComponent(e)}`)).data;
136
+ }
137
+ async function Te() {
138
+ return (await K("/billing/accounts/me")).data;
139
+ }
140
+ async function Ee(e) {
141
+ return (await K(`/billing/accounts/me/ledger${de({
142
+ pageNum: e.pageNum,
143
+ pageSize: e.pageSize,
144
+ directions: e.directions,
145
+ bizTypes: e.bizTypes,
146
+ fromTime: e.fromTime,
147
+ toTime: e.toTime
148
+ })}`)).data || { records: [] };
149
+ }
150
+ function De(e, t) {
105
151
  return t?.tenantId ? e.find((e) => e.tenantId === t.tenantId) || {
106
152
  tenantId: t.tenantId,
107
153
  tenantName: t.tenantName || t.tenantId,
@@ -111,37 +157,37 @@ function me(e, t) {
111
157
  }))
112
158
  } : e.find((e) => e.isOwner) || e[0];
113
159
  }
114
- function J(e) {
115
- typeof window < "u" && (window.__MANTUR_COMPONENTS_TENANT_CONTEXT__ = e, window.dispatchEvent(new CustomEvent(oe, { detail: e })));
160
+ function Oe(e) {
161
+ typeof window < "u" && (window.__MANTUR_COMPONENTS_TENANT_CONTEXT__ = e, window.dispatchEvent(new CustomEvent(ce, { detail: e })));
116
162
  }
117
- async function he() {
163
+ async function ke() {
118
164
  return (await K("/users/me/tenants")).data || [];
119
165
  }
120
- async function ge() {
166
+ async function Ae() {
121
167
  return (await K("/auth/current-tenant")).data;
122
168
  }
123
- async function _e(e) {
169
+ async function je(e) {
124
170
  return (await K(`/auth/current-tenant/${e}`, { method: "PUT" })).data;
125
171
  }
126
- async function ve(e = "refresh") {
127
- let [t, n] = await Promise.all([he(), ge()]), r = {
172
+ async function Me(e = "refresh") {
173
+ let [t, n] = await Promise.all([ke(), Ae()]), r = {
128
174
  tenants: t,
129
- currentTenant: me(t, n),
175
+ currentTenant: De(t, n),
130
176
  auth: n,
131
177
  reason: e
132
178
  };
133
- return J(r), r;
179
+ return Oe(r), r;
134
180
  }
135
- async function ye(e) {
136
- let t = await _e(e), n = await he(), r = {
181
+ async function Ne(e) {
182
+ let t = await je(e), n = await ke(), r = {
137
183
  tenants: n,
138
- currentTenant: me(n, t),
184
+ currentTenant: De(n, t),
139
185
  auth: t,
140
186
  reason: "switch"
141
187
  };
142
- return J(r), r;
188
+ return Oe(r), r;
143
189
  }
144
- var be = {
190
+ var Pe = {
145
191
  title: "Mantur",
146
192
  switchTeam: "Switch Team",
147
193
  personalSettings: "Personal Settings",
@@ -178,6 +224,23 @@ var be = {
178
224
  rechargeHint: "Recharge points are valid for 2 years after arrival.",
179
225
  payNow: "Pay Now",
180
226
  rechargeSuccess: "Recharge successful",
227
+ rechargeOrderCreated: "Recharge order created. Continue to complete payment.",
228
+ stripePaymentTitle: "Stripe Payment",
229
+ stripePaymentDescription: "Complete card payment. Points will be credited automatically after payment succeeds.",
230
+ stripePay: "Confirm Payment",
231
+ stripePaymentLoading: "Loading Stripe payment...",
232
+ stripePaymentConfigMissing: "Stripe publishable key is not configured",
233
+ stripePaymentClientSecretMissing: "Stripe payment credential is missing from the order",
234
+ stripeCheckoutClientSecretInvalid: "Invalid Stripe payment credential. The backend must return a Checkout Session client_secret that starts with cs_.",
235
+ stripePaymentProcessing: "Payment is processing. Please refresh points later.",
236
+ stripePaymentFailed: "Payment failed. Please try again.",
237
+ stripePaymentLoadFailed: "Failed to load Stripe payment. Please refresh and try again.",
238
+ customRechargeAmount: "Custom Amount",
239
+ customRechargeDescription: "Enter the recharge amount you need. Minimum $10 USD.",
240
+ customRechargeMinError: "Minimum recharge is $10 USD",
241
+ customRechargeEstimate: "Estimated points",
242
+ customRechargeRate: "$1 = 100 points. Package bonuses do not apply.",
243
+ selectRechargePackage: "Select a package or enter a custom amount",
181
244
  all: "All",
182
245
  income: "Income",
183
246
  expense: "Expense",
@@ -194,10 +257,10 @@ var be = {
194
257
  pointsDeductionTip: "Points expiring soon are deducted first.",
195
258
  pointsNoteTitle: "Note",
196
259
  pointsAccountNote: "Points are attached to your personal account. You recharge, consume, and manage them yourself. Others cannot recharge or use them for you. Recharge points are valid for 2 years; gifted points follow the validity set by operations."
197
- }, xe = {
260
+ }, Fe = {
198
261
  languageZh: "中文",
199
262
  languageEn: "English"
200
- }, Se = {
263
+ }, Ie = {
201
264
  title: "漫途",
202
265
  switchTeam: "切换团队",
203
266
  personalSettings: "个人设置",
@@ -234,6 +297,23 @@ var be = {
234
297
  rechargeHint: "充值积分有效期 2 年(自到账日起算),支付后不可退换。",
235
298
  payNow: "立即支付",
236
299
  rechargeSuccess: "充值成功",
300
+ rechargeOrderCreated: "充值订单已创建,请继续完成支付",
301
+ stripePaymentTitle: "Stripe 支付",
302
+ stripePaymentDescription: "请完成银行卡支付,支付成功后积分将自动到账。",
303
+ stripePay: "确认支付",
304
+ stripePaymentLoading: "正在加载 Stripe 支付组件...",
305
+ stripePaymentConfigMissing: "Stripe publishable key 未配置",
306
+ stripePaymentClientSecretMissing: "订单缺少 Stripe 支付凭证",
307
+ stripeCheckoutClientSecretInvalid: "Stripe 支付凭证类型不正确,请后端返回 Checkout Session 的 client_secret(cs_ 开头)",
308
+ stripePaymentProcessing: "支付处理中,请稍后刷新积分",
309
+ stripePaymentFailed: "支付失败,请重试",
310
+ stripePaymentLoadFailed: "Stripe 支付组件加载失败,请刷新后重试",
311
+ customRechargeAmount: "自定义金额",
312
+ customRechargeDescription: "按需输入充值金额,最低 $10 USD 起充",
313
+ customRechargeMinError: "最低充值 $10 USD",
314
+ customRechargeEstimate: "预计到账积分",
315
+ customRechargeRate: "兑换比 $1 = 100 积分(不享套餐赠送)",
316
+ selectRechargePackage: "请先选择套餐或输入自定义金额",
237
317
  all: "全部",
238
318
  income: "获得",
239
319
  expense: "消耗",
@@ -250,62 +330,62 @@ var be = {
250
330
  pointsDeductionTip: "优先扣减即将到期的积分",
251
331
  pointsNoteTitle: "说明",
252
332
  pointsAccountNote: "积分账户挂在你的个人账号上,自己充值、自己消耗、自己负责;他人不能代充、不能代用。充值积分有效期固定 2 年;赠送积分有效期由后台运营发放时设置。"
253
- }, Ce = {
333
+ }, Le = {
254
334
  languageZh: "中文",
255
335
  languageEn: "English"
256
- }, we = "i18nextLng", Te = "manturLanguageSource", Y = "mantur-language-change", Ee = {
336
+ }, Re = "i18nextLng", ze = "manturLanguageSource", Be = "mantur-language-change", Ve = {
257
337
  "zh-CN": {
258
- ...Se,
259
- ...Ce
338
+ ...Ie,
339
+ ...Le
260
340
  },
261
341
  "en-US": {
262
- ...be,
263
- ...xe
342
+ ...Pe,
343
+ ...Fe
264
344
  }
265
345
  };
266
- function X(e) {
346
+ function q(e) {
267
347
  return e?.toLowerCase().startsWith("en") ? "en-US" : "zh-CN";
268
348
  }
269
- function Z() {
270
- return typeof window > "u" ? "zh-CN" : X(window.localStorage.getItem("i18nextLng") || document.documentElement.lang || navigator.language);
349
+ function He() {
350
+ return typeof window > "u" ? "zh-CN" : q(window.localStorage.getItem("i18nextLng") || document.documentElement.lang || navigator.language);
271
351
  }
272
- function De(e) {
273
- return Ee[X(e)];
352
+ function Ue(e) {
353
+ return Ve[q(e)];
274
354
  }
275
355
  //#endregion
276
356
  //#region src/lang-switch/LangSwitch.tsx
277
- var Oe = we, ke = Te;
278
- function Ae(e, t) {
357
+ var We = Re, Ge = ze;
358
+ function Ke(e, t) {
279
359
  document.cookie = `${encodeURIComponent(e)}=${encodeURIComponent(t)}; path=/`;
280
360
  }
281
- function je() {
282
- let { i18n: e } = N(), [n, r] = i(() => Z()), a = De(n);
283
- return t(() => {
284
- r(X(e.language));
285
- }, [e.language]), /* @__PURE__ */ P(u, {
286
- droplist: /* @__PURE__ */ F(m, {
287
- selectedKeys: [n],
361
+ function qe() {
362
+ let { i18n: e } = ee(), [t, r] = a(() => He()), i = Ue(t);
363
+ return n(() => {
364
+ r(q(e.language));
365
+ }, [e.language]), /* @__PURE__ */ L(f, {
366
+ droplist: /* @__PURE__ */ R(g, {
367
+ selectedKeys: [t],
288
368
  onClickMenuItem: (t) => {
289
- let n = X(t);
290
- localStorage.setItem(Oe, t), localStorage.setItem(ke, "manual"), r(n), e.changeLanguage(t), Ae("Accept-Language", t), window.dispatchEvent(new CustomEvent(Y, { detail: n })), window.location.reload();
369
+ let n = q(t);
370
+ localStorage.setItem(We, t), localStorage.setItem(Ge, "manual"), r(n), e.changeLanguage(t), Ke("Accept-Language", t), window.dispatchEvent(new CustomEvent(Be, { detail: n })), window.location.reload();
291
371
  },
292
- children: [/* @__PURE__ */ P(m.Item, { children: a.languageZh }, "zh-CN"), /* @__PURE__ */ P(m.Item, { children: a.languageEn }, "en-US")]
372
+ children: [/* @__PURE__ */ L(g.Item, { children: i.languageZh }, "zh-CN"), /* @__PURE__ */ L(g.Item, { children: i.languageEn }, "en-US")]
293
373
  }),
294
374
  trigger: "click",
295
375
  position: "br",
296
- children: /* @__PURE__ */ P(o, {
376
+ children: /* @__PURE__ */ L(c, {
297
377
  shape: "circle",
298
- icon: /* @__PURE__ */ P(O, {})
378
+ icon: /* @__PURE__ */ L(j, {})
299
379
  })
300
380
  });
301
381
  }
302
382
  //#endregion
303
383
  //#region src/theme-switch/ThemeSwitch.tsx
304
- function Me() {
305
- let { resolvedTheme: e, setTheme: t } = I();
306
- return /* @__PURE__ */ P(o, {
384
+ function Je() {
385
+ let { resolvedTheme: e, setTheme: t } = te();
386
+ return /* @__PURE__ */ L(c, {
307
387
  shape: "circle",
308
- icon: P(e === "light" ? ee : j, {}),
388
+ icon: L(e === "light" ? M : F, {}),
309
389
  onClick: () => {
310
390
  t(e === "light" ? "dark" : "light");
311
391
  }
@@ -313,7 +393,7 @@ function Me() {
313
393
  }
314
394
  //#endregion
315
395
  //#region src/header/mock.ts
316
- var Q = [
396
+ var Ye = [
317
397
  {
318
398
  id: "points-500",
319
399
  points: 500,
@@ -329,13 +409,8 @@ var Q = [
329
409
  points: 5500,
330
410
  price: 50,
331
411
  recommended: !0
332
- },
333
- {
334
- id: "points-24000",
335
- points: 24e3,
336
- price: 200
337
412
  }
338
- ], Ne = [
413
+ ], Xe = [
339
414
  {
340
415
  id: "recharge-1",
341
416
  type: "income",
@@ -408,31 +483,31 @@ var Q = [
408
483
  badgeKind: "deducted",
409
484
  badgeText: "已扣除"
410
485
  }
411
- ], { RangePicker: Pe } = c, Fe = 21, Ie = 7;
412
- function Le(e) {
486
+ ], { RangePicker: Ze } = u, Qe = 21, $e = 7;
487
+ function et(e) {
413
488
  return e === "recharge" ? "arcoblue" : e === "gift" ? "cyan" : e === "expired" ? "gray" : "orange";
414
489
  }
415
- function Re({ visible: e, points: t, text: r, onCancel: a, onRecharge: c }) {
416
- let [l, u] = i("all"), [d, p] = i("all"), [m, C] = i(["2026-04-15", "2026-05-15"]), [w, T] = i(1), E = (e) => new Intl.NumberFormat().format(e), D = n(() => {
417
- let [e, t] = m;
418
- return Ne.filter((n) => {
419
- let r = l === "all" || n.type === l, i = d === "all" || n.source === d, a = !e || n.date >= e, o = !t || n.date <= t;
490
+ function tt({ visible: e, points: t, text: n, onCancel: i, onRecharge: o }) {
491
+ let [s, u] = a("all"), [d, f] = a("all"), [p, h] = a(["2026-04-15", "2026-05-15"]), [g, x] = a(1), E = (e) => new Intl.NumberFormat().format(e), D = r(() => {
492
+ let [e, t] = p;
493
+ return Xe.filter((n) => {
494
+ let r = s === "all" || n.type === s, i = d === "all" || n.source === d, a = !e || n.date >= e, o = !t || n.date <= t;
420
495
  return r && i && a && o;
421
496
  });
422
497
  }, [
423
- m,
498
+ p,
424
499
  d,
425
- l
500
+ s
426
501
  ]), O = [
427
502
  {
428
- title: r.pointsDetail,
503
+ title: n.pointsDetail,
429
504
  dataIndex: "name",
430
- render: (e, t) => /* @__PURE__ */ F("div", {
505
+ render: (e, t) => /* @__PURE__ */ R("div", {
431
506
  className: "min-w-0",
432
- children: [/* @__PURE__ */ P(S.Text, {
507
+ children: [/* @__PURE__ */ L(T.Text, {
433
508
  className: "font-medium!",
434
509
  children: t.name
435
- }), /* @__PURE__ */ P(S.Text, {
510
+ }), /* @__PURE__ */ L(T.Text, {
436
511
  type: "secondary",
437
512
  className: "mt-1 block! text-xs!",
438
513
  children: t.meta
@@ -440,188 +515,188 @@ function Re({ visible: e, points: t, text: r, onCancel: a, onRecharge: c }) {
440
515
  })
441
516
  },
442
517
  {
443
- title: r.pointsUnit,
518
+ title: n.pointsUnit,
444
519
  dataIndex: "amount",
445
520
  width: 120,
446
521
  align: "right",
447
- render: (e, t) => /* @__PURE__ */ F(S.Text, {
522
+ render: (e, t) => /* @__PURE__ */ R(T.Text, {
448
523
  className: `font-semibold! ${t.amount > 0 ? "text-arco-success-6!" : "text-arco-danger-6!"}`,
449
524
  children: [t.amount > 0 ? "+" : "", E(t.amount)]
450
525
  })
451
526
  },
452
527
  {
453
- title: r.source,
528
+ title: n.source,
454
529
  dataIndex: "badgeText",
455
530
  width: 110,
456
531
  align: "right",
457
- render: (e, t) => /* @__PURE__ */ P(x, {
458
- color: Le(t.badgeKind),
532
+ render: (e, t) => /* @__PURE__ */ L(w, {
533
+ color: et(t.badgeKind),
459
534
  children: t.badgeText
460
535
  })
461
536
  }
462
537
  ];
463
- return /* @__PURE__ */ P(g, {
464
- title: r.pointsDetail,
538
+ return /* @__PURE__ */ L(v, {
539
+ title: n.pointsDetail,
465
540
  visible: e,
466
- footer: /* @__PURE__ */ F("div", {
541
+ footer: /* @__PURE__ */ R("div", {
467
542
  className: "flex justify-end gap-2",
468
- children: [/* @__PURE__ */ P(o, {
469
- onClick: a,
470
- children: r.close
471
- }), /* @__PURE__ */ P(o, {
543
+ children: [/* @__PURE__ */ L(c, {
544
+ onClick: i,
545
+ children: n.close
546
+ }), /* @__PURE__ */ L(c, {
472
547
  type: "primary",
473
- icon: /* @__PURE__ */ P(k, {}),
548
+ icon: /* @__PURE__ */ L(N, {}),
474
549
  onClick: () => {
475
- a(), c();
550
+ i(), o();
476
551
  },
477
- children: r.recharge
552
+ children: n.recharge
478
553
  })]
479
554
  }),
480
- onCancel: a,
555
+ onCancel: i,
481
556
  style: {
482
557
  width: 780,
483
558
  maxWidth: "calc(100vw - 48px)"
484
559
  },
485
- children: /* @__PURE__ */ F("div", {
560
+ children: /* @__PURE__ */ R("div", {
486
561
  className: "max-h-[70vh] overflow-y-auto",
487
562
  children: [
488
- /* @__PURE__ */ F(s, {
563
+ /* @__PURE__ */ R(l, {
489
564
  bordered: !1,
490
565
  className: "from-arco-primary-light-1/40 to-cyan-400/5 rounded-none! bg-linear-to-br!",
491
566
  children: [
492
- /* @__PURE__ */ P(S.Text, {
567
+ /* @__PURE__ */ L(T.Text, {
493
568
  type: "secondary",
494
569
  className: "text-xs!",
495
- children: r.totalBalance
570
+ children: n.totalBalance
496
571
  }),
497
- /* @__PURE__ */ F("div", {
572
+ /* @__PURE__ */ R("div", {
498
573
  className: "mt-1.5 mb-3.5 ",
499
- children: [/* @__PURE__ */ P(S.Text, {
574
+ children: [/* @__PURE__ */ L(T.Text, {
500
575
  className: "text-3xl! font-bold!",
501
576
  children: E(t.total)
502
- }), /* @__PURE__ */ F(S.Text, {
577
+ }), /* @__PURE__ */ R(T.Text, {
503
578
  type: "secondary",
504
579
  className: "ml-2 text-sm! ",
505
- children: ["🪙 ", r.pointsUnit]
580
+ children: ["🪙 ", n.pointsUnit]
506
581
  })]
507
582
  }),
508
- /* @__PURE__ */ F(f.Row, {
583
+ /* @__PURE__ */ R(m.Row, {
509
584
  gutter: 12,
510
- children: [/* @__PURE__ */ P(f.Col, {
585
+ children: [/* @__PURE__ */ L(m.Col, {
511
586
  span: 12,
512
- children: /* @__PURE__ */ F(s, {
587
+ children: /* @__PURE__ */ R(l, {
513
588
  size: "small",
514
- children: [/* @__PURE__ */ F("div", {
589
+ children: [/* @__PURE__ */ R("div", {
515
590
  className: "mb-1 flex items-center justify-between",
516
- children: [/* @__PURE__ */ P(S.Text, {
591
+ children: [/* @__PURE__ */ L(T.Text, {
517
592
  type: "secondary",
518
593
  className: "text-xs!",
519
- children: r.rechargePoints
520
- }), /* @__PURE__ */ P(x, {
594
+ children: n.rechargePoints
595
+ }), /* @__PURE__ */ L(w, {
521
596
  color: "arcoblue",
522
- children: r.sourceRecharge
597
+ children: n.sourceRecharge
523
598
  })]
524
- }), /* @__PURE__ */ P(S.Text, {
599
+ }), /* @__PURE__ */ L(T.Text, {
525
600
  className: "text-lg! font-semibold!",
526
601
  children: E(t.recharge)
527
602
  })]
528
603
  })
529
- }), /* @__PURE__ */ P(f.Col, {
604
+ }), /* @__PURE__ */ L(m.Col, {
530
605
  span: 12,
531
- children: /* @__PURE__ */ F(s, {
606
+ children: /* @__PURE__ */ R(l, {
532
607
  size: "small",
533
- children: [/* @__PURE__ */ F("div", {
608
+ children: [/* @__PURE__ */ R("div", {
534
609
  className: "mb-1 flex items-center justify-between",
535
- children: [/* @__PURE__ */ P(S.Text, {
610
+ children: [/* @__PURE__ */ L(T.Text, {
536
611
  type: "secondary",
537
612
  className: "text-xs!",
538
- children: r.giftedPoints
539
- }), /* @__PURE__ */ P(x, {
613
+ children: n.giftedPoints
614
+ }), /* @__PURE__ */ L(w, {
540
615
  color: "success",
541
- children: r.sourceGifted
616
+ children: n.sourceGifted
542
617
  })]
543
- }), /* @__PURE__ */ P(S.Text, {
618
+ }), /* @__PURE__ */ L(T.Text, {
544
619
  className: "text-lg! font-semibold!",
545
620
  children: E(t.gifted)
546
621
  })]
547
622
  })
548
623
  })]
549
624
  }),
550
- /* @__PURE__ */ P(S.Text, {
625
+ /* @__PURE__ */ L(T.Text, {
551
626
  type: "secondary",
552
627
  className: "mt-2.5 block! text-xs!",
553
- children: r.pointsDeductionTip
628
+ children: n.pointsDeductionTip
554
629
  })
555
630
  ]
556
631
  }),
557
- /* @__PURE__ */ F("div", {
632
+ /* @__PURE__ */ R("div", {
558
633
  className: "px-6 py-4",
559
634
  children: [
560
- /* @__PURE__ */ F(b, {
561
- activeTab: l,
635
+ /* @__PURE__ */ R(C, {
636
+ activeTab: s,
562
637
  onChange: (e) => u(e),
563
638
  children: [
564
- /* @__PURE__ */ P(b.TabPane, { title: r.all }, "all"),
565
- /* @__PURE__ */ P(b.TabPane, { title: r.income }, "income"),
566
- /* @__PURE__ */ P(b.TabPane, { title: r.expense }, "expense")
639
+ /* @__PURE__ */ L(C.TabPane, { title: n.all }, "all"),
640
+ /* @__PURE__ */ L(C.TabPane, { title: n.income }, "income"),
641
+ /* @__PURE__ */ L(C.TabPane, { title: n.expense }, "expense")
567
642
  ]
568
643
  }),
569
- /* @__PURE__ */ F("div", {
644
+ /* @__PURE__ */ R("div", {
570
645
  className: "mt-2 mb-3.5 flex flex-wrap items-center gap-2.5",
571
646
  children: [
572
- /* @__PURE__ */ F(v, {
647
+ /* @__PURE__ */ R(b, {
573
648
  value: d,
574
649
  style: { width: 140 },
575
- onChange: (e) => p(e),
650
+ onChange: (e) => f(e),
576
651
  children: [
577
- /* @__PURE__ */ P(v.Option, {
652
+ /* @__PURE__ */ L(b.Option, {
578
653
  value: "all",
579
- children: r.sourceAll
654
+ children: n.sourceAll
580
655
  }),
581
- /* @__PURE__ */ P(v.Option, {
656
+ /* @__PURE__ */ L(b.Option, {
582
657
  value: "recharge",
583
- children: r.sourceRecharge
658
+ children: n.sourceRecharge
584
659
  }),
585
- /* @__PURE__ */ P(v.Option, {
660
+ /* @__PURE__ */ L(b.Option, {
586
661
  value: "gift",
587
- children: r.sourceGifted
662
+ children: n.sourceGifted
588
663
  })
589
664
  ]
590
665
  }),
591
- /* @__PURE__ */ P(Pe, {
592
- value: m,
593
- onChange: (e) => C(e),
666
+ /* @__PURE__ */ L(Ze, {
667
+ value: p,
668
+ onChange: (e) => h(e),
594
669
  style: { width: 260 }
595
670
  }),
596
- /* @__PURE__ */ P(o, {
597
- onClick: () => h.success(r.refreshed),
598
- children: r.query
671
+ /* @__PURE__ */ L(c, {
672
+ onClick: () => _.success(n.refreshed),
673
+ children: n.query
599
674
  })
600
675
  ]
601
676
  }),
602
- /* @__PURE__ */ P(y, {
677
+ /* @__PURE__ */ L(S, {
603
678
  rowKey: "id",
604
679
  columns: O,
605
680
  data: D,
606
681
  pagination: !1,
607
682
  border: !1
608
683
  }),
609
- /* @__PURE__ */ P(_, {
684
+ /* @__PURE__ */ L(y, {
610
685
  className: "mt-3 flex justify-center!",
611
- current: w,
612
- pageSize: Ie,
613
- total: Fe,
614
- onChange: T
686
+ current: g,
687
+ pageSize: $e,
688
+ total: Qe,
689
+ onChange: x
615
690
  })
616
691
  ]
617
692
  }),
618
- /* @__PURE__ */ P(s, {
693
+ /* @__PURE__ */ L(l, {
619
694
  bordered: !1,
620
695
  className: "bg-arco-primary-light-1/30 rounded-none!",
621
- children: /* @__PURE__ */ F(S.Text, {
696
+ children: /* @__PURE__ */ R(T.Text, {
622
697
  type: "secondary",
623
698
  className: "text-xs! leading-6!",
624
- children: [/* @__PURE__ */ F("strong", { children: [r.pointsNoteTitle, ":"] }), r.pointsAccountNote]
699
+ children: [/* @__PURE__ */ R("strong", { children: [n.pointsNoteTitle, ":"] }), n.pointsAccountNote]
625
700
  })
626
701
  })
627
702
  ]
@@ -630,17 +705,17 @@ function Re({ visible: e, points: t, text: r, onCancel: a, onRecharge: c }) {
630
705
  }
631
706
  //#endregion
632
707
  //#region src/labels.ts
633
- var ze = be;
634
- function Be(e) {
708
+ var nt = Pe;
709
+ function rt(e) {
635
710
  return {
636
- ...ze,
711
+ ...nt,
637
712
  ...e
638
713
  };
639
714
  }
640
715
  //#endregion
641
716
  //#region src/header/components/ProfileModal.tsx
642
- var Ve = 2048, He = 2 * 1024 * 1024;
643
- function Ue(e) {
717
+ var it = 2048, at = 2 * 1024 * 1024;
718
+ function ot(e) {
644
719
  return new Promise((t, n) => {
645
720
  let r = URL.createObjectURL(e), i = new Image();
646
721
  i.onload = () => {
@@ -653,80 +728,80 @@ function Ue(e) {
653
728
  }, i.src = r;
654
729
  });
655
730
  }
656
- function We({ visible: e, user: n, labels: s, onCancel: c, onSubmit: l }) {
657
- let u = Be(s), [f] = d.useForm(), [m, _] = i(!1), [v, y] = i(null), [b, x] = i(null), S = r(null);
658
- t(() => () => {
731
+ function st({ visible: e, user: t, labels: r, onCancel: o, onSubmit: l }) {
732
+ let u = rt(r), [d] = p.useForm(), [f, m] = a(!1), [g, y] = a(null), [b, x] = a(null), S = i(null);
733
+ n(() => () => {
659
734
  S.current &&= (URL.revokeObjectURL(S.current), null);
660
- }, []), t(() => {
661
- e && (f.setFieldsValue({ nickname: n?.nickname || n?.username || "" }), y(null), x((e) => (e && URL.revokeObjectURL(e), S.current = null, null)));
735
+ }, []), n(() => {
736
+ e && (d.setFieldsValue({ nickname: t?.nickname || t?.username || "" }), y(null), x((e) => (e && URL.revokeObjectURL(e), S.current = null, null)));
662
737
  }, [
663
738
  e,
664
- n,
665
- f
739
+ t,
740
+ d
666
741
  ]);
667
- let w = (e, t) => {
668
- console.error(t), h.error(e);
669
- }, T = (e) => {
670
- h.success(e);
742
+ let C = (e, t) => {
743
+ console.error(t), _.error(e);
744
+ }, w = (e) => {
745
+ _.success(e);
671
746
  };
672
- return /* @__PURE__ */ P(g, {
747
+ return /* @__PURE__ */ L(v, {
673
748
  title: u.profileTitle,
674
749
  visible: e,
675
750
  onOk: async () => {
676
751
  try {
677
- let e = await f.validate();
678
- _(!0), await l({
752
+ let e = await d.validate();
753
+ m(!0), await l({
679
754
  nickname: e.nickname,
680
- avatarFile: v
681
- }), T(u.profileUpdateSuccess), c();
755
+ avatarFile: g
756
+ }), w(u.profileUpdateSuccess), o();
682
757
  } catch (e) {
683
- e instanceof Error && w(e.message || u.error, e);
758
+ e instanceof Error && C(e.message || u.error, e);
684
759
  } finally {
685
- _(!1);
760
+ m(!1);
686
761
  }
687
762
  },
688
- onCancel: c,
689
- confirmLoading: m,
763
+ onCancel: o,
764
+ confirmLoading: f,
690
765
  okText: u.profileSave,
691
766
  cancelText: u.profileCancel,
692
- children: /* @__PURE__ */ F(d, {
693
- form: f,
767
+ children: /* @__PURE__ */ R(p, {
768
+ form: d,
694
769
  layout: "vertical",
695
- children: [/* @__PURE__ */ P(d.Item, {
770
+ children: [/* @__PURE__ */ L(p.Item, {
696
771
  label: u.profileNickname,
697
772
  field: "nickname",
698
773
  rules: [{
699
774
  required: !0,
700
775
  message: u.profileNicknamePlaceholder
701
776
  }],
702
- children: /* @__PURE__ */ P(p, {
777
+ children: /* @__PURE__ */ L(h, {
703
778
  placeholder: u.profileNicknamePlaceholder,
704
779
  allowClear: !0
705
780
  })
706
- }), /* @__PURE__ */ P(d.Item, {
781
+ }), /* @__PURE__ */ L(p.Item, {
707
782
  label: u.profileAvatar,
708
- children: /* @__PURE__ */ F("div", {
783
+ children: /* @__PURE__ */ R("div", {
709
784
  className: "flex flex-col gap-2",
710
- children: [/* @__PURE__ */ F("div", {
785
+ children: [/* @__PURE__ */ R("div", {
711
786
  className: "flex items-center gap-3",
712
- children: [/* @__PURE__ */ P(a, {
787
+ children: [/* @__PURE__ */ L(s, {
713
788
  size: 64,
714
789
  className: "shrink-0 bg-arco-primary-light-1!",
715
- children: b || n?.avatar ? /* @__PURE__ */ P("img", {
716
- src: b || n?.avatar,
790
+ children: b || t?.avatar ? /* @__PURE__ */ L("img", {
791
+ src: b || t?.avatar,
717
792
  alt: "",
718
793
  className: "block h-full w-full object-cover"
719
- }) : n?.nickname?.[0] || n?.username?.[0] || "U"
720
- }), /* @__PURE__ */ P(C, {
794
+ }) : t?.nickname?.[0] || t?.username?.[0] || "U"
795
+ }), /* @__PURE__ */ L(E, {
721
796
  accept: "image/*",
722
797
  showUploadList: !1,
723
798
  beforeUpload: async (e) => {
724
- if (e.size > He) return w(u.profileAvatarTooLarge), !1;
799
+ if (e.size > at) return C(u.profileAvatarTooLarge), !1;
725
800
  try {
726
- let { width: t, height: n } = await Ue(e);
727
- if (t > Ve || n > Ve) return w(u.profileAvatarDimensionExceeded), !1;
801
+ let { width: t, height: n } = await ot(e);
802
+ if (t > it || n > it) return C(u.profileAvatarDimensionExceeded), !1;
728
803
  } catch (e) {
729
- return w(u.profileAvatarInvalidImage, e), !1;
804
+ return C(u.profileAvatarInvalidImage, e), !1;
730
805
  }
731
806
  return x((t) => {
732
807
  t && URL.revokeObjectURL(t);
@@ -734,14 +809,14 @@ function We({ visible: e, user: n, labels: s, onCancel: c, onSubmit: l }) {
734
809
  return S.current = n, n;
735
810
  }), y(e), !1;
736
811
  },
737
- children: /* @__PURE__ */ P(o, {
812
+ children: /* @__PURE__ */ L(c, {
738
813
  type: "outline",
739
814
  size: "small",
740
- icon: /* @__PURE__ */ P(M, {}),
815
+ icon: /* @__PURE__ */ L(I, {}),
741
816
  children: u.profileUploadAvatar
742
817
  })
743
818
  })]
744
- }), /* @__PURE__ */ P("span", {
819
+ }), /* @__PURE__ */ L("span", {
745
820
  className: "text-xs text-arco-text-3",
746
821
  children: u.profileAvatarHint
747
822
  })]
@@ -752,45 +827,70 @@ function We({ visible: e, user: n, labels: s, onCancel: c, onSubmit: l }) {
752
827
  }
753
828
  //#endregion
754
829
  //#region src/header/components/UserAvatar.tsx
755
- function Ge(e) {
830
+ function ct(e) {
756
831
  return e?.nickname?.[0] || e?.username?.[0] || "U";
757
832
  }
758
- function $({ user: e, size: t, className: n = "" }) {
759
- return /* @__PURE__ */ P(a, {
833
+ function lt({ user: e, size: t, className: n = "" }) {
834
+ return /* @__PURE__ */ L(s, {
760
835
  size: t,
761
836
  className: `bg-arco-primary/20! text-arco-primary-6 border-2 font-bold ${n}`,
762
- children: e?.avatar ? /* @__PURE__ */ P("img", {
837
+ children: e?.avatar ? /* @__PURE__ */ L("img", {
763
838
  src: e.avatar,
764
839
  alt: "avatar",
765
840
  className: "h-full w-full object-cover"
766
- }) : Ge(e)
841
+ }) : ct(e)
767
842
  });
768
843
  }
769
844
  //#endregion
770
845
  //#region src/header/components/RechargeModal.tsx
771
- function Ke({ visible: e, user: t, points: n, text: r, onCancel: a, onPay: c }) {
772
- let [l, u] = i(Q[2].id), d = (e) => new Intl.NumberFormat().format(e), p = Q.find((e) => e.id === l) || Q[0];
773
- return /* @__PURE__ */ P(g, {
774
- title: r.rechargeTitle,
846
+ var ut = {
847
+ minHeight: 292,
848
+ height: "100%",
849
+ display: "flex",
850
+ flexDirection: "column",
851
+ justifyContent: "space-between"
852
+ }, dt = "relative h-full! min-h-[292px]! w-full! overflow-hidden rounded-lg! border shadow-sm! transition-all duration-200 before:absolute before:inset-x-0 before:top-0 before:h-1 before:bg-linear-to-r before:from-arco-primary before:to-transparent hover:shadow-md! [&_.arco-card-body]:flex! [&_.arco-card-body]:h-full! [&_.arco-card-body]:flex-col! [&_.arco-card-body]:justify-between!";
853
+ function ft({ visible: e, user: t, points: r, text: o, packages: s, packageLoading: u = !1, submitting: d = !1, onCancel: f, onPay: p }) {
854
+ let [g, _] = a(Ye[2].id), [y, b] = a(""), x = i(null), S = s?.length ? s : Ye, C = (e) => new Intl.NumberFormat().format(e), E = y.trim(), O = Number(E), k = E.length > 0, A = g === "custom", j = k && Number.isFinite(O) && Number.isInteger(O) && O >= 10, M = S.find((e) => e.id === g), N = A && j ? {
855
+ id: "custom",
856
+ price: O,
857
+ points: O * 100,
858
+ custom: !0
859
+ } : M, P = N ? `${o.payNow} · $${N.price}` : k ? o.customRechargeMinError : o.selectRechargePackage;
860
+ n(() => {
861
+ !e || A || S.some((e) => e.id === g) || _((S.find((e) => e.recommended) || S[0])?.id || "custom");
862
+ }, [
863
+ S,
864
+ A,
865
+ g,
866
+ e
867
+ ]);
868
+ let F = (e) => {
869
+ _(e), b("");
870
+ }, I = () => {
871
+ _("custom"), b((e) => e || "10"), x.current?.focus();
872
+ };
873
+ return /* @__PURE__ */ L(v, {
874
+ title: o.rechargeTitle,
775
875
  visible: e,
776
- footer: /* @__PURE__ */ F("div", {
876
+ footer: /* @__PURE__ */ R("div", {
777
877
  className: "mx-auto flex max-w-7xl items-center justify-between gap-5",
778
- children: [/* @__PURE__ */ P("span", {
878
+ children: [/* @__PURE__ */ L("span", {
779
879
  className: "text-arco-text-2 text-sm leading-6",
780
- children: r.rechargeHint
781
- }), /* @__PURE__ */ F(o, {
880
+ children: o.rechargeHint
881
+ }), /* @__PURE__ */ L(c, {
782
882
  type: "primary",
783
883
  size: "large",
784
884
  className: "min-w-48! font-bold!",
785
- onClick: () => c(p),
786
- children: [
787
- r.payNow,
788
- " · $",
789
- p.price
790
- ]
885
+ disabled: !N || u || d,
886
+ loading: d,
887
+ onClick: () => {
888
+ N && p(N);
889
+ },
890
+ children: P
791
891
  })]
792
892
  }),
793
- onCancel: a,
893
+ onCancel: f,
794
894
  alignCenter: !1,
795
895
  wrapClassName: "overflow-hidden!",
796
896
  style: {
@@ -800,173 +900,1346 @@ function Ke({ visible: e, user: t, points: n, text: r, onCancel: a, onPay: c })
800
900
  paddingBottom: 0
801
901
  },
802
902
  className: "top-0! m-0! flex! h-screen! w-screen! max-w-none! flex-col! [&_.arco-modal-body]:min-h-0! [&_.arco-modal-body]:flex-1! [&_.arco-modal-body]:overflow-hidden! [&_.arco-modal-body]:p-0! [&_.arco-modal-close-icon]:top-1.5! [&_.arco-modal-close-icon]:right-4! [&_.arco-modal-close-icon]:inline-flex! [&_.arco-modal-close-icon]:h-9! [&_.arco-modal-close-icon]:w-9! [&_.arco-modal-close-icon]:items-center! [&_.arco-modal-close-icon]:justify-center! [&_.arco-modal-close-icon]:rounded-lg! [&_.arco-modal-close-icon]:text-lg! [&_.arco-modal-close-icon]:leading-9! [&_.arco-modal-close-icon]:transition-colors [&_.arco-modal-close-icon:hover]:bg-arco-fill-2 [&_.arco-modal-close-icon:hover]:text-arco-primary-6 [&_.arco-modal-close-icon_svg]:h-[18px]! [&_.arco-modal-close-icon_svg]:w-[18px]! [&_.arco-modal-content]:flex! [&_.arco-modal-content]:h-auto! [&_.arco-modal-content]:min-h-0! [&_.arco-modal-content]:flex-1! [&_.arco-modal-content]:flex-col! [&_.arco-modal-content]:overflow-hidden! [&_.arco-modal-content]:rounded-none! [&_.arco-modal-footer]:shrink-0! [&_.arco-modal-header]:shrink-0!",
803
- children: /* @__PURE__ */ F("div", {
903
+ children: /* @__PURE__ */ R("div", {
804
904
  className: "mx-auto flex h-full w-full max-w-7xl flex-col items-center ",
805
- children: [/* @__PURE__ */ F("div", {
905
+ children: [/* @__PURE__ */ R("div", {
806
906
  className: "w-full border-arco-border-1 bg-arco-fill-1 text-arco-text-2 flex items-center gap-2.5 rounded-lg border px-3.5 py-3 text-sm",
807
- children: [/* @__PURE__ */ P($, {
907
+ children: [/* @__PURE__ */ L(lt, {
808
908
  user: t,
809
909
  size: 32,
810
910
  className: "shrink-0"
811
- }), /* @__PURE__ */ F("span", { children: [
911
+ }), /* @__PURE__ */ R("span", { children: [
812
912
  t?.nickname || t?.username,
813
913
  " · ",
814
- r.currentBalance,
914
+ o.currentBalance,
815
915
  " ",
816
- /* @__PURE__ */ P("strong", {
916
+ /* @__PURE__ */ L("strong", {
817
917
  className: "text-arco-text-1",
818
- children: d(n.total)
918
+ children: C(r.total)
819
919
  }),
820
920
  " ",
821
- r.pointsUnit
921
+ o.pointsUnit
822
922
  ] })]
823
- }), /* @__PURE__ */ P("div", {
923
+ }), /* @__PURE__ */ L("div", {
824
924
  className: "mt-6 w-full",
825
- children: /* @__PURE__ */ P(f.Row, {
925
+ children: /* @__PURE__ */ R(m.Row, {
826
926
  gutter: [16, 16],
827
- children: Q.map((e) => /* @__PURE__ */ P(f.Col, {
927
+ style: { alignItems: "stretch" },
928
+ children: [S.map((e) => /* @__PURE__ */ L(m.Col, {
828
929
  xs: 24,
829
930
  sm: 12,
830
931
  lg: 6,
831
- children: /* @__PURE__ */ F(s, {
932
+ style: { display: "flex" },
933
+ children: /* @__PURE__ */ R(l, {
832
934
  hoverable: !0,
935
+ loading: u,
833
936
  role: "button",
834
937
  tabIndex: 0,
835
- onClick: () => u(e.id),
938
+ onClick: () => F(e.id),
836
939
  onKeyDown: (t) => {
837
- (t.key === "Enter" || t.key === " ") && u(e.id);
940
+ (t.key === "Enter" || t.key === " ") && F(e.id);
838
941
  },
839
- bodyStyle: {
840
- minHeight: 192,
841
- display: "flex",
842
- flexDirection: "column",
843
- justifyContent: "space-between"
844
- },
845
- className: `border-arco-border-2! bg-arco-bg-2! relative cursor-pointer overflow-hidden rounded-lg! shadow-sm! transition-all duration-200 before:absolute before:inset-x-0 before:top-0 before:h-1 before:bg-linear-to-r before:from-arco-primary before:to-transparent hover:shadow-md! ${l === e.id ? "border-arco-primary-6! bg-arco-primary-light-1/40! ring-arco-primary-6/20 ring-2! shadow-[0_18px_38px_rgb(var(--primary-6)/22%)]!" : "hover:border-arco-primary-6!"}`,
942
+ bodyStyle: ut,
943
+ className: `${dt} border-arco-border-2! bg-arco-bg-2! cursor-pointer ${g === e.id ? "border-arco-primary-6! bg-arco-primary-light-1/40! ring-arco-primary-6/20 ring-2! shadow-[0_18px_38px_rgb(var(--primary-6)/22%)]!" : "hover:border-arco-primary-6!"}`,
846
944
  children: [
847
- l === e.id ? /* @__PURE__ */ P(w, { className: "text-arco-primary-6! absolute bottom-4 left-4 text-xl" }) : null,
848
- "recommended" in e && e.recommended ? /* @__PURE__ */ P(x, {
945
+ g === e.id ? /* @__PURE__ */ L(D, { className: "text-arco-primary-6! absolute bottom-4 left-4 text-xl" }) : null,
946
+ "recommended" in e && e.recommended ? /* @__PURE__ */ L(w, {
849
947
  color: "arcoblue",
850
948
  className: "absolute top-4 right-4 text-xs! font-bold!",
851
949
  children: "HOT"
852
950
  }) : null,
853
- /* @__PURE__ */ F("div", {
951
+ /* @__PURE__ */ R("div", {
854
952
  className: "min-w-0 pr-16",
855
- children: [/* @__PURE__ */ F(S.Text, {
953
+ children: [/* @__PURE__ */ R(T.Text, {
856
954
  className: "flex items-center text-3xl! leading-tight! font-bold!",
857
- children: [d(e.points), /* @__PURE__ */ P("span", {
955
+ children: [C(e.points), /* @__PURE__ */ L("span", {
858
956
  className: "ml-1 text-2xl",
859
957
  children: "🪙"
860
958
  })]
861
- }), /* @__PURE__ */ P(S.Text, {
959
+ }), /* @__PURE__ */ L(T.Text, {
862
960
  type: "secondary",
863
961
  className: "mt-1 block! text-sm!",
864
- children: r.pointsUnit
962
+ children: o.pointsUnit
865
963
  })]
866
964
  }),
867
- /* @__PURE__ */ P("div", {
965
+ /* @__PURE__ */ L("div", {
868
966
  className: "mt-7 flex w-full justify-end",
869
- children: /* @__PURE__ */ F(S.Text, {
967
+ children: /* @__PURE__ */ R(T.Text, {
870
968
  className: "text-arco-primary-6! text-right text-2xl! leading-tight! font-bold!",
871
969
  children: ["$", e.price]
872
970
  })
873
971
  })
874
972
  ]
875
973
  })
876
- }, e.id))
974
+ }, e.id)), /* @__PURE__ */ L(m.Col, {
975
+ xs: 24,
976
+ sm: 12,
977
+ lg: 6,
978
+ style: { display: "flex" },
979
+ children: /* @__PURE__ */ R(l, {
980
+ role: "button",
981
+ tabIndex: 0,
982
+ onClick: I,
983
+ onKeyDown: (e) => {
984
+ (e.key === "Enter" || e.key === " ") && I();
985
+ },
986
+ bodyStyle: ut,
987
+ className: `${dt} cursor-text ${j ? "border-arco-primary-6! bg-arco-primary-light-1/40! ring-arco-primary-6/20 ring-2! shadow-[0_18px_38px_rgb(var(--primary-6)/22%)]!" : k && A ? "border-arco-danger-6! bg-arco-bg-1! hover:border-arco-danger-6!" : "border-arco-primary-6/30! bg-arco-primary-light-1/20! hover:border-arco-primary-6!"}`,
988
+ children: [
989
+ j ? /* @__PURE__ */ L(D, { className: "text-arco-primary-6! absolute top-4 right-4 text-xl" }) : null,
990
+ /* @__PURE__ */ R("div", {
991
+ className: "flex min-w-0 flex-col gap-2.5",
992
+ children: [
993
+ /* @__PURE__ */ R("div", {
994
+ className: "flex min-w-0 flex-col gap-2.5 pr-8",
995
+ children: [/* @__PURE__ */ L(w, {
996
+ color: "arcoblue",
997
+ className: "w-fit text-xs! font-bold!",
998
+ children: o.customRechargeAmount
999
+ }), /* @__PURE__ */ L(T.Text, {
1000
+ type: "secondary",
1001
+ className: "block! text-sm! leading-5! ",
1002
+ children: o.customRechargeDescription
1003
+ })]
1004
+ }),
1005
+ /* @__PURE__ */ L("div", {
1006
+ className: "mt-1",
1007
+ onClick: (e) => e.stopPropagation(),
1008
+ children: /* @__PURE__ */ L(h, {
1009
+ ref: x,
1010
+ type: "text",
1011
+ inputMode: "numeric",
1012
+ pattern: "[0-9]*",
1013
+ value: y,
1014
+ placeholder: "10",
1015
+ onFocus: I,
1016
+ onChange: (e) => {
1017
+ _("custom"), b(e.replace(/\D/g, ""));
1018
+ },
1019
+ prefix: /* @__PURE__ */ L("span", {
1020
+ className: "text-arco-primary-6 text-base font-semibold",
1021
+ children: "$"
1022
+ }),
1023
+ suffix: /* @__PURE__ */ L("span", {
1024
+ className: "text-arco-primary-6 text-xs font-semibold",
1025
+ children: "USD"
1026
+ }),
1027
+ height: 48,
1028
+ status: k && A && !j ? "error" : void 0,
1029
+ className: `w-full! rounded-md! shadow-[0_0_0_3px_rgb(var(--primary-6)/8%)] transition-all [&_.arco-input]:text-xl! [&_.arco-input]:font-bold! [&_.arco-input]:text-arco-text-1! [&_.arco-input]:[font-family:var(--font-display)] [&_.arco-input-inner-wrapper]:border-2! [&_.arco-input-inner-wrapper]:bg-arco-bg-1! [&_.arco-input-inner-wrapper]:px-3! [&_.arco-input-inner-wrapper]:shadow-none! [&_.arco-input-inner-wrapper-focus]:border-arco-primary-6! [&_.arco-input-inner-wrapper-focus]:shadow-[0_0_0_4px_rgb(var(--primary-6)/14%)]! ${k && A && !j ? "[&_.arco-input-inner-wrapper]:border-arco-danger-6! shadow-[0_0_0_3px_rgb(var(--danger-6)/12%)]" : "[&_.arco-input-inner-wrapper]:border-arco-primary-6/50!"}`
1030
+ })
1031
+ }),
1032
+ /* @__PURE__ */ L("div", {
1033
+ className: "h-4",
1034
+ children: /* @__PURE__ */ L(T.Text, {
1035
+ type: "error",
1036
+ className: `block! text-xs! leading-4! transition-opacity ${k && A && !j ? "opacity-100" : "opacity-0"}`,
1037
+ children: o.customRechargeMinError
1038
+ })
1039
+ })
1040
+ ]
1041
+ }),
1042
+ /* @__PURE__ */ R("div", {
1043
+ className: "border-arco-primary-6/20! bg-arco-bg-1!/80 mt-3 rounded-md border px-3.5 py-3 shadow-sm",
1044
+ children: [
1045
+ /* @__PURE__ */ L(T.Text, {
1046
+ type: "secondary",
1047
+ className: "block! text-xs!",
1048
+ children: o.customRechargeEstimate
1049
+ }),
1050
+ /* @__PURE__ */ R(T.Text, {
1051
+ className: "text-arco-primary-6! mt-1 block! text-xl! leading-tight! font-bold!",
1052
+ children: [j ? C(O * 100) : "-", /* @__PURE__ */ L("span", {
1053
+ className: "text-arco-text-3 ml-1 text-xs font-normal",
1054
+ children: o.pointsUnit
1055
+ })]
1056
+ }),
1057
+ /* @__PURE__ */ L(T.Text, {
1058
+ type: "secondary",
1059
+ className: "mt-0.5 block! text-[10px]!",
1060
+ children: o.customRechargeRate
1061
+ })
1062
+ ]
1063
+ })
1064
+ ]
1065
+ })
1066
+ })]
877
1067
  })
878
1068
  })]
879
1069
  })
880
1070
  });
881
1071
  }
882
1072
  //#endregion
1073
+ //#region node_modules/prop-types/node_modules/react-is/cjs/react-is.production.min.js
1074
+ var pt = /* @__PURE__ */ U(((e) => {
1075
+ var t = typeof Symbol == "function" && Symbol.for, n = t ? Symbol.for("react.element") : 60103, r = t ? Symbol.for("react.portal") : 60106, i = t ? Symbol.for("react.fragment") : 60107, a = t ? Symbol.for("react.strict_mode") : 60108, o = t ? Symbol.for("react.profiler") : 60114, s = t ? Symbol.for("react.provider") : 60109, c = t ? Symbol.for("react.context") : 60110, l = t ? Symbol.for("react.async_mode") : 60111, u = t ? Symbol.for("react.concurrent_mode") : 60111, d = t ? Symbol.for("react.forward_ref") : 60112, f = t ? Symbol.for("react.suspense") : 60113, p = t ? Symbol.for("react.suspense_list") : 60120, m = t ? Symbol.for("react.memo") : 60115, h = t ? Symbol.for("react.lazy") : 60116, g = t ? Symbol.for("react.block") : 60121, _ = t ? Symbol.for("react.fundamental") : 60117, v = t ? Symbol.for("react.responder") : 60118, y = t ? Symbol.for("react.scope") : 60119;
1076
+ function b(e) {
1077
+ if (typeof e == "object" && e) {
1078
+ var t = e.$$typeof;
1079
+ switch (t) {
1080
+ case n: switch (e = e.type, e) {
1081
+ case l:
1082
+ case u:
1083
+ case i:
1084
+ case o:
1085
+ case a:
1086
+ case f: return e;
1087
+ default: switch (e &&= e.$$typeof, e) {
1088
+ case c:
1089
+ case d:
1090
+ case h:
1091
+ case m:
1092
+ case s: return e;
1093
+ default: return t;
1094
+ }
1095
+ }
1096
+ case r: return t;
1097
+ }
1098
+ }
1099
+ }
1100
+ function x(e) {
1101
+ return b(e) === u;
1102
+ }
1103
+ e.AsyncMode = l, e.ConcurrentMode = u, e.ContextConsumer = c, e.ContextProvider = s, e.Element = n, e.ForwardRef = d, e.Fragment = i, e.Lazy = h, e.Memo = m, e.Portal = r, e.Profiler = o, e.StrictMode = a, e.Suspense = f, e.isAsyncMode = function(e) {
1104
+ return x(e) || b(e) === l;
1105
+ }, e.isConcurrentMode = x, e.isContextConsumer = function(e) {
1106
+ return b(e) === c;
1107
+ }, e.isContextProvider = function(e) {
1108
+ return b(e) === s;
1109
+ }, e.isElement = function(e) {
1110
+ return typeof e == "object" && !!e && e.$$typeof === n;
1111
+ }, e.isForwardRef = function(e) {
1112
+ return b(e) === d;
1113
+ }, e.isFragment = function(e) {
1114
+ return b(e) === i;
1115
+ }, e.isLazy = function(e) {
1116
+ return b(e) === h;
1117
+ }, e.isMemo = function(e) {
1118
+ return b(e) === m;
1119
+ }, e.isPortal = function(e) {
1120
+ return b(e) === r;
1121
+ }, e.isProfiler = function(e) {
1122
+ return b(e) === o;
1123
+ }, e.isStrictMode = function(e) {
1124
+ return b(e) === a;
1125
+ }, e.isSuspense = function(e) {
1126
+ return b(e) === f;
1127
+ }, e.isValidElementType = function(e) {
1128
+ return typeof e == "string" || typeof e == "function" || e === i || e === u || e === o || e === a || e === f || e === p || typeof e == "object" && !!e && (e.$$typeof === h || e.$$typeof === m || e.$$typeof === s || e.$$typeof === c || e.$$typeof === d || e.$$typeof === _ || e.$$typeof === v || e.$$typeof === y || e.$$typeof === g);
1129
+ }, e.typeOf = b;
1130
+ })), mt = /* @__PURE__ */ U(((e) => {
1131
+ process.env.NODE_ENV !== "production" && (function() {
1132
+ var t = typeof Symbol == "function" && Symbol.for, n = t ? Symbol.for("react.element") : 60103, r = t ? Symbol.for("react.portal") : 60106, i = t ? Symbol.for("react.fragment") : 60107, a = t ? Symbol.for("react.strict_mode") : 60108, o = t ? Symbol.for("react.profiler") : 60114, s = t ? Symbol.for("react.provider") : 60109, c = t ? Symbol.for("react.context") : 60110, l = t ? Symbol.for("react.async_mode") : 60111, u = t ? Symbol.for("react.concurrent_mode") : 60111, d = t ? Symbol.for("react.forward_ref") : 60112, f = t ? Symbol.for("react.suspense") : 60113, p = t ? Symbol.for("react.suspense_list") : 60120, m = t ? Symbol.for("react.memo") : 60115, h = t ? Symbol.for("react.lazy") : 60116, g = t ? Symbol.for("react.block") : 60121, _ = t ? Symbol.for("react.fundamental") : 60117, v = t ? Symbol.for("react.responder") : 60118, y = t ? Symbol.for("react.scope") : 60119;
1133
+ function b(e) {
1134
+ return typeof e == "string" || typeof e == "function" || e === i || e === u || e === o || e === a || e === f || e === p || typeof e == "object" && !!e && (e.$$typeof === h || e.$$typeof === m || e.$$typeof === s || e.$$typeof === c || e.$$typeof === d || e.$$typeof === _ || e.$$typeof === v || e.$$typeof === y || e.$$typeof === g);
1135
+ }
1136
+ function x(e) {
1137
+ if (typeof e == "object" && e) {
1138
+ var t = e.$$typeof;
1139
+ switch (t) {
1140
+ case n:
1141
+ var p = e.type;
1142
+ switch (p) {
1143
+ case l:
1144
+ case u:
1145
+ case i:
1146
+ case o:
1147
+ case a:
1148
+ case f: return p;
1149
+ default:
1150
+ var g = p && p.$$typeof;
1151
+ switch (g) {
1152
+ case c:
1153
+ case d:
1154
+ case h:
1155
+ case m:
1156
+ case s: return g;
1157
+ default: return t;
1158
+ }
1159
+ }
1160
+ case r: return t;
1161
+ }
1162
+ }
1163
+ }
1164
+ var S = l, C = u, w = c, T = s, E = n, D = d, O = i, k = h, A = m, j = r, M = o, N = a, P = f, F = !1;
1165
+ function I(e) {
1166
+ return F || (F = !0, console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.")), ee(e) || x(e) === l;
1167
+ }
1168
+ function ee(e) {
1169
+ return x(e) === u;
1170
+ }
1171
+ function L(e) {
1172
+ return x(e) === c;
1173
+ }
1174
+ function R(e) {
1175
+ return x(e) === s;
1176
+ }
1177
+ function te(e) {
1178
+ return typeof e == "object" && !!e && e.$$typeof === n;
1179
+ }
1180
+ function z(e) {
1181
+ return x(e) === d;
1182
+ }
1183
+ function B(e) {
1184
+ return x(e) === i;
1185
+ }
1186
+ function ne(e) {
1187
+ return x(e) === h;
1188
+ }
1189
+ function V(e) {
1190
+ return x(e) === m;
1191
+ }
1192
+ function re(e) {
1193
+ return x(e) === r;
1194
+ }
1195
+ function H(e) {
1196
+ return x(e) === o;
1197
+ }
1198
+ function U(e) {
1199
+ return x(e) === a;
1200
+ }
1201
+ function W(e) {
1202
+ return x(e) === f;
1203
+ }
1204
+ e.AsyncMode = S, e.ConcurrentMode = C, e.ContextConsumer = w, e.ContextProvider = T, e.Element = E, e.ForwardRef = D, e.Fragment = O, e.Lazy = k, e.Memo = A, e.Portal = j, e.Profiler = M, e.StrictMode = N, e.Suspense = P, e.isAsyncMode = I, e.isConcurrentMode = ee, e.isContextConsumer = L, e.isContextProvider = R, e.isElement = te, e.isForwardRef = z, e.isFragment = B, e.isLazy = ne, e.isMemo = V, e.isPortal = re, e.isProfiler = H, e.isStrictMode = U, e.isSuspense = W, e.isValidElementType = b, e.typeOf = x;
1205
+ })();
1206
+ })), ht = /* @__PURE__ */ U(((e, t) => {
1207
+ process.env.NODE_ENV === "production" ? t.exports = pt() : t.exports = mt();
1208
+ })), gt = /* @__PURE__ */ U(((e, t) => {
1209
+ var n = Object.getOwnPropertySymbols, r = Object.prototype.hasOwnProperty, i = Object.prototype.propertyIsEnumerable;
1210
+ function a(e) {
1211
+ if (e == null) throw TypeError("Object.assign cannot be called with null or undefined");
1212
+ return Object(e);
1213
+ }
1214
+ function o() {
1215
+ try {
1216
+ if (!Object.assign) return !1;
1217
+ var e = /* @__PURE__ */ new String("abc");
1218
+ if (e[5] = "de", Object.getOwnPropertyNames(e)[0] === "5") return !1;
1219
+ for (var t = {}, n = 0; n < 10; n++) t["_" + String.fromCharCode(n)] = n;
1220
+ if (Object.getOwnPropertyNames(t).map(function(e) {
1221
+ return t[e];
1222
+ }).join("") !== "0123456789") return !1;
1223
+ var r = {};
1224
+ return "abcdefghijklmnopqrst".split("").forEach(function(e) {
1225
+ r[e] = e;
1226
+ }), Object.keys(Object.assign({}, r)).join("") === "abcdefghijklmnopqrst";
1227
+ } catch {
1228
+ return !1;
1229
+ }
1230
+ }
1231
+ t.exports = o() ? Object.assign : function(e, t) {
1232
+ for (var o, s = a(e), c, l = 1; l < arguments.length; l++) {
1233
+ for (var u in o = Object(arguments[l]), o) r.call(o, u) && (s[u] = o[u]);
1234
+ if (n) {
1235
+ c = n(o);
1236
+ for (var d = 0; d < c.length; d++) i.call(o, c[d]) && (s[c[d]] = o[c[d]]);
1237
+ }
1238
+ }
1239
+ return s;
1240
+ };
1241
+ })), _t = /* @__PURE__ */ U(((e, t) => {
1242
+ t.exports = "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";
1243
+ })), vt = /* @__PURE__ */ U(((e, t) => {
1244
+ t.exports = Function.call.bind(Object.prototype.hasOwnProperty);
1245
+ })), yt = /* @__PURE__ */ U(((e, t) => {
1246
+ var n = function() {};
1247
+ if (process.env.NODE_ENV !== "production") {
1248
+ var r = _t(), i = {}, a = vt();
1249
+ n = function(e) {
1250
+ var t = "Warning: " + e;
1251
+ typeof console < "u" && console.error(t);
1252
+ try {
1253
+ throw Error(t);
1254
+ } catch {}
1255
+ };
1256
+ }
1257
+ function o(e, t, o, s, c) {
1258
+ if (process.env.NODE_ENV !== "production") {
1259
+ for (var l in e) if (a(e, l)) {
1260
+ var u;
1261
+ try {
1262
+ if (typeof e[l] != "function") {
1263
+ var d = Error((s || "React class") + ": " + o + " type `" + l + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof e[l] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
1264
+ throw d.name = "Invariant Violation", d;
1265
+ }
1266
+ u = e[l](t, l, s, o, null, r);
1267
+ } catch (e) {
1268
+ u = e;
1269
+ }
1270
+ if (u && !(u instanceof Error) && n((s || "React class") + ": type specification of " + o + " `" + l + "` is invalid; the type checker function must return `null` or an `Error` but returned a " + typeof u + ". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."), u instanceof Error && !(u.message in i)) {
1271
+ i[u.message] = !0;
1272
+ var f = c ? c() : "";
1273
+ n("Failed " + o + " type: " + u.message + (f ?? ""));
1274
+ }
1275
+ }
1276
+ }
1277
+ }
1278
+ o.resetWarningCache = function() {
1279
+ process.env.NODE_ENV !== "production" && (i = {});
1280
+ }, t.exports = o;
1281
+ })), bt = /* @__PURE__ */ U(((e, t) => {
1282
+ var n = ht(), r = gt(), i = _t(), a = vt(), o = yt(), s = function() {};
1283
+ process.env.NODE_ENV !== "production" && (s = function(e) {
1284
+ var t = "Warning: " + e;
1285
+ typeof console < "u" && console.error(t);
1286
+ try {
1287
+ throw Error(t);
1288
+ } catch {}
1289
+ });
1290
+ function c() {
1291
+ return null;
1292
+ }
1293
+ t.exports = function(e, t) {
1294
+ var l = typeof Symbol == "function" && Symbol.iterator, u = "@@iterator";
1295
+ function d(e) {
1296
+ var t = e && (l && e[l] || e[u]);
1297
+ if (typeof t == "function") return t;
1298
+ }
1299
+ var f = "<<anonymous>>", p = {
1300
+ array: _("array"),
1301
+ bigint: _("bigint"),
1302
+ bool: _("boolean"),
1303
+ func: _("function"),
1304
+ number: _("number"),
1305
+ object: _("object"),
1306
+ string: _("string"),
1307
+ symbol: _("symbol"),
1308
+ any: v(),
1309
+ arrayOf: y,
1310
+ element: b(),
1311
+ elementType: x(),
1312
+ instanceOf: S,
1313
+ node: E(),
1314
+ objectOf: w,
1315
+ oneOf: C,
1316
+ oneOfType: T,
1317
+ shape: O,
1318
+ exact: k
1319
+ };
1320
+ function m(e, t) {
1321
+ return e === t ? e !== 0 || 1 / e == 1 / t : e !== e && t !== t;
1322
+ }
1323
+ function h(e, t) {
1324
+ this.message = e, this.data = t && typeof t == "object" ? t : {}, this.stack = "";
1325
+ }
1326
+ h.prototype = Error.prototype;
1327
+ function g(e) {
1328
+ if (process.env.NODE_ENV !== "production") var n = {}, r = 0;
1329
+ function a(a, o, c, l, u, d, p) {
1330
+ if (l ||= f, d ||= c, p !== i) {
1331
+ if (t) {
1332
+ var m = /* @__PURE__ */ Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types");
1333
+ throw m.name = "Invariant Violation", m;
1334
+ } else if (process.env.NODE_ENV !== "production" && typeof console < "u") {
1335
+ var g = l + ":" + c;
1336
+ !n[g] && r < 3 && (s("You are manually calling a React.PropTypes validation function for the `" + d + "` prop on `" + l + "`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."), n[g] = !0, r++);
1337
+ }
1338
+ }
1339
+ return o[c] == null ? a ? o[c] === null ? new h("The " + u + " `" + d + "` is marked as required " + ("in `" + l + "`, but its value is `null`.")) : new h("The " + u + " `" + d + "` is marked as required in " + ("`" + l + "`, but its value is `undefined`.")) : null : e(o, c, l, u, d);
1340
+ }
1341
+ var o = a.bind(null, !1);
1342
+ return o.isRequired = a.bind(null, !0), o;
1343
+ }
1344
+ function _(e) {
1345
+ function t(t, n, r, i, a, o) {
1346
+ var s = t[n];
1347
+ if (M(s) !== e) {
1348
+ var c = N(s);
1349
+ return new h("Invalid " + i + " `" + a + "` of type " + ("`" + c + "` supplied to `" + r + "`, expected ") + ("`" + e + "`."), { expectedType: e });
1350
+ }
1351
+ return null;
1352
+ }
1353
+ return g(t);
1354
+ }
1355
+ function v() {
1356
+ return g(c);
1357
+ }
1358
+ function y(e) {
1359
+ function t(t, n, r, a, o) {
1360
+ if (typeof e != "function") return new h("Property `" + o + "` of component `" + r + "` has invalid PropType notation inside arrayOf.");
1361
+ var s = t[n];
1362
+ if (!Array.isArray(s)) {
1363
+ var c = M(s);
1364
+ return new h("Invalid " + a + " `" + o + "` of type " + ("`" + c + "` supplied to `" + r + "`, expected an array."));
1365
+ }
1366
+ for (var l = 0; l < s.length; l++) {
1367
+ var u = e(s, l, r, a, o + "[" + l + "]", i);
1368
+ if (u instanceof Error) return u;
1369
+ }
1370
+ return null;
1371
+ }
1372
+ return g(t);
1373
+ }
1374
+ function b() {
1375
+ function t(t, n, r, i, a) {
1376
+ var o = t[n];
1377
+ if (!e(o)) {
1378
+ var s = M(o);
1379
+ return new h("Invalid " + i + " `" + a + "` of type " + ("`" + s + "` supplied to `" + r + "`, expected a single ReactElement."));
1380
+ }
1381
+ return null;
1382
+ }
1383
+ return g(t);
1384
+ }
1385
+ function x() {
1386
+ function e(e, t, r, i, a) {
1387
+ var o = e[t];
1388
+ if (!n.isValidElementType(o)) {
1389
+ var s = M(o);
1390
+ return new h("Invalid " + i + " `" + a + "` of type " + ("`" + s + "` supplied to `" + r + "`, expected a single ReactElement type."));
1391
+ }
1392
+ return null;
1393
+ }
1394
+ return g(e);
1395
+ }
1396
+ function S(e) {
1397
+ function t(t, n, r, i, a) {
1398
+ if (!(t[n] instanceof e)) {
1399
+ var o = e.name || f, s = F(t[n]);
1400
+ return new h("Invalid " + i + " `" + a + "` of type " + ("`" + s + "` supplied to `" + r + "`, expected ") + ("instance of `" + o + "`."));
1401
+ }
1402
+ return null;
1403
+ }
1404
+ return g(t);
1405
+ }
1406
+ function C(e) {
1407
+ if (!Array.isArray(e)) return process.env.NODE_ENV !== "production" && (arguments.length > 1 ? s("Invalid arguments supplied to oneOf, expected an array, got " + arguments.length + " arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z]).") : s("Invalid argument supplied to oneOf, expected an array.")), c;
1408
+ function t(t, n, r, i, a) {
1409
+ for (var o = t[n], s = 0; s < e.length; s++) if (m(o, e[s])) return null;
1410
+ var c = JSON.stringify(e, function(e, t) {
1411
+ return N(t) === "symbol" ? String(t) : t;
1412
+ });
1413
+ return new h("Invalid " + i + " `" + a + "` of value `" + String(o) + "` " + ("supplied to `" + r + "`, expected one of " + c + "."));
1414
+ }
1415
+ return g(t);
1416
+ }
1417
+ function w(e) {
1418
+ function t(t, n, r, o, s) {
1419
+ if (typeof e != "function") return new h("Property `" + s + "` of component `" + r + "` has invalid PropType notation inside objectOf.");
1420
+ var c = t[n], l = M(c);
1421
+ if (l !== "object") return new h("Invalid " + o + " `" + s + "` of type " + ("`" + l + "` supplied to `" + r + "`, expected an object."));
1422
+ for (var u in c) if (a(c, u)) {
1423
+ var d = e(c, u, r, o, s + "." + u, i);
1424
+ if (d instanceof Error) return d;
1425
+ }
1426
+ return null;
1427
+ }
1428
+ return g(t);
1429
+ }
1430
+ function T(e) {
1431
+ if (!Array.isArray(e)) return process.env.NODE_ENV !== "production" && s("Invalid argument supplied to oneOfType, expected an instance of array."), c;
1432
+ for (var t = 0; t < e.length; t++) {
1433
+ var n = e[t];
1434
+ if (typeof n != "function") return s("Invalid argument supplied to oneOfType. Expected an array of check functions, but received " + P(n) + " at index " + t + "."), c;
1435
+ }
1436
+ function r(t, n, r, o, s) {
1437
+ for (var c = [], l = 0; l < e.length; l++) {
1438
+ var u = e[l], d = u(t, n, r, o, s, i);
1439
+ if (d == null) return null;
1440
+ d.data && a(d.data, "expectedType") && c.push(d.data.expectedType);
1441
+ }
1442
+ var f = c.length > 0 ? ", expected one of type [" + c.join(", ") + "]" : "";
1443
+ return new h("Invalid " + o + " `" + s + "` supplied to " + ("`" + r + "`" + f + "."));
1444
+ }
1445
+ return g(r);
1446
+ }
1447
+ function E() {
1448
+ function e(e, t, n, r, i) {
1449
+ return A(e[t]) ? null : new h("Invalid " + r + " `" + i + "` supplied to " + ("`" + n + "`, expected a ReactNode."));
1450
+ }
1451
+ return g(e);
1452
+ }
1453
+ function D(e, t, n, r, i) {
1454
+ return new h((e || "React class") + ": " + t + " type `" + n + "." + r + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + i + "`.");
1455
+ }
1456
+ function O(e) {
1457
+ function t(t, n, r, a, o) {
1458
+ var s = t[n], c = M(s);
1459
+ if (c !== "object") return new h("Invalid " + a + " `" + o + "` of type `" + c + "` " + ("supplied to `" + r + "`, expected `object`."));
1460
+ for (var l in e) {
1461
+ var u = e[l];
1462
+ if (typeof u != "function") return D(r, a, o, l, N(u));
1463
+ var d = u(s, l, r, a, o + "." + l, i);
1464
+ if (d) return d;
1465
+ }
1466
+ return null;
1467
+ }
1468
+ return g(t);
1469
+ }
1470
+ function k(e) {
1471
+ function t(t, n, o, s, c) {
1472
+ var l = t[n], u = M(l);
1473
+ if (u !== "object") return new h("Invalid " + s + " `" + c + "` of type `" + u + "` " + ("supplied to `" + o + "`, expected `object`."));
1474
+ for (var d in r({}, t[n], e)) {
1475
+ var f = e[d];
1476
+ if (a(e, d) && typeof f != "function") return D(o, s, c, d, N(f));
1477
+ if (!f) return new h("Invalid " + s + " `" + c + "` key `" + d + "` supplied to `" + o + "`.\nBad object: " + JSON.stringify(t[n], null, " ") + "\nValid keys: " + JSON.stringify(Object.keys(e), null, " "));
1478
+ var p = f(l, d, o, s, c + "." + d, i);
1479
+ if (p) return p;
1480
+ }
1481
+ return null;
1482
+ }
1483
+ return g(t);
1484
+ }
1485
+ function A(t) {
1486
+ switch (typeof t) {
1487
+ case "number":
1488
+ case "string":
1489
+ case "undefined": return !0;
1490
+ case "boolean": return !t;
1491
+ case "object":
1492
+ if (Array.isArray(t)) return t.every(A);
1493
+ if (t === null || e(t)) return !0;
1494
+ var n = d(t);
1495
+ if (n) {
1496
+ var r = n.call(t), i;
1497
+ if (n !== t.entries) {
1498
+ for (; !(i = r.next()).done;) if (!A(i.value)) return !1;
1499
+ } else for (; !(i = r.next()).done;) {
1500
+ var a = i.value;
1501
+ if (a && !A(a[1])) return !1;
1502
+ }
1503
+ } else return !1;
1504
+ return !0;
1505
+ default: return !1;
1506
+ }
1507
+ }
1508
+ function j(e, t) {
1509
+ return e === "symbol" ? !0 : t ? t["@@toStringTag"] === "Symbol" || typeof Symbol == "function" && t instanceof Symbol : !1;
1510
+ }
1511
+ function M(e) {
1512
+ var t = typeof e;
1513
+ return Array.isArray(e) ? "array" : e instanceof RegExp ? "object" : j(t, e) ? "symbol" : t;
1514
+ }
1515
+ function N(e) {
1516
+ if (e == null) return "" + e;
1517
+ var t = M(e);
1518
+ if (t === "object") {
1519
+ if (e instanceof Date) return "date";
1520
+ if (e instanceof RegExp) return "regexp";
1521
+ }
1522
+ return t;
1523
+ }
1524
+ function P(e) {
1525
+ var t = N(e);
1526
+ switch (t) {
1527
+ case "array":
1528
+ case "object": return "an " + t;
1529
+ case "boolean":
1530
+ case "date":
1531
+ case "regexp": return "a " + t;
1532
+ default: return t;
1533
+ }
1534
+ }
1535
+ function F(e) {
1536
+ return !e.constructor || !e.constructor.name ? f : e.constructor.name;
1537
+ }
1538
+ return p.checkPropTypes = o, p.resetWarningCache = o.resetWarningCache, p.PropTypes = p, p;
1539
+ };
1540
+ })), xt = /* @__PURE__ */ U(((e, t) => {
1541
+ var n = _t();
1542
+ function r() {}
1543
+ function i() {}
1544
+ i.resetWarningCache = r, t.exports = function() {
1545
+ function e(e, t, r, i, a, o) {
1546
+ if (o !== n) {
1547
+ var s = /* @__PURE__ */ Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");
1548
+ throw s.name = "Invariant Violation", s;
1549
+ }
1550
+ }
1551
+ e.isRequired = e;
1552
+ function t() {
1553
+ return e;
1554
+ }
1555
+ var a = {
1556
+ array: e,
1557
+ bigint: e,
1558
+ bool: e,
1559
+ func: e,
1560
+ number: e,
1561
+ object: e,
1562
+ string: e,
1563
+ symbol: e,
1564
+ any: e,
1565
+ arrayOf: t,
1566
+ element: e,
1567
+ elementType: e,
1568
+ instanceOf: t,
1569
+ node: e,
1570
+ objectOf: t,
1571
+ oneOf: t,
1572
+ oneOfType: t,
1573
+ shape: t,
1574
+ exact: t,
1575
+ checkPropTypes: i,
1576
+ resetWarningCache: r
1577
+ };
1578
+ return a.PropTypes = a, a;
1579
+ };
1580
+ })), J = /* @__PURE__ */ ie((/* @__PURE__ */ U(((e, t) => {
1581
+ if (process.env.NODE_ENV !== "production") {
1582
+ var n = ht();
1583
+ t.exports = bt()(n.isElement, !0);
1584
+ } else t.exports = xt()();
1585
+ })))(), 1);
1586
+ function St(e, t) {
1587
+ var n = Object.keys(e);
1588
+ if (Object.getOwnPropertySymbols) {
1589
+ var r = Object.getOwnPropertySymbols(e);
1590
+ t && (r = r.filter(function(t) {
1591
+ return Object.getOwnPropertyDescriptor(e, t).enumerable;
1592
+ })), n.push.apply(n, r);
1593
+ }
1594
+ return n;
1595
+ }
1596
+ function Ct(e) {
1597
+ for (var t = 1; t < arguments.length; t++) {
1598
+ var n = arguments[t] == null ? {} : arguments[t];
1599
+ t % 2 ? St(Object(n), !0).forEach(function(t) {
1600
+ Tt(e, t, n[t]);
1601
+ }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n)) : St(Object(n)).forEach(function(t) {
1602
+ Object.defineProperty(e, t, Object.getOwnPropertyDescriptor(n, t));
1603
+ });
1604
+ }
1605
+ return e;
1606
+ }
1607
+ function wt(e) {
1608
+ "@babel/helpers - typeof";
1609
+ return wt = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(e) {
1610
+ return typeof e;
1611
+ } : function(e) {
1612
+ return e && typeof Symbol == "function" && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
1613
+ }, wt(e);
1614
+ }
1615
+ function Tt(e, t, n) {
1616
+ return t in e ? Object.defineProperty(e, t, {
1617
+ value: n,
1618
+ enumerable: !0,
1619
+ configurable: !0,
1620
+ writable: !0
1621
+ }) : e[t] = n, e;
1622
+ }
1623
+ function Et(e, t) {
1624
+ if (e == null) return {};
1625
+ var n = {}, r = Object.keys(e), i, a;
1626
+ for (a = 0; a < r.length; a++) i = r[a], !(t.indexOf(i) >= 0) && (n[i] = e[i]);
1627
+ return n;
1628
+ }
1629
+ function Dt(e, t) {
1630
+ if (e == null) return {};
1631
+ var n = Et(e, t), r, i;
1632
+ if (Object.getOwnPropertySymbols) {
1633
+ var a = Object.getOwnPropertySymbols(e);
1634
+ for (i = 0; i < a.length; i++) r = a[i], !(t.indexOf(r) >= 0) && Object.prototype.propertyIsEnumerable.call(e, r) && (n[r] = e[r]);
1635
+ }
1636
+ return n;
1637
+ }
1638
+ function Ot(e, t) {
1639
+ return kt(e) || At(e, t) || jt(e, t) || Nt();
1640
+ }
1641
+ function kt(e) {
1642
+ if (Array.isArray(e)) return e;
1643
+ }
1644
+ function At(e, t) {
1645
+ var n = e && (typeof Symbol < "u" && e[Symbol.iterator] || e["@@iterator"]);
1646
+ if (n != null) {
1647
+ var r = [], i = !0, a = !1, o, s;
1648
+ try {
1649
+ for (n = n.call(e); !(i = (o = n.next()).done) && (r.push(o.value), !(t && r.length === t)); i = !0);
1650
+ } catch (e) {
1651
+ a = !0, s = e;
1652
+ } finally {
1653
+ try {
1654
+ !i && n.return != null && n.return();
1655
+ } finally {
1656
+ if (a) throw s;
1657
+ }
1658
+ }
1659
+ return r;
1660
+ }
1661
+ }
1662
+ function jt(e, t) {
1663
+ if (e) {
1664
+ if (typeof e == "string") return Mt(e, t);
1665
+ var n = Object.prototype.toString.call(e).slice(8, -1);
1666
+ if (n === "Object" && e.constructor && (n = e.constructor.name), n === "Map" || n === "Set") return Array.from(e);
1667
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return Mt(e, t);
1668
+ }
1669
+ }
1670
+ function Mt(e, t) {
1671
+ (t == null || t > e.length) && (t = e.length);
1672
+ for (var n = 0, r = Array(t); n < t; n++) r[n] = e[n];
1673
+ return r;
1674
+ }
1675
+ function Nt() {
1676
+ throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
1677
+ }
1678
+ var Y = function(t, n, r) {
1679
+ var i = !!r, a = e.useRef(r);
1680
+ e.useEffect(function() {
1681
+ a.current = r;
1682
+ }, [r]), e.useEffect(function() {
1683
+ if (!i || !t) return function() {};
1684
+ var e = function() {
1685
+ a.current && a.current.apply(a, arguments);
1686
+ };
1687
+ return t.on(n, e), function() {
1688
+ t.off(n, e);
1689
+ };
1690
+ }, [
1691
+ i,
1692
+ n,
1693
+ t,
1694
+ a
1695
+ ]);
1696
+ }, X = function(t) {
1697
+ var n = e.useRef(t);
1698
+ return e.useEffect(function() {
1699
+ n.current = t;
1700
+ }, [t]), n.current;
1701
+ }, Z = function(e) {
1702
+ return e !== null && wt(e) === "object";
1703
+ }, Pt = function(e) {
1704
+ return Z(e) && typeof e.then == "function";
1705
+ }, Ft = function(e) {
1706
+ return Z(e) && typeof e.elements == "function" && typeof e.createToken == "function" && typeof e.createPaymentMethod == "function" && typeof e.confirmCardPayment == "function";
1707
+ }, It = "[object Object]", Lt = function e(t, n) {
1708
+ if (!Z(t) || !Z(n)) return t === n;
1709
+ var r = Array.isArray(t);
1710
+ if (r !== Array.isArray(n)) return !1;
1711
+ var i = Object.prototype.toString.call(t) === It;
1712
+ if (i !== (Object.prototype.toString.call(n) === It)) return !1;
1713
+ if (!i && !r) return t === n;
1714
+ var a = Object.keys(t), o = Object.keys(n);
1715
+ if (a.length !== o.length) return !1;
1716
+ for (var s = {}, c = 0; c < a.length; c += 1) s[a[c]] = !0;
1717
+ for (var l = 0; l < o.length; l += 1) s[o[l]] = !0;
1718
+ var u = Object.keys(s);
1719
+ if (u.length !== a.length) return !1;
1720
+ var d = t, f = n;
1721
+ return u.every(function(t) {
1722
+ return e(d[t], f[t]);
1723
+ });
1724
+ }, Rt = function(e, t, n) {
1725
+ return Z(e) ? Object.keys(e).reduce(function(r, i) {
1726
+ var a = !Z(t) || !Lt(e[i], t[i]);
1727
+ return n.includes(i) ? (a && console.warn(`Unsupported prop change: options.${i} is not a mutable property.`), r) : a ? Ct(Ct({}, r || {}), {}, Tt({}, i, e[i])) : r;
1728
+ }, null) : null;
1729
+ }, zt = "Invalid prop `stripe` supplied to `Elements`. We recommend using the `loadStripe` utility from `@stripe/stripe-js`. See https://stripe.com/docs/stripe-js/react#elements-props-stripe for details.", Bt = function(e) {
1730
+ var t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : zt;
1731
+ if (e === null || Ft(e)) return e;
1732
+ throw Error(t);
1733
+ }, Vt = function(e) {
1734
+ var t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : zt;
1735
+ if (Pt(e)) return {
1736
+ tag: "async",
1737
+ stripePromise: Promise.resolve(e).then(function(e) {
1738
+ return Bt(e, t);
1739
+ })
1740
+ };
1741
+ var n = Bt(e, t);
1742
+ return n === null ? { tag: "empty" } : {
1743
+ tag: "sync",
1744
+ stripe: n
1745
+ };
1746
+ }, Ht = function(e) {
1747
+ !e || !e._registerWrapper || !e.registerAppInfo || (e._registerWrapper({
1748
+ name: "react-stripe-js",
1749
+ version: "6.4.0"
1750
+ }), e.registerAppInfo({
1751
+ name: "react-stripe-js",
1752
+ version: "6.4.0",
1753
+ url: "https://stripe.com/docs/stripe-js/react"
1754
+ }));
1755
+ }, Ut = /* @__PURE__ */ e.createContext(null);
1756
+ Ut.displayName = "ElementsContext";
1757
+ var Wt = function(e, t) {
1758
+ if (!e) throw Error(`Could not find Elements context; You need to wrap the part of your app that ${t} in an <Elements> provider.`);
1759
+ return e;
1760
+ }, Gt = function(t) {
1761
+ var n = t.stripe, r = t.options, i = t.children, a = e.useMemo(function() {
1762
+ return Vt(n);
1763
+ }, [n]), o = Ot(e.useState(function() {
1764
+ return {
1765
+ stripe: a.tag === "sync" ? a.stripe : null,
1766
+ elements: a.tag === "sync" ? a.stripe.elements(r) : null
1767
+ };
1768
+ }), 2), s = o[0], c = o[1];
1769
+ e.useEffect(function() {
1770
+ var e = !0, t = function(e) {
1771
+ c(function(t) {
1772
+ return t.stripe ? t : {
1773
+ stripe: e,
1774
+ elements: e.elements(r)
1775
+ };
1776
+ });
1777
+ };
1778
+ return a.tag === "async" && !s.stripe ? a.stripePromise.then(function(n) {
1779
+ n && e && t(n);
1780
+ }) : a.tag === "sync" && !s.stripe && t(a.stripe), function() {
1781
+ e = !1;
1782
+ };
1783
+ }, [
1784
+ a,
1785
+ s,
1786
+ r
1787
+ ]);
1788
+ var l = X(n);
1789
+ e.useEffect(function() {
1790
+ l !== null && l !== n && console.warn("Unsupported prop change on Elements: You cannot change the `stripe` prop after setting it.");
1791
+ }, [l, n]);
1792
+ var u = X(r);
1793
+ return e.useEffect(function() {
1794
+ if (s.elements) {
1795
+ var e = Rt(r, u, ["clientSecret", "fonts"]);
1796
+ e && s.elements.update(e);
1797
+ }
1798
+ }, [
1799
+ r,
1800
+ u,
1801
+ s.elements
1802
+ ]), e.useEffect(function() {
1803
+ Ht(s.stripe);
1804
+ }, [s.stripe]), /* @__PURE__ */ e.createElement(Ut.Provider, { value: s }, i);
1805
+ };
1806
+ Gt.propTypes = {
1807
+ stripe: J.default.any,
1808
+ options: J.default.object
1809
+ };
1810
+ var Kt = function(t) {
1811
+ return Wt(e.useContext(Ut), t);
1812
+ }, qt = function(e) {
1813
+ var t = e.children;
1814
+ return t(Kt("mounts <ElementsConsumer>"));
1815
+ };
1816
+ qt.propTypes = { children: J.default.func.isRequired };
1817
+ var Jt = /* @__PURE__ */ e.createContext(null);
1818
+ Jt.displayName = "CheckoutContext";
1819
+ var Yt = function(t) {
1820
+ var n = e.useContext(Jt), r = e.useContext(Ut);
1821
+ if (n) {
1822
+ if (r) throw Error(`You cannot wrap the part of your app that ${t} in both a checkout provider and <Elements> provider.`);
1823
+ return n;
1824
+ } else return Wt(r, t);
1825
+ }, Xt = ["mode"], Zt = function(e) {
1826
+ return e.charAt(0).toUpperCase() + e.slice(1);
1827
+ }, Q = function(t, n, r) {
1828
+ var i = `${Zt(t)}Element`, a = n ? function(t) {
1829
+ Yt(`mounts <${i}>`);
1830
+ var n = t.id, r = t.className;
1831
+ return /* @__PURE__ */ e.createElement("div", {
1832
+ id: n,
1833
+ className: r
1834
+ });
1835
+ } : function(n) {
1836
+ var r = n.id, a = n.className, o = n.options, s = o === void 0 ? {} : o, c = n.onBlur, l = n.onFocus, u = n.onReady, d = n.onChange, f = n.onEscape, p = n.onClick, m = n.onLoadError, h = n.onLoaderStart, g = n.onNetworksChange, _ = n.onConfirm, v = n.onCancel, y = n.onShippingAddressChange, b = n.onShippingRateChange, x = n.onSavedPaymentMethodRemove, S = n.onSavedPaymentMethodUpdate, C = n.onAvailablePaymentMethodsChange, w = Yt(`mounts <${i}>`), T = "elements" in w ? w.elements : null, E = "checkoutState" in w ? w.checkoutState : null, D = E?.type === "success" || E?.type === "loading" ? E.sdk : null, O = Ot(e.useState(null), 2), k = O[0], A = O[1], j = e.useRef(null), M = e.useRef(null);
1837
+ Y(k, "blur", c), Y(k, "focus", l), Y(k, "escape", f), Y(k, "click", p), Y(k, "loaderror", m), Y(k, "loaderstart", h), Y(k, "networkschange", g), Y(k, "confirm", _), Y(k, "cancel", v), Y(k, "shippingaddresschange", y), Y(k, "shippingratechange", b), Y(k, "savedpaymentmethodremove", x), Y(k, "savedpaymentmethodupdate", S), Y(k, "availablepaymentmethodschange", C), Y(k, "change", d);
1838
+ var N;
1839
+ u && (N = t === "expressCheckout" ? u : function() {
1840
+ u(k);
1841
+ }), Y(k, "ready", N), e.useLayoutEffect(function() {
1842
+ if (j.current === null && M.current !== null && (T || D)) {
1843
+ var e = null;
1844
+ if (D) {
1845
+ var n = D, r = D;
1846
+ switch (t) {
1847
+ case "paymentForm":
1848
+ e = r.createForm(s);
1849
+ break;
1850
+ case "payment":
1851
+ e = n.createPaymentElement(s);
1852
+ break;
1853
+ case "address":
1854
+ if ("mode" in s) {
1855
+ var a = s.mode, o = Dt(s, Xt);
1856
+ if (a === "shipping") e = n.createShippingAddressElement(o);
1857
+ else if (a === "billing") e = n.createBillingAddressElement(o);
1858
+ else throw Error("Invalid options.mode. mode must be 'billing' or 'shipping'.");
1859
+ } else throw Error("You must supply options.mode. mode must be 'billing' or 'shipping'.");
1860
+ break;
1861
+ case "expressCheckout":
1862
+ e = n.createExpressCheckoutElement(s);
1863
+ break;
1864
+ case "currencySelector":
1865
+ e = D.createCurrencySelectorElement();
1866
+ break;
1867
+ case "taxId":
1868
+ e = n.createTaxIdElement(s);
1869
+ break;
1870
+ case "contactDetails":
1871
+ e = n.createContactDetailsElement();
1872
+ break;
1873
+ default: throw Error(`<${i}> is not supported inside a checkout provider. Use an <Elements> provider instead.`);
1874
+ }
1875
+ } else T && (e = T.create(t, s));
1876
+ j.current = e, A(e), e && e.mount(M.current);
1877
+ }
1878
+ }, [
1879
+ T,
1880
+ D,
1881
+ s
1882
+ ]);
1883
+ var P = X(s);
1884
+ return e.useEffect(function() {
1885
+ if (j.current) {
1886
+ var e = Rt(s, P, ["paymentRequest"]);
1887
+ e && "update" in j.current && j.current.update(e);
1888
+ }
1889
+ }, [s, P]), e.useLayoutEffect(function() {
1890
+ return function() {
1891
+ if (j.current && typeof j.current.destroy == "function") try {
1892
+ j.current.destroy(), j.current = null;
1893
+ } catch {}
1894
+ };
1895
+ }, []), /* @__PURE__ */ e.createElement("div", {
1896
+ id: r,
1897
+ className: a,
1898
+ ref: M
1899
+ });
1900
+ };
1901
+ return a.propTypes = {
1902
+ id: J.default.string,
1903
+ className: J.default.string,
1904
+ onChange: J.default.func,
1905
+ onBlur: J.default.func,
1906
+ onFocus: J.default.func,
1907
+ onReady: J.default.func,
1908
+ onEscape: J.default.func,
1909
+ onClick: J.default.func,
1910
+ onLoadError: J.default.func,
1911
+ onLoaderStart: J.default.func,
1912
+ onNetworksChange: J.default.func,
1913
+ onConfirm: J.default.func,
1914
+ onCancel: J.default.func,
1915
+ onShippingAddressChange: J.default.func,
1916
+ onShippingRateChange: J.default.func,
1917
+ onSavedPaymentMethodRemove: J.default.func,
1918
+ onSavedPaymentMethodUpdate: J.default.func,
1919
+ onAvailablePaymentMethodsChange: J.default.func,
1920
+ options: J.default.object
1921
+ }, a.displayName = i, a.__elementType = t, a;
1922
+ }, $ = typeof window > "u", Qt = /* @__PURE__ */ e.createContext(null);
1923
+ Qt.displayName = "EmbeddedCheckoutProviderContext";
1924
+ var $t = function() {
1925
+ var t = e.useContext(Qt);
1926
+ if (!t) throw Error("<EmbeddedCheckout> must be used within <EmbeddedCheckoutProvider>");
1927
+ return t;
1928
+ }, en = "Invalid prop `stripe` supplied to `EmbeddedCheckoutProvider`. We recommend using the `loadStripe` utility from `@stripe/stripe-js`. See https://stripe.com/docs/stripe-js/react#elements-props-stripe for details.", tn = function(t) {
1929
+ var n = t.stripe, r = t.options, i = t.children, a = e.useMemo(function() {
1930
+ return Vt(n, en);
1931
+ }, [n]), o = e.useRef(null), s = e.useRef(null), c = Ot(e.useState({ embeddedCheckout: null }), 2), l = c[0], u = c[1];
1932
+ e.useEffect(function() {
1933
+ if (!(s.current || o.current)) {
1934
+ var e = function(e) {
1935
+ s.current || o.current || (s.current = e, o.current = s.current.createEmbeddedCheckoutPage(r).then(function(e) {
1936
+ u({ embeddedCheckout: e });
1937
+ }));
1938
+ };
1939
+ a.tag === "async" && !s.current && (r.clientSecret || r.fetchClientSecret) ? a.stripePromise.then(function(t) {
1940
+ t && e(t);
1941
+ }) : a.tag === "sync" && !s.current && (r.clientSecret || r.fetchClientSecret) && e(a.stripe);
1942
+ }
1943
+ }, [
1944
+ a,
1945
+ r,
1946
+ l,
1947
+ s
1948
+ ]), e.useEffect(function() {
1949
+ return function() {
1950
+ l.embeddedCheckout ? (o.current = null, l.embeddedCheckout.destroy()) : o.current && o.current.then(function() {
1951
+ o.current = null, l.embeddedCheckout && l.embeddedCheckout.destroy();
1952
+ });
1953
+ };
1954
+ }, [l.embeddedCheckout]), e.useEffect(function() {
1955
+ Ht(s);
1956
+ }, [s]);
1957
+ var d = X(n);
1958
+ e.useEffect(function() {
1959
+ d !== null && d !== n && console.warn("Unsupported prop change on EmbeddedCheckoutProvider: You cannot change the `stripe` prop after setting it.");
1960
+ }, [d, n]);
1961
+ var f = X(r);
1962
+ return e.useEffect(function() {
1963
+ if (f != null) {
1964
+ if (r == null) {
1965
+ console.warn("Unsupported prop change on EmbeddedCheckoutProvider: You cannot unset options after setting them.");
1966
+ return;
1967
+ }
1968
+ r.clientSecret === void 0 && r.fetchClientSecret === void 0 && console.warn("Invalid props passed to EmbeddedCheckoutProvider: You must provide one of either `options.fetchClientSecret` or `options.clientSecret`."), f.clientSecret != null && r.clientSecret !== f.clientSecret && console.warn("Unsupported prop change on EmbeddedCheckoutProvider: You cannot change the client secret after setting it. Unmount and create a new instance of EmbeddedCheckoutProvider instead."), f.fetchClientSecret != null && r.fetchClientSecret !== f.fetchClientSecret && console.warn("Unsupported prop change on EmbeddedCheckoutProvider: You cannot change fetchClientSecret after setting it. Unmount and create a new instance of EmbeddedCheckoutProvider instead."), f.onComplete != null && r.onComplete !== f.onComplete && console.warn("Unsupported prop change on EmbeddedCheckoutProvider: You cannot change the onComplete option after setting it."), f.onShippingDetailsChange != null && r.onShippingDetailsChange !== f.onShippingDetailsChange && console.warn("Unsupported prop change on EmbeddedCheckoutProvider: You cannot change the onShippingDetailsChange option after setting it."), f.onLineItemsChange != null && r.onLineItemsChange !== f.onLineItemsChange && console.warn("Unsupported prop change on EmbeddedCheckoutProvider: You cannot change the onLineItemsChange option after setting it.");
1969
+ }
1970
+ }, [f, r]), /* @__PURE__ */ e.createElement(Qt.Provider, { value: l }, i);
1971
+ }, nn = $ ? function(t) {
1972
+ var n = t.id, r = t.className;
1973
+ return $t(), /* @__PURE__ */ e.createElement("div", {
1974
+ id: n,
1975
+ className: r
1976
+ });
1977
+ } : function(t) {
1978
+ var n = t.id, r = t.className, i = $t().embeddedCheckout, a = e.useRef(!1), o = e.useRef(null);
1979
+ return e.useLayoutEffect(function() {
1980
+ return !a.current && i && o.current !== null && (i.mount(o.current), a.current = !0), function() {
1981
+ if (a.current && i) try {
1982
+ i.unmount(), a.current = !1;
1983
+ } catch {}
1984
+ };
1985
+ }, [i]), /* @__PURE__ */ e.createElement("div", {
1986
+ ref: o,
1987
+ id: n,
1988
+ className: r
1989
+ });
1990
+ };
1991
+ Q("auBankAccount", $), Q("card", $), Q("cardNumber", $), Q("cardExpiry", $), Q("cardCvc", $), Q("iban", $), Q("payment", $), Q("expressCheckout", $), Q("paymentRequestButton", $), Q("linkAuthentication", $), Q("contactDetails", $), Q("address", $), Q("shippingAddress", $), Q("paymentMethodMessaging", $), Q("taxId", $), Q("issuingCardNumberDisplay", $), Q("issuingCardCvcDisplay", $), Q("issuingCardExpiryDisplay", $), Q("issuingCardPinDisplay", $), Q("issuingCardCopyButton", $);
1992
+ //#endregion
1993
+ //#region node_modules/@stripe/stripe-js/dist/index.mjs
1994
+ function rn(e) {
1995
+ "@babel/helpers - typeof";
1996
+ return rn = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(e) {
1997
+ return typeof e;
1998
+ } : function(e) {
1999
+ return e && typeof Symbol == "function" && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
2000
+ }, rn(e);
2001
+ }
2002
+ var an = "dahlia", on = function(e) {
2003
+ return e === 3 ? "v3" : e;
2004
+ }, sn = "https://js.stripe.com", cn = `${sn}/${an}/stripe.js`, ln = /^https:\/\/js\.stripe\.com\/v3\/?(\?.*)?$/, un = /^https:\/\/js\.stripe\.com\/(v3|[a-z]+)\/stripe\.js(\?.*)?$/, dn = "loadStripe.setLoadParameters was called but an existing Stripe.js script already exists in the document; existing script parameters will be used", fn = function(e) {
2005
+ return ln.test(e) || un.test(e);
2006
+ }, pn = function() {
2007
+ for (var e = document.querySelectorAll(`script[src^="${sn}"]`), t = 0; t < e.length; t++) {
2008
+ var n = e[t];
2009
+ if (fn(n.src)) return n;
2010
+ }
2011
+ return null;
2012
+ }, mn = function(e) {
2013
+ var t = e && !e.advancedFraudSignals ? "?advancedFraudSignals=false" : "", n = document.createElement("script");
2014
+ n.src = `${cn}${t}`;
2015
+ var r = document.head || document.body;
2016
+ if (!r) throw Error("Expected document.body not to be null. Stripe.js requires a <body> element.");
2017
+ return r.appendChild(n), n;
2018
+ }, hn = function(e, t) {
2019
+ !e || !e._registerWrapper || e._registerWrapper({
2020
+ name: "stripe-js",
2021
+ version: "9.6.0",
2022
+ startTime: t
2023
+ });
2024
+ }, gn = null, _n = null, vn = null, yn = function(e) {
2025
+ return function(t) {
2026
+ e(Error("Failed to load Stripe.js", { cause: t }));
2027
+ };
2028
+ }, bn = function(e, t) {
2029
+ return function() {
2030
+ window.Stripe ? e(window.Stripe) : t(/* @__PURE__ */ Error("Stripe.js not available"));
2031
+ };
2032
+ }, xn = function(e) {
2033
+ return gn === null ? (gn = new Promise(function(t, n) {
2034
+ if (typeof window > "u" || typeof document > "u") {
2035
+ t(null);
2036
+ return;
2037
+ }
2038
+ if (window.Stripe && e && console.warn(dn), window.Stripe) {
2039
+ t(window.Stripe);
2040
+ return;
2041
+ }
2042
+ try {
2043
+ var r = pn();
2044
+ if (r && e) console.warn(dn);
2045
+ else if (!r) r = mn(e);
2046
+ else if (r && vn !== null && _n !== null) {
2047
+ var i;
2048
+ r.removeEventListener("load", vn), r.removeEventListener("error", _n), (i = r.parentNode) == null || i.removeChild(r), r = mn(e);
2049
+ }
2050
+ vn = bn(t, n), _n = yn(n), r.addEventListener("load", vn), r.addEventListener("error", _n);
2051
+ } catch (e) {
2052
+ n(e);
2053
+ return;
2054
+ }
2055
+ }), gn.catch(function(e) {
2056
+ return gn = null, Promise.reject(e);
2057
+ })) : gn;
2058
+ }, Sn = function(e, t, n) {
2059
+ if (e === null) return null;
2060
+ var r = t[0];
2061
+ if (typeof r != "string") throw Error(`Expected publishable key to be of type string, got type ${rn(r)} instead.`);
2062
+ var i = r.match(/^pk_test/), a = on(e.version), o = an;
2063
+ i && a !== o && console.warn(`Stripe.js@${a} was loaded on the page, but @stripe/stripe-js@9.6.0 expected Stripe.js@${o}. This may result in unexpected behavior. For more information, see https://docs.stripe.com/sdks/stripejs-versioning`);
2064
+ var s = e.apply(void 0, t);
2065
+ return hn(s, n), s;
2066
+ }, Cn, wn = !1, Tn = function() {
2067
+ return Cn || (Cn = xn(null).catch(function(e) {
2068
+ return Cn = null, Promise.reject(e);
2069
+ }), Cn);
2070
+ };
2071
+ Promise.resolve().then(function() {
2072
+ return Tn();
2073
+ }).catch(function(e) {
2074
+ wn || console.warn(e);
2075
+ });
2076
+ var En = function() {
2077
+ var e = [...arguments];
2078
+ wn = !0;
2079
+ var t = Date.now();
2080
+ return Tn().then(function(n) {
2081
+ return Sn(n, e, t);
2082
+ });
2083
+ };
2084
+ //#endregion
2085
+ //#region src/header/components/StripePaymentModal.tsx
2086
+ function Dn({ visible: e, publishableKey: s, order: c, text: l, onCancel: u, onSuccess: d }) {
2087
+ let f = r(() => s ? En(s) : null, [s]), [p, m] = a(""), h = i(d), g = c?.clientSecret || c?.stripeClientSecret, _ = t(() => {
2088
+ h.current();
2089
+ }, []), y = r(() => g ? {
2090
+ clientSecret: g,
2091
+ onComplete: _
2092
+ } : void 0, [g, _]);
2093
+ n(() => {
2094
+ h.current = d;
2095
+ }, [d]), n(() => {
2096
+ if (m(""), !f) return;
2097
+ let e = !0;
2098
+ return f.then((t) => {
2099
+ e && !t && m(l.stripePaymentLoadFailed);
2100
+ }).catch((t) => {
2101
+ e && m(t instanceof Error ? t.message : l.stripePaymentLoadFailed);
2102
+ }), () => {
2103
+ e = !1;
2104
+ };
2105
+ }, [f, l.stripePaymentLoadFailed]);
2106
+ let b = s ? g ? g.startsWith("cs_") ? p ? /* @__PURE__ */ L(o, {
2107
+ type: "error",
2108
+ content: p
2109
+ }) : !f || !y ? /* @__PURE__ */ L("div", {
2110
+ className: "flex min-h-30 items-center justify-center",
2111
+ children: /* @__PURE__ */ L(x, { tip: l.stripePaymentLoading })
2112
+ }) : /* @__PURE__ */ R("div", {
2113
+ className: "flex h-full w-full flex-col gap-4",
2114
+ children: [/* @__PURE__ */ L(T.Text, {
2115
+ type: "secondary",
2116
+ className: "text-sm! leading-6!",
2117
+ children: l.stripePaymentDescription
2118
+ }), /* @__PURE__ */ L(tn, {
2119
+ stripe: f,
2120
+ options: y,
2121
+ children: /* @__PURE__ */ L(nn, { className: "min-h-[620px] w-full flex-1" })
2122
+ }, g)]
2123
+ }) : /* @__PURE__ */ L(o, {
2124
+ type: "error",
2125
+ content: l.stripeCheckoutClientSecretInvalid
2126
+ }) : /* @__PURE__ */ L(o, {
2127
+ type: "error",
2128
+ content: l.stripePaymentClientSecretMissing
2129
+ }) : /* @__PURE__ */ L(o, {
2130
+ type: "error",
2131
+ content: l.stripePaymentConfigMissing
2132
+ });
2133
+ return /* @__PURE__ */ L(v, {
2134
+ title: l.stripePaymentTitle,
2135
+ visible: e,
2136
+ footer: null,
2137
+ onCancel: u,
2138
+ alignCenter: !1,
2139
+ wrapStyle: { padding: 0 },
2140
+ style: {
2141
+ width: "100vw",
2142
+ maxWidth: "100vw",
2143
+ height: "100vh",
2144
+ top: 0,
2145
+ margin: 0,
2146
+ padding: 0
2147
+ },
2148
+ className: "flex! flex-col rounded-none! [&_.arco-modal-content]:flex-1 [&_.arco-modal-content]:overflow-auto",
2149
+ focusLock: !1,
2150
+ children: b
2151
+ });
2152
+ }
2153
+ //#endregion
883
2154
  //#region src/header/components/UserMenu.tsx
884
- function qe({ user: e, points: t, text: n, onEditProfile: r, onRecharge: i, onPointsDetail: a, onLogout: s }) {
885
- let c = (e) => new Intl.NumberFormat().format(e);
886
- return /* @__PURE__ */ F("div", {
2155
+ function On({ user: e, points: t, text: n, onEditProfile: r, onRecharge: i, onPointsDetail: a, onLogout: o }) {
2156
+ let s = (e) => new Intl.NumberFormat().format(e);
2157
+ return /* @__PURE__ */ R("div", {
887
2158
  className: "w-80 overflow-hidden rounded-xl border border-arco-border-2 bg-arco-bg-popup shadow-[0_10px_28px_rgb(0_0_0/12%)]",
888
2159
  children: [
889
- /* @__PURE__ */ F("div", {
2160
+ /* @__PURE__ */ R("div", {
890
2161
  className: "flex items-center gap-3 px-6 pt-5 pb-4",
891
- children: [/* @__PURE__ */ P($, {
2162
+ children: [/* @__PURE__ */ L(lt, {
892
2163
  user: e,
893
2164
  size: 48,
894
2165
  className: "shrink-0"
895
- }), /* @__PURE__ */ F("div", {
2166
+ }), /* @__PURE__ */ R("div", {
896
2167
  className: "flex min-w-0 flex-1 flex-col gap-1",
897
- children: [/* @__PURE__ */ F("div", {
2168
+ children: [/* @__PURE__ */ R("div", {
898
2169
  className: "flex min-w-0 items-center gap-1.5",
899
- children: [/* @__PURE__ */ P("span", {
2170
+ children: [/* @__PURE__ */ L("span", {
900
2171
  className: "text-arco-text-1 truncate text-base leading-6 font-bold",
901
2172
  children: e?.nickname || e?.username
902
- }), /* @__PURE__ */ P(o, {
2173
+ }), /* @__PURE__ */ L(c, {
903
2174
  type: "text",
904
2175
  size: "mini",
905
- icon: /* @__PURE__ */ P(E, {}),
2176
+ icon: /* @__PURE__ */ L(k, {}),
906
2177
  className: "text-arco-text-3 h-6! min-w-6! px-0!",
907
2178
  onClick: r
908
2179
  })]
909
- }), e?.email ? /* @__PURE__ */ P("span", {
2180
+ }), e?.email ? /* @__PURE__ */ L("span", {
910
2181
  className: "text-arco-text-3 truncate text-xs leading-5",
911
2182
  children: e.email
912
2183
  }) : null]
913
2184
  })]
914
2185
  }),
915
- /* @__PURE__ */ P(l, { className: "m-0!" }),
916
- /* @__PURE__ */ F("ul", {
2186
+ /* @__PURE__ */ L(d, { className: "m-0!" }),
2187
+ /* @__PURE__ */ R("ul", {
917
2188
  className: "flex flex-col gap-3.5 px-6 py-4",
918
2189
  children: [
919
- /* @__PURE__ */ F("li", {
2190
+ /* @__PURE__ */ R("li", {
920
2191
  className: "text-arco-text-2 flex items-center justify-between gap-4 text-sm",
921
- children: [/* @__PURE__ */ P("span", { children: n.myPoints }), /* @__PURE__ */ P("strong", {
2192
+ children: [/* @__PURE__ */ L("span", { children: n.myPoints }), /* @__PURE__ */ L("strong", {
922
2193
  className: "text-arco-primary-6 text-base font-bold",
923
- children: c(t.total)
2194
+ children: s(t.total)
924
2195
  })]
925
2196
  }),
926
- /* @__PURE__ */ F("li", {
2197
+ /* @__PURE__ */ R("li", {
927
2198
  className: "text-arco-text-2 flex items-center justify-between gap-4 text-sm",
928
- children: [/* @__PURE__ */ P("span", { children: n.rechargePoints }), /* @__PURE__ */ P("strong", {
2199
+ children: [/* @__PURE__ */ L("span", { children: n.rechargePoints }), /* @__PURE__ */ L("strong", {
929
2200
  className: "text-arco-text-1 text-base font-bold",
930
- children: c(t.recharge)
2201
+ children: s(t.recharge)
931
2202
  })]
932
2203
  }),
933
- /* @__PURE__ */ F("li", {
2204
+ /* @__PURE__ */ R("li", {
934
2205
  className: "text-arco-text-2 flex items-center justify-between gap-4 text-sm",
935
- children: [/* @__PURE__ */ P("span", { children: n.giftedPoints }), /* @__PURE__ */ P("strong", {
2206
+ children: [/* @__PURE__ */ L("span", { children: n.giftedPoints }), /* @__PURE__ */ L("strong", {
936
2207
  className: "text-arco-text-1 text-base font-bold",
937
- children: c(t.gifted)
2208
+ children: s(t.gifted)
938
2209
  })]
939
2210
  })
940
2211
  ]
941
2212
  }),
942
- /* @__PURE__ */ P(l, { className: "m-0!" }),
943
- /* @__PURE__ */ F("div", {
2213
+ /* @__PURE__ */ L(d, { className: "m-0!" }),
2214
+ /* @__PURE__ */ R("div", {
944
2215
  className: "flex flex-col gap-2 px-6 py-4",
945
- children: [/* @__PURE__ */ P(o, {
2216
+ children: [/* @__PURE__ */ L(c, {
946
2217
  type: "primary",
947
2218
  long: !0,
948
- icon: /* @__PURE__ */ P(k, {}),
949
- className: "h-10! rounded-md! font-semibold!",
2219
+ icon: /* @__PURE__ */ L(N, {}),
2220
+ shape: "round",
2221
+ className: "h-10! font-medium!",
950
2222
  onClick: i,
951
2223
  children: n.recharge
952
- }), /* @__PURE__ */ P(o, {
2224
+ }), /* @__PURE__ */ L(c, {
953
2225
  long: !0,
954
- icon: /* @__PURE__ */ P(D, {}),
955
- className: "border-arco-border-2! bg-arco-fill-1! text-arco-text-1! h-10! rounded-md! font-semibold!",
2226
+ shape: "round",
2227
+ icon: /* @__PURE__ */ L(A, {}),
2228
+ className: "border-arco-border-2! bg-arco-fill-1! text-arco-text-1! h-10! font-medium!",
956
2229
  onClick: a,
957
2230
  children: n.pointsDetail
958
2231
  })]
959
2232
  }),
960
- /* @__PURE__ */ P(l, { className: "m-0!" }),
961
- /* @__PURE__ */ P("div", {
2233
+ /* @__PURE__ */ L(d, { className: "m-0!" }),
2234
+ /* @__PURE__ */ L("div", {
962
2235
  className: "px-6 py-4",
963
- children: /* @__PURE__ */ P(o, {
964
- icon: /* @__PURE__ */ P(A, {}),
2236
+ children: /* @__PURE__ */ L(c, {
2237
+ icon: /* @__PURE__ */ L(P, {}),
965
2238
  type: "text",
966
2239
  status: "danger",
967
2240
  long: !0,
968
2241
  className: "flex! items-center justify-start gap-2 text-sm text-arco-text-2",
969
- onClick: () => void s?.(),
2242
+ onClick: () => void o?.(),
970
2243
  children: n.logout
971
2244
  })
972
2245
  })
@@ -975,246 +2248,296 @@ function qe({ user: e, points: t, text: n, onEditProfile: r, onRecharge: i, onPo
975
2248
  }
976
2249
  //#endregion
977
2250
  //#region src/header/ManturHeader.tsx
978
- var Je = "https://mantur.ai/images/logo.png", Ye = [
2251
+ var kn = "https://mantur.ai/images/logo.png", An = [
979
2252
  "from-arco-primary-light-1 to-arco-primary-light-2 text-arco-primary-6",
980
2253
  "from-arco-success-light-1 to-arco-success-light-2 text-arco-success-6",
981
2254
  "from-arco-warning-light-1 to-arco-warning-light-2 text-arco-warning-6",
982
2255
  "from-arco-danger-light-1 to-arco-danger-light-2 text-arco-danger-6"
983
2256
  ];
984
- function Xe(e, t = !1) {
985
- return `flex h-8 min-h-8 w-8 min-w-8 flex-none items-center justify-center rounded-lg bg-linear-to-br font-bold leading-none ${Ye[e % Ye.length]} ${t ? "shadow-[inset_0_1px_3px_rgb(0_0_0/8%)]" : ""}`;
2257
+ function jn(e, t = !1) {
2258
+ return `flex h-8 min-h-8 w-8 min-w-8 flex-none items-center justify-center rounded-lg bg-linear-to-br font-bold leading-none ${An[e % An.length]} ${t ? "shadow-[inset_0_1px_3px_rgb(0_0_0/8%)]" : ""}`;
986
2259
  }
987
- function Ze(e) {
2260
+ function Mn(e) {
988
2261
  return e?.tenantName?.[0]?.toUpperCase() || "T";
989
2262
  }
990
- function Qe(e, t, n) {
2263
+ function Nn(e, t, n) {
991
2264
  let r = e?.roles?.map((e) => e.roleName).filter(Boolean);
992
2265
  return r?.length ? r.join(", ") : e?.isOwner ? t : n;
993
2266
  }
994
- function $e({ user: a, disabled: o = !1, brandSlot: s, children: c, onTenantContextChange: l }) {
995
- let [d, f] = i(() => Z()), p = De(d), [g, _] = i(!1), [v, y] = i(!1), [b, x] = i(!1), [S, C] = i(a), [w, E] = i([]), [D, O] = i(), [ee, k] = i(!1), A = r(l), [j, M] = i({
2267
+ function Pn(e) {
2268
+ return e?.paymentUrl || e?.checkoutUrl || e?.url || e?.returnUrl;
2269
+ }
2270
+ function Fn(e) {
2271
+ return e?.clientSecret || e?.stripeClientSecret;
2272
+ }
2273
+ function In({ user: e, disabled: o = !1, brandSlot: s, children: c, onTenantContextChange: l, stripePublishableKey: u }) {
2274
+ let [d, p] = a(() => He()), m = Ue(d), [h, v] = a(!1), [y, b] = a(!1), [x, S] = a(!1), [C, w] = a(e), [T, E] = a([]), [D, k] = a(), [A, j] = a(!1), [M, N] = a(!1), [P, F] = a(!1), [I, ee] = a([]), [te, z] = a(), B = i(l), ne = u || (typeof window < "u" ? window.__MANTUR_COMPONENTS_STRIPE_PUBLISHABLE_KEY__ : void 0) || "pk_test_51TJ8JiERSsQknDG7bJSIX81RFq3LcCfUXCV7mh0cQsZ2dwmYcJ5Ki6bPXynNvdyZEEBE83I6I719NIFyO9Qreey700yPAul8sv", [V, re] = a({
996
2275
  total: 0,
997
2276
  recharge: 0,
998
2277
  gifted: 0
999
- }), N = D?.tenantId || "", I = o, L = {
1000
- total: j.total ?? 0,
1001
- recharge: j.recharge ?? 0,
1002
- gifted: j.gifted ?? 0
1003
- }, R = async (e) => {
1004
- let t = await de(e);
1005
- return t && C(t), t;
2278
+ }), H = D?.tenantId || "", U = o, W = {
2279
+ total: V.total ?? 0,
2280
+ recharge: V.recharge ?? 0,
2281
+ gifted: V.gifted ?? 0
2282
+ }, ie = async (e) => {
2283
+ let t = await ge(e);
2284
+ return t && w(t), t;
1006
2285
  };
1007
- t(() => {
1008
- C(a);
1009
- }, [a]), t(() => {
1010
- A.current = l;
2286
+ n(() => {
2287
+ w(e);
2288
+ }, [e]), n(() => {
2289
+ B.current = l;
1011
2290
  }, [l]);
1012
- let z = e((e) => {
1013
- E(e.tenants), O(e.currentTenant), A.current?.(e);
2291
+ let G = t((e) => {
2292
+ E(e.tenants), k(e.currentTenant), B.current?.(e);
1014
2293
  }, []);
1015
- t(() => {
1016
- k(!0), ve().then(z).catch((e) => {
1017
- console.warn("Failed to refresh Mantur tenant context.", e), h.error(p.error);
1018
- }).finally(() => k(!1));
1019
- }, [z, p.error]), t(() => {
2294
+ n(() => {
2295
+ j(!0), Me().then(G).catch((e) => {
2296
+ console.warn("Failed to refresh Mantur tenant context.", e), _.error(m.error);
2297
+ }).finally(() => j(!1));
2298
+ }, [G, m.error]), n(() => {
1020
2299
  let e = (e) => {
1021
- e instanceof CustomEvent && M(e.detail);
2300
+ e instanceof CustomEvent && re(e.detail);
1022
2301
  };
1023
- return window.addEventListener(U, e), q().catch((e) => {
2302
+ return window.addEventListener(oe, e), ye().catch((e) => {
1024
2303
  console.warn("Failed to refresh Mantur user points.", e);
1025
2304
  }), () => {
1026
- window.removeEventListener(U, e);
2305
+ window.removeEventListener(oe, e);
1027
2306
  };
1028
- }, []), t(() => {
2307
+ }, []), n(() => {
1029
2308
  let e = (e) => {
1030
- f(e instanceof CustomEvent ? X(e.detail) : Z());
2309
+ p(e instanceof CustomEvent ? q(e.detail) : He());
1031
2310
  };
1032
- return window.addEventListener(Y, e), window.addEventListener("storage", e), () => {
1033
- window.removeEventListener(Y, e), window.removeEventListener("storage", e);
2311
+ return window.addEventListener(Be, e), window.addEventListener("storage", e), () => {
2312
+ window.removeEventListener(Be, e), window.removeEventListener("storage", e);
1034
2313
  };
1035
- }, []);
1036
- let B = (e) => {
1037
- h.success(e);
1038
- }, V = (e, t) => {
1039
- console.error(t), h.error(e);
1040
- }, H = e(async (e) => {
1041
- if (!I && e !== N) try {
1042
- k(!0), z(await ye(e)), B(p.switchedToTeam);
2314
+ }, []), n(() => {
2315
+ y && (N(!0), be().then((e) => {
2316
+ let t = e.filter((e) => e.id && e.amount !== void 0 && e.points !== void 0).sort((e, t) => (e.sortOrder ?? 0) - (t.sortOrder ?? 0)).map((e) => ({
2317
+ id: e.id,
2318
+ packageCode: e.packageCode,
2319
+ packageName: e.packageName,
2320
+ packageNameEn: e.packageNameEn,
2321
+ price: Number(e.amount || 0),
2322
+ points: Number(e.points || 0),
2323
+ recommended: e.isRecommended,
2324
+ sortOrder: e.sortOrder
2325
+ }));
2326
+ t.length > 0 && ee(t);
2327
+ }).catch((e) => {
2328
+ console.warn("Failed to load Mantur recharge packages.", e);
2329
+ }).finally(() => N(!1)));
2330
+ }, [y]);
2331
+ let ae = (e) => {
2332
+ _.success(e);
2333
+ }, ce = (e, t) => {
2334
+ console.error(t), _.error(e);
2335
+ }, le = t(async (e) => {
2336
+ if (!U && e !== H) try {
2337
+ j(!0), G(await Ne(e)), ae(m.switchedToTeam);
1043
2338
  } catch (e) {
1044
- V(p.error, e);
2339
+ ce(m.error, e);
1045
2340
  } finally {
1046
- k(!1);
2341
+ j(!1);
1047
2342
  }
1048
2343
  }, [
1049
- z,
1050
- N,
1051
- I,
1052
- p.error,
1053
- p.switchedToTeam
1054
- ]), te = (e) => {
1055
- let t = {
1056
- total: L.total + e.points,
1057
- recharge: L.recharge + e.points,
1058
- gifted: L.gifted
1059
- };
1060
- M(t), window.dispatchEvent(new CustomEvent(U, { detail: t })), h.success(p.rechargeSuccess), y(!1);
1061
- }, ne = n(() => /* @__PURE__ */ F(m, {
2344
+ G,
2345
+ H,
2346
+ U,
2347
+ m.error,
2348
+ m.switchedToTeam
2349
+ ]), ue = async (e) => {
2350
+ try {
2351
+ F(!0);
2352
+ let t = await xe({ ..."custom" in e && e.custom ? { customAmount: e.price } : { packageId: e.id } });
2353
+ typeof window < "u" && window.dispatchEvent(new CustomEvent(se, { detail: t })), _.success(m.rechargeOrderCreated), b(!1);
2354
+ let n = Pn(t);
2355
+ if (Fn(t)) {
2356
+ z(t);
2357
+ return;
2358
+ }
2359
+ if (n) {
2360
+ window.location.href = n;
2361
+ return;
2362
+ }
2363
+ _.error(m.stripePaymentClientSecretMissing);
2364
+ } catch (e) {
2365
+ ce(m.error, e);
2366
+ } finally {
2367
+ F(!1);
2368
+ }
2369
+ }, de = r(() => /* @__PURE__ */ R(g, {
1062
2370
  className: "w-56 rounded-xl bg-arco-bg-popup shadow-[0_10px_28px_rgb(0_0_0/12%)] [&_.arco-menu-inner]:px-2 [&_.arco-menu-inner]:py-1",
1063
- selectedKeys: N ? [N] : [],
1064
- onClickMenuItem: H,
1065
- children: [/* @__PURE__ */ P("div", {
2371
+ selectedKeys: H ? [H] : [],
2372
+ onClickMenuItem: le,
2373
+ children: [/* @__PURE__ */ L("div", {
1066
2374
  className: "px-3 py-2 text-xs font-semibold tracking-[0.04em] text-arco-text-4 uppercase",
1067
- children: p.switchTeam
1068
- }), w.map((e, t) => /* @__PURE__ */ P(m.Item, {
2375
+ children: m.switchTeam
2376
+ }), T.map((e, t) => /* @__PURE__ */ L(g.Item, {
1069
2377
  className: "mb-1 h-auto! min-h-10! overflow-visible! rounded-lg! px-2! py-1! leading-normal!",
1070
- children: /* @__PURE__ */ F("div", {
2378
+ children: /* @__PURE__ */ R("div", {
1071
2379
  className: "flex w-full items-center gap-3 leading-normal",
1072
- children: [/* @__PURE__ */ P("div", {
1073
- className: Xe(t),
1074
- children: Ze(e)
1075
- }), /* @__PURE__ */ F("div", {
2380
+ children: [/* @__PURE__ */ L("div", {
2381
+ className: jn(t),
2382
+ children: Mn(e)
2383
+ }), /* @__PURE__ */ R("div", {
1076
2384
  className: "flex min-w-0 flex-col justify-center gap-0.75",
1077
- children: [/* @__PURE__ */ P("span", {
2385
+ children: [/* @__PURE__ */ L("span", {
1078
2386
  className: "text-sm leading-5 font-medium text-arco-text-1",
1079
2387
  children: e.tenantName
1080
- }), /* @__PURE__ */ P("span", {
2388
+ }), /* @__PURE__ */ L("span", {
1081
2389
  className: "text-xs leading-4 text-arco-text-3",
1082
- children: Qe(e, p.owner, p.member)
2390
+ children: Nn(e, m.owner, m.member)
1083
2391
  })]
1084
2392
  })]
1085
2393
  })
1086
2394
  }, e.tenantId))]
1087
2395
  }), [
2396
+ le,
1088
2397
  H,
1089
- N,
1090
- w,
1091
- p
1092
- ]), re = /* @__PURE__ */ P(qe, {
1093
- user: S,
1094
- points: L,
1095
- text: p,
1096
- onEditProfile: () => _(!0),
1097
- onRecharge: () => y(!0),
1098
- onPointsDetail: () => x(!0),
1099
- onLogout: ue
1100
- }), ie = Math.max(0, w.findIndex((e) => e.tenantId === D?.tenantId));
1101
- return /* @__PURE__ */ F("div", {
2398
+ T,
2399
+ m
2400
+ ]), fe = /* @__PURE__ */ L(On, {
2401
+ user: C,
2402
+ points: W,
2403
+ text: m,
2404
+ onEditProfile: () => v(!0),
2405
+ onRecharge: () => b(!0),
2406
+ onPointsDetail: () => S(!0),
2407
+ onLogout: he
2408
+ }), pe = Math.max(0, T.findIndex((e) => e.tenantId === D?.tenantId));
2409
+ return /* @__PURE__ */ R("div", {
1102
2410
  className: "flex h-20 items-center justify-between bg-transparent pr-8 shadow-[0_2px_10px_rgb(0_0_0/2%)] backdrop-blur-md max-md:pr-4",
1103
2411
  children: [
1104
- /* @__PURE__ */ F("div", {
2412
+ /* @__PURE__ */ R("div", {
1105
2413
  className: "flex items-center gap-6",
1106
- children: [/* @__PURE__ */ F("div", {
2414
+ children: [/* @__PURE__ */ R("div", {
1107
2415
  className: "flex w-65 items-center gap-3 px-8 max-md:w-auto max-md:px-4",
1108
- children: [/* @__PURE__ */ P("div", {
2416
+ children: [/* @__PURE__ */ L("div", {
1109
2417
  className: "relative flex w-12 items-center justify-center overflow-hidden ",
1110
- children: /* @__PURE__ */ P("img", {
1111
- src: Je,
2418
+ children: /* @__PURE__ */ L("img", {
2419
+ src: kn,
1112
2420
  alt: "logo",
1113
2421
  className: "w-full object-contain",
1114
2422
  onError: (e) => {
1115
2423
  e.currentTarget.style.display = "none";
1116
2424
  }
1117
2425
  })
1118
- }), s ?? /* @__PURE__ */ P("span", {
2426
+ }), s ?? /* @__PURE__ */ L("span", {
1119
2427
  className: "text-lg font-bold tracking-normal text-arco-text-1",
1120
- children: p.title
2428
+ children: m.title
1121
2429
  })]
1122
- }), /* @__PURE__ */ P(u, {
1123
- droplist: ne,
2430
+ }), /* @__PURE__ */ L(f, {
2431
+ droplist: de,
1124
2432
  trigger: "click",
1125
2433
  position: "bl",
1126
- disabled: I,
1127
- children: /* @__PURE__ */ F("div", {
1128
- "aria-disabled": I,
1129
- className: `flex items-center gap-3 rounded-full border border-arco-border-1 bg-arco-bg-1 px-2 py-1.5 transition-all ${I ? "cursor-not-allowed opacity-60" : "cursor-pointer hover:bg-arco-fill-2 hover:shadow-[0_4px_12px_rgb(0_0_0/8%)]"}`,
2434
+ disabled: U,
2435
+ children: /* @__PURE__ */ R("div", {
2436
+ "aria-disabled": U,
2437
+ className: `flex items-center gap-3 rounded-full border border-arco-border-1 bg-arco-bg-1 px-2 py-1.5 transition-all ${U ? "cursor-not-allowed opacity-60" : "cursor-pointer hover:bg-arco-fill-2 hover:shadow-[0_4px_12px_rgb(0_0_0/8%)]"}`,
1130
2438
  children: [
1131
- /* @__PURE__ */ P("div", {
1132
- className: Xe(ie, !0),
1133
- children: Ze(D)
2439
+ /* @__PURE__ */ L("div", {
2440
+ className: jn(pe, !0),
2441
+ children: Mn(D)
1134
2442
  }),
1135
- /* @__PURE__ */ F("div", {
2443
+ /* @__PURE__ */ R("div", {
1136
2444
  className: "flex min-w-0 flex-col",
1137
- children: [/* @__PURE__ */ P("span", {
2445
+ children: [/* @__PURE__ */ L("span", {
1138
2446
  className: "text-xs leading-none font-bold text-arco-text-1",
1139
- children: ee ? p.loading : D?.tenantName || p.loading
1140
- }), /* @__PURE__ */ P("span", {
2447
+ children: A ? m.loading : D?.tenantName || m.loading
2448
+ }), /* @__PURE__ */ L("span", {
1141
2449
  className: "mt-1 text-[10px] leading-none text-arco-text-3",
1142
- children: Qe(D, p.owner, p.member)
2450
+ children: Nn(D, m.owner, m.member)
1143
2451
  })]
1144
2452
  }),
1145
- /* @__PURE__ */ P(T, { className: "ml-1 text-arco-text-3" })
2453
+ /* @__PURE__ */ L(O, { className: "ml-1 text-arco-text-3" })
1146
2454
  ]
1147
2455
  })
1148
2456
  })]
1149
2457
  }),
1150
- /* @__PURE__ */ P("div", {
2458
+ /* @__PURE__ */ L("div", {
1151
2459
  className: "flex-1",
1152
2460
  children: c
1153
2461
  }),
1154
- /* @__PURE__ */ F("div", {
2462
+ /* @__PURE__ */ R("div", {
1155
2463
  className: "flex items-center gap-4",
1156
- children: [/* @__PURE__ */ F("div", {
2464
+ children: [/* @__PURE__ */ R("div", {
1157
2465
  className: "flex items-center gap-4",
1158
- children: [/* @__PURE__ */ P(Me, {}), /* @__PURE__ */ P(je, {})]
1159
- }), /* @__PURE__ */ P(u, {
1160
- droplist: re,
2466
+ children: [/* @__PURE__ */ L(Je, {}), /* @__PURE__ */ L(qe, {})]
2467
+ }), /* @__PURE__ */ L(f, {
2468
+ droplist: fe,
1161
2469
  trigger: "click",
1162
2470
  position: "br",
1163
2471
  onVisibleChange: (e) => {
1164
- e && q().catch((e) => {
2472
+ e && ye().catch((e) => {
1165
2473
  console.warn("Failed to refresh Mantur user points.", e);
1166
2474
  });
1167
2475
  },
1168
- children: /* @__PURE__ */ F("div", {
2476
+ children: /* @__PURE__ */ R("div", {
1169
2477
  className: "hover:bg-arco-fill-2 flex cursor-pointer items-center gap-2.5 rounded-full border border-transparent p-1 pr-2 transition-all",
1170
2478
  children: [
1171
- /* @__PURE__ */ F("div", {
2479
+ /* @__PURE__ */ R("div", {
1172
2480
  className: "from-arco-primary to-transparent relative rounded-full bg-linear-to-br p-0.5 shadow-sm",
1173
- children: [/* @__PURE__ */ P($, {
1174
- user: S,
2481
+ children: [/* @__PURE__ */ L(lt, {
2482
+ user: C,
1175
2483
  size: 36
1176
- }), /* @__PURE__ */ P("div", { className: "bg-arco-success border-arco-bg-white absolute right-0 bottom-0 h-3 w-3 rounded-full border-2 shadow-sm" })]
2484
+ }), /* @__PURE__ */ L("div", { className: "bg-arco-success border-arco-bg-white absolute right-0 bottom-0 h-3 w-3 rounded-full border-2 shadow-sm" })]
1177
2485
  }),
1178
- /* @__PURE__ */ P("div", {
2486
+ /* @__PURE__ */ L("div", {
1179
2487
  className: "hidden flex-col md:flex",
1180
- children: /* @__PURE__ */ P("span", {
2488
+ children: /* @__PURE__ */ L("span", {
1181
2489
  className: "text-arco-text-1 text-sm font-medium",
1182
- children: S?.nickname || S?.username
2490
+ children: C?.nickname || C?.username
1183
2491
  })
1184
2492
  }),
1185
- /* @__PURE__ */ P(T, { className: "text-arco-text-3 ml-1" })
2493
+ /* @__PURE__ */ L(O, { className: "text-arco-text-3 ml-1" })
1186
2494
  ]
1187
2495
  })
1188
2496
  })]
1189
2497
  }),
1190
- /* @__PURE__ */ P(We, {
1191
- visible: g,
1192
- user: S,
1193
- labels: p,
1194
- onCancel: () => _(!1),
1195
- onSubmit: R
2498
+ /* @__PURE__ */ L(st, {
2499
+ visible: h,
2500
+ user: C,
2501
+ labels: m,
2502
+ onCancel: () => v(!1),
2503
+ onSubmit: ie
1196
2504
  }),
1197
- /* @__PURE__ */ P(Ke, {
1198
- visible: v,
1199
- user: S,
1200
- points: L,
1201
- text: p,
1202
- onCancel: () => y(!1),
1203
- onPay: te
2505
+ /* @__PURE__ */ L(ft, {
2506
+ visible: y,
2507
+ user: C,
2508
+ points: W,
2509
+ text: m,
2510
+ packages: I,
2511
+ packageLoading: M,
2512
+ submitting: P,
2513
+ onCancel: () => b(!1),
2514
+ onPay: ue
1204
2515
  }),
1205
- /* @__PURE__ */ P(Re, {
1206
- visible: b,
1207
- points: L,
1208
- text: p,
1209
- onCancel: () => x(!1),
1210
- onRecharge: () => y(!0)
2516
+ /* @__PURE__ */ L(tt, {
2517
+ visible: x,
2518
+ points: W,
2519
+ text: m,
2520
+ onCancel: () => S(!1),
2521
+ onRecharge: () => b(!0)
2522
+ }),
2523
+ /* @__PURE__ */ L(Dn, {
2524
+ visible: !!te,
2525
+ publishableKey: ne,
2526
+ order: te,
2527
+ text: m,
2528
+ onCancel: () => z(void 0),
2529
+ onSuccess: () => {
2530
+ _.success(m.rechargeSuccess), z(void 0), ye().catch((e) => {
2531
+ console.warn("Failed to refresh Mantur user points.", e);
2532
+ });
2533
+ }
1211
2534
  })
1212
2535
  ]
1213
2536
  });
1214
2537
  }
1215
2538
  //#endregion
1216
2539
  //#region src/utils/date.ts
1217
- var et = /* @__PURE__ */ re((/* @__PURE__ */ te(((e, t) => {
2540
+ var Ln = /* @__PURE__ */ ie((/* @__PURE__ */ U(((e, t) => {
1218
2541
  (function(n, r) {
1219
2542
  typeof e == "object" && t !== void 0 ? t.exports = r() : typeof define == "function" && define.amd ? define(r) : (n = typeof globalThis < "u" ? globalThis : n || self).dayjs = r();
1220
2543
  })(e, (function() {
@@ -1509,27 +2832,27 @@ var et = /* @__PURE__ */ re((/* @__PURE__ */ te(((e, t) => {
1509
2832
  }, w.en = b[y], w.Ls = b, w.p = {}, w;
1510
2833
  }));
1511
2834
  })))(), 1);
1512
- function tt(e, t = "datetime", n) {
2835
+ function Rn(e, t = "datetime", n) {
1513
2836
  if (!e) return "-";
1514
- let r = (n ? X(n) : Z()).startsWith("en"), i = t === "date" ? r ? "MM/DD/YYYY" : "YYYY-MM-DD" : r ? "MM/DD/YYYY HH:mm:ss" : "YYYY-MM-DD HH:mm:ss";
1515
- return (0, et.default)(e).format(i);
2837
+ let r = (n ? q(n) : He()).startsWith("en"), i = t === "date" ? r ? "MM/DD/YYYY" : "YYYY-MM-DD" : r ? "MM/DD/YYYY HH:mm:ss" : "YYYY-MM-DD HH:mm:ss";
2838
+ return (0, Ln.default)(e).format(i);
1516
2839
  }
1517
2840
  //#endregion
1518
2841
  //#region src/utils/url.ts
1519
- var nt = () => {
2842
+ var zn = () => {
1520
2843
  if (typeof window > "u" || !window.location?.href) throw Error("redirectToManturMain requires currentUrl when window.location is unavailable.");
1521
2844
  return window.location.href;
1522
- }, rt = (e, t) => {
2845
+ }, Bn = (e, t) => {
1523
2846
  let n = e.split(".");
1524
2847
  return n.length <= 1 ? t : [t, ...n.slice(1)].join(".");
1525
- }, it = (e) => `${e.pathname}${e.search}${e.hash}`;
1526
- function at(e, t, n = {}) {
1527
- let r = new URL(n.currentUrl || nt()), i = new URL(r.toString()), a = e?.trim();
1528
- a ? i.hostname = rt(r.hostname, a) : i.port = "80";
1529
- let o = it(r);
2848
+ }, Vn = (e) => `${e.pathname}${e.search}${e.hash}`;
2849
+ function Hn(e, t, n = {}) {
2850
+ let r = new URL(n.currentUrl || zn()), i = new URL(r.toString()), a = e?.trim();
2851
+ a ? i.hostname = Bn(r.hostname, a) : i.port = "80";
2852
+ let o = Vn(r);
1530
2853
  i.pathname = "/login", i.searchParams.set("app", t?.trim()), i.searchParams.set("redirect", o);
1531
2854
  let s = i.toString();
1532
2855
  return n.navigate !== !1 && typeof window < "u" && (window.location.href = s), s;
1533
2856
  }
1534
2857
  //#endregion
1535
- export { $e as ManturHeader, tt as formatDateByLang, at as redirectToManturMain };
2858
+ export { oe as MANTUR_POINTS_REFRESH_EVENT, se as MANTUR_RECHARGE_ORDER_CREATED_EVENT, ce as MANTUR_TENANT_CONTEXT_CHANGE_EVENT, In as ManturHeader, xe as createManturRechargeOrder, Rn as formatDateByLang, Te as getManturBillingAccount, Ee as getManturBillingLedger, be as getManturBillingPackages, we as getManturPricingChargePoint, Ce as getManturPricingChargePoints, Se as getManturRechargeOrder, Hn as redirectToManturMain, Me as refreshManturTenantContext, ye as refreshManturUserPoints };