@ory/elements-react 1.0.0-rc.1 → 1.0.0-rc.3

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.
@@ -92,58 +92,12 @@ function DefaultCardContent({ children }) {
92
92
  }
93
93
 
94
94
  // src/theme/default/components/card/footer.tsx
95
- var import_client_fetch25 = require("@ory/client-fetch");
95
+ var import_client_fetch27 = require("@ory/client-fetch");
96
96
  var import_elements_react3 = require("@ory/elements-react");
97
97
  var import_react_intl10 = require("react-intl");
98
98
 
99
- // src/theme/default/utils/url.ts
100
- function restartFlowUrl(flow, fallback) {
101
- if (flow.requested_aal === "aal2")
102
- return appendRefresh(appendAal(fallback, "aal1"), true);
103
- return flow.request_url || appendReturnTo(fallback, flow.return_to);
104
- }
105
- function initFlowUrl(sdkUrl, flowType, flow) {
106
- const result = `${sdkUrl}/self-service/${flowType}/browser`;
107
- const qs = new URLSearchParams();
108
- if (flow.oauth2_login_challenge) {
109
- qs.set("login_challenge", flow.oauth2_login_challenge);
110
- }
111
- if (flow.return_to) {
112
- qs.set("return_to", flow.return_to);
113
- } else if (typeof window !== "undefined") {
114
- const searchParams = new URLSearchParams(window.location.search);
115
- if (searchParams.has("return_to")) {
116
- qs.set("return_to", searchParams.get("return_to") || "");
117
- }
118
- }
119
- if (qs.toString().length === 0) {
120
- return result;
121
- }
122
- return result + "?" + qs.toString();
123
- }
124
- function appendReturnTo(url, returnTo) {
125
- if (!returnTo) {
126
- return url;
127
- }
128
- const urlObj = new URL(url);
129
- urlObj.searchParams.set("return_to", returnTo);
130
- return urlObj.toString();
131
- }
132
- function appendAal(url, aal) {
133
- const urlObj = new URL(url);
134
- urlObj.searchParams.set("aal", aal);
135
- return urlObj.toString();
136
- }
137
- function appendRefresh(url, refresh) {
138
- const urlObj = new URL(url);
139
- urlObj.searchParams.set("refresh", refresh ? "true" : "false");
140
- return urlObj.toString();
141
- }
142
-
143
- // src/util/ui/index.ts
144
- var import_client_fetch2 = require("@ory/client-fetch");
145
- var import_client_fetch3 = require("@ory/client-fetch");
146
- var import_react2 = require("react");
99
+ // src/components/card/two-step/state-select-method.tsx
100
+ var import_client_fetch26 = require("@ory/client-fetch");
147
101
 
148
102
  // src/context/component.tsx
149
103
  var import_client_fetch = require("@ory/client-fetch");
@@ -167,7 +121,25 @@ var defaultGroupOrder = [
167
121
  import_client_fetch.UiNodeGroupEnum.Totp
168
122
  ];
169
123
 
124
+ // src/context/flow-context.tsx
125
+ var import_react4 = require("react");
126
+
127
+ // src/context/form-state.ts
128
+ var import_client_fetch5 = require("@ory/client-fetch");
129
+ var import_react3 = require("react");
130
+
131
+ // src/components/card/two-step/utils.ts
132
+ var import_client_fetch4 = require("@ory/client-fetch");
133
+
134
+ // src/theme/default/utils/form.ts
135
+ function isGroupImmediateSubmit(group) {
136
+ return group === "code";
137
+ }
138
+
170
139
  // src/util/ui/index.ts
140
+ var import_client_fetch2 = require("@ory/client-fetch");
141
+ var import_client_fetch3 = require("@ory/client-fetch");
142
+ var import_react2 = require("react");
171
143
  function nodesToAuthMethodGroups(nodes, excludeAuthMethods = []) {
172
144
  var _a;
173
145
  const groups = {};
@@ -230,34 +202,96 @@ function useNodeGroupsWithVisibleNodes(nodes) {
230
202
  }, [nodes]);
231
203
  }
232
204
 
233
- // src/util/nodes.ts
234
- function findScreenSelectionButton(nodes) {
235
- return nodes.find(
236
- (node) => node.attributes.node_type === "input" && node.attributes.type === "submit" && node.attributes.name === "screen"
237
- );
238
- }
239
-
240
- // src/components/card/two-step/state-select-method.tsx
241
- var import_client_fetch24 = require("@ory/client-fetch");
242
-
243
205
  // src/context/flow-context.tsx
244
- var import_react4 = require("react");
206
+ var import_jsx_runtime5 = require("react/jsx-runtime");
207
+ var OryFlowContext = (0, import_react4.createContext)(null);
245
208
 
246
- // src/context/form-state.ts
247
- var import_client_fetch5 = require("@ory/client-fetch");
248
- var import_react3 = require("react");
209
+ // src/context/config.tsx
210
+ var import_react5 = require("react");
249
211
 
250
- // src/components/card/two-step/utils.ts
251
- var import_client_fetch4 = require("@ory/client-fetch");
212
+ // src/client/config.ts
213
+ function isProduction() {
214
+ var _a, _b;
215
+ return ["production", "prod"].indexOf(
216
+ (_b = (_a = process.env.VERCEL_ENV) != null ? _a : process.env.NODE_ENV) != null ? _b : ""
217
+ ) > -1;
218
+ }
252
219
 
