idmission-web-sdk 2.3.34 → 2.3.36

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/dist/sdk2.esm.js CHANGED
@@ -204,7 +204,7 @@ typeof SuppressedError === "function" ? SuppressedError : function (error, suppr
204
204
  return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
205
205
  };
206
206
 
207
- var webSdkVersion = '2.3.34';
207
+ var webSdkVersion = '2.3.36';
208
208
 
209
209
  function getPlatform() {
210
210
  // eslint-disable-next-line @typescript-eslint/ban-ts-comment
@@ -475,7 +475,7 @@ var OverlayInner$2 = styled.div(templateObject_2$D || (templateObject_2$D = __ma
475
475
  var OverlayImageContainer = styled.div(templateObject_3$r || (templateObject_3$r = __makeTemplateObject(["\n position: relative;\n display: flex;\n flex-grow: 1;\n padding-bottom: 25px;\n overflow: hidden;\n\n & > img,\n & > svg {\n margin: 0 auto;\n width: max-content;\n max-width: 100%;\n max-height: 100%;\n aspect-ratio: initial;\n object-fit: contain;\n display: block;\n }\n"], ["\n position: relative;\n display: flex;\n flex-grow: 1;\n padding-bottom: 25px;\n overflow: hidden;\n\n & > img,\n & > svg {\n margin: 0 auto;\n width: max-content;\n max-width: 100%;\n max-height: 100%;\n aspect-ratio: initial;\n object-fit: contain;\n display: block;\n }\n"])));
476
476
  var OverlayImageRow = styled.div(templateObject_4$l || (templateObject_4$l = __makeTemplateObject(["\n display: flex;\n margin: auto;\n\n & > div {\n max-height: calc(100% - 320px);\n\n & > img {\n width: 100%;\n max-height: 100%;\n height: auto;\n object-fit: contain;\n }\n }\n"], ["\n display: flex;\n margin: auto;\n\n & > div {\n max-height: calc(100% - 320px);\n\n & > img {\n width: 100%;\n max-height: 100%;\n height: auto;\n object-fit: contain;\n }\n }\n"])));
477
477
  var GrayOverlayContainer = styled(OverlayContainer)(templateObject_5$e || (templateObject_5$e = __makeTemplateObject(["\n background: #f7f6fb;\n"], ["\n background: #f7f6fb;\n"])));
478
- var ButtonsColumn = styled.div(templateObject_6$9 || (templateObject_6$9 = __makeTemplateObject(["\n display: flex;\n flex-direction: column;\n gap: 15px 0;\n justify-content: center;\n margin-top: 24px;\n"], ["\n display: flex;\n flex-direction: column;\n gap: 15px 0;\n justify-content: center;\n margin-top: 24px;\n"])));
478
+ var ButtonsColumn = styled.div(templateObject_6$a || (templateObject_6$a = __makeTemplateObject(["\n display: flex;\n flex-direction: column;\n gap: 15px 0;\n justify-content: center;\n margin-top: 24px;\n"], ["\n display: flex;\n flex-direction: column;\n gap: 15px 0;\n justify-content: center;\n margin-top: 24px;\n"])));
479
479
  var WideButton = styled(LoaderButton)(templateObject_7$6 || (templateObject_7$6 = __makeTemplateObject(["\n width: 100%;\n border-radius: 30px;\n"], ["\n width: 100%;\n border-radius: 30px;\n"])));
480
480
  var WideBorderButton = styled(WideButton)(templateObject_8$4 || (templateObject_8$4 = __makeTemplateObject(["\n color: ", ";\n background: ", ";\n border: 1px solid\n ", ";\n box-sizing: border-box;\n"], ["\n color: ", ";\n background: ", ";\n border: 1px solid\n ", ";\n box-sizing: border-box;\n"])), function (props) {
481
481
  var _a, _b;
@@ -514,7 +514,7 @@ var LoadingOverlayLoadingListItem = styled.li(templateObject_19 || (templateObje
514
514
  var LoadingOverlayProgressContainer = styled.div(templateObject_20 || (templateObject_20 = __makeTemplateObject(["\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n"], ["\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n"])));
515
515
  var LoadingOverlayCustomLoadingGraphic = styled.img(templateObject_21 || (templateObject_21 = __makeTemplateObject(["\n transform-style: preserve-3d;\n"], ["\n transform-style: preserve-3d;\n"])));
516
516
  var LoadingOverlayContinueButtonContainer = styled.div(templateObject_22 || (templateObject_22 = __makeTemplateObject(["\n display: flex;\n"], ["\n display: flex;\n"])));
517
- var templateObject_1$M, templateObject_2$D, templateObject_3$r, templateObject_4$l, templateObject_5$e, templateObject_6$9, templateObject_7$6, templateObject_8$4, templateObject_9$3, templateObject_10$1, templateObject_11$1, templateObject_12$1, templateObject_13$1, templateObject_14, templateObject_15, templateObject_16, templateObject_17, templateObject_18, templateObject_19, templateObject_20, templateObject_21, templateObject_22;
517
+ var templateObject_1$M, templateObject_2$D, templateObject_3$r, templateObject_4$l, templateObject_5$e, templateObject_6$a, templateObject_7$6, templateObject_8$4, templateObject_9$3, templateObject_10$1, templateObject_11$1, templateObject_12$1, templateObject_13$1, templateObject_14, templateObject_15, templateObject_16, templateObject_17, templateObject_18, templateObject_19, templateObject_20, templateObject_21, templateObject_22;
518
518
 
519
519
  var GeolocationAccessDeniedOverlay = function GeolocationAccessDeniedOverlay(_a) {
520
520
  var accessBlockedImageUrl = _a.accessBlockedImageUrl;
@@ -7582,7 +7582,7 @@ var ButtonsRow$1 = styled(LoadingOverlayButtonsRow)(templateObject_5$c || (templ
7582
7582
  var _a, _b, _c, _d, _e, _f;
7583
7583
  return ((_c = (_b = (_a = props.theme) === null || _a === void 0 ? void 0 : _a.idCapture) === null || _b === void 0 ? void 0 : _b.loadingOverlay) === null || _c === void 0 ? void 0 : _c.progressBarFontSize) ? "font-size: ".concat((_f = (_e = (_d = props.theme) === null || _d === void 0 ? void 0 : _d.idCapture) === null || _e === void 0 ? void 0 : _e.loadingOverlay) === null || _f === void 0 ? void 0 : _f.progressBarFontSize, ";") : '';
7584
7584
  });
7585
- var ProgressBarBackground$1 = styled(LoadingOverlayProgressBarBackground)(templateObject_6$8 || (templateObject_6$8 = __makeTemplateObject(["\n background: ", ";\n opacity: ", ";\n"], ["\n background: ", ";\n opacity: ", ";\n"])), function (props) {
7585
+ var ProgressBarBackground$1 = styled(LoadingOverlayProgressBarBackground)(templateObject_6$9 || (templateObject_6$9 = __makeTemplateObject(["\n background: ", ";\n opacity: ", ";\n"], ["\n background: ", ";\n opacity: ", ";\n"])), function (props) {
7586
7586
  var _a, _b, _c, _d;
7587
7587
  return (_d = (_c = (_b = (_a = props.theme) === null || _a === void 0 ? void 0 : _a.idCapture) === null || _b === void 0 ? void 0 : _b.loadingOverlay) === null || _c === void 0 ? void 0 : _c.progressBarBackgroundColor) !== null && _d !== void 0 ? _d : 'var(--idm-color-positive-600)';
7588
7588
  }, function (props) {
@@ -7612,7 +7612,7 @@ var ContinueButton$1 = styled(LoaderButton)(templateObject_8$3 || (templateObjec
7612
7612
  var _a, _b, _c, _d;
7613
7613
  return (_d = (_c = (_b = (_a = props.theme) === null || _a === void 0 ? void 0 : _a.idCapture) === null || _b === void 0 ? void 0 : _b.loadingOverlay) === null || _c === void 0 ? void 0 : _c.continueBtnDisabledBorder) !== null && _d !== void 0 ? _d : 'none';
7614
7614
  });
7615
- var templateObject_1$E, templateObject_2$x, templateObject_3$m, templateObject_4$g, templateObject_5$c, templateObject_6$8, templateObject_7$5, templateObject_8$3;
7615
+ var templateObject_1$E, templateObject_2$x, templateObject_3$m, templateObject_4$g, templateObject_5$c, templateObject_6$9, templateObject_7$5, templateObject_8$3;
7616
7616
 
7617
7617
  var ContinuityCameraCheckboxContainer = styled.div(templateObject_1$D || (templateObject_1$D = __makeTemplateObject(["\n margin-top: 15px;\n margin-bottom: 15px;\n"], ["\n margin-top: 15px;\n margin-bottom: 15px;\n"])));
7618
7618
  var ContinuityCameraCheckbox = styled.input(templateObject_2$w || (templateObject_2$w = __makeTemplateObject(["\n margin-right: 8px;\n"], ["\n margin-right: 8px;\n"])));
@@ -7863,8 +7863,8 @@ var ImagesContainer = styled(OverlayImageContainer)(templateObject_2$u || (templ
7863
7863
  var ImageRow = styled(OverlayImageRow)(templateObject_3$l || (templateObject_3$l = __makeTemplateObject(["\n max-width: 100%;\n flex-direction: column;\n position: relative;\n width: 100%;\n"], ["\n max-width: 100%;\n flex-direction: column;\n position: relative;\n width: 100%;\n"])));
7864
7864
  var ImageCol$1 = styled.div(templateObject_4$f || (templateObject_4$f = __makeTemplateObject(["\n width: 450px;\n max-width: 100%;\n max-height: none !important;\n"], ["\n width: 450px;\n max-width: 100%;\n max-height: none !important;\n"])));
7865
7865
  var StyledImage = styled(CapturedDocumentImg)(templateObject_5$b || (templateObject_5$b = __makeTemplateObject(["\n width: 100%;\n border-radius: 12px;\n"], ["\n width: 100%;\n border-radius: 12px;\n"])));
7866
- var DebugPre = styled.pre(templateObject_6$7 || (templateObject_6$7 = __makeTemplateObject(["\n display: block;\n text-align: left;\n width: 100%;\n max-width: 100%;\n overflow-x: auto;\n"], ["\n display: block;\n text-align: left;\n width: 100%;\n max-width: 100%;\n overflow-x: auto;\n"])));
7867
- var templateObject_1$B, templateObject_2$u, templateObject_3$l, templateObject_4$f, templateObject_5$b, templateObject_6$7;
7866
+ var DebugPre = styled.pre(templateObject_6$8 || (templateObject_6$8 = __makeTemplateObject(["\n display: block;\n text-align: left;\n width: 100%;\n max-width: 100%;\n overflow-x: auto;\n"], ["\n display: block;\n text-align: left;\n width: 100%;\n max-width: 100%;\n overflow-x: auto;\n"])));
7867
+ var templateObject_1$B, templateObject_2$u, templateObject_3$l, templateObject_4$f, templateObject_5$b, templateObject_6$8;
7868
7868
 
7869
7869
  function useShowSuccessScreen(skipSuccessScreen, successScreenReady, onDoneCallback) {
7870
7870
  var _this = this;
@@ -7963,15 +7963,12 @@ function IdCardBorder(_a) {
7963
7963
  var progressBarIndicatorColor = (_o = (_m = (_l = theme.idCapture) === null || _l === void 0 ? void 0 : _l.guideBox) === null || _m === void 0 ? void 0 : _m.progressBarIndicatorColor) !== null && _o !== void 0 ? _o : '#287ec6';
7964
7964
  var progressBarWidth = (_r = (_q = (_p = theme.idCapture) === null || _p === void 0 ? void 0 : _p.guideBox) === null || _q === void 0 ? void 0 : _q.progressBarWidth) !== null && _r !== void 0 ? _r : borderWidth;
7965
7965
  return /*#__PURE__*/React__default.createElement(IdCardBorderContainer, _assign({}, props, {
7966
- style: {
7966
+ style: _assign(_assign({}, props.style), {
7967
7967
  aspectRatio: aspectRatio
7968
- }
7969
- }), /*#__PURE__*/React__default.createElement("div", {
7968
+ })
7969
+ }), /*#__PURE__*/React__default.createElement(IdCardBorderInner, {
7970
7970
  ref: ref,
7971
7971
  style: {
7972
- maxHeight: '100%',
7973
- maxWidth: '100%',
7974
- display: 'flex',
7975
7972
  aspectRatio: aspectRatio
7976
7973
  }
7977
7974
  }, children), status === 'ready' && !wavesDisabled && ( /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(IdCardBorderSvg, {
@@ -8034,6 +8031,7 @@ function IdCardBorderSvg(_a) {
8034
8031
  totalLength = _f[0],
8035
8032
  setTotalLength = _f[1];
8036
8033
  var resolvedProgress = progress * totalLength;
8034
+ var scaledBorderRadius = borderRadius * (typeof props.height === 'number' ? props.height / 500 : 1);
8037
8035
  var rectRef = function rectRef(r) {
8038
8036
  try {
8039
8037
  if (isProgressBar && r) setTotalLength(r.getTotalLength());
@@ -8052,16 +8050,16 @@ function IdCardBorderSvg(_a) {
8052
8050
  y: "0",
8053
8051
  width: props.width || '100%',
8054
8052
  height: props.height || '100%',
8055
- rx: borderRadius,
8056
- ry: borderRadius
8053
+ rx: scaledBorderRadius,
8054
+ ry: scaledBorderRadius
8057
8055
  }))), /*#__PURE__*/React__default.createElement(IdCardBorderRect, {
8058
8056
  ref: rectRef,
8059
8057
  x: "0",
8060
8058
  y: "0",
8061
8059
  width: props.width || '100%',
8062
8060
  height: props.height || '100%',
8063
- rx: borderRadius,
8064
- ry: borderRadius,
8061
+ rx: scaledBorderRadius,
8062
+ ry: scaledBorderRadius,
8065
8063
  clipPath: "url(#round-corner)",
8066
8064
  stroke: borderColor,
8067
8065
  strokeWidth: borderWidth,
@@ -8071,16 +8069,17 @@ function IdCardBorderSvg(_a) {
8071
8069
  className: isProgressBar ? "idmSdkProgressBorder ".concat(progressPaused ? 'idmSdkProgressPaused' : '') : ''
8072
8070
  }));
8073
8071
  }
8074
- var IdCardBorderContainer = styled.div(templateObject_3$k || (templateObject_3$k = __makeTemplateObject(["\n max-width: 100%;\n max-height: 100%;\n\n & > .idmSdkWaves {\n position: absolute;\n animation: ", " 2s ease-out infinite;\n transform-style: preserve-3d;\n\n &:nth-child(2) {\n animation-delay: 0.66s;\n }\n\n &:nth-child(3) {\n animation-delay: 1.33s;\n }\n }\n"], ["\n max-width: 100%;\n max-height: 100%;\n\n & > .idmSdkWaves {\n position: absolute;\n animation: ", " 2s ease-out infinite;\n transform-style: preserve-3d;\n\n &:nth-child(2) {\n animation-delay: 0.66s;\n }\n\n &:nth-child(3) {\n animation-delay: 1.33s;\n }\n }\n"])), wavesAnimation);
8075
- var SvgOverlay = styled.svg(templateObject_4$e || (templateObject_4$e = __makeTemplateObject(["\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n pointer-events: none;\n"], ["\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n pointer-events: none;\n"])));
8076
- var IdCardBorderRect = styled.rect(templateObject_5$a || (templateObject_5$a = __makeTemplateObject(["\n &.idmSdkProgressBorder {\n animation: ", " ", "\n ", ";\n }\n\n &.idmSdkProgressPaused {\n animation-play-state: paused;\n }\n"], ["\n &.idmSdkProgressBorder {\n animation: ", " ", "\n ", ";\n }\n\n &.idmSdkProgressPaused {\n animation-play-state: paused;\n }\n"])), progressBorderAnimation, function (props) {
8072
+ var IdCardBorderContainer = styled.div(templateObject_3$k || (templateObject_3$k = __makeTemplateObject(["\n width: 100%;\n height: 100%;\n max-width: 100%;\n max-height: 100%;\n\n & > .idmSdkWaves {\n position: absolute;\n animation: ", " 2s ease-out infinite;\n transform-style: preserve-3d;\n\n &:nth-child(2) {\n animation-delay: 0.66s;\n }\n\n &:nth-child(3) {\n animation-delay: 1.33s;\n }\n }\n"], ["\n width: 100%;\n height: 100%;\n max-width: 100%;\n max-height: 100%;\n\n & > .idmSdkWaves {\n position: absolute;\n animation: ", " 2s ease-out infinite;\n transform-style: preserve-3d;\n\n &:nth-child(2) {\n animation-delay: 0.66s;\n }\n\n &:nth-child(3) {\n animation-delay: 1.33s;\n }\n }\n"])), wavesAnimation);
8073
+ var IdCardBorderInner = styled.div(templateObject_4$e || (templateObject_4$e = __makeTemplateObject(["\n max-height: 100%;\n max-width: 100%;\n display: flex;\n align-items: center;\n justify-content: center;\n"], ["\n max-height: 100%;\n max-width: 100%;\n display: flex;\n align-items: center;\n justify-content: center;\n"])));
8074
+ var SvgOverlay = styled.svg(templateObject_5$a || (templateObject_5$a = __makeTemplateObject(["\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n pointer-events: none;\n"], ["\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n pointer-events: none;\n"])));
8075
+ var IdCardBorderRect = styled.rect(templateObject_6$7 || (templateObject_6$7 = __makeTemplateObject(["\n &.idmSdkProgressBorder {\n animation: ", " ", "\n ", ";\n }\n\n &.idmSdkProgressPaused {\n animation-play-state: paused;\n }\n"], ["\n &.idmSdkProgressBorder {\n animation: ", " ", "\n ", ";\n }\n\n &.idmSdkProgressPaused {\n animation-play-state: paused;\n }\n"])), progressBorderAnimation, function (props) {
8077
8076
  var _a;
8078
8077
  return (_a = props.$speed) !== null && _a !== void 0 ? _a : '3s';
8079
8078
  }, function (props) {
8080
8079
  var _a;
8081
8080
  return (_a = props.$fillMode) !== null && _a !== void 0 ? _a : 'forwards';
8082
8081
  });
8083
- var templateObject_1$A, templateObject_2$t, templateObject_3$k, templateObject_4$e, templateObject_5$a;
8082
+ var templateObject_1$A, templateObject_2$t, templateObject_3$k, templateObject_4$e, templateObject_5$a, templateObject_6$7;
8084
8083
 
8085
8084
  var defaultIdCaptureGuideImages = {
8086
8085
  portrait: {
@@ -8263,6 +8262,53 @@ var FlipImageContainer = styled(IdCardGuideImageContainer)(templateObject_1$z ||
8263
8262
  });
8264
8263
  var templateObject_1$z;
8265
8264
 
8265
+ var GuideOrientationContext = /*#__PURE__*/createContext({
8266
+ orientation: 'landscape',
8267
+ wrapperWidth: 1,
8268
+ wrapperHeight: 1,
8269
+ wrapperAspectRatio: 0,
8270
+ imageAspectRatio: 0,
8271
+ wrapperRef: null,
8272
+ setImageAspectRatio: function setImageAspectRatio() {
8273
+ return null;
8274
+ }
8275
+ });
8276
+ function GuideOrientationContextProvider(_a) {
8277
+ var children = _a.children;
8278
+ var _b = useState(1),
8279
+ imageAspectRatio = _b[0],
8280
+ setImageAspectRatio = _b[1];
8281
+ var _c = useResizeObserver(),
8282
+ wrapperRef = _c.ref,
8283
+ _d = _c.width,
8284
+ wrapperWidth = _d === void 0 ? 1 : _d,
8285
+ _e = _c.height,
8286
+ wrapperHeight = _e === void 0 ? 1 : _e;
8287
+ var wrapperAspectRatio = useMemo(function () {
8288
+ return wrapperWidth / wrapperHeight;
8289
+ }, [wrapperHeight, wrapperWidth]);
8290
+ var orientation = 'landscape'; //width > height ? 'landscape' : 'portrait'
8291
+ var value = useMemo(function () {
8292
+ return {
8293
+ orientation: orientation,
8294
+ wrapperWidth: wrapperWidth,
8295
+ wrapperHeight: wrapperHeight,
8296
+ wrapperAspectRatio: wrapperAspectRatio,
8297
+ imageAspectRatio: imageAspectRatio,
8298
+ setImageAspectRatio: setImageAspectRatio,
8299
+ wrapperRef: wrapperRef
8300
+ };
8301
+ }, [imageAspectRatio, wrapperAspectRatio, wrapperHeight, wrapperRef, wrapperWidth]);
8302
+ return /*#__PURE__*/React__default.createElement(GuideOrientationContext.Provider, {
8303
+ value: value
8304
+ }, children);
8305
+ }
8306
+ function useGuideOrientationContext() {
8307
+ var ctx = useContext(GuideOrientationContext);
8308
+ if (!ctx) throw new Error('useGuideOrientationContext cannot be used without GuideOrientationContextProvider');
8309
+ return ctx;
8310
+ }
8311
+
8266
8312
  var FlipIdPrompt = function FlipIdPrompt(_a) {
8267
8313
  var _b = _a.images,
8268
8314
  images = _b === void 0 ? defaultIdCaptureGuideImages : _b,
@@ -8280,6 +8326,7 @@ var FlipIdPrompt = function FlipIdPrompt(_a) {
8280
8326
  portraitGuidesOnMobile = _g === void 0 ? true : _g,
8281
8327
  _h = _a.classNames,
8282
8328
  classNames = _h === void 0 ? {} : _h;
8329
+ var imageAspectRatio = useGuideOrientationContext().imageAspectRatio;
8283
8330
  var orientation = getOrientation(portraitGuidesOnMobile);
8284
8331
  var _j = useState(1),
8285
8332
  transitionTime = _j[0],
@@ -8316,6 +8363,7 @@ var FlipIdPrompt = function FlipIdPrompt(_a) {
8316
8363
  borderRadius: borderRadius,
8317
8364
  "$transforms": frontTransforms.join(' '),
8318
8365
  "$transitionTime": transitionTime,
8366
+ aspectRatio: imageAspectRatio,
8319
8367
  "$isVisible": true
8320
8368
  }, /*#__PURE__*/React__default.createElement(IdCardGuideImage, {
8321
8369
  alt: "",
@@ -8331,6 +8379,7 @@ var FlipIdPrompt = function FlipIdPrompt(_a) {
8331
8379
  borderRadius: borderRadius,
8332
8380
  "$transforms": backTransforms.join(' '),
8333
8381
  "$transitionTime": transitionTime,
8382
+ aspectRatio: imageAspectRatio,
8334
8383
  "$isVisible": true
8335
8384
  }, /*#__PURE__*/React__default.createElement(IdCardGuideImage, {
8336
8385
  alt: "",
@@ -8341,53 +8390,6 @@ var FlipIdPrompt = function FlipIdPrompt(_a) {
8341
8390
  })));
8342
8391
  };
8343
8392
 
8344
- var GuideOrientationContext = /*#__PURE__*/createContext({
8345
- orientation: 'landscape',
8346
- wrapperWidth: 1,
8347
- wrapperHeight: 1,
8348
- wrapperAspectRatio: 0,
8349
- imageAspectRatio: 0,
8350
- wrapperRef: null,
8351
- setImageAspectRatio: function setImageAspectRatio() {
8352
- return null;
8353
- }
8354
- });
8355
- function GuideOrientationContextProvider(_a) {
8356
- var children = _a.children;
8357
- var _b = useState(1),
8358
- imageAspectRatio = _b[0],
8359
- setImageAspectRatio = _b[1];
8360
- var _c = useResizeObserver(),
8361
- wrapperRef = _c.ref,
8362
- _d = _c.width,
8363
- wrapperWidth = _d === void 0 ? 1 : _d,
8364
- _e = _c.height,
8365
- wrapperHeight = _e === void 0 ? 1 : _e;
8366
- var wrapperAspectRatio = useMemo(function () {
8367
- return wrapperWidth / wrapperHeight;
8368
- }, [wrapperHeight, wrapperWidth]);
8369
- var orientation = 'landscape'; //width > height ? 'landscape' : 'portrait'
8370
- var value = useMemo(function () {
8371
- return {
8372
- orientation: orientation,
8373
- wrapperWidth: wrapperWidth,
8374
- wrapperHeight: wrapperHeight,
8375
- wrapperAspectRatio: wrapperAspectRatio,
8376
- imageAspectRatio: imageAspectRatio,
8377
- setImageAspectRatio: setImageAspectRatio,
8378
- wrapperRef: wrapperRef
8379
- };
8380
- }, [imageAspectRatio, wrapperAspectRatio, wrapperHeight, wrapperRef, wrapperWidth]);
8381
- return /*#__PURE__*/React__default.createElement(GuideOrientationContext.Provider, {
8382
- value: value
8383
- }, children);
8384
- }
8385
- function useGuideOrientationContext() {
8386
- var ctx = useContext(GuideOrientationContext);
8387
- if (!ctx) throw new Error('useGuideOrientationContext cannot be used without GuideOrientationContextProvider');
8388
- return ctx;
8389
- }
8390
-
8391
8393
  var IdCaptureGuideOverlay = function IdCaptureGuideOverlay(_a) {
8392
8394
  var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r;
8393
8395
  var _s = _a.classNames,
@@ -8439,8 +8441,10 @@ var IdCaptureGuideOverlay = function IdCaptureGuideOverlay(_a) {
8439
8441
  var currentImage = images[orientation][requestedAction === 'FLIP_ID' ? 'SHOW_ID_FRONT' : requestedAction];
8440
8442
  var imagePadding = userSuppliedImagePadding !== null && userSuppliedImagePadding !== void 0 ? userSuppliedImagePadding : isMobile() ? (_o = (_m = (_l = theme.idCapture) === null || _l === void 0 ? void 0 : _l.guideBox) === null || _m === void 0 ? void 0 : _m.mobileImagePadding) !== null && _o !== void 0 ? _o : 0 : (_r = (_q = (_p = theme.idCapture) === null || _p === void 0 ? void 0 : _p.guideBox) === null || _q === void 0 ? void 0 : _q.imagePadding) !== null && _r !== void 0 ? _r : 50;
8441
8443
  var centerRegionMinWidth = imageAspectRatio >= wrapperAspectRatio ? wrapperWidth - paddingAndBorderPx : undefined;
8442
- function onImageLoaded() {
8444
+ useEffect(function () {
8443
8445
  setImageAspectRatio(currentImage.width / currentImage.height);
8446
+ }, [currentImage.height, currentImage.width, setImageAspectRatio]);
8447
+ function onImageLoaded() {
8444
8448
  dispatchIdCaptureAction({
8445
8449
  type: 'guideImageLoaded',
8446
8450
  payload: {
@@ -8506,8 +8510,8 @@ var IdCaptureGuideOverlay = function IdCaptureGuideOverlay(_a) {
8506
8510
  portraitGuidesOnMobile: portraitGuidesOnMobile,
8507
8511
  isMirrored: isMirrored,
8508
8512
  classNames: classNames.flipIdPrompt,
8509
- width: currentImage.width,
8510
- height: currentImage.height
8513
+ width: innerWidth,
8514
+ height: innerHeight
8511
8515
  }))))), /*#__PURE__*/React__default.createElement(Spacer, {
8512
8516
  "$maskColor": maskColor,
8513
8517
  "$minWidth": padding,