@mercurjs/vendor 2.0.2 → 2.1.0-canary.4
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/{[id]-TLZZ53G7.js → [id]-2HRWUMSJ.js} +2 -2
- package/dist/{[id]-DCCF7277.js → [id]-57VYN5YF.js} +2 -3
- package/dist/{[id]-UAOAQVEM.js → [id]-FWI6NCSF.js} +3 -4
- package/dist/{[id]-6WYSWXWC.js → [id]-IQNYVYZU.js} +1 -2
- package/dist/{[id]-LZPT5Y55.js → [id]-KCUHMQWF.js} +1 -2
- package/dist/{[id]-PHS2WYFX.js → [id]-LCMQBEOS.js} +2 -3
- package/dist/{[id]-OGHRZ2VY.js → [id]-LJJPLKJ6.js} +5 -4
- package/dist/{[id]-VKG2WEIR.js → [id]-M3PNP527.js} +1 -2
- package/dist/{[id]-EJAHMOOE.js → [id]-MZOT4GAO.js} +2 -3
- package/dist/{[id]-ENTJSLN2.js → [id]-RKEN7EEY.js} +3 -3
- package/dist/{[province_id]-XGA44S7P.js → [province_id]-2MRNXHKU.js} +1 -2
- package/dist/{add-7ZTE42IE.js → add-BVR3LDPH.js} +2 -2
- package/dist/{add-AKC7LTK3.js → add-W7ATBCKS.js} +2 -3
- package/dist/{add-customer-groups-BRC3DKQ2.js → add-customer-groups-ZZVSJJH3.js} +1 -2
- package/dist/{add-products-ZSULNZVI.js → add-products-PINICUAZ.js} +2 -3
- package/dist/{add-promotions-TNFVT5ST.js → add-promotions-2DFXTDEJ.js} +3 -3
- package/dist/{address-3DSJESKM.js → address-RNB2WQPM.js} +1 -2
- package/dist/{breadcrumb-ZMVHXCOX.js → breadcrumb-A3XUO3R2.js} +2 -3
- package/dist/{breadcrumb-UH7FAYU2.js → breadcrumb-MPXARU5F.js} +1 -2
- package/dist/{breadcrumb-D6QNYOAO.js → breadcrumb-Q5KJBAPD.js} +1 -2
- package/dist/{chunk-JRT2U4UI.js → chunk-2DUMXTKS.js} +107 -18
- package/dist/{chunk-CUMY2VZ5.js → chunk-5LKZCG77.js} +1 -96
- package/dist/{chunk-RV5UTYBG.js → chunk-EQQ3BLQ3.js} +2 -2
- package/dist/{chunk-RMBCBXWD.js → chunk-GQFNE5VL.js} +1 -1
- package/dist/chunk-HFRHHT36.js +98 -0
- package/dist/{chunk-O7E4KQAK.js → chunk-HFW7IIO2.js} +1 -1
- package/dist/{chunk-T7LEJIIM.js → chunk-PT3UQCSN.js} +1 -1
- package/dist/{chunk-LA6XSPQG.js → chunk-QDSNLU6X.js} +287 -309
- package/dist/chunk-TLE6YHGH.js +26 -0
- package/dist/{chunk-ASEVHHCT.js → chunk-UDG47AEE.js} +1 -1
- package/dist/{chunk-573EQEW2.js → chunk-V4SZIX7Q.js} +1 -1
- package/dist/{chunk-7XC7ZRG7.js → chunk-VTHSHOX4.js} +1 -1
- package/dist/{chunk-XZG2HZYW.js → chunk-WFE6CT6M.js} +1 -1
- package/dist/{chunk-N2WKLVUX.js → chunk-XF3W2U3Q.js} +1 -1
- package/dist/{chunk-NYRRRCJS.js → chunk-ZCJ737TR.js} +66 -21
- package/dist/{chunk-FNG7ZA7N.js → chunk-ZCUUV464.js} +1 -1
- package/dist/{collections-2M4RFH4P.js → collections-NNFGWUTW.js} +2 -3
- package/dist/{create-6IRE6AMF.js → create-2BPTTXLB.js} +8 -7
- package/dist/{create-D4F457BD.js → create-GCSVAMEH.js} +1 -2
- package/dist/{create-2TUWGQ2D.js → create-N3WNCW7U.js} +1 -2
- package/dist/{create-QK2SSLZK.js → create-T73PSKIV.js} +3 -4
- package/dist/{create-OF2OZ7EI.js → create-TXBY6W3X.js} +1 -2
- package/dist/{create-IFMEEHN4.js → create-VPG7P53M.js} +2 -3
- package/dist/{create-YITFTHMA.js → create-WY4KXB66.js} +1 -2
- package/dist/{create-3WUTLUJO.js → create-YCOR6HY3.js} +1 -2
- package/dist/{edit-SGEECDCR.js → edit-2QUFOE5S.js} +1 -2
- package/dist/{edit-Z7EZRPUP.js → edit-A5ZBINLU.js} +1 -1
- package/dist/{edit-QRJIWTU2.js → edit-B245OLC7.js} +1 -2
- package/dist/{edit-PIE7Y73J.js → edit-CPVFMQEI.js} +3 -4
- package/dist/{edit-ONSN756P.js → edit-CZOV6HBW.js} +1 -1
- package/dist/{edit-J5SC7GHQ.js → edit-KWSXWWOA.js} +1 -2
- package/dist/{edit-ZEIL7EQW.js → edit-QYKH2ZZA.js} +1 -2
- package/dist/{edit-UQAQVEUI.js → edit-U5VL2UQY.js} +4 -5
- package/dist/{edit-stocks-and-prices-543AYFDJ.js → edit-stocks-and-prices-Y233WVZ3.js} +1 -2
- package/dist/{fulfillment-5LNFBSBS.js → fulfillment-FBF3MITY.js} +1 -2
- package/dist/{fulfillment-providers-U7Z7QMOQ.js → fulfillment-providers-Y2YOREHX.js} +2 -3
- package/dist/index.css +32 -26
- package/dist/index.js +86 -87
- package/dist/invite-G7WOO5RZ.js +368 -0
- package/dist/{invite-SI2KIPWI.js → invite-Y2TACGCW.js} +3 -5
- package/dist/{login-QDS5UXKV.js → login-JU7R2RNN.js} +1 -2
- package/dist/{media-RDXCLPKQ.js → media-TXY3WBR3.js} +2 -2
- package/dist/{metadata-7JKDCVYY.js → metadata-7RA6MXW7.js} +1 -2
- package/dist/{metadata-ZV5RYLKR.js → metadata-GSBDSRNM.js} +1 -2
- package/dist/{metadata-X4UIPNL6.js → metadata-JXRXW6UQ.js} +1 -2
- package/dist/{metadata-W5XIPFVU.js → metadata-QM4UGMX5.js} +1 -2
- package/dist/{metadata-UKBRUFH2.js → metadata-RODKLIDO.js} +1 -2
- package/dist/onboarding-VF7EQAAA.js +893 -0
- package/dist/{orders-IAL3JNPU.js → orders-HKUVFCTQ.js} +2 -3
- package/dist/pages/index.d.ts +140 -140
- package/dist/pages/index.js +14 -13
- package/dist/{payment-details-ATUYMVJX.js → payment-details-VWR2S32W.js} +1 -2
- package/dist/{pricing-RBESFX5P.js → pricing-6UZ6SXIE.js} +1 -2
- package/dist/{product-tags-W4BL6RWV.js → product-tags-YXVFIPGQ.js} +3 -4
- package/dist/{product-variant-detail-KU5OCL7E.js → product-variant-detail-O2NOUFFC.js} +1 -2
- package/dist/{products-3VVYJUH7.js → products-3NIIOQBB.js} +2 -3
- package/dist/{products-YYLVCOOY.js → products-Z6MD665K.js} +10 -9
- package/dist/{professional-details-6Y5K6GBL.js → professional-details-SJ4AF5TM.js} +1 -2
- package/dist/{promotions-NBJTFP6N.js → promotions-PJABWGCP.js} +4 -4
- package/dist/{register-ZLE6MNPF.js → register-PSBM4NCS.js} +3 -4
- package/dist/{reset-password-PLCDLFL4.js → reset-password-4RE5TXQ5.js} +1 -1
- package/dist/{sales-channels-UIDLFCX6.js → sales-channels-2OVI6RTV.js} +3 -2
- package/dist/{sales-channels-UWPEFKAO.js → sales-channels-BKOYQXVC.js} +3 -2
- package/dist/{settings-5MNWE5CR.js → settings-F6KJREHK.js} +3 -4
- package/dist/{shipping-profiles-O7XB2DTE.js → shipping-profiles-AQMJSXDB.js} +1 -2
- package/dist/{stock-VJAAYYW5.js → stock-4G4WQIR7.js} +1 -2
- package/dist/{stock-2CGEFBXO.js → stock-NJADHNRP.js} +1 -2
- package/dist/{store-ZBSMNWFT.js → store-HJGETE33.js} +225 -105
- package/dist/{store-closure-43FK32AQ.js → store-closure-QPK4LBBZ.js} +35 -19
- package/dist/{store-select-Q2HE572R.js → store-select-XS2APMBI.js} +1 -2
- package/dist/{team-ZLZJJWIY.js → team-DZ5CV3LG.js} +1 -2
- package/package.json +5 -5
- package/dist/chunk-STBCWNZQ.js +0 -57
- package/dist/invite-P6HTOEIV.js +0 -301
- package/dist/onboarding-DLIBZRKE.js +0 -873
|
@@ -0,0 +1,368 @@
|
|
|
1
|
+
import {
|
|
2
|
+
AvatarBox
|
|
3
|
+
} from "./chunk-CP5IL4P6.js";
|
|
4
|
+
import {
|
|
5
|
+
isFetchError
|
|
6
|
+
} from "./chunk-C6SUTRP2.js";
|
|
7
|
+
import {
|
|
8
|
+
Form
|
|
9
|
+
} from "./chunk-3QSRE5LS.js";
|
|
10
|
+
import "./chunk-U2EI2ZLM.js";
|
|
11
|
+
import {
|
|
12
|
+
useAcceptInvite,
|
|
13
|
+
useSelectSeller
|
|
14
|
+
} from "./chunk-ZCJ737TR.js";
|
|
15
|
+
import {
|
|
16
|
+
useSignInForInvite,
|
|
17
|
+
useSignUpForInvite
|
|
18
|
+
} from "./chunk-F4OJN2F2.js";
|
|
19
|
+
import "./chunk-LRARA622.js";
|
|
20
|
+
import "./chunk-M6N4ISXL.js";
|
|
21
|
+
import "./chunk-S7EKBD2C.js";
|
|
22
|
+
import "./chunk-VXMOPVRH.js";
|
|
23
|
+
import "./chunk-IQWK723D.js";
|
|
24
|
+
import "./chunk-VV6IKGCN.js";
|
|
25
|
+
import "./chunk-PCMNEUMV.js";
|
|
26
|
+
import "./chunk-BOZJOOGW.js";
|
|
27
|
+
import "./chunk-RL7SFZOF.js";
|
|
28
|
+
import "./chunk-LWJF63JW.js";
|
|
29
|
+
import "./chunk-NBPMNUKZ.js";
|
|
30
|
+
import "./chunk-GCSQEJMD.js";
|
|
31
|
+
import "./chunk-VXWN37PT.js";
|
|
32
|
+
import "./chunk-UL4O5M4S.js";
|
|
33
|
+
import "./chunk-FX4V5JCF.js";
|
|
34
|
+
import "./chunk-3B34B2M2.js";
|
|
35
|
+
import "./chunk-RUE5BPC2.js";
|
|
36
|
+
import "./chunk-ZEVYT6IX.js";
|
|
37
|
+
import "./chunk-A5DJIOHN.js";
|
|
38
|
+
import "./chunk-RHKRREUU.js";
|
|
39
|
+
import "./chunk-ZA2KFUFR.js";
|
|
40
|
+
import {
|
|
41
|
+
sdk
|
|
42
|
+
} from "./chunk-RIN4CBRB.js";
|
|
43
|
+
import "./chunk-NBMM2TZK.js";
|
|
44
|
+
|
|
45
|
+
// src/pages/invite/invite.tsx
|
|
46
|
+
import { zodResolver } from "@hookform/resolvers/zod";
|
|
47
|
+
import {
|
|
48
|
+
Alert,
|
|
49
|
+
Button,
|
|
50
|
+
Heading,
|
|
51
|
+
Hint,
|
|
52
|
+
Input,
|
|
53
|
+
Text,
|
|
54
|
+
toast
|
|
55
|
+
} from "@medusajs/ui";
|
|
56
|
+
import i18n from "i18next";
|
|
57
|
+
import { AnimatePresence, motion } from "motion/react";
|
|
58
|
+
import { useEffect, useRef, useState } from "react";
|
|
59
|
+
import { useForm } from "react-hook-form";
|
|
60
|
+
import { useTranslation } from "react-i18next";
|
|
61
|
+
import { decodeToken } from "react-jwt";
|
|
62
|
+
import { Link, useNavigate, useSearchParams } from "react-router-dom";
|
|
63
|
+
import * as z from "zod";
|
|
64
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
65
|
+
var CreateAccountSchema = z.object({
|
|
66
|
+
email: z.string().email(),
|
|
67
|
+
password: z.string().min(1),
|
|
68
|
+
repeat_password: z.string().optional(),
|
|
69
|
+
existing_member: z.boolean()
|
|
70
|
+
}).superRefine(({ password, repeat_password, existing_member }, ctx) => {
|
|
71
|
+
if (!existing_member && (!repeat_password || password !== repeat_password)) {
|
|
72
|
+
ctx.addIssue({
|
|
73
|
+
code: z.ZodIssueCode.custom,
|
|
74
|
+
message: i18n.t("invite.passwordMismatch"),
|
|
75
|
+
path: ["repeat_password"]
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
});
|
|
79
|
+
var Invite = () => {
|
|
80
|
+
const [searchParams] = useSearchParams();
|
|
81
|
+
const [success, setSuccess] = useState(false);
|
|
82
|
+
const token = searchParams.get("token");
|
|
83
|
+
const invite = token ? decodeToken(token) : null;
|
|
84
|
+
const isValidInvite = invite && validateDecodedInvite(invite);
|
|
85
|
+
return /* @__PURE__ */ jsxs("div", { className: "flex h-dvh w-dvw overflow-hidden", children: [
|
|
86
|
+
/* @__PURE__ */ jsx("div", { className: "flex w-full flex-col lg:w-[584px] lg:shrink-0 h-full bg-ui-bg-base border-r border-ui-border-base overflow-y-auto", children: /* @__PURE__ */ jsx(AnimatePresence, { mode: "wait", children: success && invite ? /* @__PURE__ */ jsx(
|
|
87
|
+
motion.div,
|
|
88
|
+
{
|
|
89
|
+
initial: { opacity: 0 },
|
|
90
|
+
animate: { opacity: 1 },
|
|
91
|
+
transition: { duration: 0.6, delay: 0.2 },
|
|
92
|
+
className: "flex flex-1 flex-col items-center justify-center p-8 lg:px-14",
|
|
93
|
+
children: /* @__PURE__ */ jsx(SuccessView, { sellerName: invite.seller_name })
|
|
94
|
+
},
|
|
95
|
+
"success"
|
|
96
|
+
) : /* @__PURE__ */ jsxs(
|
|
97
|
+
motion.div,
|
|
98
|
+
{
|
|
99
|
+
exit: { opacity: 0, y: -20 },
|
|
100
|
+
transition: { duration: 0.4, ease: "easeInOut" },
|
|
101
|
+
className: "flex flex-1 flex-col p-8 lg:px-14 lg:py-12",
|
|
102
|
+
children: [
|
|
103
|
+
/* @__PURE__ */ jsx(AvatarBox, {}),
|
|
104
|
+
/* @__PURE__ */ jsx("div", { className: "mt-8 w-full", children: isValidInvite ? /* @__PURE__ */ jsx(
|
|
105
|
+
CreateView,
|
|
106
|
+
{
|
|
107
|
+
token,
|
|
108
|
+
invite,
|
|
109
|
+
onSuccess: () => setSuccess(true)
|
|
110
|
+
}
|
|
111
|
+
) : /* @__PURE__ */ jsx(InvalidView, {}) })
|
|
112
|
+
]
|
|
113
|
+
},
|
|
114
|
+
"form"
|
|
115
|
+
) }) }),
|
|
116
|
+
/* @__PURE__ */ jsx(
|
|
117
|
+
"div",
|
|
118
|
+
{
|
|
119
|
+
className: "hidden lg:flex flex-1 relative overflow-hidden items-center justify-center",
|
|
120
|
+
style: {
|
|
121
|
+
backgroundImage: "url(/onboarding/bg.svg)",
|
|
122
|
+
backgroundSize: "cover",
|
|
123
|
+
backgroundPosition: "center"
|
|
124
|
+
},
|
|
125
|
+
children: /* @__PURE__ */ jsx(
|
|
126
|
+
"img",
|
|
127
|
+
{
|
|
128
|
+
src: "/onboarding/0.png",
|
|
129
|
+
alt: "",
|
|
130
|
+
className: "w-[75%] max-h-[75%] object-contain"
|
|
131
|
+
}
|
|
132
|
+
)
|
|
133
|
+
}
|
|
134
|
+
)
|
|
135
|
+
] });
|
|
136
|
+
};
|
|
137
|
+
var SuccessView = ({ sellerName }) => {
|
|
138
|
+
const { t } = useTranslation();
|
|
139
|
+
const navigate = useNavigate();
|
|
140
|
+
const { mutateAsync: selectSeller } = useSelectSeller();
|
|
141
|
+
const hasRedirected = useRef(false);
|
|
142
|
+
useEffect(() => {
|
|
143
|
+
if (hasRedirected.current) return;
|
|
144
|
+
hasRedirected.current = true;
|
|
145
|
+
const redirect = async () => {
|
|
146
|
+
await new Promise((r) => setTimeout(r, 2500));
|
|
147
|
+
try {
|
|
148
|
+
const { seller_members } = await sdk.vendor.sellers.query({});
|
|
149
|
+
if (seller_members?.length === 1) {
|
|
150
|
+
await selectSeller({ seller_id: seller_members[0].seller.id });
|
|
151
|
+
navigate("/", { replace: true });
|
|
152
|
+
return;
|
|
153
|
+
}
|
|
154
|
+
} catch {
|
|
155
|
+
}
|
|
156
|
+
navigate("/store-select", { replace: true });
|
|
157
|
+
};
|
|
158
|
+
redirect();
|
|
159
|
+
}, [navigate, selectSeller]);
|
|
160
|
+
return /* @__PURE__ */ jsxs("div", { className: "flex flex-col items-center text-center", children: [
|
|
161
|
+
/* @__PURE__ */ jsx(AvatarBox, { checked: true }),
|
|
162
|
+
/* @__PURE__ */ jsxs(
|
|
163
|
+
motion.div,
|
|
164
|
+
{
|
|
165
|
+
initial: { opacity: 0, y: 10 },
|
|
166
|
+
animate: { opacity: 1, y: 0 },
|
|
167
|
+
transition: { duration: 0.5, delay: 0.6 },
|
|
168
|
+
children: [
|
|
169
|
+
/* @__PURE__ */ jsx(Heading, { children: t("invite.successTitle", { name: sellerName }) }),
|
|
170
|
+
/* @__PURE__ */ jsx(Text, { size: "small", className: "text-ui-fg-subtle mt-1", children: t("invite.successHint") })
|
|
171
|
+
]
|
|
172
|
+
}
|
|
173
|
+
)
|
|
174
|
+
] });
|
|
175
|
+
};
|
|
176
|
+
var LoginLink = () => {
|
|
177
|
+
const { t } = useTranslation();
|
|
178
|
+
return /* @__PURE__ */ jsx("div", { className: "mt-8", children: /* @__PURE__ */ jsxs("span", { className: "text-ui-fg-muted txt-small", children: [
|
|
179
|
+
t("invite.alreadyHaveAccount", "Already have an account?"),
|
|
180
|
+
" ",
|
|
181
|
+
/* @__PURE__ */ jsx(
|
|
182
|
+
Link,
|
|
183
|
+
{
|
|
184
|
+
to: "/login",
|
|
185
|
+
className: "txt-small text-ui-fg-interactive transition-fg hover:text-ui-fg-interactive-hover focus-visible:text-ui-fg-interactive-hover font-medium outline-none",
|
|
186
|
+
children: t("invite.logIn", "Log in")
|
|
187
|
+
}
|
|
188
|
+
)
|
|
189
|
+
] }) });
|
|
190
|
+
};
|
|
191
|
+
var InvalidView = () => {
|
|
192
|
+
const { t } = useTranslation();
|
|
193
|
+
return /* @__PURE__ */ jsxs("div", { className: "flex flex-col", children: [
|
|
194
|
+
/* @__PURE__ */ jsx(Heading, { children: t("invite.invalidTokenTitle") }),
|
|
195
|
+
/* @__PURE__ */ jsx(Text, { size: "small", className: "text-ui-fg-subtle mt-1", children: t("invite.invalidTokenHint") }),
|
|
196
|
+
/* @__PURE__ */ jsx(LoginLink, {})
|
|
197
|
+
] });
|
|
198
|
+
};
|
|
199
|
+
var CreateView = ({
|
|
200
|
+
token,
|
|
201
|
+
invite,
|
|
202
|
+
onSuccess
|
|
203
|
+
}) => {
|
|
204
|
+
const { t } = useTranslation();
|
|
205
|
+
const [invalid, setInvalid] = useState(false);
|
|
206
|
+
const isExistingMember = invite.existing_member;
|
|
207
|
+
const form = useForm({
|
|
208
|
+
resolver: zodResolver(CreateAccountSchema),
|
|
209
|
+
defaultValues: {
|
|
210
|
+
email: invite.email || "",
|
|
211
|
+
password: "",
|
|
212
|
+
repeat_password: "",
|
|
213
|
+
existing_member: isExistingMember
|
|
214
|
+
}
|
|
215
|
+
});
|
|
216
|
+
const { mutateAsync: signUp, isPending: isCreatingAuthUser } = useSignUpForInvite();
|
|
217
|
+
const { mutateAsync: signIn, isPending: isSigningIn } = useSignInForInvite();
|
|
218
|
+
const { mutateAsync: acceptInvite, isPending: isAcceptingInvite } = useAcceptInvite();
|
|
219
|
+
const handleSubmit = form.handleSubmit(async (data) => {
|
|
220
|
+
try {
|
|
221
|
+
const { token: authToken } = isExistingMember ? await signIn({
|
|
222
|
+
email: data.email,
|
|
223
|
+
password: data.password
|
|
224
|
+
}) : await signUp({
|
|
225
|
+
email: data.email,
|
|
226
|
+
password: data.password
|
|
227
|
+
});
|
|
228
|
+
await acceptInvite({
|
|
229
|
+
invite_token: token,
|
|
230
|
+
auth_token: authToken
|
|
231
|
+
});
|
|
232
|
+
const { token: freshToken } = await signIn({
|
|
233
|
+
email: data.email,
|
|
234
|
+
password: data.password
|
|
235
|
+
});
|
|
236
|
+
await sdk.auth.session.mutate({
|
|
237
|
+
fetchOptions: {
|
|
238
|
+
headers: {
|
|
239
|
+
Authorization: `Bearer ${freshToken}`
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
});
|
|
243
|
+
toast.success(t("invite.toast.accepted"));
|
|
244
|
+
onSuccess();
|
|
245
|
+
} catch (error) {
|
|
246
|
+
if (isFetchError(error)) {
|
|
247
|
+
if (error.status === 401) {
|
|
248
|
+
form.setError("root", {
|
|
249
|
+
type: "manual",
|
|
250
|
+
message: t("errors.invalidCredentials")
|
|
251
|
+
});
|
|
252
|
+
return;
|
|
253
|
+
}
|
|
254
|
+
if (error.status === 400) {
|
|
255
|
+
form.setError("root", {
|
|
256
|
+
type: "manual",
|
|
257
|
+
message: t("invite.invalidInvite")
|
|
258
|
+
});
|
|
259
|
+
setInvalid(true);
|
|
260
|
+
return;
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
form.setError("root", {
|
|
264
|
+
type: "manual",
|
|
265
|
+
message: t("errors.serverError")
|
|
266
|
+
});
|
|
267
|
+
}
|
|
268
|
+
});
|
|
269
|
+
const serverError = form.formState.errors.root?.message;
|
|
270
|
+
const validationError = form.formState.errors.email?.message || form.formState.errors.password?.message || form.formState.errors.repeat_password?.message;
|
|
271
|
+
return /* @__PURE__ */ jsxs("div", { className: "flex w-full flex-col", children: [
|
|
272
|
+
/* @__PURE__ */ jsx(Heading, { children: t("invite.title", {
|
|
273
|
+
name: invite.seller_name
|
|
274
|
+
}) }),
|
|
275
|
+
/* @__PURE__ */ jsx(Text, { size: "small", className: "text-ui-fg-subtle mt-1 mb-6", children: isExistingMember ? t("invite.existingMemberHint") : t("invite.hint") }),
|
|
276
|
+
/* @__PURE__ */ jsx(Form, { ...form, children: /* @__PURE__ */ jsxs("form", { onSubmit: handleSubmit, className: "flex w-full flex-col gap-y-6", children: [
|
|
277
|
+
/* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-y-4", children: [
|
|
278
|
+
/* @__PURE__ */ jsx(
|
|
279
|
+
Form.Field,
|
|
280
|
+
{
|
|
281
|
+
control: form.control,
|
|
282
|
+
name: "email",
|
|
283
|
+
render: ({ field }) => /* @__PURE__ */ jsxs(Form.Item, { children: [
|
|
284
|
+
/* @__PURE__ */ jsx(Form.Label, { children: t("fields.email") }),
|
|
285
|
+
/* @__PURE__ */ jsx(Form.Control, { children: /* @__PURE__ */ jsx(
|
|
286
|
+
Input,
|
|
287
|
+
{
|
|
288
|
+
autoComplete: "off",
|
|
289
|
+
...field,
|
|
290
|
+
disabled: true
|
|
291
|
+
}
|
|
292
|
+
) })
|
|
293
|
+
] })
|
|
294
|
+
}
|
|
295
|
+
),
|
|
296
|
+
/* @__PURE__ */ jsx(
|
|
297
|
+
Form.Field,
|
|
298
|
+
{
|
|
299
|
+
control: form.control,
|
|
300
|
+
name: "password",
|
|
301
|
+
render: ({ field }) => /* @__PURE__ */ jsxs(Form.Item, { children: [
|
|
302
|
+
/* @__PURE__ */ jsx(Form.Label, { children: t("fields.password") }),
|
|
303
|
+
/* @__PURE__ */ jsx(Form.Control, { children: /* @__PURE__ */ jsx(
|
|
304
|
+
Input,
|
|
305
|
+
{
|
|
306
|
+
autoComplete: "new-password",
|
|
307
|
+
type: "password",
|
|
308
|
+
...field
|
|
309
|
+
}
|
|
310
|
+
) })
|
|
311
|
+
] })
|
|
312
|
+
}
|
|
313
|
+
),
|
|
314
|
+
!isExistingMember && /* @__PURE__ */ jsx(
|
|
315
|
+
Form.Field,
|
|
316
|
+
{
|
|
317
|
+
control: form.control,
|
|
318
|
+
name: "repeat_password",
|
|
319
|
+
render: ({ field }) => /* @__PURE__ */ jsxs(Form.Item, { children: [
|
|
320
|
+
/* @__PURE__ */ jsx(Form.Label, { children: t("fields.repeatPassword") }),
|
|
321
|
+
/* @__PURE__ */ jsx(Form.Control, { children: /* @__PURE__ */ jsx(
|
|
322
|
+
Input,
|
|
323
|
+
{
|
|
324
|
+
autoComplete: "off",
|
|
325
|
+
type: "password",
|
|
326
|
+
...field
|
|
327
|
+
}
|
|
328
|
+
) })
|
|
329
|
+
] })
|
|
330
|
+
}
|
|
331
|
+
),
|
|
332
|
+
validationError && /* @__PURE__ */ jsx(Hint, { className: "inline-flex", variant: "error", children: validationError }),
|
|
333
|
+
serverError && /* @__PURE__ */ jsx(
|
|
334
|
+
Alert,
|
|
335
|
+
{
|
|
336
|
+
className: "bg-ui-bg-base items-center p-2",
|
|
337
|
+
dismissible: true,
|
|
338
|
+
variant: "error",
|
|
339
|
+
children: serverError
|
|
340
|
+
}
|
|
341
|
+
)
|
|
342
|
+
] }),
|
|
343
|
+
/* @__PURE__ */ jsx(
|
|
344
|
+
Button,
|
|
345
|
+
{
|
|
346
|
+
className: "w-full",
|
|
347
|
+
type: "submit",
|
|
348
|
+
isLoading: isCreatingAuthUser || isSigningIn || isAcceptingInvite,
|
|
349
|
+
disabled: invalid,
|
|
350
|
+
children: t("actions.continue")
|
|
351
|
+
}
|
|
352
|
+
)
|
|
353
|
+
] }) }),
|
|
354
|
+
/* @__PURE__ */ jsx(LoginLink, {})
|
|
355
|
+
] });
|
|
356
|
+
};
|
|
357
|
+
var InviteSchema = z.object({
|
|
358
|
+
id: z.string(),
|
|
359
|
+
jti: z.string(),
|
|
360
|
+
exp: z.number(),
|
|
361
|
+
iat: z.number()
|
|
362
|
+
});
|
|
363
|
+
var validateDecodedInvite = (decoded) => {
|
|
364
|
+
return InviteSchema.safeParse(decoded).success;
|
|
365
|
+
};
|
|
366
|
+
export {
|
|
367
|
+
Invite as Component
|
|
368
|
+
};
|
|
@@ -35,13 +35,11 @@ import {
|
|
|
35
35
|
} from "./chunk-3QSRE5LS.js";
|
|
36
36
|
import "./chunk-THHRRYRS.js";
|
|
37
37
|
import "./chunk-LRD242C7.js";
|
|
38
|
-
import {
|
|
39
|
-
useMe
|
|
40
|
-
} from "./chunk-NYRRRCJS.js";
|
|
41
38
|
import {
|
|
42
39
|
useCreateInvite,
|
|
43
|
-
useInvites
|
|
44
|
-
|
|
40
|
+
useInvites,
|
|
41
|
+
useMe
|
|
42
|
+
} from "./chunk-ZCJ737TR.js";
|
|
45
43
|
import "./chunk-F4OJN2F2.js";
|
|
46
44
|
import "./chunk-LRARA622.js";
|
|
47
45
|
import "./chunk-M6N4ISXL.js";
|
|
@@ -5,8 +5,7 @@ import "./chunk-CP5IL4P6.js";
|
|
|
5
5
|
import "./chunk-C6SUTRP2.js";
|
|
6
6
|
import "./chunk-3QSRE5LS.js";
|
|
7
7
|
import "./chunk-U2EI2ZLM.js";
|
|
8
|
-
import "./chunk-
|
|
9
|
-
import "./chunk-STBCWNZQ.js";
|
|
8
|
+
import "./chunk-ZCJ737TR.js";
|
|
10
9
|
import "./chunk-F4OJN2F2.js";
|
|
11
10
|
import "./chunk-LRARA622.js";
|
|
12
11
|
import "./chunk-M6N4ISXL.js";
|
|
@@ -4,10 +4,10 @@ import {
|
|
|
4
4
|
import "./chunk-S2Q7PO7I.js";
|
|
5
5
|
import {
|
|
6
6
|
EditProductMediaSchema
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-VTHSHOX4.js";
|
|
8
8
|
import "./chunk-IZ5RG5XI.js";
|
|
9
9
|
import "./chunk-SMQT3ZNO.js";
|
|
10
|
-
import "./chunk-
|
|
10
|
+
import "./chunk-2DUMXTKS.js";
|
|
11
11
|
import "./chunk-TKGWSUEI.js";
|
|
12
12
|
import {
|
|
13
13
|
KeyboundForm
|
|
@@ -5,8 +5,7 @@ import "./chunk-TKGWSUEI.js";
|
|
|
5
5
|
import "./chunk-U2ZFCAPX.js";
|
|
6
6
|
import "./chunk-3CK6OINO.js";
|
|
7
7
|
import "./chunk-3QSRE5LS.js";
|
|
8
|
-
import "./chunk-
|
|
9
|
-
import "./chunk-STBCWNZQ.js";
|
|
8
|
+
import "./chunk-ZCJ737TR.js";
|
|
10
9
|
import "./chunk-F4OJN2F2.js";
|
|
11
10
|
import "./chunk-LRARA622.js";
|
|
12
11
|
import "./chunk-M6N4ISXL.js";
|
|
@@ -5,8 +5,7 @@ import "./chunk-TKGWSUEI.js";
|
|
|
5
5
|
import "./chunk-U2ZFCAPX.js";
|
|
6
6
|
import "./chunk-3CK6OINO.js";
|
|
7
7
|
import "./chunk-3QSRE5LS.js";
|
|
8
|
-
import "./chunk-
|
|
9
|
-
import "./chunk-STBCWNZQ.js";
|
|
8
|
+
import "./chunk-ZCJ737TR.js";
|
|
10
9
|
import "./chunk-F4OJN2F2.js";
|
|
11
10
|
import "./chunk-LRARA622.js";
|
|
12
11
|
import "./chunk-M6N4ISXL.js";
|
|
@@ -8,8 +8,7 @@ import {
|
|
|
8
8
|
RouteDrawer
|
|
9
9
|
} from "./chunk-3CK6OINO.js";
|
|
10
10
|
import "./chunk-3QSRE5LS.js";
|
|
11
|
-
import "./chunk-
|
|
12
|
-
import "./chunk-STBCWNZQ.js";
|
|
11
|
+
import "./chunk-ZCJ737TR.js";
|
|
13
12
|
import "./chunk-F4OJN2F2.js";
|
|
14
13
|
import "./chunk-LRARA622.js";
|
|
15
14
|
import "./chunk-M6N4ISXL.js";
|
|
@@ -5,8 +5,7 @@ import "./chunk-TKGWSUEI.js";
|
|
|
5
5
|
import "./chunk-U2ZFCAPX.js";
|
|
6
6
|
import "./chunk-3CK6OINO.js";
|
|
7
7
|
import "./chunk-3QSRE5LS.js";
|
|
8
|
-
import "./chunk-
|
|
9
|
-
import "./chunk-STBCWNZQ.js";
|
|
8
|
+
import "./chunk-ZCJ737TR.js";
|
|
10
9
|
import "./chunk-F4OJN2F2.js";
|
|
11
10
|
import "./chunk-LRARA622.js";
|
|
12
11
|
import "./chunk-M6N4ISXL.js";
|
|
@@ -8,8 +8,7 @@ import {
|
|
|
8
8
|
RouteDrawer
|
|
9
9
|
} from "./chunk-3CK6OINO.js";
|
|
10
10
|
import "./chunk-3QSRE5LS.js";
|
|
11
|
-
import "./chunk-
|
|
12
|
-
import "./chunk-STBCWNZQ.js";
|
|
11
|
+
import "./chunk-ZCJ737TR.js";
|
|
13
12
|
import "./chunk-F4OJN2F2.js";
|
|
14
13
|
import "./chunk-LRARA622.js";
|
|
15
14
|
import "./chunk-M6N4ISXL.js";
|