@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.
package/dist/index.mjs CHANGED
@@ -1,5 +1,5 @@
1
- import { UiNodeGroupEnum, isUiNodeInputAttributes, isUiNodeAnchorAttributes, isUiNodeImageAttributes, isUiNodeScriptAttributes, FlowType, isUiNodeTextAttributes, UiNodeInputAttributesTypeEnum, handleContinueWith, handleFlowError, settingsUrl, isResponseError, loginUrl, recoveryUrl, verificationUrl, registrationUrl, Configuration, FrontendApi, instanceOfContinueWithRecoveryUi } from '@ory/client-fetch';
2
- import { createContext, useContext, useState, useMemo, useReducer, useRef, useEffect } from 'react';
1
+ import { UiNodeGroupEnum, isUiNodeInputAttributes, isUiNodeAnchorAttributes, isUiNodeImageAttributes, isUiNodeScriptAttributes, FlowType, getNodeId, Configuration, FrontendApi, isUiNodeTextAttributes, UiNodeInputAttributesTypeEnum, handleContinueWith, handleFlowError, settingsUrl, isResponseError, loginUrl, recoveryUrl, verificationUrl, registrationUrl, instanceOfContinueWithRecoveryUi } from '@ory/client-fetch';
2
+ import { createContext, useContext, useRef, useState, useMemo, useReducer, useEffect } from 'react';
3
3
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
4
4
  import { useIntl, IntlProvider as IntlProvider$1 } from 'react-intl';
5
5
  import { useFormContext, useForm, FormProvider } from 'react-hook-form';
@@ -48,13 +48,18 @@ var defaultNodeOrder = [
48
48
  ];
49
49
  function defaultNodeSorter(a, b) {
50
50
  var _a, _b;
51
+ const aIsCaptcha = a.group === "captcha";
52
+ const bIsCaptcha = b.group === "captcha";
53
+ const aIsSubmit = isUiNodeInputAttributes(a.attributes) && a.attributes.type === "submit";
54
+ const bIsSubmit = isUiNodeInputAttributes(b.attributes) && b.attributes.type === "submit";
55
+ if (aIsCaptcha && bIsSubmit) {
56
+ return -1;
57
+ }
58
+ if (bIsCaptcha && aIsSubmit) {
59
+ return 1;
60
+ }
51
61
  const aGroupWeight = (_a = defaultNodeOrder.indexOf(a.group)) != null ? _a : 999;
52
62
  const bGroupWeight = (_b = defaultNodeOrder.indexOf(b.group)) != null ? _b : 999;
53
- if (b.group === "captcha" && isUiNodeInputAttributes(a.attributes) && a.attributes.type === "submit") {
54
- return aGroupWeight - (bGroupWeight - 2);
55
- } else if (a.group === "captcha" && isUiNodeInputAttributes(b.attributes) && b.attributes.type === "submit") {
56
- return aGroupWeight - 2 - bGroupWeight;
57
- }
58
63
  return aGroupWeight - bGroupWeight;
59
64
  }
60
65
  var defaultGroupOrder = [
@@ -401,6 +406,110 @@ function OryFlowProvider({
401
406
  }
402
407
  );
403
408
  }
