@wise/dynamic-flow-client 2.2.2 → 2.3.0-beta-c55f65.18

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (34) hide show
  1. package/build/i18n/en.json +2 -0
  2. package/build/i18n/hu.json +1 -1
  3. package/build/main.css +19 -0
  4. package/build/main.js +417 -128
  5. package/build/main.min.js +8 -1
  6. package/build/types/common/utils/index.d.ts +1 -0
  7. package/build/types/common/utils/mobile-utils.d.ts +4 -0
  8. package/build/types/revamp/DynamicFlowRevamp.d.ts +3 -0
  9. package/build/types/revamp/domain/AlertComponent.d.ts +14 -0
  10. package/build/types/revamp/domain/HeadingComponent.d.ts +16 -0
  11. package/build/types/revamp/domain/ParagraphComponent.d.ts +16 -0
  12. package/build/types/revamp/domain/Step.d.ts +9 -0
  13. package/build/types/revamp/domain/types.d.ts +8 -0
  14. package/build/types/revamp/mappers/componentToProps/alertComponentToProps.d.ts +3 -0
  15. package/build/types/revamp/mappers/componentToProps/headingComponentToProps.d.ts +3 -0
  16. package/build/types/revamp/mappers/componentToProps/paragraphComponentToProps.d.ts +3 -0
  17. package/build/types/revamp/mappers/specToDomain/alertLayoutToDomain.d.ts +2 -0
  18. package/build/types/revamp/mappers/specToDomain/headingLayoutToDomain.d.ts +2 -0
  19. package/build/types/revamp/mappers/specToDomain/mapStepToDomain.d.ts +4 -0
  20. package/build/types/revamp/mappers/specToDomain/paragraphLayoutToDomain.d.ts +2 -0
  21. package/build/types/revamp/renderers/neptune/AlertRenderer.d.ts +3 -0
  22. package/build/types/revamp/renderers/neptune/HeadingRenderer.d.ts +3 -0
  23. package/build/types/revamp/renderers/neptune/ParagraphRenderer.d.ts +3 -0
  24. package/build/types/revamp/renderers/neptune/utils/layout-utils.d.ts +7 -0
  25. package/build/types/revamp/renderers/types.d.ts +31 -0
  26. package/build/types/revamp/renderers/utils/renderComponent.d.ts +7 -0
  27. package/build/types/revamp/step/Step.d.ts +8 -0
  28. package/build/types/revamp/stories/utils/fixtureHttpClient.d.ts +2 -0
  29. package/build/types/step/cameraStep/cameraCapture/components/index.d.ts +1 -0
  30. package/build/types/step/cameraStep/cameraCapture/components/orientationLockOverlay/OrientationLockOverlay.d.ts +2 -0
  31. package/build/types/step/cameraStep/cameraCapture/components/orientationLockOverlay/OrientationLockOverlay.messages.d.ts +13 -0
  32. package/build/types/step/cameraStep/cameraCapture/hooks/useFullScreenOrientationLock.d.ts +4 -0
  33. package/package.json +26 -26
  34. /package/build/types/step/cameraStep/cameraCapture/hooks/{index.d.ts → useVideoConstraints.d.ts} +0 -0
package/build/main.js CHANGED
@@ -529,6 +529,169 @@ var require_react_webcam = __commonJS({
529
529
  }
530
530
  });
531
531
 
532
+ // ../../node_modules/.pnpm/screenfull@5.2.0/node_modules/screenfull/dist/screenfull.js
533
+ var require_screenfull = __commonJS({
534
+ "../../node_modules/.pnpm/screenfull@5.2.0/node_modules/screenfull/dist/screenfull.js"(exports, module2) {
535
+ "use strict";
536
+ (function() {
537
+ "use strict";
538
+ var document2 = typeof window !== "undefined" && typeof window.document !== "undefined" ? window.document : {};
539
+ var isCommonjs = typeof module2 !== "undefined" && module2.exports;
540
+ var fn = function() {
541
+ var val;
542
+ var fnMap = [
543
+ [
544
+ "requestFullscreen",
545
+ "exitFullscreen",
546
+ "fullscreenElement",
547
+ "fullscreenEnabled",
548
+ "fullscreenchange",
549
+ "fullscreenerror"
550
+ ],
551
+ // New WebKit
552
+ [
553
+ "webkitRequestFullscreen",
554
+ "webkitExitFullscreen",
555
+ "webkitFullscreenElement",
556
+ "webkitFullscreenEnabled",
557
+ "webkitfullscreenchange",
558
+ "webkitfullscreenerror"
559
+ ],
560
+ // Old WebKit
561
+ [
562
+ "webkitRequestFullScreen",
563
+ "webkitCancelFullScreen",
564
+ "webkitCurrentFullScreenElement",
565
+ "webkitCancelFullScreen",
566
+ "webkitfullscreenchange",
567
+ "webkitfullscreenerror"
568
+ ],
569
+ [
570
+ "mozRequestFullScreen",
571
+ "mozCancelFullScreen",
572
+ "mozFullScreenElement",
573
+ "mozFullScreenEnabled",
574
+ "mozfullscreenchange",
575
+ "mozfullscreenerror"
576
+ ],
577
+ [
578
+ "msRequestFullscreen",
579
+ "msExitFullscreen",
580
+ "msFullscreenElement",
581
+ "msFullscreenEnabled",
582
+ "MSFullscreenChange",
583
+ "MSFullscreenError"
584
+ ]
585
+ ];
586
+ var i = 0;
587
+ var l = fnMap.length;
588
+ var ret = {};
589
+ for (; i < l; i++) {
590
+ val = fnMap[i];
591
+ if (val && val[1] in document2) {
592
+ for (i = 0; i < val.length; i++) {
593
+ ret[fnMap[0][i]] = val[i];
594
+ }
595
+ return ret;
596
+ }
597
+ }
598
+ return false;
599
+ }();
600
+ var eventNameMap = {
601
+ change: fn.fullscreenchange,
602
+ error: fn.fullscreenerror
603
+ };
604
+ var screenfull2 = {
605
+ request: function(element, options) {
606
+ return new Promise(function(resolve, reject) {
607
+ var onFullScreenEntered = function() {
608
+ this.off("change", onFullScreenEntered);
609
+ resolve();
610
+ }.bind(this);
611
+ this.on("change", onFullScreenEntered);
612
+ element = element || document2.documentElement;
613
+ var returnPromise = element[fn.requestFullscreen](options);
614
+ if (returnPromise instanceof Promise) {
615
+ returnPromise.then(onFullScreenEntered).catch(reject);
616
+ }
617
+ }.bind(this));
618
+ },
619
+ exit: function() {
620
+ return new Promise(function(resolve, reject) {
621
+ if (!this.isFullscreen) {
622
+ resolve();
623
+ return;
624
+ }
625
+ var onFullScreenExit = function() {
626
+ this.off("change", onFullScreenExit);
627
+ resolve();
628
+ }.bind(this);
629
+ this.on("change", onFullScreenExit);
630
+ var returnPromise = document2[fn.exitFullscreen]();
631
+ if (returnPromise instanceof Promise) {
632
+ returnPromise.then(onFullScreenExit).catch(reject);
633
+ }
634
+ }.bind(this));
635
+ },
636
+ toggle: function(element, options) {
637
+ return this.isFullscreen ? this.exit() : this.request(element, options);
638
+ },
639
+ onchange: function(callback) {
640
+ this.on("change", callback);
641
+ },
642
+ onerror: function(callback) {
643
+ this.on("error", callback);
644
+ },
645
+ on: function(event, callback) {
646
+ var eventName = eventNameMap[event];
647
+ if (eventName) {
648
+ document2.addEventListener(eventName, callback, false);
649
+ }
650
+ },
651
+ off: function(event, callback) {
652
+ var eventName = eventNameMap[event];
653
+ if (eventName) {
654
+ document2.removeEventListener(eventName, callback, false);
655
+ }
656
+ },
657
+ raw: fn
658
+ };
659
+ if (!fn) {
660
+ if (isCommonjs) {
661
+ module2.exports = { isEnabled: false };
662
+ } else {
663
+ window.screenfull = { isEnabled: false };
664
+ }
665
+ return;
666
+ }
667
+ Object.defineProperties(screenfull2, {
668
+ isFullscreen: {
669
+ get: function() {
670
+ return Boolean(document2[fn.fullscreenElement]);
671
+ }
672
+ },
673
+ element: {
674
+ enumerable: true,
675
+ get: function() {
676
+ return document2[fn.fullscreenElement];
677
+ }
678
+ },
679
+ isEnabled: {
680
+ enumerable: true,
681
+ get: function() {
682
+ return Boolean(document2[fn.fullscreenEnabled]);
683
+ }
684
+ }
685
+ });
686
+ if (isCommonjs) {
687
+ module2.exports = screenfull2;
688
+ } else {
689
+ window.screenfull = screenfull2;
690
+ }
691
+ })();
692
+ }
693
+ });
694
+
532
695
  // src/index.ts
