@wise/dynamic-flow-client 3.21.2 → 3.22.1

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.
Files changed (72) hide show
  1. package/build/i18n/de.json +2 -1
  2. package/build/i18n/en.json +2 -1
  3. package/build/i18n/es.json +2 -1
  4. package/build/i18n/fr.json +2 -1
  5. package/build/i18n/hu.json +2 -1
  6. package/build/i18n/id.json +2 -1
  7. package/build/i18n/it.json +2 -1
  8. package/build/i18n/ja.json +2 -1
  9. package/build/i18n/pl.json +2 -1
  10. package/build/i18n/pt.json +2 -1
  11. package/build/i18n/ro.json +2 -1
  12. package/build/i18n/ru.json +2 -1
  13. package/build/i18n/th.json +2 -1
  14. package/build/i18n/tr.json +2 -1
  15. package/build/i18n/zh_CN.json +2 -1
  16. package/build/i18n/zh_HK.json +2 -1
  17. package/build/main.css +14 -0
  18. package/build/main.js +822 -492
  19. package/build/main.min.js +1 -1
  20. package/build/main.mjs +686 -356
  21. package/build/types/common/messages/search.messages.d.ts +8 -0
  22. package/build/types/legacy/jsonSchemaForm/allOfSchema/AllOfSchema.d.ts +1 -0
  23. package/build/types/legacy/layout/list/DynamicStatusList.d.ts +1 -1
  24. package/build/types/legacy/test-utils/index.d.ts +1 -1
  25. package/build/types/legacy/test-utils/legacy-utils.d.ts +1 -15
  26. package/build/types/revamp/domain/components/BooleanInputComponent.d.ts +3 -3
  27. package/build/types/revamp/domain/components/DateInputComponent.d.ts +3 -3
  28. package/build/types/revamp/domain/components/IntegerInputComponent.d.ts +3 -3
  29. package/build/types/revamp/domain/components/MultiSelectInputComponent.d.ts +3 -3
  30. package/build/types/revamp/domain/components/MultiUploadInputComponent.d.ts +3 -0
  31. package/build/types/revamp/domain/components/NumberInputComponent.d.ts +3 -3
  32. package/build/types/revamp/domain/components/{repeatableComponent/RepeatableComponent.d.ts → RepeatableComponent.d.ts} +3 -3
  33. package/build/types/revamp/domain/components/SelectInputComponent.d.ts +1 -0
  34. package/build/types/revamp/domain/components/StatusListComponent.d.ts +19 -2
  35. package/build/types/revamp/domain/components/TextInputComponent.d.ts +3 -3
  36. package/build/types/revamp/domain/components/UploadInputComponent.d.ts +1 -0
  37. package/build/types/revamp/domain/features/validationAsync/getComponentValidationAsync.d.ts +2 -2
  38. package/build/types/revamp/domain/features/validationAsync/getInitialValidationAsyncState.d.ts +2 -0
  39. package/build/types/revamp/domain/mappers/layout/statusListLayoutToComponent.d.ts +2 -1
  40. package/build/types/revamp/domain/mappers/schema/arraySchemaToComponent/arraySchemaToComponent.d.ts +1 -1
  41. package/build/types/revamp/domain/mappers/schema/arraySchemaToComponent/arraySchemaToRepeatableComponent.d.ts +1 -1
  42. package/build/types/revamp/domain/mappers/schema/utils/getValidationAsyncInitialState.d.ts +1 -1
  43. package/build/types/revamp/domain/mappers/schema/utils/mapCommonSchemaProps.d.ts +1 -1
  44. package/build/types/revamp/domain/types.d.ts +5 -4
  45. package/build/types/revamp/renderers/mappers/repeatableComponentToProps.d.ts +1 -1
  46. package/build/types/revamp/renderers/mappers/utils/inputComponentToProps.d.ts +3 -1
  47. package/build/types/revamp/renderers/mappers/utils/mapErrorsToValidationState.d.ts +2 -0
  48. package/build/types/revamp/utils/type-utils.d.ts +1 -1
  49. package/package.json +11 -13
  50. package/build/types/legacy/dynamicFlow/tests/DynamicFlow.legacy.spec.d.ts +0 -1
  51. package/build/types/legacy/formControl/FormControl.spec.d.ts +0 -1
  52. package/build/types/legacy/jsonSchemaForm/JsonSchemaForm.spec.d.ts +0 -1
  53. package/build/types/legacy/jsonSchemaForm/arrayTypeSchema/ArrayTypeSchema.spec.d.ts +0 -1
  54. package/build/types/legacy/jsonSchemaForm/basicTypeSchema/BasicTypeSchema.errors.spec.d.ts +0 -1
  55. package/build/types/legacy/jsonSchemaForm/basicTypeSchema/BasicTypeSchema.spec.d.ts +0 -1
  56. package/build/types/legacy/jsonSchemaForm/controlFeedback/ControlFeedback.spec.d.ts +0 -1
  57. package/build/types/legacy/jsonSchemaForm/genericSchema/GenericSchema.spec.d.ts +0 -1
  58. package/build/types/legacy/jsonSchemaForm/help/Help.spec.d.ts +0 -1
  59. package/build/types/legacy/jsonSchemaForm/promotedOneOfSchema/PromotedOneOfSchema.spec.d.ts +0 -1
  60. package/build/types/legacy/jsonSchemaForm/promotedOneOfSchema/promotedOneOfControl/PromotedOneOfCheckboxControl.spec.d.ts +0 -1
  61. package/build/types/legacy/jsonSchemaForm/promotedOneOfSchema/promotedOneOfControl/PromotedOneOfControl.spec.d.ts +0 -1
  62. package/build/types/legacy/jsonSchemaForm/promotedOneOfSchema/promotedOneOfControl/PromotedOneOfRadioControl.spec.d.ts +0 -1
  63. package/build/types/legacy/jsonSchemaForm/readOnlySchema/ReadOnlySchema.spec.d.ts +0 -1
  64. package/build/types/legacy/layout/DynamicLayout.end-to-end.spec.d.ts +0 -1
  65. package/build/types/legacy/layout/DynamicLayout.spec.d.ts +0 -1
  66. package/build/types/legacy/layout/box/DynamicBox.spec.d.ts +0 -1
  67. package/build/types/legacy/layout/columns/DynamicColumns.spec.d.ts +0 -1
  68. package/build/types/legacy/layout/decision/DynamicDecision.spec.d.ts +0 -1
  69. package/build/types/legacy/layout/divider/DynamicDivider.spec.d.ts +0 -1
  70. package/build/types/legacy/layout/form/DynamicForm.spec.d.ts +0 -1
  71. package/build/types/legacy/step/layoutStep/LayoutStep.spec.d.ts +0 -1
  72. package/build/types/revamp/domain/features/validationAsync/getInitialValidationState.d.ts +0 -2
package/build/main.mjs CHANGED
@@ -500,7 +500,8 @@ var de_default = {
500
500
  "dynamicFlows.MultipleFileUploadSchema.minItemsError": "Bitte lade mindestens {minItems} Datei(en) hoch.",
501
501
  "dynamicFlows.PersistAsyncSchema.genericError": "Da ist etwas schiefgegangen. Versuche es bitte nochmal.",
502
502
  "dynamicFlows.ReadOnlySchema.no": "Nein",
503
- "dynamicFlows.ReadOnlySchema.yes": "Ja"
503
+ "dynamicFlows.ReadOnlySchema.yes": "Ja",
504
+ "dynamicFlows.SearchLayout.loading": "L\xE4dt..."
504
505
  };
505
506
 
506
507
  // src/i18n/en.json
@@ -550,7 +551,8 @@ var en_default = {
550
551
  "dynamicFlows.MultipleFileUploadSchema.minItemsError": "Please upload at least {minItems} file(s).",
551
552
  "dynamicFlows.PersistAsyncSchema.genericError": "Something went wrong, please try again.",
552
553
  "dynamicFlows.ReadOnlySchema.no": "No",
553
- "dynamicFlows.ReadOnlySchema.yes": "Yes"
554
+ "dynamicFlows.ReadOnlySchema.yes": "Yes",
555
+ "dynamicFlows.SearchLayout.loading": "Loading..."
554
556
  };
555
557
 
556
558
  // src/i18n/es.json
@@ -600,7 +602,8 @@ var es_default = {
600
602
  "dynamicFlows.MultipleFileUploadSchema.minItemsError": "Sube al menos {minItems} archivo(s).",
601
603
  "dynamicFlows.PersistAsyncSchema.genericError": "Ha habido un error. Int\xE9ntalo de nuevo.",
602
604
  "dynamicFlows.ReadOnlySchema.no": "No",
603
- "dynamicFlows.ReadOnlySchema.yes": "S\xED"
605
+ "dynamicFlows.ReadOnlySchema.yes": "S\xED",
606
+ "dynamicFlows.SearchLayout.loading": "Cargando..."
604
607
  };
605
608
 
606
609
  // src/i18n/fr.json
@@ -650,7 +653,8 @@ var fr_default = {
650
653
  "dynamicFlows.MultipleFileUploadSchema.minItemsError": "Veuillez t\xE9l\xE9charger au moins {minItems} fichier(s).",
651
654
  "dynamicFlows.PersistAsyncSchema.genericError": "Une erreur s'est produite, veuillez r\xE9essayer.",
652
655
  "dynamicFlows.ReadOnlySchema.no": "Non",
653
- "dynamicFlows.ReadOnlySchema.yes": "Oui"
656
+ "dynamicFlows.ReadOnlySchema.yes": "Oui",
657
+ "dynamicFlows.SearchLayout.loading": "Chargement..."
654
658
  };
655
659
 
656
660
  // src/i18n/hu.json
@@ -700,7 +704,8 @@ var hu_default = {
700
704
  "dynamicFlows.MultipleFileUploadSchema.minItemsError": "K\xE9r\xFCnk, hogy legal\xE1bb {minItems} f\xE1jlt t\xF6lts fel.",
701
705
  "dynamicFlows.PersistAsyncSchema.genericError": "Valami hiba t\xF6rt\xE9nt. K\xE9r\xFCnk, pr\xF3b\xE1ld \xFAjra.",
702
706
  "dynamicFlows.ReadOnlySchema.no": "Nem",
703
- "dynamicFlows.ReadOnlySchema.yes": "Igen"
707
+ "dynamicFlows.ReadOnlySchema.yes": "Igen",
708
+ "dynamicFlows.SearchLayout.loading": "Bet\xF6lt\xE9s..."
704
709
  };
705
710
 
706
711
  // src/i18n/id.json
@@ -750,7 +755,8 @@ var id_default = {
750
755
  "dynamicFlows.MultipleFileUploadSchema.minItemsError": "Harap unggah sedikitnya {minItems} file.",
751
756
  "dynamicFlows.PersistAsyncSchema.genericError": "Terjadi kesalahan, mohon coba lagi.",
752
757
  "dynamicFlows.ReadOnlySchema.no": "Tidak",
753
- "dynamicFlows.ReadOnlySchema.yes": "Ya"
758
+ "dynamicFlows.ReadOnlySchema.yes": "Ya",
759
+ "dynamicFlows.SearchLayout.loading": "Memuat..."
754
760
  };
755
761
 
756
762
  // src/i18n/it.json
@@ -800,7 +806,8 @@ var it_default = {
800
806
  "dynamicFlows.MultipleFileUploadSchema.minItemsError": "Carica almeno {minItems} file.",
801
807
  "dynamicFlows.PersistAsyncSchema.genericError": "Qualcosa \xE8 andato storto. Riprova.",
802
808
  "dynamicFlows.ReadOnlySchema.no": "No",
803
- "dynamicFlows.ReadOnlySchema.yes": "S\xEC"
809
+ "dynamicFlows.ReadOnlySchema.yes": "S\xEC",
810
+ "dynamicFlows.SearchLayout.loading": "Caricamento..."
804
811
  };
805
812
 
806
813
  // src/i18n/ja.json
@@ -850,7 +857,8 @@ var ja_default = {
850
857
  "dynamicFlows.MultipleFileUploadSchema.minItemsError": "{minItems}\u500B\u4EE5\u4E0A\u306E\u30D5\u30A1\u30A4\u30EB\u3092\u30A2\u30C3\u30D7\u30ED\u30FC\u30C9\u3057\u3066\u304F\u3060\u3055\u3044\u3002",
851
858
  "dynamicFlows.PersistAsyncSchema.genericError": "\u554F\u984C\u304C\u767A\u751F\u3057\u307E\u3057\u305F\u3002\u518D\u5EA6\u304A\u8A66\u3057\u304F\u3060\u3055\u3044\u3002",
852
859
  "dynamicFlows.ReadOnlySchema.no": "\u3044\u3044\u3048",
853
- "dynamicFlows.ReadOnlySchema.yes": "\u306F\u3044"
860
+ "dynamicFlows.ReadOnlySchema.yes": "\u306F\u3044",
861
+ "dynamicFlows.SearchLayout.loading": "\u8AAD\u307F\u8FBC\u307F\u4E2D\u2026"
854
862
  };
855
863
 
856
864
  // src/i18n/pl.json
@@ -900,7 +908,8 @@ var pl_default = {
900
908
  "dynamicFlows.MultipleFileUploadSchema.minItemsError": "Prze\u015Blij co najmniej nast\u0119puj\u0105c\u0105 liczb\u0119 plik\xF3w: {minItems}.",
901
909
  "dynamicFlows.PersistAsyncSchema.genericError": "Wyst\u0105pi\u0142 b\u0142\u0105d, prosimy spr\xF3bowa\u0107 ponownie.",
902
910
  "dynamicFlows.ReadOnlySchema.no": "Nie",
903
- "dynamicFlows.ReadOnlySchema.yes": "Tak"
911
+ "dynamicFlows.ReadOnlySchema.yes": "Tak",
912
+ "dynamicFlows.SearchLayout.loading": "Trwa \u0142adowanie..."
904
913
  };
905
914
 
906
915
  // src/i18n/pt.json
@@ -950,7 +959,8 @@ var pt_default = {
950
959
  "dynamicFlows.MultipleFileUploadSchema.minItemsError": "Por favor, envie pelo menos {minItems} arquivo(s).",
951
960
  "dynamicFlows.PersistAsyncSchema.genericError": "Ocorreu um erro. Por favor, tente novamente.",
952
961
  "dynamicFlows.ReadOnlySchema.no": "N\xE3o",
953
- "dynamicFlows.ReadOnlySchema.yes": "Sim"
962
+ "dynamicFlows.ReadOnlySchema.yes": "Sim",
963
+ "dynamicFlows.SearchLayout.loading": "Carregando..."
954
964
  };
955
965
 
956
966
  // src/i18n/ro.json
@@ -1000,7 +1010,8 @@ var ro_default = {
1000
1010
  "dynamicFlows.MultipleFileUploadSchema.minItemsError": "Te rug\u0103m s\u0103 \xEEncarci cel pu\u021Bin {minItems} fi\u0219ier(e).",
1001
1011
  "dynamicFlows.PersistAsyncSchema.genericError": "Ceva nu a mers bine, te rug\u0103m s\u0103 \xEEncerci din nou.",
1002
1012
  "dynamicFlows.ReadOnlySchema.no": "Nu",
1003
- "dynamicFlows.ReadOnlySchema.yes": "Da"
1013
+ "dynamicFlows.ReadOnlySchema.yes": "Da",
1014
+ "dynamicFlows.SearchLayout.loading": "Se \xEEncarc\u0103..."
1004
1015
  };
1005
1016
 
1006
1017
  // src/i18n/ru.json
@@ -1050,7 +1061,8 @@ var ru_default = {
1050
1061
  "dynamicFlows.MultipleFileUploadSchema.minItemsError": "\u041F\u043E\u0436\u0430\u043B\u0443\u0439\u0441\u0442\u0430, \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u0435 \u043F\u043E \u043A\u0440\u0430\u0439\u043D\u0435\u0439 \u043C\u0435\u0440\u0435 {minItems} \u0444\u0430\u0439\u043B(-\u0430/\u043E\u0432).",
1051
1062
  "dynamicFlows.PersistAsyncSchema.genericError": "\u0427\u0442\u043E-\u0442\u043E \u043F\u043E\u0448\u043B\u043E \u043D\u0435 \u0442\u0430\u043A, \u043F\u043E\u0436\u0430\u043B\u0443\u0439\u0441\u0442\u0430, \u043F\u043E\u043F\u0440\u043E\u0431\u0443\u0439\u0442\u0435 \u0435\u0449\u0435 \u0440\u0430\u0437.",
1052
1063
  "dynamicFlows.ReadOnlySchema.no": "\u041D\u0435\u0442",
1053
- "dynamicFlows.ReadOnlySchema.yes": "\u0414\u0430"
1064
+ "dynamicFlows.ReadOnlySchema.yes": "\u0414\u0430",
1065
+ "dynamicFlows.SearchLayout.loading": "\u0417\u0430\u0433\u0440\u0443\u0437\u043A\u0430..."
1054
1066
  };
