@clerk/ui 0.1.9

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.
@@ -0,0 +1,1610 @@
1
+ import { useLocalizations, Root2, Label, Input, Animated, Message, useDevModeWarning, useCard, Root as Root$1, LOCALIZATION_NEEDED, Content, Header, Title, Description, Body, Footer, FooterAction, Logo, GlobalError, Button as Button$1, LinkButton, FooterActionText, FooterActionButton, Connections, Actions, CaretRightLegacySm, PasswordField, useEnabledConnections, useEnvironment, useAttributes, useDisplayConfig, EmailField, UsernameField, PhoneNumberField, EmailOrPhoneNumberField, FooterActionLink, PenSm, OTPField, useOptions, Checkbox, useFocusInput, link, stringToFormattedPhoneString } from '../chunk-GJNJVJGS.mjs';
2
+ import { AppearanceProvider, Separator, useAppearance, Icon } from '../chunk-RVVUA25B.mjs';
3
+ import * as SignIn6 from '@clerk/elements/sign-in';
4
+ import { Root } from '@clerk/elements/sign-in';
5
+ import * as React from 'react';
6
+ import React__default from 'react';
7
+ import { useClerk } from '@clerk/shared/react';
8
+ import { cva } from 'cva';
9
+ import { Button, ToggleButton } from 'react-aria-components';
10
+ import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
11
+ import * as Common8 from '@clerk/elements/common';
12
+
13
+ var GetHelpContext = React.createContext(null);
14
+ var useGetHelp = () => {
15
+ const context = React.useContext(GetHelpContext);
16
+ if (!context) {
17
+ throw new Error("useGetHelp must be used within GetHelpContext.Provider");
18
+ }
19
+ return context;
20
+ };
21
+ function RightArrowSm(props) {
22
+ return /* @__PURE__ */ jsx(Icon, { ...props, children: /* @__PURE__ */ jsx("svg", { viewBox: "0 0 16 16", children: /* @__PURE__ */ jsx(
23
+ "path",
24
+ {
25
+ d: "M9.53033 4.94233C9.23744 4.64943 8.76256 4.64943 8.46967 4.94233C8.17678 5.23522 8.17678 5.71009 8.46967 6.00299L10.1893 7.72266H4C3.58579 7.72266 3.25 8.05844 3.25 8.47266C3.25 8.88687 3.58579 9.22266 4 9.22266H10.1893L8.46967 10.9423C8.17678 11.2352 8.17678 11.7101 8.46967 12.003C8.76256 12.2959 9.23744 12.2959 9.53033 12.003L12.5303 9.00299C12.8232 8.71009 12.8232 8.23522 12.5303 7.94233L9.53033 4.94233Z",
26
+ fill: "currentColor"
27
+ }
28
+ ) }) });
29
+ }
30
+ function getInitials({
31
+ firstName,
32
+ lastName,
33
+ identifier
34
+ }) {
35
+ let initials = "";
36
+ if (firstName) {
37
+ initials += firstName[0].toUpperCase();
38
+ }
39
+ if (lastName) {
40
+ initials += lastName[0].toUpperCase();
41
+ }
42
+ if (!initials && identifier) {
43
+ initials += identifier[0].toUpperCase();
44
+ }
45
+ return initials;
46
+ }
47
+ function getTitleAndSubtitle({
48
+ firstName,
49
+ lastName,
50
+ identifier
51
+ }) {
52
+ let title = "";
53
+ let subtitle = "";
54
+ if (firstName || lastName) {
55
+ title = [firstName, lastName].filter(Boolean).join(" ");
56
+ subtitle = identifier || "";
57
+ } else {
58
+ title = identifier || "";
59
+ }
60
+ return { title, subtitle };
61
+ }
62
+ var sessionAction = cva({
63
+ base: "cl-031094f6"
64
+ });
65
+ function SignInChooseSession() {
66
+ const { signOut } = useClerk();
67
+ const { t } = useLocalizations();
68
+ const isDev = useDevModeWarning();
69
+ const { footerProps } = useCard();
70
+ return /* @__PURE__ */ jsx(
71
+ SignIn6.Step,
72
+ {
73
+ asChild: true,
74
+ name: "choose-session",
75
+ children: /* @__PURE__ */ jsxs(Root$1, { banner: isDev ? LOCALIZATION_NEEDED.developmentMode : null, children: [
76
+ /* @__PURE__ */ jsxs(Content, { children: [
77
+ /* @__PURE__ */ jsxs(Header, { children: [
78
+ /* @__PURE__ */ jsx(Title, { children: t("signIn.accountSwitcher.title") }),
79
+ /* @__PURE__ */ jsx(Description, { children: t("signIn.accountSwitcher.subtitle") })
80
+ ] }),
81
+ /* @__PURE__ */ jsx(Body, { children: /* @__PURE__ */ jsxs("div", { className: "cl-855ce3c9", children: [
82
+ /* @__PURE__ */ jsx(SignIn6.SessionList, { includeCurrentSession: true, children: /* @__PURE__ */ jsx(SignIn6.SessionListItem, { asChild: true, children: ({ session }) => {
83
+ const { identifier, firstName, lastName, hasImage, imageUrl } = session;
84
+ const { title, subtitle } = getTitleAndSubtitle({ firstName, lastName, identifier });
85
+ return /* @__PURE__ */ jsx("li", { className: "cl-d0f85a65", children: /* @__PURE__ */ jsx(
86
+ SignIn6.Action,
87
+ {
88
+ setActiveSession: true,
89
+ asChild: true,
90
+ children: /* @__PURE__ */ jsxs(
91
+ Button,
92
+ {
93
+ type: "button",
94
+ className: sessionAction(),
95
+ children: [
96
+ /* @__PURE__ */ jsx("span", { className: "cl-77626d9b", children: hasImage ? /* @__PURE__ */ jsx(
97
+ "img",
98
+ {
99
+ src: imageUrl,
100
+ className: "cl-8ed2f06f",
101
+ alt: `Avatar for ${title}`
102
+ }
103
+ ) : /* @__PURE__ */ jsx("span", { className: "cl-f50b29b9", children: getInitials({ firstName, lastName, identifier }) }) }),
104
+ /* @__PURE__ */ jsxs("span", { className: "cl-cadbbf79", children: [
105
+ title ? /* @__PURE__ */ jsx("span", { className: "cl-e5dcc04d", children: title }) : null,
106
+ subtitle ? /* @__PURE__ */ jsx("span", { className: "cl-32b44f2e", children: subtitle }) : null
107
+ ] }),
108
+ /* @__PURE__ */ jsx("span", { className: "cl-ef87b06a", children: /* @__PURE__ */ jsx(RightArrowSm, {}) })
109
+ ]
110
+ }
111
+ )
112
+ }
113
+ ) });
114
+ } }) }),
115
+ /* @__PURE__ */ jsx("div", { className: "cl-d0f85a65", children: /* @__PURE__ */ jsx(
116
+ SignIn6.Action,
117
+ {
118
+ navigate: "start",
119
+ asChild: true,
120
+ children: /* @__PURE__ */ jsxs(
121
+ Button,
122
+ {
123
+ type: "button",
124
+ className: sessionAction(),
125
+ children: [
126
+ /* @__PURE__ */ jsx("span", { className: "cl-d15ca550", children: /* @__PURE__ */ jsxs(
127
+ "svg",
128
+ {
129
+ viewBox: "0 0 36 24",
130
+ className: "cl-6bb768bd",
131
+ "aria-hidden": true,
132
+ children: [
133
+ /* @__PURE__ */ jsx(
134
+ "circle",
135
+ {
136
+ cx: "18",
137
+ cy: "12",
138
+ r: "11.5",
139
+ strokeDasharray: "2 2",
140
+ className: "cl-e333d877"
141
+ }
142
+ ),
143
+ /* @__PURE__ */ jsx(
144
+ "path",
145
+ {
146
+ d: "M18.75 7.75a.75.75 0 1 0-1.5 0v3.5h-3.5a.75.75 0 1 0 0 1.5h3.5v3.5a.75.75 0 1 0 1.5 0v-3.5h3.5a.75.75 0 1 0 0-1.5h-3.5v-3.5Z",
147
+ className: "cl-c7780cae"
148
+ }
149
+ )
150
+ ]
151
+ }
152
+ ) }),
153
+ /* @__PURE__ */ jsx("span", { className: "cl-daaac3fb", children: t("signIn.accountSwitcher.action__addAccount") })
154
+ ]
155
+ }
156
+ )
157
+ }
158
+ ) })
159
+ ] }) })
160
+ ] }),
161
+ /* @__PURE__ */ jsx(Footer, { ...footerProps, children: /* @__PURE__ */ jsx(FooterAction, { children: /* @__PURE__ */ jsxs(
162
+ Button,
163
+ {
164
+ onPress: () => {
165
+ void signOut();
166
+ },
167
+ className: "cl-eab1f521",
168
+ children: [
169
+ /* @__PURE__ */ jsx("span", { className: "cl-73ffa5c8", children: /* @__PURE__ */ jsx(
170
+ "svg",
171
+ {
172
+ xmlns: "http://www.w3.org/2000/svg",
173
+ fill: "none",
174
+ viewBox: "0 0 36 24",
175
+ className: "cl-99a38caf",
176
+ children: /* @__PURE__ */ jsx(
177
+ "path",
178
+ {
179
+ fill: "currentColor",
180
+ fillRule: "evenodd",
181
+ d: "M12.6 6.604A2.045 2.045 0 0 1 14.052 6h3.417c.544 0 1.066.217 1.45.604.385.387.601.911.601 1.458v.69c0 .413-.334.75-.746.75a.748.748 0 0 1-.745-.75v-.69a.564.564 0 0 0-.56-.562h-3.417a.558.558 0 0 0-.56.563v7.874a.564.564 0 0 0 .56.563h3.417a.558.558 0 0 0 .56-.563v-.671c0-.415.334-.75.745-.75.412 0 .746.335.746.75v.671c0 .548-.216 1.072-.6 1.459a2.046 2.046 0 0 1-1.45.604H14.05a2.045 2.045 0 0 1-1.45-.604A2.068 2.068 0 0 1 12 15.937V8.064c0-.548.216-1.072.6-1.459Zm8.386 3.116a.743.743 0 0 1 1.055 0l1.74 1.75a.753.753 0 0 1 0 1.06l-1.74 1.75a.743.743 0 0 1-1.055 0 .753.753 0 0 1 0-1.06l.467-.47h-5.595a.748.748 0 0 1-.746-.75c0-.414.334-.75.746-.75h5.595l-.467-.47a.753.753 0 0 1 0-1.06Z",
182
+ clipRule: "evenodd"
183
+ }
184
+ )
185
+ }
186
+ ) }),
187
+ t("signIn.accountSwitcher.action__signOutAll")
188
+ ]
189
+ }
190
+ ) }) })
191
+ ] })
192
+ }
193
+ );
194
+ }
195
+ function EnvelopeSm(props) {
196
+ return /* @__PURE__ */ jsx(Icon, { ...props, children: /* @__PURE__ */ jsxs("svg", { viewBox: "0 0 16 16", children: [
197
+ /* @__PURE__ */ jsx(
198
+ "path",
199
+ {
200
+ d: "M2.75 5.75C2.75 4.64543 3.64543 3.75 4.75 3.75H11.25C12.3546 3.75 13.25 4.64543 13.25 5.75V10.25C13.25 11.3546 12.3546 12.25 11.25 12.25H4.75C3.64543 12.25 2.75 11.3546 2.75 10.25V5.75Z",
201
+ stroke: "currentColor",
202
+ strokeWidth: "1.5",
203
+ strokeLinecap: "round",
204
+ strokeLinejoin: "round"
205
+ }
206
+ ),
207
+ /* @__PURE__ */ jsx(
208
+ "path",
209
+ {
210
+ d: "M3 4.75L8 8.25L13 4.75",
211
+ stroke: "currentColor",
212
+ strokeWidth: "1.5",
213
+ strokeLinecap: "round",
214
+ strokeLinejoin: "round"
215
+ }
216
+ )
217
+ ] }) });
218
+ }
219
+ function FingerprintSm(props) {
220
+ return /* @__PURE__ */ jsx(Icon, { ...props, children: /* @__PURE__ */ jsx("svg", { viewBox: "0 0 16 16", children: /* @__PURE__ */ jsx(
221
+ "path",
222
+ {
223
+ d: "M4.58626 12.2271C4.70362 11.9655 4.81109 11.6999 4.90929 11.4292M9.67045 13.25C9.86213 12.749 9.98778 12.1841 10.1278 11.669M5.92223 3.22618C6.69944 2.87571 7.56005 2.71414 8.42317 2.75666C9.28629 2.79919 10.1236 3.04441 10.8563 3.46927C11.589 3.89414 12.1931 4.48469 12.6119 5.18543C13.0306 5.88617 13.2502 6.67407 13.25 7.47508C13.25 8.51981 13.1611 9.54529 12.9902 10.5455L12.4545 13.25M2.75 9.85168C2.9495 9.08924 3.05512 8.29361 3.05512 7.47508C3.05512 6.44763 3.40903 5.49631 4.01062 4.72128M8.15256 7.47451C8.15449 9.45894 7.723 11.4233 6.88636 13.25M5.54575 8.63636C5.58396 8.25402 5.60353 7.86676 5.60353 7.47508C5.60353 6.84864 5.87205 6.24786 6.35003 5.8049C6.82801 5.36194 7.47629 5.11309 8.15225 5.11309C8.82821 5.11309 9.47649 5.36194 9.95447 5.8049C10.4324 6.24786 10.701 6.84864 10.701 7.47508C10.701 7.76243 10.6936 8.04805 10.6781 8.33196L10.4957 9.44176",
224
+ stroke: "currentColor",
225
+ strokeWidth: 1.5,
226
+ strokeLinecap: "round",
227
+ strokeLinejoin: "round"
228
+ }
229
+ ) }) });
230
+ }
231
+ function LinkSm(props) {
232
+ return /* @__PURE__ */ jsx(Icon, { ...props, children: /* @__PURE__ */ jsx("svg", { viewBox: "0 0 16 16", children: /* @__PURE__ */ jsx(
233
+ "path",
234
+ {
235
+ d: "M7.75 3.7891L7.86522 3.67388C9.09706 2.44204 11.0943 2.44204 12.3261 3.67388C13.558 4.90572 13.558 6.90294 12.3261 8.13478L12.2109 8.25M6.75 9.25L9.25 6.75M8.25 12.2109L8.13478 12.3261C6.90294 13.558 4.90572 13.558 3.67388 12.3261C2.44204 11.0943 2.44204 9.09706 3.67388 7.86522L3.78911 7.75",
236
+ stroke: "currentColor",
237
+ strokeWidth: 1.5,
238
+ strokeLinecap: "round",
239
+ strokeLinejoin: "round"
240
+ }
241
+ ) }) });
242
+ }
243
+ function LockSm(props) {
244
+ return /* @__PURE__ */ jsx(Icon, { ...props, children: /* @__PURE__ */ jsx("svg", { viewBox: "0 0 16 16", children: /* @__PURE__ */ jsx(
245
+ "path",
246
+ {
247
+ d: "M5.25 7.75H3.75V11.25C3.75 12.3546 4.64543 13.25 5.75 13.25H10.25C11.3546 13.25 12.25 12.3546 12.25 11.25V7.75H10.75M5.25 7.75V5.5C5.25 3.98122 6.48122 2.75 8 2.75V2.75C9.51878 2.75 10.75 3.98122 10.75 5.5V7.75M5.25 7.75H10.75",
248
+ stroke: "currentColor",
249
+ strokeWidth: 1.5,
250
+ strokeLinecap: "round",
251
+ strokeLinejoin: "round"
252
+ }
253
+ ) }) });
254
+ }
255
+ function SmsSm(props) {
256
+ return /* @__PURE__ */ jsx(Icon, { ...props, children: /* @__PURE__ */ jsx("svg", { viewBox: "0 0 16 16", children: /* @__PURE__ */ jsx(
257
+ "path",
258
+ {
259
+ d: "M3.64195 10.1495L4.39134 10.1796C4.39823 10.0081 4.3461 9.83945 4.24363 9.70176L3.64195 10.1495ZM2.75 13.25L2.22719 12.7123C1.99924 12.9339 1.93578 13.2751 2.06885 13.5639C2.20191 13.8526 2.50257 14.0261 2.81915 13.9968L2.75 13.25ZM6.22735 11.9724L6.45883 11.259C6.20845 11.1778 5.93379 11.2338 5.73517 11.4065L6.22735 11.9724ZM12.5 7.5C12.5 9.64028 10.5577 11.5 8 11.5V13C11.2413 13 14 10.6064 14 7.5H12.5ZM8 3.5C10.5577 3.5 12.5 5.35972 12.5 7.5H14C14 4.39358 11.2413 2 8 2V3.5ZM3.5 7.5C3.5 5.35972 5.44233 3.5 8 3.5V2C4.75868 2 2 4.39358 2 7.5H3.5ZM4.24363 9.70176C3.7701 9.06542 3.5 8.309 3.5 7.5H2C2 8.6531 2.38735 9.71985 3.04026 10.5972L4.24363 9.70176ZM3.27281 13.7877C3.69076 13.3814 3.94476 12.767 4.10437 12.1773C4.27074 11.5626 4.36392 10.8622 4.39134 10.1796L2.89255 10.1194C2.86859 10.7159 2.78742 11.3016 2.65647 11.7854C2.51877 12.2941 2.35249 12.5904 2.22719 12.7123L3.27281 13.7877ZM5.73517 11.4065C5.01099 12.0363 3.84761 12.3952 2.68085 12.5032L2.81915 13.9968C4.13186 13.8753 5.65704 13.4624 6.71952 12.5383L5.73517 11.4065ZM8 11.5C7.45679 11.5 6.93808 11.4145 6.45883 11.259L5.99586 12.6858C6.62412 12.8897 7.29904 13 8 13V11.5Z",
260
+ fill: "currentColor"
261
+ }
262
+ ) }) });
263
+ }
264
+ function FirstFactorConnections({ isGlobalLoading }) {
265
+ const { signIn } = useClerk().client;
266
+ const isFirstFactor = (signIn == null ? void 0 : signIn.status) === "needs_first_factor";
267
+ if (isFirstFactor) {
268
+ return /* @__PURE__ */ jsx(Connections, { disabled: isGlobalLoading });
269
+ }
270
+ return null;
271
+ }
272
+ function SignInChooseStrategy() {
273
+ const { t } = useLocalizations();
274
+ const { setShowHelp } = useGetHelp();
275
+ const isDev = useDevModeWarning();
276
+ const { logoProps, footerProps } = useCard();
277
+ return /* @__PURE__ */ jsx(Common8.Loading, { scope: "global", children: (isGlobalLoading) => {
278
+ return /* @__PURE__ */ jsx(
279
+ SignIn6.Step,
280
+ {
281
+ asChild: true,
282
+ name: "choose-strategy",
283
+ children: /* @__PURE__ */ jsxs(Root$1, { banner: isDev ? LOCALIZATION_NEEDED.developmentMode : null, children: [
284
+ /* @__PURE__ */ jsxs(Content, { children: [
285
+ /* @__PURE__ */ jsxs(Header, { children: [
286
+ /* @__PURE__ */ jsx(Logo, { ...logoProps }),
287
+ /* @__PURE__ */ jsx(Title, { children: t("signIn.alternativeMethods.title") }),
288
+ /* @__PURE__ */ jsx(Description, { children: t("signIn.alternativeMethods.subtitle") })
289
+ ] }),
290
+ /* @__PURE__ */ jsx(GlobalError, {}),
291
+ /* @__PURE__ */ jsx(Body, { children: /* @__PURE__ */ jsxs("div", { className: "cl-2a10bda8", children: [
292
+ /* @__PURE__ */ jsxs("div", { className: "cl-7c5144aa", children: [
293
+ /* @__PURE__ */ jsx(FirstFactorConnections, { isGlobalLoading }),
294
+ /* @__PURE__ */ jsx(
295
+ SignIn6.SupportedStrategy,
296
+ {
297
+ name: "email_link",
298
+ asChild: true,
299
+ children: /* @__PURE__ */ jsx(
300
+ Button$1,
301
+ {
302
+ intent: "secondary",
303
+ iconStart: /* @__PURE__ */ jsx(LinkSm, {}),
304
+ children: /* @__PURE__ */ jsx(
305
+ SignIn6.SafeIdentifier,
306
+ {
307
+ transform: (identifier) => t("signIn.alternativeMethods.blockButton__emailLink", {
308
+ identifier
309
+ })
310
+ }
311
+ )
312
+ }
313
+ )
314
+ }
315
+ ),
316
+ /* @__PURE__ */ jsx(
317
+ SignIn6.SupportedStrategy,
318
+ {
319
+ name: "email_code",
320
+ asChild: true,
321
+ children: /* @__PURE__ */ jsx(
322
+ Button$1,
323
+ {
324
+ intent: "secondary",
325
+ iconStart: /* @__PURE__ */ jsx(EnvelopeSm, {}),
326
+ children: /* @__PURE__ */ jsx(
327
+ SignIn6.SafeIdentifier,
328
+ {
329
+ transform: (identifier) => t("signIn.alternativeMethods.blockButton__emailCode", {
330
+ identifier
331
+ })
332
+ }
333
+ )
334
+ }
335
+ )
336
+ }
337
+ ),
338
+ /* @__PURE__ */ jsx(
339
+ SignIn6.SupportedStrategy,
340
+ {
341
+ name: "phone_code",
342
+ asChild: true,
343
+ children: /* @__PURE__ */ jsx(
344
+ Button$1,
345
+ {
346
+ intent: "secondary",
347
+ iconStart: /* @__PURE__ */ jsx(SmsSm, {}),
348
+ children: /* @__PURE__ */ jsx(
349
+ SignIn6.SafeIdentifier,
350
+ {
351
+ transform: (identifier) => t("signIn.alternativeMethods.blockButton__phoneCode", {
352
+ identifier
353
+ })
354
+ }
355
+ )
356
+ }
357
+ )
358
+ }
359
+ ),
360
+ /* @__PURE__ */ jsx(
361
+ SignIn6.SupportedStrategy,
362
+ {
363
+ name: "passkey",
364
+ asChild: true,
365
+ children: /* @__PURE__ */ jsx(
366
+ Button$1,
367
+ {
368
+ intent: "secondary",
369
+ iconStart: /* @__PURE__ */ jsx(FingerprintSm, {}),
370
+ children: t("signIn.alternativeMethods.blockButton__passkey")
371
+ }
372
+ )
373
+ }
374
+ ),
375
+ /* @__PURE__ */ jsx(
376
+ SignIn6.SupportedStrategy,
377
+ {
378
+ name: "password",
379
+ asChild: true,
380
+ children: /* @__PURE__ */ jsx(
381
+ Button$1,
382
+ {
383
+ intent: "secondary",
384
+ iconStart: /* @__PURE__ */ jsx(LockSm, {}),
385
+ children: t("signIn.alternativeMethods.blockButton__password")
386
+ }
387
+ )
388
+ }
389
+ ),
390
+ /* @__PURE__ */ jsx(
391
+ SignIn6.SupportedStrategy,
392
+ {
393
+ name: "totp",
394
+ asChild: true,
395
+ children: /* @__PURE__ */ jsx(Button$1, { intent: "secondary", children: t("signIn.alternativeMethods.blockButton__totp") })
396
+ }
397
+ ),
398
+ /* @__PURE__ */ jsx(
399
+ SignIn6.SupportedStrategy,
400
+ {
401
+ name: "backup_code",
402
+ asChild: true,
403
+ children: /* @__PURE__ */ jsx(Button$1, { intent: "secondary", children: t("signIn.alternativeMethods.blockButton__backupCode") })
404
+ }
405
+ )
406
+ ] }),
407
+ /* @__PURE__ */ jsx(
408
+ SignIn6.Action,
409
+ {
410
+ navigate: "previous",
411
+ asChild: true,
412
+ children: /* @__PURE__ */ jsx(LinkButton, { children: t("backButton") })
413
+ }
414
+ )
415
+ ] }) })
416
+ ] }),
417
+ /* @__PURE__ */ jsx(Footer, { ...footerProps, children: /* @__PURE__ */ jsx(FooterAction, { children: /* @__PURE__ */ jsxs(FooterActionText, { children: [
418
+ t("signIn.alternativeMethods.actionText"),
419
+ " ",
420
+ /* @__PURE__ */ jsxs(FooterActionButton, { onClick: () => setShowHelp(true), children: [
421
+ " ",
422
+ t("signIn.alternativeMethods.actionLink")
423
+ ] })
424
+ ] }) }) })
425
+ ] })
426
+ }
427
+ );
428
+ } });
429
+ }
430
+ function SignInForgotPassword() {
431
+ const { t } = useLocalizations();
432
+ const { setShowHelp } = useGetHelp();
433
+ const isDev = useDevModeWarning();
434
+ const { logoProps, footerProps } = useCard();
435
+ return /* @__PURE__ */ jsx(Common8.Loading, { scope: "global", children: (isGlobalLoading) => {
436
+ return /* @__PURE__ */ jsx(
437
+ SignIn6.Step,
438
+ {
439
+ asChild: true,
440
+ name: "forgot-password",
441
+ children: /* @__PURE__ */ jsxs(
442
+ Root$1,
443
+ {
444
+ as: "form",
445
+ banner: isDev ? LOCALIZATION_NEEDED.developmentMode : null,
446
+ children: [
447
+ /* @__PURE__ */ jsxs(Content, { children: [
448
+ /* @__PURE__ */ jsxs(Header, { children: [
449
+ /* @__PURE__ */ jsx(Logo, { ...logoProps }),
450
+ /* @__PURE__ */ jsx(Title, { children: t("signIn.forgotPasswordAlternativeMethods.title") })
451
+ ] }),
452
+ /* @__PURE__ */ jsx(GlobalError, {}),
453
+ /* @__PURE__ */ jsxs(Body, { children: [
454
+ /* @__PURE__ */ jsx(
455
+ SignIn6.SupportedStrategy,
456
+ {
457
+ name: "reset_password_email_code",
458
+ asChild: true,
459
+ children: /* @__PURE__ */ jsx(Button$1, { children: t("signIn.forgotPasswordAlternativeMethods.blockButton__resetPassword") })
460
+ }
461
+ ),
462
+ /* @__PURE__ */ jsx(Separator, { children: t("signIn.forgotPasswordAlternativeMethods.label__alternativeMethods") }),
463
+ /* @__PURE__ */ jsxs("div", { className: "cl-7c5144aa", children: [
464
+ /* @__PURE__ */ jsx(
465
+ Connections,
466
+ {
467
+ columns: 1,
468
+ textVisuallyHidden: false,
469
+ disabled: isGlobalLoading
470
+ }
471
+ ),
472
+ /* @__PURE__ */ jsx(
473
+ SignIn6.SupportedStrategy,
474
+ {
475
+ name: "email_link",
476
+ asChild: true,
477
+ children: /* @__PURE__ */ jsx(
478
+ Button$1,
479
+ {
480
+ intent: "secondary",
481
+ iconStart: /* @__PURE__ */ jsx(LinkSm, {}),
482
+ children: /* @__PURE__ */ jsx(
483
+ SignIn6.SafeIdentifier,
484
+ {
485
+ transform: (identifier) => t("signIn.alternativeMethods.blockButton__emailLink", {
486
+ identifier
487
+ })
488
+ }
489
+ )
490
+ }
491
+ )
492
+ }
493
+ ),
494
+ /* @__PURE__ */ jsx(
495
+ SignIn6.SupportedStrategy,
496
+ {
497
+ name: "reset_password_email_code",
498
+ asChild: true,
499
+ children: /* @__PURE__ */ jsx(
500
+ Button$1,
501
+ {
502
+ intent: "secondary",
503
+ iconStart: /* @__PURE__ */ jsx(EnvelopeSm, {}),
504
+ children: /* @__PURE__ */ jsx(
505
+ SignIn6.SafeIdentifier,
506
+ {
507
+ transform: (identifier) => t("signIn.alternativeMethods.blockButton__emailCode", {
508
+ identifier
509
+ })
510
+ }
511
+ )
512
+ }
513
+ )
514
+ }
515
+ ),
516
+ /* @__PURE__ */ jsx(
517
+ SignIn6.SupportedStrategy,
518
+ {
519
+ name: "reset_password_phone_code",
520
+ asChild: true,
521
+ children: /* @__PURE__ */ jsx(
522
+ Button$1,
523
+ {
524
+ intent: "secondary",
525
+ iconStart: /* @__PURE__ */ jsx(SmsSm, {}),
526
+ children: /* @__PURE__ */ jsx(
527
+ SignIn6.SafeIdentifier,
528
+ {
529
+ transform: (identifier) => t("signIn.alternativeMethods.blockButton__phoneCode", {
530
+ identifier
531
+ })
532
+ }
533
+ )
534
+ }
535
+ )
536
+ }
537
+ ),
538
+ /* @__PURE__ */ jsx(
539
+ SignIn6.SupportedStrategy,
540
+ {
541
+ name: "passkey",
542
+ asChild: true,
543
+ children: /* @__PURE__ */ jsx(
544
+ Button$1,
545
+ {
546
+ intent: "secondary",
547
+ iconStart: /* @__PURE__ */ jsx(FingerprintSm, {}),
548
+ children: t("signIn.alternativeMethods.blockButton__passkey")
549
+ }
550
+ )
551
+ }
552
+ ),
553
+ /* @__PURE__ */ jsx(
554
+ SignIn6.SupportedStrategy,
555
+ {
556
+ name: "password",
557
+ asChild: true,
558
+ children: /* @__PURE__ */ jsx(
559
+ Button$1,
560
+ {
561
+ intent: "secondary",
562
+ iconStart: /* @__PURE__ */ jsx(LockSm, {}),
563
+ children: t("signIn.alternativeMethods.blockButton__password")
564
+ }
565
+ )
566
+ }
567
+ )
568
+ ] }),
569
+ /* @__PURE__ */ jsx(
570
+ SignIn6.Action,
571
+ {
572
+ navigate: "start",
573
+ asChild: true,
574
+ children: /* @__PURE__ */ jsx(LinkButton, { children: t("backButton") })
575
+ }
576
+ )
577
+ ] })
578
+ ] }),
579
+ /* @__PURE__ */ jsx(Footer, { ...footerProps, children: /* @__PURE__ */ jsx(FooterAction, { children: /* @__PURE__ */ jsxs(FooterActionText, { children: [
580
+ t("signIn.alternativeMethods.actionText"),
581
+ " ",
582
+ /* @__PURE__ */ jsxs(FooterActionButton, { onClick: () => setShowHelp(true), children: [
583
+ " ",
584
+ t("signIn.alternativeMethods.actionLink")
585
+ ] })
586
+ ] }) }) })
587
+ ]
588
+ }
589
+ )
590
+ }
591
+ );
592
+ } });
593
+ }
594
+ function useSupportEmail() {
595
+ const Clerk = useClerk();
596
+ const { supportEmail: supportEmailFromOptions } = useOptions();
597
+ const { displayConfig } = useEnvironment();
598
+ const { supportEmail: supportEmailFromEnvironment } = displayConfig;
599
+ const supportEmail = React__default.useMemo(
600
+ () => supportEmailFromOptions || supportEmailFromEnvironment || ["support", "@", Clerk.frontendApi ? Clerk.frontendApi.replace("clerk.", "") : "clerk.com"].join(""),
601
+ [Clerk.frontendApi, supportEmailFromOptions, supportEmailFromEnvironment]
602
+ );
603
+ return supportEmail;
604
+ }
605
+ function SignInGetHelp() {
606
+ const { t } = useLocalizations();
607
+ const isDev = useDevModeWarning();
608
+ const supportEmail = useSupportEmail();
609
+ const { setShowHelp } = useGetHelp();
610
+ const { logoProps, footerProps } = useCard();
611
+ return /* @__PURE__ */ jsxs(Root$1, { banner: isDev ? LOCALIZATION_NEEDED.developmentMode : null, children: [
612
+ /* @__PURE__ */ jsxs(Content, { children: [
613
+ /* @__PURE__ */ jsxs(Header, { children: [
614
+ /* @__PURE__ */ jsx(Logo, { ...logoProps }),
615
+ /* @__PURE__ */ jsx(Title, { children: t("signIn.alternativeMethods.getHelp.title") }),
616
+ /* @__PURE__ */ jsx(Description, { children: t("signIn.alternativeMethods.getHelp.content") })
617
+ ] }),
618
+ /* @__PURE__ */ jsxs(Actions, { children: [
619
+ /* @__PURE__ */ jsx(
620
+ Button$1,
621
+ {
622
+ onClick: () => {
623
+ window.location.href = `mailto:${supportEmail}`;
624
+ },
625
+ iconEnd: /* @__PURE__ */ jsx(CaretRightLegacySm, {}),
626
+ children: "Email support"
627
+ }
628
+ ),
629
+ /* @__PURE__ */ jsx(LinkButton, { onClick: () => setShowHelp(false), children: t("backButton") })
630
+ ] })
631
+ ] }),
632
+ /* @__PURE__ */ jsx(Footer, { ...footerProps })
633
+ ] });
634
+ }
635
+ function CheckboxField({
636
+ label,
637
+ name,
638
+ ...props
639
+ }) {
640
+ return /* @__PURE__ */ jsx(
641
+ Common8.Field,
642
+ {
643
+ name,
644
+ asChild: true,
645
+ children: /* @__PURE__ */ jsxs(Root2, { children: [
646
+ /* @__PURE__ */ jsxs("div", { className: "cl-c354e22d", children: [
647
+ /* @__PURE__ */ jsx(
648
+ Common8.Input,
649
+ {
650
+ type: "checkbox",
651
+ asChild: true,
652
+ ...props,
653
+ children: /* @__PURE__ */ jsx(Checkbox, {})
654
+ }
655
+ ),
656
+ /* @__PURE__ */ jsx(Common8.Label, { asChild: true, children: /* @__PURE__ */ jsx(Label, { children: label }) })
657
+ ] }),
658
+ /* @__PURE__ */ jsx(Common8.FieldError, { asChild: true, children: ({ message }) => {
659
+ return /* @__PURE__ */ jsx(Message, { intent: "error", children: message });
660
+ } })
661
+ ] })
662
+ }
663
+ );
664
+ }
665
+ function SignInResetPassword() {
666
+ const { t } = useLocalizations();
667
+ const isDev = useDevModeWarning();
668
+ const { logoProps, footerProps } = useCard();
669
+ return /* @__PURE__ */ jsx(Common8.Loading, { scope: "global", children: (isGlobalLoading) => {
670
+ return /* @__PURE__ */ jsx(
671
+ SignIn6.Step,
672
+ {
673
+ asChild: true,
674
+ name: "reset-password",
675
+ children: /* @__PURE__ */ jsxs(
676
+ Root$1,
677
+ {
678
+ as: "form",
679
+ banner: isDev ? LOCALIZATION_NEEDED.developmentMode : null,
680
+ children: [
681
+ /* @__PURE__ */ jsxs(Content, { children: [
682
+ /* @__PURE__ */ jsxs(Header, { children: [
683
+ /* @__PURE__ */ jsx(Logo, { ...logoProps }),
684
+ /* @__PURE__ */ jsx(Title, { children: t("signIn.resetPassword.title") })
685
+ ] }),
686
+ /* @__PURE__ */ jsx(GlobalError, {}),
687
+ /* @__PURE__ */ jsx(Body, { children: /* @__PURE__ */ jsxs("div", { className: "cl-f0ebe729", children: [
688
+ /* @__PURE__ */ jsx(
689
+ PasswordField,
690
+ {
691
+ validatePassword: true,
692
+ name: "password",
693
+ label: t("formFieldLabel__newPassword")
694
+ }
695
+ ),
696
+ /* @__PURE__ */ jsx(
697
+ PasswordField,
698
+ {
699
+ name: "confirmPassword",
700
+ label: t("formFieldLabel__confirmPassword")
701
+ }
702
+ ),
703
+ /* @__PURE__ */ jsx(
704
+ CheckboxField,
705
+ {
706
+ name: "signOutOfOtherSessions",
707
+ label: t("formFieldLabel__signOutOfOtherSessions"),
708
+ defaultChecked: true
709
+ }
710
+ )
711
+ ] }) }),
712
+ /* @__PURE__ */ jsxs(Actions, { children: [
713
+ /* @__PURE__ */ jsx(Common8.Loading, { scope: "submit", children: (isSubmitting) => {
714
+ return /* @__PURE__ */ jsx(
715
+ SignIn6.Action,
716
+ {
717
+ submit: true,
718
+ asChild: true,
719
+ children: /* @__PURE__ */ jsx(
720
+ Button$1,
721
+ {
722
+ busy: isSubmitting,
723
+ disabled: isGlobalLoading,
724
+ children: t("signIn.resetPassword.formButtonPrimary")
725
+ }
726
+ )
727
+ }
728
+ );
729
+ } }),
730
+ /* @__PURE__ */ jsx(
731
+ SignIn6.Action,
732
+ {
733
+ navigate: "start",
734
+ asChild: true,
735
+ children: /* @__PURE__ */ jsx(LinkButton, { children: t("backButton") })
736
+ }
737
+ )
738
+ ] })
739
+ ] }),
740
+ /* @__PURE__ */ jsx(Footer, { ...footerProps })
741
+ ]
742
+ }
743
+ )
744
+ }
745
+ );
746
+ } });
747
+ }
748
+ var EmailOrUsernameField = React__default.forwardRef(function EmailOrUsernameField2({
749
+ alternativeFieldTrigger,
750
+ ...props
751
+ }, forwardedRef) {
752
+ const { t } = useLocalizations();
753
+ return /* @__PURE__ */ jsx(
754
+ Common8.Field,
755
+ {
756
+ name: "identifier",
757
+ asChild: true,
758
+ children: /* @__PURE__ */ jsxs(Root2, { children: [
759
+ /* @__PURE__ */ jsx(Common8.Label, { asChild: true, children: /* @__PURE__ */ jsxs(Label, { children: [
760
+ t("formFieldLabel__emailAddress_username"),
761
+ " ",
762
+ alternativeFieldTrigger && /* @__PURE__ */ jsx("span", { className: "cl-43770a6e", children: alternativeFieldTrigger })
763
+ ] }) }),
764
+ /* @__PURE__ */ jsx(Common8.FieldState, { children: ({ state }) => {
765
+ return /* @__PURE__ */ jsx(
766
+ Common8.Input,
767
+ {
768
+ ref: forwardedRef,
769
+ type: "text",
770
+ ...props,
771
+ asChild: true,
772
+ children: /* @__PURE__ */ jsx(Input, { intent: state })
773
+ }
774
+ );
775
+ } }),
776
+ /* @__PURE__ */ jsx(Animated, { children: /* @__PURE__ */ jsx(Common8.FieldError, { asChild: true, children: ({ message }) => {
777
+ return /* @__PURE__ */ jsx(Message, { intent: "error", children: message });
778
+ } }) })
779
+ ] })
780
+ }
781
+ );
782
+ });
783
+ function EmailOrUsernameOrPhoneNumberField({
784
+ className,
785
+ name = void 0,
786
+ toggleLabelEmailOrUsername,
787
+ toggleLabelPhoneNumber,
788
+ ...props
789
+ }) {
790
+ const [showPhoneNumberField, setShowPhoneNumberField] = React.useState(false);
791
+ const [inputRef, setInputFocus] = useFocusInput();
792
+ const toggle = /* @__PURE__ */ jsxs(
793
+ ToggleButton,
794
+ {
795
+ isSelected: showPhoneNumberField,
796
+ onChange: (isSelected) => {
797
+ setShowPhoneNumberField(isSelected);
798
+ setInputFocus();
799
+ },
800
+ className: link({ size: "sm", disabled: props.disabled, focusVisible: "data-attribute" }),
801
+ children: [
802
+ /* @__PURE__ */ jsx("span", { className: "cl-32fb0905", children: LOCALIZATION_NEEDED.formFieldAccessibleLabel__emailOrUsernameOrPhone }),
803
+ showPhoneNumberField ? toggleLabelEmailOrUsername : toggleLabelPhoneNumber
804
+ ]
805
+ }
806
+ );
807
+ return showPhoneNumberField ? /* @__PURE__ */ jsx(
808
+ PhoneNumberField,
809
+ {
810
+ name,
811
+ alternativeFieldTrigger: toggle,
812
+ ...props,
813
+ ref: inputRef
814
+ }
815
+ ) : /* @__PURE__ */ jsx(
816
+ EmailOrUsernameField,
817
+ {
818
+ ...props,
819
+ name,
820
+ alternativeFieldTrigger: toggle,
821
+ ref: inputRef
822
+ }
823
+ );
824
+ }
825
+ function PhoneNumberOrUsernameField({
826
+ className,
827
+ name = void 0,
828
+ toggleLabelPhoneNumber,
829
+ toggleLabelUsername,
830
+ ...props
831
+ }) {
832
+ const [showUsernameField, setShowUsernameField] = React.useState(false);
833
+ const toggle = /* @__PURE__ */ jsxs(
834
+ ToggleButton,
835
+ {
836
+ isSelected: showUsernameField,
837
+ onChange: setShowUsernameField,
838
+ className: link({ size: "sm", disabled: props.disabled, focusVisible: "data-attribute" }),
839
+ children: [
840
+ /* @__PURE__ */ jsx("span", { className: "cl-32fb0905", children: LOCALIZATION_NEEDED.formFieldAccessibleLabel__phoneOrUsername }),
841
+ showUsernameField ? toggleLabelPhoneNumber : toggleLabelUsername
842
+ ]
843
+ }
844
+ );
845
+ return showUsernameField ? /* @__PURE__ */ jsx(
846
+ UsernameField,
847
+ {
848
+ ...props,
849
+ name,
850
+ alternativeFieldTrigger: toggle
851
+ }
852
+ ) : /* @__PURE__ */ jsx(
853
+ PhoneNumberField,
854
+ {
855
+ name,
856
+ alternativeFieldTrigger: toggle,
857
+ ...props
858
+ }
859
+ );
860
+ }
861
+
862
+ // src/constants/user-settings.ts
863
+ var SIGN_UP_MODES = {
864
+ PUBLIC: "public",
865
+ RESTRICTED: "restricted"
866
+ };
867
+ function SignInStart() {
868
+ const enabledConnections = useEnabledConnections();
869
+ const { t } = useLocalizations();
870
+ const { userSettings } = useEnvironment();
871
+ const { enabled: usernameEnabled } = useAttributes("username");
872
+ const { enabled: phoneNumberEnabled } = useAttributes("phone_number");
873
+ const { enabled: emailAddressEnabled } = useAttributes("email_address");
874
+ const { enabled: passkeyEnabled } = useAttributes("passkey");
875
+ const { applicationName } = useDisplayConfig();
876
+ const hasConnection = enabledConnections.length > 0;
877
+ const hasIdentifier = emailAddressEnabled || usernameEnabled || phoneNumberEnabled;
878
+ const isDev = useDevModeWarning();
879
+ const { options } = useAppearance().parsedAppearance;
880
+ const { logoProps, footerProps } = useCard();
881
+ return /* @__PURE__ */ jsx(Common8.Loading, { scope: "global", children: (isGlobalLoading) => {
882
+ const connectionsWithSeperator = [
883
+ /* @__PURE__ */ jsx(
884
+ Connections,
885
+ {
886
+ disabled: isGlobalLoading
887
+ },
888
+ "connections"
889
+ ),
890
+ hasConnection && hasIdentifier ? /* @__PURE__ */ jsx(Separator, { children: t("dividerText") }, "separator") : null
891
+ ];
892
+ return /* @__PURE__ */ jsx(
893
+ SignIn6.Step,
894
+ {
895
+ asChild: true,
896
+ name: "start",
897
+ children: /* @__PURE__ */ jsxs(
898
+ Root$1,
899
+ {
900
+ as: "form",
901
+ banner: isDev ? LOCALIZATION_NEEDED.developmentMode : null,
902
+ children: [
903
+ /* @__PURE__ */ jsxs(Content, { children: [
904
+ /* @__PURE__ */ jsxs(Header, { children: [
905
+ /* @__PURE__ */ jsx(Logo, { ...logoProps }),
906
+ /* @__PURE__ */ jsx(Title, { children: t("signIn.start.title", { applicationName }) }),
907
+ /* @__PURE__ */ jsx(Description, { children: t("signIn.start.subtitle", { applicationName }) })
908
+ ] }),
909
+ /* @__PURE__ */ jsx(GlobalError, {}),
910
+ /* @__PURE__ */ jsxs(Body, { children: [
911
+ options.socialButtonsPlacement === "top" ? connectionsWithSeperator : null,
912
+ hasIdentifier ? /* @__PURE__ */ jsxs("div", { className: "cl-7147c693", children: [
913
+ emailAddressEnabled && !phoneNumberEnabled && !usernameEnabled ? /* @__PURE__ */ jsx(
914
+ EmailField,
915
+ {
916
+ name: "identifier",
917
+ disabled: isGlobalLoading,
918
+ required: true
919
+ }
920
+ ) : null,
921
+ usernameEnabled && !emailAddressEnabled && !phoneNumberEnabled ? /* @__PURE__ */ jsx(
922
+ UsernameField,
923
+ {
924
+ name: "identifier",
925
+ disabled: isGlobalLoading,
926
+ required: true
927
+ }
928
+ ) : null,
929
+ phoneNumberEnabled && !emailAddressEnabled && !usernameEnabled ? /* @__PURE__ */ jsx(
930
+ PhoneNumberField,
931
+ {
932
+ name: "identifier",
933
+ disabled: isGlobalLoading,
934
+ required: true
935
+ }
936
+ ) : null,
937
+ emailAddressEnabled && usernameEnabled && !phoneNumberEnabled ? /* @__PURE__ */ jsx(
938
+ EmailOrUsernameField,
939
+ {
940
+ name: "identifier",
941
+ disabled: isGlobalLoading,
942
+ required: true
943
+ }
944
+ ) : null,
945
+ emailAddressEnabled && phoneNumberEnabled && !usernameEnabled ? /* @__PURE__ */ jsx(
946
+ EmailOrPhoneNumberField,
947
+ {
948
+ name: "identifier",
949
+ toggleLabelEmail: t("signIn.start.actionLink__use_email"),
950
+ toggleLabelPhoneNumber: t("signIn.start.actionLink__use_phone"),
951
+ disabled: isGlobalLoading,
952
+ required: true
953
+ }
954
+ ) : null,
955
+ usernameEnabled && phoneNumberEnabled && !emailAddressEnabled ? /* @__PURE__ */ jsx(
956
+ PhoneNumberOrUsernameField,
957
+ {
958
+ name: "identifier",
959
+ toggleLabelPhoneNumber: t("signIn.start.actionLink__use_phone"),
960
+ toggleLabelUsername: t("signIn.start.actionLink__use_username"),
961
+ disabled: isGlobalLoading,
962
+ required: true
963
+ }
964
+ ) : null,
965
+ emailAddressEnabled && usernameEnabled && phoneNumberEnabled ? /* @__PURE__ */ jsx(
966
+ EmailOrUsernameOrPhoneNumberField,
967
+ {
968
+ name: "identifier",
969
+ toggleLabelEmailOrUsername: t("signIn.start.actionLink__use_email_username"),
970
+ toggleLabelPhoneNumber: t("signIn.start.actionLink__use_phone"),
971
+ disabled: isGlobalLoading,
972
+ required: true
973
+ }
974
+ ) : null
975
+ ] }) : null,
976
+ options.socialButtonsPlacement === "bottom" ? connectionsWithSeperator.reverse() : null
977
+ ] }),
978
+ /* @__PURE__ */ jsxs(Actions, { children: [
979
+ /* @__PURE__ */ jsx(Common8.Loading, { scope: "submit", children: (isSubmitting) => {
980
+ return /* @__PURE__ */ jsx(
981
+ SignIn6.Action,
982
+ {
983
+ submit: true,
984
+ asChild: true,
985
+ children: /* @__PURE__ */ jsx(
986
+ Button$1,
987
+ {
988
+ busy: isSubmitting,
989
+ disabled: isGlobalLoading,
990
+ iconEnd: /* @__PURE__ */ jsx(CaretRightLegacySm, {}),
991
+ children: t("formButtonPrimary")
992
+ }
993
+ )
994
+ }
995
+ );
996
+ } }),
997
+ // Note:
998
+ // Currently this triggers the loading spinner for "Continue"
999
+ // which is a little confusing. We could use a manual
1000
+ // setState on click, but we'll need to find a way to clean
1001
+ // up the state based on `isSubmitting`
1002
+ passkeyEnabled ? /* @__PURE__ */ jsx(Common8.Loading, { scope: "passkey", children: (isSubmitting) => {
1003
+ return /* @__PURE__ */ jsx(SignIn6.Passkey, { asChild: true, children: /* @__PURE__ */ jsx(
1004
+ LinkButton,
1005
+ {
1006
+ type: "button",
1007
+ disabled: isGlobalLoading || isSubmitting,
1008
+ children: t("signIn.start.actionLink__use_passkey")
1009
+ }
1010
+ ) });
1011
+ } }) : null
1012
+ ] })
1013
+ ] }),
1014
+ /* @__PURE__ */ jsx(Footer, { ...footerProps, children: userSettings.signUp.mode === SIGN_UP_MODES.PUBLIC ? /* @__PURE__ */ jsx(FooterAction, { children: /* @__PURE__ */ jsxs(FooterActionText, { children: [
1015
+ t("signIn.start.actionText"),
1016
+ " ",
1017
+ /* @__PURE__ */ jsxs(FooterActionLink, { href: "/sign-up", children: [
1018
+ " ",
1019
+ t("signIn.start.actionLink")
1020
+ ] })
1021
+ ] }) }) : null })
1022
+ ]
1023
+ }
1024
+ )
1025
+ }
1026
+ );
1027
+ } });
1028
+ }
1029
+ function BackupCodeField(props) {
1030
+ const { t } = useLocalizations();
1031
+ return /* @__PURE__ */ jsx(
1032
+ Common8.Field,
1033
+ {
1034
+ name: "backup_code",
1035
+ asChild: true,
1036
+ children: /* @__PURE__ */ jsxs(Root2, { children: [
1037
+ /* @__PURE__ */ jsx(Common8.Label, { asChild: true, children: /* @__PURE__ */ jsx(Label, { children: t("formFieldLabel__backupCode") }) }),
1038
+ /* @__PURE__ */ jsx(Common8.FieldState, { children: ({ state }) => {
1039
+ return /* @__PURE__ */ jsx(
1040
+ Common8.Input,
1041
+ {
1042
+ type: "text",
1043
+ ...props,
1044
+ asChild: true,
1045
+ children: /* @__PURE__ */ jsx(Input, { intent: state })
1046
+ }
1047
+ );
1048
+ } }),
1049
+ /* @__PURE__ */ jsx(Common8.FieldError, { asChild: true, children: ({ message }) => {
1050
+ return /* @__PURE__ */ jsx(Message, { intent: "error", children: message });
1051
+ } })
1052
+ ] })
1053
+ }
1054
+ );
1055
+ }
1056
+ var resetPasswordStrategies = ["reset_password_phone_code", "reset_password_email_code"];
1057
+ var isResetPasswordStrategy = (strategy) => !!strategy && resetPasswordStrategies.includes(strategy);
1058
+ function useResetPasswordFactor() {
1059
+ var _a;
1060
+ const clerk = useClerk();
1061
+ return (_a = clerk.client.signIn.supportedFirstFactors) == null ? void 0 : _a.find(({ strategy }) => isResetPasswordStrategy(strategy));
1062
+ }
1063
+
1064
+ // src/utils/format-safe-identifier.ts
1065
+ var isMaskedIdentifier = (str) => str && str.includes("**");
1066
+ function formatSafeIdentifier(str) {
1067
+ if (!str || str.includes("@") || isMaskedIdentifier(str) || str.match(/[a-zA-Z]/)) {
1068
+ return str;
1069
+ }
1070
+ return stringToFormattedPhoneString(str);
1071
+ }
1072
+ function SignInVerifications() {
1073
+ const { t } = useLocalizations();
1074
+ const { applicationName } = useDisplayConfig();
1075
+ const isDev = useDevModeWarning();
1076
+ const isPasswordResetSupported = useResetPasswordFactor();
1077
+ const { logoProps, footerProps } = useCard();
1078
+ return /* @__PURE__ */ jsx(Common8.Loading, { scope: "global", children: (isGlobalLoading) => {
1079
+ return /* @__PURE__ */ jsx(
1080
+ SignIn6.Step,
1081
+ {
1082
+ asChild: true,
1083
+ name: "verifications",
1084
+ children: /* @__PURE__ */ jsxs(
1085
+ Root$1,
1086
+ {
1087
+ as: "form",
1088
+ banner: isDev ? LOCALIZATION_NEEDED.developmentMode : null,
1089
+ children: [
1090
+ /* @__PURE__ */ jsxs(Content, { children: [
1091
+ /* @__PURE__ */ jsxs(SignIn6.Strategy, { name: "password", children: [
1092
+ /* @__PURE__ */ jsxs(Header, { children: [
1093
+ /* @__PURE__ */ jsx(Logo, { ...logoProps }),
1094
+ /* @__PURE__ */ jsx(Title, { children: t("signIn.password.title") }),
1095
+ /* @__PURE__ */ jsx(Description, { children: t("signIn.password.subtitle") }),
1096
+ /* @__PURE__ */ jsx(Description, { children: /* @__PURE__ */ jsxs("span", { className: "cl-6cb778e1", children: [
1097
+ /* @__PURE__ */ jsx(SignIn6.SafeIdentifier, { transform: formatSafeIdentifier }),
1098
+ /* @__PURE__ */ jsx(
1099
+ SignIn6.Action,
1100
+ {
1101
+ navigate: "start",
1102
+ asChild: true,
1103
+ children: /* @__PURE__ */ jsx(
1104
+ "button",
1105
+ {
1106
+ type: "button",
1107
+ className: "cl-26a6f33a",
1108
+ "aria-label": "Start again",
1109
+ children: /* @__PURE__ */ jsx(PenSm, {})
1110
+ }
1111
+ )
1112
+ }
1113
+ )
1114
+ ] }) })
1115
+ ] }),
1116
+ /* @__PURE__ */ jsx(GlobalError, {}),
1117
+ /* @__PURE__ */ jsx(Body, { children: /* @__PURE__ */ jsx(
1118
+ PasswordField,
1119
+ {
1120
+ autoFocus: true,
1121
+ label: t("formFieldLabel__password"),
1122
+ alternativeFieldTrigger: isPasswordResetSupported ? /* @__PURE__ */ jsx(
1123
+ SignIn6.Action,
1124
+ {
1125
+ navigate: "forgot-password",
1126
+ asChild: true,
1127
+ children: /* @__PURE__ */ jsx(
1128
+ LinkButton,
1129
+ {
1130
+ size: "sm",
1131
+ disabled: isGlobalLoading,
1132
+ type: "button",
1133
+ children: t("formFieldAction__forgotPassword")
1134
+ }
1135
+ )
1136
+ }
1137
+ ) : null
1138
+ }
1139
+ ) }),
1140
+ /* @__PURE__ */ jsxs(Actions, { children: [
1141
+ /* @__PURE__ */ jsx(Common8.Loading, { scope: "submit", children: (isSubmitting) => {
1142
+ return /* @__PURE__ */ jsx(
1143
+ SignIn6.Action,
1144
+ {
1145
+ submit: true,
1146
+ asChild: true,
1147
+ children: /* @__PURE__ */ jsx(
1148
+ Button$1,
1149
+ {
1150
+ busy: isSubmitting,
1151
+ disabled: isGlobalLoading,
1152
+ iconEnd: /* @__PURE__ */ jsx(CaretRightLegacySm, {}),
1153
+ children: t("formButtonPrimary")
1154
+ }
1155
+ )
1156
+ }
1157
+ );
1158
+ } }),
1159
+ /* @__PURE__ */ jsx(
1160
+ SignIn6.Action,
1161
+ {
1162
+ navigate: "choose-strategy",
1163
+ asChild: true,
1164
+ children: /* @__PURE__ */ jsx(LinkButton, { disabled: isGlobalLoading, children: t("signIn.password.actionLink") })
1165
+ }
1166
+ )
1167
+ ] })
1168
+ ] }),
1169
+ /* @__PURE__ */ jsxs(SignIn6.Strategy, { name: "passkey", children: [
1170
+ /* @__PURE__ */ jsxs(Header, { children: [
1171
+ /* @__PURE__ */ jsx(Logo, { ...logoProps }),
1172
+ /* @__PURE__ */ jsx(Title, { children: t("signIn.passkey.title") }),
1173
+ /* @__PURE__ */ jsx(Description, { children: t("signIn.passkey.subtitle") }),
1174
+ /* @__PURE__ */ jsx(Description, { children: /* @__PURE__ */ jsxs("span", { className: "cl-6cb778e1", children: [
1175
+ /* @__PURE__ */ jsx(SignIn6.SafeIdentifier, {}),
1176
+ /* @__PURE__ */ jsx(
1177
+ SignIn6.Action,
1178
+ {
1179
+ navigate: "start",
1180
+ asChild: true,
1181
+ children: /* @__PURE__ */ jsx(
1182
+ "button",
1183
+ {
1184
+ type: "button",
1185
+ className: "cl-26a6f33a",
1186
+ "aria-label": "Start again",
1187
+ children: /* @__PURE__ */ jsx(PenSm, {})
1188
+ }
1189
+ )
1190
+ }
1191
+ )
1192
+ ] }) })
1193
+ ] }),
1194
+ /* @__PURE__ */ jsx(GlobalError, {}),
1195
+ /* @__PURE__ */ jsxs(Actions, { children: [
1196
+ /* @__PURE__ */ jsx(Common8.Loading, { scope: "submit", children: (isSubmitting) => {
1197
+ return /* @__PURE__ */ jsx(
1198
+ SignIn6.Action,
1199
+ {
1200
+ submit: true,
1201
+ asChild: true,
1202
+ children: /* @__PURE__ */ jsx(
1203
+ Button$1,
1204
+ {
1205
+ busy: isSubmitting,
1206
+ disabled: isGlobalLoading,
1207
+ iconEnd: /* @__PURE__ */ jsx(CaretRightLegacySm, {}),
1208
+ children: t("formButtonPrimary")
1209
+ }
1210
+ )
1211
+ }
1212
+ );
1213
+ } }),
1214
+ /* @__PURE__ */ jsx(
1215
+ SignIn6.Action,
1216
+ {
1217
+ navigate: "choose-strategy",
1218
+ asChild: true,
1219
+ children: /* @__PURE__ */ jsx(LinkButton, { disabled: isGlobalLoading, children: t("footerActionLink__useAnotherMethod") })
1220
+ }
1221
+ )
1222
+ ] })
1223
+ ] }),
1224
+ /* @__PURE__ */ jsxs(SignIn6.Strategy, { name: "backup_code", children: [
1225
+ /* @__PURE__ */ jsxs(Header, { children: [
1226
+ /* @__PURE__ */ jsx(Logo, { ...logoProps }),
1227
+ /* @__PURE__ */ jsx(Title, { children: t("signIn.backupCodeMfa.title") }),
1228
+ /* @__PURE__ */ jsx(Description, { children: t("signIn.backupCodeMfa.subtitle") })
1229
+ ] }),
1230
+ /* @__PURE__ */ jsx(GlobalError, {}),
1231
+ /* @__PURE__ */ jsx(Body, { children: /* @__PURE__ */ jsx(BackupCodeField, {}) }),
1232
+ /* @__PURE__ */ jsxs(Actions, { children: [
1233
+ /* @__PURE__ */ jsx(Common8.Loading, { scope: "submit", children: (isSubmitting) => {
1234
+ return /* @__PURE__ */ jsx(
1235
+ SignIn6.Action,
1236
+ {
1237
+ submit: true,
1238
+ asChild: true,
1239
+ children: /* @__PURE__ */ jsx(
1240
+ Button$1,
1241
+ {
1242
+ busy: isSubmitting,
1243
+ disabled: isGlobalLoading,
1244
+ iconEnd: /* @__PURE__ */ jsx(CaretRightLegacySm, {}),
1245
+ children: t("formButtonPrimary")
1246
+ }
1247
+ )
1248
+ }
1249
+ );
1250
+ } }),
1251
+ /* @__PURE__ */ jsx(
1252
+ SignIn6.Action,
1253
+ {
1254
+ navigate: "choose-strategy",
1255
+ asChild: true,
1256
+ children: /* @__PURE__ */ jsx(
1257
+ LinkButton,
1258
+ {
1259
+ disabled: isGlobalLoading,
1260
+ type: "button",
1261
+ children: t("footerActionLink__useAnotherMethod")
1262
+ }
1263
+ )
1264
+ }
1265
+ )
1266
+ ] })
1267
+ ] }),
1268
+ /* @__PURE__ */ jsxs(SignIn6.Strategy, { name: "email_code", children: [
1269
+ /* @__PURE__ */ jsxs(Header, { children: [
1270
+ /* @__PURE__ */ jsx(Logo, { ...logoProps }),
1271
+ /* @__PURE__ */ jsx(Title, { children: t("signIn.emailCode.title") }),
1272
+ /* @__PURE__ */ jsx(Description, { children: t("signIn.emailCode.subtitle", { applicationName }) }),
1273
+ /* @__PURE__ */ jsx(Description, { children: /* @__PURE__ */ jsxs("span", { className: "cl-6cb778e1", children: [
1274
+ /* @__PURE__ */ jsx(SignIn6.SafeIdentifier, {}),
1275
+ /* @__PURE__ */ jsx(
1276
+ SignIn6.Action,
1277
+ {
1278
+ navigate: "start",
1279
+ asChild: true,
1280
+ children: /* @__PURE__ */ jsx(
1281
+ "button",
1282
+ {
1283
+ type: "button",
1284
+ className: "cl-26a6f33a",
1285
+ "aria-label": "Start again",
1286
+ children: /* @__PURE__ */ jsx(PenSm, {})
1287
+ }
1288
+ )
1289
+ }
1290
+ )
1291
+ ] }) })
1292
+ ] }),
1293
+ /* @__PURE__ */ jsx(GlobalError, {}),
1294
+ /* @__PURE__ */ jsx(Body, { children: /* @__PURE__ */ jsx(
1295
+ OTPField,
1296
+ {
1297
+ label: t("signIn.emailCode.formTitle"),
1298
+ disabled: isGlobalLoading,
1299
+ resend: /* @__PURE__ */ jsx(
1300
+ SignIn6.Action,
1301
+ {
1302
+ asChild: true,
1303
+ resend: true,
1304
+ fallback: ({ resendableAfter }) => /* @__PURE__ */ jsxs(
1305
+ LinkButton,
1306
+ {
1307
+ type: "button",
1308
+ disabled: true,
1309
+ children: [
1310
+ t("signIn.emailCode.resendButton"),
1311
+ " (",
1312
+ /* @__PURE__ */ jsx("span", { className: "cl-ba2d0eea", children: resendableAfter }),
1313
+ ")"
1314
+ ]
1315
+ }
1316
+ ),
1317
+ children: /* @__PURE__ */ jsx(LinkButton, { type: "button", children: t("signIn.emailCode.resendButton") })
1318
+ }
1319
+ )
1320
+ }
1321
+ ) }),
1322
+ /* @__PURE__ */ jsxs(Actions, { children: [
1323
+ /* @__PURE__ */ jsx(Common8.Loading, { scope: "submit", children: (isSubmitting) => {
1324
+ return /* @__PURE__ */ jsx(
1325
+ SignIn6.Action,
1326
+ {
1327
+ submit: true,
1328
+ asChild: true,
1329
+ children: /* @__PURE__ */ jsx(
1330
+ Button$1,
1331
+ {
1332
+ busy: isSubmitting,
1333
+ disabled: isGlobalLoading,
1334
+ iconEnd: /* @__PURE__ */ jsx(CaretRightLegacySm, {}),
1335
+ children: t("formButtonPrimary")
1336
+ }
1337
+ )
1338
+ }
1339
+ );
1340
+ } }),
1341
+ /* @__PURE__ */ jsx(
1342
+ SignIn6.Action,
1343
+ {
1344
+ asChild: true,
1345
+ navigate: "choose-strategy",
1346
+ children: /* @__PURE__ */ jsx(LinkButton, { type: "button", children: t("footerActionLink__useAnotherMethod") })
1347
+ }
1348
+ )
1349
+ ] })
1350
+ ] }),
1351
+ /* @__PURE__ */ jsxs(SignIn6.Strategy, { name: "phone_code", children: [
1352
+ /* @__PURE__ */ jsxs(Header, { children: [
1353
+ /* @__PURE__ */ jsx(Logo, { ...logoProps }),
1354
+ /* @__PURE__ */ jsx(Title, { children: t("signIn.phoneCode.title") }),
1355
+ /* @__PURE__ */ jsx(Description, { children: t("signIn.phoneCode.subtitle", { applicationName }) }),
1356
+ /* @__PURE__ */ jsx(Description, { children: /* @__PURE__ */ jsxs("span", { className: "cl-6cb778e1", children: [
1357
+ /* @__PURE__ */ jsx(SignIn6.SafeIdentifier, { transform: formatSafeIdentifier }),
1358
+ /* @__PURE__ */ jsx(
1359
+ SignIn6.Action,
1360
+ {
1361
+ navigate: "start",
1362
+ asChild: true,
1363
+ children: /* @__PURE__ */ jsx(
1364
+ "button",
1365
+ {
1366
+ type: "button",
1367
+ className: "cl-26a6f33a",
1368
+ "aria-label": "Start again",
1369
+ children: /* @__PURE__ */ jsx(PenSm, {})
1370
+ }
1371
+ )
1372
+ }
1373
+ )
1374
+ ] }) })
1375
+ ] }),
1376
+ /* @__PURE__ */ jsx(GlobalError, {}),
1377
+ /* @__PURE__ */ jsx(Body, { children: /* @__PURE__ */ jsx(
1378
+ OTPField,
1379
+ {
1380
+ label: t("signIn.phoneCode.formTitle"),
1381
+ disabled: isGlobalLoading,
1382
+ resend: /* @__PURE__ */ jsx(
1383
+ SignIn6.Action,
1384
+ {
1385
+ asChild: true,
1386
+ resend: true,
1387
+ fallback: ({ resendableAfter }) => /* @__PURE__ */ jsxs(
1388
+ LinkButton,
1389
+ {
1390
+ type: "button",
1391
+ disabled: true,
1392
+ children: [
1393
+ t("signIn.phoneCode.resendButton"),
1394
+ " (",
1395
+ /* @__PURE__ */ jsx("span", { className: "cl-ba2d0eea", children: resendableAfter }),
1396
+ ")"
1397
+ ]
1398
+ }
1399
+ ),
1400
+ children: /* @__PURE__ */ jsx(LinkButton, { type: "button", children: t("signIn.phoneCode.resendButton") })
1401
+ }
1402
+ )
1403
+ }
1404
+ ) }),
1405
+ /* @__PURE__ */ jsxs(Actions, { children: [
1406
+ /* @__PURE__ */ jsx(Common8.Loading, { scope: "submit", children: (isSubmitting) => {
1407
+ return /* @__PURE__ */ jsx(
1408
+ SignIn6.Action,
1409
+ {
1410
+ submit: true,
1411
+ asChild: true,
1412
+ children: /* @__PURE__ */ jsx(
1413
+ Button$1,
1414
+ {
1415
+ busy: isSubmitting,
1416
+ disabled: isGlobalLoading,
1417
+ iconEnd: /* @__PURE__ */ jsx(CaretRightLegacySm, {}),
1418
+ children: t("formButtonPrimary")
1419
+ }
1420
+ )
1421
+ }
1422
+ );
1423
+ } }),
1424
+ /* @__PURE__ */ jsx(
1425
+ SignIn6.Action,
1426
+ {
1427
+ asChild: true,
1428
+ navigate: "choose-strategy",
1429
+ children: /* @__PURE__ */ jsx(LinkButton, { type: "button", children: t("footerActionLink__useAnotherMethod") })
1430
+ }
1431
+ )
1432
+ ] })
1433
+ ] }),
1434
+ /* @__PURE__ */ jsxs(SignIn6.Strategy, { name: "email_link", children: [
1435
+ /* @__PURE__ */ jsxs(Header, { children: [
1436
+ /* @__PURE__ */ jsx(Logo, { ...logoProps }),
1437
+ /* @__PURE__ */ jsx(Title, { children: t("signIn.emailLink.title") }),
1438
+ /* @__PURE__ */ jsx(Description, { children: t("signIn.emailLink.formSubtitle", { applicationName }) }),
1439
+ /* @__PURE__ */ jsx(Description, { children: /* @__PURE__ */ jsxs("span", { className: "cl-6cb778e1", children: [
1440
+ /* @__PURE__ */ jsx(SignIn6.SafeIdentifier, {}),
1441
+ /* @__PURE__ */ jsx(
1442
+ SignIn6.Action,
1443
+ {
1444
+ navigate: "start",
1445
+ asChild: true,
1446
+ children: /* @__PURE__ */ jsx(
1447
+ "button",
1448
+ {
1449
+ type: "button",
1450
+ className: "cl-26a6f33a",
1451
+ "aria-label": "Start again",
1452
+ children: /* @__PURE__ */ jsx(PenSm, {})
1453
+ }
1454
+ )
1455
+ }
1456
+ )
1457
+ ] }) })
1458
+ ] }),
1459
+ /* @__PURE__ */ jsx(GlobalError, {}),
1460
+ /* @__PURE__ */ jsx(Body, { children: /* @__PURE__ */ jsx(
1461
+ SignIn6.Action,
1462
+ {
1463
+ asChild: true,
1464
+ resend: true,
1465
+ fallback: ({ resendableAfter }) => /* @__PURE__ */ jsxs(
1466
+ LinkButton,
1467
+ {
1468
+ type: "button",
1469
+ disabled: true,
1470
+ children: [
1471
+ t("signIn.emailLink.resendButton"),
1472
+ " (",
1473
+ /* @__PURE__ */ jsx("span", { className: "cl-ba2d0eea", children: resendableAfter }),
1474
+ ")"
1475
+ ]
1476
+ }
1477
+ ),
1478
+ children: /* @__PURE__ */ jsx(LinkButton, { type: "button", children: t("signIn.emailLink.resendButton") })
1479
+ }
1480
+ ) }),
1481
+ /* @__PURE__ */ jsx(Actions, { children: /* @__PURE__ */ jsx(
1482
+ SignIn6.Action,
1483
+ {
1484
+ navigate: "choose-strategy",
1485
+ asChild: true,
1486
+ children: /* @__PURE__ */ jsx(LinkButton, { children: t("backButton") })
1487
+ }
1488
+ ) })
1489
+ ] }),
1490
+ /* @__PURE__ */ jsxs(SignIn6.Strategy, { name: "reset_password_email_code", children: [
1491
+ /* @__PURE__ */ jsxs(Header, { children: [
1492
+ /* @__PURE__ */ jsx(Title, { children: t("signIn.forgotPassword.title") }),
1493
+ /* @__PURE__ */ jsx(Description, { children: t("signIn.forgotPassword.subtitle_email") }),
1494
+ /* @__PURE__ */ jsx(Description, { children: /* @__PURE__ */ jsx(SignIn6.SafeIdentifier, {}) })
1495
+ ] }),
1496
+ /* @__PURE__ */ jsx(GlobalError, {}),
1497
+ /* @__PURE__ */ jsx(Body, { children: /* @__PURE__ */ jsx(
1498
+ OTPField,
1499
+ {
1500
+ label: t("signIn.forgotPassword.formTitle"),
1501
+ disabled: isGlobalLoading,
1502
+ resend: /* @__PURE__ */ jsx(
1503
+ SignIn6.Action,
1504
+ {
1505
+ asChild: true,
1506
+ resend: true,
1507
+ fallback: ({ resendableAfter }) => /* @__PURE__ */ jsxs(
1508
+ LinkButton,
1509
+ {
1510
+ type: "button",
1511
+ disabled: true,
1512
+ children: [
1513
+ t("signIn.phoneCode.resendButton"),
1514
+ " (",
1515
+ /* @__PURE__ */ jsx("span", { className: "cl-ba2d0eea", children: resendableAfter }),
1516
+ ")"
1517
+ ]
1518
+ }
1519
+ ),
1520
+ children: /* @__PURE__ */ jsx(LinkButton, { type: "button", children: t("signIn.phoneCode.resendButton") })
1521
+ }
1522
+ )
1523
+ }
1524
+ ) }),
1525
+ /* @__PURE__ */ jsx(Actions, { children: /* @__PURE__ */ jsx(Common8.Loading, { scope: "submit", children: (isSubmitting) => {
1526
+ return /* @__PURE__ */ jsx(
1527
+ SignIn6.Action,
1528
+ {
1529
+ submit: true,
1530
+ asChild: true,
1531
+ children: /* @__PURE__ */ jsx(
1532
+ Button$1,
1533
+ {
1534
+ busy: isSubmitting,
1535
+ disabled: isGlobalLoading,
1536
+ iconEnd: /* @__PURE__ */ jsx(CaretRightLegacySm, {}),
1537
+ children: t("formButtonPrimary")
1538
+ }
1539
+ )
1540
+ }
1541
+ );
1542
+ } }) })
1543
+ ] }),
1544
+ /* @__PURE__ */ jsxs(SignIn6.Strategy, { name: "totp", children: [
1545
+ /* @__PURE__ */ jsxs(Header, { children: [
1546
+ /* @__PURE__ */ jsx(Logo, { ...logoProps }),
1547
+ /* @__PURE__ */ jsx(Title, { children: t("signIn.totpMfa.formTitle") }),
1548
+ /* @__PURE__ */ jsx(Description, { children: t("signIn.totpMfa.subtitle", { applicationName }) })
1549
+ ] }),
1550
+ /* @__PURE__ */ jsx(GlobalError, {}),
1551
+ /* @__PURE__ */ jsx(Body, { children: /* @__PURE__ */ jsx(
1552
+ OTPField,
1553
+ {
1554
+ label: t("signIn.totpMfa.formTitle"),
1555
+ disabled: isGlobalLoading
1556
+ }
1557
+ ) }),
1558
+ /* @__PURE__ */ jsxs(Actions, { children: [
1559
+ /* @__PURE__ */ jsx(Common8.Loading, { scope: "submit", children: (isSubmitting) => {
1560
+ return /* @__PURE__ */ jsx(
1561
+ SignIn6.Action,
1562
+ {
1563
+ submit: true,
1564
+ asChild: true,
1565
+ children: /* @__PURE__ */ jsx(
1566
+ Button$1,
1567
+ {
1568
+ busy: isSubmitting,
1569
+ disabled: isGlobalLoading,
1570
+ iconEnd: /* @__PURE__ */ jsx(CaretRightLegacySm, {}),
1571
+ children: t("formButtonPrimary")
1572
+ }
1573
+ )
1574
+ }
1575
+ );
1576
+ } }),
1577
+ /* @__PURE__ */ jsx(
1578
+ SignIn6.Action,
1579
+ {
1580
+ asChild: true,
1581
+ navigate: "choose-strategy",
1582
+ children: /* @__PURE__ */ jsx(LinkButton, { type: "button", children: t("footerActionLink__useAnotherMethod") })
1583
+ }
1584
+ )
1585
+ ] })
1586
+ ] })
1587
+ ] }),
1588
+ /* @__PURE__ */ jsx(Footer, { ...footerProps })
1589
+ ]
1590
+ }
1591
+ )
1592
+ }
1593
+ );
1594
+ } });
1595
+ }
1596
+ function SignIn7({ appearance, ...rest }) {
1597
+ const [showHelp, setShowHelp] = React.useState(false);
1598
+ return /* @__PURE__ */ jsx(AppearanceProvider, { appearance, children: /* @__PURE__ */ jsx(GetHelpContext.Provider, { value: { showHelp, setShowHelp }, children: /* @__PURE__ */ jsx(Root, { ...rest, children: showHelp ? /* @__PURE__ */ jsx(SignInGetHelp, {}) : /* @__PURE__ */ jsxs(Fragment, { children: [
1599
+ /* @__PURE__ */ jsx(SignInStart, {}),
1600
+ /* @__PURE__ */ jsx(SignInVerifications, {}),
1601
+ /* @__PURE__ */ jsx(SignInChooseStrategy, {}),
1602
+ /* @__PURE__ */ jsx(SignInForgotPassword, {}),
1603
+ /* @__PURE__ */ jsx(SignInResetPassword, {}),
1604
+ /* @__PURE__ */ jsx(SignInChooseSession, {})
1605
+ ] }) }) }) });
1606
+ }
1607
+
1608
+ export { SignIn7 as SignIn };
1609
+ //# sourceMappingURL=out.js.map
1610
+ //# sourceMappingURL=sign-in.mjs.map