533
696
  var src_exports = {};
534
697
  __export(src_exports, {
@@ -854,8 +1017,8 @@ function isReference(block) {
854
1017
  }
855
1018
 
856
1019
  // src/dynamicFlow/DynamicFlow.tsx
857
- var import_react41 = require("react");
858
- var import_react_intl32 = require("react-intl");
1020
+ var import_react42 = require("react");
1021
+ var import_react_intl34 = require("react-intl");
859
1022
 
860
1023
  // src/common/contexts/dynamicFlowContexts/DynamicFlowContexts.tsx
861
1024
  var import_react2 = require("react");
@@ -1713,6 +1876,30 @@ var isNullableArrayModel = (model) => {
1713
1876
  // src/common/utils/misc-utils.ts
1714
1877
  var isBasicError = (error) => isString(error) || isNull(error);
1715
1878
 
1879
+ // src/common/utils/mobile-utils.ts
1880
+ var isMobile = () => {
1881
+ return isMobileScreenSize() && (isTouchScreen() || isMobileUA());
1882
+ };
1883
+ var isMobileUA = (userAgent = window.navigator.userAgent) => {
1884
+ return /Mobi|\b(iPhone|Android|BlackBerry|webOS|Windows Phone)\b/i.test(userAgent);
1885
+ };
1886
+ var isMobileScreenSize = (width = window.screen.width, height = window.screen.height) => {
1887
+ return width < 768 || height < 768;
1888
+ };
1889
+ var isTouchScreen = (navigator2 = window.navigator, matchMedia = window.matchMedia) => {
1890
+ if ("maxTouchPoints" in navigator2) {
1891
+ return navigator2.maxTouchPoints > 0;
1892
+ }
1893
+ if ("msMaxTouchPoints" in navigator2) {
1894
+ return navigator2["msMaxTouchPoints"] > 0;
1895
+ }
1896
+ const mQ = matchMedia == null ? void 0 : matchMedia("(pointer:coarse)");
1897
+ if ((mQ == null ? void 0 : mQ.media) === "(pointer:coarse)") {
1898
+ return !!mQ.matches;
1899
+ }
1900
+ return false;
1901
+ };
1902
+
1716
1903
  // src/common/hooks/useDebouncedFunction/useDebouncedFunction.tsx
1717
1904
  var import_react6 = require("react");
1718
1905
  function useDebouncedFunction(callback, waitMs) {
@@ -5812,11 +5999,11 @@ var LayoutStep = (props) => {
5812
5999
  var LayoutStep_default = LayoutStep;
5813
6000
 
5814
6001
  // src/step/cameraStep/CameraStep.tsx
5815
- var import_react36 = require("react");
6002
+ var import_react37 = require("react");
5816
6003
 
5817
6004
  // src/step/cameraStep/cameraCapture/CameraCapture.tsx
5818
- var import_react35 = require("react");
5819
- var import_react_intl28 = require("react-intl");
6005
+ var import_react36 = require("react");
6006
+ var import_react_intl30 = require("react-intl");
5820
6007
  var import_react_webcam = __toESM(require_react_webcam());
5821
6008
 
5822
6009
  // src/step/cameraStep/cameraCapture/CameraCapture.messages.ts
@@ -5841,16 +6028,56 @@ var CameraCapture_messages_default = (0, import_react_intl22.defineMessages)({
5841
6028
 
5842
6029
  // src/step/cameraStep/cameraCapture/components/index.tsx
5843
6030
  var import_components27 = require("@transferwise/components");
6031
+ var import_react_intl25 = require("react-intl");
6032
+
6033
+ // src/step/cameraStep/cameraCapture/components/orientationLockOverlay/OrientationLockOverlay.tsx
6034
+ var import_react_intl24 = require("react-intl");
6035
+
6036
+ // src/step/cameraStep/cameraCapture/components/orientationLockOverlay/OrientationLockOverlay.messages.ts
5844
6037
  var import_react_intl23 = require("react-intl");
6038
+ var OrientationLockOverlay_messages_default = (0, import_react_intl23.defineMessages)({
6039
+ text: {
6040
+ id: "dynamicFlows.CameraCapture.rotatePhone.text",
6041
+ defaultMessage: "Rotate your phone to portrait view to take a photo",
6042
+ description: "Prompt the user to rotate their phone from landscape to portrait mode when attempting to take a photo"
6043
+ },
6044
+ imgAlt: {
6045
+ id: "dynamicFlows.CameraCapture.rotatePhone.imgAlt",
6046
+ defaultMessage: "Rotate your phone icon",
6047
+ description: "Rotate phone icon alt text"
6048
+ }
6049
+ });
6050
+
6051
+ // src/step/cameraStep/cameraCapture/components/orientationLockOverlay/OrientationLockOverlay.tsx
5845
6052
  var import_jsx_runtime56 = require("react/jsx-runtime");
5846
- var CaptureBottomBar = ({ onCapture }) => /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("div", { className: "bottom-bar", children: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(CaptureButton, { onClick: onCapture }) });
6053
+ var OrientationLockOverlay = () => {
6054
+ const intl = (0, import_react_intl24.useIntl)();
6055
+ return /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("div", { className: "orientation-lock-overlay p-x-3 p-y-3", "data-testid": "orientation-lock", children: [
6056
+ /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
6057
+ "img",
6058
+ {
6059
+ className: "m-b-3",
6060
+ src: "https://wise.com/public-resources/assets/camera-guidelines/icon-rotate-phone.svg",
6061
+ width: "96",
6062
+ height: "96",
6063
+ alt: intl.formatMessage(OrientationLockOverlay_messages_default.imgAlt)
6064
+ }
6065
+ ),
6066
+ /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("p", { className: "text-center m-b-0", children: intl.formatMessage(OrientationLockOverlay_messages_default.text) })
6067
+ ] });
6068
+ };
6069
+ var OrientationLockOverlay_default = OrientationLockOverlay;
6070
+
6071
+ // src/step/cameraStep/cameraCapture/components/index.tsx
6072
+ var import_jsx_runtime57 = require("react/jsx-runtime");
6073
+ var CaptureBottomBar = ({ onCapture }) => /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("div", { className: "bottom-bar", children: /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(CaptureButton, { onClick: onCapture }) });
5847
6074
  var ReviewBottomBar = ({
5848
6075
  onSubmit,
5849
6076
  onRetry
5850
6077
  }) => {
5851
- const intl = (0, import_react_intl23.useIntl)();
5852
- return /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("div", { className: "bottom-bar p-x-2", children: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("div", { className: "row", children: /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("div", { className: "col-xs-12 col-md-6 col-md-offset-3", children: [
5853
- /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
6078
+ const intl = (0, import_react_intl25.useIntl)();
6079
+ return /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("div", { className: "bottom-bar p-x-2", children: /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("div", { className: "row", children: /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)("div", { className: "col-xs-12 col-md-6 col-md-offset-3", children: [
6080
+ /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
5854
6081
  import_components27.Button,
5855
6082
  {
5856
6083
  className: "m-b-1",
@@ -5861,7 +6088,7 @@ var ReviewBottomBar = ({
5861
6088
  children: intl.formatMessage(CameraCapture_messages_default.reviewSubmit)
5862
6089
  }
5863
6090
  ),
5864
- /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
6091
+ /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
5865
6092
  import_components27.Button,
5866
6093
  {
5867
6094
  className: "m-b-2",
@@ -5875,19 +6102,63 @@ var ReviewBottomBar = ({
5875
6102
  )
5876
6103
  ] }) }) });
5877
6104
  };
5878
- var CaptureButton = ({ onClick }) => /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
6105
+ var CaptureButton = ({ onClick }) => /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
5879
6106
  "button",
5880
6107
  {
5881
6108
  type: "button",
5882
6109
  className: "camera-capture-btn m-b-2",
5883
6110
  "data-testid": "camera-capture-button",
5884
6111
  onClick,
5885
- children: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("span", { className: "camera-capture-btn-inner" })
6112
+ children: /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("span", { className: "camera-capture-btn-inner" })
5886
6113
  }
5887
6114
  );
5888
6115
 
5889
- // src/step/cameraStep/cameraCapture/hooks/index.ts
6116
+ // src/step/cameraStep/cameraCapture/hooks/useFullScreenOrientationLock.ts
5890
6117
  var import_react33 = require("react");
6118
+ var import_screenfull = __toESM(require_screenfull());
6119
+ var useFullScreenOrientationLock = (isMobile2) => {
6120
+ const lockOrientation = (0, import_react33.useCallback)(() => {
6121
+ if (window.screen.orientation && "lock" in window.screen.orientation && typeof window.screen.orientation.lock === "function") {
6122
+ window.screen.orientation.lock("portrait").catch((e) => {
6123
+ });
6124
+ }
6125
+ }, []);
6126
+ const unlockOrientation = (0, import_react33.useCallback)(() => {
6127
+ var _a, _b;
6128
+ if ((_b = (_a = window.screen) == null ? void 0 : _a.orientation) == null ? void 0 : _b.unlock) {
6129
+ window.screen.orientation.unlock();
6130
+ }
6131
+ }, []);
6132
+ const enterFullScreen = (0, import_react33.useCallback)(() => {
6133
+ setTimeout(() => {
6134
+ if (isMobile2 && !import_screenfull.default.isFullscreen && import_screenfull.default.isEnabled) {
6135
+ import_screenfull.default.request(document.documentElement, { navigationUI: "show" }).then(() => {
6136
+ lockOrientation();
6137
+ }).catch((e) => {
6138
+ });
6139
+ }
6140
+ }, 100);
6141
+ }, [isMobile2, lockOrientation]);
6142
+ const exitFullScreen = (0, import_react33.useCallback)(() => {
6143
+ if (import_screenfull.default.isFullscreen) {
6144
+ import_screenfull.default.exit().catch(() => {
6145
+ });
6146
+ }
6147
+ unlockOrientation();
6148
+ }, [unlockOrientation]);
6149
+ (0, import_react33.useEffect)(() => {
6150
+ return () => {
6151
+ exitFullScreen();
6152
+ };
6153
+ }, [exitFullScreen]);
6154
+ return {
6155
+ enterFullScreen,
6156
+ exitFullScreen
6157
+ };
6158
+ };
6159
+
6160
+ // src/step/cameraStep/cameraCapture/hooks/useVideoConstraints.ts
6161
+ var import_react34 = require("react");
5891
6162
 
5892
6163
  // src/step/cameraStep/cameraCapture/utils/index.ts
5893
6164
  var isSelfieCamera = (stream) => {
@@ -5933,9 +6204,9 @@ var getVideoCapabilities = (videoStream) => {
5933
6204
  return (_b = (_a = getVideoTrack(videoStream)) == null ? void 0 : _a.getCapabilities) == null ? void 0 : _b.call(_a);
5934
6205
  };
5935
6206
 
5936
- // src/step/cameraStep/cameraCapture/hooks/index.ts
6207
+ // src/step/cameraStep/cameraCapture/hooks/useVideoConstraints.ts
5937
6208
  var useVideoConstraints = (direction) => {
5938
- const [videoConstraints, setVideoConstraints] = (0, import_react33.useState)();
6209
+ const [videoConstraints, setVideoConstraints] = (0, import_react34.useState)();
5939
6210
  const defaultVideoConstraints = {
5940
6211
  facingMode: direction === "front" ? "user" : "environment",
5941
6212
  height: { min: 480, max: 1080, ideal: 720 },
@@ -5943,7 +6214,7 @@ var useVideoConstraints = (direction) => {
5943
6214
  frameRate: 30,
5944
6215
  aspectRatio: 16 / 9
5945
6216
  };
5946
- (0, import_react33.useEffect)(() => {
6217
+ (0, import_react34.useEffect)(() => {
5947
6218
  void getVideoConstraints(direction).then(setVideoConstraints);
5948
6219
  }, [direction]);
5949
6220
  const getVideoConstraints = async (direction2) => {
@@ -5961,8 +6232,8 @@ var useVideoConstraints = (direction) => {
5961
6232
  };
5962
6233
 
5963
6234
  // src/step/cameraStep/cameraCapture/overlay/Overlay.tsx
5964
- var import_react34 = require("react");
5965
- var import_jsx_runtime57 = require("react/jsx-runtime");
6235
+ var import_react35 = require("react");
6236
+ var import_jsx_runtime58 = require("react/jsx-runtime");
5966
6237
  var captureButtonHeight = 92;
5967
6238
  var reviewButtonsHeight = 120;
5968
6239
  var imageHeight = 40;
@@ -5978,8 +6249,8 @@ var Overlay = ({
5978
6249
  instructions,
5979
6250
  reviewInstructions
5980
6251
  }) => {
5981
- const svgReference = (0, import_react34.useRef)(null);
5982
- (0, import_react34.useEffect)(() => {
6252
+ const svgReference = (0, import_react35.useRef)(null);
6253
+ (0, import_react35.useEffect)(() => {
5983
6254
  const listener = debounce(() => {
5984
6255
  var _a;
5985
6256
  if ((_a = svgReference.current) == null ? void 0 : _a.innerHTML) {
@@ -5991,18 +6262,18 @@ var Overlay = ({
5991
6262
  return () => window.removeEventListener("resize", listener);
5992
6263
  });
5993
6264
  let helperBoxHeight = (imageUrl ? imageHeight : 0) + (title ? titleHeight : 0) + (instructions ? instructionsHeight : 0);
5994
- let helperBox = /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)(import_jsx_runtime57.Fragment, { children: [
5995
- imageUrl && /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("img", { className: "camera-capture-img", src: imageUrl, alt: "" }),
5996
- title && /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("h4", { className: "camera-capture-title", children: title }),
5997
- instructions && /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("small", { className: "camera-capture-instructions", children: instructions })
6265
+ let helperBox = /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)(import_jsx_runtime58.Fragment, { children: [
6266
+ imageUrl && /* @__PURE__ */ (0, import_jsx_runtime58.jsx)("img", { className: "camera-capture-img", src: imageUrl, alt: "" }),
6267
+ title && /* @__PURE__ */ (0, import_jsx_runtime58.jsx)("h4", { className: "camera-capture-title", children: title }),
6268
+ instructions && /* @__PURE__ */ (0, import_jsx_runtime58.jsx)("small", { className: "camera-capture-instructions", children: instructions })
5998
6269
  ] });
5999
6270
  const frameBottomMargin = captureButtonHeight + helperBoxHeight;
6000
6271
  if (reviewInstructions) {
6001
6272
  helperBoxHeight = frameBottomMargin - reviewButtonsHeight;
6002
- helperBox = /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("small", { className: "camera-capture-instructions", children: reviewInstructions });
6273
+ helperBox = /* @__PURE__ */ (0, import_jsx_runtime58.jsx)("small", { className: "camera-capture-instructions", children: reviewInstructions });
6003
6274
  const frameWithReviewInstructionsMinBottomMargin = reviewButtonsHeight + reviewInstructionsHeight;
6004
6275
  if (frameBottomMargin < frameWithReviewInstructionsMinBottomMargin) {
6005
- helperBox = /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(import_jsx_runtime57.Fragment, {});
6276
+ helperBox = /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(import_jsx_runtime58.Fragment, {});
6006
6277
  }
6007
6278
  }
6008
6279
  const framePosition = {
@@ -6020,25 +6291,25 @@ var Overlay = ({
6020
6291
  width: "90%"
6021
6292
  }
6022
6293
  };
6023
- return /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)("svg", { ref: svgReference, xmlns: "http://www.w3.org/2000/svg", children: [
6024
- /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("defs", { children: /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)("mask", { id: "mask", children: [
6025
- /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("rect", { width: "100%", height: "100%", fill: "#fff" }),
6026
- /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("image", __spreadValues({ href: overlay }, framePosition))
6294
+ return /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)("svg", { ref: svgReference, xmlns: "http://www.w3.org/2000/svg", children: [
6295
+ /* @__PURE__ */ (0, import_jsx_runtime58.jsx)("defs", { children: /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)("mask", { id: "mask", children: [
6296
+ /* @__PURE__ */ (0, import_jsx_runtime58.jsx)("rect", { width: "100%", height: "100%", fill: "#fff" }),
6297
+ /* @__PURE__ */ (0, import_jsx_runtime58.jsx)("image", __spreadValues({ href: overlay }, framePosition))
6027
6298
  ] }) }),
6028
- overlay && /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("rect", { width: "100%", height: "100%", mask: "url(#mask)", fillOpacity: "0.72" }),
6029
- outline && /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("image", __spreadValues({ href: outline }, framePosition)),
6030
- /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("foreignObject", { width: "100%", height: "100%", children: /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("div", __spreadProps(__spreadValues({ className: "camera-capture-text-and-image-container" }, helperBoxPosition), { children: helperBox })) })
6299
+ overlay && /* @__PURE__ */ (0, import_jsx_runtime58.jsx)("rect", { width: "100%", height: "100%", mask: "url(#mask)", fillOpacity: "0.72" }),
6300
+ outline && /* @__PURE__ */ (0, import_jsx_runtime58.jsx)("image", __spreadValues({ href: outline }, framePosition)),
6301
+ /* @__PURE__ */ (0, import_jsx_runtime58.jsx)("foreignObject", { width: "100%", height: "100%", children: /* @__PURE__ */ (0, import_jsx_runtime58.jsx)("div", __spreadProps(__spreadValues({ className: "camera-capture-text-and-image-container" }, helperBoxPosition), { children: helperBox })) })
6031
6302
  ] });
6032
6303
  };
6033
6304
  var Overlay_default = Overlay;
6034
6305
 
6035
6306
  // src/step/cameraStep/cameraCapture/screens/NoCameraAccess/NoCameraAccess.tsx
6036
6307
  var import_components28 = require("@transferwise/components");
6037
- var import_react_intl25 = require("react-intl");
6308
+ var import_react_intl27 = require("react-intl");
6038
6309
 
6039
6310
  // src/step/cameraStep/cameraCapture/screens/NoCameraAccess/NoCameraAccess.messages.ts
6040
- var import_react_intl24 = require("react-intl");
6041
- var NoCameraAccess_messages_default = (0, import_react_intl24.defineMessages)({
6311
+ var import_react_intl26 = require("react-intl");
6312
+ var NoCameraAccess_messages_default = (0, import_react_intl26.defineMessages)({
6042
6313
  title: {
6043
6314
  id: "dynamicFlows.CameraCapture.NoCameraAccess.title",
6044
6315
  defaultMessage: "We can't access your camera",
@@ -6057,23 +6328,23 @@ var NoCameraAccess_messages_default = (0, import_react_intl24.defineMessages)({
6057
6328
  });
6058
6329
 
6059
6330
  // src/step/cameraStep/cameraCapture/screens/NoCameraAccess/NoCameraAccess.tsx
6060
- var import_jsx_runtime58 = require("react/jsx-runtime");
6331
+ var import_jsx_runtime59 = require("react/jsx-runtime");
6061
6332
  var NoCameraAccess = ({ onAction }) => {
6062
- const intl = (0, import_react_intl25.useIntl)();
6063
- return /* @__PURE__ */ (0, import_jsx_runtime58.jsx)("div", { id: "no-camera-access", children: /* @__PURE__ */ (0, import_jsx_runtime58.jsx)("div", { className: "container p-t-5", children: /* @__PURE__ */ (0, import_jsx_runtime58.jsx)("div", { className: "row", children: /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)("div", { className: "col-md-6 col-md-offset-3", children: [
6064
- /* @__PURE__ */ (0, import_jsx_runtime58.jsx)("h2", { className: "text-xs-center m-b-3", children: intl.formatMessage(NoCameraAccess_messages_default.title) }),
6065
- /* @__PURE__ */ (0, import_jsx_runtime58.jsx)("p", { className: "text-xs-center m-b-5", children: intl.formatMessage(NoCameraAccess_messages_default.paragraph) }),
6066
- /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(import_components28.Button, { block: true, onClick: onAction, children: intl.formatMessage(NoCameraAccess_messages_default.action) })
6333
+ const intl = (0, import_react_intl27.useIntl)();
6334
+ return /* @__PURE__ */ (0, import_jsx_runtime59.jsx)("div", { id: "no-camera-access", children: /* @__PURE__ */ (0, import_jsx_runtime59.jsx)("div", { className: "container p-t-5", children: /* @__PURE__ */ (0, import_jsx_runtime59.jsx)("div", { className: "row", children: /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)("div", { className: "col-md-6 col-md-offset-3", children: [
6335
+ /* @__PURE__ */ (0, import_jsx_runtime59.jsx)("h2", { className: "text-xs-center m-b-3", children: intl.formatMessage(NoCameraAccess_messages_default.title) }),
6336
+ /* @__PURE__ */ (0, import_jsx_runtime59.jsx)("p", { className: "text-xs-center m-b-5", children: intl.formatMessage(NoCameraAccess_messages_default.paragraph) }),
6337
+ /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(import_components28.Button, { block: true, onClick: onAction, children: intl.formatMessage(NoCameraAccess_messages_default.action) })
6067
6338
  ] }) }) }) });
6068
6339
  };
6069
6340
  var NoCameraAccess_default = NoCameraAccess;
6070
6341
 
6071
6342
  // src/step/cameraStep/cameraCapture/screens/CameraNotSupported/CameraNotSupported.tsx
6072
- var import_react_intl27 = require("react-intl");
6343
+ var import_react_intl29 = require("react-intl");
6073
6344
 
6074
6345
  // src/step/cameraStep/cameraCapture/screens/CameraNotSupported/CameraNotSupported.messages.ts
6075
- var import_react_intl26 = require("react-intl");
6076
- var CameraNotSupported_messages_default = (0, import_react_intl26.defineMessages)({
6346
+ var import_react_intl28 = require("react-intl");
6347
+ var CameraNotSupported_messages_default = (0, import_react_intl28.defineMessages)({
6077
6348
  title: {
6078
6349
  id: "dynamicFlows.CameraCapture.CameraNotSupported.title",
6079
6350
  defaultMessage: "Camera not supported",
@@ -6087,12 +6358,12 @@ var CameraNotSupported_messages_default = (0, import_react_intl26.defineMessages
6087
6358
  });
6088
6359
 
6089
6360
  // src/step/cameraStep/cameraCapture/screens/CameraNotSupported/CameraNotSupported.tsx
6090
- var import_jsx_runtime59 = require("react/jsx-runtime");
6361
+ var import_jsx_runtime60 = require("react/jsx-runtime");
6091
6362
  var CameraNotSupported = () => {
6092
- const intl = (0, import_react_intl27.useIntl)();
6093
- return /* @__PURE__ */ (0, import_jsx_runtime59.jsx)("div", { id: "camera-not-supported", children: /* @__PURE__ */ (0, import_jsx_runtime59.jsx)("div", { className: "container p-t-5", children: /* @__PURE__ */ (0, import_jsx_runtime59.jsx)("div", { className: "row", children: /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)("div", { className: "col-md-6 col-md-offset-3", children: [
6094
- /* @__PURE__ */ (0, import_jsx_runtime59.jsx)("h2", { className: "text-xs-center m-b-3", children: intl.formatMessage(CameraNotSupported_messages_default.title) }),
6095
- /* @__PURE__ */ (0, import_jsx_runtime59.jsx)("p", { className: "text-xs-center m-b-5", children: intl.formatMessage(CameraNotSupported_messages_default.paragraph) })
6363
+ const intl = (0, import_react_intl29.useIntl)();
6364
+ return /* @__PURE__ */ (0, import_jsx_runtime60.jsx)("div", { id: "camera-not-supported", children: /* @__PURE__ */ (0, import_jsx_runtime60.jsx)("div", { className: "container p-t-5", children: /* @__PURE__ */ (0, import_jsx_runtime60.jsx)("div", { className: "row", children: /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)("div", { className: "col-md-6 col-md-offset-3", children: [
6365
+ /* @__PURE__ */ (0, import_jsx_runtime60.jsx)("h2", { className: "text-xs-center m-b-3", children: intl.formatMessage(CameraNotSupported_messages_default.title) }),
6366
+ /* @__PURE__ */ (0, import_jsx_runtime60.jsx)("p", { className: "text-xs-center m-b-5", children: intl.formatMessage(CameraNotSupported_messages_default.paragraph) })
6096
6367
  ] }) }) }) });
6097
6368
  };
6098
6369
  var CameraNotSupported_default = CameraNotSupported;
@@ -6117,7 +6388,7 @@ var getCameraStartedProperties = async (props, videoStream) => {
6117
6388
  };
6118
6389
 
6119
6390
  // src/step/cameraStep/cameraCapture/CameraCapture.tsx
6120
- var import_jsx_runtime60 = require("react/jsx-runtime");
6391
+ var import_jsx_runtime61 = require("react/jsx-runtime");
6121
6392
  var CameraCapture = ({
6122
6393
  direction = "back",
6123
6394
  overlay = "",
@@ -6129,14 +6400,16 @@ var CameraCapture = ({
6129
6400
  onCapture,
6130
6401
  onEvent
6131
6402
  }) => {
6132
- const [mode, setMode] = (0, import_react35.useState)("CAPTURE");
6133
- const [isVideoMirrored, setIsVideoMirrored] = (0, import_react35.useState)(false);
6134
- const [ready, setReady] = (0, import_react35.useState)(false);
6135
- const [reviewImage, setReviewImage] = (0, import_react35.useState)();
6136
- const webcamReference = (0, import_react35.useRef)(null);
6403
+ const [mode, setMode] = (0, import_react36.useState)("CAPTURE");
6404
+ const [isVideoMirrored, setIsVideoMirrored] = (0, import_react36.useState)(false);
6405
+ const [ready, setReady] = (0, import_react36.useState)(false);
6406
+ const [reviewImage, setReviewImage] = (0, import_react36.useState)();
6407
+ const webcamReference = (0, import_react36.useRef)(null);
6137
6408
  const { videoConstraints } = useVideoConstraints(direction);
6138
- const intl = (0, import_react_intl28.useIntl)();
6139
- const handleCapture = (0, import_react35.useCallback)(async () => {
6409
+ const isMobileDevice = (0, import_react36.useMemo)(() => isMobile(), []);
6410
+ const { enterFullScreen, exitFullScreen } = useFullScreenOrientationLock(isMobileDevice);
6411
+ const intl = (0, import_react_intl30.useIntl)();
6412
+ const handleCapture = (0, import_react36.useCallback)(async () => {
6140
6413
  var _a, _b, _c, _d, _e, _f;
6141
6414
  if (((_a = webcamReference == null ? void 0 : webcamReference.current) == null ? void 0 : _a.video) && ((_c = (_b = webcamReference == null ? void 0 : webcamReference.current) == null ? void 0 : _b.video) == null ? void 0 : _c.readyState) >= 3) {
6142
6415
  (_e = (_d = webcamReference == null ? void 0 : webcamReference.current) == null ? void 0 : _d.video) == null ? void 0 : _e.pause();
@@ -6158,7 +6431,7 @@ var CameraCapture = ({
6158
6431
  );
6159
6432
  }
6160
6433
  }, [webcamReference, showReview, setReviewImage, setMode, onCapture, isVideoMirrored]);
6161
- const handleUserMediaError = (0, import_react35.useCallback)(
6434
+ const handleUserMediaError = (0, import_react36.useCallback)(
6162
6435
  (error) => {
6163
6436
  if (error instanceof DOMException && (error == null ? void 0 : error.name) === "NotAllowedError") {
6164
6437
  setMode("NO_CAMERA_ACCESS");
@@ -6170,13 +6443,14 @@ var CameraCapture = ({
6170
6443
  },
6171
6444
  [setMode, onEvent]
6172
6445
  );
6173
- const handleUserMedia = (0, import_react35.useCallback)(
6446
+ const handleUserMedia = (0, import_react36.useCallback)(
6174
6447
  (stream) => {
6448
+ enterFullScreen();
6175
6449
  setReady(true);
6176
6450
  setIsVideoMirrored(isSelfieCamera(stream));
6177
6451
  void trackCameraFeedStarted(onEvent, { direction }, stream);
6178
6452
  },
6179
- [setIsVideoMirrored, onEvent, direction]
6453
+ [setIsVideoMirrored, onEvent, direction, enterFullScreen]
6180
6454
  );
6181
6455
  const handleReviewSubmit = () => {
6182
6456
  onCapture((reviewImage == null ? void 0 : reviewImage.blob) || null);
@@ -6186,8 +6460,13 @@ var CameraCapture = ({
6186
6460
  setReviewImage(void 0);
6187
6461
  };
6188
6462
  const handleRetryCameraAccess = () => setMode("CAPTURE");
6189
- const captureScreen = /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)(import_jsx_runtime60.Fragment, { children: [
6190
- videoConstraints && /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
6463
+ (0, import_react36.useEffect)(() => {
6464
+ if (mode !== "CAPTURE") {
6465
+ exitFullScreen();
6466
+ }
6467
+ }, [mode, exitFullScreen]);
6468
+ const captureScreen = /* @__PURE__ */ (0, import_jsx_runtime61.jsxs)(import_jsx_runtime61.Fragment, { children: [
6469
+ videoConstraints && /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
6191
6470
  import_react_webcam.default,
6192
6471
  {
6193
6472
  ref: webcamReference,
@@ -6198,7 +6477,7 @@ var CameraCapture = ({
6198
6477
  onUserMedia: handleUserMedia
6199
6478
  }
6200
6479
  ),
6201
- /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
6480
+ /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
6202
6481
  Overlay_default,
6203
6482
  {
6204
6483
  overlay,
@@ -6208,11 +6487,12 @@ var CameraCapture = ({
6208
6487
  instructions
6209
6488
  }
6210
6489
  ),
6211
- ready && /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(CaptureBottomBar, { onCapture: () => void handleCapture() })
6490
+ isMobileDevice && /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(OrientationLockOverlay_default, {}),
6491
+ ready && /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(CaptureBottomBar, { onCapture: () => void handleCapture() })
6212
6492
  ] });
6213
- const reviewScreen = /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)(import_jsx_runtime60.Fragment, { children: [
6214
- /* @__PURE__ */ (0, import_jsx_runtime60.jsx)("img", { className: "review-image", src: reviewImage == null ? void 0 : reviewImage.source, alt: "" }),
6215
- /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
6493
+ const reviewScreen = /* @__PURE__ */ (0, import_jsx_runtime61.jsxs)(import_jsx_runtime61.Fragment, { children: [
6494
+ /* @__PURE__ */ (0, import_jsx_runtime61.jsx)("img", { className: "review-image", src: reviewImage == null ? void 0 : reviewImage.source, alt: "" }),
6495
+ /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
6216
6496
  Overlay_default,
6217
6497
  {
6218
6498
  overlay,
@@ -6222,19 +6502,19 @@ var CameraCapture = ({
6222
6502
  reviewInstructions: intl.formatMessage(CameraCapture_messages_default.reviewInstructions)
6223
6503
  }
6224
6504
  ),
6225
- /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(ReviewBottomBar, { onSubmit: handleReviewSubmit, onRetry: handleReviewRetry })
6505
+ /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(ReviewBottomBar, { onSubmit: handleReviewSubmit, onRetry: handleReviewRetry })
6226
6506
  ] });
6227
- return /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)("section", { className: "camera-capture", children: [
6507
+ return /* @__PURE__ */ (0, import_jsx_runtime61.jsxs)("section", { className: "camera-capture", children: [
6228
6508
  mode === "CAPTURE" && captureScreen,
6229
6509
  mode === "REVIEW" && reviewScreen,
6230
- mode === "NO_CAMERA_ACCESS" && /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(NoCameraAccess_default, { onAction: handleRetryCameraAccess }),
6231
- mode === "CAMERA_NOT_SUPPORTED" && /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(CameraNotSupported_default, {})
6510
+ mode === "NO_CAMERA_ACCESS" && /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(NoCameraAccess_default, { onAction: handleRetryCameraAccess }),
6511
+ mode === "CAMERA_NOT_SUPPORTED" && /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(CameraNotSupported_default, {})
6232
6512
  ] });
6233
6513
  };
6234
6514
  var CameraCapture_default = CameraCapture;
6235
6515
 
6236
6516
  // src/step/cameraStep/CameraStep.tsx
6237
- var import_jsx_runtime61 = require("react/jsx-runtime");
6517
+ var import_jsx_runtime62 = require("react/jsx-runtime");
6238
6518
  function blobToBase64(blob) {
6239
6519
  return new Promise((resolve, _) => {
6240
6520
  const reader = new FileReader();
@@ -6252,8 +6532,8 @@ var CameraStep = (props) => {
6252
6532
  const { assets, direction, instructions } = cameraConfig || {};
6253
6533
  const { overlay, outline } = assets || {};
6254
6534
  const { url: imageUrl } = image || {};
6255
- const [captureClicked, setCaptureClicked] = (0, import_react36.useState)(false);
6256
- (0, import_react36.useEffect)(() => {
6535
+ const [captureClicked, setCaptureClicked] = (0, import_react37.useState)(false);
6536
+ (0, import_react37.useEffect)(() => {
6257
6537
  if (captureClicked) {
6258
6538
  onAction(action);
6259
6539
  }
@@ -6272,7 +6552,7 @@ var CameraStep = (props) => {
6272
6552
  });
6273
6553
  }
6274
6554
  };
6275
- return /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
6555
+ return /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
6276
6556
  CameraCapture_default,
6277
6557
  {
6278
6558
  overlay,
@@ -6321,11 +6601,11 @@ function getFirstAction(step) {
6321
6601
  }
6322
6602
 
6323
6603
  // src/step/externalConfirmationStep/ExternalConfirmationStep.tsx
6324
- var import_react_intl30 = require("react-intl");
6604
+ var import_react_intl32 = require("react-intl");
6325
6605
 
6326
6606
  // src/step/externalConfirmationStep/ExternalConfirmationStep.messages.ts
6327
- var import_react_intl29 = require("react-intl");
6328
- var ExternalConfirmationStep_messages_default = (0, import_react_intl29.defineMessages)({
6607
+ var import_react_intl31 = require("react-intl");
6608
+ var ExternalConfirmationStep_messages_default = (0, import_react_intl31.defineMessages)({
6329
6609
  title: {
6330
6610
  id: "dynamicFlows.ExternalConfirmation.title",
6331
6611
  defaultMessage: "Please confirm",
@@ -6349,12 +6629,12 @@ var ExternalConfirmationStep_messages_default = (0, import_react_intl29.defineMe
6349
6629
  });
6350
6630
 
6351
6631
  // src/step/externalConfirmationStep/ExternalConfirmationStep.tsx
6352
- var import_jsx_runtime62 = require("react/jsx-runtime");
6632
+ var import_jsx_runtime63 = require("react/jsx-runtime");
6353
6633
  var noop4 = () => {
6354
6634
  };
6355
6635
  var ExternalConfirmationStep = ({ url, onClose }) => {
6356
- const { formatMessage } = (0, import_react_intl30.useIntl)();
6357
- return /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
6636
+ const { formatMessage } = (0, import_react_intl32.useIntl)();
6637
+ return /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
6358
6638
  DynamicLayout_default,
6359
6639
  {
6360
6640
  components: [
@@ -6421,9 +6701,9 @@ function getOrigin(url) {
6421
6701
  // src/dynamicFlow/BackButton.tsx
6422
6702
  var import_components30 = require("@transferwise/components");
6423
6703
  var import_icons2 = require("@transferwise/icons");
6424
- var import_jsx_runtime63 = require("react/jsx-runtime");
6704
+ var import_jsx_runtime64 = require("react/jsx-runtime");
6425
6705
  var BackButton = ({ title, action, onAction }) => {
6426
- return /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)(
6706
+ return /* @__PURE__ */ (0, import_jsx_runtime64.jsxs)(
6427
6707
  "a",
6428
6708
  {
6429
6709
  onClick: (event) => {
@@ -6434,8 +6714,8 @@ var BackButton = ({ title, action, onAction }) => {
6434
6714
  className: "df-back-btn",
6435
6715
  "aria-label": title,
6436
6716
  children: [
6437
- /* @__PURE__ */ (0, import_jsx_runtime63.jsx)("span", { className: "sr-only", children: title }),
6438
- /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(import_components30.Avatar, { type: "icon", children: /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(import_icons2.ArrowLeft, { size: "24" }) })
6717
+ /* @__PURE__ */ (0, import_jsx_runtime64.jsx)("span", { className: "sr-only", children: title }),
6718
+ /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(import_components30.Avatar, { type: "icon", children: /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(import_icons2.ArrowLeft, { size: "24" }) })
6439
6719
  ]
6440
6720
  }
6441
6721
  );
@@ -6443,7 +6723,7 @@ var BackButton = ({ title, action, onAction }) => {
6443
6723
  var BackButton_default = BackButton;
6444
6724
 
6445
6725
  // src/dynamicFlow/DynamicFlowStep.tsx
6446
- var import_jsx_runtime64 = require("react/jsx-runtime");
6726
+ var import_jsx_runtime65 = require("react/jsx-runtime");
6447
6727
  var DynamicFlowStep = (props) => {
6448
6728
  var _a, _b, _c;
6449
6729
  const { step, globalError, onAction } = props;
@@ -6454,23 +6734,23 @@ var DynamicFlowStep = (props) => {
6454
6734
  return null;
6455
6735
  }
6456
6736
  if (externalUrl && requiresManualTrigger) {
6457
- return /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(ExternalConfirmationStep_default, { url: externalUrl, onClose: dismissConfirmation });
6737
+ return /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(ExternalConfirmationStep_default, { url: externalUrl, onClose: dismissConfirmation });
6458
6738
  }
6459
6739
  if (isCameraStep(step)) {
6460
- return /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(CameraStep_default, __spreadProps(__spreadValues({}, props), { step }));
6740
+ return /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(CameraStep_default, __spreadProps(__spreadValues({}, props), { step }));
6461
6741
  }
6462
- return /* @__PURE__ */ (0, import_jsx_runtime64.jsxs)(import_jsx_runtime64.Fragment, { children: [
6463
- backButton && /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(BackButton_default, __spreadProps(__spreadValues({}, backButton), { onAction })),
6464
- globalError ? /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(DynamicAlert_default, { component: { context: "negative", markdown: globalError, margin: "lg" } }) : null,
6465
- /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(LayoutStep_default, __spreadProps(__spreadValues({}, props), { stepSpecification: step }))
6742
+ return /* @__PURE__ */ (0, import_jsx_runtime65.jsxs)(import_jsx_runtime65.Fragment, { children: [
6743
+ backButton && /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(BackButton_default, __spreadProps(__spreadValues({}, backButton), { onAction })),
6744
+ globalError ? /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(DynamicAlert_default, { component: { context: "negative", markdown: globalError, margin: "lg" } }) : null,
6745
+ /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(LayoutStep_default, __spreadProps(__spreadValues({}, props), { stepSpecification: step }))
6466
6746
  ] });
6467
6747
  };
6468
6748
 
6469
6749
  // src/dynamicFlow/utils/useDebouncedRefresh/useDebouncedRefresh.ts
6470
- var import_react37 = require("react");
6750
+ var import_react38 = require("react");
6471
6751
  var DEBOUNCE_DELAY = 1e3;
6472
6752
  function useDebouncedRefresh(fetchRefresh) {
6473
- const map = (0, import_react37.useRef)(/* @__PURE__ */ new Map());
6753
+ const map = (0, import_react38.useRef)(/* @__PURE__ */ new Map());
6474
6754
  const retrieveOrCreate = (key) => {
6475
6755
  if (map.current.has(key)) {
6476
6756
  return map.current.get(key);
@@ -6493,12 +6773,12 @@ function useDebouncedRefresh(fetchRefresh) {
6493
6773
  var shouldDebounceSchema = (schema) => getSchemaType(schema) === "basic" && schema.type !== "boolean" && schema.format !== "base64url";
6494
6774
 
6495
6775
  // src/dynamicFlow/utils/useDynamicFlowState.ts
6496
- var import_react38 = require("react");
6776
+ var import_react39 = require("react");
6497
6777
  var useDynamicFlowState = (initialStep) => {
6498
6778
  var _a, _b;
6499
- const [formErrors, setFormErrors] = (0, import_react38.useState)((_a = initialStep == null ? void 0 : initialStep.errors) == null ? void 0 : _a.validation);
6500
- const [globalError, setGlobalError] = (0, import_react38.useState)((_b = initialStep == null ? void 0 : initialStep.errors) == null ? void 0 : _b.error);
6501
- const [stepAndModels, setStepAndModels] = (0, import_react38.useState)({
6779
+ const [formErrors, setFormErrors] = (0, import_react39.useState)((_a = initialStep == null ? void 0 : initialStep.errors) == null ? void 0 : _a.validation);
6780
+ const [globalError, setGlobalError] = (0, import_react39.useState)((_b = initialStep == null ? void 0 : initialStep.errors) == null ? void 0 : _b.error);
6781
+ const [stepAndModels, setStepAndModels] = (0, import_react39.useState)({
6502
6782
  step: initialStep || void 0,
6503
6783
  models: (initialStep == null ? void 0 : initialStep.model) ? buildInitialModels(initialStep.model, getAllSchemas(initialStep)) : {},
6504
6784
  etag: void 0
@@ -6528,7 +6808,7 @@ var useDynamicFlowState = (initialStep) => {
6528
6808
  return updatedState;
6529
6809
  });
6530
6810
  };
6531
- const modelIsValid = (0, import_react38.useMemo)(
6811
+ const modelIsValid = (0, import_react39.useMemo)(
6532
6812
  () => areModelsValid(models, getAllValidatableSchemas(step)),
6533
6813
  [models, step]
6534
6814
  );
@@ -6607,17 +6887,17 @@ var isInlineSchema = (schema) => {
6607
6887
 
6608
6888
  // src/dynamicFlow/utils/useLoader.tsx
6609
6889
  var import_components31 = require("@transferwise/components");
6610
- var import_react39 = require("react");
6611
- var import_jsx_runtime65 = require("react/jsx-runtime");
6890
+ var import_react40 = require("react");
6891
+ var import_jsx_runtime66 = require("react/jsx-runtime");
6612
6892
  function useLoader(loaderConfig, initialState) {
6613
6893
  const config = __spreadValues({
6614
6894
  size: import_components31.Size.EXTRA_LARGE,
6615
6895
  initial: true,
6616
6896
  submission: false
6617
6897
  }, loaderConfig);
6618
- const [loadingState, setLoadingState] = (0, import_react39.useState)(initialState);
6898
+ const [loadingState, setLoadingState] = (0, import_react40.useState)(initialState);
6619
6899
  const shouldDisplayLoader = config.initial && loadingState === "initial" || config.submission && loadingState === "submission";
6620
- const loader = shouldDisplayLoader ? /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
6900
+ const loader = shouldDisplayLoader ? /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
6621
6901
  import_components31.Loader,
6622
6902
  {
6623
6903
  size: config.size,
@@ -6629,15 +6909,15 @@ function useLoader(loaderConfig, initialState) {
6629
6909
  }
6630
6910
 
6631
6911
  // src/dynamicFlow/utils/errorBoundary/ErrorBoundary.tsx
6632
- var import_react40 = require("react");
6912
+ var import_react41 = require("react");
6633
6913
 
6634
6914
  // src/dynamicFlow/utils/errorBoundary/ErrorBoundaryAlert.tsx
6635
6915
  var import_components32 = require("@transferwise/components");
6636
- var import_react_intl31 = require("react-intl");
6637
- var import_jsx_runtime66 = require("react/jsx-runtime");
6916
+ var import_react_intl33 = require("react-intl");
6917
+ var import_jsx_runtime67 = require("react/jsx-runtime");
6638
6918
  var ErrorBoundaryAlert = ({ onDismiss }) => {
6639
- const { formatMessage } = (0, import_react_intl31.useIntl)();
6640
- return /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
6919
+ const { formatMessage } = (0, import_react_intl33.useIntl)();
6920
+ return /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
6641
6921
  import_components32.Alert,
6642
6922
  {
6643
6923
  action: {
@@ -6653,10 +6933,10 @@ var ErrorBoundaryAlert = ({ onDismiss }) => {
6653
6933
  };
6654
6934
 
6655
6935
  // src/dynamicFlow/utils/errorBoundary/ErrorBoundary.tsx
6656
- var import_jsx_runtime67 = require("react/jsx-runtime");
6936
+ var import_jsx_runtime68 = require("react/jsx-runtime");
6657
6937
  var noop5 = () => {
6658
6938
  };
6659
- var ErrorBoundary = class extends import_react40.Component {
6939
+ var ErrorBoundary = class extends import_react41.Component {
6660
6940
  constructor(props) {
6661
6941
  super(props);
6662
6942
  this.handleErrorReset = () => {
@@ -6674,8 +6954,8 @@ var ErrorBoundary = class extends import_react40.Component {
6674
6954
  render() {
6675
6955
  const { children } = this.props;
6676
6956
  const { hasError, isFatalError } = this.state;
6677
- return /* @__PURE__ */ (0, import_jsx_runtime67.jsxs)(import_jsx_runtime67.Fragment, { children: [
6678
- hasError && /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(ErrorBoundaryAlert, { onDismiss: this.handleErrorReset }),
6957
+ return /* @__PURE__ */ (0, import_jsx_runtime68.jsxs)(import_jsx_runtime68.Fragment, { children: [
6958
+ hasError && /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(ErrorBoundaryAlert, { onDismiss: this.handleErrorReset }),
6679
6959
  !isFatalError && children
6680
6960
  ] });
6681
6961
  }
@@ -6780,7 +7060,7 @@ var assertResponseIsValid = (response) => {
6780
7060
  var isResponse = (response) => typeof response === "object" && response !== null && "clone" in response && "bodyUsed" in response;
6781
7061
 
6782
7062
  // src/dynamicFlow/DynamicFlow.tsx
6783
- var import_jsx_runtime68 = require("react/jsx-runtime");
7063
+ var import_jsx_runtime69 = require("react/jsx-runtime");
6784
7064
  var noop6 = () => {
6785
7065
  };
6786
7066
  var DynamicFlowComponent = ({
@@ -6795,7 +7075,7 @@ var DynamicFlowComponent = ({
6795
7075
  onEvent = noop6,
6796
7076
  onLog = noop6
6797
7077
  }) => {
6798
- const { locale } = (0, import_react_intl32.useIntl)();
7078
+ const { locale } = (0, import_react_intl34.useIntl)();
6799
7079
  const {
6800
7080
  formErrors,
6801
7081
  globalError,
@@ -6808,24 +7088,24 @@ var DynamicFlowComponent = ({
6808
7088
  setStepAndEtag,
6809
7089
  setSchemaModel
6810
7090
  } = useDynamicFlowState(initialStep);
6811
- const [submitted, setSubmitted] = (0, import_react41.useState)(false);
7091
+ const [submitted, setSubmitted] = (0, import_react42.useState)(false);
6812
7092
  const { isLoading, loader, setLoadingState } = useLoader(
6813
7093
  loaderConfig,
6814
7094
  initialStep ? "idle" : "initial"
6815
7095
  );
6816
7096
  const logCritical = getLogger("critical", onLog, flowId, (step == null ? void 0 : step.id) || (step == null ? void 0 : step.key));
6817
- const analyticsMetadata = (0, import_react41.useMemo)(
7097
+ const analyticsMetadata = (0, import_react42.useMemo)(
6818
7098
  () => {
6819
7099
  var _a;
6820
7100
  return __spreadValues({ flowId, stepId: (step == null ? void 0 : step.id) || (step == null ? void 0 : step.key) }, (_a = step == null ? void 0 : step.analytics) != null ? _a : {});
6821
7101
  },
6822
7102
  [flowId, step]
6823
7103
  );
6824
- const dispatchEvent = (0, import_react41.useMemo)(
7104
+ const dispatchEvent = (0, import_react42.useMemo)(
6825
7105
  () => getEventDispatcher(onEvent, analyticsMetadata),
6826
7106
  [onEvent, analyticsMetadata]
6827
7107
  );
6828
- const dfHttpClient = (0, import_react41.useCallback)(
7108
+ const dfHttpClient = (0, import_react42.useCallback)(
6829
7109
  ({ action, data, etag: etag2 }) => {
6830
7110
  const { url, method = "POST" } = action;
6831
7111
  return httpClient(url != null ? url : "", {
@@ -6875,17 +7155,17 @@ var DynamicFlowComponent = ({
6875
7155
  dispatchEventAndComplete(__spreadValues(__spreadValues({}, exitResult), actionResult));
6876
7156
  };
6877
7157
  const debouncedRefresh = useDebouncedRefresh(performRefresh);
6878
- const dispatchEventAndComplete = (0, import_react41.useCallback)(
7158
+ const dispatchEventAndComplete = (0, import_react42.useCallback)(
6879
7159
  (result) => {
6880
7160
  dispatchEvent("Dynamic Flow - Flow Finished", { result: "success" });
6881
7161
  onCompletion(result);
6882
7162
  },
6883
7163
  [onCompletion, dispatchEvent]
6884
7164
  );
6885
- (0, import_react41.useEffect)(() => {
7165
+ (0, import_react42.useEffect)(() => {
6886
7166
  dispatchEvent("Dynamic Flow - Flow Started", {});
6887
7167
  }, []);
6888
- (0, import_react41.useEffect)(() => {
7168
+ (0, import_react42.useEffect)(() => {
6889
7169
  if (!initialStep) {
6890
7170
  const action = __spreadValues({
6891
7171
  id: "#initial-step-request",
@@ -7000,7 +7280,7 @@ var DynamicFlowComponent = ({
7000
7280
  await actionHandler(action);
7001
7281
  }
7002
7282
  };
7003
- return /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(LogProvider, { flowId, stepId: (step == null ? void 0 : step.id) || (step == null ? void 0 : step.key), onLog, children: /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(EventsContextProvider, { metadata: analyticsMetadata, onEvent, children: /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(DynamicFlowProvider, { loading: isLoading, children: /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(HttpClientProvider, { httpClient, children: loader !== null ? loader : /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
7283
+ return /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(LogProvider, { flowId, stepId: (step == null ? void 0 : step.id) || (step == null ? void 0 : step.key), onLog, children: /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(EventsContextProvider, { metadata: analyticsMetadata, onEvent, children: /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(DynamicFlowProvider, { loading: isLoading, children: /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(HttpClientProvider, { httpClient, children: loader !== null ? loader : /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
7004
7284
  DynamicFlowStep,
7005
7285
  {
7006
7286
  step,
@@ -7016,7 +7296,7 @@ var DynamicFlowComponent = ({
7016
7296
  }
7017
7297
  ) }) }) }) });
7018
7298
  };
7019
- var DynamicFlow = (props) => /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(ErrorBoundary_default, { onError: props.onError, children: /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(DynamicFlowComponent, __spreadValues({}, props)) });
7299
+ var DynamicFlow = (props) => /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(ErrorBoundary_default, { onError: props.onError, children: /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(DynamicFlowComponent, __spreadValues({}, props)) });
7020
7300
  var DynamicFlow_default = DynamicFlow;
7021
7301
  var combineModels2 = (formModels) => {
7022
7302
  return Object.values(formModels).reduce((previous, model) => __spreadValues(__spreadValues({}, previous), model), {});
@@ -7034,19 +7314,19 @@ var shouldTriggerRefresh = (props) => {
7034
7314
  };
7035
7315
 
7036
7316
  // src/jsonSchemaForm/JsonSchemaForm.tsx
7037
- var import_jsx_runtime69 = require("react/jsx-runtime");
7317
+ var import_jsx_runtime70 = require("react/jsx-runtime");
7038
7318
  var JsonSchemaForm = (props) => {
7039
7319
  const schemaProps = __spreadValues({
7040
7320
  model: null,
7041
7321
  errors: null
7042
7322
  }, props);
7043
7323
  const { baseUrl = "", onEvent = noop7, onLog = noop7 } = props;
7044
- return /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(LogProvider, { flowId: "JsonSchemaForm", stepId: "JsonSchemaForm", onLog, children: /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
7324
+ return /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(LogProvider, { flowId: "JsonSchemaForm", stepId: "JsonSchemaForm", onLog, children: /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(
7045
7325
  EventsContextProvider,
7046
7326
  {
7047
7327
  metadata: { flowId: "JsonSchemaForm", stepId: "JsonSchemaForm" },
7048
7328
  onEvent,
7049
- children: /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(HttpClientProviderFromBaseUrl, { baseUrl, children: /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(GenericSchema_default, __spreadValues({}, schemaProps)) })
7329
+ children: /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(HttpClientProviderFromBaseUrl, { baseUrl, children: /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(GenericSchema_default, __spreadValues({}, schemaProps)) })
7050
7330
  }
7051
7331
  ) });
7052
7332
  };
@@ -7114,6 +7394,8 @@ var en_default = {
7114
7394
  "dynamicFlows.CameraCapture.reviewInstructions": "Is your picture clear, readable and complete?",
7115
7395
  "dynamicFlows.CameraCapture.reviewRetry": "No, try again",
7116
7396
  "dynamicFlows.CameraCapture.reviewSubmit": "Yes, submit",
7397
+ "dynamicFlows.CameraCapture.rotatePhone.imgAlt": "Rotate your phone icon",
7398
+ "dynamicFlows.CameraCapture.rotatePhone.text": "Rotate your phone to portrait view to take a photo",
7117
7399
  "dynamicFlows.ControlFeedback.maxLength": "Please enter {maxLength} or fewer characters.",
7118
7400
  "dynamicFlows.ControlFeedback.maximum": "Please enter a number that's {maximum} or less.",
7119
7401
  "dynamicFlows.ControlFeedback.maximumDate": "Please enter a date that's on or before {maximum}.",
@@ -7237,7 +7519,7 @@ var hu_default = {
7237
7519
  "dynamicFlows.ArraySchema.editItem": "Ment\xE9s",
7238
7520
  "dynamicFlows.ArraySchema.maxItemsError": "K\xE9r\xFCnk, {maxItems} vagy ann\xE1l kevesebb t\xE9telt adj meg.",
7239
7521
  "dynamicFlows.ArraySchema.minItemsError": "K\xE9r\xFCnk, legal\xE1bb {minItems} t\xE9telt adj meg.",
7240
- "dynamicFlows.ArraySchema.removeItem": "Elt\xE1vol\xEDt\xE1sra",
7522
+ "dynamicFlows.ArraySchema.removeItem": "Elt\xE1vol\xEDt\xE1s",
7241
7523
  "dynamicFlows.CameraCapture.CameraNotSupported.paragraph": "Az \xE1ltalad haszn\xE1lt b\xF6ng\xE9sz\u0151 nem t\xE1mogatja a kamera haszn\xE1lat\xE1t. K\xE9r\xFCnk, pr\xF3b\xE1lkozz m\xE1s b\xF6ng\xE9sz\u0151vel, eszk\xF6zzel vagy t\xF6ltsd le az appot",
7242
7524
  "dynamicFlows.CameraCapture.CameraNotSupported.title": "Kamera nem t\xE1mogatott",
7243
7525
  "dynamicFlows.CameraCapture.NoCameraAccess.action": "Kamer\xE1hoz val\xF3 hozz\xE1f\xE9r\xE9s enged\xE9lyez\xE9se",
@@ -7787,4 +8069,11 @@ classnames/index.js:
7787
8069
  Licensed under the MIT License (MIT), see
7788
8070
  http://jedwatson.github.io/classnames
7789
8071
  *)
8072
+
8073
+ screenfull/dist/screenfull.js:
8074
+ (*!
8075
+ * screenfull
8076
+ * v5.2.0 - 2021-11-03
8077
+ * (c) Sindre Sorhus; MIT License
8078
+ *)
7790
8079
  */