@wise/dynamic-flow-client 3.9.0 → 3.9.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.
package/build/main.js CHANGED
@@ -1154,7 +1154,6 @@ var i18n_default = translations;
1154
1154
 
1155
1155
  // src/revamp/DynamicFlowWise.tsx
1156
1156
  var import_react19 = require("react");
1157
- var import_react_intl16 = require("react-intl");
1158
1157
 
1159
1158
  // src/common/httpClientContext/HttpClientContext.tsx
1160
1159
  var import_react = require("react");
@@ -1177,13 +1176,89 @@ var useHasHttpClientProvider = () => {
1177
1176
  };
1178
1177
 
1179
1178
  // src/revamp/DynamicFlowCore.tsx
1180
- var import_react8 = require("react");
1179
+ var import_react5 = require("react");
1181
1180
 
1182
- // src/revamp/renderers/CoreContainerRenderer.tsx
1181
+ // src/common/errorBoundary/ErrorBoundary.tsx
1182
+ var import_react2 = require("react");
1183
+
1184
+ // src/common/errorBoundary/ErrorBoundaryAlert.tsx
1185
+ var import_components = require("@transferwise/components");
1186
+ var import_react_intl2 = require("react-intl");
1187
+
1188
+ // src/common/messages/generic-error.messages.ts
1189
+ var import_react_intl = require("react-intl");
1190
+ var generic_error_messages_default = (0, import_react_intl.defineMessages)({
1191
+ genericErrorRetryHint: {
1192
+ id: "dynamicFlows.PersistAsyncSchema.genericError",
1193
+ defaultMessage: "Something went wrong, please try again.",
1194
+ description: "Generic error message for persist async schema"
1195
+ },
1196
+ genericError: {
1197
+ id: "dynamicFlows.ErrorBoundary.errorAlert",
1198
+ defaultMessage: "Something went wrong.",
1199
+ description: "Generic error message for when something has gone wrong."
1200
+ },
1201
+ retry: {
1202
+ id: "dynamicFlows.ErrorBoundary.retry",
1203
+ defaultMessage: "Retry",
1204
+ description: "Usually this follows the generic error and contains a link."
1205
+ }
1206
+ });
1207
+
1208
+ // src/common/errorBoundary/ErrorBoundaryAlert.tsx
1183
1209
  var import_jsx_runtime2 = require("react/jsx-runtime");
1210
+ function ErrorBoundaryAlert({ onDismiss }) {
1211
+ const { formatMessage } = (0, import_react_intl2.useIntl)();
1212
+ return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
1213
+ import_components.Alert,
1214
+ {
1215
+ action: {
1216
+ text: formatMessage(generic_error_messages_default.retry),
1217
+ href: window.location.href
1218
+ },
1219
+ message: formatMessage(generic_error_messages_default.genericError),
1220
+ type: import_components.Sentiment.NEGATIVE,
1221
+ className: "m-b-3",
1222
+ onDismiss
1223
+ }
1224
+ );
1225
+ }
1226
+
1227
+ // src/common/errorBoundary/ErrorBoundary.tsx
1228
+ var import_jsx_runtime3 = require("react/jsx-runtime");
1229
+ var noop = () => {
1230
+ };
1231
+ var ErrorBoundary = class extends import_react2.Component {
1232
+ constructor(props) {
1233
+ super(props);
1234
+ this.handleErrorReset = () => {
1235
+ this.setState({ hasError: false, isFatalError: false });
1236
+ };
1237
+ this.state = { hasError: false, isFatalError: false };
1238
+ }
1239
+ static getDerivedStateFromError() {
1240
+ return { hasError: true, isFatalError: true };
1241
+ }
1242
+ componentDidCatch(error) {
1243
+ const { onError = noop } = this.props;
1244
+ onError(error);
1245
+ }
1246
+ render() {
1247
+ const { children } = this.props;
1248
+ const { hasError, isFatalError } = this.state;
1249
+ return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(import_jsx_runtime3.Fragment, { children: [
1250
+ hasError && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(ErrorBoundaryAlert, { onDismiss: this.handleErrorReset }),
1251
+ !isFatalError && children
1252
+ ] });
1253
+ }
1254
+ };
1255
+ var ErrorBoundary_default = ErrorBoundary;
1256
+
1257
+ // src/revamp/renderers/CoreContainerRenderer.tsx
1258
+ var import_jsx_runtime4 = require("react/jsx-runtime");
1184
1259
  var CoreContainerRenderer = {
1185
1260
  canRenderType: "container",
1186
- render: ({ children }) => /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_jsx_runtime2.Fragment, { children })
1261
+ render: ({ children }) => /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_jsx_runtime4.Fragment, { children })
1187
1262
  };
1188
1263
 
1189
1264
  // src/revamp/utils/type-validators.ts
@@ -1723,7 +1798,7 @@ var componentToRendererProps = (component, nestedContent) => {
1723
1798
  };
1724
1799
 
1725
1800
  // src/revamp/renderers/getRenderFunction.tsx
1726
- var import_jsx_runtime3 = require("react/jsx-runtime");
1801
+ var import_jsx_runtime5 = require("react/jsx-runtime");
1727
1802
  var getRenderFunction = (renderers) => {
1728
1803
  function ComponentRenderer(props) {
1729
1804
  const { type } = props;
@@ -1762,7 +1837,7 @@ var getRenderFunction = (renderers) => {
1762
1837
  children: component.getChildren().map(render)
1763
1838
  };
1764
1839
  };
1765
- const render = (component) => /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
1840
+ const render = (component) => /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
1766
1841
  ComponentRenderer,
1767
1842
  __spreadValues({}, componentToRendererProps(component, getNestedContent(component))),
1768
1843
  component.uid
@@ -1770,148 +1845,6 @@ var getRenderFunction = (renderers) => {
1770
1845
  return render;
1771
1846
  };
1772
1847
 
1773
- // src/revamp/renderers/step/StepRenderer.tsx
1774
- var import_react4 = require("react");
1775
-
1776
- // src/revamp/renderers/step/ExternalConfirmationDialog.tsx
1777
- var import_react_intl2 = require("react-intl");
1778
-
1779
- // src/common/messages/external-confirmation.messages.ts
1780
- var import_react_intl = require("react-intl");
1781
- var external_confirmation_messages_default = (0, import_react_intl.defineMessages)({
1782
- title: {
1783
- id: "dynamicFlows.ExternalConfirmation.title",
1784
- defaultMessage: "Please confirm",
1785
- description: "Heading for the confirmation screen."
1786
- },
1787
- description: {
1788
- id: "dynamicFlows.ExternalConfirmation.description",
1789
- defaultMessage: "Please confirm you want to open **{origin}** in a new browser tab.",
1790
- description: "Description for the confirmation screen."
1791
- },
1792
- open: {
1793
- id: "dynamicFlows.ExternalConfirmation.open",
1794
- defaultMessage: "Open in new tab",
1795
- description: "Button text confirming opening a new browser tab."
1796
- },
1797
- cancel: {
1798
- id: "dynamicFlows.ExternalConfirmation.cancel",
1799
- defaultMessage: "Cancel",
1800
- description: "Button text rejecting opening a new browser tab."
1801
- }
1802
- });
1803
-
1804
- // src/revamp/renderers/step/ExternalConfirmationDialog.tsx
1805
- var import_components = require("@transferwise/components");
1806
- var import_jsx_runtime4 = require("react/jsx-runtime");
1807
- function ExternalConfirmationDialog({
1808
- external,
1809
- onClose
1810
- }) {
1811
- const { formatMessage } = (0, import_react_intl2.useIntl)();
1812
- return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { className: "df-box-renderer-fixed-width", children: /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "df-box-renderer-width-lg", children: [
1813
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("h2", { className: "text-xs-center m-b-5", children: formatMessage(external_confirmation_messages_default.title) }),
1814
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_components.Markdown, { config: { link: { target: "_blank" } }, className: "text-xs-center m-b-5", children: formatMessage(external_confirmation_messages_default.description, { origin: getOrigin(external.url) }) }),
1815
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { className: "df-box-renderer-fixed-width", children: /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "df-box-renderer-width-lg", children: [
1816
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
1817
- import_components.Button,
1818
- {
1819
- block: true,
1820
- className: "m-b-2",
1821
- priority: "primary",
1822
- size: "md",
1823
- onClick: () => {
1824
- window.open(external.url);
1825
- onClose();
1826
- },
1827
- children: formatMessage(external_confirmation_messages_default.open)
1828
- }
1829
- ),
1830
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_components.Button, { block: true, className: "m-b-2", priority: "tertiary", size: "md", onClick: onClose, children: formatMessage(external_confirmation_messages_default.cancel) })
1831
- ] }) })
1832
- ] }) });
1833
- }
1834
- function getOrigin(url) {
1835
- try {
1836
- return new URL(url).origin;
1837
- } catch (e) {
1838
- return url;
1839
- }
1840
- }
1841
-
1842
- // src/revamp/renderers/step/StepRendererContext.tsx
1843
- var import_react2 = require("react");
1844
- var StepRendererContext = (0, import_react2.createContext)({ loadingState: "idle", trackEvent: () => {
1845
- } });
1846
- var StepRendererContextProvider = StepRendererContext.Provider;
1847
- var useLoadingContext = () => {
1848
- const { loadingState } = (0, import_react2.useContext)(StepRendererContext);
1849
- return { loadingState, isLoading: loadingState !== "idle" };
1850
- };
1851
- var useTrackEvent = () => {
1852
- const { trackEvent } = (0, import_react2.useContext)(StepRendererContext);
1853
- return trackEvent;
1854
- };
1855
-
1856
- // src/revamp/renderers/step/useExternal.tsx
1857
- var import_react3 = require("react");
1858
- function useExternal(url) {
1859
- const [externalWindow, setExternalWindow] = (0, import_react3.useState)(null);
1860
- const [hasDismissed, setHasDismissed] = (0, import_react3.useState)(false);
1861
- const dismissConfirmation = () => setHasDismissed(true);
1862
- (0, import_react3.useEffect)(() => {
1863
- if (url) {
1864
- setHasDismissed(false);
1865
- setExternalWindow(window.open(url, "_blank"));
1866
- }
1867
- }, [url]);
1868
- const requiresUserConfirmation = Boolean(url && !externalWindow && !hasDismissed);
1869
- return { requiresUserConfirmation, dismissConfirmation };
1870
- }
1871
-
1872
- // src/revamp/renderers/step/BackButton.tsx
1873
- var import_components2 = require("@transferwise/components");
1874
- var import_icons = require("@transferwise/icons");
1875
- var import_jsx_runtime5 = require("react/jsx-runtime");
1876
- function BackButton({ title, onClick }) {
1877
- return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
1878
- "a",
1879
- {
1880
- href: "/",
1881
- className: "df-back-btn",
1882
- "aria-label": title,
1883
- onClick: (event) => {
1884
- event.preventDefault();
1885
- onClick();
1886
- },
1887
- children: [
1888
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { className: "sr-only", children: title }),
1889
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_components2.Avatar, { type: "icon", children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_icons.ArrowLeft, { size: "24" }) })
1890
- ]
1891
- }
1892
- );
1893
- }
1894
- var BackButton_default = BackButton;
1895
-
1896
- // src/revamp/renderers/step/StepRenderer.tsx
1897
- var import_jsx_runtime6 = require("react/jsx-runtime");
1898
- var StepRenderer = {
1899
- canRenderType: "step",
1900
- render: StepRendererComponent
1901
- };
1902
- function StepRendererComponent(props) {
1903
- const { back, loadingState, external, trackEvent, children } = props;
1904
- const value = (0, import_react4.useMemo)(() => ({ loadingState, trackEvent }), [loadingState, trackEvent]);
1905
- const { requiresUserConfirmation, dismissConfirmation } = useExternal(external == null ? void 0 : external.url);
1906
- if ((external == null ? void 0 : external.url) && requiresUserConfirmation) {
1907
- return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(ExternalConfirmationDialog, { external, onClose: dismissConfirmation });
1908
- }
1909
- return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(StepRendererContextProvider, { value, children: [
1910
- back ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(BackButton_default, __spreadValues({}, back)) : null,
1911
- children
1912
- ] });
1913
- }
1914
-
1915
1848
  // ../types/build/main.mjs
1916
1849
  var __defProp2 = Object.defineProperty;
1917
1850
  var __defProps2 = Object.defineProperties;
@@ -6393,8 +6326,8 @@ var flattenZodErrors = (zodError) => zodError.flatMap((e) => {
6393
6326
  }).filter(Boolean);
6394
6327
 
6395
6328
  // src/revamp/useDynamicFlowCore.tsx
6396
- var import_react6 = require("react");
6397
- var import_react_intl7 = require("react-intl");
6329
+ var import_react4 = require("react");
6330
+ var import_react_intl6 = require("react-intl");
6398
6331
 
6399
6332
  // src/revamp/utils/component-utils.ts
