@wise/dynamic-flow-client-internal 4.0.0-experimental-8a78888 → 4.0.0-experimental-ffcedb9

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/build/main.mjs CHANGED
@@ -137,12 +137,12 @@ var init_clsx = __esm({
137
137
  }
138
138
  });
139
139
 
140
- // ../../node_modules/.pnpm/@wise+art@2.19.0_@transferwise+neptune-css@14.20.1_@types+react@18.3.18_react-dom@18.3.1_reac_mzw7cg6j4wc7ddwlhxck7linn4/node_modules/@wise/art/dist/index-8Fxev6OI.esm.js
140
+ // ../../node_modules/.pnpm/@wise+art@2.19.0_@transferwise+neptune-css@14.22.0_@types+react@18.3.18_react-dom@18.3.1_reac_62coi6aa7fmdhpcz7p72kf3gum/node_modules/@wise/art/dist/index-8Fxev6OI.esm.js
141
141
  import { useState, useEffect, forwardRef, Suspense, lazy } from "react";
142
- import { jsx as jsx12, jsxs as jsxs3, Fragment } from "react/jsx-runtime";
142
+ import { jsx as jsx11, jsxs as jsxs3, Fragment } from "react/jsx-runtime";
143
143
  var unknownFlagName, Flag, Sizes, ImageSizes, imageSizes, Assets, RenderMode;
