@fluid-app/fluid-cli-theme-dev 0.1.171 → 0.1.173
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.
- package/dist/dist-cli-preview/.vite/manifest.json +583 -181
- package/dist/dist-cli-preview/account-screens.css +1 -0
- package/dist/dist-cli-preview/account-screens.js +1 -1
- package/dist/dist-cli-preview/chunks/{Breadcrumb-BQKo8hPc.js → Breadcrumb-8-7shsB6.js} +1 -1
- package/dist/dist-cli-preview/chunks/Combobox-m3vSk0_A.js +521 -0
- package/dist/dist-cli-preview/chunks/{ContactsScreen-IsIZ_lQ0.js → ContactsScreen-CBjQOWmH.js} +1523 -1854
- package/dist/dist-cli-preview/chunks/MediaScreen-1akMnH12.js +17379 -0
- package/dist/dist-cli-preview/chunks/{MemberManagementProviders-DiQkiWzc.js → MemberManagementProviders-WSjb3a8B.js} +189 -199
- package/dist/dist-cli-preview/chunks/{MessagingScreen-B8ZxAE0L.js → MessagingScreen-By-jZq6v.js} +27645 -30195
- package/dist/dist-cli-preview/chunks/{MobileActionSheet-DMeTsLlK.js → MobileActionSheet-ERpw3qUF.js} +644 -589
- package/dist/dist-cli-preview/chunks/MySiteScreen-JAGvVMx-.js +1706 -0
- package/dist/dist-cli-preview/chunks/OrdersScreen-B1HQVMZC.js +9 -0
- package/dist/dist-cli-preview/chunks/{OrdersScreen-DrZ3SwEu.js → OrdersScreen-Cb32bBjd.js} +35 -35
- package/dist/dist-cli-preview/chunks/PortalTenantClientProvider-CguU_uRG.js +15 -0
- package/dist/dist-cli-preview/chunks/{ProfileScreen-Dxspc-6p.js → ProfileScreen-CCWM6TBs.js} +454 -463
- package/dist/dist-cli-preview/chunks/Select-5fzq5MB-.js +940 -0
- package/dist/dist-cli-preview/chunks/{SubscriptionsScreen-Be0C29uw.js → SubscriptionsScreen-DLdsaVJK.js} +3 -3
- package/dist/dist-cli-preview/chunks/Textarea-xoKqLVgY.js +330 -0
- package/dist/dist-cli-preview/chunks/{account-screen-runtime-DYMunv0A.js → account-screen-runtime-CCBl8DXt.js} +866 -860
- package/dist/dist-cli-preview/chunks/ar-D6LJV1_E.js +679 -0
- package/dist/dist-cli-preview/chunks/{arrow-left-Bd7dJtIV.js → arrow-left-CTYaRdTX.js} +1 -1
- package/dist/dist-cli-preview/chunks/bg-C5Ldmily.js +679 -0
- package/dist/dist-cli-preview/chunks/bn-kfMPWNR6.js +679 -0
- package/dist/dist-cli-preview/chunks/{cli-preview-C7Db08Ij.js → cli-preview-HAt0Lt-9.js} +20 -13
- package/dist/dist-cli-preview/chunks/{client.gen-Ck6Pm2jV.js → client.gen-B7RMYGYu.js} +1 -1
- package/dist/dist-cli-preview/chunks/copy-DHN1DxE_.js +14 -0
- package/dist/dist-cli-preview/chunks/{countries-api-adapter-InKUzF1q.js → countries-api-adapter-B4TefdRP.js} +2 -2
- package/dist/dist-cli-preview/chunks/{create-card-entry-container-C9z7JILL.js → create-card-entry-container-5NqOQ4D_.js} +3612 -3932
- package/dist/dist-cli-preview/chunks/cs-DqEgtV8D.js +679 -0
- package/dist/dist-cli-preview/chunks/da-BbuvL7Gx.js +679 -0
- package/dist/dist-cli-preview/chunks/de-BfJ7rQig.js +679 -0
- package/dist/dist-cli-preview/chunks/el-BO0rLq6D.js +679 -0
- package/dist/dist-cli-preview/chunks/es-BEVtEUXk.js +679 -0
- package/dist/dist-cli-preview/chunks/eye-qMoMW7-Z.js +20 -0
- package/dist/dist-cli-preview/chunks/fi-DjISV3UN.js +679 -0
- package/dist/dist-cli-preview/chunks/fr-1fFd-aKy.js +679 -0
- package/dist/dist-cli-preview/chunks/he-CaT9bwVp.js +679 -0
- package/dist/dist-cli-preview/chunks/{hey-api-client-DGRBsZ7Y.js → hey-api-client-JMNyZwcF.js} +79 -39
- package/dist/dist-cli-preview/chunks/hi-DkzEm57l.js +679 -0
- package/dist/dist-cli-preview/chunks/hr-DqM5N_bj.js +679 -0
- package/dist/dist-cli-preview/chunks/hu-DiLqjo5c.js +679 -0
- package/dist/dist-cli-preview/chunks/id-DA1KmwgX.js +679 -0
- package/dist/dist-cli-preview/chunks/index-BS4PnEcu.js +353 -0
- package/dist/dist-cli-preview/chunks/index-BhMjUmAr.js +2572 -0
- package/dist/dist-cli-preview/chunks/{screen-route-slug-utils-BDjSpDoe.js → index-Dor8vM2o.js} +2417 -3035
- package/dist/dist-cli-preview/chunks/it-CTEVWCRz.js +679 -0
- package/dist/dist-cli-preview/chunks/ja-fxqg1hhg.js +679 -0
- package/dist/dist-cli-preview/chunks/ko-Btp1_5YS.js +679 -0
- package/dist/dist-cli-preview/chunks/lock-DQTMeEw0.js +14 -0
- package/dist/dist-cli-preview/chunks/{log-out-CSPZjXTK.js → log-out-DUdRJX4l.js} +1 -1
- package/dist/dist-cli-preview/chunks/{map-pin-B2ScoijR.js → map-pin-DyIkpqP0.js} +1 -1
- package/dist/dist-cli-preview/chunks/media-vkLeBb90.js +4 -0
- package/dist/dist-cli-preview/chunks/member-permissions-ndhNmlOk.js +19 -0
- package/dist/dist-cli-preview/chunks/{mount-account-screen-5thBUz3X.js → mount-account-screen--gdc5WO_.js} +1869 -1884
- package/dist/dist-cli-preview/chunks/ms-DqRbmHx8.js +679 -0
- package/dist/dist-cli-preview/chunks/navigate-account-screen-AVNopuIP.js +38 -0
- package/dist/dist-cli-preview/chunks/nl-CkPNddxO.js +679 -0
- package/dist/dist-cli-preview/chunks/no-ftcy0RcQ.js +679 -0
- package/dist/dist-cli-preview/chunks/pl-wyJLqfip.js +679 -0
- package/dist/dist-cli-preview/chunks/{plus-CocoE5gC.js → plus-DZjrp536.js} +1 -1
- package/dist/dist-cli-preview/chunks/pt-7uHLacuI.js +679 -0
- package/dist/dist-cli-preview/chunks/ro-Dh12ghww.js +679 -0
- package/dist/dist-cli-preview/chunks/ru-DFM7xWFz.js +679 -0
- package/dist/dist-cli-preview/chunks/{schemas-D94nZk5x.js → schemas-BTblatUV.js} +1107 -1062
- package/dist/dist-cli-preview/chunks/screen-route-slug-utils-DozJp-uc.js +620 -0
- package/dist/dist-cli-preview/chunks/{sheet-haptics-context-iOjKcNDj.js → sheet-haptics-context-CYrEaGtf.js} +3 -3
- package/dist/dist-cli-preview/chunks/sidebar-9qopXeR1.js +598 -0
- package/dist/dist-cli-preview/chunks/sk-CsuNYa1k.js +679 -0
- package/dist/dist-cli-preview/chunks/sortable.esm-Dlen88Fc.js +3283 -0
- package/dist/dist-cli-preview/chunks/{store-api-context-B96Ip2FB.js → store-api-context-B9pW_xao.js} +1 -1
- package/dist/dist-cli-preview/chunks/sv-DVrPaJbh.js +679 -0
- package/dist/dist-cli-preview/chunks/th-BEkMpcVW.js +679 -0
- package/dist/dist-cli-preview/chunks/tl-CqwwplQC.js +679 -0
- package/dist/dist-cli-preview/chunks/tr-XEp4ekrM.js +679 -0
- package/dist/dist-cli-preview/chunks/{trash-2-wVweQZMw.js → trash-2-ClRyi9iY.js} +12 -12
- package/dist/dist-cli-preview/chunks/uk-DWdZFWBl.js +679 -0
- package/dist/dist-cli-preview/chunks/use-mobile-srOt50VV.js +254 -0
- package/dist/dist-cli-preview/chunks/{use-optional-store-lZUz976C.js → use-optional-store-BgrOjfZJ.js} +2 -2
- package/dist/dist-cli-preview/chunks/{use-store-DVmgsDXy.js → use-store-CUSQx1E-.js} +25 -36
- package/dist/dist-cli-preview/chunks/{useInfiniteQuery-Dtzov9uh.js → useInfiniteQuery-DGc8fotv.js} +1 -1
- package/dist/dist-cli-preview/chunks/user-Ca2sKJ-h.js +14 -0
- package/dist/dist-cli-preview/chunks/users-Dh7zTrKY.js +16 -0
- package/dist/dist-cli-preview/chunks/vi-H__PaPsC.js +679 -0
- package/dist/dist-cli-preview/chunks/zh_CN-B62j_w_1.js +679 -0
- package/dist/dist-cli-preview/chunks/zh_TW-CYUIGBvP.js +679 -0
- package/package.json +1 -1
- package/dist/dist-cli-preview/chunks/Combobox-cf11L_T-.js +0 -1455
- package/dist/dist-cli-preview/chunks/MySiteScreen-Dtw1rsF9.js +0 -4950
- package/dist/dist-cli-preview/chunks/OrdersScreen-DkltVCtr.js +0 -9
- package/dist/dist-cli-preview/chunks/sidebar-Ckzom4Xc.js +0 -848
- package/dist/dist-cli-preview/chunks/user-B81IrSgp.js +0 -31
- package/dist/dist-cli-preview/chunks/users-BXTjoCUz.js +0 -27
package/dist/dist-cli-preview/chunks/{ProfileScreen-Dxspc-6p.js → ProfileScreen-CCWM6TBs.js}
RENAMED
|
@@ -1,59 +1,62 @@
|
|
|
1
|
-
import { c as Y, i as mt, l as v, j as n,
|
|
2
|
-
import { u as R, a as St, b as B, c as Et,
|
|
3
|
-
import { O as
|
|
4
|
-
import { F as ee, e as
|
|
5
|
-
import {
|
|
6
|
-
import { u as
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import { u as
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
1
|
+
import { c as Y, i as mt, l as v, j as n, aa as ht, ab as le, ac as pt, ad as ne, M as ce, ae as gt, K as E, I as je, H as A, B as de, D as Ae, E as ue, x as xt, G as $, af as _t, J as H, a8 as T, ag as bt, ah as vt, a7 as yt, P as jt, ai as J, z as fe, R as Me, q as wt, Y as Ct, N as Nt } from "./account-screen-runtime-CCBl8DXt.js";
|
|
2
|
+
import { u as R, a as St, b as B, c as Et, M as Pt } from "./MemberManagementProviders-WSjb3a8B.js";
|
|
3
|
+
import { O as At } from "./OrdersScreen-Cb32bBjd.js";
|
|
4
|
+
import { F as ee, e as Mt, f as Rt, S as Ft, P as It, a as Lt, b as kt, d as Dt, A as Ot, C as Re, c as zt, g as Tt, u as Bt, i as Ut, h as $t, T as Qt, j as qt, k as Vt, m as Ht, E as Kt } from "./create-card-entry-container-5NqOQ4D_.js";
|
|
5
|
+
import { c as Gt } from "./member-permissions-ndhNmlOk.js";
|
|
6
|
+
import { u as me } from "./use-store-CUSQx1E-.js";
|
|
7
|
+
import { u as Yt } from "./trash-2-ClRyi9iY.js";
|
|
8
|
+
import { R as Fe, j as Wt, u as K, o as se, s as L } from "./schemas-BTblatUV.js";
|
|
9
|
+
import { I as Xt } from "./sheet-haptics-context-CYrEaGtf.js";
|
|
10
|
+
import { u as W } from "./sidebar-9qopXeR1.js";
|
|
11
|
+
import { B as Ie, P as Le } from "./Textarea-xoKqLVgY.js";
|
|
12
|
+
import { u as Zt } from "./countries-api-adapter-B4TefdRP.js";
|
|
13
|
+
import { u as Jt } from "./PortalTenantClientProvider-CguU_uRG.js";
|
|
14
|
+
import { M as er } from "./map-pin-DyIkpqP0.js";
|
|
15
|
+
import { A as we } from "./arrow-left-CTYaRdTX.js";
|
|
16
|
+
import { L as tr } from "./log-out-DUdRJX4l.js";
|
|
14
17
|
/**
|
|
15
18
|
* @license lucide-react v0.575.0 - ISC
|
|
16
19
|
*
|
|
17
20
|
* This source code is licensed under the ISC license.
|
|
18
21
|
* See the LICENSE file in the root directory of this source tree.
|
|
19
22
|
*/
|
|
20
|
-
const
|
|
23
|
+
const rr = [
|
|
21
24
|
["rect", { width: "20", height: "14", x: "2", y: "5", rx: "2", key: "ynyp8z" }],
|
|
22
25
|
["line", { x1: "2", x2: "22", y1: "10", y2: "10", key: "1b3vmo" }]
|
|
23
|
-
], ke = Y("credit-card",
|
|
26
|
+
], ke = Y("credit-card", rr);
|
|
24
27
|
/**
|
|
25
28
|
* @license lucide-react v0.575.0 - ISC
|
|
26
29
|
*
|
|
27
30
|
* This source code is licensed under the ISC license.
|
|
28
31
|
* See the LICENSE file in the root directory of this source tree.
|
|
29
32
|
*/
|
|
30
|
-
const
|
|
33
|
+
const nr = [
|
|
31
34
|
["path", { d: "m5 8 6 6", key: "1wu5hv" }],
|
|
32
35
|
["path", { d: "m4 14 6-6 2-3", key: "1k1g8d" }],
|
|
33
36
|
["path", { d: "M2 5h12", key: "or177f" }],
|
|
34
37
|
["path", { d: "M7 2h1", key: "1t2jsx" }],
|
|
35
38
|
["path", { d: "m22 22-5-10-5 10", key: "don7ne" }],
|
|
36
39
|
["path", { d: "M14 18h6", key: "1m8k6r" }]
|
|
37
|
-
],
|
|
40
|
+
], sr = Y("languages", nr);
|
|
38
41
|
/**
|
|
39
42
|
* @license lucide-react v0.575.0 - ISC
|
|
40
43
|
*
|
|
41
44
|
* This source code is licensed under the ISC license.
|
|
42
45
|
* See the LICENSE file in the root directory of this source tree.
|
|
43
46
|
*/
|
|
44
|
-
const
|
|
47
|
+
const ar = [
|
|
45
48
|
["path", { d: "m2 9 3-3 3 3", key: "1ltn5i" }],
|
|
46
49
|
["path", { d: "M13 18H7a2 2 0 0 1-2-2V6", key: "1r6tfw" }],
|
|
47
50
|
["path", { d: "m22 15-3 3-3-3", key: "4rnwn2" }],
|
|
48
51
|
["path", { d: "M11 6h6a2 2 0 0 1 2 2v10", key: "2f72bc" }]
|
|
49
|
-
], De = Y("repeat-2",
|
|
52
|
+
], De = Y("repeat-2", ar);
|
|
50
53
|
/**
|
|
51
54
|
* @license lucide-react v0.575.0 - ISC
|
|
52
55
|
*
|
|
53
56
|
* This source code is licensed under the ISC license.
|
|
54
57
|
* See the LICENSE file in the root directory of this source tree.
|
|
55
58
|
*/
|
|
56
|
-
const
|
|
59
|
+
const ir = [
|
|
57
60
|
[
|
|
58
61
|
"path",
|
|
59
62
|
{
|
|
@@ -61,17 +64,17 @@ const ar = [
|
|
|
61
64
|
key: "r04s7s"
|
|
62
65
|
}
|
|
63
66
|
]
|
|
64
|
-
],
|
|
67
|
+
], or = Y("star", ir);
|
|
65
68
|
/**
|
|
66
69
|
* @license lucide-react v0.575.0 - ISC
|
|
67
70
|
*
|
|
68
71
|
* This source code is licensed under the ISC license.
|
|
69
72
|
* See the LICENSE file in the root directory of this source tree.
|
|
70
73
|
*/
|
|
71
|
-
const
|
|
74
|
+
const lr = [
|
|
72
75
|
["circle", { cx: "12", cy: "8", r: "5", key: "1hypcn" }],
|
|
73
76
|
["path", { d: "M20 21a8 8 0 0 0-16 0", key: "rfgkzh" }]
|
|
74
|
-
],
|
|
77
|
+
], cr = Y("user-round", lr);
|
|
75
78
|
var te = { exports: {} }, re = {};
|
|
76
79
|
/**
|
|
77
80
|
* @license React
|
|
@@ -83,14 +86,14 @@ var te = { exports: {} }, re = {};
|
|
|
83
86
|
* LICENSE file in the root directory of this source tree.
|
|
84
87
|
*/
|
|
85
88
|
var Ce;
|
|
86
|
-
function
|
|
89
|
+
function dr() {
|
|
87
90
|
if (Ce) return re;
|
|
88
91
|
Ce = 1;
|
|
89
92
|
var e = mt();
|
|
90
93
|
function i(o, c) {
|
|
91
94
|
return o === c && (o !== 0 || 1 / o === 1 / c) || o !== o && c !== c;
|
|
92
95
|
}
|
|
93
|
-
var
|
|
96
|
+
var r = typeof Object.is == "function" ? Object.is : i, l = e.useState, d = e.useEffect, u = e.useLayoutEffect, p = e.useDebugValue;
|
|
94
97
|
function g(o, c) {
|
|
95
98
|
var m = c(), f = l({ inst: { value: m, getSnapshot: c } }), h = f[0].inst, x = f[1];
|
|
96
99
|
return u(
|
|
@@ -112,40 +115,40 @@ function cr() {
|
|
|
112
115
|
o = o.value;
|
|
113
116
|
try {
|
|
114
117
|
var m = c();
|
|
115
|
-
return !
|
|
118
|
+
return !r(o, m);
|
|
116
119
|
} catch {
|
|
117
120
|
return !0;
|
|
118
121
|
}
|
|
119
122
|
}
|
|
120
|
-
function
|
|
123
|
+
function t(o, c) {
|
|
121
124
|
return c();
|
|
122
125
|
}
|
|
123
|
-
var s = typeof window > "u" || typeof window.document > "u" || typeof window.document.createElement > "u" ?
|
|
126
|
+
var s = typeof window > "u" || typeof window.document > "u" || typeof window.document.createElement > "u" ? t : g;
|
|
124
127
|
return re.useSyncExternalStore = e.useSyncExternalStore !== void 0 ? e.useSyncExternalStore : s, re;
|
|
125
128
|
}
|
|
126
129
|
var Ne;
|
|
127
|
-
function
|
|
128
|
-
return Ne || (Ne = 1, te.exports =
|
|
130
|
+
function ur() {
|
|
131
|
+
return Ne || (Ne = 1, te.exports = dr()), te.exports;
|
|
129
132
|
}
|
|
130
|
-
var
|
|
131
|
-
function
|
|
132
|
-
return
|
|
133
|
-
|
|
133
|
+
var fr = ur();
|
|
134
|
+
function mr() {
|
|
135
|
+
return fr.useSyncExternalStore(
|
|
136
|
+
hr,
|
|
134
137
|
() => !0,
|
|
135
138
|
() => !1
|
|
136
139
|
);
|
|
137
140
|
}
|
|
138
|
-
function
|
|
141
|
+
function hr() {
|
|
139
142
|
return () => {
|
|
140
143
|
};
|
|
141
144
|
}
|
|
142
|
-
var he = "Avatar", [
|
|
145
|
+
var he = "Avatar", [pr] = ht(he), [gr, Oe] = pr(he), ze = v.forwardRef(
|
|
143
146
|
(e, i) => {
|
|
144
|
-
const { __scopeAvatar:
|
|
147
|
+
const { __scopeAvatar: r, ...l } = e, [d, u] = v.useState("idle");
|
|
145
148
|
return /* @__PURE__ */ n.jsx(
|
|
146
|
-
|
|
149
|
+
gr,
|
|
147
150
|
{
|
|
148
|
-
scope:
|
|
151
|
+
scope: r,
|
|
149
152
|
imageLoadingStatus: d,
|
|
150
153
|
onImageLoadingStatusChange: u,
|
|
151
154
|
children: /* @__PURE__ */ n.jsx(le.span, { ...l, ref: i })
|
|
@@ -156,9 +159,9 @@ var he = "Avatar", [hr] = ht(he), [pr, Oe] = hr(he), ze = v.forwardRef(
|
|
|
156
159
|
ze.displayName = he;
|
|
157
160
|
var Te = "AvatarImage", Be = v.forwardRef(
|
|
158
161
|
(e, i) => {
|
|
159
|
-
const { __scopeAvatar:
|
|
160
|
-
}, ...u } = e, p = Oe(Te,
|
|
161
|
-
d(
|
|
162
|
+
const { __scopeAvatar: r, src: l, onLoadingStatusChange: d = () => {
|
|
163
|
+
}, ...u } = e, p = Oe(Te, r), g = xr(l, u), a = pt((t) => {
|
|
164
|
+
d(t), p.onImageLoadingStatusChange(t);
|
|
162
165
|
});
|
|
163
166
|
return ne(() => {
|
|
164
167
|
g !== "idle" && a(g);
|
|
@@ -168,7 +171,7 @@ var Te = "AvatarImage", Be = v.forwardRef(
|
|
|
168
171
|
Be.displayName = Te;
|
|
169
172
|
var Ue = "AvatarFallback", $e = v.forwardRef(
|
|
170
173
|
(e, i) => {
|
|
171
|
-
const { __scopeAvatar:
|
|
174
|
+
const { __scopeAvatar: r, delayMs: l, ...d } = e, u = Oe(Ue, r), [p, g] = v.useState(l === void 0);
|
|
172
175
|
return v.useEffect(() => {
|
|
173
176
|
if (l !== void 0) {
|
|
174
177
|
const a = window.setTimeout(() => g(!0), l);
|
|
@@ -181,8 +184,8 @@ $e.displayName = Ue;
|
|
|
181
184
|
function Se(e, i) {
|
|
182
185
|
return e ? i ? (e.src !== i && (e.src = i), e.complete && e.naturalWidth > 0 ? "loaded" : "loading") : "error" : "idle";
|
|
183
186
|
}
|
|
184
|
-
function
|
|
185
|
-
const l =
|
|
187
|
+
function xr(e, { referrerPolicy: i, crossOrigin: r }) {
|
|
188
|
+
const l = mr(), d = v.useRef(null), u = l ? (d.current || (d.current = new window.Image()), d.current) : null, [p, g] = v.useState(
|
|
186
189
|
() => Se(u, e)
|
|
187
190
|
);
|
|
188
191
|
return ne(() => {
|
|
@@ -192,20 +195,20 @@ function gr(e, { referrerPolicy: i, crossOrigin: t }) {
|
|
|
192
195
|
g(o);
|
|
193
196
|
};
|
|
194
197
|
if (!u) return;
|
|
195
|
-
const
|
|
196
|
-
return u.addEventListener("load",
|
|
197
|
-
u.removeEventListener("load",
|
|
198
|
+
const t = a("loaded"), s = a("error");
|
|
199
|
+
return u.addEventListener("load", t), u.addEventListener("error", s), i && (u.referrerPolicy = i), typeof r == "string" && (u.crossOrigin = r), () => {
|
|
200
|
+
u.removeEventListener("load", t), u.removeEventListener("error", s);
|
|
198
201
|
};
|
|
199
|
-
}, [u,
|
|
202
|
+
}, [u, r, i]), p;
|
|
200
203
|
}
|
|
201
|
-
var
|
|
202
|
-
function
|
|
204
|
+
var _r = ze, br = Be, vr = $e;
|
|
205
|
+
function yr({
|
|
203
206
|
className: e,
|
|
204
207
|
size: i = "default",
|
|
205
|
-
...
|
|
208
|
+
...r
|
|
206
209
|
}) {
|
|
207
210
|
return /* @__PURE__ */ n.jsx(
|
|
208
|
-
|
|
211
|
+
_r,
|
|
209
212
|
{
|
|
210
213
|
"data-slot": "avatar",
|
|
211
214
|
"data-size": i,
|
|
@@ -213,16 +216,16 @@ function vr({
|
|
|
213
216
|
"group/avatar relative flex size-8 shrink-0 overflow-hidden rounded-full select-none data-[size=lg]:size-10 data-[size=sm]:size-6",
|
|
214
217
|
e
|
|
215
218
|
),
|
|
216
|
-
...
|
|
219
|
+
...r
|
|
217
220
|
}
|
|
218
221
|
);
|
|
219
222
|
}
|
|
220
|
-
function
|
|
223
|
+
function jr({
|
|
221
224
|
className: e,
|
|
222
225
|
...i
|
|
223
226
|
}) {
|
|
224
227
|
return /* @__PURE__ */ n.jsx(
|
|
225
|
-
|
|
228
|
+
br,
|
|
226
229
|
{
|
|
227
230
|
"data-slot": "avatar-image",
|
|
228
231
|
className: ce("aspect-square size-full", e),
|
|
@@ -230,12 +233,12 @@ function yr({
|
|
|
230
233
|
}
|
|
231
234
|
);
|
|
232
235
|
}
|
|
233
|
-
function
|
|
236
|
+
function wr({
|
|
234
237
|
className: e,
|
|
235
238
|
...i
|
|
236
239
|
}) {
|
|
237
240
|
return /* @__PURE__ */ n.jsx(
|
|
238
|
-
|
|
241
|
+
vr,
|
|
239
242
|
{
|
|
240
243
|
"data-slot": "avatar-fallback",
|
|
241
244
|
className: ce(
|
|
@@ -246,17 +249,17 @@ function jr({
|
|
|
246
249
|
}
|
|
247
250
|
);
|
|
248
251
|
}
|
|
249
|
-
function
|
|
252
|
+
function Cr({
|
|
250
253
|
control: e,
|
|
251
254
|
isOpen: i,
|
|
252
|
-
onSubmit:
|
|
255
|
+
onSubmit: r,
|
|
253
256
|
handleClose: l,
|
|
254
257
|
languageOptions: d,
|
|
255
258
|
errorMsg: u,
|
|
256
259
|
isSubmitting: p,
|
|
257
260
|
email: g,
|
|
258
261
|
onChangeEmail: a,
|
|
259
|
-
isChangingEmail:
|
|
262
|
+
isChangingEmail: t,
|
|
260
263
|
pendingEmail: s,
|
|
261
264
|
disableNameEdit: o = !1,
|
|
262
265
|
presentation: c = "dialog",
|
|
@@ -268,12 +271,12 @@ function wr({
|
|
|
268
271
|
w.current += 1, C(!1);
|
|
269
272
|
}, [i]);
|
|
270
273
|
const M = async (j) => {
|
|
271
|
-
const
|
|
272
|
-
if (j.target.value = "", !
|
|
274
|
+
const q = j.target.files?.[0];
|
|
275
|
+
if (j.target.value = "", !q || !f) return;
|
|
273
276
|
const I = ++w.current;
|
|
274
277
|
C(!0);
|
|
275
278
|
try {
|
|
276
|
-
const G = await f(
|
|
279
|
+
const G = await f(q);
|
|
277
280
|
G && w.current === I && x.onChange(G);
|
|
278
281
|
} finally {
|
|
279
282
|
w.current === I && C(!1);
|
|
@@ -300,13 +303,13 @@ function wr({
|
|
|
300
303
|
I instanceof Error ? I.message : h("failed_to_initiate_email_change")
|
|
301
304
|
);
|
|
302
305
|
}
|
|
303
|
-
},
|
|
306
|
+
}, Q = () => {
|
|
304
307
|
z(!1), y(""), P(void 0);
|
|
305
308
|
}, O = () => {
|
|
306
|
-
|
|
309
|
+
Q(), l();
|
|
307
310
|
};
|
|
308
311
|
return /* @__PURE__ */ n.jsxs(
|
|
309
|
-
|
|
312
|
+
Fe,
|
|
310
313
|
{
|
|
311
314
|
open: i,
|
|
312
315
|
onOpenChange: (j) => !j && O(),
|
|
@@ -417,7 +420,7 @@ function wr({
|
|
|
417
420
|
}
|
|
418
421
|
),
|
|
419
422
|
/* @__PURE__ */ n.jsx(
|
|
420
|
-
|
|
423
|
+
Mt,
|
|
421
424
|
{
|
|
422
425
|
control: e,
|
|
423
426
|
name: "bio",
|
|
@@ -427,7 +430,7 @@ function wr({
|
|
|
427
430
|
}
|
|
428
431
|
),
|
|
429
432
|
/* @__PURE__ */ n.jsx(
|
|
430
|
-
|
|
433
|
+
Rt,
|
|
431
434
|
{
|
|
432
435
|
control: e,
|
|
433
436
|
name: "language",
|
|
@@ -450,7 +453,7 @@ function wr({
|
|
|
450
453
|
y(j.target.value), P(void 0);
|
|
451
454
|
},
|
|
452
455
|
onKeyDown: (j) => {
|
|
453
|
-
j.key === "Enter" && (j.preventDefault(), X()), j.key === "Escape" &&
|
|
456
|
+
j.key === "Enter" && (j.preventDefault(), X()), j.key === "Escape" && Q();
|
|
454
457
|
},
|
|
455
458
|
"aria-invalid": !!D || void 0,
|
|
456
459
|
autoFocus: !0
|
|
@@ -468,7 +471,7 @@ function wr({
|
|
|
468
471
|
type: "button",
|
|
469
472
|
variant: "outline",
|
|
470
473
|
size: "sm",
|
|
471
|
-
onClick:
|
|
474
|
+
onClick: Q,
|
|
472
475
|
children: h("cancel")
|
|
473
476
|
}
|
|
474
477
|
),
|
|
@@ -478,10 +481,10 @@ function wr({
|
|
|
478
481
|
type: "button",
|
|
479
482
|
size: "sm",
|
|
480
483
|
onClick: X,
|
|
481
|
-
disabled: !F.trim() ||
|
|
484
|
+
disabled: !F.trim() || t,
|
|
482
485
|
children: [
|
|
483
|
-
|
|
484
|
-
h(
|
|
486
|
+
t && /* @__PURE__ */ n.jsx("div", { className: "mr-2 size-3.5 animate-spin rounded-full border-2 border-current/30 border-t-current" }),
|
|
487
|
+
h(t ? "sending" : "send_verification")
|
|
485
488
|
]
|
|
486
489
|
}
|
|
487
490
|
)
|
|
@@ -518,7 +521,7 @@ function wr({
|
|
|
518
521
|
E,
|
|
519
522
|
{
|
|
520
523
|
type: "button",
|
|
521
|
-
onClick:
|
|
524
|
+
onClick: r,
|
|
522
525
|
disabled: N || p,
|
|
523
526
|
children: [
|
|
524
527
|
p && /* @__PURE__ */ n.jsx("div", { className: "mr-2 size-4 animate-spin rounded-full border-2 border-current/30 border-t-current" }),
|
|
@@ -530,33 +533,21 @@ function wr({
|
|
|
530
533
|
}
|
|
531
534
|
);
|
|
532
535
|
}
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
if (t) {
|
|
537
|
-
const l = t[i];
|
|
538
|
-
return l !== void 0 ? l === !0 : t.search_enabled === !0;
|
|
539
|
-
}
|
|
540
|
-
return e.member_type !== "customer";
|
|
541
|
-
}
|
|
542
|
-
function Nr(e) {
|
|
543
|
-
return Cr(e, "rep_eligible");
|
|
544
|
-
}
|
|
545
|
-
var Sr = Object.defineProperty, Z = Object.getOwnPropertySymbols, qe = Object.prototype.hasOwnProperty, Qe = Object.prototype.propertyIsEnumerable, Ee = (e, i, t) => i in e ? Sr(e, i, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[i] = t, ae = (e, i) => {
|
|
546
|
-
for (var t in i || (i = {}))
|
|
547
|
-
qe.call(i, t) && Ee(e, t, i[t]);
|
|
536
|
+
var Nr = Object.defineProperty, Z = Object.getOwnPropertySymbols, Qe = Object.prototype.hasOwnProperty, qe = Object.prototype.propertyIsEnumerable, Ee = (e, i, r) => i in e ? Nr(e, i, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[i] = r, ae = (e, i) => {
|
|
537
|
+
for (var r in i || (i = {}))
|
|
538
|
+
Qe.call(i, r) && Ee(e, r, i[r]);
|
|
548
539
|
if (Z)
|
|
549
|
-
for (var
|
|
550
|
-
|
|
540
|
+
for (var r of Z(i))
|
|
541
|
+
qe.call(i, r) && Ee(e, r, i[r]);
|
|
551
542
|
return e;
|
|
552
543
|
}, ie = (e, i) => {
|
|
553
|
-
var
|
|
544
|
+
var r = {};
|
|
554
545
|
for (var l in e)
|
|
555
|
-
|
|
546
|
+
Qe.call(e, l) && i.indexOf(l) < 0 && (r[l] = e[l]);
|
|
556
547
|
if (e != null && Z)
|
|
557
548
|
for (var l of Z(e))
|
|
558
|
-
i.indexOf(l) < 0 &&
|
|
559
|
-
return
|
|
549
|
+
i.indexOf(l) < 0 && qe.call(e, l) && (r[l] = e[l]);
|
|
550
|
+
return r;
|
|
560
551
|
};
|
|
561
552
|
/**
|
|
562
553
|
* @license QR Code generator library (TypeScript)
|
|
@@ -571,8 +562,8 @@ var U;
|
|
|
571
562
|
// error correction level, data codeword bytes, and mask number.
|
|
572
563
|
// This is a low-level API that most users should not use directly.
|
|
573
564
|
// A mid-level API is the encodeSegments() function.
|
|
574
|
-
constructor(a,
|
|
575
|
-
if (this.version = a, this.errorCorrectionLevel =
|
|
565
|
+
constructor(a, t, s, o) {
|
|
566
|
+
if (this.version = a, this.errorCorrectionLevel = t, this.modules = [], this.isFunction = [], a < b.MIN_VERSION || a > b.MAX_VERSION)
|
|
576
567
|
throw new RangeError("Version value out of range");
|
|
577
568
|
if (o < -1 || o > 7)
|
|
578
569
|
throw new RangeError("Mask value out of range");
|
|
@@ -600,17 +591,17 @@ var U;
|
|
|
600
591
|
// Unicode code points (not UTF-16 code units) if the low error correction level is used. The smallest possible
|
|
601
592
|
// QR Code version is automatically chosen for the output. The ECC level of the result may be higher than the
|
|
602
593
|
// ecl argument if it can be done without increasing the version.
|
|
603
|
-
static encodeText(a,
|
|
594
|
+
static encodeText(a, t) {
|
|
604
595
|
const s = e.QrSegment.makeSegments(a);
|
|
605
|
-
return b.encodeSegments(s,
|
|
596
|
+
return b.encodeSegments(s, t);
|
|
606
597
|
}
|
|
607
598
|
// Returns a QR Code representing the given binary data at the given error correction level.
|
|
608
599
|
// This function always encodes using the binary segment mode, not any text mode. The maximum number of
|
|
609
600
|
// bytes allowed is 2953. The smallest possible QR Code version is automatically chosen for the output.
|
|
610
601
|
// The ECC level of the result may be higher than the ecl argument if it can be done without increasing the version.
|
|
611
|
-
static encodeBinary(a,
|
|
602
|
+
static encodeBinary(a, t) {
|
|
612
603
|
const s = e.QrSegment.makeBytes(a);
|
|
613
|
-
return b.encodeSegments([s],
|
|
604
|
+
return b.encodeSegments([s], t);
|
|
614
605
|
}
|
|
615
606
|
/*-- Static factory functions (mid level) --*/
|
|
616
607
|
// Returns a QR Code representing the given segments with the given encoding parameters.
|
|
@@ -622,12 +613,12 @@ var U;
|
|
|
622
613
|
// This function allows the user to create a custom sequence of segments that switches
|
|
623
614
|
// between modes (such as alphanumeric and byte) to encode text in less space.
|
|
624
615
|
// This is a mid-level API; the high-level API is encodeText() and encodeBinary().
|
|
625
|
-
static encodeSegments(a,
|
|
616
|
+
static encodeSegments(a, t, s = 1, o = 40, c = -1, m = !0) {
|
|
626
617
|
if (!(b.MIN_VERSION <= s && s <= o && o <= b.MAX_VERSION) || c < -1 || c > 7)
|
|
627
618
|
throw new RangeError("Invalid value");
|
|
628
619
|
let f, h;
|
|
629
620
|
for (f = s; ; f++) {
|
|
630
|
-
const _ = b.getNumDataCodewords(f,
|
|
621
|
+
const _ = b.getNumDataCodewords(f, t) * 8, w = p.getTotalBits(a, f);
|
|
631
622
|
if (w <= _) {
|
|
632
623
|
h = w;
|
|
633
624
|
break;
|
|
@@ -636,29 +627,29 @@ var U;
|
|
|
636
627
|
throw new RangeError("Data too long");
|
|
637
628
|
}
|
|
638
629
|
for (const _ of [b.Ecc.MEDIUM, b.Ecc.QUARTILE, b.Ecc.HIGH])
|
|
639
|
-
m && h <= b.getNumDataCodewords(f, _) * 8 && (
|
|
630
|
+
m && h <= b.getNumDataCodewords(f, _) * 8 && (t = _);
|
|
640
631
|
let x = [];
|
|
641
632
|
for (const _ of a) {
|
|
642
|
-
|
|
633
|
+
r(_.mode.modeBits, 4, x), r(_.numChars, _.mode.numCharCountBits(f), x);
|
|
643
634
|
for (const w of _.getData())
|
|
644
635
|
x.push(w);
|
|
645
636
|
}
|
|
646
637
|
d(x.length == h);
|
|
647
|
-
const N = b.getNumDataCodewords(f,
|
|
648
|
-
d(x.length <= N),
|
|
638
|
+
const N = b.getNumDataCodewords(f, t) * 8;
|
|
639
|
+
d(x.length <= N), r(0, Math.min(4, N - x.length), x), r(0, (8 - x.length % 8) % 8, x), d(x.length % 8 == 0);
|
|
649
640
|
for (let _ = 236; x.length < N; _ ^= 253)
|
|
650
|
-
|
|
641
|
+
r(_, 8, x);
|
|
651
642
|
let C = [];
|
|
652
643
|
for (; C.length * 8 < x.length; )
|
|
653
644
|
C.push(0);
|
|
654
|
-
return x.forEach((_, w) => C[w >>> 3] |= _ << 7 - (w & 7)), new b(f,
|
|
645
|
+
return x.forEach((_, w) => C[w >>> 3] |= _ << 7 - (w & 7)), new b(f, t, C, c);
|
|
655
646
|
}
|
|
656
647
|
/*-- Accessor methods --*/
|
|
657
648
|
// Returns the color of the module (pixel) at the given coordinates, which is false
|
|
658
649
|
// for light or true for dark. The top left corner has the coordinates (x=0, y=0).
|
|
659
650
|
// If the given coordinates are out of bounds, then false (light) is returned.
|
|
660
|
-
getModule(a,
|
|
661
|
-
return 0 <= a && a < this.size && 0 <=
|
|
651
|
+
getModule(a, t) {
|
|
652
|
+
return 0 <= a && a < this.size && 0 <= t && t < this.size && this.modules[t][a];
|
|
662
653
|
}
|
|
663
654
|
// Modified to expose modules for easy access
|
|
664
655
|
getModules() {
|
|
@@ -670,20 +661,20 @@ var U;
|
|
|
670
661
|
for (let s = 0; s < this.size; s++)
|
|
671
662
|
this.setFunctionModule(6, s, s % 2 == 0), this.setFunctionModule(s, 6, s % 2 == 0);
|
|
672
663
|
this.drawFinderPattern(3, 3), this.drawFinderPattern(this.size - 4, 3), this.drawFinderPattern(3, this.size - 4);
|
|
673
|
-
const a = this.getAlignmentPatternPositions(),
|
|
674
|
-
for (let s = 0; s <
|
|
675
|
-
for (let o = 0; o <
|
|
676
|
-
s == 0 && o == 0 || s == 0 && o ==
|
|
664
|
+
const a = this.getAlignmentPatternPositions(), t = a.length;
|
|
665
|
+
for (let s = 0; s < t; s++)
|
|
666
|
+
for (let o = 0; o < t; o++)
|
|
667
|
+
s == 0 && o == 0 || s == 0 && o == t - 1 || s == t - 1 && o == 0 || this.drawAlignmentPattern(a[s], a[o]);
|
|
677
668
|
this.drawFormatBits(0), this.drawVersion();
|
|
678
669
|
}
|
|
679
670
|
// Draws two copies of the format bits (with its own error correction code)
|
|
680
671
|
// based on the given mask and this object's error correction level field.
|
|
681
672
|
drawFormatBits(a) {
|
|
682
|
-
const
|
|
683
|
-
let s =
|
|
673
|
+
const t = this.errorCorrectionLevel.formatBits << 3 | a;
|
|
674
|
+
let s = t;
|
|
684
675
|
for (let c = 0; c < 10; c++)
|
|
685
676
|
s = s << 1 ^ (s >>> 9) * 1335;
|
|
686
|
-
const o = (
|
|
677
|
+
const o = (t << 10 | s) ^ 21522;
|
|
687
678
|
d(o >>> 15 == 0);
|
|
688
679
|
for (let c = 0; c <= 5; c++)
|
|
689
680
|
this.setFunctionModule(8, c, l(o, c));
|
|
@@ -704,42 +695,42 @@ var U;
|
|
|
704
695
|
let a = this.version;
|
|
705
696
|
for (let s = 0; s < 12; s++)
|
|
706
697
|
a = a << 1 ^ (a >>> 11) * 7973;
|
|
707
|
-
const
|
|
708
|
-
d(
|
|
698
|
+
const t = this.version << 12 | a;
|
|
699
|
+
d(t >>> 18 == 0);
|
|
709
700
|
for (let s = 0; s < 18; s++) {
|
|
710
|
-
const o = l(
|
|
701
|
+
const o = l(t, s), c = this.size - 11 + s % 3, m = Math.floor(s / 3);
|
|
711
702
|
this.setFunctionModule(c, m, o), this.setFunctionModule(m, c, o);
|
|
712
703
|
}
|
|
713
704
|
}
|
|
714
705
|
// Draws a 9*9 finder pattern including the border separator,
|
|
715
706
|
// with the center module at (x, y). Modules can be out of bounds.
|
|
716
|
-
drawFinderPattern(a,
|
|
707
|
+
drawFinderPattern(a, t) {
|
|
717
708
|
for (let s = -4; s <= 4; s++)
|
|
718
709
|
for (let o = -4; o <= 4; o++) {
|
|
719
|
-
const c = Math.max(Math.abs(o), Math.abs(s)), m = a + o, f =
|
|
710
|
+
const c = Math.max(Math.abs(o), Math.abs(s)), m = a + o, f = t + s;
|
|
720
711
|
0 <= m && m < this.size && 0 <= f && f < this.size && this.setFunctionModule(m, f, c != 2 && c != 4);
|
|
721
712
|
}
|
|
722
713
|
}
|
|
723
714
|
// Draws a 5*5 alignment pattern, with the center module
|
|
724
715
|
// at (x, y). All modules must be in bounds.
|
|
725
|
-
drawAlignmentPattern(a,
|
|
716
|
+
drawAlignmentPattern(a, t) {
|
|
726
717
|
for (let s = -2; s <= 2; s++)
|
|
727
718
|
for (let o = -2; o <= 2; o++)
|
|
728
|
-
this.setFunctionModule(a + o,
|
|
719
|
+
this.setFunctionModule(a + o, t + s, Math.max(Math.abs(o), Math.abs(s)) != 1);
|
|
729
720
|
}
|
|
730
721
|
// Sets the color of a module and marks it as a function module.
|
|
731
722
|
// Only used by the constructor. Coordinates must be in bounds.
|
|
732
|
-
setFunctionModule(a,
|
|
733
|
-
this.modules[
|
|
723
|
+
setFunctionModule(a, t, s) {
|
|
724
|
+
this.modules[t][a] = s, this.isFunction[t][a] = !0;
|
|
734
725
|
}
|
|
735
726
|
/*-- Private helper methods for constructor: Codewords and masking --*/
|
|
736
727
|
// Returns a new byte string representing the given data with the appropriate error correction
|
|
737
728
|
// codewords appended to it, based on this object's version and error correction level.
|
|
738
729
|
addEccAndInterleave(a) {
|
|
739
|
-
const
|
|
740
|
-
if (a.length != b.getNumDataCodewords(
|
|
730
|
+
const t = this.version, s = this.errorCorrectionLevel;
|
|
731
|
+
if (a.length != b.getNumDataCodewords(t, s))
|
|
741
732
|
throw new RangeError("Invalid argument");
|
|
742
|
-
const o = b.NUM_ERROR_CORRECTION_BLOCKS[s.ordinal][
|
|
733
|
+
const o = b.NUM_ERROR_CORRECTION_BLOCKS[s.ordinal][t], c = b.ECC_CODEWORDS_PER_BLOCK[s.ordinal][t], m = Math.floor(b.getNumRawDataModules(t) / 8), f = o - m % o, h = Math.floor(m / o);
|
|
743
734
|
let x = [];
|
|
744
735
|
const N = b.reedSolomonComputeDivisor(c);
|
|
745
736
|
for (let _ = 0, w = 0; _ < o; _++) {
|
|
@@ -760,16 +751,16 @@ var U;
|
|
|
760
751
|
drawCodewords(a) {
|
|
761
752
|
if (a.length != Math.floor(b.getNumRawDataModules(this.version) / 8))
|
|
762
753
|
throw new RangeError("Invalid argument");
|
|
763
|
-
let
|
|
754
|
+
let t = 0;
|
|
764
755
|
for (let s = this.size - 1; s >= 1; s -= 2) {
|
|
765
756
|
s == 6 && (s = 5);
|
|
766
757
|
for (let o = 0; o < this.size; o++)
|
|
767
758
|
for (let c = 0; c < 2; c++) {
|
|
768
759
|
const m = s - c, h = (s + 1 & 2) == 0 ? this.size - 1 - o : o;
|
|
769
|
-
!this.isFunction[h][m] &&
|
|
760
|
+
!this.isFunction[h][m] && t < a.length * 8 && (this.modules[h][m] = l(a[t >>> 3], 7 - (t & 7)), t++);
|
|
770
761
|
}
|
|
771
762
|
}
|
|
772
|
-
d(
|
|
763
|
+
d(t == a.length * 8);
|
|
773
764
|
}
|
|
774
765
|
// XORs the codeword modules in this QR Code with the given mask pattern.
|
|
775
766
|
// The function modules must be marked and the codeword bits must be drawn
|
|
@@ -779,38 +770,38 @@ var U;
|
|
|
779
770
|
applyMask(a) {
|
|
780
771
|
if (a < 0 || a > 7)
|
|
781
772
|
throw new RangeError("Mask value out of range");
|
|
782
|
-
for (let
|
|
773
|
+
for (let t = 0; t < this.size; t++)
|
|
783
774
|
for (let s = 0; s < this.size; s++) {
|
|
784
775
|
let o;
|
|
785
776
|
switch (a) {
|
|
786
777
|
case 0:
|
|
787
|
-
o = (s +
|
|
778
|
+
o = (s + t) % 2 == 0;
|
|
788
779
|
break;
|
|
789
780
|
case 1:
|
|
790
|
-
o =
|
|
781
|
+
o = t % 2 == 0;
|
|
791
782
|
break;
|
|
792
783
|
case 2:
|
|
793
784
|
o = s % 3 == 0;
|
|
794
785
|
break;
|
|
795
786
|
case 3:
|
|
796
|
-
o = (s +
|
|
787
|
+
o = (s + t) % 3 == 0;
|
|
797
788
|
break;
|
|
798
789
|
case 4:
|
|
799
|
-
o = (Math.floor(s / 3) + Math.floor(
|
|
790
|
+
o = (Math.floor(s / 3) + Math.floor(t / 2)) % 2 == 0;
|
|
800
791
|
break;
|
|
801
792
|
case 5:
|
|
802
|
-
o = s *
|
|
793
|
+
o = s * t % 2 + s * t % 3 == 0;
|
|
803
794
|
break;
|
|
804
795
|
case 6:
|
|
805
|
-
o = (s *
|
|
796
|
+
o = (s * t % 2 + s * t % 3) % 2 == 0;
|
|
806
797
|
break;
|
|
807
798
|
case 7:
|
|
808
|
-
o = ((s +
|
|
799
|
+
o = ((s + t) % 2 + s * t % 3) % 2 == 0;
|
|
809
800
|
break;
|
|
810
801
|
default:
|
|
811
802
|
throw new Error("Unreachable");
|
|
812
803
|
}
|
|
813
|
-
!this.isFunction[
|
|
804
|
+
!this.isFunction[t][s] && o && (this.modules[t][s] = !this.modules[t][s]);
|
|
814
805
|
}
|
|
815
806
|
}
|
|
816
807
|
// Calculates and returns the penalty score based on state of this QR Code's current modules.
|
|
@@ -834,10 +825,10 @@ var U;
|
|
|
834
825
|
const f = this.modules[c][m];
|
|
835
826
|
f == this.modules[c][m + 1] && f == this.modules[c + 1][m] && f == this.modules[c + 1][m + 1] && (a += b.PENALTY_N2);
|
|
836
827
|
}
|
|
837
|
-
let
|
|
828
|
+
let t = 0;
|
|
838
829
|
for (const c of this.modules)
|
|
839
|
-
|
|
840
|
-
const s = this.size * this.size, o = Math.ceil(Math.abs(
|
|
830
|
+
t = c.reduce((m, f) => m + (f ? 1 : 0), t);
|
|
831
|
+
const s = this.size * this.size, o = Math.ceil(Math.abs(t * 20 - s * 10) / s) - 1;
|
|
841
832
|
return d(0 <= o && o <= 9), a += o * b.PENALTY_N4, d(0 <= a && a <= 2568888), a;
|
|
842
833
|
}
|
|
843
834
|
/*-- Private helper functions --*/
|
|
@@ -848,9 +839,9 @@ var U;
|
|
|
848
839
|
if (this.version == 1)
|
|
849
840
|
return [];
|
|
850
841
|
{
|
|
851
|
-
const a = Math.floor(this.version / 7) + 2,
|
|
842
|
+
const a = Math.floor(this.version / 7) + 2, t = this.version == 32 ? 26 : Math.ceil((this.version * 4 + 4) / (a * 2 - 2)) * 2;
|
|
852
843
|
let s = [6];
|
|
853
|
-
for (let o = this.size - 7; s.length < a; o -=
|
|
844
|
+
for (let o = this.size - 7; s.length < a; o -= t)
|
|
854
845
|
s.splice(1, 0, o);
|
|
855
846
|
return s;
|
|
856
847
|
}
|
|
@@ -861,70 +852,70 @@ var U;
|
|
|
861
852
|
static getNumRawDataModules(a) {
|
|
862
853
|
if (a < b.MIN_VERSION || a > b.MAX_VERSION)
|
|
863
854
|
throw new RangeError("Version number out of range");
|
|
864
|
-
let
|
|
855
|
+
let t = (16 * a + 128) * a + 64;
|
|
865
856
|
if (a >= 2) {
|
|
866
857
|
const s = Math.floor(a / 7) + 2;
|
|
867
|
-
|
|
858
|
+
t -= (25 * s - 10) * s - 55, a >= 7 && (t -= 36);
|
|
868
859
|
}
|
|
869
|
-
return d(208 <=
|
|
860
|
+
return d(208 <= t && t <= 29648), t;
|
|
870
861
|
}
|
|
871
862
|
// Returns the number of 8-bit data (i.e. not error correction) codewords contained in any
|
|
872
863
|
// QR Code of the given version number and error correction level, with remainder bits discarded.
|
|
873
864
|
// This stateless pure function could be implemented as a (40*4)-cell lookup table.
|
|
874
|
-
static getNumDataCodewords(a,
|
|
875
|
-
return Math.floor(b.getNumRawDataModules(a) / 8) - b.ECC_CODEWORDS_PER_BLOCK[
|
|
865
|
+
static getNumDataCodewords(a, t) {
|
|
866
|
+
return Math.floor(b.getNumRawDataModules(a) / 8) - b.ECC_CODEWORDS_PER_BLOCK[t.ordinal][a] * b.NUM_ERROR_CORRECTION_BLOCKS[t.ordinal][a];
|
|
876
867
|
}
|
|
877
868
|
// Returns a Reed-Solomon ECC generator polynomial for the given degree. This could be
|
|
878
869
|
// implemented as a lookup table over all possible parameter values, instead of as an algorithm.
|
|
879
870
|
static reedSolomonComputeDivisor(a) {
|
|
880
871
|
if (a < 1 || a > 255)
|
|
881
872
|
throw new RangeError("Degree out of range");
|
|
882
|
-
let
|
|
873
|
+
let t = [];
|
|
883
874
|
for (let o = 0; o < a - 1; o++)
|
|
884
|
-
|
|
885
|
-
|
|
875
|
+
t.push(0);
|
|
876
|
+
t.push(1);
|
|
886
877
|
let s = 1;
|
|
887
878
|
for (let o = 0; o < a; o++) {
|
|
888
|
-
for (let c = 0; c <
|
|
889
|
-
|
|
879
|
+
for (let c = 0; c < t.length; c++)
|
|
880
|
+
t[c] = b.reedSolomonMultiply(t[c], s), c + 1 < t.length && (t[c] ^= t[c + 1]);
|
|
890
881
|
s = b.reedSolomonMultiply(s, 2);
|
|
891
882
|
}
|
|
892
|
-
return
|
|
883
|
+
return t;
|
|
893
884
|
}
|
|
894
885
|
// Returns the Reed-Solomon error correction codeword for the given data and divisor polynomials.
|
|
895
|
-
static reedSolomonComputeRemainder(a,
|
|
896
|
-
let s =
|
|
886
|
+
static reedSolomonComputeRemainder(a, t) {
|
|
887
|
+
let s = t.map((o) => 0);
|
|
897
888
|
for (const o of a) {
|
|
898
889
|
const c = o ^ s.shift();
|
|
899
|
-
s.push(0),
|
|
890
|
+
s.push(0), t.forEach((m, f) => s[f] ^= b.reedSolomonMultiply(m, c));
|
|
900
891
|
}
|
|
901
892
|
return s;
|
|
902
893
|
}
|
|
903
894
|
// Returns the product of the two given field elements modulo GF(2^8/0x11D). The arguments and result
|
|
904
895
|
// are unsigned 8-bit integers. This could be implemented as a lookup table of 256*256 entries of uint8.
|
|
905
|
-
static reedSolomonMultiply(a,
|
|
906
|
-
if (a >>> 8 ||
|
|
896
|
+
static reedSolomonMultiply(a, t) {
|
|
897
|
+
if (a >>> 8 || t >>> 8)
|
|
907
898
|
throw new RangeError("Byte out of range");
|
|
908
899
|
let s = 0;
|
|
909
900
|
for (let o = 7; o >= 0; o--)
|
|
910
|
-
s = s << 1 ^ (s >>> 7) * 285, s ^= (
|
|
901
|
+
s = s << 1 ^ (s >>> 7) * 285, s ^= (t >>> o & 1) * a;
|
|
911
902
|
return d(s >>> 8 == 0), s;
|
|
912
903
|
}
|
|
913
904
|
// Can only be called immediately after a light run is added, and
|
|
914
905
|
// returns either 0, 1, or 2. A helper function for getPenaltyScore().
|
|
915
906
|
finderPenaltyCountPatterns(a) {
|
|
916
|
-
const
|
|
917
|
-
d(
|
|
918
|
-
const s =
|
|
919
|
-
return (s && a[0] >=
|
|
907
|
+
const t = a[1];
|
|
908
|
+
d(t <= this.size * 3);
|
|
909
|
+
const s = t > 0 && a[2] == t && a[3] == t * 3 && a[4] == t && a[5] == t;
|
|
910
|
+
return (s && a[0] >= t * 4 && a[6] >= t ? 1 : 0) + (s && a[6] >= t * 4 && a[0] >= t ? 1 : 0);
|
|
920
911
|
}
|
|
921
912
|
// Must be called at the end of a line (row or column) of modules. A helper function for getPenaltyScore().
|
|
922
|
-
finderPenaltyTerminateAndCount(a,
|
|
923
|
-
return a && (this.finderPenaltyAddHistory(
|
|
913
|
+
finderPenaltyTerminateAndCount(a, t, s) {
|
|
914
|
+
return a && (this.finderPenaltyAddHistory(t, s), t = 0), t += this.size, this.finderPenaltyAddHistory(t, s), this.finderPenaltyCountPatterns(s);
|
|
924
915
|
}
|
|
925
916
|
// Pushes the given value to the front and drops the last value. A helper function for getPenaltyScore().
|
|
926
|
-
finderPenaltyAddHistory(a,
|
|
927
|
-
|
|
917
|
+
finderPenaltyAddHistory(a, t) {
|
|
918
|
+
t[0] == 0 && (a += this.size), t.pop(), t.unshift(a);
|
|
928
919
|
}
|
|
929
920
|
};
|
|
930
921
|
i.MIN_VERSION = 1, i.MAX_VERSION = 40, i.PENALTY_N1 = 3, i.PENALTY_N2 = 3, i.PENALTY_N3 = 40, i.PENALTY_N4 = 10, i.ECC_CODEWORDS_PER_BLOCK = [
|
|
@@ -950,11 +941,11 @@ var U;
|
|
|
950
941
|
[-1, 1, 1, 2, 4, 4, 4, 5, 6, 8, 8, 11, 11, 16, 16, 18, 16, 19, 21, 25, 25, 25, 34, 30, 32, 35, 37, 40, 42, 45, 48, 51, 54, 57, 60, 63, 66, 70, 74, 77, 81]
|
|
951
942
|
// High
|
|
952
943
|
], e.QrCode = i;
|
|
953
|
-
function
|
|
944
|
+
function r(g, a, t) {
|
|
954
945
|
if (a < 0 || a > 31 || g >>> a)
|
|
955
946
|
throw new RangeError("Value out of range");
|
|
956
947
|
for (let s = a - 1; s >= 0; s--)
|
|
957
|
-
|
|
948
|
+
t.push(g >>> s & 1);
|
|
958
949
|
}
|
|
959
950
|
function l(g, a) {
|
|
960
951
|
return (g >>> a & 1) != 0;
|
|
@@ -968,8 +959,8 @@ var U;
|
|
|
968
959
|
// Creates a new QR Code segment with the given attributes and data.
|
|
969
960
|
// The character count (numChars) must agree with the mode and the bit buffer length,
|
|
970
961
|
// but the constraint isn't checked. The given bit buffer is cloned and stored.
|
|
971
|
-
constructor(a,
|
|
972
|
-
if (this.mode = a, this.numChars =
|
|
962
|
+
constructor(a, t, s) {
|
|
963
|
+
if (this.mode = a, this.numChars = t, this.bitData = s, t < 0)
|
|
973
964
|
throw new RangeError("Invalid argument");
|
|
974
965
|
this.bitData = s.slice();
|
|
975
966
|
}
|
|
@@ -978,21 +969,21 @@ var U;
|
|
|
978
969
|
// byte mode. All input byte arrays are acceptable. Any text string
|
|
979
970
|
// can be converted to UTF-8 bytes and encoded as a byte mode segment.
|
|
980
971
|
static makeBytes(a) {
|
|
981
|
-
let
|
|
972
|
+
let t = [];
|
|
982
973
|
for (const s of a)
|
|
983
|
-
|
|
984
|
-
return new S(S.Mode.BYTE, a.length,
|
|
974
|
+
r(s, 8, t);
|
|
975
|
+
return new S(S.Mode.BYTE, a.length, t);
|
|
985
976
|
}
|
|
986
977
|
// Returns a segment representing the given string of decimal digits encoded in numeric mode.
|
|
987
978
|
static makeNumeric(a) {
|
|
988
979
|
if (!S.isNumeric(a))
|
|
989
980
|
throw new RangeError("String contains non-numeric characters");
|
|
990
|
-
let
|
|
981
|
+
let t = [];
|
|
991
982
|
for (let s = 0; s < a.length; ) {
|
|
992
983
|
const o = Math.min(a.length - s, 3);
|
|
993
|
-
|
|
984
|
+
r(parseInt(a.substring(s, s + o), 10), o * 3 + 1, t), s += o;
|
|
994
985
|
}
|
|
995
|
-
return new S(S.Mode.NUMERIC, a.length,
|
|
986
|
+
return new S(S.Mode.NUMERIC, a.length, t);
|
|
996
987
|
}
|
|
997
988
|
// Returns a segment representing the given text string encoded in alphanumeric mode.
|
|
998
989
|
// The characters allowed are: 0 to 9, A to Z (uppercase only), space,
|
|
@@ -1000,12 +991,12 @@ var U;
|
|
|
1000
991
|
static makeAlphanumeric(a) {
|
|
1001
992
|
if (!S.isAlphanumeric(a))
|
|
1002
993
|
throw new RangeError("String contains unencodable characters in alphanumeric mode");
|
|
1003
|
-
let
|
|
994
|
+
let t = [], s;
|
|
1004
995
|
for (s = 0; s + 2 <= a.length; s += 2) {
|
|
1005
996
|
let o = S.ALPHANUMERIC_CHARSET.indexOf(a.charAt(s)) * 45;
|
|
1006
|
-
o += S.ALPHANUMERIC_CHARSET.indexOf(a.charAt(s + 1)),
|
|
997
|
+
o += S.ALPHANUMERIC_CHARSET.indexOf(a.charAt(s + 1)), r(o, 11, t);
|
|
1007
998
|
}
|
|
1008
|
-
return s < a.length &&
|
|
999
|
+
return s < a.length && r(S.ALPHANUMERIC_CHARSET.indexOf(a.charAt(s)), 6, t), new S(S.Mode.ALPHANUMERIC, a.length, t);
|
|
1009
1000
|
}
|
|
1010
1001
|
// Returns a new mutable list of zero or more segments to represent the given Unicode text string.
|
|
1011
1002
|
// The result may use various segment modes and switch modes to optimize the length of the bit stream.
|
|
@@ -1015,18 +1006,18 @@ var U;
|
|
|
1015
1006
|
// Returns a segment representing an Extended Channel Interpretation
|
|
1016
1007
|
// (ECI) designator with the given assignment value.
|
|
1017
1008
|
static makeEci(a) {
|
|
1018
|
-
let
|
|
1009
|
+
let t = [];
|
|
1019
1010
|
if (a < 0)
|
|
1020
1011
|
throw new RangeError("ECI assignment value out of range");
|
|
1021
1012
|
if (a < 128)
|
|
1022
|
-
|
|
1013
|
+
r(a, 8, t);
|
|
1023
1014
|
else if (a < 16384)
|
|
1024
|
-
|
|
1015
|
+
r(2, 2, t), r(a, 14, t);
|
|
1025
1016
|
else if (a < 1e6)
|
|
1026
|
-
|
|
1017
|
+
r(6, 3, t), r(a, 21, t);
|
|
1027
1018
|
else
|
|
1028
1019
|
throw new RangeError("ECI assignment value out of range");
|
|
1029
|
-
return new S(S.Mode.ECI, 0,
|
|
1020
|
+
return new S(S.Mode.ECI, 0, t);
|
|
1030
1021
|
}
|
|
1031
1022
|
// Tests whether the given string can be encoded as a segment in numeric mode.
|
|
1032
1023
|
// A string is encodable iff each character is in the range 0 to 9.
|
|
@@ -1046,10 +1037,10 @@ var U;
|
|
|
1046
1037
|
}
|
|
1047
1038
|
// (Package-private) Calculates and returns the number of bits needed to encode the given segments at
|
|
1048
1039
|
// the given version. The result is infinity if a segment has too many characters to fit its length field.
|
|
1049
|
-
static getTotalBits(a,
|
|
1040
|
+
static getTotalBits(a, t) {
|
|
1050
1041
|
let s = 0;
|
|
1051
1042
|
for (const o of a) {
|
|
1052
|
-
const c = o.mode.numCharCountBits(
|
|
1043
|
+
const c = o.mode.numCharCountBits(t);
|
|
1053
1044
|
if (o.numChars >= 1 << c)
|
|
1054
1045
|
return 1 / 0;
|
|
1055
1046
|
s += 4 + c + o.bitData.length;
|
|
@@ -1059,10 +1050,10 @@ var U;
|
|
|
1059
1050
|
// Returns a new array of bytes representing the given string encoded in UTF-8.
|
|
1060
1051
|
static toUtf8ByteArray(a) {
|
|
1061
1052
|
a = encodeURI(a);
|
|
1062
|
-
let
|
|
1053
|
+
let t = [];
|
|
1063
1054
|
for (let s = 0; s < a.length; s++)
|
|
1064
|
-
a.charAt(s) != "%" ?
|
|
1065
|
-
return
|
|
1055
|
+
a.charAt(s) != "%" ? t.push(a.charCodeAt(s)) : (t.push(parseInt(a.substring(s + 1, s + 3), 16)), s += 2);
|
|
1056
|
+
return t;
|
|
1066
1057
|
}
|
|
1067
1058
|
};
|
|
1068
1059
|
u.NUMERIC_REGEX = /^[0-9]*$/, u.ALPHANUMERIC_REGEX = /^[A-Z0-9 $%*+.\/:-]*$/, u.ALPHANUMERIC_CHARSET = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:";
|
|
@@ -1071,19 +1062,19 @@ var U;
|
|
|
1071
1062
|
})(U || (U = {}));
|
|
1072
1063
|
((e) => {
|
|
1073
1064
|
((i) => {
|
|
1074
|
-
const
|
|
1065
|
+
const r = class {
|
|
1075
1066
|
// The QR Code can tolerate about 30% erroneous codewords
|
|
1076
1067
|
/*-- Constructor and fields --*/
|
|
1077
1068
|
constructor(d, u) {
|
|
1078
1069
|
this.ordinal = d, this.formatBits = u;
|
|
1079
1070
|
}
|
|
1080
1071
|
};
|
|
1081
|
-
|
|
1072
|
+
r.LOW = new r(0, 1), r.MEDIUM = new r(1, 0), r.QUARTILE = new r(2, 3), r.HIGH = new r(3, 2), i.Ecc = r;
|
|
1082
1073
|
})(e.QrCode || (e.QrCode = {}));
|
|
1083
1074
|
})(U || (U = {}));
|
|
1084
1075
|
((e) => {
|
|
1085
1076
|
((i) => {
|
|
1086
|
-
const
|
|
1077
|
+
const r = class {
|
|
1087
1078
|
/*-- Constructor and fields --*/
|
|
1088
1079
|
constructor(d, u) {
|
|
1089
1080
|
this.modeBits = d, this.numBitsCharCount = u;
|
|
@@ -1095,7 +1086,7 @@ var U;
|
|
|
1095
1086
|
return this.numBitsCharCount[Math.floor((d + 7) / 17)];
|
|
1096
1087
|
}
|
|
1097
1088
|
};
|
|
1098
|
-
|
|
1089
|
+
r.NUMERIC = new r(1, [10, 12, 14]), r.ALPHANUMERIC = new r(2, [9, 11, 13]), r.BYTE = new r(4, [8, 16, 16]), r.KANJI = new r(8, [8, 10, 12]), r.ECI = new r(7, [0, 0, 0]), i.Mode = r;
|
|
1099
1090
|
})(e.QrSegment || (e.QrSegment = {}));
|
|
1100
1091
|
})(U || (U = {}));
|
|
1101
1092
|
var V = U;
|
|
@@ -1104,19 +1095,19 @@ var V = U;
|
|
|
1104
1095
|
* Copyright (c) Paul O'Shannessy
|
|
1105
1096
|
* SPDX-License-Identifier: ISC
|
|
1106
1097
|
*/
|
|
1107
|
-
var
|
|
1098
|
+
var Sr = {
|
|
1108
1099
|
L: V.QrCode.Ecc.LOW,
|
|
1109
1100
|
M: V.QrCode.Ecc.MEDIUM,
|
|
1110
1101
|
Q: V.QrCode.Ecc.QUARTILE,
|
|
1111
1102
|
H: V.QrCode.Ecc.HIGH
|
|
1112
|
-
}, Ve = 128, He = "L", Ke = "#FFFFFF", Ge = "#000000", Ye = !1, We = 1,
|
|
1103
|
+
}, Ve = 128, He = "L", Ke = "#FFFFFF", Ge = "#000000", Ye = !1, We = 1, Er = 4, Pr = 0, Ar = 0.1;
|
|
1113
1104
|
function Xe(e, i = 0) {
|
|
1114
|
-
const
|
|
1105
|
+
const r = [];
|
|
1115
1106
|
return e.forEach(function(l, d) {
|
|
1116
1107
|
let u = null;
|
|
1117
1108
|
l.forEach(function(p, g) {
|
|
1118
1109
|
if (!p && u !== null) {
|
|
1119
|
-
|
|
1110
|
+
r.push(
|
|
1120
1111
|
`M${u + i} ${d + i}h${g - u}v1H${u + i}z`
|
|
1121
1112
|
), u = null;
|
|
1122
1113
|
return;
|
|
@@ -1124,37 +1115,37 @@ function Xe(e, i = 0) {
|
|
|
1124
1115
|
if (g === l.length - 1) {
|
|
1125
1116
|
if (!p)
|
|
1126
1117
|
return;
|
|
1127
|
-
u === null ?
|
|
1118
|
+
u === null ? r.push(`M${g + i},${d + i} h1v1H${g + i}z`) : r.push(
|
|
1128
1119
|
`M${u + i},${d + i} h${g + 1 - u}v1H${u + i}z`
|
|
1129
1120
|
);
|
|
1130
1121
|
return;
|
|
1131
1122
|
}
|
|
1132
1123
|
p && u === null && (u = g);
|
|
1133
1124
|
});
|
|
1134
|
-
}),
|
|
1125
|
+
}), r.join("");
|
|
1135
1126
|
}
|
|
1136
1127
|
function Ze(e, i) {
|
|
1137
|
-
return e.slice().map((
|
|
1128
|
+
return e.slice().map((r, l) => l < i.y || l >= i.y + i.h ? r : r.map((d, u) => u < i.x || u >= i.x + i.w ? d : !1));
|
|
1138
1129
|
}
|
|
1139
|
-
function
|
|
1130
|
+
function Mr(e, i, r, l) {
|
|
1140
1131
|
if (l == null)
|
|
1141
1132
|
return null;
|
|
1142
|
-
const d = e.length +
|
|
1133
|
+
const d = e.length + r * 2, u = Math.floor(i * Ar), p = d / i, g = (l.width || u) * p, a = (l.height || u) * p, t = l.x == null ? e.length / 2 - g / 2 : l.x * p, s = l.y == null ? e.length / 2 - a / 2 : l.y * p, o = l.opacity == null ? 1 : l.opacity;
|
|
1143
1134
|
let c = null;
|
|
1144
1135
|
if (l.excavate) {
|
|
1145
|
-
let f = Math.floor(
|
|
1136
|
+
let f = Math.floor(t), h = Math.floor(s), x = Math.ceil(g + t - f), N = Math.ceil(a + s - h);
|
|
1146
1137
|
c = { x: f, y: h, w: x, h: N };
|
|
1147
1138
|
}
|
|
1148
1139
|
const m = l.crossOrigin;
|
|
1149
|
-
return { x:
|
|
1140
|
+
return { x: t, y: s, h: a, w: g, excavation: c, opacity: o, crossOrigin: m };
|
|
1150
1141
|
}
|
|
1151
|
-
function
|
|
1152
|
-
return i != null ? Math.max(Math.floor(i), 0) : e ?
|
|
1142
|
+
function Rr(e, i) {
|
|
1143
|
+
return i != null ? Math.max(Math.floor(i), 0) : e ? Er : Pr;
|
|
1153
1144
|
}
|
|
1154
1145
|
function Je({
|
|
1155
1146
|
value: e,
|
|
1156
1147
|
level: i,
|
|
1157
|
-
minVersion:
|
|
1148
|
+
minVersion: r,
|
|
1158
1149
|
includeMargin: l,
|
|
1159
1150
|
marginSize: d,
|
|
1160
1151
|
imageSettings: u,
|
|
@@ -1165,16 +1156,16 @@ function Je({
|
|
|
1165
1156
|
const f = (Array.isArray(e) ? e : [e]).reduce((h, x) => (h.push(...V.QrSegment.makeSegments(x)), h), []);
|
|
1166
1157
|
return V.QrCode.encodeSegments(
|
|
1167
1158
|
f,
|
|
1168
|
-
|
|
1169
|
-
|
|
1159
|
+
Sr[i],
|
|
1160
|
+
r,
|
|
1170
1161
|
void 0,
|
|
1171
1162
|
void 0,
|
|
1172
1163
|
g
|
|
1173
1164
|
);
|
|
1174
|
-
}, [e, i,
|
|
1175
|
-
const { cells:
|
|
1165
|
+
}, [e, i, r, g]);
|
|
1166
|
+
const { cells: t, margin: s, numCells: o, calculatedImageSettings: c } = A.useMemo(() => {
|
|
1176
1167
|
let m = a.getModules();
|
|
1177
|
-
const f =
|
|
1168
|
+
const f = Rr(l, d), h = m.length + f * 2, x = Mr(
|
|
1178
1169
|
m,
|
|
1179
1170
|
p,
|
|
1180
1171
|
f,
|
|
@@ -1190,27 +1181,27 @@ function Je({
|
|
|
1190
1181
|
return {
|
|
1191
1182
|
qrcode: a,
|
|
1192
1183
|
margin: s,
|
|
1193
|
-
cells:
|
|
1184
|
+
cells: t,
|
|
1194
1185
|
numCells: o,
|
|
1195
1186
|
calculatedImageSettings: c
|
|
1196
1187
|
};
|
|
1197
1188
|
}
|
|
1198
|
-
var
|
|
1189
|
+
var Fr = (function() {
|
|
1199
1190
|
try {
|
|
1200
1191
|
new Path2D().addPath(new Path2D());
|
|
1201
1192
|
} catch {
|
|
1202
1193
|
return !1;
|
|
1203
1194
|
}
|
|
1204
1195
|
return !0;
|
|
1205
|
-
})(),
|
|
1206
|
-
function(i,
|
|
1196
|
+
})(), Ir = A.forwardRef(
|
|
1197
|
+
function(i, r) {
|
|
1207
1198
|
const l = i, {
|
|
1208
1199
|
value: d,
|
|
1209
1200
|
size: u = Ve,
|
|
1210
1201
|
level: p = He,
|
|
1211
1202
|
bgColor: g = Ke,
|
|
1212
1203
|
fgColor: a = Ge,
|
|
1213
|
-
includeMargin:
|
|
1204
|
+
includeMargin: t = Ye,
|
|
1214
1205
|
minVersion: s = We,
|
|
1215
1206
|
boostLevel: o,
|
|
1216
1207
|
marginSize: c,
|
|
@@ -1228,15 +1219,15 @@ var Ir = (function() {
|
|
|
1228
1219
|
"imageSettings"
|
|
1229
1220
|
]), { style: x } = h, N = ie(h, ["style"]), C = m?.src, _ = A.useRef(null), w = A.useRef(null), M = A.useCallback(
|
|
1230
1221
|
(O) => {
|
|
1231
|
-
_.current = O, typeof
|
|
1222
|
+
_.current = O, typeof r == "function" ? r(O) : r && (r.current = O);
|
|
1232
1223
|
},
|
|
1233
|
-
[
|
|
1224
|
+
[r]
|
|
1234
1225
|
), [k, z] = A.useState(!1), { margin: F, cells: y, numCells: D, calculatedImageSettings: P } = Je({
|
|
1235
1226
|
value: d,
|
|
1236
1227
|
level: p,
|
|
1237
1228
|
minVersion: s,
|
|
1238
1229
|
boostLevel: o,
|
|
1239
|
-
includeMargin:
|
|
1230
|
+
includeMargin: t,
|
|
1240
1231
|
marginSize: c,
|
|
1241
1232
|
imageSettings: m,
|
|
1242
1233
|
size: u
|
|
@@ -1246,16 +1237,16 @@ var Ir = (function() {
|
|
|
1246
1237
|
const O = _.current, j = O.getContext("2d");
|
|
1247
1238
|
if (!j)
|
|
1248
1239
|
return;
|
|
1249
|
-
let
|
|
1240
|
+
let q = y;
|
|
1250
1241
|
const I = w.current, G = P != null && I !== null && I.complete && I.naturalHeight !== 0 && I.naturalWidth !== 0;
|
|
1251
|
-
G && P.excavation != null && (
|
|
1242
|
+
G && P.excavation != null && (q = Ze(
|
|
1252
1243
|
y,
|
|
1253
1244
|
P.excavation
|
|
1254
1245
|
));
|
|
1255
1246
|
const ve = window.devicePixelRatio || 1;
|
|
1256
1247
|
O.height = O.width = u * ve;
|
|
1257
1248
|
const ye = u / D * ve;
|
|
1258
|
-
j.scale(ye, ye), j.fillStyle = g, j.fillRect(0, 0, D, D), j.fillStyle = a,
|
|
1249
|
+
j.scale(ye, ye), j.fillStyle = g, j.fillRect(0, 0, D, D), j.fillStyle = a, Fr ? j.fill(new Path2D(Xe(q, F))) : y.forEach(function(ct, dt) {
|
|
1259
1250
|
ct.forEach(function(ut, ft) {
|
|
1260
1251
|
ut && j.fillRect(ft + F, dt + F, 1, 1);
|
|
1261
1252
|
});
|
|
@@ -1271,8 +1262,8 @@ var Ir = (function() {
|
|
|
1271
1262
|
z(!1);
|
|
1272
1263
|
}, [C]);
|
|
1273
1264
|
const X = ae({ height: u, width: u }, x);
|
|
1274
|
-
let
|
|
1275
|
-
return C != null && (
|
|
1265
|
+
let Q = null;
|
|
1266
|
+
return C != null && (Q = /* @__PURE__ */ A.createElement(
|
|
1276
1267
|
"img",
|
|
1277
1268
|
{
|
|
1278
1269
|
src: C,
|
|
@@ -1293,19 +1284,19 @@ var Ir = (function() {
|
|
|
1293
1284
|
ref: M,
|
|
1294
1285
|
role: "img"
|
|
1295
1286
|
}, N)
|
|
1296
|
-
),
|
|
1287
|
+
), Q);
|
|
1297
1288
|
}
|
|
1298
1289
|
);
|
|
1299
|
-
|
|
1290
|
+
Ir.displayName = "QRCodeCanvas";
|
|
1300
1291
|
var et = A.forwardRef(
|
|
1301
|
-
function(i,
|
|
1292
|
+
function(i, r) {
|
|
1302
1293
|
const l = i, {
|
|
1303
1294
|
value: d,
|
|
1304
1295
|
size: u = Ve,
|
|
1305
1296
|
level: p = He,
|
|
1306
1297
|
bgColor: g = Ke,
|
|
1307
1298
|
fgColor: a = Ge,
|
|
1308
|
-
includeMargin:
|
|
1299
|
+
includeMargin: t = Ye,
|
|
1309
1300
|
minVersion: s = We,
|
|
1310
1301
|
boostLevel: o,
|
|
1311
1302
|
title: c,
|
|
@@ -1328,7 +1319,7 @@ var et = A.forwardRef(
|
|
|
1328
1319
|
level: p,
|
|
1329
1320
|
minVersion: s,
|
|
1330
1321
|
boostLevel: o,
|
|
1331
|
-
includeMargin:
|
|
1322
|
+
includeMargin: t,
|
|
1332
1323
|
marginSize: m,
|
|
1333
1324
|
imageSettings: f,
|
|
1334
1325
|
size: u
|
|
@@ -1357,7 +1348,7 @@ var et = A.forwardRef(
|
|
|
1357
1348
|
height: u,
|
|
1358
1349
|
width: u,
|
|
1359
1350
|
viewBox: `0 0 ${C} ${C}`,
|
|
1360
|
-
ref:
|
|
1351
|
+
ref: r,
|
|
1361
1352
|
role: "img"
|
|
1362
1353
|
}, h),
|
|
1363
1354
|
!!c && /* @__PURE__ */ A.createElement("title", null, c),
|
|
@@ -1375,29 +1366,29 @@ var et = A.forwardRef(
|
|
|
1375
1366
|
}
|
|
1376
1367
|
);
|
|
1377
1368
|
et.displayName = "QRCodeSVG";
|
|
1378
|
-
function
|
|
1369
|
+
function Lr(e, i) {
|
|
1379
1370
|
ue({ title: e, type: i });
|
|
1380
1371
|
}
|
|
1381
|
-
function
|
|
1372
|
+
function kr({
|
|
1382
1373
|
onToast: e,
|
|
1383
1374
|
/* eslint-disable @typescript-eslint/no-unused-vars -- destructured to exclude from divProps spread */
|
|
1384
1375
|
background: i,
|
|
1385
|
-
textColor:
|
|
1376
|
+
textColor: r,
|
|
1386
1377
|
accentColor: l,
|
|
1387
1378
|
padding: d,
|
|
1388
1379
|
borderRadius: u,
|
|
1389
1380
|
/* eslint-enable @typescript-eslint/no-unused-vars */
|
|
1390
1381
|
...p
|
|
1391
1382
|
}) {
|
|
1392
|
-
const { currentSlug: g } = de(), a = e ??
|
|
1393
|
-
return /* @__PURE__ */ n.jsx("div", { ...p, children: /* @__PURE__ */ n.jsx(
|
|
1394
|
-
|
|
1383
|
+
const { currentSlug: g } = de(), a = e ?? Lr, t = g.split("/")[1], s = t !== void 0, { data: o } = Ae(), c = o?.id, m = o === void 0;
|
|
1384
|
+
return /* @__PURE__ */ n.jsx("div", { ...p, children: /* @__PURE__ */ n.jsx(Ft, { children: /* @__PURE__ */ n.jsx(It, { children: /* @__PURE__ */ n.jsx(Lt, { children: s ? /* @__PURE__ */ n.jsx(
|
|
1385
|
+
kt,
|
|
1395
1386
|
{
|
|
1396
|
-
token:
|
|
1387
|
+
token: t,
|
|
1397
1388
|
onToast: a
|
|
1398
1389
|
}
|
|
1399
1390
|
) : /* @__PURE__ */ n.jsx(
|
|
1400
|
-
|
|
1391
|
+
Dt,
|
|
1401
1392
|
{
|
|
1402
1393
|
customerId: c,
|
|
1403
1394
|
isLoadingCustomer: m,
|
|
@@ -1405,23 +1396,23 @@ function Dr({
|
|
|
1405
1396
|
}
|
|
1406
1397
|
) }) }) }) });
|
|
1407
1398
|
}
|
|
1408
|
-
const oe = "profile/",
|
|
1399
|
+
const oe = "profile/", Dr = /* @__PURE__ */ new Set(["orders", "subscriptions"]);
|
|
1409
1400
|
function Pe(e) {
|
|
1410
1401
|
return e.startsWith(oe) ? e.slice(oe.length) : e;
|
|
1411
1402
|
}
|
|
1412
|
-
function
|
|
1403
|
+
function Or({
|
|
1413
1404
|
children: e
|
|
1414
1405
|
}) {
|
|
1415
|
-
const { currentSlug: i, previousSlug:
|
|
1406
|
+
const { currentSlug: i, previousSlug: r, navigate: l } = de();
|
|
1416
1407
|
function d(u) {
|
|
1417
1408
|
const p = u.split("/")[0] ?? "";
|
|
1418
|
-
l(
|
|
1409
|
+
l(Dr.has(p) ? `${oe}${u}` : u);
|
|
1419
1410
|
}
|
|
1420
1411
|
return /* @__PURE__ */ n.jsx(
|
|
1421
1412
|
xt,
|
|
1422
1413
|
{
|
|
1423
1414
|
currentSlug: Pe(i),
|
|
1424
|
-
previousSlug:
|
|
1415
|
+
previousSlug: r === null ? null : Pe(r),
|
|
1425
1416
|
navItems: [],
|
|
1426
1417
|
basePath: "/profile",
|
|
1427
1418
|
navigate: d,
|
|
@@ -1435,38 +1426,38 @@ function tt() {
|
|
|
1435
1426
|
queryKey: bt.languages(),
|
|
1436
1427
|
queryFn: async () => {
|
|
1437
1428
|
const i = [];
|
|
1438
|
-
let
|
|
1429
|
+
let r;
|
|
1439
1430
|
const l = /* @__PURE__ */ new Set();
|
|
1440
1431
|
do {
|
|
1441
|
-
if (
|
|
1442
|
-
if (typeof
|
|
1432
|
+
if (r) {
|
|
1433
|
+
if (typeof r != "string" || l.has(r))
|
|
1443
1434
|
throw new Error("Language pagination did not advance");
|
|
1444
|
-
l.add(
|
|
1435
|
+
l.add(r);
|
|
1445
1436
|
}
|
|
1446
|
-
const d = await e.listLanguages({ limit: 100, cursor:
|
|
1447
|
-
i.push(...d.languages),
|
|
1448
|
-
} while (
|
|
1437
|
+
const d = await e.listLanguages({ limit: 100, cursor: r });
|
|
1438
|
+
i.push(...d.languages), r = d.meta.pagination?.next_cursor ?? void 0;
|
|
1439
|
+
} while (r);
|
|
1449
1440
|
return i;
|
|
1450
1441
|
}
|
|
1451
1442
|
});
|
|
1452
1443
|
}
|
|
1453
1444
|
function rt() {
|
|
1454
|
-
const e = _t(), i = H(), { setLocale:
|
|
1445
|
+
const e = _t(), i = H(), { setLocale: r } = T();
|
|
1455
1446
|
return K({
|
|
1456
1447
|
mutationFn: (l) => e.updateAccount({ account: l }),
|
|
1457
1448
|
onSuccess: (l, d) => {
|
|
1458
|
-
i.setQueryData(vt.detail(), l.account), d.language_iso && l.account.language_iso &&
|
|
1449
|
+
i.setQueryData(vt.detail(), l.account), d.language_iso && l.account.language_iso && r(l.account.language_iso);
|
|
1459
1450
|
}
|
|
1460
1451
|
});
|
|
1461
1452
|
}
|
|
1462
|
-
function
|
|
1453
|
+
function zr({
|
|
1463
1454
|
account: e,
|
|
1464
1455
|
onClose: i
|
|
1465
1456
|
}) {
|
|
1466
|
-
const { t } = R(), { isMobile: l } = W(), d = me(), u = tt(), p = rt(), g = d.data?.allow_name_edit === !1, a = Yt(
|
|
1457
|
+
const { t: r } = R(), { isMobile: l } = W(), d = me(), u = tt(), p = rt(), g = d.data?.allow_name_edit === !1, a = Yt(
|
|
1467
1458
|
se({
|
|
1468
|
-
first_name: g ? L() : L().min(1,
|
|
1469
|
-
last_name: g ? L() : L().min(1,
|
|
1459
|
+
first_name: g ? L() : L().min(1, r("first_name_is_required")),
|
|
1460
|
+
last_name: g ? L() : L().min(1, r("last_name_is_required")),
|
|
1470
1461
|
phone_number: L().optional(),
|
|
1471
1462
|
bio: L().optional(),
|
|
1472
1463
|
language: L()
|
|
@@ -1480,7 +1471,7 @@ function Tr({
|
|
|
1480
1471
|
language: e.language_iso ?? ""
|
|
1481
1472
|
}
|
|
1482
1473
|
}
|
|
1483
|
-
),
|
|
1474
|
+
), t = a.handleSubmit(async (s) => {
|
|
1484
1475
|
if (!p.isPending)
|
|
1485
1476
|
try {
|
|
1486
1477
|
const o = await d.refetch({ throwOnError: !0 });
|
|
@@ -1489,18 +1480,18 @@ function Tr({
|
|
|
1489
1480
|
phone: s.phone_number ?? "",
|
|
1490
1481
|
bio: s.bio ?? "",
|
|
1491
1482
|
...s.language ? { language_iso: s.language } : {}
|
|
1492
|
-
}), ue({ title:
|
|
1483
|
+
}), ue({ title: r("profile_updated"), type: "success" }), i();
|
|
1493
1484
|
} catch {
|
|
1494
|
-
a.setError("root", { message:
|
|
1485
|
+
a.setError("root", { message: r("failed_to_update_profile") });
|
|
1495
1486
|
}
|
|
1496
1487
|
});
|
|
1497
1488
|
return /* @__PURE__ */ n.jsx(
|
|
1498
|
-
|
|
1489
|
+
Cr,
|
|
1499
1490
|
{
|
|
1500
1491
|
control: a.control,
|
|
1501
1492
|
isOpen: !0,
|
|
1502
1493
|
onSubmit: () => {
|
|
1503
|
-
|
|
1494
|
+
t();
|
|
1504
1495
|
},
|
|
1505
1496
|
handleClose: () => {
|
|
1506
1497
|
!p.isPending && !a.formState.isSubmitting && i();
|
|
@@ -1510,7 +1501,7 @@ function Tr({
|
|
|
1510
1501
|
name: s.name,
|
|
1511
1502
|
value: s.code
|
|
1512
1503
|
})),
|
|
1513
|
-
errorMsg: a.formState.errors.root?.message ?? (u.error ?
|
|
1504
|
+
errorMsg: a.formState.errors.root?.message ?? (u.error ? r("profile_languages_unavailable") : void 0),
|
|
1514
1505
|
isSubmitting: p.isPending || a.formState.isSubmitting,
|
|
1515
1506
|
disableNameEdit: g,
|
|
1516
1507
|
presentation: l ? "bottom-sheet" : "dialog"
|
|
@@ -1526,30 +1517,30 @@ function ge() {
|
|
|
1526
1517
|
});
|
|
1527
1518
|
}
|
|
1528
1519
|
function nt(e) {
|
|
1529
|
-
const i = Zt(), { locale:
|
|
1520
|
+
const i = Zt(), { locale: r } = T();
|
|
1530
1521
|
return $({
|
|
1531
|
-
queryKey: ["memberStorefront", "profile", "countries",
|
|
1532
|
-
queryFn: () => i.listCountries({ languageIso:
|
|
1522
|
+
queryKey: ["memberStorefront", "profile", "countries", r],
|
|
1523
|
+
queryFn: () => i.listCountries({ languageIso: r }),
|
|
1533
1524
|
enabled: e
|
|
1534
1525
|
});
|
|
1535
1526
|
}
|
|
1536
|
-
function
|
|
1527
|
+
function Tr() {
|
|
1537
1528
|
const e = B(), i = H();
|
|
1538
1529
|
return K({
|
|
1539
1530
|
mutationFn: async ({
|
|
1540
|
-
addressId:
|
|
1531
|
+
addressId: r,
|
|
1541
1532
|
body: l
|
|
1542
1533
|
}) => {
|
|
1543
|
-
if (
|
|
1544
|
-
await e.updateAddress(
|
|
1534
|
+
if (r === void 0) return e.createAddress(l);
|
|
1535
|
+
await e.updateAddress(r, l);
|
|
1545
1536
|
},
|
|
1546
1537
|
onSuccess: () => i.invalidateQueries({ queryKey: pe })
|
|
1547
1538
|
});
|
|
1548
1539
|
}
|
|
1549
|
-
function
|
|
1540
|
+
function Br() {
|
|
1550
1541
|
const e = B(), i = H();
|
|
1551
1542
|
return K({
|
|
1552
|
-
mutationFn: (
|
|
1543
|
+
mutationFn: (r) => e.deleteAddress(r),
|
|
1553
1544
|
onSuccess: () => i.invalidateQueries({ queryKey: pe })
|
|
1554
1545
|
});
|
|
1555
1546
|
}
|
|
@@ -1571,10 +1562,10 @@ function xe(e) {
|
|
|
1571
1562
|
function st({
|
|
1572
1563
|
isOpen: e,
|
|
1573
1564
|
onClose: i,
|
|
1574
|
-
selectedAddress:
|
|
1565
|
+
selectedAddress: r,
|
|
1575
1566
|
onAddressCreated: l
|
|
1576
1567
|
}) {
|
|
1577
|
-
const { t: d } = R(), { isMobile: u } = W(), { locale: p } = T(), g = nt(e), a = ge(),
|
|
1568
|
+
const { t: d } = R(), { isMobile: u } = W(), { locale: p } = T(), g = nt(e), a = ge(), t = Tr(), s = v.useCallback(
|
|
1578
1569
|
(o) => Promise.resolve(
|
|
1579
1570
|
g.data?.countries.find((c) => c.code === o)?.states.map((c) => ({
|
|
1580
1571
|
name: c.name,
|
|
@@ -1585,15 +1576,15 @@ function st({
|
|
|
1585
1576
|
);
|
|
1586
1577
|
if (e && g.error) throw g.error;
|
|
1587
1578
|
return e && g.isPending ? /* @__PURE__ */ n.jsx("p", { role: "status", children: d("profile_loading") }) : /* @__PURE__ */ n.jsx(
|
|
1588
|
-
|
|
1579
|
+
Ot,
|
|
1589
1580
|
{
|
|
1590
1581
|
isOpen: e,
|
|
1591
1582
|
onClose: () => {
|
|
1592
|
-
|
|
1583
|
+
t.isPending || (t.reset(), i());
|
|
1593
1584
|
},
|
|
1594
|
-
selectedAddress:
|
|
1585
|
+
selectedAddress: r,
|
|
1595
1586
|
presentation: u ? "bottom-sheet" : "dialog",
|
|
1596
|
-
defaultCountry:
|
|
1587
|
+
defaultCountry: r?.country_code ?? a.data?.addresses.find((o) => o.default)?.country ?? "US",
|
|
1597
1588
|
languageIso: p,
|
|
1598
1589
|
countries: g.data?.countries.map((o) => ({
|
|
1599
1590
|
iso: o.code,
|
|
@@ -1601,16 +1592,16 @@ function st({
|
|
|
1601
1592
|
})),
|
|
1602
1593
|
fetchStates: s,
|
|
1603
1594
|
t: (o) => d(o),
|
|
1604
|
-
isSubmitting:
|
|
1605
|
-
error:
|
|
1606
|
-
|
|
1595
|
+
isSubmitting: t.isPending,
|
|
1596
|
+
error: t.error ? d(
|
|
1597
|
+
r ? "failed_to_update_address" : "failed_to_create_address"
|
|
1607
1598
|
) : g.error ? d("unexpected_error") : void 0,
|
|
1608
1599
|
onSubmit: (o) => {
|
|
1609
|
-
if (
|
|
1600
|
+
if (t.isPending) return;
|
|
1610
1601
|
const c = o.address;
|
|
1611
|
-
|
|
1602
|
+
t.mutate(
|
|
1612
1603
|
{
|
|
1613
|
-
addressId:
|
|
1604
|
+
addressId: r?.id,
|
|
1614
1605
|
body: {
|
|
1615
1606
|
address: {
|
|
1616
1607
|
name: c.name,
|
|
@@ -1627,7 +1618,7 @@ function st({
|
|
|
1627
1618
|
},
|
|
1628
1619
|
{
|
|
1629
1620
|
onSuccess: (m) => {
|
|
1630
|
-
m && l?.(xe(m)),
|
|
1621
|
+
m && l?.(xe(m)), t.reset(), i();
|
|
1631
1622
|
}
|
|
1632
1623
|
}
|
|
1633
1624
|
);
|
|
@@ -1635,8 +1626,8 @@ function st({
|
|
|
1635
1626
|
}
|
|
1636
1627
|
);
|
|
1637
1628
|
}
|
|
1638
|
-
function
|
|
1639
|
-
const { t: e } = R(), i = ge(),
|
|
1629
|
+
function Ur() {
|
|
1630
|
+
const { t: e } = R(), i = ge(), r = Br(), l = v.useRef(null), [d, u] = v.useState(), [p, g] = v.useState(null);
|
|
1640
1631
|
if (i.error) throw i.error;
|
|
1641
1632
|
function a() {
|
|
1642
1633
|
requestAnimationFrame(() => l.current?.focus());
|
|
@@ -1652,21 +1643,21 @@ function $r() {
|
|
|
1652
1643
|
children: [
|
|
1653
1644
|
i.isPending && /* @__PURE__ */ n.jsx("p", { role: "status", className: "text-muted-foreground text-sm", children: e("profile_loading") }),
|
|
1654
1645
|
!i.isPending && !i.data?.addresses.length && /* @__PURE__ */ n.jsx("p", { className: "text-muted-foreground text-sm", children: e("no_saved_addresses_found") }),
|
|
1655
|
-
i.data?.addresses.map((
|
|
1646
|
+
i.data?.addresses.map((t) => /* @__PURE__ */ n.jsxs(
|
|
1656
1647
|
"section",
|
|
1657
1648
|
{
|
|
1658
|
-
"aria-label":
|
|
1649
|
+
"aria-label": t.street1,
|
|
1659
1650
|
className: "bg-card text-card-foreground border-border space-y-4 rounded-xl border p-5",
|
|
1660
1651
|
children: [
|
|
1661
1652
|
/* @__PURE__ */ n.jsxs("div", { className: "space-y-1 text-sm", children: [
|
|
1662
1653
|
/* @__PURE__ */ n.jsxs("div", { className: "flex items-center justify-between gap-3", children: [
|
|
1663
|
-
/* @__PURE__ */ n.jsx("p", { className: "font-medium", children:
|
|
1664
|
-
|
|
1654
|
+
/* @__PURE__ */ n.jsx("p", { className: "font-medium", children: t.name }),
|
|
1655
|
+
t.default && /* @__PURE__ */ n.jsx(Ie, { variant: "secondary", children: e("default") })
|
|
1665
1656
|
] }),
|
|
1666
|
-
/* @__PURE__ */ n.jsx("p", { children:
|
|
1667
|
-
|
|
1668
|
-
/* @__PURE__ */ n.jsx("p", { children: [
|
|
1669
|
-
/* @__PURE__ */ n.jsx("p", { children:
|
|
1657
|
+
/* @__PURE__ */ n.jsx("p", { children: t.street1 }),
|
|
1658
|
+
t.street2 && /* @__PURE__ */ n.jsx("p", { children: t.street2 }),
|
|
1659
|
+
/* @__PURE__ */ n.jsx("p", { children: [t.city, t.state, t.zip].filter(Boolean).join(", ") }),
|
|
1660
|
+
/* @__PURE__ */ n.jsx("p", { children: t.country })
|
|
1670
1661
|
] }),
|
|
1671
1662
|
/* @__PURE__ */ n.jsxs("div", { className: "flex gap-2", children: [
|
|
1672
1663
|
/* @__PURE__ */ n.jsx(
|
|
@@ -1674,17 +1665,17 @@ function $r() {
|
|
|
1674
1665
|
{
|
|
1675
1666
|
variant: "outline",
|
|
1676
1667
|
size: "sm",
|
|
1677
|
-
onClick: () => u(
|
|
1668
|
+
onClick: () => u(t),
|
|
1678
1669
|
children: e("edit_address")
|
|
1679
1670
|
}
|
|
1680
1671
|
),
|
|
1681
|
-
!
|
|
1672
|
+
!t.default && /* @__PURE__ */ n.jsx(
|
|
1682
1673
|
E,
|
|
1683
1674
|
{
|
|
1684
1675
|
variant: "ghost",
|
|
1685
1676
|
size: "sm",
|
|
1686
1677
|
onClick: () => {
|
|
1687
|
-
|
|
1678
|
+
r.reset(), g(t);
|
|
1688
1679
|
},
|
|
1689
1680
|
children: e("delete_address")
|
|
1690
1681
|
}
|
|
@@ -1692,7 +1683,7 @@ function $r() {
|
|
|
1692
1683
|
] })
|
|
1693
1684
|
]
|
|
1694
1685
|
},
|
|
1695
|
-
|
|
1686
|
+
t.id
|
|
1696
1687
|
)),
|
|
1697
1688
|
/* @__PURE__ */ n.jsx(E, { onClick: () => u(null), children: e("add_address") }),
|
|
1698
1689
|
d !== void 0 && /* @__PURE__ */ n.jsx(
|
|
@@ -1706,19 +1697,19 @@ function $r() {
|
|
|
1706
1697
|
}
|
|
1707
1698
|
),
|
|
1708
1699
|
/* @__PURE__ */ n.jsx(
|
|
1709
|
-
|
|
1700
|
+
Re,
|
|
1710
1701
|
{
|
|
1711
1702
|
title: e("delete_address"),
|
|
1712
1703
|
description: e("delete_address_message"),
|
|
1713
1704
|
actionText: e("delete"),
|
|
1714
1705
|
openDialog: p !== null,
|
|
1715
|
-
setOpenDialog: (
|
|
1716
|
-
!
|
|
1706
|
+
setOpenDialog: (t) => {
|
|
1707
|
+
!t && !r.isPending && (g(null), a());
|
|
1717
1708
|
},
|
|
1718
|
-
isLoading:
|
|
1719
|
-
errorMsg:
|
|
1709
|
+
isLoading: r.isPending,
|
|
1710
|
+
errorMsg: r.error ? e("unable_to_delete_address") : void 0,
|
|
1720
1711
|
onAction: () => {
|
|
1721
|
-
!p ||
|
|
1712
|
+
!p || r.isPending || r.mutate(p.id, {
|
|
1722
1713
|
onSuccess: () => {
|
|
1723
1714
|
g(null), a();
|
|
1724
1715
|
}
|
|
@@ -1745,30 +1736,30 @@ function at() {
|
|
|
1745
1736
|
}
|
|
1746
1737
|
});
|
|
1747
1738
|
}
|
|
1748
|
-
function
|
|
1749
|
-
const { t: e } = R(), { locale: i } = T(),
|
|
1750
|
-
if (
|
|
1751
|
-
if (
|
|
1739
|
+
function $r() {
|
|
1740
|
+
const { t: e } = R(), { locale: i } = T(), r = at(), l = me();
|
|
1741
|
+
if (r.error) throw r.error;
|
|
1742
|
+
if (r.isPending || !l.data)
|
|
1752
1743
|
return /* @__PURE__ */ n.jsx("p", { role: "status", children: e("profile_loading") });
|
|
1753
|
-
if (!
|
|
1744
|
+
if (!r.data)
|
|
1754
1745
|
return /* @__PURE__ */ n.jsx("p", { role: "status", children: e("profile_points_unavailable") });
|
|
1755
|
-
const d =
|
|
1746
|
+
const d = r.data.points_ledgers, u = d[0]?.total_balance ?? 0, p = u === 1 ? l.data.reward_points_label_singular : l.data.reward_points_label_plural, g = l.data.reward_points_label_plural, a = p.charAt(0).toLocaleUpperCase(i) + p.slice(1), t = g.charAt(0).toLocaleUpperCase(i) + g.slice(1), s = new Intl.NumberFormat(i), o = new Intl.DateTimeFormat(i, { dateStyle: "medium" });
|
|
1756
1747
|
return /* @__PURE__ */ n.jsxs("div", { className: "space-y-6", children: [
|
|
1757
1748
|
/* @__PURE__ */ n.jsxs("section", { className: "bg-card text-card-foreground border-border space-y-2 rounded-xl border p-6", children: [
|
|
1758
1749
|
/* @__PURE__ */ n.jsx("h2", { className: "text-muted-foreground text-sm", children: e("points_available", { label: a }) }),
|
|
1759
1750
|
/* @__PURE__ */ n.jsx("p", { className: "text-4xl font-semibold tabular-nums", children: s.format(u) })
|
|
1760
1751
|
] }),
|
|
1761
1752
|
/* @__PURE__ */ n.jsxs("section", { className: "space-y-3", children: [
|
|
1762
|
-
/* @__PURE__ */ n.jsx("h2", { className: "font-semibold", children: e("points_history", { label:
|
|
1753
|
+
/* @__PURE__ */ n.jsx("h2", { className: "font-semibold", children: e("points_history", { label: t }) }),
|
|
1763
1754
|
d.length ? /* @__PURE__ */ n.jsx("ol", { className: "border-border divide-border divide-y rounded-xl border", children: d.map((c) => /* @__PURE__ */ n.jsxs(
|
|
1764
1755
|
"li",
|
|
1765
1756
|
{
|
|
1766
1757
|
className: "flex items-center justify-between gap-4 p-4",
|
|
1767
1758
|
children: [
|
|
1768
1759
|
/* @__PURE__ */ n.jsxs("div", { className: "space-y-1", children: [
|
|
1769
|
-
/* @__PURE__ */ n.jsx("p", { className: "text-sm font-medium", children: c.metadata?.transaction_type === "order_refund" ? e("profile_points_refunded", { label:
|
|
1760
|
+
/* @__PURE__ */ n.jsx("p", { className: "text-sm font-medium", children: c.metadata?.transaction_type === "order_refund" ? e("profile_points_refunded", { label: t }) : e(
|
|
1770
1761
|
c.amount > 0 ? "points_awarded" : "points_redeemed",
|
|
1771
|
-
{ label:
|
|
1762
|
+
{ label: t }
|
|
1772
1763
|
) }),
|
|
1773
1764
|
/* @__PURE__ */ n.jsx(
|
|
1774
1765
|
"time",
|
|
@@ -1786,47 +1777,47 @@ function qr() {
|
|
|
1786
1777
|
]
|
|
1787
1778
|
},
|
|
1788
1779
|
c.id
|
|
1789
|
-
)) }) : /* @__PURE__ */ n.jsx("p", { className: "text-muted-foreground text-sm", children: e("no_points_history_found", { label:
|
|
1780
|
+
)) }) : /* @__PURE__ */ n.jsx("p", { className: "text-muted-foreground text-sm", children: e("no_points_history_found", { label: t }) })
|
|
1790
1781
|
] })
|
|
1791
1782
|
] });
|
|
1792
1783
|
}
|
|
1793
1784
|
function Qr({
|
|
1794
1785
|
children: e
|
|
1795
1786
|
}) {
|
|
1796
|
-
const i = v.useRef(null), [
|
|
1787
|
+
const i = v.useRef(null), [r, l] = v.useState(null);
|
|
1797
1788
|
return v.useEffect(() => {
|
|
1798
1789
|
if (!i.current) return;
|
|
1799
|
-
const d =
|
|
1790
|
+
const d = zt(i.current);
|
|
1800
1791
|
return l(d), () => d.remove();
|
|
1801
1792
|
}, []), /* @__PURE__ */ n.jsxs(n.Fragment, { children: [
|
|
1802
1793
|
/* @__PURE__ */ n.jsx("span", { ref: i, hidden: !0 }),
|
|
1803
|
-
|
|
1804
|
-
/* @__PURE__ */ n.jsx(jt, { container:
|
|
1805
|
-
|
|
1794
|
+
r && yt.createPortal(
|
|
1795
|
+
/* @__PURE__ */ n.jsx(jt, { container: r, children: e }),
|
|
1796
|
+
r
|
|
1806
1797
|
)
|
|
1807
1798
|
] });
|
|
1808
1799
|
}
|
|
1809
|
-
function
|
|
1800
|
+
function qr({
|
|
1810
1801
|
onClose: e
|
|
1811
1802
|
}) {
|
|
1812
|
-
const i = ge(), { t } = R(), { isMobile: l } = W();
|
|
1803
|
+
const i = ge(), { t: r } = R(), { isMobile: l } = W();
|
|
1813
1804
|
return /* @__PURE__ */ n.jsx(Qr, { children: i.data ? /* @__PURE__ */ n.jsx(
|
|
1814
|
-
|
|
1805
|
+
Vr,
|
|
1815
1806
|
{
|
|
1816
1807
|
initialAddresses: i.data.addresses,
|
|
1817
1808
|
onClose: e
|
|
1818
1809
|
}
|
|
1819
1810
|
) : /* @__PURE__ */ n.jsxs(
|
|
1820
|
-
|
|
1811
|
+
Fe,
|
|
1821
1812
|
{
|
|
1822
1813
|
open: !0,
|
|
1823
1814
|
onOpenChange: (d) => {
|
|
1824
1815
|
d || e();
|
|
1825
1816
|
},
|
|
1826
|
-
title:
|
|
1817
|
+
title: r("add_payment_method"),
|
|
1827
1818
|
presentation: l ? "bottom-sheet" : "dialog",
|
|
1828
1819
|
children: [
|
|
1829
|
-
/* @__PURE__ */ n.jsx("p", { role: i.error ? "alert" : "status", children:
|
|
1820
|
+
/* @__PURE__ */ n.jsx("p", { role: i.error ? "alert" : "status", children: r(i.error ? "unexpected_error" : "profile_loading") }),
|
|
1830
1821
|
i.error && /* @__PURE__ */ n.jsx(
|
|
1831
1822
|
E,
|
|
1832
1823
|
{
|
|
@@ -1834,26 +1825,26 @@ function Vr({
|
|
|
1834
1825
|
onClick: () => {
|
|
1835
1826
|
i.refetch();
|
|
1836
1827
|
},
|
|
1837
|
-
children:
|
|
1828
|
+
children: r("profile_try_again")
|
|
1838
1829
|
}
|
|
1839
1830
|
)
|
|
1840
1831
|
]
|
|
1841
1832
|
}
|
|
1842
1833
|
) });
|
|
1843
1834
|
}
|
|
1844
|
-
function
|
|
1835
|
+
function Vr({
|
|
1845
1836
|
initialAddresses: e,
|
|
1846
1837
|
onClose: i
|
|
1847
1838
|
}) {
|
|
1848
|
-
const { t } = R(), { isMobile: l } = W(), d = B(), u = H(), [p, g] = v.useState(), a = v.useMemo(() =>
|
|
1839
|
+
const { t: r } = R(), { isMobile: l } = W(), d = B(), u = H(), [p, g] = v.useState(), a = v.useMemo(() => Tt(d), [d]), [t] = v.useState(
|
|
1849
1840
|
() => e.map(xe)
|
|
1850
1841
|
);
|
|
1851
1842
|
async function s() {
|
|
1852
1843
|
await u.invalidateQueries({ queryKey: J.paymentMethods.all }), i();
|
|
1853
1844
|
}
|
|
1854
|
-
const o =
|
|
1845
|
+
const o = Bt({
|
|
1855
1846
|
payApi: d,
|
|
1856
|
-
t: (m) =>
|
|
1847
|
+
t: (m) => r(m),
|
|
1857
1848
|
onApproved: s,
|
|
1858
1849
|
onFailed: g,
|
|
1859
1850
|
onCanceled: () => {
|
|
@@ -1867,23 +1858,23 @@ function Hr({
|
|
|
1867
1858
|
default: m.set_as_default
|
|
1868
1859
|
},
|
|
1869
1860
|
billing_address_id: m.billing_address_id,
|
|
1870
|
-
browser_info:
|
|
1861
|
+
browser_info: $t()
|
|
1871
1862
|
}),
|
|
1872
1863
|
onSuccess: async (m) => {
|
|
1873
|
-
|
|
1864
|
+
Ut(m) ? await o.begin(m) : await s();
|
|
1874
1865
|
},
|
|
1875
|
-
onError: () => g(
|
|
1866
|
+
onError: () => g(r("failed_to_add_payment_method"))
|
|
1876
1867
|
});
|
|
1877
|
-
return /* @__PURE__ */ n.jsxs(
|
|
1868
|
+
return /* @__PURE__ */ n.jsxs(qt, { api: a, children: [
|
|
1878
1869
|
/* @__PURE__ */ n.jsx(
|
|
1879
|
-
|
|
1870
|
+
Vt,
|
|
1880
1871
|
{
|
|
1881
1872
|
isOpen: !0,
|
|
1882
1873
|
jwt: "",
|
|
1883
|
-
savedAddresses:
|
|
1884
|
-
defaultBillingAddressId:
|
|
1874
|
+
savedAddresses: t,
|
|
1875
|
+
defaultBillingAddressId: t.find((m) => m.default)?.id,
|
|
1885
1876
|
presentation: l ? "bottom-sheet" : "dialog",
|
|
1886
|
-
t: (m) =>
|
|
1877
|
+
t: (m) => r(m),
|
|
1887
1878
|
error: p,
|
|
1888
1879
|
isSubmitting: c.isPending || o.isActive,
|
|
1889
1880
|
preventClose: c.isPending || o.isActive,
|
|
@@ -1921,24 +1912,24 @@ function it() {
|
|
|
1921
1912
|
function ot() {
|
|
1922
1913
|
const e = B(), i = H();
|
|
1923
1914
|
return K({
|
|
1924
|
-
mutationFn: ({ id:
|
|
1915
|
+
mutationFn: ({ id: r, body: l }) => e.updatePaymentMethod(r, l),
|
|
1925
1916
|
onSuccess: () => i.invalidateQueries({ queryKey: J.paymentMethods.all })
|
|
1926
1917
|
});
|
|
1927
1918
|
}
|
|
1928
|
-
function
|
|
1919
|
+
function Hr() {
|
|
1929
1920
|
const e = B(), i = H();
|
|
1930
1921
|
return K({
|
|
1931
|
-
mutationFn: (
|
|
1922
|
+
mutationFn: (r) => e.deletePaymentMethod(r),
|
|
1932
1923
|
onSuccess: () => i.invalidateQueries({ queryKey: J.paymentMethods.all })
|
|
1933
1924
|
});
|
|
1934
1925
|
}
|
|
1935
|
-
function
|
|
1926
|
+
function Kr({
|
|
1936
1927
|
card: e,
|
|
1937
1928
|
onClose: i
|
|
1938
1929
|
}) {
|
|
1939
|
-
const { t } = R(), { locale: l } = T(), { isMobile: d } = W(), u = nt(!0), p = ot(), g = v.useMemo(() =>
|
|
1940
|
-
(
|
|
1941
|
-
u.data?.countries.find((s) => s.code ===
|
|
1930
|
+
const { t: r } = R(), { locale: l } = T(), { isMobile: d } = W(), u = nt(!0), p = ot(), g = v.useMemo(() => Ht(e), [e]), a = v.useCallback(
|
|
1931
|
+
(t) => Promise.resolve(
|
|
1932
|
+
u.data?.countries.find((s) => s.code === t)?.states.map((s) => ({
|
|
1942
1933
|
name: s.name,
|
|
1943
1934
|
isoCode: s.code
|
|
1944
1935
|
})) ?? []
|
|
@@ -1946,33 +1937,33 @@ function Gr({
|
|
|
1946
1937
|
[u.data]
|
|
1947
1938
|
);
|
|
1948
1939
|
if (u.error) throw u.error;
|
|
1949
|
-
return u.isPending ? /* @__PURE__ */ n.jsx("p", { role: "status", children:
|
|
1950
|
-
|
|
1940
|
+
return u.isPending ? /* @__PURE__ */ n.jsx("p", { role: "status", children: r("profile_loading") }) : /* @__PURE__ */ n.jsx(
|
|
1941
|
+
Kt,
|
|
1951
1942
|
{
|
|
1952
1943
|
isOpen: !0,
|
|
1953
1944
|
paymentMethod: g,
|
|
1954
1945
|
billingAddress: g.billing_address,
|
|
1955
|
-
countries: u.data?.countries.map((
|
|
1956
|
-
iso:
|
|
1957
|
-
name:
|
|
1946
|
+
countries: u.data?.countries.map((t) => ({
|
|
1947
|
+
iso: t.code,
|
|
1948
|
+
name: t.name
|
|
1958
1949
|
})),
|
|
1959
1950
|
fetchStates: a,
|
|
1960
1951
|
languageIso: l,
|
|
1961
1952
|
presentation: d ? "bottom-sheet" : "dialog",
|
|
1962
1953
|
isSubmitting: p.isPending,
|
|
1963
|
-
error: p.error ?
|
|
1954
|
+
error: p.error ? r("failed_to_update_payment_method") : void 0,
|
|
1964
1955
|
onClose: () => {
|
|
1965
1956
|
p.isPending || i();
|
|
1966
1957
|
},
|
|
1967
|
-
onSubmit: (
|
|
1958
|
+
onSubmit: (t) => {
|
|
1968
1959
|
if (p.isPending) return;
|
|
1969
|
-
const s =
|
|
1960
|
+
const s = t.billing_address;
|
|
1970
1961
|
p.mutate(
|
|
1971
1962
|
{
|
|
1972
1963
|
id: e.id,
|
|
1973
1964
|
body: {
|
|
1974
1965
|
payment_method: {
|
|
1975
|
-
default:
|
|
1966
|
+
default: t.set_as_default,
|
|
1976
1967
|
billing_address: {
|
|
1977
1968
|
name: s.name,
|
|
1978
1969
|
street1: s.address1,
|
|
@@ -1991,8 +1982,8 @@ function Gr({
|
|
|
1991
1982
|
}
|
|
1992
1983
|
);
|
|
1993
1984
|
}
|
|
1994
|
-
function
|
|
1995
|
-
const { t: e } = R(), { preview: i } = fe(),
|
|
1985
|
+
function Gr() {
|
|
1986
|
+
const { t: e } = R(), { preview: i } = fe(), r = it(), l = ot(), d = Hr(), u = v.useRef(null), p = v.useRef(null), [g, a] = v.useState(!1), [t, s] = v.useState(null), [o, c] = v.useState(null);
|
|
1996
1987
|
function m() {
|
|
1997
1988
|
requestAnimationFrame(() => {
|
|
1998
1989
|
(u.current?.isConnected ? u.current : p.current?.querySelector("button") ?? p.current)?.focus();
|
|
@@ -2007,23 +1998,23 @@ function Yr() {
|
|
|
2007
1998
|
"aria-label": e("payment_methods"),
|
|
2008
1999
|
className: "space-y-4 outline-none",
|
|
2009
2000
|
children: [
|
|
2010
|
-
|
|
2011
|
-
|
|
2001
|
+
r.isPending && /* @__PURE__ */ n.jsx("p", { role: "status", children: e("profile_loading") }),
|
|
2002
|
+
r.error && /* @__PURE__ */ n.jsxs("div", { role: "alert", className: "space-y-3", children: [
|
|
2012
2003
|
/* @__PURE__ */ n.jsx("p", { children: e("profile_payments_load_failed") }),
|
|
2013
2004
|
/* @__PURE__ */ n.jsx(
|
|
2014
2005
|
E,
|
|
2015
2006
|
{
|
|
2016
2007
|
variant: "outline",
|
|
2017
|
-
disabled:
|
|
2008
|
+
disabled: r.isFetching,
|
|
2018
2009
|
onClick: () => {
|
|
2019
|
-
|
|
2010
|
+
r.refetch();
|
|
2020
2011
|
},
|
|
2021
2012
|
children: e("profile_payments_retry")
|
|
2022
2013
|
}
|
|
2023
2014
|
)
|
|
2024
2015
|
] }),
|
|
2025
|
-
|
|
2026
|
-
|
|
2016
|
+
r.data?.payment_methods.length === 0 && /* @__PURE__ */ n.jsx("p", { className: "text-muted-foreground text-sm", children: e("profile_no_saved_cards") }),
|
|
2017
|
+
r.data?.payment_methods.map((f) => /* @__PURE__ */ n.jsxs(
|
|
2027
2018
|
"section",
|
|
2028
2019
|
{
|
|
2029
2020
|
className: "bg-card text-card-foreground border-border space-y-4 rounded-xl border p-5",
|
|
@@ -2033,7 +2024,7 @@ function Yr() {
|
|
|
2033
2024
|
brand: f.brand || e("card_fallback"),
|
|
2034
2025
|
lastFour: f.last_four
|
|
2035
2026
|
}) }),
|
|
2036
|
-
f.default && /* @__PURE__ */ n.jsx(
|
|
2027
|
+
f.default && /* @__PURE__ */ n.jsx(Ie, { variant: "secondary", children: e("default") })
|
|
2037
2028
|
] }),
|
|
2038
2029
|
f.exp_month !== null && f.exp_year !== null && /* @__PURE__ */ n.jsxs("p", { className: "text-muted-foreground text-sm", children: [
|
|
2039
2030
|
e("card_expires"),
|
|
@@ -2099,24 +2090,24 @@ function Yr() {
|
|
|
2099
2090
|
}
|
|
2100
2091
|
),
|
|
2101
2092
|
g && /* @__PURE__ */ n.jsx(
|
|
2102
|
-
|
|
2093
|
+
qr,
|
|
2103
2094
|
{
|
|
2104
2095
|
onClose: () => {
|
|
2105
2096
|
a(!1), m();
|
|
2106
2097
|
}
|
|
2107
2098
|
}
|
|
2108
2099
|
),
|
|
2109
|
-
|
|
2110
|
-
|
|
2100
|
+
t && /* @__PURE__ */ n.jsx(
|
|
2101
|
+
Kr,
|
|
2111
2102
|
{
|
|
2112
|
-
card:
|
|
2103
|
+
card: t,
|
|
2113
2104
|
onClose: () => {
|
|
2114
2105
|
s(null), m();
|
|
2115
2106
|
}
|
|
2116
2107
|
}
|
|
2117
2108
|
),
|
|
2118
2109
|
/* @__PURE__ */ n.jsx(
|
|
2119
|
-
|
|
2110
|
+
Re,
|
|
2120
2111
|
{
|
|
2121
2112
|
title: e("delete_credit_card"),
|
|
2122
2113
|
description: e("delete_credit_card_message"),
|
|
@@ -2143,7 +2134,7 @@ function Yr() {
|
|
|
2143
2134
|
function _e({
|
|
2144
2135
|
icon: e,
|
|
2145
2136
|
label: i,
|
|
2146
|
-
detail:
|
|
2137
|
+
detail: r,
|
|
2147
2138
|
busy: l,
|
|
2148
2139
|
onOpen: d,
|
|
2149
2140
|
triggerRef: u
|
|
@@ -2164,7 +2155,7 @@ function _e({
|
|
|
2164
2155
|
{
|
|
2165
2156
|
className: "text-muted-foreground block text-sm",
|
|
2166
2157
|
role: l ? "status" : void 0,
|
|
2167
|
-
children:
|
|
2158
|
+
children: r
|
|
2168
2159
|
}
|
|
2169
2160
|
)
|
|
2170
2161
|
] }),
|
|
@@ -2182,7 +2173,7 @@ function _e({
|
|
|
2182
2173
|
function be({
|
|
2183
2174
|
message: e,
|
|
2184
2175
|
retryLabel: i,
|
|
2185
|
-
isRetrying:
|
|
2176
|
+
isRetrying: r,
|
|
2186
2177
|
onRetry: l
|
|
2187
2178
|
}) {
|
|
2188
2179
|
return /* @__PURE__ */ n.jsxs("div", { role: "alert", className: "border-border space-y-3 rounded-xl border p-5", children: [
|
|
@@ -2192,23 +2183,23 @@ function be({
|
|
|
2192
2183
|
{
|
|
2193
2184
|
variant: "outline",
|
|
2194
2185
|
size: "sm",
|
|
2195
|
-
disabled:
|
|
2186
|
+
disabled: r,
|
|
2196
2187
|
onClick: l,
|
|
2197
2188
|
children: i
|
|
2198
2189
|
}
|
|
2199
2190
|
)
|
|
2200
2191
|
] });
|
|
2201
2192
|
}
|
|
2202
|
-
function
|
|
2193
|
+
function Yr({
|
|
2203
2194
|
onOpen: e,
|
|
2204
2195
|
triggerRef: i
|
|
2205
2196
|
}) {
|
|
2206
|
-
const { t } = R(), l = it(), d = l.data?.payment_methods.find((u) => u.default);
|
|
2197
|
+
const { t: r } = R(), l = it(), d = l.data?.payment_methods.find((u) => u.default);
|
|
2207
2198
|
return l.error ? /* @__PURE__ */ n.jsx(
|
|
2208
2199
|
be,
|
|
2209
2200
|
{
|
|
2210
|
-
message:
|
|
2211
|
-
retryLabel:
|
|
2201
|
+
message: r("profile_payments_load_failed"),
|
|
2202
|
+
retryLabel: r("profile_payments_retry"),
|
|
2212
2203
|
isRetrying: l.isFetching,
|
|
2213
2204
|
onRetry: () => void l.refetch()
|
|
2214
2205
|
}
|
|
@@ -2216,21 +2207,21 @@ function Wr({
|
|
|
2216
2207
|
_e,
|
|
2217
2208
|
{
|
|
2218
2209
|
icon: ke,
|
|
2219
|
-
label:
|
|
2220
|
-
detail: l.isPending ?
|
|
2221
|
-
brand: d.brand ||
|
|
2210
|
+
label: r("profile_default_payment"),
|
|
2211
|
+
detail: l.isPending ? r("profile_loading") : d ? r("profile_card_ending", {
|
|
2212
|
+
brand: d.brand || r("card_fallback"),
|
|
2222
2213
|
lastFour: d.last_four
|
|
2223
|
-
}) :
|
|
2214
|
+
}) : r("profile_no_default_payment"),
|
|
2224
2215
|
busy: l.isPending,
|
|
2225
2216
|
onOpen: e,
|
|
2226
2217
|
triggerRef: i
|
|
2227
2218
|
}
|
|
2228
2219
|
);
|
|
2229
2220
|
}
|
|
2230
|
-
function lt(e, i,
|
|
2221
|
+
function lt(e, i, r) {
|
|
2231
2222
|
const l = {
|
|
2232
2223
|
dateStyle: "medium",
|
|
2233
|
-
...
|
|
2224
|
+
...r ? { timeZone: r } : {}
|
|
2234
2225
|
};
|
|
2235
2226
|
try {
|
|
2236
2227
|
return new Intl.DateTimeFormat(i, l).format(e);
|
|
@@ -2238,24 +2229,24 @@ function lt(e, i, t) {
|
|
|
2238
2229
|
return new Intl.DateTimeFormat("en-US", l).format(e);
|
|
2239
2230
|
}
|
|
2240
2231
|
}
|
|
2241
|
-
function
|
|
2232
|
+
function Wr(e, i) {
|
|
2242
2233
|
if (!e) return null;
|
|
2243
|
-
const
|
|
2244
|
-
return Number.isNaN(
|
|
2234
|
+
const r = new Date(e);
|
|
2235
|
+
return Number.isNaN(r.getTime()) ? null : lt(r, i);
|
|
2245
2236
|
}
|
|
2246
|
-
function
|
|
2237
|
+
function Xr(e, i) {
|
|
2247
2238
|
if (!e) return null;
|
|
2248
|
-
const
|
|
2249
|
-
return Number.isNaN(
|
|
2239
|
+
const r = /* @__PURE__ */ new Date(`${e.slice(0, 10)}T00:00:00Z`);
|
|
2240
|
+
return Number.isNaN(r.getTime()) ? null : lt(r, i, "UTC");
|
|
2250
2241
|
}
|
|
2251
|
-
const
|
|
2242
|
+
const Zr = se({
|
|
2252
2243
|
subscription: se({
|
|
2253
2244
|
token: L(),
|
|
2254
2245
|
plan_name: L().nullish(),
|
|
2255
2246
|
next_billing_date: L().nullish()
|
|
2256
2247
|
}).nullish()
|
|
2257
2248
|
});
|
|
2258
|
-
async function
|
|
2249
|
+
async function Jr(e = wt) {
|
|
2259
2250
|
const i = await e(
|
|
2260
2251
|
"/api/member-storefront/subscriptions/next",
|
|
2261
2252
|
{
|
|
@@ -2265,51 +2256,51 @@ async function en(e = wt) {
|
|
|
2265
2256
|
);
|
|
2266
2257
|
if (!i.ok)
|
|
2267
2258
|
throw new Error(`Next subscription request failed (${i.status})`);
|
|
2268
|
-
const { subscription:
|
|
2269
|
-
return
|
|
2270
|
-
token:
|
|
2271
|
-
planName:
|
|
2272
|
-
nextBillingDate:
|
|
2259
|
+
const { subscription: r } = Zr.parse(await i.json());
|
|
2260
|
+
return r ? {
|
|
2261
|
+
token: r.token,
|
|
2262
|
+
planName: r.plan_name ?? null,
|
|
2263
|
+
nextBillingDate: r.next_billing_date ?? null
|
|
2273
2264
|
} : null;
|
|
2274
2265
|
}
|
|
2275
|
-
function
|
|
2276
|
-
const e =
|
|
2266
|
+
function en() {
|
|
2267
|
+
const e = Jt(), i = v.useMemo(() => Et(e), [e]);
|
|
2277
2268
|
return $({
|
|
2278
2269
|
queryKey: ["memberStorefront", "profile", "latest-order"],
|
|
2279
2270
|
queryFn: async () => (await i.fetchCustomerOrders({ limit: 1 })).orders[0] ?? null
|
|
2280
2271
|
});
|
|
2281
2272
|
}
|
|
2282
|
-
function
|
|
2273
|
+
function tn() {
|
|
2283
2274
|
const { fetch: e } = fe();
|
|
2284
2275
|
return $({
|
|
2285
2276
|
queryKey: ["memberStorefront", "profile", "next-subscription"],
|
|
2286
|
-
queryFn: () =>
|
|
2277
|
+
queryFn: () => Jr(e)
|
|
2287
2278
|
});
|
|
2288
2279
|
}
|
|
2289
|
-
function
|
|
2280
|
+
function rn({
|
|
2290
2281
|
onOpen: e,
|
|
2291
2282
|
triggerRef: i
|
|
2292
2283
|
}) {
|
|
2293
|
-
const { t } = R(), { locale: l } = T(), d =
|
|
2284
|
+
const { t: r } = R(), { locale: l } = T(), d = en();
|
|
2294
2285
|
if (d.error)
|
|
2295
2286
|
return /* @__PURE__ */ n.jsx(
|
|
2296
2287
|
be,
|
|
2297
2288
|
{
|
|
2298
|
-
message:
|
|
2299
|
-
retryLabel:
|
|
2289
|
+
message: r("profile_orders_load_failed"),
|
|
2290
|
+
retryLabel: r("profile_orders_retry"),
|
|
2300
2291
|
isRetrying: d.isFetching,
|
|
2301
2292
|
onRetry: () => void d.refetch()
|
|
2302
2293
|
}
|
|
2303
2294
|
);
|
|
2304
|
-
const u = d.data, p = d.isPending ?
|
|
2295
|
+
const u = d.data, p = d.isPending ? r("profile_loading") : u ? [
|
|
2305
2296
|
u.order_number ? `#${u.order_number}` : null,
|
|
2306
|
-
|
|
2307
|
-
].filter(Boolean).join(" · ") ||
|
|
2297
|
+
Wr(u.created_at, l)
|
|
2298
|
+
].filter(Boolean).join(" · ") || r("profile_view_orders") : r("profile_no_orders");
|
|
2308
2299
|
return /* @__PURE__ */ n.jsx(
|
|
2309
2300
|
_e,
|
|
2310
2301
|
{
|
|
2311
|
-
icon:
|
|
2312
|
-
label:
|
|
2302
|
+
icon: Le,
|
|
2303
|
+
label: r("profile_latest_order"),
|
|
2313
2304
|
detail: p,
|
|
2314
2305
|
busy: d.isPending,
|
|
2315
2306
|
onOpen: () => e(u?.token ?? null),
|
|
@@ -2317,30 +2308,30 @@ function nn({
|
|
|
2317
2308
|
}
|
|
2318
2309
|
);
|
|
2319
2310
|
}
|
|
2320
|
-
function
|
|
2311
|
+
function nn({
|
|
2321
2312
|
onOpen: e,
|
|
2322
2313
|
triggerRef: i
|
|
2323
2314
|
}) {
|
|
2324
|
-
const { t } = R(), { locale: l } = T(), d =
|
|
2315
|
+
const { t: r } = R(), { locale: l } = T(), d = tn();
|
|
2325
2316
|
if (d.error)
|
|
2326
2317
|
return /* @__PURE__ */ n.jsx(
|
|
2327
2318
|
be,
|
|
2328
2319
|
{
|
|
2329
|
-
message:
|
|
2330
|
-
retryLabel:
|
|
2320
|
+
message: r("profile_subscription_load_failed"),
|
|
2321
|
+
retryLabel: r("profile_subscription_retry"),
|
|
2331
2322
|
isRetrying: d.isFetching,
|
|
2332
2323
|
onRetry: () => void d.refetch()
|
|
2333
2324
|
}
|
|
2334
2325
|
);
|
|
2335
|
-
const u = d.data, p =
|
|
2326
|
+
const u = d.data, p = Xr(u?.nextBillingDate, l), g = d.isPending ? r("profile_loading") : u ? [
|
|
2336
2327
|
u.planName,
|
|
2337
|
-
p ?
|
|
2338
|
-
].filter(Boolean).join(" · ") ||
|
|
2328
|
+
p ? r("profile_next_bill_on", { date: p }) : null
|
|
2329
|
+
].filter(Boolean).join(" · ") || r("profile_view_subscriptions") : r("profile_no_next_subscription");
|
|
2339
2330
|
return /* @__PURE__ */ n.jsx(
|
|
2340
2331
|
_e,
|
|
2341
2332
|
{
|
|
2342
2333
|
icon: De,
|
|
2343
|
-
label:
|
|
2334
|
+
label: r("profile_next_subscription"),
|
|
2344
2335
|
detail: g,
|
|
2345
2336
|
busy: d.isPending,
|
|
2346
2337
|
onOpen: () => e(u?.token ?? null),
|
|
@@ -2348,10 +2339,10 @@ function sn({
|
|
|
2348
2339
|
}
|
|
2349
2340
|
);
|
|
2350
2341
|
}
|
|
2351
|
-
function
|
|
2342
|
+
function sn({
|
|
2352
2343
|
onOpenPayment: e,
|
|
2353
2344
|
paymentTriggerRef: i,
|
|
2354
|
-
onOpenOrder:
|
|
2345
|
+
onOpenOrder: r,
|
|
2355
2346
|
orderTriggerRef: l,
|
|
2356
2347
|
onOpenSubscription: d,
|
|
2357
2348
|
subscriptionTriggerRef: u
|
|
@@ -2361,15 +2352,15 @@ function an({
|
|
|
2361
2352
|
/* @__PURE__ */ n.jsx("h2", { className: "text-muted-foreground text-sm font-medium", children: p("profile_at_a_glance") }),
|
|
2362
2353
|
/* @__PURE__ */ n.jsxs("div", { className: "space-y-3", children: [
|
|
2363
2354
|
/* @__PURE__ */ n.jsx(
|
|
2364
|
-
|
|
2355
|
+
Yr,
|
|
2365
2356
|
{
|
|
2366
2357
|
onOpen: e,
|
|
2367
2358
|
triggerRef: i
|
|
2368
2359
|
}
|
|
2369
2360
|
),
|
|
2370
|
-
/* @__PURE__ */ n.jsx(
|
|
2361
|
+
/* @__PURE__ */ n.jsx(rn, { onOpen: r, triggerRef: l }),
|
|
2371
2362
|
/* @__PURE__ */ n.jsx(
|
|
2372
|
-
|
|
2363
|
+
nn,
|
|
2373
2364
|
{
|
|
2374
2365
|
onOpen: d,
|
|
2375
2366
|
triggerRef: u
|
|
@@ -2378,11 +2369,11 @@ function an({
|
|
|
2378
2369
|
] })
|
|
2379
2370
|
] });
|
|
2380
2371
|
}
|
|
2381
|
-
function
|
|
2372
|
+
function an({
|
|
2382
2373
|
initialLanguage: e
|
|
2383
2374
|
}) {
|
|
2384
|
-
const { t: i } = R(),
|
|
2385
|
-
if (
|
|
2375
|
+
const { t: i } = R(), r = tt(), l = rt(), [d, u] = v.useState(e);
|
|
2376
|
+
if (r.error) throw r.error;
|
|
2386
2377
|
return /* @__PURE__ */ n.jsxs(
|
|
2387
2378
|
"form",
|
|
2388
2379
|
{
|
|
@@ -2406,11 +2397,11 @@ function on({
|
|
|
2406
2397
|
className: "border-input bg-background text-foreground focus-visible:ring-ring h-10 w-full rounded-md border px-3 text-sm focus-visible:ring-2",
|
|
2407
2398
|
value: d,
|
|
2408
2399
|
onChange: (p) => u(p.target.value),
|
|
2409
|
-
disabled:
|
|
2400
|
+
disabled: r.isPending || l.isPending,
|
|
2410
2401
|
required: !0,
|
|
2411
2402
|
children: [
|
|
2412
2403
|
/* @__PURE__ */ n.jsx("option", { value: "", children: i("select_an_option") }),
|
|
2413
|
-
|
|
2404
|
+
r.data?.map((p) => /* @__PURE__ */ n.jsx("option", { value: p.code, children: p.name }, p.code))
|
|
2414
2405
|
]
|
|
2415
2406
|
}
|
|
2416
2407
|
)
|
|
@@ -2420,7 +2411,7 @@ function on({
|
|
|
2420
2411
|
E,
|
|
2421
2412
|
{
|
|
2422
2413
|
type: "submit",
|
|
2423
|
-
disabled: !d ||
|
|
2414
|
+
disabled: !d || r.isPending || l.isPending,
|
|
2424
2415
|
children: l.isPending ? i("saving") : i("save_changes")
|
|
2425
2416
|
}
|
|
2426
2417
|
)
|
|
@@ -2428,17 +2419,17 @@ function on({
|
|
|
2428
2419
|
}
|
|
2429
2420
|
);
|
|
2430
2421
|
}
|
|
2431
|
-
function
|
|
2432
|
-
const { t: e } = R(), i = Ae(),
|
|
2422
|
+
function on() {
|
|
2423
|
+
const { t: e } = R(), i = Ae(), r = me(), { currentSlug: l, navigate: d } = de(), { preview: u } = fe(), p = at(), { locale: g } = T(), a = v.useRef(""), t = v.useRef({});
|
|
2433
2424
|
if (i.error) throw i.error;
|
|
2434
|
-
if (
|
|
2435
|
-
if (!i.data || !
|
|
2425
|
+
if (r.error) throw r.error;
|
|
2426
|
+
if (!i.data || !r.data)
|
|
2436
2427
|
return /* @__PURE__ */ n.jsx("p", { role: "status", className: "text-muted-foreground p-6", children: e("profile_loading") });
|
|
2437
|
-
const s = i.data, o = `${s.first_name} ${s.last_name}`.trim() || e("account_fallback"), c =
|
|
2428
|
+
const s = i.data, o = `${s.first_name} ${s.last_name}`.trim() || e("account_fallback"), c = Gt(s), m = l === "profile/language", f = l === "profile/addresses", h = l === "profile/payment-methods", x = l === "profile/points", N = l === "profile/orders" || l.startsWith("profile/orders/"), C = l === "profile/subscriptions" || l.startsWith("profile/subscriptions/"), _ = N || C, w = l === "profile/orders" || l === "profile/subscriptions", M = r.data.reward_points_label_plural, k = M.charAt(0).toLocaleUpperCase(g) + M.slice(1), z = [
|
|
2438
2429
|
{
|
|
2439
2430
|
slug: "profile/information",
|
|
2440
2431
|
label: e("personal_information"),
|
|
2441
|
-
icon:
|
|
2432
|
+
icon: cr,
|
|
2442
2433
|
dialog: !0
|
|
2443
2434
|
},
|
|
2444
2435
|
{
|
|
@@ -2446,11 +2437,11 @@ function ln() {
|
|
|
2446
2437
|
label: e("payment_methods"),
|
|
2447
2438
|
icon: ke
|
|
2448
2439
|
},
|
|
2449
|
-
{ slug: "profile/addresses", label: e("shipping_addresses"), icon:
|
|
2440
|
+
{ slug: "profile/addresses", label: e("shipping_addresses"), icon: er },
|
|
2450
2441
|
{
|
|
2451
2442
|
slug: "orders",
|
|
2452
2443
|
label: e("orders"),
|
|
2453
|
-
icon:
|
|
2444
|
+
icon: Le
|
|
2454
2445
|
},
|
|
2455
2446
|
{
|
|
2456
2447
|
slug: "subscriptions",
|
|
@@ -2460,14 +2451,14 @@ function ln() {
|
|
|
2460
2451
|
{
|
|
2461
2452
|
slug: "profile/language",
|
|
2462
2453
|
label: e("language"),
|
|
2463
|
-
icon:
|
|
2454
|
+
icon: sr,
|
|
2464
2455
|
value: s.language_iso?.toUpperCase()
|
|
2465
2456
|
},
|
|
2466
2457
|
...p.data ? [
|
|
2467
2458
|
{
|
|
2468
2459
|
slug: "profile/points",
|
|
2469
2460
|
label: k,
|
|
2470
|
-
icon:
|
|
2461
|
+
icon: or,
|
|
2471
2462
|
value: new Intl.NumberFormat(g).format(
|
|
2472
2463
|
p.data.points_ledgers[0]?.total_balance ?? 0
|
|
2473
2464
|
)
|
|
@@ -2477,7 +2468,7 @@ function ln() {
|
|
|
2477
2468
|
function F() {
|
|
2478
2469
|
const y = a.current || l;
|
|
2479
2470
|
d("profile"), requestAnimationFrame(
|
|
2480
|
-
() => (
|
|
2471
|
+
() => (t.current[y] ?? t.current[l])?.focus()
|
|
2481
2472
|
);
|
|
2482
2473
|
}
|
|
2483
2474
|
return /* @__PURE__ */ n.jsxs(n.Fragment, { children: [
|
|
@@ -2487,7 +2478,7 @@ function ln() {
|
|
|
2487
2478
|
/* @__PURE__ */ n.jsx(we, { "aria-hidden": "true", className: "size-4" }),
|
|
2488
2479
|
e("profile_back")
|
|
2489
2480
|
] }) }),
|
|
2490
|
-
/* @__PURE__ */ n.jsx(
|
|
2481
|
+
/* @__PURE__ */ n.jsx(Or, { children: N ? /* @__PURE__ */ n.jsx(At, {}) : /* @__PURE__ */ n.jsx(kr, {}) })
|
|
2491
2482
|
] }) : /* @__PURE__ */ n.jsxs("main", { className: "mx-auto w-full max-w-3xl space-y-8 p-4 sm:p-8", children: [
|
|
2492
2483
|
m || f || x || h ? /* @__PURE__ */ n.jsxs(n.Fragment, { children: [
|
|
2493
2484
|
/* @__PURE__ */ n.jsxs(E, { variant: "ghost", onClick: F, children: [
|
|
@@ -2497,7 +2488,7 @@ function ln() {
|
|
|
2497
2488
|
/* @__PURE__ */ n.jsx("h1", { className: "text-2xl font-semibold", children: x ? k : e(
|
|
2498
2489
|
h ? "payment_methods" : f ? "shipping_addresses" : "language"
|
|
2499
2490
|
) }),
|
|
2500
|
-
h ? /* @__PURE__ */ n.jsx(
|
|
2491
|
+
h ? /* @__PURE__ */ n.jsx(Gr, {}) : f ? /* @__PURE__ */ n.jsx(Ur, {}) : x ? /* @__PURE__ */ n.jsx($r, {}) : /* @__PURE__ */ n.jsx(an, { initialLanguage: s.language_iso ?? "" })
|
|
2501
2492
|
] }) : /* @__PURE__ */ n.jsxs(n.Fragment, { children: [
|
|
2502
2493
|
/* @__PURE__ */ n.jsxs(
|
|
2503
2494
|
"section",
|
|
@@ -2507,18 +2498,18 @@ function ln() {
|
|
|
2507
2498
|
children: [
|
|
2508
2499
|
/* @__PURE__ */ n.jsxs("div", { className: "flex flex-wrap items-center justify-between gap-4 sm:gap-6", children: [
|
|
2509
2500
|
/* @__PURE__ */ n.jsxs("div", { className: "flex min-w-0 flex-1 items-center gap-3 sm:gap-4", children: [
|
|
2510
|
-
/* @__PURE__ */ n.jsxs(
|
|
2501
|
+
/* @__PURE__ */ n.jsxs(yr, { className: "size-12 shrink-0 sm:size-16", children: [
|
|
2511
2502
|
/* @__PURE__ */ n.jsx(
|
|
2512
|
-
|
|
2503
|
+
jr,
|
|
2513
2504
|
{
|
|
2514
2505
|
src: s.avatar_url ?? void 0,
|
|
2515
2506
|
alt: ""
|
|
2516
2507
|
}
|
|
2517
2508
|
),
|
|
2518
|
-
/* @__PURE__ */ n.jsx(
|
|
2509
|
+
/* @__PURE__ */ n.jsx(wr, { children: `${s.first_name[0] ?? ""}${s.last_name[0] ?? ""}` })
|
|
2519
2510
|
] }),
|
|
2520
2511
|
/* @__PURE__ */ n.jsxs("div", { className: "min-w-0 space-y-1", children: [
|
|
2521
|
-
c && /* @__PURE__ */ n.jsx("p", { className: "text-muted-foreground text-xs font-medium", children: e("member_of", { company:
|
|
2512
|
+
c && /* @__PURE__ */ n.jsx("p", { className: "text-muted-foreground text-xs font-medium", children: e("member_of", { company: r.data.name }) }),
|
|
2522
2513
|
/* @__PURE__ */ n.jsx("h1", { className: "text-xl font-semibold tracking-tight break-words sm:text-2xl", children: o }),
|
|
2523
2514
|
/* @__PURE__ */ n.jsx("p", { className: "text-muted-foreground text-sm break-all", children: s.email })
|
|
2524
2515
|
] })
|
|
@@ -2566,7 +2557,7 @@ function ln() {
|
|
|
2566
2557
|
{
|
|
2567
2558
|
type: "button",
|
|
2568
2559
|
ref: (D) => {
|
|
2569
|
-
|
|
2560
|
+
t.current[y.slug] = D;
|
|
2570
2561
|
},
|
|
2571
2562
|
"aria-haspopup": y.dialog ? "dialog" : void 0,
|
|
2572
2563
|
"aria-expanded": y.dialog ? l === y.slug : void 0,
|
|
@@ -2593,22 +2584,22 @@ function ln() {
|
|
|
2593
2584
|
}
|
|
2594
2585
|
),
|
|
2595
2586
|
/* @__PURE__ */ n.jsx(
|
|
2596
|
-
|
|
2587
|
+
sn,
|
|
2597
2588
|
{
|
|
2598
2589
|
paymentTriggerRef: (y) => {
|
|
2599
|
-
|
|
2590
|
+
t.current["profile/default-payment"] = y;
|
|
2600
2591
|
},
|
|
2601
2592
|
onOpenPayment: () => {
|
|
2602
2593
|
a.current = "profile/default-payment", d("profile/payment-methods");
|
|
2603
2594
|
},
|
|
2604
2595
|
orderTriggerRef: (y) => {
|
|
2605
|
-
|
|
2596
|
+
t.current["profile/latest-order"] = y;
|
|
2606
2597
|
},
|
|
2607
2598
|
onOpenOrder: (y) => {
|
|
2608
2599
|
a.current = "profile/latest-order", d(y ? `orders/${y}` : "orders");
|
|
2609
2600
|
},
|
|
2610
2601
|
subscriptionTriggerRef: (y) => {
|
|
2611
|
-
|
|
2602
|
+
t.current["profile/next-subscription"] = y;
|
|
2612
2603
|
},
|
|
2613
2604
|
onOpenSubscription: (y) => {
|
|
2614
2605
|
a.current = "profile/next-subscription", d(y ? `subscriptions/${y}` : "subscriptions");
|
|
@@ -2631,7 +2622,7 @@ function ln() {
|
|
|
2631
2622
|
onClick: () => {
|
|
2632
2623
|
p.refetch().then((y) => {
|
|
2633
2624
|
y.isSuccess && requestAnimationFrame(
|
|
2634
|
-
() => (
|
|
2625
|
+
() => (t.current["profile/points"] ?? t.current["profile/information"])?.focus()
|
|
2635
2626
|
);
|
|
2636
2627
|
});
|
|
2637
2628
|
},
|
|
@@ -2649,19 +2640,19 @@ function ln() {
|
|
|
2649
2640
|
tabIndex: u ? -1 : void 0,
|
|
2650
2641
|
className: "text-muted-foreground hover:text-foreground focus-visible:ring-ring flex min-h-11 items-center gap-3 rounded-md px-1 text-sm focus-visible:ring-2",
|
|
2651
2642
|
children: [
|
|
2652
|
-
/* @__PURE__ */ n.jsx(
|
|
2643
|
+
/* @__PURE__ */ n.jsx(tr, { "aria-hidden": "true", className: "size-4" }),
|
|
2653
2644
|
e("sign_out")
|
|
2654
2645
|
]
|
|
2655
2646
|
}
|
|
2656
2647
|
)
|
|
2657
2648
|
] }),
|
|
2658
|
-
l === "profile/information" && /* @__PURE__ */ n.jsx(
|
|
2649
|
+
l === "profile/information" && /* @__PURE__ */ n.jsx(zr, { account: s, onClose: F })
|
|
2659
2650
|
] })
|
|
2660
2651
|
] });
|
|
2661
2652
|
}
|
|
2662
|
-
function
|
|
2663
|
-
return /* @__PURE__ */ n.jsx(
|
|
2653
|
+
function Sn() {
|
|
2654
|
+
return /* @__PURE__ */ n.jsx(Pt, { children: /* @__PURE__ */ n.jsx(on, {}) });
|
|
2664
2655
|
}
|
|
2665
2656
|
export {
|
|
2666
|
-
|
|
2657
|
+
Sn as default
|
|
2667
2658
|
};
|