1055
1067
 
1056
1068
  // src/i18n/th.json
@@ -1100,7 +1112,8 @@ var th_default = {
1100
1112
  "dynamicFlows.MultipleFileUploadSchema.minItemsError": "\u0E42\u0E1B\u0E23\u0E14\u0E2D\u0E31\u0E1B\u0E42\u0E2B\u0E25\u0E14\u0E2D\u0E22\u0E48\u0E32\u0E07\u0E19\u0E49\u0E2D\u0E22 {minItems} \u0E44\u0E1F\u0E25\u0E4C",
1101
1113
  "dynamicFlows.PersistAsyncSchema.genericError": "\u0E40\u0E01\u0E34\u0E14\u0E02\u0E49\u0E2D\u0E1C\u0E34\u0E14\u0E1E\u0E25\u0E32\u0E14\u0E1A\u0E32\u0E07\u0E2D\u0E22\u0E48\u0E32\u0E07 \u0E42\u0E1B\u0E23\u0E14\u0E25\u0E2D\u0E07\u0E2D\u0E35\u0E01\u0E04\u0E23\u0E31\u0E49\u0E07",
1102
1114
  "dynamicFlows.ReadOnlySchema.no": "\u0E44\u0E21\u0E48\u0E43\u0E0A\u0E48",
1103
- "dynamicFlows.ReadOnlySchema.yes": "\u0E43\u0E0A\u0E48"
1115
+ "dynamicFlows.ReadOnlySchema.yes": "\u0E43\u0E0A\u0E48",
1116
+ "dynamicFlows.SearchLayout.loading": "\u0E01\u0E33\u0E25\u0E31\u0E07\u0E42\u0E2B\u0E25\u0E14..."
1104
1117
  };
1105
1118
 
1106
1119
  // src/i18n/tr.json
@@ -1150,7 +1163,8 @@ var tr_default = {
1150
1163
  "dynamicFlows.MultipleFileUploadSchema.minItemsError": "L\xFCtfen en az {minItems} dosya y\xFCkleyin.",
1151
1164
  "dynamicFlows.PersistAsyncSchema.genericError": "Bir \u015Feyler ters gitti, l\xFCtfen tekrar deneyin.",
1152
1165
  "dynamicFlows.ReadOnlySchema.no": "Hay\u0131r",
1153
- "dynamicFlows.ReadOnlySchema.yes": "Evet"
1166
+ "dynamicFlows.ReadOnlySchema.yes": "Evet",
1167
+ "dynamicFlows.SearchLayout.loading": "Y\xFCkleniyor..."
1154
1168
  };
1155
1169
 
1156
1170
  // src/i18n/zh_CN.json
@@ -1200,7 +1214,8 @@ var zh_CN_default = {
1200
1214
  "dynamicFlows.MultipleFileUploadSchema.minItemsError": "\u8BF7\u4E0A\u4F20\u81F3\u5C11 {minItems} \u4E2A\u6587\u4EF6\u3002",
1201
1215
  "dynamicFlows.PersistAsyncSchema.genericError": "\u51FA\u9519\u4E86\uFF0C\u8BF7\u91CD\u8BD5\u3002",
1202
1216
  "dynamicFlows.ReadOnlySchema.no": "\u5426",
1203
- "dynamicFlows.ReadOnlySchema.yes": "\u662F"
1217
+ "dynamicFlows.ReadOnlySchema.yes": "\u662F",
1218
+ "dynamicFlows.SearchLayout.loading": "\u6B63\u5728\u52A0\u8F7D\u2026"
1204
1219
  };
1205
1220
 
1206
1221
  // src/i18n/zh_HK.json
@@ -1250,7 +1265,8 @@ var zh_HK_default = {
1250
1265
  "dynamicFlows.MultipleFileUploadSchema.minItemsError": "\u8ACB\u4E0A\u8F09\u81F3\u5C11{minItems}\u500B\u6A94\u6848\u3002",
1251
1266
  "dynamicFlows.PersistAsyncSchema.genericError": "\u51FA\u73FE\u4E86\u554F\u984C\uFF0C\u8ACB\u518D\u8A66\u4E00\u6B21\u3002",
1252
1267
  "dynamicFlows.ReadOnlySchema.no": "\u5426",
1253
- "dynamicFlows.ReadOnlySchema.yes": "\u662F"
1268
+ "dynamicFlows.ReadOnlySchema.yes": "\u662F",
1269
+ "dynamicFlows.SearchLayout.loading": "\u8F09\u5165\u4E2D\u2026"
1254
1270
  };
1255
1271
 
1256
1272
  // src/i18n/index.ts
@@ -1448,9 +1464,20 @@ var allOfComponentToProps = ({ control, description, help, title }, children) =>
1448
1464
  title
1449
1465
  });
1450
1466
 
1467
+ // src/revamp/renderers/mappers/utils/mapErrorsToValidationState.ts
1468
+ var mapErrorsToValidationState = (errors) => {
1469
+ if (errors) {
1470
+ if (errors.length > 0) {
1471
+ return { status: "invalid", message: errors[0] };
1472
+ }
1473
+ return { status: "valid" };
1474
+ }
1475
+ return void 0;
1476
+ };
1477
+
1451
1478
  // src/revamp/renderers/mappers/utils/inputComponentToProps.ts
