@ory/elements-react 0.0.0-pr.4a28a8f → 0.0.0-pr.7af5f16

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
@@ -187,21 +187,32 @@ function nodesToAuthMethodGroups(nodes, excludeAuthMethods = []) {
187
187
  ].includes(group)
188
188
  );
189
189
  }
190
- function useNodesGroups(nodes) {
190
+ function useNodesGroups(nodes, { omit } = {}) {
191
191
  const groupSorter = useGroupSorter();
192
192
  const groups = useMemo(() => {
193
- var _a;
193
+ var _a, _b;
194
194
  const groups2 = {};
195
+ const groupRetained = {};
195
196
  for (const node of nodes) {
196
- if (node.type === "script") {
197
- continue;
198
- }
199
197
  const groupNodes = (_a = groups2[node.group]) != null ? _a : [];
200
198
  groupNodes.push(node);
201
199
  groups2[node.group] = groupNodes;
200
+ if ((omit == null ? void 0 : omit.includes("script")) && isUiNodeScriptAttributes(node.attributes)) {
201
+ continue;
202
+ }
203
+ if ((omit == null ? void 0 : omit.includes("input_hidden")) && isUiNodeInputAttributes(node.attributes) && node.attributes.type === "hidden") {
204
+ continue;
205
+ }
206
+ groupRetained[node.group] = ((_b = groupRetained[node.group]) != null ? _b : 0) + 1;
207
+ }
208
+ const finalGroups = {};
209
+ for (const [group, count] of Object.entries(groupRetained)) {
210
+ if (count > 0) {
211
+ finalGroups[group] = groups2[group];
212
+ }
202
213
  }
203
- return groups2;
204
- }, [nodes]);
214
+ return finalGroups;
215
+ }, [nodes, omit]);
205
216
  const entries = useMemo(
206
217
  () => Object.entries(groups).sort(([a], [b]) => groupSorter(a, b)),
207
218
  [groups, groupSorter]
@@ -261,6 +272,8 @@ function parseStateFromFlow(flow) {
261
272
  break;
262
273
  case FlowType.Settings:
263
274
  return { current: "settings" };
275
+ case FlowType.OAuth2Consent:
276
+ return { current: "method_active", method: "oauth2_consent" };
264
277
  }
265
278
  console.warn(
266
279
  `[Ory/Elements React] Encountered an unknown form state on ${flow.flowType} flow with ID ${flow.flow.id}`
@@ -374,6 +387,22 @@ function computeDefaultValues(nodes) {
374
387
  if (attrs.name === "method" || attrs.type === "submit" || typeof attrs.value === "undefined") {
375
388
  return acc;
376
389
  }
390
+ if (attrs.name.startsWith("grant_scope")) {
391
+ const scope = attrs.value;
392
+ if (Array.isArray(acc.grant_scope)) {
393
+ return {
394
+ ...acc,
395
+ // We want to have all scopes accepted by default, so that the user has to actively uncheck them.
396
+ grant_scope: [...acc.grant_scope, scope]
397
+ };
398
+ } else if (!acc.grant_scope) {
399
+ return {
400
+ ...acc,
401
+ grant_scope: [scope]
402
+ };
403
+ }
404
+ return acc;
405
+ }
377
406
  return unrollTrait(
378
407
  {
379
408
  name: attrs.name,
@@ -823,6 +852,19 @@ function useOryFormSubmit(onAfterSubmit) {
823
852
  });
824
853
  break;
825
854
  }
855
+ case FlowType.OAuth2Consent: {
856
+ const response = await fetch(flowContainer.flow.ui.action, {
857
+ method: "POST",
858
+ body: JSON.stringify(data),
859
+ headers: {
860
+ "Content-Type": "application/json"
861
+ }
862
+ });
863
+ const oauth2Success = await response.json();
864
+ if (oauth2Success.redirect_to && typeof oauth2Success.redirect_to === "string") {
865
+ onRedirect(oauth2Success.redirect_to);
866
+ }
867
+ }
826
868
  }
827
869
  if ("password" in data) {
828
870
  methods.setValue("password", "");
@@ -837,7 +879,11 @@ function useOryFormSubmit(onAfterSubmit) {
837
879
  };
838
880
  return onSubmit;
839
881
  }
840
- function OryForm({ children, onAfterSubmit }) {
882
+ function OryForm({
883
+ children,
884
+ onAfterSubmit,
885
+ "data-testid": dataTestId
886
+ }) {
841
887
  const { Form } = useComponents();
842
888
  const flowContainer = useOryFlow();
843
889
  const methods = useFormContext();
@@ -865,7 +911,7 @@ function OryForm({ children, onAfterSubmit }) {
865
911
  }),
866
912
  type: "error"
867
913
  };
868
- return /* @__PURE__ */ jsxs(Fragment, { children: [
914
+ return /* @__PURE__ */ jsxs("div", { className: "grid gap-8", "data-testid": dataTestId, children: [
869
915
  /* @__PURE__ */ jsx(Message.Root, { children: /* @__PURE__ */ jsx(Message.Content, { message: m }, m.id) }),
870
916
  /* @__PURE__ */ jsx(OryCardFooter, {})
871
917
  ] });
@@ -876,6 +922,7 @@ function OryForm({ children, onAfterSubmit }) {
876
922
  return /* @__PURE__ */ jsx(
877
923
  Form.Root,
878
924
  {
925
+ "data-testid": dataTestId,
879
926
  action: flowContainer.flow.ui.action,
880
927
  method: flowContainer.flow.ui.method,
881
928
  onSubmit: (e) => void methods.handleSubmit(onSubmit)(e),
@@ -910,7 +957,7 @@ var NodeInput = ({
910
957
  }) => {
911
958
  var _a;
912
959
  const { Node: Node2 } = useComponents();
913
- const { setValue } = useFormContext();
960
+ const { setValue, watch } = useFormContext();
914
961
  const {
915
962
  onloadTrigger,
916
963
  onclickTrigger,
@@ -923,7 +970,10 @@ var NodeInput = ({
923
970
  const isResendNode = ((_a = node.meta.label) == null ? void 0 : _a.id) === 1070008;
924
971
  const isScreenSelectionNode = "name" in node.attributes && node.attributes.name === "screen";
925
972
  const setFormValue = () => {
926
- if (attrs.value && !(isResendNode || isScreenSelectionNode)) {
973
+ if (isResendNode || isScreenSelectionNode || node.group === UiNodeGroupEnum.Oauth2Consent) {
974
+ return;
975
+ }
976
+ if (attrs.value !== void 0) {
927
977
  setValue(attrs.name, attrs.value);
928
978
  }
929
979
  };
@@ -948,6 +998,19 @@ var NodeInput = ({
948
998
  };
949
999
  const isSocial = (attrs.name === "provider" || attrs.name === "link") && (node.group === UiNodeGroupEnum.Oidc || node.group === UiNodeGroupEnum.Saml);
950
1000
  const isPinCodeInput = attrs.name === "code" && node.group === "code" || attrs.name === "totp_code" && node.group === "totp";
1001
+ const handleScopeChange = (checked) => {
1002
+ const scopes = watch("grant_scope");
1003
+ if (Array.isArray(scopes)) {
1004
+ if (checked) {
1005
+ setValue("grant_scope", Array.from(/* @__PURE__ */ new Set([...scopes, attrs.value])));
1006
+ } else {
1007
+ setValue(
1008
+ "grant_scope",
1009
+ scopes.filter((scope) => scope !== attrs.value)
1010
+ );
1011
+ }
1012
+ }
1013
+ };
951
1014
  switch (attributes.type) {
952
1015
  case UiNodeInputAttributesTypeEnum.Submit:
953
1016
  case UiNodeInputAttributesTypeEnum.Button:
@@ -957,6 +1020,9 @@ var NodeInput = ({
957
1020
  if (isResendNode || isScreenSelectionNode) {
958
1021
  return null;
959
1022
  }
1023
+ if (node.group === "oauth2_consent") {
1024
+ return null;
1025
+ }
960
1026
  return /* @__PURE__ */ jsx(
961
1027
  Node2.Label,
962
1028
  {
@@ -968,6 +1034,21 @@ var NodeInput = ({
968
1034
  case UiNodeInputAttributesTypeEnum.DatetimeLocal:
969
1035
  throw new Error("Not implemented");
970
1036
  case UiNodeInputAttributesTypeEnum.Checkbox:
1037
+ if (node.group === "oauth2_consent" && node.attributes.node_type === "input") {
1038
+ switch (node.attributes.name) {
1039
+ case "grant_scope":
1040
+ return /* @__PURE__ */ jsx(
1041
+ Node2.ConsentScopeCheckbox,
1042
+ {
1043
+ attributes: attrs,
1044
+ node,
1045
+ onCheckedChange: handleScopeChange
1046
+ }
1047
+ );
1048
+ default:
1049
+ return null;
1050
+ }
1051
+ }
971
1052
  return /* @__PURE__ */ jsx(
972
1053
  Node2.Label,
973
1054
  {
@@ -1056,11 +1137,13 @@ function OryFormSocialButtonsForm() {
1056
1137
  const {
1057
1138
  flow: { ui }
1058
1139
  } = useOryFlow();
1059
- const filteredNodes = ui.nodes.filter((node) => node.group === UiNodeGroupEnum.Saml || node.group === UiNodeGroupEnum.Oidc);
1140
+ const filteredNodes = ui.nodes.filter(
1141
+ (node) => node.group === UiNodeGroupEnum.Saml || node.group === UiNodeGroupEnum.Oidc
1142
+ );
1060
1143
  if (filteredNodes.length === 0) {
1061
1144
  return null;
1062
1145
  }
1063
- return /* @__PURE__ */ jsx(OryFormProvider, { children: /* @__PURE__ */ jsx(OryForm, { children: /* @__PURE__ */ jsx(OryFormOidcButtons, {}) }) });
1146
+ return /* @__PURE__ */ jsx(OryFormProvider, { children: /* @__PURE__ */ jsx(OryForm, { "data-testid": `ory/form/methods/oidc-saml`, children: /* @__PURE__ */ jsx(OryFormOidcButtons, {}) }) });
1064
1147
  }
1065
1148
  function isUINodeGroupEnum(method) {
1066
1149
  return Object.values(UiNodeGroupEnum).includes(method);
@@ -1072,11 +1155,14 @@ function OryTwoStepCard() {
1072
1155
  const { ui } = flow;
1073
1156
  const nodeSorter = useNodeSorter();
1074
1157
  const sortNodes = (a, b) => nodeSorter(a, b, { flowType });
1075
- const uniqueGroups = useNodesGroups(ui.nodes);
1076
- const options = Object.fromEntries(
1158
+ const groupsToShow = useNodesGroups(ui.nodes, {
1159
+ // We only want to render groups that have visible elements.
1160
+ omit: ["script", "input_hidden"]
1161
+ });
1162
+ const authMethodBlocks = Object.fromEntries(
1077
1163
  Object.values(UiNodeGroupEnum).filter((group) => {
1078
1164
  var _a2;
1079
- return (_a2 = uniqueGroups.groups[group]) == null ? void 0 : _a2.length;
1165
+ return (_a2 = groupsToShow.groups[group]) == null ? void 0 : _a2.length;
1080
1166
  }).filter(
1081
1167
  (group) => ![
1082
1168
  UiNodeGroupEnum.Oidc,
@@ -1088,7 +1174,17 @@ function OryTwoStepCard() {
1088
1174
  ].includes(group)
1089
1175
  ).map((g) => [g, {}])
1090
1176
  );
1091
- if (UiNodeGroupEnum.Code in options) {
1177
+ const authMethodAdditionalNodes = ui.nodes.filter(
1178
+ ({ group }) => [
1179
+ UiNodeGroupEnum.Oidc,
1180
+ UiNodeGroupEnum.Saml,
1181
+ UiNodeGroupEnum.Default,
1182
+ UiNodeGroupEnum.IdentifierFirst,
1183
+ UiNodeGroupEnum.Profile,
1184
+ UiNodeGroupEnum.Captcha
1185
+ ].includes(group)
1186
+ );
1187
+ if (UiNodeGroupEnum.Code in authMethodBlocks) {
1092
1188
  let identifier = (_b = (_a = findNode(ui.nodes, {
1093
1189
  group: "identifier_first",
1094
1190
  node_type: "input",
@@ -1100,7 +1196,7 @@ function OryTwoStepCard() {
1100
1196
  name: "address"
1101
1197
  })) == null ? void 0 : _c.attributes) == null ? void 0 : _d.value);
1102
1198
  if (identifier) {
1103
- options[UiNodeGroupEnum.Code] = {
1199
+ authMethodBlocks[UiNodeGroupEnum.Code] = {
1104
1200
  title: {
1105
1201
  id: "identities.messages.1010023",
1106
1202
  values: { address: identifier }
@@ -1109,7 +1205,7 @@ function OryTwoStepCard() {
1109
1205
  }
1110
1206
  }
1111
1207
  const nonSsoNodes = removeSsoNodes(ui.nodes);
1112
- const finalNodes = formState.current === "method_active" ? getFinalNodes(uniqueGroups.groups, formState.method) : [];
1208
+ const finalNodes = formState.current === "method_active" ? getFinalNodes(groupsToShow.groups, formState.method) : [];
1113
1209
  const handleAfterFormSubmit = (method) => {
1114
1210
  if (typeof method !== "string" || !isUINodeGroupEnum(method)) {
1115
1211
  return;
@@ -1138,39 +1234,49 @@ function OryTwoStepCard() {
1138
1234
  /* @__PURE__ */ jsxs(OryCardContent, { children: [
1139
1235
  /* @__PURE__ */ jsx(OryCardValidationMessages, {}),
1140
1236
  showSso && /* @__PURE__ */ jsx(OryFormSocialButtonsForm, {}),
1141
- /* @__PURE__ */ jsxs(OryForm, { onAfterSubmit: handleAfterFormSubmit, children: [
1142
- /* @__PURE__ */ jsxs(Form.Group, { children: [
1143
- formState.current === "provide_identifier" && /* @__PURE__ */ jsxs(Fragment, { children: [
1144
- showSsoDivider && /* @__PURE__ */ jsx(Card.Divider, {}),
1145
- nonSsoNodes.sort(sortNodes).map((node, k) => /* @__PURE__ */ jsx(Node, { node }, k))
1146
- ] }),
1147
- formState.current === "select_method" && /* @__PURE__ */ jsxs(Fragment, { children: [
1148
- /* @__PURE__ */ jsx(Card.Divider, {}),
1149
- /* @__PURE__ */ jsx(
1150
- AuthMethodList,
1151
- {
1152
- options,
1153
- setSelectedGroup: (group) => dispatchFormState({
1154
- type: "action_select_method",
1155
- method: group
1156
- })
1157
- }
1158
- ),
1159
- ui.nodes.filter((n) => n.group === UiNodeGroupEnum.Captcha).map((node, k) => /* @__PURE__ */ jsx(Node, { node }, k))
1160
- ] }),
1161
- formState.current === "method_active" && /* @__PURE__ */ jsxs(Fragment, { children: [
1162
- ui.nodes.filter((n) => n.type === "script").map((node, k) => /* @__PURE__ */ jsx(Node, { node }, k)),
1163
- finalNodes.sort(sortNodes).map((node, k) => /* @__PURE__ */ jsx(Node, { node }, k))
1164
- ] })
1165
- ] }),
1166
- /* @__PURE__ */ jsx(OryCardFooter, {})
1167
- ] })
1237
+ /* @__PURE__ */ jsxs(
1238
+ OryForm,
1239
+ {
1240
+ "data-testid": `ory/form/methods/local`,
1241
+ onAfterSubmit: handleAfterFormSubmit,
1242
+ children: [
1243
+ formState.current === "provide_identifier" && /* @__PURE__ */ jsxs(Form.Group, { children: [
1244
+ showSsoDivider && /* @__PURE__ */ jsx(Card.Divider, {}),
1245
+ nonSsoNodes.sort(sortNodes).map((node, k) => /* @__PURE__ */ jsx(Node, { node }, k))
1246
+ ] }),
1247
+ formState.current === "select_method" && Object.entries(authMethodBlocks).length > 0 && /* @__PURE__ */ jsxs(Form.Group, { children: [
1248
+ Object.entries(authMethodBlocks).length > 0 && /* @__PURE__ */ jsx(Card.Divider, {}),
1249
+ Object.entries(authMethodBlocks).length > 0 && /* @__PURE__ */ jsx(
1250
+ AuthMethodList,
1251
+ {
1252
+ options: authMethodBlocks,
1253
+ setSelectedGroup: (group) => dispatchFormState({
1254
+ type: "action_select_method",
1255
+ method: group
1256
+ })
1257
+ }
1258
+ ),
1259
+ authMethodAdditionalNodes.sort(sortNodes).map((node, k) => /* @__PURE__ */ jsx(Node, { node }, k))
1260
+ ] }),
1261
+ formState.current === "method_active" && finalNodes.length > 0 && /* @__PURE__ */ jsxs(Form.Group, { children: [
1262
+ ui.nodes.filter(
1263
+ (n) => isUiNodeScriptAttributes(n.attributes) || n.group === UiNodeGroupEnum.Captcha || n.group === UiNodeGroupEnum.Default || n.group === UiNodeGroupEnum.Profile
1264
+ ).map((node, k) => /* @__PURE__ */ jsx(Node, { node }, k)),
1265
+ finalNodes.sort(sortNodes).map((node, k) => /* @__PURE__ */ jsx(Node, { node }, k))
1266
+ ] }),
1267
+ /* @__PURE__ */ jsx(OryCardFooter, {})
1268
+ ]
1269
+ }
1270
+ )
1168
1271
  ] })
1169
1272
  ] });
1170
1273
  }
1171
1274
  function AuthMethodList({ options, setSelectedGroup }) {
1172
1275
  const { Card } = useComponents();
1173
1276
  const { setValue, getValues } = useFormContext();
1277
+ if (Object.entries(options).length === 0) {
1278
+ return null;
1279
+ }
1174
1280
  const handleClick = (group, options2) => {
1175
1281
  var _a, _b, _c, _d;
1176
1282
  if (isGroupImmediateSubmit(group)) {
@@ -1230,6 +1336,19 @@ function OryFormSectionInner({
1230
1336
  }
1231
1337
  );
1232
1338
  }
1339
+ function OryConsentCard() {
1340
+ const { Form, Card } = useComponents();
1341
+ const flow = useOryFlow();
1342
+ return /* @__PURE__ */ jsxs(OryCard, { children: [
1343
+ /* @__PURE__ */ jsx(OryCardHeader, {}),
1344
+ /* @__PURE__ */ jsx(OryCardContent, { children: /* @__PURE__ */ jsxs(OryForm, { children: [
1345
+ /* @__PURE__ */ jsx(Card.Divider, {}),
1346
+ /* @__PURE__ */ jsx(Form.Group, { children: flow.flow.ui.nodes.map((node, k) => /* @__PURE__ */ jsx(Node, { node }, k)) }),
1347
+ /* @__PURE__ */ jsx(Card.Divider, {}),
1348
+ /* @__PURE__ */ jsx(OryCardFooter, {})
1349
+ ] }) })
1350
+ ] });
1351
+ }
1233
1352
  function OryFormGroupDivider() {
1234
1353
  const { Card } = useComponents();
1235
1354
  const {
@@ -1583,16 +1702,19 @@ function SettingsSectionContent({ group, nodes }) {
1583
1702
  const { Card } = useComponents();
1584
1703
  const intl = useIntl();
1585
1704
  const { flow } = useOryFlow();
1586
- const uniqueGroups = useNodesGroups(flow.ui.nodes);
1705
+ const groupedNodes = useNodesGroups(flow.ui.nodes, {
1706
+ // Script nodes are already handled by the parent component.
1707
+ omit: ["script"]
1708
+ });
1587
1709
  if (group === UiNodeGroupEnum.Totp) {
1588
1710
  return /* @__PURE__ */ jsxs(
1589
1711
  OryFormSection,
1590
1712
  {
1591
- nodes: uniqueGroups.groups.totp,
1713
+ nodes: groupedNodes.groups.totp,
1592
1714
  "data-testid": "ory/screen/settings/group/totp",
1593
1715
  children: [
1594
- /* @__PURE__ */ jsx(OrySettingsTotp, { nodes: (_a = uniqueGroups.groups.totp) != null ? _a : [] }),
1595
- (_b = uniqueGroups.groups.default) == null ? void 0 : _b.map((node, k) => /* @__PURE__ */ jsx(Node, { node }, k))
1716
+ /* @__PURE__ */ jsx(OrySettingsTotp, { nodes: (_a = groupedNodes.groups.totp) != null ? _a : [] }),
1717
+ (_b = groupedNodes.groups.default) == null ? void 0 : _b.map((node, k) => /* @__PURE__ */ jsx(Node, { node }, k))
1596
1718
  ]
1597
1719
  }
1598
1720
  );
@@ -1601,16 +1723,16 @@ function SettingsSectionContent({ group, nodes }) {
1601
1723
  return /* @__PURE__ */ jsxs(
1602
1724
  OryFormSection,
1603
1725
  {
1604
- nodes: uniqueGroups.groups.lookup_secret,
1726
+ nodes: groupedNodes.groups.lookup_secret,
1605
1727
  "data-testid": "ory/screen/settings/group/lookup_secret",
1606
1728
  children: [
1607
1729
  /* @__PURE__ */ jsx(
1608
1730
  OrySettingsRecoveryCodes,
1609
1731
  {
1610
- nodes: (_c = uniqueGroups.groups.lookup_secret) != null ? _c : []
1732
+ nodes: (_c = groupedNodes.groups.lookup_secret) != null ? _c : []
1611
1733
  }
1612
1734
  ),
1613
- (_d = uniqueGroups.groups.default) == null ? void 0 : _d.map((node, k) => /* @__PURE__ */ jsx(Node, { node }, k))
1735
+ (_d = groupedNodes.groups.default) == null ? void 0 : _d.map((node, k) => /* @__PURE__ */ jsx(Node, { node }, k))
1614
1736
  ]
1615
1737
  }
1616
1738
  );
@@ -1619,11 +1741,11 @@ function SettingsSectionContent({ group, nodes }) {
1619
1741
  return /* @__PURE__ */ jsxs(
1620
1742
  OryFormSection,
1621
1743
  {
1622
- nodes: uniqueGroups.groups.oidc,
1744
+ nodes: groupedNodes.groups.oidc,
1623
1745
  "data-testid": "ory/screen/settings/group/oidc",
1624
1746
  children: [
1625
- /* @__PURE__ */ jsx(OrySettingsOidc, { nodes: (_e = uniqueGroups.groups.oidc) != null ? _e : [] }),
1626
- (_f = uniqueGroups.groups.default) == null ? void 0 : _f.map((node, k) => /* @__PURE__ */ jsx(Node, { node }, k))
1747
+ /* @__PURE__ */ jsx(OrySettingsOidc, { nodes: (_e = groupedNodes.groups.oidc) != null ? _e : [] }),
1748
+ (_f = groupedNodes.groups.default) == null ? void 0 : _f.map((node, k) => /* @__PURE__ */ jsx(Node, { node }, k))
1627
1749
  ]
1628
1750
  }
1629
1751
  );
@@ -1632,11 +1754,11 @@ function SettingsSectionContent({ group, nodes }) {
1632
1754
  return /* @__PURE__ */ jsxs(
1633
1755
  OryFormSection,
1634
1756
  {
1635
- nodes: uniqueGroups.groups.webauthn,
1757
+ nodes: groupedNodes.groups.webauthn,
1636
1758
  "data-testid": "ory/screen/settings/group/webauthn",
1637
1759
  children: [
1638
- /* @__PURE__ */ jsx(OrySettingsWebauthn, { nodes: (_g = uniqueGroups.groups.webauthn) != null ? _g : [] }),
1639
- (_h = uniqueGroups.groups.default) == null ? void 0 : _h.map((node, k) => /* @__PURE__ */ jsx(Node, { node }, k))
1760
+ /* @__PURE__ */ jsx(OrySettingsWebauthn, { nodes: (_g = groupedNodes.groups.webauthn) != null ? _g : [] }),
1761
+ (_h = groupedNodes.groups.default) == null ? void 0 : _h.map((node, k) => /* @__PURE__ */ jsx(Node, { node }, k))
1640
1762
  ]
1641
1763
  }
1642
1764
  );
@@ -1645,11 +1767,11 @@ function SettingsSectionContent({ group, nodes }) {
1645
1767
  return /* @__PURE__ */ jsxs(
1646
1768
  OryFormSection,
1647
1769
  {
1648
- nodes: uniqueGroups.groups.passkey,
1770
+ nodes: groupedNodes.groups.passkey,
1649
1771
  "data-testid": "ory/screen/settings/group/passkey",
1650
1772
  children: [
1651
- /* @__PURE__ */ jsx(OrySettingsPasskey, { nodes: (_i = uniqueGroups.groups.passkey) != null ? _i : [] }),
1652
- (_j = uniqueGroups.groups.default) == null ? void 0 : _j.map((node, k) => /* @__PURE__ */ jsx(Node, { node }, k))
1773
+ /* @__PURE__ */ jsx(OrySettingsPasskey, { nodes: (_i = groupedNodes.groups.passkey) != null ? _i : [] }),
1774
+ (_j = groupedNodes.groups.default) == null ? void 0 : _j.map((node, k) => /* @__PURE__ */ jsx(Node, { node }, k))
1653
1775
  ]
1654
1776
  }
1655
1777
  );
@@ -1670,7 +1792,7 @@ function SettingsSectionContent({ group, nodes }) {
1670
1792
  id: `settings.${group}.description`
1671
1793
  }),
1672
1794
  children: [
1673
- (_k = uniqueGroups.groups.default) == null ? void 0 : _k.map((node, k) => /* @__PURE__ */ jsx(Node, { node }, k)),
1795
+ (_k = groupedNodes.groups.default) == null ? void 0 : _k.map((node, k) => /* @__PURE__ */ jsx(Node, { node }, k)),
1674
1796
  nodes.filter(
1675
1797
  (node) => "type" in node.attributes && node.attributes.type !== "submit"
1676
1798
  ).map((node, k) => /* @__PURE__ */ jsx(Node, { node }, k))
@@ -1684,16 +1806,16 @@ function SettingsSectionContent({ group, nodes }) {
1684
1806
  }
1685
1807
  );
1686
1808
  }
1687
- var getScriptNode = (nodes) => nodes.find(
1688
- (node) => "id" in node.attributes && node.attributes.id === "webauthn_script"
1809
+ var onlyScriptNodes = (nodes) => nodes.filter(
1810
+ (node) => isUiNodeScriptAttributes(node.attributes) && node.attributes.id === "webauthn_script"
1689
1811
  );
1690
1812
  function OrySettingsCard() {
1691
1813
  const { flow } = useOryFlow();
1692
- const uniqueGroups = useNodesGroups(flow.ui.nodes);
1693
- const scriptNode = getScriptNode(flow.ui.nodes);
1814
+ const uniqueGroups = useNodesGroups(flow.ui.nodes, { omit: ["script"] });
1815
+ const scriptNodes = onlyScriptNodes(flow.ui.nodes);
1694
1816
  return /* @__PURE__ */ jsxs(Fragment, { children: [
1695
1817
  /* @__PURE__ */ jsx(OryCardValidationMessages, {}),
1696
- scriptNode && /* @__PURE__ */ jsx(Node, { node: scriptNode }),
1818
+ scriptNodes.map((n) => /* @__PURE__ */ jsx(Node, { node: n })),
1697
1819
  uniqueGroups.entries.map(([group, nodes]) => {
1698
1820
  if (group === UiNodeGroupEnum.Default) {
1699
1821
  return null;
@@ -2029,6 +2151,20 @@ var en_default = {
2029
2151
  "property.username": "username",
2030
2152
  "property.identifier": "identifier",
2031
2153
  "property.code": "code",
2154
+ "consent.title": "Authorize {party}",
2155
+ "consent.subtitle": "A third party application wants to access information associated with your account {identifier}.",
2156
+ "consent.scope.openid.title": "Identity",
2157
+ "consent.scope.openid.description": "Allows the application to verify your identity. This is required for authentication and a trusted login experience.",
2158
+ "consent.scope.offline_access.title": "Offline Access",
2159
+ "consent.scope.offline_access.description": "Allows this application to keep you signed in even when you're not actively using it.",
2160
+ "consent.scope.profile.title": "Profile Information",
2161
+ "consent.scope.profile.description": "Allows access to your basic profile details, including your username, first name, and last name.",
2162
+ "consent.scope.email.title": "Email Address",
2163
+ "consent.scope.email.description": "Retrieve your email address and its verification status.",
2164
+ "consent.scope.address.title": "Physical Address",
2165
+ "consent.scope.address.description": "Access your postal address.",
2166
+ "consent.scope.phone.title": "Phone Number",
2167
+ "consent.scope.phone.description": "Retrieve your phone number and its verification status.",
2032
2168
  "error.title.what-happened": "What happened?",
2033
2169
  "error.title.what-can-i-do": "What can I do?",
2034
2170
  "error.instructions": "Please try again in a few minutes or contact the website operator.",
@@ -2205,7 +2341,7 @@ var de_default = {
2205
2341
  "two-step.code.description": "Ein Best\xE4tigungscode wird an Ihre E-Mail gesendet.",
2206
2342
  "two-step.code.title": "E-Mail-Code",
2207
2343
  "two-step.passkey.description": "Verwenden Sie die Fingerabdruck- oder Gesichtserkennung Ihres Ger\xE4ts",
2208
- "two-step.passkey.title": "Passwort (empfohlen)",
2344
+ "two-step.passkey.title": "Passkey (empfohlen)",
2209
2345
  "two-step.password.description": "Geben Sie Ihr Passwort ein, das mit Ihrem Konto verkn\xFCpft ist",
2210
2346
  "two-step.password.title": "Passwort",
2211
2347
  "two-step.webauthn.title": "Sicherheitsschl\xFCssel",
@@ -2300,6 +2436,20 @@ var de_default = {
2300
2436
  "property.phone": "Telefon",
2301
2437
  "property.code": "Code",
2302
2438
  "property.username": "Benutzername",
2439
+ "consent.title": "Autorisieren {party}",
2440
+ "consent.subtitle": "Eine Drittanbieteranwendung m\xF6chte auf Informationen zugreifen, die mit Ihrem Konto {identifier} verkn\xFCpft sind.",
2441
+ "consent.scope.openid.title": "Identit\xE4t",
2442
+ "consent.scope.openid.description": "Erm\xF6glicht der Anwendung, Ihre Identit\xE4t zu \xFCberpr\xFCfen. Dies ist f\xFCr die Authentifizierung und eine vertrauensw\xFCrdige Login-Erfahrung erforderlich.",
2443
+ "consent.scope.offline_access.title": "Offline-Zugriff",
2444
+ "consent.scope.offline_access.description": "Erm\xF6glicht dieser Anwendung, Sie angemeldet zu lassen, auch wenn Sie sie nicht aktiv nutzen.",
2445
+ "consent.scope.profile.title": "Profilinformationen",
2446
+ "consent.scope.profile.description": "Erm\xF6glicht den Zugriff auf Ihre grundlegenden Profildetails, einschlie\xDFlich Ihres Benutzernamens, Vornamens und Nachnamens.",
2447
+ "consent.scope.email.title": "E-Mail-Adresse",
2448
+ "consent.scope.email.description": "Erm\xF6glicht den Abruf Ihrer E-Mail-Adresse und deren \xDCberpr\xFCfungsstatus.",
2449
+ "consent.scope.address.title": "Physische Adresse",
2450
+ "consent.scope.address.description": "Erm\xF6glicht den Zugriff auf Ihre Postanschrift.",
2451
+ "consent.scope.phone.title": "Telefonnummer",
2452
+ "consent.scope.phone.description": "Erm\xF6glicht den Abruf Ihrer Telefonnummer und deren \xDCberpr\xFCfungsstatus.",
2303
2453
  "error.title.what-happened": "Was ist passiert?",
2304
2454
  "error.footer.copy": "Kopieren",
2305
2455
  "error.footer.text": "Bitte f\xFCgen Sie bei der Meldung dieses Fehlers die folgenden Informationen hinzu:",
@@ -2571,6 +2721,20 @@ var es_default = {
2571
2721
  "property.password": "",
2572
2722
  "property.phone": "",
2573
2723
  "property.username": "",
2724
+ "consent.title": "Autorizar {party}",
2725
+ "consent.subtitle": "Una aplicaci\xF3n de terceros quiere acceder a la informaci\xF3n asociada a su cuenta {identifier}.",
2726
+ "consent.scope.openid.title": "Identidad",
2727
+ "consent.scope.openid.description": "Permite que la aplicaci\xF3n verifique su identidad. Esto es necesario para la autenticaci\xF3n y una experiencia de inicio de sesi\xF3n confiable.",
2728
+ "consent.scope.offline_access.title": "Acceso sin conexi\xF3n",
2729
+ "consent.scope.offline_access.description": "Permite que esta aplicaci\xF3n le mantenga conectado incluso cuando no la est\xE9 utilizando activamente.",
2730
+ "consent.scope.profile.title": "Informaci\xF3n del perfil",
2731
+ "consent.scope.profile.description": "Permite el acceso a los detalles b\xE1sicos de su perfil, incluyendo su nombre de usuario, nombre y apellido.",
2732
+ "consent.scope.email.title": "Direcci\xF3n de correo electr\xF3nico",
2733
+ "consent.scope.email.description": "Recupere su direcci\xF3n de correo electr\xF3nico y su estado de verificaci\xF3n.",
2734
+ "consent.scope.address.title": "Direcci\xF3n f\xEDsica",
2735
+ "consent.scope.address.description": "Acceda a su direcci\xF3n postal.",
2736
+ "consent.scope.phone.title": "N\xFAmero de tel\xE9fono",
2737
+ "consent.scope.phone.description": "Recupere su n\xFAmero de tel\xE9fono y su estado de verificaci\xF3n.",
2574
2738
  "error.action.go-back": "",
2575
2739
  "error.footer.copy": "",
2576
2740
  "error.footer.text": "",
@@ -2842,6 +3006,20 @@ var fr_default = {
2842
3006
  "property.password": "",
2843
3007
  "property.phone": "",
2844
3008
  "property.username": "",
3009
+ "consent.title": "Autoriser {party}",
3010
+ "consent.subtitle": "Une application tierce souhaite acc\xE9der aux informations associ\xE9es \xE0 votre compte {identifier}.",
3011
+ "consent.scope.openid.title": "Identit\xE9",
3012
+ "consent.scope.openid.description": "Permet \xE0 l'application de v\xE9rifier votre identit\xE9. Cela est n\xE9cessaire pour l'authentification et une exp\xE9rience de connexion fiable.",
3013
+ "consent.scope.offline_access.title": "Acc\xE8s hors ligne",
3014
+ "consent.scope.offline_access.description": "Permet \xE0 cette application de vous maintenir connect\xE9 m\xEAme lorsque vous ne l'utilisez pas activement.",
3015
+ "consent.scope.profile.title": "Informations de profil",
3016
+ "consent.scope.profile.description": "Permet l'acc\xE8s aux d\xE9tails de base de votre profil, y compris votre nom d'utilisateur, pr\xE9nom et nom.",
3017
+ "consent.scope.email.title": "Adresse e-mail",
3018
+ "consent.scope.email.description": "R\xE9cup\xE8re votre adresse e-mail et son statut de v\xE9rification.",
3019
+ "consent.scope.address.title": "Adresse physique",
3020
+ "consent.scope.address.description": "Acc\xE8de \xE0 votre adresse postale.",
3021
+ "consent.scope.phone.title": "Num\xE9ro de t\xE9l\xE9phone",
3022
+ "consent.scope.phone.description": "R\xE9cup\xE8re votre num\xE9ro de t\xE9l\xE9phone et son statut de v\xE9rification.",
2845
3023
  "error.action.go-back": "",
2846
3024
  "error.footer.copy": "",
2847
3025
  "error.footer.text": "",
@@ -3113,6 +3291,20 @@ var nl_default = {
3113
3291
  "property.password": "",
3114
3292
  "property.phone": "",
3115
3293
  "property.username": "",
3294
+ "consent.title": "Autoriseren {party}",
3295
+ "consent.subtitle": "Een derde partij applicatie wil toegang tot informatie die aan uw account {identifier} is gekoppeld.",
3296
+ "consent.scope.openid.title": "Identiteit",
3297
+ "consent.scope.openid.description": "Stelt de applicatie in staat uw identiteit te verifi\xEBren. Dit is vereist voor authenticatie en een betrouwbare inlogervaring.",
3298
+ "consent.scope.offline_access.title": "Offline toegang",
3299
+ "consent.scope.offline_access.description": "Stelt deze applicatie in staat u ingelogd te houden, zelfs wanneer u deze niet actief gebruikt.",
3300
+ "consent.scope.profile.title": "Profielinformatie",
3301
+ "consent.scope.profile.description": "Geeft toegang tot uw basisprofielgegevens, inclusief uw gebruikersnaam, voornaam en achternaam.",
3302
+ "consent.scope.email.title": "E-mailadres",
3303
+ "consent.scope.email.description": "Haal uw e-mailadres en de verificatiestatus ervan op.",
3304
+ "consent.scope.address.title": "Fysiek adres",
3305
+ "consent.scope.address.description": "Toegang tot uw postadres.",
3306
+ "consent.scope.phone.title": "Telefoonnummer",
3307
+ "consent.scope.phone.description": "Haal uw telefoonnummer en de verificatiestatus ervan op.",
3116
3308
  "error.action.go-back": "",
3117
3309
  "error.footer.copy": "",
3118
3310
  "error.footer.text": "",
@@ -3384,6 +3576,20 @@ var pl_default = {
3384
3576
  "property.phone": "",
3385
3577
  "property.username": "",
3386
3578
  "property.identifier": "",
3579
+ "consent.title": "Autoryzuj {party}",
3580
+ "consent.subtitle": "Aplikacja trzeciej strony chce uzyska\u0107 dost\u0119p do informacji powi\u0105zanych z Twoim kontem {identifier}.",
3581
+ "consent.scope.openid.title": "To\u017Csamo\u015B\u0107",
3582
+ "consent.scope.openid.description": "Pozwala aplikacji zweryfikowa\u0107 Twoj\u0105 to\u017Csamo\u015B\u0107. Jest to wymagane do uwierzytelniania i zapewnienia zaufanej sesji logowania.",
3583
+ "consent.scope.offline_access.title": "Dost\u0119p offline",
3584
+ "consent.scope.offline_access.description": "Pozwala aplikacji utrzyma\u0107 Twoje logowanie, nawet gdy nie korzystasz z niej aktywnie.",
3585
+ "consent.scope.profile.title": "Informacje profilowe",
3586
+ "consent.scope.profile.description": "Pozwala na dost\u0119p do podstawowych danych profilowych, w tym nazwy u\u017Cytkownika, imienia i nazwiska.",
3587
+ "consent.scope.email.title": "Adres e-mail",
3588
+ "consent.scope.email.description": "Pobierz sw\xF3j adres e-mail oraz status jego weryfikacji.",
3589
+ "consent.scope.address.title": "Adres fizyczny",
3590
+ "consent.scope.address.description": "Dost\u0119p do Twojego adresu pocztowego.",
3591
+ "consent.scope.phone.title": "Numer telefonu",
3592
+ "consent.scope.phone.description": "Pobierz sw\xF3j numer telefonu oraz status jego weryfikacji.",
3387
3593
  "error.action.go-back": "",
3388
3594
  "error.footer.copy": "",
3389
3595
  "error.footer.text": "",
@@ -3655,6 +3861,20 @@ var pt_default = {
3655
3861
  "property.password": "",
3656
3862
  "property.phone": "",
3657
3863
  "property.username": "",
3864
+ "consent.title": "Autorizar {party}",
3865
+ "consent.subtitle": "Um aplicativo de terceiros deseja acessar as informa\xE7\xF5es associadas \xE0 sua conta {identifier}.",
3866
+ "consent.scope.openid.title": "Identidade",
3867
+ "consent.scope.openid.description": "Permite que a aplica\xE7\xE3o verifique sua identidade. Isso \xE9 necess\xE1rio para a autentica\xE7\xE3o e uma experi\xEAncia de login confi\xE1vel.",
3868
+ "consent.scope.offline_access.title": "Acesso Offline",
3869
+ "consent.scope.offline_access.description": "Permite que este aplicativo mantenha voc\xEA conectado mesmo quando n\xE3o estiver usando-o ativamente.",
3870
+ "consent.scope.profile.title": "Informa\xE7\xF5es do Perfil",
3871
+ "consent.scope.profile.description": "Permite o acesso aos detalhes b\xE1sicos do seu perfil, incluindo seu nome de usu\xE1rio, primeiro nome e sobrenome.",
3872
+ "consent.scope.email.title": "Endere\xE7o de E-mail",
3873
+ "consent.scope.email.description": "Recupere seu endere\xE7o de e-mail e seu status de verifica\xE7\xE3o.",
3874
+ "consent.scope.address.title": "Endere\xE7o F\xEDsico",
3875
+ "consent.scope.address.description": "Acesse seu endere\xE7o postal.",
3876
+ "consent.scope.phone.title": "N\xFAmero de Telefone",
3877
+ "consent.scope.phone.description": "Recupere seu n\xFAmero de telefone e seu status de verifica\xE7\xE3o.",
3658
3878
  "error.action.go-back": "",
3659
3879
  "error.footer.copy": "",
3660
3880
  "error.footer.text": "",
@@ -3926,6 +4146,20 @@ var sv_default = {
3926
4146
  "property.username": "anv\xE4ndarnamn",
3927
4147
  "property.identifier": "identifier",
3928
4148
  "property.code": "kod",
4149
+ "consent.title": "Auktorisera {party}",
4150
+ "consent.subtitle": "En tredjepartsapplikation vill f\xE5 tillg\xE5ng till information kopplad till ditt konto {identifier}.",
4151
+ "consent.scope.openid.title": "Identitet",
4152
+ "consent.scope.openid.description": "G\xF6r det m\xF6jligt f\xF6r applikationen att verifiera din identitet. Detta kr\xE4vs f\xF6r autentisering och en p\xE5litlig inloggningsupplevelse.",
4153
+ "consent.scope.offline_access.title": "Offline-\xE5tkomst",
4154
+ "consent.scope.offline_access.description": "G\xF6r det m\xF6jligt f\xF6r denna applikation att h\xE5lla dig inloggad \xE4ven n\xE4r du inte aktivt anv\xE4nder den.",
4155
+ "consent.scope.profile.title": "Profilinformation",
4156
+ "consent.scope.profile.description": "Ger tillg\xE5ng till dina grundl\xE4ggande profiluppgifter, inklusive ditt anv\xE4ndarnamn, f\xF6rnamn och efternamn.",
4157
+ "consent.scope.email.title": "E-postadress",
4158
+ "consent.scope.email.description": "H\xE4mta din e-postadress och dess verifieringsstatus.",
4159
+ "consent.scope.address.title": "Fysisk adress",
4160
+ "consent.scope.address.description": "F\xE5 \xE5tkomst till din postadress.",
4161
+ "consent.scope.phone.title": "Telefonnummer",
4162
+ "consent.scope.phone.description": "H\xE4mta ditt telefonnummer och dess verifieringsstatus.",
3929
4163
  "error.action.go-back": "",
3930
4164
  "error.footer.copy": "",
3931
4165
  "error.footer.text": "",
@@ -3946,6 +4180,6 @@ var OryLocales = {
3946
4180
  sv: sv_default
3947
4181
  };
3948
4182
 
3949
- export { HeadlessPageHeader, OryCard, OryCardContent, OryCardFooter, OryCardHeader, OryCardValidationMessages, OryForm, OryFormGroupDivider, OryFormGroups, OryFormOidcButtons, OryFormSection, OryFormSocialButtonsForm, OryLocales, OryProvider, OrySettingsCard, OryTwoStepCard, messageTestId, uiTextToFormattedMessage, useComponents, useNodeSorter, useOryFlow };
4183
+ export { HeadlessPageHeader, OryCard, OryCardContent, OryCardFooter, OryCardHeader, OryCardValidationMessages, OryConsentCard, OryForm, OryFormGroupDivider, OryFormGroups, OryFormOidcButtons, OryFormSection, OryFormSocialButtonsForm, OryLocales, OryProvider, OrySettingsCard, OryTwoStepCard, messageTestId, uiTextToFormattedMessage, useComponents, useNodeSorter, useOryFlow };
3950
4184
  //# sourceMappingURL=index.mjs.map
3951
4185
  //# sourceMappingURL=index.mjs.map