253
- // src/theme/default/utils/form.ts
254
- function isGroupImmediateSubmit(group) {
255
- return group === "code";
220
+ // src/util/client.ts
221
+ var import_client_fetch6 = require("@ory/client-fetch");
222
+ function frontendClient(sdkUrl, opts = {}) {
223
+ const config = new import_client_fetch6.Configuration({
224
+ ...opts,
225
+ basePath: sdkUrl,
226
+ credentials: "include",
227
+ headers: {
228
+ Accept: "application/json",
229
+ ...opts.headers
230
+ }
231
+ });
232
+ return new import_client_fetch6.FrontendApi(config);
256
233
  }
257
234
 
258
- // src/context/flow-context.tsx
259
- var import_jsx_runtime5 = require("react/jsx-runtime");
260
- var OryFlowContext = (0, import_react4.createContext)(null);
235
+ // src/context/config.tsx
236
+ var import_jsx_runtime6 = require("react/jsx-runtime");
237
+ var defaultProject = {
238
+ name: "Ory",
239
+ registration_enabled: true,
240
+ verification_enabled: true,
241
+ recovery_enabled: true,
242
+ recovery_ui_url: "/ui/recovery",
243
+ registration_ui_url: "/ui/registration",
244
+ verification_ui_url: "/ui/verification",
245
+ login_ui_url: "/ui/login",
246
+ settings_ui_url: "/ui/settings",
247
+ default_redirect_url: "/ui/welcome",
248
+ error_ui_url: "/ui/error",
249
+ default_locale: "en",
250
+ locale_behavior: "force_default"
251
+ };
252
+ var OryConfigurationContext = (0, import_react5.createContext)({
253
+ sdk: computeSdkConfig({}),
254
+ project: defaultProject
255
+ });
256
+ function computeSdkConfig(config) {
257
+ if ((config == null ? void 0 : config.url) && typeof config.url === "string") {
258
+ console.debug("Using sdk url from config");
259
+ return {
260
+ url: config.url.replace(/\/$/, ""),
261
+ options: config.options || {}
262
+ };
263
+ }
264
+ return {
265
+ url: getSDKUrl(),
266
+ options: (config == null ? void 0 : config.options) || {}
267
+ };
268
+ }
269
+ function getSDKUrl() {
270
+ var _a;
271
+ if (typeof process !== "undefined" && process.versions && process.versions.node) {
272
+ if (isProduction()) {
273
+ const sdkUrl = (_a = process.env["NEXT_PUBLIC_ORY_SDK_URL"]) != null ? _a : process.env["ORY_SDK_URL"];
274
+ if (!sdkUrl) {
275
+ throw new Error(
276
+ "Unable to determine SDK URL. Please set NEXT_PUBLIC_ORY_SDK_URL and/or ORY_SDK_URL in production environments."
277
+ );
278
+ }
279
+ return sdkUrl.replace(/\/$/, "");
280
+ } else {
281
+ if (process.env["__NEXT_PRIVATE_ORIGIN"]) {
282
+ return process.env["__NEXT_PRIVATE_ORIGIN"].replace(/\/$/, "");
283
+ } else if (process.env["VERCEL_URL"]) {
284
+ return `https://${process.env["VERCEL_URL"]}`.replace(/\/$/, "");
285
+ }
286
+ }
287
+ }
288
+ if (typeof window !== "undefined") {
289
+ return window.location.origin;
290
+ }
291
+ throw new Error(
292
+ "Unable to determine SDK URL. Please set NEXT_PUBLIC_ORY_SDK_URL and/or ORY_SDK_URL or supply the sdk.url parameter in the Ory configuration."
293
+ );
294
+ }
261
295
 
262
296
  // src/context/intl-context.tsx
263
297
  var import_react_intl8 = require("react-intl");
@@ -274,20 +308,6 @@ var import_react_hook_form = require("react-hook-form");
274
308
  // src/util/onSubmitLogin.ts
275
309
  var import_client_fetch7 = require("@ory/client-fetch");
276
310
 
277
- // src/util/client.ts
278
- var import_client_fetch6 = require("@ory/client-fetch");
279
- function frontendClient(sdkUrl, opts = {}) {
280
- const config = new import_client_fetch6.Configuration({
281
- ...opts,
282
- basePath: sdkUrl,
283
- headers: {
284
- Accept: "application/json",
285
- ...opts.headers
286
- }
287
- });
288
- return new import_client_fetch6.FrontendApi(config);
289
- }
290
-
291
311
  // src/util/onSubmitRecovery.ts
292
312
  var import_client_fetch8 = require("@ory/client-fetch");
293
313
 
@@ -304,83 +324,86 @@ var import_client_fetch11 = require("@ory/client-fetch");
304
324
  var import_client_fetch12 = require("@ory/client-fetch");
305
325
 
306
326
  // src/components/form/form.tsx
307
- var import_jsx_runtime6 = require("react/jsx-runtime");
327
+ var import_jsx_runtime7 = require("react/jsx-runtime");
328
+
329
+ // src/components/form/groups.tsx
330
+ var import_client_fetch17 = require("@ory/client-fetch");
308
331
 
309
332
  // src/components/form/nodes/input.tsx
310
333
  var import_client_fetch15 = require("@ory/client-fetch");
311
- var import_react5 = require("react");
334
+ var import_react6 = require("react");
312
335
  var import_react_hook_form3 = require("react-hook-form");
313
- var import_jsx_runtime7 = require("react/jsx-runtime");
336
+ var import_jsx_runtime8 = require("react/jsx-runtime");
314
337
 
315
338
  // src/components/form/nodes/node.tsx
316
339
  var import_client_fetch16 = require("@ory/client-fetch");
317
- var import_jsx_runtime8 = require("react/jsx-runtime");
340
+ var import_jsx_runtime9 = require("react/jsx-runtime");
318
341
 
319
342
  // src/components/form/groups.tsx
320
- var import_jsx_runtime9 = require("react/jsx-runtime");
343
+ var import_jsx_runtime10 = require("react/jsx-runtime");
321
344
 
322
345
  // src/components/form/messages.tsx
323
- var import_jsx_runtime10 = require("react/jsx-runtime");
346
+ var import_jsx_runtime11 = require("react/jsx-runtime");
324
347
 
325
348
  // src/components/form/social.tsx
326
- var import_client_fetch19 = require("@ory/client-fetch");
349
+ var import_client_fetch20 = require("@ory/client-fetch");
327
350
  var import_react_hook_form5 = require("react-hook-form");
328
351
 
329
352
  // src/components/form/form-provider.tsx
330
- var import_client_fetch18 = require("@ory/client-fetch");
353
+ var import_client_fetch19 = require("@ory/client-fetch");
331
354
  var import_react_hook_form4 = require("react-hook-form");
332
355
 
333
356
  // src/components/form/form-resolver.ts
334
- var import_client_fetch17 = require("@ory/client-fetch");
357
+ var import_client_fetch18 = require("@ory/client-fetch");
335
358
 
336
359
  // src/components/form/form-provider.tsx
337
- var import_jsx_runtime11 = require("react/jsx-runtime");
360
+ var import_jsx_runtime12 = require("react/jsx-runtime");
338
361
 
339
362
  // src/components/form/social.tsx
340
- var import_jsx_runtime12 = require("react/jsx-runtime");
363
+ var import_jsx_runtime13 = require("react/jsx-runtime");
341
364
 
342
365
  // src/components/form/section.tsx
343
366
  var import_react_hook_form6 = require("react-hook-form");
344
- var import_jsx_runtime13 = require("react/jsx-runtime");
367
+ var import_jsx_runtime14 = require("react/jsx-runtime");
345
368
 
346
369
  // src/components/generic/divider.tsx
347
- var import_client_fetch20 = require("@ory/client-fetch");
348
- var import_jsx_runtime14 = require("react/jsx-runtime");
370
+ var import_client_fetch21 = require("@ory/client-fetch");
371
+ var import_jsx_runtime15 = require("react/jsx-runtime");
349
372
 
350
373
  // src/components/generic/page-header.tsx
351
- var import_jsx_runtime15 = require("react/jsx-runtime");
374
+ var import_jsx_runtime16 = require("react/jsx-runtime");
352
375
 
353
376
  // src/components/settings/settings-card.tsx
354
- var import_client_fetch21 = require("@ory/client-fetch");
377
+ var import_client_fetch22 = require("@ory/client-fetch");
355
378
  var import_react_intl7 = require("react-intl");
356
379
 
357
380
  // src/components/settings/oidc-settings.tsx
358
381
  var import_react_intl2 = require("react-intl");
359
382
  var import_react_hook_form7 = require("react-hook-form");
360
- var import_jsx_runtime16 = require("react/jsx-runtime");
383
+ var import_jsx_runtime17 = require("react/jsx-runtime");
361
384
 
362
385
  // src/components/settings/passkey-settings.tsx
363
386
  var import_react_hook_form8 = require("react-hook-form");
364
387
  var import_react_intl3 = require("react-intl");
365
- var import_jsx_runtime17 = require("react/jsx-runtime");
388
+ var import_jsx_runtime18 = require("react/jsx-runtime");
366
389
 
367
390
  // src/components/settings/recovery-codes-settings.tsx
368
391
  var import_react_intl4 = require("react-intl");
369
392
  var import_react_hook_form9 = require("react-hook-form");
370
- var import_jsx_runtime18 = require("react/jsx-runtime");
393
+ var import_jsx_runtime19 = require("react/jsx-runtime");
371
394
 
372
395
  // src/components/settings/totp-settings.tsx
373
396
  var import_react_hook_form10 = require("react-hook-form");
374
397
  var import_react_intl5 = require("react-intl");
375
- var import_jsx_runtime19 = require("react/jsx-runtime");
398
+ var import_jsx_runtime20 = require("react/jsx-runtime");
376
399
 
377
400
  // src/components/settings/webauthn-settings.tsx
378
401
  var import_react_hook_form11 = require("react-hook-form");
379
402
  var import_react_intl6 = require("react-intl");
380
- var import_jsx_runtime20 = require("react/jsx-runtime");
403
+ var import_jsx_runtime21 = require("react/jsx-runtime");
381
404
 
382
405
  // src/components/settings/settings-card.tsx
383
- var import_jsx_runtime21 = require("react/jsx-runtime");
406
+ var import_jsx_runtime22 = require("react/jsx-runtime");
384
407
 
385
408
  // src/util/i18n/index.ts
386
409
  var uiTextToFormattedMessage = ({ id, context = {}, text }, intl) => {
@@ -672,9 +695,11 @@ var en_default = {
672
695
  "card.header.parts.oidc": "a social provider",
673
696
  "card.header.parts.password.registration": "your {identifierLabel} and a password",
674
697
  "card.header.parts.password.login": "your {identifierLabel} and password",
675
- "card.header.parts.code": "a code sent to your email",
698
+ "card.header.parts.code": "a code sent to you",
676
699
  "card.header.parts.passkey": "a Passkey",
677
700
  "card.header.parts.webauthn": "a security key",
701
+ "card.header.parts.totp": "your authenticator app",
702
+ "card.header.parts.lookup_secret": "a backup recovery code",
678
703
  "card.header.parts.identifier-first": "your {identifierLabel}",
679
704
  "card.header.description.login": "Sign in with {identifierLabel}",
680
705
  "card.header.description.registration": "Sign up with {identifierLabel}",
@@ -922,13 +947,15 @@ var de_default = {
922
947
  "identities.messages.4010009": "Die Authentifizierungsmethode stimmt nicht mit der vorherigen Authentifizierungsmethode \xFCberein. Bitte versuchen Sie es erneut.",
923
948
  "identities.messages.4010010": "Die eingegebene Adresse stimmt nicht mit der Adresse \xFCberein, die Sie bei der Registrierung angegeben haben. Bitte versuchen Sie es erneut.",
924
949
  "input.placeholder": "{placeholder} eingeben",
925
- "card.header.parts.code": "einem Code per E-Mail",
950
+ "card.header.parts.code": "ein an Sie gesendeter Code",
926
951
  "card.header.parts.identifier-first": "Ihr {identifierLabel}",
927
952
  "card.header.parts.oidc": "ein sozialer Anbieter",
928
953
  "card.header.parts.passkey": "ein Passkey",
929
954
  "card.header.parts.password.login": "Ihrer {identifierLabel} und Ihrem Passwort",
930
955
  "card.header.parts.password.registration": "Ihrer {identifierLabel} und einem Passwort",
931
956
  "card.header.parts.webauthn": "ein Sicherheitsschl\xFCssel",
957
+ "card.header.parts.totp": "deine Authentifikator-App",
958
+ "card.header.parts.lookup_secret": "ein Backup-Wiederherstellungscode",
932
959
  "recovery.subtitle": "Geben Sie die mit Ihrem Konto verkn\xFCpfte E-Mail-Adresse ein, um einen einmaligen Zugangscode zu erhalten",
933
960
  "verification.subtitle": "Geben Sie die mit Ihrem Konto verkn\xFCpfte E-Mail-Adresse ein, um es zu best\xE4tigen",
934
961
  "card.header.description.login": "Melden Sie sich mit {identifierLabel} an",
@@ -1267,6 +1294,8 @@ var es_default = {
1267
1294
  "card.header.parts.code": "un c\xF3digo enviado a tu correo electr\xF3nico",
1268
1295
  "card.header.parts.passkey": "una clave de acceso",
1269
1296
  "card.header.parts.webauthn": "una clave de seguridad",
1297
+ "card.header.parts.totp": "su aplicaci\xF3n de autenticaci\xF3n",
1298
+ "card.header.parts.lookup_secret": "un c\xF3digo de recuperaci\xF3n de copia de seguridad",
1270
1299
  "card.header.parts.identifier-first": "tu {identifierLabel}",
1271
1300
  "card.header.description.login": "Iniciar sesi\xF3n con {identifierLabel}",
1272
1301
  "card.header.description.registration": "Registrarse con {identifierLabel}",
@@ -1544,10 +1573,12 @@ var fr_default = {
1544
1573
  "card.header.parts.oidc": "un fournisseur de r\xE9seaux sociaux",
1545
1574
  "card.header.parts.password.registration": "votre {identifierLabel} et un mot de passe",
1546
1575
  "card.header.parts.password.login": "votre {identifierLabel} et votre mot de passe",
1547
- "card.header.parts.code": "un code envoy\xE9 \xE0 votre adresse e-mail",
1548
1576
  "card.header.parts.passkey": "une cl\xE9 d'acc\xE8s",
1549
1577
  "card.header.parts.webauthn": "une cl\xE9 de s\xE9curit\xE9",
1550
1578
  "card.header.parts.identifier-first": "votre {identifierLabel}",
1579
+ "card.header.parts.code": "un code qui vous a \xE9t\xE9 envoy\xE9",
1580
+ "card.header.parts.totp": "votre application d'authentification",
1581
+ "card.header.parts.lookup_secret": "un code de r\xE9cup\xE9ration de secours",
1551
1582
  "card.header.description.login": "Se connecter avec {identifierLabel}",
1552
1583
  "card.header.description.registration": "S'inscrire avec {identifierLabel}",
1553
1584
  "misc.or": "ou",
@@ -1790,7 +1821,9 @@ var nl_default = {
1790
1821
  "input.placeholder": "",
1791
1822
  "card.header.description.login": "",
1792
1823
  "card.header.description.registration": "",
1793
- "card.header.parts.code": "",
1824
+ "card.header.parts.code": "een code die naar je is verzonden",
1825
+ "card.header.parts.totp": "je authenticator-app",
1826
+ "card.header.parts.lookup_secret": "een backup herstelcode",
1794
1827
  "card.header.parts.identifier-first": "",
1795
1828
  "card.header.parts.oidc": "",
1796
1829
  "card.header.parts.passkey": "",
@@ -2075,13 +2108,15 @@ var pl_default = {
2075
2108
  "input.placeholder": "",
2076
2109
  "card.header.description.login": "",
2077
2110
  "card.header.description.registration": "",
2078
- "card.header.parts.code": "",
2079
2111
  "card.header.parts.identifier-first": "",
2080
2112
  "card.header.parts.oidc": "",
2081
2113
  "card.header.parts.passkey": "",
2082
2114
  "card.header.parts.password.login": "",
2083
2115
  "card.header.parts.password.registration": "",
2084
2116
  "card.header.parts.webauthn": "",
2117
+ "card.header.parts.code": "kod wys\u0142any do Ciebie",
2118
+ "card.header.parts.totp": "Twoja aplikacja uwierzytelniaj\u0105ca",
2119
+ "card.header.parts.lookup_secret": "kod odzyskiwania kopii zapasowej",
2085
2120
  "forms.label.forgot-password": "",
2086
2121
  "login.subtitle": "",
2087
2122
  "login.subtitle-refresh": "",
@@ -2360,7 +2395,9 @@ var pt_default = {
2360
2395
  "input.placeholder": "",
2361
2396
  "card.header.description.login": "",
2362
2397
  "card.header.description.registration": "",
2363
- "card.header.parts.code": "",
2398
+ "card.header.parts.code": "um c\xF3digo enviado para voc\xEA",
2399
+ "card.header.parts.totp": "seu aplicativo autenticador",
2400
+ "card.header.parts.lookup_secret": "um c\xF3digo de recupera\xE7\xE3o de backup",
2364
2401
  "card.header.parts.identifier-first": "",
2365
2402
  "card.header.parts.oidc": "",
2366
2403
  "card.header.parts.passkey": "",
@@ -2645,7 +2682,9 @@ var sv_default = {
2645
2682
  "input.placeholder": "Ange din {placeholder}",
2646
2683
  "card.header.description.login": "Logga in med {identifierLabel}",
2647
2684
  "card.header.description.registration": "Registrera dig med {identifierLabel}",
2648
- "card.header.parts.code": "en kod skickad till din e-post",
2685
+ "card.header.parts.code": "en kod skickad till dig",
2686
+ "card.header.parts.totp": "din autentiseringsapp",
2687
+ "card.header.parts.lookup_secret": "en s\xE4kerhetskopieringskod",
2649
2688
  "card.header.parts.identifier-first": "din {identifierLabel}",
2650
2689
  "card.header.parts.oidc": "en social leverant\xF6r",
2651
2690
  "card.header.parts.passkey": "en Passkey",
@@ -2731,7 +2770,7 @@ var OryLocales = {
2731
2770
  };
2732
2771
 
2733
2772
  // src/context/intl-context.tsx
2734
- var import_jsx_runtime22 = require("react/jsx-runtime");
2773
+ var import_jsx_runtime23 = require("react/jsx-runtime");
2735
2774
  function mergeTranslations(customTranslations) {
2736
2775
  return Object.keys(customTranslations).reduce((acc, key) => {
2737
2776
  acc[key] = { ...OryLocales[key], ...customTranslations[key] };
@@ -2744,12 +2783,12 @@ var IntlProvider = ({
2744
2783
  customTranslations
2745
2784
  }) => {
2746
2785
  const messages = mergeTranslations(customTranslations != null ? customTranslations : {});
2747
- return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
2786
+ return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
2748
2787
  import_react_intl8.IntlProvider,
2749
2788
  {
2750
2789
  onWarn: () => ({}),
2751
2790
  defaultRichTextElements: {
2752
- del: (chunks) => /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("del", { children: chunks })
2791
+ del: (chunks) => /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("del", { children: chunks })
2753
2792
  },
2754
2793
  locale,
2755
2794
  messages: messages[locale],
@@ -2760,34 +2799,35 @@ var IntlProvider = ({
2760
2799
  };
2761
2800
 
2762
2801
  // src/context/provider.tsx
2763
- var import_jsx_runtime23 = require("react/jsx-runtime");
2764
-
2765
- // src/components/card/header.tsx
2766
2802
  var import_jsx_runtime24 = require("react/jsx-runtime");
2767
2803
 
2768
- // src/components/card/card.tsx
2804
+ // src/components/card/header.tsx
2769
2805
  var import_jsx_runtime25 = require("react/jsx-runtime");
2770
2806
 
2771
- // src/components/card/footer.tsx
2807
+ // src/components/card/card.tsx
2772
2808
  var import_jsx_runtime26 = require("react/jsx-runtime");
2773
2809
 
2774
- // src/components/card/content.tsx
2810
+ // src/components/card/footer.tsx
2775
2811
  var import_jsx_runtime27 = require("react/jsx-runtime");
2776
2812
 
2777
- // src/components/card/two-step/state-method-active.tsx
2778
- var import_client_fetch22 = require("@ory/client-fetch");
2813
+ // src/components/card/content.tsx
2779
2814
  var import_jsx_runtime28 = require("react/jsx-runtime");
2780
2815
 
2781
- // src/components/card/two-step/state-provide-identifier.tsx
2816
+ // src/components/card/two-step/state-method-active.tsx
2782
2817
  var import_client_fetch23 = require("@ory/client-fetch");
2783
2818
  var import_jsx_runtime29 = require("react/jsx-runtime");
2784
2819
 
2820
+ // src/components/card/two-step/state-provide-identifier.tsx
2821
+ var import_client_fetch24 = require("@ory/client-fetch");
2822
+ var import_jsx_runtime30 = require("react/jsx-runtime");
2823
+
2785
2824
  // src/components/card/card-two-step.tsx
2786
2825
  var import_elements_react = require("@ory/elements-react");
2787
- var import_jsx_runtime30 = require("react/jsx-runtime");
2826
+ var import_jsx_runtime31 = require("react/jsx-runtime");
2788
2827
 
2789
2828
  // src/components/card/card-consent.tsx
2790
- var import_jsx_runtime31 = require("react/jsx-runtime");
2829
+ var import_client_fetch25 = require("@ory/client-fetch");
2830
+ var import_jsx_runtime32 = require("react/jsx-runtime");
2791
2831
 
2792
2832
  // src/components/card/two-step/state-select-method.tsx
2793
2833
  var import_react_intl9 = require("react-intl");
@@ -2795,124 +2835,200 @@ var import_react_intl9 = require("react-intl");
2795
2835
  // src/components/card/two-step/list-methods.tsx
2796
2836
  var import_elements_react2 = require("@ory/elements-react");
2797
2837
  var import_react_hook_form12 = require("react-hook-form");
2798
- var import_jsx_runtime32 = require("react/jsx-runtime");
2838
+ var import_jsx_runtime33 = require("react/jsx-runtime");
2799
2839
 
2800
2840
  // src/components/card/two-step/state-select-method.tsx
2801
- var import_jsx_runtime33 = require("react/jsx-runtime");
2841
+ var import_jsx_runtime34 = require("react/jsx-runtime");
2802
2842
  function toAuthMethodPickerOptions(visibleGroups) {
2803
2843
  return Object.fromEntries(
2804
- Object.values(import_client_fetch24.UiNodeGroupEnum).filter((group) => {
2844
+ Object.values(import_client_fetch26.UiNodeGroupEnum).filter((group) => {
2805
2845
  var _a;
2806
2846
  return (_a = visibleGroups[group]) == null ? void 0 : _a.length;
2807
2847
  }).filter(
2808
2848
  (group) => ![
2809
- import_client_fetch24.UiNodeGroupEnum.Oidc,
2810
- import_client_fetch24.UiNodeGroupEnum.Saml,
2811
- import_client_fetch24.UiNodeGroupEnum.Default,
2812
- import_client_fetch24.UiNodeGroupEnum.IdentifierFirst,
2813
- import_client_fetch24.UiNodeGroupEnum.Profile,
2814
- import_client_fetch24.UiNodeGroupEnum.Captcha
2849
+ import_client_fetch26.UiNodeGroupEnum.Oidc,
2850
+ import_client_fetch26.UiNodeGroupEnum.Saml,
2851
+ import_client_fetch26.UiNodeGroupEnum.Default,
2852
+ import_client_fetch26.UiNodeGroupEnum.IdentifierFirst,
2853
+ import_client_fetch26.UiNodeGroupEnum.Profile,
2854
+ import_client_fetch26.UiNodeGroupEnum.Captcha
2815
2855
  ].includes(group)
2816
2856
  ).map((g) => [g, {}])
2817
2857
  );
2818
2858
  }
2819
2859
 
2820
- // src/theme/default/components/card/footer.tsx
2821
- var import_jsx_runtime34 = require("react/jsx-runtime");
2822
- function DefaultCardFooter() {
2823
- const oryFlow = (0, import_elements_react3.useOryFlow)();
2824
- switch (oryFlow.flowType) {
2825
- case import_client_fetch25.FlowType.Login:
2826
- return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(LoginCardFooter, {});
2827
- case import_client_fetch25.FlowType.Registration:
2828
- return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(RegistrationCardFooter, {});
2829
- case import_client_fetch25.FlowType.Recovery:
2830
- return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(RecoveryCardFooter, {});
2831
- case import_client_fetch25.FlowType.Verification:
2832
- return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(VerificationCardFooter, {});
2833
- case import_client_fetch25.FlowType.OAuth2Consent:
2834
- return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(ConsentCardFooter, { flow: oryFlow.flow });
2835
- default:
2836
- return null;
2837
- }
2860
+ // src/util/nodes.ts
2861
+ function findScreenSelectionButton(nodes) {
2862
+ return nodes.find(
2863
+ (node) => node.attributes.node_type === "input" && node.attributes.type === "submit" && node.attributes.name === "screen"
2864
+ );
2838
2865
  }
2839
- function LoginCardFooter() {
2840
- const { config, formState, flow, flowType } = (0, import_elements_react3.useOryFlow)();
2841
- const intl = (0, import_react_intl10.useIntl)();
2842
- const authMethods = nodesToAuthMethodGroups(flow.ui.nodes);
2843
- if (flowType === import_client_fetch25.FlowType.Login && flow.refresh) {
2844
- return null;
2845
- }
2846
- return /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(import_jsx_runtime34.Fragment, { children: [
2847
- formState.current === "provide_identifier" && config.project.registration_enabled && /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("span", { className: "font-normal leading-normal antialiased text-interface-foreground-default-primary", children: [
2848
- intl.formatMessage({
2849
- id: "login.registration-label",
2850
- defaultMessage: "No account?"
2851
- }),
2852
- " ",
2853
- /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
2854
- "a",
2855
- {
2856
- className: "text-button-link-brand-brand transition-colors hover:text-button-link-brand-brand-hover underline",
2857
- href: initFlowUrl(config.sdk.url, "registration", flow),
2858
- "data-testid": "ory/screen/login/action/register",
2859
- children: intl.formatMessage({
2860
- id: "login.registration-button",
2861
- defaultMessage: "Sign up"
2862
- })
2866
+
2867
+ // src/theme/default/utils/logout.ts
2868
+ var import_react7 = require("react");
2869
+ function useClientLogout(config) {
2870
+ const [logoutFlow, setLogoutFlow] = (0, import_react7.useState)();
2871
+ const [isLoading, setIsLoading] = (0, import_react7.useState)(true);
2872
+ const fetchLogoutFlow = (0, import_react7.useCallback)(async () => {
2873
+ try {
2874
+ const flow = await frontendClient(config.sdk.url).createBrowserLogoutFlow().catch((err) => {
2875
+ var _a;
2876
+ if (((_a = err.response) == null ? void 0 : _a.status) !== 401) {
2877
+ throw err;
2863
2878
  }
2864
- )
2865
- ] }),
2866
- authMethods.length > 1 && formState.current === "method_active" && /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("span", { className: "font-normal leading-normal antialiased text-interface-foreground-default-primary", children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
2867
- "a",
2868
- {
2869
- className: "text-button-link-brand-brand transition-colors hover:text-button-link-brand-brand-hover underline",
2870
- href: "",
2871
- "data-testid": "ory/screen/login/mfa/action/selectMethod",
2872
- children: intl.formatMessage({
2873
- id: "login.2fa.method.go-back"
2874
- })
2875
- }
2876
- ) }),
2877
- authMethods.length === 1 && authMethods[0] === "code" && formState.current === "method_active" && /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("span", { className: "font-normal leading-normal antialiased text-interface-foreground-default-primary", children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
2878
- "a",
2879
- {
2880
- className: "text-button-link-brand-brand transition-colors hover:text-button-link-brand-brand-hover underline",
2881
- href: restartFlowUrl(
2882
- flow,
2883
- `${config.sdk.url}/self-service/${flowType}/browser`
2884
- ),
2885
- "data-testid": "ory/screen/login/mfa/action/reauthenticate",
2886
- children: intl.formatMessage({
2887
- id: "login.2fa.go-back.link"
2888
- })
2889
- }
2890
- ) }),
2891
- flowType === import_client_fetch25.FlowType.Login && flow.requested_aal === "aal2" && (formState.current === "select_method" || authMethods.length === 0) && /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("span", { className: "font-normal leading-normal antialiased text-interface-foreground-default-primary", children: [
2879
+ return void 0;
2880
+ });
2881
+ setLogoutFlow(flow);
2882
+ } finally {
2883
+ setIsLoading(false);
2884
+ }
2885
+ }, [config.sdk.url]);
2886
+ (0, import_react7.useEffect)(() => {
2887
+ void fetchLogoutFlow();
2888
+ }, [fetchLogoutFlow]);
2889
+ return { logoutFlow, didLoad: !isLoading };
2890
+ }
2891
+
2892
+ // src/theme/default/utils/url.ts
2893
+ function restartFlowUrl(flow, fallback) {
2894
+ return flow.request_url || appendReturnTo(fallback, flow.return_to);
2895
+ }
2896
+ function initFlowUrl(sdkUrl, flowType, flow) {
2897
+ const result = `${sdkUrl}/self-service/${flowType}/browser`;
2898
+ const qs = new URLSearchParams();
2899
+ if (flow.oauth2_login_challenge) {
2900
+ qs.set("login_challenge", flow.oauth2_login_challenge);
2901
+ }
2902
+ if (flow.return_to) {
2903
+ qs.set("return_to", flow.return_to);
2904
+ } else if (typeof window !== "undefined") {
2905
+ const searchParams = new URLSearchParams(window.location.search);
2906
+ if (searchParams.has("return_to")) {
2907
+ qs.set("return_to", searchParams.get("return_to") || "");
2908
+ }
2909
+ }
2910
+ if (qs.toString().length === 0) {
2911
+ return result;
2912
+ }
2913
+ return result + "?" + qs.toString();
2914
+ }
2915
+ function appendReturnTo(url, returnTo) {
2916
+ if (!returnTo) {
2917
+ return url;
2918
+ }
2919
+ const urlObj = new URL(url);
2920
+ urlObj.searchParams.set("return_to", returnTo);
2921
+ return urlObj.toString();
2922
+ }
2923
+
2924
+ // src/theme/default/components/card/footer.tsx
2925
+ var import_jsx_runtime35 = require("react/jsx-runtime");
2926
+ function DefaultCardFooter() {
2927
+ const oryFlow = (0, import_elements_react3.useOryFlow)();
2928
+ switch (oryFlow.flowType) {
2929
+ case import_client_fetch27.FlowType.Login:
2930
+ return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(LoginCardFooter, {});
2931
+ case import_client_fetch27.FlowType.Registration:
2932
+ return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(RegistrationCardFooter, {});
2933
+ case import_client_fetch27.FlowType.Recovery:
2934
+ return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(RecoveryCardFooter, {});
2935
+ case import_client_fetch27.FlowType.Verification:
2936
+ return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(VerificationCardFooter, {});
2937
+ case import_client_fetch27.FlowType.OAuth2Consent:
2938
+ return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(ConsentCardFooter, { flow: oryFlow.flow });
2939
+ default:
2940
+ return null;
2941
+ }
2942
+ }
2943
+ function LoginCardFooter() {
2944
+ const { formState, flow, flowType } = (0, import_elements_react3.useOryFlow)();
2945
+ const config = (0, import_elements_react3.useOryConfiguration)();
2946
+ const { logoutFlow: logout, didLoad: didLoadLogout } = useClientLogout(config);
2947
+ const intl = (0, import_react_intl10.useIntl)();
2948
+ if (flowType !== import_client_fetch27.FlowType.Login) {
2949
+ return null;
2950
+ }
2951
+ const authMethods = nodesToAuthMethodGroups(flow.ui.nodes);
2952
+ let returnTo = config.project.default_redirect_url;
2953
+ if (flow.return_to) {
2954
+ returnTo = flow.return_to;
2955
+ }
2956
+ if (!returnTo) {
2957
+ returnTo = restartFlowUrl(
2958
+ flow,
2959
+ `${config.sdk.url}/self-service/${flowType}/browser`
2960
+ );
2961
+ }
2962
+ if (flow.refresh || flow.requested_aal === "aal2") {
2963
+ return /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("span", { className: "font-normal leading-normal antialiased text-interface-foreground-default-primary", children: [
2892
2964
  intl.formatMessage({
2893
2965
  id: "login.2fa.go-back"
2894
2966
  }),
2895
2967
  " ",
2896
- /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
2968
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
2897
2969
  "a",
2898
2970
  {
2899
2971
  className: "text-button-link-brand-brand transition-colors hover:text-button-link-brand-brand-hover underline",
2900
- href: restartFlowUrl(
2901
- flow,
2902
- `${config.sdk.url}/self-service/${flowType}/browser`
2972
+ href: logout ? logout == null ? void 0 : logout.logout_url : returnTo,
2973
+ "data-testid": (
2974
+ // Only add the test-id when the logout link has loaded.
2975
+ didLoadLogout ? "ory/screen/login/action/logout" : void 0
2903
2976
  ),
2904
- "data-testid": "ory/screen/login/mfa/action/reauthenticate",
2905
2977
  children: intl.formatMessage({
2906
- id: "login.2fa.go-back.link"
2978
+ id: !didLoadLogout || logout ? "login.logout-button" : "login.2fa.go-back.link"
2907
2979
  })
2908
2980
  }
2909
2981
  )
2910
- ] })
2982
+ ] });
2983
+ }
2984
+ return /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(import_jsx_runtime35.Fragment, { children: [
2985
+ formState.current === "provide_identifier" && config.project.registration_enabled && /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("span", { className: "font-normal leading-normal antialiased text-interface-foreground-default-primary", children: [
2986
+ intl.formatMessage({
2987
+ id: "login.registration-label",
2988
+ defaultMessage: "No account?"
2989
+ }),
2990
+ " ",
2991
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
2992
+ "a",
2993
+ {
2994
+ className: "text-button-link-brand-brand transition-colors hover:text-button-link-brand-brand-hover underline",
2995
+ href: initFlowUrl(config.sdk.url, "registration", flow),
2996
+ "data-testid": "ory/screen/login/action/register",
2997
+ children: intl.formatMessage({
2998
+ id: "login.registration-button",
2999
+ defaultMessage: "Sign up"
3000
+ })
3001
+ }
3002
+ )
3003
+ ] }),
3004
+ authMethods.length > 1 && formState.current === "method_active" && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("span", { className: "font-normal leading-normal antialiased text-interface-foreground-default-primary", children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
3005
+ "a",
3006
+ {
3007
+ className: "text-button-link-brand-brand transition-colors hover:text-button-link-brand-brand-hover underline",
3008
+ href: "",
3009
+ "data-testid": "ory/screen/login/mfa/action/selectMethod",
3010
+ children: intl.formatMessage({
3011
+ id: "login.2fa.method.go-back"
3012
+ })
3013
+ }
3014
+ ) }),
3015
+ authMethods.length === 1 && authMethods[0] === "code" && formState.current === "method_active" && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("span", { className: "font-normal leading-normal antialiased text-interface-foreground-default-primary", children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
3016
+ "a",
3017
+ {
3018
+ className: "text-button-link-brand-brand transition-colors hover:text-button-link-brand-brand-hover underline",
3019
+ href: returnTo,
3020
+ "data-testid": "ory/screen/login/action/cancel",
3021
+ children: intl.formatMessage({
3022
+ id: "login.2fa.go-back.link"
3023
+ })
3024
+ }
3025
+ ) })
2911
3026
  ] });
2912
3027
  }
2913
3028
  function RegistrationCardFooter() {
2914
3029
  const intl = (0, import_react_intl10.useIntl)();
2915
- const { config, flow, formState } = (0, import_elements_react3.useOryFlow)();
3030
+ const { flow, formState } = (0, import_elements_react3.useOryFlow)();
3031
+ const config = (0, import_elements_react3.useOryConfiguration)();
2916
3032
  const visibleGroups = useNodeGroupsWithVisibleNodes(flow.ui.nodes);
2917
3033
  const authMethodBlocks = toAuthMethodPickerOptions(visibleGroups);
2918
3034
  const screenSelectionNode = findScreenSelectionButton(flow.ui.nodes);
@@ -2921,11 +3037,12 @@ function RegistrationCardFooter() {
2921
3037
  if (!screenSelectionNode || Object.entries(authMethodBlocks).length < 2) {
2922
3038
  return null;
2923
3039
  }
2924
- return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("span", { className: "font-normal leading-normal antialiased", children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
3040
+ return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("span", { className: "font-normal leading-normal antialiased", children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
2925
3041
  "a",
2926
3042
  {
2927
3043
  className: "font-medium text-button-link-brand-brand hover:text-button-link-brand-brand-hover",
2928
3044
  href: "",
3045
+ "data-testid": "ory/screen/registration/action/selectMethod",
2929
3046
  children: intl.formatMessage({
2930
3047
  id: "card.footer.select-another-method",
2931
3048
  defaultMessage: "Select another method"
@@ -2934,13 +3051,13 @@ function RegistrationCardFooter() {
2934
3051
  ) });
2935
3052
  case "select_method":
2936
3053
  default:
2937
- return /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("span", { className: "font-normal leading-normal antialiased text-interface-foreground-default-primary", children: [
3054
+ return /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("span", { className: "font-normal leading-normal antialiased text-interface-foreground-default-primary", children: [
2938
3055
  intl.formatMessage({
2939
3056
  id: "registration.login-label",
2940
3057
  defaultMessage: "Already have an account?"
2941
3058
  }),
2942
3059
  " ",
2943
- /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
3060
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
2944
3061
  "a",
2945
3062
  {
2946
3063
  className: "text-button-link-brand-brand transition-colors hover:text-button-link-brand-brand-hover underline",
@@ -2969,26 +3086,26 @@ function ConsentCardFooter({ flow }) {
2969
3086
  node_type: "input",
2970
3087
  name: "remember"
2971
3088
  });
2972
- return /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: "flex gap-8 flex-col", children: [
2973
- /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { children: [
2974
- /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("p", { className: "text-interface-foreground-default-secondary leading-normal font-medium", children: [
3089
+ return /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { className: "flex gap-8 flex-col", children: [
3090
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { children: [
3091
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("p", { className: "text-interface-foreground-default-secondary leading-normal font-medium", children: [
2975
3092
  "Make sure you trust ",
2976
3093
  (_a = flow.consent_request.client) == null ? void 0 : _a.client_name
2977
3094
  ] }),
2978
- /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("p", { className: "text-interface-foreground-default-secondary leading-normal", children: "You may be sharing sensitive information with this site or application." })
3095
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("p", { className: "text-interface-foreground-default-secondary leading-normal", children: "You may be sharing sensitive information with this site or application." })
2979
3096
  ] }),
2980
- rememberNode && /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
3097
+ rememberNode && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
2981
3098
  Node2.Checkbox,
2982
3099
  {
2983
3100
  attributes: rememberNode.attributes,
2984
3101
  node: rememberNode
2985
3102
  }
2986
3103
  ),
2987
- /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-2", children: flow.ui.nodes.filter(
3104
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-2", children: flow.ui.nodes.filter(
2988
3105
  (n) => n.attributes.node_type === "input" && n.attributes.type === "submit"
2989
3106
  ).map((n) => {
2990
3107
  const attributes = n.attributes;
2991
- return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
3108
+ return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
2992
3109
  Node2.Button,
2993
3110
  {
2994
3111
  node: n,
@@ -2997,8 +3114,8 @@ function ConsentCardFooter({ flow }) {
2997
3114
  attributes.value
2998
3115
  );
2999
3116
  }) }),
3000
- /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("p", { className: "text-sm", children: [
3001
- /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("span", { className: "text-interface-foreground-default-tertiary", children: [
3117
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("p", { className: "text-sm", children: [
3118
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("span", { className: "text-interface-foreground-default-tertiary", children: [
3002
3119
  "Authorizing will redirect to",
3003
3120
  " "
3004
3121
  ] }),
@@ -3011,7 +3128,7 @@ function ConsentCardFooter({ flow }) {
3011
3128
  var import_elements_react5 = require("@ory/elements-react");
3012
3129
 
3013
3130
  // src/theme/default/utils/constructCardHeader.ts
3014
- var import_client_fetch26 = require("@ory/client-fetch");
3131
+ var import_client_fetch28 = require("@ory/client-fetch");
3015
3132
  var import_react_intl11 = require("react-intl");
3016
3133
  function joinWithCommaOr(list, orText = "or") {
3017
3134
  if (list.length === 0) {
@@ -3028,7 +3145,7 @@ function useCardHeaderText(container, opts) {
3028
3145
  const nodes = container.nodes;
3029
3146
  const intl = (0, import_react_intl11.useIntl)();
3030
3147
  switch (opts.flowType) {
3031
- case import_client_fetch26.FlowType.Recovery:
3148
+ case import_client_fetch28.FlowType.Recovery:
3032
3149
  if (nodes.find(
3033
3150
  (node) => "name" in node.attributes && node.attributes.name === "code"
3034
3151
  )) {
@@ -3038,7 +3155,8 @@ function useCardHeaderText(container, opts) {
3038
3155
  }),
3039
3156
  description: intl.formatMessage({
3040
3157
  id: "identities.messages.1060003"
3041
- })
3158
+ }),
3159
+ messageId: "1060003"
3042
3160
  };
3043
3161
  }
3044
3162
  return {
@@ -3049,7 +3167,7 @@ function useCardHeaderText(container, opts) {
3049
3167
  id: "recovery.subtitle"
3050
3168
  })
3051
3169
  };
3052
- case import_client_fetch26.FlowType.Settings:
3170
+ case import_client_fetch28.FlowType.Settings:
3053
3171
  return {
3054
3172
  title: intl.formatMessage({
3055
3173
  id: "settings.title"
@@ -3058,7 +3176,7 @@ function useCardHeaderText(container, opts) {
3058
3176
  id: "settings.subtitle"
3059
3177
  })
3060
3178
  };
3061
- case import_client_fetch26.FlowType.Verification:
3179
+ case import_client_fetch28.FlowType.Verification:
3062
3180
  if (nodes.find(
3063
3181
  (node) => "name" in node.attributes && node.attributes.name === "code"
3064
3182
  )) {
@@ -3068,7 +3186,8 @@ function useCardHeaderText(container, opts) {
3068
3186
  }),
3069
3187
  description: intl.formatMessage({
3070
3188
  id: "identities.messages.1080003"
3071
- })
3189
+ }),
3190
+ messageId: "1080003"
3072
3191
  };
3073
3192
  }
3074
3193
  return {
@@ -3079,7 +3198,7 @@ function useCardHeaderText(container, opts) {
3079
3198
  id: "verification.subtitle"
3080
3199
  })
3081
3200
  };
3082
- case import_client_fetch26.FlowType.Login: {
3201
+ case import_client_fetch28.FlowType.Login: {
3083
3202
  const accountLinkingMessage = (_a = container.messages) == null ? void 0 : _a.find(
3084
3203
  (m) => m.id === 1010016
3085
3204
  );
@@ -3093,7 +3212,8 @@ function useCardHeaderText(container, opts) {
3093
3212
  id: "identities.messages.1010016"
3094
3213
  },
3095
3214
  accountLinkingMessage.context
3096
- )
3215
+ ),
3216
+ messageId: "1010016"
3097
3217
  };
3098
3218
  }
3099
3219
  }
@@ -3101,7 +3221,7 @@ function useCardHeaderText(container, opts) {
3101
3221
  const parts = [];
3102
3222
  if (nodes.find((node) => node.group === "password")) {
3103
3223
  switch (opts.flowType) {
3104
- case import_client_fetch26.FlowType.Registration:
3224
+ case import_client_fetch28.FlowType.Registration:
3105
3225
  parts.push(
3106
3226
  intl.formatMessage(
3107
3227
  { id: "card.header.parts.password.registration" },
@@ -3130,6 +3250,12 @@ function useCardHeaderText(container, opts) {
3130
3250
  if (nodes.find((node) => node.group === "code")) {
3131
3251
  parts.push(intl.formatMessage({ id: "card.header.parts.code" }));
3132
3252
  }
3253
+ if (nodes.find((node) => node.group === "totp")) {
3254
+ parts.push(intl.formatMessage({ id: "card.header.parts.totp" }));
3255
+ }
3256
+ if (nodes.find((node) => node.group === "lookup_secret")) {
3257
+ parts.push(intl.formatMessage({ id: "card.header.parts.lookup_secret" }));
3258
+ }
3133
3259
  if (nodes.find((node) => node.group === "passkey")) {
3134
3260
  parts.push(intl.formatMessage({ id: "card.header.parts.passkey" }));
3135
3261
  }
@@ -3138,7 +3264,7 @@ function useCardHeaderText(container, opts) {
3138
3264
  }
3139
3265
  if (nodes.find((node) => node.group === "identifier_first")) {
3140
3266
  const identifier = nodes.find(
3141
- (node) => (0, import_client_fetch26.isUiNodeInputAttributes)(node.attributes) && node.attributes.name.startsWith("identifier") && node.attributes.type !== "hidden"
3267
+ (node) => (0, import_client_fetch28.isUiNodeInputAttributes)(node.attributes) && node.attributes.name.startsWith("identifier") && node.attributes.type !== "hidden"
3142
3268
  );
3143
3269
  if (identifier) {
3144
3270
  parts.push(
@@ -3154,7 +3280,7 @@ function useCardHeaderText(container, opts) {
3154
3280
  }
3155
3281
  }
3156
3282
  switch (opts.flowType) {
3157
- case import_client_fetch26.FlowType.Login:
3283
+ case import_client_fetch28.FlowType.Login:
3158
3284
  if (opts.flow.refresh) {
3159
3285
  return {
3160
3286
  title: intl.formatMessage({
@@ -3195,7 +3321,7 @@ function useCardHeaderText(container, opts) {
3195
3321
  }
3196
3322
  ) : ""
3197
3323
  };
3198
- case import_client_fetch26.FlowType.Registration:
3324
+ case import_client_fetch28.FlowType.Registration:
3199
3325
  return {
3200
3326
  title: intl.formatMessage({
3201
3327
  id: "registration.title"
@@ -3212,7 +3338,7 @@ function useCardHeaderText(container, opts) {
3212
3338
  }
3213
3339
  ) : ""
3214
3340
  };
3215
- case import_client_fetch26.FlowType.OAuth2Consent:
3341
+ case import_client_fetch28.FlowType.OAuth2Consent:
3216
3342
  return {
3217
3343
  title: intl.formatMessage(
3218
3344
  {
@@ -3239,17 +3365,10 @@ function useCardHeaderText(container, opts) {
3239
3365
  }
3240
3366
 
3241
3367
  // src/theme/default/components/card/current-identifier-button.tsx
3242
- var import_client_fetch27 = require("@ory/client-fetch");
3368
+ var import_client_fetch29 = require("@ory/client-fetch");
3243
3369
  var import_elements_react4 = require("@ory/elements-react");
3244
-
3245
- // src/theme/default/assets/icons/arrow-left.svg
3246
- var React3 = __toESM(require("react"));
3247
- var import_jsx_runtime35 = require("react/jsx-runtime");
3248
- var SvgArrowLeft = (props) => {
3249
- var _a, _b;
3250
- return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("svg", { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 24 25", width: (props == null ? void 0 : props.width) ? props.width : (_a = props == null ? void 0 : props.size) != null ? _a : 20, height: (props == null ? void 0 : props.height) ? props.height : (_b = props == null ? void 0 : props.size) != null ? _b : 20, ...props, children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("path", { stroke: "currentColor", strokeLinecap: "round", strokeLinejoin: "round", d: "M5 12.325h14m-14 0 6 6m-6-6 6-6" }) });
3251
- };
3252
- var arrow_left_default = SvgArrowLeft;
3370
+ var import_react8 = require("react");
3371
+ var import_react_hook_form13 = require("react-hook-form");
3253
3372
 
3254
3373
  // src/theme/default/utils/attributes.ts
3255
3374
  function omit(obj, keys) {
@@ -3260,17 +3379,50 @@ function omit(obj, keys) {
3260
3379
  return ret;
3261
3380
  }
3262
3381
 
3263
- // src/theme/default/components/card/current-identifier-button.tsx
3264
- var import_react_hook_form13 = require("react-hook-form");
3382
+ // src/util/omitAttributes.ts
3383
+ function omitInputAttributes({
3384
+ ...attrs
3385
+ }) {
3386
+ return omit(attrs, [
3387
+ "autocomplete",
3388
+ "label",
3389
+ "node_type",
3390
+ "maxlength",
3391
+ "onclick",
3392
+ "onclickTrigger",
3393
+ "onload",
3394
+ "onloadTrigger"
3395
+ ]);
3396
+ }
3397
+
3398
+ // src/theme/default/assets/icons/arrow-left.svg
3399
+ var React3 = __toESM(require("react"));
3265
3400
  var import_jsx_runtime36 = require("react/jsx-runtime");
3401
+ var SvgArrowLeft = (props) => {
3402
+ var _a, _b;
3403
+ return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("svg", { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 24 25", width: (props == null ? void 0 : props.width) ? props.width : (_a = props == null ? void 0 : props.size) != null ? _a : 20, height: (props == null ? void 0 : props.height) ? props.height : (_b = props == null ? void 0 : props.size) != null ? _b : 20, ...props, children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("path", { stroke: "currentColor", strokeLinecap: "round", strokeLinejoin: "round", d: "M5 12.325h14m-14 0 6 6m-6-6 6-6" }) });
3404
+ };
3405
+ var arrow_left_default = SvgArrowLeft;
3406
+
3407
+ // src/theme/default/components/card/current-identifier-button.tsx
3408
+ var import_jsx_runtime37 = require("react/jsx-runtime");
3266
3409
  function DefaultCurrentIdentifierButton() {
3267
- const { flow, flowType, config, formState } = (0, import_elements_react4.useOryFlow)();
3268
- const { setValue } = (0, import_react_hook_form13.useFormContext)();
3410
+ var _a;
3411
+ const { flow, flowType, formState } = (0, import_elements_react4.useOryFlow)();
3412
+ const { setValue, getValues, watch } = (0, import_react_hook_form13.useFormContext)();
3413
+ const [turnstileResponse, setTurnstileResponse] = (0, import_react8.useState)();
3414
+ const config = (0, import_elements_react4.useOryConfiguration)();
3269
3415
  const ui = flow.ui;
3416
+ const captchaVerificationValue = (_a = watch("transient_payload")) == null ? void 0 : _a.captcha_turnstile_response;
3417
+ (0, import_react8.useEffect)(() => {
3418
+ if (captchaVerificationValue) {
3419
+ setTurnstileResponse(captchaVerificationValue);
3420
+ }
3421
+ }, [captchaVerificationValue]);
3270
3422
  if (formState.current === "provide_identifier") {
3271
3423
  return null;
3272
3424
  }
3273
- if (flowType === import_client_fetch27.FlowType.Login && flow.requested_aal === "aal2") {
3425
+ if (flowType === import_client_fetch29.FlowType.Login && flow.requested_aal === "aal2") {
3274
3426
  return null;
3275
3427
  }
3276
3428
  const nodeBackButton = getBackButtonNodeAttributes(flowType, ui.nodes);
@@ -3281,36 +3433,35 @@ function DefaultCurrentIdentifierButton() {
3281
3433
  flow,
3282
3434
  `${config.sdk.url}/self-service/${flowType}/browser`
3283
3435
  );
3284
- const attributes = omit(nodeBackButton, [
3285
- "autocomplete",
3286
- "node_type",
3287
- "maxlength"
3288
- ]);
3289
3436
  const screenSelectionNode = findScreenSelectionButton(flow.ui.nodes);
3290
3437
  if (screenSelectionNode) {
3291
- return /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("form", { action: flow.ui.action, method: flow.ui.method, children: [
3438
+ return /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("form", { action: flow.ui.action, method: flow.ui.method, children: [
3292
3439
  flow.ui.nodes.filter((n) => {
3293
- if ((0, import_client_fetch27.isUiNodeInputAttributes)(n.attributes)) {
3440
+ if ((0, import_client_fetch29.isUiNodeInputAttributes)(n.attributes)) {
3294
3441
  return n.attributes.type === "hidden";
3295
3442
  }
3296
3443
  return false;
3297
3444
  }).map((n) => {
3298
3445
  const attrs = n.attributes;
3299
- return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
3446
+ let value = getValues(attrs.name) || attrs.value;
3447
+ if (attrs.name === "transient_payload.captcha_turnstile_response" && turnstileResponse) {
3448
+ value = turnstileResponse;
3449
+ }
3450
+ return /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
3300
3451
  "input",
3301
3452
  {
3302
3453
  type: "hidden",
3303
3454
  name: attrs.name,
3304
- value: attrs.value
3455
+ value
3305
3456
  },
3306
3457
  attrs.name
3307
3458
  );
3308
3459
  }),
3309
- /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
3460
+ /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
3310
3461
  "button",
3311
3462
  {
3312
3463
  className: "group inline-flex max-w-full cursor-pointer items-center gap-1 self-start rounded-identifier border px-[11px] py-[5px] transition-colors border-button-identifier-border-border-default bg-button-identifier-background-default hover:border-button-identifier-border-border-hover hover:bg-button-identifier-background-hover",
3313
- ...attributes,
3464
+ ...omitInputAttributes(nodeBackButton),
3314
3465
  type: "submit",
3315
3466
  onClick: () => {
3316
3467
  setValue(
@@ -3323,8 +3474,8 @@ function DefaultCurrentIdentifierButton() {
3323
3474
  value: screenSelectionNode.attributes.value,
3324
3475
  title: `Adjust ${nodeBackButton == null ? void 0 : nodeBackButton.value}`,
3325
3476
  "data-testid": `ory/screen/${flowType}/action/restart`,
3326
- children: /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("span", { className: "inline-flex min-h-5 items-center gap-2 overflow-hidden text-ellipsis", children: [
3327
- /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
3477
+ children: /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("span", { className: "inline-flex min-h-5 items-center gap-2 overflow-hidden text-ellipsis", children: [
3478
+ /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
3328
3479
  arrow_left_default,
3329
3480
  {
3330
3481
  size: 16,
@@ -3332,22 +3483,22 @@ function DefaultCurrentIdentifierButton() {
3332
3483
  className: "shrink-0 text-button-identifier-foreground-default group-hover:text-button-identifier-foreground-hover"
3333
3484
  }
3334
3485
  ),
3335
- /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("span", { className: "overflow-hidden text-ellipsis text-nowrap text-sm font-medium text-button-identifier-foreground-default group-hover:text-button-identifier-foreground-hover", children: nodeBackButton == null ? void 0 : nodeBackButton.value })
3486
+ /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("span", { className: "overflow-hidden text-ellipsis text-nowrap text-sm font-medium text-button-identifier-foreground-default group-hover:text-button-identifier-foreground-hover", children: nodeBackButton == null ? void 0 : nodeBackButton.value })
3336
3487
  ] })
3337
3488
  }
3338
3489
  )
3339
3490
  ] });
3340
3491
  }
3341
- return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
3492
+ return /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
3342
3493
  "a",
3343
3494
  {
3344
3495
  className: "group inline-flex max-w-full cursor-pointer items-center gap-1 self-start rounded-identifier border px-[11px] py-[5px] transition-colors border-button-identifier-border-border-default bg-button-identifier-background-default hover:border-button-identifier-border-border-hover hover:bg-button-identifier-background-hover",
3345
- ...attributes,
3496
+ ...omitInputAttributes(nodeBackButton),
3346
3497
  href: initFlowUrl2,
3347
3498
  title: `Adjust ${nodeBackButton == null ? void 0 : nodeBackButton.value}`,
3348
3499
  "data-testid": `ory/screen/${flowType}/action/restart`,
3349
- children: /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("span", { className: "inline-flex min-h-5 items-center gap-2 overflow-hidden text-ellipsis", children: [
3350
- /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
3500
+ children: /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("span", { className: "inline-flex min-h-5 items-center gap-2 overflow-hidden text-ellipsis", children: [
3501
+ /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
3351
3502
  arrow_left_default,
3352
3503
  {
3353
3504
  size: 16,
@@ -3355,7 +3506,7 @@ function DefaultCurrentIdentifierButton() {
3355
3506
  className: "shrink-0 text-button-identifier-foreground-default group-hover:text-button-identifier-foreground-hover"
3356
3507
  }
3357
3508
  ),
3358
- /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("span", { className: "overflow-hidden text-ellipsis text-nowrap text-sm font-medium text-button-identifier-foreground-default group-hover:text-button-identifier-foreground-hover", children: nodeBackButton == null ? void 0 : nodeBackButton.value })
3509
+ /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("span", { className: "overflow-hidden text-ellipsis text-nowrap text-sm font-medium text-button-identifier-foreground-default group-hover:text-button-identifier-foreground-hover", children: nodeBackButton == null ? void 0 : nodeBackButton.value })
3359
3510
  ] })
3360
3511
  }
3361
3512
  );
@@ -3364,18 +3515,18 @@ function getBackButtonNodeAttributes(flowType, nodes) {
3364
3515
  var _a, _b;
3365
3516
  let nodeBackButtonAttributes;
3366
3517
  switch (flowType) {
3367
- case import_client_fetch27.FlowType.Login:
3518
+ case import_client_fetch29.FlowType.Login:
3368
3519
  nodeBackButtonAttributes = (_a = nodes.find(
3369
- (node) => (0, import_client_fetch27.isUiNodeInputAttributes)(node.attributes) && node.attributes.name === "identifier" && ["default", "identifier_first"].includes(node.group)
3520
+ (node) => (0, import_client_fetch29.isUiNodeInputAttributes)(node.attributes) && node.attributes.name === "identifier" && ["default", "identifier_first"].includes(node.group)
3370
3521
  )) == null ? void 0 : _a.attributes;
3371
3522
  break;
3372
- case import_client_fetch27.FlowType.Registration:
3523
+ case import_client_fetch29.FlowType.Registration:
3373
3524
  nodeBackButtonAttributes = guessRegistrationBackButton(nodes);
3374
3525
  break;
3375
- case import_client_fetch27.FlowType.Recovery:
3376
- case import_client_fetch27.FlowType.Verification:
3526
+ case import_client_fetch29.FlowType.Recovery:
3527
+ case import_client_fetch29.FlowType.Verification:
3377
3528
  nodeBackButtonAttributes = (_b = nodes.find(
3378
- (n) => (0, import_client_fetch27.isUiNodeInputAttributes)(n.attributes) && n.attributes.name === "email"
3529
+ (n) => (0, import_client_fetch29.isUiNodeInputAttributes)(n.attributes) && n.attributes.name === "email"
3379
3530
  )) == null ? void 0 : _b.attributes;
3380
3531
  break;
3381
3532
  }
@@ -3392,52 +3543,74 @@ var backButtonCandiates = [
3392
3543
  function guessRegistrationBackButton(uiNodes) {
3393
3544
  var _a;
3394
3545
  return (_a = uiNodes.find(
3395
- (node) => (0, import_client_fetch27.isUiNodeInputAttributes)(node.attributes) && backButtonCandiates.includes(node.attributes.name) && node.group === "default"
3546
+ (node) => (0, import_client_fetch29.isUiNodeInputAttributes)(node.attributes) && backButtonCandiates.includes(node.attributes.name) && node.group === "default"
3396
3547
  )) == null ? void 0 : _a.attributes;
3397
3548
  }
3398
3549
 
3399
3550
  // src/theme/default/components/card/header.tsx
3400
- var import_jsx_runtime37 = require("react/jsx-runtime");
3401
- function InnerCardHeader({ title, text }) {
3551
+ var import_jsx_runtime38 = require("react/jsx-runtime");
3552
+ function InnerCardHeader({
3553
+ title,
3554
+ text,
3555
+ messageId
3556
+ }) {
3402
3557
  const { Card } = (0, import_elements_react5.useComponents)();
3403
- return /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("header", { className: "flex flex-col gap-8 antialiased", children: [
3404
- /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(Card.Logo, {}),
3405
- /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("div", { className: "flex flex-col gap-2", children: [
3406
- /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("h2", { className: "text-lg font-semibold leading-normal text-interface-foreground-default-primary", children: title }),
3407
- /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("p", { className: "leading-normal text-interface-foreground-default-secondary", children: text }),
3408
- /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(DefaultCurrentIdentifierButton, {})
3558
+ return /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("header", { className: "flex flex-col gap-8 antialiased", children: [
3559
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(Card.Logo, {}),
3560
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { className: "flex flex-col gap-2", children: [
3561
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("h2", { className: "text-lg font-semibold leading-normal text-interface-foreground-default-primary", children: title }),
3562
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
3563
+ "p",
3564
+ {
3565
+ className: "leading-normal text-interface-foreground-default-secondary",
3566
+ ...messageId ? (0, import_elements_react5.messageTestId)({ id: messageId }) : {},
3567
+ children: text
3568
+ }
3569
+ ),
3570
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(DefaultCurrentIdentifierButton, {})
3409
3571
  ] })
3410
3572
  ] });
3411
3573
  }
3412
3574
  function DefaultCardHeader() {
3413
3575
  const context = (0, import_elements_react5.useOryFlow)();
3414
- const { title, description } = useCardHeaderText(context.flow.ui, context);
3415
- return /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(InnerCardHeader, { title, text: description });
3576
+ const { title, description, messageId } = useCardHeaderText(
3577
+ context.flow.ui,
3578
+ context
3579
+ );
3580
+ return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(InnerCardHeader, { title, text: description, messageId });
3416
3581
  }
3417
3582
 
3418
3583
  // src/theme/default/components/card/logo.tsx
3419
3584
  var import_elements_react6 = require("@ory/elements-react");
3420
- var import_jsx_runtime38 = require("react/jsx-runtime");
3585
+ var import_jsx_runtime39 = require("react/jsx-runtime");
3421
3586
  function DefaultCardLogo() {
3422
- const flow = (0, import_elements_react6.useOryFlow)();
3423
- if (flow.config.logoUrl) {
3424
- return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("img", { src: flow.config.logoUrl, width: 100, height: 36, alt: "Logo" });
3587
+ const config = (0, import_elements_react6.useOryConfiguration)();
3588
+ if (config.project.logo_light_url) {
3589
+ return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
3590
+ "img",
3591
+ {
3592
+ src: config.project.logo_light_url,
3593
+ width: 100,
3594
+ height: 36,
3595
+ alt: "Logo"
3596
+ }
3597
+ );
3425
3598
  }
3426
- return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("h1", { className: "text-xl font-semibold leading-normal text-interface-foreground-default-primary", children: flow.config.name });
3599
+ return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("h1", { className: "text-xl font-semibold leading-normal text-interface-foreground-default-primary", children: config.project.name });
3427
3600
  }
3428
3601
 
3429
3602
  // src/theme/default/components/card/layout.tsx
3430
- var import_jsx_runtime39 = require("react/jsx-runtime");
3603
+ var import_jsx_runtime40 = require("react/jsx-runtime");
3431
3604
  function DefaultCardLayout({ children }) {
3432
- return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("main", { className: "p-4 pb-8 flex items-center justify-center flex-col gap-8 min-h-screen", children });
3605
+ return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("main", { className: "p-4 pb-8 flex items-center justify-center flex-col gap-8 min-h-screen", children });
3433
3606
  }
3434
3607
 
3435
3608
  // src/theme/default/components/card/index.tsx
3436
- var import_jsx_runtime40 = require("react/jsx-runtime");
3609
+ var import_jsx_runtime41 = require("react/jsx-runtime");
3437
3610
  function DefaultCard({ children }) {
3438
- return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("div", { className: "flex flex-1 sm:items-center justify-center font-sans items-start w-full sm:w-[480px] sm:max-w-[480px]", children: /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("div", { className: "relative grid grid-cols-1 gap-8 sm:rounded-cards sm:border border-form-border-default bg-form-background-default px-8 py-12 sm:px-12 sm:py-14 border-b w-full", children: [
3611
+ return /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("div", { className: "flex flex-1 sm:items-center justify-center font-sans items-start w-full sm:w-[480px] sm:max-w-[480px]", children: /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("div", { className: "relative grid grid-cols-1 gap-8 sm:rounded-cards sm:border border-form-border-default bg-form-background-default px-8 py-12 sm:px-12 sm:py-14 border-b w-full", children: [
3439
3612
  children,
3440
- /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(Badge, {})
3613
+ /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(Badge, {})
3441
3614
  ] }) });
3442
3615
  }
3443
3616
 
@@ -3451,76 +3624,63 @@ function cn(...inputs) {
3451
3624
  // src/theme/default/components/form/index.tsx
3452
3625
  var import_react_intl13 = require("react-intl");
3453
3626
  var import_elements_react8 = require("@ory/elements-react");
3454
- var import_client_fetch29 = require("@ory/client-fetch");
3627
+ var import_client_fetch31 = require("@ory/client-fetch");
3455
3628
 
3456
3629
  // src/theme/default/components/form/social.tsx
3457
3630
  var import_elements_react7 = require("@ory/elements-react");
3458
- var import_react6 = require("react");
3631
+ var import_react9 = require("react");
3459
3632
  var import_react_hook_form14 = require("react-hook-form");
3460
3633
  var import_react_intl12 = require("react-intl");
3461
3634
  var import_usehooks_ts = require("usehooks-ts");
3462
3635
 
3463
3636
  // src/theme/default/provider-logos/apple.svg
3464
3637
  var React4 = __toESM(require("react"));
3465
- var import_jsx_runtime41 = require("react/jsx-runtime");
3638
+ var import_jsx_runtime42 = require("react/jsx-runtime");
3466
3639
  var SvgApple = (props) => {
3467
3640
  var _a, _b;
3468
- return /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("svg", { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 32 32", width: (props == null ? void 0 : props.width) ? props.width : (_a = props == null ? void 0 : props.size) != null ? _a : 20, height: (props == null ? void 0 : props.height) ? props.height : (_b = props == null ? void 0 : props.size) != null ? _b : 20, ...props, children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("path", { fill: "#283544", d: "M27.734 11.55c-.134.078-3.317 1.724-3.317 5.374.15 4.162 4.017 5.621 4.083 5.621-.066.078-.584 1.988-2.116 3.991C25.167 28.261 23.817 30 21.767 30c-1.95 0-2.65-1.15-4.9-1.15-2.416 0-3.1 1.15-4.95 1.15-2.05 0-3.5-1.832-4.782-3.541-1.667-2.236-3.083-5.746-3.133-9.116-.034-1.786.334-3.54 1.266-5.032 1.317-2.081 3.667-3.494 6.233-3.54 1.966-.063 3.716 1.257 4.916 1.257 1.15 0 3.3-1.258 5.733-1.258 1.05.001 3.85.296 5.584 2.78M16.25 8.414c-.35-1.631.616-3.262 1.516-4.302C18.917 2.854 20.734 2 22.3 2c.1 1.63-.534 3.23-1.666 4.395-1.017 1.258-2.767 2.205-4.383 2.019" }) });
3641
+ return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("svg", { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 32 32", width: (props == null ? void 0 : props.width) ? props.width : (_a = props == null ? void 0 : props.size) != null ? _a : 20, height: (props == null ? void 0 : props.height) ? props.height : (_b = props == null ? void 0 : props.size) != null ? _b : 20, ...props, children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("path", { fill: "#283544", d: "M27.734 11.55c-.134.078-3.317 1.724-3.317 5.374.15 4.162 4.017 5.621 4.083 5.621-.066.078-.584 1.988-2.116 3.991C25.167 28.261 23.817 30 21.767 30c-1.95 0-2.65-1.15-4.9-1.15-2.416 0-3.1 1.15-4.95 1.15-2.05 0-3.5-1.832-4.782-3.541-1.667-2.236-3.083-5.746-3.133-9.116-.034-1.786.334-3.54 1.266-5.032 1.317-2.081 3.667-3.494 6.233-3.54 1.966-.063 3.716 1.257 4.916 1.257 1.15 0 3.3-1.258 5.733-1.258 1.05.001 3.85.296 5.584 2.78M16.25 8.414c-.35-1.631.616-3.262 1.516-4.302C18.917 2.854 20.734 2 22.3 2c.1 1.63-.534 3.23-1.666 4.395-1.017 1.258-2.767 2.205-4.383 2.019" }) });
3469
3642
  };
3470
3643
  var apple_default = SvgApple;
3471
3644
 
3472
3645
  // src/theme/default/provider-logos/auth0.svg
3473
3646
  var React5 = __toESM(require("react"));
3474
- var import_jsx_runtime42 = require("react/jsx-runtime");
3647
+ var import_jsx_runtime43 = require("react/jsx-runtime");
3475
3648
  var SvgAuth0 = (props) => {
3476
3649
  var _a, _b;
3477
- return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 64 64", width: (props == null ? void 0 : props.width) ? props.width : (_a = props == null ? void 0 : props.size) != null ? _a : 20, height: (props == null ? void 0 : props.height) ? props.height : (_b = props == null ? void 0 : props.size) != null ? _b : 20, ...props, children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("path", { fill: "#eb5424", d: "M49.012 51.774 42.514 32l17.008-12.22h-21.02L32.005 0h21.032l6.506 19.78c3.767 11.468-.118 24.52-10.53 31.993zm-34.023 0L31.998 64l17.015-12.226-17.008-12.22zm-10.516-32c-3.976 12.1.64 24.917 10.5 32.007v-.007L21.482 32 4.474 19.774l21.025.007L31.998 0H10.972z" }) });
3650
+ return /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 64 64", width: (props == null ? void 0 : props.width) ? props.width : (_a = props == null ? void 0 : props.size) != null ? _a : 20, height: (props == null ? void 0 : props.height) ? props.height : (_b = props == null ? void 0 : props.size) != null ? _b : 20, ...props, children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("path", { fill: "#eb5424", d: "M49.012 51.774 42.514 32l17.008-12.22h-21.02L32.005 0h21.032l6.506 19.78c3.767 11.468-.118 24.52-10.53 31.993zm-34.023 0L31.998 64l17.015-12.226-17.008-12.22zm-10.516-32c-3.976 12.1.64 24.917 10.5 32.007v-.007L21.482 32 4.474 19.774l21.025.007L31.998 0H10.972z" }) });
3478
3651
  };
3479
3652
  var auth0_default = SvgAuth0;
3480
3653
 
3481
3654
  // src/theme/default/provider-logos/discord.svg
3482
3655
  var React6 = __toESM(require("react"));
3483
- var import_jsx_runtime43 = require("react/jsx-runtime");
3656
+ var import_jsx_runtime44 = require("react/jsx-runtime");
3484
3657
  var SvgDiscord = (props) => {
3485
3658
  var _a, _b;
3486
- return /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("svg", { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 32 32", width: (props == null ? void 0 : props.width) ? props.width : (_a = props == null ? void 0 : props.size) != null ? _a : 20, height: (props == null ? void 0 : props.height) ? props.height : (_b = props == null ? void 0 : props.size) != null ? _b : 20, ...props, children: [
3487
- /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("path", { d: "M2 11.6c0-3.36 0-5.04.654-6.324a6 6 0 0 1 2.622-2.622C6.56 2 8.24 2 11.6 2h8.8c3.36 0 5.04 0 6.324.654a6 6 0 0 1 2.622 2.622C30 6.56 30 8.24 30 11.6v8.8c0 3.36 0 5.04-.654 6.324a6 6 0 0 1-2.622 2.622C25.44 30 23.76 30 20.4 30h-8.8c-3.36 0-5.04 0-6.324-.654a6 6 0 0 1-2.622-2.622C2 25.44 2 23.76 2 20.4z" }),
3488
- /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("path", { fill: "#5865F2", d: "M23.636 9.34A18.8 18.8 0 0 0 19.097 8c-.195.332-.424.779-.581 1.134a17.7 17.7 0 0 0-5.03 0A12 12 0 0 0 12.897 8a18.7 18.7 0 0 0-4.542 1.343c-2.872 4.078-3.65 8.055-3.262 11.975a18.6 18.6 0 0 0 5.567 2.68c.448-.58.848-1.195 1.192-1.844a12 12 0 0 1-1.877-.859 9 9 0 0 0 .46-.342c3.62 1.59 7.553 1.59 11.13 0q.225.178.46.342c-.595.337-1.225.626-1.88.86q.516.974 1.191 1.845a18.6 18.6 0 0 0 5.57-2.682c.457-4.544-.78-8.484-3.27-11.978m-11.29 9.567c-1.087 0-1.978-.953-1.978-2.113s.872-2.116 1.977-2.116c1.106 0 1.997.953 1.978 2.116.002 1.16-.872 2.113-1.978 2.113m7.308 0c-1.086 0-1.977-.953-1.977-2.113s.872-2.116 1.977-2.116c1.106 0 1.997.953 1.978 2.116 0 1.16-.872 2.113-1.978 2.113" })
3659
+ return /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("svg", { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 32 32", width: (props == null ? void 0 : props.width) ? props.width : (_a = props == null ? void 0 : props.size) != null ? _a : 20, height: (props == null ? void 0 : props.height) ? props.height : (_b = props == null ? void 0 : props.size) != null ? _b : 20, ...props, children: [
3660
+ /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("path", { d: "M2 11.6c0-3.36 0-5.04.654-6.324a6 6 0 0 1 2.622-2.622C6.56 2 8.24 2 11.6 2h8.8c3.36 0 5.04 0 6.324.654a6 6 0 0 1 2.622 2.622C30 6.56 30 8.24 30 11.6v8.8c0 3.36 0 5.04-.654 6.324a6 6 0 0 1-2.622 2.622C25.44 30 23.76 30 20.4 30h-8.8c-3.36 0-5.04 0-6.324-.654a6 6 0 0 1-2.622-2.622C2 25.44 2 23.76 2 20.4z" }),
3661
+ /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("path", { fill: "#5865F2", d: "M23.636 9.34A18.8 18.8 0 0 0 19.097 8c-.195.332-.424.779-.581 1.134a17.7 17.7 0 0 0-5.03 0A12 12 0 0 0 12.897 8a18.7 18.7 0 0 0-4.542 1.343c-2.872 4.078-3.65 8.055-3.262 11.975a18.6 18.6 0 0 0 5.567 2.68c.448-.58.848-1.195 1.192-1.844a12 12 0 0 1-1.877-.859 9 9 0 0 0 .46-.342c3.62 1.59 7.553 1.59 11.13 0q.225.178.46.342c-.595.337-1.225.626-1.88.86q.516.974 1.191 1.845a18.6 18.6 0 0 0 5.57-2.682c.457-4.544-.78-8.484-3.27-11.978m-11.29 9.567c-1.087 0-1.978-.953-1.978-2.113s.872-2.116 1.977-2.116c1.106 0 1.997.953 1.978 2.116.002 1.16-.872 2.113-1.978 2.113m7.308 0c-1.086 0-1.977-.953-1.977-2.113s.872-2.116 1.977-2.116c1.106 0 1.997.953 1.978 2.116 0 1.16-.872 2.113-1.978 2.113" })
3489
3662
  ] });
3490
3663
  };
3491
3664
  var discord_default = SvgDiscord;
3492
3665
 
3493
3666
  // src/theme/default/provider-logos/facebook.svg
3494
3667
  var React7 = __toESM(require("react"));
3495
- var import_jsx_runtime44 = require("react/jsx-runtime");
3668
+ var import_jsx_runtime45 = require("react/jsx-runtime");
3496
3669
  var SvgFacebook = (props) => {
3497
3670
  var _a, _b;
3498
- return /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("svg", { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 32 32", width: (props == null ? void 0 : props.width) ? props.width : (_a = props == null ? void 0 : props.size) != null ? _a : 20, height: (props == null ? void 0 : props.height) ? props.height : (_b = props == null ? void 0 : props.size) != null ? _b : 20, ...props, children: [
3499
- /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("circle", { cx: 16, cy: 16, r: 14, fill: "url(#facebook_svg__a)" }),
3500
- /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("path", { fill: "#fff", d: "m21.214 20.282.622-3.952h-3.89v-2.563c0-1.081.542-2.136 2.284-2.136H22V8.267S20.395 8 18.86 8c-3.205 0-5.298 1.893-5.298 5.318v3.012H10v3.952h3.562v9.552q1.073.165 2.191.166 1.12 0 2.192-.166v-9.552z" }),
3501
- /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("defs", { children: /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("linearGradient", { id: "facebook_svg__a", x1: 16, x2: 16, y1: 2, y2: 29.917, gradientUnits: "userSpaceOnUse", children: [
3502
- /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("stop", { stopColor: "#18ACFE" }),
3503
- /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("stop", { offset: 1, stopColor: "#0163E0" })
3671
+ return /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("svg", { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 32 32", width: (props == null ? void 0 : props.width) ? props.width : (_a = props == null ? void 0 : props.size) != null ? _a : 20, height: (props == null ? void 0 : props.height) ? props.height : (_b = props == null ? void 0 : props.size) != null ? _b : 20, ...props, children: [
3672
+ /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("circle", { cx: 16, cy: 16, r: 14, fill: "url(#facebook_svg__a)" }),
3673
+ /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("path", { fill: "#fff", d: "m21.214 20.282.622-3.952h-3.89v-2.563c0-1.081.542-2.136 2.284-2.136H22V8.267S20.395 8 18.86 8c-3.205 0-5.298 1.893-5.298 5.318v3.012H10v3.952h3.562v9.552q1.073.165 2.191.166 1.12 0 2.192-.166v-9.552z" }),
3674
+ /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("defs", { children: /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("linearGradient", { id: "facebook_svg__a", x1: 16, x2: 16, y1: 2, y2: 29.917, gradientUnits: "userSpaceOnUse", children: [
3675
+ /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("stop", { stopColor: "#18ACFE" }),
3676
+ /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("stop", { offset: 1, stopColor: "#0163E0" })
3504
3677
  ] }) })
3505
3678
  ] });
3506
3679
  };
3507
3680
  var facebook_default = SvgFacebook;
3508
3681
 
3509
- // src/theme/default/provider-logos/generic.svg
3510
- var React8 = __toESM(require("react"));
3511
- var import_jsx_runtime45 = require("react/jsx-runtime");
3512
- var SvgGeneric = (props) => {
3513
- var _a, _b;
3514
- return /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("svg", { xmlns: "http://www.w3.org/2000/svg", fill: "none", stroke: "currentColor", strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, className: "generic_svg__icon generic_svg__icon-tabler generic_svg__icon-tabler-brand-oauth", viewBox: "0 0 24 24", width: (props == null ? void 0 : props.width) ? props.width : (_a = props == null ? void 0 : props.size) != null ? _a : 20, height: (props == null ? void 0 : props.height) ? props.height : (_b = props == null ? void 0 : props.size) != null ? _b : 20, ...props, children: [
3515
- /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("path", { stroke: "none", d: "M0 0h24v24H0z" }),
3516
- /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("path", { d: "M2 12a10 10 0 1 0 20 0 10 10 0 1 0-20 0" }),
3517
- /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("path", { d: "M12.556 6c.65 0 1.235.373 1.508.947l2.839 7.848a1.646 1.646 0 0 1-1.01 2.108 1.673 1.673 0 0 1-2.068-.851L13.365 15h-2.73l-.398.905A1.67 1.67 0 0 1 8.26 16.95l-.153-.047a1.647 1.647 0 0 1-1.056-1.956l2.824-7.852a1.66 1.66 0 0 1 1.409-1.087z" })
3518
- ] });
3519
- };
3520
- var generic_default = SvgGeneric;
3521
-
3522
3682
  // src/theme/default/provider-logos/github.svg
3523
- var React9 = __toESM(require("react"));
3683
+ var React8 = __toESM(require("react"));
3524
3684
  var import_jsx_runtime46 = require("react/jsx-runtime");
3525
3685
  var SvgGithub = (props) => {
3526
3686
  var _a, _b;
@@ -3529,7 +3689,7 @@ var SvgGithub = (props) => {
3529
3689
  var github_default = SvgGithub;
3530
3690
 
3531
3691
  // src/theme/default/provider-logos/gitlab.svg
3532
- var React10 = __toESM(require("react"));
3692
+ var React9 = __toESM(require("react"));
3533
3693
  var import_jsx_runtime47 = require("react/jsx-runtime");
3534
3694
  var SvgGitlab = (props) => {
3535
3695
  var _a, _b;
@@ -3543,7 +3703,7 @@ var SvgGitlab = (props) => {
3543
3703
  var gitlab_default = SvgGitlab;
3544
3704
 
3545
3705
  // src/theme/default/provider-logos/google.svg
3546
- var React11 = __toESM(require("react"));
3706
+ var React10 = __toESM(require("react"));
3547
3707
  var import_jsx_runtime48 = require("react/jsx-runtime");
3548
3708
  var SvgGoogle = (props) => {
3549
3709
  var _a, _b;
@@ -3557,7 +3717,7 @@ var SvgGoogle = (props) => {
3557
3717
  var google_default = SvgGoogle;
3558
3718
 
3559
3719
  // src/theme/default/provider-logos/linkedin.svg
3560
- var React12 = __toESM(require("react"));
3720
+ var React11 = __toESM(require("react"));
3561
3721
  var import_jsx_runtime49 = require("react/jsx-runtime");
3562
3722
  var SvgLinkedin = (props) => {
3563
3723
  var _a, _b;
@@ -3569,7 +3729,7 @@ var SvgLinkedin = (props) => {
3569
3729
  var linkedin_default = SvgLinkedin;
3570
3730
 
3571
3731
  // src/theme/default/provider-logos/microsoft.svg
3572
- var React13 = __toESM(require("react"));
3732
+ var React12 = __toESM(require("react"));
3573
3733
  var import_jsx_runtime50 = require("react/jsx-runtime");
3574
3734
  var SvgMicrosoft = (props) => {
3575
3735
  var _a, _b;
@@ -3583,7 +3743,7 @@ var SvgMicrosoft = (props) => {
3583
3743
  var microsoft_default = SvgMicrosoft;
3584
3744
 
3585
3745
  // src/theme/default/provider-logos/slack.svg
3586
- var React14 = __toESM(require("react"));
3746
+ var React13 = __toESM(require("react"));
3587
3747
  var import_jsx_runtime51 = require("react/jsx-runtime");
3588
3748
  var SvgSlack = (props) => {
3589
3749
  var _a, _b;
@@ -3597,7 +3757,7 @@ var SvgSlack = (props) => {
3597
3757
  var slack_default = SvgSlack;
3598
3758
 
3599
3759
  // src/theme/default/provider-logos/spotify.svg
3600
- var React15 = __toESM(require("react"));
3760
+ var React14 = __toESM(require("react"));
3601
3761
  var import_jsx_runtime52 = require("react/jsx-runtime");
3602
3762
  var SvgSpotify = (props) => {
3603
3763
  var _a, _b;
@@ -3609,7 +3769,7 @@ var SvgSpotify = (props) => {
3609
3769
  var spotify_default = SvgSpotify;
3610
3770
 
3611
3771
  // src/theme/default/provider-logos/yandex.svg
3612
- var React16 = __toESM(require("react"));
3772
+ var React15 = __toESM(require("react"));
3613
3773
  var import_jsx_runtime53 = require("react/jsx-runtime");
3614
3774
  var SvgYandex = (props) => {
3615
3775
  var _a, _b;
@@ -3621,7 +3781,7 @@ var SvgYandex = (props) => {
3621
3781
  var yandex_default = SvgYandex;
3622
3782
 
3623
3783
  // src/theme/default/provider-logos/x.svg
3624
- var React17 = __toESM(require("react"));
3784
+ var React16 = __toESM(require("react"));
3625
3785
  var import_jsx_runtime54 = require("react/jsx-runtime");
3626
3786
  var SvgX = (props) => {
3627
3787
  var _a, _b;
@@ -3635,7 +3795,6 @@ var logos = {
3635
3795
  auth0: auth0_default,
3636
3796
  discord: discord_default,
3637
3797
  facebook: facebook_default,
3638
- generic: generic_default,
3639
3798
  github: github_default,
3640
3799
  gitlab: gitlab_default,
3641
3800
  google: google_default,
@@ -3688,25 +3847,7 @@ function Spinner({ className }) {
3688
3847
  }
3689
3848
 
3690
3849
  // src/theme/default/components/form/social.tsx
3691
- var import_client_fetch28 = require("@ory/client-fetch");
3692
-
3693
- // src/util/omitAttributes.ts
3694
- function omitInputAttributes({
3695
- ...attrs
3696
- }) {
3697
- return omit(attrs, [
3698
- "autocomplete",
3699
- "label",
3700
- "node_type",
3701
- "maxlength",
3702
- "onclick",
3703
- "onclickTrigger",
3704
- "onload",
3705
- "onloadTrigger"
3706
- ]);
3707
- }
3708
-
3709
- // src/theme/default/components/form/social.tsx
3850
+ var import_client_fetch30 = require("@ory/client-fetch");
3710
3851
  var import_jsx_runtime56 = require("react/jsx-runtime");
3711
3852
  function extractProvider(context) {
3712
3853
  if (context && typeof context === "object" && "provider" in context && typeof context.provider === "string") {
@@ -3733,7 +3874,7 @@ function DefaultButtonSocial({
3733
3874
  formState: { isSubmitting }
3734
3875
  } = (0, import_react_hook_form14.useFormContext)();
3735
3876
  const oidcNodeCount = (_a = ui.nodes.filter(
3736
- (node2) => node2.group === import_client_fetch28.UiNodeGroupEnum.Oidc || node2.group === import_client_fetch28.UiNodeGroupEnum.Saml
3877
+ (node2) => node2.group === import_client_fetch30.UiNodeGroupEnum.Oidc || node2.group === import_client_fetch30.UiNodeGroupEnum.Saml
3737
3878
  ).length) != null ? _a : 0;
3738
3879
  const Logo = logos2[attributes.value.split("-")[0]];
3739
3880
  const showLabel = _showLabel != null ? _showLabel : oidcNodeCount % 3 !== 0 && oidcNodeCount % 4 !== 0;
@@ -3742,7 +3883,7 @@ function DefaultButtonSocial({
3742
3883
  onClick == null ? void 0 : onClick();
3743
3884
  setClicked(true);
3744
3885
  };
3745
- (0, import_react6.useEffect)(() => {
3886
+ (0, import_react9.useEffect)(() => {
3746
3887
  if (!isSubmitting) {
3747
3888
  setClicked(false);
3748
3889
  }
@@ -3762,7 +3903,7 @@ function DefaultButtonSocial({
3762
3903
  "aria-label": label,
3763
3904
  ...omitInputAttributes(rest),
3764
3905
  children: [
3765
- /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("span", { className: "size-5 relative", children: !clicked ? Logo ? /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(Logo, { size: 20 }) : /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("span", { className: "flex aspect-square items-center justify-center rounded-[999px] border text-xs", children: provider.slice(0, 2) }) : /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(Spinner, { className: "size-5" }) }),
3906
+ /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("span", { className: "size-5 relative", children: !clicked ? Logo ? /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(Logo, { size: 20 }) : /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(GenericLogo, { label: provider.slice(0, 1) }) : /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(Spinner, { className: "size-5" }) }),
3766
3907
  showLabel && node.meta.label ? /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(import_jsx_runtime56.Fragment, { children: [
3767
3908
  /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("span", { className: "grow text-center font-medium leading-none text-button-social-foreground-default", children: label }),
3768
3909
  /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("span", { className: "size-5 block" })
@@ -3789,6 +3930,9 @@ function DefaultSocialButtonContainer({
3789
3930
  }
3790
3931
  );
3791
3932
  }
3933
+ function GenericLogo({ label }) {
3934
+ return /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("span", { className: "flex rounded-buttons bg-button-social-background-generic-provider text-button-social-foreground-generic-provider border-button-social-border-generic-provider text-xs size-full items-center justify-center", children: label });
3935
+ }
3792
3936
 
3793
3937
  // src/theme/default/components/form/index.tsx
3794
3938
  var import_jsx_runtime57 = require("react/jsx-runtime");
@@ -3821,7 +3965,7 @@ function DefaultMessageContainer({ children }) {
3821
3965
  "section",
3822
3966
  {
3823
3967
  className: cn(
3824
- flowType === import_client_fetch29.FlowType.Settings ? "text-center" : "text-left"
3968
+ flowType === import_client_fetch31.FlowType.Settings ? "text-center" : "text-left"
3825
3969
  ),
3826
3970
  children
3827
3971
  }
@@ -3848,7 +3992,7 @@ function DefaultMessage({ message }) {
3848
3992
  var import_react_intl14 = require("react-intl");
3849
3993
 
3850
3994
  // src/theme/default/assets/icons/code.svg
3851
- var React18 = __toESM(require("react"));
3995
+ var React17 = __toESM(require("react"));
3852
3996
  var import_jsx_runtime58 = require("react/jsx-runtime");
3853
3997
  var SvgCode = (props) => {
3854
3998
  var _a, _b;
@@ -3857,7 +4001,7 @@ var SvgCode = (props) => {
3857
4001
  var code_default = SvgCode;
3858
4002
 
3859
4003
  // src/theme/default/assets/icons/passkey.svg
3860
- var React19 = __toESM(require("react"));
4004
+ var React18 = __toESM(require("react"));
3861
4005
  var import_jsx_runtime59 = require("react/jsx-runtime");
3862
4006
  var SvgPasskey = (props) => {
3863
4007
  var _a, _b;
@@ -3866,7 +4010,7 @@ var SvgPasskey = (props) => {
3866
4010
  var passkey_default = SvgPasskey;
3867
4011
 
3868
4012
  // src/theme/default/assets/icons/password.svg
3869
- var React20 = __toESM(require("react"));
4013
+ var React19 = __toESM(require("react"));
3870
4014
  var import_jsx_runtime60 = require("react/jsx-runtime");
3871
4015
  var SvgPassword = (props) => {
3872
4016
  var _a, _b;
@@ -3875,7 +4019,7 @@ var SvgPassword = (props) => {
3875
4019
  var password_default = SvgPassword;
3876
4020
 
3877
4021
  // src/theme/default/assets/icons/webauthn.svg
3878
- var React21 = __toESM(require("react"));
4022
+ var React20 = __toESM(require("react"));
3879
4023
  var import_jsx_runtime61 = require("react/jsx-runtime");
3880
4024
  var SvgWebauthn = (props) => {
3881
4025
  var _a, _b;
@@ -3884,7 +4028,7 @@ var SvgWebauthn = (props) => {
3884
4028
  var webauthn_default = SvgWebauthn;
3885
4029
 
3886
4030
  // src/theme/default/assets/icons/totp.svg
3887
- var React22 = __toESM(require("react"));
4031
+ var React21 = __toESM(require("react"));
3888
4032
  var import_jsx_runtime62 = require("react/jsx-runtime");
3889
4033
  var SvgTotp = (props) => {
3890
4034
  var _a, _b;
@@ -3893,7 +4037,7 @@ var SvgTotp = (props) => {
3893
4037
  var totp_default = SvgTotp;
3894
4038
 
3895
4039
  // src/theme/default/assets/icons/code-asterix.svg
3896
- var React23 = __toESM(require("react"));
4040
+ var React22 = __toESM(require("react"));
3897
4041
  var import_jsx_runtime63 = require("react/jsx-runtime");
3898
4042
  var SvgCodeAsterix = (props) => {
3899
4043
  var _a, _b;
@@ -3973,12 +4117,12 @@ function DefaultAuthMethodListItem({
3973
4117
  }
3974
4118
 
3975
4119
  // src/theme/default/components/form/button.tsx
3976
- var import_client_fetch30 = require("@ory/client-fetch");
4120
+ var import_client_fetch32 = require("@ory/client-fetch");
3977
4121
  var import_elements_react9 = require("@ory/elements-react");
3978
4122
  var import_class_variance_authority = require("class-variance-authority");
3979
4123
  var import_react_hook_form15 = require("react-hook-form");
3980
4124
  var import_react_intl15 = require("react-intl");
3981
- var import_react7 = require("react");
4125
+ var import_react10 = require("react");
3982
4126
  var import_jsx_runtime66 = require("react/jsx-runtime");
3983
4127
  var buttonStyles = (0, import_class_variance_authority.cva)(
3984
4128
  [
@@ -4019,14 +4163,14 @@ var DefaultButton = ({
4019
4163
  }) => {
4020
4164
  var _a;
4021
4165
  const { type, name, value, ...rest } = attributes;
4022
- const [clicked, setClicked] = (0, import_react7.useState)(false);
4166
+ const [clicked, setClicked] = (0, import_react10.useState)(false);
4023
4167
  const intl = (0, import_react_intl15.useIntl)();
4024
- const label = (0, import_client_fetch30.getNodeLabel)(node);
4168
+ const label = (0, import_client_fetch32.getNodeLabel)(node);
4025
4169
  const {
4026
4170
  formState: { isSubmitting },
4027
4171
  setValue
4028
4172
  } = (0, import_react_hook_form15.useFormContext)();
4029
- (0, import_react7.useEffect)(() => {
4173
+ (0, import_react10.useEffect)(() => {
4030
4174
  if (!isSubmitting) {
4031
4175
  setClicked(false);
4032
4176
  }
@@ -4061,7 +4205,7 @@ var DefaultButton = ({
4061
4205
  DefaultButton.displayName = "DefaultButton";
4062
4206
 
4063
4207
  // src/theme/default/components/form/checkbox.tsx
4064
- var import_client_fetch31 = require("@ory/client-fetch");
4208
+ var import_client_fetch33 = require("@ory/client-fetch");
4065
4209
  var import_elements_react10 = require("@ory/elements-react");
4066
4210
  var import_react_hook_form16 = require("react-hook-form");
4067
4211
  var import_react_intl17 = require("react-intl");
@@ -4141,7 +4285,7 @@ var DefaultCheckbox = ({
4141
4285
  }) => {
4142
4286
  const { value, name, ...attributes } = initialAttributes;
4143
4287
  const intl = (0, import_react_intl17.useIntl)();
4144
- const label = (0, import_client_fetch31.getNodeLabel)(node);
4288
+ const label = (0, import_client_fetch33.getNodeLabel)(node);
4145
4289
  const { register } = (0, import_react_hook_form16.useFormContext)();
4146
4290
  const hasError = node.messages.some((m) => m.type === "error");
4147
4291
  return /* @__PURE__ */ (0, import_jsx_runtime68.jsxs)("label", { className: "flex items-start gap-3 self-stretch antialiased", children: [
@@ -4156,6 +4300,7 @@ var DefaultCheckbox = ({
4156
4300
  "peer size-4 border appearance-none rounded-forms bg-checkbox-background-default border-checkbox-border-checkbox-border-default checked:bg-checkbox-background-checked checked:border-checkbox-border-checkbox-border-checked",
4157
4301
  hasError && "border-interface-border-validation-danger"
4158
4302
  ),
4303
+ "data-testid": `ory/form/node/input/${name}`,
4159
4304
  ...register(name)
4160
4305
  }
4161
4306
  ),
@@ -4181,13 +4326,13 @@ var DefaultCheckbox = ({
4181
4326
 
4182
4327
  // src/theme/default/components/form/group-container.tsx
4183
4328
  var import_elements_react11 = require("@ory/elements-react");
4184
- var import_client_fetch32 = require("@ory/client-fetch");
4329
+ var import_client_fetch34 = require("@ory/client-fetch");
4185
4330
 
4186
4331
  // src/util/childCounter.ts
4187
- var import_react8 = require("react");
4332
+ var import_react11 = require("react");
4188
4333
  function countRenderableChildren(children) {
4189
- return import_react8.Children.toArray(children).filter((c) => {
4190
- if ((0, import_react8.isValidElement)(c)) {
4334
+ return import_react11.Children.toArray(children).filter((c) => {
4335
+ if ((0, import_react11.isValidElement)(c)) {
4191
4336
  return true;
4192
4337
  }
4193
4338
  return false;
@@ -4207,7 +4352,7 @@ function DefaultGroupContainer({ children }) {
4207
4352
  {
4208
4353
  className: cn(
4209
4354
  "grid",
4210
- flowType === import_client_fetch32.FlowType.OAuth2Consent ? "grid-cols-2 gap-2" : "grid-cols-1 gap-8"
4355
+ flowType === import_client_fetch34.FlowType.OAuth2Consent ? "grid-cols-2 gap-2" : "grid-cols-1 gap-8"
4211
4356
  ),
4212
4357
  children
4213
4358
  }
@@ -4234,14 +4379,14 @@ function DefaultImage({ attributes, node }) {
4234
4379
  }
4235
4380
 
4236
4381
  // src/theme/default/components/form/input.tsx
4237
- var import_client_fetch33 = require("@ory/client-fetch");
4382
+ var import_client_fetch35 = require("@ory/client-fetch");
4238
4383
  var import_elements_react12 = require("@ory/elements-react");
4239
- var import_react9 = require("react");
4384
+ var import_react12 = require("react");
4240
4385
  var import_react_hook_form17 = require("react-hook-form");
4241
4386
  var import_react_intl18 = require("react-intl");
4242
4387
 
4243
4388
  // src/theme/default/assets/icons/eye-off.svg
4244
- var React24 = __toESM(require("react"));
4389
+ var React23 = __toESM(require("react"));
4245
4390
  var import_jsx_runtime72 = require("react/jsx-runtime");
4246
4391
  var SvgEyeOff = (props) => {
4247
4392
  var _a, _b;
@@ -4250,7 +4395,7 @@ var SvgEyeOff = (props) => {
4250
4395
  var eye_off_default = SvgEyeOff;
4251
4396
 
4252
4397
  // src/theme/default/assets/icons/eye.svg
4253
- var React25 = __toESM(require("react"));
4398
+ var React24 = __toESM(require("react"));
4254
4399
  var import_jsx_runtime73 = require("react/jsx-runtime");
4255
4400
  var SvgEye = (props) => {
4256
4401
  var _a, _b;
@@ -4276,12 +4421,12 @@ var DefaultInput = ({
4276
4421
  attributes,
4277
4422
  onClick
4278
4423
  }) => {
4279
- const label = (0, import_client_fetch33.getNodeLabel)(node);
4424
+ const label = (0, import_client_fetch35.getNodeLabel)(node);
4280
4425
  const { register } = (0, import_react_hook_form17.useFormContext)();
4281
4426
  const { value, autocomplete, name, maxlength, ...rest } = attributes;
4282
4427
  const intl = (0, import_react_intl18.useIntl)();
4283
4428
  const { flowType } = (0, import_elements_react12.useOryFlow)();
4284
- const inputRef = (0, import_react9.useRef)(null);
4429
+ const inputRef = (0, import_react12.useRef)(null);
4285
4430
  const formattedLabel = label ? intl.formatMessage(
4286
4431
  {
4287
4432
  id: "input.placeholder",
@@ -4295,7 +4440,7 @@ var DefaultInput = ({
4295
4440
  return /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(
4296
4441
  "input",
4297
4442
  {
4298
- ...rest,
4443
+ ...omitInputAttributes(rest),
4299
4444
  onClick,
4300
4445
  maxLength: maxlength,
4301
4446
  autoComplete: autocomplete,
@@ -4312,7 +4457,7 @@ var DefaultInput = ({
4312
4457
  className: cn(
4313
4458
  "relative flex justify-stretch",
4314
4459
  // The settings flow input fields are supposed to be dense, so we don't need the extra padding we want on the user flows.
4315
- flowType === import_client_fetch33.FlowType.Settings && "max-w-[488px]"
4460
+ flowType === import_client_fetch35.FlowType.Settings && "max-w-[488px]"
4316
4461
  ),
4317
4462
  children: [
4318
4463
  /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(
@@ -4340,7 +4485,7 @@ var DefaultInput = ({
4340
4485
  function PasswordToggle({
4341
4486
  inputRef
4342
4487
  }) {
4343
- const [shown, setShown] = (0, import_react9.useState)(false);
4488
+ const [shown, setShown] = (0, import_react12.useState)(false);
4344
4489
  const handleClick = () => {
4345
4490
  setShown(!shown);
4346
4491
  if (inputRef.current) {
@@ -4360,7 +4505,7 @@ function PasswordToggle({
4360
4505
  }
4361
4506
 
4362
4507
  // src/theme/default/components/form/label.tsx
4363
- var import_client_fetch34 = require("@ory/client-fetch");
4508
+ var import_client_fetch36 = require("@ory/client-fetch");
4364
4509
  var import_elements_react13 = require("@ory/elements-react");
4365
4510
  var import_react_hook_form18 = require("react-hook-form");
4366
4511
  var import_react_intl19 = require("react-intl");
@@ -4377,9 +4522,10 @@ function DefaultLabel({
4377
4522
  ...rest
4378
4523
  }) {
4379
4524
  const intl = (0, import_react_intl19.useIntl)();
4380
- const label = (0, import_client_fetch34.getNodeLabel)(node);
4525
+ const label = (0, import_client_fetch36.getNodeLabel)(node);
4381
4526
  const { Message } = (0, import_elements_react13.useComponents)();
4382
- const { config, flowType, flow } = (0, import_elements_react13.useOryFlow)();
4527
+ const { flowType, flow } = (0, import_elements_react13.useOryFlow)();
4528
+ const config = (0, import_elements_react13.useOryConfiguration)();
4383
4529
  const { setValue, formState } = (0, import_react_hook_form18.useFormContext)();
4384
4530
  const isPassword = attributes.type === "password";
4385
4531
  const resendNode = findResendNode(flow.ui.nodes);
@@ -4402,7 +4548,7 @@ function DefaultLabel({
4402
4548
  children: (0, import_elements_react13.uiTextToFormattedMessage)(label, intl)
4403
4549
  }
4404
4550
  ),
4405
- isPassword && config.project.recovery_enabled && flowType === import_client_fetch34.FlowType.Login && // TODO: make it possible to override with a custom component
4551
+ isPassword && config.project.recovery_enabled && flowType === import_client_fetch36.FlowType.Login && // TODO: make it possible to override with a custom component
4406
4552
  /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(
4407
4553
  "a",
4408
4554
  {
@@ -4428,19 +4574,19 @@ function DefaultLabel({
4428
4574
  ] }),
4429
4575
  children,
4430
4576
  node.messages.map((message) => /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(Message.Content, { message }, message.id)),
4431
- fieldError && (0, import_client_fetch34.instanceOfUiText)(fieldError) && /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(Message.Content, { message: fieldError })
4577
+ fieldError && (0, import_client_fetch36.instanceOfUiText)(fieldError) && /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(Message.Content, { message: fieldError })
4432
4578
  ] });
4433
4579
  }
4434
4580
 
4435
4581
  // src/theme/default/components/form/link-button.tsx
4436
- var import_client_fetch35 = require("@ory/client-fetch");
4582
+ var import_client_fetch37 = require("@ory/client-fetch");
4437
4583
  var import_elements_react14 = require("@ory/elements-react");
4438
- var import_react10 = require("react");
4584
+ var import_react13 = require("react");
4439
4585
  var import_react_intl20 = require("react-intl");
4440
4586
  var import_jsx_runtime76 = require("react/jsx-runtime");
4441
- var DefaultLinkButton = (0, import_react10.forwardRef)(({ attributes, node }, ref) => {
4587
+ var DefaultLinkButton = (0, import_react13.forwardRef)(({ attributes, node }, ref) => {
4442
4588
  const intl = (0, import_react_intl20.useIntl)();
4443
- const label = (0, import_client_fetch35.getNodeLabel)(node);
4589
+ const label = (0, import_client_fetch37.getNodeLabel)(node);
4444
4590
  return /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(
4445
4591
  "a",
4446
4592
  {
@@ -4462,9 +4608,9 @@ var import_react_hook_form19 = require("react-hook-form");
4462
4608
 
4463
4609
  // src/theme/default/components/form/shadcn/otp-input.tsx
4464
4610
  var import_input_otp = require("input-otp");
4465
- var React26 = __toESM(require("react"));
4611
+ var React25 = __toESM(require("react"));
4466
4612
  var import_jsx_runtime77 = require("react/jsx-runtime");
4467
- var InputOTP = React26.forwardRef(({ className, containerClassName, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(
4613
+ var InputOTP = React25.forwardRef(({ className, containerClassName, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(
4468
4614
  import_input_otp.OTPInput,
4469
4615
  {
4470
4616
  ref,
@@ -4477,10 +4623,10 @@ var InputOTP = React26.forwardRef(({ className, containerClassName, ...props },
4477
4623
  }
4478
4624
  ));
4479
4625
  InputOTP.displayName = "InputOTP";
4480
- var InputOTPGroup = React26.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime77.jsx)("div", { ref, className: cn("flex items-center", className), ...props }));
4626
+ var InputOTPGroup = React25.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime77.jsx)("div", { ref, className: cn("flex items-center", className), ...props }));
4481
4627
  InputOTPGroup.displayName = "InputOTPGroup";
4482
- var InputOTPSlot = React26.forwardRef(({ index, className, ...props }, ref) => {
4483
- const inputOTPContext = React26.useContext(import_input_otp.OTPInputContext);
4628
+ var InputOTPSlot = React25.forwardRef(({ index, className, ...props }, ref) => {
4629
+ const inputOTPContext = React25.useContext(import_input_otp.OTPInputContext);
4484
4630
  const { char, hasFakeCaret, isActive } = inputOTPContext.slots[index];
4485
4631
  return /* @__PURE__ */ (0, import_jsx_runtime77.jsxs)(
4486
4632
  "div",
@@ -4504,7 +4650,7 @@ InputOTPSlot.displayName = "InputOTPSlot";
4504
4650
 
4505
4651
  // src/theme/default/components/form/pin-code-input.tsx
4506
4652
  var import_elements_react15 = require("@ory/elements-react");
4507
- var import_client_fetch36 = require("@ory/client-fetch");
4653
+ var import_client_fetch38 = require("@ory/client-fetch");
4508
4654
  var import_jsx_runtime78 = require("react/jsx-runtime");
4509
4655
  var DefaultPinCodeInput = ({ attributes }) => {
4510
4656
  const { setValue, watch } = (0, import_react_hook_form19.useFormContext)();
@@ -4528,7 +4674,7 @@ var DefaultPinCodeInput = ({ attributes }) => {
4528
4674
  className: cn(
4529
4675
  "w-full flex gap-2 justify-stretch",
4530
4676
  // The settings flow input fields are supposed to be dense, so we don't need the extra padding we want on the user flows.
4531
- flowType === import_client_fetch36.FlowType.Settings && "max-w-[488px]"
4677
+ flowType === import_client_fetch38.FlowType.Settings && "max-w-[488px]"
4532
4678
  ),
4533
4679
  children: [...Array(elements)].map((_, index) => /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(InputOTPSlot, { index }, index))
4534
4680
  }
@@ -4626,7 +4772,7 @@ var import_elements_react17 = require("@ory/elements-react");
4626
4772
  var import_react_dropdown_menu = require("@radix-ui/react-dropdown-menu");
4627
4773
 
4628
4774
  // src/theme/default/assets/icons/logout.svg
4629
- var React27 = __toESM(require("react"));
4775
+ var React26 = __toESM(require("react"));
4630
4776
  var import_jsx_runtime81 = require("react/jsx-runtime");
4631
4777
  var SvgLogout = (props) => {
4632
4778
  var _a, _b;
@@ -4635,7 +4781,7 @@ var SvgLogout = (props) => {
4635
4781
  var logout_default = SvgLogout;
4636
4782
 
4637
4783
  // src/theme/default/assets/icons/settings.svg
4638
- var React28 = __toESM(require("react"));
4784
+ var React27 = __toESM(require("react"));
4639
4785
  var import_jsx_runtime82 = require("react/jsx-runtime");
4640
4786
  var SvgSettings = (props) => {
4641
4787
  var _a, _b;
@@ -4646,20 +4792,6 @@ var SvgSettings = (props) => {
4646
4792
  };
4647
4793
  var settings_default = SvgSettings;
4648
4794
 
4649
- // src/theme/default/utils/logout.ts
4650
- var import_react11 = require("react");
4651
- function useClientLogout(config) {
4652
- const [logoutFlow, setLogoutFlow] = (0, import_react11.useState)();
4653
- const fetchLogoutFlow = (0, import_react11.useCallback)(async () => {
4654
- const flow = await frontendClient(config.sdk.url).createBrowserLogoutFlow();
4655
- setLogoutFlow(flow);
4656
- }, [config.sdk.url]);
4657
- (0, import_react11.useEffect)(() => {
4658
- void fetchLogoutFlow();
4659
- }, [fetchLogoutFlow]);
4660
- return logoutFlow;
4661
- }
4662
-
4663
4795
  // src/theme/default/utils/user.ts
4664
4796
  function isTraitsIndexable(traits) {
4665
4797
  return typeof traits === "object" && traits !== null;
@@ -4700,12 +4832,12 @@ var getUserInitials = (session) => {
4700
4832
  };
4701
4833
 
4702
4834
  // src/theme/default/components/ui/dropdown-menu.tsx
4703
- var import_react12 = require("react");
4835
+ var import_react14 = require("react");
4704
4836
  var DropdownMenuPrimitive = __toESM(require("@radix-ui/react-dropdown-menu"));
4705
4837
  var import_jsx_runtime83 = require("react/jsx-runtime");
4706
4838
  var DropdownMenu = DropdownMenuPrimitive.Root;
4707
4839
  var DropdownMenuTrigger = DropdownMenuPrimitive.Trigger;
4708
- var DropdownMenuContent = (0, import_react12.forwardRef)(({ className, sideOffset = 16, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(DropdownMenuPrimitive.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(
4840
+ var DropdownMenuContent = (0, import_react14.forwardRef)(({ className, sideOffset = 16, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(DropdownMenuPrimitive.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(
4709
4841
  DropdownMenuPrimitive.Content,
4710
4842
  {
4711
4843
  ref,
@@ -4720,7 +4852,7 @@ var DropdownMenuContent = (0, import_react12.forwardRef)(({ className, sideOffse
4720
4852
  }
4721
4853
  ) }));
4722
4854
  DropdownMenuContent.displayName = DropdownMenuPrimitive.Content.displayName;
4723
- var DropdownMenuItem = (0, import_react12.forwardRef)(({ className, inset, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(
4855
+ var DropdownMenuItem = (0, import_react14.forwardRef)(({ className, inset, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(
4724
4856
  DropdownMenuPrimitive.Item,
4725
4857
  {
4726
4858
  ref,
@@ -4738,7 +4870,7 @@ var DropdownMenuItem = (0, import_react12.forwardRef)(({ className, inset, ...pr
4738
4870
  }
4739
4871
  ));
4740
4872
  DropdownMenuItem.displayName = DropdownMenuPrimitive.Item.displayName;
4741
- var DropdownMenuLabel = (0, import_react12.forwardRef)(({ className, inset, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(
4873
+ var DropdownMenuLabel = (0, import_react14.forwardRef)(({ className, inset, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(
4742
4874
  DropdownMenuPrimitive.Label,
4743
4875
  {
4744
4876
  ref,
@@ -4753,10 +4885,10 @@ var DropdownMenuLabel = (0, import_react12.forwardRef)(({ className, inset, ...p
4753
4885
  DropdownMenuLabel.displayName = DropdownMenuPrimitive.Label.displayName;
4754
4886
 
4755
4887
  // src/theme/default/components/ui/user-avater.tsx
4756
- var import_react13 = require("react");
4888
+ var import_react15 = require("react");
4757
4889
 
4758
4890
  // src/theme/default/assets/icons/user.svg
4759
- var React29 = __toESM(require("react"));
4891
+ var React28 = __toESM(require("react"));
4760
4892
  var import_jsx_runtime84 = require("react/jsx-runtime");
4761
4893
  var SvgUser = (props) => {
4762
4894
  var _a, _b;
@@ -4766,7 +4898,7 @@ var user_default = SvgUser;
4766
4898
 
4767
4899
  // src/theme/default/components/ui/user-avater.tsx
4768
4900
  var import_jsx_runtime85 = require("react/jsx-runtime");
4769
- var UserAvatar = (0, import_react13.forwardRef)(
4901
+ var UserAvatar = (0, import_react15.forwardRef)(
4770
4902
  ({ initials, ...rest }, ref) => {
4771
4903
  return /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
4772
4904
  "button",
@@ -4797,9 +4929,9 @@ UserAvatar.displayName = "UserAvatar";
4797
4929
  // src/theme/default/components/ui/user-menu.tsx
4798
4930
  var import_jsx_runtime86 = require("react/jsx-runtime");
4799
4931
  var UserMenu = ({ session }) => {
4800
- const { config } = (0, import_elements_react17.useOryFlow)();
4932
+ const config = (0, import_elements_react17.useOryConfiguration)();
4801
4933
  const initials = getUserInitials(session);
4802
- const logoutFlow = useClientLogout(config);
4934
+ const { logoutFlow } = useClientLogout(config);
4803
4935
  return /* @__PURE__ */ (0, import_jsx_runtime86.jsxs)(DropdownMenu, { children: [
4804
4936
  /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(UserAvatar, { initials, title: "User Menu" }) }),
4805
4937
  /* @__PURE__ */ (0, import_jsx_runtime86.jsxs)(DropdownMenuContent, { children: [
@@ -4823,24 +4955,48 @@ var UserMenu = ({ session }) => {
4823
4955
  };
4824
4956
 
4825
4957
  // src/theme/default/components/generic/page-header.tsx
4826
- var import_client7 = require("@ory/elements-react/client");
4958
+ var import_client4 = require("@ory/elements-react/client");
4959
+ var import_react_intl22 = require("react-intl");
4827
4960
  var import_jsx_runtime87 = require("react/jsx-runtime");
4828
4961
  var DefaultPageHeader = (_props) => {
4962
+ var _a;
4829
4963
  const { Card } = (0, import_elements_react18.useComponents)();
4830
- const { session } = (0, import_client7.useSession)();
4831
- return /* @__PURE__ */ (0, import_jsx_runtime87.jsx)("div", { className: "mt-16 flex max-w-screen-sm w-full md:max-w-[712px] lg:max-w-[802px] xl:max-w-[896px] flex-col gap-3 px-4", children: /* @__PURE__ */ (0, import_jsx_runtime87.jsx)("div", { className: "flex flex-col gap-12", children: /* @__PURE__ */ (0, import_jsx_runtime87.jsxs)("div", { className: "flex max-h-10 flex-1 justify-between gap-2", children: [
4832
- /* @__PURE__ */ (0, import_jsx_runtime87.jsx)("div", { className: "relative h-10 flex-1", children: /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(Card.Logo, {}) }),
4833
- /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(UserMenu, { session })
4834
- ] }) }) });
4964
+ const { session } = (0, import_client4.useSession)();
4965
+ const intl = (0, import_react_intl22.useIntl)();
4966
+ const { flow } = (0, import_elements_react18.useOryFlow)();
4967
+ const config = (0, import_elements_react18.useOryConfiguration)();
4968
+ const returnUrl = (_a = flow.return_to) != null ? _a : config.project.default_redirect_url;
4969
+ return /* @__PURE__ */ (0, import_jsx_runtime87.jsx)("div", { className: "mt-16 flex max-w-screen-sm w-full md:max-w-[712px] lg:max-w-[802px] xl:max-w-[896px] flex-col gap-3 px-4", children: /* @__PURE__ */ (0, import_jsx_runtime87.jsxs)("div", { className: "flex flex-col gap-12", children: [
4970
+ /* @__PURE__ */ (0, import_jsx_runtime87.jsxs)("div", { className: "flex max-h-10 flex-1 justify-between gap-2 items-center", children: [
4971
+ /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(Card.Logo, {}),
4972
+ /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(UserMenu, { session })
4973
+ ] }),
4974
+ returnUrl && /* @__PURE__ */ (0, import_jsx_runtime87.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime87.jsxs)(
4975
+ "a",
4976
+ {
4977
+ "data-testid": "ory/screen/settings/back-button",
4978
+ href: returnUrl,
4979
+ className: "inline-flex gap-2 items-center",
4980
+ children: [
4981
+ /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(arrow_left_default, {}),
4982
+ " ",
4983
+ intl.formatMessage({
4984
+ id: "settings.navigation-back-button",
4985
+ defaultMessage: "Back"
4986
+ })
4987
+ ]
4988
+ }
4989
+ ) })
4990
+ ] }) });
4835
4991
  };
4836
4992
 
4837
4993
  // src/theme/default/components/settings/settings-oidc.tsx
4838
- var import_react14 = require("react");
4994
+ var import_react16 = require("react");
4839
4995
  var import_react_hook_form20 = require("react-hook-form");
4840
4996
  var import_usehooks_ts2 = require("usehooks-ts");
4841
4997
 
4842
4998
  // src/theme/default/assets/icons/trash.svg
4843
- var React30 = __toESM(require("react"));
4999
+ var React29 = __toESM(require("react"));
4844
5000
  var import_jsx_runtime88 = require("react/jsx-runtime");
4845
5001
  var SvgTrash = (props) => {
4846
5002
  var _a, _b;
@@ -4880,7 +5036,7 @@ function DefaultSettingsOidc({
4880
5036
  ] });
4881
5037
  }
4882
5038
  function UnlinkRow({ button }) {
4883
- var _a, _b;
5039
+ var _a, _b, _c;
4884
5040
  const [clicked, setClicked] = (0, import_usehooks_ts2.useDebounceValue)(false, 100);
4885
5041
  const {
4886
5042
  formState: { isSubmitting }
@@ -4892,20 +5048,21 @@ function UnlinkRow({ button }) {
4892
5048
  button.onClick();
4893
5049
  setClicked(true);
4894
5050
  };
4895
- (0, import_react14.useEffect)(() => {
5051
+ (0, import_react16.useEffect)(() => {
4896
5052
  if (!isSubmitting) {
4897
5053
  setClicked(false);
4898
5054
  }
4899
5055
  }, [isSubmitting, setClicked]);
5056
+ console.log((_c = button.meta.label) == null ? void 0 : _c.context);
4900
5057
  return /* @__PURE__ */ (0, import_jsx_runtime89.jsxs)("div", { className: "flex justify-between", children: [
4901
5058
  /* @__PURE__ */ (0, import_jsx_runtime89.jsxs)("div", { className: "flex items-center gap-6", children: [
4902
- Logo ? /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(Logo, { size: 32 }) : /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(provider_logos_default.generic, { size: 32 }),
5059
+ Logo ? /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(Logo, { size: 32 }) : /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(GenericLogo, { label: provider.slice(0, 1) }),
4903
5060
  /* @__PURE__ */ (0, import_jsx_runtime89.jsx)("p", { className: "text-sm font-medium text-interface-foreground-default-secondary", children: provider })
4904
5061
  ] }),
4905
5062
  /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(
4906
5063
  "button",
4907
5064
  {
4908
- ...attrs,
5065
+ ...omitInputAttributes(attrs),
4909
5066
  type: "submit",
4910
5067
  onClick: localOnClick,
4911
5068
  disabled: isSubmitting,
@@ -5003,7 +5160,7 @@ function DefaultSettingsPasskey({
5003
5160
  }
5004
5161
 
5005
5162
  // src/theme/default/assets/icons/download.svg
5006
- var React31 = __toESM(require("react"));
5163
+ var React30 = __toESM(require("react"));
5007
5164
  var import_jsx_runtime91 = require("react/jsx-runtime");
5008
5165
  var SvgDownload = (props) => {
5009
5166
  var _a, _b;
@@ -5012,7 +5169,7 @@ var SvgDownload = (props) => {
5012
5169
  var download_default = SvgDownload;
5013
5170
 
5014
5171
  // src/theme/default/assets/icons/refresh.svg
5015
- var React32 = __toESM(require("react"));
5172
+ var React31 = __toESM(require("react"));
5016
5173
  var import_jsx_runtime92 = require("react/jsx-runtime");
5017
5174
  var SvgRefresh = (props) => {
5018
5175
  var _a, _b;
@@ -5118,7 +5275,7 @@ function DefaultSettingsRecoveryCodes({
5118
5275
  var import_elements_react20 = require("@ory/elements-react");
5119
5276
 
5120
5277
  // src/theme/default/assets/icons/qrcode.svg
5121
- var React33 = __toESM(require("react"));
5278
+ var React32 = __toESM(require("react"));
5122
5279
  var import_jsx_runtime94 = require("react/jsx-runtime");
5123
5280
  var SvgQrcode = (props) => {
5124
5281
  var _a, _b;
@@ -5226,7 +5383,7 @@ function DefaultSettingsTotp({
5226
5383
  var import_elements_react21 = require("@ory/elements-react");
5227
5384
 
5228
5385
  // src/theme/default/assets/icons/key.svg
5229
- var React34 = __toESM(require("react"));
5386
+ var React33 = __toESM(require("react"));
5230
5387
  var import_jsx_runtime96 = require("react/jsx-runtime");
5231
5388
  var SvgKey = (props) => {
5232
5389
  var _a, _b;
@@ -5338,54 +5495,59 @@ function DefaultAuthMethodListContainer({
5338
5495
  }
5339
5496
 
5340
5497
  // src/theme/default/components/form/captcha.tsx
5341
- var import_client_fetch37 = require("@ory/client-fetch");
5498
+ var import_client_fetch39 = require("@ory/client-fetch");
5342
5499
  var import_react_turnstile = require("@marsidev/react-turnstile");
5343
- var import_react15 = require("react");
5500
+ var import_react17 = require("react");
5344
5501
  var import_react_hook_form25 = require("react-hook-form");
5345
5502
  var import_jsx_runtime99 = require("react/jsx-runtime");
5346
5503
  var DefaultCaptcha = ({ node }) => {
5347
- const { setValue } = (0, import_react_hook_form25.useFormContext)();
5348
- const ref = (0, import_react15.useRef)();
5349
- const nodes = [];
5350
- if ((0, import_client_fetch37.isUiNodeInputAttributes)(node.attributes)) {
5351
- if (node.attributes.name === "transient_payload.captcha_turnstile_response") {
5352
- nodes.push(
5353
- /* @__PURE__ */ (0, import_jsx_runtime99.jsx)(DefaultInput, { node, attributes: node.attributes }, 1)
5354
- );
5504
+ const { setValue, formState } = (0, import_react_hook_form25.useFormContext)();
5505
+ const ref = (0, import_react17.useRef)();
5506
+ const prevSubmitCount = (0, import_react17.useRef)(formState.submitCount);
5507
+ (0, import_react17.useEffect)(() => {
5508
+ if (formState.submitCount > prevSubmitCount.current && formState.isSubmitSuccessful) {
5509
+ prevSubmitCount.current = formState.submitCount;
5510
+ setTimeout(() => {
5511
+ if (ref.current) {
5512
+ ref.current.reset();
5513
+ }
5514
+ }, 100);
5355
5515
  }
5516
+ }, [formState.submitCount, formState.isSubmitSuccessful]);
5517
+ if (!(0, import_client_fetch39.isUiNodeInputAttributes)(node.attributes)) {
5518
+ return null;
5356
5519
  }
5357
- if ((0, import_client_fetch37.isUiNodeInputAttributes)(node.attributes) && node.attributes.name === "captcha_turnstile_options") {
5520
+ if (node.attributes.name === "transient_payload.captcha_turnstile_response") {
5521
+ return /* @__PURE__ */ (0, import_jsx_runtime99.jsx)(DefaultInput, { node, attributes: node.attributes }, 1);
5522
+ } else if (node.attributes.name === "captcha_turnstile_options") {
5358
5523
  const options = JSON.parse(node.attributes.value);
5359
- nodes.push(
5360
- /* @__PURE__ */ (0, import_jsx_runtime99.jsx)(
5361
- import_react_turnstile.Turnstile,
5362
- {
5363
- ref,
5364
- siteKey: options.sitekey,
5365
- options: {
5366
- action: options.action,
5367
- size: "flexible",
5368
- theme: options.theme,
5369
- responseField: false,
5370
- responseFieldName: options.response_field_name
5371
- },
5372
- onExpire: () => {
5373
- var _a;
5374
- return (_a = ref.current) == null ? void 0 : _a.reset();
5375
- },
5376
- onSuccess: (token) => {
5377
- setValue(options.response_field_name, token);
5378
- }
5524
+ return /* @__PURE__ */ (0, import_jsx_runtime99.jsx)(
5525
+ import_react_turnstile.Turnstile,
5526
+ {
5527
+ ref,
5528
+ siteKey: options.sitekey,
5529
+ options: {
5530
+ action: options.action,
5531
+ size: "flexible",
5532
+ theme: options.theme,
5533
+ responseField: false,
5534
+ responseFieldName: options.response_field_name
5379
5535
  },
5380
- 2
5381
- )
5536
+ onExpire: () => {
5537
+ var _a;
5538
+ return (_a = ref.current) == null ? void 0 : _a.reset();
5539
+ },
5540
+ onSuccess: (token) => {
5541
+ setValue(options.response_field_name, token);
5542
+ }
5543
+ }
5382
5544
  );
5383
5545
  }
5384
- return nodes;
5546
+ return null;
5385
5547
  };
5386
5548
 
5387
5549
  // src/theme/default/assets/icons/personal.svg
5388
- var React35 = __toESM(require("react"));
5550
+ var React34 = __toESM(require("react"));
5389
5551
  var import_jsx_runtime100 = require("react/jsx-runtime");
5390
5552
  var SvgPersonal = (props) => {
5391
5553
  var _a, _b;
@@ -5394,7 +5556,7 @@ var SvgPersonal = (props) => {
5394
5556
  var personal_default = SvgPersonal;
5395
5557
 
5396
5558
  // src/theme/default/assets/icons/message.svg
5397
- var React36 = __toESM(require("react"));
5559
+ var React35 = __toESM(require("react"));
5398
5560
  var import_jsx_runtime101 = require("react/jsx-runtime");
5399
5561
  var SvgMessage = (props) => {
5400
5562
  var _a, _b;
@@ -5403,7 +5565,7 @@ var SvgMessage = (props) => {
5403
5565
  var message_default = SvgMessage;
5404
5566
 
5405
5567
  // src/theme/default/assets/icons/phone.svg
5406
- var React37 = __toESM(require("react"));
5568
+ var React36 = __toESM(require("react"));
5407
5569
  var import_jsx_runtime102 = require("react/jsx-runtime");
5408
5570
  var SvgPhone = (props) => {
5409
5571
  var _a, _b;
@@ -5412,7 +5574,7 @@ var SvgPhone = (props) => {
5412
5574
  var phone_default = SvgPhone;
5413
5575
 
5414
5576
  // src/theme/default/components/form/consent-scope-checkbox.tsx
5415
- var import_react_intl22 = require("react-intl");
5577
+ var import_react_intl23 = require("react-intl");
5416
5578
  var Switch = __toESM(require("@radix-ui/react-switch"));
5417
5579
  var import_jsx_runtime103 = require("react/jsx-runtime");
5418
5580
  var ScopeIcons = {
@@ -5427,7 +5589,7 @@ function DefaultConsentScopeCheckbox({
5427
5589
  onCheckedChange
5428
5590
  }) {
5429
5591
  var _a;
5430
- const intl = (0, import_react_intl22.useIntl)();
5592
+ const intl = (0, import_react_intl23.useIntl)();
5431
5593
  const Icon = (_a = ScopeIcons[attributes.value]) != null ? _a : personal_default;
5432
5594
  return /* @__PURE__ */ (0, import_jsx_runtime103.jsx)(
5433
5595
  ListItem,
@@ -5510,9 +5672,10 @@ function getOryComponents(overrides) {
5510
5672
  }
5511
5673
 
5512
5674
  // src/theme/default/flows/error.tsx
5513
- var import_client_fetch38 = require("@ory/client-fetch");
5514
- var import_react16 = require("react");
5515
- var import_react_intl23 = require("react-intl");
5675
+ var import_client_fetch40 = require("@ory/client-fetch");
5676
+ var import_elements_react22 = require("@ory/elements-react");
5677
+ var import_react18 = require("react");
5678
+ var import_react_intl24 = require("react-intl");
5516
5679
  var import_jsx_runtime104 = require("react/jsx-runtime");
5517
5680
  function isOAuth2Error(error) {
5518
5681
  return !!error && typeof error === "object" && "error" in error && "error_description" in error;
@@ -5522,7 +5685,7 @@ var errorDescriptions = {
5522
5685
  5: "The server encountered an error and could not complete your request"
5523
5686
  };
5524
5687
  function useStandardize(error) {
5525
- return (0, import_react16.useMemo)(() => {
5688
+ return (0, import_react18.useMemo)(() => {
5526
5689
  var _a;
5527
5690
  if (isOAuth2Error(error)) {
5528
5691
  return {
@@ -5532,14 +5695,14 @@ function useStandardize(error) {
5532
5695
  timestamp: /* @__PURE__ */ new Date()
5533
5696
  };
5534
5697
  }
5535
- if ((0, import_client_fetch38.instanceOfFlowError)(error)) {
5698
+ if ((0, import_client_fetch40.instanceOfFlowError)(error)) {
5536
5699
  const parsed = error.error;
5537
5700
  return {
5538
5701
  ...parsed,
5539
5702
  id: error.id,
5540
5703
  timestamp: error.created_at
5541
5704
  };
5542
- } else if (error.error && (0, import_client_fetch38.instanceOfGenericError)(error.error)) {
5705
+ } else if (error.error && (0, import_client_fetch40.instanceOfGenericError)(error.error)) {
5543
5706
  return {
5544
5707
  code: (_a = error.error.code) != null ? _a : 500,
5545
5708
  message: error.error.message,
@@ -5566,7 +5729,7 @@ function Error2({
5566
5729
  const Divider = (_d = (_c = Components == null ? void 0 : Components.Card) == null ? void 0 : _c.Divider) != null ? _d : DefaultHorizontalDivider;
5567
5730
  const parsed = useStandardize(error);
5568
5731
  const description = errorDescriptions[Math.floor(parsed.code / 100)];
5569
- return /* @__PURE__ */ (0, import_jsx_runtime104.jsx)(
5732
+ return /* @__PURE__ */ (0, import_jsx_runtime104.jsx)(import_elements_react22.OryConfigurationProvider, { sdk: config.sdk, project: config.project, children: /* @__PURE__ */ (0, import_jsx_runtime104.jsx)(
5570
5733
  IntlProvider,
5571
5734
  {
5572
5735
  locale: (_f = (_e = config.intl) == null ? void 0 : _e.locale) != null ? _f : "en",
@@ -5578,22 +5741,22 @@ function Error2({
5578
5741
  "data-testid": "ory/screen/error",
5579
5742
  children: [
5580
5743
  /* @__PURE__ */ (0, import_jsx_runtime104.jsxs)("header", { className: "flex flex-col gap-8 antialiased", children: [
5581
- /* @__PURE__ */ (0, import_jsx_runtime104.jsx)(ErrorLogo, { config }),
5744
+ /* @__PURE__ */ (0, import_jsx_runtime104.jsx)(ErrorLogo, {}),
5582
5745
  /* @__PURE__ */ (0, import_jsx_runtime104.jsxs)("div", { className: "flex flex-col gap-2", children: [
5583
- /* @__PURE__ */ (0, import_jsx_runtime104.jsx)("h2", { className: "text-lg font-semibold leading-normal text-interface-foreground-default-primary", children: /* @__PURE__ */ (0, import_jsx_runtime104.jsx)(import_react_intl23.FormattedMessage, { id: "error.title.what-happened" }) }),
5746
+ /* @__PURE__ */ (0, import_jsx_runtime104.jsx)("h2", { className: "text-lg font-semibold leading-normal text-interface-foreground-default-primary", children: /* @__PURE__ */ (0, import_jsx_runtime104.jsx)(import_react_intl24.FormattedMessage, { id: "error.title.what-happened" }) }),
5584
5747
  /* @__PURE__ */ (0, import_jsx_runtime104.jsx)("p", { className: "leading-normal text-interface-foreground-default-secondary", children: (_h = parsed.message) != null ? _h : description }),
5585
5748
  parsed.reason && /* @__PURE__ */ (0, import_jsx_runtime104.jsx)("p", { className: "leading-normal text-interface-foreground-default-secondary", children: parsed.reason })
5586
5749
  ] })
5587
5750
  ] }),
5588
5751
  /* @__PURE__ */ (0, import_jsx_runtime104.jsx)(Divider, {}),
5589
5752
  /* @__PURE__ */ (0, import_jsx_runtime104.jsxs)("div", { className: "flex flex-col gap-2", children: [
5590
- /* @__PURE__ */ (0, import_jsx_runtime104.jsx)("h2", { className: "text-lg font-semibold leading-normal text-interface-foreground-default-primary", children: /* @__PURE__ */ (0, import_jsx_runtime104.jsx)(import_react_intl23.FormattedMessage, { id: "error.title.what-can-i-do" }) }),
5591
- /* @__PURE__ */ (0, import_jsx_runtime104.jsx)("p", { className: "leading-normal text-interface-foreground-default-secondary", children: /* @__PURE__ */ (0, import_jsx_runtime104.jsx)(import_react_intl23.FormattedMessage, { id: "error.instructions" }) }),
5592
- /* @__PURE__ */ (0, import_jsx_runtime104.jsx)("div", { children: session ? /* @__PURE__ */ (0, import_jsx_runtime104.jsx)(LoggedInActions, { config }) : /* @__PURE__ */ (0, import_jsx_runtime104.jsx)(GoBackButton, { config }) })
5753
+ /* @__PURE__ */ (0, import_jsx_runtime104.jsx)("h2", { className: "text-lg font-semibold leading-normal text-interface-foreground-default-primary", children: /* @__PURE__ */ (0, import_jsx_runtime104.jsx)(import_react_intl24.FormattedMessage, { id: "error.title.what-can-i-do" }) }),
5754
+ /* @__PURE__ */ (0, import_jsx_runtime104.jsx)("p", { className: "leading-normal text-interface-foreground-default-secondary", children: /* @__PURE__ */ (0, import_jsx_runtime104.jsx)(import_react_intl24.FormattedMessage, { id: "error.instructions" }) }),
5755
+ /* @__PURE__ */ (0, import_jsx_runtime104.jsx)("div", { children: session ? /* @__PURE__ */ (0, import_jsx_runtime104.jsx)(LoggedInActions, {}) : /* @__PURE__ */ (0, import_jsx_runtime104.jsx)(GoBackButton, {}) })
5593
5756
  ] }),
5594
5757
  /* @__PURE__ */ (0, import_jsx_runtime104.jsx)(Divider, {}),
5595
5758
  /* @__PURE__ */ (0, import_jsx_runtime104.jsxs)("div", { className: "font-normal leading-normal antialiased gap-2 flex flex-col", children: [
5596
- /* @__PURE__ */ (0, import_jsx_runtime104.jsx)("span", { className: "text-interface-foreground-default-primary text-sm", children: /* @__PURE__ */ (0, import_jsx_runtime104.jsx)(import_react_intl23.FormattedMessage, { id: "error.footer.text" }) }),
5759
+ /* @__PURE__ */ (0, import_jsx_runtime104.jsx)("span", { className: "text-interface-foreground-default-primary text-sm", children: /* @__PURE__ */ (0, import_jsx_runtime104.jsx)(import_react_intl24.FormattedMessage, { id: "error.footer.text" }) }),
5597
5760
  parsed.id && /* @__PURE__ */ (0, import_jsx_runtime104.jsxs)("p", { className: "text-interface-foreground-default-secondary text-sm", children: [
5598
5761
  "ID: ",
5599
5762
  /* @__PURE__ */ (0, import_jsx_runtime104.jsx)("code", { children: parsed.id })
@@ -5618,7 +5781,7 @@ ${parsed.reason ? `Message: ${parsed.reason}` : ""}
5618
5781
  `;
5619
5782
  void navigator.clipboard.writeText(text);
5620
5783
  },
5621
- children: /* @__PURE__ */ (0, import_jsx_runtime104.jsx)(import_react_intl23.FormattedMessage, { id: "error.footer.copy" })
5784
+ children: /* @__PURE__ */ (0, import_jsx_runtime104.jsx)(import_react_intl24.FormattedMessage, { id: "error.footer.copy" })
5622
5785
  }
5623
5786
  ) })
5624
5787
  ] })
@@ -5626,42 +5789,45 @@ ${parsed.reason ? `Message: ${parsed.reason}` : ""}
5626
5789
  }
5627
5790
  ) })
5628
5791
  }
5629
- );
5792
+ ) });
5630
5793
  }
5631
- function LoggedInActions({ config }) {
5632
- const logoutFlow = useClientLogout(config);
5794
+ function LoggedInActions() {
5795
+ const config = (0, import_elements_react22.useOryConfiguration)();
5796
+ const { logoutFlow } = useClientLogout(config);
5633
5797
  return /* @__PURE__ */ (0, import_jsx_runtime104.jsx)(
5634
5798
  "a",
5635
5799
  {
5636
5800
  href: logoutFlow == null ? void 0 : logoutFlow.logout_url,
5637
5801
  className: "text-interface-foreground-default-primary underline",
5638
- children: "Logout"
5802
+ children: /* @__PURE__ */ (0, import_jsx_runtime104.jsx)(import_react_intl24.FormattedMessage, { id: "login.logout-button" })
5639
5803
  }
5640
5804
  );
5641
5805
  }
5642
- function GoBackButton({ config }) {
5806
+ function GoBackButton() {
5807
+ const config = (0, import_elements_react22.useOryConfiguration)();
5643
5808
  if ("default_redirect_url" in config.project) {
5644
5809
  return /* @__PURE__ */ (0, import_jsx_runtime104.jsx)(
5645
5810
  "a",
5646
5811
  {
5647
5812
  className: "text-interface-foreground-default-primary underline",
5648
5813
  href: config.project.default_redirect_url,
5649
- children: /* @__PURE__ */ (0, import_jsx_runtime104.jsx)(import_react_intl23.FormattedMessage, { id: "error.action.go-back" })
5814
+ children: /* @__PURE__ */ (0, import_jsx_runtime104.jsx)(import_react_intl24.FormattedMessage, { id: "error.action.go-back" })
5650
5815
  }
5651
5816
  );
5652
5817
  }
5653
5818
  return null;
5654
5819
  }
5655
- function ErrorLogo({ config }) {
5656
- if (config.logoUrl) {
5657
- return /* @__PURE__ */ (0, import_jsx_runtime104.jsx)("img", { src: config.logoUrl, width: 100, height: 36, alt: "Logo" });
5820
+ function ErrorLogo() {
5821
+ const { project } = (0, import_elements_react22.useOryConfiguration)();
5822
+ if (project.logo_light_url) {
5823
+ return /* @__PURE__ */ (0, import_jsx_runtime104.jsx)("img", { src: project.logo_light_url, width: 100, height: 36, alt: "Logo" });
5658
5824
  }
5659
- return /* @__PURE__ */ (0, import_jsx_runtime104.jsx)("h1", { className: "text-xl font-semibold leading-normal text-interface-foreground-default-primary", children: config.name });
5825
+ return /* @__PURE__ */ (0, import_jsx_runtime104.jsx)("h1", { className: "text-xl font-semibold leading-normal text-interface-foreground-default-primary", children: project.name });
5660
5826
  }
5661
5827
 
5662
5828
  // src/theme/default/flows/login.tsx
5663
- var import_client_fetch39 = require("@ory/client-fetch");
5664
- var import_elements_react22 = require("@ory/elements-react");
5829
+ var import_client_fetch41 = require("@ory/client-fetch");
5830
+ var import_elements_react23 = require("@ory/elements-react");
5665
5831
  var import_jsx_runtime105 = require("react/jsx-runtime");
5666
5832
  function Login({
5667
5833
  flow,
@@ -5671,20 +5837,20 @@ function Login({
5671
5837
  }) {
5672
5838
  const components = getOryComponents(flowOverrideComponents);
5673
5839
  return /* @__PURE__ */ (0, import_jsx_runtime105.jsx)(
5674
- import_elements_react22.OryProvider,
5840
+ import_elements_react23.OryProvider,
5675
5841
  {
5676
5842
  config,
5677
5843
  flow,
5678
- flowType: import_client_fetch39.FlowType.Login,
5844
+ flowType: import_client_fetch41.FlowType.Login,
5679
5845
  components,
5680
- children: children != null ? children : /* @__PURE__ */ (0, import_jsx_runtime105.jsx)(import_elements_react22.OryTwoStepCard, {})
5846
+ children: children != null ? children : /* @__PURE__ */ (0, import_jsx_runtime105.jsx)(import_elements_react23.OryTwoStepCard, {})
5681
5847
  }
5682
5848
  );
5683
5849
  }
5684
5850
 
5685
5851
  // src/theme/default/flows/recovery.tsx
5686
- var import_client_fetch40 = require("@ory/client-fetch");
5687
- var import_elements_react23 = require("@ory/elements-react");
5852
+ var import_client_fetch42 = require("@ory/client-fetch");
5853
+ var import_elements_react24 = require("@ory/elements-react");
5688
5854
  var import_jsx_runtime106 = require("react/jsx-runtime");
5689
5855
  function Recovery({
5690
5856
  flow,
@@ -5694,20 +5860,20 @@ function Recovery({
5694
5860
  }) {
5695
5861
  const components = getOryComponents(flowOverrideComponents);
5696
5862
  return /* @__PURE__ */ (0, import_jsx_runtime106.jsx)(
5697
- import_elements_react23.OryProvider,
5863
+ import_elements_react24.OryProvider,
5698
5864
  {
5699
5865
  config,
5700
5866
  flow,
5701
- flowType: import_client_fetch40.FlowType.Recovery,
5867
+ flowType: import_client_fetch42.FlowType.Recovery,
5702
5868
  components,
5703
- children: children != null ? children : /* @__PURE__ */ (0, import_jsx_runtime106.jsx)(import_elements_react23.OryTwoStepCard, {})
5869
+ children: children != null ? children : /* @__PURE__ */ (0, import_jsx_runtime106.jsx)(import_elements_react24.OryTwoStepCard, {})
5704
5870
  }
5705
5871
  );
5706
5872
  }
5707
5873
 
5708
5874
  // src/theme/default/flows/registration.tsx
5709
- var import_client_fetch41 = require("@ory/client-fetch");
5710
- var import_elements_react24 = require("@ory/elements-react");
5875
+ var import_client_fetch43 = require("@ory/client-fetch");
5876
+ var import_elements_react25 = require("@ory/elements-react");
5711
5877
  var import_jsx_runtime107 = require("react/jsx-runtime");
5712
5878
  function Registration({
5713
5879
  flow,
@@ -5717,20 +5883,20 @@ function Registration({
5717
5883
  }) {
5718
5884
  const components = getOryComponents(flowOverrideComponents);
5719
5885
  return /* @__PURE__ */ (0, import_jsx_runtime107.jsx)(
5720
- import_elements_react24.OryProvider,
5886
+ import_elements_react25.OryProvider,
5721
5887
  {
5722
5888
  config,
5723
5889
  flow,
5724
- flowType: import_client_fetch41.FlowType.Registration,
5890
+ flowType: import_client_fetch43.FlowType.Registration,
5725
5891
  components,
5726
- children: children != null ? children : /* @__PURE__ */ (0, import_jsx_runtime107.jsx)(import_elements_react24.OryTwoStepCard, {})
5892
+ children: children != null ? children : /* @__PURE__ */ (0, import_jsx_runtime107.jsx)(import_elements_react25.OryTwoStepCard, {})
5727
5893
  }
5728
5894
  );
5729
5895
  }
5730
5896
 
5731
5897
  // src/theme/default/flows/settings.tsx
5732
- var import_client_fetch42 = require("@ory/client-fetch");
5733
- var import_elements_react25 = require("@ory/elements-react");
5898
+ var import_client_fetch44 = require("@ory/client-fetch");
5899
+ var import_elements_react26 = require("@ory/elements-react");
5734
5900
  var import_jsx_runtime108 = require("react/jsx-runtime");
5735
5901
  function Settings({
5736
5902
  flow,
@@ -5740,23 +5906,23 @@ function Settings({
5740
5906
  }) {
5741
5907
  const components = getOryComponents(flowOverrideComponents);
5742
5908
  return /* @__PURE__ */ (0, import_jsx_runtime108.jsx)(
5743
- import_elements_react25.OryProvider,
5909
+ import_elements_react26.OryProvider,
5744
5910
  {
5745
5911
  config,
5746
5912
  flow,
5747
- flowType: import_client_fetch42.FlowType.Settings,
5913
+ flowType: import_client_fetch44.FlowType.Settings,
5748
5914
  components,
5749
5915
  children: children != null ? children : /* @__PURE__ */ (0, import_jsx_runtime108.jsxs)(import_jsx_runtime108.Fragment, { children: [
5750
- /* @__PURE__ */ (0, import_jsx_runtime108.jsx)(import_elements_react25.HeadlessPageHeader, {}),
5751
- /* @__PURE__ */ (0, import_jsx_runtime108.jsx)(import_elements_react25.OrySettingsCard, {})
5916
+ /* @__PURE__ */ (0, import_jsx_runtime108.jsx)(import_elements_react26.HeadlessPageHeader, {}),
5917
+ /* @__PURE__ */ (0, import_jsx_runtime108.jsx)(import_elements_react26.OrySettingsCard, {})
5752
5918
  ] })
5753
5919
  }
5754
5920
  );
5755
5921
  }
5756
5922
 
5757
5923
  // src/theme/default/flows/verification.tsx
5758
- var import_client_fetch43 = require("@ory/client-fetch");
5759
- var import_elements_react26 = require("@ory/elements-react");
5924
+ var import_client_fetch45 = require("@ory/client-fetch");
5925
+ var import_elements_react27 = require("@ory/elements-react");
5760
5926
  var import_jsx_runtime109 = require("react/jsx-runtime");
5761
5927
  function Verification({
5762
5928
  flow,
@@ -5766,23 +5932,23 @@ function Verification({
5766
5932
  }) {
5767
5933
  const components = getOryComponents(flowOverrideComponents);
5768
5934
  return /* @__PURE__ */ (0, import_jsx_runtime109.jsx)(
5769
- import_elements_react26.OryProvider,
5935
+ import_elements_react27.OryProvider,
5770
5936
  {
5771
5937
  config,
5772
5938
  flow,
5773
- flowType: import_client_fetch43.FlowType.Verification,
5939
+ flowType: import_client_fetch45.FlowType.Verification,
5774
5940
  components,
5775
- children: children != null ? children : /* @__PURE__ */ (0, import_jsx_runtime109.jsx)(import_elements_react26.OryTwoStepCard, {})
5941
+ children: children != null ? children : /* @__PURE__ */ (0, import_jsx_runtime109.jsx)(import_elements_react27.OryTwoStepCard, {})
5776
5942
  }
5777
5943
  );
5778
5944
  }
5779
5945
 
5780
5946
  // src/theme/default/flows/consent.tsx
5781
- var import_client_fetch45 = require("@ory/client-fetch");
5782
- var import_elements_react27 = require("@ory/elements-react");
5947
+ var import_client_fetch47 = require("@ory/client-fetch");
5948
+ var import_elements_react28 = require("@ory/elements-react");
5783
5949
 
5784
5950
  // src/theme/default/utils/oauth2.ts
5785
- var import_client_fetch44 = require("@ory/client-fetch");
5951
+ var import_client_fetch46 = require("@ory/client-fetch");
5786
5952
  var rememberCheckbox = {
5787
5953
  type: "input",
5788
5954
  group: "oauth2_consent",
@@ -5790,7 +5956,7 @@ var rememberCheckbox = {
5790
5956
  label: {
5791
5957
  id: 9999111,
5792
5958
  text: "Remember my decision",
5793
- type: import_client_fetch44.UiTextTypeEnum.Info
5959
+ type: import_client_fetch46.UiTextTypeEnum.Info
5794
5960
  }
5795
5961
  },
5796
5962
  attributes: {
@@ -5809,7 +5975,7 @@ var acceptButton = {
5809
5975
  label: {
5810
5976
  id: 9999111,
5811
5977
  text: "Accept",
5812
- type: import_client_fetch44.UiTextTypeEnum.Info
5978
+ type: import_client_fetch46.UiTextTypeEnum.Info
5813
5979
  }
5814
5980
  },
5815
5981
  attributes: {
@@ -5828,7 +5994,7 @@ var rejectButton = {
5828
5994
  label: {
5829
5995
  id: 9999111,
5830
5996
  text: "Reject",
5831
- type: import_client_fetch44.UiTextTypeEnum.Info
5997
+ type: import_client_fetch46.UiTextTypeEnum.Info
5832
5998
  }
5833
5999
  },
5834
6000
  attributes: {
@@ -5875,7 +6041,7 @@ function scopesToUiNodes(scopes) {
5875
6041
  label: {
5876
6042
  id: 9999111,
5877
6043
  text: scope,
5878
- type: import_client_fetch44.UiTextTypeEnum.Info
6044
+ type: import_client_fetch46.UiTextTypeEnum.Info
5879
6045
  }
5880
6046
  },
5881
6047
  attributes: {
@@ -5938,13 +6104,13 @@ function Consent({
5938
6104
  session
5939
6105
  );
5940
6106
  return /* @__PURE__ */ (0, import_jsx_runtime110.jsx)(
5941
- import_elements_react27.OryProvider,
6107
+ import_elements_react28.OryProvider,
5942
6108
  {
5943
6109
  config,
5944
6110
  flow,
5945
- flowType: import_client_fetch45.FlowType.OAuth2Consent,
6111
+ flowType: import_client_fetch47.FlowType.OAuth2Consent,
5946
6112
  components,
5947
- children: children != null ? children : /* @__PURE__ */ (0, import_jsx_runtime110.jsx)(import_elements_react27.OryConsentCard, {})
6113
+ children: children != null ? children : /* @__PURE__ */ (0, import_jsx_runtime110.jsx)(import_elements_react28.OryConsentCard, {})
5948
6114
  }
5949
6115
  );
5950
6116
  }