@wise/dynamic-flow-client-internal 2.8.5 → 2.8.6

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
@@ -52,7 +52,7 @@ var require_main_min = __commonJS({
52
52
  "../core/build/main.min.js"(exports, module2) {
53
53
  "use strict";
54
54
  var jm = Object.create;
55
- var Yt = Object.defineProperty;
55
+ var Zt = Object.defineProperty;
56
56
  var Vm = Object.defineProperties;
57
57
  var Um = Object.getOwnPropertyDescriptor;
58
58
  var Hm = Object.getOwnPropertyDescriptors;
@@ -61,7 +61,7 @@ var require_main_min = __commonJS({
61
61
  var Gm = Object.getPrototypeOf;
62
62
  var on = Object.prototype.hasOwnProperty;
63
63
  var Wm = Object.prototype.propertyIsEnumerable;
64
- var an = (e, t, r) => t in e ? Yt(e, t, { enumerable: true, configurable: true, writable: true, value: r }) : e[t] = r;
64
+ var an = (e, t, r) => t in e ? Zt(e, t, { enumerable: true, configurable: true, writable: true, value: r }) : e[t] = r;
65
65
  var s = (e, t) => {
66
66
  for (var r in t || (t = {}))
67
67
  on.call(t, r) && an(e, r, t[r]);
@@ -74,16 +74,16 @@ var require_main_min = __commonJS({
74
74
  var Aa = (e, t) => () => (t || e((t = { exports: {} }).exports, t), t.exports);
75
75
  var $m = (e, t) => {
76
76
  for (var r in t)
77
- Yt(e, r, { get: t[r], enumerable: true });
77
+ Zt(e, r, { get: t[r], enumerable: true });
78
78
  };
79
79
  var nn = (e, t, r, a) => {
80
80
  if (t && typeof t == "object" || typeof t == "function")
81
81
  for (let o of qm(t))
82
- !on.call(e, o) && o !== r && Yt(e, o, { get: () => t[o], enumerable: !(a = Um(t, o)) || a.enumerable });
82
+ !on.call(e, o) && o !== r && Zt(e, o, { get: () => t[o], enumerable: !(a = Um(t, o)) || a.enumerable });
83
83
  return e;
84
84
  };
85
- var Ee = (e, t, r) => (r = e != null ? jm(Gm(e)) : {}, nn(t || !e || !e.__esModule ? Yt(r, "default", { value: e, enumerable: true }) : r, e));
86
- var _m = (e) => nn(Yt({}, "__esModule", { value: true }), e);
85
+ var Ee = (e, t, r) => (r = e != null ? jm(Gm(e)) : {}, nn(t || !e || !e.__esModule ? Zt(r, "default", { value: e, enumerable: true }) : r, e));
86
+ var _m = (e) => nn(Zt({}, "__esModule", { value: true }), e);
87
87
  var Xe = Aa((nf, Ur) => {
88
88
  "use strict";
89
89
  (function() {
@@ -118,11 +118,11 @@ var require_main_min = __commonJS({
118
118
  }) : window.classNames = r;
119
119
  })();
120
120
  });
121
- var bc = Aa((fr, jo) => {
121
+ var bc = Aa((hr, jo) => {
122
122
  "use strict";
123
123
  (function(t, r) {
124
- typeof fr == "object" && typeof jo == "object" ? jo.exports = r(require("react")) : typeof define == "function" && define.amd ? define(["react"], r) : typeof fr == "object" ? fr.Webcam = r(require("react")) : t.Webcam = r(t.React);
125
- })(fr, function(e) {
124
+ typeof hr == "object" && typeof jo == "object" ? jo.exports = r(require("react")) : typeof define == "function" && define.amd ? define(["react"], r) : typeof hr == "object" ? hr.Webcam = r(require("react")) : t.Webcam = r(t.React);
125
+ })(hr, function(e) {
126
126
  return function(t) {
127
127
  var r = {};
128
128
  function a(o) {
@@ -314,11 +314,11 @@ var require_main_min = __commonJS({
314
314
  } }).default;
315
315
  });
316
316
  });
317
- var kc = Aa((BF, gr) => {
317
+ var kc = Aa((zF, wr) => {
318
318
  "use strict";
319
319
  (function() {
320
320
  "use strict";
321
- var e = typeof window != "undefined" && typeof window.document != "undefined" ? window.document : {}, t = typeof gr != "undefined" && gr.exports, r = function() {
321
+ var e = typeof window != "undefined" && typeof window.document != "undefined" ? window.document : {}, t = typeof wr != "undefined" && wr.exports, r = function() {
322
322
  for (var n, i = [["requestFullscreen", "exitFullscreen", "fullscreenElement", "fullscreenEnabled", "fullscreenchange", "fullscreenerror"], ["webkitRequestFullscreen", "webkitExitFullscreen", "webkitFullscreenElement", "webkitFullscreenEnabled", "webkitfullscreenchange", "webkitfullscreenerror"], ["webkitRequestFullScreen", "webkitCancelFullScreen", "webkitCurrentFullScreenElement", "webkitCancelFullScreen", "webkitfullscreenchange", "webkitfullscreenerror"], ["mozRequestFullScreen", "mozCancelFullScreen", "mozFullScreenElement", "mozFullScreenEnabled", "mozfullscreenchange", "mozfullscreenerror"], ["msRequestFullscreen", "msExitFullscreen", "msFullscreenElement", "msFullscreenEnabled", "MSFullscreenChange", "MSFullscreenError"]], c = 0, l = i.length, m = {}; c < l; c++)
323
323
  if (n = i[c], n && n[1] in e) {
324
324
  for (c = 0; c < n.length; c++)
@@ -362,7 +362,7 @@ var require_main_min = __commonJS({
362
362
  c && e.removeEventListener(c, i, false);
363
363
  }, raw: r };
364
364
  if (!r) {
365
- t ? gr.exports = { isEnabled: false } : window.screenfull = { isEnabled: false };
365
+ t ? wr.exports = { isEnabled: false } : window.screenfull = { isEnabled: false };
366
366
  return;
367
367
  }
368
368
  Object.defineProperties(o, { isFullscreen: { get: function() {
@@ -371,13 +371,13 @@ var require_main_min = __commonJS({
371
371
  return e[r.fullscreenElement];
372
372
  } }, isEnabled: { enumerable: true, get: function() {
373
373
  return !!e[r.fullscreenEnabled];
374
- } } }), t ? gr.exports = o : window.screenfull = o;
374
+ } } }), t ? wr.exports = o : window.screenfull = o;
375
375
  })();
376
376
  });
377
377
  var Lp = {};
378
- $m(Lp, { DynamicFlow: () => Qo, JsonSchemaForm: () => en, Layout: () => ne, convertStepToLayout: () => Zt, inlineReferences: () => ze, isValidSchema: () => G, makeHttpClient: () => kr, translations: () => Bm });
378
+ $m(Lp, { DynamicFlow: () => Qo, JsonSchemaForm: () => en, Layout: () => ne, convertStepToLayout: () => Qt, inlineReferences: () => ze, isValidSchema: () => G, makeHttpClient: () => kr, translations: () => Bm });
379
379
  module2.exports = _m(Lp);
380
- function Zt(e, { displayStepTitle: t = true } = {}) {
380
+ function Qt(e, { displayStepTitle: t = true } = {}) {
381
381
  if (e.layout)
382
382
  return sl(e, t);
383
383
  switch (e.type) {
@@ -408,7 +408,7 @@ var require_main_min = __commonJS({
408
408
  function Xm(e) {
409
409
  let t = Oa(e);
410
410
  if (e.reviewFields && t.push(al(e.reviewFields)), e.schemas && t.push(...nl(e)), e.actions) {
411
- let r = e.actions.map(vr);
411
+ let r = e.actions.map(Ar);
412
412
  t.push(Pa(r, "md"));
413
413
  }
414
414
  return t;
@@ -423,7 +423,7 @@ var require_main_min = __commonJS({
423
423
  e.details.title && t.push(Ma(e.details.title)), e.details.description && t.push(ka(e.details.description));
424
424
  }
425
425
  if (e.actions) {
426
- let r = e.actions.map((a) => vr(C(s({}, a), { type: a.type || "primary" })));
426
+ let r = e.actions.map((a) => Ar(C(s({}, a), { type: a.type || "primary" })));
427
427
  t.push(Pa(r, "md"));
428
428
  }
429
429
  return t;
@@ -456,7 +456,7 @@ var require_main_min = __commonJS({
456
456
  function rl(e) {
457
457
  return typeof e == "string" ? { type: "image", url: e, text: void 0, margin: "lg", size: "md" } : sn(e);
458
458
  }
459
- function vr(e) {
459
+ function Ar(e) {
460
460
  return { type: "button", action: C(s({}, e), { title: e.title }) };
461
461
  }
462
462
  function al(e) {
@@ -485,22 +485,22 @@ var require_main_min = __commonJS({
485
485
  function cl({ formComponent: e, schemas: t }) {
486
486
  if (e.schemaId)
487
487
  return { type: "form", margin: e.margin, schema: cn(t, e.schemaId) };
488
- if (e.schema && Ar(e.schema) && e.schema.$ref)
488
+ if (e.schema && Or(e.schema) && e.schema.$ref)
489
489
  return { type: "form", margin: e.margin, schema: cn(t, e.schema.$ref) };
490
- if (e.schema && !Ar(e.schema))
490
+ if (e.schema && !Or(e.schema))
491
491
  return s({}, e);
492
492
  throw new Error('Invalid form layout component. Missing "schema" or "schemaId" properties.');
493
493
  }
494
494
  function ml({ decisionComponent: e, actions: t }) {
495
495
  var a;
496
- let r = (a = e == null ? void 0 : e.options) == null ? void 0 : a.map((o) => o.action && Ar(o.action) ? C(s({}, o), { action: mn(t, o.action.$ref) }) : o);
496
+ let r = (a = e == null ? void 0 : e.options) == null ? void 0 : a.map((o) => o.action && Or(o.action) ? C(s({}, o), { action: mn(t, o.action.$ref) }) : o);
497
497
  return C(s({}, e), { options: r });
498
498
  }
499
499
  function ll({ actionComponent: e, actions: t }) {
500
500
  var r;
501
- if (e.action && Ar(e.action) && ((r = e.action) != null && r.$ref)) {
501
+ if (e.action && Or(e.action) && ((r = e.action) != null && r.$ref)) {
502
502
  let a = mn(t, e.action.$ref);
503
- return vr(a);
503
+ return Ar(a);
504
504
  }
505
505
  return e;
506
506
  }
@@ -516,16 +516,16 @@ var require_main_min = __commonJS({
516
516
  throw new Error(`Fatal Error. Action not found. $id ${t}`);
517
517
  return r;
518
518
  }
519
- function Ar(e) {
519
+ function Or(e) {
520
520
  return Object.hasOwnProperty.call(e, "$ref");
521
521
  }
522
522
  var Me = require("react");
523
523
  var Sm = require("react-intl");
524
524
  var vt = require("react");
525
- var Or = require("react");
525
+ var Pr = require("react");
526
526
  function ln() {
527
- let [e, t] = (0, Or.useState)(0);
528
- return { addPendingPromise: (0, Or.useCallback)((a) => {
527
+ let [e, t] = (0, Pr.useState)(0);
528
+ return { addPendingPromise: (0, Pr.useCallback)((a) => {
529
529
  t((o) => o + 1), a.catch(ul).finally(() => dl(() => t((o) => Math.max(0, o - 1))));
530
530
  }, [t]), pendingPromises: e };
531
531
  }
@@ -540,17 +540,17 @@ var require_main_min = __commonJS({
540
540
  let { pendingPromises: r, addPendingPromise: a } = ln(), o = (0, vt.useMemo)(() => ({ loading: e || r > 0, registerPersistAsyncPromise: a }), [e, r, a]);
541
541
  return (0, yn.jsx)(un.Provider, { value: o, children: t });
542
542
  };
543
- var Pr = () => (0, vt.useContext)(un) || dn;
544
- var At = require("react");
543
+ var At = () => (0, vt.useContext)(un) || dn;
544
+ var Ot = require("react");
545
545
  var hn = require("react/jsx-runtime");
546
- var fn = (0, At.createContext)({ triggerEvent: () => {
546
+ var fn = (0, Ot.createContext)({ triggerEvent: () => {
547
547
  } });
548
548
  function Mr({ metadata: e, children: t, onEvent: r }) {
549
- let a = (0, At.useMemo)(() => ({ triggerEvent: Ea(r, e) }), [r, e]);
549
+ let a = (0, Ot.useMemo)(() => ({ triggerEvent: Ea(r, e) }), [r, e]);
550
550
  return (0, hn.jsx)(fn.Provider, { value: a, children: t });
551
551
  }
552
552
  function re() {
553
- let { triggerEvent: e } = (0, At.useContext)(fn);
553
+ let { triggerEvent: e } = (0, Ot.useContext)(fn);
554
554
  return e;
555
555
  }
556
556
  var Ea = (e, t) => (r, a = {}) => {
@@ -590,7 +590,7 @@ var require_main_min = __commonJS({
590
590
  return e != null ? e : fetch;
591
591
  };
592
592
  var wn = () => !!(0, ct.useContext)(Er);
593
- var Ot = require("react");
593
+ var Pt = require("react");
594
594
  var Sn = require("react/jsx-runtime");
595
595
  var mt = (e, t, r = "UNKNOWN-FLOW-ID", a = "UNKNOWN-FLOW-ID") => (o, n, i) => {
596
596
  try {
@@ -598,13 +598,13 @@ var require_main_min = __commonJS({
598
598
  } catch (c) {
599
599
  }
600
600
  };
601
- var Cn = (0, Ot.createContext)(null);
601
+ var Cn = (0, Pt.createContext)(null);
602
602
  function Dr({ flowId: e, stepId: t, children: r, onLog: a }) {
603
- let o = (0, Ot.useMemo)(() => ({ debug: mt("debug", a, e, t), info: mt("info", a, e, t), warning: mt("warning", a, e, t), error: mt("error", a, e, t), critical: mt("critical", a, e, t) }), [a, e, t]);
603
+ let o = (0, Pt.useMemo)(() => ({ debug: mt("debug", a, e, t), info: mt("info", a, e, t), warning: mt("warning", a, e, t), error: mt("error", a, e, t), critical: mt("critical", a, e, t) }), [a, e, t]);
604
604
  return (0, Sn.jsx)(Cn.Provider, { value: o, children: r });
605
605
  }
606
- var Pt = () => {
607
- let e = (0, Ot.useContext)(Cn);
606
+ var Mt = () => {
607
+ let e = (0, Pt.useContext)(Cn);
608
608
  if (e == null)
609
609
  throw new Error("Logging context not found. Did you forget to wrap your component in a <LogProvider />?");
610
610
  return e;
@@ -632,7 +632,7 @@ var require_main_min = __commonJS({
632
632
  var j = (e) => Array.isArray(e);
633
633
  var I = (e) => e === null;
634
634
  var Y = (e) => typeof e == "undefined";
635
- var Mt = (e) => L(e) && e.length === 0 || (R(e) || j(e)) && Object.keys(e).length === 0;
635
+ var kt = (e) => L(e) && e.length === 0 || (R(e) || j(e)) && Object.keys(e).length === 0;
636
636
  function On(e, t) {
637
637
  return t.oneOf.some((r) => $e(e, r) === e) ? e : null;
638
638
  }
@@ -645,7 +645,7 @@ var require_main_min = __commonJS({
645
645
  return !je(t) || !De(t) ? null : La(e, t);
646
646
  }
647
647
  function Mn(e) {
648
- return L(e) && !Mt(e) ? e : null;
648
+ return L(e) && !kt(e) ? e : null;
649
649
  }
650
650
  function kn(e) {
651
651
  return z(e) ? e : null;
@@ -661,12 +661,12 @@ var require_main_min = __commonJS({
661
661
  if (!e.every((a) => typeof a === r))
662
662
  return new Array(e.length).fill(null);
663
663
  }
664
- return e.map((r) => kt(r, t.items));
664
+ return e.map((r) => Et(r, t.items));
665
665
  }
666
666
  function In(e, t) {
667
667
  return Object.keys(t.properties).reduce((r, a) => {
668
668
  if (e && !Y(e[a])) {
669
- let o = e[a], n = t.properties[a], i = kt(o, n);
669
+ let o = e[a], n = t.properties[a], i = Et(o, n);
670
670
  if (!I(i))
671
671
  return C(s({}, r), { [a]: i });
672
672
  }
@@ -688,7 +688,7 @@ var require_main_min = __commonJS({
688
688
  return $(o) && $(n) ? C(s({}, r), { [a]: Tn(o, n) }) : C(s({}, r), { [a]: t[a] });
689
689
  }, s({}, e));
690
690
  }
691
- var kt = (e, t) => $(e) ? ce(e, t) : Ta(e) ? wl(e, t) : $e(e, t);
691
+ var Et = (e, t) => $(e) ? ce(e, t) : Ta(e) ? wl(e, t) : $e(e, t);
692
692
  function $e(e, t) {
693
693
  if (I(e))
694
694
  return null;
@@ -716,7 +716,7 @@ var require_main_min = __commonJS({
716
716
  function wl(e, t) {
717
717
  return ge(t) ? Pn(e, t) : je(t) ? La(e, t) : null;
718
718
  }
719
- function Qt(e, t = false) {
719
+ function er(e, t = false) {
720
720
  return !t || !Y(e);
721
721
  }
722
722
  function Rn(e, t = false) {
@@ -758,7 +758,7 @@ var require_main_min = __commonJS({
758
758
  case "boolean":
759
759
  return ja(e, t, r);
760
760
  case "array":
761
- return Et(e, t, r);
761
+ return It(e, t, r);
762
762
  case "object":
763
763
  return Cl(e, t);
764
764
  default:
@@ -771,13 +771,13 @@ var require_main_min = __commonJS({
771
771
  if (e === "" && r)
772
772
  return ["required"];
773
773
  let a = [];
774
- return Qt(e, r) || a.push("required"), Nn(e, t.minLength) || a.push("minLength"), Bn(e, t.maxLength) || a.push("maxLength"), zn(e, t.pattern) || a.push("pattern"), Na(e, t.minimum) || a.push("minimum"), Ra(e, t.maximum) || a.push("maximum"), a;
774
+ return er(e, r) || a.push("required"), Nn(e, t.minLength) || a.push("minLength"), Bn(e, t.maxLength) || a.push("maxLength"), zn(e, t.pattern) || a.push("pattern"), Na(e, t.minimum) || a.push("minimum"), Ra(e, t.maximum) || a.push("maximum"), a;
775
775
  }
776
776
  function Tr(e, t, r) {
777
777
  if (!z(e) && !I(e))
778
778
  return ["type"];
779
779
  let a = [];
780
- return Qt(e, r) || a.push("required"), Na(e, t.minimum) || a.push("minimum"), Ra(e, t.maximum) || a.push("maximum"), a;
780
+ return er(e, r) || a.push("required"), Na(e, t.minimum) || a.push("minimum"), Ra(e, t.maximum) || a.push("maximum"), a;
781
781
  }
782
782
  function za(e, t, r) {
783
783
  return An(e) ? Tr(e, t, r) : ["type"];
@@ -786,12 +786,12 @@ var require_main_min = __commonJS({
786
786
  if (!Ie(e) && !I(e))
787
787
  return ["type"];
788
788
  let a = [];
789
- return Qt(e, r) || a.push("required"), a;
789
+ return er(e, r) || a.push("required"), a;
790
790
  }
791
791
  function Va(e, t, r) {
792
- return Qt(e, r) ? e !== t.const ? ["const"] : [] : ["required"];
792
+ return er(e, r) ? e !== t.const ? ["const"] : [] : ["required"];
793
793
  }
794
- function Et(e, t, r) {
794
+ function It(e, t, r) {
795
795
  if (!j(e) && !I(e))
796
796
  return ["type"];
797
797
  if (!Rn(e, r))
@@ -827,7 +827,7 @@ var require_main_min = __commonJS({
827
827
  return t.hidden ? true : typeof e == "undefined" ? !r : G(e, t);
828
828
  }
829
829
  function Pl(e, t) {
830
- return t.type !== "array" || !R(t.items) || Et(e, t).length > 0 ? false : Array.isArray(e) && De(t) && e.map((r) => G(r, t.items)).every((r) => r);
830
+ return t.type !== "array" || !R(t.items) || It(e, t).length > 0 ? false : Array.isArray(e) && De(t) && e.map((r) => G(r, t.items)).every((r) => r);
831
831
  }
832
832
  function Ml(e, t) {
833
833
  return j(t.oneOf) ? t.oneOf.some((r) => G(e, r)) : false;
@@ -915,7 +915,7 @@ var require_main_min = __commonJS({
915
915
  function we(e) {
916
916
  return !Y(e == null ? void 0 : e.const);
917
917
  }
918
- function er(e) {
918
+ function tr(e) {
919
919
  return !!e && !we(e);
920
920
  }
921
921
  var Ll = (e) => !!e.readOnly && Ve(e);
@@ -936,7 +936,7 @@ var require_main_min = __commonJS({
936
936
  function Ua(e) {
937
937
  return !!e.allOf;
938
938
  }
939
- function It(e) {
939
+ function Dt(e) {
940
940
  return e.type === "blob";
941
941
  }
942
942
  function je(e) {
@@ -953,7 +953,7 @@ var require_main_min = __commonJS({
953
953
  return !!e.persistAsync;
954
954
  }
955
955
  function Nl(e) {
956
- return Br(e) && (It(e.persistAsync.schema) || Bl(e.persistAsync.schema));
956
+ return Br(e) && (Dt(e.persistAsync.schema) || Bl(e.persistAsync.schema));
957
957
  }
958
958
  var Ha = (e) => Ve(e) && !!e.validationAsync;
959
959
  function Bl(e) {
@@ -989,7 +989,7 @@ var require_main_min = __commonJS({
989
989
  var jr = (e) => L(e) || I(e);
990
990
  var Ta = (e) => j(e) ? e.length === 0 ? true : e.every((t) => typeof t == "string" || typeof t == "number" || typeof t == "boolean" || typeof t == "object") : false;
991
991
  var Xn = (e) => I(e) ? true : Ta(e);
992
- var tr = (e) => L(e) || I(e);
992
+ var rr = (e) => L(e) || I(e);
993
993
  var Yn = () => Hl() && (ql() || Ul());
994
994
  var Ul = (e = window.navigator.userAgent) => /mobi|\b(iphone|android|blackberry|webos|windows phone)\b/i.test(e);
995
995
  var Hl = (e = window.screen.width, t = window.screen.height) => e < 768 || t < 768;
@@ -1003,16 +1003,16 @@ var require_main_min = __commonJS({
1003
1003
  function Qn(e, t) {
1004
1004
  return (0, Zn.useCallback)(Ke(e, t), [e, t]);
1005
1005
  }
1006
- var rr = require("react");
1006
+ var ar = require("react");
1007
1007
  function ei(e) {
1008
- let [t, r] = (0, rr.useState)(null), [a, o] = (0, rr.useState)(false), n = () => o(true);
1009
- return (0, rr.useEffect)(() => {
1008
+ let [t, r] = (0, ar.useState)(null), [a, o] = (0, ar.useState)(false), n = () => o(true);
1009
+ return (0, ar.useEffect)(() => {
1010
1010
  e && (o(false), r(window.open(e, "_blank")));
1011
1011
  }, [e]), { requiresManualTrigger: !!(e && !t && !a), dismissConfirmation: n };
1012
1012
  }
1013
- var ar = require("react");
1013
+ var or = require("react");
1014
1014
  function ti(e, t) {
1015
- let r = ae(), a = (0, ar.useMemo)(() => {
1015
+ let r = ae(), a = (0, or.useMemo)(() => {
1016
1016
  if (e)
1017
1017
  return () => r(e.url).then((n) => {
1018
1018
  if (n.ok)
@@ -1026,7 +1026,7 @@ var require_main_min = __commonJS({
1026
1026
  }).catch((n) => {
1027
1027
  throw new Error(n.message === "failed" ? "failed" : "network failed");
1028
1028
  });
1029
- }, [e, r]), o = (0, ar.useCallback)((n) => {
1029
+ }, [e, r]), o = (0, or.useCallback)((n) => {
1030
1030
  let c = ((e == null ? void 0 : e.responseHandlers) || []).find((l) => l.result === n.result);
1031
1031
  if (c != null && c.action) {
1032
1032
  let { action: l } = c;
@@ -1041,14 +1041,14 @@ var require_main_min = __commonJS({
1041
1041
  }
1042
1042
  return true;
1043
1043
  }, [e == null ? void 0 : e.responseHandlers, t]);
1044
- Vr({ asyncFn: a, interval: (e == null ? void 0 : e.interval) || 0, maxAttempts: (e == null ? void 0 : e.maxAttempts) || 0, maxConsecutiveFails: (e == null ? void 0 : e.maxConsecutiveFails) || 0, onPollingResponse: o, onFailure: (0, ar.useCallback)(() => {
1044
+ Vr({ asyncFn: a, interval: (e == null ? void 0 : e.interval) || 0, maxAttempts: (e == null ? void 0 : e.maxAttempts) || 0, maxConsecutiveFails: (e == null ? void 0 : e.maxConsecutiveFails) || 0, onPollingResponse: o, onFailure: (0, or.useCallback)(() => {
1045
1045
  e && t(e.onError.action);
1046
1046
  }, [t, e]) });
1047
1047
  }
1048
1048
  var wc = require("react");
1049
1049
  var Cc = require("react-intl");
1050
1050
  var ri = require("react-intl");
1051
- var or = (0, ri.defineMessages)({ genericError: { id: "dynamicFlows.PersistAsyncSchema.genericError", defaultMessage: "Something went wrong, please try again later!", description: "Generic error message for persist async schema" } });
1051
+ var nr = (0, ri.defineMessages)({ genericError: { id: "dynamicFlows.PersistAsyncSchema.genericError", defaultMessage: "Something went wrong, please try again later!", description: "Generic error message for persist async schema" } });
1052
1052
  var bt = require("react");
1053
1053
  var pc = require("react-intl");
1054
1054
  var ai = { DAY_MONTH_YEAR: "day-month-year", MONTH_YEAR: "month-year" };
@@ -1058,13 +1058,13 @@ var require_main_min = __commonJS({
1058
1058
  var dc = Ee(Xe());
1059
1059
  var de = require("react");
1060
1060
  var ui = require("@transferwise/components");
1061
- var Lt = require("@transferwise/components");
1061
+ var Tt = require("@transferwise/components");
1062
1062
  var si = require("react/jsx-runtime");
1063
- var Dt = (e) => Gl(e) || Wl(e);
1063
+ var Lt = (e) => Gl(e) || Wl(e);
1064
1064
  var Gl = (e) => $l.some((t) => e === `flag-${t}`);
1065
1065
  var Wl = (e) => _l.some((t) => e === `flag-${t}`);
1066
1066
  var ii = ({ name: e }) => {
1067
- if (!Dt(e))
1067
+ if (!Lt(e))
1068
1068
  return null;
1069
1069
  let t = e.substring(5);
1070
1070
  return (0, si.jsx)("img", { src: `https://wise.com/web-art/assets/flags/${t}.svg`, alt: "", "data-testid": `img-flag-${t}` });
@@ -1089,20 +1089,20 @@ var require_main_min = __commonJS({
1089
1089
  return `${(t = e[0]) == null ? void 0 : t.toUpperCase()}${e.slice(1)}`;
1090
1090
  };
1091
1091
  var Wa = require("react/jsx-runtime");
1092
- var Jl = ({ type: e }) => Dt(e) ? (0, Wa.jsx)(ii, { name: e }) : Hr(e) ? (0, Wa.jsx)(mi, { name: e }) : null;
1092
+ var Jl = ({ type: e }) => Lt(e) ? (0, Wa.jsx)(ii, { name: e }) : Hr(e) ? (0, Wa.jsx)(mi, { name: e }) : null;
1093
1093
  function $a(e) {
1094
- return Hr(e) || Dt(e);
1094
+ return Hr(e) || Lt(e);
1095
1095
  }
1096
1096
  var Ye = Jl;
1097
- var nr = require("react/jsx-runtime");
1097
+ var ir = require("react/jsx-runtime");
1098
1098
  var ut = ({ icon: e, image: t }) => {
1099
1099
  if (e != null && e.name)
1100
- return (0, nr.jsx)(Lt.Avatar, { type: Lt.AvatarType.ICON, children: (0, nr.jsx)(Ye, { type: e.name }) });
1100
+ return (0, ir.jsx)(Tt.Avatar, { type: Tt.AvatarType.ICON, children: (0, ir.jsx)(Ye, { type: e.name }) });
1101
1101
  if (e != null && e.text)
1102
- return (0, nr.jsx)(Lt.Avatar, { type: Lt.AvatarType.INITIALS, children: e.text });
1102
+ return (0, ir.jsx)(Tt.Avatar, { type: Tt.AvatarType.INITIALS, children: e.text });
1103
1103
  if (t != null && t.url) {
1104
1104
  let { url: r, text: a } = t;
1105
- return (0, nr.jsx)("img", { src: r, alt: a });
1105
+ return (0, ir.jsx)("img", { src: r, alt: a });
1106
1106
  }
1107
1107
  return null;
1108
1108
  };
@@ -1207,7 +1207,7 @@ var require_main_min = __commonJS({
1207
1207
  var Ci = require("react/jsx-runtime");
1208
1208
  var od = (e) => {
1209
1209
  var l;
1210
- let { component: t, onAction: r } = e, a = t.action, o = hi(t), n = fi(t), { loading: i } = Pr(), c = V(t.margin || "md");
1210
+ let { component: t, onAction: r } = e, a = t.action, o = hi(t), n = fi(t), { loading: i } = At(), c = V(t.margin || "md");
1211
1211
  return (0, Ci.jsx)(wi.Button, { size: gi(t.size), type: n === "tertiary" ? void 0 : o, priority: n, block: true, className: c, disabled: t.disabled || a.disabled || i, onClick: () => r(a), children: (l = t.title) != null ? l : a.title });
1212
1212
  };
1213
1213
  var Ka = od;
@@ -1221,7 +1221,11 @@ var require_main_min = __commonJS({
1221
1221
  var Gr = require("@transferwise/components");
1222
1222
  var qr = require("react/jsx-runtime");
1223
1223
  function sd({ component: e, onAction: t }) {
1224
- return (0, qr.jsx)("div", { className: V(e.margin), children: (0, qr.jsx)(Gr.NavigationOptionsList, { children: e.options.map((r) => (0, qr.jsx)(Gr.NavigationOption, { title: r.title, content: r.description, disabled: r.disabled, media: ut(r), showMediaCircle: false, showMediaAtAllSizes: true, onClick: () => t(r.action) }, JSON.stringify(r))) }) });
1224
+ let { loading: r } = At();
1225
+ return (0, qr.jsx)("div", { className: V(e.margin), children: (0, qr.jsx)(Gr.NavigationOptionsList, { children: e.options.map((a) => {
1226
+ var o;
1227
+ return (0, qr.jsx)(Gr.NavigationOption, { title: a.title, content: a.description, disabled: (o = a.disabled) != null ? o : r, media: ut(a), showMediaCircle: false, showMediaAtAllSizes: true, onClick: () => t(a.action) }, JSON.stringify(a));
1228
+ }) }) });
1225
1229
  }
1226
1230
  var Xa = sd;
1227
1231
  var Si = require("react/jsx-runtime");
@@ -1230,7 +1234,7 @@ var require_main_min = __commonJS({
1230
1234
  return (0, Si.jsx)("hr", { className: r });
1231
1235
  };
1232
1236
  var Ya = cd;
1233
- var Tt = require("@transferwise/components");
1237
+ var Rt = require("@transferwise/components");
1234
1238
  var Wr = require("react");
1235
1239
  var xi = require("react-intl");
1236
1240
  var Fi = require("react-intl");
@@ -1242,7 +1246,7 @@ var require_main_min = __commonJS({
1242
1246
  c();
1243
1247
  }, [c]);
1244
1248
  let l = o && a ? C(s({}, o), { responseHandlers: a }) : void 0;
1245
- return ti(l, t), (0, Ze.jsxs)(Ze.Fragment, { children: [(0, Ze.jsx)(Tt.Loader, { size: Tt.Size.LARGE, classNames: { "tw-loader": "tw-loader m-x-auto" } }), (0, Ze.jsx)("br", {}), (0, Ze.jsx)(Tt.Button, { priority: "tertiary", block: true, onClick: c, children: n || i.formatMessage(bi.retryTitle) })] });
1249
+ return ti(l, t), (0, Ze.jsxs)(Ze.Fragment, { children: [(0, Ze.jsx)(Rt.Loader, { size: Rt.Size.LARGE, classNames: { "tw-loader": "tw-loader m-x-auto" } }), (0, Ze.jsx)("br", {}), (0, Ze.jsx)(Rt.Button, { priority: "tertiary", block: true, onClick: c, children: n || i.formatMessage(bi.retryTitle) })] });
1246
1250
  };
1247
1251
  var Za = md;
1248
1252
  var Gs = require("react");
@@ -1264,7 +1268,7 @@ var require_main_min = __commonJS({
1264
1268
  var Qa = Pi;
1265
1269
  var _r = require("@transferwise/components");
1266
1270
  var Ui = Ee(Xe());
1267
- var ir = require("react");
1271
+ var sr = require("react");
1268
1272
  var $r = require("@transferwise/components");
1269
1273
  var eo = require("@transferwise/formatting");
1270
1274
  var ki = require("react-intl");
@@ -1319,7 +1323,7 @@ var require_main_min = __commonJS({
1319
1323
  var ft = require("react/jsx-runtime");
1320
1324
  function Hi(e) {
1321
1325
  var M, E;
1322
- let { onChange: t, schema: r } = e, a = re(), o = ji(r), n = (0, ir.useMemo)(() => r.$id || Te(), [r.$id]), [i, c] = (0, ir.useState)(false), [l, m] = (0, ir.useState)(() => yd(e.model || [])), p = qi(r.items.persistAsync), h = r.items.persistAsync.schema, y = It(h), u = async (P) => {
1326
+ let { onChange: t, schema: r } = e, a = re(), o = ji(r), n = (0, sr.useMemo)(() => r.$id || Te(), [r.$id]), [i, c] = (0, sr.useState)(false), [l, m] = (0, sr.useState)(() => yd(e.model || [])), p = qi(r.items.persistAsync), h = r.items.persistAsync.schema, y = Dt(h), u = async (P) => {
1323
1327
  c(true);
1324
1328
  try {
1325
1329
  let D = await Ii(P, y);
@@ -1337,7 +1341,7 @@ var require_main_min = __commonJS({
1337
1341
  let U = Vi(P).map((ee) => ee.id);
1338
1342
  t({ model: U, triggerSchema: r, triggerModel: U });
1339
1343
  }
1340
- let w = Vi(l).map((P) => P.id), S = Et(w, r, e.required), F = !!e.errors || (i || e.submitted) && !!S.length, g = "accepts" in h && h.accepts, v = "maxSize" in h && h.maxSize, O = C(s(s({ multiple: true, className: "form-control", files: l, fileInputName: n, id: n }, g ? { fileTypes: g } : void 0), v ? { sizeLimit: Nr(v) } : void 0), { sizeLimitErrorMessage: ((M = h.validationMessages) == null ? void 0 : M.maxSize) || o.maxFileSizeErrorMessage, maxFiles: e.schema.maxItems, maxFilesErrorMessage: ((E = e.schema.validationMessages) == null ? void 0 : E.maxItems) || o.maxItemsErrorMessage, uploadButtonTitle: h.title, description: h.description, disabled: e.disabled, onUploadFile: (P) => u(P.get(n)), onFilesChange: d, onDeleteFile: () => Promise.resolve() }), x = `${n}-feedback`;
1344
+ let w = Vi(l).map((P) => P.id), S = It(w, r, e.required), F = !!e.errors || (i || e.submitted) && !!S.length, g = "accepts" in h && h.accepts, v = "maxSize" in h && h.maxSize, O = C(s(s({ multiple: true, className: "form-control", files: l, fileInputName: n, id: n }, g ? { fileTypes: g } : void 0), v ? { sizeLimit: Nr(v) } : void 0), { sizeLimitErrorMessage: ((M = h.validationMessages) == null ? void 0 : M.maxSize) || o.maxFileSizeErrorMessage, maxFiles: e.schema.maxItems, maxFilesErrorMessage: ((E = e.schema.validationMessages) == null ? void 0 : E.maxItems) || o.maxItemsErrorMessage, uploadButtonTitle: h.title, description: h.description, disabled: e.disabled, onUploadFile: (P) => u(P.get(n)), onFilesChange: d, onDeleteFile: () => Promise.resolve() }), x = `${n}-feedback`;
1341
1345
  return (0, ft.jsxs)("div", { className: (0, Ui.default)("form-group", { "has-error": F }), children: [(0, ft.jsx)("label", { className: "d-block control-label", htmlFor: n, children: e.schema.title }), (0, ft.jsx)("div", { "aria-describedby": x, children: (0, ft.jsx)(_r.UploadInput, s({}, O)) }), (0, ft.jsx)(He, { id: x, changed: i, submitted: e.submitted, errors: e.errors, schema: e.schema, validations: S, validationMessages: hd(r, !!e.required, o), infoMessage: null, focused: false, blurred: true })] });
1342
1346
  }
1343
1347
  Hi.defaultProps = { errors: null, required: false };
@@ -1355,7 +1359,7 @@ var require_main_min = __commonJS({
1355
1359
  let { minItems: a, maxItems: o } = e;
1356
1360
  return s(s(s({}, t && { required: r.requiredMessage }), a && { minItems: r.minItemsErrorMessage }), o && { maxItems: r.maxItemsErrorMessage });
1357
1361
  }
1358
- var Nt = require("@transferwise/components");
1362
+ var Bt = require("@transferwise/components");
1359
1363
  var Zi = require("@transferwise/icons");
1360
1364
  var Xr = require("react");
1361
1365
  var Qi = require("react-intl");
@@ -1374,26 +1378,26 @@ var require_main_min = __commonJS({
1374
1378
  }
1375
1379
  var Ji = gd;
1376
1380
  var Jr = (e, t) => {
1377
- let r = sr(e, t);
1381
+ let r = cr(e, t);
1378
1382
  if (r >= 0)
1379
1383
  return r;
1380
- if (e.oneOf.length === 1 && er(e.oneOf[0]))
1384
+ if (e.oneOf.length === 1 && tr(e.oneOf[0]))
1381
1385
  return 0;
1382
1386
  if (we(e.oneOf[0])) {
1383
- let a = sr(e, e.default);
1387
+ let a = cr(e, e.default);
1384
1388
  if (a >= 0)
1385
1389
  return a;
1386
1390
  }
1387
- return lt(e) && $(t) && Object.keys(t).length >= 1 ? Rt(e, t) : lt(e) && !Y(e.default) && $(e.default) && Object.keys(e.default).length >= 1 ? Rt(e, e.default) : null;
1391
+ return lt(e) && $(t) && Object.keys(t).length >= 1 ? Nt(e, t) : lt(e) && !Y(e.default) && $(e.default) && Object.keys(e.default).length >= 1 ? Nt(e, e.default) : null;
1388
1392
  };
1389
- var sr = (e, t) => {
1393
+ var cr = (e, t) => {
1390
1394
  let r = (a) => !Y(t) && G(t, a);
1391
1395
  return e.oneOf.filter(r).length === 1 ? e.oneOf.findIndex(r) : -1;
1392
1396
  };
1393
- function Rt(e, t) {
1397
+ function Nt(e, t) {
1394
1398
  if (t == null)
1395
1399
  return null;
1396
- let r = e.oneOf.map((a) => wd(a).reduce((o, [n, i]) => we(i) && i.const === t[n] ? o + 2 : er(i) && typeof t[n] != "undefined" ? o + 1 : o, 0));
1400
+ let r = e.oneOf.map((a) => wd(a).reduce((o, [n, i]) => we(i) && i.const === t[n] ? o + 2 : tr(i) && typeof t[n] != "undefined" ? o + 1 : o, 0));
1397
1401
  return r.every((a) => a === r[0]) ? null : r.indexOf(Math.max(...r));
1398
1402
  }
1399
1403
  function wd(e) {
@@ -1438,7 +1442,7 @@ var require_main_min = __commonJS({
1438
1442
  if (lt(t)) {
1439
1443
  if (!$(r))
1440
1444
  return null;
1441
- let n = Rt(t, r);
1445
+ let n = Nt(t, r);
1442
1446
  if (n === null || n < 0)
1443
1447
  return null;
1444
1448
  let i = t.oneOf[n];
@@ -1481,7 +1485,7 @@ var require_main_min = __commonJS({
1481
1485
  }, f = () => {
1482
1486
  p({ item: null, model: null }), i(null);
1483
1487
  }, { formatMessage: w } = (0, Qi.useIntl)();
1484
- return (0, Fe.jsxs)(Fe.Fragment, { children: [e.title && (0, Fe.jsx)(Nt.Header, { title: e.title }), c && c.map((S) => (0, Fe.jsx)(Wi, { item: S, onClick: () => u(S) }, JSON.stringify(S))), (0, Fe.jsx)(Nt.NavigationOption, { onClick: y, media: (0, Fe.jsx)(Zi.Plus, {}), title: e.addItemTitle || w(ht.addItemTitle), showMediaAtAllSizes: true }), (0, Fe.jsx)(Nt.Modal, { open: n !== null, onClose: f, title: (n === "add" ? e.addItemTitle : e.editItemTitle) || w(ht.addItemTitle), body: (0, Fe.jsx)(Ji, { type: n != null ? n : "add", schema: e, model: m.model, errors: r, submitted: a, onAction: d, onModelChange: ({ model: S }) => p(C(s({}, m), { model: S })) }) })] });
1488
+ return (0, Fe.jsxs)(Fe.Fragment, { children: [e.title && (0, Fe.jsx)(Bt.Header, { title: e.title }), c && c.map((S) => (0, Fe.jsx)(Wi, { item: S, onClick: () => u(S) }, JSON.stringify(S))), (0, Fe.jsx)(Bt.NavigationOption, { onClick: y, media: (0, Fe.jsx)(Zi.Plus, {}), title: e.addItemTitle || w(ht.addItemTitle), showMediaAtAllSizes: true }), (0, Fe.jsx)(Bt.Modal, { open: n !== null, onClose: f, title: (n === "add" ? e.addItemTitle : e.editItemTitle) || w(ht.addItemTitle), body: (0, Fe.jsx)(Ji, { type: n != null ? n : "add", schema: e, model: m.model, errors: r, submitted: a, onAction: d, onModelChange: ({ model: S }) => p(C(s({}, m), { model: S })) }) })] });
1485
1489
  };
1486
1490
  var vd = (e, { originalItem: t, updatedItem: r, itemSummaries: a }) => {
1487
1491
  if (e === "remove")
@@ -1534,7 +1538,7 @@ var require_main_min = __commonJS({
1534
1538
  return (0, fe.jsxs)(fe.Fragment, { children: [e.schema.alert && (0, fe.jsx)(se, { component: e.schema.alert }), (0, fe.jsxs)("fieldset", { children: [e.schema.title && !e.hideTitle && (0, fe.jsxs)("legend", { children: [" ", e.schema.title, " "] }), e.schema.description && !e.hideTitle && (0, fe.jsxs)("p", { children: [" ", e.schema.description, " "] }), (0, fe.jsx)("div", { className: "row", children: c.map((m) => (0, fe.jsx)("div", { className: (0, ns.default)(Ad(e.schema.properties[m].width)), children: (0, fe.jsx)(me, { schema: e.schema.properties[m], model: e.model && e.model[m], errors: l == null ? void 0 : l[m], submitted: e.submitted, required: o(m), disabled: e.disabled, onChange: (p) => a(m, p), onPersistAsync: e.onPersistAsync }) }, m)) })] })] });
1535
1539
  }
1536
1540
  is.defaultProps = { hideTitle: false, disabled: false };
1537
- var cr = is;
1541
+ var mr = is;
1538
1542
  var Ss = require("@transferwise/components");
1539
1543
  var Fs = Ee(Xe());
1540
1544
  var Ne = require("react");
@@ -1543,15 +1547,15 @@ var require_main_min = __commonJS({
1543
1547
  var ss = require("react-intl");
1544
1548
  var cs = (0, ss.defineMessages)({ helpAria: { id: "dynamicFlows.Help.ariaLabel", defaultMessage: "Click here for more info.", description: "Aria label for help." } });
1545
1549
  var no = require("react/jsx-runtime");
1546
- var Od = (e) => {
1550
+ function Od(e) {
1547
1551
  let t = (0, ms.useIntl)();
1548
1552
  return (0, no.jsx)(Zr.Info, { className: "m-l-1", content: (0, no.jsx)(Zr.Markdown, { children: e.help.markdown }), presentation: "POPOVER", size: "sm", "aria-label": t.formatMessage(cs.helpAria) });
1549
- };
1553
+ }
1550
1554
  var qe = Od;
1551
1555
  var ws = require("react");
1552
1556
  var _ = require("@transferwise/components");
1553
1557
  var ys = require("react");
1554
- var Bt = (e, t = {}) => {
1558
+ var zt = (e, t = {}) => {
1555
1559
  let { coerceValue: r = false } = t;
1556
1560
  if (!I(e)) {
1557
1561
  if (R(e)) {
@@ -1691,9 +1695,9 @@ var require_main_min = __commonJS({
1691
1695
  A.target instanceof HTMLElement && A.target.blur();
1692
1696
  }, "aria-describedby": U });
1693
1697
  case N.HIDDEN:
1694
- return (0, Z.jsx)("input", { type: "hidden", name: r, value: Bt(P, { coerceValue: true }), id: x });
1698
+ return (0, Z.jsx)("input", { type: "hidden", name: r, value: zt(P, { coerceValue: true }), id: x });
1695
1699
  case N.PASSWORD:
1696
- return (0, Z.jsx)("input", { autoComplete: this.getAutocompleteValue(), className: "form-control", disabled: l, id: x, placeholder: a, readOnly: m, required: p, type: "password", value: Bt(P, { coerceValue: true }), onBlur: this.handleOnBlur, onChange: this.handleInputOnChange, onFocus: this.handleOnFocus, "aria-describedby": U });
1700
+ return (0, Z.jsx)("input", { autoComplete: this.getAutocompleteValue(), className: "form-control", disabled: l, id: x, placeholder: a, readOnly: m, required: p, type: "password", value: zt(P, { coerceValue: true }), onBlur: this.handleOnBlur, onChange: this.handleInputOnChange, onFocus: this.handleOnFocus, "aria-describedby": U });
1697
1701
  case N.DATE:
1698
1702
  case N.DATETIME:
1699
1703
  return (0, Z.jsx)(_.DateInput, { disabled: l, size: F, value: ds(P), mode: D, monthFormat: O, onBlur: this.handleOnBlur, onChange: this.handleOnChange, onFocus: this.handleOnFocus });
@@ -1702,9 +1706,9 @@ var require_main_min = __commonJS({
1702
1706
  this.handleOnChange(qn(A));
1703
1707
  }, onBlur: this.handleOnBlur, onFocus: this.handleOnFocus });
1704
1708
  case N.TEL:
1705
- return (0, Z.jsx)(_.PhoneNumberInput, { disabled: l, countryCode: n, placeholder: a, required: p, searchPlaceholder: f, size: F, initialValue: Bt(P), onBlur: this.handleOnBlur, onChange: this.handleOnChange, onFocus: this.handleOnFocus });
1709
+ return (0, Z.jsx)(_.PhoneNumberInput, { disabled: l, countryCode: n, placeholder: a, required: p, searchPlaceholder: f, size: F, initialValue: zt(P), onBlur: this.handleOnBlur, onChange: this.handleOnChange, onFocus: this.handleOnFocus });
1706
1710
  case N.TEXTAREA: {
1707
- let A = { className: "form-control tw-form-control", id: x, name: r, placeholder: a, value: Bt(P, { coerceValue: true }), readOnly: m, required: p, minLength: h, maxLength: y, onFocus: this.handleOnFocus, onBlur: this.handleOnBlur, disabled: l, autoComplete: this.getAutocompleteValue() };
1711
+ let A = { className: "form-control tw-form-control", id: x, name: r, placeholder: a, value: zt(P, { coerceValue: true }), readOnly: m, required: p, minLength: h, maxLength: y, onFocus: this.handleOnFocus, onBlur: this.handleOnBlur, disabled: l, autoComplete: this.getAutocompleteValue() };
1708
1712
  return this.props.displayPattern ? (0, Z.jsx)(_.TextareaWithDisplayFormat, C(s({ displayPattern: this.props.displayPattern }, A), { onChange: this.handleOnChange })) : (0, Z.jsx)("textarea", C(s({}, A), { onChange: this.handleInputOnChange, "aria-describedby": U }));
1709
1713
  }
1710
1714
  case N.FILE:
@@ -1719,14 +1723,14 @@ var require_main_min = __commonJS({
1719
1723
  case N.TEXT:
1720
1724
  case N.EMAIL:
1721
1725
  default: {
1722
- let A = { type: i === N.EMAIL ? "email" : "text", className: "form-control", id: x, name: r, placeholder: a, value: Bt(P, { coerceValue: true }), readOnly: m, required: p, minLength: h, maxLength: y, onFocus: this.handleOnFocus, onBlur: this.handleOnBlur, disabled: l, autoComplete: this.getAutocompleteValue() };
1726
+ let A = { type: i === N.EMAIL ? "email" : "text", className: "form-control", id: x, name: r, placeholder: a, value: zt(P, { coerceValue: true }), readOnly: m, required: p, minLength: h, maxLength: y, onFocus: this.handleOnFocus, onBlur: this.handleOnBlur, disabled: l, autoComplete: this.getAutocompleteValue() };
1723
1727
  return this.props.displayPattern ? (0, Z.jsx)(_.InputWithDisplayFormat, C(s({ displayPattern: this.props.displayPattern }, A), { onChange: this.handleOnChange })) : (0, Z.jsx)("input", C(s({}, A), { onChange: this.handleInputOnChange, "aria-describedby": U }));
1724
1728
  }
1725
1729
  }
1726
1730
  }
1727
1731
  };
1728
1732
  be.Type = N, be.Size = ni, be.MonthFormat = oi, be.DateMode = ai, be.defaultProps = { autoComplete: true, countryCode: null, disabled: false, displayPattern: null, id: null, label: "", max: null, maxDate: null, maxLength: null, min: null, minDate: null, minLength: null, mode: be.DateMode.DAY_MONTH_YEAR, monthFormat: be.MonthFormat.LONG, onBlur: null, onFocus: null, onSearchChange: null, options: [], placeholder: null, readOnly: false, required: false, searchPlaceholder: null, searchValue: "", selectedOption: null, size: be.Size.MEDIUM, step: 1, type: be.Type.TEXT, uploadProps: {}, value: null };
1729
- var zt = be;
1733
+ var jt = be;
1730
1734
  var et = require("@transferwise/components");
1731
1735
  var xe = require("react/jsx-runtime");
1732
1736
  var fs = (e, t) => {
@@ -1738,12 +1742,12 @@ var require_main_min = __commonJS({
1738
1742
  return Pd(e);
1739
1743
  }
1740
1744
  };
1741
- var Pd = (e) => s(s(s({ label: e.title, value: e.const }, hs(e.title, e.description)), jt(e)), gs(e.disabled));
1745
+ var Pd = (e) => s(s(s({ label: e.title, value: e.const }, hs(e.title, e.description)), Vt(e)), gs(e.disabled));
1742
1746
  var Md = (e) => s(s(s(s(s({ label: e.title, value: e.const }, hs(e.title, e.description)), Id(e.icon)), Ed(e.image)), gs(e.disabled)), kd(e.keywords));
1743
1747
  var kd = (e) => j(e) ? { searchStrings: e } : {};
1744
1748
  var Ed = (e) => e != null && e.url ? { icon: (0, xe.jsx)("div", { className: "media", children: (0, xe.jsx)("div", { className: "np-option__no-media-circle", children: (0, xe.jsx)("img", { src: e.url, alt: e.name || "" }) }) }) } : null;
1745
- var Id = (e) => e != null && e.name && Dt(e.name) ? { currency: e.name.substring(5) } : e != null && e.name && $a(e.name) ? { icon: (0, xe.jsx)(Ye, { type: e.name }) } : e != null && e.text ? { icon: (0, xe.jsx)("span", { children: e.text }) } : null;
1746
- var jt = ({ image: e, icon: t }) => e != null && e.url ? { avatar: (0, xe.jsx)(et.Avatar, { type: et.AvatarType.THUMBNAIL, children: (0, xe.jsx)("img", { src: e.url, alt: "" }) }) } : t != null && t.name && $a(t.name) ? { avatar: (0, xe.jsx)(et.Avatar, { type: et.AvatarType.ICON, children: (0, xe.jsx)(Ye, { type: t.name }) }) } : t != null && t.text ? { avatar: (0, xe.jsx)(et.Avatar, { type: et.AvatarType.INITIALS, children: t.text }) } : null;
1749
+ var Id = (e) => e != null && e.name && Lt(e.name) ? { currency: e.name.substring(5) } : e != null && e.name && $a(e.name) ? { icon: (0, xe.jsx)(Ye, { type: e.name }) } : e != null && e.text ? { icon: (0, xe.jsx)("span", { children: e.text }) } : null;
1750
+ var Vt = ({ image: e, icon: t }) => e != null && e.url ? { avatar: (0, xe.jsx)(et.Avatar, { type: et.AvatarType.THUMBNAIL, children: (0, xe.jsx)("img", { src: e.url, alt: "" }) }) } : t != null && t.name && $a(t.name) ? { avatar: (0, xe.jsx)(et.Avatar, { type: et.AvatarType.ICON, children: (0, xe.jsx)(Ye, { type: t.name }) }) } : t != null && t.text ? { avatar: (0, xe.jsx)(et.Avatar, { type: et.AvatarType.INITIALS, children: t.text }) } : null;
1747
1751
  var Qr = ({ accepts: e }) => s({}, j(e) && { usAccept: e.join(",") });
1748
1752
  var hs = (e, t) => {
1749
1753
  if (e && t)
@@ -1761,27 +1765,27 @@ var require_main_min = __commonJS({
1761
1765
  var Rd = { date: "date", email: "email", base64url: "file", password: "password", "phone-number": "tel" };
1762
1766
  var Nd = (e, t) => e.oneOf ? e.oneOf.map((r) => fs(r, t)) : null;
1763
1767
  function Cs(e) {
1764
- let { id: t, schema: r, value: a, disabled: o, onChange: n, onFocus: i, onBlur: c, onSearchChange: l, describedBy: m } = e, p = Pt(), h = (F) => Dd(r.type) && (I(F) || Y(F)) ? "" : F, y = (F, g) => {
1768
+ let { id: t, schema: r, value: a, disabled: o, onChange: n, onFocus: i, onBlur: c, onSearchChange: l, describedBy: m } = e, p = Mt(), h = (F) => Dd(r.type) && (I(F) || Y(F)) ? "" : F, y = (F, g) => {
1765
1769
  n($e(F, r), g);
1766
1770
  }, u = lo(r);
1767
1771
  (0, ws.useEffect)(() => {
1768
1772
  Bd(r, p, u);
1769
1773
  }, [JSON.stringify(r), p, u]);
1770
1774
  let d = r.values || Nd(r, u), f = { onFocus: i, onBlur: c, onSearchChange: l, onChange: y }, w = h(a), S = { id: t, name: t, label: r.title, options: d || [], placeholder: r.placeholder, autoComplete: !r.help, autocompleteHint: r.autocompleteHint, disabled: o || r.disabled, displayPattern: r.displayFormat, uploadProps: Qr(r), describedBy: m };
1771
- return (0, mo.jsx)("div", { "aria-describedby": m, children: (0, mo.jsx)(zt, s(s({ type: u, value: w }, f), S)) });
1775
+ return (0, mo.jsx)("div", { "aria-describedby": m, children: (0, mo.jsx)(jt, s(s({ type: u, value: w }, f), S)) });
1772
1776
  }
1773
1777
  Cs.defaultProps = { value: null, onFocus: null, onBlur: null, onSearchChange: null, disabled: false };
1774
1778
  var Bd = (e, t, r) => {
1775
1779
  ge(e) && e.oneOf.length === 2 && !e.control && t.warning("Deprecation warning", 'A oneOf schema with 2 options and no control type currently renders as a "radio" but will be changed to render as a "select". Please specify control radio to retain the existing behaviour.'), r === "file" && t.warning("Deprecation warning", "Please use a persist-async blob schema instead of string with base64url for file uploads. The base64url does not perform well on low end devices. Support for this schema will be removed in a later release."), e.values && t.warning("Deprecated schema", "Schema.values is a legacy approach. Please use oneOf.");
1776
1780
  };
1777
- var mr = Cs;
1781
+ var lr = Cs;
1778
1782
  var Q = require("react/jsx-runtime");
1779
1783
  function bs(e) {
1780
1784
  let t = re(), [r, a] = (0, Ne.useState)(false), [o, n] = (0, Ne.useState)(false), [i, c] = (0, Ne.useState)(false), l = (0, Ne.useMemo)(() => e.schema.$id || Te(), [e.schema.$id]), [m, p] = (0, Ne.useState)(Jr(e.schema, e.model)), [h, y] = (0, Ne.useState)(Ud(e.model, e.schema.oneOf)), u = Qn(t, 200), d = (M) => {
1781
1785
  u("Dynamic Flow - OneOf Searched", { oneOfId: e.schema.analyticsId, searchValueLength: M.length });
1782
1786
  };
1783
1787
  if ((0, Ne.useEffect)(() => {
1784
- let M = sr(e.schema, e.model), E = sr(e.schema, e.schema.default);
1788
+ let M = cr(e.schema, e.model), E = cr(e.schema, e.schema.default);
1785
1789
  M === -1 && E >= 0 && F(E, "init");
1786
1790
  }, [e.schema]), !j(e.schema.oneOf))
1787
1791
  return console.error("Incorrect format", e.schema), null;
@@ -1800,8 +1804,8 @@ var require_main_min = __commonJS({
1800
1804
  } else
1801
1805
  e.onChange({ model: h[M], triggerSchema: P, triggerModel: h[M], type: E });
1802
1806
  E !== "init" && e.schema.analyticsId && t("Dynamic Flow - OneOf Selected", { oneOfId: e.schema.analyticsId, schemaId: P == null ? void 0 : P.analyticsId });
1803
- }, g = Hd(e.schema), v = jd(e, m), O = { "form-group": true, "has-error": !r && e.errors && !Mt(e.errors) || (e.submitted || r && i) && v.length }, x = `${l}-feedback`;
1804
- return (0, Q.jsxs)(Q.Fragment, { children: [(e.schema.oneOf.length > 1 || we(e.schema.oneOf[0])) && (0, Q.jsxs)(Q.Fragment, { children: [e.schema.alert && (0, Q.jsx)(se, { component: e.schema.alert }), (0, Q.jsxs)("div", { className: (0, Fs.default)(O), children: [zd(e.schema, l), (0, Q.jsx)(mr, { id: l, schema: g, value: m, disabled: e.disabled, describedBy: x, onChange: F, onFocus: w, onBlur: S, onSearchChange: d }), (0, Q.jsx)(He, { id: x, changed: r, focused: o, blurred: i, submitted: e.submitted, errors: Vd(e.errors), schema: e.schema, validations: v, infoMessage: null })] })] }), er(e.schema.oneOf[m]) && (0, Q.jsx)(me, { schema: e.schema.oneOf[m], model: h[m], errors: e.errors, submitted: e.submitted, hideTitle: true, disabled: e.disabled, onChange: (M) => f(m, M), onPersistAsync: e.onPersistAsync })] });
1807
+ }, g = Hd(e.schema), v = jd(e, m), O = { "form-group": true, "has-error": !r && e.errors && !kt(e.errors) || (e.submitted || r && i) && v.length }, x = `${l}-feedback`;
1808
+ return (0, Q.jsxs)(Q.Fragment, { children: [(e.schema.oneOf.length > 1 || we(e.schema.oneOf[0])) && (0, Q.jsxs)(Q.Fragment, { children: [e.schema.alert && (0, Q.jsx)(se, { component: e.schema.alert }), (0, Q.jsxs)("div", { className: (0, Fs.default)(O), children: [zd(e.schema, l), (0, Q.jsx)(lr, { id: l, schema: g, value: m, disabled: e.disabled, describedBy: x, onChange: F, onFocus: w, onBlur: S, onSearchChange: d }), (0, Q.jsx)(He, { id: x, changed: r, focused: o, blurred: i, submitted: e.submitted, errors: Vd(e.errors), schema: e.schema, validations: v, infoMessage: null })] })] }), tr(e.schema.oneOf[m]) && (0, Q.jsx)(me, { schema: e.schema.oneOf[m], model: h[m], errors: e.errors, submitted: e.submitted, hideTitle: true, disabled: e.disabled, onChange: (M) => f(m, M), onPersistAsync: e.onPersistAsync })] });
1805
1809
  }
1806
1810
  function zd(e, t) {
1807
1811
  var o;
@@ -1816,7 +1820,7 @@ var require_main_min = __commonJS({
1816
1820
  return typeof e == "string" ? e : null;
1817
1821
  }
1818
1822
  function Ud(e, t) {
1819
- return t.map((r) => kt(e, r));
1823
+ return t.map((r) => Et(e, r));
1820
1824
  }
1821
1825
  function Hd(e) {
1822
1826
  return C(s({}, e), { oneOf: e.oneOf.map(qd) });
@@ -1836,7 +1840,7 @@ var require_main_min = __commonJS({
1836
1840
  let { id: t, httpClient: r = fetch, httpOptions: a, fileId: o, idProperty: n, usAccept: i, maxSize: c, usPlaceholder: l, onSuccess: m, onFailure: p, onCancel: h } = e, y = re(), u = (0, xs.useMemo)(() => o ? [{ id: o, status: ea.Status.SUCCEEDED }] : [], [o]), d = (f) => (y("Dynamic Flow - PersistAsync", { status: "pending", schemaId: t }), r(String(a.url), { method: a.method || "POST", body: f }).then((w) => w.ok ? (m == null || m(w.clone()), w.json().then((S) => ({ id: S[n] }))) : (p == null || p({ response: w }), Promise.reject())));
1837
1841
  return (0, As.jsx)(ea.UploadInput, { id: t, fileInputName: a.fileInputName, files: u, uploadButtonTitle: e.usLabel, sizeLimit: c ? Nr(c) : void 0, fileTypes: i, description: l, onUploadFile: d, onDeleteFile: (f) => (h == null || h(), Promise.resolve()) });
1838
1842
  }
1839
- var Vt = require("react/jsx-runtime");
1843
+ var Ut = require("react/jsx-runtime");
1840
1844
  function Ps(e) {
1841
1845
  let [t, r] = (0, wt.useState)({}), [a, o] = (0, wt.useState)(null), [n, i] = (0, wt.useState)([]), [c, l] = (0, wt.useState)(false), m = ae(), p = re();
1842
1846
  (0, wt.useEffect)(() => {
@@ -1854,7 +1858,7 @@ var require_main_min = __commonJS({
1854
1858
  }, d = () => {
1855
1859
  o(null), e.onChange({ model: null, triggerSchema: e.schema, triggerModel: null }), l(true);
1856
1860
  }, { url: f, method: w } = e.schema.persistAsync, S = a || n, F = { "form-group": true, "has-error": (e.submitted || c) && !!S.length }, g = e.schema.$id || e.schema.persistAsync.schema.$id || e.schema.persistAsync.idProperty, v = `${g}-feedback`;
1857
- return (0, Vt.jsxs)("div", { className: (0, Os.default)(F), children: [(0, Vt.jsx)("div", { "aria-describedby": v, children: (0, Vt.jsx)(vs, s({ id: g, fileId: e.model, idProperty: e.schema.persistAsync.idProperty, animationDelay: 0, maxSize: e.schema.persistAsync.schema.maxSize, usLabel: e.schema.title || e.schema.persistAsync.schema.title, usPlaceholder: e.schema.description || e.schema.persistAsync.schema.description, httpOptions: { url: f, method: w, fileInputName: e.schema.persistAsync.param }, httpClient: m, onSuccess: y, onFailure: u, onCancel: d }, Qr(e.schema.persistAsync.schema))) }), (0, Vt.jsx)(He, { id: v, blurred: true, focused: false, changed: c, submitted: e.submitted, errors: e.errors, schema: e.schema, validations: S, validationMessages: s({ required: "Value is required..." }, t), infoMessage: null })] });
1861
+ return (0, Ut.jsxs)("div", { className: (0, Os.default)(F), children: [(0, Ut.jsx)("div", { "aria-describedby": v, children: (0, Ut.jsx)(vs, s({ id: g, fileId: e.model, idProperty: e.schema.persistAsync.idProperty, animationDelay: 0, maxSize: e.schema.persistAsync.schema.maxSize, usLabel: e.schema.title || e.schema.persistAsync.schema.title, usPlaceholder: e.schema.description || e.schema.persistAsync.schema.description, httpOptions: { url: f, method: w, fileInputName: e.schema.persistAsync.param }, httpClient: m, onSuccess: y, onFailure: u, onCancel: d }, Qr(e.schema.persistAsync.schema))) }), (0, Ut.jsx)(He, { id: v, blurred: true, focused: false, changed: c, submitted: e.submitted, errors: e.errors, schema: e.schema, validations: S, validationMessages: s({ required: "Value is required..." }, t), infoMessage: null })] });
1858
1862
  }
1859
1863
  Ps.defaultProps = { required: false };
1860
1864
  var yo = Ps;
@@ -1867,7 +1871,7 @@ var require_main_min = __commonJS({
1867
1871
  var go = Ms;
1868
1872
  var zs = require("react");
1869
1873
  var ks = (e, t) => {
1870
- let r = Rt(e, t);
1874
+ let r = Nt(e, t);
1871
1875
  return r !== null ? e.oneOf[r].promoted ? "promoted" : "other" : null;
1872
1876
  };
1873
1877
  var Es = require("@transferwise/components");
@@ -1881,23 +1885,23 @@ var require_main_min = __commonJS({
1881
1885
  Is.defaultProps = {};
1882
1886
  var Ds = Is;
1883
1887
  var Ls = require("@transferwise/components");
1884
- var lr = require("react/jsx-runtime");
1888
+ var dr = require("react/jsx-runtime");
1885
1889
  function Ts(e) {
1886
1890
  var l, m;
1887
- let { id: t, selection: r, setSelection: a, promotion: o, promotedOneOf: n, title: i } = e, c = [s({ value: "promoted", label: ((l = o.promoted) == null ? void 0 : l.title) || n.title, secondary: ((m = o.promoted) == null ? void 0 : m.description) || n.description }, jt(n)), s({ value: "other", label: o.other.title, secondary: o.other.description }, jt(o.other))];
1888
- return (0, lr.jsxs)("div", { className: "form-group", children: [i && (0, lr.jsx)("label", { className: "control-label", htmlFor: t, children: i }), (0, lr.jsx)(Ls.RadioGroup, { name: "promoted-selection", selectedValue: r, radios: c, id: t, onChange: a })] });
1891
+ let { id: t, selection: r, setSelection: a, promotion: o, promotedOneOf: n, title: i } = e, c = [s({ value: "promoted", label: ((l = o.promoted) == null ? void 0 : l.title) || n.title, secondary: ((m = o.promoted) == null ? void 0 : m.description) || n.description }, Vt(n)), s({ value: "other", label: o.other.title, secondary: o.other.description }, Vt(o.other))];
1892
+ return (0, dr.jsxs)("div", { className: "form-group", children: [i && (0, dr.jsx)("label", { className: "control-label", htmlFor: t, children: i }), (0, dr.jsx)(Ls.RadioGroup, { name: "promoted-selection", selectedValue: r, radios: c, id: t, onChange: a })] });
1889
1893
  }
1890
1894
  Ts.defaultProps = { title: void 0 };
1891
1895
  var Rs = Ts;
1892
- var Ut = require("react/jsx-runtime");
1896
+ var Ht = require("react/jsx-runtime");
1893
1897
  function Ns(e) {
1894
1898
  switch (e.promotion.control || "radio") {
1895
1899
  case "radio":
1896
- return (0, Ut.jsx)(Rs, s({}, e));
1900
+ return (0, Ht.jsx)(Rs, s({}, e));
1897
1901
  case "checkbox":
1898
- return (0, Ut.jsx)(Ds, s({}, e));
1902
+ return (0, Ht.jsx)(Ds, s({}, e));
1899
1903
  default:
1900
- return (0, Ut.jsx)(Ut.Fragment, {});
1904
+ return (0, Ht.jsx)(Ht.Fragment, {});
1901
1905
  }
1902
1906
  }
1903
1907
  Ns.defaultProps = { id: Te(), title: void 0 };
@@ -1907,7 +1911,7 @@ var require_main_min = __commonJS({
1907
1911
  var Gd = (e) => {
1908
1912
  var c;
1909
1913
  let [t, r] = (0, zs.useState)(ks(e.schema, e.model) || ((c = e.schema.promotion) == null ? void 0 : c.default) || "promoted"), a = e.schema.alert, o = e.schema.oneOf.find(js), n = Wd(o), i = $d(e.schema);
1910
- return (0, Ge.jsxs)(Ge.Fragment, { children: [a && (0, Ge.jsx)(se, { component: a }), (0, Ge.jsx)(Bs, { id: e.schema.$id, title: e.schema.title, promotedOneOf: o, promotion: e.schema.promotion, selection: t, setSelection: r }), t === "promoted" && (0, Ge.jsx)(cr, C(s({}, e), { schema: n })), t === "other" && (0, Ge.jsx)(me, C(s({}, e), { schema: i }))] });
1914
+ return (0, Ge.jsxs)(Ge.Fragment, { children: [a && (0, Ge.jsx)(se, { component: a }), (0, Ge.jsx)(Bs, { id: e.schema.$id, title: e.schema.title, promotedOneOf: o, promotion: e.schema.promotion, selection: t, setSelection: r }), t === "promoted" && (0, Ge.jsx)(mr, C(s({}, e), { schema: n })), t === "other" && (0, Ge.jsx)(me, C(s({}, e), { schema: i }))] });
1911
1915
  };
1912
1916
  function Wd(e) {
1913
1917
  return C(s({}, e), { title: void 0, description: void 0 });
@@ -1922,10 +1926,10 @@ var require_main_min = __commonJS({
1922
1926
  var Us = require("react-intl");
1923
1927
  var Vs = require("react-intl");
1924
1928
  var So = (0, Vs.defineMessages)({ yes: { id: "dynamicFlows.ReadOnlySchema.yes", defaultMessage: "Yes", description: "Yes, used for boolean schemas with a value of true." }, no: { id: "dynamicFlows.ReadOnlySchema.no", defaultMessage: "No", description: "No: used for boolean schemas with a value of false." } });
1925
- var Ht = require("react/jsx-runtime");
1929
+ var qt = require("react/jsx-runtime");
1926
1930
  function _d({ schema: e, model: t }) {
1927
1931
  let { title: r = "" } = e, { formatMessage: a } = (0, Us.useIntl)(), o = Kd({ schema: e, model: t, formatMessage: a });
1928
- return (0, Ht.jsx)(ta.DefinitionList, { layout: ta.Layout.VERTICAL_ONE_COLUMN, definitions: [{ title: r, value: o, key: "" }] });
1932
+ return (0, qt.jsx)(ta.DefinitionList, { layout: ta.Layout.VERTICAL_ONE_COLUMN, definitions: [{ title: r, value: o, key: "" }] });
1929
1933
  }
1930
1934
  var Fo = _d;
1931
1935
  function Kd({ schema: e, model: t, formatMessage: r }) {
@@ -1939,13 +1943,13 @@ var require_main_min = __commonJS({
1939
1943
  return e.oneOf.find((r) => "const" in r ? t === r.const : false);
1940
1944
  }
1941
1945
  function Yd(e) {
1942
- let t = e.title && e.description ? `${e.title} - ${e.description}` : e.title || "", r = jt({ icon: e.icon });
1943
- return r != null && r.avatar ? (0, Ht.jsxs)(Ht.Fragment, { children: [r.avatar, " ", t] }) : t;
1946
+ let t = e.title && e.description ? `${e.title} - ${e.description}` : e.title || "", r = Vt({ icon: e.icon });
1947
+ return r != null && r.avatar ? (0, qt.jsxs)(qt.Fragment, { children: [r.avatar, " ", t] }) : t;
1944
1948
  }
1945
1949
  var Be = require("react");
1946
1950
  var qs = require("react/jsx-runtime");
1947
1951
  function Hs(e) {
1948
- let { schema: t, model: r, required: a, submitted: o, errors: n, onChange: i } = e, [c, l] = (0, Be.useState)(r), m = (0, Be.useRef)(null), [p, h] = (0, Be.useState)(null), [y, u] = (0, Be.useState)(null), [d, f] = (0, Be.useState)(false), [w, S] = (0, Be.useState)(null), F = ae(), g = re(), v = Pt();
1952
+ let { schema: t, model: r, required: a, submitted: o, errors: n, onChange: i } = e, [c, l] = (0, Be.useState)(r), m = (0, Be.useRef)(null), [p, h] = (0, Be.useState)(null), [y, u] = (0, Be.useState)(null), [d, f] = (0, Be.useState)(false), [w, S] = (0, Be.useState)(null), F = ae(), g = re(), v = Mt();
1949
1953
  (0, Be.useEffect)(() => {
1950
1954
  t.validationAsync.method || v.warning("Invalid schema or model", 'ValidationAsyncSchema without a "method" property would have defaulted to "GET" in previous versions. Now defaults to "POST".', {});
1951
1955
  }, [v, t.validationAsync.method]);
@@ -1977,7 +1981,7 @@ var require_main_min = __commonJS({
1977
1981
  var he = require("react/jsx-runtime");
1978
1982
  var Ws = require("react");
1979
1983
  function Zd(e) {
1980
- let { schema: t, model: r = null, errors: a = null, hideTitle: o = false, disabled: n = false } = e, i = C(s({}, e), { model: r, errors: a, hideTitle: o, disabled: n }), c = dt(t), l = Pt();
1984
+ let { schema: t, model: r = null, errors: a = null, hideTitle: o = false, disabled: n = false } = e, i = C(s({}, e), { model: r, errors: a, hideTitle: o, disabled: n }), c = dt(t), l = Mt();
1981
1985
  switch ((0, Gs.useEffect)(() => {
1982
1986
  Qd(t, r, a) || l.error("Invalid schema or model", `Schema of type ${c || "undefined"} requested, but schema did not pass validation.`);
1983
1987
  }, [JSON.stringify(t), JSON.stringify(r), JSON.stringify(a), c, l]), c) {
@@ -1992,7 +1996,7 @@ var require_main_min = __commonJS({
1992
1996
  return (0, he.jsx)(Ct, s({}, m));
1993
1997
  }
1994
1998
  case "object":
1995
- return (0, Ws.createElement)(cr, C(s({}, i), { key: JSON.stringify(t) }));
1999
+ return (0, Ws.createElement)(mr, C(s({}, i), { key: JSON.stringify(t) }));
1996
2000
  case "array":
1997
2001
  return (0, he.jsx)(oo, s({}, i));
1998
2002
  case "promotedOneOf":
@@ -2008,15 +2012,15 @@ var require_main_min = __commonJS({
2008
2012
  var Qd = (e, t, r) => {
2009
2013
  switch (dt(e)) {
2010
2014
  case "persistAsync":
2011
- return Br(e) && jr(t) && tr(r);
2015
+ return Br(e) && jr(t) && rr(r);
2012
2016
  case "validationAsync":
2013
- return Ha(e) && Ga(t) && tr(r);
2017
+ return Ha(e) && Ga(t) && rr(r);
2014
2018
  case "basic":
2015
- return Ve(e) && Ga(t) && tr(r);
2019
+ return Ve(e) && Ga(t) && rr(r);
2016
2020
  case "object":
2017
2021
  return Le(e) && qa(t);
2018
2022
  case "array":
2019
- return je(e) && Xn(t) && tr(r);
2023
+ return je(e) && Xn(t) && rr(r);
2020
2024
  case "promotedOneOf":
2021
2025
  return lt(e) && qa(t);
2022
2026
  case "oneOf":
@@ -2071,12 +2075,12 @@ var require_main_min = __commonJS({
2071
2075
  };
2072
2076
  var Ao = tu;
2073
2077
  var Oo = require("@transferwise/components");
2074
- var dr = require("react/jsx-runtime");
2078
+ var ur = require("react/jsx-runtime");
2075
2079
  var Po = ({ component: e }) => {
2076
2080
  let { content: t, align: r, margin: a } = e;
2077
- return (0, dr.jsx)("div", { className: Ce({ align: r, margin: a }), children: (0, dr.jsx)(Oo.Markdown, { config: { link: { target: "_blank" } }, children: t }) });
2081
+ return (0, ur.jsx)("div", { className: Ce({ align: r, margin: a }), children: (0, ur.jsx)(Oo.Markdown, { config: { link: { target: "_blank" } }, children: t }) });
2078
2082
  };
2079
- var Mo = ({ component: e }) => (0, dr.jsx)("div", { className: Ce(e), children: (0, dr.jsx)(Oo.Markdown, { config: { link: { target: "_blank" } }, children: e.markdown }) });
2083
+ var Mo = ({ component: e }) => (0, ur.jsx)("div", { className: Ce(e), children: (0, ur.jsx)(Oo.Markdown, { config: { link: { target: "_blank" } }, children: e.markdown }) });
2080
2084
  var _s = require("@transferwise/components");
2081
2085
  var aa = require("react");
2082
2086
  var ko = require("react/jsx-runtime");
@@ -2106,12 +2110,12 @@ var require_main_min = __commonJS({
2106
2110
  };
2107
2111
  var Eo = ou;
2108
2112
  var oa = require("@transferwise/components");
2109
- var ur = require("react/jsx-runtime");
2113
+ var pr = require("react/jsx-runtime");
2110
2114
  var su = ["positive", "neutral"];
2111
2115
  var cu = ["warning", "negative"];
2112
2116
  var mu = ({ component: e }) => {
2113
2117
  let { items: t } = e, r = t.filter((o) => su.includes(o.context)).map(({ text: o }) => o), a = t.filter((o) => cu.includes(o.context)).map(({ text: o }) => o);
2114
- return (0, ur.jsxs)("div", { className: V(e.margin || "md"), children: [e.title ? (0, ur.jsx)(oa.Header, { title: e.title }) : null, (0, ur.jsx)(oa.InstructionsList, { dos: r, donts: a })] });
2118
+ return (0, pr.jsxs)("div", { className: V(e.margin || "md"), children: [e.title ? (0, pr.jsx)(oa.Header, { title: e.title }) : null, (0, pr.jsx)(oa.InstructionsList, { dos: r, donts: a })] });
2115
2119
  };
2116
2120
  var Io = mu;
2117
2121
  var H = require("react/jsx-runtime");
@@ -2153,7 +2157,7 @@ var require_main_min = __commonJS({
2153
2157
  case "status-list":
2154
2158
  return (0, H.jsx)(Do, { component: p, onAction: i }, K(p));
2155
2159
  case "loading-indicator":
2156
- return (0, H.jsx)(pr, { component: p }, K(p));
2160
+ return (0, H.jsx)(yr, { component: p }, K(p));
2157
2161
  case "search":
2158
2162
  return (0, H.jsx)(Ro, { component: p, onAction: i }, K(p));
2159
2163
  case "modal":
@@ -2166,11 +2170,11 @@ var require_main_min = __commonJS({
2166
2170
  }
2167
2171
  var ne = lu;
2168
2172
  var na = require("@transferwise/components");
2169
- var qt = require("react/jsx-runtime");
2170
- var du = ({ component: e }) => (0, qt.jsxs)("div", { className: V(e.margin || "md"), children: [e.title ? (0, qt.jsx)(na.Header, { title: e.title }) : null, e.items.map(uu)] });
2173
+ var Gt = require("react/jsx-runtime");
2174
+ var du = ({ component: e }) => (0, Gt.jsxs)("div", { className: V(e.margin || "md"), children: [e.title ? (0, Gt.jsx)(na.Header, { title: e.title }) : null, e.items.map(uu)] });
2171
2175
  var uu = ({ title: e, description: t, icon: r, status: a }) => {
2172
- let o = s(s({ key: `${e}/${t || ""}`, title: e, description: t }, r != null && r.name ? { icon: (0, qt.jsx)(Ye, { type: r.name }) } : {}), a ? { status: fu[a] } : {});
2173
- return (0, qt.jsx)(na.Summary, s({}, o));
2176
+ let o = s(s({ key: `${e}/${t || ""}`, title: e, description: t }, r != null && r.name ? { icon: (0, Gt.jsx)(Ye, { type: r.name }) } : {}), a ? { status: fu[a] } : {});
2177
+ return (0, Gt.jsx)(na.Summary, s({}, o));
2174
2178
  };
2175
2179
  var pu = { done: "done", pending: "pending", "not-done": "notDone" };
2176
2180
  var yu = { positive: "done", warning: "pending", neutral: "notDone" };
@@ -2182,7 +2186,7 @@ var require_main_min = __commonJS({
2182
2186
  let { margin: t = "md", size: r = "md" } = e;
2183
2187
  return (0, Js.jsx)(Ks.Loader, { size: r, classNames: { "tw-loader": `tw-loader m-x-auto ${V(t)}` }, "data-testid": "loading-indicator" });
2184
2188
  };
2185
- var pr = hu;
2189
+ var yr = hu;
2186
2190
  var ec = require("@transferwise/components");
2187
2191
  var tc = require("react-intl");
2188
2192
  var Xs = require("react-intl");
@@ -2196,15 +2200,19 @@ var require_main_min = __commonJS({
2196
2200
  function gu() {
2197
2201
  }
2198
2202
  var tt = require("react/jsx-runtime");
2199
- var wu = ({ component: e }) => e.control === "copyable" ? (0, tt.jsx)(Su, { component: e }) : (0, tt.jsx)(Cu, { component: e });
2200
- var Cu = ({ component: e }) => (0, tt.jsxs)("p", { className: Ce(e), children: [" ", e.text, " "] });
2201
- var Su = ({ component: e }) => {
2203
+ function wu({ component: e }) {
2204
+ return e.control === "copyable" ? (0, tt.jsx)(Su, { component: e }) : (0, tt.jsx)(Cu, { component: e });
2205
+ }
2206
+ function Cu({ component: e }) {
2207
+ return (0, tt.jsxs)("p", { className: Ce(e), children: [" ", e.text, " "] });
2208
+ }
2209
+ function Su({ component: e }) {
2202
2210
  let { formatMessage: t } = (0, tc.useIntl)(), r = Qs(), { text: a } = e, o = () => {
2203
2211
  var i;
2204
2212
  (i = navigator.clipboard) == null || i.writeText(a).then(() => r({ text: t(Bo.copied) })).catch(Fu);
2205
- }, n = Ce({ align: e.align, margin: "sm" }) + " form-control";
2213
+ }, n = `${Ce({ align: e.align, margin: "sm" })} form-control`;
2206
2214
  return (0, tt.jsxs)("div", { className: Ce(e), children: [(0, tt.jsx)("input", { type: "text", className: n, value: a, readOnly: true, style: { textOverflow: "ellipsis" } }), (0, tt.jsx)(ec.Button, { block: true, onClick: o, children: t(Bo.copy) })] });
2207
- };
2215
+ }
2208
2216
  function Fu() {
2209
2217
  }
2210
2218
  var Lo = wu;
@@ -2227,19 +2235,19 @@ var require_main_min = __commonJS({
2227
2235
  var ca = require("@transferwise/components");
2228
2236
  var nc = require("react-intl");
2229
2237
  var oc = require("react-intl");
2230
- var Gt = (0, oc.defineMessages)({ errorAlert: { id: "dynamicFlows.ErrorBoundary.errorAlert", defaultMessage: "Oops. Something went wrong...", description: "Generic error message for when something has gone wrong." }, retry: { id: "dynamicFlows.ErrorBoundary.retry", defaultMessage: "Retry", description: "Usually this follows the generic error and contains a link." } });
2238
+ var Wt = (0, oc.defineMessages)({ errorAlert: { id: "dynamicFlows.ErrorBoundary.errorAlert", defaultMessage: "Oops. Something went wrong...", description: "Generic error message for when something has gone wrong." }, retry: { id: "dynamicFlows.ErrorBoundary.retry", defaultMessage: "Retry", description: "Usually this follows the generic error and contains a link." } });
2231
2239
  var St = require("react/jsx-runtime");
2232
2240
  var ic = ({ results: e, emptyMessage: t, onSelect: r }) => e.length === 0 ? (0, St.jsx)("p", { className: "m-t-2", children: t }) : (0, St.jsx)(ca.NavigationOptionsList, { children: e.map((a) => (0, St.jsx)(ca.NavigationOption, { title: a.title, content: a.description, media: ut(a), showMediaCircle: false, showMediaAtAllSizes: true, onClick: () => r(a) }, JSON.stringify(a))) });
2233
2241
  var sc = ({ onRetrySearch: e }) => {
2234
2242
  let t = (0, nc.useIntl)();
2235
- return (0, St.jsxs)("p", { className: "m-t-2", children: [t.formatMessage(Gt.errorAlert), "\xA0", (0, St.jsx)("a", { href: "/", onClick: (r) => {
2243
+ return (0, St.jsxs)("p", { className: "m-t-2", children: [t.formatMessage(Wt.errorAlert), "\xA0", (0, St.jsx)("a", { href: "/", onClick: (r) => {
2236
2244
  r.preventDefault(), e();
2237
- }, children: t.formatMessage(Gt.retry) })] });
2245
+ }, children: t.formatMessage(Wt.retry) })] });
2238
2246
  };
2239
- var Wt = require("react");
2247
+ var $t = require("react");
2240
2248
  var cc = { "Content-Type": "application/json" };
2241
2249
  var mc = (e) => {
2242
- let [t, r] = (0, Wt.useState)({ status: "idle" }), a = (0, Wt.useRef)(null), o = ae(), n = (0, Wt.useCallback)(async (m, { url: p, method: h, param: y } = e) => {
2250
+ let [t, r] = (0, $t.useState)({ status: "idle" }), a = (0, $t.useRef)(null), o = ae(), n = (0, $t.useCallback)(async (m, { url: p, method: h, param: y } = e) => {
2243
2251
  var d;
2244
2252
  if ((d = a.current) == null || d.abort(), !m) {
2245
2253
  r({ status: "idle" });
@@ -2290,15 +2298,15 @@ var require_main_min = __commonJS({
2290
2298
  }, F = () => {
2291
2299
  a(r), y(r);
2292
2300
  };
2293
- return (0, Ft.jsxs)("div", { className: V(n || "md"), children: [(0, Ft.jsx)(ac, { title: o, value: r, onChange: w, onFocus: f }), p === "loading" && (0, Ft.jsx)(pr, { component: { type: "loading-indicator", size: "sm" } }), p === "error" && (0, Ft.jsx)(sc, { onRetrySearch: F }), p === "success" && (0, Ft.jsx)(ic, { results: h, emptyMessage: m, onSelect: S })] });
2301
+ return (0, Ft.jsxs)("div", { className: V(n || "md"), children: [(0, Ft.jsx)(ac, { title: o, value: r, onChange: w, onFocus: f }), p === "loading" && (0, Ft.jsx)(yr, { component: { type: "loading-indicator", size: "sm" } }), p === "error" && (0, Ft.jsx)(sc, { onRetrySearch: F }), p === "success" && (0, Ft.jsx)(ic, { results: h, emptyMessage: m, onSelect: S })] });
2294
2302
  }
2295
2303
  var Ro = Eu;
2296
2304
  var la = require("@transferwise/components");
2297
2305
  var lc = require("react");
2298
- var $t = require("react/jsx-runtime");
2306
+ var _t = require("react/jsx-runtime");
2299
2307
  var Iu = (e) => {
2300
2308
  let [t, r] = (0, lc.useState)(false), { component: a, onAction: o } = e, { margin: n = "md" } = a;
2301
- return (0, $t.jsxs)("div", { className: Ce({ margin: n }), children: [(0, $t.jsx)(la.Button, { priority: "tertiary", block: true, onClick: () => r(true), children: a.trigger.title }), (0, $t.jsx)(la.Modal, { scroll: "content", onClose: () => r(false), open: t, size: "lg", body: (0, $t.jsx)(ne, C(s({}, e), { components: a.content.components, onAction: o })) })] });
2309
+ return (0, _t.jsxs)("div", { className: Ce({ margin: n }), children: [(0, _t.jsx)(la.Button, { priority: "tertiary", block: true, onClick: () => r(true), children: a.trigger.title }), (0, _t.jsx)(la.Modal, { scroll: "content", onClose: () => r(false), open: t, size: "lg", body: (0, _t.jsx)(ne, C(s({}, e), { components: a.content.components, onAction: o })) })] });
2302
2310
  };
2303
2311
  var No = Iu;
2304
2312
  var ue = require("react/jsx-runtime");
@@ -2328,7 +2336,7 @@ var require_main_min = __commonJS({
2328
2336
  k !== c && l(k);
2329
2337
  }, [e.model]);
2330
2338
  let E = { "form-group": true, "has-error": (e.submitted || !h) && !!e.errors || (e.submitted || h && f) && !!S.length, "has-info": !!e.schema.description || !!e.infoMessage }, P = e.schema.format !== "file" && e.schema.type !== "boolean", D = e.schema.help, U = `${g}-feedback`;
2331
- return M ? null : (0, ue.jsxs)(ue.Fragment, { children: [e.schema.alert && (0, ue.jsx)(se, { component: e.schema.alert }), (0, ue.jsxs)("div", { className: (0, dc.default)(E), children: [P && (0, ue.jsxs)("div", { className: "d-inline-block m-b-1", children: [(0, ue.jsx)("label", { className: "control-label d-inline", htmlFor: g, children: e.schema.title }), !!D && (0, ue.jsx)(qe, { help: D })] }), !P && !!D && (0, ue.jsx)(qe, { help: D }), (0, ue.jsx)(mr, { id: g, schema: e.schema, value: c, disabled: !!e.disabled, onChange: t, onFocus: n, onBlur: i, describedBy: U }), (0, ue.jsx)(He, { id: U, changed: h, focused: u, blurred: f, submitted: e.submitted, errors: (B = e.errors) != null ? B : null, schema: e.schema, validations: S, infoMessage: e.infoMessage })] })] });
2339
+ return M ? null : (0, ue.jsxs)(ue.Fragment, { children: [e.schema.alert && (0, ue.jsx)(se, { component: e.schema.alert }), (0, ue.jsxs)("div", { className: (0, dc.default)(E), children: [P && (0, ue.jsxs)("div", { className: "d-inline-block m-b-1", children: [(0, ue.jsx)("label", { className: "control-label d-inline", htmlFor: g, children: e.schema.title }), !!D && (0, ue.jsx)(qe, { help: D })] }), !P && !!D && (0, ue.jsx)(qe, { help: D }), (0, ue.jsx)(lr, { id: g, schema: e.schema, value: c, disabled: !!e.disabled, onChange: t, onFocus: n, onBlur: i, describedBy: U }), (0, ue.jsx)(He, { id: U, changed: h, focused: u, blurred: f, submitted: e.submitted, errors: (B = e.errors) != null ? B : null, schema: e.schema, validations: S, infoMessage: e.infoMessage })] })] });
2332
2340
  };
2333
2341
  uc.defaultProps = { required: false, disabled: false, onBlur: null };
2334
2342
  var Ct = uc;
@@ -2344,7 +2352,7 @@ var require_main_min = __commonJS({
2344
2352
  (0, bt.useEffect)(() => {
2345
2353
  Lu.has(lo(t.persistAsync.schema)) && x();
2346
2354
  }, [p]);
2347
- let g = () => d(c.formatMessage(or.genericError)), v = async (P, D) => {
2355
+ let g = () => d(c.formatMessage(nr.genericError)), v = async (P, D) => {
2348
2356
  let U = O(), ee = { [D.param]: P };
2349
2357
  w(true);
2350
2358
  try {
@@ -2385,7 +2393,7 @@ var require_main_min = __commonJS({
2385
2393
  var qi = (e) => {
2386
2394
  let [t, r] = (0, wc.useState)(null), a = ae(), o = (0, Cc.useIntl)(), { schema: n } = e;
2387
2395
  async function i(y) {
2388
- let u = y instanceof Blob ? !It(n) : !G(y, n);
2396
+ let u = y instanceof Blob ? !Dt(n) : !G(y, n);
2389
2397
  return (I(y) || u) && h(), await m(y);
2390
2398
  }
2391
2399
  let c = () => {
@@ -2394,7 +2402,7 @@ var require_main_min = __commonJS({
2394
2402
  return r(y), y.signal;
2395
2403
  };
2396
2404
  function l(y) {
2397
- let u = It(n), d = c(), f = e.param, w = u ? Tu(f, y) : JSON.stringify({ [f]: y });
2405
+ let u = Dt(n), d = c(), f = e.param, w = u ? Tu(f, y) : JSON.stringify({ [f]: y });
2398
2406
  return { method: e.method, headers: s({}, !u && { "Content-Type": "application/json" }), body: w, signal: d };
2399
2407
  }
2400
2408
  async function m(y) {
@@ -2422,10 +2430,10 @@ var require_main_min = __commonJS({
2422
2430
  throw new Error(d);
2423
2431
  }
2424
2432
  }
2425
- throw new Error(o.formatMessage(or.genericError));
2433
+ throw new Error(o.formatMessage(nr.genericError));
2426
2434
  }
2427
2435
  let h = (y) => {
2428
- let u = Ru(y) ? y.message : o.formatMessage(or.genericError);
2436
+ let u = Ru(y) ? y.message : o.formatMessage(nr.genericError);
2429
2437
  throw new Error(u);
2430
2438
  };
2431
2439
  return i;
@@ -2471,9 +2479,9 @@ var require_main_min = __commonJS({
2471
2479
  t.current = e;
2472
2480
  }, [e]), t.current;
2473
2481
  };
2474
- var yr = require("react");
2482
+ var fr = require("react");
2475
2483
  function Sc(e, t) {
2476
- let r = ae(), a = (0, yr.useMemo)(() => {
2484
+ let r = ae(), a = (0, fr.useMemo)(() => {
2477
2485
  if (e)
2478
2486
  return () => r(e.url).then((n) => {
2479
2487
  if (n.ok)
@@ -2482,21 +2490,21 @@ var require_main_min = __commonJS({
2482
2490
  }).catch((n) => {
2483
2491
  throw new Error(n.message === "failed" ? "failed" : "network failed");
2484
2492
  });
2485
- }, [e, r]), o = (0, yr.useCallback)((n) => n != null && n.action ? (t(n.action), false) : true, [t]);
2486
- Vr({ asyncFn: a, interval: 1e3 * ((e == null ? void 0 : e.interval) || 0), maxAttempts: (e == null ? void 0 : e.maxAttempts) || 0, maxConsecutiveFails: 1, onPollingResponse: o, onFailure: (0, yr.useCallback)(() => {
2493
+ }, [e, r]), o = (0, fr.useCallback)((n) => n != null && n.action ? (t(n.action), false) : true, [t]);
2494
+ Vr({ asyncFn: a, interval: 1e3 * ((e == null ? void 0 : e.interval) || 0), maxAttempts: (e == null ? void 0 : e.maxAttempts) || 0, maxConsecutiveFails: 1, onPollingResponse: o, onFailure: (0, fr.useCallback)(() => {
2487
2495
  e && t(e.onError.action);
2488
2496
  }, [t, e]) });
2489
2497
  }
2490
2498
  var Fc = require("react/jsx-runtime");
2491
2499
  var Bu = (e, t) => {
2492
2500
  var a;
2493
- if (Mt(e))
2501
+ if (kt(e))
2494
2502
  return [];
2495
- let r = Zt(e, t);
2503
+ let r = Qt(e, t);
2496
2504
  return ze({ layout: r, schemas: e.schemas || [], actions: e.actions || [], model: (a = e.model) != null ? a : null });
2497
2505
  };
2498
2506
  var zu = (e) => {
2499
- let { stepSpecification: t, stepLayoutOptions: r, submitted: a, model: o, formErrors: n, onModelChange: i } = e, c = Bu(t, r), { loading: l, registerPersistAsyncPromise: m } = Pr(), p = re(), h = l ? () => {
2507
+ let { stepSpecification: t, stepLayoutOptions: r, submitted: a, model: o, formErrors: n, onModelChange: i } = e, c = Bu(t, r), { loading: l, registerPersistAsyncPromise: m } = At(), p = re(), h = l ? () => {
2500
2508
  p("Dynamic Flow - onAction supressed", { reason: "LayoutStep - loading state" });
2501
2509
  } : e.onAction;
2502
2510
  return Sc(t.polling, h), (0, Fc.jsx)(ne, { components: c, submitted: a, model: o, errors: n, onAction: h, onModelChange: i, onPersistAsync: m });
@@ -2520,10 +2528,10 @@ var require_main_min = __commonJS({
2520
2528
  var Pc = require("react-intl");
2521
2529
  var Ac = require("react-intl");
2522
2530
  var Oc = (0, Ac.defineMessages)({ text: { id: "dynamicFlows.CameraCapture.rotatePhone.text", defaultMessage: "Rotate your phone to portrait view to take a photo", description: "Prompt the user to rotate their phone from landscape to portrait mode when attempting to take a photo" } });
2523
- var hr = require("react/jsx-runtime");
2531
+ var gr = require("react/jsx-runtime");
2524
2532
  function Vu() {
2525
2533
  let e = (0, Pc.useIntl)();
2526
- return (0, hr.jsxs)("div", { className: "orientation-lock-overlay", children: [(0, hr.jsx)("img", { className: "m-b-3", src: "https://wise.com/public-resources/assets/camera-guidelines/icon-rotate-phone.svg", width: "96", height: "96", alt: "" }), (0, hr.jsx)("p", { className: "text-center m-b-0", children: e.formatMessage(Oc.text) })] });
2534
+ return (0, gr.jsxs)("div", { className: "orientation-lock-overlay", children: [(0, gr.jsx)("img", { className: "m-b-3", src: "https://wise.com/public-resources/assets/camera-guidelines/icon-rotate-phone.svg", width: "96", height: "96", alt: "" }), (0, gr.jsx)("p", { className: "text-center m-b-0", children: e.formatMessage(Oc.text) })] });
2527
2535
  }
2528
2536
  var Ho = Vu;
2529
2537
  var Mc = require("@transferwise/components");
@@ -2533,7 +2541,7 @@ var require_main_min = __commonJS({
2533
2541
  }
2534
2542
  var qo = Uu;
2535
2543
  var ot = require("react");
2536
- var _t = Ee(kc());
2544
+ var Kt = Ee(kc());
2537
2545
  var Ec = (e) => {
2538
2546
  var r;
2539
2547
  let { facingMode: t } = ((r = pa(e)) == null ? void 0 : r.getSettings()) || {};
@@ -2594,12 +2602,12 @@ var require_main_min = __commonJS({
2594
2602
  return (m = (l = (c = window == null ? void 0 : window.screen) == null ? void 0 : c.orientation) == null ? void 0 : l.unlock) == null ? void 0 : m.call(l);
2595
2603
  }, []), o = (0, ot.useCallback)(() => {
2596
2604
  setTimeout(() => {
2597
- e && !_t.default.isFullscreen && _t.default.isEnabled && _t.default.request(document.documentElement, { navigationUI: "show" }).then(() => {
2605
+ e && !Kt.default.isFullscreen && Kt.default.isEnabled && Kt.default.request(document.documentElement, { navigationUI: "show" }).then(() => {
2598
2606
  r();
2599
2607
  }).catch(Wo);
2600
2608
  }, 100);
2601
2609
  }, [e, r]), n = (0, ot.useCallback)(() => {
2602
- _t.default.isFullscreen && _t.default.exit().catch(Wo), a();
2610
+ Kt.default.isFullscreen && Kt.default.exit().catch(Wo), a();
2603
2611
  }, [a]), i = (0, ot.useCallback)((c) => {
2604
2612
  var l, m;
2605
2613
  (l = c == null ? void 0 : c.target) != null && l.type.includes("landscape") && (m = window.screen) != null && m.orientation && Bc(t);
@@ -2664,10 +2672,10 @@ var require_main_min = __commonJS({
2664
2672
  var ye = require("react/jsx-runtime");
2665
2673
  function Xu({ direction: e = "back", overlay: t = "", outline: r = "", imageUrl: a = "", title: o = "", instructions: n = "", showReview: i = false, onCapture: c, onEvent: l }) {
2666
2674
  let [m, p] = (0, oe.useState)("CAPTURE"), [h, y] = (0, oe.useState)(), [u, d] = (0, oe.useState)(false), [f, w] = (0, oe.useState)(false), [S, F] = (0, oe.useState)(), g = (0, oe.useRef)(null), { videoConstraints: v } = Vc(e), O = (0, oe.useMemo)(() => !!(Yn() && m === "CAPTURE"), [m]), { enterFullScreen: x, exitFullScreen: M } = jc(O, l), E = (0, qc.useIntl)(), P = (0, oe.useCallback)(async () => {
2667
- var W, X, ke, nt, Fr, br;
2675
+ var W, X, ke, nt, br, xr;
2668
2676
  if ((W = g == null ? void 0 : g.current) != null && W.video && ((ke = (X = g == null ? void 0 : g.current) == null ? void 0 : X.video) == null ? void 0 : ke.readyState) >= 3) {
2669
- (Fr = (nt = g == null ? void 0 : g.current) == null ? void 0 : nt.video) == null || Fr.pause();
2670
- let it = await Dc((br = g == null ? void 0 : g.current) == null ? void 0 : br.video);
2677
+ (br = (nt = g == null ? void 0 : g.current) == null ? void 0 : nt.video) == null || br.pause();
2678
+ let it = await Dc((xr = g == null ? void 0 : g.current) == null ? void 0 : xr.video);
2671
2679
  it == null || it.toBlob((xt) => {
2672
2680
  if (xt)
2673
2681
  if (i) {
@@ -2753,13 +2761,13 @@ var require_main_min = __commonJS({
2753
2761
  }
2754
2762
  var Jc = require("react-intl");
2755
2763
  var _c = require("react-intl");
2756
- var wr = (0, _c.defineMessages)({ title: { id: "dynamicFlows.ExternalConfirmation.title", defaultMessage: "Please confirm", description: "Heading for the confirmation screen." }, description: { id: "dynamicFlows.ExternalConfirmation.description", defaultMessage: "Please confirm you want to open **{origin}** in a new browser tab.", description: "Description for the confirmation screen." }, open: { id: "dynamicFlows.ExternalConfirmation.open", defaultMessage: "Open in new tab", description: "Button text confirming opening a new browser tab." }, cancel: { id: "dynamicFlows.ExternalConfirmation.cancel", defaultMessage: "Cancel", description: "Button text rejecting opening a new browser tab." } });
2764
+ var Cr = (0, _c.defineMessages)({ title: { id: "dynamicFlows.ExternalConfirmation.title", defaultMessage: "Please confirm", description: "Heading for the confirmation screen." }, description: { id: "dynamicFlows.ExternalConfirmation.description", defaultMessage: "Please confirm you want to open **{origin}** in a new browser tab.", description: "Description for the confirmation screen." }, open: { id: "dynamicFlows.ExternalConfirmation.open", defaultMessage: "Open in new tab", description: "Button text confirming opening a new browser tab." }, cancel: { id: "dynamicFlows.ExternalConfirmation.cancel", defaultMessage: "Cancel", description: "Button text rejecting opening a new browser tab." } });
2757
2765
  var Xc = require("react/jsx-runtime");
2758
2766
  var Kc = () => {
2759
2767
  };
2760
2768
  var tp = ({ url: e, onClose: t }) => {
2761
2769
  let { formatMessage: r } = (0, Jc.useIntl)();
2762
- return (0, Xc.jsx)(ne, { components: [{ type: "box", width: "lg", components: [{ type: "heading", text: r(wr.title), size: "lg", align: "center", margin: "xl" }, { type: "info", markdown: r(wr.description, { origin: rp(e) }), align: "center", margin: "xl" }, { type: "box", width: "md", components: [{ type: "button", action: { title: r(wr.open), type: "primary", url: e, exit: true } }, { type: "button", action: { title: r(wr.cancel), type: "link", url: "", exit: true } }] }] }], submitted: false, onAction: (a) => {
2770
+ return (0, Xc.jsx)(ne, { components: [{ type: "box", width: "lg", components: [{ type: "heading", text: r(Cr.title), size: "lg", align: "center", margin: "xl" }, { type: "info", markdown: r(Cr.description, { origin: rp(e) }), align: "center", margin: "xl" }, { type: "box", width: "md", components: [{ type: "button", action: { title: r(Cr.open), type: "primary", url: e, exit: true } }, { type: "button", action: { title: r(Cr.cancel), type: "link", url: "", exit: true } }] }] }], submitted: false, onAction: (a) => {
2763
2771
  a.url && window.open(a.url, "_blank"), t();
2764
2772
  }, onModelChange: Kc, onPersistAsync: Kc });
2765
2773
  };
@@ -2773,11 +2781,11 @@ var require_main_min = __commonJS({
2773
2781
  }
2774
2782
  var Yc = require("@transferwise/components");
2775
2783
  var Zc = require("@transferwise/icons");
2776
- var Kt = require("react/jsx-runtime");
2784
+ var Jt = require("react/jsx-runtime");
2777
2785
  function ap({ title: e, action: t, onAction: r }) {
2778
- return (0, Kt.jsxs)("a", { href: "/", className: "df-back-btn", "aria-label": e, onClick: (a) => {
2786
+ return (0, Jt.jsxs)("a", { href: "/", className: "df-back-btn", "aria-label": e, onClick: (a) => {
2779
2787
  a.preventDefault(), r(C(s({}, t), { skipValidation: true }));
2780
- }, children: [(0, Kt.jsx)("span", { className: "sr-only", children: e }), (0, Kt.jsx)(Yc.Avatar, { type: "icon", children: (0, Kt.jsx)(Zc.ArrowLeft, { size: "24" }) })] });
2788
+ }, children: [(0, Jt.jsx)("span", { className: "sr-only", children: e }), (0, Jt.jsx)(Yc.Avatar, { type: "icon", children: (0, Jt.jsx)(Zc.ArrowLeft, { size: "24" }) })] });
2781
2789
  }
2782
2790
  var Qc = ap;
2783
2791
  var Pe = require("react/jsx-runtime");
@@ -2801,10 +2809,10 @@ var require_main_min = __commonJS({
2801
2809
  };
2802
2810
  }
2803
2811
  var np = (e) => dt(e) === "basic" && e.type !== "boolean" && e.format !== "base64url";
2804
- var Jt = require("react");
2812
+ var Xt = require("react");
2805
2813
  var om = (e) => {
2806
2814
  var u, d;
2807
- let [t, r] = (0, Jt.useState)((u = e == null ? void 0 : e.errors) == null ? void 0 : u.validation), [a, o] = (0, Jt.useState)((d = e == null ? void 0 : e.errors) == null ? void 0 : d.error), [n, i] = (0, Jt.useState)({ step: e || void 0, models: e != null && e.model ? rm(e.model, am(e)) : {}, etag: void 0 }), { step: c, models: l, etag: m } = n, p = (f, w) => {
2815
+ let [t, r] = (0, Xt.useState)((u = e == null ? void 0 : e.errors) == null ? void 0 : u.validation), [a, o] = (0, Xt.useState)((d = e == null ? void 0 : e.errors) == null ? void 0 : d.error), [n, i] = (0, Xt.useState)({ step: e || void 0, models: e != null && e.model ? rm(e.model, am(e)) : {}, etag: void 0 }), { step: c, models: l, etag: m } = n, p = (f, w) => {
2808
2816
  var S, F, g, v;
2809
2817
  i((O) => ({ step: f, models: f.model ? rm(f.model, am(f)) : O.models, etag: w })), r((F = (S = f == null ? void 0 : f.errors) == null ? void 0 : S.validation) != null ? F : null), o((v = (g = f == null ? void 0 : f.errors) == null ? void 0 : g.error) != null ? v : null);
2810
2818
  }, h = (f, w, S) => {
@@ -2812,7 +2820,7 @@ var require_main_min = __commonJS({
2812
2820
  let g = C(s({}, F.models), { [f]: w }), v = { step: F.step, models: g, etag: F.etag };
2813
2821
  return S(g), v;
2814
2822
  });
2815
- }, y = (0, Jt.useMemo)(() => sp(l, ip(c)), [l, c]);
2823
+ }, y = (0, Xt.useMemo)(() => sp(l, ip(c)), [l, c]);
2816
2824
  return { formErrors: t, globalError: a, step: c, models: l, etag: m, modelIsValid: y, setFormErrors: r, setGlobalError: o, setStepAndEtag: p, setSchemaModel: h };
2817
2825
  };
2818
2826
  var rm = (e, t = []) => t.reduce((r, a) => (a.$id || console.warn("Schema without $id property found."), C(s({}, r), { [a.$id || ""]: ce(e, a) || {} })), {});
@@ -2858,9 +2866,9 @@ var require_main_min = __commonJS({
2858
2866
  var dm = require("react/jsx-runtime");
2859
2867
  function lm({ onDismiss: e }) {
2860
2868
  let { formatMessage: t } = (0, mm.useIntl)();
2861
- return (0, dm.jsx)(ba.Alert, { action: { text: t(Gt.retry), href: window.location.href }, message: t(Gt.errorAlert), type: ba.Sentiment.NEGATIVE, className: "m-b-3", onDismiss: e });
2869
+ return (0, dm.jsx)(ba.Alert, { action: { text: t(Wt.retry), href: window.location.href }, message: t(Wt.errorAlert), type: ba.Sentiment.NEGATIVE, className: "m-b-3", onDismiss: e });
2862
2870
  }
2863
- var Xt = require("react/jsx-runtime");
2871
+ var Yt = require("react/jsx-runtime");
2864
2872
  var mp = () => {
2865
2873
  };
2866
2874
  var Jo = class extends um.Component {
@@ -2880,7 +2888,7 @@ var require_main_min = __commonJS({
2880
2888
  }
2881
2889
  render() {
2882
2890
  let { children: r } = this.props, { hasError: a, isFatalError: o } = this.state;
2883
- return (0, Xt.jsxs)(Xt.Fragment, { children: [a && (0, Xt.jsx)(lm, { onDismiss: this.handleErrorReset }), !o && r] });
2891
+ return (0, Yt.jsxs)(Yt.Fragment, { children: [a && (0, Yt.jsx)(lm, { onDismiss: this.handleErrorReset }), !o && r] });
2884
2892
  }
2885
2893
  };
2886
2894
  var Xo = Jo;
@@ -2897,14 +2905,14 @@ var require_main_min = __commonJS({
2897
2905
  }
2898
2906
  };
2899
2907
  var ym = async (e) => {
2900
- let t = await Cr(e);
2908
+ let t = await Sr(e);
2901
2909
  if (!R(t))
2902
2910
  throw new Error("Incorrect response body in response. Expected an object.");
2903
2911
  let r = e.headers.get("etag") || void 0;
2904
2912
  return { type: "step", step: t, etag: r };
2905
2913
  };
2906
2914
  var fm = async (e) => {
2907
- let t = await Cr(e);
2915
+ let t = await Sr(e);
2908
2916
  if (!R(t))
2909
2917
  throw new Error("Incorrect response body in response. Expected an object.");
2910
2918
  if (!R(t.action))
@@ -2925,12 +2933,12 @@ var require_main_min = __commonJS({
2925
2933
  }
2926
2934
  if ((o = e.headers) != null && o.has("X-Df-Exit"))
2927
2935
  return hm(e);
2928
- let t = await Cr(e.clone());
2936
+ let t = await Sr(e.clone());
2929
2937
  return R(t) && t.action ? fm(e) : ym(e);
2930
2938
  };
2931
2939
  var wm = async (e) => {
2932
2940
  Zo(e);
2933
- let t = await Cr(e);
2941
+ let t = await Sr(e);
2934
2942
  if (!R(t))
2935
2943
  throw new Error("Incorrect response body in error response. Expected an object.");
2936
2944
  if (!t.refreshFormUrl && !t.refreshUrl && !t.validation && !t.error)
@@ -2939,10 +2947,10 @@ var require_main_min = __commonJS({
2939
2947
  };
2940
2948
  var Yo = async (e) => {
2941
2949
  Zo(e);
2942
- let t = await Cr(e);
2950
+ let t = await Sr(e);
2943
2951
  return R(t) ? t : null;
2944
2952
  };
2945
- var Cr = async (e) => {
2953
+ var Sr = async (e) => {
2946
2954
  try {
2947
2955
  return await e.json();
2948
2956
  } catch (t) {
@@ -3008,31 +3016,31 @@ var require_main_min = __commonJS({
3008
3016
  }
3009
3017
  if (!b.ok) {
3010
3018
  let te = await wm(b);
3011
- br(te);
3019
+ xr(te);
3012
3020
  return;
3013
3021
  }
3014
3022
  let T = await gm(b);
3015
- T.type === "action" ? k(T.action, T.action.data) : T.type === "exit" ? ke(T.result) : Fr(T.step, T.etag, q);
3023
+ T.type === "action" ? k(T.action, T.action.data) : T.type === "exit" ? ke(T.result) : br(T.step, T.etag, q);
3016
3024
  } catch (T) {
3017
3025
  it(T, "Error parsing fetch response", q, b.status);
3018
3026
  }
3019
- }, Fr = (b, q, T) => {
3027
+ }, br = (b, q, T) => {
3020
3028
  v(b, q), D("idle"), T === "submission" ? (M(false), A("Dynamic Flow - Step Started", s({ stepId: b.id || b.key }, b == null ? void 0 : b.analytics))) : A("Dynamic Flow - Step Refreshed", { status: "success" });
3021
- }, br = async (b) => {
3029
+ }, xr = async (b) => {
3022
3030
  let q = b.refreshUrl || b.refreshFormUrl;
3023
3031
  q && await ie(q, xa(f), w), b.validation && F(b.validation), b.error && g(b.error), D("idle");
3024
3032
  }, it = (b, q, T, te) => {
3025
3033
  U("Error fetching", q), T === "refresh" && A("Dynamic Flow - Step Refreshed", { status: "failure" }), A("Dynamic Flow - Flow Finished", { status: "failure" }), l(b, te), D("idle");
3026
3034
  }, xt = (b) => {
3027
3035
  let { model: q, formSchema: T } = b, { $id: te = "" } = T;
3028
- g(null), $(q) || U("Invalid model on change", "onModelChange was called but the model argument is not an object"), O(te, q, (xr) => {
3029
- va(b, xr);
3036
+ g(null), $(q) || U("Invalid model on change", "onModelChange was called but the model argument is not an object"), O(te, q, (vr) => {
3037
+ va(b, vr);
3030
3038
  });
3031
3039
  }, va = (b, q) => {
3032
3040
  let { triggerSchema: T } = b;
3033
3041
  if (yp(b)) {
3034
- let te = T.refreshUrl || T.refreshFormUrl, st = (d == null ? void 0 : d.refreshUrl) || (d == null ? void 0 : d.refreshFormUrl), xr = te || st;
3035
- xr && X(xr, xa(q), w, T);
3042
+ let te = T.refreshUrl || T.refreshFormUrl, st = (d == null ? void 0 : d.refreshUrl) || (d == null ? void 0 : d.refreshFormUrl), vr = te || st;
3043
+ vr && X(vr, xa(q), w, T);
3036
3044
  }
3037
3045
  }, zm = async (b) => {
3038
3046
  if (E || b.disabled)
@@ -3058,10 +3066,10 @@ var require_main_min = __commonJS({
3058
3066
  let { type: t, triggerSchema: r, triggerModel: a, lastTriggerModel: o = null } = e, n = () => G(a, r), i = () => G(o, r), c = (r == null ? void 0 : r.refreshStepOnChange) || (r == null ? void 0 : r.refreshFormOnChange);
3059
3067
  return t !== "init" && c && (n() || i());
3060
3068
  };
3061
- var Sr = require("react/jsx-runtime");
3069
+ var Fr = require("react/jsx-runtime");
3062
3070
  function fp(e) {
3063
3071
  let t = s({ model: null, errors: null }, e), { baseUrl: r = "", onEvent: a = Fm, onLog: o = Fm } = e;
3064
- return (0, Sr.jsx)(Dr, { flowId: "JsonSchemaForm", stepId: "JsonSchemaForm", onLog: o, children: (0, Sr.jsx)(Mr, { metadata: { flowId: "JsonSchemaForm", stepId: "JsonSchemaForm" }, onEvent: a, children: (0, Sr.jsx)(Ir, { baseUrl: r, children: (0, Sr.jsx)(me, s({}, t)) }) }) });
3072
+ return (0, Fr.jsx)(Dr, { flowId: "JsonSchemaForm", stepId: "JsonSchemaForm", onLog: o, children: (0, Fr.jsx)(Mr, { metadata: { flowId: "JsonSchemaForm", stepId: "JsonSchemaForm" }, onEvent: a, children: (0, Fr.jsx)(Ir, { baseUrl: r, children: (0, Fr.jsx)(me, s({}, t)) }) }) });
3065
3073
  }
3066
3074
  var en = fp;
3067
3075
  var Fm = () => {