1452
1479
  var inputComponentToProps = (component, type) => {
1453
- var _a, _b;
1480
+ var _a;
1454
1481
  const {
1455
1482
  autoComplete,
1456
1483
  control,
@@ -1462,29 +1489,40 @@ var inputComponentToProps = (component, type) => {
1462
1489
  placeholder,
1463
1490
  required,
1464
1491
  title,
1492
+ validationAsyncState,
1465
1493
  onBlur,
1466
1494
  onFocus
1467
1495
  } = component;
1468
- const validationState = componentHasValidationState(component) ? component.validationState : void 0;
1469
- const { messages } = validationState != null ? validationState : {};
1496
+ const { messages } = validationAsyncState != null ? validationAsyncState : {};
1470
1497
  return {
1471
1498
  type,
1472
1499
  autoComplete,
1473
1500
  control,
1474
- description: (_a = messages == null ? void 0 : messages.success) != null ? _a : description,
1501
+ description,
1475
1502
  disabled,
1476
- error: (_b = messages == null ? void 0 : messages.error) != null ? _b : errors[0],
1503
+ error: (_a = messages == null ? void 0 : messages.error) != null ? _a : errors == null ? void 0 : errors[0],
1477
1504
  help,
1478
1505
  id,
1479
1506
  label: title,
1480
1507
  placeholder,
1481
1508
  required,
1509
+ validationState: getValidationState(errors, validationAsyncState),
1482
1510
  value: component.getLocalValue(),
1483
1511
  onBlur: onBlur.bind(component),
1484
1512
  onFocus: onFocus.bind(component)
1485
1513
  };
1486
1514
  };
1487
- var componentHasValidationState = (component) => Boolean("validationState" in component && component.validationState);
1515
+ var getValidationState = (errors, validationAsyncState) => {
1516
+ if (validationAsyncState) {
1517
+ if (validationAsyncState == null ? void 0 : validationAsyncState.messages.error) {
1518
+ return { status: "invalid", message: validationAsyncState == null ? void 0 : validationAsyncState.messages.error };
1519
+ }
1520
+ if (validationAsyncState == null ? void 0 : validationAsyncState.messages.success) {
1521
+ return { status: "valid", message: validationAsyncState == null ? void 0 : validationAsyncState.messages.success };
1522
+ }
1523
+ }
1524
+ return mapErrorsToValidationState(errors);
1525
+ };
1488
1526
 
1489
1527
  // src/revamp/renderers/mappers/booleanInputComponentToProps.ts
1490
1528
  var booleanInputComponentToProps = (component) => {
@@ -1642,15 +1680,14 @@ var modalComponentToProps = ({ content, control, margin, trigger }, components)
1642
1680
 
1643
1681
  // src/revamp/renderers/mappers/multiUploadInputComponentToProps.ts
1644
1682
  var multiUploadInputComponentToProps = (component) => {
1645
- const { accepts, fileMap, maxSize, minItems, maxItems, uploadLabel } = component;
1646
- const findIdByValue = (file) => Object.keys(fileMap).find((id) => fileMap[id] === file);
1647
- const fileList = Object.values(fileMap).map((file) => {
1648
- var _a;
1649
- return {
1650
- id: (_a = findIdByValue(file)) != null ? _a : "",
1651
- file
1652
- };
1653
- });
1683
+ const { accepts, errorsMap, fileMap, maxSize, minItems, maxItems, uploadLabel } = component;
1684
+ const fileList = Object.entries(fileMap).map(
1685
+ ([id, file]) => ({
1686
+ id,
1687
+ file,
1688
+ validationState: mapErrorsToValidationState(errorsMap[id])
1689
+ })
1690
+ );
1654
1691
  return __spreadProps(__spreadValues({}, inputComponentToProps(component, "input-upload-multi")), {
1655
1692
  accepts,
1656
1693
  maxSize,
@@ -1732,11 +1769,12 @@ var repeatableComponentToProps = (component, children, editableItemChildren) =>
1732
1769
  description,
1733
1770
  editableItem: editableItemChildren,
1734
1771
  editItemTitle,
1772
+ error: errors == null ? void 0 : errors[0],
1735
1773
  items: itemProps,
1736
1774
  maxItems,
1737
1775
  minItems,
1738
1776
  title,
1739
- error: errors[0],
1777
+ validationState: mapErrorsToValidationState(errors),
1740
1778
  onAdd: onAdd.bind(component),
1741
1779
  onEdit: onEdit.bind(component),
1742
1780
  onSave: onSave.bind(component),
@@ -7368,18 +7406,18 @@ var getDebouncedPerformRefresh = (performRefresh) => performRefresh ? debounce(p
7368
7406
  // src/revamp/domain/features/validationAsync/getComponentValidationAsync.ts
7369
7407
  var getComponentValidationAsync = (update, performValidationAsync) => (
7370
7408
  /**
7371
- * Will update the validationState when a new request is made, and will update
7409
+ * Will update the validationAsyncState when a new request is made, and will update
7372
7410
  * the description or set errors when the request completes.
7373
7411
  */
7374
- async (validationState, currentValue) => {
7375
- const { abortController, lastSubmitted } = validationState;
7412
+ async (validationAsyncState, currentValue) => {
7413
+ const { abortController, lastSubmitted } = validationAsyncState;
7376
7414
  if (lastSubmitted === currentValue) {
7377
7415
  return;
7378
7416
  }
7379
7417
  const newAbortController = abortAndResetController(abortController);
7380
7418
  if (isNullish(currentValue)) {
7381
7419
  update((draft) => {
7382
- draft.validationState = {
7420
+ draft.validationAsyncState = {
7383
7421
  abortController: newAbortController,
7384
7422
  lastSubmitted: currentValue,
7385
7423
  messages: {}
@@ -7391,7 +7429,7 @@ var getComponentValidationAsync = (update, performValidationAsync) => (
7391
7429
  const newSubmission = performValidationAsync({ value: currentValue, signal }).then((message) => {
7392
7430
  update((draft) => {
7393
7431
  if (message) {
7394
- draft.validationState.messages.success = message;
7432
+ draft.validationAsyncState.messages.success = message;
7395
7433
  }
7396
7434
  });
7397
7435
  return message;
@@ -7400,11 +7438,11 @@ var getComponentValidationAsync = (update, performValidationAsync) => (
7400
7438
  return null;
7401
7439
  }
7402
7440
  update((draft) => {
7403
- draft.validationState.messages.error = error.message;
7441
+ draft.validationAsyncState.messages.error = error.message;
7404
7442
  });
7405
7443
  });
7406
7444
  update((draft) => {
7407
- draft.validationState = {
7445
+ draft.validationAsyncState = {
7408
7446
  abortController: newAbortController,
7409
7447
  lastSubmitted: currentValue,
7410
7448
  messages: {}
@@ -7459,7 +7497,7 @@ var createNumberInputComponent = (numberInputProps, updateComponent) => {
7459
7497
  onChange(updatedValue) {
7460
7498
  update((draft) => {
7461
7499
  draft.errors = [];
7462
- draft.validationState.messages = {};
7500
+ draft.validationAsyncState.messages = {};
7463
7501
  draft.value = updatedValue;
7464
7502
  });
7465
7503
  performDebouncedRefresh == null ? void 0 : performDebouncedRefresh();
@@ -7508,7 +7546,7 @@ var createNumberInputComponent = (numberInputProps, updateComponent) => {
7508
7546
  return __spreadProps(__spreadValues({}, numberComponent), {
7509
7547
  onBlur() {
7510
7548
  if (this.validate()) {
7511
- validateAsync(this.validationState, this.getLocalValue()).catch(() => {
7549
+ validateAsync(this.validationAsyncState, this.getLocalValue()).catch(() => {
7512
7550
  });
7513
7551
  }
7514
7552
  }
@@ -7820,7 +7858,7 @@ var mapCommonSchemaProps = (schemaMapperProps) => {
7820
7858
  control,
7821
7859
  description,
7822
7860
  disabled: schemaHasDisabled(schema) ? schema.disabled : false,
7823
- errors: isString(validationErrors) ? [validationErrors] : [],
7861
+ errors: isString(validationErrors) ? [validationErrors] : void 0,
7824
7862
  hidden: Boolean(hidden),
7825
7863
  keywords,
7826
7864
  required: Boolean(required),
@@ -7879,8 +7917,8 @@ var getValidationMessage = (json) => {
7879
7917
  return isString(message) ? message : null;
7880
7918
  };
7881
7919
 
7882
- // src/revamp/domain/features/validationAsync/getInitialValidationState.ts
7883
- var getInitialValidationState = () => ({
7920
+ // src/revamp/domain/features/validationAsync/getInitialValidationAsyncState.ts
7921
+ var getInitialValidationAsyncState = () => ({
7884
7922
  abortController: new AbortController(),
7885
7923
  lastSubmitted: null,
7886
7924
  messages: {}
@@ -7889,8 +7927,8 @@ var getInitialValidationState = () => ({
7889
7927
  // src/revamp/domain/mappers/schema/utils/getValidationAsyncInitialState.ts
7890
7928
  var getValidationAsyncInitialState = (schemaMapperProps, mapperProps) => {
7891
7929
  const performValidationAsync = getValidationAsyncFn(schemaMapperProps, mapperProps);
7892
- const validationState = getInitialValidationState();
7893
- return { performValidationAsync, validationState };
7930
+ const validationAsyncState = getInitialValidationAsyncState();
7931
+ return { performValidationAsync, validationAsyncState };
7894
7932
  };
7895
7933
  var getValidationAsyncFn = (schemaMapperProps, mapperProps) => {
7896
7934
  const { schema } = schemaMapperProps;
@@ -7919,7 +7957,7 @@ var numberSchemaToComponent = (schemaMapperProps, mapperProps) => {
7919
7957
  schemaMapperProps,
7920
7958
  mapperProps
7921
7959
  );
7922
- const { performValidationAsync, validationState } = getValidationAsyncInitialState(
7960
+ const { performValidationAsync, validationAsyncState } = getValidationAsyncInitialState(
7923
7961
  schemaMapperProps,
7924
7962
  mapperProps
7925
7963
  );
@@ -7938,7 +7976,7 @@ var numberSchemaToComponent = (schemaMapperProps, mapperProps) => {
7938
7976
  maximum,
7939
7977
  minimum,
7940
7978
  persistedState,
7941
- validationState,
7979
+ validationAsyncState,
7942
7980
  performPersistAsync,
7943
7981
  performRefresh: getPerformRefresh(schema, onRefresh),
7944
7982
  performValidationAsync,
@@ -8200,7 +8238,7 @@ var createIntegerInputComponent = (integerInputProps, updateComponent) => {
8200
8238
  onChange(updatedValue) {
8201
8239
  update((draft) => {
8202
8240
  draft.errors = [];
8203
- draft.validationState.messages = {};
8241
+ draft.validationAsyncState.messages = {};
8204
8242
  draft.value = updatedValue;
8205
8243
  });
8206
8244
  performDebouncedRefresh == null ? void 0 : performDebouncedRefresh();
@@ -8249,7 +8287,7 @@ var createIntegerInputComponent = (integerInputProps, updateComponent) => {
8249
8287
  return __spreadProps(__spreadValues({}, integerComponent), {
8250
8288
  onBlur() {
8251
8289
  if (this.validate()) {
8252
- validateAsync(this.validationState, this.getLocalValue()).catch(() => {
8290
+ validateAsync(this.validationAsyncState, this.getLocalValue()).catch(() => {
8253
8291
  });
8254
8292
  }
8255
8293
  }
@@ -8268,7 +8306,7 @@ var integerSchemaToComponent = (schemaMapperProps, mapperProps) => {
8268
8306
  schemaMapperProps,
8269
8307
  mapperProps
8270
8308
  );
8271
- const { performValidationAsync, validationState } = getValidationAsyncInitialState(
8309
+ const { performValidationAsync, validationAsyncState } = getValidationAsyncInitialState(
8272
8310
  schemaMapperProps,
8273
8311
  mapperProps
8274
8312
  );
@@ -8288,7 +8326,7 @@ var integerSchemaToComponent = (schemaMapperProps, mapperProps) => {
8288
8326
  minimum,
8289
8327
  persistedState,
8290
8328
  value,
8291
- validationState,
8329
+ validationAsyncState,
8292
8330
  performPersistAsync,
8293
8331
  performRefresh: getPerformRefresh(schema, onRefresh),
8294
8332
  performValidationAsync,
@@ -8491,7 +8529,7 @@ var createDateInputComponent = (textInputProps, updateComponent) => {
8491
8529
  onChange(updatedValue) {
8492
8530
  update((draft) => {
8493
8531
  draft.errors = [];
8494
- draft.validationState.messages = {};
8532
+ draft.validationAsyncState.messages = {};
8495
8533
  draft.value = updatedValue;
8496
8534
  });
8497
8535
  performRefresh == null ? void 0 : performRefresh();
@@ -8542,7 +8580,7 @@ var createDateInputComponent = (textInputProps, updateComponent) => {
8542
8580
  return __spreadProps(__spreadValues({}, dateInputComponent), {
8543
8581
  onBlur() {
8544
8582
  if (this.validate()) {
8545
- validateAsync(this.validationState, this.getLocalValue()).catch(() => {
8583
+ validateAsync(this.validationAsyncState, this.getLocalValue()).catch(() => {
8546
8584
  });
8547
8585
  }
8548
8586
  }
@@ -8566,7 +8604,7 @@ var stringSchemaToDateInputComponent = (schemaMapperProps, mapperProps) => {
8566
8604
  schemaMapperProps,
8567
8605
  mapperProps
8568
8606
  );
8569
- const { performValidationAsync, validationState } = getValidationAsyncInitialState(
8607
+ const { performValidationAsync, validationAsyncState } = getValidationAsyncInitialState(
8570
8608
  schemaMapperProps,
8571
8609
  mapperProps
8572
8610
  );
@@ -8585,7 +8623,7 @@ var stringSchemaToDateInputComponent = (schemaMapperProps, mapperProps) => {
8585
8623
  maximumDate,
8586
8624
  value,
8587
8625
  persistedState,
8588
- validationState,
8626
+ validationAsyncState,
8589
8627
  performPersistAsync,
8590
8628
  performRefresh: getPerformRefresh(schema, onRefresh),
8591
8629
  performValidationAsync,
@@ -8797,7 +8835,7 @@ var createTextInputComponent = (textInputProps, updateComponent) => {
8797
8835
  onChange(updatedValue) {
8798
8836
  update((draft) => {
8799
8837
  draft.errors = [];
8800
- draft.validationState.messages = {};
8838
+ draft.validationAsyncState.messages = {};
8801
8839
  draft.value = updatedValue;
8802
8840
  });
8803
8841
  performDebouncedRefresh == null ? void 0 : performDebouncedRefresh();
@@ -8846,7 +8884,7 @@ var createTextInputComponent = (textInputProps, updateComponent) => {
8846
8884
  return __spreadProps(__spreadValues({}, inputComponent), {
8847
8885
  onBlur() {
8848
8886
  if (this.validate()) {
8849
- validateAsync(this.validationState, this.getLocalValue()).catch(() => {
8887
+ validateAsync(this.validationAsyncState, this.getLocalValue()).catch(() => {
8850
8888
  });
8851
8889
  }
8852
8890
  }
@@ -8875,7 +8913,7 @@ var stringSchemaToTextInputComponent = (schemaMapperProps, mapperProps) => {
8875
8913
  schemaMapperProps,
8876
8914
  mapperProps
8877
8915
  );
8878
- const { performValidationAsync, validationState } = getValidationAsyncInitialState(
8916
+ const { performValidationAsync, validationAsyncState } = getValidationAsyncInitialState(
8879
8917
  schemaMapperProps,
8880
8918
  mapperProps
8881
8919
  );
@@ -8897,7 +8935,7 @@ var stringSchemaToTextInputComponent = (schemaMapperProps, mapperProps) => {
8897
8935
  minLength,
8898
8936
  value,
8899
8937
  persistedState,
8900
- validationState,
8938
+ validationAsyncState,
8901
8939
  performPersistAsync,
8902
8940
  performRefresh: getPerformRefresh(schema, onRefresh),
8903
8941
  performValidationAsync,
@@ -8949,7 +8987,7 @@ var createContainerComponent = (containerProps) => __spreadProps(__spreadValues(
8949
8987
  }
8950
8988
  });
8951
8989
 
8952
- // src/revamp/domain/components/repeatableComponent/RepeatableComponent.ts
8990
+ // src/revamp/domain/components/RepeatableComponent.ts
8953
8991
  var createRepeatableComponent = (repeatableProps, updateComponent) => {
8954
8992
  const _a = repeatableProps, {
8955
8993
  uid,
@@ -9094,7 +9132,8 @@ var arraySchemaToRepeatableComponent = (schemaMapperProps, mapperProps) => {
9094
9132
  schema: items,
9095
9133
  localValue: editableValue,
9096
9134
  model: localValueToJsonElement(editableValue),
9097
- validationErrors: void 0
9135
+ validationErrors: void 0,
9136
+ required: true
9098
9137
  },
9099
9138
  mapperProps
9100
9139
  );
@@ -9137,9 +9176,28 @@ var getRandomInt = () => Math.floor(Math.random() * 1e8);
9137
9176
 
9138
9177
  // src/revamp/domain/components/MultiUploadInputComponent.ts
9139
9178
  var createMultiUploadInputComponent = (uploadInputProps, updateComponent) => {
9140
- const _a = uploadInputProps, { uid, id, checks, format, performPersistAsync, onValueChange, summariser } = _a, rest = __objRest(_a, ["uid", "id", "checks", "format", "performPersistAsync", "onValueChange", "summariser"]);
9179
+ const _a = uploadInputProps, {
9180
+ uid,
9181
+ id,
9182
+ checks,
9183
+ fileChecks,
9184
+ format,
9185
+ performPersistAsync,
9186
+ onValueChange,
9187
+ summariser
9188
+ } = _a, rest = __objRest(_a, [
9189
+ "uid",
9190
+ "id",
9191
+ "checks",
9192
+ "fileChecks",
9193
+ "format",
9194
+ "performPersistAsync",
9195
+ "onValueChange",
9196
+ "summariser"
9197
+ ]);
9141
9198
  const update = getInputUpdateFunction(uid, updateComponent);
9142
9199
  const getValidationErrors = getLocalValueValidator(checks);
9200
+ const getFileValidationErrors = getLocalValueValidator(fileChecks);
9143
9201
  const getAndSetValidationErrors = (currentValue) => {
9144
9202
  const messages = getValidationErrors(currentValue);
9145
9203
  update((draft) => {
@@ -9152,6 +9210,7 @@ var createMultiUploadInputComponent = (uploadInputProps, updateComponent) => {
9152
9210
  uid,
9153
9211
  id,
9154
9212
  format: "base64",
9213
+ errorsMap: {},
9155
9214
  fileMap: {},
9156
9215
  onBlur() {
9157
9216
  getAndSetValidationErrors(this.getLocalValue());
@@ -9166,13 +9225,17 @@ var createMultiUploadInputComponent = (uploadInputProps, updateComponent) => {
9166
9225
  update((draft) => {
9167
9226
  draft.value.splice(fileIndex, 1);
9168
9227
  const _a2 = draft.fileMap, { [fileId]: _ } = _a2, files = __objRest(_a2, [__restKey(fileId)]);
9228
+ const _b = draft.errorsMap, { [fileId]: removedErrors } = _b, fileErrors = __objRest(_b, [__restKey(fileId)]);
9169
9229
  draft.fileMap = files;
9230
+ draft.errorsMap = fileErrors;
9170
9231
  });
9171
9232
  }
9172
9233
  },
9173
9234
  async onUpload(file, fileId) {
9235
+ const fileErrors = getFileValidationErrors(file);
9174
9236
  update((draft) => {
9175
9237
  draft.fileMap[fileId] = file;
9238
+ draft.errorsMap[fileId] = fileErrors;
9176
9239
  draft.value = [...this.value, file];
9177
9240
  draft.errors = [];
9178
9241
  });
@@ -9193,7 +9256,7 @@ var createMultiUploadInputComponent = (uploadInputProps, updateComponent) => {
9193
9256
  },
9194
9257
  validate() {
9195
9258
  const messages = getAndSetValidationErrors(this.getLocalValue());
9196
- return messages.length === 0;
9259
+ return messages.length === 0 && Object.values(this.errorsMap).every((errors) => errors.length === 0);
9197
9260
  }
9198
9261
  }, rest);
9199
9262
  if (!performPersistAsync) {
@@ -9252,6 +9315,7 @@ var arraySchemaToMultiUploadComponent = (schemaMapperProps, mapperProps) => {
9252
9315
  accepts,
9253
9316
  autoComplete: "off",
9254
9317
  checks: schema.hidden ? [] : checks,
9318
+ fileChecks: [],
9255
9319
  format,
9256
9320
  maxSize,
9257
9321
  minItems,
@@ -9376,7 +9440,7 @@ var createMultiSelectComponent = (multiSelectProps, updateComponent) => {
9376
9440
  onSelect(indices) {
9377
9441
  inputComponent.onSelect.call(this, indices);
9378
9442
  if (this.validate()) {
9379
- validateAsync(this.validationState, this.getLocalValue()).catch(() => {
9443
+ validateAsync(this.validationAsyncState, this.getLocalValue()).catch(() => {
9380
9444
  });
9381
9445
  }
9382
9446
  }
@@ -9427,7 +9491,7 @@ var arraySchemaToMultiSelectComponent = (schemaMapperProps, mapperProps) => {
9427
9491
  const { maxItems, minItems, title, validationMessages } = schema;
9428
9492
  const { getErrorMessageFunctions, onRefresh, onValueChange, updateComponent } = mapperProps;
9429
9493
  const errorMessageFunctions = getErrorMessageFunctions(validationMessages);
9430
- const { performValidationAsync, validationState } = getValidationAsyncInitialState(
9494
+ const { performValidationAsync, validationAsyncState } = getValidationAsyncInitialState(
9431
9495
  schemaMapperProps,
9432
9496
  mapperProps
9433
9497
  );
@@ -9446,7 +9510,7 @@ var arraySchemaToMultiSelectComponent = (schemaMapperProps, mapperProps) => {
9446
9510
  options,
9447
9511
  required,
9448
9512
  title,
9449
- validationState,
9513
+ validationAsyncState,
9450
9514
  performValidationAsync,
9451
9515
  performRefresh: getPerformRefresh(schema, onRefresh),
9452
9516
  onValueChange
@@ -9622,7 +9686,7 @@ var createBooleanInputComponent = (booleanInputProps, updateComponent) => {
9622
9686
  return __spreadProps(__spreadValues({}, booleanComponent), {
9623
9687
  onChange(updatedValue) {
9624
9688
  booleanComponent.onChange.call(this, updatedValue);
9625
- validateAsync(this.validationState, this.getLocalValue()).catch(() => {
9689
+ validateAsync(this.validationAsyncState, this.getLocalValue()).catch(() => {
9626
9690
  });
9627
9691
  }
9628
9692
  });
@@ -9640,7 +9704,7 @@ var booleanSchemaToComponent = (schemaMapperProps, mapperProps) => {
9640
9704
  schemaMapperProps,
9641
9705
  mapperProps
9642
9706
  );
9643
- const { performValidationAsync, validationState } = getValidationAsyncInitialState(
9707
+ const { performValidationAsync, validationAsyncState } = getValidationAsyncInitialState(
9644
9708
  schemaMapperProps,
9645
9709
  mapperProps
9646
9710
  );
@@ -9651,7 +9715,7 @@ var booleanSchemaToComponent = (schemaMapperProps, mapperProps) => {
9651
9715
  __spreadProps(__spreadValues({}, mapCommonSchemaProps(schemaMapperProps)), {
9652
9716
  value: value != null ? value : false,
9653
9717
  persistedState,
9654
- validationState,
9718
+ validationAsyncState,
9655
9719
  performPersistAsync,
9656
9720
  performRefresh,
9657
9721
  performValidationAsync,
@@ -10186,13 +10250,44 @@ var createStatusListComponent = (statusListProps) => __spreadProps(__spreadValue
10186
10250
  });
10187
10251
 
10188
10252
  // src/revamp/domain/mappers/layout/statusListLayoutToComponent.ts
10189
- var statusListLayoutToComponent = (uid, { control, items, margin = "md", title }) => createStatusListComponent({
10253
+ var statusListLayoutToComponent = (uid, { control, items, margin = "md", title }, { onAction, onLink }) => createStatusListComponent({
10190
10254
  uid,
10191
10255
  control,
10192
- items,
10256
+ items: items.map((item) => {
10257
+ var _a, _b, _c;
10258
+ return __spreadProps(__spreadValues({}, item), {
10259
+ href: (_c = (_b = (_a = item == null ? void 0 : item.callToAction) == null ? void 0 : _a.behavior) == null ? void 0 : _b.link) == null ? void 0 : _c.url,
10260
+ callToAction: item.callToAction ? getItemCallToAction(item.callToAction, onAction, onLink) : void 0
10261
+ });
10262
+ }),
10193
10263
  margin,
10194
10264
  title
10195
10265
  });
10266
+ var getItemCallToAction = (callToAction, onAction, onLink) => {
10267
+ const { accessibilityDescription, behavior, title } = callToAction;
10268
+ if (behavior.link) {
10269
+ const { url } = behavior.link;
10270
+ return {
10271
+ accessibilityDescription,
10272
+ href: url,
10273
+ title,
10274
+ onClick: () => {
10275
+ void onLink(url);
10276
+ }
10277
+ };
10278
+ }
10279
+ if (behavior.action) {
10280
+ const { action } = behavior;
10281
+ return {
10282
+ accessibilityDescription,
10283
+ title,
10284
+ onClick: () => {
10285
+ void onAction(action);
10286
+ }
10287
+ };
10288
+ }
10289
+ return void 0;
10290
+ };
10196
10291
 
10197
10292
  // src/revamp/domain/mappers/layout/listLayoutToComponent.ts
10198
10293
  var listLayoutToComponent = (uid, { control, items, margin = "md", title }) => createStatusListComponent({
@@ -10259,7 +10354,7 @@ var mapLayoutToComponent = (uid, layout, mapperProps) => {
10259
10354
  case "search":
10260
10355
  return searchLayoutToComponent(uid, layout, mapperProps);
10261
10356
  case "status-list":
10262
- return statusListLayoutToComponent(uid, layout);
10357
+ return statusListLayoutToComponent(uid, layout, mapperProps);
10263
10358
  default:
10264
10359
  throw new Error(`Invalid layout type in ${JSON.stringify(layout)}`);
10265
10360
  }
@@ -11141,10 +11236,29 @@ function LabelContentWithHelp({ text, help }) {
11141
11236
 
11142
11237
  // ../renderers/src/components/FieldInput.tsx
11143
11238
  import { jsx as jsx10 } from "react/jsx-runtime";
11144
- function FieldInput({ id, children, label, error, description, help }) {
11239
+ function FieldInput({ id, children, label, validation, description, help }) {
11145
11240
  const labelContent = label && help ? /* @__PURE__ */ jsx10(LabelContentWithHelp, { text: label, help }) : label;
11146
- return /* @__PURE__ */ jsx10(Field, { id, label: labelContent, hint: description, error, children });
11241
+ return /* @__PURE__ */ jsx10(
11242
+ Field,
11243
+ {
11244
+ id,
11245
+ label: labelContent,
11246
+ description,
11247
+ message: validation == null ? void 0 : validation.message,
11248
+ sentiment: mapStatusToSentiment(validation),
11249
+ children
11250
+ }
11251
+ );
11147
11252
  }
11253
+ var mapStatusToSentiment = (validation) => {
11254
+ if (validation) {
11255
+ if (validation.status === "valid") {
11256
+ return "positive";
11257
+ }
11258
+ return "negative";
11259
+ }
11260
+ return void 0;
11261
+ };
11148
11262
  var FieldInput_default = FieldInput;
11149
11263
 
11150
11264
  // ../renderers/src/BooleanInputRenderer.tsx
@@ -11153,9 +11267,27 @@ import { jsx as jsx11 } from "react/jsx-runtime";
11153
11267
  var BooleanInputRenderer = {
11154
11268
  canRenderType: "input-boolean",
11155
11269
  render: (props) => {
11156
- const _a = props, { id, control, label = "", description, help, error, type, value } = _a, rest = __objRest(_a, ["id", "control", "label", "description", "help", "error", "type", "value"]);
11270
+ const _a = props, {
11271
+ id,
11272
+ control,
11273
+ label = "",
11274
+ description,
11275
+ help,
11276
+ type,
11277
+ validationState,
11278
+ value
11279
+ } = _a, rest = __objRest(_a, [
11280
+ "id",
11281
+ "control",
11282
+ "label",
11283
+ "description",
11284
+ "help",
11285
+ "type",
11286
+ "validationState",
11287
+ "value"
11288
+ ]);
11157
11289
  const checkboxProps = __spreadProps(__spreadValues({}, rest), { label, secondary: description, checked: value });
11158
- return /* @__PURE__ */ jsx11(FieldInput_default, { id, label: "", description: "", error, help, children: /* @__PURE__ */ jsx11(Checkbox, __spreadValues({ id }, checkboxProps)) });
11290
+ return /* @__PURE__ */ jsx11(FieldInput_default, { id, label: "", description: "", validation: validationState, help, children: /* @__PURE__ */ jsx11(Checkbox, __spreadValues({ id }, checkboxProps)) });
11159
11291
  }
11160
11292
  };
11161
11293
  var BooleanInputRenderer_default = BooleanInputRenderer;
@@ -11380,23 +11512,33 @@ var DateInputRenderer = {
11380
11512
  control,
11381
11513
  label,
11382
11514
  description,
11383
- error,
11384
11515
  type,
11385
11516
  help,
11517
+ validationState,
11386
11518
  value: initialValue
11387
11519
  } = _a, rest = __objRest(_a, [
11388
11520
  "id",
11389
11521
  "control",
11390
11522
  "label",
11391
11523
  "description",
11392
- "error",
11393
11524
  "type",
11394
11525
  "help",
11526
+ "validationState",
11395
11527
  "value"
11396
11528
  ]);
11397
11529
  const value = initialValue != null ? initialValue : "";
11398
11530
  const inputProps = __spreadProps(__spreadValues({}, rest), { value, id });
11399
- return /* @__PURE__ */ jsx16(FieldInput_default, { id, label, description, error, help, children: /* @__PURE__ */ jsx16(VariableDateInput_default, { control, inputProps }) });
11531
+ return /* @__PURE__ */ jsx16(
11532
+ FieldInput_default,
11533
+ {
11534
+ id,
11535
+ label,
11536
+ description,
11537
+ validation: validationState,
11538
+ help,
11539
+ children: /* @__PURE__ */ jsx16(VariableDateInput_default, { control, inputProps })
11540
+ }
11541
+ );
11400
11542
  }
11401
11543
  };
11402
11544
  var DateInputRenderer_default = DateInputRenderer;
@@ -11684,23 +11826,33 @@ import { jsx as jsx29 } from "react/jsx-runtime";
11684
11826
  var IntegerInputRenderer = {
11685
11827
  canRenderType: "input-integer",
11686
11828
  render: (props) => {
11687
- const _a = props, { id, label, error, description, help, type, value, onChange } = _a, rest = __objRest(_a, ["id", "label", "error", "description", "help", "type", "value", "onChange"]);
11688
- return /* @__PURE__ */ jsx29(FieldInput_default, { id, label, description, error, help, children: /* @__PURE__ */ jsx29(
11689
- Input,
11690
- __spreadValues({
11829
+ const _a = props, { id, label, description, help, type, validationState, value, onChange } = _a, rest = __objRest(_a, ["id", "label", "description", "help", "type", "validationState", "value", "onChange"]);
11830
+ return /* @__PURE__ */ jsx29(
11831
+ FieldInput_default,
11832
+ {
11691
11833
  id,
11692
- name: id,
11693
- type: "number",
11694
- step: "1",
11695
- pattern: "\\d+",
11696
- value: value != null ? value : "",
11697
- onChange: ({ target: { value: newValue } }) => {
11698
- const parsedValue = Number.parseInt(newValue, 10);
11699
- onChange(Number.isNaN(parsedValue) ? null : parsedValue);
11700
- },
11701
- onWheel
11702
- }, rest)
11703
- ) });
11834
+ label,
11835
+ description,
11836
+ validation: validationState,
11837
+ help,
11838
+ children: /* @__PURE__ */ jsx29(
11839
+ Input,
11840
+ __spreadValues({
11841
+ id,
11842
+ name: id,
11843
+ type: "number",
11844
+ step: "1",
11845
+ pattern: "\\d+",
11846
+ value: value != null ? value : "",
11847
+ onChange: ({ target: { value: newValue } }) => {
11848
+ const parsedValue = Number.parseInt(newValue, 10);
11849
+ onChange(Number.isNaN(parsedValue) ? null : parsedValue);
11850
+ },
11851
+ onWheel
11852
+ }, rest)
11853
+ )
11854
+ }
11855
+ );
11704
11856
  }
11705
11857
  };
11706
11858
  var IntegerInputRenderer_default = IntegerInputRenderer;
@@ -11806,10 +11958,10 @@ function MultiSelectInputRendererComponent(props) {
11806
11958
  disabled,
11807
11959
  label,
11808
11960
  help,
11809
- error,
11810
11961
  options,
11811
11962
  placeholder,
11812
11963
  selectedIndices,
11964
+ validationState,
11813
11965
  onSelect
11814
11966
  } = props;
11815
11967
  const mergedIndices = stagedIndices != null ? stagedIndices : selectedIndices;
@@ -11840,39 +11992,49 @@ function MultiSelectInputRendererComponent(props) {
11840
11992
  };
11841
11993
  return /* @__PURE__ */ jsx34(SelectInputOptionContent, __spreadValues({}, contentProps));
11842
11994
  };
11843
- return /* @__PURE__ */ jsx34(FieldInput_default, { id, label, help, description, error, children: /* @__PURE__ */ jsx34(
11844
- SelectInput,
11995
+ return /* @__PURE__ */ jsx34(
11996
+ FieldInput_default,
11845
11997
  {
11846
11998
  id,
11847
- items: options.map((option, index) => {
11848
- var _a, _b, _c;
11849
- return {
11850
- type: "option",
11851
- value: index,
11852
- filterMatchers: [
11853
- ...(_a = option.keywords) != null ? _a : [],
11854
- (_b = option.title) != null ? _b : "",
11855
- (_c = option.description) != null ? _c : ""
11856
- ],
11857
- disabled: option.disabled
11858
- };
11859
- }),
11860
- disabled,
11861
- placeholder,
11862
- value: mergedIndices,
11863
- renderValue,
11864
- multiple: true,
11865
- onChange: (values) => {
11866
- setStagedIndices(values);
11867
- },
11868
- onClose: () => {
11869
- if (stagedIndices) {
11870
- onSelect(stagedIndices);
11871
- setStagedIndices(void 0);
11999
+ label,
12000
+ help,
12001
+ description,
12002
+ validation: validationState,
12003
+ children: /* @__PURE__ */ jsx34(
12004
+ SelectInput,
12005
+ {
12006
+ id,
12007
+ items: options.map((option, index) => {
12008
+ var _a, _b, _c;
12009
+ return {
12010
+ type: "option",
12011
+ value: index,
12012
+ filterMatchers: [
12013
+ ...(_a = option.keywords) != null ? _a : [],
12014
+ (_b = option.title) != null ? _b : "",
12015
+ (_c = option.description) != null ? _c : ""
12016
+ ],
12017
+ disabled: option.disabled
12018
+ };
12019
+ }),
12020
+ disabled,
12021
+ placeholder,
12022
+ value: mergedIndices,
12023
+ renderValue,
12024
+ multiple: true,
12025
+ onChange: (values) => {
12026
+ setStagedIndices(values);
12027
+ },
12028
+ onClose: () => {
12029
+ if (stagedIndices) {
12030
+ onSelect(stagedIndices);
12031
+ setStagedIndices(void 0);
12032
+ }
12033
+ }
11872
12034
  }
11873
- }
12035
+ )
11874
12036
  }
11875
- ) });
12037
+ );
11876
12038
  }
11877
12039
  var MultiSelectInputRenderer_default = MultiSelectInputRenderer;
11878
12040
 
@@ -11888,8 +12050,8 @@ function UploadFieldInput({
11888
12050
  children,
11889
12051
  label,
11890
12052
  description,
11891
- error,
11892
- help
12053
+ help,
12054
+ validation
11893
12055
  }) {
11894
12056
  const labelContent = label && help ? /* @__PURE__ */ jsx35(LabelContentWithHelp, { text: label, help }) : label;
11895
12057
  const descriptionId = description ? `${id}-description` : void 0;
@@ -11897,12 +12059,12 @@ function UploadFieldInput({
11897
12059
  "div",
11898
12060
  {
11899
12061
  className: (0, import_classnames3.default)("form-group d-block", {
11900
- "has-error": !!error
12062
+ "has-error": (validation == null ? void 0 : validation.status) === "invalid"
11901
12063
  }),
11902
12064
  children: [
11903
12065
  /* @__PURE__ */ jsx35("label", { htmlFor: id, className: "control-label", children: labelContent }),
11904
12066
  children,
11905
- error && /* @__PURE__ */ jsx35(InlineAlert, { type: "negative", id: descriptionId, children: error })
12067
+ (validation == null ? void 0 : validation.status) === "invalid" && /* @__PURE__ */ jsx35(InlineAlert, { type: "negative", id: descriptionId, children: validation.message })
11906
12068
  ]
11907
12069
  }
11908
12070
  );
@@ -11945,10 +12107,10 @@ var MultiUploadInputRenderer = {
11945
12107
  label,
11946
12108
  description,
11947
12109
  disabled,
11948
- error,
11949
12110
  maxSize,
11950
12111
  maxItems,
11951
12112
  uploadLabel,
12113
+ validationState,
11952
12114
  onUpload,
11953
12115
  onDelete
11954
12116
  } = props;
@@ -11961,22 +12123,32 @@ var MultiUploadInputRenderer = {
11961
12123
  };
11962
12124
  const onDeleteFile = async (fileId) => onDelete(String(fileId));
11963
12125
  const descriptionId = description ? `${id}-description` : void 0;
11964
- return /* @__PURE__ */ jsx36(UploadFieldInput_default, { id, label, description, error, help, children: /* @__PURE__ */ jsx36(
11965
- UploadInput,
12126
+ return /* @__PURE__ */ jsx36(
12127
+ UploadFieldInput_default,
11966
12128
  {
11967
12129
  id,
11968
- "aria-describedby": descriptionId,
12130
+ label,
11969
12131
  description,
11970
- disabled,
11971
- fileTypes: getAcceptsString(accepts),
11972
- maxFiles: maxItems,
11973
- multiple: true,
11974
- sizeLimit: maxSize ? toKilobytes(maxSize) : void 0,
11975
- uploadButtonTitle: uploadLabel,
11976
- onDeleteFile,
11977
- onUploadFile
12132
+ validation: validationState,
12133
+ help,
12134
+ children: /* @__PURE__ */ jsx36(
12135
+ UploadInput,
12136
+ {
12137
+ id,
12138
+ "aria-describedby": descriptionId,
12139
+ description,
12140
+ disabled,
12141
+ fileTypes: getAcceptsString(accepts),
12142
+ maxFiles: maxItems,
12143
+ multiple: true,
12144
+ sizeLimit: maxSize ? toKilobytes(maxSize) : void 0,
12145
+ uploadButtonTitle: uploadLabel,
12146
+ onDeleteFile,
12147
+ onUploadFile
12148
+ }
12149
+ )
11978
12150
  }
11979
- ) });
12151
+ );
11980
12152
  }
11981
12153
  };
11982
12154
  var MultiUploadInputRenderer_default = MultiUploadInputRenderer;
@@ -11987,21 +12159,31 @@ import { jsx as jsx37 } from "react/jsx-runtime";
11987
12159
  var NumberInputRenderer = {
11988
12160
  canRenderType: "input-number",
11989
12161
  render: (props) => {
11990
- const _a = props, { id, label, error, description, help, type, value, onChange } = _a, rest = __objRest(_a, ["id", "label", "error", "description", "help", "type", "value", "onChange"]);
11991
- return /* @__PURE__ */ jsx37(FieldInput_default, { id, label, description, error, help, children: /* @__PURE__ */ jsx37(
11992
- Input2,
11993
- __spreadValues({
12162
+ const _a = props, { id, label, description, help, type, validationState, value, onChange } = _a, rest = __objRest(_a, ["id", "label", "description", "help", "type", "validationState", "value", "onChange"]);
12163
+ return /* @__PURE__ */ jsx37(
12164
+ FieldInput_default,
12165
+ {
11994
12166
  id,
11995
- name: id,
11996
- type: "number",
11997
- value: value != null ? value : "",
11998
- onChange: ({ target: { value: newValue } }) => {
11999
- const parsedValue = Number.parseFloat(newValue);
12000
- onChange(Number.isNaN(parsedValue) ? null : parsedValue);
12001
- },
12002
- onWheel
12003
- }, rest)
12004
- ) });
12167
+ label,
12168
+ description,
12169
+ validation: validationState,
12170
+ help,
12171
+ children: /* @__PURE__ */ jsx37(
12172
+ Input2,
12173
+ __spreadValues({
12174
+ id,
12175
+ name: id,
12176
+ type: "number",
12177
+ value: value != null ? value : "",
12178
+ onChange: ({ target: { value: newValue } }) => {
12179
+ const parsedValue = Number.parseFloat(newValue);
12180
+ onChange(Number.isNaN(parsedValue) ? null : parsedValue);
12181
+ },
12182
+ onWheel
12183
+ }, rest)
12184
+ )
12185
+ }
12186
+ );
12005
12187
  }
12006
12188
  };
12007
12189
  var NumberInputRenderer_default = NumberInputRenderer;
@@ -12121,9 +12303,9 @@ function Repeatable(props) {
12121
12303
  description,
12122
12304
  editableItem,
12123
12305
  editItemTitle,
12124
- error,
12125
12306
  items,
12126
12307
  title,
12308
+ validationState,
12127
12309
  onEdit,
12128
12310
  onAdd,
12129
12311
  onSave,
@@ -12159,7 +12341,7 @@ function Repeatable(props) {
12159
12341
  "div",
12160
12342
  {
12161
12343
  className: (0, import_classnames5.default)("form-group", {
12162
- "has-error": error
12344
+ "has-error": (validationState == null ? void 0 : validationState.status) === "invalid"
12163
12345
  }),
12164
12346
  children: [
12165
12347
  items == null ? void 0 : items.map((item, index) => /* @__PURE__ */ jsx39(ItemSummaryOption, { item, onClick: () => onEditItem(index) }, item.id)),
@@ -12172,7 +12354,7 @@ function Repeatable(props) {
12172
12354
  onClick: () => onAddItem()
12173
12355
  }
12174
12356
  ),
12175
- error && /* @__PURE__ */ jsx39(InlineAlert2, { type: "negative", children: error })
12357
+ (validationState == null ? void 0 : validationState.status) === "invalid" && /* @__PURE__ */ jsx39(InlineAlert2, { type: "negative", children: validationState.message })
12176
12358
  ]
12177
12359
  }
12178
12360
  ),
@@ -12237,28 +12419,45 @@ var generic_error_messages_default2 = defineMessages9({
12237
12419
  });
12238
12420
 
12239
12421
  // ../renderers/src/SearchRenderer/ErrorResult.tsx
12422
+ import { Button as Button5 } from "@transferwise/components";
12240
12423
  import { jsx as jsx40, jsxs as jsxs12 } from "react/jsx-runtime";
12241
12424
  function ErrorResult({ state }) {
12242
12425
  const intl = useIntl7();
12426
+ const buttonVisualProps = {
12427
+ priority: "tertiary",
12428
+ size: "sm",
12429
+ style: { marginTop: "-2px", padding: "0", width: "auto", display: "inline" }
12430
+ };
12243
12431
  return /* @__PURE__ */ jsxs12("p", { className: "m-t-2", children: [
12244
12432
  intl.formatMessage(generic_error_messages_default2.genericError),
12245
12433
  "\xA0",
12246
12434
  /* @__PURE__ */ jsx40(
12247
- "a",
12248
- {
12249
- href: "/",
12250
- onClick: (e) => {
12251
- e.preventDefault();
12435
+ Button5,
12436
+ __spreadProps(__spreadValues({}, buttonVisualProps), {
12437
+ onClick: () => {
12252
12438
  state.onRetry();
12253
12439
  },
12254
12440
  children: intl.formatMessage(generic_error_messages_default2.retry)
12255
- }
12441
+ })
12256
12442
  )
12257
12443
  ] });
12258
12444
  }
12259
12445
 
12260
12446
  // ../renderers/src/SearchRenderer/BlockSearchRendererComponent.tsx
12261
12447
  import { useState as useState7 } from "react";
12448
+
12449
+ // ../renderers/src/messages/search.messages.ts
12450
+ import { defineMessages as defineMessages10 } from "react-intl";
12451
+ var search_messages_default = defineMessages10({
12452
+ loading: {
12453
+ id: "df.wise.SearchLayout.loading",
12454
+ defaultMessage: "Loading...",
12455
+ description: "A message shown to the user while their search is being processed, before results appear."
12456
+ }
12457
+ });
12458
+
12459
+ // ../renderers/src/SearchRenderer/BlockSearchRendererComponent.tsx
12460
+ import { useIntl as useIntl8 } from "react-intl";
12262
12461
  import { Fragment as Fragment5, jsx as jsx41, jsxs as jsxs13 } from "react/jsx-runtime";
12263
12462
  function BlockSearchRendererComponent({
12264
12463
  id,
@@ -12271,8 +12470,9 @@ function BlockSearchRendererComponent({
12271
12470
  }) {
12272
12471
  const [hasSearched, setHasSearched] = useState7(false);
12273
12472
  const trackEvent = useTrackEvent();
12473
+ const { formatMessage } = useIntl8();
12274
12474
  return /* @__PURE__ */ jsxs13("div", { className: getMargin(margin), children: [
12275
- /* @__PURE__ */ jsx41(FieldInput_default, { id, description: "", error: "", help: "", label: title, children: /* @__PURE__ */ jsx41(
12475
+ /* @__PURE__ */ jsx41(FieldInput_default, { id, description: "", validation: void 0, help: "", label: title, children: /* @__PURE__ */ jsx41(
12276
12476
  Input4,
12277
12477
  {
12278
12478
  id,
@@ -12289,7 +12489,7 @@ function BlockSearchRendererComponent({
12289
12489
  }
12290
12490
  }
12291
12491
  ) }),
12292
- isLoading ? /* @__PURE__ */ jsx41(Fragment5, { children: "Loading..." }) : /* @__PURE__ */ jsx41(SearchResultContent, { state, onChange })
12492
+ isLoading ? /* @__PURE__ */ jsx41(Fragment5, { children: formatMessage(search_messages_default.loading) }) : /* @__PURE__ */ jsx41(SearchResultContent, { state, onChange })
12293
12493
  ] });
12294
12494
  }
12295
12495
  function SearchResultContent({
@@ -12342,7 +12542,7 @@ var BlockSearchRendererComponent_default = BlockSearchRendererComponent;
12342
12542
  import { Markdown as Markdown4, Typeahead } from "@transferwise/components";
12343
12543
  import { Search } from "@transferwise/icons";
12344
12544
  import { useState as useState8 } from "react";
12345
- import { useIntl as useIntl8 } from "react-intl";
12545
+ import { useIntl as useIntl9 } from "react-intl";
12346
12546
  import { jsx as jsx42 } from "react/jsx-runtime";
12347
12547
  function InlineSearchRenderer({
12348
12548
  id,
@@ -12354,8 +12554,8 @@ function InlineSearchRenderer({
12354
12554
  }) {
12355
12555
  const [hasSearched, setHasSearched] = useState8(false);
12356
12556
  const trackEvent = useTrackEvent();
12357
- const intl = useIntl8();
12358
- return /* @__PURE__ */ jsx42("div", { className: getMargin(margin), children: /* @__PURE__ */ jsx42(FieldInput_default, { id, description: "", error: "", help: "", label: title, children: /* @__PURE__ */ jsx42(
12557
+ const intl = useIntl9();
12558
+ return /* @__PURE__ */ jsx42("div", { className: getMargin(margin), children: /* @__PURE__ */ jsx42(FieldInput_default, { id, description: "", validation: void 0, help: "", label: title, children: /* @__PURE__ */ jsx42(
12359
12559
  Typeahead,
12360
12560
  {
12361
12561
  id: "typeahead-input-id",
@@ -12401,6 +12601,7 @@ function mapResultToTypeaheadOption(result) {
12401
12601
  };
12402
12602
  }
12403
12603
  function TypeaheadFooter({ state, isLoading }) {
12604
+ const { formatMessage } = useIntl9();
12404
12605
  if (state.type === "noResults") {
12405
12606
  return /* @__PURE__ */ jsx42(Markdown4, { className: "m-t-2 m-x-2", config: { link: { target: "_blank" } }, children: state.message });
12406
12607
  }
@@ -12408,7 +12609,7 @@ function TypeaheadFooter({ state, isLoading }) {
12408
12609
  return /* @__PURE__ */ jsx42("div", { className: "m-t-2 m-x-2", children: /* @__PURE__ */ jsx42(ErrorResult, { state }) });
12409
12610
  }
12410
12611
  if (state.type === "pending" || isLoading) {
12411
- return /* @__PURE__ */ jsx42("p", { className: "m-t-2 m-x-2", children: "Loading..." });
12612
+ return /* @__PURE__ */ jsx42("p", { className: "m-t-2 m-x-2", children: formatMessage(search_messages_default.loading) });
12412
12613
  }
12413
12614
  return null;
12414
12615
  }
@@ -12431,30 +12632,40 @@ function RadioInputRendererComponent(props) {
12431
12632
  children,
12432
12633
  description,
12433
12634
  disabled,
12434
- error,
12435
12635
  help,
12436
12636
  label,
12437
12637
  options,
12438
12638
  selectedIndex,
12639
+ validationState,
12439
12640
  onSelect
12440
12641
  } = props;
12441
12642
  return /* @__PURE__ */ jsxs14(Fragment6, { children: [
12442
- /* @__PURE__ */ jsx44(FieldInput_default, { id, label, help, description, error, children: /* @__PURE__ */ jsx44("span", { children: /* @__PURE__ */ jsx44(
12443
- RadioGroup,
12643
+ /* @__PURE__ */ jsx44(
12644
+ FieldInput_default,
12444
12645
  {
12445
- name: id,
12446
- radios: options.map((option, index) => ({
12447
- label: option.title,
12448
- value: index,
12449
- secondary: option.description,
12450
- disabled: option.disabled || disabled,
12451
- avatar: /* @__PURE__ */ jsx44(OptionMedia, { icon: option.icon, image: option.image })
12452
- })),
12453
- selectedValue: selectedIndex != null ? selectedIndex : void 0,
12454
- onChange: onSelect
12455
- },
12456
- `${id}-${selectedIndex}`
12457
- ) }) }),
12646
+ id,
12647
+ label,
12648
+ help,
12649
+ description,
12650
+ validation: validationState,
12651
+ children: /* @__PURE__ */ jsx44("span", { children: /* @__PURE__ */ jsx44(
12652
+ RadioGroup,
12653
+ {
12654
+ name: id,
12655
+ radios: options.map((option, index) => ({
12656
+ label: option.title,
12657
+ value: index,
12658
+ secondary: option.description,
12659
+ disabled: option.disabled || disabled,
12660
+ avatar: /* @__PURE__ */ jsx44(OptionMedia, { icon: option.icon, image: option.image })
12661
+ })),
12662
+ selectedValue: selectedIndex != null ? selectedIndex : void 0,
12663
+ onChange: onSelect
12664
+ },
12665
+ `${id}-${selectedIndex}`
12666
+ ) })
12667
+ }
12668
+ ),
12458
12669
  children
12459
12670
  ] });
12460
12671
  }
@@ -12469,11 +12680,11 @@ function TabInputRendererComponent(props) {
12469
12680
  children,
12470
12681
  description,
12471
12682
  disabled,
12472
- error,
12473
12683
  help,
12474
12684
  label,
12475
12685
  options,
12476
12686
  selectedIndex,
12687
+ validationState,
12477
12688
  onSelect
12478
12689
  } = props;
12479
12690
  useEffect4(() => {
@@ -12482,21 +12693,31 @@ function TabInputRendererComponent(props) {
12482
12693
  }
12483
12694
  }, [selectedIndex, onSelect, options.length]);
12484
12695
  return /* @__PURE__ */ jsxs15(Fragment7, { children: [
12485
- /* @__PURE__ */ jsx45(FieldInput_default, { id, label, help, description, error, children: /* @__PURE__ */ jsx45(
12486
- Tabs,
12696
+ /* @__PURE__ */ jsx45(
12697
+ FieldInput_default,
12487
12698
  {
12488
- name: id,
12489
- selected: selectedIndex != null ? selectedIndex : 0,
12490
- tabs: options.map((option) => ({
12491
- title: option.title,
12492
- // if we pass null, we get some props-types console errors
12493
- // eslint-disable-next-line react/jsx-no-useless-fragment
12494
- content: /* @__PURE__ */ jsx45(Fragment7, {}),
12495
- disabled: option.disabled || disabled
12496
- })),
12497
- onTabSelect: onSelect
12699
+ id,
12700
+ label,
12701
+ help,
12702
+ description,
12703
+ validation: validationState,
12704
+ children: /* @__PURE__ */ jsx45(
12705
+ Tabs,
12706
+ {
12707
+ name: id,
12708
+ selected: selectedIndex != null ? selectedIndex : 0,
12709
+ tabs: options.map((option) => ({
12710
+ title: option.title,
12711
+ // if we pass null, we get some props-types console errors
12712
+ // eslint-disable-next-line react/jsx-no-useless-fragment
12713
+ content: /* @__PURE__ */ jsx45(Fragment7, {}),
12714
+ disabled: option.disabled || disabled
12715
+ })),
12716
+ onTabSelect: onSelect
12717
+ }
12718
+ )
12498
12719
  }
12499
- ) }),
12720
+ ),
12500
12721
  children
12501
12722
  ] });
12502
12723
  }
@@ -12529,13 +12750,13 @@ function SelectInputRendererComponent(props) {
12529
12750
  children,
12530
12751
  description,
12531
12752
  disabled,
12532
- error,
12533
12753
  help,
12534
12754
  label,
12535
12755
  options,
12536
12756
  placeholder,
12537
12757
  required,
12538
12758
  selectedIndex,
12759
+ validationState,
12539
12760
  onSelect
12540
12761
  } = props;
12541
12762
  const items = options.map(
@@ -12566,20 +12787,30 @@ function SelectInputRendererComponent(props) {
12566
12787
  return /* @__PURE__ */ jsx47(SelectInputOptionContent2, __spreadValues({}, contentProps));
12567
12788
  };
12568
12789
  return /* @__PURE__ */ jsxs16(Fragment8, { children: [
12569
- /* @__PURE__ */ jsx47(FieldInput_default, { id, label, help, description, error, children: /* @__PURE__ */ jsx47(
12570
- SelectInput2,
12790
+ /* @__PURE__ */ jsx47(
12791
+ FieldInput_default,
12571
12792
  {
12572
- name: id,
12573
- placeholder,
12574
- items,
12575
- disabled,
12576
- value: selectedIndex,
12577
- renderValue,
12578
- filterable: items.length >= 8,
12579
- onChange: onSelect,
12580
- onClear: required ? void 0 : () => onSelect(null)
12793
+ id,
12794
+ label,
12795
+ help,
12796
+ description,
12797
+ validation: validationState,
12798
+ children: /* @__PURE__ */ jsx47(
12799
+ SelectInput2,
12800
+ {
12801
+ name: id,
12802
+ placeholder,
12803
+ items,
12804
+ disabled,
12805
+ value: selectedIndex,
12806
+ renderValue,
12807
+ filterable: items.length >= 8,
12808
+ onChange: onSelect,
12809
+ onClear: required ? void 0 : () => onSelect(null)
12810
+ }
12811
+ )
12581
12812
  }
12582
- ) }),
12813
+ ),
12583
12814
  children
12584
12815
  ] });
12585
12816
  }
@@ -12589,28 +12820,48 @@ import { useEffect as useEffect5 } from "react";
12589
12820
  import { SegmentedControl } from "@transferwise/components";
12590
12821
  import { Fragment as Fragment9, jsx as jsx48, jsxs as jsxs17 } from "react/jsx-runtime";
12591
12822
  function SegmentedInputRendererComponent(props) {
12592
- const { id, children, description, error, help, label, options, selectedIndex, onSelect } = props;
12823
+ const {
12824
+ id,
12825
+ children,
12826
+ description,
12827
+ help,
12828
+ label,
12829
+ options,
12830
+ selectedIndex,
12831
+ validationState,
12832
+ onSelect
12833
+ } = props;
12593
12834
  useEffect5(() => {
12594
12835
  if (!isValidIndex2(selectedIndex, options.length)) {
12595
12836
  onSelect(0);
12596
12837
  }
12597
12838
  }, [selectedIndex, onSelect, options.length]);
12598
12839
  return /* @__PURE__ */ jsxs17(Fragment9, { children: [
12599
- /* @__PURE__ */ jsx48(FieldInput_default, { id, label, help, description, error, children: /* @__PURE__ */ jsx48(
12600
- SegmentedControl,
12840
+ /* @__PURE__ */ jsx48(
12841
+ FieldInput_default,
12601
12842
  {
12602
- name: `${id}-segmented-control`,
12603
- value: String(selectedIndex),
12604
- mode: "view",
12605
- segments: options.map((option, index) => ({
12606
- id: String(index),
12607
- value: String(index),
12608
- label: option.title,
12609
- controls: `${id}-children`
12610
- })),
12611
- onChange: (value) => onSelect(Number(value))
12843
+ id,
12844
+ label,
12845
+ help,
12846
+ description,
12847
+ validation: validationState,
12848
+ children: /* @__PURE__ */ jsx48(
12849
+ SegmentedControl,
12850
+ {
12851
+ name: `${id}-segmented-control`,
12852
+ value: String(selectedIndex),
12853
+ mode: "view",
12854
+ segments: options.map((option, index) => ({
12855
+ id: String(index),
12856
+ value: String(index),
12857
+ label: option.title,
12858
+ controls: `${id}-children`
12859
+ })),
12860
+ onChange: (value) => onSelect(Number(value))
12861
+ }
12862
+ )
12612
12863
  }
12613
- ) }),
12864
+ ),
12614
12865
  /* @__PURE__ */ jsx48("div", { id: `${id}-children`, children })
12615
12866
  ] });
12616
12867
  }
@@ -12643,15 +12894,22 @@ var StatusListRenderer = {
12643
12894
  canRenderType: "status-list",
12644
12895
  render: ({ margin, items, title }) => /* @__PURE__ */ jsxs18("div", { className: getMargin(margin), children: [
12645
12896
  title ? /* @__PURE__ */ jsx50(Header5, { title }) : null,
12646
- items.map(({ description, icon, status, title: itemTitle }) => /* @__PURE__ */ jsx50(
12897
+ items.map(({ callToAction, description, icon, status, title: itemTitle }) => /* @__PURE__ */ jsx50(
12647
12898
  Summary,
12648
12899
  {
12649
12900
  title: itemTitle,
12650
12901
  description,
12651
12902
  icon: icon && "name" in icon ? /* @__PURE__ */ jsx50(DynamicIcon_default, { name: icon.name }) : null,
12652
- status: mapStatus(status)
12903
+ status: mapStatus(status),
12904
+ action: callToAction ? {
12905
+ "aria-label": callToAction.accessibilityDescription,
12906
+ href: callToAction.href,
12907
+ text: callToAction.title,
12908
+ target: callToAction.href ? "_blank" : void 0,
12909
+ onClick: callToAction.href ? void 0 : callToAction.onClick
12910
+ } : void 0
12653
12911
  },
12654
- `${title}/${description || ""}`
12912
+ `${itemTitle}/${description || ""}`
12655
12913
  ))
12656
12914
  ] })
12657
12915
  };
@@ -12753,6 +13011,7 @@ var TextInputRenderer = {
12753
13011
  maxLength,
12754
13012
  minLength,
12755
13013
  type,
13014
+ validationState,
12756
13015
  value: initialValue
12757
13016
  } = _a, rest = __objRest(_a, [
12758
13017
  "id",
@@ -12764,11 +13023,22 @@ var TextInputRenderer = {
12764
13023
  "maxLength",
12765
13024
  "minLength",
12766
13025
  "type",
13026
+ "validationState",
12767
13027
  "value"
12768
13028
  ]);
12769
13029
  const value = initialValue != null ? initialValue : "";
12770
13030
  const inputProps = __spreadProps(__spreadValues({}, rest), { value, id });
12771
- return /* @__PURE__ */ jsx52(FieldInput_default, { id, label, description, error, help, children: /* @__PURE__ */ jsx52(VariableTextInput_default, { control, inputProps }) });
13031
+ return /* @__PURE__ */ jsx52(
13032
+ FieldInput_default,
13033
+ {
13034
+ id,
13035
+ label,
13036
+ description,
13037
+ validation: validationState,
13038
+ help,
13039
+ children: /* @__PURE__ */ jsx52(VariableTextInput_default, { control, inputProps })
13040
+ }
13041
+ );
12772
13042
  }
12773
13043
  };
12774
13044
  var TextInputRenderer_default = TextInputRenderer;
@@ -12779,7 +13049,7 @@ import { jsx as jsx53 } from "react/jsx-runtime";
12779
13049
  var UploadInputRenderer = {
12780
13050
  canRenderType: "input-upload",
12781
13051
  render: (props) => {
12782
- const { id, accepts, error, label, description, disabled, maxSize, onUpload } = props;
13052
+ const { id, accepts, label, description, disabled, maxSize, validationState, onUpload } = props;
12783
13053
  const onUploadFile = async (formData) => {
12784
13054
  const file = formData.get("file");
12785
13055
  return onUpload(file).then(() => ({
@@ -12791,19 +13061,28 @@ var UploadInputRenderer = {
12791
13061
  };
12792
13062
  return (
12793
13063
  // We don't pass help here as there is no sensible place to display it
12794
- /* @__PURE__ */ jsx53(UploadFieldInput_default, { id, label: void 0, description: void 0, error, children: /* @__PURE__ */ jsx53(
12795
- UploadInput2,
13064
+ /* @__PURE__ */ jsx53(
13065
+ UploadFieldInput_default,
12796
13066
  {
12797
13067
  id,
12798
- description,
12799
- disabled,
12800
- fileTypes: getAcceptsString(accepts),
12801
- sizeLimit: maxSize ? toKilobytes(maxSize) : void 0,
12802
- uploadButtonTitle: label,
12803
- onDeleteFile,
12804
- onUploadFile
13068
+ label: void 0,
13069
+ description: void 0,
13070
+ validation: validationState,
13071
+ children: /* @__PURE__ */ jsx53(
13072
+ UploadInput2,
13073
+ {
13074
+ id,
13075
+ description,
13076
+ disabled,
13077
+ fileTypes: getAcceptsString(accepts),
13078
+ sizeLimit: maxSize ? toKilobytes(maxSize) : void 0,
13079
+ uploadButtonTitle: label,
13080
+ onDeleteFile,
13081
+ onUploadFile
13082
+ }
13083
+ )
12805
13084
  }
12806
- ) })
13085
+ )
12807
13086
  );
12808
13087
  }
12809
13088
  };
@@ -12818,10 +13097,10 @@ var LargeUploadRenderer = {
12818
13097
  label,
12819
13098
  description,
12820
13099
  disabled,
12821
- error,
12822
13100
  help,
12823
13101
  maxSize,
12824
13102
  type,
13103
+ validationState,
12825
13104
  onUpload
12826
13105
  } = _a, rest = __objRest(_a, [
12827
13106
  "id",
@@ -12830,10 +13109,10 @@ var LargeUploadRenderer = {
12830
13109
  "label",
12831
13110
  "description",
12832
13111
  "disabled",
12833
- "error",
12834
13112
  "help",
12835
13113
  "maxSize",
12836
13114
  "type",
13115
+ "validationState",
12837
13116
  "onUpload"
12838
13117
  ]);
12839
13118
  const uploadProps = __spreadProps(__spreadValues({}, rest), { id, name: id });
@@ -12846,16 +13125,26 @@ var LargeUploadRenderer = {
12846
13125
  throw e;
12847
13126
  }
12848
13127
  };
12849
- return /* @__PURE__ */ jsx53(FieldInput_default, { id, label, description, error, help, children: /* @__PURE__ */ jsx53(
12850
- Upload,
12851
- __spreadProps(__spreadValues({}, uploadProps), {
12852
- usAccept: getAcceptsString(accepts),
12853
- usDisabled: disabled,
12854
- onSuccess: onUploadFile,
12855
- onFailure: async () => onUpload(null),
12856
- onCancel: async () => onUpload(null)
12857
- })
12858
- ) });
13128
+ return /* @__PURE__ */ jsx53(
13129
+ FieldInput_default,
13130
+ {
13131
+ id,
13132
+ label,
13133
+ description,
13134
+ validation: validationState,
13135
+ help,
13136
+ children: /* @__PURE__ */ jsx53(
13137
+ Upload,
13138
+ __spreadProps(__spreadValues({}, uploadProps), {
13139
+ usAccept: getAcceptsString(accepts),
13140
+ usDisabled: disabled,
13141
+ onSuccess: onUploadFile,
13142
+ onFailure: async () => onUpload(null),
13143
+ onCancel: async () => onUpload(null)
13144
+ })
13145
+ )
13146
+ }
13147
+ );
12859
13148
  }
12860
13149
  };
12861
13150
 
@@ -12924,11 +13213,11 @@ var getFieldValue = (value, help, orientation) => {
12924
13213
  import { useMemo as useMemo3 } from "react";
12925
13214
 
12926
13215
  // ../renderers/src/step/ExternalConfirmationDialog.tsx
12927
- import { useIntl as useIntl9 } from "react-intl";
13216
+ import { useIntl as useIntl10 } from "react-intl";
12928
13217
 
12929
13218
  // ../renderers/src/messages/external-confirmation.messages.ts
12930
- import { defineMessages as defineMessages10 } from "react-intl";
12931
- var external_confirmation_messages_default = defineMessages10({
13219
+ import { defineMessages as defineMessages11 } from "react-intl";
13220
+ var external_confirmation_messages_default = defineMessages11({
12932
13221
  title: {
12933
13222
  id: "df.wise.ExternalConfirmation.title",
12934
13223
  defaultMessage: "Please confirm",
@@ -12952,19 +13241,19 @@ var external_confirmation_messages_default = defineMessages10({
12952
13241
  });
12953
13242
 
12954
13243
  // ../renderers/src/step/ExternalConfirmationDialog.tsx
12955
- import { Button as Button5, Markdown as Markdown5 } from "@transferwise/components";
13244
+ import { Button as Button6, Markdown as Markdown5 } from "@transferwise/components";
12956
13245
  import { jsx as jsx55, jsxs as jsxs20 } from "react/jsx-runtime";
12957
13246
  function ExternalConfirmationDialog({
12958
13247
  external,
12959
13248
  onClose
12960
13249
  }) {
12961
- const { formatMessage } = useIntl9();
13250
+ const { formatMessage } = useIntl10();
12962
13251
  return /* @__PURE__ */ jsx55("div", { className: "df-box-renderer-fixed-width", children: /* @__PURE__ */ jsxs20("div", { className: "df-box-renderer-width-lg", children: [
12963
13252
  /* @__PURE__ */ jsx55("h2", { className: "text-xs-center m-b-5", children: formatMessage(external_confirmation_messages_default.title) }),
12964
13253
  /* @__PURE__ */ jsx55(Markdown5, { config: { link: { target: "_blank" } }, className: "text-xs-center m-b-5", children: formatMessage(external_confirmation_messages_default.description, { origin: getOrigin(external.url) }) }),
12965
13254
  /* @__PURE__ */ jsx55("div", { className: "df-box-renderer-fixed-width", children: /* @__PURE__ */ jsxs20("div", { className: "df-box-renderer-width-lg", children: [
12966
13255
  /* @__PURE__ */ jsx55(
12967
- Button5,
13256
+ Button6,
12968
13257
  {
12969
13258
  block: true,
12970
13259
  className: "m-b-2",
@@ -12977,7 +13266,7 @@ function ExternalConfirmationDialog({
12977
13266
  children: formatMessage(external_confirmation_messages_default.open)
12978
13267
  }
12979
13268
  ),
12980
- /* @__PURE__ */ jsx55(Button5, { block: true, className: "m-b-2", priority: "tertiary", size: "md", onClick: onClose, children: formatMessage(external_confirmation_messages_default.cancel) })
13269
+ /* @__PURE__ */ jsx55(Button6, { block: true, className: "m-b-2", priority: "tertiary", size: "md", onClick: onClose, children: formatMessage(external_confirmation_messages_default.cancel) })
12981
13270
  ] }) })
12982
13271
  ] }) });
12983
13272
  }
@@ -13011,15 +13300,13 @@ import { ArrowLeft } from "@transferwise/icons";
13011
13300
  import { jsx as jsx56, jsxs as jsxs21 } from "react/jsx-runtime";
13012
13301
  function BackButton({ title, onClick }) {
13013
13302
  return /* @__PURE__ */ jsx56("div", { className: "m-b-2", children: /* @__PURE__ */ jsxs21(
13014
- "a",
13303
+ "button",
13015
13304
  {
13016
- href: "/",
13305
+ type: "button",
13017
13306
  className: "df-back-btn",
13307
+ title,
13018
13308
  "aria-label": title,
13019
- onClick: (event) => {
13020
- event.preventDefault();
13021
- onClick();
13022
- },
13309
+ onClick,
13023
13310
  children: [
13024
13311
  /* @__PURE__ */ jsx56("span", { className: "sr-only", children: title }),
13025
13312
  /* @__PURE__ */ jsx56(Avatar4, { type: "icon", children: /* @__PURE__ */ jsx56(ArrowLeft, { size: "24" }) })
@@ -13523,7 +13810,7 @@ function isReference(block) {
13523
13810
 
13524
13811
  // src/legacy/dynamicFlow/DynamicFlow.tsx
13525
13812
  import { useCallback as useCallback11, useEffect as useEffect26, useMemo as useMemo23, useState as useState34 } from "react";
13526
- import { useIntl as useIntl30 } from "react-intl";
13813
+ import { useIntl as useIntl31 } from "react-intl";
13527
13814
 
13528
13815
  // src/legacy/common/contexts/dynamicFlowContexts/DynamicFlowContexts.tsx
13529
13816
  import { createContext as createContext4, useContext as useContext5, useMemo as useMemo8 } from "react";
@@ -14445,11 +14732,11 @@ function useExternalStepPolling(polling, onAction) {
14445
14732
 
14446
14733
  // src/legacy/common/hooks/usePersistAsync/usePersistAsync.ts
14447
14734
  import { useState as useState28 } from "react";
14448
- import { useIntl as useIntl24 } from "react-intl";
14735
+ import { useIntl as useIntl25 } from "react-intl";
14449
14736
 
14450
14737
  // src/legacy/jsonSchemaForm/persistAsyncSchema/persistAsyncBasicSchema/PersistAsyncBasicSchema.tsx
14451
14738
  import { useEffect as useEffect18, useState as useState27 } from "react";
14452
- import { useIntl as useIntl23 } from "react-intl";
14739
+ import { useIntl as useIntl24 } from "react-intl";
14453
14740
 
14454
14741
  // src/legacy/common/constants/DateMode.ts
14455
14742
  var DateMode = {
@@ -14704,7 +14991,7 @@ var getBoxWidthClasses = (component) => {
14704
14991
  var DynamicBox_default = DynamicBox;
14705
14992
 
14706
14993
  // src/legacy/layout/button/DynamicButton.tsx
14707
- import { Button as Button6 } from "@transferwise/components";
14994
+ import { Button as Button7 } from "@transferwise/components";
14708
14995
 
14709
14996
  // src/legacy/layout/button/utils.ts
14710
14997
  var priorities = {
@@ -14776,7 +15063,7 @@ function DynamicButtonWithoutBehavior(props) {
14776
15063
  }
14777
15064
  };
14778
15065
  return /* @__PURE__ */ jsx72(
14779
- Button6,
15066
+ Button7,
14780
15067
  {
14781
15068
  size: getButtonSize(component.size),
14782
15069
  type: priority === "tertiary" ? void 0 : type,
@@ -14808,7 +15095,7 @@ function DynamicButtonWithBehavior(props) {
14808
15095
  }
14809
15096
  };
14810
15097
  return /* @__PURE__ */ jsx72(
14811
- Button6,
15098
+ Button7,
14812
15099
  {
14813
15100
  size: getButtonSize(component.size),
14814
15101
  type: priority === "tertiary" ? void 0 : type,
@@ -14910,13 +15197,13 @@ var DynamicDivider = ({ component }) => {
14910
15197
  var DynamicDivider_default = DynamicDivider;
14911
15198
 
14912
15199
  // src/legacy/layout/external/DynamicExternal.tsx
14913
- import { Button as Button7, Loader as Loader2, Size as Size2 } from "@transferwise/components";
15200
+ import { Button as Button8, Loader as Loader2, Size as Size2 } from "@transferwise/components";
14914
15201
  import { useCallback as useCallback6, useEffect as useEffect8 } from "react";
14915
- import { useIntl as useIntl10 } from "react-intl";
15202
+ import { useIntl as useIntl11 } from "react-intl";
14916
15203
 
14917
15204
  // src/legacy/layout/external/DynamicExternal.messages.ts
14918
- import { defineMessages as defineMessages11 } from "react-intl";
14919
- var DynamicExternal_messages_default = defineMessages11({
15205
+ import { defineMessages as defineMessages12 } from "react-intl";
15206
+ var DynamicExternal_messages_default = defineMessages12({
14920
15207
  retryTitle: {
14921
15208
  id: "dynamicFlows.DynamicExternal.retryTitle",
14922
15209
  defaultMessage: "Reopen window",
@@ -14928,7 +15215,7 @@ var DynamicExternal_messages_default = defineMessages11({
14928
15215
  import { Fragment as Fragment11, jsx as jsx76, jsxs as jsxs25 } from "react/jsx-runtime";
14929
15216
  var DynamicExternal = ({ component, onAction }) => {
14930
15217
  const { requestUrl, responseHandlers, polling, retryTitle } = component;
14931
- const intl = useIntl10();
15218
+ const intl = useIntl11();
14932
15219
  const openExternalUrl = useCallback6(
14933
15220
  () => window.open(requestUrl, "df-external-window"),
14934
15221
  [requestUrl]
@@ -14943,7 +15230,7 @@ var DynamicExternal = ({ component, onAction }) => {
14943
15230
  return /* @__PURE__ */ jsxs25(Fragment11, { children: [
14944
15231
  /* @__PURE__ */ jsx76(Loader2, { size: Size2.LARGE, classNames: { "tw-loader": "tw-loader m-x-auto" } }),
14945
15232
  /* @__PURE__ */ jsx76("br", {}),
14946
- /* @__PURE__ */ jsx76(Button7, { priority: "tertiary", block: true, onClick: openExternalUrl, children: retryTitle || intl.formatMessage(DynamicExternal_messages_default.retryTitle) })
15233
+ /* @__PURE__ */ jsx76(Button8, { priority: "tertiary", block: true, onClick: openExternalUrl, children: retryTitle || intl.formatMessage(DynamicExternal_messages_default.retryTitle) })
14947
15234
  ] });
14948
15235
  };
14949
15236
  var DynamicExternal_default = DynamicExternal;
@@ -14964,7 +15251,7 @@ var getSchemaColumnClasses = (width) => ({
14964
15251
  "col-sm-4": width === "sm"
14965
15252
  });
14966
15253
  function AllOfSchema(props) {
14967
- const { disabled = false } = props;
15254
+ const { disabled = false, hideTitle = false } = props;
14968
15255
  const onChangeModelIndex = (index, onChangeProps) => {
14969
15256
  const modelSchema = props.schema.allOf[index];
14970
15257
  models[index] = getValidObjectModelParts(onChangeProps.model, modelSchema) || {};
@@ -14973,7 +15260,7 @@ function AllOfSchema(props) {
14973
15260
  };
14974
15261
  const [models, setModels] = useState12(splitModel(props.model, props.schema.allOf));
14975
15262
  return /* @__PURE__ */ jsxs26(Fragment12, { children: [
14976
- props.schema.title && /* @__PURE__ */ jsx77(Header8, { title: props.schema.title }),
15263
+ props.schema.title && !hideTitle && /* @__PURE__ */ jsx77(Header8, { title: props.schema.title }),
14977
15264
  props.schema.description && /* @__PURE__ */ jsx77("p", { children: props.schema.description }),
14978
15265
  /* @__PURE__ */ jsx77("div", { className: "row", children: props.schema.allOf.map((schema, index) => (
14979
15266
  // eslint-disable-next-line react/no-array-index-key
@@ -15008,7 +15295,7 @@ import { useMemo as useMemo12, useState as useState13 } from "react";
15008
15295
  // src/legacy/jsonSchemaForm/controlFeedback/ControlFeedback.tsx
15009
15296
  import { InlineAlert as InlineAlert3 } from "@transferwise/components";
15010
15297
  import { formatDate as formatDate3 } from "@transferwise/formatting";
15011
- import { useIntl as useIntl11 } from "react-intl";
15298
+ import { useIntl as useIntl12 } from "react-intl";
15012
15299
  import { jsx as jsx78, jsxs as jsxs27 } from "react/jsx-runtime";
15013
15300
  function ControlFeedback(props) {
15014
15301
  const { errors = "", validations = [], validationMessages = {} } = props;
@@ -15028,7 +15315,7 @@ function ControlFeedback(props) {
15028
15315
  ] });
15029
15316
  }
15030
15317
  function useDefaultValidationMessages(schema) {
15031
- const { formatMessage, locale } = useIntl11();
15318
+ const { formatMessage, locale } = useIntl12();
15032
15319
  const formattedMessages = {
15033
15320
  type: formatMessage(validation_messages_default.type),
15034
15321
  minimum: formatMessage(validation_messages_default.minimum, {
@@ -15115,11 +15402,11 @@ function constructUploadError(response) {
15115
15402
  }
15116
15403
 
15117
15404
  // src/legacy/jsonSchemaForm/arrayTypeSchema/arrayListSchema/multipleFileUploadSchema/utils/useFormattedDefaultErrorMessages.tsx
15118
- import { useIntl as useIntl12 } from "react-intl";
15405
+ import { useIntl as useIntl13 } from "react-intl";
15119
15406
 
15120
15407
  // src/legacy/common/messages.ts
15121
- import { defineMessages as defineMessages12 } from "react-intl";
15122
- var messages_default = defineMessages12({
15408
+ import { defineMessages as defineMessages13 } from "react-intl";
15409
+ var messages_default = defineMessages13({
15123
15410
  required: {
15124
15411
  id: "dynamicFlows.DefaultErrorMessages.required",
15125
15412
  defaultMessage: "Please fill out this field.",
@@ -15132,7 +15419,7 @@ function useFormattedDefaultErrorMessages({
15132
15419
  maxItems,
15133
15420
  minItems
15134
15421
  }) {
15135
- const { formatMessage } = useIntl12();
15422
+ const { formatMessage } = useIntl13();
15136
15423
  const { maxFileSizeError, maxItemsError, minItemsError } = multi_file_upload_messages_default;
15137
15424
  return {
15138
15425
  maxFileSizeErrorMessage: formatMessage(maxFileSizeError),
@@ -15243,7 +15530,7 @@ function getValidationMessages(schema, required, defaultErrorMessages) {
15243
15530
  var import_classnames8 = __toESM(require_classnames());
15244
15531
  import { SelectInput as SelectInput3, SelectInputOptionContent as SelectInputOptionContent3 } from "@transferwise/components";
15245
15532
  import { useEffect as useEffect9, useMemo as useMemo13, useState as useState14 } from "react";
15246
- import { useIntl as useIntl13 } from "react-intl";
15533
+ import { useIntl as useIntl14 } from "react-intl";
15247
15534
 
15248
15535
  // src/legacy/jsonSchemaForm/schemaFormControl/utils/mapping-utils.tsx
15249
15536
  import { Avatar as Avatar6, AvatarType as AvatarType5 } from "@transferwise/components";
@@ -15337,8 +15624,8 @@ var getDisabled = (disabled) => {
15337
15624
  };
15338
15625
 
15339
15626
  // src/common/messages/multi-select.messages.ts
15340
- import { defineMessages as defineMessages13 } from "react-intl";
15341
- var multi_select_messages_default2 = defineMessages13({
15627
+ import { defineMessages as defineMessages14 } from "react-intl";
15628
+ var multi_select_messages_default2 = defineMessages14({
15342
15629
  summary: {
15343
15630
  id: "dynamicFlows.MultiSelect.summary",
15344
15631
  defaultMessage: "{first} and {count} more",
@@ -15356,7 +15643,7 @@ function MultiSelectSchema({
15356
15643
  errors,
15357
15644
  onChange
15358
15645
  }) {
15359
- const { formatMessage, locale } = useIntl13();
15646
+ const { formatMessage, locale } = useIntl14();
15360
15647
  const { disabled, items, validationMessages, placeholder } = schema;
15361
15648
  const options = items.oneOf.map((item) => mapConstSchemaToOption(item, "select"));
15362
15649
  const id = useMemo13(() => schema.$id || generateRandomId(), [schema.$id]);
@@ -15460,7 +15747,7 @@ var getInitialModelIndices2 = (model, options) => {
15460
15747
  import { Header as Header9, Modal as Modal3, NavigationOption as NavigationOption6 } from "@transferwise/components";
15461
15748
  import { Plus as Plus2 } from "@transferwise/icons";
15462
15749
  import { useMemo as useMemo14, useState as useState16 } from "react";
15463
- import { useIntl as useIntl15 } from "react-intl";
15750
+ import { useIntl as useIntl16 } from "react-intl";
15464
15751
 
15465
15752
  // src/legacy/jsonSchemaForm/arrayTypeSchema/arrayListSchema/repeatableSchema/ItemSummary.tsx
15466
15753
  import { NavigationOption as NavigationOption5 } from "@transferwise/components";
@@ -15479,8 +15766,8 @@ function ItemSummaryOption2({ item, onClick }) {
15479
15766
  }
15480
15767
 
15481
15768
  // src/common/messages/repeatable.messages.ts
15482
- import { defineMessages as defineMessages14 } from "react-intl";
15483
- var repeatable_messages_default2 = defineMessages14({
15769
+ import { defineMessages as defineMessages15 } from "react-intl";
15770
+ var repeatable_messages_default2 = defineMessages15({
15484
15771
  addItemTitle: {
15485
15772
  id: "dynamicFlows.ArraySchema.addItemTitle",
15486
15773
  defaultMessage: "Add Item",
@@ -15505,7 +15792,7 @@ var repeatable_messages_default2 = defineMessages14({
15505
15792
 
15506
15793
  // src/legacy/jsonSchemaForm/arrayTypeSchema/arrayListSchema/repeatableSchema/RepeatableSchemaStep.tsx
15507
15794
  import { useState as useState15 } from "react";
15508
- import { useIntl as useIntl14 } from "react-intl";
15795
+ import { useIntl as useIntl15 } from "react-intl";
15509
15796
  import { jsx as jsx83 } from "react/jsx-runtime";
15510
15797
  function RepeatableSchemaStep({
15511
15798
  type,
@@ -15516,7 +15803,7 @@ function RepeatableSchemaStep({
15516
15803
  onModelChange,
15517
15804
  onAction
15518
15805
  }) {
15519
- const { formatMessage } = useIntl14();
15806
+ const { formatMessage } = useIntl15();
15520
15807
  const [filename, setFilename] = useState15(void 0);
15521
15808
  const step = {
15522
15809
  layout: [
@@ -15823,7 +16110,7 @@ function RepeatableSchema({
15823
16110
  setEditableItem({ item: null, model: null });
15824
16111
  setOpenModalType(null);
15825
16112
  };
15826
- const { formatMessage } = useIntl15();
16113
+ const { formatMessage } = useIntl16();
15827
16114
  const validations = getValidationFailures(model, schema, required);
15828
16115
  const base64ValidationMessages = useFormattedDefaultErrorMessages({
15829
16116
  minItems: schema.minItems,
@@ -16029,11 +16316,11 @@ import { useEffect as useEffect12, useMemo as useMemo15, useState as useState18
16029
16316
 
16030
16317
  // src/legacy/jsonSchemaForm/help/Help.tsx
16031
16318
  import { Markdown as Markdown6, Info as Info2 } from "@transferwise/components";
16032
- import { useIntl as useIntl16 } from "react-intl";
16319
+ import { useIntl as useIntl17 } from "react-intl";
16033
16320
 
16034
16321
  // src/common/messages/help.messages.ts
16035
- import { defineMessages as defineMessages15 } from "react-intl";
16036
- var help_messages_default2 = defineMessages15({
16322
+ import { defineMessages as defineMessages16 } from "react-intl";
16323
+ var help_messages_default2 = defineMessages16({
16037
16324
  helpAria: {
16038
16325
  id: "dynamicFlows.Help.ariaLabel",
16039
16326
  defaultMessage: "Click here for more info.",
@@ -16044,7 +16331,7 @@ var help_messages_default2 = defineMessages15({
16044
16331
  // src/legacy/jsonSchemaForm/help/Help.tsx
16045
16332
  import { jsx as jsx88 } from "react/jsx-runtime";
16046
16333
  function Help2(props) {
16047
- const intl = useIntl16();
16334
+ const intl = useIntl17();
16048
16335
  return /* @__PURE__ */ jsx88(
16049
16336
  Info2,
16050
16337
  {
@@ -16060,7 +16347,7 @@ var Help_default2 = Help2;
16060
16347
 
16061
16348
  // src/legacy/jsonSchemaForm/schemaFormControl/SchemaFormControl.tsx
16062
16349
  import { useEffect as useEffect11 } from "react";
16063
- import { useIntl as useIntl17 } from "react-intl";
16350
+ import { useIntl as useIntl18 } from "react-intl";
16064
16351
 
16065
16352
  // src/legacy/formControl/FormControl.tsx
16066
16353
  import {
@@ -16778,7 +17065,7 @@ function SchemaFormControl(props) {
16778
17065
  labelledBy
16779
17066
  } = props;
16780
17067
  const log = useLogger();
16781
- const intl = useIntl17();
17068
+ const intl = useIntl18();
16782
17069
  const getSanitisedValue = (value2) => isNativeInput(schema.type) && (isNull3(value2) || isUndefined3(value2)) ? "" : value2;
16783
17070
  const onModelChange = (value2, type, metadata) => {
16784
17071
  onChange(getValidBasicModelOrNull(value2, schema), type, metadata);
@@ -17015,7 +17302,7 @@ var OneOfSchema_default = OneOfSchema;
17015
17302
  // src/legacy/jsonSchemaForm/persistAsyncSchema/persistAsyncBlobSchema/PersistAsyncBlobSchema.tsx
17016
17303
  var import_classnames12 = __toESM(require_classnames());
17017
17304
  import { useEffect as useEffect13, useState as useState19 } from "react";
17018
- import { useIntl as useIntl18 } from "react-intl";
17305
+ import { useIntl as useIntl19 } from "react-intl";
17019
17306
 
17020
17307
  // src/legacy/jsonSchemaForm/persistAsyncSchema/persistAsyncBlobSchema/UploadInputAdapter.tsx
17021
17308
  import { Status as Status2, UploadInput as UploadInput4 } from "@transferwise/components";
@@ -17082,7 +17369,7 @@ function PersistAsyncBlobSchema(props) {
17082
17369
  const [persistAsyncValidations, setPersistAsyncValidations] = useState19(null);
17083
17370
  const [validations, setValidations] = useState19([]);
17084
17371
  const [changed, setChanged] = useState19(false);
17085
- const intl = useIntl18();
17372
+ const intl = useIntl19();
17086
17373
  const httpClient = useHttpClient();
17087
17374
  const onEvent = useEventDispatcher();
17088
17375
  useEffect13(() => {
@@ -17321,11 +17608,11 @@ var PromotedOneOfSchema_default = PromotedOneOfSchema;
17321
17608
 
17322
17609
  // src/legacy/jsonSchemaForm/readOnlySchema/ReadOnlySchema.tsx
17323
17610
  import { DefinitionList as DefinitionList2, Layout } from "@transferwise/components";
17324
- import { useIntl as useIntl19 } from "react-intl";
17611
+ import { useIntl as useIntl20 } from "react-intl";
17325
17612
 
17326
17613
  // src/legacy/jsonSchemaForm/readOnlySchema/ReadOnlySchema.messages.ts
17327
- import { defineMessages as defineMessages16 } from "react-intl";
17328
- var ReadOnlySchema_messages_default = defineMessages16({
17614
+ import { defineMessages as defineMessages17 } from "react-intl";
17615
+ var ReadOnlySchema_messages_default = defineMessages17({
17329
17616
  yes: {
17330
17617
  id: "dynamicFlows.ReadOnlySchema.yes",
17331
17618
  defaultMessage: "Yes",
@@ -17342,7 +17629,7 @@ var ReadOnlySchema_messages_default = defineMessages16({
17342
17629
  import { Fragment as Fragment18, jsx as jsx99, jsxs as jsxs36 } from "react/jsx-runtime";
17343
17630
  function ReadOnlySchema({ schema, model }) {
17344
17631
  const { title = "" } = schema;
17345
- const { formatMessage } = useIntl19();
17632
+ const { formatMessage } = useIntl20();
17346
17633
  const value = getValueForSchema({ schema, model, formatMessage });
17347
17634
  return /* @__PURE__ */ jsx99(DefinitionList2, { layout: Layout.VERTICAL_ONE_COLUMN, definitions: [{ title, value, key: "" }] });
17348
17635
  }
@@ -17795,19 +18082,47 @@ var DynamicLayout_default = DynamicLayout;
17795
18082
  // src/legacy/layout/list/DynamicStatusList.tsx
17796
18083
  import { Header as Header13, Summary as Summary2 } from "@transferwise/components";
17797
18084
  import { jsx as jsx108, jsxs as jsxs38 } from "react/jsx-runtime";
17798
- var DynamicStatusList = ({ component }) => {
18085
+ var DynamicStatusList = ({ component, onAction }) => {
17799
18086
  return /* @__PURE__ */ jsxs38("div", { className: getMargin2(component.margin || "md"), children: [
17800
18087
  component.title ? /* @__PURE__ */ jsx108(Header13, { title: component.title }) : null,
17801
- component.items.map(mapListItemToSummary)
18088
+ component.items.map((item) => mapListItemToSummary(item, onAction))
17802
18089
  ] });
17803
18090
  };
17804
- var mapListItemToSummary = ({ title, description, icon, status }) => {
17805
- const props = __spreadValues(__spreadValues({
18091
+ var mapListItemToSummary = (props, onAction) => {
18092
+ const { title, description, icon, status } = props;
18093
+ const summaryProps = __spreadValues(__spreadValues({
17806
18094
  key: `${title}/${description || ""}`,
17807
18095
  title,
17808
- description
18096
+ description,
18097
+ action: "callToAction" in props ? callToActionToSummaryAction(props == null ? void 0 : props.callToAction, onAction) : void 0
17809
18098
  }, (icon == null ? void 0 : icon.name) ? { icon: /* @__PURE__ */ jsx108(DynamicIcon_default2, { type: icon.name }) } : {}), status ? { status: statusMap[status] } : {});
17810
- return /* @__PURE__ */ jsx108(Summary2, __spreadValues({}, props));
18099
+ return /* @__PURE__ */ jsx108(Summary2, __spreadValues({}, summaryProps));
18100
+ };
18101
+ var callToActionToSummaryAction = (callToAction, onAction) => {
18102
+ if (!callToAction) {
18103
+ return void 0;
18104
+ }
18105
+ const { accessibilityDescription, behavior, title } = callToAction;
18106
+ if (behavior.link) {
18107
+ const { link } = behavior;
18108
+ return {
18109
+ text: title,
18110
+ "aria-label": accessibilityDescription,
18111
+ href: link.url,
18112
+ target: "_blank"
18113
+ };
18114
+ }
18115
+ if (behavior.action) {
18116
+ const { action } = behavior;
18117
+ return {
18118
+ text: title,
18119
+ "aria-label": accessibilityDescription,
18120
+ onClick: () => {
18121
+ onAction(action);
18122
+ }
18123
+ };
18124
+ }
18125
+ return void 0;
17811
18126
  };
17812
18127
  var statusListMap = {
17813
18128
  done: "done",
@@ -17841,12 +18156,12 @@ var DynamicLoadingIndicator = ({ component }) => {
17841
18156
  var DynamicLoadingIndicator_default = DynamicLoadingIndicator;
17842
18157
 
17843
18158
  // src/legacy/layout/paragraph/DynamicParagraph.tsx
17844
- import { Button as Button8 } from "@transferwise/components";
17845
- import { useIntl as useIntl20 } from "react-intl";
18159
+ import { Button as Button9 } from "@transferwise/components";
18160
+ import { useIntl as useIntl21 } from "react-intl";
17846
18161
 
17847
18162
  // src/common/messages/paragraph.messages.ts
17848
- import { defineMessages as defineMessages17 } from "react-intl";
17849
- var paragraph_messages_default2 = defineMessages17({
18163
+ import { defineMessages as defineMessages18 } from "react-intl";
18164
+ var paragraph_messages_default2 = defineMessages18({
17850
18165
  copy: {
17851
18166
  id: "dynamicFlows.DynamicParagraph.copy",
17852
18167
  defaultMessage: "Copy",
@@ -17878,7 +18193,7 @@ function BasicDynamicParagraph({ component }) {
17878
18193
  return /* @__PURE__ */ jsx110("p", { className: `np-text-body-large ${getTextAlignmentAndMargin2(component)}`, children: component.text });
17879
18194
  }
17880
18195
  function CopyableDynamicParagraph({ component }) {
17881
- const { formatMessage } = useIntl20();
18196
+ const { formatMessage } = useIntl21();
17882
18197
  const createSnackbar = useSnackBarIfAvailable2();
17883
18198
  const { text } = component;
17884
18199
  const copy = () => {
@@ -17900,7 +18215,7 @@ function CopyableDynamicParagraph({ component }) {
17900
18215
  style: { textOverflow: "ellipsis" }
17901
18216
  }
17902
18217
  ),
17903
- /* @__PURE__ */ jsx110(Button8, { block: true, onClick: copy, children: formatMessage(paragraph_messages_default2.copy) })
18218
+ /* @__PURE__ */ jsx110(Button9, { block: true, onClick: copy, children: formatMessage(paragraph_messages_default2.copy) })
17904
18219
  ] });
17905
18220
  }
17906
18221
  function noop4() {
@@ -17993,7 +18308,7 @@ var SearchInput = ({ title, value, onFocus, onChange }) => {
17993
18308
 
17994
18309
  // src/legacy/layout/search/SearchResults.tsx
17995
18310
  import { NavigationOption as NavigationOption7, NavigationOptionsList as NavigationOptionsList4 } from "@transferwise/components";
17996
- import { useIntl as useIntl21 } from "react-intl";
18311
+ import { useIntl as useIntl22 } from "react-intl";
17997
18312
  import { jsx as jsx113, jsxs as jsxs42 } from "react/jsx-runtime";
17998
18313
  function SearchResults2({ results, emptyMessage, onSelect }) {
17999
18314
  if (results.length === 0) {
@@ -18013,7 +18328,7 @@ function SearchResults2({ results, emptyMessage, onSelect }) {
18013
18328
  )) });
18014
18329
  }
18015
18330
  function ErrorResult2({ onRetrySearch }) {
18016
- const intl = useIntl21();
18331
+ const intl = useIntl22();
18017
18332
  return /* @__PURE__ */ jsxs42("p", { className: "m-t-2", children: [
18018
18333
  intl.formatMessage(generic_error_messages_default.genericError),
18019
18334
  "\xA0",
@@ -18103,12 +18418,24 @@ var addQueryParameter2 = (url, key, value) => {
18103
18418
  // src/legacy/layout/search/DynamicSearch.tsx
18104
18419
  var import_classnames14 = __toESM(require_classnames());
18105
18420
  import { Markdown as Markdown8, Typeahead as Typeahead2 } from "@transferwise/components";
18106
- import { useIntl as useIntl22 } from "react-intl";
18421
+ import { useIntl as useIntl23 } from "react-intl";
18422
+
18423
+ // src/common/messages/search.messages.ts
18424
+ import { defineMessages as defineMessages19 } from "react-intl";
18425
+ var search_messages_default2 = defineMessages19({
18426
+ loading: {
18427
+ id: "dynamicFlows.SearchLayout.loading",
18428
+ defaultMessage: "Loading...",
18429
+ description: "A message shown to the user while their search is being processed, before results appear."
18430
+ }
18431
+ });
18432
+
18433
+ // src/legacy/layout/search/DynamicSearch.tsx
18107
18434
  import { jsx as jsx114, jsxs as jsxs43 } from "react/jsx-runtime";
18108
18435
  var DEBOUNCE_TIME2 = 400;
18109
18436
  function DynamicSearch({ component, onAction }) {
18110
18437
  const [query, setQuery] = useState24("");
18111
- const intl = useIntl22();
18438
+ const intl = useIntl23();
18112
18439
  const { control, title, margin, url, method, param, emptyMessage } = component;
18113
18440
  const { status, results, search } = useSearch({ url, method, param });
18114
18441
  const onEvent = useEventDispatcher();
@@ -18140,6 +18467,7 @@ function DynamicSearch({ component, onAction }) {
18140
18467
  setQuery(query);
18141
18468
  void search(query);
18142
18469
  };
18470
+ const loadingMessage = intl.formatMessage(search_messages_default2.loading);
18143
18471
  if (control === "inline") {
18144
18472
  return /* @__PURE__ */ jsx114("div", { className: (0, import_classnames14.default)(getMargin2(margin != null ? margin : "md"), "df-search-typeahead"), children: /* @__PURE__ */ jsxs43("label", { className: "control-label d-inline", children: [
18145
18473
  title,
@@ -18157,6 +18485,7 @@ function DynamicSearch({ component, onAction }) {
18157
18485
  state: status,
18158
18486
  results,
18159
18487
  emptyMessage,
18488
+ loadingMessage,
18160
18489
  onRetrySearch
18161
18490
  }
18162
18491
  ),
@@ -18194,10 +18523,11 @@ function mapResultToTypeaheadOption2(result) {
18194
18523
  };
18195
18524
  }
18196
18525
  function TypeaheadFooter2({
18526
+ emptyMessage,
18527
+ loadingMessage,
18197
18528
  results,
18198
18529
  state,
18199
- onRetrySearch,
18200
- emptyMessage
18530
+ onRetrySearch
18201
18531
  }) {
18202
18532
  if (state === "success" && results.length === 0) {
18203
18533
  return /* @__PURE__ */ jsx114(Markdown8, { className: "m-t-2 m-x-2", config: { link: { target: "_blank" } }, children: emptyMessage });
@@ -18206,14 +18536,14 @@ function TypeaheadFooter2({
18206
18536
  return /* @__PURE__ */ jsx114("div", { className: "m-t-2 m-x-2", children: /* @__PURE__ */ jsx114(ErrorResult2, { onRetrySearch }) });
18207
18537
  }
18208
18538
  if (state === "loading" || results.length === 0) {
18209
- return /* @__PURE__ */ jsx114("p", { className: "m-t-2 m-x-2", children: "Loading..." });
18539
+ return /* @__PURE__ */ jsx114("p", { className: "m-t-2 m-x-2", children: loadingMessage });
18210
18540
  }
18211
18541
  return null;
18212
18542
  }
18213
18543
  var DynamicSearch_default = DynamicSearch;
18214
18544
 
18215
18545
  // src/legacy/layout/modal/DynamicModal.tsx
18216
- import { Button as Button9, Modal as Modal4 } from "@transferwise/components";
18546
+ import { Button as Button10, Modal as Modal4 } from "@transferwise/components";
18217
18547
  import { useState as useState25 } from "react";
18218
18548
  import { jsx as jsx115, jsxs as jsxs44 } from "react/jsx-runtime";
18219
18549
  function DynamicModal(props) {
@@ -18221,7 +18551,7 @@ function DynamicModal(props) {
18221
18551
  const { component, onAction } = props;
18222
18552
  const { margin = "md" } = component;
18223
18553
  return /* @__PURE__ */ jsxs44("div", { className: getTextAlignmentAndMargin2({ margin }), children: [
18224
- /* @__PURE__ */ jsx115(Button9, { priority: "tertiary", block: true, onClick: () => isVisible(true), children: component.trigger.title }),
18554
+ /* @__PURE__ */ jsx115(Button10, { priority: "tertiary", block: true, onClick: () => isVisible(true), children: component.trigger.title }),
18225
18555
  /* @__PURE__ */ jsx115(
18226
18556
  Modal4,
18227
18557
  {
@@ -18382,7 +18712,7 @@ var controlTypesWithPersistOnChange = /* @__PURE__ */ new Set([
18382
18712
  ]);
18383
18713
  function PersistAsyncBasicSchema(props) {
18384
18714
  const { schema, required = false, submitted, errors, onChange, onPersistAsync } = props;
18385
- const intl = useIntl23();
18715
+ const intl = useIntl24();
18386
18716
  const httpClient = useHttpClient();
18387
18717
  const onEvent = useEventDispatcher();
18388
18718
  const [persistAsyncModel, setPersistAsyncModel] = useState27(null);
@@ -18477,7 +18807,7 @@ var PersistAsyncBasicSchema_default = PersistAsyncBasicSchema;
18477
18807
  var usePersistAsync = (persistAsync) => {
18478
18808
  const [abortController, setAbortController] = useState28(null);
18479
18809
  const httpClient = useHttpClient();
18480
- const intl = useIntl24();
18810
+ const intl = useIntl25();
18481
18811
  const { schema } = persistAsync;
18482
18812
  async function handlePersistAsync(model) {
18483
18813
  const isInvalidSchema = model instanceof Blob ? !isBlobSchema2(schema) : !isValidSchema(model, schema);
@@ -18710,12 +19040,12 @@ import { useEffect as useEffect25, useState as useState31 } from "react";
18710
19040
 
18711
19041
  // src/common/cameraCapture/CameraCapture.tsx
18712
19042
  import { useCallback as useCallback10, useEffect as useEffect24, useMemo as useMemo21, useRef as useRef8, useState as useState30 } from "react";
18713
- import { useIntl as useIntl27 } from "react-intl";
19043
+ import { useIntl as useIntl28 } from "react-intl";
18714
19044
  import Webcam from "react-webcam";
18715
19045
 
18716
19046
  // src/common/cameraCapture/CameraCapture.messages.ts
18717
- import { defineMessages as defineMessages18 } from "react-intl";
18718
- var CameraCapture_messages_default = defineMessages18({
19047
+ import { defineMessages as defineMessages20 } from "react-intl";
19048
+ var CameraCapture_messages_default = defineMessages20({
18719
19049
  reviewSubmit: {
18720
19050
  id: "dynamicFlows.CameraCapture.reviewSubmit",
18721
19051
  defaultMessage: "Yes, submit",
@@ -18774,18 +19104,18 @@ var CameraCapture_messages_default = defineMessages18({
18774
19104
  });
18775
19105
 
18776
19106
  // src/common/cameraCapture/components/bottomBar/BottomBar.tsx
18777
- import { Button as Button10, ControlType, Priority, Size as Size3 } from "@transferwise/components";
18778
- import { useIntl as useIntl25 } from "react-intl";
19107
+ import { Button as Button11, ControlType, Priority, Size as Size3 } from "@transferwise/components";
19108
+ import { useIntl as useIntl26 } from "react-intl";
18779
19109
  import { jsx as jsx119, jsxs as jsxs46 } from "react/jsx-runtime";
18780
19110
  var CaptureBottomBar = ({ onCapture }) => /* @__PURE__ */ jsx119("div", { className: "bottom-bar", children: /* @__PURE__ */ jsx119(CaptureButton, { onClick: onCapture }) });
18781
19111
  var ReviewBottomBar = ({
18782
19112
  onSubmit,
18783
19113
  onRetry
18784
19114
  }) => {
18785
- const intl = useIntl25();
19115
+ const intl = useIntl26();
18786
19116
  return /* @__PURE__ */ jsx119("div", { className: "bottom-bar p-x-2", children: /* @__PURE__ */ jsx119("div", { className: "row", children: /* @__PURE__ */ jsxs46("div", { className: "col-xs-12 col-md-6 col-md-offset-3", children: [
18787
19117
  /* @__PURE__ */ jsx119(
18788
- Button10,
19118
+ Button11,
18789
19119
  {
18790
19120
  className: "m-b-1",
18791
19121
  block: true,
@@ -18796,7 +19126,7 @@ var ReviewBottomBar = ({
18796
19126
  }
18797
19127
  ),
18798
19128
  /* @__PURE__ */ jsx119(
18799
- Button10,
19129
+ Button11,
18800
19130
  {
18801
19131
  className: "m-b-2",
18802
19132
  block: true,
@@ -18821,11 +19151,11 @@ var CaptureButton = ({ onClick }) => /* @__PURE__ */ jsx119(
18821
19151
  );
18822
19152
 
18823
19153
  // src/common/cameraCapture/components/orientationLockOverlay/OrientationLockOverlay.tsx
18824
- import { useIntl as useIntl26 } from "react-intl";
19154
+ import { useIntl as useIntl27 } from "react-intl";
18825
19155
 
18826
19156
  // src/common/cameraCapture/components/orientationLockOverlay/OrientationLockOverlay.messages.ts
18827
- import { defineMessages as defineMessages19 } from "react-intl";
18828
- var OrientationLockOverlay_messages_default = defineMessages19({
19157
+ import { defineMessages as defineMessages21 } from "react-intl";
19158
+ var OrientationLockOverlay_messages_default = defineMessages21({
18829
19159
  text: {
18830
19160
  id: "dynamicFlows.CameraCapture.rotatePhone.text",
18831
19161
  defaultMessage: "Rotate your phone to portrait view to take a photo",
@@ -18836,7 +19166,7 @@ var OrientationLockOverlay_messages_default = defineMessages19({
18836
19166
  // src/common/cameraCapture/components/orientationLockOverlay/OrientationLockOverlay.tsx
18837
19167
  import { jsx as jsx120, jsxs as jsxs47 } from "react/jsx-runtime";
18838
19168
  function OrientationLockOverlay() {
18839
- const intl = useIntl26();
19169
+ const intl = useIntl27();
18840
19170
  return /* @__PURE__ */ jsxs47("div", { className: "orientation-lock-overlay", children: [
18841
19171
  /* @__PURE__ */ jsx120(
18842
19172
  "img",
@@ -19087,13 +19417,13 @@ function Overlay({ overlay, outline, imageUrl, title, instructions, reviewInstru
19087
19417
  var Overlay_default = Overlay;
19088
19418
 
19089
19419
  // src/common/cameraCapture/screens/cameraErrorScreen/CameraErrorScreen.tsx
19090
- import { Button as Button11 } from "@transferwise/components";
19420
+ import { Button as Button12 } from "@transferwise/components";
19091
19421
  import { jsx as jsx122, jsxs as jsxs49 } from "react/jsx-runtime";
19092
19422
  function CameraErrorScreen({ title, description, actionButton, onAction }) {
19093
19423
  return /* @__PURE__ */ jsx122("div", { className: "container p-t-5", children: /* @__PURE__ */ jsx122("div", { className: "row", children: /* @__PURE__ */ jsxs49("div", { className: "col-md-6 col-md-offset-3", children: [
19094
19424
  /* @__PURE__ */ jsx122("h2", { className: "text-xs-center m-b-3", children: title }),
19095
19425
  /* @__PURE__ */ jsx122("p", { className: "text-xs-center m-b-5", children: description }),
19096
- onAction && actionButton && /* @__PURE__ */ jsx122(Button11, { block: true, onClick: onAction, children: actionButton })
19426
+ onAction && actionButton && /* @__PURE__ */ jsx122(Button12, { block: true, onClick: onAction, children: actionButton })
19097
19427
  ] }) }) });
19098
19428
  }
19099
19429
  var CameraErrorScreen_default = CameraErrorScreen;
@@ -19126,7 +19456,7 @@ function CameraCapture({
19126
19456
  shouldLockOrientation,
19127
19457
  onEvent
19128
19458
  );
19129
- const intl = useIntl27();
19459
+ const intl = useIntl28();
19130
19460
  const handleCapture = useCallback10(async () => {
19131
19461
  var _a, _b, _c, _d, _e, _f;
19132
19462
  if (((_a = webcamReference == null ? void 0 : webcamReference.current) == null ? void 0 : _a.video) && ((_c = (_b = webcamReference == null ? void 0 : webcamReference.current) == null ? void 0 : _b.video) == null ? void 0 : _c.readyState) >= 3) {
@@ -19349,11 +19679,11 @@ function getFirstAction(step) {
19349
19679
  }
19350
19680
 
19351
19681
  // src/legacy/step/externalConfirmationStep/ExternalConfirmationStep.tsx
19352
- import { useIntl as useIntl28 } from "react-intl";
19682
+ import { useIntl as useIntl29 } from "react-intl";
19353
19683
 
19354
19684
  // src/common/messages/external-confirmation.messages.ts
19355
- import { defineMessages as defineMessages20 } from "react-intl";
19356
- var external_confirmation_messages_default2 = defineMessages20({
19685
+ import { defineMessages as defineMessages22 } from "react-intl";
19686
+ var external_confirmation_messages_default2 = defineMessages22({
19357
19687
  title: {
19358
19688
  id: "dynamicFlows.ExternalConfirmation.title",
19359
19689
  defaultMessage: "Please confirm",
@@ -19381,7 +19711,7 @@ import { jsx as jsx125 } from "react/jsx-runtime";
19381
19711
  var noop6 = () => {
19382
19712
  };
19383
19713
  function ExternalConfirmationStep({ url, onClose }) {
19384
- const { formatMessage } = useIntl28();
19714
+ const { formatMessage } = useIntl29();
19385
19715
  return /* @__PURE__ */ jsx125(
19386
19716
  DynamicLayout_default,
19387
19717
  {
@@ -19754,9 +20084,9 @@ var assertResponseIsValid2 = (response) => {
19754
20084
  var isResponse2 = (response) => typeof response === "object" && response !== null && "clone" in response && "bodyUsed" in response;
19755
20085
 
19756
20086
  // src/legacy/dynamicFlow/utils/useErrorResponse.tsx
19757
- import { useIntl as useIntl29 } from "react-intl";
20087
+ import { useIntl as useIntl30 } from "react-intl";
19758
20088
  var useErrorResponse = () => {
19759
- const { formatMessage } = useIntl29();
20089
+ const { formatMessage } = useIntl30();
19760
20090
  return async (response, fetchType, isInitialRequest) => {
19761
20091
  try {
19762
20092
  const errorResponse = await parseErrorResponse(response);
@@ -19800,7 +20130,7 @@ var DynamicFlowComponent = ({
19800
20130
  setSchemaModel
19801
20131
  } = useDynamicFlowState(initialStep);
19802
20132
  const [submitted, setSubmitted] = useState34(false);
19803
- const { locale } = useIntl30();
20133
+ const { locale } = useIntl31();
19804
20134
  const { isLoading, loader, setLoadingState } = useLoader(
19805
20135
  loaderConfig,
19806
20136
  initialStep ? "idle" : "initial"