mantur-components 0.1.13-beta.2 → 0.1.13
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,31 +1,31 @@
|
|
|
1
1
|
import e, { useCallback as t, useEffect as n, useMemo as r, useRef as i, useState as a } from "react";
|
|
2
2
|
import { Alert as o, Avatar as s, Button as c, Card as l, DatePicker as u, Descriptions as d, Divider as f, Dropdown as p, Form as m, Grid as h, Input as g, Menu as _, Message as v, Modal as y, Pagination as b, Select as x, Spin as S, Table as C, Tabs as w, Tag as T, Tooltip as E, Typography as D, Upload as O } from "@arco-design/web-react";
|
|
3
|
-
import { IconCheckCircleFill as k, IconDown as A, IconEdit as j,
|
|
4
|
-
import { useTranslation as
|
|
5
|
-
import { jsx as
|
|
6
|
-
import { useTheme as
|
|
3
|
+
import { IconCheckCircleFill as k, IconDown as A, IconEdit as j, IconLanguage as M, IconMoonFill as N, IconPlus as P, IconPoweroff as F, IconSunFill as I, IconUpload as L } from "@arco-design/web-react/icon";
|
|
4
|
+
import { useTranslation as R } from "react-i18next";
|
|
5
|
+
import { jsx as z, jsxs as B } from "react/jsx-runtime";
|
|
6
|
+
import { useTheme as V } from "next-themes";
|
|
7
7
|
//#region \0rolldown/runtime.js
|
|
8
|
-
var
|
|
9
|
-
if (t && typeof t == "object" || typeof t == "function") for (var i = re(t), a = 0, o = i.length, s; a < o; a++) s = i[a], !ae.call(e, s) && s !== n &&
|
|
8
|
+
var ee = Object.create, te = Object.defineProperty, ne = Object.getOwnPropertyDescriptor, re = Object.getOwnPropertyNames, ie = Object.getPrototypeOf, ae = Object.prototype.hasOwnProperty, H = (e, t) => () => (t || (e((t = { exports: {} }).exports, t), e = null), t.exports), oe = (e, t, n, r) => {
|
|
9
|
+
if (t && typeof t == "object" || typeof t == "function") for (var i = re(t), a = 0, o = i.length, s; a < o; a++) s = i[a], !ae.call(e, s) && s !== n && te(e, s, {
|
|
10
10
|
get: ((e) => t[e]).bind(null, s),
|
|
11
11
|
enumerable: !(r = ne(t, s)) || r.enumerable
|
|
12
12
|
});
|
|
13
13
|
return e;
|
|
14
|
-
},
|
|
14
|
+
}, U = (e, t, n) => (n = e == null ? {} : ee(ie(e)), oe(t || !e || !e.__esModule ? te(n, "default", {
|
|
15
15
|
value: e,
|
|
16
16
|
enumerable: !0
|
|
17
|
-
}) : n, e)),
|
|
17
|
+
}) : n, e)), W = () => {
|
|
18
18
|
if (typeof window > "u" || !window.location?.href) throw Error("redirectToManturMain requires currentUrl when window.location is unavailable.");
|
|
19
19
|
return window.location.href;
|
|
20
|
-
},
|
|
20
|
+
}, G = (e, t) => {
|
|
21
21
|
let n = e.split(".");
|
|
22
22
|
return n.length <= 1 ? t : [t, ...n.slice(1)].join(".");
|
|
23
|
-
},
|
|
23
|
+
}, se = (e) => `${e.pathname}${e.search}${e.hash}`, K = new Set([
|
|
24
24
|
"localhost",
|
|
25
25
|
"127.0.0.1",
|
|
26
26
|
"::1",
|
|
27
27
|
"[::1]"
|
|
28
|
-
]), ce = (e) =>
|
|
28
|
+
]), ce = (e) => K.has(e), le = (e) => e.startsWith("[") && e.endsWith("]") ? e : e.includes(":") ? `[${e}]` : e, ue = {
|
|
29
29
|
82: "creative-agent",
|
|
30
30
|
83: "production-agent",
|
|
31
31
|
81: "traffic-engine",
|
|
@@ -35,7 +35,7 @@ function de(e) {
|
|
|
35
35
|
let t = {
|
|
36
36
|
BASE_URL: "/",
|
|
37
37
|
DEV: !1,
|
|
38
|
-
MODE: "
|
|
38
|
+
MODE: "pro",
|
|
39
39
|
PROD: !0,
|
|
40
40
|
SSR: !1,
|
|
41
41
|
VITE_MANTUR_STRIPE_PUBLISHABLE_KEY: "pk_test_51TJ8JiERSsQknDG7bJSIX81RFq3LcCfUXCV7mh0cQsZ2dwmYcJ5Ki6bPXynNvdyZEEBE83I6I719NIFyO9Qreey700yPAul8sv"
|
|
@@ -46,26 +46,26 @@ function fe(e) {
|
|
|
46
46
|
return (typeof window > "u" ? de("VITE_APP_NAME") : window.__MANTUR_APP_NAME__ || de("VITE_APP_NAME"))?.trim() || ue[e.port] || "mantur";
|
|
47
47
|
}
|
|
48
48
|
function pe(e = {}) {
|
|
49
|
-
let t = new URL(e.currentUrl || (typeof window > "u" ? "http://localhost/" :
|
|
49
|
+
let t = new URL(e.currentUrl || (typeof window > "u" ? "http://localhost/" : W()));
|
|
50
50
|
return {
|
|
51
51
|
app: fe(t),
|
|
52
|
-
redirect:
|
|
52
|
+
redirect: se(t)
|
|
53
53
|
};
|
|
54
54
|
}
|
|
55
55
|
function me(e, t = {}) {
|
|
56
|
-
let n = new URL(t.currentUrl ||
|
|
56
|
+
let n = new URL(t.currentUrl || W()), r = e?.trim();
|
|
57
57
|
if (ce(n.hostname)) return `${n.protocol}//${le(n.hostname)}:80/`;
|
|
58
58
|
let i = new URL(n.toString());
|
|
59
|
-
return r && (i.hostname =
|
|
59
|
+
return r && (i.hostname = G(n.hostname, r)), i.port = "", i.pathname = "/", i.search = "", i.hash = "", i.toString();
|
|
60
60
|
}
|
|
61
61
|
function he(e, t = {}) {
|
|
62
62
|
let n = me(e, t);
|
|
63
63
|
return t.navigate !== !1 && typeof window < "u" && (window.location.href = n), n;
|
|
64
64
|
}
|
|
65
65
|
function ge(e, t, n = {}) {
|
|
66
|
-
let r = new URL(n.currentUrl ||
|
|
67
|
-
a && (i.hostname =
|
|
68
|
-
let o =
|
|
66
|
+
let r = new URL(n.currentUrl || W()), i = new URL(r.toString()), a = e?.trim();
|
|
67
|
+
a && (i.hostname = G(r.hostname, a)), i.port = "";
|
|
68
|
+
let o = se(r);
|
|
69
69
|
i.pathname = "/login", i.searchParams.set("app", t?.trim()), i.searchParams.set("redirect", o);
|
|
70
70
|
let s = i.toString();
|
|
71
71
|
return n.navigate !== !1 && typeof window < "u" && (window.location.href = s), s;
|
|
@@ -111,7 +111,7 @@ function De(e) {
|
|
|
111
111
|
if (t.code !== 0) throw Error(t.message || "Request failed");
|
|
112
112
|
return t;
|
|
113
113
|
}
|
|
114
|
-
async function
|
|
114
|
+
async function q(e, t = {}) {
|
|
115
115
|
let n = Te("front-token"), r = Te("Accept-Language"), i = t.headers || {};
|
|
116
116
|
return n && (i.Authorization = decodeURIComponent(n)), r && (i["Accept-Language"] = decodeURIComponent(r)), new Promise((n, r) => {
|
|
117
117
|
let a = new XMLHttpRequest();
|
|
@@ -133,7 +133,7 @@ async function J(e, t = {}) {
|
|
|
133
133
|
}
|
|
134
134
|
async function Oe() {
|
|
135
135
|
try {
|
|
136
|
-
await
|
|
136
|
+
await q("/auth/front-logout", { method: "DELETE" });
|
|
137
137
|
} catch (e) {
|
|
138
138
|
console.warn("Logout request failed, continuing local logout.", e);
|
|
139
139
|
} finally {
|
|
@@ -144,12 +144,12 @@ async function ke(e) {
|
|
|
144
144
|
let t;
|
|
145
145
|
if (e.avatarFile) {
|
|
146
146
|
let n = new FormData();
|
|
147
|
-
n.append("file", e.avatarFile), t = (await
|
|
147
|
+
n.append("file", e.avatarFile), t = (await q("/users/me/avatar", {
|
|
148
148
|
method: "POST",
|
|
149
149
|
body: n
|
|
150
150
|
})).data;
|
|
151
151
|
}
|
|
152
|
-
return (await
|
|
152
|
+
return (await q("/users/me", {
|
|
153
153
|
method: "PUT",
|
|
154
154
|
headers: { "Content-Type": "application/json;charset=utf-8" },
|
|
155
155
|
body: JSON.stringify({ nickname: e.nickname })
|
|
@@ -167,18 +167,18 @@ function Ae(e) {
|
|
|
167
167
|
};
|
|
168
168
|
}
|
|
169
169
|
async function je() {
|
|
170
|
-
return Ae((await
|
|
170
|
+
return Ae((await q(Ce())).data);
|
|
171
171
|
}
|
|
172
172
|
async function Me() {
|
|
173
173
|
let e = await je();
|
|
174
174
|
return typeof window < "u" && window.dispatchEvent(new CustomEvent(ye, { detail: e })), e;
|
|
175
175
|
}
|
|
176
176
|
async function Ne() {
|
|
177
|
-
return (await
|
|
177
|
+
return (await q("/billing/packages")).data || [];
|
|
178
178
|
}
|
|
179
179
|
async function Pe(e) {
|
|
180
180
|
let t = pe();
|
|
181
|
-
return (await
|
|
181
|
+
return (await q("/billing/recharge/orders", {
|
|
182
182
|
method: "POST",
|
|
183
183
|
headers: { "Content-Type": "application/json;charset=utf-8" },
|
|
184
184
|
body: JSON.stringify({
|
|
@@ -189,22 +189,22 @@ async function Pe(e) {
|
|
|
189
189
|
})).data;
|
|
190
190
|
}
|
|
191
191
|
async function Fe(e) {
|
|
192
|
-
return (await
|
|
192
|
+
return (await q(`/billing/recharge/orders/${encodeURIComponent(e)}`)).data;
|
|
193
193
|
}
|
|
194
194
|
async function Ie(e) {
|
|
195
|
-
return (await
|
|
195
|
+
return (await q(`/billing/recharge/orders/${encodeURIComponent(e)}/cancel`, { method: "POST" })).data;
|
|
196
196
|
}
|
|
197
197
|
async function Le() {
|
|
198
|
-
return (await
|
|
198
|
+
return (await q("/billing/pricing/charge-points")).data || [];
|
|
199
199
|
}
|
|
200
200
|
async function Re(e) {
|
|
201
|
-
return (await
|
|
201
|
+
return (await q(`/billing/pricing/charge-points/${encodeURIComponent(e)}`)).data;
|
|
202
202
|
}
|
|
203
203
|
async function ze() {
|
|
204
|
-
return (await
|
|
204
|
+
return (await q("/billing/accounts/me")).data;
|
|
205
205
|
}
|
|
206
206
|
async function Be(e) {
|
|
207
|
-
return (await
|
|
207
|
+
return (await q(`/billing/accounts/me/ledger${we({
|
|
208
208
|
pageNum: e.pageNum,
|
|
209
209
|
pageSize: e.pageSize,
|
|
210
210
|
directions: e.directions,
|
|
@@ -227,13 +227,13 @@ function He(e) {
|
|
|
227
227
|
typeof window < "u" && (window.__MANTUR_COMPONENTS_TENANT_CONTEXT__ = e, window.dispatchEvent(new CustomEvent(xe, { detail: e })));
|
|
228
228
|
}
|
|
229
229
|
async function Ue() {
|
|
230
|
-
return (await
|
|
230
|
+
return (await q("/users/me/tenants")).data || [];
|
|
231
231
|
}
|
|
232
232
|
async function We() {
|
|
233
|
-
return (await
|
|
233
|
+
return (await q("/auth/current-tenant")).data;
|
|
234
234
|
}
|
|
235
235
|
async function Ge(e) {
|
|
236
|
-
return (await
|
|
236
|
+
return (await q(`/auth/current-tenant/${e}`, { method: "PUT" })).data;
|
|
237
237
|
}
|
|
238
238
|
async function Ke(e = "refresh") {
|
|
239
239
|
let [t, n] = await Promise.all([Ue(), We()]), r = {
|
|
@@ -421,14 +421,14 @@ var Je = {
|
|
|
421
421
|
...Ye
|
|
422
422
|
}
|
|
423
423
|
};
|
|
424
|
-
function
|
|
424
|
+
function J(e) {
|
|
425
425
|
return e?.toLowerCase().startsWith("en") ? "en-US" : "zh-CN";
|
|
426
426
|
}
|
|
427
427
|
function nt() {
|
|
428
|
-
return typeof window > "u" ? "zh-CN" :
|
|
428
|
+
return typeof window > "u" ? "zh-CN" : J(window.localStorage.getItem("i18nextLng") || document.documentElement.lang || navigator.language);
|
|
429
429
|
}
|
|
430
430
|
function rt(e) {
|
|
431
|
-
return tt[
|
|
431
|
+
return tt[J(e)];
|
|
432
432
|
}
|
|
433
433
|
//#endregion
|
|
434
434
|
//#region src/lang-switch/LangSwitch.tsx
|
|
@@ -437,88 +437,390 @@ function ot(e, t) {
|
|
|
437
437
|
document.cookie = `${encodeURIComponent(e)}=${encodeURIComponent(t)}; path=/`;
|
|
438
438
|
}
|
|
439
439
|
function st() {
|
|
440
|
-
let { i18n: e } =
|
|
440
|
+
let { i18n: e } = R(), [t, r] = a(() => nt()), i = rt(t);
|
|
441
441
|
return n(() => {
|
|
442
|
-
r(
|
|
443
|
-
}, [e.language]), /* @__PURE__ */
|
|
444
|
-
droplist: /* @__PURE__ */
|
|
442
|
+
r(J(e.language));
|
|
443
|
+
}, [e.language]), /* @__PURE__ */ z(p, {
|
|
444
|
+
droplist: /* @__PURE__ */ B(_, {
|
|
445
445
|
selectedKeys: [t],
|
|
446
446
|
onClickMenuItem: (t) => {
|
|
447
|
-
let n =
|
|
447
|
+
let n = J(t);
|
|
448
448
|
localStorage.setItem(it, t), localStorage.setItem(at, "manual"), r(n), e.changeLanguage(t), ot("Accept-Language", t), window.dispatchEvent(new CustomEvent(et, { detail: n })), window.location.reload();
|
|
449
449
|
},
|
|
450
|
-
children: [/* @__PURE__ */
|
|
450
|
+
children: [/* @__PURE__ */ z(_.Item, { children: i.languageZh }, "zh-CN"), /* @__PURE__ */ z(_.Item, { children: i.languageEn }, "en-US")]
|
|
451
451
|
}),
|
|
452
452
|
trigger: "click",
|
|
453
453
|
position: "br",
|
|
454
|
-
children: /* @__PURE__ */
|
|
454
|
+
children: /* @__PURE__ */ z(c, {
|
|
455
455
|
shape: "circle",
|
|
456
|
-
icon: /* @__PURE__ */
|
|
456
|
+
icon: /* @__PURE__ */ z(M, {})
|
|
457
457
|
})
|
|
458
458
|
});
|
|
459
459
|
}
|
|
460
460
|
//#endregion
|
|
461
461
|
//#region src/theme-switch/ThemeSwitch.tsx
|
|
462
462
|
function ct() {
|
|
463
|
-
let { resolvedTheme: e, setTheme: t } =
|
|
464
|
-
return /* @__PURE__ */
|
|
463
|
+
let { resolvedTheme: e, setTheme: t } = V();
|
|
464
|
+
return /* @__PURE__ */ z(c, {
|
|
465
465
|
shape: "circle",
|
|
466
|
-
icon:
|
|
466
|
+
icon: z(e === "light" ? N : I, {}),
|
|
467
467
|
onClick: () => {
|
|
468
468
|
t(e === "light" ? "dark" : "light");
|
|
469
469
|
}
|
|
470
470
|
});
|
|
471
471
|
}
|
|
472
472
|
//#endregion
|
|
473
|
+
//#region src/utils/date.ts
|
|
474
|
+
var lt = /* @__PURE__ */ U((/* @__PURE__ */ H(((e, t) => {
|
|
475
|
+
(function(n, r) {
|
|
476
|
+
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();
|
|
477
|
+
})(e, (function() {
|
|
478
|
+
var e = 1e3, t = 6e4, n = 36e5, r = "millisecond", i = "second", a = "minute", o = "hour", s = "day", c = "week", l = "month", u = "quarter", d = "year", f = "date", p = "Invalid Date", m = /^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/, h = /\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g, g = {
|
|
479
|
+
name: "en",
|
|
480
|
+
weekdays: "Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),
|
|
481
|
+
months: "January_February_March_April_May_June_July_August_September_October_November_December".split("_"),
|
|
482
|
+
ordinal: function(e) {
|
|
483
|
+
var t = [
|
|
484
|
+
"th",
|
|
485
|
+
"st",
|
|
486
|
+
"nd",
|
|
487
|
+
"rd"
|
|
488
|
+
], n = e % 100;
|
|
489
|
+
return "[" + e + (t[(n - 20) % 10] || t[n] || t[0]) + "]";
|
|
490
|
+
}
|
|
491
|
+
}, _ = function(e, t, n) {
|
|
492
|
+
var r = String(e);
|
|
493
|
+
return !r || r.length >= t ? e : "" + Array(t + 1 - r.length).join(n) + e;
|
|
494
|
+
}, v = {
|
|
495
|
+
s: _,
|
|
496
|
+
z: function(e) {
|
|
497
|
+
var t = -e.utcOffset(), n = Math.abs(t), r = Math.floor(n / 60), i = n % 60;
|
|
498
|
+
return (t <= 0 ? "+" : "-") + _(r, 2, "0") + ":" + _(i, 2, "0");
|
|
499
|
+
},
|
|
500
|
+
m: function e(t, n) {
|
|
501
|
+
if (t.date() < n.date()) return -e(n, t);
|
|
502
|
+
var r = 12 * (n.year() - t.year()) + (n.month() - t.month()), i = t.clone().add(r, l), a = n - i < 0, o = t.clone().add(r + (a ? -1 : 1), l);
|
|
503
|
+
return +(-(r + (n - i) / (a ? i - o : o - i)) || 0);
|
|
504
|
+
},
|
|
505
|
+
a: function(e) {
|
|
506
|
+
return e < 0 ? Math.ceil(e) || 0 : Math.floor(e);
|
|
507
|
+
},
|
|
508
|
+
p: function(e) {
|
|
509
|
+
return {
|
|
510
|
+
M: l,
|
|
511
|
+
y: d,
|
|
512
|
+
w: c,
|
|
513
|
+
d: s,
|
|
514
|
+
D: f,
|
|
515
|
+
h: o,
|
|
516
|
+
m: a,
|
|
517
|
+
s: i,
|
|
518
|
+
ms: r,
|
|
519
|
+
Q: u
|
|
520
|
+
}[e] || String(e || "").toLowerCase().replace(/s$/, "");
|
|
521
|
+
},
|
|
522
|
+
u: function(e) {
|
|
523
|
+
return e === void 0;
|
|
524
|
+
}
|
|
525
|
+
}, y = "en", b = {};
|
|
526
|
+
b[y] = g;
|
|
527
|
+
var x = "$isDayjsObject", S = function(e) {
|
|
528
|
+
return e instanceof E || !(!e || !e[x]);
|
|
529
|
+
}, C = function e(t, n, r) {
|
|
530
|
+
var i;
|
|
531
|
+
if (!t) return y;
|
|
532
|
+
if (typeof t == "string") {
|
|
533
|
+
var a = t.toLowerCase();
|
|
534
|
+
b[a] && (i = a), n && (b[a] = n, i = a);
|
|
535
|
+
var o = t.split("-");
|
|
536
|
+
if (!i && o.length > 1) return e(o[0]);
|
|
537
|
+
} else {
|
|
538
|
+
var s = t.name;
|
|
539
|
+
b[s] = t, i = s;
|
|
540
|
+
}
|
|
541
|
+
return !r && i && (y = i), i || !r && y;
|
|
542
|
+
}, w = function(e, t) {
|
|
543
|
+
if (S(e)) return e.clone();
|
|
544
|
+
var n = typeof t == "object" ? t : {};
|
|
545
|
+
return n.date = e, n.args = arguments, new E(n);
|
|
546
|
+
}, T = v;
|
|
547
|
+
T.l = C, T.i = S, T.w = function(e, t) {
|
|
548
|
+
return w(e, {
|
|
549
|
+
locale: t.$L,
|
|
550
|
+
utc: t.$u,
|
|
551
|
+
x: t.$x,
|
|
552
|
+
$offset: t.$offset
|
|
553
|
+
});
|
|
554
|
+
};
|
|
555
|
+
var E = function() {
|
|
556
|
+
function g(e) {
|
|
557
|
+
this.$L = C(e.locale, null, !0), this.parse(e), this.$x = this.$x || e.x || {}, this[x] = !0;
|
|
558
|
+
}
|
|
559
|
+
var _ = g.prototype;
|
|
560
|
+
return _.parse = function(e) {
|
|
561
|
+
this.$d = function(e) {
|
|
562
|
+
var t = e.date, n = e.utc;
|
|
563
|
+
if (t === null) return /* @__PURE__ */ new Date(NaN);
|
|
564
|
+
if (T.u(t)) return /* @__PURE__ */ new Date();
|
|
565
|
+
if (t instanceof Date) return new Date(t);
|
|
566
|
+
if (typeof t == "string" && !/Z$/i.test(t)) {
|
|
567
|
+
var r = t.match(m);
|
|
568
|
+
if (r) {
|
|
569
|
+
var i = r[2] - 1 || 0, a = (r[7] || "0").substring(0, 3);
|
|
570
|
+
return n ? new Date(Date.UTC(r[1], i, r[3] || 1, r[4] || 0, r[5] || 0, r[6] || 0, a)) : new Date(r[1], i, r[3] || 1, r[4] || 0, r[5] || 0, r[6] || 0, a);
|
|
571
|
+
}
|
|
572
|
+
}
|
|
573
|
+
return new Date(t);
|
|
574
|
+
}(e), this.init();
|
|
575
|
+
}, _.init = function() {
|
|
576
|
+
var e = this.$d;
|
|
577
|
+
this.$y = e.getFullYear(), this.$M = e.getMonth(), this.$D = e.getDate(), this.$W = e.getDay(), this.$H = e.getHours(), this.$m = e.getMinutes(), this.$s = e.getSeconds(), this.$ms = e.getMilliseconds();
|
|
578
|
+
}, _.$utils = function() {
|
|
579
|
+
return T;
|
|
580
|
+
}, _.isValid = function() {
|
|
581
|
+
return this.$d.toString() !== p;
|
|
582
|
+
}, _.isSame = function(e, t) {
|
|
583
|
+
var n = w(e);
|
|
584
|
+
return this.startOf(t) <= n && n <= this.endOf(t);
|
|
585
|
+
}, _.isAfter = function(e, t) {
|
|
586
|
+
return w(e) < this.startOf(t);
|
|
587
|
+
}, _.isBefore = function(e, t) {
|
|
588
|
+
return this.endOf(t) < w(e);
|
|
589
|
+
}, _.$g = function(e, t, n) {
|
|
590
|
+
return T.u(e) ? this[t] : this.set(n, e);
|
|
591
|
+
}, _.unix = function() {
|
|
592
|
+
return Math.floor(this.valueOf() / 1e3);
|
|
593
|
+
}, _.valueOf = function() {
|
|
594
|
+
return this.$d.getTime();
|
|
595
|
+
}, _.startOf = function(e, t) {
|
|
596
|
+
var n = this, r = !!T.u(t) || t, u = T.p(e), p = function(e, t) {
|
|
597
|
+
var i = T.w(n.$u ? Date.UTC(n.$y, t, e) : new Date(n.$y, t, e), n);
|
|
598
|
+
return r ? i : i.endOf(s);
|
|
599
|
+
}, m = function(e, t) {
|
|
600
|
+
return T.w(n.toDate()[e].apply(n.toDate("s"), (r ? [
|
|
601
|
+
0,
|
|
602
|
+
0,
|
|
603
|
+
0,
|
|
604
|
+
0
|
|
605
|
+
] : [
|
|
606
|
+
23,
|
|
607
|
+
59,
|
|
608
|
+
59,
|
|
609
|
+
999
|
|
610
|
+
]).slice(t)), n);
|
|
611
|
+
}, h = this.$W, g = this.$M, _ = this.$D, v = "set" + (this.$u ? "UTC" : "");
|
|
612
|
+
switch (u) {
|
|
613
|
+
case d: return r ? p(1, 0) : p(31, 11);
|
|
614
|
+
case l: return r ? p(1, g) : p(0, g + 1);
|
|
615
|
+
case c:
|
|
616
|
+
var y = this.$locale().weekStart || 0, b = (h < y ? h + 7 : h) - y;
|
|
617
|
+
return p(r ? _ - b : _ + (6 - b), g);
|
|
618
|
+
case s:
|
|
619
|
+
case f: return m(v + "Hours", 0);
|
|
620
|
+
case o: return m(v + "Minutes", 1);
|
|
621
|
+
case a: return m(v + "Seconds", 2);
|
|
622
|
+
case i: return m(v + "Milliseconds", 3);
|
|
623
|
+
default: return this.clone();
|
|
624
|
+
}
|
|
625
|
+
}, _.endOf = function(e) {
|
|
626
|
+
return this.startOf(e, !1);
|
|
627
|
+
}, _.$set = function(e, t) {
|
|
628
|
+
var n, c = T.p(e), u = "set" + (this.$u ? "UTC" : ""), p = (n = {}, n[s] = u + "Date", n[f] = u + "Date", n[l] = u + "Month", n[d] = u + "FullYear", n[o] = u + "Hours", n[a] = u + "Minutes", n[i] = u + "Seconds", n[r] = u + "Milliseconds", n)[c], m = c === s ? this.$D + (t - this.$W) : t;
|
|
629
|
+
if (c === l || c === d) {
|
|
630
|
+
var h = this.clone().set(f, 1);
|
|
631
|
+
h.$d[p](m), h.init(), this.$d = h.set(f, Math.min(this.$D, h.daysInMonth())).$d;
|
|
632
|
+
} else p && this.$d[p](m);
|
|
633
|
+
return this.init(), this;
|
|
634
|
+
}, _.set = function(e, t) {
|
|
635
|
+
return this.clone().$set(e, t);
|
|
636
|
+
}, _.get = function(e) {
|
|
637
|
+
return this[T.p(e)]();
|
|
638
|
+
}, _.add = function(r, u) {
|
|
639
|
+
var f, p = this;
|
|
640
|
+
r = Number(r);
|
|
641
|
+
var m = T.p(u), h = function(e) {
|
|
642
|
+
var t = w(p);
|
|
643
|
+
return T.w(t.date(t.date() + Math.round(e * r)), p);
|
|
644
|
+
};
|
|
645
|
+
if (m === l) return this.set(l, this.$M + r);
|
|
646
|
+
if (m === d) return this.set(d, this.$y + r);
|
|
647
|
+
if (m === s) return h(1);
|
|
648
|
+
if (m === c) return h(7);
|
|
649
|
+
var g = (f = {}, f[a] = t, f[o] = n, f[i] = e, f)[m] || 1, _ = this.$d.getTime() + r * g;
|
|
650
|
+
return T.w(_, this);
|
|
651
|
+
}, _.subtract = function(e, t) {
|
|
652
|
+
return this.add(-1 * e, t);
|
|
653
|
+
}, _.format = function(e) {
|
|
654
|
+
var t = this, n = this.$locale();
|
|
655
|
+
if (!this.isValid()) return n.invalidDate || p;
|
|
656
|
+
var r = e || "YYYY-MM-DDTHH:mm:ssZ", i = T.z(this), a = this.$H, o = this.$m, s = this.$M, c = n.weekdays, l = n.months, u = n.meridiem, d = function(e, n, i, a) {
|
|
657
|
+
return e && (e[n] || e(t, r)) || i[n].slice(0, a);
|
|
658
|
+
}, f = function(e) {
|
|
659
|
+
return T.s(a % 12 || 12, e, "0");
|
|
660
|
+
}, m = u || function(e, t, n) {
|
|
661
|
+
var r = e < 12 ? "AM" : "PM";
|
|
662
|
+
return n ? r.toLowerCase() : r;
|
|
663
|
+
};
|
|
664
|
+
return r.replace(h, (function(e, r) {
|
|
665
|
+
return r || function(e) {
|
|
666
|
+
switch (e) {
|
|
667
|
+
case "YY": return String(t.$y).slice(-2);
|
|
668
|
+
case "YYYY": return T.s(t.$y, 4, "0");
|
|
669
|
+
case "M": return s + 1;
|
|
670
|
+
case "MM": return T.s(s + 1, 2, "0");
|
|
671
|
+
case "MMM": return d(n.monthsShort, s, l, 3);
|
|
672
|
+
case "MMMM": return d(l, s);
|
|
673
|
+
case "D": return t.$D;
|
|
674
|
+
case "DD": return T.s(t.$D, 2, "0");
|
|
675
|
+
case "d": return String(t.$W);
|
|
676
|
+
case "dd": return d(n.weekdaysMin, t.$W, c, 2);
|
|
677
|
+
case "ddd": return d(n.weekdaysShort, t.$W, c, 3);
|
|
678
|
+
case "dddd": return c[t.$W];
|
|
679
|
+
case "H": return String(a);
|
|
680
|
+
case "HH": return T.s(a, 2, "0");
|
|
681
|
+
case "h": return f(1);
|
|
682
|
+
case "hh": return f(2);
|
|
683
|
+
case "a": return m(a, o, !0);
|
|
684
|
+
case "A": return m(a, o, !1);
|
|
685
|
+
case "m": return String(o);
|
|
686
|
+
case "mm": return T.s(o, 2, "0");
|
|
687
|
+
case "s": return String(t.$s);
|
|
688
|
+
case "ss": return T.s(t.$s, 2, "0");
|
|
689
|
+
case "SSS": return T.s(t.$ms, 3, "0");
|
|
690
|
+
case "Z": return i;
|
|
691
|
+
}
|
|
692
|
+
return null;
|
|
693
|
+
}(e) || i.replace(":", "");
|
|
694
|
+
}));
|
|
695
|
+
}, _.utcOffset = function() {
|
|
696
|
+
return 15 * -Math.round(this.$d.getTimezoneOffset() / 15);
|
|
697
|
+
}, _.diff = function(r, f, p) {
|
|
698
|
+
var m, h = this, g = T.p(f), _ = w(r), v = (_.utcOffset() - this.utcOffset()) * t, y = this - _, b = function() {
|
|
699
|
+
return T.m(h, _);
|
|
700
|
+
};
|
|
701
|
+
switch (g) {
|
|
702
|
+
case d:
|
|
703
|
+
m = b() / 12;
|
|
704
|
+
break;
|
|
705
|
+
case l:
|
|
706
|
+
m = b();
|
|
707
|
+
break;
|
|
708
|
+
case u:
|
|
709
|
+
m = b() / 3;
|
|
710
|
+
break;
|
|
711
|
+
case c:
|
|
712
|
+
m = (y - v) / 6048e5;
|
|
713
|
+
break;
|
|
714
|
+
case s:
|
|
715
|
+
m = (y - v) / 864e5;
|
|
716
|
+
break;
|
|
717
|
+
case o:
|
|
718
|
+
m = y / n;
|
|
719
|
+
break;
|
|
720
|
+
case a:
|
|
721
|
+
m = y / t;
|
|
722
|
+
break;
|
|
723
|
+
case i:
|
|
724
|
+
m = y / e;
|
|
725
|
+
break;
|
|
726
|
+
default: m = y;
|
|
727
|
+
}
|
|
728
|
+
return p ? m : T.a(m);
|
|
729
|
+
}, _.daysInMonth = function() {
|
|
730
|
+
return this.endOf(l).$D;
|
|
731
|
+
}, _.$locale = function() {
|
|
732
|
+
return b[this.$L];
|
|
733
|
+
}, _.locale = function(e, t) {
|
|
734
|
+
if (!e) return this.$L;
|
|
735
|
+
var n = this.clone(), r = C(e, t, !0);
|
|
736
|
+
return r && (n.$L = r), n;
|
|
737
|
+
}, _.clone = function() {
|
|
738
|
+
return T.w(this.$d, this);
|
|
739
|
+
}, _.toDate = function() {
|
|
740
|
+
return new Date(this.valueOf());
|
|
741
|
+
}, _.toJSON = function() {
|
|
742
|
+
return this.isValid() ? this.toISOString() : null;
|
|
743
|
+
}, _.toISOString = function() {
|
|
744
|
+
return this.$d.toISOString();
|
|
745
|
+
}, _.toString = function() {
|
|
746
|
+
return this.$d.toUTCString();
|
|
747
|
+
}, g;
|
|
748
|
+
}(), D = E.prototype;
|
|
749
|
+
return w.prototype = D, [
|
|
750
|
+
["$ms", r],
|
|
751
|
+
["$s", i],
|
|
752
|
+
["$m", a],
|
|
753
|
+
["$H", o],
|
|
754
|
+
["$W", s],
|
|
755
|
+
["$M", l],
|
|
756
|
+
["$y", d],
|
|
757
|
+
["$D", f]
|
|
758
|
+
].forEach((function(e) {
|
|
759
|
+
D[e[1]] = function(t) {
|
|
760
|
+
return this.$g(t, e[0], e[1]);
|
|
761
|
+
};
|
|
762
|
+
})), w.extend = function(e, t) {
|
|
763
|
+
return e.$i ||= (e(t, E, w), !0), w;
|
|
764
|
+
}, w.locale = C, w.isDayjs = S, w.unix = function(e) {
|
|
765
|
+
return w(1e3 * e);
|
|
766
|
+
}, w.en = b[y], w.Ls = b, w.p = {}, w;
|
|
767
|
+
}));
|
|
768
|
+
})))(), 1);
|
|
769
|
+
function ut(e, t = "datetime", n) {
|
|
770
|
+
if (!e) return "-";
|
|
771
|
+
let r = (n ? J(n) : nt()).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";
|
|
772
|
+
return (0, lt.default)(e).format(i);
|
|
773
|
+
}
|
|
774
|
+
//#endregion
|
|
473
775
|
//#region src/header/components/PointsDetailModal.tsx
|
|
474
|
-
var { RangePicker:
|
|
776
|
+
var { RangePicker: dt } = u, ft = 7, pt = [1], mt = [
|
|
475
777
|
3,
|
|
476
778
|
5,
|
|
477
779
|
6,
|
|
478
780
|
7
|
|
479
|
-
],
|
|
480
|
-
function
|
|
781
|
+
], ht = [1], gt = [2];
|
|
782
|
+
function _t(e) {
|
|
481
783
|
return e === "recharge" ? "arcoblue" : e === "gift" ? "cyan" : e === "expired" ? "gray" : "orange";
|
|
482
784
|
}
|
|
483
|
-
function
|
|
484
|
-
if (e === "income") return
|
|
485
|
-
if (e === "expense") return
|
|
785
|
+
function vt(e) {
|
|
786
|
+
if (e === "income") return pt;
|
|
787
|
+
if (e === "expense") return mt;
|
|
486
788
|
}
|
|
487
|
-
function
|
|
488
|
-
if (e === "recharge") return
|
|
489
|
-
if (e === "gift") return
|
|
789
|
+
function yt(e) {
|
|
790
|
+
if (e === "recharge") return ht;
|
|
791
|
+
if (e === "gift") return gt;
|
|
490
792
|
}
|
|
491
|
-
function
|
|
793
|
+
function bt(e, t) {
|
|
492
794
|
if (e) return /^\d{4}-\d{2}-\d{2}$/.test(e) ? `${e}T${t}` : e;
|
|
493
795
|
}
|
|
494
|
-
function
|
|
796
|
+
function xt(e) {
|
|
495
797
|
let t = Number(e.amount || 0);
|
|
496
798
|
return t < 0 ? t : e.direction === 3 || e.direction === 6 || e.direction === 7 ? -t : t;
|
|
497
799
|
}
|
|
498
|
-
function
|
|
499
|
-
return e.pointType === 1 ? "recharge" : e.pointType === 2 ? "gift" : e.direction === 6 || e.bizType === 5 ? "expired" :
|
|
800
|
+
function St(e) {
|
|
801
|
+
return e.pointType === 1 ? "recharge" : e.pointType === 2 ? "gift" : e.direction === 6 || e.bizType === 5 ? "expired" : xt(e) < 0 ? "deducted" : "recharge";
|
|
500
802
|
}
|
|
501
|
-
function
|
|
502
|
-
return e.pointType === 1 ? t.sourceRecharge : e.pointType === 2 ? t.sourceGifted : e.actionName || (
|
|
803
|
+
function Ct(e, t) {
|
|
804
|
+
return e.pointType === 1 ? t.sourceRecharge : e.pointType === 2 ? t.sourceGifted : e.actionName || (xt(e) < 0 ? t.expense : t.income);
|
|
503
805
|
}
|
|
504
|
-
function
|
|
505
|
-
let [d, f] = a("all"), [p, m] = a("all"), [g, _] = a([]), [S, E] = a(1), [O, k] = a([]), [A, j] = a(0), [M, N] = a(!1),
|
|
806
|
+
function wt({ visible: e, points: r, text: o, onCancel: s, onRecharge: u }) {
|
|
807
|
+
let [d, f] = a("all"), [p, m] = a("all"), [g, _] = a([]), [S, E] = a(1), [O, k] = a([]), [A, j] = a(0), [M, N] = a(!1), F = i(0), I = (e) => new Intl.NumberFormat().format(e), L = t((e) => {
|
|
506
808
|
let [t, n] = g;
|
|
507
809
|
return {
|
|
508
810
|
pageNum: e,
|
|
509
|
-
pageSize:
|
|
510
|
-
directions:
|
|
511
|
-
bizTypes:
|
|
512
|
-
fromTime:
|
|
513
|
-
toTime:
|
|
811
|
+
pageSize: ft,
|
|
812
|
+
directions: vt(d),
|
|
813
|
+
bizTypes: yt(p),
|
|
814
|
+
fromTime: bt(t, "00:00:00"),
|
|
815
|
+
toTime: bt(n, "23:59:59")
|
|
514
816
|
};
|
|
515
817
|
}, [
|
|
516
818
|
g,
|
|
517
819
|
p,
|
|
518
820
|
d
|
|
519
821
|
]), R = t((e, t, n) => {
|
|
520
|
-
let r =
|
|
521
|
-
e.createTime,
|
|
822
|
+
let r = xt(e), i = [
|
|
823
|
+
e.createTime ? ut(e.createTime) : void 0,
|
|
522
824
|
e.contextDisplay,
|
|
523
825
|
e.bizRefId ? `ID ${e.bizRefId}` : void 0,
|
|
524
826
|
e.balanceAfter === void 0 ? void 0 : `${o.currentBalance}: ${I(Number(e.balanceAfter || 0))}`
|
|
@@ -528,21 +830,21 @@ function St({ visible: e, points: r, text: o, onCancel: s, onRecharge: u }) {
|
|
|
528
830
|
name: e.actionName || (r < 0 ? o.expense : o.income),
|
|
529
831
|
meta: i.join(" · "),
|
|
530
832
|
amount: r,
|
|
531
|
-
badgeKind:
|
|
532
|
-
badgeText:
|
|
833
|
+
badgeKind: St(e),
|
|
834
|
+
badgeText: Ct(e, o)
|
|
533
835
|
};
|
|
534
|
-
}, [o]),
|
|
535
|
-
let n =
|
|
536
|
-
|
|
836
|
+
}, [o]), V = t(async (e = S, t = !1) => {
|
|
837
|
+
let n = F.current + 1;
|
|
838
|
+
F.current = n, N(!0);
|
|
537
839
|
try {
|
|
538
840
|
let r = await Be(L(e));
|
|
539
|
-
if (n !==
|
|
841
|
+
if (n !== F.current) return;
|
|
540
842
|
k((r.records || []).map((t, n) => R(t, n, e))), j(Number(r.total || 0)), E(Number(r.pageNum || e)), t && v.success(o.refreshed);
|
|
541
843
|
} catch (e) {
|
|
542
|
-
if (n !==
|
|
844
|
+
if (n !== F.current) return;
|
|
543
845
|
console.warn("Failed to load Mantur points ledger.", e), v.error(o.error);
|
|
544
846
|
} finally {
|
|
545
|
-
n ===
|
|
847
|
+
n === F.current && N(!1);
|
|
546
848
|
}
|
|
547
849
|
}, [
|
|
548
850
|
L,
|
|
@@ -552,18 +854,18 @@ function St({ visible: e, points: r, text: o, onCancel: s, onRecharge: u }) {
|
|
|
552
854
|
o.refreshed
|
|
553
855
|
]);
|
|
554
856
|
n(() => {
|
|
555
|
-
e &&
|
|
556
|
-
}, [
|
|
857
|
+
e && V();
|
|
858
|
+
}, [V, e]);
|
|
557
859
|
let ee = [
|
|
558
860
|
{
|
|
559
861
|
title: o.pointsDetail,
|
|
560
862
|
dataIndex: "name",
|
|
561
|
-
render: (e, t) => /* @__PURE__ */
|
|
863
|
+
render: (e, t) => /* @__PURE__ */ B("div", {
|
|
562
864
|
className: "min-w-0",
|
|
563
|
-
children: [/* @__PURE__ */
|
|
865
|
+
children: [/* @__PURE__ */ z(D.Text, {
|
|
564
866
|
className: "font-medium!",
|
|
565
867
|
children: t.name
|
|
566
|
-
}), /* @__PURE__ */
|
|
868
|
+
}), /* @__PURE__ */ z(D.Text, {
|
|
567
869
|
type: "secondary",
|
|
568
870
|
className: "mt-1 block! text-xs!",
|
|
569
871
|
children: t.meta
|
|
@@ -575,7 +877,7 @@ function St({ visible: e, points: r, text: o, onCancel: s, onRecharge: u }) {
|
|
|
575
877
|
dataIndex: "amount",
|
|
576
878
|
width: 120,
|
|
577
879
|
align: "right",
|
|
578
|
-
render: (e, t) => /* @__PURE__ */
|
|
880
|
+
render: (e, t) => /* @__PURE__ */ B(D.Text, {
|
|
579
881
|
className: `font-semibold! ${t.amount > 0 ? "text-arco-success-6!" : "text-arco-danger-6!"}`,
|
|
580
882
|
children: [t.amount > 0 ? "+" : "", I(t.amount)]
|
|
581
883
|
})
|
|
@@ -585,23 +887,23 @@ function St({ visible: e, points: r, text: o, onCancel: s, onRecharge: u }) {
|
|
|
585
887
|
dataIndex: "badgeText",
|
|
586
888
|
width: 110,
|
|
587
889
|
align: "right",
|
|
588
|
-
render: (e, t) => /* @__PURE__ */
|
|
589
|
-
color:
|
|
890
|
+
render: (e, t) => /* @__PURE__ */ z(T, {
|
|
891
|
+
color: _t(t.badgeKind),
|
|
590
892
|
children: t.badgeText
|
|
591
893
|
})
|
|
592
894
|
}
|
|
593
895
|
];
|
|
594
|
-
return /* @__PURE__ */
|
|
896
|
+
return /* @__PURE__ */ z(y, {
|
|
595
897
|
title: o.pointsDetail,
|
|
596
898
|
visible: e,
|
|
597
|
-
footer: /* @__PURE__ */
|
|
899
|
+
footer: /* @__PURE__ */ B("div", {
|
|
598
900
|
className: "flex justify-end gap-2",
|
|
599
|
-
children: [/* @__PURE__ */
|
|
901
|
+
children: [/* @__PURE__ */ z(c, {
|
|
600
902
|
onClick: s,
|
|
601
903
|
children: o.close
|
|
602
|
-
}), /* @__PURE__ */
|
|
904
|
+
}), /* @__PURE__ */ z(c, {
|
|
603
905
|
type: "primary",
|
|
604
|
-
icon: /* @__PURE__ */
|
|
906
|
+
icon: /* @__PURE__ */ z(P, {}),
|
|
605
907
|
onClick: () => {
|
|
606
908
|
s(), u();
|
|
607
909
|
},
|
|
@@ -613,131 +915,131 @@ function St({ visible: e, points: r, text: o, onCancel: s, onRecharge: u }) {
|
|
|
613
915
|
width: 780,
|
|
614
916
|
maxWidth: "calc(100vw - 48px)"
|
|
615
917
|
},
|
|
616
|
-
children: /* @__PURE__ */
|
|
918
|
+
children: /* @__PURE__ */ B("div", {
|
|
617
919
|
className: "max-h-[70vh] overflow-y-auto",
|
|
618
920
|
children: [
|
|
619
|
-
/* @__PURE__ */
|
|
921
|
+
/* @__PURE__ */ B(l, {
|
|
620
922
|
bordered: !1,
|
|
621
923
|
className: "from-arco-primary-light-1/40 to-cyan-400/5 rounded-none! bg-linear-to-br!",
|
|
622
924
|
children: [
|
|
623
|
-
/* @__PURE__ */
|
|
925
|
+
/* @__PURE__ */ z(D.Text, {
|
|
624
926
|
type: "secondary",
|
|
625
927
|
className: "text-xs!",
|
|
626
928
|
children: o.totalBalance
|
|
627
929
|
}),
|
|
628
|
-
/* @__PURE__ */
|
|
930
|
+
/* @__PURE__ */ B("div", {
|
|
629
931
|
className: "mt-1.5 mb-3.5 ",
|
|
630
|
-
children: [/* @__PURE__ */
|
|
932
|
+
children: [/* @__PURE__ */ z(D.Text, {
|
|
631
933
|
className: "text-3xl! font-bold!",
|
|
632
934
|
children: I(r.total)
|
|
633
|
-
}), /* @__PURE__ */
|
|
935
|
+
}), /* @__PURE__ */ B(D.Text, {
|
|
634
936
|
type: "secondary",
|
|
635
937
|
className: "ml-2 text-sm! ",
|
|
636
938
|
children: ["🪙 ", o.pointsUnit]
|
|
637
939
|
})]
|
|
638
940
|
}),
|
|
639
|
-
/* @__PURE__ */
|
|
941
|
+
/* @__PURE__ */ B(h.Row, {
|
|
640
942
|
gutter: 12,
|
|
641
|
-
children: [/* @__PURE__ */
|
|
943
|
+
children: [/* @__PURE__ */ z(h.Col, {
|
|
642
944
|
span: 12,
|
|
643
|
-
children: /* @__PURE__ */
|
|
945
|
+
children: /* @__PURE__ */ B(l, {
|
|
644
946
|
size: "small",
|
|
645
|
-
children: [/* @__PURE__ */
|
|
947
|
+
children: [/* @__PURE__ */ B("div", {
|
|
646
948
|
className: "mb-1 flex items-center justify-between",
|
|
647
|
-
children: [/* @__PURE__ */
|
|
949
|
+
children: [/* @__PURE__ */ z(D.Text, {
|
|
648
950
|
type: "secondary",
|
|
649
951
|
className: "text-xs!",
|
|
650
952
|
children: o.rechargePoints
|
|
651
|
-
}), /* @__PURE__ */
|
|
953
|
+
}), /* @__PURE__ */ z(T, {
|
|
652
954
|
color: "arcoblue",
|
|
653
955
|
children: o.sourceRecharge
|
|
654
956
|
})]
|
|
655
|
-
}), /* @__PURE__ */
|
|
957
|
+
}), /* @__PURE__ */ z(D.Text, {
|
|
656
958
|
className: "text-lg! font-semibold!",
|
|
657
959
|
children: I(r.recharge)
|
|
658
960
|
})]
|
|
659
961
|
})
|
|
660
|
-
}), /* @__PURE__ */
|
|
962
|
+
}), /* @__PURE__ */ z(h.Col, {
|
|
661
963
|
span: 12,
|
|
662
|
-
children: /* @__PURE__ */
|
|
964
|
+
children: /* @__PURE__ */ B(l, {
|
|
663
965
|
size: "small",
|
|
664
|
-
children: [/* @__PURE__ */
|
|
966
|
+
children: [/* @__PURE__ */ B("div", {
|
|
665
967
|
className: "mb-1 flex items-center justify-between",
|
|
666
|
-
children: [/* @__PURE__ */
|
|
968
|
+
children: [/* @__PURE__ */ z(D.Text, {
|
|
667
969
|
type: "secondary",
|
|
668
970
|
className: "text-xs!",
|
|
669
971
|
children: o.giftedPoints
|
|
670
|
-
}), /* @__PURE__ */
|
|
972
|
+
}), /* @__PURE__ */ z(T, {
|
|
671
973
|
color: "success",
|
|
672
974
|
children: o.sourceGifted
|
|
673
975
|
})]
|
|
674
|
-
}), /* @__PURE__ */
|
|
976
|
+
}), /* @__PURE__ */ z(D.Text, {
|
|
675
977
|
className: "text-lg! font-semibold!",
|
|
676
978
|
children: I(r.gifted)
|
|
677
979
|
})]
|
|
678
980
|
})
|
|
679
981
|
})]
|
|
680
982
|
}),
|
|
681
|
-
/* @__PURE__ */
|
|
983
|
+
/* @__PURE__ */ z(D.Text, {
|
|
682
984
|
type: "secondary",
|
|
683
985
|
className: "mt-2.5 block! text-xs!",
|
|
684
986
|
children: o.pointsDeductionTip
|
|
685
987
|
})
|
|
686
988
|
]
|
|
687
989
|
}),
|
|
688
|
-
/* @__PURE__ */
|
|
990
|
+
/* @__PURE__ */ B("div", {
|
|
689
991
|
className: "px-6 py-4",
|
|
690
992
|
children: [
|
|
691
|
-
/* @__PURE__ */
|
|
993
|
+
/* @__PURE__ */ B(w, {
|
|
692
994
|
activeTab: d,
|
|
693
995
|
onChange: (e) => {
|
|
694
996
|
f(e), E(1);
|
|
695
997
|
},
|
|
696
998
|
children: [
|
|
697
|
-
/* @__PURE__ */
|
|
698
|
-
/* @__PURE__ */
|
|
699
|
-
/* @__PURE__ */
|
|
999
|
+
/* @__PURE__ */ z(w.TabPane, { title: o.all }, "all"),
|
|
1000
|
+
/* @__PURE__ */ z(w.TabPane, { title: o.income }, "income"),
|
|
1001
|
+
/* @__PURE__ */ z(w.TabPane, { title: o.expense }, "expense")
|
|
700
1002
|
]
|
|
701
1003
|
}),
|
|
702
|
-
/* @__PURE__ */
|
|
1004
|
+
/* @__PURE__ */ B("div", {
|
|
703
1005
|
className: "mt-2 mb-3.5 flex flex-wrap items-center gap-2.5",
|
|
704
1006
|
children: [
|
|
705
|
-
/* @__PURE__ */
|
|
1007
|
+
/* @__PURE__ */ B(x, {
|
|
706
1008
|
value: p,
|
|
707
1009
|
style: { width: 140 },
|
|
708
1010
|
onChange: (e) => {
|
|
709
1011
|
m(e), E(1);
|
|
710
1012
|
},
|
|
711
1013
|
children: [
|
|
712
|
-
/* @__PURE__ */
|
|
1014
|
+
/* @__PURE__ */ z(x.Option, {
|
|
713
1015
|
value: "all",
|
|
714
1016
|
children: o.sourceAll
|
|
715
1017
|
}),
|
|
716
|
-
/* @__PURE__ */
|
|
1018
|
+
/* @__PURE__ */ z(x.Option, {
|
|
717
1019
|
value: "recharge",
|
|
718
1020
|
children: o.sourceRecharge
|
|
719
1021
|
}),
|
|
720
|
-
/* @__PURE__ */
|
|
1022
|
+
/* @__PURE__ */ z(x.Option, {
|
|
721
1023
|
value: "gift",
|
|
722
1024
|
children: o.sourceGifted
|
|
723
1025
|
})
|
|
724
1026
|
]
|
|
725
1027
|
}),
|
|
726
|
-
/* @__PURE__ */
|
|
1028
|
+
/* @__PURE__ */ z(dt, {
|
|
727
1029
|
value: g,
|
|
728
1030
|
onChange: (e) => {
|
|
729
1031
|
_(e || []), E(1);
|
|
730
1032
|
},
|
|
731
1033
|
style: { width: 260 }
|
|
732
1034
|
}),
|
|
733
|
-
/* @__PURE__ */
|
|
1035
|
+
/* @__PURE__ */ z(c, {
|
|
734
1036
|
loading: M,
|
|
735
|
-
onClick: () => void
|
|
1037
|
+
onClick: () => void V(S, !0),
|
|
736
1038
|
children: o.query
|
|
737
1039
|
})
|
|
738
1040
|
]
|
|
739
1041
|
}),
|
|
740
|
-
/* @__PURE__ */
|
|
1042
|
+
/* @__PURE__ */ z(C, {
|
|
741
1043
|
rowKey: "id",
|
|
742
1044
|
columns: ee,
|
|
743
1045
|
data: O,
|
|
@@ -745,22 +1047,22 @@ function St({ visible: e, points: r, text: o, onCancel: s, onRecharge: u }) {
|
|
|
745
1047
|
pagination: !1,
|
|
746
1048
|
border: !1
|
|
747
1049
|
}),
|
|
748
|
-
/* @__PURE__ */
|
|
1050
|
+
/* @__PURE__ */ z(b, {
|
|
749
1051
|
className: "mt-3 flex justify-center!",
|
|
750
1052
|
current: S,
|
|
751
|
-
pageSize:
|
|
1053
|
+
pageSize: ft,
|
|
752
1054
|
total: A,
|
|
753
1055
|
onChange: E
|
|
754
1056
|
})
|
|
755
1057
|
]
|
|
756
1058
|
}),
|
|
757
|
-
/* @__PURE__ */
|
|
1059
|
+
/* @__PURE__ */ z(l, {
|
|
758
1060
|
bordered: !1,
|
|
759
1061
|
className: "bg-arco-primary-light-1/30 rounded-none!",
|
|
760
|
-
children: /* @__PURE__ */
|
|
1062
|
+
children: /* @__PURE__ */ B(D.Text, {
|
|
761
1063
|
type: "secondary",
|
|
762
1064
|
className: "text-xs! leading-6!",
|
|
763
|
-
children: [/* @__PURE__ */
|
|
1065
|
+
children: [/* @__PURE__ */ B("strong", { children: [o.pointsNoteTitle, ":"] }), o.pointsAccountNote]
|
|
764
1066
|
})
|
|
765
1067
|
})
|
|
766
1068
|
]
|
|
@@ -769,17 +1071,17 @@ function St({ visible: e, points: r, text: o, onCancel: s, onRecharge: u }) {
|
|
|
769
1071
|
}
|
|
770
1072
|
//#endregion
|
|
771
1073
|
//#region src/labels.ts
|
|
772
|
-
var
|
|
773
|
-
function
|
|
1074
|
+
var Tt = Je;
|
|
1075
|
+
function Et(e) {
|
|
774
1076
|
return {
|
|
775
|
-
...
|
|
1077
|
+
...Tt,
|
|
776
1078
|
...e
|
|
777
1079
|
};
|
|
778
1080
|
}
|
|
779
1081
|
//#endregion
|
|
780
1082
|
//#region src/header/components/ProfileModal.tsx
|
|
781
|
-
var
|
|
782
|
-
function
|
|
1083
|
+
var Dt = 2048, Ot = 2 * 1024 * 1024;
|
|
1084
|
+
function kt(e) {
|
|
783
1085
|
return new Promise((t, n) => {
|
|
784
1086
|
let r = URL.createObjectURL(e), i = new Image();
|
|
785
1087
|
i.onload = () => {
|
|
@@ -792,8 +1094,8 @@ function Dt(e) {
|
|
|
792
1094
|
}, i.src = r;
|
|
793
1095
|
});
|
|
794
1096
|
}
|
|
795
|
-
function
|
|
796
|
-
let u =
|
|
1097
|
+
function At({ visible: e, user: t, labels: r, onCancel: o, onSubmit: l }) {
|
|
1098
|
+
let u = Et(r), [d] = m.useForm(), [f, p] = a(!1), [h, _] = a(null), [b, x] = a(null), S = i(null);
|
|
797
1099
|
n(() => () => {
|
|
798
1100
|
S.current &&= (URL.revokeObjectURL(S.current), null);
|
|
799
1101
|
}, []), n(() => {
|
|
@@ -808,7 +1110,7 @@ function Ot({ visible: e, user: t, labels: r, onCancel: o, onSubmit: l }) {
|
|
|
808
1110
|
}, w = (e) => {
|
|
809
1111
|
v.success(e);
|
|
810
1112
|
};
|
|
811
|
-
return /* @__PURE__ */
|
|
1113
|
+
return /* @__PURE__ */ z(y, {
|
|
812
1114
|
title: u.profileTitle,
|
|
813
1115
|
visible: e,
|
|
814
1116
|
onOk: async () => {
|
|
@@ -828,42 +1130,42 @@ function Ot({ visible: e, user: t, labels: r, onCancel: o, onSubmit: l }) {
|
|
|
828
1130
|
confirmLoading: f,
|
|
829
1131
|
okText: u.profileSave,
|
|
830
1132
|
cancelText: u.profileCancel,
|
|
831
|
-
children: /* @__PURE__ */
|
|
1133
|
+
children: /* @__PURE__ */ B(m, {
|
|
832
1134
|
form: d,
|
|
833
1135
|
layout: "vertical",
|
|
834
|
-
children: [/* @__PURE__ */
|
|
1136
|
+
children: [/* @__PURE__ */ z(m.Item, {
|
|
835
1137
|
label: u.profileNickname,
|
|
836
1138
|
field: "nickname",
|
|
837
1139
|
rules: [{
|
|
838
1140
|
required: !0,
|
|
839
1141
|
message: u.profileNicknamePlaceholder
|
|
840
1142
|
}],
|
|
841
|
-
children: /* @__PURE__ */
|
|
1143
|
+
children: /* @__PURE__ */ z(g, {
|
|
842
1144
|
placeholder: u.profileNicknamePlaceholder,
|
|
843
1145
|
allowClear: !0
|
|
844
1146
|
})
|
|
845
|
-
}), /* @__PURE__ */
|
|
1147
|
+
}), /* @__PURE__ */ z(m.Item, {
|
|
846
1148
|
label: u.profileAvatar,
|
|
847
|
-
children: /* @__PURE__ */
|
|
1149
|
+
children: /* @__PURE__ */ B("div", {
|
|
848
1150
|
className: "flex flex-col gap-2",
|
|
849
|
-
children: [/* @__PURE__ */
|
|
1151
|
+
children: [/* @__PURE__ */ B("div", {
|
|
850
1152
|
className: "flex items-center gap-3",
|
|
851
|
-
children: [/* @__PURE__ */
|
|
1153
|
+
children: [/* @__PURE__ */ z(s, {
|
|
852
1154
|
size: 64,
|
|
853
1155
|
className: "shrink-0 bg-arco-primary-light-1!",
|
|
854
|
-
children: b || t?.avatar ? /* @__PURE__ */
|
|
1156
|
+
children: b || t?.avatar ? /* @__PURE__ */ z("img", {
|
|
855
1157
|
src: b || t?.avatar,
|
|
856
1158
|
alt: "",
|
|
857
1159
|
className: "block h-full w-full object-cover"
|
|
858
1160
|
}) : t?.nickname?.[0] || t?.username?.[0] || "U"
|
|
859
|
-
}), /* @__PURE__ */
|
|
1161
|
+
}), /* @__PURE__ */ z(O, {
|
|
860
1162
|
accept: "image/*",
|
|
861
1163
|
showUploadList: !1,
|
|
862
1164
|
beforeUpload: async (e) => {
|
|
863
|
-
if (e.size >
|
|
1165
|
+
if (e.size > Ot) return C(u.profileAvatarTooLarge), !1;
|
|
864
1166
|
try {
|
|
865
|
-
let { width: t, height: n } = await
|
|
866
|
-
if (t >
|
|
1167
|
+
let { width: t, height: n } = await kt(e);
|
|
1168
|
+
if (t > Dt || n > Dt) return C(u.profileAvatarDimensionExceeded), !1;
|
|
867
1169
|
} catch (e) {
|
|
868
1170
|
return C(u.profileAvatarInvalidImage, e), !1;
|
|
869
1171
|
}
|
|
@@ -873,14 +1175,14 @@ function Ot({ visible: e, user: t, labels: r, onCancel: o, onSubmit: l }) {
|
|
|
873
1175
|
return S.current = n, n;
|
|
874
1176
|
}), _(e), !1;
|
|
875
1177
|
},
|
|
876
|
-
children: /* @__PURE__ */
|
|
1178
|
+
children: /* @__PURE__ */ z(c, {
|
|
877
1179
|
type: "outline",
|
|
878
1180
|
size: "small",
|
|
879
|
-
icon: /* @__PURE__ */
|
|
1181
|
+
icon: /* @__PURE__ */ z(L, {}),
|
|
880
1182
|
children: u.profileUploadAvatar
|
|
881
1183
|
})
|
|
882
1184
|
})]
|
|
883
|
-
}), /* @__PURE__ */
|
|
1185
|
+
}), /* @__PURE__ */ z("span", {
|
|
884
1186
|
className: "text-xs text-arco-text-3",
|
|
885
1187
|
children: u.profileAvatarHint
|
|
886
1188
|
})]
|
|
@@ -891,7 +1193,7 @@ function Ot({ visible: e, user: t, labels: r, onCancel: o, onSubmit: l }) {
|
|
|
891
1193
|
}
|
|
892
1194
|
//#endregion
|
|
893
1195
|
//#region src/header/mock.ts
|
|
894
|
-
var
|
|
1196
|
+
var jt = [
|
|
895
1197
|
{
|
|
896
1198
|
id: "points-500",
|
|
897
1199
|
points: 500,
|
|
@@ -911,31 +1213,31 @@ var kt = [
|
|
|
911
1213
|
];
|
|
912
1214
|
//#endregion
|
|
913
1215
|
//#region src/header/components/UserAvatar.tsx
|
|
914
|
-
function
|
|
1216
|
+
function Mt(e) {
|
|
915
1217
|
return e?.nickname?.[0] || e?.username?.[0] || "U";
|
|
916
1218
|
}
|
|
917
|
-
function
|
|
918
|
-
return /* @__PURE__ */
|
|
1219
|
+
function Nt({ user: e, size: t, className: n = "" }) {
|
|
1220
|
+
return /* @__PURE__ */ z(s, {
|
|
919
1221
|
size: t,
|
|
920
1222
|
className: `bg-arco-primary/20! text-arco-primary-6 border-2 font-bold ${n}`,
|
|
921
|
-
children: e?.avatar ? /* @__PURE__ */
|
|
1223
|
+
children: e?.avatar ? /* @__PURE__ */ z("img", {
|
|
922
1224
|
src: e.avatar,
|
|
923
1225
|
alt: "avatar",
|
|
924
1226
|
className: "h-full w-full object-cover"
|
|
925
|
-
}) :
|
|
1227
|
+
}) : Mt(e)
|
|
926
1228
|
});
|
|
927
1229
|
}
|
|
928
1230
|
//#endregion
|
|
929
1231
|
//#region src/header/components/RechargeModal.tsx
|
|
930
|
-
var
|
|
1232
|
+
var Pt = {
|
|
931
1233
|
minHeight: 292,
|
|
932
1234
|
height: "100%",
|
|
933
1235
|
display: "flex",
|
|
934
1236
|
flexDirection: "column",
|
|
935
1237
|
justifyContent: "space-between"
|
|
936
|
-
},
|
|
937
|
-
function
|
|
938
|
-
let [m, _] = a(
|
|
1238
|
+
}, Ft = "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!";
|
|
1239
|
+
function It({ visible: e, user: t, points: r, text: o, packages: s, packageLoading: u = !1, submitting: d = !1, onCancel: f, onPay: p }) {
|
|
1240
|
+
let [m, _] = a(jt[2].id), [v, b] = a(""), x = i(null), S = s?.length ? s : jt, C = (e) => new Intl.NumberFormat().format(e), w = v.trim(), E = Number(w), O = w.length > 0, A = m === "custom", j = O && Number.isFinite(E) && Number.isInteger(E) && E >= 10, M = S.find((e) => e.id === m), N = A && j ? {
|
|
939
1241
|
id: "custom",
|
|
940
1242
|
price: E,
|
|
941
1243
|
points: E * 100,
|
|
@@ -954,15 +1256,15 @@ function Pt({ visible: e, user: t, points: r, text: o, packages: s, packageLoadi
|
|
|
954
1256
|
}, I = () => {
|
|
955
1257
|
_("custom"), b((e) => e || "10"), x.current?.focus();
|
|
956
1258
|
};
|
|
957
|
-
return /* @__PURE__ */
|
|
1259
|
+
return /* @__PURE__ */ z(y, {
|
|
958
1260
|
title: o.rechargeTitle,
|
|
959
1261
|
visible: e,
|
|
960
|
-
footer: /* @__PURE__ */
|
|
1262
|
+
footer: /* @__PURE__ */ B("div", {
|
|
961
1263
|
className: "mx-auto flex max-w-7xl items-center justify-between gap-5",
|
|
962
|
-
children: [/* @__PURE__ */
|
|
1264
|
+
children: [/* @__PURE__ */ z("span", {
|
|
963
1265
|
className: "text-arco-text-2 text-sm leading-6",
|
|
964
1266
|
children: o.rechargeHint
|
|
965
|
-
}), /* @__PURE__ */
|
|
1267
|
+
}), /* @__PURE__ */ z(c, {
|
|
966
1268
|
type: "primary",
|
|
967
1269
|
size: "large",
|
|
968
1270
|
className: "min-w-48! font-bold!",
|
|
@@ -989,37 +1291,37 @@ function Pt({ visible: e, user: t, points: r, text: o, packages: s, packageLoadi
|
|
|
989
1291
|
paddingBottom: 0
|
|
990
1292
|
},
|
|
991
1293
|
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!",
|
|
992
|
-
children: /* @__PURE__ */
|
|
1294
|
+
children: /* @__PURE__ */ B("div", {
|
|
993
1295
|
className: "mx-auto flex h-full w-full max-w-7xl flex-col items-center ",
|
|
994
|
-
children: [/* @__PURE__ */
|
|
1296
|
+
children: [/* @__PURE__ */ B("div", {
|
|
995
1297
|
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",
|
|
996
|
-
children: [/* @__PURE__ */
|
|
1298
|
+
children: [/* @__PURE__ */ z(Nt, {
|
|
997
1299
|
user: t,
|
|
998
1300
|
size: 32,
|
|
999
1301
|
className: "shrink-0"
|
|
1000
|
-
}), /* @__PURE__ */
|
|
1302
|
+
}), /* @__PURE__ */ B("span", { children: [
|
|
1001
1303
|
t?.nickname || t?.username,
|
|
1002
1304
|
" · ",
|
|
1003
1305
|
o.currentBalance,
|
|
1004
1306
|
" ",
|
|
1005
|
-
/* @__PURE__ */
|
|
1307
|
+
/* @__PURE__ */ z("strong", {
|
|
1006
1308
|
className: "text-arco-text-1",
|
|
1007
1309
|
children: C(r.total)
|
|
1008
1310
|
}),
|
|
1009
1311
|
" ",
|
|
1010
1312
|
o.pointsUnit
|
|
1011
1313
|
] })]
|
|
1012
|
-
}), /* @__PURE__ */
|
|
1314
|
+
}), /* @__PURE__ */ z("div", {
|
|
1013
1315
|
className: "mt-6 w-full",
|
|
1014
|
-
children: /* @__PURE__ */
|
|
1316
|
+
children: /* @__PURE__ */ B(h.Row, {
|
|
1015
1317
|
gutter: [16, 16],
|
|
1016
1318
|
style: { alignItems: "stretch" },
|
|
1017
|
-
children: [S.map((e) => /* @__PURE__ */
|
|
1319
|
+
children: [S.map((e) => /* @__PURE__ */ z(h.Col, {
|
|
1018
1320
|
xs: 24,
|
|
1019
1321
|
sm: 12,
|
|
1020
1322
|
lg: 6,
|
|
1021
1323
|
style: { display: "flex" },
|
|
1022
|
-
children: /* @__PURE__ */
|
|
1324
|
+
children: /* @__PURE__ */ B(l, {
|
|
1023
1325
|
hoverable: !0,
|
|
1024
1326
|
loading: u,
|
|
1025
1327
|
role: "button",
|
|
@@ -1028,73 +1330,73 @@ function Pt({ visible: e, user: t, points: r, text: o, packages: s, packageLoadi
|
|
|
1028
1330
|
onKeyDown: (t) => {
|
|
1029
1331
|
(t.key === "Enter" || t.key === " ") && F(e.id);
|
|
1030
1332
|
},
|
|
1031
|
-
bodyStyle:
|
|
1032
|
-
className: `${
|
|
1333
|
+
bodyStyle: Pt,
|
|
1334
|
+
className: `${Ft} border-arco-border-2! bg-arco-bg-2! cursor-pointer ${m === 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!"}`,
|
|
1033
1335
|
children: [
|
|
1034
|
-
m === e.id ? /* @__PURE__ */
|
|
1035
|
-
"recommended" in e && e.recommended ? /* @__PURE__ */
|
|
1336
|
+
m === e.id ? /* @__PURE__ */ z(k, { className: "text-arco-primary-6! absolute bottom-4 left-4 text-xl" }) : null,
|
|
1337
|
+
"recommended" in e && e.recommended ? /* @__PURE__ */ z(T, {
|
|
1036
1338
|
color: "arcoblue",
|
|
1037
1339
|
className: "absolute top-4 right-4 text-xs! font-bold!",
|
|
1038
1340
|
children: "HOT"
|
|
1039
1341
|
}) : null,
|
|
1040
|
-
/* @__PURE__ */
|
|
1342
|
+
/* @__PURE__ */ B("div", {
|
|
1041
1343
|
className: "min-w-0 pr-16",
|
|
1042
|
-
children: [/* @__PURE__ */
|
|
1344
|
+
children: [/* @__PURE__ */ B(D.Text, {
|
|
1043
1345
|
className: "flex items-center text-3xl! leading-tight! font-bold!",
|
|
1044
|
-
children: [C(e.points), /* @__PURE__ */
|
|
1346
|
+
children: [C(e.points), /* @__PURE__ */ z("span", {
|
|
1045
1347
|
className: "ml-1 text-2xl",
|
|
1046
1348
|
children: "🪙"
|
|
1047
1349
|
})]
|
|
1048
|
-
}), /* @__PURE__ */
|
|
1350
|
+
}), /* @__PURE__ */ z(D.Text, {
|
|
1049
1351
|
type: "secondary",
|
|
1050
1352
|
className: "mt-1 block! text-sm!",
|
|
1051
1353
|
children: o.pointsUnit
|
|
1052
1354
|
})]
|
|
1053
1355
|
}),
|
|
1054
|
-
/* @__PURE__ */
|
|
1356
|
+
/* @__PURE__ */ z("div", {
|
|
1055
1357
|
className: "mt-7 flex w-full justify-end",
|
|
1056
|
-
children: /* @__PURE__ */
|
|
1358
|
+
children: /* @__PURE__ */ B(D.Text, {
|
|
1057
1359
|
className: "text-arco-primary-6! text-right text-2xl! leading-tight! font-bold!",
|
|
1058
1360
|
children: ["$", e.price]
|
|
1059
1361
|
})
|
|
1060
1362
|
})
|
|
1061
1363
|
]
|
|
1062
1364
|
})
|
|
1063
|
-
}, e.id)), /* @__PURE__ */
|
|
1365
|
+
}, e.id)), /* @__PURE__ */ z(h.Col, {
|
|
1064
1366
|
xs: 24,
|
|
1065
1367
|
sm: 12,
|
|
1066
1368
|
lg: 6,
|
|
1067
1369
|
style: { display: "flex" },
|
|
1068
|
-
children: /* @__PURE__ */
|
|
1370
|
+
children: /* @__PURE__ */ B(l, {
|
|
1069
1371
|
role: "button",
|
|
1070
1372
|
tabIndex: 0,
|
|
1071
1373
|
onClick: I,
|
|
1072
1374
|
onKeyDown: (e) => {
|
|
1073
1375
|
(e.key === "Enter" || e.key === " ") && I();
|
|
1074
1376
|
},
|
|
1075
|
-
bodyStyle:
|
|
1076
|
-
className: `${
|
|
1377
|
+
bodyStyle: Pt,
|
|
1378
|
+
className: `${Ft} 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%)]!" : O && 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!"}`,
|
|
1077
1379
|
children: [
|
|
1078
|
-
j ? /* @__PURE__ */
|
|
1079
|
-
/* @__PURE__ */
|
|
1380
|
+
j ? /* @__PURE__ */ z(k, { className: "text-arco-primary-6! absolute top-4 right-4 text-xl" }) : null,
|
|
1381
|
+
/* @__PURE__ */ B("div", {
|
|
1080
1382
|
className: "flex min-w-0 flex-col gap-2.5",
|
|
1081
1383
|
children: [
|
|
1082
|
-
/* @__PURE__ */
|
|
1384
|
+
/* @__PURE__ */ B("div", {
|
|
1083
1385
|
className: "flex min-w-0 flex-col gap-2.5 pr-8",
|
|
1084
|
-
children: [/* @__PURE__ */
|
|
1386
|
+
children: [/* @__PURE__ */ z(T, {
|
|
1085
1387
|
color: "arcoblue",
|
|
1086
1388
|
className: "w-fit text-xs! font-bold!",
|
|
1087
1389
|
children: o.customRechargeAmount
|
|
1088
|
-
}), /* @__PURE__ */
|
|
1390
|
+
}), /* @__PURE__ */ z(D.Text, {
|
|
1089
1391
|
type: "secondary",
|
|
1090
1392
|
className: "block! text-sm! leading-5! ",
|
|
1091
1393
|
children: o.customRechargeDescription
|
|
1092
1394
|
})]
|
|
1093
1395
|
}),
|
|
1094
|
-
/* @__PURE__ */
|
|
1396
|
+
/* @__PURE__ */ z("div", {
|
|
1095
1397
|
className: "mt-1",
|
|
1096
1398
|
onClick: (e) => e.stopPropagation(),
|
|
1097
|
-
children: /* @__PURE__ */
|
|
1399
|
+
children: /* @__PURE__ */ z(g, {
|
|
1098
1400
|
ref: x,
|
|
1099
1401
|
type: "text",
|
|
1100
1402
|
inputMode: "numeric",
|
|
@@ -1105,11 +1407,11 @@ function Pt({ visible: e, user: t, points: r, text: o, packages: s, packageLoadi
|
|
|
1105
1407
|
onChange: (e) => {
|
|
1106
1408
|
_("custom"), b(e.replace(/\D/g, ""));
|
|
1107
1409
|
},
|
|
1108
|
-
prefix: /* @__PURE__ */
|
|
1410
|
+
prefix: /* @__PURE__ */ z("span", {
|
|
1109
1411
|
className: "text-arco-primary-6 text-base font-semibold",
|
|
1110
1412
|
children: "$"
|
|
1111
1413
|
}),
|
|
1112
|
-
suffix: /* @__PURE__ */
|
|
1414
|
+
suffix: /* @__PURE__ */ z("span", {
|
|
1113
1415
|
className: "text-arco-primary-6 text-xs font-semibold",
|
|
1114
1416
|
children: "USD"
|
|
1115
1417
|
}),
|
|
@@ -1118,9 +1420,9 @@ function Pt({ visible: e, user: t, points: r, text: o, packages: s, packageLoadi
|
|
|
1118
1420
|
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%)]! ${O && 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!"}`
|
|
1119
1421
|
})
|
|
1120
1422
|
}),
|
|
1121
|
-
/* @__PURE__ */
|
|
1423
|
+
/* @__PURE__ */ z("div", {
|
|
1122
1424
|
className: "h-4",
|
|
1123
|
-
children: /* @__PURE__ */
|
|
1425
|
+
children: /* @__PURE__ */ z(D.Text, {
|
|
1124
1426
|
type: "error",
|
|
1125
1427
|
className: `block! text-xs! leading-4! transition-opacity ${O && A && !j ? "opacity-100" : "opacity-0"}`,
|
|
1126
1428
|
children: o.customRechargeMinError
|
|
@@ -1128,22 +1430,22 @@ function Pt({ visible: e, user: t, points: r, text: o, packages: s, packageLoadi
|
|
|
1128
1430
|
})
|
|
1129
1431
|
]
|
|
1130
1432
|
}),
|
|
1131
|
-
/* @__PURE__ */
|
|
1433
|
+
/* @__PURE__ */ B("div", {
|
|
1132
1434
|
className: "border-arco-primary-6/20! bg-arco-bg-1!/80 mt-3 rounded-md border px-3.5 py-3 shadow-sm",
|
|
1133
1435
|
children: [
|
|
1134
|
-
/* @__PURE__ */
|
|
1436
|
+
/* @__PURE__ */ z(D.Text, {
|
|
1135
1437
|
type: "secondary",
|
|
1136
1438
|
className: "block! text-xs!",
|
|
1137
1439
|
children: o.customRechargeEstimate
|
|
1138
1440
|
}),
|
|
1139
|
-
/* @__PURE__ */
|
|
1441
|
+
/* @__PURE__ */ B(D.Text, {
|
|
1140
1442
|
className: "text-arco-primary-6! mt-1 block! text-xl! leading-tight! font-bold!",
|
|
1141
|
-
children: [j ? C(E * 100) : "-", /* @__PURE__ */
|
|
1443
|
+
children: [j ? C(E * 100) : "-", /* @__PURE__ */ z("span", {
|
|
1142
1444
|
className: "text-arco-text-3 ml-1 text-xs font-normal",
|
|
1143
1445
|
children: o.pointsUnit
|
|
1144
1446
|
})]
|
|
1145
1447
|
}),
|
|
1146
|
-
/* @__PURE__ */
|
|
1448
|
+
/* @__PURE__ */ z(D.Text, {
|
|
1147
1449
|
type: "secondary",
|
|
1148
1450
|
className: "mt-0.5 block! text-[10px]!",
|
|
1149
1451
|
children: o.customRechargeRate
|
|
@@ -1160,7 +1462,7 @@ function Pt({ visible: e, user: t, points: r, text: o, packages: s, packageLoadi
|
|
|
1160
1462
|
}
|
|
1161
1463
|
//#endregion
|
|
1162
1464
|
//#region node_modules/prop-types/node_modules/react-is/cjs/react-is.production.min.js
|
|
1163
|
-
var
|
|
1465
|
+
var Lt = /* @__PURE__ */ H(((e) => {
|
|
1164
1466
|
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;
|
|
1165
1467
|
function b(e) {
|
|
1166
1468
|
if (typeof e == "object" && e) {
|
|
@@ -1216,7 +1518,7 @@ var Ft = /* @__PURE__ */ U(((e) => {
|
|
|
1216
1518
|
}, e.isValidElementType = function(e) {
|
|
1217
1519
|
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);
|
|
1218
1520
|
}, e.typeOf = b;
|
|
1219
|
-
})),
|
|
1521
|
+
})), Rt = /* @__PURE__ */ H(((e) => {
|
|
1220
1522
|
process.env.NODE_ENV !== "production" && (function() {
|
|
1221
1523
|
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;
|
|
1222
1524
|
function b(e) {
|
|
@@ -1275,26 +1577,26 @@ var Ft = /* @__PURE__ */ U(((e) => {
|
|
|
1275
1577
|
function te(e) {
|
|
1276
1578
|
return x(e) === h;
|
|
1277
1579
|
}
|
|
1278
|
-
function
|
|
1580
|
+
function ne(e) {
|
|
1279
1581
|
return x(e) === m;
|
|
1280
1582
|
}
|
|
1281
|
-
function
|
|
1583
|
+
function re(e) {
|
|
1282
1584
|
return x(e) === r;
|
|
1283
1585
|
}
|
|
1284
|
-
function
|
|
1586
|
+
function ie(e) {
|
|
1285
1587
|
return x(e) === o;
|
|
1286
1588
|
}
|
|
1287
|
-
function
|
|
1589
|
+
function ae(e) {
|
|
1288
1590
|
return x(e) === a;
|
|
1289
1591
|
}
|
|
1290
|
-
function
|
|
1592
|
+
function H(e) {
|
|
1291
1593
|
return x(e) === f;
|
|
1292
1594
|
}
|
|
1293
|
-
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 = L, e.isContextConsumer = R, e.isContextProvider = z, e.isElement = B, e.isForwardRef = V, e.isFragment = ee, e.isLazy = te, e.isMemo =
|
|
1595
|
+
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 = L, e.isContextConsumer = R, e.isContextProvider = z, e.isElement = B, e.isForwardRef = V, e.isFragment = ee, e.isLazy = te, e.isMemo = ne, e.isPortal = re, e.isProfiler = ie, e.isStrictMode = ae, e.isSuspense = H, e.isValidElementType = b, e.typeOf = x;
|
|
1294
1596
|
})();
|
|
1295
|
-
})),
|
|
1296
|
-
process.env.NODE_ENV === "production" ? t.exports =
|
|
1297
|
-
})),
|
|
1597
|
+
})), zt = /* @__PURE__ */ H(((e, t) => {
|
|
1598
|
+
process.env.NODE_ENV === "production" ? t.exports = Lt() : t.exports = Rt();
|
|
1599
|
+
})), Bt = /* @__PURE__ */ H(((e, t) => {
|
|
1298
1600
|
var n = Object.getOwnPropertySymbols, r = Object.prototype.hasOwnProperty, i = Object.prototype.propertyIsEnumerable;
|
|
1299
1601
|
function a(e) {
|
|
1300
1602
|
if (e == null) throw TypeError("Object.assign cannot be called with null or undefined");
|
|
@@ -1327,14 +1629,14 @@ var Ft = /* @__PURE__ */ U(((e) => {
|
|
|
1327
1629
|
}
|
|
1328
1630
|
return s;
|
|
1329
1631
|
};
|
|
1330
|
-
})),
|
|
1632
|
+
})), Vt = /* @__PURE__ */ H(((e, t) => {
|
|
1331
1633
|
t.exports = "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";
|
|
1332
|
-
})),
|
|
1634
|
+
})), Ht = /* @__PURE__ */ H(((e, t) => {
|
|
1333
1635
|
t.exports = Function.call.bind(Object.prototype.hasOwnProperty);
|
|
1334
|
-
})),
|
|
1636
|
+
})), Ut = /* @__PURE__ */ H(((e, t) => {
|
|
1335
1637
|
var n = function() {};
|
|
1336
1638
|
if (process.env.NODE_ENV !== "production") {
|
|
1337
|
-
var r =
|
|
1639
|
+
var r = Vt(), i = {}, a = Ht();
|
|
1338
1640
|
n = function(e) {
|
|
1339
1641
|
var t = "Warning: " + e;
|
|
1340
1642
|
typeof console < "u" && console.error(t);
|
|
@@ -1367,8 +1669,8 @@ var Ft = /* @__PURE__ */ U(((e) => {
|
|
|
1367
1669
|
o.resetWarningCache = function() {
|
|
1368
1670
|
process.env.NODE_ENV !== "production" && (i = {});
|
|
1369
1671
|
}, t.exports = o;
|
|
1370
|
-
})),
|
|
1371
|
-
var n =
|
|
1672
|
+
})), Wt = /* @__PURE__ */ H(((e, t) => {
|
|
1673
|
+
var n = zt(), r = Bt(), i = Vt(), a = Ht(), o = Ut(), s = function() {};
|
|
1372
1674
|
process.env.NODE_ENV !== "production" && (s = function(e) {
|
|
1373
1675
|
var t = "Warning: " + e;
|
|
1374
1676
|
typeof console < "u" && console.error(t);
|
|
@@ -1514,1666 +1816,1316 @@ var Ft = /* @__PURE__ */ U(((e) => {
|
|
|
1514
1816
|
}
|
|
1515
1817
|
return null;
|
|
1516
1818
|
}
|
|
1517
|
-
return g(t);
|
|
1518
|
-
}
|
|
1519
|
-
function T(e) {
|
|
1520
|
-
if (!Array.isArray(e)) return process.env.NODE_ENV !== "production" && s("Invalid argument supplied to oneOfType, expected an instance of array."), c;
|
|
1521
|
-
for (var t = 0; t < e.length; t++) {
|
|
1522
|
-
var n = e[t];
|
|
1523
|
-
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;
|
|
1524
|
-
}
|
|
1525
|
-
function r(t, n, r, o, s) {
|
|
1526
|
-
for (var c = [], l = 0; l < e.length; l++) {
|
|
1527
|
-
var u = e[l], d = u(t, n, r, o, s, i);
|
|
1528
|
-
if (d == null) return null;
|
|
1529
|
-
d.data && a(d.data, "expectedType") && c.push(d.data.expectedType);
|
|
1530
|
-
}
|
|
1531
|
-
var f = c.length > 0 ? ", expected one of type [" + c.join(", ") + "]" : "";
|
|
1532
|
-
return new h("Invalid " + o + " `" + s + "` supplied to " + ("`" + r + "`" + f + "."));
|
|
1533
|
-
}
|
|
1534
|
-
return g(r);
|
|
1535
|
-
}
|
|
1536
|
-
function E() {
|
|
1537
|
-
function e(e, t, n, r, i) {
|
|
1538
|
-
return A(e[t]) ? null : new h("Invalid " + r + " `" + i + "` supplied to " + ("`" + n + "`, expected a ReactNode."));
|
|
1539
|
-
}
|
|
1540
|
-
return g(e);
|
|
1541
|
-
}
|
|
1542
|
-
function D(e, t, n, r, i) {
|
|
1543
|
-
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 + "`.");
|
|
1544
|
-
}
|
|
1545
|
-
function O(e) {
|
|
1546
|
-
function t(t, n, r, a, o) {
|
|
1547
|
-
var s = t[n], c = M(s);
|
|
1548
|
-
if (c !== "object") return new h("Invalid " + a + " `" + o + "` of type `" + c + "` " + ("supplied to `" + r + "`, expected `object`."));
|
|
1549
|
-
for (var l in e) {
|
|
1550
|
-
var u = e[l];
|
|
1551
|
-
if (typeof u != "function") return D(r, a, o, l, N(u));
|
|
1552
|
-
var d = u(s, l, r, a, o + "." + l, i);
|
|
1553
|
-
if (d) return d;
|
|
1554
|
-
}
|
|
1555
|
-
return null;
|
|
1556
|
-
}
|
|
1557
|
-
return g(t);
|
|
1558
|
-
}
|
|
1559
|
-
function k(e) {
|
|
1560
|
-
function t(t, n, o, s, c) {
|
|
1561
|
-
var l = t[n], u = M(l);
|
|
1562
|
-
if (u !== "object") return new h("Invalid " + s + " `" + c + "` of type `" + u + "` " + ("supplied to `" + o + "`, expected `object`."));
|
|
1563
|
-
for (var d in r({}, t[n], e)) {
|
|
1564
|
-
var f = e[d];
|
|
1565
|
-
if (a(e, d) && typeof f != "function") return D(o, s, c, d, N(f));
|
|
1566
|
-
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, " "));
|
|
1567
|
-
var p = f(l, d, o, s, c + "." + d, i);
|
|
1568
|
-
if (p) return p;
|
|
1569
|
-
}
|
|
1570
|
-
return null;
|
|
1571
|
-
}
|
|
1572
|
-
return g(t);
|
|
1573
|
-
}
|
|
1574
|
-
function A(t) {
|
|
1575
|
-
switch (typeof t) {
|
|
1576
|
-
case "number":
|
|
1577
|
-
case "string":
|
|
1578
|
-
case "undefined": return !0;
|
|
1579
|
-
case "boolean": return !t;
|
|
1580
|
-
case "object":
|
|
1581
|
-
if (Array.isArray(t)) return t.every(A);
|
|
1582
|
-
if (t === null || e(t)) return !0;
|
|
1583
|
-
var n = d(t);
|
|
1584
|
-
if (n) {
|
|
1585
|
-
var r = n.call(t), i;
|
|
1586
|
-
if (n !== t.entries) {
|
|
1587
|
-
for (; !(i = r.next()).done;) if (!A(i.value)) return !1;
|
|
1588
|
-
} else for (; !(i = r.next()).done;) {
|
|
1589
|
-
var a = i.value;
|
|
1590
|
-
if (a && !A(a[1])) return !1;
|
|
1591
|
-
}
|
|
1592
|
-
} else return !1;
|
|
1593
|
-
return !0;
|
|
1594
|
-
default: return !1;
|
|
1595
|
-
}
|
|
1596
|
-
}
|
|
1597
|
-
function j(e, t) {
|
|
1598
|
-
return e === "symbol" ? !0 : t ? t["@@toStringTag"] === "Symbol" || typeof Symbol == "function" && t instanceof Symbol : !1;
|
|
1599
|
-
}
|
|
1600
|
-
function M(e) {
|
|
1601
|
-
var t = typeof e;
|
|
1602
|
-
return Array.isArray(e) ? "array" : e instanceof RegExp ? "object" : j(t, e) ? "symbol" : t;
|
|
1603
|
-
}
|
|
1604
|
-
function N(e) {
|
|
1605
|
-
if (e == null) return "" + e;
|
|
1606
|
-
var t = M(e);
|
|
1607
|
-
if (t === "object") {
|
|
1608
|
-
if (e instanceof Date) return "date";
|
|
1609
|
-
if (e instanceof RegExp) return "regexp";
|
|
1610
|
-
}
|
|
1611
|
-
return t;
|
|
1612
|
-
}
|
|
1613
|
-
function P(e) {
|
|
1614
|
-
var t = N(e);
|
|
1615
|
-
switch (t) {
|
|
1616
|
-
case "array":
|
|
1617
|
-
case "object": return "an " + t;
|
|
1618
|
-
case "boolean":
|
|
1619
|
-
case "date":
|
|
1620
|
-
case "regexp": return "a " + t;
|
|
1621
|
-
default: return t;
|
|
1622
|
-
}
|
|
1819
|
+
return g(t);
|
|
1623
1820
|
}
|
|
1624
|
-
function
|
|
1625
|
-
|
|
1821
|
+
function T(e) {
|
|
1822
|
+
if (!Array.isArray(e)) return process.env.NODE_ENV !== "production" && s("Invalid argument supplied to oneOfType, expected an instance of array."), c;
|
|
1823
|
+
for (var t = 0; t < e.length; t++) {
|
|
1824
|
+
var n = e[t];
|
|
1825
|
+
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;
|
|
1826
|
+
}
|
|
1827
|
+
function r(t, n, r, o, s) {
|
|
1828
|
+
for (var c = [], l = 0; l < e.length; l++) {
|
|
1829
|
+
var u = e[l], d = u(t, n, r, o, s, i);
|
|
1830
|
+
if (d == null) return null;
|
|
1831
|
+
d.data && a(d.data, "expectedType") && c.push(d.data.expectedType);
|
|
1832
|
+
}
|
|
1833
|
+
var f = c.length > 0 ? ", expected one of type [" + c.join(", ") + "]" : "";
|
|
1834
|
+
return new h("Invalid " + o + " `" + s + "` supplied to " + ("`" + r + "`" + f + "."));
|
|
1835
|
+
}
|
|
1836
|
+
return g(r);
|
|
1626
1837
|
}
|
|
1627
|
-
|
|
1628
|
-
|
|
1629
|
-
|
|
1630
|
-
var n = zt();
|
|
1631
|
-
function r() {}
|
|
1632
|
-
function i() {}
|
|
1633
|
-
i.resetWarningCache = r, t.exports = function() {
|
|
1634
|
-
function e(e, t, r, i, a, o) {
|
|
1635
|
-
if (o !== n) {
|
|
1636
|
-
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");
|
|
1637
|
-
throw s.name = "Invariant Violation", s;
|
|
1838
|
+
function E() {
|
|
1839
|
+
function e(e, t, n, r, i) {
|
|
1840
|
+
return A(e[t]) ? null : new h("Invalid " + r + " `" + i + "` supplied to " + ("`" + n + "`, expected a ReactNode."));
|
|
1638
1841
|
}
|
|
1842
|
+
return g(e);
|
|
1639
1843
|
}
|
|
1640
|
-
e
|
|
1641
|
-
|
|
1642
|
-
return e;
|
|
1844
|
+
function D(e, t, n, r, i) {
|
|
1845
|
+
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 + "`.");
|
|
1643
1846
|
}
|
|
1644
|
-
|
|
1645
|
-
|
|
1646
|
-
|
|
1647
|
-
|
|
1648
|
-
|
|
1649
|
-
|
|
1650
|
-
|
|
1651
|
-
|
|
1652
|
-
|
|
1653
|
-
|
|
1654
|
-
|
|
1655
|
-
element: e,
|
|
1656
|
-
elementType: e,
|
|
1657
|
-
instanceOf: t,
|
|
1658
|
-
node: e,
|
|
1659
|
-
objectOf: t,
|
|
1660
|
-
oneOf: t,
|
|
1661
|
-
oneOfType: t,
|
|
1662
|
-
shape: t,
|
|
1663
|
-
exact: t,
|
|
1664
|
-
checkPropTypes: i,
|
|
1665
|
-
resetWarningCache: r
|
|
1666
|
-
};
|
|
1667
|
-
return a.PropTypes = a, a;
|
|
1668
|
-
};
|
|
1669
|
-
})), X = /* @__PURE__ */ G((/* @__PURE__ */ U(((e, t) => {
|
|
1670
|
-
if (process.env.NODE_ENV !== "production") {
|
|
1671
|
-
var n = Lt();
|
|
1672
|
-
t.exports = Ht()(n.isElement, !0);
|
|
1673
|
-
} else t.exports = Ut()();
|
|
1674
|
-
})))(), 1);
|
|
1675
|
-
function Wt(e, t) {
|
|
1676
|
-
var n = Object.keys(e);
|
|
1677
|
-
if (Object.getOwnPropertySymbols) {
|
|
1678
|
-
var r = Object.getOwnPropertySymbols(e);
|
|
1679
|
-
t && (r = r.filter(function(t) {
|
|
1680
|
-
return Object.getOwnPropertyDescriptor(e, t).enumerable;
|
|
1681
|
-
})), n.push.apply(n, r);
|
|
1682
|
-
}
|
|
1683
|
-
return n;
|
|
1684
|
-
}
|
|
1685
|
-
function Gt(e) {
|
|
1686
|
-
for (var t = 1; t < arguments.length; t++) {
|
|
1687
|
-
var n = arguments[t] == null ? {} : arguments[t];
|
|
1688
|
-
t % 2 ? Wt(Object(n), !0).forEach(function(t) {
|
|
1689
|
-
qt(e, t, n[t]);
|
|
1690
|
-
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n)) : Wt(Object(n)).forEach(function(t) {
|
|
1691
|
-
Object.defineProperty(e, t, Object.getOwnPropertyDescriptor(n, t));
|
|
1692
|
-
});
|
|
1693
|
-
}
|
|
1694
|
-
return e;
|
|
1695
|
-
}
|
|
1696
|
-
function Kt(e) {
|
|
1697
|
-
"@babel/helpers - typeof";
|
|
1698
|
-
return Kt = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(e) {
|
|
1699
|
-
return typeof e;
|
|
1700
|
-
} : function(e) {
|
|
1701
|
-
return e && typeof Symbol == "function" && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
|
|
1702
|
-
}, Kt(e);
|
|
1703
|
-
}
|
|
1704
|
-
function qt(e, t, n) {
|
|
1705
|
-
return t in e ? Object.defineProperty(e, t, {
|
|
1706
|
-
value: n,
|
|
1707
|
-
enumerable: !0,
|
|
1708
|
-
configurable: !0,
|
|
1709
|
-
writable: !0
|
|
1710
|
-
}) : e[t] = n, e;
|
|
1711
|
-
}
|
|
1712
|
-
function Jt(e, t) {
|
|
1713
|
-
if (e == null) return {};
|
|
1714
|
-
var n = {}, r = Object.keys(e), i, a;
|
|
1715
|
-
for (a = 0; a < r.length; a++) i = r[a], !(t.indexOf(i) >= 0) && (n[i] = e[i]);
|
|
1716
|
-
return n;
|
|
1717
|
-
}
|
|
1718
|
-
function Yt(e, t) {
|
|
1719
|
-
if (e == null) return {};
|
|
1720
|
-
var n = Jt(e, t), r, i;
|
|
1721
|
-
if (Object.getOwnPropertySymbols) {
|
|
1722
|
-
var a = Object.getOwnPropertySymbols(e);
|
|
1723
|
-
for (i = 0; i < a.length; i++) r = a[i], !(t.indexOf(r) >= 0) && Object.prototype.propertyIsEnumerable.call(e, r) && (n[r] = e[r]);
|
|
1724
|
-
}
|
|
1725
|
-
return n;
|
|
1726
|
-
}
|
|
1727
|
-
function Xt(e, t) {
|
|
1728
|
-
return Zt(e) || Qt(e, t) || $t(e, t) || tn();
|
|
1729
|
-
}
|
|
1730
|
-
function Zt(e) {
|
|
1731
|
-
if (Array.isArray(e)) return e;
|
|
1732
|
-
}
|
|
1733
|
-
function Qt(e, t) {
|
|
1734
|
-
var n = e && (typeof Symbol < "u" && e[Symbol.iterator] || e["@@iterator"]);
|
|
1735
|
-
if (n != null) {
|
|
1736
|
-
var r = [], i = !0, a = !1, o, s;
|
|
1737
|
-
try {
|
|
1738
|
-
for (n = n.call(e); !(i = (o = n.next()).done) && (r.push(o.value), !(t && r.length === t)); i = !0);
|
|
1739
|
-
} catch (e) {
|
|
1740
|
-
a = !0, s = e;
|
|
1741
|
-
} finally {
|
|
1742
|
-
try {
|
|
1743
|
-
!i && n.return != null && n.return();
|
|
1744
|
-
} finally {
|
|
1745
|
-
if (a) throw s;
|
|
1847
|
+
function O(e) {
|
|
1848
|
+
function t(t, n, r, a, o) {
|
|
1849
|
+
var s = t[n], c = M(s);
|
|
1850
|
+
if (c !== "object") return new h("Invalid " + a + " `" + o + "` of type `" + c + "` " + ("supplied to `" + r + "`, expected `object`."));
|
|
1851
|
+
for (var l in e) {
|
|
1852
|
+
var u = e[l];
|
|
1853
|
+
if (typeof u != "function") return D(r, a, o, l, N(u));
|
|
1854
|
+
var d = u(s, l, r, a, o + "." + l, i);
|
|
1855
|
+
if (d) return d;
|
|
1856
|
+
}
|
|
1857
|
+
return null;
|
|
1746
1858
|
}
|
|
1859
|
+
return g(t);
|
|
1747
1860
|
}
|
|
1748
|
-
|
|
1749
|
-
|
|
1750
|
-
|
|
1751
|
-
|
|
1752
|
-
|
|
1753
|
-
|
|
1754
|
-
|
|
1755
|
-
|
|
1756
|
-
|
|
1757
|
-
|
|
1758
|
-
}
|
|
1759
|
-
|
|
1760
|
-
(t == null || t > e.length) && (t = e.length);
|
|
1761
|
-
for (var n = 0, r = Array(t); n < t; n++) r[n] = e[n];
|
|
1762
|
-
return r;
|
|
1763
|
-
}
|
|
1764
|
-
function tn() {
|
|
1765
|
-
throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
1766
|
-
}
|
|
1767
|
-
var nn = function(e) {
|
|
1768
|
-
return e !== null && Kt(e) === "object";
|
|
1769
|
-
}, rn = function(e) {
|
|
1770
|
-
return nn(e) && typeof e.then == "function";
|
|
1771
|
-
}, an = function(e) {
|
|
1772
|
-
return nn(e) && typeof e.elements == "function" && typeof e.createToken == "function" && typeof e.createPaymentMethod == "function" && typeof e.confirmCardPayment == "function";
|
|
1773
|
-
}, on = "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.", sn = function(e) {
|
|
1774
|
-
var t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : on;
|
|
1775
|
-
if (e === null || an(e)) return e;
|
|
1776
|
-
throw Error(t);
|
|
1777
|
-
}, cn = function(e) {
|
|
1778
|
-
var t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : on;
|
|
1779
|
-
if (rn(e)) return {
|
|
1780
|
-
tag: "async",
|
|
1781
|
-
stripePromise: Promise.resolve(e).then(function(e) {
|
|
1782
|
-
return sn(e, t);
|
|
1783
|
-
})
|
|
1784
|
-
};
|
|
1785
|
-
var n = sn(e, t);
|
|
1786
|
-
return n === null ? { tag: "empty" } : {
|
|
1787
|
-
tag: "sync",
|
|
1788
|
-
stripe: n
|
|
1789
|
-
};
|
|
1790
|
-
}, ln = function(t) {
|
|
1791
|
-
var n = e.useRef(t);
|
|
1792
|
-
return e.useEffect(function() {
|
|
1793
|
-
n.current = t;
|
|
1794
|
-
}, [t]), n.current;
|
|
1795
|
-
}, un = "[object Object]", dn = function e(t, n) {
|
|
1796
|
-
if (!nn(t) || !nn(n)) return t === n;
|
|
1797
|
-
var r = Array.isArray(t);
|
|
1798
|
-
if (r !== Array.isArray(n)) return !1;
|
|
1799
|
-
var i = Object.prototype.toString.call(t) === un;
|
|
1800
|
-
if (i !== (Object.prototype.toString.call(n) === un)) return !1;
|
|
1801
|
-
if (!i && !r) return t === n;
|
|
1802
|
-
var a = Object.keys(t), o = Object.keys(n);
|
|
1803
|
-
if (a.length !== o.length) return !1;
|
|
1804
|
-
for (var s = {}, c = 0; c < a.length; c += 1) s[a[c]] = !0;
|
|
1805
|
-
for (var l = 0; l < o.length; l += 1) s[o[l]] = !0;
|
|
1806
|
-
var u = Object.keys(s);
|
|
1807
|
-
if (u.length !== a.length) return !1;
|
|
1808
|
-
var d = t, f = n;
|
|
1809
|
-
return u.every(function(t) {
|
|
1810
|
-
return e(d[t], f[t]);
|
|
1811
|
-
});
|
|
1812
|
-
}, fn = function(e) {
|
|
1813
|
-
!e || !e._registerWrapper || !e.registerAppInfo || (e._registerWrapper({
|
|
1814
|
-
name: "react-stripe-js",
|
|
1815
|
-
version: "6.4.0"
|
|
1816
|
-
}), e.registerAppInfo({
|
|
1817
|
-
name: "react-stripe-js",
|
|
1818
|
-
version: "6.4.0",
|
|
1819
|
-
url: "https://stripe.com/docs/stripe-js/react"
|
|
1820
|
-
}));
|
|
1821
|
-
}, pn = function(e, t, n) {
|
|
1822
|
-
return nn(e) ? Object.keys(e).reduce(function(r, i) {
|
|
1823
|
-
var a = !nn(t) || !dn(e[i], t[i]);
|
|
1824
|
-
return n.includes(i) ? (a && console.warn(`Unsupported prop change: options.${i} is not a mutable property.`), r) : a ? Gt(Gt({}, r || {}), {}, qt({}, i, e[i])) : r;
|
|
1825
|
-
}, null) : null;
|
|
1826
|
-
}, mn = /* @__PURE__ */ e.createContext(null);
|
|
1827
|
-
mn.displayName = "ElementsContext";
|
|
1828
|
-
var hn = function(e, t) {
|
|
1829
|
-
if (!e) throw Error(`Could not find Elements context; You need to wrap the part of your app that ${t} in an <Elements> provider.`);
|
|
1830
|
-
return e;
|
|
1831
|
-
};
|
|
1832
|
-
X.default.any, X.default.object, X.default.func.isRequired;
|
|
1833
|
-
var gn = ["on", "loadActions"], _n = ["getSession"], vn = /* @__PURE__ */ e.createContext(null);
|
|
1834
|
-
vn.displayName = "CheckoutContext";
|
|
1835
|
-
var yn = function(e, t) {
|
|
1836
|
-
if (!e) throw Error(`Could not find checkout context; You need to wrap the part of your app that ${t} in a <CheckoutElementsProvider> or <CheckoutFormProvider> provider.`);
|
|
1837
|
-
return e;
|
|
1838
|
-
}, bn = function(t) {
|
|
1839
|
-
var n = e.useContext(vn), r = e.useContext(mn);
|
|
1840
|
-
if (n) {
|
|
1841
|
-
if (r) throw Error(`You cannot wrap the part of your app that ${t} in both a checkout provider and <Elements> provider.`);
|
|
1842
|
-
return n;
|
|
1843
|
-
} else return hn(r, t);
|
|
1844
|
-
}, xn = function(e) {
|
|
1845
|
-
if (e.type === "success") {
|
|
1846
|
-
var t = e.sdk, n = e.session, r = e.checkoutActions;
|
|
1847
|
-
t.on, t.loadActions;
|
|
1848
|
-
var i = Yt(t, gn);
|
|
1849
|
-
r.getSession;
|
|
1850
|
-
var a = Yt(r, _n);
|
|
1851
|
-
return {
|
|
1852
|
-
type: "success",
|
|
1853
|
-
checkout: Gt(Gt(Gt({}, n), i), a)
|
|
1854
|
-
};
|
|
1855
|
-
} else if (e.type === "loading") return { type: "loading" };
|
|
1856
|
-
else return {
|
|
1857
|
-
type: "error",
|
|
1858
|
-
error: e.error
|
|
1859
|
-
};
|
|
1860
|
-
}, Sn = function() {
|
|
1861
|
-
var t = yn(e.useContext(vn), "calls useCheckoutElements()").checkoutState;
|
|
1862
|
-
if (t.type === "success" && t.sdkKind !== "elements") throw Error("useCheckoutElements() must be used inside <CheckoutElementsProvider>. Inside <CheckoutFormProvider>, use useCheckoutForm() instead.");
|
|
1863
|
-
return xn(t);
|
|
1864
|
-
}, Cn = "Invalid prop `stripe` supplied to `CheckoutElementsProvider`. We recommend using the `loadStripe` utility from `@stripe/stripe-js`. See https://stripe.com/docs/stripe-js/react#elements-props-stripe for details.", wn = function(e) {
|
|
1865
|
-
return e.type === "success" || e.type === "loading" ? e.sdk : null;
|
|
1866
|
-
}, Tn = function(t) {
|
|
1867
|
-
var n = t.stripe, r = t.options, i = t.children, a = e.useMemo(function() {
|
|
1868
|
-
return cn(n, Cn);
|
|
1869
|
-
}, [n]), o = Xt(e.useState({
|
|
1870
|
-
type: "loading",
|
|
1871
|
-
sdk: null
|
|
1872
|
-
}), 2), s = o[0], c = o[1], l = Xt(e.useState(null), 2), u = l[0], d = l[1], f = e.useRef(!1);
|
|
1873
|
-
e.useEffect(function() {
|
|
1874
|
-
var e = !0, t = function(t) {
|
|
1875
|
-
var n = t.stripe;
|
|
1876
|
-
if (n && e && !f.current) {
|
|
1877
|
-
f.current = !0;
|
|
1878
|
-
var i = n.initCheckoutElementsSdk(r);
|
|
1879
|
-
c({
|
|
1880
|
-
type: "loading",
|
|
1881
|
-
sdk: i
|
|
1882
|
-
}), i.loadActions().then(function(e) {
|
|
1883
|
-
if (e.type === "success") {
|
|
1884
|
-
var t = e.actions;
|
|
1885
|
-
c({
|
|
1886
|
-
type: "success",
|
|
1887
|
-
sdkKind: "elements",
|
|
1888
|
-
sdk: i,
|
|
1889
|
-
checkoutActions: t,
|
|
1890
|
-
session: t.getSession()
|
|
1891
|
-
}), i.on("change", function(e) {
|
|
1892
|
-
c(function(t) {
|
|
1893
|
-
return t.type === "success" && t.sdkKind === "elements" ? {
|
|
1894
|
-
type: "success",
|
|
1895
|
-
sdkKind: "elements",
|
|
1896
|
-
sdk: t.sdk,
|
|
1897
|
-
checkoutActions: t.checkoutActions,
|
|
1898
|
-
session: e
|
|
1899
|
-
} : t;
|
|
1900
|
-
});
|
|
1901
|
-
});
|
|
1902
|
-
} else c({
|
|
1903
|
-
type: "error",
|
|
1904
|
-
error: e.error
|
|
1905
|
-
});
|
|
1906
|
-
}).catch(function(e) {
|
|
1907
|
-
c({
|
|
1908
|
-
type: "error",
|
|
1909
|
-
error: e
|
|
1910
|
-
});
|
|
1911
|
-
});
|
|
1861
|
+
function k(e) {
|
|
1862
|
+
function t(t, n, o, s, c) {
|
|
1863
|
+
var l = t[n], u = M(l);
|
|
1864
|
+
if (u !== "object") return new h("Invalid " + s + " `" + c + "` of type `" + u + "` " + ("supplied to `" + o + "`, expected `object`."));
|
|
1865
|
+
for (var d in r({}, t[n], e)) {
|
|
1866
|
+
var f = e[d];
|
|
1867
|
+
if (a(e, d) && typeof f != "function") return D(o, s, c, d, N(f));
|
|
1868
|
+
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, " "));
|
|
1869
|
+
var p = f(l, d, o, s, c + "." + d, i);
|
|
1870
|
+
if (p) return p;
|
|
1871
|
+
}
|
|
1872
|
+
return null;
|
|
1912
1873
|
}
|
|
1913
|
-
|
|
1914
|
-
return a.tag === "async" ? a.stripePromise.then(function(e) {
|
|
1915
|
-
d(e), e && t({ stripe: e });
|
|
1916
|
-
}) : a.tag === "sync" && (d(a.stripe), t({ stripe: a.stripe })), function() {
|
|
1917
|
-
e = !1;
|
|
1918
|
-
};
|
|
1919
|
-
}, [
|
|
1920
|
-
a,
|
|
1921
|
-
r,
|
|
1922
|
-
c
|
|
1923
|
-
]);
|
|
1924
|
-
var p = ln(n);
|
|
1925
|
-
e.useEffect(function() {
|
|
1926
|
-
p !== null && p !== n && console.warn("Unsupported prop change on CheckoutElementsProvider: You cannot change the `stripe` prop after setting it.");
|
|
1927
|
-
}, [p, n]);
|
|
1928
|
-
var m = wn(s), h = ln(r);
|
|
1929
|
-
e.useEffect(function() {
|
|
1930
|
-
if (m) {
|
|
1931
|
-
var e = h?.elementsOptions?.appearance, t = r?.elementsOptions?.appearance, n = !dn(t, e);
|
|
1932
|
-
t && n && m.changeAppearance(t);
|
|
1933
|
-
var i = h?.elementsOptions?.fonts, a = r?.elementsOptions?.fonts, o = !dn(i, a);
|
|
1934
|
-
a && o && m.loadFonts(a);
|
|
1874
|
+
return g(t);
|
|
1935
1875
|
}
|
|
1936
|
-
|
|
1937
|
-
|
|
1938
|
-
|
|
1939
|
-
|
|
1940
|
-
|
|
1941
|
-
|
|
1942
|
-
|
|
1943
|
-
|
|
1944
|
-
|
|
1945
|
-
|
|
1946
|
-
|
|
1947
|
-
|
|
1948
|
-
|
|
1949
|
-
|
|
1950
|
-
};
|
|
1951
|
-
|
|
1952
|
-
|
|
1953
|
-
|
|
1954
|
-
|
|
1955
|
-
|
|
1956
|
-
|
|
1957
|
-
};
|
|
1958
|
-
var En = "Invalid prop `stripe` supplied to `CheckoutFormProvider`. We recommend using the `loadStripe` utility from `@stripe/stripe-js`. See https://stripe.com/docs/stripe-js/react#elements-props-stripe for details.", Dn = function(t) {
|
|
1959
|
-
var n = t.stripe, r = t.options, i = t.children, a = e.useMemo(function() {
|
|
1960
|
-
return cn(n, En);
|
|
1961
|
-
}, [n]), o = Xt(e.useState({
|
|
1962
|
-
type: "loading",
|
|
1963
|
-
sdk: null
|
|
1964
|
-
}), 2), s = o[0], c = o[1], l = Xt(e.useState(null), 2), u = l[0], d = l[1], f = e.useRef(!1);
|
|
1965
|
-
e.useEffect(function() {
|
|
1966
|
-
var e = !0, t = function(t) {
|
|
1967
|
-
var n = t.stripe;
|
|
1968
|
-
if (n && e && !f.current) {
|
|
1969
|
-
f.current = !0;
|
|
1970
|
-
var i = n.initCheckoutFormSdk(r);
|
|
1971
|
-
c({
|
|
1972
|
-
type: "loading",
|
|
1973
|
-
sdk: i
|
|
1974
|
-
}), i.loadActions().then(function(e) {
|
|
1975
|
-
if (e.type === "success") {
|
|
1976
|
-
var t = e.actions;
|
|
1977
|
-
c({
|
|
1978
|
-
type: "success",
|
|
1979
|
-
sdkKind: "form",
|
|
1980
|
-
sdk: i,
|
|
1981
|
-
checkoutActions: t,
|
|
1982
|
-
session: t.getSession()
|
|
1983
|
-
}), i.on("change", function(e) {
|
|
1984
|
-
c(function(t) {
|
|
1985
|
-
return t.type === "success" && t.sdkKind === "form" ? {
|
|
1986
|
-
type: "success",
|
|
1987
|
-
sdkKind: "form",
|
|
1988
|
-
sdk: t.sdk,
|
|
1989
|
-
checkoutActions: t.checkoutActions,
|
|
1990
|
-
session: e
|
|
1991
|
-
} : t;
|
|
1992
|
-
});
|
|
1993
|
-
});
|
|
1994
|
-
} else c({
|
|
1995
|
-
type: "error",
|
|
1996
|
-
error: e.error
|
|
1997
|
-
});
|
|
1998
|
-
}).catch(function(e) {
|
|
1999
|
-
c({
|
|
2000
|
-
type: "error",
|
|
2001
|
-
error: e
|
|
2002
|
-
});
|
|
2003
|
-
});
|
|
1876
|
+
function A(t) {
|
|
1877
|
+
switch (typeof t) {
|
|
1878
|
+
case "number":
|
|
1879
|
+
case "string":
|
|
1880
|
+
case "undefined": return !0;
|
|
1881
|
+
case "boolean": return !t;
|
|
1882
|
+
case "object":
|
|
1883
|
+
if (Array.isArray(t)) return t.every(A);
|
|
1884
|
+
if (t === null || e(t)) return !0;
|
|
1885
|
+
var n = d(t);
|
|
1886
|
+
if (n) {
|
|
1887
|
+
var r = n.call(t), i;
|
|
1888
|
+
if (n !== t.entries) {
|
|
1889
|
+
for (; !(i = r.next()).done;) if (!A(i.value)) return !1;
|
|
1890
|
+
} else for (; !(i = r.next()).done;) {
|
|
1891
|
+
var a = i.value;
|
|
1892
|
+
if (a && !A(a[1])) return !1;
|
|
1893
|
+
}
|
|
1894
|
+
} else return !1;
|
|
1895
|
+
return !0;
|
|
1896
|
+
default: return !1;
|
|
2004
1897
|
}
|
|
2005
|
-
};
|
|
2006
|
-
return a.tag === "async" ? a.stripePromise.then(function(e) {
|
|
2007
|
-
d(e), e && t({ stripe: e });
|
|
2008
|
-
}) : a.tag === "sync" && (d(a.stripe), t({ stripe: a.stripe })), function() {
|
|
2009
|
-
e = !1;
|
|
2010
|
-
};
|
|
2011
|
-
}, [
|
|
2012
|
-
a,
|
|
2013
|
-
r,
|
|
2014
|
-
c
|
|
2015
|
-
]);
|
|
2016
|
-
var p = ln(n);
|
|
2017
|
-
e.useEffect(function() {
|
|
2018
|
-
p !== null && p !== n && console.warn("Unsupported prop change on CheckoutFormProvider: You cannot change the `stripe` prop after setting it.");
|
|
2019
|
-
}, [p, n]);
|
|
2020
|
-
var m = s.type === "success" || s.type === "loading" ? s.sdk : null, h = ln(r);
|
|
2021
|
-
e.useEffect(function() {
|
|
2022
|
-
if (m) {
|
|
2023
|
-
var e = h?.appearance, t = r?.appearance, n = !dn(t, e);
|
|
2024
|
-
t && n && m.changeAppearance(t);
|
|
2025
|
-
var i = h?.fonts, a = r?.fonts, o = !dn(i, a);
|
|
2026
|
-
a && o && m.loadFonts(a);
|
|
2027
1898
|
}
|
|
2028
|
-
|
|
2029
|
-
|
|
2030
|
-
|
|
2031
|
-
|
|
2032
|
-
|
|
2033
|
-
|
|
2034
|
-
|
|
2035
|
-
|
|
2036
|
-
|
|
2037
|
-
|
|
2038
|
-
|
|
2039
|
-
|
|
2040
|
-
|
|
2041
|
-
return /* @__PURE__ */ e.createElement(vn.Provider, { value: g }, i);
|
|
2042
|
-
};
|
|
2043
|
-
Dn.propTypes = {
|
|
2044
|
-
stripe: X.default.any,
|
|
2045
|
-
options: X.default.shape({
|
|
2046
|
-
clientSecret: X.default.oneOfType([X.default.string, X.default.instanceOf(Promise)]).isRequired,
|
|
2047
|
-
appearance: X.default.object,
|
|
2048
|
-
loader: X.default.string,
|
|
2049
|
-
fonts: X.default.array,
|
|
2050
|
-
savedPaymentMethod: X.default.object,
|
|
2051
|
-
defaultValues: X.default.object
|
|
2052
|
-
}).isRequired
|
|
2053
|
-
};
|
|
2054
|
-
var Z = function(t, n, r) {
|
|
2055
|
-
var i = !!r, a = e.useRef(r);
|
|
2056
|
-
e.useEffect(function() {
|
|
2057
|
-
a.current = r;
|
|
2058
|
-
}, [r]), e.useEffect(function() {
|
|
2059
|
-
if (!i || !t) return function() {};
|
|
2060
|
-
var e = function() {
|
|
2061
|
-
a.current && a.current.apply(a, arguments);
|
|
2062
|
-
};
|
|
2063
|
-
return t.on(n, e), function() {
|
|
2064
|
-
t.off(n, e);
|
|
2065
|
-
};
|
|
2066
|
-
}, [
|
|
2067
|
-
i,
|
|
2068
|
-
n,
|
|
2069
|
-
t,
|
|
2070
|
-
a
|
|
2071
|
-
]);
|
|
2072
|
-
}, On = ["mode"], kn = function(e) {
|
|
2073
|
-
return e.charAt(0).toUpperCase() + e.slice(1);
|
|
2074
|
-
}, Q = function(t, n, r) {
|
|
2075
|
-
var i = r || `${kn(t)}Element`, a = n ? function(t) {
|
|
2076
|
-
bn(`mounts <${i}>`);
|
|
2077
|
-
var n = t.id, r = t.className;
|
|
2078
|
-
return /* @__PURE__ */ e.createElement("div", {
|
|
2079
|
-
id: n,
|
|
2080
|
-
className: r
|
|
2081
|
-
});
|
|
2082
|
-
} : function(n) {
|
|
2083
|
-
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 = bn(`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 = Xt(e.useState(null), 2), k = O[0], A = O[1], j = e.useRef(null), M = e.useRef(null);
|
|
2084
|
-
Z(k, "blur", c), Z(k, "focus", l), Z(k, "escape", f), Z(k, "click", p), Z(k, "loaderror", m), Z(k, "loaderstart", h), Z(k, "networkschange", g), Z(k, "confirm", _), Z(k, "cancel", v), Z(k, "shippingaddresschange", y), Z(k, "shippingratechange", b), Z(k, "savedpaymentmethodremove", x), Z(k, "savedpaymentmethodupdate", S), Z(k, "availablepaymentmethodschange", C), Z(k, "change", d);
|
|
2085
|
-
var N;
|
|
2086
|
-
u && (N = t === "expressCheckout" ? u : function() {
|
|
2087
|
-
u(k);
|
|
2088
|
-
}), Z(k, "ready", N), e.useLayoutEffect(function() {
|
|
2089
|
-
if (j.current === null && M.current !== null && (T || D)) {
|
|
2090
|
-
var e = null;
|
|
2091
|
-
if (D) {
|
|
2092
|
-
var n = D, r = D;
|
|
2093
|
-
switch (t) {
|
|
2094
|
-
case "paymentForm":
|
|
2095
|
-
e = r.createForm(s);
|
|
2096
|
-
break;
|
|
2097
|
-
case "payment":
|
|
2098
|
-
e = n.createPaymentElement(s);
|
|
2099
|
-
break;
|
|
2100
|
-
case "address":
|
|
2101
|
-
if ("mode" in s) {
|
|
2102
|
-
var a = s.mode, o = Yt(s, On);
|
|
2103
|
-
if (a === "shipping") e = n.createShippingAddressElement(o);
|
|
2104
|
-
else if (a === "billing") e = n.createBillingAddressElement(o);
|
|
2105
|
-
else throw Error("Invalid options.mode. mode must be 'billing' or 'shipping'.");
|
|
2106
|
-
} else throw Error("You must supply options.mode. mode must be 'billing' or 'shipping'.");
|
|
2107
|
-
break;
|
|
2108
|
-
case "expressCheckout":
|
|
2109
|
-
e = n.createExpressCheckoutElement(s);
|
|
2110
|
-
break;
|
|
2111
|
-
case "currencySelector":
|
|
2112
|
-
e = D.createCurrencySelectorElement();
|
|
2113
|
-
break;
|
|
2114
|
-
case "taxId":
|
|
2115
|
-
e = n.createTaxIdElement(s);
|
|
2116
|
-
break;
|
|
2117
|
-
case "contactDetails":
|
|
2118
|
-
e = n.createContactDetailsElement();
|
|
2119
|
-
break;
|
|
2120
|
-
default: throw Error(`<${i}> is not supported inside a checkout provider. Use an <Elements> provider instead.`);
|
|
2121
|
-
}
|
|
2122
|
-
} else T && (e = T.create(t, s));
|
|
2123
|
-
j.current = e, A(e), e && e.mount(M.current);
|
|
1899
|
+
function j(e, t) {
|
|
1900
|
+
return e === "symbol" ? !0 : t ? t["@@toStringTag"] === "Symbol" || typeof Symbol == "function" && t instanceof Symbol : !1;
|
|
1901
|
+
}
|
|
1902
|
+
function M(e) {
|
|
1903
|
+
var t = typeof e;
|
|
1904
|
+
return Array.isArray(e) ? "array" : e instanceof RegExp ? "object" : j(t, e) ? "symbol" : t;
|
|
1905
|
+
}
|
|
1906
|
+
function N(e) {
|
|
1907
|
+
if (e == null) return "" + e;
|
|
1908
|
+
var t = M(e);
|
|
1909
|
+
if (t === "object") {
|
|
1910
|
+
if (e instanceof Date) return "date";
|
|
1911
|
+
if (e instanceof RegExp) return "regexp";
|
|
2124
1912
|
}
|
|
2125
|
-
|
|
2126
|
-
|
|
2127
|
-
|
|
2128
|
-
|
|
2129
|
-
|
|
2130
|
-
|
|
2131
|
-
|
|
2132
|
-
|
|
2133
|
-
|
|
2134
|
-
|
|
1913
|
+
return t;
|
|
1914
|
+
}
|
|
1915
|
+
function P(e) {
|
|
1916
|
+
var t = N(e);
|
|
1917
|
+
switch (t) {
|
|
1918
|
+
case "array":
|
|
1919
|
+
case "object": return "an " + t;
|
|
1920
|
+
case "boolean":
|
|
1921
|
+
case "date":
|
|
1922
|
+
case "regexp": return "a " + t;
|
|
1923
|
+
default: return t;
|
|
2135
1924
|
}
|
|
2136
|
-
}
|
|
2137
|
-
|
|
2138
|
-
|
|
2139
|
-
|
|
2140
|
-
|
|
2141
|
-
|
|
2142
|
-
|
|
2143
|
-
|
|
2144
|
-
|
|
2145
|
-
|
|
2146
|
-
|
|
1925
|
+
}
|
|
1926
|
+
function F(e) {
|
|
1927
|
+
return !e.constructor || !e.constructor.name ? f : e.constructor.name;
|
|
1928
|
+
}
|
|
1929
|
+
return p.checkPropTypes = o, p.resetWarningCache = o.resetWarningCache, p.PropTypes = p, p;
|
|
1930
|
+
};
|
|
1931
|
+
})), Gt = /* @__PURE__ */ H(((e, t) => {
|
|
1932
|
+
var n = Vt();
|
|
1933
|
+
function r() {}
|
|
1934
|
+
function i() {}
|
|
1935
|
+
i.resetWarningCache = r, t.exports = function() {
|
|
1936
|
+
function e(e, t, r, i, a, o) {
|
|
1937
|
+
if (o !== n) {
|
|
1938
|
+
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");
|
|
1939
|
+
throw s.name = "Invariant Violation", s;
|
|
1940
|
+
}
|
|
1941
|
+
}
|
|
1942
|
+
e.isRequired = e;
|
|
1943
|
+
function t() {
|
|
1944
|
+
return e;
|
|
1945
|
+
}
|
|
1946
|
+
var a = {
|
|
1947
|
+
array: e,
|
|
1948
|
+
bigint: e,
|
|
1949
|
+
bool: e,
|
|
1950
|
+
func: e,
|
|
1951
|
+
number: e,
|
|
1952
|
+
object: e,
|
|
1953
|
+
string: e,
|
|
1954
|
+
symbol: e,
|
|
1955
|
+
any: e,
|
|
1956
|
+
arrayOf: t,
|
|
1957
|
+
element: e,
|
|
1958
|
+
elementType: e,
|
|
1959
|
+
instanceOf: t,
|
|
1960
|
+
node: e,
|
|
1961
|
+
objectOf: t,
|
|
1962
|
+
oneOf: t,
|
|
1963
|
+
oneOfType: t,
|
|
1964
|
+
shape: t,
|
|
1965
|
+
exact: t,
|
|
1966
|
+
checkPropTypes: i,
|
|
1967
|
+
resetWarningCache: r
|
|
1968
|
+
};
|
|
1969
|
+
return a.PropTypes = a, a;
|
|
2147
1970
|
};
|
|
2148
|
-
|
|
2149
|
-
|
|
2150
|
-
|
|
2151
|
-
|
|
2152
|
-
|
|
2153
|
-
|
|
2154
|
-
|
|
2155
|
-
|
|
2156
|
-
|
|
2157
|
-
|
|
2158
|
-
|
|
2159
|
-
|
|
2160
|
-
|
|
2161
|
-
|
|
2162
|
-
|
|
2163
|
-
|
|
2164
|
-
|
|
2165
|
-
|
|
2166
|
-
|
|
2167
|
-
|
|
2168
|
-
|
|
2169
|
-
}
|
|
2170
|
-
|
|
2171
|
-
|
|
2172
|
-
|
|
2173
|
-
|
|
2174
|
-
|
|
2175
|
-
|
|
2176
|
-
//#region node_modules/@stripe/stripe-js/dist/index.mjs
|
|
2177
|
-
function Mn(e) {
|
|
1971
|
+
})), Y = /* @__PURE__ */ U((/* @__PURE__ */ H(((e, t) => {
|
|
1972
|
+
if (process.env.NODE_ENV !== "production") {
|
|
1973
|
+
var n = zt();
|
|
1974
|
+
t.exports = Wt()(n.isElement, !0);
|
|
1975
|
+
} else t.exports = Gt()();
|
|
1976
|
+
})))(), 1);
|
|
1977
|
+
function Kt(e, t) {
|
|
1978
|
+
var n = Object.keys(e);
|
|
1979
|
+
if (Object.getOwnPropertySymbols) {
|
|
1980
|
+
var r = Object.getOwnPropertySymbols(e);
|
|
1981
|
+
t && (r = r.filter(function(t) {
|
|
1982
|
+
return Object.getOwnPropertyDescriptor(e, t).enumerable;
|
|
1983
|
+
})), n.push.apply(n, r);
|
|
1984
|
+
}
|
|
1985
|
+
return n;
|
|
1986
|
+
}
|
|
1987
|
+
function qt(e) {
|
|
1988
|
+
for (var t = 1; t < arguments.length; t++) {
|
|
1989
|
+
var n = arguments[t] == null ? {} : arguments[t];
|
|
1990
|
+
t % 2 ? Kt(Object(n), !0).forEach(function(t) {
|
|
1991
|
+
Yt(e, t, n[t]);
|
|
1992
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n)) : Kt(Object(n)).forEach(function(t) {
|
|
1993
|
+
Object.defineProperty(e, t, Object.getOwnPropertyDescriptor(n, t));
|
|
1994
|
+
});
|
|
1995
|
+
}
|
|
1996
|
+
return e;
|
|
1997
|
+
}
|
|
1998
|
+
function Jt(e) {
|
|
2178
1999
|
"@babel/helpers - typeof";
|
|
2179
|
-
return
|
|
2000
|
+
return Jt = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(e) {
|
|
2180
2001
|
return typeof e;
|
|
2181
2002
|
} : function(e) {
|
|
2182
2003
|
return e && typeof Symbol == "function" && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
|
|
2183
|
-
},
|
|
2184
|
-
}
|
|
2185
|
-
var Nn = "dahlia", Pn = function(e) {
|
|
2186
|
-
return e === 3 ? "v3" : e;
|
|
2187
|
-
}, Fn = "https://js.stripe.com", In = `${Fn}/${Nn}/stripe.js`, Ln = /^https:\/\/js\.stripe\.com\/v3\/?(\?.*)?$/, Rn = /^https:\/\/js\.stripe\.com\/(v3|[a-z]+)\/stripe\.js(\?.*)?$/, zn = "loadStripe.setLoadParameters was called but an existing Stripe.js script already exists in the document; existing script parameters will be used", Bn = function(e) {
|
|
2188
|
-
return Ln.test(e) || Rn.test(e);
|
|
2189
|
-
}, Vn = function() {
|
|
2190
|
-
for (var e = document.querySelectorAll(`script[src^="${Fn}"]`), t = 0; t < e.length; t++) {
|
|
2191
|
-
var n = e[t];
|
|
2192
|
-
if (Bn(n.src)) return n;
|
|
2193
|
-
}
|
|
2194
|
-
return null;
|
|
2195
|
-
}, Hn = function(e) {
|
|
2196
|
-
var t = e && !e.advancedFraudSignals ? "?advancedFraudSignals=false" : "", n = document.createElement("script");
|
|
2197
|
-
n.src = `${In}${t}`;
|
|
2198
|
-
var r = document.head || document.body;
|
|
2199
|
-
if (!r) throw Error("Expected document.body not to be null. Stripe.js requires a <body> element.");
|
|
2200
|
-
return r.appendChild(n), n;
|
|
2201
|
-
}, Un = function(e, t) {
|
|
2202
|
-
!e || !e._registerWrapper || e._registerWrapper({
|
|
2203
|
-
name: "stripe-js",
|
|
2204
|
-
version: "9.6.0",
|
|
2205
|
-
startTime: t
|
|
2206
|
-
});
|
|
2207
|
-
}, Wn = null, Gn = null, Kn = null, qn = function(e) {
|
|
2208
|
-
return function(t) {
|
|
2209
|
-
e(Error("Failed to load Stripe.js", { cause: t }));
|
|
2210
|
-
};
|
|
2211
|
-
}, Jn = function(e, t) {
|
|
2212
|
-
return function() {
|
|
2213
|
-
window.Stripe ? e(window.Stripe) : t(/* @__PURE__ */ Error("Stripe.js not available"));
|
|
2214
|
-
};
|
|
2215
|
-
}, Yn = function(e) {
|
|
2216
|
-
return Wn === null ? (Wn = new Promise(function(t, n) {
|
|
2217
|
-
if (typeof window > "u" || typeof document > "u") {
|
|
2218
|
-
t(null);
|
|
2219
|
-
return;
|
|
2220
|
-
}
|
|
2221
|
-
if (window.Stripe && e && console.warn(zn), window.Stripe) {
|
|
2222
|
-
t(window.Stripe);
|
|
2223
|
-
return;
|
|
2224
|
-
}
|
|
2225
|
-
try {
|
|
2226
|
-
var r = Vn();
|
|
2227
|
-
if (r && e) console.warn(zn);
|
|
2228
|
-
else if (!r) r = Hn(e);
|
|
2229
|
-
else if (r && Kn !== null && Gn !== null) {
|
|
2230
|
-
var i;
|
|
2231
|
-
r.removeEventListener("load", Kn), r.removeEventListener("error", Gn), (i = r.parentNode) == null || i.removeChild(r), r = Hn(e);
|
|
2232
|
-
}
|
|
2233
|
-
Kn = Jn(t, n), Gn = qn(n), r.addEventListener("load", Kn), r.addEventListener("error", Gn);
|
|
2234
|
-
} catch (e) {
|
|
2235
|
-
n(e);
|
|
2236
|
-
return;
|
|
2237
|
-
}
|
|
2238
|
-
}), Wn.catch(function(e) {
|
|
2239
|
-
return Wn = null, Promise.reject(e);
|
|
2240
|
-
})) : Wn;
|
|
2241
|
-
}, Xn = function(e, t, n) {
|
|
2242
|
-
if (e === null) return null;
|
|
2243
|
-
var r = t[0];
|
|
2244
|
-
if (typeof r != "string") throw Error(`Expected publishable key to be of type string, got type ${Mn(r)} instead.`);
|
|
2245
|
-
var i = r.match(/^pk_test/), a = Pn(e.version), o = Nn;
|
|
2246
|
-
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`);
|
|
2247
|
-
var s = e.apply(void 0, t);
|
|
2248
|
-
return Un(s, n), s;
|
|
2249
|
-
}, Zn, Qn = !1, $n = function() {
|
|
2250
|
-
return Zn || (Zn = Yn(null).catch(function(e) {
|
|
2251
|
-
return Zn = null, Promise.reject(e);
|
|
2252
|
-
}), Zn);
|
|
2253
|
-
};
|
|
2254
|
-
Promise.resolve().then(function() {
|
|
2255
|
-
return $n();
|
|
2256
|
-
}).catch(function(e) {
|
|
2257
|
-
Qn || console.warn(e);
|
|
2258
|
-
});
|
|
2259
|
-
var er = function() {
|
|
2260
|
-
var e = [...arguments];
|
|
2261
|
-
Qn = !0;
|
|
2262
|
-
var t = Date.now();
|
|
2263
|
-
return $n().then(function(n) {
|
|
2264
|
-
return Xn(n, e, t);
|
|
2265
|
-
});
|
|
2266
|
-
}, tr = "-";
|
|
2267
|
-
function nr(e) {
|
|
2268
|
-
return e === void 0 ? tr : `$${new Intl.NumberFormat("en-US").format(Number(e || 0))}`;
|
|
2004
|
+
}, Jt(e);
|
|
2269
2005
|
}
|
|
2270
|
-
function
|
|
2271
|
-
return
|
|
2272
|
-
|
|
2273
|
-
|
|
2274
|
-
|
|
2006
|
+
function Yt(e, t, n) {
|
|
2007
|
+
return t in e ? Object.defineProperty(e, t, {
|
|
2008
|
+
value: n,
|
|
2009
|
+
enumerable: !0,
|
|
2010
|
+
configurable: !0,
|
|
2011
|
+
writable: !0
|
|
2012
|
+
}) : e[t] = n, e;
|
|
2275
2013
|
}
|
|
2276
|
-
function
|
|
2277
|
-
|
|
2278
|
-
|
|
2279
|
-
|
|
2280
|
-
|
|
2281
|
-
});
|
|
2282
|
-
if (n.type === "error") return /* @__PURE__ */ B(o, {
|
|
2283
|
-
type: "error",
|
|
2284
|
-
content: n.error.message
|
|
2285
|
-
});
|
|
2286
|
-
let { checkout: u } = n, d = u.total.total.amount;
|
|
2287
|
-
return /* @__PURE__ */ V("form", {
|
|
2288
|
-
className: "flex flex-col gap-6",
|
|
2289
|
-
onSubmit: async (n) => {
|
|
2290
|
-
if (n.preventDefault(), !(!u.canConfirm || s)) {
|
|
2291
|
-
l(!0), i("");
|
|
2292
|
-
try {
|
|
2293
|
-
let e = await u.confirm({ redirect: "if_required" });
|
|
2294
|
-
if (e.type === "error") {
|
|
2295
|
-
i(e.error.message);
|
|
2296
|
-
return;
|
|
2297
|
-
}
|
|
2298
|
-
t();
|
|
2299
|
-
} catch (t) {
|
|
2300
|
-
i(t instanceof Error ? t.message : e.stripePaymentFailed);
|
|
2301
|
-
} finally {
|
|
2302
|
-
l(!1);
|
|
2303
|
-
}
|
|
2304
|
-
}
|
|
2305
|
-
},
|
|
2306
|
-
children: [
|
|
2307
|
-
/* @__PURE__ */ V("div", {
|
|
2308
|
-
className: "flex flex-col gap-3",
|
|
2309
|
-
children: [/* @__PURE__ */ B(D.Title, {
|
|
2310
|
-
heading: 6,
|
|
2311
|
-
className: "text-arco-text-1! mb-0!",
|
|
2312
|
-
children: e.stripeContactDetails
|
|
2313
|
-
}), /* @__PURE__ */ B(jn, {})]
|
|
2314
|
-
}),
|
|
2315
|
-
/* @__PURE__ */ V("div", {
|
|
2316
|
-
className: "flex flex-col gap-3",
|
|
2317
|
-
children: [/* @__PURE__ */ B(D.Title, {
|
|
2318
|
-
heading: 6,
|
|
2319
|
-
className: "text-arco-text-1! mb-0!",
|
|
2320
|
-
children: e.stripePaymentSection
|
|
2321
|
-
}), /* @__PURE__ */ B(An, { id: "mantur-stripe-payment-element" })]
|
|
2322
|
-
}),
|
|
2323
|
-
/* @__PURE__ */ V(c, {
|
|
2324
|
-
htmlType: "submit",
|
|
2325
|
-
type: "primary",
|
|
2326
|
-
size: "large",
|
|
2327
|
-
className: "w-full!",
|
|
2328
|
-
disabled: !u.canConfirm || s,
|
|
2329
|
-
loading: s,
|
|
2330
|
-
children: [
|
|
2331
|
-
e.stripePay,
|
|
2332
|
-
" · ",
|
|
2333
|
-
d
|
|
2334
|
-
]
|
|
2335
|
-
}),
|
|
2336
|
-
r ? /* @__PURE__ */ B(o, {
|
|
2337
|
-
type: "error",
|
|
2338
|
-
content: r
|
|
2339
|
-
}) : null
|
|
2340
|
-
]
|
|
2341
|
-
});
|
|
2014
|
+
function Xt(e, t) {
|
|
2015
|
+
if (e == null) return {};
|
|
2016
|
+
var n = {}, r = Object.keys(e), i, a;
|
|
2017
|
+
for (a = 0; a < r.length; a++) i = r[a], !(t.indexOf(i) >= 0) && (n[i] = e[i]);
|
|
2018
|
+
return n;
|
|
2342
2019
|
}
|
|
2343
|
-
function
|
|
2344
|
-
|
|
2345
|
-
|
|
2346
|
-
|
|
2347
|
-
|
|
2348
|
-
|
|
2349
|
-
|
|
2350
|
-
|
|
2351
|
-
label: l.stripePaymentTotalAmount,
|
|
2352
|
-
value: rr(s?.amount)
|
|
2353
|
-
}, {
|
|
2354
|
-
label: l.stripePaymentOrderNo,
|
|
2355
|
-
value: s?.orderNo || tr
|
|
2356
|
-
}], [
|
|
2357
|
-
s?.amount,
|
|
2358
|
-
s?.orderNo,
|
|
2359
|
-
l.stripePaymentOrderNo,
|
|
2360
|
-
l.stripePaymentTotalAmount
|
|
2361
|
-
]), C = t(async () => {
|
|
2362
|
-
if (g.current) return;
|
|
2363
|
-
let e = s?.orderNo;
|
|
2364
|
-
if (!e) {
|
|
2365
|
-
u();
|
|
2366
|
-
return;
|
|
2367
|
-
}
|
|
2368
|
-
g.current = !0, h(!0);
|
|
2369
|
-
try {
|
|
2370
|
-
await Ie(e);
|
|
2371
|
-
} catch (e) {
|
|
2372
|
-
console.warn("Failed to cancel Mantur recharge order.", e);
|
|
2373
|
-
} finally {
|
|
2374
|
-
g.current = !1, h(!1), u();
|
|
2375
|
-
}
|
|
2376
|
-
}, [u, s?.orderNo]), w = !n || !v ? /* @__PURE__ */ B(o, {
|
|
2377
|
-
type: "error",
|
|
2378
|
-
content: l.stripePaymentConfigMissing
|
|
2379
|
-
}) : _ ? _.startsWith("cs_") ? x ? /* @__PURE__ */ B(Tn, {
|
|
2380
|
-
stripe: v,
|
|
2381
|
-
options: x,
|
|
2382
|
-
children: /* @__PURE__ */ B(ir, {
|
|
2383
|
-
text: l,
|
|
2384
|
-
onSuccess: f
|
|
2385
|
-
})
|
|
2386
|
-
}, `${_}-${b}`) : /* @__PURE__ */ B(o, {
|
|
2387
|
-
type: "error",
|
|
2388
|
-
content: l.stripePaymentClientSecretMissing
|
|
2389
|
-
}) : /* @__PURE__ */ B(o, {
|
|
2390
|
-
type: "error",
|
|
2391
|
-
content: l.stripeCheckoutClientSecretInvalid
|
|
2392
|
-
}) : /* @__PURE__ */ B(o, {
|
|
2393
|
-
type: "error",
|
|
2394
|
-
content: l.stripePaymentClientSecretMissing
|
|
2395
|
-
});
|
|
2396
|
-
return /* @__PURE__ */ B(y, {
|
|
2397
|
-
title: l.stripePaymentTitle,
|
|
2398
|
-
visible: e,
|
|
2399
|
-
closeIcon: null,
|
|
2400
|
-
footer: /* @__PURE__ */ B("div", {
|
|
2401
|
-
className: "flex justify-end gap-2 mx-auto max-w-7xl ",
|
|
2402
|
-
children: /* @__PURE__ */ B(c, {
|
|
2403
|
-
size: "large",
|
|
2404
|
-
type: "primary",
|
|
2405
|
-
status: "danger",
|
|
2406
|
-
disabled: m,
|
|
2407
|
-
loading: m,
|
|
2408
|
-
onClick: () => void C(),
|
|
2409
|
-
children: l.close
|
|
2410
|
-
})
|
|
2411
|
-
}),
|
|
2412
|
-
onCancel: () => void C(),
|
|
2413
|
-
alignCenter: !1,
|
|
2414
|
-
wrapStyle: { padding: 0 },
|
|
2415
|
-
style: {
|
|
2416
|
-
width: "100vw",
|
|
2417
|
-
maxWidth: "100vw",
|
|
2418
|
-
height: "100vh",
|
|
2419
|
-
top: 0,
|
|
2420
|
-
margin: 0,
|
|
2421
|
-
padding: 0
|
|
2422
|
-
},
|
|
2423
|
-
className: "top-0! m-0! flex! h-screen! w-screen! max-w-none! flex-col! rounded-none! [&_.arco-modal-body]:min-h-0! [&_.arco-modal-body]:flex-1! [&_.arco-modal-body]:overflow-auto! [&_.arco-modal-content]:flex! [&_.arco-modal-content]:h-full! [&_.arco-modal-content]:flex-col! [&_.arco-modal-content]:rounded-none! [&_.arco-modal-header]:shrink-0!",
|
|
2424
|
-
focusLock: !1,
|
|
2425
|
-
children: /* @__PURE__ */ V("div", {
|
|
2426
|
-
className: "mx-auto flex min-h-full w-full max-w-7xl gap-8 px-6 py-6 lg:px-8",
|
|
2427
|
-
children: [/* @__PURE__ */ B("div", {
|
|
2428
|
-
className: "w-80",
|
|
2429
|
-
children: /* @__PURE__ */ B("div", {
|
|
2430
|
-
className: "bg-arco-bg-1 mx-auto w-full rounded-xl p-6",
|
|
2431
|
-
children: /* @__PURE__ */ B(d, {
|
|
2432
|
-
border: !1,
|
|
2433
|
-
column: 1,
|
|
2434
|
-
data: S,
|
|
2435
|
-
labelStyle: { width: 96 }
|
|
2436
|
-
})
|
|
2437
|
-
})
|
|
2438
|
-
}), /* @__PURE__ */ B("div", {
|
|
2439
|
-
className: "min-w-0 flex-1",
|
|
2440
|
-
children: /* @__PURE__ */ B("div", {
|
|
2441
|
-
className: "bg-arco-bg-1 mx-auto w-full max-w-2xl rounded-xl p-6",
|
|
2442
|
-
children: w
|
|
2443
|
-
})
|
|
2444
|
-
})]
|
|
2445
|
-
})
|
|
2446
|
-
});
|
|
2020
|
+
function Zt(e, t) {
|
|
2021
|
+
if (e == null) return {};
|
|
2022
|
+
var n = Xt(e, t), r, i;
|
|
2023
|
+
if (Object.getOwnPropertySymbols) {
|
|
2024
|
+
var a = Object.getOwnPropertySymbols(e);
|
|
2025
|
+
for (i = 0; i < a.length; i++) r = a[i], !(t.indexOf(r) >= 0) && Object.prototype.propertyIsEnumerable.call(e, r) && (n[r] = e[r]);
|
|
2026
|
+
}
|
|
2027
|
+
return n;
|
|
2447
2028
|
}
|
|
2448
|
-
|
|
2449
|
-
|
|
2450
|
-
function or({ user: e, points: t, text: n, onEditProfile: r, onRecharge: i, onPointsDetail: a, onLogout: o }) {
|
|
2451
|
-
let s = (e) => new Intl.NumberFormat().format(e);
|
|
2452
|
-
return /* @__PURE__ */ V("div", {
|
|
2453
|
-
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%)]",
|
|
2454
|
-
children: [
|
|
2455
|
-
/* @__PURE__ */ V("div", {
|
|
2456
|
-
className: "flex items-center gap-3 px-6 pt-5 pb-4",
|
|
2457
|
-
children: [/* @__PURE__ */ B(jt, {
|
|
2458
|
-
user: e,
|
|
2459
|
-
size: 48,
|
|
2460
|
-
className: "shrink-0"
|
|
2461
|
-
}), /* @__PURE__ */ V("div", {
|
|
2462
|
-
className: "flex min-w-0 flex-1 flex-col gap-1",
|
|
2463
|
-
children: [/* @__PURE__ */ V("div", {
|
|
2464
|
-
className: "flex min-w-0 items-center gap-1.5",
|
|
2465
|
-
children: [/* @__PURE__ */ B("span", {
|
|
2466
|
-
className: "text-arco-text-1 truncate text-base leading-6 font-bold",
|
|
2467
|
-
children: e?.nickname || e?.username
|
|
2468
|
-
}), /* @__PURE__ */ B(c, {
|
|
2469
|
-
type: "text",
|
|
2470
|
-
size: "mini",
|
|
2471
|
-
icon: /* @__PURE__ */ B(j, {}),
|
|
2472
|
-
className: "text-arco-text-3 h-6! min-w-6! px-0!",
|
|
2473
|
-
onClick: r
|
|
2474
|
-
})]
|
|
2475
|
-
}), e?.email ? /* @__PURE__ */ B("span", {
|
|
2476
|
-
className: "text-arco-text-3 truncate text-xs leading-5",
|
|
2477
|
-
children: e.email
|
|
2478
|
-
}) : null]
|
|
2479
|
-
})]
|
|
2480
|
-
}),
|
|
2481
|
-
/* @__PURE__ */ B(f, { className: "m-0!" }),
|
|
2482
|
-
/* @__PURE__ */ V("ul", {
|
|
2483
|
-
className: "flex flex-col gap-3.5 px-6 py-4",
|
|
2484
|
-
children: [
|
|
2485
|
-
/* @__PURE__ */ V("li", {
|
|
2486
|
-
className: "text-arco-text-2 flex items-center justify-between gap-4 text-sm",
|
|
2487
|
-
children: [/* @__PURE__ */ B("span", { children: n.myPoints }), /* @__PURE__ */ B("strong", {
|
|
2488
|
-
className: "text-arco-primary-6 text-base font-bold",
|
|
2489
|
-
children: s(t.total)
|
|
2490
|
-
})]
|
|
2491
|
-
}),
|
|
2492
|
-
/* @__PURE__ */ V("li", {
|
|
2493
|
-
className: "text-arco-text-2 flex items-center justify-between gap-4 text-sm",
|
|
2494
|
-
children: [/* @__PURE__ */ B("span", { children: n.rechargePoints }), /* @__PURE__ */ B("strong", {
|
|
2495
|
-
className: "text-arco-text-1 text-base font-bold",
|
|
2496
|
-
children: s(t.recharge)
|
|
2497
|
-
})]
|
|
2498
|
-
}),
|
|
2499
|
-
/* @__PURE__ */ V("li", {
|
|
2500
|
-
className: "text-arco-text-2 flex items-center justify-between gap-4 text-sm",
|
|
2501
|
-
children: [/* @__PURE__ */ B("span", { children: n.giftedPoints }), /* @__PURE__ */ B("strong", {
|
|
2502
|
-
className: "text-arco-text-1 text-base font-bold",
|
|
2503
|
-
children: s(t.gifted)
|
|
2504
|
-
})]
|
|
2505
|
-
})
|
|
2506
|
-
]
|
|
2507
|
-
}),
|
|
2508
|
-
/* @__PURE__ */ B(f, { className: "m-0!" }),
|
|
2509
|
-
/* @__PURE__ */ V("div", {
|
|
2510
|
-
className: "flex flex-col gap-2 px-6 py-4",
|
|
2511
|
-
children: [/* @__PURE__ */ B(c, {
|
|
2512
|
-
type: "primary",
|
|
2513
|
-
long: !0,
|
|
2514
|
-
icon: /* @__PURE__ */ B(F, {}),
|
|
2515
|
-
shape: "round",
|
|
2516
|
-
className: "h-10! font-medium!",
|
|
2517
|
-
onClick: i,
|
|
2518
|
-
children: n.recharge
|
|
2519
|
-
}), /* @__PURE__ */ B(c, {
|
|
2520
|
-
long: !0,
|
|
2521
|
-
shape: "round",
|
|
2522
|
-
icon: /* @__PURE__ */ B(M, {}),
|
|
2523
|
-
className: "border-arco-border-2! bg-arco-fill-1! text-arco-text-1! h-10! font-medium!",
|
|
2524
|
-
onClick: a,
|
|
2525
|
-
children: n.pointsDetail
|
|
2526
|
-
})]
|
|
2527
|
-
}),
|
|
2528
|
-
/* @__PURE__ */ B(f, { className: "m-0!" }),
|
|
2529
|
-
/* @__PURE__ */ B("div", {
|
|
2530
|
-
className: "px-6 py-4",
|
|
2531
|
-
children: /* @__PURE__ */ B(c, {
|
|
2532
|
-
icon: /* @__PURE__ */ B(I, {}),
|
|
2533
|
-
type: "text",
|
|
2534
|
-
status: "danger",
|
|
2535
|
-
long: !0,
|
|
2536
|
-
className: "flex! items-center justify-start gap-2 text-sm text-arco-text-2",
|
|
2537
|
-
onClick: () => void o?.(),
|
|
2538
|
-
children: n.logout
|
|
2539
|
-
})
|
|
2540
|
-
})
|
|
2541
|
-
]
|
|
2542
|
-
});
|
|
2029
|
+
function Qt(e, t) {
|
|
2030
|
+
return $t(e) || en(e, t) || tn(e, t) || rn();
|
|
2543
2031
|
}
|
|
2544
|
-
|
|
2545
|
-
|
|
2546
|
-
var sr = "https://mantur.ai/images/logo.png", cr = [
|
|
2547
|
-
"from-arco-primary-light-1 to-arco-primary-light-2 text-arco-primary-6",
|
|
2548
|
-
"from-arco-success-light-1 to-arco-success-light-2 text-arco-success-6",
|
|
2549
|
-
"from-arco-warning-light-1 to-arco-warning-light-2 text-arco-warning-6",
|
|
2550
|
-
"from-arco-danger-light-1 to-arco-danger-light-2 text-arco-danger-6"
|
|
2551
|
-
];
|
|
2552
|
-
function lr(e, t = !1) {
|
|
2553
|
-
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 ${cr[e % cr.length]} ${t ? "shadow-[inset_0_1px_3px_rgb(0_0_0/8%)]" : ""}`;
|
|
2032
|
+
function $t(e) {
|
|
2033
|
+
if (Array.isArray(e)) return e;
|
|
2554
2034
|
}
|
|
2555
|
-
function
|
|
2556
|
-
|
|
2035
|
+
function en(e, t) {
|
|
2036
|
+
var n = e && (typeof Symbol < "u" && e[Symbol.iterator] || e["@@iterator"]);
|
|
2037
|
+
if (n != null) {
|
|
2038
|
+
var r = [], i = !0, a = !1, o, s;
|
|
2039
|
+
try {
|
|
2040
|
+
for (n = n.call(e); !(i = (o = n.next()).done) && (r.push(o.value), !(t && r.length === t)); i = !0);
|
|
2041
|
+
} catch (e) {
|
|
2042
|
+
a = !0, s = e;
|
|
2043
|
+
} finally {
|
|
2044
|
+
try {
|
|
2045
|
+
!i && n.return != null && n.return();
|
|
2046
|
+
} finally {
|
|
2047
|
+
if (a) throw s;
|
|
2048
|
+
}
|
|
2049
|
+
}
|
|
2050
|
+
return r;
|
|
2051
|
+
}
|
|
2557
2052
|
}
|
|
2558
|
-
function
|
|
2559
|
-
|
|
2560
|
-
|
|
2053
|
+
function tn(e, t) {
|
|
2054
|
+
if (e) {
|
|
2055
|
+
if (typeof e == "string") return nn(e, t);
|
|
2056
|
+
var n = Object.prototype.toString.call(e).slice(8, -1);
|
|
2057
|
+
if (n === "Object" && e.constructor && (n = e.constructor.name), n === "Map" || n === "Set") return Array.from(e);
|
|
2058
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return nn(e, t);
|
|
2059
|
+
}
|
|
2561
2060
|
}
|
|
2562
|
-
function
|
|
2563
|
-
|
|
2564
|
-
|
|
2565
|
-
|
|
2566
|
-
|
|
2567
|
-
|
|
2568
|
-
|
|
2569
|
-
|
|
2570
|
-
|
|
2571
|
-
|
|
2572
|
-
|
|
2573
|
-
|
|
2061
|
+
function nn(e, t) {
|
|
2062
|
+
(t == null || t > e.length) && (t = e.length);
|
|
2063
|
+
for (var n = 0, r = Array(t); n < t; n++) r[n] = e[n];
|
|
2064
|
+
return r;
|
|
2065
|
+
}
|
|
2066
|
+
function rn() {
|
|
2067
|
+
throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
2068
|
+
}
|
|
2069
|
+
var X = function(e) {
|
|
2070
|
+
return e !== null && Jt(e) === "object";
|
|
2071
|
+
}, an = function(e) {
|
|
2072
|
+
return X(e) && typeof e.then == "function";
|
|
2073
|
+
}, on = function(e) {
|
|
2074
|
+
return X(e) && typeof e.elements == "function" && typeof e.createToken == "function" && typeof e.createPaymentMethod == "function" && typeof e.confirmCardPayment == "function";
|
|
2075
|
+
}, sn = "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.", cn = function(e) {
|
|
2076
|
+
var t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : sn;
|
|
2077
|
+
if (e === null || on(e)) return e;
|
|
2078
|
+
throw Error(t);
|
|
2079
|
+
}, ln = function(e) {
|
|
2080
|
+
var t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : sn;
|
|
2081
|
+
if (an(e)) return {
|
|
2082
|
+
tag: "async",
|
|
2083
|
+
stripePromise: Promise.resolve(e).then(function(e) {
|
|
2084
|
+
return cn(e, t);
|
|
2085
|
+
})
|
|
2574
2086
|
};
|
|
2575
|
-
n(
|
|
2576
|
-
|
|
2577
|
-
|
|
2578
|
-
|
|
2579
|
-
}
|
|
2580
|
-
|
|
2581
|
-
|
|
2582
|
-
|
|
2583
|
-
|
|
2584
|
-
|
|
2585
|
-
|
|
2586
|
-
|
|
2587
|
-
|
|
2588
|
-
|
|
2589
|
-
|
|
2590
|
-
|
|
2591
|
-
|
|
2592
|
-
|
|
2593
|
-
|
|
2594
|
-
|
|
2087
|
+
var n = cn(e, t);
|
|
2088
|
+
return n === null ? { tag: "empty" } : {
|
|
2089
|
+
tag: "sync",
|
|
2090
|
+
stripe: n
|
|
2091
|
+
};
|
|
2092
|
+
}, un = function(t) {
|
|
2093
|
+
var n = e.useRef(t);
|
|
2094
|
+
return e.useEffect(function() {
|
|
2095
|
+
n.current = t;
|
|
2096
|
+
}, [t]), n.current;
|
|
2097
|
+
}, dn = "[object Object]", fn = function e(t, n) {
|
|
2098
|
+
if (!X(t) || !X(n)) return t === n;
|
|
2099
|
+
var r = Array.isArray(t);
|
|
2100
|
+
if (r !== Array.isArray(n)) return !1;
|
|
2101
|
+
var i = Object.prototype.toString.call(t) === dn;
|
|
2102
|
+
if (i !== (Object.prototype.toString.call(n) === dn)) return !1;
|
|
2103
|
+
if (!i && !r) return t === n;
|
|
2104
|
+
var a = Object.keys(t), o = Object.keys(n);
|
|
2105
|
+
if (a.length !== o.length) return !1;
|
|
2106
|
+
for (var s = {}, c = 0; c < a.length; c += 1) s[a[c]] = !0;
|
|
2107
|
+
for (var l = 0; l < o.length; l += 1) s[o[l]] = !0;
|
|
2108
|
+
var u = Object.keys(s);
|
|
2109
|
+
if (u.length !== a.length) return !1;
|
|
2110
|
+
var d = t, f = n;
|
|
2111
|
+
return u.every(function(t) {
|
|
2112
|
+
return e(d[t], f[t]);
|
|
2113
|
+
});
|
|
2114
|
+
}, pn = function(e) {
|
|
2115
|
+
!e || !e._registerWrapper || !e.registerAppInfo || (e._registerWrapper({
|
|
2116
|
+
name: "react-stripe-js",
|
|
2117
|
+
version: "6.4.0"
|
|
2118
|
+
}), e.registerAppInfo({
|
|
2119
|
+
name: "react-stripe-js",
|
|
2120
|
+
version: "6.4.0",
|
|
2121
|
+
url: "https://stripe.com/docs/stripe-js/react"
|
|
2122
|
+
}));
|
|
2123
|
+
}, mn = function(e, t, n) {
|
|
2124
|
+
return X(e) ? Object.keys(e).reduce(function(r, i) {
|
|
2125
|
+
var a = !X(t) || !fn(e[i], t[i]);
|
|
2126
|
+
return n.includes(i) ? (a && console.warn(`Unsupported prop change: options.${i} is not a mutable property.`), r) : a ? qt(qt({}, r || {}), {}, Yt({}, i, e[i])) : r;
|
|
2127
|
+
}, null) : null;
|
|
2128
|
+
}, hn = /* @__PURE__ */ e.createContext(null);
|
|
2129
|
+
hn.displayName = "ElementsContext";
|
|
2130
|
+
var gn = function(e, t) {
|
|
2131
|
+
if (!e) throw Error(`Could not find Elements context; You need to wrap the part of your app that ${t} in an <Elements> provider.`);
|
|
2132
|
+
return e;
|
|
2133
|
+
};
|
|
2134
|
+
Y.default.any, Y.default.object, Y.default.func.isRequired;
|
|
2135
|
+
var _n = ["on", "loadActions"], vn = ["getSession"], yn = /* @__PURE__ */ e.createContext(null);
|
|
2136
|
+
yn.displayName = "CheckoutContext";
|
|
2137
|
+
var bn = function(e, t) {
|
|
2138
|
+
if (!e) throw Error(`Could not find checkout context; You need to wrap the part of your app that ${t} in a <CheckoutElementsProvider> or <CheckoutFormProvider> provider.`);
|
|
2139
|
+
return e;
|
|
2140
|
+
}, xn = function(t) {
|
|
2141
|
+
var n = e.useContext(yn), r = e.useContext(hn);
|
|
2142
|
+
if (n) {
|
|
2143
|
+
if (r) throw Error(`You cannot wrap the part of your app that ${t} in both a checkout provider and <Elements> provider.`);
|
|
2144
|
+
return n;
|
|
2145
|
+
} else return gn(r, t);
|
|
2146
|
+
}, Sn = function(e) {
|
|
2147
|
+
if (e.type === "success") {
|
|
2148
|
+
var t = e.sdk, n = e.session, r = e.checkoutActions;
|
|
2149
|
+
t.on, t.loadActions;
|
|
2150
|
+
var i = Zt(t, _n);
|
|
2151
|
+
r.getSession;
|
|
2152
|
+
var a = Zt(r, vn);
|
|
2153
|
+
return {
|
|
2154
|
+
type: "success",
|
|
2155
|
+
checkout: qt(qt(qt({}, n), i), a)
|
|
2595
2156
|
};
|
|
2596
|
-
}
|
|
2597
|
-
|
|
2598
|
-
|
|
2157
|
+
} else if (e.type === "loading") return { type: "loading" };
|
|
2158
|
+
else return {
|
|
2159
|
+
type: "error",
|
|
2160
|
+
error: e.error
|
|
2161
|
+
};
|
|
2162
|
+
}, Cn = function() {
|
|
2163
|
+
var t = bn(e.useContext(yn), "calls useCheckoutElements()").checkoutState;
|
|
2164
|
+
if (t.type === "success" && t.sdkKind !== "elements") throw Error("useCheckoutElements() must be used inside <CheckoutElementsProvider>. Inside <CheckoutFormProvider>, use useCheckoutForm() instead.");
|
|
2165
|
+
return Sn(t);
|
|
2166
|
+
}, wn = "Invalid prop `stripe` supplied to `CheckoutElementsProvider`. 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(e) {
|
|
2167
|
+
return e.type === "success" || e.type === "loading" ? e.sdk : null;
|
|
2168
|
+
}, En = function(t) {
|
|
2169
|
+
var n = t.stripe, r = t.options, i = t.children, a = e.useMemo(function() {
|
|
2170
|
+
return ln(n, wn);
|
|
2171
|
+
}, [n]), o = Qt(e.useState({
|
|
2172
|
+
type: "loading",
|
|
2173
|
+
sdk: null
|
|
2174
|
+
}), 2), s = o[0], c = o[1], l = Qt(e.useState(null), 2), u = l[0], d = l[1], f = e.useRef(!1);
|
|
2175
|
+
e.useEffect(function() {
|
|
2176
|
+
var e = !0, t = function(t) {
|
|
2177
|
+
var n = t.stripe;
|
|
2178
|
+
if (n && e && !f.current) {
|
|
2179
|
+
f.current = !0;
|
|
2180
|
+
var i = n.initCheckoutElementsSdk(r);
|
|
2181
|
+
c({
|
|
2182
|
+
type: "loading",
|
|
2183
|
+
sdk: i
|
|
2184
|
+
}), i.loadActions().then(function(e) {
|
|
2185
|
+
if (e.type === "success") {
|
|
2186
|
+
var t = e.actions;
|
|
2187
|
+
c({
|
|
2188
|
+
type: "success",
|
|
2189
|
+
sdkKind: "elements",
|
|
2190
|
+
sdk: i,
|
|
2191
|
+
checkoutActions: t,
|
|
2192
|
+
session: t.getSession()
|
|
2193
|
+
}), i.on("change", function(e) {
|
|
2194
|
+
c(function(t) {
|
|
2195
|
+
return t.type === "success" && t.sdkKind === "elements" ? {
|
|
2196
|
+
type: "success",
|
|
2197
|
+
sdkKind: "elements",
|
|
2198
|
+
sdk: t.sdk,
|
|
2199
|
+
checkoutActions: t.checkoutActions,
|
|
2200
|
+
session: e
|
|
2201
|
+
} : t;
|
|
2202
|
+
});
|
|
2203
|
+
});
|
|
2204
|
+
} else c({
|
|
2205
|
+
type: "error",
|
|
2206
|
+
error: e.error
|
|
2207
|
+
});
|
|
2208
|
+
}).catch(function(e) {
|
|
2209
|
+
c({
|
|
2210
|
+
type: "error",
|
|
2211
|
+
error: e
|
|
2212
|
+
});
|
|
2213
|
+
});
|
|
2214
|
+
}
|
|
2599
2215
|
};
|
|
2600
|
-
return
|
|
2601
|
-
|
|
2216
|
+
return a.tag === "async" ? a.stripePromise.then(function(e) {
|
|
2217
|
+
d(e), e && t({ stripe: e });
|
|
2218
|
+
}) : a.tag === "sync" && (d(a.stripe), t({ stripe: a.stripe })), function() {
|
|
2219
|
+
e = !1;
|
|
2602
2220
|
};
|
|
2603
|
-
}, []), n(() => {
|
|
2604
|
-
x && (I(!0), Ne().then((e) => {
|
|
2605
|
-
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) => ({
|
|
2606
|
-
id: e.id,
|
|
2607
|
-
packageCode: e.packageCode,
|
|
2608
|
-
packageName: e.packageName,
|
|
2609
|
-
packageNameEn: e.packageNameEn,
|
|
2610
|
-
price: Number(e.amount || 0),
|
|
2611
|
-
points: Number(e.points || 0),
|
|
2612
|
-
recommended: e.isRecommended,
|
|
2613
|
-
sortOrder: e.sortOrder
|
|
2614
|
-
}));
|
|
2615
|
-
t.length > 0 && ee(t);
|
|
2616
|
-
}).catch((e) => {
|
|
2617
|
-
console.warn("Failed to load Mantur recharge packages.", e);
|
|
2618
|
-
}).finally(() => I(!1)));
|
|
2619
|
-
}, [x]);
|
|
2620
|
-
let se = (e) => {
|
|
2621
|
-
v.success(e);
|
|
2622
|
-
}, ce = (e, t) => {
|
|
2623
|
-
console.error(t), v.error(e);
|
|
2624
|
-
}, le = t(async (e) => {
|
|
2625
|
-
if (!G && e !== W) try {
|
|
2626
|
-
P(!0), q(await qe(e)), se(g.switchedToTeam);
|
|
2627
|
-
} catch (e) {
|
|
2628
|
-
ce(g.error, e);
|
|
2629
|
-
} finally {
|
|
2630
|
-
P(!1);
|
|
2631
|
-
}
|
|
2632
2221
|
}, [
|
|
2633
|
-
|
|
2634
|
-
|
|
2635
|
-
|
|
2636
|
-
|
|
2637
|
-
|
|
2638
|
-
|
|
2639
|
-
|
|
2640
|
-
|
|
2641
|
-
|
|
2642
|
-
|
|
2643
|
-
|
|
2644
|
-
|
|
2645
|
-
|
|
2646
|
-
|
|
2647
|
-
|
|
2648
|
-
v.error(g.stripePaymentClientSecretMissing);
|
|
2649
|
-
return;
|
|
2650
|
-
}
|
|
2651
|
-
typeof window < "u" && window.dispatchEvent(new CustomEvent(be, { detail: n })), v.success(g.rechargeOrderCreated), S(!1), H(n);
|
|
2652
|
-
} catch (e) {
|
|
2653
|
-
ce(g.error, e);
|
|
2654
|
-
} finally {
|
|
2655
|
-
R(!1);
|
|
2222
|
+
a,
|
|
2223
|
+
r,
|
|
2224
|
+
c
|
|
2225
|
+
]);
|
|
2226
|
+
var p = un(n);
|
|
2227
|
+
e.useEffect(function() {
|
|
2228
|
+
p !== null && p !== n && console.warn("Unsupported prop change on CheckoutElementsProvider: You cannot change the `stripe` prop after setting it.");
|
|
2229
|
+
}, [p, n]);
|
|
2230
|
+
var m = Tn(s), h = un(r);
|
|
2231
|
+
e.useEffect(function() {
|
|
2232
|
+
if (m) {
|
|
2233
|
+
var e = h?.elementsOptions?.appearance, t = r?.elementsOptions?.appearance, n = !fn(t, e);
|
|
2234
|
+
t && n && m.changeAppearance(t);
|
|
2235
|
+
var i = h?.elementsOptions?.fonts, a = r?.elementsOptions?.fonts, o = !fn(i, a);
|
|
2236
|
+
a && o && m.loadFonts(a);
|
|
2656
2237
|
}
|
|
2657
|
-
},
|
|
2658
|
-
|
|
2659
|
-
|
|
2660
|
-
|
|
2661
|
-
|
|
2662
|
-
|
|
2663
|
-
|
|
2664
|
-
|
|
2665
|
-
|
|
2666
|
-
|
|
2667
|
-
|
|
2668
|
-
|
|
2669
|
-
|
|
2670
|
-
|
|
2671
|
-
|
|
2672
|
-
|
|
2673
|
-
|
|
2674
|
-
|
|
2675
|
-
|
|
2676
|
-
|
|
2677
|
-
|
|
2678
|
-
|
|
2679
|
-
|
|
2680
|
-
|
|
2681
|
-
|
|
2682
|
-
|
|
2683
|
-
|
|
2684
|
-
|
|
2685
|
-
}), [
|
|
2686
|
-
|
|
2687
|
-
|
|
2688
|
-
|
|
2689
|
-
|
|
2690
|
-
|
|
2691
|
-
|
|
2692
|
-
|
|
2693
|
-
|
|
2694
|
-
|
|
2695
|
-
|
|
2696
|
-
|
|
2697
|
-
|
|
2698
|
-
|
|
2699
|
-
|
|
2700
|
-
|
|
2701
|
-
|
|
2702
|
-
|
|
2703
|
-
|
|
2704
|
-
|
|
2705
|
-
|
|
2706
|
-
|
|
2707
|
-
|
|
2708
|
-
|
|
2709
|
-
|
|
2710
|
-
|
|
2711
|
-
|
|
2712
|
-
|
|
2713
|
-
|
|
2714
|
-
children: /* @__PURE__ */ B("img", {
|
|
2715
|
-
src: sr,
|
|
2716
|
-
alt: "logo",
|
|
2717
|
-
className: "w-full object-contain",
|
|
2718
|
-
onError: (e) => {
|
|
2719
|
-
e.currentTarget.style.display = "none";
|
|
2720
|
-
}
|
|
2721
|
-
})
|
|
2722
|
-
})
|
|
2723
|
-
}), s ?? /* @__PURE__ */ B("span", {
|
|
2724
|
-
className: "text-lg font-bold tracking-normal text-arco-text-1",
|
|
2725
|
-
children: g.title
|
|
2726
|
-
})]
|
|
2727
|
-
}), /* @__PURE__ */ B(p, {
|
|
2728
|
-
droplist: fe,
|
|
2729
|
-
trigger: "click",
|
|
2730
|
-
position: "bl",
|
|
2731
|
-
disabled: G,
|
|
2732
|
-
children: /* @__PURE__ */ V("div", {
|
|
2733
|
-
"aria-disabled": G,
|
|
2734
|
-
className: `flex items-center gap-3 rounded-full border border-arco-border-1 bg-arco-bg-1 px-2 py-1.5 transition-all ${G ? "cursor-not-allowed opacity-60" : "cursor-pointer hover:bg-arco-fill-2 hover:shadow-[0_4px_12px_rgb(0_0_0/8%)]"}`,
|
|
2735
|
-
children: [
|
|
2736
|
-
/* @__PURE__ */ B("div", {
|
|
2737
|
-
className: lr(me, !0),
|
|
2738
|
-
children: ur(j)
|
|
2739
|
-
}),
|
|
2740
|
-
/* @__PURE__ */ V("div", {
|
|
2741
|
-
className: "flex min-w-0 flex-col",
|
|
2742
|
-
children: [/* @__PURE__ */ B("span", {
|
|
2743
|
-
className: "text-xs leading-none font-bold text-arco-text-1",
|
|
2744
|
-
children: N ? g.loading : j?.tenantName || g.loading
|
|
2745
|
-
}), /* @__PURE__ */ B("span", {
|
|
2746
|
-
className: "mt-1 text-[10px] leading-none text-arco-text-3",
|
|
2747
|
-
children: dr(j, g.owner, g.member)
|
|
2748
|
-
})]
|
|
2749
|
-
}),
|
|
2750
|
-
/* @__PURE__ */ B(A, { className: "ml-1 text-arco-text-3" })
|
|
2751
|
-
]
|
|
2752
|
-
})
|
|
2753
|
-
})]
|
|
2754
|
-
}),
|
|
2755
|
-
/* @__PURE__ */ B("div", {
|
|
2756
|
-
className: "flex-1",
|
|
2757
|
-
children: c
|
|
2758
|
-
}),
|
|
2759
|
-
/* @__PURE__ */ V("div", {
|
|
2760
|
-
className: "flex items-center gap-4",
|
|
2761
|
-
children: [/* @__PURE__ */ V("div", {
|
|
2762
|
-
className: "flex items-center gap-4",
|
|
2763
|
-
children: [/* @__PURE__ */ B(ct, {}), /* @__PURE__ */ B(st, {})]
|
|
2764
|
-
}), /* @__PURE__ */ B(p, {
|
|
2765
|
-
droplist: pe,
|
|
2766
|
-
trigger: "click",
|
|
2767
|
-
position: "br",
|
|
2768
|
-
onVisibleChange: (e) => {
|
|
2769
|
-
e && Me().catch((e) => {
|
|
2770
|
-
console.warn("Failed to refresh Mantur user points.", e);
|
|
2238
|
+
}, [
|
|
2239
|
+
r,
|
|
2240
|
+
h,
|
|
2241
|
+
m
|
|
2242
|
+
]), e.useEffect(function() {
|
|
2243
|
+
pn(u);
|
|
2244
|
+
}, [u]);
|
|
2245
|
+
var g = e.useMemo(function() {
|
|
2246
|
+
return {
|
|
2247
|
+
stripe: u,
|
|
2248
|
+
checkoutState: s
|
|
2249
|
+
};
|
|
2250
|
+
}, [u, s]);
|
|
2251
|
+
return /* @__PURE__ */ e.createElement(yn.Provider, { value: g }, i);
|
|
2252
|
+
};
|
|
2253
|
+
En.propTypes = {
|
|
2254
|
+
stripe: Y.default.any,
|
|
2255
|
+
options: Y.default.shape({
|
|
2256
|
+
clientSecret: Y.default.oneOfType([Y.default.string, Y.default.instanceOf(Promise)]).isRequired,
|
|
2257
|
+
elementsOptions: Y.default.object
|
|
2258
|
+
}).isRequired
|
|
2259
|
+
};
|
|
2260
|
+
var Dn = "Invalid prop `stripe` supplied to `CheckoutFormProvider`. We recommend using the `loadStripe` utility from `@stripe/stripe-js`. See https://stripe.com/docs/stripe-js/react#elements-props-stripe for details.", On = function(t) {
|
|
2261
|
+
var n = t.stripe, r = t.options, i = t.children, a = e.useMemo(function() {
|
|
2262
|
+
return ln(n, Dn);
|
|
2263
|
+
}, [n]), o = Qt(e.useState({
|
|
2264
|
+
type: "loading",
|
|
2265
|
+
sdk: null
|
|
2266
|
+
}), 2), s = o[0], c = o[1], l = Qt(e.useState(null), 2), u = l[0], d = l[1], f = e.useRef(!1);
|
|
2267
|
+
e.useEffect(function() {
|
|
2268
|
+
var e = !0, t = function(t) {
|
|
2269
|
+
var n = t.stripe;
|
|
2270
|
+
if (n && e && !f.current) {
|
|
2271
|
+
f.current = !0;
|
|
2272
|
+
var i = n.initCheckoutFormSdk(r);
|
|
2273
|
+
c({
|
|
2274
|
+
type: "loading",
|
|
2275
|
+
sdk: i
|
|
2276
|
+
}), i.loadActions().then(function(e) {
|
|
2277
|
+
if (e.type === "success") {
|
|
2278
|
+
var t = e.actions;
|
|
2279
|
+
c({
|
|
2280
|
+
type: "success",
|
|
2281
|
+
sdkKind: "form",
|
|
2282
|
+
sdk: i,
|
|
2283
|
+
checkoutActions: t,
|
|
2284
|
+
session: t.getSession()
|
|
2285
|
+
}), i.on("change", function(e) {
|
|
2286
|
+
c(function(t) {
|
|
2287
|
+
return t.type === "success" && t.sdkKind === "form" ? {
|
|
2288
|
+
type: "success",
|
|
2289
|
+
sdkKind: "form",
|
|
2290
|
+
sdk: t.sdk,
|
|
2291
|
+
checkoutActions: t.checkoutActions,
|
|
2292
|
+
session: e
|
|
2293
|
+
} : t;
|
|
2294
|
+
});
|
|
2771
2295
|
});
|
|
2772
|
-
}
|
|
2773
|
-
|
|
2774
|
-
|
|
2775
|
-
children: [
|
|
2776
|
-
/* @__PURE__ */ V("div", {
|
|
2777
|
-
className: "from-arco-primary to-transparent relative rounded-full bg-linear-to-br p-0.5 shadow-sm",
|
|
2778
|
-
children: [/* @__PURE__ */ B(jt, {
|
|
2779
|
-
user: T,
|
|
2780
|
-
size: 36
|
|
2781
|
-
}), /* @__PURE__ */ B("div", { className: "bg-arco-success border-arco-bg-white absolute right-0 bottom-0 h-3 w-3 rounded-full border-2 shadow-sm" })]
|
|
2782
|
-
}),
|
|
2783
|
-
/* @__PURE__ */ B("div", {
|
|
2784
|
-
className: "hidden flex-col md:flex",
|
|
2785
|
-
children: /* @__PURE__ */ B("span", {
|
|
2786
|
-
className: "text-arco-text-1 text-sm font-medium",
|
|
2787
|
-
children: T?.nickname || T?.username
|
|
2788
|
-
})
|
|
2789
|
-
}),
|
|
2790
|
-
/* @__PURE__ */ B(A, { className: "text-arco-text-3 ml-1" })
|
|
2791
|
-
]
|
|
2792
|
-
})
|
|
2793
|
-
})]
|
|
2794
|
-
}),
|
|
2795
|
-
/* @__PURE__ */ B(Ot, {
|
|
2796
|
-
visible: y,
|
|
2797
|
-
user: T,
|
|
2798
|
-
labels: g,
|
|
2799
|
-
onCancel: () => b(!1),
|
|
2800
|
-
onSubmit: oe
|
|
2801
|
-
}),
|
|
2802
|
-
/* @__PURE__ */ B(Pt, {
|
|
2803
|
-
visible: x,
|
|
2804
|
-
user: T,
|
|
2805
|
-
points: K,
|
|
2806
|
-
text: g,
|
|
2807
|
-
packages: z,
|
|
2808
|
-
packageLoading: F,
|
|
2809
|
-
submitting: L,
|
|
2810
|
-
onCancel: () => S(!1),
|
|
2811
|
-
onPay: ue
|
|
2812
|
-
}),
|
|
2813
|
-
/* @__PURE__ */ B(St, {
|
|
2814
|
-
visible: C,
|
|
2815
|
-
points: K,
|
|
2816
|
-
text: g,
|
|
2817
|
-
onCancel: () => w(!1),
|
|
2818
|
-
onRecharge: () => S(!0)
|
|
2819
|
-
}),
|
|
2820
|
-
/* @__PURE__ */ B(ar, {
|
|
2821
|
-
visible: !!te,
|
|
2822
|
-
publishableKey: re,
|
|
2823
|
-
order: te,
|
|
2824
|
-
text: g,
|
|
2825
|
-
onCancel: () => H(void 0),
|
|
2826
|
-
onSuccess: () => {
|
|
2827
|
-
v.success(g.rechargeSuccess), H(void 0), Me().catch((e) => {
|
|
2828
|
-
console.warn("Failed to refresh Mantur user points.", e);
|
|
2296
|
+
} else c({
|
|
2297
|
+
type: "error",
|
|
2298
|
+
error: e.error
|
|
2829
2299
|
});
|
|
2830
|
-
}
|
|
2831
|
-
|
|
2832
|
-
|
|
2833
|
-
|
|
2834
|
-
}
|
|
2835
|
-
|
|
2836
|
-
//#region src/utils/date.ts
|
|
2837
|
-
var pr = /* @__PURE__ */ G((/* @__PURE__ */ U(((e, t) => {
|
|
2838
|
-
(function(n, r) {
|
|
2839
|
-
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();
|
|
2840
|
-
})(e, (function() {
|
|
2841
|
-
var e = 1e3, t = 6e4, n = 36e5, r = "millisecond", i = "second", a = "minute", o = "hour", s = "day", c = "week", l = "month", u = "quarter", d = "year", f = "date", p = "Invalid Date", m = /^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/, h = /\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g, g = {
|
|
2842
|
-
name: "en",
|
|
2843
|
-
weekdays: "Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),
|
|
2844
|
-
months: "January_February_March_April_May_June_July_August_September_October_November_December".split("_"),
|
|
2845
|
-
ordinal: function(e) {
|
|
2846
|
-
var t = [
|
|
2847
|
-
"th",
|
|
2848
|
-
"st",
|
|
2849
|
-
"nd",
|
|
2850
|
-
"rd"
|
|
2851
|
-
], n = e % 100;
|
|
2852
|
-
return "[" + e + (t[(n - 20) % 10] || t[n] || t[0]) + "]";
|
|
2300
|
+
}).catch(function(e) {
|
|
2301
|
+
c({
|
|
2302
|
+
type: "error",
|
|
2303
|
+
error: e
|
|
2304
|
+
});
|
|
2305
|
+
});
|
|
2853
2306
|
}
|
|
2854
|
-
}
|
|
2855
|
-
|
|
2856
|
-
|
|
2857
|
-
},
|
|
2858
|
-
|
|
2859
|
-
|
|
2860
|
-
|
|
2861
|
-
|
|
2862
|
-
|
|
2863
|
-
|
|
2864
|
-
|
|
2865
|
-
|
|
2866
|
-
|
|
2867
|
-
|
|
2868
|
-
|
|
2869
|
-
|
|
2870
|
-
|
|
2871
|
-
|
|
2872
|
-
|
|
2873
|
-
|
|
2874
|
-
|
|
2875
|
-
|
|
2876
|
-
|
|
2877
|
-
|
|
2878
|
-
|
|
2879
|
-
|
|
2880
|
-
|
|
2881
|
-
|
|
2882
|
-
|
|
2883
|
-
|
|
2884
|
-
|
|
2885
|
-
|
|
2886
|
-
|
|
2307
|
+
};
|
|
2308
|
+
return a.tag === "async" ? a.stripePromise.then(function(e) {
|
|
2309
|
+
d(e), e && t({ stripe: e });
|
|
2310
|
+
}) : a.tag === "sync" && (d(a.stripe), t({ stripe: a.stripe })), function() {
|
|
2311
|
+
e = !1;
|
|
2312
|
+
};
|
|
2313
|
+
}, [
|
|
2314
|
+
a,
|
|
2315
|
+
r,
|
|
2316
|
+
c
|
|
2317
|
+
]);
|
|
2318
|
+
var p = un(n);
|
|
2319
|
+
e.useEffect(function() {
|
|
2320
|
+
p !== null && p !== n && console.warn("Unsupported prop change on CheckoutFormProvider: You cannot change the `stripe` prop after setting it.");
|
|
2321
|
+
}, [p, n]);
|
|
2322
|
+
var m = s.type === "success" || s.type === "loading" ? s.sdk : null, h = un(r);
|
|
2323
|
+
e.useEffect(function() {
|
|
2324
|
+
if (m) {
|
|
2325
|
+
var e = h?.appearance, t = r?.appearance, n = !fn(t, e);
|
|
2326
|
+
t && n && m.changeAppearance(t);
|
|
2327
|
+
var i = h?.fonts, a = r?.fonts, o = !fn(i, a);
|
|
2328
|
+
a && o && m.loadFonts(a);
|
|
2329
|
+
}
|
|
2330
|
+
}, [
|
|
2331
|
+
r,
|
|
2332
|
+
h,
|
|
2333
|
+
m
|
|
2334
|
+
]), e.useEffect(function() {
|
|
2335
|
+
pn(u);
|
|
2336
|
+
}, [u]);
|
|
2337
|
+
var g = e.useMemo(function() {
|
|
2338
|
+
return {
|
|
2339
|
+
stripe: u,
|
|
2340
|
+
checkoutState: s
|
|
2341
|
+
};
|
|
2342
|
+
}, [u, s]);
|
|
2343
|
+
return /* @__PURE__ */ e.createElement(yn.Provider, { value: g }, i);
|
|
2344
|
+
};
|
|
2345
|
+
On.propTypes = {
|
|
2346
|
+
stripe: Y.default.any,
|
|
2347
|
+
options: Y.default.shape({
|
|
2348
|
+
clientSecret: Y.default.oneOfType([Y.default.string, Y.default.instanceOf(Promise)]).isRequired,
|
|
2349
|
+
appearance: Y.default.object,
|
|
2350
|
+
loader: Y.default.string,
|
|
2351
|
+
fonts: Y.default.array,
|
|
2352
|
+
savedPaymentMethod: Y.default.object,
|
|
2353
|
+
defaultValues: Y.default.object
|
|
2354
|
+
}).isRequired
|
|
2355
|
+
};
|
|
2356
|
+
var Z = function(t, n, r) {
|
|
2357
|
+
var i = !!r, a = e.useRef(r);
|
|
2358
|
+
e.useEffect(function() {
|
|
2359
|
+
a.current = r;
|
|
2360
|
+
}, [r]), e.useEffect(function() {
|
|
2361
|
+
if (!i || !t) return function() {};
|
|
2362
|
+
var e = function() {
|
|
2363
|
+
a.current && a.current.apply(a, arguments);
|
|
2364
|
+
};
|
|
2365
|
+
return t.on(n, e), function() {
|
|
2366
|
+
t.off(n, e);
|
|
2367
|
+
};
|
|
2368
|
+
}, [
|
|
2369
|
+
i,
|
|
2370
|
+
n,
|
|
2371
|
+
t,
|
|
2372
|
+
a
|
|
2373
|
+
]);
|
|
2374
|
+
}, kn = ["mode"], An = function(e) {
|
|
2375
|
+
return e.charAt(0).toUpperCase() + e.slice(1);
|
|
2376
|
+
}, Q = function(t, n, r) {
|
|
2377
|
+
var i = r || `${An(t)}Element`, a = n ? function(t) {
|
|
2378
|
+
xn(`mounts <${i}>`);
|
|
2379
|
+
var n = t.id, r = t.className;
|
|
2380
|
+
return /* @__PURE__ */ e.createElement("div", {
|
|
2381
|
+
id: n,
|
|
2382
|
+
className: r
|
|
2383
|
+
});
|
|
2384
|
+
} : function(n) {
|
|
2385
|
+
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 = xn(`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 = Qt(e.useState(null), 2), k = O[0], A = O[1], j = e.useRef(null), M = e.useRef(null);
|
|
2386
|
+
Z(k, "blur", c), Z(k, "focus", l), Z(k, "escape", f), Z(k, "click", p), Z(k, "loaderror", m), Z(k, "loaderstart", h), Z(k, "networkschange", g), Z(k, "confirm", _), Z(k, "cancel", v), Z(k, "shippingaddresschange", y), Z(k, "shippingratechange", b), Z(k, "savedpaymentmethodremove", x), Z(k, "savedpaymentmethodupdate", S), Z(k, "availablepaymentmethodschange", C), Z(k, "change", d);
|
|
2387
|
+
var N;
|
|
2388
|
+
u && (N = t === "expressCheckout" ? u : function() {
|
|
2389
|
+
u(k);
|
|
2390
|
+
}), Z(k, "ready", N), e.useLayoutEffect(function() {
|
|
2391
|
+
if (j.current === null && M.current !== null && (T || D)) {
|
|
2392
|
+
var e = null;
|
|
2393
|
+
if (D) {
|
|
2394
|
+
var n = D, r = D;
|
|
2395
|
+
switch (t) {
|
|
2396
|
+
case "paymentForm":
|
|
2397
|
+
e = r.createForm(s);
|
|
2398
|
+
break;
|
|
2399
|
+
case "payment":
|
|
2400
|
+
e = n.createPaymentElement(s);
|
|
2401
|
+
break;
|
|
2402
|
+
case "address":
|
|
2403
|
+
if ("mode" in s) {
|
|
2404
|
+
var a = s.mode, o = Zt(s, kn);
|
|
2405
|
+
if (a === "shipping") e = n.createShippingAddressElement(o);
|
|
2406
|
+
else if (a === "billing") e = n.createBillingAddressElement(o);
|
|
2407
|
+
else throw Error("Invalid options.mode. mode must be 'billing' or 'shipping'.");
|
|
2408
|
+
} else throw Error("You must supply options.mode. mode must be 'billing' or 'shipping'.");
|
|
2409
|
+
break;
|
|
2410
|
+
case "expressCheckout":
|
|
2411
|
+
e = n.createExpressCheckoutElement(s);
|
|
2412
|
+
break;
|
|
2413
|
+
case "currencySelector":
|
|
2414
|
+
e = D.createCurrencySelectorElement();
|
|
2415
|
+
break;
|
|
2416
|
+
case "taxId":
|
|
2417
|
+
e = n.createTaxIdElement(s);
|
|
2418
|
+
break;
|
|
2419
|
+
case "contactDetails":
|
|
2420
|
+
e = n.createContactDetailsElement();
|
|
2421
|
+
break;
|
|
2422
|
+
default: throw Error(`<${i}> is not supported inside a checkout provider. Use an <Elements> provider instead.`);
|
|
2423
|
+
}
|
|
2424
|
+
} else T && (e = T.create(t, s));
|
|
2425
|
+
j.current = e, A(e), e && e.mount(M.current);
|
|
2887
2426
|
}
|
|
2888
|
-
},
|
|
2889
|
-
|
|
2890
|
-
|
|
2891
|
-
|
|
2892
|
-
|
|
2893
|
-
|
|
2894
|
-
|
|
2895
|
-
if (
|
|
2896
|
-
var
|
|
2897
|
-
|
|
2898
|
-
var o = t.split("-");
|
|
2899
|
-
if (!i && o.length > 1) return e(o[0]);
|
|
2900
|
-
} else {
|
|
2901
|
-
var s = t.name;
|
|
2902
|
-
b[s] = t, i = s;
|
|
2427
|
+
}, [
|
|
2428
|
+
T,
|
|
2429
|
+
D,
|
|
2430
|
+
s
|
|
2431
|
+
]);
|
|
2432
|
+
var P = un(s);
|
|
2433
|
+
return e.useEffect(function() {
|
|
2434
|
+
if (j.current) {
|
|
2435
|
+
var e = mn(s, P, ["paymentRequest"]);
|
|
2436
|
+
e && "update" in j.current && j.current.update(e);
|
|
2903
2437
|
}
|
|
2904
|
-
|
|
2905
|
-
|
|
2906
|
-
|
|
2907
|
-
|
|
2908
|
-
|
|
2909
|
-
|
|
2910
|
-
|
|
2911
|
-
|
|
2912
|
-
|
|
2913
|
-
|
|
2914
|
-
|
|
2915
|
-
|
|
2916
|
-
|
|
2917
|
-
|
|
2918
|
-
|
|
2919
|
-
|
|
2920
|
-
|
|
2438
|
+
}, [s, P]), e.useLayoutEffect(function() {
|
|
2439
|
+
return function() {
|
|
2440
|
+
if (j.current && typeof j.current.destroy == "function") try {
|
|
2441
|
+
j.current.destroy(), j.current = null;
|
|
2442
|
+
} catch {}
|
|
2443
|
+
};
|
|
2444
|
+
}, []), /* @__PURE__ */ e.createElement("div", {
|
|
2445
|
+
id: r,
|
|
2446
|
+
className: a,
|
|
2447
|
+
ref: M
|
|
2448
|
+
});
|
|
2449
|
+
};
|
|
2450
|
+
return a.propTypes = {
|
|
2451
|
+
id: Y.default.string,
|
|
2452
|
+
className: Y.default.string,
|
|
2453
|
+
onChange: Y.default.func,
|
|
2454
|
+
onBlur: Y.default.func,
|
|
2455
|
+
onFocus: Y.default.func,
|
|
2456
|
+
onReady: Y.default.func,
|
|
2457
|
+
onEscape: Y.default.func,
|
|
2458
|
+
onClick: Y.default.func,
|
|
2459
|
+
onLoadError: Y.default.func,
|
|
2460
|
+
onLoaderStart: Y.default.func,
|
|
2461
|
+
onNetworksChange: Y.default.func,
|
|
2462
|
+
onConfirm: Y.default.func,
|
|
2463
|
+
onCancel: Y.default.func,
|
|
2464
|
+
onShippingAddressChange: Y.default.func,
|
|
2465
|
+
onShippingRateChange: Y.default.func,
|
|
2466
|
+
onSavedPaymentMethodRemove: Y.default.func,
|
|
2467
|
+
onSavedPaymentMethodUpdate: Y.default.func,
|
|
2468
|
+
onAvailablePaymentMethodsChange: Y.default.func,
|
|
2469
|
+
options: Y.default.object
|
|
2470
|
+
}, a.displayName = i, a.__elementType = t, a;
|
|
2471
|
+
}, $ = typeof window > "u";
|
|
2472
|
+
Q("currencySelector", $);
|
|
2473
|
+
var jn = Q("payment", $);
|
|
2474
|
+
Q("paymentForm", $, "CheckoutForm"), Q("expressCheckout", $), Q("taxId", $);
|
|
2475
|
+
var Mn = Q("contactDetails", $);
|
|
2476
|
+
Q("address", $);
|
|
2477
|
+
//#endregion
|
|
2478
|
+
//#region node_modules/@stripe/stripe-js/dist/index.mjs
|
|
2479
|
+
function Nn(e) {
|
|
2480
|
+
"@babel/helpers - typeof";
|
|
2481
|
+
return Nn = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(e) {
|
|
2482
|
+
return typeof e;
|
|
2483
|
+
} : function(e) {
|
|
2484
|
+
return e && typeof Symbol == "function" && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
|
|
2485
|
+
}, Nn(e);
|
|
2486
|
+
}
|
|
2487
|
+
var Pn = "dahlia", Fn = function(e) {
|
|
2488
|
+
return e === 3 ? "v3" : e;
|
|
2489
|
+
}, In = "https://js.stripe.com", Ln = `${In}/${Pn}/stripe.js`, Rn = /^https:\/\/js\.stripe\.com\/v3\/?(\?.*)?$/, zn = /^https:\/\/js\.stripe\.com\/(v3|[a-z]+)\/stripe\.js(\?.*)?$/, Bn = "loadStripe.setLoadParameters was called but an existing Stripe.js script already exists in the document; existing script parameters will be used", Vn = function(e) {
|
|
2490
|
+
return Rn.test(e) || zn.test(e);
|
|
2491
|
+
}, Hn = function() {
|
|
2492
|
+
for (var e = document.querySelectorAll(`script[src^="${In}"]`), t = 0; t < e.length; t++) {
|
|
2493
|
+
var n = e[t];
|
|
2494
|
+
if (Vn(n.src)) return n;
|
|
2495
|
+
}
|
|
2496
|
+
return null;
|
|
2497
|
+
}, Un = function(e) {
|
|
2498
|
+
var t = e && !e.advancedFraudSignals ? "?advancedFraudSignals=false" : "", n = document.createElement("script");
|
|
2499
|
+
n.src = `${Ln}${t}`;
|
|
2500
|
+
var r = document.head || document.body;
|
|
2501
|
+
if (!r) throw Error("Expected document.body not to be null. Stripe.js requires a <body> element.");
|
|
2502
|
+
return r.appendChild(n), n;
|
|
2503
|
+
}, Wn = function(e, t) {
|
|
2504
|
+
!e || !e._registerWrapper || e._registerWrapper({
|
|
2505
|
+
name: "stripe-js",
|
|
2506
|
+
version: "9.6.0",
|
|
2507
|
+
startTime: t
|
|
2508
|
+
});
|
|
2509
|
+
}, Gn = null, Kn = null, qn = null, Jn = function(e) {
|
|
2510
|
+
return function(t) {
|
|
2511
|
+
e(Error("Failed to load Stripe.js", { cause: t }));
|
|
2512
|
+
};
|
|
2513
|
+
}, Yn = function(e, t) {
|
|
2514
|
+
return function() {
|
|
2515
|
+
window.Stripe ? e(window.Stripe) : t(/* @__PURE__ */ Error("Stripe.js not available"));
|
|
2516
|
+
};
|
|
2517
|
+
}, Xn = function(e) {
|
|
2518
|
+
return Gn === null ? (Gn = new Promise(function(t, n) {
|
|
2519
|
+
if (typeof window > "u" || typeof document > "u") {
|
|
2520
|
+
t(null);
|
|
2521
|
+
return;
|
|
2522
|
+
}
|
|
2523
|
+
if (window.Stripe && e && console.warn(Bn), window.Stripe) {
|
|
2524
|
+
t(window.Stripe);
|
|
2525
|
+
return;
|
|
2526
|
+
}
|
|
2527
|
+
try {
|
|
2528
|
+
var r = Hn();
|
|
2529
|
+
if (r && e) console.warn(Bn);
|
|
2530
|
+
else if (!r) r = Un(e);
|
|
2531
|
+
else if (r && qn !== null && Kn !== null) {
|
|
2532
|
+
var i;
|
|
2533
|
+
r.removeEventListener("load", qn), r.removeEventListener("error", Kn), (i = r.parentNode) == null || i.removeChild(r), r = Un(e);
|
|
2921
2534
|
}
|
|
2922
|
-
|
|
2923
|
-
|
|
2924
|
-
|
|
2925
|
-
|
|
2926
|
-
|
|
2927
|
-
|
|
2928
|
-
|
|
2929
|
-
|
|
2930
|
-
|
|
2931
|
-
|
|
2932
|
-
|
|
2933
|
-
|
|
2934
|
-
|
|
2935
|
-
|
|
2936
|
-
|
|
2937
|
-
|
|
2938
|
-
|
|
2939
|
-
|
|
2940
|
-
|
|
2941
|
-
|
|
2942
|
-
|
|
2943
|
-
|
|
2944
|
-
|
|
2945
|
-
|
|
2946
|
-
|
|
2947
|
-
|
|
2948
|
-
|
|
2949
|
-
|
|
2950
|
-
|
|
2951
|
-
|
|
2952
|
-
|
|
2953
|
-
|
|
2954
|
-
|
|
2955
|
-
|
|
2956
|
-
|
|
2957
|
-
|
|
2958
|
-
|
|
2959
|
-
|
|
2960
|
-
|
|
2961
|
-
|
|
2962
|
-
|
|
2963
|
-
|
|
2964
|
-
|
|
2965
|
-
|
|
2966
|
-
|
|
2967
|
-
|
|
2968
|
-
|
|
2969
|
-
|
|
2970
|
-
|
|
2971
|
-
|
|
2972
|
-
|
|
2973
|
-
|
|
2974
|
-
|
|
2975
|
-
|
|
2976
|
-
|
|
2977
|
-
|
|
2978
|
-
|
|
2979
|
-
|
|
2980
|
-
|
|
2981
|
-
|
|
2982
|
-
|
|
2983
|
-
|
|
2984
|
-
|
|
2985
|
-
|
|
2986
|
-
|
|
2535
|
+
qn = Yn(t, n), Kn = Jn(n), r.addEventListener("load", qn), r.addEventListener("error", Kn);
|
|
2536
|
+
} catch (e) {
|
|
2537
|
+
n(e);
|
|
2538
|
+
return;
|
|
2539
|
+
}
|
|
2540
|
+
}), Gn.catch(function(e) {
|
|
2541
|
+
return Gn = null, Promise.reject(e);
|
|
2542
|
+
})) : Gn;
|
|
2543
|
+
}, Zn = function(e, t, n) {
|
|
2544
|
+
if (e === null) return null;
|
|
2545
|
+
var r = t[0];
|
|
2546
|
+
if (typeof r != "string") throw Error(`Expected publishable key to be of type string, got type ${Nn(r)} instead.`);
|
|
2547
|
+
var i = r.match(/^pk_test/), a = Fn(e.version), o = Pn;
|
|
2548
|
+
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`);
|
|
2549
|
+
var s = e.apply(void 0, t);
|
|
2550
|
+
return Wn(s, n), s;
|
|
2551
|
+
}, Qn, $n = !1, er = function() {
|
|
2552
|
+
return Qn || (Qn = Xn(null).catch(function(e) {
|
|
2553
|
+
return Qn = null, Promise.reject(e);
|
|
2554
|
+
}), Qn);
|
|
2555
|
+
};
|
|
2556
|
+
Promise.resolve().then(function() {
|
|
2557
|
+
return er();
|
|
2558
|
+
}).catch(function(e) {
|
|
2559
|
+
$n || console.warn(e);
|
|
2560
|
+
});
|
|
2561
|
+
var tr = function() {
|
|
2562
|
+
var e = [...arguments];
|
|
2563
|
+
$n = !0;
|
|
2564
|
+
var t = Date.now();
|
|
2565
|
+
return er().then(function(n) {
|
|
2566
|
+
return Zn(n, e, t);
|
|
2567
|
+
});
|
|
2568
|
+
}, nr = "-";
|
|
2569
|
+
function rr(e) {
|
|
2570
|
+
return e === void 0 ? nr : `$${new Intl.NumberFormat("en-US").format(Number(e || 0))}`;
|
|
2571
|
+
}
|
|
2572
|
+
function ir(e) {
|
|
2573
|
+
return /* @__PURE__ */ z(D.Text, {
|
|
2574
|
+
className: "text-arco-text-1! text-3xl! leading-tight! font-bold!",
|
|
2575
|
+
children: rr(e)
|
|
2576
|
+
});
|
|
2577
|
+
}
|
|
2578
|
+
function ar({ text: e, onSuccess: t }) {
|
|
2579
|
+
let n = Cn(), [r, i] = a(""), [s, l] = a(!1);
|
|
2580
|
+
if (n.type === "loading") return /* @__PURE__ */ z("div", {
|
|
2581
|
+
className: "flex min-h-80 items-center justify-center",
|
|
2582
|
+
children: /* @__PURE__ */ z(S, { tip: e.stripePaymentLoading })
|
|
2583
|
+
});
|
|
2584
|
+
if (n.type === "error") return /* @__PURE__ */ z(o, {
|
|
2585
|
+
type: "error",
|
|
2586
|
+
content: n.error.message
|
|
2587
|
+
});
|
|
2588
|
+
let { checkout: u } = n, d = u.total.total.amount;
|
|
2589
|
+
return /* @__PURE__ */ B("form", {
|
|
2590
|
+
className: "flex flex-col gap-6",
|
|
2591
|
+
onSubmit: async (n) => {
|
|
2592
|
+
if (n.preventDefault(), !(!u.canConfirm || s)) {
|
|
2593
|
+
l(!0), i("");
|
|
2594
|
+
try {
|
|
2595
|
+
let e = await u.confirm({ redirect: "if_required" });
|
|
2596
|
+
if (e.type === "error") {
|
|
2597
|
+
i(e.error.message);
|
|
2598
|
+
return;
|
|
2599
|
+
}
|
|
2600
|
+
t();
|
|
2601
|
+
} catch (t) {
|
|
2602
|
+
i(t instanceof Error ? t.message : e.stripePaymentFailed);
|
|
2603
|
+
} finally {
|
|
2604
|
+
l(!1);
|
|
2987
2605
|
}
|
|
2988
|
-
}
|
|
2989
|
-
|
|
2990
|
-
|
|
2991
|
-
|
|
2992
|
-
|
|
2993
|
-
|
|
2994
|
-
|
|
2995
|
-
|
|
2996
|
-
|
|
2997
|
-
|
|
2998
|
-
|
|
2999
|
-
|
|
3000
|
-
|
|
3001
|
-
|
|
3002
|
-
|
|
3003
|
-
|
|
3004
|
-
|
|
3005
|
-
|
|
3006
|
-
|
|
3007
|
-
|
|
3008
|
-
|
|
3009
|
-
|
|
3010
|
-
|
|
3011
|
-
|
|
3012
|
-
|
|
3013
|
-
|
|
3014
|
-
|
|
3015
|
-
|
|
3016
|
-
|
|
3017
|
-
|
|
3018
|
-
|
|
3019
|
-
|
|
3020
|
-
|
|
3021
|
-
|
|
3022
|
-
|
|
3023
|
-
|
|
3024
|
-
|
|
3025
|
-
|
|
3026
|
-
|
|
3027
|
-
|
|
3028
|
-
|
|
3029
|
-
|
|
3030
|
-
|
|
3031
|
-
|
|
3032
|
-
|
|
3033
|
-
|
|
3034
|
-
|
|
3035
|
-
|
|
3036
|
-
|
|
3037
|
-
|
|
3038
|
-
|
|
3039
|
-
|
|
3040
|
-
|
|
3041
|
-
|
|
3042
|
-
|
|
3043
|
-
|
|
3044
|
-
|
|
3045
|
-
|
|
3046
|
-
|
|
3047
|
-
|
|
3048
|
-
|
|
3049
|
-
|
|
3050
|
-
|
|
3051
|
-
|
|
3052
|
-
|
|
3053
|
-
|
|
3054
|
-
|
|
3055
|
-
|
|
3056
|
-
|
|
3057
|
-
|
|
3058
|
-
|
|
3059
|
-
|
|
3060
|
-
|
|
3061
|
-
|
|
3062
|
-
|
|
3063
|
-
|
|
3064
|
-
|
|
3065
|
-
|
|
3066
|
-
|
|
3067
|
-
|
|
3068
|
-
|
|
3069
|
-
|
|
3070
|
-
|
|
3071
|
-
|
|
3072
|
-
|
|
3073
|
-
|
|
3074
|
-
|
|
3075
|
-
|
|
3076
|
-
|
|
3077
|
-
|
|
3078
|
-
|
|
3079
|
-
|
|
3080
|
-
|
|
3081
|
-
|
|
3082
|
-
|
|
3083
|
-
|
|
3084
|
-
|
|
3085
|
-
|
|
3086
|
-
|
|
3087
|
-
|
|
3088
|
-
|
|
3089
|
-
|
|
2606
|
+
}
|
|
2607
|
+
},
|
|
2608
|
+
children: [
|
|
2609
|
+
/* @__PURE__ */ B("div", {
|
|
2610
|
+
className: "flex flex-col gap-3",
|
|
2611
|
+
children: [/* @__PURE__ */ z(D.Title, {
|
|
2612
|
+
heading: 6,
|
|
2613
|
+
className: "text-arco-text-1! mb-0!",
|
|
2614
|
+
children: e.stripeContactDetails
|
|
2615
|
+
}), /* @__PURE__ */ z(Mn, {})]
|
|
2616
|
+
}),
|
|
2617
|
+
/* @__PURE__ */ B("div", {
|
|
2618
|
+
className: "flex flex-col gap-3",
|
|
2619
|
+
children: [/* @__PURE__ */ z(D.Title, {
|
|
2620
|
+
heading: 6,
|
|
2621
|
+
className: "text-arco-text-1! mb-0!",
|
|
2622
|
+
children: e.stripePaymentSection
|
|
2623
|
+
}), /* @__PURE__ */ z(jn, { id: "mantur-stripe-payment-element" })]
|
|
2624
|
+
}),
|
|
2625
|
+
/* @__PURE__ */ B(c, {
|
|
2626
|
+
htmlType: "submit",
|
|
2627
|
+
type: "primary",
|
|
2628
|
+
size: "large",
|
|
2629
|
+
className: "w-full!",
|
|
2630
|
+
disabled: !u.canConfirm || s,
|
|
2631
|
+
loading: s,
|
|
2632
|
+
children: [
|
|
2633
|
+
e.stripePay,
|
|
2634
|
+
" · ",
|
|
2635
|
+
d
|
|
2636
|
+
]
|
|
2637
|
+
}),
|
|
2638
|
+
r ? /* @__PURE__ */ z(o, {
|
|
2639
|
+
type: "error",
|
|
2640
|
+
content: r
|
|
2641
|
+
}) : null
|
|
2642
|
+
]
|
|
2643
|
+
});
|
|
2644
|
+
}
|
|
2645
|
+
function or({ visible: e, publishableKey: n, order: s, text: l, onCancel: u, onSuccess: f }) {
|
|
2646
|
+
let { resolvedTheme: p } = V(), [m, h] = a(!1), g = i(!1), _ = s?.clientSecret || s?.stripeClientSecret, v = r(() => n ? tr(n) : null, [n]), b = p === "dark" ? "night" : "flat", x = r(() => _ ? {
|
|
2647
|
+
clientSecret: _,
|
|
2648
|
+
elementsOptions: { appearance: {
|
|
2649
|
+
theme: b,
|
|
2650
|
+
labels: "above"
|
|
2651
|
+
} }
|
|
2652
|
+
} : void 0, [_, b]), S = r(() => [{
|
|
2653
|
+
label: l.stripePaymentTotalAmount,
|
|
2654
|
+
value: ir(s?.amount)
|
|
2655
|
+
}, {
|
|
2656
|
+
label: l.stripePaymentOrderNo,
|
|
2657
|
+
value: s?.orderNo || nr
|
|
2658
|
+
}], [
|
|
2659
|
+
s?.amount,
|
|
2660
|
+
s?.orderNo,
|
|
2661
|
+
l.stripePaymentOrderNo,
|
|
2662
|
+
l.stripePaymentTotalAmount
|
|
2663
|
+
]), C = t(async () => {
|
|
2664
|
+
if (g.current) return;
|
|
2665
|
+
let e = s?.orderNo;
|
|
2666
|
+
if (!e) {
|
|
2667
|
+
u();
|
|
2668
|
+
return;
|
|
2669
|
+
}
|
|
2670
|
+
g.current = !0, h(!0);
|
|
2671
|
+
try {
|
|
2672
|
+
await Ie(e);
|
|
2673
|
+
} catch (e) {
|
|
2674
|
+
console.warn("Failed to cancel Mantur recharge order.", e);
|
|
2675
|
+
} finally {
|
|
2676
|
+
g.current = !1, h(!1), u();
|
|
2677
|
+
}
|
|
2678
|
+
}, [u, s?.orderNo]), w = !n || !v ? /* @__PURE__ */ z(o, {
|
|
2679
|
+
type: "error",
|
|
2680
|
+
content: l.stripePaymentConfigMissing
|
|
2681
|
+
}) : _ ? _.startsWith("cs_") ? x ? /* @__PURE__ */ z(En, {
|
|
2682
|
+
stripe: v,
|
|
2683
|
+
options: x,
|
|
2684
|
+
children: /* @__PURE__ */ z(ar, {
|
|
2685
|
+
text: l,
|
|
2686
|
+
onSuccess: f
|
|
2687
|
+
})
|
|
2688
|
+
}, `${_}-${b}`) : /* @__PURE__ */ z(o, {
|
|
2689
|
+
type: "error",
|
|
2690
|
+
content: l.stripePaymentClientSecretMissing
|
|
2691
|
+
}) : /* @__PURE__ */ z(o, {
|
|
2692
|
+
type: "error",
|
|
2693
|
+
content: l.stripeCheckoutClientSecretInvalid
|
|
2694
|
+
}) : /* @__PURE__ */ z(o, {
|
|
2695
|
+
type: "error",
|
|
2696
|
+
content: l.stripePaymentClientSecretMissing
|
|
2697
|
+
});
|
|
2698
|
+
return /* @__PURE__ */ z(y, {
|
|
2699
|
+
title: l.stripePaymentTitle,
|
|
2700
|
+
visible: e,
|
|
2701
|
+
closeIcon: null,
|
|
2702
|
+
footer: /* @__PURE__ */ z("div", {
|
|
2703
|
+
className: "flex justify-end gap-2 mx-auto max-w-7xl ",
|
|
2704
|
+
children: /* @__PURE__ */ z(c, {
|
|
2705
|
+
size: "large",
|
|
2706
|
+
type: "primary",
|
|
2707
|
+
status: "danger",
|
|
2708
|
+
disabled: m,
|
|
2709
|
+
loading: m,
|
|
2710
|
+
onClick: () => void C(),
|
|
2711
|
+
children: l.close
|
|
2712
|
+
})
|
|
2713
|
+
}),
|
|
2714
|
+
onCancel: () => void C(),
|
|
2715
|
+
alignCenter: !1,
|
|
2716
|
+
wrapStyle: { padding: 0 },
|
|
2717
|
+
style: {
|
|
2718
|
+
width: "100vw",
|
|
2719
|
+
maxWidth: "100vw",
|
|
2720
|
+
height: "100vh",
|
|
2721
|
+
top: 0,
|
|
2722
|
+
margin: 0,
|
|
2723
|
+
padding: 0
|
|
2724
|
+
},
|
|
2725
|
+
className: "top-0! m-0! flex! h-screen! w-screen! max-w-none! flex-col! rounded-none! [&_.arco-modal-body]:min-h-0! [&_.arco-modal-body]:flex-1! [&_.arco-modal-body]:overflow-auto! [&_.arco-modal-content]:flex! [&_.arco-modal-content]:h-full! [&_.arco-modal-content]:flex-col! [&_.arco-modal-content]:rounded-none! [&_.arco-modal-header]:shrink-0!",
|
|
2726
|
+
focusLock: !1,
|
|
2727
|
+
children: /* @__PURE__ */ B("div", {
|
|
2728
|
+
className: "mx-auto flex min-h-full w-full max-w-7xl gap-8 px-6 py-6 lg:px-8",
|
|
2729
|
+
children: [/* @__PURE__ */ z("div", {
|
|
2730
|
+
className: "w-80",
|
|
2731
|
+
children: /* @__PURE__ */ z("div", {
|
|
2732
|
+
className: "bg-arco-bg-1 mx-auto w-full rounded-xl p-6",
|
|
2733
|
+
children: /* @__PURE__ */ z(d, {
|
|
2734
|
+
border: !1,
|
|
2735
|
+
column: 1,
|
|
2736
|
+
data: S,
|
|
2737
|
+
labelStyle: { width: 96 }
|
|
2738
|
+
})
|
|
2739
|
+
})
|
|
2740
|
+
}), /* @__PURE__ */ z("div", {
|
|
2741
|
+
className: "min-w-0 flex-1",
|
|
2742
|
+
children: /* @__PURE__ */ z("div", {
|
|
2743
|
+
className: "bg-arco-bg-1 mx-auto w-full max-w-2xl rounded-xl p-6",
|
|
2744
|
+
children: w
|
|
2745
|
+
})
|
|
2746
|
+
})]
|
|
2747
|
+
})
|
|
2748
|
+
});
|
|
2749
|
+
}
|
|
2750
|
+
//#endregion
|
|
2751
|
+
//#region src/header/components/UserMenu.tsx
|
|
2752
|
+
function sr({ user: e, text: t, onEditProfile: n, onLogout: r }) {
|
|
2753
|
+
return /* @__PURE__ */ B("div", {
|
|
2754
|
+
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%)]",
|
|
2755
|
+
children: [
|
|
2756
|
+
/* @__PURE__ */ B("div", {
|
|
2757
|
+
className: "flex items-center gap-3 px-6 pt-5 pb-4",
|
|
2758
|
+
children: [/* @__PURE__ */ z(Nt, {
|
|
2759
|
+
user: e,
|
|
2760
|
+
size: 48,
|
|
2761
|
+
className: "shrink-0"
|
|
2762
|
+
}), /* @__PURE__ */ B("div", {
|
|
2763
|
+
className: "flex min-w-0 flex-1 flex-col gap-1",
|
|
2764
|
+
children: [/* @__PURE__ */ B("div", {
|
|
2765
|
+
className: "flex min-w-0 items-center gap-1.5",
|
|
2766
|
+
children: [/* @__PURE__ */ z("span", {
|
|
2767
|
+
className: "text-arco-text-1 truncate text-base leading-6 font-bold",
|
|
2768
|
+
children: e?.nickname || e?.username
|
|
2769
|
+
}), /* @__PURE__ */ z(c, {
|
|
2770
|
+
type: "text",
|
|
2771
|
+
size: "mini",
|
|
2772
|
+
icon: /* @__PURE__ */ z(j, {}),
|
|
2773
|
+
className: "text-arco-text-3 h-6! min-w-6! px-0!",
|
|
2774
|
+
onClick: n
|
|
2775
|
+
})]
|
|
2776
|
+
}), e?.email ? /* @__PURE__ */ z("span", {
|
|
2777
|
+
className: "text-arco-text-3 truncate text-xs leading-5",
|
|
2778
|
+
children: e.email
|
|
2779
|
+
}) : null]
|
|
2780
|
+
})]
|
|
2781
|
+
}),
|
|
2782
|
+
/* @__PURE__ */ z(f, { className: "m-0!" }),
|
|
2783
|
+
/* @__PURE__ */ z("div", {
|
|
2784
|
+
className: "px-6 py-4",
|
|
2785
|
+
children: /* @__PURE__ */ z(c, {
|
|
2786
|
+
icon: /* @__PURE__ */ z(F, {}),
|
|
2787
|
+
type: "text",
|
|
2788
|
+
status: "danger",
|
|
2789
|
+
long: !0,
|
|
2790
|
+
className: "flex! items-center justify-start gap-2 text-sm text-arco-text-2",
|
|
2791
|
+
onClick: () => void r?.(),
|
|
2792
|
+
children: t.logout
|
|
2793
|
+
})
|
|
2794
|
+
})
|
|
2795
|
+
]
|
|
2796
|
+
});
|
|
2797
|
+
}
|
|
2798
|
+
//#endregion
|
|
2799
|
+
//#region src/header/ManturHeader.tsx
|
|
2800
|
+
var cr = "https://mantur.ai/images/logo.png", lr = [
|
|
2801
|
+
"from-arco-primary-light-1 to-arco-primary-light-2 text-arco-primary-6",
|
|
2802
|
+
"from-arco-success-light-1 to-arco-success-light-2 text-arco-success-6",
|
|
2803
|
+
"from-arco-warning-light-1 to-arco-warning-light-2 text-arco-warning-6",
|
|
2804
|
+
"from-arco-danger-light-1 to-arco-danger-light-2 text-arco-danger-6"
|
|
2805
|
+
];
|
|
2806
|
+
function ur(e, t = !1) {
|
|
2807
|
+
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 ${lr[e % lr.length]} ${t ? "shadow-[inset_0_1px_3px_rgb(0_0_0/8%)]" : ""}`;
|
|
2808
|
+
}
|
|
2809
|
+
function dr(e) {
|
|
2810
|
+
return e?.tenantName?.[0]?.toUpperCase() || "T";
|
|
2811
|
+
}
|
|
2812
|
+
function fr(e, t, n) {
|
|
2813
|
+
let r = e?.roles?.map((e) => e.roleName).filter(Boolean);
|
|
2814
|
+
return r?.length ? r.join(", ") : e?.isOwner ? t : n;
|
|
2815
|
+
}
|
|
2816
|
+
function pr({ user: e, disabled: o = !1, brandSlot: s, children: c, onTenantContextChange: l, appName: u, mainPrefix: d, stripePublishableKey: f }) {
|
|
2817
|
+
let [m, h] = a(() => nt()), g = rt(m), [y, b] = a(!1), [x, S] = a(!1), [C, w] = a(!1), [T, D] = a(e), [O, k] = a([]), [j, M] = a(), [N, P] = a(!1), [F, I] = a(!1), [L, R] = a(!1), [V, ee] = a([]), [te, ne] = a(), re = i(l), ie = f || (typeof window < "u" ? window.__MANTUR_COMPONENTS_STRIPE_PUBLISHABLE_KEY__ : void 0) || "pk_test_51TJ8JiERSsQknDG7bJSIX81RFq3LcCfUXCV7mh0cQsZ2dwmYcJ5Ki6bPXynNvdyZEEBE83I6I719NIFyO9Qreey700yPAul8sv", ae = d ?? (typeof window < "u" ? window.__MANTUR_MAIN_PREFIX__ : void 0) ?? void 0, [H, oe] = a({
|
|
2818
|
+
total: 0,
|
|
2819
|
+
recharge: 0,
|
|
2820
|
+
gifted: 0
|
|
2821
|
+
}), U = j?.tenantId || "", W = o, G = {
|
|
2822
|
+
total: H.total ?? 0,
|
|
2823
|
+
recharge: H.recharge ?? 0,
|
|
2824
|
+
gifted: H.gifted ?? 0
|
|
2825
|
+
}, se = async (e) => {
|
|
2826
|
+
let t = await ke(e);
|
|
2827
|
+
return t && D(t), t;
|
|
2828
|
+
};
|
|
2829
|
+
n(() => {
|
|
2830
|
+
D(e);
|
|
2831
|
+
}, [e]), n(() => {
|
|
2832
|
+
re.current = l;
|
|
2833
|
+
}, [l]);
|
|
2834
|
+
let K = t((e) => {
|
|
2835
|
+
k(e.tenants), M(e.currentTenant), re.current?.(e);
|
|
2836
|
+
}, []);
|
|
2837
|
+
n(() => {
|
|
2838
|
+
P(!0), Ke().then(K).catch((e) => {
|
|
2839
|
+
console.warn("Failed to refresh Mantur tenant context.", e), v.error(g.error);
|
|
2840
|
+
}).finally(() => P(!1));
|
|
2841
|
+
}, [K, g.error]), n(() => {
|
|
2842
|
+
let e = (e) => {
|
|
2843
|
+
e instanceof CustomEvent && oe(e.detail);
|
|
2844
|
+
};
|
|
2845
|
+
return window.addEventListener(ye, e), Me().catch((e) => {
|
|
2846
|
+
console.warn("Failed to refresh Mantur user points.", e);
|
|
2847
|
+
}), () => {
|
|
2848
|
+
window.removeEventListener(ye, e);
|
|
2849
|
+
};
|
|
2850
|
+
}, []), n(() => {
|
|
2851
|
+
let e = (e) => {
|
|
2852
|
+
h(e instanceof CustomEvent ? J(e.detail) : nt());
|
|
2853
|
+
};
|
|
2854
|
+
return window.addEventListener(et, e), window.addEventListener("storage", e), () => {
|
|
2855
|
+
window.removeEventListener(et, e), window.removeEventListener("storage", e);
|
|
2856
|
+
};
|
|
2857
|
+
}, []), n(() => {
|
|
2858
|
+
x && (I(!0), Ne().then((e) => {
|
|
2859
|
+
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) => ({
|
|
2860
|
+
id: e.id,
|
|
2861
|
+
packageCode: e.packageCode,
|
|
2862
|
+
packageName: e.packageName,
|
|
2863
|
+
packageNameEn: e.packageNameEn,
|
|
2864
|
+
price: Number(e.amount || 0),
|
|
2865
|
+
points: Number(e.points || 0),
|
|
2866
|
+
recommended: e.isRecommended,
|
|
2867
|
+
sortOrder: e.sortOrder
|
|
2868
|
+
}));
|
|
2869
|
+
t.length > 0 && ee(t);
|
|
2870
|
+
}).catch((e) => {
|
|
2871
|
+
console.warn("Failed to load Mantur recharge packages.", e);
|
|
2872
|
+
}).finally(() => I(!1)));
|
|
2873
|
+
}, [x]);
|
|
2874
|
+
let ce = (e) => {
|
|
2875
|
+
v.success(e);
|
|
2876
|
+
}, le = (e, t) => {
|
|
2877
|
+
console.error(t), v.error(e);
|
|
2878
|
+
}, ue = t(async (e) => {
|
|
2879
|
+
if (!W && e !== U) try {
|
|
2880
|
+
P(!0), K(await qe(e)), ce(g.switchedToTeam);
|
|
2881
|
+
} catch (e) {
|
|
2882
|
+
le(g.error, e);
|
|
2883
|
+
} finally {
|
|
2884
|
+
P(!1);
|
|
2885
|
+
}
|
|
2886
|
+
}, [
|
|
2887
|
+
K,
|
|
2888
|
+
U,
|
|
2889
|
+
W,
|
|
2890
|
+
g.error,
|
|
2891
|
+
g.switchedToTeam
|
|
2892
|
+
]), de = async (e) => {
|
|
2893
|
+
let t = u?.trim();
|
|
2894
|
+
try {
|
|
2895
|
+
R(!0);
|
|
2896
|
+
let n = await Pe({
|
|
2897
|
+
..."custom" in e && e.custom ? { customAmount: e.price } : { packageId: e.id },
|
|
2898
|
+
...t ? { app: t } : {},
|
|
2899
|
+
uiMode: "elements"
|
|
2900
|
+
});
|
|
2901
|
+
if (!n) {
|
|
2902
|
+
v.error(g.stripePaymentClientSecretMissing);
|
|
2903
|
+
return;
|
|
2904
|
+
}
|
|
2905
|
+
typeof window < "u" && window.dispatchEvent(new CustomEvent(be, { detail: n })), v.success(g.rechargeOrderCreated), S(!1), ne(n);
|
|
2906
|
+
} catch (e) {
|
|
2907
|
+
le(g.error, e);
|
|
2908
|
+
} finally {
|
|
2909
|
+
R(!1);
|
|
2910
|
+
}
|
|
2911
|
+
}, fe = t(() => {
|
|
2912
|
+
he(ae);
|
|
2913
|
+
}, [ae]), pe = r(() => /* @__PURE__ */ B(_, {
|
|
2914
|
+
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",
|
|
2915
|
+
selectedKeys: U ? [U] : [],
|
|
2916
|
+
onClickMenuItem: ue,
|
|
2917
|
+
children: [/* @__PURE__ */ z("div", {
|
|
2918
|
+
className: "px-3 py-2 text-xs font-semibold tracking-[0.04em] text-arco-text-4 uppercase",
|
|
2919
|
+
children: g.switchTeam
|
|
2920
|
+
}), O.map((e, t) => /* @__PURE__ */ z(_.Item, {
|
|
2921
|
+
className: "mb-1 h-auto! min-h-10! overflow-visible! rounded-lg! px-2! py-1! leading-normal!",
|
|
2922
|
+
children: /* @__PURE__ */ B("div", {
|
|
2923
|
+
className: "flex w-full items-center gap-3 leading-normal",
|
|
2924
|
+
children: [/* @__PURE__ */ z("div", {
|
|
2925
|
+
className: ur(t),
|
|
2926
|
+
children: dr(e)
|
|
2927
|
+
}), /* @__PURE__ */ B("div", {
|
|
2928
|
+
className: "flex min-w-0 flex-col justify-center gap-0.75",
|
|
2929
|
+
children: [/* @__PURE__ */ z("span", {
|
|
2930
|
+
className: "text-sm leading-5 font-medium text-arco-text-1",
|
|
2931
|
+
children: e.tenantName
|
|
2932
|
+
}), /* @__PURE__ */ z("span", {
|
|
2933
|
+
className: "text-xs leading-4 text-arco-text-3",
|
|
2934
|
+
children: fr(e, g.owner, g.member)
|
|
2935
|
+
})]
|
|
2936
|
+
})]
|
|
2937
|
+
})
|
|
2938
|
+
}, e.tenantId))]
|
|
2939
|
+
}), [
|
|
2940
|
+
ue,
|
|
2941
|
+
U,
|
|
2942
|
+
O,
|
|
2943
|
+
g
|
|
2944
|
+
]), me = /* @__PURE__ */ z(sr, {
|
|
2945
|
+
user: T,
|
|
2946
|
+
points: G,
|
|
2947
|
+
text: g,
|
|
2948
|
+
onEditProfile: () => b(!0),
|
|
2949
|
+
onRecharge: () => S(!0),
|
|
2950
|
+
onPointsDetail: () => w(!0),
|
|
2951
|
+
onLogout: Oe
|
|
2952
|
+
}), ge = Math.max(0, O.findIndex((e) => e.tenantId === j?.tenantId));
|
|
2953
|
+
return /* @__PURE__ */ B("div", {
|
|
2954
|
+
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",
|
|
2955
|
+
children: [
|
|
2956
|
+
/* @__PURE__ */ B("div", {
|
|
2957
|
+
className: "flex items-center gap-6",
|
|
2958
|
+
children: [/* @__PURE__ */ B("div", {
|
|
2959
|
+
className: "flex w-65 items-center gap-3 px-8 max-md:w-auto max-md:px-4",
|
|
2960
|
+
children: [/* @__PURE__ */ z(E, {
|
|
2961
|
+
content: g.home,
|
|
2962
|
+
position: "bottom",
|
|
2963
|
+
children: /* @__PURE__ */ z("button", {
|
|
2964
|
+
type: "button",
|
|
2965
|
+
"aria-label": g.home,
|
|
2966
|
+
className: "relative flex w-12 cursor-pointer items-center justify-center overflow-hidden rounded-md border-0 bg-transparent p-0 transition-opacity hover:opacity-80 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-arco-primary-6",
|
|
2967
|
+
onClick: fe,
|
|
2968
|
+
children: /* @__PURE__ */ z("img", {
|
|
2969
|
+
src: cr,
|
|
2970
|
+
alt: "logo",
|
|
2971
|
+
className: "w-full object-contain",
|
|
2972
|
+
onError: (e) => {
|
|
2973
|
+
e.currentTarget.style.display = "none";
|
|
2974
|
+
}
|
|
2975
|
+
})
|
|
2976
|
+
})
|
|
2977
|
+
}), s ?? /* @__PURE__ */ z("span", {
|
|
2978
|
+
className: "text-lg font-bold tracking-normal text-arco-text-1",
|
|
2979
|
+
children: g.title
|
|
2980
|
+
})]
|
|
2981
|
+
}), /* @__PURE__ */ z(p, {
|
|
2982
|
+
droplist: pe,
|
|
2983
|
+
trigger: "click",
|
|
2984
|
+
position: "bl",
|
|
2985
|
+
disabled: W,
|
|
2986
|
+
children: /* @__PURE__ */ B("div", {
|
|
2987
|
+
"aria-disabled": W,
|
|
2988
|
+
className: `flex items-center gap-3 rounded-full border border-arco-border-1 bg-arco-bg-1 px-2 py-1.5 transition-all ${W ? "cursor-not-allowed opacity-60" : "cursor-pointer hover:bg-arco-fill-2 hover:shadow-[0_4px_12px_rgb(0_0_0/8%)]"}`,
|
|
2989
|
+
children: [
|
|
2990
|
+
/* @__PURE__ */ z("div", {
|
|
2991
|
+
className: ur(ge, !0),
|
|
2992
|
+
children: dr(j)
|
|
2993
|
+
}),
|
|
2994
|
+
/* @__PURE__ */ B("div", {
|
|
2995
|
+
className: "flex min-w-0 flex-col",
|
|
2996
|
+
children: [/* @__PURE__ */ z("span", {
|
|
2997
|
+
className: "text-xs leading-none font-bold text-arco-text-1",
|
|
2998
|
+
children: N ? g.loading : j?.tenantName || g.loading
|
|
2999
|
+
}), /* @__PURE__ */ z("span", {
|
|
3000
|
+
className: "mt-1 text-[10px] leading-none text-arco-text-3",
|
|
3001
|
+
children: fr(j, g.owner, g.member)
|
|
3002
|
+
})]
|
|
3003
|
+
}),
|
|
3004
|
+
/* @__PURE__ */ z(A, { className: "ml-1 text-arco-text-3" })
|
|
3005
|
+
]
|
|
3006
|
+
})
|
|
3007
|
+
})]
|
|
3008
|
+
}),
|
|
3009
|
+
/* @__PURE__ */ z("div", {
|
|
3010
|
+
className: "flex-1",
|
|
3011
|
+
children: c
|
|
3012
|
+
}),
|
|
3013
|
+
/* @__PURE__ */ B("div", {
|
|
3014
|
+
className: "flex items-center gap-4",
|
|
3015
|
+
children: [/* @__PURE__ */ B("div", {
|
|
3016
|
+
className: "flex items-center gap-4",
|
|
3017
|
+
children: [/* @__PURE__ */ z(ct, {}), /* @__PURE__ */ z(st, {})]
|
|
3018
|
+
}), /* @__PURE__ */ z(p, {
|
|
3019
|
+
droplist: me,
|
|
3020
|
+
trigger: "click",
|
|
3021
|
+
position: "br",
|
|
3022
|
+
onVisibleChange: (e) => {
|
|
3023
|
+
e && Me().catch((e) => {
|
|
3024
|
+
console.warn("Failed to refresh Mantur user points.", e);
|
|
3025
|
+
});
|
|
3026
|
+
},
|
|
3027
|
+
children: /* @__PURE__ */ B("div", {
|
|
3028
|
+
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",
|
|
3029
|
+
children: [
|
|
3030
|
+
/* @__PURE__ */ B("div", {
|
|
3031
|
+
className: "from-arco-primary to-transparent relative rounded-full bg-linear-to-br p-0.5 shadow-sm",
|
|
3032
|
+
children: [/* @__PURE__ */ z(Nt, {
|
|
3033
|
+
user: T,
|
|
3034
|
+
size: 36
|
|
3035
|
+
}), /* @__PURE__ */ z("div", { className: "bg-arco-success border-arco-bg-white absolute right-0 bottom-0 h-3 w-3 rounded-full border-2 shadow-sm" })]
|
|
3036
|
+
}),
|
|
3037
|
+
/* @__PURE__ */ z("div", {
|
|
3038
|
+
className: "hidden flex-col md:flex",
|
|
3039
|
+
children: /* @__PURE__ */ z("span", {
|
|
3040
|
+
className: "text-arco-text-1 text-sm font-medium",
|
|
3041
|
+
children: T?.nickname || T?.username
|
|
3042
|
+
})
|
|
3043
|
+
}),
|
|
3044
|
+
/* @__PURE__ */ z(A, { className: "text-arco-text-3 ml-1" })
|
|
3045
|
+
]
|
|
3046
|
+
})
|
|
3047
|
+
})]
|
|
3048
|
+
}),
|
|
3049
|
+
/* @__PURE__ */ z(At, {
|
|
3050
|
+
visible: y,
|
|
3051
|
+
user: T,
|
|
3052
|
+
labels: g,
|
|
3053
|
+
onCancel: () => b(!1),
|
|
3054
|
+
onSubmit: se
|
|
3055
|
+
}),
|
|
3056
|
+
/* @__PURE__ */ z(It, {
|
|
3057
|
+
visible: x,
|
|
3058
|
+
user: T,
|
|
3059
|
+
points: G,
|
|
3060
|
+
text: g,
|
|
3061
|
+
packages: V,
|
|
3062
|
+
packageLoading: F,
|
|
3063
|
+
submitting: L,
|
|
3064
|
+
onCancel: () => S(!1),
|
|
3065
|
+
onPay: de
|
|
3066
|
+
}),
|
|
3067
|
+
/* @__PURE__ */ z(wt, {
|
|
3068
|
+
visible: C,
|
|
3069
|
+
points: G,
|
|
3070
|
+
text: g,
|
|
3071
|
+
onCancel: () => w(!1),
|
|
3072
|
+
onRecharge: () => S(!0)
|
|
3073
|
+
}),
|
|
3074
|
+
/* @__PURE__ */ z(or, {
|
|
3075
|
+
visible: !!te,
|
|
3076
|
+
publishableKey: ie,
|
|
3077
|
+
order: te,
|
|
3078
|
+
text: g,
|
|
3079
|
+
onCancel: () => ne(void 0),
|
|
3080
|
+
onSuccess: () => {
|
|
3081
|
+
v.success(g.rechargeSuccess), ne(void 0), Me().catch((e) => {
|
|
3082
|
+
console.warn("Failed to refresh Mantur user points.", e);
|
|
3083
|
+
});
|
|
3090
3084
|
}
|
|
3091
|
-
|
|
3092
|
-
|
|
3093
|
-
|
|
3094
|
-
}, _.$locale = function() {
|
|
3095
|
-
return b[this.$L];
|
|
3096
|
-
}, _.locale = function(e, t) {
|
|
3097
|
-
if (!e) return this.$L;
|
|
3098
|
-
var n = this.clone(), r = C(e, t, !0);
|
|
3099
|
-
return r && (n.$L = r), n;
|
|
3100
|
-
}, _.clone = function() {
|
|
3101
|
-
return T.w(this.$d, this);
|
|
3102
|
-
}, _.toDate = function() {
|
|
3103
|
-
return new Date(this.valueOf());
|
|
3104
|
-
}, _.toJSON = function() {
|
|
3105
|
-
return this.isValid() ? this.toISOString() : null;
|
|
3106
|
-
}, _.toISOString = function() {
|
|
3107
|
-
return this.$d.toISOString();
|
|
3108
|
-
}, _.toString = function() {
|
|
3109
|
-
return this.$d.toUTCString();
|
|
3110
|
-
}, g;
|
|
3111
|
-
}(), D = E.prototype;
|
|
3112
|
-
return w.prototype = D, [
|
|
3113
|
-
["$ms", r],
|
|
3114
|
-
["$s", i],
|
|
3115
|
-
["$m", a],
|
|
3116
|
-
["$H", o],
|
|
3117
|
-
["$W", s],
|
|
3118
|
-
["$M", l],
|
|
3119
|
-
["$y", d],
|
|
3120
|
-
["$D", f]
|
|
3121
|
-
].forEach((function(e) {
|
|
3122
|
-
D[e[1]] = function(t) {
|
|
3123
|
-
return this.$g(t, e[0], e[1]);
|
|
3124
|
-
};
|
|
3125
|
-
})), w.extend = function(e, t) {
|
|
3126
|
-
return e.$i ||= (e(t, E, w), !0), w;
|
|
3127
|
-
}, w.locale = C, w.isDayjs = S, w.unix = function(e) {
|
|
3128
|
-
return w(1e3 * e);
|
|
3129
|
-
}, w.en = b[y], w.Ls = b, w.p = {}, w;
|
|
3130
|
-
}));
|
|
3131
|
-
})))(), 1);
|
|
3132
|
-
function mr(e, t = "datetime", n) {
|
|
3133
|
-
if (!e) return "-";
|
|
3134
|
-
let r = (n ? Y(n) : nt()).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";
|
|
3135
|
-
return (0, pr.default)(e).format(i);
|
|
3085
|
+
})
|
|
3086
|
+
]
|
|
3087
|
+
});
|
|
3136
3088
|
}
|
|
3137
3089
|
//#endregion
|
|
3138
3090
|
//#region src/utils/stripe-payment-window.ts
|
|
3139
|
-
var
|
|
3140
|
-
function
|
|
3091
|
+
var mr = "mantur-stripe-payment-window", hr = "/stripe-payment";
|
|
3092
|
+
function gr(e) {
|
|
3141
3093
|
if (!e || typeof e != "object") return !1;
|
|
3142
3094
|
let t = e;
|
|
3143
3095
|
return t.source === "mantur-components" && t.type === "mantur-stripe-payment-window" && (t.action === "close" || t.action === "success" || t.action === "failed");
|
|
3144
3096
|
}
|
|
3145
|
-
function
|
|
3097
|
+
function _r(e = "close", t, n = typeof window > "u" ? void 0 : window.location.origin) {
|
|
3146
3098
|
if (typeof window > "u" || !n) return;
|
|
3147
3099
|
let r = {
|
|
3148
3100
|
source: "mantur-components",
|
|
3149
|
-
type:
|
|
3101
|
+
type: mr,
|
|
3150
3102
|
action: e,
|
|
3151
3103
|
orderNo: t
|
|
3152
3104
|
};
|
|
3153
3105
|
window.opener?.postMessage(r, n), window.parent && window.parent !== window && window.parent.postMessage(r, n);
|
|
3154
3106
|
}
|
|
3155
|
-
function
|
|
3107
|
+
function vr() {
|
|
3156
3108
|
return typeof window > "u" ? void 0 : window.__MANTUR_MAIN_PREFIX__ || void 0;
|
|
3157
3109
|
}
|
|
3158
|
-
function
|
|
3110
|
+
function yr() {
|
|
3159
3111
|
return typeof window > "u" ? "mantur" : window.__MANTUR_APP_NAME__ || "mantur";
|
|
3160
3112
|
}
|
|
3161
|
-
function
|
|
3113
|
+
function br(e, t) {
|
|
3162
3114
|
let n = e.split(".");
|
|
3163
3115
|
return n.length <= 1 ? t : [t, ...n.slice(1)].join(".");
|
|
3164
3116
|
}
|
|
3165
|
-
function
|
|
3166
|
-
let t = new URL(e.toString()), n =
|
|
3167
|
-
return n &&
|
|
3117
|
+
function xr(e) {
|
|
3118
|
+
let t = new URL(e.toString()), n = vr()?.trim();
|
|
3119
|
+
return n && yr() !== "mantur" && (t.hostname = br(e.hostname, n)), t.port = "", t.toString();
|
|
3168
3120
|
}
|
|
3169
|
-
function
|
|
3121
|
+
function Sr(e, t = {}) {
|
|
3170
3122
|
let n = e.clientSecret || e.stripeClientSecret;
|
|
3171
3123
|
if (typeof window > "u" || !e.orderNo || !n) return;
|
|
3172
|
-
let r = new URL(
|
|
3173
|
-
return r.searchParams.set("orderNo", e.orderNo), r.searchParams.set("clientSecret", n), r.searchParams.set("openerOrigin", window.location.origin), r.searchParams.set("app", a), r.searchParams.set("redirect", o), e.amount !== void 0 && r.searchParams.set("amount", String(e.amount)), e.points !== void 0 && r.searchParams.set("points", String(e.points)), t.stripePublishableKey && r.searchParams.set("publishableKey", t.stripePublishableKey),
|
|
3124
|
+
let r = new URL(hr, window.location.href), i = pe(), a = t.app || i.app, o = t.redirect || i.redirect;
|
|
3125
|
+
return r.searchParams.set("orderNo", e.orderNo), r.searchParams.set("clientSecret", n), r.searchParams.set("openerOrigin", window.location.origin), r.searchParams.set("app", a), r.searchParams.set("redirect", o), e.amount !== void 0 && r.searchParams.set("amount", String(e.amount)), e.points !== void 0 && r.searchParams.set("points", String(e.points)), t.stripePublishableKey && r.searchParams.set("publishableKey", t.stripePublishableKey), xr(r);
|
|
3174
3126
|
}
|
|
3175
|
-
function
|
|
3176
|
-
return
|
|
3127
|
+
function Cr(e, t = {}) {
|
|
3128
|
+
return Sr(e, t) || e.paymentUrl || e.checkoutUrl || e.url || e.returnUrl;
|
|
3177
3129
|
}
|
|
3178
3130
|
//#endregion
|
|
3179
|
-
export { ye as MANTUR_POINTS_REFRESH_EVENT, be as MANTUR_RECHARGE_ORDER_CREATED_EVENT,
|
|
3131
|
+
export { ye as MANTUR_POINTS_REFRESH_EVENT, be as MANTUR_RECHARGE_ORDER_CREATED_EVENT, hr as MANTUR_STRIPE_PAYMENT_ROUTE, mr as MANTUR_STRIPE_PAYMENT_WINDOW_MESSAGE_TYPE, xe as MANTUR_TENANT_CONTEXT_CHANGE_EVENT, pr as ManturHeader, Ie as cancelManturRechargeOrder, Pe as createManturRechargeOrder, ut as formatDateByLang, ze as getManturBillingAccount, Be as getManturBillingLedger, Ne as getManturBillingPackages, Re as getManturPricingChargePoint, Le as getManturPricingChargePoints, Fe as getManturRechargeOrder, pe as getManturRechargeRedirectContext, gr as isManturStripePaymentWindowMessage, _r as postManturStripePaymentWindowMessage, ge as redirectToManturMain, he as redirectToManturMainHome, Ke as refreshManturTenantContext, Me as refreshManturUserPoints, me as resolveManturMainHomeUrl, Cr as resolveManturRechargePaymentPageUrl, Sr as resolveManturStripePaymentPageUrl };
|