6400
6333
  var getSubmittableData = async (components) => Promise.all(components.map(async (component) => component.getSubmittableValue())).then(
@@ -9752,7 +9685,7 @@ var executeSubmission = async (props) => {
9752
9685
  const responseType = await getResponseType(response);
9753
9686
  const body = await parseResponseBodyAsJsonElement(response);
9754
9687
  if (exit) {
9755
- return { type: "complete", result: mergeModels(result, body) };
9688
+ return { type: "complete", result: mergeModels(body, result) };
9756
9689
  }
9757
9690
  switch (responseType) {
9758
9691
  case "step": {
@@ -9763,7 +9696,7 @@ var executeSubmission = async (props) => {
9763
9696
  }
9764
9697
  case "exit": {
9765
9698
  trackSubmissionEvent("Action Succeeded", { actionId });
9766
- return { type: "complete", result: mergeModels(result, body) };
9699
+ return { type: "complete", result: mergeModels(body, result) };
9767
9700
  }
9768
9701
  case "action": {
9769
9702
  assertActionResponseBody(body);
@@ -9852,29 +9785,9 @@ var validation_messages_default = (0, import_react_intl3.defineMessages)({
9852
9785
  }
9853
9786
  });
9854
9787
 
9855
- // src/common/messages/generic-error.messages.ts
9856
- var import_react_intl4 = require("react-intl");
9857
- var generic_error_messages_default = (0, import_react_intl4.defineMessages)({
9858
- genericErrorRetryHint: {
9859
- id: "dynamicFlows.PersistAsyncSchema.genericError",
9860
- defaultMessage: "Something went wrong, please try again.",
9861
- description: "Generic error message for persist async schema"
9862
- },
9863
- genericError: {
9864
- id: "dynamicFlows.ErrorBoundary.errorAlert",
9865
- defaultMessage: "Something went wrong.",
9866
- description: "Generic error message for when something has gone wrong."
9867
- },
9868
- retry: {
9869
- id: "dynamicFlows.ErrorBoundary.retry",
9870
- defaultMessage: "Retry",
9871
- description: "Usually this follows the generic error and contains a link."
9872
- }
9873
- });
9874
-
9875
9788
  // src/common/messages/multi-file-upload.messages.ts
9876
- var import_react_intl5 = require("react-intl");
9877
- var multi_file_upload_messages_default = (0, import_react_intl5.defineMessages)({
9789
+ var import_react_intl4 = require("react-intl");
9790
+ var multi_file_upload_messages_default = (0, import_react_intl4.defineMessages)({
9878
9791
  minItemsError: {
9879
9792
  id: "dynamicFlows.MultipleFileUploadSchema.minItemsError",
9880
9793
  defaultMessage: "Please upload at least {minItems} file(s).",
@@ -9893,8 +9806,8 @@ var multi_file_upload_messages_default = (0, import_react_intl5.defineMessages)(
9893
9806
  });
9894
9807
 
9895
9808
  // src/common/messages/validation.array.messages.ts
9896
- var import_react_intl6 = require("react-intl");
9897
- var validation_array_messages_default = (0, import_react_intl6.defineMessages)({
9809
+ var import_react_intl5 = require("react-intl");
9810
+ var validation_array_messages_default = (0, import_react_intl5.defineMessages)({
9898
9811
  minItemsError: {
9899
9812
  id: "dynamicFlows.ArraySchema.minItemsError",
9900
9813
  defaultMessage: "Please add at least {minItems}.",
@@ -10012,13 +9925,13 @@ var flattenComponents = (components) => components.reduce((acc, component) => {
10012
9925
  }, []);
10013
9926
 
10014
9927
  // src/revamp/utils/useStableCallback.tsx
10015
- var import_react5 = require("react");
9928
+ var import_react3 = require("react");
10016
9929
  function useStableCallback(handler) {
10017
- const ref = (0, import_react5.useRef)(handler);
10018
- (0, import_react5.useLayoutEffect)(() => {
9930
+ const ref = (0, import_react3.useRef)(handler);
9931
+ (0, import_react3.useLayoutEffect)(() => {
10019
9932
  ref.current = handler;
10020
9933
  });
10021
- return (0, import_react5.useCallback)((...args) => ref.current ? ref.current(...args) : null, []);
9934
+ return (0, import_react3.useCallback)((...args) => ref.current ? ref.current(...args) : null, []);
10022
9935
  }
10023
9936
 
10024
9937
  // src/revamp/useDynamicFlowCore.tsx
@@ -10030,22 +9943,22 @@ function useDynamicFlowCore(props) {
10030
9943
  const onError = useStableCallback(rest.onError);
10031
9944
  const onEvent = useStableCallback(rest.onEvent);
10032
9945
  const onLog = useStableCallback(rest.onLog);
10033
- const { formatMessage, locale } = (0, import_react_intl7.useIntl)();
10034
- const getErrorMessageFunctions = (0, import_react6.useMemo)(
9946
+ const { formatMessage, locale } = (0, import_react_intl6.useIntl)();
9947
+ const getErrorMessageFunctions = (0, import_react4.useMemo)(
10035
9948
  () => getSchemaErrorMessageFunction(formatMessage, locale),
10036
9949
  [formatMessage, locale]
10037
9950
  );
10038
- const [stepComponent, setStepComponent] = (0, import_react6.useState)(null);
10039
- const stepComponentRef = (0, import_react6.useRef)(null);
10040
- const stepRef = (0, import_react6.useRef)(initialStep != null ? initialStep : null);
10041
- const etagRef = (0, import_react6.useRef)(null);
10042
- const abortControllerRef = (0, import_react6.useRef)(new AbortController());
9951
+ const [stepComponent, setStepComponent] = (0, import_react4.useState)(null);
9952
+ const stepComponentRef = (0, import_react4.useRef)(null);
9953
+ const stepRef = (0, import_react4.useRef)(initialStep != null ? initialStep : null);
9954
+ const etagRef = (0, import_react4.useRef)(null);
9955
+ const abortControllerRef = (0, import_react4.useRef)(new AbortController());
10043
9956
  const abortCurrentAndGetNewAbortSignal = () => {
10044
9957
  abortControllerRef.current.abort();
10045
9958
  abortControllerRef.current = new AbortController();
10046
9959
  return abortControllerRef.current.signal;
10047
9960
  };
10048
- (0, import_react6.useEffect)(() => {
9961
+ (0, import_react4.useEffect)(() => {
10049
9962
  trackCoreEvent("Initiated");
10050
9963
  if (!initialStep && initialAction) {
10051
9964
  void onAction(__spreadValues({ method: "GET" }, initialAction));
@@ -10055,7 +9968,7 @@ function useDynamicFlowCore(props) {
10055
9968
  trackCoreEvent("Step Shown", { isFirstStep: true });
10056
9969
  }
10057
9970
  }, []);
10058
- const initialiseWithStep = (0, import_react6.useCallback)(
9971
+ const initialiseWithStep = (0, import_react4.useCallback)(
10059
9972
  (newStep, etag) => {
10060
9973
  var _a2, _b, _c;
10061
9974
  (_a2 = stepComponentRef.current) == null ? void 0 : _a2.stop();
@@ -10102,7 +10015,7 @@ function useDynamicFlowCore(props) {
10102
10015
  // eslint-disable-next-line react-hooks/exhaustive-deps
10103
10016
  []
10104
10017
  );
10105
- const trackEvent = (0, import_react6.useCallback)(
10018
+ const trackEvent = (0, import_react4.useCallback)(
10106
10019
  (eventName, properties) => {
10107
10020
  var _a2, _b, _c, _d;
10108
10021
  const stepId = (_c = (_a2 = stepRef.current) == null ? void 0 : _a2.id) != null ? _c : (_b = stepRef.current) == null ? void 0 : _b.key;
@@ -10119,7 +10032,7 @@ function useDynamicFlowCore(props) {
10119
10032
  []
10120
10033
  );
10121
10034
  const trackCoreEvent = trackEvent;
10122
- const logEvent = (0, import_react6.useCallback)(
10035
+ const logEvent = (0, import_react4.useCallback)(
10123
10036
  (level, message, properties) => {
10124
10037
  var _a2, _b, _c;
10125
10038
  try {
@@ -10133,7 +10046,7 @@ function useDynamicFlowCore(props) {
10133
10046
  // eslint-disable-next-line react-hooks/exhaustive-deps
10134
10047
  []
10135
10048
  );
10136
- const closeWithError = (0, import_react6.useCallback)(
10049
+ const closeWithError = (0, import_react4.useCallback)(
10137
10050
  (error, analytics) => {
10138
10051
  trackCoreEvent("Failed", __spreadValues({}, analytics));
10139
10052
  onError(error);
@@ -10141,7 +10054,7 @@ function useDynamicFlowCore(props) {
10141
10054
  // eslint-disable-next-line react-hooks/exhaustive-deps
10142
10055
  []
10143
10056
  );
10144
- const onAction = (0, import_react6.useCallback)(async (action) => {
10057
+ const onAction = (0, import_react4.useCallback)(async (action) => {
10145
10058
  var _a2, _b, _c;
10146
10059
  try {
10147
10060
  (_a2 = stepComponentRef.current) == null ? void 0 : _a2.setLoadingState("loading");
@@ -10185,7 +10098,7 @@ function useDynamicFlowCore(props) {
10185
10098
  closeWithError(error);
10186
10099
  }
10187
10100
  }, []);
10188
- const onRefresh = (0, import_react6.useCallback)(
10101
+ const onRefresh = (0, import_react4.useCallback)(
10189
10102
  async (schemaId, refreshUrl = "", errorsOverride) => {
10190
10103
  var _a2, _b, _c, _d;
10191
10104
  try {
@@ -10225,83 +10138,29 @@ function useDynamicFlowCore(props) {
10225
10138
  return { stepComponentRef };
10226
10139
  }
10227
10140
 
10228
- // src/common/errorBoundary/ErrorBoundary.tsx
10229
- var import_react7 = require("react");
10230
-
10231
- // src/common/errorBoundary/ErrorBoundaryAlert.tsx
10232
- var import_components3 = require("@transferwise/components");
10233
- var import_react_intl8 = require("react-intl");
10234
- var import_jsx_runtime7 = require("react/jsx-runtime");
10235
- function ErrorBoundaryAlert({ onDismiss }) {
10236
- const { formatMessage } = (0, import_react_intl8.useIntl)();
10237
- return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
10238
- import_components3.Alert,
10141
+ // src/revamp/DynamicFlowCore.tsx
10142
+ var import_jsx_runtime6 = require("react/jsx-runtime");
10143
+ function DynamicFlowCore(props) {
10144
+ const { stepComponentRef } = useDynamicFlowCore(props);
10145
+ const { renderers, onEvent, onError } = props;
10146
+ const render = (0, import_react5.useMemo)(
10147
+ () => getRenderFunction([CoreContainerRenderer, ...renderers]),
10148
+ [renderers]
10149
+ );
10150
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
10151
+ ErrorBoundary_default,
10239
10152
  {
10240
- action: {
10241
- text: formatMessage(generic_error_messages_default.retry),
10242
- href: window.location.href
10153
+ onError: (error) => {
10154
+ onEvent == null ? void 0 : onEvent("Dynamic Flow - Failed", { error });
10155
+ onError == null ? void 0 : onError(error);
10243
10156
  },
10244
- message: formatMessage(generic_error_messages_default.genericError),
10245
- type: import_components3.Sentiment.NEGATIVE,
10246
- className: "m-b-3",
10247
- onDismiss
10248
- }
10249
- );
10250
- }
10251
-
10252
- // src/common/errorBoundary/ErrorBoundary.tsx
10253
- var import_jsx_runtime8 = require("react/jsx-runtime");
10254
- var noop = () => {
10255
- };
10256
- var ErrorBoundary = class extends import_react7.Component {
10257
- constructor(props) {
10258
- super(props);
10259
- this.handleErrorReset = () => {
10260
- this.setState({ hasError: false, isFatalError: false });
10261
- };
10262
- this.state = { hasError: false, isFatalError: false };
10263
- }
10264
- static getDerivedStateFromError() {
10265
- return { hasError: true, isFatalError: true };
10266
- }
10267
- componentDidCatch(error) {
10268
- const { onError = noop } = this.props;
10269
- onError(error);
10270
- }
10271
- render() {
10272
- const { children } = this.props;
10273
- const { hasError, isFatalError } = this.state;
10274
- return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(import_jsx_runtime8.Fragment, { children: [
10275
- hasError && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(ErrorBoundaryAlert, { onDismiss: this.handleErrorReset }),
10276
- !isFatalError && children
10277
- ] });
10278
- }
10279
- };
10280
- var ErrorBoundary_default = ErrorBoundary;
10281
-
10282
- // src/revamp/DynamicFlowCore.tsx
10283
- var import_jsx_runtime9 = require("react/jsx-runtime");
10284
- function DynamicFlowCore(props) {
10285
- const { stepComponentRef } = useDynamicFlowCore(props);
10286
- const { renderers, onEvent, onError } = props;
10287
- const render = (0, import_react8.useMemo)(
10288
- () => getRenderFunction([CoreContainerRenderer, ...renderers, StepRenderer]),
10289
- [renderers]
10290
- );
10291
- return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
10292
- ErrorBoundary_default,
10293
- {
10294
- onError: (error) => {
10295
- onEvent == null ? void 0 : onEvent("Dynamic Flow - Failed", { error });
10296
- onError == null ? void 0 : onError(error);
10297
- },
10298
- children: stepComponentRef.current ? render(stepComponentRef.current) : null
10157
+ children: stepComponentRef.current ? render(stepComponentRef.current) : null
10299
10158
  }
10300
10159
  );
10301
10160
  }
10302
10161
 
10303
10162
  // src/revamp/wise/renderers/AlertRenderer.tsx
10304
- var import_components4 = require("@transferwise/components");
10163
+ var import_components2 = require("@transferwise/components");
10305
10164
 
10306
10165
  // src/revamp/wise/renderers/utils/layout-utils.ts
10307
10166
  var getMargin = (size) => {
@@ -10334,10 +10193,10 @@ var getTextAlignment = (align) => {
10334
10193
  var getTextAlignmentAndMargin = (component) => `${getTextAlignment(component.align)} ${getMargin(component.margin)}`;
10335
10194
 
10336
10195
  // src/revamp/wise/renderers/AlertRenderer.tsx
10337
- var import_jsx_runtime10 = require("react/jsx-runtime");
10196
+ var import_jsx_runtime7 = require("react/jsx-runtime");
10338
10197
  var AlertRenderer = {
10339
10198
  canRenderType: "alert",
10340
- render: ({ context, markdown, margin }) => /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_components4.Alert, { type: context, className: getMargin(margin), message: markdown })
10199
+ render: ({ context, markdown, margin }) => /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_components2.Alert, { type: context, className: getMargin(margin), message: markdown })
10341
10200
  };
10342
10201
  var AlertRenderer_default = AlertRenderer;
10343
10202
 
@@ -10345,8 +10204,8 @@ var AlertRenderer_default = AlertRenderer;
10345
10204
  var $2AODx$react = __toESM(require("react"), 1);
10346
10205
 
10347
10206
  // ../../node_modules/.pnpm/@radix-ui+react-use-layout-effect@1.0.1_@types+react@18.0.29_react@18.2.0/node_modules/@radix-ui/react-use-layout-effect/dist/index.mjs
10348
- var import_react9 = require("react");
10349
- var $9f79659886946c16$export$e5c5a5f917a5871c = Boolean(globalThis === null || globalThis === void 0 ? void 0 : globalThis.document) ? import_react9.useLayoutEffect : () => {
10207
+ var import_react6 = require("react");
10208
+ var $9f79659886946c16$export$e5c5a5f917a5871c = Boolean(globalThis === null || globalThis === void 0 ? void 0 : globalThis.document) ? import_react6.useLayoutEffect : () => {
10350
10209
  };
10351
10210
 
10352
10211
  // ../../node_modules/.pnpm/@radix-ui+react-id@1.0.1_@types+react@18.0.29_react@18.2.0/node_modules/@radix-ui/react-id/dist/index.mjs
@@ -10366,15 +10225,15 @@ function $1746a345f3d73bb7$export$f680877a34711e37(deterministicId) {
10366
10225
  }
10367
10226
 
10368
10227
  // ../../node_modules/.pnpm/@wise+forms@0.3.4_@transferwise+components@46.27.0_@types+react@18.0.29_react@18.2.0/node_modules/@wise/forms/dist/index.mjs
10369
- var import_components5 = require("@transferwise/components");
10228
+ var import_components3 = require("@transferwise/components");
10370
10229
  var import_classnames = __toESM(require_classnames(), 1);
10371
- var import_react10 = require("react");
10372
- var import_jsx_runtime11 = require("react/jsx-runtime");
10373
- var InputIdContext = /* @__PURE__ */ (0, import_react10.createContext)(void 0);
10230
+ var import_react7 = require("react");
10231
+ var import_jsx_runtime8 = require("react/jsx-runtime");
10232
+ var InputIdContext = /* @__PURE__ */ (0, import_react7.createContext)(void 0);
10374
10233
  var InputIdContextProvider = InputIdContext.Provider;
10375
- var FormControlDescribedByContext = /* @__PURE__ */ (0, import_react10.createContext)(void 0);
10234
+ var FormControlDescribedByContext = /* @__PURE__ */ (0, import_react7.createContext)(void 0);
10376
10235
  var FormControlDescribedByProvider = FormControlDescribedByContext.Provider;
10377
- var FormControlInvalidContext = /* @__PURE__ */ (0, import_react10.createContext)(void 0);
10236
+ var FormControlInvalidContext = /* @__PURE__ */ (0, import_react7.createContext)(void 0);
10378
10237
  var FormControlInvalidProvider = FormControlInvalidContext.Provider;
10379
10238
  var Label = ({
10380
10239
  id,
@@ -10382,7 +10241,7 @@ var Label = ({
10382
10241
  className,
10383
10242
  children
10384
10243
  }) => {
10385
- return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("label", {
10244
+ return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("label", {
10386
10245
  id,
10387
10246
  htmlFor,
10388
10247
  className: (0, import_classnames.default)("control-label d-flex flex-column gap-y-1 m-b-0", className),
@@ -10402,26 +10261,26 @@ var Field = ({
10402
10261
  const fallbackInputId = $1746a345f3d73bb7$export$f680877a34711e37();
10403
10262
  const inputId = id !== null ? id != null ? id : fallbackInputId : void 0;
10404
10263
  const descriptionId = $1746a345f3d73bb7$export$f680877a34711e37();
10405
- return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(InputIdContextProvider, {
10264
+ return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(InputIdContextProvider, {
10406
10265
  value: inputId,
10407
- children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(FormControlDescribedByProvider, {
10266
+ children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(FormControlDescribedByProvider, {
10408
10267
  value: hasError || hasHint ? descriptionId : void 0,
10409
- children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(FormControlInvalidProvider, {
10268
+ children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(FormControlInvalidProvider, {
10410
10269
  value: hasError,
10411
- children: /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", {
10270
+ children: /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", {
10412
10271
  className: (0, import_classnames.default)("form-group d-block", {
10413
10272
  "has-error": hasError,
10414
10273
  "has-info": hasHint
10415
10274
  }, className),
10416
- children: [/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(Label, {
10275
+ children: [/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(Label, {
10417
10276
  htmlFor: inputId,
10418
10277
  children: [label, children]
10419
- }), hasHint && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_components5.InlineAlert, {
10420
- type: import_components5.Sentiment.NEUTRAL,
10278
+ }), hasHint && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_components3.InlineAlert, {
10279
+ type: import_components3.Sentiment.NEUTRAL,
10421
10280
  id: descriptionId,
10422
10281
  children: hint
10423
- }), hasError && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_components5.InlineAlert, {
10424
- type: import_components5.Sentiment.NEGATIVE,
10282
+ }), hasError && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_components3.InlineAlert, {
10283
+ type: import_components3.Sentiment.NEGATIVE,
10425
10284
  id: descriptionId,
10426
10285
  children: error
10427
10286
  })]
@@ -10432,12 +10291,12 @@ var Field = ({
10432
10291
  };
10433
10292
 
10434
10293
  // src/revamp/wise/renderers/components/Help.tsx
10435
- var import_components6 = require("@transferwise/components");
10436
- var import_react_intl10 = require("react-intl");
10294
+ var import_components4 = require("@transferwise/components");
10295
+ var import_react_intl8 = require("react-intl");
10437
10296
 
10438
10297
  // src/common/messages/help.messages.ts
10439
- var import_react_intl9 = require("react-intl");
10440
- var help_messages_default = (0, import_react_intl9.defineMessages)({
10298
+ var import_react_intl7 = require("react-intl");
10299
+ var help_messages_default = (0, import_react_intl7.defineMessages)({
10441
10300
  helpAria: {
10442
10301
  id: "dynamicFlows.Help.ariaLabel",
10443
10302
  defaultMessage: "Click here for more info.",
@@ -10446,14 +10305,14 @@ var help_messages_default = (0, import_react_intl9.defineMessages)({
10446
10305
  });
10447
10306
 
10448
10307
  // src/revamp/wise/renderers/components/Help.tsx
10449
- var import_jsx_runtime12 = require("react/jsx-runtime");
10308
+ var import_jsx_runtime9 = require("react/jsx-runtime");
10450
10309
  function Help({ help }) {
10451
- const intl = (0, import_react_intl10.useIntl)();
10452
- return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
10453
- import_components6.Info,
10310
+ const intl = (0, import_react_intl8.useIntl)();
10311
+ return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
10312
+ import_components4.Info,
10454
10313
  {
10455
10314
  className: "m-l-1",
10456
- content: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_components6.Markdown, { config: { link: { target: "_blank" } }, children: help }),
10315
+ content: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_components4.Markdown, { config: { link: { target: "_blank" } }, children: help }),
10457
10316
  presentation: "POPOVER",
10458
10317
  size: "sm",
10459
10318
  "aria-label": intl.formatMessage(help_messages_default.helpAria)
@@ -10463,43 +10322,43 @@ function Help({ help }) {
10463
10322
  var Help_default = Help;
10464
10323
 
10465
10324
  // src/revamp/wise/renderers/components/LabelContentWithHelp.tsx
10466
- var import_jsx_runtime13 = require("react/jsx-runtime");
10325
+ var import_jsx_runtime10 = require("react/jsx-runtime");
10467
10326
  function LabelContentWithHelp({ text, help }) {
10468
- return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { children: [
10327
+ return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { children: [
10469
10328
  text,
10470
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(Help_default, { help })
10329
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(Help_default, { help })
10471
10330
  ] });
10472
10331
  }
10473
10332
 
10474
10333
  // src/revamp/wise/renderers/components/FieldInput.tsx
10475
- var import_jsx_runtime14 = require("react/jsx-runtime");
10334
+ var import_jsx_runtime11 = require("react/jsx-runtime");
10476
10335
  function FieldInput({ id, children, label, error, description, help }) {
10477
- const labelContent = label && help ? /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(LabelContentWithHelp, { text: label, help }) : label;
10478
- return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Field, { id, label: labelContent, hint: description, error, children });
10336
+ const labelContent = label && help ? /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(LabelContentWithHelp, { text: label, help }) : label;
10337
+ return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(Field, { id, label: labelContent, hint: description, error, children });
10479
10338
  }
10480
10339
  var FieldInput_default = FieldInput;
10481
10340
 
10482
10341
  // src/revamp/wise/renderers/BooleanInputRenderer.tsx
10483
- var import_components7 = require("@transferwise/components");
10484
- var import_jsx_runtime15 = require("react/jsx-runtime");
10342
+ var import_components5 = require("@transferwise/components");
10343
+ var import_jsx_runtime12 = require("react/jsx-runtime");
10485
10344
  var BooleanInputRenderer = {
10486
10345
  canRenderType: "input-boolean",
10487
10346
  render: (props) => {
10488
10347
  const _a = props, { id, control, label = "", description, help, error, type, value } = _a, rest = __objRest(_a, ["id", "control", "label", "description", "help", "error", "type", "value"]);
10489
10348
  const checkboxProps = __spreadProps(__spreadValues({}, rest), { label, secondary: description, checked: value });
10490
- return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(FieldInput_default, { id, label: "", description: "", error, help, children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_components7.Checkbox, __spreadValues({ id }, checkboxProps)) });
10349
+ return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(FieldInput_default, { id, label: "", description: "", error, help, children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_components5.Checkbox, __spreadValues({ id }, checkboxProps)) });
10491
10350
  }
10492
10351
  };
10493
10352
  var BooleanInputRenderer_default = BooleanInputRenderer;
10494
10353
 
10495
10354
  // src/revamp/wise/renderers/BoxRenderer.tsx
10496
10355
  var import_classnames2 = __toESM(require_classnames());
10497
- var import_jsx_runtime16 = require("react/jsx-runtime");
10356
+ var import_jsx_runtime13 = require("react/jsx-runtime");
10498
10357
  var BoxRenderer = {
10499
10358
  canRenderType: "box",
10500
10359
  render: ({ border, children, margin, width }) => {
10501
10360
  const hasFixedWidth = width !== "xl";
10502
- const contents = /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
10361
+ const contents = /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
10503
10362
  "div",
10504
10363
  {
10505
10364
  className: (0, import_classnames2.default)({
@@ -10510,14 +10369,30 @@ var BoxRenderer = {
10510
10369
  children
10511
10370
  }
10512
10371
  );
10513
- return hasFixedWidth ? /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { className: (0, import_classnames2.default)("df-box-renderer-fixed-width", getMargin(margin)), children: contents }) : contents;
10372
+ return hasFixedWidth ? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { className: (0, import_classnames2.default)("df-box-renderer-fixed-width", getMargin(margin)), children: contents }) : contents;
10514
10373
  }
10515
10374
  };
10516
10375
  var BoxRenderer_default = BoxRenderer;
10517
10376
 
10518
10377
  // src/revamp/wise/renderers/ButtonRenderer.tsx
10519
- var import_components8 = require("@transferwise/components");
10520
- var import_jsx_runtime17 = require("react/jsx-runtime");
10378
+ var import_components6 = require("@transferwise/components");
10379
+
10380
+ // src/revamp/wise/renderers/step/StepRendererContext.tsx
10381
+ var import_react8 = require("react");
10382
+ var StepRendererContext = (0, import_react8.createContext)({ loadingState: "idle", trackEvent: () => {
10383
+ } });
10384
+ var StepRendererContextProvider = StepRendererContext.Provider;
10385
+ var useLoadingContext = () => {
10386
+ const { loadingState } = (0, import_react8.useContext)(StepRendererContext);
10387
+ return { loadingState, isLoading: loadingState !== "idle" };
10388
+ };
10389
+ var useTrackEvent = () => {
10390
+ const { trackEvent } = (0, import_react8.useContext)(StepRendererContext);
10391
+ return trackEvent;
10392
+ };
10393
+
10394
+ // src/revamp/wise/renderers/ButtonRenderer.tsx
10395
+ var import_jsx_runtime14 = require("react/jsx-runtime");
10521
10396
  var ButtonRenderer = {
10522
10397
  canRenderType: "button",
10523
10398
  render: ButtonRendererComponent
@@ -10535,8 +10410,8 @@ function ButtonRendererComponent({
10535
10410
  const priority = mapControl(control);
10536
10411
  const type = priority === "tertiary" ? void 0 : mapContext(context);
10537
10412
  const { isLoading } = useLoadingContext();
10538
- return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
10539
- import_components8.Button,
10413
+ return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
10414
+ import_components6.Button,
10540
10415
  {
10541
10416
  block: true,
10542
10417
  className,
@@ -10587,10 +10462,10 @@ var ButtonRenderer_default = ButtonRenderer;
10587
10462
 
10588
10463
  // src/revamp/wise/renderers/ColumnsRenderer.tsx
10589
10464
  var import_classnames3 = __toESM(require_classnames());
10590
- var import_jsx_runtime18 = require("react/jsx-runtime");
10465
+ var import_jsx_runtime15 = require("react/jsx-runtime");
10591
10466
  var ColumnsRenderer = {
10592
10467
  canRenderType: "columns",
10593
- render: ({ bias, margin, startChildren, endChildren }) => /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
10468
+ render: ({ bias, margin, startChildren, endChildren }) => /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
10594
10469
  "div",
10595
10470
  {
10596
10471
  className: (0, import_classnames3.default)("df-columns-renderer-container", getMargin(margin), {
@@ -10598,8 +10473,8 @@ var ColumnsRenderer = {
10598
10473
  "df-columns-renderer-bias-end": bias === "end"
10599
10474
  }),
10600
10475
  children: [
10601
- /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { className: "df-columns-renderer-column", children: startChildren }),
10602
- /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { className: "df-columns-renderer-column", children: endChildren })
10476
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "df-columns-renderer-column", children: startChildren }),
10477
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "df-columns-renderer-column", children: endChildren })
10603
10478
  ]
10604
10479
  }
10605
10480
  )
@@ -10607,7 +10482,7 @@ var ColumnsRenderer = {
10607
10482
  var ColumnsRenderer_default = ColumnsRenderer;
10608
10483
 
10609
10484
  // src/revamp/wise/renderers/components/VariableDateInput.tsx
10610
- var import_components9 = require("@transferwise/components");
10485
+ var import_components7 = require("@transferwise/components");
10611
10486
 
10612
10487
  // src/revamp/wise/renderers/validators/type-validators.ts
10613
10488
  var isNumber2 = (value) => typeof value === "number" && !Number.isNaN(value);
@@ -10638,15 +10513,15 @@ var dateToDateString = (date) => {
10638
10513
  };
10639
10514
 
10640
10515
  // src/revamp/wise/renderers/components/VariableDateInput.tsx
10641
- var import_jsx_runtime19 = require("react/jsx-runtime");
10516
+ var import_jsx_runtime16 = require("react/jsx-runtime");
10642
10517
  function VariableDateInput({
10643
10518
  control,
10644
10519
  inputProps
10645
10520
  }) {
10646
10521
  const { minimumDate, maximumDate, placeholder, disabled, onBlur, onChange, onFocus } = inputProps;
10647
10522
  if (control === "date-lookup") {
10648
- return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
10649
- import_components9.DateLookup,
10523
+ return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
10524
+ import_components7.DateLookup,
10650
10525
  {
10651
10526
  value: dateStringToDateOrNull(inputProps.value),
10652
10527
  min: dateStringToDateOrNull(minimumDate),
@@ -10661,12 +10536,12 @@ function VariableDateInput({
10661
10536
  }
10662
10537
  );
10663
10538
  }
10664
- return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_components9.DateInput, __spreadValues({}, inputProps));
10539
+ return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_components7.DateInput, __spreadValues({}, inputProps));
10665
10540
  }
10666
10541
  var VariableDateInput_default = VariableDateInput;
10667
10542
 
10668
10543
  // src/revamp/wise/renderers/DateInputRenderer.tsx
10669
- var import_jsx_runtime20 = require("react/jsx-runtime");
10544
+ var import_jsx_runtime17 = require("react/jsx-runtime");
10670
10545
  var DateInputRenderer = {
10671
10546
  canRenderType: "input-date",
10672
10547
  render: (props) => {
@@ -10691,29 +10566,29 @@ var DateInputRenderer = {
10691
10566
  ]);
10692
10567
  const value = initialValue != null ? initialValue : "";
10693
10568
  const inputProps = __spreadProps(__spreadValues({}, rest), { value, id });
10694
- return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(FieldInput_default, { id, label, description, error, help, children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(VariableDateInput_default, { control, inputProps }) });
10569
+ return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(FieldInput_default, { id, label, description, error, help, children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(VariableDateInput_default, { control, inputProps }) });
10695
10570
  }
10696
10571
  };
10697
10572
  var DateInputRenderer_default = DateInputRenderer;
10698
10573
 
10699
10574
  // src/revamp/wise/renderers/DecisionRenderer.tsx
10700
- var import_components11 = require("@transferwise/components");
10575
+ var import_components9 = require("@transferwise/components");
10701
10576
 
10702
10577
  // ../../node_modules/.pnpm/@wise+art@2.7.0_react-dom@18.2.0_react@18.2.0/node_modules/@wise/art/dist/index.esm.js
10703
- var import_react11 = require("react");
10704
- var import_jsx_runtime21 = require("react/jsx-runtime");
10578
+ var import_react9 = require("react");
10579
+ var import_jsx_runtime18 = require("react/jsx-runtime");
10705
10580
  var unknownFlagName = "wise";
10706
10581
  var Flag = ({
10707
10582
  code,
10708
10583
  intrinsicSize = 64
10709
10584
  }) => {
10710
- const [fallback, setFallback] = (0, import_react11.useState)(null);
10711
- (0, import_react11.useEffect)(() => {
10585
+ const [fallback, setFallback] = (0, import_react9.useState)(null);
10586
+ (0, import_react9.useEffect)(() => {
10712
10587
  setFallback(null);
10713
10588
  }, [code]);
10714
10589
  const detailed = intrinsicSize >= 150;
10715
10590
  const name = fallback !== "unknown" ? `${code.toLowerCase()}${fallback == null && detailed ? "-detailed" : ""}` : unknownFlagName;
10716
- return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("img", {
10591
+ return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("img", {
10717
10592
  src: `https://wise.com/web-art/assets/flags/${name}.svg`,
10718
10593
  alt: "",
10719
10594
  width: intrinsicSize,
@@ -10804,19 +10679,19 @@ var Assets;
10804
10679
  })(Assets || (Assets = {}));
10805
10680
 
10806
10681
  // src/revamp/wise/renderers/components/icon/FlagIcon.tsx
10807
- var import_jsx_runtime22 = require("react/jsx-runtime");
10682
+ var import_jsx_runtime19 = require("react/jsx-runtime");
10808
10683
  var isFlagIcon = (name) => name.startsWith("flag-");
10809
10684
  function FlagIcon({ name }) {
10810
10685
  if (!isFlagIcon(name)) {
10811
10686
  return null;
10812
10687
  }
10813
10688
  const code = name.substring(5);
10814
- return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(Flag, { code });
10689
+ return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(Flag, { code });
10815
10690
  }
10816
10691
 
10817
10692
  // src/revamp/wise/renderers/components/icon/NamedIcon.tsx
10818
10693
  var icons = __toESM(require("@transferwise/icons"));
10819
- var import_jsx_runtime23 = require("react/jsx-runtime");
10694
+ var import_jsx_runtime20 = require("react/jsx-runtime");
10820
10695
  var isNamedIcon = (name) => {
10821
10696
  const iconName = toCapitalisedCamelCase(name);
10822
10697
  return Object.keys(icons).includes(iconName);
@@ -10827,45 +10702,45 @@ function NamedIcon({ name }) {
10827
10702
  }
10828
10703
  const iconName = toCapitalisedCamelCase(name);
10829
10704
  const Icon = icons[iconName];
10830
- return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(Icon, { size: 24 });
10705
+ return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Icon, { size: 24 });
10831
10706
  }
10832
10707
  var toCapitalisedCamelCase = (value) => value.split("-").map(capitaliseFirstChar).join("");
10833
10708
  var capitaliseFirstChar = (value) => `${value[0].toUpperCase()}${value.slice(1)}`;
10834
10709
 
10835
10710
  // src/revamp/wise/renderers/components/icon/DynamicIcon.tsx
10836
- var import_jsx_runtime24 = require("react/jsx-runtime");
10711
+ var import_jsx_runtime21 = require("react/jsx-runtime");
10837
10712
  function DynamicIcon({ name }) {
10838
10713
  if (isFlagIcon(name)) {
10839
- return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(FlagIcon, { name });
10714
+ return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(FlagIcon, { name });
10840
10715
  }
10841
10716
  if (isNamedIcon(name)) {
10842
- return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(NamedIcon, { name });
10717
+ return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(NamedIcon, { name });
10843
10718
  }
10844
10719
  return null;
10845
10720
  }
10846
10721
  var DynamicIcon_default = DynamicIcon;
10847
10722
 
10848
10723
  // src/revamp/wise/renderers/components/icon/NavigationOptionMedia.tsx
10849
- var import_components10 = require("@transferwise/components");
10850
- var import_jsx_runtime25 = require("react/jsx-runtime");
10724
+ var import_components8 = require("@transferwise/components");
10725
+ var import_jsx_runtime22 = require("react/jsx-runtime");
10851
10726
  function NavigationOptionMedia({ icon, image }) {
10852
10727
  if (!isNullish2(icon)) {
10853
10728
  if ("name" in icon) {
10854
- return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_components10.Avatar, { type: import_components10.AvatarType.ICON, children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(DynamicIcon_default, { name: icon.name }) });
10729
+ return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_components8.Avatar, { type: import_components8.AvatarType.ICON, children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(DynamicIcon_default, { name: icon.name }) });
10855
10730
  }
10856
10731
  if (icon.text) {
10857
- return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_components10.Avatar, { type: import_components10.AvatarType.INITIALS, children: icon.text });
10732
+ return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_components8.Avatar, { type: import_components8.AvatarType.INITIALS, children: icon.text });
10858
10733
  }
10859
10734
  }
10860
10735
  if (image == null ? void 0 : image.url) {
10861
10736
  const { url, accessibilityDescription } = image;
10862
- return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("img", { src: url, alt: accessibilityDescription });
10737
+ return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("img", { src: url, alt: accessibilityDescription });
10863
10738
  }
10864
10739
  return null;
10865
10740
  }
10866
10741
 
10867
10742
  // src/revamp/wise/renderers/DecisionRenderer.tsx
10868
- var import_jsx_runtime26 = require("react/jsx-runtime");
10743
+ var import_jsx_runtime23 = require("react/jsx-runtime");
10869
10744
  var DecisionRenderer = {
10870
10745
  canRenderType: "decision",
10871
10746
  render: DecisionRendererComponent
@@ -10873,13 +10748,13 @@ var DecisionRenderer = {
10873
10748
  var DecisionRenderer_default = DecisionRenderer;
10874
10749
  function DecisionRendererComponent({ margin, options }) {
10875
10750
  const { isLoading } = useLoadingContext();
10876
- return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", { className: getMargin(margin), children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_components11.NavigationOptionsList, { children: options.map(({ description, disabled, icon, image, title, onClick }) => /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
10877
- import_components11.NavigationOption,
10751
+ return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { className: getMargin(margin), children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_components9.NavigationOptionsList, { children: options.map(({ description, disabled, icon, image, title, onClick }) => /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
10752
+ import_components9.NavigationOption,
10878
10753
  {
10879
10754
  title,
10880
10755
  content: description,
10881
10756
  disabled: isLoading || disabled,
10882
- media: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(NavigationOptionMedia, { icon, image }),
10757
+ media: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(NavigationOptionMedia, { icon, image }),
10883
10758
  showMediaCircle: false,
10884
10759
  showMediaAtAllSizes: true,
10885
10760
  onClick
@@ -10889,69 +10764,69 @@ function DecisionRendererComponent({ margin, options }) {
10889
10764
  }
10890
10765
 
10891
10766
  // src/revamp/wise/renderers/DividerRenderer.tsx
10892
- var import_jsx_runtime27 = require("react/jsx-runtime");
10767
+ var import_jsx_runtime24 = require("react/jsx-runtime");
10893
10768
  var DividerRenderer = {
10894
10769
  canRenderType: "divider",
10895
- render: ({ margin }) => /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("hr", { className: `m-t-0 ${getMargin(margin)}` })
10770
+ render: ({ margin }) => /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("hr", { className: `m-t-0 ${getMargin(margin)}` })
10896
10771
  };
10897
10772
  var DividerRenderer_default = DividerRenderer;
10898
10773
 
10899
10774
  // src/revamp/wise/renderers/FormRenderer.tsx
10900
- var import_jsx_runtime28 = require("react/jsx-runtime");
10775
+ var import_jsx_runtime25 = require("react/jsx-runtime");
10901
10776
  var FormRenderer = {
10902
10777
  canRenderType: "form",
10903
- render: ({ children, margin }) => /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: getMargin(margin), children })
10778
+ render: ({ children, margin }) => /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: getMargin(margin), children })
10904
10779
  };
10905
10780
  var FormRenderer_default = FormRenderer;
10906
10781
 
10907
10782
  // src/revamp/wise/renderers/FormSectionRenderer.tsx
10908
- var import_components12 = require("@transferwise/components");
10909
- var import_jsx_runtime29 = require("react/jsx-runtime");
10783
+ var import_components10 = require("@transferwise/components");
10784
+ var import_jsx_runtime26 = require("react/jsx-runtime");
10910
10785
  var FormSectionRenderer = {
10911
10786
  canRenderType: "form-section",
10912
- render: ({ title, description, children }) => /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("fieldset", { children: [
10787
+ render: ({ title, description, children }) => /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("fieldset", { children: [
10913
10788
  title && // TODO - once section headers support help, we could show help in here
10914
- /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
10915
- import_components12.Header,
10789
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
10790
+ import_components10.Header,
10916
10791
  {
10917
10792
  as: "h2",
10918
10793
  title
10919
10794
  }
10920
10795
  ),
10921
- description && /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("p", { children: description }),
10796
+ description && /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("p", { children: description }),
10922
10797
  children
10923
10798
  ] })
10924
10799
  };
10925
10800
  var FormSectionRenderer_default = FormSectionRenderer;
10926
10801
 
10927
10802
  // src/revamp/wise/renderers/HeadingRenderer.tsx
10928
- var import_components13 = require("@transferwise/components");
10929
- var import_jsx_runtime30 = require("react/jsx-runtime");
10803
+ var import_components11 = require("@transferwise/components");
10804
+ var import_jsx_runtime27 = require("react/jsx-runtime");
10930
10805
  var HeadingRenderer = {
10931
10806
  canRenderType: "heading",
10932
- render: (props) => /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(Heading, __spreadValues({}, props))
10807
+ render: (props) => /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(Heading, __spreadValues({}, props))
10933
10808
  };
10934
10809
  function Heading(props) {
10935
10810
  const { text, size, align, margin, control } = props;
10936
10811
  const className = getTextAlignmentAndMargin({ align, margin });
10937
- return control === "display" ? /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(DisplayHeading, { size, text, className }) : /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(StandardHeading, { size, text, className });
10812
+ return control === "display" ? /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(DisplayHeading, { size, text, className }) : /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(StandardHeading, { size, text, className });
10938
10813
  }
10939
10814
  function DisplayHeading({ size, text, className }) {
10940
- return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_components13.Display, { type: getDisplayType(size), className, children: text });
10815
+ return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_components11.Display, { type: getDisplayType(size), className, children: text });
10941
10816
  }
10942
10817
  function StandardHeading({ size, text, className }) {
10943
10818
  switch (size) {
10944
10819
  case "xs":
10945
- return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("h5", { className, children: text });
10820
+ return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("h5", { className, children: text });
10946
10821
  case "sm":
10947
- return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("h4", { className, children: text });
10822
+ return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("h4", { className, children: text });
10948
10823
  case "lg":
10949
- return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("h2", { className, children: text });
10824
+ return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("h2", { className, children: text });
10950
10825
  case "xl":
10951
- return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("h1", { className, children: text });
10826
+ return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("h1", { className, children: text });
10952
10827
  case "md":
10953
10828
  default:
10954
- return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("h3", { className, children: text });
10829
+ return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("h3", { className, children: text });
10955
10830
  }
10956
10831
  }
10957
10832
  var getDisplayType = (size) => {
@@ -10970,12 +10845,12 @@ var getDisplayType = (size) => {
10970
10845
  var HeadingRenderer_default = HeadingRenderer;
10971
10846
 
10972
10847
  // src/revamp/wise/renderers/ImageRenderer.tsx
10973
- var import_components14 = require("@transferwise/components");
10974
- var import_react12 = require("react");
10975
- var import_jsx_runtime31 = require("react/jsx-runtime");
10848
+ var import_components12 = require("@transferwise/components");
10849
+ var import_react10 = require("react");
10850
+ var import_jsx_runtime28 = require("react/jsx-runtime");
10976
10851
  var ImageRenderer = {
10977
10852
  canRenderType: "image",
10978
- render: (props) => /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(ImageRendererComponent, __spreadValues({}, props))
10853
+ render: (props) => /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(ImageRendererComponent, __spreadValues({}, props))
10979
10854
  };
10980
10855
  var ImageRenderer_default = ImageRenderer;
10981
10856
  function ImageRendererComponent({
@@ -10984,13 +10859,13 @@ function ImageRendererComponent({
10984
10859
  size,
10985
10860
  url
10986
10861
  }) {
10987
- const [imageSource, setImageSource] = (0, import_react12.useState)("");
10862
+ const [imageSource, setImageSource] = (0, import_react10.useState)("");
10988
10863
  const httpClient = useHttpClient();
10989
- (0, import_react12.useEffect)(() => {
10864
+ (0, import_react10.useEffect)(() => {
10990
10865
  void getImageSource(httpClient, url).then(setImageSource);
10991
10866
  }, [url, httpClient]);
10992
- return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("div", { className: `df-image ${size || "md"}`, children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
10993
- import_components14.Image,
10867
+ return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: `df-image ${size || "md"}`, children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
10868
+ import_components12.Image,
10994
10869
  {
10995
10870
  className: `img-responsive ${getMargin(margin)}`,
10996
10871
  alt: accessibilityDescription != null ? accessibilityDescription : "",
@@ -11033,8 +10908,8 @@ var getImageSource = async (httpClient, imageUrl) => {
11033
10908
  };
11034
10909
 
11035
10910
  // src/revamp/wise/renderers/InstructionsRenderer.tsx
11036
- var import_components15 = require("@transferwise/components");
11037
- var import_jsx_runtime32 = require("react/jsx-runtime");
10911
+ var import_components13 = require("@transferwise/components");
10912
+ var import_jsx_runtime29 = require("react/jsx-runtime");
11038
10913
  var doContext = ["positive", "neutral"];
11039
10914
  var dontContext = ["warning", "negative"];
11040
10915
  var InstructionsRenderer = {
@@ -11042,16 +10917,16 @@ var InstructionsRenderer = {
11042
10917
  render: ({ items, margin, title }) => {
11043
10918
  const dos = items.filter((item) => doContext.includes(item.context)).map(({ text }) => text);
11044
10919
  const donts = items.filter((item) => dontContext.includes(item.context)).map(({ text }) => text);
11045
- return /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { className: getMargin(margin), children: [
11046
- title ? /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_components15.Header, { title }) : null,
11047
- /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_components15.InstructionsList, { dos, donts })
10920
+ return /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("div", { className: getMargin(margin), children: [
10921
+ title ? /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_components13.Header, { title }) : null,
10922
+ /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_components13.InstructionsList, { dos, donts })
11048
10923
  ] });
11049
10924
  }
11050
10925
  };
11051
10926
  var InstructionsRenderer_default = InstructionsRenderer;
11052
10927
 
11053
10928
  // src/revamp/wise/renderers/IntegerInputRenderer.tsx
11054
- var import_components16 = require("@transferwise/components");
10929
+ var import_components14 = require("@transferwise/components");
11055
10930
 
11056
10931
  // src/revamp/wise/renderers/utils/input-utils.ts
11057
10932
  var onWheel = (event) => {
@@ -11061,13 +10936,13 @@ var onWheel = (event) => {
11061
10936
  };
11062
10937
 
11063
10938
  // src/revamp/wise/renderers/IntegerInputRenderer.tsx
11064
- var import_jsx_runtime33 = require("react/jsx-runtime");
10939
+ var import_jsx_runtime30 = require("react/jsx-runtime");
11065
10940
  var IntegerInputRenderer = {
11066
10941
  canRenderType: "input-integer",
11067
10942
  render: (props) => {
11068
10943
  const _a = props, { id, label, error, description, help, type, value, onChange } = _a, rest = __objRest(_a, ["id", "label", "error", "description", "help", "type", "value", "onChange"]);
11069
- return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(FieldInput_default, { id, label, description, error, help, children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
11070
- import_components16.Input,
10944
+ return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(FieldInput_default, { id, label, description, error, help, children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
10945
+ import_components14.Input,
11071
10946
  __spreadValues({
11072
10947
  id,
11073
10948
  name: id,
@@ -11087,12 +10962,12 @@ var IntegerInputRenderer = {
11087
10962
  var IntegerInputRenderer_default = IntegerInputRenderer;
11088
10963
 
11089
10964
  // src/revamp/wise/renderers/LoadingIndicatorRenderer.tsx
11090
- var import_components17 = require("@transferwise/components");
11091
- var import_jsx_runtime34 = require("react/jsx-runtime");
10965
+ var import_components15 = require("@transferwise/components");
10966
+ var import_jsx_runtime31 = require("react/jsx-runtime");
11092
10967
  var LoadingIndicatorRenderer = {
11093
10968
  canRenderType: "loading-indicator",
11094
- render: ({ margin, size }) => /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
11095
- import_components17.Loader,
10969
+ render: ({ margin, size }) => /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
10970
+ import_components15.Loader,
11096
10971
  {
11097
10972
  size,
11098
10973
  classNames: { "tw-loader": `tw-loader m-x-auto ${getMargin(margin)}` },
@@ -11103,29 +10978,29 @@ var LoadingIndicatorRenderer = {
11103
10978
  var LoadingIndicatorRenderer_default = LoadingIndicatorRenderer;
11104
10979
 
11105
10980
  // src/revamp/wise/renderers/MarkdownRenderer.tsx
11106
- var import_components18 = require("@transferwise/components");
11107
- var import_jsx_runtime35 = require("react/jsx-runtime");
10981
+ var import_components16 = require("@transferwise/components");
10982
+ var import_jsx_runtime32 = require("react/jsx-runtime");
11108
10983
  var MarkdownRenderer = {
11109
10984
  canRenderType: "markdown",
11110
- render: ({ content, align, margin }) => /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { className: getTextAlignmentAndMargin({ align, margin }), children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_components18.Markdown, { config: { link: { target: "_blank" } }, children: content }) })
10985
+ render: ({ content, align, margin }) => /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("div", { className: getTextAlignmentAndMargin({ align, margin }), children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_components16.Markdown, { config: { link: { target: "_blank" } }, children: content }) })
11111
10986
  };
11112
10987
  var MarkdownRenderer_default = MarkdownRenderer;
11113
10988
 
11114
10989
  // src/revamp/wise/renderers/ModalRenderer.tsx
11115
- var import_components19 = require("@transferwise/components");
11116
- var import_react13 = require("react");
11117
- var import_jsx_runtime36 = require("react/jsx-runtime");
10990
+ var import_components17 = require("@transferwise/components");
10991
+ var import_react11 = require("react");
10992
+ var import_jsx_runtime33 = require("react/jsx-runtime");
11118
10993
  var ModalRenderer = {
11119
10994
  canRenderType: "modal",
11120
- render: (props) => /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(DFModal, __spreadValues({}, props))
10995
+ render: (props) => /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(DFModal, __spreadValues({}, props))
11121
10996
  };
11122
10997
  var ModalRenderer_default = ModalRenderer;
11123
10998
  function DFModal({ content, margin, trigger }) {
11124
- const [visible, setVisible] = (0, import_react13.useState)(false);
11125
- return /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { className: getMargin(margin), children: [
11126
- /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(import_components19.Button, { priority: "tertiary", block: true, onClick: () => setVisible(true), children: trigger.title }),
11127
- /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
11128
- import_components19.Modal,
10999
+ const [visible, setVisible] = (0, import_react11.useState)(false);
11000
+ return /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: getMargin(margin), children: [
11001
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_components17.Button, { priority: "tertiary", block: true, onClick: () => setVisible(true), children: trigger.title }),
11002
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
11003
+ import_components17.Modal,
11129
11004
  {
11130
11005
  scroll: "content",
11131
11006
  open: visible,
@@ -11138,12 +11013,12 @@ function DFModal({ content, margin, trigger }) {
11138
11013
  }
11139
11014
 
11140
11015
  // src/revamp/wise/renderers/MultiUploadInputRenderer.tsx
11141
- var import_components21 = require("@transferwise/components");
11016
+ var import_components19 = require("@transferwise/components");
11142
11017
 
11143
11018
  // src/revamp/wise/renderers/components/UploadFieldInput.tsx
11144
- var import_components20 = require("@transferwise/components");
11019
+ var import_components18 = require("@transferwise/components");
11145
11020
  var import_classnames4 = __toESM(require_classnames());
11146
- var import_jsx_runtime37 = require("react/jsx-runtime");
11021
+ var import_jsx_runtime34 = require("react/jsx-runtime");
11147
11022
  function UploadFieldInput({
11148
11023
  id,
11149
11024
  children,
@@ -11152,18 +11027,18 @@ function UploadFieldInput({
11152
11027
  error,
11153
11028
  help
11154
11029
  }) {
11155
- const labelContent = label && help ? /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(LabelContentWithHelp, { text: label, help }) : label;
11030
+ const labelContent = label && help ? /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(LabelContentWithHelp, { text: label, help }) : label;
11156
11031
  const descriptionId = description ? `${id}-description` : void 0;
11157
- return /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(
11032
+ return /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(
11158
11033
  "div",
11159
11034
  {
11160
11035
  className: (0, import_classnames4.default)("form-group d-block", {
11161
11036
  "has-error": !!error
11162
11037
  }),
11163
11038
  children: [
11164
- /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("label", { htmlFor: id, className: "control-label", children: labelContent }),
11039
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("label", { htmlFor: id, className: "control-label", children: labelContent }),
11165
11040
  children,
11166
- error && /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_components20.InlineAlert, { type: "negative", id: descriptionId, children: error })
11041
+ error && /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_components18.InlineAlert, { type: "negative", id: descriptionId, children: error })
11167
11042
  ]
11168
11043
  }
11169
11044
  );
@@ -11206,7 +11081,7 @@ var nanoid = (size = 21) => {
11206
11081
  var getRandomId = () => nanoid(10);
11207
11082
 
11208
11083
  // src/revamp/wise/renderers/MultiUploadInputRenderer.tsx
11209
- var import_jsx_runtime38 = require("react/jsx-runtime");
11084
+ var import_jsx_runtime35 = require("react/jsx-runtime");
11210
11085
  var MultiUploadInputRenderer = {
11211
11086
  canRenderType: "input-upload-multi",
11212
11087
  render: (props) => {
@@ -11233,8 +11108,8 @@ var MultiUploadInputRenderer = {
11233
11108
  };
11234
11109
  const onDeleteFile = async (fileId) => onDelete(String(fileId));
11235
11110
  const descriptionId = description ? `${id}-description` : void 0;
11236
- return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(UploadFieldInput_default, { id, label, description, error, help, children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
11237
- import_components21.UploadInput,
11111
+ return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(UploadFieldInput_default, { id, label, description, error, help, children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
11112
+ import_components19.UploadInput,
11238
11113
  {
11239
11114
  id,
11240
11115
  "aria-describedby": descriptionId,
@@ -11255,14 +11130,14 @@ var MultiUploadInputRenderer = {
11255
11130
  var MultiUploadInputRenderer_default = MultiUploadInputRenderer;
11256
11131
 
11257
11132
  // src/revamp/wise/renderers/NumberInputRenderer.tsx
11258
- var import_components22 = require("@transferwise/components");
11259
- var import_jsx_runtime39 = require("react/jsx-runtime");
11133
+ var import_components20 = require("@transferwise/components");
11134
+ var import_jsx_runtime36 = require("react/jsx-runtime");
11260
11135
  var NumberInputRenderer = {
11261
11136
  canRenderType: "input-number",
11262
11137
  render: (props) => {
11263
11138
  const _a = props, { id, label, error, description, help, type, value, onChange } = _a, rest = __objRest(_a, ["id", "label", "error", "description", "help", "type", "value", "onChange"]);
11264
- return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(FieldInput_default, { id, label, description, error, help, children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
11265
- import_components22.Input,
11139
+ return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(FieldInput_default, { id, label, description, error, help, children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
11140
+ import_components20.Input,
11266
11141
  __spreadValues({
11267
11142
  id,
11268
11143
  name: id,
@@ -11280,24 +11155,24 @@ var NumberInputRenderer = {
11280
11155
  var NumberInputRenderer_default = NumberInputRenderer;
11281
11156
 
11282
11157
  // src/revamp/wise/renderers/ParagraphRenderer.tsx
11283
- var import_react_intl12 = require("react-intl");
11158
+ var import_react_intl10 = require("react-intl");
11284
11159
 
11285
11160
  // src/revamp/wise/renderers/hooks/useSnackBarIfAvailable.ts
11286
- var import_components23 = require("@transferwise/components");
11287
- var import_react14 = require("react");
11161
+ var import_components21 = require("@transferwise/components");
11162
+ var import_react12 = require("react");
11288
11163
  function useSnackBarIfAvailable() {
11289
- const context = (0, import_react14.useContext)(import_components23.SnackbarContext);
11164
+ const context = (0, import_react12.useContext)(import_components21.SnackbarContext);
11290
11165
  return context ? context.createSnackbar : () => {
11291
11166
  };
11292
11167
  }
11293
11168
 
11294
11169
  // src/revamp/wise/renderers/ParagraphRenderer.tsx
11295
- var import_components24 = require("@transferwise/components");
11170
+ var import_components22 = require("@transferwise/components");
11296
11171
  var import_classnames5 = __toESM(require_classnames());
11297
11172
 
11298
11173
  // src/common/messages/paragraph.messages.ts
11299
- var import_react_intl11 = require("react-intl");
11300
- var paragraph_messages_default = (0, import_react_intl11.defineMessages)({
11174
+ var import_react_intl9 = require("react-intl");
11175
+ var paragraph_messages_default = (0, import_react_intl9.defineMessages)({
11301
11176
  copy: {
11302
11177
  id: "dynamicFlows.DynamicParagraph.copy",
11303
11178
  defaultMessage: "Copy",
@@ -11311,33 +11186,33 @@ var paragraph_messages_default = (0, import_react_intl11.defineMessages)({
11311
11186
  });
11312
11187
 
11313
11188
  // src/revamp/wise/renderers/ParagraphRenderer.tsx
11314
- var import_jsx_runtime40 = require("react/jsx-runtime");
11189
+ var import_jsx_runtime37 = require("react/jsx-runtime");
11315
11190
  var ParagraphRenderer = {
11316
11191
  canRenderType: "paragraph",
11317
- render: (props) => /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(Paragraph, __spreadValues({}, props))
11192
+ render: (props) => /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(Paragraph, __spreadValues({}, props))
11318
11193
  };
11319
11194
  function Paragraph({ align, control, margin, text }) {
11320
11195
  const className = getTextAlignmentAndMargin({ align, margin });
11321
- return control === "copyable" ? /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(CopyableParagraph, { className, align, text }) : /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(StandardParagraph, { className, text });
11196
+ return control === "copyable" ? /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(CopyableParagraph, { className, align, text }) : /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(StandardParagraph, { className, text });
11322
11197
  }
11323
11198
  function StandardParagraph({ text, className }) {
11324
- return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("p", { className, children: text });
11199
+ return /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("p", { className, children: text });
11325
11200
  }
11326
11201
  function CopyableParagraph({
11327
11202
  text,
11328
11203
  align,
11329
11204
  className
11330
11205
  }) {
11331
- const { formatMessage } = (0, import_react_intl12.useIntl)();
11206
+ const { formatMessage } = (0, import_react_intl10.useIntl)();
11332
11207
  const createSnackbar = useSnackBarIfAvailable();
11333
11208
  const copy = () => {
11334
11209
  navigator.clipboard.writeText(text).then(() => createSnackbar({ text: formatMessage(paragraph_messages_default.copied) })).catch(() => {
11335
11210
  });
11336
11211
  };
11337
11212
  const inputAlignmentClasses = getTextAlignmentAndMargin({ align, margin: "sm" });
11338
- return /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("div", { className, children: [
11339
- /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
11340
- import_components24.Input,
11213
+ return /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("div", { className, children: [
11214
+ /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
11215
+ import_components22.Input,
11341
11216
  {
11342
11217
  type: "text",
11343
11218
  value: text,
@@ -11345,20 +11220,20 @@ function CopyableParagraph({
11345
11220
  className: (0, import_classnames5.default)("text-ellipsis", inputAlignmentClasses)
11346
11221
  }
11347
11222
  ),
11348
- /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_components24.Button, { block: true, onClick: copy, children: formatMessage(paragraph_messages_default.copy) })
11223
+ /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_components22.Button, { block: true, onClick: copy, children: formatMessage(paragraph_messages_default.copy) })
11349
11224
  ] });
11350
11225
  }
11351
11226
  var ParagraphRenderer_default = ParagraphRenderer;
11352
11227
 
11353
11228
  // src/revamp/wise/renderers/RepeatableRenderer.tsx
11354
- var import_components25 = require("@transferwise/components");
11355
- var import_react15 = require("react");
11356
- var import_icons2 = require("@transferwise/icons");
11357
- var import_react_intl14 = require("react-intl");
11229
+ var import_components23 = require("@transferwise/components");
11230
+ var import_react13 = require("react");
11231
+ var import_icons = require("@transferwise/icons");
11232
+ var import_react_intl12 = require("react-intl");
11358
11233
 
11359
11234
  // src/common/messages/repeatable.messages.ts
11360
- var import_react_intl13 = require("react-intl");
11361
- var repeatable_messages_default = (0, import_react_intl13.defineMessages)({
11235
+ var import_react_intl11 = require("react-intl");
11236
+ var repeatable_messages_default = (0, import_react_intl11.defineMessages)({
11362
11237
  addItemTitle: {
11363
11238
  id: "dynamicFlows.ArraySchema.addItemTitle",
11364
11239
  defaultMessage: "Add Item",
@@ -11383,10 +11258,10 @@ var repeatable_messages_default = (0, import_react_intl13.defineMessages)({
11383
11258
 
11384
11259
  // src/revamp/wise/renderers/RepeatableRenderer.tsx
11385
11260
  var import_classnames6 = __toESM(require_classnames());
11386
- var import_jsx_runtime41 = require("react/jsx-runtime");
11261
+ var import_jsx_runtime38 = require("react/jsx-runtime");
11387
11262
  var RepeatableRenderer = {
11388
11263
  canRenderType: "repeatable",
11389
- render: (props) => /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(Repeatable, __spreadValues({}, props))
11264
+ render: (props) => /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(Repeatable, __spreadValues({}, props))
11390
11265
  };
11391
11266
  function Repeatable(props) {
11392
11267
  const {
@@ -11402,8 +11277,8 @@ function Repeatable(props) {
11402
11277
  onSave,
11403
11278
  onRemove
11404
11279
  } = props;
11405
- const { formatMessage } = (0, import_react_intl14.useIntl)();
11406
- const [openModalType, setOpenModalType] = (0, import_react15.useState)(null);
11280
+ const { formatMessage } = (0, import_react_intl12.useIntl)();
11281
+ const [openModalType, setOpenModalType] = (0, import_react13.useState)(null);
11407
11282
  const onAddItem = () => {
11408
11283
  onAdd();
11409
11284
  setOpenModalType("add");
@@ -11425,40 +11300,40 @@ function Repeatable(props) {
11425
11300
  const onCancelEdit = () => {
11426
11301
  setOpenModalType(null);
11427
11302
  };
11428
- return /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(import_jsx_runtime41.Fragment, { children: [
11429
- title && /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_components25.Header, { title }),
11430
- description && /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("p", { children: description }),
11431
- /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(
11303
+ return /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(import_jsx_runtime38.Fragment, { children: [
11304
+ title && /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_components23.Header, { title }),
11305
+ description && /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("p", { children: description }),
11306
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(
11432
11307
  "div",
11433
11308
  {
11434
11309
  className: (0, import_classnames6.default)("form-group", {
11435
11310
  "has-error": error
11436
11311
  }),
11437
11312
  children: [
11438
- items == null ? void 0 : items.map((item, index) => /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(ItemSummaryOption, { item, onClick: () => onEditItem(index) }, item.id)),
11439
- /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
11440
- import_components25.NavigationOption,
11313
+ items == null ? void 0 : items.map((item, index) => /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(ItemSummaryOption, { item, onClick: () => onEditItem(index) }, item.id)),
11314
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
11315
+ import_components23.NavigationOption,
11441
11316
  {
11442
- media: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_icons2.Plus, {}),
11317
+ media: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_icons.Plus, {}),
11443
11318
  title: addItemTitle || formatMessage(repeatable_messages_default.addItemTitle),
11444
11319
  showMediaAtAllSizes: true,
11445
11320
  onClick: () => onAddItem()
11446
11321
  }
11447
11322
  ),
11448
- error && /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_components25.InlineAlert, { type: "negative", children: error })
11323
+ error && /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_components23.InlineAlert, { type: "negative", children: error })
11449
11324
  ]
11450
11325
  }
11451
11326
  ),
11452
- /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
11453
- import_components25.Modal,
11327
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
11328
+ import_components23.Modal,
11454
11329
  {
11455
11330
  open: openModalType !== null,
11456
11331
  title: (openModalType === "add" ? addItemTitle : editItemTitle) || formatMessage(repeatable_messages_default.addItemTitle),
11457
- body: /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(import_jsx_runtime41.Fragment, { children: [
11458
- /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("div", { className: "m-b-2", children: editableItem }),
11459
- /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("div", { children: [
11460
- /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_components25.Button, { priority: "primary", block: true, className: "m-b-2", onClick: () => onSaveItem(), children: formatMessage(repeatable_messages_default.addItem) }),
11461
- /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_components25.Button, { priority: "secondary", type: "negative", block: true, onClick: () => onRemoveItem(), children: formatMessage(repeatable_messages_default.removeItem) })
11332
+ body: /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(import_jsx_runtime38.Fragment, { children: [
11333
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("div", { className: "m-b-2", children: editableItem }),
11334
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { children: [
11335
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_components23.Button, { priority: "primary", block: true, className: "m-b-2", onClick: () => onSaveItem(), children: formatMessage(repeatable_messages_default.addItem) }),
11336
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_components23.Button, { priority: "secondary", type: "negative", block: true, onClick: () => onRemoveItem(), children: formatMessage(repeatable_messages_default.removeItem) })
11462
11337
  ] })
11463
11338
  ] }),
11464
11339
  onClose: () => onCancelEdit()
@@ -11470,10 +11345,10 @@ function ItemSummaryOption({
11470
11345
  item,
11471
11346
  onClick
11472
11347
  }) {
11473
- return /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
11474
- import_components25.NavigationOption,
11348
+ return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
11349
+ import_components23.NavigationOption,
11475
11350
  {
11476
- media: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(NavigationOptionMedia, __spreadValues({}, item)),
11351
+ media: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(NavigationOptionMedia, __spreadValues({}, item)),
11477
11352
  title: item.title,
11478
11353
  content: item.description,
11479
11354
  showMediaAtAllSizes: true,
@@ -11484,17 +11359,17 @@ function ItemSummaryOption({
11484
11359
  var RepeatableRenderer_default = RepeatableRenderer;
11485
11360
 
11486
11361
  // src/revamp/wise/renderers/SearchRenderer/BlockSearchRendererComponent.tsx
11487
- var import_components26 = require("@transferwise/components");
11362
+ var import_components24 = require("@transferwise/components");
11488
11363
 
11489
11364
  // src/revamp/wise/renderers/SearchRenderer/ErrorResult.tsx
11490
- var import_react_intl15 = require("react-intl");
11491
- var import_jsx_runtime42 = require("react/jsx-runtime");
11365
+ var import_react_intl13 = require("react-intl");
11366
+ var import_jsx_runtime39 = require("react/jsx-runtime");
11492
11367
  function ErrorResult({ state }) {
11493
- const intl = (0, import_react_intl15.useIntl)();
11494
- return /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("p", { className: "m-t-2", children: [
11368
+ const intl = (0, import_react_intl13.useIntl)();
11369
+ return /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("p", { className: "m-t-2", children: [
11495
11370
  intl.formatMessage(generic_error_messages_default.genericError),
11496
11371
  "\xA0",
11497
- /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
11372
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
11498
11373
  "a",
11499
11374
  {
11500
11375
  href: "/",
@@ -11509,8 +11384,8 @@ function ErrorResult({ state }) {
11509
11384
  }
11510
11385
 
11511
11386
  // src/revamp/wise/renderers/SearchRenderer/BlockSearchRendererComponent.tsx
11512
- var import_react16 = require("react");
11513
- var import_jsx_runtime43 = require("react/jsx-runtime");
11387
+ var import_react14 = require("react");
11388
+ var import_jsx_runtime40 = require("react/jsx-runtime");
11514
11389
  function BlockSearchRendererComponent({
11515
11390
  id,
11516
11391
  isLoading,
@@ -11520,11 +11395,11 @@ function BlockSearchRendererComponent({
11520
11395
  state,
11521
11396
  title
11522
11397
  }) {
11523
- const [hasSearched, setHasSearched] = (0, import_react16.useState)(false);
11398
+ const [hasSearched, setHasSearched] = (0, import_react14.useState)(false);
11524
11399
  const trackEvent = useTrackEvent();
11525
- return /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("div", { className: getMargin(margin), children: [
11526
- /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(FieldInput_default, { id, description: "", error: "", help: "", label: title, children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
11527
- import_components26.Input,
11400
+ return /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("div", { className: getMargin(margin), children: [
11401
+ /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(FieldInput_default, { id, description: "", error: "", help: "", label: title, children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
11402
+ import_components24.Input,
11528
11403
  {
11529
11404
  id,
11530
11405
  name: id,
@@ -11540,7 +11415,7 @@ function BlockSearchRendererComponent({
11540
11415
  }
11541
11416
  }
11542
11417
  ) }),
11543
- isLoading ? /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(import_jsx_runtime43.Fragment, { children: "Loading..." }) : /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(SearchResultContent, { state, onChange })
11418
+ isLoading ? /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_jsx_runtime40.Fragment, { children: "Loading..." }) : /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(SearchResultContent, { state, onChange })
11544
11419
  ] });
11545
11420
  }
11546
11421
  function SearchResultContent({
@@ -11549,29 +11424,29 @@ function SearchResultContent({
11549
11424
  }) {
11550
11425
  switch (state.type) {
11551
11426
  case "error":
11552
- return /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(ErrorResult, { state });
11427
+ return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(ErrorResult, { state });
11553
11428
  case "results":
11554
- return /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(SearchResults, { state, onChange });
11429
+ return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(SearchResults, { state, onChange });
11555
11430
  case "noResults":
11556
- return /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(EmptySearchResult, { state });
11431
+ return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(EmptySearchResult, { state });
11557
11432
  case "pending":
11558
11433
  default:
11559
11434
  return null;
11560
11435
  }
11561
11436
  }
11562
11437
  function EmptySearchResult({ state }) {
11563
- return /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(import_components26.Markdown, { className: "m-t-2", config: { link: { target: "_blank" } }, children: state.message });
11438
+ return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_components24.Markdown, { className: "m-t-2", config: { link: { target: "_blank" } }, children: state.message });
11564
11439
  }
11565
11440
  function SearchResults({
11566
11441
  state
11567
11442
  }) {
11568
11443
  const trackEvent = useTrackEvent();
11569
- return /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(import_components26.NavigationOptionsList, { children: state.results.map((result) => /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
11570
- import_components26.NavigationOption,
11444
+ return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_components24.NavigationOptionsList, { children: state.results.map((result) => /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
11445
+ import_components24.NavigationOption,
11571
11446
  {
11572
11447
  title: result.title,
11573
11448
  content: result.description,
11574
- media: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(NavigationOptionMedia, __spreadValues({}, result)),
11449
+ media: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(NavigationOptionMedia, __spreadValues({}, result)),
11575
11450
  showMediaCircle: false,
11576
11451
  showMediaAtAllSizes: true,
11577
11452
  onClick: () => {
@@ -11587,10 +11462,10 @@ function SearchResults({
11587
11462
  var BlockSearchRendererComponent_default = BlockSearchRendererComponent;
11588
11463
 
11589
11464
  // src/revamp/wise/renderers/SearchRenderer/InlineSearchRendererComponent.tsx
11590
- var import_components27 = require("@transferwise/components");
11591
- var import_icons3 = require("@transferwise/icons");
11592
- var import_react17 = require("react");
11593
- var import_jsx_runtime44 = require("react/jsx-runtime");
11465
+ var import_components25 = require("@transferwise/components");
11466
+ var import_icons2 = require("@transferwise/icons");
11467
+ var import_react15 = require("react");
11468
+ var import_jsx_runtime41 = require("react/jsx-runtime");
11594
11469
  function InlineSearchRenderer({
11595
11470
  id,
11596
11471
  isLoading,
@@ -11599,21 +11474,21 @@ function InlineSearchRenderer({
11599
11474
  state,
11600
11475
  title
11601
11476
  }) {
11602
- const [hasSearched, setHasSearched] = (0, import_react17.useState)(false);
11477
+ const [hasSearched, setHasSearched] = (0, import_react15.useState)(false);
11603
11478
  const trackEvent = useTrackEvent();
11604
- return /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("div", { className: getMargin(margin), children: /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(FieldInput_default, { id, description: "", error: "", help: "", label: title, children: [
11479
+ return /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("div", { className: getMargin(margin), children: /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(FieldInput_default, { id, description: "", error: "", help: "", label: title, children: [
11605
11480
  id,
11606
- /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
11607
- import_components27.Typeahead,
11481
+ /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
11482
+ import_components25.Typeahead,
11608
11483
  {
11609
11484
  id: "typeahead-input-id",
11610
11485
  name: "typeahead-input-name",
11611
11486
  size: "md",
11612
11487
  maxHeight: 100,
11613
- footer: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(TypeaheadFooter, { state, isLoading }),
11488
+ footer: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(TypeaheadFooter, { state, isLoading }),
11614
11489
  multiple: false,
11615
11490
  clearable: false,
11616
- addon: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_icons3.Search, { size: 24 }),
11491
+ addon: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_icons2.Search, { size: 24 }),
11617
11492
  options: state.type === "results" ? state.results.map(mapResultToTypeaheadOption) : [],
11618
11493
  minQueryLength: 1,
11619
11494
  onChange: (values) => {
@@ -11650,47 +11525,47 @@ function mapResultToTypeaheadOption(result) {
11650
11525
  }
11651
11526
  function TypeaheadFooter({ state, isLoading }) {
11652
11527
  if (state.type === "noResults") {
11653
- return /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_components27.Markdown, { className: "m-t-2 m-x-2", config: { link: { target: "_blank" } }, children: state.message });
11528
+ return /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_components25.Markdown, { className: "m-t-2 m-x-2", config: { link: { target: "_blank" } }, children: state.message });
11654
11529
  }
11655
11530
  if (state.type === "error") {
11656
- return /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("div", { className: "m-t-2 m-x-2", children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(ErrorResult, { state }) });
11531
+ return /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("div", { className: "m-t-2 m-x-2", children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(ErrorResult, { state }) });
11657
11532
  }
11658
11533
  if (state.type === "pending" || isLoading) {
11659
- return /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("p", { className: "m-t-2 m-x-2", children: "Loading..." });
11534
+ return /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("p", { className: "m-t-2 m-x-2", children: "Loading..." });
11660
11535
  }
11661
11536
  return null;
11662
11537
  }
11663
11538
  var InlineSearchRendererComponent_default = InlineSearchRenderer;
11664
11539
 
11665
11540
  // src/revamp/wise/renderers/SearchRenderer/SearchRenderer.tsx
11666
- var import_jsx_runtime45 = require("react/jsx-runtime");
11541
+ var import_jsx_runtime42 = require("react/jsx-runtime");
11667
11542
  var SearchRenderer = {
11668
11543
  canRenderType: "search",
11669
- render: (props) => props.control === "inline" ? /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(InlineSearchRendererComponent_default, __spreadValues({}, props)) : /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(BlockSearchRendererComponent_default, __spreadValues({}, props))
11544
+ render: (props) => props.control === "inline" ? /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(InlineSearchRendererComponent_default, __spreadValues({}, props)) : /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(BlockSearchRendererComponent_default, __spreadValues({}, props))
11670
11545
  };
11671
11546
  var SearchRenderer_default = SearchRenderer;
11672
11547
 
11673
11548
  // src/revamp/wise/renderers/SelectInputRenderer/RadioInputRendererComponent.tsx
11674
- var import_components29 = require("@transferwise/components");
11549
+ var import_components27 = require("@transferwise/components");
11675
11550
 
11676
11551
  // src/revamp/wise/renderers/SelectInputRenderer/OptionMedia.tsx
11677
- var import_components28 = require("@transferwise/components");
11678
- var import_jsx_runtime46 = require("react/jsx-runtime");
11552
+ var import_components26 = require("@transferwise/components");
11553
+ var import_jsx_runtime43 = require("react/jsx-runtime");
11679
11554
  function OptionMedia({ icon, image }) {
11680
11555
  if (image == null ? void 0 : image.url) {
11681
- return /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("img", { src: image.url, alt: image.accessibilityDescription || "", width: "64px" });
11556
+ return /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("img", { src: image.url, alt: image.accessibilityDescription || "", width: "64px" });
11682
11557
  }
11683
11558
  if (icon && "name" in icon) {
11684
- return /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_components28.Avatar, { type: import_components28.AvatarType.ICON, children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(DynamicIcon_default, { name: icon.name }) });
11559
+ return /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(import_components26.Avatar, { type: import_components26.AvatarType.ICON, children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(DynamicIcon_default, { name: icon.name }) });
11685
11560
  }
11686
11561
  if (icon && "text" in icon) {
11687
- return /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_components28.Avatar, { type: import_components28.AvatarType.INITIALS, children: icon.text });
11562
+ return /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(import_components26.Avatar, { type: import_components26.AvatarType.INITIALS, children: icon.text });
11688
11563
  }
11689
11564
  return null;
11690
11565
  }
11691
11566
 
11692
11567
  // src/revamp/wise/renderers/SelectInputRenderer/RadioInputRendererComponent.tsx
11693
- var import_jsx_runtime47 = require("react/jsx-runtime");
11568
+ var import_jsx_runtime44 = require("react/jsx-runtime");
11694
11569
  function RadioInputRendererComponent(props) {
11695
11570
  const {
11696
11571
  id,
@@ -11704,9 +11579,9 @@ function RadioInputRendererComponent(props) {
11704
11579
  selectedIndex,
11705
11580
  onSelect
11706
11581
  } = props;
11707
- return /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(import_jsx_runtime47.Fragment, { children: [
11708
- /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(FieldInput_default, { id, label, help, description, error, children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("span", { children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
11709
- import_components29.RadioGroup,
11582
+ return /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(import_jsx_runtime44.Fragment, { children: [
11583
+ /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(FieldInput_default, { id, label, help, description, error, children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("span", { children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
11584
+ import_components27.RadioGroup,
11710
11585
  {
11711
11586
  name: id,
11712
11587
  radios: options.map((option, index) => ({
@@ -11714,7 +11589,7 @@ function RadioInputRendererComponent(props) {
11714
11589
  value: index,
11715
11590
  secondary: option.description,
11716
11591
  disabled: option.disabled || disabled,
11717
- avatar: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(OptionMedia, { icon: option.icon, image: option.image })
11592
+ avatar: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(OptionMedia, { icon: option.icon, image: option.image })
11718
11593
  })),
11719
11594
  selectedValue: selectedIndex != null ? selectedIndex : void 0,
11720
11595
  onChange: onSelect
@@ -11725,9 +11600,9 @@ function RadioInputRendererComponent(props) {
11725
11600
  }
11726
11601
 
11727
11602
  // src/revamp/wise/renderers/SelectInputRenderer/TabInputRendererComponent.tsx
11728
- var import_components30 = require("@transferwise/components");
11729
- var import_react18 = require("react");
11730
- var import_jsx_runtime48 = require("react/jsx-runtime");
11603
+ var import_components28 = require("@transferwise/components");
11604
+ var import_react16 = require("react");
11605
+ var import_jsx_runtime45 = require("react/jsx-runtime");
11731
11606
  function TabInputRendererComponent(props) {
11732
11607
  const {
11733
11608
  id,
@@ -11741,14 +11616,14 @@ function TabInputRendererComponent(props) {
11741
11616
  selectedIndex,
11742
11617
  onSelect
11743
11618
  } = props;
11744
- (0, import_react18.useEffect)(() => {
11619
+ (0, import_react16.useEffect)(() => {
11745
11620
  if (!isValidIndex(selectedIndex, options.length)) {
11746
11621
  onSelect(0);
11747
11622
  }
11748
11623
  }, [selectedIndex, onSelect, options.length]);
11749
- return /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(import_jsx_runtime48.Fragment, { children: [
11750
- /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(FieldInput_default, { id, label, help, description, error, children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
11751
- import_components30.Tabs,
11624
+ return /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(import_jsx_runtime45.Fragment, { children: [
11625
+ /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(FieldInput_default, { id, label, help, description, error, children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
11626
+ import_components28.Tabs,
11752
11627
  {
11753
11628
  name: id,
11754
11629
  selected: selectedIndex != null ? selectedIndex : 0,
@@ -11756,7 +11631,7 @@ function TabInputRendererComponent(props) {
11756
11631
  title: option.title,
11757
11632
  // if we pass null, we get some props-types console errors
11758
11633
  // eslint-disable-next-line react/jsx-no-useless-fragment
11759
- content: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_jsx_runtime48.Fragment, {}),
11634
+ content: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_jsx_runtime45.Fragment, {}),
11760
11635
  disabled: option.disabled || disabled
11761
11636
  })),
11762
11637
  onTabSelect: onSelect
@@ -11768,26 +11643,26 @@ function TabInputRendererComponent(props) {
11768
11643
  var isValidIndex = (index, options) => index !== null && index >= 0 && index < options;
11769
11644
 
11770
11645
  // src/revamp/wise/renderers/SelectInputRenderer/SelectInputRendererComponent.tsx
11771
- var import_components32 = require("@transferwise/components");
11646
+ var import_components30 = require("@transferwise/components");
11772
11647
 
11773
11648
  // src/revamp/wise/renderers/SelectInputRenderer/SelectTriggerMedia.tsx
11774
- var import_components31 = require("@transferwise/components");
11775
- var import_jsx_runtime49 = require("react/jsx-runtime");
11649
+ var import_components29 = require("@transferwise/components");
11650
+ var import_jsx_runtime46 = require("react/jsx-runtime");
11776
11651
  function SelectTriggerMedia({ icon, image }) {
11777
11652
  if (image == null ? void 0 : image.url) {
11778
11653
  return null;
11779
11654
  }
11780
11655
  if (icon && "name" in icon) {
11781
- return /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_components31.Avatar, { type: import_components31.AvatarType.ICON, size: 24, children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(DynamicIcon_default, { name: icon.name }) });
11656
+ return /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_components29.Avatar, { type: import_components29.AvatarType.ICON, size: 24, children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(DynamicIcon_default, { name: icon.name }) });
11782
11657
  }
11783
11658
  if (icon && "text" in icon) {
11784
- return /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_components31.Avatar, { type: import_components31.AvatarType.ICON, size: 24, children: icon.text });
11659
+ return /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_components29.Avatar, { type: import_components29.AvatarType.ICON, size: 24, children: icon.text });
11785
11660
  }
11786
11661
  return null;
11787
11662
  }
11788
11663
 
11789
11664
  // src/revamp/wise/renderers/SelectInputRenderer/SelectInputRendererComponent.tsx
11790
- var import_jsx_runtime50 = require("react/jsx-runtime");
11665
+ var import_jsx_runtime47 = require("react/jsx-runtime");
11791
11666
  function SelectInputRendererComponent(props) {
11792
11667
  const {
11793
11668
  id,
@@ -11821,17 +11696,17 @@ function SelectInputRendererComponent(props) {
11821
11696
  const contentProps = withinTrigger ? {
11822
11697
  title: option.title,
11823
11698
  note: option.description,
11824
- icon: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(SelectTriggerMedia, { icon: option.icon, image: option.image })
11699
+ icon: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(SelectTriggerMedia, { icon: option.icon, image: option.image })
11825
11700
  } : {
11826
11701
  title: option.title,
11827
11702
  description: option.description,
11828
- icon: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(OptionMedia, { icon: option.icon, image: option.image })
11703
+ icon: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(OptionMedia, { icon: option.icon, image: option.image })
11829
11704
  };
11830
- return /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(import_components32.SelectInputOptionContent, __spreadValues({}, contentProps));
11705
+ return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_components30.SelectInputOptionContent, __spreadValues({}, contentProps));
11831
11706
  };
11832
- return /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)(import_jsx_runtime50.Fragment, { children: [
11833
- /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(FieldInput_default, { id, label, help, description, error, children: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
11834
- import_components32.SelectInput,
11707
+ return /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(import_jsx_runtime47.Fragment, { children: [
11708
+ /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(FieldInput_default, { id, label, help, description, error, children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
11709
+ import_components30.SelectInput,
11835
11710
  {
11836
11711
  name: id,
11837
11712
  placeholder,
@@ -11849,36 +11724,36 @@ function SelectInputRendererComponent(props) {
11849
11724
  }
11850
11725
 
11851
11726
  // src/revamp/wise/renderers/SelectInputRenderer/SelectInputRenderer.tsx
11852
- var import_jsx_runtime51 = require("react/jsx-runtime");
11727
+ var import_jsx_runtime48 = require("react/jsx-runtime");
11853
11728
  var SelectInputRenderer = {
11854
11729
  canRenderType: "input-select",
11855
11730
  render: (props) => {
11856
11731
  switch (props.control) {
11857
11732
  case "radio":
11858
- return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(RadioInputRendererComponent, __spreadValues({}, props));
11733
+ return /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(RadioInputRendererComponent, __spreadValues({}, props));
11859
11734
  case "tab":
11860
- return props.options.length > 3 ? /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(SelectInputRendererComponent, __spreadValues({}, props)) : /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(TabInputRendererComponent, __spreadValues({}, props));
11735
+ return props.options.length > 3 ? /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(SelectInputRendererComponent, __spreadValues({}, props)) : /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(TabInputRendererComponent, __spreadValues({}, props));
11861
11736
  case "select":
11862
11737
  default:
11863
- return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(SelectInputRendererComponent, __spreadValues({}, props));
11738
+ return /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(SelectInputRendererComponent, __spreadValues({}, props));
11864
11739
  }
11865
11740
  }
11866
11741
  };
11867
11742
  var SelectInputRenderer_default = SelectInputRenderer;
11868
11743
 
11869
11744
  // src/revamp/wise/renderers/StatusListRenderer.tsx
11870
- var import_components33 = require("@transferwise/components");
11871
- var import_jsx_runtime52 = require("react/jsx-runtime");
11745
+ var import_components31 = require("@transferwise/components");
11746
+ var import_jsx_runtime49 = require("react/jsx-runtime");
11872
11747
  var StatusListRenderer = {
11873
11748
  canRenderType: "status-list",
11874
- render: ({ margin, items, title }) => /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("div", { className: getMargin(margin), children: [
11875
- title ? /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(import_components33.Header, { title }) : null,
11876
- items.map(({ description, icon, status, title: itemTitle }) => /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
11877
- import_components33.Summary,
11749
+ render: ({ margin, items, title }) => /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("div", { className: getMargin(margin), children: [
11750
+ title ? /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_components31.Header, { title }) : null,
11751
+ items.map(({ description, icon, status, title: itemTitle }) => /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
11752
+ import_components31.Summary,
11878
11753
  {
11879
11754
  title: itemTitle,
11880
11755
  description,
11881
- icon: icon && "name" in icon ? /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(DynamicIcon_default, { name: icon.name }) : null,
11756
+ icon: icon && "name" in icon ? /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(DynamicIcon_default, { name: icon.name }) : null,
11882
11757
  status: mapStatus(status)
11883
11758
  },
11884
11759
  `${title}/${description || ""}`
@@ -11894,63 +11769,63 @@ var mapStatus = (status) => {
11894
11769
  };
11895
11770
 
11896
11771
  // src/revamp/wise/renderers/components/VariableTextInput.tsx
11897
- var import_components34 = require("@transferwise/components");
11898
- var import_jsx_runtime53 = require("react/jsx-runtime");
11772
+ var import_components32 = require("@transferwise/components");
11773
+ var import_jsx_runtime50 = require("react/jsx-runtime");
11899
11774
  function VariableTextInput({
11900
11775
  control,
11901
11776
  inputProps
11902
11777
  }) {
11903
11778
  switch (control) {
11904
11779
  case "password":
11905
- return /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(TextInput, __spreadValues({ type: "password" }, inputProps));
11780
+ return /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(TextInput, __spreadValues({ type: "password" }, inputProps));
11906
11781
  case "email":
11907
- return /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(TextInput, __spreadValues({ type: "email" }, inputProps));
11782
+ return /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(TextInput, __spreadValues({ type: "email" }, inputProps));
11908
11783
  case "textarea":
11909
- return /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(TextAreaInput, __spreadValues({}, inputProps));
11784
+ return /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(TextAreaInput, __spreadValues({}, inputProps));
11910
11785
  case "numeric":
11911
- return /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(NumericInput, __spreadValues({ type: "number" }, inputProps));
11786
+ return /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(NumericInput, __spreadValues({ type: "number" }, inputProps));
11912
11787
  case "phone-number":
11913
- return /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(PhoneNumberInput, __spreadValues({}, inputProps));
11788
+ return /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(PhoneNumberInput, __spreadValues({}, inputProps));
11914
11789
  default:
11915
- return /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(TextInput, __spreadValues({ type: "text" }, inputProps));
11790
+ return /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(TextInput, __spreadValues({ type: "text" }, inputProps));
11916
11791
  }
11917
11792
  }
11918
11793
  function TextInput(_a) {
11919
11794
  var _b = _a, { id, displayFormat, onChange } = _b, rest = __objRest(_b, ["id", "displayFormat", "onChange"]);
11920
11795
  if (typeof displayFormat === "string") {
11921
11796
  const inputProps = __spreadValues({ id, name: id, className: "form-control" }, rest);
11922
- return /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
11923
- import_components34.InputWithDisplayFormat,
11797
+ return /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
11798
+ import_components32.InputWithDisplayFormat,
11924
11799
  __spreadValues({
11925
11800
  displayPattern: displayFormat,
11926
11801
  onChange: (newValue) => onChange(newValue)
11927
11802
  }, inputProps)
11928
11803
  );
11929
11804
  }
11930
- return /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(import_components34.Input, __spreadValues({ id, name: id, onChange: (e) => onChange(e.target.value) }, rest));
11805
+ return /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(import_components32.Input, __spreadValues({ id, name: id, onChange: (e) => onChange(e.target.value) }, rest));
11931
11806
  }
11932
11807
  function TextAreaInput(_a) {
11933
11808
  var _b = _a, { id, displayFormat, onChange } = _b, rest = __objRest(_b, ["id", "displayFormat", "onChange"]);
11934
11809
  const textAreaProps = __spreadValues({ id, name: id }, rest);
11935
- return typeof displayFormat === "string" ? /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
11936
- import_components34.TextareaWithDisplayFormat,
11810
+ return typeof displayFormat === "string" ? /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
11811
+ import_components32.TextareaWithDisplayFormat,
11937
11812
  __spreadValues({
11938
11813
  displayPattern: displayFormat,
11939
11814
  onChange: (newValue) => onChange(newValue)
11940
11815
  }, textAreaProps)
11941
- ) : /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(import_components34.TextArea, __spreadValues({ onChange: (e) => onChange(e.target.value) }, textAreaProps));
11816
+ ) : /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(import_components32.TextArea, __spreadValues({ onChange: (e) => onChange(e.target.value) }, textAreaProps));
11942
11817
  }
11943
11818
  function NumericInput(_a) {
11944
11819
  var _b = _a, { id, displayFormat, onChange } = _b, rest = __objRest(_b, ["id", "displayFormat", "onChange"]);
11945
11820
  const numericProps = __spreadValues({ id, name: id, onWheel }, rest);
11946
- return typeof displayFormat === "string" ? /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
11947
- import_components34.InputWithDisplayFormat,
11821
+ return typeof displayFormat === "string" ? /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
11822
+ import_components32.InputWithDisplayFormat,
11948
11823
  __spreadValues({
11949
11824
  displayPattern: displayFormat,
11950
11825
  onChange: (newValue) => onChange(numericValueOrNull(newValue))
11951
11826
  }, numericProps)
11952
- ) : /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
11953
- import_components34.Input,
11827
+ ) : /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
11828
+ import_components32.Input,
11954
11829
  __spreadValues({
11955
11830
  onChange: ({ target: { value: newValue } }) => onChange(numericValueOrNull(newValue))
11956
11831
  }, numericProps)
@@ -11958,12 +11833,12 @@ function NumericInput(_a) {
11958
11833
  }
11959
11834
  function PhoneNumberInput(_a) {
11960
11835
  var _b = _a, { value } = _b, rest = __objRest(_b, ["value"]);
11961
- return /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(import_components34.PhoneNumberInput, __spreadValues({ initialValue: value }, rest));
11836
+ return /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(import_components32.PhoneNumberInput, __spreadValues({ initialValue: value }, rest));
11962
11837
  }
11963
11838
  var VariableTextInput_default = VariableTextInput;
11964
11839
 
11965
11840
  // src/revamp/wise/renderers/TextInputRenderer.tsx
11966
- var import_jsx_runtime54 = require("react/jsx-runtime");
11841
+ var import_jsx_runtime51 = require("react/jsx-runtime");
11967
11842
  var TextInputRenderer = {
11968
11843
  canRenderType: "input-text",
11969
11844
  render: (props) => {
@@ -11988,14 +11863,14 @@ var TextInputRenderer = {
11988
11863
  ]);
11989
11864
  const value = initialValue != null ? initialValue : "";
11990
11865
  const inputProps = __spreadProps(__spreadValues({}, rest), { value, id });
11991
- return /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(FieldInput_default, { id, label, description, error, help, children: /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(VariableTextInput_default, { control, inputProps }) });
11866
+ return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(FieldInput_default, { id, label, description, error, help, children: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(VariableTextInput_default, { control, inputProps }) });
11992
11867
  }
11993
11868
  };
11994
11869
  var TextInputRenderer_default = TextInputRenderer;
11995
11870
 
11996
11871
  // src/revamp/wise/renderers/UploadInputRenderer.tsx
11997
- var import_components35 = require("@transferwise/components");
11998
- var import_jsx_runtime55 = require("react/jsx-runtime");
11872
+ var import_components33 = require("@transferwise/components");
11873
+ var import_jsx_runtime52 = require("react/jsx-runtime");
11999
11874
  var UploadInputRenderer = {
12000
11875
  canRenderType: "input-upload",
12001
11876
  render: (props) => {
@@ -12011,8 +11886,8 @@ var UploadInputRenderer = {
12011
11886
  };
12012
11887
  return (
12013
11888
  // We don't pass help here as there is no sensible place to display it
12014
- /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(UploadFieldInput_default, { id, label: void 0, description: void 0, error, children: /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
12015
- import_components35.UploadInput,
11889
+ /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(UploadFieldInput_default, { id, label: void 0, description: void 0, error, children: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
11890
+ import_components33.UploadInput,
12016
11891
  {
12017
11892
  id,
12018
11893
  description,
@@ -12066,8 +11941,8 @@ var LargeUploadRenderer = {
12066
11941
  throw e;
12067
11942
  }
12068
11943
  };
12069
- return /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(FieldInput_default, { id, label, description, error, help, children: /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
12070
- import_components35.Upload,
11944
+ return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(FieldInput_default, { id, label, description, error, help, children: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
11945
+ import_components33.Upload,
12071
11946
  __spreadProps(__spreadValues({}, uploadProps), {
12072
11947
  usAccept: getAcceptsString(accepts),
12073
11948
  usDisabled: disabled,
@@ -12080,8 +11955,8 @@ var LargeUploadRenderer = {
12080
11955
  };
12081
11956
 
12082
11957
  // src/revamp/wise/renderers/ReviewRenderer.tsx
12083
- var import_components36 = require("@transferwise/components");
12084
- var import_jsx_runtime56 = require("react/jsx-runtime");
11958
+ var import_components34 = require("@transferwise/components");
11959
+ var import_jsx_runtime53 = require("react/jsx-runtime");
12085
11960
  var ReviewRenderer = {
12086
11961
  canRenderType: "review",
12087
11962
  render: ({ callToAction, control, fields, margin, title }) => {
@@ -12093,10 +11968,10 @@ var ReviewRenderer = {
12093
11968
  callToAction.onClick();
12094
11969
  }
12095
11970
  } : void 0;
12096
- return /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("div", { className: getMargin(margin), children: [
12097
- (title || callToAction) && /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(import_components36.Header, { title: title != null ? title : "", action }),
12098
- /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("div", { className: margin, children: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
12099
- import_components36.DefinitionList,
11971
+ return /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("div", { className: getMargin(margin), children: [
11972
+ (title || callToAction) && /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(import_components34.Header, { title: title != null ? title : "", action }),
11973
+ /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("div", { className: margin, children: /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
11974
+ import_components34.DefinitionList,
12100
11975
  {
12101
11976
  layout: orientation,
12102
11977
  definitions: fields.map(({ label, value, help }, index) => ({
@@ -12112,19 +11987,147 @@ var ReviewRenderer = {
12112
11987
  var ReviewRenderer_default = ReviewRenderer;
12113
11988
  var getFieldValue = (value, help, orientation) => {
12114
11989
  if (help) {
12115
- return orientation === "HORIZONTAL_RIGHT_ALIGNED" ? /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(import_jsx_runtime56.Fragment, { children: [
12116
- /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(Help_default, { help }),
11990
+ return orientation === "HORIZONTAL_RIGHT_ALIGNED" ? /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)(import_jsx_runtime53.Fragment, { children: [
11991
+ /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(Help_default, { help }),
12117
11992
  " ",
12118
11993
  value
12119
- ] }) : /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(import_jsx_runtime56.Fragment, { children: [
11994
+ ] }) : /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)(import_jsx_runtime53.Fragment, { children: [
12120
11995
  value,
12121
11996
  " ",
12122
- /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(Help_default, { help })
11997
+ /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(Help_default, { help })
12123
11998
  ] });
12124
11999
  }
12125
12000
  return value;
12126
12001
  };
12127
12002
 
12003
+ // src/revamp/wise/renderers/step/StepRenderer.tsx
12004
+ var import_react18 = require("react");
12005
+
12006
+ // src/revamp/wise/renderers/step/ExternalConfirmationDialog.tsx
12007
+ var import_react_intl15 = require("react-intl");
12008
+
12009
+ // src/common/messages/external-confirmation.messages.ts
12010
+ var import_react_intl14 = require("react-intl");
12011
+ var external_confirmation_messages_default = (0, import_react_intl14.defineMessages)({
12012
+ title: {
12013
+ id: "dynamicFlows.ExternalConfirmation.title",
12014
+ defaultMessage: "Please confirm",
12015
+ description: "Heading for the confirmation screen."
12016
+ },
12017
+ description: {
12018
+ id: "dynamicFlows.ExternalConfirmation.description",
12019
+ defaultMessage: "Please confirm you want to open **{origin}** in a new browser tab.",
12020
+ description: "Description for the confirmation screen."
12021
+ },
12022
+ open: {
12023
+ id: "dynamicFlows.ExternalConfirmation.open",
12024
+ defaultMessage: "Open in new tab",
12025
+ description: "Button text confirming opening a new browser tab."
12026
+ },
12027
+ cancel: {
12028
+ id: "dynamicFlows.ExternalConfirmation.cancel",
12029
+ defaultMessage: "Cancel",
12030
+ description: "Button text rejecting opening a new browser tab."
12031
+ }
12032
+ });
12033
+
12034
+ // src/revamp/wise/renderers/step/ExternalConfirmationDialog.tsx
12035
+ var import_components35 = require("@transferwise/components");
12036
+ var import_jsx_runtime54 = require("react/jsx-runtime");
12037
+ function ExternalConfirmationDialog({
12038
+ external,
12039
+ onClose
12040
+ }) {
12041
+ const { formatMessage } = (0, import_react_intl15.useIntl)();
12042
+ return /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("div", { className: "df-box-renderer-fixed-width", children: /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("div", { className: "df-box-renderer-width-lg", children: [
12043
+ /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("h2", { className: "text-xs-center m-b-5", children: formatMessage(external_confirmation_messages_default.title) }),
12044
+ /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(import_components35.Markdown, { config: { link: { target: "_blank" } }, className: "text-xs-center m-b-5", children: formatMessage(external_confirmation_messages_default.description, { origin: getOrigin(external.url) }) }),
12045
+ /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("div", { className: "df-box-renderer-fixed-width", children: /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("div", { className: "df-box-renderer-width-lg", children: [
12046
+ /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
12047
+ import_components35.Button,
12048
+ {
12049
+ block: true,
12050
+ className: "m-b-2",
12051
+ priority: "primary",
12052
+ size: "md",
12053
+ onClick: () => {
12054
+ window.open(external.url);
12055
+ onClose();
12056
+ },
12057
+ children: formatMessage(external_confirmation_messages_default.open)
12058
+ }
12059
+ ),
12060
+ /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(import_components35.Button, { block: true, className: "m-b-2", priority: "tertiary", size: "md", onClick: onClose, children: formatMessage(external_confirmation_messages_default.cancel) })
12061
+ ] }) })
12062
+ ] }) });
12063
+ }
12064
+ function getOrigin(url) {
12065
+ try {
12066
+ return new URL(url).origin;
12067
+ } catch (e) {
12068
+ return url;
12069
+ }
12070
+ }
12071
+
12072
+ // src/revamp/wise/renderers/step/useExternal.tsx
12073
+ var import_react17 = require("react");
12074
+ function useExternal(url) {
12075
+ const [externalWindow, setExternalWindow] = (0, import_react17.useState)(null);
12076
+ const [hasDismissed, setHasDismissed] = (0, import_react17.useState)(false);
12077
+ const dismissConfirmation = () => setHasDismissed(true);
12078
+ (0, import_react17.useEffect)(() => {
12079
+ if (url) {
12080
+ setHasDismissed(false);
12081
+ setExternalWindow(window.open(url, "_blank"));
12082
+ }
12083
+ }, [url]);
12084
+ const requiresUserConfirmation = Boolean(url && !externalWindow && !hasDismissed);
12085
+ return { requiresUserConfirmation, dismissConfirmation };
12086
+ }
12087
+
12088
+ // src/revamp/wise/renderers/step/BackButton.tsx
12089
+ var import_components36 = require("@transferwise/components");
12090
+ var import_icons3 = require("@transferwise/icons");
12091
+ var import_jsx_runtime55 = require("react/jsx-runtime");
12092
+ function BackButton({ title, onClick }) {
12093
+ return /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)(
12094
+ "a",
12095
+ {
12096
+ href: "/",
12097
+ className: "df-back-btn",
12098
+ "aria-label": title,
12099
+ onClick: (event) => {
12100
+ event.preventDefault();
12101
+ onClick();
12102
+ },
12103
+ children: [
12104
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("span", { className: "sr-only", children: title }),
12105
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(import_components36.Avatar, { type: "icon", children: /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(import_icons3.ArrowLeft, { size: "24" }) })
12106
+ ]
12107
+ }
12108
+ );
12109
+ }
12110
+ var BackButton_default = BackButton;
12111
+
12112
+ // src/revamp/wise/renderers/step/StepRenderer.tsx
12113
+ var import_jsx_runtime56 = require("react/jsx-runtime");
12114
+ var StepRenderer = {
12115
+ canRenderType: "step",
12116
+ render: StepRendererComponent
12117
+ };
12118
+ function StepRendererComponent(props) {
12119
+ const { back, loadingState, external, trackEvent, children } = props;
12120
+ const value = (0, import_react18.useMemo)(() => ({ loadingState, trackEvent }), [loadingState, trackEvent]);
12121
+ const { requiresUserConfirmation, dismissConfirmation } = useExternal(external == null ? void 0 : external.url);
12122
+ if ((external == null ? void 0 : external.url) && requiresUserConfirmation) {
12123
+ return /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(ExternalConfirmationDialog, { external, onClose: dismissConfirmation });
12124
+ }
12125
+ return /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(StepRendererContextProvider, { value, children: [
12126
+ back ? /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(BackButton_default, __spreadValues({}, back)) : null,
12127
+ children
12128
+ ] });
12129
+ }
12130
+
12128
12131
  // src/revamp/wise/renderers/getWiseRenderers.ts
12129
12132
  var getWiseRenderers = () => [
12130
12133
  AlertRenderer_default,
@@ -12154,7 +12157,8 @@ var getWiseRenderers = () => [
12154
12157
  SelectInputRenderer_default,
12155
12158
  StatusListRenderer_default,
12156
12159
  TextInputRenderer_default,
12157
- UploadInputRenderer
12160
+ UploadInputRenderer,
12161
+ StepRenderer
12158
12162
  ];
12159
12163
 
12160
12164
  // src/revamp/DynamicFlowWise.tsx
@@ -12162,19 +12166,10 @@ var import_jsx_runtime57 = require("react/jsx-runtime");
12162
12166
  var wiseRenderers = getWiseRenderers();
12163
12167
  function DynamicFlowWise(props) {
12164
12168
  const { httpClient, renderers } = props;
12165
- const { locale } = (0, import_react_intl16.useIntl)();
12166
- const wiseHttpClient = (0, import_react19.useMemo)(
12167
- () => makeWiseHttpClient(httpClient, locale),
12168
- [httpClient, locale]
12169
- );
12170
12169
  const mergedRenderers = (0, import_react19.useMemo)(() => [...renderers != null ? renderers : [], ...wiseRenderers], [renderers]);
12171
- return /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(HttpClientProvider, { httpClient: wiseHttpClient, children: /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(DynamicFlowCore, __spreadProps(__spreadValues({}, props), { renderers: mergedRenderers })) });
12170
+ return /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(HttpClientProvider, { httpClient, children: /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(DynamicFlowCore, __spreadProps(__spreadValues({}, props), { renderers: mergedRenderers })) });
12172
12171
  }
12173
12172
  var DynamicFlowWise_default = DynamicFlowWise;
12174
- var makeWiseHttpClient = (httpClient, locale) => async (input, init) => httpClient(
12175
- input,
12176
- mergeRequestInit(init, { credentials: "include", headers: { "accept-language": locale } })
12177
- );
12178
12173
 
12179
12174
  // src/revamp/DynamicFragmentWise.tsx
12180
12175
  var import_react20 = require("react");
@@ -12522,7 +12517,6 @@ function isReference(block) {
12522
12517
 
12523
12518
  // src/legacy/dynamicFlow/DynamicFlow.tsx
12524
12519
  var import_react64 = require("react");
12525
- var import_react_intl39 = require("react-intl");
12526
12520
 
12527
12521
  // src/legacy/common/contexts/dynamicFlowContexts/DynamicFlowContexts.tsx
12528
12522
  var import_react22 = require("react");
@@ -13443,11 +13437,11 @@ function useExternalStepPolling(polling, onAction) {
13443
13437
 
13444
13438
  // src/legacy/common/hooks/usePersistAsync/usePersistAsync.ts
13445
13439
  var import_react52 = require("react");
13446
- var import_react_intl32 = require("react-intl");
13440
+ var import_react_intl31 = require("react-intl");
13447
13441
 
13448
13442
  // src/legacy/jsonSchemaForm/persistAsyncSchema/persistAsyncBasicSchema/PersistAsyncBasicSchema.tsx
13449
13443
  var import_react51 = require("react");
13450
- var import_react_intl31 = require("react-intl");
13444
+ var import_react_intl30 = require("react-intl");
13451
13445
 
13452
13446
  // src/legacy/common/constants/DateMode.ts
13453
13447
  var DateMode = {
@@ -13843,11 +13837,11 @@ var DynamicDivider_default = DynamicDivider;
13843
13837
  // src/legacy/layout/external/DynamicExternal.tsx
13844
13838
  var import_components41 = require("@transferwise/components");
13845
13839
  var import_react29 = require("react");
13846
- var import_react_intl18 = require("react-intl");
13840
+ var import_react_intl17 = require("react-intl");
13847
13841
 
13848
13842
  // src/legacy/layout/external/DynamicExternal.messages.ts
13849
- var import_react_intl17 = require("react-intl");
13850
- var DynamicExternal_messages_default = (0, import_react_intl17.defineMessages)({
13843
+ var import_react_intl16 = require("react-intl");
13844
+ var DynamicExternal_messages_default = (0, import_react_intl16.defineMessages)({
13851
13845
  retryTitle: {
13852
13846
  id: "dynamicFlows.DynamicExternal.retryTitle",
13853
13847
  defaultMessage: "Reopen window",
@@ -13859,7 +13853,7 @@ var DynamicExternal_messages_default = (0, import_react_intl17.defineMessages)({
13859
13853
  var import_jsx_runtime73 = require("react/jsx-runtime");
13860
13854
  var DynamicExternal = ({ component, onAction }) => {
13861
13855
  const { requestUrl, responseHandlers, polling, retryTitle } = component;
13862
- const intl = (0, import_react_intl18.useIntl)();
13856
+ const intl = (0, import_react_intl17.useIntl)();
13863
13857
  const openExternalUrl = (0, import_react29.useCallback)(
13864
13858
  () => window.open(requestUrl, "df-external-window"),
13865
13859
  [requestUrl]
@@ -13938,7 +13932,7 @@ var import_react31 = require("react");
13938
13932
  // src/legacy/jsonSchemaForm/controlFeedback/ControlFeedback.tsx
13939
13933
  var import_components43 = require("@transferwise/components");
13940
13934
  var import_formatting2 = require("@transferwise/formatting");
13941
- var import_react_intl19 = require("react-intl");
13935
+ var import_react_intl18 = require("react-intl");
13942
13936
  var import_jsx_runtime75 = require("react/jsx-runtime");
13943
13937
  function ControlFeedback(props) {
13944
13938
  var _a;
@@ -13964,7 +13958,7 @@ ControlFeedback.defaultProps = {
13964
13958
  validationAsyncSuccessMessage: null
13965
13959
  };
13966
13960
  function useDefaultValidationMessages(schema) {
13967
- const { formatMessage, locale } = (0, import_react_intl19.useIntl)();
13961
+ const { formatMessage, locale } = (0, import_react_intl18.useIntl)();
13968
13962
  const formattedMessages = {
13969
13963
  type: formatMessage(validation_messages_default.type),
13970
13964
  minimum: formatMessage(validation_messages_default.minimum, {
@@ -14051,11 +14045,11 @@ function constructUploadError(response) {
14051
14045
  }
14052
14046
 
14053
14047
  // src/legacy/jsonSchemaForm/arrayTypeSchema/arrayListSchema/multipleFileUploadSchema/utils/useFormattedDefaultErrorMessages.tsx
14054
- var import_react_intl21 = require("react-intl");
14048
+ var import_react_intl20 = require("react-intl");
14055
14049
 
14056
14050
  // src/legacy/common/messages.ts
14057
- var import_react_intl20 = require("react-intl");
14058
- var messages_default = (0, import_react_intl20.defineMessages)({
14051
+ var import_react_intl19 = require("react-intl");
14052
+ var messages_default = (0, import_react_intl19.defineMessages)({
14059
14053
  required: {
14060
14054
  id: "dynamicFlows.DefaultErrorMessages.required",
14061
14055
  defaultMessage: "Please fill out this field.",
@@ -14068,7 +14062,7 @@ function useFormattedDefaultErrorMessages({
14068
14062
  maxItems,
14069
14063
  minItems
14070
14064
  }) {
14071
- const { formatMessage } = (0, import_react_intl21.useIntl)();
14065
+ const { formatMessage } = (0, import_react_intl20.useIntl)();
14072
14066
  const { maxFileSizeError, maxItemsError, minItemsError } = multi_file_upload_messages_default;
14073
14067
  return {
14074
14068
  maxFileSizeErrorMessage: formatMessage(maxFileSizeError),
@@ -14188,7 +14182,7 @@ function getValidationMessages(schema, required, defaultErrorMessages) {
14188
14182
  var import_components46 = require("@transferwise/components");
14189
14183
  var import_classnames9 = __toESM(require_classnames());
14190
14184
  var import_react32 = require("react");
14191
- var import_react_intl23 = require("react-intl");
14185
+ var import_react_intl22 = require("react-intl");
14192
14186
 
14193
14187
  // src/legacy/jsonSchemaForm/schemaFormControl/utils/mapping-utils.tsx
14194
14188
  var import_components45 = require("@transferwise/components");
@@ -14282,8 +14276,8 @@ var getDisabled = (disabled) => {
14282
14276
  };
14283
14277
 
14284
14278
  // src/common/messages/multi-select.messages.ts
14285
- var import_react_intl22 = require("react-intl");
14286
- var multi_select_messages_default = (0, import_react_intl22.defineMessages)({
14279
+ var import_react_intl21 = require("react-intl");
14280
+ var multi_select_messages_default = (0, import_react_intl21.defineMessages)({
14287
14281
  summary: {
14288
14282
  id: "dynamicFlows.MultiSelect.summary",
14289
14283
  defaultMessage: "{first} and {count} more",
@@ -14301,7 +14295,7 @@ function MultiSelectSchema({
14301
14295
  errors,
14302
14296
  onChange
14303
14297
  }) {
14304
- const { formatMessage, locale } = (0, import_react_intl23.useIntl)();
14298
+ const { formatMessage, locale } = (0, import_react_intl22.useIntl)();
14305
14299
  const { disabled, items, validationMessages, placeholder } = schema;
14306
14300
  const options = items.oneOf.map((item) => mapConstSchemaToOption(item, "select"));
14307
14301
  const id = (0, import_react32.useMemo)(() => schema.$id || generateRandomId(), [schema.$id]);
@@ -14397,7 +14391,7 @@ var getInitialModelIndices = (model, options) => {
14397
14391
  var import_components48 = require("@transferwise/components");
14398
14392
  var import_icons4 = require("@transferwise/icons");
14399
14393
  var import_react34 = require("react");
14400
- var import_react_intl25 = require("react-intl");
14394
+ var import_react_intl24 = require("react-intl");
14401
14395
 
14402
14396
  // src/legacy/jsonSchemaForm/arrayTypeSchema/arrayListSchema/repeatableSchema/ItemSummary.tsx
14403
14397
  var import_components47 = require("@transferwise/components");
@@ -14417,7 +14411,7 @@ function ItemSummaryOption2({ item, onClick }) {
14417
14411
 
14418
14412
  // src/legacy/jsonSchemaForm/arrayTypeSchema/arrayListSchema/repeatableSchema/RepeatableSchemaStep.tsx
14419
14413
  var import_react33 = require("react");
14420
- var import_react_intl24 = require("react-intl");
14414
+ var import_react_intl23 = require("react-intl");
14421
14415
  var import_jsx_runtime80 = require("react/jsx-runtime");
14422
14416
  function RepeatableSchemaStep({
14423
14417
  type,
@@ -14428,7 +14422,7 @@ function RepeatableSchemaStep({
14428
14422
  onModelChange,
14429
14423
  onAction
14430
14424
  }) {
14431
- const { formatMessage } = (0, import_react_intl24.useIntl)();
14425
+ const { formatMessage } = (0, import_react_intl23.useIntl)();
14432
14426
  const [filename, setFilename] = (0, import_react33.useState)(void 0);
14433
14427
  const step = {
14434
14428
  layout: [
@@ -14735,7 +14729,7 @@ function RepeatableSchema({
14735
14729
  setEditableItem({ item: null, model: null });
14736
14730
  setOpenModalType(null);
14737
14731
  };
14738
- const { formatMessage } = (0, import_react_intl25.useIntl)();
14732
+ const { formatMessage } = (0, import_react_intl24.useIntl)();
14739
14733
  const validations = getValidationFailures(model, schema, required);
14740
14734
  const base64ValidationMessages = useFormattedDefaultErrorMessages({
14741
14735
  minItems: schema.minItems,
@@ -14951,10 +14945,10 @@ var import_react38 = require("react");
14951
14945
 
14952
14946
  // src/legacy/jsonSchemaForm/help/Help.tsx
14953
14947
  var import_components50 = require("@transferwise/components");
14954
- var import_react_intl26 = require("react-intl");
14948
+ var import_react_intl25 = require("react-intl");
14955
14949
  var import_jsx_runtime85 = require("react/jsx-runtime");
14956
14950
  function Help2(props) {
14957
- const intl = (0, import_react_intl26.useIntl)();
14951
+ const intl = (0, import_react_intl25.useIntl)();
14958
14952
  return /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
14959
14953
  import_components50.Info,
14960
14954
  {
@@ -16185,11 +16179,11 @@ var PromotedOneOfSchema_default = PromotedOneOfSchema;
16185
16179
 
16186
16180
  // src/legacy/jsonSchemaForm/readOnlySchema/ReadOnlySchema.tsx
16187
16181
  var import_components56 = require("@transferwise/components");
16188
- var import_react_intl28 = require("react-intl");
16182
+ var import_react_intl27 = require("react-intl");
16189
16183
 
16190
16184
  // src/legacy/jsonSchemaForm/readOnlySchema/ReadOnlySchema.messages.ts
16191
- var import_react_intl27 = require("react-intl");
16192
- var ReadOnlySchema_messages_default = (0, import_react_intl27.defineMessages)({
16185
+ var import_react_intl26 = require("react-intl");
16186
+ var ReadOnlySchema_messages_default = (0, import_react_intl26.defineMessages)({
16193
16187
  yes: {
16194
16188
  id: "dynamicFlows.ReadOnlySchema.yes",
16195
16189
  defaultMessage: "Yes",
@@ -16206,7 +16200,7 @@ var ReadOnlySchema_messages_default = (0, import_react_intl27.defineMessages)({
16206
16200
  var import_jsx_runtime96 = require("react/jsx-runtime");
16207
16201
  function ReadOnlySchema({ schema, model }) {
16208
16202
  const { title = "" } = schema;
16209
- const { formatMessage } = (0, import_react_intl28.useIntl)();
16203
+ const { formatMessage } = (0, import_react_intl27.useIntl)();
16210
16204
  const value = getValueForSchema({ schema, model, formatMessage });
16211
16205
  return /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(import_components56.DefinitionList, { layout: import_components56.Layout.VERTICAL_ONE_COLUMN, definitions: [{ title, value, key: "" }] });
16212
16206
  }
@@ -16707,7 +16701,7 @@ var DynamicLoadingIndicator_default = DynamicLoadingIndicator;
16707
16701
 
16708
16702
  // src/legacy/layout/paragraph/DynamicParagraph.tsx
16709
16703
  var import_components64 = require("@transferwise/components");
16710
- var import_react_intl29 = require("react-intl");
16704
+ var import_react_intl28 = require("react-intl");
16711
16705
 
16712
16706
  // src/legacy/layout/paragraph/useSnackBarIfAvailable.ts
16713
16707
  var import_components63 = require("@transferwise/components");
@@ -16732,7 +16726,7 @@ function BasicDynamicParagraph({ component }) {
16732
16726
  ] });
16733
16727
  }
16734
16728
  function CopyableDynamicParagraph({ component }) {
16735
- const { formatMessage } = (0, import_react_intl29.useIntl)();
16729
+ const { formatMessage } = (0, import_react_intl28.useIntl)();
16736
16730
  const createSnackbar = useSnackBarIfAvailable2();
16737
16731
  const { text } = component;
16738
16732
  const copy = () => {
@@ -16835,7 +16829,7 @@ var SearchInput = ({ title, value, onFocus, onChange }) => {
16835
16829
 
16836
16830
  // src/legacy/layout/search/SearchResults.tsx
16837
16831
  var import_components67 = require("@transferwise/components");
16838
- var import_react_intl30 = require("react-intl");
16832
+ var import_react_intl29 = require("react-intl");
16839
16833
  var import_jsx_runtime110 = require("react/jsx-runtime");
16840
16834
  function SearchResults2({ results, emptyMessage, onSelect }) {
16841
16835
  if (results.length === 0) {
@@ -16855,7 +16849,7 @@ function SearchResults2({ results, emptyMessage, onSelect }) {
16855
16849
  )) });
16856
16850
  }
16857
16851
  function ErrorResult2({ onRetrySearch }) {
16858
- const intl = (0, import_react_intl30.useIntl)();
16852
+ const intl = (0, import_react_intl29.useIntl)();
16859
16853
  return /* @__PURE__ */ (0, import_jsx_runtime110.jsxs)("p", { className: "m-t-2", children: [
16860
16854
  intl.formatMessage(generic_error_messages_default.genericError),
16861
16855
  "\xA0",
@@ -17222,7 +17216,7 @@ var controlTypesWithPersistOnChange = /* @__PURE__ */ new Set([
17222
17216
  ]);
17223
17217
  function PersistAsyncBasicSchema(props) {
17224
17218
  const { schema, required, submitted, errors, onChange, onPersistAsync } = props;
17225
- const intl = (0, import_react_intl31.useIntl)();
17219
+ const intl = (0, import_react_intl30.useIntl)();
17226
17220
  const httpClient = useHttpClient();
17227
17221
  const onEvent = useEventDispatcher();
17228
17222
  const [persistAsyncModel, setPersistAsyncModel] = (0, import_react51.useState)(null);
@@ -17320,7 +17314,7 @@ var PersistAsyncBasicSchema_default = PersistAsyncBasicSchema;
17320
17314
  var usePersistAsync = (persistAsync) => {
17321
17315
  const [abortController, setAbortController] = (0, import_react52.useState)(null);
17322
17316
  const httpClient = useHttpClient();
17323
- const intl = (0, import_react_intl32.useIntl)();
17317
+ const intl = (0, import_react_intl31.useIntl)();
17324
17318
  const { schema } = persistAsync;
17325
17319
  async function handlePersistAsync(model) {
17326
17320
  const isInvalidSchema = model instanceof Blob ? !isBlobSchema2(schema) : !isValidSchema(model, schema);
@@ -17551,12 +17545,12 @@ var import_react60 = require("react");
17551
17545
 
17552
17546
  // src/legacy/step/cameraStep/cameraCapture/CameraCapture.tsx
17553
17547
  var import_react59 = require("react");
17554
- var import_react_intl37 = require("react-intl");
17548
+ var import_react_intl36 = require("react-intl");
17555
17549
  var import_react_webcam = __toESM(require("react-webcam"));
17556
17550
 
17557
17551
  // src/legacy/step/cameraStep/cameraCapture/CameraCapture.messages.ts
17558
- var import_react_intl33 = require("react-intl");
17559
- var CameraCapture_messages_default = (0, import_react_intl33.defineMessages)({
17552
+ var import_react_intl32 = require("react-intl");
17553
+ var CameraCapture_messages_default = (0, import_react_intl32.defineMessages)({
17560
17554
  reviewSubmit: {
17561
17555
  id: "dynamicFlows.CameraCapture.reviewSubmit",
17562
17556
  defaultMessage: "Yes, submit",
@@ -17616,14 +17610,14 @@ var CameraCapture_messages_default = (0, import_react_intl33.defineMessages)({
17616
17610
 
17617
17611
  // src/legacy/step/cameraStep/cameraCapture/components/bottomBar/BottomBar.tsx
17618
17612
  var import_components70 = require("@transferwise/components");
17619
- var import_react_intl34 = require("react-intl");
17613
+ var import_react_intl33 = require("react-intl");
17620
17614
  var import_jsx_runtime116 = require("react/jsx-runtime");
17621
17615
  var CaptureBottomBar = ({ onCapture }) => /* @__PURE__ */ (0, import_jsx_runtime116.jsx)("div", { className: "bottom-bar", children: /* @__PURE__ */ (0, import_jsx_runtime116.jsx)(CaptureButton, { onClick: onCapture }) });
17622
17616
  var ReviewBottomBar = ({
17623
17617
  onSubmit,
17624
17618
  onRetry
17625
17619
  }) => {
17626
- const intl = (0, import_react_intl34.useIntl)();
17620
+ const intl = (0, import_react_intl33.useIntl)();
17627
17621
  return /* @__PURE__ */ (0, import_jsx_runtime116.jsx)("div", { className: "bottom-bar p-x-2", children: /* @__PURE__ */ (0, import_jsx_runtime116.jsx)("div", { className: "row", children: /* @__PURE__ */ (0, import_jsx_runtime116.jsxs)("div", { className: "col-xs-12 col-md-6 col-md-offset-3", children: [
17628
17622
  /* @__PURE__ */ (0, import_jsx_runtime116.jsx)(
17629
17623
  import_components70.Button,
@@ -17662,11 +17656,11 @@ var CaptureButton = ({ onClick }) => /* @__PURE__ */ (0, import_jsx_runtime116.j
17662
17656
  );
17663
17657
 
17664
17658
  // src/legacy/step/cameraStep/cameraCapture/components/orientationLockOverlay/OrientationLockOverlay.tsx
17665
- var import_react_intl36 = require("react-intl");
17659
+ var import_react_intl35 = require("react-intl");
17666
17660
 
17667
17661
  // src/legacy/step/cameraStep/cameraCapture/components/orientationLockOverlay/OrientationLockOverlay.messages.ts
17668
- var import_react_intl35 = require("react-intl");
17669
- var OrientationLockOverlay_messages_default = (0, import_react_intl35.defineMessages)({
17662
+ var import_react_intl34 = require("react-intl");
17663
+ var OrientationLockOverlay_messages_default = (0, import_react_intl34.defineMessages)({
17670
17664
  text: {
17671
17665
  id: "dynamicFlows.CameraCapture.rotatePhone.text",
17672
17666
  defaultMessage: "Rotate your phone to portrait view to take a photo",
@@ -17677,7 +17671,7 @@ var OrientationLockOverlay_messages_default = (0, import_react_intl35.defineMess
17677
17671
  // src/legacy/step/cameraStep/cameraCapture/components/orientationLockOverlay/OrientationLockOverlay.tsx
17678
17672
  var import_jsx_runtime117 = require("react/jsx-runtime");
17679
17673
  function OrientationLockOverlay() {
17680
- const intl = (0, import_react_intl36.useIntl)();
17674
+ const intl = (0, import_react_intl35.useIntl)();
17681
17675
  return /* @__PURE__ */ (0, import_jsx_runtime117.jsxs)("div", { className: "orientation-lock-overlay", children: [
17682
17676
  /* @__PURE__ */ (0, import_jsx_runtime117.jsx)(
17683
17677
  "img",
@@ -17964,7 +17958,7 @@ function CameraCapture({
17964
17958
  shouldLockOrientation,
17965
17959
  onEvent
17966
17960
  );
17967
- const intl = (0, import_react_intl37.useIntl)();
17961
+ const intl = (0, import_react_intl36.useIntl)();
17968
17962
  const handleCapture = (0, import_react59.useCallback)(async () => {
17969
17963
  var _a, _b, _c, _d, _e, _f;
17970
17964
  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) {
@@ -18187,12 +18181,12 @@ function getFirstAction(step) {
18187
18181
  }
18188
18182
 
18189
18183
  // src/legacy/step/externalConfirmationStep/ExternalConfirmationStep.tsx
18190
- var import_react_intl38 = require("react-intl");
18184
+ var import_react_intl37 = require("react-intl");
18191
18185
  var import_jsx_runtime122 = require("react/jsx-runtime");
18192
18186
  var noop6 = () => {
18193
18187
  };
18194
18188
  function ExternalConfirmationStep({ url, onClose }) {
18195
- const { formatMessage } = (0, import_react_intl38.useIntl)();
18189
+ const { formatMessage } = (0, import_react_intl37.useIntl)();
18196
18190
  return /* @__PURE__ */ (0, import_jsx_runtime122.jsx)(
18197
18191
  DynamicLayout_default,
18198
18192
  {
@@ -18581,7 +18575,6 @@ var DynamicFlowComponent = ({
18581
18575
  onEvent = noop7,
18582
18576
  onLog = noop7
18583
18577
  }) => {
18584
- const { locale } = (0, import_react_intl39.useIntl)();
18585
18578
  const {
18586
18579
  formErrors,
18587
18580
  globalError,
@@ -18633,15 +18626,12 @@ var DynamicFlowComponent = ({
18633
18626
  return httpClient(url != null ? url : "", {
18634
18627
  method,
18635
18628
  headers: __spreadValues({
18636
- "accept-language": locale,
18637
- // FIXME move this out of the library https://transferwise.atlassian.net/browse/MC-3286
18638
18629
  "Content-Type": "application/json"
18639
18630
  }, etag2 ? { "If-None-Match": etag2 } : {}),
18640
- credentials: "include",
18641
18631
  body: method === "GET" ? void 0 : JSON.stringify(data)
18642
18632
  });
18643
18633
  },
18644
- [httpClient, locale]
18634
+ [httpClient]
18645
18635
  );
18646
18636
  const performAction = async (action, data = {}) => {
18647
18637
  cancelPendingRefreshes();
@@ -18653,7 +18643,7 @@ var DynamicFlowComponent = ({
18653
18643
  await handleExitResponse(response, action.result);
18654
18644
  return;
18655
18645
  }
18656
- await handleResponse(response, "submission");
18646
+ await handleResponse(response, "submission", action.result);
18657
18647
  } catch (error) {
18658
18648
  completeWithError(
18659
18649
  error,
@@ -18698,8 +18688,8 @@ var DynamicFlowComponent = ({
18698
18688
  if (initialStep) {
18699
18689
  warnIfNoStepLayout(initialStep);
18700
18690
  }
18701
- }, [httpClient, locale, JSON.stringify(initialStep), JSON.stringify(initialAction)]);
18702
- const handleResponse = async (response, fetchType) => {
18691
+ }, [httpClient, JSON.stringify(initialStep), JSON.stringify(initialAction)]);
18692
+ const handleResponse = async (response, fetchType, actionResult) => {
18703
18693
  try {
18704
18694
  if (response.status === 304) {
18705
18695
  setLoadingState("idle");
@@ -18714,7 +18704,9 @@ var DynamicFlowComponent = ({
18714
18704
  if (result.type === "action") {
18715
18705
  void performAction(result.action, result.action.data);
18716
18706
  } else if (result.type === "exit") {
18717
- dispatchEventAndComplete(result.result);
18707
+ dispatchEventAndComplete(
18708
+ isObject2(actionResult) ? __spreadValues(__spreadValues({}, result.result), actionResult) : result.result
18709
+ );
18718
18710
  } else {
18719
18711
  updateStep(result.step, result.etag, fetchType);
18720
18712
  }