144
144
  var init_index_8Fxev6OI_esm = __esm({
145
- "../../node_modules/.pnpm/@wise+art@2.19.0_@transferwise+neptune-css@14.20.1_@types+react@18.3.18_react-dom@18.3.1_reac_mzw7cg6j4wc7ddwlhxck7linn4/node_modules/@wise/art/dist/index-8Fxev6OI.esm.js"() {
145
+ "../../node_modules/.pnpm/@wise+art@2.19.0_@transferwise+neptune-css@14.22.0_@types+react@18.3.18_react-dom@18.3.1_reac_62coi6aa7fmdhpcz7p72kf3gum/node_modules/@wise/art/dist/index-8Fxev6OI.esm.js"() {
146
146
  "use strict";
147
147
  init_clsx();
148
148
  unknownFlagName = "wise";
@@ -158,7 +158,7 @@ var init_index_8Fxev6OI_esm = __esm({
158
158
  }, [code]);
159
159
  const detailed = intrinsicSize >= 150;
160
160
  const name = fallback !== "unknown" ? `${code.toLowerCase()}${fallback == null && detailed ? "-detailed" : ""}` : unknownFlagName;
161
- return /* @__PURE__ */ jsx12("img", {
161
+ return /* @__PURE__ */ jsx11("img", {
162
162
  className: clsx(`wds-flag wds-flag-${name}`, className),
163
163
  src: false ? `${name}.svg` : `https://wise.com/web-art/assets/flags/${name}.svg`,
164
164
  loading,
@@ -862,26 +862,14 @@ var translations = languages.reduce(
862
862
  var i18n_default = translations;
863
863
 
864
864
  // src/dynamicFlow/DynamicFlow.tsx
865
- import { forwardRef as forwardRef2, useCallback, useMemo as useMemo2 } from "react";
865
+ import { forwardRef as forwardRef2, useCallback, useMemo } from "react";
866
866
  import { useIntl as useIntl9 } from "react-intl";
867
867
  import {
868
868
  DynamicFlow as DynamicFlowCoreLegacy,
869
869
  DynamicFlowCoreRevamp,
870
- DynamicFragmentCore
870
+ DynamicFormCore
871
871
  } from "@wise/dynamic-flow-client";
872
872
 
873
- // ../renderers/src/contexts/RendererHttpClientContext.tsx
874
- import { createContext, useContext } from "react";
875
- import { jsx } from "react/jsx-runtime";
876
- var HttpClientContext = createContext(void 0);
877
- function RendererHttpClientProvider({ httpClient, children }) {
878
- return /* @__PURE__ */ jsx(HttpClientContext.Provider, { value: httpClient, children });
879
- }
880
- var useRendererHttpClient = () => {
881
- const contextFetch = useContext(HttpClientContext);
882
- return contextFetch != null ? contextFetch : fetch;
883
- };
884
-
885
873
  // ../renderers/src/AlertRenderer.tsx
886
874
  import { Alert } from "@transferwise/components";
887
875
 
@@ -916,10 +904,10 @@ var getTextAlignment = (align) => {
916
904
  var getTextAlignmentAndMargin = (component) => `${getTextAlignment(component.align)} ${getMargin(component.margin)}`;
917
905
 
918
906
  // ../renderers/src/AlertRenderer.tsx
919
- import { jsx as jsx2 } from "react/jsx-runtime";
907
+ import { jsx } from "react/jsx-runtime";
920
908
  var AlertRenderer = {
921
909
  canRenderType: "alert",
922
- render: ({ context, markdown, margin, callToAction }) => /* @__PURE__ */ jsx2(
910
+ render: ({ context, markdown, margin, callToAction }) => /* @__PURE__ */ jsx(
923
911
  Alert,
924
912
  {
925
913
  type: context,
@@ -973,14 +961,14 @@ var help_messages_default = defineMessages({
973
961
  });
974
962
 
975
963
  // ../renderers/src/components/Help.tsx
976
- import { jsx as jsx3 } from "react/jsx-runtime";
964
+ import { jsx as jsx2 } from "react/jsx-runtime";
977
965
  function Help({ help }) {
978
966
  const intl = useIntl();
979
- return /* @__PURE__ */ jsx3(
967
+ return /* @__PURE__ */ jsx2(
980
968
  Info,
981
969
  {
982
970
  className: "m-l-1",
983
- content: /* @__PURE__ */ jsx3(Markdown, { config: { link: { target: "_blank" } }, children: help }),
971
+ content: /* @__PURE__ */ jsx2(Markdown, { config: { link: { target: "_blank" } }, children: help }),
984
972
  presentation: "POPOVER",
985
973
  size: "sm",
986
974
  "aria-label": intl.formatMessage(help_messages_default.helpAria)
@@ -990,19 +978,19 @@ function Help({ help }) {
990
978
  var Help_default = Help;
991
979
 
992
980
  // ../renderers/src/components/LabelContentWithHelp.tsx
993
- import { jsx as jsx4, jsxs } from "react/jsx-runtime";
981
+ import { jsx as jsx3, jsxs } from "react/jsx-runtime";
994
982
  function LabelContentWithHelp({ text, help }) {
995
983
  return /* @__PURE__ */ jsxs("div", { children: [
996
984
  text,
997
- /* @__PURE__ */ jsx4(Help_default, { help })
985
+ /* @__PURE__ */ jsx3(Help_default, { help })
998
986
  ] });
999
987
  }
1000
988
 
1001
989
  // ../renderers/src/components/FieldInput.tsx
1002
- import { jsx as jsx5 } from "react/jsx-runtime";
990
+ import { jsx as jsx4 } from "react/jsx-runtime";
1003
991
  function FieldInput({ id, children, label, validation, description, help }) {
1004
- const labelContent = label && help ? /* @__PURE__ */ jsx5(LabelContentWithHelp, { text: label, help }) : label;
1005
- return /* @__PURE__ */ jsx5(
992
+ const labelContent = label && help ? /* @__PURE__ */ jsx4(LabelContentWithHelp, { text: label, help }) : label;
993
+ return /* @__PURE__ */ jsx4(
1006
994
  Field,
1007
995
  {
1008
996
  id,
@@ -1027,7 +1015,7 @@ var FieldInput_default = FieldInput;
1027
1015
 
1028
1016
  // ../renderers/src/CheckboxInputRenderer.tsx
1029
1017
  import { Checkbox } from "@transferwise/components";
1030
- import { jsx as jsx6 } from "react/jsx-runtime";
1018
+ import { jsx as jsx5 } from "react/jsx-runtime";
1031
1019
  var CheckboxInputRenderer = {
1032
1020
  canRenderType: "input-checkbox",
1033
1021
  render: (props) => {
@@ -1051,20 +1039,20 @@ var CheckboxInputRenderer = {
1051
1039
  "value"
1052
1040
  ]);
1053
1041
  const checkboxProps = __spreadProps(__spreadValues({}, rest), { label: title, secondary: description, checked: value });
1054
- return /* @__PURE__ */ jsx6(FieldInput_default, { id, label: "", description: "", validation: validationState, help, children: /* @__PURE__ */ jsx6(Checkbox, __spreadValues({ id }, checkboxProps)) });
1042
+ return /* @__PURE__ */ jsx5(FieldInput_default, { id, label: "", description: "", validation: validationState, help, children: /* @__PURE__ */ jsx5(Checkbox, __spreadValues({ id }, checkboxProps)) });
1055
1043
  }
1056
1044
  };
1057
1045
  var CheckboxInputRenderer_default = CheckboxInputRenderer;
1058
1046
 
1059
1047
  // ../renderers/src/BoxRenderer.tsx
1060
1048
  var import_classnames = __toESM(require_classnames());
1061
- import { jsx as jsx7 } from "react/jsx-runtime";
1049
+ import { jsx as jsx6 } from "react/jsx-runtime";
1062
1050
  var BoxRenderer = {
1063
1051
  canRenderType: "box",
1064
- render: ({ border, children, control, margin, width }) => {
1052
+ render: ({ children, control, margin, width }) => {
1065
1053
  const hasFixedWidth = width !== "xl";
1066
- const hasBorder = control === "bordered" || control === "bordered-web" || border;
1067
- const contents = /* @__PURE__ */ jsx7(
1054
+ const hasBorder = control === "bordered" || control === "bordered-web";
1055
+ const contents = /* @__PURE__ */ jsx6(
1068
1056
  "div",
1069
1057
  {
1070
1058
  className: (0, import_classnames.default)({
@@ -1075,30 +1063,14 @@ var BoxRenderer = {
1075
1063
  children
1076
1064
  }
1077
1065
  );
1078
- return hasFixedWidth ? /* @__PURE__ */ jsx7("div", { className: (0, import_classnames.default)("df-box-renderer-fixed-width", getMargin(margin)), children: contents }) : contents;
1066
+ return hasFixedWidth ? /* @__PURE__ */ jsx6("div", { className: (0, import_classnames.default)("df-box-renderer-fixed-width", getMargin(margin)), children: contents }) : contents;
1079
1067
  }
1080
1068
  };
1081
1069
  var BoxRenderer_default = BoxRenderer;
1082
1070
 
1083
1071
  // ../renderers/src/ButtonRenderer.tsx
1084
1072
  import { Button } from "@transferwise/components";
1085
-
1086
- // ../renderers/src/step/StepRendererContext.tsx
1087
- import { createContext as createContext2, useContext as useContext2 } from "react";
1088
- var StepRendererContext = createContext2({ loadingState: "idle", trackEvent: () => {
1089
- } });
1090
- var StepRendererContextProvider = StepRendererContext.Provider;
1091
- var useLoadingContext = () => {
1092
- const { loadingState } = useContext2(StepRendererContext);
1093
- return { loadingState, isLoading: loadingState !== "idle" };
1094
- };
1095
- var useTrackEvent = () => {
1096
- const { trackEvent } = useContext2(StepRendererContext);
1097
- return trackEvent;
1098
- };
1099
-
1100
- // ../renderers/src/ButtonRenderer.tsx
1101
- import { jsx as jsx8 } from "react/jsx-runtime";
1073
+ import { jsx as jsx7 } from "react/jsx-runtime";
1102
1074
  var ButtonRenderer = {
1103
1075
  canRenderType: "button",
1104
1076
  render: ButtonRendererComponent
@@ -1110,13 +1082,14 @@ function ButtonRendererComponent({
1110
1082
  margin,
1111
1083
  title,
1112
1084
  size: size2,
1085
+ stepLoadingState,
1113
1086
  onClick
1114
1087
  }) {
1115
1088
  const className = getMargin(margin);
1116
1089
  const priority = mapControl(control);
1117
1090
  const type = priority === "tertiary" ? void 0 : mapContext(context);
1118
- const { isLoading } = useLoadingContext();
1119
- return /* @__PURE__ */ jsx8(
1091
+ const isLoading = stepLoadingState !== "idle";
1092
+ return /* @__PURE__ */ jsx7(
1120
1093
  Button,
1121
1094
  {
1122
1095
  block: true,
@@ -1168,7 +1141,7 @@ var ButtonRenderer_default = ButtonRenderer;
1168
1141
 
1169
1142
  // ../renderers/src/ColumnsRenderer.tsx
1170
1143
  var import_classnames2 = __toESM(require_classnames());
1171
- import { jsx as jsx9, jsxs as jsxs2 } from "react/jsx-runtime";
1144
+ import { jsx as jsx8, jsxs as jsxs2 } from "react/jsx-runtime";
1172
1145
  var ColumnsRenderer = {
1173
1146
  canRenderType: "columns",
1174
1147
  render: ({ bias, margin, startChildren, endChildren }) => /* @__PURE__ */ jsxs2(
@@ -1179,8 +1152,8 @@ var ColumnsRenderer = {
1179
1152
  "df-columns-renderer-bias-end": bias === "end"
1180
1153
  }),
1181
1154
  children: [
1182
- /* @__PURE__ */ jsx9("div", { className: "df-columns-renderer-column", children: startChildren }),
1183
- /* @__PURE__ */ jsx9("div", { className: "df-columns-renderer-column", children: endChildren })
1155
+ /* @__PURE__ */ jsx8("div", { className: "df-columns-renderer-column", children: startChildren }),
1156
+ /* @__PURE__ */ jsx8("div", { className: "df-columns-renderer-column", children: endChildren })
1184
1157
  ]
1185
1158
  }
1186
1159
  )
@@ -1219,7 +1192,7 @@ var dateToDateString = (date) => {
1219
1192
  };
1220
1193
 
1221
1194
  // ../renderers/src/components/VariableDateInput.tsx
1222
- import { jsx as jsx10 } from "react/jsx-runtime";
1195
+ import { jsx as jsx9 } from "react/jsx-runtime";
1223
1196
  function VariableDateInput({
1224
1197
  control,
1225
1198
  inputProps
@@ -1235,7 +1208,7 @@ function VariableDateInput({
1235
1208
  onFocus
1236
1209
  } = inputProps;
1237
1210
  if (control === "date-lookup") {
1238
- return /* @__PURE__ */ jsx10(
1211
+ return /* @__PURE__ */ jsx9(
1239
1212
  DateLookup,
1240
1213
  {
1241
1214
  value: dateStringToDateOrNull(inputProps.value),
@@ -1251,7 +1224,7 @@ function VariableDateInput({
1251
1224
  }
1252
1225
  );
1253
1226
  }
1254
- return /* @__PURE__ */ jsx10(
1227
+ return /* @__PURE__ */ jsx9(
1255
1228
  DateInput,
1256
1229
  __spreadProps(__spreadValues({}, inputProps), {
1257
1230
  dayAutoComplete: getAutocompleteString(autoComplete, "day"),
@@ -1268,7 +1241,7 @@ var getAutocompleteString = (value, suffix) => {
1268
1241
  var VariableDateInput_default = VariableDateInput;
1269
1242
 
1270
1243
  // ../renderers/src/DateInputRenderer.tsx
1271
- import { jsx as jsx11 } from "react/jsx-runtime";
1244
+ import { jsx as jsx10 } from "react/jsx-runtime";
1272
1245
  var DateInputRenderer = {
1273
1246
  canRenderType: "input-date",
1274
1247
  render: (props) => {
@@ -1293,7 +1266,7 @@ var DateInputRenderer = {
1293
1266
  ]);
1294
1267
  const value = initialValue != null ? initialValue : "";
1295
1268
  const inputProps = __spreadProps(__spreadValues({}, rest), { value, id });
1296
- return /* @__PURE__ */ jsx11(
1269
+ return /* @__PURE__ */ jsx10(
1297
1270
  FieldInput_default,
1298
1271
  {
1299
1272
  id,
@@ -1301,7 +1274,7 @@ var DateInputRenderer = {
1301
1274
  description,
1302
1275
  validation: validationState,
1303
1276
  help,
1304
- children: /* @__PURE__ */ jsx11(VariableDateInput_default, { control, inputProps })
1277
+ children: /* @__PURE__ */ jsx10(VariableDateInput_default, { control, inputProps })
1305
1278
  }
1306
1279
  );
1307
1280
  }
@@ -1309,28 +1282,28 @@ var DateInputRenderer = {
1309
1282
  var DateInputRenderer_default = DateInputRenderer;
1310
1283
 
1311
1284
  // ../renderers/src/DecisionRenderer.tsx
1312
- import { NavigationOptionsList, NavigationOption, Header } from "@transferwise/components";
1285
+ import { Header, NavigationOption, NavigationOptionsList } from "@transferwise/components";
1313
1286
 
1314
- // ../../node_modules/.pnpm/@wise+art@2.19.0_@transferwise+neptune-css@14.20.1_@types+react@18.3.18_react-dom@18.3.1_reac_mzw7cg6j4wc7ddwlhxck7linn4/node_modules/@wise/art/dist/index.esm.js
1287
+ // ../../node_modules/.pnpm/@wise+art@2.19.0_@transferwise+neptune-css@14.22.0_@types+react@18.3.18_react-dom@18.3.1_reac_62coi6aa7fmdhpcz7p72kf3gum/node_modules/@wise/art/dist/index.esm.js
1315
1288
  init_index_8Fxev6OI_esm();
1316
1289
  init_clsx();
1317
1290
  import "react";
1318
1291
  import "react/jsx-runtime";
1319
1292
 
1320
1293
  // ../renderers/src/components/icon/FlagIcon.tsx
1321
- import { jsx as jsx13 } from "react/jsx-runtime";
1294
+ import { jsx as jsx12 } from "react/jsx-runtime";
1322
1295
  var isFlagIcon = (name) => name.startsWith("flag-");
1323
1296
  function FlagIcon({ name }) {
1324
1297
  if (!isFlagIcon(name)) {
1325
1298
  return null;
1326
1299
  }
1327
1300
  const code = name.substring(5);
1328
- return /* @__PURE__ */ jsx13(Flag, { code });
1301
+ return /* @__PURE__ */ jsx12(Flag, { code });
1329
1302
  }
1330
1303
 
1331
1304
  // ../renderers/src/components/icon/NamedIcon.tsx
1332
1305
  import * as icons from "@transferwise/icons";
1333
- import { jsx as jsx14 } from "react/jsx-runtime";
1306
+ import { jsx as jsx13 } from "react/jsx-runtime";
1334
1307
  var isNamedIcon = (name) => {
1335
1308
  const iconName = toCapitalisedCamelCase(name);
1336
1309
  return Object.keys(icons).includes(iconName);
@@ -1341,19 +1314,19 @@ function NamedIcon({ name }) {
1341
1314
  }
1342
1315
  const iconName = toCapitalisedCamelCase(name);
1343
1316
  const Icon = icons[iconName];
1344
- return /* @__PURE__ */ jsx14(Icon, { size: 24 });
1317
+ return /* @__PURE__ */ jsx13(Icon, { size: 24 });
1345
1318
  }
1346
1319
  var toCapitalisedCamelCase = (value) => value.split("-").map(capitaliseFirstChar).join("");
1347
1320
  var capitaliseFirstChar = (value) => `${value[0].toUpperCase()}${value.slice(1)}`;
1348
1321
 
1349
1322
  // ../renderers/src/components/icon/DynamicIcon.tsx
1350
- import { jsx as jsx15 } from "react/jsx-runtime";
1323
+ import { jsx as jsx14 } from "react/jsx-runtime";
1351
1324
  function DynamicIcon({ name }) {
1352
1325
  if (isFlagIcon(name)) {
1353
- return /* @__PURE__ */ jsx15(FlagIcon, { name });
1326
+ return /* @__PURE__ */ jsx14(FlagIcon, { name });
1354
1327
  }
1355
1328
  if (isNamedIcon(name)) {
1356
- return /* @__PURE__ */ jsx15(NamedIcon, { name });
1329
+ return /* @__PURE__ */ jsx14(NamedIcon, { name });
1357
1330
  }
1358
1331
  return null;
1359
1332
  }
@@ -1361,46 +1334,51 @@ var DynamicIcon_default = DynamicIcon;
1361
1334
 
1362
1335
  // ../renderers/src/components/icon/NavigationOptionMedia.tsx
1363
1336
  import { Avatar, AvatarType } from "@transferwise/components";
1364
- import { jsx as jsx16 } from "react/jsx-runtime";
1337
+ import { jsx as jsx15 } from "react/jsx-runtime";
1365
1338
  function NavigationOptionMedia({ icon, image }) {
1366
1339
  if (!isNullish(icon)) {
1367
1340
  if ("name" in icon) {
1368
- return /* @__PURE__ */ jsx16(Avatar, { type: AvatarType.ICON, children: /* @__PURE__ */ jsx16(DynamicIcon_default, { name: icon.name }) });
1341
+ return /* @__PURE__ */ jsx15(Avatar, { type: AvatarType.ICON, children: /* @__PURE__ */ jsx15(DynamicIcon_default, { name: icon.name }) });
1369
1342
  }
1370
1343
  if (icon.text) {
1371
- return /* @__PURE__ */ jsx16(Avatar, { type: AvatarType.INITIALS, children: icon.text });
1344
+ return /* @__PURE__ */ jsx15(Avatar, { type: AvatarType.INITIALS, children: icon.text });
1372
1345
  }
1373
1346
  }
1374
1347
  if (image) {
1375
1348
  const { accessibilityDescription, uri, url } = image;
1376
1349
  if (uri && !uri.startsWith("urn:")) {
1377
- return /* @__PURE__ */ jsx16("img", { src: uri, alt: accessibilityDescription });
1350
+ return /* @__PURE__ */ jsx15("img", { src: uri, alt: accessibilityDescription });
1378
1351
  }
1379
1352
  if (url) {
1380
- return /* @__PURE__ */ jsx16("img", { src: url, alt: accessibilityDescription });
1353
+ return /* @__PURE__ */ jsx15("img", { src: url, alt: accessibilityDescription });
1381
1354
  }
1382
1355
  }
1383
1356
  return null;
1384
1357
  }
1385
1358
 
1386
1359
  // ../renderers/src/DecisionRenderer.tsx
1387
- import { jsx as jsx17, jsxs as jsxs4 } from "react/jsx-runtime";
1360
+ import { jsx as jsx16, jsxs as jsxs4 } from "react/jsx-runtime";
1388
1361
  var DecisionRenderer = {
1389
1362
  canRenderType: "decision",
1390
1363
  render: DecisionRendererComponent
1391
1364
  };
1392
1365
  var DecisionRenderer_default = DecisionRenderer;
1393
- function DecisionRendererComponent({ margin, options, title }) {
1394
- const { isLoading } = useLoadingContext();
1366
+ function DecisionRendererComponent({
1367
+ margin,
1368
+ options,
1369
+ title,
1370
+ stepLoadingState
1371
+ }) {
1372
+ const isLoading = stepLoadingState !== "idle";
1395
1373
  return /* @__PURE__ */ jsxs4("div", { className: getMargin(margin), children: [
1396
- title && /* @__PURE__ */ jsx17(Header, { as: "h2", title }),
1397
- /* @__PURE__ */ jsx17(NavigationOptionsList, { children: options.map(({ description, disabled, icon, image, title: itemTitle, onClick }) => /* @__PURE__ */ jsx17(
1374
+ title && /* @__PURE__ */ jsx16(Header, { as: "h2", title }),
1375
+ /* @__PURE__ */ jsx16(NavigationOptionsList, { children: options.map(({ description, disabled, icon, image, title: itemTitle, onClick }) => /* @__PURE__ */ jsx16(
1398
1376
  NavigationOption,
1399
1377
  {
1400
1378
  title: itemTitle,
1401
1379
  content: description,
1402
1380
  disabled: isLoading || disabled,
1403
- media: /* @__PURE__ */ jsx17(NavigationOptionMedia, { icon, image }),
1381
+ media: /* @__PURE__ */ jsx16(NavigationOptionMedia, { icon, image }),
1404
1382
  showMediaCircle: false,
1405
1383
  showMediaAtAllSizes: true,
1406
1384
  onClick
@@ -1411,35 +1389,35 @@ function DecisionRendererComponent({ margin, options, title }) {
1411
1389
  }
1412
1390
 
1413
1391
  // ../renderers/src/DividerRenderer.tsx
1414
- import { jsx as jsx18 } from "react/jsx-runtime";
1392
+ import { jsx as jsx17 } from "react/jsx-runtime";
1415
1393
  var DividerRenderer = {
1416
1394
  canRenderType: "divider",
1417
- render: ({ margin }) => /* @__PURE__ */ jsx18("hr", { className: `m-t-0 ${getMargin(margin)}` })
1395
+ render: ({ margin }) => /* @__PURE__ */ jsx17("hr", { className: `m-t-0 ${getMargin(margin)}` })
1418
1396
  };
1419
1397
  var DividerRenderer_default = DividerRenderer;
1420
1398
 
1421
1399
  // ../renderers/src/FormRenderer.tsx
1422
- import { jsx as jsx19 } from "react/jsx-runtime";
1400
+ import { jsx as jsx18 } from "react/jsx-runtime";
1423
1401
  var FormRenderer = {
1424
1402
  canRenderType: "form",
1425
- render: ({ children, margin }) => /* @__PURE__ */ jsx19("div", { className: getMargin(margin), children })
1403
+ render: ({ children, margin }) => /* @__PURE__ */ jsx18("div", { className: getMargin(margin), children })
1426
1404
  };
1427
1405
  var FormRenderer_default = FormRenderer;
1428
1406
 
1429
1407
  // ../renderers/src/FormSectionRenderer.tsx
1430
1408
  import { Header as Header2 } from "@transferwise/components";
1431
- import { jsx as jsx20, jsxs as jsxs5 } from "react/jsx-runtime";
1409
+ import { jsx as jsx19, jsxs as jsxs5 } from "react/jsx-runtime";
1432
1410
  var FormSectionRenderer = {
1433
1411
  canRenderType: "section",
1434
1412
  render: ({ title, description, children }) => /* @__PURE__ */ jsxs5("fieldset", { children: [
1435
- title && /* @__PURE__ */ jsx20(
1413
+ title && /* @__PURE__ */ jsx19(
1436
1414
  Header2,
1437
1415
  {
1438
1416
  as: "h2",
1439
1417
  title
1440
1418
  }
1441
1419
  ),
1442
- description && /* @__PURE__ */ jsx20("p", { children: description }),
1420
+ description && /* @__PURE__ */ jsx19("p", { children: description }),
1443
1421
  children
1444
1422
  ] })
1445
1423
  };
@@ -1447,32 +1425,32 @@ var FormSectionRenderer_default = FormSectionRenderer;
1447
1425
 
1448
1426
  // ../renderers/src/HeadingRenderer.tsx
1449
1427
  import { Display } from "@transferwise/components";
1450
- import { jsx as jsx21 } from "react/jsx-runtime";
1428
+ import { jsx as jsx20 } from "react/jsx-runtime";
1451
1429
  var HeadingRenderer = {
1452
1430
  canRenderType: "heading",
1453
- render: (props) => /* @__PURE__ */ jsx21(Heading, __spreadValues({}, props))
1431
+ render: (props) => /* @__PURE__ */ jsx20(Heading, __spreadValues({}, props))
1454
1432
  };
1455
1433
  function Heading(props) {
1456
1434
  const { text, size: size2, align, margin, control } = props;
1457
1435
  const className = getTextAlignmentAndMargin({ align, margin });
1458
- return control === "display" ? /* @__PURE__ */ jsx21(DisplayHeading, { size: size2, text, className }) : /* @__PURE__ */ jsx21(StandardHeading, { size: size2, text, className });
1436
+ return control === "display" ? /* @__PURE__ */ jsx20(DisplayHeading, { size: size2, text, className }) : /* @__PURE__ */ jsx20(StandardHeading, { size: size2, text, className });
1459
1437
  }
1460
1438
  function DisplayHeading({ size: size2, text, className }) {
1461
- return /* @__PURE__ */ jsx21(Display, { type: getDisplayType(size2), className, children: text });
1439
+ return /* @__PURE__ */ jsx20(Display, { type: getDisplayType(size2), className, children: text });
1462
1440
  }
1463
1441
  function StandardHeading({ size: size2, text, className }) {
1464
1442
  switch (size2) {
1465
1443
  case "xs":
1466
- return /* @__PURE__ */ jsx21("h5", { className, children: text });
1444
+ return /* @__PURE__ */ jsx20("h5", { className, children: text });
1467
1445
  case "sm":
1468
- return /* @__PURE__ */ jsx21("h4", { className, children: text });
1446
+ return /* @__PURE__ */ jsx20("h4", { className, children: text });
1469
1447
  case "lg":
1470
- return /* @__PURE__ */ jsx21("h2", { className, children: text });
1448
+ return /* @__PURE__ */ jsx20("h2", { className, children: text });
1471
1449
  case "xl":
1472
- return /* @__PURE__ */ jsx21("h1", { className, children: text });
1450
+ return /* @__PURE__ */ jsx20("h1", { className, children: text });
1473
1451
  case "md":
1474
1452
  default:
1475
- return /* @__PURE__ */ jsx21("h3", { className, children: text });
1453
+ return /* @__PURE__ */ jsx20("h3", { className, children: text });
1476
1454
  }
1477
1455
  }
1478
1456
  var getDisplayType = (size2) => {
@@ -1502,10 +1480,10 @@ function isRelativePath(url = "") {
1502
1480
  }
1503
1481
 
1504
1482
  // ../renderers/src/ImageRenderer.tsx
1505
- import { jsx as jsx22 } from "react/jsx-runtime";
1483
+ import { jsx as jsx21 } from "react/jsx-runtime";
1506
1484
  var ImageRenderer = {
1507
1485
  canRenderType: "image",
1508
- render: (props) => /* @__PURE__ */ jsx22(ImageRendererComponent, __spreadValues({}, props))
1486
+ render: (props) => /* @__PURE__ */ jsx21(ImageRendererComponent, __spreadValues({}, props))
1509
1487
  };
1510
1488
  var ImageRenderer_default = ImageRenderer;
1511
1489
  function ImageRendererComponent({
@@ -1513,10 +1491,10 @@ function ImageRendererComponent({
1513
1491
  margin,
1514
1492
  size: size2,
1515
1493
  uri,
1516
- url
1494
+ url,
1495
+ httpClient
1517
1496
  }) {
1518
1497
  const [imageSource, setImageSource] = useState2("");
1519
- const httpClient = useRendererHttpClient();
1520
1498
  useEffect2(() => {
1521
1499
  if (!uri) {
1522
1500
  void getImageSource(httpClient, url).then(setImageSource);
@@ -1524,10 +1502,9 @@ function ImageRendererComponent({
1524
1502
  }
1525
1503
  if (!uri.startsWith("urn:")) {
1526
1504
  void getImageSource(httpClient, uri).then(setImageSource);
1527
- return;
1528
1505
  }
1529
1506
  }, [uri, url, httpClient]);
1530
- return /* @__PURE__ */ jsx22("div", { className: `df-image ${size2 || "md"}`, children: /* @__PURE__ */ jsx22(
1507
+ return /* @__PURE__ */ jsx21("div", { className: `df-image ${size2 || "md"}`, children: /* @__PURE__ */ jsx21(
1531
1508
  Image,
1532
1509
  {
1533
1510
  className: `img-responsive ${getMargin(margin)}`,
@@ -1572,7 +1549,7 @@ var getImageSource = async (httpClient, imageUrl) => {
1572
1549
 
1573
1550
  // ../renderers/src/InstructionsRenderer.tsx
1574
1551
  import { Header as Header3, InstructionsList } from "@transferwise/components";
1575
- import { jsx as jsx23, jsxs as jsxs6 } from "react/jsx-runtime";
1552
+ import { jsx as jsx22, jsxs as jsxs6 } from "react/jsx-runtime";
1576
1553
  var doContext = ["positive", "neutral"];
1577
1554
  var dontContext = ["warning", "negative"];
1578
1555
  var InstructionsRenderer = {
@@ -1581,8 +1558,8 @@ var InstructionsRenderer = {
1581
1558
  const dos = items.filter((item) => doContext.includes(item.context)).map(({ text }) => text);
1582
1559
  const donts = items.filter((item) => dontContext.includes(item.context)).map(({ text }) => text);
1583
1560
  return /* @__PURE__ */ jsxs6("div", { className: getMargin(margin), children: [
1584
- title ? /* @__PURE__ */ jsx23(Header3, { title }) : null,
1585
- /* @__PURE__ */ jsx23(InstructionsList, { dos, donts })
1561
+ title ? /* @__PURE__ */ jsx22(Header3, { title }) : null,
1562
+ /* @__PURE__ */ jsx22(InstructionsList, { dos, donts })
1586
1563
  ] });
1587
1564
  }
1588
1565
  };
@@ -1600,11 +1577,11 @@ var onWheel = (event) => {
1600
1577
 
1601
1578
  // ../renderers/src/utils/getIconAvatar.tsx
1602
1579
  import { Avatar as Avatar2, AvatarType as AvatarType2 } from "@transferwise/components";
1603
- import { jsx as jsx24 } from "react/jsx-runtime";
1580
+ import { jsx as jsx23 } from "react/jsx-runtime";
1604
1581
  var size = 24;
1605
1582
  function getIconAvatar({ icon, image }) {
1606
1583
  if (image == null ? void 0 : image.url) {
1607
- return /* @__PURE__ */ jsx24(
1584
+ return /* @__PURE__ */ jsx23(
1608
1585
  "img",
1609
1586
  {
1610
1587
  src: image.url,
@@ -1615,13 +1592,13 @@ function getIconAvatar({ icon, image }) {
1615
1592
  );
1616
1593
  }
1617
1594
  if (isFlagIcon2(icon)) {
1618
- return /* @__PURE__ */ jsx24(Avatar2, { type: AvatarType2.ICON, size, children: /* @__PURE__ */ jsx24(DynamicIcon_default, { name: icon.name }) });
1595
+ return /* @__PURE__ */ jsx23(Avatar2, { type: AvatarType2.ICON, size, children: /* @__PURE__ */ jsx23(DynamicIcon_default, { name: icon.name }) });
1619
1596
  }
1620
1597
  if (isNamedIcon2(icon)) {
1621
- return /* @__PURE__ */ jsx24(DynamicIcon_default, { name: icon.name });
1598
+ return /* @__PURE__ */ jsx23(DynamicIcon_default, { name: icon.name });
1622
1599
  }
1623
1600
  if (icon && "text" in icon) {
1624
- return /* @__PURE__ */ jsx24(Avatar2, { type: AvatarType2.ICON, size, children: icon.text });
1601
+ return /* @__PURE__ */ jsx23(Avatar2, { type: AvatarType2.ICON, size, children: icon.text });
1625
1602
  }
1626
1603
  return null;
1627
1604
  }
@@ -1634,35 +1611,32 @@ var getInputGroupAddonStart = ({ icon, image }) => {
1634
1611
  return content ? { content } : void 0;
1635
1612
  };
1636
1613
 
1614
+ // ../renderers/src/utils/pick.ts
1615
+ function pick(obj, ...keys) {
1616
+ const result = {};
1617
+ keys.forEach((key) => {
1618
+ result[key] = obj[key];
1619
+ });
1620
+ return result;
1621
+ }
1622
+
1637
1623
  // ../renderers/src/IntegerInputRenderer.tsx
1638
- import { jsx as jsx25 } from "react/jsx-runtime";
1624
+ import { jsx as jsx24 } from "react/jsx-runtime";
1639
1625
  var IntegerInputRenderer = {
1640
1626
  canRenderType: "input-integer",
1641
1627
  render: (props) => {
1642
- const _a = props, {
1643
- id,
1644
- title,
1645
- description,
1646
- help,
1647
- icon,
1648
- image,
1649
- type,
1650
- validationState,
1651
- value,
1652
- onChange
1653
- } = _a, rest = __objRest(_a, [
1654
- "id",
1655
- "title",
1656
- "description",
1657
- "help",
1658
- "icon",
1659
- "image",
1660
- "type",
1661
- "validationState",
1662
- "value",
1663
- "onChange"
1664
- ]);
1665
- return /* @__PURE__ */ jsx25(
1628
+ const { id, title, description, help, icon, image, validationState, value, onChange } = props;
1629
+ const commonProps = pick(
1630
+ props,
1631
+ "autoComplete",
1632
+ "disabled",
1633
+ "onBlur",
1634
+ "onFocus",
1635
+ "placeholder",
1636
+ "maximum",
1637
+ "minimum"
1638
+ );
1639
+ return /* @__PURE__ */ jsx24(
1666
1640
  FieldInput_default,
1667
1641
  {
1668
1642
  id,
@@ -1670,7 +1644,7 @@ var IntegerInputRenderer = {
1670
1644
  description,
1671
1645
  validation: validationState,
1672
1646
  help,
1673
- children: /* @__PURE__ */ jsx25(InputGroup, { addonStart: getInputGroupAddonStart({ icon, image }), children: /* @__PURE__ */ jsx25(
1647
+ children: /* @__PURE__ */ jsx24(InputGroup, { addonStart: getInputGroupAddonStart({ icon, image }), children: /* @__PURE__ */ jsx24(
1674
1648
  Input,
1675
1649
  __spreadValues({
1676
1650
  id,
@@ -1684,7 +1658,7 @@ var IntegerInputRenderer = {
1684
1658
  onChange(Number.isNaN(parsedValue) ? null : parsedValue);
1685
1659
  },
1686
1660
  onWheel
1687
- }, rest)
1661
+ }, commonProps)
1688
1662
  ) })
1689
1663
  }
1690
1664
  );
@@ -1694,10 +1668,10 @@ var IntegerInputRenderer_default = IntegerInputRenderer;
1694
1668
 
1695
1669
  // ../renderers/src/LoadingIndicatorRenderer.tsx
1696
1670
  import { Loader } from "@transferwise/components";
1697
- import { jsx as jsx26 } from "react/jsx-runtime";
1671
+ import { jsx as jsx25 } from "react/jsx-runtime";
1698
1672
  var LoadingIndicatorRenderer = {
1699
1673
  canRenderType: "loading-indicator",
1700
- render: ({ margin, size: size2 }) => /* @__PURE__ */ jsx26(
1674
+ render: ({ margin, size: size2 }) => /* @__PURE__ */ jsx25(
1701
1675
  Loader,
1702
1676
  {
1703
1677
  size: size2,
@@ -1710,35 +1684,35 @@ var LoadingIndicatorRenderer_default = LoadingIndicatorRenderer;
1710
1684
 
1711
1685
  // ../renderers/src/MarkdownRenderer.tsx
1712
1686
  import { Markdown as Markdown2 } from "@transferwise/components";
1713
- import { jsx as jsx27 } from "react/jsx-runtime";
1687
+ import { jsx as jsx26 } from "react/jsx-runtime";
1714
1688
  var MarkdownRenderer = {
1715
1689
  canRenderType: "markdown",
1716
- render: ({ content, align, margin }) => /* @__PURE__ */ jsx27("div", { className: getTextAlignmentAndMargin({ align, margin }), children: /* @__PURE__ */ jsx27(Markdown2, { config: { link: { target: "_blank" } }, children: content }) })
1690
+ render: ({ content, align, margin }) => /* @__PURE__ */ jsx26("div", { className: getTextAlignmentAndMargin({ align, margin }), children: /* @__PURE__ */ jsx26(Markdown2, { config: { link: { target: "_blank" } }, children: content }) })
1717
1691
  };
1718
1692
  var MarkdownRenderer_default = MarkdownRenderer;
1719
1693
 
1720
1694
  // ../renderers/src/ModalRenderer.tsx
1721
1695
  import { Button as Button2, Modal } from "@transferwise/components";
1722
1696
  import { useState as useState3 } from "react";
1723
- import { jsx as jsx28, jsxs as jsxs7 } from "react/jsx-runtime";
1697
+ import { jsx as jsx27, jsxs as jsxs7 } from "react/jsx-runtime";
1724
1698
  var ModalRenderer = {
1725
1699
  canRenderType: "modal",
1726
- render: (props) => /* @__PURE__ */ jsx28(DFModal, __spreadValues({}, props))
1700
+ render: (props) => /* @__PURE__ */ jsx27(DFModal, __spreadValues({}, props))
1727
1701
  };
1728
1702
  var ModalRenderer_default = ModalRenderer;
1729
1703
  function DFModal({ content, margin, trigger }) {
1730
1704
  const [visible, setVisible] = useState3(false);
1731
- const { components, title } = content;
1705
+ const { children, title } = content;
1732
1706
  return /* @__PURE__ */ jsxs7("div", { className: getMargin(margin), children: [
1733
- /* @__PURE__ */ jsx28(Button2, { priority: "tertiary", block: true, onClick: () => setVisible(true), children: trigger.title }),
1734
- /* @__PURE__ */ jsx28(
1707
+ /* @__PURE__ */ jsx27(Button2, { priority: "tertiary", block: true, onClick: () => setVisible(true), children: trigger.title }),
1708
+ /* @__PURE__ */ jsx27(
1735
1709
  Modal,
1736
1710
  {
1737
1711
  scroll: "content",
1738
1712
  open: visible,
1739
1713
  size: "lg",
1740
1714
  title,
1741
- body: components,
1715
+ body: children,
1742
1716
  onClose: () => setVisible(false)
1743
1717
  }
1744
1718
  )
@@ -1750,16 +1724,16 @@ import { SelectInput, SelectInputOptionContent } from "@transferwise/components"
1750
1724
 
1751
1725
  // ../renderers/src/SelectInputRenderer/OptionMedia.tsx
1752
1726
  import { Avatar as Avatar3, AvatarType as AvatarType3 } from "@transferwise/components";
1753
- import { jsx as jsx29 } from "react/jsx-runtime";
1727
+ import { jsx as jsx28 } from "react/jsx-runtime";
1754
1728
  function OptionMedia({ icon, image }) {
1755
1729
  if (image == null ? void 0 : image.url) {
1756
- return /* @__PURE__ */ jsx29("img", { src: image.url, alt: image.accessibilityDescription || "", width: "64px" });
1730
+ return /* @__PURE__ */ jsx28("img", { src: image.url, alt: image.accessibilityDescription || "", width: "64px" });
1757
1731
  }
1758
1732
  if (icon && "name" in icon) {
1759
- return /* @__PURE__ */ jsx29(Avatar3, { type: AvatarType3.ICON, children: /* @__PURE__ */ jsx29(DynamicIcon_default, { name: icon.name }) });
1733
+ return /* @__PURE__ */ jsx28(Avatar3, { type: AvatarType3.ICON, children: /* @__PURE__ */ jsx28(DynamicIcon_default, { name: icon.name }) });
1760
1734
  }
1761
1735
  if (icon && "text" in icon) {
1762
- return /* @__PURE__ */ jsx29(Avatar3, { type: AvatarType3.INITIALS, children: icon.text });
1736
+ return /* @__PURE__ */ jsx28(Avatar3, { type: AvatarType3.INITIALS, children: icon.text });
1763
1737
  }
1764
1738
  return null;
1765
1739
  }
@@ -1779,10 +1753,10 @@ var multi_select_messages_default = defineMessages2({
1779
1753
 
1780
1754
  // ../renderers/src/MultiSelectInputRenderer.tsx
1781
1755
  import { useState as useState4 } from "react";
1782
- import { jsx as jsx30 } from "react/jsx-runtime";
1756
+ import { jsx as jsx29 } from "react/jsx-runtime";
1783
1757
  var MultiSelectInputRenderer = {
1784
1758
  canRenderType: "input-multi-select",
1785
- render: (props) => /* @__PURE__ */ jsx30(MultiSelectInputRendererComponent, __spreadValues({}, props))
1759
+ render: (props) => /* @__PURE__ */ jsx29(MultiSelectInputRendererComponent, __spreadValues({}, props))
1786
1760
  };
1787
1761
  function MultiSelectInputRendererComponent(props) {
1788
1762
  const { formatMessage } = useIntl2();
@@ -1824,12 +1798,12 @@ function MultiSelectInputRendererComponent(props) {
1824
1798
  const contentProps = {
1825
1799
  title: option.title,
1826
1800
  description: option.description,
1827
- icon: /* @__PURE__ */ jsx30(OptionMedia, { icon: option.icon, image: option.image })
1801
+ icon: /* @__PURE__ */ jsx29(OptionMedia, { icon: option.icon, image: option.image })
1828
1802
  };
1829
- return /* @__PURE__ */ jsx30(SelectInputOptionContent, __spreadValues({}, contentProps));
1803
+ return /* @__PURE__ */ jsx29(SelectInputOptionContent, __spreadValues({}, contentProps));
1830
1804
  };
1831
1805
  const extraProps = { autoComplete };
1832
- return /* @__PURE__ */ jsx30(
1806
+ return /* @__PURE__ */ jsx29(
1833
1807
  FieldInput_default,
1834
1808
  {
1835
1809
  id,
@@ -1837,7 +1811,7 @@ function MultiSelectInputRendererComponent(props) {
1837
1811
  help,
1838
1812
  description,
1839
1813
  validation: validationState,
1840
- children: /* @__PURE__ */ jsx30(
1814
+ children: /* @__PURE__ */ jsx29(
1841
1815
  SelectInput,
1842
1816
  __spreadValues({
1843
1817
  id,
@@ -1881,7 +1855,7 @@ import { UploadInput } from "@transferwise/components";
1881
1855
  // ../renderers/src/components/UploadFieldInput.tsx
1882
1856
  var import_classnames3 = __toESM(require_classnames());
1883
1857
  import { InlineAlert } from "@transferwise/components";
1884
- import { jsx as jsx31, jsxs as jsxs8 } from "react/jsx-runtime";
1858
+ import { jsx as jsx30, jsxs as jsxs8 } from "react/jsx-runtime";
1885
1859
  function UploadFieldInput({
1886
1860
  id,
1887
1861
  children,
@@ -1890,7 +1864,7 @@ function UploadFieldInput({
1890
1864
  help,
1891
1865
  validation
1892
1866
  }) {
1893
- const labelContent = label && help ? /* @__PURE__ */ jsx31(LabelContentWithHelp, { text: label, help }) : label;
1867
+ const labelContent = label && help ? /* @__PURE__ */ jsx30(LabelContentWithHelp, { text: label, help }) : label;
1894
1868
  const descriptionId = description ? `${id}-description` : void 0;
1895
1869
  return /* @__PURE__ */ jsxs8(
1896
1870
  "div",
@@ -1899,9 +1873,9 @@ function UploadFieldInput({
1899
1873
  "has-error": (validation == null ? void 0 : validation.status) === "invalid"
1900
1874
  }),
1901
1875
  children: [
1902
- /* @__PURE__ */ jsx31("label", { htmlFor: id, className: "control-label", children: labelContent }),
1876
+ /* @__PURE__ */ jsx30("label", { htmlFor: id, className: "control-label", children: labelContent }),
1903
1877
  children,
1904
- (validation == null ? void 0 : validation.status) === "invalid" && /* @__PURE__ */ jsx31(InlineAlert, { type: "negative", id: descriptionId, children: validation.message })
1878
+ (validation == null ? void 0 : validation.status) === "invalid" && /* @__PURE__ */ jsx30(InlineAlert, { type: "negative", id: descriptionId, children: validation.message })
1905
1879
  ]
1906
1880
  }
1907
1881
  );
@@ -1930,7 +1904,7 @@ var getFileType = (base64Url) => {
1930
1904
  };
1931
1905
 
1932
1906
  // ../renderers/src/MultiUploadInputRenderer.tsx
1933
- import { jsx as jsx32 } from "react/jsx-runtime";
1907
+ import { jsx as jsx31 } from "react/jsx-runtime";
1934
1908
  var MultiUploadInputRenderer = {
1935
1909
  canRenderType: "input-upload-multi",
1936
1910
  render: (props) => {
@@ -1955,7 +1929,7 @@ var MultiUploadInputRenderer = {
1955
1929
  };
1956
1930
  const onDeleteFile = async (fileId) => onRemoveFile(value.findIndex((file) => file.id === fileId));
1957
1931
  const descriptionId = description ? `${id}-description` : void 0;
1958
- return /* @__PURE__ */ jsx32(
1932
+ return /* @__PURE__ */ jsx31(
1959
1933
  UploadFieldInput_default,
1960
1934
  {
1961
1935
  id,
@@ -1963,7 +1937,7 @@ var MultiUploadInputRenderer = {
1963
1937
  description,
1964
1938
  validation: validationState,
1965
1939
  help,
1966
- children: /* @__PURE__ */ jsx32(
1940
+ children: /* @__PURE__ */ jsx31(
1967
1941
  UploadInput,
1968
1942
  {
1969
1943
  id,
@@ -1987,34 +1961,21 @@ var MultiUploadInputRenderer_default = MultiUploadInputRenderer;
1987
1961
 
1988
1962
  // ../renderers/src/NumberInputRenderer.tsx
1989
1963
  import { Input as Input2, InputGroup as InputGroup2 } from "@transferwise/components";
1990
- import { jsx as jsx33 } from "react/jsx-runtime";
1964
+ import { jsx as jsx32 } from "react/jsx-runtime";
1991
1965
  var NumberInputRenderer = {
1992
1966
  canRenderType: "input-number",
1993
1967
  render: (props) => {
1994
- const _a = props, {
1995
- id,
1996
- title,
1997
- description,
1998
- help,
1999
- icon,
2000
- image,
2001
- type,
2002
- validationState,
2003
- value,
2004
- onChange
2005
- } = _a, rest = __objRest(_a, [
2006
- "id",
2007
- "title",
2008
- "description",
2009
- "help",
2010
- "icon",
2011
- "image",
2012
- "type",
2013
- "validationState",
2014
- "value",
2015
- "onChange"
2016
- ]);
2017
- return /* @__PURE__ */ jsx33(
1968
+ const { id, title, description, help, icon, image, validationState, value, onChange } = props;
1969
+ const commonProps = pick(
1970
+ props,
1971
+ "disabled",
1972
+ "onBlur",
1973
+ "onFocus",
1974
+ "placeholder",
1975
+ "maximum",
1976
+ "minimum"
1977
+ );
1978
+ return /* @__PURE__ */ jsx32(
2018
1979
  FieldInput_default,
2019
1980
  {
2020
1981
  id,
@@ -2022,7 +1983,7 @@ var NumberInputRenderer = {
2022
1983
  description,
2023
1984
  validation: validationState,
2024
1985
  help,
2025
- children: /* @__PURE__ */ jsx33(InputGroup2, { addonStart: getInputGroupAddonStart({ icon, image }), children: /* @__PURE__ */ jsx33(
1986
+ children: /* @__PURE__ */ jsx32(InputGroup2, { addonStart: getInputGroupAddonStart({ icon, image }), children: /* @__PURE__ */ jsx32(
2026
1987
  Input2,
2027
1988
  __spreadValues({
2028
1989
  id,
@@ -2034,7 +1995,7 @@ var NumberInputRenderer = {
2034
1995
  onChange(Number.isNaN(parsedValue) ? null : parsedValue);
2035
1996
  },
2036
1997
  onWheel
2037
- }, rest)
1998
+ }, commonProps)
2038
1999
  ) })
2039
2000
  }
2040
2001
  );
@@ -2047,9 +2008,9 @@ import { useIntl as useIntl3 } from "react-intl";
2047
2008
 
2048
2009
  // ../renderers/src/hooks/useSnackBarIfAvailable.ts
2049
2010
  import { SnackbarContext } from "@transferwise/components";
2050
- import { useContext as useContext3 } from "react";
2011
+ import { useContext } from "react";
2051
2012
  function useSnackBarIfAvailable() {
2052
- const context = useContext3(SnackbarContext);
2013
+ const context = useContext(SnackbarContext);
2053
2014
  return context ? context.createSnackbar : () => {
2054
2015
  };
2055
2016
  }
@@ -2074,17 +2035,17 @@ var paragraph_messages_default = defineMessages3({
2074
2035
  });
2075
2036
 
2076
2037
  // ../renderers/src/ParagraphRenderer.tsx
2077
- import { jsx as jsx34, jsxs as jsxs9 } from "react/jsx-runtime";
2038
+ import { jsx as jsx33, jsxs as jsxs9 } from "react/jsx-runtime";
2078
2039
  var ParagraphRenderer = {
2079
2040
  canRenderType: "paragraph",
2080
- render: (props) => /* @__PURE__ */ jsx34(Paragraph, __spreadValues({}, props))
2041
+ render: (props) => /* @__PURE__ */ jsx33(Paragraph, __spreadValues({}, props))
2081
2042
  };
2082
2043
  function Paragraph({ align, control, margin, text }) {
2083
2044
  const className = getTextAlignmentAndMargin({ align, margin });
2084
- return control === "copyable" ? /* @__PURE__ */ jsx34(CopyableParagraph, { className, align, text }) : /* @__PURE__ */ jsx34(StandardParagraph, { className, text });
2045
+ return control === "copyable" ? /* @__PURE__ */ jsx33(CopyableParagraph, { className, align, text }) : /* @__PURE__ */ jsx33(StandardParagraph, { className, text });
2085
2046
  }
2086
2047
  function StandardParagraph({ text, className }) {
2087
- return /* @__PURE__ */ jsx34("p", { className: `np-text-body-large ${className}`, children: text });
2048
+ return /* @__PURE__ */ jsx33("p", { className: `np-text-body-large ${className}`, children: text });
2088
2049
  }
2089
2050
  function CopyableParagraph({
2090
2051
  text,
@@ -2099,7 +2060,7 @@ function CopyableParagraph({
2099
2060
  };
2100
2061
  const inputAlignmentClasses = getTextAlignmentAndMargin({ align, margin: "sm" });
2101
2062
  return /* @__PURE__ */ jsxs9("div", { className, children: [
2102
- /* @__PURE__ */ jsx34(
2063
+ /* @__PURE__ */ jsx33(
2103
2064
  Input3,
2104
2065
  {
2105
2066
  type: "text",
@@ -2108,7 +2069,7 @@ function CopyableParagraph({
2108
2069
  className: (0, import_classnames4.default)("text-ellipsis", inputAlignmentClasses)
2109
2070
  }
2110
2071
  ),
2111
- /* @__PURE__ */ jsx34(Button3, { block: true, onClick: copy, children: formatMessage(paragraph_messages_default.copy) })
2072
+ /* @__PURE__ */ jsx33(Button3, { block: true, onClick: copy, children: formatMessage(paragraph_messages_default.copy) })
2112
2073
  ] });
2113
2074
  }
2114
2075
  var ParagraphRenderer_default = ParagraphRenderer;
@@ -2146,10 +2107,10 @@ var repeatable_messages_default = defineMessages4({
2146
2107
 
2147
2108
  // ../renderers/src/RepeatableRenderer.tsx
2148
2109
  var import_classnames5 = __toESM(require_classnames());
2149
- import { Fragment as Fragment2, jsx as jsx35, jsxs as jsxs10 } from "react/jsx-runtime";
2110
+ import { Fragment as Fragment2, jsx as jsx34, jsxs as jsxs10 } from "react/jsx-runtime";
2150
2111
  var RepeatableRenderer = {
2151
2112
  canRenderType: "repeatable",
2152
- render: (props) => /* @__PURE__ */ jsx35(Repeatable, __spreadValues({}, props))
2113
+ render: (props) => /* @__PURE__ */ jsx34(Repeatable, __spreadValues({}, props))
2153
2114
  };
2154
2115
  function Repeatable(props) {
2155
2116
  const {
@@ -2189,8 +2150,8 @@ function Repeatable(props) {
2189
2150
  setOpenModalType(null);
2190
2151
  };
2191
2152
  return /* @__PURE__ */ jsxs10(Fragment2, { children: [
2192
- title && /* @__PURE__ */ jsx35(Header4, { title }),
2193
- description && /* @__PURE__ */ jsx35("p", { children: description }),
2153
+ title && /* @__PURE__ */ jsx34(Header4, { title }),
2154
+ description && /* @__PURE__ */ jsx34("p", { children: description }),
2194
2155
  /* @__PURE__ */ jsxs10(
2195
2156
  "div",
2196
2157
  {
@@ -2198,30 +2159,30 @@ function Repeatable(props) {
2198
2159
  "has-error": (validationState == null ? void 0 : validationState.status) === "invalid"
2199
2160
  }),
2200
2161
  children: [
2201
- items == null ? void 0 : items.map((item, index) => /* @__PURE__ */ jsx35(ItemSummaryOption, { item, onClick: () => onEditItem(index) }, item.id)),
2202
- /* @__PURE__ */ jsx35(
2162
+ items == null ? void 0 : items.map((item, index) => /* @__PURE__ */ jsx34(ItemSummaryOption, { item, onClick: () => onEditItem(index) }, item.id)),
2163
+ /* @__PURE__ */ jsx34(
2203
2164
  NavigationOption2,
2204
2165
  {
2205
- media: /* @__PURE__ */ jsx35(Plus, {}),
2166
+ media: /* @__PURE__ */ jsx34(Plus, {}),
2206
2167
  title: addItemTitle || formatMessage(repeatable_messages_default.addItemTitle),
2207
2168
  showMediaAtAllSizes: true,
2208
2169
  onClick: () => onAddItem()
2209
2170
  }
2210
2171
  ),
2211
- (validationState == null ? void 0 : validationState.status) === "invalid" && /* @__PURE__ */ jsx35(InlineAlert2, { type: "negative", children: validationState.message })
2172
+ (validationState == null ? void 0 : validationState.status) === "invalid" && /* @__PURE__ */ jsx34(InlineAlert2, { type: "negative", children: validationState.message })
2212
2173
  ]
2213
2174
  }
2214
2175
  ),
2215
- /* @__PURE__ */ jsx35(
2176
+ /* @__PURE__ */ jsx34(
2216
2177
  Modal2,
2217
2178
  {
2218
2179
  open: openModalType !== null,
2219
2180
  title: (openModalType === "add" ? addItemTitle : editItemTitle) || formatMessage(repeatable_messages_default.addItemTitle),
2220
2181
  body: /* @__PURE__ */ jsxs10(Fragment2, { children: [
2221
- /* @__PURE__ */ jsx35("div", { className: "m-b-2", children: editableItem }),
2182
+ /* @__PURE__ */ jsx34("div", { className: "m-b-2", children: editableItem }),
2222
2183
  /* @__PURE__ */ jsxs10("div", { children: [
2223
- /* @__PURE__ */ jsx35(Button4, { priority: "primary", block: true, className: "m-b-2", onClick: () => onSaveItem(), children: formatMessage(repeatable_messages_default.addItem) }),
2224
- /* @__PURE__ */ jsx35(Button4, { priority: "secondary", type: "negative", block: true, onClick: () => onRemoveItem(), children: formatMessage(repeatable_messages_default.removeItem) })
2184
+ /* @__PURE__ */ jsx34(Button4, { priority: "primary", block: true, className: "m-b-2", onClick: () => onSaveItem(), children: formatMessage(repeatable_messages_default.addItem) }),
2185
+ /* @__PURE__ */ jsx34(Button4, { priority: "secondary", type: "negative", block: true, onClick: () => onRemoveItem(), children: formatMessage(repeatable_messages_default.removeItem) })
2225
2186
  ] })
2226
2187
  ] }),
2227
2188
  onClose: () => onCancelEdit()
@@ -2233,10 +2194,10 @@ function ItemSummaryOption({
2233
2194
  item,
2234
2195
  onClick
2235
2196
  }) {
2236
- return /* @__PURE__ */ jsx35(
2197
+ return /* @__PURE__ */ jsx34(
2237
2198
  NavigationOption2,
2238
2199
  {
2239
- media: /* @__PURE__ */ jsx35(NavigationOptionMedia, __spreadValues({}, item)),
2200
+ media: /* @__PURE__ */ jsx34(NavigationOptionMedia, __spreadValues({}, item)),
2240
2201
  title: item.title,
2241
2202
  content: item.description,
2242
2203
  showMediaAtAllSizes: true,
@@ -2248,13 +2209,25 @@ var RepeatableRenderer_default = RepeatableRenderer;
2248
2209
 
2249
2210
  // ../renderers/src/SearchRenderer/BlockSearchRendererComponent.tsx
2250
2211
  import { Input as Input4, Markdown as Markdown3, NavigationOption as NavigationOption3, NavigationOptionsList as NavigationOptionsList2 } from "@transferwise/components";
2212
+ import { useState as useState6 } from "react";
2213
+ import { useIntl as useIntl6 } from "react-intl";
2214
+
2215
+ // ../renderers/src/messages/search.messages.ts
2216
+ import { defineMessages as defineMessages5 } from "react-intl";
2217
+ var search_messages_default = defineMessages5({
2218
+ loading: {
2219
+ id: "df.wise.SearchLayout.loading",
2220
+ defaultMessage: "Loading...",
2221
+ description: "A message shown to the user while their search is being processed, before results appear."
2222
+ }
2223
+ });
2251
2224
 
2252
2225
  // ../renderers/src/SearchRenderer/ErrorResult.tsx
2253
2226
  import { useIntl as useIntl5 } from "react-intl";
2254
2227
 
2255
2228
  // ../renderers/src/messages/generic-error.messages.ts
2256
- import { defineMessages as defineMessages5 } from "react-intl";
2257
- var generic_error_messages_default = defineMessages5({
2229
+ import { defineMessages as defineMessages6 } from "react-intl";
2230
+ var generic_error_messages_default = defineMessages6({
2258
2231
  genericErrorRetryHint: {
2259
2232
  id: "df.wise.PersistAsyncSchema.genericError",
2260
2233
  defaultMessage: "Something went wrong, please try again.",
@@ -2274,7 +2247,7 @@ var generic_error_messages_default = defineMessages5({
2274
2247
 
2275
2248
  // ../renderers/src/SearchRenderer/ErrorResult.tsx
2276
2249
  import { Button as Button5 } from "@transferwise/components";
2277
- import { jsx as jsx36, jsxs as jsxs11 } from "react/jsx-runtime";
2250
+ import { jsx as jsx35, jsxs as jsxs11 } from "react/jsx-runtime";
2278
2251
  function ErrorResult({ state }) {
2279
2252
  const intl = useIntl5();
2280
2253
  const buttonVisualProps = {
@@ -2285,7 +2258,7 @@ function ErrorResult({ state }) {
2285
2258
  return /* @__PURE__ */ jsxs11("p", { className: "m-t-2", children: [
2286
2259
  intl.formatMessage(generic_error_messages_default.genericError),
2287
2260
  "\xA0",
2288
- /* @__PURE__ */ jsx36(
2261
+ /* @__PURE__ */ jsx35(
2289
2262
  Button5,
2290
2263
  __spreadProps(__spreadValues({}, buttonVisualProps), {
2291
2264
  onClick: () => {
@@ -2298,35 +2271,21 @@ function ErrorResult({ state }) {
2298
2271
  }
2299
2272
 
2300
2273
  // ../renderers/src/SearchRenderer/BlockSearchRendererComponent.tsx
2301
- import { useState as useState6 } from "react";
2302
-
2303
- // ../renderers/src/messages/search.messages.ts
2304
- import { defineMessages as defineMessages6 } from "react-intl";
2305
- var search_messages_default = defineMessages6({
2306
- loading: {
2307
- id: "df.wise.SearchLayout.loading",
2308
- defaultMessage: "Loading...",
2309
- description: "A message shown to the user while their search is being processed, before results appear."
2310
- }
2311
- });
2312
-
2313
- // ../renderers/src/SearchRenderer/BlockSearchRendererComponent.tsx
2314
- import { useIntl as useIntl6 } from "react-intl";
2315
- import { Fragment as Fragment3, jsx as jsx37, jsxs as jsxs12 } from "react/jsx-runtime";
2274
+ import { Fragment as Fragment3, jsx as jsx36, jsxs as jsxs12 } from "react/jsx-runtime";
2316
2275
  function BlockSearchRendererComponent({
2317
2276
  id,
2318
2277
  isLoading,
2319
2278
  margin,
2320
- onChange,
2321
2279
  query,
2322
2280
  state,
2323
- title
2281
+ title,
2282
+ trackEvent,
2283
+ onChange
2324
2284
  }) {
2325
2285
  const [hasSearched, setHasSearched] = useState6(false);
2326
- const trackEvent = useTrackEvent();
2327
2286
  const { formatMessage } = useIntl6();
2328
2287
  return /* @__PURE__ */ jsxs12("div", { className: getMargin(margin), children: [
2329
- /* @__PURE__ */ jsx37(FieldInput_default, { id, description: "", validation: void 0, help: "", label: title, children: /* @__PURE__ */ jsx37(
2288
+ /* @__PURE__ */ jsx36(FieldInput_default, { id, description: "", validation: void 0, help: "", label: title, children: /* @__PURE__ */ jsx36(
2330
2289
  Input4,
2331
2290
  {
2332
2291
  id,
@@ -2343,35 +2302,35 @@ function BlockSearchRendererComponent({
2343
2302
  }
2344
2303
  }
2345
2304
  ) }),
2346
- isLoading ? /* @__PURE__ */ jsx37(Fragment3, { children: formatMessage(search_messages_default.loading) }) : /* @__PURE__ */ jsx37(SearchResultContent, { state, onChange })
2305
+ isLoading ? /* @__PURE__ */ jsx36(Fragment3, { children: formatMessage(search_messages_default.loading) }) : /* @__PURE__ */ jsx36(SearchResultContent, { state, trackEvent })
2347
2306
  ] });
2348
2307
  }
2349
2308
  function SearchResultContent({
2350
2309
  state,
2351
- onChange
2310
+ trackEvent
2352
2311
  }) {
2353
2312
  switch (state.type) {
2354
2313
  case "error":
2355
- return /* @__PURE__ */ jsx37(ErrorResult, { state });
2314
+ return /* @__PURE__ */ jsx36(ErrorResult, { state });
2356
2315
  case "results":
2357
- return /* @__PURE__ */ jsx37(SearchResults, { state, onChange });
2316
+ return /* @__PURE__ */ jsx36(SearchResults, { state, trackEvent });
2358
2317
  case "noResults":
2359
- return /* @__PURE__ */ jsx37(EmptySearchResult, { state });
2318
+ return /* @__PURE__ */ jsx36(EmptySearchResult, { state });
2360
2319
  case "pending":
2361
2320
  default:
2362
2321
  return null;
2363
2322
  }
2364
2323
  }
2365
2324
  function EmptySearchResult({ state }) {
2366
- return /* @__PURE__ */ jsx37(Markdown3, { className: "m-t-2", config: { link: { target: "_blank" } }, children: state.message });
2325
+ return /* @__PURE__ */ jsx36(Markdown3, { className: "m-t-2", config: { link: { target: "_blank" } }, children: state.message });
2367
2326
  }
2368
2327
  function SearchResults({
2369
- state
2328
+ state,
2329
+ trackEvent
2370
2330
  }) {
2371
- const trackEvent = useTrackEvent();
2372
- return /* @__PURE__ */ jsx37(NavigationOptionsList2, { children: state.results.map((result) => {
2331
+ return /* @__PURE__ */ jsx36(NavigationOptionsList2, { children: state.results.map((result) => {
2373
2332
  const { icon, image } = result;
2374
- return /* @__PURE__ */ jsx37(
2333
+ return /* @__PURE__ */ jsx36(
2375
2334
  NavigationOption3,
2376
2335
  {
2377
2336
  title: result.title,
@@ -2397,19 +2356,19 @@ import { Markdown as Markdown4, Typeahead } from "@transferwise/components";
2397
2356
  import { Search } from "@transferwise/icons";
2398
2357
  import { useState as useState7 } from "react";
2399
2358
  import { useIntl as useIntl7 } from "react-intl";
2400
- import { jsx as jsx38 } from "react/jsx-runtime";
2359
+ import { jsx as jsx37 } from "react/jsx-runtime";
2401
2360
  function InlineSearchRenderer({
2402
2361
  id,
2403
2362
  isLoading,
2404
2363
  margin,
2405
2364
  onChange,
2406
2365
  state,
2407
- title
2366
+ title,
2367
+ trackEvent
2408
2368
  }) {
2409
2369
  const [hasSearched, setHasSearched] = useState7(false);
2410
- const trackEvent = useTrackEvent();
2411
2370
  const intl = useIntl7();
2412
- return /* @__PURE__ */ jsx38("div", { className: getMargin(margin), children: /* @__PURE__ */ jsx38(FieldInput_default, { id, description: "", validation: void 0, help: "", label: title, children: /* @__PURE__ */ jsx38(
2371
+ return /* @__PURE__ */ jsx37("div", { className: getMargin(margin), children: /* @__PURE__ */ jsx37(FieldInput_default, { id, description: "", validation: void 0, help: "", label: title, children: /* @__PURE__ */ jsx37(
2413
2372
  Typeahead,
2414
2373
  {
2415
2374
  id: "typeahead-input-id",
@@ -2417,10 +2376,10 @@ function InlineSearchRenderer({
2417
2376
  name: "typeahead-input-name",
2418
2377
  size: "md",
2419
2378
  maxHeight: 100,
2420
- footer: /* @__PURE__ */ jsx38(TypeaheadFooter, { state, isLoading }),
2379
+ footer: /* @__PURE__ */ jsx37(TypeaheadFooter, { state, isLoading }),
2421
2380
  multiple: false,
2422
2381
  clearable: false,
2423
- addon: /* @__PURE__ */ jsx38(Search, { size: 24 }),
2382
+ addon: /* @__PURE__ */ jsx37(Search, { size: 24 }),
2424
2383
  options: state.type === "results" ? state.results.map(mapResultToTypeaheadOption) : [],
2425
2384
  minQueryLength: 1,
2426
2385
  onChange: (values) => {
@@ -2457,29 +2416,29 @@ function mapResultToTypeaheadOption(result) {
2457
2416
  function TypeaheadFooter({ state, isLoading }) {
2458
2417
  const { formatMessage } = useIntl7();
2459
2418
  if (state.type === "noResults") {
2460
- return /* @__PURE__ */ jsx38(Markdown4, { className: "m-t-2 m-x-2", config: { link: { target: "_blank" } }, children: state.message });
2419
+ return /* @__PURE__ */ jsx37(Markdown4, { className: "m-t-2 m-x-2", config: { link: { target: "_blank" } }, children: state.message });
2461
2420
  }
2462
2421
  if (state.type === "error") {
2463
- return /* @__PURE__ */ jsx38("div", { className: "m-t-2 m-x-2", children: /* @__PURE__ */ jsx38(ErrorResult, { state }) });
2422
+ return /* @__PURE__ */ jsx37("div", { className: "m-t-2 m-x-2", children: /* @__PURE__ */ jsx37(ErrorResult, { state }) });
2464
2423
  }
2465
2424
  if (state.type === "pending" || isLoading) {
2466
- return /* @__PURE__ */ jsx38("p", { className: "m-t-2 m-x-2", children: formatMessage(search_messages_default.loading) });
2425
+ return /* @__PURE__ */ jsx37("p", { className: "m-t-2 m-x-2", children: formatMessage(search_messages_default.loading) });
2467
2426
  }
2468
2427
  return null;
2469
2428
  }
2470
2429
  var InlineSearchRendererComponent_default = InlineSearchRenderer;
2471
2430
 
2472
2431
  // ../renderers/src/SearchRenderer/SearchRenderer.tsx
2473
- import { jsx as jsx39 } from "react/jsx-runtime";
2432
+ import { jsx as jsx38 } from "react/jsx-runtime";
2474
2433
  var SearchRenderer = {
2475
2434
  canRenderType: "search",
2476
- render: (props) => props.control === "inline" ? /* @__PURE__ */ jsx39(InlineSearchRendererComponent_default, __spreadValues({}, props)) : /* @__PURE__ */ jsx39(BlockSearchRendererComponent_default, __spreadValues({}, props))
2435
+ render: (props) => props.control === "inline" ? /* @__PURE__ */ jsx38(InlineSearchRendererComponent_default, __spreadValues({}, props)) : /* @__PURE__ */ jsx38(BlockSearchRendererComponent_default, __spreadValues({}, props))
2477
2436
  };
2478
2437
  var SearchRenderer_default = SearchRenderer;
2479
2438
 
2480
2439
  // ../renderers/src/SelectInputRenderer/RadioInputRendererComponent.tsx
2481
2440
  import { RadioGroup } from "@transferwise/components";
2482
- import { Fragment as Fragment4, jsx as jsx40, jsxs as jsxs13 } from "react/jsx-runtime";
2441
+ import { Fragment as Fragment4, jsx as jsx39, jsxs as jsxs13 } from "react/jsx-runtime";
2483
2442
  function RadioInputRendererComponent(props) {
2484
2443
  const {
2485
2444
  id,
@@ -2494,7 +2453,7 @@ function RadioInputRendererComponent(props) {
2494
2453
  onSelect
2495
2454
  } = props;
2496
2455
  return /* @__PURE__ */ jsxs13(Fragment4, { children: [
2497
- /* @__PURE__ */ jsx40(
2456
+ /* @__PURE__ */ jsx39(
2498
2457
  FieldInput_default,
2499
2458
  {
2500
2459
  id,
@@ -2502,7 +2461,7 @@ function RadioInputRendererComponent(props) {
2502
2461
  help,
2503
2462
  description,
2504
2463
  validation: validationState,
2505
- children: /* @__PURE__ */ jsx40("span", { children: /* @__PURE__ */ jsx40(
2464
+ children: /* @__PURE__ */ jsx39("span", { children: /* @__PURE__ */ jsx39(
2506
2465
  RadioGroup,
2507
2466
  {
2508
2467
  name: id,
@@ -2511,7 +2470,7 @@ function RadioInputRendererComponent(props) {
2511
2470
  value: index,
2512
2471
  secondary: option.description,
2513
2472
  disabled: option.disabled || disabled,
2514
- avatar: /* @__PURE__ */ jsx40(OptionMedia, { icon: option.icon, image: option.image })
2473
+ avatar: /* @__PURE__ */ jsx39(OptionMedia, { icon: option.icon, image: option.image })
2515
2474
  })),
2516
2475
  selectedValue: selectedIndex != null ? selectedIndex : void 0,
2517
2476
  onChange: onSelect
@@ -2527,7 +2486,7 @@ function RadioInputRendererComponent(props) {
2527
2486
  // ../renderers/src/SelectInputRenderer/TabInputRendererComponent.tsx
2528
2487
  import { Tabs } from "@transferwise/components";
2529
2488
  import { useEffect as useEffect3 } from "react";
2530
- import { Fragment as Fragment5, jsx as jsx41, jsxs as jsxs14 } from "react/jsx-runtime";
2489
+ import { Fragment as Fragment5, jsx as jsx40, jsxs as jsxs14 } from "react/jsx-runtime";
2531
2490
  function TabInputRendererComponent(props) {
2532
2491
  const {
2533
2492
  id,
@@ -2547,7 +2506,7 @@ function TabInputRendererComponent(props) {
2547
2506
  }
2548
2507
  }, [selectedIndex, onSelect, options.length]);
2549
2508
  return /* @__PURE__ */ jsxs14(Fragment5, { children: [
2550
- /* @__PURE__ */ jsx41(
2509
+ /* @__PURE__ */ jsx40(
2551
2510
  FieldInput_default,
2552
2511
  {
2553
2512
  id,
@@ -2555,7 +2514,7 @@ function TabInputRendererComponent(props) {
2555
2514
  help,
2556
2515
  description,
2557
2516
  validation: validationState,
2558
- children: /* @__PURE__ */ jsx41(
2517
+ children: /* @__PURE__ */ jsx40(
2559
2518
  Tabs,
2560
2519
  {
2561
2520
  name: id,
@@ -2564,7 +2523,7 @@ function TabInputRendererComponent(props) {
2564
2523
  title: option.title,
2565
2524
  // if we pass null, we get some props-types console errors
2566
2525
  // eslint-disable-next-line react/jsx-no-useless-fragment
2567
- content: /* @__PURE__ */ jsx41(Fragment5, {}),
2526
+ content: /* @__PURE__ */ jsx40(Fragment5, {}),
2568
2527
  disabled: option.disabled || disabled
2569
2528
  })),
2570
2529
  onTabSelect: onSelect
@@ -2579,7 +2538,7 @@ var isValidIndex = (index, options) => index !== null && index >= 0 && index < o
2579
2538
 
2580
2539
  // ../renderers/src/SelectInputRenderer/SelectInputRendererComponent.tsx
2581
2540
  import { SelectInput as SelectInput2, SelectInputOptionContent as SelectInputOptionContent2 } from "@transferwise/components";
2582
- import { Fragment as Fragment6, jsx as jsx42, jsxs as jsxs15 } from "react/jsx-runtime";
2541
+ import { Fragment as Fragment6, jsx as jsx41, jsxs as jsxs15 } from "react/jsx-runtime";
2583
2542
  function SelectInputRendererComponent(props) {
2584
2543
  const {
2585
2544
  id,
@@ -2619,13 +2578,13 @@ function SelectInputRendererComponent(props) {
2619
2578
  } : {
2620
2579
  title: option.title,
2621
2580
  description: option.description,
2622
- icon: /* @__PURE__ */ jsx42(OptionMedia, { icon: option.icon, image: option.image })
2581
+ icon: /* @__PURE__ */ jsx41(OptionMedia, { icon: option.icon, image: option.image })
2623
2582
  };
2624
- return /* @__PURE__ */ jsx42(SelectInputOptionContent2, __spreadValues({}, contentProps));
2583
+ return /* @__PURE__ */ jsx41(SelectInputOptionContent2, __spreadValues({}, contentProps));
2625
2584
  };
2626
2585
  const extraProps = { autoComplete };
2627
2586
  return /* @__PURE__ */ jsxs15(Fragment6, { children: [
2628
- /* @__PURE__ */ jsx42(
2587
+ /* @__PURE__ */ jsx41(
2629
2588
  FieldInput_default,
2630
2589
  {
2631
2590
  id,
@@ -2633,7 +2592,7 @@ function SelectInputRendererComponent(props) {
2633
2592
  help,
2634
2593
  description,
2635
2594
  validation: validationState,
2636
- children: /* @__PURE__ */ jsx42(
2595
+ children: /* @__PURE__ */ jsx41(
2637
2596
  SelectInput2,
2638
2597
  __spreadValues({
2639
2598
  name: id,
@@ -2656,7 +2615,7 @@ function SelectInputRendererComponent(props) {
2656
2615
  // ../renderers/src/SelectInputRenderer/SegmentedInputRendererComponent.tsx
2657
2616
  import { useEffect as useEffect4 } from "react";
2658
2617
  import { SegmentedControl } from "@transferwise/components";
2659
- import { Fragment as Fragment7, jsx as jsx43, jsxs as jsxs16 } from "react/jsx-runtime";
2618
+ import { Fragment as Fragment7, jsx as jsx42, jsxs as jsxs16 } from "react/jsx-runtime";
2660
2619
  function SegmentedInputRendererComponent(props) {
2661
2620
  const {
2662
2621
  id,
@@ -2675,7 +2634,7 @@ function SegmentedInputRendererComponent(props) {
2675
2634
  }
2676
2635
  }, [selectedIndex, onSelect, options.length]);
2677
2636
  return /* @__PURE__ */ jsxs16(Fragment7, { children: [
2678
- /* @__PURE__ */ jsx43(
2637
+ /* @__PURE__ */ jsx42(
2679
2638
  FieldInput_default,
2680
2639
  {
2681
2640
  id,
@@ -2683,7 +2642,7 @@ function SegmentedInputRendererComponent(props) {
2683
2642
  help,
2684
2643
  description,
2685
2644
  validation: validationState,
2686
- children: /* @__PURE__ */ jsx43(
2645
+ children: /* @__PURE__ */ jsx42(
2687
2646
  SegmentedControl,
2688
2647
  {
2689
2648
  name: `${id}-segmented-control`,
@@ -2700,26 +2659,26 @@ function SegmentedInputRendererComponent(props) {
2700
2659
  )
2701
2660
  }
2702
2661
  ),
2703
- /* @__PURE__ */ jsx43("div", { id: `${id}-children`, children })
2662
+ /* @__PURE__ */ jsx42("div", { id: `${id}-children`, children })
2704
2663
  ] });
2705
2664
  }
2706
2665
  var isValidIndex2 = (index, options) => index !== null && index >= 0 && index < options;
2707
2666
 
2708
2667
  // ../renderers/src/SelectInputRenderer/SelectInputRenderer.tsx
2709
- import { jsx as jsx44 } from "react/jsx-runtime";
2668
+ import { jsx as jsx43 } from "react/jsx-runtime";
2710
2669
  var SelectInputRenderer = {
2711
2670
  canRenderType: "input-select",
2712
2671
  render: (props) => {
2713
2672
  switch (props.control) {
2714
2673
  case "radio":
2715
- return /* @__PURE__ */ jsx44(RadioInputRendererComponent, __spreadValues({}, props));
2674
+ return /* @__PURE__ */ jsx43(RadioInputRendererComponent, __spreadValues({}, props));
2716
2675
  case "tab":
2717
- return props.options.length > 3 ? /* @__PURE__ */ jsx44(SelectInputRendererComponent, __spreadValues({}, props)) : /* @__PURE__ */ jsx44(TabInputRendererComponent, __spreadValues({}, props));
2676
+ return props.options.length > 3 ? /* @__PURE__ */ jsx43(SelectInputRendererComponent, __spreadValues({}, props)) : /* @__PURE__ */ jsx43(TabInputRendererComponent, __spreadValues({}, props));
2718
2677
  case "segmented":
2719
- return props.options.length > 3 ? /* @__PURE__ */ jsx44(SelectInputRendererComponent, __spreadValues({}, props)) : /* @__PURE__ */ jsx44(SegmentedInputRendererComponent, __spreadValues({}, props));
2678
+ return props.options.length > 3 ? /* @__PURE__ */ jsx43(SelectInputRendererComponent, __spreadValues({}, props)) : /* @__PURE__ */ jsx43(SegmentedInputRendererComponent, __spreadValues({}, props));
2720
2679
  case "select":
2721
2680
  default:
2722
- return /* @__PURE__ */ jsx44(SelectInputRendererComponent, __spreadValues({}, props));
2681
+ return /* @__PURE__ */ jsx43(SelectInputRendererComponent, __spreadValues({}, props));
2723
2682
  }
2724
2683
  }
2725
2684
  };
@@ -2727,17 +2686,17 @@ var SelectInputRenderer_default = SelectInputRenderer;
2727
2686
 
2728
2687
  // ../renderers/src/StatusListRenderer.tsx
2729
2688
  import { Header as Header5, Summary } from "@transferwise/components";
2730
- import { jsx as jsx45, jsxs as jsxs17 } from "react/jsx-runtime";
2689
+ import { jsx as jsx44, jsxs as jsxs17 } from "react/jsx-runtime";
2731
2690
  var StatusListRenderer = {
2732
2691
  canRenderType: "status-list",
2733
2692
  render: ({ margin, items, title }) => /* @__PURE__ */ jsxs17("div", { className: getMargin(margin), children: [
2734
- title ? /* @__PURE__ */ jsx45(Header5, { title, className: "m-b-2" }) : null,
2735
- items.map(({ callToAction, description, icon, status, title: itemTitle }) => /* @__PURE__ */ jsx45(
2693
+ title ? /* @__PURE__ */ jsx44(Header5, { title, className: "m-b-2" }) : null,
2694
+ items.map(({ callToAction, description, icon, status, title: itemTitle }) => /* @__PURE__ */ jsx44(
2736
2695
  Summary,
2737
2696
  {
2738
2697
  title: itemTitle,
2739
2698
  description,
2740
- icon: icon && "name" in icon ? /* @__PURE__ */ jsx45(DynamicIcon_default, { name: icon.name }) : null,
2699
+ icon: icon && "name" in icon ? /* @__PURE__ */ jsx44(DynamicIcon_default, { name: icon.name }) : null,
2741
2700
  status: mapStatus(status),
2742
2701
  action: getSummaryAction(callToAction)
2743
2702
  },
@@ -2779,109 +2738,77 @@ import { InputGroup as InputGroup3 } from "@transferwise/components";
2779
2738
  import {
2780
2739
  Input as Input5,
2781
2740
  InputWithDisplayFormat,
2782
- PhoneNumberInput as PhoneNumber,
2741
+ PhoneNumberInput,
2783
2742
  TextArea,
2784
2743
  TextareaWithDisplayFormat
2785
2744
  } from "@transferwise/components";
2786
- import { jsx as jsx46 } from "react/jsx-runtime";
2787
- function VariableTextInput({
2788
- control,
2789
- inputProps
2790
- }) {
2745
+ import { jsx as jsx45 } from "react/jsx-runtime";
2746
+ var commonKeys = [
2747
+ "autoComplete",
2748
+ "autoCapitalize",
2749
+ "placeholder",
2750
+ "control",
2751
+ "disabled",
2752
+ "displayFormat",
2753
+ "id",
2754
+ "onBlur",
2755
+ "onFocus",
2756
+ "placeholder",
2757
+ "value"
2758
+ ];
2759
+ function VariableTextInput(inputProps) {
2760
+ const { id, value, control, onChange } = inputProps;
2761
+ const commonProps = __spreadProps(__spreadValues({}, pick(inputProps, ...commonKeys)), { name: id });
2791
2762
  switch (control) {
2792
- case "password":
2793
- return /* @__PURE__ */ jsx46(TextInput, __spreadValues({ type: "password" }, inputProps));
2794
2763
  case "email":
2795
- return /* @__PURE__ */ jsx46(TextInput, __spreadValues({ type: "email" }, inputProps));
2796
- case "textarea":
2797
- return /* @__PURE__ */ jsx46(TextAreaInput, __spreadValues({}, inputProps));
2798
- case "numeric":
2799
- return /* @__PURE__ */ jsx46(NumericInput, __spreadValues({ type: "number" }, inputProps));
2764
+ return /* @__PURE__ */ jsx45(TextInput, __spreadProps(__spreadValues({}, commonProps), { type: "email", onChange }));
2765
+ case "password":
2766
+ return /* @__PURE__ */ jsx45(TextInput, __spreadProps(__spreadValues({}, commonProps), { type: "password", onChange }));
2767
+ case "numeric": {
2768
+ const numericProps = __spreadProps(__spreadValues({}, commonProps), { type: "number", onWheel });
2769
+ return /* @__PURE__ */ jsx45(
2770
+ TextInput,
2771
+ __spreadProps(__spreadValues({}, numericProps), {
2772
+ onChange: (newValue) => onChange(numericValueOrNull(newValue))
2773
+ })
2774
+ );
2775
+ }
2800
2776
  case "phone-number":
2801
- return /* @__PURE__ */ jsx46(PhoneNumberInput, __spreadValues({}, inputProps));
2802
- default:
2803
- return /* @__PURE__ */ jsx46(TextInput, __spreadValues({ type: "text" }, inputProps));
2804
- }
2805
- }
2806
- function TextInput(_a) {
2807
- var _b = _a, { id, displayFormat, onChange } = _b, rest = __objRest(_b, ["id", "displayFormat", "onChange"]);
2808
- if (typeof displayFormat === "string") {
2809
- const inputProps = __spreadValues({ id, name: id, className: "form-control" }, rest);
2810
- return /* @__PURE__ */ jsx46(
2811
- InputWithDisplayFormat,
2812
- __spreadValues({
2813
- displayPattern: displayFormat,
2814
- onChange: (newValue) => onChange(newValue)
2815
- }, inputProps)
2816
- );
2777
+ return /* @__PURE__ */ jsx45(PhoneNumberInput, __spreadProps(__spreadValues({ initialValue: value }, commonProps), { onChange }));
2778
+ default: {
2779
+ return /* @__PURE__ */ jsx45(TextInput, __spreadProps(__spreadValues({}, commonProps), { type: "text", onChange }));
2780
+ }
2817
2781
  }
2818
- return /* @__PURE__ */ jsx46(Input5, __spreadValues({ id, name: id, onChange: (e) => onChange(e.target.value) }, rest));
2819
2782
  }
2820
- function TextAreaInput(_a) {
2821
- var _b = _a, { id, displayFormat, onChange } = _b, rest = __objRest(_b, ["id", "displayFormat", "onChange"]);
2822
- const textAreaProps = __spreadValues({ id, name: id }, rest);
2823
- return typeof displayFormat === "string" ? /* @__PURE__ */ jsx46(
2824
- TextareaWithDisplayFormat,
2825
- __spreadValues({
2826
- displayPattern: displayFormat,
2827
- onChange: (newValue) => onChange(newValue)
2828
- }, textAreaProps)
2829
- ) : /* @__PURE__ */ jsx46(TextArea, __spreadValues({ onChange: (e) => onChange(e.target.value) }, textAreaProps));
2783
+ function TextInput(props) {
2784
+ const _a = props, { control, displayFormat, onChange } = _a, commonProps = __objRest(_a, ["control", "displayFormat", "onChange"]);
2785
+ const InputWithPattern = control === "textarea" ? TextareaWithDisplayFormat : InputWithDisplayFormat;
2786
+ const InputWithoutPattern = control === "textarea" ? TextArea : Input5;
2787
+ return displayFormat ? /* @__PURE__ */ jsx45(InputWithPattern, __spreadProps(__spreadValues({ displayPattern: displayFormat }, commonProps), { onChange })) : /* @__PURE__ */ jsx45(InputWithoutPattern, __spreadProps(__spreadValues({}, commonProps), { onChange: (e) => onChange(e.target.value) }));
2830
2788
  }
2831
- function NumericInput(_a) {
2832
- var _b = _a, { id, displayFormat, onChange } = _b, rest = __objRest(_b, ["id", "displayFormat", "onChange"]);
2833
- const numericProps = __spreadValues({ id, name: id, onWheel }, rest);
2834
- return typeof displayFormat === "string" ? /* @__PURE__ */ jsx46(
2835
- InputWithDisplayFormat,
2836
- __spreadValues({
2837
- displayPattern: displayFormat,
2838
- onChange: (newValue) => onChange(numericValueOrNull(newValue))
2839
- }, numericProps)
2840
- ) : /* @__PURE__ */ jsx46(
2841
- Input5,
2842
- __spreadValues({
2843
- onChange: ({ target: { value: newValue } }) => onChange(numericValueOrNull(newValue))
2844
- }, numericProps)
2845
- );
2846
- }
2847
- function PhoneNumberInput(_a) {
2848
- var _b = _a, { value } = _b, rest = __objRest(_b, ["value"]);
2849
- return /* @__PURE__ */ jsx46(PhoneNumber, __spreadValues({ initialValue: value }, rest));
2850
- }
2851
- var VariableTextInput_default = VariableTextInput;
2852
2789
 
2853
2790
  // ../renderers/src/TextInputRenderer.tsx
2854
- import { jsx as jsx47 } from "react/jsx-runtime";
2791
+ import { jsx as jsx46 } from "react/jsx-runtime";
2855
2792
  var TextInputRenderer = {
2856
2793
  canRenderType: "input-text",
2857
2794
  render: (props) => {
2858
2795
  const _a = props, {
2859
2796
  id,
2860
- control,
2861
2797
  title,
2862
2798
  description,
2863
2799
  help,
2864
- error,
2865
2800
  icon,
2866
2801
  image,
2867
- maxLength,
2868
- minLength,
2869
- type,
2870
2802
  validationState,
2871
2803
  value: initialValue,
2872
2804
  onChange
2873
2805
  } = _a, rest = __objRest(_a, [
2874
2806
  "id",
2875
- "control",
2876
2807
  "title",
2877
2808
  "description",
2878
2809
  "help",
2879
- "error",
2880
2810
  "icon",
2881
2811
  "image",
2882
- "maxLength",
2883
- "minLength",
2884
- "type",
2885
2812
  "validationState",
2886
2813
  "value",
2887
2814
  "onChange"
@@ -2896,7 +2823,7 @@ var TextInputRenderer = {
2896
2823
  }
2897
2824
  }
2898
2825
  });
2899
- return /* @__PURE__ */ jsx47(
2826
+ return /* @__PURE__ */ jsx46(
2900
2827
  FieldInput_default,
2901
2828
  {
2902
2829
  id,
@@ -2904,7 +2831,7 @@ var TextInputRenderer = {
2904
2831
  description,
2905
2832
  validation: validationState,
2906
2833
  help,
2907
- children: /* @__PURE__ */ jsx47(InputGroup3, { addonStart: getInputGroupAddonStart({ icon, image }), children: /* @__PURE__ */ jsx47(VariableTextInput_default, { control, inputProps }) })
2834
+ children: /* @__PURE__ */ jsx46(InputGroup3, { addonStart: getInputGroupAddonStart({ icon, image }), children: /* @__PURE__ */ jsx46(VariableTextInput, __spreadValues({}, inputProps)) })
2908
2835
  }
2909
2836
  );
2910
2837
  }
@@ -2918,7 +2845,7 @@ import { Upload, UploadInput as UploadInput2 } from "@transferwise/components";
2918
2845
  var getRandomId = () => Math.random().toString(36).substring(2);
2919
2846
 
2920
2847
  // ../renderers/src/UploadInputRenderer.tsx
2921
- import { jsx as jsx48 } from "react/jsx-runtime";
2848
+ import { jsx as jsx47 } from "react/jsx-runtime";
2922
2849
  var UploadInputRenderer = {
2923
2850
  canRenderType: "input-upload",
2924
2851
  render: (props) => {
@@ -2934,14 +2861,14 @@ var UploadInputRenderer = {
2934
2861
  };
2935
2862
  return (
2936
2863
  // We don't pass help here as there is no sensible place to display it
2937
- /* @__PURE__ */ jsx48(
2864
+ /* @__PURE__ */ jsx47(
2938
2865
  UploadFieldInput_default,
2939
2866
  {
2940
2867
  id,
2941
2868
  label: void 0,
2942
2869
  description: void 0,
2943
2870
  validation: validationState,
2944
- children: /* @__PURE__ */ jsx48(
2871
+ children: /* @__PURE__ */ jsx47(
2945
2872
  UploadInput2,
2946
2873
  {
2947
2874
  id,
@@ -2998,7 +2925,7 @@ var LargeUploadRenderer = {
2998
2925
  throw e;
2999
2926
  }
3000
2927
  };
3001
- return /* @__PURE__ */ jsx48(
2928
+ return /* @__PURE__ */ jsx47(
3002
2929
  FieldInput_default,
3003
2930
  {
3004
2931
  id,
@@ -3006,7 +2933,7 @@ var LargeUploadRenderer = {
3006
2933
  description,
3007
2934
  validation: validationState,
3008
2935
  help,
3009
- children: /* @__PURE__ */ jsx48(
2936
+ children: /* @__PURE__ */ jsx47(
3010
2937
  Upload,
3011
2938
  __spreadProps(__spreadValues({}, uploadProps), {
3012
2939
  usAccept: getAcceptsString(accepts),
@@ -3023,14 +2950,14 @@ var LargeUploadRenderer = {
3023
2950
 
3024
2951
  // ../renderers/src/ReviewRenderer.tsx
3025
2952
  import { DefinitionList, Header as Header6 } from "@transferwise/components";
3026
- import { Fragment as Fragment8, jsx as jsx49, jsxs as jsxs18 } from "react/jsx-runtime";
2953
+ import { Fragment as Fragment8, jsx as jsx48, jsxs as jsxs18 } from "react/jsx-runtime";
3027
2954
  var ReviewRenderer = {
3028
2955
  canRenderType: "review",
3029
2956
  render: ({ callToAction, control, fields, margin, title }) => {
3030
2957
  const orientation = mapControlToDefinitionListLayout(control);
3031
2958
  return /* @__PURE__ */ jsxs18("div", { className: getMargin(margin), children: [
3032
- (title || callToAction) && /* @__PURE__ */ jsx49(Header6, { title: title != null ? title : "", action: getReviewAction(callToAction) }),
3033
- /* @__PURE__ */ jsx49("div", { className: margin, children: /* @__PURE__ */ jsx49(
2959
+ (title || callToAction) && /* @__PURE__ */ jsx48(Header6, { title: title != null ? title : "", action: getReviewAction(callToAction) }),
2960
+ /* @__PURE__ */ jsx48("div", { className: margin, children: /* @__PURE__ */ jsx48(
3034
2961
  DefinitionList,
3035
2962
  {
3036
2963
  layout: orientation,
@@ -3063,13 +2990,13 @@ var mapControlToDefinitionListLayout = (control) => {
3063
2990
  var getFieldValue = (value, help, orientation) => {
3064
2991
  if (help) {
3065
2992
  return orientation === "HORIZONTAL_RIGHT_ALIGNED" ? /* @__PURE__ */ jsxs18(Fragment8, { children: [
3066
- /* @__PURE__ */ jsx49(Help_default, { help }),
2993
+ /* @__PURE__ */ jsx48(Help_default, { help }),
3067
2994
  " ",
3068
2995
  value
3069
2996
  ] }) : /* @__PURE__ */ jsxs18(Fragment8, { children: [
3070
2997
  value,
3071
2998
  " ",
3072
- /* @__PURE__ */ jsx49(Help_default, { help })
2999
+ /* @__PURE__ */ jsx48(Help_default, { help })
3073
3000
  ] });
3074
3001
  }
3075
3002
  return value;
@@ -3098,7 +3025,29 @@ var getReviewAction = (callToAction) => {
3098
3025
  };
3099
3026
 
3100
3027
  // ../renderers/src/step/StepRenderer.tsx
3101
- import { useMemo } from "react";
3028
+ import { Alert as Alert2, Title } from "@transferwise/components";
3029
+
3030
+ // ../renderers/src/step/BackButton.tsx
3031
+ import { Avatar as Avatar4 } from "@transferwise/components";
3032
+ import { ArrowLeft } from "@transferwise/icons";
3033
+ import { jsx as jsx49, jsxs as jsxs19 } from "react/jsx-runtime";
3034
+ function BackButton({ title, onClick }) {
3035
+ return /* @__PURE__ */ jsx49("div", { className: "m-b-2", children: /* @__PURE__ */ jsxs19(
3036
+ "button",
3037
+ {
3038
+ type: "button",
3039
+ className: "df-back-btn",
3040
+ title,
3041
+ "aria-label": title,
3042
+ onClick,
3043
+ children: [
3044
+ /* @__PURE__ */ jsx49("span", { className: "sr-only", children: title }),
3045
+ /* @__PURE__ */ jsx49(Avatar4, { type: "icon", children: /* @__PURE__ */ jsx49(ArrowLeft, { size: "24" }) })
3046
+ ]
3047
+ }
3048
+ ) });
3049
+ }
3050
+ var BackButton_default = BackButton;
3102
3051
 
3103
3052
  // ../renderers/src/step/ExternalConfirmationDialog.tsx
3104
3053
  import { useIntl as useIntl8 } from "react-intl";
@@ -3130,16 +3079,16 @@ var external_confirmation_messages_default = defineMessages7({
3130
3079
 
3131
3080
  // ../renderers/src/step/ExternalConfirmationDialog.tsx
3132
3081
  import { Button as Button6, Markdown as Markdown5 } from "@transferwise/components";
3133
- import { jsx as jsx50, jsxs as jsxs19 } from "react/jsx-runtime";
3082
+ import { jsx as jsx50, jsxs as jsxs20 } from "react/jsx-runtime";
3134
3083
  function ExternalConfirmationDialog({
3135
3084
  external,
3136
3085
  onClose
3137
3086
  }) {
3138
3087
  const { formatMessage } = useIntl8();
3139
- return /* @__PURE__ */ jsx50("div", { className: "df-box-renderer-fixed-width", children: /* @__PURE__ */ jsxs19("div", { className: "df-box-renderer-width-lg", children: [
3088
+ return /* @__PURE__ */ jsx50("div", { className: "df-box-renderer-fixed-width", children: /* @__PURE__ */ jsxs20("div", { className: "df-box-renderer-width-lg", children: [
3140
3089
  /* @__PURE__ */ jsx50("h2", { className: "text-xs-center m-b-5", children: formatMessage(external_confirmation_messages_default.title) }),
3141
3090
  /* @__PURE__ */ jsx50(Markdown5, { config: { link: { target: "_blank" } }, className: "text-xs-center m-b-5", children: formatMessage(external_confirmation_messages_default.description, { origin: getOrigin(external.url) }) }),
3142
- /* @__PURE__ */ jsx50("div", { className: "df-box-renderer-fixed-width", children: /* @__PURE__ */ jsxs19("div", { className: "df-box-renderer-width-lg", children: [
3091
+ /* @__PURE__ */ jsx50("div", { className: "df-box-renderer-fixed-width", children: /* @__PURE__ */ jsxs20("div", { className: "df-box-renderer-width-lg", children: [
3143
3092
  /* @__PURE__ */ jsx50(
3144
3093
  Button6,
3145
3094
  {
@@ -3182,49 +3131,25 @@ function useExternal(url) {
3182
3131
  return { requiresUserConfirmation, dismissConfirmation };
3183
3132
  }
3184
3133
 
3185
- // ../renderers/src/step/BackButton.tsx
3186
- import { Avatar as Avatar4 } from "@transferwise/components";
3187
- import { ArrowLeft } from "@transferwise/icons";
3188
- import { jsx as jsx51, jsxs as jsxs20 } from "react/jsx-runtime";
3189
- function BackButton({ title, onClick }) {
3190
- return /* @__PURE__ */ jsx51("div", { className: "m-b-2", children: /* @__PURE__ */ jsxs20(
3191
- "button",
3192
- {
3193
- type: "button",
3194
- className: "df-back-btn",
3195
- title,
3196
- "aria-label": title,
3197
- onClick,
3198
- children: [
3199
- /* @__PURE__ */ jsx51("span", { className: "sr-only", children: title }),
3200
- /* @__PURE__ */ jsx51(Avatar4, { type: "icon", children: /* @__PURE__ */ jsx51(ArrowLeft, { size: "24" }) })
3201
- ]
3202
- }
3203
- ) });
3204
- }
3205
- var BackButton_default = BackButton;
3206
-
3207
3134
  // ../renderers/src/step/StepRenderer.tsx
3208
- import { Alert as Alert2, Title } from "@transferwise/components";
3209
- import { jsx as jsx52, jsxs as jsxs21 } from "react/jsx-runtime";
3135
+ import { Fragment as Fragment9, jsx as jsx51, jsxs as jsxs21 } from "react/jsx-runtime";
3210
3136
  var StepRenderer = {
3211
3137
  canRenderType: "step",
3212
3138
  render: StepRendererComponent
3213
3139
  };
3214
3140
  function StepRendererComponent(props) {
3215
- const { back, description, error, external, loadingState, title, trackEvent, children } = props;
3216
- const value = useMemo(() => ({ loadingState, trackEvent }), [loadingState, trackEvent]);
3141
+ const { back, description, error, external, title, children } = props;
3217
3142
  const { requiresUserConfirmation, dismissConfirmation } = useExternal(external == null ? void 0 : external.url);
3218
3143
  if ((external == null ? void 0 : external.url) && requiresUserConfirmation) {
3219
- return /* @__PURE__ */ jsx52(ExternalConfirmationDialog, { external, onClose: dismissConfirmation });
3144
+ return /* @__PURE__ */ jsx51(ExternalConfirmationDialog, { external, onClose: dismissConfirmation });
3220
3145
  }
3221
- return /* @__PURE__ */ jsxs21(StepRendererContextProvider, { value, children: [
3222
- back ? /* @__PURE__ */ jsx52(BackButton_default, __spreadValues({}, back)) : null,
3146
+ return /* @__PURE__ */ jsxs21(Fragment9, { children: [
3147
+ back ? /* @__PURE__ */ jsx51(BackButton_default, __spreadValues({}, back)) : null,
3223
3148
  title || description ? /* @__PURE__ */ jsxs21("div", { className: "m-b-4", children: [
3224
- title ? /* @__PURE__ */ jsx52(Title, { as: "h1", type: "title-section", className: "text-xs-center m-b-2", children: title }) : void 0,
3225
- description ? /* @__PURE__ */ jsx52("p", { className: "text-xs-center np-text-body-large", children: description }) : void 0
3149
+ title ? /* @__PURE__ */ jsx51(Title, { as: "h1", type: "title-section", className: "text-xs-center m-b-2", children: title }) : void 0,
3150
+ description ? /* @__PURE__ */ jsx51("p", { className: "text-xs-center np-text-body-large", children: description }) : void 0
3226
3151
  ] }) : void 0,
3227
- error ? /* @__PURE__ */ jsx52(Alert2, { type: "negative", className: "m-b-2", message: error }) : void 0,
3152
+ error ? /* @__PURE__ */ jsx51(Alert2, { type: "negative", className: "m-b-2", message: error }) : void 0,
3228
3153
  children
3229
3154
  ] });
3230
3155
  }
@@ -3232,15 +3157,15 @@ function StepRendererComponent(props) {
3232
3157
  // ../renderers/src/ListRenderer.tsx
3233
3158
  var import_classnames6 = __toESM(require_classnames());
3234
3159
  import { Body, Header as Header7 } from "@transferwise/components";
3235
- import { jsx as jsx53, jsxs as jsxs22 } from "react/jsx-runtime";
3160
+ import { jsx as jsx52, jsxs as jsxs22 } from "react/jsx-runtime";
3236
3161
  var ListRenderer = {
3237
3162
  canRenderType: "list",
3238
3163
  render: ({ callToAction, margin, items, title }) => /* @__PURE__ */ jsxs22("div", { className: getMargin(margin), children: [
3239
- title && /* @__PURE__ */ jsx53(Header7, { as: "h2", title, action: getListAction(callToAction) }),
3240
- items.map((props) => /* @__PURE__ */ jsx53(DesignSystemListItem, __spreadValues({}, props), props.title))
3164
+ (title || callToAction) && /* @__PURE__ */ jsx52(Header7, { as: "h2", title: title != null ? title : "", action: getListAction(callToAction) }),
3165
+ items.map((props) => /* @__PURE__ */ jsx52(DesignSystemListItem, __spreadValues({}, props), props.title))
3241
3166
  ] })
3242
3167
  };
3243
- var DesignSystemListItem = ({ title, subtitle, value, subvalue, icon, image }) => /* @__PURE__ */ jsx53(
3168
+ var DesignSystemListItem = ({ title, subtitle, value, subvalue, icon, image }) => /* @__PURE__ */ jsx52(
3244
3169
  "label",
3245
3170
  {
3246
3171
  className: (0, import_classnames6.default)("np-option p-a-2", {
@@ -3248,15 +3173,15 @@ var DesignSystemListItem = ({ title, subtitle, value, subvalue, icon, image }) =
3248
3173
  "np-option__container-aligned": true
3249
3174
  }),
3250
3175
  children: /* @__PURE__ */ jsxs22("div", { className: "media", children: [
3251
- icon || image ? /* @__PURE__ */ jsx53("div", { className: "media-left", children: /* @__PURE__ */ jsx53(ListItemMedia, { image, icon }) }) : null,
3176
+ icon || image ? /* @__PURE__ */ jsx52("div", { className: "media-left", children: /* @__PURE__ */ jsx52(ListItemMedia, { image, icon }) }) : null,
3252
3177
  /* @__PURE__ */ jsxs22("div", { className: "media-body", children: [
3253
3178
  /* @__PURE__ */ jsxs22("div", { className: "d-flex justify-content-between", children: [
3254
- /* @__PURE__ */ jsx53("h4", { className: "np-text-body-large-bold text-primary np-option__title", children: title }),
3255
- /* @__PURE__ */ jsx53("h4", { className: "np-text-body-large-bold text-primary np-option__title", children: value })
3179
+ /* @__PURE__ */ jsx52("h4", { className: "np-text-body-large-bold text-primary np-option__title", children: title }),
3180
+ /* @__PURE__ */ jsx52("h4", { className: "np-text-body-large-bold text-primary np-option__title", children: value })
3256
3181
  ] }),
3257
3182
  /* @__PURE__ */ jsxs22("div", { className: "d-flex justify-content-between", children: [
3258
- /* @__PURE__ */ jsx53(Body, { className: "d-block np-option__body", children: subtitle }),
3259
- /* @__PURE__ */ jsx53(Body, { className: "d-block np-option__body", children: subvalue })
3183
+ /* @__PURE__ */ jsx52(Body, { className: "d-block np-option__body", children: subtitle }),
3184
+ /* @__PURE__ */ jsx52(Body, { className: "d-block np-option__body", children: subvalue })
3260
3185
  ] })
3261
3186
  ] })
3262
3187
  ] })
@@ -3265,10 +3190,10 @@ var DesignSystemListItem = ({ title, subtitle, value, subvalue, icon, image }) =
3265
3190
  );
3266
3191
  var ListItemMedia = ({ icon, image }) => {
3267
3192
  if (icon) {
3268
- return /* @__PURE__ */ jsx53("div", { className: "circle circle-sm text-primary", children: /* @__PURE__ */ jsx53(NavigationOptionMedia, { icon, image }) });
3193
+ return /* @__PURE__ */ jsx52("div", { className: "circle circle-sm text-primary", children: /* @__PURE__ */ jsx52(NavigationOptionMedia, { icon, image }) });
3269
3194
  }
3270
3195
  if (image) {
3271
- return /* @__PURE__ */ jsx53("div", { className: "np-option__no-media-circle", children: /* @__PURE__ */ jsx53(NavigationOptionMedia, { icon, image }) });
3196
+ return /* @__PURE__ */ jsx52("div", { className: "np-option__no-media-circle", children: /* @__PURE__ */ jsx52(NavigationOptionMedia, { icon, image }) });
3272
3197
  }
3273
3198
  };
3274
3199
  var getListAction = (callToAction) => {
@@ -3331,17 +3256,17 @@ var getWiseRenderers = () => [
3331
3256
  ];
3332
3257
 
3333
3258
  // src/dynamicFlow/DynamicFlow.tsx
3334
- import { jsx as jsx54 } from "react/jsx-runtime";
3259
+ import { jsx as jsx53 } from "react/jsx-runtime";
3335
3260
  var wiseRenderers = getWiseRenderers();
3336
3261
  function DynamicFlowLegacy(props) {
3337
3262
  const { customFetch = globalThis.fetch } = props;
3338
3263
  const coreProps = __spreadProps(__spreadValues({}, props), { httpClient: customFetch });
3339
- return /* @__PURE__ */ jsx54(DynamicFlowCoreLegacy, __spreadValues({}, coreProps));
3264
+ return /* @__PURE__ */ jsx53(DynamicFlowCoreLegacy, __spreadValues({}, coreProps));
3340
3265
  }
3341
3266
  function DynamicFlowRevamp(props) {
3342
3267
  const { customFetch = globalThis.fetch, renderers, onLog, onLink = openLinkInNewTab } = props;
3343
3268
  const httpClient = useWiseHttpClient(customFetch);
3344
- const mergedRenderers = useMemo2(() => [...renderers != null ? renderers : [], ...wiseRenderers], [renderers]);
3269
+ const mergedRenderers = useMemo(() => [...renderers != null ? renderers : [], ...wiseRenderers], [renderers]);
3345
3270
  const filteredOnLog = useFilteredOnLog(onLog);
3346
3271
  const coreProps = __spreadProps(__spreadValues({}, props), {
3347
3272
  httpClient,
@@ -3349,12 +3274,12 @@ function DynamicFlowRevamp(props) {
3349
3274
  onLink,
3350
3275
  onLog: filteredOnLog
3351
3276
  });
3352
- return /* @__PURE__ */ jsx54(RendererHttpClientProvider, { httpClient, children: /* @__PURE__ */ jsx54(DynamicFlowCoreRevamp, __spreadValues({}, coreProps)) });
3277
+ return /* @__PURE__ */ jsx53(DynamicFlowCoreRevamp, __spreadValues({}, coreProps));
3353
3278
  }
3354
- var DynamicFragment = forwardRef2(function DynamicFragment2(props, ref) {
3279
+ var DynamicForm = forwardRef2(function DynamicForm2(props, ref) {
3355
3280
  const { customFetch = globalThis.fetch, renderers, onLog, onLink = openLinkInNewTab } = props;
3356
3281
  const httpClient = useWiseHttpClient(customFetch);
3357
- const mergedRenderers = useMemo2(() => [...renderers != null ? renderers : [], ...wiseRenderers], [renderers]);
3282
+ const mergedRenderers = useMemo(() => [...renderers != null ? renderers : [], ...wiseRenderers], [renderers]);
3358
3283
  const filteredOnLog = useFilteredOnLog(onLog);
3359
3284
  const coreProps = __spreadProps(__spreadValues({}, props), {
3360
3285
  httpClient,
@@ -3362,7 +3287,7 @@ var DynamicFragment = forwardRef2(function DynamicFragment2(props, ref) {
3362
3287
  onLink,
3363
3288
  onLog: filteredOnLog
3364
3289
  });
3365
- return /* @__PURE__ */ jsx54(RendererHttpClientProvider, { httpClient, children: /* @__PURE__ */ jsx54(DynamicFragmentCore, __spreadProps(__spreadValues({}, coreProps), { ref })) });
3290
+ return /* @__PURE__ */ jsx53(DynamicFormCore, __spreadProps(__spreadValues({}, coreProps), { ref }));
3366
3291
  });
3367
3292
  var useWiseHttpClient = (httpClient) => {
3368
3293
  const { locale } = useIntl9();
@@ -3384,7 +3309,7 @@ var openLinkInNewTab = (url) => {
3384
3309
  return false;
3385
3310
  }
3386
3311
  };
3387
- var useFilteredOnLog = (onLog) => useMemo2(() => {
3312
+ var useFilteredOnLog = (onLog) => useMemo(() => {
3388
3313
  return (level, message, extra) => {
3389
3314
  if (level !== "info") {
3390
3315
  onLog == null ? void 0 : onLog(level, message, extra);
@@ -3392,10 +3317,9 @@ var useFilteredOnLog = (onLog) => useMemo2(() => {
3392
3317
  };
3393
3318
  }, [onLog]);
3394
3319
  export {
3395
- DynamicFlowLegacy as DynamicFlow,
3396
3320
  DynamicFlowLegacy,
3397
3321
  DynamicFlowRevamp,
3398
- DynamicFragment,
3322
+ DynamicForm,
3399
3323
  JsonSchemaForm,
3400
3324
  isValidSchema,
3401
3325
  makeHttpClient as makeCustomFetch,