409
+
410
+ // src/client/config.ts
411
+ function isProduction() {
412
+ var _a, _b;
413
+ return ["production", "prod"].indexOf(
414
+ (_b = (_a = process.env.VERCEL_ENV) != null ? _a : process.env.NODE_ENV) != null ? _b : ""
415
+ ) > -1;
416
+ }
417
+ function frontendClient(sdkUrl, opts = {}) {
418
+ const config = new Configuration({
419
+ ...opts,
420
+ basePath: sdkUrl,
421
+ credentials: "include",
422
+ headers: {
423
+ Accept: "application/json",
424
+ ...opts.headers
425
+ }
426
+ });
427
+ return new FrontendApi(config);
428
+ }
429
+ var defaultProject = {
430
+ name: "Ory",
431
+ registration_enabled: true,
432
+ verification_enabled: true,
433
+ recovery_enabled: true,
434
+ recovery_ui_url: "/ui/recovery",
435
+ registration_ui_url: "/ui/registration",
436
+ verification_ui_url: "/ui/verification",
437
+ login_ui_url: "/ui/login",
438
+ settings_ui_url: "/ui/settings",
439
+ default_redirect_url: "/ui/welcome",
440
+ error_ui_url: "/ui/error",
441
+ default_locale: "en",
442
+ locale_behavior: "force_default"
443
+ };
444
+ function useOryConfiguration() {
445
+ const configCtx = useContext(OryConfigurationContext);
446
+ return {
447
+ sdk: {
448
+ ...configCtx.sdk,
449
+ frontend: frontendClient(configCtx.sdk.url, configCtx.sdk.options)
450
+ },
451
+ project: {
452
+ ...configCtx.project
453
+ }
454
+ };
455
+ }
456
+ var OryConfigurationContext = createContext({
457
+ sdk: computeSdkConfig({}),
458
+ project: defaultProject
459
+ });
460
+ function OryConfigurationProvider({
461
+ children,
462
+ sdk: initialConfig,
463
+ project
464
+ }) {
465
+ const configRef = useRef({
466
+ sdk: computeSdkConfig(initialConfig),
467
+ project: {
468
+ ...defaultProject,
469
+ ...project
470
+ }
471
+ });
472
+ return /* @__PURE__ */ jsx(OryConfigurationContext.Provider, { value: configRef.current, children });
473
+ }
474
+ function computeSdkConfig(config) {
475
+ if ((config == null ? void 0 : config.url) && typeof config.url === "string") {
476
+ console.debug("Using sdk url from config");
477
+ return {
478
+ url: config.url.replace(/\/$/, ""),
479
+ options: config.options || {}
480
+ };
481
+ }
482
+ return {
483
+ url: getSDKUrl(),
484
+ options: (config == null ? void 0 : config.options) || {}
485
+ };
486
+ }
487
+ function getSDKUrl() {
488
+ var _a;
489
+ if (typeof process !== "undefined" && process.versions && process.versions.node) {
490
+ if (isProduction()) {
491
+ const sdkUrl = (_a = process.env["NEXT_PUBLIC_ORY_SDK_URL"]) != null ? _a : process.env["ORY_SDK_URL"];
492
+ if (!sdkUrl) {
493
+ throw new Error(
494
+ "Unable to determine SDK URL. Please set NEXT_PUBLIC_ORY_SDK_URL and/or ORY_SDK_URL in production environments."
495
+ );
496
+ }
497
+ return sdkUrl.replace(/\/$/, "");
498
+ } else {
499
+ if (process.env["__NEXT_PRIVATE_ORIGIN"]) {
500
+ return process.env["__NEXT_PRIVATE_ORIGIN"].replace(/\/$/, "");
501
+ } else if (process.env["VERCEL_URL"]) {
502
+ return `https://${process.env["VERCEL_URL"]}`.replace(/\/$/, "");
503
+ }
504
+ }
505
+ }
506
+ if (typeof window !== "undefined") {
507
+ return window.location.origin;
508
+ }
509
+ throw new Error(
510
+ "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."
511
+ );
512
+ }
404
513
  function mergeTranslations(customTranslations) {
405
514
  return Object.keys(customTranslations).reduce((acc, key) => {
406
515
  acc[key] = { ...OryLocales[key], ...customTranslations[key] };
@@ -430,17 +539,18 @@ var IntlProvider = ({
430
539
  function OryProvider({
431
540
  children,
432
541
  components: Components,
542
+ config,
433
543
  ...oryFlowProps
434
544
  }) {
435
545
  var _a, _b, _c;
436
- return /* @__PURE__ */ jsx(
546
+ return /* @__PURE__ */ jsx(OryConfigurationProvider, { sdk: config.sdk, project: config.project, children: /* @__PURE__ */ jsx(
437
547
  IntlProvider,
438
548
  {
439
- locale: (_b = (_a = oryFlowProps.config.intl) == null ? void 0 : _a.locale) != null ? _b : "en",
440
- customTranslations: (_c = oryFlowProps.config.intl) == null ? void 0 : _c.customTranslations,
549
+ locale: (_b = (_a = config.intl) == null ? void 0 : _a.locale) != null ? _b : "en",
550
+ customTranslations: (_c = config.intl) == null ? void 0 : _c.customTranslations,
441
551
  children: /* @__PURE__ */ jsx(OryFlowProvider, { ...oryFlowProps, children: /* @__PURE__ */ jsx(OryComponentProvider, { components: Components, children }) })
442
552
  }
443
- );
553
+ ) });
444
554
  }
445
555
  function OryCardHeader() {
446
556
  const { Card } = useComponents();
@@ -559,17 +669,6 @@ function OryCardContent({ children }) {
559
669
  const { Card } = useComponents();
560
670
  return /* @__PURE__ */ jsx(Card.Content, { children });
561
671
  }
562
- function frontendClient(sdkUrl, opts = {}) {
563
- const config = new Configuration({
564
- ...opts,
565
- basePath: sdkUrl,
566
- headers: {
567
- Accept: "application/json",
568
- ...opts.headers
569
- }
570
- });
571
- return new FrontendApi(config);
572
- }
573
672
 
574
673
  // src/util/internal.ts
575
674
  function replaceWindowFlowId(flow) {
@@ -579,7 +678,7 @@ function replaceWindowFlowId(flow) {
579
678
  }
580
679
 
581
680
  // src/util/onSubmitLogin.ts
582
- async function onSubmitLogin({ config, flow }, {
681
+ async function onSubmitLogin({ flow }, config, {
583
682
  setFlowContainer,
584
683
  body,
585
684
  onRedirect
@@ -608,7 +707,6 @@ async function onSubmitLogin({ config, flow }, {
608
707
  },
609
708
  onValidationError: (body2) => {
610
709
  setFlowContainer({
611
- config,
612
710
  flow: body2,
613
711
  flowType: FlowType.Login
614
712
  });
@@ -617,18 +715,12 @@ async function onSubmitLogin({ config, flow }, {
617
715
  })
618
716
  );
619
717
  }
620
- async function onSubmitRecovery({ config, flow }, {
718
+ async function onSubmitRecovery({ flow }, config, {
621
719
  setFlowContainer,
622
720
  body,
623
721
  onRedirect
624
722
  }) {
625
- var _a;
626
- if (!config.sdk.url) {
627
- throw new Error(
628
- `Please supply your Ory Network SDK url to the Ory Elements configuration.`
629
- );
630
- }
631
- await frontendClient(config.sdk.url, (_a = config.sdk.options) != null ? _a : {}).updateRecoveryFlowRaw({
723
+ await config.sdk.frontend.updateRecoveryFlowRaw({
632
724
  flow: flow.id,
633
725
  updateRecoveryFlowBody: body
634
726
  }).then(async (res) => {
@@ -641,8 +733,7 @@ async function onSubmitRecovery({ config, flow }, {
641
733
  }
642
734
  setFlowContainer({
643
735
  flow: flow2,
644
- flowType: FlowType.Recovery,
645
- config
736
+ flowType: FlowType.Recovery
646
737
  });
647
738
  }).catch(
648
739
  handleFlowError({
@@ -660,8 +751,7 @@ async function onSubmitRecovery({ config, flow }, {
660
751
  } else {
661
752
  setFlowContainer({
662
753
  flow: body2,
663
- flowType: FlowType.Recovery,
664
- config
754
+ flowType: FlowType.Recovery
665
755
  });
666
756
  }
667
757
  },
@@ -682,19 +772,12 @@ function handleContinueWithRecoveryUIError(error, config, onRedirect) {
682
772
  }
683
773
  onRedirect(recoveryUrl(config), true);
684
774
  }
685
- async function onSubmitRegistration({ config, flow }, {
775
+ async function onSubmitRegistration({ flow }, config, {
686
776
  setFlowContainer,
687
777
  body,
688
778
  onRedirect
689
779
  }) {
690
- var _a;
691
- if (!config.sdk.url) {
692
- throw new Error(
693
- `Please supply your Ory Network SDK url to the Ory Elements configuration.`
694
- );
695
- }
696
- const client = frontendClient(config.sdk.url, (_a = config.sdk.options) != null ? _a : {});
697
- await client.updateRegistrationFlowRaw({
780
+ await config.sdk.frontend.updateRegistrationFlowRaw({
698
781
  flow: flow.id,
699
782
  updateRegistrationFlowBody: body
700
783
  }).then(async (res) => {
@@ -718,27 +801,19 @@ async function onSubmitRegistration({ config, flow }, {
718
801
  onValidationError: (body2) => {
719
802
  setFlowContainer({
720
803
  flow: body2,
721
- flowType: FlowType.Registration,
722
- config
804
+ flowType: FlowType.Registration
723
805
  });
724
806
  },
725
807
  onRedirect
726
808
  })
727
809
  );
728
810
  }
729
- async function onSubmitSettings({ config, flow }, {
811
+ async function onSubmitSettings({ flow }, config, {
730
812
  setFlowContainer,
731
813
  body,
732
814
  onRedirect
733
815
  }) {
734
- var _a;
735
- if (!config.sdk.url) {
736
- throw new Error(
737
- `Please supply your Ory Network SDK url to the Ory Elements configuration.`
738
- );
739
- }
740
- const client = frontendClient(config.sdk.url, (_a = config.sdk.options) != null ? _a : {});
741
- await client.updateSettingsFlowRaw({
816
+ await config.sdk.frontend.updateSettingsFlowRaw({
742
817
  flow: flow.id,
743
818
  updateSettingsFlowBody: body
744
819
  }).then(async (res) => {
@@ -751,8 +826,7 @@ async function onSubmitSettings({ config, flow }, {
751
826
  }
752
827
  setFlowContainer({
753
828
  flow: body2,
754
- flowType: FlowType.Settings,
755
- config
829
+ flowType: FlowType.Settings
756
830
  });
757
831
  }).catch(
758
832
  handleFlowError({
@@ -766,8 +840,7 @@ async function onSubmitSettings({ config, flow }, {
766
840
  onValidationError: (body2) => {
767
841
  setFlowContainer({
768
842
  flow: body2,
769
- flowType: FlowType.Settings,
770
- config
843
+ flowType: FlowType.Settings
771
844
  });
772
845
  },
773
846
  onRedirect
@@ -784,25 +857,18 @@ async function onSubmitSettings({ config, flow }, {
784
857
  }
785
858
  });
786
859
  }
787
- async function onSubmitVerification({ config, flow }, {
860
+ async function onSubmitVerification({ flow }, config, {
788
861
  setFlowContainer,
789
862
  body,
790
863
  onRedirect
791
864
  }) {
792
- var _a;
793
- if (!config.sdk.url) {
794
- throw new Error(
795
- `Please supply your Ory Network SDK URL to the Ory Elements configuration.`
796
- );
797
- }
798
- await frontendClient(config.sdk.url, (_a = config.sdk.options) != null ? _a : {}).updateVerificationFlowRaw({
865
+ await config.sdk.frontend.updateVerificationFlowRaw({
799
866
  flow: flow.id,
800
867
  updateVerificationFlowBody: body
801
868
  }).then(
802
869
  async (res) => setFlowContainer({
803
870
  flow: await res.value(),
804
- flowType: FlowType.Verification,
805
- config
871
+ flowType: FlowType.Verification
806
872
  })
807
873
  ).catch(
808
874
  handleFlowError({
@@ -816,8 +882,7 @@ async function onSubmitVerification({ config, flow }, {
816
882
  onValidationError: (body2) => {
817
883
  setFlowContainer({
818
884
  flow: body2,
819
- flowType: FlowType.Verification,
820
- config
885
+ flowType: FlowType.Verification
821
886
  });
822
887
  },
823
888
  onRedirect
@@ -830,6 +895,7 @@ var supportsSelectAccountPrompt = ["google", "github"];
830
895
  function useOryFormSubmit(onAfterSubmit) {
831
896
  const flowContainer = useOryFlow();
832
897
  const methods = useFormContext();
898
+ const config = useOryConfiguration();
833
899
  const handleSuccess = (flow) => {
834
900
  flowContainer.setFlowContainer(flow);
835
901
  methods.reset(computeDefaultValues(flow.flow.ui.nodes));
@@ -846,7 +912,7 @@ function useOryFormSubmit(onAfterSubmit) {
846
912
  if (submitData.method === "code" && data.code) {
847
913
  submitData.resend = "";
848
914
  }
849
- await onSubmitLogin(flowContainer, {
915
+ await onSubmitLogin(flowContainer, config, {
850
916
  onRedirect,
851
917
  setFlowContainer: handleSuccess,
852
918
  body: submitData
@@ -860,7 +926,7 @@ function useOryFormSubmit(onAfterSubmit) {
860
926
  if (submitData.method === "code" && submitData.code) {
861
927
  submitData.resend = "";
862
928
  }
863
- await onSubmitRegistration(flowContainer, {
929
+ await onSubmitRegistration(flowContainer, config, {
864
930
  onRedirect,
865
931
  setFlowContainer: handleSuccess,
866
932
  body: submitData
@@ -868,7 +934,7 @@ function useOryFormSubmit(onAfterSubmit) {
868
934
  break;
869
935
  }
870
936
  case FlowType.Verification:
871
- await onSubmitVerification(flowContainer, {
937
+ await onSubmitVerification(flowContainer, config, {
872
938
  onRedirect,
873
939
  setFlowContainer: handleSuccess,
874
940
  body: data
@@ -881,7 +947,7 @@ function useOryFormSubmit(onAfterSubmit) {
881
947
  if (data.code) {
882
948
  submitData.email = "";
883
949
  }
884
- await onSubmitRecovery(flowContainer, {
950
+ await onSubmitRecovery(flowContainer, config, {
885
951
  onRedirect,
886
952
  setFlowContainer: handleSuccess,
887
953
  body: submitData
@@ -909,7 +975,7 @@ function useOryFormSubmit(onAfterSubmit) {
909
975
  if ("passkey_remove" in submitData) {
910
976
  submitData.method = "passkey";
911
977
  }
912
- await onSubmitSettings(flowContainer, {
978
+ await onSubmitSettings(flowContainer, config, {
913
979
  onRedirect,
914
980
  setFlowContainer: handleSuccess,
915
981
  body: submitData
@@ -1178,7 +1244,7 @@ function OryFormOidcButtons() {
1178
1244
  if (filteredNodes.length === 0) {
1179
1245
  return null;
1180
1246
  }
1181
- return /* @__PURE__ */ jsx(Form.OidcRoot, { nodes: filteredNodes, children: filteredNodes.map((node, k) => /* @__PURE__ */ jsx(
1247
+ return /* @__PURE__ */ jsx(Form.OidcRoot, { nodes: filteredNodes, children: filteredNodes.map((node) => /* @__PURE__ */ jsx(
1182
1248
  Node2.OidcButton,
1183
1249
  {
1184
1250
  node,
@@ -1191,7 +1257,7 @@ function OryFormOidcButtons() {
1191
1257
  setValue("method", node.group);
1192
1258
  }
1193
1259
  },
1194
- k
1260
+ getNodeId(node)
1195
1261
  )) });
1196
1262
  }
1197
1263
  function OryFormSocialButtonsForm() {
@@ -1229,7 +1295,7 @@ function OryTwoStepCardStateMethodActive({
1229
1295
  onAfterSubmit: handleAfterFormSubmit(dispatchFormState),
1230
1296
  children: /* @__PURE__ */ jsxs(Form.Group, { children: [
1231
1297
  ui.nodes.filter(
1232
- (n) => isUiNodeScriptAttributes(n.attributes) || n.group === UiNodeGroupEnum.Captcha || n.group === UiNodeGroupEnum.Default || n.group === UiNodeGroupEnum.Profile
1298
+ (n) => isUiNodeScriptAttributes(n.attributes) || n.group === UiNodeGroupEnum.Default || n.group === UiNodeGroupEnum.Profile
1233
1299
  ).map((node, k) => /* @__PURE__ */ jsx(Node, { node }, k)),
1234
1300
  finalNodes.sort(sortNodes).map((node, k) => /* @__PURE__ */ jsx(Node, { node }, k))
1235
1301
  ] })
@@ -1408,8 +1474,8 @@ function OryFormGroups({ groups }) {
1408
1474
  const { flowType } = useOryFlow();
1409
1475
  const { Form } = useComponents();
1410
1476
  const nodes = ui.nodes.filter((node) => groups.indexOf(node.group) > -1).sort((a, b) => nodeSorter(a, b, { flowType }));
1411
- return /* @__PURE__ */ jsx(Form.Group, { children: nodes.map((node, k) => {
1412
- return /* @__PURE__ */ jsx(Node, { node }, k);
1477
+ return /* @__PURE__ */ jsx(Form.Group, { children: nodes.map((node) => {
1478
+ return /* @__PURE__ */ jsx(Node, { node }, getNodeId(node));
1413
1479
  }) });
1414
1480
  }
1415
1481
  function OryFormSection({
@@ -1445,7 +1511,7 @@ function OryConsentCard() {
1445
1511
  /* @__PURE__ */ jsx(OryCardHeader, {}),
1446
1512
  /* @__PURE__ */ jsx(OryCardContent, { children: /* @__PURE__ */ jsxs(OryForm, { children: [
1447
1513
  /* @__PURE__ */ jsx(Card.Divider, {}),
1448
- /* @__PURE__ */ jsx(Form.Group, { children: flow.flow.ui.nodes.map((node, k) => /* @__PURE__ */ jsx(Node, { node }, k)) }),
1514
+ /* @__PURE__ */ jsx(Form.Group, { children: flow.flow.ui.nodes.map((node) => /* @__PURE__ */ jsx(Node, { node }, getNodeId(node))) }),
1449
1515
  /* @__PURE__ */ jsx(Card.Divider, {}),
1450
1516
  /* @__PURE__ */ jsx(OryCardFooter, {})
1451
1517
  ] }) })
@@ -1816,7 +1882,7 @@ function SettingsSectionContent({ group, nodes }) {
1816
1882
  "data-testid": "ory/screen/settings/group/totp",
1817
1883
  children: [
1818
1884
  /* @__PURE__ */ jsx(OrySettingsTotp, { nodes: (_a = groupedNodes.groups.totp) != null ? _a : [] }),
1819
- (_b = groupedNodes.groups.default) == null ? void 0 : _b.map((node, k) => /* @__PURE__ */ jsx(Node, { node }, k))
1885
+ (_b = groupedNodes.groups.default) == null ? void 0 : _b.map((node) => /* @__PURE__ */ jsx(Node, { node }, getNodeId(node)))
1820
1886
  ]
1821
1887
  }
1822
1888
  );
@@ -1834,7 +1900,7 @@ function SettingsSectionContent({ group, nodes }) {
1834
1900
  nodes: (_c = groupedNodes.groups.lookup_secret) != null ? _c : []
1835
1901
  }
1836
1902
  ),
1837
- (_d = groupedNodes.groups.default) == null ? void 0 : _d.map((node, k) => /* @__PURE__ */ jsx(Node, { node }, k))
1903
+ (_d = groupedNodes.groups.default) == null ? void 0 : _d.map((node) => /* @__PURE__ */ jsx(Node, { node }, getNodeId(node)))
1838
1904
  ]
1839
1905
  }
1840
1906
  );
@@ -1847,7 +1913,7 @@ function SettingsSectionContent({ group, nodes }) {
1847
1913
  "data-testid": "ory/screen/settings/group/oidc",
1848
1914
  children: [
1849
1915
  /* @__PURE__ */ jsx(OrySettingsOidc, { nodes: (_e = groupedNodes.groups.oidc) != null ? _e : [] }),
1850
- (_f = groupedNodes.groups.default) == null ? void 0 : _f.map((node, k) => /* @__PURE__ */ jsx(Node, { node }, k))
1916
+ (_f = groupedNodes.groups.default) == null ? void 0 : _f.map((node) => /* @__PURE__ */ jsx(Node, { node }, getNodeId(node)))
1851
1917
  ]
1852
1918
  }
1853
1919
  );
@@ -1860,7 +1926,7 @@ function SettingsSectionContent({ group, nodes }) {
1860
1926
  "data-testid": "ory/screen/settings/group/webauthn",
1861
1927
  children: [
1862
1928
  /* @__PURE__ */ jsx(OrySettingsWebauthn, { nodes: (_g = groupedNodes.groups.webauthn) != null ? _g : [] }),
1863
- (_h = groupedNodes.groups.default) == null ? void 0 : _h.map((node, k) => /* @__PURE__ */ jsx(Node, { node }, k))
1929
+ (_h = groupedNodes.groups.default) == null ? void 0 : _h.map((node) => /* @__PURE__ */ jsx(Node, { node }, getNodeId(node)))
1864
1930
  ]
1865
1931
  }
1866
1932
  );
@@ -1873,7 +1939,7 @@ function SettingsSectionContent({ group, nodes }) {
1873
1939
  "data-testid": "ory/screen/settings/group/passkey",
1874
1940
  children: [
1875
1941
  /* @__PURE__ */ jsx(OrySettingsPasskey, { nodes: (_i = groupedNodes.groups.passkey) != null ? _i : [] }),
1876
- (_j = groupedNodes.groups.default) == null ? void 0 : _j.map((node, k) => /* @__PURE__ */ jsx(Node, { node }, k))
1942
+ (_j = groupedNodes.groups.default) == null ? void 0 : _j.map((node) => /* @__PURE__ */ jsx(Node, { node }, getNodeId(node)))
1877
1943
  ]
1878
1944
  }
1879
1945
  );
@@ -1894,16 +1960,16 @@ function SettingsSectionContent({ group, nodes }) {
1894
1960
  id: `settings.${group}.description`
1895
1961
  }),
1896
1962
  children: [
1897
- (_k = groupedNodes.groups.default) == null ? void 0 : _k.map((node, k) => /* @__PURE__ */ jsx(Node, { node }, k)),
1963
+ (_k = groupedNodes.groups.default) == null ? void 0 : _k.map((node) => /* @__PURE__ */ jsx(Node, { node }, getNodeId(node))),
1898
1964
  nodes.filter(
1899
1965
  (node) => "type" in node.attributes && node.attributes.type !== "submit"
1900
- ).map((node, k) => /* @__PURE__ */ jsx(Node, { node }, k))
1966
+ ).map((node) => /* @__PURE__ */ jsx(Node, { node }, getNodeId(node)))
1901
1967
  ]
1902
1968
  }
1903
1969
  ),
1904
1970
  /* @__PURE__ */ jsx(Card.SettingsSectionFooter, { children: nodes.filter(
1905
1971
  (node) => "type" in node.attributes && node.attributes.type === "submit"
1906
- ).map((node, k) => /* @__PURE__ */ jsx(Node, { node }, k)) })
1972
+ ).map((node) => /* @__PURE__ */ jsx(Node, { node }, getNodeId(node))) })
1907
1973
  ]
1908
1974
  }
1909
1975
  );
@@ -1917,7 +1983,7 @@ function OrySettingsCard() {
1917
1983
  const scriptNodes = onlyScriptNodes(flow.ui.nodes);
1918
1984
  return /* @__PURE__ */ jsxs(Fragment, { children: [
1919
1985
  /* @__PURE__ */ jsx(OryCardValidationMessages, {}),
1920
- scriptNodes.map((n) => /* @__PURE__ */ jsx(Node, { node: n })),
1986
+ scriptNodes.map((n) => /* @__PURE__ */ jsx(Node, { node: n }, getNodeId(n))),
1921
1987
  uniqueGroups.entries.map(([group, nodes]) => {
1922
1988
  if (group === UiNodeGroupEnum.Default) {
1923
1989
  return null;
@@ -2224,9 +2290,11 @@ var en_default = {
2224
2290
  "card.header.parts.oidc": "a social provider",
2225
2291
  "card.header.parts.password.registration": "your {identifierLabel} and a password",
2226
2292
  "card.header.parts.password.login": "your {identifierLabel} and password",
2227
- "card.header.parts.code": "a code sent to your email",
2293
+ "card.header.parts.code": "a code sent to you",
2228
2294
  "card.header.parts.passkey": "a Passkey",
2229
2295
  "card.header.parts.webauthn": "a security key",
2296
+ "card.header.parts.totp": "your authenticator app",
2297
+ "card.header.parts.lookup_secret": "a backup recovery code",
2230
2298
  "card.header.parts.identifier-first": "your {identifierLabel}",
2231
2299
  "card.header.description.login": "Sign in with {identifierLabel}",
2232
2300
  "card.header.description.registration": "Sign up with {identifierLabel}",
@@ -2474,13 +2542,15 @@ var de_default = {
2474
2542
  "identities.messages.4010009": "Die Authentifizierungsmethode stimmt nicht mit der vorherigen Authentifizierungsmethode \xFCberein. Bitte versuchen Sie es erneut.",
2475
2543
  "identities.messages.4010010": "Die eingegebene Adresse stimmt nicht mit der Adresse \xFCberein, die Sie bei der Registrierung angegeben haben. Bitte versuchen Sie es erneut.",
2476
2544
  "input.placeholder": "{placeholder} eingeben",
2477
- "card.header.parts.code": "einem Code per E-Mail",
2545
+ "card.header.parts.code": "ein an Sie gesendeter Code",
2478
2546
  "card.header.parts.identifier-first": "Ihr {identifierLabel}",
2479
2547
  "card.header.parts.oidc": "ein sozialer Anbieter",
2480
2548
  "card.header.parts.passkey": "ein Passkey",
2481
2549
  "card.header.parts.password.login": "Ihrer {identifierLabel} und Ihrem Passwort",
2482
2550
  "card.header.parts.password.registration": "Ihrer {identifierLabel} und einem Passwort",
2483
2551
  "card.header.parts.webauthn": "ein Sicherheitsschl\xFCssel",
2552
+ "card.header.parts.totp": "deine Authentifikator-App",
2553
+ "card.header.parts.lookup_secret": "ein Backup-Wiederherstellungscode",
2484
2554
  "recovery.subtitle": "Geben Sie die mit Ihrem Konto verkn\xFCpfte E-Mail-Adresse ein, um einen einmaligen Zugangscode zu erhalten",
2485
2555
  "verification.subtitle": "Geben Sie die mit Ihrem Konto verkn\xFCpfte E-Mail-Adresse ein, um es zu best\xE4tigen",
2486
2556
  "card.header.description.login": "Melden Sie sich mit {identifierLabel} an",
@@ -2819,6 +2889,8 @@ var es_default = {
2819
2889
  "card.header.parts.code": "un c\xF3digo enviado a tu correo electr\xF3nico",
2820
2890
  "card.header.parts.passkey": "una clave de acceso",
2821
2891
  "card.header.parts.webauthn": "una clave de seguridad",
2892
+ "card.header.parts.totp": "su aplicaci\xF3n de autenticaci\xF3n",
2893
+ "card.header.parts.lookup_secret": "un c\xF3digo de recuperaci\xF3n de copia de seguridad",
2822
2894
  "card.header.parts.identifier-first": "tu {identifierLabel}",
2823
2895
  "card.header.description.login": "Iniciar sesi\xF3n con {identifierLabel}",
2824
2896
  "card.header.description.registration": "Registrarse con {identifierLabel}",
@@ -3096,10 +3168,12 @@ var fr_default = {
3096
3168
  "card.header.parts.oidc": "un fournisseur de r\xE9seaux sociaux",
3097
3169
  "card.header.parts.password.registration": "votre {identifierLabel} et un mot de passe",
3098
3170
  "card.header.parts.password.login": "votre {identifierLabel} et votre mot de passe",
3099
- "card.header.parts.code": "un code envoy\xE9 \xE0 votre adresse e-mail",
3100
3171
  "card.header.parts.passkey": "une cl\xE9 d'acc\xE8s",
3101
3172
  "card.header.parts.webauthn": "une cl\xE9 de s\xE9curit\xE9",
3102
3173
  "card.header.parts.identifier-first": "votre {identifierLabel}",
3174
+ "card.header.parts.code": "un code qui vous a \xE9t\xE9 envoy\xE9",
3175
+ "card.header.parts.totp": "votre application d'authentification",
3176
+ "card.header.parts.lookup_secret": "un code de r\xE9cup\xE9ration de secours",
3103
3177
  "card.header.description.login": "Se connecter avec {identifierLabel}",
3104
3178
  "card.header.description.registration": "S'inscrire avec {identifierLabel}",
3105
3179
  "misc.or": "ou",
@@ -3342,7 +3416,9 @@ var nl_default = {
3342
3416
  "input.placeholder": "",
3343
3417
  "card.header.description.login": "",
3344
3418
  "card.header.description.registration": "",
3345
- "card.header.parts.code": "",
3419
+ "card.header.parts.code": "een code die naar je is verzonden",
3420
+ "card.header.parts.totp": "je authenticator-app",
3421
+ "card.header.parts.lookup_secret": "een backup herstelcode",
3346
3422
  "card.header.parts.identifier-first": "",
3347
3423
  "card.header.parts.oidc": "",
3348
3424
  "card.header.parts.passkey": "",
@@ -3627,13 +3703,15 @@ var pl_default = {
3627
3703
  "input.placeholder": "",
3628
3704
  "card.header.description.login": "",
3629
3705
  "card.header.description.registration": "",
3630
- "card.header.parts.code": "",
3631
3706
  "card.header.parts.identifier-first": "",
3632
3707
  "card.header.parts.oidc": "",
3633
3708
  "card.header.parts.passkey": "",
3634
3709
  "card.header.parts.password.login": "",
3635
3710
  "card.header.parts.password.registration": "",
3636
3711
  "card.header.parts.webauthn": "",
3712
+ "card.header.parts.code": "kod wys\u0142any do Ciebie",
3713
+ "card.header.parts.totp": "Twoja aplikacja uwierzytelniaj\u0105ca",
3714
+ "card.header.parts.lookup_secret": "kod odzyskiwania kopii zapasowej",
3637
3715
  "forms.label.forgot-password": "",
3638
3716
  "login.subtitle": "",
3639
3717
  "login.subtitle-refresh": "",
@@ -3912,7 +3990,9 @@ var pt_default = {
3912
3990
  "input.placeholder": "",
3913
3991
  "card.header.description.login": "",
3914
3992
  "card.header.description.registration": "",
3915
- "card.header.parts.code": "",
3993
+ "card.header.parts.code": "um c\xF3digo enviado para voc\xEA",
3994
+ "card.header.parts.totp": "seu aplicativo autenticador",
3995
+ "card.header.parts.lookup_secret": "um c\xF3digo de recupera\xE7\xE3o de backup",
3916
3996
  "card.header.parts.identifier-first": "",
3917
3997
  "card.header.parts.oidc": "",
3918
3998
  "card.header.parts.passkey": "",
@@ -4197,7 +4277,9 @@ var sv_default = {
4197
4277
  "input.placeholder": "Ange din {placeholder}",
4198
4278
  "card.header.description.login": "Logga in med {identifierLabel}",
4199
4279
  "card.header.description.registration": "Registrera dig med {identifierLabel}",
4200
- "card.header.parts.code": "en kod skickad till din e-post",
4280
+ "card.header.parts.code": "en kod skickad till dig",
4281
+ "card.header.parts.totp": "din autentiseringsapp",
4282
+ "card.header.parts.lookup_secret": "en s\xE4kerhetskopieringskod",
4201
4283
  "card.header.parts.identifier-first": "din {identifierLabel}",
4202
4284
  "card.header.parts.oidc": "en social leverant\xF6r",
4203
4285
  "card.header.parts.passkey": "en Passkey",
@@ -4282,6 +4364,6 @@ var OryLocales = {
4282
4364
  sv: sv_default
4283
4365
  };
4284
4366
 
4285
- export { HeadlessPageHeader, OryCard, OryCardContent, OryCardFooter, OryCardHeader, OryCardValidationMessages, OryConsentCard, OryForm, OryFormGroupDivider, OryFormGroups, OryFormOidcButtons, OryFormSection, OryFormSocialButtonsForm, OryLocales, OryProvider, OrySettingsCard, OryTwoStepCard, messageTestId, uiTextToFormattedMessage, useComponents, useNodeSorter, useOryFlow };
4367
+ export { HeadlessPageHeader, OryCard, OryCardContent, OryCardFooter, OryCardHeader, OryCardValidationMessages, OryConfigurationProvider, OryConsentCard, OryForm, OryFormGroupDivider, OryFormGroups, OryFormOidcButtons, OryFormSection, OryFormSocialButtonsForm, OryLocales, OryProvider, OrySettingsCard, OryTwoStepCard, messageTestId, uiTextToFormattedMessage, useComponents, useNodeSorter, useOryConfiguration, useOryFlow };
4286
4368
  //# sourceMappingURL=index.mjs.map
4287
4369
  //# sourceMappingURL=index.mjs.map